From: Andrea Amorese Date: Thu, 25 Nov 2021 09:35:20 +0000 (+0100) Subject: Built motion from commit 53978783.|2.5.39 X-Git-Url: http://repos.xcallymotion.com/base//%22api/fax/attachments/%7B%7BfaxAttachment.id%7D%7D/%22?a=commitdiff_plain;h=8f1e5b8e3ef90a951371620736d3392ddeeb5040;p=motion2.git Built motion from commit 53978783.|2.5.39 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index d81f83a..d18c0ca 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-11-24T15:31:57.052Z", + "time": "2021-11-25T09:21:10.797Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 055b9aa..84f4a8f 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-24T15:31:57.052Z", + "time": "2021-11-25T09:21:10.797Z", "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 17baaf3..bd628e5 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 _0x59b0=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','urlForward'];(function(_0x3f6565,_0x12a8bb){var _0x4abd23=function(_0x56dce7){while(--_0x56dce7){_0x3f6565['push'](_0x3f6565['shift']());}};_0x4abd23(++_0x12a8bb);}(_0x59b0,0x188));var _0x059b=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x59b0[_0x4314d7];return _0x5c599b;};'use strict';var Sequelize=require(_0x059b('0x0'));module['exports']={'name':{'type':Sequelize[_0x059b('0x1')],'get':function(_0x517c2c){return this[_0x059b('0x2')](_0x059b('0x3'));}},'action':{'type':Sequelize[_0x059b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x059b('0x5'),'integration',_0x059b('0x6'),'jscripty',_0x059b('0x7'),_0x059b('0x8'),_0x059b('0x9'),_0x059b('0xa')]],'msg':_0x059b('0xb')}},'comment':_0x059b('0xb')},'data1':{'type':Sequelize[_0x059b('0x4')](0x1000),'comment':_0x059b('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x059b('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x059b('0xe')},'data4':{'type':Sequelize[_0x059b('0x4')](0x1000),'comments':_0x059b('0xf')},'data5':{'type':Sequelize[_0x059b('0x4')](0x1000),'comments':_0x059b('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x059b('0x11')},'data7':{'type':Sequelize[_0x059b('0x12')],'comments':_0x059b('0x13')}}; \ No newline at end of file +var _0x54b2=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x54b2,0x6e));var _0x254b=function(_0x450dd0,_0x29c7aa){_0x450dd0=_0x450dd0-0x0;var _0x3b8712=_0x54b2[_0x450dd0];return _0x3b8712;};'use strict';var Sequelize=require(_0x254b('0x0'));module['exports']={'name':{'type':Sequelize[_0x254b('0x1')],'get':function(_0x418dfa){return this[_0x254b('0x2')](_0x254b('0x3'));}},'action':{'type':Sequelize[_0x254b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x254b('0x5'),_0x254b('0x6'),_0x254b('0x7'),_0x254b('0x8'),_0x254b('0x9'),'bot',_0x254b('0xa')]],'msg':_0x254b('0xb')}},'comment':_0x254b('0xb')},'data1':{'type':Sequelize[_0x254b('0x4')](0x1000),'comment':_0x254b('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x254b('0x4')](0x1000),'comment':_0x254b('0xd')},'data4':{'type':Sequelize[_0x254b('0x4')](0x1000),'comments':_0x254b('0xe')},'data5':{'type':Sequelize[_0x254b('0x4')](0x1000),'comments':_0x254b('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x254b('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x254b('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index d71bb5f..ca5a1d0 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 _0x3bf1=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','find','params','Action','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5073fe,_0x278fdf){var _0x7e7638=function(_0x364f81){while(--_0x364f81){_0x5073fe['push'](_0x5073fe['shift']());}};_0x7e7638(++_0x278fdf);}(_0x3bf1,0x17c));var _0x13bf=function(_0x42ce2b,_0xa55246){_0x42ce2b=_0x42ce2b-0x0;var _0x4fe361=_0x3bf1[_0x42ce2b];return _0x4fe361;};'use strict';var emlformat=require(_0x13bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13bf('0x2'));var moment=require(_0x13bf('0x3'));var BPromise=require(_0x13bf('0x4'));var Mustache=require(_0x13bf('0x5'));var util=require(_0x13bf('0x6'));var path=require(_0x13bf('0x7'));var sox=require(_0x13bf('0x8'));var csv=require(_0x13bf('0x9'));var ejs=require(_0x13bf('0xa'));var fs=require('fs');var fs_extra=require(_0x13bf('0xb'));var _=require(_0x13bf('0xc'));var squel=require(_0x13bf('0xd'));var crypto=require(_0x13bf('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x13bf('0x9'));var querystring=require(_0x13bf('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x13bf('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x13bf('0x11'));var hardwareService=require(_0x13bf('0x12'));var logger=require(_0x13bf('0x13'))(_0x13bf('0x14'));var utils=require(_0x13bf('0x15'));var config=require(_0x13bf('0x16'));var licenseUtil=require(_0x13bf('0x17'));var db=require(_0x13bf('0x18'))['db'];function respondWithStatusCode(_0x40e34a,_0x21a319){_0x21a319=_0x21a319||0xcc;return function(_0x478857){if(_0x478857){return _0x40e34a[_0x13bf('0x19')](_0x21a319);}return _0x40e34a[_0x13bf('0x1a')](_0x21a319)[_0x13bf('0x1b')]();};}function respondWithResult(_0x3acafb,_0x31ba1a){_0x31ba1a=_0x31ba1a||0xc8;return function(_0x269bc7){if(_0x269bc7){return _0x3acafb[_0x13bf('0x1a')](_0x31ba1a)[_0x13bf('0x1c')](_0x269bc7);}};}function respondWithFilteredResult(_0x7c91e1,_0x371c76){return function(_0x2feaed){if(_0x2feaed){var _0x251150=typeof _0x371c76[_0x13bf('0x1d')]===_0x13bf('0x1e')&&typeof _0x371c76[_0x13bf('0x1f')]===_0x13bf('0x1e');var _0x4b7aec=_0x2feaed[_0x13bf('0x20')];var _0x2d8608=_0x251150?0x0:_0x371c76['offset'];var _0x3e5345=_0x251150?_0x2feaed['count']:_0x371c76[_0x13bf('0x1d')]+_0x371c76['limit'];var _0x3fa61a;if(_0x3e5345>=_0x4b7aec){_0x3e5345=_0x4b7aec;_0x3fa61a=0xc8;}else{_0x3fa61a=0xce;}_0x7c91e1[_0x13bf('0x1a')](_0x3fa61a);return _0x7c91e1[_0x13bf('0x21')](_0x13bf('0x22'),_0x2d8608+'-'+_0x3e5345+'/'+_0x4b7aec)[_0x13bf('0x1c')](_0x2feaed);}return null;};}function patchUpdates(_0x5c4806){return function(_0x205e40){try{jsonpatch[_0x13bf('0x23')](_0x205e40,_0x5c4806,!![]);}catch(_0x29113d){return BPromise[_0x13bf('0x24')](_0x29113d);}return _0x205e40[_0x13bf('0x25')]();};}function saveUpdates(_0x2aaf4e,_0x42967c){return function(_0x54e7d6){if(_0x54e7d6){return _0x54e7d6[_0x13bf('0x26')](_0x2aaf4e)[_0x13bf('0x27')](function(_0x520bd7){return _0x520bd7;});}return null;};}function removeEntity(_0x40ea66,_0x4b9ac4){return function(_0x59f01b){if(_0x59f01b){return _0x59f01b[_0x13bf('0x28')]()[_0x13bf('0x27')](function(){_0x40ea66[_0x13bf('0x1a')](0xcc)[_0x13bf('0x1b')]();});}};}function handleEntityNotFound(_0xc8aed7,_0x13fc2c){return function(_0x336c7c){if(!_0x336c7c){_0xc8aed7[_0x13bf('0x19')](0x194);}return _0x336c7c;};}function handleError(_0x327428,_0x1eb877){_0x1eb877=_0x1eb877||0x1f4;return function(_0x4ce5a8){logger[_0x13bf('0x29')](_0x4ce5a8[_0x13bf('0x2a')]);if(_0x4ce5a8[_0x13bf('0x2b')]){delete _0x4ce5a8['name'];}_0x327428[_0x13bf('0x1a')](_0x1eb877)[_0x13bf('0x2c')](_0x4ce5a8);};}exports[_0x13bf('0x26')]=function(_0x4793dd,_0x4bde79){if(_0x4793dd['body']['id']){delete _0x4793dd[_0x13bf('0x2d')]['id'];}return db['Action'][_0x13bf('0x2e')]({'where':{'id':_0x4793dd[_0x13bf('0x2f')]['id']}})[_0x13bf('0x27')](handleEntityNotFound(_0x4bde79,null))[_0x13bf('0x27')](saveUpdates(_0x4793dd[_0x13bf('0x2d')],null))['then'](respondWithResult(_0x4bde79,null))['catch'](handleError(_0x4bde79,null));};exports['destroy']=function(_0x25a5b1,_0x1b0135){return db[_0x13bf('0x30')][_0x13bf('0x2e')]({'where':{'id':_0x25a5b1[_0x13bf('0x2f')]['id']}})[_0x13bf('0x27')](handleEntityNotFound(_0x1b0135,null))[_0x13bf('0x27')](removeEntity(_0x1b0135,null))[_0x13bf('0x31')](handleError(_0x1b0135,null));}; \ No newline at end of file +var _0xd793=['body','Action','find','params','catch','destroy','rimraf','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x24eaaa,_0x2aa0bc){var _0x25f160=function(_0xfca29f){while(--_0xfca29f){_0x24eaaa['push'](_0x24eaaa['shift']());}};_0x25f160(++_0x2aa0bc);}(_0xd793,0x1f0));var _0x3d79=function(_0x56ef7f,_0x327af8){_0x56ef7f=_0x56ef7f-0x0;var _0x24b910=_0xd793[_0x56ef7f];return _0x24b910;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3d79('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3d79('0x2'));var path=require(_0x3d79('0x3'));var sox=require(_0x3d79('0x4'));var csv=require('to-csv');var ejs=require(_0x3d79('0x5'));var fs=require('fs');var fs_extra=require(_0x3d79('0x6'));var _=require(_0x3d79('0x7'));var squel=require(_0x3d79('0x8'));var crypto=require(_0x3d79('0x9'));var jsforce=require(_0x3d79('0xa'));var deskjs=require(_0x3d79('0xb'));var toCsv=require(_0x3d79('0xc'));var querystring=require(_0x3d79('0xd'));var Papa=require(_0x3d79('0xe'));var Redis=require(_0x3d79('0xf'));var authService=require(_0x3d79('0x10'));var qs=require(_0x3d79('0x11'));var as=require(_0x3d79('0x12'));var hardwareService=require(_0x3d79('0x13'));var logger=require(_0x3d79('0x14'))('api');var utils=require(_0x3d79('0x15'));var config=require(_0x3d79('0x16'));var licenseUtil=require(_0x3d79('0x17'));var db=require(_0x3d79('0x18'))['db'];function respondWithStatusCode(_0x5b8a38,_0x384fd0){_0x384fd0=_0x384fd0||0xcc;return function(_0x196a94){if(_0x196a94){return _0x5b8a38['sendStatus'](_0x384fd0);}return _0x5b8a38[_0x3d79('0x19')](_0x384fd0)[_0x3d79('0x1a')]();};}function respondWithResult(_0x27df7e,_0x1a49c2){_0x1a49c2=_0x1a49c2||0xc8;return function(_0x5d34f4){if(_0x5d34f4){return _0x27df7e['status'](_0x1a49c2)['json'](_0x5d34f4);}};}function respondWithFilteredResult(_0x23dcf5,_0x7d951e){return function(_0x24ce61){if(_0x24ce61){var _0x202a88=typeof _0x7d951e[_0x3d79('0x1b')]==='undefined'&&typeof _0x7d951e[_0x3d79('0x1c')]===_0x3d79('0x1d');var _0x238223=_0x24ce61['count'];var _0xfa9e33=_0x202a88?0x0:_0x7d951e[_0x3d79('0x1b')];var _0x61791d=_0x202a88?_0x24ce61[_0x3d79('0x1e')]:_0x7d951e[_0x3d79('0x1b')]+_0x7d951e[_0x3d79('0x1c')];var _0x3101a0;if(_0x61791d>=_0x238223){_0x61791d=_0x238223;_0x3101a0=0xc8;}else{_0x3101a0=0xce;}_0x23dcf5[_0x3d79('0x19')](_0x3101a0);return _0x23dcf5[_0x3d79('0x1f')](_0x3d79('0x20'),_0xfa9e33+'-'+_0x61791d+'/'+_0x238223)[_0x3d79('0x21')](_0x24ce61);}return null;};}function patchUpdates(_0xf96ee){return function(_0x1b50f0){try{jsonpatch[_0x3d79('0x22')](_0x1b50f0,_0xf96ee,!![]);}catch(_0x526bfe){return BPromise['reject'](_0x526bfe);}return _0x1b50f0[_0x3d79('0x23')]();};}function saveUpdates(_0x5e6b46,_0x18fcaa){return function(_0xc02edf){if(_0xc02edf){return _0xc02edf[_0x3d79('0x24')](_0x5e6b46)[_0x3d79('0x25')](function(_0x4c841a){return _0x4c841a;});}return null;};}function removeEntity(_0x28e487,_0x1388b1){return function(_0x289da4){if(_0x289da4){return _0x289da4['destroy']()[_0x3d79('0x25')](function(){_0x28e487[_0x3d79('0x19')](0xcc)[_0x3d79('0x1a')]();});}};}function handleEntityNotFound(_0xaeec07,_0x1f62c9){return function(_0x218b43){if(!_0x218b43){_0xaeec07[_0x3d79('0x26')](0x194);}return _0x218b43;};}function handleError(_0x5ad36a,_0x220e67){_0x220e67=_0x220e67||0x1f4;return function(_0x5ef5d2){logger[_0x3d79('0x27')](_0x5ef5d2[_0x3d79('0x28')]);if(_0x5ef5d2[_0x3d79('0x29')]){delete _0x5ef5d2[_0x3d79('0x29')];}_0x5ad36a['status'](_0x220e67)[_0x3d79('0x2a')](_0x5ef5d2);};}exports[_0x3d79('0x24')]=function(_0x508bab,_0x20bbb0){if(_0x508bab[_0x3d79('0x2b')]['id']){delete _0x508bab['body']['id'];}return db[_0x3d79('0x2c')][_0x3d79('0x2d')]({'where':{'id':_0x508bab[_0x3d79('0x2e')]['id']}})['then'](handleEntityNotFound(_0x20bbb0,null))['then'](saveUpdates(_0x508bab[_0x3d79('0x2b')],null))['then'](respondWithResult(_0x20bbb0,null))[_0x3d79('0x2f')](handleError(_0x20bbb0,null));};exports[_0x3d79('0x30')]=function(_0x14f0cf,_0x4491c1){return db['Action'][_0x3d79('0x2d')]({'where':{'id':_0x14f0cf[_0x3d79('0x2e')]['id']}})[_0x3d79('0x25')](handleEntityNotFound(_0x4491c1,null))[_0x3d79('0x25')](removeEntity(_0x4491c1,null))[_0x3d79('0x2f')](handleError(_0x4491c1,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ebac93e..ef085a4 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 _0x0b6b=['request-promise','path','rimraf','../../config/environment','exports','define','tools_actions','lodash','../../config/logger','api','moment'];(function(_0x2034e2,_0x3a13b5){var _0x4dca78=function(_0x24f493){while(--_0x24f493){_0x2034e2['push'](_0x2034e2['shift']());}};_0x4dca78(++_0x3a13b5);}(_0x0b6b,0x125));var _0xb0b6=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0x0b6b[_0xb3b452];return _0x238983;};'use strict';var _=require(_0xb0b6('0x0'));var util=require('util');var logger=require(_0xb0b6('0x1'))(_0xb0b6('0x2'));var moment=require(_0xb0b6('0x3'));var BPromise=require('bluebird');var rp=require(_0xb0b6('0x4'));var fs=require('fs');var path=require(_0xb0b6('0x5'));var rimraf=require(_0xb0b6('0x6'));var config=require(_0xb0b6('0x7'));var attributes=require('./action.attributes');module[_0xb0b6('0x8')]=function(_0x43f31d,_0x1477ff){return _0x43f31d[_0xb0b6('0x9')]('Action',attributes,{'tableName':_0xb0b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2405=['Action','lodash','util','api','moment','bluebird','request-promise','rimraf','./action.attributes','exports'];(function(_0x3c1883,_0x34869a){var _0x972f41=function(_0x3777f5){while(--_0x3777f5){_0x3c1883['push'](_0x3c1883['shift']());}};_0x972f41(++_0x34869a);}(_0x2405,0x173));var _0x5240=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x2405[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0x5240('0x0'));var util=require(_0x5240('0x1'));var logger=require('../../config/logger')(_0x5240('0x2'));var moment=require(_0x5240('0x3'));var BPromise=require(_0x5240('0x4'));var rp=require(_0x5240('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5240('0x6'));var config=require('../../config/environment');var attributes=require(_0x5240('0x7'));module[_0x5240('0x8')]=function(_0x2bac60,_0x8d0e5a){return _0x2bac60['define'](_0x5240('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 9e865a9..8564657 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x434ce6,_0x4a1e8d){var _0x3ac61e=function(_0x3cf2b1){while(--_0x3cf2b1){_0x434ce6['push'](_0x434ce6['shift']());}};_0x3ac61e(++_0x4a1e8d);}(_0x326f,0xd1));var _0xf326=function(_0x46e880,_0x1ff896){_0x46e880=_0x46e880-0x0;var _0xef8636=_0x326f[_0x46e880];return _0xef8636;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1690b6,_0x1b6717){var _0x15f107=function(_0x495147){while(--_0x495147){_0x1690b6['push'](_0x1690b6['shift']());}};_0x15f107(++_0x1b6717);}(_0x326f,0xd1));var _0xf326=function(_0x4e5dce,_0x34981f){_0x4e5dce=_0x4e5dce-0x0;var _0x3bd624=_0x326f[_0x4e5dce];return _0x3bd624;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3155628..97bd027 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 _0x8b78=['Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b78,0x183));var _0x88b7=function(_0x5934e6,_0x50fb76){_0x5934e6=_0x5934e6-0x0;var _0xef6993=_0x8b78[_0x5934e6];return _0xef6993;};'use strict';var multer=require(_0x88b7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x88b7('0x1'));var express=require(_0x88b7('0x2'));var router=express[_0x88b7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x88b7('0x4'));var interaction=require(_0x88b7('0x5'));var config=require('../../config/environment');var controller=require(_0x88b7('0x6'));router[_0x88b7('0x7')](_0x88b7('0x8'),auth[_0x88b7('0x9')](),controller['update']);router[_0x88b7('0xa')](_0x88b7('0x8'),auth[_0x88b7('0x9')](),controller[_0x88b7('0xb')]);module[_0x88b7('0xc')]=router; \ No newline at end of file +var _0x4c53=['isAuthenticated','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id'];(function(_0x366c9c,_0x38de3a){var _0x14a683=function(_0x34e95f){while(--_0x34e95f){_0x366c9c['push'](_0x366c9c['shift']());}};_0x14a683(++_0x38de3a);}(_0x4c53,0xab));var _0x34c5=function(_0x1b21be,_0x2ccf31){_0x1b21be=_0x1b21be-0x0;var _0x29002a=_0x4c53[_0x1b21be];return _0x29002a;};'use strict';var multer=require(_0x34c5('0x0'));var util=require(_0x34c5('0x1'));var path=require(_0x34c5('0x2'));var timeout=require('connect-timeout');var express=require(_0x34c5('0x3'));var router=express[_0x34c5('0x4')]();var fs_extra=require(_0x34c5('0x5'));var auth=require(_0x34c5('0x6'));var interaction=require(_0x34c5('0x7'));var config=require('../../config/environment');var controller=require(_0x34c5('0x8'));router[_0x34c5('0x9')](_0x34c5('0xa'),auth[_0x34c5('0xb')](),controller['update']);router['delete'](_0x34c5('0xa'),auth[_0x34c5('0xb')](),controller[_0x34c5('0xc')]);module[_0x34c5('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 9015936..be9737b 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 _0x7fbe=['STRING','TEXT'];(function(_0x4362c4,_0x57b51f){var _0x4e2876=function(_0x208a59){while(--_0x208a59){_0x4362c4['push'](_0x4362c4['shift']());}};_0x4e2876(++_0x57b51f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x49adfd,_0x136735){_0x49adfd=_0x49adfd-0x0;var _0x518e53=_0x7fbe[_0x49adfd];return _0x518e53;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file +var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x33fd6b,_0x2068fc){var _0x5bacb9=function(_0x1975bf){while(--_0x1975bf){_0x33fd6b['push'](_0x33fd6b['shift']());}};_0x5bacb9(++_0x2068fc);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x2a6b5c,_0x3631cd){_0x2a6b5c=_0x2a6b5c-0x0;var _0x2284a9=_0x9c5a[_0x2a6b5c];return _0x2284a9;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 21316cc..6eb77bf 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 _0x01bd=['hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','rows','show','params','keys','fields','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','parse','joins','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','Sequelize','%s.%s\x20=\x20%s.%s','clone','output','web','%s-%s.%s','randomstring','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','COUNT(*)','run','SUM(%s)','COUNT(DISTINCT\x20%s)','ROUND(%s)','IS\x20NOT\x20NULL','metric','alias','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length'];(function(_0x4583d0,_0x24551f){var _0x7b3c5a=function(_0x14946a){while(--_0x14946a){_0x4583d0['push'](_0x4583d0['shift']());}};_0x7b3c5a(++_0x24551f);}(_0x01bd,0x1aa));var _0xd01b=function(_0x5657fa,_0x1edcfe){_0x5657fa=_0x5657fa-0x0;var _0x5a799e=_0x01bd[_0x5657fa];return _0x5a799e;};'use strict';var emlformat=require(_0xd01b('0x0'));var rimraf=require(_0xd01b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd01b('0x2'));var rp=require(_0xd01b('0x3'));var moment=require(_0xd01b('0x4'));var BPromise=require(_0xd01b('0x5'));var Mustache=require('mustache');var util=require(_0xd01b('0x6'));var path=require(_0xd01b('0x7'));var sox=require(_0xd01b('0x8'));var csv=require('to-csv');var ejs=require(_0xd01b('0x9'));var fs=require('fs');var fs_extra=require(_0xd01b('0xa'));var _=require('lodash');var squel=require(_0xd01b('0xb'));var crypto=require(_0xd01b('0xc'));var jsforce=require(_0xd01b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd01b('0xe'));var querystring=require(_0xd01b('0xf'));var Papa=require(_0xd01b('0x10'));var Redis=require(_0xd01b('0x11'));var authService=require(_0xd01b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd01b('0x13'));var logger=require(_0xd01b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd01b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd01b('0x16'))['db'];var dbH=require(_0xd01b('0x16'))[_0xd01b('0x17')];function respondWithStatusCode(_0x51b746,_0x45a45a){_0x45a45a=_0x45a45a||0xcc;return function(_0x1d6015){if(_0x1d6015){return _0x51b746[_0xd01b('0x18')](_0x45a45a);}return _0x51b746[_0xd01b('0x19')](_0x45a45a)[_0xd01b('0x1a')]();};}function respondWithResult(_0x481203,_0x19b306){_0x19b306=_0x19b306||0xc8;return function(_0x19349c){if(_0x19349c){return _0x481203[_0xd01b('0x19')](_0x19b306)[_0xd01b('0x1b')](_0x19349c);}};}function respondWithFilteredResult(_0x154125,_0x3f6e7c){return function(_0x11639a){if(_0x11639a){var _0x147ca3=typeof _0x3f6e7c[_0xd01b('0x1c')]==='undefined'&&typeof _0x3f6e7c[_0xd01b('0x1d')]==='undefined';var _0x972f45=_0x11639a[_0xd01b('0x1e')];var _0x6d92a0=_0x147ca3?0x0:_0x3f6e7c[_0xd01b('0x1c')];var _0x5ea4be=_0x147ca3?_0x11639a['count']:_0x3f6e7c[_0xd01b('0x1c')]+_0x3f6e7c[_0xd01b('0x1d')];var _0x57f654;if(_0x5ea4be>=_0x972f45){_0x5ea4be=_0x972f45;_0x57f654=0xc8;}else{_0x57f654=0xce;}_0x154125[_0xd01b('0x19')](_0x57f654);return _0x154125[_0xd01b('0x1f')](_0xd01b('0x20'),_0x6d92a0+'-'+_0x5ea4be+'/'+_0x972f45)[_0xd01b('0x1b')](_0x11639a);}return null;};}function patchUpdates(_0xf908b7){return function(_0x32bfab){try{jsonpatch['apply'](_0x32bfab,_0xf908b7,!![]);}catch(_0x1bd00a){return BPromise[_0xd01b('0x21')](_0x1bd00a);}return _0x32bfab[_0xd01b('0x22')]();};}function saveUpdates(_0x2a6ad7,_0x2174ed){return function(_0xdc24d3){if(_0xdc24d3){return _0xdc24d3['update'](_0x2a6ad7)[_0xd01b('0x23')](function(_0x4fc7d0){return _0x4fc7d0;});}return null;};}function removeEntity(_0x1498a4,_0x5b925c){return function(_0x96b132){if(_0x96b132){return _0x96b132[_0xd01b('0x24')]()['then'](function(){var _0x1cbb7f=_0x96b132['get']({'plain':!![]});var _0x2fe4b5='CustomReports';return db[_0xd01b('0x25')][_0xd01b('0x24')]({'where':{'type':_0x2fe4b5,'resourceId':_0x1cbb7f['id']}})[_0xd01b('0x23')](function(){return _0x96b132;});})[_0xd01b('0x23')](function(){_0x1498a4[_0xd01b('0x19')](0xcc)[_0xd01b('0x1a')]();});}};}function handleEntityNotFound(_0x337db6,_0x3b4c42){return function(_0x231e8a){if(!_0x231e8a){_0x337db6[_0xd01b('0x18')](0x194);}return _0x231e8a;};}function handleError(_0x4ecd99,_0x1e5546){_0x1e5546=_0x1e5546||0x1f4;return function(_0x1a0435){logger['error'](_0x1a0435[_0xd01b('0x26')]);if(_0x1a0435[_0xd01b('0x27')]){delete _0x1a0435['name'];}_0x4ecd99[_0xd01b('0x19')](_0x1e5546)[_0xd01b('0x28')](_0x1a0435);};}exports[_0xd01b('0x29')]=function(_0x34efe2,_0x5680e1){var _0x5626f4={},_0xf26526={},_0x4e37e6={'count':0x0,'rows':[]};var _0x3912bb=_[_0xd01b('0x2a')](db[_0xd01b('0x2b')][_0xd01b('0x2c')],function(_0x3f852b){return{'name':_0x3f852b[_0xd01b('0x2d')],'type':_0x3f852b[_0xd01b('0x2e')][_0xd01b('0x2f')]};});_0xf26526[_0xd01b('0x30')]=_[_0xd01b('0x2a')](_0x3912bb,_0xd01b('0x27'));_0xf26526[_0xd01b('0x31')]=_['keys'](_0x34efe2[_0xd01b('0x31')]);_0xf26526[_0xd01b('0x32')]=_[_0xd01b('0x33')](_0xf26526[_0xd01b('0x30')],_0xf26526['query']);_0x5626f4[_0xd01b('0x34')]=_[_0xd01b('0x33')](_0xf26526[_0xd01b('0x30')],qs['fields'](_0x34efe2['query']['fields']));_0x5626f4[_0xd01b('0x34')]=_0x5626f4['attributes'][_0xd01b('0x35')]?_0x5626f4[_0xd01b('0x34')]:_0xf26526[_0xd01b('0x30')];if(!_0x34efe2[_0xd01b('0x31')][_0xd01b('0x36')](_0xd01b('0x37'))){_0x5626f4['limit']=qs[_0xd01b('0x1d')](_0x34efe2[_0xd01b('0x31')][_0xd01b('0x1d')]);_0x5626f4[_0xd01b('0x1c')]=qs[_0xd01b('0x1c')](_0x34efe2['query'][_0xd01b('0x1c')]);}_0x5626f4[_0xd01b('0x38')]=qs['sort'](_0x34efe2['query'][_0xd01b('0x39')]);_0x5626f4['where']=qs['filters'](_[_0xd01b('0x3a')](_0x34efe2[_0xd01b('0x31')],_0xf26526[_0xd01b('0x32')]),_0x3912bb);if(_0x34efe2[_0xd01b('0x31')][_0xd01b('0x3b')]){_0x5626f4['where']=_[_0xd01b('0x3c')](_0x5626f4[_0xd01b('0x3d')],{'$or':_[_0xd01b('0x2a')](_0x3912bb,function(_0x3dc6a0){if(_0x3dc6a0[_0xd01b('0x2e')]!=='VIRTUAL'){var _0x4aae57={};_0x4aae57[_0x3dc6a0[_0xd01b('0x27')]]={'$like':'%'+_0x34efe2[_0xd01b('0x31')][_0xd01b('0x3b')]+'%'};return _0x4aae57;}})});}_0x5626f4=_['merge']({},_0x5626f4,_0x34efe2[_0xd01b('0x3e')]);var _0x29a5d7={'where':_0x5626f4[_0xd01b('0x3d')]};return db['AnalyticCustomReport']['count'](_0x29a5d7)[_0xd01b('0x23')](function(_0x16c022){_0x4e37e6[_0xd01b('0x1e')]=_0x16c022;if(_0x34efe2['query'][_0xd01b('0x3f')]){_0x5626f4['include']=[{'all':!![]}];}return db[_0xd01b('0x2b')]['findAll'](_0x5626f4);})[_0xd01b('0x23')](function(_0x27e290){_0x4e37e6[_0xd01b('0x40')]=_0x27e290;return _0x4e37e6;})[_0xd01b('0x23')](respondWithFilteredResult(_0x5680e1,_0x5626f4))['catch'](handleError(_0x5680e1,null));};exports[_0xd01b('0x41')]=function(_0x4fb64c,_0x4dc53b){var _0xfc7d7a={'raw':![],'where':{'id':_0x4fb64c[_0xd01b('0x42')]['id']}},_0x3b46ed={};_0x3b46ed[_0xd01b('0x30')]=_[_0xd01b('0x43')](db['AnalyticCustomReport'][_0xd01b('0x2c')]);_0x3b46ed['query']=_[_0xd01b('0x43')](_0x4fb64c[_0xd01b('0x31')]);_0x3b46ed['filters']=_[_0xd01b('0x33')](_0x3b46ed[_0xd01b('0x30')],_0x3b46ed[_0xd01b('0x31')]);_0xfc7d7a['attributes']=_[_0xd01b('0x33')](_0x3b46ed[_0xd01b('0x30')],qs[_0xd01b('0x44')](_0x4fb64c[_0xd01b('0x31')][_0xd01b('0x44')]));_0xfc7d7a[_0xd01b('0x34')]=_0xfc7d7a[_0xd01b('0x34')][_0xd01b('0x35')]?_0xfc7d7a[_0xd01b('0x34')]:_0x3b46ed['model'];if(_0x4fb64c[_0xd01b('0x31')][_0xd01b('0x3f')]){_0xfc7d7a[_0xd01b('0x45')]=[{'all':!![]}];}_0xfc7d7a=_['merge']({},_0xfc7d7a,_0x4fb64c['options']);return db[_0xd01b('0x2b')][_0xd01b('0x46')](_0xfc7d7a)[_0xd01b('0x23')](handleEntityNotFound(_0x4dc53b,null))[_0xd01b('0x23')](respondWithResult(_0x4dc53b,null))[_0xd01b('0x47')](handleError(_0x4dc53b,null));};exports[_0xd01b('0x48')]=function(_0x21810b,_0x26a499){return db['AnalyticCustomReport'][_0xd01b('0x48')](_0x21810b[_0xd01b('0x49')],{})[_0xd01b('0x23')](function(_0x161b4e){var _0x4a770c=_0x21810b['user']['get']({'plain':!![]});if(!_0x4a770c)throw new Error(_0xd01b('0x4a'));if(_0x4a770c['role']===_0xd01b('0x4b')){var _0x27789d=_0x161b4e[_0xd01b('0x4c')]({'plain':!![]});var _0x36c690='Reports';return db[_0xd01b('0x4d')]['find']({'where':{'name':_0x36c690,'userProfileId':_0x4a770c['userProfileId']},'raw':!![]})['then'](function(_0x3281cf){if(_0x3281cf&&_0x3281cf[_0xd01b('0x4e')]===0x0){return db[_0xd01b('0x25')]['create']({'name':_0x27789d[_0xd01b('0x27')],'resourceId':_0x27789d['id'],'type':'CustomReports','sectionId':_0x3281cf['id']},{})[_0xd01b('0x23')](function(){return _0x161b4e;});}else{return _0x161b4e;}})[_0xd01b('0x47')](function(_0x3a52a6){logger[_0xd01b('0x4f')](_0xd01b('0x50'),_0x3a52a6);throw _0x3a52a6;});}return _0x161b4e;})[_0xd01b('0x23')](respondWithResult(_0x26a499,0xc9))[_0xd01b('0x47')](handleError(_0x26a499,null));};exports['update']=function(_0x48a633,_0x18bb04){if(_0x48a633[_0xd01b('0x49')]['id']){delete _0x48a633[_0xd01b('0x49')]['id'];}return db[_0xd01b('0x2b')][_0xd01b('0x46')]({'where':{'id':_0x48a633['params']['id']}})[_0xd01b('0x23')](handleEntityNotFound(_0x18bb04,null))[_0xd01b('0x23')](saveUpdates(_0x48a633['body'],null))[_0xd01b('0x23')](respondWithResult(_0x18bb04,null))[_0xd01b('0x47')](handleError(_0x18bb04,null));};exports[_0xd01b('0x24')]=function(_0x432a35,_0x3f4ab1){return db[_0xd01b('0x2b')][_0xd01b('0x46')]({'where':{'id':_0x432a35['params']['id']}})[_0xd01b('0x23')](handleEntityNotFound(_0x3f4ab1,null))[_0xd01b('0x23')](removeEntity(_0x3f4ab1,null))[_0xd01b('0x47')](handleError(_0x3f4ab1,null));};exports[_0xd01b('0x51')]=function(_0x2caa88,_0x2c0a35){var _0x1fdbc1=0xa;var _0x36c9f5=[_0xd01b('0x52'),_0xd01b('0x53'),_0xd01b('0x54'),_0xd01b('0x55')];var _0x8ad734={'SUM':'SUM(%s)','COUNT':_0xd01b('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd01b('0x57'),'MIN':_0xd01b('0x58'),'AVG':_0xd01b('0x59'),'GROUP_CONCAT':_0xd01b('0x5a'),'GROUP_CONCAT ASC':_0xd01b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1db70e={'SEC_TO_TIME':_0xd01b('0x5c'),'DATE':_0xd01b('0x5d'),'HOUR':_0xd01b('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd01b('0x5f')};var _0xfd9481=function(_0x37a1ed){return!_[_0xd01b('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xd01b('0x61'),_0xd01b('0x62')],_0x37a1ed);};var _0x5aefca=function(_0x326b78){if(!_0x326b78||!_0x326b78[_0xd01b('0x63')]['length']){return'';}for(var _0x746fd1='(',_0x455f82=0x0;_0x455f82<_0x326b78[_0xd01b('0x63')]['length'];_0x455f82+=0x1){_0x455f82>0x0&&(_0x746fd1+='\x20'+_0x326b78[_0xd01b('0x64')]+'\x20');_0x746fd1+=_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x65')]?_0x5aefca(_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x65')]):_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x66')]+'\x20'+_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x67')]+(_0xfd9481(_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x67')])?'\x20'+_0x326b78['rules'][_0x455f82][_0xd01b('0x68')]:'');}return _0x746fd1+')';};var _0x2cb63c={'where':{'id':_0x2caa88[_0xd01b('0x42')]['id']}},_0x29eb2c,_0x10670c,_0x3d4bc6,_0x2edd2f,_0x21e8b4;_0x2cb63c=_[_0xd01b('0x3c')]({},_0x2cb63c,_0x2caa88[_0xd01b('0x3e')]);return db[_0xd01b('0x2b')][_0xd01b('0x46')](_0x2cb63c)[_0xd01b('0x23')](function(_0x22f553){if(_0x22f553){_0x29eb2c=_0x22f553;return _0x22f553[_0xd01b('0x69')]();}return null;})['then'](function(_0x1670b9){if(_0x1670b9){if(!_0x1670b9[_0xd01b('0x35')]){throw new db['Sequelize'][(_0xd01b('0x6a'))](_0xd01b('0x6b'),0x193);}_0x10670c=_0x1670b9;return db[_0xd01b('0x6c')][_0xd01b('0x6d')]({'raw':!![]});}return null;})[_0xd01b('0x23')](function(_0x25efaf){if(_0x25efaf){_0x3d4bc6=_[_0xd01b('0x6e')](_0x25efaf,'id');var _0xffb92d;var _0x3f157f=squel[_0xd01b('0x6f')]();_0x3f157f[_0xd01b('0x70')](_0x29eb2c[_0xd01b('0x71')]);for(var _0x17423f=0x0;_0x17423f<_0x10670c[_0xd01b('0x35')];_0x17423f+=0x1){_0xffb92d=_0x10670c[_0x17423f][_0xd01b('0x72')]?_0x3d4bc6[_0x10670c[_0x17423f][_0xd01b('0x72')]]['metric']:_0x10670c[_0x17423f][_0xd01b('0x66')];_0xffb92d=_0x10670c[_0x17423f][_0xd01b('0x73')]?_[_0xd01b('0x74')](_0x8ad734[_0x10670c[_0x17423f][_0xd01b('0x73')]],'%s',_0xffb92d):_0xffb92d;_0xffb92d=_0x10670c[_0x17423f][_0xd01b('0x75')]?_[_0xd01b('0x74')](_0x1db70e[_0x10670c[_0x17423f][_0xd01b('0x75')]],'%s',_0xffb92d):_0xffb92d;if(_0x10670c[_0x17423f][_0xd01b('0x76')]){_0x3f157f[_0xd01b('0x65')](_0xffb92d);}_0x10670c[_0x17423f][_0xd01b('0x77')]&&_0x3f157f['order'](_0xffb92d,_0x10670c[_0x17423f][_0xd01b('0x77')]===_0xd01b('0x78')?![]:!![]);_0x3f157f['field'](_0xffb92d,_0x10670c[_0x17423f]['alias']||_0xffb92d);}if(_0x29eb2c['joins']){_0x29eb2c['joins']=JSON[_0xd01b('0x79')](_0x29eb2c[_0xd01b('0x7a')]);for(var _0x2123f8=0x0;_0x2123f8<_0x29eb2c[_0xd01b('0x7a')][_0xd01b('0x35')];_0x2123f8+=0x1){if(_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x2e')]&&_[_0xd01b('0x60')](_0x36c9f5,_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x2e')])&&_0x29eb2c['joins'][_0x2123f8][_0xd01b('0x7b')]&&_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7c')]&&_0x29eb2c['joins'][_0x2123f8][_0xd01b('0x7d')]){_0x3f157f[_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x2e')]](_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7c')],null,util[_0xd01b('0x75')]('%s.%s\x20=\x20%s.%s',_0x29eb2c[_0xd01b('0x71')],_0x29eb2c['joins'][_0x2123f8][_0xd01b('0x7b')],_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7c')],_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7d')]));}}}if(_0x29eb2c[_0xd01b('0x7e')]){_0x29eb2c[_0xd01b('0x7e')]=JSON[_0xd01b('0x79')](_0x29eb2c[_0xd01b('0x7e')]);_0x3f157f[_0xd01b('0x3d')](_0x5aefca(_0x29eb2c[_0xd01b('0x7e')]['group']));}_0x21e8b4=_0x3f157f['clone']();_0x3f157f[_0xd01b('0x1d')](_0x1fdbc1);_0x3f157f[_0xd01b('0x1c')](0x0);logger[_0xd01b('0x7f')](_0xd01b('0x80'),_0x3f157f[_0xd01b('0x81')]());return dbH[_0xd01b('0x82')][_0xd01b('0x31')](_0x3f157f[_0xd01b('0x81')](),{'type':dbH[_0xd01b('0x82')][_0xd01b('0x83')][_0xd01b('0x84')]});}})['then'](respondWithResult(_0x2c0a35,null))['catch'](handleError(_0x2c0a35,null));};function runReport(_0x335dfc,_0x565315,_0x4bfa60){var _0xdc22ef=_0x565315[_0xd01b('0x27')];var _0x20b759=0xa;var _0x130015=[_0xd01b('0x52'),_0xd01b('0x53'),'right_join','cross_join'];var _0x4f0511={'SUM':'SUM(%s)','COUNT':_0xd01b('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd01b('0x57'),'MIN':_0xd01b('0x58'),'AVG':_0xd01b('0x59'),'GROUP_CONCAT':_0xd01b('0x5a'),'GROUP_CONCAT ASC':_0xd01b('0x5b'),'GROUP_CONCAT DESC':_0xd01b('0x85')};var _0x3f8808={'SEC_TO_TIME':_0xd01b('0x5c'),'DATE':'DATE(%s)','HOUR':_0xd01b('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x37bc66=function(_0x381b82){return!_[_0xd01b('0x60')]([_0xd01b('0x86'),'IS\x20NOT\x20NULL',_0xd01b('0x61'),_0xd01b('0x62')],_0x381b82);};var _0x16c6a6=function(_0x534783){if(!_0x534783||!_0x534783[_0xd01b('0x63')][_0xd01b('0x35')]){return'';}for(var _0x5b4185='(',_0xb7d88d=0x0;_0xb7d88d<_0x534783[_0xd01b('0x63')][_0xd01b('0x35')];_0xb7d88d+=0x1){_0xb7d88d>0x0&&(_0x5b4185+='\x20'+_0x534783['operator']+'\x20');_0x5b4185+=_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x65')]?_0x16c6a6(_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x65')]):_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x66')]+'\x20'+_0x534783['rules'][_0xb7d88d][_0xd01b('0x67')]+(_0x37bc66(_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x67')])?'\x20'+_0x534783['rules'][_0xb7d88d][_0xd01b('0x68')]:'');}return _0x5b4185+')';};var _0x47d8cf={'where':{'id':_0x335dfc['id']}},_0x172975,_0x145a18,_0x42b2d4,_0x252521,_0x4d3741;_0x47d8cf=_[_0xd01b('0x3c')]({},_0x47d8cf,_0x4bfa60);return db['AnalyticCustomReport'][_0xd01b('0x46')](_0x47d8cf)[_0xd01b('0x23')](function(_0x24cd1f){if(_0x24cd1f){_0x172975=_0x24cd1f;return _0x24cd1f[_0xd01b('0x69')]();}return null;})[_0xd01b('0x23')](function(_0x222fcf){if(_0x222fcf){if(!_0x222fcf[_0xd01b('0x35')]){throw new db[(_0xd01b('0x87'))][(_0xd01b('0x6a'))](_0xd01b('0x6b'),0x193);}_0x145a18=_0x222fcf;return db[_0xd01b('0x6c')][_0xd01b('0x6d')]({'raw':!![]});}return null;})[_0xd01b('0x23')](function(_0x493dff){if(_0x493dff){_0x42b2d4=_[_0xd01b('0x6e')](_0x493dff,'id');var _0x38fa41;var _0x28393a=squel[_0xd01b('0x6f')]();_0x28393a[_0xd01b('0x70')](_0x172975[_0xd01b('0x71')]);for(var _0x29651c=0x0;_0x29651c<_0x145a18[_0xd01b('0x35')];_0x29651c+=0x1){_0x38fa41=_0x145a18[_0x29651c]['MetricId']?_0x42b2d4[_0x145a18[_0x29651c][_0xd01b('0x72')]]['metric']:_0x145a18[_0x29651c][_0xd01b('0x66')];_0x38fa41=_0x145a18[_0x29651c]['function']?_[_0xd01b('0x74')](_0x4f0511[_0x145a18[_0x29651c]['function']],'%s',_0x38fa41):_0x38fa41;_0x38fa41=_0x145a18[_0x29651c][_0xd01b('0x75')]?_['replace'](_0x3f8808[_0x145a18[_0x29651c][_0xd01b('0x75')]],'%s',_0x38fa41):_0x38fa41;if(_0x145a18[_0x29651c][_0xd01b('0x76')]){_0x28393a['group'](_0x38fa41);}_0x145a18[_0x29651c]['orderBy']&&_0x28393a[_0xd01b('0x38')](_0x38fa41,_0x145a18[_0x29651c][_0xd01b('0x77')]===_0xd01b('0x78')?![]:!![]);_0x28393a[_0xd01b('0x66')](_0x38fa41,_0x145a18[_0x29651c]['alias']||_0x38fa41);}if(_0x172975[_0xd01b('0x7a')]){_0x172975[_0xd01b('0x7a')]=JSON[_0xd01b('0x79')](_0x172975[_0xd01b('0x7a')]);for(var _0x358894=0x0;_0x358894<_0x172975[_0xd01b('0x7a')][_0xd01b('0x35')];_0x358894+=0x1){if(_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x2e')]&&_['includes'](_0x130015,_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x2e')])&&_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7b')]&&_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7c')]&&_0x172975['joins'][_0x358894][_0xd01b('0x7d')]){_0x28393a[_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x2e')]](_0x172975[_0xd01b('0x7a')][_0x358894]['foreignTable'],null,util[_0xd01b('0x75')](_0xd01b('0x88'),_0x172975[_0xd01b('0x71')],_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7b')],_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7c')],_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7d')]));}}}if(_0x172975['conditions']){_0x172975[_0xd01b('0x7e')]=JSON[_0xd01b('0x79')](_0x172975[_0xd01b('0x7e')]);_0x28393a[_0xd01b('0x3d')](_0x16c6a6(_0x172975[_0xd01b('0x7e')]['group']));}_0x4d3741=_0x28393a[_0xd01b('0x89')]();_0x28393a[_0xd01b('0x1d')](_0x20b759);_0x28393a[_0xd01b('0x1c')](0x0);return;}})[_0xd01b('0x23')](function(){if(_0x565315[_0xd01b('0x8a')]===_0xd01b('0x8b')){return null;}var _0x21d6d2=_[_0xd01b('0x3c')](_0x565315,{'name':_0x565315['fullPath']||_0x565315[_0xd01b('0x27')]||_0x172975['name'],'basename':_0xdc22ef,'savename':util[_0xd01b('0x75')](_0xd01b('0x8c'),_0x565315[_0xd01b('0x27')]||_0x172975[_0xd01b('0x27')],require(_0xd01b('0x8d'))['generate'](0x4),_0x565315[_0xd01b('0x8a')]||_0xd01b('0x8e')),'reportId':_0x172975['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xd01b('0x48')](_0x21d6d2,{'raw':!![]});})[_0xd01b('0x23')](function(_0x280e89){if(_0x172975[_0xd01b('0x71')]===_0xd01b('0x8f')){_0x4d3741['where'](_0x172975[_0xd01b('0x71')]+_0xd01b('0x90'),_0x565315[_0xd01b('0x91')],_0x565315[_0xd01b('0x92')]);}else{_0x4d3741['where'](_0x172975[_0xd01b('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x565315[_0xd01b('0x91')],_0x565315['endDate']);}if(_0x280e89){logger[_0xd01b('0x93')](_0xd01b('0x94'),_0x4d3741['toString']());require(_0xd01b('0x95'))['fork'](path[_0xd01b('0x52')](__dirname,_0xd01b('0x96'),_0x280e89[_0xd01b('0x8a')]),[_0x280e89['id'],_0x4d3741['toString'](),path[_0xd01b('0x52')](__dirname,_0xd01b('0x97'),_0x280e89['savename']),_0xdc22ef]);return _0x280e89;}else{var _0x4fb4e5=squel[_0xd01b('0x6f')]();_0x4fb4e5[_0xd01b('0x70')]('('+_0x4d3741[_0xd01b('0x81')]()+')','countTable');_0x4fb4e5[_0xd01b('0x66')](_0xd01b('0x98'),_0xd01b('0x1e'));_0x4d3741[_0xd01b('0x1d')](_0x565315[_0xd01b('0x1d')]||_0x20b759);_0x4d3741['offset'](_0x565315[_0xd01b('0x1c')]||0x0);return dbH[_0xd01b('0x82')][_0xd01b('0x31')](_0x4fb4e5['toString'](),{'type':dbH[_0xd01b('0x82')]['QueryTypes'][_0xd01b('0x84')]})['then'](function(_0x412c62){if(!_0x412c62[_0xd01b('0x35')]){_0x252521=0x0;}else{_0x252521=_0x412c62[0x0]['count']||0x0;}return dbH['sequelize'][_0xd01b('0x31')](_0x4d3741[_0xd01b('0x81')](),{'type':dbH[_0xd01b('0x82')][_0xd01b('0x83')][_0xd01b('0x84')]});})[_0xd01b('0x23')](function(_0x24f5be){return{'rows':_0x24f5be||[],'count':_0x252521};});}});}exports[_0xd01b('0x99')]=function(_0x46731d,_0x3ec101){return runReport(_0x46731d[_0xd01b('0x42')],_0x46731d[_0xd01b('0x31')],_0x46731d['options'])['then'](respondWithResult(_0x3ec101,null))[_0xd01b('0x47')](handleError(_0x3ec101,null));};exports['runReport']=runReport;exports[_0xd01b('0x31')]=function(_0x386c99,_0x27ca94){var _0x363bc9=0xa;var _0x4f4c9f=[_0xd01b('0x52'),_0xd01b('0x53'),_0xd01b('0x54'),_0xd01b('0x55')];var _0x4cd237={'SUM':_0xd01b('0x9a'),'COUNT':_0xd01b('0x56'),'COUNT DISTINCT':_0xd01b('0x9b'),'MAX':_0xd01b('0x57'),'MIN':_0xd01b('0x58'),'AVG':_0xd01b('0x59'),'GROUP_CONCAT':_0xd01b('0x5a'),'GROUP_CONCAT ASC':_0xd01b('0x5b'),'GROUP_CONCAT DESC':_0xd01b('0x85')};var _0x29682c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd01b('0x5d'),'HOUR':_0xd01b('0x5e'),'ROUND':_0xd01b('0x9c'),'UNIX_TIMESTAMP':_0xd01b('0x5f')};var _0x1d28b0=function(_0x199320){return!_[_0xd01b('0x60')]([_0xd01b('0x86'),_0xd01b('0x9d'),_0xd01b('0x61'),_0xd01b('0x62')],_0x199320);};var _0x1505b0=function(_0x20f040){if(!_0x20f040||!_0x20f040['rules']['length']){return'';}for(var _0x3e8044='(',_0x20e45b=0x0;_0x20e45b<_0x20f040[_0xd01b('0x63')][_0xd01b('0x35')];_0x20e45b+=0x1){_0x20e45b>0x0&&(_0x3e8044+='\x20'+_0x20f040[_0xd01b('0x64')]+'\x20');_0x3e8044+=_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x65')]?_0x1505b0(_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x65')]):_0x20f040['rules'][_0x20e45b][_0xd01b('0x66')]+'\x20'+_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x67')]+(_0x1d28b0(_0x20f040[_0xd01b('0x63')][_0x20e45b]['condition'])?'\x20'+_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x68')]:'');}return _0x3e8044+')';};var _0x1a0c39={'where':{'id':_0x386c99[_0xd01b('0x42')]['id']}},_0x51202b,_0x53a3e4,_0x5d0d60,_0x331f6b,_0x578f91;_0x1a0c39=_[_0xd01b('0x3c')]({},_0x1a0c39,_0x386c99['options']);return db['AnalyticCustomReport'][_0xd01b('0x46')](_0x1a0c39)['then'](function(_0x3e81c4){if(_0x3e81c4){_0x51202b=_0x3e81c4;return _0x3e81c4['getFields']();}return null;})['then'](function(_0x35b1bf){if(_0x35b1bf){if(!_0x35b1bf['length']){throw new db[(_0xd01b('0x87'))][(_0xd01b('0x6a'))](_0xd01b('0x6b'),0x193);}_0x53a3e4=_0x35b1bf;return db[_0xd01b('0x6c')][_0xd01b('0x6d')]({'raw':!![]});}return null;})['then'](function(_0xcc4f3b){if(_0xcc4f3b){_0x5d0d60=_[_0xd01b('0x6e')](_0xcc4f3b,'id');var _0x28ae4e;var _0x376399=squel[_0xd01b('0x6f')]();_0x376399['from'](_0x51202b['table']);for(var _0xf1eeb0=0x0;_0xf1eeb0<_0x53a3e4[_0xd01b('0x35')];_0xf1eeb0+=0x1){_0x28ae4e=_0x53a3e4[_0xf1eeb0][_0xd01b('0x72')]?_0x5d0d60[_0x53a3e4[_0xf1eeb0][_0xd01b('0x72')]][_0xd01b('0x9e')]:_0x53a3e4[_0xf1eeb0][_0xd01b('0x66')];_0x28ae4e=_0x53a3e4[_0xf1eeb0][_0xd01b('0x73')]?_[_0xd01b('0x74')](_0x4cd237[_0x53a3e4[_0xf1eeb0]['function']],'%s',_0x28ae4e):_0x28ae4e;_0x28ae4e=_0x53a3e4[_0xf1eeb0][_0xd01b('0x75')]?_[_0xd01b('0x74')](_0x29682c[_0x53a3e4[_0xf1eeb0][_0xd01b('0x75')]],'%s',_0x28ae4e):_0x28ae4e;if(_0x53a3e4[_0xf1eeb0][_0xd01b('0x76')]){_0x376399[_0xd01b('0x65')](_0x28ae4e);}_0x53a3e4[_0xf1eeb0]['orderBy']&&_0x376399['order'](_0x28ae4e,_0x53a3e4[_0xf1eeb0][_0xd01b('0x77')]===_0xd01b('0x78')?![]:!![]);_0x376399[_0xd01b('0x66')](_0x28ae4e,_0x53a3e4[_0xf1eeb0][_0xd01b('0x9f')]||_0x28ae4e);}if(_0x51202b[_0xd01b('0x7a')]){_0x51202b[_0xd01b('0x7a')]=JSON[_0xd01b('0x79')](_0x51202b[_0xd01b('0x7a')]);for(var _0x159dfb=0x0;_0x159dfb<_0x51202b[_0xd01b('0x7a')][_0xd01b('0x35')];_0x159dfb+=0x1){if(_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x2e')]&&_[_0xd01b('0x60')](_0x4f4c9f,_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x2e')])&&_0x51202b['joins'][_0x159dfb][_0xd01b('0x7b')]&&_0x51202b['joins'][_0x159dfb]['foreignTable']&&_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7d')]){_0x376399[_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x2e')]](_0x51202b[_0xd01b('0x7a')][_0x159dfb]['foreignTable'],null,util[_0xd01b('0x75')](_0xd01b('0x88'),_0x51202b[_0xd01b('0x71')],_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7b')],_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7c')],_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7d')]));}}}if(_0x51202b['conditions']){_0x51202b[_0xd01b('0x7e')]=JSON[_0xd01b('0x79')](_0x51202b[_0xd01b('0x7e')]);_0x376399['where'](_0x1505b0(_0x51202b['conditions']['group']));}_0x578f91=_0x376399[_0xd01b('0x89')]();_0x376399[_0xd01b('0x1d')](_0x363bc9);_0x376399[_0xd01b('0x1c')](0x0);logger[_0xd01b('0x7f')](_0xd01b('0x80'),_0x376399[_0xd01b('0x81')]());return dbH[_0xd01b('0x82')][_0xd01b('0x31')](_0x376399[_0xd01b('0x81')](),{'type':dbH['sequelize'][_0xd01b('0x83')]['SELECT']});}})[_0xd01b('0x23')](function(){return{'sql':_0x578f91['toString']()};})[_0xd01b('0x23')](respondWithResult(_0x27ca94,null))[_0xd01b('0x47')](handleError(_0x27ca94,null));}; \ No newline at end of file +var _0xc217=['getFields','replace','clone','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','AnalyticCustomReport','include','findAll','rows','catch','show','params','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','find','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','GROUP_CONCAT(%s)','operator','condition'];(function(_0x34d7e8,_0x1b3355){var _0x5d45bc=function(_0x1dd0a5){while(--_0x1dd0a5){_0x34d7e8['push'](_0x34d7e8['shift']());}};_0x5d45bc(++_0x1b3355);}(_0xc217,0x15d));var _0x7c21=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0xc217[_0x9a3e0f];return _0x3d2a9a;};'use strict';var emlformat=require(_0x7c21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c21('0x1'));var jsonpatch=require(_0x7c21('0x2'));var rp=require(_0x7c21('0x3'));var moment=require(_0x7c21('0x4'));var BPromise=require(_0x7c21('0x5'));var Mustache=require('mustache');var util=require(_0x7c21('0x6'));var path=require(_0x7c21('0x7'));var sox=require(_0x7c21('0x8'));var csv=require(_0x7c21('0x9'));var ejs=require(_0x7c21('0xa'));var fs=require('fs');var fs_extra=require(_0x7c21('0xb'));var _=require(_0x7c21('0xc'));var squel=require('squel');var crypto=require(_0x7c21('0xd'));var jsforce=require(_0x7c21('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7c21('0x9'));var querystring=require(_0x7c21('0xf'));var Papa=require(_0x7c21('0x10'));var Redis=require(_0x7c21('0x11'));var authService=require(_0x7c21('0x12'));var qs=require(_0x7c21('0x13'));var as=require(_0x7c21('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c21('0x15'))('api');var utils=require(_0x7c21('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7c21('0x17'));var db=require(_0x7c21('0x18'))['db'];var dbH=require(_0x7c21('0x18'))[_0x7c21('0x19')];function respondWithStatusCode(_0x15bbc4,_0x19b39f){_0x19b39f=_0x19b39f||0xcc;return function(_0x4a665d){if(_0x4a665d){return _0x15bbc4[_0x7c21('0x1a')](_0x19b39f);}return _0x15bbc4[_0x7c21('0x1b')](_0x19b39f)[_0x7c21('0x1c')]();};}function respondWithResult(_0x692529,_0x5f3b6d){_0x5f3b6d=_0x5f3b6d||0xc8;return function(_0x2cee0d){if(_0x2cee0d){return _0x692529[_0x7c21('0x1b')](_0x5f3b6d)[_0x7c21('0x1d')](_0x2cee0d);}};}function respondWithFilteredResult(_0x4611df,_0x2fd1dd){return function(_0x22b5d0){if(_0x22b5d0){var _0x4dad7c=typeof _0x2fd1dd[_0x7c21('0x1e')]==='undefined'&&typeof _0x2fd1dd[_0x7c21('0x1f')]===_0x7c21('0x20');var _0x4165aa=_0x22b5d0['count'];var _0x2ec99b=_0x4dad7c?0x0:_0x2fd1dd[_0x7c21('0x1e')];var _0x294213=_0x4dad7c?_0x22b5d0[_0x7c21('0x21')]:_0x2fd1dd[_0x7c21('0x1e')]+_0x2fd1dd[_0x7c21('0x1f')];var _0x368351;if(_0x294213>=_0x4165aa){_0x294213=_0x4165aa;_0x368351=0xc8;}else{_0x368351=0xce;}_0x4611df[_0x7c21('0x1b')](_0x368351);return _0x4611df['set']('Content-Range',_0x2ec99b+'-'+_0x294213+'/'+_0x4165aa)[_0x7c21('0x1d')](_0x22b5d0);}return null;};}function patchUpdates(_0x57efb7){return function(_0x468e23){try{jsonpatch[_0x7c21('0x22')](_0x468e23,_0x57efb7,!![]);}catch(_0x2da528){return BPromise['reject'](_0x2da528);}return _0x468e23[_0x7c21('0x23')]();};}function saveUpdates(_0x619b02,_0x3dd770){return function(_0x205039){if(_0x205039){return _0x205039['update'](_0x619b02)[_0x7c21('0x24')](function(_0x23851f){return _0x23851f;});}return null;};}function removeEntity(_0x55269d,_0x287688){return function(_0x35052f){if(_0x35052f){return _0x35052f['destroy']()[_0x7c21('0x24')](function(){var _0xc6164b=_0x35052f[_0x7c21('0x25')]({'plain':!![]});var _0x4b3528=_0x7c21('0x26');return db[_0x7c21('0x27')][_0x7c21('0x28')]({'where':{'type':_0x4b3528,'resourceId':_0xc6164b['id']}})['then'](function(){return _0x35052f;});})['then'](function(){_0x55269d[_0x7c21('0x1b')](0xcc)[_0x7c21('0x1c')]();});}};}function handleEntityNotFound(_0x1ed8b2,_0x10c69f){return function(_0x31e91f){if(!_0x31e91f){_0x1ed8b2[_0x7c21('0x1a')](0x194);}return _0x31e91f;};}function handleError(_0x2c8847,_0x5b52ce){_0x5b52ce=_0x5b52ce||0x1f4;return function(_0x1ffce1){logger[_0x7c21('0x29')](_0x1ffce1['stack']);if(_0x1ffce1['name']){delete _0x1ffce1[_0x7c21('0x2a')];}_0x2c8847[_0x7c21('0x1b')](_0x5b52ce)[_0x7c21('0x2b')](_0x1ffce1);};}exports[_0x7c21('0x2c')]=function(_0x539690,_0x146e6f){var _0x455469={},_0x35d833={},_0x253836={'count':0x0,'rows':[]};var _0x5b17af=_[_0x7c21('0x2d')](db['AnalyticCustomReport'][_0x7c21('0x2e')],function(_0x4ba36c){return{'name':_0x4ba36c[_0x7c21('0x2f')],'type':_0x4ba36c['type'][_0x7c21('0x30')]};});_0x35d833[_0x7c21('0x31')]=_[_0x7c21('0x2d')](_0x5b17af,_0x7c21('0x2a'));_0x35d833[_0x7c21('0x32')]=_[_0x7c21('0x33')](_0x539690['query']);_0x35d833[_0x7c21('0x34')]=_[_0x7c21('0x35')](_0x35d833['model'],_0x35d833[_0x7c21('0x32')]);_0x455469[_0x7c21('0x36')]=_[_0x7c21('0x35')](_0x35d833[_0x7c21('0x31')],qs[_0x7c21('0x37')](_0x539690['query'][_0x7c21('0x37')]));_0x455469[_0x7c21('0x36')]=_0x455469[_0x7c21('0x36')][_0x7c21('0x38')]?_0x455469[_0x7c21('0x36')]:_0x35d833['model'];if(!_0x539690[_0x7c21('0x32')][_0x7c21('0x39')]('nolimit')){_0x455469[_0x7c21('0x1f')]=qs[_0x7c21('0x1f')](_0x539690[_0x7c21('0x32')][_0x7c21('0x1f')]);_0x455469[_0x7c21('0x1e')]=qs['offset'](_0x539690[_0x7c21('0x32')][_0x7c21('0x1e')]);}_0x455469[_0x7c21('0x3a')]=qs['sort'](_0x539690[_0x7c21('0x32')][_0x7c21('0x3b')]);_0x455469[_0x7c21('0x3c')]=qs[_0x7c21('0x34')](_['pick'](_0x539690['query'],_0x35d833['filters']),_0x5b17af);if(_0x539690[_0x7c21('0x32')][_0x7c21('0x3d')]){_0x455469[_0x7c21('0x3c')]=_[_0x7c21('0x3e')](_0x455469['where'],{'$or':_[_0x7c21('0x2d')](_0x5b17af,function(_0x1fc9c5){if(_0x1fc9c5[_0x7c21('0x3f')]!=='VIRTUAL'){var _0x42a59b={};_0x42a59b[_0x1fc9c5[_0x7c21('0x2a')]]={'$like':'%'+_0x539690[_0x7c21('0x32')]['filter']+'%'};return _0x42a59b;}})});}_0x455469=_[_0x7c21('0x3e')]({},_0x455469,_0x539690['options']);var _0x3d9c69={'where':_0x455469[_0x7c21('0x3c')]};return db[_0x7c21('0x40')][_0x7c21('0x21')](_0x3d9c69)[_0x7c21('0x24')](function(_0x1f4c1e){_0x253836[_0x7c21('0x21')]=_0x1f4c1e;if(_0x539690[_0x7c21('0x32')]['includeAll']){_0x455469[_0x7c21('0x41')]=[{'all':!![]}];}return db[_0x7c21('0x40')][_0x7c21('0x42')](_0x455469);})['then'](function(_0x4b93db){_0x253836[_0x7c21('0x43')]=_0x4b93db;return _0x253836;})['then'](respondWithFilteredResult(_0x146e6f,_0x455469))[_0x7c21('0x44')](handleError(_0x146e6f,null));};exports[_0x7c21('0x45')]=function(_0x1b36a8,_0x1e8ceb){var _0x1df6d7={'raw':![],'where':{'id':_0x1b36a8[_0x7c21('0x46')]['id']}},_0x797ac={};_0x797ac['model']=_[_0x7c21('0x33')](db[_0x7c21('0x40')][_0x7c21('0x2e')]);_0x797ac[_0x7c21('0x32')]=_[_0x7c21('0x33')](_0x1b36a8[_0x7c21('0x32')]);_0x797ac[_0x7c21('0x34')]=_['intersection'](_0x797ac['model'],_0x797ac['query']);_0x1df6d7[_0x7c21('0x36')]=_['intersection'](_0x797ac[_0x7c21('0x31')],qs[_0x7c21('0x37')](_0x1b36a8[_0x7c21('0x32')][_0x7c21('0x37')]));_0x1df6d7[_0x7c21('0x36')]=_0x1df6d7[_0x7c21('0x36')][_0x7c21('0x38')]?_0x1df6d7[_0x7c21('0x36')]:_0x797ac[_0x7c21('0x31')];if(_0x1b36a8[_0x7c21('0x32')][_0x7c21('0x47')]){_0x1df6d7[_0x7c21('0x41')]=[{'all':!![]}];}_0x1df6d7=_[_0x7c21('0x3e')]({},_0x1df6d7,_0x1b36a8[_0x7c21('0x48')]);return db[_0x7c21('0x40')]['find'](_0x1df6d7)[_0x7c21('0x24')](handleEntityNotFound(_0x1e8ceb,null))[_0x7c21('0x24')](respondWithResult(_0x1e8ceb,null))[_0x7c21('0x44')](handleError(_0x1e8ceb,null));};exports[_0x7c21('0x49')]=function(_0x410b2b,_0x4c93e6){return db['AnalyticCustomReport']['create'](_0x410b2b[_0x7c21('0x4a')],{})['then'](function(_0x4142f9){var _0x4989e=_0x410b2b['user']['get']({'plain':!![]});if(!_0x4989e)throw new Error(_0x7c21('0x4b'));if(_0x4989e[_0x7c21('0x4c')]===_0x7c21('0x4d')){var _0x42dce2=_0x4142f9['get']({'plain':!![]});var _0x5135d5=_0x7c21('0x4e');return db[_0x7c21('0x4f')]['find']({'where':{'name':_0x5135d5,'userProfileId':_0x4989e[_0x7c21('0x50')]},'raw':!![]})[_0x7c21('0x24')](function(_0x273f5c){if(_0x273f5c&&_0x273f5c[_0x7c21('0x51')]===0x0){return db[_0x7c21('0x27')][_0x7c21('0x49')]({'name':_0x42dce2[_0x7c21('0x2a')],'resourceId':_0x42dce2['id'],'type':_0x7c21('0x26'),'sectionId':_0x273f5c['id']},{})[_0x7c21('0x24')](function(){return _0x4142f9;});}else{return _0x4142f9;}})['catch'](function(_0x18da43){logger[_0x7c21('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18da43);throw _0x18da43;});}return _0x4142f9;})[_0x7c21('0x24')](respondWithResult(_0x4c93e6,0xc9))[_0x7c21('0x44')](handleError(_0x4c93e6,null));};exports['update']=function(_0xd97085,_0x3ca526){if(_0xd97085[_0x7c21('0x4a')]['id']){delete _0xd97085[_0x7c21('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x7c21('0x52')]({'where':{'id':_0xd97085[_0x7c21('0x46')]['id']}})[_0x7c21('0x24')](handleEntityNotFound(_0x3ca526,null))[_0x7c21('0x24')](saveUpdates(_0xd97085[_0x7c21('0x4a')],null))[_0x7c21('0x24')](respondWithResult(_0x3ca526,null))[_0x7c21('0x44')](handleError(_0x3ca526,null));};exports[_0x7c21('0x28')]=function(_0x29052d,_0xfd81b9){return db[_0x7c21('0x40')][_0x7c21('0x52')]({'where':{'id':_0x29052d['params']['id']}})['then'](handleEntityNotFound(_0xfd81b9,null))['then'](removeEntity(_0xfd81b9,null))[_0x7c21('0x44')](handleError(_0xfd81b9,null));};exports[_0x7c21('0x53')]=function(_0x506510,_0xfea710){var _0x3bd527=0xa;var _0x5c30ef=[_0x7c21('0x54'),_0x7c21('0x55'),_0x7c21('0x56'),'cross_join'];var _0x27184d={'SUM':_0x7c21('0x57'),'COUNT':_0x7c21('0x58'),'COUNT DISTINCT':_0x7c21('0x59'),'MAX':_0x7c21('0x5a'),'MIN':_0x7c21('0x5b'),'AVG':_0x7c21('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7c21('0x5d')};var _0x4fb1b6={'SEC_TO_TIME':_0x7c21('0x5e'),'DATE':_0x7c21('0x5f'),'HOUR':_0x7c21('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7c21('0x61')};var _0x1db4d9=function(_0x15eb37){return!_[_0x7c21('0x62')]([_0x7c21('0x63'),_0x7c21('0x64'),_0x7c21('0x65'),_0x7c21('0x66')],_0x15eb37);};var _0xc08090=function(_0xc86b83){if(!_0xc86b83||!_0xc86b83[_0x7c21('0x67')][_0x7c21('0x38')]){return'';}for(var _0x3434e5='(',_0x57a744=0x0;_0x57a744<_0xc86b83['rules'][_0x7c21('0x38')];_0x57a744+=0x1){_0x57a744>0x0&&(_0x3434e5+='\x20'+_0xc86b83['operator']+'\x20');_0x3434e5+=_0xc86b83['rules'][_0x57a744][_0x7c21('0x68')]?_0xc08090(_0xc86b83[_0x7c21('0x67')][_0x57a744][_0x7c21('0x68')]):_0xc86b83[_0x7c21('0x67')][_0x57a744][_0x7c21('0x69')]+'\x20'+_0xc86b83[_0x7c21('0x67')][_0x57a744]['condition']+(_0x1db4d9(_0xc86b83[_0x7c21('0x67')][_0x57a744]['condition'])?'\x20'+_0xc86b83[_0x7c21('0x67')][_0x57a744][_0x7c21('0x6a')]:'');}return _0x3434e5+')';};var _0x5a1583={'where':{'id':_0x506510[_0x7c21('0x46')]['id']}},_0x5266ad,_0x1a3d7b,_0x14f63f,_0x157b0e,_0x14de44;_0x5a1583=_[_0x7c21('0x3e')]({},_0x5a1583,_0x506510[_0x7c21('0x48')]);return db[_0x7c21('0x40')][_0x7c21('0x52')](_0x5a1583)[_0x7c21('0x24')](function(_0x56e7ed){if(_0x56e7ed){_0x5266ad=_0x56e7ed;return _0x56e7ed['getFields']();}return null;})[_0x7c21('0x24')](function(_0x3e04ca){if(_0x3e04ca){if(!_0x3e04ca[_0x7c21('0x38')]){throw new db[(_0x7c21('0x6b'))][(_0x7c21('0x6c'))](_0x7c21('0x6d'),0x193);}_0x1a3d7b=_0x3e04ca;return db[_0x7c21('0x6e')][_0x7c21('0x42')]({'raw':!![]});}return null;})[_0x7c21('0x24')](function(_0x4a2b44){if(_0x4a2b44){_0x14f63f=_[_0x7c21('0x6f')](_0x4a2b44,'id');var _0x3ac98a;var _0x5c0382=squel[_0x7c21('0x70')]();_0x5c0382[_0x7c21('0x71')](_0x5266ad[_0x7c21('0x72')]);for(var _0x2e16b8=0x0;_0x2e16b8<_0x1a3d7b[_0x7c21('0x38')];_0x2e16b8+=0x1){_0x3ac98a=_0x1a3d7b[_0x2e16b8]['MetricId']?_0x14f63f[_0x1a3d7b[_0x2e16b8][_0x7c21('0x73')]][_0x7c21('0x74')]:_0x1a3d7b[_0x2e16b8][_0x7c21('0x69')];_0x3ac98a=_0x1a3d7b[_0x2e16b8][_0x7c21('0x75')]?_['replace'](_0x27184d[_0x1a3d7b[_0x2e16b8][_0x7c21('0x75')]],'%s',_0x3ac98a):_0x3ac98a;_0x3ac98a=_0x1a3d7b[_0x2e16b8][_0x7c21('0x76')]?_['replace'](_0x4fb1b6[_0x1a3d7b[_0x2e16b8][_0x7c21('0x76')]],'%s',_0x3ac98a):_0x3ac98a;if(_0x1a3d7b[_0x2e16b8][_0x7c21('0x77')]){_0x5c0382['group'](_0x3ac98a);}_0x1a3d7b[_0x2e16b8]['orderBy']&&_0x5c0382[_0x7c21('0x3a')](_0x3ac98a,_0x1a3d7b[_0x2e16b8][_0x7c21('0x78')]===_0x7c21('0x79')?![]:!![]);_0x5c0382[_0x7c21('0x69')](_0x3ac98a,_0x1a3d7b[_0x2e16b8][_0x7c21('0x7a')]||_0x3ac98a);}if(_0x5266ad[_0x7c21('0x7b')]){_0x5266ad[_0x7c21('0x7b')]=JSON[_0x7c21('0x7c')](_0x5266ad[_0x7c21('0x7b')]);for(var _0x3ca6ae=0x0;_0x3ca6ae<_0x5266ad[_0x7c21('0x7b')]['length'];_0x3ca6ae+=0x1){if(_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x3f')]&&_[_0x7c21('0x62')](_0x5c30ef,_0x5266ad['joins'][_0x3ca6ae][_0x7c21('0x3f')])&&_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7d')]&&_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae]['foreignTable']&&_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7e')]){_0x5c0382[_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x3f')]](_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7f')],null,util[_0x7c21('0x76')](_0x7c21('0x80'),_0x5266ad['table'],_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae]['parentKey'],_0x5266ad['joins'][_0x3ca6ae][_0x7c21('0x7f')],_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7e')]));}}}if(_0x5266ad[_0x7c21('0x81')]){_0x5266ad['conditions']=JSON[_0x7c21('0x7c')](_0x5266ad['conditions']);_0x5c0382[_0x7c21('0x3c')](_0xc08090(_0x5266ad[_0x7c21('0x81')]['group']));}_0x14de44=_0x5c0382['clone']();_0x5c0382[_0x7c21('0x1f')](_0x3bd527);_0x5c0382['offset'](0x0);logger[_0x7c21('0x82')](_0x7c21('0x83'),_0x5c0382[_0x7c21('0x84')]());return dbH['sequelize'][_0x7c21('0x32')](_0x5c0382[_0x7c21('0x84')](),{'type':dbH[_0x7c21('0x85')][_0x7c21('0x86')][_0x7c21('0x87')]});}})['then'](respondWithResult(_0xfea710,null))[_0x7c21('0x44')](handleError(_0xfea710,null));};function runReport(_0x306e95,_0x1300f3,_0x2e7501){var _0x33c2c4=_0x1300f3[_0x7c21('0x2a')];var _0xfae9db=0xa;var _0x244eec=[_0x7c21('0x54'),'left_join','right_join',_0x7c21('0x88')];var _0x3b9a6a={'SUM':_0x7c21('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7c21('0x59'),'MAX':'MAX(%s)','MIN':_0x7c21('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7c21('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7c21('0x5d')};var _0x5753ac={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7c21('0x5f'),'HOUR':_0x7c21('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7c21('0x61')};var _0x23441e=function(_0x27cf8e){return!_[_0x7c21('0x62')]([_0x7c21('0x63'),_0x7c21('0x64'),_0x7c21('0x65'),_0x7c21('0x66')],_0x27cf8e);};var _0x369ed5=function(_0x5a43cb){if(!_0x5a43cb||!_0x5a43cb[_0x7c21('0x67')][_0x7c21('0x38')]){return'';}for(var _0x33412d='(',_0x1d5184=0x0;_0x1d5184<_0x5a43cb[_0x7c21('0x67')][_0x7c21('0x38')];_0x1d5184+=0x1){_0x1d5184>0x0&&(_0x33412d+='\x20'+_0x5a43cb[_0x7c21('0x8a')]+'\x20');_0x33412d+=_0x5a43cb['rules'][_0x1d5184][_0x7c21('0x68')]?_0x369ed5(_0x5a43cb[_0x7c21('0x67')][_0x1d5184][_0x7c21('0x68')]):_0x5a43cb[_0x7c21('0x67')][_0x1d5184]['field']+'\x20'+_0x5a43cb[_0x7c21('0x67')][_0x1d5184][_0x7c21('0x8b')]+(_0x23441e(_0x5a43cb['rules'][_0x1d5184][_0x7c21('0x8b')])?'\x20'+_0x5a43cb[_0x7c21('0x67')][_0x1d5184]['value']:'');}return _0x33412d+')';};var _0xa1d104={'where':{'id':_0x306e95['id']}},_0x5839dc,_0x4e3f73,_0x48cd3c,_0x49f0af,_0x3b6902;_0xa1d104=_[_0x7c21('0x3e')]({},_0xa1d104,_0x2e7501);return db[_0x7c21('0x40')][_0x7c21('0x52')](_0xa1d104)[_0x7c21('0x24')](function(_0xa7f6c3){if(_0xa7f6c3){_0x5839dc=_0xa7f6c3;return _0xa7f6c3[_0x7c21('0x8c')]();}return null;})['then'](function(_0x2377e9){if(_0x2377e9){if(!_0x2377e9[_0x7c21('0x38')]){throw new db[(_0x7c21('0x6b'))]['ValidationErrorItem'](_0x7c21('0x6d'),0x193);}_0x4e3f73=_0x2377e9;return db[_0x7c21('0x6e')][_0x7c21('0x42')]({'raw':!![]});}return null;})[_0x7c21('0x24')](function(_0x451edc){if(_0x451edc){_0x48cd3c=_['keyBy'](_0x451edc,'id');var _0x3c13e4;var _0x2ae727=squel[_0x7c21('0x70')]();_0x2ae727[_0x7c21('0x71')](_0x5839dc[_0x7c21('0x72')]);for(var _0xb77eb7=0x0;_0xb77eb7<_0x4e3f73[_0x7c21('0x38')];_0xb77eb7+=0x1){_0x3c13e4=_0x4e3f73[_0xb77eb7][_0x7c21('0x73')]?_0x48cd3c[_0x4e3f73[_0xb77eb7][_0x7c21('0x73')]][_0x7c21('0x74')]:_0x4e3f73[_0xb77eb7][_0x7c21('0x69')];_0x3c13e4=_0x4e3f73[_0xb77eb7][_0x7c21('0x75')]?_[_0x7c21('0x8d')](_0x3b9a6a[_0x4e3f73[_0xb77eb7][_0x7c21('0x75')]],'%s',_0x3c13e4):_0x3c13e4;_0x3c13e4=_0x4e3f73[_0xb77eb7]['format']?_[_0x7c21('0x8d')](_0x5753ac[_0x4e3f73[_0xb77eb7][_0x7c21('0x76')]],'%s',_0x3c13e4):_0x3c13e4;if(_0x4e3f73[_0xb77eb7][_0x7c21('0x77')]){_0x2ae727[_0x7c21('0x68')](_0x3c13e4);}_0x4e3f73[_0xb77eb7]['orderBy']&&_0x2ae727['order'](_0x3c13e4,_0x4e3f73[_0xb77eb7][_0x7c21('0x78')]==='DESC'?![]:!![]);_0x2ae727[_0x7c21('0x69')](_0x3c13e4,_0x4e3f73[_0xb77eb7][_0x7c21('0x7a')]||_0x3c13e4);}if(_0x5839dc[_0x7c21('0x7b')]){_0x5839dc['joins']=JSON['parse'](_0x5839dc[_0x7c21('0x7b')]);for(var _0x2e0cd2=0x0;_0x2e0cd2<_0x5839dc[_0x7c21('0x7b')][_0x7c21('0x38')];_0x2e0cd2+=0x1){if(_0x5839dc['joins'][_0x2e0cd2][_0x7c21('0x3f')]&&_[_0x7c21('0x62')](_0x244eec,_0x5839dc['joins'][_0x2e0cd2][_0x7c21('0x3f')])&&_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x7d')]&&_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x7f')]&&_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['foreignKey']){_0x2ae727[_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x3f')]](_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x7f')],null,util[_0x7c21('0x76')](_0x7c21('0x80'),_0x5839dc['table'],_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['parentKey'],_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['foreignTable'],_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['foreignKey']));}}}if(_0x5839dc[_0x7c21('0x81')]){_0x5839dc[_0x7c21('0x81')]=JSON[_0x7c21('0x7c')](_0x5839dc[_0x7c21('0x81')]);_0x2ae727[_0x7c21('0x3c')](_0x369ed5(_0x5839dc[_0x7c21('0x81')][_0x7c21('0x68')]));}_0x3b6902=_0x2ae727[_0x7c21('0x8e')]();_0x2ae727[_0x7c21('0x1f')](_0xfae9db);_0x2ae727[_0x7c21('0x1e')](0x0);return;}})[_0x7c21('0x24')](function(){if(_0x1300f3['output']==='web'){return null;}var _0x8066a2=_[_0x7c21('0x3e')](_0x1300f3,{'name':_0x1300f3[_0x7c21('0x8f')]||_0x1300f3[_0x7c21('0x2a')]||_0x5839dc[_0x7c21('0x2a')],'basename':_0x33c2c4,'savename':util[_0x7c21('0x76')](_0x7c21('0x90'),_0x1300f3[_0x7c21('0x2a')]||_0x5839dc[_0x7c21('0x2a')],require(_0x7c21('0x91'))[_0x7c21('0x92')](0x4),_0x1300f3[_0x7c21('0x93')]||_0x7c21('0x94')),'reportId':_0x5839dc['id'],'reportType':_0x7c21('0x95')});return db['AnalyticExtractedReport'][_0x7c21('0x49')](_0x8066a2,{'raw':!![]});})['then'](function(_0x66f08f){if(_0x5839dc['table']===_0x7c21('0x96')){_0x3b6902['where'](_0x5839dc[_0x7c21('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1300f3[_0x7c21('0x97')],_0x1300f3['endDate']);}else{_0x3b6902[_0x7c21('0x3c')](_0x5839dc[_0x7c21('0x72')]+_0x7c21('0x98'),_0x1300f3['startDate'],_0x1300f3[_0x7c21('0x99')]);}if(_0x66f08f){logger[_0x7c21('0x9a')](_0x7c21('0x9b'),_0x3b6902[_0x7c21('0x84')]());require(_0x7c21('0x9c'))['fork'](path[_0x7c21('0x54')](__dirname,'../../components/export/',_0x66f08f['output']),[_0x66f08f['id'],_0x3b6902[_0x7c21('0x84')](),path[_0x7c21('0x54')](__dirname,_0x7c21('0x9d'),_0x66f08f[_0x7c21('0x9e')]),_0x33c2c4]);return _0x66f08f;}else{var _0x1048ae=squel[_0x7c21('0x70')]();_0x1048ae[_0x7c21('0x71')]('('+_0x3b6902[_0x7c21('0x84')]()+')',_0x7c21('0x9f'));_0x1048ae[_0x7c21('0x69')]('COUNT(*)',_0x7c21('0x21'));_0x3b6902[_0x7c21('0x1f')](_0x1300f3[_0x7c21('0x1f')]||_0xfae9db);_0x3b6902[_0x7c21('0x1e')](_0x1300f3[_0x7c21('0x1e')]||0x0);return dbH[_0x7c21('0x85')][_0x7c21('0x32')](_0x1048ae['toString'](),{'type':dbH[_0x7c21('0x85')][_0x7c21('0x86')]['SELECT']})[_0x7c21('0x24')](function(_0x4d64a1){if(!_0x4d64a1[_0x7c21('0x38')]){_0x49f0af=0x0;}else{_0x49f0af=_0x4d64a1[0x0][_0x7c21('0x21')]||0x0;}return dbH[_0x7c21('0x85')][_0x7c21('0x32')](_0x3b6902['toString'](),{'type':dbH[_0x7c21('0x85')][_0x7c21('0x86')]['SELECT']});})[_0x7c21('0x24')](function(_0x2e6dbe){return{'rows':_0x2e6dbe||[],'count':_0x49f0af};});}});}exports[_0x7c21('0xa0')]=function(_0x2456ae,_0x85ac11){return runReport(_0x2456ae['params'],_0x2456ae['query'],_0x2456ae[_0x7c21('0x48')])[_0x7c21('0x24')](respondWithResult(_0x85ac11,null))[_0x7c21('0x44')](handleError(_0x85ac11,null));};exports['runReport']=runReport;exports['query']=function(_0x2a944c,_0x347d84){var _0x558c62=0xa;var _0x3577ed=[_0x7c21('0x54'),_0x7c21('0x55'),'right_join',_0x7c21('0x88')];var _0x5091dd={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7c21('0x59'),'MAX':_0x7c21('0x5a'),'MIN':_0x7c21('0x5b'),'AVG':_0x7c21('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7c21('0xa1'),'GROUP_CONCAT DESC':_0x7c21('0x5d')};var _0xec1d30={'SEC_TO_TIME':_0x7c21('0x5e'),'DATE':_0x7c21('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x7c21('0xa2'),'UNIX_TIMESTAMP':_0x7c21('0x61')};var _0x3472a5=function(_0x5c713e){return!_[_0x7c21('0x62')]([_0x7c21('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x7c21('0x66')],_0x5c713e);};var _0x2cc5a4=function(_0x1532d4){if(!_0x1532d4||!_0x1532d4['rules']['length']){return'';}for(var _0x40e3db='(',_0x5ad922=0x0;_0x5ad922<_0x1532d4['rules']['length'];_0x5ad922+=0x1){_0x5ad922>0x0&&(_0x40e3db+='\x20'+_0x1532d4[_0x7c21('0x8a')]+'\x20');_0x40e3db+=_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x68')]?_0x2cc5a4(_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x68')]):_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x69')]+'\x20'+_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x8b')]+(_0x3472a5(_0x1532d4[_0x7c21('0x67')][_0x5ad922]['condition'])?'\x20'+_0x1532d4[_0x7c21('0x67')][_0x5ad922]['value']:'');}return _0x40e3db+')';};var _0x43832d={'where':{'id':_0x2a944c[_0x7c21('0x46')]['id']}},_0xf45b0a,_0x12b79c,_0x89ff9c,_0x409c16,_0x2d96f3;_0x43832d=_[_0x7c21('0x3e')]({},_0x43832d,_0x2a944c[_0x7c21('0x48')]);return db[_0x7c21('0x40')][_0x7c21('0x52')](_0x43832d)[_0x7c21('0x24')](function(_0x10467f){if(_0x10467f){_0xf45b0a=_0x10467f;return _0x10467f['getFields']();}return null;})[_0x7c21('0x24')](function(_0x22656c){if(_0x22656c){if(!_0x22656c['length']){throw new db[(_0x7c21('0x6b'))]['ValidationErrorItem'](_0x7c21('0x6d'),0x193);}_0x12b79c=_0x22656c;return db[_0x7c21('0x6e')][_0x7c21('0x42')]({'raw':!![]});}return null;})[_0x7c21('0x24')](function(_0x1e4c7d){if(_0x1e4c7d){_0x89ff9c=_['keyBy'](_0x1e4c7d,'id');var _0x2f0802;var _0x24f57d=squel[_0x7c21('0x70')]();_0x24f57d[_0x7c21('0x71')](_0xf45b0a[_0x7c21('0x72')]);for(var _0x3b4c8a=0x0;_0x3b4c8a<_0x12b79c[_0x7c21('0x38')];_0x3b4c8a+=0x1){_0x2f0802=_0x12b79c[_0x3b4c8a][_0x7c21('0x73')]?_0x89ff9c[_0x12b79c[_0x3b4c8a][_0x7c21('0x73')]][_0x7c21('0x74')]:_0x12b79c[_0x3b4c8a][_0x7c21('0x69')];_0x2f0802=_0x12b79c[_0x3b4c8a]['function']?_['replace'](_0x5091dd[_0x12b79c[_0x3b4c8a][_0x7c21('0x75')]],'%s',_0x2f0802):_0x2f0802;_0x2f0802=_0x12b79c[_0x3b4c8a]['format']?_[_0x7c21('0x8d')](_0xec1d30[_0x12b79c[_0x3b4c8a]['format']],'%s',_0x2f0802):_0x2f0802;if(_0x12b79c[_0x3b4c8a][_0x7c21('0x77')]){_0x24f57d[_0x7c21('0x68')](_0x2f0802);}_0x12b79c[_0x3b4c8a][_0x7c21('0x78')]&&_0x24f57d[_0x7c21('0x3a')](_0x2f0802,_0x12b79c[_0x3b4c8a]['orderBy']===_0x7c21('0x79')?![]:!![]);_0x24f57d['field'](_0x2f0802,_0x12b79c[_0x3b4c8a]['alias']||_0x2f0802);}if(_0xf45b0a[_0x7c21('0x7b')]){_0xf45b0a[_0x7c21('0x7b')]=JSON[_0x7c21('0x7c')](_0xf45b0a[_0x7c21('0x7b')]);for(var _0x41154c=0x0;_0x41154c<_0xf45b0a[_0x7c21('0x7b')][_0x7c21('0x38')];_0x41154c+=0x1){if(_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x3f')]&&_[_0x7c21('0x62')](_0x3577ed,_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x3f')])&&_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x7d')]&&_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x7f')]&&_0xf45b0a[_0x7c21('0x7b')][_0x41154c]['foreignKey']){_0x24f57d[_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x3f')]](_0xf45b0a['joins'][_0x41154c][_0x7c21('0x7f')],null,util[_0x7c21('0x76')](_0x7c21('0x80'),_0xf45b0a[_0x7c21('0x72')],_0xf45b0a[_0x7c21('0x7b')][_0x41154c]['parentKey'],_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x7f')],_0xf45b0a['joins'][_0x41154c][_0x7c21('0x7e')]));}}}if(_0xf45b0a[_0x7c21('0x81')]){_0xf45b0a[_0x7c21('0x81')]=JSON[_0x7c21('0x7c')](_0xf45b0a[_0x7c21('0x81')]);_0x24f57d[_0x7c21('0x3c')](_0x2cc5a4(_0xf45b0a[_0x7c21('0x81')][_0x7c21('0x68')]));}_0x2d96f3=_0x24f57d['clone']();_0x24f57d['limit'](_0x558c62);_0x24f57d['offset'](0x0);logger['debug'](_0x7c21('0x83'),_0x24f57d['toString']());return dbH[_0x7c21('0x85')]['query'](_0x24f57d['toString'](),{'type':dbH[_0x7c21('0x85')]['QueryTypes'][_0x7c21('0x87')]});}})['then'](function(){return{'sql':_0x2d96f3[_0x7c21('0x84')]()};})[_0x7c21('0x24')](respondWithResult(_0x347d84,null))[_0x7c21('0x44')](handleError(_0x347d84,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 6fb48e5..6a731e1 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 _0x6548=['bluebird','path','rimraf','../../config/environment','exports','define','analytics_custom_reports','util','../../config/logger','api'];(function(_0x497e9e,_0x36e053){var _0x2aaf55=function(_0x476fa3){while(--_0x476fa3){_0x497e9e['push'](_0x497e9e['shift']());}};_0x2aaf55(++_0x36e053);}(_0x6548,0x151));var _0x8654=function(_0x1c9995,_0x542b6e){_0x1c9995=_0x1c9995-0x0;var _0x47a31a=_0x6548[_0x1c9995];return _0x47a31a;};'use strict';var _=require('lodash');var util=require(_0x8654('0x0'));var logger=require(_0x8654('0x1'))(_0x8654('0x2'));var moment=require('moment');var BPromise=require(_0x8654('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8654('0x4'));var rimraf=require(_0x8654('0x5'));var config=require(_0x8654('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x8654('0x7')]=function(_0x224d30,_0x4bce57){return _0x224d30[_0x8654('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x8654('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b84=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28e1e1,_0x4c99b2){var _0x34698a=function(_0x550ed1){while(--_0x550ed1){_0x28e1e1['push'](_0x28e1e1['shift']());}};_0x34698a(++_0x4c99b2);}(_0x1b84,0x178));var _0x41b8=function(_0x51b214,_0x463e42){_0x51b214=_0x51b214-0x0;var _0x57bc84=_0x1b84[_0x51b214];return _0x57bc84;};'use strict';var _=require(_0x41b8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x41b8('0x1'));var moment=require(_0x41b8('0x2'));var BPromise=require(_0x41b8('0x3'));var rp=require(_0x41b8('0x4'));var fs=require('fs');var path=require(_0x41b8('0x5'));var rimraf=require(_0x41b8('0x6'));var config=require(_0x41b8('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x41b8('0x8')]=function(_0x24b866,_0x464720){return _0x24b866[_0x41b8('0x9')](_0x41b8('0xa'),attributes,{'tableName':_0x41b8('0xb'),'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 cb0632f..3b45b3a 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 _0xe174=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','ioredis','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f47a2,_0x67272d){var _0x53813f=function(_0x4c173f){while(--_0x4c173f){_0x4f47a2['push'](_0x4f47a2['shift']());}};_0x53813f(++_0x67272d);}(_0xe174,0x102));var _0x4e17=function(_0x565b23,_0x2ba1ee){_0x565b23=_0x565b23-0x0;var _0x20913c=_0xe174[_0x565b23];return _0x20913c;};'use strict';var _=require(_0x4e17('0x0'));var util=require(_0x4e17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e17('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e17('0x3'));var config=require(_0x4e17('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4e17('0x5')][_0x4e17('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x268b84,_0x26bb10,_0x57dc27){return new BPromise(function(_0x6a326e,_0x50b578){return client['request'](_0x268b84,_0x57dc27)[_0x4e17('0x7')](function(_0x40c11b){logger[_0x4e17('0x8')](_0x4e17('0x9'),_0x26bb10,_0x4e17('0xa'));logger[_0x4e17('0xb')](_0x4e17('0xc'),_0x26bb10,'request\x20sent',JSON[_0x4e17('0xd')](_0x40c11b));if(_0x40c11b['error']){if(_0x40c11b[_0x4e17('0xe')][_0x4e17('0xf')]===0x1f4){logger[_0x4e17('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x26bb10,_0x40c11b[_0x4e17('0xe')]['message']);return _0x50b578(_0x40c11b[_0x4e17('0xe')]['message']);}logger[_0x4e17('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x26bb10,_0x40c11b[_0x4e17('0xe')][_0x4e17('0x10')]);return _0x6a326e(_0x40c11b[_0x4e17('0xe')]['message']);}else{logger[_0x4e17('0x8')](_0x4e17('0x9'),_0x26bb10,_0x4e17('0xa'));_0x6a326e(_0x40c11b['result']['message']);}})[_0x4e17('0x11')](function(_0x269b72){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x26bb10,_0x269b72);_0x50b578(_0x269b72);});});} \ No newline at end of file +var _0x5720=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x5720,0x1e9));var _0x0572=function(_0x28d396,_0x50bd20){_0x28d396=_0x28d396-0x0;var _0x3bdb1d=_0x5720[_0x28d396];return _0x3bdb1d;};'use strict';var _=require('lodash');var util=require(_0x0572('0x0'));var moment=require(_0x0572('0x1'));var BPromise=require(_0x0572('0x2'));var rs=require(_0x0572('0x3'));var fs=require('fs');var Redis=require(_0x0572('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0572('0x5'))(_0x0572('0x6'));var config=require(_0x0572('0x7'));var jayson=require(_0x0572('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d16e2,_0x352eeb,_0x3a2a33){return new BPromise(function(_0x16a97f,_0x308c97){return client[_0x0572('0x9')](_0x3d16e2,_0x3a2a33)[_0x0572('0xa')](function(_0x33e524){logger[_0x0572('0xb')](_0x0572('0xc'),_0x352eeb,_0x0572('0xd'));logger[_0x0572('0xe')](_0x0572('0xf'),_0x352eeb,_0x0572('0xd'),JSON[_0x0572('0x10')](_0x33e524));if(_0x33e524['error']){if(_0x33e524[_0x0572('0x11')][_0x0572('0x12')]===0x1f4){logger[_0x0572('0x11')](_0x0572('0xc'),_0x352eeb,_0x33e524[_0x0572('0x11')][_0x0572('0x13')]);return _0x308c97(_0x33e524['error']['message']);}logger[_0x0572('0x11')](_0x0572('0xc'),_0x352eeb,_0x33e524[_0x0572('0x11')][_0x0572('0x13')]);return _0x16a97f(_0x33e524[_0x0572('0x11')][_0x0572('0x13')]);}else{logger[_0x0572('0xb')](_0x0572('0xc'),_0x352eeb,_0x0572('0xd'));_0x16a97f(_0x33e524[_0x0572('0x14')][_0x0572('0x13')]);}})[_0x0572('0x15')](function(_0x40f9cd){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x352eeb,_0x40f9cd);_0x308c97(_0x40f9cd);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index c31553c..77cd984 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 _0x8a8d=['query','update','delete','exports','path','connect-timeout','Router','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','/:id/run','run'];(function(_0x25d2bd,_0x4b5453){var _0x1852de=function(_0x500db8){while(--_0x500db8){_0x25d2bd['push'](_0x25d2bd['shift']());}};_0x1852de(++_0x4b5453);}(_0x8a8d,0xc4));var _0xd8a8=function(_0x1f2773,_0x153741){_0x1f2773=_0x1f2773-0x0;var _0x3eda0f=_0x8a8d[_0x1f2773];return _0x3eda0f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd8a8('0x0'));var timeout=require(_0xd8a8('0x1'));var express=require('express');var router=express[_0xd8a8('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd8a8('0x3'));var config=require('../../config/environment');var controller=require(_0xd8a8('0x4'));router[_0xd8a8('0x5')]('/',auth[_0xd8a8('0x6')](),controller[_0xd8a8('0x7')]);router[_0xd8a8('0x5')](_0xd8a8('0x8'),auth[_0xd8a8('0x6')](),controller['show']);router['get'](_0xd8a8('0x9'),auth[_0xd8a8('0x6')](),controller['preview']);router[_0xd8a8('0x5')](_0xd8a8('0xa'),auth['isAuthenticated'](),controller[_0xd8a8('0xb')]);router['get']('/:id/query',auth[_0xd8a8('0x6')](),controller[_0xd8a8('0xc')]);router['post']('/',auth[_0xd8a8('0x6')](),controller['create']);router['put'](_0xd8a8('0x8'),auth[_0xd8a8('0x6')](),controller[_0xd8a8('0xd')]);router[_0xd8a8('0xe')](_0xd8a8('0x8'),auth[_0xd8a8('0x6')](),controller['destroy']);module[_0xd8a8('0xf')]=router; \ No newline at end of file +var _0xb853=['query','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query'];(function(_0x49bd05,_0xf8935){var _0x2b5ea0=function(_0x40b504){while(--_0x40b504){_0x49bd05['push'](_0x49bd05['shift']());}};_0x2b5ea0(++_0xf8935);}(_0xb853,0x96));var _0x3b85=function(_0x35e1e5,_0x1a17b5){_0x35e1e5=_0x35e1e5-0x0;var _0x18b21c=_0xb853[_0x35e1e5];return _0x18b21c;};'use strict';var multer=require(_0x3b85('0x0'));var util=require(_0x3b85('0x1'));var path=require(_0x3b85('0x2'));var timeout=require(_0x3b85('0x3'));var express=require(_0x3b85('0x4'));var router=express[_0x3b85('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3b85('0x6'));var config=require(_0x3b85('0x7'));var controller=require(_0x3b85('0x8'));router[_0x3b85('0x9')]('/',auth[_0x3b85('0xa')](),controller[_0x3b85('0xb')]);router[_0x3b85('0x9')](_0x3b85('0xc'),auth['isAuthenticated'](),controller[_0x3b85('0xd')]);router[_0x3b85('0x9')](_0x3b85('0xe'),auth[_0x3b85('0xa')](),controller['preview']);router[_0x3b85('0x9')](_0x3b85('0xf'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x10')]);router['get'](_0x3b85('0x11'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x12')]);router[_0x3b85('0x13')]('/',auth['isAuthenticated'](),controller[_0x3b85('0x14')]);router['put'](_0x3b85('0xc'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x15')]);router[_0x3b85('0x16')](_0x3b85('0xc'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index fb413b7..661f7f1 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x35d649,_0x331b46){var _0x31489d=function(_0x1a8bfd){while(--_0x1a8bfd){_0x35d649['push'](_0x35d649['shift']());}};_0x31489d(++_0x331b46);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xdc97,0x13b));var _0x7dc9=function(_0x41d03b,_0x2df68a){_0x41d03b=_0x41d03b-0x0;var _0x1ac319=_0xdc97[_0x41d03b];return _0x1ac319;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 2b66624..30f378a 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x4195ab,_0x54a952){var _0x4eb46f=function(_0x5b4c5c){while(--_0x5b4c5c){_0x4195ab['push'](_0x4195ab['shift']());}};_0x4eb46f(++_0x54a952);}(_0x31f0,0xb7));var _0x031f=function(_0x228481,_0x27f47a){_0x228481=_0x228481-0x0;var _0x18f590=_0x31f0[_0x228481];return _0x18f590;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file +var _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','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','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x326f,0xd1));var _0xf326=function(_0x5904e4,_0x83cf65){_0x5904e4=_0x5904e4-0x0;var _0x3d825b=_0x326f[_0x5904e4];return _0x3d825b;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a494b68..b57cabe 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 _0x80ce=['analytics_default_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x4cc593,_0x82927){var _0x1ac9e7=function(_0x50892a){while(--_0x50892a){_0x4cc593['push'](_0x4cc593['shift']());}};_0x1ac9e7(++_0x82927);}(_0x80ce,0x15d));var _0xe80c=function(_0x1c1d22,_0x579c90){_0x1c1d22=_0x1c1d22-0x0;var _0x1733d8=_0x80ce[_0x1c1d22];return _0x1733d8;};'use strict';var _=require(_0xe80c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe80c('0x1'));var moment=require(_0xe80c('0x2'));var BPromise=require(_0xe80c('0x3'));var rp=require(_0xe80c('0x4'));var fs=require('fs');var path=require(_0xe80c('0x5'));var rimraf=require(_0xe80c('0x6'));var config=require(_0xe80c('0x7'));var attributes=require(_0xe80c('0x8'));module[_0xe80c('0x9')]=function(_0x5f1b03,_0x4f0ca2){return _0x5f1b03['define'](_0xe80c('0xa'),attributes,{'tableName':_0xe80c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25ac=['analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x25ac,0x160));var _0xc25a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc25a('0x0'));var util=require(_0xc25a('0x1'));var logger=require(_0xc25a('0x2'))(_0xc25a('0x3'));var moment=require(_0xc25a('0x4'));var BPromise=require(_0xc25a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc25a('0x6'));var rimraf=require('rimraf');var config=require(_0xc25a('0x7'));var attributes=require(_0xc25a('0x8'));module[_0xc25a('0x9')]=function(_0x340f54,_0x4fc72d){return _0x340f54[_0xc25a('0xa')](_0xc25a('0xb'),attributes,{'tableName':_0xc25a('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 7167ba2..f20adf8 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 _0xbbe0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x453536,_0x46622b){var _0x252fb0=function(_0x14e766){while(--_0x14e766){_0x453536['push'](_0x453536['shift']());}};_0x252fb0(++_0x46622b);}(_0xbbe0,0x12f));var _0x0bbe=function(_0x1b68a9,_0x3a71df){_0x1b68a9=_0x1b68a9-0x0;var _0x5b6502=_0xbbe0[_0x1b68a9];return _0x5b6502;};'use strict';var _=require(_0x0bbe('0x0'));var util=require(_0x0bbe('0x1'));var moment=require(_0x0bbe('0x2'));var BPromise=require(_0x0bbe('0x3'));var rs=require(_0x0bbe('0x4'));var fs=require('fs');var Redis=require(_0x0bbe('0x5'));var db=require(_0x0bbe('0x6'))['db'];var utils=require(_0x0bbe('0x7'));var logger=require(_0x0bbe('0x8'))('rpc');var config=require(_0x0bbe('0x9'));var jayson=require(_0x0bbe('0xa'));var client=jayson['client'][_0x0bbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e6672,_0x4b6832,_0x5b8738){return new BPromise(function(_0x10f4b3,_0x42ebcc){return client['request'](_0x4e6672,_0x5b8738)[_0x0bbe('0xc')](function(_0x4fda0a){logger[_0x0bbe('0xd')](_0x0bbe('0xe'),_0x4b6832,_0x0bbe('0xf'));logger[_0x0bbe('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4b6832,_0x0bbe('0xf'),JSON[_0x0bbe('0x11')](_0x4fda0a));if(_0x4fda0a[_0x0bbe('0x12')]){if(_0x4fda0a['error'][_0x0bbe('0x13')]===0x1f4){logger['error'](_0x0bbe('0xe'),_0x4b6832,_0x4fda0a[_0x0bbe('0x12')][_0x0bbe('0x14')]);return _0x42ebcc(_0x4fda0a[_0x0bbe('0x12')]['message']);}logger[_0x0bbe('0x12')](_0x0bbe('0xe'),_0x4b6832,_0x4fda0a[_0x0bbe('0x12')][_0x0bbe('0x14')]);return _0x10f4b3(_0x4fda0a[_0x0bbe('0x12')][_0x0bbe('0x14')]);}else{logger['info'](_0x0bbe('0xe'),_0x4b6832,_0x0bbe('0xf'));_0x10f4b3(_0x4fda0a[_0x0bbe('0x15')][_0x0bbe('0x14')]);}})['catch'](function(_0x5fafab){logger[_0x0bbe('0x12')](_0x0bbe('0xe'),_0x4b6832,_0x5fafab);_0x42ebcc(_0x5fafab);});});} \ No newline at end of file +var _0xf6de=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4964f4,_0x2ee37a){var _0x28c889=function(_0x3d84a4){while(--_0x3d84a4){_0x4964f4['push'](_0x4964f4['shift']());}};_0x28c889(++_0x2ee37a);}(_0xf6de,0xfb));var _0xef6d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xf6de[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0xef6d('0x0'));var moment=require(_0xef6d('0x1'));var BPromise=require(_0xef6d('0x2'));var rs=require(_0xef6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef6d('0x5'))(_0xef6d('0x6'));var config=require(_0xef6d('0x7'));var jayson=require(_0xef6d('0x8'));var client=jayson[_0xef6d('0x9')][_0xef6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d1315,_0x2940a2,_0x29df7d){return new BPromise(function(_0x538975,_0x3736a2){return client[_0xef6d('0xb')](_0x1d1315,_0x29df7d)['then'](function(_0x4a9fe0){logger[_0xef6d('0xc')](_0xef6d('0xd'),_0x2940a2,_0xef6d('0xe'));logger[_0xef6d('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2940a2,_0xef6d('0xe'),JSON[_0xef6d('0x10')](_0x4a9fe0));if(_0x4a9fe0[_0xef6d('0x11')]){if(_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x12')]===0x1f4){logger[_0xef6d('0x11')](_0xef6d('0xd'),_0x2940a2,_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);return _0x3736a2(_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);}logger[_0xef6d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2940a2,_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);return _0x538975(_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);}else{logger['info'](_0xef6d('0xd'),_0x2940a2,'request\x20sent');_0x538975(_0x4a9fe0[_0xef6d('0x14')][_0xef6d('0x13')]);}})[_0xef6d('0x15')](function(_0x4f88cc){logger['error'](_0xef6d('0xd'),_0x2940a2,_0x4f88cc);_0x3736a2(_0x4f88cc);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index e04ba43..a2f3563 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 _0xd1c5=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete'];(function(_0xa876e8,_0x39f6e4){var _0x1a5cbc=function(_0x4ae5b0){while(--_0x4ae5b0){_0xa876e8['push'](_0xa876e8['shift']());}};_0x1a5cbc(++_0x39f6e4);}(_0xd1c5,0xca));var _0x5d1c=function(_0x2b5cf3,_0x2bdf7f){_0x2b5cf3=_0x2b5cf3-0x0;var _0x130b41=_0xd1c5[_0x2b5cf3];return _0x130b41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5d1c('0x0'));var timeout=require(_0x5d1c('0x1'));var express=require(_0x5d1c('0x2'));var router=express[_0x5d1c('0x3')]();var fs_extra=require(_0x5d1c('0x4'));var auth=require(_0x5d1c('0x5'));var interaction=require(_0x5d1c('0x6'));var config=require(_0x5d1c('0x7'));var controller=require(_0x5d1c('0x8'));router[_0x5d1c('0x9')]('/',auth['isAuthenticated'](),controller[_0x5d1c('0xa')]);router[_0x5d1c('0x9')](_0x5d1c('0xb'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0xd')]);router[_0x5d1c('0x9')](_0x5d1c('0xe'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0xf')]);router['get'](_0x5d1c('0x10'),auth[_0x5d1c('0xc')](),controller['run']);router[_0x5d1c('0x9')](_0x5d1c('0x11'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0x12')]);router[_0x5d1c('0x13')]('/',auth[_0x5d1c('0xc')](),controller[_0x5d1c('0x14')]);router[_0x5d1c('0x15')](_0x5d1c('0xb'),auth[_0x5d1c('0xc')](),controller['update']);router[_0x5d1c('0x16')](_0x5d1c('0xb'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0x17')]);module[_0x5d1c('0x18')]=router; \ No newline at end of file +var _0x5090=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5090,0x140));var _0x0509=function(_0x50d86a,_0x41261){_0x50d86a=_0x50d86a-0x0;var _0x103f61=_0x5090[_0x50d86a];return _0x103f61;};'use strict';var multer=require('multer');var util=require(_0x0509('0x0'));var path=require(_0x0509('0x1'));var timeout=require('connect-timeout');var express=require(_0x0509('0x2'));var router=express[_0x0509('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0509('0x4'));var interaction=require(_0x0509('0x5'));var config=require(_0x0509('0x6'));var controller=require(_0x0509('0x7'));router[_0x0509('0x8')]('/',auth['isAuthenticated'](),controller[_0x0509('0x9')]);router['get'](_0x0509('0xa'),auth[_0x0509('0xb')](),controller[_0x0509('0xc')]);router[_0x0509('0x8')](_0x0509('0xd'),auth[_0x0509('0xb')](),controller[_0x0509('0xe')]);router[_0x0509('0x8')](_0x0509('0xf'),auth['isAuthenticated'](),controller[_0x0509('0x10')]);router[_0x0509('0x8')](_0x0509('0x11'),auth[_0x0509('0xb')](),controller[_0x0509('0x12')]);router[_0x0509('0x13')]('/',auth[_0x0509('0xb')](),controller['create']);router[_0x0509('0x14')](_0x0509('0xa'),auth[_0x0509('0xb')](),controller[_0x0509('0x15')]);router[_0x0509('0x16')](_0x0509('0xa'),auth['isAuthenticated'](),controller[_0x0509('0x17')]);module[_0x0509('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index bc7f25d..aec688d 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 _0xdd0e=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','scheduled','manual','INTEGER'];(function(_0x3cf239,_0x427eba){var _0x33ad92=function(_0x317c8d){while(--_0x317c8d){_0x3cf239['push'](_0x3cf239['shift']());}};_0x33ad92(++_0x427eba);}(_0xdd0e,0x1d5));var _0xedd0=function(_0x271020,_0x2ef665){_0x271020=_0x271020-0x0;var _0x40c326=_0xdd0e[_0x271020];return _0x40c326;};'use strict';var Sequelize=require(_0xedd0('0x0'));var moment=require(_0xedd0('0x1'));module[_0xedd0('0x2')]={'name':{'type':Sequelize[_0xedd0('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xedd0('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xedd0('0x4')](_0xedd0('0x5'),_0xedd0('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xedd0('0x7')]},'endDate':{'type':Sequelize[_0xedd0('0x7')]},'status':{'type':Sequelize[_0xedd0('0x3')],'defaultValue':_0xedd0('0x8')},'type':{'type':Sequelize['ENUM']('manual',_0xedd0('0x9')),'allowNull':![],'defaultValue':_0xedd0('0xa')},'reportId':{'type':Sequelize[_0xedd0('0xb')](0xb)[_0xedd0('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf3e4=['moment','exports','STRING','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0xf3e4,0x17f));var _0x4f3e=function(_0x4688e8,_0x358f11){_0x4688e8=_0x4688e8-0x0;var _0x5a3aae=_0xf3e4[_0x4688e8];return _0x5a3aae;};'use strict';var Sequelize=require(_0x4f3e('0x0'));var moment=require(_0x4f3e('0x1'));module[_0x4f3e('0x2')]={'name':{'type':Sequelize[_0x4f3e('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4f3e('0x4'),'pdf',_0x4f3e('0x5')),'allowNull':![],'defaultValue':_0x4f3e('0x4')},'savename':{'type':Sequelize[_0x4f3e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4f3e('0x6')]},'status':{'type':Sequelize[_0x4f3e('0x3')],'defaultValue':_0x4f3e('0x7')},'type':{'type':Sequelize['ENUM'](_0x4f3e('0x8'),_0x4f3e('0x9')),'allowNull':![],'defaultValue':_0x4f3e('0x8')},'reportId':{'type':Sequelize[_0x4f3e('0xa')](0xb)[_0x4f3e('0xb')]},'reportType':{'type':Sequelize[_0x4f3e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7e299d5..2607ba3 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 _0x14ec=['sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','update','destroy','then','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x79afce,_0x29087a){var _0x5c7221=function(_0x15bf76){while(--_0x15bf76){_0x79afce['push'](_0x79afce['shift']());}};_0x5c7221(++_0x29087a);}(_0x14ec,0x139));var _0xc14e=function(_0x2977d2,_0x566419){_0x2977d2=_0x2977d2-0x0;var _0x39b2d1=_0x14ec[_0x2977d2];return _0x39b2d1;};'use strict';var emlformat=require(_0xc14e('0x0'));var rimraf=require(_0xc14e('0x1'));var zipdir=require(_0xc14e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc14e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc14e('0x4'));var util=require(_0xc14e('0x5'));var path=require(_0xc14e('0x6'));var sox=require(_0xc14e('0x7'));var csv=require(_0xc14e('0x8'));var ejs=require(_0xc14e('0x9'));var fs=require('fs');var fs_extra=require(_0xc14e('0xa'));var _=require(_0xc14e('0xb'));var squel=require(_0xc14e('0xc'));var crypto=require(_0xc14e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc14e('0xe'));var Papa=require(_0xc14e('0xf'));var Redis=require(_0xc14e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc14e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc14e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc14e('0x13'));var licenseUtil=require(_0xc14e('0x14'));var db=require(_0xc14e('0x15'))['db'];function respondWithStatusCode(_0x16f672,_0x2e49dd){_0x2e49dd=_0x2e49dd||0xcc;return function(_0x4a6def){if(_0x4a6def){return _0x16f672[_0xc14e('0x16')](_0x2e49dd);}return _0x16f672[_0xc14e('0x17')](_0x2e49dd)[_0xc14e('0x18')]();};}function respondWithResult(_0x290c80,_0x5493ba){_0x5493ba=_0x5493ba||0xc8;return function(_0x21720a){if(_0x21720a){return _0x290c80[_0xc14e('0x17')](_0x5493ba)[_0xc14e('0x19')](_0x21720a);}};}function respondWithFilteredResult(_0x3108f8,_0x162a22){return function(_0x465fd8){if(_0x465fd8){var _0x1c5005=typeof _0x162a22[_0xc14e('0x1a')]==='undefined'&&typeof _0x162a22[_0xc14e('0x1b')]==='undefined';var _0xf1237=_0x465fd8[_0xc14e('0x1c')];var _0x5122ae=_0x1c5005?0x0:_0x162a22[_0xc14e('0x1a')];var _0x174499=_0x1c5005?_0x465fd8[_0xc14e('0x1c')]:_0x162a22[_0xc14e('0x1a')]+_0x162a22[_0xc14e('0x1b')];var _0x5983f2;if(_0x174499>=_0xf1237){_0x174499=_0xf1237;_0x5983f2=0xc8;}else{_0x5983f2=0xce;}_0x3108f8['status'](_0x5983f2);return _0x3108f8[_0xc14e('0x1d')]('Content-Range',_0x5122ae+'-'+_0x174499+'/'+_0xf1237)[_0xc14e('0x19')](_0x465fd8);}return null;};}function patchUpdates(_0x4266c7){return function(_0x1b5735){try{jsonpatch['apply'](_0x1b5735,_0x4266c7,!![]);}catch(_0x5d9e5b){return BPromise[_0xc14e('0x1e')](_0x5d9e5b);}return _0x1b5735['save']();};}function saveUpdates(_0x379c61,_0x482055){return function(_0x342abc){if(_0x342abc){return _0x342abc[_0xc14e('0x1f')](_0x379c61)['then'](function(_0x2e9a72){return _0x2e9a72;});}return null;};}function removeEntity(_0x58d2c4,_0x1bbf5c){return function(_0x4c66ff){if(_0x4c66ff){return _0x4c66ff[_0xc14e('0x20')]()[_0xc14e('0x21')](function(){var _0x4790a2=_0x4c66ff['get']({'plain':!![]});var _0x1e345b=_0xc14e('0x22');return db[_0xc14e('0x23')]['destroy']({'where':{'type':_0x1e345b,'resourceId':_0x4790a2['id']}})[_0xc14e('0x21')](function(){return _0x4c66ff;});})[_0xc14e('0x21')](function(){_0x58d2c4[_0xc14e('0x17')](0xcc)[_0xc14e('0x18')]();});}};}function handleEntityNotFound(_0x1de8a8,_0x943691){return function(_0x37f470){if(!_0x37f470){_0x1de8a8[_0xc14e('0x16')](0x194);}return _0x37f470;};}function handleError(_0x1c0bba,_0x578413){_0x578413=_0x578413||0x1f4;return function(_0x580e9c){logger['error'](_0x580e9c[_0xc14e('0x24')]);if(_0x580e9c[_0xc14e('0x25')]){delete _0x580e9c[_0xc14e('0x25')];}_0x1c0bba[_0xc14e('0x17')](_0x578413)[_0xc14e('0x26')](_0x580e9c);};}exports[_0xc14e('0x27')]=function(_0x5d7993,_0xbe8b02){var _0x256453={},_0x574659={},_0x2e05b3={'count':0x0,'rows':[]};var _0x25e61f=_[_0xc14e('0x28')](db[_0xc14e('0x29')]['rawAttributes'],function(_0x45b26d){return{'name':_0x45b26d['fieldName'],'type':_0x45b26d[_0xc14e('0x2a')][_0xc14e('0x2b')]};});_0x574659[_0xc14e('0x2c')]=_['map'](_0x25e61f,'name');_0x574659['query']=_[_0xc14e('0x2d')](_0x5d7993[_0xc14e('0x2e')]);_0x574659[_0xc14e('0x2f')]=_[_0xc14e('0x30')](_0x574659[_0xc14e('0x2c')],_0x574659[_0xc14e('0x2e')]);_0x256453['attributes']=_[_0xc14e('0x30')](_0x574659[_0xc14e('0x2c')],qs[_0xc14e('0x31')](_0x5d7993[_0xc14e('0x2e')]['fields']));_0x256453[_0xc14e('0x32')]=_0x256453[_0xc14e('0x32')][_0xc14e('0x33')]?_0x256453[_0xc14e('0x32')]:_0x574659[_0xc14e('0x2c')];if(!_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x34')](_0xc14e('0x35'))){_0x256453[_0xc14e('0x1b')]=qs['limit'](_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x1b')]);_0x256453[_0xc14e('0x1a')]=qs[_0xc14e('0x1a')](_0x5d7993['query'][_0xc14e('0x1a')]);}_0x256453[_0xc14e('0x36')]=qs[_0xc14e('0x37')](_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x37')]);_0x256453[_0xc14e('0x38')]=qs[_0xc14e('0x2f')](_[_0xc14e('0x39')](_0x5d7993[_0xc14e('0x2e')],_0x574659[_0xc14e('0x2f')]),_0x25e61f);if(_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x3a')]){_0x256453['where']=_[_0xc14e('0x3b')](_0x256453[_0xc14e('0x38')],{'$or':_[_0xc14e('0x28')](_0x25e61f,function(_0x24450d){if(_0x24450d['type']!=='VIRTUAL'){var _0x1b740d={};_0x1b740d[_0x24450d['name']]={'$like':'%'+_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x3a')]+'%'};return _0x1b740d;}})});}_0x256453=_['merge']({},_0x256453,_0x5d7993['options']);var _0xfbedbd={'where':_0x256453[_0xc14e('0x38')]};return db['AnalyticExtractedReport'][_0xc14e('0x1c')](_0xfbedbd)['then'](function(_0x15b505){_0x2e05b3['count']=_0x15b505;if(_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x3c')]){_0x256453[_0xc14e('0x3d')]=[{'all':!![]}];}return db[_0xc14e('0x29')][_0xc14e('0x3e')](_0x256453);})[_0xc14e('0x21')](function(_0x5dfbe4){_0x2e05b3[_0xc14e('0x3f')]=_0x5dfbe4;return _0x2e05b3;})[_0xc14e('0x21')](respondWithFilteredResult(_0xbe8b02,_0x256453))[_0xc14e('0x40')](handleError(_0xbe8b02,null));};exports['show']=function(_0x55182b,_0x3fc7e6){var _0x57cdeb={'raw':!![],'where':{'id':_0x55182b['params']['id']}},_0x58b237={};_0x58b237[_0xc14e('0x2c')]=_[_0xc14e('0x2d')](db['AnalyticExtractedReport'][_0xc14e('0x41')]);_0x58b237[_0xc14e('0x2e')]=_[_0xc14e('0x2d')](_0x55182b[_0xc14e('0x2e')]);_0x58b237[_0xc14e('0x2f')]=_['intersection'](_0x58b237[_0xc14e('0x2c')],_0x58b237[_0xc14e('0x2e')]);_0x57cdeb[_0xc14e('0x32')]=_[_0xc14e('0x30')](_0x58b237[_0xc14e('0x2c')],qs[_0xc14e('0x31')](_0x55182b[_0xc14e('0x2e')][_0xc14e('0x31')]));_0x57cdeb[_0xc14e('0x32')]=_0x57cdeb[_0xc14e('0x32')]['length']?_0x57cdeb[_0xc14e('0x32')]:_0x58b237['model'];if(_0x55182b['query'][_0xc14e('0x3c')]){_0x57cdeb[_0xc14e('0x3d')]=[{'all':!![]}];}_0x57cdeb=_[_0xc14e('0x3b')]({},_0x57cdeb,_0x55182b[_0xc14e('0x42')]);return db[_0xc14e('0x29')][_0xc14e('0x43')](_0x57cdeb)[_0xc14e('0x21')](handleEntityNotFound(_0x3fc7e6,null))[_0xc14e('0x21')](respondWithResult(_0x3fc7e6,null))[_0xc14e('0x40')](handleError(_0x3fc7e6,null));};exports['create']=function(_0x4637db,_0x4b4ec7){return db['AnalyticExtractedReport'][_0xc14e('0x44')](_0x4637db[_0xc14e('0x45')],{})[_0xc14e('0x21')](function(_0x237d5d){var _0x480fc7=_0x4637db[_0xc14e('0x46')][_0xc14e('0x47')]({'plain':!![]});if(!_0x480fc7)throw new Error(_0xc14e('0x48'));if(_0x480fc7['role']===_0xc14e('0x46')){var _0x5ccb56=_0x237d5d[_0xc14e('0x47')]({'plain':!![]});var _0x3021d0=_0xc14e('0x22');return db[_0xc14e('0x49')]['find']({'where':{'name':_0x3021d0,'userProfileId':_0x480fc7[_0xc14e('0x4a')]},'raw':!![]})[_0xc14e('0x21')](function(_0x4aac5b){if(_0x4aac5b&&_0x4aac5b[_0xc14e('0x4b')]===0x0){return db['UserProfileResource'][_0xc14e('0x44')]({'name':_0x5ccb56['name'],'resourceId':_0x5ccb56['id'],'type':_0x4aac5b[_0xc14e('0x25')],'sectionId':_0x4aac5b['id']},{})['then'](function(){return _0x237d5d;});}else{return _0x237d5d;}})[_0xc14e('0x40')](function(_0x2a2f87){logger[_0xc14e('0x4c')](_0xc14e('0x4d'),_0x2a2f87);throw _0x2a2f87;});}return _0x237d5d;})['then'](respondWithResult(_0x4b4ec7,0xc9))[_0xc14e('0x40')](handleError(_0x4b4ec7,null));};exports[_0xc14e('0x1f')]=function(_0x2dd774,_0x2acdf0){if(_0x2dd774['body']['id']){delete _0x2dd774[_0xc14e('0x45')]['id'];}return db[_0xc14e('0x29')]['find']({'where':{'id':_0x2dd774['params']['id']}})['then'](handleEntityNotFound(_0x2acdf0,null))[_0xc14e('0x21')](saveUpdates(_0x2dd774[_0xc14e('0x45')],null))[_0xc14e('0x21')](respondWithResult(_0x2acdf0,null))['catch'](handleError(_0x2acdf0,null));};exports[_0xc14e('0x20')]=function(_0x29c1e0,_0x565067){return db[_0xc14e('0x29')][_0xc14e('0x43')]({'where':{'id':_0x29c1e0[_0xc14e('0x4e')]['id']}})[_0xc14e('0x21')](handleEntityNotFound(_0x565067,null))['then'](removeEntity(_0x565067,null))[_0xc14e('0x40')](handleError(_0x565067,null));};exports[_0xc14e('0x4f')]=function(_0x53de6d,_0x2cb91c,_0x4219f3){return db[_0xc14e('0x29')][_0xc14e('0x43')]({'where':{'id':_0x53de6d['params']['id']},'attributes':[_0xc14e('0x25'),_0xc14e('0x50'),_0xc14e('0x51'),'output'],'raw':!![]})[_0xc14e('0x21')](handleEntityNotFound(_0x2cb91c,null))[_0xc14e('0x21')](function(_0x30f94e){if(_0x30f94e){if(!fs[_0xc14e('0x52')](path[_0xc14e('0x53')](config['root'],_0xc14e('0x54'),_0x30f94e['savename']))){throw new db[(_0xc14e('0x55'))][(_0xc14e('0x56'))](_0xc14e('0x57'));}if(_0x53de6d[_0xc14e('0x2e')][_0xc14e('0x58')]){return _0x2cb91c[_0xc14e('0x16')](0xc8);}return _0x2cb91c['download'](path[_0xc14e('0x53')](config[_0xc14e('0x59')],_0xc14e('0x54'),_0x30f94e[_0xc14e('0x51')]),util[_0xc14e('0x5a')](_0xc14e('0x5b'),_0x30f94e[_0xc14e('0x50')]||_0x30f94e['name'],_0x30f94e['output']['toLowerCase']()));}})[_0xc14e('0x40')](handleError(_0x2cb91c,null));}; \ No newline at end of file +var _0xd373=['Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','intersection','fields','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','join','server/files/reports','savename','Sequelize','exists','sendStatus','root','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set'];(function(_0x557c07,_0x181488){var _0x51b4d0=function(_0x478e6f){while(--_0x478e6f){_0x557c07['push'](_0x557c07['shift']());}};_0x51b4d0(++_0x181488);}(_0xd373,0x1b6));var _0x3d37=function(_0x5dc4c3,_0x3c1a65){_0x5dc4c3=_0x5dc4c3-0x0;var _0x28a4c5=_0xd373[_0x5dc4c3];return _0x28a4c5;};'use strict';var emlformat=require(_0x3d37('0x0'));var rimraf=require(_0x3d37('0x1'));var zipdir=require(_0x3d37('0x2'));var jsonpatch=require(_0x3d37('0x3'));var rp=require(_0x3d37('0x4'));var moment=require(_0x3d37('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3d37('0x6'));var util=require(_0x3d37('0x7'));var path=require('path');var sox=require(_0x3d37('0x8'));var csv=require(_0x3d37('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d37('0xa'));var _=require(_0x3d37('0xb'));var squel=require(_0x3d37('0xc'));var crypto=require(_0x3d37('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3d37('0xe'));var toCsv=require(_0x3d37('0x9'));var querystring=require(_0x3d37('0xf'));var Papa=require(_0x3d37('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d37('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d37('0x12'));var logger=require(_0x3d37('0x13'))(_0x3d37('0x14'));var utils=require(_0x3d37('0x15'));var config=require(_0x3d37('0x16'));var licenseUtil=require(_0x3d37('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42063c,_0x3a6e93){_0x3a6e93=_0x3a6e93||0xcc;return function(_0xa257f5){if(_0xa257f5){return _0x42063c['sendStatus'](_0x3a6e93);}return _0x42063c[_0x3d37('0x18')](_0x3a6e93)[_0x3d37('0x19')]();};}function respondWithResult(_0x3699c7,_0x29931f){_0x29931f=_0x29931f||0xc8;return function(_0xc5cfe){if(_0xc5cfe){return _0x3699c7[_0x3d37('0x18')](_0x29931f)[_0x3d37('0x1a')](_0xc5cfe);}};}function respondWithFilteredResult(_0x4a1d99,_0x29c522){return function(_0x372526){if(_0x372526){var _0x364941=typeof _0x29c522[_0x3d37('0x1b')]==='undefined'&&typeof _0x29c522[_0x3d37('0x1c')]===_0x3d37('0x1d');var _0x383618=_0x372526[_0x3d37('0x1e')];var _0x5cd325=_0x364941?0x0:_0x29c522[_0x3d37('0x1b')];var _0x6be2f7=_0x364941?_0x372526[_0x3d37('0x1e')]:_0x29c522[_0x3d37('0x1b')]+_0x29c522[_0x3d37('0x1c')];var _0x265931;if(_0x6be2f7>=_0x383618){_0x6be2f7=_0x383618;_0x265931=0xc8;}else{_0x265931=0xce;}_0x4a1d99[_0x3d37('0x18')](_0x265931);return _0x4a1d99[_0x3d37('0x1f')](_0x3d37('0x20'),_0x5cd325+'-'+_0x6be2f7+'/'+_0x383618)['json'](_0x372526);}return null;};}function patchUpdates(_0x49ceb1){return function(_0x30d2d7){try{jsonpatch[_0x3d37('0x21')](_0x30d2d7,_0x49ceb1,!![]);}catch(_0x2ff95f){return BPromise[_0x3d37('0x22')](_0x2ff95f);}return _0x30d2d7[_0x3d37('0x23')]();};}function saveUpdates(_0x5112a3,_0x16843e){return function(_0x368b30){if(_0x368b30){return _0x368b30['update'](_0x5112a3)[_0x3d37('0x24')](function(_0x2bbc68){return _0x2bbc68;});}return null;};}function removeEntity(_0x322724,_0x2fec83){return function(_0x41b358){if(_0x41b358){return _0x41b358[_0x3d37('0x25')]()[_0x3d37('0x24')](function(){var _0x4ff59c=_0x41b358[_0x3d37('0x26')]({'plain':!![]});var _0x47ed32=_0x3d37('0x27');return db[_0x3d37('0x28')]['destroy']({'where':{'type':_0x47ed32,'resourceId':_0x4ff59c['id']}})[_0x3d37('0x24')](function(){return _0x41b358;});})[_0x3d37('0x24')](function(){_0x322724['status'](0xcc)[_0x3d37('0x19')]();});}};}function handleEntityNotFound(_0x2340f9,_0x5c2980){return function(_0x35554d){if(!_0x35554d){_0x2340f9['sendStatus'](0x194);}return _0x35554d;};}function handleError(_0x4a22d0,_0x37d74f){_0x37d74f=_0x37d74f||0x1f4;return function(_0x41b703){logger['error'](_0x41b703[_0x3d37('0x29')]);if(_0x41b703[_0x3d37('0x2a')]){delete _0x41b703[_0x3d37('0x2a')];}_0x4a22d0[_0x3d37('0x18')](_0x37d74f)[_0x3d37('0x2b')](_0x41b703);};}exports[_0x3d37('0x2c')]=function(_0x58e699,_0x19ff2f){var _0x27fdf5={},_0x13bf07={},_0x217de5={'count':0x0,'rows':[]};var _0x16dc06=_[_0x3d37('0x2d')](db[_0x3d37('0x2e')][_0x3d37('0x2f')],function(_0x2d37ae){return{'name':_0x2d37ae[_0x3d37('0x30')],'type':_0x2d37ae[_0x3d37('0x31')][_0x3d37('0x32')]};});_0x13bf07[_0x3d37('0x33')]=_[_0x3d37('0x2d')](_0x16dc06,'name');_0x13bf07['query']=_[_0x3d37('0x34')](_0x58e699[_0x3d37('0x35')]);_0x13bf07[_0x3d37('0x36')]=_['intersection'](_0x13bf07[_0x3d37('0x33')],_0x13bf07[_0x3d37('0x35')]);_0x27fdf5['attributes']=_['intersection'](_0x13bf07[_0x3d37('0x33')],qs['fields'](_0x58e699[_0x3d37('0x35')]['fields']));_0x27fdf5[_0x3d37('0x37')]=_0x27fdf5['attributes'][_0x3d37('0x38')]?_0x27fdf5[_0x3d37('0x37')]:_0x13bf07[_0x3d37('0x33')];if(!_0x58e699[_0x3d37('0x35')]['hasOwnProperty']('nolimit')){_0x27fdf5[_0x3d37('0x1c')]=qs[_0x3d37('0x1c')](_0x58e699[_0x3d37('0x35')][_0x3d37('0x1c')]);_0x27fdf5['offset']=qs['offset'](_0x58e699[_0x3d37('0x35')]['offset']);}_0x27fdf5['order']=qs[_0x3d37('0x39')](_0x58e699[_0x3d37('0x35')][_0x3d37('0x39')]);_0x27fdf5[_0x3d37('0x3a')]=qs[_0x3d37('0x36')](_[_0x3d37('0x3b')](_0x58e699['query'],_0x13bf07['filters']),_0x16dc06);if(_0x58e699[_0x3d37('0x35')]['filter']){_0x27fdf5[_0x3d37('0x3a')]=_[_0x3d37('0x3c')](_0x27fdf5[_0x3d37('0x3a')],{'$or':_['map'](_0x16dc06,function(_0x1d9c88){if(_0x1d9c88[_0x3d37('0x31')]!==_0x3d37('0x3d')){var _0x26e427={};_0x26e427[_0x1d9c88[_0x3d37('0x2a')]]={'$like':'%'+_0x58e699[_0x3d37('0x35')][_0x3d37('0x3e')]+'%'};return _0x26e427;}})});}_0x27fdf5=_[_0x3d37('0x3c')]({},_0x27fdf5,_0x58e699[_0x3d37('0x3f')]);var _0xdf9ed5={'where':_0x27fdf5[_0x3d37('0x3a')]};return db[_0x3d37('0x2e')][_0x3d37('0x1e')](_0xdf9ed5)[_0x3d37('0x24')](function(_0x161e2b){_0x217de5[_0x3d37('0x1e')]=_0x161e2b;if(_0x58e699[_0x3d37('0x35')]['includeAll']){_0x27fdf5['include']=[{'all':!![]}];}return db[_0x3d37('0x2e')][_0x3d37('0x40')](_0x27fdf5);})[_0x3d37('0x24')](function(_0x4a83b7){_0x217de5[_0x3d37('0x41')]=_0x4a83b7;return _0x217de5;})[_0x3d37('0x24')](respondWithFilteredResult(_0x19ff2f,_0x27fdf5))[_0x3d37('0x42')](handleError(_0x19ff2f,null));};exports['show']=function(_0x5f5113,_0x3931f4){var _0x45abec={'raw':!![],'where':{'id':_0x5f5113[_0x3d37('0x43')]['id']}},_0x5cf9d9={};_0x5cf9d9[_0x3d37('0x33')]=_[_0x3d37('0x34')](db[_0x3d37('0x2e')][_0x3d37('0x2f')]);_0x5cf9d9[_0x3d37('0x35')]=_['keys'](_0x5f5113[_0x3d37('0x35')]);_0x5cf9d9['filters']=_[_0x3d37('0x44')](_0x5cf9d9[_0x3d37('0x33')],_0x5cf9d9[_0x3d37('0x35')]);_0x45abec[_0x3d37('0x37')]=_[_0x3d37('0x44')](_0x5cf9d9[_0x3d37('0x33')],qs[_0x3d37('0x45')](_0x5f5113[_0x3d37('0x35')]['fields']));_0x45abec[_0x3d37('0x37')]=_0x45abec['attributes'][_0x3d37('0x38')]?_0x45abec[_0x3d37('0x37')]:_0x5cf9d9[_0x3d37('0x33')];if(_0x5f5113[_0x3d37('0x35')][_0x3d37('0x46')]){_0x45abec['include']=[{'all':!![]}];}_0x45abec=_[_0x3d37('0x3c')]({},_0x45abec,_0x5f5113['options']);return db[_0x3d37('0x2e')][_0x3d37('0x47')](_0x45abec)[_0x3d37('0x24')](handleEntityNotFound(_0x3931f4,null))[_0x3d37('0x24')](respondWithResult(_0x3931f4,null))[_0x3d37('0x42')](handleError(_0x3931f4,null));};exports[_0x3d37('0x48')]=function(_0x2fcaa8,_0x50a28a){return db['AnalyticExtractedReport']['create'](_0x2fcaa8[_0x3d37('0x49')],{})[_0x3d37('0x24')](function(_0x2ccf70){var _0x4506aa=_0x2fcaa8['user']['get']({'plain':!![]});if(!_0x4506aa)throw new Error(_0x3d37('0x4a'));if(_0x4506aa[_0x3d37('0x4b')]===_0x3d37('0x4c')){var _0x1d017d=_0x2ccf70[_0x3d37('0x26')]({'plain':!![]});var _0x5e5c42=_0x3d37('0x27');return db[_0x3d37('0x4d')][_0x3d37('0x47')]({'where':{'name':_0x5e5c42,'userProfileId':_0x4506aa[_0x3d37('0x4e')]},'raw':!![]})['then'](function(_0x3bf517){if(_0x3bf517&&_0x3bf517[_0x3d37('0x4f')]===0x0){return db[_0x3d37('0x28')]['create']({'name':_0x1d017d[_0x3d37('0x2a')],'resourceId':_0x1d017d['id'],'type':_0x3bf517[_0x3d37('0x2a')],'sectionId':_0x3bf517['id']},{})[_0x3d37('0x24')](function(){return _0x2ccf70;});}else{return _0x2ccf70;}})[_0x3d37('0x42')](function(_0xa25326){logger[_0x3d37('0x50')](_0x3d37('0x51'),_0xa25326);throw _0xa25326;});}return _0x2ccf70;})['then'](respondWithResult(_0x50a28a,0xc9))['catch'](handleError(_0x50a28a,null));};exports[_0x3d37('0x52')]=function(_0x513765,_0x13e2b4){if(_0x513765[_0x3d37('0x49')]['id']){delete _0x513765[_0x3d37('0x49')]['id'];}return db[_0x3d37('0x2e')][_0x3d37('0x47')]({'where':{'id':_0x513765[_0x3d37('0x43')]['id']}})['then'](handleEntityNotFound(_0x13e2b4,null))[_0x3d37('0x24')](saveUpdates(_0x513765[_0x3d37('0x49')],null))[_0x3d37('0x24')](respondWithResult(_0x13e2b4,null))[_0x3d37('0x42')](handleError(_0x13e2b4,null));};exports[_0x3d37('0x25')]=function(_0x194e1f,_0x85fba){return db[_0x3d37('0x2e')][_0x3d37('0x47')]({'where':{'id':_0x194e1f[_0x3d37('0x43')]['id']}})[_0x3d37('0x24')](handleEntityNotFound(_0x85fba,null))['then'](removeEntity(_0x85fba,null))[_0x3d37('0x42')](handleError(_0x85fba,null));};exports['download']=function(_0x3e1ea6,_0x17ca1d,_0x219e67){return db[_0x3d37('0x2e')][_0x3d37('0x47')]({'where':{'id':_0x3e1ea6[_0x3d37('0x43')]['id']},'attributes':[_0x3d37('0x2a'),_0x3d37('0x53'),'savename',_0x3d37('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x17ca1d,null))['then'](function(_0x40e085){if(_0x40e085){if(!fs[_0x3d37('0x55')](path[_0x3d37('0x56')](config['root'],_0x3d37('0x57'),_0x40e085[_0x3d37('0x58')]))){throw new db[(_0x3d37('0x59'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x3e1ea6[_0x3d37('0x35')][_0x3d37('0x5a')]){return _0x17ca1d[_0x3d37('0x5b')](0xc8);}return _0x17ca1d['download'](path['join'](config[_0x3d37('0x5c')],_0x3d37('0x57'),_0x40e085[_0x3d37('0x58')]),util[_0x3d37('0x5d')]('%s.%s',_0x40e085[_0x3d37('0x53')]||_0x40e085['name'],_0x40e085[_0x3d37('0x54')]['toLowerCase']()));}})['catch'](handleError(_0x17ca1d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b469fba..351591d 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 _0xd1f2=['api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger'];(function(_0x35bd04,_0x333beb){var _0x3a42e8=function(_0x4f5bda){while(--_0x4f5bda){_0x35bd04['push'](_0x35bd04['shift']());}};_0x3a42e8(++_0x333beb);}(_0xd1f2,0x18a));var _0x2d1f=function(_0x4eaa00,_0x10e6c1){_0x4eaa00=_0x4eaa00-0x0;var _0xba8c86=_0xd1f2[_0x4eaa00];return _0xba8c86;};'use strict';var _=require(_0x2d1f('0x0'));var util=require('util');var logger=require(_0x2d1f('0x1'))(_0x2d1f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d1f('0x3'));var fs=require('fs');var path=require(_0x2d1f('0x4'));var rimraf=require(_0x2d1f('0x5'));var config=require(_0x2d1f('0x6'));var attributes=require(_0x2d1f('0x7'));module[_0x2d1f('0x8')]=function(_0x21ed6f,_0x54eac0){return _0x21ed6f[_0x2d1f('0x9')](_0x2d1f('0xa'),attributes,{'tableName':_0x2d1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8a4=['AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x4ed07b,_0x2e370a){var _0x422a39=function(_0x1077fa){while(--_0x1077fa){_0x4ed07b['push'](_0x4ed07b['shift']());}};_0x422a39(++_0x2e370a);}(_0xe8a4,0xdf));var _0x4e8a=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xe8a4[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x4e8a('0x0'));var util=require('util');var logger=require(_0x4e8a('0x1'))(_0x4e8a('0x2'));var moment=require(_0x4e8a('0x3'));var BPromise=require(_0x4e8a('0x4'));var rp=require(_0x4e8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e8a('0x6'));var config=require(_0x4e8a('0x7'));var attributes=require(_0x4e8a('0x8'));module[_0x4e8a('0x9')]=function(_0x6f533c,_0x587b74){return _0x6f533c[_0x4e8a('0xa')](_0x4e8a('0xb'),attributes,{'tableName':_0x4e8a('0xc'),'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 a78fb2e..8e5268b 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 _0x9652=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3f4a8e,_0x507c39){var _0x7f68fd=function(_0x29890f){while(--_0x29890f){_0x3f4a8e['push'](_0x3f4a8e['shift']());}};_0x7f68fd(++_0x507c39);}(_0x9652,0xaf));var _0x2965=function(_0x4dac30,_0x3b1e61){_0x4dac30=_0x4dac30-0x0;var _0x4ae741=_0x9652[_0x4dac30];return _0x4ae741;};'use strict';var _=require(_0x2965('0x0'));var util=require(_0x2965('0x1'));var moment=require('moment');var BPromise=require(_0x2965('0x2'));var rs=require(_0x2965('0x3'));var fs=require('fs');var Redis=require(_0x2965('0x4'));var db=require(_0x2965('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2965('0x6'));var config=require(_0x2965('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x694054,_0x4a51b2,_0x31e39f){return new BPromise(function(_0x3be4b1,_0x33ce11){return client['request'](_0x694054,_0x31e39f)[_0x2965('0x8')](function(_0x13fbb9){logger[_0x2965('0x9')](_0x2965('0xa'),_0x4a51b2,_0x2965('0xb'));logger['debug'](_0x2965('0xc'),_0x4a51b2,_0x2965('0xb'),JSON['stringify'](_0x13fbb9));if(_0x13fbb9[_0x2965('0xd')]){if(_0x13fbb9[_0x2965('0xd')][_0x2965('0xe')]===0x1f4){logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);return _0x33ce11(_0x13fbb9['error'][_0x2965('0xf')]);}logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);return _0x3be4b1(_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);}else{logger['info'](_0x2965('0xa'),_0x4a51b2,_0x2965('0xb'));_0x3be4b1(_0x13fbb9['result'][_0x2965('0xf')]);}})[_0x2965('0x10')](function(_0x3409b1){logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x3409b1);_0x33ce11(_0x3409b1);});});} \ No newline at end of file +var _0xe0e7=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util'];(function(_0x28b5d6,_0x31f3ea){var _0x3ae39e=function(_0x1d86bd){while(--_0x1d86bd){_0x28b5d6['push'](_0x28b5d6['shift']());}};_0x3ae39e(++_0x31f3ea);}(_0xe0e7,0x17b));var _0x7e0e=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0xe0e7[_0xfd5f37];return _0x11bd01;};'use strict';var _=require('lodash');var util=require(_0x7e0e('0x0'));var moment=require(_0x7e0e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e0e('0x2'));var fs=require('fs');var Redis=require(_0x7e0e('0x3'));var db=require(_0x7e0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e0e('0x5'))('rpc');var config=require(_0x7e0e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e0e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29a488,_0x198eb6,_0x1902b1){return new BPromise(function(_0x2d49b7,_0x15e6ea){return client[_0x7e0e('0x8')](_0x29a488,_0x1902b1)[_0x7e0e('0x9')](function(_0x1aabe6){logger['info'](_0x7e0e('0xa'),_0x198eb6,_0x7e0e('0xb'));logger[_0x7e0e('0xc')](_0x7e0e('0xd'),_0x198eb6,'request\x20sent',JSON['stringify'](_0x1aabe6));if(_0x1aabe6[_0x7e0e('0xe')]){if(_0x1aabe6[_0x7e0e('0xe')][_0x7e0e('0xf')]===0x1f4){logger[_0x7e0e('0xe')](_0x7e0e('0xa'),_0x198eb6,_0x1aabe6[_0x7e0e('0xe')]['message']);return _0x15e6ea(_0x1aabe6[_0x7e0e('0xe')][_0x7e0e('0x10')]);}logger[_0x7e0e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x198eb6,_0x1aabe6['error']['message']);return _0x2d49b7(_0x1aabe6[_0x7e0e('0xe')]['message']);}else{logger[_0x7e0e('0x11')](_0x7e0e('0xa'),_0x198eb6,_0x7e0e('0xb'));_0x2d49b7(_0x1aabe6[_0x7e0e('0x12')][_0x7e0e('0x10')]);}})['catch'](function(_0x149617){logger[_0x7e0e('0xe')](_0x7e0e('0xa'),_0x198eb6,_0x149617);_0x15e6ea(_0x149617);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 947ed41..369d4b7 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 _0x95fc=['isAuthenticated','/:id','show','get','/:id/download','download','create','put','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x95fc,0xd6));var _0xc95f=function(_0x59ed0e,_0x41a60f){_0x59ed0e=_0x59ed0e-0x0;var _0x9a8307=_0x95fc[_0x59ed0e];return _0x9a8307;};'use strict';var multer=require('multer');var util=require(_0xc95f('0x0'));var path=require('path');var timeout=require(_0xc95f('0x1'));var express=require('express');var router=express[_0xc95f('0x2')]();var fs_extra=require(_0xc95f('0x3'));var auth=require(_0xc95f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc95f('0x5'));var controller=require(_0xc95f('0x6'));router['get']('/',auth[_0xc95f('0x7')](),controller['index']);router['get'](_0xc95f('0x8'),auth[_0xc95f('0x7')](),controller[_0xc95f('0x9')]);router[_0xc95f('0xa')](_0xc95f('0xb'),auth['isAuthenticated'](),controller[_0xc95f('0xc')]);router['post']('/',auth[_0xc95f('0x7')](),controller[_0xc95f('0xd')]);router[_0xc95f('0xe')]('/:id',auth[_0xc95f('0x7')](),controller['update']);router[_0xc95f('0xf')](_0xc95f('0x8'),auth[_0xc95f('0x7')](),controller[_0xc95f('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfac6=['get','index','show','/:id/download','isAuthenticated','download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xfac6,0x116));var _0x6fac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfac6[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x6fac('0x0'));var path=require(_0x6fac('0x1'));var timeout=require(_0x6fac('0x2'));var express=require(_0x6fac('0x3'));var router=express['Router']();var fs_extra=require(_0x6fac('0x4'));var auth=require(_0x6fac('0x5'));var interaction=require(_0x6fac('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x6fac('0x7')]('/',auth['isAuthenticated'](),controller[_0x6fac('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6fac('0x9')]);router['get'](_0x6fac('0xa'),auth[_0x6fac('0xb')](),controller[_0x6fac('0xc')]);router[_0x6fac('0xd')]('/',auth[_0x6fac('0xb')](),controller[_0x6fac('0xe')]);router['put'](_0x6fac('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6fac('0x10')](_0x6fac('0xf'),auth[_0x6fac('0xb')](),controller[_0x6fac('0x11')]);module[_0x6fac('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index c7ba85a..c083b7b 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 _0xf35e=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x554092,_0x211b5f){var _0x33d000=function(_0x43b7a6){while(--_0x43b7a6){_0x554092['push'](_0x554092['shift']());}};_0x33d000(++_0x211b5f);}(_0xf35e,0x1b6));var _0xef35=function(_0x389267,_0x2e51d7){_0x389267=_0x389267-0x0;var _0x66af=_0xf35e[_0x389267];return _0x66af;};'use strict';var Sequelize=require(_0xef35('0x0'));module[_0xef35('0x1')]={'field':{'type':Sequelize[_0xef35('0x2')]},'alias':{'type':Sequelize[_0xef35('0x3')]},'function':{'type':Sequelize[_0xef35('0x3')]},'format':{'type':Sequelize[_0xef35('0x3')]},'groupBy':{'type':Sequelize[_0xef35('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xef35('0x3')]},'custom':{'type':Sequelize[_0xef35('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe64f=['exports','TEXT','STRING','BOOLEAN'];(function(_0x2f2b03,_0x39f038){var _0x44ee4b=function(_0x4336ac){while(--_0x4336ac){_0x2f2b03['push'](_0x2f2b03['shift']());}};_0x44ee4b(++_0x39f038);}(_0xe64f,0x1a8));var _0xfe64=function(_0x16da64,_0x357fbd){_0x16da64=_0x16da64-0x0;var _0x15d5b=_0xe64f[_0x16da64];return _0x15d5b;};'use strict';var Sequelize=require('sequelize');module[_0xfe64('0x0')]={'field':{'type':Sequelize[_0xfe64('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xfe64('0x2')]},'format':{'type':Sequelize[_0xfe64('0x2')]},'groupBy':{'type':Sequelize[_0xfe64('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfe64('0x2')]},'custom':{'type':Sequelize[_0xfe64('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5edcff4..6605247 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 _0x8aaa=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','bulkCreate','update','bulkDestroy','ids','addFields','sequelize','transaction','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x3a7e01,_0x51204c){var _0x5b8398=function(_0x4dcfab){while(--_0x4dcfab){_0x3a7e01['push'](_0x3a7e01['shift']());}};_0x5b8398(++_0x51204c);}(_0x8aaa,0x10a));var _0xa8aa=function(_0x5ee73b,_0x282c4c){_0x5ee73b=_0x5ee73b-0x0;var _0x22948a=_0x8aaa[_0x5ee73b];return _0x22948a;};'use strict';var emlformat=require(_0xa8aa('0x0'));var rimraf=require(_0xa8aa('0x1'));var zipdir=require(_0xa8aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8aa('0x3'));var moment=require('moment');var BPromise=require(_0xa8aa('0x4'));var Mustache=require('mustache');var util=require(_0xa8aa('0x5'));var path=require(_0xa8aa('0x6'));var sox=require(_0xa8aa('0x7'));var csv=require(_0xa8aa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8aa('0x9'));var _=require(_0xa8aa('0xa'));var squel=require(_0xa8aa('0xb'));var crypto=require(_0xa8aa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa8aa('0xd'));var toCsv=require(_0xa8aa('0x8'));var querystring=require(_0xa8aa('0xe'));var Papa=require(_0xa8aa('0xf'));var Redis=require(_0xa8aa('0x10'));var authService=require(_0xa8aa('0x11'));var qs=require(_0xa8aa('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8aa('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa8aa('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa8aa('0x15'));var db=require(_0xa8aa('0x16'))['db'];function respondWithStatusCode(_0x4de1f0,_0x4ac506){_0x4ac506=_0x4ac506||0xcc;return function(_0x52c314){if(_0x52c314){return _0x4de1f0['sendStatus'](_0x4ac506);}return _0x4de1f0[_0xa8aa('0x17')](_0x4ac506)[_0xa8aa('0x18')]();};}function respondWithResult(_0x5b38ca,_0x45c3e6){_0x45c3e6=_0x45c3e6||0xc8;return function(_0x25d333){if(_0x25d333){return _0x5b38ca[_0xa8aa('0x17')](_0x45c3e6)[_0xa8aa('0x19')](_0x25d333);}};}function respondWithFilteredResult(_0x4ed803,_0x1aa4d6){return function(_0x483a4b){if(_0x483a4b){var _0x4ed67d=typeof _0x1aa4d6[_0xa8aa('0x1a')]===_0xa8aa('0x1b')&&typeof _0x1aa4d6[_0xa8aa('0x1c')]===_0xa8aa('0x1b');var _0x274b0c=_0x483a4b['count'];var _0x5269d9=_0x4ed67d?0x0:_0x1aa4d6[_0xa8aa('0x1a')];var _0x1a52ff=_0x4ed67d?_0x483a4b[_0xa8aa('0x1d')]:_0x1aa4d6[_0xa8aa('0x1a')]+_0x1aa4d6[_0xa8aa('0x1c')];var _0x13c118;if(_0x1a52ff>=_0x274b0c){_0x1a52ff=_0x274b0c;_0x13c118=0xc8;}else{_0x13c118=0xce;}_0x4ed803[_0xa8aa('0x17')](_0x13c118);return _0x4ed803['set'](_0xa8aa('0x1e'),_0x5269d9+'-'+_0x1a52ff+'/'+_0x274b0c)[_0xa8aa('0x19')](_0x483a4b);}return null;};}function patchUpdates(_0x5dbc61){return function(_0x5c3c23){try{jsonpatch['apply'](_0x5c3c23,_0x5dbc61,!![]);}catch(_0x564a4a){return BPromise[_0xa8aa('0x1f')](_0x564a4a);}return _0x5c3c23[_0xa8aa('0x20')]();};}function saveUpdates(_0x2afc86,_0x4cf473){return function(_0x5548d9){if(_0x5548d9){return _0x5548d9['update'](_0x2afc86)[_0xa8aa('0x21')](function(_0x3bc136){return _0x3bc136;});}return null;};}function removeEntity(_0x276b0c,_0x10a7eb){return function(_0x5caa39){if(_0x5caa39){return _0x5caa39[_0xa8aa('0x22')]()['then'](function(){_0x276b0c[_0xa8aa('0x17')](0xcc)[_0xa8aa('0x18')]();});}};}function handleEntityNotFound(_0x5a2dc5,_0x5998c5){return function(_0x1f8527){if(!_0x1f8527){_0x5a2dc5['sendStatus'](0x194);}return _0x1f8527;};}function handleError(_0x3ce5cb,_0x34449e){_0x34449e=_0x34449e||0x1f4;return function(_0xda83f2){logger['error'](_0xda83f2[_0xa8aa('0x23')]);if(_0xda83f2[_0xa8aa('0x24')]){delete _0xda83f2[_0xa8aa('0x24')];}_0x3ce5cb[_0xa8aa('0x17')](_0x34449e)['send'](_0xda83f2);};}exports[_0xa8aa('0x25')]=function(_0x40a2a6,_0x39accd){var _0x4d6589={},_0xcb4825={},_0x13e766={'count':0x0,'rows':[]};var _0x1a10c9=_['map'](db[_0xa8aa('0x26')][_0xa8aa('0x27')],function(_0x4af511){return{'name':_0x4af511[_0xa8aa('0x28')],'type':_0x4af511[_0xa8aa('0x29')][_0xa8aa('0x2a')]};});_0xcb4825[_0xa8aa('0x2b')]=_[_0xa8aa('0x2c')](_0x1a10c9,_0xa8aa('0x24'));_0xcb4825[_0xa8aa('0x2d')]=_[_0xa8aa('0x2e')](_0x40a2a6['query']);_0xcb4825[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0xcb4825[_0xa8aa('0x2b')],_0xcb4825[_0xa8aa('0x2d')]);_0x4d6589[_0xa8aa('0x31')]=_['intersection'](_0xcb4825[_0xa8aa('0x2b')],qs[_0xa8aa('0x32')](_0x40a2a6[_0xa8aa('0x2d')]['fields']));_0x4d6589[_0xa8aa('0x31')]=_0x4d6589['attributes'][_0xa8aa('0x33')]?_0x4d6589[_0xa8aa('0x31')]:_0xcb4825[_0xa8aa('0x2b')];if(!_0x40a2a6[_0xa8aa('0x2d')][_0xa8aa('0x34')](_0xa8aa('0x35'))){_0x4d6589[_0xa8aa('0x1c')]=qs[_0xa8aa('0x1c')](_0x40a2a6[_0xa8aa('0x2d')][_0xa8aa('0x1c')]);_0x4d6589[_0xa8aa('0x1a')]=qs[_0xa8aa('0x1a')](_0x40a2a6[_0xa8aa('0x2d')][_0xa8aa('0x1a')]);}_0x4d6589[_0xa8aa('0x36')]=qs[_0xa8aa('0x37')](_0x40a2a6['query']['sort']);_0x4d6589['where']=qs[_0xa8aa('0x2f')](_[_0xa8aa('0x38')](_0x40a2a6[_0xa8aa('0x2d')],_0xcb4825[_0xa8aa('0x2f')]),_0x1a10c9);if(_0x40a2a6[_0xa8aa('0x2d')]['filter']){_0x4d6589[_0xa8aa('0x39')]=_[_0xa8aa('0x3a')](_0x4d6589['where'],{'$or':_[_0xa8aa('0x2c')](_0x1a10c9,function(_0x423a38){if(_0x423a38[_0xa8aa('0x29')]!=='VIRTUAL'){var _0x103058={};_0x103058[_0x423a38[_0xa8aa('0x24')]]={'$like':'%'+_0x40a2a6['query'][_0xa8aa('0x3b')]+'%'};return _0x103058;}})});}_0x4d6589=_['merge']({},_0x4d6589,_0x40a2a6['options']);var _0x5229c1={'where':_0x4d6589[_0xa8aa('0x39')]};return db[_0xa8aa('0x26')][_0xa8aa('0x1d')](_0x5229c1)['then'](function(_0x29164e){_0x13e766['count']=_0x29164e;if(_0x40a2a6['query'][_0xa8aa('0x3c')]){_0x4d6589[_0xa8aa('0x3d')]=[{'all':!![]}];}return db[_0xa8aa('0x26')][_0xa8aa('0x3e')](_0x4d6589);})[_0xa8aa('0x21')](function(_0x327ab7){_0x13e766[_0xa8aa('0x3f')]=_0x327ab7;return _0x13e766;})[_0xa8aa('0x21')](respondWithFilteredResult(_0x39accd,_0x4d6589))[_0xa8aa('0x40')](handleError(_0x39accd,null));};exports[_0xa8aa('0x41')]=function(_0x573df6,_0x29a1c4){var _0x5301ce={'raw':![],'where':{'id':_0x573df6[_0xa8aa('0x42')]['id']}},_0x2de433={};_0x2de433[_0xa8aa('0x2b')]=_['keys'](db[_0xa8aa('0x26')][_0xa8aa('0x27')]);_0x2de433['query']=_[_0xa8aa('0x2e')](_0x573df6[_0xa8aa('0x2d')]);_0x2de433[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0x2de433[_0xa8aa('0x2b')],_0x2de433[_0xa8aa('0x2d')]);_0x5301ce[_0xa8aa('0x31')]=_[_0xa8aa('0x30')](_0x2de433[_0xa8aa('0x2b')],qs[_0xa8aa('0x32')](_0x573df6[_0xa8aa('0x2d')][_0xa8aa('0x32')]));_0x5301ce[_0xa8aa('0x31')]=_0x5301ce[_0xa8aa('0x31')][_0xa8aa('0x33')]?_0x5301ce[_0xa8aa('0x31')]:_0x2de433[_0xa8aa('0x2b')];if(_0x573df6['query'][_0xa8aa('0x3c')]){_0x5301ce['include']=[{'all':!![]}];}_0x5301ce=_[_0xa8aa('0x3a')]({},_0x5301ce,_0x573df6[_0xa8aa('0x43')]);return db[_0xa8aa('0x26')][_0xa8aa('0x44')](_0x5301ce)[_0xa8aa('0x21')](handleEntityNotFound(_0x29a1c4,null))['then'](respondWithResult(_0x29a1c4,null))[_0xa8aa('0x40')](handleError(_0x29a1c4,null));};exports[_0xa8aa('0x45')]=function(_0x439613,_0x47383c){return db[_0xa8aa('0x26')]['create'](_0x439613[_0xa8aa('0x46')],{})[_0xa8aa('0x21')](respondWithResult(_0x47383c,0xc9))['catch'](handleError(_0x47383c,null));};exports[_0xa8aa('0x47')]=function(_0x22d6ad,_0x2822c3){return db['AnalyticFieldReport'][_0xa8aa('0x47')](_0x22d6ad[_0xa8aa('0x46')],{'raw':![],'individualHooks':!![]})[_0xa8aa('0x21')](respondWithResult(_0x2822c3,0xc9))[_0xa8aa('0x40')](handleError(_0x2822c3,null));};exports[_0xa8aa('0x48')]=function(_0x2dfc51,_0x1e5042){if(_0x2dfc51[_0xa8aa('0x46')]['id']){delete _0x2dfc51[_0xa8aa('0x46')]['id'];}return db[_0xa8aa('0x26')][_0xa8aa('0x44')]({'where':{'id':_0x2dfc51[_0xa8aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e5042,null))[_0xa8aa('0x21')](saveUpdates(_0x2dfc51['body'],null))['then'](respondWithResult(_0x1e5042,null))[_0xa8aa('0x40')](handleError(_0x1e5042,null));};exports[_0xa8aa('0x22')]=function(_0x32109a,_0x33489d){return db['AnalyticFieldReport'][_0xa8aa('0x44')]({'where':{'id':_0x32109a['params']['id']}})[_0xa8aa('0x21')](handleEntityNotFound(_0x33489d,null))[_0xa8aa('0x21')](removeEntity(_0x33489d,null))['catch'](handleError(_0x33489d,null));};exports[_0xa8aa('0x49')]=function(_0x11536f,_0x44cebd){return db[_0xa8aa('0x26')][_0xa8aa('0x22')]({'where':{'id':_0x11536f[_0xa8aa('0x2d')][_0xa8aa('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xa8aa('0x21')](respondWithResult(_0x44cebd,0xcc))['catch'](handleError(_0x44cebd,null));};exports[_0xa8aa('0x4b')]=function(_0xeb3d19,_0x3ece61,_0x154466){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0xeb3d19[_0xa8aa('0x42')]['id']}})[_0xa8aa('0x21')](handleEntityNotFound(_0x3ece61,null))[_0xa8aa('0x21')](function(_0xcb9acd){if(_0xcb9acd){return db[_0xa8aa('0x4c')][_0xa8aa('0x4d')](function(_0x3e79e8){return db[_0xa8aa('0x26')][_0xa8aa('0x22')]({'where':{'CustomReportId':_0xeb3d19[_0xa8aa('0x42')]['id']},'transaction':_0x3e79e8})[_0xa8aa('0x21')](function(_0x4e802d){var _0x5dbaed=_[_0xa8aa('0x2c')](_0xeb3d19[_0xa8aa('0x46')],function(_0x2244d2){delete _0x2244d2['id'];_0x2244d2['CustomReportId']=_0xeb3d19[_0xa8aa('0x42')]['id'];return _0x2244d2;});return db['AnalyticFieldReport'][_0xa8aa('0x47')](_0x5dbaed,{'transaction':_0x3e79e8});});})[_0xa8aa('0x21')](function(){return db[_0xa8aa('0x26')][_0xa8aa('0x3e')]({'where':{'CustomReportId':_0xeb3d19[_0xa8aa('0x42')]['id']}});});}})[_0xa8aa('0x21')](respondWithResult(_0x3ece61,null))[_0xa8aa('0x40')](handleError(_0x3ece61,null));}; \ No newline at end of file +var _0x037e=['api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','rawAttributes','include','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x037e,0x1ec));var _0xe037=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x037e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe037('0x0'));var rimraf=require(_0xe037('0x1'));var zipdir=require(_0xe037('0x2'));var jsonpatch=require(_0xe037('0x3'));var rp=require(_0xe037('0x4'));var moment=require(_0xe037('0x5'));var BPromise=require(_0xe037('0x6'));var Mustache=require(_0xe037('0x7'));var util=require(_0xe037('0x8'));var path=require(_0xe037('0x9'));var sox=require(_0xe037('0xa'));var csv=require(_0xe037('0xb'));var ejs=require(_0xe037('0xc'));var fs=require('fs');var fs_extra=require(_0xe037('0xd'));var _=require(_0xe037('0xe'));var squel=require(_0xe037('0xf'));var crypto=require(_0xe037('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe037('0xb'));var querystring=require(_0xe037('0x11'));var Papa=require(_0xe037('0x12'));var Redis=require(_0xe037('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe037('0x14'));var as=require(_0xe037('0x15'));var hardwareService=require(_0xe037('0x16'));var logger=require(_0xe037('0x17'))(_0xe037('0x18'));var utils=require(_0xe037('0x19'));var config=require(_0xe037('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xe037('0x1b'))['db'];function respondWithStatusCode(_0x23a693,_0xed735a){_0xed735a=_0xed735a||0xcc;return function(_0x1f256f){if(_0x1f256f){return _0x23a693['sendStatus'](_0xed735a);}return _0x23a693['status'](_0xed735a)[_0xe037('0x1c')]();};}function respondWithResult(_0x7f9b9,_0x450776){_0x450776=_0x450776||0xc8;return function(_0x251e01){if(_0x251e01){return _0x7f9b9[_0xe037('0x1d')](_0x450776)[_0xe037('0x1e')](_0x251e01);}};}function respondWithFilteredResult(_0x1969d5,_0x2ccbf0){return function(_0x22fb0c){if(_0x22fb0c){var _0x20aad3=typeof _0x2ccbf0[_0xe037('0x1f')]===_0xe037('0x20')&&typeof _0x2ccbf0[_0xe037('0x21')]===_0xe037('0x20');var _0x13d87a=_0x22fb0c[_0xe037('0x22')];var _0x152fdd=_0x20aad3?0x0:_0x2ccbf0[_0xe037('0x1f')];var _0x2ddece=_0x20aad3?_0x22fb0c[_0xe037('0x22')]:_0x2ccbf0[_0xe037('0x1f')]+_0x2ccbf0[_0xe037('0x21')];var _0x769195;if(_0x2ddece>=_0x13d87a){_0x2ddece=_0x13d87a;_0x769195=0xc8;}else{_0x769195=0xce;}_0x1969d5[_0xe037('0x1d')](_0x769195);return _0x1969d5[_0xe037('0x23')](_0xe037('0x24'),_0x152fdd+'-'+_0x2ddece+'/'+_0x13d87a)[_0xe037('0x1e')](_0x22fb0c);}return null;};}function patchUpdates(_0x5d19be){return function(_0x29a23f){try{jsonpatch['apply'](_0x29a23f,_0x5d19be,!![]);}catch(_0x5d804a){return BPromise[_0xe037('0x25')](_0x5d804a);}return _0x29a23f['save']();};}function saveUpdates(_0x1f0ff8,_0x14c2e5){return function(_0x149b38){if(_0x149b38){return _0x149b38[_0xe037('0x26')](_0x1f0ff8)[_0xe037('0x27')](function(_0x4ff092){return _0x4ff092;});}return null;};}function removeEntity(_0x1668ef,_0x4c6a91){return function(_0x2dc8c8){if(_0x2dc8c8){return _0x2dc8c8[_0xe037('0x28')]()[_0xe037('0x27')](function(){_0x1668ef[_0xe037('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x377a14,_0x5ac43c){return function(_0x266cc8){if(!_0x266cc8){_0x377a14['sendStatus'](0x194);}return _0x266cc8;};}function handleError(_0x2dd35c,_0x193d77){_0x193d77=_0x193d77||0x1f4;return function(_0x2f80ee){logger[_0xe037('0x29')](_0x2f80ee[_0xe037('0x2a')]);if(_0x2f80ee[_0xe037('0x2b')]){delete _0x2f80ee['name'];}_0x2dd35c[_0xe037('0x1d')](_0x193d77)[_0xe037('0x2c')](_0x2f80ee);};}exports[_0xe037('0x2d')]=function(_0x4e9fe9,_0x526c1a){var _0xd82964={},_0x19988a={},_0x349cd3={'count':0x0,'rows':[]};var _0x4097ee=_[_0xe037('0x2e')](db[_0xe037('0x2f')]['rawAttributes'],function(_0x35f284){return{'name':_0x35f284['fieldName'],'type':_0x35f284[_0xe037('0x30')][_0xe037('0x31')]};});_0x19988a['model']=_[_0xe037('0x2e')](_0x4097ee,'name');_0x19988a[_0xe037('0x32')]=_[_0xe037('0x33')](_0x4e9fe9[_0xe037('0x32')]);_0x19988a[_0xe037('0x34')]=_[_0xe037('0x35')](_0x19988a[_0xe037('0x36')],_0x19988a[_0xe037('0x32')]);_0xd82964[_0xe037('0x37')]=_[_0xe037('0x35')](_0x19988a[_0xe037('0x36')],qs['fields'](_0x4e9fe9[_0xe037('0x32')][_0xe037('0x38')]));_0xd82964[_0xe037('0x37')]=_0xd82964['attributes'][_0xe037('0x39')]?_0xd82964[_0xe037('0x37')]:_0x19988a[_0xe037('0x36')];if(!_0x4e9fe9[_0xe037('0x32')][_0xe037('0x3a')](_0xe037('0x3b'))){_0xd82964['limit']=qs[_0xe037('0x21')](_0x4e9fe9[_0xe037('0x32')][_0xe037('0x21')]);_0xd82964[_0xe037('0x1f')]=qs[_0xe037('0x1f')](_0x4e9fe9[_0xe037('0x32')][_0xe037('0x1f')]);}_0xd82964[_0xe037('0x3c')]=qs[_0xe037('0x3d')](_0x4e9fe9['query'][_0xe037('0x3d')]);_0xd82964['where']=qs[_0xe037('0x34')](_[_0xe037('0x3e')](_0x4e9fe9[_0xe037('0x32')],_0x19988a[_0xe037('0x34')]),_0x4097ee);if(_0x4e9fe9[_0xe037('0x32')][_0xe037('0x3f')]){_0xd82964[_0xe037('0x40')]=_[_0xe037('0x41')](_0xd82964[_0xe037('0x40')],{'$or':_[_0xe037('0x2e')](_0x4097ee,function(_0x32dcd7){if(_0x32dcd7[_0xe037('0x30')]!==_0xe037('0x42')){var _0x3e6e0b={};_0x3e6e0b[_0x32dcd7[_0xe037('0x2b')]]={'$like':'%'+_0x4e9fe9[_0xe037('0x32')][_0xe037('0x3f')]+'%'};return _0x3e6e0b;}})});}_0xd82964=_[_0xe037('0x41')]({},_0xd82964,_0x4e9fe9[_0xe037('0x43')]);var _0x1b7dce={'where':_0xd82964[_0xe037('0x40')]};return db[_0xe037('0x2f')][_0xe037('0x22')](_0x1b7dce)[_0xe037('0x27')](function(_0x1c0f5e){_0x349cd3[_0xe037('0x22')]=_0x1c0f5e;if(_0x4e9fe9['query'][_0xe037('0x44')]){_0xd82964['include']=[{'all':!![]}];}return db[_0xe037('0x2f')]['findAll'](_0xd82964);})[_0xe037('0x27')](function(_0x4ff1c0){_0x349cd3[_0xe037('0x45')]=_0x4ff1c0;return _0x349cd3;})[_0xe037('0x27')](respondWithFilteredResult(_0x526c1a,_0xd82964))[_0xe037('0x46')](handleError(_0x526c1a,null));};exports[_0xe037('0x47')]=function(_0x40bbb4,_0x3019c6){var _0x357d1c={'raw':![],'where':{'id':_0x40bbb4['params']['id']}},_0x320ea9={};_0x320ea9[_0xe037('0x36')]=_[_0xe037('0x33')](db[_0xe037('0x2f')][_0xe037('0x48')]);_0x320ea9[_0xe037('0x32')]=_[_0xe037('0x33')](_0x40bbb4[_0xe037('0x32')]);_0x320ea9[_0xe037('0x34')]=_[_0xe037('0x35')](_0x320ea9[_0xe037('0x36')],_0x320ea9[_0xe037('0x32')]);_0x357d1c[_0xe037('0x37')]=_[_0xe037('0x35')](_0x320ea9[_0xe037('0x36')],qs['fields'](_0x40bbb4['query'][_0xe037('0x38')]));_0x357d1c[_0xe037('0x37')]=_0x357d1c[_0xe037('0x37')][_0xe037('0x39')]?_0x357d1c['attributes']:_0x320ea9[_0xe037('0x36')];if(_0x40bbb4['query'][_0xe037('0x44')]){_0x357d1c[_0xe037('0x49')]=[{'all':!![]}];}_0x357d1c=_[_0xe037('0x41')]({},_0x357d1c,_0x40bbb4[_0xe037('0x43')]);return db[_0xe037('0x2f')][_0xe037('0x4a')](_0x357d1c)[_0xe037('0x27')](handleEntityNotFound(_0x3019c6,null))['then'](respondWithResult(_0x3019c6,null))[_0xe037('0x46')](handleError(_0x3019c6,null));};exports[_0xe037('0x4b')]=function(_0x375354,_0x4ad77a){return db[_0xe037('0x2f')][_0xe037('0x4b')](_0x375354[_0xe037('0x4c')],{})['then'](respondWithResult(_0x4ad77a,0xc9))[_0xe037('0x46')](handleError(_0x4ad77a,null));};exports[_0xe037('0x4d')]=function(_0x3ecbc2,_0x461569){return db['AnalyticFieldReport']['bulkCreate'](_0x3ecbc2[_0xe037('0x4c')],{'raw':![],'individualHooks':!![]})[_0xe037('0x27')](respondWithResult(_0x461569,0xc9))[_0xe037('0x46')](handleError(_0x461569,null));};exports[_0xe037('0x26')]=function(_0x268e1d,_0x528f9d){if(_0x268e1d[_0xe037('0x4c')]['id']){delete _0x268e1d[_0xe037('0x4c')]['id'];}return db[_0xe037('0x2f')][_0xe037('0x4a')]({'where':{'id':_0x268e1d[_0xe037('0x4e')]['id']}})[_0xe037('0x27')](handleEntityNotFound(_0x528f9d,null))['then'](saveUpdates(_0x268e1d[_0xe037('0x4c')],null))[_0xe037('0x27')](respondWithResult(_0x528f9d,null))[_0xe037('0x46')](handleError(_0x528f9d,null));};exports[_0xe037('0x28')]=function(_0x4187da,_0x462298){return db['AnalyticFieldReport'][_0xe037('0x4a')]({'where':{'id':_0x4187da['params']['id']}})['then'](handleEntityNotFound(_0x462298,null))['then'](removeEntity(_0x462298,null))[_0xe037('0x46')](handleError(_0x462298,null));};exports[_0xe037('0x4f')]=function(_0x2140cc,_0x258070){return db[_0xe037('0x2f')][_0xe037('0x28')]({'where':{'id':_0x2140cc[_0xe037('0x32')][_0xe037('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xe037('0x27')](respondWithResult(_0x258070,0xcc))[_0xe037('0x46')](handleError(_0x258070,null));};exports[_0xe037('0x51')]=function(_0x384ef8,_0x33d55b,_0x421ff3){return db['AnalyticCustomReport'][_0xe037('0x52')]({'where':{'id':_0x384ef8[_0xe037('0x4e')]['id']}})[_0xe037('0x27')](handleEntityNotFound(_0x33d55b,null))['then'](function(_0x464575){if(_0x464575){return db['sequelize'][_0xe037('0x53')](function(_0x6bf944){return db[_0xe037('0x2f')][_0xe037('0x28')]({'where':{'CustomReportId':_0x384ef8['params']['id']},'transaction':_0x6bf944})[_0xe037('0x27')](function(_0x577a35){var _0x579a94=_[_0xe037('0x2e')](_0x384ef8[_0xe037('0x4c')],function(_0x3e7fd8){delete _0x3e7fd8['id'];_0x3e7fd8[_0xe037('0x54')]=_0x384ef8['params']['id'];return _0x3e7fd8;});return db['AnalyticFieldReport'][_0xe037('0x4d')](_0x579a94,{'transaction':_0x6bf944});});})[_0xe037('0x27')](function(){return db[_0xe037('0x2f')][_0xe037('0x55')]({'where':{'CustomReportId':_0x384ef8['params']['id']}});});}})[_0xe037('0x27')](respondWithResult(_0x33d55b,null))['catch'](handleError(_0x33d55b,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0245384..0668292 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 _0xfb34=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x576f97,_0x215bbd){var _0x1822a0=function(_0x34b86c){while(--_0x34b86c){_0x576f97['push'](_0x576f97['shift']());}};_0x1822a0(++_0x215bbd);}(_0xfb34,0x185));var _0x4fb3=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xfb34[_0x1dbaf7];return _0x593f05;};'use strict';var _=require(_0x4fb3('0x0'));var util=require(_0x4fb3('0x1'));var logger=require(_0x4fb3('0x2'))(_0x4fb3('0x3'));var moment=require(_0x4fb3('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fb3('0x5'));var fs=require('fs');var path=require(_0x4fb3('0x6'));var rimraf=require(_0x4fb3('0x7'));var config=require(_0x4fb3('0x8'));var attributes=require(_0x4fb3('0x9'));module[_0x4fb3('0xa')]=function(_0x4a8fe6,_0x403e60){return _0x4a8fe6[_0x4fb3('0xb')](_0x4fb3('0xc'),attributes,{'tableName':_0x4fb3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25ba=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x266012,_0x54bd8d){var _0xd52b29=function(_0x19371a){while(--_0x19371a){_0x266012['push'](_0x266012['shift']());}};_0xd52b29(++_0x54bd8d);}(_0x25ba,0xc8));var _0xa25b=function(_0x452f9f,_0x194f43){_0x452f9f=_0x452f9f-0x0;var _0xbc7fc4=_0x25ba[_0x452f9f];return _0xbc7fc4;};'use strict';var _=require('lodash');var util=require(_0xa25b('0x0'));var logger=require(_0xa25b('0x1'))(_0xa25b('0x2'));var moment=require('moment');var BPromise=require(_0xa25b('0x3'));var rp=require(_0xa25b('0x4'));var fs=require('fs');var path=require(_0xa25b('0x5'));var rimraf=require(_0xa25b('0x6'));var config=require(_0xa25b('0x7'));var attributes=require(_0xa25b('0x8'));module[_0xa25b('0x9')]=function(_0x1b05e2,_0x43981e){return _0x1b05e2[_0xa25b('0xa')](_0xa25b('0xb'),attributes,{'tableName':_0xa25b('0xc'),'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 8809490..f53f139 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 _0x658b=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x120d55,_0xe7f868){var _0x266408=function(_0x486835){while(--_0x486835){_0x120d55['push'](_0x120d55['shift']());}};_0x266408(++_0xe7f868);}(_0x658b,0x66));var _0xb658=function(_0x2096ed,_0xeac518){_0x2096ed=_0x2096ed-0x0;var _0x5c8969=_0x658b[_0x2096ed];return _0x5c8969;};'use strict';var _=require(_0xb658('0x0'));var util=require(_0xb658('0x1'));var moment=require(_0xb658('0x2'));var BPromise=require('bluebird');var rs=require(_0xb658('0x3'));var fs=require('fs');var Redis=require(_0xb658('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb658('0x5'));var config=require(_0xb658('0x6'));var jayson=require(_0xb658('0x7'));var client=jayson[_0xb658('0x8')][_0xb658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc54fa,_0x4a1edf,_0x3579f9){return new BPromise(function(_0x7ee83b,_0x34f249){return client[_0xb658('0xa')](_0xc54fa,_0x3579f9)[_0xb658('0xb')](function(_0x5f30cf){logger[_0xb658('0xc')](_0xb658('0xd'),_0x4a1edf,'request\x20sent');logger[_0xb658('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4a1edf,'request\x20sent',JSON[_0xb658('0xf')](_0x5f30cf));if(_0x5f30cf[_0xb658('0x10')]){if(_0x5f30cf[_0xb658('0x10')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4a1edf,_0x5f30cf['error'][_0xb658('0x11')]);return _0x34f249(_0x5f30cf[_0xb658('0x10')][_0xb658('0x11')]);}logger['error'](_0xb658('0xd'),_0x4a1edf,_0x5f30cf[_0xb658('0x10')]['message']);return _0x7ee83b(_0x5f30cf['error'][_0xb658('0x11')]);}else{logger[_0xb658('0xc')](_0xb658('0xd'),_0x4a1edf,_0xb658('0x12'));_0x7ee83b(_0x5f30cf[_0xb658('0x13')][_0xb658('0x11')]);}})[_0xb658('0x14')](function(_0x3df1c1){logger[_0xb658('0x10')](_0xb658('0xd'),_0x4a1edf,_0x3df1c1);_0x34f249(_0x3df1c1);});});} \ No newline at end of file +var _0xe38c=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','debug','request\x20sent','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x2b12b7,_0x2621a1){var _0x2c7af3=function(_0x4d3946){while(--_0x4d3946){_0x2b12b7['push'](_0x2b12b7['shift']());}};_0x2c7af3(++_0x2621a1);}(_0xe38c,0x1ba));var _0xce38=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xe38c[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require(_0xce38('0x0'));var moment=require(_0xce38('0x1'));var BPromise=require(_0xce38('0x2'));var rs=require(_0xce38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce38('0x4'))['db'];var utils=require(_0xce38('0x5'));var logger=require(_0xce38('0x6'))(_0xce38('0x7'));var config=require(_0xce38('0x8'));var jayson=require(_0xce38('0x9'));var client=jayson['client'][_0xce38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x346f01,_0x985dfb,_0xa1ec8e){return new BPromise(function(_0x1561f7,_0x3eba46){return client['request'](_0x346f01,_0xa1ec8e)['then'](function(_0x38098f){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x985dfb,'request\x20sent');logger[_0xce38('0xb')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x985dfb,_0xce38('0xc'),JSON[_0xce38('0xd')](_0x38098f));if(_0x38098f['error']){if(_0x38098f[_0xce38('0xe')]['code']===0x1f4){logger['error'](_0xce38('0xf'),_0x985dfb,_0x38098f[_0xce38('0xe')][_0xce38('0x10')]);return _0x3eba46(_0x38098f['error'][_0xce38('0x10')]);}logger[_0xce38('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x985dfb,_0x38098f[_0xce38('0xe')][_0xce38('0x10')]);return _0x1561f7(_0x38098f[_0xce38('0xe')][_0xce38('0x10')]);}else{logger[_0xce38('0x11')](_0xce38('0xf'),_0x985dfb,_0xce38('0xc'));_0x1561f7(_0x38098f[_0xce38('0x12')][_0xce38('0x10')]);}})[_0xce38('0x13')](function(_0x4ba451){logger[_0xce38('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x985dfb,_0x4ba451);_0x3eba46(_0x4ba451);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 4f0ab05..4d31b4a 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(_0x4d6321,_0x13044d){var _0x185667=function(_0x556b6a){while(--_0x556b6a){_0x4d6321['push'](_0x4d6321['shift']());}};_0x185667(++_0x13044d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x420425,_0x12292b){var _0x340329=function(_0x69b0f8){while(--_0x69b0f8){_0x420425['push'](_0x420425['shift']());}};_0x340329(++_0x12292b);}(_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('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 456114a..e6cce49 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 _0x7980=['exports','STRING','name','sequelize'];(function(_0x35db9d,_0x526e15){var _0x4642a0=function(_0x3117f4){while(--_0x3117f4){_0x35db9d['push'](_0x35db9d['shift']());}};_0x4642a0(++_0x526e15);}(_0x7980,0xab));var _0x0798=function(_0x51c2f8,_0x24af65){_0x51c2f8=_0x51c2f8-0x0;var _0x30b874=_0x7980[_0x51c2f8];return _0x30b874;};'use strict';var Sequelize=require(_0x0798('0x0'));module[_0x0798('0x1')]={'name':{'type':Sequelize[_0x0798('0x2')],'allowNull':![],'unique':_0x0798('0x3')},'table':{'type':Sequelize[_0x0798('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x0798('0x2')]}}; \ No newline at end of file +var _0xd027=['STRING','TEXT','exports'];(function(_0x54d5c8,_0x344ce5){var _0x525e2e=function(_0x4581b7){while(--_0x4581b7){_0x54d5c8['push'](_0x54d5c8['shift']());}};_0x525e2e(++_0x344ce5);}(_0xd027,0x197));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7d02('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7d02('0x1')]},'metric':{'type':Sequelize[_0x7d02('0x2')]},'description':{'type':Sequelize[_0x7d02('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3651553..584f38a 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x1ab724,_0x2e2566){var _0x2167ac=function(_0xb2e7fd){while(--_0xb2e7fd){_0x1ab724['push'](_0x1ab724['shift']());}};_0x2167ac(++_0x2e2566);}(_0x008c,0x188));var _0xc008=function(_0xc6583e,_0x3e854a){_0xc6583e=_0xc6583e-0x0;var _0x11f67e=_0x008c[_0xc6583e];return _0x11f67e;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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'];(function(_0x385364,_0x2d2121){var _0x27a054=function(_0x3126a9){while(--_0x3126a9){_0x385364['push'](_0x385364['shift']());}};_0x27a054(++_0x2d2121);}(_0x3e74,0x175));var _0x43e7=function(_0x4e922a,_0x418973){_0x4e922a=_0x4e922a-0x0;var _0x34f8e8=_0x3e74[_0x4e922a];return _0x34f8e8;};'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(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index ad813fd..da64f45 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 _0x24ce=['analytics_metrics','util','../../config/logger','api','moment','path','./analyticMetric.attributes','exports','define'];(function(_0x26f582,_0x2f890b){var _0x58ac50=function(_0x2cddd7){while(--_0x2cddd7){_0x26f582['push'](_0x26f582['shift']());}};_0x58ac50(++_0x2f890b);}(_0x24ce,0x1de));var _0xe24c=function(_0x45dcf6,_0x47fa5d){_0x45dcf6=_0x45dcf6-0x0;var _0x33cc76=_0x24ce[_0x45dcf6];return _0x33cc76;};'use strict';var _=require('lodash');var util=require(_0xe24c('0x0'));var logger=require(_0xe24c('0x1'))(_0xe24c('0x2'));var moment=require(_0xe24c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe24c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe24c('0x5'));module[_0xe24c('0x6')]=function(_0x6f92e0,_0x1ac59c){return _0x6f92e0[_0xe24c('0x7')]('AnalyticMetric',attributes,{'tableName':_0xe24c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fc5=['define','AnalyticMetric','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x2e2073,_0x4b778f){var _0xd996ba=function(_0x2c12ac){while(--_0x2c12ac){_0x2e2073['push'](_0x2e2073['shift']());}};_0xd996ba(++_0x4b778f);}(_0x9fc5,0xb6));var _0x59fc=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x9fc5[_0x1c546c];return _0x2cc384;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var logger=require(_0x59fc('0x1'))('api');var moment=require(_0x59fc('0x2'));var BPromise=require(_0x59fc('0x3'));var rp=require(_0x59fc('0x4'));var fs=require('fs');var path=require(_0x59fc('0x5'));var rimraf=require(_0x59fc('0x6'));var config=require(_0x59fc('0x7'));var attributes=require(_0x59fc('0x8'));module[_0x59fc('0x9')]=function(_0x4cb94d,_0x3bde0b){return _0x4cb94d[_0x59fc('0xa')](_0x59fc('0xb'),attributes,{'tableName':'analytics_metrics','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 f0470d4..a87022b 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 _0x0cb9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x596bb7,_0x2e1c68){var _0x10b55b=function(_0x433204){while(--_0x433204){_0x596bb7['push'](_0x596bb7['shift']());}};_0x10b55b(++_0x2e1c68);}(_0x0cb9,0xd1));var _0x90cb=function(_0x4a99ff,_0x181d92){_0x4a99ff=_0x4a99ff-0x0;var _0x32551e=_0x0cb9[_0x4a99ff];return _0x32551e;};'use strict';var _=require(_0x90cb('0x0'));var util=require(_0x90cb('0x1'));var moment=require(_0x90cb('0x2'));var BPromise=require(_0x90cb('0x3'));var rs=require(_0x90cb('0x4'));var fs=require('fs');var Redis=require(_0x90cb('0x5'));var db=require(_0x90cb('0x6'))['db'];var utils=require(_0x90cb('0x7'));var logger=require(_0x90cb('0x8'))(_0x90cb('0x9'));var config=require(_0x90cb('0xa'));var jayson=require(_0x90cb('0xb'));var client=jayson[_0x90cb('0xc')][_0x90cb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4f0b77,_0x47d304,_0x227cbc){return new BPromise(function(_0x5c0bf4,_0x1580e1){return client['request'](_0x4f0b77,_0x227cbc)[_0x90cb('0xe')](function(_0x40669a){logger[_0x90cb('0xf')](_0x90cb('0x10'),_0x47d304,_0x90cb('0x11'));logger[_0x90cb('0x12')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x47d304,_0x90cb('0x11'),JSON[_0x90cb('0x13')](_0x40669a));if(_0x40669a[_0x90cb('0x14')]){if(_0x40669a[_0x90cb('0x14')][_0x90cb('0x15')]===0x1f4){logger[_0x90cb('0x14')](_0x90cb('0x10'),_0x47d304,_0x40669a[_0x90cb('0x14')]['message']);return _0x1580e1(_0x40669a[_0x90cb('0x14')][_0x90cb('0x16')]);}logger['error'](_0x90cb('0x10'),_0x47d304,_0x40669a[_0x90cb('0x14')][_0x90cb('0x16')]);return _0x5c0bf4(_0x40669a[_0x90cb('0x14')][_0x90cb('0x16')]);}else{logger['info'](_0x90cb('0x10'),_0x47d304,_0x90cb('0x11'));_0x5c0bf4(_0x40669a['result']['message']);}})[_0x90cb('0x17')](function(_0x2b86a4){logger[_0x90cb('0x14')](_0x90cb('0x10'),_0x47d304,_0x2b86a4);_0x1580e1(_0x2b86a4);});});} \ No newline at end of file +var _0x584a=['jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x584a,0x6f));var _0xa584=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x584a[_0x2b9e8a];return _0x520e67;};'use strict';var _=require(_0xa584('0x0'));var util=require(_0xa584('0x1'));var moment=require(_0xa584('0x2'));var BPromise=require('bluebird');var rs=require(_0xa584('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa584('0x4'))['db'];var utils=require(_0xa584('0x5'));var logger=require(_0xa584('0x6'))(_0xa584('0x7'));var config=require(_0xa584('0x8'));var jayson=require(_0xa584('0x9'));var client=jayson[_0xa584('0xa')][_0xa584('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd8c8,_0x22552a,_0x4ad4bd){return new BPromise(function(_0x59dead,_0x17e258){return client[_0xa584('0xc')](_0x1bd8c8,_0x4ad4bd)[_0xa584('0xd')](function(_0x224808){logger[_0xa584('0xe')](_0xa584('0xf'),_0x22552a,_0xa584('0x10'));logger['debug'](_0xa584('0x11'),_0x22552a,_0xa584('0x10'),JSON[_0xa584('0x12')](_0x224808));if(_0x224808['error']){if(_0x224808[_0xa584('0x13')][_0xa584('0x14')]===0x1f4){logger[_0xa584('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x22552a,_0x224808[_0xa584('0x13')]['message']);return _0x17e258(_0x224808['error']['message']);}logger[_0xa584('0x13')](_0xa584('0xf'),_0x22552a,_0x224808[_0xa584('0x13')][_0xa584('0x15')]);return _0x59dead(_0x224808['error']['message']);}else{logger['info'](_0xa584('0xf'),_0x22552a,_0xa584('0x10'));_0x59dead(_0x224808[_0xa584('0x16')][_0xa584('0x15')]);}})[_0xa584('0x17')](function(_0x49a9c6){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x22552a,_0x49a9c6);_0x17e258(_0x49a9c6);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index b938f60..eda84c8 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 _0xf4d9=['isAuthenticated','index','get','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x1a43e6,_0x2d06bc){var _0x283d30=function(_0x5f02f5){while(--_0x5f02f5){_0x1a43e6['push'](_0x1a43e6['shift']());}};_0x283d30(++_0x2d06bc);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x36900f,_0x59fcd6){_0x36900f=_0x36900f-0x0;var _0xdf4daf=_0xf4d9[_0x36900f];return _0xdf4daf;};'use strict';var multer=require(_0x9f4d('0x0'));var util=require('util');var path=require(_0x9f4d('0x1'));var timeout=require(_0x9f4d('0x2'));var express=require(_0x9f4d('0x3'));var router=express[_0x9f4d('0x4')]();var fs_extra=require(_0x9f4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9f4d('0x6'));var config=require(_0x9f4d('0x7'));var controller=require(_0x9f4d('0x8'));router['get']('/',auth[_0x9f4d('0x9')](),controller[_0x9f4d('0xa')]);router[_0x9f4d('0xb')]('/:id',auth[_0x9f4d('0x9')](),controller['show']);router[_0x9f4d('0xc')]('/',auth['isAuthenticated'](),controller[_0x9f4d('0xd')]);router[_0x9f4d('0xe')](_0x9f4d('0xf'),auth[_0x9f4d('0x9')](),controller['update']);router[_0x9f4d('0x10')](_0x9f4d('0xf'),auth[_0x9f4d('0x9')](),controller[_0x9f4d('0x11')]);module[_0x9f4d('0x12')]=router; \ No newline at end of file +var _0x1b69=['update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x433d33,_0x361a43){var _0x468297=function(_0x49041e){while(--_0x49041e){_0x433d33['push'](_0x433d33['shift']());}};_0x468297(++_0x361a43);}(_0x1b69,0x190));var _0x91b6=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1b69[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x91b6('0x0'));var express=require(_0x91b6('0x1'));var router=express[_0x91b6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x91b6('0x3'));var interaction=require(_0x91b6('0x4'));var config=require(_0x91b6('0x5'));var controller=require(_0x91b6('0x6'));router[_0x91b6('0x7')]('/',auth[_0x91b6('0x8')](),controller[_0x91b6('0x9')]);router[_0x91b6('0x7')](_0x91b6('0xa'),auth[_0x91b6('0x8')](),controller[_0x91b6('0xb')]);router[_0x91b6('0xc')]('/',auth[_0x91b6('0x8')](),controller[_0x91b6('0xd')]);router['put']('/:id',auth[_0x91b6('0x8')](),controller[_0x91b6('0xe')]);router[_0x91b6('0xf')]('/:id',auth[_0x91b6('0x8')](),controller[_0x91b6('0x10')]);module[_0x91b6('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e723796..70f07b5 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 _0x4c33=['TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c33,0x1d9));var _0x34c3=function(_0x4b44ac,_0x84990a){_0x4b44ac=_0x4b44ac-0x0;var _0x1f3c0a=_0x4c33[_0x4b44ac];return _0x1f3c0a;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x34c3('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x3934=['sequelize','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3934,0x10e));var _0x4393=function(_0x194658,_0x45a76c){_0x194658=_0x194658-0x0;var _0x429ca1=_0x3934[_0x194658];return _0x429ca1;};'use strict';var Sequelize=require(_0x4393('0x0'));module[_0x4393('0x1')]={'tree':{'type':Sequelize[_0x4393('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 1e791fb..f762a5b 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 _0xcec5=['lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','save','update','destroy','then','error','stack','name','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcec5,0x1b5));var _0x5cec=function(_0x50de46,_0x5c398c){_0x50de46=_0x50de46-0x0;var _0x5ac054=_0xcec5[_0x50de46];return _0x5ac054;};'use strict';var emlformat=require(_0x5cec('0x0'));var rimraf=require(_0x5cec('0x1'));var zipdir=require(_0x5cec('0x2'));var jsonpatch=require(_0x5cec('0x3'));var rp=require('request-promise');var moment=require(_0x5cec('0x4'));var BPromise=require(_0x5cec('0x5'));var Mustache=require(_0x5cec('0x6'));var util=require(_0x5cec('0x7'));var path=require(_0x5cec('0x8'));var sox=require(_0x5cec('0x9'));var csv=require(_0x5cec('0xa'));var ejs=require(_0x5cec('0xb'));var fs=require('fs');var fs_extra=require(_0x5cec('0xc'));var _=require(_0x5cec('0xd'));var squel=require('squel');var crypto=require(_0x5cec('0xe'));var jsforce=require(_0x5cec('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5cec('0xa'));var querystring=require('querystring');var Papa=require(_0x5cec('0x10'));var Redis=require(_0x5cec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5cec('0x12'));var as=require(_0x5cec('0x13'));var hardwareService=require(_0x5cec('0x14'));var logger=require(_0x5cec('0x15'))('api');var utils=require(_0x5cec('0x16'));var config=require(_0x5cec('0x17'));var licenseUtil=require(_0x5cec('0x18'));var db=require(_0x5cec('0x19'))['db'];function respondWithStatusCode(_0x4a2af4,_0x68227e){_0x68227e=_0x68227e||0xcc;return function(_0x4e7e2f){if(_0x4e7e2f){return _0x4a2af4[_0x5cec('0x1a')](_0x68227e);}return _0x4a2af4['status'](_0x68227e)[_0x5cec('0x1b')]();};}function respondWithResult(_0x48837b,_0xa9b03d){_0xa9b03d=_0xa9b03d||0xc8;return function(_0x3c167d){if(_0x3c167d){return _0x48837b[_0x5cec('0x1c')](_0xa9b03d)['json'](_0x3c167d);}};}function respondWithFilteredResult(_0x271f59,_0x936cf){return function(_0x116f61){if(_0x116f61){var _0x3a4129=typeof _0x936cf['offset']===_0x5cec('0x1d')&&typeof _0x936cf['limit']==='undefined';var _0x257bd4=_0x116f61['count'];var _0x1d0f77=_0x3a4129?0x0:_0x936cf['offset'];var _0x5c8b20=_0x3a4129?_0x116f61[_0x5cec('0x1e')]:_0x936cf[_0x5cec('0x1f')]+_0x936cf[_0x5cec('0x20')];var _0x3529ee;if(_0x5c8b20>=_0x257bd4){_0x5c8b20=_0x257bd4;_0x3529ee=0xc8;}else{_0x3529ee=0xce;}_0x271f59[_0x5cec('0x1c')](_0x3529ee);return _0x271f59[_0x5cec('0x21')](_0x5cec('0x22'),_0x1d0f77+'-'+_0x5c8b20+'/'+_0x257bd4)[_0x5cec('0x23')](_0x116f61);}return null;};}function patchUpdates(_0x2f9f6b){return function(_0x5cfdf4){try{jsonpatch['apply'](_0x5cfdf4,_0x2f9f6b,!![]);}catch(_0x53d812){return BPromise['reject'](_0x53d812);}return _0x5cfdf4[_0x5cec('0x24')]();};}function saveUpdates(_0x42d37a,_0x4a4293){return function(_0x5c0510){if(_0x5c0510){return _0x5c0510[_0x5cec('0x25')](_0x42d37a)['then'](function(_0x68aaf5){return _0x68aaf5;});}return null;};}function removeEntity(_0x5a5d59,_0x55676d){return function(_0x3e421d){if(_0x3e421d){return _0x3e421d[_0x5cec('0x26')]()[_0x5cec('0x27')](function(){_0x5a5d59[_0x5cec('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12facf,_0x3192f4){return function(_0xffaee){if(!_0xffaee){_0x12facf[_0x5cec('0x1a')](0x194);}return _0xffaee;};}function handleError(_0x4ee74b,_0x1f04ee){_0x1f04ee=_0x1f04ee||0x1f4;return function(_0x1c9c9a){logger[_0x5cec('0x28')](_0x1c9c9a[_0x5cec('0x29')]);if(_0x1c9c9a[_0x5cec('0x2a')]){delete _0x1c9c9a[_0x5cec('0x2a')];}_0x4ee74b[_0x5cec('0x1c')](_0x1f04ee)['send'](_0x1c9c9a);};}exports['index']=function(_0x4feea5,_0x38d757){var _0x1df8cf={},_0x4cbb3a={},_0x5e4932={'count':0x0,'rows':[]};var _0x3b2b7f=_['map'](db['AnalyticTreeReport'][_0x5cec('0x2b')],function(_0x3cd092){return{'name':_0x3cd092[_0x5cec('0x2c')],'type':_0x3cd092['type'][_0x5cec('0x2d')]};});_0x4cbb3a[_0x5cec('0x2e')]=_[_0x5cec('0x2f')](_0x3b2b7f,_0x5cec('0x2a'));_0x4cbb3a[_0x5cec('0x30')]=_[_0x5cec('0x31')](_0x4feea5['query']);_0x4cbb3a[_0x5cec('0x32')]=_['intersection'](_0x4cbb3a[_0x5cec('0x2e')],_0x4cbb3a[_0x5cec('0x30')]);_0x1df8cf['attributes']=_[_0x5cec('0x33')](_0x4cbb3a['model'],qs[_0x5cec('0x34')](_0x4feea5['query'][_0x5cec('0x34')]));_0x1df8cf[_0x5cec('0x35')]=_0x1df8cf[_0x5cec('0x35')]['length']?_0x1df8cf['attributes']:_0x4cbb3a[_0x5cec('0x2e')];if(!_0x4feea5['query'][_0x5cec('0x36')](_0x5cec('0x37'))){_0x1df8cf[_0x5cec('0x20')]=qs[_0x5cec('0x20')](_0x4feea5[_0x5cec('0x30')]['limit']);_0x1df8cf[_0x5cec('0x1f')]=qs['offset'](_0x4feea5['query'][_0x5cec('0x1f')]);}_0x1df8cf[_0x5cec('0x38')]=qs[_0x5cec('0x39')](_0x4feea5[_0x5cec('0x30')][_0x5cec('0x39')]);_0x1df8cf['where']=qs[_0x5cec('0x32')](_[_0x5cec('0x3a')](_0x4feea5[_0x5cec('0x30')],_0x4cbb3a['filters']),_0x3b2b7f);if(_0x4feea5['query'][_0x5cec('0x3b')]){_0x1df8cf[_0x5cec('0x3c')]=_[_0x5cec('0x3d')](_0x1df8cf['where'],{'$or':_['map'](_0x3b2b7f,function(_0x5564eb){if(_0x5564eb['type']!==_0x5cec('0x3e')){var _0x53225f={};_0x53225f[_0x5564eb[_0x5cec('0x2a')]]={'$like':'%'+_0x4feea5['query']['filter']+'%'};return _0x53225f;}})});}_0x1df8cf=_[_0x5cec('0x3d')]({},_0x1df8cf,_0x4feea5[_0x5cec('0x3f')]);var _0x21aa39={'where':_0x1df8cf[_0x5cec('0x3c')]};return db[_0x5cec('0x40')][_0x5cec('0x1e')](_0x21aa39)[_0x5cec('0x27')](function(_0x419683){_0x5e4932['count']=_0x419683;if(_0x4feea5[_0x5cec('0x30')][_0x5cec('0x41')]){_0x1df8cf[_0x5cec('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x5cec('0x43')](_0x1df8cf);})[_0x5cec('0x27')](function(_0x4efa5c){_0x5e4932[_0x5cec('0x44')]=_0x4efa5c;return _0x5e4932;})[_0x5cec('0x27')](respondWithFilteredResult(_0x38d757,_0x1df8cf))[_0x5cec('0x45')](handleError(_0x38d757,null));};exports['show']=function(_0x5b43ea,_0x19efab){var _0x40a73e={'raw':!![],'where':{'id':_0x5b43ea[_0x5cec('0x46')]['id']}},_0x57b7e5={};_0x57b7e5[_0x5cec('0x2e')]=_[_0x5cec('0x31')](db[_0x5cec('0x40')][_0x5cec('0x2b')]);_0x57b7e5[_0x5cec('0x30')]=_['keys'](_0x5b43ea[_0x5cec('0x30')]);_0x57b7e5[_0x5cec('0x32')]=_[_0x5cec('0x33')](_0x57b7e5[_0x5cec('0x2e')],_0x57b7e5[_0x5cec('0x30')]);_0x40a73e[_0x5cec('0x35')]=_[_0x5cec('0x33')](_0x57b7e5[_0x5cec('0x2e')],qs[_0x5cec('0x34')](_0x5b43ea[_0x5cec('0x30')][_0x5cec('0x34')]));_0x40a73e[_0x5cec('0x35')]=_0x40a73e[_0x5cec('0x35')][_0x5cec('0x47')]?_0x40a73e['attributes']:_0x57b7e5[_0x5cec('0x2e')];if(_0x5b43ea[_0x5cec('0x30')][_0x5cec('0x41')]){_0x40a73e['include']=[{'all':!![]}];}_0x40a73e=_['merge']({},_0x40a73e,_0x5b43ea['options']);return db[_0x5cec('0x40')][_0x5cec('0x48')](_0x40a73e)[_0x5cec('0x27')](handleEntityNotFound(_0x19efab,null))[_0x5cec('0x27')](respondWithResult(_0x19efab,null))['catch'](handleError(_0x19efab,null));};exports[_0x5cec('0x49')]=function(_0x1aaeec,_0x337c32){return db[_0x5cec('0x40')][_0x5cec('0x49')](_0x1aaeec['body'],{})[_0x5cec('0x27')](respondWithResult(_0x337c32,0xc9))['catch'](handleError(_0x337c32,null));};exports[_0x5cec('0x25')]=function(_0xa811bf,_0x182210){if(_0xa811bf['body']['id']){delete _0xa811bf[_0x5cec('0x4a')]['id'];}return db[_0x5cec('0x40')][_0x5cec('0x48')]({'where':{'id':_0xa811bf[_0x5cec('0x46')]['id']}})[_0x5cec('0x27')](handleEntityNotFound(_0x182210,null))[_0x5cec('0x27')](saveUpdates(_0xa811bf['body'],null))[_0x5cec('0x27')](respondWithResult(_0x182210,null))['catch'](handleError(_0x182210,null));};exports['destroy']=function(_0x44c2e6,_0xa53f2){return db[_0x5cec('0x40')][_0x5cec('0x48')]({'where':{'id':_0x44c2e6[_0x5cec('0x46')]['id']}})[_0x5cec('0x27')](handleEntityNotFound(_0xa53f2,null))['then'](removeEntity(_0xa53f2,null))[_0x5cec('0x45')](handleError(_0xa53f2,null));}; \ No newline at end of file +var _0x8999=['count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','offset','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','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/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined'];(function(_0x563456,_0x10d2da){var _0x4c009=function(_0x31cc55){while(--_0x31cc55){_0x563456['push'](_0x563456['shift']());}};_0x4c009(++_0x10d2da);}(_0x8999,0xb3));var _0x9899=function(_0x57e9a0,_0x24b43a){_0x57e9a0=_0x57e9a0-0x0;var _0x3c0c39=_0x8999[_0x57e9a0];return _0x3c0c39;};'use strict';var emlformat=require(_0x9899('0x0'));var rimraf=require(_0x9899('0x1'));var zipdir=require(_0x9899('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9899('0x3'));var moment=require(_0x9899('0x4'));var BPromise=require(_0x9899('0x5'));var Mustache=require(_0x9899('0x6'));var util=require(_0x9899('0x7'));var path=require(_0x9899('0x8'));var sox=require(_0x9899('0x9'));var csv=require(_0x9899('0xa'));var ejs=require(_0x9899('0xb'));var fs=require('fs');var fs_extra=require(_0x9899('0xc'));var _=require(_0x9899('0xd'));var squel=require(_0x9899('0xe'));var crypto=require(_0x9899('0xf'));var jsforce=require(_0x9899('0x10'));var deskjs=require(_0x9899('0x11'));var toCsv=require(_0x9899('0xa'));var querystring=require(_0x9899('0x12'));var Papa=require(_0x9899('0x13'));var Redis=require(_0x9899('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9899('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9899('0x16'))(_0x9899('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9899('0x18'));var db=require(_0x9899('0x19'))['db'];function respondWithStatusCode(_0x4cf048,_0x55ea76){_0x55ea76=_0x55ea76||0xcc;return function(_0x11b816){if(_0x11b816){return _0x4cf048[_0x9899('0x1a')](_0x55ea76);}return _0x4cf048['status'](_0x55ea76)[_0x9899('0x1b')]();};}function respondWithResult(_0x4208ea,_0x2c1fca){_0x2c1fca=_0x2c1fca||0xc8;return function(_0x779d92){if(_0x779d92){return _0x4208ea[_0x9899('0x1c')](_0x2c1fca)[_0x9899('0x1d')](_0x779d92);}};}function respondWithFilteredResult(_0x29ab17,_0x2f513c){return function(_0x42fc53){if(_0x42fc53){var _0xc71e3d=typeof _0x2f513c['offset']===_0x9899('0x1e')&&typeof _0x2f513c['limit']===_0x9899('0x1e');var _0xce40fb=_0x42fc53[_0x9899('0x1f')];var _0x3ea213=_0xc71e3d?0x0:_0x2f513c['offset'];var _0x3921b6=_0xc71e3d?_0x42fc53[_0x9899('0x1f')]:_0x2f513c['offset']+_0x2f513c[_0x9899('0x20')];var _0x1321a8;if(_0x3921b6>=_0xce40fb){_0x3921b6=_0xce40fb;_0x1321a8=0xc8;}else{_0x1321a8=0xce;}_0x29ab17['status'](_0x1321a8);return _0x29ab17[_0x9899('0x21')](_0x9899('0x22'),_0x3ea213+'-'+_0x3921b6+'/'+_0xce40fb)['json'](_0x42fc53);}return null;};}function patchUpdates(_0x714205){return function(_0x2901da){try{jsonpatch[_0x9899('0x23')](_0x2901da,_0x714205,!![]);}catch(_0x4040c7){return BPromise[_0x9899('0x24')](_0x4040c7);}return _0x2901da[_0x9899('0x25')]();};}function saveUpdates(_0x3bcc80,_0x42d97d){return function(_0x5c02fc){if(_0x5c02fc){return _0x5c02fc[_0x9899('0x26')](_0x3bcc80)[_0x9899('0x27')](function(_0x1c96b9){return _0x1c96b9;});}return null;};}function removeEntity(_0x48ae3c,_0x1f2915){return function(_0x488e9a){if(_0x488e9a){return _0x488e9a[_0x9899('0x28')]()[_0x9899('0x27')](function(){_0x48ae3c[_0x9899('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x123cdd,_0x565768){return function(_0x452892){if(!_0x452892){_0x123cdd['sendStatus'](0x194);}return _0x452892;};}function handleError(_0xb59f5f,_0x4b454f){_0x4b454f=_0x4b454f||0x1f4;return function(_0x32006b){logger['error'](_0x32006b['stack']);if(_0x32006b[_0x9899('0x29')]){delete _0x32006b[_0x9899('0x29')];}_0xb59f5f[_0x9899('0x1c')](_0x4b454f)['send'](_0x32006b);};}exports[_0x9899('0x2a')]=function(_0xf0747a,_0xfeab06){var _0x21b59a={},_0x17f9d5={},_0x53d802={'count':0x0,'rows':[]};var _0x30befe=_[_0x9899('0x2b')](db[_0x9899('0x2c')][_0x9899('0x2d')],function(_0x2b9488){return{'name':_0x2b9488['fieldName'],'type':_0x2b9488['type']['key']};});_0x17f9d5[_0x9899('0x2e')]=_[_0x9899('0x2b')](_0x30befe,_0x9899('0x29'));_0x17f9d5['query']=_[_0x9899('0x2f')](_0xf0747a[_0x9899('0x30')]);_0x17f9d5[_0x9899('0x31')]=_[_0x9899('0x32')](_0x17f9d5[_0x9899('0x2e')],_0x17f9d5['query']);_0x21b59a[_0x9899('0x33')]=_[_0x9899('0x32')](_0x17f9d5['model'],qs[_0x9899('0x34')](_0xf0747a[_0x9899('0x30')][_0x9899('0x34')]));_0x21b59a[_0x9899('0x33')]=_0x21b59a[_0x9899('0x33')][_0x9899('0x35')]?_0x21b59a[_0x9899('0x33')]:_0x17f9d5['model'];if(!_0xf0747a['query']['hasOwnProperty']('nolimit')){_0x21b59a[_0x9899('0x20')]=qs[_0x9899('0x20')](_0xf0747a[_0x9899('0x30')][_0x9899('0x20')]);_0x21b59a[_0x9899('0x36')]=qs[_0x9899('0x36')](_0xf0747a[_0x9899('0x30')][_0x9899('0x36')]);}_0x21b59a['order']=qs['sort'](_0xf0747a[_0x9899('0x30')][_0x9899('0x37')]);_0x21b59a[_0x9899('0x38')]=qs[_0x9899('0x31')](_['pick'](_0xf0747a[_0x9899('0x30')],_0x17f9d5['filters']),_0x30befe);if(_0xf0747a[_0x9899('0x30')][_0x9899('0x39')]){_0x21b59a[_0x9899('0x38')]=_[_0x9899('0x3a')](_0x21b59a[_0x9899('0x38')],{'$or':_['map'](_0x30befe,function(_0x1db76f){if(_0x1db76f[_0x9899('0x3b')]!==_0x9899('0x3c')){var _0x2349f0={};_0x2349f0[_0x1db76f[_0x9899('0x29')]]={'$like':'%'+_0xf0747a[_0x9899('0x30')]['filter']+'%'};return _0x2349f0;}})});}_0x21b59a=_['merge']({},_0x21b59a,_0xf0747a[_0x9899('0x3d')]);var _0x394b73={'where':_0x21b59a[_0x9899('0x38')]};return db['AnalyticTreeReport'][_0x9899('0x1f')](_0x394b73)[_0x9899('0x27')](function(_0x2ae9a8){_0x53d802['count']=_0x2ae9a8;if(_0xf0747a['query'][_0x9899('0x3e')]){_0x21b59a[_0x9899('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x21b59a);})['then'](function(_0x87174){_0x53d802[_0x9899('0x40')]=_0x87174;return _0x53d802;})[_0x9899('0x27')](respondWithFilteredResult(_0xfeab06,_0x21b59a))[_0x9899('0x41')](handleError(_0xfeab06,null));};exports[_0x9899('0x42')]=function(_0x14ad75,_0x14826f){var _0x5120aa={'raw':!![],'where':{'id':_0x14ad75['params']['id']}},_0xc99ec4={};_0xc99ec4[_0x9899('0x2e')]=_[_0x9899('0x2f')](db[_0x9899('0x2c')]['rawAttributes']);_0xc99ec4['query']=_[_0x9899('0x2f')](_0x14ad75[_0x9899('0x30')]);_0xc99ec4[_0x9899('0x31')]=_[_0x9899('0x32')](_0xc99ec4['model'],_0xc99ec4[_0x9899('0x30')]);_0x5120aa[_0x9899('0x33')]=_['intersection'](_0xc99ec4['model'],qs['fields'](_0x14ad75[_0x9899('0x30')][_0x9899('0x34')]));_0x5120aa[_0x9899('0x33')]=_0x5120aa[_0x9899('0x33')]['length']?_0x5120aa[_0x9899('0x33')]:_0xc99ec4['model'];if(_0x14ad75[_0x9899('0x30')][_0x9899('0x3e')]){_0x5120aa[_0x9899('0x3f')]=[{'all':!![]}];}_0x5120aa=_[_0x9899('0x3a')]({},_0x5120aa,_0x14ad75[_0x9899('0x3d')]);return db[_0x9899('0x2c')][_0x9899('0x43')](_0x5120aa)['then'](handleEntityNotFound(_0x14826f,null))[_0x9899('0x27')](respondWithResult(_0x14826f,null))[_0x9899('0x41')](handleError(_0x14826f,null));};exports[_0x9899('0x44')]=function(_0x5ab575,_0xa70afa){return db[_0x9899('0x2c')][_0x9899('0x44')](_0x5ab575[_0x9899('0x45')],{})['then'](respondWithResult(_0xa70afa,0xc9))[_0x9899('0x41')](handleError(_0xa70afa,null));};exports[_0x9899('0x26')]=function(_0x4e4bd9,_0x4be886){if(_0x4e4bd9[_0x9899('0x45')]['id']){delete _0x4e4bd9['body']['id'];}return db[_0x9899('0x2c')][_0x9899('0x43')]({'where':{'id':_0x4e4bd9['params']['id']}})[_0x9899('0x27')](handleEntityNotFound(_0x4be886,null))[_0x9899('0x27')](saveUpdates(_0x4e4bd9['body'],null))[_0x9899('0x27')](respondWithResult(_0x4be886,null))['catch'](handleError(_0x4be886,null));};exports['destroy']=function(_0x170a60,_0x1abec5){return db[_0x9899('0x2c')][_0x9899('0x43')]({'where':{'id':_0x170a60['params']['id']}})[_0x9899('0x27')](handleEntityNotFound(_0x1abec5,null))['then'](removeEntity(_0x1abec5,null))['catch'](handleError(_0x1abec5,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 7b7c13d..9e853f6 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 _0x188b=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x188b,0x6c));var _0xb188=function(_0xaa75b0,_0x1a05e7){_0xaa75b0=_0xaa75b0-0x0;var _0x49dbe1=_0x188b[_0xaa75b0];return _0x49dbe1;};'use strict';var _=require(_0xb188('0x0'));var util=require(_0xb188('0x1'));var logger=require(_0xb188('0x2'))('api');var moment=require(_0xb188('0x3'));var BPromise=require(_0xb188('0x4'));var rp=require(_0xb188('0x5'));var fs=require('fs');var path=require(_0xb188('0x6'));var rimraf=require(_0xb188('0x7'));var config=require(_0xb188('0x8'));var attributes=require(_0xb188('0x9'));module['exports']=function(_0x4bc5a3,_0x4a654d){return _0x4bc5a3[_0xb188('0xa')](_0xb188('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25c8=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_trees','util'];(function(_0x1de4d3,_0x4809a5){var _0x41b51e=function(_0x3f7702){while(--_0x3f7702){_0x1de4d3['push'](_0x1de4d3['shift']());}};_0x41b51e(++_0x4809a5);}(_0x25c8,0xb3));var _0x825c=function(_0x37abba,_0x490d40){_0x37abba=_0x37abba-0x0;var _0x459ef6=_0x25c8[_0x37abba];return _0x459ef6;};'use strict';var _=require('lodash');var util=require(_0x825c('0x0'));var logger=require(_0x825c('0x1'))('api');var moment=require(_0x825c('0x2'));var BPromise=require(_0x825c('0x3'));var rp=require(_0x825c('0x4'));var fs=require('fs');var path=require(_0x825c('0x5'));var rimraf=require(_0x825c('0x6'));var config=require(_0x825c('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x2e515c,_0x479b70){return _0x2e515c[_0x825c('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0x825c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index ffba945..4893ff4 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 _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(_0x4094d9,_0x16234a){var _0x133fdb=function(_0x234f9a){while(--_0x234f9a){_0x4094d9['push'](_0x4094d9['shift']());}};_0x133fdb(++_0x16234a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ecf10,_0x1f6ea7){_0x4ecf10=_0x4ecf10-0x0;var _0x2e737b=_0x5f2f[_0x4ecf10];return _0x2e737b;};'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 +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(_0x26e9e8,_0x4b18bb){var _0x570436=function(_0x163a8c){while(--_0x163a8c){_0x26e9e8['push'](_0x26e9e8['shift']());}};_0x570436(++_0x4b18bb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x20a48e,_0x19c088){_0x20a48e=_0x20a48e-0x0;var _0x4b0c22=_0x5f2f[_0x20a48e];return _0x4b0c22;};'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 add37e9..2d5ff59 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 _0x23fd=['exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','create','put','/:id','delete','destroy'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x23fd,0x131));var _0xd23f=function(_0x579a16,_0x27986b){_0x579a16=_0x579a16-0x0;var _0x489de6=_0x23fd[_0x579a16];return _0x489de6;};'use strict';var multer=require(_0xd23f('0x0'));var util=require(_0xd23f('0x1'));var path=require('path');var timeout=require(_0xd23f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd23f('0x3'));var interaction=require(_0xd23f('0x4'));var config=require(_0xd23f('0x5'));var controller=require('./analyticTreeReport.controller');router[_0xd23f('0x6')]('/',auth['isAuthenticated'](),controller[_0xd23f('0x7')]);router[_0xd23f('0x6')]('/:id',auth[_0xd23f('0x8')](),controller['show']);router[_0xd23f('0x9')]('/',auth[_0xd23f('0x8')](),controller[_0xd23f('0xa')]);router[_0xd23f('0xb')](_0xd23f('0xc'),auth[_0xd23f('0x8')](),controller['update']);router[_0xd23f('0xd')](_0xd23f('0xc'),auth[_0xd23f('0x8')](),controller[_0xd23f('0xe')]);module[_0xd23f('0xf')]=router; \ No newline at end of file +var _0x1c60=['post','create','put','update','delete','destroy','exports','util','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x4d76cf,_0x37d73e){var _0x5d10fb=function(_0x439b5c){while(--_0x439b5c){_0x4d76cf['push'](_0x4d76cf['shift']());}};_0x5d10fb(++_0x37d73e);}(_0x1c60,0xbb));var _0x01c6=function(_0x567f0e,_0x2be7a0){_0x567f0e=_0x567f0e-0x0;var _0x15aca8=_0x1c60[_0x567f0e];return _0x15aca8;};'use strict';var multer=require('multer');var util=require(_0x01c6('0x0'));var path=require('path');var timeout=require(_0x01c6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x01c6('0x2'));var config=require(_0x01c6('0x3'));var controller=require('./analyticTreeReport.controller');router[_0x01c6('0x4')]('/',auth[_0x01c6('0x5')](),controller['index']);router[_0x01c6('0x4')](_0x01c6('0x6'),auth[_0x01c6('0x5')](),controller[_0x01c6('0x7')]);router[_0x01c6('0x8')]('/',auth[_0x01c6('0x5')](),controller[_0x01c6('0x9')]);router[_0x01c6('0xa')](_0x01c6('0x6'),auth[_0x01c6('0x5')](),controller[_0x01c6('0xb')]);router[_0x01c6('0xc')](_0x01c6('0x6'),auth[_0x01c6('0x5')](),controller[_0x01c6('0xd')]);module[_0x01c6('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b9cbc75..e2fa122 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 _0xc831=['STRING','exports'];(function(_0xcc1875,_0xa0f98d){var _0x113da2=function(_0x229505){while(--_0x229505){_0xcc1875['push'](_0xcc1875['shift']());}};_0x113da2(++_0xa0f98d);}(_0xc831,0x103));var _0x1c83=function(_0x467aa9,_0x24b963){_0x467aa9=_0x467aa9-0x0;var _0x5d9e92=_0xc831[_0x467aa9];return _0x5d9e92;};'use strict';var Sequelize=require('sequelize');module[_0x1c83('0x0')]={'name':{'type':Sequelize[_0x1c83('0x1')]},'basename':{'type':Sequelize[_0x1c83('0x1')]},'type':{'type':Sequelize[_0x1c83('0x1')]}}; \ No newline at end of file +var _0x34e7=['exports','STRING','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x34e7,0x164));var _0x734e=function(_0x44044a,_0x3a0097){_0x44044a=_0x44044a-0x0;var _0x43bb6e=_0x34e7[_0x44044a];return _0x43bb6e;};'use strict';var Sequelize=require(_0x734e('0x0'));module[_0x734e('0x1')]={'name':{'type':Sequelize[_0x734e('0x2')]},'basename':{'type':Sequelize[_0x734e('0x2')]},'type':{'type':Sequelize[_0x734e('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index aa580f6..d75e578 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 _0xd464=['omit','create','catch','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','name','send','index','Attachment','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','find','clone','rawAttributes','options','get','createdAt','updatedAt','body'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xd464,0x6f));var _0x4d46=function(_0x532138,_0x3b38ad){_0x532138=_0x532138-0x0;var _0x3555dd=_0xd464[_0x532138];return _0x3555dd;};'use strict';var emlformat=require(_0x4d46('0x0'));var rimraf=require(_0x4d46('0x1'));var zipdir=require(_0x4d46('0x2'));var jsonpatch=require(_0x4d46('0x3'));var rp=require(_0x4d46('0x4'));var moment=require(_0x4d46('0x5'));var BPromise=require(_0x4d46('0x6'));var Mustache=require(_0x4d46('0x7'));var util=require(_0x4d46('0x8'));var path=require(_0x4d46('0x9'));var sox=require(_0x4d46('0xa'));var csv=require(_0x4d46('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d46('0xc'));var _=require(_0x4d46('0xd'));var squel=require(_0x4d46('0xe'));var crypto=require(_0x4d46('0xf'));var jsforce=require(_0x4d46('0x10'));var deskjs=require(_0x4d46('0x11'));var toCsv=require(_0x4d46('0xb'));var querystring=require(_0x4d46('0x12'));var Papa=require(_0x4d46('0x13'));var Redis=require(_0x4d46('0x14'));var authService=require(_0x4d46('0x15'));var qs=require(_0x4d46('0x16'));var as=require(_0x4d46('0x17'));var hardwareService=require(_0x4d46('0x18'));var logger=require(_0x4d46('0x19'))(_0x4d46('0x1a'));var utils=require(_0x4d46('0x1b'));var config=require(_0x4d46('0x1c'));var licenseUtil=require(_0x4d46('0x1d'));var db=require(_0x4d46('0x1e'))['db'];function respondWithStatusCode(_0x4554e7,_0x271a43){_0x271a43=_0x271a43||0xcc;return function(_0x296e1d){if(_0x296e1d){return _0x4554e7[_0x4d46('0x1f')](_0x271a43);}return _0x4554e7[_0x4d46('0x20')](_0x271a43)[_0x4d46('0x21')]();};}function respondWithResult(_0x50c721,_0x5e4dde){_0x5e4dde=_0x5e4dde||0xc8;return function(_0x2c1a76){if(_0x2c1a76){return _0x50c721[_0x4d46('0x20')](_0x5e4dde)['json'](_0x2c1a76);}};}function respondWithFilteredResult(_0xa92d12,_0xdeef26){return function(_0x49b984){if(_0x49b984){var _0x26ef10=typeof _0xdeef26[_0x4d46('0x22')]===_0x4d46('0x23')&&typeof _0xdeef26[_0x4d46('0x24')]===_0x4d46('0x23');var _0x4bc520=_0x49b984[_0x4d46('0x25')];var _0x2ef287=_0x26ef10?0x0:_0xdeef26[_0x4d46('0x22')];var _0x1848ed=_0x26ef10?_0x49b984['count']:_0xdeef26['offset']+_0xdeef26[_0x4d46('0x24')];var _0x19f334;if(_0x1848ed>=_0x4bc520){_0x1848ed=_0x4bc520;_0x19f334=0xc8;}else{_0x19f334=0xce;}_0xa92d12['status'](_0x19f334);return _0xa92d12[_0x4d46('0x26')](_0x4d46('0x27'),_0x2ef287+'-'+_0x1848ed+'/'+_0x4bc520)[_0x4d46('0x28')](_0x49b984);}return null;};}function patchUpdates(_0x240c89){return function(_0x273cf1){try{jsonpatch['apply'](_0x273cf1,_0x240c89,!![]);}catch(_0x3872f8){return BPromise[_0x4d46('0x29')](_0x3872f8);}return _0x273cf1[_0x4d46('0x2a')]();};}function saveUpdates(_0x80d584,_0x26ad63){return function(_0x172fce){if(_0x172fce){return _0x172fce['update'](_0x80d584)[_0x4d46('0x2b')](function(_0x5ed26c){return _0x5ed26c;});}return null;};}function removeEntity(_0x37bd9a,_0x55b368){return function(_0x3dce22){if(_0x3dce22){return _0x3dce22[_0x4d46('0x2c')]()[_0x4d46('0x2b')](function(){_0x37bd9a[_0x4d46('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27d3b4,_0x1ac0b8){return function(_0x54cff0){if(!_0x54cff0){_0x27d3b4[_0x4d46('0x1f')](0x194);}return _0x54cff0;};}function handleError(_0x20adf2,_0x3f016f){_0x3f016f=_0x3f016f||0x1f4;return function(_0xca9e0e){logger[_0x4d46('0x2d')](_0xca9e0e['stack']);if(_0xca9e0e[_0x4d46('0x2e')]){delete _0xca9e0e['name'];}_0x20adf2[_0x4d46('0x20')](_0x3f016f)[_0x4d46('0x2f')](_0xca9e0e);};}exports[_0x4d46('0x30')]=function(_0x4dc870,_0x54af5d){var _0x5040f1={},_0x17384c={},_0x1150d6={'count':0x0,'rows':[]};var _0x257ce1=_['map'](db[_0x4d46('0x31')]['rawAttributes'],function(_0x1c15ad){return{'name':_0x1c15ad['fieldName'],'type':_0x1c15ad[_0x4d46('0x32')][_0x4d46('0x33')]};});_0x17384c[_0x4d46('0x34')]=_[_0x4d46('0x35')](_0x257ce1,_0x4d46('0x2e'));_0x17384c[_0x4d46('0x36')]=_[_0x4d46('0x37')](_0x4dc870[_0x4d46('0x36')]);_0x17384c['filters']=_[_0x4d46('0x38')](_0x17384c['model'],_0x17384c[_0x4d46('0x36')]);_0x5040f1[_0x4d46('0x39')]=_[_0x4d46('0x38')](_0x17384c[_0x4d46('0x34')],qs[_0x4d46('0x3a')](_0x4dc870['query'][_0x4d46('0x3a')]));_0x5040f1['attributes']=_0x5040f1[_0x4d46('0x39')][_0x4d46('0x3b')]?_0x5040f1[_0x4d46('0x39')]:_0x17384c[_0x4d46('0x34')];if(!_0x4dc870[_0x4d46('0x36')][_0x4d46('0x3c')](_0x4d46('0x3d'))){_0x5040f1[_0x4d46('0x24')]=qs[_0x4d46('0x24')](_0x4dc870[_0x4d46('0x36')][_0x4d46('0x24')]);_0x5040f1[_0x4d46('0x22')]=qs[_0x4d46('0x22')](_0x4dc870[_0x4d46('0x36')][_0x4d46('0x22')]);}_0x5040f1['order']=qs[_0x4d46('0x3e')](_0x4dc870[_0x4d46('0x36')][_0x4d46('0x3e')]);_0x5040f1['where']=qs[_0x4d46('0x3f')](_[_0x4d46('0x40')](_0x4dc870['query'],_0x17384c[_0x4d46('0x3f')]),_0x257ce1);if(_0x4dc870['query'][_0x4d46('0x41')]){_0x5040f1[_0x4d46('0x42')]=_['merge'](_0x5040f1['where'],{'$or':_[_0x4d46('0x35')](_0x257ce1,function(_0x535b06){if(_0x535b06[_0x4d46('0x32')]!==_0x4d46('0x43')){var _0x48203b={};_0x48203b[_0x535b06[_0x4d46('0x2e')]]={'$like':'%'+_0x4dc870['query'][_0x4d46('0x41')]+'%'};return _0x48203b;}})});}_0x5040f1=_[_0x4d46('0x44')]({},_0x5040f1,_0x4dc870['options']);var _0x5355e8={'where':_0x5040f1[_0x4d46('0x42')]};return db[_0x4d46('0x31')][_0x4d46('0x25')](_0x5355e8)[_0x4d46('0x2b')](function(_0x7c5341){_0x1150d6[_0x4d46('0x25')]=_0x7c5341;if(_0x4dc870[_0x4d46('0x36')][_0x4d46('0x45')]){_0x5040f1[_0x4d46('0x46')]=[{'all':!![]}];}return db[_0x4d46('0x31')][_0x4d46('0x47')](_0x5040f1);})[_0x4d46('0x2b')](function(_0x5237c6){_0x1150d6[_0x4d46('0x48')]=_0x5237c6;return _0x1150d6;})[_0x4d46('0x2b')](respondWithFilteredResult(_0x54af5d,_0x5040f1))['catch'](handleError(_0x54af5d,null));};exports[_0x4d46('0x49')]=function(_0x59bfe7,_0x4493a6){var _0x244278={'raw':!![],'where':{'id':_0x59bfe7[_0x4d46('0x4a')]['id']}},_0xcf199={};_0xcf199[_0x4d46('0x34')]=_[_0x4d46('0x37')](db[_0x4d46('0x31')]['rawAttributes']);_0xcf199['query']=_[_0x4d46('0x37')](_0x59bfe7[_0x4d46('0x36')]);_0xcf199[_0x4d46('0x3f')]=_['intersection'](_0xcf199[_0x4d46('0x34')],_0xcf199[_0x4d46('0x36')]);_0x244278['attributes']=_[_0x4d46('0x38')](_0xcf199[_0x4d46('0x34')],qs[_0x4d46('0x3a')](_0x59bfe7[_0x4d46('0x36')][_0x4d46('0x3a')]));_0x244278[_0x4d46('0x39')]=_0x244278[_0x4d46('0x39')][_0x4d46('0x3b')]?_0x244278[_0x4d46('0x39')]:_0xcf199[_0x4d46('0x34')];if(_0x59bfe7['query']['includeAll']){_0x244278['include']=[{'all':!![]}];}_0x244278=_[_0x4d46('0x44')]({},_0x244278,_0x59bfe7['options']);return db[_0x4d46('0x31')][_0x4d46('0x4b')](_0x244278)[_0x4d46('0x2b')](handleEntityNotFound(_0x4493a6,null))[_0x4d46('0x2b')](respondWithResult(_0x4493a6,null))['catch'](handleError(_0x4493a6,null));};exports[_0x4d46('0x4c')]=function(_0x21b43a,_0x3f471e){var _0x32fb79={'where':{'id':_0x21b43a[_0x4d46('0x4a')]['id']}},_0x144f00={};_0x144f00[_0x4d46('0x34')]=_[_0x4d46('0x37')](db[_0x4d46('0x31')][_0x4d46('0x4d')]);_0x32fb79[_0x4d46('0x39')]=_['intersection'](_0x144f00['model'],qs['fields'](_0x21b43a[_0x4d46('0x36')][_0x4d46('0x3a')]));_0x32fb79[_0x4d46('0x39')]=_0x32fb79['attributes'][_0x4d46('0x3b')]?_0x32fb79[_0x4d46('0x39')]:_0x144f00[_0x4d46('0x34')];if(_0x21b43a[_0x4d46('0x36')][_0x4d46('0x45')]){_0x32fb79['include']=[{'all':!![]}];}_0x32fb79=_[_0x4d46('0x44')]({},_0x32fb79,_0x21b43a[_0x4d46('0x4e')]);return db['Attachment'][_0x4d46('0x4b')](_0x32fb79)[_0x4d46('0x2b')](handleEntityNotFound(_0x3f471e,null))[_0x4d46('0x2b')](function(_0xce49e2){if(_0xce49e2){var _0x45080e=_0xce49e2[_0x4d46('0x4f')]({'plain':!![]});_0x45080e=qs['omit'](_0x45080e,['id',_0x4d46('0x50'),_0x4d46('0x51')]);_0x21b43a[_0x4d46('0x52')]=_[_0x4d46('0x53')](_0x21b43a[_0x4d46('0x52')],['id','createdAt','updatedAt']);return db[_0x4d46('0x31')][_0x4d46('0x54')](_['merge'](_0x45080e,_0x21b43a['body']),{'include':_0x21b43a[_0x4d46('0x36')][_0x4d46('0x45')]?[{'all':!![]}]:undefined});}})[_0x4d46('0x2b')](respondWithResult(_0x3f471e,0xc9))[_0x4d46('0x55')](handleError(_0x3f471e,null));};exports['update']=function(_0x568b32,_0xb7c2ec){if(_0x568b32[_0x4d46('0x52')]['id']){delete _0x568b32[_0x4d46('0x52')]['id'];}return db[_0x4d46('0x31')][_0x4d46('0x4b')]({'where':{'id':_0x568b32[_0x4d46('0x4a')]['id']}})[_0x4d46('0x2b')](handleEntityNotFound(_0xb7c2ec,null))['then'](saveUpdates(_0x568b32[_0x4d46('0x52')],null))[_0x4d46('0x2b')](respondWithResult(_0xb7c2ec,null))['catch'](handleError(_0xb7c2ec,null));};exports[_0x4d46('0x2c')]=function(_0x3f1a0d,_0x10d345){return db[_0x4d46('0x31')][_0x4d46('0x4b')]({'where':{'id':_0x3f1a0d[_0x4d46('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10d345,null))[_0x4d46('0x2b')](removeEntity(_0x10d345,null))[_0x4d46('0x55')](handleError(_0x10d345,null));};exports['create']=function(_0x811dbf,_0x1d4072,_0x188c52){_0x811dbf[_0x4d46('0x52')][_0x4d46('0x2e')]=_0x811dbf[_0x4d46('0x56')][_0x4d46('0x57')];_0x811dbf[_0x4d46('0x52')]['basename']=_0x811dbf[_0x4d46('0x56')][_0x4d46('0x58')];_0x811dbf[_0x4d46('0x52')][_0x4d46('0x32')]=_0x811dbf['file'][_0x4d46('0x59')];return db['Attachment']['create'](_0x811dbf[_0x4d46('0x52')])[_0x4d46('0x2b')](respondWithResult(_0x1d4072,0xc9))[_0x4d46('0x55')](handleError(_0x1d4072,null));};exports[_0x4d46('0x5a')]=function(_0x1e2ec2,_0x3815ab,_0x5c1869){return db[_0x4d46('0x31')][_0x4d46('0x5b')]({'where':{'id':_0x1e2ec2['params']['id']},'raw':!![]})[_0x4d46('0x2b')](handleEntityNotFound(_0x3815ab,null))['then'](function(_0x5796c9){if(_0x5796c9){var _0x5b35e4=_0x5796c9[_0x4d46('0x5c')]!==null;var _0x19f887=path['join'](config[_0x4d46('0x5d')],_0x4d46('0x5e'));if(_0x5b35e4){_0x19f887=path[_0x4d46('0x5f')](_0x19f887,'offline-chat/');}var _0x2ed711=path[_0x4d46('0x5f')](_0x19f887,_0x5796c9[_0x4d46('0x60')]);return _0x3815ab[_0x4d46('0x5a')](_0x2ed711);}})[_0x4d46('0x55')](handleError(_0x3815ab,null));}; \ No newline at end of file +var _0xbd43=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','show','params','rawAttributes','find','catch','clone','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd43,0xf6));var _0x3bd4=function(_0x53762a,_0x25997a){_0x53762a=_0x53762a-0x0;var _0x469e93=_0xbd43[_0x53762a];return _0x469e93;};'use strict';var emlformat=require(_0x3bd4('0x0'));var rimraf=require(_0x3bd4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bd4('0x2'));var rp=require(_0x3bd4('0x3'));var moment=require(_0x3bd4('0x4'));var BPromise=require(_0x3bd4('0x5'));var Mustache=require(_0x3bd4('0x6'));var util=require(_0x3bd4('0x7'));var path=require(_0x3bd4('0x8'));var sox=require('sox');var csv=require(_0x3bd4('0x9'));var ejs=require(_0x3bd4('0xa'));var fs=require('fs');var fs_extra=require(_0x3bd4('0xb'));var _=require(_0x3bd4('0xc'));var squel=require('squel');var crypto=require(_0x3bd4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3bd4('0x9'));var querystring=require(_0x3bd4('0xe'));var Papa=require(_0x3bd4('0xf'));var Redis=require(_0x3bd4('0x10'));var authService=require(_0x3bd4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3bd4('0x12'));var hardwareService=require(_0x3bd4('0x13'));var logger=require('../../config/logger')(_0x3bd4('0x14'));var utils=require(_0x3bd4('0x15'));var config=require(_0x3bd4('0x16'));var licenseUtil=require(_0x3bd4('0x17'));var db=require(_0x3bd4('0x18'))['db'];function respondWithStatusCode(_0x1a6a92,_0x478b42){_0x478b42=_0x478b42||0xcc;return function(_0x1ea089){if(_0x1ea089){return _0x1a6a92['sendStatus'](_0x478b42);}return _0x1a6a92[_0x3bd4('0x19')](_0x478b42)[_0x3bd4('0x1a')]();};}function respondWithResult(_0x427123,_0x52a0d0){_0x52a0d0=_0x52a0d0||0xc8;return function(_0x42781f){if(_0x42781f){return _0x427123[_0x3bd4('0x19')](_0x52a0d0)['json'](_0x42781f);}};}function respondWithFilteredResult(_0x526f98,_0x5ed5f3){return function(_0xf580c5){if(_0xf580c5){var _0x2a7ff4=typeof _0x5ed5f3['offset']===_0x3bd4('0x1b')&&typeof _0x5ed5f3[_0x3bd4('0x1c')]===_0x3bd4('0x1b');var _0x4b64ee=_0xf580c5[_0x3bd4('0x1d')];var _0x3c9e82=_0x2a7ff4?0x0:_0x5ed5f3[_0x3bd4('0x1e')];var _0x5a09ee=_0x2a7ff4?_0xf580c5[_0x3bd4('0x1d')]:_0x5ed5f3[_0x3bd4('0x1e')]+_0x5ed5f3[_0x3bd4('0x1c')];var _0x41f2e6;if(_0x5a09ee>=_0x4b64ee){_0x5a09ee=_0x4b64ee;_0x41f2e6=0xc8;}else{_0x41f2e6=0xce;}_0x526f98[_0x3bd4('0x19')](_0x41f2e6);return _0x526f98['set'](_0x3bd4('0x1f'),_0x3c9e82+'-'+_0x5a09ee+'/'+_0x4b64ee)[_0x3bd4('0x20')](_0xf580c5);}return null;};}function patchUpdates(_0x51de64){return function(_0x1939e4){try{jsonpatch[_0x3bd4('0x21')](_0x1939e4,_0x51de64,!![]);}catch(_0x2b4737){return BPromise[_0x3bd4('0x22')](_0x2b4737);}return _0x1939e4[_0x3bd4('0x23')]();};}function saveUpdates(_0x394b23,_0x5f5bc1){return function(_0x4c0e4d){if(_0x4c0e4d){return _0x4c0e4d[_0x3bd4('0x24')](_0x394b23)[_0x3bd4('0x25')](function(_0x4919ec){return _0x4919ec;});}return null;};}function removeEntity(_0x5534c5,_0x3c9b36){return function(_0x47d577){if(_0x47d577){return _0x47d577[_0x3bd4('0x26')]()[_0x3bd4('0x25')](function(){_0x5534c5[_0x3bd4('0x19')](0xcc)[_0x3bd4('0x1a')]();});}};}function handleEntityNotFound(_0x2f8626,_0x10f99a){return function(_0x226aba){if(!_0x226aba){_0x2f8626['sendStatus'](0x194);}return _0x226aba;};}function handleError(_0x53d20f,_0x214235){_0x214235=_0x214235||0x1f4;return function(_0xfcd693){logger[_0x3bd4('0x27')](_0xfcd693[_0x3bd4('0x28')]);if(_0xfcd693[_0x3bd4('0x29')]){delete _0xfcd693[_0x3bd4('0x29')];}_0x53d20f[_0x3bd4('0x19')](_0x214235)['send'](_0xfcd693);};}exports[_0x3bd4('0x2a')]=function(_0x3fbabc,_0x42c4e4){var _0x9f588f={},_0x1fc588={},_0x3dd6dc={'count':0x0,'rows':[]};var _0x53d9b5=_[_0x3bd4('0x2b')](db['Attachment']['rawAttributes'],function(_0x1de80c){return{'name':_0x1de80c['fieldName'],'type':_0x1de80c[_0x3bd4('0x2c')]['key']};});_0x1fc588[_0x3bd4('0x2d')]=_[_0x3bd4('0x2b')](_0x53d9b5,_0x3bd4('0x29'));_0x1fc588['query']=_[_0x3bd4('0x2e')](_0x3fbabc[_0x3bd4('0x2f')]);_0x1fc588[_0x3bd4('0x30')]=_[_0x3bd4('0x31')](_0x1fc588['model'],_0x1fc588[_0x3bd4('0x2f')]);_0x9f588f[_0x3bd4('0x32')]=_['intersection'](_0x1fc588[_0x3bd4('0x2d')],qs[_0x3bd4('0x33')](_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x33')]));_0x9f588f[_0x3bd4('0x32')]=_0x9f588f[_0x3bd4('0x32')][_0x3bd4('0x34')]?_0x9f588f[_0x3bd4('0x32')]:_0x1fc588['model'];if(!_0x3fbabc[_0x3bd4('0x2f')]['hasOwnProperty'](_0x3bd4('0x35'))){_0x9f588f['limit']=qs[_0x3bd4('0x1c')](_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x1c')]);_0x9f588f['offset']=qs[_0x3bd4('0x1e')](_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x1e')]);}_0x9f588f['order']=qs[_0x3bd4('0x36')](_0x3fbabc[_0x3bd4('0x2f')]['sort']);_0x9f588f[_0x3bd4('0x37')]=qs['filters'](_['pick'](_0x3fbabc['query'],_0x1fc588[_0x3bd4('0x30')]),_0x53d9b5);if(_0x3fbabc['query'][_0x3bd4('0x38')]){_0x9f588f[_0x3bd4('0x37')]=_[_0x3bd4('0x39')](_0x9f588f[_0x3bd4('0x37')],{'$or':_[_0x3bd4('0x2b')](_0x53d9b5,function(_0x8ea638){if(_0x8ea638[_0x3bd4('0x2c')]!==_0x3bd4('0x3a')){var _0x1b9d22={};_0x1b9d22[_0x8ea638[_0x3bd4('0x29')]]={'$like':'%'+_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x38')]+'%'};return _0x1b9d22;}})});}_0x9f588f=_[_0x3bd4('0x39')]({},_0x9f588f,_0x3fbabc[_0x3bd4('0x3b')]);var _0x1585d3={'where':_0x9f588f[_0x3bd4('0x37')]};return db[_0x3bd4('0x3c')][_0x3bd4('0x1d')](_0x1585d3)[_0x3bd4('0x25')](function(_0xfdaa18){_0x3dd6dc[_0x3bd4('0x1d')]=_0xfdaa18;if(_0x3fbabc['query'][_0x3bd4('0x3d')]){_0x9f588f[_0x3bd4('0x3e')]=[{'all':!![]}];}return db[_0x3bd4('0x3c')][_0x3bd4('0x3f')](_0x9f588f);})[_0x3bd4('0x25')](function(_0x402f20){_0x3dd6dc['rows']=_0x402f20;return _0x3dd6dc;})[_0x3bd4('0x25')](respondWithFilteredResult(_0x42c4e4,_0x9f588f))['catch'](handleError(_0x42c4e4,null));};exports[_0x3bd4('0x40')]=function(_0x417136,_0x544692){var _0x35de9a={'raw':!![],'where':{'id':_0x417136[_0x3bd4('0x41')]['id']}},_0x36d80b={};_0x36d80b['model']=_['keys'](db[_0x3bd4('0x3c')][_0x3bd4('0x42')]);_0x36d80b[_0x3bd4('0x2f')]=_[_0x3bd4('0x2e')](_0x417136[_0x3bd4('0x2f')]);_0x36d80b[_0x3bd4('0x30')]=_[_0x3bd4('0x31')](_0x36d80b[_0x3bd4('0x2d')],_0x36d80b[_0x3bd4('0x2f')]);_0x35de9a[_0x3bd4('0x32')]=_['intersection'](_0x36d80b[_0x3bd4('0x2d')],qs['fields'](_0x417136[_0x3bd4('0x2f')]['fields']));_0x35de9a[_0x3bd4('0x32')]=_0x35de9a[_0x3bd4('0x32')]['length']?_0x35de9a[_0x3bd4('0x32')]:_0x36d80b[_0x3bd4('0x2d')];if(_0x417136[_0x3bd4('0x2f')]['includeAll']){_0x35de9a[_0x3bd4('0x3e')]=[{'all':!![]}];}_0x35de9a=_[_0x3bd4('0x39')]({},_0x35de9a,_0x417136[_0x3bd4('0x3b')]);return db[_0x3bd4('0x3c')][_0x3bd4('0x43')](_0x35de9a)[_0x3bd4('0x25')](handleEntityNotFound(_0x544692,null))[_0x3bd4('0x25')](respondWithResult(_0x544692,null))[_0x3bd4('0x44')](handleError(_0x544692,null));};exports[_0x3bd4('0x45')]=function(_0x4932db,_0x124fd9){var _0x367790={'where':{'id':_0x4932db['params']['id']}},_0x38bb6e={};_0x38bb6e[_0x3bd4('0x2d')]=_['keys'](db[_0x3bd4('0x3c')][_0x3bd4('0x42')]);_0x367790[_0x3bd4('0x32')]=_[_0x3bd4('0x31')](_0x38bb6e[_0x3bd4('0x2d')],qs[_0x3bd4('0x33')](_0x4932db[_0x3bd4('0x2f')][_0x3bd4('0x33')]));_0x367790[_0x3bd4('0x32')]=_0x367790[_0x3bd4('0x32')][_0x3bd4('0x34')]?_0x367790[_0x3bd4('0x32')]:_0x38bb6e[_0x3bd4('0x2d')];if(_0x4932db[_0x3bd4('0x2f')][_0x3bd4('0x3d')]){_0x367790[_0x3bd4('0x3e')]=[{'all':!![]}];}_0x367790=_[_0x3bd4('0x39')]({},_0x367790,_0x4932db['options']);return db[_0x3bd4('0x3c')]['find'](_0x367790)[_0x3bd4('0x25')](handleEntityNotFound(_0x124fd9,null))[_0x3bd4('0x25')](function(_0x50579c){if(_0x50579c){var _0x5c8c31=_0x50579c['get']({'plain':!![]});_0x5c8c31=qs[_0x3bd4('0x46')](_0x5c8c31,['id',_0x3bd4('0x47'),_0x3bd4('0x48')]);_0x4932db[_0x3bd4('0x49')]=_[_0x3bd4('0x46')](_0x4932db[_0x3bd4('0x49')],['id',_0x3bd4('0x47'),_0x3bd4('0x48')]);return db[_0x3bd4('0x3c')][_0x3bd4('0x4a')](_[_0x3bd4('0x39')](_0x5c8c31,_0x4932db[_0x3bd4('0x49')]),{'include':_0x4932db[_0x3bd4('0x2f')][_0x3bd4('0x3d')]?[{'all':!![]}]:undefined});}})[_0x3bd4('0x25')](respondWithResult(_0x124fd9,0xc9))[_0x3bd4('0x44')](handleError(_0x124fd9,null));};exports[_0x3bd4('0x24')]=function(_0x4e4d57,_0x11bede){if(_0x4e4d57[_0x3bd4('0x49')]['id']){delete _0x4e4d57['body']['id'];}return db[_0x3bd4('0x3c')][_0x3bd4('0x43')]({'where':{'id':_0x4e4d57[_0x3bd4('0x41')]['id']}})[_0x3bd4('0x25')](handleEntityNotFound(_0x11bede,null))[_0x3bd4('0x25')](saveUpdates(_0x4e4d57[_0x3bd4('0x49')],null))[_0x3bd4('0x25')](respondWithResult(_0x11bede,null))[_0x3bd4('0x44')](handleError(_0x11bede,null));};exports[_0x3bd4('0x26')]=function(_0x227c3f,_0x3dbc04){return db[_0x3bd4('0x3c')]['find']({'where':{'id':_0x227c3f[_0x3bd4('0x41')]['id']}})['then'](handleEntityNotFound(_0x3dbc04,null))['then'](removeEntity(_0x3dbc04,null))[_0x3bd4('0x44')](handleError(_0x3dbc04,null));};exports[_0x3bd4('0x4a')]=function(_0x3f7cdf,_0x1f32b8,_0xbf7150){_0x3f7cdf[_0x3bd4('0x49')][_0x3bd4('0x29')]=_0x3f7cdf['file'][_0x3bd4('0x4b')];_0x3f7cdf[_0x3bd4('0x49')][_0x3bd4('0x4c')]=_0x3f7cdf[_0x3bd4('0x4d')][_0x3bd4('0x4e')];_0x3f7cdf[_0x3bd4('0x49')][_0x3bd4('0x2c')]=_0x3f7cdf['file'][_0x3bd4('0x4f')];return db[_0x3bd4('0x3c')]['create'](_0x3f7cdf[_0x3bd4('0x49')])[_0x3bd4('0x25')](respondWithResult(_0x1f32b8,0xc9))['catch'](handleError(_0x1f32b8,null));};exports[_0x3bd4('0x50')]=function(_0x4f7530,_0x37dc30,_0x21b666){return db[_0x3bd4('0x3c')][_0x3bd4('0x51')]({'where':{'id':_0x4f7530[_0x3bd4('0x41')]['id']},'raw':!![]})[_0x3bd4('0x25')](handleEntityNotFound(_0x37dc30,null))[_0x3bd4('0x25')](function(_0x3ead43){if(_0x3ead43){var _0x336bc5=_0x3ead43[_0x3bd4('0x52')]!==null;var _0x4e80ed=path[_0x3bd4('0x53')](config[_0x3bd4('0x54')],_0x3bd4('0x55'));if(_0x336bc5){_0x4e80ed=path['join'](_0x4e80ed,_0x3bd4('0x56'));}var _0xcd8d1a=path[_0x3bd4('0x53')](_0x4e80ed,_0x3ead43[_0x3bd4('0x4c')]);return _0x37dc30[_0x3bd4('0x50')](_0xcd8d1a);}})[_0x3bd4('0x44')](handleError(_0x37dc30,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6c3b5a1..3b6657b 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 _0xd954=['../../config/environment','exports','define','Attachment','attachments','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2a089b,_0x5d0db9){var _0x40cd66=function(_0x24f349){while(--_0x24f349){_0x2a089b['push'](_0x2a089b['shift']());}};_0x40cd66(++_0x5d0db9);}(_0xd954,0xe1));var _0x4d95=function(_0x26d51f,_0x1de895){_0x26d51f=_0x26d51f-0x0;var _0x48305d=_0xd954[_0x26d51f];return _0x48305d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4d95('0x0'))(_0x4d95('0x1'));var moment=require(_0x4d95('0x2'));var BPromise=require(_0x4d95('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d95('0x4'));var rimraf=require(_0x4d95('0x5'));var config=require(_0x4d95('0x6'));var attributes=require('./attachment.attributes');module[_0x4d95('0x7')]=function(_0x5c25ad,_0x542544){return _0x5c25ad[_0x4d95('0x8')](_0x4d95('0x9'),attributes,{'tableName':_0x4d95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec33=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0xa48710,_0x4e8107){var _0x271041=function(_0x2bac29){while(--_0x2bac29){_0xa48710['push'](_0xa48710['shift']());}};_0x271041(++_0x4e8107);}(_0xec33,0x152));var _0x3ec3=function(_0x28cc40,_0x54f517){_0x28cc40=_0x28cc40-0x0;var _0x4e10c1=_0xec33[_0x28cc40];return _0x4e10c1;};'use strict';var _=require(_0x3ec3('0x0'));var util=require(_0x3ec3('0x1'));var logger=require(_0x3ec3('0x2'))('api');var moment=require(_0x3ec3('0x3'));var BPromise=require(_0x3ec3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ec3('0x5'));var rimraf=require(_0x3ec3('0x6'));var config=require(_0x3ec3('0x7'));var attributes=require(_0x3ec3('0x8'));module['exports']=function(_0x2ee4be,_0x22f0e5){return _0x2ee4be[_0x3ec3('0x9')](_0x3ec3('0xa'),attributes,{'tableName':_0x3ec3('0xb'),'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 05c2ee5..523ed5d 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 _0x03ce=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Attachment','create','body','raw','CreateAttachment','lodash','util','moment'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x03ce,0x1a1));var _0xe03c=function(_0xa4bc34,_0x4b8774){_0xa4bc34=_0xa4bc34-0x0;var _0xea4df9=_0x03ce[_0xa4bc34];return _0xea4df9;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var moment=require(_0xe03c('0x2'));var BPromise=require(_0xe03c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe03c('0x4'));var db=require(_0xe03c('0x5'))['db'];var utils=require(_0xe03c('0x6'));var logger=require('../../config/logger')(_0xe03c('0x7'));var config=require(_0xe03c('0x8'));var jayson=require(_0xe03c('0x9'));var client=jayson[_0xe03c('0xa')][_0xe03c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c54f,_0x89f039,_0x52dda4){return new BPromise(function(_0x53c2b0,_0x3bca56){return client[_0xe03c('0xc')](_0x44c54f,_0x52dda4)[_0xe03c('0xd')](function(_0x267044){logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,_0xe03c('0x10'));logger[_0xe03c('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x89f039,_0xe03c('0x10'),JSON[_0xe03c('0x12')](_0x267044));if(_0x267044[_0xe03c('0x13')]){if(_0x267044['error'][_0xe03c('0x14')]===0x1f4){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);return _0x3bca56(_0x267044['error'][_0xe03c('0x15')]);}logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044['error'][_0xe03c('0x15')]);return _0x53c2b0(_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);}else{logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,'request\x20sent');_0x53c2b0(_0x267044[_0xe03c('0x16')][_0xe03c('0x15')]);}})['catch'](function(_0x7160ac){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x7160ac);_0x3bca56(_0x7160ac);});});}exports['CreateAttachment']=function(_0x56ec58){var _0x23080a=this;return new Promise(function(_0x386cb7,_0x47da2a){return db[_0xe03c('0x17')][_0xe03c('0x18')](_0x56ec58[_0xe03c('0x19')],{'raw':_0x56ec58['options']?_0x56ec58['options'][_0xe03c('0x1a')]===undefined?!![]:![]:!![]})[_0xe03c('0xd')](function(_0x3bf505){logger[_0xe03c('0xe')](_0xe03c('0x1b'),_0x56ec58);logger[_0xe03c('0x11')](_0xe03c('0x1b'),_0x56ec58,JSON[_0xe03c('0x12')](_0x3bf505));_0x386cb7(_0x3bf505);})['catch'](function(_0x1cbf9f){logger['error'](_0xe03c('0x1b'),_0x1cbf9f[_0xe03c('0x15')],_0x56ec58);_0x47da2a(_0x23080a[_0xe03c('0x13')](0x1f4,_0x1cbf9f[_0xe03c('0x15')]));});});}; \ No newline at end of file +var _0x7af2=['message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error'];(function(_0x15c885,_0x1b4937){var _0x35949d=function(_0x13094f){while(--_0x13094f){_0x15c885['push'](_0x15c885['shift']());}};_0x35949d(++_0x1b4937);}(_0x7af2,0x119));var _0x27af=function(_0x3b1869,_0x2fa04b){_0x3b1869=_0x3b1869-0x0;var _0x433b45=_0x7af2[_0x3b1869];return _0x433b45;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var moment=require(_0x27af('0x1'));var BPromise=require(_0x27af('0x2'));var rs=require(_0x27af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27af('0x4'))['db'];var utils=require(_0x27af('0x5'));var logger=require(_0x27af('0x6'))(_0x27af('0x7'));var config=require(_0x27af('0x8'));var jayson=require(_0x27af('0x9'));var client=jayson[_0x27af('0xa')][_0x27af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2193c6,_0x572219,_0x1e2509){return new BPromise(function(_0x366868,_0x389e97){return client['request'](_0x2193c6,_0x1e2509)[_0x27af('0xc')](function(_0xfa1882){logger[_0x27af('0xd')]('Attachment,\x20%s,\x20%s',_0x572219,_0x27af('0xe'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x572219,_0x27af('0xe'),JSON['stringify'](_0xfa1882));if(_0xfa1882['error']){if(_0xfa1882[_0x27af('0xf')]['code']===0x1f4){logger[_0x27af('0xf')]('Attachment,\x20%s,\x20%s',_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x389e97(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}logger[_0x27af('0xf')](_0x27af('0x11'),_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x366868(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}else{logger[_0x27af('0xd')](_0x27af('0x11'),_0x572219,_0x27af('0xe'));_0x366868(_0xfa1882[_0x27af('0x12')][_0x27af('0x10')]);}})[_0x27af('0x13')](function(_0x13f8ed){logger[_0x27af('0xf')]('Attachment,\x20%s,\x20%s',_0x572219,_0x13f8ed);_0x389e97(_0x13f8ed);});});}exports[_0x27af('0x14')]=function(_0x31d702){var _0x5997ae=this;return new Promise(function(_0x4e6e2f,_0x20a6d7){return db[_0x27af('0x15')][_0x27af('0x16')](_0x31d702[_0x27af('0x17')],{'raw':_0x31d702[_0x27af('0x18')]?_0x31d702['options'][_0x27af('0x19')]===undefined?!![]:![]:!![]})[_0x27af('0xc')](function(_0xcb4b90){logger['info'](_0x27af('0x14'),_0x31d702);logger[_0x27af('0x1a')](_0x27af('0x14'),_0x31d702,JSON['stringify'](_0xcb4b90));_0x4e6e2f(_0xcb4b90);})[_0x27af('0x13')](function(_0x2460f4){logger[_0x27af('0xf')](_0x27af('0x14'),_0x2460f4[_0x27af('0x10')],_0x31d702);_0x20a6d7(_0x5997ae[_0x27af('0xf')](0x1f4,_0x2460f4[_0x27af('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 57dbc0a..b445486 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x3829de,_0x20365e){_0x3829de=_0x3829de-0x0;var _0x8cd041=_0xdb28[_0x3829de];return _0x8cd041;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index fcdf5a6..49383a6 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file +var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 6179c43..5fdb1ce 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2277=['express','post','login','exports'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0x2277,0x170));var _0x7227=function(_0x378825,_0x53fa0e){_0x378825=_0x378825-0x0;var _0x1f92dc=_0x2277[_0x378825];return _0x1f92dc;};'use strict';var express=require(_0x7227('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x7227('0x1')]('/',controller[_0x7227('0x2')]);module[_0x7227('0x3')]=router; \ No newline at end of file +var _0x1cd9=['Router','express'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x1cd9,0x1ed));var _0x91cd=function(_0x2d96a7,_0xe0f108){_0x2d96a7=_0x2d96a7-0x0;var _0x398def=_0x1cd9[_0x2d96a7];return _0x398def;};'use strict';var express=require(_0x91cd('0x0'));var router=express[_0x91cd('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);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 e9117d7..118288a 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x662597,_0x29b293){var _0x25d4f9=function(_0x47aa6b){while(--_0x47aa6b){_0x662597['push'](_0x662597['shift']());}};_0x25d4f9(++_0x29b293);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x7a54,0x106));var _0x47a5=function(_0x3b86ce,_0x188400){_0x3b86ce=_0x3b86ce-0x0;var _0xf54668=_0x7a54[_0x3b86ce];return _0xf54668;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f9579a0..fd011be 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 _0xf97d=['exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware'];(function(_0xd55562,_0x4aa596){var _0x4129f1=function(_0x3d565d){while(--_0x3d565d){_0xd55562['push'](_0xd55562['shift']());}};_0x4129f1(++_0x4aa596);}(_0xf97d,0x199));var _0xdf97=function(_0x3fa435,_0x152d94){_0x3fa435=_0x3fa435-0x0;var _0x5dc72e=_0xf97d[_0x3fa435];return _0x5dc72e;};'use strict';var express=require(_0xdf97('0x0'));var passport=require(_0xdf97('0x1'));var router=express[_0xdf97('0x2')]();var controller=require(_0xdf97('0x3'));var userController=require(_0xdf97('0x4'));var authService=require(_0xdf97('0x5'));router[_0xdf97('0x6')]('/',controller[_0xdf97('0x7')]);router['get'](_0xdf97('0x8'),controller[_0xdf97('0x9')],authService[_0xdf97('0xa')],userController[_0xdf97('0x7')],authService['setTokenCookie']);module[_0xdf97('0xb')]=router; \ No newline at end of file +var _0xe890=['get','callback','login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x2899dd,_0x482585){var _0x1feee0=function(_0x2f15f9){while(--_0x2f15f9){_0x2899dd['push'](_0x2899dd['shift']());}};_0x1feee0(++_0x482585);}(_0xe890,0x19a));var _0x0e89=function(_0x3a6eb2,_0x20da4b){_0x3a6eb2=_0x3a6eb2-0x0;var _0x1a6b2b=_0xe890[_0x3a6eb2];return _0x1a6b2b;};'use strict';var express=require(_0x0e89('0x0'));var passport=require(_0x0e89('0x1'));var router=express['Router']();var controller=require(_0x0e89('0x2'));var userController=require(_0x0e89('0x3'));var authService=require('../../components/auth/service');router[_0x0e89('0x4')]('/',controller['login']);router[_0x0e89('0x4')]('/callback',controller[_0x0e89('0x5')],authService['isMiddleware'],userController[_0x0e89('0x6')],authService[_0x0e89('0x7')]);module[_0x0e89('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index c682434..8db0184 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 _0x2257=['minutes','clearBlockUser','add','getLicense','catch','MailAccount','name','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','merge','format','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','findOne','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','client','Setting','allowedLoginAttempts','blockDuration','then','password','salt','disabled','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x44d741,_0x58f36c){var _0x491fb8=function(_0xb5576c){while(--_0xb5576c){_0x44d741['push'](_0x44d741['shift']());}};_0x491fb8(++_0x58f36c);}(_0x2257,0x1d1));var _0x7225=function(_0x3b4d49,_0x578d2f){_0x3b4d49=_0x3b4d49-0x0;var _0x42b92b=_0x2257[_0x3b4d49];return _0x42b92b;};'use strict';var util=require('util');var passport=require(_0x7225('0x0'));var LocalStrategy=require(_0x7225('0x1'))[_0x7225('0x2')];var jayson=require(_0x7225('0x3'));var _=require(_0x7225('0x4'));var rs=require(_0x7225('0x5'));var moment=require('moment');var db=require(_0x7225('0x6'))['db'];var authService=require(_0x7225('0x7'));var utils=require('../../config/utils');var client=jayson[_0x7225('0x8')]['http']({'port':0x232b});function localAuthenticate(_0xcc118f,_0x30329e,_0x3afc4b,_0x2f863d){var _0x21bb69,_0x278311;return db[_0x7225('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x7225('0xa'),_0x7225('0xb')],'raw':!![]})[_0x7225('0xc')](function(_0x41be3e){_0x21bb69=_0x41be3e;return _0xcc118f['findOne']({'attributes':['id','name',_0x7225('0xd'),_0x7225('0xe'),'role',_0x7225('0xf'),_0x7225('0x10'),_0x7225('0x11'),'loginAttempts'],'where':{'name':_0x30329e,'role':{'$or':[_0x7225('0x12'),_0x7225('0x13'),'agent']}}});})['then'](function(_0x26f3c8){if(!_0x26f3c8||_0x26f3c8&&_0x26f3c8['name']!==_0x30329e){throw new Error(_0x7225('0x14'));}else{_0x278311=_0x26f3c8;return _0x278311;}})['then'](function(){_0x278311['authenticate'](_0x3afc4b,function(_0x5a4452,_0x41c1dd){var _0x53c4d4=_0x278311['loginAttempts']+0x1;if(_0x5a4452){return _0x2f863d(_0x5a4452);}else if(!_0x41c1dd){if(_0x278311[_0x7225('0xf')]){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else if(_0x21bb69[_0x7225('0xa')]>0x0){if(_0x278311['blocked']){if(_0x21bb69['blockDuration']>0x0){if(moment(_0x278311[_0x7225('0x11')])['add'](_0x21bb69['blockDuration'],_0x7225('0x15'))>moment()){return _0x2f863d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7225('0x16')](_0x278311,_0x53c4d4,![],null)['then'](function(){return _0x2f863d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2f863d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x53c4d4>=_0x21bb69['allowedLoginAttempts']){return utils['clearBlockUser'](_0x278311,0x0,!![],moment())[_0x7225('0xc')](function(){return _0x2f863d(null,![],{'message':_0x7225('0x14')});});}else{return utils[_0x7225('0x16')](_0x278311,_0x53c4d4,![],null)[_0x7225('0xc')](function(){return _0x2f863d(null,![],{'message':_0x7225('0x14')});});}}}else{return _0x2f863d(null,![],{'message':_0x7225('0x14')});}}else{if(_0x278311[_0x7225('0xf')]){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else if(_0x21bb69['allowedLoginAttempts']>0x0){if(_0x278311[_0x7225('0x10')]){if(_0x21bb69[_0x7225('0xb')]>0x0){if(moment(_0x278311[_0x7225('0x11')])[_0x7225('0x17')](_0x21bb69[_0x7225('0xb')],_0x7225('0x15'))>moment()){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else{return utils[_0x7225('0x16')](_0x278311,0x0,![],null)[_0x7225('0xc')](function(){return utils[_0x7225('0x18')](_0x278311);})[_0x7225('0xc')](function(){return _0x2f863d(null,_0x278311);});}}else{return _0x2f863d(null,![],{'message':_0x7225('0x14')});}}else{return utils[_0x7225('0x16')](_0x278311,0x0,![],null)['then'](function(){return utils[_0x7225('0x18')](_0x278311);})[_0x7225('0xc')](function(){return _0x2f863d(null,_0x278311);})[_0x7225('0x19')](function(_0x537431){return _0x2f863d(null,![],_0x537431);});}}else{if(_0x278311[_0x7225('0x10')]){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else{return utils[_0x7225('0x18')](_0x278311)[_0x7225('0xc')](function(){return _0x2f863d(null,_0x278311);});}}}});})[_0x7225('0x19')](function(_0x106272){return _0x2f863d(null,![],_0x106272);});}function sendServiceMail(_0xd42814){return db[_0x7225('0x1a')]['find']({'where':{'service':!![]},'attributes':['id',_0x7225('0x1b'),_0x7225('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0x7225('0x1d')}]})[_0x7225('0xc')](function(_0x6efece){if(!_0x6efece){throw new Error(_0x7225('0x1e'));}var _0x56a988={'tls':{'rejectUnauthorized':![]}};if(_0x6efece[_0x7225('0x1d')][_0x7225('0x1f')]){_0x56a988['service']=_0x6efece['Smtp']['service'];}else{_0x56a988[_0x7225('0x20')]=_0x6efece['Smtp']['host'];_0x56a988[_0x7225('0x21')]=_0x6efece[_0x7225('0x1d')][_0x7225('0x21')];_0x56a988[_0x7225('0x22')]=_0x6efece[_0x7225('0x1d')][_0x7225('0x22')];}if(_0x6efece['Smtp']['authentication']){_0x56a988[_0x7225('0x23')]={'user':_0x6efece[_0x7225('0x1d')]['user'],'pass':_0x6efece[_0x7225('0x1d')]['pass']};}var _0x58ebe5={'account':_0x56a988,'message':_[_0x7225('0x24')]({'from':util[_0x7225('0x25')]('\x22%s\x22\x20<%s>',_0x6efece['name'],_0x6efece[_0x7225('0x1c')]||_0x6efece['Smtp']['user'])},_0xd42814)};return client[_0x7225('0x26')]('SendMail',_0x58ebe5);})[_0x7225('0xc')](function(_0x297f67){if(_0x297f67['error']){throw new Error(util[_0x7225('0x25')](_0x7225('0x27'),_0x297f67[_0x7225('0x28')][_0x7225('0x29')]||JSON[_0x7225('0x2a')](_0x297f67[_0x7225('0x28')])));}return!![];});}function handleError(_0xf988e3,_0x39056b,_0x27de89){return _0xf988e3[_0x7225('0x2b')](_0x39056b||0x1f4)[_0x7225('0x2c')]({'message':_0x27de89?_0x27de89[_0x7225('0x29')]||_0x27de89:''});}exports['login']=function(_0x67062e,_0x14419f,_0x35c8dc){passport['authenticate'](_0x7225('0x2d'),function(_0x438338,_0x21a32d,_0x2ada6a){var _0x5e43b4=_0x438338||_0x2ada6a;if(_0x5e43b4){return handleError(_0x14419f,0x191,_0x5e43b4);}if(!_0x21a32d){return handleError(_0x14419f,0x194,{'message':_0x7225('0x2e')});}else{var _0x50316b={'payload':{'id':_0x21a32d['id'],'role':_0x21a32d[_0x7225('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x7225('0x30')](_0x50316b)[_0x7225('0xc')](function(_0x2069b7){_0x14419f[_0x7225('0x31')]({'id':_0x21a32d['id'],'token':_0x2069b7,'statusCall':'','isAlreadyLogged':_0x21a32d['online']});});}})(_0x67062e,_0x14419f,_0x35c8dc);};exports[_0x7225('0x32')]=function(_0x1bf174,_0x3d67b7,_0xa71896){if(!_0x1bf174['body'][_0x7225('0x1c')]){return handleError(_0x3d67b7,0x1f4,{'message':_0x7225('0x33')});}var _0x2816bb=rs[_0x7225('0x34')]();_0x1bf174[_0x7225('0x35')][_0x7225('0x1c')]=_0x1bf174[_0x7225('0x35')][_0x7225('0x1c')][_0x7225('0x36')]()[_0x7225('0x37')]();var _0x18d9b6;return db[_0x7225('0x9')][_0x7225('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7225('0xb')],'raw':!![]})[_0x7225('0xc')](function(_0xc07d4d){_0x18d9b6=_0xc07d4d;return db['User'][_0x7225('0x39')]({'where':{'email':_0x1bf174['body']['email']}});})[_0x7225('0xc')](function(_0x1ca7f9){if(!_0x1ca7f9){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1ca7f9[_0x7225('0xf')]){throw new Error(_0x7225('0x3a'));}if(_0x1ca7f9[_0x7225('0x10')]){if(moment(_0x1ca7f9[_0x7225('0x11')])[_0x7225('0x17')](_0x18d9b6[_0x7225('0xb')],_0x7225('0x15'))>moment()){throw new Error(_0x7225('0x3b'));}else{_0x1ca7f9[_0x7225('0x10')]=![];_0x1ca7f9[_0x7225('0x11')]=null;}}_0x1ca7f9[_0x7225('0x3c')]=_0x2816bb;_0x1ca7f9[_0x7225('0x3d')]=Date['now']()+0x36ee80;return _0x1ca7f9[_0x7225('0x3e')]();})[_0x7225('0xc')](function(){return sendServiceMail({'to':_0x1bf174[_0x7225('0x35')][_0x7225('0x1c')],'subject':_0x7225('0x3f'),'text':_0x7225('0x40')+_0x7225('0x41')+_0x7225('0x42')+_0x1bf174['headers'][_0x7225('0x20')]+_0x7225('0x43')+_0x2816bb+'\x0a\x0a'+_0x7225('0x44')});})[_0x7225('0xc')](function(){_0x3d67b7['status'](0xc8)[_0x7225('0x2c')]({'message':_0x7225('0x45')});})[_0x7225('0x19')](function(_0x44d2de){return handleError(_0x3d67b7,0x1f4,_0x44d2de);});};exports[_0x7225('0x46')]=function(_0x43e55c,_0x5f8557,_0x58d312){return db[_0x7225('0x47')][_0x7225('0x39')]({'where':{'resetPasswordToken':_0x43e55c[_0x7225('0x48')][_0x7225('0x49')],'resetPasswordExpires':{'$gt':Date[_0x7225('0x4a')]()}}})[_0x7225('0xc')](function(_0x56ecf6){if(!_0x56ecf6){throw new Error(_0x7225('0x4b'));}return db['Setting'][_0x7225('0x38')]({'attributes':['id',_0x7225('0x4c'),_0x7225('0x4d'),_0x7225('0x4e')]})[_0x7225('0xc')](function(_0x3354a7){if(_0x3354a7[_0x7225('0x4c')])authService['validatePasswordPattern'](_0x43e55c[_0x7225('0x35')][_0x7225('0xd')]);if(!_0x3354a7['enforcePasswordHistory']||!_0x56ecf6['previousPasswords'])return _0x56ecf6;authService[_0x7225('0x4f')](_0x43e55c[_0x7225('0x35')][_0x7225('0xd')],_0x56ecf6[_0x7225('0x50')],_0x3354a7[_0x7225('0x4e')]);return _0x56ecf6;})[_0x7225('0xc')](function(){_0x56ecf6['password']=_0x43e55c['body'][_0x7225('0xd')];_0x56ecf6[_0x7225('0x3c')]=null;_0x56ecf6['resetPasswordExpires']=null;return _0x56ecf6[_0x7225('0x3e')]();});})[_0x7225('0xc')](function(){_0x5f8557[_0x7225('0x2b')](0xc8)[_0x7225('0x2c')]({'message':'Password\x20reset!'});})[_0x7225('0x19')](function(_0x51e785){return handleError(_0x5f8557,0x1f4,_0x51e785);});};passport['use'](_0x7225('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0x7225('0xd')},function(_0x26594a,_0x3efdef,_0x10579c){return localAuthenticate(db[_0x7225('0x47')],_0x26594a,_0x3efdef,_0x10579c);})); \ No newline at end of file +var _0xfb59=['format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\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','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','Setting','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','save','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb59,0x7e));var _0x9fb5=function(_0x187f5a,_0x29ccda){_0x187f5a=_0x187f5a-0x0;var _0x547ed8=_0xfb59[_0x187f5a];return _0x547ed8;};'use strict';var util=require(_0x9fb5('0x0'));var passport=require(_0x9fb5('0x1'));var LocalStrategy=require('passport-local')[_0x9fb5('0x2')];var jayson=require(_0x9fb5('0x3'));var _=require(_0x9fb5('0x4'));var rs=require(_0x9fb5('0x5'));var moment=require('moment');var db=require(_0x9fb5('0x6'))['db'];var authService=require(_0x9fb5('0x7'));var utils=require(_0x9fb5('0x8'));var client=jayson[_0x9fb5('0x9')]['http']({'port':0x232b});function localAuthenticate(_0xff89ab,_0x3bfded,_0x418bf6,_0x47856d){var _0x470a76,_0x4221e4;return db['Setting'][_0x9fb5('0xa')]({'where':{'id':0x1},'attributes':[_0x9fb5('0xb'),_0x9fb5('0xc')],'raw':!![]})['then'](function(_0xfd8616){_0x470a76=_0xfd8616;return _0xff89ab[_0x9fb5('0xa')]({'attributes':['id','name','password',_0x9fb5('0xd'),'role',_0x9fb5('0xe'),_0x9fb5('0xf'),_0x9fb5('0x10'),_0x9fb5('0x11')],'where':{'name':_0x3bfded,'role':{'$or':[_0x9fb5('0x12'),_0x9fb5('0x13'),'agent']}}});})[_0x9fb5('0x14')](function(_0xd55089){if(!_0xd55089||_0xd55089&&_0xd55089['name']!==_0x3bfded){throw new Error(_0x9fb5('0x15'));}else{_0x4221e4=_0xd55089;return _0x4221e4;}})[_0x9fb5('0x14')](function(){_0x4221e4[_0x9fb5('0x16')](_0x418bf6,function(_0x55a2b1,_0x4e45d8){var _0x293ba4=_0x4221e4[_0x9fb5('0x11')]+0x1;if(_0x55a2b1){return _0x47856d(_0x55a2b1);}else if(!_0x4e45d8){if(_0x4221e4[_0x9fb5('0xe')]){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else if(_0x470a76[_0x9fb5('0xb')]>0x0){if(_0x4221e4[_0x9fb5('0xf')]){if(_0x470a76[_0x9fb5('0xc')]>0x0){if(moment(_0x4221e4['blockedAt'])[_0x9fb5('0x17')](_0x470a76[_0x9fb5('0xc')],_0x9fb5('0x18'))>moment()){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else{return utils[_0x9fb5('0x19')](_0x4221e4,_0x293ba4,![],null)[_0x9fb5('0x14')](function(){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});});}}else{return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}}else{if(_0x293ba4>=_0x470a76[_0x9fb5('0xb')]){return utils[_0x9fb5('0x19')](_0x4221e4,0x0,!![],moment())[_0x9fb5('0x14')](function(){return _0x47856d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9fb5('0x19')](_0x4221e4,_0x293ba4,![],null)[_0x9fb5('0x14')](function(){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});});}}}else{return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}}else{if(_0x4221e4[_0x9fb5('0xe')]){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else if(_0x470a76[_0x9fb5('0xb')]>0x0){if(_0x4221e4[_0x9fb5('0xf')]){if(_0x470a76[_0x9fb5('0xc')]>0x0){if(moment(_0x4221e4[_0x9fb5('0x10')])[_0x9fb5('0x17')](_0x470a76['blockDuration'],_0x9fb5('0x18'))>moment()){return _0x47856d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9fb5('0x19')](_0x4221e4,0x0,![],null)[_0x9fb5('0x14')](function(){return utils['getLicense'](_0x4221e4);})[_0x9fb5('0x14')](function(){return _0x47856d(null,_0x4221e4);});}}else{return _0x47856d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x9fb5('0x19')](_0x4221e4,0x0,![],null)['then'](function(){return utils[_0x9fb5('0x1a')](_0x4221e4);})['then'](function(){return _0x47856d(null,_0x4221e4);})[_0x9fb5('0x1b')](function(_0x24d61e){return _0x47856d(null,![],_0x24d61e);});}}else{if(_0x4221e4[_0x9fb5('0xf')]){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else{return utils[_0x9fb5('0x1a')](_0x4221e4)[_0x9fb5('0x14')](function(){return _0x47856d(null,_0x4221e4);});}}}});})[_0x9fb5('0x1b')](function(_0x3dee2f){return _0x47856d(null,![],_0x3dee2f);});}function sendServiceMail(_0x2be671){return db['MailAccount'][_0x9fb5('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x9fb5('0x1d'),_0x9fb5('0x1e')],'include':[{'model':db[_0x9fb5('0x1f')],'as':_0x9fb5('0x20')}]})[_0x9fb5('0x14')](function(_0x22dd14){if(!_0x22dd14){throw new Error(_0x9fb5('0x21'));}var _0x397e20={'tls':{'rejectUnauthorized':![]}};if(_0x22dd14[_0x9fb5('0x20')]['service']){_0x397e20[_0x9fb5('0x22')]=_0x22dd14['Smtp']['service'];}else{_0x397e20[_0x9fb5('0x23')]=_0x22dd14[_0x9fb5('0x20')]['host'];_0x397e20['port']=_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x24')];_0x397e20[_0x9fb5('0x25')]=_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x25')];}if(_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x26')]){_0x397e20[_0x9fb5('0x27')]={'user':_0x22dd14['Smtp']['user'],'pass':_0x22dd14['Smtp']['pass']};}var _0x3e5079={'account':_0x397e20,'message':_['merge']({'from':util[_0x9fb5('0x28')]('\x22%s\x22\x20<%s>',_0x22dd14[_0x9fb5('0x1d')],_0x22dd14[_0x9fb5('0x1e')]||_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x13')])},_0x2be671)};return client[_0x9fb5('0x29')](_0x9fb5('0x2a'),_0x3e5079);})[_0x9fb5('0x14')](function(_0x167179){if(_0x167179[_0x9fb5('0x2b')]){throw new Error(util[_0x9fb5('0x28')](_0x9fb5('0x2c'),_0x167179[_0x9fb5('0x2b')][_0x9fb5('0x2d')]||JSON[_0x9fb5('0x2e')](_0x167179[_0x9fb5('0x2b')])));}return!![];});}function handleError(_0x3a9245,_0x1bffa9,_0x2c1310){return _0x3a9245[_0x9fb5('0x2f')](_0x1bffa9||0x1f4)[_0x9fb5('0x30')]({'message':_0x2c1310?_0x2c1310[_0x9fb5('0x2d')]||_0x2c1310:''});}exports[_0x9fb5('0x31')]=function(_0x376a21,_0x554970,_0x38e944){passport['authenticate'](_0x9fb5('0x32'),function(_0x35bd80,_0x4cd713,_0x1fb663){var _0x5d5de3=_0x35bd80||_0x1fb663;if(_0x5d5de3){return handleError(_0x554970,0x191,_0x5d5de3);}if(!_0x4cd713){return handleError(_0x554970,0x194,{'message':_0x9fb5('0x33')});}else{var _0x1bd9a2={'payload':{'id':_0x4cd713['id'],'role':_0x4cd713[_0x9fb5('0x34')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1bd9a2)[_0x9fb5('0x14')](function(_0x39d3b6){_0x554970[_0x9fb5('0x35')]({'id':_0x4cd713['id'],'token':_0x39d3b6,'statusCall':'','isAlreadyLogged':_0x4cd713[_0x9fb5('0x36')]});});}})(_0x376a21,_0x554970,_0x38e944);};exports[_0x9fb5('0x37')]=function(_0x5903f6,_0x2fca9b,_0x3d5351){if(!_0x5903f6['body'][_0x9fb5('0x1e')]){return handleError(_0x2fca9b,0x1f4,{'message':_0x9fb5('0x38')});}var _0x55dee2=rs['generate']();_0x5903f6[_0x9fb5('0x39')][_0x9fb5('0x1e')]=_0x5903f6[_0x9fb5('0x39')]['email'][_0x9fb5('0x3a')]()[_0x9fb5('0x3b')]();var _0x48843a;return db['Setting'][_0x9fb5('0xa')]({'where':{'id':0x1},'attributes':[_0x9fb5('0xb'),_0x9fb5('0xc')],'raw':!![]})[_0x9fb5('0x14')](function(_0x4d5d7d){_0x48843a=_0x4d5d7d;return db['User'][_0x9fb5('0x1c')]({'where':{'email':_0x5903f6[_0x9fb5('0x39')]['email']}});})['then'](function(_0xddb67d){if(!_0xddb67d){throw new Error(_0x9fb5('0x3c'));}if(_0xddb67d[_0x9fb5('0xe')]){throw new Error(_0x9fb5('0x3d'));}if(_0xddb67d['blocked']){if(moment(_0xddb67d[_0x9fb5('0x10')])[_0x9fb5('0x17')](_0x48843a[_0x9fb5('0xc')],_0x9fb5('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xddb67d['blocked']=![];_0xddb67d[_0x9fb5('0x10')]=null;}}_0xddb67d[_0x9fb5('0x3e')]=_0x55dee2;_0xddb67d[_0x9fb5('0x3f')]=Date[_0x9fb5('0x40')]()+0x36ee80;return _0xddb67d['save']();})[_0x9fb5('0x14')](function(){return sendServiceMail({'to':_0x5903f6['body'][_0x9fb5('0x1e')],'subject':_0x9fb5('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x9fb5('0x42')+_0x9fb5('0x43')+_0x5903f6[_0x9fb5('0x44')][_0x9fb5('0x23')]+'/reset/'+_0x55dee2+'\x0a\x0a'+_0x9fb5('0x45')});})['then'](function(){_0x2fca9b['status'](0xc8)[_0x9fb5('0x30')]({'message':_0x9fb5('0x46')});})[_0x9fb5('0x1b')](function(_0x2cfcca){return handleError(_0x2fca9b,0x1f4,_0x2cfcca);});};exports[_0x9fb5('0x47')]=function(_0x15cd6a,_0x2fae92,_0x4811d4){return db[_0x9fb5('0x48')][_0x9fb5('0x1c')]({'where':{'resetPasswordToken':_0x15cd6a[_0x9fb5('0x49')][_0x9fb5('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x9fb5('0x40')]()}}})[_0x9fb5('0x14')](function(_0x1170c2){if(!_0x1170c2){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x9fb5('0x4b')][_0x9fb5('0xa')]({'attributes':['id','securePassword',_0x9fb5('0x4c'),_0x9fb5('0x4d')]})['then'](function(_0x46cb00){if(_0x46cb00['securePassword'])authService['validatePasswordPattern'](_0x15cd6a[_0x9fb5('0x39')]['password']);if(!_0x46cb00[_0x9fb5('0x4c')]||!_0x1170c2['previousPasswords'])return _0x1170c2;authService['validatePasswordHistory'](_0x15cd6a[_0x9fb5('0x39')][_0x9fb5('0x4e')],_0x1170c2[_0x9fb5('0x4f')],_0x46cb00['passwordHistoryLimit']);return _0x1170c2;})[_0x9fb5('0x14')](function(){_0x1170c2['password']=_0x15cd6a[_0x9fb5('0x39')]['password'];_0x1170c2[_0x9fb5('0x3e')]=null;_0x1170c2[_0x9fb5('0x3f')]=null;return _0x1170c2[_0x9fb5('0x50')]();});})[_0x9fb5('0x14')](function(){_0x2fae92['status'](0xc8)[_0x9fb5('0x30')]({'message':_0x9fb5('0x51')});})[_0x9fb5('0x1b')](function(_0x14d53b){return handleError(_0x2fae92,0x1f4,_0x14d53b);});};passport[_0x9fb5('0x52')](_0x9fb5('0x32'),new LocalStrategy({'usernameField':'name','passwordField':_0x9fb5('0x4e')},function(_0x20aed9,_0x23be3b,_0x72c015){return localAuthenticate(db[_0x9fb5('0x48')],_0x20aed9,_0x23be3b,_0x72c015);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 0bf4378..4c71684 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 _0x1a9a=['post','/reset/:token','reset','exports','express','Router','/forgot','forgot'];(function(_0x5a9397,_0x2e444c){var _0x5b89be=function(_0x17d763){while(--_0x17d763){_0x5a9397['push'](_0x5a9397['shift']());}};_0x5b89be(++_0x2e444c);}(_0x1a9a,0xec));var _0xa1a9=function(_0x14a188,_0x12c89b){_0x14a188=_0x14a188-0x0;var _0x4222b2=_0x1a9a[_0x14a188];return _0x4222b2;};'use strict';var express=require(_0xa1a9('0x0'));var router=express[_0xa1a9('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post'](_0xa1a9('0x2'),controller[_0xa1a9('0x3')]);router[_0xa1a9('0x4')](_0xa1a9('0x5'),controller[_0xa1a9('0x6')]);module[_0xa1a9('0x7')]=router; \ No newline at end of file +var _0xe368=['forgot','reset','Router','post','login','/forgot'];(function(_0x5c4de0,_0x435e61){var _0x565255=function(_0x41bf22){while(--_0x41bf22){_0x5c4de0['push'](_0x5c4de0['shift']());}};_0x565255(++_0x435e61);}(_0xe368,0x14c));var _0x8e36=function(_0x1b6cfb,_0x13520c){_0x1b6cfb=_0x1b6cfb-0x0;var _0x280347=_0xe368[_0x1b6cfb];return _0x280347;};'use strict';var express=require('express');var router=express[_0x8e36('0x0')]();var controller=require('./authLocal.controller');router[_0x8e36('0x1')]('/',controller[_0x8e36('0x2')]);router[_0x8e36('0x1')](_0x8e36('0x3'),controller[_0x8e36('0x4')]);router['post']('/reset/:token',controller[_0x8e36('0x5')]);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 24e92af..64afcaa 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 _0xfac7=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x19d998,_0x3697e3){var _0x30aa6f=function(_0x1b7a72){while(--_0x1b7a72){_0x19d998['push'](_0x19d998['shift']());}};_0x30aa6f(++_0x3697e3);}(_0xfac7,0x189));var _0x7fac=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xfac7[_0x387dc1];return _0x17567c;};'use strict';var Sequelize=require(_0x7fac('0x0'));module[_0x7fac('0x1')]={'name':{'type':Sequelize[_0x7fac('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7fac('0x2')]},'description':{'type':Sequelize[_0x7fac('0x2')]},'status':{'type':Sequelize[_0x7fac('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7fac('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x5f64=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x5f64,0x175));var _0x45f6=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0x5f64[_0xb5fc3e];return _0x2efc3c;};'use strict';var Sequelize=require(_0x45f6('0x0'));module[_0x45f6('0x1')]={'name':{'type':Sequelize[_0x45f6('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x45f6('0x2')]},'description':{'type':Sequelize[_0x45f6('0x2')]},'status':{'type':Sequelize[_0x45f6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x45f6('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index bcf7cb8..93e8733 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 _0xdb01=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','rows','catch','show','rawAttributes','include','create','body','find','params','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','filters'];(function(_0x325b77,_0x161ccd){var _0x13282c=function(_0x235631){while(--_0x235631){_0x325b77['push'](_0x325b77['shift']());}};_0x13282c(++_0x161ccd);}(_0xdb01,0x120));var _0x1db0=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xdb01[_0x498334];return _0x13bb70;};'use strict';var emlformat=require(_0x1db0('0x0'));var rimraf=require(_0x1db0('0x1'));var zipdir=require(_0x1db0('0x2'));var jsonpatch=require(_0x1db0('0x3'));var rp=require(_0x1db0('0x4'));var moment=require(_0x1db0('0x5'));var BPromise=require(_0x1db0('0x6'));var Mustache=require('mustache');var util=require(_0x1db0('0x7'));var path=require(_0x1db0('0x8'));var sox=require(_0x1db0('0x9'));var csv=require('to-csv');var ejs=require(_0x1db0('0xa'));var fs=require('fs');var fs_extra=require(_0x1db0('0xb'));var _=require(_0x1db0('0xc'));var squel=require(_0x1db0('0xd'));var crypto=require(_0x1db0('0xe'));var jsforce=require(_0x1db0('0xf'));var deskjs=require(_0x1db0('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1db0('0x11'));var Papa=require(_0x1db0('0x12'));var Redis=require(_0x1db0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1db0('0x14'));var as=require(_0x1db0('0x15'));var hardwareService=require(_0x1db0('0x16'));var logger=require('../../config/logger')(_0x1db0('0x17'));var utils=require(_0x1db0('0x18'));var config=require(_0x1db0('0x19'));var licenseUtil=require(_0x1db0('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa52f4d,_0x2b71e6){_0x2b71e6=_0x2b71e6||0xcc;return function(_0x397d40){if(_0x397d40){return _0xa52f4d['sendStatus'](_0x2b71e6);}return _0xa52f4d[_0x1db0('0x1b')](_0x2b71e6)[_0x1db0('0x1c')]();};}function respondWithResult(_0x2acc53,_0x3bba0b){_0x3bba0b=_0x3bba0b||0xc8;return function(_0x5ea811){if(_0x5ea811){return _0x2acc53[_0x1db0('0x1b')](_0x3bba0b)[_0x1db0('0x1d')](_0x5ea811);}};}function respondWithFilteredResult(_0x2c717e,_0x2fd8d4){return function(_0x430ac4){if(_0x430ac4){var _0x3e65fe=typeof _0x2fd8d4[_0x1db0('0x1e')]===_0x1db0('0x1f')&&typeof _0x2fd8d4[_0x1db0('0x20')]===_0x1db0('0x1f');var _0x18852d=_0x430ac4[_0x1db0('0x21')];var _0x4d43e3=_0x3e65fe?0x0:_0x2fd8d4[_0x1db0('0x1e')];var _0x316bc8=_0x3e65fe?_0x430ac4[_0x1db0('0x21')]:_0x2fd8d4['offset']+_0x2fd8d4[_0x1db0('0x20')];var _0x4c7f8c;if(_0x316bc8>=_0x18852d){_0x316bc8=_0x18852d;_0x4c7f8c=0xc8;}else{_0x4c7f8c=0xce;}_0x2c717e['status'](_0x4c7f8c);return _0x2c717e[_0x1db0('0x22')]('Content-Range',_0x4d43e3+'-'+_0x316bc8+'/'+_0x18852d)[_0x1db0('0x1d')](_0x430ac4);}return null;};}function patchUpdates(_0x53cc7b){return function(_0x40631b){try{jsonpatch['apply'](_0x40631b,_0x53cc7b,!![]);}catch(_0x5e5f82){return BPromise[_0x1db0('0x23')](_0x5e5f82);}return _0x40631b[_0x1db0('0x24')]();};}function saveUpdates(_0xd788ff,_0x1e69e2){return function(_0x2c5dcd){if(_0x2c5dcd){return _0x2c5dcd[_0x1db0('0x25')](_0xd788ff)[_0x1db0('0x26')](function(_0x5909c6){return _0x5909c6;});}return null;};}function removeEntity(_0xe33e8,_0x13f4a8){return function(_0x48b16e){if(_0x48b16e){return _0x48b16e[_0x1db0('0x27')]()[_0x1db0('0x26')](function(){_0xe33e8['status'](0xcc)[_0x1db0('0x1c')]();});}};}function handleEntityNotFound(_0x101945,_0xb400f1){return function(_0xfcb526){if(!_0xfcb526){_0x101945['sendStatus'](0x194);}return _0xfcb526;};}function handleError(_0x5f3825,_0x55ac9d){_0x55ac9d=_0x55ac9d||0x1f4;return function(_0x351fcb){logger['error'](_0x351fcb[_0x1db0('0x28')]);if(_0x351fcb[_0x1db0('0x29')]){delete _0x351fcb['name'];}_0x5f3825[_0x1db0('0x1b')](_0x55ac9d)['send'](_0x351fcb);};}exports[_0x1db0('0x2a')]=function(_0xf84175,_0x4b4ee0){var _0x3bb681={},_0x104947={},_0x16dcdf={'count':0x0,'rows':[]};var _0x234a9c=_[_0x1db0('0x2b')](db[_0x1db0('0x2c')]['rawAttributes'],function(_0x2a548d){return{'name':_0x2a548d[_0x1db0('0x2d')],'type':_0x2a548d[_0x1db0('0x2e')][_0x1db0('0x2f')]};});_0x104947[_0x1db0('0x30')]=_[_0x1db0('0x2b')](_0x234a9c,_0x1db0('0x29'));_0x104947[_0x1db0('0x31')]=_[_0x1db0('0x32')](_0xf84175[_0x1db0('0x31')]);_0x104947[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x104947[_0x1db0('0x30')],_0x104947[_0x1db0('0x31')]);_0x3bb681[_0x1db0('0x35')]=_['intersection'](_0x104947[_0x1db0('0x30')],qs[_0x1db0('0x36')](_0xf84175[_0x1db0('0x31')][_0x1db0('0x36')]));_0x3bb681[_0x1db0('0x35')]=_0x3bb681[_0x1db0('0x35')][_0x1db0('0x37')]?_0x3bb681[_0x1db0('0x35')]:_0x104947[_0x1db0('0x30')];if(!_0xf84175[_0x1db0('0x31')][_0x1db0('0x38')](_0x1db0('0x39'))){_0x3bb681[_0x1db0('0x20')]=qs[_0x1db0('0x20')](_0xf84175['query'][_0x1db0('0x20')]);_0x3bb681[_0x1db0('0x1e')]=qs[_0x1db0('0x1e')](_0xf84175[_0x1db0('0x31')][_0x1db0('0x1e')]);}_0x3bb681[_0x1db0('0x3a')]=qs[_0x1db0('0x3b')](_0xf84175['query']['sort']);_0x3bb681['where']=qs[_0x1db0('0x33')](_[_0x1db0('0x3c')](_0xf84175[_0x1db0('0x31')],_0x104947['filters']),_0x234a9c);if(_0xf84175['query'][_0x1db0('0x3d')]){_0x3bb681['where']=_[_0x1db0('0x3e')](_0x3bb681['where'],{'$or':_[_0x1db0('0x2b')](_0x234a9c,function(_0x45493e){if(_0x45493e['type']!==_0x1db0('0x3f')){var _0xd7e06={};_0xd7e06[_0x45493e['name']]={'$like':'%'+_0xf84175[_0x1db0('0x31')][_0x1db0('0x3d')]+'%'};return _0xd7e06;}})});}_0x3bb681=_[_0x1db0('0x3e')]({},_0x3bb681,_0xf84175[_0x1db0('0x40')]);var _0x448ddd={'where':_0x3bb681[_0x1db0('0x41')]};return db[_0x1db0('0x2c')][_0x1db0('0x21')](_0x448ddd)[_0x1db0('0x26')](function(_0x1dc2a3){_0x16dcdf[_0x1db0('0x21')]=_0x1dc2a3;if(_0xf84175['query'][_0x1db0('0x42')]){_0x3bb681['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x3bb681);})[_0x1db0('0x26')](function(_0x5f493d){_0x16dcdf[_0x1db0('0x43')]=_0x5f493d;return _0x16dcdf;})[_0x1db0('0x26')](respondWithFilteredResult(_0x4b4ee0,_0x3bb681))[_0x1db0('0x44')](handleError(_0x4b4ee0,null));};exports[_0x1db0('0x45')]=function(_0x592d58,_0x1da5a6){var _0x4a0ec7={'raw':![],'where':{'id':_0x592d58['params']['id']}},_0x24ea0e={};_0x24ea0e[_0x1db0('0x30')]=_['keys'](db[_0x1db0('0x2c')][_0x1db0('0x46')]);_0x24ea0e[_0x1db0('0x31')]=_[_0x1db0('0x32')](_0x592d58[_0x1db0('0x31')]);_0x24ea0e[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x24ea0e[_0x1db0('0x30')],_0x24ea0e[_0x1db0('0x31')]);_0x4a0ec7[_0x1db0('0x35')]=_[_0x1db0('0x34')](_0x24ea0e[_0x1db0('0x30')],qs[_0x1db0('0x36')](_0x592d58[_0x1db0('0x31')][_0x1db0('0x36')]));_0x4a0ec7['attributes']=_0x4a0ec7['attributes']['length']?_0x4a0ec7['attributes']:_0x24ea0e['model'];if(_0x592d58['query']['includeAll']){_0x4a0ec7[_0x1db0('0x47')]=[{'all':!![]}];}_0x4a0ec7=_[_0x1db0('0x3e')]({},_0x4a0ec7,_0x592d58[_0x1db0('0x40')]);return db[_0x1db0('0x2c')]['find'](_0x4a0ec7)[_0x1db0('0x26')](handleEntityNotFound(_0x1da5a6,null))[_0x1db0('0x26')](respondWithResult(_0x1da5a6,null))[_0x1db0('0x44')](handleError(_0x1da5a6,null));};exports[_0x1db0('0x48')]=function(_0x478b44,_0x26d579){return db[_0x1db0('0x2c')][_0x1db0('0x48')](_0x478b44[_0x1db0('0x49')],{})[_0x1db0('0x26')](respondWithResult(_0x26d579,0xc9))['catch'](handleError(_0x26d579,null));};exports[_0x1db0('0x25')]=function(_0x48e460,_0x3d456b){if(_0x48e460['body']['id']){delete _0x48e460[_0x1db0('0x49')]['id'];}return db['Automation'][_0x1db0('0x4a')]({'where':{'id':_0x48e460['params']['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x3d456b,null))[_0x1db0('0x26')](saveUpdates(_0x48e460['body'],null))[_0x1db0('0x26')](respondWithResult(_0x3d456b,null))['catch'](handleError(_0x3d456b,null));};exports[_0x1db0('0x27')]=function(_0x590e1a,_0x1ff1e7){return db['Automation'][_0x1db0('0x4a')]({'where':{'id':_0x590e1a[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x1ff1e7,null))[_0x1db0('0x26')](removeEntity(_0x1ff1e7,null))[_0x1db0('0x44')](handleError(_0x1ff1e7,null));};exports[_0x1db0('0x4c')]=function(_0x204862,_0x2bfad9,_0x2449c6){return db[_0x1db0('0x4d')][_0x1db0('0x4a')]({'where':{'id':_0x204862[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x2bfad9,null))[_0x1db0('0x26')](function(_0xb6c718){if(_0xb6c718){return _0xb6c718['addConditions'](_0x204862[_0x1db0('0x49')]['ids'],_[_0x1db0('0x4e')](_0x204862['body'],[_0x1db0('0x4f'),'id'])||{});}})[_0x1db0('0x26')](respondWithResult(_0x2bfad9,null))[_0x1db0('0x44')](handleError(_0x2bfad9,null));};exports[_0x1db0('0x50')]=function(_0x3478c1,_0x46eab8,_0xd35341){var _0x50385b={};var _0x2cec62={};var _0x2c3c33;var _0x535cb4;return db['Automation'][_0x1db0('0x51')]({'where':{'id':_0x3478c1[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x46eab8,null))['then'](function(_0x478279){if(_0x478279){_0x2c3c33=_0x478279;_0x2cec62[_0x1db0('0x30')]=_['keys'](db[_0x1db0('0x4d')][_0x1db0('0x46')]);_0x2cec62[_0x1db0('0x31')]=_['keys'](_0x3478c1['query']);_0x2cec62[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x2cec62[_0x1db0('0x30')],_0x2cec62['query']);_0x50385b[_0x1db0('0x35')]=_['intersection'](_0x2cec62['model'],qs[_0x1db0('0x36')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x36')]));_0x50385b[_0x1db0('0x35')]=_0x50385b['attributes'][_0x1db0('0x37')]?_0x50385b[_0x1db0('0x35')]:_0x2cec62['model'];_0x50385b['order']=qs[_0x1db0('0x3b')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x3b')]);_0x50385b[_0x1db0('0x41')]=qs[_0x1db0('0x33')](_[_0x1db0('0x3c')](_0x3478c1[_0x1db0('0x31')],_0x2cec62[_0x1db0('0x33')]));if(_0x3478c1['query']['filter']){_0x50385b[_0x1db0('0x41')]=_[_0x1db0('0x3e')](_0x50385b[_0x1db0('0x41')],{'$or':_[_0x1db0('0x2b')](_0x50385b[_0x1db0('0x35')],function(_0x545b3b){var _0x49ea75={};_0x49ea75[_0x545b3b]={'$like':'%'+_0x3478c1[_0x1db0('0x31')][_0x1db0('0x3d')]+'%'};return _0x49ea75;})});}_0x50385b=_[_0x1db0('0x3e')]({},_0x50385b,_0x3478c1[_0x1db0('0x40')]);return _0x2c3c33['getConditions'](_0x50385b);}})['then'](function(_0x5711a6){if(_0x5711a6){_0x535cb4=_0x5711a6['length'];if(!_0x3478c1['query'][_0x1db0('0x38')]('nolimit')){_0x50385b[_0x1db0('0x20')]=qs[_0x1db0('0x20')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x20')]);_0x50385b[_0x1db0('0x1e')]=qs[_0x1db0('0x1e')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x1e')]);}return _0x2c3c33['getConditions'](_0x50385b);}})[_0x1db0('0x26')](function(_0x70ca69){if(_0x70ca69){return _0x70ca69?{'count':_0x535cb4,'rows':_0x70ca69}:null;}})[_0x1db0('0x26')](respondWithResult(_0x46eab8,null))[_0x1db0('0x44')](handleError(_0x46eab8,null));};exports[_0x1db0('0x52')]=function(_0xbf2600,_0x2efcab,_0x39e94f){return db[_0x1db0('0x53')]['find']({'where':{'id':_0xbf2600['params']['id']}})['then'](handleEntityNotFound(_0x2efcab,null))[_0x1db0('0x26')](function(_0x25c379){if(_0x25c379){return _0x25c379[_0x1db0('0x52')](_0xbf2600[_0x1db0('0x49')][_0x1db0('0x4f')],_[_0x1db0('0x4e')](_0xbf2600[_0x1db0('0x49')],[_0x1db0('0x4f'),'id'])||{});}})[_0x1db0('0x26')](respondWithResult(_0x2efcab,null))[_0x1db0('0x44')](handleError(_0x2efcab,null));};exports[_0x1db0('0x54')]=function(_0x5591a2,_0x11279e,_0x4da846){var _0x1c8771={};var _0x1b3e4c={};var _0xc339;var _0xced2db;return db[_0x1db0('0x2c')][_0x1db0('0x51')]({'where':{'id':_0x5591a2[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x11279e,null))[_0x1db0('0x26')](function(_0x3c1e08){if(_0x3c1e08){_0xc339=_0x3c1e08;_0x1b3e4c[_0x1db0('0x30')]=_[_0x1db0('0x32')](db[_0x1db0('0x53')][_0x1db0('0x46')]);_0x1b3e4c[_0x1db0('0x31')]=_['keys'](_0x5591a2[_0x1db0('0x31')]);_0x1b3e4c[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x1b3e4c[_0x1db0('0x30')],_0x1b3e4c[_0x1db0('0x31')]);_0x1c8771[_0x1db0('0x35')]=_[_0x1db0('0x34')](_0x1b3e4c[_0x1db0('0x30')],qs[_0x1db0('0x36')](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x36')]));_0x1c8771[_0x1db0('0x35')]=_0x1c8771['attributes'][_0x1db0('0x37')]?_0x1c8771[_0x1db0('0x35')]:_0x1b3e4c[_0x1db0('0x30')];_0x1c8771['order']=qs[_0x1db0('0x3b')](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x3b')]);_0x1c8771[_0x1db0('0x41')]=qs[_0x1db0('0x33')](_['pick'](_0x5591a2[_0x1db0('0x31')],_0x1b3e4c[_0x1db0('0x33')]));if(_0x5591a2['query'][_0x1db0('0x3d')]){_0x1c8771[_0x1db0('0x41')]=_[_0x1db0('0x3e')](_0x1c8771[_0x1db0('0x41')],{'$or':_['map'](_0x1c8771['attributes'],function(_0x1f87e8){var _0x27e1e2={};_0x27e1e2[_0x1f87e8]={'$like':'%'+_0x5591a2[_0x1db0('0x31')]['filter']+'%'};return _0x27e1e2;})});}_0x1c8771=_['merge']({},_0x1c8771,_0x5591a2[_0x1db0('0x40')]);return _0xc339[_0x1db0('0x54')](_0x1c8771);}})[_0x1db0('0x26')](function(_0x128498){if(_0x128498){_0xced2db=_0x128498[_0x1db0('0x37')];if(!_0x5591a2[_0x1db0('0x31')][_0x1db0('0x38')]('nolimit')){_0x1c8771['limit']=qs['limit'](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x20')]);_0x1c8771['offset']=qs['offset'](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x1e')]);}return _0xc339[_0x1db0('0x54')](_0x1c8771);}})[_0x1db0('0x26')](function(_0x43eef0){if(_0x43eef0){return _0x43eef0?{'count':_0xced2db,'rows':_0x43eef0}:null;}})['then'](respondWithResult(_0x11279e,null))[_0x1db0('0x44')](handleError(_0x11279e,null));}; \ No newline at end of file +var _0x26ea=['error','stack','name','send','Automation','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','then','show','params','find','catch','create','body','addConditions','Condition','ids','omit','findOne','getConditions','Action','addActions','getActions','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x23899b,_0x1ef7c7){var _0x3b7fda=function(_0x119d17){while(--_0x119d17){_0x23899b['push'](_0x23899b['shift']());}};_0x3b7fda(++_0x1ef7c7);}(_0x26ea,0x176));var _0xa26e=function(_0x36580f,_0x35017f){_0x36580f=_0x36580f-0x0;var _0x5dab9b=_0x26ea[_0x36580f];return _0x5dab9b;};'use strict';var emlformat=require(_0xa26e('0x0'));var rimraf=require(_0xa26e('0x1'));var zipdir=require(_0xa26e('0x2'));var jsonpatch=require(_0xa26e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa26e('0x4'));var Mustache=require(_0xa26e('0x5'));var util=require(_0xa26e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa26e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa26e('0x8'));var _=require(_0xa26e('0x9'));var squel=require(_0xa26e('0xa'));var crypto=require(_0xa26e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa26e('0xc'));var toCsv=require(_0xa26e('0x7'));var querystring=require(_0xa26e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa26e('0xe'));var qs=require(_0xa26e('0xf'));var as=require(_0xa26e('0x10'));var hardwareService=require(_0xa26e('0x11'));var logger=require(_0xa26e('0x12'))(_0xa26e('0x13'));var utils=require(_0xa26e('0x14'));var config=require(_0xa26e('0x15'));var licenseUtil=require(_0xa26e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4435d9,_0xd6f8b5){_0xd6f8b5=_0xd6f8b5||0xcc;return function(_0x2eae05){if(_0x2eae05){return _0x4435d9[_0xa26e('0x17')](_0xd6f8b5);}return _0x4435d9[_0xa26e('0x18')](_0xd6f8b5)[_0xa26e('0x19')]();};}function respondWithResult(_0x244e7e,_0x468b43){_0x468b43=_0x468b43||0xc8;return function(_0x36e34a){if(_0x36e34a){return _0x244e7e[_0xa26e('0x18')](_0x468b43)['json'](_0x36e34a);}};}function respondWithFilteredResult(_0x15b9e6,_0x2806b7){return function(_0x2a6e40){if(_0x2a6e40){var _0x5e2149=typeof _0x2806b7[_0xa26e('0x1a')]===_0xa26e('0x1b')&&typeof _0x2806b7[_0xa26e('0x1c')]===_0xa26e('0x1b');var _0x4935bb=_0x2a6e40[_0xa26e('0x1d')];var _0x1c31b6=_0x5e2149?0x0:_0x2806b7[_0xa26e('0x1a')];var _0x5bd3b0=_0x5e2149?_0x2a6e40[_0xa26e('0x1d')]:_0x2806b7[_0xa26e('0x1a')]+_0x2806b7[_0xa26e('0x1c')];var _0x381c39;if(_0x5bd3b0>=_0x4935bb){_0x5bd3b0=_0x4935bb;_0x381c39=0xc8;}else{_0x381c39=0xce;}_0x15b9e6[_0xa26e('0x18')](_0x381c39);return _0x15b9e6[_0xa26e('0x1e')](_0xa26e('0x1f'),_0x1c31b6+'-'+_0x5bd3b0+'/'+_0x4935bb)['json'](_0x2a6e40);}return null;};}function patchUpdates(_0x3443c9){return function(_0x376be2){try{jsonpatch[_0xa26e('0x20')](_0x376be2,_0x3443c9,!![]);}catch(_0x3586a6){return BPromise[_0xa26e('0x21')](_0x3586a6);}return _0x376be2[_0xa26e('0x22')]();};}function saveUpdates(_0x34d7da,_0x365318){return function(_0x2e381b){if(_0x2e381b){return _0x2e381b[_0xa26e('0x23')](_0x34d7da)['then'](function(_0x1e0b02){return _0x1e0b02;});}return null;};}function removeEntity(_0x26364e,_0x2e1b8b){return function(_0xefae7c){if(_0xefae7c){return _0xefae7c['destroy']()['then'](function(){_0x26364e[_0xa26e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7d6ae2,_0x1e65f8){return function(_0x62587e){if(!_0x62587e){_0x7d6ae2[_0xa26e('0x17')](0x194);}return _0x62587e;};}function handleError(_0x1cb5e5,_0x18e86e){_0x18e86e=_0x18e86e||0x1f4;return function(_0x1ccaa0){logger[_0xa26e('0x24')](_0x1ccaa0[_0xa26e('0x25')]);if(_0x1ccaa0[_0xa26e('0x26')]){delete _0x1ccaa0['name'];}_0x1cb5e5[_0xa26e('0x18')](_0x18e86e)[_0xa26e('0x27')](_0x1ccaa0);};}exports['index']=function(_0x312620,_0x9bcf79){var _0x37c375={},_0x5278a0={},_0x51962c={'count':0x0,'rows':[]};var _0x2abb55=_['map'](db[_0xa26e('0x28')][_0xa26e('0x29')],function(_0x52f8f5){return{'name':_0x52f8f5['fieldName'],'type':_0x52f8f5['type'][_0xa26e('0x2a')]};});_0x5278a0[_0xa26e('0x2b')]=_[_0xa26e('0x2c')](_0x2abb55,'name');_0x5278a0[_0xa26e('0x2d')]=_[_0xa26e('0x2e')](_0x312620[_0xa26e('0x2d')]);_0x5278a0['filters']=_[_0xa26e('0x2f')](_0x5278a0[_0xa26e('0x2b')],_0x5278a0['query']);_0x37c375[_0xa26e('0x30')]=_['intersection'](_0x5278a0[_0xa26e('0x2b')],qs['fields'](_0x312620['query'][_0xa26e('0x31')]));_0x37c375['attributes']=_0x37c375['attributes'][_0xa26e('0x32')]?_0x37c375[_0xa26e('0x30')]:_0x5278a0[_0xa26e('0x2b')];if(!_0x312620[_0xa26e('0x2d')][_0xa26e('0x33')](_0xa26e('0x34'))){_0x37c375['limit']=qs[_0xa26e('0x1c')](_0x312620[_0xa26e('0x2d')]['limit']);_0x37c375[_0xa26e('0x1a')]=qs[_0xa26e('0x1a')](_0x312620[_0xa26e('0x2d')]['offset']);}_0x37c375['order']=qs[_0xa26e('0x35')](_0x312620[_0xa26e('0x2d')][_0xa26e('0x35')]);_0x37c375['where']=qs['filters'](_[_0xa26e('0x36')](_0x312620['query'],_0x5278a0[_0xa26e('0x37')]),_0x2abb55);if(_0x312620[_0xa26e('0x2d')][_0xa26e('0x38')]){_0x37c375[_0xa26e('0x39')]=_[_0xa26e('0x3a')](_0x37c375[_0xa26e('0x39')],{'$or':_['map'](_0x2abb55,function(_0x216bb3){if(_0x216bb3[_0xa26e('0x3b')]!==_0xa26e('0x3c')){var _0x2fce92={};_0x2fce92[_0x216bb3['name']]={'$like':'%'+_0x312620[_0xa26e('0x2d')][_0xa26e('0x38')]+'%'};return _0x2fce92;}})});}_0x37c375=_[_0xa26e('0x3a')]({},_0x37c375,_0x312620[_0xa26e('0x3d')]);var _0x5b3139={'where':_0x37c375[_0xa26e('0x39')]};return db[_0xa26e('0x28')][_0xa26e('0x1d')](_0x5b3139)['then'](function(_0x283469){_0x51962c[_0xa26e('0x1d')]=_0x283469;if(_0x312620[_0xa26e('0x2d')][_0xa26e('0x3e')]){_0x37c375[_0xa26e('0x3f')]=[{'all':!![]}];}return db[_0xa26e('0x28')][_0xa26e('0x40')](_0x37c375);})['then'](function(_0x26fd69){_0x51962c['rows']=_0x26fd69;return _0x51962c;})[_0xa26e('0x41')](respondWithFilteredResult(_0x9bcf79,_0x37c375))['catch'](handleError(_0x9bcf79,null));};exports[_0xa26e('0x42')]=function(_0x40e786,_0x3bc4ed){var _0x462cae={'raw':![],'where':{'id':_0x40e786[_0xa26e('0x43')]['id']}},_0x5737c1={};_0x5737c1[_0xa26e('0x2b')]=_[_0xa26e('0x2e')](db[_0xa26e('0x28')]['rawAttributes']);_0x5737c1[_0xa26e('0x2d')]=_[_0xa26e('0x2e')](_0x40e786['query']);_0x5737c1[_0xa26e('0x37')]=_[_0xa26e('0x2f')](_0x5737c1['model'],_0x5737c1[_0xa26e('0x2d')]);_0x462cae[_0xa26e('0x30')]=_[_0xa26e('0x2f')](_0x5737c1['model'],qs[_0xa26e('0x31')](_0x40e786[_0xa26e('0x2d')]['fields']));_0x462cae['attributes']=_0x462cae[_0xa26e('0x30')][_0xa26e('0x32')]?_0x462cae[_0xa26e('0x30')]:_0x5737c1[_0xa26e('0x2b')];if(_0x40e786[_0xa26e('0x2d')][_0xa26e('0x3e')]){_0x462cae[_0xa26e('0x3f')]=[{'all':!![]}];}_0x462cae=_[_0xa26e('0x3a')]({},_0x462cae,_0x40e786['options']);return db[_0xa26e('0x28')][_0xa26e('0x44')](_0x462cae)[_0xa26e('0x41')](handleEntityNotFound(_0x3bc4ed,null))[_0xa26e('0x41')](respondWithResult(_0x3bc4ed,null))[_0xa26e('0x45')](handleError(_0x3bc4ed,null));};exports[_0xa26e('0x46')]=function(_0x263209,_0x404f89){return db[_0xa26e('0x28')]['create'](_0x263209[_0xa26e('0x47')],{})[_0xa26e('0x41')](respondWithResult(_0x404f89,0xc9))[_0xa26e('0x45')](handleError(_0x404f89,null));};exports[_0xa26e('0x23')]=function(_0x4c96fa,_0x31ba9){if(_0x4c96fa[_0xa26e('0x47')]['id']){delete _0x4c96fa[_0xa26e('0x47')]['id'];}return db[_0xa26e('0x28')][_0xa26e('0x44')]({'where':{'id':_0x4c96fa['params']['id']}})['then'](handleEntityNotFound(_0x31ba9,null))['then'](saveUpdates(_0x4c96fa[_0xa26e('0x47')],null))[_0xa26e('0x41')](respondWithResult(_0x31ba9,null))[_0xa26e('0x45')](handleError(_0x31ba9,null));};exports['destroy']=function(_0x300c24,_0x260fce){return db[_0xa26e('0x28')][_0xa26e('0x44')]({'where':{'id':_0x300c24[_0xa26e('0x43')]['id']}})[_0xa26e('0x41')](handleEntityNotFound(_0x260fce,null))[_0xa26e('0x41')](removeEntity(_0x260fce,null))[_0xa26e('0x45')](handleError(_0x260fce,null));};exports[_0xa26e('0x48')]=function(_0x30bf4e,_0x3326a4,_0x57b078){return db[_0xa26e('0x49')]['find']({'where':{'id':_0x30bf4e[_0xa26e('0x43')]['id']}})['then'](handleEntityNotFound(_0x3326a4,null))[_0xa26e('0x41')](function(_0x5e397b){if(_0x5e397b){return _0x5e397b[_0xa26e('0x48')](_0x30bf4e[_0xa26e('0x47')][_0xa26e('0x4a')],_[_0xa26e('0x4b')](_0x30bf4e['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x3326a4,null))[_0xa26e('0x45')](handleError(_0x3326a4,null));};exports['getConditions']=function(_0x682178,_0x31c700,_0x2b3927){var _0x3bd38c={};var _0x354bb2={};var _0x3fb090;var _0x11d7d6;return db[_0xa26e('0x28')][_0xa26e('0x4c')]({'where':{'id':_0x682178[_0xa26e('0x43')]['id']}})['then'](handleEntityNotFound(_0x31c700,null))[_0xa26e('0x41')](function(_0x31b4bd){if(_0x31b4bd){_0x3fb090=_0x31b4bd;_0x354bb2['model']=_['keys'](db[_0xa26e('0x49')][_0xa26e('0x29')]);_0x354bb2['query']=_[_0xa26e('0x2e')](_0x682178[_0xa26e('0x2d')]);_0x354bb2[_0xa26e('0x37')]=_[_0xa26e('0x2f')](_0x354bb2['model'],_0x354bb2[_0xa26e('0x2d')]);_0x3bd38c['attributes']=_[_0xa26e('0x2f')](_0x354bb2[_0xa26e('0x2b')],qs[_0xa26e('0x31')](_0x682178[_0xa26e('0x2d')][_0xa26e('0x31')]));_0x3bd38c['attributes']=_0x3bd38c[_0xa26e('0x30')]['length']?_0x3bd38c[_0xa26e('0x30')]:_0x354bb2['model'];_0x3bd38c['order']=qs['sort'](_0x682178[_0xa26e('0x2d')][_0xa26e('0x35')]);_0x3bd38c[_0xa26e('0x39')]=qs[_0xa26e('0x37')](_['pick'](_0x682178[_0xa26e('0x2d')],_0x354bb2['filters']));if(_0x682178[_0xa26e('0x2d')][_0xa26e('0x38')]){_0x3bd38c['where']=_['merge'](_0x3bd38c['where'],{'$or':_[_0xa26e('0x2c')](_0x3bd38c[_0xa26e('0x30')],function(_0x44204c){var _0x4062f6={};_0x4062f6[_0x44204c]={'$like':'%'+_0x682178[_0xa26e('0x2d')][_0xa26e('0x38')]+'%'};return _0x4062f6;})});}_0x3bd38c=_[_0xa26e('0x3a')]({},_0x3bd38c,_0x682178[_0xa26e('0x3d')]);return _0x3fb090['getConditions'](_0x3bd38c);}})[_0xa26e('0x41')](function(_0xde3453){if(_0xde3453){_0x11d7d6=_0xde3453[_0xa26e('0x32')];if(!_0x682178[_0xa26e('0x2d')][_0xa26e('0x33')](_0xa26e('0x34'))){_0x3bd38c[_0xa26e('0x1c')]=qs[_0xa26e('0x1c')](_0x682178[_0xa26e('0x2d')][_0xa26e('0x1c')]);_0x3bd38c[_0xa26e('0x1a')]=qs['offset'](_0x682178[_0xa26e('0x2d')][_0xa26e('0x1a')]);}return _0x3fb090[_0xa26e('0x4d')](_0x3bd38c);}})[_0xa26e('0x41')](function(_0x525a3d){if(_0x525a3d){return _0x525a3d?{'count':_0x11d7d6,'rows':_0x525a3d}:null;}})[_0xa26e('0x41')](respondWithResult(_0x31c700,null))['catch'](handleError(_0x31c700,null));};exports['addActions']=function(_0x3abadb,_0x25e15d,_0xc01922){return db[_0xa26e('0x4e')]['find']({'where':{'id':_0x3abadb[_0xa26e('0x43')]['id']}})[_0xa26e('0x41')](handleEntityNotFound(_0x25e15d,null))['then'](function(_0x7bc968){if(_0x7bc968){return _0x7bc968[_0xa26e('0x4f')](_0x3abadb[_0xa26e('0x47')]['ids'],_[_0xa26e('0x4b')](_0x3abadb[_0xa26e('0x47')],[_0xa26e('0x4a'),'id'])||{});}})[_0xa26e('0x41')](respondWithResult(_0x25e15d,null))[_0xa26e('0x45')](handleError(_0x25e15d,null));};exports[_0xa26e('0x50')]=function(_0x5ab469,_0x1124bb,_0x1fd5b0){var _0x3d92bf={};var _0x29abfa={};var _0x5ed218;var _0x4c056c;return db[_0xa26e('0x28')]['findOne']({'where':{'id':_0x5ab469[_0xa26e('0x43')]['id']}})[_0xa26e('0x41')](handleEntityNotFound(_0x1124bb,null))[_0xa26e('0x41')](function(_0x1b8573){if(_0x1b8573){_0x5ed218=_0x1b8573;_0x29abfa['model']=_[_0xa26e('0x2e')](db['Action'][_0xa26e('0x29')]);_0x29abfa['query']=_[_0xa26e('0x2e')](_0x5ab469[_0xa26e('0x2d')]);_0x29abfa['filters']=_[_0xa26e('0x2f')](_0x29abfa[_0xa26e('0x2b')],_0x29abfa['query']);_0x3d92bf[_0xa26e('0x30')]=_['intersection'](_0x29abfa[_0xa26e('0x2b')],qs['fields'](_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x31')]));_0x3d92bf[_0xa26e('0x30')]=_0x3d92bf['attributes'][_0xa26e('0x32')]?_0x3d92bf[_0xa26e('0x30')]:_0x29abfa[_0xa26e('0x2b')];_0x3d92bf[_0xa26e('0x51')]=qs[_0xa26e('0x35')](_0x5ab469['query'][_0xa26e('0x35')]);_0x3d92bf['where']=qs[_0xa26e('0x37')](_[_0xa26e('0x36')](_0x5ab469[_0xa26e('0x2d')],_0x29abfa[_0xa26e('0x37')]));if(_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x38')]){_0x3d92bf[_0xa26e('0x39')]=_[_0xa26e('0x3a')](_0x3d92bf[_0xa26e('0x39')],{'$or':_[_0xa26e('0x2c')](_0x3d92bf[_0xa26e('0x30')],function(_0x55bfc4){var _0x922e10={};_0x922e10[_0x55bfc4]={'$like':'%'+_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x38')]+'%'};return _0x922e10;})});}_0x3d92bf=_[_0xa26e('0x3a')]({},_0x3d92bf,_0x5ab469[_0xa26e('0x3d')]);return _0x5ed218[_0xa26e('0x50')](_0x3d92bf);}})[_0xa26e('0x41')](function(_0x186bb0){if(_0x186bb0){_0x4c056c=_0x186bb0[_0xa26e('0x32')];if(!_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x33')](_0xa26e('0x34'))){_0x3d92bf['limit']=qs[_0xa26e('0x1c')](_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x1c')]);_0x3d92bf['offset']=qs['offset'](_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x1a')]);}return _0x5ed218[_0xa26e('0x50')](_0x3d92bf);}})[_0xa26e('0x41')](function(_0x1bbd3a){if(_0x1bbd3a){return _0x1bbd3a?{'count':_0x4c056c,'rows':_0x1bbd3a}:null;}})[_0xa26e('0x41')](respondWithResult(_0x1124bb,null))[_0xa26e('0x45')](handleError(_0x1124bb,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 7e7d08c..14765de 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 _0x060f=['request-promise','path','rimraf','./automation.attributes','define','tools_automations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3870ae,_0x969767){var _0x58966d=function(_0x2f6ccb){while(--_0x2f6ccb){_0x3870ae['push'](_0x3870ae['shift']());}};_0x58966d(++_0x969767);}(_0x060f,0x1b3));var _0xf060=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x060f[_0x39bc44];return _0x2916d8;};'use strict';var _=require(_0xf060('0x0'));var util=require('util');var logger=require(_0xf060('0x1'))(_0xf060('0x2'));var moment=require(_0xf060('0x3'));var BPromise=require(_0xf060('0x4'));var rp=require(_0xf060('0x5'));var fs=require('fs');var path=require(_0xf060('0x6'));var rimraf=require(_0xf060('0x7'));var config=require('../../config/environment');var attributes=require(_0xf060('0x8'));module['exports']=function(_0x8ae8c1,_0x2bd10d){return _0x8ae8c1[_0xf060('0x9')]('Automation',attributes,{'tableName':_0xf060('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed0d=['util','../../config/logger','api','moment','request-promise','path','define','tools_automations','lodash'];(function(_0x1aa47e,_0x4fc638){var _0x13d4b7=function(_0x1f5811){while(--_0x1f5811){_0x1aa47e['push'](_0x1aa47e['shift']());}};_0x13d4b7(++_0x4fc638);}(_0xed0d,0x143));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xded0('0x0'));var util=require(_0xded0('0x1'));var logger=require(_0xded0('0x2'))(_0xded0('0x3'));var moment=require(_0xded0('0x4'));var BPromise=require('bluebird');var rp=require(_0xded0('0x5'));var fs=require('fs');var path=require(_0xded0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x211f85,_0x27c13d){return _0x211f85[_0xded0('0x7')]('Automation',attributes,{'tableName':_0xded0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 54ee730..b3adb84 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 _0xa3b7=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x4e76b0,_0x3168de){var _0x5d5358=function(_0x57db2a){while(--_0x57db2a){_0x4e76b0['push'](_0x4e76b0['shift']());}};_0x5d5358(++_0x3168de);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0xa3b7[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x7a3b('0x0'));var util=require('util');var moment=require(_0x7a3b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a3b('0x2'));var fs=require('fs');var Redis=require(_0x7a3b('0x3'));var db=require(_0x7a3b('0x4'))['db'];var utils=require(_0x7a3b('0x5'));var logger=require(_0x7a3b('0x6'))(_0x7a3b('0x7'));var config=require(_0x7a3b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7a3b('0x9')][_0x7a3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31274f,_0x43c083,_0x63f93d){return new BPromise(function(_0x560f45,_0x1d6e53){return client['request'](_0x31274f,_0x63f93d)[_0x7a3b('0xb')](function(_0x60adf9){logger[_0x7a3b('0xc')](_0x7a3b('0xd'),_0x43c083,_0x7a3b('0xe'));logger[_0x7a3b('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x43c083,_0x7a3b('0xe'),JSON[_0x7a3b('0x10')](_0x60adf9));if(_0x60adf9[_0x7a3b('0x11')]){if(_0x60adf9['error'][_0x7a3b('0x12')]===0x1f4){logger[_0x7a3b('0x11')]('Automation,\x20%s,\x20%s',_0x43c083,_0x60adf9[_0x7a3b('0x11')][_0x7a3b('0x13')]);return _0x1d6e53(_0x60adf9[_0x7a3b('0x11')]['message']);}logger[_0x7a3b('0x11')](_0x7a3b('0xd'),_0x43c083,_0x60adf9[_0x7a3b('0x11')]['message']);return _0x560f45(_0x60adf9[_0x7a3b('0x11')][_0x7a3b('0x13')]);}else{logger['info'](_0x7a3b('0xd'),_0x43c083,_0x7a3b('0xe'));_0x560f45(_0x60adf9[_0x7a3b('0x14')]['message']);}})[_0x7a3b('0x15')](function(_0x414a5b){logger['error'](_0x7a3b('0xd'),_0x43c083,_0x414a5b);_0x1d6e53(_0x414a5b);});});} \ No newline at end of file +var _0x23bb=['stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','debug'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x23bb,0x79));var _0xb23b=function(_0x330a95,_0x2b0fe3){_0x330a95=_0x330a95-0x0;var _0xb9a8d=_0x23bb[_0x330a95];return _0xb9a8d;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb23b('0x1'));var rs=require(_0xb23b('0x2'));var fs=require('fs');var Redis=require(_0xb23b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb23b('0x4'));var logger=require(_0xb23b('0x5'))(_0xb23b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb23b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c5626,_0x4a2873,_0x596a94){return new BPromise(function(_0x29e8e9,_0x4d00fe){return client[_0xb23b('0x8')](_0x4c5626,_0x596a94)['then'](function(_0x23270c){logger[_0xb23b('0x9')]('Automation,\x20%s,\x20%s',_0x4a2873,_0xb23b('0xa'));logger[_0xb23b('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x4a2873,_0xb23b('0xa'),JSON[_0xb23b('0xc')](_0x23270c));if(_0x23270c[_0xb23b('0xd')]){if(_0x23270c['error'][_0xb23b('0xe')]===0x1f4){logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);return _0x4d00fe(_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);}logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);return _0x29e8e9(_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);}else{logger[_0xb23b('0x9')](_0xb23b('0xf'),_0x4a2873,_0xb23b('0xa'));_0x29e8e9(_0x23270c[_0xb23b('0x11')]['message']);}})[_0xb23b('0x12')](function(_0x3c5852){logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x3c5852);_0x4d00fe(_0x3c5852);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 138d0fa..bf7577c 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 _0xd89f=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions','post','addActions','update','destroy'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xd89f,0x191));var _0xfd89=function(_0x4696d6,_0x27b551){_0x4696d6=_0x4696d6-0x0;var _0x19f53d=_0xd89f[_0x4696d6];return _0x19f53d;};'use strict';var multer=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var path=require(_0xfd89('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd89('0x3'));var router=express[_0xfd89('0x4')]();var fs_extra=require(_0xfd89('0x5'));var auth=require(_0xfd89('0x6'));var interaction=require(_0xfd89('0x7'));var config=require(_0xfd89('0x8'));var controller=require('./automation.controller');router[_0xfd89('0x9')]('/',auth[_0xfd89('0xa')](),controller[_0xfd89('0xb')]);router[_0xfd89('0x9')](_0xfd89('0xc'),auth[_0xfd89('0xa')](),controller[_0xfd89('0xd')]);router[_0xfd89('0x9')](_0xfd89('0xe'),auth[_0xfd89('0xa')](),controller[_0xfd89('0xf')]);router[_0xfd89('0x9')](_0xfd89('0x10'),auth[_0xfd89('0xa')](),controller[_0xfd89('0x11')]);router['post']('/',auth[_0xfd89('0xa')](),controller[_0xfd89('0x12')]);router['post']('/:id/conditions',auth[_0xfd89('0xa')](),controller[_0xfd89('0x13')]);router[_0xfd89('0x14')](_0xfd89('0x10'),auth['isAuthenticated'](),controller[_0xfd89('0x15')]);router['put'](_0xfd89('0xc'),auth[_0xfd89('0xa')](),controller[_0xfd89('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfd89('0x17')]);module[_0xfd89('0x18')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x3e74,0x175));var _0x43e7=function(_0x3af4b9,_0x3b01a1){_0x3af4b9=_0x3af4b9-0x0;var _0xcadb14=_0x3e74[_0x3af4b9];return _0xcadb14;};'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/actions',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['post']('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xf')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0xf')](_0x43e7('0x11'),auth[_0x43e7('0x8')](),controller['addActions']);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index ef9a961..eba16d6 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 _0x025c=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\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\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x025c,0x128));var _0xc025=function(_0x471351,_0x2777eb){_0x471351=_0x471351-0x0;var _0x4a1c5b=_0x025c[_0x471351];return _0x4a1c5b;};'use strict';var Sequelize=require(_0xc025('0x0'));module[_0xc025('0x1')]={'name':{'type':Sequelize[_0xc025('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc025('0x3')](_0xc025('0x4')),'allowNull':![],'defaultValue':_0xc025('0x4')},'description':{'type':Sequelize[_0xc025('0x2')]},'active':{'type':Sequelize[_0xc025('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xc025('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc025('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc025('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc025('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'comment':_0xc025('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc025('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc025('0x2')],'defaultValue':_0xc025('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xc025('0x3')](_0xc025('0x12'),_0xc025('0x13'),_0xc025('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xc025('0x5')],'defaultValue':0x0,'comment':_0xc025('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xc025('0x6')](0x9)[_0xc025('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc025('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xc025('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc025('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc025('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc025('0x6')](0x9)[_0xc025('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc025('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0xc025('0x6')](0x9)[_0xc025('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc025('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc025('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc025('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc025('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc025('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc025('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc025('0x1e'),_0xc025('0x1f')),'defaultValue':_0xc025('0x1e')},'dialPrefix':{'type':Sequelize[_0xc025('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc025('0x20')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc025('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc025('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x27')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x8e11=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#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)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x8e11,0x11d));var _0x18e1=function(_0x4ebf10,_0x2ea42a){_0x4ebf10=_0x4ebf10-0x0;var _0x12453b=_0x8e11[_0x4ebf10];return _0x12453b;};'use strict';var Sequelize=require('sequelize');module[_0x18e1('0x0')]={'name':{'type':Sequelize[_0x18e1('0x1')],'unique':_0x18e1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x18e1('0x3')](_0x18e1('0x4')),'allowNull':![],'defaultValue':_0x18e1('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x18e1('0x5')],'defaultValue':0x0,'comment':_0x18e1('0x6')},'limitCalls':{'type':Sequelize[_0x18e1('0x7')](0x4)[_0x18e1('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x18e1('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x18e1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x18e1('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x18e1('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x18e1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x18e1('0xe'),_0x18e1('0xf'),_0x18e1('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x18e1('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x18e1('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x18e1('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x18e1('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x18e1('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x18e1('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x18e1('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x18e1('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x18e1('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x18e1('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x18e1('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x18e1('0x3')](_0x18e1('0x17'),'ASC'),'defaultValue':_0x18e1('0x17')},'dialPrefix':{'type':Sequelize[_0x18e1('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18e1('0x18')},'dialCutDigit':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18e1('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x21')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 1bd3d4f..2f56481 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 _0xfcef=['filters','intersection','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','updatedAt','omit','body','params','findOne','nolimit','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','NOW()','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','cm_hopper','phone\x20NOT\x20IN\x20(?)','push','removeLists','addBlackLists','sequelize','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show'];(function(_0x44b743,_0x58b597){var _0x24bd58=function(_0x29db9c){while(--_0x29db9c){_0x44b743['push'](_0x44b743['shift']());}};_0x24bd58(++_0x58b597);}(_0xfcef,0x1cc));var _0xffce=function(_0x17aa4f,_0x5146fc){_0x17aa4f=_0x17aa4f-0x0;var _0x1fa956=_0xfcef[_0x17aa4f];return _0x1fa956;};'use strict';var emlformat=require(_0xffce('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xffce('0x1'));var rp=require(_0xffce('0x2'));var moment=require(_0xffce('0x3'));var BPromise=require(_0xffce('0x4'));var Mustache=require(_0xffce('0x5'));var util=require(_0xffce('0x6'));var path=require(_0xffce('0x7'));var sox=require('sox');var csv=require(_0xffce('0x8'));var ejs=require(_0xffce('0x9'));var fs=require('fs');var fs_extra=require(_0xffce('0xa'));var _=require(_0xffce('0xb'));var squel=require('squel');var crypto=require(_0xffce('0xc'));var jsforce=require(_0xffce('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xffce('0x8'));var querystring=require('querystring');var Papa=require(_0xffce('0xe'));var Redis=require('ioredis');var authService=require(_0xffce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xffce('0x10'));var hardwareService=require(_0xffce('0x11'));var logger=require(_0xffce('0x12'))('api');var utils=require(_0xffce('0x13'));var config=require(_0xffce('0x14'));var licenseUtil=require(_0xffce('0x15'));var db=require(_0xffce('0x16'))['db'];function respondWithStatusCode(_0x19be98,_0x560a14){_0x560a14=_0x560a14||0xcc;return function(_0x23815a){if(_0x23815a){return _0x19be98[_0xffce('0x17')](_0x560a14);}return _0x19be98[_0xffce('0x18')](_0x560a14)[_0xffce('0x19')]();};}function respondWithResult(_0x2f5d17,_0x375878){_0x375878=_0x375878||0xc8;return function(_0x37812e){if(_0x37812e){return _0x2f5d17[_0xffce('0x18')](_0x375878)['json'](_0x37812e);}};}function respondWithFilteredResult(_0x2c9bac,_0x51941a){return function(_0x3a646c){if(_0x3a646c){var _0x71a054=typeof _0x51941a[_0xffce('0x1a')]===_0xffce('0x1b')&&typeof _0x51941a['limit']===_0xffce('0x1b');var _0x31a112=_0x3a646c[_0xffce('0x1c')];var _0xd475ef=_0x71a054?0x0:_0x51941a['offset'];var _0x5a8751=_0x71a054?_0x3a646c[_0xffce('0x1c')]:_0x51941a[_0xffce('0x1a')]+_0x51941a[_0xffce('0x1d')];var _0x37ad20;if(_0x5a8751>=_0x31a112){_0x5a8751=_0x31a112;_0x37ad20=0xc8;}else{_0x37ad20=0xce;}_0x2c9bac[_0xffce('0x18')](_0x37ad20);return _0x2c9bac['set'](_0xffce('0x1e'),_0xd475ef+'-'+_0x5a8751+'/'+_0x31a112)[_0xffce('0x1f')](_0x3a646c);}return null;};}function patchUpdates(_0x46daab){return function(_0x43a9b0){try{jsonpatch[_0xffce('0x20')](_0x43a9b0,_0x46daab,!![]);}catch(_0x3e9428){return BPromise[_0xffce('0x21')](_0x3e9428);}return _0x43a9b0['save']();};}function saveUpdates(_0x4bd9c3,_0x200705){return function(_0x1be721){if(_0x1be721){return _0x1be721[_0xffce('0x22')](_0x4bd9c3)[_0xffce('0x23')](function(_0x2f85ea){return _0x2f85ea;});}return null;};}function removeEntity(_0x5e14ba,_0x1c6943){return function(_0x989d97){if(_0x989d97){return _0x989d97['destroy']()[_0xffce('0x23')](function(){var _0x10bae4=_0x989d97[_0xffce('0x24')]({'plain':!![]});var _0x71a4e0=_0xffce('0x25');return db[_0xffce('0x26')][_0xffce('0x27')]({'where':{'type':_0x71a4e0,'resourceId':_0x10bae4['id']}})[_0xffce('0x23')](function(){return _0x989d97;});})[_0xffce('0x23')](function(){_0x5e14ba[_0xffce('0x18')](0xcc)[_0xffce('0x19')]();});}};}function handleEntityNotFound(_0x2d554f,_0x3fab6f){return function(_0x497fe1){if(!_0x497fe1){_0x2d554f['sendStatus'](0x194);}return _0x497fe1;};}function handleError(_0x28b040,_0x17baed){_0x17baed=_0x17baed||0x1f4;return function(_0x2ecfac){logger[_0xffce('0x28')](_0x2ecfac['stack']);if(_0x2ecfac[_0xffce('0x29')]){delete _0x2ecfac[_0xffce('0x29')];}_0x28b040[_0xffce('0x18')](_0x17baed)[_0xffce('0x2a')](_0x2ecfac);};}exports[_0xffce('0x2b')]=function(_0x2cb51c,_0x12ea95){var _0x3230ed={},_0x1a36d9={},_0x11255b={'count':0x0,'rows':[]};var _0xfb329c=_[_0xffce('0x2c')](db[_0xffce('0x2d')][_0xffce('0x2e')],function(_0xfc8473){return{'name':_0xfc8473[_0xffce('0x2f')],'type':_0xfc8473['type'][_0xffce('0x30')]};});_0x1a36d9[_0xffce('0x31')]=_[_0xffce('0x2c')](_0xfb329c,_0xffce('0x29'));_0x1a36d9[_0xffce('0x32')]=_[_0xffce('0x33')](_0x2cb51c['query']);_0x1a36d9['filters']=_['intersection'](_0x1a36d9['model'],_0x1a36d9[_0xffce('0x32')]);_0x3230ed[_0xffce('0x34')]=_['intersection'](_0x1a36d9[_0xffce('0x31')],qs[_0xffce('0x35')](_0x2cb51c['query']['fields']));_0x3230ed[_0xffce('0x34')]=_0x3230ed['attributes'][_0xffce('0x36')]?_0x3230ed['attributes']:_0x1a36d9[_0xffce('0x31')];if(!_0x2cb51c[_0xffce('0x32')][_0xffce('0x37')]('nolimit')){_0x3230ed[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x2cb51c['query'][_0xffce('0x1d')]);_0x3230ed[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0x2cb51c[_0xffce('0x32')][_0xffce('0x1a')]);}_0x3230ed[_0xffce('0x38')]=qs['sort'](_0x2cb51c[_0xffce('0x32')][_0xffce('0x39')]);_0x3230ed[_0xffce('0x3a')]=qs['filters'](_[_0xffce('0x3b')](_0x2cb51c[_0xffce('0x32')],_0x1a36d9['filters']),_0xfb329c);if(_0x2cb51c[_0xffce('0x32')][_0xffce('0x3c')]){_0x3230ed['where']=_[_0xffce('0x3d')](_0x3230ed['where'],{'$or':_['map'](_0xfb329c,function(_0xd6df69){if(_0xd6df69[_0xffce('0x3e')]!==_0xffce('0x3f')){var _0x518e76={};_0x518e76[_0xd6df69[_0xffce('0x29')]]={'$like':'%'+_0x2cb51c[_0xffce('0x32')][_0xffce('0x3c')]+'%'};return _0x518e76;}})});}_0x3230ed=_[_0xffce('0x3d')]({},_0x3230ed,_0x2cb51c[_0xffce('0x40')]);var _0x5a6c9a={'where':_0x3230ed[_0xffce('0x3a')]};return db[_0xffce('0x2d')][_0xffce('0x1c')](_0x5a6c9a)[_0xffce('0x23')](function(_0x589cf0){_0x11255b[_0xffce('0x1c')]=_0x589cf0;if(_0x2cb51c[_0xffce('0x32')][_0xffce('0x41')]){_0x3230ed['include']=[{'all':!![]}];}return db[_0xffce('0x2d')]['findAll'](_0x3230ed);})[_0xffce('0x23')](function(_0x271cab){_0x11255b[_0xffce('0x42')]=_0x271cab;return _0x11255b;})['then'](respondWithFilteredResult(_0x12ea95,_0x3230ed))['catch'](handleError(_0x12ea95,null));};exports[_0xffce('0x43')]=function(_0x2497d1,_0x2abfb7){var _0x3b9f9a={'raw':![],'where':{'id':_0x2497d1['params']['id']}},_0x323f78={};_0x323f78[_0xffce('0x31')]=_['keys'](db[_0xffce('0x2d')][_0xffce('0x2e')]);_0x323f78['query']=_[_0xffce('0x33')](_0x2497d1[_0xffce('0x32')]);_0x323f78[_0xffce('0x44')]=_['intersection'](_0x323f78[_0xffce('0x31')],_0x323f78[_0xffce('0x32')]);_0x3b9f9a[_0xffce('0x34')]=_[_0xffce('0x45')](_0x323f78[_0xffce('0x31')],qs[_0xffce('0x35')](_0x2497d1['query'][_0xffce('0x35')]));_0x3b9f9a['attributes']=_0x3b9f9a[_0xffce('0x34')][_0xffce('0x36')]?_0x3b9f9a[_0xffce('0x34')]:_0x323f78[_0xffce('0x31')];if(_0x2497d1[_0xffce('0x32')][_0xffce('0x41')]){_0x3b9f9a[_0xffce('0x46')]=[{'all':!![]}];}_0x3b9f9a=_[_0xffce('0x3d')]({},_0x3b9f9a,_0x2497d1[_0xffce('0x40')]);return db['Campaign'][_0xffce('0x47')](_0x3b9f9a)['then'](handleEntityNotFound(_0x2abfb7,null))[_0xffce('0x23')](respondWithResult(_0x2abfb7,null))[_0xffce('0x48')](handleError(_0x2abfb7,null));};exports[_0xffce('0x49')]=function(_0x13376e,_0x477947){return db[_0xffce('0x2d')][_0xffce('0x49')](_0x13376e['body'],{})[_0xffce('0x23')](function(_0x321443){var _0x19a0cf=_0x13376e[_0xffce('0x4a')]['get']({'plain':!![]});if(!_0x19a0cf)throw new Error(_0xffce('0x4b'));if(_0x19a0cf[_0xffce('0x4c')]==='user'){var _0x816855=_0x321443[_0xffce('0x24')]({'plain':!![]});var _0x1b90b7=_0xffce('0x25');return db[_0xffce('0x4d')]['find']({'where':{'name':_0x1b90b7,'userProfileId':_0x19a0cf[_0xffce('0x4e')]},'raw':!![]})[_0xffce('0x23')](function(_0x40a15e){if(_0x40a15e&&_0x40a15e[_0xffce('0x4f')]===0x0){return db[_0xffce('0x26')]['create']({'name':_0x816855[_0xffce('0x29')],'resourceId':_0x816855['id'],'type':_0x40a15e['name'],'sectionId':_0x40a15e['id']},{})['then'](function(){return _0x321443;});}else{return _0x321443;}})[_0xffce('0x48')](function(_0x558853){logger[_0xffce('0x28')](_0xffce('0x50'),_0x558853);throw _0x558853;});}return _0x321443;})[_0xffce('0x23')](respondWithResult(_0x477947,0xc9))[_0xffce('0x48')](handleError(_0x477947,null));};exports['clone']=function(_0x188856,_0x1a37cc){var _0x1e8e49={'where':{'id':_0x188856['params']['id']}},_0x3cda59={};_0x3cda59[_0xffce('0x31')]=_[_0xffce('0x33')](db[_0xffce('0x2d')][_0xffce('0x2e')]);_0x1e8e49[_0xffce('0x34')]=_[_0xffce('0x45')](_0x3cda59[_0xffce('0x31')],qs[_0xffce('0x35')](_0x188856['query'][_0xffce('0x35')]));_0x1e8e49['attributes']=_0x1e8e49[_0xffce('0x34')]['length']?_0x1e8e49[_0xffce('0x34')]:_0x3cda59['model'];if(_0x188856['query'][_0xffce('0x41')]){_0x1e8e49[_0xffce('0x46')]=[{'all':!![]}];}_0x1e8e49=_[_0xffce('0x3d')]({},_0x1e8e49,_0x188856[_0xffce('0x40')]);return db[_0xffce('0x2d')][_0xffce('0x47')](_0x1e8e49)[_0xffce('0x23')](handleEntityNotFound(_0x1a37cc,null))[_0xffce('0x23')](function(_0x18bfe0){if(_0x18bfe0){var _0x5ab159=_0x18bfe0[_0xffce('0x24')]({'plain':!![]});_0x5ab159=qs['omit'](_0x5ab159,['id','createdAt',_0xffce('0x51')]);_0x188856['body']=_[_0xffce('0x52')](_0x188856[_0xffce('0x53')],['id','createdAt','updatedAt']);return db[_0xffce('0x2d')]['create'](_[_0xffce('0x3d')](_0x5ab159,_0x188856[_0xffce('0x53')]),{'include':_0x188856[_0xffce('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x21f959){var _0xa47ca9=_0x188856[_0xffce('0x4a')][_0xffce('0x24')]({'plain':!![]});if(!_0xa47ca9)throw new Error(_0xffce('0x4b'));if(_0xa47ca9[_0xffce('0x4c')]===_0xffce('0x4a')){var _0x9699d3=_0x21f959[_0xffce('0x24')]({'plain':!![]});var _0x1a70e6=_0xffce('0x25');return db[_0xffce('0x4d')][_0xffce('0x47')]({'where':{'name':_0x1a70e6,'userProfileId':_0xa47ca9[_0xffce('0x4e')]},'raw':!![]})[_0xffce('0x23')](function(_0x10b737){if(_0x10b737&&_0x10b737[_0xffce('0x4f')]===0x0){return db[_0xffce('0x26')]['create']({'name':_0x9699d3[_0xffce('0x29')],'resourceId':_0x9699d3['id'],'type':_0x10b737[_0xffce('0x29')],'sectionId':_0x10b737['id']},{})[_0xffce('0x23')](function(){return _0x21f959;});}else{return _0x21f959;}})['catch'](function(_0x820599){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x820599);throw _0x820599;});}return _0x21f959;});}})[_0xffce('0x23')](respondWithResult(_0x1a37cc,0xc9))[_0xffce('0x48')](handleError(_0x1a37cc,null));};exports['update']=function(_0x539660,_0x148d99){if(_0x539660[_0xffce('0x53')]['id']){delete _0x539660['body']['id'];}return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x539660[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x148d99,null))[_0xffce('0x23')](saveUpdates(_0x539660['body'],null))['then'](respondWithResult(_0x148d99,null))[_0xffce('0x48')](handleError(_0x148d99,null));};exports['destroy']=function(_0x40da1,_0x5a3271){return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x40da1[_0xffce('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a3271,null))['then'](removeEntity(_0x5a3271,null))[_0xffce('0x48')](handleError(_0x5a3271,null));};exports['getHoppers']=function(_0x138156,_0x4e3fed,_0x5e8df5){var _0x329dd7={'raw':!![],'where':{}};var _0x26d8d1={};var _0x1f50a9={'count':0x0,'rows':[]};return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0x138156['params']['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x4e3fed,null))[_0xffce('0x23')](function(_0x33f21a){if(_0x33f21a){_0x26d8d1[_0xffce('0x31')]=_['keys'](db['CmHopper'][_0xffce('0x2e')]);_0x26d8d1[_0xffce('0x32')]=_['keys'](_0x138156[_0xffce('0x32')]);_0x26d8d1['filters']=_[_0xffce('0x45')](_0x26d8d1[_0xffce('0x31')],_0x26d8d1['query']);_0x329dd7[_0xffce('0x34')]=_[_0xffce('0x45')](_0x26d8d1['model'],qs[_0xffce('0x35')](_0x138156[_0xffce('0x32')][_0xffce('0x35')]));_0x329dd7[_0xffce('0x34')]=_0x329dd7['attributes']['length']?_0x329dd7['attributes']:_0x26d8d1[_0xffce('0x31')];if(!_0x138156[_0xffce('0x32')][_0xffce('0x37')](_0xffce('0x56'))){_0x329dd7[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x138156[_0xffce('0x32')][_0xffce('0x1d')]);_0x329dd7['offset']=qs['offset'](_0x138156['query'][_0xffce('0x1a')]);}_0x329dd7['order']=qs['sort'](_0x138156[_0xffce('0x32')][_0xffce('0x39')]);_0x329dd7[_0xffce('0x3a')]=qs[_0xffce('0x44')](_['pick'](_0x138156[_0xffce('0x32')],_0x26d8d1[_0xffce('0x44')]));_0x329dd7[_0xffce('0x3a')][_0xffce('0x57')]=_0x33f21a['id'];if(_0x138156['query'][_0xffce('0x3c')]){_0x329dd7[_0xffce('0x3a')]=_['merge'](_0x329dd7['where'],{'$or':_[_0xffce('0x2c')](_0x329dd7[_0xffce('0x34')],function(_0x5e6d39){var _0x4af4e3={};_0x4af4e3[_0x5e6d39]={'$like':'%'+_0x138156['query'][_0xffce('0x3c')]+'%'};return _0x4af4e3;})});}_0x329dd7=_['merge']({},_0x329dd7,_0x138156[_0xffce('0x40')]);return db[_0xffce('0x58')][_0xffce('0x1c')]({'where':_0x329dd7['where']})[_0xffce('0x23')](function(_0x5c5685){_0x1f50a9[_0xffce('0x1c')]=_0x5c5685;if(_0x138156[_0xffce('0x32')]['includeAll']){_0x329dd7[_0xffce('0x46')]=[{'all':!![]}];}return db[_0xffce('0x58')][_0xffce('0x59')](_0x329dd7);})[_0xffce('0x23')](function(_0xd9272a){_0x1f50a9[_0xffce('0x42')]=_0xd9272a;return _0x1f50a9;});}})[_0xffce('0x23')](respondWithFilteredResult(_0x4e3fed,_0x329dd7))[_0xffce('0x48')](handleError(_0x4e3fed,null));};exports[_0xffce('0x5a')]=function(_0xacb476,_0x40ba7f,_0x16ff46){var _0x51e531={'raw':!![],'where':{}};var _0x1ff0b0={};var _0x2690a7={'count':0x0,'rows':[]};return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0xacb476['params']['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x40ba7f,null))[_0xffce('0x23')](function(_0x3f08b7){if(_0x3f08b7){_0x1ff0b0[_0xffce('0x31')]=_[_0xffce('0x33')](db['CmHopperHistory'][_0xffce('0x2e')]);_0x1ff0b0[_0xffce('0x32')]=_[_0xffce('0x33')](_0xacb476[_0xffce('0x32')]);_0x1ff0b0[_0xffce('0x44')]=_['intersection'](_0x1ff0b0[_0xffce('0x31')],_0x1ff0b0[_0xffce('0x32')]);_0x51e531[_0xffce('0x34')]=_[_0xffce('0x45')](_0x1ff0b0[_0xffce('0x31')],qs['fields'](_0xacb476[_0xffce('0x32')][_0xffce('0x35')]));_0x51e531[_0xffce('0x34')]=_0x51e531[_0xffce('0x34')]['length']?_0x51e531[_0xffce('0x34')]:_0x1ff0b0[_0xffce('0x31')];if(!_0xacb476['query'][_0xffce('0x37')](_0xffce('0x56'))){_0x51e531[_0xffce('0x1d')]=qs['limit'](_0xacb476[_0xffce('0x32')][_0xffce('0x1d')]);_0x51e531[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0xacb476[_0xffce('0x32')]['offset']);}_0x51e531[_0xffce('0x38')]=qs[_0xffce('0x39')](_0xacb476[_0xffce('0x32')]['sort']);_0x51e531[_0xffce('0x3a')]=qs[_0xffce('0x44')](_['pick'](_0xacb476[_0xffce('0x32')],_0x1ff0b0[_0xffce('0x44')]));_0x51e531[_0xffce('0x3a')][_0xffce('0x57')]=_0x3f08b7['id'];if(_0xacb476[_0xffce('0x32')]['filter']){_0x51e531[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x51e531[_0xffce('0x3a')],{'$or':_['map'](_0x51e531[_0xffce('0x34')],function(_0x5e8480){var _0x4974de={};_0x4974de[_0x5e8480]={'$like':'%'+_0xacb476[_0xffce('0x32')]['filter']+'%'};return _0x4974de;})});}_0x51e531=_[_0xffce('0x3d')]({},_0x51e531,_0xacb476[_0xffce('0x40')]);return db['CmHopperHistory']['count']({'where':_0x51e531['where']})[_0xffce('0x23')](function(_0x1657f8){_0x2690a7['count']=_0x1657f8;if(_0xacb476['query'][_0xffce('0x41')]){_0x51e531[_0xffce('0x46')]=[{'all':!![]}];}return db[_0xffce('0x5b')][_0xffce('0x59')](_0x51e531);})['then'](function(_0xbaac4c){_0x2690a7['rows']=_0xbaac4c;return _0x2690a7;});}})[_0xffce('0x23')](respondWithFilteredResult(_0x40ba7f,_0x51e531))['catch'](handleError(_0x40ba7f,null));};exports[_0xffce('0x5c')]=function(_0x36e60f,_0x9387f2,_0x408b21){var _0xebefea={'raw':!![],'where':{}};var _0x2d55ea={};var _0x372f94={'count':0x0,'rows':[]};return db['Campaign'][_0xffce('0x55')]({'where':{'id':_0x36e60f[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x9387f2,null))[_0xffce('0x23')](function(_0x5a1a24){if(_0x5a1a24){_0x2d55ea[_0xffce('0x31')]=_[_0xffce('0x33')](db['CmHopperFinal'][_0xffce('0x2e')]);_0x2d55ea[_0xffce('0x32')]=_[_0xffce('0x33')](_0x36e60f['query']);_0x2d55ea[_0xffce('0x44')]=_['intersection'](_0x2d55ea[_0xffce('0x31')],_0x2d55ea[_0xffce('0x32')]);_0xebefea[_0xffce('0x34')]=_[_0xffce('0x45')](_0x2d55ea[_0xffce('0x31')],qs['fields'](_0x36e60f[_0xffce('0x32')][_0xffce('0x35')]));_0xebefea['attributes']=_0xebefea[_0xffce('0x34')][_0xffce('0x36')]?_0xebefea[_0xffce('0x34')]:_0x2d55ea[_0xffce('0x31')];if(!_0x36e60f[_0xffce('0x32')][_0xffce('0x37')](_0xffce('0x56'))){_0xebefea['limit']=qs[_0xffce('0x1d')](_0x36e60f[_0xffce('0x32')]['limit']);_0xebefea[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0x36e60f[_0xffce('0x32')][_0xffce('0x1a')]);}_0xebefea[_0xffce('0x38')]=qs[_0xffce('0x39')](_0x36e60f[_0xffce('0x32')]['sort']);_0xebefea[_0xffce('0x3a')]=qs[_0xffce('0x44')](_[_0xffce('0x3b')](_0x36e60f[_0xffce('0x32')],_0x2d55ea[_0xffce('0x44')]));_0xebefea[_0xffce('0x3a')][_0xffce('0x57')]=_0x5a1a24['id'];if(_0x36e60f[_0xffce('0x32')][_0xffce('0x3c')]){_0xebefea[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0xebefea[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0xebefea[_0xffce('0x34')],function(_0xec8e67){var _0xdafbe6={};_0xdafbe6[_0xec8e67]={'$like':'%'+_0x36e60f[_0xffce('0x32')]['filter']+'%'};return _0xdafbe6;})});}_0xebefea=_['merge']({},_0xebefea,_0x36e60f[_0xffce('0x40')]);return db[_0xffce('0x5d')]['count']({'where':_0xebefea['where']})['then'](function(_0x25a9d2){_0x372f94[_0xffce('0x1c')]=_0x25a9d2;if(_0x36e60f[_0xffce('0x32')][_0xffce('0x41')]){_0xebefea[_0xffce('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xffce('0x59')](_0xebefea);})['then'](function(_0x13a07c){_0x372f94[_0xffce('0x42')]=_0x13a07c;return _0x372f94;});}})['then'](respondWithFilteredResult(_0x9387f2,_0xebefea))['catch'](handleError(_0x9387f2,null));};exports[_0xffce('0x5e')]=function(_0x447e2a,_0xb624ed,_0x33ed9b){var _0x5c0dc3={'raw':!![],'where':{}};var _0x7f9361={};var _0x4f1091={'count':0x0,'rows':[]};return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0x447e2a[_0xffce('0x54')]['id']}})['then'](handleEntityNotFound(_0xb624ed,null))[_0xffce('0x23')](function(_0x2957ca){if(_0x2957ca){_0x7f9361[_0xffce('0x31')]=_[_0xffce('0x33')](db[_0xffce('0x5f')][_0xffce('0x2e')]);_0x7f9361['query']=_[_0xffce('0x33')](_0x447e2a[_0xffce('0x32')]);_0x7f9361[_0xffce('0x44')]=_[_0xffce('0x45')](_0x7f9361[_0xffce('0x31')],_0x7f9361[_0xffce('0x32')]);_0x5c0dc3[_0xffce('0x34')]=_['intersection'](_0x7f9361[_0xffce('0x31')],qs['fields'](_0x447e2a['query'][_0xffce('0x35')]));_0x5c0dc3[_0xffce('0x34')]=_0x5c0dc3['attributes'][_0xffce('0x36')]?_0x5c0dc3[_0xffce('0x34')]:_0x7f9361[_0xffce('0x31')];if(!_0x447e2a['query']['hasOwnProperty'](_0xffce('0x56'))){_0x5c0dc3[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x447e2a[_0xffce('0x32')][_0xffce('0x1d')]);_0x5c0dc3[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0x447e2a[_0xffce('0x32')]['offset']);}_0x5c0dc3['order']=qs['sort'](_0x447e2a[_0xffce('0x32')][_0xffce('0x39')]);_0x5c0dc3[_0xffce('0x3a')]=qs[_0xffce('0x44')](_[_0xffce('0x3b')](_0x447e2a[_0xffce('0x32')],_0x7f9361[_0xffce('0x44')]));_0x5c0dc3[_0xffce('0x3a')][_0xffce('0x57')]=_0x2957ca['id'];if(_0x447e2a[_0xffce('0x32')]['filter']){_0x5c0dc3[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x5c0dc3[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0x5c0dc3[_0xffce('0x34')],function(_0x3e3c67){var _0x1ca0d6={};_0x1ca0d6[_0x3e3c67]={'$like':'%'+_0x447e2a['query']['filter']+'%'};return _0x1ca0d6;})});}_0x5c0dc3=_[_0xffce('0x3d')]({},_0x5c0dc3,_0x447e2a[_0xffce('0x40')]);return db['CmHopperBlack'][_0xffce('0x1c')]({'where':_0x5c0dc3[_0xffce('0x3a')]})[_0xffce('0x23')](function(_0x4c691e){_0x4f1091[_0xffce('0x1c')]=_0x4c691e;if(_0x447e2a['query'][_0xffce('0x41')]){_0x5c0dc3[_0xffce('0x46')]=[{'all':!![]}];}return db[_0xffce('0x5f')][_0xffce('0x59')](_0x5c0dc3);})[_0xffce('0x23')](function(_0x193731){_0x4f1091['rows']=_0x193731;return _0x4f1091;});}})['then'](respondWithFilteredResult(_0xb624ed,_0x5c0dc3))[_0xffce('0x48')](handleError(_0xb624ed,null));};exports[_0xffce('0x60')]=function(_0x1c8f16,_0x59f60b,_0x3f8cfb){var _0x4c9fdb={};var _0x5a296f={};var _0x1222ba;var _0x4276a1;return db[_0xffce('0x2d')]['findOne']({'where':{'id':_0x1c8f16[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x59f60b,null))[_0xffce('0x23')](function(_0x39e1dd){if(_0x39e1dd){_0x1222ba=_0x39e1dd;_0x5a296f[_0xffce('0x31')]=_[_0xffce('0x33')](db[_0xffce('0x61')][_0xffce('0x2e')]);_0x5a296f[_0xffce('0x32')]=_[_0xffce('0x33')](_0x1c8f16[_0xffce('0x32')]);_0x5a296f['filters']=_['intersection'](_0x5a296f[_0xffce('0x31')],_0x5a296f[_0xffce('0x32')]);_0x4c9fdb[_0xffce('0x34')]=_[_0xffce('0x45')](_0x5a296f[_0xffce('0x31')],qs[_0xffce('0x35')](_0x1c8f16[_0xffce('0x32')]['fields']));_0x4c9fdb[_0xffce('0x34')]=_0x4c9fdb['attributes'][_0xffce('0x36')]?_0x4c9fdb[_0xffce('0x34')]:_0x5a296f['model'];_0x4c9fdb[_0xffce('0x38')]=qs[_0xffce('0x39')](_0x1c8f16['query']['sort']);_0x4c9fdb[_0xffce('0x3a')]=qs[_0xffce('0x44')](_['pick'](_0x1c8f16[_0xffce('0x32')],_0x5a296f[_0xffce('0x44')]));if(_0x1c8f16['query'][_0xffce('0x3c')]){_0x4c9fdb[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x4c9fdb[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0x4c9fdb[_0xffce('0x34')],function(_0x401ed5){var _0x5e894a={};_0x5e894a[_0x401ed5]={'$like':'%'+_0x1c8f16[_0xffce('0x32')][_0xffce('0x3c')]+'%'};return _0x5e894a;})});}_0x4c9fdb=_[_0xffce('0x3d')]({},_0x4c9fdb,_0x1c8f16[_0xffce('0x40')]);return _0x1222ba[_0xffce('0x60')](_0x4c9fdb);}})[_0xffce('0x23')](function(_0x54aa10){if(_0x54aa10){_0x4276a1=_0x54aa10[_0xffce('0x36')];if(!_0x1c8f16[_0xffce('0x32')][_0xffce('0x37')](_0xffce('0x56'))){_0x4c9fdb[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x1c8f16[_0xffce('0x32')]['limit']);_0x4c9fdb[_0xffce('0x1a')]=qs['offset'](_0x1c8f16[_0xffce('0x32')][_0xffce('0x1a')]);}return _0x1222ba[_0xffce('0x60')](_0x4c9fdb);}})[_0xffce('0x23')](function(_0x244ec3){if(_0x244ec3){return _0x244ec3?{'count':_0x4276a1,'rows':_0x244ec3}:null;}})[_0xffce('0x23')](respondWithResult(_0x59f60b,null))[_0xffce('0x48')](handleError(_0x59f60b,null));};exports[_0xffce('0x62')]=function(_0x8d89c7,_0xe12ac0,_0x2d0a6e){var _0x473b81,_0x49b9b4;return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x8d89c7[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0xe12ac0,null))['then'](function(_0x3d5e1d){if(_0x3d5e1d){_0x49b9b4=_0x3d5e1d;return _0x3d5e1d[_0xffce('0x62')](_0x8d89c7[_0xffce('0x53')]['ids'],_[_0xffce('0x52')](_0x8d89c7['body'],[_0xffce('0x63'),'id'])||{});}return null;})[_0xffce('0x64')](function(_0xb3384f){var _0x2be7cd;_0x473b81=_0xb3384f||[];var _0x1dbc20=[];if(_0xb3384f){for(var _0x53af64=0x0;_0x53af64<_0xb3384f['length'];_0x53af64+=0x1){var _0x2cf5eb=_0xb3384f[_0x53af64][_0xffce('0x24')]({'plain':!![]});_0x49b9b4['dialCheckDuplicateType']=_0x8d89c7['body']['dialCheckDuplicateType']?_0x8d89c7[_0xffce('0x53')][_0xffce('0x65')]:_0x49b9b4[_0xffce('0x65')];switch(_0x49b9b4['dialCheckDuplicateType']){case _0xffce('0x66'):_0x2be7cd=squel[_0xffce('0x67')]()[_0xffce('0x68')]('cm_hopper')[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6b'),_0xffce('0x6c'),_0xffce('0x6d'),_0xffce('0x57'),_0xffce('0x6e'),_0xffce('0x51')],squel['select']()['field'](_0xffce('0x6a'),_0xffce('0x6a'))['field'](_0xffce('0x6f'),_0xffce('0x6b'))[_0xffce('0x70')]('id',_0xffce('0x6c'))['field'](_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x8d89c7[_0xffce('0x54')]['id']['toString'](),'CampaignId')[_0xffce('0x70')]('NOW()',_0xffce('0x6e'))['field']('NOW()',_0xffce('0x51'))[_0xffce('0x73')](_0xffce('0x74'))[_0xffce('0x3a')](_0xffce('0x75'))[_0xffce('0x3a')](_0xffce('0x76'),_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')]())['where'](_0xffce('0x77'))[_0xffce('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xffce('0x70')](_0xffce('0x78'))['from'](_0xffce('0x79'))['where'](_0xffce('0x7a'),_0x8d89c7['params']['id'][_0xffce('0x72')]()))[_0xffce('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xffce('0x7b')]()['field'](_0xffce('0x7c'))[_0xffce('0x73')](_0xffce('0x7d'))[_0xffce('0x3a')]('CampaignId\x20=\x20?',_0x8d89c7['params']['id'][_0xffce('0x72')]())))[_0xffce('0x72')]();break;case'onlyIfOpen':_0x2be7cd=squel[_0xffce('0x67')]()['into'](_0xffce('0x7d'))[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6b'),_0xffce('0x6c'),'ListId','CampaignId','createdAt',_0xffce('0x51')],squel[_0xffce('0x7b')]()[_0xffce('0x70')](_0xffce('0x6a'),_0xffce('0x6a'))['field'](_0xffce('0x6f'),_0xffce('0x6b'))['field']('id',_0xffce('0x6c'))[_0xffce('0x70')](_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x8d89c7[_0xffce('0x54')]['id'][_0xffce('0x72')](),'CampaignId')[_0xffce('0x70')](_0xffce('0x6f'),_0xffce('0x6e'))[_0xffce('0x70')]('NOW()',_0xffce('0x51'))[_0xffce('0x73')]('cm_contacts')[_0xffce('0x3a')](_0xffce('0x75'))['where'](_0xffce('0x76'),_0x2cf5eb['CmListId']['toString']())[_0xffce('0x3a')](_0xffce('0x77'))[_0xffce('0x3a')](_0xffce('0x7e'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xffce('0x73')](_0xffce('0x7d'))[_0xffce('0x3a')](_0xffce('0x7a'),_0x8d89c7['params']['id'][_0xffce('0x72')]())))[_0xffce('0x72')]();break;default:_0x2be7cd=squel[_0xffce('0x67')]()['into'](_0xffce('0x7d'))[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6b'),_0xffce('0x6c'),'ListId',_0xffce('0x57'),_0xffce('0x6e'),'updatedAt'],squel[_0xffce('0x7b')]()[_0xffce('0x70')](_0xffce('0x6a'),_0xffce('0x6a'))[_0xffce('0x70')](_0xffce('0x6f'),_0xffce('0x6b'))[_0xffce('0x70')]('id',_0xffce('0x6c'))[_0xffce('0x70')](_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x8d89c7[_0xffce('0x54')]['id'][_0xffce('0x72')](),'CampaignId')[_0xffce('0x70')](_0xffce('0x6f'),_0xffce('0x6e'))[_0xffce('0x70')]('NOW()',_0xffce('0x51'))[_0xffce('0x73')]('cm_contacts')[_0xffce('0x3a')](_0xffce('0x75'))[_0xffce('0x3a')](_0xffce('0x76'),_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')]())[_0xffce('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xffce('0x72')]();}_0x1dbc20[_0xffce('0x7f')](db['sequelize'][_0xffce('0x32')](_0x2be7cd));}return BPromise['all'](_0x1dbc20);}})[_0xffce('0x23')](function(){return _0x473b81;})[_0xffce('0x23')](respondWithResult(_0xe12ac0,null))[_0xffce('0x48')](handleError(_0xe12ac0,null));};exports[_0xffce('0x80')]=function(_0xe4b627,_0x1c61ce,_0x3e169b){return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0xe4b627['params']['id']}})['then'](handleEntityNotFound(_0x1c61ce,null))['then'](function(_0x3f5861){if(_0x3f5861){return _0x3f5861[_0xffce('0x80')](_0xe4b627[_0xffce('0x32')][_0xffce('0x63')]);}})[_0xffce('0x23')](function(_0xd3298e){if(_0xd3298e){return db[_0xffce('0x58')][_0xffce('0x27')]({'where':{'ListId':_0xe4b627[_0xffce('0x32')][_0xffce('0x63')],'CampaignId':_0xe4b627[_0xffce('0x54')]['id']}})[_0xffce('0x23')](function(){return _0xd3298e;});}})[_0xffce('0x23')](respondWithStatusCode(_0x1c61ce,null))['catch'](handleError(_0x1c61ce,null));};exports['getBlackLists']=function(_0xd20b55,_0x37c68c,_0x578cea){var _0x59daf8={};var _0x455918={};var _0x3f5cc6;var _0xe61f73;return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0xd20b55[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x37c68c,null))[_0xffce('0x23')](function(_0x4a77fb){if(_0x4a77fb){_0x3f5cc6=_0x4a77fb;_0x455918[_0xffce('0x31')]=_[_0xffce('0x33')](db['CmList'][_0xffce('0x2e')]);_0x455918['query']=_['keys'](_0xd20b55[_0xffce('0x32')]);_0x455918[_0xffce('0x44')]=_[_0xffce('0x45')](_0x455918[_0xffce('0x31')],_0x455918['query']);_0x59daf8[_0xffce('0x34')]=_[_0xffce('0x45')](_0x455918['model'],qs[_0xffce('0x35')](_0xd20b55[_0xffce('0x32')][_0xffce('0x35')]));_0x59daf8[_0xffce('0x34')]=_0x59daf8['attributes'][_0xffce('0x36')]?_0x59daf8[_0xffce('0x34')]:_0x455918['model'];_0x59daf8[_0xffce('0x38')]=qs[_0xffce('0x39')](_0xd20b55[_0xffce('0x32')][_0xffce('0x39')]);_0x59daf8[_0xffce('0x3a')]=qs[_0xffce('0x44')](_[_0xffce('0x3b')](_0xd20b55[_0xffce('0x32')],_0x455918[_0xffce('0x44')]));if(_0xd20b55[_0xffce('0x32')]['filter']){_0x59daf8[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x59daf8[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0x59daf8[_0xffce('0x34')],function(_0x173b37){var _0xdb8e19={};_0xdb8e19[_0x173b37]={'$like':'%'+_0xd20b55[_0xffce('0x32')][_0xffce('0x3c')]+'%'};return _0xdb8e19;})});}_0x59daf8=_[_0xffce('0x3d')]({},_0x59daf8,_0xd20b55['options']);return _0x3f5cc6['getBlackLists'](_0x59daf8);}})[_0xffce('0x23')](function(_0x57461f){if(_0x57461f){_0xe61f73=_0x57461f[_0xffce('0x36')];if(!_0xd20b55[_0xffce('0x32')]['hasOwnProperty']('nolimit')){_0x59daf8[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0xd20b55[_0xffce('0x32')]['limit']);_0x59daf8[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0xd20b55[_0xffce('0x32')][_0xffce('0x1a')]);}return _0x3f5cc6['getBlackLists'](_0x59daf8);}})['then'](function(_0x54a6cc){if(_0x54a6cc){return _0x54a6cc?{'count':_0xe61f73,'rows':_0x54a6cc}:null;}})[_0xffce('0x23')](respondWithResult(_0x37c68c,null))[_0xffce('0x48')](handleError(_0x37c68c,null));};exports[_0xffce('0x81')]=function(_0x128a3d,_0x2835b1,_0xed7541){var _0x44418f,_0x5e284a;return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x128a3d[_0xffce('0x54')]['id']}})['then'](handleEntityNotFound(_0x2835b1,null))[_0xffce('0x23')](function(_0x21726e){if(_0x21726e){_0x5e284a=_0x21726e;return _0x21726e[_0xffce('0x81')](_0x128a3d[_0xffce('0x53')][_0xffce('0x63')],_[_0xffce('0x52')](_0x128a3d['body'],['ids','id'])||{});}return null;})['spread'](function(_0x28ac72){var _0x5131b8;_0x44418f=_0x28ac72||[];var _0x3996ab=[];if(_0x28ac72){for(var _0x10daa5=0x0;_0x10daa5<_0x28ac72[_0xffce('0x36')];_0x10daa5+=0x1){var _0xa9070a=_0x28ac72[_0x10daa5]['get']({'plain':!![]});_0x5131b8=squel[_0xffce('0x67')]()['into']('cm_hopper_black')[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6c'),'ListId',_0xffce('0x57'),'createdAt','updatedAt'],squel[_0xffce('0x7b')]()['field'](_0xffce('0x6a'),_0xffce('0x6a'))['field']('id',_0xffce('0x6c'))['field'](_0xa9070a[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x128a3d['params']['id'][_0xffce('0x72')](),_0xffce('0x57'))['field'](_0xffce('0x6f'),_0xffce('0x6e'))[_0xffce('0x70')](_0xffce('0x6f'),'updatedAt')[_0xffce('0x73')](_0xffce('0x74'))[_0xffce('0x3a')](_0xffce('0x75'))[_0xffce('0x3a')](_0xffce('0x76'),_0xa9070a[_0xffce('0x71')]['toString']())[_0xffce('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xffce('0x72')]();_0x3996ab[_0xffce('0x7f')](db[_0xffce('0x82')][_0xffce('0x32')](_0x5131b8));}return BPromise['all'](_0x3996ab);}})[_0xffce('0x23')](function(){return _0x44418f;})[_0xffce('0x23')](respondWithResult(_0x2835b1,null))[_0xffce('0x48')](handleError(_0x2835b1,null));};exports[_0xffce('0x83')]=function(_0x25d4ce,_0x2c35cc,_0x26a773){return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x25d4ce[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x2c35cc,null))[_0xffce('0x23')](function(_0x88f242){if(_0x88f242){return _0x88f242[_0xffce('0x83')](_0x25d4ce['query']['ids']);}})[_0xffce('0x23')](function(_0x4ad0f0){if(_0x4ad0f0){return db[_0xffce('0x5f')][_0xffce('0x27')]({'where':{'ListId':_0x25d4ce['query']['ids'],'CampaignId':_0x25d4ce[_0xffce('0x54')]['id']}})['then'](function(){return _0x4ad0f0;});}})['then'](respondWithStatusCode(_0x2c35cc,null))[_0xffce('0x48')](handleError(_0x2c35cc,null));}; \ No newline at end of file +var _0xd5c4=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','save','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','model','map','keys','filters','query','fields','attributes','length','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','hasOwnProperty','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xf2b35e,_0x1531c7){var _0x38dfc4=function(_0x29fe76){while(--_0x29fe76){_0xf2b35e['push'](_0xf2b35e['shift']());}};_0x38dfc4(++_0x1531c7);}(_0xd5c4,0x80));var _0x4d5c=function(_0x3242e7,_0x43139f){_0x3242e7=_0x3242e7-0x0;var _0x56502d=_0xd5c4[_0x3242e7];return _0x56502d;};'use strict';var emlformat=require(_0x4d5c('0x0'));var rimraf=require(_0x4d5c('0x1'));var zipdir=require(_0x4d5c('0x2'));var jsonpatch=require(_0x4d5c('0x3'));var rp=require(_0x4d5c('0x4'));var moment=require(_0x4d5c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4d5c('0x6'));var util=require(_0x4d5c('0x7'));var path=require(_0x4d5c('0x8'));var sox=require(_0x4d5c('0x9'));var csv=require(_0x4d5c('0xa'));var ejs=require(_0x4d5c('0xb'));var fs=require('fs');var fs_extra=require(_0x4d5c('0xc'));var _=require(_0x4d5c('0xd'));var squel=require(_0x4d5c('0xe'));var crypto=require(_0x4d5c('0xf'));var jsforce=require(_0x4d5c('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d5c('0x11'));var Papa=require('papaparse');var Redis=require(_0x4d5c('0x12'));var authService=require(_0x4d5c('0x13'));var qs=require(_0x4d5c('0x14'));var as=require(_0x4d5c('0x15'));var hardwareService=require(_0x4d5c('0x16'));var logger=require('../../config/logger')(_0x4d5c('0x17'));var utils=require(_0x4d5c('0x18'));var config=require(_0x4d5c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d5c('0x1a'))['db'];function respondWithStatusCode(_0xf62f8f,_0x3d2ae1){_0x3d2ae1=_0x3d2ae1||0xcc;return function(_0x4ad0fc){if(_0x4ad0fc){return _0xf62f8f['sendStatus'](_0x3d2ae1);}return _0xf62f8f[_0x4d5c('0x1b')](_0x3d2ae1)[_0x4d5c('0x1c')]();};}function respondWithResult(_0x5ea36c,_0x588e9d){_0x588e9d=_0x588e9d||0xc8;return function(_0x1e6da0){if(_0x1e6da0){return _0x5ea36c['status'](_0x588e9d)['json'](_0x1e6da0);}};}function respondWithFilteredResult(_0x3e21d6,_0x1321a8){return function(_0x221ff9){if(_0x221ff9){var _0x588b33=typeof _0x1321a8['offset']===_0x4d5c('0x1d')&&typeof _0x1321a8[_0x4d5c('0x1e')]===_0x4d5c('0x1d');var _0x8023a6=_0x221ff9['count'];var _0x1ac965=_0x588b33?0x0:_0x1321a8[_0x4d5c('0x1f')];var _0x39f21f=_0x588b33?_0x221ff9[_0x4d5c('0x20')]:_0x1321a8['offset']+_0x1321a8[_0x4d5c('0x1e')];var _0x288efe;if(_0x39f21f>=_0x8023a6){_0x39f21f=_0x8023a6;_0x288efe=0xc8;}else{_0x288efe=0xce;}_0x3e21d6[_0x4d5c('0x1b')](_0x288efe);return _0x3e21d6[_0x4d5c('0x21')](_0x4d5c('0x22'),_0x1ac965+'-'+_0x39f21f+'/'+_0x8023a6)[_0x4d5c('0x23')](_0x221ff9);}return null;};}function patchUpdates(_0x783a5c){return function(_0x5e5c42){try{jsonpatch[_0x4d5c('0x24')](_0x5e5c42,_0x783a5c,!![]);}catch(_0x10ffa6){return BPromise['reject'](_0x10ffa6);}return _0x5e5c42[_0x4d5c('0x25')]();};}function saveUpdates(_0x137497,_0x575388){return function(_0x1e6a0b){if(_0x1e6a0b){return _0x1e6a0b['update'](_0x137497)['then'](function(_0x1d42fb){return _0x1d42fb;});}return null;};}function removeEntity(_0x48dc11,_0x283e52){return function(_0x5aec09){if(_0x5aec09){return _0x5aec09['destroy']()[_0x4d5c('0x26')](function(){var _0x14e0ba=_0x5aec09[_0x4d5c('0x27')]({'plain':!![]});var _0x4b9cb5=_0x4d5c('0x28');return db[_0x4d5c('0x29')][_0x4d5c('0x2a')]({'where':{'type':_0x4b9cb5,'resourceId':_0x14e0ba['id']}})[_0x4d5c('0x26')](function(){return _0x5aec09;});})[_0x4d5c('0x26')](function(){_0x48dc11[_0x4d5c('0x1b')](0xcc)[_0x4d5c('0x1c')]();});}};}function handleEntityNotFound(_0x5a80fc,_0x3a1480){return function(_0x579998){if(!_0x579998){_0x5a80fc['sendStatus'](0x194);}return _0x579998;};}function handleError(_0x43cd8a,_0xb1963e){_0xb1963e=_0xb1963e||0x1f4;return function(_0x5c43f0){logger[_0x4d5c('0x2b')](_0x5c43f0[_0x4d5c('0x2c')]);if(_0x5c43f0[_0x4d5c('0x2d')]){delete _0x5c43f0[_0x4d5c('0x2d')];}_0x43cd8a['status'](_0xb1963e)[_0x4d5c('0x2e')](_0x5c43f0);};}exports[_0x4d5c('0x2f')]=function(_0x1b114c,_0x56c925){var _0x3495a4={},_0xb723b7={},_0x5df1e5={'count':0x0,'rows':[]};var _0x53b513=_['map'](db['Campaign'][_0x4d5c('0x30')],function(_0x3fb2d1){return{'name':_0x3fb2d1[_0x4d5c('0x31')],'type':_0x3fb2d1['type']['key']};});_0xb723b7[_0x4d5c('0x32')]=_[_0x4d5c('0x33')](_0x53b513,_0x4d5c('0x2d'));_0xb723b7['query']=_[_0x4d5c('0x34')](_0x1b114c['query']);_0xb723b7[_0x4d5c('0x35')]=_['intersection'](_0xb723b7[_0x4d5c('0x32')],_0xb723b7[_0x4d5c('0x36')]);_0x3495a4['attributes']=_['intersection'](_0xb723b7['model'],qs[_0x4d5c('0x37')](_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x3495a4[_0x4d5c('0x38')]=_0x3495a4[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x3495a4['attributes']:_0xb723b7[_0x4d5c('0x32')];if(!_0x1b114c[_0x4d5c('0x36')]['hasOwnProperty'](_0x4d5c('0x3a'))){_0x3495a4[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x3495a4[_0x4d5c('0x1f')]=qs['offset'](_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}_0x3495a4['order']=qs[_0x4d5c('0x3b')](_0x1b114c['query'][_0x4d5c('0x3b')]);_0x3495a4['where']=qs[_0x4d5c('0x35')](_[_0x4d5c('0x3c')](_0x1b114c[_0x4d5c('0x36')],_0xb723b7[_0x4d5c('0x35')]),_0x53b513);if(_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x3495a4['where']=_[_0x4d5c('0x3e')](_0x3495a4[_0x4d5c('0x3f')],{'$or':_['map'](_0x53b513,function(_0x3a9ab3){if(_0x3a9ab3[_0x4d5c('0x40')]!==_0x4d5c('0x41')){var _0x18c0e2={};_0x18c0e2[_0x3a9ab3['name']]={'$like':'%'+_0x1b114c['query'][_0x4d5c('0x3d')]+'%'};return _0x18c0e2;}})});}_0x3495a4=_[_0x4d5c('0x3e')]({},_0x3495a4,_0x1b114c[_0x4d5c('0x42')]);var _0x5e3f81={'where':_0x3495a4[_0x4d5c('0x3f')]};return db[_0x4d5c('0x43')][_0x4d5c('0x20')](_0x5e3f81)[_0x4d5c('0x26')](function(_0x3c01e3){_0x5df1e5[_0x4d5c('0x20')]=_0x3c01e3;if(_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x44')]){_0x3495a4[_0x4d5c('0x45')]=[{'all':!![]}];}return db['Campaign'][_0x4d5c('0x46')](_0x3495a4);})[_0x4d5c('0x26')](function(_0x101bc5){_0x5df1e5[_0x4d5c('0x47')]=_0x101bc5;return _0x5df1e5;})[_0x4d5c('0x26')](respondWithFilteredResult(_0x56c925,_0x3495a4))[_0x4d5c('0x48')](handleError(_0x56c925,null));};exports[_0x4d5c('0x49')]=function(_0x25b92c,_0x94a698){var _0xfd1f66={'raw':![],'where':{'id':_0x25b92c['params']['id']}},_0x5d19cb={};_0x5d19cb[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x43')]['rawAttributes']);_0x5d19cb[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x25b92c[_0x4d5c('0x36')]);_0x5d19cb['filters']=_[_0x4d5c('0x4a')](_0x5d19cb[_0x4d5c('0x32')],_0x5d19cb['query']);_0xfd1f66[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x5d19cb[_0x4d5c('0x32')],qs[_0x4d5c('0x37')](_0x25b92c['query'][_0x4d5c('0x37')]));_0xfd1f66[_0x4d5c('0x38')]=_0xfd1f66['attributes'][_0x4d5c('0x39')]?_0xfd1f66[_0x4d5c('0x38')]:_0x5d19cb[_0x4d5c('0x32')];if(_0x25b92c['query'][_0x4d5c('0x44')]){_0xfd1f66[_0x4d5c('0x45')]=[{'all':!![]}];}_0xfd1f66=_[_0x4d5c('0x3e')]({},_0xfd1f66,_0x25b92c['options']);return db[_0x4d5c('0x43')]['find'](_0xfd1f66)[_0x4d5c('0x26')](handleEntityNotFound(_0x94a698,null))['then'](respondWithResult(_0x94a698,null))[_0x4d5c('0x48')](handleError(_0x94a698,null));};exports[_0x4d5c('0x4b')]=function(_0x554851,_0x5519a7){return db[_0x4d5c('0x43')][_0x4d5c('0x4b')](_0x554851[_0x4d5c('0x4c')],{})['then'](function(_0x3ecf00){var _0x27124e=_0x554851[_0x4d5c('0x4d')][_0x4d5c('0x27')]({'plain':!![]});if(!_0x27124e)throw new Error(_0x4d5c('0x4e'));if(_0x27124e['role']===_0x4d5c('0x4d')){var _0x677e5d=_0x3ecf00[_0x4d5c('0x27')]({'plain':!![]});var _0x6c0572='IvrCampaigns';return db[_0x4d5c('0x4f')][_0x4d5c('0x50')]({'where':{'name':_0x6c0572,'userProfileId':_0x27124e[_0x4d5c('0x51')]},'raw':!![]})['then'](function(_0x1532f5){if(_0x1532f5&&_0x1532f5[_0x4d5c('0x52')]===0x0){return db['UserProfileResource'][_0x4d5c('0x4b')]({'name':_0x677e5d[_0x4d5c('0x2d')],'resourceId':_0x677e5d['id'],'type':_0x1532f5[_0x4d5c('0x2d')],'sectionId':_0x1532f5['id']},{})[_0x4d5c('0x26')](function(){return _0x3ecf00;});}else{return _0x3ecf00;}})['catch'](function(_0x3d9f38){logger[_0x4d5c('0x2b')](_0x4d5c('0x53'),_0x3d9f38);throw _0x3d9f38;});}return _0x3ecf00;})[_0x4d5c('0x26')](respondWithResult(_0x5519a7,0xc9))[_0x4d5c('0x48')](handleError(_0x5519a7,null));};exports[_0x4d5c('0x54')]=function(_0x24e13b,_0x2e28b2){var _0x22ce0b={'where':{'id':_0x24e13b[_0x4d5c('0x55')]['id']}},_0xb3fdf2={};_0xb3fdf2[_0x4d5c('0x32')]=_['keys'](db['Campaign'][_0x4d5c('0x30')]);_0x22ce0b[_0x4d5c('0x38')]=_['intersection'](_0xb3fdf2['model'],qs[_0x4d5c('0x37')](_0x24e13b[_0x4d5c('0x36')]['fields']));_0x22ce0b['attributes']=_0x22ce0b[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x22ce0b[_0x4d5c('0x38')]:_0xb3fdf2[_0x4d5c('0x32')];if(_0x24e13b[_0x4d5c('0x36')][_0x4d5c('0x44')]){_0x22ce0b[_0x4d5c('0x45')]=[{'all':!![]}];}_0x22ce0b=_[_0x4d5c('0x3e')]({},_0x22ce0b,_0x24e13b[_0x4d5c('0x42')]);return db[_0x4d5c('0x43')][_0x4d5c('0x50')](_0x22ce0b)['then'](handleEntityNotFound(_0x2e28b2,null))[_0x4d5c('0x26')](function(_0x4e9ffd){if(_0x4e9ffd){var _0x57e4ef=_0x4e9ffd[_0x4d5c('0x27')]({'plain':!![]});_0x57e4ef=qs[_0x4d5c('0x56')](_0x57e4ef,['id',_0x4d5c('0x57'),_0x4d5c('0x58')]);_0x24e13b[_0x4d5c('0x4c')]=_[_0x4d5c('0x56')](_0x24e13b['body'],['id',_0x4d5c('0x57'),_0x4d5c('0x58')]);return db[_0x4d5c('0x43')][_0x4d5c('0x4b')](_['merge'](_0x57e4ef,_0x24e13b[_0x4d5c('0x4c')]),{'include':_0x24e13b[_0x4d5c('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x50e3e8){var _0x307dcb=_0x24e13b['user'][_0x4d5c('0x27')]({'plain':!![]});if(!_0x307dcb)throw new Error(_0x4d5c('0x4e'));if(_0x307dcb[_0x4d5c('0x59')]===_0x4d5c('0x4d')){var _0x1c3f82=_0x50e3e8[_0x4d5c('0x27')]({'plain':!![]});var _0x3525b3='IvrCampaigns';return db[_0x4d5c('0x4f')][_0x4d5c('0x50')]({'where':{'name':_0x3525b3,'userProfileId':_0x307dcb['userProfileId']},'raw':!![]})[_0x4d5c('0x26')](function(_0x5d2261){if(_0x5d2261&&_0x5d2261[_0x4d5c('0x52')]===0x0){return db['UserProfileResource'][_0x4d5c('0x4b')]({'name':_0x1c3f82[_0x4d5c('0x2d')],'resourceId':_0x1c3f82['id'],'type':_0x5d2261[_0x4d5c('0x2d')],'sectionId':_0x5d2261['id']},{})[_0x4d5c('0x26')](function(){return _0x50e3e8;});}else{return _0x50e3e8;}})[_0x4d5c('0x48')](function(_0x45ad3c){logger['error'](_0x4d5c('0x53'),_0x45ad3c);throw _0x45ad3c;});}return _0x50e3e8;});}})[_0x4d5c('0x26')](respondWithResult(_0x2e28b2,0xc9))[_0x4d5c('0x48')](handleError(_0x2e28b2,null));};exports['update']=function(_0x171a21,_0x493e5e){if(_0x171a21['body']['id']){delete _0x171a21[_0x4d5c('0x4c')]['id'];}return db['Campaign'][_0x4d5c('0x50')]({'where':{'id':_0x171a21['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x493e5e,null))[_0x4d5c('0x26')](saveUpdates(_0x171a21['body'],null))[_0x4d5c('0x26')](respondWithResult(_0x493e5e,null))[_0x4d5c('0x48')](handleError(_0x493e5e,null));};exports['destroy']=function(_0xa442e2,_0x9a9e60){return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0xa442e2['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x9a9e60,null))[_0x4d5c('0x26')](removeEntity(_0x9a9e60,null))['catch'](handleError(_0x9a9e60,null));};exports[_0x4d5c('0x5a')]=function(_0x51964d,_0x4b0d62,_0x51dcc4){var _0x2c4f32={'raw':!![],'where':{}};var _0x384e0b={};var _0x41ba12={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x51964d['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x4b0d62,null))[_0x4d5c('0x26')](function(_0x45d98a){if(_0x45d98a){_0x384e0b[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x5c')][_0x4d5c('0x30')]);_0x384e0b[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x51964d[_0x4d5c('0x36')]);_0x384e0b[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x384e0b[_0x4d5c('0x32')],_0x384e0b['query']);_0x2c4f32[_0x4d5c('0x38')]=_['intersection'](_0x384e0b['model'],qs['fields'](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x2c4f32[_0x4d5c('0x38')]=_0x2c4f32[_0x4d5c('0x38')]['length']?_0x2c4f32[_0x4d5c('0x38')]:_0x384e0b[_0x4d5c('0x32')];if(!_0x51964d[_0x4d5c('0x36')]['hasOwnProperty']('nolimit')){_0x2c4f32[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x2c4f32['offset']=qs[_0x4d5c('0x1f')](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}_0x2c4f32['order']=qs[_0x4d5c('0x3b')](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x3b')]);_0x2c4f32[_0x4d5c('0x3f')]=qs['filters'](_['pick'](_0x51964d[_0x4d5c('0x36')],_0x384e0b[_0x4d5c('0x35')]));_0x2c4f32[_0x4d5c('0x3f')][_0x4d5c('0x5d')]=_0x45d98a['id'];if(_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x2c4f32[_0x4d5c('0x3f')]=_[_0x4d5c('0x3e')](_0x2c4f32[_0x4d5c('0x3f')],{'$or':_[_0x4d5c('0x33')](_0x2c4f32['attributes'],function(_0x1911e8){var _0x418822={};_0x418822[_0x1911e8]={'$like':'%'+_0x51964d[_0x4d5c('0x36')]['filter']+'%'};return _0x418822;})});}_0x2c4f32=_[_0x4d5c('0x3e')]({},_0x2c4f32,_0x51964d[_0x4d5c('0x42')]);return db[_0x4d5c('0x5c')][_0x4d5c('0x20')]({'where':_0x2c4f32[_0x4d5c('0x3f')]})['then'](function(_0x5461a0){_0x41ba12[_0x4d5c('0x20')]=_0x5461a0;if(_0x51964d[_0x4d5c('0x36')]['includeAll']){_0x2c4f32[_0x4d5c('0x45')]=[{'all':!![]}];}return db[_0x4d5c('0x5c')][_0x4d5c('0x46')](_0x2c4f32);})[_0x4d5c('0x26')](function(_0x4944be){_0x41ba12[_0x4d5c('0x47')]=_0x4944be;return _0x41ba12;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0x4b0d62,_0x2c4f32))[_0x4d5c('0x48')](handleError(_0x4b0d62,null));};exports[_0x4d5c('0x5e')]=function(_0x35c44b,_0x25af4d,_0x919d5f){var _0x642b78={'raw':!![],'where':{}};var _0x1457b9={};var _0xb8a7ae={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')]['findOne']({'where':{'id':_0x35c44b[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x25af4d,null))['then'](function(_0xc9e6f3){if(_0xc9e6f3){_0x1457b9[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x5f')][_0x4d5c('0x30')]);_0x1457b9[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x35c44b[_0x4d5c('0x36')]);_0x1457b9[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x1457b9[_0x4d5c('0x32')],_0x1457b9[_0x4d5c('0x36')]);_0x642b78[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x1457b9['model'],qs['fields'](_0x35c44b['query'][_0x4d5c('0x37')]));_0x642b78['attributes']=_0x642b78['attributes'][_0x4d5c('0x39')]?_0x642b78['attributes']:_0x1457b9[_0x4d5c('0x32')];if(!_0x35c44b['query'][_0x4d5c('0x60')]('nolimit')){_0x642b78[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x642b78[_0x4d5c('0x1f')]=qs[_0x4d5c('0x1f')](_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}_0x642b78[_0x4d5c('0x61')]=qs[_0x4d5c('0x3b')](_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x3b')]);_0x642b78[_0x4d5c('0x3f')]=qs['filters'](_[_0x4d5c('0x3c')](_0x35c44b[_0x4d5c('0x36')],_0x1457b9['filters']));_0x642b78['where'][_0x4d5c('0x5d')]=_0xc9e6f3['id'];if(_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x642b78[_0x4d5c('0x3f')]=_[_0x4d5c('0x3e')](_0x642b78[_0x4d5c('0x3f')],{'$or':_[_0x4d5c('0x33')](_0x642b78[_0x4d5c('0x38')],function(_0xd6c649){var _0x29ea39={};_0x29ea39[_0xd6c649]={'$like':'%'+_0x35c44b[_0x4d5c('0x36')]['filter']+'%'};return _0x29ea39;})});}_0x642b78=_[_0x4d5c('0x3e')]({},_0x642b78,_0x35c44b[_0x4d5c('0x42')]);return db[_0x4d5c('0x5f')][_0x4d5c('0x20')]({'where':_0x642b78['where']})['then'](function(_0x5c8364){_0xb8a7ae[_0x4d5c('0x20')]=_0x5c8364;if(_0x35c44b[_0x4d5c('0x36')]['includeAll']){_0x642b78[_0x4d5c('0x45')]=[{'all':!![]}];}return db[_0x4d5c('0x5f')]['findAll'](_0x642b78);})[_0x4d5c('0x26')](function(_0x4fc22d){_0xb8a7ae['rows']=_0x4fc22d;return _0xb8a7ae;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0x25af4d,_0x642b78))[_0x4d5c('0x48')](handleError(_0x25af4d,null));};exports[_0x4d5c('0x62')]=function(_0xd42398,_0x8d2ad2,_0x335ab9){var _0x3bc0a2={'raw':!![],'where':{}};var _0x3bcc6d={};var _0x42fa3d={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0xd42398[_0x4d5c('0x55')]['id']}})['then'](handleEntityNotFound(_0x8d2ad2,null))[_0x4d5c('0x26')](function(_0xcaef92){if(_0xcaef92){_0x3bcc6d['model']=_[_0x4d5c('0x34')](db[_0x4d5c('0x63')][_0x4d5c('0x30')]);_0x3bcc6d[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0xd42398['query']);_0x3bcc6d[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x3bcc6d[_0x4d5c('0x32')],_0x3bcc6d[_0x4d5c('0x36')]);_0x3bc0a2[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x3bcc6d['model'],qs[_0x4d5c('0x37')](_0xd42398['query'][_0x4d5c('0x37')]));_0x3bc0a2[_0x4d5c('0x38')]=_0x3bc0a2['attributes'][_0x4d5c('0x39')]?_0x3bc0a2['attributes']:_0x3bcc6d[_0x4d5c('0x32')];if(!_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x60')](_0x4d5c('0x3a'))){_0x3bc0a2[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x3bc0a2[_0x4d5c('0x1f')]=qs[_0x4d5c('0x1f')](_0xd42398['query'][_0x4d5c('0x1f')]);}_0x3bc0a2['order']=qs[_0x4d5c('0x3b')](_0xd42398[_0x4d5c('0x36')]['sort']);_0x3bc0a2['where']=qs['filters'](_[_0x4d5c('0x3c')](_0xd42398[_0x4d5c('0x36')],_0x3bcc6d[_0x4d5c('0x35')]));_0x3bc0a2[_0x4d5c('0x3f')][_0x4d5c('0x5d')]=_0xcaef92['id'];if(_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x3bc0a2[_0x4d5c('0x3f')]=_[_0x4d5c('0x3e')](_0x3bc0a2['where'],{'$or':_[_0x4d5c('0x33')](_0x3bc0a2['attributes'],function(_0x1e4410){var _0x8d1f2e={};_0x8d1f2e[_0x1e4410]={'$like':'%'+_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x3d')]+'%'};return _0x8d1f2e;})});}_0x3bc0a2=_['merge']({},_0x3bc0a2,_0xd42398[_0x4d5c('0x42')]);return db['CmHopperFinal']['count']({'where':_0x3bc0a2[_0x4d5c('0x3f')]})[_0x4d5c('0x26')](function(_0x52f018){_0x42fa3d[_0x4d5c('0x20')]=_0x52f018;if(_0xd42398[_0x4d5c('0x36')]['includeAll']){_0x3bc0a2['include']=[{'all':!![]}];}return db[_0x4d5c('0x63')][_0x4d5c('0x46')](_0x3bc0a2);})[_0x4d5c('0x26')](function(_0x8f95e1){_0x42fa3d[_0x4d5c('0x47')]=_0x8f95e1;return _0x42fa3d;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0x8d2ad2,_0x3bc0a2))['catch'](handleError(_0x8d2ad2,null));};exports[_0x4d5c('0x64')]=function(_0x1b0c70,_0xfc9792,_0x3004b9){var _0x1f30a3={'raw':!![],'where':{}};var _0xe9fb3d={};var _0x563f93={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x1b0c70[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0xfc9792,null))[_0x4d5c('0x26')](function(_0x2c329d){if(_0x2c329d){_0xe9fb3d[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x65')]['rawAttributes']);_0xe9fb3d['query']=_[_0x4d5c('0x34')](_0x1b0c70['query']);_0xe9fb3d[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0xe9fb3d['model'],_0xe9fb3d[_0x4d5c('0x36')]);_0x1f30a3[_0x4d5c('0x38')]=_['intersection'](_0xe9fb3d['model'],qs['fields'](_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x1f30a3[_0x4d5c('0x38')]=_0x1f30a3[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x1f30a3[_0x4d5c('0x38')]:_0xe9fb3d[_0x4d5c('0x32')];if(!_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x60')]('nolimit')){_0x1f30a3[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x1f30a3[_0x4d5c('0x1f')]=qs[_0x4d5c('0x1f')](_0x1b0c70['query'][_0x4d5c('0x1f')]);}_0x1f30a3[_0x4d5c('0x61')]=qs['sort'](_0x1b0c70[_0x4d5c('0x36')]['sort']);_0x1f30a3[_0x4d5c('0x3f')]=qs[_0x4d5c('0x35')](_['pick'](_0x1b0c70[_0x4d5c('0x36')],_0xe9fb3d[_0x4d5c('0x35')]));_0x1f30a3[_0x4d5c('0x3f')]['CampaignId']=_0x2c329d['id'];if(_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x1f30a3['where']=_[_0x4d5c('0x3e')](_0x1f30a3[_0x4d5c('0x3f')],{'$or':_[_0x4d5c('0x33')](_0x1f30a3['attributes'],function(_0xcc73e6){var _0x226b8e={};_0x226b8e[_0xcc73e6]={'$like':'%'+_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x3d')]+'%'};return _0x226b8e;})});}_0x1f30a3=_[_0x4d5c('0x3e')]({},_0x1f30a3,_0x1b0c70[_0x4d5c('0x42')]);return db[_0x4d5c('0x65')][_0x4d5c('0x20')]({'where':_0x1f30a3['where']})[_0x4d5c('0x26')](function(_0x5b0ca0){_0x563f93[_0x4d5c('0x20')]=_0x5b0ca0;if(_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x44')]){_0x1f30a3[_0x4d5c('0x45')]=[{'all':!![]}];}return db[_0x4d5c('0x65')]['findAll'](_0x1f30a3);})['then'](function(_0x15cc39){_0x563f93['rows']=_0x15cc39;return _0x563f93;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0xfc9792,_0x1f30a3))[_0x4d5c('0x48')](handleError(_0xfc9792,null));};exports['getLists']=function(_0x21ac94,_0x5d4912,_0x3b7f91){var _0x5335f9={};var _0x2eb31b={};var _0x5e25ae;var _0x49a9f3;return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x21ac94[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x5d4912,null))[_0x4d5c('0x26')](function(_0x2b8f11){if(_0x2b8f11){_0x5e25ae=_0x2b8f11;_0x2eb31b[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db['CmList'][_0x4d5c('0x30')]);_0x2eb31b[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x21ac94[_0x4d5c('0x36')]);_0x2eb31b[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x2eb31b[_0x4d5c('0x32')],_0x2eb31b[_0x4d5c('0x36')]);_0x5335f9[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x2eb31b[_0x4d5c('0x32')],qs['fields'](_0x21ac94[_0x4d5c('0x36')]['fields']));_0x5335f9[_0x4d5c('0x38')]=_0x5335f9[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x5335f9[_0x4d5c('0x38')]:_0x2eb31b[_0x4d5c('0x32')];_0x5335f9['order']=qs[_0x4d5c('0x3b')](_0x21ac94[_0x4d5c('0x36')]['sort']);_0x5335f9[_0x4d5c('0x3f')]=qs['filters'](_[_0x4d5c('0x3c')](_0x21ac94[_0x4d5c('0x36')],_0x2eb31b['filters']));if(_0x21ac94[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x5335f9[_0x4d5c('0x3f')]=_['merge'](_0x5335f9['where'],{'$or':_[_0x4d5c('0x33')](_0x5335f9[_0x4d5c('0x38')],function(_0x2df03e){var _0x1bffbd={};_0x1bffbd[_0x2df03e]={'$like':'%'+_0x21ac94[_0x4d5c('0x36')]['filter']+'%'};return _0x1bffbd;})});}_0x5335f9=_['merge']({},_0x5335f9,_0x21ac94[_0x4d5c('0x42')]);return _0x5e25ae[_0x4d5c('0x66')](_0x5335f9);}})[_0x4d5c('0x26')](function(_0xcc999d){if(_0xcc999d){_0x49a9f3=_0xcc999d[_0x4d5c('0x39')];if(!_0x21ac94[_0x4d5c('0x36')][_0x4d5c('0x60')]('nolimit')){_0x5335f9[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x21ac94[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x5335f9['offset']=qs[_0x4d5c('0x1f')](_0x21ac94['query'][_0x4d5c('0x1f')]);}return _0x5e25ae[_0x4d5c('0x66')](_0x5335f9);}})[_0x4d5c('0x26')](function(_0x4fbeac){if(_0x4fbeac){return _0x4fbeac?{'count':_0x49a9f3,'rows':_0x4fbeac}:null;}})[_0x4d5c('0x26')](respondWithResult(_0x5d4912,null))['catch'](handleError(_0x5d4912,null));};exports[_0x4d5c('0x67')]=function(_0x1bbaac,_0x110a32,_0x519374){var _0x6bd512,_0x4b7a0c;return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0x1bbaac[_0x4d5c('0x55')]['id']}})['then'](handleEntityNotFound(_0x110a32,null))[_0x4d5c('0x26')](function(_0x1650c0){if(_0x1650c0){_0x4b7a0c=_0x1650c0;return _0x1650c0['addLists'](_0x1bbaac[_0x4d5c('0x4c')][_0x4d5c('0x68')],_[_0x4d5c('0x56')](_0x1bbaac[_0x4d5c('0x4c')],[_0x4d5c('0x68'),'id'])||{});}return null;})[_0x4d5c('0x69')](function(_0x4414c4){var _0x2b6fc3;_0x6bd512=_0x4414c4||[];var _0x4e584b=[];if(_0x4414c4){for(var _0x387dae=0x0;_0x387dae<_0x4414c4['length'];_0x387dae+=0x1){var _0x3c7a62=_0x4414c4[_0x387dae]['get']({'plain':!![]});_0x4b7a0c['dialCheckDuplicateType']=_0x1bbaac[_0x4d5c('0x4c')][_0x4d5c('0x6a')]?_0x1bbaac[_0x4d5c('0x4c')][_0x4d5c('0x6a')]:_0x4b7a0c[_0x4d5c('0x6a')];switch(_0x4b7a0c[_0x4d5c('0x6a')]){case _0x4d5c('0x6b'):_0x2b6fc3=squel['insert']()[_0x4d5c('0x6c')]('cm_hopper')[_0x4d5c('0x6d')](['phone',_0x4d5c('0x6e'),_0x4d5c('0x6f'),_0x4d5c('0x70'),_0x4d5c('0x5d'),_0x4d5c('0x57'),'updatedAt'],squel['select']()[_0x4d5c('0x71')](_0x4d5c('0x72'),_0x4d5c('0x72'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x6e'))[_0x4d5c('0x71')]('id',_0x4d5c('0x6f'))[_0x4d5c('0x71')](_0x3c7a62[_0x4d5c('0x74')][_0x4d5c('0x75')](),_0x4d5c('0x70'))['field'](_0x1bbaac[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')](),'CampaignId')[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')](_0x4d5c('0x73'),'updatedAt')[_0x4d5c('0x76')]('cm_contacts')[_0x4d5c('0x3f')](_0x4d5c('0x77'))['where'](_0x4d5c('0x78'),_0x3c7a62[_0x4d5c('0x74')]['toString']())[_0x4d5c('0x3f')](_0x4d5c('0x79'))[_0x4d5c('0x3f')](_0x4d5c('0x7a'),squel[_0x4d5c('0x7b')]()[_0x4d5c('0x71')](_0x4d5c('0x7c'))[_0x4d5c('0x76')](_0x4d5c('0x7d'))[_0x4d5c('0x3f')]('CampaignId\x20=\x20?',_0x1bbaac[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')]()))[_0x4d5c('0x3f')](_0x4d5c('0x7a'),squel[_0x4d5c('0x7b')]()[_0x4d5c('0x71')](_0x4d5c('0x7e'))[_0x4d5c('0x76')](_0x4d5c('0x7f'))['where'](_0x4d5c('0x80'),_0x1bbaac[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')]())))[_0x4d5c('0x75')]();break;case _0x4d5c('0x81'):_0x2b6fc3=squel[_0x4d5c('0x82')]()[_0x4d5c('0x6c')]('cm_hopper')[_0x4d5c('0x6d')]([_0x4d5c('0x72'),_0x4d5c('0x6e'),_0x4d5c('0x6f'),_0x4d5c('0x70'),'CampaignId','createdAt',_0x4d5c('0x58')],squel['select']()['field'](_0x4d5c('0x72'),_0x4d5c('0x72'))[_0x4d5c('0x71')]('NOW()',_0x4d5c('0x6e'))[_0x4d5c('0x71')]('id','ContactId')[_0x4d5c('0x71')](_0x3c7a62[_0x4d5c('0x74')]['toString'](),'ListId')[_0x4d5c('0x71')](_0x1bbaac[_0x4d5c('0x55')]['id']['toString'](),_0x4d5c('0x5d'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x58'))[_0x4d5c('0x76')](_0x4d5c('0x83'))['where'](_0x4d5c('0x77'))[_0x4d5c('0x3f')]('ListId\x20=\x20?',_0x3c7a62[_0x4d5c('0x74')][_0x4d5c('0x75')]())[_0x4d5c('0x3f')](_0x4d5c('0x79'))[_0x4d5c('0x3f')](_0x4d5c('0x7a'),squel['select']()[_0x4d5c('0x71')](_0x4d5c('0x7e'))['from'](_0x4d5c('0x7f'))[_0x4d5c('0x3f')]('CampaignId\x20=\x20?',_0x1bbaac['params']['id'][_0x4d5c('0x75')]())))['toString']();break;default:_0x2b6fc3=squel['insert']()['into'](_0x4d5c('0x7f'))[_0x4d5c('0x6d')]([_0x4d5c('0x72'),_0x4d5c('0x6e'),_0x4d5c('0x6f'),'ListId','CampaignId','createdAt','updatedAt'],squel['select']()[_0x4d5c('0x71')]('phone',_0x4d5c('0x72'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x6e'))['field']('id',_0x4d5c('0x6f'))[_0x4d5c('0x71')](_0x3c7a62[_0x4d5c('0x74')]['toString'](),_0x4d5c('0x70'))[_0x4d5c('0x71')](_0x1bbaac[_0x4d5c('0x55')]['id']['toString'](),_0x4d5c('0x5d'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')]('NOW()',_0x4d5c('0x58'))[_0x4d5c('0x76')](_0x4d5c('0x83'))[_0x4d5c('0x3f')](_0x4d5c('0x77'))[_0x4d5c('0x3f')]('ListId\x20=\x20?',_0x3c7a62[_0x4d5c('0x74')][_0x4d5c('0x75')]())[_0x4d5c('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x4d5c('0x75')]();}_0x4e584b[_0x4d5c('0x84')](db[_0x4d5c('0x85')][_0x4d5c('0x36')](_0x2b6fc3));}return BPromise[_0x4d5c('0x86')](_0x4e584b);}})[_0x4d5c('0x26')](function(){return _0x6bd512;})[_0x4d5c('0x26')](respondWithResult(_0x110a32,null))[_0x4d5c('0x48')](handleError(_0x110a32,null));};exports[_0x4d5c('0x87')]=function(_0x4bb898,_0x5498fc,_0x1f75a2){return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0x4bb898[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x5498fc,null))[_0x4d5c('0x26')](function(_0x4fbf21){if(_0x4fbf21){return _0x4fbf21[_0x4d5c('0x87')](_0x4bb898['query'][_0x4d5c('0x68')]);}})[_0x4d5c('0x26')](function(_0x3023a0){if(_0x3023a0){return db[_0x4d5c('0x5c')]['destroy']({'where':{'ListId':_0x4bb898[_0x4d5c('0x36')][_0x4d5c('0x68')],'CampaignId':_0x4bb898[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](function(){return _0x3023a0;});}})[_0x4d5c('0x26')](respondWithStatusCode(_0x5498fc,null))['catch'](handleError(_0x5498fc,null));};exports[_0x4d5c('0x88')]=function(_0x5041b0,_0x3590fb,_0x5e0226){var _0x3d5c94={};var _0x5e57b6={};var _0x45e1f0;var _0x2062a1;return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x5041b0['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x3590fb,null))[_0x4d5c('0x26')](function(_0x7ff3c5){if(_0x7ff3c5){_0x45e1f0=_0x7ff3c5;_0x5e57b6['model']=_[_0x4d5c('0x34')](db[_0x4d5c('0x89')]['rawAttributes']);_0x5e57b6['query']=_[_0x4d5c('0x34')](_0x5041b0['query']);_0x5e57b6[_0x4d5c('0x35')]=_['intersection'](_0x5e57b6['model'],_0x5e57b6['query']);_0x3d5c94[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x5e57b6['model'],qs[_0x4d5c('0x37')](_0x5041b0[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x3d5c94[_0x4d5c('0x38')]=_0x3d5c94[_0x4d5c('0x38')]['length']?_0x3d5c94[_0x4d5c('0x38')]:_0x5e57b6['model'];_0x3d5c94[_0x4d5c('0x61')]=qs[_0x4d5c('0x3b')](_0x5041b0[_0x4d5c('0x36')]['sort']);_0x3d5c94[_0x4d5c('0x3f')]=qs[_0x4d5c('0x35')](_[_0x4d5c('0x3c')](_0x5041b0[_0x4d5c('0x36')],_0x5e57b6[_0x4d5c('0x35')]));if(_0x5041b0[_0x4d5c('0x36')]['filter']){_0x3d5c94['where']=_['merge'](_0x3d5c94[_0x4d5c('0x3f')],{'$or':_['map'](_0x3d5c94['attributes'],function(_0x2be182){var _0x4aa61b={};_0x4aa61b[_0x2be182]={'$like':'%'+_0x5041b0[_0x4d5c('0x36')]['filter']+'%'};return _0x4aa61b;})});}_0x3d5c94=_[_0x4d5c('0x3e')]({},_0x3d5c94,_0x5041b0[_0x4d5c('0x42')]);return _0x45e1f0[_0x4d5c('0x88')](_0x3d5c94);}})[_0x4d5c('0x26')](function(_0x4cd417){if(_0x4cd417){_0x2062a1=_0x4cd417['length'];if(!_0x5041b0['query'][_0x4d5c('0x60')]('nolimit')){_0x3d5c94[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x5041b0[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x3d5c94[_0x4d5c('0x1f')]=qs['offset'](_0x5041b0[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}return _0x45e1f0[_0x4d5c('0x88')](_0x3d5c94);}})[_0x4d5c('0x26')](function(_0x168619){if(_0x168619){return _0x168619?{'count':_0x2062a1,'rows':_0x168619}:null;}})[_0x4d5c('0x26')](respondWithResult(_0x3590fb,null))[_0x4d5c('0x48')](handleError(_0x3590fb,null));};exports[_0x4d5c('0x8a')]=function(_0x512ff3,_0x5be972,_0x5a1f9e){var _0x6bf256,_0x3bdeaa;return db['Campaign'][_0x4d5c('0x50')]({'where':{'id':_0x512ff3[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x5be972,null))[_0x4d5c('0x26')](function(_0x39e0d3){if(_0x39e0d3){_0x3bdeaa=_0x39e0d3;return _0x39e0d3[_0x4d5c('0x8a')](_0x512ff3[_0x4d5c('0x4c')]['ids'],_['omit'](_0x512ff3['body'],['ids','id'])||{});}return null;})[_0x4d5c('0x69')](function(_0xef8e3){var _0x432190;_0x6bf256=_0xef8e3||[];var _0x2a259e=[];if(_0xef8e3){for(var _0x914b77=0x0;_0x914b77<_0xef8e3[_0x4d5c('0x39')];_0x914b77+=0x1){var _0x4ed438=_0xef8e3[_0x914b77][_0x4d5c('0x27')]({'plain':!![]});_0x432190=squel[_0x4d5c('0x82')]()[_0x4d5c('0x6c')](_0x4d5c('0x8b'))[_0x4d5c('0x6d')]([_0x4d5c('0x72'),_0x4d5c('0x6f'),'ListId',_0x4d5c('0x5d'),'createdAt',_0x4d5c('0x58')],squel[_0x4d5c('0x7b')]()['field'](_0x4d5c('0x72'),_0x4d5c('0x72'))['field']('id',_0x4d5c('0x6f'))[_0x4d5c('0x71')](_0x4ed438[_0x4d5c('0x74')][_0x4d5c('0x75')](),'ListId')[_0x4d5c('0x71')](_0x512ff3[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')](),_0x4d5c('0x5d'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')]('NOW()','updatedAt')[_0x4d5c('0x76')](_0x4d5c('0x83'))['where'](_0x4d5c('0x77'))[_0x4d5c('0x3f')](_0x4d5c('0x78'),_0x4ed438['CmListId'][_0x4d5c('0x75')]())[_0x4d5c('0x3f')](_0x4d5c('0x79')))[_0x4d5c('0x75')]();_0x2a259e[_0x4d5c('0x84')](db[_0x4d5c('0x85')][_0x4d5c('0x36')](_0x432190));}return BPromise[_0x4d5c('0x86')](_0x2a259e);}})[_0x4d5c('0x26')](function(){return _0x6bf256;})[_0x4d5c('0x26')](respondWithResult(_0x5be972,null))['catch'](handleError(_0x5be972,null));};exports[_0x4d5c('0x8c')]=function(_0x260f77,_0x35eaf5,_0x426566){return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0x260f77[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x35eaf5,null))['then'](function(_0x5727d8){if(_0x5727d8){return _0x5727d8[_0x4d5c('0x8c')](_0x260f77[_0x4d5c('0x36')][_0x4d5c('0x68')]);}})[_0x4d5c('0x26')](function(_0x61a4a2){if(_0x61a4a2){return db[_0x4d5c('0x65')][_0x4d5c('0x2a')]({'where':{'ListId':_0x260f77[_0x4d5c('0x36')][_0x4d5c('0x68')],'CampaignId':_0x260f77[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](function(){return _0x61a4a2;});}})['then'](respondWithStatusCode(_0x35eaf5,null))[_0x4d5c('0x48')](handleError(_0x35eaf5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index afc7f7d..4d60c37 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4ccc7a,_0x2b65d2){var _0x1f8000=function(_0x3463aa){while(--_0x3463aa){_0x4ccc7a['push'](_0x4ccc7a['shift']());}};_0x1f8000(++_0x2b65d2);}(_0x7a54,0x106));var _0x47a5=function(_0x2c1910,_0x1eddfd){_0x2c1910=_0x2c1910-0x0;var _0x4a956c=_0x7a54[_0x2c1910];return _0x4a956c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index e6c160c..2a61098 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 _0x2750=['Campaign','options','raw','where','attributes','include','model','map','GetCampaign','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x2750,0x13b));var _0x0275=function(_0x4cbc7c,_0x5aa7e4){_0x4cbc7c=_0x4cbc7c-0x0;var _0x4c2ab6=_0x2750[_0x4cbc7c];return _0x4c2ab6;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var moment=require(_0x0275('0x1'));var BPromise=require(_0x0275('0x2'));var rs=require(_0x0275('0x3'));var fs=require('fs');var Redis=require(_0x0275('0x4'));var db=require(_0x0275('0x5'))['db'];var utils=require(_0x0275('0x6'));var logger=require(_0x0275('0x7'))(_0x0275('0x8'));var config=require(_0x0275('0x9'));var jayson=require(_0x0275('0xa'));var client=jayson['client'][_0x0275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2421fd,_0x2fa0eb,_0x2e4b5c){return new BPromise(function(_0x4dffd1,_0x1f7c4a){return client[_0x0275('0xc')](_0x2421fd,_0x2e4b5c)[_0x0275('0xd')](function(_0x5e0e4a){logger['info'](_0x0275('0xe'),_0x2fa0eb,'request\x20sent');logger[_0x0275('0xf')](_0x0275('0x10'),_0x2fa0eb,_0x0275('0x11'),JSON[_0x0275('0x12')](_0x5e0e4a));if(_0x5e0e4a[_0x0275('0x13')]){if(_0x5e0e4a['error'][_0x0275('0x14')]===0x1f4){logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a['error']['message']);return _0x1f7c4a(_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);}logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);return _0x4dffd1(_0x5e0e4a['error'][_0x0275('0x15')]);}else{logger[_0x0275('0x16')]('Campaign,\x20%s,\x20%s',_0x2fa0eb,_0x0275('0x11'));_0x4dffd1(_0x5e0e4a[_0x0275('0x17')]['message']);}})[_0x0275('0x18')](function(_0x31c76b){logger['error']('Campaign,\x20%s,\x20%s',_0x2fa0eb,_0x31c76b);_0x1f7c4a(_0x31c76b);});});}exports['GetCampaign']=function(_0x591d27){var _0x5b8746=this;return new Promise(function(_0x566ad6,_0x44f7b0){return db[_0x0275('0x19')]['findAll']({'raw':_0x591d27[_0x0275('0x1a')]?_0x591d27[_0x0275('0x1a')][_0x0275('0x1b')]===undefined?!![]:![]:!![],'where':_0x591d27['options']?_0x591d27[_0x0275('0x1a')][_0x0275('0x1c')]||null:null,'attributes':_0x591d27['options']?_0x591d27['options'][_0x0275('0x1d')]||null:null,'limit':_0x591d27[_0x0275('0x1a')]?_0x591d27[_0x0275('0x1a')]['limit']||null:null,'include':_0x591d27[_0x0275('0x1a')]?_0x591d27['options'][_0x0275('0x1e')]?_['map'](_0x591d27[_0x0275('0x1a')][_0x0275('0x1e')],function(_0x594321){return{'model':db[_0x594321[_0x0275('0x1f')]],'as':_0x594321['as'],'attributes':_0x594321[_0x0275('0x1d')],'include':_0x594321[_0x0275('0x1e')]?_['map'](_0x594321[_0x0275('0x1e')],function(_0x44bbf8){return{'model':db[_0x44bbf8[_0x0275('0x1f')]],'as':_0x44bbf8['as'],'attributes':_0x44bbf8[_0x0275('0x1d')],'include':_0x44bbf8[_0x0275('0x1e')]?_[_0x0275('0x20')](_0x44bbf8['include'],function(_0x35343c){return{'model':db[_0x35343c[_0x0275('0x1f')]],'as':_0x35343c['as'],'attributes':_0x35343c[_0x0275('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0275('0xd')](function(_0x4689a3){logger['info'](_0x0275('0x21'),_0x591d27);logger[_0x0275('0xf')](_0x0275('0x21'),_0x591d27,JSON[_0x0275('0x12')](_0x4689a3));_0x566ad6(_0x4689a3);})[_0x0275('0x18')](function(_0x49e645){logger[_0x0275('0x13')](_0x0275('0x21'),_0x49e645[_0x0275('0x15')],_0x591d27);_0x44f7b0(_0x5b8746['error'](0x1f4,_0x49e645['message']));});});}; \ No newline at end of file +var _0x1c4d=['Campaign','findAll','options','where','attributes','limit','map','include','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign'];(function(_0x535222,_0x30d7a5){var _0x10680b=function(_0x25cb5e){while(--_0x25cb5e){_0x535222['push'](_0x535222['shift']());}};_0x10680b(++_0x30d7a5);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x3b0e1e,_0x31eb24){_0x3b0e1e=_0x3b0e1e-0x0;var _0x2466b8=_0x1c4d[_0x3b0e1e];return _0x2466b8;};'use strict';var _=require('lodash');var util=require(_0xd1c4('0x0'));var moment=require(_0xd1c4('0x1'));var BPromise=require(_0xd1c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1c4('0x3'));var db=require(_0xd1c4('0x4'))['db'];var utils=require(_0xd1c4('0x5'));var logger=require(_0xd1c4('0x6'))('rpc');var config=require(_0xd1c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd1c4('0x8')][_0xd1c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41cc76,_0x35cbf5,_0x429dc6){return new BPromise(function(_0xc9284c,_0x49c2dc){return client[_0xd1c4('0xa')](_0x41cc76,_0x429dc6)[_0xd1c4('0xb')](function(_0x5443f3){logger[_0xd1c4('0xc')]('Campaign,\x20%s,\x20%s',_0x35cbf5,_0xd1c4('0xd'));logger[_0xd1c4('0xe')](_0xd1c4('0xf'),_0x35cbf5,_0xd1c4('0xd'),JSON[_0xd1c4('0x10')](_0x5443f3));if(_0x5443f3[_0xd1c4('0x11')]){if(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x12')]===0x1f4){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0x49c2dc(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x14')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0xc9284c(_0x5443f3[_0xd1c4('0x11')]['message']);}else{logger['info'](_0xd1c4('0x13'),_0x35cbf5,'request\x20sent');_0xc9284c(_0x5443f3[_0xd1c4('0x15')][_0xd1c4('0x14')]);}})[_0xd1c4('0x16')](function(_0x4af352){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x4af352);_0x49c2dc(_0x4af352);});});}exports[_0xd1c4('0x17')]=function(_0x41c496){var _0xe25f12=this;return new Promise(function(_0x39e0bb,_0x51a465){return db[_0xd1c4('0x18')][_0xd1c4('0x19')]({'raw':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1b')]||null:null,'attributes':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1c')]||null:null,'limit':_0x41c496['options']?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1d')]||null:null,'include':_0x41c496['options']?_0x41c496[_0xd1c4('0x1a')]['include']?_[_0xd1c4('0x1e')](_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1f')],function(_0x5d24e7){return{'model':db[_0x5d24e7[_0xd1c4('0x20')]],'as':_0x5d24e7['as'],'attributes':_0x5d24e7[_0xd1c4('0x1c')],'include':_0x5d24e7[_0xd1c4('0x1f')]?_[_0xd1c4('0x1e')](_0x5d24e7[_0xd1c4('0x1f')],function(_0x23f9af){return{'model':db[_0x23f9af[_0xd1c4('0x20')]],'as':_0x23f9af['as'],'attributes':_0x23f9af[_0xd1c4('0x1c')],'include':_0x23f9af[_0xd1c4('0x1f')]?_['map'](_0x23f9af[_0xd1c4('0x1f')],function(_0x2cdf75){return{'model':db[_0x2cdf75[_0xd1c4('0x20')]],'as':_0x2cdf75['as'],'attributes':_0x2cdf75[_0xd1c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd1c4('0xb')](function(_0x26fda4){logger['info'](_0xd1c4('0x17'),_0x41c496);logger['debug'](_0xd1c4('0x17'),_0x41c496,JSON[_0xd1c4('0x10')](_0x26fda4));_0x39e0bb(_0x26fda4);})[_0xd1c4('0x16')](function(_0x3ef290){logger[_0xd1c4('0x11')]('GetCampaign',_0x3ef290[_0xd1c4('0x14')],_0x41c496);_0x51a465(_0xe25f12[_0xd1c4('0x11')](0x1f4,_0x3ef290['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4ab3fff..ff9318b 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 _0xe10c=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','/:id','update','destroy','removeLists','delete','/:id/blacklists','removeBlackLists','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/hoppers'];(function(_0x1a967b,_0x2eba36){var _0x3c9397=function(_0x1a5aca){while(--_0x1a5aca){_0x1a967b['push'](_0x1a967b['shift']());}};_0x3c9397(++_0x2eba36);}(_0xe10c,0x153));var _0xce10=function(_0x1e64b4,_0xe0c41){_0x1e64b4=_0x1e64b4-0x0;var _0x1e2670=_0xe10c[_0x1e64b4];return _0x1e2670;};'use strict';var multer=require(_0xce10('0x0'));var util=require(_0xce10('0x1'));var path=require(_0xce10('0x2'));var timeout=require('connect-timeout');var express=require(_0xce10('0x3'));var router=express['Router']();var fs_extra=require(_0xce10('0x4'));var auth=require(_0xce10('0x5'));var interaction=require(_0xce10('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xce10('0x7')]('/',auth[_0xce10('0x8')](),controller[_0xce10('0x9')]);router[_0xce10('0x7')]('/:id',auth[_0xce10('0x8')](),controller['show']);router[_0xce10('0x7')](_0xce10('0xa'),auth['isAuthenticated'](),controller[_0xce10('0xb')]);router['get'](_0xce10('0xc'),auth[_0xce10('0x8')](),controller[_0xce10('0xd')]);router[_0xce10('0x7')](_0xce10('0xe'),auth[_0xce10('0x8')](),controller[_0xce10('0xf')]);router[_0xce10('0x7')](_0xce10('0x10'),auth[_0xce10('0x8')](),controller[_0xce10('0x11')]);router[_0xce10('0x7')]('/:id/lists',auth['isAuthenticated'](),controller[_0xce10('0x12')]);router[_0xce10('0x7')]('/:id/blacklists',auth[_0xce10('0x8')](),controller[_0xce10('0x13')]);router[_0xce10('0x14')]('/',auth[_0xce10('0x8')](),controller[_0xce10('0x15')]);router['post'](_0xce10('0x16'),auth[_0xce10('0x8')](),controller[_0xce10('0x17')]);router[_0xce10('0x14')](_0xce10('0x18'),auth[_0xce10('0x8')](),controller[_0xce10('0x19')]);router[_0xce10('0x14')]('/:id/blacklists',auth[_0xce10('0x8')](),controller[_0xce10('0x1a')]);router[_0xce10('0x1b')](_0xce10('0x1c'),auth[_0xce10('0x8')](),controller[_0xce10('0x1d')]);router['delete'](_0xce10('0x1c'),auth[_0xce10('0x8')](),controller[_0xce10('0x1e')]);router['delete'](_0xce10('0x18'),auth[_0xce10('0x8')](),controller[_0xce10('0x1f')]);router[_0xce10('0x20')](_0xce10('0x21'),auth[_0xce10('0x8')](),controller[_0xce10('0x22')]);module['exports']=router; \ No newline at end of file +var _0xb877=['addBlackLists','delete','destroy','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getBlackLists','post','create','/:id/clone','/:id/lists','addLists','/:id/blacklists'];(function(_0x598fae,_0x13abf1){var _0x1d975c=function(_0x34f13f){while(--_0x34f13f){_0x598fae['push'](_0x598fae['shift']());}};_0x1d975c(++_0x13abf1);}(_0xb877,0x1cb));var _0x7b87=function(_0x3b2306,_0xfde2f7){_0x3b2306=_0x3b2306-0x0;var _0x53f8e5=_0xb877[_0x3b2306];return _0x53f8e5;};'use strict';var multer=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var path=require(_0x7b87('0x2'));var timeout=require(_0x7b87('0x3'));var express=require(_0x7b87('0x4'));var router=express[_0x7b87('0x5')]();var fs_extra=require(_0x7b87('0x6'));var auth=require(_0x7b87('0x7'));var interaction=require(_0x7b87('0x8'));var config=require(_0x7b87('0x9'));var controller=require(_0x7b87('0xa'));router[_0x7b87('0xb')]('/',auth[_0x7b87('0xc')](),controller[_0x7b87('0xd')]);router[_0x7b87('0xb')](_0x7b87('0xe'),auth[_0x7b87('0xc')](),controller[_0x7b87('0xf')]);router[_0x7b87('0xb')](_0x7b87('0x10'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x11')]);router['get'](_0x7b87('0x12'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x13')]);router[_0x7b87('0xb')](_0x7b87('0x14'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x15')]);router[_0x7b87('0xb')](_0x7b87('0x16'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x17')]);router[_0x7b87('0xb')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x7b87('0xc')](),controller[_0x7b87('0x18')]);router[_0x7b87('0x19')]('/',auth[_0x7b87('0xc')](),controller[_0x7b87('0x1a')]);router[_0x7b87('0x19')](_0x7b87('0x1b'),auth[_0x7b87('0xc')](),controller['clone']);router['post'](_0x7b87('0x1c'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x1d')]);router[_0x7b87('0x19')](_0x7b87('0x1e'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x1f')]);router['put'](_0x7b87('0xe'),auth[_0x7b87('0xc')](),controller['update']);router[_0x7b87('0x20')](_0x7b87('0xe'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x21')]);router[_0x7b87('0x20')](_0x7b87('0x1c'),auth[_0x7b87('0xc')](),controller['removeLists']);router[_0x7b87('0x20')](_0x7b87('0x1e'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6bd3f47..4c2c3ae 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 _0x2870=['key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2870,0x1b1));var _0x0287=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x2870[_0x555069];return _0x100af7;};'use strict';var Sequelize=require(_0x0287('0x0'));module[_0x0287('0x1')]={'key':{'type':Sequelize[_0x0287('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0287('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0287('0x4')],'get':function(){return this['getDataValue'](_0x0287('0x5'));}}}; \ No newline at end of file +var _0x7c78=['getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x591e8e,_0x11eb4f){var _0x4119e7=function(_0x41415e){while(--_0x41415e){_0x591e8e['push'](_0x591e8e['shift']());}};_0x4119e7(++_0x11eb4f);}(_0x7c78,0x158));var _0x87c7=function(_0x9d37d9,_0x4cdbf8){_0x9d37d9=_0x9d37d9-0x0;var _0x22db05=_0x7c78[_0x9d37d9];return _0x22db05;};'use strict';var Sequelize=require(_0x87c7('0x0'));module[_0x87c7('0x1')]={'key':{'type':Sequelize[_0x87c7('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x87c7('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x87c7('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x87c7('0x4')](_0x87c7('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 1e4099b..5f615e7 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 _0x64c2=['type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x57246f,_0x3d0f4c){var _0x2c7db9=function(_0x9cd6d){while(--_0x9cd6d){_0x57246f['push'](_0x57246f['shift']());}};_0x2c7db9(++_0x3d0f4c);}(_0x64c2,0x194));var _0x264c=function(_0xdb815e,_0x3012fc){_0xdb815e=_0xdb815e-0x0;var _0x2bab1f=_0x64c2[_0xdb815e];return _0x2bab1f;};'use strict';var emlformat=require(_0x264c('0x0'));var rimraf=require(_0x264c('0x1'));var zipdir=require(_0x264c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x264c('0x3'));var moment=require(_0x264c('0x4'));var BPromise=require(_0x264c('0x5'));var Mustache=require(_0x264c('0x6'));var util=require(_0x264c('0x7'));var path=require(_0x264c('0x8'));var sox=require(_0x264c('0x9'));var csv=require('to-csv');var ejs=require(_0x264c('0xa'));var fs=require('fs');var fs_extra=require(_0x264c('0xb'));var _=require('lodash');var squel=require(_0x264c('0xc'));var crypto=require(_0x264c('0xd'));var jsforce=require(_0x264c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x264c('0xf'));var Papa=require(_0x264c('0x10'));var Redis=require(_0x264c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x264c('0x12'));var as=require(_0x264c('0x13'));var hardwareService=require(_0x264c('0x14'));var logger=require(_0x264c('0x15'))(_0x264c('0x16'));var utils=require('../../config/utils');var config=require(_0x264c('0x17'));var licenseUtil=require(_0x264c('0x18'));var db=require(_0x264c('0x19'))['db'];function respondWithStatusCode(_0x2124e1,_0x982e76){_0x982e76=_0x982e76||0xcc;return function(_0x203ace){if(_0x203ace){return _0x2124e1['sendStatus'](_0x982e76);}return _0x2124e1[_0x264c('0x1a')](_0x982e76)[_0x264c('0x1b')]();};}function respondWithResult(_0x4f2154,_0x2f8214){_0x2f8214=_0x2f8214||0xc8;return function(_0x11947e){if(_0x11947e){return _0x4f2154[_0x264c('0x1a')](_0x2f8214)[_0x264c('0x1c')](_0x11947e);}};}function respondWithFilteredResult(_0x530289,_0x152af2){return function(_0x5310ac){if(_0x5310ac){var _0x50e3a8=typeof _0x152af2[_0x264c('0x1d')]===_0x264c('0x1e')&&typeof _0x152af2[_0x264c('0x1f')]==='undefined';var _0x12a8d5=_0x5310ac[_0x264c('0x20')];var _0x5ca376=_0x50e3a8?0x0:_0x152af2['offset'];var _0x42f578=_0x50e3a8?_0x5310ac[_0x264c('0x20')]:_0x152af2[_0x264c('0x1d')]+_0x152af2[_0x264c('0x1f')];var _0x2858d9;if(_0x42f578>=_0x12a8d5){_0x42f578=_0x12a8d5;_0x2858d9=0xc8;}else{_0x2858d9=0xce;}_0x530289[_0x264c('0x1a')](_0x2858d9);return _0x530289[_0x264c('0x21')](_0x264c('0x22'),_0x5ca376+'-'+_0x42f578+'/'+_0x12a8d5)[_0x264c('0x1c')](_0x5310ac);}return null;};}function patchUpdates(_0x253405){return function(_0x39d0c9){try{jsonpatch['apply'](_0x39d0c9,_0x253405,!![]);}catch(_0x571f4c){return BPromise[_0x264c('0x23')](_0x571f4c);}return _0x39d0c9[_0x264c('0x24')]();};}function saveUpdates(_0x4d6ba2,_0x15a3f2){return function(_0x40858c){if(_0x40858c){return _0x40858c[_0x264c('0x25')](_0x4d6ba2)['then'](function(_0x496455){return _0x496455;});}return null;};}function removeEntity(_0x2f8427,_0x22b73b){return function(_0xd7abf1){if(_0xd7abf1){return _0xd7abf1[_0x264c('0x26')]()[_0x264c('0x27')](function(){var _0x40c325=_0xd7abf1[_0x264c('0x28')]({'plain':!![]});var _0x4bbf6a=_0x264c('0x29');return db[_0x264c('0x2a')][_0x264c('0x26')]({'where':{'type':_0x4bbf6a,'resourceId':_0x40c325['id']}})[_0x264c('0x27')](function(){return _0xd7abf1;});})[_0x264c('0x27')](function(){_0x2f8427['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e7b98,_0x386f19){return function(_0x8e3074){if(!_0x8e3074){_0x4e7b98[_0x264c('0x2b')](0x194);}return _0x8e3074;};}function handleError(_0x26c92f,_0x489d27){_0x489d27=_0x489d27||0x1f4;return function(_0x1ab901){logger['error'](_0x1ab901[_0x264c('0x2c')]);if(_0x1ab901['name']){delete _0x1ab901[_0x264c('0x2d')];}_0x26c92f[_0x264c('0x1a')](_0x489d27)[_0x264c('0x2e')](_0x1ab901);};}exports[_0x264c('0x2f')]=function(_0x653b44,_0x1bf4ae){var _0x2fd82f={},_0x3ede53={},_0x11ed39={'count':0x0,'rows':[]};var _0x149ac2=_[_0x264c('0x30')](db[_0x264c('0x31')][_0x264c('0x32')],function(_0x2601c4){return{'name':_0x2601c4['fieldName'],'type':_0x2601c4[_0x264c('0x33')]['key']};});_0x3ede53[_0x264c('0x34')]=_['map'](_0x149ac2,_0x264c('0x2d'));_0x3ede53[_0x264c('0x35')]=_[_0x264c('0x36')](_0x653b44[_0x264c('0x35')]);_0x3ede53[_0x264c('0x37')]=_[_0x264c('0x38')](_0x3ede53[_0x264c('0x34')],_0x3ede53[_0x264c('0x35')]);_0x2fd82f[_0x264c('0x39')]=_[_0x264c('0x38')](_0x3ede53[_0x264c('0x34')],qs[_0x264c('0x3a')](_0x653b44[_0x264c('0x35')][_0x264c('0x3a')]));_0x2fd82f[_0x264c('0x39')]=_0x2fd82f['attributes'][_0x264c('0x3b')]?_0x2fd82f[_0x264c('0x39')]:_0x3ede53[_0x264c('0x34')];if(!_0x653b44[_0x264c('0x35')]['hasOwnProperty'](_0x264c('0x3c'))){_0x2fd82f[_0x264c('0x1f')]=qs[_0x264c('0x1f')](_0x653b44['query'][_0x264c('0x1f')]);_0x2fd82f[_0x264c('0x1d')]=qs[_0x264c('0x1d')](_0x653b44[_0x264c('0x35')][_0x264c('0x1d')]);}_0x2fd82f[_0x264c('0x3d')]=qs[_0x264c('0x3e')](_0x653b44[_0x264c('0x35')][_0x264c('0x3e')]);_0x2fd82f[_0x264c('0x3f')]=qs[_0x264c('0x37')](_[_0x264c('0x40')](_0x653b44[_0x264c('0x35')],_0x3ede53['filters']),_0x149ac2);if(_0x653b44[_0x264c('0x35')]['filter']){_0x2fd82f[_0x264c('0x3f')]=_['merge'](_0x2fd82f[_0x264c('0x3f')],{'$or':[{'key':{'$like':'%'+_0x653b44['query'][_0x264c('0x41')]+'%'}},{'value':{'$like':'%'+_0x653b44[_0x264c('0x35')][_0x264c('0x41')]+'%'}}]});}_0x2fd82f=_[_0x264c('0x42')]({},_0x2fd82f,_0x653b44[_0x264c('0x43')]);var _0x413321={'where':_0x2fd82f[_0x264c('0x3f')]};return db[_0x264c('0x31')][_0x264c('0x20')](_0x413321)[_0x264c('0x27')](function(_0x13fe66){_0x11ed39[_0x264c('0x20')]=_0x13fe66;if(_0x653b44['query'][_0x264c('0x44')]){_0x2fd82f['include']=[{'all':!![]}];}return db[_0x264c('0x31')][_0x264c('0x45')](_0x2fd82f);})['then'](function(_0xea1f41){_0x11ed39[_0x264c('0x46')]=_0xea1f41;return _0x11ed39;})[_0x264c('0x27')](respondWithFilteredResult(_0x1bf4ae,_0x2fd82f))[_0x264c('0x47')](handleError(_0x1bf4ae,null));};exports[_0x264c('0x48')]=function(_0x5e2a36,_0x4f537e){var _0x46f7d6={'raw':!![],'where':{'id':_0x5e2a36['params']['id']}},_0x216677={};_0x216677['model']=_[_0x264c('0x36')](db[_0x264c('0x31')]['rawAttributes']);_0x216677[_0x264c('0x35')]=_['keys'](_0x5e2a36[_0x264c('0x35')]);_0x216677[_0x264c('0x37')]=_[_0x264c('0x38')](_0x216677[_0x264c('0x34')],_0x216677[_0x264c('0x35')]);_0x46f7d6[_0x264c('0x39')]=_['intersection'](_0x216677[_0x264c('0x34')],qs[_0x264c('0x3a')](_0x5e2a36[_0x264c('0x35')]['fields']));_0x46f7d6[_0x264c('0x39')]=_0x46f7d6['attributes'][_0x264c('0x3b')]?_0x46f7d6[_0x264c('0x39')]:_0x216677[_0x264c('0x34')];if(_0x5e2a36['query'][_0x264c('0x44')]){_0x46f7d6[_0x264c('0x49')]=[{'all':!![]}];}_0x46f7d6=_[_0x264c('0x42')]({},_0x46f7d6,_0x5e2a36[_0x264c('0x43')]);return db[_0x264c('0x31')][_0x264c('0x4a')](_0x46f7d6)[_0x264c('0x27')](handleEntityNotFound(_0x4f537e,null))[_0x264c('0x27')](respondWithResult(_0x4f537e,null))['catch'](handleError(_0x4f537e,null));};exports[_0x264c('0x25')]=function(_0x54f755,_0x5ae673){if(_0x54f755['body']['id']){delete _0x54f755[_0x264c('0x4b')]['id'];}return db[_0x264c('0x31')][_0x264c('0x4a')]({'where':{'id':_0x54f755[_0x264c('0x4c')]['id']}})[_0x264c('0x27')](handleEntityNotFound(_0x5ae673,null))[_0x264c('0x27')](saveUpdates(_0x54f755['body'],null))['then'](respondWithResult(_0x5ae673,null))[_0x264c('0x47')](handleError(_0x5ae673,null));};exports[_0x264c('0x26')]=function(_0x28f184,_0x22b56f){return db[_0x264c('0x31')][_0x264c('0x4a')]({'where':{'id':_0x28f184[_0x264c('0x4c')]['id']}})[_0x264c('0x27')](handleEntityNotFound(_0x22b56f,null))[_0x264c('0x27')](removeEntity(_0x22b56f,null))[_0x264c('0x47')](handleError(_0x22b56f,null));};exports[_0x264c('0x4d')]=function(_0x4ca901,_0xd898f6){var _0x401023={'key':_0x4ca901[_0x264c('0x4b')]['key']};if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x4e')]){_0x401023[_0x264c('0x4e')]=_0x4ca901[_0x264c('0x4b')][_0x264c('0x4e')];}else if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x4f')]){_0x401023[_0x264c('0x4f')]=_0x4ca901['body'][_0x264c('0x4f')];}else if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x50')]){_0x401023[_0x264c('0x50')]=_0x4ca901[_0x264c('0x4b')]['OpenchannelAccountId'];}else if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x51')]){_0x401023[_0x264c('0x51')]=_0x4ca901[_0x264c('0x4b')][_0x264c('0x51')];}return db[_0x264c('0x31')]['find']({'where':_0x401023})['then'](function(_0x28a3dd){if(_0x28a3dd){throw new db['Sequelize'][(_0x264c('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x264c('0x31')]['create'](_0x4ca901['body']);})[_0x264c('0x27')](function(_0x291311){var _0x4467f1=_0x4ca901[_0x264c('0x53')]['get']({'plain':!![]});if(!_0x4467f1)throw new Error(_0x264c('0x54'));if(_0x4467f1[_0x264c('0x55')]===_0x264c('0x53')){var _0xf0d3b=_0x291311['get']({'plain':!![]});return db[_0x264c('0x56')][_0x264c('0x4a')]({'where':{'name':_0x264c('0x29'),'userProfileId':_0x4467f1[_0x264c('0x57')]},'raw':!![]})[_0x264c('0x27')](function(_0x4c0996){if(_0x4c0996&&_0x4c0996[_0x264c('0x58')]===0x0){return db[_0x264c('0x2a')][_0x264c('0x4d')]({'name':_0xf0d3b[_0x264c('0x2d')],'resourceId':_0xf0d3b['id'],'type':_0x4c0996[_0x264c('0x2d')],'sectionId':_0x4c0996['id']},{})[_0x264c('0x27')](function(){return _0x291311;});}else{return _0x291311;}})[_0x264c('0x47')](function(_0x2de0d1){logger[_0x264c('0x59')](_0x264c('0x5a'),_0x2de0d1);throw _0x2de0d1;});}return _0x291311;})[_0x264c('0x27')](respondWithResult(_0xd898f6,0xc9))[_0x264c('0x47')](handleError(_0xd898f6,null));}; \ No newline at end of file +var _0x5871=['error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','update','then','get','CannedAnswers','destroy'];(function(_0x121896,_0x30212b){var _0x329155=function(_0x224039){while(--_0x224039){_0x121896['push'](_0x121896['shift']());}};_0x329155(++_0x30212b);}(_0x5871,0x12e));var _0x1587=function(_0x2b9bfa,_0x403511){_0x2b9bfa=_0x2b9bfa-0x0;var _0x1c355d=_0x5871[_0x2b9bfa];return _0x1c355d;};'use strict';var emlformat=require(_0x1587('0x0'));var rimraf=require(_0x1587('0x1'));var zipdir=require(_0x1587('0x2'));var jsonpatch=require(_0x1587('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1587('0x4'));var util=require(_0x1587('0x5'));var path=require(_0x1587('0x6'));var sox=require(_0x1587('0x7'));var csv=require(_0x1587('0x8'));var ejs=require(_0x1587('0x9'));var fs=require('fs');var fs_extra=require(_0x1587('0xa'));var _=require('lodash');var squel=require(_0x1587('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1587('0x8'));var querystring=require(_0x1587('0xc'));var Papa=require('papaparse');var Redis=require(_0x1587('0xd'));var authService=require(_0x1587('0xe'));var qs=require(_0x1587('0xf'));var as=require(_0x1587('0x10'));var hardwareService=require(_0x1587('0x11'));var logger=require(_0x1587('0x12'))('api');var utils=require(_0x1587('0x13'));var config=require(_0x1587('0x14'));var licenseUtil=require(_0x1587('0x15'));var db=require(_0x1587('0x16'))['db'];function respondWithStatusCode(_0x229066,_0x46e638){_0x46e638=_0x46e638||0xcc;return function(_0x5f02b9){if(_0x5f02b9){return _0x229066[_0x1587('0x17')](_0x46e638);}return _0x229066['status'](_0x46e638)[_0x1587('0x18')]();};}function respondWithResult(_0x18f5e6,_0x39bc79){_0x39bc79=_0x39bc79||0xc8;return function(_0x22f452){if(_0x22f452){return _0x18f5e6[_0x1587('0x19')](_0x39bc79)[_0x1587('0x1a')](_0x22f452);}};}function respondWithFilteredResult(_0x1c612d,_0x76c915){return function(_0x4a3617){if(_0x4a3617){var _0x2efeee=typeof _0x76c915['offset']===_0x1587('0x1b')&&typeof _0x76c915[_0x1587('0x1c')]==='undefined';var _0xe6414=_0x4a3617[_0x1587('0x1d')];var _0x1de94c=_0x2efeee?0x0:_0x76c915[_0x1587('0x1e')];var _0x38a7f0=_0x2efeee?_0x4a3617[_0x1587('0x1d')]:_0x76c915[_0x1587('0x1e')]+_0x76c915[_0x1587('0x1c')];var _0x124ade;if(_0x38a7f0>=_0xe6414){_0x38a7f0=_0xe6414;_0x124ade=0xc8;}else{_0x124ade=0xce;}_0x1c612d[_0x1587('0x19')](_0x124ade);return _0x1c612d['set'](_0x1587('0x1f'),_0x1de94c+'-'+_0x38a7f0+'/'+_0xe6414)[_0x1587('0x1a')](_0x4a3617);}return null;};}function patchUpdates(_0x3c4145){return function(_0x4966fe){try{jsonpatch[_0x1587('0x20')](_0x4966fe,_0x3c4145,!![]);}catch(_0x366e72){return BPromise['reject'](_0x366e72);}return _0x4966fe['save']();};}function saveUpdates(_0x27ae31,_0x3dd564){return function(_0x2ded4d){if(_0x2ded4d){return _0x2ded4d[_0x1587('0x21')](_0x27ae31)[_0x1587('0x22')](function(_0xd06ce9){return _0xd06ce9;});}return null;};}function removeEntity(_0x590091,_0x56ef5e){return function(_0x438b4b){if(_0x438b4b){return _0x438b4b['destroy']()['then'](function(){var _0x39cfe6=_0x438b4b[_0x1587('0x23')]({'plain':!![]});var _0x1fb615=_0x1587('0x24');return db['UserProfileResource'][_0x1587('0x25')]({'where':{'type':_0x1fb615,'resourceId':_0x39cfe6['id']}})['then'](function(){return _0x438b4b;});})[_0x1587('0x22')](function(){_0x590091[_0x1587('0x19')](0xcc)[_0x1587('0x18')]();});}};}function handleEntityNotFound(_0x3f284b,_0x276af2){return function(_0x43b40c){if(!_0x43b40c){_0x3f284b['sendStatus'](0x194);}return _0x43b40c;};}function handleError(_0x13bdcf,_0x42b5e2){_0x42b5e2=_0x42b5e2||0x1f4;return function(_0x1986fd){logger[_0x1587('0x26')](_0x1986fd[_0x1587('0x27')]);if(_0x1986fd[_0x1587('0x28')]){delete _0x1986fd[_0x1587('0x28')];}_0x13bdcf[_0x1587('0x19')](_0x42b5e2)[_0x1587('0x29')](_0x1986fd);};}exports['index']=function(_0x5b79d1,_0x256ac5){var _0x307445={},_0x4b8cfb={},_0x4111ef={'count':0x0,'rows':[]};var _0x37938b=_[_0x1587('0x2a')](db[_0x1587('0x2b')][_0x1587('0x2c')],function(_0xe7bc97){return{'name':_0xe7bc97[_0x1587('0x2d')],'type':_0xe7bc97[_0x1587('0x2e')][_0x1587('0x2f')]};});_0x4b8cfb[_0x1587('0x30')]=_[_0x1587('0x2a')](_0x37938b,'name');_0x4b8cfb['query']=_[_0x1587('0x31')](_0x5b79d1[_0x1587('0x32')]);_0x4b8cfb[_0x1587('0x33')]=_[_0x1587('0x34')](_0x4b8cfb[_0x1587('0x30')],_0x4b8cfb[_0x1587('0x32')]);_0x307445[_0x1587('0x35')]=_['intersection'](_0x4b8cfb[_0x1587('0x30')],qs['fields'](_0x5b79d1[_0x1587('0x32')][_0x1587('0x36')]));_0x307445[_0x1587('0x35')]=_0x307445[_0x1587('0x35')][_0x1587('0x37')]?_0x307445[_0x1587('0x35')]:_0x4b8cfb[_0x1587('0x30')];if(!_0x5b79d1[_0x1587('0x32')][_0x1587('0x38')]('nolimit')){_0x307445[_0x1587('0x1c')]=qs[_0x1587('0x1c')](_0x5b79d1['query'][_0x1587('0x1c')]);_0x307445['offset']=qs[_0x1587('0x1e')](_0x5b79d1[_0x1587('0x32')][_0x1587('0x1e')]);}_0x307445[_0x1587('0x39')]=qs[_0x1587('0x3a')](_0x5b79d1[_0x1587('0x32')][_0x1587('0x3a')]);_0x307445[_0x1587('0x3b')]=qs['filters'](_[_0x1587('0x3c')](_0x5b79d1[_0x1587('0x32')],_0x4b8cfb[_0x1587('0x33')]),_0x37938b);if(_0x5b79d1[_0x1587('0x32')][_0x1587('0x3d')]){_0x307445[_0x1587('0x3b')]=_[_0x1587('0x3e')](_0x307445[_0x1587('0x3b')],{'$or':[{'key':{'$like':'%'+_0x5b79d1[_0x1587('0x32')][_0x1587('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5b79d1['query'][_0x1587('0x3d')]+'%'}}]});}_0x307445=_[_0x1587('0x3e')]({},_0x307445,_0x5b79d1[_0x1587('0x3f')]);var _0x2b364a={'where':_0x307445[_0x1587('0x3b')]};return db['CannedAnswer'][_0x1587('0x1d')](_0x2b364a)['then'](function(_0xf16a65){_0x4111ef[_0x1587('0x1d')]=_0xf16a65;if(_0x5b79d1[_0x1587('0x32')][_0x1587('0x40')]){_0x307445[_0x1587('0x41')]=[{'all':!![]}];}return db[_0x1587('0x2b')]['findAll'](_0x307445);})[_0x1587('0x22')](function(_0x2f1930){_0x4111ef['rows']=_0x2f1930;return _0x4111ef;})[_0x1587('0x22')](respondWithFilteredResult(_0x256ac5,_0x307445))[_0x1587('0x42')](handleError(_0x256ac5,null));};exports[_0x1587('0x43')]=function(_0x283477,_0x35e18d){var _0x509d85={'raw':!![],'where':{'id':_0x283477['params']['id']}},_0x265c7c={};_0x265c7c['model']=_[_0x1587('0x31')](db['CannedAnswer'][_0x1587('0x2c')]);_0x265c7c[_0x1587('0x32')]=_['keys'](_0x283477[_0x1587('0x32')]);_0x265c7c[_0x1587('0x33')]=_['intersection'](_0x265c7c[_0x1587('0x30')],_0x265c7c[_0x1587('0x32')]);_0x509d85['attributes']=_[_0x1587('0x34')](_0x265c7c['model'],qs[_0x1587('0x36')](_0x283477[_0x1587('0x32')][_0x1587('0x36')]));_0x509d85['attributes']=_0x509d85[_0x1587('0x35')][_0x1587('0x37')]?_0x509d85[_0x1587('0x35')]:_0x265c7c['model'];if(_0x283477[_0x1587('0x32')][_0x1587('0x40')]){_0x509d85[_0x1587('0x41')]=[{'all':!![]}];}_0x509d85=_[_0x1587('0x3e')]({},_0x509d85,_0x283477[_0x1587('0x3f')]);return db['CannedAnswer'][_0x1587('0x44')](_0x509d85)['then'](handleEntityNotFound(_0x35e18d,null))['then'](respondWithResult(_0x35e18d,null))[_0x1587('0x42')](handleError(_0x35e18d,null));};exports[_0x1587('0x21')]=function(_0x3687c0,_0x3cbc0b){if(_0x3687c0[_0x1587('0x45')]['id']){delete _0x3687c0[_0x1587('0x45')]['id'];}return db[_0x1587('0x2b')][_0x1587('0x44')]({'where':{'id':_0x3687c0[_0x1587('0x46')]['id']}})[_0x1587('0x22')](handleEntityNotFound(_0x3cbc0b,null))[_0x1587('0x22')](saveUpdates(_0x3687c0['body'],null))[_0x1587('0x22')](respondWithResult(_0x3cbc0b,null))['catch'](handleError(_0x3cbc0b,null));};exports[_0x1587('0x25')]=function(_0x160293,_0x70925b){return db[_0x1587('0x2b')][_0x1587('0x44')]({'where':{'id':_0x160293['params']['id']}})[_0x1587('0x22')](handleEntityNotFound(_0x70925b,null))[_0x1587('0x22')](removeEntity(_0x70925b,null))['catch'](handleError(_0x70925b,null));};exports[_0x1587('0x47')]=function(_0x514948,_0x416178){var _0x4ad68a={'key':_0x514948[_0x1587('0x45')][_0x1587('0x2f')]};if(_0x514948[_0x1587('0x45')][_0x1587('0x48')]){_0x4ad68a['MailAccountId']=_0x514948[_0x1587('0x45')][_0x1587('0x48')];}else if(_0x514948[_0x1587('0x45')]['SmsAccountId']){_0x4ad68a[_0x1587('0x49')]=_0x514948[_0x1587('0x45')][_0x1587('0x49')];}else if(_0x514948[_0x1587('0x45')]['OpenchannelAccountId']){_0x4ad68a[_0x1587('0x4a')]=_0x514948[_0x1587('0x45')][_0x1587('0x4a')];}else if(_0x514948[_0x1587('0x45')][_0x1587('0x4b')]){_0x4ad68a[_0x1587('0x4b')]=_0x514948['body'][_0x1587('0x4b')];}return db['CannedAnswer'][_0x1587('0x44')]({'where':_0x4ad68a})[_0x1587('0x22')](function(_0x311602){if(_0x311602){throw new db['Sequelize']['ValidationError'](_0x1587('0x4c'));}return db['CannedAnswer'][_0x1587('0x47')](_0x514948[_0x1587('0x45')]);})[_0x1587('0x22')](function(_0x4cd654){var _0x41a281=_0x514948['user'][_0x1587('0x23')]({'plain':!![]});if(!_0x41a281)throw new Error(_0x1587('0x4d'));if(_0x41a281[_0x1587('0x4e')]===_0x1587('0x4f')){var _0x446867=_0x4cd654[_0x1587('0x23')]({'plain':!![]});return db[_0x1587('0x50')][_0x1587('0x44')]({'where':{'name':_0x1587('0x24'),'userProfileId':_0x41a281[_0x1587('0x51')]},'raw':!![]})['then'](function(_0x5399bf){if(_0x5399bf&&_0x5399bf[_0x1587('0x52')]===0x0){return db[_0x1587('0x53')][_0x1587('0x47')]({'name':_0x446867[_0x1587('0x28')],'resourceId':_0x446867['id'],'type':_0x5399bf[_0x1587('0x28')],'sectionId':_0x5399bf['id']},{})[_0x1587('0x22')](function(){return _0x4cd654;});}else{return _0x4cd654;}})[_0x1587('0x42')](function(_0x4f5b37){logger['error'](_0x1587('0x54'),_0x4f5b37);throw _0x4f5b37;});}return _0x4cd654;})['then'](respondWithResult(_0x416178,0xc9))[_0x1587('0x42')](handleError(_0x416178,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 8d148e7..9144db1 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 _0x1afa=['bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','api','moment'];(function(_0x310522,_0x44a838){var _0xa37d9b=function(_0x1d4ddb){while(--_0x1d4ddb){_0x310522['push'](_0x310522['shift']());}};_0xa37d9b(++_0x44a838);}(_0x1afa,0x70));var _0xa1af=function(_0xbea2f0,_0x3fbf98){_0xbea2f0=_0xbea2f0-0x0;var _0x5b4840=_0x1afa[_0xbea2f0];return _0x5b4840;};'use strict';var _=require(_0xa1af('0x0'));var util=require(_0xa1af('0x1'));var logger=require(_0xa1af('0x2'))(_0xa1af('0x3'));var moment=require(_0xa1af('0x4'));var BPromise=require(_0xa1af('0x5'));var rp=require(_0xa1af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1af('0x7'));var config=require(_0xa1af('0x8'));var attributes=require(_0xa1af('0x9'));module[_0xa1af('0xa')]=function(_0x33ee37,_0xf609ff){return _0x33ee37[_0xa1af('0xb')]('CannedAnswer',attributes,{'tableName':_0xa1af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0e01=['exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','rimraf'];(function(_0x35f2ce,_0x137df9){var _0x23aea4=function(_0x3f6819){while(--_0x3f6819){_0x35f2ce['push'](_0x35f2ce['shift']());}};_0x23aea4(++_0x137df9);}(_0x0e01,0x87));var _0x10e0=function(_0x4baf82,_0x4e05f3){_0x4baf82=_0x4baf82-0x0;var _0x3985bd=_0x0e01[_0x4baf82];return _0x3985bd;};'use strict';var _=require(_0x10e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x10e0('0x1'));var moment=require(_0x10e0('0x2'));var BPromise=require(_0x10e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x10e0('0x4'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x10e0('0x5')]=function(_0x4a9f5f,_0x684dac){return _0x4a9f5f[_0x10e0('0x6')]('CannedAnswer',attributes,{'tableName':_0x10e0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10e0('0x8'),'collate':_0x10e0('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 139fe54..34c1dab 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(_0x356e41,_0x1169cc){var _0x5ce4af=function(_0x4d4f26){while(--_0x4d4f26){_0x356e41['push'](_0x356e41['shift']());}};_0x5ce4af(++_0x1169cc);}(_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','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(_0x5ef192,_0x163c5b){var _0x45bea1=function(_0x2cb1c4){while(--_0x2cb1c4){_0x5ef192['push'](_0x5ef192['shift']());}};_0x45bea1(++_0x163c5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 26510a8..d8fbfae 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 _0x508d=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','show','create','isAuthenticated','update'];(function(_0x4b65d8,_0x23f32b){var _0x1d85f6=function(_0x1e802f){while(--_0x1e802f){_0x4b65d8['push'](_0x4b65d8['shift']());}};_0x1d85f6(++_0x23f32b);}(_0x508d,0x1a6));var _0xd508=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x508d[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0xd508('0x0'));var util=require(_0xd508('0x1'));var path=require(_0xd508('0x2'));var timeout=require(_0xd508('0x3'));var express=require(_0xd508('0x4'));var router=express[_0xd508('0x5')]();var fs_extra=require(_0xd508('0x6'));var auth=require(_0xd508('0x7'));var interaction=require(_0xd508('0x8'));var config=require(_0xd508('0x9'));var controller=require(_0xd508('0xa'));router[_0xd508('0xb')]('/',auth['isAuthenticated'](),controller[_0xd508('0xc')]);router[_0xd508('0xb')](_0xd508('0xd'),auth['isAuthenticated'](),controller[_0xd508('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd508('0xf')]);router['put']('/:id',auth[_0xd508('0x10')](),controller[_0xd508('0x11')]);router[_0xd508('0x12')](_0xd508('0xd'),auth[_0xd508('0x10')](),controller['destroy']);module[_0xd508('0x13')]=router; \ No newline at end of file +var _0x3f67=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','put','update'];(function(_0x19441b,_0x5a239b){var _0x16bbd7=function(_0x4f8ecb){while(--_0x4f8ecb){_0x19441b['push'](_0x19441b['shift']());}};_0x16bbd7(++_0x5a239b);}(_0x3f67,0x1d0));var _0x73f6=function(_0x3e4db1,_0x385cd6){_0x3e4db1=_0x3e4db1-0x0;var _0x33ecd5=_0x3f67[_0x3e4db1];return _0x33ecd5;};'use strict';var multer=require(_0x73f6('0x0'));var util=require(_0x73f6('0x1'));var path=require(_0x73f6('0x2'));var timeout=require(_0x73f6('0x3'));var express=require(_0x73f6('0x4'));var router=express[_0x73f6('0x5')]();var fs_extra=require(_0x73f6('0x6'));var auth=require(_0x73f6('0x7'));var interaction=require(_0x73f6('0x8'));var config=require(_0x73f6('0x9'));var controller=require(_0x73f6('0xa'));router[_0x73f6('0xb')]('/',auth['isAuthenticated'](),controller[_0x73f6('0xc')]);router[_0x73f6('0xb')](_0x73f6('0xd'),auth[_0x73f6('0xe')](),controller[_0x73f6('0xf')]);router[_0x73f6('0x10')]('/',auth[_0x73f6('0xe')](),controller['create']);router[_0x73f6('0x11')](_0x73f6('0xd'),auth[_0x73f6('0xe')](),controller[_0x73f6('0x12')]);router[_0x73f6('0x13')](_0x73f6('0xd'),auth[_0x73f6('0xe')](),controller[_0x73f6('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index f20c812..6327cf6 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 _0xd957=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2dd2bc,_0x20cd80){var _0x57e3b6=function(_0x1194ea){while(--_0x1194ea){_0x2dd2bc['push'](_0x2dd2bc['shift']());}};_0x57e3b6(++_0x20cd80);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x7d95('0x2')},'clid':{'type':Sequelize[_0x7d95('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x7d95('0x3')]},'dcontext':{'type':Sequelize[_0x7d95('0x3')]},'channel':{'type':Sequelize[_0x7d95('0x3')]},'dstchannel':{'type':Sequelize[_0x7d95('0x3')]},'lastapp':{'type':Sequelize[_0x7d95('0x3')]},'lastdata':{'type':Sequelize[_0x7d95('0x3')]},'duration':{'type':Sequelize[_0x7d95('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7d95('0x3')]},'amaflags':{'type':Sequelize[_0x7d95('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7d95('0x3')]},'uniqueid':{'type':Sequelize[_0x7d95('0x3')]},'linkedid':{'type':Sequelize[_0x7d95('0x3')]},'sequence':{'type':Sequelize[_0x7d95('0x3')]},'peeraccount':{'type':Sequelize[_0x7d95('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x7d95('0x3')]}}; \ No newline at end of file +var _0x475d=['sequelize','exports','STRING','INTEGER'];(function(_0x3d1202,_0x171153){var _0x59fa79=function(_0x521bf7){while(--_0x521bf7){_0x3d1202['push'](_0x3d1202['shift']());}};_0x59fa79(++_0x171153);}(_0x475d,0x110));var _0xd475=function(_0xb518e5,_0x5b627c){_0xb518e5=_0xb518e5-0x0;var _0x59c78e=_0x475d[_0xb518e5];return _0x59c78e;};'use strict';var Sequelize=require(_0xd475('0x0'));module[_0xd475('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd475('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xd475('0x2')]},'channel':{'type':Sequelize[_0xd475('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd475('0x2')]},'lastdata':{'type':Sequelize[_0xd475('0x2')]},'duration':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd475('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd475('0x2')]},'uniqueid':{'type':Sequelize[_0xd475('0x2')]},'linkedid':{'type':Sequelize[_0xd475('0x2')]},'sequence':{'type':Sequelize[_0xd475('0x2')]},'peeraccount':{'type':Sequelize[_0xd475('0x2')]},'type':{'type':Sequelize[_0xd475('0x2')]},'tag':{'type':Sequelize[_0xd475('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ffe32e0..4b7b67f 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 _0xe0ae=['where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','catch','create','body','update','find','describe','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0xe0ae,0xa1));var _0xee0a=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0xe0ae[_0x2652ef];return _0x2db578;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee0a('0x0'));var jsonpatch=require(_0xee0a('0x1'));var rp=require('request-promise');var moment=require(_0xee0a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xee0a('0x3'));var util=require(_0xee0a('0x4'));var path=require('path');var sox=require(_0xee0a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee0a('0x6'));var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xee0a('0xe'));var hardwareService=require(_0xee0a('0xf'));var logger=require('../../config/logger')(_0xee0a('0x10'));var utils=require('../../config/utils');var config=require(_0xee0a('0x11'));var licenseUtil=require(_0xee0a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fcf59,_0x5c56d9){_0x5c56d9=_0x5c56d9||0xcc;return function(_0x32fad9){if(_0x32fad9){return _0x1fcf59[_0xee0a('0x13')](_0x5c56d9);}return _0x1fcf59['status'](_0x5c56d9)['end']();};}function respondWithResult(_0x325a8e,_0x41b70a){_0x41b70a=_0x41b70a||0xc8;return function(_0x347604){if(_0x347604){return _0x325a8e[_0xee0a('0x14')](_0x41b70a)[_0xee0a('0x15')](_0x347604);}};}function respondWithFilteredResult(_0x57afe6,_0xb891a9){return function(_0xd39431){if(_0xd39431){var _0x50063f=typeof _0xb891a9[_0xee0a('0x16')]===_0xee0a('0x17')&&typeof _0xb891a9[_0xee0a('0x18')]===_0xee0a('0x17');var _0x4f711b=_0xd39431[_0xee0a('0x19')];var _0x1d7a8a=_0x50063f?0x0:_0xb891a9[_0xee0a('0x16')];var _0x55c474=_0x50063f?_0xd39431[_0xee0a('0x19')]:_0xb891a9[_0xee0a('0x16')]+_0xb891a9[_0xee0a('0x18')];var _0x24f8f1;if(_0x55c474>=_0x4f711b){_0x55c474=_0x4f711b;_0x24f8f1=0xc8;}else{_0x24f8f1=0xce;}_0x57afe6['status'](_0x24f8f1);return _0x57afe6[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x1d7a8a+'-'+_0x55c474+'/'+_0x4f711b)[_0xee0a('0x15')](_0xd39431);}return null;};}function patchUpdates(_0x201d32){return function(_0x5c981e){try{jsonpatch[_0xee0a('0x1c')](_0x5c981e,_0x201d32,!![]);}catch(_0xff2f14){return BPromise[_0xee0a('0x1d')](_0xff2f14);}return _0x5c981e[_0xee0a('0x1e')]();};}function saveUpdates(_0x39fa96,_0x1eb176){return function(_0x2c543c){if(_0x2c543c){return _0x2c543c['update'](_0x39fa96)[_0xee0a('0x1f')](function(_0x3d5459){return _0x3d5459;});}return null;};}function removeEntity(_0x27989c,_0x38d029){return function(_0x567810){if(_0x567810){return _0x567810[_0xee0a('0x20')]()[_0xee0a('0x1f')](function(){_0x27989c[_0xee0a('0x14')](0xcc)[_0xee0a('0x21')]();});}};}function handleEntityNotFound(_0x4c61e2,_0x50e9d1){return function(_0x578ecf){if(!_0x578ecf){_0x4c61e2[_0xee0a('0x13')](0x194);}return _0x578ecf;};}function handleError(_0x4f9f56,_0x5c7cfa){_0x5c7cfa=_0x5c7cfa||0x1f4;return function(_0x1c9ad8){logger[_0xee0a('0x22')](_0x1c9ad8[_0xee0a('0x23')]);if(_0x1c9ad8['name']){delete _0x1c9ad8[_0xee0a('0x24')];}_0x4f9f56[_0xee0a('0x14')](_0x5c7cfa)[_0xee0a('0x25')](_0x1c9ad8);};}exports[_0xee0a('0x26')]=function(_0x2e7f18,_0x45538d){var _0x145332={},_0x408909={},_0x65e054={'count':0x0,'rows':[]};var _0x7b472b=_['map'](db[_0xee0a('0x27')][_0xee0a('0x28')],function(_0x284be5){return{'name':_0x284be5[_0xee0a('0x29')],'type':_0x284be5[_0xee0a('0x2a')][_0xee0a('0x2b')]};});_0x408909['model']=_[_0xee0a('0x2c')](_0x7b472b,_0xee0a('0x24'));_0x408909[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x2e7f18['query']);_0x408909[_0xee0a('0x2f')]=_['intersection'](_0x408909[_0xee0a('0x30')],_0x408909[_0xee0a('0x2d')]);_0x145332[_0xee0a('0x31')]=_[_0xee0a('0x32')](_0x408909[_0xee0a('0x30')],qs[_0xee0a('0x33')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x33')]));_0x145332['attributes']=_0x145332[_0xee0a('0x31')][_0xee0a('0x34')]?_0x145332['attributes']:_0x408909[_0xee0a('0x30')];if(!_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x35')]('nolimit')){_0x145332[_0xee0a('0x18')]=qs[_0xee0a('0x18')](_0x2e7f18[_0xee0a('0x2d')]['limit']);_0x145332[_0xee0a('0x16')]=qs[_0xee0a('0x16')](_0x2e7f18[_0xee0a('0x2d')]['offset']);}_0x145332['order']=qs[_0xee0a('0x36')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x36')]);_0x145332[_0xee0a('0x37')]=qs[_0xee0a('0x2f')](_[_0xee0a('0x38')](_0x2e7f18[_0xee0a('0x2d')],_0x408909[_0xee0a('0x2f')]),_0x7b472b);if(_0x2e7f18[_0xee0a('0x2d')]['filter']){_0x145332[_0xee0a('0x37')]=_[_0xee0a('0x39')](_0x145332['where'],{'$or':_[_0xee0a('0x2c')](_0x7b472b,function(_0x20a6f2){if(_0x20a6f2['type']!==_0xee0a('0x3a')){var _0x22b1c0={};_0x22b1c0[_0x20a6f2[_0xee0a('0x24')]]={'$like':'%'+_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x3b')]+'%'};return _0x22b1c0;}})});}_0x145332=_[_0xee0a('0x39')]({},_0x145332,_0x2e7f18[_0xee0a('0x3c')]);var _0x1b88df={'where':_0x145332[_0xee0a('0x37')]};return db['Cdr'][_0xee0a('0x19')](_0x1b88df)[_0xee0a('0x1f')](function(_0x41eba8){_0x65e054[_0xee0a('0x19')]=_0x41eba8;if(_0x2e7f18['query']['includeAll']){_0x145332[_0xee0a('0x3d')]=[{'all':!![]}];}return db[_0xee0a('0x27')][_0xee0a('0x3e')](_0x145332);})[_0xee0a('0x1f')](function(_0x1b69b9){_0x65e054[_0xee0a('0x3f')]=_0x1b69b9;return _0x65e054;})[_0xee0a('0x1f')](respondWithFilteredResult(_0x45538d,_0x145332))['catch'](handleError(_0x45538d,null));};exports['show']=function(_0x285543,_0x283062){var _0x587ee3={'raw':!![],'where':{'id':_0x285543[_0xee0a('0x40')]['id']}},_0x3293b5={};_0x3293b5['model']=_[_0xee0a('0x2e')](db[_0xee0a('0x27')][_0xee0a('0x28')]);_0x3293b5[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x285543[_0xee0a('0x2d')]);_0x3293b5[_0xee0a('0x2f')]=_['intersection'](_0x3293b5['model'],_0x3293b5[_0xee0a('0x2d')]);_0x587ee3['attributes']=_['intersection'](_0x3293b5['model'],qs[_0xee0a('0x33')](_0x285543[_0xee0a('0x2d')]['fields']));_0x587ee3['attributes']=_0x587ee3['attributes']['length']?_0x587ee3[_0xee0a('0x31')]:_0x3293b5[_0xee0a('0x30')];if(_0x285543[_0xee0a('0x2d')][_0xee0a('0x41')]){_0x587ee3[_0xee0a('0x3d')]=[{'all':!![]}];}_0x587ee3=_[_0xee0a('0x39')]({},_0x587ee3,_0x285543['options']);return db[_0xee0a('0x27')]['find'](_0x587ee3)[_0xee0a('0x1f')](handleEntityNotFound(_0x283062,null))[_0xee0a('0x1f')](respondWithResult(_0x283062,null))[_0xee0a('0x42')](handleError(_0x283062,null));};exports[_0xee0a('0x43')]=function(_0x567680,_0x3ef07b){return db[_0xee0a('0x27')][_0xee0a('0x43')](_0x567680[_0xee0a('0x44')],{})[_0xee0a('0x1f')](respondWithResult(_0x3ef07b,0xc9))[_0xee0a('0x42')](handleError(_0x3ef07b,null));};exports[_0xee0a('0x45')]=function(_0x4cd7d3,_0x51300e){if(_0x4cd7d3[_0xee0a('0x44')]['id']){delete _0x4cd7d3[_0xee0a('0x44')]['id'];}return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x4cd7d3[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x51300e,null))[_0xee0a('0x1f')](saveUpdates(_0x4cd7d3[_0xee0a('0x44')],null))[_0xee0a('0x1f')](respondWithResult(_0x51300e,null))[_0xee0a('0x42')](handleError(_0x51300e,null));};exports[_0xee0a('0x20')]=function(_0x335356,_0x57face){return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x335356[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x57face,null))[_0xee0a('0x1f')](removeEntity(_0x57face,null))['catch'](handleError(_0x57face,null));};exports[_0xee0a('0x47')]=function(_0x160123,_0xc9c3a3){return db[_0xee0a('0x27')][_0xee0a('0x47')]()['then'](respondWithResult(_0xc9c3a3,null))[_0xee0a('0x42')](handleError(_0xc9c3a3,null));}; \ No newline at end of file +var _0x919e=['Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','map'];(function(_0x24fa83,_0x4df1a8){var _0x520fd3=function(_0x7c12f1){while(--_0x7c12f1){_0x24fa83['push'](_0x24fa83['shift']());}};_0x520fd3(++_0x4df1a8);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe919('0x0'));var rimraf=require(_0xe919('0x1'));var zipdir=require(_0xe919('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe919('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe919('0x4'));var util=require(_0xe919('0x5'));var path=require(_0xe919('0x6'));var sox=require(_0xe919('0x7'));var csv=require(_0xe919('0x8'));var ejs=require(_0xe919('0x9'));var fs=require('fs');var fs_extra=require(_0xe919('0xa'));var _=require('lodash');var squel=require(_0xe919('0xb'));var crypto=require(_0xe919('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe919('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe919('0xe'));var Papa=require(_0xe919('0xf'));var Redis=require(_0xe919('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe919('0x11'));var as=require(_0xe919('0x12'));var hardwareService=require(_0xe919('0x13'));var logger=require('../../config/logger')(_0xe919('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe919('0x15'))['db'];function respondWithStatusCode(_0xb06def,_0x40d013){_0x40d013=_0x40d013||0xcc;return function(_0x525f3e){if(_0x525f3e){return _0xb06def['sendStatus'](_0x40d013);}return _0xb06def[_0xe919('0x16')](_0x40d013)[_0xe919('0x17')]();};}function respondWithResult(_0x5c44d4,_0x3c09be){_0x3c09be=_0x3c09be||0xc8;return function(_0x1f88a0){if(_0x1f88a0){return _0x5c44d4[_0xe919('0x16')](_0x3c09be)[_0xe919('0x18')](_0x1f88a0);}};}function respondWithFilteredResult(_0x1e2bdd,_0x20d095){return function(_0x33b067){if(_0x33b067){var _0x5768f8=typeof _0x20d095[_0xe919('0x19')]==='undefined'&&typeof _0x20d095['limit']===_0xe919('0x1a');var _0x1ca098=_0x33b067['count'];var _0x4b3ea3=_0x5768f8?0x0:_0x20d095['offset'];var _0x1c820f=_0x5768f8?_0x33b067[_0xe919('0x1b')]:_0x20d095[_0xe919('0x19')]+_0x20d095[_0xe919('0x1c')];var _0x4a6945;if(_0x1c820f>=_0x1ca098){_0x1c820f=_0x1ca098;_0x4a6945=0xc8;}else{_0x4a6945=0xce;}_0x1e2bdd['status'](_0x4a6945);return _0x1e2bdd[_0xe919('0x1d')](_0xe919('0x1e'),_0x4b3ea3+'-'+_0x1c820f+'/'+_0x1ca098)[_0xe919('0x18')](_0x33b067);}return null;};}function patchUpdates(_0xd2a816){return function(_0x48d99f){try{jsonpatch[_0xe919('0x1f')](_0x48d99f,_0xd2a816,!![]);}catch(_0xc39074){return BPromise['reject'](_0xc39074);}return _0x48d99f['save']();};}function saveUpdates(_0x175b39,_0x483515){return function(_0x53e428){if(_0x53e428){return _0x53e428[_0xe919('0x20')](_0x175b39)[_0xe919('0x21')](function(_0x57056a){return _0x57056a;});}return null;};}function removeEntity(_0x26e01d,_0x5694b0){return function(_0x422934){if(_0x422934){return _0x422934[_0xe919('0x22')]()['then'](function(){_0x26e01d[_0xe919('0x16')](0xcc)[_0xe919('0x17')]();});}};}function handleEntityNotFound(_0x4607f5,_0x509bfa){return function(_0x2bb8d6){if(!_0x2bb8d6){_0x4607f5[_0xe919('0x23')](0x194);}return _0x2bb8d6;};}function handleError(_0x58f7a3,_0x19580b){_0x19580b=_0x19580b||0x1f4;return function(_0x354849){logger[_0xe919('0x24')](_0x354849['stack']);if(_0x354849[_0xe919('0x25')]){delete _0x354849['name'];}_0x58f7a3[_0xe919('0x16')](_0x19580b)[_0xe919('0x26')](_0x354849);};}exports['index']=function(_0x29b693,_0x5adb9b){var _0x101522={},_0x46d4f4={},_0x16d3a2={'count':0x0,'rows':[]};var _0x50e5cc=_[_0xe919('0x27')](db[_0xe919('0x28')][_0xe919('0x29')],function(_0x1090d4){return{'name':_0x1090d4[_0xe919('0x2a')],'type':_0x1090d4[_0xe919('0x2b')][_0xe919('0x2c')]};});_0x46d4f4[_0xe919('0x2d')]=_['map'](_0x50e5cc,_0xe919('0x25'));_0x46d4f4[_0xe919('0x2e')]=_['keys'](_0x29b693['query']);_0x46d4f4[_0xe919('0x2f')]=_[_0xe919('0x30')](_0x46d4f4[_0xe919('0x2d')],_0x46d4f4[_0xe919('0x2e')]);_0x101522[_0xe919('0x31')]=_[_0xe919('0x30')](_0x46d4f4[_0xe919('0x2d')],qs[_0xe919('0x32')](_0x29b693['query'][_0xe919('0x32')]));_0x101522[_0xe919('0x31')]=_0x101522[_0xe919('0x31')][_0xe919('0x33')]?_0x101522[_0xe919('0x31')]:_0x46d4f4[_0xe919('0x2d')];if(!_0x29b693[_0xe919('0x2e')][_0xe919('0x34')](_0xe919('0x35'))){_0x101522['limit']=qs[_0xe919('0x1c')](_0x29b693['query'][_0xe919('0x1c')]);_0x101522['offset']=qs['offset'](_0x29b693[_0xe919('0x2e')]['offset']);}_0x101522[_0xe919('0x36')]=qs[_0xe919('0x37')](_0x29b693['query']['sort']);_0x101522[_0xe919('0x38')]=qs[_0xe919('0x2f')](_[_0xe919('0x39')](_0x29b693[_0xe919('0x2e')],_0x46d4f4[_0xe919('0x2f')]),_0x50e5cc);if(_0x29b693[_0xe919('0x2e')][_0xe919('0x3a')]){_0x101522[_0xe919('0x38')]=_[_0xe919('0x3b')](_0x101522[_0xe919('0x38')],{'$or':_[_0xe919('0x27')](_0x50e5cc,function(_0x160774){if(_0x160774[_0xe919('0x2b')]!==_0xe919('0x3c')){var _0x35de99={};_0x35de99[_0x160774['name']]={'$like':'%'+_0x29b693[_0xe919('0x2e')][_0xe919('0x3a')]+'%'};return _0x35de99;}})});}_0x101522=_['merge']({},_0x101522,_0x29b693[_0xe919('0x3d')]);var _0xe34037={'where':_0x101522[_0xe919('0x38')]};return db[_0xe919('0x28')][_0xe919('0x1b')](_0xe34037)[_0xe919('0x21')](function(_0x48a291){_0x16d3a2[_0xe919('0x1b')]=_0x48a291;if(_0x29b693['query'][_0xe919('0x3e')]){_0x101522[_0xe919('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0xe919('0x40')](_0x101522);})[_0xe919('0x21')](function(_0x717cce){_0x16d3a2[_0xe919('0x41')]=_0x717cce;return _0x16d3a2;})[_0xe919('0x21')](respondWithFilteredResult(_0x5adb9b,_0x101522))[_0xe919('0x42')](handleError(_0x5adb9b,null));};exports[_0xe919('0x43')]=function(_0x347384,_0xf4ec66){var _0x435bd8={'raw':!![],'where':{'id':_0x347384[_0xe919('0x44')]['id']}},_0x4cbdea={};_0x4cbdea['model']=_['keys'](db[_0xe919('0x28')][_0xe919('0x29')]);_0x4cbdea['query']=_[_0xe919('0x45')](_0x347384[_0xe919('0x2e')]);_0x4cbdea[_0xe919('0x2f')]=_['intersection'](_0x4cbdea[_0xe919('0x2d')],_0x4cbdea[_0xe919('0x2e')]);_0x435bd8[_0xe919('0x31')]=_[_0xe919('0x30')](_0x4cbdea['model'],qs[_0xe919('0x32')](_0x347384[_0xe919('0x2e')]['fields']));_0x435bd8[_0xe919('0x31')]=_0x435bd8[_0xe919('0x31')][_0xe919('0x33')]?_0x435bd8[_0xe919('0x31')]:_0x4cbdea[_0xe919('0x2d')];if(_0x347384['query'][_0xe919('0x3e')]){_0x435bd8['include']=[{'all':!![]}];}_0x435bd8=_[_0xe919('0x3b')]({},_0x435bd8,_0x347384[_0xe919('0x3d')]);return db[_0xe919('0x28')][_0xe919('0x46')](_0x435bd8)[_0xe919('0x21')](handleEntityNotFound(_0xf4ec66,null))[_0xe919('0x21')](respondWithResult(_0xf4ec66,null))[_0xe919('0x42')](handleError(_0xf4ec66,null));};exports['create']=function(_0x3cd8f4,_0x19d7b3){return db[_0xe919('0x28')]['create'](_0x3cd8f4[_0xe919('0x47')],{})[_0xe919('0x21')](respondWithResult(_0x19d7b3,0xc9))['catch'](handleError(_0x19d7b3,null));};exports[_0xe919('0x20')]=function(_0x3da722,_0x300d64){if(_0x3da722[_0xe919('0x47')]['id']){delete _0x3da722[_0xe919('0x47')]['id'];}return db[_0xe919('0x28')]['find']({'where':{'id':_0x3da722[_0xe919('0x44')]['id']}})[_0xe919('0x21')](handleEntityNotFound(_0x300d64,null))['then'](saveUpdates(_0x3da722[_0xe919('0x47')],null))[_0xe919('0x21')](respondWithResult(_0x300d64,null))[_0xe919('0x42')](handleError(_0x300d64,null));};exports[_0xe919('0x22')]=function(_0x125160,_0x1aae2c){return db[_0xe919('0x28')][_0xe919('0x46')]({'where':{'id':_0x125160[_0xe919('0x44')]['id']}})[_0xe919('0x21')](handleEntityNotFound(_0x1aae2c,null))['then'](removeEntity(_0x1aae2c,null))[_0xe919('0x42')](handleError(_0x1aae2c,null));};exports[_0xe919('0x48')]=function(_0x3a44bb,_0x3d4b2a){return db[_0xe919('0x28')][_0xe919('0x48')]()[_0xe919('0x21')](respondWithResult(_0x3d4b2a,null))[_0xe919('0x42')](handleError(_0x3d4b2a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b210e18..b86a0be 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(_0x11a9e3,_0x567aef){var _0x58b7c8=function(_0x4b74f1){while(--_0x4b74f1){_0x11a9e3['push'](_0x11a9e3['shift']());}};_0x58b7c8(++_0x567aef);}(_0x7a54,0x106));var _0x47a5=function(_0x2bcd8b,_0x4e9062){_0x2bcd8b=_0x2bcd8b-0x0;var _0x4f9133=_0x7a54[_0x2bcd8b];return _0x4f9133;};'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(_0xcc5b09,_0x17464d){var _0x1f165e=function(_0x211199){while(--_0x211199){_0xcc5b09['push'](_0xcc5b09['shift']());}};_0x1f165e(++_0x17464d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 cf0b894..2079577 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 _0x09d6=['jayson/promise','http','then','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x407db6,_0x11bd0e){var _0x3013f4=function(_0x23d84e){while(--_0x23d84e){_0x407db6['push'](_0x407db6['shift']());}};_0x3013f4(++_0x11bd0e);}(_0x09d6,0xdf));var _0x609d=function(_0x5bf2a1,_0x5ec237){_0x5bf2a1=_0x5bf2a1-0x0;var _0x27b22c=_0x09d6[_0x5bf2a1];return _0x27b22c;};'use strict';var _=require(_0x609d('0x0'));var util=require('util');var moment=require(_0x609d('0x1'));var BPromise=require(_0x609d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x609d('0x3'));var db=require(_0x609d('0x4'))['db'];var utils=require(_0x609d('0x5'));var logger=require('../../config/logger')(_0x609d('0x6'));var config=require(_0x609d('0x7'));var jayson=require(_0x609d('0x8'));var client=jayson['client'][_0x609d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17ef50,_0x104d2e,_0x1e1499){return new BPromise(function(_0x5017b3,_0x3810a8){return client['request'](_0x17ef50,_0x1e1499)[_0x609d('0xa')](function(_0x58c921){logger['info']('Cdr,\x20%s,\x20%s',_0x104d2e,_0x609d('0xb'));logger[_0x609d('0xc')](_0x609d('0xd'),_0x104d2e,_0x609d('0xb'),JSON[_0x609d('0xe')](_0x58c921));if(_0x58c921[_0x609d('0xf')]){if(_0x58c921['error'][_0x609d('0x10')]===0x1f4){logger['error'](_0x609d('0x11'),_0x104d2e,_0x58c921['error']['message']);return _0x3810a8(_0x58c921[_0x609d('0xf')][_0x609d('0x12')]);}logger[_0x609d('0xf')](_0x609d('0x11'),_0x104d2e,_0x58c921[_0x609d('0xf')][_0x609d('0x12')]);return _0x5017b3(_0x58c921[_0x609d('0xf')][_0x609d('0x12')]);}else{logger[_0x609d('0x13')](_0x609d('0x11'),_0x104d2e,_0x609d('0xb'));_0x5017b3(_0x58c921[_0x609d('0x14')][_0x609d('0x12')]);}})['catch'](function(_0x207651){logger[_0x609d('0xf')](_0x609d('0x11'),_0x104d2e,_0x207651);_0x3810a8(_0x207651);});});} \ No newline at end of file +var _0x75ac=['jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x7b192a,_0x4db383){var _0x33ba94=function(_0x14e55a){while(--_0x14e55a){_0x7b192a['push'](_0x7b192a['shift']());}};_0x33ba94(++_0x4db383);}(_0x75ac,0x151));var _0xc75a=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x75ac[_0x363ef8];return _0x148822;};'use strict';var _=require('lodash');var util=require(_0xc75a('0x0'));var moment=require(_0xc75a('0x1'));var BPromise=require(_0xc75a('0x2'));var rs=require(_0xc75a('0x3'));var fs=require('fs');var Redis=require(_0xc75a('0x4'));var db=require(_0xc75a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc75a('0x6'));var config=require(_0xc75a('0x7'));var jayson=require(_0xc75a('0x8'));var client=jayson[_0xc75a('0x9')][_0xc75a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189897,_0x303e75,_0x408923){return new BPromise(function(_0xadaaac,_0xbc9677){return client[_0xc75a('0xb')](_0x189897,_0x408923)[_0xc75a('0xc')](function(_0x5024c7){logger[_0xc75a('0xd')]('Cdr,\x20%s,\x20%s',_0x303e75,_0xc75a('0xe'));logger[_0xc75a('0xf')](_0xc75a('0x10'),_0x303e75,_0xc75a('0xe'),JSON[_0xc75a('0x11')](_0x5024c7));if(_0x5024c7[_0xc75a('0x12')]){if(_0x5024c7[_0xc75a('0x12')][_0xc75a('0x13')]===0x1f4){logger[_0xc75a('0x12')](_0xc75a('0x14'),_0x303e75,_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);return _0xbc9677(_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);}logger[_0xc75a('0x12')](_0xc75a('0x14'),_0x303e75,_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);return _0xadaaac(_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);}else{logger[_0xc75a('0xd')](_0xc75a('0x14'),_0x303e75,_0xc75a('0xe'));_0xadaaac(_0x5024c7['result'][_0xc75a('0x15')]);}})[_0xc75a('0x16')](function(_0x4026a5){logger['error'](_0xc75a('0x14'),_0x303e75,_0x4026a5);_0xbc9677(_0x4026a5);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d8fdea0..c9207c6 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2c5c39,_0x2f303f){var _0x36c20f=function(_0x27310c){while(--_0x27310c){_0x2c5c39['push'](_0x2c5c39['shift']());}};_0x36c20f(++_0x2f303f);}(_0xb10b,0x12a));var _0xbb10=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xb10b[_0x555069];return _0x100af7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 2e9bbe7..e18fb4d 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 _0x1859=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x1859,0x183));var _0x9185=function(_0x49aea6,_0x164d24){_0x49aea6=_0x49aea6-0x0;var _0x54f4d4=_0x1859[_0x49aea6];return _0x54f4d4;};'use strict';var Sequelize=require(_0x9185('0x0'));module[_0x9185('0x1')]={'priority':{'type':Sequelize[_0x9185('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9185('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9185('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9185('0x3')],'defaultValue':_0x9185('0x5')}}; \ No newline at end of file +var _0xa06c=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xa06c,0x125));var _0xca06=function(_0xb82f1b,_0x412bde){_0xb82f1b=_0xb82f1b-0x0;var _0x35cdbf=_0xa06c[_0xb82f1b];return _0x35cdbf;};'use strict';var Sequelize=require('sequelize');module[_0xca06('0x0')]={'priority':{'type':Sequelize[_0xca06('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xca06('0x2')],'allowNull':![],'defaultValue':_0xca06('0x3')},'appdata':{'type':Sequelize[_0xca06('0x4')]()},'description':{'type':Sequelize[_0xca06('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xca06('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 2f4319b..fe3a1cd 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 _0x30fe=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x30fe,0x149));var _0xe30f=function(_0x1ae8d4,_0x3ae445){_0x1ae8d4=_0x1ae8d4-0x0;var _0x3d48c6=_0x30fe[_0x1ae8d4];return _0x3d48c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe30f('0x1'));var rp=require('request-promise');var moment=require(_0xe30f('0x2'));var BPromise=require(_0xe30f('0x3'));var Mustache=require(_0xe30f('0x4'));var util=require(_0xe30f('0x5'));var path=require(_0xe30f('0x6'));var sox=require('sox');var csv=require(_0xe30f('0x7'));var ejs=require(_0xe30f('0x8'));var fs=require('fs');var fs_extra=require(_0xe30f('0x9'));var _=require(_0xe30f('0xa'));var squel=require(_0xe30f('0xb'));var crypto=require(_0xe30f('0xc'));var jsforce=require(_0xe30f('0xd'));var deskjs=require(_0xe30f('0xe'));var toCsv=require(_0xe30f('0x7'));var querystring=require(_0xe30f('0xf'));var Papa=require('papaparse');var Redis=require(_0xe30f('0x10'));var authService=require(_0xe30f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe30f('0x12'));var hardwareService=require(_0xe30f('0x13'));var logger=require(_0xe30f('0x14'))(_0xe30f('0x15'));var utils=require('../../config/utils');var config=require(_0xe30f('0x16'));var licenseUtil=require(_0xe30f('0x17'));var db=require(_0xe30f('0x18'))['db'];function respondWithStatusCode(_0x583eb9,_0x3859df){_0x3859df=_0x3859df||0xcc;return function(_0x19970e){if(_0x19970e){return _0x583eb9[_0xe30f('0x19')](_0x3859df);}return _0x583eb9['status'](_0x3859df)[_0xe30f('0x1a')]();};}function respondWithResult(_0x460e07,_0x122e2a){_0x122e2a=_0x122e2a||0xc8;return function(_0x7d684c){if(_0x7d684c){return _0x460e07['status'](_0x122e2a)['json'](_0x7d684c);}};}function respondWithFilteredResult(_0x5ac4b2,_0x3c9680){return function(_0x494ad3){if(_0x494ad3){var _0x2b6a9b=typeof _0x3c9680[_0xe30f('0x1b')]==='undefined'&&typeof _0x3c9680[_0xe30f('0x1c')]==='undefined';var _0x2dbb2b=_0x494ad3[_0xe30f('0x1d')];var _0x406c98=_0x2b6a9b?0x0:_0x3c9680[_0xe30f('0x1b')];var _0x17024a=_0x2b6a9b?_0x494ad3['count']:_0x3c9680['offset']+_0x3c9680[_0xe30f('0x1c')];var _0x535873;if(_0x17024a>=_0x2dbb2b){_0x17024a=_0x2dbb2b;_0x535873=0xc8;}else{_0x535873=0xce;}_0x5ac4b2[_0xe30f('0x1e')](_0x535873);return _0x5ac4b2['set'](_0xe30f('0x1f'),_0x406c98+'-'+_0x17024a+'/'+_0x2dbb2b)[_0xe30f('0x20')](_0x494ad3);}return null;};}function patchUpdates(_0x2c4d1f){return function(_0x2a0432){try{jsonpatch[_0xe30f('0x21')](_0x2a0432,_0x2c4d1f,!![]);}catch(_0x5b33fa){return BPromise[_0xe30f('0x22')](_0x5b33fa);}return _0x2a0432['save']();};}function saveUpdates(_0xf66c5a,_0x5af7b5){return function(_0x322ee0){if(_0x322ee0){return _0x322ee0[_0xe30f('0x23')](_0xf66c5a)[_0xe30f('0x24')](function(_0x42833a){return _0x42833a;});}return null;};}function removeEntity(_0x7f7b1f,_0x378d6f){return function(_0x50bca4){if(_0x50bca4){return _0x50bca4[_0xe30f('0x25')]()['then'](function(){_0x7f7b1f[_0xe30f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4fbe,_0x4fc220){return function(_0x11a539){if(!_0x11a539){_0x4d4fbe['sendStatus'](0x194);}return _0x11a539;};}function handleError(_0x412015,_0x25e3cf){_0x25e3cf=_0x25e3cf||0x1f4;return function(_0x37c716){logger[_0xe30f('0x26')](_0x37c716[_0xe30f('0x27')]);if(_0x37c716[_0xe30f('0x28')]){delete _0x37c716['name'];}_0x412015[_0xe30f('0x1e')](_0x25e3cf)[_0xe30f('0x29')](_0x37c716);};}exports['show']=function(_0x15a217,_0x2d67d4){var _0x5a6cc3={'raw':!![],'where':{'id':_0x15a217['params']['id']}},_0x500626={};_0x500626[_0xe30f('0x2a')]=_[_0xe30f('0x2b')](db[_0xe30f('0x2c')][_0xe30f('0x2d')]);_0x500626[_0xe30f('0x2e')]=_[_0xe30f('0x2b')](_0x15a217['query']);_0x500626[_0xe30f('0x2f')]=_['intersection'](_0x500626[_0xe30f('0x2a')],_0x500626[_0xe30f('0x2e')]);_0x5a6cc3[_0xe30f('0x30')]=_[_0xe30f('0x31')](_0x500626['model'],qs[_0xe30f('0x32')](_0x15a217[_0xe30f('0x2e')][_0xe30f('0x32')]));_0x5a6cc3['attributes']=_0x5a6cc3[_0xe30f('0x30')]['length']?_0x5a6cc3[_0xe30f('0x30')]:_0x500626[_0xe30f('0x2a')];if(_0x15a217[_0xe30f('0x2e')][_0xe30f('0x33')]){_0x5a6cc3['include']=[{'all':!![]}];}_0x5a6cc3=_[_0xe30f('0x34')]({},_0x5a6cc3,_0x15a217[_0xe30f('0x35')]);return db[_0xe30f('0x2c')][_0xe30f('0x36')](_0x5a6cc3)[_0xe30f('0x24')](handleEntityNotFound(_0x2d67d4,null))[_0xe30f('0x24')](respondWithResult(_0x2d67d4,null))[_0xe30f('0x37')](handleError(_0x2d67d4,null));};exports['update']=function(_0x139915,_0xcc659c){if(_0x139915[_0xe30f('0x38')]['id']){delete _0x139915['body']['id'];}return db[_0xe30f('0x2c')][_0xe30f('0x36')]({'where':{'id':_0x139915['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0xcc659c,null))['then'](saveUpdates(_0x139915[_0xe30f('0x38')],null))['then'](respondWithResult(_0xcc659c,null))['catch'](handleError(_0xcc659c,null));};exports['destroy']=function(_0xf09327,_0x86fbbc){return db['ChatApplication'][_0xe30f('0x36')]({'where':{'id':_0xf09327['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0x86fbbc,null))[_0xe30f('0x24')](removeEntity(_0x86fbbc,null))[_0xe30f('0x37')](handleError(_0x86fbbc,null));}; \ No newline at end of file +var _0x205d=['intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys'];(function(_0xb4a6da,_0x4c1e9e){var _0x4f7bea=function(_0x443f96){while(--_0x443f96){_0xb4a6da['push'](_0xb4a6da['shift']());}};_0x4f7bea(++_0x4c1e9e);}(_0x205d,0xf6));var _0xd205=function(_0x4f4e4b,_0x46ea73){_0x4f4e4b=_0x4f4e4b-0x0;var _0x23a628=_0x205d[_0x4f4e4b];return _0x23a628;};'use strict';var emlformat=require(_0xd205('0x0'));var rimraf=require(_0xd205('0x1'));var zipdir=require(_0xd205('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd205('0x3'));var BPromise=require(_0xd205('0x4'));var Mustache=require(_0xd205('0x5'));var util=require('util');var path=require(_0xd205('0x6'));var sox=require(_0xd205('0x7'));var csv=require(_0xd205('0x8'));var ejs=require(_0xd205('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd205('0xa'));var squel=require(_0xd205('0xb'));var crypto=require(_0xd205('0xc'));var jsforce=require(_0xd205('0xd'));var deskjs=require(_0xd205('0xe'));var toCsv=require(_0xd205('0x8'));var querystring=require(_0xd205('0xf'));var Papa=require(_0xd205('0x10'));var Redis=require(_0xd205('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd205('0x12'));var as=require(_0xd205('0x13'));var hardwareService=require(_0xd205('0x14'));var logger=require(_0xd205('0x15'))('api');var utils=require(_0xd205('0x16'));var config=require(_0xd205('0x17'));var licenseUtil=require(_0xd205('0x18'));var db=require(_0xd205('0x19'))['db'];function respondWithStatusCode(_0x1ba89e,_0x23ec66){_0x23ec66=_0x23ec66||0xcc;return function(_0xd53838){if(_0xd53838){return _0x1ba89e['sendStatus'](_0x23ec66);}return _0x1ba89e[_0xd205('0x1a')](_0x23ec66)[_0xd205('0x1b')]();};}function respondWithResult(_0x2ad6db,_0x4f62d8){_0x4f62d8=_0x4f62d8||0xc8;return function(_0x584b3f){if(_0x584b3f){return _0x2ad6db[_0xd205('0x1a')](_0x4f62d8)['json'](_0x584b3f);}};}function respondWithFilteredResult(_0x177854,_0x4a0805){return function(_0x398fc3){if(_0x398fc3){var _0x3a907a=typeof _0x4a0805[_0xd205('0x1c')]===_0xd205('0x1d')&&typeof _0x4a0805['limit']===_0xd205('0x1d');var _0x3d88e3=_0x398fc3[_0xd205('0x1e')];var _0x135e9d=_0x3a907a?0x0:_0x4a0805[_0xd205('0x1c')];var _0x31eb94=_0x3a907a?_0x398fc3[_0xd205('0x1e')]:_0x4a0805[_0xd205('0x1c')]+_0x4a0805[_0xd205('0x1f')];var _0x5a1429;if(_0x31eb94>=_0x3d88e3){_0x31eb94=_0x3d88e3;_0x5a1429=0xc8;}else{_0x5a1429=0xce;}_0x177854[_0xd205('0x1a')](_0x5a1429);return _0x177854['set']('Content-Range',_0x135e9d+'-'+_0x31eb94+'/'+_0x3d88e3)[_0xd205('0x20')](_0x398fc3);}return null;};}function patchUpdates(_0x5c3c31){return function(_0x53b46e){try{jsonpatch[_0xd205('0x21')](_0x53b46e,_0x5c3c31,!![]);}catch(_0x3b89b4){return BPromise[_0xd205('0x22')](_0x3b89b4);}return _0x53b46e[_0xd205('0x23')]();};}function saveUpdates(_0x162c26,_0x19f710){return function(_0x2ba4cf){if(_0x2ba4cf){return _0x2ba4cf[_0xd205('0x24')](_0x162c26)[_0xd205('0x25')](function(_0x1b0fef){return _0x1b0fef;});}return null;};}function removeEntity(_0x17b032,_0x37cf59){return function(_0x436a3a){if(_0x436a3a){return _0x436a3a[_0xd205('0x26')]()[_0xd205('0x25')](function(){_0x17b032[_0xd205('0x1a')](0xcc)[_0xd205('0x1b')]();});}};}function handleEntityNotFound(_0x2c0369,_0xf798bd){return function(_0x1b5485){if(!_0x1b5485){_0x2c0369['sendStatus'](0x194);}return _0x1b5485;};}function handleError(_0x3dea83,_0x1c3609){_0x1c3609=_0x1c3609||0x1f4;return function(_0xe0f84d){logger[_0xd205('0x27')](_0xe0f84d[_0xd205('0x28')]);if(_0xe0f84d[_0xd205('0x29')]){delete _0xe0f84d['name'];}_0x3dea83['status'](_0x1c3609)['send'](_0xe0f84d);};}exports[_0xd205('0x2a')]=function(_0x12e354,_0x3bfd88){var _0x102094={'raw':!![],'where':{'id':_0x12e354[_0xd205('0x2b')]['id']}},_0x2486a5={};_0x2486a5[_0xd205('0x2c')]=_['keys'](db[_0xd205('0x2d')][_0xd205('0x2e')]);_0x2486a5[_0xd205('0x2f')]=_[_0xd205('0x30')](_0x12e354['query']);_0x2486a5['filters']=_[_0xd205('0x31')](_0x2486a5[_0xd205('0x2c')],_0x2486a5[_0xd205('0x2f')]);_0x102094['attributes']=_[_0xd205('0x31')](_0x2486a5[_0xd205('0x2c')],qs[_0xd205('0x32')](_0x12e354['query'][_0xd205('0x32')]));_0x102094[_0xd205('0x33')]=_0x102094[_0xd205('0x33')]['length']?_0x102094['attributes']:_0x2486a5[_0xd205('0x2c')];if(_0x12e354['query'][_0xd205('0x34')]){_0x102094[_0xd205('0x35')]=[{'all':!![]}];}_0x102094=_[_0xd205('0x36')]({},_0x102094,_0x12e354[_0xd205('0x37')]);return db['ChatApplication'][_0xd205('0x38')](_0x102094)['then'](handleEntityNotFound(_0x3bfd88,null))[_0xd205('0x25')](respondWithResult(_0x3bfd88,null))[_0xd205('0x39')](handleError(_0x3bfd88,null));};exports['update']=function(_0x8bbb41,_0x526378){if(_0x8bbb41[_0xd205('0x3a')]['id']){delete _0x8bbb41[_0xd205('0x3a')]['id'];}return db[_0xd205('0x2d')][_0xd205('0x38')]({'where':{'id':_0x8bbb41[_0xd205('0x2b')]['id']}})[_0xd205('0x25')](handleEntityNotFound(_0x526378,null))[_0xd205('0x25')](saveUpdates(_0x8bbb41[_0xd205('0x3a')],null))[_0xd205('0x25')](respondWithResult(_0x526378,null))[_0xd205('0x39')](handleError(_0x526378,null));};exports['destroy']=function(_0x38d565,_0x35b82a){return db['ChatApplication']['find']({'where':{'id':_0x38d565['params']['id']}})[_0xd205('0x25')](handleEntityNotFound(_0x35b82a,null))[_0xd205('0x25')](removeEntity(_0x35b82a,null))[_0xd205('0x39')](handleError(_0x35b82a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9989de4..4b6020b 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 _0xb717=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb717,0x1b4));var _0x7b71=function(_0x557fc9,_0x39d16e){_0x557fc9=_0x557fc9-0x0;var _0x26d2c1=_0xb717[_0x557fc9];return _0x26d2c1;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b71('0xc'),'collate':_0x7b71('0xd')});}; \ No newline at end of file +var _0xe29d=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./chatApplication.attributes','ChatApplication'];(function(_0x4ee806,_0x33c72d){var _0x3ddc84=function(_0x2571dc){while(--_0x2571dc){_0x4ee806['push'](_0x4ee806['shift']());}};_0x3ddc84(++_0x33c72d);}(_0xe29d,0x66));var _0xde29=function(_0x114b00,_0x3e8ee){_0x114b00=_0x114b00-0x0;var _0x3e0ad3=_0xe29d[_0x114b00];return _0x3e0ad3;};'use strict';var _=require(_0xde29('0x0'));var util=require('util');var logger=require(_0xde29('0x1'))(_0xde29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde29('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde29('0x4'));var config=require(_0xde29('0x5'));var attributes=require(_0xde29('0x6'));module['exports']=function(_0x151eb8,_0x17cc46){return _0x151eb8['define'](_0xde29('0x7'),attributes,{'tableName':_0xde29('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde29('0x9'),'collate':_0xde29('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index afeda19..c622c57 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 _0x6b95=['jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b95,0x19f));var _0x56b9=function(_0x51fb96,_0x1f33f7){_0x51fb96=_0x51fb96-0x0;var _0x573228=_0x6b95[_0x51fb96];return _0x573228;};'use strict';var _=require(_0x56b9('0x0'));var util=require('util');var moment=require(_0x56b9('0x1'));var BPromise=require(_0x56b9('0x2'));var rs=require(_0x56b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56b9('0x4'));var config=require('../../config/environment');var jayson=require(_0x56b9('0x5'));var client=jayson[_0x56b9('0x6')][_0x56b9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1aae21,_0x4b8148,_0x53336f){return new BPromise(function(_0x2e14a1,_0x115666){return client[_0x56b9('0x8')](_0x1aae21,_0x53336f)[_0x56b9('0x9')](function(_0x3ade31){logger[_0x56b9('0xa')](_0x56b9('0xb'),_0x4b8148,'request\x20sent');logger[_0x56b9('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4b8148,'request\x20sent',JSON[_0x56b9('0xd')](_0x3ade31));if(_0x3ade31[_0x56b9('0xe')]){if(_0x3ade31[_0x56b9('0xe')][_0x56b9('0xf')]===0x1f4){logger[_0x56b9('0xe')](_0x56b9('0xb'),_0x4b8148,_0x3ade31[_0x56b9('0xe')][_0x56b9('0x10')]);return _0x115666(_0x3ade31[_0x56b9('0xe')][_0x56b9('0x10')]);}logger['error'](_0x56b9('0xb'),_0x4b8148,_0x3ade31[_0x56b9('0xe')][_0x56b9('0x10')]);return _0x2e14a1(_0x3ade31['error']['message']);}else{logger[_0x56b9('0xa')](_0x56b9('0xb'),_0x4b8148,_0x56b9('0x11'));_0x2e14a1(_0x3ade31[_0x56b9('0x12')][_0x56b9('0x10')]);}})[_0x56b9('0x13')](function(_0x3c1b9b){logger[_0x56b9('0xe')](_0x56b9('0xb'),_0x4b8148,_0x3c1b9b);_0x115666(_0x3c1b9b);});});} \ No newline at end of file +var _0x61a8=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2ce563,_0x26eca2){var _0x5164e0=function(_0x19844f){while(--_0x19844f){_0x2ce563['push'](_0x2ce563['shift']());}};_0x5164e0(++_0x26eca2);}(_0x61a8,0x1cd));var _0x861a=function(_0x47c901,_0x16799f){_0x47c901=_0x47c901-0x0;var _0x5f15c8=_0x61a8[_0x47c901];return _0x5f15c8;};'use strict';var _=require(_0x861a('0x0'));var util=require('util');var moment=require(_0x861a('0x1'));var BPromise=require(_0x861a('0x2'));var rs=require(_0x861a('0x3'));var fs=require('fs');var Redis=require(_0x861a('0x4'));var db=require(_0x861a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x861a('0x6'))(_0x861a('0x7'));var config=require(_0x861a('0x8'));var jayson=require(_0x861a('0x9'));var client=jayson['client'][_0x861a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ab28d,_0x362c34,_0x744154){return new BPromise(function(_0x238dec,_0x256cae){return client[_0x861a('0xb')](_0x1ab28d,_0x744154)[_0x861a('0xc')](function(_0x54eddb){logger[_0x861a('0xd')](_0x861a('0xe'),_0x362c34,_0x861a('0xf'));logger['debug'](_0x861a('0x10'),_0x362c34,_0x861a('0xf'),JSON[_0x861a('0x11')](_0x54eddb));if(_0x54eddb['error']){if(_0x54eddb[_0x861a('0x12')][_0x861a('0x13')]===0x1f4){logger[_0x861a('0x12')](_0x861a('0xe'),_0x362c34,_0x54eddb['error'][_0x861a('0x14')]);return _0x256cae(_0x54eddb[_0x861a('0x12')][_0x861a('0x14')]);}logger['error'](_0x861a('0xe'),_0x362c34,_0x54eddb[_0x861a('0x12')][_0x861a('0x14')]);return _0x238dec(_0x54eddb[_0x861a('0x12')][_0x861a('0x14')]);}else{logger[_0x861a('0xd')]('ChatApplication,\x20%s,\x20%s',_0x362c34,_0x861a('0xf'));_0x238dec(_0x54eddb[_0x861a('0x15')][_0x861a('0x14')]);}})[_0x861a('0x16')](function(_0x38c641){logger[_0x861a('0x12')](_0x861a('0xe'),_0x362c34,_0x38c641);_0x256cae(_0x38c641);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e1af02d..c6eba1d 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 _0xe21e=['/:id','isAuthenticated','show','put','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x2420c8,_0x540b1e){var _0x151e7c=function(_0x1218c5){while(--_0x1218c5){_0x2420c8['push'](_0x2420c8['shift']());}};_0x151e7c(++_0x540b1e);}(_0xe21e,0xd9));var _0xee21=function(_0x2a78be,_0x3686cc){_0x2a78be=_0x2a78be-0x0;var _0x5fa345=_0xe21e[_0x2a78be];return _0x5fa345;};'use strict';var multer=require('multer');var util=require(_0xee21('0x0'));var path=require(_0xee21('0x1'));var timeout=require('connect-timeout');var express=require(_0xee21('0x2'));var router=express['Router']();var fs_extra=require(_0xee21('0x3'));var auth=require(_0xee21('0x4'));var interaction=require(_0xee21('0x5'));var config=require(_0xee21('0x6'));var controller=require(_0xee21('0x7'));router['get'](_0xee21('0x8'),auth[_0xee21('0x9')](),controller[_0xee21('0xa')]);router[_0xee21('0xb')]('/:id',auth[_0xee21('0x9')](),controller[_0xee21('0xc')]);router[_0xee21('0xd')](_0xee21('0x8'),auth['isAuthenticated'](),controller[_0xee21('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2c35=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x2c35,0x157));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x52c3('0x0'));var path=require(_0x52c3('0x1'));var timeout=require(_0x52c3('0x2'));var express=require(_0x52c3('0x3'));var router=express[_0x52c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x52c3('0x5'));var interaction=require(_0x52c3('0x6'));var config=require(_0x52c3('0x7'));var controller=require(_0x52c3('0x8'));router[_0x52c3('0x9')](_0x52c3('0xa'),auth[_0x52c3('0xb')](),controller['show']);router[_0x52c3('0xc')](_0x52c3('0xa'),auth[_0x52c3('0xb')](),controller[_0x52c3('0xd')]);router[_0x52c3('0xe')](_0x52c3('0xa'),auth[_0x52c3('0xb')](),controller[_0x52c3('0xf')]);module[_0x52c3('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 93142ee..1c0280d 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 _0x58ea=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58ea,0xe7));var _0xa58e=function(_0x2f2940,_0x3f393e){_0x2f2940=_0x2f2940-0x0;var _0x4ad6fc=_0x58ea[_0x2f2940];return _0x4ad6fc;};'use strict';var Sequelize=require(_0xa58e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa58e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6e75=['sequelize','exports','STRING','BOOLEAN'];(function(_0x198d47,_0x599e61){var _0x45a964=function(_0x1645cd){while(--_0x1645cd){_0x198d47['push'](_0x198d47['shift']());}};_0x45a964(++_0x599e61);}(_0x6e75,0xa4));var _0x56e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e75[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x56e7('0x0'));module[_0x56e7('0x1')]={'name':{'type':Sequelize[_0x56e7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x56e7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 916e800..dbd9f6f 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 _0xb20e=['count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','fields','find','create','body','describe','ChatInternalMessage','params','toInteger','addMembers','ids','getMembers','findOne','User','sort','removeMembers','addMessage','getMessages','order','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0xb20e,0x9c));var _0xeb20=function(_0x4d01bd,_0x3995ae){_0x4d01bd=_0x4d01bd-0x0;var _0x1ffff6=_0xb20e[_0x4d01bd];return _0x1ffff6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb20('0x0'));var zipdir=require(_0xeb20('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb20('0x2'));var Mustache=require(_0xeb20('0x3'));var util=require(_0xeb20('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xeb20('0x5'));var ejs=require(_0xeb20('0x6'));var fs=require('fs');var fs_extra=require(_0xeb20('0x7'));var _=require(_0xeb20('0x8'));var squel=require(_0xeb20('0x9'));var crypto=require(_0xeb20('0xa'));var jsforce=require(_0xeb20('0xb'));var deskjs=require(_0xeb20('0xc'));var toCsv=require(_0xeb20('0x5'));var querystring=require(_0xeb20('0xd'));var Papa=require(_0xeb20('0xe'));var Redis=require('ioredis');var authService=require(_0xeb20('0xf'));var qs=require(_0xeb20('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb20('0x11'));var logger=require(_0xeb20('0x12'))(_0xeb20('0x13'));var utils=require(_0xeb20('0x14'));var config=require(_0xeb20('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb20('0x16'))['db'];config['redis']=_[_0xeb20('0x17')](config['redis'],{'host':_0xeb20('0x18'),'port':0x18eb});var socket=require(_0xeb20('0x19'))(new Redis(config[_0xeb20('0x1a')]));require(_0xeb20('0x1b'))[_0xeb20('0x1c')](socket);function respondWithStatusCode(_0x768e67,_0x3d8681){_0x3d8681=_0x3d8681||0xcc;return function(_0x35acba){if(_0x35acba){return _0x768e67[_0xeb20('0x1d')](_0x3d8681);}return _0x768e67[_0xeb20('0x1e')](_0x3d8681)[_0xeb20('0x1f')]();};}function respondWithResult(_0x319f5c,_0xf95fa2){_0xf95fa2=_0xf95fa2||0xc8;return function(_0x312483){if(_0x312483){return _0x319f5c[_0xeb20('0x1e')](_0xf95fa2)[_0xeb20('0x20')](_0x312483);}};}function respondWithFilteredResult(_0x2cb558,_0x32aabd){return function(_0x2cf635){if(_0x2cf635){var _0x665289=typeof _0x32aabd[_0xeb20('0x21')]==='undefined'&&typeof _0x32aabd[_0xeb20('0x22')]===_0xeb20('0x23');var _0x1033cb=_0x2cf635[_0xeb20('0x24')];var _0x57e2df=_0x665289?0x0:_0x32aabd[_0xeb20('0x21')];var _0x2a834d=_0x665289?_0x2cf635[_0xeb20('0x24')]:_0x32aabd[_0xeb20('0x21')]+_0x32aabd[_0xeb20('0x22')];var _0x1c1488;if(_0x2a834d>=_0x1033cb){_0x2a834d=_0x1033cb;_0x1c1488=0xc8;}else{_0x1c1488=0xce;}_0x2cb558[_0xeb20('0x1e')](_0x1c1488);return _0x2cb558[_0xeb20('0x25')](_0xeb20('0x26'),_0x57e2df+'-'+_0x2a834d+'/'+_0x1033cb)['json'](_0x2cf635);}return null;};}function patchUpdates(_0x5aa2ea){return function(_0x3fc397){try{jsonpatch[_0xeb20('0x27')](_0x3fc397,_0x5aa2ea,!![]);}catch(_0x3c4741){return BPromise[_0xeb20('0x28')](_0x3c4741);}return _0x3fc397[_0xeb20('0x29')]();};}function saveUpdates(_0x1f49b0,_0x3a8a03){return function(_0x147f9f){if(_0x147f9f){return _0x147f9f[_0xeb20('0x2a')](_0x1f49b0)[_0xeb20('0x2b')](function(_0x308e0a){return _0x308e0a;});}return null;};}function removeEntity(_0x16ec9f,_0x7b6180){return function(_0x3e7c12){if(_0x3e7c12){return _0x3e7c12[_0xeb20('0x2c')]()[_0xeb20('0x2b')](function(){_0x16ec9f[_0xeb20('0x1e')](0xcc)[_0xeb20('0x1f')]();});}};}function handleEntityNotFound(_0x4724a2,_0x19e56f){return function(_0x52b716){if(!_0x52b716){_0x4724a2[_0xeb20('0x1d')](0x194);}return _0x52b716;};}function handleError(_0x2fbbae,_0x5ae350){_0x5ae350=_0x5ae350||0x1f4;return function(_0x1bb016){logger[_0xeb20('0x2d')](_0x1bb016[_0xeb20('0x2e')]);if(_0x1bb016['name']){delete _0x1bb016[_0xeb20('0x2f')];}_0x2fbbae[_0xeb20('0x1e')](_0x5ae350)[_0xeb20('0x30')](_0x1bb016);};}exports[_0xeb20('0x31')]=function(_0x43979e,_0x1b21a5){var _0x561ee7={},_0x31a08a={},_0x3f747b={'count':0x0,'rows':[]};var _0x2d6bd=_[_0xeb20('0x32')](db[_0xeb20('0x33')][_0xeb20('0x34')],function(_0x398158){return{'name':_0x398158[_0xeb20('0x35')],'type':_0x398158[_0xeb20('0x36')][_0xeb20('0x37')]};});_0x31a08a['model']=_['map'](_0x2d6bd,_0xeb20('0x2f'));_0x31a08a[_0xeb20('0x38')]=_[_0xeb20('0x39')](_0x43979e[_0xeb20('0x38')]);_0x31a08a[_0xeb20('0x3a')]=_[_0xeb20('0x3b')](_0x31a08a[_0xeb20('0x3c')],_0x31a08a[_0xeb20('0x38')]);_0x561ee7[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x31a08a[_0xeb20('0x3c')],qs['fields'](_0x43979e['query']['fields']));_0x561ee7[_0xeb20('0x3d')]=_0x561ee7[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0x561ee7[_0xeb20('0x3d')]:_0x31a08a[_0xeb20('0x3c')];if(!_0x43979e[_0xeb20('0x38')][_0xeb20('0x3f')](_0xeb20('0x40'))){_0x561ee7[_0xeb20('0x22')]=qs[_0xeb20('0x22')](_0x43979e[_0xeb20('0x38')][_0xeb20('0x22')]);_0x561ee7[_0xeb20('0x21')]=qs['offset'](_0x43979e[_0xeb20('0x38')][_0xeb20('0x21')]);}_0x561ee7['order']=qs['sort'](_0x43979e[_0xeb20('0x38')]['sort']);_0x561ee7[_0xeb20('0x41')]=qs[_0xeb20('0x3a')](_[_0xeb20('0x42')](_0x43979e[_0xeb20('0x38')],_0x31a08a[_0xeb20('0x3a')]),_0x2d6bd);if(_0x43979e[_0xeb20('0x38')][_0xeb20('0x43')]){_0x561ee7[_0xeb20('0x41')]=_[_0xeb20('0x44')](_0x561ee7[_0xeb20('0x41')],{'$or':_['map'](_0x2d6bd,function(_0xaf1f7e){if(_0xaf1f7e['type']!==_0xeb20('0x45')){var _0x15d648={};_0x15d648[_0xaf1f7e[_0xeb20('0x2f')]]={'$like':'%'+_0x43979e[_0xeb20('0x38')][_0xeb20('0x43')]+'%'};return _0x15d648;}})});}_0x561ee7=_[_0xeb20('0x44')]({},_0x561ee7,_0x43979e[_0xeb20('0x46')]);var _0x3ae0a6={'where':_0x561ee7[_0xeb20('0x41')]};return db[_0xeb20('0x33')][_0xeb20('0x24')](_0x3ae0a6)['then'](function(_0x3aab8b){_0x3f747b[_0xeb20('0x24')]=_0x3aab8b;if(_0x43979e['query'][_0xeb20('0x47')]){_0x561ee7[_0xeb20('0x48')]=[{'all':!![]}];}return db[_0xeb20('0x33')]['findAll'](_0x561ee7);})['then'](function(_0x4f7266){_0x3f747b[_0xeb20('0x49')]=_0x4f7266;return _0x3f747b;})[_0xeb20('0x2b')](respondWithFilteredResult(_0x1b21a5,_0x561ee7))[_0xeb20('0x4a')](handleError(_0x1b21a5,null));};exports[_0xeb20('0x4b')]=function(_0xce8583,_0x301968){var _0x40791c={'raw':!![],'where':{'id':_0xce8583['params']['id']}},_0x528345={};_0x528345[_0xeb20('0x3c')]=_['keys'](db['ChatGroup'][_0xeb20('0x34')]);_0x528345['query']=_[_0xeb20('0x39')](_0xce8583[_0xeb20('0x38')]);_0x528345[_0xeb20('0x3a')]=_[_0xeb20('0x3b')](_0x528345['model'],_0x528345[_0xeb20('0x38')]);_0x40791c[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x528345[_0xeb20('0x3c')],qs[_0xeb20('0x4c')](_0xce8583[_0xeb20('0x38')][_0xeb20('0x4c')]));_0x40791c[_0xeb20('0x3d')]=_0x40791c[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0x40791c[_0xeb20('0x3d')]:_0x528345['model'];if(_0xce8583[_0xeb20('0x38')][_0xeb20('0x47')]){_0x40791c[_0xeb20('0x48')]=[{'all':!![]}];}_0x40791c=_['merge']({},_0x40791c,_0xce8583[_0xeb20('0x46')]);return db[_0xeb20('0x33')][_0xeb20('0x4d')](_0x40791c)[_0xeb20('0x2b')](handleEntityNotFound(_0x301968,null))[_0xeb20('0x2b')](respondWithResult(_0x301968,null))[_0xeb20('0x4a')](handleError(_0x301968,null));};exports[_0xeb20('0x4e')]=function(_0x190c74,_0x1fb46b){return db['ChatGroup'][_0xeb20('0x4e')](_0x190c74['body'],{})[_0xeb20('0x2b')](respondWithResult(_0x1fb46b,0xc9))[_0xeb20('0x4a')](handleError(_0x1fb46b,null));};exports[_0xeb20('0x2a')]=function(_0x4aa192,_0x1becc7){if(_0x4aa192[_0xeb20('0x4f')]['id']){delete _0x4aa192[_0xeb20('0x4f')]['id'];}return db[_0xeb20('0x33')][_0xeb20('0x4d')]({'where':{'id':_0x4aa192['params']['id']}})['then'](handleEntityNotFound(_0x1becc7,null))[_0xeb20('0x2b')](saveUpdates(_0x4aa192[_0xeb20('0x4f')],null))[_0xeb20('0x2b')](respondWithResult(_0x1becc7,null))[_0xeb20('0x4a')](handleError(_0x1becc7,null));};exports[_0xeb20('0x2c')]=function(_0x273a1e,_0x37ced5){return db['ChatGroup'][_0xeb20('0x4d')]({'where':{'id':_0x273a1e['params']['id']}})[_0xeb20('0x2b')](handleEntityNotFound(_0x37ced5,null))['then'](removeEntity(_0x37ced5,null))['catch'](handleError(_0x37ced5,null));};exports[_0xeb20('0x50')]=function(_0x109ac2,_0x517540){return db[_0xeb20('0x33')][_0xeb20('0x50')]()[_0xeb20('0x2b')](respondWithResult(_0x517540,null))[_0xeb20('0x4a')](handleError(_0x517540,null));};exports['getUnread']=function(_0x461e80,_0xc8851a,_0x303b6a){return db[_0xeb20('0x51')][_0xeb20('0x24')]({'where':{'ChatGroupId':_0x461e80[_0xeb20('0x52')]['id'],'ToId':_0x461e80['user']['id'],'read':![]}})[_0xeb20('0x2b')](function(_0x5b912f){return{'id':_[_0xeb20('0x53')](_0x461e80['params']['id']),'count':_0x5b912f};})[_0xeb20('0x2b')](respondWithResult(_0xc8851a,null))[_0xeb20('0x4a')](handleError(_0xc8851a,null));};exports[_0xeb20('0x54')]=function(_0x8c06ab,_0x52aba6,_0x1b19f6){return db['ChatGroup'][_0xeb20('0x4d')]({'where':{'id':_0x8c06ab['params']['id']}})['then'](handleEntityNotFound(_0x52aba6,null))['then'](function(_0x38c960){if(_0x38c960){return _0x38c960['addMembers'](_0x8c06ab[_0xeb20('0x4f')][_0xeb20('0x55')],_['omit'](_0x8c06ab['body'],['ids','id'])||{});}})[_0xeb20('0x2b')](respondWithResult(_0x52aba6,null))[_0xeb20('0x4a')](handleError(_0x52aba6,null));};exports[_0xeb20('0x56')]=function(_0x252c22,_0x55d468,_0x2a2279){var _0xe60745={};var _0x522359={};var _0x4fbbe0;var _0x3a58ef;return db['ChatGroup'][_0xeb20('0x57')]({'where':{'id':_0x252c22['params']['id']}})[_0xeb20('0x2b')](handleEntityNotFound(_0x55d468,null))['then'](function(_0x1083fd){if(_0x1083fd){_0x4fbbe0=_0x1083fd;_0x522359['model']=_['keys'](db[_0xeb20('0x58')]['rawAttributes']);_0x522359['query']=_[_0xeb20('0x39')](_0x252c22[_0xeb20('0x38')]);_0x522359['filters']=_['intersection'](_0x522359['model'],_0x522359['query']);_0xe60745[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x522359[_0xeb20('0x3c')],qs[_0xeb20('0x4c')](_0x252c22[_0xeb20('0x38')][_0xeb20('0x4c')]));_0xe60745[_0xeb20('0x3d')]=_0xe60745[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0xe60745[_0xeb20('0x3d')]:_0x522359[_0xeb20('0x3c')];_0xe60745['order']=qs[_0xeb20('0x59')](_0x252c22['query']['sort']);_0xe60745['where']=qs[_0xeb20('0x3a')](_[_0xeb20('0x42')](_0x252c22[_0xeb20('0x38')],_0x522359[_0xeb20('0x3a')]));if(_0x252c22[_0xeb20('0x38')]['filter']){_0xe60745['where']=_['merge'](_0xe60745['where'],{'$or':_[_0xeb20('0x32')](_0xe60745[_0xeb20('0x3d')],function(_0x3c256b){var _0x36c293={};_0x36c293[_0x3c256b]={'$like':'%'+_0x252c22[_0xeb20('0x38')][_0xeb20('0x43')]+'%'};return _0x36c293;})});}_0xe60745=_['merge']({},_0xe60745,_0x252c22[_0xeb20('0x46')]);return _0x4fbbe0[_0xeb20('0x56')](_0xe60745);}})['then'](function(_0x28f116){if(_0x28f116){_0x3a58ef=_0x28f116[_0xeb20('0x3e')];if(!_0x252c22[_0xeb20('0x38')][_0xeb20('0x3f')]('nolimit')){_0xe60745[_0xeb20('0x22')]=qs['limit'](_0x252c22[_0xeb20('0x38')][_0xeb20('0x22')]);_0xe60745['offset']=qs[_0xeb20('0x21')](_0x252c22[_0xeb20('0x38')][_0xeb20('0x21')]);}return _0x4fbbe0[_0xeb20('0x56')](_0xe60745);}})[_0xeb20('0x2b')](function(_0x9b49cb){if(_0x9b49cb){return _0x9b49cb?{'count':_0x3a58ef,'rows':_0x9b49cb}:null;}})[_0xeb20('0x2b')](respondWithResult(_0x55d468,null))[_0xeb20('0x4a')](handleError(_0x55d468,null));};exports[_0xeb20('0x5a')]=function(_0x2b5557,_0xba5ddb,_0x46371f){return db['ChatGroup'][_0xeb20('0x4d')]({'where':{'id':_0x2b5557['params']['id']}})['then'](handleEntityNotFound(_0xba5ddb,null))[_0xeb20('0x2b')](function(_0x530eaf){if(_0x530eaf){return _0x530eaf['removeMembers'](_0x2b5557[_0xeb20('0x38')][_0xeb20('0x55')]);}})['then'](respondWithStatusCode(_0xba5ddb,null))[_0xeb20('0x4a')](handleError(_0xba5ddb,null));};exports[_0xeb20('0x5b')]=function(_0x5605f1,_0x56231b,_0x282105){if(_0x5605f1['body']['id']){delete _0x5605f1[_0xeb20('0x4f')]['id'];}return db[_0xeb20('0x33')]['find']({'where':{'id':_0x5605f1[_0xeb20('0x52')]['id']}})['then'](handleEntityNotFound(_0x56231b,null))[_0xeb20('0x2b')](function(_0x2f8c36){if(_0x2f8c36){_0x5605f1[_0xeb20('0x4f')]['ChatGroupId']=_0x2f8c36['id'];return db[_0xeb20('0x51')][_0xeb20('0x4e')](_0x5605f1[_0xeb20('0x4f')]);}})[_0xeb20('0x2b')](respondWithResult(_0x56231b,null))[_0xeb20('0x4a')](handleError(_0x56231b,null));};exports[_0xeb20('0x5c')]=function(_0x3b2132,_0x500217,_0x4c033a){var _0x48427d={};var _0x55de77={};var _0x2080fe;var _0x5c97e6;return db[_0xeb20('0x33')][_0xeb20('0x57')]({'where':{'id':_0x3b2132['params']['id']}})[_0xeb20('0x2b')](handleEntityNotFound(_0x500217,null))[_0xeb20('0x2b')](function(_0x59b2af){if(_0x59b2af){_0x2080fe=_0x59b2af;_0x55de77[_0xeb20('0x3c')]=_[_0xeb20('0x39')](db['ChatInternalMessage'][_0xeb20('0x34')]);_0x55de77['query']=_[_0xeb20('0x39')](_0x3b2132[_0xeb20('0x38')]);_0x55de77[_0xeb20('0x3a')]=_[_0xeb20('0x3b')](_0x55de77[_0xeb20('0x3c')],_0x55de77[_0xeb20('0x38')]);_0x48427d[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x55de77[_0xeb20('0x3c')],qs['fields'](_0x3b2132[_0xeb20('0x38')][_0xeb20('0x4c')]));_0x48427d[_0xeb20('0x3d')]=_0x48427d[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0x48427d[_0xeb20('0x3d')]:_0x55de77['model'];_0x48427d[_0xeb20('0x5d')]=qs[_0xeb20('0x59')](_0x3b2132[_0xeb20('0x38')][_0xeb20('0x59')]);_0x48427d[_0xeb20('0x41')]=qs[_0xeb20('0x3a')](_[_0xeb20('0x42')](_0x3b2132['query'],_0x55de77[_0xeb20('0x3a')]));if(_0x3b2132[_0xeb20('0x38')][_0xeb20('0x43')]){_0x48427d[_0xeb20('0x41')]=_[_0xeb20('0x44')](_0x48427d[_0xeb20('0x41')],{'$or':_['map'](_0x48427d[_0xeb20('0x3d')],function(_0x160d31){var _0x1dbe87={};_0x1dbe87[_0x160d31]={'$like':'%'+_0x3b2132['query'][_0xeb20('0x43')]+'%'};return _0x1dbe87;})});}if(_0x3b2132[_0xeb20('0x38')]['$gte']){var _0x4e1aee=_0x3b2132['query']['$gte']['split'](',');var _0x43c02c={};_0x43c02c[_0x4e1aee[0x0]]={'$gte':moment(_0x4e1aee[0x1])[_0xeb20('0x5e')](_0xeb20('0x5f'))};_0x48427d[_0xeb20('0x41')]=_[_0xeb20('0x44')](_0x48427d[_0xeb20('0x41')],_0x43c02c);}_0x48427d=_[_0xeb20('0x44')]({},_0x48427d,_0x3b2132[_0xeb20('0x46')]);return _0x2080fe[_0xeb20('0x5c')](_0x48427d);}})[_0xeb20('0x2b')](function(_0x474fdc){if(_0x474fdc){_0x5c97e6=_0x474fdc['length'];if(!_0x3b2132[_0xeb20('0x38')][_0xeb20('0x3f')](_0xeb20('0x40'))){_0x48427d[_0xeb20('0x22')]=qs[_0xeb20('0x22')](_0x3b2132[_0xeb20('0x38')]['limit']);_0x48427d[_0xeb20('0x21')]=qs[_0xeb20('0x21')](_0x3b2132[_0xeb20('0x38')][_0xeb20('0x21')]);}return _0x2080fe['getMessages'](_0x48427d);}})['then'](function(_0x5a40dd){if(_0x5a40dd){return _0x5a40dd?{'count':_0x5c97e6,'rows':_0x5a40dd}:null;}})[_0xeb20('0x2b')](respondWithResult(_0x500217,null))[_0xeb20('0x4a')](handleError(_0x500217,null));}; \ No newline at end of file +var _0x5750=['include','catch','show','params','length','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','hasOwnProperty','nolimit','removeMembers','addMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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','socket.io-emitter','register','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','status','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll'];(function(_0x550a6b,_0x473bb3){var _0x2369de=function(_0x396ab1){while(--_0x396ab1){_0x550a6b['push'](_0x550a6b['shift']());}};_0x2369de(++_0x473bb3);}(_0x5750,0xd9));var _0x0575=function(_0x321976,_0x2cb745){_0x321976=_0x321976-0x0;var _0x1537f8=_0x5750[_0x321976];return _0x1537f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0575('0x0'));var jsonpatch=require(_0x0575('0x1'));var rp=require(_0x0575('0x2'));var moment=require(_0x0575('0x3'));var BPromise=require(_0x0575('0x4'));var Mustache=require(_0x0575('0x5'));var util=require(_0x0575('0x6'));var path=require(_0x0575('0x7'));var sox=require(_0x0575('0x8'));var csv=require(_0x0575('0x9'));var ejs=require(_0x0575('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0575('0xb'));var squel=require('squel');var crypto=require(_0x0575('0xc'));var jsforce=require(_0x0575('0xd'));var deskjs=require(_0x0575('0xe'));var toCsv=require(_0x0575('0x9'));var querystring=require('querystring');var Papa=require(_0x0575('0xf'));var Redis=require('ioredis');var authService=require(_0x0575('0x10'));var qs=require(_0x0575('0x11'));var as=require(_0x0575('0x12'));var hardwareService=require(_0x0575('0x13'));var logger=require(_0x0575('0x14'))(_0x0575('0x15'));var utils=require(_0x0575('0x16'));var config=require(_0x0575('0x17'));var licenseUtil=require(_0x0575('0x18'));var db=require(_0x0575('0x19'))['db'];config[_0x0575('0x1a')]=_[_0x0575('0x1b')](config[_0x0575('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0575('0x1c'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x0575('0x1d')](socket);function respondWithStatusCode(_0x119e14,_0x5ed622){_0x5ed622=_0x5ed622||0xcc;return function(_0x139d40){if(_0x139d40){return _0x119e14[_0x0575('0x1e')](_0x5ed622);}return _0x119e14['status'](_0x5ed622)[_0x0575('0x1f')]();};}function respondWithResult(_0xeff7c4,_0x49e602){_0x49e602=_0x49e602||0xc8;return function(_0x12e251){if(_0x12e251){return _0xeff7c4['status'](_0x49e602)[_0x0575('0x20')](_0x12e251);}};}function respondWithFilteredResult(_0x4eb9e6,_0x3e6c12){return function(_0x1231c4){if(_0x1231c4){var _0x5103d9=typeof _0x3e6c12[_0x0575('0x21')]==='undefined'&&typeof _0x3e6c12[_0x0575('0x22')]===_0x0575('0x23');var _0x122c6e=_0x1231c4[_0x0575('0x24')];var _0x1963d9=_0x5103d9?0x0:_0x3e6c12['offset'];var _0x33602d=_0x5103d9?_0x1231c4[_0x0575('0x24')]:_0x3e6c12['offset']+_0x3e6c12['limit'];var _0x268fcd;if(_0x33602d>=_0x122c6e){_0x33602d=_0x122c6e;_0x268fcd=0xc8;}else{_0x268fcd=0xce;}_0x4eb9e6['status'](_0x268fcd);return _0x4eb9e6[_0x0575('0x25')](_0x0575('0x26'),_0x1963d9+'-'+_0x33602d+'/'+_0x122c6e)[_0x0575('0x20')](_0x1231c4);}return null;};}function patchUpdates(_0x444e6a){return function(_0x2b8920){try{jsonpatch['apply'](_0x2b8920,_0x444e6a,!![]);}catch(_0x40320c){return BPromise[_0x0575('0x27')](_0x40320c);}return _0x2b8920[_0x0575('0x28')]();};}function saveUpdates(_0x47af8b,_0x3e2bd6){return function(_0x489dce){if(_0x489dce){return _0x489dce[_0x0575('0x29')](_0x47af8b)['then'](function(_0x581bbb){return _0x581bbb;});}return null;};}function removeEntity(_0x3ae790,_0x2ec6a1){return function(_0x30b6aa){if(_0x30b6aa){return _0x30b6aa[_0x0575('0x2a')]()[_0x0575('0x2b')](function(){_0x3ae790[_0x0575('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253fb9,_0x5a6d14){return function(_0x1c522a){if(!_0x1c522a){_0x253fb9[_0x0575('0x1e')](0x194);}return _0x1c522a;};}function handleError(_0x71b2e6,_0x2e23cb){_0x2e23cb=_0x2e23cb||0x1f4;return function(_0x531e96){logger[_0x0575('0x2d')](_0x531e96[_0x0575('0x2e')]);if(_0x531e96[_0x0575('0x2f')]){delete _0x531e96[_0x0575('0x2f')];}_0x71b2e6[_0x0575('0x2c')](_0x2e23cb)['send'](_0x531e96);};}exports[_0x0575('0x30')]=function(_0x52394e,_0x1f4e4e){var _0x105ac1={},_0x22a3ed={},_0x22ce4b={'count':0x0,'rows':[]};var _0x366663=_[_0x0575('0x31')](db[_0x0575('0x32')][_0x0575('0x33')],function(_0x4722f1){return{'name':_0x4722f1[_0x0575('0x34')],'type':_0x4722f1['type'][_0x0575('0x35')]};});_0x22a3ed[_0x0575('0x36')]=_[_0x0575('0x31')](_0x366663,_0x0575('0x2f'));_0x22a3ed['query']=_[_0x0575('0x37')](_0x52394e[_0x0575('0x38')]);_0x22a3ed[_0x0575('0x39')]=_[_0x0575('0x3a')](_0x22a3ed[_0x0575('0x36')],_0x22a3ed[_0x0575('0x38')]);_0x105ac1[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x22a3ed[_0x0575('0x36')],qs[_0x0575('0x3c')](_0x52394e['query'][_0x0575('0x3c')]));_0x105ac1[_0x0575('0x3b')]=_0x105ac1[_0x0575('0x3b')]['length']?_0x105ac1[_0x0575('0x3b')]:_0x22a3ed[_0x0575('0x36')];if(!_0x52394e[_0x0575('0x38')]['hasOwnProperty']('nolimit')){_0x105ac1[_0x0575('0x22')]=qs[_0x0575('0x22')](_0x52394e[_0x0575('0x38')][_0x0575('0x22')]);_0x105ac1[_0x0575('0x21')]=qs[_0x0575('0x21')](_0x52394e['query'][_0x0575('0x21')]);}_0x105ac1[_0x0575('0x3d')]=qs[_0x0575('0x3e')](_0x52394e[_0x0575('0x38')]['sort']);_0x105ac1[_0x0575('0x3f')]=qs['filters'](_[_0x0575('0x40')](_0x52394e['query'],_0x22a3ed[_0x0575('0x39')]),_0x366663);if(_0x52394e[_0x0575('0x38')]['filter']){_0x105ac1[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x105ac1[_0x0575('0x3f')],{'$or':_['map'](_0x366663,function(_0xa9e10a){if(_0xa9e10a[_0x0575('0x42')]!==_0x0575('0x43')){var _0x2f330b={};_0x2f330b[_0xa9e10a['name']]={'$like':'%'+_0x52394e[_0x0575('0x38')][_0x0575('0x44')]+'%'};return _0x2f330b;}})});}_0x105ac1=_[_0x0575('0x41')]({},_0x105ac1,_0x52394e[_0x0575('0x45')]);var _0x1f97c7={'where':_0x105ac1[_0x0575('0x3f')]};return db['ChatGroup']['count'](_0x1f97c7)[_0x0575('0x2b')](function(_0x3520cf){_0x22ce4b[_0x0575('0x24')]=_0x3520cf;if(_0x52394e[_0x0575('0x38')][_0x0575('0x46')]){_0x105ac1[_0x0575('0x47')]=[{'all':!![]}];}return db[_0x0575('0x32')]['findAll'](_0x105ac1);})[_0x0575('0x2b')](function(_0x19325c){_0x22ce4b['rows']=_0x19325c;return _0x22ce4b;})[_0x0575('0x2b')](respondWithFilteredResult(_0x1f4e4e,_0x105ac1))[_0x0575('0x48')](handleError(_0x1f4e4e,null));};exports[_0x0575('0x49')]=function(_0x59509f,_0x5964a9){var _0x56ed6d={'raw':!![],'where':{'id':_0x59509f[_0x0575('0x4a')]['id']}},_0x2e2e2d={};_0x2e2e2d['model']=_[_0x0575('0x37')](db[_0x0575('0x32')][_0x0575('0x33')]);_0x2e2e2d[_0x0575('0x38')]=_[_0x0575('0x37')](_0x59509f[_0x0575('0x38')]);_0x2e2e2d['filters']=_['intersection'](_0x2e2e2d['model'],_0x2e2e2d['query']);_0x56ed6d[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x2e2e2d[_0x0575('0x36')],qs[_0x0575('0x3c')](_0x59509f[_0x0575('0x38')][_0x0575('0x3c')]));_0x56ed6d[_0x0575('0x3b')]=_0x56ed6d['attributes'][_0x0575('0x4b')]?_0x56ed6d[_0x0575('0x3b')]:_0x2e2e2d[_0x0575('0x36')];if(_0x59509f['query'][_0x0575('0x46')]){_0x56ed6d['include']=[{'all':!![]}];}_0x56ed6d=_['merge']({},_0x56ed6d,_0x59509f['options']);return db['ChatGroup'][_0x0575('0x4c')](_0x56ed6d)['then'](handleEntityNotFound(_0x5964a9,null))[_0x0575('0x2b')](respondWithResult(_0x5964a9,null))['catch'](handleError(_0x5964a9,null));};exports[_0x0575('0x4d')]=function(_0x5abb50,_0x1e999e){return db[_0x0575('0x32')][_0x0575('0x4d')](_0x5abb50['body'],{})[_0x0575('0x2b')](respondWithResult(_0x1e999e,0xc9))[_0x0575('0x48')](handleError(_0x1e999e,null));};exports[_0x0575('0x29')]=function(_0x29b807,_0x288a0a){if(_0x29b807[_0x0575('0x4e')]['id']){delete _0x29b807[_0x0575('0x4e')]['id'];}return db[_0x0575('0x32')]['find']({'where':{'id':_0x29b807[_0x0575('0x4a')]['id']}})[_0x0575('0x2b')](handleEntityNotFound(_0x288a0a,null))[_0x0575('0x2b')](saveUpdates(_0x29b807[_0x0575('0x4e')],null))[_0x0575('0x2b')](respondWithResult(_0x288a0a,null))[_0x0575('0x48')](handleError(_0x288a0a,null));};exports[_0x0575('0x2a')]=function(_0x477fec,_0x139e7f){return db['ChatGroup'][_0x0575('0x4c')]({'where':{'id':_0x477fec[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x139e7f,null))[_0x0575('0x2b')](removeEntity(_0x139e7f,null))[_0x0575('0x48')](handleError(_0x139e7f,null));};exports[_0x0575('0x4f')]=function(_0x702d96,_0x165351){return db[_0x0575('0x32')][_0x0575('0x4f')]()[_0x0575('0x2b')](respondWithResult(_0x165351,null))[_0x0575('0x48')](handleError(_0x165351,null));};exports['getUnread']=function(_0x30b90a,_0x5ae1c9,_0x13328d){return db[_0x0575('0x50')]['count']({'where':{'ChatGroupId':_0x30b90a[_0x0575('0x4a')]['id'],'ToId':_0x30b90a[_0x0575('0x51')]['id'],'read':![]}})[_0x0575('0x2b')](function(_0x1658fc){return{'id':_[_0x0575('0x52')](_0x30b90a[_0x0575('0x4a')]['id']),'count':_0x1658fc};})[_0x0575('0x2b')](respondWithResult(_0x5ae1c9,null))[_0x0575('0x48')](handleError(_0x5ae1c9,null));};exports['addMembers']=function(_0x452482,_0x5667bb,_0x384844){return db[_0x0575('0x32')]['find']({'where':{'id':_0x452482[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5667bb,null))[_0x0575('0x2b')](function(_0x1ad84a){if(_0x1ad84a){return _0x1ad84a[_0x0575('0x53')](_0x452482['body'][_0x0575('0x54')],_[_0x0575('0x55')](_0x452482[_0x0575('0x4e')],[_0x0575('0x54'),'id'])||{});}})[_0x0575('0x2b')](respondWithResult(_0x5667bb,null))[_0x0575('0x48')](handleError(_0x5667bb,null));};exports[_0x0575('0x56')]=function(_0x412b14,_0x112d92,_0x32bd8d){var _0x59c04b={};var _0x524d43={};var _0x3023b3;var _0x5cf01a;return db['ChatGroup'][_0x0575('0x57')]({'where':{'id':_0x412b14[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x112d92,null))[_0x0575('0x2b')](function(_0x40ed33){if(_0x40ed33){_0x3023b3=_0x40ed33;_0x524d43[_0x0575('0x36')]=_['keys'](db['User'][_0x0575('0x33')]);_0x524d43[_0x0575('0x38')]=_[_0x0575('0x37')](_0x412b14[_0x0575('0x38')]);_0x524d43[_0x0575('0x39')]=_[_0x0575('0x3a')](_0x524d43[_0x0575('0x36')],_0x524d43[_0x0575('0x38')]);_0x59c04b[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x524d43['model'],qs['fields'](_0x412b14[_0x0575('0x38')][_0x0575('0x3c')]));_0x59c04b[_0x0575('0x3b')]=_0x59c04b[_0x0575('0x3b')][_0x0575('0x4b')]?_0x59c04b[_0x0575('0x3b')]:_0x524d43[_0x0575('0x36')];_0x59c04b[_0x0575('0x3d')]=qs[_0x0575('0x3e')](_0x412b14[_0x0575('0x38')]['sort']);_0x59c04b[_0x0575('0x3f')]=qs[_0x0575('0x39')](_['pick'](_0x412b14['query'],_0x524d43['filters']));if(_0x412b14[_0x0575('0x38')]['filter']){_0x59c04b[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x59c04b[_0x0575('0x3f')],{'$or':_['map'](_0x59c04b[_0x0575('0x3b')],function(_0x5624f0){var _0x3da4ba={};_0x3da4ba[_0x5624f0]={'$like':'%'+_0x412b14['query'][_0x0575('0x44')]+'%'};return _0x3da4ba;})});}_0x59c04b=_['merge']({},_0x59c04b,_0x412b14['options']);return _0x3023b3[_0x0575('0x56')](_0x59c04b);}})['then'](function(_0x4dd44c){if(_0x4dd44c){_0x5cf01a=_0x4dd44c['length'];if(!_0x412b14['query'][_0x0575('0x58')](_0x0575('0x59'))){_0x59c04b[_0x0575('0x22')]=qs[_0x0575('0x22')](_0x412b14[_0x0575('0x38')][_0x0575('0x22')]);_0x59c04b['offset']=qs[_0x0575('0x21')](_0x412b14['query'][_0x0575('0x21')]);}return _0x3023b3[_0x0575('0x56')](_0x59c04b);}})[_0x0575('0x2b')](function(_0x379b21){if(_0x379b21){return _0x379b21?{'count':_0x5cf01a,'rows':_0x379b21}:null;}})[_0x0575('0x2b')](respondWithResult(_0x112d92,null))[_0x0575('0x48')](handleError(_0x112d92,null));};exports['removeMembers']=function(_0x2cce36,_0x18bf2f,_0x4acc4a){return db[_0x0575('0x32')]['find']({'where':{'id':_0x2cce36[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x18bf2f,null))[_0x0575('0x2b')](function(_0x1a9e71){if(_0x1a9e71){return _0x1a9e71[_0x0575('0x5a')](_0x2cce36[_0x0575('0x38')][_0x0575('0x54')]);}})[_0x0575('0x2b')](respondWithStatusCode(_0x18bf2f,null))[_0x0575('0x48')](handleError(_0x18bf2f,null));};exports[_0x0575('0x5b')]=function(_0x44d538,_0x3d675e,_0x122e45){if(_0x44d538[_0x0575('0x4e')]['id']){delete _0x44d538['body']['id'];}return db[_0x0575('0x32')][_0x0575('0x4c')]({'where':{'id':_0x44d538[_0x0575('0x4a')]['id']}})[_0x0575('0x2b')](handleEntityNotFound(_0x3d675e,null))[_0x0575('0x2b')](function(_0x4f80ba){if(_0x4f80ba){_0x44d538[_0x0575('0x4e')]['ChatGroupId']=_0x4f80ba['id'];return db[_0x0575('0x50')][_0x0575('0x4d')](_0x44d538[_0x0575('0x4e')]);}})['then'](respondWithResult(_0x3d675e,null))[_0x0575('0x48')](handleError(_0x3d675e,null));};exports[_0x0575('0x5c')]=function(_0x1e1dd9,_0x40e9d1,_0x13b070){var _0x4add81={};var _0x218b75={};var _0x29c414;var _0x169eae;return db[_0x0575('0x32')][_0x0575('0x57')]({'where':{'id':_0x1e1dd9[_0x0575('0x4a')]['id']}})[_0x0575('0x2b')](handleEntityNotFound(_0x40e9d1,null))['then'](function(_0xed1fff){if(_0xed1fff){_0x29c414=_0xed1fff;_0x218b75[_0x0575('0x36')]=_[_0x0575('0x37')](db['ChatInternalMessage'][_0x0575('0x33')]);_0x218b75[_0x0575('0x38')]=_[_0x0575('0x37')](_0x1e1dd9[_0x0575('0x38')]);_0x218b75['filters']=_[_0x0575('0x3a')](_0x218b75[_0x0575('0x36')],_0x218b75[_0x0575('0x38')]);_0x4add81[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x218b75[_0x0575('0x36')],qs[_0x0575('0x3c')](_0x1e1dd9[_0x0575('0x38')]['fields']));_0x4add81[_0x0575('0x3b')]=_0x4add81['attributes'][_0x0575('0x4b')]?_0x4add81['attributes']:_0x218b75[_0x0575('0x36')];_0x4add81[_0x0575('0x3d')]=qs['sort'](_0x1e1dd9[_0x0575('0x38')][_0x0575('0x3e')]);_0x4add81[_0x0575('0x3f')]=qs['filters'](_[_0x0575('0x40')](_0x1e1dd9[_0x0575('0x38')],_0x218b75[_0x0575('0x39')]));if(_0x1e1dd9[_0x0575('0x38')]['filter']){_0x4add81[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x4add81[_0x0575('0x3f')],{'$or':_[_0x0575('0x31')](_0x4add81[_0x0575('0x3b')],function(_0x4754f4){var _0xbf4f31={};_0xbf4f31[_0x4754f4]={'$like':'%'+_0x1e1dd9['query'][_0x0575('0x44')]+'%'};return _0xbf4f31;})});}if(_0x1e1dd9[_0x0575('0x38')][_0x0575('0x5d')]){var _0x162ac9=_0x1e1dd9['query'][_0x0575('0x5d')][_0x0575('0x5e')](',');var _0x43877e={};_0x43877e[_0x162ac9[0x0]]={'$gte':moment(_0x162ac9[0x1])['format'](_0x0575('0x5f'))};_0x4add81[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x4add81[_0x0575('0x3f')],_0x43877e);}_0x4add81=_[_0x0575('0x41')]({},_0x4add81,_0x1e1dd9[_0x0575('0x45')]);return _0x29c414['getMessages'](_0x4add81);}})['then'](function(_0x12a255){if(_0x12a255){_0x169eae=_0x12a255['length'];if(!_0x1e1dd9[_0x0575('0x38')][_0x0575('0x58')]('nolimit')){_0x4add81['limit']=qs[_0x0575('0x22')](_0x1e1dd9['query'][_0x0575('0x22')]);_0x4add81[_0x0575('0x21')]=qs['offset'](_0x1e1dd9[_0x0575('0x38')]['offset']);}return _0x29c414[_0x0575('0x5c')](_0x4add81);}})['then'](function(_0x1860ac){if(_0x1860ac){return _0x1860ac?{'count':_0x169eae,'rows':_0x1860ac}:null;}})[_0x0575('0x2b')](respondWithResult(_0x40e9d1,null))[_0x0575('0x48')](handleError(_0x40e9d1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index b861763..72b3be6 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 _0x117c=['emit','hasOwnProperty','hook','setMaxListeners','remove'];(function(_0x161192,_0x4b4d12){var _0x5a643b=function(_0x388d8a){while(--_0x388d8a){_0x161192['push'](_0x161192['shift']());}};_0x5a643b(++_0x4b4d12);}(_0x117c,0x71));var _0xc117=function(_0x11c032,_0x4ca503){_0x11c032=_0x11c032-0x0;var _0x55919f=_0x117c[_0x11c032];return _0x55919f;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc117('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc117('0x1')};function emitEvent(_0x36ca43){return function(_0x2ec18c,_0x2361ee,_0x1768dc){ChatGroupEvents[_0xc117('0x2')](_0x36ca43+':'+_0x2ec18c['id'],_0x2ec18c);ChatGroupEvents['emit'](_0x36ca43,_0x2ec18c);_0x1768dc(null);};}for(var e in events){if(events[_0xc117('0x3')](e)){var event=events[e];ChatGroup[_0xc117('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x508b=['setMaxListeners','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x508b,0x1c1));var _0xb508=function(_0x49ca6b,_0x3ba842){_0x49ca6b=_0x49ca6b-0x0;var _0x1d957f=_0x508b[_0x49ca6b];return _0x1d957f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xb508('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb508('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb508('0x2')};function emitEvent(_0x592cb7){return function(_0x322891,_0x97a155,_0x22ceb1){ChatGroupEvents[_0xb508('0x3')](_0x592cb7+':'+_0x322891['id'],_0x322891);ChatGroupEvents[_0xb508('0x3')](_0x592cb7,_0x322891);_0x22ceb1(null);};}for(var e in events){if(events[_0xb508('0x4')](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 64fa5c1..4430ee3 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 _0xe5bb=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3a5a75,_0x4c4e3c){var _0x53a146=function(_0x5aaf3a){while(--_0x5aaf3a){_0x3a5a75['push'](_0x3a5a75['shift']());}};_0x53a146(++_0x4c4e3c);}(_0xe5bb,0x1ab));var _0xbe5b=function(_0x303965,_0x580a9d){_0x303965=_0x303965-0x0;var _0x1048eb=_0xe5bb[_0x303965];return _0x1048eb;};'use strict';var _=require(_0xbe5b('0x0'));var util=require(_0xbe5b('0x1'));var logger=require(_0xbe5b('0x2'))(_0xbe5b('0x3'));var moment=require(_0xbe5b('0x4'));var BPromise=require(_0xbe5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe5b('0x6'));var rimraf=require(_0xbe5b('0x7'));var config=require(_0xbe5b('0x8'));var attributes=require(_0xbe5b('0x9'));module[_0xbe5b('0xa')]=function(_0x1af5c5,_0x3d7f92){return _0x1af5c5[_0xbe5b('0xb')](_0xbe5b('0xc'),attributes,{'tableName':_0xbe5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x109e=['define','ChatGroup','chat_groups','util','../../config/logger','bluebird','request-promise','./chatGroup.attributes'];(function(_0x17d7ee,_0x1a0d71){var _0x51f272=function(_0x37be77){while(--_0x37be77){_0x17d7ee['push'](_0x17d7ee['shift']());}};_0x51f272(++_0x1a0d71);}(_0x109e,0x1ab));var _0xe109=function(_0x4e920b,_0x329dde){_0x4e920b=_0x4e920b-0x0;var _0x40ed85=_0x109e[_0x4e920b];return _0x40ed85;};'use strict';var _=require('lodash');var util=require(_0xe109('0x0'));var logger=require(_0xe109('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe109('0x2'));var rp=require(_0xe109('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe109('0x4'));module['exports']=function(_0x53d875,_0x3cf368){return _0x53d875[_0xe109('0x5')](_0xe109('0x6'),attributes,{'tableName':_0xe109('0x7'),'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 c1c7418..94fe9e3 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 _0x0d0b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cc870,_0x2c014b){var _0x1f6aed=function(_0x1f2fb6){while(--_0x1f2fb6){_0x3cc870['push'](_0x3cc870['shift']());}};_0x1f6aed(++_0x2c014b);}(_0x0d0b,0x1ef));var _0xb0d0=function(_0x2369e6,_0x2931a6){_0x2369e6=_0x2369e6-0x0;var _0x39f461=_0x0d0b[_0x2369e6];return _0x39f461;};'use strict';var _=require('lodash');var util=require(_0xb0d0('0x0'));var moment=require('moment');var BPromise=require(_0xb0d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0d0('0x2'));var db=require(_0xb0d0('0x3'))['db'];var utils=require(_0xb0d0('0x4'));var logger=require(_0xb0d0('0x5'))(_0xb0d0('0x6'));var config=require(_0xb0d0('0x7'));var jayson=require(_0xb0d0('0x8'));var client=jayson[_0xb0d0('0x9')]['http']({'port':0x232a});config[_0xb0d0('0xa')]=_[_0xb0d0('0xb')](config[_0xb0d0('0xa')],{'host':_0xb0d0('0xc'),'port':0x18eb});var socket=require(_0xb0d0('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xb0d0('0xe')](socket);function respondWithRpcPromise(_0x316f3e,_0x598239,_0x55f77b){return new BPromise(function(_0x42e5ea,_0x267e7f){return client[_0xb0d0('0xf')](_0x316f3e,_0x55f77b)[_0xb0d0('0x10')](function(_0x317fa4){logger[_0xb0d0('0x11')]('ChatGroup,\x20%s,\x20%s',_0x598239,_0xb0d0('0x12'));logger[_0xb0d0('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x598239,_0xb0d0('0x12'),JSON['stringify'](_0x317fa4));if(_0x317fa4[_0xb0d0('0x14')]){if(_0x317fa4['error'][_0xb0d0('0x15')]===0x1f4){logger['error'](_0xb0d0('0x16'),_0x598239,_0x317fa4[_0xb0d0('0x14')]['message']);return _0x267e7f(_0x317fa4[_0xb0d0('0x14')][_0xb0d0('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x598239,_0x317fa4['error'][_0xb0d0('0x17')]);return _0x42e5ea(_0x317fa4[_0xb0d0('0x14')]['message']);}else{logger[_0xb0d0('0x11')](_0xb0d0('0x16'),_0x598239,_0xb0d0('0x12'));_0x42e5ea(_0x317fa4[_0xb0d0('0x18')][_0xb0d0('0x17')]);}})['catch'](function(_0x2643e3){logger[_0xb0d0('0x14')](_0xb0d0('0x16'),_0x598239,_0x2643e3);_0x267e7f(_0x2643e3);});});} \ No newline at end of file +var _0x12c9=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x12c9,0x1c9));var _0x912c=function(_0x211c60,_0x3cc9d1){_0x211c60=_0x211c60-0x0;var _0x1623e6=_0x12c9[_0x211c60];return _0x1623e6;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var moment=require(_0x912c('0x2'));var BPromise=require(_0x912c('0x3'));var rs=require(_0x912c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x912c('0x5'))['db'];var utils=require(_0x912c('0x6'));var logger=require(_0x912c('0x7'))(_0x912c('0x8'));var config=require(_0x912c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x912c('0xa')]({'port':0x232a});config[_0x912c('0xb')]=_[_0x912c('0xc')](config[_0x912c('0xb')],{'host':_0x912c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x912c('0xb')]));require('./chatGroup.socket')[_0x912c('0xe')](socket);function respondWithRpcPromise(_0x56f7ba,_0xf95487,_0x580a52){return new BPromise(function(_0x14f4ea,_0x53746d){return client[_0x912c('0xf')](_0x56f7ba,_0x580a52)[_0x912c('0x10')](function(_0x52bbf3){logger[_0x912c('0x11')]('ChatGroup,\x20%s,\x20%s',_0xf95487,_0x912c('0x12'));logger[_0x912c('0x13')](_0x912c('0x14'),_0xf95487,_0x912c('0x12'),JSON[_0x912c('0x15')](_0x52bbf3));if(_0x52bbf3['error']){if(_0x52bbf3[_0x912c('0x16')]['code']===0x1f4){logger[_0x912c('0x16')](_0x912c('0x17'),_0xf95487,_0x52bbf3['error'][_0x912c('0x18')]);return _0x53746d(_0x52bbf3[_0x912c('0x16')][_0x912c('0x18')]);}logger[_0x912c('0x16')](_0x912c('0x17'),_0xf95487,_0x52bbf3[_0x912c('0x16')][_0x912c('0x18')]);return _0x14f4ea(_0x52bbf3[_0x912c('0x16')][_0x912c('0x18')]);}else{logger[_0x912c('0x11')]('ChatGroup,\x20%s,\x20%s',_0xf95487,_0x912c('0x12'));_0x14f4ea(_0x52bbf3[_0x912c('0x19')][_0x912c('0x18')]);}})[_0x912c('0x1a')](function(_0xa18263){logger[_0x912c('0x16')](_0x912c('0x17'),_0xf95487,_0xa18263);_0x53746d(_0xa18263);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 42cfeff..340b38f 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 _0x76be=['./chatGroup.events','update','emit','removeListener','register','length','chatGroup:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76be,0xa8));var _0xe76b=function(_0x9df766,_0x3495a2){_0x9df766=_0x9df766-0x0;var _0x5ddc65=_0x76be[_0x9df766];return _0x5ddc65;};'use strict';var ChatGroupEvents=require(_0xe76b('0x0'));var events=['save','remove',_0xe76b('0x1')];function createListener(_0x4d2441,_0x49e087){return function(_0x517b3e){_0x49e087[_0xe76b('0x2')](_0x4d2441,_0x517b3e);};}function removeListener(_0x194215,_0x556c95){return function(){ChatGroupEvents[_0xe76b('0x3')](_0x194215,_0x556c95);};}exports[_0xe76b('0x4')]=function(_0x44d7a9){for(var _0x3f4de0=0x0,_0x10fc7a=events[_0xe76b('0x5')];_0x3f4de0<_0x10fc7a;_0x3f4de0++){var _0x26cfee=events[_0x3f4de0];var _0x3a2731=createListener(_0xe76b('0x6')+_0x26cfee,_0x44d7a9);ChatGroupEvents['on'](_0x26cfee,_0x3a2731);}}; \ No newline at end of file +var _0x77da=['save','remove','update','removeListener','register','chatGroup:','./chatGroup.events'];(function(_0x24c805,_0xbe445c){var _0x1ea8cb=function(_0x4fe90d){while(--_0x4fe90d){_0x24c805['push'](_0x24c805['shift']());}};_0x1ea8cb(++_0xbe445c);}(_0x77da,0x13a));var _0xa77d=function(_0x4eb142,_0x5895d6){_0x4eb142=_0x4eb142-0x0;var _0x5a3a5f=_0x77da[_0x4eb142];return _0x5a3a5f;};'use strict';var ChatGroupEvents=require(_0xa77d('0x0'));var events=[_0xa77d('0x1'),_0xa77d('0x2'),_0xa77d('0x3')];function createListener(_0x49e5af,_0x29f335){return function(_0x679ce){_0x29f335['emit'](_0x49e5af,_0x679ce);};}function removeListener(_0x183e53,_0xf1153b){return function(){ChatGroupEvents[_0xa77d('0x4')](_0x183e53,_0xf1153b);};}exports[_0xa77d('0x5')]=function(_0x15abf4){for(var _0x493083=0x0,_0x50740d=events['length'];_0x493083<_0x50740d;_0x493083++){var _0x26d1db=events[_0x493083];var _0x20f5d5=createListener(_0xa77d('0x6')+_0x26d1db,_0x15abf4);ChatGroupEvents['on'](_0x26d1db,_0x20f5d5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 6af2aa4..7f1cc08 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 _0x222f=['put','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x222f,0x19a));var _0xf222=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x222f[_0x2dc96f];return _0xd012da;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require('path');var timeout=require(_0xf222('0x2'));var express=require(_0xf222('0x3'));var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./chatGroup.controller');router[_0xf222('0x8')]('/',auth[_0xf222('0x9')](),controller[_0xf222('0xa')]);router[_0xf222('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xf222('0xb')]);router[_0xf222('0x8')](_0xf222('0xc'),auth[_0xf222('0x9')](),controller[_0xf222('0xd')]);router[_0xf222('0x8')](_0xf222('0xe'),auth[_0xf222('0x9')](),controller[_0xf222('0xf')]);router[_0xf222('0x8')](_0xf222('0x10'),auth[_0xf222('0x9')](),controller[_0xf222('0x11')]);router[_0xf222('0x8')](_0xf222('0x12'),auth['isAuthenticated'](),controller[_0xf222('0x13')]);router[_0xf222('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf222('0x14')](_0xf222('0x10'),auth['isAuthenticated'](),controller[_0xf222('0x15')]);router['post']('/:id/messages',auth[_0xf222('0x9')](),controller['addMessage']);router[_0xf222('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf222('0x17')]('/:id',auth[_0xf222('0x9')](),controller[_0xf222('0x18')]);router[_0xf222('0x17')](_0xf222('0x10'),auth[_0xf222('0x9')](),controller[_0xf222('0x19')]);module[_0xf222('0x1a')]=router; \ No newline at end of file +var _0xd124=['isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x3a8d06,_0xc5596f){var _0x3c1015=function(_0x1888a5){while(--_0x1888a5){_0x3a8d06['push'](_0x3a8d06['shift']());}};_0x3c1015(++_0xc5596f);}(_0xd124,0x9f));var _0x4d12=function(_0xd9edc5,_0xdaff9e){_0xd9edc5=_0xd9edc5-0x0;var _0x2a2936=_0xd124[_0xd9edc5];return _0x2a2936;};'use strict';var multer=require(_0x4d12('0x0'));var util=require(_0x4d12('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d12('0x2'));var router=express['Router']();var fs_extra=require(_0x4d12('0x3'));var auth=require(_0x4d12('0x4'));var interaction=require(_0x4d12('0x5'));var config=require(_0x4d12('0x6'));var controller=require(_0x4d12('0x7'));router[_0x4d12('0x8')]('/',auth[_0x4d12('0x9')](),controller[_0x4d12('0xa')]);router[_0x4d12('0x8')](_0x4d12('0xb'),auth['isAuthenticated'](),controller[_0x4d12('0xc')]);router['get'](_0x4d12('0xd'),auth['isAuthenticated'](),controller[_0x4d12('0xe')]);router[_0x4d12('0x8')](_0x4d12('0xf'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x10')]);router[_0x4d12('0x8')](_0x4d12('0x11'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x12')]);router[_0x4d12('0x8')](_0x4d12('0x13'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x14')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4d12('0x15')]('/:id/members',auth['isAuthenticated'](),controller[_0x4d12('0x16')]);router[_0x4d12('0x15')](_0x4d12('0x13'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x17')]);router[_0x4d12('0x18')](_0x4d12('0xd'),auth[_0x4d12('0x9')](),controller['update']);router['delete'](_0x4d12('0xd'),auth[_0x4d12('0x9')](),controller['destroy']);router[_0x4d12('0x19')](_0x4d12('0x11'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x1a')]);module[_0x4d12('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 8ee96a9..97828c1 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 _0x3276=['BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x12b58f,_0x18ffc9){var _0x350c16=function(_0x176a30){while(--_0x176a30){_0x12b58f['push'](_0x12b58f['shift']());}};_0x350c16(++_0x18ffc9);}(_0x3276,0xc7));var _0x6327=function(_0x409c6b,_0x3bd25f){_0x409c6b=_0x409c6b-0x0;var _0x13a52b=_0x3276[_0x409c6b];return _0x13a52b;};'use strict';var Sequelize=require(_0x6327('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6327('0x1')]},'ratingType':{'type':Sequelize[_0x6327('0x2')](_0x6327('0x3'),_0x6327('0x4')),'defaultValue':_0x6327('0x3')},'ratingMessage':{'type':Sequelize[_0x6327('0x5')]},'pathTranscript':{'type':Sequelize[_0x6327('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6327('0x6')]},'secondDisposition':{'type':Sequelize[_0x6327('0x6')]},'thirdDisposition':{'type':Sequelize[_0x6327('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x6327('0x6')]},'browserVersion':{'type':Sequelize[_0x6327('0x6')]},'osName':{'type':Sequelize[_0x6327('0x6')]},'osVersion':{'type':Sequelize[_0x6327('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x6327('0x6')]},'deviceType':{'type':Sequelize[_0x6327('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x6327('0x6')]},'formData':{'type':Sequelize[_0x6327('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x6327('0x7')]},'lastMsgAt':{'type':Sequelize[_0x6327('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x6327('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6327('0x6')]},'customerPort':{'type':Sequelize[_0x6327('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x6327('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x6327('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x2f3a=['BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x3847b3,_0x22ffc9){var _0x2f7412=function(_0x15343d){while(--_0x15343d){_0x3847b3['push'](_0x3847b3['shift']());}};_0x2f7412(++_0x22ffc9);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x3b0879,_0x4caa55){_0x3b0879=_0x3b0879-0x0;var _0x5e6e8c=_0x2f3a[_0x3b0879];return _0x5e6e8c;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa2f3('0x1')]},'ratingType':{'type':Sequelize[_0xa2f3('0x2')](_0xa2f3('0x3'),_0xa2f3('0x4')),'defaultValue':_0xa2f3('0x3')},'ratingMessage':{'type':Sequelize[_0xa2f3('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa2f3('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa2f3('0x6')]},'secondDisposition':{'type':Sequelize[_0xa2f3('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa2f3('0x6')]},'browserVersion':{'type':Sequelize[_0xa2f3('0x6')]},'osName':{'type':Sequelize[_0xa2f3('0x6')]},'osVersion':{'type':Sequelize[_0xa2f3('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa2f3('0x6')]},'deviceType':{'type':Sequelize[_0xa2f3('0x6')]},'referer':{'type':Sequelize[_0xa2f3('0x5')]},'customerIp':{'type':Sequelize[_0xa2f3('0x6')]},'formData':{'type':Sequelize[_0xa2f3('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa2f3('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa2f3('0x6')]},'customerPort':{'type':Sequelize[_0xa2f3('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa2f3('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index b776d90..c7a8ff5 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 _0x6588=['ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','show','params','includeAll','create','body','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','close','mailTranscript','server/files/chat/upload/','now','Messages','User','%s%d','agentAlias','System','customer','format','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','$gte','include','findAll','getMyMessages','includeAgent','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','download','server','files','transcript-%d-%s.zip','firstName','lastName','secret','Owner','get','mkdirSync','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','createWriteStream','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','stack','name','send','merge','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','unmanaged','total','UserId','waiting','closed','disposition','abandoned','index','ChatInteraction','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','keys','some','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','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)','getFullTextValue','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)','order','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x56f6e3,_0x4be59b){var _0x4f86e8=function(_0x55e562){while(--_0x55e562){_0x56f6e3['push'](_0x56f6e3['shift']());}};_0x4f86e8(++_0x4be59b);}(_0x6588,0x80));var _0x8658=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x6588[_0x209ec9];return _0x129b1b;};'use strict';var emlformat=require(_0x8658('0x0'));var rimraf=require(_0x8658('0x1'));var zipdir=require(_0x8658('0x2'));var jsonpatch=require(_0x8658('0x3'));var rp=require('request-promise');var moment=require(_0x8658('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8658('0x5'));var util=require(_0x8658('0x6'));var path=require(_0x8658('0x7'));var sox=require(_0x8658('0x8'));var csv=require(_0x8658('0x9'));var ejs=require(_0x8658('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8658('0xb'));var squel=require(_0x8658('0xc'));var crypto=require(_0x8658('0xd'));var jsforce=require(_0x8658('0xe'));var deskjs=require(_0x8658('0xf'));var toCsv=require(_0x8658('0x9'));var querystring=require('querystring');var Papa=require(_0x8658('0x10'));var Redis=require(_0x8658('0x11'));var authService=require(_0x8658('0x12'));var qs=require(_0x8658('0x13'));var as=require(_0x8658('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8658('0x15'));var logger=require(_0x8658('0x16'))(_0x8658('0x17'));var utils=require(_0x8658('0x18'));var config=require(_0x8658('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8658('0x1a'))['db'];config['redis']=_[_0x8658('0x1b')](config[_0x8658('0x1c')],{'host':_0x8658('0x1d'),'port':0x18eb});var socket=require(_0x8658('0x1e'))(new Redis(config[_0x8658('0x1c')]));require(_0x8658('0x1f'))[_0x8658('0x20')](socket);var jayson=require(_0x8658('0x21'));var client=jayson['client'][_0x8658('0x22')]({'port':0x232b});var client9004=jayson[_0x8658('0x23')][_0x8658('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x594177,_0x43beb3,_0x2a77fa,_0x15d8c8){return new BPromise(function(_0x5e9108,_0x368417){var _0x4b3a10=_0x15d8c8||client;return _0x4b3a10[_0x8658('0x24')](_0x594177,_0x2a77fa)[_0x8658('0x25')](function(_0xb49892){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x43beb3,_0x8658('0x26'));logger[_0x8658('0x27')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x43beb3,'request\x20sent',JSON[_0x8658('0x28')](_0xb49892));if(_0xb49892[_0x8658('0x29')]){if(_0xb49892[_0x8658('0x29')][_0x8658('0x2a')]===0x1f4){logger['error'](_0x8658('0x2b'),_0x43beb3,_0xb49892[_0x8658('0x29')][_0x8658('0x2c')]);return _0x368417(_0xb49892['error'][_0x8658('0x2c')]);}logger[_0x8658('0x29')](_0x8658('0x2b'),_0x43beb3,_0xb49892[_0x8658('0x29')]['message']);return _0x5e9108(_0xb49892[_0x8658('0x29')][_0x8658('0x2c')]);}else{logger[_0x8658('0x2d')](_0x8658('0x2b'),_0x43beb3,_0x8658('0x26'));_0x5e9108(_0xb49892['result'][_0x8658('0x2c')]);}})[_0x8658('0x2e')](function(_0xa00f2f){logger[_0x8658('0x29')](_0x8658('0x2b'),_0x43beb3,_0xa00f2f);_0x368417(_0xa00f2f);});});}function respondWithStatusCode(_0x48e1e6,_0x3f853c){_0x3f853c=_0x3f853c||0xcc;return function(_0x3a61c8){if(_0x3a61c8){return _0x48e1e6[_0x8658('0x2f')](_0x3f853c);}return _0x48e1e6[_0x8658('0x30')](_0x3f853c)['end']();};}function respondWithResult(_0x54a26b,_0x7cc95){_0x7cc95=_0x7cc95||0xc8;return function(_0x2d6611){if(_0x2d6611){return _0x54a26b['status'](_0x7cc95)[_0x8658('0x31')](_0x2d6611);}};}function respondWithFilteredResult(_0x58266b,_0x3224b5){return function(_0x298176){if(_0x298176){var _0x44fbaa=typeof _0x3224b5[_0x8658('0x32')]===_0x8658('0x33')&&typeof _0x3224b5['limit']===_0x8658('0x33');var _0x83551=_0x298176[_0x8658('0x34')];var _0x40d019=_0x44fbaa?0x0:_0x3224b5[_0x8658('0x32')];var _0x1e75d8=_0x44fbaa?_0x298176['count']:_0x3224b5[_0x8658('0x32')]+_0x3224b5[_0x8658('0x35')];var _0x479106;if(_0x1e75d8>=_0x83551){_0x1e75d8=_0x83551;_0x479106=0xc8;}else{_0x479106=0xce;}_0x58266b[_0x8658('0x30')](_0x479106);return _0x58266b['set'](_0x8658('0x36'),_0x40d019+'-'+_0x1e75d8+'/'+_0x83551)[_0x8658('0x31')](_0x298176);}return null;};}function patchUpdates(_0x224661){return function(_0x3591ce){try{jsonpatch[_0x8658('0x37')](_0x3591ce,_0x224661,!![]);}catch(_0x3af5b6){return BPromise[_0x8658('0x38')](_0x3af5b6);}return _0x3591ce[_0x8658('0x39')]();};}function saveUpdates(_0x1df4c5,_0x5b01a9){return function(_0x30fb82){if(_0x30fb82){return _0x30fb82[_0x8658('0x3a')](_0x1df4c5)[_0x8658('0x25')](function(_0x30bab7){return _0x30bab7;});}return null;};}function removeEntity(_0x23efc0,_0xc668b8){return function(_0x84ab1e){if(_0x84ab1e){return _0x84ab1e['destroy']()[_0x8658('0x25')](function(){_0x23efc0[_0x8658('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x550813,_0xd3647e){return function(_0x3cb9f6){if(!_0x3cb9f6){_0x550813[_0x8658('0x2f')](0x194);}return _0x3cb9f6;};}function handleError(_0x2e9638,_0x253402){_0x253402=_0x253402||0x1f4;return function(_0x4b64a5){logger[_0x8658('0x29')](_0x4b64a5[_0x8658('0x3b')]);if(_0x4b64a5[_0x8658('0x3c')]){delete _0x4b64a5[_0x8658('0x3c')];}_0x2e9638[_0x8658('0x30')](_0x253402)[_0x8658('0x3d')](_0x4b64a5);};}function getMustacheRender(_0x120c0d,_0x16dba9){return Mustache['render'](_0x120c0d,_[_0x8658('0x3e')](_0x16dba9['body'],{'contact':_0x16dba9['contact'],'message':_0x16dba9[_0x8658('0x2c')],'agent':_0x16dba9[_0x8658('0x3f')],'interaction':_0x16dba9[_0x8658('0x40')],'account':_0x16dba9[_0x8658('0x41')]}))||'';}function getInteractionUsers(_0x3f9ef9,_0x5e5573){return new BPromise(function(_0x4be3a9,_0x1bc0a3){try{if(_0x5e5573[_0x3f9ef9['id']]){_0x3f9ef9[_0x8658('0x42')]=_[_0x8658('0x43')](_0x5e5573[_0x3f9ef9['id']],function(_0x8cd391){return{'id':_0x8cd391['id'],'fullname':_0x8cd391[_0x8658('0x44')]};});}}catch(_0x229d47){_0x1bc0a3(_0x229d47);}_0x4be3a9(_0x3f9ef9);});}function getInteractionTags(_0x2cbc8d,_0x1d4b2c){return new BPromise(function(_0x30f043,_0xe798cd){try{if(_0x2cbc8d[_0x8658('0x45')]){_0x2cbc8d[_0x8658('0x46')]=[];_0x2cbc8d['TagIds'][_0x8658('0x47')](',')[_0x8658('0x48')](function(_0x55781e){_0x2cbc8d[_0x8658('0x46')]['push'](_0x1d4b2c[_0x55781e]);});}delete _0x2cbc8d[_0x8658('0x45')];}catch(_0x44539c){_0xe798cd(_0x44539c);}_0x30f043(_0x2cbc8d);});}function updateChatInteraction(_0x13444f,_0x2890aa,_0x3958bb){return new BPromise(function(_0x50978a,_0x29dd9a){return getInteractionUsers(_0x13444f,_0x3958bb)[_0x8658('0x25')](function(_0x4da848){return getInteractionTags(_0x4da848,_0x2890aa);})[_0x8658('0x25')](function(_0x2e1acd){return getStateInteraction(_0x2e1acd);})[_0x8658('0x25')](function(_0x135d17){_0x50978a(_0x135d17);})[_0x8658('0x2e')](function(_0x42a502){_0x29dd9a(_0x42a502);});});}function getStateInteraction(_0x1bba9b){return new BPromise(function(_0x1e2e9e){_0x1bba9b['waiting']=0x0;_0x1bba9b[_0x8658('0x49')]=0x0;_0x1bba9b[_0x8658('0x4a')]=0x0;_0x1bba9b[_0x8658('0x4b')]=0x0;_0x1bba9b['abandoned']=0x0;_0x1bba9b[_0x8658('0x4c')]=0x0;if(!_0x1bba9b['closed']&&!_0x1bba9b[_0x8658('0x4d')]){_0x1bba9b[_0x8658('0x4e')]+=0x1;}if(!_0x1bba9b[_0x8658('0x4f')]&&_0x1bba9b[_0x8658('0x4d')]){_0x1bba9b[_0x8658('0x49')]+=0x1;if(_0x1bba9b['waiting']){_0x1bba9b[_0x8658('0x4e')]-=0x1;}}if(_0x1bba9b[_0x8658('0x4f')]&&_0x1bba9b[_0x8658('0x50')]===_0x8658('0x51')){_0x1bba9b[_0x8658('0x51')]+=0x1;if(_0x1bba9b[_0x8658('0x4e')]){_0x1bba9b['waiting']-=0x1;}}else if(_0x1bba9b[_0x8658('0x4f')]&&!_0x1bba9b[_0x8658('0x4d')]&&_0x1bba9b['disposition']){_0x1bba9b[_0x8658('0x4b')]+=0x1;if(_0x1bba9b[_0x8658('0x4e')]){_0x1bba9b[_0x8658('0x4e')]-=0x1;}}else if(_0x1bba9b['closed']&&_0x1bba9b[_0x8658('0x4d')]){_0x1bba9b[_0x8658('0x4a')]+=0x1;if(_0x1bba9b[_0x8658('0x49')]){_0x1bba9b[_0x8658('0x49')]-=0x1;}}_0x1bba9b[_0x8658('0x4c')]+=0x1;_0x1e2e9e(_0x1bba9b);});}exports[_0x8658('0x52')]=function(_0x2cb3c1,_0x4800ba){var _0x4b7d12={},_0x38a8c3={},_0x1dbc7c={'count':0x0,'rows':[]};var _0x1ece2f=_['map'](db[_0x8658('0x53')][_0x8658('0x54')],function(_0x2a9be3){return{'name':_0x2a9be3[_0x8658('0x55')],'type':_0x2a9be3[_0x8658('0x56')]['key']};});_0x38a8c3[_0x8658('0x57')]=_[_0x8658('0x43')](_0x1ece2f,_0x8658('0x3c'));_0x38a8c3[_0x8658('0x58')]=_['keys'](_0x2cb3c1[_0x8658('0x58')]);_0x38a8c3['filters']=_[_0x8658('0x59')](_0x38a8c3[_0x8658('0x57')],_0x38a8c3[_0x8658('0x58')]);_0x4b7d12['attributes']=_[_0x8658('0x59')](_0x38a8c3[_0x8658('0x57')],qs['fields'](_0x2cb3c1['query'][_0x8658('0x5a')]));_0x4b7d12[_0x8658('0x5b')]=_0x4b7d12['attributes'][_0x8658('0x5c')]?_0x4b7d12['attributes']:_0x38a8c3['model'];if(!_0x2cb3c1[_0x8658('0x58')][_0x8658('0x5d')](_0x8658('0x5e'))){_0x4b7d12[_0x8658('0x35')]=qs[_0x8658('0x35')](_0x2cb3c1[_0x8658('0x58')][_0x8658('0x35')]);_0x4b7d12[_0x8658('0x32')]=qs[_0x8658('0x32')](_0x2cb3c1['query']['offset']);}_0x4b7d12['order']=qs[_0x8658('0x5f')](_0x2cb3c1[_0x8658('0x58')][_0x8658('0x5f')]);_0x4b7d12[_0x8658('0x60')]=qs[_0x8658('0x61')](_[_0x8658('0x62')](_0x2cb3c1['query'],_0x38a8c3[_0x8658('0x61')]),_0x1ece2f);var _0x345597=[];var _0x4069f2=squel[_0x8658('0x63')]()[_0x8658('0x64')]('id')['field']('name')[_0x8658('0x64')]('color')[_0x8658('0x65')](_0x8658('0x66'));var _0x26518c=squel[_0x8658('0x63')]()[_0x8658('0x64')](_0x8658('0x67'))[_0x8658('0x64')](_0x8658('0x68'))['field'](_0x8658('0x69'))[_0x8658('0x65')](_0x8658('0x6a'),'ui')[_0x8658('0x6b')](_0x8658('0x6c'),'u',_0x8658('0x6d'));var _0x31552e=squel['select']()[_0x8658('0x65')](_0x8658('0x6e'),'i')[_0x8658('0x6b')]('cm_contacts','c',_0x8658('0x6f'))[_0x8658('0x6b')](_0x8658('0x6c'),'o',_0x8658('0x70'))['left_join'](_0x8658('0x71'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x8658('0x6b')]('chat_messages','me',_0x8658('0x72'))[_0x8658('0x6b')](_0x8658('0x73'),'it',_0x8658('0x74'))[_0x8658('0x6b')]('tools_tags','t',_0x8658('0x75'));var _0x4436b1=squel[_0x8658('0x76')]();var _0xb93a8e=[];var _0x5b5295=squel[_0x8658('0x76')]();var _0x3ec33b;if(_0x2cb3c1['query'][_0x8658('0x77')]){_0x3ec33b=as['parseSearch'](_0x2cb3c1[_0x8658('0x58')][_0x8658('0x77')]);var _0x20d053=_0x3ec33b[_0x8658('0x78')];for(var _0x214693=0x0;_0x214693<_0x3ec33b[_0x8658('0x79')]['length'];_0x214693++){var _0x49a0ba=_0x3ec33b[_0x8658('0x79')][_0x214693];var _0x23f5d5='i';var _0x387cca=_[_0x8658('0x7a')](_0x1ece2f,[_0x8658('0x3c'),_0x49a0ba[_0x8658('0x64')]]);if(!_0x387cca){switch(_0x49a0ba[_0x8658('0x64')]){case _0x8658('0x7b'):if(_0x49a0ba[_0x8658('0x7c')]==0x1){_0x31552e['having']('`'+_0x49a0ba[_0x8658('0x64')]+'`\x20=\x200');}else{_0x31552e[_0x8658('0x7d')]('`'+_0x49a0ba[_0x8658('0x64')]+_0x8658('0x7e'));}break;case _0x8658('0x7f'):if(_0x49a0ba[_0x8658('0x80')]==='$substring'){if(_0x49a0ba[_0x8658('0x7c')][_0x8658('0x47')]('\x20')[_0x8658('0x5c')]>0x1){_0x4436b1[_0x20d053](_0x8658('0x81'),qs['getFullTextValue'](_0x49a0ba[_0x8658('0x7c')]),null);}else{var _0x320089='%'+_0x49a0ba[_0x8658('0x7c')]+'%';_0x4436b1[_0x20d053](_0x8658('0x82'),_0x320089,_0x320089,_0x320089);}}else{_0x387cca=_['find'](_0x1ece2f,['name',_0x8658('0x83')]);_0x49a0ba['field']=_0x8658('0x83');_0x27d3fe=as[_0x8658('0x84')](_0x23f5d5,_0x387cca['type'],_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe['text'],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x85')],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);}break;case'Tag':var _0x36d608=_0x49a0ba['value'][_0x8658('0x47')](',')['map'](function(_0x519ca7){return Number(_0x519ca7);});_0x36d608[_0x8658('0x48')](function(_0x1b2835){_0x5b5295['or'](_0x8658('0x87'),'%,'+_0x1b2835+',%');});_0xb93a8e=_['union'](_0xb93a8e,_0x36d608);break;case'User':if(_0x49a0ba[_0x8658('0x80')]===_0x8658('0x88')){_0x4436b1[_0x20d053](_0x8658('0x89'),'%'+_0x49a0ba[_0x8658('0x7c')]+'%',null);}else{_0x387cca=_[_0x8658('0x7a')](_0x1ece2f,[_0x8658('0x3c'),_0x8658('0x4d')]);_0x49a0ba[_0x8658('0x64')]=_0x8658('0x4d');_0x27d3fe=as['buildExpression'](_0x23f5d5,_0x387cca['type'],_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe[_0x8658('0x8a')],_0x27d3fe[_0x8658('0x7c')]['start'],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);}break;case'body':_0x27d3fe=as[_0x8658('0x84')]('me',null,_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe[_0x8658('0x8a')],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x85')],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);break;}}else{var _0x27d3fe=as[_0x8658('0x84')](_0x23f5d5,_0x387cca[_0x8658('0x56')],_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe[_0x8658('0x8a')],_0x27d3fe[_0x8658('0x7c')]['start'],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);}}}else{var _0x10c337=_(_0x2cb3c1['query'])[_0x8658('0x8b')]()[_0x8658('0x43')](function(_0x27c75b){return _[_0x8658('0x8c')](_0x1ece2f,[_0x8658('0x3c'),_0x27c75b])?_0x27c75b:undefined;})[_0x8658('0x8d')]()['value']();if(!_['isEmpty'](_0x10c337)){_0x10c337[_0x8658('0x48')](function(_0xc1cea8){if(_0xc1cea8==='ChatWebsiteId'){_0x31552e[_0x8658('0x60')](_0x8658('0x8e'),[][_0x8658('0x8f')](_0x2cb3c1[_0x8658('0x58')][_0xc1cea8]));}else if(_0xc1cea8===_0x8658('0x90')){var _0x2c0f4c=JSON[_0x8658('0x91')](_0x2cb3c1[_0x8658('0x58')][_0xc1cea8])['$gte'];var _0x45344f=JSON['parse'](_0x2cb3c1['query'][_0xc1cea8])[_0x8658('0x92')];_0x31552e[_0x8658('0x60')](_0x8658('0x93'),_0x2c0f4c,_0x45344f);}else{if(_0x2cb3c1['query'][_0xc1cea8]===_0x8658('0x94')){_0x31552e['where']('i.'+_0xc1cea8+'\x20IS\x20NULL');}else{_0x31552e['where']('i.'+_0xc1cea8+_0x8658('0x95'),_0x2cb3c1['query'][_0xc1cea8]);}}});}if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0x96')]){if(_0x2cb3c1[_0x8658('0x58')]['read']==0x1){_0x31552e[_0x8658('0x7d')]('`unreadMessages`\x20=\x200');}else{_0x31552e[_0x8658('0x7d')](_0x8658('0x97'));}}if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0x98')]){_0xb93a8e=_[_0x8658('0x99')](_0x2cb3c1['query'][_0x8658('0x98')])?_0x2cb3c1[_0x8658('0x58')][_0x8658('0x98')]:new Array(_0x2cb3c1['query']['tag']);_0xb93a8e['forEach'](function(_0x5badc6){_0x5b5295['or'](_0x8658('0x87'),'%,'+_0x5badc6+',%');});}if(_0x2cb3c1[_0x8658('0x58')]['filter']){var _0x3517bd=_0x2cb3c1['query'][_0x8658('0x9a')]['replace']('\x5c','\x5c\x5c')[_0x8658('0x9b')](/'/g,'\x27\x27');if(qs[_0x8658('0x9c')](_0x3517bd)){_0x4436b1['or'](_0x8658('0x9d'),_0x3517bd+'%');}else{_0x4436b1['or'](_0x8658('0x9e'),qs[_0x8658('0x9f')](_0x3517bd))['or'](_0x8658('0xa0'),_0x3517bd+'%');}}}_0x31552e[_0x8658('0x60')](_0x4436b1);_0x31552e[_0x8658('0xa1')](_0x8658('0xa2'));var _0x491e44={'type':db[_0x8658('0xa3')][_0x8658('0xa4')]['SELECT'],'raw':!![]};var _0x4e07fe=_0x31552e[_0x8658('0xa5')]();_0x4e07fe[_0x8658('0x64')]('i.id');_0x4e07fe[_0x8658('0x64')](_0x8658('0xa6'),_0x8658('0x7b'));if(_0x4b7d12[_0x8658('0xa7')]){_0x4b7d12[_0x8658('0xa7')]['forEach'](function(_0x11f3b0){var _0x5b908a=_0x11f3b0[0x0]===_0x8658('0xa8')?_0x11f3b0[0x0]:'i.'+_0x11f3b0[0x0];_0x31552e[_0x8658('0xa7')](_0x5b908a,_0x11f3b0[0x1]===_0x8658('0xa9')?![]:!![]);});}if(!_['isEmpty'](_0xb93a8e)){_0x31552e[_0x8658('0x7d')](_0x5b5295);_0x4e07fe[_0x8658('0x60')](_0x8658('0xaa'),_0xb93a8e);}BPromise[_0x8658('0xab')]()[_0x8658('0x25')](function(){if(!_0x3ec33b){if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0xac')])return;_0x4e07fe['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x31552e[_0x8658('0x60')](_0x8658('0xad'));return;}if(_0x2cb3c1[_0x8658('0xae')][_0x8658('0xaf')]!==_0x8658('0x3f'))return;return _0x2cb3c1[_0x8658('0xae')][_0x8658('0xb0')]({'attributes':['id'],'raw':!![]})[_0x8658('0x25')](function(_0x3e66f0){if(_[_0x8658('0xb1')](_0x3e66f0)){_0x4e07fe[_0x8658('0x60')]('i.ChatWebsiteId\x20IS\x20NULL');_0x31552e['where'](_0x8658('0xb2'));}else{_0x4e07fe['where'](_0x8658('0x8e'),_[_0x8658('0x43')](_0x3e66f0,'id'));_0x31552e['where'](_0x8658('0x8e'),_[_0x8658('0x43')](_0x3e66f0,'id'));}});})[_0x8658('0x25')](function(){if(_0x2cb3c1['user'][_0x8658('0xaf')]===_0x8658('0x3f')&&!_0x3ec33b&&!_0x2cb3c1[_0x8658('0x58')][_0x8658('0xac')])return[];return db[_0x8658('0xb3')]['query'](_0x4e07fe['toString'](),_0x491e44);})[_0x8658('0x25')](function(_0x49d079){_0x1dbc7c['count']=_0x49d079[_0x8658('0x5c')];if(_0x1dbc7c['count']===0x0)return[];return db[_0x8658('0xb3')][_0x8658('0x58')](_0x4069f2[_0x8658('0xb4')](),_0x491e44)[_0x8658('0x25')](function(_0x1ab673){_0x345597=_['keyBy'](_0x1ab673,'id');_0x491e44=_[_0x8658('0x3e')](_0x491e44,{'model':db[_0x8658('0x53')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0x5a')]){_0x4b7d12[_0x8658('0x5b')]['forEach'](function(_0x5bb576){_0x31552e[_0x8658('0x64')]('i.'+_0x5bb576);});}else{_0x31552e[_0x8658('0x64')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8658('0x7b'));_0x31552e[_0x8658('0x64')](_0x8658('0xb5'),_0x8658('0xb6'));_0x31552e[_0x8658('0x64')](_0x8658('0xb7'),'Account.mandatoryDisposition');_0x31552e[_0x8658('0x64')](_0x8658('0xb8'),_0x8658('0xa8'));_0x31552e['field'](_0x8658('0xb9'));_0x31552e[_0x8658('0x64')](_0x8658('0xba'),_0x8658('0xbb'));_0x31552e[_0x8658('0x64')](_0x8658('0xbc'),_0x8658('0xbd'));_0x31552e[_0x8658('0x64')](_0x8658('0xbe'),'Contact.email');_0x31552e['field'](_0x8658('0xbf'),_0x8658('0xc0'));_0x31552e[_0x8658('0x64')](_0x8658('0xc1'),_0x8658('0xc2'));_0x31552e[_0x8658('0x64')](_0x8658('0xc3'),_0x8658('0xc4'));_0x31552e['field']('o.fullname','Owner.fullname');_0x31552e[_0x8658('0x64')](_0x8658('0xc5'),_0x8658('0xc6'));_0x31552e['field'](_0x8658('0xc7'),'TagIds');}if(_0x4b7d12[_0x8658('0x35')])_0x31552e[_0x8658('0x35')](_0x4b7d12[_0x8658('0x35')]);if(_0x4b7d12[_0x8658('0x32')])_0x31552e['offset'](_0x4b7d12[_0x8658('0x32')]);return db[_0x8658('0xb3')]['query'](_0x31552e[_0x8658('0xb4')](),_0x491e44);})[_0x8658('0x25')](function(_0x5f5070){if(_0x5f5070['length']>0x0)_0x26518c['where'](_0x8658('0xc8'),_['map'](_0x5f5070,'id'));return db[_0x8658('0xb3')]['query'](_0x26518c[_0x8658('0xb4')](),_0x491e44)[_0x8658('0x25')](function(_0x40d6c5){var _0x140511=_['groupBy'](_0x40d6c5,_0x8658('0xc9'));var _0x3e33b7=[];_0x5f5070['forEach'](function(_0x135719){_0x3e33b7[_0x8658('0xca')](updateChatInteraction(_0x135719,_0x345597,_0x140511));});return BPromise[_0x8658('0xcb')](_0x3e33b7);});});})['then'](function(_0x2a1ac7){_0x1dbc7c[_0x8658('0xcc')]=_0x2a1ac7;return _0x1dbc7c;})[_0x8658('0x25')](respondWithFilteredResult(_0x4800ba,_0x4b7d12))[_0x8658('0x2e')](handleError(_0x4800ba,null));};exports[_0x8658('0xcd')]=function(_0x460257,_0x4988b7){var _0x83592d={'raw':![],'where':{'id':_0x460257[_0x8658('0xce')]['id']}},_0x32929e={};_0x32929e[_0x8658('0x57')]=_[_0x8658('0x8b')](db[_0x8658('0x53')]['rawAttributes']);_0x32929e[_0x8658('0x58')]=_[_0x8658('0x8b')](_0x460257[_0x8658('0x58')]);_0x32929e[_0x8658('0x61')]=_[_0x8658('0x59')](_0x32929e[_0x8658('0x57')],_0x32929e['query']);_0x83592d['attributes']=_['intersection'](_0x32929e['model'],qs[_0x8658('0x5a')](_0x460257[_0x8658('0x58')][_0x8658('0x5a')]));_0x83592d[_0x8658('0x5b')]=_0x83592d[_0x8658('0x5b')][_0x8658('0x5c')]?_0x83592d[_0x8658('0x5b')]:_0x32929e[_0x8658('0x57')];if(_0x460257[_0x8658('0x58')][_0x8658('0xcf')]){_0x83592d['include']=[{'all':!![]}];}_0x83592d=_[_0x8658('0x3e')]({},_0x83592d,_0x460257['options']);return db[_0x8658('0x53')]['find'](_0x83592d)[_0x8658('0x25')](handleEntityNotFound(_0x4988b7,null))[_0x8658('0x25')](respondWithResult(_0x4988b7,null))[_0x8658('0x2e')](handleError(_0x4988b7,null));};exports[_0x8658('0xd0')]=function(_0x1ac79f,_0x3a3c1c){return db[_0x8658('0x53')]['create'](_0x1ac79f[_0x8658('0xd1')],{})['then'](respondWithResult(_0x3a3c1c,0xc9))[_0x8658('0x2e')](handleError(_0x3a3c1c,null));};exports[_0x8658('0x3a')]=function(_0xf9ecf5,_0x2a1c89){if(_0xf9ecf5[_0x8658('0xd1')]['id']){delete _0xf9ecf5[_0x8658('0xd1')]['id'];}return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0xf9ecf5[_0x8658('0xce')]['id']}})[_0x8658('0x25')](handleEntityNotFound(_0x2a1c89,null))[_0x8658('0x25')](saveUpdates(_0xf9ecf5['body'],null))[_0x8658('0x25')](respondWithResult(_0x2a1c89,null))['catch'](handleError(_0x2a1c89,null));};exports[_0x8658('0xd2')]=function(_0x49a424,_0x2395b5){return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0x49a424[_0x8658('0xce')]['id']}})['then'](handleEntityNotFound(_0x2395b5,null))[_0x8658('0x25')](removeEntity(_0x2395b5,null))[_0x8658('0x2e')](handleError(_0x2395b5,null));};exports[_0x8658('0xd3')]=function(_0x2a5ea0,_0x225166){return db['ChatInteraction'][_0x8658('0xd3')]()[_0x8658('0x25')](respondWithResult(_0x225166,null))[_0x8658('0x2e')](handleError(_0x225166,null));};exports[_0x8658('0xd4')]=function(_0x4bf0de,_0x312ec6){var _0x39125f=_0x4bf0de[_0x8658('0xce')]['id'];var _0x4687fb;var _0x120bc8;var _0x2ce9de;return db[_0x8658('0x53')][_0x8658('0xd5')]({'where':{'id':_0x39125f}})['then'](function(_0x4607d2){_0x4687fb=_0x4607d2;return db[_0x8658('0xd6')][_0x8658('0xd5')]({'where':{'id':_0x4607d2[_0x8658('0xac')]},'attributes':['id',_0x8658('0xd7'),_0x8658('0xd8'),_0x8658('0xd9'),_0x8658('0xda'),_0x8658('0xdb')],'raw':!![]});})[_0x8658('0x25')](function(_0x356736){if(_0x356736&&_0x356736[_0x8658('0xd7')]&&_0x356736[_0x8658('0xd8')]){_0x120bc8=_0x356736;var _0xbb37df={'interaction':{'id':_0x39125f},'agent':{'id':_0x4bf0de[_0x8658('0xae')]['id'],'name':_0x4bf0de['user'][_0x8658('0x3c')],'fullname':_0x4bf0de[_0x8658('0xae')][_0x8658('0x44')],'email':_0x4bf0de[_0x8658('0xae')]['email']},'contact':_0x4bf0de[_0x8658('0xd1')][_0x8658('0xdc')],'account':_0x4bf0de[_0x8658('0xd1')][_0x8658('0x41')]};var _0x2052ad={'rejectUnauthorized':![],'method':_0x8658('0xdd'),'url':_0x8658('0xde'),'headers':{'X-APIKEY':_0x356736[_0x8658('0xd7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4bf0de['user'][_0x8658('0xdf')]],'buttons':null,'topic':_0x120bc8[_0x8658('0xd9')],'note':_[_0x8658('0xe0')](_0x120bc8[_0x8658('0xda')])?null:getMustacheRender(_0x120bc8[_0x8658('0xda')],_0xbb37df),'metadata':null},'redirect':_0x8658('0xe1'),'json':!![]};try{if(!_[_0x8658('0xe0')](_0x120bc8[_0x8658('0xdb')])){var _0x150fca=getMustacheRender(_0x120bc8[_0x8658('0xdb')],_0xbb37df);var _0x30023a=JSON[_0x8658('0x91')](_0x150fca);_0x2052ad['body'][_0x8658('0xe2')]=_0x30023a;}}catch(_0x440da5){throw new db['Sequelize'][(_0x8658('0xe3'))](_0x8658('0xe4'));}return rp(_0x2052ad);}else{throw new db[(_0x8658('0xa3'))][(_0x8658('0xe3'))](_0x8658('0xe5'));}})[_0x8658('0x25')](function(_0x3fbd8b){_0x2ce9de=_0x3fbd8b;if(_0x2ce9de['id']){var _0x5f92ca={'body':_0x2ce9de[_0x8658('0xe6')],'ChatWebsiteId':_0x120bc8['id'],'ChatInteractionId':_0x4687fb['id'],'direction':_0x8658('0xe7'),'UserId':_0x4bf0de[_0x8658('0xae')]['id']};return db[_0x8658('0xe8')]['create'](_0x5f92ca,{});}else{throw new db[(_0x8658('0xa3'))][(_0x8658('0xe3'))](_0x8658('0xe9'));}})[_0x8658('0x25')](function(){return _0x4687fb['updateAttributes']({'vidaooSessionId':_0x2ce9de['id']});})['then'](respondWithResult(_0x312ec6,null))[_0x8658('0x2e')](handleError(_0x312ec6,null));};exports[_0x8658('0xea')]=function(_0x3b1600,_0x542f9e){if(_0x3b1600[_0x8658('0xd1')]['id']){delete _0x3b1600[_0x8658('0xd1')]['id'];}return db['ChatInteraction'][_0x8658('0x7a')]({'where':{'id':_0x3b1600['params']['id']},'include':[{'model':db[_0x8658('0xeb')],'as':_0x8658('0x7f')}]})[_0x8658('0x25')](handleEntityNotFound(_0x542f9e,null))[_0x8658('0x25')](saveUpdates(_0x3b1600[_0x8658('0xd1')],null))[_0x8658('0x25')](respondWithResult(_0x542f9e,null))['catch'](handleError(_0x542f9e,null));};exports['abandon']=function(_0x259769,_0x58290c,_0x5cfe17){if(_0x259769[_0x8658('0xd1')]['id']){delete _0x259769[_0x8658('0xd1')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x259769[_0x8658('0xce')]['id']}})[_0x8658('0x25')](function(_0x235382){if(!_0x235382){logger[_0x8658('0x29')](_0x8658('0xec'),_0x8658('0xed'),0x194,_0x8658('0xee'));_0x58290c['sendStatus'](0x194);}else{if(_0x235382[_0x8658('0x4d')]){throw new db[(_0x8658('0xa3'))][(_0x8658('0xe3'))]('Interaction\x20already\x20assigned');}}return _0x235382;})[_0x8658('0x25')](function(_0x229db9){if(_0x229db9){return _0x229db9[_0x8658('0x3a')]({'closed':_0x259769[_0x8658('0xd1')][_0x8658('0x4f')],'disposition':_0x259769['body'][_0x8658('0x50')]})[_0x8658('0x25')](function(_0x795429){return _0x795429;});}})['then'](function(_0xe4e687){return respondWithRpcPromise(_0x8658('0xef'),'abandon',_0x259769[_0x8658('0xd1')],client9004);})[_0x8658('0x25')](respondWithResult(_0x58290c,null))['catch'](handleError(_0x58290c,null));};exports[_0x8658('0xf0')]=function(_0x190c34,_0x494399,_0x1e002b){_0x190c34[_0x8658('0xd1')][_0x8658('0x3c')]=_0x190c34['file'][_0x8658('0xf1')];_0x190c34['body']['basename']=_0x190c34[_0x8658('0xf2')][_0x8658('0xf3')];_0x190c34['body']['type']=_0x190c34[_0x8658('0xf2')][_0x8658('0xf4')];return db[_0x8658('0xf5')][_0x8658('0xd0')](_0x190c34['body'])[_0x8658('0x25')](respondWithResult(_0x494399,0xc9))['catch'](handleError(_0x494399,null));};exports[_0x8658('0xf6')]=function(_0x8dec85,_0x2a6aef,_0x11a56b){return db['ChatInteraction']['findOne']({'where':{'id':_0x8dec85[_0x8658('0xce')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2a6aef,null))[_0x8658('0x25')](function(_0x273129){if(_0x273129){if(_0x273129['closed']){return _0x2a6aef['status'](0x193)['json']({'status':0x193,'message':_0x8658('0xf7')});}return db[_0x8658('0xf5')]['findOne']({'where':{'id':_0x8dec85[_0x8658('0x58')][_0x8658('0xf8')]},'raw':!![]})[_0x8658('0x25')](handleEntityNotFound(_0x2a6aef,null));}})['then'](function(_0x2761a2){if(_0x2761a2){var _0x43dc41=_0x2761a2['ChatOfflineMessageId']!==null;var _0x5a28be=path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0xfb'));if(_0x43dc41){_0x5a28be=path[_0x8658('0xf9')](_0x5a28be,'offline-chat/');}var _0x2e2b78=path['join'](_0x5a28be,_0x2761a2[_0x8658('0xfc')]);return _0x2a6aef['download'](_0x2e2b78);}})[_0x8658('0x2e')](handleError(_0x2a6aef,null));};exports[_0x8658('0xfd')]=function(_0x5638db,_0x31a7f2){var _0x21cb07=null;var _0x1a0fc5=null;var _0x196ec1=null;var _0x2db9b7=null;if(_0x5638db[_0x8658('0xd1')]['id']){delete _0x5638db[_0x8658('0xd1')]['id'];}if(_0x5638db[_0x8658('0xd1')][_0x8658('0xfe')]){_0x2db9b7=path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0xff'),util['format']('transcript-%s.txt',Date[_0x8658('0x100')]()));_0x5638db['body']['pathTranscript']=_0x2db9b7;}return db[_0x8658('0x53')]['find']({'where':{'id':_0x5638db[_0x8658('0xce')]['id']},'include':[{'model':db[_0x8658('0xe8')],'as':_0x8658('0x101'),'include':[{'model':db[_0x8658('0x102')],'as':_0x8658('0x102')}]}]})[_0x8658('0x25')](handleEntityNotFound(_0x31a7f2,null))['then'](saveUpdates(_0x5638db[_0x8658('0xd1')],null))['then'](function(_0x5a1f70){if(_0x5a1f70){_0x21cb07=_0x5a1f70;return db[_0x8658('0xd6')]['find']({'where':{'id':_0x21cb07['ChatWebsiteId']}});}})[_0x8658('0x25')](function(_0x130a82){if(_0x130a82){_0x196ec1=_0x130a82;return db[_0x8658('0xeb')]['find']({'where':{'id':_0x21cb07['ContactId']}});}})['then'](function(_0xb54f42){if(_0xb54f42){_0x1a0fc5=_0xb54f42;if(_0x2db9b7){var _0x1966ca=null;for(var _0x3d57ba=0x1;_0x3d57ba<_0x21cb07[_0x8658('0x101')][_0x8658('0x5c')];++_0x3d57ba){_0x1966ca=_0x21cb07[_0x8658('0x101')][_0x3d57ba];var _0xb17147=_0x1966ca[_0x8658('0x4d')]?util['format'](_0x8658('0x103'),_0x196ec1[_0x8658('0x104')],_0x1966ca[_0x8658('0x4d')]):_0x8658('0x105');var _0x20d216=_0x5638db[_0x8658('0xd1')][_0x8658('0x106')]||util[_0x8658('0x107')](_0x8658('0x103'),_0x8658('0x108'),_0x1966ca[_0x8658('0x83')]);switch(_0x196ec1['agentIdentifier']){case _0x8658('0x109'):_0xb17147=_0x1966ca['UserId']?util[_0x8658('0x107')](_0x8658('0x103'),_0x196ec1['agentAlias'],_0x1966ca[_0x8658('0x4d')]):_0x8658('0x105');break;case _0x8658('0x10a'):_0xb17147=_0x1966ca['UserId']?_0x1966ca['User'][_0x8658('0x10b')]||_0x1966ca[_0x8658('0x102')]['fullname']:'System';break;case _0x8658('0x10c'):_0xb17147=_0x1966ca['UserId']?_0x1966ca[_0x8658('0x102')][_0x8658('0x44')]:_0x8658('0x105');break;default:_0xb17147=_0x1966ca[_0x8658('0x4d')]?util[_0x8658('0x107')](_0x8658('0x103'),_0x196ec1[_0x8658('0x104')],_0x1966ca['UserId']):_0x8658('0x105');}var _0x1c96b1=util['format'](_0x8658('0x10d'),moment(_0x1966ca['createdAt'])[_0x8658('0x107')](_0x8658('0x10e')),_0x1966ca[_0x8658('0x10f')]==='in'?_0x20d216:_0xb17147,_0x1966ca[_0x8658('0xd1')]);if(!_0x1966ca['secret']){fs[_0x8658('0x110')](_0x2db9b7,_0x1c96b1);}}return db[_0x8658('0x111')][_0x8658('0xd5')]({'where':{'service':!![]},'include':[{'model':db[_0x8658('0x112')],'as':_0x8658('0x113'),'raw':!![]}]});}}})[_0x8658('0x25')](function(_0x3215f9){if(_0x3215f9&&_0x3215f9[_0x8658('0x113')]&&_0x5638db['body']){var _0x157b37={'tls':{'rejectUnauthorized':![]}};if(_0x3215f9[_0x8658('0x113')][_0x8658('0x114')]){_0x157b37['service']=_0x3215f9['Smtp'][_0x8658('0x114')];}else{_0x157b37[_0x8658('0x115')]=_0x3215f9['Smtp'][_0x8658('0x115')];_0x157b37[_0x8658('0x116')]=_0x3215f9[_0x8658('0x113')][_0x8658('0x116')];_0x157b37[_0x8658('0x117')]=_0x3215f9[_0x8658('0x113')][_0x8658('0x117')];}if(_0x3215f9[_0x8658('0x113')][_0x8658('0x118')]){_0x157b37[_0x8658('0x119')]={'user':_0x3215f9[_0x8658('0x113')]['user'],'pass':_0x3215f9['Smtp'][_0x8658('0x11a')]};}return respondWithRpcPromise(_0x8658('0x11b'),_0x8658('0x11c'),{'account':_0x157b37,'message':{'from':util[_0x8658('0x107')]('\x22%s\x22\x20<%s>',_0x3215f9['name'],_0x3215f9[_0x8658('0xdf')]||_0x3215f9[_0x8658('0x113')][_0x8658('0xae')]),'to':_0x5638db['body']['mailTranscript'],'subject':_0x8658('0x11d'),'text':util[_0x8658('0x107')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5638db[_0x8658('0xd1')][_0x8658('0xfe')]),'attachments':[{'path':_0x2db9b7}]}})[_0x8658('0x25')](function(){return _0x21cb07;})[_0x8658('0x2e')](function(_0x2015e2){console[_0x8658('0x29')](_0x2015e2);});}else{return _0x21cb07;}})[_0x8658('0x25')](respondWithStatusCode(_0x31a7f2,0xc8))[_0x8658('0x2e')](handleError(_0x31a7f2,null));};exports[_0x8658('0x11e')]=function(_0x214d09,_0x8a5ed1,_0x229fca){return db[_0x8658('0xe8')][_0x8658('0x7a')]({'where':{'id':_0x214d09['params']['id']}})[_0x8658('0x25')](handleEntityNotFound(_0x8a5ed1,null))[_0x8658('0x25')](function(_0x4defb8){if(_0x4defb8){return _0x4defb8[_0x8658('0x11e')](_0x214d09[_0x8658('0xd1')][_0x8658('0x11f')],_[_0x8658('0x120')](_0x214d09[_0x8658('0xd1')],[_0x8658('0x11f'),'id'])||{});}})[_0x8658('0x25')](respondWithResult(_0x8a5ed1,null))[_0x8658('0x2e')](handleError(_0x8a5ed1,null));};exports['getMessages']=function(_0x5b0f20,_0xad624,_0x5478f6){var _0x3cb90f={'raw':![],'where':{}};var _0x366f9b={};var _0x44ef7e={'count':0x0,'rows':[]};return db[_0x8658('0x53')][_0x8658('0xd5')]({'where':{'id':_0x5b0f20[_0x8658('0xce')]['id']}})['then'](handleEntityNotFound(_0xad624,null))[_0x8658('0x25')](function(_0x1182cc){if(_0x1182cc){_0x366f9b[_0x8658('0x57')]=_[_0x8658('0x8b')](db[_0x8658('0xe8')]['rawAttributes']);_0x366f9b[_0x8658('0x58')]=_[_0x8658('0x8b')](_0x5b0f20[_0x8658('0x58')]);_0x366f9b['filters']=_[_0x8658('0x59')](_0x366f9b[_0x8658('0x57')],_0x366f9b['query']);_0x3cb90f['attributes']=_['intersection'](_0x366f9b[_0x8658('0x57')],qs[_0x8658('0x5a')](_0x5b0f20['query']['fields']));_0x3cb90f[_0x8658('0x5b')]=_0x3cb90f[_0x8658('0x5b')]['length']?_0x3cb90f[_0x8658('0x5b')]:_0x366f9b[_0x8658('0x57')];if(!_0x5b0f20[_0x8658('0x58')][_0x8658('0x5d')](_0x8658('0x5e'))){_0x3cb90f['limit']=qs[_0x8658('0x35')](_0x5b0f20['query'][_0x8658('0x35')]);_0x3cb90f['offset']=qs[_0x8658('0x32')](_0x5b0f20['query'][_0x8658('0x32')]);}_0x3cb90f['order']=qs[_0x8658('0x5f')](_0x5b0f20['query']['sort']);_0x3cb90f[_0x8658('0x60')]=qs[_0x8658('0x61')](_[_0x8658('0x62')](_0x5b0f20['query'],_0x366f9b['filters']));_0x3cb90f['where'][_0x8658('0xc9')]=_0x1182cc['id'];if(_0x5b0f20['query'][_0x8658('0x9a')]){_0x3cb90f[_0x8658('0x60')]=_[_0x8658('0x3e')](_0x3cb90f[_0x8658('0x60')],{'$or':_[_0x8658('0x43')](_0x3cb90f[_0x8658('0x5b')],function(_0x27a1d4){var _0x254ebb={};_0x254ebb[_0x27a1d4]={'$like':'%'+_0x5b0f20['query']['filter']+'%'};return _0x254ebb;})});}if(_0x5b0f20[_0x8658('0x58')]['$gte']){var _0x233f0f=_0x5b0f20[_0x8658('0x58')][_0x8658('0x121')][_0x8658('0x47')](',');var _0xe2319b={};_0xe2319b[_0x233f0f[0x0]]={'$gte':moment(_0x233f0f[0x1])[_0x8658('0x107')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3cb90f['where']=_[_0x8658('0x3e')](_0x3cb90f[_0x8658('0x60')],_0xe2319b);}_0x3cb90f=_[_0x8658('0x3e')]({},_0x3cb90f,_0x5b0f20['options']);return db[_0x8658('0xe8')][_0x8658('0x34')]({'where':_0x3cb90f['where']})[_0x8658('0x25')](function(_0x43f610){_0x44ef7e['count']=_0x43f610;if(_0x5b0f20[_0x8658('0x58')][_0x8658('0xcf')]){_0x3cb90f[_0x8658('0x122')]=[{'all':!![]}];}return db['ChatMessage'][_0x8658('0x123')](_0x3cb90f);})['then'](function(_0x5901d9){_0x44ef7e['rows']=_0x5901d9;return _0x44ef7e;});}})['then'](respondWithFilteredResult(_0xad624,_0x3cb90f))['catch'](handleError(_0xad624,null));};exports[_0x8658('0x124')]=function(_0x1a3325,_0x7da060,_0x43c496){var _0x329b3b={'where':{}},_0xc50fdd={},_0x52b3fd={'count':0x0,'rows':[]};return db[_0x8658('0x53')][_0x8658('0xd5')]({'where':{'id':_0x1a3325[_0x8658('0xce')]['id']}})[_0x8658('0x25')](handleEntityNotFound(_0x7da060,null))[_0x8658('0x25')](function(_0x3cd027){if(_0x3cd027){_0xc50fdd[_0x8658('0x57')]=_['keys'](db[_0x8658('0xe8')][_0x8658('0x54')]);_0xc50fdd[_0x8658('0x58')]=_['keys'](_0x1a3325['query']);_0xc50fdd[_0x8658('0x61')]=_[_0x8658('0x59')](_0xc50fdd[_0x8658('0x57')],_0xc50fdd[_0x8658('0x58')]);_0x329b3b[_0x8658('0x5b')]=_[_0x8658('0x59')](_0xc50fdd['model'],qs[_0x8658('0x5a')](_0x1a3325[_0x8658('0x58')]['fields']));_0x329b3b[_0x8658('0x5b')]=_0x329b3b[_0x8658('0x5b')]['length']?_0x329b3b[_0x8658('0x5b')]:_0xc50fdd['model'];if(!_0x1a3325['query']['hasOwnProperty'](_0x8658('0x5e'))){_0x329b3b['limit']=qs[_0x8658('0x35')](_0x1a3325['query'][_0x8658('0x35')]);_0x329b3b[_0x8658('0x32')]=qs[_0x8658('0x32')](_0x1a3325['query'][_0x8658('0x32')]);}_0x329b3b['order']=qs[_0x8658('0x5f')](_0x1a3325[_0x8658('0x58')][_0x8658('0x5f')]);_0x329b3b[_0x8658('0x60')]=qs[_0x8658('0x61')](_[_0x8658('0x62')](_0x1a3325[_0x8658('0x58')],_0xc50fdd['filters']));_0x329b3b[_0x8658('0x60')][_0x8658('0xc9')]=_0x3cd027['id'];if(_0x1a3325['query']['filter']){_0x329b3b[_0x8658('0x60')]=_[_0x8658('0x3e')](_0x329b3b[_0x8658('0x60')],{'$or':_[_0x8658('0x43')](_0x329b3b[_0x8658('0x5b')],function(_0x279e8d){var _0x3ed303={};_0x3ed303[_0x279e8d]={'$like':'%'+_0x1a3325[_0x8658('0x58')][_0x8658('0x9a')]+'%'};return _0x3ed303;})});}_0x329b3b['where']['secret']=![];if(_0x1a3325[_0x8658('0x58')]['id']){_0x329b3b['where']['id']={'$gt':_0x1a3325[_0x8658('0x58')]['id']};}_0x329b3b=_[_0x8658('0x3e')]({},_0x329b3b,_0x1a3325['options']);return db[_0x8658('0xe8')][_0x8658('0x34')]({'where':_0x329b3b[_0x8658('0x60')]})[_0x8658('0x25')](function(_0xcfec07){_0x52b3fd['count']=_0xcfec07;_0x329b3b[_0x8658('0x122')]=[];if(_0x1a3325['query'][_0x8658('0x125')]){_0x329b3b[_0x8658('0x122')][_0x8658('0xca')]({'model':db[_0x8658('0x102')],'as':'User','attributes':['id',_0x8658('0x44'),_0x8658('0x10b')]});}if(_0x1a3325['query'][_0x8658('0xcf')]){_0x329b3b[_0x8658('0x122')]=[{'all':!![]}];}return db[_0x8658('0xe8')][_0x8658('0x123')](_0x329b3b);})[_0x8658('0x25')](function(_0x1082f7){_0x52b3fd[_0x8658('0xcc')]=_0x1082f7;return _0x52b3fd;});}})[_0x8658('0x25')](respondWithFilteredResult(_0x7da060,_0x329b3b))[_0x8658('0x2e')](handleError(_0x7da060,null));};exports['addTags']=function(_0x37e313,_0x5a401e,_0x14bfa9){return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0x37e313[_0x8658('0xce')]['id']}})['then'](handleEntityNotFound(_0x5a401e,null))[_0x8658('0x25')](function(_0x416fc8){if(_0x416fc8){return _0x416fc8[_0x8658('0x126')](_0x37e313[_0x8658('0xd1')]['ids'],_[_0x8658('0x120')](_0x37e313[_0x8658('0xd1')],['ids','id'])||{})['spread'](function(){return db[_0x8658('0x127')]['findAll']({'attributes':['id','name',_0x8658('0x128')],'where':{'id':_0x37e313['body'][_0x8658('0x11f')]}});})[_0x8658('0x25')](function(_0x4a8157){socket[_0x8658('0x129')](_0x8658('0x12a'),{'id':Number(_0x37e313[_0x8658('0xce')]['id']),'tags':_0x4a8157||[]});return{'id':Number(_0x37e313[_0x8658('0xce')]['id']),'tags':_0x4a8157||[]};});}})['then'](respondWithResult(_0x5a401e,null))[_0x8658('0x2e')](handleError(_0x5a401e,null));};exports[_0x8658('0x12b')]=function(_0x56ea6a,_0x487f36,_0x4db015){return db['ChatInteraction'][_0x8658('0x7a')]({'where':{'id':_0x56ea6a['params']['id']}})['then'](handleEntityNotFound(_0x487f36,null))[_0x8658('0x25')](function(_0x241c98){if(_0x241c98){return _0x241c98[_0x8658('0x12b')](_0x56ea6a[_0x8658('0x58')][_0x8658('0x11f')]);}})['then'](respondWithStatusCode(_0x487f36,null))[_0x8658('0x2e')](handleError(_0x487f36,null));};exports[_0x8658('0x12c')]=function(_0x1d1d04,_0x464e5c){var _0x14d327=moment()['unix']()[_0x8658('0xb4')]();var _0x403e14=path[_0x8658('0xf9')](config['root'],_0x8658('0x12d'),_0x8658('0x12e'),'tmp');var _0x4abe8b=path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0x12d'),_0x8658('0x12e'),'attachments');var _0x2ab7f7=path[_0x8658('0xf9')](_0x403e14,_0x14d327);var _0x310300=util[_0x8658('0x107')](_0x8658('0x12f'),_0x1d1d04[_0x8658('0xce')]['id'],_0x14d327);var _0xd10136=path[_0x8658('0xf9')](_0x403e14,_0x310300);var _0x22d652=[];_0x22d652[_0x8658('0xca')]({'model':db[_0x8658('0x102')],'as':'User','attributes':['id',_0x8658('0x44')],'raw':!![]});_0x22d652[_0x8658('0xca')]({'model':db[_0x8658('0xeb')],'as':_0x8658('0x7f'),'attributes':['id',_0x8658('0x130'),_0x8658('0x131')],'raw':!![]});if(_0x1d1d04[_0x8658('0x58')]['attachments']){_0x22d652['push']({'model':db[_0x8658('0xf5')],'as':_0x8658('0xf5'),'raw':!![]});}var _0x483631=[{'model':db[_0x8658('0xe8')],'as':_0x8658('0x101'),'attributes':['id',_0x8658('0xd1'),'createdAt','direction',_0x8658('0x132'),_0x8658('0x96')],'include':_0x22d652}];_0x483631[_0x8658('0xca')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x8658('0x3c')]});_0x483631[_0x8658('0xca')]({'model':db['User'],'as':_0x8658('0x133'),'attributes':['id',_0x8658('0x44')]});return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0x1d1d04[_0x8658('0xce')]['id']},'include':_0x483631})[_0x8658('0x25')](handleEntityNotFound(_0x464e5c,null))['then'](function(_0xcf61ec){if(_0xcf61ec){var _0x437383=_0xcf61ec[_0x8658('0x134')]({'plain':!![]});fs[_0x8658('0x135')](_0x2ab7f7);var _0x53bb1d={'channel':_0x8658('0x136'),'account':_0x437383[_0x8658('0x137')][_0x8658('0x3c')],'agent':_0x437383[_0x8658('0x133')]?_0x437383[_0x8658('0x133')][_0x8658('0x44')]:_0x8658('0x138'),'createdAt':moment(_0x437383[_0x8658('0x90')])[_0x8658('0x107')](_0x8658('0x139'))[_0x8658('0xb4')](),'closedAt':_0x437383[_0x8658('0x4f')]?moment(_0x437383[_0x8658('0x13a')])[_0x8658('0x107')](_0x8658('0x139'))[_0x8658('0xb4')]():'','disposition':_0x437383[_0x8658('0x50')],'chatInfo':{'browser':_0x437383[_0x8658('0x13b')],'os':_0x437383[_0x8658('0x13c')],'referer':_0x437383[_0x8658('0x13d')],'customerIp':_0x437383[_0x8658('0x13e')],'customerPort':_0x437383[_0x8658('0x13f')]?_0x437383[_0x8658('0x13f')]:_0x8658('0x138')},'messages':_(_0x437383[_0x8658('0x101')])[_0x8658('0x140')]()['filter']({'secret':![]})[_0x8658('0x43')](function(_0x3d7f10){if(_0x3d7f10[_0x8658('0xf5')]){var _0x40ae0f=path[_0x8658('0xf9')](_0x4abe8b,_0x3d7f10[_0x8658('0xf5')][_0x8658('0xfc')]);if(fs['existsSync'](_0x40ae0f)){fs[_0x8658('0x141')](_0x40ae0f)['pipe'](fs[_0x8658('0x142')](path[_0x8658('0xf9')](_0x2ab7f7,_0x3d7f10[_0x8658('0xf5')][_0x8658('0xfc')])));}}return{'date':moment(_0x3d7f10[_0x8658('0x90')])[_0x8658('0x107')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8658('0xb4')](),'sender':_0x3d7f10[_0x8658('0x10f')]==='out'?_0x3d7f10['User']?_0x3d7f10[_0x8658('0x102')][_0x8658('0x44')]:_0x8658('0x105'):_0x3d7f10['Contact'][_0x8658('0x130')]+(_0x3d7f10['Contact'][_0x8658('0x131')]?'\x20'+_0x3d7f10[_0x8658('0x7f')]['lastName']:''),'body':_0x3d7f10[_0x8658('0xf5')]?_0x3d7f10[_0x8658('0xf5')][_0x8658('0xfc')]:_0x3d7f10[_0x8658('0xd1')],'direction':_0x3d7f10[_0x8658('0x10f')]==='out'?'A':'C','secret':_0x3d7f10[_0x8658('0x132')],'read':_0x3d7f10[_0x8658('0x96')],'attachment':_0x3d7f10['Attachment']};})[_0x8658('0x7c')]()};return ejs['renderFile'](path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0x12d'),'views',_0x8658('0x143')),{'interaction':_0x53bb1d})[_0x8658('0x25')](function(_0x1ae3bf){var _0x3b3bfc=path[_0x8658('0xf9')](_0x2ab7f7,_0x8658('0x144')+_0x437383['id']+'-'+_0x14d327+_0x8658('0x145'));var _0x4d1045={'path':_0x3b3bfc,'channel':_0x8658('0x136'),'interactionId':_0x437383['id']};return pdf[_0x8658('0x146')](_0x1ae3bf,_0x4d1045);})[_0x8658('0x25')](function(){return new BPromise(function(_0x4cb7b8,_0x207e06){zipdir(_0x2ab7f7,{'saveTo':_0xd10136},function(_0x3a3727,_0xc32bdf){if(_0x3a3727)return _0x207e06(_0x3a3727);return _0x4cb7b8(_0xc32bdf);});})[_0x8658('0x25')](function(){return new BPromise(function(_0xbdf497,_0x5062dd){rimraf(_0x2ab7f7,function(_0x585566){if(_0x585566)_0x5062dd(_0x585566);return _0xbdf497();});});})[_0x8658('0x25')](function(){return _0x464e5c[_0x8658('0x12c')](_0xd10136,_0x310300,function(_0x8993c6){if(_0x8993c6){console[_0x8658('0x147')]('err',_0x8993c6);}else{fs['unlinkSync'](_0xd10136);}});});});}else{return _0x464e5c[_0x8658('0x2f')](0xc8);}})[_0x8658('0x2e')](handleError(_0x464e5c,null));}; \ No newline at end of file +var _0x9f02=['isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','customer','agentIdentifier','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','secret','includeAgent','setTags','omit','spread','emit','chatInteractionTags:save','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','Account','Owner','get','Chat','N.A.','browserName','osName','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','render','contact','agent','account','fullname','TagIds','Tags','split','push','waiting','talking','answered','abandoned','total','UserId','closed','disposition','unmanaged','map','ChatInteraction','rawAttributes','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','filters','color','tools_tags','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','ChatWebsiteId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','user','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','includeAll','include','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x9f02,0x6b));var _0x29f0=function(_0x31cf21,_0x1916a7){_0x31cf21=_0x31cf21-0x0;var _0x4c73bd=_0x9f02[_0x31cf21];return _0x4c73bd;};'use strict';var emlformat=require(_0x29f0('0x0'));var rimraf=require(_0x29f0('0x1'));var zipdir=require(_0x29f0('0x2'));var jsonpatch=require(_0x29f0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x29f0('0x4'));var Mustache=require('mustache');var util=require(_0x29f0('0x5'));var path=require(_0x29f0('0x6'));var sox=require(_0x29f0('0x7'));var csv=require(_0x29f0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f0('0x9'));var _=require(_0x29f0('0xa'));var squel=require(_0x29f0('0xb'));var crypto=require(_0x29f0('0xc'));var jsforce=require(_0x29f0('0xd'));var deskjs=require(_0x29f0('0xe'));var toCsv=require(_0x29f0('0x8'));var querystring=require(_0x29f0('0xf'));var Papa=require(_0x29f0('0x10'));var Redis=require(_0x29f0('0x11'));var authService=require(_0x29f0('0x12'));var qs=require(_0x29f0('0x13'));var as=require(_0x29f0('0x14'));var pdf=require(_0x29f0('0x15'));var hardwareService=require(_0x29f0('0x16'));var logger=require('../../config/logger')(_0x29f0('0x17'));var utils=require('../../config/utils');var config=require(_0x29f0('0x18'));var licenseUtil=require(_0x29f0('0x19'));var db=require(_0x29f0('0x1a'))['db'];config['redis']=_[_0x29f0('0x1b')](config['redis'],{'host':_0x29f0('0x1c'),'port':0x18eb});var socket=require(_0x29f0('0x1d'))(new Redis(config[_0x29f0('0x1e')]));require(_0x29f0('0x1f'))[_0x29f0('0x20')](socket);var jayson=require(_0x29f0('0x21'));var client=jayson[_0x29f0('0x22')][_0x29f0('0x23')]({'port':0x232b});var client9004=jayson[_0x29f0('0x22')][_0x29f0('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x13680f,_0x492f23,_0x29dd7d,_0x2cf752){return new BPromise(function(_0x3ed5ba,_0x38b467){var _0x2d4ccc=_0x2cf752||client;return _0x2d4ccc[_0x29f0('0x24')](_0x13680f,_0x29dd7d)[_0x29f0('0x25')](function(_0x204652){logger[_0x29f0('0x26')](_0x29f0('0x27'),_0x492f23,_0x29f0('0x28'));logger['debug'](_0x29f0('0x29'),_0x492f23,'request\x20sent',JSON['stringify'](_0x204652));if(_0x204652['error']){if(_0x204652[_0x29f0('0x2a')]['code']===0x1f4){logger['error'](_0x29f0('0x27'),_0x492f23,_0x204652['error'][_0x29f0('0x2b')]);return _0x38b467(_0x204652[_0x29f0('0x2a')]['message']);}logger[_0x29f0('0x2a')](_0x29f0('0x27'),_0x492f23,_0x204652[_0x29f0('0x2a')][_0x29f0('0x2b')]);return _0x3ed5ba(_0x204652[_0x29f0('0x2a')][_0x29f0('0x2b')]);}else{logger[_0x29f0('0x26')](_0x29f0('0x27'),_0x492f23,_0x29f0('0x28'));_0x3ed5ba(_0x204652[_0x29f0('0x2c')][_0x29f0('0x2b')]);}})[_0x29f0('0x2d')](function(_0x12b342){logger[_0x29f0('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x492f23,_0x12b342);_0x38b467(_0x12b342);});});}function respondWithStatusCode(_0x26b767,_0x3bf2be){_0x3bf2be=_0x3bf2be||0xcc;return function(_0x21aeac){if(_0x21aeac){return _0x26b767[_0x29f0('0x2e')](_0x3bf2be);}return _0x26b767['status'](_0x3bf2be)[_0x29f0('0x2f')]();};}function respondWithResult(_0x244dd7,_0x5936fb){_0x5936fb=_0x5936fb||0xc8;return function(_0xbb312c){if(_0xbb312c){return _0x244dd7[_0x29f0('0x30')](_0x5936fb)[_0x29f0('0x31')](_0xbb312c);}};}function respondWithFilteredResult(_0x4e06ba,_0x33c4a2){return function(_0x154b04){if(_0x154b04){var _0x8bca7c=typeof _0x33c4a2[_0x29f0('0x32')]===_0x29f0('0x33')&&typeof _0x33c4a2[_0x29f0('0x34')]==='undefined';var _0x471711=_0x154b04[_0x29f0('0x35')];var _0x42182b=_0x8bca7c?0x0:_0x33c4a2['offset'];var _0x5ee38c=_0x8bca7c?_0x154b04[_0x29f0('0x35')]:_0x33c4a2['offset']+_0x33c4a2[_0x29f0('0x34')];var _0x518dbc;if(_0x5ee38c>=_0x471711){_0x5ee38c=_0x471711;_0x518dbc=0xc8;}else{_0x518dbc=0xce;}_0x4e06ba[_0x29f0('0x30')](_0x518dbc);return _0x4e06ba[_0x29f0('0x36')](_0x29f0('0x37'),_0x42182b+'-'+_0x5ee38c+'/'+_0x471711)['json'](_0x154b04);}return null;};}function patchUpdates(_0xb75d32){return function(_0x344b0a){try{jsonpatch['apply'](_0x344b0a,_0xb75d32,!![]);}catch(_0xb4b1db){return BPromise[_0x29f0('0x38')](_0xb4b1db);}return _0x344b0a[_0x29f0('0x39')]();};}function saveUpdates(_0x16880a,_0x519b96){return function(_0x23fba8){if(_0x23fba8){return _0x23fba8[_0x29f0('0x3a')](_0x16880a)[_0x29f0('0x25')](function(_0x5666c2){return _0x5666c2;});}return null;};}function removeEntity(_0x2a26e7,_0x5db8ca){return function(_0x1964d3){if(_0x1964d3){return _0x1964d3[_0x29f0('0x3b')]()[_0x29f0('0x25')](function(){_0x2a26e7['status'](0xcc)[_0x29f0('0x2f')]();});}};}function handleEntityNotFound(_0x444854,_0x30dea1){return function(_0x3bf58b){if(!_0x3bf58b){_0x444854[_0x29f0('0x2e')](0x194);}return _0x3bf58b;};}function handleError(_0x4ad186,_0x362969){_0x362969=_0x362969||0x1f4;return function(_0x5decd5){logger['error'](_0x5decd5[_0x29f0('0x3c')]);if(_0x5decd5[_0x29f0('0x3d')]){delete _0x5decd5[_0x29f0('0x3d')];}_0x4ad186[_0x29f0('0x30')](_0x362969)[_0x29f0('0x3e')](_0x5decd5);};}function getMustacheRender(_0x3628f9,_0x228c30){return Mustache[_0x29f0('0x3f')](_0x3628f9,_['merge'](_0x228c30['body'],{'contact':_0x228c30[_0x29f0('0x40')],'message':_0x228c30['message'],'agent':_0x228c30[_0x29f0('0x41')],'interaction':_0x228c30['interaction'],'account':_0x228c30[_0x29f0('0x42')]}))||'';}function getInteractionUsers(_0x1e9fbd,_0x46aaac){return new BPromise(function(_0x2b07d9,_0x921e98){try{if(_0x46aaac[_0x1e9fbd['id']]){_0x1e9fbd['Users']=_['map'](_0x46aaac[_0x1e9fbd['id']],function(_0x198f71){return{'id':_0x198f71['id'],'fullname':_0x198f71[_0x29f0('0x43')]};});}}catch(_0x2a04d4){_0x921e98(_0x2a04d4);}_0x2b07d9(_0x1e9fbd);});}function getInteractionTags(_0x417e64,_0x284dec){return new BPromise(function(_0xdc83df,_0x2df5e7){try{if(_0x417e64[_0x29f0('0x44')]){_0x417e64[_0x29f0('0x45')]=[];_0x417e64[_0x29f0('0x44')][_0x29f0('0x46')](',')['forEach'](function(_0x215d5d){_0x417e64[_0x29f0('0x45')][_0x29f0('0x47')](_0x284dec[_0x215d5d]);});}delete _0x417e64[_0x29f0('0x44')];}catch(_0x1d9697){_0x2df5e7(_0x1d9697);}_0xdc83df(_0x417e64);});}function updateChatInteraction(_0x7fd8b2,_0x11c873,_0x394680){return new BPromise(function(_0x35a623,_0x15aeeb){return getInteractionUsers(_0x7fd8b2,_0x394680)[_0x29f0('0x25')](function(_0x3f880f){return getInteractionTags(_0x3f880f,_0x11c873);})[_0x29f0('0x25')](function(_0x586fa4){return getStateInteraction(_0x586fa4);})[_0x29f0('0x25')](function(_0x4016e3){_0x35a623(_0x4016e3);})['catch'](function(_0x3f98b9){_0x15aeeb(_0x3f98b9);});});}function getStateInteraction(_0x500e97){return new BPromise(function(_0x49cd20){_0x500e97[_0x29f0('0x48')]=0x0;_0x500e97[_0x29f0('0x49')]=0x0;_0x500e97[_0x29f0('0x4a')]=0x0;_0x500e97['unmanaged']=0x0;_0x500e97[_0x29f0('0x4b')]=0x0;_0x500e97[_0x29f0('0x4c')]=0x0;if(!_0x500e97['closed']&&!_0x500e97[_0x29f0('0x4d')]){_0x500e97[_0x29f0('0x48')]+=0x1;}if(!_0x500e97[_0x29f0('0x4e')]&&_0x500e97[_0x29f0('0x4d')]){_0x500e97['talking']+=0x1;if(_0x500e97[_0x29f0('0x48')]){_0x500e97[_0x29f0('0x48')]-=0x1;}}if(_0x500e97[_0x29f0('0x4e')]&&_0x500e97[_0x29f0('0x4f')]==='abandoned'){_0x500e97[_0x29f0('0x4b')]+=0x1;if(_0x500e97[_0x29f0('0x48')]){_0x500e97[_0x29f0('0x48')]-=0x1;}}else if(_0x500e97['closed']&&!_0x500e97[_0x29f0('0x4d')]&&_0x500e97['disposition']){_0x500e97[_0x29f0('0x50')]+=0x1;if(_0x500e97['waiting']){_0x500e97[_0x29f0('0x48')]-=0x1;}}else if(_0x500e97[_0x29f0('0x4e')]&&_0x500e97['UserId']){_0x500e97[_0x29f0('0x4a')]+=0x1;if(_0x500e97['talking']){_0x500e97[_0x29f0('0x49')]-=0x1;}}_0x500e97[_0x29f0('0x4c')]+=0x1;_0x49cd20(_0x500e97);});}exports['index']=function(_0x13f457,_0x189811){var _0x22687c={},_0x3ba889={},_0x2108f5={'count':0x0,'rows':[]};var _0x8f7db8=_[_0x29f0('0x51')](db[_0x29f0('0x52')][_0x29f0('0x53')],function(_0x191b9c){return{'name':_0x191b9c['fieldName'],'type':_0x191b9c[_0x29f0('0x54')][_0x29f0('0x55')]};});_0x3ba889['model']=_[_0x29f0('0x51')](_0x8f7db8,'name');_0x3ba889[_0x29f0('0x56')]=_[_0x29f0('0x57')](_0x13f457[_0x29f0('0x56')]);_0x3ba889['filters']=_['intersection'](_0x3ba889['model'],_0x3ba889[_0x29f0('0x56')]);_0x22687c[_0x29f0('0x58')]=_[_0x29f0('0x59')](_0x3ba889[_0x29f0('0x5a')],qs[_0x29f0('0x5b')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x5b')]));_0x22687c['attributes']=_0x22687c['attributes'][_0x29f0('0x5c')]?_0x22687c[_0x29f0('0x58')]:_0x3ba889[_0x29f0('0x5a')];if(!_0x13f457[_0x29f0('0x56')][_0x29f0('0x5d')]('nolimit')){_0x22687c[_0x29f0('0x34')]=qs[_0x29f0('0x34')](_0x13f457['query']['limit']);_0x22687c[_0x29f0('0x32')]=qs[_0x29f0('0x32')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x32')]);}_0x22687c[_0x29f0('0x5e')]=qs[_0x29f0('0x5f')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x5f')]);_0x22687c[_0x29f0('0x60')]=qs[_0x29f0('0x61')](_['pick'](_0x13f457[_0x29f0('0x56')],_0x3ba889[_0x29f0('0x61')]),_0x8f7db8);var _0x3f62b8=[];var _0x15ee00=squel['select']()['field']('id')['field'](_0x29f0('0x3d'))['field'](_0x29f0('0x62'))['from'](_0x29f0('0x63'));var _0x29d943=squel[_0x29f0('0x64')]()[_0x29f0('0x65')](_0x29f0('0x66'))[_0x29f0('0x65')](_0x29f0('0x67'))[_0x29f0('0x65')](_0x29f0('0x68'))[_0x29f0('0x69')](_0x29f0('0x6a'),'ui')[_0x29f0('0x6b')](_0x29f0('0x6c'),'u',_0x29f0('0x6d'));var _0x584246=squel['select']()[_0x29f0('0x69')]('chat_interactions','i')[_0x29f0('0x6b')](_0x29f0('0x6e'),'c',_0x29f0('0x6f'))[_0x29f0('0x6b')](_0x29f0('0x6c'),'o',_0x29f0('0x70'))[_0x29f0('0x6b')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x29f0('0x6b')](_0x29f0('0x71'),'me',_0x29f0('0x72'))[_0x29f0('0x6b')]('chat_interaction_has_tags','it',_0x29f0('0x73'))[_0x29f0('0x6b')]('tools_tags','t',_0x29f0('0x74'));var _0x5201e5=squel[_0x29f0('0x75')]();var _0x5cfe35=[];var _0x2f73fd=squel[_0x29f0('0x75')]();var _0x30e2ac;if(_0x13f457[_0x29f0('0x56')]['search']){_0x30e2ac=as[_0x29f0('0x76')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x77')]);var _0x19aa01=_0x30e2ac[_0x29f0('0x78')];for(var _0x4a5f0e=0x0;_0x4a5f0e<_0x30e2ac['conditions'][_0x29f0('0x5c')];_0x4a5f0e++){var _0x86e9d3=_0x30e2ac[_0x29f0('0x79')][_0x4a5f0e];var _0x4c7c6a='i';var _0x4a0e86=_['find'](_0x8f7db8,[_0x29f0('0x3d'),_0x86e9d3[_0x29f0('0x65')]]);if(!_0x4a0e86){switch(_0x86e9d3['field']){case _0x29f0('0x7a'):if(_0x86e9d3[_0x29f0('0x7b')]==0x1){_0x584246[_0x29f0('0x7c')]('`'+_0x86e9d3[_0x29f0('0x65')]+'`\x20=\x200');}else{_0x584246['having']('`'+_0x86e9d3[_0x29f0('0x65')]+'`\x20>\x200');}break;case _0x29f0('0x7d'):if(_0x86e9d3[_0x29f0('0x7e')]===_0x29f0('0x7f')){if(_0x86e9d3['value'][_0x29f0('0x46')]('\x20')[_0x29f0('0x5c')]>0x1){_0x5201e5[_0x19aa01](_0x29f0('0x80'),qs['getFullTextValue'](_0x86e9d3['value']),null);}else{var _0x63e497='%'+_0x86e9d3[_0x29f0('0x7b')]+'%';_0x5201e5[_0x19aa01]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x63e497,_0x63e497,_0x63e497);}}else{_0x4a0e86=_[_0x29f0('0x81')](_0x8f7db8,[_0x29f0('0x3d'),_0x29f0('0x82')]);_0x86e9d3['field']=_0x29f0('0x82');_0x24b8c2=as[_0x29f0('0x83')](_0x4c7c6a,_0x4a0e86[_0x29f0('0x54')],_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2[_0x29f0('0x84')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x85')],_0x24b8c2['value'][_0x29f0('0x2f')]);}break;case _0x29f0('0x86'):var _0x59c4c9=_0x86e9d3['value'][_0x29f0('0x46')](',')[_0x29f0('0x51')](function(_0x53a7f1){return Number(_0x53a7f1);});_0x59c4c9[_0x29f0('0x87')](function(_0x43e277){_0x2f73fd['or'](_0x29f0('0x88'),'%,'+_0x43e277+',%');});_0x5cfe35=_[_0x29f0('0x89')](_0x5cfe35,_0x59c4c9);break;case'User':if(_0x86e9d3[_0x29f0('0x7e')]==='$substring'){_0x5201e5[_0x19aa01](_0x29f0('0x8a'),'%'+_0x86e9d3[_0x29f0('0x7b')]+'%',null);}else{_0x4a0e86=_['find'](_0x8f7db8,['name',_0x29f0('0x4d')]);_0x86e9d3[_0x29f0('0x65')]='UserId';_0x24b8c2=as[_0x29f0('0x83')](_0x4c7c6a,_0x4a0e86['type'],_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2[_0x29f0('0x84')],_0x24b8c2['value']['start'],_0x24b8c2['value'][_0x29f0('0x2f')]);}break;case _0x29f0('0x8b'):_0x24b8c2=as['buildExpression']('me',null,_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2[_0x29f0('0x84')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x85')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x2f')]);break;}}else{var _0x24b8c2=as[_0x29f0('0x83')](_0x4c7c6a,_0x4a0e86[_0x29f0('0x54')],_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2['text'],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x85')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x2f')]);}}}else{var _0x18cc91=_(_0x13f457[_0x29f0('0x56')])[_0x29f0('0x57')]()[_0x29f0('0x51')](function(_0x46c7b3){return _['some'](_0x8f7db8,['name',_0x46c7b3])?_0x46c7b3:undefined;})[_0x29f0('0x8c')]()[_0x29f0('0x7b')]();if(!_['isEmpty'](_0x18cc91)){_0x18cc91['forEach'](function(_0x55849d){if(_0x55849d===_0x29f0('0x8d')){_0x584246[_0x29f0('0x60')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x13f457['query'][_0x55849d]));}else if(_0x55849d===_0x29f0('0x8e')){var _0x1b03b1=JSON[_0x29f0('0x8f')](_0x13f457[_0x29f0('0x56')][_0x55849d])['$gte'];var _0x455806=JSON['parse'](_0x13f457[_0x29f0('0x56')][_0x55849d])[_0x29f0('0x90')];_0x584246[_0x29f0('0x60')](_0x29f0('0x91'),_0x1b03b1,_0x455806);}else{if(_0x13f457[_0x29f0('0x56')][_0x55849d]===_0x29f0('0x92')){_0x584246['where']('i.'+_0x55849d+_0x29f0('0x93'));}else{_0x584246[_0x29f0('0x60')]('i.'+_0x55849d+'\x20=\x20?',_0x13f457[_0x29f0('0x56')][_0x55849d]);}}});}if(_0x13f457['query'][_0x29f0('0x94')]){if(_0x13f457[_0x29f0('0x56')][_0x29f0('0x94')]==0x1){_0x584246[_0x29f0('0x7c')](_0x29f0('0x95'));}else{_0x584246[_0x29f0('0x7c')](_0x29f0('0x96'));}}if(_0x13f457[_0x29f0('0x56')][_0x29f0('0x97')]){_0x5cfe35=_[_0x29f0('0x98')](_0x13f457[_0x29f0('0x56')]['tag'])?_0x13f457['query']['tag']:new Array(_0x13f457[_0x29f0('0x56')][_0x29f0('0x97')]);_0x5cfe35[_0x29f0('0x87')](function(_0x298dbc){_0x2f73fd['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298dbc+',%');});}if(_0x13f457[_0x29f0('0x56')]['filter']){var _0x40aa05=_0x13f457['query'][_0x29f0('0x99')][_0x29f0('0x9a')]('\x5c','\x5c\x5c')[_0x29f0('0x9a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x40aa05)){_0x5201e5['or'](_0x29f0('0x9b'),_0x40aa05+'%');}else{_0x5201e5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x40aa05))['or'](_0x29f0('0x9c'),_0x40aa05+'%');}}}_0x584246[_0x29f0('0x60')](_0x5201e5);_0x584246[_0x29f0('0x9d')](_0x29f0('0x9e'));var _0x1a5a42={'type':db[_0x29f0('0x9f')][_0x29f0('0xa0')][_0x29f0('0xa1')],'raw':!![]};var _0x147ee3=_0x584246[_0x29f0('0xa2')]();_0x147ee3[_0x29f0('0x65')](_0x29f0('0x9e'));_0x147ee3['field'](_0x29f0('0xa3'),_0x29f0('0x7a'));if(_0x22687c[_0x29f0('0x5e')]){_0x22687c[_0x29f0('0x5e')][_0x29f0('0x87')](function(_0x6b2677){var _0x4ed9ea=_0x6b2677[0x0]==='contactName'?_0x6b2677[0x0]:'i.'+_0x6b2677[0x0];_0x584246['order'](_0x4ed9ea,_0x6b2677[0x1]==='DESC'?![]:!![]);});}if(!_[_0x29f0('0xa4')](_0x5cfe35)){_0x584246['having'](_0x2f73fd);_0x147ee3['where'](_0x29f0('0xa5'),_0x5cfe35);}BPromise[_0x29f0('0xa6')]()[_0x29f0('0x25')](function(){if(!_0x30e2ac){if(_0x13f457['query'][_0x29f0('0x8d')])return;_0x147ee3[_0x29f0('0x60')](_0x29f0('0xa7'));_0x584246[_0x29f0('0x60')](_0x29f0('0xa7'));return;}if(_0x13f457['user'][_0x29f0('0xa8')]!=='agent')return;return _0x13f457['user'][_0x29f0('0xa9')]({'attributes':['id'],'raw':!![]})[_0x29f0('0x25')](function(_0x3c454c){if(_[_0x29f0('0xa4')](_0x3c454c)){_0x147ee3[_0x29f0('0x60')](_0x29f0('0xaa'));_0x584246[_0x29f0('0x60')](_0x29f0('0xaa'));}else{_0x147ee3[_0x29f0('0x60')](_0x29f0('0xab'),_[_0x29f0('0x51')](_0x3c454c,'id'));_0x584246[_0x29f0('0x60')](_0x29f0('0xab'),_[_0x29f0('0x51')](_0x3c454c,'id'));}});})[_0x29f0('0x25')](function(){if(_0x13f457[_0x29f0('0xac')][_0x29f0('0xa8')]===_0x29f0('0x41')&&!_0x30e2ac&&!_0x13f457[_0x29f0('0x56')][_0x29f0('0x8d')])return[];return db[_0x29f0('0xad')][_0x29f0('0x56')](_0x147ee3[_0x29f0('0xae')](),_0x1a5a42);})[_0x29f0('0x25')](function(_0x2b48b4){_0x2108f5[_0x29f0('0x35')]=_0x2b48b4['length'];if(_0x2108f5[_0x29f0('0x35')]===0x0)return[];return db[_0x29f0('0xad')][_0x29f0('0x56')](_0x15ee00[_0x29f0('0xae')](),_0x1a5a42)[_0x29f0('0x25')](function(_0x703715){_0x3f62b8=_[_0x29f0('0xaf')](_0x703715,'id');_0x1a5a42=_[_0x29f0('0xb0')](_0x1a5a42,{'model':db[_0x29f0('0x52')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13f457[_0x29f0('0x56')][_0x29f0('0x5b')]){_0x22687c[_0x29f0('0x58')][_0x29f0('0x87')](function(_0x1f353d){_0x584246['field']('i.'+_0x1f353d);});}else{_0x584246['field'](_0x29f0('0xa3'),_0x29f0('0x7a'));_0x584246[_0x29f0('0x65')](_0x29f0('0xb1'),_0x29f0('0xb2'));_0x584246[_0x29f0('0x65')]('a.mandatoryDisposition',_0x29f0('0xb3'));_0x584246['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',_0x29f0('0xb4'));_0x584246[_0x29f0('0x65')]('i.*');_0x584246[_0x29f0('0x65')]('c.firstName',_0x29f0('0xb5'));_0x584246['field']('c.lastName',_0x29f0('0xb6'));_0x584246[_0x29f0('0x65')]('c.email','Contact.email');_0x584246[_0x29f0('0x65')](_0x29f0('0xb7'),_0x29f0('0xb8'));_0x584246[_0x29f0('0x65')]('c.mobile',_0x29f0('0xb9'));_0x584246[_0x29f0('0x65')]('c.fax','Contact.fax');_0x584246[_0x29f0('0x65')](_0x29f0('0xba'),_0x29f0('0xbb'));_0x584246[_0x29f0('0x65')](_0x29f0('0xbc'),_0x29f0('0xbd'));_0x584246[_0x29f0('0x65')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29f0('0x44'));}if(_0x22687c[_0x29f0('0x34')])_0x584246[_0x29f0('0x34')](_0x22687c[_0x29f0('0x34')]);if(_0x22687c[_0x29f0('0x32')])_0x584246[_0x29f0('0x32')](_0x22687c[_0x29f0('0x32')]);return db['sequelize'][_0x29f0('0x56')](_0x584246[_0x29f0('0xae')](),_0x1a5a42);})['then'](function(_0x280d83){if(_0x280d83[_0x29f0('0x5c')]>0x0)_0x29d943['where'](_0x29f0('0xbe'),_[_0x29f0('0x51')](_0x280d83,'id'));return db['sequelize'][_0x29f0('0x56')](_0x29d943[_0x29f0('0xae')](),_0x1a5a42)['then'](function(_0x2ea2ca){var _0x3fb15d=_[_0x29f0('0xbf')](_0x2ea2ca,_0x29f0('0xc0'));var _0x1dde84=[];_0x280d83[_0x29f0('0x87')](function(_0x3d8c8a){_0x1dde84[_0x29f0('0x47')](updateChatInteraction(_0x3d8c8a,_0x3f62b8,_0x3fb15d));});return BPromise[_0x29f0('0xc1')](_0x1dde84);});});})[_0x29f0('0x25')](function(_0x4f6598){_0x2108f5[_0x29f0('0xc2')]=_0x4f6598;return _0x2108f5;})[_0x29f0('0x25')](respondWithFilteredResult(_0x189811,_0x22687c))['catch'](handleError(_0x189811,null));};exports[_0x29f0('0xc3')]=function(_0x20117d,_0x4b0d36){var _0x28805e={'raw':![],'where':{'id':_0x20117d['params']['id']}},_0x4f9e18={};_0x4f9e18[_0x29f0('0x5a')]=_[_0x29f0('0x57')](db['ChatInteraction'][_0x29f0('0x53')]);_0x4f9e18[_0x29f0('0x56')]=_['keys'](_0x20117d['query']);_0x4f9e18['filters']=_[_0x29f0('0x59')](_0x4f9e18['model'],_0x4f9e18[_0x29f0('0x56')]);_0x28805e['attributes']=_[_0x29f0('0x59')](_0x4f9e18[_0x29f0('0x5a')],qs['fields'](_0x20117d[_0x29f0('0x56')][_0x29f0('0x5b')]));_0x28805e[_0x29f0('0x58')]=_0x28805e[_0x29f0('0x58')]['length']?_0x28805e[_0x29f0('0x58')]:_0x4f9e18[_0x29f0('0x5a')];if(_0x20117d[_0x29f0('0x56')][_0x29f0('0xc4')]){_0x28805e[_0x29f0('0xc5')]=[{'all':!![]}];}_0x28805e=_[_0x29f0('0xb0')]({},_0x28805e,_0x20117d[_0x29f0('0xc6')]);return db[_0x29f0('0x52')]['find'](_0x28805e)[_0x29f0('0x25')](handleEntityNotFound(_0x4b0d36,null))['then'](respondWithResult(_0x4b0d36,null))[_0x29f0('0x2d')](handleError(_0x4b0d36,null));};exports[_0x29f0('0xc7')]=function(_0x310e02,_0x526daf){return db[_0x29f0('0x52')]['create'](_0x310e02[_0x29f0('0x8b')],{})[_0x29f0('0x25')](respondWithResult(_0x526daf,0xc9))[_0x29f0('0x2d')](handleError(_0x526daf,null));};exports[_0x29f0('0x3a')]=function(_0x38ac96,_0x28a1bb){if(_0x38ac96[_0x29f0('0x8b')]['id']){delete _0x38ac96['body']['id'];}return db[_0x29f0('0x52')]['find']({'where':{'id':_0x38ac96[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x28a1bb,null))[_0x29f0('0x25')](saveUpdates(_0x38ac96[_0x29f0('0x8b')],null))[_0x29f0('0x25')](respondWithResult(_0x28a1bb,null))[_0x29f0('0x2d')](handleError(_0x28a1bb,null));};exports[_0x29f0('0x3b')]=function(_0x15c880,_0x2d6930){return db['ChatInteraction']['find']({'where':{'id':_0x15c880[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x2d6930,null))['then'](removeEntity(_0x2d6930,null))['catch'](handleError(_0x2d6930,null));};exports[_0x29f0('0xc9')]=function(_0x2c16b9,_0x5c35c1){return db[_0x29f0('0x52')]['describe']()[_0x29f0('0x25')](respondWithResult(_0x5c35c1,null))[_0x29f0('0x2d')](handleError(_0x5c35c1,null));};exports[_0x29f0('0xca')]=function(_0x45abfa,_0x510479){var _0x30ca18=_0x45abfa['params']['id'];var _0x435f47;var _0xd582a5;var _0x5528c8;return db[_0x29f0('0x52')][_0x29f0('0xcb')]({'where':{'id':_0x30ca18}})[_0x29f0('0x25')](function(_0x18267c){_0x435f47=_0x18267c;return db[_0x29f0('0xcc')]['findOne']({'where':{'id':_0x18267c[_0x29f0('0x8d')]},'attributes':['id','vidaooApiKey',_0x29f0('0xcd'),_0x29f0('0xce'),_0x29f0('0xcf'),_0x29f0('0xd0')],'raw':!![]});})[_0x29f0('0x25')](function(_0x579153){if(_0x579153&&_0x579153[_0x29f0('0xd1')]&&_0x579153[_0x29f0('0xcd')]){_0xd582a5=_0x579153;var _0x2bdea3={'interaction':{'id':_0x30ca18},'agent':{'id':_0x45abfa[_0x29f0('0xac')]['id'],'name':_0x45abfa['user'][_0x29f0('0x3d')],'fullname':_0x45abfa['user']['fullname'],'email':_0x45abfa['user'][_0x29f0('0xd2')]},'contact':_0x45abfa[_0x29f0('0x8b')][_0x29f0('0x40')],'account':_0x45abfa[_0x29f0('0x8b')][_0x29f0('0x42')]};var _0x32bf3f={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x579153[_0x29f0('0xd1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x45abfa[_0x29f0('0xac')][_0x29f0('0xd2')]],'buttons':null,'topic':_0xd582a5['vidaooTopic'],'note':_[_0x29f0('0xd3')](_0xd582a5[_0x29f0('0xcf')])?null:getMustacheRender(_0xd582a5[_0x29f0('0xcf')],_0x2bdea3),'metadata':null},'redirect':_0x29f0('0xd4'),'json':!![]};try{if(!_['isNull'](_0xd582a5['vidaooMetadata'])){var _0x1620c3=getMustacheRender(_0xd582a5[_0x29f0('0xd0')],_0x2bdea3);var _0x3003cb=JSON[_0x29f0('0x8f')](_0x1620c3);_0x32bf3f['body']['metadata']=_0x3003cb;}}catch(_0x2ad975){throw new db[(_0x29f0('0x9f'))]['ValidationError'](_0x29f0('0xd5'));}return rp(_0x32bf3f);}else{throw new db['Sequelize'][(_0x29f0('0xd6'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x29f0('0x25')](function(_0xbe09b3){_0x5528c8=_0xbe09b3;if(_0x5528c8['id']){var _0x561877={'body':_0x5528c8[_0x29f0('0xd7')],'ChatWebsiteId':_0xd582a5['id'],'ChatInteractionId':_0x435f47['id'],'direction':_0x29f0('0xd8'),'UserId':_0x45abfa['user']['id']};return db[_0x29f0('0xd9')][_0x29f0('0xc7')](_0x561877,{});}else{throw new db[(_0x29f0('0x9f'))][(_0x29f0('0xd6'))](_0x29f0('0xda'));}})['then'](function(){return _0x435f47[_0x29f0('0xdb')]({'vidaooSessionId':_0x5528c8['id']});})[_0x29f0('0x25')](respondWithResult(_0x510479,null))['catch'](handleError(_0x510479,null));};exports['customUpdate']=function(_0x7f7baa,_0x2a8188){if(_0x7f7baa['body']['id']){delete _0x7f7baa[_0x29f0('0x8b')]['id'];}return db[_0x29f0('0x52')][_0x29f0('0x81')]({'where':{'id':_0x7f7baa[_0x29f0('0xc8')]['id']},'include':[{'model':db[_0x29f0('0xdc')],'as':_0x29f0('0x7d')}]})['then'](handleEntityNotFound(_0x2a8188,null))[_0x29f0('0x25')](saveUpdates(_0x7f7baa['body'],null))[_0x29f0('0x25')](respondWithResult(_0x2a8188,null))[_0x29f0('0x2d')](handleError(_0x2a8188,null));};exports[_0x29f0('0xdd')]=function(_0x5b5045,_0x5ba5c6,_0x3d0435){if(_0x5b5045[_0x29f0('0x8b')]['id']){delete _0x5b5045[_0x29f0('0x8b')]['id'];}return db[_0x29f0('0x52')]['find']({'where':{'id':_0x5b5045[_0x29f0('0xc8')]['id']}})['then'](function(_0x310f40){if(!_0x310f40){logger[_0x29f0('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x29f0('0xdd'),0x194,_0x29f0('0xde'));_0x5ba5c6['sendStatus'](0x194);}else{if(_0x310f40['UserId']){throw new db[(_0x29f0('0x9f'))]['ValidationError'](_0x29f0('0xdf'));}}return _0x310f40;})['then'](function(_0x42b926){if(_0x42b926){return _0x42b926[_0x29f0('0x3a')]({'closed':_0x5b5045[_0x29f0('0x8b')][_0x29f0('0x4e')],'disposition':_0x5b5045[_0x29f0('0x8b')][_0x29f0('0x4f')]})[_0x29f0('0x25')](function(_0x2ffc6d){return _0x2ffc6d;});}})[_0x29f0('0x25')](function(_0x23eb35){return respondWithRpcPromise(_0x29f0('0xe0'),_0x29f0('0xdd'),_0x5b5045[_0x29f0('0x8b')],client9004);})['then'](respondWithResult(_0x5ba5c6,null))[_0x29f0('0x2d')](handleError(_0x5ba5c6,null));};exports[_0x29f0('0xe1')]=function(_0x39de91,_0x1cceae,_0xbbba50){_0x39de91[_0x29f0('0x8b')][_0x29f0('0x3d')]=_0x39de91['file'][_0x29f0('0xe2')];_0x39de91[_0x29f0('0x8b')][_0x29f0('0xe3')]=_0x39de91[_0x29f0('0xe4')][_0x29f0('0xe5')];_0x39de91[_0x29f0('0x8b')][_0x29f0('0x54')]=_0x39de91[_0x29f0('0xe4')][_0x29f0('0xe6')];return db[_0x29f0('0xe7')][_0x29f0('0xc7')](_0x39de91[_0x29f0('0x8b')])[_0x29f0('0x25')](respondWithResult(_0x1cceae,0xc9))['catch'](handleError(_0x1cceae,null));};exports[_0x29f0('0xe8')]=function(_0x8cddb0,_0xdd3c86,_0x49bf44){return db[_0x29f0('0x52')][_0x29f0('0xcb')]({'where':{'id':_0x8cddb0['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xdd3c86,null))[_0x29f0('0x25')](function(_0x25d01b){if(_0x25d01b){if(_0x25d01b['closed']){return _0xdd3c86['status'](0x193)['json']({'status':0x193,'message':_0x29f0('0xe9')});}return db[_0x29f0('0xe7')]['findOne']({'where':{'id':_0x8cddb0['query'][_0x29f0('0xea')]},'raw':!![]})['then'](handleEntityNotFound(_0xdd3c86,null));}})[_0x29f0('0x25')](function(_0x5525f5){if(_0x5525f5){var _0x6370a2=_0x5525f5[_0x29f0('0xeb')]!==null;var _0x50d928=path[_0x29f0('0xec')](config['root'],_0x29f0('0xed'));if(_0x6370a2){_0x50d928=path['join'](_0x50d928,_0x29f0('0xee'));}var _0x3dd6ed=path[_0x29f0('0xec')](_0x50d928,_0x5525f5[_0x29f0('0xe3')]);return _0xdd3c86['download'](_0x3dd6ed);}})['catch'](handleError(_0xdd3c86,null));};exports[_0x29f0('0xef')]=function(_0x2e2091,_0x1717ed){var _0x325b06=null;var _0x40d2c2=null;var _0x2b144d=null;var _0x1cba1c=null;if(_0x2e2091[_0x29f0('0x8b')]['id']){delete _0x2e2091[_0x29f0('0x8b')]['id'];}if(_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf0')]){_0x1cba1c=path[_0x29f0('0xec')](config[_0x29f0('0xf1')],_0x29f0('0xf2'),util[_0x29f0('0xf3')](_0x29f0('0xf4'),Date[_0x29f0('0xf5')]()));_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf6')]=_0x1cba1c;}return db[_0x29f0('0x52')]['find']({'where':{'id':_0x2e2091['params']['id']},'include':[{'model':db[_0x29f0('0xd9')],'as':_0x29f0('0xf7'),'include':[{'model':db[_0x29f0('0xf8')],'as':_0x29f0('0xf8')}]}]})[_0x29f0('0x25')](handleEntityNotFound(_0x1717ed,null))[_0x29f0('0x25')](saveUpdates(_0x2e2091[_0x29f0('0x8b')],null))[_0x29f0('0x25')](function(_0x38e7e1){if(_0x38e7e1){_0x325b06=_0x38e7e1;return db['ChatWebsite'][_0x29f0('0x81')]({'where':{'id':_0x325b06[_0x29f0('0x8d')]}});}})[_0x29f0('0x25')](function(_0xaac683){if(_0xaac683){_0x2b144d=_0xaac683;return db[_0x29f0('0xdc')][_0x29f0('0x81')]({'where':{'id':_0x325b06[_0x29f0('0x82')]}});}})[_0x29f0('0x25')](function(_0x3ea84c){if(_0x3ea84c){_0x40d2c2=_0x3ea84c;if(_0x1cba1c){var _0x5e92e9=null;for(var _0x57d47a=0x1;_0x57d47a<_0x325b06[_0x29f0('0xf7')]['length'];++_0x57d47a){_0x5e92e9=_0x325b06[_0x29f0('0xf7')][_0x57d47a];var _0x25eaed=_0x5e92e9['UserId']?util[_0x29f0('0xf3')](_0x29f0('0xf9'),_0x2b144d[_0x29f0('0xfa')],_0x5e92e9[_0x29f0('0x4d')]):'System';var _0x112d58=_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xfb')]||util[_0x29f0('0xf3')](_0x29f0('0xf9'),'Visitor',_0x5e92e9[_0x29f0('0x82')]);switch(_0x2b144d[_0x29f0('0xfc')]){case'website_alias':_0x25eaed=_0x5e92e9[_0x29f0('0x4d')]?util['format'](_0x29f0('0xf9'),_0x2b144d['agentAlias'],_0x5e92e9[_0x29f0('0x4d')]):_0x29f0('0xfd');break;case _0x29f0('0xfe'):_0x25eaed=_0x5e92e9['UserId']?_0x5e92e9[_0x29f0('0xf8')][_0x29f0('0xff')]||_0x5e92e9[_0x29f0('0xf8')][_0x29f0('0x43')]:_0x29f0('0xfd');break;case _0x29f0('0x100'):_0x25eaed=_0x5e92e9[_0x29f0('0x4d')]?_0x5e92e9[_0x29f0('0xf8')][_0x29f0('0x43')]:_0x29f0('0xfd');break;default:_0x25eaed=_0x5e92e9[_0x29f0('0x4d')]?util[_0x29f0('0xf3')](_0x29f0('0xf9'),_0x2b144d[_0x29f0('0xfa')],_0x5e92e9['UserId']):_0x29f0('0xfd');}var _0x4ff91b=util['format'](_0x29f0('0x101'),moment(_0x5e92e9[_0x29f0('0x8e')])['format'](_0x29f0('0x102')),_0x5e92e9[_0x29f0('0x103')]==='in'?_0x112d58:_0x25eaed,_0x5e92e9[_0x29f0('0x8b')]);if(!_0x5e92e9['secret']){fs[_0x29f0('0x104')](_0x1cba1c,_0x4ff91b);}}return db[_0x29f0('0x105')][_0x29f0('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0x29f0('0x106')],'as':_0x29f0('0x107'),'raw':!![]}]});}}})['then'](function(_0x74ddc7){if(_0x74ddc7&&_0x74ddc7[_0x29f0('0x107')]&&_0x2e2091[_0x29f0('0x8b')]){var _0x11fd39={'tls':{'rejectUnauthorized':![]}};if(_0x74ddc7[_0x29f0('0x107')]['service']){_0x11fd39[_0x29f0('0x108')]=_0x74ddc7[_0x29f0('0x107')]['service'];}else{_0x11fd39[_0x29f0('0x109')]=_0x74ddc7[_0x29f0('0x107')][_0x29f0('0x109')];_0x11fd39['port']=_0x74ddc7['Smtp'][_0x29f0('0x10a')];_0x11fd39[_0x29f0('0x10b')]=_0x74ddc7['Smtp'][_0x29f0('0x10b')];}if(_0x74ddc7[_0x29f0('0x107')][_0x29f0('0x10c')]){_0x11fd39['auth']={'user':_0x74ddc7['Smtp']['user'],'pass':_0x74ddc7[_0x29f0('0x107')][_0x29f0('0x10d')]};}return respondWithRpcPromise(_0x29f0('0x10e'),'sendMail',{'account':_0x11fd39,'message':{'from':util['format'](_0x29f0('0x10f'),_0x74ddc7[_0x29f0('0x3d')],_0x74ddc7[_0x29f0('0xd2')]||_0x74ddc7[_0x29f0('0x107')]['user']),'to':_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf0')],'subject':_0x29f0('0x110'),'text':util[_0x29f0('0xf3')](_0x29f0('0x111'),_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf0')]),'attachments':[{'path':_0x1cba1c}]}})[_0x29f0('0x25')](function(){return _0x325b06;})['catch'](function(_0x156ec6){console[_0x29f0('0x2a')](_0x156ec6);});}else{return _0x325b06;}})[_0x29f0('0x25')](respondWithStatusCode(_0x1717ed,0xc8))[_0x29f0('0x2d')](handleError(_0x1717ed,null));};exports[_0x29f0('0x112')]=function(_0x3d96b9,_0x2abd80,_0x438e57){return db[_0x29f0('0xd9')][_0x29f0('0x81')]({'where':{'id':_0x3d96b9[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x2abd80,null))['then'](function(_0xd1e306){if(_0xd1e306){return _0xd1e306[_0x29f0('0x112')](_0x3d96b9[_0x29f0('0x8b')]['ids'],_['omit'](_0x3d96b9['body'],[_0x29f0('0x113'),'id'])||{});}})[_0x29f0('0x25')](respondWithResult(_0x2abd80,null))['catch'](handleError(_0x2abd80,null));};exports[_0x29f0('0x114')]=function(_0xc6515c,_0x24cb8f,_0x1eae1e){var _0x77698e={'raw':![],'where':{}};var _0x2d0dab={};var _0x408c92={'count':0x0,'rows':[]};return db[_0x29f0('0x52')][_0x29f0('0xcb')]({'where':{'id':_0xc6515c[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x24cb8f,null))['then'](function(_0x41672d){if(_0x41672d){_0x2d0dab['model']=_[_0x29f0('0x57')](db[_0x29f0('0xd9')][_0x29f0('0x53')]);_0x2d0dab[_0x29f0('0x56')]=_[_0x29f0('0x57')](_0xc6515c[_0x29f0('0x56')]);_0x2d0dab[_0x29f0('0x61')]=_[_0x29f0('0x59')](_0x2d0dab[_0x29f0('0x5a')],_0x2d0dab['query']);_0x77698e['attributes']=_[_0x29f0('0x59')](_0x2d0dab[_0x29f0('0x5a')],qs[_0x29f0('0x5b')](_0xc6515c[_0x29f0('0x56')]['fields']));_0x77698e[_0x29f0('0x58')]=_0x77698e[_0x29f0('0x58')][_0x29f0('0x5c')]?_0x77698e[_0x29f0('0x58')]:_0x2d0dab['model'];if(!_0xc6515c[_0x29f0('0x56')][_0x29f0('0x5d')](_0x29f0('0x115'))){_0x77698e['limit']=qs[_0x29f0('0x34')](_0xc6515c[_0x29f0('0x56')][_0x29f0('0x34')]);_0x77698e['offset']=qs[_0x29f0('0x32')](_0xc6515c[_0x29f0('0x56')][_0x29f0('0x32')]);}_0x77698e[_0x29f0('0x5e')]=qs[_0x29f0('0x5f')](_0xc6515c[_0x29f0('0x56')][_0x29f0('0x5f')]);_0x77698e[_0x29f0('0x60')]=qs[_0x29f0('0x61')](_[_0x29f0('0x116')](_0xc6515c[_0x29f0('0x56')],_0x2d0dab[_0x29f0('0x61')]));_0x77698e[_0x29f0('0x60')][_0x29f0('0xc0')]=_0x41672d['id'];if(_0xc6515c[_0x29f0('0x56')][_0x29f0('0x99')]){_0x77698e[_0x29f0('0x60')]=_[_0x29f0('0xb0')](_0x77698e[_0x29f0('0x60')],{'$or':_[_0x29f0('0x51')](_0x77698e[_0x29f0('0x58')],function(_0x49bd38){var _0x19bf31={};_0x19bf31[_0x49bd38]={'$like':'%'+_0xc6515c[_0x29f0('0x56')][_0x29f0('0x99')]+'%'};return _0x19bf31;})});}if(_0xc6515c['query'][_0x29f0('0x117')]){var _0x49eb6b=_0xc6515c['query'][_0x29f0('0x117')][_0x29f0('0x46')](',');var _0x35cce3={};_0x35cce3[_0x49eb6b[0x0]]={'$gte':moment(_0x49eb6b[0x1])['format'](_0x29f0('0x118'))};_0x77698e[_0x29f0('0x60')]=_[_0x29f0('0xb0')](_0x77698e[_0x29f0('0x60')],_0x35cce3);}_0x77698e=_[_0x29f0('0xb0')]({},_0x77698e,_0xc6515c['options']);return db[_0x29f0('0xd9')][_0x29f0('0x35')]({'where':_0x77698e[_0x29f0('0x60')]})['then'](function(_0x2ebb4a){_0x408c92['count']=_0x2ebb4a;if(_0xc6515c[_0x29f0('0x56')]['includeAll']){_0x77698e['include']=[{'all':!![]}];}return db[_0x29f0('0xd9')][_0x29f0('0x119')](_0x77698e);})[_0x29f0('0x25')](function(_0x47cc5){_0x408c92[_0x29f0('0xc2')]=_0x47cc5;return _0x408c92;});}})[_0x29f0('0x25')](respondWithFilteredResult(_0x24cb8f,_0x77698e))[_0x29f0('0x2d')](handleError(_0x24cb8f,null));};exports[_0x29f0('0x11a')]=function(_0x3c1c89,_0xbba52a,_0x304d31){var _0x4eb88b={'where':{}},_0x55a38f={},_0x3beaea={'count':0x0,'rows':[]};return db[_0x29f0('0x52')]['findOne']({'where':{'id':_0x3c1c89[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0xbba52a,null))[_0x29f0('0x25')](function(_0x148c8b){if(_0x148c8b){_0x55a38f[_0x29f0('0x5a')]=_['keys'](db[_0x29f0('0xd9')][_0x29f0('0x53')]);_0x55a38f[_0x29f0('0x56')]=_[_0x29f0('0x57')](_0x3c1c89[_0x29f0('0x56')]);_0x55a38f[_0x29f0('0x61')]=_[_0x29f0('0x59')](_0x55a38f[_0x29f0('0x5a')],_0x55a38f[_0x29f0('0x56')]);_0x4eb88b[_0x29f0('0x58')]=_[_0x29f0('0x59')](_0x55a38f[_0x29f0('0x5a')],qs[_0x29f0('0x5b')](_0x3c1c89[_0x29f0('0x56')]['fields']));_0x4eb88b['attributes']=_0x4eb88b[_0x29f0('0x58')][_0x29f0('0x5c')]?_0x4eb88b[_0x29f0('0x58')]:_0x55a38f[_0x29f0('0x5a')];if(!_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x5d')](_0x29f0('0x115'))){_0x4eb88b[_0x29f0('0x34')]=qs[_0x29f0('0x34')](_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x34')]);_0x4eb88b[_0x29f0('0x32')]=qs[_0x29f0('0x32')](_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x32')]);}_0x4eb88b[_0x29f0('0x5e')]=qs[_0x29f0('0x5f')](_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x5f')]);_0x4eb88b[_0x29f0('0x60')]=qs[_0x29f0('0x61')](_[_0x29f0('0x116')](_0x3c1c89[_0x29f0('0x56')],_0x55a38f['filters']));_0x4eb88b[_0x29f0('0x60')][_0x29f0('0xc0')]=_0x148c8b['id'];if(_0x3c1c89['query']['filter']){_0x4eb88b['where']=_[_0x29f0('0xb0')](_0x4eb88b[_0x29f0('0x60')],{'$or':_[_0x29f0('0x51')](_0x4eb88b[_0x29f0('0x58')],function(_0x7d19a){var _0x23c29c={};_0x23c29c[_0x7d19a]={'$like':'%'+_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x99')]+'%'};return _0x23c29c;})});}_0x4eb88b[_0x29f0('0x60')][_0x29f0('0x11b')]=![];if(_0x3c1c89[_0x29f0('0x56')]['id']){_0x4eb88b[_0x29f0('0x60')]['id']={'$gt':_0x3c1c89[_0x29f0('0x56')]['id']};}_0x4eb88b=_[_0x29f0('0xb0')]({},_0x4eb88b,_0x3c1c89[_0x29f0('0xc6')]);return db['ChatMessage']['count']({'where':_0x4eb88b[_0x29f0('0x60')]})[_0x29f0('0x25')](function(_0x244a26){_0x3beaea[_0x29f0('0x35')]=_0x244a26;_0x4eb88b[_0x29f0('0xc5')]=[];if(_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x11c')]){_0x4eb88b[_0x29f0('0xc5')][_0x29f0('0x47')]({'model':db[_0x29f0('0xf8')],'as':'User','attributes':['id',_0x29f0('0x43'),_0x29f0('0xff')]});}if(_0x3c1c89[_0x29f0('0x56')][_0x29f0('0xc4')]){_0x4eb88b[_0x29f0('0xc5')]=[{'all':!![]}];}return db[_0x29f0('0xd9')]['findAll'](_0x4eb88b);})[_0x29f0('0x25')](function(_0x47b220){_0x3beaea[_0x29f0('0xc2')]=_0x47b220;return _0x3beaea;});}})[_0x29f0('0x25')](respondWithFilteredResult(_0xbba52a,_0x4eb88b))['catch'](handleError(_0xbba52a,null));};exports['addTags']=function(_0x38c54d,_0x1cd4d8,_0x4bb54d){return db[_0x29f0('0x52')]['find']({'where':{'id':_0x38c54d[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x1cd4d8,null))['then'](function(_0x4c9263){if(_0x4c9263){return _0x4c9263[_0x29f0('0x11d')](_0x38c54d[_0x29f0('0x8b')]['ids'],_[_0x29f0('0x11e')](_0x38c54d[_0x29f0('0x8b')],[_0x29f0('0x113'),'id'])||{})[_0x29f0('0x11f')](function(){return db[_0x29f0('0x86')][_0x29f0('0x119')]({'attributes':['id',_0x29f0('0x3d'),_0x29f0('0x62')],'where':{'id':_0x38c54d[_0x29f0('0x8b')][_0x29f0('0x113')]}});})['then'](function(_0x3aee8e){socket[_0x29f0('0x120')](_0x29f0('0x121'),{'id':Number(_0x38c54d['params']['id']),'tags':_0x3aee8e||[]});return{'id':Number(_0x38c54d[_0x29f0('0xc8')]['id']),'tags':_0x3aee8e||[]};});}})[_0x29f0('0x25')](respondWithResult(_0x1cd4d8,null))['catch'](handleError(_0x1cd4d8,null));};exports['removeTags']=function(_0x2d6ac6,_0x40e23c,_0x49a14d){return db['ChatInteraction']['find']({'where':{'id':_0x2d6ac6[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x40e23c,null))[_0x29f0('0x25')](function(_0x5c2456){if(_0x5c2456){return _0x5c2456['removeTags'](_0x2d6ac6['query'][_0x29f0('0x113')]);}})[_0x29f0('0x25')](respondWithStatusCode(_0x40e23c,null))[_0x29f0('0x2d')](handleError(_0x40e23c,null));};exports['download']=function(_0x57c80a,_0x52c53f){var _0xd55701=moment()[_0x29f0('0x122')]()[_0x29f0('0xae')]();var _0x218bc6=path[_0x29f0('0xec')](config[_0x29f0('0xf1')],_0x29f0('0x123'),_0x29f0('0x124'),'tmp');var _0x38526c=path[_0x29f0('0xec')](config[_0x29f0('0xf1')],_0x29f0('0x123'),_0x29f0('0x124'),'attachments');var _0x51264d=path[_0x29f0('0xec')](_0x218bc6,_0xd55701);var _0x52d801=util[_0x29f0('0xf3')](_0x29f0('0x125'),_0x57c80a[_0x29f0('0xc8')]['id'],_0xd55701);var _0x2d12a8=path[_0x29f0('0xec')](_0x218bc6,_0x52d801);var _0x20cb64=[];_0x20cb64[_0x29f0('0x47')]({'model':db[_0x29f0('0xf8')],'as':_0x29f0('0xf8'),'attributes':['id',_0x29f0('0x43')],'raw':!![]});_0x20cb64[_0x29f0('0x47')]({'model':db[_0x29f0('0xdc')],'as':_0x29f0('0x7d'),'attributes':['id',_0x29f0('0x126'),_0x29f0('0x127')],'raw':!![]});if(_0x57c80a['query'][_0x29f0('0x128')]){_0x20cb64[_0x29f0('0x47')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4b7bb3=[{'model':db[_0x29f0('0xd9')],'as':_0x29f0('0xf7'),'attributes':['id',_0x29f0('0x8b'),_0x29f0('0x8e'),_0x29f0('0x103'),_0x29f0('0x11b'),_0x29f0('0x94')],'include':_0x20cb64}];_0x4b7bb3[_0x29f0('0x47')]({'model':db['ChatWebsite'],'as':_0x29f0('0x129'),'attributes':['id','name']});_0x4b7bb3[_0x29f0('0x47')]({'model':db[_0x29f0('0xf8')],'as':_0x29f0('0x12a'),'attributes':['id',_0x29f0('0x43')]});return db[_0x29f0('0x52')]['find']({'where':{'id':_0x57c80a['params']['id']},'include':_0x4b7bb3})['then'](handleEntityNotFound(_0x52c53f,null))[_0x29f0('0x25')](function(_0x5ab301){if(_0x5ab301){var _0x3224b2=_0x5ab301[_0x29f0('0x12b')]({'plain':!![]});fs['mkdirSync'](_0x51264d);var _0x2d737a={'channel':_0x29f0('0x12c'),'account':_0x3224b2[_0x29f0('0x129')]['name'],'agent':_0x3224b2[_0x29f0('0x12a')]?_0x3224b2['Owner'][_0x29f0('0x43')]:_0x29f0('0x12d'),'createdAt':moment(_0x3224b2[_0x29f0('0x8e')])[_0x29f0('0xf3')](_0x29f0('0x118'))[_0x29f0('0xae')](),'closedAt':_0x3224b2[_0x29f0('0x4e')]?moment(_0x3224b2['closedAt'])['format'](_0x29f0('0x118'))[_0x29f0('0xae')]():'','disposition':_0x3224b2['disposition'],'chatInfo':{'browser':_0x3224b2[_0x29f0('0x12e')],'os':_0x3224b2[_0x29f0('0x12f')],'referer':_0x3224b2['referer'],'customerIp':_0x3224b2['customerIp'],'customerPort':_0x3224b2[_0x29f0('0x130')]?_0x3224b2['customerPort']:_0x29f0('0x12d')},'messages':_(_0x3224b2['Messages'])[_0x29f0('0x131')]()['filter']({'secret':![]})['map'](function(_0x5eba71){if(_0x5eba71['Attachment']){var _0x2420c0=path[_0x29f0('0xec')](_0x38526c,_0x5eba71[_0x29f0('0xe7')]['basename']);if(fs[_0x29f0('0x132')](_0x2420c0)){fs[_0x29f0('0x133')](_0x2420c0)[_0x29f0('0x134')](fs['createWriteStream'](path['join'](_0x51264d,_0x5eba71[_0x29f0('0xe7')]['basename'])));}}return{'date':moment(_0x5eba71[_0x29f0('0x8e')])[_0x29f0('0xf3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x5eba71[_0x29f0('0x103')]===_0x29f0('0xd8')?_0x5eba71[_0x29f0('0xf8')]?_0x5eba71[_0x29f0('0xf8')][_0x29f0('0x43')]:_0x29f0('0xfd'):_0x5eba71['Contact'][_0x29f0('0x126')]+(_0x5eba71[_0x29f0('0x7d')][_0x29f0('0x127')]?'\x20'+_0x5eba71[_0x29f0('0x7d')][_0x29f0('0x127')]:''),'body':_0x5eba71['Attachment']?_0x5eba71[_0x29f0('0xe7')][_0x29f0('0xe3')]:_0x5eba71[_0x29f0('0x8b')],'direction':_0x5eba71[_0x29f0('0x103')]===_0x29f0('0xd8')?'A':'C','secret':_0x5eba71['secret'],'read':_0x5eba71[_0x29f0('0x94')],'attachment':_0x5eba71[_0x29f0('0xe7')]};})[_0x29f0('0x7b')]()};return ejs[_0x29f0('0x135')](path[_0x29f0('0xec')](config[_0x29f0('0xf1')],'server',_0x29f0('0x136'),_0x29f0('0x137')),{'interaction':_0x2d737a})[_0x29f0('0x25')](function(_0x161e49){var _0x16c616=path['join'](_0x51264d,_0x29f0('0x138')+_0x3224b2['id']+'-'+_0xd55701+_0x29f0('0x139'));var _0x372bfb={'path':_0x16c616,'channel':_0x29f0('0x12c'),'interactionId':_0x3224b2['id']};return pdf[_0x29f0('0x13a')](_0x161e49,_0x372bfb);})['then'](function(){return new BPromise(function(_0x5c9177,_0xe7fd29){zipdir(_0x51264d,{'saveTo':_0x2d12a8},function(_0x871fbc,_0x452c33){if(_0x871fbc)return _0xe7fd29(_0x871fbc);return _0x5c9177(_0x452c33);});})[_0x29f0('0x25')](function(){return new BPromise(function(_0x2b8bda,_0x1d62e9){rimraf(_0x51264d,function(_0x22a118){if(_0x22a118)_0x1d62e9(_0x22a118);return _0x2b8bda();});});})['then'](function(){return _0x52c53f[_0x29f0('0x13b')](_0x2d12a8,_0x52d801,function(_0x481f9d){if(_0x481f9d){console['log'](_0x29f0('0x13c'),_0x481f9d);}else{fs[_0x29f0('0x13d')](_0x2d12a8);}});});});}else{return _0x52c53f[_0x29f0('0x2e')](0xc8);}})[_0x29f0('0x2d')](handleError(_0x52c53f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 11b0e59..259499f 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 _0x16bf=['unreadMessages','length','emit','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','ChatMessage','save','remove','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16bf,0x116));var _0xf16b=function(_0x3f15ae,_0x2f8168){_0x3f15ae=_0x3f15ae-0x0;var _0x5ad4=_0x16bf[_0x3f15ae];return _0x5ad4;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xf16b('0x0')];var ChatMessage=require(_0xf16b('0x1'))['db'][_0xf16b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf16b('0x3'),'afterUpdate':'update','afterDestroy':_0xf16b('0x4')};function emitEvent(_0x2ba743){return function(_0x4fe78c,_0x1d5f9b,_0x2ec26c){_0x4fe78c[_0xf16b('0x5')]({'attributes':['id'],'raw':!![]})[_0xf16b('0x6')](function(_0x3e15d3){_0x4fe78c['setDataValue'](_0xf16b('0x7'),_0x3e15d3[_0xf16b('0x8')](function(_0x3d8fc3){return{'id':_0x3d8fc3['id']};}));return ChatMessage[_0xf16b('0x9')]({'where':{'ChatInteractionId':_0x4fe78c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf16b('0x6')](function(_0x2ba46a){_0x4fe78c[_0xf16b('0xa')](_0xf16b('0xb'),_0x2ba46a[_0xf16b('0xc')]);ChatInteractionEvents[_0xf16b('0xd')](_0x2ba743+':'+_0x4fe78c['id'],_0x4fe78c);ChatInteractionEvents[_0xf16b('0xd')](_0x2ba743,_0x4fe78c);_0x2ec26c(null);})['catch'](_0x2ec26c(null));};}for(var e in events){if(events[_0xf16b('0xe')](e)){var event=events[e];ChatInteraction[_0xf16b('0xf')](e,emitEvent(event));}}module[_0xf16b('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xc2da=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update','then','setDataValue','Users'];(function(_0x583345,_0x42d756){var _0x1b2505=function(_0x1fc76c){while(--_0x1fc76c){_0x583345['push'](_0x583345['shift']());}};_0x1b2505(++_0x42d756);}(_0xc2da,0xc3));var _0xac2d=function(_0xeb5ddc,_0x47cac9){_0xeb5ddc=_0xeb5ddc-0x0;var _0xfe6f47=_0xc2da[_0xeb5ddc];return _0xfe6f47;};'use strict';var EventEmitter=require(_0xac2d('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xac2d('0x1')];var ChatMessage=require(_0xac2d('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xac2d('0x3')](0x0);var events={'afterCreate':_0xac2d('0x4'),'afterUpdate':_0xac2d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ecbe5){return function(_0x1f9336,_0x3dd620,_0x56d364){_0x1f9336['getUsers']({'attributes':['id'],'raw':!![]})[_0xac2d('0x6')](function(_0x22a7b8){_0x1f9336[_0xac2d('0x7')](_0xac2d('0x8'),_0x22a7b8[_0xac2d('0x9')](function(_0x402126){return{'id':_0x402126['id']};}));return ChatMessage[_0xac2d('0xa')]({'where':{'ChatInteractionId':_0x1f9336['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac2d('0x6')](function(_0x841a42){_0x1f9336[_0xac2d('0x7')](_0xac2d('0xb'),_0x841a42[_0xac2d('0xc')]);ChatInteractionEvents[_0xac2d('0xd')](_0x1ecbe5+':'+_0x1f9336['id'],_0x1f9336);ChatInteractionEvents[_0xac2d('0xd')](_0x1ecbe5,_0x1f9336);_0x56d364(null);})[_0xac2d('0xe')](_0x56d364(null));};}for(var e in events){if(events[_0xac2d('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xac2d('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 1b1df5f..d5eab1c 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 _0xb13c=['../../config/logger','api','request-promise','path','./chatInteraction.attributes','define','chat_interactions','closed','closedAt','format','utf8mb4','lodash','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb13c,0x184));var _0xcb13=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0xb13c[_0x4e0359];return _0x450f0a;};'use strict';var _=require(_0xcb13('0x0'));var util=require(_0xcb13('0x1'));var logger=require(_0xcb13('0x2'))(_0xcb13('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb13('0x4'));var fs=require('fs');var path=require(_0xcb13('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb13('0x6'));module['exports']=function(_0x15cd0b,_0x2cb225){return _0x15cd0b[_0xcb13('0x7')]('ChatInteraction',attributes,{'tableName':_0xcb13('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f785a,_0x583a44,_0x1bce6a){if(_0x1f785a['changed'](_0xcb13('0x9'))){_0x1f785a[_0xcb13('0xa')]=moment()[_0xcb13('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1bce6a(null,_0x1f785a);}},'charset':_0xcb13('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xdcae=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x53a456,_0x1c3d73){var _0x19bf77=function(_0x252263){while(--_0x252263){_0x53a456['push'](_0x53a456['shift']());}};_0x19bf77(++_0x1c3d73);}(_0xdcae,0x1e3));var _0xedca=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0xdcae[_0x5a709c];return _0x719025;};'use strict';var _=require('lodash');var util=require(_0xedca('0x0'));var logger=require('../../config/logger')(_0xedca('0x1'));var moment=require(_0xedca('0x2'));var BPromise=require(_0xedca('0x3'));var rp=require(_0xedca('0x4'));var fs=require('fs');var path=require(_0xedca('0x5'));var rimraf=require(_0xedca('0x6'));var config=require(_0xedca('0x7'));var attributes=require(_0xedca('0x8'));module[_0xedca('0x9')]=function(_0x26faff,_0x49a82d){return _0x26faff[_0xedca('0xa')](_0xedca('0xb'),attributes,{'tableName':_0xedca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x128b39,_0x2edc48,_0x507248){if(_0x128b39[_0xedca('0xd')](_0xedca('0xe'))){_0x128b39[_0xedca('0xf')]=moment()[_0xedca('0x10')](_0xedca('0x11'));}_0x507248(null,_0x128b39);}},'charset':_0xedca('0x12'),'collate':_0xedca('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 43f2527..f03aad3 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 _0x50bf=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x1d0a01,_0x163bbf){var _0x1f7ecf=function(_0x3f151c){while(--_0x3f151c){_0x1d0a01['push'](_0x1d0a01['shift']());}};_0x1f7ecf(++_0x163bbf);}(_0x50bf,0x101));var _0xf50b=function(_0x42abf5,_0x53bfde){_0x42abf5=_0x42abf5-0x0;var _0x21cf79=_0x50bf[_0x42abf5];return _0x21cf79;};'use strict';var _=require(_0xf50b('0x0'));var util=require('util');var moment=require(_0xf50b('0x1'));var BPromise=require(_0xf50b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf50b('0x3'))['db'];var utils=require(_0xf50b('0x4'));var logger=require(_0xf50b('0x5'))(_0xf50b('0x6'));var config=require(_0xf50b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf50b('0x8')][_0xf50b('0x9')]({'port':0x232a});config['redis']=_[_0xf50b('0xa')](config[_0xf50b('0xb')],{'host':_0xf50b('0xc'),'port':0x18eb});var socket=require(_0xf50b('0xd'))(new Redis(config[_0xf50b('0xb')]));require('./chatInteraction.socket')[_0xf50b('0xe')](socket);function respondWithRpcPromise(_0xabc2ca,_0x54e905,_0x8e190c){return new BPromise(function(_0x2688b3,_0x184817){return client[_0xf50b('0xf')](_0xabc2ca,_0x8e190c)[_0xf50b('0x10')](function(_0x27a4a6){logger[_0xf50b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x54e905,'request\x20sent');logger[_0xf50b('0x12')](_0xf50b('0x13'),_0x54e905,_0xf50b('0x14'),JSON['stringify'](_0x27a4a6));if(_0x27a4a6[_0xf50b('0x15')]){if(_0x27a4a6[_0xf50b('0x15')][_0xf50b('0x16')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x54e905,_0x27a4a6[_0xf50b('0x15')]['message']);return _0x184817(_0x27a4a6[_0xf50b('0x15')][_0xf50b('0x17')]);}logger[_0xf50b('0x15')](_0xf50b('0x18'),_0x54e905,_0x27a4a6[_0xf50b('0x15')]['message']);return _0x2688b3(_0x27a4a6[_0xf50b('0x15')][_0xf50b('0x17')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x54e905,_0xf50b('0x14'));_0x2688b3(_0x27a4a6[_0xf50b('0x19')]['message']);}})['catch'](function(_0x53409e){logger[_0xf50b('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x54e905,_0x53409e);_0x184817(_0x53409e);});});}exports[_0xf50b('0x1a')]=function(_0x1a1620){var _0x508938=this;return new Promise(function(_0x302274,_0x201867){return db[_0xf50b('0x1b')][_0xf50b('0x1c')](_0x1a1620[_0xf50b('0x1d')],{'raw':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620['options'][_0xf50b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620[_0xf50b('0x1e')][_0xf50b('0x20')]||null:null,'attributes':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620[_0xf50b('0x1e')]['attributes']||null:null,'limit':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620[_0xf50b('0x1e')][_0xf50b('0x21')]||null:null})['then'](function(_0x47b603){logger['info'](_0xf50b('0x1a'),_0x1a1620);logger[_0xf50b('0x12')]('UpdateChatInteraction',_0x1a1620,JSON[_0xf50b('0x22')](_0x47b603));_0x302274(_0x47b603);})[_0xf50b('0x23')](function(_0x7a7d8a){logger[_0xf50b('0x15')](_0xf50b('0x1a'),_0x7a7d8a[_0xf50b('0x17')],_0x1a1620);_0x201867(_0x508938[_0xf50b('0x15')](0x1f4,_0x7a7d8a[_0xf50b('0x17')]));});});};exports[_0xf50b('0x24')]=function(_0x296d3c){return new Promise(function(_0x596d09,_0x4613f0){return db[_0xf50b('0x1b')][_0xf50b('0x25')]({'where':_0x296d3c[_0xf50b('0x1e')]?_0x296d3c[_0xf50b('0x1e')][_0xf50b('0x20')]||null:null})['then'](function(_0x46a73f){if(_0x46a73f){return _0x46a73f[_0xf50b('0x26')](_0x296d3c[_0xf50b('0x1d')][_0xf50b('0x27')],_[_0xf50b('0x28')](_0x296d3c['body'],['ids','id'])||{});}})[_0xf50b('0x29')](function(_0x275de7){logger[_0xf50b('0x11')](_0xf50b('0x2a'),_0x296d3c);logger[_0xf50b('0x12')](_0xf50b('0x2a'),_0x296d3c,JSON[_0xf50b('0x22')](_0x275de7));_0x596d09(_0x275de7);})[_0xf50b('0x23')](function(_0xe43aec){logger['error']('AddTags',_0xe43aec[_0xf50b('0x17')],_0x296d3c);_0x4613f0(_this[_0xf50b('0x15')](0x1f4,_0xe43aec[_0xf50b('0x17')]));});});}; \ No newline at end of file +var _0xbb91=['./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','stringify','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','redis'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xbb91,0x9e));var _0x1bb9=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0xbb91[_0x1c72b8];return _0x191114;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var moment=require(_0x1bb9('0x2'));var BPromise=require(_0x1bb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1bb9('0x4'))['db'];var utils=require(_0x1bb9('0x5'));var logger=require(_0x1bb9('0x6'))(_0x1bb9('0x7'));var config=require(_0x1bb9('0x8'));var jayson=require(_0x1bb9('0x9'));var client=jayson[_0x1bb9('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1bb9('0xb')](config['redis'],{'host':_0x1bb9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1bb9('0xd')]));require(_0x1bb9('0xe'))[_0x1bb9('0xf')](socket);function respondWithRpcPromise(_0x12dd2a,_0x31f453,_0x3696e2){return new BPromise(function(_0xc23f1,_0x130b78){return client[_0x1bb9('0x10')](_0x12dd2a,_0x3696e2)[_0x1bb9('0x11')](function(_0x2758af){logger[_0x1bb9('0x12')](_0x1bb9('0x13'),_0x31f453,_0x1bb9('0x14'));logger[_0x1bb9('0x15')](_0x1bb9('0x16'),_0x31f453,_0x1bb9('0x14'),JSON['stringify'](_0x2758af));if(_0x2758af[_0x1bb9('0x17')]){if(_0x2758af[_0x1bb9('0x17')][_0x1bb9('0x18')]===0x1f4){logger[_0x1bb9('0x17')](_0x1bb9('0x13'),_0x31f453,_0x2758af[_0x1bb9('0x17')][_0x1bb9('0x19')]);return _0x130b78(_0x2758af['error'][_0x1bb9('0x19')]);}logger[_0x1bb9('0x17')](_0x1bb9('0x13'),_0x31f453,_0x2758af[_0x1bb9('0x17')][_0x1bb9('0x19')]);return _0xc23f1(_0x2758af['error'][_0x1bb9('0x19')]);}else{logger[_0x1bb9('0x12')](_0x1bb9('0x13'),_0x31f453,_0x1bb9('0x14'));_0xc23f1(_0x2758af[_0x1bb9('0x1a')][_0x1bb9('0x19')]);}})[_0x1bb9('0x1b')](function(_0x38a860){logger[_0x1bb9('0x17')](_0x1bb9('0x13'),_0x31f453,_0x38a860);_0x130b78(_0x38a860);});});}exports[_0x1bb9('0x1c')]=function(_0x4c54c2){var _0x5c5355=this;return new Promise(function(_0x50be32,_0x3c1351){return db[_0x1bb9('0x1d')][_0x1bb9('0x1e')](_0x4c54c2[_0x1bb9('0x1f')],{'raw':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2[_0x1bb9('0x20')][_0x1bb9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2[_0x1bb9('0x20')][_0x1bb9('0x22')]||null:null,'attributes':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2[_0x1bb9('0x20')]['attributes']||null:null,'limit':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2['options'][_0x1bb9('0x23')]||null:null})[_0x1bb9('0x11')](function(_0x7a3e87){logger[_0x1bb9('0x12')](_0x1bb9('0x1c'),_0x4c54c2);logger[_0x1bb9('0x15')](_0x1bb9('0x1c'),_0x4c54c2,JSON[_0x1bb9('0x24')](_0x7a3e87));_0x50be32(_0x7a3e87);})[_0x1bb9('0x1b')](function(_0x3377ee){logger['error'](_0x1bb9('0x1c'),_0x3377ee[_0x1bb9('0x19')],_0x4c54c2);_0x3c1351(_0x5c5355['error'](0x1f4,_0x3377ee[_0x1bb9('0x19')]));});});};exports[_0x1bb9('0x25')]=function(_0x2f2442){return new Promise(function(_0x58c6a1,_0x438a76){return db[_0x1bb9('0x1d')][_0x1bb9('0x26')]({'where':_0x2f2442[_0x1bb9('0x20')]?_0x2f2442[_0x1bb9('0x20')][_0x1bb9('0x22')]||null:null})['then'](function(_0x3a73ca){if(_0x3a73ca){return _0x3a73ca['addTags'](_0x2f2442[_0x1bb9('0x1f')][_0x1bb9('0x27')],_[_0x1bb9('0x28')](_0x2f2442[_0x1bb9('0x1f')],[_0x1bb9('0x27'),'id'])||{});}})[_0x1bb9('0x29')](function(_0x4b5b26){logger[_0x1bb9('0x12')](_0x1bb9('0x2a'),_0x2f2442);logger[_0x1bb9('0x15')](_0x1bb9('0x2a'),_0x2f2442,JSON[_0x1bb9('0x24')](_0x4b5b26));_0x58c6a1(_0x4b5b26);})[_0x1bb9('0x1b')](function(_0x29c0c9){logger['error'](_0x1bb9('0x2a'),_0x29c0c9['message'],_0x2f2442);_0x438a76(_this['error'](0x1f4,_0x29c0c9[_0x1bb9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index b018cd9..48e2a3b 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 _0x6c6f=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x5f14ef,_0x2c0b21){var _0x1b5067=function(_0x566d2f){while(--_0x566d2f){_0x5f14ef['push'](_0x5f14ef['shift']());}};_0x1b5067(++_0x2c0b21);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x11a3cc,_0x587433){_0x11a3cc=_0x11a3cc-0x0;var _0x16d50e=_0x6c6f[_0x11a3cc];return _0x16d50e;};'use strict';var ChatInteractionEvents=require(_0xf6c6('0x0'));var events=[_0xf6c6('0x1'),_0xf6c6('0x2'),_0xf6c6('0x3')];function createListener(_0x2f571d,_0x3c8fc3){return function(_0x332916){_0x3c8fc3[_0xf6c6('0x4')](_0x2f571d,_0x332916);};}function removeListener(_0x36fcd2,_0xa1183){return function(){ChatInteractionEvents[_0xf6c6('0x5')](_0x36fcd2,_0xa1183);};}exports['register']=function(_0x3b4e7b){for(var _0x4f8e34=0x0,_0x4c27f8=events[_0xf6c6('0x6')];_0x4f8e34<_0x4c27f8;_0x4f8e34++){var _0x5b34df=events[_0x4f8e34];var _0x308c42=createListener(_0xf6c6('0x7')+_0x5b34df,_0x3b4e7b);ChatInteractionEvents['on'](_0x5b34df,_0x308c42);}}; \ No newline at end of file +var _0x4ed4=['remove','update','emit','register','chatInteraction:','save'];(function(_0x10f68,_0x450501){var _0x353b09=function(_0x292fd2){while(--_0x292fd2){_0x10f68['push'](_0x10f68['shift']());}};_0x353b09(++_0x450501);}(_0x4ed4,0xbf));var _0x44ed=function(_0x334623,_0x33a637){_0x334623=_0x334623-0x0;var _0x2c3799=_0x4ed4[_0x334623];return _0x2c3799;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x44ed('0x0'),_0x44ed('0x1'),_0x44ed('0x2')];function createListener(_0x2016e0,_0x34ac2a){return function(_0xa80d0c){_0x34ac2a[_0x44ed('0x3')](_0x2016e0,_0xa80d0c);};}function removeListener(_0x515e2a,_0x2fab7d){return function(){ChatInteractionEvents['removeListener'](_0x515e2a,_0x2fab7d);};}exports[_0x44ed('0x4')]=function(_0x5d44e1){for(var _0x438adf=0x0,_0x319878=events['length'];_0x438adf<_0x319878;_0x438adf++){var _0x44e4e0=events[_0x438adf];var _0x4d9e3c=createListener(_0x44ed('0x5')+_0x44e4e0,_0x5d44e1);ChatInteractionEvents['on'](_0x44e4e0,_0x4d9e3c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c1f0e7e..56cd953 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 _0x0556=['diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','/:id/messages','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','createVidaooSession'];(function(_0x5c1f18,_0x53d570){var _0xa58746=function(_0x3a3c5e){while(--_0x3a3c5e){_0x5c1f18['push'](_0x5c1f18['shift']());}};_0xa58746(++_0x53d570);}(_0x0556,0xb6));var _0x6055=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0x0556[_0x1eb82d];return _0x2c9502;};'use strict';var multer=require(_0x6055('0x0'));var util=require('util');var path=require(_0x6055('0x1'));var timeout=require(_0x6055('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6055('0x3'));var interaction=require(_0x6055('0x4'));var config=require(_0x6055('0x5'));var controller=require(_0x6055('0x6'));router['get']('/',auth[_0x6055('0x7')](),controller['index']);router[_0x6055('0x8')]('/describe',auth[_0x6055('0x7')](),controller[_0x6055('0x9')]);router[_0x6055('0x8')](_0x6055('0xa'),auth['isChatInteractionAuthorized'](),controller[_0x6055('0xb')]);router[_0x6055('0x8')](_0x6055('0xc'),auth[_0x6055('0xd')](),controller[_0x6055('0xe')]);router['get']('/:id/messages',auth[_0x6055('0x7')](),controller[_0x6055('0xf')]);router[_0x6055('0x8')](_0x6055('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x6055('0x11')]);router[_0x6055('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x6055('0x12')]);router[_0x6055('0x13')]('/',auth[_0x6055('0x7')](),controller[_0x6055('0x14')]);router[_0x6055('0x13')]('/:id/vidaoo',auth[_0x6055('0x7')](),controller[_0x6055('0x15')]);var upload=multer({'storage':multer[_0x6055('0x16')]({'destination':function(_0x26b23a,_0xfb4580,_0x2c47f0){_0x2c47f0(null,path[_0x6055('0x17')](config[_0x6055('0x18')],_0x6055('0x19')));},'filename':function(_0x29d032,_0x48452f,_0x196708){_0x196708(null,util[_0x6055('0x1a')](_0x6055('0x1b'),Date[_0x6055('0x1c')](),_0x48452f[_0x6055('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x6055('0x1e'),upload[_0x6055('0x1f')](_0x6055('0x20')),controller['attachmentUpload']);router[_0x6055('0x13')](_0x6055('0x21'),auth[_0x6055('0xd')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x6055('0x22')](_0x6055('0x23'),_0x6055('0x24')),controller['addTags']);router[_0x6055('0x25')]('/:id',auth[_0x6055('0x7')](),interaction[_0x6055('0x22')](_0x6055('0x23'),_0x6055('0x26')),controller[_0x6055('0x27')]);router[_0x6055('0x25')](_0x6055('0x28'),controller[_0x6055('0x29')]);router[_0x6055('0x25')](_0x6055('0x2a'),auth[_0x6055('0xd')](),controller[_0x6055('0x2b')]);router['put']('/:id/close',controller[_0x6055('0x2c')]);router[_0x6055('0x2d')](_0x6055('0xa'),auth['isAuthenticated'](),interaction[_0x6055('0x22')](_0x6055('0x23'),_0x6055('0x2e')),controller[_0x6055('0x2f')]);router['delete'](_0x6055('0x30'),auth[_0x6055('0x7')](),controller[_0x6055('0x31')]);module[_0x6055('0x32')]=router; \ No newline at end of file +var _0x11d4=['close','delete','tracked','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','create','/:id/vidaoo','diskStorage','join','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11d4,0x105));var _0x411d=function(_0x207f46,_0x20cc49){_0x207f46=_0x207f46-0x0;var _0x226e01=_0x11d4[_0x207f46];return _0x226e01;};'use strict';var multer=require(_0x411d('0x0'));var util=require('util');var path=require(_0x411d('0x1'));var timeout=require(_0x411d('0x2'));var express=require(_0x411d('0x3'));var router=express['Router']();var fs_extra=require(_0x411d('0x4'));var auth=require(_0x411d('0x5'));var interaction=require(_0x411d('0x6'));var config=require(_0x411d('0x7'));var controller=require(_0x411d('0x8'));router[_0x411d('0x9')]('/',auth[_0x411d('0xa')](),controller[_0x411d('0xb')]);router[_0x411d('0x9')](_0x411d('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x411d('0x9')](_0x411d('0xd'),auth[_0x411d('0xe')](),controller[_0x411d('0xf')]);router[_0x411d('0x9')](_0x411d('0x10'),auth[_0x411d('0xe')](),controller[_0x411d('0x11')]);router[_0x411d('0x9')](_0x411d('0x12'),auth[_0x411d('0xa')](),controller[_0x411d('0x13')]);router[_0x411d('0x9')]('/:id/my_messages',auth[_0x411d('0xe')](),controller[_0x411d('0x14')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x411d('0x15')]);router[_0x411d('0x16')]('/',auth['isAuthenticated'](),controller[_0x411d('0x17')]);router[_0x411d('0x16')](_0x411d('0x18'),auth[_0x411d('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x411d('0x19')]({'destination':function(_0x12b94a,_0xbfc138,_0x3c06d3){_0x3c06d3(null,path[_0x411d('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x2b2cf9,_0x28c40b,_0x24ca79){_0x24ca79(null,util['format']('%s-%s',Date['now'](),_0x28c40b[_0x411d('0x1b')][_0x411d('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x411d('0x16')](_0x411d('0x1d'),upload[_0x411d('0x1e')]('file'),controller[_0x411d('0x1f')]);router[_0x411d('0x16')]('/:id/messages',auth[_0x411d('0xe')](),controller[_0x411d('0x20')]);router['post'](_0x411d('0x21'),auth['isAuthenticated'](),interaction['tracked'](_0x411d('0x22'),_0x411d('0x23')),controller[_0x411d('0x24')]);router[_0x411d('0x25')]('/:id',auth[_0x411d('0xa')](),interaction['tracked'](_0x411d('0x22'),_0x411d('0x26')),controller[_0x411d('0x27')]);router[_0x411d('0x25')](_0x411d('0x28'),controller[_0x411d('0x29')]);router[_0x411d('0x25')](_0x411d('0x2a'),auth[_0x411d('0xe')](),controller[_0x411d('0x2b')]);router[_0x411d('0x25')](_0x411d('0x2c'),controller[_0x411d('0x2d')]);router[_0x411d('0x2e')](_0x411d('0xd'),auth[_0x411d('0xa')](),interaction[_0x411d('0x2f')](_0x411d('0x22'),_0x411d('0x30')),controller[_0x411d('0x31')]);router[_0x411d('0x2e')](_0x411d('0x21'),auth[_0x411d('0xa')](),controller['removeTags']);module[_0x411d('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 42ac092..beccba5 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 _0x8713=['sequelize','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8713,0x184));var _0x3871=function(_0x5fdb22,_0x24aaf9){_0x5fdb22=_0x5fdb22-0x0;var _0xaa6d7e=_0x8713[_0x5fdb22];return _0xaa6d7e;};'use strict';var Sequelize=require(_0x3871('0x0'));module[_0x3871('0x1')]={'body':{'type':Sequelize[_0x3871('0x2')](_0x3871('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4b39=['medium','BOOLEAN','sequelize','TEXT'];(function(_0x2dbe16,_0x13655b){var _0x3eb827=function(_0x3b3c87){while(--_0x3b3c87){_0x2dbe16['push'](_0x2dbe16['shift']());}};_0x3eb827(++_0x13655b);}(_0x4b39,0x116));var _0x94b3=function(_0x4e2d46,_0x199962){_0x4e2d46=_0x4e2d46-0x0;var _0x12f797=_0x4b39[_0x4e2d46];return _0x12f797;};'use strict';var Sequelize=require(_0x94b3('0x0'));module['exports']={'body':{'type':Sequelize[_0x94b3('0x1')](_0x94b3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x94b3('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 59465dc..41cba22 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 _0xda3d=['push','messages','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatInternalMessage','then','include','findAll','rows','show','includeAll','find','catch','create','body','params','createdAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xda3d,0x154));var _0xdda3=function(_0xd3381d,_0x6c6291){_0xd3381d=_0xd3381d-0x0;var _0x2fe10e=_0xda3d[_0xd3381d];return _0x2fe10e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda3('0x0'));var zipdir=require(_0xdda3('0x1'));var jsonpatch=require(_0xdda3('0x2'));var rp=require(_0xdda3('0x3'));var moment=require(_0xdda3('0x4'));var BPromise=require(_0xdda3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdda3('0x6'));var csv=require(_0xdda3('0x7'));var ejs=require(_0xdda3('0x8'));var fs=require('fs');var fs_extra=require(_0xdda3('0x9'));var _=require(_0xdda3('0xa'));var squel=require(_0xdda3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdda3('0xc'));var toCsv=require(_0xdda3('0x7'));var querystring=require(_0xdda3('0xd'));var Papa=require(_0xdda3('0xe'));var Redis=require(_0xdda3('0xf'));var authService=require(_0xdda3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdda3('0x11'));var hardwareService=require(_0xdda3('0x12'));var logger=require(_0xdda3('0x13'))(_0xdda3('0x14'));var utils=require(_0xdda3('0x15'));var config=require(_0xdda3('0x16'));var licenseUtil=require(_0xdda3('0x17'));var db=require(_0xdda3('0x18'))['db'];config[_0xdda3('0x19')]=_[_0xdda3('0x1a')](config[_0xdda3('0x19')],{'host':_0xdda3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdda3('0x19')]));require(_0xdda3('0x1c'))[_0xdda3('0x1d')](socket);function respondWithStatusCode(_0x36b832,_0x519eee){_0x519eee=_0x519eee||0xcc;return function(_0x5932c9){if(_0x5932c9){return _0x36b832[_0xdda3('0x1e')](_0x519eee);}return _0x36b832[_0xdda3('0x1f')](_0x519eee)[_0xdda3('0x20')]();};}function respondWithResult(_0x196dbf,_0x4ce646){_0x4ce646=_0x4ce646||0xc8;return function(_0x5d2000){if(_0x5d2000){return _0x196dbf[_0xdda3('0x1f')](_0x4ce646)['json'](_0x5d2000);}};}function respondWithFilteredResult(_0x53d576,_0x55ba24){return function(_0x48ee07){if(_0x48ee07){var _0xde3565=typeof _0x55ba24[_0xdda3('0x21')]===_0xdda3('0x22')&&typeof _0x55ba24[_0xdda3('0x23')]===_0xdda3('0x22');var _0x4d5000=_0x48ee07[_0xdda3('0x24')];var _0x1eab3a=_0xde3565?0x0:_0x55ba24[_0xdda3('0x21')];var _0xa6d4cd=_0xde3565?_0x48ee07[_0xdda3('0x24')]:_0x55ba24['offset']+_0x55ba24[_0xdda3('0x23')];var _0x2fe071;if(_0xa6d4cd>=_0x4d5000){_0xa6d4cd=_0x4d5000;_0x2fe071=0xc8;}else{_0x2fe071=0xce;}_0x53d576[_0xdda3('0x1f')](_0x2fe071);return _0x53d576[_0xdda3('0x25')](_0xdda3('0x26'),_0x1eab3a+'-'+_0xa6d4cd+'/'+_0x4d5000)['json'](_0x48ee07);}return null;};}function patchUpdates(_0x2bd683){return function(_0x491f99){try{jsonpatch['apply'](_0x491f99,_0x2bd683,!![]);}catch(_0x570c1a){return BPromise[_0xdda3('0x27')](_0x570c1a);}return _0x491f99[_0xdda3('0x28')]();};}function saveUpdates(_0x5a9b27,_0x4efe1c){return function(_0x17674b){if(_0x17674b){return _0x17674b[_0xdda3('0x29')](_0x5a9b27)['then'](function(_0x4a79b7){return _0x4a79b7;});}return null;};}function removeEntity(_0x24080a,_0x1ffb08){return function(_0x35a11e){if(_0x35a11e){return _0x35a11e[_0xdda3('0x2a')]()['then'](function(){_0x24080a[_0xdda3('0x1f')](0xcc)[_0xdda3('0x20')]();});}};}function handleEntityNotFound(_0x1cfe6a,_0x18059d){return function(_0x4ab970){if(!_0x4ab970){_0x1cfe6a['sendStatus'](0x194);}return _0x4ab970;};}function handleError(_0x3579d7,_0x193910){_0x193910=_0x193910||0x1f4;return function(_0x155d0e){logger[_0xdda3('0x2b')](_0x155d0e[_0xdda3('0x2c')]);if(_0x155d0e['name']){delete _0x155d0e[_0xdda3('0x2d')];}_0x3579d7[_0xdda3('0x1f')](_0x193910)['send'](_0x155d0e);};}exports[_0xdda3('0x2e')]=function(_0x17ae91,_0x5d3c8b){var _0x1ececc={},_0x3bcd43={},_0x7b7c25={'count':0x0,'rows':[]};var _0x5614d5=_[_0xdda3('0x2f')](db['ChatInternalMessage'][_0xdda3('0x30')],function(_0x543e8b){return{'name':_0x543e8b['fieldName'],'type':_0x543e8b[_0xdda3('0x31')]['key']};});_0x3bcd43['model']=_['map'](_0x5614d5,_0xdda3('0x2d'));_0x3bcd43[_0xdda3('0x32')]=_[_0xdda3('0x33')](_0x17ae91[_0xdda3('0x32')]);_0x3bcd43[_0xdda3('0x34')]=_[_0xdda3('0x35')](_0x3bcd43[_0xdda3('0x36')],_0x3bcd43[_0xdda3('0x32')]);_0x1ececc[_0xdda3('0x37')]=_[_0xdda3('0x35')](_0x3bcd43[_0xdda3('0x36')],qs[_0xdda3('0x38')](_0x17ae91['query'][_0xdda3('0x38')]));_0x1ececc[_0xdda3('0x37')]=_0x1ececc[_0xdda3('0x37')][_0xdda3('0x39')]?_0x1ececc['attributes']:_0x3bcd43[_0xdda3('0x36')];if(!_0x17ae91[_0xdda3('0x32')][_0xdda3('0x3a')](_0xdda3('0x3b'))){_0x1ececc[_0xdda3('0x23')]=qs['limit'](_0x17ae91[_0xdda3('0x32')][_0xdda3('0x23')]);_0x1ececc['offset']=qs[_0xdda3('0x21')](_0x17ae91[_0xdda3('0x32')]['offset']);}_0x1ececc[_0xdda3('0x3c')]=qs[_0xdda3('0x3d')](_0x17ae91[_0xdda3('0x32')][_0xdda3('0x3d')]);_0x1ececc[_0xdda3('0x3e')]=qs[_0xdda3('0x34')](_[_0xdda3('0x3f')](_0x17ae91['query'],_0x3bcd43[_0xdda3('0x34')]),_0x5614d5);if(_0x17ae91[_0xdda3('0x32')][_0xdda3('0x40')]){_0x1ececc['where']=_[_0xdda3('0x41')](_0x1ececc['where'],{'$or':_['map'](_0x5614d5,function(_0x2c67fd){if(_0x2c67fd['type']!=='VIRTUAL'){var _0x5d9208={};_0x5d9208[_0x2c67fd[_0xdda3('0x2d')]]={'$like':'%'+_0x17ae91[_0xdda3('0x32')]['filter']+'%'};return _0x5d9208;}})});}_0x1ececc=_['merge']({},_0x1ececc,_0x17ae91[_0xdda3('0x42')]);var _0xa16993={'where':_0x1ececc[_0xdda3('0x3e')]};return db[_0xdda3('0x43')][_0xdda3('0x24')](_0xa16993)[_0xdda3('0x44')](function(_0x3f93a5){_0x7b7c25[_0xdda3('0x24')]=_0x3f93a5;if(_0x17ae91[_0xdda3('0x32')]['includeAll']){_0x1ececc[_0xdda3('0x45')]=[{'all':!![]}];}return db[_0xdda3('0x43')][_0xdda3('0x46')](_0x1ececc);})['then'](function(_0x23d3ef){_0x7b7c25[_0xdda3('0x47')]=_0x23d3ef;return _0x7b7c25;})['then'](respondWithFilteredResult(_0x5d3c8b,_0x1ececc))['catch'](handleError(_0x5d3c8b,null));};exports[_0xdda3('0x48')]=function(_0x51f6d3,_0x483b85){var _0x357f9b={'raw':!![],'where':{'id':_0x51f6d3['params']['id']}},_0x16b601={};_0x16b601[_0xdda3('0x36')]=_['keys'](db['ChatInternalMessage'][_0xdda3('0x30')]);_0x16b601['query']=_[_0xdda3('0x33')](_0x51f6d3['query']);_0x16b601[_0xdda3('0x34')]=_[_0xdda3('0x35')](_0x16b601[_0xdda3('0x36')],_0x16b601[_0xdda3('0x32')]);_0x357f9b[_0xdda3('0x37')]=_[_0xdda3('0x35')](_0x16b601['model'],qs[_0xdda3('0x38')](_0x51f6d3[_0xdda3('0x32')]['fields']));_0x357f9b[_0xdda3('0x37')]=_0x357f9b[_0xdda3('0x37')][_0xdda3('0x39')]?_0x357f9b[_0xdda3('0x37')]:_0x16b601[_0xdda3('0x36')];if(_0x51f6d3[_0xdda3('0x32')][_0xdda3('0x49')]){_0x357f9b[_0xdda3('0x45')]=[{'all':!![]}];}_0x357f9b=_[_0xdda3('0x41')]({},_0x357f9b,_0x51f6d3['options']);return db[_0xdda3('0x43')][_0xdda3('0x4a')](_0x357f9b)[_0xdda3('0x44')](handleEntityNotFound(_0x483b85,null))[_0xdda3('0x44')](respondWithResult(_0x483b85,null))[_0xdda3('0x4b')](handleError(_0x483b85,null));};exports['create']=function(_0x467292,_0x345d2b){return db[_0xdda3('0x43')][_0xdda3('0x4c')](_0x467292[_0xdda3('0x4d')],{})[_0xdda3('0x44')](respondWithResult(_0x345d2b,0xc9))['catch'](handleError(_0x345d2b,null));};exports['update']=function(_0x3f3c2b,_0x2ce132){if(_0x3f3c2b[_0xdda3('0x4d')]['id']){delete _0x3f3c2b[_0xdda3('0x4d')]['id'];}return db[_0xdda3('0x43')][_0xdda3('0x4a')]({'where':{'id':_0x3f3c2b[_0xdda3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2ce132,null))['then'](saveUpdates(_0x3f3c2b[_0xdda3('0x4d')],null))[_0xdda3('0x44')](respondWithResult(_0x2ce132,null))[_0xdda3('0x4b')](handleError(_0x2ce132,null));};exports['destroy']=function(_0x4f4c79,_0x511489){return db['ChatInternalMessage'][_0xdda3('0x4a')]({'where':{'id':_0x4f4c79[_0xdda3('0x4e')]['id']}})[_0xdda3('0x44')](handleEntityNotFound(_0x511489,null))[_0xdda3('0x44')](removeEntity(_0x511489,null))[_0xdda3('0x4b')](handleError(_0x511489,null));};exports['describe']=function(_0x2f60a9,_0x41481){return db[_0xdda3('0x43')]['describe']()[_0xdda3('0x44')](respondWithResult(_0x41481,null))['catch'](handleError(_0x41481,null));};function wrapUser(_0x2df9fa){return function(_0x1819f8){var _0x2f7ddd=_0x2df9fa['get']({'plain':!![]});_0x2f7ddd['messages']=[];if(_0x1819f8){_0x2f7ddd['lastMessageAt']=_0x1819f8[_0xdda3('0x4f')];_0x2f7ddd[_0xdda3('0x50')]=_0x1819f8;}else{_0x2f7ddd['lastMessageAt']=moment(0x0)[_0xdda3('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f7ddd[_0xdda3('0x50')]={};}return _0x2f7ddd;};}exports[_0xdda3('0x52')]=function(_0x1d3be5,_0x44e8a4,_0x48b3d5){var _0x567f21=[];return db[_0xdda3('0x53')]['findAll']({'where':{'role':[_0xdda3('0x54'),_0xdda3('0x55'),_0xdda3('0x56')]},'attributes':['id',_0xdda3('0x57'),_0xdda3('0x2d'),_0xdda3('0x58'),_0xdda3('0x59'),_0xdda3('0x5a'),_0xdda3('0x5b'),_0xdda3('0x5c'),_0xdda3('0x5d'),'showWebBar'],'order':qs[_0xdda3('0x3d')]('-online'),'include':[{'model':db[_0xdda3('0x5e')],'as':'VoiceQueues','attributes':['id','name',_0xdda3('0x31')],'through':{'attributes':[]}}]})[_0xdda3('0x44')](function(_0x499d34){if(_0x499d34){var _0x90616e=_0x1d3be5[_0xdda3('0x56')][_0xdda3('0x5f')]({'plain':!![]});if(!_0x90616e)throw new Error(_0xdda3('0x60'));if(_0x90616e[_0xdda3('0x58')]===_0xdda3('0x56')){return db[_0xdda3('0x61')][_0xdda3('0x4a')]({'where':{'name':_0xdda3('0x62'),'userProfileId':_0x90616e[_0xdda3('0x63')]},'raw':!![]})[_0xdda3('0x44')](function(_0x29d4d0){if(_0x29d4d0){if(_0x29d4d0[_0xdda3('0x64')]===0x0){return db[_0xdda3('0x65')]['findAll']({'where':{'sectionId':_0x29d4d0['id']},'raw':!![]})['then'](function(_0x3745dd){var _0x4819ad=[];if(_[_0xdda3('0x66')](_0x3745dd)){_0x4819ad=_['filter'](_0x499d34,function(_0x40f8f9){if(_0x40f8f9['role']!==_0xdda3('0x54')){return _0x40f8f9;}});return _0x4819ad;}else{for(var _0x409af4=0x0;_0x409af4<_0x499d34[_0xdda3('0x39')];_0x409af4++){var _0x4f037f=_0x499d34[_0x409af4];if(_0x4f037f[_0xdda3('0x58')]===_0xdda3('0x54')){var _0x4224ec=_[_0xdda3('0x4a')](_0x3745dd,function(_0x55898a){return _0x55898a[_0xdda3('0x67')]===_0x4f037f['id'];});if(_0x4224ec)_0x4819ad[_0xdda3('0x68')](_0x4f037f);}else{_0x4819ad[_0xdda3('0x68')](_0x4f037f);}}return _0x4819ad;}});}else{return _0x499d34;}}else{var _0x5bfed3=_[_0xdda3('0x40')](_0x499d34,function(_0x430735){if(_0x430735[_0xdda3('0x58')]!=='agent'){return _0x430735;}});return _0x5bfed3;}});}else{return _0x499d34;}}})['then'](function(_0x4758ae){var _0x27eb75=[];if(_0x4758ae){_0x567f21=_0x4758ae;for(var _0x2dc006=0x0;_0x2dc006<_0x4758ae[_0xdda3('0x39')];_0x2dc006+=0x1){_0x567f21[_0x2dc006][_0xdda3('0x69')]=[];_0x27eb75[_0xdda3('0x68')](db[_0xdda3('0x43')][_0xdda3('0x4a')]({'where':{'FromId':[_0x1d3be5['user']['id'],_0x4758ae[_0x2dc006]['id']],'ToId':[_0x1d3be5[_0xdda3('0x56')]['id'],_0x4758ae[_0x2dc006]['id']],'ChatGroupId':null},'attributes':['id',_0xdda3('0x4f'),_0xdda3('0x6a'),_0xdda3('0x6b'),_0xdda3('0x6c'),_0xdda3('0x4d')],'order':qs[_0xdda3('0x3d')](_0xdda3('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdda3('0x44')](wrapUser(_0x4758ae[_0x2dc006])));}return BPromise[_0xdda3('0x6e')](_0x27eb75);}return[];})[_0xdda3('0x44')](function(_0x428a82){return{'rows':_0x428a82,'count':_0x428a82['length']};})[_0xdda3('0x44')](respondWithResult(_0x44e8a4,null))[_0xdda3('0x4b')](handleError(_0x44e8a4,null));}; \ No newline at end of file +var _0xa238=['find','catch','create','body','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','user','fullname','role','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','offset','limit','undefined','Content-Range','apply','update','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','then','rows','params'];(function(_0x5207a2,_0x316913){var _0x314716=function(_0x2ca663){while(--_0x2ca663){_0x5207a2['push'](_0x5207a2['shift']());}};_0x314716(++_0x316913);}(_0xa238,0x156));var _0x8a23=function(_0x1faa29,_0x4192ad){_0x1faa29=_0x1faa29-0x0;var _0x2b75ee=_0xa238[_0x1faa29];return _0x2b75ee;};'use strict';var emlformat=require(_0x8a23('0x0'));var rimraf=require(_0x8a23('0x1'));var zipdir=require(_0x8a23('0x2'));var jsonpatch=require(_0x8a23('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8a23('0x4'));var util=require(_0x8a23('0x5'));var path=require(_0x8a23('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8a23('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a23('0x8'));var squel=require(_0x8a23('0x9'));var crypto=require(_0x8a23('0xa'));var jsforce=require(_0x8a23('0xb'));var deskjs=require(_0x8a23('0xc'));var toCsv=require(_0x8a23('0xd'));var querystring=require(_0x8a23('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8a23('0xf'));var qs=require(_0x8a23('0x10'));var as=require(_0x8a23('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a23('0x12'))('api');var utils=require(_0x8a23('0x13'));var config=require(_0x8a23('0x14'));var licenseUtil=require(_0x8a23('0x15'));var db=require(_0x8a23('0x16'))['db'];config[_0x8a23('0x17')]=_[_0x8a23('0x18')](config[_0x8a23('0x17')],{'host':_0x8a23('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a23('0x17')]));require(_0x8a23('0x1a'))[_0x8a23('0x1b')](socket);function respondWithStatusCode(_0x86e4de,_0x39e8e0){_0x39e8e0=_0x39e8e0||0xcc;return function(_0x7e1100){if(_0x7e1100){return _0x86e4de[_0x8a23('0x1c')](_0x39e8e0);}return _0x86e4de['status'](_0x39e8e0)[_0x8a23('0x1d')]();};}function respondWithResult(_0x53e107,_0x20caf2){_0x20caf2=_0x20caf2||0xc8;return function(_0x3811f7){if(_0x3811f7){return _0x53e107[_0x8a23('0x1e')](_0x20caf2)['json'](_0x3811f7);}};}function respondWithFilteredResult(_0x516b6f,_0x3e9909){return function(_0x5d3d96){if(_0x5d3d96){var _0x3d1493=typeof _0x3e9909[_0x8a23('0x1f')]==='undefined'&&typeof _0x3e9909[_0x8a23('0x20')]===_0x8a23('0x21');var _0x5cab94=_0x5d3d96['count'];var _0x4d4f2f=_0x3d1493?0x0:_0x3e9909['offset'];var _0x54c155=_0x3d1493?_0x5d3d96['count']:_0x3e9909[_0x8a23('0x1f')]+_0x3e9909[_0x8a23('0x20')];var _0x12dd57;if(_0x54c155>=_0x5cab94){_0x54c155=_0x5cab94;_0x12dd57=0xc8;}else{_0x12dd57=0xce;}_0x516b6f['status'](_0x12dd57);return _0x516b6f['set'](_0x8a23('0x22'),_0x4d4f2f+'-'+_0x54c155+'/'+_0x5cab94)['json'](_0x5d3d96);}return null;};}function patchUpdates(_0x220f88){return function(_0x3b125d){try{jsonpatch[_0x8a23('0x23')](_0x3b125d,_0x220f88,!![]);}catch(_0x464d66){return BPromise['reject'](_0x464d66);}return _0x3b125d['save']();};}function saveUpdates(_0x200b81,_0x3d06a2){return function(_0x1df3ec){if(_0x1df3ec){return _0x1df3ec[_0x8a23('0x24')](_0x200b81)['then'](function(_0x4faf1c){return _0x4faf1c;});}return null;};}function removeEntity(_0x42c158,_0x2e2751){return function(_0x261f8c){if(_0x261f8c){return _0x261f8c['destroy']()['then'](function(){_0x42c158[_0x8a23('0x1e')](0xcc)[_0x8a23('0x1d')]();});}};}function handleEntityNotFound(_0x39fa38,_0x73fdf7){return function(_0x51488c){if(!_0x51488c){_0x39fa38[_0x8a23('0x1c')](0x194);}return _0x51488c;};}function handleError(_0x5181fd,_0x3a3950){_0x3a3950=_0x3a3950||0x1f4;return function(_0x599bb5){logger[_0x8a23('0x25')](_0x599bb5[_0x8a23('0x26')]);if(_0x599bb5[_0x8a23('0x27')]){delete _0x599bb5[_0x8a23('0x27')];}_0x5181fd[_0x8a23('0x1e')](_0x3a3950)[_0x8a23('0x28')](_0x599bb5);};}exports[_0x8a23('0x29')]=function(_0xd8e477,_0x1f43fc){var _0x342d57={},_0x55f867={},_0x186d27={'count':0x0,'rows':[]};var _0x1e154b=_[_0x8a23('0x2a')](db[_0x8a23('0x2b')][_0x8a23('0x2c')],function(_0x3120b8){return{'name':_0x3120b8['fieldName'],'type':_0x3120b8[_0x8a23('0x2d')]['key']};});_0x55f867['model']=_['map'](_0x1e154b,'name');_0x55f867[_0x8a23('0x2e')]=_[_0x8a23('0x2f')](_0xd8e477[_0x8a23('0x2e')]);_0x55f867['filters']=_[_0x8a23('0x30')](_0x55f867['model'],_0x55f867['query']);_0x342d57[_0x8a23('0x31')]=_['intersection'](_0x55f867[_0x8a23('0x32')],qs[_0x8a23('0x33')](_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x33')]));_0x342d57[_0x8a23('0x31')]=_0x342d57[_0x8a23('0x31')][_0x8a23('0x34')]?_0x342d57[_0x8a23('0x31')]:_0x55f867[_0x8a23('0x32')];if(!_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x35')]('nolimit')){_0x342d57[_0x8a23('0x20')]=qs['limit'](_0xd8e477[_0x8a23('0x2e')]['limit']);_0x342d57[_0x8a23('0x1f')]=qs[_0x8a23('0x1f')](_0xd8e477[_0x8a23('0x2e')]['offset']);}_0x342d57[_0x8a23('0x36')]=qs[_0x8a23('0x37')](_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x37')]);_0x342d57[_0x8a23('0x38')]=qs[_0x8a23('0x39')](_[_0x8a23('0x3a')](_0xd8e477[_0x8a23('0x2e')],_0x55f867[_0x8a23('0x39')]),_0x1e154b);if(_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x3b')]){_0x342d57[_0x8a23('0x38')]=_[_0x8a23('0x3c')](_0x342d57[_0x8a23('0x38')],{'$or':_[_0x8a23('0x2a')](_0x1e154b,function(_0x2a6448){if(_0x2a6448[_0x8a23('0x2d')]!==_0x8a23('0x3d')){var _0x3e33d8={};_0x3e33d8[_0x2a6448[_0x8a23('0x27')]]={'$like':'%'+_0xd8e477[_0x8a23('0x2e')]['filter']+'%'};return _0x3e33d8;}})});}_0x342d57=_['merge']({},_0x342d57,_0xd8e477[_0x8a23('0x3e')]);var _0x2e9366={'where':_0x342d57['where']};return db[_0x8a23('0x2b')][_0x8a23('0x3f')](_0x2e9366)['then'](function(_0x1b0148){_0x186d27[_0x8a23('0x3f')]=_0x1b0148;if(_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x40')]){_0x342d57[_0x8a23('0x41')]=[{'all':!![]}];}return db[_0x8a23('0x2b')][_0x8a23('0x42')](_0x342d57);})[_0x8a23('0x43')](function(_0x586d8e){_0x186d27[_0x8a23('0x44')]=_0x586d8e;return _0x186d27;})[_0x8a23('0x43')](respondWithFilteredResult(_0x1f43fc,_0x342d57))['catch'](handleError(_0x1f43fc,null));};exports['show']=function(_0x58441d,_0x591dfe){var _0x581989={'raw':!![],'where':{'id':_0x58441d[_0x8a23('0x45')]['id']}},_0x3279a7={};_0x3279a7[_0x8a23('0x32')]=_['keys'](db[_0x8a23('0x2b')]['rawAttributes']);_0x3279a7[_0x8a23('0x2e')]=_['keys'](_0x58441d[_0x8a23('0x2e')]);_0x3279a7['filters']=_[_0x8a23('0x30')](_0x3279a7[_0x8a23('0x32')],_0x3279a7[_0x8a23('0x2e')]);_0x581989[_0x8a23('0x31')]=_[_0x8a23('0x30')](_0x3279a7[_0x8a23('0x32')],qs[_0x8a23('0x33')](_0x58441d[_0x8a23('0x2e')][_0x8a23('0x33')]));_0x581989[_0x8a23('0x31')]=_0x581989['attributes'][_0x8a23('0x34')]?_0x581989[_0x8a23('0x31')]:_0x3279a7[_0x8a23('0x32')];if(_0x58441d[_0x8a23('0x2e')][_0x8a23('0x40')]){_0x581989[_0x8a23('0x41')]=[{'all':!![]}];}_0x581989=_[_0x8a23('0x3c')]({},_0x581989,_0x58441d['options']);return db['ChatInternalMessage'][_0x8a23('0x46')](_0x581989)[_0x8a23('0x43')](handleEntityNotFound(_0x591dfe,null))[_0x8a23('0x43')](respondWithResult(_0x591dfe,null))[_0x8a23('0x47')](handleError(_0x591dfe,null));};exports[_0x8a23('0x48')]=function(_0x55f2c2,_0x2f3bea){return db[_0x8a23('0x2b')][_0x8a23('0x48')](_0x55f2c2[_0x8a23('0x49')],{})['then'](respondWithResult(_0x2f3bea,0xc9))[_0x8a23('0x47')](handleError(_0x2f3bea,null));};exports[_0x8a23('0x24')]=function(_0xdba9f1,_0x18fdb0){if(_0xdba9f1[_0x8a23('0x49')]['id']){delete _0xdba9f1['body']['id'];}return db['ChatInternalMessage'][_0x8a23('0x46')]({'where':{'id':_0xdba9f1[_0x8a23('0x45')]['id']}})[_0x8a23('0x43')](handleEntityNotFound(_0x18fdb0,null))[_0x8a23('0x43')](saveUpdates(_0xdba9f1[_0x8a23('0x49')],null))[_0x8a23('0x43')](respondWithResult(_0x18fdb0,null))[_0x8a23('0x47')](handleError(_0x18fdb0,null));};exports['destroy']=function(_0x4ca922,_0x520b99){return db[_0x8a23('0x2b')]['find']({'where':{'id':_0x4ca922[_0x8a23('0x45')]['id']}})['then'](handleEntityNotFound(_0x520b99,null))['then'](removeEntity(_0x520b99,null))[_0x8a23('0x47')](handleError(_0x520b99,null));};exports[_0x8a23('0x4a')]=function(_0x3b4176,_0x104268){return db[_0x8a23('0x2b')][_0x8a23('0x4a')]()[_0x8a23('0x43')](respondWithResult(_0x104268,null))[_0x8a23('0x47')](handleError(_0x104268,null));};function wrapUser(_0x500925){return function(_0x1aa15c){var _0x233427=_0x500925[_0x8a23('0x4b')]({'plain':!![]});_0x233427['messages']=[];if(_0x1aa15c){_0x233427[_0x8a23('0x4c')]=_0x1aa15c[_0x8a23('0x4d')];_0x233427['lastMessage']=_0x1aa15c;}else{_0x233427[_0x8a23('0x4c')]=moment(0x0)[_0x8a23('0x4e')](_0x8a23('0x4f'));_0x233427[_0x8a23('0x50')]={};}return _0x233427;};}exports['getUsers']=function(_0x40295f,_0x2de5ba,_0x504a44){var _0x4a9402=[];return db[_0x8a23('0x51')]['findAll']({'where':{'role':['agent','admin',_0x8a23('0x52')]},'attributes':['id',_0x8a23('0x53'),_0x8a23('0x27'),_0x8a23('0x54'),'userpic',_0x8a23('0x55'),_0x8a23('0x56'),_0x8a23('0x57'),'allowmessenger',_0x8a23('0x58')],'order':qs['sort'](_0x8a23('0x59')),'include':[{'model':db[_0x8a23('0x5a')],'as':'VoiceQueues','attributes':['id',_0x8a23('0x27'),'type'],'through':{'attributes':[]}}]})['then'](function(_0xafb015){if(_0xafb015){var _0x30766a=_0x40295f[_0x8a23('0x52')]['get']({'plain':!![]});if(!_0x30766a)throw new Error(_0x8a23('0x5b'));if(_0x30766a[_0x8a23('0x54')]===_0x8a23('0x52')){return db[_0x8a23('0x5c')][_0x8a23('0x46')]({'where':{'name':'Agents','userProfileId':_0x30766a[_0x8a23('0x5d')]},'raw':!![]})[_0x8a23('0x43')](function(_0x25536c){if(_0x25536c){if(_0x25536c[_0x8a23('0x5e')]===0x0){return db[_0x8a23('0x5f')][_0x8a23('0x42')]({'where':{'sectionId':_0x25536c['id']},'raw':!![]})['then'](function(_0x163300){var _0x3dd53d=[];if(_[_0x8a23('0x60')](_0x163300)){_0x3dd53d=_[_0x8a23('0x3b')](_0xafb015,function(_0x147889){if(_0x147889[_0x8a23('0x54')]!==_0x8a23('0x61')){return _0x147889;}});return _0x3dd53d;}else{for(var _0x346a0a=0x0;_0x346a0a<_0xafb015[_0x8a23('0x34')];_0x346a0a++){var _0x13053a=_0xafb015[_0x346a0a];if(_0x13053a['role']===_0x8a23('0x61')){var _0x4bd905=_[_0x8a23('0x46')](_0x163300,function(_0x36413a){return _0x36413a['resourceId']===_0x13053a['id'];});if(_0x4bd905)_0x3dd53d[_0x8a23('0x62')](_0x13053a);}else{_0x3dd53d[_0x8a23('0x62')](_0x13053a);}}return _0x3dd53d;}});}else{return _0xafb015;}}else{var _0x27bf32=_['filter'](_0xafb015,function(_0x5402f5){if(_0x5402f5[_0x8a23('0x54')]!==_0x8a23('0x61')){return _0x5402f5;}});return _0x27bf32;}});}else{return _0xafb015;}}})[_0x8a23('0x43')](function(_0x23b249){var _0x5e152f=[];if(_0x23b249){_0x4a9402=_0x23b249;for(var _0x419ee7=0x0;_0x419ee7<_0x23b249['length'];_0x419ee7+=0x1){_0x4a9402[_0x419ee7]['messages']=[];_0x5e152f['push'](db[_0x8a23('0x2b')][_0x8a23('0x46')]({'where':{'FromId':[_0x40295f[_0x8a23('0x52')]['id'],_0x23b249[_0x419ee7]['id']],'ToId':[_0x40295f[_0x8a23('0x52')]['id'],_0x23b249[_0x419ee7]['id']],'ChatGroupId':null},'attributes':['id',_0x8a23('0x4d'),_0x8a23('0x63'),_0x8a23('0x64'),_0x8a23('0x65'),_0x8a23('0x49')],'order':qs[_0x8a23('0x37')](_0x8a23('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8a23('0x43')](wrapUser(_0x23b249[_0x419ee7])));}return BPromise['all'](_0x5e152f);}return[];})[_0x8a23('0x43')](function(_0x53b162){return{'rows':_0x53b162,'count':_0x53b162[_0x8a23('0x34')]};})[_0x8a23('0x43')](respondWithResult(_0x2de5ba,null))[_0x8a23('0x47')](handleError(_0x2de5ba,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 129e823..52a8237 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 _0x96ab=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x96ab,0x146));var _0xb96a=function(_0x556fcf,_0xf09f41){_0x556fcf=_0x556fcf-0x0;var _0x5d8ace=_0x96ab[_0x556fcf];return _0x5d8ace;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xb96a('0x0'))['db'][_0xb96a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb96a('0x2')](0x0);var events={'afterCreate':_0xb96a('0x3'),'afterUpdate':_0xb96a('0x4'),'afterDestroy':_0xb96a('0x5')};function emitEvent(_0x13809c){return function(_0x52e7be,_0x360ef4,_0xbe5590){ChatInternalMessageEvents[_0xb96a('0x6')](_0x13809c+':'+_0x52e7be['id'],_0x52e7be);ChatInternalMessageEvents[_0xb96a('0x6')](_0x13809c,_0x52e7be);_0xbe5590(null);};}for(var e in events){if(events[_0xb96a('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb96a('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xda3c=['exports','events','../../mysqldb','ChatInternalMessage','save','emit'];(function(_0x512b27,_0x55c73b){var _0x2ad648=function(_0xe0b23b){while(--_0xe0b23b){_0x512b27['push'](_0x512b27['shift']());}};_0x2ad648(++_0x55c73b);}(_0xda3c,0x163));var _0xcda3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xda3c[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xcda3('0x0'));var ChatInternalMessage=require(_0xcda3('0x1'))['db'][_0xcda3('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcda3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x6138c7){return function(_0x160679,_0x667e22,_0x158d25){ChatInternalMessageEvents[_0xcda3('0x4')](_0x6138c7+':'+_0x160679['id'],_0x160679);ChatInternalMessageEvents['emit'](_0x6138c7,_0x160679);_0x158d25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xcda3('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 22c7527..e69017e 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 _0x2a7d=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1a8b07,_0x492d7c){var _0x13813e=function(_0x18a2dd){while(--_0x18a2dd){_0x1a8b07['push'](_0x1a8b07['shift']());}};_0x13813e(++_0x492d7c);}(_0x2a7d,0x121));var _0xd2a7=function(_0x3af7ef,_0x5444ec){_0x3af7ef=_0x3af7ef-0x0;var _0x5cffcc=_0x2a7d[_0x3af7ef];return _0x5cffcc;};'use strict';var _=require('lodash');var util=require(_0xd2a7('0x0'));var logger=require(_0xd2a7('0x1'))(_0xd2a7('0x2'));var moment=require('moment');var BPromise=require(_0xd2a7('0x3'));var rp=require(_0xd2a7('0x4'));var fs=require('fs');var path=require(_0xd2a7('0x5'));var rimraf=require(_0xd2a7('0x6'));var config=require(_0xd2a7('0x7'));var attributes=require(_0xd2a7('0x8'));module['exports']=function(_0x4f3746,_0xe540dc){return _0x4f3746[_0xd2a7('0x9')](_0xd2a7('0xa'),attributes,{'tableName':_0xd2a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd2a7('0xc'),'collate':_0xd2a7('0xd')});}; \ No newline at end of file +var _0xe2a0=['utf8mb4','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','chat_internal_messages'];(function(_0x90c1e4,_0xbe318d){var _0x4ea509=function(_0x57a680){while(--_0x57a680){_0x90c1e4['push'](_0x90c1e4['shift']());}};_0x4ea509(++_0xbe318d);}(_0xe2a0,0x1c3));var _0x0e2a=function(_0x1c324d,_0x2daa7c){_0x1c324d=_0x1c324d-0x0;var _0x33347f=_0xe2a0[_0x1c324d];return _0x33347f;};'use strict';var _=require(_0x0e2a('0x0'));var util=require('util');var logger=require(_0x0e2a('0x1'))(_0x0e2a('0x2'));var moment=require(_0x0e2a('0x3'));var BPromise=require(_0x0e2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e2a('0x5'));var config=require(_0x0e2a('0x6'));var attributes=require(_0x0e2a('0x7'));module['exports']=function(_0xd3e39,_0x2906b5){return _0xd3e39['define']('ChatInternalMessage',attributes,{'tableName':_0x0e2a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0e2a('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 74dbbf0..3162c86 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 _0xb66b=['info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x55bdd7,_0x3ddd0a){var _0xb5101=function(_0x476d59){while(--_0x476d59){_0x55bdd7['push'](_0x55bdd7['shift']());}};_0xb5101(++_0x3ddd0a);}(_0xb66b,0x1a7));var _0xbb66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb66b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb66('0x0'));var util=require('util');var moment=require(_0xbb66('0x1'));var BPromise=require(_0xbb66('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb66('0x3'));var db=require(_0xbb66('0x4'))['db'];var utils=require(_0xbb66('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xbb66('0x6'));var jayson=require(_0xbb66('0x7'));var client=jayson[_0xbb66('0x8')][_0xbb66('0x9')]({'port':0x232a});config['redis']=_[_0xbb66('0xa')](config[_0xbb66('0xb')],{'host':_0xbb66('0xc'),'port':0x18eb});var socket=require(_0xbb66('0xd'))(new Redis(config[_0xbb66('0xb')]));require(_0xbb66('0xe'))[_0xbb66('0xf')](socket);function respondWithRpcPromise(_0x5e6861,_0x4558a6,_0x2dfef8){return new BPromise(function(_0x139565,_0x525432){return client[_0xbb66('0x10')](_0x5e6861,_0x2dfef8)['then'](function(_0x3040d8){logger['info'](_0xbb66('0x11'),_0x4558a6,_0xbb66('0x12'));logger[_0xbb66('0x13')](_0xbb66('0x14'),_0x4558a6,_0xbb66('0x12'),JSON[_0xbb66('0x15')](_0x3040d8));if(_0x3040d8[_0xbb66('0x16')]){if(_0x3040d8['error'][_0xbb66('0x17')]===0x1f4){logger[_0xbb66('0x16')](_0xbb66('0x11'),_0x4558a6,_0x3040d8[_0xbb66('0x16')][_0xbb66('0x18')]);return _0x525432(_0x3040d8[_0xbb66('0x16')][_0xbb66('0x18')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4558a6,_0x3040d8['error'][_0xbb66('0x18')]);return _0x139565(_0x3040d8[_0xbb66('0x16')]['message']);}else{logger[_0xbb66('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x4558a6,'request\x20sent');_0x139565(_0x3040d8[_0xbb66('0x1a')]['message']);}})[_0xbb66('0x1b')](function(_0x7838e5){logger[_0xbb66('0x16')](_0xbb66('0x11'),_0x4558a6,_0x7838e5);_0x525432(_0x7838e5);});});} \ No newline at end of file +var _0xd22b=['ChatInternalMessage,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x18fe46,_0x47a2b0){var _0x27c44d=function(_0x1b9e59){while(--_0x1b9e59){_0x18fe46['push'](_0x18fe46['shift']());}};_0x27c44d(++_0x47a2b0);}(_0xd22b,0x11b));var _0xbd22=function(_0x6d0d1e,_0x5f584b){_0x6d0d1e=_0x6d0d1e-0x0;var _0x285729=_0xd22b[_0x6d0d1e];return _0x285729;};'use strict';var _=require(_0xbd22('0x0'));var util=require(_0xbd22('0x1'));var moment=require(_0xbd22('0x2'));var BPromise=require(_0xbd22('0x3'));var rs=require(_0xbd22('0x4'));var fs=require('fs');var Redis=require(_0xbd22('0x5'));var db=require(_0xbd22('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd22('0x7'))('rpc');var config=require(_0xbd22('0x8'));var jayson=require(_0xbd22('0x9'));var client=jayson[_0xbd22('0xa')][_0xbd22('0xb')]({'port':0x232a});config[_0xbd22('0xc')]=_[_0xbd22('0xd')](config[_0xbd22('0xc')],{'host':_0xbd22('0xe'),'port':0x18eb});var socket=require(_0xbd22('0xf'))(new Redis(config[_0xbd22('0xc')]));require(_0xbd22('0x10'))[_0xbd22('0x11')](socket);function respondWithRpcPromise(_0x3f8c09,_0x351d96,_0xd99fc4){return new BPromise(function(_0x1a4973,_0x192b81){return client[_0xbd22('0x12')](_0x3f8c09,_0xd99fc4)[_0xbd22('0x13')](function(_0x415cd8){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x351d96,'request\x20sent');logger[_0xbd22('0x14')](_0xbd22('0x15'),_0x351d96,_0xbd22('0x16'),JSON[_0xbd22('0x17')](_0x415cd8));if(_0x415cd8[_0xbd22('0x18')]){if(_0x415cd8[_0xbd22('0x18')][_0xbd22('0x19')]===0x1f4){logger[_0xbd22('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x351d96,_0x415cd8[_0xbd22('0x18')][_0xbd22('0x1a')]);return _0x192b81(_0x415cd8[_0xbd22('0x18')][_0xbd22('0x1a')]);}logger[_0xbd22('0x18')](_0xbd22('0x1b'),_0x351d96,_0x415cd8[_0xbd22('0x18')][_0xbd22('0x1a')]);return _0x1a4973(_0x415cd8['error'][_0xbd22('0x1a')]);}else{logger[_0xbd22('0x1c')](_0xbd22('0x1b'),_0x351d96,_0xbd22('0x16'));_0x1a4973(_0x415cd8[_0xbd22('0x1d')][_0xbd22('0x1a')]);}})[_0xbd22('0x1e')](function(_0x319f13){logger['error'](_0xbd22('0x1b'),_0x351d96,_0x319f13);_0x192b81(_0x319f13);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4e947ea..1757402 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 _0x8e2e=['./chatInternalMessage.events','update','removeListener','register','length','chatInternalMessage:'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0x8e2e,0xb4));var _0xe8e2=function(_0x321d5e,_0x1ae4a9){_0x321d5e=_0x321d5e-0x0;var _0x3458cd=_0x8e2e[_0x321d5e];return _0x3458cd;};'use strict';var ChatInternalMessageEvents=require(_0xe8e2('0x0'));var events=['save','remove',_0xe8e2('0x1')];function createListener(_0x5c566e,_0x10e9eb){return function(_0x8d944a){_0x10e9eb['emit'](_0x5c566e,_0x8d944a);};}function removeListener(_0x2ee229,_0x500757){return function(){ChatInternalMessageEvents[_0xe8e2('0x2')](_0x2ee229,_0x500757);};}exports[_0xe8e2('0x3')]=function(_0x472d7e){for(var _0x246c64=0x0,_0x11634e=events[_0xe8e2('0x4')];_0x246c64<_0x11634e;_0x246c64++){var _0x4ce58e=events[_0x246c64];var _0x4efbda=createListener(_0xe8e2('0x5')+_0x4ce58e,_0x472d7e);ChatInternalMessageEvents['on'](_0x4ce58e,_0x4efbda);}}; \ No newline at end of file +var _0xda1a=['./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0xda1a,0x1b9));var _0xada1=function(_0x16b852,_0x174214){_0x16b852=_0x16b852-0x0;var _0xc6653a=_0xda1a[_0x16b852];return _0xc6653a;};'use strict';var ChatInternalMessageEvents=require(_0xada1('0x0'));var events=[_0xada1('0x1'),_0xada1('0x2'),_0xada1('0x3')];function createListener(_0x50e141,_0x6f6285){return function(_0x41800d){_0x6f6285[_0xada1('0x4')](_0x50e141,_0x41800d);};}function removeListener(_0x430942,_0x3589dd){return function(){ChatInternalMessageEvents[_0xada1('0x5')](_0x430942,_0x3589dd);};}exports[_0xada1('0x6')]=function(_0x5c2e3b){for(var _0x56f11c=0x0,_0x1a93c5=events[_0xada1('0x7')];_0x56f11c<_0x1a93c5;_0x56f11c++){var _0x105c66=events[_0x56f11c];var _0x330bb8=createListener(_0xada1('0x8')+_0x105c66,_0x5c2e3b);ChatInternalMessageEvents['on'](_0x105c66,_0x330bb8);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 01ceb03..ea161f6 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 _0x1ca6=['/:id','show','post','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x5620aa,_0x417f7e){var _0xf0f3ad=function(_0x141e30){while(--_0x141e30){_0x5620aa['push'](_0x5620aa['shift']());}};_0xf0f3ad(++_0x417f7e);}(_0x1ca6,0x97));var _0x61ca=function(_0x1c8412,_0x15456e){_0x1c8412=_0x1c8412-0x0;var _0xf0f5f1=_0x1ca6[_0x1c8412];return _0xf0f5f1;};'use strict';var multer=require(_0x61ca('0x0'));var util=require(_0x61ca('0x1'));var path=require(_0x61ca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x61ca('0x3')]();var fs_extra=require(_0x61ca('0x4'));var auth=require(_0x61ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x61ca('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x61ca('0x7')]('/',auth[_0x61ca('0x8')](),controller['index']);router[_0x61ca('0x7')](_0x61ca('0x9'),auth[_0x61ca('0x8')](),controller[_0x61ca('0xa')]);router[_0x61ca('0x7')]('/users',auth[_0x61ca('0x8')](),controller['getUsers']);router[_0x61ca('0x7')](_0x61ca('0xb'),auth[_0x61ca('0x8')](),controller[_0x61ca('0xc')]);router[_0x61ca('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x61ca('0xe')]('/:id',controller[_0x61ca('0xf')]);router[_0x61ca('0x10')]('/:id',auth[_0x61ca('0x8')](),controller['destroy']);module[_0x61ca('0x11')]=router; \ No newline at end of file +var _0x5cac=['getUsers','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/users'];(function(_0x2f1e82,_0x50bf3a){var _0x4bc038=function(_0x436dbb){while(--_0x436dbb){_0x2f1e82['push'](_0x2f1e82['shift']());}};_0x4bc038(++_0x50bf3a);}(_0x5cac,0x182));var _0xc5ca=function(_0x3b558e,_0x6d6aeb){_0x3b558e=_0x3b558e-0x0;var _0x178be9=_0x5cac[_0x3b558e];return _0x178be9;};'use strict';var multer=require(_0xc5ca('0x0'));var util=require(_0xc5ca('0x1'));var path=require(_0xc5ca('0x2'));var timeout=require(_0xc5ca('0x3'));var express=require('express');var router=express[_0xc5ca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc5ca('0x5'));var interaction=require(_0xc5ca('0x6'));var config=require(_0xc5ca('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0xc5ca('0x8')](),controller[_0xc5ca('0x9')]);router['get'](_0xc5ca('0xa'),auth['isAuthenticated'](),controller[_0xc5ca('0xb')]);router[_0xc5ca('0xc')](_0xc5ca('0xd'),auth[_0xc5ca('0x8')](),controller[_0xc5ca('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc5ca('0xf')](_0xc5ca('0x10'),controller['update']);router[_0xc5ca('0x11')]('/:id',auth[_0xc5ca('0x8')](),controller[_0xc5ca('0x12')]);module[_0xc5ca('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 0383eb9..9e2ea58 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 _0x8a5c=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x1adff8,_0x283cc1){var _0x3483d8=function(_0x56b79d){while(--_0x56b79d){_0x1adff8['push'](_0x1adff8['shift']());}};_0x3483d8(++_0x283cc1);}(_0x8a5c,0x136));var _0xc8a5=function(_0x417485,_0x431bb3){_0x417485=_0x417485-0x0;var _0x2ef6fd=_0x8a5c[_0x417485];return _0x2ef6fd;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'body':{'type':Sequelize[_0xc8a5('0x2')](_0xc8a5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc8a5('0x5')]('in',_0xc8a5('0x6')),'defaultValue':_0xc8a5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc8a5('0x7')]},'providerResponse':{'type':Sequelize[_0xc8a5('0x2')]}}; \ No newline at end of file +var _0x0b0e=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x0b0e[_0x4de1b1];return _0x639f27;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0b0('0x3')]('in',_0xe0b0('0x4')),'defaultValue':_0xe0b0('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe0b0('0x5')]},'providerName':{'type':Sequelize[_0xe0b0('0x6')]},'providerResponse':{'type':Sequelize[_0xe0b0('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index f59fe8c..ba08c9c 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 _0x3971=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','internal','reject','rejectmessage','formData','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x45f2ed,_0x1b9102){var _0x121587=function(_0x3d274c){while(--_0x3d274c){_0x45f2ed['push'](_0x45f2ed['shift']());}};_0x121587(++_0x1b9102);}(_0x3971,0x146));var _0x1397=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x3971[_0x4358f5];return _0x4d8104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1397('0x0'));var zipdir=require(_0x1397('0x1'));var jsonpatch=require(_0x1397('0x2'));var rp=require(_0x1397('0x3'));var moment=require(_0x1397('0x4'));var BPromise=require(_0x1397('0x5'));var Mustache=require(_0x1397('0x6'));var util=require('util');var path=require(_0x1397('0x7'));var sox=require(_0x1397('0x8'));var csv=require(_0x1397('0x9'));var ejs=require(_0x1397('0xa'));var fs=require('fs');var fs_extra=require(_0x1397('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1397('0xc'));var jsforce=require(_0x1397('0xd'));var deskjs=require(_0x1397('0xe'));var toCsv=require(_0x1397('0x9'));var querystring=require('querystring');var Papa=require(_0x1397('0xf'));var Redis=require('ioredis');var authService=require(_0x1397('0x10'));var qs=require(_0x1397('0x11'));var as=require(_0x1397('0x12'));var hardwareService=require(_0x1397('0x13'));var logger=require(_0x1397('0x14'))(_0x1397('0x15'));var utils=require(_0x1397('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1397('0x17'));var db=require('../../mysqldb')['db'];config[_0x1397('0x18')]=_['defaults'](config[_0x1397('0x18')],{'host':_0x1397('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1397('0x18')]));require('./chatMessage.socket')[_0x1397('0x1a')](socket);var jayson=require(_0x1397('0x1b'));var client=jayson[_0x1397('0x1c')][_0x1397('0x1d')]({'port':0x232c});var client9002=jayson[_0x1397('0x1c')][_0x1397('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x51b078,_0x14c526,_0x3b4a10,_0x4344a2){return new BPromise(function(_0x12ace7,_0x425eca){var _0x515488=_0x4344a2||client;return _0x515488[_0x1397('0x1e')](_0x51b078,_0x3b4a10)[_0x1397('0x1f')](function(_0x4a178f){logger[_0x1397('0x20')]('ChatMessage,\x20%s,\x20%s',_0x14c526,_0x1397('0x21'));logger[_0x1397('0x22')](_0x1397('0x23'),_0x14c526,_0x1397('0x21'),JSON[_0x1397('0x24')](_0x4a178f));if(_0x4a178f['error']){if(_0x4a178f[_0x1397('0x25')][_0x1397('0x26')]===0x1f4){logger[_0x1397('0x25')](_0x1397('0x27'),_0x14c526,_0x4a178f[_0x1397('0x25')][_0x1397('0x28')]);return _0x425eca(_0x4a178f['error']['message']);}logger[_0x1397('0x25')](_0x1397('0x27'),_0x14c526,_0x4a178f[_0x1397('0x25')][_0x1397('0x28')]);return _0x12ace7(_0x4a178f[_0x1397('0x25')][_0x1397('0x28')]);}else{logger[_0x1397('0x20')]('ChatMessage,\x20%s,\x20%s',_0x14c526,_0x1397('0x21'));_0x12ace7(_0x4a178f['result']['message']);}})['catch'](function(_0x28022f){logger[_0x1397('0x25')](_0x1397('0x27'),_0x14c526,_0x28022f);_0x425eca(_0x28022f);});});}function respondWithStatusCode(_0x2742af,_0x4b5fb3){_0x4b5fb3=_0x4b5fb3||0xcc;return function(_0x283094){if(_0x283094){return _0x2742af[_0x1397('0x29')](_0x4b5fb3);}return _0x2742af[_0x1397('0x2a')](_0x4b5fb3)[_0x1397('0x2b')]();};}function respondWithResult(_0xfaadfa,_0x5ae21e){_0x5ae21e=_0x5ae21e||0xc8;return function(_0x2b5e22){if(_0x2b5e22){return _0xfaadfa[_0x1397('0x2a')](_0x5ae21e)[_0x1397('0x2c')](_0x2b5e22);}};}function respondWithFilteredResult(_0x270a2c,_0x1e2d3b){return function(_0x28dae6){if(_0x28dae6){var _0x1f22b2=typeof _0x1e2d3b['offset']==='undefined'&&typeof _0x1e2d3b[_0x1397('0x2d')]===_0x1397('0x2e');var _0x81ed8b=_0x28dae6['count'];var _0x2a471d=_0x1f22b2?0x0:_0x1e2d3b[_0x1397('0x2f')];var _0x548dbb=_0x1f22b2?_0x28dae6[_0x1397('0x30')]:_0x1e2d3b[_0x1397('0x2f')]+_0x1e2d3b[_0x1397('0x2d')];var _0x571137;if(_0x548dbb>=_0x81ed8b){_0x548dbb=_0x81ed8b;_0x571137=0xc8;}else{_0x571137=0xce;}_0x270a2c[_0x1397('0x2a')](_0x571137);return _0x270a2c['set'](_0x1397('0x31'),_0x2a471d+'-'+_0x548dbb+'/'+_0x81ed8b)[_0x1397('0x2c')](_0x28dae6);}return null;};}function patchUpdates(_0x41cd47){return function(_0x3a33a8){try{jsonpatch[_0x1397('0x32')](_0x3a33a8,_0x41cd47,!![]);}catch(_0x9a8f9e){return BPromise['reject'](_0x9a8f9e);}return _0x3a33a8['save']();};}function saveUpdates(_0x91ce28,_0x31a3b0){return function(_0x8c6d50){if(_0x8c6d50){return _0x8c6d50[_0x1397('0x33')](_0x91ce28)[_0x1397('0x1f')](function(_0x24c519){return _0x24c519;});}return null;};}function removeEntity(_0x55d475,_0x368c7f){return function(_0x198aee){if(_0x198aee){return _0x198aee[_0x1397('0x34')]()[_0x1397('0x1f')](function(){_0x55d475[_0x1397('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a7a9e,_0x3e4a27){return function(_0x195bcc){if(!_0x195bcc){_0x5a7a9e[_0x1397('0x29')](0x194);}return _0x195bcc;};}function handleError(_0x52673f,_0x50a939){_0x50a939=_0x50a939||0x1f4;return function(_0x177959){logger[_0x1397('0x25')](_0x177959[_0x1397('0x35')]);if(_0x177959[_0x1397('0x36')]){delete _0x177959['name'];}_0x52673f[_0x1397('0x2a')](_0x50a939)['send'](_0x177959);};}exports[_0x1397('0x37')]=function(_0x5e6da3,_0x5c1dc0){var _0x46ee3d={},_0x11b6f2={},_0x2c3d07={'count':0x0,'rows':[]};var _0x40574a=_[_0x1397('0x38')](db[_0x1397('0x39')][_0x1397('0x3a')],function(_0x2bd6fb){return{'name':_0x2bd6fb[_0x1397('0x3b')],'type':_0x2bd6fb[_0x1397('0x3c')][_0x1397('0x3d')]};});_0x11b6f2[_0x1397('0x3e')]=_[_0x1397('0x38')](_0x40574a,_0x1397('0x36'));_0x11b6f2[_0x1397('0x3f')]=_[_0x1397('0x40')](_0x5e6da3[_0x1397('0x3f')]);_0x11b6f2[_0x1397('0x41')]=_[_0x1397('0x42')](_0x11b6f2['model'],_0x11b6f2[_0x1397('0x3f')]);_0x46ee3d[_0x1397('0x43')]=_['intersection'](_0x11b6f2[_0x1397('0x3e')],qs[_0x1397('0x44')](_0x5e6da3[_0x1397('0x3f')]['fields']));_0x46ee3d[_0x1397('0x43')]=_0x46ee3d['attributes']['length']?_0x46ee3d['attributes']:_0x11b6f2[_0x1397('0x3e')];if(!_0x5e6da3[_0x1397('0x3f')][_0x1397('0x45')](_0x1397('0x46'))){_0x46ee3d['limit']=qs['limit'](_0x5e6da3[_0x1397('0x3f')][_0x1397('0x2d')]);_0x46ee3d[_0x1397('0x2f')]=qs[_0x1397('0x2f')](_0x5e6da3[_0x1397('0x3f')]['offset']);}_0x46ee3d[_0x1397('0x47')]=qs['sort'](_0x5e6da3[_0x1397('0x3f')][_0x1397('0x48')]);_0x46ee3d[_0x1397('0x49')]=qs[_0x1397('0x41')](_[_0x1397('0x4a')](_0x5e6da3[_0x1397('0x3f')],_0x11b6f2[_0x1397('0x41')]),_0x40574a);if(_0x5e6da3[_0x1397('0x3f')][_0x1397('0x4b')]){_0x46ee3d[_0x1397('0x49')]=_[_0x1397('0x4c')](_0x46ee3d[_0x1397('0x49')],{'$or':_[_0x1397('0x38')](_0x40574a,function(_0x3c7adc){if(_0x3c7adc['type']!==_0x1397('0x4d')){var _0x18eedb={};_0x18eedb[_0x3c7adc[_0x1397('0x36')]]={'$like':'%'+_0x5e6da3[_0x1397('0x3f')]['filter']+'%'};return _0x18eedb;}})});}_0x46ee3d=_[_0x1397('0x4c')]({},_0x46ee3d,_0x5e6da3[_0x1397('0x4e')]);var _0x4ea6a2={'where':_0x46ee3d['where']};return db[_0x1397('0x39')][_0x1397('0x30')](_0x4ea6a2)['then'](function(_0x5080ee){_0x2c3d07[_0x1397('0x30')]=_0x5080ee;if(_0x5e6da3[_0x1397('0x3f')][_0x1397('0x4f')]){_0x46ee3d[_0x1397('0x50')]=[{'all':!![]}];}return db[_0x1397('0x39')][_0x1397('0x51')](_0x46ee3d);})[_0x1397('0x1f')](function(_0x447d17){_0x2c3d07[_0x1397('0x52')]=_0x447d17;return _0x2c3d07;})['then'](respondWithFilteredResult(_0x5c1dc0,_0x46ee3d))[_0x1397('0x53')](handleError(_0x5c1dc0,null));};exports[_0x1397('0x54')]=function(_0x1b2d29,_0x6b1675){var _0x1b300b={'raw':!![],'where':{'id':_0x1b2d29[_0x1397('0x55')]['id']}},_0x3e618f={};_0x3e618f[_0x1397('0x3e')]=_[_0x1397('0x40')](db[_0x1397('0x39')]['rawAttributes']);_0x3e618f[_0x1397('0x3f')]=_[_0x1397('0x40')](_0x1b2d29[_0x1397('0x3f')]);_0x3e618f['filters']=_['intersection'](_0x3e618f[_0x1397('0x3e')],_0x3e618f[_0x1397('0x3f')]);_0x1b300b[_0x1397('0x43')]=_[_0x1397('0x42')](_0x3e618f[_0x1397('0x3e')],qs[_0x1397('0x44')](_0x1b2d29[_0x1397('0x3f')]['fields']));_0x1b300b['attributes']=_0x1b300b[_0x1397('0x43')][_0x1397('0x56')]?_0x1b300b['attributes']:_0x3e618f[_0x1397('0x3e')];if(_0x1b2d29[_0x1397('0x3f')][_0x1397('0x4f')]){_0x1b300b[_0x1397('0x50')]=[{'all':!![]}];}_0x1b300b=_[_0x1397('0x4c')]({},_0x1b300b,_0x1b2d29[_0x1397('0x4e')]);return db['ChatMessage']['find'](_0x1b300b)[_0x1397('0x1f')](handleEntityNotFound(_0x6b1675,null))['then'](respondWithResult(_0x6b1675,null))[_0x1397('0x53')](handleError(_0x6b1675,null));};exports[_0x1397('0x57')]=function(_0x19c147,_0x58905e){return db[_0x1397('0x39')][_0x1397('0x57')](_0x19c147[_0x1397('0x58')],{})[_0x1397('0x1f')](respondWithResult(_0x58905e,0xc9))[_0x1397('0x53')](handleError(_0x58905e,null));};exports[_0x1397('0x33')]=function(_0x5c909a,_0x126898){if(_0x5c909a[_0x1397('0x58')]['id']){delete _0x5c909a[_0x1397('0x58')]['id'];}return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x5c909a[_0x1397('0x55')]['id']}})[_0x1397('0x1f')](handleEntityNotFound(_0x126898,null))[_0x1397('0x1f')](saveUpdates(_0x5c909a[_0x1397('0x58')],null))[_0x1397('0x1f')](respondWithResult(_0x126898,null))[_0x1397('0x53')](handleError(_0x126898,null));};exports[_0x1397('0x34')]=function(_0x4f8629,_0x16c641){return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x4f8629[_0x1397('0x55')]['id']}})[_0x1397('0x1f')](handleEntityNotFound(_0x16c641,null))['then'](removeEntity(_0x16c641,null))['catch'](handleError(_0x16c641,null));};exports['describe']=function(_0x103f0d,_0x55341a){return db[_0x1397('0x39')][_0x1397('0x5a')]()['then'](respondWithResult(_0x55341a,null))['catch'](handleError(_0x55341a,null));};var interaction_log=require(_0x1397('0x14'))(_0x1397('0x5b'));exports[_0x1397('0x5c')]=function(_0x1bd779,_0x3a84b4,_0x45ed47){var _0x3ef339={'agent':{},'channel':'chat'};if(_0x1bd779[_0x1397('0x58')]['id']){delete _0x1bd779[_0x1397('0x58')]['id'];}_0x1bd779[_0x1397('0x58')]['read']=!![];_0x1bd779['body'][_0x1397('0x5d')]=moment()['format'](_0x1397('0x5e'));_0x1bd779['body']['UserId']=_0x1bd779[_0x1397('0x58')][_0x1397('0x5f')]||_0x1bd779[_0x1397('0x60')]['id'];_0x3ef339[_0x1397('0x61')]['id']=_0x1bd779['body'][_0x1397('0x5f')];return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x1bd779['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a84b4,null))['then'](saveUpdates(_0x1bd779['body'],null))[_0x1397('0x1f')](function(_0xcbb7dd){if(_0xcbb7dd){_0x3ef339[_0x1397('0x28')]=_0xcbb7dd[_0x1397('0x62')]({'plain':!![]});return db[_0x1397('0x63')][_0x1397('0x59')]({'where':{'id':_0xcbb7dd[_0x1397('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x3a84b4,null))[_0x1397('0x1f')](function(_0x35f4ee){if(_0x35f4ee){return _0x35f4ee[_0x1397('0x33')]({'UserId':_0x1bd779['body']['UserId'],'read1stAt':_['isNil'](_0x35f4ee['read1stAt'])?moment()[_0x1397('0x65')](_0x1397('0x5e')):undefined});}return null;})[_0x1397('0x1f')](function(_0x316ac1){if(_0x316ac1){_0x3ef339[_0x1397('0x66')]=_0x316ac1['get']({'plain':!![]});interaction_log[_0x1397('0x20')](_0x1397('0x67'),_0x1bd779[_0x1397('0x60')]['id'],_0x1bd779[_0x1397('0x60')][_0x1397('0x36')],_0x1bd779[_0x1397('0x60')][_0x1397('0x68')],_0x3ef339[_0x1397('0x66')]['id'],_0x1bd779[_0x1397('0x58')]?JSON[_0x1397('0x24')](_0x1bd779['body']):_0x1397('0x69'));return respondWithRpcPromise(_0x1397('0x6a'),_0x1397('0x6b'),_0x3ef339);}return null;})[_0x1397('0x1f')](function(_0x20bd5b){var _0x231357=_0x1397('0x6c')+_0x20bd5b[_0x1397('0x28')]['ContactId'];return db[_0x1397('0x6d')][_0x1397('0x3f')](_0x231357,{'type':db[_0x1397('0x6e')][_0x1397('0x6f')][_0x1397('0x70')],'raw':!![]})[_0x1397('0x1f')](function(_0x536a22){return _0x536a22;});})[_0x1397('0x1f')](function(_0x443863){if(_0x443863){_0x3ef339[_0x1397('0x28')][_0x1397('0x71')]=_0x443863[0x0];if(!_0x1bd779[_0x1397('0x58')]['UserId'])return;return db[_0x1397('0x72')][_0x1397('0x59')]({'where':{'id':_0x1bd779[_0x1397('0x58')][_0x1397('0x5f')],'role':_0x1397('0x61')},'attributes':['id','name','fullname',_0x1397('0x73'),'internal'],'raw':!![]});}return null;})[_0x1397('0x1f')](function(_0x3f7335){if(!_0x3f7335)return null;_0x3ef339[_0x1397('0x28')]['agent']=_0x3f7335;return _0x3ef339;})[_0x1397('0x1f')](function(_0x2c0e20){if(_0x2c0e20){if(_0x1bd779[_0x1397('0x58')][_0x1397('0x74')]){_0x3ef339['message'][_0x1397('0x75')]=util[_0x1397('0x65')]('SIP/%s',_0x1bd779['user'][_0x1397('0x36')]);_0x3ef339[_0x1397('0x28')][_0x1397('0x76')]=_0x3ef339[_0x1397('0x76')];_0x3ef339[_0x1397('0x28')][_0x1397('0x77')]=_0x3ef339[_0x1397('0x76')];_0x3ef339['message'][_0x1397('0x78')]='accept';return respondWithRpcPromise(_0x1397('0x79'),_0x1397('0x79'),{'event':_0x1397('0x7a'),'message':_[_0x1397('0x4c')](_0x3ef339[_0x1397('0x28')],JSON[_0x1397('0x7b')](_0x3ef339[_0x1397('0x66')]['formData']))},client9002)[_0x1397('0x1f')](function(){return _0x3ef339;});}return _0x3ef339;}return null;})[_0x1397('0x1f')](respondWithResult(_0x3a84b4,null))['catch'](handleError(_0x3a84b4,null));};var interaction_log=require(_0x1397('0x14'))(_0x1397('0x5b'));exports['reject']=function(_0x5ef003,_0x55bdba,_0x2bfc30){var _0x5a5fc7={'agent':{},'channel':_0x1397('0x7c')};if(_0x5ef003[_0x1397('0x58')]['id']){delete _0x5ef003['body']['id'];}_0x5ef003[_0x1397('0x58')][_0x1397('0x5f')]=_0x5ef003[_0x1397('0x58')]['UserId']||_0x5ef003[_0x1397('0x60')]['id'];_0x5a5fc7[_0x1397('0x61')]['id']=_0x5ef003[_0x1397('0x58')][_0x1397('0x5f')];return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x5ef003['params']['id'],'UserId':null}})[_0x1397('0x1f')](handleEntityNotFound(_0x55bdba,null))[_0x1397('0x1f')](function(_0xe7ee99){if(_0xe7ee99){_0x5a5fc7['message']=_0xe7ee99['get']({'plain':!![]});return db[_0x1397('0x63')][_0x1397('0x59')]({'where':{'id':_0xe7ee99[_0x1397('0x64')]}});}return null;})[_0x1397('0x1f')](handleEntityNotFound(_0x55bdba,null))[_0x1397('0x1f')](function(_0x2a2036){if(_0x2a2036){_0x5a5fc7['interaction']=_0x2a2036[_0x1397('0x62')]({'plain':!![]});interaction_log[_0x1397('0x20')](_0x1397('0x7d'),_0x5ef003[_0x1397('0x60')]['id'],_0x5ef003[_0x1397('0x60')][_0x1397('0x36')],_0x5ef003['user']['role'],_0x5a5fc7[_0x1397('0x66')]['id'],_0x5ef003['body']?JSON[_0x1397('0x24')](_0x5ef003[_0x1397('0x58')]):_0x1397('0x69'));return respondWithRpcPromise(_0x1397('0x7e'),_0x1397('0x7f'),_0x5a5fc7);}return null;})[_0x1397('0x1f')](function(_0x7a8c87){var _0x162262=_0x1397('0x6c')+_0x7a8c87['message']['ContactId'];return db['sequelize'][_0x1397('0x3f')](_0x162262,{'type':db[_0x1397('0x6e')][_0x1397('0x6f')][_0x1397('0x70')],'raw':!![]})[_0x1397('0x1f')](function(_0x17b887){return _0x17b887;});})[_0x1397('0x1f')](function(_0x122019){if(_0x122019){_0x5a5fc7['message'][_0x1397('0x71')]=_0x122019[0x0];if(!_0x5ef003[_0x1397('0x58')]['UserId'])return;return db[_0x1397('0x72')][_0x1397('0x59')]({'where':{'id':_0x5ef003[_0x1397('0x58')][_0x1397('0x5f')],'role':_0x1397('0x61')},'attributes':['id',_0x1397('0x36'),_0x1397('0x80'),_0x1397('0x73'),_0x1397('0x81')],'raw':!![]});}return null;})[_0x1397('0x1f')](function(_0x5e6337){if(!_0x5e6337)return null;_0x5a5fc7['message']['agent']=_0x5e6337;return _0x5a5fc7;})[_0x1397('0x1f')](function(_0x4f067b){if(_0x4f067b){_0x4f067b[_0x1397('0x28')][_0x1397('0x75')]=util['format']('SIP/%s',_0x5ef003[_0x1397('0x60')][_0x1397('0x36')]);_0x4f067b[_0x1397('0x28')][_0x1397('0x76')]=_0x5a5fc7[_0x1397('0x76')];_0x4f067b[_0x1397('0x28')]['motionChannel']=_0x5a5fc7['channel'];_0x4f067b[_0x1397('0x28')][_0x1397('0x78')]=_0x1397('0x82');respondWithRpcPromise(_0x1397('0x79'),_0x1397('0x79'),{'event':_0x1397('0x83'),'message':_['merge'](_0x5a5fc7[_0x1397('0x28')],JSON[_0x1397('0x7b')](_0x5a5fc7[_0x1397('0x66')][_0x1397('0x84')]))},client9002);return _0x5a5fc7;}return null;})[_0x1397('0x1f')](respondWithResult(_0x55bdba,null))[_0x1397('0x53')](handleError(_0x55bdba,null));}; \ No newline at end of file +var _0x41d6=['internal','rejectmessage','parse','formData','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','../../config/logger','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId'];(function(_0x4b9702,_0x1ce3ab){var _0x152ef5=function(_0x136419){while(--_0x136419){_0x4b9702['push'](_0x4b9702['shift']());}};_0x152ef5(++_0x1ce3ab);}(_0x41d6,0x10c));var _0x641d=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x41d6[_0x27638d];return _0x35da35;};'use strict';var emlformat=require(_0x641d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x641d('0x1'));var moment=require(_0x641d('0x2'));var BPromise=require(_0x641d('0x3'));var Mustache=require(_0x641d('0x4'));var util=require('util');var path=require(_0x641d('0x5'));var sox=require(_0x641d('0x6'));var csv=require(_0x641d('0x7'));var ejs=require(_0x641d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x641d('0x9'));var crypto=require(_0x641d('0xa'));var jsforce=require(_0x641d('0xb'));var deskjs=require(_0x641d('0xc'));var toCsv=require(_0x641d('0x7'));var querystring=require('querystring');var Papa=require(_0x641d('0xd'));var Redis=require(_0x641d('0xe'));var authService=require(_0x641d('0xf'));var qs=require(_0x641d('0x10'));var as=require(_0x641d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x641d('0x12'));var utils=require(_0x641d('0x13'));var config=require(_0x641d('0x14'));var licenseUtil=require(_0x641d('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x641d('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x641d('0x17')](socket);var jayson=require(_0x641d('0x18'));var client=jayson[_0x641d('0x19')][_0x641d('0x1a')]({'port':0x232c});var client9002=jayson[_0x641d('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x599cec,_0x2350d0,_0x406371,_0x11b7e9){return new BPromise(function(_0x4c0d8d,_0x5077b5){var _0x16c914=_0x11b7e9||client;return _0x16c914[_0x641d('0x1b')](_0x599cec,_0x406371)[_0x641d('0x1c')](function(_0x328cf2){logger[_0x641d('0x1d')](_0x641d('0x1e'),_0x2350d0,_0x641d('0x1f'));logger[_0x641d('0x20')](_0x641d('0x21'),_0x2350d0,_0x641d('0x1f'),JSON['stringify'](_0x328cf2));if(_0x328cf2[_0x641d('0x22')]){if(_0x328cf2[_0x641d('0x22')][_0x641d('0x23')]===0x1f4){logger['error'](_0x641d('0x1e'),_0x2350d0,_0x328cf2[_0x641d('0x22')][_0x641d('0x24')]);return _0x5077b5(_0x328cf2[_0x641d('0x22')][_0x641d('0x24')]);}logger[_0x641d('0x22')](_0x641d('0x1e'),_0x2350d0,_0x328cf2[_0x641d('0x22')]['message']);return _0x4c0d8d(_0x328cf2['error'][_0x641d('0x24')]);}else{logger['info'](_0x641d('0x1e'),_0x2350d0,_0x641d('0x1f'));_0x4c0d8d(_0x328cf2[_0x641d('0x25')][_0x641d('0x24')]);}})[_0x641d('0x26')](function(_0xa5732c){logger[_0x641d('0x22')](_0x641d('0x1e'),_0x2350d0,_0xa5732c);_0x5077b5(_0xa5732c);});});}function respondWithStatusCode(_0x17944c,_0x44b9a7){_0x44b9a7=_0x44b9a7||0xcc;return function(_0x10ace9){if(_0x10ace9){return _0x17944c[_0x641d('0x27')](_0x44b9a7);}return _0x17944c[_0x641d('0x28')](_0x44b9a7)[_0x641d('0x29')]();};}function respondWithResult(_0x49f8d3,_0x5abcbe){_0x5abcbe=_0x5abcbe||0xc8;return function(_0x498ce4){if(_0x498ce4){return _0x49f8d3[_0x641d('0x28')](_0x5abcbe)['json'](_0x498ce4);}};}function respondWithFilteredResult(_0x2af9fb,_0x262aca){return function(_0x55cc80){if(_0x55cc80){var _0x499859=typeof _0x262aca['offset']===_0x641d('0x2a')&&typeof _0x262aca['limit']==='undefined';var _0x353e82=_0x55cc80[_0x641d('0x2b')];var _0x529d32=_0x499859?0x0:_0x262aca[_0x641d('0x2c')];var _0x530eb6=_0x499859?_0x55cc80[_0x641d('0x2b')]:_0x262aca[_0x641d('0x2c')]+_0x262aca['limit'];var _0x27c4aa;if(_0x530eb6>=_0x353e82){_0x530eb6=_0x353e82;_0x27c4aa=0xc8;}else{_0x27c4aa=0xce;}_0x2af9fb[_0x641d('0x28')](_0x27c4aa);return _0x2af9fb[_0x641d('0x2d')](_0x641d('0x2e'),_0x529d32+'-'+_0x530eb6+'/'+_0x353e82)['json'](_0x55cc80);}return null;};}function patchUpdates(_0x49569b){return function(_0x30c1d0){try{jsonpatch['apply'](_0x30c1d0,_0x49569b,!![]);}catch(_0x2e5d6f){return BPromise[_0x641d('0x2f')](_0x2e5d6f);}return _0x30c1d0[_0x641d('0x30')]();};}function saveUpdates(_0x1ef3dc,_0x1f5ecc){return function(_0x181a85){if(_0x181a85){return _0x181a85[_0x641d('0x31')](_0x1ef3dc)[_0x641d('0x1c')](function(_0x260f54){return _0x260f54;});}return null;};}function removeEntity(_0x21dd5b,_0x101154){return function(_0xca2126){if(_0xca2126){return _0xca2126[_0x641d('0x32')]()[_0x641d('0x1c')](function(){_0x21dd5b['status'](0xcc)[_0x641d('0x29')]();});}};}function handleEntityNotFound(_0x28d8f8,_0x2a0a8a){return function(_0x1838a2){if(!_0x1838a2){_0x28d8f8[_0x641d('0x27')](0x194);}return _0x1838a2;};}function handleError(_0x21d779,_0x5efdcd){_0x5efdcd=_0x5efdcd||0x1f4;return function(_0x2b0b1d){logger[_0x641d('0x22')](_0x2b0b1d[_0x641d('0x33')]);if(_0x2b0b1d[_0x641d('0x34')]){delete _0x2b0b1d[_0x641d('0x34')];}_0x21d779[_0x641d('0x28')](_0x5efdcd)[_0x641d('0x35')](_0x2b0b1d);};}exports[_0x641d('0x36')]=function(_0x46624a,_0x1d2e99){var _0x232426={},_0x4c350e={},_0x3b7607={'count':0x0,'rows':[]};var _0x43c6b2=_[_0x641d('0x37')](db[_0x641d('0x38')]['rawAttributes'],function(_0x3b5975){return{'name':_0x3b5975[_0x641d('0x39')],'type':_0x3b5975[_0x641d('0x3a')]['key']};});_0x4c350e[_0x641d('0x3b')]=_[_0x641d('0x37')](_0x43c6b2,_0x641d('0x34'));_0x4c350e[_0x641d('0x3c')]=_[_0x641d('0x3d')](_0x46624a[_0x641d('0x3c')]);_0x4c350e[_0x641d('0x3e')]=_[_0x641d('0x3f')](_0x4c350e[_0x641d('0x3b')],_0x4c350e[_0x641d('0x3c')]);_0x232426[_0x641d('0x40')]=_['intersection'](_0x4c350e[_0x641d('0x3b')],qs[_0x641d('0x41')](_0x46624a[_0x641d('0x3c')][_0x641d('0x41')]));_0x232426[_0x641d('0x40')]=_0x232426[_0x641d('0x40')][_0x641d('0x42')]?_0x232426['attributes']:_0x4c350e[_0x641d('0x3b')];if(!_0x46624a[_0x641d('0x3c')][_0x641d('0x43')]('nolimit')){_0x232426[_0x641d('0x44')]=qs[_0x641d('0x44')](_0x46624a[_0x641d('0x3c')][_0x641d('0x44')]);_0x232426['offset']=qs[_0x641d('0x2c')](_0x46624a[_0x641d('0x3c')][_0x641d('0x2c')]);}_0x232426[_0x641d('0x45')]=qs[_0x641d('0x46')](_0x46624a[_0x641d('0x3c')][_0x641d('0x46')]);_0x232426['where']=qs[_0x641d('0x3e')](_['pick'](_0x46624a[_0x641d('0x3c')],_0x4c350e['filters']),_0x43c6b2);if(_0x46624a['query'][_0x641d('0x47')]){_0x232426[_0x641d('0x48')]=_[_0x641d('0x49')](_0x232426['where'],{'$or':_[_0x641d('0x37')](_0x43c6b2,function(_0x2fd001){if(_0x2fd001[_0x641d('0x3a')]!==_0x641d('0x4a')){var _0x344451={};_0x344451[_0x2fd001[_0x641d('0x34')]]={'$like':'%'+_0x46624a[_0x641d('0x3c')]['filter']+'%'};return _0x344451;}})});}_0x232426=_[_0x641d('0x49')]({},_0x232426,_0x46624a['options']);var _0x35a056={'where':_0x232426[_0x641d('0x48')]};return db[_0x641d('0x38')]['count'](_0x35a056)[_0x641d('0x1c')](function(_0x3328cf){_0x3b7607[_0x641d('0x2b')]=_0x3328cf;if(_0x46624a[_0x641d('0x3c')][_0x641d('0x4b')]){_0x232426[_0x641d('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0x641d('0x4d')](_0x232426);})[_0x641d('0x1c')](function(_0x5e1f5b){_0x3b7607[_0x641d('0x4e')]=_0x5e1f5b;return _0x3b7607;})[_0x641d('0x1c')](respondWithFilteredResult(_0x1d2e99,_0x232426))[_0x641d('0x26')](handleError(_0x1d2e99,null));};exports[_0x641d('0x4f')]=function(_0x386320,_0x446dd1){var _0x282799={'raw':!![],'where':{'id':_0x386320[_0x641d('0x50')]['id']}},_0x30468b={};_0x30468b[_0x641d('0x3b')]=_['keys'](db[_0x641d('0x38')][_0x641d('0x51')]);_0x30468b[_0x641d('0x3c')]=_[_0x641d('0x3d')](_0x386320[_0x641d('0x3c')]);_0x30468b[_0x641d('0x3e')]=_[_0x641d('0x3f')](_0x30468b[_0x641d('0x3b')],_0x30468b[_0x641d('0x3c')]);_0x282799[_0x641d('0x40')]=_[_0x641d('0x3f')](_0x30468b[_0x641d('0x3b')],qs['fields'](_0x386320[_0x641d('0x3c')]['fields']));_0x282799[_0x641d('0x40')]=_0x282799[_0x641d('0x40')][_0x641d('0x42')]?_0x282799[_0x641d('0x40')]:_0x30468b[_0x641d('0x3b')];if(_0x386320[_0x641d('0x3c')][_0x641d('0x4b')]){_0x282799[_0x641d('0x4c')]=[{'all':!![]}];}_0x282799=_[_0x641d('0x49')]({},_0x282799,_0x386320[_0x641d('0x52')]);return db[_0x641d('0x38')][_0x641d('0x53')](_0x282799)[_0x641d('0x1c')](handleEntityNotFound(_0x446dd1,null))[_0x641d('0x1c')](respondWithResult(_0x446dd1,null))[_0x641d('0x26')](handleError(_0x446dd1,null));};exports[_0x641d('0x54')]=function(_0x28de21,_0x3787ef){return db[_0x641d('0x38')][_0x641d('0x54')](_0x28de21[_0x641d('0x55')],{})[_0x641d('0x1c')](respondWithResult(_0x3787ef,0xc9))[_0x641d('0x26')](handleError(_0x3787ef,null));};exports[_0x641d('0x31')]=function(_0xd2a239,_0xb5430e){if(_0xd2a239[_0x641d('0x55')]['id']){delete _0xd2a239[_0x641d('0x55')]['id'];}return db[_0x641d('0x38')][_0x641d('0x53')]({'where':{'id':_0xd2a239[_0x641d('0x50')]['id']}})['then'](handleEntityNotFound(_0xb5430e,null))[_0x641d('0x1c')](saveUpdates(_0xd2a239[_0x641d('0x55')],null))[_0x641d('0x1c')](respondWithResult(_0xb5430e,null))[_0x641d('0x26')](handleError(_0xb5430e,null));};exports[_0x641d('0x32')]=function(_0x5452cf,_0x2ec2c2){return db[_0x641d('0x38')][_0x641d('0x53')]({'where':{'id':_0x5452cf[_0x641d('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ec2c2,null))['then'](removeEntity(_0x2ec2c2,null))[_0x641d('0x26')](handleError(_0x2ec2c2,null));};exports['describe']=function(_0x4725d2,_0x114739){return db['ChatMessage'][_0x641d('0x56')]()[_0x641d('0x1c')](respondWithResult(_0x114739,null))[_0x641d('0x26')](handleError(_0x114739,null));};var interaction_log=require(_0x641d('0x57'))('chat-interactions');exports[_0x641d('0x58')]=function(_0x2d6019,_0x3f580d,_0xa2142c){var _0x11b207={'agent':{},'channel':'chat'};if(_0x2d6019[_0x641d('0x55')]['id']){delete _0x2d6019[_0x641d('0x55')]['id'];}_0x2d6019['body'][_0x641d('0x59')]=!![];_0x2d6019['body'][_0x641d('0x5a')]=moment()[_0x641d('0x5b')](_0x641d('0x5c'));_0x2d6019[_0x641d('0x55')][_0x641d('0x5d')]=_0x2d6019['body'][_0x641d('0x5d')]||_0x2d6019[_0x641d('0x5e')]['id'];_0x11b207[_0x641d('0x5f')]['id']=_0x2d6019[_0x641d('0x55')]['UserId'];return db[_0x641d('0x38')][_0x641d('0x53')]({'where':{'id':_0x2d6019[_0x641d('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f580d,null))[_0x641d('0x1c')](saveUpdates(_0x2d6019[_0x641d('0x55')],null))[_0x641d('0x1c')](function(_0x2153ca){if(_0x2153ca){_0x11b207[_0x641d('0x24')]=_0x2153ca[_0x641d('0x60')]({'plain':!![]});return db['ChatInteraction'][_0x641d('0x53')]({'where':{'id':_0x2153ca[_0x641d('0x61')]}});}return null;})[_0x641d('0x1c')](handleEntityNotFound(_0x3f580d,null))[_0x641d('0x1c')](function(_0x2ec619){if(_0x2ec619){return _0x2ec619[_0x641d('0x31')]({'UserId':_0x2d6019[_0x641d('0x55')][_0x641d('0x5d')],'read1stAt':_[_0x641d('0x62')](_0x2ec619[_0x641d('0x63')])?moment()[_0x641d('0x5b')](_0x641d('0x5c')):undefined});}return null;})[_0x641d('0x1c')](function(_0x8c7627){if(_0x8c7627){_0x11b207['interaction']=_0x8c7627['get']({'plain':!![]});interaction_log[_0x641d('0x1d')](_0x641d('0x64'),_0x2d6019[_0x641d('0x5e')]['id'],_0x2d6019[_0x641d('0x5e')][_0x641d('0x34')],_0x2d6019[_0x641d('0x5e')]['role'],_0x11b207[_0x641d('0x65')]['id'],_0x2d6019[_0x641d('0x55')]?JSON[_0x641d('0x66')](_0x2d6019[_0x641d('0x55')]):_0x641d('0x67'));return respondWithRpcPromise(_0x641d('0x68'),_0x641d('0x69'),_0x11b207);}return null;})[_0x641d('0x1c')](function(_0x31d03a){var _0x4df362=_0x641d('0x6a')+_0x31d03a[_0x641d('0x24')]['ContactId'];return db[_0x641d('0x6b')][_0x641d('0x3c')](_0x4df362,{'type':db[_0x641d('0x6c')][_0x641d('0x6d')][_0x641d('0x6e')],'raw':!![]})[_0x641d('0x1c')](function(_0x32da01){return _0x32da01;});})[_0x641d('0x1c')](function(_0x159ca8){if(_0x159ca8){_0x11b207[_0x641d('0x24')][_0x641d('0x6f')]=_0x159ca8[0x0];if(!_0x2d6019['body'][_0x641d('0x5d')])return;return db[_0x641d('0x70')][_0x641d('0x53')]({'where':{'id':_0x2d6019[_0x641d('0x55')][_0x641d('0x5d')],'role':_0x641d('0x5f')},'attributes':['id',_0x641d('0x34'),_0x641d('0x71'),_0x641d('0x72'),'internal'],'raw':!![]});}return null;})[_0x641d('0x1c')](function(_0xb839eb){if(!_0xb839eb)return null;_0x11b207[_0x641d('0x24')][_0x641d('0x5f')]=_0xb839eb;return _0x11b207;})[_0x641d('0x1c')](function(_0x4aae66){if(_0x4aae66){if(_0x2d6019[_0x641d('0x55')]['manual']){_0x11b207[_0x641d('0x24')][_0x641d('0x73')]=util['format']('SIP/%s',_0x2d6019[_0x641d('0x5e')][_0x641d('0x34')]);_0x11b207['message'][_0x641d('0x74')]=_0x11b207[_0x641d('0x74')];_0x11b207[_0x641d('0x24')][_0x641d('0x75')]=_0x11b207[_0x641d('0x74')];_0x11b207[_0x641d('0x24')][_0x641d('0x76')]=_0x641d('0x58');return respondWithRpcPromise('EventManager',_0x641d('0x77'),{'event':_0x641d('0x78'),'message':_[_0x641d('0x49')](_0x11b207['message'],JSON['parse'](_0x11b207[_0x641d('0x65')]['formData']))},client9002)[_0x641d('0x1c')](function(){return _0x11b207;});}return _0x11b207;}return null;})[_0x641d('0x1c')](respondWithResult(_0x3f580d,null))[_0x641d('0x26')](handleError(_0x3f580d,null));};var interaction_log=require(_0x641d('0x57'))('chat-interactions');exports['reject']=function(_0x6e3ad,_0x358f25,_0xca2b52){var _0x37e322={'agent':{},'channel':_0x641d('0x79')};if(_0x6e3ad[_0x641d('0x55')]['id']){delete _0x6e3ad[_0x641d('0x55')]['id'];}_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')]=_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')]||_0x6e3ad[_0x641d('0x5e')]['id'];_0x37e322[_0x641d('0x5f')]['id']=_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')];return db['ChatMessage'][_0x641d('0x53')]({'where':{'id':_0x6e3ad['params']['id'],'UserId':null}})[_0x641d('0x1c')](handleEntityNotFound(_0x358f25,null))[_0x641d('0x1c')](function(_0x2551bd){if(_0x2551bd){_0x37e322[_0x641d('0x24')]=_0x2551bd[_0x641d('0x60')]({'plain':!![]});return db[_0x641d('0x7a')][_0x641d('0x53')]({'where':{'id':_0x2551bd[_0x641d('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x358f25,null))[_0x641d('0x1c')](function(_0x846701){if(_0x846701){_0x37e322[_0x641d('0x65')]=_0x846701['get']({'plain':!![]});interaction_log[_0x641d('0x1d')](_0x641d('0x7b'),_0x6e3ad[_0x641d('0x5e')]['id'],_0x6e3ad[_0x641d('0x5e')][_0x641d('0x34')],_0x6e3ad['user'][_0x641d('0x7c')],_0x37e322[_0x641d('0x65')]['id'],_0x6e3ad[_0x641d('0x55')]?JSON[_0x641d('0x66')](_0x6e3ad[_0x641d('0x55')]):'null');return respondWithRpcPromise(_0x641d('0x7d'),_0x641d('0x7e'),_0x37e322);}return null;})[_0x641d('0x1c')](function(_0x5b31e5){var _0x2bf1cb=_0x641d('0x6a')+_0x5b31e5[_0x641d('0x24')][_0x641d('0x7f')];return db[_0x641d('0x6b')]['query'](_0x2bf1cb,{'type':db[_0x641d('0x6c')][_0x641d('0x6d')][_0x641d('0x6e')],'raw':!![]})['then'](function(_0x22047d){return _0x22047d;});})[_0x641d('0x1c')](function(_0x4a63b0){if(_0x4a63b0){_0x37e322['message']['contact']=_0x4a63b0[0x0];if(!_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')])return;return db['User'][_0x641d('0x53')]({'where':{'id':_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')],'role':_0x641d('0x5f')},'attributes':['id',_0x641d('0x34'),_0x641d('0x71'),'email',_0x641d('0x80')],'raw':!![]});}return null;})[_0x641d('0x1c')](function(_0x2fc736){if(!_0x2fc736)return null;_0x37e322[_0x641d('0x24')]['agent']=_0x2fc736;return _0x37e322;})[_0x641d('0x1c')](function(_0x9288f7){if(_0x9288f7){_0x9288f7[_0x641d('0x24')][_0x641d('0x73')]=util[_0x641d('0x5b')]('SIP/%s',_0x6e3ad[_0x641d('0x5e')][_0x641d('0x34')]);_0x9288f7[_0x641d('0x24')]['channel']=_0x37e322[_0x641d('0x74')];_0x9288f7[_0x641d('0x24')][_0x641d('0x75')]=_0x37e322['channel'];_0x9288f7[_0x641d('0x24')][_0x641d('0x76')]=_0x641d('0x2f');respondWithRpcPromise(_0x641d('0x77'),_0x641d('0x77'),{'event':_0x641d('0x81'),'message':_[_0x641d('0x49')](_0x37e322['message'],JSON[_0x641d('0x82')](_0x37e322[_0x641d('0x65')][_0x641d('0x83')]))},client9002);return _0x37e322;}return null;})['then'](respondWithResult(_0x358f25,null))[_0x641d('0x26')](handleError(_0x358f25,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 72e7af3..2bcc357 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 _0x9e0c=['ChatMessage','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x9e0c,0x1c9));var _0xc9e0=function(_0x56b1db,_0x4beb76){_0x56b1db=_0x56b1db-0x0;var _0x44e78a=_0x9e0c[_0x56b1db];return _0x44e78a;};'use strict';var EventEmitter=require(_0xc9e0('0x0'));var ChatMessage=require(_0xc9e0('0x1'))['db'][_0xc9e0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9e0('0x3'),'afterDestroy':_0xc9e0('0x4')};function emitEvent(_0x5e5534){return function(_0x456532,_0x1cc3d2,_0x48d713){ChatMessageEvents[_0xc9e0('0x5')](_0x5e5534+':'+_0x456532['id'],_0x456532);ChatMessageEvents['emit'](_0x5e5534,_0x456532);_0x48d713(null);};}for(var e in events){if(events[_0xc9e0('0x6')](e)){var event=events[e];ChatMessage[_0xc9e0('0x7')](e,emitEvent(event));}}module[_0xc9e0('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xc562=['hasOwnProperty','../../mysqldb','ChatMessage','save','update','emit'];(function(_0x15f964,_0x3e7bcf){var _0x317e6c=function(_0x4e4aa4){while(--_0x4e4aa4){_0x15f964['push'](_0x15f964['shift']());}};_0x317e6c(++_0x3e7bcf);}(_0xc562,0x163));var _0x2c56=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xc562[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x2c56('0x0'))['db'][_0x2c56('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c56('0x2'),'afterUpdate':_0x2c56('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d577c){return function(_0x1ebc03,_0x233e9c,_0x4f9d51){ChatMessageEvents[_0x2c56('0x4')](_0x4d577c+':'+_0x1ebc03['id'],_0x1ebc03);ChatMessageEvents[_0x2c56('0x4')](_0x4d577c,_0x1ebc03);_0x4f9d51(null);};}for(var e in events){if(events[_0x2c56('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index f256c6f..46bfaf0 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 _0x720a=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','findOne','then','update'];(function(_0x229310,_0x36482a){var _0xbcea9b=function(_0x45fddd){while(--_0x45fddd){_0x229310['push'](_0x229310['shift']());}};_0xbcea9b(++_0x36482a);}(_0x720a,0x1a5));var _0xa720=function(_0x9e3b3c,_0x2da57d){_0x9e3b3c=_0x9e3b3c-0x0;var _0xd848be=_0x720a[_0x9e3b3c];return _0xd848be;};'use strict';var _=require(_0xa720('0x0'));var util=require('util');var logger=require(_0xa720('0x1'))('api');var moment=require(_0xa720('0x2'));var BPromise=require(_0xa720('0x3'));var rp=require(_0xa720('0x4'));var fs=require('fs');var path=require(_0xa720('0x5'));var rimraf=require('rimraf');var config=require(_0xa720('0x6'));var attributes=require(_0xa720('0x7'));module['exports']=function(_0x1ab069,_0x3e45d9){return _0x1ab069[_0xa720('0x8')](_0xa720('0x9'),attributes,{'tableName':_0xa720('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xa720('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x171d41,_0x2990d9,_0x180d48){var _0x2e75f3=_0x1ab069['models'];var _0x26f826=_0x171d41[_0xa720('0xc')]({'plain':!![]});if(_0x26f826[_0xa720('0xd')][_0xa720('0xe')]()==='in'||_0x26f826[_0xa720('0xd')][_0xa720('0xe')]()===_0xa720('0xf')&&!_0x26f826[_0xa720('0x10')]&&!_[_0xa720('0x11')](_0x26f826['UserId'])){_0x2e75f3['ChatInteraction'][_0xa720('0x12')]({'where':{'id':_0x26f826['ChatInteractionId']}})[_0xa720('0x13')](function(_0x3ab312){if(_0x3ab312){_0x3ab312[_0xa720('0x14')]({'lastMsgAt':_0x26f826[_0xa720('0x15')],'lastMsgDirection':_0x26f826[_0xa720('0xd')]['toLowerCase']()});}})[_0xa720('0x16')](function(_0x512f89){console[_0xa720('0x17')](_0x512f89);});}_0x180d48();}},'charset':_0xa720('0x18'),'collate':_0xa720('0x19')});}; \ No newline at end of file +var _0x5044=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','catch','utf8mb4','util','api','moment'];(function(_0x5d289a,_0x352880){var _0x14bd5f=function(_0x268766){while(--_0x268766){_0x5d289a['push'](_0x5d289a['shift']());}};_0x14bd5f(++_0x352880);}(_0x5044,0xc8));var _0x4504=function(_0x4e204f,_0x417205){_0x4e204f=_0x4e204f-0x0;var _0x32e8e1=_0x5044[_0x4e204f];return _0x32e8e1;};'use strict';var _=require('lodash');var util=require(_0x4504('0x0'));var logger=require('../../config/logger')(_0x4504('0x1'));var moment=require(_0x4504('0x2'));var BPromise=require(_0x4504('0x3'));var rp=require(_0x4504('0x4'));var fs=require('fs');var path=require(_0x4504('0x5'));var rimraf=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var attributes=require(_0x4504('0x8'));module['exports']=function(_0x10b50f,_0x40195b){return _0x10b50f[_0x4504('0x9')](_0x4504('0xa'),attributes,{'tableName':_0x4504('0xb'),'paranoid':![],'indexes':[{'name':_0x4504('0xc'),'fields':[_0x4504('0xd')],'type':_0x4504('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1719c1,_0x56961c,_0xe150a1){var _0x5693ac=_0x10b50f[_0x4504('0xf')];var _0x337392=_0x1719c1[_0x4504('0x10')]({'plain':!![]});if(_0x337392[_0x4504('0x11')][_0x4504('0x12')]()==='in'||_0x337392[_0x4504('0x11')][_0x4504('0x12')]()===_0x4504('0x13')&&!_0x337392[_0x4504('0x14')]&&!_[_0x4504('0x15')](_0x337392[_0x4504('0x16')])){_0x5693ac[_0x4504('0x17')][_0x4504('0x18')]({'where':{'id':_0x337392['ChatInteractionId']}})[_0x4504('0x19')](function(_0x1f6c56){if(_0x1f6c56){_0x1f6c56['update']({'lastMsgAt':_0x337392[_0x4504('0x1a')],'lastMsgDirection':_0x337392[_0x4504('0x11')][_0x4504('0x12')]()});}})[_0x4504('0x1b')](function(_0x4c773a){console['error'](_0x4c773a);});}_0xe150a1();}},'charset':_0x4504('0x1c'),'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 963da02..4e7e769 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 _0x1aa5=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x24f211,_0x2774a7){var _0xaab41=function(_0x34b4f7){while(--_0x34b4f7){_0x24f211['push'](_0x24f211['shift']());}};_0xaab41(++_0x2774a7);}(_0x1aa5,0x18e));var _0x51aa=function(_0x56903a,_0x32da1d){_0x56903a=_0x56903a-0x0;var _0x2d3083=_0x1aa5[_0x56903a];return _0x2d3083;};'use strict';var _=require(_0x51aa('0x0'));var util=require('util');var moment=require(_0x51aa('0x1'));var BPromise=require(_0x51aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51aa('0x3'))['db'];var utils=require(_0x51aa('0x4'));var logger=require(_0x51aa('0x5'))('rpc');var config=require(_0x51aa('0x6'));var jayson=require(_0x51aa('0x7'));var client=jayson[_0x51aa('0x8')][_0x51aa('0x9')]({'port':0x232a});config[_0x51aa('0xa')]=_[_0x51aa('0xb')](config[_0x51aa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x51aa('0xc'))(new Redis(config[_0x51aa('0xa')]));require('./chatMessage.socket')[_0x51aa('0xd')](socket);function respondWithRpcPromise(_0x42ac4c,_0x4275c9,_0x587b23){return new BPromise(function(_0x4c1c8c,_0x5245b6){return client[_0x51aa('0xe')](_0x42ac4c,_0x587b23)[_0x51aa('0xf')](function(_0x4ddfee){logger['info'](_0x51aa('0x10'),_0x4275c9,_0x51aa('0x11'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4275c9,_0x51aa('0x11'),JSON[_0x51aa('0x12')](_0x4ddfee));if(_0x4ddfee[_0x51aa('0x13')]){if(_0x4ddfee[_0x51aa('0x13')][_0x51aa('0x14')]===0x1f4){logger[_0x51aa('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4275c9,_0x4ddfee['error'][_0x51aa('0x15')]);return _0x5245b6(_0x4ddfee[_0x51aa('0x13')][_0x51aa('0x15')]);}logger[_0x51aa('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4275c9,_0x4ddfee[_0x51aa('0x13')]['message']);return _0x4c1c8c(_0x4ddfee[_0x51aa('0x13')][_0x51aa('0x15')]);}else{logger[_0x51aa('0x16')](_0x51aa('0x10'),_0x4275c9,_0x51aa('0x11'));_0x4c1c8c(_0x4ddfee['result']['message']);}})[_0x51aa('0x17')](function(_0x4fd365){logger['error'](_0x51aa('0x10'),_0x4275c9,_0x4fd365);_0x5245b6(_0x4fd365);});});}exports[_0x51aa('0x18')]=function(_0x2754bf){var _0x489c99=this;return new Promise(function(_0x3e0da7,_0x2f7cdc){return db[_0x51aa('0x19')][_0x51aa('0x1a')](_0x2754bf[_0x51aa('0x1b')],{'raw':_0x2754bf[_0x51aa('0x1c')]?_0x2754bf[_0x51aa('0x1c')][_0x51aa('0x1d')]===undefined?!![]:![]:!![]})[_0x51aa('0xf')](function(_0x108c23){logger[_0x51aa('0x16')](_0x51aa('0x18'),_0x2754bf);logger[_0x51aa('0x1e')](_0x51aa('0x18'),_0x2754bf,JSON[_0x51aa('0x12')](_0x108c23));_0x3e0da7(_0x108c23);})[_0x51aa('0x17')](function(_0x3cb151){logger[_0x51aa('0x13')](_0x51aa('0x18'),_0x3cb151[_0x51aa('0x15')],_0x2754bf);_0x2f7cdc(_0x489c99[_0x51aa('0x13')](0x1f4,_0x3cb151[_0x51aa('0x15')]));});});}; \ No newline at end of file +var _0x84cd=['options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','create'];(function(_0x21ff9c,_0x424a46){var _0x552861=function(_0xd0a872){while(--_0xd0a872){_0x21ff9c['push'](_0x21ff9c['shift']());}};_0x552861(++_0x424a46);}(_0x84cd,0x16b));var _0xd84c=function(_0x59b72b,_0x2537d9){_0x59b72b=_0x59b72b-0x0;var _0x389230=_0x84cd[_0x59b72b];return _0x389230;};'use strict';var _=require(_0xd84c('0x0'));var util=require(_0xd84c('0x1'));var moment=require(_0xd84c('0x2'));var BPromise=require(_0xd84c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd84c('0x4'));var db=require(_0xd84c('0x5'))['db'];var utils=require(_0xd84c('0x6'));var logger=require(_0xd84c('0x7'))(_0xd84c('0x8'));var config=require(_0xd84c('0x9'));var jayson=require(_0xd84c('0xa'));var client=jayson[_0xd84c('0xb')][_0xd84c('0xc')]({'port':0x232a});config[_0xd84c('0xd')]=_[_0xd84c('0xe')](config[_0xd84c('0xd')],{'host':_0xd84c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd84c('0xd')]));require(_0xd84c('0x10'))[_0xd84c('0x11')](socket);function respondWithRpcPromise(_0x167bb2,_0x2337cf,_0x51cb1a){return new BPromise(function(_0x3d9f9a,_0x4d6734){return client[_0xd84c('0x12')](_0x167bb2,_0x51cb1a)['then'](function(_0x328b4e){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2337cf,'request\x20sent');logger[_0xd84c('0x13')](_0xd84c('0x14'),_0x2337cf,_0xd84c('0x15'),JSON[_0xd84c('0x16')](_0x328b4e));if(_0x328b4e[_0xd84c('0x17')]){if(_0x328b4e['error'][_0xd84c('0x18')]===0x1f4){logger['error'](_0xd84c('0x19'),_0x2337cf,_0x328b4e[_0xd84c('0x17')][_0xd84c('0x1a')]);return _0x4d6734(_0x328b4e[_0xd84c('0x17')][_0xd84c('0x1a')]);}logger[_0xd84c('0x17')](_0xd84c('0x19'),_0x2337cf,_0x328b4e[_0xd84c('0x17')][_0xd84c('0x1a')]);return _0x3d9f9a(_0x328b4e['error'][_0xd84c('0x1a')]);}else{logger[_0xd84c('0x1b')](_0xd84c('0x19'),_0x2337cf,_0xd84c('0x15'));_0x3d9f9a(_0x328b4e[_0xd84c('0x1c')][_0xd84c('0x1a')]);}})[_0xd84c('0x1d')](function(_0x151862){logger[_0xd84c('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2337cf,_0x151862);_0x4d6734(_0x151862);});});}exports[_0xd84c('0x1e')]=function(_0x5c8f0e){var _0x2e7dbc=this;return new Promise(function(_0x43f9d1,_0x3be18f){return db[_0xd84c('0x1f')][_0xd84c('0x20')](_0x5c8f0e['body'],{'raw':_0x5c8f0e[_0xd84c('0x21')]?_0x5c8f0e[_0xd84c('0x21')][_0xd84c('0x22')]===undefined?!![]:![]:!![]})[_0xd84c('0x23')](function(_0x53f7a1){logger['info'](_0xd84c('0x1e'),_0x5c8f0e);logger['debug'](_0xd84c('0x1e'),_0x5c8f0e,JSON['stringify'](_0x53f7a1));_0x43f9d1(_0x53f7a1);})[_0xd84c('0x1d')](function(_0x43f5ea){logger[_0xd84c('0x17')](_0xd84c('0x1e'),_0x43f5ea[_0xd84c('0x1a')],_0x5c8f0e);_0x3be18f(_0x2e7dbc[_0xd84c('0x17')](0x1f4,_0x43f5ea['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index bcd3c06..bf9a15f 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 _0x3c17=['register','length','./chatMessage.events','remove','removeListener'];(function(_0x17d1c1,_0x3a5a2d){var _0x56e1de=function(_0x2fee11){while(--_0x2fee11){_0x17d1c1['push'](_0x17d1c1['shift']());}};_0x56e1de(++_0x3a5a2d);}(_0x3c17,0x1a1));var _0x73c1=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x3c17[_0x266618];return _0x54dbf5;};'use strict';var ChatMessageEvents=require(_0x73c1('0x0'));var events=['save',_0x73c1('0x1'),'update'];function createListener(_0x1a088c,_0x19c8cc){return function(_0x1ed81e){_0x19c8cc['emit'](_0x1a088c,_0x1ed81e);};}function removeListener(_0x3a00a0,_0xcbe17a){return function(){ChatMessageEvents[_0x73c1('0x2')](_0x3a00a0,_0xcbe17a);};}exports[_0x73c1('0x3')]=function(_0x48c943){for(var _0x382f82=0x0,_0x58151c=events[_0x73c1('0x4')];_0x382f82<_0x58151c;_0x382f82++){var _0x42ca06=events[_0x382f82];var _0x422176=createListener('chatMessage:'+_0x42ca06,_0x48c943);ChatMessageEvents['on'](_0x42ca06,_0x422176);}}; \ No newline at end of file +var _0x06f4=['register','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0x21d424,_0x7c5147){var _0x504777=function(_0xa06101){while(--_0xa06101){_0x21d424['push'](_0x21d424['shift']());}};_0x504777(++_0x7c5147);}(_0x06f4,0x136));var _0x406f=function(_0x480481,_0x246ad9){_0x480481=_0x480481-0x0;var _0x2bdace=_0x06f4[_0x480481];return _0x2bdace;};'use strict';var ChatMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){ChatMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);ChatMessageEvents['on'](_0x1afec4,_0x1c39ce);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 804e490..0725dee 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 _0x3dc9=['chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','tracked'];(function(_0x5f31e9,_0xf44932){var _0x165bed=function(_0xfa0e79){while(--_0xfa0e79){_0x5f31e9['push'](_0x5f31e9['shift']());}};_0x165bed(++_0xf44932);}(_0x3dc9,0x143));var _0x93dc=function(_0xd3b6f9,_0x3747f3){_0xd3b6f9=_0xd3b6f9-0x0;var _0x2009fd=_0x3dc9[_0xd3b6f9];return _0x2009fd;};'use strict';var multer=require(_0x93dc('0x0'));var util=require(_0x93dc('0x1'));var path=require('path');var timeout=require(_0x93dc('0x2'));var express=require('express');var router=express[_0x93dc('0x3')]();var fs_extra=require(_0x93dc('0x4'));var auth=require(_0x93dc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93dc('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x93dc('0x7')](),controller[_0x93dc('0x8')]);router[_0x93dc('0x9')]('/describe',auth[_0x93dc('0x7')](),controller['describe']);router['get'](_0x93dc('0xa'),auth['isAuthenticated'](),controller[_0x93dc('0xb')]);router['post']('/',auth[_0x93dc('0x7')](),interaction[_0x93dc('0xc')](_0x93dc('0xd'),_0x93dc('0xe')),controller[_0x93dc('0xf')]);router[_0x93dc('0x10')](_0x93dc('0xa'),controller[_0x93dc('0x11')]);router[_0x93dc('0x10')](_0x93dc('0x12'),auth[_0x93dc('0x7')](),controller['accept']);router['put'](_0x93dc('0x13'),auth[_0x93dc('0x7')](),controller[_0x93dc('0x14')]);router[_0x93dc('0x15')](_0x93dc('0xa'),auth['isAuthenticated'](),controller[_0x93dc('0x16')]);module[_0x93dc('0x17')]=router; \ No newline at end of file +var _0x02a8=['post','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','isAuthenticated','index','/describe','/:id','show'];(function(_0x419cba,_0x2173ee){var _0x5512ed=function(_0xf41bd){while(--_0xf41bd){_0x419cba['push'](_0x419cba['shift']());}};_0x5512ed(++_0x2173ee);}(_0x02a8,0xa1));var _0x802a=function(_0x27f920,_0x2b9e90){_0x27f920=_0x27f920-0x0;var _0x16ed9d=_0x02a8[_0x27f920];return _0x16ed9d;};'use strict';var multer=require(_0x802a('0x0'));var util=require(_0x802a('0x1'));var path=require(_0x802a('0x2'));var timeout=require(_0x802a('0x3'));var express=require(_0x802a('0x4'));var router=express[_0x802a('0x5')]();var fs_extra=require(_0x802a('0x6'));var auth=require(_0x802a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x802a('0x8'));router['get']('/',auth[_0x802a('0x9')](),controller[_0x802a('0xa')]);router['get'](_0x802a('0xb'),auth[_0x802a('0x9')](),controller['describe']);router['get'](_0x802a('0xc'),auth['isAuthenticated'](),controller[_0x802a('0xd')]);router[_0x802a('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x802a('0xf'),_0x802a('0x10')),controller['create']);router[_0x802a('0x11')](_0x802a('0xc'),controller[_0x802a('0x12')]);router[_0x802a('0x11')](_0x802a('0x13'),auth[_0x802a('0x9')](),controller[_0x802a('0x14')]);router[_0x802a('0x11')](_0x802a('0x15'),auth[_0x802a('0x9')](),controller[_0x802a('0x16')]);router[_0x802a('0x17')](_0x802a('0xc'),auth['isAuthenticated'](),controller[_0x802a('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 582c38e..976b448 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 _0xdaa7=['exports','medium','sequelize'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0xdaa7,0xec));var _0x7daa=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0xdaa7[_0xfc0976];return _0x23579f;};'use strict';var Sequelize=require(_0x7daa('0x0'));module[_0x7daa('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7daa('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x6aec=['sequelize','TEXT','medium'];(function(_0x382e11,_0x24daf4){var _0xcd301c=function(_0x2ceb35){while(--_0x2ceb35){_0x382e11['push'](_0x382e11['shift']());}};_0xcd301c(++_0x24daf4);}(_0x6aec,0x10e));var _0xc6ae=function(_0x39f7ce,_0x5d3ea7){_0x39f7ce=_0x39f7ce-0x0;var _0x1ae5b0=_0x6aec[_0x39f7ce];return _0x1ae5b0;};'use strict';var Sequelize=require(_0xc6ae('0x0'));module['exports']={'body':{'type':Sequelize[_0xc6ae('0x1')](_0xc6ae('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 5b4e7ac..13aa78a 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(_0x400e19,_0x28b2c6){var _0x4e31a7=function(_0x27502a){while(--_0x27502a){_0x400e19['push'](_0x400e19['shift']());}};_0x4e31a7(++_0x28b2c6);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7a54,0x106));var _0x47a5=function(_0x513822,_0x311601){_0x513822=_0x513822-0x0;var _0x3c0d73=_0x7a54[_0x513822];return _0x3c0d73;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index ac00b05..8a55210 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd04e=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1f6e01,_0x4c1606){var _0x50a4a0=function(_0x3905c7){while(--_0x3905c7){_0x1f6e01['push'](_0x1f6e01['shift']());}};_0x50a4a0(++_0x4c1606);}(_0xd04e,0x10d));var _0xed04=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xd04e[_0x45bf86];return _0x1f02b7;};'use strict';var EventEmitter=require(_0xed04('0x0'));var ChatOfflineMessage=require(_0xed04('0x1'))['db'][_0xed04('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xed04('0x3')](0x0);var events={'afterCreate':_0xed04('0x4'),'afterUpdate':_0xed04('0x5'),'afterDestroy':_0xed04('0x6')};function emitEvent(_0x39af6d){return function(_0x106c9b,_0x590cd8,_0x491930){ChatOfflineMessageEvents[_0xed04('0x7')](_0x39af6d+':'+_0x106c9b['id'],_0x106c9b);ChatOfflineMessageEvents[_0xed04('0x7')](_0x39af6d,_0x106c9b);_0x491930(null);};}for(var e in events){if(events[_0xed04('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xed04('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xc058=['exports','events','ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc058,0xc7));var _0x8c05=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc058[_0x122096];return _0x3d1966;};'use strict';var EventEmitter=require(_0x8c05('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x8c05('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8c05('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8c05('0x3'),'afterDestroy':_0x8c05('0x4')};function emitEvent(_0x254e51){return function(_0xf70219,_0x47e175,_0xf64bf){ChatOfflineMessageEvents['emit'](_0x254e51+':'+_0xf70219['id'],_0xf70219);ChatOfflineMessageEvents[_0x8c05('0x5')](_0x254e51,_0xf70219);_0xf64bf(null);};}for(var e in events){if(events[_0x8c05('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x8c05('0x7')](e,emitEvent(event));}}module[_0x8c05('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index cda59f4..afd046a 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 _0xb88c=['exports','define','ChatOfflineMessage','utf8mb4_unicode_ci','models','get','./chatOfflineMessage.attributes'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0xb88c,0x84));var _0xcb88=function(_0x1c4c1e,_0x37ae2c){_0x1c4c1e=_0x1c4c1e-0x0;var _0x308b62=_0xb88c[_0x1c4c1e];return _0x308b62;};'use strict';var attributes=require(_0xcb88('0x0'));module[_0xcb88('0x1')]=function(_0x507131){return _0x507131[_0xcb88('0x2')](_0xcb88('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcb88('0x4'),'hooks':{'afterCreate':function(_0x2fdd66,_0xe9ca69,_0xd1b25f){var _0x3f5c38=_0x507131[_0xcb88('0x5')];var _0x3ba1a0=_0x2fdd66[_0xcb88('0x6')]({'plain':!![]});_0xd1b25f();}}});}; \ No newline at end of file +var _0x49a4=['models','get','./chatOfflineMessage.attributes','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x49a4,0x17c));var _0x449a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x49a4[_0x17d9e3];return _0x14192d;};'use strict';var attributes=require(_0x449a('0x0'));module['exports']=function(_0x66bef2){return _0x66bef2['define']('ChatOfflineMessage',attributes,{'tableName':_0x449a('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x449a('0x2'),'collate':_0x449a('0x3'),'hooks':{'afterCreate':function(_0x120bba,_0x3e5c88,_0x2d673a){var _0x599999=_0x66bef2[_0x449a('0x4')];var _0x3b7579=_0x120bba[_0x449a('0x5')]({'plain':!![]});_0x2d673a();}}});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index be30f49..6490520 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 _0xf8db=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8db,0x16b));var _0xbf8d=function(_0x2c45c4,_0x4bb43b){_0x2c45c4=_0x2c45c4-0x0;var _0x34540a=_0xf8db[_0x2c45c4];return _0x34540a;};'use strict';var _=require(_0xbf8d('0x0'));var util=require('util');var moment=require(_0xbf8d('0x1'));var BPromise=require(_0xbf8d('0x2'));var rs=require(_0xbf8d('0x3'));var fs=require('fs');var Redis=require(_0xbf8d('0x4'));var db=require(_0xbf8d('0x5'))['db'];var utils=require(_0xbf8d('0x6'));var logger=require('../../config/logger')(_0xbf8d('0x7'));var config=require(_0xbf8d('0x8'));var jayson=require(_0xbf8d('0x9'));var client=jayson[_0xbf8d('0xa')][_0xbf8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12f40d,_0x5065ad,_0x3b5a99){return new BPromise(function(_0x4f9a83,_0x55e16a){return client[_0xbf8d('0xc')](_0x12f40d,_0x3b5a99)[_0xbf8d('0xd')](function(_0x391657){logger[_0xbf8d('0xe')](_0xbf8d('0xf'),_0x5065ad,_0xbf8d('0x10'));logger[_0xbf8d('0x11')](_0xbf8d('0x12'),_0x5065ad,_0xbf8d('0x10'),JSON[_0xbf8d('0x13')](_0x391657));if(_0x391657[_0xbf8d('0x14')]){if(_0x391657[_0xbf8d('0x14')][_0xbf8d('0x15')]===0x1f4){logger[_0xbf8d('0x14')](_0xbf8d('0xf'),_0x5065ad,_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);return _0x55e16a(_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);}logger[_0xbf8d('0x14')](_0xbf8d('0xf'),_0x5065ad,_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);return _0x4f9a83(_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);}else{logger[_0xbf8d('0xe')](_0xbf8d('0xf'),_0x5065ad,_0xbf8d('0x10'));_0x4f9a83(_0x391657[_0xbf8d('0x17')][_0xbf8d('0x16')]);}})[_0xbf8d('0x18')](function(_0x1460f1){logger[_0xbf8d('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5065ad,_0x1460f1);_0x55e16a(_0x1460f1);});});} \ No newline at end of file +var _0xb70a=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xb70a,0x18e));var _0xab70=function(_0xaf6691,_0x10c873){_0xaf6691=_0xaf6691-0x0;var _0x23b08a=_0xb70a[_0xaf6691];return _0x23b08a;};'use strict';var _=require('lodash');var util=require(_0xab70('0x0'));var moment=require(_0xab70('0x1'));var BPromise=require(_0xab70('0x2'));var rs=require(_0xab70('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab70('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab70('0x5'))(_0xab70('0x6'));var config=require('../../config/environment');var jayson=require(_0xab70('0x7'));var client=jayson['client'][_0xab70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46e903,_0x302d78,_0x31e83b){return new BPromise(function(_0x5314ab,_0x3631e5){return client[_0xab70('0x9')](_0x46e903,_0x31e83b)[_0xab70('0xa')](function(_0xbfe54){logger[_0xab70('0xb')](_0xab70('0xc'),_0x302d78,_0xab70('0xd'));logger[_0xab70('0xe')](_0xab70('0xf'),_0x302d78,_0xab70('0xd'),JSON['stringify'](_0xbfe54));if(_0xbfe54[_0xab70('0x10')]){if(_0xbfe54[_0xab70('0x10')][_0xab70('0x11')]===0x1f4){logger['error'](_0xab70('0xc'),_0x302d78,_0xbfe54[_0xab70('0x10')][_0xab70('0x12')]);return _0x3631e5(_0xbfe54[_0xab70('0x10')]['message']);}logger[_0xab70('0x10')](_0xab70('0xc'),_0x302d78,_0xbfe54[_0xab70('0x10')]['message']);return _0x5314ab(_0xbfe54['error'][_0xab70('0x12')]);}else{logger[_0xab70('0xb')](_0xab70('0xc'),_0x302d78,'request\x20sent');_0x5314ab(_0xbfe54[_0xab70('0x13')][_0xab70('0x12')]);}})['catch'](function(_0x3c0cec){logger[_0xab70('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x302d78,_0x3c0cec);_0x3631e5(_0x3c0cec);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ba5c0eb..b700bce 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 _0x9375=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9375,0x11f));var _0x5937=function(_0x3b3bc1,_0x38b1df){_0x3b3bc1=_0x3b3bc1-0x0;var _0x3735b0=_0x9375[_0x3b3bc1];return _0x3735b0;};'use strict';var multer=require(_0x5937('0x0'));var util=require(_0x5937('0x1'));var path=require(_0x5937('0x2'));var timeout=require(_0x5937('0x3'));var express=require(_0x5937('0x4'));var router=express['Router']();var fs_extra=require(_0x5937('0x5'));var auth=require(_0x5937('0x6'));var interaction=require(_0x5937('0x7'));var config=require(_0x5937('0x8'));var controller=require(_0x5937('0x9'));router[_0x5937('0xa')]('/',auth[_0x5937('0xb')](),controller[_0x5937('0xc')]);router[_0x5937('0xa')](_0x5937('0xd'),auth[_0x5937('0xb')](),controller[_0x5937('0xe')]);router[_0x5937('0xa')](_0x5937('0xf'),auth[_0x5937('0xb')](),controller[_0x5937('0x10')]);router['post']('/',auth[_0x5937('0xb')](),controller['create']);router[_0x5937('0x11')]('/:id',auth[_0x5937('0xb')](),controller[_0x5937('0x12')]);router[_0x5937('0x13')](_0x5937('0xf'),auth[_0x5937('0xb')](),controller['destroy']);module[_0x5937('0x14')]=router; \ No newline at end of file +var _0x41a2=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','/:id'];(function(_0x1aeba3,_0xad09a9){var _0x134fa9=function(_0x3e4b3c){while(--_0x3e4b3c){_0x1aeba3['push'](_0x1aeba3['shift']());}};_0x134fa9(++_0xad09a9);}(_0x41a2,0xa9));var _0x241a=function(_0x536755,_0x3bfa50){_0x536755=_0x536755-0x0;var _0x2b9dde=_0x41a2[_0x536755];return _0x2b9dde;};'use strict';var multer=require(_0x241a('0x0'));var util=require('util');var path=require(_0x241a('0x1'));var timeout=require(_0x241a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x241a('0x3'));var auth=require(_0x241a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x241a('0x5'));var controller=require(_0x241a('0x6'));router[_0x241a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x241a('0x8'),auth['isAuthenticated'](),controller[_0x241a('0x9')]);router[_0x241a('0x7')](_0x241a('0xa'),auth[_0x241a('0xb')](),controller[_0x241a('0xc')]);router[_0x241a('0xd')]('/',auth[_0x241a('0xb')](),controller[_0x241a('0xe')]);router[_0x241a('0xf')]('/:id',auth[_0x241a('0xb')](),controller[_0x241a('0x10')]);router[_0x241a('0x11')](_0x241a('0xa'),auth[_0x241a('0xb')](),controller[_0x241a('0x12')]);module[_0x241a('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 f017ba5..0dc6dff 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 _0x6893=['exports','ENUM','mouseOver','timeout','STRING','sequelize'];(function(_0x58106b,_0x230f7a){var _0x1ea838=function(_0x33b049){while(--_0x33b049){_0x58106b['push'](_0x58106b['shift']());}};_0x1ea838(++_0x230f7a);}(_0x6893,0xb3));var _0x3689=function(_0x1a675c,_0x4648bc){_0x1a675c=_0x1a675c-0x0;var _0x4ee1dc=_0x6893[_0x1a675c];return _0x4ee1dc;};'use strict';var Sequelize=require(_0x3689('0x0'));module[_0x3689('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3689('0x2')](_0x3689('0x3'),_0x3689('0x4')),'defaultValue':_0x3689('0x3')},'selector':{'type':Sequelize[_0x3689('0x5')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0347=['INTEGER','sequelize','ENUM','mouseOver'];(function(_0x5d6613,_0x276bdc){var _0xc1fc9e=function(_0x41674f){while(--_0x41674f){_0x5d6613['push'](_0x5d6613['shift']());}};_0xc1fc9e(++_0x276bdc);}(_0x0347,0x109));var _0x7034=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0347[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x7034('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7034('0x1')](_0x7034('0x2'),'timeout'),'defaultValue':_0x7034('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7034('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 65e6413..fcf6ee0 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 _0xa381=['rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','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','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','create','body','eml-format'];(function(_0x28fda7,_0x3d6bab){var _0x22e520=function(_0x354dba){while(--_0x354dba){_0x28fda7['push'](_0x28fda7['shift']());}};_0x22e520(++_0x3d6bab);}(_0xa381,0x79));var _0x1a38=function(_0x325ee2,_0xaf1371){_0x325ee2=_0x325ee2-0x0;var _0x7f2741=_0xa381[_0x325ee2];return _0x7f2741;};'use strict';var emlformat=require(_0x1a38('0x0'));var rimraf=require(_0x1a38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a38('0x2'));var moment=require(_0x1a38('0x3'));var BPromise=require(_0x1a38('0x4'));var Mustache=require('mustache');var util=require(_0x1a38('0x5'));var path=require(_0x1a38('0x6'));var sox=require(_0x1a38('0x7'));var csv=require(_0x1a38('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a38('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a38('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1a38('0xb'));var toCsv=require(_0x1a38('0x8'));var querystring=require(_0x1a38('0xc'));var Papa=require(_0x1a38('0xd'));var Redis=require('ioredis');var authService=require(_0x1a38('0xe'));var qs=require(_0x1a38('0xf'));var as=require(_0x1a38('0x10'));var hardwareService=require(_0x1a38('0x11'));var logger=require(_0x1a38('0x12'))(_0x1a38('0x13'));var utils=require(_0x1a38('0x14'));var config=require(_0x1a38('0x15'));var licenseUtil=require(_0x1a38('0x16'));var db=require(_0x1a38('0x17'))['db'];function respondWithStatusCode(_0x332dab,_0x28f875){_0x28f875=_0x28f875||0xcc;return function(_0x8c19e){if(_0x8c19e){return _0x332dab[_0x1a38('0x18')](_0x28f875);}return _0x332dab[_0x1a38('0x19')](_0x28f875)[_0x1a38('0x1a')]();};}function respondWithResult(_0x3177ec,_0x111055){_0x111055=_0x111055||0xc8;return function(_0x3392cb){if(_0x3392cb){return _0x3177ec[_0x1a38('0x19')](_0x111055)[_0x1a38('0x1b')](_0x3392cb);}};}function respondWithFilteredResult(_0x478419,_0x3a60ea){return function(_0x5d6cce){if(_0x5d6cce){var _0x54d688=typeof _0x3a60ea[_0x1a38('0x1c')]==='undefined'&&typeof _0x3a60ea[_0x1a38('0x1d')]===_0x1a38('0x1e');var _0x44a325=_0x5d6cce[_0x1a38('0x1f')];var _0x25ebb0=_0x54d688?0x0:_0x3a60ea[_0x1a38('0x1c')];var _0x408e8f=_0x54d688?_0x5d6cce[_0x1a38('0x1f')]:_0x3a60ea[_0x1a38('0x1c')]+_0x3a60ea['limit'];var _0x65f17c;if(_0x408e8f>=_0x44a325){_0x408e8f=_0x44a325;_0x65f17c=0xc8;}else{_0x65f17c=0xce;}_0x478419['status'](_0x65f17c);return _0x478419[_0x1a38('0x20')](_0x1a38('0x21'),_0x25ebb0+'-'+_0x408e8f+'/'+_0x44a325)['json'](_0x5d6cce);}return null;};}function patchUpdates(_0x45272f){return function(_0x50fccb){try{jsonpatch['apply'](_0x50fccb,_0x45272f,!![]);}catch(_0x1b87d9){return BPromise[_0x1a38('0x22')](_0x1b87d9);}return _0x50fccb[_0x1a38('0x23')]();};}function saveUpdates(_0x205c5b,_0x561fa4){return function(_0x391040){if(_0x391040){return _0x391040[_0x1a38('0x24')](_0x205c5b)[_0x1a38('0x25')](function(_0x4bfa67){return _0x4bfa67;});}return null;};}function removeEntity(_0x18912c,_0x214228){return function(_0x2877fe){if(_0x2877fe){return _0x2877fe[_0x1a38('0x26')]()[_0x1a38('0x25')](function(){_0x18912c[_0x1a38('0x19')](0xcc)[_0x1a38('0x1a')]();});}};}function handleEntityNotFound(_0x160ac1,_0x37a7d9){return function(_0x20daca){if(!_0x20daca){_0x160ac1['sendStatus'](0x194);}return _0x20daca;};}function handleError(_0x1c4d20,_0x54e4a9){_0x54e4a9=_0x54e4a9||0x1f4;return function(_0x398827){logger[_0x1a38('0x27')](_0x398827['stack']);if(_0x398827[_0x1a38('0x28')]){delete _0x398827['name'];}_0x1c4d20[_0x1a38('0x19')](_0x54e4a9)[_0x1a38('0x29')](_0x398827);};}exports[_0x1a38('0x2a')]=function(_0x59d9cc,_0x4be61f){var _0x39ac00={'raw':!![],'where':{'id':_0x59d9cc[_0x1a38('0x2b')]['id']}},_0x2a4027={};_0x2a4027[_0x1a38('0x2c')]=_[_0x1a38('0x2d')](db[_0x1a38('0x2e')][_0x1a38('0x2f')]);_0x2a4027[_0x1a38('0x30')]=_['keys'](_0x59d9cc['query']);_0x2a4027[_0x1a38('0x31')]=_[_0x1a38('0x32')](_0x2a4027[_0x1a38('0x2c')],_0x2a4027[_0x1a38('0x30')]);_0x39ac00[_0x1a38('0x33')]=_[_0x1a38('0x32')](_0x2a4027[_0x1a38('0x2c')],qs['fields'](_0x59d9cc[_0x1a38('0x30')]['fields']));_0x39ac00[_0x1a38('0x33')]=_0x39ac00[_0x1a38('0x33')][_0x1a38('0x34')]?_0x39ac00[_0x1a38('0x33')]:_0x2a4027[_0x1a38('0x2c')];if(_0x59d9cc['query'][_0x1a38('0x35')]){_0x39ac00[_0x1a38('0x36')]=[{'all':!![]}];}_0x39ac00=_[_0x1a38('0x37')]({},_0x39ac00,_0x59d9cc[_0x1a38('0x38')]);return db[_0x1a38('0x2e')][_0x1a38('0x39')](_0x39ac00)['then'](handleEntityNotFound(_0x4be61f,null))[_0x1a38('0x25')](respondWithResult(_0x4be61f,null))[_0x1a38('0x3a')](handleError(_0x4be61f,null));};exports[_0x1a38('0x3b')]=function(_0x54baf1,_0x2c8b24){return db[_0x1a38('0x2e')]['create'](_0x54baf1['body'],{})[_0x1a38('0x25')](respondWithResult(_0x2c8b24,0xc9))[_0x1a38('0x3a')](handleError(_0x2c8b24,null));};exports[_0x1a38('0x24')]=function(_0x29a32b,_0x490ab4){if(_0x29a32b['body']['id']){delete _0x29a32b[_0x1a38('0x3c')]['id'];}return db[_0x1a38('0x2e')][_0x1a38('0x39')]({'where':{'id':_0x29a32b[_0x1a38('0x2b')]['id']}})[_0x1a38('0x25')](handleEntityNotFound(_0x490ab4,null))[_0x1a38('0x25')](saveUpdates(_0x29a32b[_0x1a38('0x3c')],null))[_0x1a38('0x25')](respondWithResult(_0x490ab4,null))[_0x1a38('0x3a')](handleError(_0x490ab4,null));};exports[_0x1a38('0x26')]=function(_0x433755,_0x4971d0){return db[_0x1a38('0x2e')][_0x1a38('0x39')]({'where':{'id':_0x433755[_0x1a38('0x2b')]['id']}})[_0x1a38('0x25')](handleEntityNotFound(_0x4971d0,null))[_0x1a38('0x25')](removeEntity(_0x4971d0,null))[_0x1a38('0x3a')](handleError(_0x4971d0,null));}; \ No newline at end of file +var _0x3c70=['util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x391802,_0xde0fd){var _0x3aa73b=function(_0x31d199){while(--_0x31d199){_0x391802['push'](_0x391802['shift']());}};_0x3aa73b(++_0xde0fd);}(_0x3c70,0x10c));var _0x03c7=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x3c70[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x03c7('0x0'));var rimraf=require(_0x03c7('0x1'));var zipdir=require(_0x03c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03c7('0x3'));var moment=require(_0x03c7('0x4'));var BPromise=require(_0x03c7('0x5'));var Mustache=require(_0x03c7('0x6'));var util=require(_0x03c7('0x7'));var path=require(_0x03c7('0x8'));var sox=require('sox');var csv=require(_0x03c7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03c7('0xa'));var _=require(_0x03c7('0xb'));var squel=require(_0x03c7('0xc'));var crypto=require('crypto');var jsforce=require(_0x03c7('0xd'));var deskjs=require(_0x03c7('0xe'));var toCsv=require(_0x03c7('0x9'));var querystring=require('querystring');var Papa=require(_0x03c7('0xf'));var Redis=require('ioredis');var authService=require(_0x03c7('0x10'));var qs=require(_0x03c7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03c7('0x12'));var logger=require(_0x03c7('0x13'))(_0x03c7('0x14'));var utils=require(_0x03c7('0x15'));var config=require(_0x03c7('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe78fd1,_0xb1b40a){_0xb1b40a=_0xb1b40a||0xcc;return function(_0x49697f){if(_0x49697f){return _0xe78fd1[_0x03c7('0x17')](_0xb1b40a);}return _0xe78fd1[_0x03c7('0x18')](_0xb1b40a)[_0x03c7('0x19')]();};}function respondWithResult(_0x2c57af,_0x1d9668){_0x1d9668=_0x1d9668||0xc8;return function(_0x5adce3){if(_0x5adce3){return _0x2c57af[_0x03c7('0x18')](_0x1d9668)['json'](_0x5adce3);}};}function respondWithFilteredResult(_0xdc48a7,_0x1ae657){return function(_0x4e3ff5){if(_0x4e3ff5){var _0x9a3264=typeof _0x1ae657[_0x03c7('0x1a')]===_0x03c7('0x1b')&&typeof _0x1ae657['limit']===_0x03c7('0x1b');var _0x6c852d=_0x4e3ff5[_0x03c7('0x1c')];var _0xdb40cc=_0x9a3264?0x0:_0x1ae657[_0x03c7('0x1a')];var _0x2946d7=_0x9a3264?_0x4e3ff5['count']:_0x1ae657['offset']+_0x1ae657[_0x03c7('0x1d')];var _0x2cd27c;if(_0x2946d7>=_0x6c852d){_0x2946d7=_0x6c852d;_0x2cd27c=0xc8;}else{_0x2cd27c=0xce;}_0xdc48a7[_0x03c7('0x18')](_0x2cd27c);return _0xdc48a7[_0x03c7('0x1e')](_0x03c7('0x1f'),_0xdb40cc+'-'+_0x2946d7+'/'+_0x6c852d)['json'](_0x4e3ff5);}return null;};}function patchUpdates(_0x1e3de1){return function(_0x1e6fae){try{jsonpatch['apply'](_0x1e6fae,_0x1e3de1,!![]);}catch(_0x4e8062){return BPromise['reject'](_0x4e8062);}return _0x1e6fae[_0x03c7('0x20')]();};}function saveUpdates(_0x734b3b,_0x3a5da2){return function(_0x50b316){if(_0x50b316){return _0x50b316[_0x03c7('0x21')](_0x734b3b)[_0x03c7('0x22')](function(_0x3c960a){return _0x3c960a;});}return null;};}function removeEntity(_0x4d6a9c,_0xfa2d9e){return function(_0x4795e7){if(_0x4795e7){return _0x4795e7[_0x03c7('0x23')]()['then'](function(){_0x4d6a9c[_0x03c7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270ee3,_0x304337){return function(_0x246f9d){if(!_0x246f9d){_0x270ee3['sendStatus'](0x194);}return _0x246f9d;};}function handleError(_0x3b1cbb,_0x2a4ac4){_0x2a4ac4=_0x2a4ac4||0x1f4;return function(_0x222912){logger[_0x03c7('0x24')](_0x222912['stack']);if(_0x222912['name']){delete _0x222912[_0x03c7('0x25')];}_0x3b1cbb['status'](_0x2a4ac4)[_0x03c7('0x26')](_0x222912);};}exports[_0x03c7('0x27')]=function(_0x51929b,_0x24a331){var _0x462f08={'raw':!![],'where':{'id':_0x51929b[_0x03c7('0x28')]['id']}},_0x153be5={};_0x153be5[_0x03c7('0x29')]=_[_0x03c7('0x2a')](db[_0x03c7('0x2b')][_0x03c7('0x2c')]);_0x153be5[_0x03c7('0x2d')]=_[_0x03c7('0x2a')](_0x51929b[_0x03c7('0x2d')]);_0x153be5['filters']=_[_0x03c7('0x2e')](_0x153be5[_0x03c7('0x29')],_0x153be5[_0x03c7('0x2d')]);_0x462f08['attributes']=_['intersection'](_0x153be5['model'],qs[_0x03c7('0x2f')](_0x51929b['query'][_0x03c7('0x2f')]));_0x462f08[_0x03c7('0x30')]=_0x462f08[_0x03c7('0x30')]['length']?_0x462f08[_0x03c7('0x30')]:_0x153be5[_0x03c7('0x29')];if(_0x51929b[_0x03c7('0x2d')]['includeAll']){_0x462f08[_0x03c7('0x31')]=[{'all':!![]}];}_0x462f08=_[_0x03c7('0x32')]({},_0x462f08,_0x51929b['options']);return db[_0x03c7('0x2b')][_0x03c7('0x33')](_0x462f08)['then'](handleEntityNotFound(_0x24a331,null))[_0x03c7('0x22')](respondWithResult(_0x24a331,null))[_0x03c7('0x34')](handleError(_0x24a331,null));};exports[_0x03c7('0x35')]=function(_0x48a30b,_0x2309de){return db[_0x03c7('0x2b')][_0x03c7('0x35')](_0x48a30b[_0x03c7('0x36')],{})['then'](respondWithResult(_0x2309de,0xc9))[_0x03c7('0x34')](handleError(_0x2309de,null));};exports['update']=function(_0x132c1b,_0xc29c21){if(_0x132c1b[_0x03c7('0x36')]['id']){delete _0x132c1b[_0x03c7('0x36')]['id'];}return db[_0x03c7('0x2b')][_0x03c7('0x33')]({'where':{'id':_0x132c1b['params']['id']}})['then'](handleEntityNotFound(_0xc29c21,null))[_0x03c7('0x22')](saveUpdates(_0x132c1b[_0x03c7('0x36')],null))['then'](respondWithResult(_0xc29c21,null))[_0x03c7('0x34')](handleError(_0xc29c21,null));};exports[_0x03c7('0x23')]=function(_0x346335,_0x7c8ba5){return db[_0x03c7('0x2b')][_0x03c7('0x33')]({'where':{'id':_0x346335[_0x03c7('0x28')]['id']}})['then'](handleEntityNotFound(_0x7c8ba5,null))['then'](removeEntity(_0x7c8ba5,null))[_0x03c7('0x34')](handleError(_0x7c8ba5,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index bb389eb..5e96605 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 _0x98f0=['bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','util','../../config/logger','moment'];(function(_0x1d5dde,_0x151614){var _0x47e4ab=function(_0x3d54b5){while(--_0x3d54b5){_0x1d5dde['push'](_0x1d5dde['shift']());}};_0x47e4ab(++_0x151614);}(_0x98f0,0x1dd));var _0x098f=function(_0x429fe2,_0x21c22e){_0x429fe2=_0x429fe2-0x0;var _0x53aa98=_0x98f0[_0x429fe2];return _0x53aa98;};'use strict';var _=require('lodash');var util=require(_0x098f('0x0'));var logger=require(_0x098f('0x1'))('api');var moment=require(_0x098f('0x2'));var BPromise=require(_0x098f('0x3'));var rp=require(_0x098f('0x4'));var fs=require('fs');var path=require(_0x098f('0x5'));var rimraf=require('rimraf');var config=require(_0x098f('0x6'));var attributes=require(_0x098f('0x7'));module[_0x098f('0x8')]=function(_0x3db1e9,_0x49a2b2){return _0x3db1e9[_0x098f('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d45=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x4677ee,_0x5d58dd){var _0x3dda22=function(_0x16c414){while(--_0x16c414){_0x4677ee['push'](_0x4677ee['shift']());}};_0x3dda22(++_0x5d58dd);}(_0x6d45,0xa8));var _0x56d4=function(_0x2efdef,_0x80ec4f){_0x2efdef=_0x2efdef-0x0;var _0x22fa0c=_0x6d45[_0x2efdef];return _0x22fa0c;};'use strict';var _=require(_0x56d4('0x0'));var util=require(_0x56d4('0x1'));var logger=require('../../config/logger')(_0x56d4('0x2'));var moment=require(_0x56d4('0x3'));var BPromise=require(_0x56d4('0x4'));var rp=require(_0x56d4('0x5'));var fs=require('fs');var path=require(_0x56d4('0x6'));var rimraf=require(_0x56d4('0x7'));var config=require(_0x56d4('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x56d4('0x9')]=function(_0x2f9401,_0x9b809b){return _0x2f9401['define'](_0x56d4('0xa'),attributes,{'tableName':_0x56d4('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 51aa6b3..03ea4ad 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 _0x795e=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x48de38,_0x3a0a5c){var _0x3a8a8b=function(_0x1264ed){while(--_0x1264ed){_0x48de38['push'](_0x48de38['shift']());}};_0x3a8a8b(++_0x3a0a5c);}(_0x795e,0x177));var _0xe795=function(_0x496ade,_0x443c5a){_0x496ade=_0x496ade-0x0;var _0x41bef1=_0x795e[_0x496ade];return _0x41bef1;};'use strict';var _=require(_0xe795('0x0'));var util=require(_0xe795('0x1'));var moment=require(_0xe795('0x2'));var BPromise=require(_0xe795('0x3'));var rs=require(_0xe795('0x4'));var fs=require('fs');var Redis=require(_0xe795('0x5'));var db=require(_0xe795('0x6'))['db'];var utils=require(_0xe795('0x7'));var logger=require('../../config/logger')(_0xe795('0x8'));var config=require(_0xe795('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe795('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6c52,_0x175513,_0x38cf7a){return new BPromise(function(_0x26d37d,_0x347262){return client[_0xe795('0xb')](_0x4a6c52,_0x38cf7a)[_0xe795('0xc')](function(_0x26800d){logger['info'](_0xe795('0xd'),_0x175513,_0xe795('0xe'));logger[_0xe795('0xf')](_0xe795('0x10'),_0x175513,'request\x20sent',JSON['stringify'](_0x26800d));if(_0x26800d[_0xe795('0x11')]){if(_0x26800d[_0xe795('0x11')][_0xe795('0x12')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x175513,_0x26800d[_0xe795('0x11')][_0xe795('0x13')]);return _0x347262(_0x26800d['error'][_0xe795('0x13')]);}logger['error'](_0xe795('0xd'),_0x175513,_0x26800d['error'][_0xe795('0x13')]);return _0x26d37d(_0x26800d['error'][_0xe795('0x13')]);}else{logger[_0xe795('0x14')](_0xe795('0xd'),_0x175513,_0xe795('0xe'));_0x26d37d(_0x26800d[_0xe795('0x15')]['message']);}})[_0xe795('0x16')](function(_0x145770){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x175513,_0x145770);_0x347262(_0x145770);});});} \ No newline at end of file +var _0xb2f1=['../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4d82e1,_0x5ac72b){var _0x5f3bd9=function(_0x5380db){while(--_0x5380db){_0x4d82e1['push'](_0x4d82e1['shift']());}};_0x5f3bd9(++_0x5ac72b);}(_0xb2f1,0x6a));var _0x1b2f=function(_0x33f099,_0x21f5cd){_0x33f099=_0x33f099-0x0;var _0x109851=_0xb2f1[_0x33f099];return _0x109851;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var moment=require(_0x1b2f('0x2'));var BPromise=require(_0x1b2f('0x3'));var rs=require(_0x1b2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b2f('0x5'))['db'];var utils=require(_0x1b2f('0x6'));var logger=require(_0x1b2f('0x7'))(_0x1b2f('0x8'));var config=require(_0x1b2f('0x9'));var jayson=require(_0x1b2f('0xa'));var client=jayson[_0x1b2f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37192e,_0x2fbc52,_0x256316){return new BPromise(function(_0x383bbe,_0x7dc463){return client[_0x1b2f('0xc')](_0x37192e,_0x256316)[_0x1b2f('0xd')](function(_0x25491b){logger[_0x1b2f('0xe')](_0x1b2f('0xf'),_0x2fbc52,_0x1b2f('0x10'));logger[_0x1b2f('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2fbc52,'request\x20sent',JSON[_0x1b2f('0x12')](_0x25491b));if(_0x25491b[_0x1b2f('0x13')]){if(_0x25491b[_0x1b2f('0x13')][_0x1b2f('0x14')]===0x1f4){logger[_0x1b2f('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x2fbc52,_0x25491b['error'][_0x1b2f('0x15')]);return _0x7dc463(_0x25491b['error'][_0x1b2f('0x15')]);}logger['error'](_0x1b2f('0xf'),_0x2fbc52,_0x25491b[_0x1b2f('0x13')][_0x1b2f('0x15')]);return _0x383bbe(_0x25491b[_0x1b2f('0x13')][_0x1b2f('0x15')]);}else{logger['info'](_0x1b2f('0xf'),_0x2fbc52,_0x1b2f('0x10'));_0x383bbe(_0x25491b['result'][_0x1b2f('0x15')]);}})[_0x1b2f('0x16')](function(_0x5d6009){logger[_0x1b2f('0x13')](_0x1b2f('0xf'),_0x2fbc52,_0x5d6009);_0x7dc463(_0x5d6009);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1667e0a..946b923 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 _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x038b,0x114));var _0xb038=function(_0x15609b,_0x203633){_0x15609b=_0x15609b-0x0;var _0x40c5e8=_0x038b[_0x15609b];return _0x40c5e8;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router; \ No newline at end of file +var _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xc41898,_0x4b7fa8){_0xc41898=_0xc41898-0x0;var _0x3f1d80=_0x9c5a[_0xc41898];return _0x3f1d80;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7b4fd05..87c3cc5 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 _0x9cfe=['ENUM','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9cfe,0x96));var _0xe9cf=function(_0x3c8113,_0x788e9f){_0x3c8113=_0x3c8113-0x0;var _0x24079b=_0x9cfe[_0x3c8113];return _0x24079b;};'use strict';var Sequelize=require(_0xe9cf('0x0'));module[_0xe9cf('0x1')]={'name':{'type':Sequelize[_0xe9cf('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe9cf('0x2')]},'timeout':{'type':Sequelize[_0xe9cf('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe9cf('0x4')]('rrmemory',_0xe9cf('0x5'),_0xe9cf('0x6'))}}; \ No newline at end of file +var _0x8e92=['rrmemory','roundrobin','sequelize','name','ENUM'];(function(_0x413786,_0x50e1a0){var _0x39365a=function(_0x398bbb){while(--_0x398bbb){_0x413786['push'](_0x413786['shift']());}};_0x39365a(++_0x50e1a0);}(_0x8e92,0x147));var _0x28e9=function(_0x254691,_0x2618e5){_0x254691=_0x254691-0x0;var _0x2bccd5=_0x8e92[_0x254691];return _0x2bccd5;};'use strict';var Sequelize=require(_0x28e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x28e9('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x28e9('0x2')](_0x28e9('0x3'),'beepall',_0x28e9('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 6944d45..a3698d3 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 _0xf148=['stack','index','map','rawAttributes','fieldName','type','key','name','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','rows','show','params','fields','include','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','describe','findOne','UserChatQueue','order','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','QueryTypes','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','omit','isArray','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','sendStatus'];(function(_0xf8bbac,_0x3c9c1d){var _0x4e19dd=function(_0x108e8e){while(--_0x108e8e){_0xf8bbac['push'](_0xf8bbac['shift']());}};_0x4e19dd(++_0x3c9c1d);}(_0xf148,0x184));var _0x8f14=function(_0x528eaf,_0x4cc41c){_0x528eaf=_0x528eaf-0x0;var _0x39922d=_0xf148[_0x528eaf];return _0x39922d;};'use strict';var emlformat=require(_0x8f14('0x0'));var rimraf=require(_0x8f14('0x1'));var zipdir=require(_0x8f14('0x2'));var jsonpatch=require(_0x8f14('0x3'));var rp=require(_0x8f14('0x4'));var moment=require('moment');var BPromise=require(_0x8f14('0x5'));var Mustache=require(_0x8f14('0x6'));var util=require(_0x8f14('0x7'));var path=require(_0x8f14('0x8'));var sox=require(_0x8f14('0x9'));var csv=require(_0x8f14('0xa'));var ejs=require(_0x8f14('0xb'));var fs=require('fs');var fs_extra=require(_0x8f14('0xc'));var _=require('lodash');var squel=require(_0x8f14('0xd'));var crypto=require('crypto');var jsforce=require(_0x8f14('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f14('0xf'));var Redis=require('ioredis');var authService=require(_0x8f14('0x10'));var qs=require(_0x8f14('0x11'));var as=require(_0x8f14('0x12'));var hardwareService=require(_0x8f14('0x13'));var logger=require(_0x8f14('0x14'))(_0x8f14('0x15'));var utils=require(_0x8f14('0x16'));var config=require(_0x8f14('0x17'));var licenseUtil=require(_0x8f14('0x18'));var db=require(_0x8f14('0x19'))['db'];config['redis']=_[_0x8f14('0x1a')](config[_0x8f14('0x1b')],{'host':_0x8f14('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f14('0x1b')]));require('./chatQueue.socket')[_0x8f14('0x1d')](socket);var jayson=require(_0x8f14('0x1e'));var client=jayson[_0x8f14('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cc3b3,_0x245bc0,_0x4b1a10,_0x496373){return new BPromise(function(_0x529bc0,_0x2d3568){var _0xc2f0e=_0x496373||client;return _0xc2f0e[_0x8f14('0x20')](_0x4cc3b3,_0x4b1a10)[_0x8f14('0x21')](function(_0x4992a8){logger['info'](_0x8f14('0x22'),_0x245bc0,_0x8f14('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x245bc0,'request\x20sent',JSON['stringify'](_0x4992a8));if(_0x4992a8[_0x8f14('0x24')]){if(_0x4992a8[_0x8f14('0x24')]['code']===0x1f4){logger[_0x8f14('0x24')](_0x8f14('0x22'),_0x245bc0,_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);return _0x2d3568(_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);}logger['error'](_0x8f14('0x22'),_0x245bc0,_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);return _0x529bc0(_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);}else{logger[_0x8f14('0x26')](_0x8f14('0x22'),_0x245bc0,_0x8f14('0x23'));_0x529bc0(_0x4992a8[_0x8f14('0x27')][_0x8f14('0x25')]);}})[_0x8f14('0x28')](function(_0x35aaaa){logger[_0x8f14('0x24')]('ChatQueue,\x20%s,\x20%s',_0x245bc0,_0x35aaaa);_0x2d3568(_0x35aaaa);});});}function respondWithStatusCode(_0x39763f,_0x4418c8){_0x4418c8=_0x4418c8||0xcc;return function(_0x4cf151){if(_0x4cf151){return _0x39763f['sendStatus'](_0x4418c8);}return _0x39763f[_0x8f14('0x29')](_0x4418c8)['end']();};}function respondWithResult(_0x1cf33e,_0x207364){_0x207364=_0x207364||0xc8;return function(_0x434a69){if(_0x434a69){return _0x1cf33e[_0x8f14('0x29')](_0x207364)[_0x8f14('0x2a')](_0x434a69);}};}function respondWithFilteredResult(_0x4d3e5f,_0x455888){return function(_0x208dc0){if(_0x208dc0){var _0x1502dd=typeof _0x455888[_0x8f14('0x2b')]===_0x8f14('0x2c')&&typeof _0x455888['limit']==='undefined';var _0x5ba989=_0x208dc0[_0x8f14('0x2d')];var _0xafc65=_0x1502dd?0x0:_0x455888[_0x8f14('0x2b')];var _0x1f2edc=_0x1502dd?_0x208dc0[_0x8f14('0x2d')]:_0x455888[_0x8f14('0x2b')]+_0x455888[_0x8f14('0x2e')];var _0x2b9bf1;if(_0x1f2edc>=_0x5ba989){_0x1f2edc=_0x5ba989;_0x2b9bf1=0xc8;}else{_0x2b9bf1=0xce;}_0x4d3e5f[_0x8f14('0x29')](_0x2b9bf1);return _0x4d3e5f[_0x8f14('0x2f')](_0x8f14('0x30'),_0xafc65+'-'+_0x1f2edc+'/'+_0x5ba989)['json'](_0x208dc0);}return null;};}function patchUpdates(_0x1bd39c){return function(_0x101b67){try{jsonpatch[_0x8f14('0x31')](_0x101b67,_0x1bd39c,!![]);}catch(_0x3f428a){return BPromise[_0x8f14('0x32')](_0x3f428a);}return _0x101b67['save']();};}function saveUpdates(_0x330b44,_0x313587){return function(_0x7e10cd){if(_0x7e10cd){return _0x7e10cd[_0x8f14('0x33')](_0x330b44)[_0x8f14('0x21')](function(_0x88876d){return _0x88876d;});}return null;};}function removeEntity(_0x2722f2,_0x104f44){return function(_0x2b2b6d){if(_0x2b2b6d){return _0x2b2b6d[_0x8f14('0x34')]()[_0x8f14('0x21')](function(){var _0x985e05=_0x2b2b6d[_0x8f14('0x35')]({'plain':!![]});var _0x583a66=_0x8f14('0x36');return db['UserProfileResource'][_0x8f14('0x34')]({'where':{'type':_0x583a66,'resourceId':_0x985e05['id']}})[_0x8f14('0x21')](function(){return _0x2b2b6d;});})[_0x8f14('0x21')](function(){_0x2722f2[_0x8f14('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e6fb,_0x244d61){return function(_0x217972){if(!_0x217972){_0x59e6fb[_0x8f14('0x37')](0x194);}return _0x217972;};}function handleError(_0x2630df,_0x324d00){_0x324d00=_0x324d00||0x1f4;return function(_0x108d17){logger[_0x8f14('0x24')](_0x108d17[_0x8f14('0x38')]);if(_0x108d17['name']){delete _0x108d17['name'];}_0x2630df['status'](_0x324d00)['send'](_0x108d17);};}exports[_0x8f14('0x39')]=function(_0xe435b2,_0x2c3ff5){var _0x45cb73={},_0x251e59={},_0x77dd8e={'count':0x0,'rows':[]};var _0x1ab42b=_[_0x8f14('0x3a')](db['ChatQueue'][_0x8f14('0x3b')],function(_0x5808d4){return{'name':_0x5808d4[_0x8f14('0x3c')],'type':_0x5808d4[_0x8f14('0x3d')][_0x8f14('0x3e')]};});_0x251e59['model']=_[_0x8f14('0x3a')](_0x1ab42b,_0x8f14('0x3f'));_0x251e59['query']=_[_0x8f14('0x40')](_0xe435b2[_0x8f14('0x41')]);_0x251e59['filters']=_[_0x8f14('0x42')](_0x251e59[_0x8f14('0x43')],_0x251e59[_0x8f14('0x41')]);_0x45cb73[_0x8f14('0x44')]=_[_0x8f14('0x42')](_0x251e59[_0x8f14('0x43')],qs['fields'](_0xe435b2[_0x8f14('0x41')]['fields']));_0x45cb73['attributes']=_0x45cb73['attributes'][_0x8f14('0x45')]?_0x45cb73['attributes']:_0x251e59[_0x8f14('0x43')];if(!_0xe435b2['query'][_0x8f14('0x46')](_0x8f14('0x47'))){_0x45cb73['limit']=qs[_0x8f14('0x2e')](_0xe435b2['query']['limit']);_0x45cb73[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0xe435b2[_0x8f14('0x41')][_0x8f14('0x2b')]);}_0x45cb73['order']=qs['sort'](_0xe435b2['query'][_0x8f14('0x48')]);_0x45cb73[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0xe435b2[_0x8f14('0x41')],_0x251e59['filters']),_0x1ab42b);if(_0xe435b2[_0x8f14('0x41')][_0x8f14('0x4c')]){_0x45cb73[_0x8f14('0x49')]=_[_0x8f14('0x4d')](_0x45cb73['where'],{'$or':_[_0x8f14('0x3a')](_0x1ab42b,function(_0x4975cf){if(_0x4975cf['type']!==_0x8f14('0x4e')){var _0x23e1db={};_0x23e1db[_0x4975cf['name']]={'$like':'%'+_0xe435b2[_0x8f14('0x41')]['filter']+'%'};return _0x23e1db;}})});}_0x45cb73=_[_0x8f14('0x4d')]({},_0x45cb73,_0xe435b2[_0x8f14('0x4f')]);var _0x6525b6={'where':_0x45cb73[_0x8f14('0x49')]};return db[_0x8f14('0x50')][_0x8f14('0x2d')](_0x6525b6)[_0x8f14('0x21')](function(_0x52e43e){_0x77dd8e['count']=_0x52e43e;if(_0xe435b2['query'][_0x8f14('0x51')]){_0x45cb73['include']=[{'all':!![]}];}return db[_0x8f14('0x50')]['findAll'](_0x45cb73);})['then'](function(_0x92e8dc){_0x77dd8e[_0x8f14('0x52')]=_0x92e8dc;return _0x77dd8e;})[_0x8f14('0x21')](respondWithFilteredResult(_0x2c3ff5,_0x45cb73))['catch'](handleError(_0x2c3ff5,null));};exports[_0x8f14('0x53')]=function(_0xdd4124,_0x435182){var _0x333b19={'raw':!![],'where':{'id':_0xdd4124[_0x8f14('0x54')]['id']}},_0x3affca={};_0x3affca[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x50')][_0x8f14('0x3b')]);_0x3affca[_0x8f14('0x41')]=_[_0x8f14('0x40')](_0xdd4124[_0x8f14('0x41')]);_0x3affca[_0x8f14('0x4a')]=_[_0x8f14('0x42')](_0x3affca['model'],_0x3affca['query']);_0x333b19[_0x8f14('0x44')]=_[_0x8f14('0x42')](_0x3affca['model'],qs['fields'](_0xdd4124[_0x8f14('0x41')][_0x8f14('0x55')]));_0x333b19[_0x8f14('0x44')]=_0x333b19['attributes'][_0x8f14('0x45')]?_0x333b19[_0x8f14('0x44')]:_0x3affca[_0x8f14('0x43')];if(_0xdd4124['query']['includeAll']){_0x333b19[_0x8f14('0x56')]=[{'all':!![]}];}_0x333b19=_[_0x8f14('0x4d')]({},_0x333b19,_0xdd4124[_0x8f14('0x4f')]);return db[_0x8f14('0x50')][_0x8f14('0x57')](_0x333b19)[_0x8f14('0x21')](handleEntityNotFound(_0x435182,null))[_0x8f14('0x21')](respondWithResult(_0x435182,null))[_0x8f14('0x28')](handleError(_0x435182,null));};exports[_0x8f14('0x58')]=function(_0xd99ea6,_0x38f0e7){return db[_0x8f14('0x50')][_0x8f14('0x58')](_0xd99ea6[_0x8f14('0x59')],{})[_0x8f14('0x21')](function(_0x124e69){var _0xba2d5c=_0xd99ea6[_0x8f14('0x5a')][_0x8f14('0x35')]({'plain':!![]});if(!_0xba2d5c)throw new Error(_0x8f14('0x5b'));if(_0xba2d5c[_0x8f14('0x5c')]===_0x8f14('0x5a')){var _0x35d449=_0x124e69[_0x8f14('0x35')]({'plain':!![]});var _0x3532dc=_0x8f14('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x3532dc,'userProfileId':_0xba2d5c[_0x8f14('0x5d')]},'raw':!![]})[_0x8f14('0x21')](function(_0x25611d){if(_0x25611d&&_0x25611d[_0x8f14('0x5e')]===0x0){return db[_0x8f14('0x5f')]['create']({'name':_0x35d449[_0x8f14('0x3f')],'resourceId':_0x35d449['id'],'type':_0x25611d[_0x8f14('0x3f')],'sectionId':_0x25611d['id']},{})[_0x8f14('0x21')](function(){return _0x124e69;});}else{return _0x124e69;}})[_0x8f14('0x28')](function(_0xb6a93a){logger[_0x8f14('0x24')](_0x8f14('0x60'),_0xb6a93a);throw _0xb6a93a;});}return _0x124e69;})[_0x8f14('0x21')](respondWithResult(_0x38f0e7,0xc9))['catch'](handleError(_0x38f0e7,null));};exports[_0x8f14('0x33')]=function(_0x1032a8,_0x536942){if(_0x1032a8[_0x8f14('0x59')]['id']){delete _0x1032a8[_0x8f14('0x59')]['id'];}return db['ChatQueue'][_0x8f14('0x57')]({'where':{'id':_0x1032a8[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x536942,null))[_0x8f14('0x21')](saveUpdates(_0x1032a8[_0x8f14('0x59')],null))['then'](respondWithResult(_0x536942,null))[_0x8f14('0x28')](handleError(_0x536942,null));};exports[_0x8f14('0x34')]=function(_0xe8b0ba,_0x829160){return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0xe8b0ba[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x829160,null))['then'](removeEntity(_0x829160,null))[_0x8f14('0x28')](handleError(_0x829160,null));};exports['describe']=function(_0x10d71b,_0x4fcf93){return db['ChatQueue'][_0x8f14('0x61')]()[_0x8f14('0x21')](respondWithResult(_0x4fcf93,null))[_0x8f14('0x28')](handleError(_0x4fcf93,null));};exports['getMembers']=function(_0x2f5118,_0x4002b4,_0xe6c40c){var _0x9f8c17={'raw':!![],'where':{}},_0x5e6c5e={},_0x216373;return db[_0x8f14('0x50')][_0x8f14('0x62')]({'where':{'id':_0x2f5118[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x4002b4,null))[_0x8f14('0x21')](function(_0x218d2c){if(_0x218d2c){_0x216373=_0x218d2c[_0x8f14('0x35')]({'plain':!![]});_0x5e6c5e[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x63')][_0x8f14('0x3b')]);_0x5e6c5e[_0x8f14('0x41')]=_[_0x8f14('0x40')](_0x2f5118[_0x8f14('0x41')]);_0x5e6c5e[_0x8f14('0x4a')]=_['intersection'](_0x5e6c5e[_0x8f14('0x43')],_0x5e6c5e[_0x8f14('0x41')]);_0x9f8c17[_0x8f14('0x44')]=_['intersection'](_0x5e6c5e['model'],qs[_0x8f14('0x55')](_0x2f5118[_0x8f14('0x41')]['fields']));_0x9f8c17[_0x8f14('0x44')]=_0x9f8c17['attributes'][_0x8f14('0x45')]?_0x9f8c17['attributes']:_0x5e6c5e[_0x8f14('0x43')];if(!_0x2f5118['query'][_0x8f14('0x46')](_0x8f14('0x47'))){_0x9f8c17[_0x8f14('0x2e')]=qs[_0x8f14('0x2e')](_0x2f5118[_0x8f14('0x41')][_0x8f14('0x2e')]);_0x9f8c17[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0x2f5118[_0x8f14('0x41')]['offset']);}_0x9f8c17[_0x8f14('0x64')]=qs['sort'](_0x2f5118['query'][_0x8f14('0x48')]);_0x9f8c17[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0x2f5118[_0x8f14('0x41')],_0x5e6c5e['filters']));_0x9f8c17[_0x8f14('0x49')]['ChatQueueId']=_0x218d2c['id'];if(_0x2f5118[_0x8f14('0x41')][_0x8f14('0x4c')]){_0x9f8c17[_0x8f14('0x49')]=_[_0x8f14('0x4d')](_0x9f8c17[_0x8f14('0x49')],{'$or':_['map'](_0x9f8c17[_0x8f14('0x44')],function(_0x4f3844){var _0x4e2c7a={};_0x4e2c7a[_0x4f3844]={'$like':'%'+_0x2f5118[_0x8f14('0x41')][_0x8f14('0x4c')]+'%'};return _0x4e2c7a;})});}_0x9f8c17=_[_0x8f14('0x4d')]({},_0x9f8c17,_0x2f5118['options']);return db['UserChatQueue'][_0x8f14('0x65')](_0x9f8c17);}})[_0x8f14('0x21')](function(_0x182fa2){if(_0x182fa2){return db[_0x8f14('0x66')]['findAndCountAll']({'where':{'id':_['map'](_0x182fa2,_0x8f14('0x67')),'role':_0x8f14('0x68')},'attributes':['id',_0x8f14('0x3f'),_0x8f14('0x69'),_0x8f14('0x6a'),_0x8f14('0x6b')]});}})[_0x8f14('0x21')](function(_0x494611){if(_0x494611){return{'count':_0x494611[_0x8f14('0x2d')],'rows':_['map'](_0x494611['rows'],function(_0x182396){return{'membername':_0x182396[_0x8f14('0x3f')],'UserId':_0x182396['id'],'queue_name':_0x216373[_0x8f14('0x3f')],'ChatQueueId':_0x216373['id'],'interface':util[_0x8f14('0x6c')](_0x8f14('0x6d'),_0x8f14('0x6e'),_0x182396['name']),'penalty':0x0,'paused':_0x182396[_0x8f14('0x69')],'createdAt':_0x182396[_0x8f14('0x6b')],'updatedAt':_0x182396[_0x8f14('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8f14('0x21')](respondWithFilteredResult(_0x4002b4,_0x9f8c17))[_0x8f14('0x28')](handleError(_0x4002b4,null));};exports[_0x8f14('0x6f')]=function(_0x1e4fb3,_0x5ac69f,_0x1ba288){var _0x9e7df2={};var _0x305488={};var _0x3912ee;var _0x3dc3bb;return db[_0x8f14('0x50')][_0x8f14('0x62')]({'where':{'id':_0x1e4fb3[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x5ac69f,null))[_0x8f14('0x21')](function(_0x51005e){if(_0x51005e){_0x3912ee=_0x51005e;_0x305488[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x70')]['rawAttributes']);_0x305488[_0x8f14('0x41')]=_['keys'](_0x1e4fb3[_0x8f14('0x41')]);_0x305488[_0x8f14('0x4a')]=_[_0x8f14('0x42')](_0x305488[_0x8f14('0x43')],_0x305488[_0x8f14('0x41')]);_0x9e7df2['attributes']=_[_0x8f14('0x42')](_0x305488[_0x8f14('0x43')],qs[_0x8f14('0x55')](_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x55')]));_0x9e7df2[_0x8f14('0x44')]=_0x9e7df2[_0x8f14('0x44')][_0x8f14('0x45')]?_0x9e7df2[_0x8f14('0x44')]:_0x305488['model'];_0x9e7df2['order']=qs[_0x8f14('0x48')](_0x1e4fb3['query'][_0x8f14('0x48')]);_0x9e7df2[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0x1e4fb3[_0x8f14('0x41')],_0x305488[_0x8f14('0x4a')]));if(_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x4c')]){_0x9e7df2['where']=_[_0x8f14('0x4d')](_0x9e7df2[_0x8f14('0x49')],{'$or':_[_0x8f14('0x3a')](_0x9e7df2[_0x8f14('0x44')],function(_0x489916){var _0x291870={};_0x291870[_0x489916]={'$like':'%'+_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x4c')]+'%'};return _0x291870;})});}_0x9e7df2=_['merge']({},_0x9e7df2,_0x1e4fb3[_0x8f14('0x4f')]);return _0x3912ee[_0x8f14('0x6f')](_0x9e7df2);}})[_0x8f14('0x21')](function(_0x3cb4eb){if(_0x3cb4eb){_0x3dc3bb=_0x3cb4eb[_0x8f14('0x45')];if(!_0x1e4fb3['query'][_0x8f14('0x46')](_0x8f14('0x47'))){_0x9e7df2['limit']=qs['limit'](_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x2e')]);_0x9e7df2[_0x8f14('0x2b')]=qs['offset'](_0x1e4fb3['query']['offset']);}return _0x3912ee['getTeams'](_0x9e7df2);}})[_0x8f14('0x21')](function(_0x801bc9){if(_0x801bc9){return _0x801bc9?{'count':_0x3dc3bb,'rows':_0x801bc9}:null;}})[_0x8f14('0x21')](respondWithResult(_0x5ac69f,null))['catch'](handleError(_0x5ac69f,null));};exports[_0x8f14('0x71')]=function(_0x3c5543,_0x5e7331,_0x17d0df){var _0x1fc5c8=_0x3c5543['body'][_0x8f14('0x72')];return db[_0x8f14('0x70')][_0x8f14('0x65')]({'where':{'id':_0x1fc5c8},'attributes':['id'],'include':[{'model':db[_0x8f14('0x66')],'as':'Agents','attributes':['id',_0x8f14('0x3f'),_0x8f14('0x73'),_0x8f14('0x74'),_0x8f14('0x75')],'raw':!![]}]})[_0x8f14('0x21')](function(_0x62f766){if(_0x62f766){var _0x29242d=_[_0x8f14('0x76')](_0x62f766,function(_0x3472d6){var _0x3c3de1=_0x3472d6['get']({'plain':!![]});return _0x3c3de1[_0x8f14('0x77')];});return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x3c5543[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](function(_0x2937d2){return db[_0x8f14('0x78')][_0x8f14('0x79')](function(_0x1e5293){return _0x2937d2[_0x8f14('0x71')](_0x1fc5c8,{'transaction':_0x1e5293})[_0x8f14('0x21')](function(){return BPromise[_0x8f14('0x7a')](_0x29242d,function(_0x35361a){return db[_0x8f14('0x63')][_0x8f14('0x7b')]({'where':{'UserId':_0x35361a['id'],'ChatQueueId':_0x3c5543[_0x8f14('0x54')]['id']},'transaction':_0x1e5293});});})[_0x8f14('0x21')](function(){_0x29242d[_0x8f14('0x7c')](function(_0x39354d){socket['emit'](_0x8f14('0x7d'),{'UserId':_0x39354d['id'],'ChatQueueId':_0x2937d2['id']});});});});});}})[_0x8f14('0x21')](respondWithStatusCode(_0x5e7331,null))['catch'](handleError(_0x5e7331,null));};exports['removeTeams']=function(_0x3d1b0e,_0x5048f1,_0x2d1c92){return db[_0x8f14('0x70')][_0x8f14('0x65')]({'where':{'id':_0x3d1b0e[_0x8f14('0x41')][_0x8f14('0x72')]},'attributes':['id'],'include':[{'model':db[_0x8f14('0x66')],'as':_0x8f14('0x77'),'attributes':['id'],'raw':!![]}]})[_0x8f14('0x21')](handleEntityNotFound(_0x5048f1,null))[_0x8f14('0x21')](function(_0x323211){var _0x15dc65=_[_0x8f14('0x3a')](_0x323211,'id');var _0x3f08dd=[];var _0x245c2c=[];var _0x46b971=squel[_0x8f14('0x7e')]();_0x46b971[_0x8f14('0x7f')](_0x8f14('0x80'))[_0x8f14('0x81')](_0x8f14('0x82'),'tq')['join'](_0x8f14('0x83'),'ut',_0x8f14('0x84'))[_0x8f14('0x49')](_0x8f14('0x85'),_0x3d1b0e[_0x8f14('0x54')]['id']);for(var _0x3d79bc=0x0;_0x3d79bc<_0x323211[_0x8f14('0x45')];_0x3d79bc+=0x1){let _0x1ebf57=_0x323211[_0x3d79bc];for(var _0x1ce66c=0x0;_0x1ce66c<_0x1ebf57[_0x8f14('0x77')]['length'];_0x1ce66c+=0x1){let _0x548c87=_0x1ebf57[_0x8f14('0x77')][_0x1ce66c];var _0x2a60d1=_0x46b971['clone']();_0x2a60d1[_0x8f14('0x49')]('ut.UserId\x20=\x20?',_0x548c87['id']);_0x245c2c['push'](db['sequelize']['query'](_0x2a60d1['toString'](),{'type':db[_0x8f14('0x78')][_0x8f14('0x86')]['SELECT']})[_0x8f14('0x21')](function(_0x406e12){if(_0x406e12[_0x8f14('0x45')]===0x1){return _0x548c87['id'];}else{var _0x366a1b=_[_0x8f14('0x87')](_[_0x8f14('0x3a')](_0x406e12,_0x8f14('0x88')),function(_0x1cdea1){return _[_0x8f14('0x89')](_0x15dc65,_0x1cdea1);});if(_0x366a1b){return _0x548c87['id'];}}}));}}return BPromise[_0x8f14('0x8a')](_0x245c2c)[_0x8f14('0x21')](function(_0x2296d2){_0x3f08dd=_(_0x3f08dd)[_0x8f14('0x8b')](_0x2296d2)[_0x8f14('0x8c')]()['value']();return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x3d1b0e[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](function(_0x473dbf){return db[_0x8f14('0x78')][_0x8f14('0x79')](function(_0x138748){return _0x473dbf[_0x8f14('0x8d')](_0x3d1b0e[_0x8f14('0x41')]['ids'],{'transaction':_0x138748})['then'](function(){if(!_[_0x8f14('0x8e')](_0x3f08dd)){return _0x473dbf[_0x8f14('0x8f')](_0x3f08dd,{'transaction':_0x138748});}})[_0x8f14('0x21')](function(){_0x3f08dd[_0x8f14('0x7c')](function(_0x3ef81a){socket[_0x8f14('0x90')](_0x8f14('0x91'),{'UserId':_0x3ef81a,'ChatQueueId':_0x473dbf['id']});});});});});});})[_0x8f14('0x21')](respondWithStatusCode(_0x5048f1,null))[_0x8f14('0x28')](handleError(_0x5048f1,null));};exports['addAgents']=function(_0x22cb20,_0x5e7332,_0x553998){return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x22cb20[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x5e7332,null))['then'](function(_0xcc105c){if(_0xcc105c){return _0xcc105c['addAgents'](_0x22cb20[_0x8f14('0x59')]['ids'],_[_0x8f14('0x92')](_0x22cb20['body'],[_0x8f14('0x72'),'id'])||{})['spread'](function(_0x10dbdf){for(var _0x5e82e9=0x0;_0x5e82e9<_0x22cb20[_0x8f14('0x59')][_0x8f14('0x72')][_0x8f14('0x45')];_0x5e82e9+=0x1){socket[_0x8f14('0x90')](_0x8f14('0x7d'),{'UserId':Number(_0x22cb20[_0x8f14('0x59')][_0x8f14('0x72')][_0x5e82e9]),'ChatQueueId':Number(_0x22cb20[_0x8f14('0x54')]['id'])});}return _0x10dbdf;});}})[_0x8f14('0x21')](respondWithResult(_0x5e7332,null))[_0x8f14('0x28')](handleError(_0x5e7332,null));};exports[_0x8f14('0x8f')]=function(_0x1fa090,_0x56d42e,_0x61036f){return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x1fa090[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x56d42e,null))[_0x8f14('0x21')](function(_0x213d27){if(_0x213d27){return _0x213d27[_0x8f14('0x8f')](_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')])[_0x8f14('0x21')](function(){if(_[_0x8f14('0x93')](_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')])){for(var _0x37e131=0x0;_0x37e131<_0x1fa090['query'][_0x8f14('0x72')][_0x8f14('0x45')];_0x37e131+=0x1){socket[_0x8f14('0x90')](_0x8f14('0x91'),{'UserId':Number(_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')][_0x37e131]),'ChatQueueId':Number(_0x1fa090[_0x8f14('0x54')]['id'])});}}else{socket[_0x8f14('0x90')]('userChatQueue:remove',{'UserId':Number(_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')]),'ChatQueueId':Number(_0x1fa090[_0x8f14('0x54')]['id'])});}});}})[_0x8f14('0x21')](respondWithStatusCode(_0x56d42e,null))[_0x8f14('0x28')](handleError(_0x56d42e,null));};exports['getAgents']=function(_0x32c321,_0x5a67b2,_0x10ee1b){var _0x187346={};var _0x1dbcf2={};var _0x514627;var _0x7ba174;return db[_0x8f14('0x50')][_0x8f14('0x62')]({'where':{'id':_0x32c321['params']['id']}})['then'](handleEntityNotFound(_0x5a67b2,null))['then'](function(_0x2f08cf){if(_0x2f08cf){_0x514627=_0x2f08cf;_0x1dbcf2[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x66')]['rawAttributes']);_0x1dbcf2[_0x8f14('0x41')]=_[_0x8f14('0x40')](_0x32c321[_0x8f14('0x41')]);_0x1dbcf2[_0x8f14('0x4a')]=_['intersection'](_0x1dbcf2['model'],_0x1dbcf2[_0x8f14('0x41')]);_0x187346['attributes']=_[_0x8f14('0x42')](_0x1dbcf2[_0x8f14('0x43')],qs[_0x8f14('0x55')](_0x32c321[_0x8f14('0x41')][_0x8f14('0x55')]));_0x187346[_0x8f14('0x44')]=_0x187346[_0x8f14('0x44')]['length']?_0x187346[_0x8f14('0x44')]:_0x1dbcf2[_0x8f14('0x43')];_0x187346[_0x8f14('0x64')]=qs[_0x8f14('0x48')](_0x32c321[_0x8f14('0x41')][_0x8f14('0x48')]);_0x187346[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0x32c321[_0x8f14('0x41')],_0x1dbcf2[_0x8f14('0x4a')]));if(_0x32c321[_0x8f14('0x41')]['filter']){_0x187346['where']=_['merge'](_0x187346['where'],{'$or':_[_0x8f14('0x3a')](_0x187346['attributes'],function(_0x373776){var _0x3ebf6e={};_0x3ebf6e[_0x373776]={'$like':'%'+_0x32c321[_0x8f14('0x41')]['filter']+'%'};return _0x3ebf6e;})});}_0x187346=_[_0x8f14('0x4d')]({},_0x187346,_0x32c321['options']);return _0x514627['getAgents'](_0x187346);}})[_0x8f14('0x21')](function(_0x2454af){if(_0x2454af){_0x7ba174=_0x2454af[_0x8f14('0x45')];if(!_0x32c321[_0x8f14('0x41')]['hasOwnProperty'](_0x8f14('0x47'))){_0x187346[_0x8f14('0x2e')]=qs[_0x8f14('0x2e')](_0x32c321['query'][_0x8f14('0x2e')]);_0x187346['offset']=qs[_0x8f14('0x2b')](_0x32c321['query']['offset']);}return _0x514627['getAgents'](_0x187346);}})[_0x8f14('0x21')](function(_0x3ed80d){if(_0x3ed80d){return _0x3ed80d?{'count':_0x7ba174,'rows':_0x3ed80d}:null;}})[_0x8f14('0x21')](respondWithResult(_0x5a67b2,null))[_0x8f14('0x28')](handleError(_0x5a67b2,null));}; \ No newline at end of file +var _0x9cfe=['findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','ids','emit','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','fieldName','type','model','map','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','ChatQueue','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','Agents','online','interface','flatMap','sequelize','each'];(function(_0x177131,_0x37d940){var _0x4cec84=function(_0x17ea48){while(--_0x17ea48){_0x177131['push'](_0x177131['shift']());}};_0x4cec84(++_0x37d940);}(_0x9cfe,0x1d9));var _0xe9cf=function(_0x1c8141,_0x32f8d7){_0x1c8141=_0x1c8141-0x0;var _0x126697=_0x9cfe[_0x1c8141];return _0x126697;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9cf('0x1'));var rp=require(_0xe9cf('0x2'));var moment=require(_0xe9cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe9cf('0x4'));var util=require(_0xe9cf('0x5'));var path=require(_0xe9cf('0x6'));var sox=require(_0xe9cf('0x7'));var csv=require(_0xe9cf('0x8'));var ejs=require(_0xe9cf('0x9'));var fs=require('fs');var fs_extra=require(_0xe9cf('0xa'));var _=require('lodash');var squel=require(_0xe9cf('0xb'));var crypto=require(_0xe9cf('0xc'));var jsforce=require(_0xe9cf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe9cf('0x8'));var querystring=require(_0xe9cf('0xe'));var Papa=require(_0xe9cf('0xf'));var Redis=require('ioredis');var authService=require(_0xe9cf('0x10'));var qs=require(_0xe9cf('0x11'));var as=require(_0xe9cf('0x12'));var hardwareService=require(_0xe9cf('0x13'));var logger=require(_0xe9cf('0x14'))(_0xe9cf('0x15'));var utils=require('../../config/utils');var config=require(_0xe9cf('0x16'));var licenseUtil=require(_0xe9cf('0x17'));var db=require(_0xe9cf('0x18'))['db'];config[_0xe9cf('0x19')]=_['defaults'](config['redis'],{'host':_0xe9cf('0x1a'),'port':0x18eb});var socket=require(_0xe9cf('0x1b'))(new Redis(config[_0xe9cf('0x19')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0xe9cf('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x676d1e,_0x5e5120,_0x6f8f2e,_0x1938da){return new BPromise(function(_0x50b82d,_0x31214e){var _0x55c9e4=_0x1938da||client;return _0x55c9e4['request'](_0x676d1e,_0x6f8f2e)['then'](function(_0x10459b){logger[_0xe9cf('0x1d')](_0xe9cf('0x1e'),_0x5e5120,_0xe9cf('0x1f'));logger[_0xe9cf('0x20')](_0xe9cf('0x21'),_0x5e5120,_0xe9cf('0x1f'),JSON['stringify'](_0x10459b));if(_0x10459b[_0xe9cf('0x22')]){if(_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x23')]===0x1f4){logger[_0xe9cf('0x22')](_0xe9cf('0x1e'),_0x5e5120,_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x24')]);return _0x31214e(_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x24')]);}logger[_0xe9cf('0x22')]('ChatQueue,\x20%s,\x20%s',_0x5e5120,_0x10459b[_0xe9cf('0x22')]['message']);return _0x50b82d(_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x24')]);}else{logger[_0xe9cf('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x5e5120,_0xe9cf('0x1f'));_0x50b82d(_0x10459b[_0xe9cf('0x25')][_0xe9cf('0x24')]);}})[_0xe9cf('0x26')](function(_0x50f860){logger[_0xe9cf('0x22')](_0xe9cf('0x1e'),_0x5e5120,_0x50f860);_0x31214e(_0x50f860);});});}function respondWithStatusCode(_0x175630,_0x316fe0){_0x316fe0=_0x316fe0||0xcc;return function(_0x2ea283){if(_0x2ea283){return _0x175630[_0xe9cf('0x27')](_0x316fe0);}return _0x175630[_0xe9cf('0x28')](_0x316fe0)[_0xe9cf('0x29')]();};}function respondWithResult(_0x555319,_0x51058e){_0x51058e=_0x51058e||0xc8;return function(_0x336e50){if(_0x336e50){return _0x555319[_0xe9cf('0x28')](_0x51058e)[_0xe9cf('0x2a')](_0x336e50);}};}function respondWithFilteredResult(_0x543e04,_0x2390cc){return function(_0x3d1239){if(_0x3d1239){var _0x2a8fcd=typeof _0x2390cc['offset']===_0xe9cf('0x2b')&&typeof _0x2390cc[_0xe9cf('0x2c')]===_0xe9cf('0x2b');var _0x2bb102=_0x3d1239[_0xe9cf('0x2d')];var _0x4086b0=_0x2a8fcd?0x0:_0x2390cc[_0xe9cf('0x2e')];var _0x56d2c8=_0x2a8fcd?_0x3d1239[_0xe9cf('0x2d')]:_0x2390cc[_0xe9cf('0x2e')]+_0x2390cc['limit'];var _0x16a62f;if(_0x56d2c8>=_0x2bb102){_0x56d2c8=_0x2bb102;_0x16a62f=0xc8;}else{_0x16a62f=0xce;}_0x543e04[_0xe9cf('0x28')](_0x16a62f);return _0x543e04[_0xe9cf('0x2f')](_0xe9cf('0x30'),_0x4086b0+'-'+_0x56d2c8+'/'+_0x2bb102)[_0xe9cf('0x2a')](_0x3d1239);}return null;};}function patchUpdates(_0x4fb3f4){return function(_0x14785d){try{jsonpatch[_0xe9cf('0x31')](_0x14785d,_0x4fb3f4,!![]);}catch(_0x4cba8f){return BPromise[_0xe9cf('0x32')](_0x4cba8f);}return _0x14785d[_0xe9cf('0x33')]();};}function saveUpdates(_0x35c43c,_0x2f194c){return function(_0x32fdcd){if(_0x32fdcd){return _0x32fdcd[_0xe9cf('0x34')](_0x35c43c)[_0xe9cf('0x35')](function(_0x39d8ad){return _0x39d8ad;});}return null;};}function removeEntity(_0x48bb0b,_0x10ee5a){return function(_0x44a06e){if(_0x44a06e){return _0x44a06e[_0xe9cf('0x36')]()[_0xe9cf('0x35')](function(){var _0x5bc8d9=_0x44a06e[_0xe9cf('0x37')]({'plain':!![]});var _0x267225=_0xe9cf('0x38');return db[_0xe9cf('0x39')][_0xe9cf('0x36')]({'where':{'type':_0x267225,'resourceId':_0x5bc8d9['id']}})[_0xe9cf('0x35')](function(){return _0x44a06e;});})[_0xe9cf('0x35')](function(){_0x48bb0b['status'](0xcc)[_0xe9cf('0x29')]();});}};}function handleEntityNotFound(_0x727371,_0x309371){return function(_0x2d354b){if(!_0x2d354b){_0x727371[_0xe9cf('0x27')](0x194);}return _0x2d354b;};}function handleError(_0x1e6bc0,_0x80b27b){_0x80b27b=_0x80b27b||0x1f4;return function(_0x48e366){logger[_0xe9cf('0x22')](_0x48e366['stack']);if(_0x48e366[_0xe9cf('0x3a')]){delete _0x48e366[_0xe9cf('0x3a')];}_0x1e6bc0[_0xe9cf('0x28')](_0x80b27b)[_0xe9cf('0x3b')](_0x48e366);};}exports[_0xe9cf('0x3c')]=function(_0x47dae9,_0x390729){var _0x36c788={},_0x1c5349={},_0x203d1e={'count':0x0,'rows':[]};var _0x32df8a=_['map'](db['ChatQueue']['rawAttributes'],function(_0x14bc2e){return{'name':_0x14bc2e[_0xe9cf('0x3d')],'type':_0x14bc2e[_0xe9cf('0x3e')]['key']};});_0x1c5349[_0xe9cf('0x3f')]=_[_0xe9cf('0x40')](_0x32df8a,_0xe9cf('0x3a'));_0x1c5349['query']=_[_0xe9cf('0x41')](_0x47dae9['query']);_0x1c5349[_0xe9cf('0x42')]=_[_0xe9cf('0x43')](_0x1c5349['model'],_0x1c5349['query']);_0x36c788[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x1c5349[_0xe9cf('0x3f')],qs['fields'](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x36c788[_0xe9cf('0x44')]=_0x36c788[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x36c788[_0xe9cf('0x44')]:_0x1c5349[_0xe9cf('0x3f')];if(!_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x48')](_0xe9cf('0x49'))){_0x36c788['limit']=qs[_0xe9cf('0x2c')](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x2c')]);_0x36c788['offset']=qs['offset'](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}_0x36c788[_0xe9cf('0x4a')]=qs['sort'](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x4b')]);_0x36c788[_0xe9cf('0x4c')]=qs[_0xe9cf('0x42')](_[_0xe9cf('0x4d')](_0x47dae9[_0xe9cf('0x45')],_0x1c5349[_0xe9cf('0x42')]),_0x32df8a);if(_0x47dae9[_0xe9cf('0x45')]['filter']){_0x36c788[_0xe9cf('0x4c')]=_[_0xe9cf('0x4e')](_0x36c788[_0xe9cf('0x4c')],{'$or':_[_0xe9cf('0x40')](_0x32df8a,function(_0x4b4929){if(_0x4b4929['type']!=='VIRTUAL'){var _0x1cd7f7={};_0x1cd7f7[_0x4b4929[_0xe9cf('0x3a')]]={'$like':'%'+_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x1cd7f7;}})});}_0x36c788=_[_0xe9cf('0x4e')]({},_0x36c788,_0x47dae9[_0xe9cf('0x50')]);var _0x30364d={'where':_0x36c788[_0xe9cf('0x4c')]};return db['ChatQueue'][_0xe9cf('0x2d')](_0x30364d)[_0xe9cf('0x35')](function(_0x110f5b){_0x203d1e[_0xe9cf('0x2d')]=_0x110f5b;if(_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x51')]){_0x36c788[_0xe9cf('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0xe9cf('0x53')](_0x36c788);})[_0xe9cf('0x35')](function(_0x105341){_0x203d1e[_0xe9cf('0x54')]=_0x105341;return _0x203d1e;})[_0xe9cf('0x35')](respondWithFilteredResult(_0x390729,_0x36c788))['catch'](handleError(_0x390729,null));};exports[_0xe9cf('0x55')]=function(_0x1c8b62,_0x19fef3){var _0x363eb4={'raw':!![],'where':{'id':_0x1c8b62['params']['id']}},_0x196594={};_0x196594[_0xe9cf('0x3f')]=_[_0xe9cf('0x41')](db[_0xe9cf('0x56')][_0xe9cf('0x57')]);_0x196594[_0xe9cf('0x45')]=_['keys'](_0x1c8b62[_0xe9cf('0x45')]);_0x196594[_0xe9cf('0x42')]=_[_0xe9cf('0x43')](_0x196594[_0xe9cf('0x3f')],_0x196594['query']);_0x363eb4[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x196594[_0xe9cf('0x3f')],qs[_0xe9cf('0x46')](_0x1c8b62[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x363eb4[_0xe9cf('0x44')]=_0x363eb4[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x363eb4[_0xe9cf('0x44')]:_0x196594[_0xe9cf('0x3f')];if(_0x1c8b62[_0xe9cf('0x45')][_0xe9cf('0x51')]){_0x363eb4[_0xe9cf('0x52')]=[{'all':!![]}];}_0x363eb4=_[_0xe9cf('0x4e')]({},_0x363eb4,_0x1c8b62[_0xe9cf('0x50')]);return db[_0xe9cf('0x56')][_0xe9cf('0x58')](_0x363eb4)[_0xe9cf('0x35')](handleEntityNotFound(_0x19fef3,null))[_0xe9cf('0x35')](respondWithResult(_0x19fef3,null))['catch'](handleError(_0x19fef3,null));};exports[_0xe9cf('0x59')]=function(_0x17e84f,_0x2306a8){return db[_0xe9cf('0x56')]['create'](_0x17e84f[_0xe9cf('0x5a')],{})[_0xe9cf('0x35')](function(_0x1fc712){var _0x27f29e=_0x17e84f[_0xe9cf('0x5b')][_0xe9cf('0x37')]({'plain':!![]});if(!_0x27f29e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27f29e[_0xe9cf('0x5c')]==='user'){var _0x35682a=_0x1fc712[_0xe9cf('0x37')]({'plain':!![]});var _0x2a96f6=_0xe9cf('0x38');return db[_0xe9cf('0x5d')][_0xe9cf('0x58')]({'where':{'name':_0x2a96f6,'userProfileId':_0x27f29e['userProfileId']},'raw':!![]})[_0xe9cf('0x35')](function(_0xa0c2db){if(_0xa0c2db&&_0xa0c2db[_0xe9cf('0x5e')]===0x0){return db[_0xe9cf('0x39')]['create']({'name':_0x35682a[_0xe9cf('0x3a')],'resourceId':_0x35682a['id'],'type':_0xa0c2db[_0xe9cf('0x3a')],'sectionId':_0xa0c2db['id']},{})['then'](function(){return _0x1fc712;});}else{return _0x1fc712;}})[_0xe9cf('0x26')](function(_0x532a46){logger[_0xe9cf('0x22')](_0xe9cf('0x5f'),_0x532a46);throw _0x532a46;});}return _0x1fc712;})[_0xe9cf('0x35')](respondWithResult(_0x2306a8,0xc9))['catch'](handleError(_0x2306a8,null));};exports[_0xe9cf('0x34')]=function(_0x3c9c20,_0x3b4c4e){if(_0x3c9c20[_0xe9cf('0x5a')]['id']){delete _0x3c9c20[_0xe9cf('0x5a')]['id'];}return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x3c9c20[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x3b4c4e,null))[_0xe9cf('0x35')](saveUpdates(_0x3c9c20[_0xe9cf('0x5a')],null))[_0xe9cf('0x35')](respondWithResult(_0x3b4c4e,null))[_0xe9cf('0x26')](handleError(_0x3b4c4e,null));};exports['destroy']=function(_0xc1a963,_0x2549a6){return db['ChatQueue'][_0xe9cf('0x58')]({'where':{'id':_0xc1a963['params']['id']}})['then'](handleEntityNotFound(_0x2549a6,null))[_0xe9cf('0x35')](removeEntity(_0x2549a6,null))[_0xe9cf('0x26')](handleError(_0x2549a6,null));};exports[_0xe9cf('0x61')]=function(_0x424d41,_0x348184){return db[_0xe9cf('0x56')]['describe']()[_0xe9cf('0x35')](respondWithResult(_0x348184,null))[_0xe9cf('0x26')](handleError(_0x348184,null));};exports[_0xe9cf('0x62')]=function(_0x492fc3,_0x41fc23,_0x1dd452){var _0x163b73={'raw':!![],'where':{}},_0x47b216={},_0x2d5d1e;return db['ChatQueue'][_0xe9cf('0x63')]({'where':{'id':_0x492fc3[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x41fc23,null))['then'](function(_0x4e9d1f){if(_0x4e9d1f){_0x2d5d1e=_0x4e9d1f[_0xe9cf('0x37')]({'plain':!![]});_0x47b216[_0xe9cf('0x3f')]=_[_0xe9cf('0x41')](db['UserChatQueue'][_0xe9cf('0x57')]);_0x47b216[_0xe9cf('0x45')]=_[_0xe9cf('0x41')](_0x492fc3['query']);_0x47b216[_0xe9cf('0x42')]=_['intersection'](_0x47b216[_0xe9cf('0x3f')],_0x47b216[_0xe9cf('0x45')]);_0x163b73['attributes']=_[_0xe9cf('0x43')](_0x47b216[_0xe9cf('0x3f')],qs['fields'](_0x492fc3[_0xe9cf('0x45')]['fields']));_0x163b73[_0xe9cf('0x44')]=_0x163b73[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x163b73['attributes']:_0x47b216[_0xe9cf('0x3f')];if(!_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x48')](_0xe9cf('0x49'))){_0x163b73[_0xe9cf('0x2c')]=qs['limit'](_0x492fc3[_0xe9cf('0x45')]['limit']);_0x163b73['offset']=qs[_0xe9cf('0x2e')](_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}_0x163b73['order']=qs[_0xe9cf('0x4b')](_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x4b')]);_0x163b73[_0xe9cf('0x4c')]=qs['filters'](_['pick'](_0x492fc3[_0xe9cf('0x45')],_0x47b216['filters']));_0x163b73['where'][_0xe9cf('0x64')]=_0x4e9d1f['id'];if(_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x4f')]){_0x163b73['where']=_[_0xe9cf('0x4e')](_0x163b73[_0xe9cf('0x4c')],{'$or':_['map'](_0x163b73[_0xe9cf('0x44')],function(_0x2a4f69){var _0x1d385c={};_0x1d385c[_0x2a4f69]={'$like':'%'+_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x1d385c;})});}_0x163b73=_['merge']({},_0x163b73,_0x492fc3[_0xe9cf('0x50')]);return db[_0xe9cf('0x65')][_0xe9cf('0x53')](_0x163b73);}})['then'](function(_0x218a14){if(_0x218a14){return db[_0xe9cf('0x66')][_0xe9cf('0x67')]({'where':{'id':_[_0xe9cf('0x40')](_0x218a14,'UserId'),'role':_0xe9cf('0x68')},'attributes':['id',_0xe9cf('0x3a'),_0xe9cf('0x69'),_0xe9cf('0x6a'),_0xe9cf('0x6b')]});}})[_0xe9cf('0x35')](function(_0x2e7547){if(_0x2e7547){return{'count':_0x2e7547[_0xe9cf('0x2d')],'rows':_[_0xe9cf('0x40')](_0x2e7547[_0xe9cf('0x54')],function(_0x3209e2){return{'membername':_0x3209e2['name'],'UserId':_0x3209e2['id'],'queue_name':_0x2d5d1e[_0xe9cf('0x3a')],'ChatQueueId':_0x2d5d1e['id'],'interface':util[_0xe9cf('0x6c')](_0xe9cf('0x6d'),'SIP',_0x3209e2[_0xe9cf('0x3a')]),'penalty':0x0,'paused':_0x3209e2[_0xe9cf('0x69')],'createdAt':_0x3209e2[_0xe9cf('0x6b')],'updatedAt':_0x3209e2[_0xe9cf('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe9cf('0x35')](respondWithFilteredResult(_0x41fc23,_0x163b73))[_0xe9cf('0x26')](handleError(_0x41fc23,null));};exports['getTeams']=function(_0x41afce,_0xc21223,_0x18ee52){var _0x3a5fe6={};var _0x47fd4f={};var _0x4ff45d;var _0x29c808;return db[_0xe9cf('0x56')]['findOne']({'where':{'id':_0x41afce[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0xc21223,null))['then'](function(_0xedac78){if(_0xedac78){_0x4ff45d=_0xedac78;_0x47fd4f[_0xe9cf('0x3f')]=_['keys'](db[_0xe9cf('0x6e')][_0xe9cf('0x57')]);_0x47fd4f[_0xe9cf('0x45')]=_[_0xe9cf('0x41')](_0x41afce['query']);_0x47fd4f['filters']=_[_0xe9cf('0x43')](_0x47fd4f['model'],_0x47fd4f[_0xe9cf('0x45')]);_0x3a5fe6[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x47fd4f[_0xe9cf('0x3f')],qs[_0xe9cf('0x46')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x3a5fe6[_0xe9cf('0x44')]=_0x3a5fe6[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x3a5fe6[_0xe9cf('0x44')]:_0x47fd4f[_0xe9cf('0x3f')];_0x3a5fe6[_0xe9cf('0x4a')]=qs[_0xe9cf('0x4b')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x4b')]);_0x3a5fe6['where']=qs[_0xe9cf('0x42')](_[_0xe9cf('0x4d')](_0x41afce[_0xe9cf('0x45')],_0x47fd4f[_0xe9cf('0x42')]));if(_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x4f')]){_0x3a5fe6['where']=_[_0xe9cf('0x4e')](_0x3a5fe6[_0xe9cf('0x4c')],{'$or':_[_0xe9cf('0x40')](_0x3a5fe6[_0xe9cf('0x44')],function(_0x451fd0){var _0x434af3={};_0x434af3[_0x451fd0]={'$like':'%'+_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x434af3;})});}_0x3a5fe6=_[_0xe9cf('0x4e')]({},_0x3a5fe6,_0x41afce['options']);return _0x4ff45d[_0xe9cf('0x6f')](_0x3a5fe6);}})['then'](function(_0xdef7a6){if(_0xdef7a6){_0x29c808=_0xdef7a6[_0xe9cf('0x47')];if(!_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x48')](_0xe9cf('0x49'))){_0x3a5fe6[_0xe9cf('0x2c')]=qs[_0xe9cf('0x2c')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x2c')]);_0x3a5fe6[_0xe9cf('0x2e')]=qs[_0xe9cf('0x2e')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}return _0x4ff45d[_0xe9cf('0x6f')](_0x3a5fe6);}})['then'](function(_0x3af794){if(_0x3af794){return _0x3af794?{'count':_0x29c808,'rows':_0x3af794}:null;}})[_0xe9cf('0x35')](respondWithResult(_0xc21223,null))[_0xe9cf('0x26')](handleError(_0xc21223,null));};exports[_0xe9cf('0x70')]=function(_0x522765,_0x3586af,_0x1867f1){var _0x3cfdfc=_0x522765[_0xe9cf('0x5a')]['ids'];return db['Team'][_0xe9cf('0x53')]({'where':{'id':_0x3cfdfc},'attributes':['id'],'include':[{'model':db[_0xe9cf('0x66')],'as':_0xe9cf('0x71'),'attributes':['id',_0xe9cf('0x3a'),_0xe9cf('0x72'),'voicePause',_0xe9cf('0x73')],'raw':!![]}]})[_0xe9cf('0x35')](function(_0x1543c5){if(_0x1543c5){var _0x4b9920=_[_0xe9cf('0x74')](_0x1543c5,function(_0x4029da){var _0x124690=_0x4029da[_0xe9cf('0x37')]({'plain':!![]});return _0x124690[_0xe9cf('0x71')];});return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x522765['params']['id']}})['then'](function(_0x465731){return db[_0xe9cf('0x75')]['transaction'](function(_0xd45133){return _0x465731['addTeams'](_0x3cfdfc,{'transaction':_0xd45133})[_0xe9cf('0x35')](function(){return BPromise[_0xe9cf('0x76')](_0x4b9920,function(_0x35fbde){return db[_0xe9cf('0x65')][_0xe9cf('0x77')]({'where':{'UserId':_0x35fbde['id'],'ChatQueueId':_0x522765['params']['id']},'transaction':_0xd45133});});})[_0xe9cf('0x35')](function(){_0x4b9920[_0xe9cf('0x78')](function(_0x30cb5e){socket['emit'](_0xe9cf('0x79'),{'UserId':_0x30cb5e['id'],'ChatQueueId':_0x465731['id']});});});});});}})[_0xe9cf('0x35')](respondWithStatusCode(_0x3586af,null))['catch'](handleError(_0x3586af,null));};exports[_0xe9cf('0x7a')]=function(_0x570095,_0xed29e7,_0xadbcd6){return db[_0xe9cf('0x6e')][_0xe9cf('0x53')]({'where':{'id':_0x570095[_0xe9cf('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe9cf('0x66')],'as':_0xe9cf('0x71'),'attributes':['id'],'raw':!![]}]})[_0xe9cf('0x35')](handleEntityNotFound(_0xed29e7,null))['then'](function(_0x33fff7){var _0x4d1f86=_['map'](_0x33fff7,'id');var _0x209775=[];var _0x111cec=[];var _0x2bccaf=squel[_0xe9cf('0x7b')]();_0x2bccaf['field'](_0xe9cf('0x7c'))[_0xe9cf('0x7d')]('team_has_chat_queues','tq')[_0xe9cf('0x7e')](_0xe9cf('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x570095[_0xe9cf('0x60')]['id']);for(var _0x190519=0x0;_0x190519<_0x33fff7[_0xe9cf('0x47')];_0x190519+=0x1){let _0x25ab96=_0x33fff7[_0x190519];for(var _0x55c2d3=0x0;_0x55c2d3<_0x25ab96[_0xe9cf('0x71')][_0xe9cf('0x47')];_0x55c2d3+=0x1){let _0x596eb7=_0x25ab96[_0xe9cf('0x71')][_0x55c2d3];var _0x378df4=_0x2bccaf[_0xe9cf('0x80')]();_0x378df4['where'](_0xe9cf('0x81'),_0x596eb7['id']);_0x111cec[_0xe9cf('0x82')](db[_0xe9cf('0x75')][_0xe9cf('0x45')](_0x378df4[_0xe9cf('0x83')](),{'type':db[_0xe9cf('0x75')][_0xe9cf('0x84')][_0xe9cf('0x85')]})[_0xe9cf('0x35')](function(_0x536990){if(_0x536990[_0xe9cf('0x47')]===0x1){return _0x596eb7['id'];}else{var _0x30b5ac=_[_0xe9cf('0x86')](_[_0xe9cf('0x40')](_0x536990,_0xe9cf('0x87')),function(_0x1792ad){return _[_0xe9cf('0x88')](_0x4d1f86,_0x1792ad);});if(_0x30b5ac){return _0x596eb7['id'];}}}));}}return BPromise['all'](_0x111cec)[_0xe9cf('0x35')](function(_0x5dc746){_0x209775=_(_0x209775)[_0xe9cf('0x89')](_0x5dc746)[_0xe9cf('0x8a')]()[_0xe9cf('0x8b')]();return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x570095[_0xe9cf('0x60')]['id']}})['then'](function(_0x1e96e5){return db[_0xe9cf('0x75')]['transaction'](function(_0x53fe53){return _0x1e96e5[_0xe9cf('0x7a')](_0x570095['query'][_0xe9cf('0x8c')],{'transaction':_0x53fe53})['then'](function(){if(!_['isEmpty'](_0x209775)){return _0x1e96e5['removeAgents'](_0x209775,{'transaction':_0x53fe53});}})['then'](function(){_0x209775[_0xe9cf('0x78')](function(_0x4090ad){socket[_0xe9cf('0x8d')](_0xe9cf('0x8e'),{'UserId':_0x4090ad,'ChatQueueId':_0x1e96e5['id']});});});});});});})[_0xe9cf('0x35')](respondWithStatusCode(_0xed29e7,null))['catch'](handleError(_0xed29e7,null));};exports[_0xe9cf('0x8f')]=function(_0x2a31a4,_0x52209d,_0x20f59c){return db['ChatQueue'][_0xe9cf('0x58')]({'where':{'id':_0x2a31a4['params']['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x52209d,null))[_0xe9cf('0x35')](function(_0x5ec5e0){if(_0x5ec5e0){return _0x5ec5e0[_0xe9cf('0x8f')](_0x2a31a4[_0xe9cf('0x5a')][_0xe9cf('0x8c')],_['omit'](_0x2a31a4[_0xe9cf('0x5a')],[_0xe9cf('0x8c'),'id'])||{})[_0xe9cf('0x90')](function(_0x4ca70c){for(var _0x4d7e08=0x0;_0x4d7e08<_0x2a31a4[_0xe9cf('0x5a')][_0xe9cf('0x8c')]['length'];_0x4d7e08+=0x1){socket[_0xe9cf('0x8d')]('userChatQueue:save',{'UserId':Number(_0x2a31a4[_0xe9cf('0x5a')]['ids'][_0x4d7e08]),'ChatQueueId':Number(_0x2a31a4[_0xe9cf('0x60')]['id'])});}return _0x4ca70c;});}})[_0xe9cf('0x35')](respondWithResult(_0x52209d,null))[_0xe9cf('0x26')](handleError(_0x52209d,null));};exports[_0xe9cf('0x91')]=function(_0x3a98c9,_0x1764ac,_0x5c49de){return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x3a98c9[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x1764ac,null))[_0xe9cf('0x35')](function(_0x749d4f){if(_0x749d4f){return _0x749d4f['removeAgents'](_0x3a98c9[_0xe9cf('0x45')]['ids'])[_0xe9cf('0x35')](function(){if(_[_0xe9cf('0x92')](_0x3a98c9['query']['ids'])){for(var _0x40e600=0x0;_0x40e600<_0x3a98c9['query']['ids'][_0xe9cf('0x47')];_0x40e600+=0x1){socket[_0xe9cf('0x8d')](_0xe9cf('0x8e'),{'UserId':Number(_0x3a98c9[_0xe9cf('0x45')]['ids'][_0x40e600]),'ChatQueueId':Number(_0x3a98c9['params']['id'])});}}else{socket['emit'](_0xe9cf('0x8e'),{'UserId':Number(_0x3a98c9[_0xe9cf('0x45')][_0xe9cf('0x8c')]),'ChatQueueId':Number(_0x3a98c9[_0xe9cf('0x60')]['id'])});}});}})[_0xe9cf('0x35')](respondWithStatusCode(_0x1764ac,null))['catch'](handleError(_0x1764ac,null));};exports[_0xe9cf('0x93')]=function(_0x12846d,_0x313b71,_0x247a3c){var _0x4b1123={};var _0x19c8c5={};var _0x20f52b;var _0x76fd3a;return db[_0xe9cf('0x56')][_0xe9cf('0x63')]({'where':{'id':_0x12846d[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x313b71,null))['then'](function(_0x3b98f8){if(_0x3b98f8){_0x20f52b=_0x3b98f8;_0x19c8c5['model']=_[_0xe9cf('0x41')](db['User'][_0xe9cf('0x57')]);_0x19c8c5['query']=_[_0xe9cf('0x41')](_0x12846d[_0xe9cf('0x45')]);_0x19c8c5['filters']=_[_0xe9cf('0x43')](_0x19c8c5[_0xe9cf('0x3f')],_0x19c8c5[_0xe9cf('0x45')]);_0x4b1123[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x19c8c5[_0xe9cf('0x3f')],qs[_0xe9cf('0x46')](_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x4b1123[_0xe9cf('0x44')]=_0x4b1123['attributes'][_0xe9cf('0x47')]?_0x4b1123[_0xe9cf('0x44')]:_0x19c8c5[_0xe9cf('0x3f')];_0x4b1123[_0xe9cf('0x4a')]=qs['sort'](_0x12846d['query'][_0xe9cf('0x4b')]);_0x4b1123[_0xe9cf('0x4c')]=qs['filters'](_['pick'](_0x12846d[_0xe9cf('0x45')],_0x19c8c5['filters']));if(_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x4f')]){_0x4b1123[_0xe9cf('0x4c')]=_['merge'](_0x4b1123[_0xe9cf('0x4c')],{'$or':_['map'](_0x4b1123['attributes'],function(_0x5e7ceb){var _0x508edd={};_0x508edd[_0x5e7ceb]={'$like':'%'+_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x508edd;})});}_0x4b1123=_[_0xe9cf('0x4e')]({},_0x4b1123,_0x12846d[_0xe9cf('0x50')]);return _0x20f52b[_0xe9cf('0x93')](_0x4b1123);}})[_0xe9cf('0x35')](function(_0x611b72){if(_0x611b72){_0x76fd3a=_0x611b72['length'];if(!_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x48')]('nolimit')){_0x4b1123[_0xe9cf('0x2c')]=qs[_0xe9cf('0x2c')](_0x12846d['query']['limit']);_0x4b1123['offset']=qs[_0xe9cf('0x2e')](_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}return _0x20f52b[_0xe9cf('0x93')](_0x4b1123);}})[_0xe9cf('0x35')](function(_0xa0aee0){if(_0xa0aee0){return _0xa0aee0?{'count':_0x76fd3a,'rows':_0xa0aee0}:null;}})[_0xe9cf('0x35')](respondWithResult(_0x313b71,null))[_0xe9cf('0x26')](handleError(_0x313b71,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 20eb4f1..05015f9 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 _0x5793=['hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','emit'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x5793,0xb1));var _0x3579=function(_0x1f029b,_0x2e3f7f){_0x1f029b=_0x1f029b-0x0;var _0x38f53c=_0x5793[_0x1f029b];return _0x38f53c;};'use strict';var EventEmitter=require(_0x3579('0x0'));var ChatQueue=require(_0x3579('0x1'))['db'][_0x3579('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3579('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x320a4c){return function(_0x45c4bc,_0x165417,_0x470028){ChatQueueEvents[_0x3579('0x4')](_0x320a4c+':'+_0x45c4bc['id'],_0x45c4bc);ChatQueueEvents['emit'](_0x320a4c,_0x45c4bc);_0x470028(null);};}for(var e in events){if(events[_0x3579('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x3579('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0xcefb=['ChatQueue','save','remove','emit','hook','events','../../mysqldb'];(function(_0x3d16d2,_0x4f1364){var _0x96e9b1=function(_0x523f4f){while(--_0x523f4f){_0x3d16d2['push'](_0x3d16d2['shift']());}};_0x96e9b1(++_0x4f1364);}(_0xcefb,0xfa));var _0xbcef=function(_0x18515d,_0x5c442b){_0x18515d=_0x18515d-0x0;var _0x175db2=_0xcefb[_0x18515d];return _0x175db2;};'use strict';var EventEmitter=require(_0xbcef('0x0'));var ChatQueue=require(_0xbcef('0x1'))['db'][_0xbcef('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbcef('0x3'),'afterUpdate':'update','afterDestroy':_0xbcef('0x4')};function emitEvent(_0x22f518){return function(_0x34f0bf,_0x452873,_0x2b6032){ChatQueueEvents[_0xbcef('0x5')](_0x22f518+':'+_0x34f0bf['id'],_0x34f0bf);ChatQueueEvents[_0xbcef('0x5')](_0x22f518,_0x34f0bf);_0x2b6032(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xbcef('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 7ef5be9..801dfdc 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 _0xce98=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash','api','moment'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0xce98,0x1e1));var _0x8ce9=function(_0x2f5ab1,_0x4ffb4b){_0x2f5ab1=_0x2f5ab1-0x0;var _0x18f707=_0xce98[_0x2f5ab1];return _0x18f707;};'use strict';var _=require(_0x8ce9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ce9('0x1'));var moment=require(_0x8ce9('0x2'));var BPromise=require(_0x8ce9('0x3'));var rp=require(_0x8ce9('0x4'));var fs=require('fs');var path=require(_0x8ce9('0x5'));var rimraf=require(_0x8ce9('0x6'));var config=require(_0x8ce9('0x7'));var attributes=require(_0x8ce9('0x8'));module['exports']=function(_0x16480a,_0x3d85e9){return _0x16480a[_0x8ce9('0x9')]('ChatQueue',attributes,{'tableName':_0x8ce9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51f4=['path','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x51f4,0x1a0));var _0x451f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x51f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x451f('0x0'));var util=require('util');var logger=require(_0x451f('0x1'))('api');var moment=require(_0x451f('0x2'));var BPromise=require(_0x451f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x451f('0x4'));var rimraf=require('rimraf');var config=require(_0x451f('0x5'));var attributes=require(_0x451f('0x6'));module[_0x451f('0x7')]=function(_0x182df6,_0x44f2e4){return _0x182df6['define'](_0x451f('0x8'),attributes,{'tableName':_0x451f('0x9'),'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 97b9f8c..b99011c 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 _0x685b=['where','limit','include','model','attributes','map','stringify','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x685b,0xbd));var _0xb685=function(_0x549fb4,_0x57140c){_0x549fb4=_0x549fb4-0x0;var _0xc64c37=_0x685b[_0x549fb4];return _0xc64c37;};'use strict';var _=require(_0xb685('0x0'));var util=require(_0xb685('0x1'));var moment=require(_0xb685('0x2'));var BPromise=require(_0xb685('0x3'));var rs=require(_0xb685('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb685('0x5'))['db'];var utils=require(_0xb685('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb685('0x7'));var jayson=require(_0xb685('0x8'));var client=jayson[_0xb685('0x9')]['http']({'port':0x232a});config[_0xb685('0xa')]=_[_0xb685('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb685('0xa')]));require('./chatQueue.socket')[_0xb685('0xc')](socket);function respondWithRpcPromise(_0x4996e2,_0x1034fe,_0xfcd2){return new BPromise(function(_0x22052e,_0x17a28b){return client['request'](_0x4996e2,_0xfcd2)[_0xb685('0xd')](function(_0x3f3ca7){logger[_0xb685('0xe')](_0xb685('0xf'),_0x1034fe,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1034fe,_0xb685('0x10'),JSON['stringify'](_0x3f3ca7));if(_0x3f3ca7[_0xb685('0x11')]){if(_0x3f3ca7[_0xb685('0x11')][_0xb685('0x12')]===0x1f4){logger[_0xb685('0x11')](_0xb685('0xf'),_0x1034fe,_0x3f3ca7[_0xb685('0x11')][_0xb685('0x13')]);return _0x17a28b(_0x3f3ca7[_0xb685('0x11')]['message']);}logger[_0xb685('0x11')](_0xb685('0xf'),_0x1034fe,_0x3f3ca7[_0xb685('0x11')]['message']);return _0x22052e(_0x3f3ca7[_0xb685('0x11')][_0xb685('0x13')]);}else{logger[_0xb685('0xe')](_0xb685('0xf'),_0x1034fe,_0xb685('0x10'));_0x22052e(_0x3f3ca7[_0xb685('0x14')][_0xb685('0x13')]);}})[_0xb685('0x15')](function(_0x4f4932){logger[_0xb685('0x11')](_0xb685('0xf'),_0x1034fe,_0x4f4932);_0x17a28b(_0x4f4932);});});}exports[_0xb685('0x16')]=function(_0x367400){var _0x501559=this;return new Promise(function(_0x7ececd,_0x51439c){return db[_0xb685('0x17')][_0xb685('0x18')]({'raw':_0x367400['options']?_0x367400['options'][_0xb685('0x19')]===undefined?!![]:![]:!![],'where':_0x367400[_0xb685('0x1a')]?_0x367400['options'][_0xb685('0x1b')]||null:null,'attributes':_0x367400['options']?_0x367400[_0xb685('0x1a')]['attributes']||null:null,'limit':_0x367400[_0xb685('0x1a')]?_0x367400[_0xb685('0x1a')][_0xb685('0x1c')]||null:null,'include':_0x367400['options']?_0x367400[_0xb685('0x1a')][_0xb685('0x1d')]?_['map'](_0x367400[_0xb685('0x1a')][_0xb685('0x1d')],function(_0xdfc74d){return{'model':db[_0xdfc74d[_0xb685('0x1e')]],'as':_0xdfc74d['as'],'attributes':_0xdfc74d[_0xb685('0x1f')],'include':_0xdfc74d[_0xb685('0x1d')]?_[_0xb685('0x20')](_0xdfc74d['include'],function(_0x1a3011){return{'model':db[_0x1a3011[_0xb685('0x1e')]],'as':_0x1a3011['as'],'attributes':_0x1a3011[_0xb685('0x1f')],'include':_0x1a3011['include']?_[_0xb685('0x20')](_0x1a3011[_0xb685('0x1d')],function(_0x26fa16){return{'model':db[_0x26fa16['model']],'as':_0x26fa16['as'],'attributes':_0x26fa16[_0xb685('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb685('0xd')](function(_0xa4b7a6){logger[_0xb685('0xe')](_0xb685('0x16'),_0x367400);logger['debug'](_0xb685('0x16'),_0x367400,JSON[_0xb685('0x21')](_0xa4b7a6));_0x7ececd(_0xa4b7a6);})[_0xb685('0x15')](function(_0x2253f6){logger[_0xb685('0x11')](_0xb685('0x16'),_0x2253f6[_0xb685('0x13')],_0x367400);_0x51439c(_0x501559['error'](0x1f4,_0x2253f6[_0xb685('0x13')]));});});};exports[_0xb685('0x22')]=function(_0x516674){var _0x25eac5=this;return new Promise(function(_0x5d6471,_0x49818){return db[_0xb685('0x17')][_0xb685('0x23')]({'raw':_0x516674[_0xb685('0x1a')]?_0x516674[_0xb685('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x516674[_0xb685('0x1a')]?_0x516674[_0xb685('0x1a')][_0xb685('0x1b')]||null:null,'attributes':_0x516674[_0xb685('0x1a')]?_0x516674[_0xb685('0x1a')][_0xb685('0x1f')]||null:null,'include':_0x516674['options']?_0x516674[_0xb685('0x1a')][_0xb685('0x1d')]?_[_0xb685('0x20')](_0x516674['options'][_0xb685('0x1d')],function(_0x2ecdbd){return{'model':db[_0x2ecdbd[_0xb685('0x1e')]],'as':_0x2ecdbd['as'],'attributes':_0x2ecdbd[_0xb685('0x1f')],'include':_0x2ecdbd[_0xb685('0x1d')]?_[_0xb685('0x20')](_0x2ecdbd[_0xb685('0x1d')],function(_0x404b1b){return{'model':db[_0x404b1b[_0xb685('0x1e')]],'as':_0x404b1b['as'],'attributes':_0x404b1b[_0xb685('0x1f')],'include':_0x404b1b[_0xb685('0x1d')]?_[_0xb685('0x20')](_0x404b1b[_0xb685('0x1d')],function(_0xa398fe){return{'model':db[_0xa398fe[_0xb685('0x1e')]],'as':_0xa398fe['as'],'attributes':_0xa398fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f392a){logger['info'](_0xb685('0x22'),_0x516674);logger['debug'](_0xb685('0x22'),_0x516674,JSON[_0xb685('0x21')](_0x4f392a));_0x5d6471(_0x4f392a);})['catch'](function(_0x4940f9){logger[_0xb685('0x11')]('ShowChatQueue',_0x4940f9[_0xb685('0x13')],_0x516674);_0x49818(_0x25eac5[_0xb685('0x11')](0x1f4,_0x4940f9[_0xb685('0x13')]));});});}; \ No newline at end of file +var _0xda66=['redis','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','findAll','options','raw','where','attributes','include','map','model','then','GetChatQueue','stringify','ChatQueue','ShowChatQueue','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x27f68f,_0x177be3){var _0xef1bec=function(_0x5551b2){while(--_0x5551b2){_0x27f68f['push'](_0x27f68f['shift']());}};_0xef1bec(++_0x177be3);}(_0xda66,0x7f));var _0x6da6=function(_0x3144b3,_0x45f961){_0x3144b3=_0x3144b3-0x0;var _0x2517a9=_0xda66[_0x3144b3];return _0x2517a9;};'use strict';var _=require(_0x6da6('0x0'));var util=require('util');var moment=require(_0x6da6('0x1'));var BPromise=require(_0x6da6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6da6('0x3'));var logger=require(_0x6da6('0x4'))(_0x6da6('0x5'));var config=require(_0x6da6('0x6'));var jayson=require(_0x6da6('0x7'));var client=jayson['client'][_0x6da6('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6da6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6da6('0xa'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x6da6('0xb')](socket);function respondWithRpcPromise(_0x28bd1,_0x273738,_0x53f6b){return new BPromise(function(_0x117d66,_0x3dd80d){return client[_0x6da6('0xc')](_0x28bd1,_0x53f6b)['then'](function(_0x535b87){logger[_0x6da6('0xd')](_0x6da6('0xe'),_0x273738,_0x6da6('0xf'));logger[_0x6da6('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x273738,_0x6da6('0xf'),JSON['stringify'](_0x535b87));if(_0x535b87[_0x6da6('0x11')]){if(_0x535b87[_0x6da6('0x11')][_0x6da6('0x12')]===0x1f4){logger[_0x6da6('0x11')](_0x6da6('0xe'),_0x273738,_0x535b87[_0x6da6('0x11')][_0x6da6('0x13')]);return _0x3dd80d(_0x535b87['error']['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x273738,_0x535b87['error']['message']);return _0x117d66(_0x535b87[_0x6da6('0x11')][_0x6da6('0x13')]);}else{logger[_0x6da6('0xd')](_0x6da6('0xe'),_0x273738,_0x6da6('0xf'));_0x117d66(_0x535b87['result'][_0x6da6('0x13')]);}})[_0x6da6('0x14')](function(_0x4494b4){logger['error'](_0x6da6('0xe'),_0x273738,_0x4494b4);_0x3dd80d(_0x4494b4);});});}exports['GetChatQueue']=function(_0xd6e637){var _0x3bd06a=this;return new Promise(function(_0x22340e,_0xd63d5b){return db['ChatQueue'][_0x6da6('0x15')]({'raw':_0xd6e637[_0x6da6('0x16')]?_0xd6e637['options'][_0x6da6('0x17')]===undefined?!![]:![]:!![],'where':_0xd6e637[_0x6da6('0x16')]?_0xd6e637[_0x6da6('0x16')][_0x6da6('0x18')]||null:null,'attributes':_0xd6e637['options']?_0xd6e637[_0x6da6('0x16')][_0x6da6('0x19')]||null:null,'limit':_0xd6e637[_0x6da6('0x16')]?_0xd6e637[_0x6da6('0x16')]['limit']||null:null,'include':_0xd6e637['options']?_0xd6e637[_0x6da6('0x16')][_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0xd6e637[_0x6da6('0x16')][_0x6da6('0x1a')],function(_0x5dff07){return{'model':db[_0x5dff07[_0x6da6('0x1c')]],'as':_0x5dff07['as'],'attributes':_0x5dff07[_0x6da6('0x19')],'include':_0x5dff07[_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0x5dff07[_0x6da6('0x1a')],function(_0x3a3903){return{'model':db[_0x3a3903[_0x6da6('0x1c')]],'as':_0x3a3903['as'],'attributes':_0x3a3903['attributes'],'include':_0x3a3903[_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0x3a3903[_0x6da6('0x1a')],function(_0x1cd1a4){return{'model':db[_0x1cd1a4[_0x6da6('0x1c')]],'as':_0x1cd1a4['as'],'attributes':_0x1cd1a4[_0x6da6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6da6('0x1d')](function(_0x33f5fa){logger[_0x6da6('0xd')](_0x6da6('0x1e'),_0xd6e637);logger[_0x6da6('0x10')]('GetChatQueue',_0xd6e637,JSON[_0x6da6('0x1f')](_0x33f5fa));_0x22340e(_0x33f5fa);})['catch'](function(_0x945988){logger[_0x6da6('0x11')](_0x6da6('0x1e'),_0x945988[_0x6da6('0x13')],_0xd6e637);_0xd63d5b(_0x3bd06a[_0x6da6('0x11')](0x1f4,_0x945988[_0x6da6('0x13')]));});});};exports['ShowChatQueue']=function(_0x2fa8af){var _0x362451=this;return new Promise(function(_0x18a3cb,_0x582bf7){return db[_0x6da6('0x20')]['find']({'raw':_0x2fa8af[_0x6da6('0x16')]?_0x2fa8af[_0x6da6('0x16')][_0x6da6('0x17')]===undefined?!![]:![]:!![],'where':_0x2fa8af[_0x6da6('0x16')]?_0x2fa8af['options'][_0x6da6('0x18')]||null:null,'attributes':_0x2fa8af[_0x6da6('0x16')]?_0x2fa8af[_0x6da6('0x16')][_0x6da6('0x19')]||null:null,'include':_0x2fa8af['options']?_0x2fa8af['options'][_0x6da6('0x1a')]?_['map'](_0x2fa8af[_0x6da6('0x16')][_0x6da6('0x1a')],function(_0x5e14a8){return{'model':db[_0x5e14a8[_0x6da6('0x1c')]],'as':_0x5e14a8['as'],'attributes':_0x5e14a8['attributes'],'include':_0x5e14a8[_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0x5e14a8[_0x6da6('0x1a')],function(_0xd668ca){return{'model':db[_0xd668ca[_0x6da6('0x1c')]],'as':_0xd668ca['as'],'attributes':_0xd668ca[_0x6da6('0x19')],'include':_0xd668ca[_0x6da6('0x1a')]?_['map'](_0xd668ca['include'],function(_0x563a3b){return{'model':db[_0x563a3b['model']],'as':_0x563a3b['as'],'attributes':_0x563a3b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6da6('0x1d')](function(_0x9531d8){logger[_0x6da6('0xd')](_0x6da6('0x21'),_0x2fa8af);logger[_0x6da6('0x10')]('ShowChatQueue',_0x2fa8af,JSON[_0x6da6('0x1f')](_0x9531d8));_0x18a3cb(_0x9531d8);})[_0x6da6('0x14')](function(_0x192ee2){logger['error'](_0x6da6('0x21'),_0x192ee2[_0x6da6('0x13')],_0x2fa8af);_0x582bf7(_0x362451[_0x6da6('0x11')](0x1f4,_0x192ee2[_0x6da6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 2e332fd..8ad69ea 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 _0xe14d=['update','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x394a80,_0xb35b3f){var _0x42797e=function(_0x17843f){while(--_0x17843f){_0x394a80['push'](_0x394a80['shift']());}};_0x42797e(++_0xb35b3f);}(_0xe14d,0x1ee));var _0xde14=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe14d[_0x15bc81];return _0x59440e;};'use strict';var ChatQueueEvents=require(_0xde14('0x0'));var events=[_0xde14('0x1'),_0xde14('0x2'),_0xde14('0x3')];function createListener(_0x48b392,_0x1c5b4){return function(_0x28965b){_0x1c5b4['emit'](_0x48b392,_0x28965b);};}function removeListener(_0x1c3e94,_0x13c24e){return function(){ChatQueueEvents[_0xde14('0x4')](_0x1c3e94,_0x13c24e);};}exports[_0xde14('0x5')]=function(_0x461af3){for(var _0xba1514=0x0,_0x4b1f6b=events['length'];_0xba1514<_0x4b1f6b;_0xba1514++){var _0x1bd49d=events[_0xba1514];var _0x115b7d=createListener(_0xde14('0x6')+_0x1bd49d,_0x461af3);ChatQueueEvents['on'](_0x1bd49d,_0x115b7d);}}; \ No newline at end of file +var _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x4b0f00,_0x18cb68){var _0x4a2bfd=function(_0x4a853e){while(--_0x4a853e){_0x4b0f00['push'](_0x4b0f00['shift']());}};_0x4a2bfd(++_0x18cb68);}(_0x22fb,0x192));var _0xb22f=function(_0x54bb55,_0x5bdec1){_0x54bb55=_0x54bb55-0x0;var _0x30528c=_0x22fb[_0x54bb55];return _0x30528c;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 5143e6e..38e419f 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 _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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x3703ee,_0x4235ce){_0x3703ee=_0x3703ee-0x0;var _0x1a1180=_0x3e74[_0x3703ee];return _0x1a1180;};'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 +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1a6687,_0x1d0824){var _0x3c4995=function(_0x247d53){while(--_0x247d53){_0x1a6687['push'](_0x1a6687['shift']());}};_0x3c4995(++_0x1d0824);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index e950111..dcfee9c 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 _0x3706=['sequelize','exports','STRING','DATE','moment'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x3706,0xae));var _0x6370=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x3706[_0x1780f8];return _0x33a410;};'use strict';var moment=require(_0x6370('0x0'));var Sequelize=require(_0x6370('0x1'));module[_0x6370('0x2')]={'uniqueid':{'type':Sequelize[_0x6370('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6370('0x3')]},'joinAt':{'type':Sequelize[_0x6370('0x4')]},'leaveAt':{'type':Sequelize[_0x6370('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6370('0x4')]},'reason':{'type':Sequelize[_0x6370('0x3')]}}; \ No newline at end of file +var _0xa61a=['moment','sequelize','exports','STRING','DATE'];(function(_0x13c774,_0x4d3531){var _0x5ae4e7=function(_0x43a7b0){while(--_0x43a7b0){_0x13c774['push'](_0x13c774['shift']());}};_0x5ae4e7(++_0x4d3531);}(_0xa61a,0xc8));var _0xaa61=function(_0x305bbf,_0x5647b3){_0x305bbf=_0x305bbf-0x0;var _0x4ed772=_0xa61a[_0x305bbf];return _0x4ed772;};'use strict';var moment=require(_0xaa61('0x0'));var Sequelize=require(_0xaa61('0x1'));module[_0xaa61('0x2')]={'uniqueid':{'type':Sequelize[_0xaa61('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xaa61('0x4')]},'leaveAt':{'type':Sequelize[_0xaa61('0x4')]},'acceptAt':{'type':Sequelize[_0xaa61('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xaa61('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 61ccb7b..54331d7 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 _0x103f=['rows','catch','show','params','intersection','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','ChatQueueReport','rawAttributes','fieldName','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x347402,_0x581b59){var _0x487765=function(_0x2ac371){while(--_0x2ac371){_0x347402['push'](_0x347402['shift']());}};_0x487765(++_0x581b59);}(_0x103f,0x13e));var _0xf103=function(_0x46b8af,_0x307d60){_0x46b8af=_0x46b8af-0x0;var _0x33bf87=_0x103f[_0x46b8af];return _0x33bf87;};'use strict';var emlformat=require(_0xf103('0x0'));var rimraf=require(_0xf103('0x1'));var zipdir=require(_0xf103('0x2'));var jsonpatch=require(_0xf103('0x3'));var rp=require(_0xf103('0x4'));var moment=require(_0xf103('0x5'));var BPromise=require(_0xf103('0x6'));var Mustache=require(_0xf103('0x7'));var util=require(_0xf103('0x8'));var path=require(_0xf103('0x9'));var sox=require('sox');var csv=require(_0xf103('0xa'));var ejs=require(_0xf103('0xb'));var fs=require('fs');var fs_extra=require(_0xf103('0xc'));var _=require(_0xf103('0xd'));var squel=require(_0xf103('0xe'));var crypto=require(_0xf103('0xf'));var jsforce=require(_0xf103('0x10'));var deskjs=require(_0xf103('0x11'));var toCsv=require(_0xf103('0xa'));var querystring=require(_0xf103('0x12'));var Papa=require(_0xf103('0x13'));var Redis=require(_0xf103('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf103('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf103('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf103('0x17'));var config=require(_0xf103('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf103('0x19'))['db'];function respondWithStatusCode(_0x568960,_0x5735d1){_0x5735d1=_0x5735d1||0xcc;return function(_0x4e7ec5){if(_0x4e7ec5){return _0x568960[_0xf103('0x1a')](_0x5735d1);}return _0x568960['status'](_0x5735d1)[_0xf103('0x1b')]();};}function respondWithResult(_0x1e8765,_0x55ec64){_0x55ec64=_0x55ec64||0xc8;return function(_0x189a41){if(_0x189a41){return _0x1e8765[_0xf103('0x1c')](_0x55ec64)['json'](_0x189a41);}};}function respondWithFilteredResult(_0x1de2a8,_0x299ddf){return function(_0x5bf405){if(_0x5bf405){var _0x13be78=typeof _0x299ddf['offset']==='undefined'&&typeof _0x299ddf[_0xf103('0x1d')]===_0xf103('0x1e');var _0x31e26e=_0x5bf405[_0xf103('0x1f')];var _0x1659fa=_0x13be78?0x0:_0x299ddf[_0xf103('0x20')];var _0x5a2e85=_0x13be78?_0x5bf405[_0xf103('0x1f')]:_0x299ddf[_0xf103('0x20')]+_0x299ddf['limit'];var _0x21ea69;if(_0x5a2e85>=_0x31e26e){_0x5a2e85=_0x31e26e;_0x21ea69=0xc8;}else{_0x21ea69=0xce;}_0x1de2a8[_0xf103('0x1c')](_0x21ea69);return _0x1de2a8[_0xf103('0x21')](_0xf103('0x22'),_0x1659fa+'-'+_0x5a2e85+'/'+_0x31e26e)[_0xf103('0x23')](_0x5bf405);}return null;};}function patchUpdates(_0x5d28e9){return function(_0x32aaa5){try{jsonpatch[_0xf103('0x24')](_0x32aaa5,_0x5d28e9,!![]);}catch(_0x467b15){return BPromise[_0xf103('0x25')](_0x467b15);}return _0x32aaa5[_0xf103('0x26')]();};}function saveUpdates(_0x319c49,_0x3607ce){return function(_0x111e83){if(_0x111e83){return _0x111e83['update'](_0x319c49)[_0xf103('0x27')](function(_0x4fab08){return _0x4fab08;});}return null;};}function removeEntity(_0x470479,_0x4d1752){return function(_0x3a8d9e){if(_0x3a8d9e){return _0x3a8d9e[_0xf103('0x28')]()[_0xf103('0x27')](function(){_0x470479[_0xf103('0x1c')](0xcc)[_0xf103('0x1b')]();});}};}function handleEntityNotFound(_0x297198,_0x23a122){return function(_0x259797){if(!_0x259797){_0x297198['sendStatus'](0x194);}return _0x259797;};}function handleError(_0x2c415a,_0x4bdc52){_0x4bdc52=_0x4bdc52||0x1f4;return function(_0x259fdc){logger['error'](_0x259fdc[_0xf103('0x29')]);if(_0x259fdc[_0xf103('0x2a')]){delete _0x259fdc[_0xf103('0x2a')];}_0x2c415a[_0xf103('0x1c')](_0x4bdc52)['send'](_0x259fdc);};}exports[_0xf103('0x2b')]=function(_0x1d3cdd,_0x14b6b7){var _0x5a1f81={},_0x4adf44={},_0x1b0a13={'count':0x0,'rows':[]};var _0x7ee263=_['map'](db[_0xf103('0x2c')][_0xf103('0x2d')],function(_0x2fab93){return{'name':_0x2fab93[_0xf103('0x2e')],'type':_0x2fab93['type']['key']};});_0x4adf44['model']=_['map'](_0x7ee263,_0xf103('0x2a'));_0x4adf44['query']=_[_0xf103('0x2f')](_0x1d3cdd[_0xf103('0x30')]);_0x4adf44[_0xf103('0x31')]=_['intersection'](_0x4adf44['model'],_0x4adf44[_0xf103('0x30')]);_0x5a1f81[_0xf103('0x32')]=_['intersection'](_0x4adf44[_0xf103('0x33')],qs[_0xf103('0x34')](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x34')]));_0x5a1f81[_0xf103('0x32')]=_0x5a1f81[_0xf103('0x32')][_0xf103('0x35')]?_0x5a1f81[_0xf103('0x32')]:_0x4adf44[_0xf103('0x33')];if(!_0x1d3cdd[_0xf103('0x30')][_0xf103('0x36')](_0xf103('0x37'))){_0x5a1f81[_0xf103('0x1d')]=qs[_0xf103('0x1d')](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x1d')]);_0x5a1f81[_0xf103('0x20')]=qs['offset'](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x20')]);}_0x5a1f81[_0xf103('0x38')]=qs['sort'](_0x1d3cdd[_0xf103('0x30')]['sort']);_0x5a1f81['where']=qs[_0xf103('0x31')](_[_0xf103('0x39')](_0x1d3cdd[_0xf103('0x30')],_0x4adf44[_0xf103('0x31')]),_0x7ee263);if(_0x1d3cdd[_0xf103('0x30')][_0xf103('0x3a')]){_0x5a1f81[_0xf103('0x3b')]=_[_0xf103('0x3c')](_0x5a1f81[_0xf103('0x3b')],{'$or':_['map'](_0x7ee263,function(_0x3cd906){if(_0x3cd906[_0xf103('0x3d')]!==_0xf103('0x3e')){var _0x4a192c={};_0x4a192c[_0x3cd906[_0xf103('0x2a')]]={'$like':'%'+_0x1d3cdd[_0xf103('0x30')][_0xf103('0x3a')]+'%'};return _0x4a192c;}})});}_0x5a1f81=_['merge']({},_0x5a1f81,_0x1d3cdd[_0xf103('0x3f')]);var _0x7ff67a={'where':_0x5a1f81[_0xf103('0x3b')]};return db[_0xf103('0x2c')][_0xf103('0x1f')](_0x7ff67a)['then'](function(_0x4c22b2){_0x1b0a13[_0xf103('0x1f')]=_0x4c22b2;if(_0x1d3cdd[_0xf103('0x30')][_0xf103('0x40')]){_0x5a1f81[_0xf103('0x41')]=[{'all':!![]}];}return db[_0xf103('0x2c')][_0xf103('0x42')](_0x5a1f81);})[_0xf103('0x27')](function(_0x304ce2){_0x1b0a13[_0xf103('0x43')]=_0x304ce2;return _0x1b0a13;})[_0xf103('0x27')](respondWithFilteredResult(_0x14b6b7,_0x5a1f81))[_0xf103('0x44')](handleError(_0x14b6b7,null));};exports[_0xf103('0x45')]=function(_0x439cf4,_0x26df37){var _0x434a3a={'raw':!![],'where':{'id':_0x439cf4[_0xf103('0x46')]['id']}},_0x16ed02={};_0x16ed02['model']=_['keys'](db[_0xf103('0x2c')][_0xf103('0x2d')]);_0x16ed02['query']=_[_0xf103('0x2f')](_0x439cf4[_0xf103('0x30')]);_0x16ed02[_0xf103('0x31')]=_[_0xf103('0x47')](_0x16ed02[_0xf103('0x33')],_0x16ed02['query']);_0x434a3a[_0xf103('0x32')]=_[_0xf103('0x47')](_0x16ed02['model'],qs[_0xf103('0x34')](_0x439cf4[_0xf103('0x30')][_0xf103('0x34')]));_0x434a3a[_0xf103('0x32')]=_0x434a3a[_0xf103('0x32')]['length']?_0x434a3a['attributes']:_0x16ed02['model'];if(_0x439cf4['query'][_0xf103('0x40')]){_0x434a3a[_0xf103('0x41')]=[{'all':!![]}];}_0x434a3a=_[_0xf103('0x3c')]({},_0x434a3a,_0x439cf4[_0xf103('0x3f')]);return db[_0xf103('0x2c')][_0xf103('0x48')](_0x434a3a)[_0xf103('0x27')](handleEntityNotFound(_0x26df37,null))[_0xf103('0x27')](respondWithResult(_0x26df37,null))[_0xf103('0x44')](handleError(_0x26df37,null));};exports[_0xf103('0x49')]=function(_0x326562,_0x2f6cca){return db[_0xf103('0x2c')]['create'](_0x326562[_0xf103('0x4a')],{})[_0xf103('0x27')](respondWithResult(_0x2f6cca,0xc9))['catch'](handleError(_0x2f6cca,null));};exports[_0xf103('0x4b')]=function(_0x5209ac,_0x382217){if(_0x5209ac[_0xf103('0x4a')]['id']){delete _0x5209ac[_0xf103('0x4a')]['id'];}return db[_0xf103('0x2c')][_0xf103('0x48')]({'where':{'id':_0x5209ac['params']['id']}})[_0xf103('0x27')](handleEntityNotFound(_0x382217,null))['then'](saveUpdates(_0x5209ac[_0xf103('0x4a')],null))[_0xf103('0x27')](respondWithResult(_0x382217,null))['catch'](handleError(_0x382217,null));};exports['destroy']=function(_0x267e8f,_0x677aaf){return db[_0xf103('0x2c')][_0xf103('0x48')]({'where':{'id':_0x267e8f[_0xf103('0x46')]['id']}})['then'](handleEntityNotFound(_0x677aaf,null))[_0xf103('0x27')](removeEntity(_0x677aaf,null))[_0xf103('0x44')](handleError(_0x677aaf,null));};exports['describe']=function(_0x463494,_0x2a0e12){return db[_0xf103('0x2c')][_0xf103('0x4c')]()[_0xf103('0x27')](respondWithResult(_0x2a0e12,null))['catch'](handleError(_0x2a0e12,null));}; \ No newline at end of file +var _0x3e4d=['jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','end','error','stack','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','show','params','keys','length','include','create','update','body','find','describe','eml-format','zip-dir','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto'];(function(_0x249b6f,_0x2ecefb){var _0x578c21=function(_0x52d857){while(--_0x52d857){_0x249b6f['push'](_0x249b6f['shift']());}};_0x578c21(++_0x2ecefb);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x12366b,_0x3eb259){_0x12366b=_0x12366b-0x0;var _0x15b2b2=_0x3e4d[_0x12366b];return _0x15b2b2;};'use strict';var emlformat=require(_0xd3e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd3e4('0x2'));var Mustache=require(_0xd3e4('0x3'));var util=require(_0xd3e4('0x4'));var path=require('path');var sox=require(_0xd3e4('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3e4('0x6'));var _=require(_0xd3e4('0x7'));var squel=require(_0xd3e4('0x8'));var crypto=require(_0xd3e4('0x9'));var jsforce=require(_0xd3e4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd3e4('0xb'));var querystring=require(_0xd3e4('0xc'));var Papa=require(_0xd3e4('0xd'));var Redis=require('ioredis');var authService=require(_0xd3e4('0xe'));var qs=require(_0xd3e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3e4('0x10'))(_0xd3e4('0x11'));var utils=require(_0xd3e4('0x12'));var config=require(_0xd3e4('0x13'));var licenseUtil=require(_0xd3e4('0x14'));var db=require(_0xd3e4('0x15'))['db'];function respondWithStatusCode(_0x1fadc6,_0x4e3258){_0x4e3258=_0x4e3258||0xcc;return function(_0x178b05){if(_0x178b05){return _0x1fadc6[_0xd3e4('0x16')](_0x4e3258);}return _0x1fadc6[_0xd3e4('0x17')](_0x4e3258)['end']();};}function respondWithResult(_0x49c058,_0x254706){_0x254706=_0x254706||0xc8;return function(_0x4abd20){if(_0x4abd20){return _0x49c058[_0xd3e4('0x17')](_0x254706)[_0xd3e4('0x18')](_0x4abd20);}};}function respondWithFilteredResult(_0x586db9,_0x2dbbc5){return function(_0x17081f){if(_0x17081f){var _0x4d5136=typeof _0x2dbbc5['offset']==='undefined'&&typeof _0x2dbbc5[_0xd3e4('0x19')]===_0xd3e4('0x1a');var _0xd6de64=_0x17081f[_0xd3e4('0x1b')];var _0xcf261b=_0x4d5136?0x0:_0x2dbbc5['offset'];var _0x1a6d65=_0x4d5136?_0x17081f[_0xd3e4('0x1b')]:_0x2dbbc5[_0xd3e4('0x1c')]+_0x2dbbc5['limit'];var _0x413a10;if(_0x1a6d65>=_0xd6de64){_0x1a6d65=_0xd6de64;_0x413a10=0xc8;}else{_0x413a10=0xce;}_0x586db9[_0xd3e4('0x17')](_0x413a10);return _0x586db9[_0xd3e4('0x1d')]('Content-Range',_0xcf261b+'-'+_0x1a6d65+'/'+_0xd6de64)[_0xd3e4('0x18')](_0x17081f);}return null;};}function patchUpdates(_0x2e2ab8){return function(_0x52af67){try{jsonpatch[_0xd3e4('0x1e')](_0x52af67,_0x2e2ab8,!![]);}catch(_0x4386b0){return BPromise[_0xd3e4('0x1f')](_0x4386b0);}return _0x52af67[_0xd3e4('0x20')]();};}function saveUpdates(_0x186786,_0x196be4){return function(_0x27019e){if(_0x27019e){return _0x27019e['update'](_0x186786)[_0xd3e4('0x21')](function(_0x5cd1fa){return _0x5cd1fa;});}return null;};}function removeEntity(_0x17b41a,_0x4281e5){return function(_0xe295b6){if(_0xe295b6){return _0xe295b6[_0xd3e4('0x22')]()[_0xd3e4('0x21')](function(){_0x17b41a[_0xd3e4('0x17')](0xcc)[_0xd3e4('0x23')]();});}};}function handleEntityNotFound(_0x4d24ab,_0x512ab8){return function(_0x81b1f5){if(!_0x81b1f5){_0x4d24ab[_0xd3e4('0x16')](0x194);}return _0x81b1f5;};}function handleError(_0xebf9ff,_0x178023){_0x178023=_0x178023||0x1f4;return function(_0x868020){logger[_0xd3e4('0x24')](_0x868020[_0xd3e4('0x25')]);if(_0x868020['name']){delete _0x868020['name'];}_0xebf9ff['status'](_0x178023)[_0xd3e4('0x26')](_0x868020);};}exports['index']=function(_0x46dada,_0x387ea6){var _0x59b895={},_0x250e70={},_0xef4209={'count':0x0,'rows':[]};var _0xe0942d=_[_0xd3e4('0x27')](db[_0xd3e4('0x28')][_0xd3e4('0x29')],function(_0x1b6cab){return{'name':_0x1b6cab[_0xd3e4('0x2a')],'type':_0x1b6cab[_0xd3e4('0x2b')][_0xd3e4('0x2c')]};});_0x250e70['model']=_[_0xd3e4('0x27')](_0xe0942d,'name');_0x250e70[_0xd3e4('0x2d')]=_['keys'](_0x46dada['query']);_0x250e70['filters']=_[_0xd3e4('0x2e')](_0x250e70[_0xd3e4('0x2f')],_0x250e70[_0xd3e4('0x2d')]);_0x59b895['attributes']=_[_0xd3e4('0x2e')](_0x250e70[_0xd3e4('0x2f')],qs[_0xd3e4('0x30')](_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x30')]));_0x59b895[_0xd3e4('0x31')]=_0x59b895['attributes']['length']?_0x59b895[_0xd3e4('0x31')]:_0x250e70['model'];if(!_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x32')](_0xd3e4('0x33'))){_0x59b895['limit']=qs[_0xd3e4('0x19')](_0x46dada['query'][_0xd3e4('0x19')]);_0x59b895[_0xd3e4('0x1c')]=qs[_0xd3e4('0x1c')](_0x46dada[_0xd3e4('0x2d')]['offset']);}_0x59b895[_0xd3e4('0x34')]=qs['sort'](_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x35')]);_0x59b895[_0xd3e4('0x36')]=qs['filters'](_[_0xd3e4('0x37')](_0x46dada[_0xd3e4('0x2d')],_0x250e70[_0xd3e4('0x38')]),_0xe0942d);if(_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x39')]){_0x59b895[_0xd3e4('0x36')]=_[_0xd3e4('0x3a')](_0x59b895[_0xd3e4('0x36')],{'$or':_[_0xd3e4('0x27')](_0xe0942d,function(_0x40a1e9){if(_0x40a1e9[_0xd3e4('0x2b')]!==_0xd3e4('0x3b')){var _0x541802={};_0x541802[_0x40a1e9[_0xd3e4('0x3c')]]={'$like':'%'+_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x39')]+'%'};return _0x541802;}})});}_0x59b895=_[_0xd3e4('0x3a')]({},_0x59b895,_0x46dada[_0xd3e4('0x3d')]);var _0x2ab66a={'where':_0x59b895[_0xd3e4('0x36')]};return db[_0xd3e4('0x28')][_0xd3e4('0x1b')](_0x2ab66a)['then'](function(_0xc429de){_0xef4209['count']=_0xc429de;if(_0x46dada['query'][_0xd3e4('0x3e')]){_0x59b895['include']=[{'all':!![]}];}return db[_0xd3e4('0x28')]['findAll'](_0x59b895);})[_0xd3e4('0x21')](function(_0x13d688){_0xef4209[_0xd3e4('0x3f')]=_0x13d688;return _0xef4209;})[_0xd3e4('0x21')](respondWithFilteredResult(_0x387ea6,_0x59b895))[_0xd3e4('0x40')](handleError(_0x387ea6,null));};exports[_0xd3e4('0x41')]=function(_0x307223,_0x5345e2){var _0x4fef51={'raw':!![],'where':{'id':_0x307223[_0xd3e4('0x42')]['id']}},_0x5b97f8={};_0x5b97f8[_0xd3e4('0x2f')]=_[_0xd3e4('0x43')](db[_0xd3e4('0x28')][_0xd3e4('0x29')]);_0x5b97f8[_0xd3e4('0x2d')]=_[_0xd3e4('0x43')](_0x307223[_0xd3e4('0x2d')]);_0x5b97f8[_0xd3e4('0x38')]=_[_0xd3e4('0x2e')](_0x5b97f8['model'],_0x5b97f8[_0xd3e4('0x2d')]);_0x4fef51[_0xd3e4('0x31')]=_[_0xd3e4('0x2e')](_0x5b97f8[_0xd3e4('0x2f')],qs[_0xd3e4('0x30')](_0x307223[_0xd3e4('0x2d')][_0xd3e4('0x30')]));_0x4fef51[_0xd3e4('0x31')]=_0x4fef51[_0xd3e4('0x31')][_0xd3e4('0x44')]?_0x4fef51[_0xd3e4('0x31')]:_0x5b97f8[_0xd3e4('0x2f')];if(_0x307223['query'][_0xd3e4('0x3e')]){_0x4fef51[_0xd3e4('0x45')]=[{'all':!![]}];}_0x4fef51=_[_0xd3e4('0x3a')]({},_0x4fef51,_0x307223['options']);return db[_0xd3e4('0x28')]['find'](_0x4fef51)[_0xd3e4('0x21')](handleEntityNotFound(_0x5345e2,null))[_0xd3e4('0x21')](respondWithResult(_0x5345e2,null))[_0xd3e4('0x40')](handleError(_0x5345e2,null));};exports[_0xd3e4('0x46')]=function(_0x8ffe57,_0x4e113c){return db[_0xd3e4('0x28')][_0xd3e4('0x46')](_0x8ffe57['body'],{})[_0xd3e4('0x21')](respondWithResult(_0x4e113c,0xc9))[_0xd3e4('0x40')](handleError(_0x4e113c,null));};exports[_0xd3e4('0x47')]=function(_0x55d726,_0x26b7b3){if(_0x55d726[_0xd3e4('0x48')]['id']){delete _0x55d726[_0xd3e4('0x48')]['id'];}return db[_0xd3e4('0x28')][_0xd3e4('0x49')]({'where':{'id':_0x55d726[_0xd3e4('0x42')]['id']}})[_0xd3e4('0x21')](handleEntityNotFound(_0x26b7b3,null))['then'](saveUpdates(_0x55d726[_0xd3e4('0x48')],null))[_0xd3e4('0x21')](respondWithResult(_0x26b7b3,null))[_0xd3e4('0x40')](handleError(_0x26b7b3,null));};exports[_0xd3e4('0x22')]=function(_0x51ba4f,_0x12aa09){return db[_0xd3e4('0x28')]['find']({'where':{'id':_0x51ba4f['params']['id']}})[_0xd3e4('0x21')](handleEntityNotFound(_0x12aa09,null))[_0xd3e4('0x21')](removeEntity(_0x12aa09,null))[_0xd3e4('0x40')](handleError(_0x12aa09,null));};exports[_0xd3e4('0x4a')]=function(_0x5340c6,_0x259db2){return db[_0xd3e4('0x28')][_0xd3e4('0x4a')]()['then'](respondWithResult(_0x259db2,null))[_0xd3e4('0x40')](handleError(_0x259db2,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 55fe4b4..0184c65 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xe706,0xa3));var _0x6e70=function(_0x2606e7,_0xcbe32c){_0x2606e7=_0x2606e7-0x0;var _0x56d2b6=_0xe706[_0x2606e7];return _0x56d2b6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x587d38,_0x2aa598){var _0x37ff5c=function(_0x19070b){while(--_0x19070b){_0x587d38['push'](_0x587d38['shift']());}};_0x37ff5c(++_0x2aa598);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b69371a..95c4b34 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 _0xf1f9=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','body','where','attributes','limit','UpdateChatQueueReport','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x1a9699,_0x456e23){_0x1a9699=_0x1a9699-0x0;var _0x4a91ef=_0xf1f9[_0x1a9699];return _0x4a91ef;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});}exports[_0x9f1f('0x17')]=function(_0x5d35a6){var _0x23d9c0=this;return new Promise(function(_0x11d55b,_0x19d3f2){return db[_0x9f1f('0x18')][_0x9f1f('0x19')](_0x5d35a6['body'],{'raw':_0x5d35a6[_0x9f1f('0x1a')]?_0x5d35a6[_0x9f1f('0x1a')][_0x9f1f('0x1b')]===undefined?!![]:![]:!![]})[_0x9f1f('0xc')](function(_0x5db027){logger[_0x9f1f('0xd')]('CreateChatQueueReport',_0x5d35a6);logger[_0x9f1f('0x10')](_0x9f1f('0x17'),_0x5d35a6,JSON['stringify'](_0x5db027));_0x11d55b(_0x5db027);})[_0x9f1f('0x16')](function(_0x317f75){logger[_0x9f1f('0x13')](_0x9f1f('0x17'),_0x317f75[_0x9f1f('0x14')],_0x5d35a6);_0x19d3f2(_0x23d9c0['error'](0x1f4,_0x317f75['message']));});});};exports['UpdateChatQueueReport']=function(_0x57d29f){var _0x47db05=this;return new Promise(function(_0x42a5ac,_0x35dac1){return db[_0x9f1f('0x18')]['update'](_0x57d29f[_0x9f1f('0x1c')],{'raw':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1d')]||null:null,'attributes':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1e')]||null:null,'limit':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1f')]||null:null})[_0x9f1f('0xc')](function(_0x4e4636){logger['info'](_0x9f1f('0x20'),_0x57d29f);logger[_0x9f1f('0x10')]('UpdateChatQueueReport',_0x57d29f,JSON[_0x9f1f('0x12')](_0x4e4636));_0x42a5ac(_0x4e4636);})[_0x9f1f('0x16')](function(_0x3fccb6){logger[_0x9f1f('0x13')](_0x9f1f('0x20'),_0x3fccb6[_0x9f1f('0x14')],_0x57d29f);_0x35dac1(_0x47db05[_0x9f1f('0x13')](0x1f4,_0x3fccb6[_0x9f1f('0x14')]));});});}; \ No newline at end of file +var _0x0066=['then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x167067,_0xca5f29){var _0xcf561b=function(_0x11bda4){while(--_0x11bda4){_0x167067['push'](_0x167067['shift']());}};_0xcf561b(++_0xca5f29);}(_0x0066,0x111));var _0x6006=function(_0x1ef294,_0x496671){_0x1ef294=_0x1ef294-0x0;var _0x3c1c9c=_0x0066[_0x1ef294];return _0x3c1c9c;};'use strict';var _=require(_0x6006('0x0'));var util=require(_0x6006('0x1'));var moment=require(_0x6006('0x2'));var BPromise=require(_0x6006('0x3'));var rs=require(_0x6006('0x4'));var fs=require('fs');var Redis=require(_0x6006('0x5'));var db=require(_0x6006('0x6'))['db'];var utils=require(_0x6006('0x7'));var logger=require(_0x6006('0x8'))(_0x6006('0x9'));var config=require(_0x6006('0xa'));var jayson=require(_0x6006('0xb'));var client=jayson[_0x6006('0xc')][_0x6006('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3aee4f,_0x568810,_0x4af6e8){return new BPromise(function(_0xdf0291,_0x5afcb3){return client[_0x6006('0xe')](_0x3aee4f,_0x4af6e8)[_0x6006('0xf')](function(_0x2e6093){logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,'request\x20sent');logger[_0x6006('0x12')](_0x6006('0x13'),_0x568810,'request\x20sent',JSON[_0x6006('0x14')](_0x2e6093));if(_0x2e6093[_0x6006('0x15')]){if(_0x2e6093['error'][_0x6006('0x16')]===0x1f4){logger[_0x6006('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x568810,_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);return _0x5afcb3(_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);}logger[_0x6006('0x15')](_0x6006('0x11'),_0x568810,_0x2e6093['error']['message']);return _0xdf0291(_0x2e6093['error'][_0x6006('0x17')]);}else{logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,_0x6006('0x18'));_0xdf0291(_0x2e6093['result'][_0x6006('0x17')]);}})['catch'](function(_0x5d277e){logger['error'](_0x6006('0x11'),_0x568810,_0x5d277e);_0x5afcb3(_0x5d277e);});});}exports['CreateChatQueueReport']=function(_0x3be2b0){var _0x213493=this;return new Promise(function(_0x49f63f,_0xd97b56){return db[_0x6006('0x19')][_0x6006('0x1a')](_0x3be2b0[_0x6006('0x1b')],{'raw':_0x3be2b0[_0x6006('0x1c')]?_0x3be2b0[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![]})[_0x6006('0xf')](function(_0x62bf30){logger['info'](_0x6006('0x1e'),_0x3be2b0);logger['debug'](_0x6006('0x1e'),_0x3be2b0,JSON[_0x6006('0x14')](_0x62bf30));_0x49f63f(_0x62bf30);})['catch'](function(_0x229ba9){logger[_0x6006('0x15')](_0x6006('0x1e'),_0x229ba9[_0x6006('0x17')],_0x3be2b0);_0xd97b56(_0x213493['error'](0x1f4,_0x229ba9[_0x6006('0x17')]));});});};exports[_0x6006('0x1f')]=function(_0x1e1eb4){var _0x4c52fb=this;return new Promise(function(_0x515952,_0x30744e){return db[_0x6006('0x19')][_0x6006('0x20')](_0x1e1eb4['body'],{'raw':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x21')]||null:null,'attributes':_0x1e1eb4['options']?_0x1e1eb4[_0x6006('0x1c')]['attributes']||null:null,'limit':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4['options'][_0x6006('0x22')]||null:null})[_0x6006('0xf')](function(_0x137b1a){logger[_0x6006('0x10')]('UpdateChatQueueReport',_0x1e1eb4);logger['debug'](_0x6006('0x1f'),_0x1e1eb4,JSON[_0x6006('0x14')](_0x137b1a));_0x515952(_0x137b1a);})[_0x6006('0x23')](function(_0xa63979){logger[_0x6006('0x15')]('UpdateChatQueueReport',_0xa63979['message'],_0x1e1eb4);_0x30744e(_0x4c52fb[_0x6006('0x15')](0x1f4,_0xa63979['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index da89834..07c68fa 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 _0x3128=['/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','get','isAuthenticated','index'];(function(_0x41954f,_0x85d7b8){var _0x4b8406=function(_0x373b43){while(--_0x373b43){_0x41954f['push'](_0x41954f['shift']());}};_0x4b8406(++_0x85d7b8);}(_0x3128,0xab));var _0x8312=function(_0x2054d2,_0x3b06cb){_0x2054d2=_0x2054d2-0x0;var _0x82bf17=_0x3128[_0x2054d2];return _0x82bf17;};'use strict';var multer=require(_0x8312('0x0'));var util=require(_0x8312('0x1'));var path=require(_0x8312('0x2'));var timeout=require(_0x8312('0x3'));var express=require(_0x8312('0x4'));var router=express['Router']();var fs_extra=require(_0x8312('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x8312('0x6')]('/',auth[_0x8312('0x7')](),controller[_0x8312('0x8')]);router[_0x8312('0x6')](_0x8312('0x9'),auth[_0x8312('0x7')](),controller[_0x8312('0xa')]);router[_0x8312('0x6')](_0x8312('0xb'),auth[_0x8312('0x7')](),controller[_0x8312('0xc')]);router[_0x8312('0xd')]('/',auth['isAuthenticated'](),controller[_0x8312('0xe')]);router[_0x8312('0xf')](_0x8312('0xb'),auth[_0x8312('0x7')](),controller[_0x8312('0x10')]);router['delete'](_0x8312('0xb'),auth['isAuthenticated'](),controller[_0x8312('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6ff7=['isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x5c6c64,_0x12d4cb){var _0x172174=function(_0x3f49c3){while(--_0x3f49c3){_0x5c6c64['push'](_0x5c6c64['shift']());}};_0x172174(++_0x12d4cb);}(_0x6ff7,0x16f));var _0x76ff=function(_0x79a988,_0x336527){_0x79a988=_0x79a988-0x0;var _0x29f9d2=_0x6ff7[_0x79a988];return _0x29f9d2;};'use strict';var multer=require(_0x76ff('0x0'));var util=require(_0x76ff('0x1'));var path=require('path');var timeout=require(_0x76ff('0x2'));var express=require(_0x76ff('0x3'));var router=express[_0x76ff('0x4')]();var fs_extra=require(_0x76ff('0x5'));var auth=require(_0x76ff('0x6'));var interaction=require(_0x76ff('0x7'));var config=require(_0x76ff('0x8'));var controller=require(_0x76ff('0x9'));router[_0x76ff('0xa')]('/',auth[_0x76ff('0xb')](),controller[_0x76ff('0xc')]);router[_0x76ff('0xa')](_0x76ff('0xd'),auth[_0x76ff('0xb')](),controller['describe']);router[_0x76ff('0xa')](_0x76ff('0xe'),auth[_0x76ff('0xb')](),controller[_0x76ff('0xf')]);router[_0x76ff('0x10')]('/',auth[_0x76ff('0xb')](),controller[_0x76ff('0x11')]);router[_0x76ff('0x12')](_0x76ff('0xe'),auth[_0x76ff('0xb')](),controller[_0x76ff('0x13')]);router[_0x76ff('0x14')]('/:id',auth[_0x76ff('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index fd97dda..13519b7 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xc4ea75,_0x273753){var _0x52ea5e=function(_0x1ee872){while(--_0x1ee872){_0xc4ea75['push'](_0xc4ea75['shift']());}};_0x52ea5e(++_0x273753);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x008c,0x188));var _0xc008=function(_0x56a06f,_0x183813){_0x56a06f=_0x56a06f-0x0;var _0x3309ac=_0x008c[_0x56a06f];return _0x3309ac;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 103830f..5109a26 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 _0xe1f0=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','update','then','destroy','name','send','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','rows','catch','show','params','keys','create','body','find','describe'];(function(_0x4e5969,_0x59d73e){var _0x59d7ce=function(_0x13a624){while(--_0x13a624){_0x4e5969['push'](_0x4e5969['shift']());}};_0x59d7ce(++_0x59d73e);}(_0xe1f0,0x1ea));var _0x0e1f=function(_0x4bd740,_0x25ce9e){_0x4bd740=_0x4bd740-0x0;var _0x41f39e=_0xe1f0[_0x4bd740];return _0x41f39e;};'use strict';var emlformat=require(_0x0e1f('0x0'));var rimraf=require(_0x0e1f('0x1'));var zipdir=require(_0x0e1f('0x2'));var jsonpatch=require(_0x0e1f('0x3'));var rp=require(_0x0e1f('0x4'));var moment=require(_0x0e1f('0x5'));var BPromise=require(_0x0e1f('0x6'));var Mustache=require(_0x0e1f('0x7'));var util=require(_0x0e1f('0x8'));var path=require(_0x0e1f('0x9'));var sox=require(_0x0e1f('0xa'));var csv=require(_0x0e1f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e1f('0xc'));var squel=require('squel');var crypto=require(_0x0e1f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0e1f('0xe'));var toCsv=require(_0x0e1f('0xb'));var querystring=require(_0x0e1f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e1f('0x10'));var as=require(_0x0e1f('0x11'));var hardwareService=require(_0x0e1f('0x12'));var logger=require('../../config/logger')(_0x0e1f('0x13'));var utils=require(_0x0e1f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0e1f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124cec,_0xc2abd8){_0xc2abd8=_0xc2abd8||0xcc;return function(_0x4bd123){if(_0x4bd123){return _0x124cec[_0x0e1f('0x16')](_0xc2abd8);}return _0x124cec[_0x0e1f('0x17')](_0xc2abd8)[_0x0e1f('0x18')]();};}function respondWithResult(_0x4e0d54,_0x5c235d){_0x5c235d=_0x5c235d||0xc8;return function(_0xc59f20){if(_0xc59f20){return _0x4e0d54[_0x0e1f('0x17')](_0x5c235d)[_0x0e1f('0x19')](_0xc59f20);}};}function respondWithFilteredResult(_0x3bd237,_0x59ece2){return function(_0x5a9ee8){if(_0x5a9ee8){var _0x2f6f20=typeof _0x59ece2[_0x0e1f('0x1a')]==='undefined'&&typeof _0x59ece2[_0x0e1f('0x1b')]==='undefined';var _0x2af45d=_0x5a9ee8['count'];var _0x5f04c9=_0x2f6f20?0x0:_0x59ece2['offset'];var _0x37ffd2=_0x2f6f20?_0x5a9ee8[_0x0e1f('0x1c')]:_0x59ece2['offset']+_0x59ece2[_0x0e1f('0x1b')];var _0x81c9c5;if(_0x37ffd2>=_0x2af45d){_0x37ffd2=_0x2af45d;_0x81c9c5=0xc8;}else{_0x81c9c5=0xce;}_0x3bd237[_0x0e1f('0x17')](_0x81c9c5);return _0x3bd237['set'](_0x0e1f('0x1d'),_0x5f04c9+'-'+_0x37ffd2+'/'+_0x2af45d)[_0x0e1f('0x19')](_0x5a9ee8);}return null;};}function patchUpdates(_0x4d52bc){return function(_0x4dd689){try{jsonpatch['apply'](_0x4dd689,_0x4d52bc,!![]);}catch(_0x278504){return BPromise[_0x0e1f('0x1e')](_0x278504);}return _0x4dd689['save']();};}function saveUpdates(_0x1c402a,_0x5bbaa8){return function(_0x2d751b){if(_0x2d751b){return _0x2d751b[_0x0e1f('0x1f')](_0x1c402a)[_0x0e1f('0x20')](function(_0x1a1b11){return _0x1a1b11;});}return null;};}function removeEntity(_0x4aa0f7,_0x2a328c){return function(_0x15d0e3){if(_0x15d0e3){return _0x15d0e3[_0x0e1f('0x21')]()[_0x0e1f('0x20')](function(){_0x4aa0f7[_0x0e1f('0x17')](0xcc)[_0x0e1f('0x18')]();});}};}function handleEntityNotFound(_0x4a61dd,_0x4f49da){return function(_0x2c3d19){if(!_0x2c3d19){_0x4a61dd[_0x0e1f('0x16')](0x194);}return _0x2c3d19;};}function handleError(_0x18eb9b,_0x41c47e){_0x41c47e=_0x41c47e||0x1f4;return function(_0x4d1e2c){logger['error'](_0x4d1e2c['stack']);if(_0x4d1e2c[_0x0e1f('0x22')]){delete _0x4d1e2c['name'];}_0x18eb9b[_0x0e1f('0x17')](_0x41c47e)[_0x0e1f('0x23')](_0x4d1e2c);};}exports[_0x0e1f('0x24')]=function(_0x4b6596,_0x4ae5ae){var _0x4ba73f={},_0x2dd563={},_0xd29787={'count':0x0,'rows':[]};var _0x14b7d9=_['map'](db['ChatTransferReport'][_0x0e1f('0x25')],function(_0x4b31e4){return{'name':_0x4b31e4['fieldName'],'type':_0x4b31e4[_0x0e1f('0x26')][_0x0e1f('0x27')]};});_0x2dd563['model']=_[_0x0e1f('0x28')](_0x14b7d9,'name');_0x2dd563[_0x0e1f('0x29')]=_['keys'](_0x4b6596[_0x0e1f('0x29')]);_0x2dd563[_0x0e1f('0x2a')]=_[_0x0e1f('0x2b')](_0x2dd563[_0x0e1f('0x2c')],_0x2dd563[_0x0e1f('0x29')]);_0x4ba73f[_0x0e1f('0x2d')]=_[_0x0e1f('0x2b')](_0x2dd563['model'],qs['fields'](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x2e')]));_0x4ba73f[_0x0e1f('0x2d')]=_0x4ba73f[_0x0e1f('0x2d')][_0x0e1f('0x2f')]?_0x4ba73f['attributes']:_0x2dd563['model'];if(!_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x30')](_0x0e1f('0x31'))){_0x4ba73f[_0x0e1f('0x1b')]=qs[_0x0e1f('0x1b')](_0x4b6596[_0x0e1f('0x29')]['limit']);_0x4ba73f[_0x0e1f('0x1a')]=qs[_0x0e1f('0x1a')](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x1a')]);}_0x4ba73f['order']=qs['sort'](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x32')]);_0x4ba73f['where']=qs[_0x0e1f('0x2a')](_[_0x0e1f('0x33')](_0x4b6596[_0x0e1f('0x29')],_0x2dd563[_0x0e1f('0x2a')]),_0x14b7d9);if(_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x34')]){_0x4ba73f[_0x0e1f('0x35')]=_[_0x0e1f('0x36')](_0x4ba73f[_0x0e1f('0x35')],{'$or':_[_0x0e1f('0x28')](_0x14b7d9,function(_0x27c717){if(_0x27c717[_0x0e1f('0x26')]!==_0x0e1f('0x37')){var _0x32859f={};_0x32859f[_0x27c717[_0x0e1f('0x22')]]={'$like':'%'+_0x4b6596[_0x0e1f('0x29')]['filter']+'%'};return _0x32859f;}})});}_0x4ba73f=_[_0x0e1f('0x36')]({},_0x4ba73f,_0x4b6596[_0x0e1f('0x38')]);var _0x3b51ef={'where':_0x4ba73f[_0x0e1f('0x35')]};return db['ChatTransferReport'][_0x0e1f('0x1c')](_0x3b51ef)['then'](function(_0x2187ae){_0xd29787['count']=_0x2187ae;if(_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x39')]){_0x4ba73f[_0x0e1f('0x3a')]=[{'all':!![]}];}return db[_0x0e1f('0x3b')][_0x0e1f('0x3c')](_0x4ba73f);})[_0x0e1f('0x20')](function(_0x228013){_0xd29787[_0x0e1f('0x3d')]=_0x228013;return _0xd29787;})[_0x0e1f('0x20')](respondWithFilteredResult(_0x4ae5ae,_0x4ba73f))[_0x0e1f('0x3e')](handleError(_0x4ae5ae,null));};exports[_0x0e1f('0x3f')]=function(_0x5e26b5,_0x11f9e8){var _0x4d7374={'raw':!![],'where':{'id':_0x5e26b5[_0x0e1f('0x40')]['id']}},_0xf13325={};_0xf13325[_0x0e1f('0x2c')]=_[_0x0e1f('0x41')](db[_0x0e1f('0x3b')][_0x0e1f('0x25')]);_0xf13325[_0x0e1f('0x29')]=_[_0x0e1f('0x41')](_0x5e26b5['query']);_0xf13325['filters']=_[_0x0e1f('0x2b')](_0xf13325[_0x0e1f('0x2c')],_0xf13325[_0x0e1f('0x29')]);_0x4d7374['attributes']=_[_0x0e1f('0x2b')](_0xf13325['model'],qs['fields'](_0x5e26b5[_0x0e1f('0x29')][_0x0e1f('0x2e')]));_0x4d7374['attributes']=_0x4d7374['attributes'][_0x0e1f('0x2f')]?_0x4d7374[_0x0e1f('0x2d')]:_0xf13325[_0x0e1f('0x2c')];if(_0x5e26b5['query'][_0x0e1f('0x39')]){_0x4d7374[_0x0e1f('0x3a')]=[{'all':!![]}];}_0x4d7374=_[_0x0e1f('0x36')]({},_0x4d7374,_0x5e26b5[_0x0e1f('0x38')]);return db[_0x0e1f('0x3b')]['find'](_0x4d7374)[_0x0e1f('0x20')](handleEntityNotFound(_0x11f9e8,null))[_0x0e1f('0x20')](respondWithResult(_0x11f9e8,null))['catch'](handleError(_0x11f9e8,null));};exports[_0x0e1f('0x42')]=function(_0xa166ed,_0x244d97){return db[_0x0e1f('0x3b')][_0x0e1f('0x42')](_0xa166ed['body'],{})['then'](respondWithResult(_0x244d97,0xc9))[_0x0e1f('0x3e')](handleError(_0x244d97,null));};exports[_0x0e1f('0x1f')]=function(_0x208c15,_0x22ff97){if(_0x208c15[_0x0e1f('0x43')]['id']){delete _0x208c15[_0x0e1f('0x43')]['id'];}return db[_0x0e1f('0x3b')][_0x0e1f('0x44')]({'where':{'id':_0x208c15[_0x0e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0x22ff97,null))[_0x0e1f('0x20')](saveUpdates(_0x208c15[_0x0e1f('0x43')],null))[_0x0e1f('0x20')](respondWithResult(_0x22ff97,null))[_0x0e1f('0x3e')](handleError(_0x22ff97,null));};exports['destroy']=function(_0x28d058,_0xab1e60){return db[_0x0e1f('0x3b')]['find']({'where':{'id':_0x28d058[_0x0e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0xab1e60,null))[_0x0e1f('0x20')](removeEntity(_0xab1e60,null))[_0x0e1f('0x3e')](handleError(_0xab1e60,null));};exports[_0x0e1f('0x45')]=function(_0x326b1b,_0x4bc4d6){return db['ChatTransferReport'][_0x0e1f('0x45')]()[_0x0e1f('0x20')](respondWithResult(_0x4bc4d6,null))[_0x0e1f('0x3e')](handleError(_0x4bc4d6,null));}; \ No newline at end of file +var _0xcf10=['merge','options','create','body','update','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','filter','include','findAll','rows','catch','show','keys'];(function(_0x1cf2e3,_0x4e62db){var _0x3f868f=function(_0x263baf){while(--_0x263baf){_0x1cf2e3['push'](_0x1cf2e3['shift']());}};_0x3f868f(++_0x4e62db);}(_0xcf10,0x1d6));var _0x0cf1=function(_0x34750b,_0x34aae5){_0x34750b=_0x34750b-0x0;var _0x244258=_0xcf10[_0x34750b];return _0x244258;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0cf1('0x0'));var zipdir=require(_0x0cf1('0x1'));var jsonpatch=require(_0x0cf1('0x2'));var rp=require('request-promise');var moment=require(_0x0cf1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0cf1('0x4'));var util=require(_0x0cf1('0x5'));var path=require(_0x0cf1('0x6'));var sox=require(_0x0cf1('0x7'));var csv=require(_0x0cf1('0x8'));var ejs=require(_0x0cf1('0x9'));var fs=require('fs');var fs_extra=require(_0x0cf1('0xa'));var _=require(_0x0cf1('0xb'));var squel=require('squel');var crypto=require(_0x0cf1('0xc'));var jsforce=require(_0x0cf1('0xd'));var deskjs=require(_0x0cf1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0cf1('0xf'));var Papa=require(_0x0cf1('0x10'));var Redis=require('ioredis');var authService=require(_0x0cf1('0x11'));var qs=require(_0x0cf1('0x12'));var as=require(_0x0cf1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0cf1('0x14'));var utils=require(_0x0cf1('0x15'));var config=require(_0x0cf1('0x16'));var licenseUtil=require(_0x0cf1('0x17'));var db=require(_0x0cf1('0x18'))['db'];function respondWithStatusCode(_0x320821,_0x548e5f){_0x548e5f=_0x548e5f||0xcc;return function(_0x3def44){if(_0x3def44){return _0x320821[_0x0cf1('0x19')](_0x548e5f);}return _0x320821[_0x0cf1('0x1a')](_0x548e5f)[_0x0cf1('0x1b')]();};}function respondWithResult(_0x5aa83a,_0x31935b){_0x31935b=_0x31935b||0xc8;return function(_0x3f55f3){if(_0x3f55f3){return _0x5aa83a['status'](_0x31935b)[_0x0cf1('0x1c')](_0x3f55f3);}};}function respondWithFilteredResult(_0xd426cf,_0x44894a){return function(_0x1cac30){if(_0x1cac30){var _0x3282b0=typeof _0x44894a['offset']===_0x0cf1('0x1d')&&typeof _0x44894a[_0x0cf1('0x1e')]===_0x0cf1('0x1d');var _0x6571e3=_0x1cac30[_0x0cf1('0x1f')];var _0x41c595=_0x3282b0?0x0:_0x44894a[_0x0cf1('0x20')];var _0x3d9dee=_0x3282b0?_0x1cac30[_0x0cf1('0x1f')]:_0x44894a['offset']+_0x44894a[_0x0cf1('0x1e')];var _0x2822c3;if(_0x3d9dee>=_0x6571e3){_0x3d9dee=_0x6571e3;_0x2822c3=0xc8;}else{_0x2822c3=0xce;}_0xd426cf[_0x0cf1('0x1a')](_0x2822c3);return _0xd426cf[_0x0cf1('0x21')](_0x0cf1('0x22'),_0x41c595+'-'+_0x3d9dee+'/'+_0x6571e3)['json'](_0x1cac30);}return null;};}function patchUpdates(_0x4cffc6){return function(_0x419690){try{jsonpatch[_0x0cf1('0x23')](_0x419690,_0x4cffc6,!![]);}catch(_0x98db32){return BPromise[_0x0cf1('0x24')](_0x98db32);}return _0x419690['save']();};}function saveUpdates(_0x349d1b,_0x3b420e){return function(_0x2c855c){if(_0x2c855c){return _0x2c855c['update'](_0x349d1b)[_0x0cf1('0x25')](function(_0x44523d){return _0x44523d;});}return null;};}function removeEntity(_0x1e5481,_0x171b45){return function(_0x9f4ad7){if(_0x9f4ad7){return _0x9f4ad7['destroy']()[_0x0cf1('0x25')](function(){_0x1e5481[_0x0cf1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f4ae4,_0x191849){return function(_0x890c15){if(!_0x890c15){_0x1f4ae4[_0x0cf1('0x19')](0x194);}return _0x890c15;};}function handleError(_0x50e7a7,_0x1ce204){_0x1ce204=_0x1ce204||0x1f4;return function(_0x5a4187){logger[_0x0cf1('0x26')](_0x5a4187[_0x0cf1('0x27')]);if(_0x5a4187[_0x0cf1('0x28')]){delete _0x5a4187[_0x0cf1('0x28')];}_0x50e7a7[_0x0cf1('0x1a')](_0x1ce204)[_0x0cf1('0x29')](_0x5a4187);};}exports[_0x0cf1('0x2a')]=function(_0xbb58fc,_0x1f137e){var _0x3ece12={},_0x7b78e4={},_0x4da793={'count':0x0,'rows':[]};var _0x48136e=_['map'](db[_0x0cf1('0x2b')][_0x0cf1('0x2c')],function(_0x571ae9){return{'name':_0x571ae9[_0x0cf1('0x2d')],'type':_0x571ae9[_0x0cf1('0x2e')][_0x0cf1('0x2f')]};});_0x7b78e4[_0x0cf1('0x30')]=_['map'](_0x48136e,_0x0cf1('0x28'));_0x7b78e4[_0x0cf1('0x31')]=_['keys'](_0xbb58fc[_0x0cf1('0x31')]);_0x7b78e4[_0x0cf1('0x32')]=_[_0x0cf1('0x33')](_0x7b78e4['model'],_0x7b78e4['query']);_0x3ece12[_0x0cf1('0x34')]=_[_0x0cf1('0x33')](_0x7b78e4[_0x0cf1('0x30')],qs[_0x0cf1('0x35')](_0xbb58fc[_0x0cf1('0x31')]['fields']));_0x3ece12[_0x0cf1('0x34')]=_0x3ece12[_0x0cf1('0x34')][_0x0cf1('0x36')]?_0x3ece12['attributes']:_0x7b78e4['model'];if(!_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x37')](_0x0cf1('0x38'))){_0x3ece12[_0x0cf1('0x1e')]=qs['limit'](_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x1e')]);_0x3ece12['offset']=qs['offset'](_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x20')]);}_0x3ece12['order']=qs['sort'](_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x39')]);_0x3ece12[_0x0cf1('0x3a')]=qs[_0x0cf1('0x32')](_[_0x0cf1('0x3b')](_0xbb58fc[_0x0cf1('0x31')],_0x7b78e4[_0x0cf1('0x32')]),_0x48136e);if(_0xbb58fc[_0x0cf1('0x31')]['filter']){_0x3ece12[_0x0cf1('0x3a')]=_['merge'](_0x3ece12['where'],{'$or':_[_0x0cf1('0x3c')](_0x48136e,function(_0x13e4ea){if(_0x13e4ea[_0x0cf1('0x2e')]!==_0x0cf1('0x3d')){var _0x4da89f={};_0x4da89f[_0x13e4ea[_0x0cf1('0x28')]]={'$like':'%'+_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x3e')]+'%'};return _0x4da89f;}})});}_0x3ece12=_['merge']({},_0x3ece12,_0xbb58fc['options']);var _0x5ecea4={'where':_0x3ece12[_0x0cf1('0x3a')]};return db[_0x0cf1('0x2b')][_0x0cf1('0x1f')](_0x5ecea4)[_0x0cf1('0x25')](function(_0x612a14){_0x4da793['count']=_0x612a14;if(_0xbb58fc[_0x0cf1('0x31')]['includeAll']){_0x3ece12[_0x0cf1('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x0cf1('0x40')](_0x3ece12);})['then'](function(_0x1f6129){_0x4da793[_0x0cf1('0x41')]=_0x1f6129;return _0x4da793;})['then'](respondWithFilteredResult(_0x1f137e,_0x3ece12))[_0x0cf1('0x42')](handleError(_0x1f137e,null));};exports[_0x0cf1('0x43')]=function(_0x1f47c5,_0x2114c9){var _0x377f6c={'raw':!![],'where':{'id':_0x1f47c5['params']['id']}},_0x936ba5={};_0x936ba5[_0x0cf1('0x30')]=_[_0x0cf1('0x44')](db[_0x0cf1('0x2b')]['rawAttributes']);_0x936ba5[_0x0cf1('0x31')]=_[_0x0cf1('0x44')](_0x1f47c5[_0x0cf1('0x31')]);_0x936ba5['filters']=_[_0x0cf1('0x33')](_0x936ba5[_0x0cf1('0x30')],_0x936ba5[_0x0cf1('0x31')]);_0x377f6c[_0x0cf1('0x34')]=_[_0x0cf1('0x33')](_0x936ba5[_0x0cf1('0x30')],qs[_0x0cf1('0x35')](_0x1f47c5[_0x0cf1('0x31')][_0x0cf1('0x35')]));_0x377f6c['attributes']=_0x377f6c[_0x0cf1('0x34')][_0x0cf1('0x36')]?_0x377f6c[_0x0cf1('0x34')]:_0x936ba5[_0x0cf1('0x30')];if(_0x1f47c5[_0x0cf1('0x31')]['includeAll']){_0x377f6c['include']=[{'all':!![]}];}_0x377f6c=_[_0x0cf1('0x45')]({},_0x377f6c,_0x1f47c5[_0x0cf1('0x46')]);return db['ChatTransferReport']['find'](_0x377f6c)[_0x0cf1('0x25')](handleEntityNotFound(_0x2114c9,null))[_0x0cf1('0x25')](respondWithResult(_0x2114c9,null))[_0x0cf1('0x42')](handleError(_0x2114c9,null));};exports[_0x0cf1('0x47')]=function(_0x50f6e8,_0x406713){return db[_0x0cf1('0x2b')][_0x0cf1('0x47')](_0x50f6e8[_0x0cf1('0x48')],{})[_0x0cf1('0x25')](respondWithResult(_0x406713,0xc9))[_0x0cf1('0x42')](handleError(_0x406713,null));};exports[_0x0cf1('0x49')]=function(_0x1c022b,_0x263976){if(_0x1c022b[_0x0cf1('0x48')]['id']){delete _0x1c022b[_0x0cf1('0x48')]['id'];}return db[_0x0cf1('0x2b')]['find']({'where':{'id':_0x1c022b[_0x0cf1('0x4a')]['id']}})[_0x0cf1('0x25')](handleEntityNotFound(_0x263976,null))[_0x0cf1('0x25')](saveUpdates(_0x1c022b[_0x0cf1('0x48')],null))[_0x0cf1('0x25')](respondWithResult(_0x263976,null))[_0x0cf1('0x42')](handleError(_0x263976,null));};exports[_0x0cf1('0x4b')]=function(_0x31e3b6,_0x58815e){return db['ChatTransferReport']['find']({'where':{'id':_0x31e3b6['params']['id']}})[_0x0cf1('0x25')](handleEntityNotFound(_0x58815e,null))[_0x0cf1('0x25')](removeEntity(_0x58815e,null))[_0x0cf1('0x42')](handleError(_0x58815e,null));};exports[_0x0cf1('0x4c')]=function(_0x12a526,_0x2df567){return db['ChatTransferReport'][_0x0cf1('0x4c')]()['then'](respondWithResult(_0x2df567,null))['catch'](handleError(_0x2df567,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 5e50f47..8dee480 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 _0xf2e6=['bluebird','request-promise','path','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0xb138d9,_0x11c0a3){var _0x578de3=function(_0x4a80d8){while(--_0x4a80d8){_0xb138d9['push'](_0xb138d9['shift']());}};_0x578de3(++_0x11c0a3);}(_0xf2e6,0x194));var _0x6f2e=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xf2e6[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x6f2e('0x0'));var util=require(_0x6f2e('0x1'));var logger=require(_0x6f2e('0x2'))(_0x6f2e('0x3'));var moment=require('moment');var BPromise=require(_0x6f2e('0x4'));var rp=require(_0x6f2e('0x5'));var fs=require('fs');var path=require(_0x6f2e('0x6'));var rimraf=require('rimraf');var config=require(_0x6f2e('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x6f2e('0x8')]=function(_0x1857df,_0x54475b){return _0x1857df['define'](_0x6f2e('0x9'),attributes,{'tableName':_0x6f2e('0xa'),'paranoid':![],'indexes':[{'name':_0x6f2e('0xb'),'fields':[_0x6f2e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x077e=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x184486,_0x2155b6){var _0x47ed62=function(_0x452d9e){while(--_0x452d9e){_0x184486['push'](_0x184486['shift']());}};_0x47ed62(++_0x2155b6);}(_0x077e,0x1a7));var _0xe077=function(_0x3e2687,_0x2ca49b){_0x3e2687=_0x3e2687-0x0;var _0x22d33d=_0x077e[_0x3e2687];return _0x22d33d;};'use strict';var _=require(_0xe077('0x0'));var util=require(_0xe077('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe077('0x2'));var BPromise=require(_0xe077('0x3'));var rp=require(_0xe077('0x4'));var fs=require('fs');var path=require(_0xe077('0x5'));var rimraf=require(_0xe077('0x6'));var config=require(_0xe077('0x7'));var attributes=require(_0xe077('0x8'));module[_0xe077('0x9')]=function(_0x4ab513,_0x5cd39f){return _0x4ab513['define'](_0xe077('0xa'),attributes,{'tableName':_0xe077('0xb'),'paranoid':![],'indexes':[{'name':_0xe077('0xc'),'fields':[_0xe077('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 4e1ee18..5c3d86a 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 _0x18e7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','moment','randomstring'];(function(_0x37a5f7,_0x2d4830){var _0x44efda=function(_0x57613a){while(--_0x57613a){_0x37a5f7['push'](_0x37a5f7['shift']());}};_0x44efda(++_0x2d4830);}(_0x18e7,0x140));var _0x718e=function(_0x1b936e,_0x5e6437){_0x1b936e=_0x1b936e-0x0;var _0x5d4fc7=_0x18e7[_0x1b936e];return _0x5d4fc7;};'use strict';var _=require('lodash');var util=require(_0x718e('0x0'));var moment=require(_0x718e('0x1'));var BPromise=require('bluebird');var rs=require(_0x718e('0x2'));var fs=require('fs');var Redis=require(_0x718e('0x3'));var db=require(_0x718e('0x4'))['db'];var utils=require(_0x718e('0x5'));var logger=require(_0x718e('0x6'))(_0x718e('0x7'));var config=require(_0x718e('0x8'));var jayson=require(_0x718e('0x9'));var client=jayson[_0x718e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb656c3,_0x19bdaf,_0x545cc0){return new BPromise(function(_0x523511,_0x14c1a1){return client['request'](_0xb656c3,_0x545cc0)['then'](function(_0x3f1b18){logger[_0x718e('0xb')](_0x718e('0xc'),_0x19bdaf,'request\x20sent');logger[_0x718e('0xd')](_0x718e('0xe'),_0x19bdaf,_0x718e('0xf'),JSON['stringify'](_0x3f1b18));if(_0x3f1b18[_0x718e('0x10')]){if(_0x3f1b18[_0x718e('0x10')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x19bdaf,_0x3f1b18[_0x718e('0x10')][_0x718e('0x11')]);return _0x14c1a1(_0x3f1b18[_0x718e('0x10')]['message']);}logger[_0x718e('0x10')](_0x718e('0xc'),_0x19bdaf,_0x3f1b18[_0x718e('0x10')][_0x718e('0x11')]);return _0x523511(_0x3f1b18[_0x718e('0x10')]['message']);}else{logger[_0x718e('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x19bdaf,_0x718e('0xf'));_0x523511(_0x3f1b18['result']['message']);}})[_0x718e('0x12')](function(_0x2833b2){logger[_0x718e('0x10')](_0x718e('0xc'),_0x19bdaf,_0x2833b2);_0x14c1a1(_0x2833b2);});});} \ No newline at end of file +var _0x16ca=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x25f341,_0x4dcc49){var _0x749c7b=function(_0x45433f){while(--_0x45433f){_0x25f341['push'](_0x25f341['shift']());}};_0x749c7b(++_0x4dcc49);}(_0x16ca,0xe5));var _0xa16c=function(_0xff765f,_0xdc88a9){_0xff765f=_0xff765f-0x0;var _0x36ceea=_0x16ca[_0xff765f];return _0x36ceea;};'use strict';var _=require('lodash');var util=require(_0xa16c('0x0'));var moment=require(_0xa16c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa16c('0x2'));var db=require(_0xa16c('0x3'))['db'];var utils=require(_0xa16c('0x4'));var logger=require(_0xa16c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa16c('0x6'));var client=jayson[_0xa16c('0x7')][_0xa16c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ef611,_0x18e066,_0x352b9c){return new BPromise(function(_0x40d979,_0x38ae00){return client[_0xa16c('0x9')](_0x2ef611,_0x352b9c)[_0xa16c('0xa')](function(_0x5e1bc8){logger[_0xa16c('0xb')](_0xa16c('0xc'),_0x18e066,_0xa16c('0xd'));logger[_0xa16c('0xe')](_0xa16c('0xf'),_0x18e066,_0xa16c('0xd'),JSON[_0xa16c('0x10')](_0x5e1bc8));if(_0x5e1bc8[_0xa16c('0x11')]){if(_0x5e1bc8[_0xa16c('0x11')][_0xa16c('0x12')]===0x1f4){logger['error'](_0xa16c('0xc'),_0x18e066,_0x5e1bc8[_0xa16c('0x11')][_0xa16c('0x13')]);return _0x38ae00(_0x5e1bc8[_0xa16c('0x11')][_0xa16c('0x13')]);}logger[_0xa16c('0x11')](_0xa16c('0xc'),_0x18e066,_0x5e1bc8['error'][_0xa16c('0x13')]);return _0x40d979(_0x5e1bc8[_0xa16c('0x11')]['message']);}else{logger[_0xa16c('0xb')](_0xa16c('0xc'),_0x18e066,_0xa16c('0xd'));_0x40d979(_0x5e1bc8[_0xa16c('0x14')][_0xa16c('0x13')]);}})[_0xa16c('0x15')](function(_0x381995){logger[_0xa16c('0x11')](_0xa16c('0xc'),_0x18e066,_0x381995);_0x38ae00(_0x381995);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 38365f1..e376b90 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 _0x3812=['/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x535b58,_0x48d56b){var _0x4cf320=function(_0xe47069){while(--_0xe47069){_0x535b58['push'](_0x535b58['shift']());}};_0x4cf320(++_0x48d56b);}(_0x3812,0x15f));var _0x2381=function(_0x5088ab,_0x38e7a8){_0x5088ab=_0x5088ab-0x0;var _0x1f9f55=_0x3812[_0x5088ab];return _0x1f9f55;};'use strict';var multer=require(_0x2381('0x0'));var util=require(_0x2381('0x1'));var path=require(_0x2381('0x2'));var timeout=require('connect-timeout');var express=require(_0x2381('0x3'));var router=express['Router']();var fs_extra=require(_0x2381('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2381('0x5'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x2381('0x6')]('/',auth[_0x2381('0x7')](),controller[_0x2381('0x8')]);router[_0x2381('0x6')](_0x2381('0x9'),auth[_0x2381('0x7')](),controller[_0x2381('0xa')]);router[_0x2381('0x6')](_0x2381('0xb'),auth[_0x2381('0x7')](),controller[_0x2381('0xc')]);router[_0x2381('0xd')]('/',auth['isAuthenticated'](),controller[_0x2381('0xe')]);router['put'](_0x2381('0xb'),auth['isAuthenticated'](),controller[_0x2381('0xf')]);router[_0x2381('0x10')]('/:id',auth[_0x2381('0x7')](),controller['destroy']);module[_0x2381('0x11')]=router; \ No newline at end of file +var _0x8284=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated','describe','get','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x493bc9,_0x5e1501){var _0x552b55=function(_0x2a63eb){while(--_0x2a63eb){_0x493bc9['push'](_0x493bc9['shift']());}};_0x552b55(++_0x5e1501);}(_0x8284,0xb6));var _0x4828=function(_0x103e40,_0x33fba3){_0x103e40=_0x103e40-0x0;var _0x4b186d=_0x8284[_0x103e40];return _0x4b186d;};'use strict';var multer=require(_0x4828('0x0'));var util=require(_0x4828('0x1'));var path=require(_0x4828('0x2'));var timeout=require(_0x4828('0x3'));var express=require(_0x4828('0x4'));var router=express[_0x4828('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4828('0x6'));var interaction=require(_0x4828('0x7'));var config=require(_0x4828('0x8'));var controller=require(_0x4828('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4828('0xa')]);router['get'](_0x4828('0xb'),auth[_0x4828('0xc')](),controller[_0x4828('0xd')]);router[_0x4828('0xe')](_0x4828('0xf'),auth[_0x4828('0xc')](),controller['show']);router[_0x4828('0x10')]('/',auth[_0x4828('0xc')](),controller['create']);router[_0x4828('0x11')](_0x4828('0xf'),auth[_0x4828('0xc')](),controller[_0x4828('0x12')]);router[_0x4828('0x13')](_0x4828('0xf'),auth[_0x4828('0xc')](),controller['destroy']);module[_0x4828('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 09c76dc..2d024a6 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 _0xc3c2=['Agent','#ffffff','INTEGER','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','onlineForm','parse','getDataValue','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email'];(function(_0x35d268,_0x3c22de){var _0x481a37=function(_0x1ba721){while(--_0x1ba721){_0x35d268['push'](_0x35d268['shift']());}};_0x481a37(++_0x3c22de);}(_0xc3c2,0x1aa));var _0x2c3c=function(_0x116816,_0xa8b0a3){_0x116816=_0x116816-0x0;var _0x5e1f45=_0xc3c2[_0x116816];return _0x5e1f45;};'use strict';var Sequelize=require(_0x2c3c('0x0'));var rs=require(_0x2c3c('0x1'));module[_0x2c3c('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'unique':_0x2c3c('0x4')},'description':{'type':Sequelize[_0x2c3c('0x3')]},'mapKey':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x5')},'key':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x6')},'customerAlias':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':_0x2c3c('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2c3c('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2c3c('0x9')](_0x2c3c('0xa'),'squared'),'defaultValue':_0x2c3c('0xa')},'header_online':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0xc')},'header_offline':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xd')},'download_transcript':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2c3c('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2c3c('0x10')]},'closingQuestion':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x14')},'closingMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x15')},'closingMessageButton':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xc')},'skipMessageButton':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x16')},'conditionAgreement':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x17')},'ratingType':{'type':Sequelize[_0x2c3c('0x9')](_0x2c3c('0x18'),_0x2c3c('0x19')),'defaultValue':_0x2c3c('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2c3c('0x1a')]({'items':[{'type':_0x2c3c('0x1b'),'variable':null,'config':{'placeholder':_0x2c3c('0x1c'),'type':_0x2c3c('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x2c3c('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2c3c('0x5'),'type':_0x2c3c('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x2c3c('0x1e'))?JSON[_0x2c3c('0x1f')](this[_0x2c3c('0x20')](_0x2c3c('0x1e'))):{};},'set':function(_0x43c69a){return this['setDataValue'](_0x2c3c('0x1e'),JSON[_0x2c3c('0x1a')](_0x43c69a));}},'offlineForm':{'type':Sequelize[_0x2c3c('0x10')],'defaultValue':function(){return JSON[_0x2c3c('0x1a')]({'items':[{'type':_0x2c3c('0x1b'),'props':{'title':_0x2c3c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x2c3c('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x2c3c('0x20')]('offlineForm')?JSON[_0x2c3c('0x1f')](this[_0x2c3c('0x20')]('offlineForm')):{};},'set':function(_0x48f83d){return this['setDataValue'](_0x2c3c('0x22'),JSON[_0x2c3c('0x1a')](_0x48f83d));}},'token':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2c3c('0x3')]},'forwardOffline':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2c3c('0x3')]},'waitingTitle':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x23')},'waitingMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x24')},'offlineMessageBody':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x16')},'sendUnmanaged':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2c3c('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2c3c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2c3c('0x10')],'defaultValue':function(){return _0x2c3c('0x25');}},'notificationSound':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x2c3c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x27')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x28')},'defaultTitle':{'type':Sequelize[_0x2c3c('0x3')]},'customerAvatar':{'type':Sequelize[_0x2c3c('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2c3c('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':_0x2c3c('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2c3c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2c3c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x2a')},'systemAvatar':{'type':Sequelize[_0x2c3c('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2c3c('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![],'comment':_0x2c3c('0x2c'),'set':function(_0x332b77){if(!_0x332b77)this[_0x2c3c('0x2d')](_0x2c3c('0x2e'),null);this[_0x2c3c('0x2d')]('mandatoryDisposition',_0x332b77);}},'vidaooEscalation':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2c3c('0x3')]},'vidaooTopic':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':function(){return _0x2c3c('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x2c3c('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9041=['Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','alternate','#fafafa','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','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea'];(function(_0x30f270,_0x29deee){var _0x5a7fd1=function(_0x1755bb){while(--_0x1755bb){_0x30f270['push'](_0x30f270['shift']());}};_0x5a7fd1(++_0x29deee);}(_0x9041,0x1a0));var _0x1904=function(_0xff71f2,_0x3abf3e){_0xff71f2=_0xff71f2-0x0;var _0x145310=_0x9041[_0xff71f2];return _0x145310;};'use strict';var Sequelize=require(_0x1904('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x1904('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x1904('0x1')],'allowNull':![],'unique':_0x1904('0x2')},'description':{'type':Sequelize[_0x1904('0x1')]},'mapKey':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1904('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1904('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1904('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1904('0x8')](_0x1904('0x9'),_0x1904('0xa')),'defaultValue':_0x1904('0x9')},'header_online':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0xc')},'offline_chat_button':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0xd')},'download_transcript':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x12')},'placeholderMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x13')},'closingMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x15')},'skipMessageButton':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x1904('0x8')](_0x1904('0x17'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1904('0x18')],'defaultValue':function(){return JSON[_0x1904('0x19')]({'items':[{'type':_0x1904('0x1a'),'variable':null,'config':{'placeholder':_0x1904('0x1b'),'type':_0x1904('0x1c'),'required':!![]},'props':{'title':_0x1904('0x1b'),'helpText':''}},{'type':_0x1904('0x1a'),'props':{'title':_0x1904('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1904('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1904('0x1d'))?JSON[_0x1904('0x1e')](this[_0x1904('0x1f')](_0x1904('0x1d'))):{};},'set':function(_0x5e44c0){return this[_0x1904('0x20')](_0x1904('0x1d'),JSON[_0x1904('0x19')](_0x5e44c0));}},'offlineForm':{'type':Sequelize[_0x1904('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1904('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1904('0x3'),'type':_0x1904('0x3')},'variable':null},{'type':_0x1904('0x21'),'config':{'placeholder':_0x1904('0x22')},'props':{'title':_0x1904('0x22'),'helpText':_0x1904('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x1904('0x1f')](_0x1904('0x24'))?JSON[_0x1904('0x1e')](this[_0x1904('0x1f')]('offlineForm')):{};},'set':function(_0x194b43){return this['setDataValue']('offlineForm',JSON['stringify'](_0x194b43));}},'token':{'type':Sequelize[_0x1904('0x1')],'defaultValue':function(){return rs[_0x1904('0x25')]();}},'autoclose':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1904('0x1')]},'forwardOffline':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1904('0x1')]},'waitingTitle':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x26')},'waitingMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x29')},'skipUnmanaged':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x15')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1904('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1904('0x1')]},'notificationTemplate':{'type':Sequelize[_0x1904('0x18')],'defaultValue':function(){return _0x1904('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x1904('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x2b')},'defaultTitle':{'type':Sequelize[_0x1904('0x1')]},'customerAvatar':{'type':Sequelize[_0x1904('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1904('0x1')],'allowNull':![],'defaultValue':_0x1904('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1904('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1904('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x1904('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1904('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![],'comment':_0x1904('0x2d'),'set':function(_0x1d9423){if(!_0x1d9423)this['setDataValue'](_0x1904('0x2e'),null);this[_0x1904('0x20')](_0x1904('0x2f'),_0x1d9423);}},'vidaooEscalation':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1904('0x1')]},'vidaooTopic':{'type':Sequelize[_0x1904('0x1')],'allowNull':![],'defaultValue':_0x1904('0x30')},'vidaooNote':{'type':Sequelize[_0x1904('0x1')],'defaultValue':function(){return _0x1904('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x1904('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 3f3f7ba..116440a 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 _0xd2fe=['includeAll','show','params','rawAttributes','include','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','find','ChatWebsiteId','Disposition','getDispositions','nolimit','map','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','../../config/license/util','isNil','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','createdAt','updatedAt','difference','CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','applications','list','asc','account','Applications','contact','customerIp','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','all','some','utf8','remote','x-real-ip','connection','remoteAddress','replace','render','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','fromKey','getOfflineMessages','Attachments','rows','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','update','destroy','get','ChatWebsites','name','index','Pause','mandatoryDispositionPause','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','ChatWebsite'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0xd2fe,0xea));var _0xed2f=function(_0x2513ce,_0xf33af6){_0x2513ce=_0x2513ce-0x0;var _0x19e1e7=_0xd2fe[_0x2513ce];return _0x19e1e7;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xed2f('0x0'));var util=require('util');var path=require(_0xed2f('0x1'));var ejs=require(_0xed2f('0x2'));var fs=require('fs');var fs_extra=require(_0xed2f('0x3'));var _=require(_0xed2f('0x4'));var querystring=require(_0xed2f('0x5'));var Redis=require(_0xed2f('0x6'));var qs=require(_0xed2f('0x7'));var logger=require(_0xed2f('0x8'))('api');var config=require(_0xed2f('0x9'));var db=require(_0xed2f('0xa'))['db'];config['redis']=_[_0xed2f('0xb')](config['redis'],{'host':_0xed2f('0xc'),'port':0x18eb});var socket=require(_0xed2f('0xd'))(new Redis(config[_0xed2f('0xe')]));require(_0xed2f('0xf'))[_0xed2f('0x10')](socket);var jayson=require(_0xed2f('0x11'));var client=jayson[_0xed2f('0x12')][_0xed2f('0x13')]({'port':0x232c});var client9002=jayson[_0xed2f('0x12')][_0xed2f('0x13')]({'port':0x232a});var client9003=jayson[_0xed2f('0x12')][_0xed2f('0x13')]({'port':0x232b});var client9001=jayson[_0xed2f('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3d5482,_0x577d76,_0x1fb51d,_0x16b8ae){return new BPromise(function(_0x55bd1f,_0x447eba){var _0x5ebd19=_0x16b8ae||client;return _0x5ebd19[_0xed2f('0x14')](_0x3d5482,_0x1fb51d)[_0xed2f('0x15')](function(_0x3d7c3c){logger[_0xed2f('0x16')](_0xed2f('0x17'),_0x577d76,_0xed2f('0x18'));logger['debug'](_0xed2f('0x19'),_0x577d76,_0xed2f('0x18'),JSON[_0xed2f('0x1a')](_0x3d7c3c));if(_0x3d7c3c[_0xed2f('0x1b')]){if(_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1c')]===0x1f4){logger['error'](_0xed2f('0x17'),_0x577d76,_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1d')]);return _0x447eba(_0x3d7c3c['error'][_0xed2f('0x1d')]);}logger['error'](_0xed2f('0x17'),_0x577d76,_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1d')]);return _0x55bd1f(_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1d')]);}else{logger[_0xed2f('0x16')](_0xed2f('0x17'),_0x577d76,_0xed2f('0x18'));_0x55bd1f(_0x3d7c3c[_0xed2f('0x1e')][_0xed2f('0x1d')]);}})[_0xed2f('0x1f')](function(_0x3dfa11){logger[_0xed2f('0x1b')](_0xed2f('0x17'),_0x577d76,_0x3dfa11);_0x447eba(_0x3dfa11);});});}function respondWithStatusCode(_0x71a6ac,_0x511eb8){_0x511eb8=_0x511eb8||0xcc;return function(_0x1d15d9){if(_0x1d15d9){return _0x71a6ac[_0xed2f('0x20')](_0x511eb8);}return _0x71a6ac['status'](_0x511eb8)[_0xed2f('0x21')]();};}function respondWithResult(_0x37e512,_0x3e4e64){_0x3e4e64=_0x3e4e64||0xc8;return function(_0x50b63c){if(_0x50b63c){return _0x37e512['status'](_0x3e4e64)[_0xed2f('0x22')](_0x50b63c);}};}function respondWithFilteredResult(_0x30e49d,_0x55b2e3){return function(_0x457319){if(_0x457319){var _0x2d226c=typeof _0x55b2e3[_0xed2f('0x23')]===_0xed2f('0x24')&&typeof _0x55b2e3[_0xed2f('0x25')]===_0xed2f('0x24');var _0x271695=_0x457319[_0xed2f('0x26')];var _0x5b506d=_0x2d226c?0x0:_0x55b2e3['offset'];var _0x55ba58=_0x2d226c?_0x457319[_0xed2f('0x26')]:_0x55b2e3['offset']+_0x55b2e3['limit'];var _0x46ef43;if(_0x55ba58>=_0x271695){_0x55ba58=_0x271695;_0x46ef43=0xc8;}else{_0x46ef43=0xce;}_0x30e49d[_0xed2f('0x27')](_0x46ef43);return _0x30e49d['set'](_0xed2f('0x28'),_0x5b506d+'-'+_0x55ba58+'/'+_0x271695)['json'](_0x457319);}return null;};}function saveUpdates(_0x519131){return function(_0x49d019){if(_0x49d019){return _0x49d019[_0xed2f('0x29')](_0x519131)[_0xed2f('0x15')](function(_0x1e5637){return _0x1e5637;});}return null;};}function removeEntity(_0x3bb0af){return function(_0x27814a){if(_0x27814a){return _0x27814a[_0xed2f('0x2a')]()[_0xed2f('0x15')](function(){var _0x28f425=_0x27814a[_0xed2f('0x2b')]({'plain':!![]});var _0x2457ec=_0xed2f('0x2c');return db['UserProfileResource'][_0xed2f('0x2a')]({'where':{'type':_0x2457ec,'resourceId':_0x28f425['id']}})[_0xed2f('0x15')](function(){return _0x27814a;});})[_0xed2f('0x15')](function(){_0x3bb0af[_0xed2f('0x27')](0xcc)[_0xed2f('0x21')]();});}};}function handleEntityNotFound(_0x3de9e2){return function(_0x4ee256){if(!_0x4ee256){_0x3de9e2[_0xed2f('0x20')](0x194);}return _0x4ee256;};}function handleError(_0x413832,_0x3b40dc){_0x3b40dc=_0x3b40dc||0x1f4;return function(_0x52485c){logger[_0xed2f('0x1b')](_0x52485c['stack']);if(_0x52485c['name']){delete _0x52485c[_0xed2f('0x2d')];}_0x413832[_0xed2f('0x27')](_0x3b40dc)['send'](_0x52485c);};}exports[_0xed2f('0x2e')]=function(_0x580857,_0x390e7e){var _0x12d5d4={'include':[{'model':db[_0xed2f('0x2f')],'as':_0xed2f('0x30')}]},_0xc5ed0e={},_0x1c7698={'count':0x0,'rows':[]};var _0x1ecaca=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x29a68e){return{'name':_0x29a68e['fieldName'],'type':_0x29a68e[_0xed2f('0x31')][_0xed2f('0x32')]};});_0xc5ed0e['model']=_['map'](_0x1ecaca,_0xed2f('0x2d'));_0xc5ed0e[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x580857[_0xed2f('0x33')]);_0xc5ed0e['filters']=_[_0xed2f('0x35')](_0xc5ed0e[_0xed2f('0x36')],_0xc5ed0e['query']);_0x12d5d4[_0xed2f('0x37')]=_[_0xed2f('0x35')](_0xc5ed0e[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x580857[_0xed2f('0x33')]['fields']));_0x12d5d4[_0xed2f('0x37')]=_0x12d5d4[_0xed2f('0x37')][_0xed2f('0x39')]?_0x12d5d4['attributes']:_0xc5ed0e[_0xed2f('0x36')];if(!_0x580857['query'][_0xed2f('0x3a')]('nolimit')){_0x12d5d4['limit']=qs['limit'](_0x580857[_0xed2f('0x33')]['limit']);_0x12d5d4[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x580857[_0xed2f('0x33')]['offset']);}_0x12d5d4[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x580857[_0xed2f('0x33')][_0xed2f('0x3c')]);_0x12d5d4[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x580857['query'],_0xc5ed0e[_0xed2f('0x3e')]),_0x1ecaca);if(_0x580857[_0xed2f('0x33')]['filter']){_0x12d5d4[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x12d5d4[_0xed2f('0x3d')],{'$or':_['map'](_0x1ecaca,function(_0x3bfc32){if(_0x3bfc32['type']!==_0xed2f('0x41')){var _0x1a576a={};_0x1a576a[_0x3bfc32[_0xed2f('0x2d')]]={'$like':'%'+_0x580857[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x1a576a;}})});}_0x12d5d4=_[_0xed2f('0x40')]({},_0x12d5d4,_0x580857[_0xed2f('0x43')]);var _0x2105a9={'where':_0x12d5d4[_0xed2f('0x3d')]};return db[_0xed2f('0x44')][_0xed2f('0x26')](_0x2105a9)[_0xed2f('0x15')](function(_0x535bf3){_0x1c7698['count']=_0x535bf3;if(_0x580857['query'][_0xed2f('0x45')]){_0x12d5d4['include']=[{'all':!![]}];}return db[_0xed2f('0x44')]['findAll'](_0x12d5d4);})[_0xed2f('0x15')](function(_0x468c9a){_0x1c7698['rows']=_0x468c9a;return _0x1c7698;})[_0xed2f('0x15')](respondWithFilteredResult(_0x390e7e,_0x12d5d4))[_0xed2f('0x1f')](handleError(_0x390e7e,null));};exports[_0xed2f('0x46')]=function(_0x16e7f3,_0x10e6f6){var _0x581251={'raw':![],'where':{'id':_0x16e7f3[_0xed2f('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xed2f('0x30')}]},_0x5f4f09={};_0x5f4f09[_0xed2f('0x36')]=_[_0xed2f('0x34')](db[_0xed2f('0x44')][_0xed2f('0x48')]);_0x5f4f09[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x16e7f3[_0xed2f('0x33')]);_0x5f4f09[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x5f4f09[_0xed2f('0x36')],_0x5f4f09[_0xed2f('0x33')]);_0x581251[_0xed2f('0x37')]=_['intersection'](_0x5f4f09[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x16e7f3[_0xed2f('0x33')][_0xed2f('0x38')]));_0x581251[_0xed2f('0x37')]=_0x581251['attributes'][_0xed2f('0x39')]?_0x581251['attributes']:_0x5f4f09[_0xed2f('0x36')];if(_0x16e7f3[_0xed2f('0x33')][_0xed2f('0x45')]){_0x581251[_0xed2f('0x49')]=[{'all':!![]}];}_0x581251=_['merge']({},_0x581251,_0x16e7f3[_0xed2f('0x43')]);return db[_0xed2f('0x44')]['find'](_0x581251)[_0xed2f('0x15')](handleEntityNotFound(_0x10e6f6,null))[_0xed2f('0x15')](respondWithResult(_0x10e6f6,null))[_0xed2f('0x1f')](handleError(_0x10e6f6,null));};exports[_0xed2f('0x4a')]=function(_0xb39c8b,_0x190e9c){return db[_0xed2f('0x44')][_0xed2f('0x4a')](_0xb39c8b[_0xed2f('0x4b')],{})[_0xed2f('0x15')](function(_0x4d5eac){var _0x3bd9fb=_0xb39c8b['user'][_0xed2f('0x2b')]({'plain':!![]});if(!_0x3bd9fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bd9fb[_0xed2f('0x4c')]===_0xed2f('0x4d')){var _0x1b16f1=_0x4d5eac['get']({'plain':!![]});var _0x403531=_0xed2f('0x2c');return db[_0xed2f('0x4e')]['find']({'where':{'name':_0x403531,'userProfileId':_0x3bd9fb[_0xed2f('0x4f')]},'raw':!![]})[_0xed2f('0x15')](function(_0x53fdfe){if(_0x53fdfe&&_0x53fdfe[_0xed2f('0x50')]===0x0){return db[_0xed2f('0x51')]['create']({'name':_0x1b16f1[_0xed2f('0x2d')],'resourceId':_0x1b16f1['id'],'type':_0x53fdfe[_0xed2f('0x2d')],'sectionId':_0x53fdfe['id']},{})[_0xed2f('0x15')](function(){return _0x4d5eac;});}else{return _0x4d5eac;}})[_0xed2f('0x1f')](function(_0x33315f){logger[_0xed2f('0x1b')](_0xed2f('0x52'),_0x33315f);throw _0x33315f;});}return _0x4d5eac;})['then'](respondWithResult(_0x190e9c,0xc9))[_0xed2f('0x1f')](handleError(_0x190e9c,null));};exports['update']=function(_0x4790b9,_0x2eacc6){if(_0x4790b9[_0xed2f('0x4b')]['id']){delete _0x4790b9[_0xed2f('0x4b')]['id'];}return db[_0xed2f('0x44')]['find']({'where':{'id':_0x4790b9['params']['id']},'include':[{'model':db[_0xed2f('0x2f')],'as':_0xed2f('0x30')}]})[_0xed2f('0x15')](handleEntityNotFound(_0x2eacc6,null))[_0xed2f('0x15')](saveUpdates(_0x4790b9[_0xed2f('0x4b')],null))[_0xed2f('0x15')](respondWithResult(_0x2eacc6,null))[_0xed2f('0x1f')](handleError(_0x2eacc6,null));};exports[_0xed2f('0x2a')]=function(_0x44b95c,_0x2f40af){return db[_0xed2f('0x44')]['find']({'where':{'id':_0x44b95c['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x2f40af,null))[_0xed2f('0x15')](removeEntity(_0x2f40af,null))['catch'](handleError(_0x2f40af,null));};exports['describe']=function(_0x16cff7,_0xa75c7d){return db[_0xed2f('0x44')][_0xed2f('0x53')]()['then'](respondWithResult(_0xa75c7d,null))[_0xed2f('0x1f')](handleError(_0xa75c7d,null));};exports[_0xed2f('0x54')]=function(_0x3ec741,_0x14649d){if(_0x3ec741[_0xed2f('0x4b')]['id']){delete _0x3ec741[_0xed2f('0x4b')]['id'];}return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x3ec741[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x14649d,null))[_0xed2f('0x15')](function(_0x316c93){if(_0x316c93){_0x3ec741[_0xed2f('0x4b')][_0xed2f('0x56')]=_0x316c93['id'];return db[_0xed2f('0x57')][_0xed2f('0x4a')](_0x3ec741['body']);}})['then'](respondWithResult(_0x14649d,null))[_0xed2f('0x1f')](handleError(_0x14649d,null));};exports[_0xed2f('0x58')]=function(_0xcb991c,_0x25810f){var _0x44659d={'raw':![],'where':{}};var _0x241c4f={};var _0x1f67f8={'count':0x0,'rows':[]};return db[_0xed2f('0x44')]['findOne']({'where':{'id':_0xcb991c[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x25810f,null))[_0xed2f('0x15')](function(_0x22ff2b){if(_0x22ff2b){_0x241c4f[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['Disposition']['rawAttributes']);_0x241c4f['query']=_['keys'](_0xcb991c[_0xed2f('0x33')]);_0x241c4f[_0xed2f('0x3e')]=_['intersection'](_0x241c4f[_0xed2f('0x36')],_0x241c4f[_0xed2f('0x33')]);_0x44659d['attributes']=_[_0xed2f('0x35')](_0x241c4f[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0xcb991c[_0xed2f('0x33')]['fields']));_0x44659d[_0xed2f('0x37')]=_0x44659d[_0xed2f('0x37')][_0xed2f('0x39')]?_0x44659d['attributes']:_0x241c4f[_0xed2f('0x36')];if(!_0xcb991c[_0xed2f('0x33')]['hasOwnProperty'](_0xed2f('0x59'))){_0x44659d[_0xed2f('0x25')]=qs['limit'](_0xcb991c[_0xed2f('0x33')]['limit']);_0x44659d[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0xcb991c[_0xed2f('0x33')][_0xed2f('0x23')]);}_0x44659d[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0xcb991c[_0xed2f('0x33')]['sort']);_0x44659d[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0xcb991c[_0xed2f('0x33')],_0x241c4f[_0xed2f('0x3e')]));_0x44659d[_0xed2f('0x3d')][_0xed2f('0x56')]=_0x22ff2b['id'];if(_0xcb991c[_0xed2f('0x33')][_0xed2f('0x42')]){_0x44659d[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x44659d['where'],{'$or':_[_0xed2f('0x5a')](_0x44659d[_0xed2f('0x37')],function(_0x473b02){var _0x58bdc2={};_0x58bdc2[_0x473b02]={'$like':'%'+_0xcb991c[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x58bdc2;})});}_0x44659d=_['merge']({},_0x44659d,_0xcb991c['options']);return db[_0xed2f('0x57')]['count']({'where':_0x44659d['where']})[_0xed2f('0x15')](function(_0x522ff3){_0x1f67f8['count']=_0x522ff3;if(_0xcb991c[_0xed2f('0x33')][_0xed2f('0x45')]){_0x44659d['include']=[{'all':!![]}];}return db[_0xed2f('0x57')][_0xed2f('0x5b')](_0x44659d);})[_0xed2f('0x15')](function(_0x7a1da7){_0x1f67f8['rows']=_0x7a1da7;return _0x1f67f8;});}})[_0xed2f('0x15')](respondWithFilteredResult(_0x25810f,_0x44659d))[_0xed2f('0x1f')](handleError(_0x25810f,null));};exports[_0xed2f('0x5c')]=function(_0x476b87,_0x5b1b8b){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x476b87['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5b1b8b,null))['then'](function(_0x48db78){if(_0x48db78){return _0x48db78['removeDispositions'](_0x476b87[_0xed2f('0x33')]['ids']);}})[_0xed2f('0x15')](respondWithStatusCode(_0x5b1b8b,null))['catch'](handleError(_0x5b1b8b,null));};exports[_0xed2f('0x5d')]=function(_0x18ed97,_0x5adae1){if(_0x18ed97[_0xed2f('0x4b')]['id']){delete _0x18ed97['body']['id'];}return db[_0xed2f('0x44')]['find']({'where':{'id':_0x18ed97[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5adae1,null))[_0xed2f('0x15')](function(_0x209c24){if(_0x209c24){_0x18ed97[_0xed2f('0x4b')][_0xed2f('0x56')]=_0x209c24['id'];return db[_0xed2f('0x5e')][_0xed2f('0x4a')](_0x18ed97[_0xed2f('0x4b')]);}})[_0xed2f('0x15')](respondWithResult(_0x5adae1,null))['catch'](handleError(_0x5adae1,null));};exports[_0xed2f('0x5f')]=function(_0x5ed2b5,_0x47ee4a){var _0xefa13b={'raw':![],'where':{}};var _0x4164d6={};var _0x3d15bc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xed2f('0x60')]({'where':{'id':_0x5ed2b5[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x47ee4a,null))[_0xed2f('0x15')](function(_0xc34b74){if(_0xc34b74){_0x4164d6[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['CannedAnswer']['rawAttributes']);_0x4164d6[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x5ed2b5[_0xed2f('0x33')]);_0x4164d6[_0xed2f('0x3e')]=_['intersection'](_0x4164d6[_0xed2f('0x36')],_0x4164d6[_0xed2f('0x33')]);_0xefa13b[_0xed2f('0x37')]=_['intersection'](_0x4164d6[_0xed2f('0x36')],qs['fields'](_0x5ed2b5[_0xed2f('0x33')][_0xed2f('0x38')]));_0xefa13b[_0xed2f('0x37')]=_0xefa13b[_0xed2f('0x37')][_0xed2f('0x39')]?_0xefa13b[_0xed2f('0x37')]:_0x4164d6['model'];if(!_0x5ed2b5['query'][_0xed2f('0x3a')](_0xed2f('0x59'))){_0xefa13b[_0xed2f('0x25')]=qs[_0xed2f('0x25')](_0x5ed2b5['query'][_0xed2f('0x25')]);_0xefa13b['offset']=qs[_0xed2f('0x23')](_0x5ed2b5['query']['offset']);}_0xefa13b[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x5ed2b5['query'][_0xed2f('0x3c')]);_0xefa13b[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x5ed2b5[_0xed2f('0x33')],_0x4164d6[_0xed2f('0x3e')]));_0xefa13b['where'][_0xed2f('0x56')]=_0xc34b74['id'];if(_0x5ed2b5[_0xed2f('0x33')][_0xed2f('0x42')]){_0xefa13b['where']=_[_0xed2f('0x40')](_0xefa13b[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0xefa13b[_0xed2f('0x37')],function(_0x4c575a){var _0x465ef8={};_0x465ef8[_0x4c575a]={'$like':'%'+_0x5ed2b5[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x465ef8;})});}_0xefa13b=_[_0xed2f('0x40')]({},_0xefa13b,_0x5ed2b5[_0xed2f('0x43')]);return db[_0xed2f('0x5e')][_0xed2f('0x26')]({'where':_0xefa13b[_0xed2f('0x3d')]})[_0xed2f('0x15')](function(_0x419f98){_0x3d15bc[_0xed2f('0x26')]=_0x419f98;if(_0x5ed2b5[_0xed2f('0x33')]['includeAll']){_0xefa13b[_0xed2f('0x49')]=[{'all':!![]}];}return db[_0xed2f('0x5e')][_0xed2f('0x5b')](_0xefa13b);})[_0xed2f('0x15')](function(_0x56301d){_0x3d15bc['rows']=_0x56301d;return _0x3d15bc;});}})['then'](respondWithFilteredResult(_0x47ee4a,_0xefa13b))[_0xed2f('0x1f')](handleError(_0x47ee4a,null));};exports[_0xed2f('0x61')]=function(_0x3149fc,_0x2cafba){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x3149fc[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2cafba,null))[_0xed2f('0x15')](function(_0x3fbf3c){if(_0x3fbf3c){return _0x3fbf3c[_0xed2f('0x61')](_0x3149fc[_0xed2f('0x33')][_0xed2f('0x62')]);}})['then'](respondWithStatusCode(_0x2cafba,null))[_0xed2f('0x1f')](handleError(_0x2cafba,null));};exports[_0xed2f('0x63')]=function(_0x101fd9,_0x457dad){_0x101fd9[_0xed2f('0x4b')][_0xed2f('0x64')]=_0x101fd9[_0xed2f('0x65')][_0xed2f('0x66')];return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x101fd9['params']['id']}})['then'](handleEntityNotFound(_0x457dad,null))['then'](saveUpdates(_0x101fd9[_0xed2f('0x4b')],null))[_0xed2f('0x15')](respondWithResult(_0x457dad,null))[_0xed2f('0x1f')](handleError(_0x457dad,null));};exports[_0xed2f('0x67')]=function(_0x5a3813,_0x28a00c){_0x5a3813['body'][_0xed2f('0x68')]=_0x5a3813['file'][_0xed2f('0x66')];return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x5a3813['params']['id']}})['then'](handleEntityNotFound(_0x28a00c,null))['then'](saveUpdates(_0x5a3813[_0xed2f('0x4b')],null))[_0xed2f('0x15')](respondWithResult(_0x28a00c,null))[_0xed2f('0x1f')](handleError(_0x28a00c,null));};exports[_0xed2f('0x69')]=function(_0x3c36f5,_0x14b288){_0x3c36f5[_0xed2f('0x4b')][_0xed2f('0x6a')]=_0x3c36f5[_0xed2f('0x65')][_0xed2f('0x66')];return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x3c36f5[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x14b288,null))[_0xed2f('0x15')](saveUpdates(_0x3c36f5[_0xed2f('0x4b')],null))['then'](respondWithResult(_0x14b288,null))['catch'](handleError(_0x14b288,null));};exports[_0xed2f('0x6b')]=function(_0x45bc93,_0x534a16){_0x45bc93[_0xed2f('0x4b')][_0xed2f('0x6c')]=_0x45bc93[_0xed2f('0x65')][_0xed2f('0x66')];return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x45bc93[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x534a16,null))['then'](saveUpdates(_0x45bc93[_0xed2f('0x4b')],null))['then'](respondWithResult(_0x534a16,null))['catch'](handleError(_0x534a16,null));};exports['getLogo']=function(_0x3206ff,_0x3807a4){var _0x344188=path['join'](config[_0xed2f('0x6d')],'server/files/images/logos/default_logo.svg');var _0x3ca44c={'where':{'id':_0x3206ff[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x64')],'raw':!![]};var _0x507975=![];return require(_0xed2f('0x6e'))['getLicense']()[_0xed2f('0x15')](function(_0x3231fe){if(_0x3231fe){_0x507975=_0x3231fe['custom'];}})[_0xed2f('0x15')](function(){return db['ChatWebsite']['find'](_0x3ca44c);})[_0xed2f('0x15')](handleEntityNotFound(_0x3807a4,null))[_0xed2f('0x15')](function(_0x2014be){if(_0x2014be){if(!_[_0xed2f('0x6f')](_0x2014be['sitepic'])){if(fs[_0xed2f('0x70')](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x72'),_0x2014be[_0xed2f('0x64')]))&&_0x507975){_0x344188=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x72'),_0x2014be['sitepic']);}}return _0x3807a4['download'](_0x344188);}})[_0xed2f('0x1f')](handleError(_0x3807a4,null));};exports[_0xed2f('0x73')]=function(_0x1722d6,_0xbbc261){var _0x21c137=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0xac77e3={'where':{'id':_0x1722d6[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x68')],'raw':!![]};return db['ChatWebsite']['find'](_0xac77e3)[_0xed2f('0x15')](handleEntityNotFound(_0xbbc261,null))[_0xed2f('0x15')](function(_0x2f8100){if(_0x2f8100){if(!_['isNil'](_0x2f8100[_0xed2f('0x68')])){if(fs['existsSync'](path['join'](config[_0xed2f('0x6d')],_0xed2f('0x74'),_0x2f8100['agentAvatar']))){_0x21c137=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x2f8100['agentAvatar']);}}return _0xbbc261[_0xed2f('0x75')](_0x21c137);}})[_0xed2f('0x1f')](handleError(_0xbbc261,null));};exports[_0xed2f('0x76')]=function(_0x158a2a,_0x4967cf){var _0xf674e1=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x77'));var _0x4a41f8={'where':{'id':_0x158a2a[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x6a'),_0xed2f('0x78')],'raw':!![]};return db[_0xed2f('0x44')]['find'](_0x4a41f8)['then'](handleEntityNotFound(_0x4967cf,null))[_0xed2f('0x15')](function(_0x46ae5e){if(_0x46ae5e){if(!_[_0xed2f('0x6f')](_0x46ae5e['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x46ae5e[_0xed2f('0x6a')]))&&_0x46ae5e[_0xed2f('0x78')]){_0xf674e1=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x46ae5e['customerAvatar']);}}return _0x4967cf[_0xed2f('0x75')](_0xf674e1);}})[_0xed2f('0x1f')](handleError(_0x4967cf,null));};exports[_0xed2f('0x79')]=function(_0x5f2aef,_0x901907){var _0x5eb22c=path['join'](config['root'],_0xed2f('0x7a'));var _0x1653ac={'where':{'id':_0x5f2aef[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x6c')],'raw':!![]};return db['ChatWebsite']['find'](_0x1653ac)[_0xed2f('0x15')](handleEntityNotFound(_0x901907,null))[_0xed2f('0x15')](function(_0x5ee73c){if(_0x5ee73c){if(!_[_0xed2f('0x6f')](_0x5ee73c['systemAvatar'])){if(fs['existsSync'](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x5ee73c['systemAvatar']))){_0x5eb22c=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x74'),_0x5ee73c[_0xed2f('0x6c')]);}}return _0x901907[_0xed2f('0x75')](_0x5eb22c);}})[_0xed2f('0x1f')](handleError(_0x901907,null));};exports[_0xed2f('0x7b')]=function(_0x2d6cb8,_0x547510){var _0x29a9c6=require(_0xed2f('0x7c'));var _0x5ba6e7=new _0x29a9c6();var _0x4b9777=_0x5ba6e7[_0xed2f('0x7d')](_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x7f')])[_0xed2f('0x80')]();var _0x59dc89={'body':_0x2d6cb8[_0xed2f('0x4b')],'channel':'chat'};var _0x343b3f=[];var _0x135d3b=[];var _0x4df2d7={};var _0x43f02c=![];return db[_0xed2f('0x81')]['describe']()['then'](function(_0x5aeda5){if(!_0x5aeda5){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x343b3f=_['difference'](_[_0xed2f('0x34')](_0x5aeda5),[_0xed2f('0x82'),_0xed2f('0x83')]);_0x135d3b=_[_0xed2f('0x84')](_[_0xed2f('0x34')](_0x5aeda5),[_0xed2f('0x82'),_0xed2f('0x83'),_0xed2f('0x85'),_0xed2f('0x86')]);if(_0x2d6cb8[_0xed2f('0x4b')]['id']){delete _0x2d6cb8[_0xed2f('0x4b')]['id'];}if(_[_0xed2f('0x6f')](_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x87')])){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0x8a'));}if(_['isNil'](_0x2d6cb8[_0xed2f('0x4b')]['body'])||_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x4b')]===''){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0x8b'));}if(_[_0xed2f('0x6f')](_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x8c')])){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x135d3b);}if(!_['includes'](_0x135d3b,_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x8c')])){throw new db['Sequelize']['ValidationError'](_0xed2f('0x8d')+_0x135d3b);}_0x4df2d7[_0x2d6cb8['body']['mapKey']]=_0x2d6cb8[_0xed2f('0x4b')]['from'];})[_0xed2f('0x15')](function(){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x2d6cb8[_0xed2f('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0xed2f('0x8e'),'include':[{'model':db['CmContact'],'as':_0xed2f('0x8f'),'where':_0x4df2d7,'limit':0x1,'order':[[_0xed2f('0x83'),_0xed2f('0x90')]]}]},{'model':db[_0xed2f('0x91')],'as':'Applications'}]});})[_0xed2f('0x15')](handleEntityNotFound(_0x547510,null))[_0xed2f('0x15')](function(_0x53a7f0){if(_0x53a7f0&&_0x53a7f0[_0xed2f('0x8e')]){_0x59dc89['account']=_0x53a7f0;_0x59dc89[_0xed2f('0x92')]=_0x53a7f0['Applications'];_0x59dc89[_0xed2f('0x93')]=_0x53a7f0[_0xed2f('0x8e')];_0x59dc89[_0xed2f('0x92')]=_['orderBy'](_0x59dc89[_0xed2f('0x92')],['priority'],[_0xed2f('0x94')]);if(_0x59dc89[_0xed2f('0x95')][_0xed2f('0x96')]){delete _0x59dc89[_0xed2f('0x95')][_0xed2f('0x96')];}if(_0x59dc89['account'][_0xed2f('0x8e')]&&_0x59dc89[_0xed2f('0x95')]['List'][_0xed2f('0x8f')]['length']){return _0x59dc89[_0xed2f('0x95')][_0xed2f('0x8e')][_0xed2f('0x8f')][0x0];}var _0x400059=_[_0xed2f('0xb')](_0x2d6cb8['body'],{'firstName':_0x2d6cb8[_0xed2f('0x4b')]['from'],'ListId':_0x53a7f0[_0xed2f('0x86')]});_0x400059[_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x8c')]]=_0x2d6cb8[_0xed2f('0x4b')]['from'];return db[_0xed2f('0x81')][_0xed2f('0x4a')](_0x400059,{'fields':_0x343b3f,'raw':!![]});}})[_0xed2f('0x15')](handleEntityNotFound(_0x547510,null))[_0xed2f('0x15')](function(_0x589255){_0x59dc89[_0xed2f('0x97')]=_0x589255;var _0x2c1615=_0x2d6cb8['body'][_0xed2f('0x98')];if(_0x2d6cb8[_0xed2f('0x7e')]['cf-connecting-ip']){_0x2c1615=_0x2d6cb8[_0xed2f('0x7e')]['cf-connecting-ip'];}else if(_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x99')]){_0x2c1615=_[_0xed2f('0x9a')](_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x99')][_0xed2f('0x9b')](','));}if(_0x589255){var _0x5ec497={'ContactId':_0x589255['id'],'ChatWebsiteId':_0x2d6cb8['params']['id'],'from':(_0x589255[_0xed2f('0x9c')]||'')+'\x20'+(_0x589255[_0xed2f('0x9d')]||''),'customerIp':_0x2c1615,'customerPort':_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x9e')]?_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x9e')]:null,'referer':_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x9f')],'browserName':_0x4b9777[_0xed2f('0xa0')][_0xed2f('0x2d')]&&_0x4b9777[_0xed2f('0xa0')]['version']?util[_0xed2f('0xa1')](_0xed2f('0xa2'),_0x4b9777[_0xed2f('0xa0')][_0xed2f('0x2d')],_0x4b9777['browser'][_0xed2f('0xa3')]):'unknown','browserVersion':_0x4b9777[_0xed2f('0xa0')][_0xed2f('0xa3')]||_0xed2f('0xa4'),'osName':util[_0xed2f('0xa1')](_0xed2f('0xa2'),_0x4b9777['os'][_0xed2f('0x2d')],_0x4b9777['os'][_0xed2f('0xa3')]),'osVersion':_0x4b9777['os'][_0xed2f('0xa3')],'deviceModel':_0x4b9777[_0xed2f('0xa5')]['model']&&_0x4b9777[_0xed2f('0xa5')][_0xed2f('0xa6')]?util[_0xed2f('0xa1')](_0xed2f('0xa7'),_0x4b9777['device']['model'],_0x4b9777[_0xed2f('0xa5')][_0xed2f('0xa6')],_0x4b9777[_0xed2f('0xa5')]['type']):null,'deviceVendor':_0x4b9777[_0xed2f('0xa5')][_0xed2f('0xa6')],'deviceType':_0x4b9777[_0xed2f('0xa5')][_0xed2f('0x31')],'formData':JSON[_0xed2f('0x1a')](_0x2d6cb8[_0xed2f('0x4b')])};var _0x44ec47={'ChatWebsiteId':_0x2d6cb8[_0xed2f('0x47')]['id'],'closed':![]};if(_0x2d6cb8[_0xed2f('0x4b')]['threadId']){_0x44ec47[_0xed2f('0xa8')]=_0x2d6cb8['body'][_0xed2f('0xa8')];return db[_0xed2f('0xa9')]['find']({'where':_0x44ec47})[_0xed2f('0x15')](function(_0x1e5e3a){if(_0x1e5e3a){return[_0x1e5e3a,![]];}_0x5ec497[_0xed2f('0xa8')]=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xa8')];_0x5ec497[_0xed2f('0xaa')]=_0x2d6cb8['body']['externalUrl'];return db[_0xed2f('0xa9')][_0xed2f('0x4a')](_0x5ec497)[_0xed2f('0x15')](function(_0x23ae4d){return[_0x23ae4d,!![]];});});}_0x44ec47[_0xed2f('0xab')]=_0x589255['id'];if(_0x2d6cb8['body'][_0xed2f('0xac')]&&_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xac')]['id']){_0x44ec47['id']=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xac')]['id'];return db[_0xed2f('0xa9')][_0xed2f('0x55')]({'where':_0x44ec47})[_0xed2f('0x15')](function(_0x995013){if(_0x995013){return[_0x995013,![]];}return db[_0xed2f('0xa9')]['create'](_0x5ec497)['then'](function(_0x383b6f){return[_0x383b6f,!![]];});});}return db[_0xed2f('0xa9')][_0xed2f('0x4a')](_0x5ec497)[_0xed2f('0x15')](function(_0x4087f7){return[_0x4087f7,!![]];});}})['spread'](function(_0x23728a,_0x381cae){if(_0x23728a){_0x43f02c=_0x381cae;if(!_0x381cae){var _0x2433ed={'from':(_0x59dc89['contact'][_0xed2f('0x9c')]||'')+'\x20'+(_0x59dc89[_0xed2f('0x97')][_0xed2f('0x9d')]||'')};if(_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xa8')]&&_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xad')]&&_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xa8')]!=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xad')]){_0x2433ed[_0xed2f('0xa8')]=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xad')];}return _0x23728a[_0xed2f('0x29')](_0x2433ed);}else{return _0x23728a;}}})[_0xed2f('0x15')](function(_0x47a825){_0x59dc89[_0xed2f('0xac')]=_0x47a825[_0xed2f('0x2b')]({'plain':!![]});_0x59dc89[_0xed2f('0xac')]['created']=_0x43f02c;if(_0x59dc89[_0xed2f('0xac')][_0xed2f('0xae')]){if(_0x59dc89[_0xed2f('0x95')][_0xed2f('0xaf')]){_0x59dc89[_0xed2f('0x92')][_0xed2f('0xb0')]({'id':0x0,'priority':_0x59dc89[_0xed2f('0x92')][_0xed2f('0x39')]+0x1,'app':_0xed2f('0xb1'),'appdata':_0xed2f('0xb2'),'interval':_0xed2f('0xb3')});}}return db[_0xed2f('0xb4')]['create']({'body':_0x2d6cb8[_0xed2f('0x4b')]['body'],'ChatWebsiteId':_0x2d6cb8['params']['id'],'ChatInteractionId':_0x47a825['id'],'direction':'in','ContactId':_0x59dc89[_0xed2f('0x97')]['id'],'AttachmentId':_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xb5')]});})[_0xed2f('0x15')](function(_0x5240d7){_0x59dc89[_0xed2f('0x1d')]=_0x5240d7;if(_0x59dc89['interaction'][_0xed2f('0xb6')]){return db['User'][_0xed2f('0x55')]({'attributes':['id','name'],'where':{'id':_0x59dc89[_0xed2f('0xac')]['UserId']}})[_0xed2f('0x15')](function(_0x36ce38){if(_0x36ce38){_0x59dc89[_0xed2f('0x92')][_0xed2f('0xb7')]({'id':0x0,'priority':0x0,'app':_0xed2f('0xb8'),'appdata':_0x36ce38[_0xed2f('0x2d')]+','+(_0x59dc89[_0xed2f('0x95')][_0xed2f('0xb9')]||0xa),'interval':_0xed2f('0xb3')});_0x59dc89['forcedOwnership']=!![];}return respondWithRpcPromise(_0xed2f('0xba'),_0xed2f('0xbb'),_0x59dc89);});}return respondWithRpcPromise(_0xed2f('0xba'),_0xed2f('0xbb'),_0x59dc89);})[_0xed2f('0x15')](function(_0x18b10b){respondWithRpcPromise('EventManager',_0xed2f('0xbc'),{'event':_0xed2f('0x7b'),'message':_0x18b10b},client9002);return _0x18b10b;})[_0xed2f('0x15')](respondWithResult(_0x547510,null))[_0xed2f('0x1f')](handleError(_0x547510,null));};exports[_0xed2f('0xbd')]=function(_0x58858c,_0x1bd343){var _0x10e639,_0x223825,_0x5c79e8;var _0x16fbe5=[];var _0x4c5b07={};var _0x142d4a=_0x58858c[_0xed2f('0xbe')]||[];var _0x2f940a=[];var _0x17d04e;return db[_0xed2f('0x81')][_0xed2f('0x53')]()[_0xed2f('0x15')](function(_0x3971df){if(!_0x3971df){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0xbf'));}_0x16fbe5=_[_0xed2f('0x84')](_[_0xed2f('0x34')](_0x3971df),[_0xed2f('0x82'),_0xed2f('0x83'),'CompanyId',_0xed2f('0x86')]);if(_0x58858c[_0xed2f('0x4b')]['id']){delete _0x58858c[_0xed2f('0x4b')]['id'];}if(_['isNil'](_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')])){throw _0x1bd343[_0xed2f('0x27')](0x1f4)[_0xed2f('0xc0')](new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0x8a')));}if(_[_0xed2f('0x6f')](_0x58858c[_0xed2f('0x4b')][_0xed2f('0x4b')])||_0x58858c['body'][_0xed2f('0x4b')]===''){throw _0x1bd343[_0xed2f('0x27')](0x1f4)[_0xed2f('0xc0')](new db['Sequelize'][(_0xed2f('0x89'))](_0xed2f('0x8b')));}if(_['isNil'](_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')])){throw _0x1bd343['status'](0x1f4)[_0xed2f('0xc0')](new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0xc2')+_0x16fbe5));}if(!_[_0xed2f('0xc3')](_0x16fbe5,_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')])){throw _0x1bd343[_0xed2f('0x27')](0x1f4)[_0xed2f('0xc0')](new db['Sequelize'][(_0xed2f('0x89'))](_0xed2f('0xc4')+_0x16fbe5));}_0x4c5b07[_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')]]=_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')];})[_0xed2f('0x15')](function(){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x58858c[_0xed2f('0x47')]['id']},'include':[{'model':db[_0xed2f('0xc5')],'as':_0xed2f('0x8e')},{'model':db[_0xed2f('0xc6')],'as':_0xed2f('0xc6')}]});})['then'](handleEntityNotFound(_0x1bd343,null))['then'](function(_0x5014a1){if(_0x5014a1&&_0x5014a1[_0xed2f('0x8e')]){_0x223825=_0x5014a1;var _0x51d495=_['defaults'](_0x58858c[_0xed2f('0x4b')],{'firstName':_0x58858c['body']['from'],'phone':_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')],'ListId':_0x5014a1[_0xed2f('0x86')]});_0x51d495[_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')]]=_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')];return db['CmContact'][_0xed2f('0xc7')]({'where':_0x4c5b07,'defaults':_0x51d495});}})[_0xed2f('0xc8')](function(_0x4ed782){if(_0x4ed782){_0x5c79e8=_0x4ed782;var _0x246824=fs[_0xed2f('0xc9')](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0xca')),'utf8');var _0x419f08=ejs['render'](_0x246824,{'body':_[_0xed2f('0xcb')](_0x58858c['body']['body']),'bodyTitle':_0x223825['offlineMessageBody']});return db[_0xed2f('0xcc')][_0xed2f('0x4a')]({'body':_0x419f08,'ContactId':_0x4ed782['id'],'ChatWebsiteId':_0x223825['id']});}})[_0xed2f('0x15')](function(_0x3a2698){_0x17d04e=_0x3a2698;if(_0x142d4a[_0xed2f('0x39')]){var _0x33741c=_0x142d4a[_0xed2f('0x5a')](function(_0x257bcc){return{'name':_0x257bcc[_0xed2f('0xcd')],'basename':_0x257bcc[_0xed2f('0x66')],'type':_0x257bcc[_0xed2f('0xce')],'ChatOfflineMessageId':_0x3a2698['id']};});_0x2f940a=_0x33741c[_0xed2f('0x5a')](_0xcaaf98=>{var _0x1488e5={'filename':_0xcaaf98[_0xed2f('0x2d')],'path':path['join'](config['root'],_0xed2f('0xcf'),_0xed2f('0xbe'),_0xed2f('0xd0'),_0xed2f('0xd1'),_0xcaaf98[_0xed2f('0xd2')])};return _0x1488e5;});if(!_0x223825[_0xed2f('0xd3')]){return db['sequelize'][_0xed2f('0xd4')](function(_0x37bf9f){return db[_0xed2f('0xd5')]['bulkCreate'](_0x33741c,{'transaction':_0x37bf9f});});}}})[_0xed2f('0x15')](function(){if(_0x17d04e){_0x10e639=_0x17d04e;return db['MailAccount'][_0xed2f('0x60')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0xed2f('0x15')](function(_0x44c4e8){if(_0x44c4e8&&_0x44c4e8[_0xed2f('0xd6')]&&_0x223825['forwardOffline']&&_0x223825['forwardOfflineAddress']){var _0x142b91={'tls':{'rejectUnauthorized':![]}};if(_0x44c4e8['Smtp'][_0xed2f('0xd7')]){_0x142b91[_0xed2f('0xd7')]=_0x44c4e8[_0xed2f('0xd6')]['service'];}else{_0x142b91['host']=_0x44c4e8[_0xed2f('0xd6')][_0xed2f('0xd8')];_0x142b91['port']=_0x44c4e8['Smtp'][_0xed2f('0xd9')];_0x142b91['secure']=_0x44c4e8['Smtp'][_0xed2f('0xda')];}if(_0x44c4e8['Smtp'][_0xed2f('0xdb')]){_0x142b91[_0xed2f('0xdc')]={'user':_0x44c4e8[_0xed2f('0xd6')][_0xed2f('0x4d')],'pass':_0x44c4e8[_0xed2f('0xd6')]['pass']};}return respondWithRpcPromise(_0xed2f('0xdd'),_0xed2f('0xde'),{'account':_0x142b91,'message':{'from':util[_0xed2f('0xa1')](_0xed2f('0xdf'),_0x44c4e8[_0xed2f('0x2d')],_0x44c4e8['email']||_0x44c4e8[_0xed2f('0xd6')][_0xed2f('0x4d')]),'to':_0x223825[_0xed2f('0xe0')],'subject':_0x223825[_0xed2f('0xe1')],'html':_0x10e639[_0xed2f('0x4b')],'attachments':_0x2f940a}},client9003)['then'](function(){return _0x10e639;})[_0xed2f('0x1f')](function(_0x2ec217){console[_0xed2f('0x1b')](_0x2ec217);});}})[_0xed2f('0x15')](function(){if(_0x223825&&_0x223825['openNewInteraction']&&_0x223825[_0xed2f('0xe2')]){var _0x465e4d=[];if(_0x142d4a[_0xed2f('0x39')]){_0x465e4d=_0x142d4a[_0xed2f('0x5a')](function(_0x1e7e8e){return{'name':_0x1e7e8e[_0xed2f('0xcd')],'basename':_0x1e7e8e[_0xed2f('0x66')],'type':_0x1e7e8e[_0xed2f('0xce')],'ChatOfflineMessageId':_0x17d04e['id']};});}var _0x2656c3;if(!_[_0xed2f('0x6f')](_0x223825[_0xed2f('0xe3')])){var _0x2b3da1=_['map'](_0x58858c[_0xed2f('0x4b')],function(_0x18ebfb){return _0x18ebfb;});var _0x196a30=_[_0xed2f('0xe4')](_0x2b3da1)[0x0];var _0x77f576=_[_0xed2f('0xe5')](_0x196a30,function(_0x4528cd){return _0x4528cd;});_0x2656c3=_0x77f576[0x1][_0x223825['subjectOffline']];}var _0x12d8c9={'from':_0x5c79e8[_0xed2f('0xe6')],'firstName':_0x5c79e8[_0xed2f('0x9c')],'lastName':_0x5c79e8['lastName'],'mapKey':_0xed2f('0xe6'),'message':{'from':_0x5c79e8['email'],'to':_0x223825[_0xed2f('0xc6')][_0xed2f('0xe6')],'cc':'','subject':_['isNil'](_0x2656c3)?_0x223825[_0xed2f('0xe1')]:_0x2656c3,'messageId':'','sentAt':new Date(),'attach':_0x465e4d['length'],'attachments':_0x465e4d,'originChannel':_0xed2f('0xe7'),'ChatWebsiteId':_0x223825['id'],'ChatOfflineMessageId':_0x10e639['id'],'originTo':_0x223825[_0xed2f('0xc6')][_0xed2f('0xe6')]},'body':_0x10e639[_0xed2f('0x4b')]};var _0x1bc1a0={'account':{'id':_0x223825[_0xed2f('0xe2')]},'body':_0x12d8c9,'log':_0xed2f('0xe8')};return respondWithRpcPromise(_0xed2f('0xe8'),_0xed2f('0xe9'),_0x1bc1a0,client9001)['then'](function(){return _0x10e639;})['catch'](function(_0x204d79){console[_0xed2f('0x1b')](_0x204d79);});}return;})['then'](function(){if(_0x10e639){return _0x10e639;}})[_0xed2f('0x15')](respondWithResult(_0x1bd343,null))['catch'](function(_0x58ec7e){console[_0xed2f('0x1b')](_0xed2f('0x1f'),_0x58ec7e);for(var _0x20101b of _0x142d4a){var _0x2f2f30=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server',_0xed2f('0xbe'),_0xed2f('0xd0'),_0xed2f('0xd1'),_0x20101b[_0xed2f('0x66')]);fs_extra['remove'](_0x2f2f30)[_0xed2f('0x1f')](function(_0x4f7d78){console['error'](_0xed2f('0xea'),_0x2f2f30,_0x4f7d78);});}});};exports[_0xed2f('0xeb')]=function(_0x3ce8ce,_0x5ab9d6){return db[_0xed2f('0xa9')][_0xed2f('0x55')]({'where':{'id':_0x3ce8ce[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5ab9d6,null))[_0xed2f('0x15')](function(_0x28dd4b){if(_0x28dd4b){return _0x28dd4b['addInteraction'](_0x3ce8ce[_0xed2f('0x4b')][_0xed2f('0x62')],_[_0xed2f('0xec')](_0x3ce8ce[_0xed2f('0x4b')],[_0xed2f('0x62'),'id'])||{});}})['then'](respondWithResult(_0x5ab9d6,null))[_0xed2f('0x1f')](handleError(_0x5ab9d6,null));};exports[_0xed2f('0xed')]=function(_0x59e55e,_0x1669c2){var _0x1a324e={'raw':![],'where':{}};var _0x3c08dc={};var _0x5a2f1c={'count':0x0,'rows':[]};return db[_0xed2f('0x44')]['findOne']({'where':{'id':_0x59e55e['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x1669c2,null))[_0xed2f('0x15')](function(_0x433b26){if(_0x433b26){_0x3c08dc[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['ChatInteraction'][_0xed2f('0x48')]);_0x3c08dc['query']=_[_0xed2f('0x34')](_0x59e55e[_0xed2f('0x33')]);_0x3c08dc[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x3c08dc[_0xed2f('0x36')],_0x3c08dc[_0xed2f('0x33')]);_0x1a324e[_0xed2f('0x37')]=_[_0xed2f('0x35')](_0x3c08dc[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x59e55e[_0xed2f('0x33')][_0xed2f('0x38')]));_0x1a324e[_0xed2f('0x37')]=_0x1a324e['attributes'][_0xed2f('0x39')]?_0x1a324e[_0xed2f('0x37')]:_0x3c08dc['model'];if(!_0x59e55e[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x1a324e[_0xed2f('0x25')]=qs[_0xed2f('0x25')](_0x59e55e['query'][_0xed2f('0x25')]);_0x1a324e[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x59e55e['query']['offset']);}_0x1a324e['order']=qs[_0xed2f('0x3c')](_0x59e55e['query'][_0xed2f('0x3c')]);_0x1a324e[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x59e55e[_0xed2f('0x33')],_0x3c08dc[_0xed2f('0x3e')]));_0x1a324e['where'][_0xed2f('0x56')]=_0x433b26['id'];if(_0x59e55e[_0xed2f('0x33')][_0xed2f('0x42')]){_0x1a324e[_0xed2f('0x3d')]=_['merge'](_0x1a324e[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x1a324e[_0xed2f('0x37')],function(_0x10355e){var _0x4a6ad5={};_0x4a6ad5[_0x10355e]={'$like':'%'+_0x59e55e['query'][_0xed2f('0x42')]+'%'};return _0x4a6ad5;})});}_0x1a324e=_[_0xed2f('0x40')]({},_0x1a324e,_0x59e55e[_0xed2f('0x43')]);return db[_0xed2f('0xa9')]['count']({'where':_0x1a324e['where']})[_0xed2f('0x15')](function(_0x12afb9){_0x5a2f1c['count']=_0x12afb9;if(_0x59e55e[_0xed2f('0x33')]['includeAll']){_0x1a324e[_0xed2f('0x49')]=[{'model':db[_0xed2f('0x81')],'as':_0xed2f('0xee'),'required':![]},{'model':db[_0xed2f('0xef')],'as':_0xed2f('0xf0'),'attributes':[_0xed2f('0x2d'),'fullname','internal'],'required':![]},{'model':db[_0xed2f('0xf1')],'as':_0xed2f('0xf2'),'attributes':['id',_0xed2f('0x2d'),_0xed2f('0xf3')],'where':_0x59e55e['query']['tag']?{'id':_0x59e55e['query'][_0xed2f('0xf4')]}:undefined,'required':_0x59e55e['query'][_0xed2f('0xf4')]?!![]:![]}];}return db[_0xed2f('0xa9')][_0xed2f('0x5b')](_0x1a324e);})[_0xed2f('0x15')](function(_0x15dd24){_0x5a2f1c['rows']=_0x15dd24;return _0x5a2f1c;});}})[_0xed2f('0x15')](respondWithFilteredResult(_0x1669c2,_0x1a324e))[_0xed2f('0x1f')](handleError(_0x1669c2,null));};function iftimePromise(_0x1c0c72,_0x58aebd){return respondWithRpcPromise(_0xed2f('0xf5'),_0xed2f('0xf6'),{'command':_0x58aebd[_0xed2f('0xf7')]?util[_0xed2f('0xa1')](_0xed2f('0xf8'),_0x1c0c72[_0xed2f('0xf9')],_0x58aebd['timezone']):util[_0xed2f('0xa1')](_0xed2f('0xfa'),_0x1c0c72['interval'])},client9002)['then'](function(_0x3b3af4){var _0x47e607=_0x3b3af4&&_0x3b3af4[_0xed2f('0xfb')](_0xed2f('0xfc'))>=0x0?!![]:![];logger[_0xed2f('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x58aebd['id'],_0x1c0c72['id'],_0x1c0c72[_0xed2f('0xf9')],_0x47e607?_0xed2f('0xfd'):'OFFLINE',_0x58aebd[_0xed2f('0xf7')]?_0x58aebd[_0xed2f('0xf7')]:_0xed2f('0xfe'));return _0x47e607;})[_0xed2f('0x1f')](function(_0x811190){logger[_0xed2f('0x1b')](_0xed2f('0xff'),_0x58aebd['id'],_0x1c0c72['id'],_0x1c0c72['interval'],util[_0xed2f('0x100')](_0x811190,{'showHidden':![],'depth':null}),_0x58aebd['timezone']?_0x58aebd[_0xed2f('0xf7')]:'No\x20timezone');return![];});}exports[_0xed2f('0xf6')]=function(_0x2ad790,_0x562db5){var _0x1f1a69=0x0;var _0x672f0a=0x0;var _0x8ce47e=![];var _0x48b209;var _0x1e7d22;return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x2ad790['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xed2f('0x101')],'as':_0xed2f('0x102'),'attributes':['id',_0xed2f('0xf9')],'raw':!![]}]}]})[_0xed2f('0x15')](handleEntityNotFound(_0x562db5,null))[_0xed2f('0x15')](function(_0x24e12c){if(_0x24e12c){_0x48b209=_0x24e12c;return _0x24e12c[_0xed2f('0x103')]({'raw':!![]});}})[_0xed2f('0x15')](function(_0x16d605){if(_0x48b209){if(_0x16d605){_0x1e7d22=_0x16d605;}}return require('../../config/license/util')[_0xed2f('0x104')]();})[_0xed2f('0x15')](function(_0x27a2f6){if(_0x27a2f6){_0x672f0a=_0x27a2f6[_0xed2f('0x105')];_0x8ce47e=_0x27a2f6['custom'];}})['then'](function(){return db[_0xed2f('0xa9')][_0xed2f('0x26')]({'where':{'closed':![]}});})[_0xed2f('0x15')](function(_0x151bce){_0x1f1a69=_0x151bce;if(_0x672f0a&&_0x151bce>_0x672f0a){return db['License'][_0xed2f('0x60')]({'where':{'id':0x1}})['then'](function(_0x551709){if(_0x551709){_0x551709[_0xed2f('0x106')](_0xed2f('0x107'));}});}})['then'](function(){if(_0x48b209[_0xed2f('0x101')]&&_0x48b209[_0xed2f('0x101')]['Intervals']){var _0xbb9b38=[];for(var _0xe1582b=0x0;_0xe1582b<_0x48b209[_0xed2f('0x101')][_0xed2f('0x102')][_0xed2f('0x39')];_0xe1582b++){var _0x30a27c=_0x48b209[_0xed2f('0x101')][_0xed2f('0x102')][_0xe1582b][_0xed2f('0x2b')]({'plain':!![]});_0xbb9b38[_0xed2f('0xb0')](iftimePromise(_0x30a27c,_0x48b209));}return BPromise[_0xed2f('0x108')](_0xbb9b38)[_0xed2f('0x15')](function(_0x3ffc14){return _[_0xed2f('0x109')](_0x3ffc14);});}else{return!![];}})['then'](function(_0xdb41c0){var _0x276dcf=fs[_0xed2f('0xc9')](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/chat/iframe.ejs'),_0xed2f('0x10a'));var _0x49f8e8={'remote':_0x48b209[_0xed2f('0x10b')],'query':querystring['stringify'](_[_0xed2f('0x40')](_0x48b209[_0xed2f('0x2b')]({'plain':!![]}),{'customerIp':_0x2ad790[_0xed2f('0x7e')][_0xed2f('0x99')]||_0x2ad790[_0xed2f('0x7e')][_0xed2f('0x10c')]||_0x2ad790[_0xed2f('0x10d')][_0xed2f('0x10e')]||_0x2ad790['ip'],'referer':_0x2ad790[_0xed2f('0x7e')][_0xed2f('0x9f')],'openedInteractions':_0x1f1a69,'maxInteractions':_0x672f0a,'virtual':_0x8ce47e[_0xed2f('0x105')],'online':_0xdb41c0,'custom':_0x8ce47e}))[_0xed2f('0x10f')](/'/g,'\x5c\x27')};_0x562db5[_0xed2f('0xc0')](ejs[_0xed2f('0x110')](Mustache[_0xed2f('0x110')](_0x276dcf,_0x49f8e8),{'proactiveActions':_0x1e7d22,'alignment':_0x48b209['alignment'],'verticalAlignment':_0x48b209[_0xed2f('0x111')],'div_color':_0x48b209[_0xed2f('0xf3')],'labelText':_0x48b209[_0xed2f('0x112')],'text_color':_0x48b209[_0xed2f('0x113')],'button_color':_0x48b209[_0xed2f('0x114')],'background_color':_0x48b209[_0xed2f('0x115')]}));})[_0xed2f('0x1f')](handleError(_0x562db5,null));};exports[_0xed2f('0x116')]=function(_0x28d27f,_0x265304){var _0x1eb2c4=_0x28d27f['params']['id'];var _0x3fbbb3=_0x28d27f[_0xed2f('0x4b')];var _0x2a700e=0xc8;var _0x5d9d1e=null;return db['sequelize'][_0xed2f('0xd4')]({'isolationLevel':db[_0xed2f('0x117')][_0xed2f('0x118')][_0xed2f('0x119')][_0xed2f('0x11a')]},function(_0x2131d5){return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x1eb2c4},'transaction':_0x2131d5})[_0xed2f('0x15')](function(_0x1d7006){if(_0x1d7006){return db['ChatApplication'][_0xed2f('0x2a')]({'where':{'ChatWebsiteId':_0x1eb2c4},'transaction':_0x2131d5})[_0xed2f('0x15')](function(){var _0x22c810=_['map'](_0x3fbbb3,function(_0x59e004){_0x59e004[_0xed2f('0x56')]=_0x1eb2c4;return _0x59e004;});return db['ChatApplication'][_0xed2f('0x11b')](_0x22c810,{'transaction':_0x2131d5});});}else{_0x2a700e=0x194;_0x5d9d1e=[];}});})[_0xed2f('0x15')](function(){if(_0x2a700e!==0x194){return db[_0xed2f('0x91')][_0xed2f('0x11c')]({'where':{'ChatWebsiteId':_0x1eb2c4},'order':'priority'})['then'](function(_0x4e9aeb){_0x5d9d1e=_0x4e9aeb;});}})[_0xed2f('0x1f')](function(_0x254697){_0x2a700e=0x1f4;logger['error'](_0x254697['stack']);if(_0x254697[_0xed2f('0x2d')]){delete _0x254697[_0xed2f('0x2d')];}_0x5d9d1e=_0x254697;})['finally'](function(){if(_0x5d9d1e===null){_0x265304[_0xed2f('0x20')](_0x2a700e);}else{if(_0x2a700e===0x1f4){_0x265304[_0xed2f('0x27')](_0x2a700e)[_0xed2f('0xc0')](_0x5d9d1e);}else{_0x265304[_0xed2f('0x27')](_0x2a700e)['json'](_0x5d9d1e);}}});};exports[_0xed2f('0x11d')]=function(_0x53cd63,_0x3112e4){var _0x4bf1b9={};var _0x1c55a1={};var _0x4028a6;var _0x3f6825;return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x53cd63[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x3112e4,null))[_0xed2f('0x15')](function(_0x2e87f5){if(_0x2e87f5){_0x4028a6=_0x2e87f5;_0x1c55a1[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['ChatApplication'][_0xed2f('0x48')]);_0x1c55a1[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x53cd63[_0xed2f('0x33')]);_0x1c55a1[_0xed2f('0x3e')]=_['intersection'](_0x1c55a1[_0xed2f('0x36')],_0x1c55a1[_0xed2f('0x33')]);_0x4bf1b9['attributes']=_[_0xed2f('0x35')](_0x1c55a1[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x53cd63[_0xed2f('0x33')]['fields']));_0x4bf1b9['attributes']=_0x4bf1b9[_0xed2f('0x37')][_0xed2f('0x39')]?_0x4bf1b9['attributes']:_0x1c55a1['model'];_0x4bf1b9[_0xed2f('0x3b')]=qs['sort'](_0x53cd63[_0xed2f('0x33')]['sort']);_0x4bf1b9[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x53cd63[_0xed2f('0x33')],_0x1c55a1[_0xed2f('0x3e')]));if(_0x53cd63['query'][_0xed2f('0x42')]){_0x4bf1b9[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x4bf1b9['where'],{'$or':_['map'](_0x4bf1b9['attributes'],function(_0x317cc5){var _0x2d4774={};_0x2d4774[_0x317cc5]={'$like':'%'+_0x53cd63[_0xed2f('0x33')]['filter']+'%'};return _0x2d4774;})});}_0x4bf1b9=_[_0xed2f('0x40')]({},_0x4bf1b9,_0x53cd63[_0xed2f('0x43')]);return _0x4028a6[_0xed2f('0x11d')](_0x4bf1b9);}})[_0xed2f('0x15')](function(_0x5f334a){if(_0x5f334a){_0x3f6825=_0x5f334a[_0xed2f('0x39')];if(!_0x53cd63[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x4bf1b9[_0xed2f('0x25')]=qs[_0xed2f('0x25')](_0x53cd63[_0xed2f('0x33')][_0xed2f('0x25')]);_0x4bf1b9[_0xed2f('0x23')]=qs['offset'](_0x53cd63[_0xed2f('0x33')][_0xed2f('0x23')]);}return _0x4028a6['getApplications'](_0x4bf1b9);}})['then'](function(_0x1f078c){if(_0x1f078c){return _0x1f078c?{'count':_0x3f6825,'rows':_0x1f078c}:null;}})[_0xed2f('0x15')](respondWithResult(_0x3112e4,null))['catch'](handleError(_0x3112e4,null));};exports['addProactiveActions']=function(_0xed57c8,_0x5aa3a2){return db[_0xed2f('0x11e')][_0xed2f('0x55')]({'where':{'id':_0xed57c8[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x5aa3a2,null))[_0xed2f('0x15')](function(_0x5245d9){if(_0x5245d9){return _0x5245d9['addProactiveActions'](_0xed57c8[_0xed2f('0x4b')][_0xed2f('0x62')],_[_0xed2f('0xec')](_0xed57c8['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5aa3a2,null))['catch'](handleError(_0x5aa3a2,null));};exports['getProactiveActions']=function(_0x32911b,_0x217760){var _0x31e77b={};var _0x1715df={};var _0x162a6a;var _0x4c8feb;return db[_0xed2f('0x44')]['findOne']({'where':{'id':_0x32911b[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x217760,null))[_0xed2f('0x15')](function(_0x3e6963){if(_0x3e6963){_0x162a6a=_0x3e6963;_0x1715df['model']=_['keys'](db[_0xed2f('0x11f')][_0xed2f('0x48')]);_0x1715df[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x32911b[_0xed2f('0x33')]);_0x1715df[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x1715df['model'],_0x1715df[_0xed2f('0x33')]);_0x31e77b[_0xed2f('0x37')]=_[_0xed2f('0x35')](_0x1715df[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x38')]));_0x31e77b[_0xed2f('0x37')]=_0x31e77b['attributes']['length']?_0x31e77b[_0xed2f('0x37')]:_0x1715df['model'];_0x31e77b[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x3c')]);_0x31e77b[_0xed2f('0x3d')]=qs['filters'](_[_0xed2f('0x3f')](_0x32911b['query'],_0x1715df['filters']));if(_0x32911b[_0xed2f('0x33')][_0xed2f('0x42')]){_0x31e77b[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x31e77b[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x31e77b[_0xed2f('0x37')],function(_0x50b23d){var _0x5d8d47={};_0x5d8d47[_0x50b23d]={'$like':'%'+_0x32911b['query'][_0xed2f('0x42')]+'%'};return _0x5d8d47;})});}_0x31e77b=_[_0xed2f('0x40')]({},_0x31e77b,_0x32911b[_0xed2f('0x43')]);return _0x162a6a[_0xed2f('0x103')](_0x31e77b);}})[_0xed2f('0x15')](function(_0x3b8150){if(_0x3b8150){_0x4c8feb=_0x3b8150[_0xed2f('0x39')];if(!_0x32911b[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x31e77b['limit']=qs[_0xed2f('0x25')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x25')]);_0x31e77b[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x23')]);}return _0x162a6a[_0xed2f('0x103')](_0x31e77b);}})[_0xed2f('0x15')](function(_0x50382a){if(_0x50382a){return _0x50382a?{'count':_0x4c8feb,'rows':_0x50382a}:null;}})['then'](respondWithResult(_0x217760,null))[_0xed2f('0x1f')](handleError(_0x217760,null));};exports[_0xed2f('0x120')]=function(_0x2f2438,_0xe58ef4){var _0x5e9e6d=_0x2f2438[_0xed2f('0x33')][_0xed2f('0x121')]===_0xed2f('0x122')?_0xed2f('0x123'):'onlineForm';return db[_0xed2f('0x44')][_0xed2f('0x55')]({'attributes':['id',_0x5e9e6d],'where':{'id':_0x2f2438[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0xe58ef4,null))['then'](function(_0x3c08df){if(_0x3c08df){var _0x3513e5=_0x3c08df[_0x5e9e6d];var _0x266dc1=_0x3513e5&&_0x3513e5['items']?_0x3513e5['items']:[];_0xe58ef4[_0xed2f('0xc0')]({'fromKey':_[_0xed2f('0x6f')](_0x3513e5[_0xed2f('0x124')])?undefined:_0x3513e5[_0xed2f('0x124')],'count':_0x266dc1[_0xed2f('0x39')],'rows':_0x266dc1});}})[_0xed2f('0x1f')](handleError(_0xe58ef4,null));};exports[_0xed2f('0x125')]=function(_0x185b62,_0xa683b1){var _0x5dc28b={'raw':![],'where':{}};var _0x363777={};var _0x2da55f={'count':0x0,'rows':[]};return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x185b62[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0xa683b1,null))[_0xed2f('0x15')](function(_0x423f57){if(_0x423f57){_0x363777[_0xed2f('0x36')]=_['keys'](db[_0xed2f('0xcc')]['rawAttributes']);_0x363777[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x185b62[_0xed2f('0x33')]);_0x363777[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x363777[_0xed2f('0x36')],_0x363777[_0xed2f('0x33')]);_0x5dc28b['attributes']=_[_0xed2f('0x35')](_0x363777[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x185b62[_0xed2f('0x33')][_0xed2f('0x38')]));_0x5dc28b['attributes']=_0x5dc28b[_0xed2f('0x37')][_0xed2f('0x39')]?_0x5dc28b[_0xed2f('0x37')]:_0x363777[_0xed2f('0x36')];if(!_0x185b62[_0xed2f('0x33')][_0xed2f('0x3a')]('nolimit')){_0x5dc28b['limit']=qs['limit'](_0x185b62['query'][_0xed2f('0x25')]);_0x5dc28b[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x185b62[_0xed2f('0x33')][_0xed2f('0x23')]);}_0x5dc28b[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x185b62[_0xed2f('0x33')][_0xed2f('0x3c')]);_0x5dc28b[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x185b62['query'],_0x363777['filters']));_0x5dc28b[_0xed2f('0x3d')]['ChatWebsiteId']=_0x423f57['id'];if(_0x185b62[_0xed2f('0x33')][_0xed2f('0x42')]){_0x5dc28b[_0xed2f('0x3d')]=_['merge'](_0x5dc28b[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x5dc28b[_0xed2f('0x37')],function(_0xfa2fc9){var _0x28b143={};_0x28b143[_0xfa2fc9]={'$like':'%'+_0x185b62[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x28b143;})});}_0x5dc28b=_[_0xed2f('0x40')]({},_0x5dc28b,_0x185b62[_0xed2f('0x43')]);return db['ChatOfflineMessage'][_0xed2f('0x26')]({'where':_0x5dc28b[_0xed2f('0x3d')]})[_0xed2f('0x15')](function(_0x506c60){_0x2da55f['count']=_0x506c60;if(_0x185b62[_0xed2f('0x33')][_0xed2f('0x45')]){_0x5dc28b[_0xed2f('0x49')]=[{'all':!![]}];}else{_0x5dc28b[_0xed2f('0x49')]=[{'model':db['CmContact'],'as':_0xed2f('0xee'),'required':![]},{'model':db['Attachment'],'as':_0xed2f('0x126'),'required':![]}];}return db[_0xed2f('0xcc')][_0xed2f('0x5b')](_0x5dc28b);})[_0xed2f('0x15')](function(_0x1ed533){_0x2da55f[_0xed2f('0x127')]=_0x1ed533;return _0x2da55f;});}})['then'](respondWithFilteredResult(_0xa683b1,_0x5dc28b))[_0xed2f('0x1f')](handleError(_0xa683b1,null));};exports['addAgents']=function(_0x4825a7,_0x5ed2eb){return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x4825a7[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5ed2eb,null))[_0xed2f('0x15')](function(_0x50b86d){if(_0x50b86d){return _0x50b86d[_0xed2f('0x128')](_0x4825a7[_0xed2f('0x4b')][_0xed2f('0x62')],_[_0xed2f('0xec')](_0x4825a7['body'],[_0xed2f('0x62'),'id'])||{})[_0xed2f('0xc8')](function(_0x491bc4){for(var _0x4436e9=0x0;_0x4436e9<_0x4825a7[_0xed2f('0x4b')][_0xed2f('0x62')]['length'];_0x4436e9+=0x1){socket[_0xed2f('0x129')](_0xed2f('0x12a'),{'UserId':Number(_0x4825a7[_0xed2f('0x4b')][_0xed2f('0x62')][_0x4436e9]),'ChatWebsiteId':Number(_0x4825a7[_0xed2f('0x47')]['id'])});}return _0x491bc4;});}})[_0xed2f('0x15')](respondWithResult(_0x5ed2eb,null))[_0xed2f('0x1f')](handleError(_0x5ed2eb,null));};exports[_0xed2f('0x12b')]=function(_0x4b0ff6,_0x37e899){return db[_0xed2f('0x44')]['find']({'where':{'id':_0x4b0ff6[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x37e899,null))['then'](function(_0x31eeb8){if(_0x31eeb8){return _0x31eeb8[_0xed2f('0x12b')](_0x4b0ff6[_0xed2f('0x33')][_0xed2f('0x62')])['then'](function(){if(_[_0xed2f('0x12c')](_0x4b0ff6[_0xed2f('0x33')][_0xed2f('0x62')])){for(var _0x3bfeb4=0x0;_0x3bfeb4<_0x4b0ff6[_0xed2f('0x33')]['ids']['length'];_0x3bfeb4+=0x1){socket[_0xed2f('0x129')](_0xed2f('0x12d'),{'UserId':Number(_0x4b0ff6['query'][_0xed2f('0x62')][_0x3bfeb4]),'ChatWebsiteId':Number(_0x4b0ff6[_0xed2f('0x47')]['id'])});}}else{socket[_0xed2f('0x129')]('userChatWebsite:remove',{'UserId':Number(_0x4b0ff6[_0xed2f('0x33')]['ids']),'ChatWebsiteId':Number(_0x4b0ff6[_0xed2f('0x47')]['id'])});}});}})[_0xed2f('0x15')](respondWithStatusCode(_0x37e899,null))['catch'](handleError(_0x37e899,null));};exports[_0xed2f('0x12e')]=function(_0x4e1603,_0x4ba4f3){var _0x41b4f1={};var _0x2181ac={};var _0x4974a7;var _0x1f8a39;return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x4e1603['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x4ba4f3,null))[_0xed2f('0x15')](function(_0x41653d){if(_0x41653d){_0x4974a7=_0x41653d;_0x2181ac[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['User'][_0xed2f('0x48')]);_0x2181ac[_0xed2f('0x33')]=_['keys'](_0x4e1603[_0xed2f('0x33')]);_0x2181ac[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x2181ac[_0xed2f('0x36')],_0x2181ac[_0xed2f('0x33')]);_0x41b4f1['attributes']=_[_0xed2f('0x35')](_0x2181ac[_0xed2f('0x36')],qs['fields'](_0x4e1603[_0xed2f('0x33')][_0xed2f('0x38')]));_0x41b4f1[_0xed2f('0x37')]=_0x41b4f1[_0xed2f('0x37')]['length']?_0x41b4f1['attributes']:_0x2181ac[_0xed2f('0x36')];_0x41b4f1['order']=qs[_0xed2f('0x3c')](_0x4e1603[_0xed2f('0x33')]['sort']);_0x41b4f1[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_['pick'](_0x4e1603[_0xed2f('0x33')],_0x2181ac[_0xed2f('0x3e')]));if(_0x4e1603[_0xed2f('0x33')][_0xed2f('0x42')]){_0x41b4f1[_0xed2f('0x3d')]=_['merge'](_0x41b4f1[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x41b4f1[_0xed2f('0x37')],function(_0x388b2d){var _0xa81edc={};_0xa81edc[_0x388b2d]={'$like':'%'+_0x4e1603[_0xed2f('0x33')]['filter']+'%'};return _0xa81edc;})});}_0x41b4f1=_[_0xed2f('0x40')]({},_0x41b4f1,_0x4e1603[_0xed2f('0x43')]);return _0x4974a7[_0xed2f('0x12e')](_0x41b4f1);}})[_0xed2f('0x15')](function(_0x34b8dc){if(_0x34b8dc){_0x1f8a39=_0x34b8dc[_0xed2f('0x39')];if(!_0x4e1603[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x41b4f1['limit']=qs[_0xed2f('0x25')](_0x4e1603['query']['limit']);_0x41b4f1['offset']=qs['offset'](_0x4e1603[_0xed2f('0x33')]['offset']);}return _0x4974a7[_0xed2f('0x12e')](_0x41b4f1);}})[_0xed2f('0x15')](function(_0x5e262a){if(_0x5e262a){return _0x5e262a?{'count':_0x1f8a39,'rows':_0x5e262a}:null;}})['then'](respondWithResult(_0x4ba4f3,null))[_0xed2f('0x1f')](handleError(_0x4ba4f3,null));}; \ No newline at end of file +var _0x7db4=['close','*,*,*,*','UserId','Start','startRouting','EventManager','offline','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','forwardOfflineAddress','service','host','secure','auth','pass','SendMail','\x22%s\x22\x20<%s>','MailAccountId','subjectOffline','toPairsIn','firstName','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','internal','color','tag','Command','interval','timezone','iftime\x20%s','indexOf','true','info','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','labelText','textColor','color_button','addApplications','Transaction','READ_COMMITTED','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','ChatWebsites','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','account','applications','Applications','List','orderBy','priority','asc','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push'];(function(_0x227d71,_0x19044b){var _0x33c663=function(_0x52bffd){while(--_0x52bffd){_0x227d71['push'](_0x227d71['shift']());}};_0x33c663(++_0x19044b);}(_0x7db4,0x193));var _0x47db=function(_0x498262,_0x2cda1e){_0x498262=_0x498262-0x0;var _0x3c9f08=_0x7db4[_0x498262];return _0x3c9f08;};'use strict';var BPromise=require(_0x47db('0x0'));var Mustache=require(_0x47db('0x1'));var util=require(_0x47db('0x2'));var path=require('path');var ejs=require(_0x47db('0x3'));var fs=require('fs');var fs_extra=require(_0x47db('0x4'));var _=require(_0x47db('0x5'));var querystring=require(_0x47db('0x6'));var Redis=require('ioredis');var qs=require(_0x47db('0x7'));var logger=require(_0x47db('0x8'))(_0x47db('0x9'));var config=require('../../config/environment');var db=require(_0x47db('0xa'))['db'];config[_0x47db('0xb')]=_[_0x47db('0xc')](config[_0x47db('0xb')],{'host':_0x47db('0xd'),'port':0x18eb});var socket=require(_0x47db('0xe'))(new Redis(config['redis']));require(_0x47db('0xf'))[_0x47db('0x10')](socket);var jayson=require(_0x47db('0x11'));var client=jayson[_0x47db('0x12')][_0x47db('0x13')]({'port':0x232c});var client9002=jayson[_0x47db('0x12')][_0x47db('0x13')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x47db('0x12')][_0x47db('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x1be61e,_0x4314b3,_0x5b6556,_0x57d37e){return new BPromise(function(_0x37a84c,_0x53b022){var _0x11e12d=_0x57d37e||client;return _0x11e12d[_0x47db('0x14')](_0x1be61e,_0x5b6556)[_0x47db('0x15')](function(_0x30170b){logger['info'](_0x47db('0x16'),_0x4314b3,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4314b3,'request\x20sent',JSON[_0x47db('0x17')](_0x30170b));if(_0x30170b[_0x47db('0x18')]){if(_0x30170b[_0x47db('0x18')][_0x47db('0x19')]===0x1f4){logger[_0x47db('0x18')](_0x47db('0x16'),_0x4314b3,_0x30170b[_0x47db('0x18')]['message']);return _0x53b022(_0x30170b['error']['message']);}logger[_0x47db('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x4314b3,_0x30170b['error'][_0x47db('0x1a')]);return _0x37a84c(_0x30170b['error'][_0x47db('0x1a')]);}else{logger['info'](_0x47db('0x16'),_0x4314b3,_0x47db('0x1b'));_0x37a84c(_0x30170b[_0x47db('0x1c')][_0x47db('0x1a')]);}})[_0x47db('0x1d')](function(_0x73a4c7){logger[_0x47db('0x18')](_0x47db('0x16'),_0x4314b3,_0x73a4c7);_0x53b022(_0x73a4c7);});});}function respondWithStatusCode(_0x3bb8fc,_0x4dc509){_0x4dc509=_0x4dc509||0xcc;return function(_0x40402b){if(_0x40402b){return _0x3bb8fc['sendStatus'](_0x4dc509);}return _0x3bb8fc[_0x47db('0x1e')](_0x4dc509)['end']();};}function respondWithResult(_0x3c8248,_0xd6d4ae){_0xd6d4ae=_0xd6d4ae||0xc8;return function(_0x1416cd){if(_0x1416cd){return _0x3c8248[_0x47db('0x1e')](_0xd6d4ae)['json'](_0x1416cd);}};}function respondWithFilteredResult(_0xc4bc54,_0x1f70af){return function(_0x395f3b){if(_0x395f3b){var _0x1b87a5=typeof _0x1f70af[_0x47db('0x1f')]===_0x47db('0x20')&&typeof _0x1f70af[_0x47db('0x21')]==='undefined';var _0x48616f=_0x395f3b[_0x47db('0x22')];var _0x43f866=_0x1b87a5?0x0:_0x1f70af[_0x47db('0x1f')];var _0x308c84=_0x1b87a5?_0x395f3b[_0x47db('0x22')]:_0x1f70af['offset']+_0x1f70af[_0x47db('0x21')];var _0x437c30;if(_0x308c84>=_0x48616f){_0x308c84=_0x48616f;_0x437c30=0xc8;}else{_0x437c30=0xce;}_0xc4bc54[_0x47db('0x1e')](_0x437c30);return _0xc4bc54[_0x47db('0x23')](_0x47db('0x24'),_0x43f866+'-'+_0x308c84+'/'+_0x48616f)[_0x47db('0x25')](_0x395f3b);}return null;};}function saveUpdates(_0x1fb439){return function(_0x4a4de6){if(_0x4a4de6){return _0x4a4de6[_0x47db('0x26')](_0x1fb439)['then'](function(_0x3d826e){return _0x3d826e;});}return null;};}function removeEntity(_0x3b3400){return function(_0x472245){if(_0x472245){return _0x472245[_0x47db('0x27')]()[_0x47db('0x15')](function(){var _0x26792a=_0x472245['get']({'plain':!![]});var _0x594133=_0x47db('0x28');return db['UserProfileResource'][_0x47db('0x27')]({'where':{'type':_0x594133,'resourceId':_0x26792a['id']}})[_0x47db('0x15')](function(){return _0x472245;});})[_0x47db('0x15')](function(){_0x3b3400[_0x47db('0x1e')](0xcc)[_0x47db('0x29')]();});}};}function handleEntityNotFound(_0x2d19f3){return function(_0x24fcc7){if(!_0x24fcc7){_0x2d19f3[_0x47db('0x2a')](0x194);}return _0x24fcc7;};}function handleError(_0x2b0d2a,_0x4668e2){_0x4668e2=_0x4668e2||0x1f4;return function(_0x428156){logger[_0x47db('0x18')](_0x428156[_0x47db('0x2b')]);if(_0x428156[_0x47db('0x2c')]){delete _0x428156[_0x47db('0x2c')];}_0x2b0d2a[_0x47db('0x1e')](_0x4668e2)[_0x47db('0x2d')](_0x428156);};}exports[_0x47db('0x2e')]=function(_0x54e49d,_0xac37ac){var _0x307d73={'include':[{'model':db[_0x47db('0x2f')],'as':_0x47db('0x30')}]},_0x3713ae={},_0x2a3303={'count':0x0,'rows':[]};var _0x20e4a0=_['map'](db[_0x47db('0x31')][_0x47db('0x32')],function(_0x1ea643){return{'name':_0x1ea643[_0x47db('0x33')],'type':_0x1ea643[_0x47db('0x34')][_0x47db('0x35')]};});_0x3713ae[_0x47db('0x36')]=_[_0x47db('0x37')](_0x20e4a0,'name');_0x3713ae[_0x47db('0x38')]=_[_0x47db('0x39')](_0x54e49d[_0x47db('0x38')]);_0x3713ae[_0x47db('0x3a')]=_['intersection'](_0x3713ae[_0x47db('0x36')],_0x3713ae['query']);_0x307d73[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x3713ae[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x54e49d[_0x47db('0x38')]['fields']));_0x307d73[_0x47db('0x3b')]=_0x307d73[_0x47db('0x3b')][_0x47db('0x3e')]?_0x307d73['attributes']:_0x3713ae[_0x47db('0x36')];if(!_0x54e49d['query'][_0x47db('0x3f')](_0x47db('0x40'))){_0x307d73[_0x47db('0x21')]=qs['limit'](_0x54e49d['query'][_0x47db('0x21')]);_0x307d73[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x54e49d[_0x47db('0x38')][_0x47db('0x1f')]);}_0x307d73[_0x47db('0x41')]=qs['sort'](_0x54e49d[_0x47db('0x38')][_0x47db('0x42')]);_0x307d73[_0x47db('0x43')]=qs[_0x47db('0x3a')](_['pick'](_0x54e49d[_0x47db('0x38')],_0x3713ae['filters']),_0x20e4a0);if(_0x54e49d['query'][_0x47db('0x44')]){_0x307d73[_0x47db('0x43')]=_[_0x47db('0x45')](_0x307d73['where'],{'$or':_[_0x47db('0x37')](_0x20e4a0,function(_0x57b7d2){if(_0x57b7d2[_0x47db('0x34')]!==_0x47db('0x46')){var _0x1f6257={};_0x1f6257[_0x57b7d2[_0x47db('0x2c')]]={'$like':'%'+_0x54e49d[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0x1f6257;}})});}_0x307d73=_[_0x47db('0x45')]({},_0x307d73,_0x54e49d[_0x47db('0x47')]);var _0x14ec65={'where':_0x307d73[_0x47db('0x43')]};return db[_0x47db('0x31')][_0x47db('0x22')](_0x14ec65)[_0x47db('0x15')](function(_0x56f6b1){_0x2a3303[_0x47db('0x22')]=_0x56f6b1;if(_0x54e49d['query'][_0x47db('0x48')]){_0x307d73[_0x47db('0x49')]=[{'all':!![]}];}return db[_0x47db('0x31')][_0x47db('0x4a')](_0x307d73);})[_0x47db('0x15')](function(_0x26c6a4){_0x2a3303[_0x47db('0x4b')]=_0x26c6a4;return _0x2a3303;})[_0x47db('0x15')](respondWithFilteredResult(_0xac37ac,_0x307d73))[_0x47db('0x1d')](handleError(_0xac37ac,null));};exports['show']=function(_0x53f6db,_0x56058d){var _0x48bb48={'raw':![],'where':{'id':_0x53f6db['params']['id']},'include':[{'model':db[_0x47db('0x2f')],'as':_0x47db('0x30')}]},_0x342ae0={};_0x342ae0[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0x31')][_0x47db('0x32')]);_0x342ae0[_0x47db('0x38')]=_[_0x47db('0x39')](_0x53f6db[_0x47db('0x38')]);_0x342ae0[_0x47db('0x3a')]=_[_0x47db('0x3c')](_0x342ae0[_0x47db('0x36')],_0x342ae0['query']);_0x48bb48[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x342ae0[_0x47db('0x36')],qs['fields'](_0x53f6db[_0x47db('0x38')]['fields']));_0x48bb48[_0x47db('0x3b')]=_0x48bb48[_0x47db('0x3b')][_0x47db('0x3e')]?_0x48bb48['attributes']:_0x342ae0[_0x47db('0x36')];if(_0x53f6db[_0x47db('0x38')][_0x47db('0x48')]){_0x48bb48[_0x47db('0x49')]=[{'all':!![]}];}_0x48bb48=_['merge']({},_0x48bb48,_0x53f6db[_0x47db('0x47')]);return db['ChatWebsite'][_0x47db('0x4c')](_0x48bb48)[_0x47db('0x15')](handleEntityNotFound(_0x56058d,null))[_0x47db('0x15')](respondWithResult(_0x56058d,null))[_0x47db('0x1d')](handleError(_0x56058d,null));};exports['create']=function(_0x3a9922,_0xec085d){return db[_0x47db('0x31')][_0x47db('0x4d')](_0x3a9922['body'],{})['then'](function(_0x56f73a){var _0x170b9b=_0x3a9922['user'][_0x47db('0x4e')]({'plain':!![]});if(!_0x170b9b)throw new Error(_0x47db('0x4f'));if(_0x170b9b[_0x47db('0x50')]===_0x47db('0x51')){var _0x53acc0=_0x56f73a['get']({'plain':!![]});var _0x171c83='ChatWebsites';return db[_0x47db('0x52')][_0x47db('0x4c')]({'where':{'name':_0x171c83,'userProfileId':_0x170b9b[_0x47db('0x53')]},'raw':!![]})[_0x47db('0x15')](function(_0x2ac531){if(_0x2ac531&&_0x2ac531[_0x47db('0x54')]===0x0){return db[_0x47db('0x55')][_0x47db('0x4d')]({'name':_0x53acc0[_0x47db('0x2c')],'resourceId':_0x53acc0['id'],'type':_0x2ac531[_0x47db('0x2c')],'sectionId':_0x2ac531['id']},{})[_0x47db('0x15')](function(){return _0x56f73a;});}else{return _0x56f73a;}})[_0x47db('0x1d')](function(_0x4fd0ba){logger[_0x47db('0x18')](_0x47db('0x56'),_0x4fd0ba);throw _0x4fd0ba;});}return _0x56f73a;})[_0x47db('0x15')](respondWithResult(_0xec085d,0xc9))[_0x47db('0x1d')](handleError(_0xec085d,null));};exports[_0x47db('0x26')]=function(_0x489ee7,_0x3ccdb7){if(_0x489ee7[_0x47db('0x57')]['id']){delete _0x489ee7['body']['id'];}return db['ChatWebsite'][_0x47db('0x4c')]({'where':{'id':_0x489ee7[_0x47db('0x58')]['id']},'include':[{'model':db[_0x47db('0x2f')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3ccdb7,null))[_0x47db('0x15')](saveUpdates(_0x489ee7[_0x47db('0x57')],null))['then'](respondWithResult(_0x3ccdb7,null))[_0x47db('0x1d')](handleError(_0x3ccdb7,null));};exports['destroy']=function(_0x29a365,_0xda4a8f){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x29a365[_0x47db('0x58')]['id']}})['then'](handleEntityNotFound(_0xda4a8f,null))[_0x47db('0x15')](removeEntity(_0xda4a8f,null))['catch'](handleError(_0xda4a8f,null));};exports[_0x47db('0x59')]=function(_0x5e7da5,_0x4ab4a0){return db['ChatWebsite'][_0x47db('0x59')]()[_0x47db('0x15')](respondWithResult(_0x4ab4a0,null))[_0x47db('0x1d')](handleError(_0x4ab4a0,null));};exports[_0x47db('0x5a')]=function(_0x145284,_0x5f14ac){if(_0x145284['body']['id']){delete _0x145284[_0x47db('0x57')]['id'];}return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x145284['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x5f14ac,null))[_0x47db('0x15')](function(_0x5a91a7){if(_0x5a91a7){_0x145284[_0x47db('0x57')][_0x47db('0x5b')]=_0x5a91a7['id'];return db[_0x47db('0x5c')][_0x47db('0x4d')](_0x145284[_0x47db('0x57')]);}})[_0x47db('0x15')](respondWithResult(_0x5f14ac,null))[_0x47db('0x1d')](handleError(_0x5f14ac,null));};exports[_0x47db('0x5d')]=function(_0x2fc8b2,_0x51651d){var _0x1852c2={'raw':![],'where':{}};var _0x57a3df={};var _0x2f5e67={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x47db('0x5e')]({'where':{'id':_0x2fc8b2[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x51651d,null))[_0x47db('0x15')](function(_0x5b6a84){if(_0x5b6a84){_0x57a3df[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0x5c')][_0x47db('0x32')]);_0x57a3df[_0x47db('0x38')]=_[_0x47db('0x39')](_0x2fc8b2[_0x47db('0x38')]);_0x57a3df[_0x47db('0x3a')]=_['intersection'](_0x57a3df['model'],_0x57a3df[_0x47db('0x38')]);_0x1852c2[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x57a3df[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x2fc8b2['query'][_0x47db('0x3d')]));_0x1852c2[_0x47db('0x3b')]=_0x1852c2['attributes']['length']?_0x1852c2[_0x47db('0x3b')]:_0x57a3df[_0x47db('0x36')];if(!_0x2fc8b2[_0x47db('0x38')][_0x47db('0x3f')](_0x47db('0x40'))){_0x1852c2['limit']=qs[_0x47db('0x21')](_0x2fc8b2[_0x47db('0x38')][_0x47db('0x21')]);_0x1852c2[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x2fc8b2[_0x47db('0x38')][_0x47db('0x1f')]);}_0x1852c2[_0x47db('0x41')]=qs[_0x47db('0x42')](_0x2fc8b2[_0x47db('0x38')][_0x47db('0x42')]);_0x1852c2[_0x47db('0x43')]=qs[_0x47db('0x3a')](_['pick'](_0x2fc8b2[_0x47db('0x38')],_0x57a3df[_0x47db('0x3a')]));_0x1852c2['where'][_0x47db('0x5b')]=_0x5b6a84['id'];if(_0x2fc8b2[_0x47db('0x38')]['filter']){_0x1852c2['where']=_[_0x47db('0x45')](_0x1852c2[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x1852c2[_0x47db('0x3b')],function(_0xdc935f){var _0xca722b={};_0xca722b[_0xdc935f]={'$like':'%'+_0x2fc8b2[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0xca722b;})});}_0x1852c2=_[_0x47db('0x45')]({},_0x1852c2,_0x2fc8b2[_0x47db('0x47')]);return db[_0x47db('0x5c')][_0x47db('0x22')]({'where':_0x1852c2['where']})[_0x47db('0x15')](function(_0x281e08){_0x2f5e67[_0x47db('0x22')]=_0x281e08;if(_0x2fc8b2[_0x47db('0x38')][_0x47db('0x48')]){_0x1852c2[_0x47db('0x49')]=[{'all':!![]}];}return db[_0x47db('0x5c')]['findAll'](_0x1852c2);})[_0x47db('0x15')](function(_0x1e08da){_0x2f5e67[_0x47db('0x4b')]=_0x1e08da;return _0x2f5e67;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x51651d,_0x1852c2))['catch'](handleError(_0x51651d,null));};exports['removeDispositions']=function(_0x2479ea,_0x226d84){return db[_0x47db('0x31')]['find']({'where':{'id':_0x2479ea[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x226d84,null))[_0x47db('0x15')](function(_0x849df9){if(_0x849df9){return _0x849df9[_0x47db('0x5f')](_0x2479ea['query'][_0x47db('0x60')]);}})[_0x47db('0x15')](respondWithStatusCode(_0x226d84,null))[_0x47db('0x1d')](handleError(_0x226d84,null));};exports[_0x47db('0x61')]=function(_0x4ee027,_0x17912b){if(_0x4ee027[_0x47db('0x57')]['id']){delete _0x4ee027[_0x47db('0x57')]['id'];}return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x4ee027[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x17912b,null))['then'](function(_0x426842){if(_0x426842){_0x4ee027[_0x47db('0x57')][_0x47db('0x5b')]=_0x426842['id'];return db[_0x47db('0x62')][_0x47db('0x4d')](_0x4ee027[_0x47db('0x57')]);}})[_0x47db('0x15')](respondWithResult(_0x17912b,null))['catch'](handleError(_0x17912b,null));};exports[_0x47db('0x63')]=function(_0x5bdb94,_0x1e17ed){var _0x4cddfe={'raw':![],'where':{}};var _0x2e0617={};var _0x329e91={'count':0x0,'rows':[]};return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x5bdb94['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x1e17ed,null))[_0x47db('0x15')](function(_0x29ee2c){if(_0x29ee2c){_0x2e0617[_0x47db('0x36')]=_[_0x47db('0x39')](db['CannedAnswer'][_0x47db('0x32')]);_0x2e0617['query']=_['keys'](_0x5bdb94['query']);_0x2e0617[_0x47db('0x3a')]=_['intersection'](_0x2e0617[_0x47db('0x36')],_0x2e0617['query']);_0x4cddfe[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x2e0617[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x5bdb94[_0x47db('0x38')][_0x47db('0x3d')]));_0x4cddfe[_0x47db('0x3b')]=_0x4cddfe[_0x47db('0x3b')]['length']?_0x4cddfe[_0x47db('0x3b')]:_0x2e0617[_0x47db('0x36')];if(!_0x5bdb94[_0x47db('0x38')][_0x47db('0x3f')]('nolimit')){_0x4cddfe[_0x47db('0x21')]=qs[_0x47db('0x21')](_0x5bdb94['query']['limit']);_0x4cddfe[_0x47db('0x1f')]=qs['offset'](_0x5bdb94[_0x47db('0x38')][_0x47db('0x1f')]);}_0x4cddfe['order']=qs[_0x47db('0x42')](_0x5bdb94[_0x47db('0x38')][_0x47db('0x42')]);_0x4cddfe['where']=qs[_0x47db('0x3a')](_[_0x47db('0x64')](_0x5bdb94[_0x47db('0x38')],_0x2e0617[_0x47db('0x3a')]));_0x4cddfe['where'][_0x47db('0x5b')]=_0x29ee2c['id'];if(_0x5bdb94['query'][_0x47db('0x44')]){_0x4cddfe['where']=_[_0x47db('0x45')](_0x4cddfe[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x4cddfe['attributes'],function(_0x5cf08d){var _0x49b4da={};_0x49b4da[_0x5cf08d]={'$like':'%'+_0x5bdb94['query']['filter']+'%'};return _0x49b4da;})});}_0x4cddfe=_['merge']({},_0x4cddfe,_0x5bdb94[_0x47db('0x47')]);return db[_0x47db('0x62')][_0x47db('0x22')]({'where':_0x4cddfe[_0x47db('0x43')]})[_0x47db('0x15')](function(_0x1433f1){_0x329e91['count']=_0x1433f1;if(_0x5bdb94[_0x47db('0x38')]['includeAll']){_0x4cddfe[_0x47db('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0x47db('0x4a')](_0x4cddfe);})[_0x47db('0x15')](function(_0x438e68){_0x329e91[_0x47db('0x4b')]=_0x438e68;return _0x329e91;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x1e17ed,_0x4cddfe))[_0x47db('0x1d')](handleError(_0x1e17ed,null));};exports[_0x47db('0x65')]=function(_0x486f1e,_0x2efa0c){return db['ChatWebsite'][_0x47db('0x4c')]({'where':{'id':_0x486f1e[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2efa0c,null))['then'](function(_0x28f6e8){if(_0x28f6e8){return _0x28f6e8['removeAnswers'](_0x486f1e[_0x47db('0x38')][_0x47db('0x60')]);}})[_0x47db('0x15')](respondWithStatusCode(_0x2efa0c,null))[_0x47db('0x1d')](handleError(_0x2efa0c,null));};exports[_0x47db('0x66')]=function(_0x41f4d0,_0x4aa0c3){_0x41f4d0[_0x47db('0x57')][_0x47db('0x67')]=_0x41f4d0[_0x47db('0x68')]['filename'];return db[_0x47db('0x31')]['find']({'where':{'id':_0x41f4d0['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x4aa0c3,null))[_0x47db('0x15')](saveUpdates(_0x41f4d0[_0x47db('0x57')],null))[_0x47db('0x15')](respondWithResult(_0x4aa0c3,null))[_0x47db('0x1d')](handleError(_0x4aa0c3,null));};exports[_0x47db('0x69')]=function(_0x459f05,_0x382ec8){_0x459f05[_0x47db('0x57')][_0x47db('0x6a')]=_0x459f05[_0x47db('0x68')]['filename'];return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x459f05[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x382ec8,null))['then'](saveUpdates(_0x459f05['body'],null))[_0x47db('0x15')](respondWithResult(_0x382ec8,null))[_0x47db('0x1d')](handleError(_0x382ec8,null));};exports['addCustomerAvatar']=function(_0x8faf2e,_0x2e4315){_0x8faf2e[_0x47db('0x57')]['customerAvatar']=_0x8faf2e['file'][_0x47db('0x6b')];return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x8faf2e[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2e4315,null))[_0x47db('0x15')](saveUpdates(_0x8faf2e[_0x47db('0x57')],null))[_0x47db('0x15')](respondWithResult(_0x2e4315,null))[_0x47db('0x1d')](handleError(_0x2e4315,null));};exports[_0x47db('0x6c')]=function(_0x5559df,_0x2978da){_0x5559df[_0x47db('0x57')][_0x47db('0x6d')]=_0x5559df[_0x47db('0x68')][_0x47db('0x6b')];return db[_0x47db('0x31')]['find']({'where':{'id':_0x5559df[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2978da,null))[_0x47db('0x15')](saveUpdates(_0x5559df[_0x47db('0x57')],null))[_0x47db('0x15')](respondWithResult(_0x2978da,null))['catch'](handleError(_0x2978da,null));};exports[_0x47db('0x6e')]=function(_0x28e3f8,_0x3257ab){var _0x4edd0f=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x71'));var _0x44e393={'where':{'id':_0x28e3f8[_0x47db('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x298ea1=![];return require('../../config/license/util')[_0x47db('0x72')]()[_0x47db('0x15')](function(_0x47d605){if(_0x47d605){_0x298ea1=_0x47d605[_0x47db('0x73')];}})[_0x47db('0x15')](function(){return db[_0x47db('0x31')][_0x47db('0x4c')](_0x44e393);})[_0x47db('0x15')](handleEntityNotFound(_0x3257ab,null))[_0x47db('0x15')](function(_0x118645){if(_0x118645){if(!_[_0x47db('0x74')](_0x118645['sitepic'])){if(fs['existsSync'](path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x75'),_0x118645[_0x47db('0x67')]))&&_0x298ea1){_0x4edd0f=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x75'),_0x118645[_0x47db('0x67')]);}}return _0x3257ab[_0x47db('0x76')](_0x4edd0f);}})[_0x47db('0x1d')](handleError(_0x3257ab,null));};exports['getAvatar']=function(_0x21b0a7,_0x1431b1){var _0xa50a53=path[_0x47db('0x6f')](config['root'],_0x47db('0x77'));var _0x49da8a={'where':{'id':_0x21b0a7[_0x47db('0x58')]['id']},'attributes':['id',_0x47db('0x6a')],'raw':!![]};return db[_0x47db('0x31')][_0x47db('0x4c')](_0x49da8a)[_0x47db('0x15')](handleEntityNotFound(_0x1431b1,null))[_0x47db('0x15')](function(_0x5b48e4){if(_0x5b48e4){if(!_['isNil'](_0x5b48e4[_0x47db('0x6a')])){if(fs[_0x47db('0x78')](path[_0x47db('0x6f')](config[_0x47db('0x70')],'server/files/images/avatars/',_0x5b48e4[_0x47db('0x6a')]))){_0xa50a53=path[_0x47db('0x6f')](config['root'],_0x47db('0x79'),_0x5b48e4[_0x47db('0x6a')]);}}return _0x1431b1['download'](_0xa50a53);}})['catch'](handleError(_0x1431b1,null));};exports[_0x47db('0x7a')]=function(_0x25fa50,_0x45732e){var _0x18d8b6=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x7b'));var _0x33ae54={'where':{'id':_0x25fa50[_0x47db('0x58')]['id']},'attributes':['id',_0x47db('0x7c'),_0x47db('0x7d')],'raw':!![]};return db['ChatWebsite']['find'](_0x33ae54)[_0x47db('0x15')](handleEntityNotFound(_0x45732e,null))[_0x47db('0x15')](function(_0x4934a4){if(_0x4934a4){if(!_['isNil'](_0x4934a4[_0x47db('0x7c')])){if(fs[_0x47db('0x78')](path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x79'),_0x4934a4[_0x47db('0x7c')]))&&_0x4934a4[_0x47db('0x7d')]){_0x18d8b6=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x79'),_0x4934a4[_0x47db('0x7c')]);}}return _0x45732e[_0x47db('0x76')](_0x18d8b6);}})[_0x47db('0x1d')](handleError(_0x45732e,null));};exports[_0x47db('0x7e')]=function(_0x592869,_0x3e6017){var _0x59d8e6=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x7f'));var _0x2f2966={'where':{'id':_0x592869[_0x47db('0x58')]['id']},'attributes':['id',_0x47db('0x6d')],'raw':!![]};return db[_0x47db('0x31')][_0x47db('0x4c')](_0x2f2966)[_0x47db('0x15')](handleEntityNotFound(_0x3e6017,null))['then'](function(_0x380f22){if(_0x380f22){if(!_['isNil'](_0x380f22[_0x47db('0x6d')])){if(fs[_0x47db('0x78')](path['join'](config[_0x47db('0x70')],'server/files/images/avatars/',_0x380f22['systemAvatar']))){_0x59d8e6=path['join'](config[_0x47db('0x70')],_0x47db('0x79'),_0x380f22['systemAvatar']);}}return _0x3e6017['download'](_0x59d8e6);}})[_0x47db('0x1d')](handleError(_0x3e6017,null));};exports['notify']=function(_0x137ced,_0x18b980){var _0x63d215=require(_0x47db('0x80'));var _0x44a33f=new _0x63d215();var _0x532851=_0x44a33f['setUA'](_0x137ced['headers'][_0x47db('0x81')])[_0x47db('0x82')]();var _0xf1181c={'body':_0x137ced['body'],'channel':_0x47db('0x83')};var _0x17b91=[];var _0x62d395=[];var _0x545ef7={};var _0x2cceef=![];return db[_0x47db('0x84')][_0x47db('0x59')]()[_0x47db('0x15')](function(_0x4bbd0b){if(!_0x4bbd0b){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x87'));}_0x17b91=_[_0x47db('0x88')](_[_0x47db('0x39')](_0x4bbd0b),['createdAt',_0x47db('0x89')]);_0x62d395=_[_0x47db('0x88')](_[_0x47db('0x39')](_0x4bbd0b),['createdAt',_0x47db('0x89'),_0x47db('0x8a'),_0x47db('0x8b')]);if(_0x137ced[_0x47db('0x57')]['id']){delete _0x137ced['body']['id'];}if(_[_0x47db('0x74')](_0x137ced[_0x47db('0x57')][_0x47db('0x8c')])){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x8d'));}if(_[_0x47db('0x74')](_0x137ced['body'][_0x47db('0x57')])||_0x137ced['body']['body']===''){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x8e'));}if(_[_0x47db('0x74')](_0x137ced[_0x47db('0x57')][_0x47db('0x8f')])){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x90')+_0x62d395);}if(!_[_0x47db('0x91')](_0x62d395,_0x137ced[_0x47db('0x57')]['mapKey'])){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x92')+_0x62d395);}_0x545ef7[_0x137ced[_0x47db('0x57')][_0x47db('0x8f')]]=_0x137ced[_0x47db('0x57')][_0x47db('0x8c')];})['then'](function(){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x137ced[_0x47db('0x58')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47db('0x84')],'as':_0x47db('0x93'),'where':_0x545ef7,'limit':0x1,'order':[[_0x47db('0x89'),_0x47db('0x94')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x47db('0x15')](handleEntityNotFound(_0x18b980,null))[_0x47db('0x15')](function(_0xe9cff7){if(_0xe9cff7&&_0xe9cff7['List']){_0xf1181c[_0x47db('0x95')]=_0xe9cff7;_0xf1181c[_0x47db('0x96')]=_0xe9cff7[_0x47db('0x97')];_0xf1181c['list']=_0xe9cff7[_0x47db('0x98')];_0xf1181c[_0x47db('0x96')]=_[_0x47db('0x99')](_0xf1181c[_0x47db('0x96')],[_0x47db('0x9a')],[_0x47db('0x9b')]);if(_0xf1181c[_0x47db('0x95')][_0x47db('0x97')]){delete _0xf1181c[_0x47db('0x95')]['Applications'];}if(_0xf1181c[_0x47db('0x95')][_0x47db('0x98')]&&_0xf1181c[_0x47db('0x95')][_0x47db('0x98')][_0x47db('0x93')][_0x47db('0x3e')]){return _0xf1181c[_0x47db('0x95')]['List'][_0x47db('0x93')][0x0];}var _0xdd2f8b=_[_0x47db('0xc')](_0x137ced[_0x47db('0x57')],{'firstName':_0x137ced[_0x47db('0x57')]['from'],'ListId':_0xe9cff7[_0x47db('0x8b')]});_0xdd2f8b[_0x137ced[_0x47db('0x57')][_0x47db('0x8f')]]=_0x137ced['body'][_0x47db('0x8c')];return db['CmContact']['create'](_0xdd2f8b,{'fields':_0x17b91,'raw':!![]});}})[_0x47db('0x15')](handleEntityNotFound(_0x18b980,null))[_0x47db('0x15')](function(_0x11c567){_0xf1181c[_0x47db('0x9c')]=_0x11c567;var _0x3e18ca=_0x137ced[_0x47db('0x57')]['customerIp'];if(_0x137ced[_0x47db('0x9d')][_0x47db('0x9e')]){_0x3e18ca=_0x137ced['headers'][_0x47db('0x9e')];}else if(_0x137ced['headers'][_0x47db('0x9f')]){_0x3e18ca=_[_0x47db('0xa0')](_0x137ced[_0x47db('0x9d')][_0x47db('0x9f')][_0x47db('0xa1')](','));}if(_0x11c567){var _0x3c57d2={'ContactId':_0x11c567['id'],'ChatWebsiteId':_0x137ced[_0x47db('0x58')]['id'],'from':(_0x11c567['firstName']||'')+'\x20'+(_0x11c567['lastName']||''),'customerIp':_0x3e18ca,'customerPort':_0x137ced[_0x47db('0x9d')]['x-real-port']?_0x137ced['headers']['x-real-port']:null,'referer':_0x137ced[_0x47db('0x57')]['referer'],'browserName':_0x532851['browser'][_0x47db('0x2c')]&&_0x532851[_0x47db('0xa2')][_0x47db('0xa3')]?util[_0x47db('0xa4')](_0x47db('0xa5'),_0x532851['browser'][_0x47db('0x2c')],_0x532851[_0x47db('0xa2')][_0x47db('0xa3')]):_0x47db('0xa6'),'browserVersion':_0x532851[_0x47db('0xa2')][_0x47db('0xa3')]||_0x47db('0xa6'),'osName':util[_0x47db('0xa4')](_0x47db('0xa5'),_0x532851['os'][_0x47db('0x2c')],_0x532851['os'][_0x47db('0xa3')]),'osVersion':_0x532851['os']['version'],'deviceModel':_0x532851[_0x47db('0xa7')]['model']&&_0x532851['device'][_0x47db('0xa8')]?util[_0x47db('0xa4')](_0x47db('0xa9'),_0x532851['device'][_0x47db('0x36')],_0x532851[_0x47db('0xa7')][_0x47db('0xa8')],_0x532851[_0x47db('0xa7')]['type']):null,'deviceVendor':_0x532851['device'][_0x47db('0xa8')],'deviceType':_0x532851[_0x47db('0xa7')]['type'],'formData':JSON[_0x47db('0x17')](_0x137ced[_0x47db('0x57')])};var _0x335d21={'ChatWebsiteId':_0x137ced['params']['id'],'closed':![]};if(_0x137ced[_0x47db('0x57')][_0x47db('0xaa')]){_0x335d21[_0x47db('0xaa')]=_0x137ced[_0x47db('0x57')][_0x47db('0xaa')];return db[_0x47db('0xab')][_0x47db('0x4c')]({'where':_0x335d21})[_0x47db('0x15')](function(_0x282a18){if(_0x282a18){return[_0x282a18,![]];}_0x3c57d2[_0x47db('0xaa')]=_0x137ced[_0x47db('0x57')][_0x47db('0xaa')];_0x3c57d2[_0x47db('0xac')]=_0x137ced[_0x47db('0x57')]['externalUrl'];return db[_0x47db('0xab')][_0x47db('0x4d')](_0x3c57d2)[_0x47db('0x15')](function(_0x35b02c){return[_0x35b02c,!![]];});});}_0x335d21[_0x47db('0xad')]=_0x11c567['id'];if(_0x137ced[_0x47db('0x57')][_0x47db('0xae')]&&_0x137ced[_0x47db('0x57')][_0x47db('0xae')]['id']){_0x335d21['id']=_0x137ced[_0x47db('0x57')][_0x47db('0xae')]['id'];return db[_0x47db('0xab')][_0x47db('0x4c')]({'where':_0x335d21})[_0x47db('0x15')](function(_0x261083){if(_0x261083){return[_0x261083,![]];}return db['ChatInteraction'][_0x47db('0x4d')](_0x3c57d2)['then'](function(_0x224e1d){return[_0x224e1d,!![]];});});}return db[_0x47db('0xab')][_0x47db('0x4d')](_0x3c57d2)[_0x47db('0x15')](function(_0x14a1de){return[_0x14a1de,!![]];});}})[_0x47db('0xaf')](function(_0x35a48f,_0x1257cb){if(_0x35a48f){_0x2cceef=_0x1257cb;if(!_0x1257cb){var _0x5bc7f0={'from':(_0xf1181c['contact']['firstName']||'')+'\x20'+(_0xf1181c[_0x47db('0x9c')][_0x47db('0xb0')]||'')};if(_0x137ced[_0x47db('0x57')][_0x47db('0xaa')]&&_0x137ced[_0x47db('0x57')][_0x47db('0xb1')]&&_0x137ced['body'][_0x47db('0xaa')]!=_0x137ced['body'][_0x47db('0xb1')]){_0x5bc7f0['threadId']=_0x137ced[_0x47db('0x57')][_0x47db('0xb1')];}return _0x35a48f['update'](_0x5bc7f0);}else{return _0x35a48f;}}})[_0x47db('0x15')](function(_0x3bc248){_0xf1181c[_0x47db('0xae')]=_0x3bc248[_0x47db('0x4e')]({'plain':!![]});_0xf1181c['interaction'][_0x47db('0xb2')]=_0x2cceef;if(_0xf1181c[_0x47db('0xae')][_0x47db('0xb2')]){if(_0xf1181c[_0x47db('0x95')][_0x47db('0xb3')]){_0xf1181c['applications'][_0x47db('0xb4')]({'id':0x0,'priority':_0xf1181c[_0x47db('0x96')][_0x47db('0x3e')]+0x1,'app':_0x47db('0xb5'),'appdata':'unmanaged','interval':_0x47db('0xb6')});}}return db['ChatMessage']['create']({'body':_0x137ced[_0x47db('0x57')]['body'],'ChatWebsiteId':_0x137ced[_0x47db('0x58')]['id'],'ChatInteractionId':_0x3bc248['id'],'direction':'in','ContactId':_0xf1181c[_0x47db('0x9c')]['id'],'AttachmentId':_0x137ced[_0x47db('0x57')]['AttachmentId']});})[_0x47db('0x15')](function(_0x1551eb){_0xf1181c['message']=_0x1551eb;if(_0xf1181c[_0x47db('0xae')][_0x47db('0xb7')]){return db['User']['find']({'attributes':['id',_0x47db('0x2c')],'where':{'id':_0xf1181c[_0x47db('0xae')]['UserId']}})['then'](function(_0x115011){if(_0x115011){_0xf1181c['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x115011[_0x47db('0x2c')]+','+(_0xf1181c[_0x47db('0x95')]['waitForTheAssignedAgent']||0xa),'interval':_0x47db('0xb6')});_0xf1181c['forcedOwnership']=!![];}return respondWithRpcPromise(_0x47db('0xb8'),_0x47db('0xb9'),_0xf1181c);});}return respondWithRpcPromise(_0x47db('0xb8'),_0x47db('0xb9'),_0xf1181c);})[_0x47db('0x15')](function(_0x21e0a1){respondWithRpcPromise(_0x47db('0xba'),'EventManager',{'event':'notify','message':_0x21e0a1},client9002);return _0x21e0a1;})[_0x47db('0x15')](respondWithResult(_0x18b980,null))['catch'](handleError(_0x18b980,null));};exports[_0x47db('0xbb')]=function(_0x16fe70,_0x54d4d7){var _0x5bb677,_0x12e30e,_0x50f360;var _0x3d7e18=[];var _0x762e7f={};var _0x2ba327=_0x16fe70[_0x47db('0xbc')]||[];var _0x16a7f1=[];var _0x4cb864;return db[_0x47db('0x84')]['describe']()[_0x47db('0x15')](function(_0x32b4e0){if(!_0x32b4e0){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x87'));}_0x3d7e18=_[_0x47db('0x88')](_[_0x47db('0x39')](_0x32b4e0),[_0x47db('0xbd'),_0x47db('0x89'),_0x47db('0x8a'),_0x47db('0x8b')]);if(_0x16fe70['body']['id']){delete _0x16fe70['body']['id'];}if(_[_0x47db('0x74')](_0x16fe70['body'][_0x47db('0x8c')])){throw _0x54d4d7['status'](0x1f4)[_0x47db('0x2d')](new db['Sequelize'][(_0x47db('0x86'))]('from\x20is\x20mandatory'));}if(_[_0x47db('0x74')](_0x16fe70[_0x47db('0x57')][_0x47db('0x57')])||_0x16fe70[_0x47db('0x57')][_0x47db('0x57')]===''){throw _0x54d4d7[_0x47db('0x1e')](0x1f4)['send'](new db[(_0x47db('0x85'))][(_0x47db('0x86'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x47db('0x74')](_0x16fe70[_0x47db('0x57')][_0x47db('0xbe')])){throw _0x54d4d7[_0x47db('0x1e')](0x1f4)[_0x47db('0x2d')](new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0xbf')+_0x3d7e18));}if(!_[_0x47db('0x91')](_0x3d7e18,_0x16fe70[_0x47db('0x57')]['mapKeyOffline'])){throw _0x54d4d7[_0x47db('0x1e')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x47db('0xc0')+_0x3d7e18));}_0x762e7f[_0x16fe70[_0x47db('0x57')][_0x47db('0xbe')]]=_0x16fe70[_0x47db('0x57')][_0x47db('0x8c')];})[_0x47db('0x15')](function(){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x16fe70[_0x47db('0x58')]['id']},'include':[{'model':db[_0x47db('0xc1')],'as':'List'},{'model':db[_0x47db('0xc2')],'as':_0x47db('0xc2')}]});})['then'](handleEntityNotFound(_0x54d4d7,null))[_0x47db('0x15')](function(_0x39f1d8){if(_0x39f1d8&&_0x39f1d8[_0x47db('0x98')]){_0x12e30e=_0x39f1d8;var _0x1cb7c4=_[_0x47db('0xc')](_0x16fe70[_0x47db('0x57')],{'firstName':_0x16fe70[_0x47db('0x57')][_0x47db('0x8c')],'phone':_0x16fe70['body']['from'],'ListId':_0x39f1d8['ListId']});_0x1cb7c4[_0x16fe70[_0x47db('0x57')]['mapKeyOffline']]=_0x16fe70[_0x47db('0x57')][_0x47db('0x8c')];return db[_0x47db('0x84')][_0x47db('0xc3')]({'where':_0x762e7f,'defaults':_0x1cb7c4});}})[_0x47db('0xaf')](function(_0x3bcd5c){if(_0x3bcd5c){_0x50f360=_0x3bcd5c;var _0x1e64b0=fs[_0x47db('0xc4')](path[_0x47db('0x6f')](config['root'],_0x47db('0xc5')),'utf8');var _0x2145eb=ejs[_0x47db('0xc6')](_0x1e64b0,{'body':_[_0x47db('0xc7')](_0x16fe70[_0x47db('0x57')]['body']),'bodyTitle':_0x12e30e[_0x47db('0xc8')]});return db[_0x47db('0xc9')][_0x47db('0x4d')]({'body':_0x2145eb,'ContactId':_0x3bcd5c['id'],'ChatWebsiteId':_0x12e30e['id']});}})['then'](function(_0x1871b8){_0x4cb864=_0x1871b8;if(_0x2ba327[_0x47db('0x3e')]){var _0x35aab5=_0x2ba327[_0x47db('0x37')](function(_0x101ca0){return{'name':_0x101ca0[_0x47db('0xca')],'basename':_0x101ca0[_0x47db('0x6b')],'type':_0x101ca0[_0x47db('0xcb')],'ChatOfflineMessageId':_0x1871b8['id']};});_0x16a7f1=_0x35aab5[_0x47db('0x37')](_0x376775=>{var _0x458964={'filename':_0x376775['name'],'path':path[_0x47db('0x6f')](config['root'],'server',_0x47db('0xbc'),_0x47db('0xcc'),_0x47db('0xcd'),_0x376775[_0x47db('0xce')])};return _0x458964;});if(!_0x12e30e[_0x47db('0xcf')]){return db[_0x47db('0xd0')]['transaction'](function(_0x4bd6f5){return db['Attachment'][_0x47db('0xd1')](_0x35aab5,{'transaction':_0x4bd6f5});});}}})[_0x47db('0x15')](function(){if(_0x4cb864){_0x5bb677=_0x4cb864;return db[_0x47db('0xc2')][_0x47db('0x5e')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x47db('0xd2'),'raw':!![]}]});}})[_0x47db('0x15')](function(_0x455e01){if(_0x455e01&&_0x455e01[_0x47db('0xd2')]&&_0x12e30e['forwardOffline']&&_0x12e30e[_0x47db('0xd3')]){var _0x297ce4={'tls':{'rejectUnauthorized':![]}};if(_0x455e01['Smtp'][_0x47db('0xd4')]){_0x297ce4['service']=_0x455e01[_0x47db('0xd2')][_0x47db('0xd4')];}else{_0x297ce4[_0x47db('0xd5')]=_0x455e01[_0x47db('0xd2')][_0x47db('0xd5')];_0x297ce4['port']=_0x455e01[_0x47db('0xd2')]['port'];_0x297ce4[_0x47db('0xd6')]=_0x455e01[_0x47db('0xd2')][_0x47db('0xd6')];}if(_0x455e01[_0x47db('0xd2')]['authentication']){_0x297ce4[_0x47db('0xd7')]={'user':_0x455e01['Smtp']['user'],'pass':_0x455e01[_0x47db('0xd2')][_0x47db('0xd8')]};}return respondWithRpcPromise(_0x47db('0xd9'),'sendMail',{'account':_0x297ce4,'message':{'from':util[_0x47db('0xa4')](_0x47db('0xda'),_0x455e01['name'],_0x455e01['email']||_0x455e01['Smtp'][_0x47db('0x51')]),'to':_0x12e30e['forwardOfflineAddress'],'subject':_0x12e30e['offlineMessageSubject'],'html':_0x5bb677['body'],'attachments':_0x16a7f1}},client9003)[_0x47db('0x15')](function(){return _0x5bb677;})['catch'](function(_0x4e231a){console[_0x47db('0x18')](_0x4e231a);});}})[_0x47db('0x15')](function(){if(_0x12e30e&&_0x12e30e['openNewInteraction']&&_0x12e30e[_0x47db('0xdb')]){var _0x3e23a5=[];if(_0x2ba327['length']){_0x3e23a5=_0x2ba327[_0x47db('0x37')](function(_0x4b76eb){return{'name':_0x4b76eb['originalname'],'basename':_0x4b76eb[_0x47db('0x6b')],'type':_0x4b76eb['mimetype'],'ChatOfflineMessageId':_0x4cb864['id']};});}var _0x28706f;if(!_[_0x47db('0x74')](_0x12e30e[_0x47db('0xdc')])){var _0x46578a=_[_0x47db('0x37')](_0x16fe70[_0x47db('0x57')],function(_0x1a320f){return _0x1a320f;});var _0x5324f7=_[_0x47db('0xdd')](_0x46578a)[0x0];var _0x4e3bc2=_['mapValues'](_0x5324f7,function(_0x232267){return _0x232267;});_0x28706f=_0x4e3bc2[0x1][_0x12e30e[_0x47db('0xdc')]];}var _0x5977d3={'from':_0x50f360['email'],'firstName':_0x50f360[_0x47db('0xde')],'lastName':_0x50f360['lastName'],'mapKey':_0x47db('0xdf'),'message':{'from':_0x50f360[_0x47db('0xdf')],'to':_0x12e30e[_0x47db('0xc2')]['email'],'cc':'','subject':_[_0x47db('0x74')](_0x28706f)?_0x12e30e[_0x47db('0xe0')]:_0x28706f,'messageId':'','sentAt':new Date(),'attach':_0x3e23a5['length'],'attachments':_0x3e23a5,'originChannel':_0x47db('0xe1'),'ChatWebsiteId':_0x12e30e['id'],'ChatOfflineMessageId':_0x5bb677['id'],'originTo':_0x12e30e[_0x47db('0xc2')][_0x47db('0xdf')]},'body':_0x5bb677[_0x47db('0x57')]};var _0x5cad1a={'account':{'id':_0x12e30e['MailAccountId']},'body':_0x5977d3,'log':_0x47db('0xe2')};return respondWithRpcPromise('NotifyMailAccount',_0x47db('0xe3'),_0x5cad1a,client9001)[_0x47db('0x15')](function(){return _0x5bb677;})['catch'](function(_0x3b3d4a){console['error'](_0x3b3d4a);});}return;})[_0x47db('0x15')](function(){if(_0x5bb677){return _0x5bb677;}})[_0x47db('0x15')](respondWithResult(_0x54d4d7,null))[_0x47db('0x1d')](function(_0x3c4ff0){console[_0x47db('0x18')](_0x47db('0x1d'),_0x3c4ff0);for(var _0x151601 of _0x2ba327){var _0x1c4804=path[_0x47db('0x6f')](config[_0x47db('0x70')],'server',_0x47db('0xbc'),_0x47db('0xcc'),_0x47db('0xcd'),_0x151601[_0x47db('0x6b')]);fs_extra[_0x47db('0xe4')](_0x1c4804)[_0x47db('0x1d')](function(_0x5acb2b){console[_0x47db('0x18')](_0x47db('0xe5'),_0x1c4804,_0x5acb2b);});}});};exports[_0x47db('0xe6')]=function(_0x3e9800,_0x2508ae){return db[_0x47db('0xab')]['find']({'where':{'id':_0x3e9800['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2508ae,null))['then'](function(_0x44e751){if(_0x44e751){return _0x44e751[_0x47db('0xe6')](_0x3e9800[_0x47db('0x57')]['ids'],_[_0x47db('0xe7')](_0x3e9800['body'],[_0x47db('0x60'),'id'])||{});}})['then'](respondWithResult(_0x2508ae,null))[_0x47db('0x1d')](handleError(_0x2508ae,null));};exports[_0x47db('0xe8')]=function(_0x4a80bf,_0x417696){var _0x1cff4f={'raw':![],'where':{}};var _0x127a5d={};var _0x44441b={'count':0x0,'rows':[]};return db[_0x47db('0x31')]['findOne']({'where':{'id':_0x4a80bf[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x417696,null))[_0x47db('0x15')](function(_0x115ac3){if(_0x115ac3){_0x127a5d[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0xab')]['rawAttributes']);_0x127a5d[_0x47db('0x38')]=_[_0x47db('0x39')](_0x4a80bf['query']);_0x127a5d['filters']=_[_0x47db('0x3c')](_0x127a5d[_0x47db('0x36')],_0x127a5d[_0x47db('0x38')]);_0x1cff4f['attributes']=_['intersection'](_0x127a5d[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x4a80bf['query']['fields']));_0x1cff4f[_0x47db('0x3b')]=_0x1cff4f[_0x47db('0x3b')][_0x47db('0x3e')]?_0x1cff4f[_0x47db('0x3b')]:_0x127a5d[_0x47db('0x36')];if(!_0x4a80bf['query']['hasOwnProperty'](_0x47db('0x40'))){_0x1cff4f[_0x47db('0x21')]=qs['limit'](_0x4a80bf[_0x47db('0x38')][_0x47db('0x21')]);_0x1cff4f[_0x47db('0x1f')]=qs['offset'](_0x4a80bf[_0x47db('0x38')][_0x47db('0x1f')]);}_0x1cff4f[_0x47db('0x41')]=qs['sort'](_0x4a80bf[_0x47db('0x38')][_0x47db('0x42')]);_0x1cff4f['where']=qs[_0x47db('0x3a')](_[_0x47db('0x64')](_0x4a80bf[_0x47db('0x38')],_0x127a5d[_0x47db('0x3a')]));_0x1cff4f['where'][_0x47db('0x5b')]=_0x115ac3['id'];if(_0x4a80bf[_0x47db('0x38')]['filter']){_0x1cff4f[_0x47db('0x43')]=_['merge'](_0x1cff4f[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x1cff4f[_0x47db('0x3b')],function(_0x509023){var _0x2d5435={};_0x2d5435[_0x509023]={'$like':'%'+_0x4a80bf[_0x47db('0x38')]['filter']+'%'};return _0x2d5435;})});}_0x1cff4f=_[_0x47db('0x45')]({},_0x1cff4f,_0x4a80bf[_0x47db('0x47')]);return db[_0x47db('0xab')][_0x47db('0x22')]({'where':_0x1cff4f[_0x47db('0x43')]})[_0x47db('0x15')](function(_0x186e60){_0x44441b[_0x47db('0x22')]=_0x186e60;if(_0x4a80bf[_0x47db('0x38')][_0x47db('0x48')]){_0x1cff4f[_0x47db('0x49')]=[{'model':db[_0x47db('0x84')],'as':_0x47db('0xe9'),'required':![]},{'model':db[_0x47db('0xea')],'as':_0x47db('0xeb'),'attributes':[_0x47db('0x2c'),'fullname',_0x47db('0xec')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x47db('0x2c'),_0x47db('0xed')],'where':_0x4a80bf['query'][_0x47db('0xee')]?{'id':_0x4a80bf[_0x47db('0x38')][_0x47db('0xee')]}:undefined,'required':_0x4a80bf[_0x47db('0x38')][_0x47db('0xee')]?!![]:![]}];}return db[_0x47db('0xab')][_0x47db('0x4a')](_0x1cff4f);})['then'](function(_0x1744fa){_0x44441b['rows']=_0x1744fa;return _0x44441b;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x417696,_0x1cff4f))[_0x47db('0x1d')](handleError(_0x417696,null));};function iftimePromise(_0x6bead0,_0x21cb19){return respondWithRpcPromise(_0x47db('0xef'),'getSnippet',{'command':_0x21cb19['timezone']?util['format']('iftime\x20%s,%s',_0x6bead0[_0x47db('0xf0')],_0x21cb19[_0x47db('0xf1')]):util[_0x47db('0xa4')](_0x47db('0xf2'),_0x6bead0[_0x47db('0xf0')])},client9002)['then'](function(_0x1d510e){var _0x643a75=_0x1d510e&&_0x1d510e[_0x47db('0xf3')](_0x47db('0xf4'))>=0x0?!![]:![];logger[_0x47db('0xf5')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x21cb19['id'],_0x6bead0['id'],_0x6bead0[_0x47db('0xf0')],_0x643a75?_0x47db('0xf6'):_0x47db('0xf7'),_0x21cb19[_0x47db('0xf1')]?_0x21cb19[_0x47db('0xf1')]:'No\x20timezone');return _0x643a75;})[_0x47db('0x1d')](function(_0x45e7ff){logger[_0x47db('0x18')](_0x47db('0xf8'),_0x21cb19['id'],_0x6bead0['id'],_0x6bead0[_0x47db('0xf0')],util[_0x47db('0xf9')](_0x45e7ff,{'showHidden':![],'depth':null}),_0x21cb19[_0x47db('0xf1')]?_0x21cb19[_0x47db('0xf1')]:_0x47db('0xfa'));return![];});}exports[_0x47db('0xfb')]=function(_0x5c5057,_0x632ecd){var _0x165f69=0x0;var _0x61b611=0x0;var _0x353903=![];var _0x46757c;var _0x1e7a35;return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x5c5057[_0x47db('0x58')]['id']},'include':[{'model':db[_0x47db('0xfc')],'as':_0x47db('0xfc'),'include':[{'model':db[_0x47db('0xfc')],'as':_0x47db('0xfd'),'attributes':['id',_0x47db('0xf0')],'raw':!![]}]}]})[_0x47db('0x15')](handleEntityNotFound(_0x632ecd,null))[_0x47db('0x15')](function(_0x241c4e){if(_0x241c4e){_0x46757c=_0x241c4e;return _0x241c4e[_0x47db('0xfe')]({'raw':!![]});}})['then'](function(_0xdc1d44){if(_0x46757c){if(_0xdc1d44){_0x1e7a35=_0xdc1d44;}}return require('../../config/license/util')[_0x47db('0x72')]();})['then'](function(_0x125562){if(_0x125562){_0x61b611=_0x125562[_0x47db('0xff')];_0x353903=_0x125562[_0x47db('0x73')];}})['then'](function(){return db[_0x47db('0xab')][_0x47db('0x22')]({'where':{'closed':![]}});})[_0x47db('0x15')](function(_0x456d0a){_0x165f69=_0x456d0a;if(_0x61b611&&_0x456d0a>_0x61b611){return db['License'][_0x47db('0x5e')]({'where':{'id':0x1}})[_0x47db('0x15')](function(_0x411b28){if(_0x411b28){_0x411b28['increment'](_0x47db('0x100'));}});}})['then'](function(){if(_0x46757c[_0x47db('0xfc')]&&_0x46757c['Interval']['Intervals']){var _0x109af1=[];for(var _0x2d4bad=0x0;_0x2d4bad<_0x46757c[_0x47db('0xfc')][_0x47db('0xfd')]['length'];_0x2d4bad++){var _0x1b5b85=_0x46757c['Interval'][_0x47db('0xfd')][_0x2d4bad]['get']({'plain':!![]});_0x109af1['push'](iftimePromise(_0x1b5b85,_0x46757c));}return BPromise[_0x47db('0x101')](_0x109af1)[_0x47db('0x15')](function(_0x5d41a8){return _['some'](_0x5d41a8);});}else{return!![];}})[_0x47db('0x15')](function(_0x21ac89){var _0x332303=fs[_0x47db('0xc4')](path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x102')),'utf8');var _0x477b89={'remote':_0x46757c[_0x47db('0x103')],'query':querystring[_0x47db('0x17')](_[_0x47db('0x45')](_0x46757c[_0x47db('0x4e')]({'plain':!![]}),{'customerIp':_0x5c5057[_0x47db('0x9d')]['x-forwarded-for']||_0x5c5057[_0x47db('0x9d')][_0x47db('0x104')]||_0x5c5057[_0x47db('0x105')][_0x47db('0x106')]||_0x5c5057['ip'],'referer':_0x5c5057['headers'][_0x47db('0x107')],'openedInteractions':_0x165f69,'maxInteractions':_0x61b611,'virtual':_0x353903[_0x47db('0xff')],'online':_0x21ac89,'custom':_0x353903}))[_0x47db('0x108')](/'/g,'\x5c\x27')};_0x632ecd[_0x47db('0x2d')](ejs[_0x47db('0xc6')](Mustache[_0x47db('0xc6')](_0x332303,_0x477b89),{'proactiveActions':_0x1e7a35,'alignment':_0x46757c[_0x47db('0x109')],'verticalAlignment':_0x46757c[_0x47db('0x10a')],'div_color':_0x46757c[_0x47db('0xed')],'labelText':_0x46757c[_0x47db('0x10b')],'text_color':_0x46757c[_0x47db('0x10c')],'button_color':_0x46757c[_0x47db('0x10d')],'background_color':_0x46757c['backgroundColor']}));})['catch'](handleError(_0x632ecd,null));};exports[_0x47db('0x10e')]=function(_0x24d403,_0x46d70d){var _0x41250c=_0x24d403[_0x47db('0x58')]['id'];var _0x143c09=_0x24d403[_0x47db('0x57')];var _0x4e3c3c=0xc8;var _0x27f9db=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x47db('0xd0')][_0x47db('0x10f')]['ISOLATION_LEVELS'][_0x47db('0x110')]},function(_0x6f7096){return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x41250c},'transaction':_0x6f7096})[_0x47db('0x15')](function(_0x2ccc4c){if(_0x2ccc4c){return db[_0x47db('0x111')]['destroy']({'where':{'ChatWebsiteId':_0x41250c},'transaction':_0x6f7096})[_0x47db('0x15')](function(){var _0x4e2134=_[_0x47db('0x37')](_0x143c09,function(_0x42bfe4){_0x42bfe4[_0x47db('0x5b')]=_0x41250c;return _0x42bfe4;});return db[_0x47db('0x111')]['bulkCreate'](_0x4e2134,{'transaction':_0x6f7096});});}else{_0x4e3c3c=0x194;_0x27f9db=[];}});})[_0x47db('0x15')](function(){if(_0x4e3c3c!==0x194){return db[_0x47db('0x111')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x41250c},'order':_0x47db('0x9a')})[_0x47db('0x15')](function(_0x4f0e32){_0x27f9db=_0x4f0e32;});}})[_0x47db('0x1d')](function(_0xeafb72){_0x4e3c3c=0x1f4;logger[_0x47db('0x18')](_0xeafb72[_0x47db('0x2b')]);if(_0xeafb72[_0x47db('0x2c')]){delete _0xeafb72[_0x47db('0x2c')];}_0x27f9db=_0xeafb72;})['finally'](function(){if(_0x27f9db===null){_0x46d70d['sendStatus'](_0x4e3c3c);}else{if(_0x4e3c3c===0x1f4){_0x46d70d[_0x47db('0x1e')](_0x4e3c3c)[_0x47db('0x2d')](_0x27f9db);}else{_0x46d70d['status'](_0x4e3c3c)['json'](_0x27f9db);}}});};exports['getApplications']=function(_0x331350,_0x1883dd){var _0x3c88d2={};var _0x1394c0={};var _0x228de2;var _0x4b4e9a;return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x331350[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x1883dd,null))['then'](function(_0x4b37f1){if(_0x4b37f1){_0x228de2=_0x4b37f1;_0x1394c0[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0x111')][_0x47db('0x32')]);_0x1394c0[_0x47db('0x38')]=_[_0x47db('0x39')](_0x331350[_0x47db('0x38')]);_0x1394c0[_0x47db('0x3a')]=_[_0x47db('0x3c')](_0x1394c0[_0x47db('0x36')],_0x1394c0[_0x47db('0x38')]);_0x3c88d2[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x1394c0[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x331350['query'][_0x47db('0x3d')]));_0x3c88d2['attributes']=_0x3c88d2[_0x47db('0x3b')][_0x47db('0x3e')]?_0x3c88d2['attributes']:_0x1394c0[_0x47db('0x36')];_0x3c88d2['order']=qs[_0x47db('0x42')](_0x331350[_0x47db('0x38')][_0x47db('0x42')]);_0x3c88d2[_0x47db('0x43')]=qs['filters'](_[_0x47db('0x64')](_0x331350['query'],_0x1394c0[_0x47db('0x3a')]));if(_0x331350['query'][_0x47db('0x44')]){_0x3c88d2['where']=_['merge'](_0x3c88d2[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x3c88d2[_0x47db('0x3b')],function(_0x148c6e){var _0x46118a={};_0x46118a[_0x148c6e]={'$like':'%'+_0x331350['query'][_0x47db('0x44')]+'%'};return _0x46118a;})});}_0x3c88d2=_['merge']({},_0x3c88d2,_0x331350[_0x47db('0x47')]);return _0x228de2[_0x47db('0x112')](_0x3c88d2);}})[_0x47db('0x15')](function(_0x3cb6e6){if(_0x3cb6e6){_0x4b4e9a=_0x3cb6e6[_0x47db('0x3e')];if(!_0x331350['query']['hasOwnProperty'](_0x47db('0x40'))){_0x3c88d2[_0x47db('0x21')]=qs[_0x47db('0x21')](_0x331350['query'][_0x47db('0x21')]);_0x3c88d2[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x331350[_0x47db('0x38')][_0x47db('0x1f')]);}return _0x228de2[_0x47db('0x112')](_0x3c88d2);}})[_0x47db('0x15')](function(_0x1518a7){if(_0x1518a7){return _0x1518a7?{'count':_0x4b4e9a,'rows':_0x1518a7}:null;}})[_0x47db('0x15')](respondWithResult(_0x1883dd,null))[_0x47db('0x1d')](handleError(_0x1883dd,null));};exports[_0x47db('0x113')]=function(_0x3b8e05,_0x32bd8b){return db[_0x47db('0x114')][_0x47db('0x4c')]({'where':{'id':_0x3b8e05[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x32bd8b,null))[_0x47db('0x15')](function(_0x844232){if(_0x844232){return _0x844232[_0x47db('0x113')](_0x3b8e05[_0x47db('0x57')][_0x47db('0x60')],_[_0x47db('0xe7')](_0x3b8e05[_0x47db('0x57')],[_0x47db('0x60'),'id'])||{});}})['then'](respondWithResult(_0x32bd8b,null))[_0x47db('0x1d')](handleError(_0x32bd8b,null));};exports['getProactiveActions']=function(_0x676769,_0x27817c){var _0x24ceb9={};var _0x3e92f4={};var _0x3fb690;var _0x56db34;return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x676769[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x27817c,null))['then'](function(_0x901a67){if(_0x901a67){_0x3fb690=_0x901a67;_0x3e92f4[_0x47db('0x36')]=_[_0x47db('0x39')](db['ChatProactiveAction'][_0x47db('0x32')]);_0x3e92f4[_0x47db('0x38')]=_[_0x47db('0x39')](_0x676769[_0x47db('0x38')]);_0x3e92f4[_0x47db('0x3a')]=_['intersection'](_0x3e92f4[_0x47db('0x36')],_0x3e92f4[_0x47db('0x38')]);_0x24ceb9[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x3e92f4[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x676769['query'][_0x47db('0x3d')]));_0x24ceb9['attributes']=_0x24ceb9[_0x47db('0x3b')][_0x47db('0x3e')]?_0x24ceb9[_0x47db('0x3b')]:_0x3e92f4[_0x47db('0x36')];_0x24ceb9['order']=qs[_0x47db('0x42')](_0x676769['query']['sort']);_0x24ceb9['where']=qs[_0x47db('0x3a')](_['pick'](_0x676769[_0x47db('0x38')],_0x3e92f4[_0x47db('0x3a')]));if(_0x676769[_0x47db('0x38')][_0x47db('0x44')]){_0x24ceb9[_0x47db('0x43')]=_['merge'](_0x24ceb9[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x24ceb9[_0x47db('0x3b')],function(_0x3add84){var _0x222f9a={};_0x222f9a[_0x3add84]={'$like':'%'+_0x676769['query'][_0x47db('0x44')]+'%'};return _0x222f9a;})});}_0x24ceb9=_[_0x47db('0x45')]({},_0x24ceb9,_0x676769[_0x47db('0x47')]);return _0x3fb690[_0x47db('0xfe')](_0x24ceb9);}})[_0x47db('0x15')](function(_0x5a173c){if(_0x5a173c){_0x56db34=_0x5a173c['length'];if(!_0x676769[_0x47db('0x38')][_0x47db('0x3f')](_0x47db('0x40'))){_0x24ceb9['limit']=qs[_0x47db('0x21')](_0x676769[_0x47db('0x38')][_0x47db('0x21')]);_0x24ceb9[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x676769[_0x47db('0x38')][_0x47db('0x1f')]);}return _0x3fb690[_0x47db('0xfe')](_0x24ceb9);}})['then'](function(_0x5be6ac){if(_0x5be6ac){return _0x5be6ac?{'count':_0x56db34,'rows':_0x5be6ac}:null;}})[_0x47db('0x15')](respondWithResult(_0x27817c,null))[_0x47db('0x1d')](handleError(_0x27817c,null));};exports[_0x47db('0x115')]=function(_0x31fb39,_0x2777b6){var _0x3d5961=_0x31fb39[_0x47db('0x38')][_0x47db('0x116')]==='false'?_0x47db('0x117'):_0x47db('0x118');return db[_0x47db('0x31')][_0x47db('0x4c')]({'attributes':['id',_0x3d5961],'where':{'id':_0x31fb39['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2777b6,null))[_0x47db('0x15')](function(_0x54199b){if(_0x54199b){var _0x567b03=_0x54199b[_0x3d5961];var _0x4a50d7=_0x567b03&&_0x567b03[_0x47db('0x119')]?_0x567b03[_0x47db('0x119')]:[];_0x2777b6[_0x47db('0x2d')]({'fromKey':_[_0x47db('0x74')](_0x567b03[_0x47db('0x11a')])?undefined:_0x567b03[_0x47db('0x11a')],'count':_0x4a50d7[_0x47db('0x3e')],'rows':_0x4a50d7});}})[_0x47db('0x1d')](handleError(_0x2777b6,null));};exports[_0x47db('0x11b')]=function(_0x3655b4,_0x48cf7d){var _0x3ba757={'raw':![],'where':{}};var _0x3d2d7d={};var _0x1ba3b2={'count':0x0,'rows':[]};return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x3655b4[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x48cf7d,null))[_0x47db('0x15')](function(_0x31eed1){if(_0x31eed1){_0x3d2d7d['model']=_[_0x47db('0x39')](db['ChatOfflineMessage'][_0x47db('0x32')]);_0x3d2d7d[_0x47db('0x38')]=_[_0x47db('0x39')](_0x3655b4[_0x47db('0x38')]);_0x3d2d7d['filters']=_[_0x47db('0x3c')](_0x3d2d7d[_0x47db('0x36')],_0x3d2d7d[_0x47db('0x38')]);_0x3ba757[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x3d2d7d[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x3655b4[_0x47db('0x38')][_0x47db('0x3d')]));_0x3ba757[_0x47db('0x3b')]=_0x3ba757['attributes'][_0x47db('0x3e')]?_0x3ba757[_0x47db('0x3b')]:_0x3d2d7d['model'];if(!_0x3655b4[_0x47db('0x38')][_0x47db('0x3f')](_0x47db('0x40'))){_0x3ba757['limit']=qs[_0x47db('0x21')](_0x3655b4[_0x47db('0x38')]['limit']);_0x3ba757['offset']=qs['offset'](_0x3655b4['query']['offset']);}_0x3ba757['order']=qs['sort'](_0x3655b4[_0x47db('0x38')]['sort']);_0x3ba757[_0x47db('0x43')]=qs[_0x47db('0x3a')](_['pick'](_0x3655b4[_0x47db('0x38')],_0x3d2d7d['filters']));_0x3ba757[_0x47db('0x43')][_0x47db('0x5b')]=_0x31eed1['id'];if(_0x3655b4['query']['filter']){_0x3ba757[_0x47db('0x43')]=_[_0x47db('0x45')](_0x3ba757['where'],{'$or':_[_0x47db('0x37')](_0x3ba757[_0x47db('0x3b')],function(_0x20e3e8){var _0x21a5f9={};_0x21a5f9[_0x20e3e8]={'$like':'%'+_0x3655b4[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0x21a5f9;})});}_0x3ba757=_['merge']({},_0x3ba757,_0x3655b4[_0x47db('0x47')]);return db['ChatOfflineMessage'][_0x47db('0x22')]({'where':_0x3ba757[_0x47db('0x43')]})[_0x47db('0x15')](function(_0x5d7aa1){_0x1ba3b2[_0x47db('0x22')]=_0x5d7aa1;if(_0x3655b4[_0x47db('0x38')][_0x47db('0x48')]){_0x3ba757[_0x47db('0x49')]=[{'all':!![]}];}else{_0x3ba757[_0x47db('0x49')]=[{'model':db[_0x47db('0x84')],'as':_0x47db('0xe9'),'required':![]},{'model':db['Attachment'],'as':_0x47db('0x11c'),'required':![]}];}return db[_0x47db('0xc9')][_0x47db('0x4a')](_0x3ba757);})[_0x47db('0x15')](function(_0x17ad52){_0x1ba3b2[_0x47db('0x4b')]=_0x17ad52;return _0x1ba3b2;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x48cf7d,_0x3ba757))['catch'](handleError(_0x48cf7d,null));};exports[_0x47db('0x11d')]=function(_0x584a16,_0x1b7367){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x584a16[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x1b7367,null))[_0x47db('0x15')](function(_0x4824e9){if(_0x4824e9){return _0x4824e9[_0x47db('0x11d')](_0x584a16[_0x47db('0x57')]['ids'],_[_0x47db('0xe7')](_0x584a16[_0x47db('0x57')],[_0x47db('0x60'),'id'])||{})['spread'](function(_0xebc896){for(var _0x319c47=0x0;_0x319c47<_0x584a16[_0x47db('0x57')]['ids']['length'];_0x319c47+=0x1){socket['emit'](_0x47db('0x11e'),{'UserId':Number(_0x584a16[_0x47db('0x57')][_0x47db('0x60')][_0x319c47]),'ChatWebsiteId':Number(_0x584a16[_0x47db('0x58')]['id'])});}return _0xebc896;});}})['then'](respondWithResult(_0x1b7367,null))['catch'](handleError(_0x1b7367,null));};exports[_0x47db('0x11f')]=function(_0x19c764,_0x47e510){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x19c764[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x47e510,null))[_0x47db('0x15')](function(_0x84849f){if(_0x84849f){return _0x84849f[_0x47db('0x11f')](_0x19c764[_0x47db('0x38')][_0x47db('0x60')])['then'](function(){if(_[_0x47db('0x120')](_0x19c764[_0x47db('0x38')][_0x47db('0x60')])){for(var _0x1301b8=0x0;_0x1301b8<_0x19c764[_0x47db('0x38')][_0x47db('0x60')][_0x47db('0x3e')];_0x1301b8+=0x1){socket[_0x47db('0x121')](_0x47db('0x122'),{'UserId':Number(_0x19c764['query']['ids'][_0x1301b8]),'ChatWebsiteId':Number(_0x19c764[_0x47db('0x58')]['id'])});}}else{socket['emit'](_0x47db('0x122'),{'UserId':Number(_0x19c764[_0x47db('0x38')][_0x47db('0x60')]),'ChatWebsiteId':Number(_0x19c764['params']['id'])});}});}})['then'](respondWithStatusCode(_0x47e510,null))[_0x47db('0x1d')](handleError(_0x47e510,null));};exports[_0x47db('0x123')]=function(_0xfdc78e,_0x3c9d69){var _0x3ad4a9={};var _0x4e8715={};var _0x1f8320;var _0x52eb5d;return db['ChatWebsite']['findOne']({'where':{'id':_0xfdc78e[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x3c9d69,null))[_0x47db('0x15')](function(_0x1dd1e1){if(_0x1dd1e1){_0x1f8320=_0x1dd1e1;_0x4e8715['model']=_[_0x47db('0x39')](db[_0x47db('0xea')][_0x47db('0x32')]);_0x4e8715['query']=_['keys'](_0xfdc78e[_0x47db('0x38')]);_0x4e8715[_0x47db('0x3a')]=_[_0x47db('0x3c')](_0x4e8715[_0x47db('0x36')],_0x4e8715[_0x47db('0x38')]);_0x3ad4a9[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x4e8715[_0x47db('0x36')],qs[_0x47db('0x3d')](_0xfdc78e[_0x47db('0x38')][_0x47db('0x3d')]));_0x3ad4a9[_0x47db('0x3b')]=_0x3ad4a9['attributes'][_0x47db('0x3e')]?_0x3ad4a9[_0x47db('0x3b')]:_0x4e8715[_0x47db('0x36')];_0x3ad4a9[_0x47db('0x41')]=qs[_0x47db('0x42')](_0xfdc78e['query']['sort']);_0x3ad4a9['where']=qs['filters'](_[_0x47db('0x64')](_0xfdc78e[_0x47db('0x38')],_0x4e8715[_0x47db('0x3a')]));if(_0xfdc78e[_0x47db('0x38')]['filter']){_0x3ad4a9[_0x47db('0x43')]=_[_0x47db('0x45')](_0x3ad4a9[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x3ad4a9[_0x47db('0x3b')],function(_0x3d9993){var _0x480285={};_0x480285[_0x3d9993]={'$like':'%'+_0xfdc78e[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0x480285;})});}_0x3ad4a9=_['merge']({},_0x3ad4a9,_0xfdc78e[_0x47db('0x47')]);return _0x1f8320[_0x47db('0x123')](_0x3ad4a9);}})[_0x47db('0x15')](function(_0x59d1f9){if(_0x59d1f9){_0x52eb5d=_0x59d1f9['length'];if(!_0xfdc78e[_0x47db('0x38')][_0x47db('0x3f')]('nolimit')){_0x3ad4a9['limit']=qs[_0x47db('0x21')](_0xfdc78e[_0x47db('0x38')]['limit']);_0x3ad4a9['offset']=qs['offset'](_0xfdc78e[_0x47db('0x38')]['offset']);}return _0x1f8320[_0x47db('0x123')](_0x3ad4a9);}})[_0x47db('0x15')](function(_0x43e0c8){if(_0x43e0c8){return _0x43e0c8?{'count':_0x52eb5d,'rows':_0x43e0c8}:null;}})[_0x47db('0x15')](respondWithResult(_0x3c9d69,null))[_0x47db('0x1d')](handleError(_0x3c9d69,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index e5b284e..7211111 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 _0x0911=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x4dcbcf,_0x2f0e36){var _0x28b21b=function(_0x2cadd3){while(--_0x2cadd3){_0x4dcbcf['push'](_0x4dcbcf['shift']());}};_0x28b21b(++_0x2f0e36);}(_0x0911,0x1a9));var _0x1091=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0x0911[_0x29ce14];return _0x48f289;};'use strict';var EventEmitter=require(_0x1091('0x0'));var ChatWebsite=require(_0x1091('0x1'))['db'][_0x1091('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1091('0x3')](0x0);var events={'afterCreate':_0x1091('0x4'),'afterUpdate':'update','afterDestroy':_0x1091('0x5')};function emitEvent(_0x580aa2){return function(_0x3a71a4,_0x58640b,_0x26a1a5){ChatWebsiteEvents[_0x1091('0x6')](_0x580aa2+':'+_0x3a71a4['id'],_0x3a71a4);ChatWebsiteEvents[_0x1091('0x6')](_0x580aa2,_0x3a71a4);_0x26a1a5(null);};}for(var e in events){if(events[_0x1091('0x7')](e)){var event=events[e];ChatWebsite[_0x1091('0x8')](e,emitEvent(event));}}module[_0x1091('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x8ece=['events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8ece,0x195));var _0xe8ec=function(_0x4887ef,_0xf947c1){_0x4887ef=_0x4887ef-0x0;var _0x44dd61=_0x8ece[_0x4887ef];return _0x44dd61;};'use strict';var EventEmitter=require(_0xe8ec('0x0'));var ChatWebsite=require(_0xe8ec('0x1'))['db'][_0xe8ec('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe8ec('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe8ec('0x4')};function emitEvent(_0x30c05a){return function(_0x5047e7,_0x433734,_0x79f756){ChatWebsiteEvents['emit'](_0x30c05a+':'+_0x5047e7['id'],_0x5047e7);ChatWebsiteEvents[_0xe8ec('0x5')](_0x30c05a,_0x5047e7);_0x79f756(null);};}for(var e in events){if(events[_0xe8ec('0x6')](e)){var event=events[e];ChatWebsite[_0xe8ec('0x7')](e,emitEvent(event));}}module[_0xe8ec('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a97e44e..0ff0220 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 _0xd040=['path','rimraf','../../config/environment','define','ChatWebsite','chat_websites','../../config/logger','api','bluebird','request-promise'];(function(_0x403ed0,_0x49ea6b){var _0x58137b=function(_0x42a887){while(--_0x42a887){_0x403ed0['push'](_0x403ed0['shift']());}};_0x58137b(++_0x49ea6b);}(_0xd040,0x16e));var _0x0d04=function(_0x133c61,_0x362aa2){_0x133c61=_0x133c61-0x0;var _0x4ed1aa=_0xd040[_0x133c61];return _0x4ed1aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d04('0x0'))(_0x0d04('0x1'));var moment=require('moment');var BPromise=require(_0x0d04('0x2'));var rp=require(_0x0d04('0x3'));var fs=require('fs');var path=require(_0x0d04('0x4'));var rimraf=require(_0x0d04('0x5'));var config=require(_0x0d04('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x307631,_0x3bf8f1){return _0x307631[_0x0d04('0x7')](_0x0d04('0x8'),attributes,{'tableName':_0x0d04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ff2=['chat_websites','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x3ebfee,_0x27a325){var _0x1cb7c8=function(_0xde211b){while(--_0xde211b){_0x3ebfee['push'](_0x3ebfee['shift']());}};_0x1cb7c8(++_0x27a325);}(_0x1ff2,0x83));var _0x21ff=function(_0x9227f4,_0x11cb39){_0x9227f4=_0x9227f4-0x0;var _0x20455e=_0x1ff2[_0x9227f4];return _0x20455e;};'use strict';var _=require(_0x21ff('0x0'));var util=require('util');var logger=require(_0x21ff('0x1'))('api');var moment=require('moment');var BPromise=require(_0x21ff('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21ff('0x3'));var rimraf=require(_0x21ff('0x4'));var config=require(_0x21ff('0x5'));var attributes=require(_0x21ff('0x6'));module[_0x21ff('0x7')]=function(_0x241989,_0x4324a4){return _0x241989['define'](_0x21ff('0x8'),attributes,{'tableName':_0x21ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 2517eee..0f2ed13 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 _0xb20a=['redis','defaults','localhost','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x341a08,_0x52c3f1){var _0x4b7c31=function(_0x38e383){while(--_0x38e383){_0x341a08['push'](_0x341a08['shift']());}};_0x4b7c31(++_0x52c3f1);}(_0xb20a,0x76));var _0xab20=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb20a[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0xab20('0x0'));var util=require(_0xab20('0x1'));var moment=require(_0xab20('0x2'));var BPromise=require(_0xab20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xab20('0x5'));var logger=require(_0xab20('0x6'))(_0xab20('0x7'));var config=require(_0xab20('0x8'));var jayson=require(_0xab20('0x9'));var client=jayson[_0xab20('0xa')][_0xab20('0xb')]({'port':0x232a});config[_0xab20('0xc')]=_[_0xab20('0xd')](config['redis'],{'host':_0xab20('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab20('0xc')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2a41e2,_0x42302e,_0x3dace2){return new BPromise(function(_0x413e0c,_0x5ed8e6){return client[_0xab20('0xf')](_0x2a41e2,_0x3dace2)[_0xab20('0x10')](function(_0x572ed3){logger['info'](_0xab20('0x11'),_0x42302e,_0xab20('0x12'));logger['debug'](_0xab20('0x13'),_0x42302e,_0xab20('0x12'),JSON[_0xab20('0x14')](_0x572ed3));if(_0x572ed3[_0xab20('0x15')]){if(_0x572ed3[_0xab20('0x15')][_0xab20('0x16')]===0x1f4){logger[_0xab20('0x15')](_0xab20('0x11'),_0x42302e,_0x572ed3[_0xab20('0x15')][_0xab20('0x17')]);return _0x5ed8e6(_0x572ed3[_0xab20('0x15')][_0xab20('0x17')]);}logger[_0xab20('0x15')](_0xab20('0x11'),_0x42302e,_0x572ed3[_0xab20('0x15')][_0xab20('0x17')]);return _0x413e0c(_0x572ed3[_0xab20('0x15')]['message']);}else{logger[_0xab20('0x18')](_0xab20('0x11'),_0x42302e,_0xab20('0x12'));_0x413e0c(_0x572ed3['result'][_0xab20('0x17')]);}})[_0xab20('0x19')](function(_0x23563b){logger['error'](_0xab20('0x11'),_0x42302e,_0x23563b);_0x5ed8e6(_0x23563b);});});} \ No newline at end of file +var _0x278c=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x278c,0x1d6));var _0xc278=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x278c[_0x16337a];return _0x422365;};'use strict';var _=require(_0xc278('0x0'));var util=require(_0xc278('0x1'));var moment=require('moment');var BPromise=require(_0xc278('0x2'));var rs=require(_0xc278('0x3'));var fs=require('fs');var Redis=require(_0xc278('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc278('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc278('0x6'));var jayson=require(_0xc278('0x7'));var client=jayson[_0xc278('0x8')][_0xc278('0x9')]({'port':0x232a});config[_0xc278('0xa')]=_[_0xc278('0xb')](config[_0xc278('0xa')],{'host':_0xc278('0xc'),'port':0x18eb});var socket=require(_0xc278('0xd'))(new Redis(config[_0xc278('0xa')]));require('./chatWebsite.socket')[_0xc278('0xe')](socket);function respondWithRpcPromise(_0x2e0e78,_0x104a27,_0x25bb01){return new BPromise(function(_0x277b15,_0x604e83){return client[_0xc278('0xf')](_0x2e0e78,_0x25bb01)[_0xc278('0x10')](function(_0x945d68){logger['info'](_0xc278('0x11'),_0x104a27,_0xc278('0x12'));logger['debug'](_0xc278('0x13'),_0x104a27,_0xc278('0x12'),JSON[_0xc278('0x14')](_0x945d68));if(_0x945d68[_0xc278('0x15')]){if(_0x945d68[_0xc278('0x15')]['code']===0x1f4){logger[_0xc278('0x15')](_0xc278('0x11'),_0x104a27,_0x945d68[_0xc278('0x15')][_0xc278('0x16')]);return _0x604e83(_0x945d68[_0xc278('0x15')][_0xc278('0x16')]);}logger[_0xc278('0x15')](_0xc278('0x11'),_0x104a27,_0x945d68[_0xc278('0x15')][_0xc278('0x16')]);return _0x277b15(_0x945d68[_0xc278('0x15')]['message']);}else{logger[_0xc278('0x17')](_0xc278('0x11'),_0x104a27,_0xc278('0x12'));_0x277b15(_0x945d68[_0xc278('0x18')][_0xc278('0x16')]);}})[_0xc278('0x19')](function(_0x2281ce){logger[_0xc278('0x15')](_0xc278('0x11'),_0x104a27,_0x2281ce);_0x604e83(_0x2281ce);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 0d6d1b4..36bc73f 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 _0x1924=['./chatWebsite.events','save','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x35fbe5,_0x50967c){var _0x23675a=function(_0x373120){while(--_0x373120){_0x35fbe5['push'](_0x35fbe5['shift']());}};_0x23675a(++_0x50967c);}(_0x1924,0x180));var _0x4192=function(_0x5101fc,_0x745e72){_0x5101fc=_0x5101fc-0x0;var _0x2d5b10=_0x1924[_0x5101fc];return _0x2d5b10;};'use strict';var ChatWebsiteEvents=require(_0x4192('0x0'));var events=[_0x4192('0x1'),'remove',_0x4192('0x2')];function createListener(_0x286f4c,_0x25f090){return function(_0x2d6487){_0x25f090[_0x4192('0x3')](_0x286f4c,_0x2d6487);};}function removeListener(_0x4a5c06,_0x2062dd){return function(){ChatWebsiteEvents[_0x4192('0x4')](_0x4a5c06,_0x2062dd);};}exports[_0x4192('0x5')]=function(_0x546ad5){for(var _0x225abd=0x0,_0xa191f=events[_0x4192('0x6')];_0x225abd<_0xa191f;_0x225abd++){var _0x28ef47=events[_0x225abd];var _0x2876ed=createListener(_0x4192('0x7')+_0x28ef47,_0x546ad5);ChatWebsiteEvents['on'](_0x28ef47,_0x2876ed);}}; \ No newline at end of file +var _0xc4a1=['chatWebsite:','./chatWebsite.events','remove','update','removeListener','register','length'];(function(_0x2c2a55,_0x3d6ee1){var _0xbaeaff=function(_0x30a33e){while(--_0x30a33e){_0x2c2a55['push'](_0x2c2a55['shift']());}};_0xbaeaff(++_0x3d6ee1);}(_0xc4a1,0x94));var _0x1c4a=function(_0x2d25f5,_0x42e9eb){_0x2d25f5=_0x2d25f5-0x0;var _0x55a70a=_0xc4a1[_0x2d25f5];return _0x55a70a;};'use strict';var ChatWebsiteEvents=require(_0x1c4a('0x0'));var events=['save',_0x1c4a('0x1'),_0x1c4a('0x2')];function createListener(_0xdc49a9,_0x5bfb34){return function(_0x19cf3c){_0x5bfb34['emit'](_0xdc49a9,_0x19cf3c);};}function removeListener(_0x5c74b7,_0x5228f0){return function(){ChatWebsiteEvents[_0x1c4a('0x3')](_0x5c74b7,_0x5228f0);};}exports[_0x1c4a('0x4')]=function(_0x490800){for(var _0x195acf=0x0,_0x121396=events[_0x1c4a('0x5')];_0x195acf<_0x121396;_0x195acf++){var _0x3f80cf=events[_0x195acf];var _0x31b5ea=createListener(_0x1c4a('0x6')+_0x3f80cf,_0x490800);ChatWebsiteEvents['on'](_0x3f80cf,_0x31b5ea);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 57e7a47..912a216 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 _0x8147=['/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','single','addAvatar','diskStorage','join','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','attachments','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','/:id/applications','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0xc4f7c0,_0x3d731b){var _0x479501=function(_0x36a2cd){while(--_0x36a2cd){_0xc4f7c0['push'](_0xc4f7c0['shift']());}};_0x479501(++_0x3d731b);}(_0x8147,0x1a7));var _0x7814=function(_0x28644a,_0x3e1873){_0x28644a=_0x28644a-0x0;var _0x8b4c6a=_0x8147[_0x28644a];return _0x8b4c6a;};'use strict';var multer=require(_0x7814('0x0'));var util=require(_0x7814('0x1'));var path=require(_0x7814('0x2'));var timeout=require(_0x7814('0x3'));var express=require(_0x7814('0x4'));var router=express[_0x7814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7814('0x6'));var interaction=require(_0x7814('0x7'));var config=require('../../config/environment');var controller=require(_0x7814('0x8'));router[_0x7814('0x9')]('/',auth[_0x7814('0xa')](),controller['index']);router[_0x7814('0x9')](_0x7814('0xb'),auth[_0x7814('0xa')](),controller[_0x7814('0xc')]);router[_0x7814('0x9')](_0x7814('0xd'),auth[_0x7814('0xa')](),controller[_0x7814('0xe')]);router[_0x7814('0x9')](_0x7814('0xf'),auth[_0x7814('0xa')](),controller['getDispositions']);router[_0x7814('0x9')]('/:id/canned_answers',auth[_0x7814('0xa')](),controller[_0x7814('0x10')]);router['get'](_0x7814('0x11'),controller[_0x7814('0x12')]);router[_0x7814('0x9')](_0x7814('0x13'),controller[_0x7814('0x14')]);router[_0x7814('0x9')]('/:id/customer_avatar',controller[_0x7814('0x15')]);router[_0x7814('0x9')]('/:id/system_avatar',controller[_0x7814('0x16')]);router[_0x7814('0x9')]('/:id/interactions',auth[_0x7814('0xa')](),controller[_0x7814('0x17')]);router['get'](_0x7814('0x18'),controller[_0x7814('0x19')]);router['get']('/:id/applications',auth[_0x7814('0xa')](),controller[_0x7814('0x1a')]);router['get'](_0x7814('0x1b'),auth[_0x7814('0xa')](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0x7814('0x1c')]);router[_0x7814('0x9')]('/:id/offline_messages',auth[_0x7814('0xa')](),controller['getOfflineMessages']);router[_0x7814('0x9')](_0x7814('0x1d'),auth[_0x7814('0xa')](),controller[_0x7814('0x1e')]);router[_0x7814('0x1f')]('/',auth[_0x7814('0xa')](),controller[_0x7814('0x20')]);router[_0x7814('0x1f')](_0x7814('0xf'),auth['isAuthenticated'](),controller[_0x7814('0x21')]);router[_0x7814('0x1f')]('/:id/canned_answers',auth[_0x7814('0xa')](),controller[_0x7814('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2dbebb,_0x55df29,_0x3557b6){_0x3557b6(null,path['join'](config[_0x7814('0x23')],_0x7814('0x24')));},'filename':function(_0x5a89dd,_0x5227a6,_0x5523e4){_0x5523e4(null,util[_0x7814('0x25')](_0x7814('0x26'),Date[_0x7814('0x27')](),_0x5227a6[_0x7814('0x28')]));}})});router['post']('/:id/logo',upload['single'](_0x7814('0x29')),controller[_0x7814('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a7bc5,_0x5940de,_0x207ac0){_0x207ac0(null,path['join'](config[_0x7814('0x23')],'server/files/images/avatars/'));},'filename':function(_0x5ba27e,_0x492b48,_0x491e13){_0x491e13(null,util['format'](_0x7814('0x26'),Date[_0x7814('0x27')](),_0x492b48[_0x7814('0x28')]));}})});router['post'](_0x7814('0x13'),upload[_0x7814('0x2b')]('file'),controller[_0x7814('0x2c')]);var upload=multer({'storage':multer[_0x7814('0x2d')]({'destination':function(_0x114a7f,_0x1072d9,_0x2a26a5){_0x2a26a5(null,path[_0x7814('0x2e')](config[_0x7814('0x23')],_0x7814('0x2f')));},'filename':function(_0x345696,_0x69d21d,_0x26ac36){_0x26ac36(null,util[_0x7814('0x25')](_0x7814('0x26'),Date['now'](),_0x69d21d['originalname']));}})});router[_0x7814('0x1f')](_0x7814('0x30'),upload[_0x7814('0x2b')](_0x7814('0x29')),controller[_0x7814('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b9911,_0x2b2525,_0x29e776){_0x29e776(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3f85a3,_0x4142a5,_0x39f8bb){_0x39f8bb(null,util['format']('%s-%s',Date[_0x7814('0x27')](),_0x4142a5[_0x7814('0x28')]));}})});router[_0x7814('0x1f')](_0x7814('0x32'),upload[_0x7814('0x2b')](_0x7814('0x29')),controller[_0x7814('0x33')]);router['post']('/:id/notify',controller[_0x7814('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x7814('0x2d')]({'destination':function(_0x27097d,_0x5ebd8d,_0x38e0e7){const _0x2bdefb=path[_0x7814('0x2e')](config['root'],'server/files',_0x7814('0x35'),_0x7814('0x36'));fs_extra[_0x7814('0x37')](_0x2bdefb,function(){_0x38e0e7(null,_0x2bdefb);});},'filename':function(_0x2f91f3,_0x467ac4,_0x274427){const _0xc61c2b=_0x467ac4['originalname'][_0x7814('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x455dc9=path[_0x7814('0x39')](_0xc61c2b);const _0x12f05e=Date[_0x7814('0x27')]()+'-'+_0xc61c2b[_0x7814('0x38')](_0x455dc9,'')+_0x455dc9;_0x274427(null,_0x12f05e);}})});router[_0x7814('0x1f')]('/:id/offline',offlineUploadMulter[_0x7814('0x3a')](),controller[_0x7814('0x3b')]);router[_0x7814('0x1f')](_0x7814('0x3c'),auth[_0x7814('0xa')](),controller[_0x7814('0x3d')]);router['post'](_0x7814('0x3e'),auth[_0x7814('0xa')](),controller['addApplications']);router[_0x7814('0x1f')](_0x7814('0x1b'),auth[_0x7814('0xa')](),controller[_0x7814('0x3f')]);router[_0x7814('0x1f')](_0x7814('0x1d'),auth[_0x7814('0xa')](),controller[_0x7814('0x40')]);router['put'](_0x7814('0xd'),auth['isAuthenticated'](),controller[_0x7814('0x41')]);router['delete']('/:id',auth[_0x7814('0xa')](),controller[_0x7814('0x42')]);router[_0x7814('0x43')](_0x7814('0xf'),auth[_0x7814('0xa')](),controller[_0x7814('0x44')]);router[_0x7814('0x43')](_0x7814('0x45'),auth[_0x7814('0xa')](),controller[_0x7814('0x46')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x7814('0x47')]);module[_0x7814('0x48')]=router; \ No newline at end of file +var _0xc8b5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','now','originalname','file','addLogo','server/files/images/avatars/','%s-%s','single','addAvatar','root','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','extname','/:id/offline','any','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x3ba9f1,_0x134d3c){var _0x5b9055=function(_0x479b60){while(--_0x479b60){_0x3ba9f1['push'](_0x3ba9f1['shift']());}};_0x5b9055(++_0x134d3c);}(_0xc8b5,0xd5));var _0x5c8b=function(_0x175f7b,_0x19753b){_0x175f7b=_0x175f7b-0x0;var _0x36d75c=_0xc8b5[_0x175f7b];return _0x36d75c;};'use strict';var multer=require(_0x5c8b('0x0'));var util=require(_0x5c8b('0x1'));var path=require(_0x5c8b('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c8b('0x3'));var router=express[_0x5c8b('0x4')]();var fs_extra=require(_0x5c8b('0x5'));var auth=require(_0x5c8b('0x6'));var interaction=require(_0x5c8b('0x7'));var config=require(_0x5c8b('0x8'));var controller=require(_0x5c8b('0x9'));router[_0x5c8b('0xa')]('/',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0xc')]);router['get'](_0x5c8b('0xd'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0xe')]);router[_0x5c8b('0xa')](_0x5c8b('0xf'),auth[_0x5c8b('0xb')](),controller['show']);router['get'](_0x5c8b('0x10'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x11')]);router[_0x5c8b('0xa')](_0x5c8b('0x12'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x13')]);router[_0x5c8b('0xa')](_0x5c8b('0x14'),controller['getLogo']);router['get'](_0x5c8b('0x15'),controller[_0x5c8b('0x16')]);router[_0x5c8b('0xa')](_0x5c8b('0x17'),controller[_0x5c8b('0x18')]);router[_0x5c8b('0xa')](_0x5c8b('0x19'),controller[_0x5c8b('0x1a')]);router[_0x5c8b('0xa')](_0x5c8b('0x1b'),auth[_0x5c8b('0xb')](),controller['getInteractions']);router[_0x5c8b('0xa')](_0x5c8b('0x1c'),controller[_0x5c8b('0x1d')]);router[_0x5c8b('0xa')](_0x5c8b('0x1e'),auth[_0x5c8b('0xb')](),controller['getApplications']);router[_0x5c8b('0xa')]('/:id/proactive_actions',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x1f')]);router[_0x5c8b('0xa')](_0x5c8b('0x20'),controller[_0x5c8b('0x21')]);router[_0x5c8b('0xa')](_0x5c8b('0x22'),auth['isAuthenticated'](),controller['getOfflineMessages']);router['get'](_0x5c8b('0x23'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x24')]);router[_0x5c8b('0x25')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5c8b('0x25')]('/:id/dispositions',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x26')]);router[_0x5c8b('0x25')](_0x5c8b('0x12'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x27')]);var upload=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x154d51,_0x7177f9,_0x58593f){_0x58593f(null,path[_0x5c8b('0x29')](config['root'],_0x5c8b('0x2a')));},'filename':function(_0x2607f0,_0x26f547,_0x15cf01){_0x15cf01(null,util[_0x5c8b('0x2b')]('%s-%s',Date[_0x5c8b('0x2c')](),_0x26f547[_0x5c8b('0x2d')]));}})});router[_0x5c8b('0x25')]('/:id/logo',upload['single'](_0x5c8b('0x2e')),controller[_0x5c8b('0x2f')]);var upload=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x39f84b,_0x4a9a1f,_0x13e093){_0x13e093(null,path[_0x5c8b('0x29')](config['root'],_0x5c8b('0x30')));},'filename':function(_0x10e79d,_0xfe7d64,_0x592061){_0x592061(null,util[_0x5c8b('0x2b')](_0x5c8b('0x31'),Date[_0x5c8b('0x2c')](),_0xfe7d64['originalname']));}})});router[_0x5c8b('0x25')](_0x5c8b('0x15'),upload[_0x5c8b('0x32')](_0x5c8b('0x2e')),controller[_0x5c8b('0x33')]);var upload=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x3a129e,_0x1c4b8,_0x22e4fa){_0x22e4fa(null,path['join'](config[_0x5c8b('0x34')],'server/files/images/avatars/'));},'filename':function(_0x46a20d,_0x945530,_0x4de0b6){_0x4de0b6(null,util[_0x5c8b('0x2b')](_0x5c8b('0x31'),Date[_0x5c8b('0x2c')](),_0x945530['originalname']));}})});router[_0x5c8b('0x25')](_0x5c8b('0x17'),upload[_0x5c8b('0x32')](_0x5c8b('0x2e')),controller[_0x5c8b('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1f9d97,_0x1cfe50,_0x440e42){_0x440e42(null,path[_0x5c8b('0x29')](config['root'],_0x5c8b('0x30')));},'filename':function(_0x21d5d5,_0xc1795e,_0x2d9a74){_0x2d9a74(null,util[_0x5c8b('0x2b')](_0x5c8b('0x31'),Date[_0x5c8b('0x2c')](),_0xc1795e[_0x5c8b('0x2d')]));}})});router[_0x5c8b('0x25')](_0x5c8b('0x19'),upload[_0x5c8b('0x32')](_0x5c8b('0x2e')),controller[_0x5c8b('0x36')]);router[_0x5c8b('0x25')]('/:id/notify',controller[_0x5c8b('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x58347a,_0x1fbfaf,_0x57d69e){const _0x472ee0=path[_0x5c8b('0x29')](config[_0x5c8b('0x34')],_0x5c8b('0x38'),'attachments',_0x5c8b('0x39'));fs_extra[_0x5c8b('0x3a')](_0x472ee0,function(){_0x57d69e(null,_0x472ee0);});},'filename':function(_0x316a1e,_0x4910ab,_0x287478){const _0x1e0473=_0x4910ab[_0x5c8b('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x386e04=path[_0x5c8b('0x3b')](_0x1e0473);const _0x58a12d=Date[_0x5c8b('0x2c')]()+'-'+_0x1e0473['replace'](_0x386e04,'')+_0x386e04;_0x287478(null,_0x58a12d);}})});router[_0x5c8b('0x25')](_0x5c8b('0x3c'),offlineUploadMulter[_0x5c8b('0x3d')](),controller['offline']);router[_0x5c8b('0x25')](_0x5c8b('0x1b'),auth[_0x5c8b('0xb')](),controller['addInteraction']);router[_0x5c8b('0x25')]('/:id/applications',auth['isAuthenticated'](),controller[_0x5c8b('0x3e')]);router[_0x5c8b('0x25')](_0x5c8b('0x3f'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x40')]);router[_0x5c8b('0x25')]('/:id/users',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x41')]);router[_0x5c8b('0x42')](_0x5c8b('0xf'),auth['isAuthenticated'](),controller[_0x5c8b('0x43')]);router[_0x5c8b('0x44')]('/:id',auth[_0x5c8b('0xb')](),controller['destroy']);router[_0x5c8b('0x44')](_0x5c8b('0x10'),auth[_0x5c8b('0xb')](),controller['removeDispositions']);router[_0x5c8b('0x44')](_0x5c8b('0x12'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x45')]);router['delete']('/:id/users',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x46')]);module[_0x5c8b('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 82a5152..ddcdfff 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 _0x13f5=['sequelize','exports','STRING','ENUM','Google'];(function(_0x9c607a,_0x1cb2c6){var _0x3b1311=function(_0x1b3fec){while(--_0x1b3fec){_0x9c607a['push'](_0x9c607a['shift']());}};_0x3b1311(++_0x1cb2c6);}(_0x13f5,0xc3));var _0x513f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x13f5[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'name':{'type':Sequelize[_0x513f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x513f('0x3')]('AmazonAWS',_0x513f('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5fab=['AmazonAWS','Google','STRING','sequelize','exports','ENUM'];(function(_0x437aa2,_0x48d508){var _0x28ac4d=function(_0x4afc37){while(--_0x4afc37){_0x437aa2['push'](_0x437aa2['shift']());}};_0x28ac4d(++_0x48d508);}(_0x5fab,0x177));var _0xb5fa=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x5fab[_0x115d5b];return _0x6cfc50;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb5fa('0x2')](_0xb5fa('0x3'),_0xb5fa('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xb5fa('0x5')]},'data2':{'type':Sequelize[_0xb5fa('0x5')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index c194f0b..cb52fb7 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 _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(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14ecc8,_0x2b02ee){_0x14ecc8=_0x14ecc8-0x0;var _0x1d64b0=_0x5f2f[_0x14ecc8];return _0x1d64b0;};'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 +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','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(_0x471269,_0x3fafb9){var _0x5f1fcb=function(_0x48c337){while(--_0x48c337){_0x471269['push'](_0x471269['shift']());}};_0x5f1fcb(++_0x3fafb9);}(_0x7a54,0x106));var _0x47a5=function(_0x1c5a8b,_0x223ee3){_0x1c5a8b=_0x1c5a8b-0x0;var _0x2f2921=_0x7a54[_0x1c5a8b];return _0x2f2921;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f86255c..92da18a 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 _0x22c7=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','exports'];(function(_0x34cc52,_0x493272){var _0x491c03=function(_0x58a84a){while(--_0x58a84a){_0x34cc52['push'](_0x34cc52['shift']());}};_0x491c03(++_0x493272);}(_0x22c7,0xf2));var _0x722c=function(_0x20b99b,_0x409d0e){_0x20b99b=_0x20b99b-0x0;var _0x12c7ce=_0x22c7[_0x20b99b];return _0x12c7ce;};'use strict';var _=require(_0x722c('0x0'));var util=require(_0x722c('0x1'));var logger=require(_0x722c('0x2'))(_0x722c('0x3'));var moment=require('moment');var BPromise=require(_0x722c('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('./cloudProvider.attributes');module[_0x722c('0x5')]=function(_0xe9ddfc,_0x1fb915){return _0xe9ddfc['define'](_0x722c('0x6'),attributes,{'tableName':_0x722c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7bb=['rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf7bb,0x1b3));var _0xbf7b=function(_0x4b65f1,_0x3dfc92){_0x4b65f1=_0x4b65f1-0x0;var _0x4efedd=_0xf7bb[_0x4b65f1];return _0x4efedd;};'use strict';var _=require(_0xbf7b('0x0'));var util=require(_0xbf7b('0x1'));var logger=require(_0xbf7b('0x2'))(_0xbf7b('0x3'));var moment=require(_0xbf7b('0x4'));var BPromise=require(_0xbf7b('0x5'));var rp=require(_0xbf7b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf7b('0x7'));var config=require(_0xbf7b('0x8'));var attributes=require(_0xbf7b('0x9'));module[_0xbf7b('0xa')]=function(_0x32592b,_0x2af7f9){return _0x32592b['define'](_0xbf7b('0xb'),attributes,{'tableName':_0xbf7b('0xc'),'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 8ce9c71..6a86626 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 _0x4b74=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x4b74,0x103));var _0x44b7=function(_0x2a9ef1,_0x28d168){_0x2a9ef1=_0x2a9ef1-0x0;var _0x332d3d=_0x4b74[_0x2a9ef1];return _0x332d3d;};'use strict';var _=require(_0x44b7('0x0'));var util=require(_0x44b7('0x1'));var moment=require(_0x44b7('0x2'));var BPromise=require('bluebird');var rs=require(_0x44b7('0x3'));var fs=require('fs');var Redis=require(_0x44b7('0x4'));var db=require(_0x44b7('0x5'))['db'];var utils=require(_0x44b7('0x6'));var logger=require(_0x44b7('0x7'))(_0x44b7('0x8'));var config=require(_0x44b7('0x9'));var jayson=require(_0x44b7('0xa'));var client=jayson['client'][_0x44b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2174f2,_0x7b80e9,_0x4a582b){return new BPromise(function(_0x45dfbe,_0xabf05c){return client[_0x44b7('0xc')](_0x2174f2,_0x4a582b)['then'](function(_0x7d4b17){logger[_0x44b7('0xd')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'));logger[_0x44b7('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'),JSON[_0x44b7('0x10')](_0x7d4b17));if(_0x7d4b17[_0x44b7('0x11')]){if(_0x7d4b17['error'][_0x44b7('0x12')]===0x1f4){logger[_0x44b7('0x11')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17[_0x44b7('0x11')]['message']);return _0xabf05c(_0x7d4b17[_0x44b7('0x11')][_0x44b7('0x13')]);}logger[_0x44b7('0x11')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17['error'][_0x44b7('0x13')]);return _0x45dfbe(_0x7d4b17['error']['message']);}else{logger['info'](_0x44b7('0x14'),_0x7b80e9,_0x44b7('0xe'));_0x45dfbe(_0x7d4b17['result'][_0x44b7('0x13')]);}})[_0x44b7('0x15')](function(_0x3528c8){logger[_0x44b7('0x11')](_0x44b7('0x14'),_0x7b80e9,_0x3528c8);_0xabf05c(_0x3528c8);});});} \ No newline at end of file +var _0x414f=['then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x414f,0x13f));var _0xf414=function(_0x2bcf3b,_0x2443d7){_0x2bcf3b=_0x2bcf3b-0x0;var _0x1d2898=_0x414f[_0x2bcf3b];return _0x1d2898;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var moment=require(_0xf414('0x1'));var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf414('0x3'));var db=require(_0xf414('0x4'))['db'];var utils=require(_0xf414('0x5'));var logger=require(_0xf414('0x6'))(_0xf414('0x7'));var config=require(_0xf414('0x8'));var jayson=require(_0xf414('0x9'));var client=jayson['client'][_0xf414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdcdb,_0x34c4d0,_0x2306e5){return new BPromise(function(_0xad732,_0x5194e5){return client['request'](_0x4cdcdb,_0x2306e5)[_0xf414('0xb')](function(_0x2bbf01){logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));logger[_0xf414('0xf')](_0xf414('0x10'),_0x34c4d0,_0xf414('0xe'),JSON['stringify'](_0x2bbf01));if(_0x2bbf01['error']){if(_0x2bbf01[_0xf414('0x11')][_0xf414('0x12')]===0x1f4){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0x5194e5(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0xad732(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}else{logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));_0xad732(_0x2bbf01[_0xf414('0x14')][_0xf414('0x13')]);}})[_0xf414('0x15')](function(_0x483e29){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x483e29);_0x5194e5(_0x483e29);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index b621e35..8e3fff2 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 _0x4874=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cloudProvider.controller','get'];(function(_0x30c400,_0x36123a){var _0x234819=function(_0x1ecd03){while(--_0x1ecd03){_0x30c400['push'](_0x30c400['shift']());}};_0x234819(++_0x36123a);}(_0x4874,0x12a));var _0x4487=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4874[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4487('0x0'));var timeout=require(_0x4487('0x1'));var express=require(_0x4487('0x2'));var router=express[_0x4487('0x3')]();var fs_extra=require(_0x4487('0x4'));var auth=require(_0x4487('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4487('0x6'));router[_0x4487('0x7')]('/',auth[_0x4487('0x8')](),controller[_0x4487('0x9')]);router['get'](_0x4487('0xa'),auth[_0x4487('0x8')](),controller[_0x4487('0xb')]);router[_0x4487('0xc')]('/',auth[_0x4487('0x8')](),controller[_0x4487('0xd')]);router[_0x4487('0xe')](_0x4487('0xa'),auth[_0x4487('0x8')](),controller[_0x4487('0xf')]);router[_0x4487('0x10')](_0x4487('0xa'),auth[_0x4487('0x8')](),controller[_0x4487('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2f1c=['index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cloudProvider.controller','get'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2f1c,0x68));var _0xc2f1=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0x2f1c[_0x3dc538];return _0x72c2fd;};'use strict';var multer=require(_0xc2f1('0x0'));var util=require(_0xc2f1('0x1'));var path=require(_0xc2f1('0x2'));var timeout=require(_0xc2f1('0x3'));var express=require(_0xc2f1('0x4'));var router=express[_0xc2f1('0x5')]();var fs_extra=require(_0xc2f1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc2f1('0x7'));var controller=require(_0xc2f1('0x8'));router[_0xc2f1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc2f1('0xa')]);router['get'](_0xc2f1('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc2f1('0xc')](),controller[_0xc2f1('0xd')]);router[_0xc2f1('0xe')](_0xc2f1('0xb'),auth[_0xc2f1('0xc')](),controller[_0xc2f1('0xf')]);router[_0xc2f1('0x10')](_0xc2f1('0xb'),auth[_0xc2f1('0xc')](),controller[_0xc2f1('0x11')]);module[_0xc2f1('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 9df91d0..0fdff0a 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 _0xd529=['name','sequelize','exports','STRING'];(function(_0x25f1bf,_0x1c78d8){var _0x5705c1=function(_0x229b78){while(--_0x229b78){_0x25f1bf['push'](_0x25f1bf['shift']());}};_0x5705c1(++_0x1c78d8);}(_0xd529,0x1c9));var _0x9d52=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd529[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x9d52('0x0'));module[_0x9d52('0x1')]={'name':{'type':Sequelize[_0x9d52('0x2')],'unique':_0x9d52('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9d52('0x2')]},'companyId':{'type':Sequelize[_0x9d52('0x2')]},'website':{'type':Sequelize[_0x9d52('0x2')]},'phone':{'type':Sequelize[_0x9d52('0x2')]},'fax':{'type':Sequelize[_0x9d52('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9d52('0x2')]},'city':{'type':Sequelize[_0x9d52('0x2')]},'country':{'type':Sequelize[_0x9d52('0x2')]},'email':{'type':Sequelize[_0x9d52('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9d52('0x2')]},'sStreet':{'type':Sequelize[_0x9d52('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x9d52('0x2')]},'sCountry':{'type':Sequelize[_0x9d52('0x2')]},'description':{'type':Sequelize[_0x9d52('0x2')]}}; \ No newline at end of file +var _0x22d2=['exports','STRING','sequelize'];(function(_0x2a6146,_0x3cf092){var _0x25378d=function(_0x289351){while(--_0x289351){_0x2a6146['push'](_0x2a6146['shift']());}};_0x25378d(++_0x3cf092);}(_0x22d2,0x194));var _0x222d=function(_0x22dca9,_0x2b8545){_0x22dca9=_0x22dca9-0x0;var _0x2a8d89=_0x22d2[_0x22dca9];return _0x2a8d89;};'use strict';var Sequelize=require(_0x222d('0x0'));module[_0x222d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x222d('0x2')]},'phone':{'type':Sequelize[_0x222d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x222d('0x2')]},'street':{'type':Sequelize[_0x222d('0x2')]},'postalCode':{'type':Sequelize[_0x222d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x222d('0x2')]},'email':{'type':Sequelize[_0x222d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x222d('0x2')]},'sStreet':{'type':Sequelize[_0x222d('0x2')]},'sPostalCode':{'type':Sequelize[_0x222d('0x2')]},'sCity':{'type':Sequelize[_0x222d('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x222d('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 68ff486..e81f3b6 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 _0x5b52=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','findOne','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','create'];(function(_0x3f52e1,_0x12177e){var _0x3cd8b6=function(_0x2babb6){while(--_0x2babb6){_0x3f52e1['push'](_0x3f52e1['shift']());}};_0x3cd8b6(++_0x12177e);}(_0x5b52,0x17d));var _0x25b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b52[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x25b5('0x0'));var rimraf=require(_0x25b5('0x1'));var zipdir=require(_0x25b5('0x2'));var jsonpatch=require(_0x25b5('0x3'));var rp=require('request-promise');var moment=require(_0x25b5('0x4'));var BPromise=require(_0x25b5('0x5'));var Mustache=require('mustache');var util=require(_0x25b5('0x6'));var path=require(_0x25b5('0x7'));var sox=require(_0x25b5('0x8'));var csv=require(_0x25b5('0x9'));var ejs=require(_0x25b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b5('0xb'));var squel=require(_0x25b5('0xc'));var crypto=require(_0x25b5('0xd'));var jsforce=require(_0x25b5('0xe'));var deskjs=require(_0x25b5('0xf'));var toCsv=require(_0x25b5('0x9'));var querystring=require('querystring');var Papa=require(_0x25b5('0x10'));var Redis=require('ioredis');var authService=require(_0x25b5('0x11'));var qs=require(_0x25b5('0x12'));var as=require(_0x25b5('0x13'));var hardwareService=require(_0x25b5('0x14'));var logger=require('../../config/logger')(_0x25b5('0x15'));var utils=require(_0x25b5('0x16'));var config=require(_0x25b5('0x17'));var licenseUtil=require(_0x25b5('0x18'));var db=require(_0x25b5('0x19'))['db'];function respondWithStatusCode(_0x2e933f,_0xea527e){_0xea527e=_0xea527e||0xcc;return function(_0x5c6046){if(_0x5c6046){return _0x2e933f[_0x25b5('0x1a')](_0xea527e);}return _0x2e933f[_0x25b5('0x1b')](_0xea527e)[_0x25b5('0x1c')]();};}function respondWithResult(_0x12f0e0,_0x12fa5b){_0x12fa5b=_0x12fa5b||0xc8;return function(_0x3ce0dc){if(_0x3ce0dc){return _0x12f0e0[_0x25b5('0x1b')](_0x12fa5b)[_0x25b5('0x1d')](_0x3ce0dc);}};}function respondWithFilteredResult(_0x585a21,_0x1a1ff0){return function(_0x58d935){if(_0x58d935){var _0x2fbd03=typeof _0x1a1ff0['offset']===_0x25b5('0x1e')&&typeof _0x1a1ff0[_0x25b5('0x1f')]===_0x25b5('0x1e');var _0x47648c=_0x58d935[_0x25b5('0x20')];var _0x8e5c7=_0x2fbd03?0x0:_0x1a1ff0[_0x25b5('0x21')];var _0x124a8a=_0x2fbd03?_0x58d935[_0x25b5('0x20')]:_0x1a1ff0[_0x25b5('0x21')]+_0x1a1ff0[_0x25b5('0x1f')];var _0x24b7fc;if(_0x124a8a>=_0x47648c){_0x124a8a=_0x47648c;_0x24b7fc=0xc8;}else{_0x24b7fc=0xce;}_0x585a21[_0x25b5('0x1b')](_0x24b7fc);return _0x585a21[_0x25b5('0x22')](_0x25b5('0x23'),_0x8e5c7+'-'+_0x124a8a+'/'+_0x47648c)['json'](_0x58d935);}return null;};}function patchUpdates(_0x3167e9){return function(_0x18727b){try{jsonpatch[_0x25b5('0x24')](_0x18727b,_0x3167e9,!![]);}catch(_0x2b7fb0){return BPromise['reject'](_0x2b7fb0);}return _0x18727b[_0x25b5('0x25')]();};}function saveUpdates(_0x47fc8d,_0x19362d){return function(_0x22e861){if(_0x22e861){return _0x22e861[_0x25b5('0x26')](_0x47fc8d)[_0x25b5('0x27')](function(_0x3fc6c9){return _0x3fc6c9;});}return null;};}function removeEntity(_0x4076c7,_0x26f62c){return function(_0x47a7b7){if(_0x47a7b7){return _0x47a7b7[_0x25b5('0x28')]()['then'](function(){var _0x13c4c1=_0x47a7b7[_0x25b5('0x29')]({'plain':!![]});var _0x469a63=_0x25b5('0x2a');return db[_0x25b5('0x2b')]['destroy']({'where':{'type':_0x469a63,'resourceId':_0x13c4c1['id']}})['then'](function(){return _0x47a7b7;});})[_0x25b5('0x27')](function(){_0x4076c7[_0x25b5('0x1b')](0xcc)[_0x25b5('0x1c')]();});}};}function handleEntityNotFound(_0xd7b124,_0x18ba36){return function(_0x4350e4){if(!_0x4350e4){_0xd7b124[_0x25b5('0x1a')](0x194);}return _0x4350e4;};}function handleError(_0x53d3c6,_0x308308){_0x308308=_0x308308||0x1f4;return function(_0xad2c57){logger[_0x25b5('0x2c')](_0xad2c57['stack']);if(_0xad2c57[_0x25b5('0x2d')]){delete _0xad2c57[_0x25b5('0x2d')];}_0x53d3c6[_0x25b5('0x1b')](_0x308308)[_0x25b5('0x2e')](_0xad2c57);};}exports[_0x25b5('0x2f')]=function(_0x19647b,_0x40d5dc){var _0x10f966={},_0x4d0cf7={},_0x685421={'count':0x0,'rows':[]};return db[_0x25b5('0x30')][_0x25b5('0x31')]()['then'](function(_0x34ce8a){_0x4d0cf7['model']=_[_0x25b5('0x32')](_0x34ce8a);_0x4d0cf7[_0x25b5('0x33')]=_['keys'](_0x19647b[_0x25b5('0x33')]);_0x4d0cf7[_0x25b5('0x34')]=_['intersection'](_0x4d0cf7[_0x25b5('0x35')],_0x4d0cf7['query']);_0x10f966['attributes']=_[_0x25b5('0x36')](_0x4d0cf7['model'],qs[_0x25b5('0x37')](_0x19647b['query'][_0x25b5('0x37')]));_0x10f966[_0x25b5('0x38')]=_0x10f966[_0x25b5('0x38')][_0x25b5('0x39')]?_0x10f966[_0x25b5('0x38')]:_0x4d0cf7[_0x25b5('0x35')];if(!_0x19647b[_0x25b5('0x33')][_0x25b5('0x3a')](_0x25b5('0x3b'))){_0x10f966[_0x25b5('0x1f')]=qs[_0x25b5('0x1f')](_0x19647b[_0x25b5('0x33')]['limit']);_0x10f966['offset']=qs[_0x25b5('0x21')](_0x19647b['query'][_0x25b5('0x21')]);}_0x10f966[_0x25b5('0x3c')]=qs[_0x25b5('0x3d')](_0x19647b[_0x25b5('0x33')][_0x25b5('0x3d')]);_0x10f966['where']=qs[_0x25b5('0x34')](_[_0x25b5('0x3e')](_0x19647b['query'],_0x4d0cf7['filters']),_0x34ce8a);if(_0x19647b['query'][_0x25b5('0x3f')]){_0x10f966[_0x25b5('0x40')]=_['merge'](_0x10f966['where'],{'$or':_['map'](_0x10f966[_0x25b5('0x38')],function(_0x32e18f){var _0x3ff741={};_0x3ff741[_0x32e18f]={'$like':'%'+_0x19647b[_0x25b5('0x33')][_0x25b5('0x3f')]+'%'};return _0x3ff741;})});}_0x10f966=_[_0x25b5('0x41')]({},_0x10f966,_0x19647b['options']);var _0x4a4db5={'where':_0x10f966['where']};return db[_0x25b5('0x30')]['count'](_0x4a4db5)[_0x25b5('0x27')](function(_0x2fcb89){_0x685421[_0x25b5('0x20')]=_0x2fcb89;if(_0x19647b[_0x25b5('0x33')][_0x25b5('0x42')]){_0x10f966[_0x25b5('0x43')]=[{'all':!![]}];}return db['CmCompany'][_0x25b5('0x44')](_0x10f966);})[_0x25b5('0x27')](function(_0xe66c18){_0x685421[_0x25b5('0x45')]=_0xe66c18;return _0x685421;})[_0x25b5('0x27')](respondWithFilteredResult(_0x40d5dc,_0x10f966))[_0x25b5('0x46')](handleError(_0x40d5dc,null));})[_0x25b5('0x46')](handleError(_0x40d5dc,null));};exports[_0x25b5('0x47')]=function(_0x548ab3,_0x22b861){var _0x426e1e={'raw':![],'where':{'id':_0x548ab3['params']['id']}},_0x23ff5d={};_0x23ff5d[_0x25b5('0x35')]=_['keys'](db[_0x25b5('0x30')][_0x25b5('0x48')]);_0x23ff5d[_0x25b5('0x33')]=_[_0x25b5('0x32')](_0x548ab3[_0x25b5('0x33')]);_0x23ff5d[_0x25b5('0x34')]=_['intersection'](_0x23ff5d[_0x25b5('0x35')],_0x23ff5d[_0x25b5('0x33')]);_0x426e1e[_0x25b5('0x38')]=_['intersection'](_0x23ff5d[_0x25b5('0x35')],qs[_0x25b5('0x37')](_0x548ab3[_0x25b5('0x33')]['fields']));_0x426e1e[_0x25b5('0x38')]=_0x426e1e[_0x25b5('0x38')][_0x25b5('0x39')]?_0x426e1e[_0x25b5('0x38')]:_0x23ff5d['model'];if(_0x548ab3[_0x25b5('0x33')]['includeAll']){_0x426e1e[_0x25b5('0x43')]=[{'all':!![]}];}_0x426e1e=_[_0x25b5('0x41')]({},_0x426e1e,_0x548ab3['options']);return db['CmCompany']['find'](_0x426e1e)[_0x25b5('0x27')](handleEntityNotFound(_0x22b861,null))['then'](respondWithResult(_0x22b861,null))[_0x25b5('0x46')](handleError(_0x22b861,null));};exports[_0x25b5('0x49')]=function(_0x3d67d8,_0x33d84f){return db[_0x25b5('0x30')][_0x25b5('0x49')](_0x3d67d8[_0x25b5('0x4a')],{})[_0x25b5('0x27')](function(_0x56ba48){var _0x213443=_0x3d67d8[_0x25b5('0x4b')][_0x25b5('0x29')]({'plain':!![]});if(!_0x213443)throw new Error(_0x25b5('0x4c'));if(_0x213443[_0x25b5('0x4d')]==='user'){var _0x48d9f1=_0x56ba48[_0x25b5('0x29')]({'plain':!![]});var _0x1ac801=_0x25b5('0x2a');return db[_0x25b5('0x4e')][_0x25b5('0x4f')]({'where':{'name':_0x1ac801,'userProfileId':_0x213443[_0x25b5('0x50')]},'raw':!![]})[_0x25b5('0x27')](function(_0x3796fe){if(_0x3796fe&&_0x3796fe[_0x25b5('0x51')]===0x0){return db[_0x25b5('0x2b')]['create']({'name':_0x48d9f1[_0x25b5('0x2d')],'resourceId':_0x48d9f1['id'],'type':_0x3796fe[_0x25b5('0x2d')],'sectionId':_0x3796fe['id']},{})[_0x25b5('0x27')](function(){return _0x56ba48;});}else{return _0x56ba48;}})[_0x25b5('0x46')](function(_0x27378c){logger[_0x25b5('0x2c')](_0x25b5('0x52'),_0x27378c);throw _0x27378c;});}return _0x56ba48;})[_0x25b5('0x27')](respondWithResult(_0x33d84f,0xc9))[_0x25b5('0x46')](handleError(_0x33d84f,null));};exports[_0x25b5('0x26')]=function(_0x3e24f3,_0x17ff92){if(_0x3e24f3[_0x25b5('0x4a')]['id']){delete _0x3e24f3['body']['id'];}return db[_0x25b5('0x30')]['find']({'where':{'id':_0x3e24f3[_0x25b5('0x53')]['id']}})[_0x25b5('0x27')](handleEntityNotFound(_0x17ff92,null))[_0x25b5('0x27')](saveUpdates(_0x3e24f3[_0x25b5('0x4a')],null))[_0x25b5('0x27')](respondWithResult(_0x17ff92,null))[_0x25b5('0x46')](handleError(_0x17ff92,null));};exports['destroy']=function(_0x389a4d,_0xf0b0d1){return db['CmCompany'][_0x25b5('0x4f')]({'where':{'id':_0x389a4d[_0x25b5('0x53')]['id']}})[_0x25b5('0x27')](handleEntityNotFound(_0xf0b0d1,null))[_0x25b5('0x27')](removeEntity(_0xf0b0d1,null))['catch'](handleError(_0xf0b0d1,null));};exports['describe']=function(_0x2eb1aa,_0x11b1d1){return db[_0x25b5('0x30')]['describe']()[_0x25b5('0x27')](respondWithResult(_0x11b1d1,null))[_0x25b5('0x46')](handleError(_0x11b1d1,null));};exports[_0x25b5('0x54')]=function(_0x9dd741,_0xc75585,_0x15276e){return db[_0x25b5('0x55')]['find']({'where':{'id':_0x9dd741[_0x25b5('0x53')]['id']}})['then'](handleEntityNotFound(_0xc75585,null))['then'](function(_0x29534a){if(_0x29534a){return _0x29534a[_0x25b5('0x54')](_0x9dd741['body']['ids'],_[_0x25b5('0x56')](_0x9dd741['body'],[_0x25b5('0x57'),'id'])||{});}})[_0x25b5('0x27')](respondWithResult(_0xc75585,null))[_0x25b5('0x46')](handleError(_0xc75585,null));};exports['getContacts']=function(_0x4ea3bb,_0x539795,_0x5c4d33){var _0x2a7506={};var _0x4397f2={};var _0x20285c;var _0x1a0055;return db['CmCompany'][_0x25b5('0x58')]({'where':{'id':_0x4ea3bb[_0x25b5('0x53')]['id']}})[_0x25b5('0x27')](handleEntityNotFound(_0x539795,null))[_0x25b5('0x27')](function(_0x543c51){if(_0x543c51){_0x20285c=_0x543c51;_0x4397f2[_0x25b5('0x35')]=_[_0x25b5('0x32')](db['CmContact'][_0x25b5('0x48')]);_0x4397f2[_0x25b5('0x33')]=_[_0x25b5('0x32')](_0x4ea3bb[_0x25b5('0x33')]);_0x4397f2['filters']=_['intersection'](_0x4397f2[_0x25b5('0x35')],_0x4397f2[_0x25b5('0x33')]);_0x2a7506['attributes']=_[_0x25b5('0x36')](_0x4397f2[_0x25b5('0x35')],qs[_0x25b5('0x37')](_0x4ea3bb[_0x25b5('0x33')][_0x25b5('0x37')]));_0x2a7506[_0x25b5('0x38')]=_0x2a7506['attributes'][_0x25b5('0x39')]?_0x2a7506[_0x25b5('0x38')]:_0x4397f2[_0x25b5('0x35')];_0x2a7506[_0x25b5('0x3c')]=qs[_0x25b5('0x3d')](_0x4ea3bb['query']['sort']);_0x2a7506[_0x25b5('0x40')]=qs['filters'](_[_0x25b5('0x3e')](_0x4ea3bb[_0x25b5('0x33')],_0x4397f2[_0x25b5('0x34')]));if(_0x4ea3bb['query'][_0x25b5('0x3f')]){_0x2a7506[_0x25b5('0x40')]=_[_0x25b5('0x41')](_0x2a7506[_0x25b5('0x40')],{'$or':_[_0x25b5('0x59')](_0x2a7506[_0x25b5('0x38')],function(_0x3f4313){var _0x560531={};_0x560531[_0x3f4313]={'$like':'%'+_0x4ea3bb['query'][_0x25b5('0x3f')]+'%'};return _0x560531;})});}_0x2a7506=_[_0x25b5('0x41')]({},_0x2a7506,_0x4ea3bb['options']);return _0x20285c[_0x25b5('0x5a')](_0x2a7506);}})[_0x25b5('0x27')](function(_0x36a36b){if(_0x36a36b){_0x1a0055=_0x36a36b['length'];if(!_0x4ea3bb[_0x25b5('0x33')][_0x25b5('0x3a')](_0x25b5('0x3b'))){_0x2a7506[_0x25b5('0x1f')]=qs[_0x25b5('0x1f')](_0x4ea3bb[_0x25b5('0x33')][_0x25b5('0x1f')]);_0x2a7506[_0x25b5('0x21')]=qs['offset'](_0x4ea3bb['query'][_0x25b5('0x21')]);}return _0x20285c[_0x25b5('0x5a')](_0x2a7506);}})[_0x25b5('0x27')](function(_0xa5cb12){if(_0xa5cb12){return _0xa5cb12?{'count':_0x1a0055,'rows':_0xa5cb12}:null;}})[_0x25b5('0x27')](respondWithResult(_0x539795,null))[_0x25b5('0x46')](handleError(_0x539795,null));}; \ No newline at end of file +var _0x46d7=['fast-json-patch','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','describe','addContacts','CmContact','ids','getContacts','findOne','map','eml-format','rimraf','zip-dir'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x46d7,0x159));var _0x746d=function(_0x5c54a4,_0x1028bc){_0x5c54a4=_0x5c54a4-0x0;var _0x2a713f=_0x46d7[_0x5c54a4];return _0x2a713f;};'use strict';var emlformat=require(_0x746d('0x0'));var rimraf=require(_0x746d('0x1'));var zipdir=require(_0x746d('0x2'));var jsonpatch=require(_0x746d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x746d('0x4'));var util=require(_0x746d('0x5'));var path=require(_0x746d('0x6'));var sox=require('sox');var csv=require(_0x746d('0x7'));var ejs=require(_0x746d('0x8'));var fs=require('fs');var fs_extra=require(_0x746d('0x9'));var _=require(_0x746d('0xa'));var squel=require(_0x746d('0xb'));var crypto=require(_0x746d('0xc'));var jsforce=require(_0x746d('0xd'));var deskjs=require(_0x746d('0xe'));var toCsv=require(_0x746d('0x7'));var querystring=require(_0x746d('0xf'));var Papa=require(_0x746d('0x10'));var Redis=require(_0x746d('0x11'));var authService=require(_0x746d('0x12'));var qs=require(_0x746d('0x13'));var as=require(_0x746d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x746d('0x15'))(_0x746d('0x16'));var utils=require(_0x746d('0x17'));var config=require(_0x746d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x746d('0x19'))['db'];function respondWithStatusCode(_0x2272bf,_0x14363b){_0x14363b=_0x14363b||0xcc;return function(_0x53f84f){if(_0x53f84f){return _0x2272bf['sendStatus'](_0x14363b);}return _0x2272bf[_0x746d('0x1a')](_0x14363b)['end']();};}function respondWithResult(_0x1bf4f3,_0x328ccb){_0x328ccb=_0x328ccb||0xc8;return function(_0x258649){if(_0x258649){return _0x1bf4f3[_0x746d('0x1a')](_0x328ccb)[_0x746d('0x1b')](_0x258649);}};}function respondWithFilteredResult(_0x1b1bc2,_0x3f50bb){return function(_0x1bda16){if(_0x1bda16){var _0x4e4928=typeof _0x3f50bb[_0x746d('0x1c')]===_0x746d('0x1d')&&typeof _0x3f50bb[_0x746d('0x1e')]===_0x746d('0x1d');var _0x4486f3=_0x1bda16[_0x746d('0x1f')];var _0x1649ea=_0x4e4928?0x0:_0x3f50bb[_0x746d('0x1c')];var _0x54fdfb=_0x4e4928?_0x1bda16['count']:_0x3f50bb[_0x746d('0x1c')]+_0x3f50bb['limit'];var _0x1b6687;if(_0x54fdfb>=_0x4486f3){_0x54fdfb=_0x4486f3;_0x1b6687=0xc8;}else{_0x1b6687=0xce;}_0x1b1bc2[_0x746d('0x1a')](_0x1b6687);return _0x1b1bc2[_0x746d('0x20')](_0x746d('0x21'),_0x1649ea+'-'+_0x54fdfb+'/'+_0x4486f3)[_0x746d('0x1b')](_0x1bda16);}return null;};}function patchUpdates(_0x576b17){return function(_0x17bb95){try{jsonpatch[_0x746d('0x22')](_0x17bb95,_0x576b17,!![]);}catch(_0x210e8d){return BPromise[_0x746d('0x23')](_0x210e8d);}return _0x17bb95[_0x746d('0x24')]();};}function saveUpdates(_0x16a431,_0x54870c){return function(_0x2fd321){if(_0x2fd321){return _0x2fd321[_0x746d('0x25')](_0x16a431)[_0x746d('0x26')](function(_0x1aa81b){return _0x1aa81b;});}return null;};}function removeEntity(_0x3efa3a,_0x4d080b){return function(_0x3ee6f5){if(_0x3ee6f5){return _0x3ee6f5[_0x746d('0x27')]()[_0x746d('0x26')](function(){var _0x307851=_0x3ee6f5[_0x746d('0x28')]({'plain':!![]});var _0x5e43f3=_0x746d('0x29');return db[_0x746d('0x2a')][_0x746d('0x27')]({'where':{'type':_0x5e43f3,'resourceId':_0x307851['id']}})['then'](function(){return _0x3ee6f5;});})[_0x746d('0x26')](function(){_0x3efa3a[_0x746d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f07e,_0x581202){return function(_0x15271b){if(!_0x15271b){_0x38f07e[_0x746d('0x2b')](0x194);}return _0x15271b;};}function handleError(_0x4a3542,_0x1fe682){_0x1fe682=_0x1fe682||0x1f4;return function(_0x50e27c){logger[_0x746d('0x2c')](_0x50e27c[_0x746d('0x2d')]);if(_0x50e27c[_0x746d('0x2e')]){delete _0x50e27c[_0x746d('0x2e')];}_0x4a3542['status'](_0x1fe682)[_0x746d('0x2f')](_0x50e27c);};}exports['index']=function(_0x47c653,_0x9f9cc9){var _0x52e97e={},_0x49c4fe={},_0x243c6a={'count':0x0,'rows':[]};return db[_0x746d('0x30')]['describe']()[_0x746d('0x26')](function(_0x36a606){_0x49c4fe[_0x746d('0x31')]=_[_0x746d('0x32')](_0x36a606);_0x49c4fe[_0x746d('0x33')]=_['keys'](_0x47c653['query']);_0x49c4fe[_0x746d('0x34')]=_[_0x746d('0x35')](_0x49c4fe[_0x746d('0x31')],_0x49c4fe[_0x746d('0x33')]);_0x52e97e[_0x746d('0x36')]=_[_0x746d('0x35')](_0x49c4fe[_0x746d('0x31')],qs[_0x746d('0x37')](_0x47c653[_0x746d('0x33')][_0x746d('0x37')]));_0x52e97e[_0x746d('0x36')]=_0x52e97e[_0x746d('0x36')][_0x746d('0x38')]?_0x52e97e[_0x746d('0x36')]:_0x49c4fe[_0x746d('0x31')];if(!_0x47c653[_0x746d('0x33')][_0x746d('0x39')](_0x746d('0x3a'))){_0x52e97e[_0x746d('0x1e')]=qs[_0x746d('0x1e')](_0x47c653['query'][_0x746d('0x1e')]);_0x52e97e['offset']=qs['offset'](_0x47c653['query'][_0x746d('0x1c')]);}_0x52e97e[_0x746d('0x3b')]=qs['sort'](_0x47c653['query'][_0x746d('0x3c')]);_0x52e97e[_0x746d('0x3d')]=qs[_0x746d('0x34')](_[_0x746d('0x3e')](_0x47c653[_0x746d('0x33')],_0x49c4fe['filters']),_0x36a606);if(_0x47c653['query']['filter']){_0x52e97e['where']=_[_0x746d('0x3f')](_0x52e97e['where'],{'$or':_['map'](_0x52e97e[_0x746d('0x36')],function(_0x1d80d1){var _0x119a20={};_0x119a20[_0x1d80d1]={'$like':'%'+_0x47c653[_0x746d('0x33')][_0x746d('0x40')]+'%'};return _0x119a20;})});}_0x52e97e=_[_0x746d('0x3f')]({},_0x52e97e,_0x47c653['options']);var _0x5d1a09={'where':_0x52e97e[_0x746d('0x3d')]};return db[_0x746d('0x30')][_0x746d('0x1f')](_0x5d1a09)['then'](function(_0x4436c5){_0x243c6a[_0x746d('0x1f')]=_0x4436c5;if(_0x47c653[_0x746d('0x33')]['includeAll']){_0x52e97e['include']=[{'all':!![]}];}return db['CmCompany'][_0x746d('0x41')](_0x52e97e);})[_0x746d('0x26')](function(_0x291116){_0x243c6a[_0x746d('0x42')]=_0x291116;return _0x243c6a;})[_0x746d('0x26')](respondWithFilteredResult(_0x9f9cc9,_0x52e97e))[_0x746d('0x43')](handleError(_0x9f9cc9,null));})[_0x746d('0x43')](handleError(_0x9f9cc9,null));};exports[_0x746d('0x44')]=function(_0x4eb426,_0x5dbeac){var _0x38a14a={'raw':![],'where':{'id':_0x4eb426[_0x746d('0x45')]['id']}},_0x264fd6={};_0x264fd6[_0x746d('0x31')]=_[_0x746d('0x32')](db['CmCompany'][_0x746d('0x46')]);_0x264fd6[_0x746d('0x33')]=_[_0x746d('0x32')](_0x4eb426[_0x746d('0x33')]);_0x264fd6[_0x746d('0x34')]=_['intersection'](_0x264fd6[_0x746d('0x31')],_0x264fd6[_0x746d('0x33')]);_0x38a14a[_0x746d('0x36')]=_[_0x746d('0x35')](_0x264fd6['model'],qs[_0x746d('0x37')](_0x4eb426['query'][_0x746d('0x37')]));_0x38a14a[_0x746d('0x36')]=_0x38a14a['attributes']['length']?_0x38a14a[_0x746d('0x36')]:_0x264fd6[_0x746d('0x31')];if(_0x4eb426['query'][_0x746d('0x47')]){_0x38a14a['include']=[{'all':!![]}];}_0x38a14a=_[_0x746d('0x3f')]({},_0x38a14a,_0x4eb426[_0x746d('0x48')]);return db['CmCompany'][_0x746d('0x49')](_0x38a14a)[_0x746d('0x26')](handleEntityNotFound(_0x5dbeac,null))[_0x746d('0x26')](respondWithResult(_0x5dbeac,null))[_0x746d('0x43')](handleError(_0x5dbeac,null));};exports[_0x746d('0x4a')]=function(_0x506169,_0x4041f2){return db[_0x746d('0x30')][_0x746d('0x4a')](_0x506169[_0x746d('0x4b')],{})['then'](function(_0x3d14b3){var _0x4bb09e=_0x506169[_0x746d('0x4c')][_0x746d('0x28')]({'plain':!![]});if(!_0x4bb09e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bb09e['role']===_0x746d('0x4c')){var _0x8e6ebe=_0x3d14b3[_0x746d('0x28')]({'plain':!![]});var _0x36054a='Companies';return db[_0x746d('0x4d')][_0x746d('0x49')]({'where':{'name':_0x36054a,'userProfileId':_0x4bb09e[_0x746d('0x4e')]},'raw':!![]})[_0x746d('0x26')](function(_0x3716cf){if(_0x3716cf&&_0x3716cf[_0x746d('0x4f')]===0x0){return db[_0x746d('0x2a')][_0x746d('0x4a')]({'name':_0x8e6ebe[_0x746d('0x2e')],'resourceId':_0x8e6ebe['id'],'type':_0x3716cf[_0x746d('0x2e')],'sectionId':_0x3716cf['id']},{})[_0x746d('0x26')](function(){return _0x3d14b3;});}else{return _0x3d14b3;}})[_0x746d('0x43')](function(_0x2825a5){logger[_0x746d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2825a5);throw _0x2825a5;});}return _0x3d14b3;})[_0x746d('0x26')](respondWithResult(_0x4041f2,0xc9))['catch'](handleError(_0x4041f2,null));};exports[_0x746d('0x25')]=function(_0xf285b1,_0x1ccd50){if(_0xf285b1[_0x746d('0x4b')]['id']){delete _0xf285b1[_0x746d('0x4b')]['id'];}return db[_0x746d('0x30')][_0x746d('0x49')]({'where':{'id':_0xf285b1['params']['id']}})[_0x746d('0x26')](handleEntityNotFound(_0x1ccd50,null))[_0x746d('0x26')](saveUpdates(_0xf285b1['body'],null))[_0x746d('0x26')](respondWithResult(_0x1ccd50,null))[_0x746d('0x43')](handleError(_0x1ccd50,null));};exports[_0x746d('0x27')]=function(_0x1922e7,_0x5c5a52){return db[_0x746d('0x30')][_0x746d('0x49')]({'where':{'id':_0x1922e7['params']['id']}})['then'](handleEntityNotFound(_0x5c5a52,null))[_0x746d('0x26')](removeEntity(_0x5c5a52,null))[_0x746d('0x43')](handleError(_0x5c5a52,null));};exports['describe']=function(_0x131393,_0x5bb9cb){return db[_0x746d('0x30')][_0x746d('0x50')]()[_0x746d('0x26')](respondWithResult(_0x5bb9cb,null))[_0x746d('0x43')](handleError(_0x5bb9cb,null));};exports[_0x746d('0x51')]=function(_0x46f86c,_0x4de7a7,_0x59e1bd){return db[_0x746d('0x52')]['find']({'where':{'id':_0x46f86c['params']['id']}})[_0x746d('0x26')](handleEntityNotFound(_0x4de7a7,null))[_0x746d('0x26')](function(_0x44dd21){if(_0x44dd21){return _0x44dd21['addContacts'](_0x46f86c[_0x746d('0x4b')][_0x746d('0x53')],_['omit'](_0x46f86c[_0x746d('0x4b')],['ids','id'])||{});}})[_0x746d('0x26')](respondWithResult(_0x4de7a7,null))[_0x746d('0x43')](handleError(_0x4de7a7,null));};exports[_0x746d('0x54')]=function(_0x479baf,_0x454ed4,_0x349a77){var _0x22ae27={};var _0x3719d5={};var _0x21320c;var _0x8300bd;return db[_0x746d('0x30')][_0x746d('0x55')]({'where':{'id':_0x479baf[_0x746d('0x45')]['id']}})['then'](handleEntityNotFound(_0x454ed4,null))[_0x746d('0x26')](function(_0x306632){if(_0x306632){_0x21320c=_0x306632;_0x3719d5['model']=_[_0x746d('0x32')](db[_0x746d('0x52')][_0x746d('0x46')]);_0x3719d5[_0x746d('0x33')]=_[_0x746d('0x32')](_0x479baf[_0x746d('0x33')]);_0x3719d5[_0x746d('0x34')]=_['intersection'](_0x3719d5[_0x746d('0x31')],_0x3719d5[_0x746d('0x33')]);_0x22ae27['attributes']=_[_0x746d('0x35')](_0x3719d5[_0x746d('0x31')],qs['fields'](_0x479baf['query'][_0x746d('0x37')]));_0x22ae27[_0x746d('0x36')]=_0x22ae27[_0x746d('0x36')]['length']?_0x22ae27['attributes']:_0x3719d5['model'];_0x22ae27[_0x746d('0x3b')]=qs[_0x746d('0x3c')](_0x479baf[_0x746d('0x33')][_0x746d('0x3c')]);_0x22ae27[_0x746d('0x3d')]=qs[_0x746d('0x34')](_[_0x746d('0x3e')](_0x479baf[_0x746d('0x33')],_0x3719d5[_0x746d('0x34')]));if(_0x479baf[_0x746d('0x33')][_0x746d('0x40')]){_0x22ae27[_0x746d('0x3d')]=_[_0x746d('0x3f')](_0x22ae27[_0x746d('0x3d')],{'$or':_[_0x746d('0x56')](_0x22ae27[_0x746d('0x36')],function(_0x444b02){var _0x57fe98={};_0x57fe98[_0x444b02]={'$like':'%'+_0x479baf['query'][_0x746d('0x40')]+'%'};return _0x57fe98;})});}_0x22ae27=_[_0x746d('0x3f')]({},_0x22ae27,_0x479baf[_0x746d('0x48')]);return _0x21320c[_0x746d('0x54')](_0x22ae27);}})[_0x746d('0x26')](function(_0x51d301){if(_0x51d301){_0x8300bd=_0x51d301[_0x746d('0x38')];if(!_0x479baf['query'][_0x746d('0x39')]('nolimit')){_0x22ae27[_0x746d('0x1e')]=qs[_0x746d('0x1e')](_0x479baf[_0x746d('0x33')]['limit']);_0x22ae27[_0x746d('0x1c')]=qs[_0x746d('0x1c')](_0x479baf[_0x746d('0x33')]['offset']);}return _0x21320c[_0x746d('0x54')](_0x22ae27);}})[_0x746d('0x26')](function(_0x11bf65){if(_0x11bf65){return _0x11bf65?{'count':_0x8300bd,'rows':_0x11bf65}:null;}})[_0x746d('0x26')](respondWithResult(_0x454ed4,null))[_0x746d('0x43')](handleError(_0x454ed4,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 949fc55..dede2e0 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 _0xcb2e=['rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','bluebird','path'];(function(_0x55ce52,_0x5b0650){var _0x3b1e5d=function(_0x1cf224){while(--_0x1cf224){_0x55ce52['push'](_0x55ce52['shift']());}};_0x3b1e5d(++_0x5b0650);}(_0xcb2e,0xed));var _0xecb2=function(_0x8d2c14,_0x50e164){_0x8d2c14=_0x8d2c14-0x0;var _0x3ebabb=_0xcb2e[_0x8d2c14];return _0x3ebabb;};'use strict';var _=require(_0xecb2('0x0'));var util=require('util');var logger=require(_0xecb2('0x1'))(_0xecb2('0x2'));var moment=require('moment');var BPromise=require(_0xecb2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecb2('0x4'));var rimraf=require(_0xecb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xecb2('0x6'));module[_0xecb2('0x7')]=function(_0x20c384,_0x304dc7){return _0x20c384[_0xecb2('0x8')](_0xecb2('0x9'),attributes,{'tableName':_0xecb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf40c=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1335a3,_0x52e14f){var _0x3d4e0e=function(_0x540191){while(--_0x540191){_0x1335a3['push'](_0x1335a3['shift']());}};_0x3d4e0e(++_0x52e14f);}(_0xf40c,0x89));var _0xcf40=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xf40c[_0x261e29];return _0x25ef43;};'use strict';var _=require(_0xcf40('0x0'));var util=require(_0xcf40('0x1'));var logger=require(_0xcf40('0x2'))(_0xcf40('0x3'));var moment=require('moment');var BPromise=require(_0xcf40('0x4'));var rp=require(_0xcf40('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf40('0x6'));var config=require('../../config/environment');var attributes=require(_0xcf40('0x7'));module[_0xcf40('0x8')]=function(_0x1d232c,_0x54ef17){return _0x1d232c[_0xcf40('0x9')](_0xcf40('0xa'),attributes,{'tableName':_0xcf40('0xb'),'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 22c12b7..ef5e321 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 _0x7a36=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x309e28,_0x486c36){var _0x24bf32=function(_0x418eac){while(--_0x418eac){_0x309e28['push'](_0x309e28['shift']());}};_0x24bf32(++_0x486c36);}(_0x7a36,0x18e));var _0x67a3=function(_0x320b41,_0x460866){_0x320b41=_0x320b41-0x0;var _0x5f6e6=_0x7a36[_0x320b41];return _0x5f6e6;};'use strict';var _=require(_0x67a3('0x0'));var util=require(_0x67a3('0x1'));var moment=require(_0x67a3('0x2'));var BPromise=require(_0x67a3('0x3'));var rs=require(_0x67a3('0x4'));var fs=require('fs');var Redis=require(_0x67a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x67a3('0x6'));var logger=require(_0x67a3('0x7'))(_0x67a3('0x8'));var config=require(_0x67a3('0x9'));var jayson=require(_0x67a3('0xa'));var client=jayson[_0x67a3('0xb')][_0x67a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d7376,_0x7715b9,_0x4254c2){return new BPromise(function(_0x81668c,_0x144420){return client[_0x67a3('0xd')](_0x3d7376,_0x4254c2)[_0x67a3('0xe')](function(_0x3d38a0){logger['info'](_0x67a3('0xf'),_0x7715b9,_0x67a3('0x10'));logger[_0x67a3('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x7715b9,'request\x20sent',JSON[_0x67a3('0x12')](_0x3d38a0));if(_0x3d38a0[_0x67a3('0x13')]){if(_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x14')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x7715b9,_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x15')]);return _0x144420(_0x3d38a0[_0x67a3('0x13')]['message']);}logger['error'](_0x67a3('0xf'),_0x7715b9,_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x15')]);return _0x81668c(_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x15')]);}else{logger[_0x67a3('0x16')]('CmCompany,\x20%s,\x20%s',_0x7715b9,'request\x20sent');_0x81668c(_0x3d38a0[_0x67a3('0x17')][_0x67a3('0x15')]);}})[_0x67a3('0x18')](function(_0x223ae5){logger[_0x67a3('0x13')](_0x67a3('0xf'),_0x7715b9,_0x223ae5);_0x144420(_0x223ae5);});});} \ No newline at end of file +var _0x2380=['client','request','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9388cb,_0x1f671b){var _0x1315a2=function(_0x3e06fc){while(--_0x3e06fc){_0x9388cb['push'](_0x9388cb['shift']());}};_0x1315a2(++_0x1f671b);}(_0x2380,0x16d));var _0x0238=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x2380[_0x9aada2];return _0x196dff;};'use strict';var _=require('lodash');var util=require(_0x0238('0x0'));var moment=require('moment');var BPromise=require(_0x0238('0x1'));var rs=require(_0x0238('0x2'));var fs=require('fs');var Redis=require(_0x0238('0x3'));var db=require(_0x0238('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0238('0x5'))(_0x0238('0x6'));var config=require(_0x0238('0x7'));var jayson=require(_0x0238('0x8'));var client=jayson[_0x0238('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58ea0e,_0x308f1b,_0x3e3d33){return new BPromise(function(_0x480c27,_0x651d25){return client[_0x0238('0xa')](_0x58ea0e,_0x3e3d33)[_0x0238('0xb')](function(_0x524643){logger[_0x0238('0xc')]('CmCompany,\x20%s,\x20%s',_0x308f1b,'request\x20sent');logger[_0x0238('0xd')](_0x0238('0xe'),_0x308f1b,_0x0238('0xf'),JSON[_0x0238('0x10')](_0x524643));if(_0x524643[_0x0238('0x11')]){if(_0x524643[_0x0238('0x11')][_0x0238('0x12')]===0x1f4){logger[_0x0238('0x11')](_0x0238('0x13'),_0x308f1b,_0x524643['error']['message']);return _0x651d25(_0x524643[_0x0238('0x11')]['message']);}logger[_0x0238('0x11')](_0x0238('0x13'),_0x308f1b,_0x524643[_0x0238('0x11')]['message']);return _0x480c27(_0x524643[_0x0238('0x11')][_0x0238('0x14')]);}else{logger[_0x0238('0xc')](_0x0238('0x13'),_0x308f1b,'request\x20sent');_0x480c27(_0x524643[_0x0238('0x15')]['message']);}})['catch'](function(_0x490b4c){logger[_0x0238('0x11')](_0x0238('0x13'),_0x308f1b,_0x490b4c);_0x651d25(_0x490b4c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 1099604..83d9ff4 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 _0xe634=['index','/describe','describe','/:id','getContacts','post','create','addContacts','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0xc7daaf,_0x2d7456){var _0x31ee66=function(_0xc2fabe){while(--_0xc2fabe){_0xc7daaf['push'](_0xc7daaf['shift']());}};_0x31ee66(++_0x2d7456);}(_0xe634,0xf1));var _0x4e63=function(_0x48cf09,_0x3834d6){_0x48cf09=_0x48cf09-0x0;var _0x155c04=_0xe634[_0x48cf09];return _0x155c04;};'use strict';var multer=require(_0x4e63('0x0'));var util=require(_0x4e63('0x1'));var path=require(_0x4e63('0x2'));var timeout=require(_0x4e63('0x3'));var express=require(_0x4e63('0x4'));var router=express[_0x4e63('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4e63('0x6'));var interaction=require(_0x4e63('0x7'));var config=require(_0x4e63('0x8'));var controller=require(_0x4e63('0x9'));router[_0x4e63('0xa')]('/',auth[_0x4e63('0xb')](),controller[_0x4e63('0xc')]);router['get'](_0x4e63('0xd'),auth[_0x4e63('0xb')](),controller[_0x4e63('0xe')]);router[_0x4e63('0xa')](_0x4e63('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x4e63('0xa')]('/:id/contacts',auth[_0x4e63('0xb')](),controller[_0x4e63('0x10')]);router[_0x4e63('0x11')]('/',auth['isAuthenticated'](),controller[_0x4e63('0x12')]);router[_0x4e63('0x11')]('/:id/contacts',auth[_0x4e63('0xb')](),controller[_0x4e63('0x13')]);router[_0x4e63('0x14')](_0x4e63('0xf'),auth[_0x4e63('0xb')](),controller[_0x4e63('0x15')]);router['delete'](_0x4e63('0xf'),auth[_0x4e63('0xb')](),controller['destroy']);module[_0x4e63('0x16')]=router; \ No newline at end of file +var _0x1e17=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','/:id/contacts','put','destroy','exports','multer','util'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x1e17,0x71));var _0x71e1=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x1e17[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x71e1('0x0'));var util=require(_0x71e1('0x1'));var path=require(_0x71e1('0x2'));var timeout=require(_0x71e1('0x3'));var express=require(_0x71e1('0x4'));var router=express[_0x71e1('0x5')]();var fs_extra=require(_0x71e1('0x6'));var auth=require(_0x71e1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x71e1('0x8'));var controller=require(_0x71e1('0x9'));router[_0x71e1('0xa')]('/',auth[_0x71e1('0xb')](),controller[_0x71e1('0xc')]);router[_0x71e1('0xa')](_0x71e1('0xd'),auth[_0x71e1('0xb')](),controller[_0x71e1('0xe')]);router[_0x71e1('0xa')](_0x71e1('0xf'),auth[_0x71e1('0xb')](),controller[_0x71e1('0x10')]);router[_0x71e1('0xa')]('/:id/contacts',auth[_0x71e1('0xb')](),controller[_0x71e1('0x11')]);router[_0x71e1('0x12')]('/',auth[_0x71e1('0xb')](),controller['create']);router[_0x71e1('0x12')](_0x71e1('0x13'),auth[_0x71e1('0xb')](),controller['addContacts']);router[_0x71e1('0x14')](_0x71e1('0xf'),auth[_0x71e1('0xb')](),controller['update']);router['delete'](_0x71e1('0xf'),auth['isAuthenticated'](),controller[_0x71e1('0x15')]);module[_0x71e1('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index aa083a3..31ef9d1 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 _0xc75a=['NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc75a,0xe1));var _0xac75=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0xc75a[_0x8a30cf];return _0x20f439;};'use strict';var _=require('lodash');var Sequelize=require(_0xac75('0x0'));module[_0xac75('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xac75('0x2')]},'street':{'type':Sequelize[_0xac75('0x2')]},'postalCode':{'type':Sequelize[_0xac75('0x2')]},'city':{'type':Sequelize[_0xac75('0x2')]},'country':{'type':Sequelize[_0xac75('0x2')]},'dateOfBirth':{'type':Sequelize[_0xac75('0x2')]},'description':{'type':Sequelize[_0xac75('0x3')]},'phone':{'type':Sequelize[_0xac75('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xac75('0x2')]},'email':{'type':Sequelize[_0xac75('0x2')]},'url':{'type':Sequelize[_0xac75('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xac75('0x2')]},'skype':{'type':Sequelize[_0xac75('0x2')]},'teams':{'type':Sequelize[_0xac75('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xac75('0x2')]},'wechat':{'type':Sequelize[_0xac75('0x2')]},'telegram':{'type':Sequelize[_0xac75('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xac75('0x4')](0x2)[_0xac75('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xac75('0x6')],'defaultValue':Sequelize[_0xac75('0x7')]}}; \ No newline at end of file +var _0xac14=['lodash','sequelize','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x3c3609,_0x3c0b19){var _0x5d2932=function(_0x4c9416){while(--_0x4c9416){_0x3c3609['push'](_0x3c3609['shift']());}};_0x5d2932(++_0x3c0b19);}(_0xac14,0x198));var _0x4ac1=function(_0x2ddfd2,_0x36f81b){_0x2ddfd2=_0x2ddfd2-0x0;var _0x5d4848=_0xac14[_0x2ddfd2];return _0x5d4848;};'use strict';var _=require(_0x4ac1('0x0'));var Sequelize=require(_0x4ac1('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4ac1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4ac1('0x2')]},'street':{'type':Sequelize[_0x4ac1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4ac1('0x2')]},'country':{'type':Sequelize[_0x4ac1('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4ac1('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4ac1('0x2')]},'mobile':{'type':Sequelize[_0x4ac1('0x2')]},'fax':{'type':Sequelize[_0x4ac1('0x2')]},'email':{'type':Sequelize[_0x4ac1('0x2')]},'url':{'type':Sequelize[_0x4ac1('0x2')]},'facebook':{'type':Sequelize[_0x4ac1('0x2')]},'fb_data':{'type':Sequelize[_0x4ac1('0x2')]},'twitter':{'type':Sequelize[_0x4ac1('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4ac1('0x2')]},'viber':{'type':Sequelize[_0x4ac1('0x2')]},'line':{'type':Sequelize[_0x4ac1('0x2')]},'wechat':{'type':Sequelize[_0x4ac1('0x2')]},'telegram':{'type':Sequelize[_0x4ac1('0x2')]},'UserId':{'type':Sequelize[_0x4ac1('0x3')]},'priority':{'type':Sequelize[_0x4ac1('0x3')](0x2)[_0x4ac1('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4ac1('0x5')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e1069d0..3ba13e8 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 _0xe938=['value','split','map','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','DATE','start','end','hasOwnProperty','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','toString','sequelize','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','destroy','params','describe','tags','columnName','displayName','analytics','findAll','custom','values','body','get','mergeWith','isArray','join','info','CmHopper','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','catch','duplicates','show','$and','omit','pickBy','format','table','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','options','getTags','setTags','ids','ContactId','include','getHopperHistories','includeAll','rows','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','file','parse','meta','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','exit','error\x20child\x20process','mail','sms','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','startCase','chat','Website','Account','closed','disposition','secondDisposition','thirdDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','referer','subject','openchannel','externalUrl','threadId','Interaction','flatten','sortBy','slice','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','sendStatus','error','stack','name','index','CmContact','keys','startsWith','push','CmCustomField','trimStart','cf_','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xe938,0xd2));var _0x8e93=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0xe938[_0x1bb47b];return _0x566418;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8e93('0x0'));var path=require(_0x8e93('0x1'));var fs=require('fs');var _=require(_0x8e93('0x2'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x8e93('0x3'));var qs=require(_0x8e93('0x4'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')(_0x8e93('0x5'));var config=require(_0x8e93('0x6'));var db=require(_0x8e93('0x7'))['db'];config[_0x8e93('0x8')]=_['defaults'](config[_0x8e93('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e93('0x9'))(new Redis(config[_0x8e93('0x8')]));require(_0x8e93('0xa'))[_0x8e93('0xb')](socket);function respondWithResult(_0x43cd52,_0x5cc9a6){_0x5cc9a6=_0x5cc9a6||0xc8;return function(_0x59e70c){if(_0x59e70c){return _0x43cd52[_0x8e93('0xc')](_0x5cc9a6)[_0x8e93('0xd')](_0x59e70c);}};}function respondWithFilteredResult(_0x435694,_0x49fcae){return function(_0x2eee0c){if(_0x2eee0c){var _0x51a8f7=typeof _0x49fcae[_0x8e93('0xe')]===_0x8e93('0xf')&&typeof _0x49fcae[_0x8e93('0x10')]===_0x8e93('0xf');var _0x29f100=_0x2eee0c['count'];var _0x559663=_0x51a8f7?0x0:_0x49fcae[_0x8e93('0xe')];var _0x500c4a=_0x51a8f7?_0x2eee0c[_0x8e93('0x11')]:_0x49fcae[_0x8e93('0xe')]+_0x49fcae[_0x8e93('0x10')];var _0x4735c0;if(_0x500c4a>=_0x29f100){_0x500c4a=_0x29f100;_0x4735c0=0xc8;}else{_0x4735c0=0xce;}_0x435694['status'](_0x4735c0);return _0x435694['set'](_0x8e93('0x12'),_0x559663+'-'+_0x500c4a+'/'+_0x29f100)[_0x8e93('0xd')](_0x2eee0c);}return null;};}function saveUpdates(_0x5bb64b){return function(_0x1b17c2){if(_0x1b17c2){return _0x1b17c2[_0x8e93('0x13')](_0x5bb64b)['then'](function(_0x525c2c){return _0x525c2c;});}return null;};}function removeEntity(_0x4b60bb){return function(_0x15ac37){if(_0x15ac37){return _0x15ac37['destroy']()[_0x8e93('0x14')](function(){_0x4b60bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35cc92){return function(_0xc828c0){if(!_0xc828c0){_0x35cc92[_0x8e93('0x15')](0x194);}return _0xc828c0;};}function handleError(_0x291919,_0x22ccbc){_0x22ccbc=_0x22ccbc||0x1f4;return function(_0x43eb15){logger[_0x8e93('0x16')](_0x43eb15[_0x8e93('0x17')]);if(_0x43eb15[_0x8e93('0x18')]){delete _0x43eb15['name'];}_0x291919['status'](_0x22ccbc)['send'](_0x43eb15);};}exports[_0x8e93('0x19')]=function(_0x4266e7,_0x19663c){var _0x204f5d={},_0x382dfd={},_0x4398a6={'count':0x0,'rows':[]};return db[_0x8e93('0x1a')]['describe']()[_0x8e93('0x14')](function(_0x276f79){var _0x541533=[];for(var _0x5c1fef=0x0;_0x5c1fef0x1){_0x2edcfa['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x14ab74),null);}else{if(qs['isNumeric'](_0x14ab74)){_0x2edcfa['or'](_0x8e93('0x59'),_0x14ab74+'%');_0x2edcfa['or'](_0x8e93('0x5a'),_0x14ab74+'%');_0x2edcfa['or'](_0x8e93('0x5b'),_0x14ab74+'%');_0x2edcfa['or']('c.fax\x20LIKE\x20?',_0x14ab74+'%');}else if(qs[_0x8e93('0x5c')](_0x14ab74)){_0x2edcfa['or'](_0x8e93('0x5d'),_0x14ab74+'%');}else{_0x2edcfa['or'](_0x8e93('0x5e'),'%'+_0x14ab74+'%');_0x2edcfa['or'](_0x8e93('0x5f'),'%'+_0x14ab74+'%');_0x2edcfa['or'](_0x8e93('0x5d'),'%'+_0x14ab74+'%');}}}}_0x272215[_0x8e93('0x2d')](_0x2edcfa);_0x272215[_0x8e93('0x60')](_0x8e93('0x61'));var _0x5ffa05={'type':db[_0x8e93('0x62')][_0x8e93('0x63')][_0x8e93('0x64')],'raw':!![]};var _0x127161=_0x272215[_0x8e93('0x65')]()[_0x8e93('0x30')](_0x8e93('0x61'));if(_0x204f5d[_0x8e93('0x66')]){_0x204f5d['order'][_0x8e93('0x4f')](function(_0x5f1489){_0x272215['order']('c.'+_0x5f1489[0x0],_0x5f1489[0x1]===_0x8e93('0x67')?![]:!![]);});}if(!_[_0x8e93('0x4e')](_0x11055d)){_0x272215[_0x8e93('0x68')](_0x159cee);_0x127161[_0x8e93('0x2d')]('t.id\x20IN\x20?',_0x11055d);}BPromise[_0x8e93('0x69')]()[_0x8e93('0x14')](function(){if(!_0x3d06e3)return;if(_0x4266e7['user'][_0x8e93('0x6a')]!==_0x8e93('0x6b'))return;if(!_[_0x8e93('0x6c')](_0x3d06e3[_0x8e93('0x3c')],[_0x8e93('0x30'),_0x8e93('0x43')])){return _0x4266e7[_0x8e93('0x6d')][_0x8e93('0x6e')]({'attributes':['id'],'raw':!![]})[_0x8e93('0x14')](function(_0x3934c8){if(_[_0x8e93('0x4e')](_0x3934c8)){_0x127161[_0x8e93('0x2d')]('c.ListId\x20IS\x20NULL');_0x272215['where'](_0x8e93('0x6f'));}else{_0x127161['where'](_0x8e93('0x51'),_[_0x8e93('0x41')](_0x3934c8,'id'));_0x272215[_0x8e93('0x2d')](_0x8e93('0x51'),_['map'](_0x3934c8,'id'));}});}})['then'](function(){if(_0x4266e7[_0x8e93('0x6d')][_0x8e93('0x6a')]===_0x8e93('0x6b')&&!_0x3d06e3&&!_0x4266e7[_0x8e93('0x26')]['ListId'])return[];return db['sequelize'][_0x8e93('0x26')](_0x127161[_0x8e93('0x70')](),_0x5ffa05);})[_0x8e93('0x14')](function(_0x201c81){_0x4398a6['count']=_0x201c81['length'];if(_0x4398a6[_0x8e93('0x11')]===0x0)return[];return db[_0x8e93('0x71')][_0x8e93('0x26')](_0x3a0062[_0x8e93('0x70')](),_0x5ffa05)[_0x8e93('0x14')](function(_0x40ab4f){_0x50acfa=_['keyBy'](_0x40ab4f,'id');_0x5ffa05=_[_0x8e93('0x72')](_0x5ffa05,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4266e7['query'][_0x8e93('0x2a')]){_0x204f5d['attributes'][_0x8e93('0x4f')](function(_0x55251e){_0x272215[_0x8e93('0x30')]('c.'+_0x55251e);});}else{_0x272215[_0x8e93('0x30')](_0x8e93('0x61'));_0x272215[_0x8e93('0x30')](_0x8e93('0x73'));_0x272215[_0x8e93('0x30')]('c.lastName');_0x272215[_0x8e93('0x30')](_0x8e93('0x74'));_0x272215[_0x8e93('0x30')](_0x8e93('0x75'));_0x272215[_0x8e93('0x30')](_0x8e93('0x76'));_0x272215[_0x8e93('0x30')](_0x8e93('0x77'));_0x272215[_0x8e93('0x30')]('c.ListId');_0x272215['field'](_0x8e93('0x78'));_0x272215['field'](_0x8e93('0x79'));_0x272215[_0x8e93('0x30')](_0x8e93('0x7a'));_0x272215[_0x8e93('0x30')](_0x8e93('0x7b'),_0x8e93('0x7c'));}if(_0x204f5d['limit'])_0x272215[_0x8e93('0x10')](_0x204f5d[_0x8e93('0x10')]);if(_0x204f5d[_0x8e93('0xe')])_0x272215[_0x8e93('0xe')](_0x204f5d[_0x8e93('0xe')]);return db['sequelize'][_0x8e93('0x26')](_0x272215[_0x8e93('0x70')](),_0x5ffa05);});})[_0x8e93('0x14')](function(_0x33a347){_0x33a347[_0x8e93('0x4f')](function(_0x5c51d5){if(_0x5c51d5[_0x8e93('0x7c')]){_0x5c51d5[_0x8e93('0x7d')]=[];_0x5c51d5['TagIds']['split'](',')[_0x8e93('0x4f')](function(_0x11526a){_0x5c51d5['Tags'][_0x8e93('0x1d')](_0x50acfa[_0x11526a]);});}delete _0x5c51d5[_0x8e93('0x7c')];});_0x4398a6['rows']=_0x33a347;return _0x4398a6;})[_0x8e93('0x14')](respondWithFilteredResult(_0x19663c,_0x204f5d));})['catch'](handleError(_0x19663c,null));};exports[_0x8e93('0x7e')]=function(_0x4afac9,_0x253fbd){return db[_0x8e93('0x1a')][_0x8e93('0x3d')]({'where':{'id':_0x4afac9[_0x8e93('0x7f')]['id']}})['then'](handleEntityNotFound(_0x253fbd,null))[_0x8e93('0x14')](removeEntity(_0x253fbd,null))['catch'](handleError(_0x253fbd,null));};exports['describe']=function(_0x1404c6,_0x209e38){return db[_0x8e93('0x1a')][_0x8e93('0x80')]()[_0x8e93('0x14')](function(_0x5c4d33){delete _0x5c4d33[_0x8e93('0x81')];for(var _0x5489de=0x0;_0x5489de=_0x2ab263){_0x152b7b=_0x2ab263;_0x15a912=0xc8;}else{_0x15a912=0xce;}_0x131a39[_0xfe2c('0xf')](_0x15a912);return _0x131a39[_0xfe2c('0x15')](_0xfe2c('0x16'),_0x418973+'-'+_0x152b7b+'/'+_0x2ab263)[_0xfe2c('0x10')](_0x49fe3a);}return null;};}function saveUpdates(_0x579059){return function(_0x82be6f){if(_0x82be6f){return _0x82be6f[_0xfe2c('0x17')](_0x579059)['then'](function(_0x1f82c7){return _0x1f82c7;});}return null;};}function removeEntity(_0x26e481){return function(_0x193a8a){if(_0x193a8a){return _0x193a8a['destroy']()[_0xfe2c('0x18')](function(){_0x26e481[_0xfe2c('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50e564){return function(_0x54d7df){if(!_0x54d7df){_0x50e564['sendStatus'](0x194);}return _0x54d7df;};}function handleError(_0x149f68,_0x3b0b8a){_0x3b0b8a=_0x3b0b8a||0x1f4;return function(_0x175984){logger[_0xfe2c('0x19')](_0x175984[_0xfe2c('0x1a')]);if(_0x175984['name']){delete _0x175984['name'];}_0x149f68[_0xfe2c('0xf')](_0x3b0b8a)['send'](_0x175984);};}exports[_0xfe2c('0x1b')]=function(_0x53d2d0,_0x33c169){var _0x22bd2e={},_0xb95c43={},_0x562928={'count':0x0,'rows':[]};return db[_0xfe2c('0x1c')][_0xfe2c('0x1d')]()[_0xfe2c('0x18')](function(_0xf51c38){var _0x4110f0=[];for(var _0x4f9f24=0x0;_0x4f9f240x1){_0xe791b8['or'](_0xfe2c('0x5d'),qs[_0xfe2c('0x5e')](_0x522e12),null);}else{if(qs[_0xfe2c('0x5f')](_0x522e12)){_0xe791b8['or']('c.id\x20LIKE\x20?',_0x522e12+'%');_0xe791b8['or'](_0xfe2c('0x60'),_0x522e12+'%');_0xe791b8['or'](_0xfe2c('0x61'),_0x522e12+'%');_0xe791b8['or'](_0xfe2c('0x62'),_0x522e12+'%');}else if(qs[_0xfe2c('0x63')](_0x522e12)){_0xe791b8['or'](_0xfe2c('0x64'),_0x522e12+'%');}else{_0xe791b8['or']('c.firstName\x20LIKE\x20?','%'+_0x522e12+'%');_0xe791b8['or']('c.lastName\x20LIKE\x20?','%'+_0x522e12+'%');_0xe791b8['or']('c.email\x20LIKE\x20?','%'+_0x522e12+'%');}}}}_0x151c92[_0xfe2c('0x3c')](_0xe791b8);_0x151c92[_0xfe2c('0x65')](_0xfe2c('0x66'));var _0x3aa9da={'type':db[_0xfe2c('0x67')][_0xfe2c('0x68')]['SELECT'],'raw':!![]};var _0x55f535=_0x151c92[_0xfe2c('0x69')]()['field'](_0xfe2c('0x66'));if(_0x22bd2e[_0xfe2c('0x2e')]){_0x22bd2e['order']['forEach'](function(_0x5f1de7){_0x151c92[_0xfe2c('0x2e')]('c.'+_0x5f1de7[0x0],_0x5f1de7[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfe2c('0x6a')](_0x5e58d8)){_0x151c92[_0xfe2c('0x6b')](_0x1710a4);_0x55f535[_0xfe2c('0x3c')](_0xfe2c('0x6c'),_0x5e58d8);}BPromise[_0xfe2c('0x6d')]()[_0xfe2c('0x18')](function(){if(!_0x176cf1)return;if(_0x53d2d0[_0xfe2c('0x6e')]['role']!==_0xfe2c('0x6f'))return;if(!_['some'](_0x176cf1['conditions'],[_0xfe2c('0x31'),'User'])){return _0x53d2d0[_0xfe2c('0x6e')][_0xfe2c('0x70')]({'attributes':['id'],'raw':!![]})[_0xfe2c('0x18')](function(_0x2ec48c){if(_[_0xfe2c('0x6a')](_0x2ec48c)){_0x55f535['where']('c.ListId\x20IS\x20NULL');_0x151c92[_0xfe2c('0x3c')](_0xfe2c('0x71'));}else{_0x55f535[_0xfe2c('0x3c')](_0xfe2c('0x58'),_[_0xfe2c('0x47')](_0x2ec48c,'id'));_0x151c92[_0xfe2c('0x3c')](_0xfe2c('0x58'),_[_0xfe2c('0x47')](_0x2ec48c,'id'));}});}})[_0xfe2c('0x18')](function(){if(_0x53d2d0[_0xfe2c('0x6e')][_0xfe2c('0x72')]===_0xfe2c('0x6f')&&!_0x176cf1&&!_0x53d2d0[_0xfe2c('0x28')][_0xfe2c('0x57')])return[];return db['sequelize'][_0xfe2c('0x28')](_0x55f535['toString'](),_0x3aa9da);})[_0xfe2c('0x18')](function(_0x3fca46){_0x562928[_0xfe2c('0x14')]=_0x3fca46[_0xfe2c('0x1f')];if(_0x562928[_0xfe2c('0x14')]===0x0)return[];return db[_0xfe2c('0x73')]['query'](_0x5774da['toString'](),_0x3aa9da)[_0xfe2c('0x18')](function(_0x340d8f){_0x115b0d=_[_0xfe2c('0x74')](_0x340d8f,'id');_0x3aa9da=_[_0xfe2c('0x75')](_0x3aa9da,{'model':db[_0xfe2c('0x1c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53d2d0['query'][_0xfe2c('0x2c')]){_0x22bd2e[_0xfe2c('0x2a')]['forEach'](function(_0x329aca){_0x151c92[_0xfe2c('0x31')]('c.'+_0x329aca);});}else{_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x66'));_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x76'));_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x77'));_0x151c92[_0xfe2c('0x31')]('c.phone');_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x78'));_0x151c92['field'](_0xfe2c('0x79'));_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x7a'));_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x7b'));_0x151c92[_0xfe2c('0x31')]('c.createdAt');_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x7c'));_0x151c92['field'](_0xfe2c('0x7d'));_0x151c92[_0xfe2c('0x31')](_0xfe2c('0x7e'),_0xfe2c('0x7f'));}if(_0x22bd2e[_0xfe2c('0x13')])_0x151c92[_0xfe2c('0x13')](_0x22bd2e[_0xfe2c('0x13')]);if(_0x22bd2e['offset'])_0x151c92['offset'](_0x22bd2e[_0xfe2c('0x11')]);return db[_0xfe2c('0x73')][_0xfe2c('0x28')](_0x151c92[_0xfe2c('0x80')](),_0x3aa9da);});})[_0xfe2c('0x18')](function(_0x2ddd46){_0x2ddd46[_0xfe2c('0x48')](function(_0x16af05){if(_0x16af05[_0xfe2c('0x7f')]){_0x16af05[_0xfe2c('0x81')]=[];_0x16af05[_0xfe2c('0x7f')][_0xfe2c('0x46')](',')['forEach'](function(_0x156b93){_0x16af05[_0xfe2c('0x81')]['push'](_0x115b0d[_0x156b93]);});}delete _0x16af05[_0xfe2c('0x7f')];});_0x562928['rows']=_0x2ddd46;return _0x562928;})[_0xfe2c('0x18')](respondWithFilteredResult(_0x33c169,_0x22bd2e));})['catch'](handleError(_0x33c169,null));};exports[_0xfe2c('0x82')]=function(_0x1d6592,_0x275327){return db[_0xfe2c('0x1c')][_0xfe2c('0x43')]({'where':{'id':_0x1d6592[_0xfe2c('0x83')]['id']}})['then'](handleEntityNotFound(_0x275327,null))['then'](removeEntity(_0x275327,null))['catch'](handleError(_0x275327,null));};exports[_0xfe2c('0x1d')]=function(_0x43b0ff,_0x46ae86){return db[_0xfe2c('0x1c')][_0xfe2c('0x1d')]()[_0xfe2c('0x18')](function(_0x45e726){delete _0x45e726['tags'];for(var _0x3e66ee=0x0;_0x3e66ee{}\s\\|]/g,'-');_0x1b1bb9(null,util[_0x3ba2('0x21')](_0x3ba2('0x22'),path['basename'](_0x505f6d['originalname'],path[_0x3ba2('0x23')](_0x505f6d['originalname'])),Date[_0x3ba2('0x24')](),path[_0x3ba2('0x23')](_0x505f6d[_0x3ba2('0x20')])));}})});router[_0x3ba2('0x16')](_0x3ba2('0x25'),upload[_0x3ba2('0x26')](_0x3ba2('0x27')),controller[_0x3ba2('0x28')]);var upload=multer({'storage':multer[_0x3ba2('0x1c')]({'destination':function(_0x54e75a,_0x48a696,_0xb2994e){_0xb2994e(null,path['join'](config['root'],'server/files/tmp'));},'filename':function(_0x15e4db,_0x47e9df,_0x463d60){_0x47e9df[_0x3ba2('0x20')]=_0x47e9df[_0x3ba2('0x20')][_0x3ba2('0x29')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x463d60(null,util[_0x3ba2('0x21')](_0x3ba2('0x22'),path[_0x3ba2('0x2a')](_0x47e9df[_0x3ba2('0x20')],path['extname'](_0x47e9df[_0x3ba2('0x20')])),Date[_0x3ba2('0x24')](),path[_0x3ba2('0x23')](_0x47e9df['originalname'])));}})});router[_0x3ba2('0x16')]('/upload',upload[_0x3ba2('0x26')]('file'),controller[_0x3ba2('0x2b')]);router[_0x3ba2('0x16')](_0x3ba2('0x2c'),auth['isAuthenticated'](),controller[_0x3ba2('0x2d')]);router[_0x3ba2('0x2e')]('/:id',auth[_0x3ba2('0xa')](),controller[_0x3ba2('0x2f')]);router[_0x3ba2('0x30')]('/:id',auth[_0x3ba2('0xa')](),controller['destroy']);module[_0x3ba2('0x31')]=router; \ No newline at end of file +var _0x1b6f=['getHoppers','/:id/hopper_histories','getHopperHistories','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','root','originalname','replace','%s-%s%s','basename','extname','now','/csv','single','file','join','server/files/tmp','format','/upload/:id','import','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/tags','getTags'];(function(_0xb9ab2,_0x373a81){var _0x45bac9=function(_0x7e0e6b){while(--_0x7e0e6b){_0xb9ab2['push'](_0xb9ab2['shift']());}};_0x45bac9(++_0x373a81);}(_0x1b6f,0xf4));var _0xf1b6=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x1b6f[_0x366388];return _0x41c97e;};'use strict';var multer=require(_0xf1b6('0x0'));var util=require('util');var path=require(_0xf1b6('0x1'));var timeout=require(_0xf1b6('0x2'));var express=require(_0xf1b6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf1b6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf1b6('0x5'));router[_0xf1b6('0x6')]('/',auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x8')]);router['get'](_0xf1b6('0x9'),auth[_0xf1b6('0x7')](),controller[_0xf1b6('0xa')]);router[_0xf1b6('0x6')](_0xf1b6('0xb'),auth[_0xf1b6('0x7')](),controller['show']);router['get'](_0xf1b6('0xc'),auth[_0xf1b6('0x7')](),controller[_0xf1b6('0xd')]);router[_0xf1b6('0x6')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xf1b6('0xe')]);router['get'](_0xf1b6('0xf'),auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x10')]);router[_0xf1b6('0x6')]('/:id/hopper_finals',auth[_0xf1b6('0x7')](),controller['getHopperFinals']);router['get']('/:id/jscripty_sessions',auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x11')]);router['get']('/:id/journey',auth[_0xf1b6('0x7')](),controller['getJourney']);router[_0xf1b6('0x12')](_0xf1b6('0x13'),auth['isAuthenticated'](),controller[_0xf1b6('0x14')]);router[_0xf1b6('0x12')]('/',auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x15')]);router['post'](_0xf1b6('0x16'),auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x17')]);router['post']('/:id/tags',auth[_0xf1b6('0x7')](),controller['setTags']);var upload=multer({'storage':multer[_0xf1b6('0x18')]({'destination':function(_0xcda30,_0x33c924,_0x8bca90){_0x8bca90(null,path['join'](config[_0xf1b6('0x19')],'server/files/tmp'));},'filename':function(_0x247f8e,_0x4dcba7,_0x35ba67){_0x4dcba7[_0xf1b6('0x1a')]=_0x4dcba7[_0xf1b6('0x1a')][_0xf1b6('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x35ba67(null,util['format'](_0xf1b6('0x1c'),path[_0xf1b6('0x1d')](_0x4dcba7[_0xf1b6('0x1a')],path[_0xf1b6('0x1e')](_0x4dcba7[_0xf1b6('0x1a')])),Date[_0xf1b6('0x1f')](),path[_0xf1b6('0x1e')](_0x4dcba7[_0xf1b6('0x1a')])));}})});router['post'](_0xf1b6('0x20'),upload[_0xf1b6('0x21')](_0xf1b6('0x22')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xf1b6('0x18')]({'destination':function(_0x402fe6,_0x15f76b,_0x5edc04){_0x5edc04(null,path[_0xf1b6('0x23')](config[_0xf1b6('0x19')],_0xf1b6('0x24')));},'filename':function(_0x573718,_0x400423,_0x48f2ed){_0x400423[_0xf1b6('0x1a')]=_0x400423[_0xf1b6('0x1a')][_0xf1b6('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48f2ed(null,util[_0xf1b6('0x25')](_0xf1b6('0x1c'),path[_0xf1b6('0x1d')](_0x400423[_0xf1b6('0x1a')],path[_0xf1b6('0x1e')](_0x400423[_0xf1b6('0x1a')])),Date[_0xf1b6('0x1f')](),path[_0xf1b6('0x1e')](_0x400423[_0xf1b6('0x1a')])));}})});router['post']('/upload',upload[_0xf1b6('0x21')](_0xf1b6('0x22')),controller['upload']);router[_0xf1b6('0x12')](_0xf1b6('0x26'),auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x27')]);router['put'](_0xf1b6('0xb'),auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x28')]);router['delete']('/:id',auth[_0xf1b6('0x7')](),controller[_0xf1b6('0x29')]);module[_0xf1b6('0x2a')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ec762f0..cee09d2 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 _0x8f27=['stringify','BOOLEAN','ENUM','voice','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type','parse','values','isArray'];(function(_0x9611dc,_0x20d19a){var _0x1986c4=function(_0x408094){while(--_0x408094){_0x9611dc['push'](_0x9611dc['shift']());}};_0x1986c4(++_0x20d19a);}(_0x8f27,0x7b));var _0x78f2=function(_0x3c560a,_0x1c46d4){_0x3c560a=_0x3c560a-0x0;var _0x22e9be=_0x8f27[_0x3c560a];return _0x22e9be;};'use strict';var Sequelize=require(_0x78f2('0x0'));var _=require(_0x78f2('0x1'));module['exports']={'name':{'type':Sequelize[_0x78f2('0x2')],'get':function(_0x2400dc){return this[_0x78f2('0x3')](_0x78f2('0x4'));}},'alias':{'type':Sequelize[_0x78f2('0x5')],'allowNull':![],'set':function(_0x598b48){this[_0x78f2('0x6')](_0x78f2('0x4'),_0x598b48?_0x598b48:this[_0x78f2('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x78f2('0x7')](_0x78f2('0x8')),'get':function(){if(this[_0x78f2('0x3')](_0x78f2('0x9'))==='select'){return JSON[_0x78f2('0xa')](this[_0x78f2('0x3')](_0x78f2('0xb')));}else{return this['getDataValue'](_0x78f2('0xb'));}},'set':function(_0x4e301f){if(Array[_0x78f2('0xc')](_0x4e301f)){this['setDataValue'](_0x78f2('0xb'),JSON[_0x78f2('0xd')](_0x4e301f));}else{this[_0x78f2('0x6')]('values',_0x4e301f);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x78f2('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x78f2('0xf')](_0x78f2('0x10'))}}; \ No newline at end of file +var _0x9f7e=['parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','TEXT','long','type','select'];(function(_0x31e4ee,_0x9630fb){var _0x13eaae=function(_0x39c685){while(--_0x39c685){_0x31e4ee['push'](_0x31e4ee['shift']());}};_0x13eaae(++_0x9630fb);}(_0x9f7e,0x166));var _0xe9f7=function(_0x4311ef,_0x40a72){_0x4311ef=_0x4311ef-0x0;var _0x4e9e34=_0x9f7e[_0x4311ef];return _0x4e9e34;};'use strict';var Sequelize=require(_0xe9f7('0x0'));var _=require('lodash');module[_0xe9f7('0x1')]={'name':{'type':Sequelize[_0xe9f7('0x2')],'get':function(_0x595761){return this[_0xe9f7('0x3')](_0xe9f7('0x4'));}},'alias':{'type':Sequelize[_0xe9f7('0x5')],'allowNull':![],'set':function(_0x4bfc0c){this['setDataValue'](_0xe9f7('0x4'),_0x4bfc0c?_0x4bfc0c:this[_0xe9f7('0x3')]('name'));}},'type':{'type':Sequelize[_0xe9f7('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xe9f7('0x6')](_0xe9f7('0x7')),'get':function(){if(this[_0xe9f7('0x3')](_0xe9f7('0x8'))===_0xe9f7('0x9')){return JSON[_0xe9f7('0xa')](this[_0xe9f7('0x3')](_0xe9f7('0xb')));}else{return this[_0xe9f7('0x3')](_0xe9f7('0xb'));}},'set':function(_0x398599){if(Array[_0xe9f7('0xc')](_0x398599)){this['setDataValue'](_0xe9f7('0xb'),JSON[_0xe9f7('0xd')](_0x398599));}else{this['setDataValue'](_0xe9f7('0xb'),_0x398599);}}},'required':{'type':Sequelize[_0xe9f7('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe9f7('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe9f7('0xf')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4535e06..baacae5 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 _0x1d10=['stack','name','send','CmCustomField','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','queryInterface','addColumn','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error'];(function(_0xb41389,_0xd7548){var _0x3afe96=function(_0x2db214){while(--_0x2db214){_0xb41389['push'](_0xb41389['shift']());}};_0x3afe96(++_0xd7548);}(_0x1d10,0x1dc));var _0x01d1=function(_0xecac3a,_0x404efc){_0xecac3a=_0xecac3a-0x0;var _0x49c859=_0x1d10[_0xecac3a];return _0x49c859;};'use strict';var emlformat=require(_0x01d1('0x0'));var rimraf=require(_0x01d1('0x1'));var zipdir=require(_0x01d1('0x2'));var jsonpatch=require(_0x01d1('0x3'));var rp=require(_0x01d1('0x4'));var moment=require(_0x01d1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x01d1('0x6'));var path=require(_0x01d1('0x7'));var sox=require(_0x01d1('0x8'));var csv=require('to-csv');var ejs=require(_0x01d1('0x9'));var fs=require('fs');var fs_extra=require(_0x01d1('0xa'));var _=require(_0x01d1('0xb'));var squel=require('squel');var crypto=require(_0x01d1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x01d1('0xd'));var toCsv=require(_0x01d1('0xe'));var querystring=require(_0x01d1('0xf'));var Papa=require(_0x01d1('0x10'));var Redis=require(_0x01d1('0x11'));var authService=require(_0x01d1('0x12'));var qs=require(_0x01d1('0x13'));var as=require(_0x01d1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x01d1('0x15'));var utils=require(_0x01d1('0x16'));var config=require(_0x01d1('0x17'));var licenseUtil=require(_0x01d1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ddb91,_0x4d923b){_0x4d923b=_0x4d923b||0xcc;return function(_0x10dfc2){if(_0x10dfc2){return _0x3ddb91[_0x01d1('0x19')](_0x4d923b);}return _0x3ddb91[_0x01d1('0x1a')](_0x4d923b)['end']();};}function respondWithResult(_0x370cf7,_0x1988cd){_0x1988cd=_0x1988cd||0xc8;return function(_0x188fa0){if(_0x188fa0){return _0x370cf7[_0x01d1('0x1a')](_0x1988cd)[_0x01d1('0x1b')](_0x188fa0);}};}function respondWithFilteredResult(_0x5a3c6f,_0x1a7f48){return function(_0x4808c5){if(_0x4808c5){var _0xa1ac92=typeof _0x1a7f48['offset']===_0x01d1('0x1c')&&typeof _0x1a7f48[_0x01d1('0x1d')]===_0x01d1('0x1c');var _0x1460c2=_0x4808c5[_0x01d1('0x1e')];var _0xababe2=_0xa1ac92?0x0:_0x1a7f48[_0x01d1('0x1f')];var _0x404cc1=_0xa1ac92?_0x4808c5[_0x01d1('0x1e')]:_0x1a7f48[_0x01d1('0x1f')]+_0x1a7f48[_0x01d1('0x1d')];var _0x2489b9;if(_0x404cc1>=_0x1460c2){_0x404cc1=_0x1460c2;_0x2489b9=0xc8;}else{_0x2489b9=0xce;}_0x5a3c6f[_0x01d1('0x1a')](_0x2489b9);return _0x5a3c6f[_0x01d1('0x20')](_0x01d1('0x21'),_0xababe2+'-'+_0x404cc1+'/'+_0x1460c2)[_0x01d1('0x1b')](_0x4808c5);}return null;};}function patchUpdates(_0x3a394b){return function(_0x49e2d9){try{jsonpatch[_0x01d1('0x22')](_0x49e2d9,_0x3a394b,!![]);}catch(_0x46fd34){return BPromise['reject'](_0x46fd34);}return _0x49e2d9['save']();};}function saveUpdates(_0x5433ef,_0x588686){return function(_0x2dd927){if(_0x2dd927){return _0x2dd927[_0x01d1('0x23')](_0x5433ef)[_0x01d1('0x24')](function(_0x4b99cd){return _0x4b99cd;});}return null;};}function removeEntity(_0x28afaa,_0x2b6719){return function(_0x4b9570){if(_0x4b9570){return _0x4b9570[_0x01d1('0x25')]()['then'](function(){_0x28afaa[_0x01d1('0x1a')](0xcc)[_0x01d1('0x26')]();});}};}function handleEntityNotFound(_0x59272b,_0xbcdb3a){return function(_0x2d10e6){if(!_0x2d10e6){_0x59272b['sendStatus'](0x194);}return _0x2d10e6;};}function handleError(_0xb6ffbe,_0x3fa856){_0x3fa856=_0x3fa856||0x1f4;return function(_0x207d6e){logger[_0x01d1('0x27')](_0x207d6e[_0x01d1('0x28')]);if(_0x207d6e[_0x01d1('0x29')]){delete _0x207d6e[_0x01d1('0x29')];}_0xb6ffbe['status'](_0x3fa856)[_0x01d1('0x2a')](_0x207d6e);};}exports['index']=function(_0x108340,_0x3b4b58){var _0x235f60={},_0x4f3891={},_0x322e61={'count':0x0,'rows':[]};var _0x143279=_['map'](db[_0x01d1('0x2b')]['rawAttributes'],function(_0xe4be3e){return{'name':_0xe4be3e['fieldName'],'type':_0xe4be3e[_0x01d1('0x2c')][_0x01d1('0x2d')]};});_0x4f3891[_0x01d1('0x2e')]=_[_0x01d1('0x2f')](_[_0x01d1('0x30')](_0x143279,'name'),[_0x01d1('0x29')]);_0x4f3891[_0x01d1('0x31')]=_[_0x01d1('0x32')](_0x108340[_0x01d1('0x31')]);_0x4f3891[_0x01d1('0x33')]=_[_0x01d1('0x34')](_0x4f3891['model'],_0x4f3891['query']);_0x235f60[_0x01d1('0x35')]=_[_0x01d1('0x34')](_0x4f3891[_0x01d1('0x2e')],qs[_0x01d1('0x36')](_0x108340[_0x01d1('0x31')][_0x01d1('0x36')]));_0x235f60[_0x01d1('0x35')]=_0x235f60[_0x01d1('0x35')]['length']?_0x235f60[_0x01d1('0x35')]:_0x4f3891[_0x01d1('0x2e')];if(!_0x108340[_0x01d1('0x31')][_0x01d1('0x37')](_0x01d1('0x38'))){_0x235f60[_0x01d1('0x1d')]=qs[_0x01d1('0x1d')](_0x108340[_0x01d1('0x31')]['limit']);_0x235f60[_0x01d1('0x1f')]=qs['offset'](_0x108340[_0x01d1('0x31')][_0x01d1('0x1f')]);}_0x235f60['order']=qs[_0x01d1('0x39')](_0x108340[_0x01d1('0x31')]['sort']);_0x235f60[_0x01d1('0x3a')]=qs[_0x01d1('0x33')](_['pick'](_0x108340['query'],_0x4f3891[_0x01d1('0x33')]),_0x143279);if(_0x108340['query'][_0x01d1('0x3b')]){_0x235f60[_0x01d1('0x3a')]=_[_0x01d1('0x3c')](_0x235f60[_0x01d1('0x3a')],{'$or':_[_0x01d1('0x30')](_0x143279,function(_0x2f60df){if(_0x2f60df[_0x01d1('0x2c')]!==_0x01d1('0x3d')){var _0x49a221={};_0x49a221[_0x2f60df[_0x01d1('0x29')]]={'$like':'%'+_0x108340[_0x01d1('0x31')][_0x01d1('0x3b')]+'%'};return _0x49a221;}})});}_0x235f60=_[_0x01d1('0x3c')]({},_0x235f60,_0x108340['options']);var _0x49cd27={'where':_0x235f60[_0x01d1('0x3a')]};return db[_0x01d1('0x2b')]['count'](_0x49cd27)[_0x01d1('0x24')](function(_0x34b0e5){_0x322e61[_0x01d1('0x1e')]=_0x34b0e5;if(_0x108340[_0x01d1('0x31')][_0x01d1('0x3e')]){_0x235f60[_0x01d1('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x01d1('0x40')](_0x235f60);})['then'](function(_0x34ca78){_0x322e61[_0x01d1('0x41')]=_0x34ca78;return _0x322e61;})[_0x01d1('0x24')](respondWithFilteredResult(_0x3b4b58,_0x235f60))[_0x01d1('0x42')](handleError(_0x3b4b58,null));};exports[_0x01d1('0x43')]=function(_0x43a016,_0x43f1c5){var _0x2e7f6c={'raw':!![],'where':{'id':_0x43a016[_0x01d1('0x44')]['id']}},_0x481d42={};_0x481d42[_0x01d1('0x2e')]=_[_0x01d1('0x32')](db[_0x01d1('0x2b')][_0x01d1('0x45')]);_0x481d42[_0x01d1('0x31')]=_['keys'](_0x43a016[_0x01d1('0x31')]);_0x481d42[_0x01d1('0x33')]=_[_0x01d1('0x34')](_0x481d42[_0x01d1('0x2e')],_0x481d42[_0x01d1('0x31')]);_0x2e7f6c['attributes']=_[_0x01d1('0x34')](_0x481d42[_0x01d1('0x2e')],qs['fields'](_0x43a016[_0x01d1('0x31')][_0x01d1('0x36')]));_0x2e7f6c['attributes']=_0x2e7f6c[_0x01d1('0x35')][_0x01d1('0x46')]?_0x2e7f6c[_0x01d1('0x35')]:_0x481d42[_0x01d1('0x2e')];if(_0x43a016[_0x01d1('0x31')]['includeAll']){_0x2e7f6c['include']=[{'all':!![]}];}_0x2e7f6c=_['merge']({},_0x2e7f6c,_0x43a016[_0x01d1('0x47')]);return db[_0x01d1('0x2b')][_0x01d1('0x48')](_0x2e7f6c)['then'](handleEntityNotFound(_0x43f1c5,null))['then'](respondWithResult(_0x43f1c5,null))[_0x01d1('0x42')](handleError(_0x43f1c5,null));};exports[_0x01d1('0x23')]=function(_0x2be39b,_0x5f2f27){if(_0x2be39b[_0x01d1('0x49')]['id']){delete _0x2be39b[_0x01d1('0x49')]['id'];}return db[_0x01d1('0x2b')][_0x01d1('0x48')]({'where':{'id':_0x2be39b[_0x01d1('0x44')]['id']}})[_0x01d1('0x24')](handleEntityNotFound(_0x5f2f27,null))['then'](saveUpdates(_0x2be39b[_0x01d1('0x49')],null))[_0x01d1('0x24')](respondWithResult(_0x5f2f27,null))[_0x01d1('0x42')](handleError(_0x5f2f27,null));};exports[_0x01d1('0x25')]=function(_0x356346,_0x50ba25){return db[_0x01d1('0x2b')][_0x01d1('0x48')]({'where':{'id':_0x356346[_0x01d1('0x44')]['id']}})[_0x01d1('0x24')](handleEntityNotFound(_0x50ba25,null))[_0x01d1('0x24')](removeEntity(_0x50ba25,null))['catch'](handleError(_0x50ba25,null));};exports[_0x01d1('0x4a')]=function(_0x1675c3,_0xa80b44){var _0x2c7484;return db[_0x01d1('0x4b')][_0x01d1('0x4c')](function(_0x56d5a0){return db[_0x01d1('0x2b')][_0x01d1('0x4a')](_0x1675c3[_0x01d1('0x49')],{'transaction':_0x56d5a0})['then'](function(_0x4d8b1e){_0x2c7484=_0x4d8b1e;var _0x4aa1dd={'type':db[_0x01d1('0x4d')][_0x01d1('0x4e')],'transaction':_0x56d5a0};switch(_0x1675c3['body'][_0x01d1('0x2c')]){case _0x01d1('0x4f'):_0x4aa1dd['type']=db[_0x01d1('0x4d')]['TEXT'];break;case'number':_0x4aa1dd[_0x01d1('0x2c')]=db[_0x01d1('0x4d')][_0x01d1('0x50')];break;case _0x01d1('0x51'):_0x4aa1dd[_0x01d1('0x2c')]=db[_0x01d1('0x4d')][_0x01d1('0x52')];_0x4aa1dd['defaultValue']=![];break;default:}return db[_0x01d1('0x4b')][_0x01d1('0x53')][_0x01d1('0x54')]('cm_contacts',util[_0x01d1('0x55')]('cf_%d',_0x2c7484['id']),_0x4aa1dd);})[_0x01d1('0x24')](function(){return _0x2c7484;});})[_0x01d1('0x24')](respondWithResult(_0xa80b44,0xc9))['catch'](handleError(_0xa80b44,null));}; \ No newline at end of file +var _0x79fe=['intersection','length','include','find','body','create','transaction','TEXT','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','count','CmCustomField','findAll','rows','catch','show','params'];(function(_0x3df1d2,_0xe38d80){var _0x3af47e=function(_0x5538a3){while(--_0x5538a3){_0x3df1d2['push'](_0x3df1d2['shift']());}};_0x3af47e(++_0xe38d80);}(_0x79fe,0x17d));var _0xe79f=function(_0x59c8bf,_0x8ebd29){_0x59c8bf=_0x59c8bf-0x0;var _0x111039=_0x79fe[_0x59c8bf];return _0x111039;};'use strict';var emlformat=require(_0xe79f('0x0'));var rimraf=require(_0xe79f('0x1'));var zipdir=require(_0xe79f('0x2'));var jsonpatch=require(_0xe79f('0x3'));var rp=require('request-promise');var moment=require(_0xe79f('0x4'));var BPromise=require(_0xe79f('0x5'));var Mustache=require(_0xe79f('0x6'));var util=require(_0xe79f('0x7'));var path=require(_0xe79f('0x8'));var sox=require(_0xe79f('0x9'));var csv=require(_0xe79f('0xa'));var ejs=require(_0xe79f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe79f('0xc'));var squel=require(_0xe79f('0xd'));var crypto=require(_0xe79f('0xe'));var jsforce=require(_0xe79f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe79f('0xa'));var querystring=require(_0xe79f('0x10'));var Papa=require(_0xe79f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe79f('0x12'));var as=require(_0xe79f('0x13'));var hardwareService=require(_0xe79f('0x14'));var logger=require(_0xe79f('0x15'))(_0xe79f('0x16'));var utils=require(_0xe79f('0x17'));var config=require(_0xe79f('0x18'));var licenseUtil=require(_0xe79f('0x19'));var db=require(_0xe79f('0x1a'))['db'];function respondWithStatusCode(_0x22d60d,_0x2454f7){_0x2454f7=_0x2454f7||0xcc;return function(_0x566af4){if(_0x566af4){return _0x22d60d[_0xe79f('0x1b')](_0x2454f7);}return _0x22d60d[_0xe79f('0x1c')](_0x2454f7)['end']();};}function respondWithResult(_0x306b93,_0x49ff1d){_0x49ff1d=_0x49ff1d||0xc8;return function(_0x2299e1){if(_0x2299e1){return _0x306b93[_0xe79f('0x1c')](_0x49ff1d)['json'](_0x2299e1);}};}function respondWithFilteredResult(_0x2279c5,_0x3d00fb){return function(_0x1e793d){if(_0x1e793d){var _0x4d13a0=typeof _0x3d00fb[_0xe79f('0x1d')]===_0xe79f('0x1e')&&typeof _0x3d00fb[_0xe79f('0x1f')]===_0xe79f('0x1e');var _0x3d546f=_0x1e793d['count'];var _0x365a83=_0x4d13a0?0x0:_0x3d00fb['offset'];var _0x4d5b04=_0x4d13a0?_0x1e793d['count']:_0x3d00fb['offset']+_0x3d00fb[_0xe79f('0x1f')];var _0xb2e15c;if(_0x4d5b04>=_0x3d546f){_0x4d5b04=_0x3d546f;_0xb2e15c=0xc8;}else{_0xb2e15c=0xce;}_0x2279c5['status'](_0xb2e15c);return _0x2279c5[_0xe79f('0x20')](_0xe79f('0x21'),_0x365a83+'-'+_0x4d5b04+'/'+_0x3d546f)[_0xe79f('0x22')](_0x1e793d);}return null;};}function patchUpdates(_0x30bd4){return function(_0x140d88){try{jsonpatch[_0xe79f('0x23')](_0x140d88,_0x30bd4,!![]);}catch(_0x28eda9){return BPromise[_0xe79f('0x24')](_0x28eda9);}return _0x140d88[_0xe79f('0x25')]();};}function saveUpdates(_0x1b183a,_0x23fa43){return function(_0x3ff97b){if(_0x3ff97b){return _0x3ff97b[_0xe79f('0x26')](_0x1b183a)[_0xe79f('0x27')](function(_0x2253dc){return _0x2253dc;});}return null;};}function removeEntity(_0x151985,_0x224692){return function(_0xf46ae2){if(_0xf46ae2){return _0xf46ae2[_0xe79f('0x28')]()[_0xe79f('0x27')](function(){_0x151985[_0xe79f('0x1c')](0xcc)[_0xe79f('0x29')]();});}};}function handleEntityNotFound(_0x529b9c,_0xdd4b6a){return function(_0x24084a){if(!_0x24084a){_0x529b9c[_0xe79f('0x1b')](0x194);}return _0x24084a;};}function handleError(_0xbf5cf4,_0x270774){_0x270774=_0x270774||0x1f4;return function(_0x1f9f59){logger[_0xe79f('0x2a')](_0x1f9f59[_0xe79f('0x2b')]);if(_0x1f9f59[_0xe79f('0x2c')]){delete _0x1f9f59[_0xe79f('0x2c')];}_0xbf5cf4['status'](_0x270774)[_0xe79f('0x2d')](_0x1f9f59);};}exports['index']=function(_0x33ca58,_0x518099){var _0x32012c={},_0x5785ce={},_0x1c72bb={'count':0x0,'rows':[]};var _0x36a481=_[_0xe79f('0x2e')](db['CmCustomField'][_0xe79f('0x2f')],function(_0x1ec189){return{'name':_0x1ec189[_0xe79f('0x30')],'type':_0x1ec189[_0xe79f('0x31')][_0xe79f('0x32')]};});_0x5785ce[_0xe79f('0x33')]=_[_0xe79f('0x34')](_[_0xe79f('0x2e')](_0x36a481,'name'),[_0xe79f('0x2c')]);_0x5785ce[_0xe79f('0x35')]=_[_0xe79f('0x36')](_0x33ca58[_0xe79f('0x35')]);_0x5785ce[_0xe79f('0x37')]=_['intersection'](_0x5785ce[_0xe79f('0x33')],_0x5785ce[_0xe79f('0x35')]);_0x32012c[_0xe79f('0x38')]=_['intersection'](_0x5785ce['model'],qs[_0xe79f('0x39')](_0x33ca58[_0xe79f('0x35')][_0xe79f('0x39')]));_0x32012c[_0xe79f('0x38')]=_0x32012c[_0xe79f('0x38')]['length']?_0x32012c['attributes']:_0x5785ce[_0xe79f('0x33')];if(!_0x33ca58['query'][_0xe79f('0x3a')](_0xe79f('0x3b'))){_0x32012c[_0xe79f('0x1f')]=qs[_0xe79f('0x1f')](_0x33ca58[_0xe79f('0x35')]['limit']);_0x32012c['offset']=qs[_0xe79f('0x1d')](_0x33ca58[_0xe79f('0x35')][_0xe79f('0x1d')]);}_0x32012c['order']=qs[_0xe79f('0x3c')](_0x33ca58[_0xe79f('0x35')]['sort']);_0x32012c['where']=qs[_0xe79f('0x37')](_[_0xe79f('0x3d')](_0x33ca58[_0xe79f('0x35')],_0x5785ce[_0xe79f('0x37')]),_0x36a481);if(_0x33ca58['query'][_0xe79f('0x3e')]){_0x32012c['where']=_[_0xe79f('0x3f')](_0x32012c[_0xe79f('0x40')],{'$or':_[_0xe79f('0x2e')](_0x36a481,function(_0x427e5e){if(_0x427e5e[_0xe79f('0x31')]!==_0xe79f('0x41')){var _0x2d760e={};_0x2d760e[_0x427e5e[_0xe79f('0x2c')]]={'$like':'%'+_0x33ca58['query'][_0xe79f('0x3e')]+'%'};return _0x2d760e;}})});}_0x32012c=_['merge']({},_0x32012c,_0x33ca58[_0xe79f('0x42')]);var _0x48e42e={'where':_0x32012c['where']};return db['CmCustomField'][_0xe79f('0x43')](_0x48e42e)[_0xe79f('0x27')](function(_0x14fc65){_0x1c72bb[_0xe79f('0x43')]=_0x14fc65;if(_0x33ca58[_0xe79f('0x35')]['includeAll']){_0x32012c['include']=[{'all':!![]}];}return db[_0xe79f('0x44')][_0xe79f('0x45')](_0x32012c);})[_0xe79f('0x27')](function(_0x2cab9f){_0x1c72bb[_0xe79f('0x46')]=_0x2cab9f;return _0x1c72bb;})[_0xe79f('0x27')](respondWithFilteredResult(_0x518099,_0x32012c))[_0xe79f('0x47')](handleError(_0x518099,null));};exports[_0xe79f('0x48')]=function(_0x4b64b7,_0x566ff5){var _0x55f19a={'raw':!![],'where':{'id':_0x4b64b7[_0xe79f('0x49')]['id']}},_0x379127={};_0x379127[_0xe79f('0x33')]=_[_0xe79f('0x36')](db[_0xe79f('0x44')][_0xe79f('0x2f')]);_0x379127['query']=_[_0xe79f('0x36')](_0x4b64b7[_0xe79f('0x35')]);_0x379127[_0xe79f('0x37')]=_[_0xe79f('0x4a')](_0x379127[_0xe79f('0x33')],_0x379127[_0xe79f('0x35')]);_0x55f19a['attributes']=_['intersection'](_0x379127['model'],qs[_0xe79f('0x39')](_0x4b64b7[_0xe79f('0x35')]['fields']));_0x55f19a['attributes']=_0x55f19a[_0xe79f('0x38')][_0xe79f('0x4b')]?_0x55f19a[_0xe79f('0x38')]:_0x379127[_0xe79f('0x33')];if(_0x4b64b7[_0xe79f('0x35')]['includeAll']){_0x55f19a[_0xe79f('0x4c')]=[{'all':!![]}];}_0x55f19a=_[_0xe79f('0x3f')]({},_0x55f19a,_0x4b64b7['options']);return db[_0xe79f('0x44')][_0xe79f('0x4d')](_0x55f19a)[_0xe79f('0x27')](handleEntityNotFound(_0x566ff5,null))[_0xe79f('0x27')](respondWithResult(_0x566ff5,null))['catch'](handleError(_0x566ff5,null));};exports[_0xe79f('0x26')]=function(_0x2b4cbe,_0x2b15ed){if(_0x2b4cbe['body']['id']){delete _0x2b4cbe['body']['id'];}return db[_0xe79f('0x44')]['find']({'where':{'id':_0x2b4cbe[_0xe79f('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b15ed,null))[_0xe79f('0x27')](saveUpdates(_0x2b4cbe[_0xe79f('0x4e')],null))['then'](respondWithResult(_0x2b15ed,null))[_0xe79f('0x47')](handleError(_0x2b15ed,null));};exports['destroy']=function(_0x409d80,_0x540a36){return db['CmCustomField'][_0xe79f('0x4d')]({'where':{'id':_0x409d80['params']['id']}})[_0xe79f('0x27')](handleEntityNotFound(_0x540a36,null))[_0xe79f('0x27')](removeEntity(_0x540a36,null))[_0xe79f('0x47')](handleError(_0x540a36,null));};exports[_0xe79f('0x4f')]=function(_0x160054,_0x1a53d4){var _0x198237;return db['sequelize'][_0xe79f('0x50')](function(_0xff6b2){return db['CmCustomField']['create'](_0x160054['body'],{'transaction':_0xff6b2})[_0xe79f('0x27')](function(_0x3492f9){_0x198237=_0x3492f9;var _0x3da3e5={'type':db['Sequelize'][_0xe79f('0x51')],'transaction':_0xff6b2};switch(_0x160054[_0xe79f('0x4e')][_0xe79f('0x31')]){case'text':_0x3da3e5[_0xe79f('0x31')]=db[_0xe79f('0x52')][_0xe79f('0x51')];break;case _0xe79f('0x53'):_0x3da3e5[_0xe79f('0x31')]=db[_0xe79f('0x52')][_0xe79f('0x54')];break;case _0xe79f('0x55'):_0x3da3e5[_0xe79f('0x31')]=db[_0xe79f('0x52')][_0xe79f('0x56')];_0x3da3e5[_0xe79f('0x57')]=![];break;default:}return db[_0xe79f('0x58')]['queryInterface'][_0xe79f('0x59')]('cm_contacts',util['format'](_0xe79f('0x5a'),_0x198237['id']),_0x3da3e5);})[_0xe79f('0x27')](function(){return _0x198237;});})[_0xe79f('0x27')](respondWithResult(_0x1a53d4,0xc9))['catch'](handleError(_0x1a53d4,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index a018cc0..0c1e421 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 _0x448e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x2440df,_0x453be8){var _0x1fa6fb=function(_0x1e0417){while(--_0x1e0417){_0x2440df['push'](_0x2440df['shift']());}};_0x1fa6fb(++_0x453be8);}(_0x448e,0x194));var _0xe448=function(_0x9ac2cb,_0x1b0500){_0x9ac2cb=_0x9ac2cb-0x0;var _0x217bf3=_0x448e[_0x9ac2cb];return _0x217bf3;};'use strict';var _=require(_0xe448('0x0'));var util=require(_0xe448('0x1'));var logger=require(_0xe448('0x2'))('api');var moment=require(_0xe448('0x3'));var BPromise=require(_0xe448('0x4'));var rp=require(_0xe448('0x5'));var fs=require('fs');var path=require(_0xe448('0x6'));var rimraf=require(_0xe448('0x7'));var config=require(_0xe448('0x8'));var attributes=require(_0xe448('0x9'));module[_0xe448('0xa')]=function(_0x131642,_0x3b9ca6){return _0x131642[_0xe448('0xb')](_0xe448('0xc'),attributes,{'tableName':_0xe448('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0207=['../../config/logger','path','./cmCustomField.attributes','define','CmCustomField','lodash','util'];(function(_0x16acc6,_0x3dd9ae){var _0x2970f1=function(_0x40e0ad){while(--_0x40e0ad){_0x16acc6['push'](_0x16acc6['shift']());}};_0x2970f1(++_0x3dd9ae);}(_0x0207,0x11d));var _0x7020=function(_0xd9ab80,_0x1f1968){_0xd9ab80=_0xd9ab80-0x0;var _0x559fc7=_0x0207[_0xd9ab80];return _0x559fc7;};'use strict';var _=require(_0x7020('0x0'));var util=require(_0x7020('0x1'));var logger=require(_0x7020('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7020('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7020('0x4'));module['exports']=function(_0x21c546,_0x38217e){return _0x21c546[_0x7020('0x5')](_0x7020('0x6'),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 1f2bddb..9759f97 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 _0xbd38=['request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0xbd38,0x187));var _0x8bd3=function(_0x1e0442,_0x289c7f){_0x1e0442=_0x1e0442-0x0;var _0x1f4f61=_0xbd38[_0x1e0442];return _0x1f4f61;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8bd3('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bd3('0x1'));var db=require(_0x8bd3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bd3('0x3'))(_0x8bd3('0x4'));var config=require(_0x8bd3('0x5'));var jayson=require(_0x8bd3('0x6'));var client=jayson[_0x8bd3('0x7')][_0x8bd3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10c109,_0x39e105,_0x5e782f){return new BPromise(function(_0x1c4f61,_0x3e5b5f){return client[_0x8bd3('0x9')](_0x10c109,_0x5e782f)[_0x8bd3('0xa')](function(_0x4a6259){logger['info'](_0x8bd3('0xb'),_0x39e105,_0x8bd3('0xc'));logger['debug'](_0x8bd3('0xd'),_0x39e105,_0x8bd3('0xc'),JSON[_0x8bd3('0xe')](_0x4a6259));if(_0x4a6259[_0x8bd3('0xf')]){if(_0x4a6259[_0x8bd3('0xf')][_0x8bd3('0x10')]===0x1f4){logger[_0x8bd3('0xf')](_0x8bd3('0xb'),_0x39e105,_0x4a6259[_0x8bd3('0xf')][_0x8bd3('0x11')]);return _0x3e5b5f(_0x4a6259[_0x8bd3('0xf')][_0x8bd3('0x11')]);}logger['error'](_0x8bd3('0xb'),_0x39e105,_0x4a6259[_0x8bd3('0xf')][_0x8bd3('0x11')]);return _0x1c4f61(_0x4a6259[_0x8bd3('0xf')][_0x8bd3('0x11')]);}else{logger[_0x8bd3('0x12')]('CmCustomField,\x20%s,\x20%s',_0x39e105,'request\x20sent');_0x1c4f61(_0x4a6259[_0x8bd3('0x13')][_0x8bd3('0x11')]);}})['catch'](function(_0x24c560){logger[_0x8bd3('0xf')](_0x8bd3('0xb'),_0x39e105,_0x24c560);_0x3e5b5f(_0x24c560);});});} \ No newline at end of file +var _0xa42e=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x43d32b,_0x109e07){var _0x43b8e5=function(_0x7c030d){while(--_0x7c030d){_0x43d32b['push'](_0x43d32b['shift']());}};_0x43b8e5(++_0x109e07);}(_0xa42e,0x168));var _0xea42=function(_0x13c195,_0x484580){_0x13c195=_0x13c195-0x0;var _0x15ad32=_0xa42e[_0x13c195];return _0x15ad32;};'use strict';var _=require(_0xea42('0x0'));var util=require(_0xea42('0x1'));var moment=require('moment');var BPromise=require(_0xea42('0x2'));var rs=require(_0xea42('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea42('0x4'))['db'];var utils=require(_0xea42('0x5'));var logger=require(_0xea42('0x6'))(_0xea42('0x7'));var config=require(_0xea42('0x8'));var jayson=require(_0xea42('0x9'));var client=jayson[_0xea42('0xa')][_0xea42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x139fc3,_0xca4303,_0x58ed6a){return new BPromise(function(_0x1b950c,_0x541712){return client[_0xea42('0xc')](_0x139fc3,_0x58ed6a)[_0xea42('0xd')](function(_0x1406fc){logger[_0xea42('0xe')](_0xea42('0xf'),_0xca4303,_0xea42('0x10'));logger[_0xea42('0x11')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xca4303,_0xea42('0x10'),JSON[_0xea42('0x12')](_0x1406fc));if(_0x1406fc['error']){if(_0x1406fc[_0xea42('0x13')][_0xea42('0x14')]===0x1f4){logger[_0xea42('0x13')](_0xea42('0xf'),_0xca4303,_0x1406fc[_0xea42('0x13')][_0xea42('0x15')]);return _0x541712(_0x1406fc[_0xea42('0x13')][_0xea42('0x15')]);}logger[_0xea42('0x13')](_0xea42('0xf'),_0xca4303,_0x1406fc[_0xea42('0x13')]['message']);return _0x1b950c(_0x1406fc['error'][_0xea42('0x15')]);}else{logger[_0xea42('0xe')]('CmCustomField,\x20%s,\x20%s',_0xca4303,_0xea42('0x10'));_0x1b950c(_0x1406fc[_0xea42('0x16')]['message']);}})[_0xea42('0x17')](function(_0x551f7c){logger[_0xea42('0x13')](_0xea42('0xf'),_0xca4303,_0x551f7c);_0x541712(_0x551f7c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index a177ce4..e2b035a 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 _0x2384=['../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b37c7,_0x15d5d7){var _0x1879f3=function(_0x4a2fe6){while(--_0x4a2fe6){_0x1b37c7['push'](_0x1b37c7['shift']());}};_0x1879f3(++_0x15d5d7);}(_0x2384,0x1aa));var _0x4238=function(_0x8f97ae,_0x22c0d1){_0x8f97ae=_0x8f97ae-0x0;var _0x2e8423=_0x2384[_0x8f97ae];return _0x2e8423;};'use strict';var multer=require(_0x4238('0x0'));var util=require('util');var path=require(_0x4238('0x1'));var timeout=require(_0x4238('0x2'));var express=require(_0x4238('0x3'));var router=express[_0x4238('0x4')]();var fs_extra=require(_0x4238('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4238('0x6'));var config=require('../../config/environment');var controller=require(_0x4238('0x7'));router[_0x4238('0x8')]('/',auth[_0x4238('0x9')](),controller[_0x4238('0xa')]);router[_0x4238('0x8')](_0x4238('0xb'),auth[_0x4238('0x9')](),controller[_0x4238('0xc')]);router[_0x4238('0xd')]('/',auth['isAuthenticated'](),controller[_0x4238('0xe')]);router[_0x4238('0xf')]('/:id',auth[_0x4238('0x9')](),controller['update']);router['delete'](_0x4238('0xb'),auth[_0x4238('0x9')](),controller[_0x4238('0x10')]);module[_0x4238('0x11')]=router; \ No newline at end of file +var _0xed5f=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x66ad07,_0xb8dc38){var _0x23fe59=function(_0x21e728){while(--_0x21e728){_0x66ad07['push'](_0x66ad07['shift']());}};_0x23fe59(++_0xb8dc38);}(_0xed5f,0x1e6));var _0xfed5=function(_0x632122,_0x48a81c){_0x632122=_0x632122-0x0;var _0x4b7fc0=_0xed5f[_0x632122];return _0x4b7fc0;};'use strict';var multer=require('multer');var util=require(_0xfed5('0x0'));var path=require(_0xfed5('0x1'));var timeout=require(_0xfed5('0x2'));var express=require('express');var router=express[_0xfed5('0x3')]();var fs_extra=require(_0xfed5('0x4'));var auth=require(_0xfed5('0x5'));var interaction=require(_0xfed5('0x6'));var config=require('../../config/environment');var controller=require(_0xfed5('0x7'));router[_0xfed5('0x8')]('/',auth[_0xfed5('0x9')](),controller['index']);router[_0xfed5('0x8')](_0xfed5('0xa'),auth['isAuthenticated'](),controller[_0xfed5('0xb')]);router[_0xfed5('0xc')]('/',auth[_0xfed5('0x9')](),controller[_0xfed5('0xd')]);router[_0xfed5('0xe')](_0xfed5('0xa'),auth[_0xfed5('0x9')](),controller[_0xfed5('0xf')]);router[_0xfed5('0x10')](_0xfed5('0xa'),auth[_0xfed5('0x9')](),controller[_0xfed5('0x11')]);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 b85b73a..778a10a 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 _0x8ac3=['DATE','contactListQueue','moment','sequelize','STRING','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x56ea12,_0x304238){var _0x4b9883=function(_0x5a0ffa){while(--_0x5a0ffa){_0x56ea12['push'](_0x56ea12['shift']());}};_0x4b9883(++_0x304238);}(_0x8ac3,0x152));var _0x38ac=function(_0x1794d1,_0x34ce96){_0x1794d1=_0x1794d1-0x0;var _0x21f540=_0x8ac3[_0x1794d1];return _0x21f540;};'use strict';var moment=require(_0x38ac('0x0'));var Sequelize=require(_0x38ac('0x1'));module['exports']={'phone':{'type':Sequelize[_0x38ac('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x38ac('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x38ac('0x4'))},'countbusyretry':{'type':Sequelize[_0x38ac('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x38ac('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x38ac('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x38ac('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x38ac('0x6')]},'priority':{'type':Sequelize[_0x38ac('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x38ac('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x38ac('0x7')},'UserId':{'type':Sequelize[_0x38ac('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x38ac('0x5')],'unique':_0x38ac('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x38ac('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x38ac('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x38ac('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x38ac('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc17a=['BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','exports','STRING'];(function(_0x53204f,_0x3f9beb){var _0x25cde5=function(_0x28f70b){while(--_0x28f70b){_0x53204f['push'](_0x53204f['shift']());}};_0x25cde5(++_0x3f9beb);}(_0xc17a,0x156));var _0xac17=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xc17a[_0x344a3f];return _0x264712;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xac17('0x0')]={'phone':{'type':Sequelize[_0xac17('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xac17('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xac17('0x3')],'defaultValue':moment()[_0xac17('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xac17('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xac17('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xac17('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xac17('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xac17('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xac17('0x3')]},'priority':{'type':Sequelize[_0xac17('0x5')](0x2)[_0xac17('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xac17('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xac17('0x5')],'unique':_0xac17('0x7')},'ListId':{'type':Sequelize[_0xac17('0x5')],'unique':_0xac17('0x7')},'UserId':{'type':Sequelize[_0xac17('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xac17('0x5')],'unique':_0xac17('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xac17('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xac17('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xac17('0x5')],'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 d957693..0aeaea7 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 _0x5da8=['ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Queue','dialActive','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','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','sendStatus','status','end','json','limit','offset','count','Content-Range','apply','save','then','destroy','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','$or','$gt','$lt','$lte','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','options','where','include','findAll','catch','show','params','includeAll','find','create','body','update','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','deleted','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','describe','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','scheduledAt'];(function(_0x4d328c,_0x576aa0){var _0xc6f817=function(_0x4ba3e1){while(--_0x4ba3e1){_0x4d328c['push'](_0x4d328c['shift']());}};_0xc6f817(++_0x576aa0);}(_0x5da8,0x1cb));var _0x85da=function(_0x3bce49,_0x36eda5){_0x3bce49=_0x3bce49-0x0;var _0x5a3954=_0x5da8[_0x3bce49];return _0x5a3954;};'use strict';var emlformat=require(_0x85da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85da('0x1'));var jsonpatch=require(_0x85da('0x2'));var rp=require(_0x85da('0x3'));var moment=require(_0x85da('0x4'));var BPromise=require(_0x85da('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x85da('0x6'));var sox=require(_0x85da('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85da('0x8'));var _=require(_0x85da('0x9'));var squel=require(_0x85da('0xa'));var crypto=require(_0x85da('0xb'));var jsforce=require(_0x85da('0xc'));var deskjs=require(_0x85da('0xd'));var toCsv=require('to-csv');var querystring=require(_0x85da('0xe'));var Papa=require(_0x85da('0xf'));var Redis=require('ioredis');var authService=require(_0x85da('0x10'));var qs=require(_0x85da('0x11'));var as=require(_0x85da('0x12'));var hardwareService=require(_0x85da('0x13'));var logger=require('../../config/logger')(_0x85da('0x14'));var utils=require(_0x85da('0x15'));var config=require(_0x85da('0x16'));var licenseUtil=require(_0x85da('0x17'));var db=require(_0x85da('0x18'))['db'];function respondWithStatusCode(_0x2f58b,_0x57dce0){_0x57dce0=_0x57dce0||0xcc;return function(_0x4334d8){if(_0x4334d8){return _0x2f58b[_0x85da('0x19')](_0x57dce0);}return _0x2f58b[_0x85da('0x1a')](_0x57dce0)[_0x85da('0x1b')]();};}function respondWithResult(_0x123522,_0x15eb71){_0x15eb71=_0x15eb71||0xc8;return function(_0x1992c9){if(_0x1992c9){return _0x123522[_0x85da('0x1a')](_0x15eb71)[_0x85da('0x1c')](_0x1992c9);}};}function respondWithFilteredResult(_0x39e21d,_0x38a0bf){return function(_0x3de5a3){if(_0x3de5a3){var _0x1443c7=typeof _0x38a0bf['offset']==='undefined'&&typeof _0x38a0bf[_0x85da('0x1d')]==='undefined';var _0x25c85f=_0x3de5a3['count'];var _0x3c93f7=_0x1443c7?0x0:_0x38a0bf[_0x85da('0x1e')];var _0x468f74=_0x1443c7?_0x3de5a3[_0x85da('0x1f')]:_0x38a0bf['offset']+_0x38a0bf[_0x85da('0x1d')];var _0x165e67;if(_0x468f74>=_0x25c85f){_0x468f74=_0x25c85f;_0x165e67=0xc8;}else{_0x165e67=0xce;}_0x39e21d[_0x85da('0x1a')](_0x165e67);return _0x39e21d['set'](_0x85da('0x20'),_0x3c93f7+'-'+_0x468f74+'/'+_0x25c85f)[_0x85da('0x1c')](_0x3de5a3);}return null;};}function patchUpdates(_0x2ed5d9){return function(_0x912bee){try{jsonpatch[_0x85da('0x21')](_0x912bee,_0x2ed5d9,!![]);}catch(_0x5e04ab){return BPromise['reject'](_0x5e04ab);}return _0x912bee[_0x85da('0x22')]();};}function saveUpdates(_0x138adf,_0x45adaa){return function(_0x29f894){if(_0x29f894){return _0x29f894['update'](_0x138adf)[_0x85da('0x23')](function(_0x303b7f){return _0x303b7f;});}return null;};}function removeEntity(_0x5b8547,_0x2414c1){return function(_0x22544b){if(_0x22544b){return _0x22544b[_0x85da('0x24')]()[_0x85da('0x23')](function(){_0x5b8547['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2436e0,_0x39cec5){return function(_0x3e5f7e){if(!_0x3e5f7e){_0x2436e0[_0x85da('0x19')](0x194);}return _0x3e5f7e;};}function handleError(_0x154882,_0x306e43){_0x306e43=_0x306e43||0x1f4;return function(_0x128686){logger[_0x85da('0x25')](_0x128686[_0x85da('0x26')]);if(_0x128686[_0x85da('0x27')]){delete _0x128686[_0x85da('0x27')];}_0x154882[_0x85da('0x1a')](_0x306e43)[_0x85da('0x28')](_0x128686);};}exports['index']=function(_0x5dd7a2,_0x4f8e3c){var _0x5d71a5={},_0x26b173={},_0x5840e3={'count':0x0,'rows':[]};var _0x4c061e=_[_0x85da('0x29')](db[_0x85da('0x2a')][_0x85da('0x2b')],function(_0x4f7ccf){return{'name':_0x4f7ccf[_0x85da('0x2c')],'type':_0x4f7ccf[_0x85da('0x2d')][_0x85da('0x2e')]};});_0x26b173[_0x85da('0x2f')]=_[_0x85da('0x29')](_0x4c061e,_0x85da('0x27'));_0x26b173['query']=_[_0x85da('0x30')](_0x5dd7a2[_0x85da('0x31')]);_0x26b173[_0x85da('0x32')]=_[_0x85da('0x33')](_0x26b173[_0x85da('0x2f')],_0x26b173[_0x85da('0x31')]);_0x26b173['filters']=_['concat'](_0x26b173[_0x85da('0x32')],['$and',_0x85da('0x34'),_0x85da('0x35'),'$gte',_0x85da('0x36'),_0x85da('0x37'),'$ne',_0x85da('0x38'),_0x85da('0x39'),_0x85da('0x3a'),_0x85da('0x3b'),_0x85da('0x3c'),'$notIn',_0x85da('0x3d'),_0x85da('0x3e'),_0x85da('0x3f'),_0x85da('0x40'),'$like',_0x85da('0x41'),_0x85da('0x42'),'$contained',_0x85da('0x43')]);_0x5d71a5[_0x85da('0x44')]=_[_0x85da('0x33')](_0x26b173[_0x85da('0x2f')],qs[_0x85da('0x45')](_0x5dd7a2[_0x85da('0x31')]['fields']));_0x5d71a5[_0x85da('0x44')]=_0x5d71a5[_0x85da('0x44')][_0x85da('0x46')]?_0x5d71a5[_0x85da('0x44')]:_0x26b173[_0x85da('0x2f')];if(!_0x5dd7a2[_0x85da('0x31')][_0x85da('0x47')](_0x85da('0x48'))){_0x5d71a5[_0x85da('0x1d')]=qs[_0x85da('0x1d')](_0x5dd7a2[_0x85da('0x31')][_0x85da('0x1d')]);_0x5d71a5[_0x85da('0x1e')]=qs[_0x85da('0x1e')](_0x5dd7a2[_0x85da('0x31')][_0x85da('0x1e')]);}_0x5d71a5[_0x85da('0x49')]=qs[_0x85da('0x4a')](_0x5dd7a2['query'][_0x85da('0x4a')]);_0x5d71a5['where']=qs[_0x85da('0x32')](_['pick'](_0x5dd7a2[_0x85da('0x31')],_0x26b173[_0x85da('0x32')]),_0x4c061e);if(_0x5dd7a2[_0x85da('0x31')]['filter']){_0x5d71a5['where']=_[_0x85da('0x4b')](_0x5d71a5['where'],{'$or':_[_0x85da('0x29')](_0x4c061e,function(_0x3e62f2){if(_0x3e62f2[_0x85da('0x2d')]!=='VIRTUAL'){var _0x2201d5={};_0x2201d5[_0x3e62f2['name']]={'$like':'%'+_0x5dd7a2[_0x85da('0x31')]['filter']+'%'};return _0x2201d5;}})});}_0x5d71a5=_[_0x85da('0x4b')]({},_0x5d71a5,_0x5dd7a2[_0x85da('0x4c')]);var _0x2c22c5={'where':_0x5d71a5[_0x85da('0x4d')]};return db[_0x85da('0x2a')][_0x85da('0x1f')](_0x2c22c5)[_0x85da('0x23')](function(_0x47079f){_0x5840e3['count']=_0x47079f;if(_0x5dd7a2[_0x85da('0x31')]['includeAll']){_0x5d71a5[_0x85da('0x4e')]=[{'all':!![]}];}return db[_0x85da('0x2a')][_0x85da('0x4f')](_0x5d71a5);})[_0x85da('0x23')](function(_0xe130be){_0x5840e3['rows']=_0xe130be;return _0x5840e3;})['then'](respondWithFilteredResult(_0x4f8e3c,_0x5d71a5))[_0x85da('0x50')](handleError(_0x4f8e3c,null));};exports[_0x85da('0x51')]=function(_0x1ee3ab,_0x32e0e2){var _0x42c15f={'raw':!![],'where':{'id':_0x1ee3ab[_0x85da('0x52')]['id']}},_0x5d0624={};_0x5d0624[_0x85da('0x2f')]=_[_0x85da('0x30')](db['CmHopper']['rawAttributes']);_0x5d0624[_0x85da('0x31')]=_['keys'](_0x1ee3ab[_0x85da('0x31')]);_0x5d0624[_0x85da('0x32')]=_[_0x85da('0x33')](_0x5d0624['model'],_0x5d0624[_0x85da('0x31')]);_0x42c15f[_0x85da('0x44')]=_[_0x85da('0x33')](_0x5d0624[_0x85da('0x2f')],qs[_0x85da('0x45')](_0x1ee3ab['query'][_0x85da('0x45')]));_0x42c15f[_0x85da('0x44')]=_0x42c15f[_0x85da('0x44')][_0x85da('0x46')]?_0x42c15f['attributes']:_0x5d0624[_0x85da('0x2f')];if(_0x1ee3ab[_0x85da('0x31')][_0x85da('0x53')]){_0x42c15f[_0x85da('0x4e')]=[{'all':!![]}];}_0x42c15f=_[_0x85da('0x4b')]({},_0x42c15f,_0x1ee3ab[_0x85da('0x4c')]);return db[_0x85da('0x2a')][_0x85da('0x54')](_0x42c15f)[_0x85da('0x23')](handleEntityNotFound(_0x32e0e2,null))[_0x85da('0x23')](respondWithResult(_0x32e0e2,null))['catch'](handleError(_0x32e0e2,null));};exports[_0x85da('0x55')]=function(_0x140399,_0x4c6ccd){return db[_0x85da('0x2a')][_0x85da('0x55')](_0x140399[_0x85da('0x56')],{})[_0x85da('0x23')](respondWithResult(_0x4c6ccd,0xc9))[_0x85da('0x50')](handleError(_0x4c6ccd,null));};exports[_0x85da('0x57')]=function(_0x39156c,_0x2ef017){if(_0x39156c[_0x85da('0x56')]['id']){delete _0x39156c[_0x85da('0x56')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x39156c[_0x85da('0x52')]['id']}})[_0x85da('0x23')](handleEntityNotFound(_0x2ef017,null))[_0x85da('0x23')](saveUpdates(_0x39156c[_0x85da('0x56')],null))[_0x85da('0x23')](respondWithResult(_0x2ef017,null))[_0x85da('0x50')](handleError(_0x2ef017,null));};exports['describe']=function(_0x2808d7,_0x156d42){return db[_0x85da('0x2a')]['describe']()[_0x85da('0x23')](respondWithResult(_0x156d42,null))['catch'](handleError(_0x156d42,null));};exports[_0x85da('0x24')]=function(_0x45f1a9,_0x5b152d){var _0xc698e3;return db['CmHopper'][_0x85da('0x54')]({'where':{'id':_0x45f1a9[_0x85da('0x52')]['id']}})['then'](handleEntityNotFound(_0x5b152d,null))[_0x85da('0x23')](function(_0x4737eb){if(_0x4737eb){return _0x4737eb[_0x85da('0x24')]()['then'](function(_0x411166){return _0x411166;});}})[_0x85da('0x23')](function(_0x3bdf43){_0xc698e3=_0x3bdf43;if(_0x3bdf43){if(_0x3bdf43[_0x85da('0x58')]||_0x3bdf43[_0x85da('0x59')]){return db[_0x3bdf43['VoiceQueueId']?_0x85da('0x5a'):_0x85da('0x5b')][_0x85da('0x54')]({'where':{'id':_0x3bdf43[_0x85da('0x58')]?_0x3bdf43[_0x85da('0x58')]:_0x3bdf43['CampaignId']},'attributes':['id',_0x85da('0x27')],'raw':!![]});}}})[_0x85da('0x23')](function(_0x5f1e3e){var _0x4ddc46={};if(_0x5f1e3e){_['merge'](_0x4ddc46,_[_0x85da('0x5c')](_0xc698e3[_0x85da('0x5d')],[_0x85da('0x5e'),'updatedAt','id']));_0x4ddc46[_0x85da('0x5f')]=0x15;_0x4ddc46['statedesc']=_0x85da('0x60');_0x4ddc46['campaign']=_0x5f1e3e[_0x85da('0x27')];_0x4ddc46['membername']=_0x45f1a9['user']['name'];_0x4ddc46[_0x85da('0x61')]=_0x45f1a9[_0x85da('0x62')]['id'];_0x4ddc46[_0x85da('0x60')]=!![];_0x4ddc46[_0x85da('0x63')]=moment()[_0x85da('0x64')](_0x85da('0x65'));_0x4ddc46[_0x85da('0x66')]=_0xc698e3[_0x85da('0x67')];_0x4ddc46[_0x85da('0x68')]=_0xc698e3[_0x85da('0x58')]?_0x85da('0x69'):_0x85da('0x6a');return db[_0x85da('0x6b')][_0x85da('0x54')]({'where':{'id':_0x4ddc46[_0x85da('0x6c')]},'attributes':[_0x85da('0x6d'),_0x85da('0x6e')]})[_0x85da('0x23')](function(_0x234d0c){if(!_[_0x85da('0x6f')](_0x5b152d)&&!_['isNil'](_0x234d0c['firstName'])){_0x4ddc46[_0x85da('0x70')]=_0x234d0c[_0x85da('0x6d')];if(!_[_0x85da('0x6f')](_0x234d0c['lastName'])){_0x4ddc46[_0x85da('0x70')]+='\x20'+_0x234d0c['lastName'];}}})[_0x85da('0x71')](function(){return db[_0x85da('0x72')][_0x85da('0x55')](_0x4ddc46);});}})[_0x85da('0x23')](function(){return _0x5b152d[_0x85da('0x1a')](0xcc)[_0x85da('0x1b')]();})[_0x85da('0x50')](handleError(_0x5b152d,null));};exports['getPreview']=function(_0x260dae,_0x213b9b,_0x538041){var _0x247e8c=[];return db[_0x85da('0x6b')][_0x85da('0x73')]()['then'](function(_0x3f6a78){_0x247e8c=_[_0x85da('0x30')](_0x3f6a78);return _0x260dae[_0x85da('0x62')][_0x85da('0x74')]({'where':{'type':_0x85da('0x75'),'dialActive':!![],'dialMethod':_0x85da('0x76')},'attributes':['id',_0x85da('0x77'),_0x85da('0x78')],'raw':!![]});})['then'](function(_0x4a871e){if(_0x4a871e&&_0x4a871e['length']){return db[_0x85da('0x79')][_0x85da('0x7a')](function(_0x2d0d2f){var _0x5ef6de={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x85da('0x64')](_0x85da('0x65'))},'VoiceQueueId':{'$in':_[_0x85da('0x29')](_0x4a871e,'id')},'$or':[{'UserId':null},{'UserId':_0x260dae[_0x85da('0x62')]['id']}]};var _0xb1401e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4a871e)['filter']([_0x85da('0x78'),0x0])[_0x85da('0x29')]('id')[_0x85da('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x260dae[_0x85da('0x62')]['id']}]};var _0x36b646={'$or':[_0x5ef6de,_0xb1401e]};var _0x1c5987=[];if(_0x260dae[_0x85da('0x56')][_0x85da('0x7c')]&&_0x260dae['body'][_0x85da('0x7c')]===_0x85da('0x7d')){if(!_['isEmpty'](_0x260dae[_0x85da('0x56')][_0x85da('0x7e')])){_0x36b646['id']={'$in':_0x260dae[_0x85da('0x56')][_0x85da('0x7e')]};}_0x1c5987=[[_0x85da('0x7f'),'ASC'],[_0x85da('0x80'),_0x4a871e[0x0][_0x85da('0x77')]===_0x85da('0x81')?_0x85da('0x82'):_0x85da('0x81')],db[_0x85da('0x79')][_0x85da('0x83')](_0x85da('0x84')),['id',_0x85da('0x82')]];}else{if(!_[_0x85da('0x85')](_0x260dae[_0x85da('0x56')][_0x85da('0x7e')])){_0x36b646['id']={'$notIn':_0x260dae[_0x85da('0x56')][_0x85da('0x7e')]};}_0x1c5987=[[_0x85da('0x7f'),'DESC'],[_0x85da('0x80'),_0x4a871e[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal'](_0x85da('0x86')),['id',_0x85da('0x81')]];}return db[_0x85da('0x2a')][_0x85da('0x87')]({'attributes':['id',_0x85da('0x88'),_0x85da('0x89')],'where':_0x36b646,'order':_0x1c5987,'transaction':_0x2d0d2f,'lock':_0x2d0d2f[_0x85da('0x8a')][_0x85da('0x8b')],'include':[{'model':db[_0x85da('0x6b')],'as':_0x85da('0x8c'),'attributes':_0x247e8c,'include':[{'model':db[_0x85da('0x8d')],'as':'Company','attributes':['id',_0x85da('0x27')]}]},{'model':db['CmList'],'as':'List','attributes':['id','name']},{'model':db[_0x85da('0x5a')],'as':_0x85da('0x8e'),'attributes':['id',_0x85da('0x27'),_0x85da('0x8f')]}]})[_0x85da('0x23')](function(_0x3b1a0e){if(_0x3b1a0e){return _0x3b1a0e['update']({'UserId':_0x260dae['user']['id']},{'transaction':_0x2d0d2f});}});});}})[_0x85da('0x23')](handleEntityNotFound(_0x213b9b,null))[_0x85da('0x23')](respondWithResult(_0x213b9b,null))[_0x85da('0x50')](handleError(_0x213b9b,null));};exports[_0x85da('0x90')]=function(_0x59ac18,_0x497fd5,_0xd458c4){return _0x59ac18['user']['getVoiceQueues']({'where':{'type':_0x85da('0x75'),'dialActive':!![],'dialMethod':_0x85da('0x76')},'attributes':['id'],'raw':!![]})['then'](function(_0x1401b7){if(_0x1401b7&&_0x1401b7[_0x85da('0x46')]){return db['CmHopper'][_0x85da('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x85da('0x64')](_0x85da('0x65'))},'VoiceQueueId':{'$in':_[_0x85da('0x29')](_0x1401b7,'id')},'$or':[{'UserId':null},{'UserId':_0x59ac18['user']['id']}]}});}return 0x0;})['then'](function(_0x223fbd){if(!_[_0x85da('0x6f')](_0x223fbd)&&_['isNumber'](_0x223fbd)){return _0x497fd5[_0x85da('0x1a')](0xc8)[_0x85da('0x1c')]({'contacts':_0x223fbd});}else{logger[_0x85da('0x25')](_0x85da('0x91'),_0x85da('0x90'),0x194,_0x85da('0x92'));_0x497fd5[_0x85da('0x19')](0x194);}})['catch'](handleError(_0x497fd5,null));}; \ No newline at end of file +var _0xe027=['$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','calleridnum','phone','campaigntype','queue','ivr','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','describe','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','value','direction','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','sendStatus','error','name','send','index','CmHopper','rawAttributes','fieldName','type','model','query','filters','intersection','$or','$gt','$lt','$lte','$ne'];(function(_0x348866,_0x1249de){var _0x3e5e06=function(_0x5e5675){while(--_0x5e5675){_0x348866['push'](_0x348866['shift']());}};_0x3e5e06(++_0x1249de);}(_0xe027,0xf9));var _0x7e02=function(_0x5a2bdb,_0x1b2b33){_0x5a2bdb=_0x5a2bdb-0x0;var _0x4b3a70=_0xe027[_0x5a2bdb];return _0x4b3a70;};'use strict';var emlformat=require(_0x7e02('0x0'));var rimraf=require(_0x7e02('0x1'));var zipdir=require(_0x7e02('0x2'));var jsonpatch=require(_0x7e02('0x3'));var rp=require('request-promise');var moment=require(_0x7e02('0x4'));var BPromise=require(_0x7e02('0x5'));var Mustache=require('mustache');var util=require(_0x7e02('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e02('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e02('0x8'));var squel=require(_0x7e02('0x9'));var crypto=require('crypto');var jsforce=require(_0x7e02('0xa'));var deskjs=require(_0x7e02('0xb'));var toCsv=require(_0x7e02('0xc'));var querystring=require(_0x7e02('0xd'));var Papa=require(_0x7e02('0xe'));var Redis=require(_0x7e02('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7e02('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e02('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7e02('0x12'));var licenseUtil=require(_0x7e02('0x13'));var db=require(_0x7e02('0x14'))['db'];function respondWithStatusCode(_0x440535,_0x1e4765){_0x1e4765=_0x1e4765||0xcc;return function(_0x25afb8){if(_0x25afb8){return _0x440535['sendStatus'](_0x1e4765);}return _0x440535[_0x7e02('0x15')](_0x1e4765)[_0x7e02('0x16')]();};}function respondWithResult(_0x18c4ba,_0x5919f2){_0x5919f2=_0x5919f2||0xc8;return function(_0xd131e){if(_0xd131e){return _0x18c4ba[_0x7e02('0x15')](_0x5919f2)[_0x7e02('0x17')](_0xd131e);}};}function respondWithFilteredResult(_0x428d21,_0x419761){return function(_0x464633){if(_0x464633){var _0x237b4d=typeof _0x419761[_0x7e02('0x18')]==='undefined'&&typeof _0x419761['limit']===_0x7e02('0x19');var _0x581473=_0x464633[_0x7e02('0x1a')];var _0x478233=_0x237b4d?0x0:_0x419761['offset'];var _0x3a9273=_0x237b4d?_0x464633[_0x7e02('0x1a')]:_0x419761[_0x7e02('0x18')]+_0x419761[_0x7e02('0x1b')];var _0x3f0c09;if(_0x3a9273>=_0x581473){_0x3a9273=_0x581473;_0x3f0c09=0xc8;}else{_0x3f0c09=0xce;}_0x428d21['status'](_0x3f0c09);return _0x428d21[_0x7e02('0x1c')](_0x7e02('0x1d'),_0x478233+'-'+_0x3a9273+'/'+_0x581473)[_0x7e02('0x17')](_0x464633);}return null;};}function patchUpdates(_0x4c451b){return function(_0x4662cc){try{jsonpatch['apply'](_0x4662cc,_0x4c451b,!![]);}catch(_0x1c48cb){return BPromise[_0x7e02('0x1e')](_0x1c48cb);}return _0x4662cc['save']();};}function saveUpdates(_0x900567,_0x177b81){return function(_0x494695){if(_0x494695){return _0x494695['update'](_0x900567)[_0x7e02('0x1f')](function(_0x4d1cfe){return _0x4d1cfe;});}return null;};}function removeEntity(_0x302055,_0x30d7e1){return function(_0x123e61){if(_0x123e61){return _0x123e61[_0x7e02('0x20')]()[_0x7e02('0x1f')](function(){_0x302055[_0x7e02('0x15')](0xcc)[_0x7e02('0x16')]();});}};}function handleEntityNotFound(_0x2a1f56,_0x434d69){return function(_0x2d16d3){if(!_0x2d16d3){_0x2a1f56[_0x7e02('0x21')](0x194);}return _0x2d16d3;};}function handleError(_0x4fd74a,_0x4f3c27){_0x4f3c27=_0x4f3c27||0x1f4;return function(_0x585c47){logger[_0x7e02('0x22')](_0x585c47['stack']);if(_0x585c47[_0x7e02('0x23')]){delete _0x585c47[_0x7e02('0x23')];}_0x4fd74a[_0x7e02('0x15')](_0x4f3c27)[_0x7e02('0x24')](_0x585c47);};}exports[_0x7e02('0x25')]=function(_0x3bb8a1,_0xed4078){var _0x1f78b4={},_0x1f07a3={},_0x198ad2={'count':0x0,'rows':[]};var _0xef3bd=_['map'](db[_0x7e02('0x26')][_0x7e02('0x27')],function(_0x221c1b){return{'name':_0x221c1b[_0x7e02('0x28')],'type':_0x221c1b[_0x7e02('0x29')]['key']};});_0x1f07a3[_0x7e02('0x2a')]=_['map'](_0xef3bd,_0x7e02('0x23'));_0x1f07a3[_0x7e02('0x2b')]=_['keys'](_0x3bb8a1[_0x7e02('0x2b')]);_0x1f07a3[_0x7e02('0x2c')]=_[_0x7e02('0x2d')](_0x1f07a3[_0x7e02('0x2a')],_0x1f07a3[_0x7e02('0x2b')]);_0x1f07a3[_0x7e02('0x2c')]=_['concat'](_0x1f07a3['filters'],['$and',_0x7e02('0x2e'),_0x7e02('0x2f'),'$gte',_0x7e02('0x30'),_0x7e02('0x31'),_0x7e02('0x32'),_0x7e02('0x33'),_0x7e02('0x34'),'$between',_0x7e02('0x35'),_0x7e02('0x36'),_0x7e02('0x37'),_0x7e02('0x38'),_0x7e02('0x39'),_0x7e02('0x3a'),_0x7e02('0x3b'),'$like',_0x7e02('0x3c'),_0x7e02('0x3d'),_0x7e02('0x3e'),'$any']);_0x1f78b4[_0x7e02('0x3f')]=_[_0x7e02('0x2d')](_0x1f07a3['model'],qs[_0x7e02('0x40')](_0x3bb8a1[_0x7e02('0x2b')]['fields']));_0x1f78b4[_0x7e02('0x3f')]=_0x1f78b4['attributes'][_0x7e02('0x41')]?_0x1f78b4[_0x7e02('0x3f')]:_0x1f07a3[_0x7e02('0x2a')];if(!_0x3bb8a1[_0x7e02('0x2b')][_0x7e02('0x42')]('nolimit')){_0x1f78b4['limit']=qs[_0x7e02('0x1b')](_0x3bb8a1[_0x7e02('0x2b')][_0x7e02('0x1b')]);_0x1f78b4['offset']=qs[_0x7e02('0x18')](_0x3bb8a1['query'][_0x7e02('0x18')]);}_0x1f78b4[_0x7e02('0x43')]=qs['sort'](_0x3bb8a1[_0x7e02('0x2b')][_0x7e02('0x44')]);_0x1f78b4[_0x7e02('0x45')]=qs['filters'](_[_0x7e02('0x46')](_0x3bb8a1[_0x7e02('0x2b')],_0x1f07a3['filters']),_0xef3bd);if(_0x3bb8a1[_0x7e02('0x2b')][_0x7e02('0x47')]){_0x1f78b4[_0x7e02('0x45')]=_[_0x7e02('0x48')](_0x1f78b4['where'],{'$or':_[_0x7e02('0x49')](_0xef3bd,function(_0x3a5358){if(_0x3a5358[_0x7e02('0x29')]!==_0x7e02('0x4a')){var _0x24ae69={};_0x24ae69[_0x3a5358[_0x7e02('0x23')]]={'$like':'%'+_0x3bb8a1[_0x7e02('0x2b')][_0x7e02('0x47')]+'%'};return _0x24ae69;}})});}_0x1f78b4=_[_0x7e02('0x48')]({},_0x1f78b4,_0x3bb8a1[_0x7e02('0x4b')]);var _0xee2600={'where':_0x1f78b4[_0x7e02('0x45')]};return db[_0x7e02('0x26')][_0x7e02('0x1a')](_0xee2600)[_0x7e02('0x1f')](function(_0x151400){_0x198ad2[_0x7e02('0x1a')]=_0x151400;if(_0x3bb8a1[_0x7e02('0x2b')][_0x7e02('0x4c')]){_0x1f78b4[_0x7e02('0x4d')]=[{'all':!![]}];}return db[_0x7e02('0x26')][_0x7e02('0x4e')](_0x1f78b4);})[_0x7e02('0x1f')](function(_0x1a8b1c){_0x198ad2[_0x7e02('0x4f')]=_0x1a8b1c;return _0x198ad2;})[_0x7e02('0x1f')](respondWithFilteredResult(_0xed4078,_0x1f78b4))[_0x7e02('0x50')](handleError(_0xed4078,null));};exports[_0x7e02('0x51')]=function(_0x127108,_0x2bb8c4){var _0x44ac21={'raw':!![],'where':{'id':_0x127108[_0x7e02('0x52')]['id']}},_0xfd7403={};_0xfd7403['model']=_[_0x7e02('0x53')](db['CmHopper'][_0x7e02('0x27')]);_0xfd7403[_0x7e02('0x2b')]=_[_0x7e02('0x53')](_0x127108['query']);_0xfd7403[_0x7e02('0x2c')]=_[_0x7e02('0x2d')](_0xfd7403[_0x7e02('0x2a')],_0xfd7403[_0x7e02('0x2b')]);_0x44ac21[_0x7e02('0x3f')]=_['intersection'](_0xfd7403[_0x7e02('0x2a')],qs['fields'](_0x127108[_0x7e02('0x2b')]['fields']));_0x44ac21['attributes']=_0x44ac21['attributes'][_0x7e02('0x41')]?_0x44ac21[_0x7e02('0x3f')]:_0xfd7403[_0x7e02('0x2a')];if(_0x127108[_0x7e02('0x2b')][_0x7e02('0x4c')]){_0x44ac21[_0x7e02('0x4d')]=[{'all':!![]}];}_0x44ac21=_['merge']({},_0x44ac21,_0x127108['options']);return db[_0x7e02('0x26')][_0x7e02('0x54')](_0x44ac21)['then'](handleEntityNotFound(_0x2bb8c4,null))[_0x7e02('0x1f')](respondWithResult(_0x2bb8c4,null))[_0x7e02('0x50')](handleError(_0x2bb8c4,null));};exports['create']=function(_0x10264e,_0x3f1f26){return db['CmHopper'][_0x7e02('0x55')](_0x10264e[_0x7e02('0x56')],{})[_0x7e02('0x1f')](respondWithResult(_0x3f1f26,0xc9))['catch'](handleError(_0x3f1f26,null));};exports[_0x7e02('0x57')]=function(_0x3f730c,_0x43fbff){if(_0x3f730c[_0x7e02('0x56')]['id']){delete _0x3f730c['body']['id'];}return db[_0x7e02('0x26')][_0x7e02('0x54')]({'where':{'id':_0x3f730c[_0x7e02('0x52')]['id']}})[_0x7e02('0x1f')](handleEntityNotFound(_0x43fbff,null))[_0x7e02('0x1f')](saveUpdates(_0x3f730c[_0x7e02('0x56')],null))[_0x7e02('0x1f')](respondWithResult(_0x43fbff,null))['catch'](handleError(_0x43fbff,null));};exports['describe']=function(_0x3d9822,_0x272f89){return db[_0x7e02('0x26')]['describe']()[_0x7e02('0x1f')](respondWithResult(_0x272f89,null))[_0x7e02('0x50')](handleError(_0x272f89,null));};exports[_0x7e02('0x20')]=function(_0xb543c5,_0x5c5d41){var _0x5a6c09;return db['CmHopper'][_0x7e02('0x54')]({'where':{'id':_0xb543c5[_0x7e02('0x52')]['id']}})[_0x7e02('0x1f')](handleEntityNotFound(_0x5c5d41,null))[_0x7e02('0x1f')](function(_0xfa5178){if(_0xfa5178){return _0xfa5178[_0x7e02('0x20')]()[_0x7e02('0x1f')](function(_0x36bf37){return _0x36bf37;});}})[_0x7e02('0x1f')](function(_0x2e68a0){_0x5a6c09=_0x2e68a0;if(_0x2e68a0){if(_0x2e68a0[_0x7e02('0x58')]||_0x2e68a0['CampaignId']){return db[_0x2e68a0['VoiceQueueId']?_0x7e02('0x59'):_0x7e02('0x5a')][_0x7e02('0x54')]({'where':{'id':_0x2e68a0[_0x7e02('0x58')]?_0x2e68a0[_0x7e02('0x58')]:_0x2e68a0[_0x7e02('0x5b')]},'attributes':['id',_0x7e02('0x23')],'raw':!![]});}}})[_0x7e02('0x1f')](function(_0x59df37){var _0x3df881={};if(_0x59df37){_[_0x7e02('0x48')](_0x3df881,_[_0x7e02('0x5c')](_0x5a6c09[_0x7e02('0x5d')],[_0x7e02('0x5e'),_0x7e02('0x5f'),'id']));_0x3df881[_0x7e02('0x60')]=0x15;_0x3df881[_0x7e02('0x61')]=_0x7e02('0x62');_0x3df881['campaign']=_0x59df37[_0x7e02('0x23')];_0x3df881[_0x7e02('0x63')]=_0xb543c5[_0x7e02('0x64')][_0x7e02('0x23')];_0x3df881[_0x7e02('0x65')]=_0xb543c5[_0x7e02('0x64')]['id'];_0x3df881['deleted']=!![];_0x3df881[_0x7e02('0x66')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3df881[_0x7e02('0x67')]=_0x5a6c09[_0x7e02('0x68')];_0x3df881[_0x7e02('0x69')]=_0x5a6c09[_0x7e02('0x58')]?_0x7e02('0x6a'):_0x7e02('0x6b');return db['CmContact'][_0x7e02('0x54')]({'where':{'id':_0x3df881['ContactId']},'attributes':[_0x7e02('0x6c'),_0x7e02('0x6d')]})[_0x7e02('0x1f')](function(_0x210a19){if(!_['isNil'](_0x5c5d41)&&!_[_0x7e02('0x6e')](_0x210a19[_0x7e02('0x6c')])){_0x3df881[_0x7e02('0x6f')]=_0x210a19['firstName'];if(!_[_0x7e02('0x6e')](_0x210a19[_0x7e02('0x6d')])){_0x3df881[_0x7e02('0x6f')]+='\x20'+_0x210a19[_0x7e02('0x6d')];}}})[_0x7e02('0x70')](function(){return db[_0x7e02('0x71')][_0x7e02('0x55')](_0x3df881);});}})[_0x7e02('0x1f')](function(){return _0x5c5d41[_0x7e02('0x15')](0xcc)[_0x7e02('0x16')]();})[_0x7e02('0x50')](handleError(_0x5c5d41,null));};exports['getPreview']=function(_0x1d4d79,_0x3aa063,_0x2c4fbe){var _0x5d59bb=[];return db['CmContact'][_0x7e02('0x72')]()[_0x7e02('0x1f')](function(_0x491ad2){_0x5d59bb=_[_0x7e02('0x53')](_0x491ad2);return _0x1d4d79[_0x7e02('0x64')][_0x7e02('0x73')]({'where':{'type':_0x7e02('0x74'),'dialActive':!![],'dialMethod':_0x7e02('0x75')},'attributes':['id',_0x7e02('0x76'),_0x7e02('0x77')],'raw':!![]});})[_0x7e02('0x1f')](function(_0x1394bc){if(_0x1394bc&&_0x1394bc[_0x7e02('0x41')]){return db[_0x7e02('0x78')][_0x7e02('0x79')](function(_0x271b7a){var _0x3ca982={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7e02('0x7a')](_0x7e02('0x7b'))},'VoiceQueueId':{'$in':_[_0x7e02('0x49')](_0x1394bc,'id')},'$or':[{'UserId':null},{'UserId':_0x1d4d79['user']['id']}]};var _0x27a161={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1394bc)[_0x7e02('0x47')]([_0x7e02('0x77'),0x0])['map']('id')[_0x7e02('0x7c')]()},'$or':[{'UserId':null},{'UserId':_0x1d4d79[_0x7e02('0x64')]['id']}]};var _0x45ddec={'$or':[_0x3ca982,_0x27a161]};var _0x101292=[];if(_0x1d4d79[_0x7e02('0x56')][_0x7e02('0x7d')]&&_0x1d4d79[_0x7e02('0x56')][_0x7e02('0x7d')]==='prev'){if(!_['isEmpty'](_0x1d4d79[_0x7e02('0x56')][_0x7e02('0x7e')])){_0x45ddec['id']={'$in':_0x1d4d79[_0x7e02('0x56')][_0x7e02('0x7e')]};}_0x101292=[[_0x7e02('0x7f'),_0x7e02('0x80')],[_0x7e02('0x81'),_0x1394bc[0x0][_0x7e02('0x76')]===_0x7e02('0x80')?_0x7e02('0x82'):_0x7e02('0x80')],db[_0x7e02('0x78')][_0x7e02('0x83')](_0x7e02('0x84')),['id','DESC']];}else{if(!_[_0x7e02('0x85')](_0x1d4d79[_0x7e02('0x56')][_0x7e02('0x7e')])){_0x45ddec['id']={'$notIn':_0x1d4d79[_0x7e02('0x56')][_0x7e02('0x7e')]};}_0x101292=[['priority',_0x7e02('0x82')],[_0x7e02('0x81'),_0x1394bc[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x7e02('0x83')](_0x7e02('0x86')),['id',_0x7e02('0x80')]];}return db[_0x7e02('0x26')][_0x7e02('0x87')]({'attributes':['id',_0x7e02('0x88'),_0x7e02('0x89')],'where':_0x45ddec,'order':_0x101292,'transaction':_0x271b7a,'lock':_0x271b7a[_0x7e02('0x8a')][_0x7e02('0x8b')],'include':[{'model':db['CmContact'],'as':_0x7e02('0x8c'),'attributes':_0x5d59bb,'include':[{'model':db[_0x7e02('0x8d')],'as':_0x7e02('0x8e'),'attributes':['id',_0x7e02('0x23')]}]},{'model':db[_0x7e02('0x8f')],'as':_0x7e02('0x90'),'attributes':['id',_0x7e02('0x23')]},{'model':db['VoiceQueue'],'as':_0x7e02('0x91'),'attributes':['id',_0x7e02('0x23'),_0x7e02('0x92')]}]})['then'](function(_0x39311a){if(_0x39311a){return _0x39311a[_0x7e02('0x57')]({'UserId':_0x1d4d79[_0x7e02('0x64')]['id']},{'transaction':_0x271b7a});}});});}})[_0x7e02('0x1f')](handleEntityNotFound(_0x3aa063,null))['then'](respondWithResult(_0x3aa063,null))[_0x7e02('0x50')](handleError(_0x3aa063,null));};exports['getOpenContacts']=function(_0xd875da,_0x3e1cba,_0x451913){return _0xd875da[_0x7e02('0x64')][_0x7e02('0x73')]({'where':{'type':_0x7e02('0x74'),'dialActive':!![],'dialMethod':_0x7e02('0x75')},'attributes':['id'],'raw':!![]})[_0x7e02('0x1f')](function(_0x13f9bf){if(_0x13f9bf&&_0x13f9bf['length']){return db[_0x7e02('0x26')][_0x7e02('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7e02('0x7b'))},'VoiceQueueId':{'$in':_[_0x7e02('0x49')](_0x13f9bf,'id')},'$or':[{'UserId':null},{'UserId':_0xd875da[_0x7e02('0x64')]['id']}]}});}return 0x0;})[_0x7e02('0x1f')](function(_0x2955af){if(!_[_0x7e02('0x6e')](_0x2955af)&&_[_0x7e02('0x93')](_0x2955af)){return _0x3e1cba[_0x7e02('0x15')](0xc8)[_0x7e02('0x17')]({'contacts':_0x2955af});}else{logger['error'](_0x7e02('0x94'),'getOpenContacts',0x194,_0x7e02('0x95'));_0x3e1cba[_0x7e02('0x21')](0x194);}})['catch'](handleError(_0x3e1cba,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index ec78daa..c8c3982 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4819=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x541f91,_0x370220){var _0x3e6f80=function(_0x1005c9){while(--_0x1005c9){_0x541f91['push'](_0x541f91['shift']());}};_0x3e6f80(++_0x370220);}(_0x4819,0xcd));var _0x9481=function(_0x3c4047,_0x26c881){_0x3c4047=_0x3c4047-0x0;var _0xea78a2=_0x4819[_0x3c4047];return _0xea78a2;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]},{'name':_0x9481('0xd'),'fields':['phone']},{'name':_0x9481('0xe'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['define','CmHopper','cm_hopper','scheduledat','phone','priority','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x3e2f83,_0x545386){var _0x509846=function(_0x5574d7){while(--_0x5574d7){_0x3e2f83['push'](_0x3e2f83['shift']());}};_0x509846(++_0x545386);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x542394,_0x18c0d0){_0x542394=_0x542394-0x0;var _0x1dd946=_0xdbf5[_0x542394];return _0x1dd946;};'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 0cc90ec..06cfbf3 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 _0x9322=['request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','map','include','model','ShowCmHopper','CreateCmHopper','body','active','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','Agent','voicePause','UserId','push','update','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','create','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','format','\x20,\x201,\x20null','GetContactRecallMe','describe','ResetActiveCalls','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s'];(function(_0x837dad,_0x1d9098){var _0x1d62d3=function(_0x40b7c1){while(--_0x40b7c1){_0x837dad['push'](_0x837dad['shift']());}};_0x1d62d3(++_0x1d9098);}(_0x9322,0x199));var _0x2932=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9322[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x2932('0x0'));var util=require(_0x2932('0x1'));var moment=require(_0x2932('0x2'));var BPromise=require(_0x2932('0x3'));var rs=require(_0x2932('0x4'));var fs=require('fs');var Redis=require(_0x2932('0x5'));var db=require(_0x2932('0x6'))['db'];var utils=require(_0x2932('0x7'));var logger=require(_0x2932('0x8'))(_0x2932('0x9'));var config=require(_0x2932('0xa'));var jayson=require(_0x2932('0xb'));var client=jayson[_0x2932('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0cd3a,_0x12f804,_0x4186cb){return new BPromise(function(_0x17b939,_0x3f43b4){return client[_0x2932('0xd')](_0xa0cd3a,_0x4186cb)[_0x2932('0xe')](function(_0x6c11c9){logger[_0x2932('0xf')](_0x2932('0x10'),_0x12f804,_0x2932('0x11'));logger[_0x2932('0x12')](_0x2932('0x13'),_0x12f804,'request\x20sent',JSON[_0x2932('0x14')](_0x6c11c9));if(_0x6c11c9[_0x2932('0x15')]){if(_0x6c11c9[_0x2932('0x15')][_0x2932('0x16')]===0x1f4){logger[_0x2932('0x15')]('CmHopper,\x20%s,\x20%s',_0x12f804,_0x6c11c9['error'][_0x2932('0x17')]);return _0x3f43b4(_0x6c11c9[_0x2932('0x15')][_0x2932('0x17')]);}logger[_0x2932('0x15')](_0x2932('0x10'),_0x12f804,_0x6c11c9[_0x2932('0x15')][_0x2932('0x17')]);return _0x17b939(_0x6c11c9[_0x2932('0x15')][_0x2932('0x17')]);}else{logger[_0x2932('0xf')](_0x2932('0x10'),_0x12f804,_0x2932('0x11'));_0x17b939(_0x6c11c9['result']['message']);}})[_0x2932('0x18')](function(_0x4e4c91){logger[_0x2932('0x15')](_0x2932('0x10'),_0x12f804,_0x4e4c91);_0x3f43b4(_0x4e4c91);});});}exports[_0x2932('0x19')]=function(_0xcafb72){var _0x470790=this;return new Promise(function(_0x58313b,_0x33d6d1){return db[_0x2932('0x1a')][_0x2932('0x1b')]({'raw':_0xcafb72[_0x2932('0x1c')]?_0xcafb72[_0x2932('0x1c')][_0x2932('0x1d')]===undefined?!![]:![]:!![],'where':_0xcafb72[_0x2932('0x1c')]?_0xcafb72[_0x2932('0x1c')][_0x2932('0x1e')]||null:null,'attributes':_0xcafb72['options']?_0xcafb72[_0x2932('0x1c')][_0x2932('0x1f')]||null:null,'limit':_0xcafb72['options']?_0xcafb72[_0x2932('0x1c')][_0x2932('0x20')]||null:null,'include':_0xcafb72[_0x2932('0x1c')]?_0xcafb72[_0x2932('0x1c')]['include']?_[_0x2932('0x21')](_0xcafb72[_0x2932('0x1c')][_0x2932('0x22')],function(_0x5d25ed){return{'model':db[_0x5d25ed[_0x2932('0x23')]],'as':_0x5d25ed['as'],'attributes':_0x5d25ed[_0x2932('0x1f')],'include':_0x5d25ed['include']?_[_0x2932('0x21')](_0x5d25ed[_0x2932('0x22')],function(_0xc19175){return{'model':db[_0xc19175[_0x2932('0x23')]],'as':_0xc19175['as'],'attributes':_0xc19175[_0x2932('0x1f')],'include':_0xc19175[_0x2932('0x22')]?_[_0x2932('0x21')](_0xc19175[_0x2932('0x22')],function(_0x40b3de){return{'model':db[_0x40b3de[_0x2932('0x23')]],'as':_0x40b3de['as'],'attributes':_0x40b3de[_0x2932('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2932('0xe')](function(_0x43af99){logger[_0x2932('0xf')](_0x2932('0x19'),_0xcafb72);logger[_0x2932('0x12')]('GetCmHopper',_0xcafb72,JSON[_0x2932('0x14')](_0x43af99));_0x58313b(_0x43af99);})['catch'](function(_0x56e1c4){logger[_0x2932('0x15')](_0x2932('0x19'),_0x56e1c4[_0x2932('0x17')],_0xcafb72);_0x33d6d1(_0x470790[_0x2932('0x15')](0x1f4,_0x56e1c4[_0x2932('0x17')]));});});};exports[_0x2932('0x24')]=function(_0xfb2a83){var _0x5481d3=this;return new Promise(function(_0x19d5cf,_0x2cc77d){return db[_0x2932('0x1a')]['find']({'raw':_0xfb2a83['options']?_0xfb2a83[_0x2932('0x1c')][_0x2932('0x1d')]===undefined?!![]:![]:!![],'where':_0xfb2a83[_0x2932('0x1c')]?_0xfb2a83[_0x2932('0x1c')][_0x2932('0x1e')]||null:null,'attributes':_0xfb2a83[_0x2932('0x1c')]?_0xfb2a83[_0x2932('0x1c')][_0x2932('0x1f')]||null:null,'include':_0xfb2a83['options']?_0xfb2a83[_0x2932('0x1c')][_0x2932('0x22')]?_['map'](_0xfb2a83['options']['include'],function(_0x4a61ef){return{'model':db[_0x4a61ef[_0x2932('0x23')]],'as':_0x4a61ef['as'],'attributes':_0x4a61ef['attributes'],'include':_0x4a61ef[_0x2932('0x22')]?_['map'](_0x4a61ef['include'],function(_0x44a0d6){return{'model':db[_0x44a0d6[_0x2932('0x23')]],'as':_0x44a0d6['as'],'attributes':_0x44a0d6['attributes'],'include':_0x44a0d6['include']?_[_0x2932('0x21')](_0x44a0d6[_0x2932('0x22')],function(_0x22bc70){return{'model':db[_0x22bc70['model']],'as':_0x22bc70['as'],'attributes':_0x22bc70['attributes']};}):[]};}):[]};}):[]:[]})[_0x2932('0xe')](function(_0x6fc09a){logger[_0x2932('0xf')](_0x2932('0x24'),_0xfb2a83);logger[_0x2932('0x12')](_0x2932('0x24'),_0xfb2a83,JSON[_0x2932('0x14')](_0x6fc09a));_0x19d5cf(_0x6fc09a);})['catch'](function(_0x406e26){logger[_0x2932('0x15')](_0x2932('0x24'),_0x406e26['message'],_0xfb2a83);_0x2cc77d(_0x5481d3[_0x2932('0x15')](0x1f4,_0x406e26[_0x2932('0x17')]));});});};exports['CreateCmHopper']=function(_0x55cb18){var _0x1fa318=this;return new Promise(function(_0x279ba9,_0x353375){return db[_0x2932('0x1a')]['create'](_0x55cb18['body'],{'raw':_0x55cb18[_0x2932('0x1c')]?_0x55cb18[_0x2932('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x2932('0xe')](function(_0x39f6f7){logger['info'](_0x2932('0x25'),_0x55cb18);logger[_0x2932('0x12')](_0x2932('0x25'),_0x55cb18,JSON['stringify'](_0x39f6f7));_0x279ba9(_0x39f6f7);})[_0x2932('0x18')](function(_0x2fc6fd){logger[_0x2932('0x15')]('CreateCmHopper',_0x2fc6fd[_0x2932('0x17')],_0x55cb18);_0x353375(_0x1fa318['error'](0x1f4,_0x2fc6fd['message']));});});};exports['UpdateCmHopper']=function(_0x196a5a){var _0x5d63fd=this;return new Promise(function(_0x388b51,_0x5b4d1b){return db[_0x2932('0x1a')]['update'](_0x196a5a[_0x2932('0x26')],{'raw':_0x196a5a[_0x2932('0x1c')]?_0x196a5a[_0x2932('0x1c')][_0x2932('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x196a5a[_0x2932('0x1c')]?_0x196a5a['options'][_0x2932('0x1e')]||null:null,'attributes':_0x196a5a[_0x2932('0x1c')]?_0x196a5a[_0x2932('0x1c')][_0x2932('0x1f')]||null:null,'limit':_0x196a5a['options']?_0x196a5a[_0x2932('0x1c')][_0x2932('0x20')]||null:null})['then'](function(_0x35da69){logger[_0x2932('0xf')]('UpdateCmHopper',_0x196a5a);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x2932('0x14')](_0x196a5a[_0x2932('0x1c')][_0x2932('0x1e')]),_0x196a5a[_0x2932('0x26')][_0x2932('0x27')]);logger[_0x2932('0x12')](_0x2932('0x28'),_0x196a5a,JSON[_0x2932('0x14')](_0x35da69));_0x388b51(_0x35da69);})[_0x2932('0x18')](function(_0x830e74){logger[_0x2932('0x15')]('UpdateCmHopper',_0x830e74['message'],_0x196a5a);_0x5b4d1b(_0x5d63fd[_0x2932('0x15')](0x1f4,_0x830e74[_0x2932('0x17')]));});});};exports[_0x2932('0x29')]=function(_0x104765){var _0x129b8c=this;return new Promise(function(_0x2d99ab,_0x2709e9){return db['CmHopper']['destroy']({'where':_0x104765[_0x2932('0x1c')]?_0x104765['options'][_0x2932('0x1e')]||null:null})[_0x2932('0xe')](function(_0x728122){logger['info'](_0x2932('0x29'),_0x104765);logger[_0x2932('0x12')](_0x2932('0x29'),_0x104765,JSON[_0x2932('0x14')](_0x728122));_0x2d99ab(_0x728122);})[_0x2932('0x18')](function(_0x4d0ae5){logger['error'](_0x2932('0x29'),_0x4d0ae5[_0x2932('0x17')],_0x104765);_0x2709e9(_0x129b8c[_0x2932('0x15')](0x1f4,_0x4d0ae5[_0x2932('0x17')]));});});};exports[_0x2932('0x2a')]=function(_0x2435ae){var _0x761e7=this;return new Promise(function(_0x967550,_0x36b6fd){return db[_0x2932('0x2b')]['describe']()[_0x2932('0xe')](function(_0x280152){return db[_0x2932('0x2c')][_0x2932('0x2d')](function(_0x46a9ea){return db[_0x2932('0x1a')]['findAll']({'where':_0x2435ae['options']?_0x2435ae[_0x2932('0x1c')][_0x2932('0x1e')]||null:null,'attributes':_0x2435ae[_0x2932('0x1c')]?_0x2435ae[_0x2932('0x1c')][_0x2932('0x1f')]||null:null,'limit':_0x2435ae[_0x2932('0x1c')]?_0x2435ae[_0x2932('0x1c')][_0x2932('0x20')]||null:null,'order':_0x2435ae[_0x2932('0x1c')]?_0x2435ae[_0x2932('0x1c')][_0x2932('0x2e')]||null:null,'transaction':_0x46a9ea,'lock':_0x46a9ea[_0x2932('0x2f')][_0x2932('0x30')],'include':[{'model':db['CmContact'],'as':_0x2932('0x31'),'attributes':_['keys'](_0x280152)},{'model':db['User'],'as':_0x2932('0x32'),'attributes':['id','name',_0x2932('0x33')]}]})[_0x2932('0xe')](function(_0x5f0b84){var _0x4c52ec=[];var _0x4a1ba1=[];for(var _0xaf15d7=0x0;_0xaf15d7<_0x5f0b84['length'];_0xaf15d7+=0x1){var _0x253655=_0x5f0b84[_0xaf15d7][_0x2932('0x34')];if(_0x253655===null){_0x4c52ec[_0x2932('0x35')](_0x5f0b84[_0xaf15d7][_0x2932('0x36')](_0x2435ae[_0x2932('0x26')],{'transaction':_0x46a9ea}));}else if(!_0x4a1ba1['includes'](_0x253655)){_0x4a1ba1['push'](_0x253655);_0x4c52ec[_0x2932('0x35')](_0x5f0b84[_0xaf15d7][_0x2932('0x36')](_0x2435ae[_0x2932('0x26')],{'transaction':_0x46a9ea}));}}return BPromise['all'](_0x4c52ec);});})['then'](function(_0x2b4673){logger[_0x2932('0xf')](_0x2932('0x2a'),_0x2435ae);if(_0x2b4673[_0x2932('0x37')]>0x0){logger['info'](_0x2932('0x38'),_0x2b4673[0x0]['dataValues']['id'],_0x2b4673[0x0][_0x2932('0x39')][_0x2932('0x3a')],_0x2b4673[0x0][_0x2932('0x39')][_0x2932('0x27')]);}logger['debug'](_0x2932('0x2a'),_0x2435ae,JSON['stringify'](_0x2b4673));_0x967550(_0x2b4673);})[_0x2932('0x18')](function(_0x553713){logger[_0x2932('0x15')]('GetContactDialer',_0x553713[_0x2932('0x17')],_0x2435ae);_0x36b6fd(_0x761e7[_0x2932('0x15')](0x1f4,_0x553713[_0x2932('0x17')]));});});});};exports['MoveContactManagedDialer']=function(_0x33f886){var _0x325b77=this;return new Promise(function(_0x412001,_0x3b6e24){return db[_0x2932('0x2c')]['transaction'](function(_0x31fb48){return db[_0x2932('0x3b')][_0x2932('0x3c')](_0x33f886[_0x2932('0x26')],{'raw':_0x33f886[_0x2932('0x1c')]?_0x33f886[_0x2932('0x1c')][_0x2932('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x31fb48})['then'](function(){logger[_0x2932('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x2932('0x14')](_0x33f886['options'][_0x2932('0x1e')]),_0x33f886[_0x2932('0x1c')][_0x2932('0x1e')][_0x2932('0x27')]);return db[_0x2932('0x1a')][_0x2932('0x3d')]({'where':_0x33f886[_0x2932('0x1c')]?_0x33f886[_0x2932('0x1c')][_0x2932('0x1e')]||null:null,'transaction':_0x31fb48});});})[_0x2932('0xe')](function(_0x591b45){logger[_0x2932('0xf')](_0x2932('0x3e'),_0x33f886);logger[_0x2932('0x12')](_0x2932('0x3e'),_0x33f886,JSON['stringify'](_0x591b45));_0x412001(_0x591b45);})['catch'](function(_0xc45c69){logger['error'](_0x2932('0x3e'),_0xc45c69['message'],_0x33f886);_0x3b6e24(_0x325b77[_0x2932('0x15')](0x1f4,_0xc45c69[_0x2932('0x17')]));});});};exports[_0x2932('0x3f')]=function(_0x201a88){var _0x4c2f2a=this;return new Promise(function(_0x114e7d,_0x3af4af){return db[_0x2932('0x1a')][_0x2932('0x1b')]({'raw':_0x201a88[_0x2932('0x1c')]?_0x201a88['options'][_0x2932('0x1d')]===undefined?!![]:![]:!![],'where':_0x201a88['options']?_0x201a88[_0x2932('0x1c')][_0x2932('0x1e')]||null:null,'attributes':[[db[_0x2932('0x2c')]['fn'](_0x2932('0x40'),db[_0x2932('0x2c')]['fn']('IF',db[_0x2932('0x2c')][_0x2932('0x41')]('`scheduledat`\x20>=\x20'+util[_0x2932('0x42')]('\x22%s\x22',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x2932('0x43')))),'contactsRescheduled']]})[_0x2932('0xe')](function(_0x2e26f8){logger[_0x2932('0xf')]('CountReScheduled',_0x201a88);logger[_0x2932('0x12')](_0x2932('0x3f'),_0x201a88,JSON[_0x2932('0x14')](_0x2e26f8));_0x114e7d(_0x2e26f8);})[_0x2932('0x18')](function(_0x503922){logger[_0x2932('0x15')](_0x2932('0x3f'),_0x503922[_0x2932('0x17')],_0x201a88);_0x3af4af(_0x4c2f2a['error'](0x1f4,_0x503922[_0x2932('0x17')]));});});};exports[_0x2932('0x44')]=function(_0x5bd205){var _0x2b74bb=this;return new Promise(function(_0x1b2249,_0x474f31){return db[_0x2932('0x2b')][_0x2932('0x45')]()[_0x2932('0xe')](function(_0x96ddc0){return db[_0x2932('0x2c')][_0x2932('0x2d')](function(_0x28d802){return db[_0x2932('0x1a')][_0x2932('0x1b')]({'where':_0x5bd205[_0x2932('0x1c')]?_0x5bd205[_0x2932('0x1c')]['where']||null:null,'attributes':_0x5bd205[_0x2932('0x1c')]?_0x5bd205[_0x2932('0x1c')][_0x2932('0x1f')]||null:null,'limit':0x1,'order':_0x5bd205[_0x2932('0x1c')]?_0x5bd205['options'][_0x2932('0x2e')]||null:null,'group':db[_0x2932('0x1a')][_0x2932('0x34')],'transaction':_0x28d802,'lock':_0x28d802['LOCK'][_0x2932('0x30')],'include':_0x5bd205[_0x2932('0x1c')]?_0x5bd205[_0x2932('0x1c')][_0x2932('0x22')]?_[_0x2932('0x21')](_0x5bd205[_0x2932('0x1c')]['include'],function(_0x8a924){return{'model':db[_0x8a924[_0x2932('0x23')]],'as':_0x8a924['as'],'attributes':_0x8a924['attributes'],'include':_0x8a924[_0x2932('0x22')]?_['map'](_0x8a924[_0x2932('0x22')],function(_0x576a82){return{'model':db[_0x576a82[_0x2932('0x23')]],'as':_0x576a82['as'],'attributes':_0x576a82[_0x2932('0x1f')],'include':_0x576a82[_0x2932('0x22')]?_['map'](_0x576a82[_0x2932('0x22')],function(_0x3776c5){return{'model':db[_0x3776c5[_0x2932('0x23')]],'as':_0x3776c5['as'],'attributes':_0x3776c5[_0x2932('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2932('0xe')](function(_0x98b83a){var _0x2319c6=[];for(var _0x658a99=0x0;_0x658a99<_0x98b83a[_0x2932('0x37')];_0x658a99+=0x1){_0x2319c6['push'](_0x98b83a[_0x658a99]['update'](_0x5bd205[_0x2932('0x26')],{'transaction':_0x28d802}));}return BPromise['all'](_0x2319c6);});})[_0x2932('0xe')](function(_0x1c3bc3){logger[_0x2932('0xf')]('GetContactRecallMe',_0x5bd205);logger[_0x2932('0x12')]('GetContactRecallMe',_0x5bd205,JSON[_0x2932('0x14')](_0x1c3bc3));_0x1b2249(_0x1c3bc3);})[_0x2932('0x18')](function(_0x3774a2){logger[_0x2932('0x15')]('GetContactRecallMe',_0x3774a2[_0x2932('0x17')],_0x5bd205);_0x474f31(_0x2b74bb[_0x2932('0x15')](0x1f4,_0x3774a2[_0x2932('0x17')]));});});});};exports['GetCmHopperPreview']=function(_0x460c86){var _0x5bc48a=this;return new Promise(function(_0xfa47aa,_0x1ab38f){db[_0x2932('0x2b')][_0x2932('0x45')]()['then'](function(_0x5eecd3){return db['CmHopper']['findAll']({'raw':_0x460c86[_0x2932('0x1c')]?_0x460c86[_0x2932('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x460c86[_0x2932('0x1c')]?_0x460c86[_0x2932('0x1c')]['where']||null:null,'attributes':_0x460c86[_0x2932('0x1c')]?_0x460c86[_0x2932('0x1c')][_0x2932('0x1f')]||null:null,'limit':_0x460c86[_0x2932('0x1c')]?_0x460c86[_0x2932('0x1c')][_0x2932('0x20')]||null:null,'include':_0x460c86[_0x2932('0x1c')]?_0x460c86['options'][_0x2932('0x22')]?_[_0x2932('0x21')](_0x460c86['options'][_0x2932('0x22')],function(_0x3658e3){return{'model':db[_0x3658e3[_0x2932('0x23')]],'as':_0x3658e3['as'],'attributes':_0x3658e3['as']==='Contact'?_['keys'](_0x5eecd3):_0x3658e3[_0x2932('0x1f')],'include':_0x3658e3[_0x2932('0x22')]?_['map'](_0x3658e3[_0x2932('0x22')],function(_0x2b1de5){return{'model':db[_0x2b1de5[_0x2932('0x23')]],'as':_0x2b1de5['as'],'attributes':_0x2b1de5[_0x2932('0x1f')],'include':_0x2b1de5['include']?_[_0x2932('0x21')](_0x2b1de5[_0x2932('0x22')],function(_0x43e63a){return{'model':db[_0x43e63a[_0x2932('0x23')]],'as':_0x43e63a['as'],'attributes':_0x43e63a[_0x2932('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2932('0xe')](function(_0x1e7248){logger[_0x2932('0xf')](_0x2932('0x19'),_0x460c86);logger[_0x2932('0x12')](_0x2932('0x19'),_0x460c86,JSON[_0x2932('0x14')](_0x1e7248));_0xfa47aa(_0x1e7248);})[_0x2932('0x18')](function(_0xad4a92){logger[_0x2932('0x15')](_0x2932('0x19'),_0xad4a92[_0x2932('0x17')],_0x460c86);_0x1ab38f(_0x5bc48a['error'](0x1f4,_0xad4a92[_0x2932('0x17')]));});});});};exports[_0x2932('0x46')]=function(_0x1b9df6){var _0x115177=this;return new Promise(function(_0x2e6d09,_0x1c89e3){return db[_0x2932('0x2c')][_0x2932('0x2d')](function(_0x722b8d){return db['CmHopper'][_0x2932('0x36')]({'active':![]},{'where':{},'transaction':_0x722b8d})[_0x2932('0xe')](function(_0x50b9fc){logger[_0x2932('0xf')]('ResetActiveCalls',_0x1b9df6);logger['debug'](_0x2932('0x46'),_0x1b9df6,JSON[_0x2932('0x14')](_0x50b9fc));_0x2e6d09(_0x50b9fc);})['catch'](function(_0x5d6966){logger[_0x2932('0x15')]('ResetActiveCalls',_0x5d6966[_0x2932('0x17')],_0x1b9df6);_0x1c89e3(_0x115177['error'](0x1f4,_0x5d6966['message']));});});});}; \ No newline at end of file +var _0x88cb=['push','update','includes','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','LOCK','GetCmHopperPreview','Contact','ResetActiveCalls','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','where','include','map','model','attributes','ShowCmHopper','find','CreateCmHopper','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','CmContact','describe','sequelize','transaction','findAll','order','UPDATE','keys','User','name','voicePause','UserId'];(function(_0x213947,_0x34d7e5){var _0x5d1cbc=function(_0x4e1180){while(--_0x4e1180){_0x213947['push'](_0x213947['shift']());}};_0x5d1cbc(++_0x34d7e5);}(_0x88cb,0xb5));var _0xb88c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x88cb[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb88c('0x0'));var BPromise=require(_0xb88c('0x1'));var rs=require(_0xb88c('0x2'));var fs=require('fs');var Redis=require(_0xb88c('0x3'));var db=require(_0xb88c('0x4'))['db'];var utils=require(_0xb88c('0x5'));var logger=require(_0xb88c('0x6'))(_0xb88c('0x7'));var config=require(_0xb88c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb88c('0x9')][_0xb88c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54d169,_0x48d7d6,_0x13d373){return new BPromise(function(_0x113a4f,_0x356c19){return client['request'](_0x54d169,_0x13d373)[_0xb88c('0xb')](function(_0x567e0e){logger[_0xb88c('0xc')](_0xb88c('0xd'),_0x48d7d6,_0xb88c('0xe'));logger[_0xb88c('0xf')](_0xb88c('0x10'),_0x48d7d6,_0xb88c('0xe'),JSON[_0xb88c('0x11')](_0x567e0e));if(_0x567e0e[_0xb88c('0x12')]){if(_0x567e0e[_0xb88c('0x12')][_0xb88c('0x13')]===0x1f4){logger[_0xb88c('0x12')](_0xb88c('0xd'),_0x48d7d6,_0x567e0e[_0xb88c('0x12')][_0xb88c('0x14')]);return _0x356c19(_0x567e0e[_0xb88c('0x12')][_0xb88c('0x14')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x48d7d6,_0x567e0e[_0xb88c('0x12')][_0xb88c('0x14')]);return _0x113a4f(_0x567e0e[_0xb88c('0x12')][_0xb88c('0x14')]);}else{logger[_0xb88c('0xc')](_0xb88c('0xd'),_0x48d7d6,_0xb88c('0xe'));_0x113a4f(_0x567e0e[_0xb88c('0x15')]['message']);}})[_0xb88c('0x16')](function(_0x3bdd77){logger[_0xb88c('0x12')](_0xb88c('0xd'),_0x48d7d6,_0x3bdd77);_0x356c19(_0x3bdd77);});});}exports[_0xb88c('0x17')]=function(_0x5a31e7){var _0xdb9b2d=this;return new Promise(function(_0x40f86d,_0x1309c6){return db[_0xb88c('0x18')]['findAll']({'raw':_0x5a31e7['options']?_0x5a31e7[_0xb88c('0x19')][_0xb88c('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a31e7[_0xb88c('0x19')]?_0x5a31e7['options'][_0xb88c('0x1b')]||null:null,'attributes':_0x5a31e7['options']?_0x5a31e7[_0xb88c('0x19')]['attributes']||null:null,'limit':_0x5a31e7[_0xb88c('0x19')]?_0x5a31e7[_0xb88c('0x19')]['limit']||null:null,'include':_0x5a31e7['options']?_0x5a31e7['options'][_0xb88c('0x1c')]?_[_0xb88c('0x1d')](_0x5a31e7['options'][_0xb88c('0x1c')],function(_0x2cbe95){return{'model':db[_0x2cbe95[_0xb88c('0x1e')]],'as':_0x2cbe95['as'],'attributes':_0x2cbe95[_0xb88c('0x1f')],'include':_0x2cbe95[_0xb88c('0x1c')]?_[_0xb88c('0x1d')](_0x2cbe95['include'],function(_0x2545ea){return{'model':db[_0x2545ea[_0xb88c('0x1e')]],'as':_0x2545ea['as'],'attributes':_0x2545ea[_0xb88c('0x1f')],'include':_0x2545ea['include']?_['map'](_0x2545ea[_0xb88c('0x1c')],function(_0x2c0704){return{'model':db[_0x2c0704[_0xb88c('0x1e')]],'as':_0x2c0704['as'],'attributes':_0x2c0704['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b681f){logger[_0xb88c('0xc')]('GetCmHopper',_0x5a31e7);logger[_0xb88c('0xf')](_0xb88c('0x17'),_0x5a31e7,JSON[_0xb88c('0x11')](_0x4b681f));_0x40f86d(_0x4b681f);})[_0xb88c('0x16')](function(_0x17c1bd){logger[_0xb88c('0x12')]('GetCmHopper',_0x17c1bd['message'],_0x5a31e7);_0x1309c6(_0xdb9b2d['error'](0x1f4,_0x17c1bd[_0xb88c('0x14')]));});});};exports[_0xb88c('0x20')]=function(_0x14353f){var _0x2ad062=this;return new Promise(function(_0x99d239,_0x3fc9eb){return db[_0xb88c('0x18')][_0xb88c('0x21')]({'raw':_0x14353f['options']?_0x14353f[_0xb88c('0x19')][_0xb88c('0x1a')]===undefined?!![]:![]:!![],'where':_0x14353f['options']?_0x14353f['options'][_0xb88c('0x1b')]||null:null,'attributes':_0x14353f[_0xb88c('0x19')]?_0x14353f[_0xb88c('0x19')]['attributes']||null:null,'include':_0x14353f[_0xb88c('0x19')]?_0x14353f[_0xb88c('0x19')][_0xb88c('0x1c')]?_[_0xb88c('0x1d')](_0x14353f[_0xb88c('0x19')][_0xb88c('0x1c')],function(_0xb20e43){return{'model':db[_0xb20e43[_0xb88c('0x1e')]],'as':_0xb20e43['as'],'attributes':_0xb20e43['attributes'],'include':_0xb20e43[_0xb88c('0x1c')]?_[_0xb88c('0x1d')](_0xb20e43[_0xb88c('0x1c')],function(_0x255a2f){return{'model':db[_0x255a2f[_0xb88c('0x1e')]],'as':_0x255a2f['as'],'attributes':_0x255a2f[_0xb88c('0x1f')],'include':_0x255a2f[_0xb88c('0x1c')]?_[_0xb88c('0x1d')](_0x255a2f[_0xb88c('0x1c')],function(_0x2dceea){return{'model':db[_0x2dceea[_0xb88c('0x1e')]],'as':_0x2dceea['as'],'attributes':_0x2dceea['attributes']};}):[]};}):[]};}):[]:[]})[_0xb88c('0xb')](function(_0x160cde){logger[_0xb88c('0xc')](_0xb88c('0x20'),_0x14353f);logger['debug'](_0xb88c('0x20'),_0x14353f,JSON[_0xb88c('0x11')](_0x160cde));_0x99d239(_0x160cde);})['catch'](function(_0x37349d){logger[_0xb88c('0x12')]('ShowCmHopper',_0x37349d['message'],_0x14353f);_0x3fc9eb(_0x2ad062[_0xb88c('0x12')](0x1f4,_0x37349d['message']));});});};exports[_0xb88c('0x22')]=function(_0x375541){var _0x269ad9=this;return new Promise(function(_0x237ef4,_0x4ebb3e){return db[_0xb88c('0x18')]['create'](_0x375541[_0xb88c('0x23')],{'raw':_0x375541[_0xb88c('0x19')]?_0x375541['options'][_0xb88c('0x1a')]===undefined?!![]:![]:!![]})[_0xb88c('0xb')](function(_0x1e94be){logger[_0xb88c('0xc')](_0xb88c('0x22'),_0x375541);logger[_0xb88c('0xf')](_0xb88c('0x22'),_0x375541,JSON['stringify'](_0x1e94be));_0x237ef4(_0x1e94be);})['catch'](function(_0x26a65a){logger['error'](_0xb88c('0x22'),_0x26a65a[_0xb88c('0x14')],_0x375541);_0x4ebb3e(_0x269ad9[_0xb88c('0x12')](0x1f4,_0x26a65a['message']));});});};exports[_0xb88c('0x24')]=function(_0x5d876f){var _0x5e336b=this;return new Promise(function(_0x43bad6,_0x3f209d){return db[_0xb88c('0x18')]['update'](_0x5d876f[_0xb88c('0x23')],{'raw':_0x5d876f['options']?_0x5d876f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d876f[_0xb88c('0x19')]?_0x5d876f[_0xb88c('0x19')][_0xb88c('0x1b')]||null:null,'attributes':_0x5d876f[_0xb88c('0x19')]?_0x5d876f['options'][_0xb88c('0x1f')]||null:null,'limit':_0x5d876f[_0xb88c('0x19')]?_0x5d876f[_0xb88c('0x19')][_0xb88c('0x25')]||null:null})[_0xb88c('0xb')](function(_0xc343e3){logger[_0xb88c('0xc')](_0xb88c('0x24'),_0x5d876f);logger['info'](_0xb88c('0x26'),JSON[_0xb88c('0x11')](_0x5d876f[_0xb88c('0x19')][_0xb88c('0x1b')]),_0x5d876f[_0xb88c('0x23')][_0xb88c('0x27')]);logger[_0xb88c('0xf')](_0xb88c('0x24'),_0x5d876f,JSON['stringify'](_0xc343e3));_0x43bad6(_0xc343e3);})['catch'](function(_0x1a8410){logger['error'](_0xb88c('0x24'),_0x1a8410['message'],_0x5d876f);_0x3f209d(_0x5e336b[_0xb88c('0x12')](0x1f4,_0x1a8410[_0xb88c('0x14')]));});});};exports[_0xb88c('0x28')]=function(_0x28daac){var _0x10f98d=this;return new Promise(function(_0xb2c34e,_0x7bafcc){return db[_0xb88c('0x18')]['destroy']({'where':_0x28daac[_0xb88c('0x19')]?_0x28daac['options'][_0xb88c('0x1b')]||null:null})[_0xb88c('0xb')](function(_0x5a4c5e){logger['info']('DestroyCmHopper',_0x28daac);logger[_0xb88c('0xf')](_0xb88c('0x28'),_0x28daac,JSON[_0xb88c('0x11')](_0x5a4c5e));_0xb2c34e(_0x5a4c5e);})[_0xb88c('0x16')](function(_0xee6857){logger[_0xb88c('0x12')](_0xb88c('0x28'),_0xee6857['message'],_0x28daac);_0x7bafcc(_0x10f98d[_0xb88c('0x12')](0x1f4,_0xee6857['message']));});});};exports['GetContactDialer']=function(_0x5eb35b){var _0x1c441e=this;return new Promise(function(_0x56dc15,_0x2c7b0f){return db[_0xb88c('0x29')][_0xb88c('0x2a')]()[_0xb88c('0xb')](function(_0x5ee815){return db[_0xb88c('0x2b')][_0xb88c('0x2c')](function(_0x503339){return db['CmHopper'][_0xb88c('0x2d')]({'where':_0x5eb35b[_0xb88c('0x19')]?_0x5eb35b['options']['where']||null:null,'attributes':_0x5eb35b[_0xb88c('0x19')]?_0x5eb35b[_0xb88c('0x19')][_0xb88c('0x1f')]||null:null,'limit':_0x5eb35b['options']?_0x5eb35b[_0xb88c('0x19')][_0xb88c('0x25')]||null:null,'order':_0x5eb35b[_0xb88c('0x19')]?_0x5eb35b[_0xb88c('0x19')][_0xb88c('0x2e')]||null:null,'transaction':_0x503339,'lock':_0x503339['LOCK'][_0xb88c('0x2f')],'include':[{'model':db[_0xb88c('0x29')],'as':'Contact','attributes':_[_0xb88c('0x30')](_0x5ee815)},{'model':db[_0xb88c('0x31')],'as':'Agent','attributes':['id',_0xb88c('0x32'),_0xb88c('0x33')]}]})['then'](function(_0x1bc88f){var _0x1b18c3=[];var _0x1f1244=[];for(var _0x3b3509=0x0;_0x3b3509<_0x1bc88f['length'];_0x3b3509+=0x1){var _0x1d4465=_0x1bc88f[_0x3b3509][_0xb88c('0x34')];if(_0x1d4465===null){_0x1b18c3[_0xb88c('0x35')](_0x1bc88f[_0x3b3509][_0xb88c('0x36')](_0x5eb35b[_0xb88c('0x23')],{'transaction':_0x503339}));}else if(!_0x1f1244[_0xb88c('0x37')](_0x1d4465)){_0x1f1244['push'](_0x1d4465);_0x1b18c3['push'](_0x1bc88f[_0x3b3509][_0xb88c('0x36')](_0x5eb35b[_0xb88c('0x23')],{'transaction':_0x503339}));}}return BPromise[_0xb88c('0x38')](_0x1b18c3);});})[_0xb88c('0xb')](function(_0x4f2fe1){logger[_0xb88c('0xc')](_0xb88c('0x39'),_0x5eb35b);if(_0x4f2fe1[_0xb88c('0x3a')]>0x0){logger[_0xb88c('0xc')](_0xb88c('0x3b'),_0x4f2fe1[0x0][_0xb88c('0x3c')]['id'],_0x4f2fe1[0x0][_0xb88c('0x3c')][_0xb88c('0x3d')],_0x4f2fe1[0x0][_0xb88c('0x3c')][_0xb88c('0x27')]);}logger[_0xb88c('0xf')]('GetContactDialer',_0x5eb35b,JSON[_0xb88c('0x11')](_0x4f2fe1));_0x56dc15(_0x4f2fe1);})[_0xb88c('0x16')](function(_0x27c9bc){logger[_0xb88c('0x12')](_0xb88c('0x39'),_0x27c9bc['message'],_0x5eb35b);_0x2c7b0f(_0x1c441e[_0xb88c('0x12')](0x1f4,_0x27c9bc[_0xb88c('0x14')]));});});});};exports[_0xb88c('0x3e')]=function(_0x5e5716){var _0x1aa32f=this;return new Promise(function(_0x3ef6f3,_0x2a2c1a){return db[_0xb88c('0x2b')][_0xb88c('0x2c')](function(_0x5d64d6){return db[_0xb88c('0x3f')][_0xb88c('0x40')](_0x5e5716[_0xb88c('0x23')],{'raw':_0x5e5716[_0xb88c('0x19')]?_0x5e5716[_0xb88c('0x19')][_0xb88c('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x5d64d6})[_0xb88c('0xb')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xb88c('0x11')](_0x5e5716['options'][_0xb88c('0x1b')]),_0x5e5716[_0xb88c('0x19')][_0xb88c('0x1b')][_0xb88c('0x27')]);return db[_0xb88c('0x18')][_0xb88c('0x41')]({'where':_0x5e5716[_0xb88c('0x19')]?_0x5e5716[_0xb88c('0x19')][_0xb88c('0x1b')]||null:null,'transaction':_0x5d64d6});});})[_0xb88c('0xb')](function(_0x4739e3){logger['info'](_0xb88c('0x3e'),_0x5e5716);logger[_0xb88c('0xf')](_0xb88c('0x3e'),_0x5e5716,JSON[_0xb88c('0x11')](_0x4739e3));_0x3ef6f3(_0x4739e3);})['catch'](function(_0x35ffc6){logger[_0xb88c('0x12')](_0xb88c('0x3e'),_0x35ffc6['message'],_0x5e5716);_0x2a2c1a(_0x1aa32f[_0xb88c('0x12')](0x1f4,_0x35ffc6[_0xb88c('0x14')]));});});};exports[_0xb88c('0x42')]=function(_0x11c8a4){var _0x49d77c=this;return new Promise(function(_0x19b2fc,_0x2bd6c2){return db[_0xb88c('0x18')]['findAll']({'raw':_0x11c8a4['options']?_0x11c8a4[_0xb88c('0x19')][_0xb88c('0x1a')]===undefined?!![]:![]:!![],'where':_0x11c8a4[_0xb88c('0x19')]?_0x11c8a4['options']['where']||null:null,'attributes':[[db[_0xb88c('0x2b')]['fn'](_0xb88c('0x43'),db[_0xb88c('0x2b')]['fn']('IF',db[_0xb88c('0x2b')][_0xb88c('0x44')](_0xb88c('0x45')+util[_0xb88c('0x46')]('\x22%s\x22',moment()[_0xb88c('0x46')](_0xb88c('0x47')))+_0xb88c('0x48')))),'contactsRescheduled']]})[_0xb88c('0xb')](function(_0x5bd0bd){logger[_0xb88c('0xc')](_0xb88c('0x42'),_0x11c8a4);logger['debug'](_0xb88c('0x42'),_0x11c8a4,JSON['stringify'](_0x5bd0bd));_0x19b2fc(_0x5bd0bd);})[_0xb88c('0x16')](function(_0x17ebff){logger[_0xb88c('0x12')](_0xb88c('0x42'),_0x17ebff[_0xb88c('0x14')],_0x11c8a4);_0x2bd6c2(_0x49d77c['error'](0x1f4,_0x17ebff[_0xb88c('0x14')]));});});};exports[_0xb88c('0x49')]=function(_0x2febce){var _0x2f330=this;return new Promise(function(_0x3ab39b,_0x437f97){return db[_0xb88c('0x29')]['describe']()[_0xb88c('0xb')](function(_0x3cacd3){return db[_0xb88c('0x2b')]['transaction'](function(_0x4fa055){return db[_0xb88c('0x18')][_0xb88c('0x2d')]({'where':_0x2febce[_0xb88c('0x19')]?_0x2febce[_0xb88c('0x19')][_0xb88c('0x1b')]||null:null,'attributes':_0x2febce[_0xb88c('0x19')]?_0x2febce[_0xb88c('0x19')][_0xb88c('0x1f')]||null:null,'limit':0x1,'order':_0x2febce['options']?_0x2febce[_0xb88c('0x19')][_0xb88c('0x2e')]||null:null,'group':db[_0xb88c('0x18')][_0xb88c('0x34')],'transaction':_0x4fa055,'lock':_0x4fa055[_0xb88c('0x4a')]['UPDATE'],'include':_0x2febce['options']?_0x2febce[_0xb88c('0x19')]['include']?_[_0xb88c('0x1d')](_0x2febce[_0xb88c('0x19')][_0xb88c('0x1c')],function(_0x486e2){return{'model':db[_0x486e2[_0xb88c('0x1e')]],'as':_0x486e2['as'],'attributes':_0x486e2[_0xb88c('0x1f')],'include':_0x486e2[_0xb88c('0x1c')]?_[_0xb88c('0x1d')](_0x486e2[_0xb88c('0x1c')],function(_0x4db6f9){return{'model':db[_0x4db6f9[_0xb88c('0x1e')]],'as':_0x4db6f9['as'],'attributes':_0x4db6f9[_0xb88c('0x1f')],'include':_0x4db6f9[_0xb88c('0x1c')]?_[_0xb88c('0x1d')](_0x4db6f9[_0xb88c('0x1c')],function(_0x2ead44){return{'model':db[_0x2ead44[_0xb88c('0x1e')]],'as':_0x2ead44['as'],'attributes':_0x2ead44[_0xb88c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb88c('0xb')](function(_0x51c08b){var _0xebaed7=[];for(var _0x38cb63=0x0;_0x38cb63<_0x51c08b[_0xb88c('0x3a')];_0x38cb63+=0x1){_0xebaed7[_0xb88c('0x35')](_0x51c08b[_0x38cb63][_0xb88c('0x36')](_0x2febce[_0xb88c('0x23')],{'transaction':_0x4fa055}));}return BPromise['all'](_0xebaed7);});})['then'](function(_0x2d4c37){logger['info'](_0xb88c('0x49'),_0x2febce);logger['debug']('GetContactRecallMe',_0x2febce,JSON[_0xb88c('0x11')](_0x2d4c37));_0x3ab39b(_0x2d4c37);})[_0xb88c('0x16')](function(_0x27d284){logger['error'](_0xb88c('0x49'),_0x27d284[_0xb88c('0x14')],_0x2febce);_0x437f97(_0x2f330[_0xb88c('0x12')](0x1f4,_0x27d284['message']));});});});};exports[_0xb88c('0x4b')]=function(_0xeefe75){var _0x4b8ddb=this;return new Promise(function(_0x256f3d,_0x26d7bf){db[_0xb88c('0x29')]['describe']()[_0xb88c('0xb')](function(_0x571071){return db[_0xb88c('0x18')]['findAll']({'raw':_0xeefe75[_0xb88c('0x19')]?_0xeefe75[_0xb88c('0x19')][_0xb88c('0x1a')]===undefined?!![]:![]:!![],'where':_0xeefe75['options']?_0xeefe75[_0xb88c('0x19')][_0xb88c('0x1b')]||null:null,'attributes':_0xeefe75[_0xb88c('0x19')]?_0xeefe75[_0xb88c('0x19')][_0xb88c('0x1f')]||null:null,'limit':_0xeefe75[_0xb88c('0x19')]?_0xeefe75['options']['limit']||null:null,'include':_0xeefe75[_0xb88c('0x19')]?_0xeefe75['options'][_0xb88c('0x1c')]?_['map'](_0xeefe75[_0xb88c('0x19')][_0xb88c('0x1c')],function(_0x5c2db6){return{'model':db[_0x5c2db6[_0xb88c('0x1e')]],'as':_0x5c2db6['as'],'attributes':_0x5c2db6['as']===_0xb88c('0x4c')?_[_0xb88c('0x30')](_0x571071):_0x5c2db6[_0xb88c('0x1f')],'include':_0x5c2db6[_0xb88c('0x1c')]?_['map'](_0x5c2db6[_0xb88c('0x1c')],function(_0x1180c8){return{'model':db[_0x1180c8[_0xb88c('0x1e')]],'as':_0x1180c8['as'],'attributes':_0x1180c8[_0xb88c('0x1f')],'include':_0x1180c8['include']?_['map'](_0x1180c8['include'],function(_0x11dda5){return{'model':db[_0x11dda5[_0xb88c('0x1e')]],'as':_0x11dda5['as'],'attributes':_0x11dda5[_0xb88c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb88c('0xb')](function(_0x2076a6){logger['info'](_0xb88c('0x17'),_0xeefe75);logger[_0xb88c('0xf')](_0xb88c('0x17'),_0xeefe75,JSON[_0xb88c('0x11')](_0x2076a6));_0x256f3d(_0x2076a6);})[_0xb88c('0x16')](function(_0x2777dd){logger[_0xb88c('0x12')]('GetCmHopper',_0x2777dd[_0xb88c('0x14')],_0xeefe75);_0x26d7bf(_0x4b8ddb[_0xb88c('0x12')](0x1f4,_0x2777dd[_0xb88c('0x14')]));});});});};exports[_0xb88c('0x4d')]=function(_0x57cb54){var _0x132099=this;return new Promise(function(_0x467f54,_0x1c14f5){return db[_0xb88c('0x2b')][_0xb88c('0x2c')](function(_0x1c2d66){return db[_0xb88c('0x18')][_0xb88c('0x36')]({'active':![]},{'where':{},'transaction':_0x1c2d66})['then'](function(_0x464efb){logger['info'](_0xb88c('0x4d'),_0x57cb54);logger[_0xb88c('0xf')](_0xb88c('0x4d'),_0x57cb54,JSON['stringify'](_0x464efb));_0x467f54(_0x464efb);})[_0xb88c('0x16')](function(_0xe2c0e2){logger[_0xb88c('0x12')](_0xb88c('0x4d'),_0xe2c0e2[_0xb88c('0x14')],_0x57cb54);_0x1c14f5(_0x132099[_0xb88c('0x12')](0x1f4,_0xe2c0e2[_0xb88c('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c57da77..a04e1a3 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 _0xbd55=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','show','post','create','/preview','put','/:id'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xbd55,0xff));var _0x5bd5=function(_0x51666b,_0x48e537){_0x51666b=_0x51666b-0x0;var _0x1858fa=_0xbd55[_0x51666b];return _0x1858fa;};'use strict';var multer=require('multer');var util=require(_0x5bd5('0x0'));var path=require('path');var timeout=require(_0x5bd5('0x1'));var express=require(_0x5bd5('0x2'));var router=express[_0x5bd5('0x3')]();var fs_extra=require(_0x5bd5('0x4'));var auth=require(_0x5bd5('0x5'));var interaction=require(_0x5bd5('0x6'));var config=require('../../config/environment');var controller=require(_0x5bd5('0x7'));router[_0x5bd5('0x8')]('/',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0xa')]);router[_0x5bd5('0x8')](_0x5bd5('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x5bd5('0x8')]('/opencontacts',auth[_0x5bd5('0x9')](),controller['getOpenContacts']);router['get']('/:id',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0xc')]);router[_0x5bd5('0xd')]('/',auth[_0x5bd5('0x9')](),controller[_0x5bd5('0xe')]);router[_0x5bd5('0xd')](_0x5bd5('0xf'),auth[_0x5bd5('0x9')](),controller['getPreview']);router[_0x5bd5('0x10')](_0x5bd5('0x11'),auth[_0x5bd5('0x9')](),controller['update']);router[_0x5bd5('0x12')](_0x5bd5('0x11'),auth[_0x5bd5('0x9')](),controller[_0x5bd5('0x13')]);module[_0x5bd5('0x14')]=router; \ No newline at end of file +var _0xeb3d=['get','isAuthenticated','/describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','put','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller'];(function(_0x16fa02,_0x3eaff5){var _0x58fa70=function(_0x18bfc5){while(--_0x18bfc5){_0x16fa02['push'](_0x16fa02['shift']());}};_0x58fa70(++_0x3eaff5);}(_0xeb3d,0xf4));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdeb3('0x0'));var util=require(_0xdeb3('0x1'));var path=require(_0xdeb3('0x2'));var timeout=require('connect-timeout');var express=require(_0xdeb3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdeb3('0x4'));var interaction=require(_0xdeb3('0x5'));var config=require(_0xdeb3('0x6'));var controller=require(_0xdeb3('0x7'));router[_0xdeb3('0x8')]('/',auth[_0xdeb3('0x9')](),controller['index']);router['get'](_0xdeb3('0xa'),auth[_0xdeb3('0x9')](),controller['describe']);router[_0xdeb3('0x8')](_0xdeb3('0xb'),auth['isAuthenticated'](),controller[_0xdeb3('0xc')]);router['get'](_0xdeb3('0xd'),auth[_0xdeb3('0x9')](),controller['show']);router[_0xdeb3('0xe')]('/',auth[_0xdeb3('0x9')](),controller[_0xdeb3('0xf')]);router['post'](_0xdeb3('0x10'),auth[_0xdeb3('0x9')](),controller['getPreview']);router[_0xdeb3('0x11')](_0xdeb3('0xd'),auth[_0xdeb3('0x9')](),controller[_0xdeb3('0x12')]);router[_0xdeb3('0x13')](_0xdeb3('0xd'),auth[_0xdeb3('0x9')](),controller[_0xdeb3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 93c4923..e3976e6 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 _0x29a1=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x270913,_0xb25fb4){var _0x1e1dba=function(_0x1bbe82){while(--_0x1bbe82){_0x270913['push'](_0x270913['shift']());}};_0x1e1dba(++_0xb25fb4);}(_0x29a1,0x118));var _0x129a=function(_0x2170ca,_0x538839){_0x2170ca=_0x2170ca-0x0;var _0x2e8b25=_0x29a1[_0x2170ca];return _0x2e8b25;};'use strict';var moment=require(_0x129a('0x0'));var Sequelize=require(_0x129a('0x1'));module[_0x129a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x129a('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x129a('0x3')],'unique':_0x129a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x129a('0x3')],'unique':_0x129a('0x4')}}; \ No newline at end of file +var _0x64f5=['contactListQueue','moment','INTEGER'];(function(_0x1cd1df,_0x1a3023){var _0x2020fe=function(_0x4a3252){while(--_0x4a3252){_0x1cd1df['push'](_0x1cd1df['shift']());}};_0x2020fe(++_0x1a3023);}(_0x64f5,0x17e));var _0x564f=function(_0x13678c,_0x137710){_0x13678c=_0x13678c-0x0;var _0x1ef6fe=_0x64f5[_0x13678c];return _0x1ef6fe;};'use strict';var moment=require(_0x564f('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x564f('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x564f('0x1')],'unique':_0x564f('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x564f('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 9c65f76..dbb50ac 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 _0x7b81=['name','map','CmHopperBlack','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','limit','count','offset','set','json','apply','reject','update','destroy','then'];(function(_0x88fab1,_0x1accff){var _0x20c571=function(_0x12de1c){while(--_0x12de1c){_0x88fab1['push'](_0x88fab1['shift']());}};_0x20c571(++_0x1accff);}(_0x7b81,0xab));var _0x17b8=function(_0x1d7a9f,_0x366f16){_0x1d7a9f=_0x1d7a9f-0x0;var _0x377548=_0x7b81[_0x1d7a9f];return _0x377548;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x17b8('0x0'));var zipdir=require(_0x17b8('0x1'));var jsonpatch=require(_0x17b8('0x2'));var rp=require(_0x17b8('0x3'));var moment=require(_0x17b8('0x4'));var BPromise=require(_0x17b8('0x5'));var Mustache=require('mustache');var util=require(_0x17b8('0x6'));var path=require(_0x17b8('0x7'));var sox=require(_0x17b8('0x8'));var csv=require(_0x17b8('0x9'));var ejs=require(_0x17b8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17b8('0xb'));var squel=require('squel');var crypto=require(_0x17b8('0xc'));var jsforce=require(_0x17b8('0xd'));var deskjs=require(_0x17b8('0xe'));var toCsv=require(_0x17b8('0x9'));var querystring=require(_0x17b8('0xf'));var Papa=require(_0x17b8('0x10'));var Redis=require(_0x17b8('0x11'));var authService=require(_0x17b8('0x12'));var qs=require(_0x17b8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x17b8('0x14'))(_0x17b8('0x15'));var utils=require('../../config/utils');var config=require(_0x17b8('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b9d89,_0x196fe1){_0x196fe1=_0x196fe1||0xcc;return function(_0x491a2a){if(_0x491a2a){return _0x5b9d89[_0x17b8('0x17')](_0x196fe1);}return _0x5b9d89[_0x17b8('0x18')](_0x196fe1)[_0x17b8('0x19')]();};}function respondWithResult(_0x29f1b8,_0x30bceb){_0x30bceb=_0x30bceb||0xc8;return function(_0x5f3899){if(_0x5f3899){return _0x29f1b8[_0x17b8('0x18')](_0x30bceb)['json'](_0x5f3899);}};}function respondWithFilteredResult(_0x118f27,_0x195c31){return function(_0x2c0c37){if(_0x2c0c37){var _0xabaca2=typeof _0x195c31['offset']==='undefined'&&typeof _0x195c31[_0x17b8('0x1a')]==='undefined';var _0x527755=_0x2c0c37[_0x17b8('0x1b')];var _0x2b4143=_0xabaca2?0x0:_0x195c31[_0x17b8('0x1c')];var _0x409a37=_0xabaca2?_0x2c0c37[_0x17b8('0x1b')]:_0x195c31['offset']+_0x195c31['limit'];var _0x1d1252;if(_0x409a37>=_0x527755){_0x409a37=_0x527755;_0x1d1252=0xc8;}else{_0x1d1252=0xce;}_0x118f27[_0x17b8('0x18')](_0x1d1252);return _0x118f27[_0x17b8('0x1d')]('Content-Range',_0x2b4143+'-'+_0x409a37+'/'+_0x527755)[_0x17b8('0x1e')](_0x2c0c37);}return null;};}function patchUpdates(_0x32b917){return function(_0x37df9c){try{jsonpatch[_0x17b8('0x1f')](_0x37df9c,_0x32b917,!![]);}catch(_0x1f1b09){return BPromise[_0x17b8('0x20')](_0x1f1b09);}return _0x37df9c['save']();};}function saveUpdates(_0x55f725,_0x19c845){return function(_0x410aef){if(_0x410aef){return _0x410aef[_0x17b8('0x21')](_0x55f725)['then'](function(_0x4f930f){return _0x4f930f;});}return null;};}function removeEntity(_0x3ceef5,_0xe932c3){return function(_0x42ce36){if(_0x42ce36){return _0x42ce36[_0x17b8('0x22')]()[_0x17b8('0x23')](function(){_0x3ceef5[_0x17b8('0x18')](0xcc)[_0x17b8('0x19')]();});}};}function handleEntityNotFound(_0x38221d,_0x71ce11){return function(_0x3b45f2){if(!_0x3b45f2){_0x38221d[_0x17b8('0x17')](0x194);}return _0x3b45f2;};}function handleError(_0x4da05f,_0x511b8f){_0x511b8f=_0x511b8f||0x1f4;return function(_0x172d5b){logger['error'](_0x172d5b['stack']);if(_0x172d5b[_0x17b8('0x24')]){delete _0x172d5b['name'];}_0x4da05f[_0x17b8('0x18')](_0x511b8f)['send'](_0x172d5b);};}exports['index']=function(_0x569856,_0x5256c0){var _0x2c5632={},_0x47f564={},_0x4e05c7={'count':0x0,'rows':[]};var _0x120a30=_[_0x17b8('0x25')](db[_0x17b8('0x26')][_0x17b8('0x27')],function(_0x6836a1){return{'name':_0x6836a1[_0x17b8('0x28')],'type':_0x6836a1[_0x17b8('0x29')]['key']};});_0x47f564[_0x17b8('0x2a')]=_[_0x17b8('0x25')](_0x120a30,_0x17b8('0x24'));_0x47f564[_0x17b8('0x2b')]=_['keys'](_0x569856[_0x17b8('0x2b')]);_0x47f564[_0x17b8('0x2c')]=_[_0x17b8('0x2d')](_0x47f564[_0x17b8('0x2a')],_0x47f564[_0x17b8('0x2b')]);_0x2c5632[_0x17b8('0x2e')]=_[_0x17b8('0x2d')](_0x47f564[_0x17b8('0x2a')],qs[_0x17b8('0x2f')](_0x569856['query'][_0x17b8('0x2f')]));_0x2c5632[_0x17b8('0x2e')]=_0x2c5632[_0x17b8('0x2e')][_0x17b8('0x30')]?_0x2c5632['attributes']:_0x47f564[_0x17b8('0x2a')];if(!_0x569856[_0x17b8('0x2b')][_0x17b8('0x31')](_0x17b8('0x32'))){_0x2c5632[_0x17b8('0x1a')]=qs[_0x17b8('0x1a')](_0x569856[_0x17b8('0x2b')][_0x17b8('0x1a')]);_0x2c5632[_0x17b8('0x1c')]=qs['offset'](_0x569856[_0x17b8('0x2b')]['offset']);}_0x2c5632[_0x17b8('0x33')]=qs[_0x17b8('0x34')](_0x569856['query'][_0x17b8('0x34')]);_0x2c5632['where']=qs['filters'](_[_0x17b8('0x35')](_0x569856[_0x17b8('0x2b')],_0x47f564[_0x17b8('0x2c')]),_0x120a30);if(_0x569856[_0x17b8('0x2b')][_0x17b8('0x36')]){_0x2c5632[_0x17b8('0x37')]=_[_0x17b8('0x38')](_0x2c5632[_0x17b8('0x37')],{'$or':_[_0x17b8('0x25')](_0x120a30,function(_0x2a995f){if(_0x2a995f[_0x17b8('0x29')]!==_0x17b8('0x39')){var _0x478e84={};_0x478e84[_0x2a995f[_0x17b8('0x24')]]={'$like':'%'+_0x569856[_0x17b8('0x2b')]['filter']+'%'};return _0x478e84;}})});}_0x2c5632=_[_0x17b8('0x38')]({},_0x2c5632,_0x569856[_0x17b8('0x3a')]);var _0x22a146={'where':_0x2c5632['where']};return db['CmHopperBlack'][_0x17b8('0x1b')](_0x22a146)[_0x17b8('0x23')](function(_0x4f4c0f){_0x4e05c7[_0x17b8('0x1b')]=_0x4f4c0f;if(_0x569856[_0x17b8('0x2b')][_0x17b8('0x3b')]){_0x2c5632['include']=[{'all':!![]}];}return db[_0x17b8('0x26')][_0x17b8('0x3c')](_0x2c5632);})['then'](function(_0x483276){_0x4e05c7[_0x17b8('0x3d')]=_0x483276;return _0x4e05c7;})[_0x17b8('0x23')](respondWithFilteredResult(_0x5256c0,_0x2c5632))[_0x17b8('0x3e')](handleError(_0x5256c0,null));};exports['show']=function(_0x2e94d8,_0x5dc71b){var _0x3f4e71={'raw':!![],'where':{'id':_0x2e94d8[_0x17b8('0x3f')]['id']}},_0xaa03c={};_0xaa03c[_0x17b8('0x2a')]=_[_0x17b8('0x40')](db[_0x17b8('0x26')]['rawAttributes']);_0xaa03c[_0x17b8('0x2b')]=_[_0x17b8('0x40')](_0x2e94d8[_0x17b8('0x2b')]);_0xaa03c[_0x17b8('0x2c')]=_[_0x17b8('0x2d')](_0xaa03c[_0x17b8('0x2a')],_0xaa03c[_0x17b8('0x2b')]);_0x3f4e71[_0x17b8('0x2e')]=_[_0x17b8('0x2d')](_0xaa03c[_0x17b8('0x2a')],qs[_0x17b8('0x2f')](_0x2e94d8[_0x17b8('0x2b')]['fields']));_0x3f4e71['attributes']=_0x3f4e71['attributes'][_0x17b8('0x30')]?_0x3f4e71[_0x17b8('0x2e')]:_0xaa03c[_0x17b8('0x2a')];if(_0x2e94d8[_0x17b8('0x2b')][_0x17b8('0x3b')]){_0x3f4e71[_0x17b8('0x41')]=[{'all':!![]}];}_0x3f4e71=_[_0x17b8('0x38')]({},_0x3f4e71,_0x2e94d8[_0x17b8('0x3a')]);return db['CmHopperBlack']['find'](_0x3f4e71)[_0x17b8('0x23')](handleEntityNotFound(_0x5dc71b,null))[_0x17b8('0x23')](respondWithResult(_0x5dc71b,null))[_0x17b8('0x3e')](handleError(_0x5dc71b,null));};exports[_0x17b8('0x21')]=function(_0x464e85,_0x376e1f){if(_0x464e85[_0x17b8('0x42')]['id']){delete _0x464e85[_0x17b8('0x42')]['id'];}return db[_0x17b8('0x26')][_0x17b8('0x43')]({'where':{'id':_0x464e85[_0x17b8('0x3f')]['id']}})[_0x17b8('0x23')](handleEntityNotFound(_0x376e1f,null))[_0x17b8('0x23')](saveUpdates(_0x464e85['body'],null))[_0x17b8('0x23')](respondWithResult(_0x376e1f,null))[_0x17b8('0x3e')](handleError(_0x376e1f,null));};exports[_0x17b8('0x22')]=function(_0x2e7244,_0x49738d){return db[_0x17b8('0x26')][_0x17b8('0x43')]({'where':{'id':_0x2e7244[_0x17b8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x49738d,null))[_0x17b8('0x23')](removeEntity(_0x49738d,null))[_0x17b8('0x3e')](handleError(_0x49738d,null));};exports[_0x17b8('0x44')]=function(_0x2b78fa,_0x2ae211){return db[_0x17b8('0x26')]['describe']()[_0x17b8('0x23')](respondWithResult(_0x2ae211,null))[_0x17b8('0x3e')](handleError(_0x2ae211,null));}; \ No newline at end of file +var _0x4379=['name','send','index','map','CmHopperBlack','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','error','stack'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x4379,0x102));var _0x9437=function(_0x12955c,_0x10753c){_0x12955c=_0x12955c-0x0;var _0x2b75d6=_0x4379[_0x12955c];return _0x2b75d6;};'use strict';var emlformat=require(_0x9437('0x0'));var rimraf=require(_0x9437('0x1'));var zipdir=require(_0x9437('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9437('0x3'));var moment=require(_0x9437('0x4'));var BPromise=require(_0x9437('0x5'));var Mustache=require(_0x9437('0x6'));var util=require(_0x9437('0x7'));var path=require('path');var sox=require(_0x9437('0x8'));var csv=require(_0x9437('0x9'));var ejs=require(_0x9437('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9437('0xb'));var squel=require(_0x9437('0xc'));var crypto=require(_0x9437('0xd'));var jsforce=require(_0x9437('0xe'));var deskjs=require(_0x9437('0xf'));var toCsv=require(_0x9437('0x9'));var querystring=require(_0x9437('0x10'));var Papa=require(_0x9437('0x11'));var Redis=require(_0x9437('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9437('0x13'));var as=require(_0x9437('0x14'));var hardwareService=require(_0x9437('0x15'));var logger=require(_0x9437('0x16'))(_0x9437('0x17'));var utils=require('../../config/utils');var config=require(_0x9437('0x18'));var licenseUtil=require(_0x9437('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58c4fe,_0x22fb8b){_0x22fb8b=_0x22fb8b||0xcc;return function(_0x29a2b8){if(_0x29a2b8){return _0x58c4fe[_0x9437('0x1a')](_0x22fb8b);}return _0x58c4fe[_0x9437('0x1b')](_0x22fb8b)[_0x9437('0x1c')]();};}function respondWithResult(_0xf67ef0,_0x5b9776){_0x5b9776=_0x5b9776||0xc8;return function(_0x4862f7){if(_0x4862f7){return _0xf67ef0[_0x9437('0x1b')](_0x5b9776)['json'](_0x4862f7);}};}function respondWithFilteredResult(_0x5e1c9a,_0xf7e4ad){return function(_0x26c45b){if(_0x26c45b){var _0x1edfb0=typeof _0xf7e4ad[_0x9437('0x1d')]==='undefined'&&typeof _0xf7e4ad[_0x9437('0x1e')]===_0x9437('0x1f');var _0x1c0b6f=_0x26c45b['count'];var _0x42491f=_0x1edfb0?0x0:_0xf7e4ad[_0x9437('0x1d')];var _0x3f4c20=_0x1edfb0?_0x26c45b[_0x9437('0x20')]:_0xf7e4ad[_0x9437('0x1d')]+_0xf7e4ad['limit'];var _0x2542fd;if(_0x3f4c20>=_0x1c0b6f){_0x3f4c20=_0x1c0b6f;_0x2542fd=0xc8;}else{_0x2542fd=0xce;}_0x5e1c9a['status'](_0x2542fd);return _0x5e1c9a[_0x9437('0x21')]('Content-Range',_0x42491f+'-'+_0x3f4c20+'/'+_0x1c0b6f)[_0x9437('0x22')](_0x26c45b);}return null;};}function patchUpdates(_0x1cc5b6){return function(_0x1bfe7f){try{jsonpatch[_0x9437('0x23')](_0x1bfe7f,_0x1cc5b6,!![]);}catch(_0x36ff0e){return BPromise[_0x9437('0x24')](_0x36ff0e);}return _0x1bfe7f[_0x9437('0x25')]();};}function saveUpdates(_0xcb5b9b,_0x23dfeb){return function(_0xbb28f7){if(_0xbb28f7){return _0xbb28f7[_0x9437('0x26')](_0xcb5b9b)[_0x9437('0x27')](function(_0xad91f){return _0xad91f;});}return null;};}function removeEntity(_0x40917c,_0x5929e2){return function(_0x3c4aab){if(_0x3c4aab){return _0x3c4aab['destroy']()[_0x9437('0x27')](function(){_0x40917c[_0x9437('0x1b')](0xcc)[_0x9437('0x1c')]();});}};}function handleEntityNotFound(_0x20dd77,_0x1c5398){return function(_0x3894fe){if(!_0x3894fe){_0x20dd77[_0x9437('0x1a')](0x194);}return _0x3894fe;};}function handleError(_0x5aaaee,_0x2543f7){_0x2543f7=_0x2543f7||0x1f4;return function(_0x3cad9d){logger[_0x9437('0x28')](_0x3cad9d[_0x9437('0x29')]);if(_0x3cad9d[_0x9437('0x2a')]){delete _0x3cad9d[_0x9437('0x2a')];}_0x5aaaee[_0x9437('0x1b')](_0x2543f7)[_0x9437('0x2b')](_0x3cad9d);};}exports[_0x9437('0x2c')]=function(_0x1e281f,_0x151355){var _0x4b3192={},_0x3bfd51={},_0x5aded0={'count':0x0,'rows':[]};var _0xb9b874=_[_0x9437('0x2d')](db[_0x9437('0x2e')]['rawAttributes'],function(_0x77b271){return{'name':_0x77b271['fieldName'],'type':_0x77b271[_0x9437('0x2f')][_0x9437('0x30')]};});_0x3bfd51['model']=_[_0x9437('0x2d')](_0xb9b874,_0x9437('0x2a'));_0x3bfd51['query']=_[_0x9437('0x31')](_0x1e281f[_0x9437('0x32')]);_0x3bfd51[_0x9437('0x33')]=_[_0x9437('0x34')](_0x3bfd51[_0x9437('0x35')],_0x3bfd51[_0x9437('0x32')]);_0x4b3192[_0x9437('0x36')]=_['intersection'](_0x3bfd51[_0x9437('0x35')],qs[_0x9437('0x37')](_0x1e281f[_0x9437('0x32')][_0x9437('0x37')]));_0x4b3192[_0x9437('0x36')]=_0x4b3192[_0x9437('0x36')][_0x9437('0x38')]?_0x4b3192[_0x9437('0x36')]:_0x3bfd51[_0x9437('0x35')];if(!_0x1e281f[_0x9437('0x32')]['hasOwnProperty'](_0x9437('0x39'))){_0x4b3192[_0x9437('0x1e')]=qs[_0x9437('0x1e')](_0x1e281f[_0x9437('0x32')][_0x9437('0x1e')]);_0x4b3192[_0x9437('0x1d')]=qs['offset'](_0x1e281f[_0x9437('0x32')][_0x9437('0x1d')]);}_0x4b3192[_0x9437('0x3a')]=qs[_0x9437('0x3b')](_0x1e281f[_0x9437('0x32')]['sort']);_0x4b3192[_0x9437('0x3c')]=qs[_0x9437('0x33')](_[_0x9437('0x3d')](_0x1e281f[_0x9437('0x32')],_0x3bfd51[_0x9437('0x33')]),_0xb9b874);if(_0x1e281f[_0x9437('0x32')][_0x9437('0x3e')]){_0x4b3192[_0x9437('0x3c')]=_[_0x9437('0x3f')](_0x4b3192[_0x9437('0x3c')],{'$or':_['map'](_0xb9b874,function(_0x450355){if(_0x450355[_0x9437('0x2f')]!==_0x9437('0x40')){var _0x578f63={};_0x578f63[_0x450355['name']]={'$like':'%'+_0x1e281f[_0x9437('0x32')]['filter']+'%'};return _0x578f63;}})});}_0x4b3192=_['merge']({},_0x4b3192,_0x1e281f[_0x9437('0x41')]);var _0x1478ee={'where':_0x4b3192[_0x9437('0x3c')]};return db[_0x9437('0x2e')][_0x9437('0x20')](_0x1478ee)[_0x9437('0x27')](function(_0x345724){_0x5aded0[_0x9437('0x20')]=_0x345724;if(_0x1e281f[_0x9437('0x32')][_0x9437('0x42')]){_0x4b3192[_0x9437('0x43')]=[{'all':!![]}];}return db[_0x9437('0x2e')]['findAll'](_0x4b3192);})['then'](function(_0x211707){_0x5aded0[_0x9437('0x44')]=_0x211707;return _0x5aded0;})[_0x9437('0x27')](respondWithFilteredResult(_0x151355,_0x4b3192))[_0x9437('0x45')](handleError(_0x151355,null));};exports['show']=function(_0x47ecea,_0x592825){var _0x2b6d33={'raw':!![],'where':{'id':_0x47ecea[_0x9437('0x46')]['id']}},_0xd3d7ef={};_0xd3d7ef[_0x9437('0x35')]=_[_0x9437('0x31')](db[_0x9437('0x2e')][_0x9437('0x47')]);_0xd3d7ef['query']=_[_0x9437('0x31')](_0x47ecea['query']);_0xd3d7ef[_0x9437('0x33')]=_['intersection'](_0xd3d7ef[_0x9437('0x35')],_0xd3d7ef[_0x9437('0x32')]);_0x2b6d33[_0x9437('0x36')]=_['intersection'](_0xd3d7ef[_0x9437('0x35')],qs[_0x9437('0x37')](_0x47ecea['query'][_0x9437('0x37')]));_0x2b6d33[_0x9437('0x36')]=_0x2b6d33[_0x9437('0x36')][_0x9437('0x38')]?_0x2b6d33['attributes']:_0xd3d7ef['model'];if(_0x47ecea[_0x9437('0x32')][_0x9437('0x42')]){_0x2b6d33[_0x9437('0x43')]=[{'all':!![]}];}_0x2b6d33=_[_0x9437('0x3f')]({},_0x2b6d33,_0x47ecea[_0x9437('0x41')]);return db['CmHopperBlack'][_0x9437('0x48')](_0x2b6d33)[_0x9437('0x27')](handleEntityNotFound(_0x592825,null))[_0x9437('0x27')](respondWithResult(_0x592825,null))[_0x9437('0x45')](handleError(_0x592825,null));};exports[_0x9437('0x26')]=function(_0xd4c2,_0x176a5a){if(_0xd4c2[_0x9437('0x49')]['id']){delete _0xd4c2[_0x9437('0x49')]['id'];}return db['CmHopperBlack'][_0x9437('0x48')]({'where':{'id':_0xd4c2[_0x9437('0x46')]['id']}})[_0x9437('0x27')](handleEntityNotFound(_0x176a5a,null))[_0x9437('0x27')](saveUpdates(_0xd4c2[_0x9437('0x49')],null))[_0x9437('0x27')](respondWithResult(_0x176a5a,null))['catch'](handleError(_0x176a5a,null));};exports[_0x9437('0x4a')]=function(_0x5e260b,_0x1246d4){return db[_0x9437('0x2e')]['find']({'where':{'id':_0x5e260b[_0x9437('0x46')]['id']}})[_0x9437('0x27')](handleEntityNotFound(_0x1246d4,null))['then'](removeEntity(_0x1246d4,null))[_0x9437('0x45')](handleError(_0x1246d4,null));};exports['describe']=function(_0x11bb47,_0x349ac8){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x349ac8,null))[_0x9437('0x45')](handleError(_0x349ac8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 7add2a0..13f9b49 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 _0x9077=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','lodash','api','moment','bluebird','request-promise','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9077,0x1e9));var _0x7907=function(_0x6e5129,_0x36050f){_0x6e5129=_0x6e5129-0x0;var _0x3b2ee2=_0x9077[_0x6e5129];return _0x3b2ee2;};'use strict';var _=require(_0x7907('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7907('0x1'));var moment=require(_0x7907('0x2'));var BPromise=require(_0x7907('0x3'));var rp=require(_0x7907('0x4'));var fs=require('fs');var path=require(_0x7907('0x5'));var rimraf=require(_0x7907('0x6'));var config=require(_0x7907('0x7'));var attributes=require(_0x7907('0x8'));module[_0x7907('0x9')]=function(_0x487904,_0x41abed){return _0x487904[_0x7907('0xa')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb848=['../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2a08a9,_0x385bf2){var _0x39a847=function(_0x46908e){while(--_0x46908e){_0x2a08a9['push'](_0x2a08a9['shift']());}};_0x39a847(++_0x385bf2);}(_0xb848,0x6d));var _0x8b84=function(_0x517fee,_0x33a791){_0x517fee=_0x517fee-0x0;var _0x581aa4=_0xb848[_0x517fee];return _0x581aa4;};'use strict';var _=require(_0x8b84('0x0'));var util=require('util');var logger=require(_0x8b84('0x1'))(_0x8b84('0x2'));var moment=require(_0x8b84('0x3'));var BPromise=require(_0x8b84('0x4'));var rp=require(_0x8b84('0x5'));var fs=require('fs');var path=require(_0x8b84('0x6'));var rimraf=require(_0x8b84('0x7'));var config=require(_0x8b84('0x8'));var attributes=require(_0x8b84('0x9'));module[_0x8b84('0xa')]=function(_0x59a8b5,_0x3ec0e4){return _0x59a8b5[_0x8b84('0xb')]('CmHopperBlack',attributes,{'tableName':_0x8b84('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 3b50046..2796f9e 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 _0xe96c=['destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','update','body','UpdateCmHopperBlack'];(function(_0x2cc21f,_0xa9eb03){var _0x2b97de=function(_0x505e18){while(--_0x505e18){_0x2cc21f['push'](_0x2cc21f['shift']());}};_0x2b97de(++_0xa9eb03);}(_0xe96c,0xcf));var _0xce96=function(_0x6378a,_0x54defb){_0x6378a=_0x6378a-0x0;var _0x2c3495=_0xe96c[_0x6378a];return _0x2c3495;};'use strict';var _=require(_0xce96('0x0'));var util=require(_0xce96('0x1'));var moment=require(_0xce96('0x2'));var BPromise=require(_0xce96('0x3'));var rs=require(_0xce96('0x4'));var fs=require('fs');var Redis=require(_0xce96('0x5'));var db=require(_0xce96('0x6'))['db'];var utils=require(_0xce96('0x7'));var logger=require(_0xce96('0x8'))('rpc');var config=require(_0xce96('0x9'));var jayson=require(_0xce96('0xa'));var client=jayson[_0xce96('0xb')][_0xce96('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x273306,_0x1b6743,_0x1cc29b){return new BPromise(function(_0x5190f8,_0x5f0982){return client[_0xce96('0xd')](_0x273306,_0x1cc29b)[_0xce96('0xe')](function(_0x127683){logger['info'](_0xce96('0xf'),_0x1b6743,_0xce96('0x10'));logger['debug'](_0xce96('0x11'),_0x1b6743,_0xce96('0x10'),JSON[_0xce96('0x12')](_0x127683));if(_0x127683['error']){if(_0x127683[_0xce96('0x13')][_0xce96('0x14')]===0x1f4){logger['error'](_0xce96('0xf'),_0x1b6743,_0x127683[_0xce96('0x13')][_0xce96('0x15')]);return _0x5f0982(_0x127683[_0xce96('0x13')][_0xce96('0x15')]);}logger[_0xce96('0x13')](_0xce96('0xf'),_0x1b6743,_0x127683['error'][_0xce96('0x15')]);return _0x5190f8(_0x127683[_0xce96('0x13')]['message']);}else{logger[_0xce96('0x16')](_0xce96('0xf'),_0x1b6743,_0xce96('0x10'));_0x5190f8(_0x127683['result'][_0xce96('0x15')]);}})['catch'](function(_0x10f40d){logger[_0xce96('0x13')](_0xce96('0xf'),_0x1b6743,_0x10f40d);_0x5f0982(_0x10f40d);});});}exports[_0xce96('0x17')]=function(_0xa21625){var _0x224d8b=this;return new Promise(function(_0x18f098,_0x4948ef){return db[_0xce96('0x18')][_0xce96('0x19')]({'raw':_0xa21625[_0xce96('0x1a')]?_0xa21625[_0xce96('0x1a')][_0xce96('0x1b')]===undefined?!![]:![]:!![],'where':_0xa21625[_0xce96('0x1a')]?_0xa21625[_0xce96('0x1a')][_0xce96('0x1c')]||null:null,'attributes':_0xa21625[_0xce96('0x1a')]?_0xa21625[_0xce96('0x1a')][_0xce96('0x1d')]||null:null,'limit':_0xa21625['options']?_0xa21625[_0xce96('0x1a')][_0xce96('0x1e')]||null:null,'include':_0xa21625[_0xce96('0x1a')]?_0xa21625[_0xce96('0x1a')][_0xce96('0x1f')]?_['map'](_0xa21625['options']['include'],function(_0x1a453a){return{'model':db[_0x1a453a[_0xce96('0x20')]],'as':_0x1a453a['as'],'attributes':_0x1a453a[_0xce96('0x1d')],'include':_0x1a453a[_0xce96('0x1f')]?_[_0xce96('0x21')](_0x1a453a['include'],function(_0x30ee24){return{'model':db[_0x30ee24[_0xce96('0x20')]],'as':_0x30ee24['as'],'attributes':_0x30ee24['attributes'],'include':_0x30ee24['include']?_[_0xce96('0x21')](_0x30ee24[_0xce96('0x1f')],function(_0x4ed820){return{'model':db[_0x4ed820[_0xce96('0x20')]],'as':_0x4ed820['as'],'attributes':_0x4ed820[_0xce96('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xce96('0xe')](function(_0x19b35d){logger[_0xce96('0x16')](_0xce96('0x17'),_0xa21625);logger[_0xce96('0x22')]('GetCmHopperBlack',_0xa21625,JSON['stringify'](_0x19b35d));_0x18f098(_0x19b35d);})[_0xce96('0x23')](function(_0x5a6418){logger[_0xce96('0x13')](_0xce96('0x17'),_0x5a6418[_0xce96('0x15')],_0xa21625);_0x4948ef(_0x224d8b['error'](0x1f4,_0x5a6418['message']));});});};exports['UpdateCmHopperBlack']=function(_0x3ce2ca){var _0x5c10aa=this;return new Promise(function(_0x1e0c22,_0x2c4072){return db[_0xce96('0x18')][_0xce96('0x24')](_0x3ce2ca[_0xce96('0x25')],{'raw':_0x3ce2ca[_0xce96('0x1a')]?_0x3ce2ca['options'][_0xce96('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce2ca[_0xce96('0x1a')]?_0x3ce2ca[_0xce96('0x1a')][_0xce96('0x1c')]||null:null,'attributes':_0x3ce2ca['options']?_0x3ce2ca[_0xce96('0x1a')][_0xce96('0x1d')]||null:null,'limit':_0x3ce2ca['options']?_0x3ce2ca[_0xce96('0x1a')][_0xce96('0x1e')]||null:null})[_0xce96('0xe')](function(_0x2d0b5d){logger[_0xce96('0x16')](_0xce96('0x26'),_0x3ce2ca);logger[_0xce96('0x22')](_0xce96('0x26'),_0x3ce2ca,JSON[_0xce96('0x12')](_0x2d0b5d));_0x1e0c22(_0x2d0b5d);})['catch'](function(_0x317244){logger[_0xce96('0x13')](_0xce96('0x26'),_0x317244[_0xce96('0x15')],_0x3ce2ca);_0x2c4072(_0x5c10aa[_0xce96('0x13')](0x1f4,_0x317244[_0xce96('0x15')]));});});};exports['DestroyCmHopperBlack']=function(_0x1a2d06){var _0x371741=this;return new Promise(function(_0x281516,_0x348269){return db[_0xce96('0x18')][_0xce96('0x27')]({'where':_0x1a2d06['options']?_0x1a2d06['options'][_0xce96('0x1c')]||null:null})[_0xce96('0xe')](function(_0x336482){logger['info'](_0xce96('0x28'),_0x1a2d06);logger[_0xce96('0x22')]('DestroyCmHopperBlack',_0x1a2d06,JSON['stringify'](_0x336482));_0x281516(_0x336482);})[_0xce96('0x23')](function(_0x4bc4c3){logger[_0xce96('0x13')](_0xce96('0x28'),_0x4bc4c3['message'],_0x1a2d06);_0x348269(_0x371741[_0xce96('0x13')](0x1f4,_0x4bc4c3[_0xce96('0x15')]));});});}; \ No newline at end of file +var _0x4938=['result','catch','CmHopperBlack','options','raw','where','limit','model','attributes','map','include','GetCmHopperBlack','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message'];(function(_0x12ac2e,_0x57afe9){var _0x5b21b9=function(_0x1f655e){while(--_0x1f655e){_0x12ac2e['push'](_0x12ac2e['shift']());}};_0x5b21b9(++_0x57afe9);}(_0x4938,0x83));var _0x8493=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x4938[_0x77773a];return _0x1091a2;};'use strict';var _=require('lodash');var util=require(_0x8493('0x0'));var moment=require(_0x8493('0x1'));var BPromise=require(_0x8493('0x2'));var rs=require(_0x8493('0x3'));var fs=require('fs');var Redis=require(_0x8493('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8493('0x5'))(_0x8493('0x6'));var config=require(_0x8493('0x7'));var jayson=require(_0x8493('0x8'));var client=jayson[_0x8493('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5902dc,_0x4667e7,_0x20b074){return new BPromise(function(_0x3d9e7e,_0x123d98){return client[_0x8493('0xa')](_0x5902dc,_0x20b074)[_0x8493('0xb')](function(_0x241f81){logger[_0x8493('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x4667e7,_0x8493('0xd'));logger[_0x8493('0xe')](_0x8493('0xf'),_0x4667e7,'request\x20sent',JSON[_0x8493('0x10')](_0x241f81));if(_0x241f81[_0x8493('0x11')]){if(_0x241f81[_0x8493('0x11')][_0x8493('0x12')]===0x1f4){logger['error'](_0x8493('0x13'),_0x4667e7,_0x241f81[_0x8493('0x11')][_0x8493('0x14')]);return _0x123d98(_0x241f81[_0x8493('0x11')]['message']);}logger[_0x8493('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4667e7,_0x241f81[_0x8493('0x11')][_0x8493('0x14')]);return _0x3d9e7e(_0x241f81['error'][_0x8493('0x14')]);}else{logger[_0x8493('0xc')](_0x8493('0x13'),_0x4667e7,_0x8493('0xd'));_0x3d9e7e(_0x241f81[_0x8493('0x15')][_0x8493('0x14')]);}})[_0x8493('0x16')](function(_0x20bb03){logger['error'](_0x8493('0x13'),_0x4667e7,_0x20bb03);_0x123d98(_0x20bb03);});});}exports['GetCmHopperBlack']=function(_0x19b4b3){var _0x322c11=this;return new Promise(function(_0xbafac6,_0x409bae){return db[_0x8493('0x17')]['findAll']({'raw':_0x19b4b3[_0x8493('0x18')]?_0x19b4b3[_0x8493('0x18')][_0x8493('0x19')]===undefined?!![]:![]:!![],'where':_0x19b4b3['options']?_0x19b4b3[_0x8493('0x18')][_0x8493('0x1a')]||null:null,'attributes':_0x19b4b3['options']?_0x19b4b3[_0x8493('0x18')]['attributes']||null:null,'limit':_0x19b4b3[_0x8493('0x18')]?_0x19b4b3['options'][_0x8493('0x1b')]||null:null,'include':_0x19b4b3[_0x8493('0x18')]?_0x19b4b3['options']['include']?_['map'](_0x19b4b3[_0x8493('0x18')]['include'],function(_0x56cd11){return{'model':db[_0x56cd11[_0x8493('0x1c')]],'as':_0x56cd11['as'],'attributes':_0x56cd11[_0x8493('0x1d')],'include':_0x56cd11['include']?_[_0x8493('0x1e')](_0x56cd11[_0x8493('0x1f')],function(_0x8a9fe2){return{'model':db[_0x8a9fe2[_0x8493('0x1c')]],'as':_0x8a9fe2['as'],'attributes':_0x8a9fe2['attributes'],'include':_0x8a9fe2[_0x8493('0x1f')]?_[_0x8493('0x1e')](_0x8a9fe2[_0x8493('0x1f')],function(_0x58fa5c){return{'model':db[_0x58fa5c['model']],'as':_0x58fa5c['as'],'attributes':_0x58fa5c[_0x8493('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16a1d7){logger[_0x8493('0xc')](_0x8493('0x20'),_0x19b4b3);logger[_0x8493('0xe')](_0x8493('0x20'),_0x19b4b3,JSON[_0x8493('0x10')](_0x16a1d7));_0xbafac6(_0x16a1d7);})[_0x8493('0x16')](function(_0x15e35c){logger['error']('GetCmHopperBlack',_0x15e35c[_0x8493('0x14')],_0x19b4b3);_0x409bae(_0x322c11[_0x8493('0x11')](0x1f4,_0x15e35c[_0x8493('0x14')]));});});};exports[_0x8493('0x21')]=function(_0x38092e){var _0x535e1b=this;return new Promise(function(_0x54ab22,_0x338390){return db[_0x8493('0x17')][_0x8493('0x22')](_0x38092e[_0x8493('0x23')],{'raw':_0x38092e[_0x8493('0x18')]?_0x38092e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38092e[_0x8493('0x18')]?_0x38092e[_0x8493('0x18')][_0x8493('0x1a')]||null:null,'attributes':_0x38092e['options']?_0x38092e[_0x8493('0x18')][_0x8493('0x1d')]||null:null,'limit':_0x38092e[_0x8493('0x18')]?_0x38092e['options']['limit']||null:null})[_0x8493('0xb')](function(_0x1e4124){logger['info']('UpdateCmHopperBlack',_0x38092e);logger[_0x8493('0xe')](_0x8493('0x21'),_0x38092e,JSON[_0x8493('0x10')](_0x1e4124));_0x54ab22(_0x1e4124);})[_0x8493('0x16')](function(_0x10c855){logger[_0x8493('0x11')](_0x8493('0x21'),_0x10c855['message'],_0x38092e);_0x338390(_0x535e1b[_0x8493('0x11')](0x1f4,_0x10c855[_0x8493('0x14')]));});});};exports[_0x8493('0x24')]=function(_0x4f03d5){var _0x3f2e50=this;return new Promise(function(_0x5931f3,_0x52ffbc){return db['CmHopperBlack'][_0x8493('0x25')]({'where':_0x4f03d5[_0x8493('0x18')]?_0x4f03d5[_0x8493('0x18')][_0x8493('0x1a')]||null:null})[_0x8493('0xb')](function(_0x19d7f4){logger[_0x8493('0xc')](_0x8493('0x24'),_0x4f03d5);logger[_0x8493('0xe')]('DestroyCmHopperBlack',_0x4f03d5,JSON[_0x8493('0x10')](_0x19d7f4));_0x5931f3(_0x19d7f4);})[_0x8493('0x16')](function(_0x16da19){logger[_0x8493('0x11')](_0x8493('0x24'),_0x16da19[_0x8493('0x14')],_0x4f03d5);_0x52ffbc(_0x3f2e50[_0x8493('0x11')](0x1f4,_0x16da19['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 0a684cb..fb75ed6 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 _0x7bd0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','destroy','exports'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0x7bd0,0x111));var _0x07bd=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x7bd0[_0x5e238b];return _0x389bea;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var fs_extra=require(_0x07bd('0x6'));var auth=require(_0x07bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x07bd('0x8'));var controller=require(_0x07bd('0x9'));router[_0x07bd('0xa')]('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0xc')]);router[_0x07bd('0xa')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0xe')]);router['get'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x10')]);router['put'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x11')]);router[_0x07bd('0x12')]('/:id',auth[_0x07bd('0xb')](),controller[_0x07bd('0x13')]);module[_0x07bd('0x14')]=router; \ No newline at end of file +var _0x5496=['../../config/environment','./cmHopperBlack.controller','index','get','isAuthenticated','describe','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x508ff2,_0x2e9db7){var _0x48d6bc=function(_0x212aa9){while(--_0x212aa9){_0x508ff2['push'](_0x508ff2['shift']());}};_0x48d6bc(++_0x2e9db7);}(_0x5496,0x175));var _0x6549=function(_0x3daa23,_0x4fb1c2){_0x3daa23=_0x3daa23-0x0;var _0x53b9d0=_0x5496[_0x3daa23];return _0x53b9d0;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var fs_extra=require(_0x6549('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var controller=require(_0x6549('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6549('0x9')]);router[_0x6549('0xa')]('/describe',auth[_0x6549('0xb')](),controller[_0x6549('0xc')]);router[_0x6549('0xa')]('/:id',auth[_0x6549('0xb')](),controller[_0x6549('0xd')]);router[_0x6549('0xe')](_0x6549('0xf'),auth[_0x6549('0xb')](),controller[_0x6549('0x10')]);router['delete']('/:id',auth[_0x6549('0xb')](),controller[_0x6549('0x11')]);module[_0x6549('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index a139176..c6bc228 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 _0x508c=['STRING','DATE','getDataValue','endtime','setDataValue','diff','dispositionat','BOOLEAN','exports','INTEGER'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x508c,0x8a));var _0xc508=function(_0x5cf8c6,_0x1c41f7){_0x5cf8c6=_0x5cf8c6-0x0;var _0x2f16bb=_0x508c[_0x5cf8c6];return _0x2f16bb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xc508('0x0')]={'state':{'type':Sequelize[_0xc508('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc508('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc508('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc508('0x2')]},'originatecalleridname':{'type':Sequelize[_0xc508('0x2')]},'calleridnum':{'type':Sequelize[_0xc508('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xc508('0x3')]},'responsetime':{'type':Sequelize[_0xc508('0x3')]},'answertime':{'type':Sequelize[_0xc508('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc508('0x2')]},'campaign':{'type':Sequelize[_0xc508('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc508('0x2')]},'reason':{'type':Sequelize[_0xc508('0x2')]},'disposition':{'type':Sequelize[_0xc508('0x2')]},'secondDisposition':{'type':Sequelize[_0xc508('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc508('0x2')]},'dispositionat':{'type':Sequelize[_0xc508('0x3')],'set':function(_0x4dffcc){var _0x12ddd2=this[_0xc508('0x4')](_0xc508('0x5'));if(_0x12ddd2&&_0x4dffcc){this[_0xc508('0x6')]('followuptime',moment(_0x4dffcc)[_0xc508('0x7')](moment(_0x12ddd2),'seconds'));}return this['setDataValue'](_0xc508('0x8'),_0x4dffcc);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc508('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc508('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc508('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc508('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc508('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc508('0x3')]},'deleted':{'type':Sequelize[_0xc508('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc508('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc508('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd6c6=['seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','endtime','setDataValue','followuptime'];(function(_0x3f4efe,_0x54b675){var _0xc77d8a=function(_0x3f6e21){while(--_0x3f6e21){_0x3f4efe['push'](_0x3f4efe['shift']());}};_0xc77d8a(++_0x54b675);}(_0xd6c6,0x70));var _0x6d6c=function(_0x84997e,_0xf41d0f){_0x84997e=_0x84997e-0x0;var _0xe00b76=_0xd6c6[_0x84997e];return _0xe00b76;};'use strict';var Sequelize=require(_0x6d6c('0x0'));var moment=require(_0x6d6c('0x1'));module['exports']={'state':{'type':Sequelize[_0x6d6c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6d6c('0x3')]},'scheduledat':{'type':Sequelize[_0x6d6c('0x4')]},'countbusyretry':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6d6c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6d6c('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6d6c('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6d6c('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6d6c('0x4')]},'ringtime':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6d6c('0x3')]},'campaign':{'type':Sequelize[_0x6d6c('0x3')]},'campaigntype':{'type':Sequelize[_0x6d6c('0x3')]},'membername':{'type':Sequelize[_0x6d6c('0x3')]},'reason':{'type':Sequelize[_0x6d6c('0x3')]},'disposition':{'type':Sequelize[_0x6d6c('0x3')]},'secondDisposition':{'type':Sequelize[_0x6d6c('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6d6c('0x4')],'set':function(_0xe787b7){var _0x34d881=this['getDataValue'](_0x6d6c('0x5'));if(_0x34d881&&_0xe787b7){this[_0x6d6c('0x6')](_0x6d6c('0x7'),moment(_0xe787b7)['diff'](moment(_0x34d881),_0x6d6c('0x8')));}return this[_0x6d6c('0x6')]('dispositionat',_0xe787b7);}},'amd':{'type':Sequelize[_0x6d6c('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6d6c('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6d6c('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6d6c('0x4')]},'callback':{'type':Sequelize[_0x6d6c('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6d6c('0x4')]},'deleted':{'type':Sequelize[_0x6d6c('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6d6c('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6d6c('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6d6c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6d6c('0x2')],'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 fc89736..e37b7f7 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 _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x4d9f0a,_0x1ff504){var _0x36ac94=function(_0x1e8d8e){while(--_0x1e8d8e){_0x4d9f0a['push'](_0x4d9f0a['shift']());}};_0x36ac94(++_0x1ff504);}(_0xc2c7,0x134));var _0x7c2c=function(_0x294b58,_0x15d508){_0x294b58=_0x294b58-0x0;var _0x576fc6=_0xc2c7[_0x294b58];return _0x576fc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));}; \ No newline at end of file +var _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','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','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x55c97d,_0x228ffc){var _0x1d5112=function(_0x2ab908){while(--_0x2ab908){_0x55c97d['push'](_0x55c97d['shift']());}};_0x1d5112(++_0x228ffc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'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'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 0695c80..838594d 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 _0x3263=['exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x3263,0x11d));var _0x3326=function(_0x361422,_0xa27d1e){_0x361422=_0x361422-0x0;var _0x2daa43=_0x3263[_0x361422];return _0x2daa43;};'use strict';var _=require(_0x3326('0x0'));var util=require(_0x3326('0x1'));var logger=require('../../config/logger')(_0x3326('0x2'));var moment=require('moment');var BPromise=require(_0x3326('0x3'));var rp=require(_0x3326('0x4'));var fs=require('fs');var path=require(_0x3326('0x5'));var rimraf=require(_0x3326('0x6'));var config=require(_0x3326('0x7'));var attributes=require(_0x3326('0x8'));module[_0x3326('0x9')]=function(_0x25d8bd,_0x182b87){return _0x25d8bd[_0x3326('0xa')]('CmHopperFinal',attributes,{'tableName':_0x3326('0xb'),'paranoid':![],'indexes':[{'name':_0x3326('0xc'),'fields':[_0x3326('0xc')]},{'name':_0x3326('0xd'),'fields':[_0x3326('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc2b4=['./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x24528b,_0x3851b8){var _0x58bf0a=function(_0x3114c2){while(--_0x3114c2){_0x24528b['push'](_0x24528b['shift']());}};_0x58bf0a(++_0x3851b8);}(_0xc2b4,0x8d));var _0x4c2b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2b4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4c2b('0x0'));var util=require(_0x4c2b('0x1'));var logger=require(_0x4c2b('0x2'))(_0x4c2b('0x3'));var moment=require(_0x4c2b('0x4'));var BPromise=require(_0x4c2b('0x5'));var rp=require(_0x4c2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c2b('0x7'));var config=require(_0x4c2b('0x8'));var attributes=require(_0x4c2b('0x9'));module[_0x4c2b('0xa')]=function(_0x1a994e,_0x1a6742){return _0x1a994e[_0x4c2b('0xb')]('CmHopperFinal',attributes,{'tableName':_0x4c2b('0xc'),'paranoid':![],'indexes':[{'name':_0x4c2b('0xd'),'fields':['calleridnum']},{'name':_0x4c2b('0xe'),'fields':[_0x4c2b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 859549b..32cdd72 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x18fe44,_0xbc510d){var _0x38e74b=function(_0x26d0d9){while(--_0x26d0d9){_0x18fe44['push'](_0x18fe44['shift']());}};_0x38e74b(++_0xbc510d);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b2583,_0x2a154b){_0x2b2583=_0x2b2583-0x0;var _0x4cd668=_0xb10b[_0x2b2583];return _0x4cd668;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x33e8eb,_0x37b092){var _0x29b8a2=function(_0x302678){while(--_0x302678){_0x33e8eb['push'](_0x33e8eb['shift']());}};_0x29b8a2(++_0x37b092);}(_0xb10b,0x12a));var _0xbb10=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0xb10b[_0xd4636c];return _0x5ee17d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 86b57d4..2da755b 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 _0xe883=['countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x552386,_0x258ced){var _0x329fa4=function(_0x3eba0c){while(--_0x3eba0c){_0x552386['push'](_0x552386['shift']());}};_0x329fa4(++_0x258ced);}(_0xe883,0x14a));var _0x3e88=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xe883[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x3e88('0x0'));var util=require(_0x3e88('0x1'));var path=require(_0x3e88('0x2'));var timeout=require(_0x3e88('0x3'));var express=require(_0x3e88('0x4'));var router=express[_0x3e88('0x5')]();var fs_extra=require(_0x3e88('0x6'));var auth=require(_0x3e88('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3e88('0x8'));var controller=require(_0x3e88('0x9'));router['get']('/',auth[_0x3e88('0xa')](),controller['index']);router[_0x3e88('0xb')](_0x3e88('0xc'),auth[_0x3e88('0xa')](),controller[_0x3e88('0xd')]);router['get'](_0x3e88('0xe'),auth[_0x3e88('0xa')](),controller['show']);router[_0x3e88('0xb')](_0x3e88('0xf'),auth[_0x3e88('0xa')](),controller[_0x3e88('0x10')]);router[_0x3e88('0xb')](_0x3e88('0x11'),auth[_0x3e88('0xa')](),controller[_0x3e88('0x12')]);router[_0x3e88('0x13')](_0x3e88('0x14'),auth[_0x3e88('0xa')](),controller[_0x3e88('0x15')]);router[_0x3e88('0x13')](_0x3e88('0x16'),auth[_0x3e88('0xa')](),controller[_0x3e88('0x17')]);router[_0x3e88('0x13')](_0x3e88('0x18'),auth[_0x3e88('0xa')](),controller[_0x3e88('0x19')]);router[_0x3e88('0x1a')](_0x3e88('0xe'),auth[_0x3e88('0xa')](),controller[_0x3e88('0x1b')]);module[_0x3e88('0x1c')]=router; \ No newline at end of file +var _0xb724=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','multer','util','connect-timeout'];(function(_0x2c9ebd,_0x3549a5){var _0x3ccc76=function(_0x5f1af5){while(--_0x5f1af5){_0x2c9ebd['push'](_0x2c9ebd['shift']());}};_0x3ccc76(++_0x3549a5);}(_0xb724,0x19f));var _0x4b72=function(_0x1e84d5,_0x56c23c){_0x1e84d5=_0x1e84d5-0x0;var _0x295339=_0xb724[_0x1e84d5];return _0x295339;};'use strict';var multer=require(_0x4b72('0x0'));var util=require(_0x4b72('0x1'));var path=require('path');var timeout=require(_0x4b72('0x2'));var express=require('express');var router=express[_0x4b72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4b72('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4b72('0x5'));var controller=require('./cmHopperFinal.controller');router[_0x4b72('0x6')]('/',auth[_0x4b72('0x7')](),controller[_0x4b72('0x8')]);router[_0x4b72('0x6')](_0x4b72('0x9'),auth['isAuthenticated'](),controller[_0x4b72('0xa')]);router[_0x4b72('0x6')](_0x4b72('0xb'),auth[_0x4b72('0x7')](),controller[_0x4b72('0xc')]);router[_0x4b72('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x4b72('0xd')]);router['get'](_0x4b72('0xe'),auth[_0x4b72('0x7')](),controller[_0x4b72('0xf')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x4b72('0x7')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x4b72('0x10')](_0x4b72('0x11'),auth[_0x4b72('0x7')](),controller[_0x4b72('0x12')]);router[_0x4b72('0x10')](_0x4b72('0x13'),auth[_0x4b72('0x7')](),controller[_0x4b72('0x14')]);router['put'](_0x4b72('0xb'),auth[_0x4b72('0x7')](),controller[_0x4b72('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 44a376d..1a5085c 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 _0x973b=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x973b,0x1e4));var _0xb973=function(_0x389dc4,_0x2c0909){_0x389dc4=_0x389dc4-0x0;var _0x40244d=_0x973b[_0x389dc4];return _0x40244d;};'use strict';var Sequelize=require(_0xb973('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb973('0x1')]},'scheduledat':{'type':Sequelize[_0xb973('0x2')]},'countbusyretry':{'type':Sequelize[_0xb973('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb973('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb973('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xb973('0x1')]},'originatecalleridname':{'type':Sequelize[_0xb973('0x1')]},'calleridnum':{'type':Sequelize[_0xb973('0x1')]},'calleridname':{'type':Sequelize[_0xb973('0x1')]},'starttime':{'type':Sequelize[_0xb973('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb973('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb973('0x2')]},'ringtime':{'type':Sequelize[_0xb973('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb973('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb973('0x1')]},'campaign':{'type':Sequelize[_0xb973('0x1')]},'campaigntype':{'type':Sequelize[_0xb973('0x1')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xb973('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb973('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xb973('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb973('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb973('0x2')]},'recallme':{'type':Sequelize[_0xb973('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xb973('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb973('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb973('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb973('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfa04=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0xfa04,0x1a0));var _0x4fa0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xfa04[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x4fa0('0x0'));module[_0x4fa0('0x1')]={'state':{'type':Sequelize[_0x4fa0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4fa0('0x3')]},'scheduledat':{'type':Sequelize[_0x4fa0('0x4')]},'countbusyretry':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4fa0('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4fa0('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4fa0('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4fa0('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4fa0('0x4')]},'ringtime':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4fa0('0x3')]},'campaign':{'type':Sequelize[_0x4fa0('0x3')]},'campaigntype':{'type':Sequelize[_0x4fa0('0x3')]},'membername':{'type':Sequelize[_0x4fa0('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x4fa0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4fa0('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x4fa0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4fa0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4fa0('0x4')]},'recallme':{'type':Sequelize[_0x4fa0('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4fa0('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4fa0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4fa0('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 6199b6b..d1dc1ba 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 _0x09c4=['params','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','Content-Range','json','reject','update','then','name','send','index','map','CmHopperHistory','fieldName','type','keys','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','describe','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09c4,0xcd));var _0x409c=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x09c4[_0x2eb5bc];return _0x51c7b1;};'use strict';var emlformat=require(_0x409c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x409c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x409c('0x2'));var moment=require(_0x409c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x409c('0x4'));var path=require('path');var sox=require(_0x409c('0x5'));var csv=require(_0x409c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x409c('0x7'));var _=require(_0x409c('0x8'));var squel=require('squel');var crypto=require(_0x409c('0x9'));var jsforce=require(_0x409c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x409c('0xb'));var Papa=require(_0x409c('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x409c('0xd'));var as=require(_0x409c('0xe'));var hardwareService=require(_0x409c('0xf'));var logger=require(_0x409c('0x10'))(_0x409c('0x11'));var utils=require(_0x409c('0x12'));var config=require(_0x409c('0x13'));var licenseUtil=require(_0x409c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f227a,_0x3da95c){_0x3da95c=_0x3da95c||0xcc;return function(_0x2d9893){if(_0x2d9893){return _0x3f227a[_0x409c('0x15')](_0x3da95c);}return _0x3f227a[_0x409c('0x16')](_0x3da95c)[_0x409c('0x17')]();};}function respondWithResult(_0x792852,_0x2d5f14){_0x2d5f14=_0x2d5f14||0xc8;return function(_0x33c7af){if(_0x33c7af){return _0x792852[_0x409c('0x16')](_0x2d5f14)['json'](_0x33c7af);}};}function respondWithFilteredResult(_0x494761,_0x2919a6){return function(_0x2df667){if(_0x2df667){var _0x27138a=typeof _0x2919a6[_0x409c('0x18')]===_0x409c('0x19')&&typeof _0x2919a6[_0x409c('0x1a')]===_0x409c('0x19');var _0x82ff56=_0x2df667['count'];var _0x460577=_0x27138a?0x0:_0x2919a6[_0x409c('0x18')];var _0x2a4ade=_0x27138a?_0x2df667['count']:_0x2919a6[_0x409c('0x18')]+_0x2919a6[_0x409c('0x1a')];var _0xfec43;if(_0x2a4ade>=_0x82ff56){_0x2a4ade=_0x82ff56;_0xfec43=0xc8;}else{_0xfec43=0xce;}_0x494761['status'](_0xfec43);return _0x494761['set'](_0x409c('0x1b'),_0x460577+'-'+_0x2a4ade+'/'+_0x82ff56)[_0x409c('0x1c')](_0x2df667);}return null;};}function patchUpdates(_0x2652bb){return function(_0x213395){try{jsonpatch['apply'](_0x213395,_0x2652bb,!![]);}catch(_0x497b8a){return BPromise[_0x409c('0x1d')](_0x497b8a);}return _0x213395['save']();};}function saveUpdates(_0x3ccca6,_0x1d040c){return function(_0x436367){if(_0x436367){return _0x436367[_0x409c('0x1e')](_0x3ccca6)[_0x409c('0x1f')](function(_0xb90adf){return _0xb90adf;});}return null;};}function removeEntity(_0x2c0368,_0x168395){return function(_0x264863){if(_0x264863){return _0x264863['destroy']()[_0x409c('0x1f')](function(){_0x2c0368[_0x409c('0x16')](0xcc)[_0x409c('0x17')]();});}};}function handleEntityNotFound(_0x45aa6e,_0x2d5380){return function(_0x482557){if(!_0x482557){_0x45aa6e[_0x409c('0x15')](0x194);}return _0x482557;};}function handleError(_0x1ef9e8,_0x336255){_0x336255=_0x336255||0x1f4;return function(_0x420195){logger['error'](_0x420195['stack']);if(_0x420195[_0x409c('0x20')]){delete _0x420195[_0x409c('0x20')];}_0x1ef9e8[_0x409c('0x16')](_0x336255)[_0x409c('0x21')](_0x420195);};}exports[_0x409c('0x22')]=function(_0x4af03c,_0x3ab67f){var _0x1e64a6={},_0x330844={},_0x5435aa={'count':0x0,'rows':[]};var _0x43443a=_[_0x409c('0x23')](db[_0x409c('0x24')]['rawAttributes'],function(_0x330d61){return{'name':_0x330d61[_0x409c('0x25')],'type':_0x330d61[_0x409c('0x26')]['key']};});_0x330844['model']=_[_0x409c('0x23')](_0x43443a,_0x409c('0x20'));_0x330844['query']=_[_0x409c('0x27')](_0x4af03c['query']);_0x330844['filters']=_[_0x409c('0x28')](_0x330844[_0x409c('0x29')],_0x330844[_0x409c('0x2a')]);_0x1e64a6[_0x409c('0x2b')]=_[_0x409c('0x28')](_0x330844[_0x409c('0x29')],qs['fields'](_0x4af03c[_0x409c('0x2a')][_0x409c('0x2c')]));_0x1e64a6[_0x409c('0x2b')]=_0x1e64a6[_0x409c('0x2b')][_0x409c('0x2d')]?_0x1e64a6[_0x409c('0x2b')]:_0x330844[_0x409c('0x29')];if(!_0x4af03c[_0x409c('0x2a')]['hasOwnProperty'](_0x409c('0x2e'))){_0x1e64a6['limit']=qs['limit'](_0x4af03c[_0x409c('0x2a')][_0x409c('0x1a')]);_0x1e64a6['offset']=qs[_0x409c('0x18')](_0x4af03c[_0x409c('0x2a')][_0x409c('0x18')]);}_0x1e64a6[_0x409c('0x2f')]=qs[_0x409c('0x30')](_0x4af03c[_0x409c('0x2a')]['sort']);_0x1e64a6[_0x409c('0x31')]=qs[_0x409c('0x32')](_[_0x409c('0x33')](_0x4af03c[_0x409c('0x2a')],_0x330844[_0x409c('0x32')]),_0x43443a);if(_0x4af03c[_0x409c('0x2a')][_0x409c('0x34')]){_0x1e64a6[_0x409c('0x31')]=_['merge'](_0x1e64a6[_0x409c('0x31')],{'$or':_[_0x409c('0x23')](_0x43443a,function(_0x4bf56d){if(_0x4bf56d[_0x409c('0x26')]!==_0x409c('0x35')){var _0x5e23f6={};_0x5e23f6[_0x4bf56d[_0x409c('0x20')]]={'$like':'%'+_0x4af03c[_0x409c('0x2a')][_0x409c('0x34')]+'%'};return _0x5e23f6;}})});}_0x1e64a6=_['merge']({},_0x1e64a6,_0x4af03c[_0x409c('0x36')]);var _0x56244={'where':_0x1e64a6[_0x409c('0x31')]};return db[_0x409c('0x24')]['count'](_0x56244)[_0x409c('0x1f')](function(_0x4b6820){_0x5435aa['count']=_0x4b6820;if(_0x4af03c['query'][_0x409c('0x37')]){_0x1e64a6[_0x409c('0x38')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x409c('0x39')](_0x1e64a6);})[_0x409c('0x1f')](function(_0x3a2050){_0x5435aa[_0x409c('0x3a')]=_0x3a2050;return _0x5435aa;})['then'](respondWithFilteredResult(_0x3ab67f,_0x1e64a6))[_0x409c('0x3b')](handleError(_0x3ab67f,null));};exports[_0x409c('0x3c')]=function(_0x12a09c,_0x4b5b3d){var _0x53ce0f={'raw':!![],'where':{'id':_0x12a09c['params']['id']}},_0x3da8ac={};_0x3da8ac['model']=_['keys'](db[_0x409c('0x24')]['rawAttributes']);_0x3da8ac[_0x409c('0x2a')]=_[_0x409c('0x27')](_0x12a09c[_0x409c('0x2a')]);_0x3da8ac[_0x409c('0x32')]=_[_0x409c('0x28')](_0x3da8ac[_0x409c('0x29')],_0x3da8ac[_0x409c('0x2a')]);_0x53ce0f[_0x409c('0x2b')]=_['intersection'](_0x3da8ac['model'],qs[_0x409c('0x2c')](_0x12a09c[_0x409c('0x2a')][_0x409c('0x2c')]));_0x53ce0f[_0x409c('0x2b')]=_0x53ce0f['attributes'][_0x409c('0x2d')]?_0x53ce0f['attributes']:_0x3da8ac[_0x409c('0x29')];if(_0x12a09c[_0x409c('0x2a')][_0x409c('0x37')]){_0x53ce0f[_0x409c('0x38')]=[{'all':!![]}];}_0x53ce0f=_[_0x409c('0x3d')]({},_0x53ce0f,_0x12a09c[_0x409c('0x36')]);return db[_0x409c('0x24')][_0x409c('0x3e')](_0x53ce0f)['then'](handleEntityNotFound(_0x4b5b3d,null))[_0x409c('0x1f')](respondWithResult(_0x4b5b3d,null))[_0x409c('0x3b')](handleError(_0x4b5b3d,null));};exports[_0x409c('0x3f')]=function(_0x59e59e,_0x505f05){return db[_0x409c('0x24')][_0x409c('0x3f')](_0x59e59e[_0x409c('0x40')],{})[_0x409c('0x1f')](respondWithResult(_0x505f05,0xc9))[_0x409c('0x3b')](handleError(_0x505f05,null));};exports[_0x409c('0x41')]=function(_0x1692d7,_0xc65d7b){return db[_0x409c('0x24')]['describe']()['then'](respondWithResult(_0xc65d7b,null))[_0x409c('0x3b')](handleError(_0xc65d7b,null));};exports[_0x409c('0x1e')]=function(_0x26aa33,_0x4ed9b1){if(_0x26aa33[_0x409c('0x40')]['uniqueid']){delete _0x26aa33[_0x409c('0x40')][_0x409c('0x42')];}return db[_0x409c('0x24')][_0x409c('0x3e')]({'where':{'uniqueid':_0x26aa33[_0x409c('0x43')]['id']}})[_0x409c('0x1f')](handleEntityNotFound(_0x4ed9b1,null))['then'](saveUpdates(_0x26aa33[_0x409c('0x40')],null))[_0x409c('0x1f')](respondWithResult(_0x4ed9b1,null))[_0x409c('0x3b')](handleError(_0x4ed9b1,null));}; \ No newline at end of file +var _0xdb74=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','status','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length'];(function(_0x203a88,_0x32521b){var _0x46e6ce=function(_0x3fa707){while(--_0x3fa707){_0x203a88['push'](_0x203a88['shift']());}};_0x46e6ce(++_0x32521b);}(_0xdb74,0x19d));var _0x4db7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdb74[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x4db7('0x0'));var rimraf=require(_0x4db7('0x1'));var zipdir=require(_0x4db7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db7('0x3'));var moment=require(_0x4db7('0x4'));var BPromise=require(_0x4db7('0x5'));var Mustache=require(_0x4db7('0x6'));var util=require(_0x4db7('0x7'));var path=require(_0x4db7('0x8'));var sox=require(_0x4db7('0x9'));var csv=require(_0x4db7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db7('0xb'));var _=require(_0x4db7('0xc'));var squel=require(_0x4db7('0xd'));var crypto=require(_0x4db7('0xe'));var jsforce=require(_0x4db7('0xf'));var deskjs=require(_0x4db7('0x10'));var toCsv=require(_0x4db7('0xa'));var querystring=require('querystring');var Papa=require(_0x4db7('0x11'));var Redis=require(_0x4db7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4db7('0x13'));var as=require(_0x4db7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4db7('0x15'));var utils=require('../../config/utils');var config=require(_0x4db7('0x16'));var licenseUtil=require(_0x4db7('0x17'));var db=require(_0x4db7('0x18'))['db'];function respondWithStatusCode(_0x2d9632,_0x35b2e2){_0x35b2e2=_0x35b2e2||0xcc;return function(_0x3020d5){if(_0x3020d5){return _0x2d9632['sendStatus'](_0x35b2e2);}return _0x2d9632['status'](_0x35b2e2)[_0x4db7('0x19')]();};}function respondWithResult(_0x2befdc,_0x9581d9){_0x9581d9=_0x9581d9||0xc8;return function(_0x48ae9e){if(_0x48ae9e){return _0x2befdc['status'](_0x9581d9)[_0x4db7('0x1a')](_0x48ae9e);}};}function respondWithFilteredResult(_0x5db665,_0x321e2a){return function(_0x211cf8){if(_0x211cf8){var _0x408696=typeof _0x321e2a[_0x4db7('0x1b')]===_0x4db7('0x1c')&&typeof _0x321e2a[_0x4db7('0x1d')]===_0x4db7('0x1c');var _0x60bfbd=_0x211cf8[_0x4db7('0x1e')];var _0x28738f=_0x408696?0x0:_0x321e2a[_0x4db7('0x1b')];var _0x4542f7=_0x408696?_0x211cf8[_0x4db7('0x1e')]:_0x321e2a[_0x4db7('0x1b')]+_0x321e2a[_0x4db7('0x1d')];var _0x1b3b33;if(_0x4542f7>=_0x60bfbd){_0x4542f7=_0x60bfbd;_0x1b3b33=0xc8;}else{_0x1b3b33=0xce;}_0x5db665['status'](_0x1b3b33);return _0x5db665[_0x4db7('0x1f')](_0x4db7('0x20'),_0x28738f+'-'+_0x4542f7+'/'+_0x60bfbd)[_0x4db7('0x1a')](_0x211cf8);}return null;};}function patchUpdates(_0x8a9e8f){return function(_0x1e70dd){try{jsonpatch['apply'](_0x1e70dd,_0x8a9e8f,!![]);}catch(_0x24c40d){return BPromise['reject'](_0x24c40d);}return _0x1e70dd[_0x4db7('0x21')]();};}function saveUpdates(_0x4a51df,_0x42d36b){return function(_0x3bdb20){if(_0x3bdb20){return _0x3bdb20[_0x4db7('0x22')](_0x4a51df)[_0x4db7('0x23')](function(_0xd8c044){return _0xd8c044;});}return null;};}function removeEntity(_0x228550,_0x552d26){return function(_0x5e7064){if(_0x5e7064){return _0x5e7064[_0x4db7('0x24')]()['then'](function(){_0x228550[_0x4db7('0x25')](0xcc)[_0x4db7('0x19')]();});}};}function handleEntityNotFound(_0x5ca6e4,_0x1df584){return function(_0x423187){if(!_0x423187){_0x5ca6e4['sendStatus'](0x194);}return _0x423187;};}function handleError(_0x686c78,_0x56fd69){_0x56fd69=_0x56fd69||0x1f4;return function(_0x30f966){logger[_0x4db7('0x26')](_0x30f966[_0x4db7('0x27')]);if(_0x30f966[_0x4db7('0x28')]){delete _0x30f966['name'];}_0x686c78[_0x4db7('0x25')](_0x56fd69)[_0x4db7('0x29')](_0x30f966);};}exports[_0x4db7('0x2a')]=function(_0x4392a4,_0x175dd0){var _0x56d8cd={},_0x300560={},_0x5ca30b={'count':0x0,'rows':[]};var _0x41e9d5=_[_0x4db7('0x2b')](db[_0x4db7('0x2c')][_0x4db7('0x2d')],function(_0x4ae21e){return{'name':_0x4ae21e[_0x4db7('0x2e')],'type':_0x4ae21e[_0x4db7('0x2f')][_0x4db7('0x30')]};});_0x300560[_0x4db7('0x31')]=_['map'](_0x41e9d5,_0x4db7('0x28'));_0x300560[_0x4db7('0x32')]=_['keys'](_0x4392a4[_0x4db7('0x32')]);_0x300560['filters']=_[_0x4db7('0x33')](_0x300560[_0x4db7('0x31')],_0x300560['query']);_0x56d8cd['attributes']=_[_0x4db7('0x33')](_0x300560[_0x4db7('0x31')],qs[_0x4db7('0x34')](_0x4392a4[_0x4db7('0x32')][_0x4db7('0x34')]));_0x56d8cd[_0x4db7('0x35')]=_0x56d8cd[_0x4db7('0x35')][_0x4db7('0x36')]?_0x56d8cd[_0x4db7('0x35')]:_0x300560[_0x4db7('0x31')];if(!_0x4392a4[_0x4db7('0x32')][_0x4db7('0x37')](_0x4db7('0x38'))){_0x56d8cd['limit']=qs[_0x4db7('0x1d')](_0x4392a4[_0x4db7('0x32')][_0x4db7('0x1d')]);_0x56d8cd[_0x4db7('0x1b')]=qs[_0x4db7('0x1b')](_0x4392a4[_0x4db7('0x32')]['offset']);}_0x56d8cd[_0x4db7('0x39')]=qs['sort'](_0x4392a4[_0x4db7('0x32')][_0x4db7('0x3a')]);_0x56d8cd[_0x4db7('0x3b')]=qs[_0x4db7('0x3c')](_[_0x4db7('0x3d')](_0x4392a4['query'],_0x300560[_0x4db7('0x3c')]),_0x41e9d5);if(_0x4392a4[_0x4db7('0x32')]['filter']){_0x56d8cd[_0x4db7('0x3b')]=_['merge'](_0x56d8cd[_0x4db7('0x3b')],{'$or':_['map'](_0x41e9d5,function(_0x3abc45){if(_0x3abc45[_0x4db7('0x2f')]!=='VIRTUAL'){var _0x525f4e={};_0x525f4e[_0x3abc45[_0x4db7('0x28')]]={'$like':'%'+_0x4392a4['query'][_0x4db7('0x3e')]+'%'};return _0x525f4e;}})});}_0x56d8cd=_['merge']({},_0x56d8cd,_0x4392a4[_0x4db7('0x3f')]);var _0x168631={'where':_0x56d8cd['where']};return db[_0x4db7('0x2c')][_0x4db7('0x1e')](_0x168631)[_0x4db7('0x23')](function(_0x5f3bd5){_0x5ca30b[_0x4db7('0x1e')]=_0x5f3bd5;if(_0x4392a4[_0x4db7('0x32')][_0x4db7('0x40')]){_0x56d8cd[_0x4db7('0x41')]=[{'all':!![]}];}return db[_0x4db7('0x2c')][_0x4db7('0x42')](_0x56d8cd);})['then'](function(_0x1da95a){_0x5ca30b[_0x4db7('0x43')]=_0x1da95a;return _0x5ca30b;})['then'](respondWithFilteredResult(_0x175dd0,_0x56d8cd))['catch'](handleError(_0x175dd0,null));};exports[_0x4db7('0x44')]=function(_0x35f215,_0x1a724e){var _0x1a6a10={'raw':!![],'where':{'id':_0x35f215[_0x4db7('0x45')]['id']}},_0x4bdcf7={};_0x4bdcf7[_0x4db7('0x31')]=_[_0x4db7('0x46')](db[_0x4db7('0x2c')][_0x4db7('0x2d')]);_0x4bdcf7[_0x4db7('0x32')]=_[_0x4db7('0x46')](_0x35f215[_0x4db7('0x32')]);_0x4bdcf7[_0x4db7('0x3c')]=_[_0x4db7('0x33')](_0x4bdcf7[_0x4db7('0x31')],_0x4bdcf7[_0x4db7('0x32')]);_0x1a6a10['attributes']=_[_0x4db7('0x33')](_0x4bdcf7['model'],qs['fields'](_0x35f215[_0x4db7('0x32')][_0x4db7('0x34')]));_0x1a6a10[_0x4db7('0x35')]=_0x1a6a10['attributes']['length']?_0x1a6a10['attributes']:_0x4bdcf7[_0x4db7('0x31')];if(_0x35f215[_0x4db7('0x32')][_0x4db7('0x40')]){_0x1a6a10[_0x4db7('0x41')]=[{'all':!![]}];}_0x1a6a10=_[_0x4db7('0x47')]({},_0x1a6a10,_0x35f215[_0x4db7('0x3f')]);return db[_0x4db7('0x2c')][_0x4db7('0x48')](_0x1a6a10)[_0x4db7('0x23')](handleEntityNotFound(_0x1a724e,null))['then'](respondWithResult(_0x1a724e,null))[_0x4db7('0x49')](handleError(_0x1a724e,null));};exports[_0x4db7('0x4a')]=function(_0x460dc6,_0x262648){return db[_0x4db7('0x2c')][_0x4db7('0x4a')](_0x460dc6[_0x4db7('0x4b')],{})[_0x4db7('0x23')](respondWithResult(_0x262648,0xc9))[_0x4db7('0x49')](handleError(_0x262648,null));};exports['describe']=function(_0x19a873,_0x2a094f){return db[_0x4db7('0x2c')][_0x4db7('0x4c')]()['then'](respondWithResult(_0x2a094f,null))['catch'](handleError(_0x2a094f,null));};exports[_0x4db7('0x22')]=function(_0x372bff,_0x247034){if(_0x372bff[_0x4db7('0x4b')][_0x4db7('0x4d')]){delete _0x372bff[_0x4db7('0x4b')]['uniqueid'];}return db[_0x4db7('0x2c')][_0x4db7('0x48')]({'where':{'uniqueid':_0x372bff[_0x4db7('0x45')]['id']}})[_0x4db7('0x23')](handleEntityNotFound(_0x247034,null))['then'](saveUpdates(_0x372bff[_0x4db7('0x4b')],null))[_0x4db7('0x23')](respondWithResult(_0x247034,null))[_0x4db7('0x49')](handleError(_0x247034,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index ea2978c..b76a848 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 _0xafcd=['rimraf','../../config/environment','./cmHopperHistory.attributes','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5dbb2,_0x1e3317){var _0x4ba922=function(_0x34fd51){while(--_0x34fd51){_0x5dbb2['push'](_0x5dbb2['shift']());}};_0x4ba922(++_0x1e3317);}(_0xafcd,0x157));var _0xdafc=function(_0x3e83f1,_0x1b09ae){_0x3e83f1=_0x3e83f1-0x0;var _0x28cd96=_0xafcd[_0x3e83f1];return _0x28cd96;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var logger=require(_0xdafc('0x2'))(_0xdafc('0x3'));var moment=require(_0xdafc('0x4'));var BPromise=require(_0xdafc('0x5'));var rp=require(_0xdafc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdafc('0x7'));var config=require(_0xdafc('0x8'));var attributes=require(_0xdafc('0x9'));module['exports']=function(_0x3b4373,_0x2aa781){return _0x3b4373[_0xdafc('0xa')]('CmHopperHistory',attributes,{'tableName':_0xdafc('0xb'),'paranoid':![],'indexes':[{'name':_0xdafc('0xc'),'fields':[_0xdafc('0xc')]},{'name':_0xdafc('0xd'),'fields':[_0xdafc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5324=['define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x2c79c2,_0x416ae3){var _0x12e732=function(_0x9dad8){while(--_0x9dad8){_0x2c79c2['push'](_0x2c79c2['shift']());}};_0x12e732(++_0x416ae3);}(_0x5324,0x154));var _0x4532=function(_0x54f13c,_0x435653){_0x54f13c=_0x54f13c-0x0;var _0x576db8=_0x5324[_0x54f13c];return _0x576db8;};'use strict';var _=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var logger=require(_0x4532('0x2'))(_0x4532('0x3'));var moment=require('moment');var BPromise=require(_0x4532('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4532('0x5'));var rimraf=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var attributes=require(_0x4532('0x8'));module[_0x4532('0x9')]=function(_0x3f68e2,_0x2672ec){return _0x3f68e2[_0x4532('0xa')]('CmHopperHistory',attributes,{'tableName':_0x4532('0xb'),'paranoid':![],'indexes':[{'name':_0x4532('0xc'),'fields':[_0x4532('0xc')]},{'name':_0x4532('0xd'),'fields':[_0x4532('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index a79e81a..ab6dcb3 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 _0xca1d=['create','body','options','raw','then','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`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','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory'];(function(_0x3864c5,_0x5bd4aa){var _0x33e5f1=function(_0x52168e){while(--_0x52168e){_0x3864c5['push'](_0x3864c5['shift']());}};_0x33e5f1(++_0x5bd4aa);}(_0xca1d,0x1e6));var _0xdca1=function(_0x84c448,_0x24265a){_0x84c448=_0x84c448-0x0;var _0x92a26=_0xca1d[_0x84c448];return _0x92a26;};'use strict';var _=require(_0xdca1('0x0'));var util=require(_0xdca1('0x1'));var moment=require(_0xdca1('0x2'));var BPromise=require(_0xdca1('0x3'));var rs=require(_0xdca1('0x4'));var fs=require('fs');var Redis=require(_0xdca1('0x5'));var db=require(_0xdca1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdca1('0x7'))(_0xdca1('0x8'));var config=require('../../config/environment');var jayson=require(_0xdca1('0x9'));var client=jayson[_0xdca1('0xa')][_0xdca1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4de495,_0x290b14,_0x124ced){return new BPromise(function(_0x43f029,_0x1837b1){return client[_0xdca1('0xc')](_0x4de495,_0x124ced)['then'](function(_0x319e07){logger[_0xdca1('0xd')](_0xdca1('0xe'),_0x290b14,_0xdca1('0xf'));logger[_0xdca1('0x10')](_0xdca1('0x11'),_0x290b14,'request\x20sent',JSON[_0xdca1('0x12')](_0x319e07));if(_0x319e07[_0xdca1('0x13')]){if(_0x319e07['error'][_0xdca1('0x14')]===0x1f4){logger[_0xdca1('0x13')](_0xdca1('0xe'),_0x290b14,_0x319e07[_0xdca1('0x13')][_0xdca1('0x15')]);return _0x1837b1(_0x319e07[_0xdca1('0x13')]['message']);}logger[_0xdca1('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x290b14,_0x319e07[_0xdca1('0x13')][_0xdca1('0x15')]);return _0x43f029(_0x319e07[_0xdca1('0x13')][_0xdca1('0x15')]);}else{logger[_0xdca1('0xd')](_0xdca1('0xe'),_0x290b14,_0xdca1('0xf'));_0x43f029(_0x319e07['result']['message']);}})[_0xdca1('0x16')](function(_0x2f1a03){logger[_0xdca1('0x13')](_0xdca1('0xe'),_0x290b14,_0x2f1a03);_0x1837b1(_0x2f1a03);});});}exports[_0xdca1('0x17')]=function(_0x1fad53){var _0x29bcfe=this;return new Promise(function(_0x39aded,_0x3baf6a){return db[_0xdca1('0x18')][_0xdca1('0x19')](_0x1fad53[_0xdca1('0x1a')],{'raw':_0x1fad53[_0xdca1('0x1b')]?_0x1fad53[_0xdca1('0x1b')][_0xdca1('0x1c')]===undefined?!![]:![]:!![]})[_0xdca1('0x1d')](function(_0xe84014){logger['info'](_0xdca1('0x17'),_0x1fad53);logger[_0xdca1('0x10')](_0xdca1('0x17'),_0x1fad53,JSON[_0xdca1('0x12')](_0xe84014));_0x39aded(_0xe84014);})[_0xdca1('0x16')](function(_0x2f1d49){logger[_0xdca1('0x13')](_0xdca1('0x17'),_0x2f1d49['message'],_0x1fad53);_0x3baf6a(_0x29bcfe[_0xdca1('0x13')](0x1f4,_0x2f1d49[_0xdca1('0x15')]));});});};exports['AvgHandleTime']=function(_0xd34c45){var _0x348d72=this;return new Promise(function(_0x186c71,_0x89cba8){return db[_0xdca1('0x18')][_0xdca1('0x1e')]({'raw':_0xd34c45[_0xdca1('0x1b')]?_0xd34c45[_0xdca1('0x1b')][_0xdca1('0x1c')]===undefined?!![]:![]:!![],'where':_0xd34c45[_0xdca1('0x1b')]?_0xd34c45['options'][_0xdca1('0x1f')]||null:null,'attributes':[[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db['sequelize'][_0xdca1('0x22')]('id')),_0xdca1('0x23')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db['sequelize']['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x25')))),_0xdca1('0x26')],[db[_0xdca1('0x20')]['fn']('COUNT',db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x27')))),_0xdca1('0x28')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db['sequelize'][_0xdca1('0x24')]('`state`\x20=\x2011,\x201,\x20null'))),_0xdca1('0x29')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x2a'),db['sequelize']['fn']('IF',db['sequelize'][_0xdca1('0x24')](_0xdca1('0x2b')))),'predictiveIntervalAvgHoldtime'],[db[_0xdca1('0x20')]['fn']('AVG',db[_0xdca1('0x20')]['fn']('IF',db['sequelize']['literal'](_0xdca1('0x2c')))),_0xdca1('0x2d')]]})[_0xdca1('0x1d')](function(_0x4e59fc){logger[_0xdca1('0xd')](_0xdca1('0x2e'),_0xd34c45);logger['debug'](_0xdca1('0x2e'),_0xd34c45,JSON[_0xdca1('0x12')](_0x4e59fc));_0x186c71(_0x4e59fc);})[_0xdca1('0x16')](function(_0xe0304d){logger['error'](_0xdca1('0x2e'),_0xe0304d[_0xdca1('0x15')],_0xd34c45);_0x89cba8(_0x348d72['error'](0x1f4,_0xe0304d[_0xdca1('0x15')]));});});};exports[_0xdca1('0x2f')]=function(_0x4f04a3){var _0x81c404=this;return new Promise(function(_0x5e1a82,_0x39e459){return db[_0xdca1('0x18')][_0xdca1('0x1e')]({'raw':_0x4f04a3[_0xdca1('0x1b')]?_0x4f04a3[_0xdca1('0x1b')][_0xdca1('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f04a3[_0xdca1('0x1b')]?_0x4f04a3[_0xdca1('0x1b')][_0xdca1('0x1f')]||null:null,'attributes':[['campaign',_0xdca1('0x30')],[db['sequelize']['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db['sequelize']['literal'](_0xdca1('0x31')))),_0xdca1('0x32')],[db['sequelize']['fn']('COUNT',db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x33')))),_0xdca1('0x34')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x25')))),'outboundAnswerCallsDay'],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x35')))),'outboundBusyCallsDay'],[db[_0xdca1('0x20')]['fn']('COUNT',db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')]['literal'](_0xdca1('0x36')))),_0xdca1('0x37')],[db[_0xdca1('0x20')]['fn']('COUNT',db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x38')))),_0xdca1('0x39')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x3a')))),_0xdca1('0x3b')],[db[_0xdca1('0x20')]['fn']('COUNT',db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x3c')))),'outboundUnknownCallsDay'],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db['sequelize']['literal'](_0xdca1('0x3d')))),_0xdca1('0x3e')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x3f')))),_0xdca1('0x40')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db['sequelize']['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x41')))),'outboundRejectCallsDay'],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x42')))),_0xdca1('0x43')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xdca1('0x44')]],'group':[_0xdca1('0x45')]})['then'](function(_0x57778e){logger[_0xdca1('0xd')](_0xdca1('0x2f'),_0x4f04a3);logger['debug'](_0xdca1('0x2f'),_0x4f04a3,JSON[_0xdca1('0x12')](_0x57778e));_0x5e1a82(_0x57778e);})['catch'](function(_0x31d671){logger['error'](_0xdca1('0x2f'),_0x31d671[_0xdca1('0x15')],_0x4f04a3);_0x39e459(_0x81c404[_0xdca1('0x13')](0x1f4,_0x31d671[_0xdca1('0x15')]));});});};exports[_0xdca1('0x46')]=function(_0x1eeff0){var _0x304055=this;return new Promise(function(_0x489ee3,_0x4fd9d2){return db[_0xdca1('0x18')][_0xdca1('0x1e')]({'raw':_0x1eeff0['options']?_0x1eeff0[_0xdca1('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1eeff0[_0xdca1('0x1b')]?_0x1eeff0['options'][_0xdca1('0x1f')]||null:null,'attributes':[[_0xdca1('0x45'),'name'],[db[_0xdca1('0x20')]['fn']('COUNT',db['sequelize']['col']('id')),_0xdca1('0x47')],[db[_0xdca1('0x20')]['fn'](_0xdca1('0x21'),db[_0xdca1('0x20')]['fn']('IF',db[_0xdca1('0x20')][_0xdca1('0x24')](_0xdca1('0x25')))),_0xdca1('0x48')]],'group':['campaign']})[_0xdca1('0x1d')](function(_0x3d3c31){logger[_0xdca1('0xd')]('GetCampaignHopperHistory',_0x1eeff0);logger[_0xdca1('0x10')](_0xdca1('0x46'),_0x1eeff0,JSON[_0xdca1('0x12')](_0x3d3c31));_0x489ee3(_0x3d3c31);})[_0xdca1('0x16')](function(_0x5a7d8d){logger[_0xdca1('0x13')]('GetCampaignHopperHistory',_0x5a7d8d['message'],_0x1eeff0);_0x4fd9d2(_0x304055['error'](0x1f4,_0x5a7d8d[_0xdca1('0x15')]));});});}; \ No newline at end of file +var _0xf123=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','literal','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','bluebird'];(function(_0x4bb011,_0x8d34f6){var _0x13c133=function(_0x562d04){while(--_0x562d04){_0x4bb011['push'](_0x4bb011['shift']());}};_0x13c133(++_0x8d34f6);}(_0xf123,0x134));var _0x3f12=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xf123[_0x176329];return _0x31997c;};'use strict';var _=require('lodash');var util=require(_0x3f12('0x0'));var moment=require('moment');var BPromise=require(_0x3f12('0x1'));var rs=require(_0x3f12('0x2'));var fs=require('fs');var Redis=require(_0x3f12('0x3'));var db=require(_0x3f12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f12('0x5'))(_0x3f12('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f12('0x7'));var client=jayson[_0x3f12('0x8')][_0x3f12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x589443,_0x102c59,_0x4952b3){return new BPromise(function(_0x405186,_0x456ea3){return client[_0x3f12('0xa')](_0x589443,_0x4952b3)[_0x3f12('0xb')](function(_0xacff21){logger[_0x3f12('0xc')](_0x3f12('0xd'),_0x102c59,_0x3f12('0xe'));logger[_0x3f12('0xf')](_0x3f12('0x10'),_0x102c59,'request\x20sent',JSON[_0x3f12('0x11')](_0xacff21));if(_0xacff21[_0x3f12('0x12')]){if(_0xacff21['error'][_0x3f12('0x13')]===0x1f4){logger[_0x3f12('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x102c59,_0xacff21[_0x3f12('0x12')][_0x3f12('0x14')]);return _0x456ea3(_0xacff21['error']['message']);}logger[_0x3f12('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x102c59,_0xacff21['error'][_0x3f12('0x14')]);return _0x405186(_0xacff21[_0x3f12('0x12')]['message']);}else{logger[_0x3f12('0xc')](_0x3f12('0xd'),_0x102c59,'request\x20sent');_0x405186(_0xacff21['result'][_0x3f12('0x14')]);}})[_0x3f12('0x15')](function(_0x185f4b){logger[_0x3f12('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x102c59,_0x185f4b);_0x456ea3(_0x185f4b);});});}exports['CreateCmHopperHistory']=function(_0x313188){var _0x50d455=this;return new Promise(function(_0x361c57,_0x5eff18){return db[_0x3f12('0x16')]['create'](_0x313188[_0x3f12('0x17')],{'raw':_0x313188['options']?_0x313188[_0x3f12('0x18')][_0x3f12('0x19')]===undefined?!![]:![]:!![]})[_0x3f12('0xb')](function(_0xd9f2c3){logger[_0x3f12('0xc')](_0x3f12('0x1a'),_0x313188);logger[_0x3f12('0xf')](_0x3f12('0x1a'),_0x313188,JSON[_0x3f12('0x11')](_0xd9f2c3));_0x361c57(_0xd9f2c3);})[_0x3f12('0x15')](function(_0x1e53ae){logger[_0x3f12('0x12')](_0x3f12('0x1a'),_0x1e53ae[_0x3f12('0x14')],_0x313188);_0x5eff18(_0x50d455[_0x3f12('0x12')](0x1f4,_0x1e53ae[_0x3f12('0x14')]));});});};exports[_0x3f12('0x1b')]=function(_0xe22349){var _0x93cf07=this;return new Promise(function(_0x521935,_0x48df32){return db[_0x3f12('0x16')]['findAll']({'raw':_0xe22349['options']?_0xe22349[_0x3f12('0x18')][_0x3f12('0x19')]===undefined?!![]:![]:!![],'where':_0xe22349[_0x3f12('0x18')]?_0xe22349['options'][_0x3f12('0x1c')]||null:null,'attributes':[[db[_0x3f12('0x1d')]['fn']('COUNT',db['sequelize'][_0x3f12('0x1e')]('id')),_0x3f12('0x1f')],[db[_0x3f12('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x3f12('0x20')](_0x3f12('0x22')))),_0x3f12('0x23')],[db['sequelize']['fn'](_0x3f12('0x21'),db['sequelize']['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0x3f12('0x24')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x25'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x25'),db[_0x3f12('0x1d')]['fn']('IF',db['sequelize'][_0x3f12('0x20')](_0x3f12('0x26')))),_0x3f12('0x27')]]})[_0x3f12('0xb')](function(_0x433858){logger[_0x3f12('0xc')](_0x3f12('0x1b'),_0xe22349);logger[_0x3f12('0xf')](_0x3f12('0x1b'),_0xe22349,JSON['stringify'](_0x433858));_0x521935(_0x433858);})[_0x3f12('0x15')](function(_0x4585a4){logger[_0x3f12('0x12')]('AvgHandleTime',_0x4585a4[_0x3f12('0x14')],_0xe22349);_0x48df32(_0x93cf07[_0x3f12('0x12')](0x1f4,_0x4585a4['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x32aa54){var _0x38acdd=this;return new Promise(function(_0x1f62ba,_0x24290e){return db[_0x3f12('0x16')][_0x3f12('0x28')]({'raw':_0x32aa54[_0x3f12('0x18')]?_0x32aa54[_0x3f12('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x32aa54['options']?_0x32aa54['options'][_0x3f12('0x1c')]||null:null,'attributes':[[_0x3f12('0x29'),_0x3f12('0x2a')],[db['sequelize']['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')]['literal'](_0x3f12('0x2b')))),_0x3f12('0x2c')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x3f12('0x2d')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x3f12('0x2e')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')]['literal'](_0x3f12('0x2f')))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x208,\x201,\x20null'))),_0x3f12('0x30')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')](_0x3f12('0x31')))),'outboundDropCallsDayCallersExit'],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),_0x3f12('0x32')],[db['sequelize']['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')](_0x3f12('0x33')))),_0x3f12('0x34')],[db[_0x3f12('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x3f12('0x20')](_0x3f12('0x35')))),'outboundOriginateFailureCallsDay'],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),_0x3f12('0x36')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db['sequelize'][_0x3f12('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0x3f12('0x37')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db['sequelize']['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x3f12('0x1d')]['fn']('COUNT',db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')](_0x3f12('0x38')))),_0x3f12('0x39')]],'group':['campaign']})[_0x3f12('0xb')](function(_0xa9d915){logger[_0x3f12('0xc')]('GetVoiceQueueHopperHistory',_0x32aa54);logger[_0x3f12('0xf')]('GetVoiceQueueHopperHistory',_0x32aa54,JSON[_0x3f12('0x11')](_0xa9d915));_0x1f62ba(_0xa9d915);})[_0x3f12('0x15')](function(_0x9bdb2c){logger['error'](_0x3f12('0x3a'),_0x9bdb2c[_0x3f12('0x14')],_0x32aa54);_0x24290e(_0x38acdd['error'](0x1f4,_0x9bdb2c[_0x3f12('0x14')]));});});};exports[_0x3f12('0x3b')]=function(_0x3221d6){var _0xfa0e4d=this;return new Promise(function(_0xe18503,_0x26449e){return db[_0x3f12('0x16')][_0x3f12('0x28')]({'raw':_0x3221d6['options']?_0x3221d6['options'][_0x3f12('0x19')]===undefined?!![]:![]:!![],'where':_0x3221d6['options']?_0x3221d6[_0x3f12('0x18')][_0x3f12('0x1c')]||null:null,'attributes':[[_0x3f12('0x29'),_0x3f12('0x2a')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')][_0x3f12('0x1e')]('id')),_0x3f12('0x3c')],[db[_0x3f12('0x1d')]['fn'](_0x3f12('0x21'),db[_0x3f12('0x1d')]['fn']('IF',db[_0x3f12('0x1d')][_0x3f12('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x3f12('0x3d')]],'group':[_0x3f12('0x29')]})[_0x3f12('0xb')](function(_0x2be298){logger[_0x3f12('0xc')](_0x3f12('0x3b'),_0x3221d6);logger[_0x3f12('0xf')](_0x3f12('0x3b'),_0x3221d6,JSON['stringify'](_0x2be298));_0xe18503(_0x2be298);})[_0x3f12('0x15')](function(_0x4205db){logger[_0x3f12('0x12')](_0x3f12('0x3b'),_0x4205db[_0x3f12('0x14')],_0x3221d6);_0x26449e(_0xfa0e4d[_0x3f12('0x12')](0x1f4,_0x4205db[_0x3f12('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f16f00b..35b5c85 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 _0xcfa2=['isAuthenticated','/:id','show','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','/describe'];(function(_0x98ddb7,_0x51226c){var _0x4fbad9=function(_0x2a488a){while(--_0x2a488a){_0x98ddb7['push'](_0x98ddb7['shift']());}};_0x4fbad9(++_0x51226c);}(_0xcfa2,0x1d0));var _0x2cfa=function(_0x364d6c,_0x494b46){_0x364d6c=_0x364d6c-0x0;var _0xf2b469=_0xcfa2[_0x364d6c];return _0xf2b469;};'use strict';var multer=require('multer');var util=require(_0x2cfa('0x0'));var path=require(_0x2cfa('0x1'));var timeout=require(_0x2cfa('0x2'));var express=require(_0x2cfa('0x3'));var router=express[_0x2cfa('0x4')]();var fs_extra=require(_0x2cfa('0x5'));var auth=require(_0x2cfa('0x6'));var interaction=require(_0x2cfa('0x7'));var config=require('../../config/environment');var controller=require(_0x2cfa('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2cfa('0x9')](_0x2cfa('0xa'),auth[_0x2cfa('0xb')](),controller['describe']);router[_0x2cfa('0x9')](_0x2cfa('0xc'),auth[_0x2cfa('0xb')](),controller[_0x2cfa('0xd')]);router[_0x2cfa('0xe')]('/',auth[_0x2cfa('0xb')](),controller[_0x2cfa('0xf')]);router[_0x2cfa('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2cfa('0x11')]);module[_0x2cfa('0x12')]=router; \ No newline at end of file +var _0xba7b=['show','create','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xba7b,0x194));var _0xbba7=function(_0xd1262,_0x101ce2){_0xd1262=_0xd1262-0x0;var _0x1bb6c1=_0xba7b[_0xd1262];return _0x1bb6c1;};'use strict';var multer=require(_0xbba7('0x0'));var util=require(_0xbba7('0x1'));var path=require('path');var timeout=require(_0xbba7('0x2'));var express=require(_0xbba7('0x3'));var router=express['Router']();var fs_extra=require(_0xbba7('0x4'));var auth=require(_0xbba7('0x5'));var interaction=require(_0xbba7('0x6'));var config=require(_0xbba7('0x7'));var controller=require(_0xbba7('0x8'));router[_0xbba7('0x9')]('/',auth[_0xbba7('0xa')](),controller[_0xbba7('0xb')]);router[_0xbba7('0x9')](_0xbba7('0xc'),auth[_0xbba7('0xa')](),controller['describe']);router[_0xbba7('0x9')](_0xbba7('0xd'),auth[_0xbba7('0xa')](),controller[_0xbba7('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbba7('0xf')]);router[_0xbba7('0x10')]('/:id',auth[_0xbba7('0xa')](),controller[_0xbba7('0x11')]);module[_0xbba7('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 cd51618..4ae7529 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 _0x861a=['STRING','name','sequelize'];(function(_0x620dbe,_0x61f14e){var _0x3c66c3=function(_0x365735){while(--_0x365735){_0x620dbe['push'](_0x620dbe['shift']());}};_0x3c66c3(++_0x61f14e);}(_0x861a,0x194));var _0xa861=function(_0x3fd27c,_0x291768){_0x3fd27c=_0x3fd27c-0x0;var _0x35f210=_0x861a[_0x3fd27c];return _0x35f210;};'use strict';var Sequelize=require(_0xa861('0x0'));module['exports']={'name':{'type':Sequelize[_0xa861('0x1')],'unique':_0xa861('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa861('0x1')]},'dialPrefix':{'type':Sequelize[_0xa861('0x1')]}}; \ No newline at end of file +var _0xc978=['name','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8c97('0x0'));module[_0x8c97('0x1')]={'name':{'type':Sequelize[_0x8c97('0x2')],'unique':_0x8c97('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8c97('0x2')]},'dialPrefix':{'type':Sequelize[_0x8c97('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 65543be..82cb0a5 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 _0x40ae=['undefined','offset','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','Disposition','getDispositions','findOne','pick','filter','removeDispositions','addContacts','tags','isArray','join','ListId','push','each','CmContact','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','concat','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','cf_%s','getCustomFields','findAndCountAll','addAgents','ids','spread','emit','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./cmList.socket','sendStatus','status','end'];(function(_0x51ff7b,_0x247a38){var _0x3719d7=function(_0x2ca2e5){while(--_0x2ca2e5){_0x51ff7b['push'](_0x51ff7b['shift']());}};_0x3719d7(++_0x247a38);}(_0x40ae,0xff));var _0xe40a=function(_0x2afc50,_0x2d12f0){_0x2afc50=_0x2afc50-0x0;var _0x534415=_0x40ae[_0x2afc50];return _0x534415;};'use strict';var emlformat=require(_0xe40a('0x0'));var rimraf=require(_0xe40a('0x1'));var zipdir=require(_0xe40a('0x2'));var jsonpatch=require(_0xe40a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe40a('0x4'));var Mustache=require(_0xe40a('0x5'));var util=require(_0xe40a('0x6'));var path=require(_0xe40a('0x7'));var sox=require(_0xe40a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe40a('0x9'));var _=require(_0xe40a('0xa'));var squel=require(_0xe40a('0xb'));var crypto=require(_0xe40a('0xc'));var jsforce=require(_0xe40a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe40a('0xe'));var querystring=require('querystring');var Papa=require(_0xe40a('0xf'));var Redis=require(_0xe40a('0x10'));var authService=require(_0xe40a('0x11'));var qs=require(_0xe40a('0x12'));var as=require(_0xe40a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe40a('0x14'))(_0xe40a('0x15'));var utils=require(_0xe40a('0x16'));var config=require(_0xe40a('0x17'));var licenseUtil=require(_0xe40a('0x18'));var db=require(_0xe40a('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe40a('0x1a'),'port':0x18eb});var socket=require(_0xe40a('0x1b'))(new Redis(config[_0xe40a('0x1c')]));require(_0xe40a('0x1d'))['register'](socket);function respondWithStatusCode(_0x585042,_0x4a706d){_0x4a706d=_0x4a706d||0xcc;return function(_0x4d8567){if(_0x4d8567){return _0x585042[_0xe40a('0x1e')](_0x4a706d);}return _0x585042[_0xe40a('0x1f')](_0x4a706d)[_0xe40a('0x20')]();};}function respondWithResult(_0x1aec18,_0x558356){_0x558356=_0x558356||0xc8;return function(_0x5ce785){if(_0x5ce785){return _0x1aec18[_0xe40a('0x1f')](_0x558356)['json'](_0x5ce785);}};}function respondWithFilteredResult(_0xe8a747,_0x4eb58b){return function(_0x2458e7){if(_0x2458e7){var _0x3c601d=typeof _0x4eb58b['offset']===_0xe40a('0x21')&&typeof _0x4eb58b['limit']===_0xe40a('0x21');var _0x651d8b=_0x2458e7['count'];var _0x4f06d0=_0x3c601d?0x0:_0x4eb58b[_0xe40a('0x22')];var _0x5951df=_0x3c601d?_0x2458e7[_0xe40a('0x23')]:_0x4eb58b[_0xe40a('0x22')]+_0x4eb58b[_0xe40a('0x24')];var _0x2978fb;if(_0x5951df>=_0x651d8b){_0x5951df=_0x651d8b;_0x2978fb=0xc8;}else{_0x2978fb=0xce;}_0xe8a747[_0xe40a('0x1f')](_0x2978fb);return _0xe8a747['set'](_0xe40a('0x25'),_0x4f06d0+'-'+_0x5951df+'/'+_0x651d8b)[_0xe40a('0x26')](_0x2458e7);}return null;};}function patchUpdates(_0xb9a4a9){return function(_0x20200f){try{jsonpatch[_0xe40a('0x27')](_0x20200f,_0xb9a4a9,!![]);}catch(_0x45bb19){return BPromise[_0xe40a('0x28')](_0x45bb19);}return _0x20200f[_0xe40a('0x29')]();};}function saveUpdates(_0x3bb58c,_0x5b6914){return function(_0x5c2e86){if(_0x5c2e86){return _0x5c2e86[_0xe40a('0x2a')](_0x3bb58c)[_0xe40a('0x2b')](function(_0x503426){return _0x503426;});}return null;};}function removeEntity(_0x25b95c,_0x5bf3be){return function(_0x1cacdb){if(_0x1cacdb){return _0x1cacdb[_0xe40a('0x2c')]()[_0xe40a('0x2b')](function(){var _0x538ae8=_0x1cacdb[_0xe40a('0x2d')]({'plain':!![]});var _0x35bead=_0xe40a('0x2e');return db[_0xe40a('0x2f')]['destroy']({'where':{'type':_0x35bead,'resourceId':_0x538ae8['id']}})[_0xe40a('0x2b')](function(){return _0x1cacdb;});})['then'](function(){_0x25b95c[_0xe40a('0x1f')](0xcc)[_0xe40a('0x20')]();});}};}function handleEntityNotFound(_0x37312f,_0xd9a78){return function(_0x4b800a){if(!_0x4b800a){_0x37312f[_0xe40a('0x1e')](0x194);}return _0x4b800a;};}function handleError(_0x20399b,_0x502fad){_0x502fad=_0x502fad||0x1f4;return function(_0x4aa014){logger['error'](_0x4aa014['stack']);if(_0x4aa014[_0xe40a('0x30')]){delete _0x4aa014[_0xe40a('0x30')];}_0x20399b[_0xe40a('0x1f')](_0x502fad)[_0xe40a('0x31')](_0x4aa014);};}exports[_0xe40a('0x32')]=function(_0x20eb14,_0x4205f6){var _0x2086ef={},_0x3252a2={},_0x13a433={'count':0x0,'rows':[]};var _0x3c9bc9=_[_0xe40a('0x33')](db[_0xe40a('0x34')][_0xe40a('0x35')],function(_0x75c2fe){return{'name':_0x75c2fe[_0xe40a('0x36')],'type':_0x75c2fe[_0xe40a('0x37')][_0xe40a('0x38')]};});_0x3252a2['model']=_[_0xe40a('0x33')](_0x3c9bc9,_0xe40a('0x30'));_0x3252a2[_0xe40a('0x39')]=_['keys'](_0x20eb14[_0xe40a('0x39')]);_0x3252a2['filters']=_[_0xe40a('0x3a')](_0x3252a2['model'],_0x3252a2[_0xe40a('0x39')]);_0x2086ef['attributes']=_[_0xe40a('0x3a')](_0x3252a2[_0xe40a('0x3b')],qs[_0xe40a('0x3c')](_0x20eb14[_0xe40a('0x39')][_0xe40a('0x3c')]));_0x2086ef[_0xe40a('0x3d')]=_0x2086ef['attributes'][_0xe40a('0x3e')]?_0x2086ef[_0xe40a('0x3d')]:_0x3252a2[_0xe40a('0x3b')];if(!_0x20eb14[_0xe40a('0x39')][_0xe40a('0x3f')](_0xe40a('0x40'))){_0x2086ef[_0xe40a('0x24')]=qs[_0xe40a('0x24')](_0x20eb14[_0xe40a('0x39')][_0xe40a('0x24')]);_0x2086ef[_0xe40a('0x22')]=qs['offset'](_0x20eb14[_0xe40a('0x39')]['offset']);}_0x2086ef[_0xe40a('0x41')]=qs[_0xe40a('0x42')](_0x20eb14[_0xe40a('0x39')]['sort']);_0x2086ef[_0xe40a('0x43')]=qs[_0xe40a('0x44')](_['pick'](_0x20eb14[_0xe40a('0x39')],_0x3252a2[_0xe40a('0x44')]),_0x3c9bc9);if(_0x20eb14[_0xe40a('0x39')]['filter']){_0x2086ef['where']=_['merge'](_0x2086ef['where'],{'$or':_[_0xe40a('0x33')](_0x3c9bc9,function(_0x2c0fad){if(_0x2c0fad[_0xe40a('0x37')]!=='VIRTUAL'){var _0x306a33={};_0x306a33[_0x2c0fad[_0xe40a('0x30')]]={'$like':'%'+_0x20eb14[_0xe40a('0x39')]['filter']+'%'};return _0x306a33;}})});}_0x2086ef=_[_0xe40a('0x45')]({},_0x2086ef,_0x20eb14[_0xe40a('0x46')]);var _0x16be63={'where':_0x2086ef[_0xe40a('0x43')]};return db[_0xe40a('0x34')]['count'](_0x16be63)[_0xe40a('0x2b')](function(_0x331cc1){_0x13a433[_0xe40a('0x23')]=_0x331cc1;if(_0x20eb14['query'][_0xe40a('0x47')]){_0x2086ef[_0xe40a('0x48')]=[{'all':!![]}];}return db[_0xe40a('0x34')][_0xe40a('0x49')](_0x2086ef);})[_0xe40a('0x2b')](function(_0x43b5f4){_0x13a433[_0xe40a('0x4a')]=_0x43b5f4;return _0x13a433;})['then'](respondWithFilteredResult(_0x4205f6,_0x2086ef))['catch'](handleError(_0x4205f6,null));};exports[_0xe40a('0x4b')]=function(_0x270d36,_0x5523cf){var _0xb78faf={'raw':![],'where':{'id':_0x270d36[_0xe40a('0x4c')]['id']}},_0x268fa9={};_0x268fa9[_0xe40a('0x3b')]=_['keys'](db[_0xe40a('0x34')][_0xe40a('0x35')]);_0x268fa9[_0xe40a('0x39')]=_[_0xe40a('0x4d')](_0x270d36['query']);_0x268fa9[_0xe40a('0x44')]=_[_0xe40a('0x3a')](_0x268fa9[_0xe40a('0x3b')],_0x268fa9[_0xe40a('0x39')]);_0xb78faf[_0xe40a('0x3d')]=_[_0xe40a('0x3a')](_0x268fa9[_0xe40a('0x3b')],qs[_0xe40a('0x3c')](_0x270d36[_0xe40a('0x39')]['fields']));_0xb78faf[_0xe40a('0x3d')]=_0xb78faf['attributes'][_0xe40a('0x3e')]?_0xb78faf[_0xe40a('0x3d')]:_0x268fa9[_0xe40a('0x3b')];if(_0x270d36[_0xe40a('0x39')][_0xe40a('0x47')]){_0xb78faf['include']=[{'all':!![]}];}_0xb78faf=_[_0xe40a('0x45')]({},_0xb78faf,_0x270d36['options']);return db[_0xe40a('0x34')][_0xe40a('0x4e')](_0xb78faf)[_0xe40a('0x2b')](handleEntityNotFound(_0x5523cf,null))['then'](respondWithResult(_0x5523cf,null))[_0xe40a('0x4f')](handleError(_0x5523cf,null));};exports[_0xe40a('0x50')]=function(_0xb20653,_0x1c3b74){return db[_0xe40a('0x34')][_0xe40a('0x50')](_0xb20653['body'],{})[_0xe40a('0x2b')](function(_0x302dee){var _0x28fdc8=_0xb20653[_0xe40a('0x51')][_0xe40a('0x2d')]({'plain':!![]});if(!_0x28fdc8)throw new Error(_0xe40a('0x52'));if(_0x28fdc8['role']===_0xe40a('0x51')){var _0x1a7154=_0x302dee['get']({'plain':!![]});var _0x219b78=_0xe40a('0x2e');return db[_0xe40a('0x53')][_0xe40a('0x4e')]({'where':{'name':_0x219b78,'userProfileId':_0x28fdc8['userProfileId']},'raw':!![]})[_0xe40a('0x2b')](function(_0x394c60){if(_0x394c60&&_0x394c60['autoAssociation']===0x0){return db[_0xe40a('0x2f')][_0xe40a('0x50')]({'name':_0x1a7154[_0xe40a('0x30')],'resourceId':_0x1a7154['id'],'type':_0x394c60[_0xe40a('0x30')],'sectionId':_0x394c60['id']},{})['then'](function(){return _0x302dee;});}else{return _0x302dee;}})[_0xe40a('0x4f')](function(_0x1b6c8c){logger[_0xe40a('0x54')](_0xe40a('0x55'),_0x1b6c8c);throw _0x1b6c8c;});}return _0x302dee;})['then'](respondWithResult(_0x1c3b74,0xc9))[_0xe40a('0x4f')](handleError(_0x1c3b74,null));};exports[_0xe40a('0x2a')]=function(_0x5130bb,_0x46bf38){if(_0x5130bb[_0xe40a('0x56')]['id']){delete _0x5130bb[_0xe40a('0x56')]['id'];}return db[_0xe40a('0x34')][_0xe40a('0x4e')]({'where':{'id':_0x5130bb[_0xe40a('0x4c')]['id']}})[_0xe40a('0x2b')](handleEntityNotFound(_0x46bf38,null))[_0xe40a('0x2b')](saveUpdates(_0x5130bb['body'],null))[_0xe40a('0x2b')](respondWithResult(_0x46bf38,null))[_0xe40a('0x4f')](handleError(_0x46bf38,null));};exports[_0xe40a('0x2c')]=function(_0xafdd01,_0xea5015){return db['CmList'][_0xe40a('0x4e')]({'where':{'id':_0xafdd01[_0xe40a('0x4c')]['id']}})[_0xe40a('0x2b')](handleEntityNotFound(_0xea5015,null))[_0xe40a('0x2b')](removeEntity(_0xea5015,null))[_0xe40a('0x4f')](handleError(_0xea5015,null));};exports['describe']=function(_0x3006c2,_0xda6332){return db[_0xe40a('0x34')][_0xe40a('0x57')]()[_0xe40a('0x2b')](respondWithResult(_0xda6332,null))[_0xe40a('0x4f')](handleError(_0xda6332,null));};exports['addDisposition']=function(_0x4050e9,_0x3a7373,_0x35bcc1){if(_0x4050e9[_0xe40a('0x56')]['id']){delete _0x4050e9[_0xe40a('0x56')]['id'];}return db[_0xe40a('0x34')][_0xe40a('0x4e')]({'where':{'id':_0x4050e9[_0xe40a('0x4c')]['id']}})[_0xe40a('0x2b')](handleEntityNotFound(_0x3a7373,null))[_0xe40a('0x2b')](function(_0x2409c0){if(_0x2409c0){_0x4050e9[_0xe40a('0x56')]['ListId']=_0x2409c0['id'];return db[_0xe40a('0x58')]['create'](_0x4050e9['body']);}})[_0xe40a('0x2b')](respondWithResult(_0x3a7373,null))[_0xe40a('0x4f')](handleError(_0x3a7373,null));};exports[_0xe40a('0x59')]=function(_0x82f100,_0x25007c,_0x5bab74){var _0x175cc8={'raw':![],'where':{}};var _0x5c177b={};var _0x403864={'count':0x0,'rows':[]};return db[_0xe40a('0x34')][_0xe40a('0x5a')]({'where':{'id':_0x82f100[_0xe40a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25007c,null))['then'](function(_0x45875c){if(_0x45875c){_0x5c177b['model']=_[_0xe40a('0x4d')](db[_0xe40a('0x58')][_0xe40a('0x35')]);_0x5c177b['query']=_['keys'](_0x82f100[_0xe40a('0x39')]);_0x5c177b[_0xe40a('0x44')]=_[_0xe40a('0x3a')](_0x5c177b['model'],_0x5c177b['query']);_0x175cc8[_0xe40a('0x3d')]=_[_0xe40a('0x3a')](_0x5c177b['model'],qs['fields'](_0x82f100[_0xe40a('0x39')]['fields']));_0x175cc8[_0xe40a('0x3d')]=_0x175cc8[_0xe40a('0x3d')]['length']?_0x175cc8[_0xe40a('0x3d')]:_0x5c177b['model'];if(!_0x82f100[_0xe40a('0x39')][_0xe40a('0x3f')]('nolimit')){_0x175cc8[_0xe40a('0x24')]=qs[_0xe40a('0x24')](_0x82f100[_0xe40a('0x39')][_0xe40a('0x24')]);_0x175cc8['offset']=qs[_0xe40a('0x22')](_0x82f100[_0xe40a('0x39')][_0xe40a('0x22')]);}_0x175cc8[_0xe40a('0x41')]=qs[_0xe40a('0x42')](_0x82f100[_0xe40a('0x39')][_0xe40a('0x42')]);_0x175cc8[_0xe40a('0x43')]=qs[_0xe40a('0x44')](_[_0xe40a('0x5b')](_0x82f100[_0xe40a('0x39')],_0x5c177b[_0xe40a('0x44')]));_0x175cc8['where']['ListId']=_0x45875c['id'];if(_0x82f100[_0xe40a('0x39')][_0xe40a('0x5c')]){_0x175cc8[_0xe40a('0x43')]=_['merge'](_0x175cc8[_0xe40a('0x43')],{'$or':_[_0xe40a('0x33')](_0x175cc8[_0xe40a('0x3d')],function(_0x412894){var _0x38fbc1={};_0x38fbc1[_0x412894]={'$like':'%'+_0x82f100['query'][_0xe40a('0x5c')]+'%'};return _0x38fbc1;})});}_0x175cc8=_['merge']({},_0x175cc8,_0x82f100[_0xe40a('0x46')]);return db[_0xe40a('0x58')][_0xe40a('0x23')]({'where':_0x175cc8[_0xe40a('0x43')]})[_0xe40a('0x2b')](function(_0x3e83bb){_0x403864[_0xe40a('0x23')]=_0x3e83bb;if(_0x82f100[_0xe40a('0x39')]['includeAll']){_0x175cc8['include']=[{'all':!![]}];}return db[_0xe40a('0x58')][_0xe40a('0x49')](_0x175cc8);})[_0xe40a('0x2b')](function(_0x422f0d){_0x403864[_0xe40a('0x4a')]=_0x422f0d;return _0x403864;});}})[_0xe40a('0x2b')](respondWithFilteredResult(_0x25007c,_0x175cc8))[_0xe40a('0x4f')](handleError(_0x25007c,null));};exports[_0xe40a('0x5d')]=function(_0x46d0ef,_0xd3c41f,_0x432f07){return db[_0xe40a('0x34')]['find']({'where':{'id':_0x46d0ef[_0xe40a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd3c41f,null))[_0xe40a('0x2b')](function(_0x177db1){if(_0x177db1){return _0x177db1['removeDispositions'](_0x46d0ef[_0xe40a('0x39')]['ids']);}})['then'](respondWithStatusCode(_0xd3c41f,null))[_0xe40a('0x4f')](handleError(_0xd3c41f,null));};exports[_0xe40a('0x5e')]=function(_0xbf45bb,_0x210445,_0x771bd2){return db[_0xe40a('0x34')]['find']({'where':{'id':_0xbf45bb[_0xe40a('0x4c')]['id']}})[_0xe40a('0x2b')](handleEntityNotFound(_0x210445,null))['then'](function(_0x3b4c42){if(_0x3b4c42){var _0xba64a=[];var _0x378700={'success':[],'errors':[]};return db['CmContact']['describe']()['then'](function(_0x2dbe7a){if(_0xbf45bb[_0xe40a('0x56')][_0xe40a('0x5f')]&&_[_0xe40a('0x60')](_0xbf45bb[_0xe40a('0x56')]['tags'])){if(_0xbf45bb[_0xe40a('0x56')][_0xe40a('0x5f')][_0xe40a('0x3e')]){_0xbf45bb[_0xe40a('0x56')]['tags']=_0xbf45bb[_0xe40a('0x56')][_0xe40a('0x5f')][_0xe40a('0x61')](';')+';';}else{_0xbf45bb[_0xe40a('0x56')][_0xe40a('0x5f')]=null;}}else{_0xbf45bb[_0xe40a('0x56')]['tags']=null;}if(_0xbf45bb[_0xe40a('0x56')]&&_[_0xe40a('0x60')](_0xbf45bb[_0xe40a('0x56')])){for(var _0x335e64=0x0;_0x335e64<_0xbf45bb['body'][_0xe40a('0x3e')];_0x335e64+=0x1){_0xbf45bb['body'][_0x335e64][_0xe40a('0x62')]=_0xbf45bb[_0xe40a('0x4c')]['id'];_0xba64a[_0xe40a('0x63')](_0xbf45bb[_0xe40a('0x56')][_0x335e64]);}return BPromise[_0xe40a('0x64')](_0xba64a,function(_0xee9461){return db[_0xe40a('0x65')][_0xe40a('0x50')](_[_0xe40a('0x66')](_0xee9461,['ids','id'])||{},{'fields':_[_0xe40a('0x4d')](_0x2dbe7a),'raw':!![]})['then'](function(_0xfce4ff){_0x378700[_0xe40a('0x67')][_0xe40a('0x63')](_0xfce4ff['dataValues']);})[_0xe40a('0x4f')](function(_0x836e11){_0x378700[_0xe40a('0x68')]['push']({'data':_0xee9461,'error':_0x836e11[_0xe40a('0x69')]});});})[_0xe40a('0x2b')](function(_0x4fd83a){return _0x378700;})[_0xe40a('0x4f')](function(_0x4848b8){return _0x4848b8;});}else{_0x210445['status'](0x190)[_0xe40a('0x26')]({'message':_0xe40a('0x6a')});}});}})[_0xe40a('0x2b')](respondWithResult(_0x210445,null))[_0xe40a('0x4f')](handleError(_0x210445,null));};exports[_0xe40a('0x6b')]=function(_0x5faaab,_0x1f842d,_0x29d813){var _0x11bcc9;return db[_0xe40a('0x34')][_0xe40a('0x4e')]({'where':{'id':_0x5faaab[_0xe40a('0x4c')]['id']},'include':[{'model':db[_0xe40a('0x6c')],'as':_0xe40a('0x6d')}]})['then'](handleEntityNotFound(_0x1f842d,null))[_0xe40a('0x2b')](function(_0x4cde02){if(_0x4cde02){_0x11bcc9=_0x4cde02;return db[_0xe40a('0x65')][_0xe40a('0x35')];}})[_0xe40a('0x2b')](function(_0x560759){if(_0x560759){var _0x2e9dd1={};var _0x3401aa={};_0x3401aa[_0xe40a('0x3b')]=_['concat'](_[_0xe40a('0x4d')](_0x560759),_[_0xe40a('0x33')](_0x11bcc9['CustomFields'],function(_0x427952){return util[_0xe40a('0x6e')](_0xe40a('0x6f'),_0x427952['id']);}));_0x3401aa[_0xe40a('0x39')]=_[_0xe40a('0x4d')](_0x5faaab[_0xe40a('0x39')]);_0x3401aa[_0xe40a('0x44')]=_[_0xe40a('0x3a')](_0x3401aa['model'],_0x3401aa['query']);_0x2e9dd1['attributes']=_['intersection'](_0x3401aa[_0xe40a('0x3b')],qs[_0xe40a('0x3c')](_0x5faaab['query'][_0xe40a('0x3c')]));_0x2e9dd1['attributes']=_0x2e9dd1[_0xe40a('0x3d')]['length']?_0x2e9dd1[_0xe40a('0x3d')]:_0x3401aa[_0xe40a('0x3b')];if(!_0x5faaab[_0xe40a('0x39')][_0xe40a('0x3f')](_0xe40a('0x40'))){_0x2e9dd1[_0xe40a('0x24')]=qs[_0xe40a('0x24')](_0x5faaab['query'][_0xe40a('0x24')]);_0x2e9dd1[_0xe40a('0x22')]=qs[_0xe40a('0x22')](_0x5faaab[_0xe40a('0x39')][_0xe40a('0x22')]);}_0x2e9dd1[_0xe40a('0x41')]=qs['sort'](_0x5faaab[_0xe40a('0x39')][_0xe40a('0x42')]);_0x2e9dd1[_0xe40a('0x43')]=qs[_0xe40a('0x44')](_[_0xe40a('0x5b')](_0x5faaab['query'],_0x3401aa['filters']));_0x2e9dd1[_0xe40a('0x70')]=!![];if(_0x5faaab['query'][_0xe40a('0x5c')]){_0x2e9dd1[_0xe40a('0x43')]=_[_0xe40a('0x45')](_0x2e9dd1[_0xe40a('0x43')],{'$or':_[_0xe40a('0x33')](_0x2e9dd1['attributes'],function(_0x41ec90){var _0x155da4={};_0x155da4[_0x41ec90]={'$like':'%'+_0x5faaab[_0xe40a('0x39')][_0xe40a('0x5c')]+'%'};return _0x155da4;})});}_0x2e9dd1=_['merge']({},_0x2e9dd1,_0x5faaab[_0xe40a('0x46')]);return _0x11bcc9[_0xe40a('0x6b')](_0x2e9dd1);}})['then'](respondWithResult(_0x1f842d,null))[_0xe40a('0x4f')](handleError(_0x1f842d,null));};exports[_0xe40a('0x71')]=function(_0x20c1f8,_0x5543d8,_0x423ddd){var _0x3f3e9c;return db['CmList'][_0xe40a('0x4e')]({'where':{'id':_0x20c1f8['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xe40a('0x6d')}]})['then'](handleEntityNotFound(_0x5543d8,null))[_0xe40a('0x2b')](function(_0x3c3089){if(_0x3c3089){_0x3f3e9c=_0x3c3089;return db[_0xe40a('0x65')][_0xe40a('0x35')];}})[_0xe40a('0x2b')](function(_0x13ea16){if(_0x13ea16){var _0x412c6b={};var _0x42b043={};_0x42b043[_0xe40a('0x3b')]=_[_0xe40a('0x72')](_[_0xe40a('0x4d')](_0x13ea16),_[_0xe40a('0x33')](_0x3f3e9c[_0xe40a('0x6d')],function(_0x4e0303){return util['format']('cf_%d',_0x4e0303['id']);}));_0x42b043[_0xe40a('0x39')]=_['keys'](_0x20c1f8[_0xe40a('0x39')]);_0x42b043[_0xe40a('0x44')]=_[_0xe40a('0x3a')](_0x42b043[_0xe40a('0x3b')],_0x42b043[_0xe40a('0x39')]);_0x412c6b[_0xe40a('0x3d')]=_[_0xe40a('0x3a')](_0x42b043[_0xe40a('0x3b')],qs['fields'](_0x20c1f8[_0xe40a('0x39')][_0xe40a('0x3c')]));_0x412c6b[_0xe40a('0x3d')]=_0x412c6b['attributes'][_0xe40a('0x3e')]?_0x412c6b['attributes']:_0x42b043[_0xe40a('0x3b')];if(!_0x20c1f8['query'][_0xe40a('0x3f')]('nolimit')){_0x412c6b['limit']=qs[_0xe40a('0x24')](_0x20c1f8['query']['limit']);_0x412c6b[_0xe40a('0x22')]=qs['offset'](_0x20c1f8[_0xe40a('0x39')][_0xe40a('0x22')]);}_0x412c6b['order']=qs[_0xe40a('0x42')](_0x20c1f8[_0xe40a('0x39')][_0xe40a('0x42')]);_0x412c6b['where']=qs['filters'](_[_0xe40a('0x5b')](_0x20c1f8['query'],_0x42b043['filters']));_0x412c6b[_0xe40a('0x70')]=!![];if(_0x20c1f8[_0xe40a('0x39')][_0xe40a('0x5c')]){_0x412c6b['where']=_['merge'](_0x412c6b[_0xe40a('0x43')],{'$or':_['map'](_0x412c6b[_0xe40a('0x3d')],function(_0x5319e5){var _0x135796={};_0x135796[_0x5319e5]={'$like':'%'+_0x20c1f8[_0xe40a('0x39')][_0xe40a('0x5c')]+'%'};return _0x135796;})});}_0x412c6b=_[_0xe40a('0x45')]({},_0x412c6b,_0x20c1f8['options']);return _0x3f3e9c['getContacts'](_0x412c6b);}})[_0xe40a('0x2b')](function(_0x43117b){if(!_['isEmpty'](_0x43117b)){var _0x2523a8=toCsv(_0x43117b);var _0x57caf2=Date[_0xe40a('0x73')]();fs[_0xe40a('0x74')](util[_0xe40a('0x6e')](_0xe40a('0x75'),_0x3f3e9c['id'],_0x57caf2),_0x2523a8);_0x5543d8[_0xe40a('0x76')](_0xe40a('0x77'),_0xe40a('0x78')+util[_0xe40a('0x6e')](_0xe40a('0x79'),_0x3f3e9c['id'],_0x57caf2));_0x5543d8[_0xe40a('0x76')](_0xe40a('0x7a'),'text/csv');return _0x5543d8['download'](util[_0xe40a('0x6e')](_0xe40a('0x75'),_0x3f3e9c['id'],_0x57caf2));}else{return _0x5543d8[_0xe40a('0x1e')](0xcc);}})[_0xe40a('0x4f')](handleError(_0x5543d8,null));};exports[_0xe40a('0x7b')]=function(_0x23fca6,_0x689627,_0x169e23){var _0x1f2139;delete _0x23fca6[_0xe40a('0x56')]['id'];return db[_0xe40a('0x34')][_0xe40a('0x5a')]({'where':{'id':_0x23fca6[_0xe40a('0x4c')]['id']}})[_0xe40a('0x2b')](handleEntityNotFound(_0x689627,null))[_0xe40a('0x2b')](function(_0x44c6e3){if(_0x44c6e3){return db[_0xe40a('0x7c')][_0xe40a('0x7d')](function(_0x17f6ed){return db[_0xe40a('0x6c')]['create'](_0x23fca6[_0xe40a('0x56')],{'transaction':_0x17f6ed})[_0xe40a('0x2b')](function(_0x7631e5){_0x1f2139=_0x7631e5;return _0x44c6e3['addCustomFields'](_0x7631e5,{'transaction':_0x17f6ed});})[_0xe40a('0x2b')](function(){var _0x25eeb9={'type':db[_0xe40a('0x7e')]['TEXT'],'transaction':_0x17f6ed};switch(_0x23fca6[_0xe40a('0x56')][_0xe40a('0x37')]){case'text':_0x25eeb9[_0xe40a('0x37')]=db['Sequelize'][_0xe40a('0x7f')];break;case _0xe40a('0x80'):_0x25eeb9[_0xe40a('0x37')]=db[_0xe40a('0x7e')][_0xe40a('0x81')];break;case _0xe40a('0x82'):_0x25eeb9[_0xe40a('0x37')]=db['Sequelize'][_0xe40a('0x83')];_0x25eeb9[_0xe40a('0x84')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn']('cm_contacts',util[_0xe40a('0x6e')](_0xe40a('0x85'),_0x1f2139['id']),_0x25eeb9);})[_0xe40a('0x2b')](function(){return _0x1f2139;});});}})[_0xe40a('0x2b')](respondWithResult(_0x689627,null))[_0xe40a('0x4f')](handleError(_0x689627,null));};exports[_0xe40a('0x86')]=function(_0x1b40c1,_0x401140,_0x175e3c){var _0x3f935e={};var _0x2c8927={};var _0x3f52e9;var _0x538e27;return db['CmList'][_0xe40a('0x5a')]({'where':{'id':_0x1b40c1[_0xe40a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x401140,null))['then'](function(_0x5ee465){if(_0x5ee465){_0x3f52e9=_0x5ee465;_0x2c8927[_0xe40a('0x3b')]=_[_0xe40a('0x4d')](db[_0xe40a('0x6c')][_0xe40a('0x35')]);_0x2c8927[_0xe40a('0x39')]=_['keys'](_0x1b40c1[_0xe40a('0x39')]);_0x2c8927[_0xe40a('0x44')]=_[_0xe40a('0x3a')](_0x2c8927[_0xe40a('0x3b')],_0x2c8927[_0xe40a('0x39')]);_0x3f935e[_0xe40a('0x3d')]=_['intersection'](_0x2c8927['model'],qs[_0xe40a('0x3c')](_0x1b40c1[_0xe40a('0x39')]['fields']));_0x3f935e[_0xe40a('0x3d')]=_0x3f935e['attributes'][_0xe40a('0x3e')]?_0x3f935e[_0xe40a('0x3d')]:_0x2c8927[_0xe40a('0x3b')];_0x3f935e[_0xe40a('0x41')]=qs[_0xe40a('0x42')](_0x1b40c1[_0xe40a('0x39')]['sort']);_0x3f935e[_0xe40a('0x43')]=qs['filters'](_['pick'](_0x1b40c1[_0xe40a('0x39')],_0x2c8927['filters']));_0x3f935e[_0xe40a('0x43')]=_[_0xe40a('0x45')](_0x3f935e[_0xe40a('0x43')],{'$or':[{'ListId':_0x5ee465['id']},{'ListId':null}]});if(_0x1b40c1['query']['filter']){_0x3f935e[_0xe40a('0x43')]=_['merge'](_0x3f935e['where'],{'$or':_[_0xe40a('0x33')](_0x3f935e['attributes'],function(_0xc9cd39){var _0x39c4d8={};_0x39c4d8[_0xc9cd39]={'$like':'%'+_0x1b40c1[_0xe40a('0x39')][_0xe40a('0x5c')]+'%'};return _0x39c4d8;})});}_0x3f935e=_['merge']({},_0x3f935e,_0x1b40c1[_0xe40a('0x46')]);return db[_0xe40a('0x6c')][_0xe40a('0x87')](_0x3f935e);}})[_0xe40a('0x2b')](respondWithResult(_0x401140,null))['catch'](handleError(_0x401140,null));};exports[_0xe40a('0x88')]=function(_0x252e55,_0x41fcd8,_0x1754cf){return db[_0xe40a('0x34')][_0xe40a('0x4e')]({'where':{'id':_0x252e55[_0xe40a('0x4c')]['id']}})[_0xe40a('0x2b')](handleEntityNotFound(_0x41fcd8,null))[_0xe40a('0x2b')](function(_0x37d66d){if(_0x37d66d){return _0x37d66d[_0xe40a('0x88')](_0x252e55['body'][_0xe40a('0x89')],_['omit'](_0x252e55[_0xe40a('0x56')],['ids','id'])||{})[_0xe40a('0x8a')](function(_0x4e8c73){for(var _0x26d820=0x0;_0x26d820<_0x252e55[_0xe40a('0x56')][_0xe40a('0x89')][_0xe40a('0x3e')];_0x26d820+=0x1){socket[_0xe40a('0x8b')]('userCmList:save',{'UserId':Number(_0x252e55['body']['ids'][_0x26d820]),'CmListId':Number(_0x252e55[_0xe40a('0x4c')]['id'])});}return _0x4e8c73;});}})[_0xe40a('0x2b')](respondWithResult(_0x41fcd8,null))[_0xe40a('0x4f')](handleError(_0x41fcd8,null));};exports[_0xe40a('0x8c')]=function(_0x40ef49,_0x4fa903,_0x10b9ec){return db[_0xe40a('0x34')][_0xe40a('0x4e')]({'where':{'id':_0x40ef49[_0xe40a('0x4c')]['id']}})[_0xe40a('0x2b')](handleEntityNotFound(_0x4fa903,null))[_0xe40a('0x2b')](function(_0x2cbb38){if(_0x2cbb38){return _0x2cbb38[_0xe40a('0x8c')](_0x40ef49[_0xe40a('0x39')][_0xe40a('0x89')])[_0xe40a('0x2b')](function(){if(_['isArray'](_0x40ef49[_0xe40a('0x39')][_0xe40a('0x89')])){for(var _0x471781=0x0;_0x471781<_0x40ef49[_0xe40a('0x39')][_0xe40a('0x89')][_0xe40a('0x3e')];_0x471781+=0x1){socket['emit'](_0xe40a('0x8d'),{'UserId':Number(_0x40ef49[_0xe40a('0x39')][_0xe40a('0x89')][_0x471781]),'CmListId':Number(_0x40ef49[_0xe40a('0x4c')]['id'])});}}else{socket['emit'](_0xe40a('0x8d'),{'UserId':Number(_0x40ef49['query']['ids']),'CmListId':Number(_0x40ef49['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4fa903,null))['catch'](handleError(_0x4fa903,null));};exports['getAgents']=function(_0x172958,_0x4b7101,_0x4b68ad){var _0x354448={};var _0x4a6cb0={};var _0x576e7d;var _0x5f2a05;return db['CmList'][_0xe40a('0x5a')]({'where':{'id':_0x172958[_0xe40a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b7101,null))['then'](function(_0x57531b){if(_0x57531b){_0x576e7d=_0x57531b;_0x4a6cb0[_0xe40a('0x3b')]=_['keys'](db[_0xe40a('0x8e')][_0xe40a('0x35')]);_0x4a6cb0[_0xe40a('0x39')]=_['keys'](_0x172958[_0xe40a('0x39')]);_0x4a6cb0[_0xe40a('0x44')]=_['intersection'](_0x4a6cb0[_0xe40a('0x3b')],_0x4a6cb0[_0xe40a('0x39')]);_0x354448[_0xe40a('0x3d')]=_[_0xe40a('0x3a')](_0x4a6cb0[_0xe40a('0x3b')],qs[_0xe40a('0x3c')](_0x172958[_0xe40a('0x39')]['fields']));_0x354448[_0xe40a('0x3d')]=_0x354448['attributes'][_0xe40a('0x3e')]?_0x354448[_0xe40a('0x3d')]:_0x4a6cb0['model'];_0x354448['order']=qs[_0xe40a('0x42')](_0x172958[_0xe40a('0x39')][_0xe40a('0x42')]);_0x354448['where']=qs[_0xe40a('0x44')](_['pick'](_0x172958[_0xe40a('0x39')],_0x4a6cb0['filters']));if(_0x172958['query'][_0xe40a('0x5c')]){_0x354448['where']=_[_0xe40a('0x45')](_0x354448[_0xe40a('0x43')],{'$or':_['map'](_0x354448[_0xe40a('0x3d')],function(_0x3241e2){var _0x23cbba={};_0x23cbba[_0x3241e2]={'$like':'%'+_0x172958[_0xe40a('0x39')][_0xe40a('0x5c')]+'%'};return _0x23cbba;})});}_0x354448=_[_0xe40a('0x45')]({},_0x354448,_0x172958[_0xe40a('0x46')]);return _0x576e7d[_0xe40a('0x8f')](_0x354448);}})[_0xe40a('0x2b')](function(_0x2fd456){if(_0x2fd456){_0x5f2a05=_0x2fd456[_0xe40a('0x3e')];if(!_0x172958[_0xe40a('0x39')][_0xe40a('0x3f')]('nolimit')){_0x354448[_0xe40a('0x24')]=qs[_0xe40a('0x24')](_0x172958[_0xe40a('0x39')][_0xe40a('0x24')]);_0x354448[_0xe40a('0x22')]=qs[_0xe40a('0x22')](_0x172958['query']['offset']);}return _0x576e7d[_0xe40a('0x8f')](_0x354448);}})['then'](function(_0x1fac97){if(_0x1fac97){return _0x1fac97?{'count':_0x5f2a05,'rows':_0x1fac97}:null;}})[_0xe40a('0x2b')](respondWithResult(_0x4b7101,null))[_0xe40a('0x4f')](handleError(_0x4b7101,null));}; \ No newline at end of file +var _0xb413=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','get','UserProfileResource','name','send','index','map','CmList','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','options','include','rows','show','params','keys','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','rawAttributes','nolimit','filter','findAll','ids','CmContact','tags','join','isArray','push','each','omit','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','rimraf','request-promise','moment','bluebird','mustache'];(function(_0x9cbfa1,_0x5036b3){var _0x84e426=function(_0x514e92){while(--_0x514e92){_0x9cbfa1['push'](_0x9cbfa1['shift']());}};_0x84e426(++_0x5036b3);}(_0xb413,0x1b4));var _0x3b41=function(_0x1e2555,_0x3d2280){_0x1e2555=_0x1e2555-0x0;var _0x8d8297=_0xb413[_0x1e2555];return _0x8d8297;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3b41('0x1'));var moment=require(_0x3b41('0x2'));var BPromise=require(_0x3b41('0x3'));var Mustache=require(_0x3b41('0x4'));var util=require(_0x3b41('0x5'));var path=require('path');var sox=require(_0x3b41('0x6'));var csv=require(_0x3b41('0x7'));var ejs=require(_0x3b41('0x8'));var fs=require('fs');var fs_extra=require(_0x3b41('0x9'));var _=require(_0x3b41('0xa'));var squel=require(_0x3b41('0xb'));var crypto=require(_0x3b41('0xc'));var jsforce=require(_0x3b41('0xd'));var deskjs=require(_0x3b41('0xe'));var toCsv=require(_0x3b41('0x7'));var querystring=require(_0x3b41('0xf'));var Papa=require(_0x3b41('0x10'));var Redis=require(_0x3b41('0x11'));var authService=require(_0x3b41('0x12'));var qs=require(_0x3b41('0x13'));var as=require(_0x3b41('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b41('0x15'))(_0x3b41('0x16'));var utils=require('../../config/utils');var config=require(_0x3b41('0x17'));var licenseUtil=require(_0x3b41('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3b41('0x19')](config[_0x3b41('0x1a')],{'host':_0x3b41('0x1b'),'port':0x18eb});var socket=require(_0x3b41('0x1c'))(new Redis(config[_0x3b41('0x1a')]));require(_0x3b41('0x1d'))['register'](socket);function respondWithStatusCode(_0x26b163,_0x19d9ef){_0x19d9ef=_0x19d9ef||0xcc;return function(_0x553b52){if(_0x553b52){return _0x26b163[_0x3b41('0x1e')](_0x19d9ef);}return _0x26b163[_0x3b41('0x1f')](_0x19d9ef)[_0x3b41('0x20')]();};}function respondWithResult(_0x1dea85,_0x5eeea5){_0x5eeea5=_0x5eeea5||0xc8;return function(_0x32be7a){if(_0x32be7a){return _0x1dea85[_0x3b41('0x1f')](_0x5eeea5)[_0x3b41('0x21')](_0x32be7a);}};}function respondWithFilteredResult(_0x3b36e6,_0x4ec15a){return function(_0x489571){if(_0x489571){var _0x234359=typeof _0x4ec15a[_0x3b41('0x22')]===_0x3b41('0x23')&&typeof _0x4ec15a[_0x3b41('0x24')]==='undefined';var _0x2aa361=_0x489571[_0x3b41('0x25')];var _0x5a77ee=_0x234359?0x0:_0x4ec15a[_0x3b41('0x22')];var _0x167172=_0x234359?_0x489571['count']:_0x4ec15a[_0x3b41('0x22')]+_0x4ec15a[_0x3b41('0x24')];var _0x44886b;if(_0x167172>=_0x2aa361){_0x167172=_0x2aa361;_0x44886b=0xc8;}else{_0x44886b=0xce;}_0x3b36e6[_0x3b41('0x1f')](_0x44886b);return _0x3b36e6['set']('Content-Range',_0x5a77ee+'-'+_0x167172+'/'+_0x2aa361)[_0x3b41('0x21')](_0x489571);}return null;};}function patchUpdates(_0x49d50a){return function(_0x132f78){try{jsonpatch[_0x3b41('0x26')](_0x132f78,_0x49d50a,!![]);}catch(_0x392141){return BPromise['reject'](_0x392141);}return _0x132f78['save']();};}function saveUpdates(_0x3ef4a4,_0x588f5c){return function(_0x136239){if(_0x136239){return _0x136239[_0x3b41('0x27')](_0x3ef4a4)[_0x3b41('0x28')](function(_0x420d0f){return _0x420d0f;});}return null;};}function removeEntity(_0x24bd15,_0x3a60e0){return function(_0x1e40b6){if(_0x1e40b6){return _0x1e40b6[_0x3b41('0x29')]()[_0x3b41('0x28')](function(){var _0x4fe385=_0x1e40b6[_0x3b41('0x2a')]({'plain':!![]});var _0x47fbd2='Lists';return db[_0x3b41('0x2b')]['destroy']({'where':{'type':_0x47fbd2,'resourceId':_0x4fe385['id']}})['then'](function(){return _0x1e40b6;});})[_0x3b41('0x28')](function(){_0x24bd15[_0x3b41('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54ef51,_0xf2b1ce){return function(_0x44c541){if(!_0x44c541){_0x54ef51['sendStatus'](0x194);}return _0x44c541;};}function handleError(_0x4e09a3,_0x50459f){_0x50459f=_0x50459f||0x1f4;return function(_0x7e04fd){logger['error'](_0x7e04fd['stack']);if(_0x7e04fd[_0x3b41('0x2c')]){delete _0x7e04fd[_0x3b41('0x2c')];}_0x4e09a3[_0x3b41('0x1f')](_0x50459f)[_0x3b41('0x2d')](_0x7e04fd);};}exports[_0x3b41('0x2e')]=function(_0x2df76c,_0xd2a345){var _0x482e08={},_0x3cb795={},_0x1dbe73={'count':0x0,'rows':[]};var _0x4d9fa8=_[_0x3b41('0x2f')](db[_0x3b41('0x30')]['rawAttributes'],function(_0x21086c){return{'name':_0x21086c['fieldName'],'type':_0x21086c[_0x3b41('0x31')][_0x3b41('0x32')]};});_0x3cb795[_0x3b41('0x33')]=_[_0x3b41('0x2f')](_0x4d9fa8,'name');_0x3cb795[_0x3b41('0x34')]=_['keys'](_0x2df76c[_0x3b41('0x34')]);_0x3cb795[_0x3b41('0x35')]=_[_0x3b41('0x36')](_0x3cb795['model'],_0x3cb795[_0x3b41('0x34')]);_0x482e08[_0x3b41('0x37')]=_['intersection'](_0x3cb795['model'],qs[_0x3b41('0x38')](_0x2df76c['query'][_0x3b41('0x38')]));_0x482e08[_0x3b41('0x37')]=_0x482e08[_0x3b41('0x37')][_0x3b41('0x39')]?_0x482e08[_0x3b41('0x37')]:_0x3cb795[_0x3b41('0x33')];if(!_0x2df76c['query']['hasOwnProperty']('nolimit')){_0x482e08[_0x3b41('0x24')]=qs[_0x3b41('0x24')](_0x2df76c['query'][_0x3b41('0x24')]);_0x482e08[_0x3b41('0x22')]=qs['offset'](_0x2df76c[_0x3b41('0x34')][_0x3b41('0x22')]);}_0x482e08[_0x3b41('0x3a')]=qs[_0x3b41('0x3b')](_0x2df76c[_0x3b41('0x34')][_0x3b41('0x3b')]);_0x482e08[_0x3b41('0x3c')]=qs[_0x3b41('0x35')](_[_0x3b41('0x3d')](_0x2df76c['query'],_0x3cb795[_0x3b41('0x35')]),_0x4d9fa8);if(_0x2df76c['query']['filter']){_0x482e08[_0x3b41('0x3c')]=_[_0x3b41('0x3e')](_0x482e08[_0x3b41('0x3c')],{'$or':_[_0x3b41('0x2f')](_0x4d9fa8,function(_0x227945){if(_0x227945[_0x3b41('0x31')]!=='VIRTUAL'){var _0xd5134e={};_0xd5134e[_0x227945[_0x3b41('0x2c')]]={'$like':'%'+_0x2df76c[_0x3b41('0x34')]['filter']+'%'};return _0xd5134e;}})});}_0x482e08=_['merge']({},_0x482e08,_0x2df76c[_0x3b41('0x3f')]);var _0x33b2f={'where':_0x482e08[_0x3b41('0x3c')]};return db['CmList'][_0x3b41('0x25')](_0x33b2f)[_0x3b41('0x28')](function(_0x5b0e05){_0x1dbe73[_0x3b41('0x25')]=_0x5b0e05;if(_0x2df76c[_0x3b41('0x34')]['includeAll']){_0x482e08[_0x3b41('0x40')]=[{'all':!![]}];}return db[_0x3b41('0x30')]['findAll'](_0x482e08);})[_0x3b41('0x28')](function(_0x54d7be){_0x1dbe73[_0x3b41('0x41')]=_0x54d7be;return _0x1dbe73;})[_0x3b41('0x28')](respondWithFilteredResult(_0xd2a345,_0x482e08))['catch'](handleError(_0xd2a345,null));};exports[_0x3b41('0x42')]=function(_0xc85747,_0x5d0630){var _0x58f985={'raw':![],'where':{'id':_0xc85747[_0x3b41('0x43')]['id']}},_0x532859={};_0x532859['model']=_[_0x3b41('0x44')](db[_0x3b41('0x30')]['rawAttributes']);_0x532859['query']=_[_0x3b41('0x44')](_0xc85747[_0x3b41('0x34')]);_0x532859[_0x3b41('0x35')]=_[_0x3b41('0x36')](_0x532859[_0x3b41('0x33')],_0x532859[_0x3b41('0x34')]);_0x58f985[_0x3b41('0x37')]=_['intersection'](_0x532859['model'],qs[_0x3b41('0x38')](_0xc85747[_0x3b41('0x34')][_0x3b41('0x38')]));_0x58f985[_0x3b41('0x37')]=_0x58f985[_0x3b41('0x37')]['length']?_0x58f985['attributes']:_0x532859[_0x3b41('0x33')];if(_0xc85747[_0x3b41('0x34')][_0x3b41('0x45')]){_0x58f985[_0x3b41('0x40')]=[{'all':!![]}];}_0x58f985=_[_0x3b41('0x3e')]({},_0x58f985,_0xc85747[_0x3b41('0x3f')]);return db[_0x3b41('0x30')]['find'](_0x58f985)[_0x3b41('0x28')](handleEntityNotFound(_0x5d0630,null))['then'](respondWithResult(_0x5d0630,null))['catch'](handleError(_0x5d0630,null));};exports[_0x3b41('0x46')]=function(_0x5c3599,_0x3bfa87){return db[_0x3b41('0x30')][_0x3b41('0x46')](_0x5c3599[_0x3b41('0x47')],{})[_0x3b41('0x28')](function(_0x5c54bf){var _0x49d9d6=_0x5c3599[_0x3b41('0x48')][_0x3b41('0x2a')]({'plain':!![]});if(!_0x49d9d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49d9d6[_0x3b41('0x49')]===_0x3b41('0x48')){var _0x46ecdd=_0x5c54bf[_0x3b41('0x2a')]({'plain':!![]});var _0x583605='Lists';return db[_0x3b41('0x4a')][_0x3b41('0x4b')]({'where':{'name':_0x583605,'userProfileId':_0x49d9d6[_0x3b41('0x4c')]},'raw':!![]})['then'](function(_0x1d25dd){if(_0x1d25dd&&_0x1d25dd[_0x3b41('0x4d')]===0x0){return db['UserProfileResource'][_0x3b41('0x46')]({'name':_0x46ecdd['name'],'resourceId':_0x46ecdd['id'],'type':_0x1d25dd[_0x3b41('0x2c')],'sectionId':_0x1d25dd['id']},{})[_0x3b41('0x28')](function(){return _0x5c54bf;});}else{return _0x5c54bf;}})[_0x3b41('0x4e')](function(_0x360598){logger[_0x3b41('0x4f')](_0x3b41('0x50'),_0x360598);throw _0x360598;});}return _0x5c54bf;})[_0x3b41('0x28')](respondWithResult(_0x3bfa87,0xc9))[_0x3b41('0x4e')](handleError(_0x3bfa87,null));};exports[_0x3b41('0x27')]=function(_0x223df0,_0x2366a2){if(_0x223df0[_0x3b41('0x47')]['id']){delete _0x223df0[_0x3b41('0x47')]['id'];}return db['CmList']['find']({'where':{'id':_0x223df0[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x2366a2,null))['then'](saveUpdates(_0x223df0['body'],null))[_0x3b41('0x28')](respondWithResult(_0x2366a2,null))['catch'](handleError(_0x2366a2,null));};exports[_0x3b41('0x29')]=function(_0x1880f5,_0x4b8333){return db[_0x3b41('0x30')][_0x3b41('0x4b')]({'where':{'id':_0x1880f5[_0x3b41('0x43')]['id']}})['then'](handleEntityNotFound(_0x4b8333,null))['then'](removeEntity(_0x4b8333,null))['catch'](handleError(_0x4b8333,null));};exports[_0x3b41('0x51')]=function(_0x1105c8,_0x118cae){return db[_0x3b41('0x30')][_0x3b41('0x51')]()['then'](respondWithResult(_0x118cae,null))[_0x3b41('0x4e')](handleError(_0x118cae,null));};exports[_0x3b41('0x52')]=function(_0x59274a,_0x2d6535,_0x474fbf){if(_0x59274a[_0x3b41('0x47')]['id']){delete _0x59274a['body']['id'];}return db[_0x3b41('0x30')]['find']({'where':{'id':_0x59274a[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x2d6535,null))[_0x3b41('0x28')](function(_0x1340c2){if(_0x1340c2){_0x59274a[_0x3b41('0x47')][_0x3b41('0x53')]=_0x1340c2['id'];return db[_0x3b41('0x54')][_0x3b41('0x46')](_0x59274a[_0x3b41('0x47')]);}})[_0x3b41('0x28')](respondWithResult(_0x2d6535,null))[_0x3b41('0x4e')](handleError(_0x2d6535,null));};exports[_0x3b41('0x55')]=function(_0xa11289,_0x5bff22,_0x380fe3){var _0x120f82={'raw':![],'where':{}};var _0x5f5c1a={};var _0x3a3b57={'count':0x0,'rows':[]};return db['CmList'][_0x3b41('0x56')]({'where':{'id':_0xa11289[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x5bff22,null))[_0x3b41('0x28')](function(_0x1cdbdf){if(_0x1cdbdf){_0x5f5c1a[_0x3b41('0x33')]=_[_0x3b41('0x44')](db['Disposition'][_0x3b41('0x57')]);_0x5f5c1a['query']=_['keys'](_0xa11289[_0x3b41('0x34')]);_0x5f5c1a[_0x3b41('0x35')]=_['intersection'](_0x5f5c1a['model'],_0x5f5c1a[_0x3b41('0x34')]);_0x120f82[_0x3b41('0x37')]=_[_0x3b41('0x36')](_0x5f5c1a['model'],qs['fields'](_0xa11289[_0x3b41('0x34')][_0x3b41('0x38')]));_0x120f82[_0x3b41('0x37')]=_0x120f82[_0x3b41('0x37')]['length']?_0x120f82['attributes']:_0x5f5c1a['model'];if(!_0xa11289[_0x3b41('0x34')]['hasOwnProperty'](_0x3b41('0x58'))){_0x120f82[_0x3b41('0x24')]=qs[_0x3b41('0x24')](_0xa11289[_0x3b41('0x34')]['limit']);_0x120f82[_0x3b41('0x22')]=qs[_0x3b41('0x22')](_0xa11289['query'][_0x3b41('0x22')]);}_0x120f82[_0x3b41('0x3a')]=qs['sort'](_0xa11289['query'][_0x3b41('0x3b')]);_0x120f82[_0x3b41('0x3c')]=qs[_0x3b41('0x35')](_[_0x3b41('0x3d')](_0xa11289[_0x3b41('0x34')],_0x5f5c1a['filters']));_0x120f82['where'][_0x3b41('0x53')]=_0x1cdbdf['id'];if(_0xa11289[_0x3b41('0x34')][_0x3b41('0x59')]){_0x120f82[_0x3b41('0x3c')]=_['merge'](_0x120f82[_0x3b41('0x3c')],{'$or':_[_0x3b41('0x2f')](_0x120f82[_0x3b41('0x37')],function(_0x25c6dd){var _0x2cd115={};_0x2cd115[_0x25c6dd]={'$like':'%'+_0xa11289['query'][_0x3b41('0x59')]+'%'};return _0x2cd115;})});}_0x120f82=_[_0x3b41('0x3e')]({},_0x120f82,_0xa11289[_0x3b41('0x3f')]);return db['Disposition'][_0x3b41('0x25')]({'where':_0x120f82['where']})[_0x3b41('0x28')](function(_0x2e1092){_0x3a3b57[_0x3b41('0x25')]=_0x2e1092;if(_0xa11289[_0x3b41('0x34')][_0x3b41('0x45')]){_0x120f82[_0x3b41('0x40')]=[{'all':!![]}];}return db[_0x3b41('0x54')][_0x3b41('0x5a')](_0x120f82);})[_0x3b41('0x28')](function(_0x7d0ed1){_0x3a3b57[_0x3b41('0x41')]=_0x7d0ed1;return _0x3a3b57;});}})[_0x3b41('0x28')](respondWithFilteredResult(_0x5bff22,_0x120f82))[_0x3b41('0x4e')](handleError(_0x5bff22,null));};exports['removeDispositions']=function(_0x323fdb,_0x527592,_0x18fa94){return db[_0x3b41('0x30')][_0x3b41('0x4b')]({'where':{'id':_0x323fdb['params']['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x527592,null))[_0x3b41('0x28')](function(_0x2087a7){if(_0x2087a7){return _0x2087a7['removeDispositions'](_0x323fdb[_0x3b41('0x34')][_0x3b41('0x5b')]);}})[_0x3b41('0x28')](respondWithStatusCode(_0x527592,null))[_0x3b41('0x4e')](handleError(_0x527592,null));};exports['addContacts']=function(_0x4fedd4,_0x44318e,_0xf4216d){return db['CmList'][_0x3b41('0x4b')]({'where':{'id':_0x4fedd4[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x44318e,null))[_0x3b41('0x28')](function(_0x678b75){if(_0x678b75){var _0x59b3fe=[];var _0x30b6a4={'success':[],'errors':[]};return db[_0x3b41('0x5c')][_0x3b41('0x51')]()[_0x3b41('0x28')](function(_0x573ee7){if(_0x4fedd4[_0x3b41('0x47')][_0x3b41('0x5d')]&&_['isArray'](_0x4fedd4[_0x3b41('0x47')][_0x3b41('0x5d')])){if(_0x4fedd4[_0x3b41('0x47')][_0x3b41('0x5d')]['length']){_0x4fedd4[_0x3b41('0x47')]['tags']=_0x4fedd4[_0x3b41('0x47')][_0x3b41('0x5d')][_0x3b41('0x5e')](';')+';';}else{_0x4fedd4[_0x3b41('0x47')][_0x3b41('0x5d')]=null;}}else{_0x4fedd4[_0x3b41('0x47')][_0x3b41('0x5d')]=null;}if(_0x4fedd4[_0x3b41('0x47')]&&_[_0x3b41('0x5f')](_0x4fedd4[_0x3b41('0x47')])){for(var _0x3a06f1=0x0;_0x3a06f1<_0x4fedd4[_0x3b41('0x47')][_0x3b41('0x39')];_0x3a06f1+=0x1){_0x4fedd4[_0x3b41('0x47')][_0x3a06f1][_0x3b41('0x53')]=_0x4fedd4['params']['id'];_0x59b3fe[_0x3b41('0x60')](_0x4fedd4[_0x3b41('0x47')][_0x3a06f1]);}return BPromise[_0x3b41('0x61')](_0x59b3fe,function(_0x1da3d3){return db['CmContact'][_0x3b41('0x46')](_[_0x3b41('0x62')](_0x1da3d3,[_0x3b41('0x5b'),'id'])||{},{'fields':_['keys'](_0x573ee7),'raw':!![]})[_0x3b41('0x28')](function(_0x35dae9){_0x30b6a4['success'][_0x3b41('0x60')](_0x35dae9[_0x3b41('0x63')]);})[_0x3b41('0x4e')](function(_0x153340){_0x30b6a4['errors'][_0x3b41('0x60')]({'data':_0x1da3d3,'error':_0x153340[_0x3b41('0x64')]});});})[_0x3b41('0x28')](function(_0x791fa5){return _0x30b6a4;})[_0x3b41('0x4e')](function(_0x29696c){return _0x29696c;});}else{_0x44318e[_0x3b41('0x1f')](0x190)[_0x3b41('0x21')]({'message':_0x3b41('0x65')});}});}})[_0x3b41('0x28')](respondWithResult(_0x44318e,null))['catch'](handleError(_0x44318e,null));};exports[_0x3b41('0x66')]=function(_0x1f3076,_0x3d102f,_0x1f730f){var _0xebd435;return db[_0x3b41('0x30')][_0x3b41('0x4b')]({'where':{'id':_0x1f3076[_0x3b41('0x43')]['id']},'include':[{'model':db[_0x3b41('0x67')],'as':_0x3b41('0x68')}]})[_0x3b41('0x28')](handleEntityNotFound(_0x3d102f,null))[_0x3b41('0x28')](function(_0x4bbff3){if(_0x4bbff3){_0xebd435=_0x4bbff3;return db['CmContact']['rawAttributes'];}})['then'](function(_0x522d56){if(_0x522d56){var _0x5e0585={};var _0x4dcdec={};_0x4dcdec[_0x3b41('0x33')]=_[_0x3b41('0x69')](_[_0x3b41('0x44')](_0x522d56),_['map'](_0xebd435[_0x3b41('0x68')],function(_0x10052d){return util[_0x3b41('0x6a')](_0x3b41('0x6b'),_0x10052d['id']);}));_0x4dcdec[_0x3b41('0x34')]=_[_0x3b41('0x44')](_0x1f3076[_0x3b41('0x34')]);_0x4dcdec['filters']=_['intersection'](_0x4dcdec[_0x3b41('0x33')],_0x4dcdec[_0x3b41('0x34')]);_0x5e0585[_0x3b41('0x37')]=_[_0x3b41('0x36')](_0x4dcdec['model'],qs[_0x3b41('0x38')](_0x1f3076[_0x3b41('0x34')][_0x3b41('0x38')]));_0x5e0585[_0x3b41('0x37')]=_0x5e0585[_0x3b41('0x37')][_0x3b41('0x39')]?_0x5e0585['attributes']:_0x4dcdec[_0x3b41('0x33')];if(!_0x1f3076['query'][_0x3b41('0x6c')]('nolimit')){_0x5e0585[_0x3b41('0x24')]=qs[_0x3b41('0x24')](_0x1f3076[_0x3b41('0x34')][_0x3b41('0x24')]);_0x5e0585[_0x3b41('0x22')]=qs['offset'](_0x1f3076['query']['offset']);}_0x5e0585[_0x3b41('0x3a')]=qs[_0x3b41('0x3b')](_0x1f3076[_0x3b41('0x34')]['sort']);_0x5e0585[_0x3b41('0x3c')]=qs[_0x3b41('0x35')](_['pick'](_0x1f3076['query'],_0x4dcdec[_0x3b41('0x35')]));_0x5e0585[_0x3b41('0x6d')]=!![];if(_0x1f3076[_0x3b41('0x34')][_0x3b41('0x59')]){_0x5e0585[_0x3b41('0x3c')]=_[_0x3b41('0x3e')](_0x5e0585[_0x3b41('0x3c')],{'$or':_['map'](_0x5e0585['attributes'],function(_0x44239d){var _0x462fc7={};_0x462fc7[_0x44239d]={'$like':'%'+_0x1f3076[_0x3b41('0x34')][_0x3b41('0x59')]+'%'};return _0x462fc7;})});}_0x5e0585=_[_0x3b41('0x3e')]({},_0x5e0585,_0x1f3076['options']);return _0xebd435[_0x3b41('0x66')](_0x5e0585);}})[_0x3b41('0x28')](respondWithResult(_0x3d102f,null))[_0x3b41('0x4e')](handleError(_0x3d102f,null));};exports[_0x3b41('0x6e')]=function(_0x503d63,_0x2b50b2,_0x4a4d0a){var _0x4f206c;return db[_0x3b41('0x30')][_0x3b41('0x4b')]({'where':{'id':_0x503d63[_0x3b41('0x43')]['id']},'include':[{'model':db[_0x3b41('0x67')],'as':_0x3b41('0x68')}]})[_0x3b41('0x28')](handleEntityNotFound(_0x2b50b2,null))[_0x3b41('0x28')](function(_0xe9b9ba){if(_0xe9b9ba){_0x4f206c=_0xe9b9ba;return db['CmContact'][_0x3b41('0x57')];}})[_0x3b41('0x28')](function(_0x2751a8){if(_0x2751a8){var _0x340826={};var _0x297f87={};_0x297f87[_0x3b41('0x33')]=_[_0x3b41('0x69')](_['keys'](_0x2751a8),_[_0x3b41('0x2f')](_0x4f206c['CustomFields'],function(_0x575fa4){return util[_0x3b41('0x6a')](_0x3b41('0x6b'),_0x575fa4['id']);}));_0x297f87[_0x3b41('0x34')]=_[_0x3b41('0x44')](_0x503d63['query']);_0x297f87[_0x3b41('0x35')]=_['intersection'](_0x297f87[_0x3b41('0x33')],_0x297f87['query']);_0x340826[_0x3b41('0x37')]=_[_0x3b41('0x36')](_0x297f87[_0x3b41('0x33')],qs[_0x3b41('0x38')](_0x503d63[_0x3b41('0x34')][_0x3b41('0x38')]));_0x340826['attributes']=_0x340826[_0x3b41('0x37')][_0x3b41('0x39')]?_0x340826['attributes']:_0x297f87[_0x3b41('0x33')];if(!_0x503d63[_0x3b41('0x34')][_0x3b41('0x6c')](_0x3b41('0x58'))){_0x340826[_0x3b41('0x24')]=qs[_0x3b41('0x24')](_0x503d63['query'][_0x3b41('0x24')]);_0x340826['offset']=qs[_0x3b41('0x22')](_0x503d63['query'][_0x3b41('0x22')]);}_0x340826[_0x3b41('0x3a')]=qs[_0x3b41('0x3b')](_0x503d63[_0x3b41('0x34')][_0x3b41('0x3b')]);_0x340826[_0x3b41('0x3c')]=qs[_0x3b41('0x35')](_[_0x3b41('0x3d')](_0x503d63['query'],_0x297f87[_0x3b41('0x35')]));_0x340826[_0x3b41('0x6d')]=!![];if(_0x503d63['query'][_0x3b41('0x59')]){_0x340826[_0x3b41('0x3c')]=_[_0x3b41('0x3e')](_0x340826[_0x3b41('0x3c')],{'$or':_['map'](_0x340826[_0x3b41('0x37')],function(_0x39348b){var _0x23696a={};_0x23696a[_0x39348b]={'$like':'%'+_0x503d63['query'][_0x3b41('0x59')]+'%'};return _0x23696a;})});}_0x340826=_[_0x3b41('0x3e')]({},_0x340826,_0x503d63[_0x3b41('0x3f')]);return _0x4f206c['getContacts'](_0x340826);}})[_0x3b41('0x28')](function(_0x12a79a){if(!_[_0x3b41('0x6f')](_0x12a79a)){var _0x6d85ee=toCsv(_0x12a79a);var _0x3c8755=Date[_0x3b41('0x70')]();fs[_0x3b41('0x71')](util[_0x3b41('0x6a')](_0x3b41('0x72'),_0x4f206c['id'],_0x3c8755),_0x6d85ee);_0x2b50b2[_0x3b41('0x73')](_0x3b41('0x74'),_0x3b41('0x75')+util[_0x3b41('0x6a')](_0x3b41('0x76'),_0x4f206c['id'],_0x3c8755));_0x2b50b2[_0x3b41('0x73')](_0x3b41('0x77'),_0x3b41('0x78'));return _0x2b50b2[_0x3b41('0x79')](util[_0x3b41('0x6a')](_0x3b41('0x72'),_0x4f206c['id'],_0x3c8755));}else{return _0x2b50b2['sendStatus'](0xcc);}})[_0x3b41('0x4e')](handleError(_0x2b50b2,null));};exports[_0x3b41('0x7a')]=function(_0x42025c,_0x551713,_0x5adbef){var _0xcd03f9;delete _0x42025c[_0x3b41('0x47')]['id'];return db['CmList'][_0x3b41('0x56')]({'where':{'id':_0x42025c[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x551713,null))[_0x3b41('0x28')](function(_0x4995bc){if(_0x4995bc){return db[_0x3b41('0x7b')][_0x3b41('0x7c')](function(_0x4589d7){return db['CmCustomField'][_0x3b41('0x46')](_0x42025c['body'],{'transaction':_0x4589d7})[_0x3b41('0x28')](function(_0x30eac1){_0xcd03f9=_0x30eac1;return _0x4995bc[_0x3b41('0x7d')](_0x30eac1,{'transaction':_0x4589d7});})[_0x3b41('0x28')](function(){var _0x29ae70={'type':db['Sequelize'][_0x3b41('0x7e')],'transaction':_0x4589d7};switch(_0x42025c[_0x3b41('0x47')]['type']){case _0x3b41('0x7f'):_0x29ae70[_0x3b41('0x31')]=db['Sequelize'][_0x3b41('0x7e')];break;case _0x3b41('0x80'):_0x29ae70['type']=db[_0x3b41('0x81')][_0x3b41('0x82')];break;case _0x3b41('0x83'):_0x29ae70[_0x3b41('0x31')]=db[_0x3b41('0x81')][_0x3b41('0x84')];_0x29ae70[_0x3b41('0x85')]=![];break;default:}return db[_0x3b41('0x7b')][_0x3b41('0x86')][_0x3b41('0x87')](_0x3b41('0x88'),util[_0x3b41('0x6a')](_0x3b41('0x89'),_0xcd03f9['id']),_0x29ae70);})['then'](function(){return _0xcd03f9;});});}})[_0x3b41('0x28')](respondWithResult(_0x551713,null))[_0x3b41('0x4e')](handleError(_0x551713,null));};exports[_0x3b41('0x8a')]=function(_0x34beb9,_0x362a76,_0x270775){var _0x4d3210={};var _0x23a3f0={};var _0x56f307;var _0x5533ed;return db['CmList'][_0x3b41('0x56')]({'where':{'id':_0x34beb9[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x362a76,null))[_0x3b41('0x28')](function(_0x5a23eb){if(_0x5a23eb){_0x56f307=_0x5a23eb;_0x23a3f0[_0x3b41('0x33')]=_['keys'](db[_0x3b41('0x67')][_0x3b41('0x57')]);_0x23a3f0['query']=_[_0x3b41('0x44')](_0x34beb9[_0x3b41('0x34')]);_0x23a3f0['filters']=_[_0x3b41('0x36')](_0x23a3f0['model'],_0x23a3f0['query']);_0x4d3210['attributes']=_[_0x3b41('0x36')](_0x23a3f0[_0x3b41('0x33')],qs['fields'](_0x34beb9[_0x3b41('0x34')][_0x3b41('0x38')]));_0x4d3210[_0x3b41('0x37')]=_0x4d3210['attributes'][_0x3b41('0x39')]?_0x4d3210[_0x3b41('0x37')]:_0x23a3f0[_0x3b41('0x33')];_0x4d3210[_0x3b41('0x3a')]=qs[_0x3b41('0x3b')](_0x34beb9['query'][_0x3b41('0x3b')]);_0x4d3210[_0x3b41('0x3c')]=qs[_0x3b41('0x35')](_[_0x3b41('0x3d')](_0x34beb9['query'],_0x23a3f0[_0x3b41('0x35')]));_0x4d3210[_0x3b41('0x3c')]=_['merge'](_0x4d3210['where'],{'$or':[{'ListId':_0x5a23eb['id']},{'ListId':null}]});if(_0x34beb9[_0x3b41('0x34')][_0x3b41('0x59')]){_0x4d3210[_0x3b41('0x3c')]=_[_0x3b41('0x3e')](_0x4d3210[_0x3b41('0x3c')],{'$or':_[_0x3b41('0x2f')](_0x4d3210['attributes'],function(_0x2c0d00){var _0x538b7d={};_0x538b7d[_0x2c0d00]={'$like':'%'+_0x34beb9[_0x3b41('0x34')][_0x3b41('0x59')]+'%'};return _0x538b7d;})});}_0x4d3210=_[_0x3b41('0x3e')]({},_0x4d3210,_0x34beb9[_0x3b41('0x3f')]);return db['CmCustomField'][_0x3b41('0x8b')](_0x4d3210);}})[_0x3b41('0x28')](respondWithResult(_0x362a76,null))[_0x3b41('0x4e')](handleError(_0x362a76,null));};exports[_0x3b41('0x8c')]=function(_0x3ca8ab,_0x4a4111,_0x395c68){return db[_0x3b41('0x30')][_0x3b41('0x4b')]({'where':{'id':_0x3ca8ab[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x4a4111,null))[_0x3b41('0x28')](function(_0x47cb0d){if(_0x47cb0d){return _0x47cb0d['addAgents'](_0x3ca8ab[_0x3b41('0x47')][_0x3b41('0x5b')],_[_0x3b41('0x62')](_0x3ca8ab['body'],[_0x3b41('0x5b'),'id'])||{})[_0x3b41('0x8d')](function(_0x3dac55){for(var _0x3f2e1c=0x0;_0x3f2e1c<_0x3ca8ab[_0x3b41('0x47')][_0x3b41('0x5b')][_0x3b41('0x39')];_0x3f2e1c+=0x1){socket[_0x3b41('0x8e')](_0x3b41('0x8f'),{'UserId':Number(_0x3ca8ab[_0x3b41('0x47')][_0x3b41('0x5b')][_0x3f2e1c]),'CmListId':Number(_0x3ca8ab[_0x3b41('0x43')]['id'])});}return _0x3dac55;});}})[_0x3b41('0x28')](respondWithResult(_0x4a4111,null))[_0x3b41('0x4e')](handleError(_0x4a4111,null));};exports['removeAgents']=function(_0x2c582a,_0x5d45ab,_0x37a42f){return db['CmList']['find']({'where':{'id':_0x2c582a[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x5d45ab,null))[_0x3b41('0x28')](function(_0x45ae98){if(_0x45ae98){return _0x45ae98[_0x3b41('0x90')](_0x2c582a[_0x3b41('0x34')][_0x3b41('0x5b')])[_0x3b41('0x28')](function(){if(_[_0x3b41('0x5f')](_0x2c582a[_0x3b41('0x34')]['ids'])){for(var _0x545c80=0x0;_0x545c80<_0x2c582a[_0x3b41('0x34')][_0x3b41('0x5b')][_0x3b41('0x39')];_0x545c80+=0x1){socket[_0x3b41('0x8e')](_0x3b41('0x91'),{'UserId':Number(_0x2c582a['query']['ids'][_0x545c80]),'CmListId':Number(_0x2c582a[_0x3b41('0x43')]['id'])});}}else{socket['emit'](_0x3b41('0x91'),{'UserId':Number(_0x2c582a[_0x3b41('0x34')][_0x3b41('0x5b')]),'CmListId':Number(_0x2c582a[_0x3b41('0x43')]['id'])});}});}})[_0x3b41('0x28')](respondWithStatusCode(_0x5d45ab,null))[_0x3b41('0x4e')](handleError(_0x5d45ab,null));};exports[_0x3b41('0x92')]=function(_0x4138a9,_0x5e24b3,_0x496e0d){var _0x1c9984={};var _0x4b03a1={};var _0x1d6935;var _0x3f6c1e;return db[_0x3b41('0x30')][_0x3b41('0x56')]({'where':{'id':_0x4138a9[_0x3b41('0x43')]['id']}})[_0x3b41('0x28')](handleEntityNotFound(_0x5e24b3,null))[_0x3b41('0x28')](function(_0x33dfde){if(_0x33dfde){_0x1d6935=_0x33dfde;_0x4b03a1[_0x3b41('0x33')]=_[_0x3b41('0x44')](db['User'][_0x3b41('0x57')]);_0x4b03a1[_0x3b41('0x34')]=_['keys'](_0x4138a9[_0x3b41('0x34')]);_0x4b03a1[_0x3b41('0x35')]=_[_0x3b41('0x36')](_0x4b03a1[_0x3b41('0x33')],_0x4b03a1[_0x3b41('0x34')]);_0x1c9984[_0x3b41('0x37')]=_[_0x3b41('0x36')](_0x4b03a1[_0x3b41('0x33')],qs['fields'](_0x4138a9[_0x3b41('0x34')]['fields']));_0x1c9984['attributes']=_0x1c9984[_0x3b41('0x37')][_0x3b41('0x39')]?_0x1c9984['attributes']:_0x4b03a1[_0x3b41('0x33')];_0x1c9984[_0x3b41('0x3a')]=qs[_0x3b41('0x3b')](_0x4138a9[_0x3b41('0x34')][_0x3b41('0x3b')]);_0x1c9984[_0x3b41('0x3c')]=qs[_0x3b41('0x35')](_[_0x3b41('0x3d')](_0x4138a9[_0x3b41('0x34')],_0x4b03a1['filters']));if(_0x4138a9[_0x3b41('0x34')]['filter']){_0x1c9984[_0x3b41('0x3c')]=_[_0x3b41('0x3e')](_0x1c9984['where'],{'$or':_[_0x3b41('0x2f')](_0x1c9984[_0x3b41('0x37')],function(_0x37b27a){var _0x4ccc23={};_0x4ccc23[_0x37b27a]={'$like':'%'+_0x4138a9[_0x3b41('0x34')][_0x3b41('0x59')]+'%'};return _0x4ccc23;})});}_0x1c9984=_[_0x3b41('0x3e')]({},_0x1c9984,_0x4138a9[_0x3b41('0x3f')]);return _0x1d6935[_0x3b41('0x92')](_0x1c9984);}})[_0x3b41('0x28')](function(_0x166291){if(_0x166291){_0x3f6c1e=_0x166291[_0x3b41('0x39')];if(!_0x4138a9[_0x3b41('0x34')][_0x3b41('0x6c')](_0x3b41('0x58'))){_0x1c9984['limit']=qs[_0x3b41('0x24')](_0x4138a9[_0x3b41('0x34')][_0x3b41('0x24')]);_0x1c9984['offset']=qs[_0x3b41('0x22')](_0x4138a9['query'][_0x3b41('0x22')]);}return _0x1d6935[_0x3b41('0x92')](_0x1c9984);}})[_0x3b41('0x28')](function(_0x17a2b0){if(_0x17a2b0){return _0x17a2b0?{'count':_0x3f6c1e,'rows':_0x17a2b0}:null;}})['then'](respondWithResult(_0x5e24b3,null))[_0x3b41('0x4e')](handleError(_0x5e24b3,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5ab28fa..7ff0168 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x55ca,0x126));var _0xa55c=function(_0x57b4cc,_0x2ae50e){_0x57b4cc=_0x57b4cc-0x0;var _0x45ba9d=_0x55ca[_0x57b4cc];return _0x45ba9d;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x1c0a25,_0x227201){var _0x4ddd7e=function(_0x59f4ac){while(--_0x59f4ac){_0x1c0a25['push'](_0x1c0a25['shift']());}};_0x4ddd7e(++_0x227201);}(_0x7217,0x19e));var _0x7721=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7217[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9589b6b..414534c 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 _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList','cm_lists','lodash'];(function(_0x54c8ba,_0x5682fd){var _0x10f126=function(_0x180ece){while(--_0x180ece){_0x54c8ba['push'](_0x54c8ba['shift']());}};_0x10f126(++_0x5682fd);}(_0xda55,0x6d));var _0x5da5=function(_0x2b462a,_0x493169){_0x2b462a=_0x2b462a-0x0;var _0x25f215=_0xda55[_0x2b462a];return _0x25f215;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91a7=['bluebird','path','./cmList.attributes','exports','CmList','cm_lists','util','../../config/logger','api'];(function(_0x32e264,_0x41cee8){var _0x1d7175=function(_0x5913d9){while(--_0x5913d9){_0x32e264['push'](_0x32e264['shift']());}};_0x1d7175(++_0x41cee8);}(_0x91a7,0xe7));var _0x791a=function(_0x5bdf55,_0x39ff3e){_0x5bdf55=_0x5bdf55-0x0;var _0x4c15c7=_0x91a7[_0x5bdf55];return _0x4c15c7;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x791a('0x5'));module[_0x791a('0x6')]=function(_0x49a9b7,_0x361f53){return _0x49a9b7['define'](_0x791a('0x7'),attributes,{'tableName':_0x791a('0x8'),'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 f8983f9..4506bee 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 _0x086d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','info','CmList,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x111ee6,_0xd8a3ea){var _0x8bbb51=function(_0x273011){while(--_0x273011){_0x111ee6['push'](_0x111ee6['shift']());}};_0x8bbb51(++_0xd8a3ea);}(_0x086d,0x150));var _0xd086=function(_0x524a29,_0x2cccfa){_0x524a29=_0x524a29-0x0;var _0x26126d=_0x086d[_0x524a29];return _0x26126d;};'use strict';var _=require('lodash');var util=require(_0xd086('0x0'));var moment=require(_0xd086('0x1'));var BPromise=require(_0xd086('0x2'));var rs=require(_0xd086('0x3'));var fs=require('fs');var Redis=require(_0xd086('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd086('0x5'));var logger=require(_0xd086('0x6'))(_0xd086('0x7'));var config=require(_0xd086('0x8'));var jayson=require(_0xd086('0x9'));var client=jayson['client'][_0xd086('0xa')]({'port':0x232a});config[_0xd086('0xb')]=_[_0xd086('0xc')](config[_0xd086('0xb')],{'host':_0xd086('0xd'),'port':0x18eb});var socket=require(_0xd086('0xe'))(new Redis(config[_0xd086('0xb')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x59ce8f,_0x11c3b9,_0x40a32e){return new BPromise(function(_0xe74669,_0x51d81b){return client[_0xd086('0xf')](_0x59ce8f,_0x40a32e)['then'](function(_0x38d4aa){logger[_0xd086('0x10')](_0xd086('0x11'),_0x11c3b9,'request\x20sent');logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x11c3b9,_0xd086('0x12'),JSON['stringify'](_0x38d4aa));if(_0x38d4aa['error']){if(_0x38d4aa[_0xd086('0x13')][_0xd086('0x14')]===0x1f4){logger[_0xd086('0x13')](_0xd086('0x11'),_0x11c3b9,_0x38d4aa[_0xd086('0x13')][_0xd086('0x15')]);return _0x51d81b(_0x38d4aa['error'][_0xd086('0x15')]);}logger[_0xd086('0x13')](_0xd086('0x11'),_0x11c3b9,_0x38d4aa[_0xd086('0x13')][_0xd086('0x15')]);return _0xe74669(_0x38d4aa[_0xd086('0x13')][_0xd086('0x15')]);}else{logger[_0xd086('0x10')]('CmList,\x20%s,\x20%s',_0x11c3b9,_0xd086('0x12'));_0xe74669(_0x38d4aa[_0xd086('0x16')][_0xd086('0x15')]);}})[_0xd086('0x17')](function(_0x1ce450){logger[_0xd086('0x13')](_0xd086('0x11'),_0x11c3b9,_0x1ce450);_0x51d81b(_0x1ce450);});});} \ No newline at end of file +var _0x305e=['redis','defaults','localhost','socket.io-emitter','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2bf2f3,_0x1a97c8){var _0x4f0b67=function(_0x3b5cd5){while(--_0x3b5cd5){_0x2bf2f3['push'](_0x2bf2f3['shift']());}};_0x4f0b67(++_0x1a97c8);}(_0x305e,0x76));var _0xe305=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x305e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe305('0x0'));var util=require(_0xe305('0x1'));var moment=require(_0xe305('0x2'));var BPromise=require('bluebird');var rs=require(_0xe305('0x3'));var fs=require('fs');var Redis=require(_0xe305('0x4'));var db=require(_0xe305('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe305('0x6'))(_0xe305('0x7'));var config=require(_0xe305('0x8'));var jayson=require(_0xe305('0x9'));var client=jayson[_0xe305('0xa')][_0xe305('0xb')]({'port':0x232a});config[_0xe305('0xc')]=_[_0xe305('0xd')](config[_0xe305('0xc')],{'host':_0xe305('0xe'),'port':0x18eb});var socket=require(_0xe305('0xf'))(new Redis(config[_0xe305('0xc')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x2a3e00,_0x433f52,_0x479e14){return new BPromise(function(_0x1a8b45,_0x29d08b){return client['request'](_0x2a3e00,_0x479e14)['then'](function(_0x3cacba){logger[_0xe305('0x10')](_0xe305('0x11'),_0x433f52,_0xe305('0x12'));logger[_0xe305('0x13')](_0xe305('0x14'),_0x433f52,_0xe305('0x12'),JSON[_0xe305('0x15')](_0x3cacba));if(_0x3cacba['error']){if(_0x3cacba[_0xe305('0x16')]['code']===0x1f4){logger[_0xe305('0x16')](_0xe305('0x11'),_0x433f52,_0x3cacba[_0xe305('0x16')][_0xe305('0x17')]);return _0x29d08b(_0x3cacba[_0xe305('0x16')][_0xe305('0x17')]);}logger['error']('CmList,\x20%s,\x20%s',_0x433f52,_0x3cacba['error']['message']);return _0x1a8b45(_0x3cacba['error'][_0xe305('0x17')]);}else{logger[_0xe305('0x10')](_0xe305('0x11'),_0x433f52,_0xe305('0x12'));_0x1a8b45(_0x3cacba[_0xe305('0x18')]['message']);}})[_0xe305('0x19')](function(_0xf3d75c){logger[_0xe305('0x16')](_0xe305('0x11'),_0x433f52,_0xf3d75c);_0x29d08b(_0xf3d75c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 5120e3f..59db5df 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 _0x8e6b=['remove','update','removeListener','length','./cmList.events','save'];(function(_0x4f87b6,_0x2f0953){var _0x52ba7c=function(_0x5da29e){while(--_0x5da29e){_0x4f87b6['push'](_0x4f87b6['shift']());}};_0x52ba7c(++_0x2f0953);}(_0x8e6b,0x112));var _0xb8e6=function(_0x30bf77,_0x58de20){_0x30bf77=_0x30bf77-0x0;var _0x62cc40=_0x8e6b[_0x30bf77];return _0x62cc40;};'use strict';var CmListEvents=require(_0xb8e6('0x0'));var events=[_0xb8e6('0x1'),_0xb8e6('0x2'),_0xb8e6('0x3')];function createListener(_0x51f24e,_0x4caf47){return function(_0x478908){_0x4caf47['emit'](_0x51f24e,_0x478908);};}function removeListener(_0x4481ea,_0x33076b){return function(){CmListEvents[_0xb8e6('0x4')](_0x4481ea,_0x33076b);};}exports['register']=function(_0x2a5897){for(var _0x1d9f6d=0x0,_0x295c20=events[_0xb8e6('0x5')];_0x1d9f6d<_0x295c20;_0x1d9f6d++){var _0x2d5d65=events[_0x1d9f6d];var _0x167096=createListener('cmList:'+_0x2d5d65,_0x2a5897);CmListEvents['on'](_0x2d5d65,_0x167096);}}; \ No newline at end of file +var _0x73c0=['removeListener','register','length','save','remove','update'];(function(_0xde620d,_0x3774de){var _0x57b00c=function(_0x36111f){while(--_0x36111f){_0xde620d['push'](_0xde620d['shift']());}};_0x57b00c(++_0x3774de);}(_0x73c0,0x171));var _0x073c=function(_0x19360d,_0x59163f){_0x19360d=_0x19360d-0x0;var _0xc8d2e1=_0x73c0[_0x19360d];return _0xc8d2e1;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x073c('0x0'),_0x073c('0x1'),_0x073c('0x2')];function createListener(_0x155d0e,_0x311ea3){return function(_0xe5ee60){_0x311ea3['emit'](_0x155d0e,_0xe5ee60);};}function removeListener(_0x28c480,_0x342242){return function(){CmListEvents[_0x073c('0x3')](_0x28c480,_0x342242);};}exports[_0x073c('0x4')]=function(_0x9de3ce){for(var _0x275dc7=0x0,_0x1d5e2e=events[_0x073c('0x5')];_0x275dc7<_0x1d5e2e;_0x275dc7++){var _0x50439e=events[_0x275dc7];var _0x14b82d=createListener('cmList:'+_0x50439e,_0x9de3ce);CmListEvents['on'](_0x50439e,_0x14b82d);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ca18c03..d7baac8 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 _0xf1b6=['/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4b93e1,_0x24d168){var _0x5a2ec4=function(_0x11fee7){while(--_0x11fee7){_0x4b93e1['push'](_0x4b93e1['shift']());}};_0x5a2ec4(++_0x24d168);}(_0xf1b6,0xd1));var _0x6f1b=function(_0x1f697c,_0x38b2a6){_0x1f697c=_0x1f697c-0x0;var _0x18fbc1=_0xf1b6[_0x1f697c];return _0x18fbc1;};'use strict';var multer=require('multer');var util=require(_0x6f1b('0x0'));var path=require('path');var timeout=require(_0x6f1b('0x1'));var express=require(_0x6f1b('0x2'));var router=express[_0x6f1b('0x3')]();var fs_extra=require(_0x6f1b('0x4'));var auth=require(_0x6f1b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f1b('0x6'));var controller=require(_0x6f1b('0x7'));router[_0x6f1b('0x8')]('/',auth[_0x6f1b('0x9')](),controller[_0x6f1b('0xa')]);router[_0x6f1b('0x8')](_0x6f1b('0xb'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0xc')]);router['get'](_0x6f1b('0xd'),auth['isAuthenticated'](),controller[_0x6f1b('0xe')]);router['get'](_0x6f1b('0xf'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x10')]);router[_0x6f1b('0x8')](_0x6f1b('0x11'),auth[_0x6f1b('0x9')](),controller['getContacts']);router[_0x6f1b('0x8')](_0x6f1b('0x12'),auth['isAuthenticated'](),controller[_0x6f1b('0x13')]);router[_0x6f1b('0x8')](_0x6f1b('0x14'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x15')]);router[_0x6f1b('0x8')](_0x6f1b('0x16'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x17')]);router[_0x6f1b('0x18')]('/',auth['isAuthenticated'](),controller[_0x6f1b('0x19')]);router[_0x6f1b('0x18')](_0x6f1b('0xf'),auth['isAuthenticated'](),controller[_0x6f1b('0x1a')]);router[_0x6f1b('0x18')](_0x6f1b('0x11'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x1b')]);router[_0x6f1b('0x18')](_0x6f1b('0x14'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x1c')]);router[_0x6f1b('0x18')](_0x6f1b('0x16'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x1d')]);router[_0x6f1b('0x1e')](_0x6f1b('0xd'),auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x1f')]);router[_0x6f1b('0x20')](_0x6f1b('0xd'),auth['isAuthenticated'](),controller[_0x6f1b('0x21')]);router[_0x6f1b('0x20')](_0x6f1b('0xf'),auth['isAuthenticated'](),controller[_0x6f1b('0x22')]);router['delete']('/:id/users',auth[_0x6f1b('0x9')](),controller[_0x6f1b('0x23')]);module[_0x6f1b('0x24')]=router; \ No newline at end of file +var _0x3a37=['/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','exports','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','isAuthenticated','describe','get','/:id','show'];(function(_0x3fd49f,_0xbf474d){var _0x5092e9=function(_0x5cb663){while(--_0x5cb663){_0x3fd49f['push'](_0x3fd49f['shift']());}};_0x5092e9(++_0xbf474d);}(_0x3a37,0x1c5));var _0x73a3=function(_0x3d7365,_0x13ccfb){_0x3d7365=_0x3d7365-0x0;var _0x3d96ac=_0x3a37[_0x3d7365];return _0x3d96ac;};'use strict';var multer=require('multer');var util=require(_0x73a3('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(_0x73a3('0x1'));var interaction=require(_0x73a3('0x2'));var config=require(_0x73a3('0x3'));var controller=require(_0x73a3('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x73a3('0x5')]);router['get']('/describe',auth[_0x73a3('0x6')](),controller[_0x73a3('0x7')]);router[_0x73a3('0x8')](_0x73a3('0x9'),auth[_0x73a3('0x6')](),controller[_0x73a3('0xa')]);router['get'](_0x73a3('0xb'),auth['isAuthenticated'](),controller[_0x73a3('0xc')]);router['get']('/:id/contacts',auth[_0x73a3('0x6')](),controller[_0x73a3('0xd')]);router[_0x73a3('0x8')](_0x73a3('0xe'),auth['isAuthenticated'](),controller[_0x73a3('0xf')]);router[_0x73a3('0x8')](_0x73a3('0x10'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x73a3('0x8')](_0x73a3('0x11'),auth[_0x73a3('0x6')](),controller[_0x73a3('0x12')]);router[_0x73a3('0x13')]('/',auth[_0x73a3('0x6')](),controller['create']);router['post'](_0x73a3('0xb'),auth[_0x73a3('0x6')](),controller[_0x73a3('0x14')]);router[_0x73a3('0x13')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x73a3('0x15')]);router[_0x73a3('0x13')](_0x73a3('0x10'),auth[_0x73a3('0x6')](),controller[_0x73a3('0x16')]);router[_0x73a3('0x13')](_0x73a3('0x11'),auth['isAuthenticated'](),controller[_0x73a3('0x17')]);router[_0x73a3('0x18')](_0x73a3('0x9'),auth['isAuthenticated'](),controller[_0x73a3('0x19')]);router[_0x73a3('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x73a3('0x1b')]);router[_0x73a3('0x1a')](_0x73a3('0xb'),auth[_0x73a3('0x6')](),controller['removeDispositions']);router[_0x73a3('0x1a')](_0x73a3('0x11'),auth[_0x73a3('0x6')](),controller['removeAgents']);module[_0x73a3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d7957dc..3f44b5e 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 _0xcdc0=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x5e2803,_0x3c82f7){var _0x4d7e74=function(_0x4109a4){while(--_0x4109a4){_0x5e2803['push'](_0x5e2803['shift']());}};_0x4d7e74(++_0x3c82f7);}(_0xcdc0,0x1e1));var _0x0cdc=function(_0x2a225f,_0x44ed36){_0x2a225f=_0x2a225f-0x0;var _0xfa8e42=_0xcdc0[_0x2a225f];return _0xfa8e42;};'use strict';var Sequelize=require(_0x0cdc('0x0'));module[_0x0cdc('0x1')]={'name':{'type':Sequelize[_0x0cdc('0x2')],'get':function(_0x64d70e){return this[_0x0cdc('0x3')](_0x0cdc('0x4'));}},'field':{'type':Sequelize[_0x0cdc('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x0cdc('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x0815=['sequelize','exports','getDataValue','field','STRING'];(function(_0x55c9ea,_0xf80189){var _0x59d18e=function(_0x55ec90){while(--_0x55ec90){_0x55c9ea['push'](_0x55c9ea['shift']());}};_0x59d18e(++_0xf80189);}(_0x0815,0x140));var _0x5081=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0815[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x5081('0x0'));module[_0x5081('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x547351){return this[_0x5081('0x2')](_0x5081('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x5081('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x5081('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 7451c0f..eef97af 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x53afd0,_0x246871){var _0x40968d=function(_0x27ef59){while(--_0x27ef59){_0x53afd0['push'](_0x53afd0['shift']());}};_0x40968d(++_0x246871);}(_0x7a54,0x106));var _0x47a5=function(_0x139eeb,_0x8ccb9c){_0x139eeb=_0x139eeb-0x0;var _0x3ce97a=_0x7a54[_0x139eeb];return _0x3ce97a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _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(_0x393f0d,_0x4be350){var _0x238fa7=function(_0x4d35cd){while(--_0x4d35cd){_0x393f0d['push'](_0x393f0d['shift']());}};_0x238fa7(++_0x4be350);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 b7e940b..c74a76d 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 _0x4bec=['exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','path','rimraf','./condition.attributes'];(function(_0x5c5251,_0xcae2a9){var _0x57e72a=function(_0x37246c){while(--_0x37246c){_0x5c5251['push'](_0x5c5251['shift']());}};_0x57e72a(++_0xcae2a9);}(_0x4bec,0xe8));var _0xc4be=function(_0x4ccc7d,_0x467c40){_0x4ccc7d=_0x4ccc7d-0x0;var _0x2b5fd5=_0x4bec[_0x4ccc7d];return _0x2b5fd5;};'use strict';var _=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var logger=require(_0xc4be('0x2'))(_0xc4be('0x3'));var moment=require(_0xc4be('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4be('0x5'));var rimraf=require(_0xc4be('0x6'));var config=require('../../config/environment');var attributes=require(_0xc4be('0x7'));module[_0xc4be('0x8')]=function(_0x348e2d,_0xf89899){return _0x348e2d[_0xc4be('0x9')](_0xc4be('0xa'),attributes,{'tableName':_0xc4be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda50=['./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xda50,0x10d));var _0x0da5=function(_0xd6d0be,_0x27c8ef){_0xd6d0be=_0xd6d0be-0x0;var _0x3f775b=_0xda50[_0xd6d0be];return _0x3f775b;};'use strict';var _=require(_0x0da5('0x0'));var util=require(_0x0da5('0x1'));var logger=require(_0x0da5('0x2'))(_0x0da5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0da5('0x4'));var fs=require('fs');var path=require(_0x0da5('0x5'));var rimraf=require('rimraf');var config=require(_0x0da5('0x6'));var attributes=require(_0x0da5('0x7'));module[_0x0da5('0x8')]=function(_0x2bfad3,_0x4f9623){return _0x2bfad3[_0x0da5('0x9')](_0x0da5('0xa'),attributes,{'tableName':_0x0da5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 1a86681..4d07cbc 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 _0x1b60=['info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','Condition,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x877091,_0x1ab15a){var _0x391eda=function(_0x5a46d0){while(--_0x5a46d0){_0x877091['push'](_0x877091['shift']());}};_0x391eda(++_0x1ab15a);}(_0x1b60,0x199));var _0x01b6=function(_0x1748de,_0x42f2bb){_0x1748de=_0x1748de-0x0;var _0x12eb41=_0x1b60[_0x1748de];return _0x12eb41;};'use strict';var _=require('lodash');var util=require(_0x01b6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x01b6('0x1'));var fs=require('fs');var Redis=require(_0x01b6('0x2'));var db=require(_0x01b6('0x3'))['db'];var utils=require(_0x01b6('0x4'));var logger=require(_0x01b6('0x5'))('rpc');var config=require(_0x01b6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x01b6('0x7')][_0x01b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2eb2fb,_0x2a98c4,_0x4b9129){return new BPromise(function(_0x390669,_0x4b6d65){return client[_0x01b6('0x9')](_0x2eb2fb,_0x4b9129)[_0x01b6('0xa')](function(_0x26dcd8){logger[_0x01b6('0xb')]('Condition,\x20%s,\x20%s',_0x2a98c4,'request\x20sent');logger[_0x01b6('0xc')](_0x01b6('0xd'),_0x2a98c4,_0x01b6('0xe'),JSON['stringify'](_0x26dcd8));if(_0x26dcd8[_0x01b6('0xf')]){if(_0x26dcd8[_0x01b6('0xf')]['code']===0x1f4){logger[_0x01b6('0xf')](_0x01b6('0x10'),_0x2a98c4,_0x26dcd8[_0x01b6('0xf')][_0x01b6('0x11')]);return _0x4b6d65(_0x26dcd8[_0x01b6('0xf')]['message']);}logger[_0x01b6('0xf')](_0x01b6('0x10'),_0x2a98c4,_0x26dcd8[_0x01b6('0xf')][_0x01b6('0x11')]);return _0x390669(_0x26dcd8[_0x01b6('0xf')][_0x01b6('0x11')]);}else{logger[_0x01b6('0xb')](_0x01b6('0x10'),_0x2a98c4,'request\x20sent');_0x390669(_0x26dcd8[_0x01b6('0x12')][_0x01b6('0x11')]);}})[_0x01b6('0x13')](function(_0x53f7f0){logger['error'](_0x01b6('0x10'),_0x2a98c4,_0x53f7f0);_0x4b6d65(_0x53f7f0);});});} \ No newline at end of file +var _0xbdf5=['debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Condition,\x20%s,\x20%s','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent'];(function(_0xf9c1d,_0x22129b){var _0x53a527=function(_0xacdd5c){while(--_0xacdd5c){_0xf9c1d['push'](_0xf9c1d['shift']());}};_0x53a527(++_0x22129b);}(_0xbdf5,0x13d));var _0x5bdf=function(_0x441076,_0x4d8811){_0x441076=_0x441076-0x0;var _0x52e56b=_0xbdf5[_0x441076];return _0x52e56b;};'use strict';var _=require(_0x5bdf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5bdf('0x1'));var rs=require(_0x5bdf('0x2'));var fs=require('fs');var Redis=require(_0x5bdf('0x3'));var db=require(_0x5bdf('0x4'))['db'];var utils=require(_0x5bdf('0x5'));var logger=require(_0x5bdf('0x6'))(_0x5bdf('0x7'));var config=require('../../config/environment');var jayson=require(_0x5bdf('0x8'));var client=jayson[_0x5bdf('0x9')][_0x5bdf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x374e78,_0x35ad93,_0x2d9acb){return new BPromise(function(_0x24b0af,_0x39a001){return client['request'](_0x374e78,_0x2d9acb)[_0x5bdf('0xb')](function(_0x4629a8){logger['info']('Condition,\x20%s,\x20%s',_0x35ad93,_0x5bdf('0xc'));logger[_0x5bdf('0xd')](_0x5bdf('0xe'),_0x35ad93,_0x5bdf('0xc'),JSON[_0x5bdf('0xf')](_0x4629a8));if(_0x4629a8[_0x5bdf('0x10')]){if(_0x4629a8[_0x5bdf('0x10')][_0x5bdf('0x11')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x35ad93,_0x4629a8[_0x5bdf('0x10')][_0x5bdf('0x12')]);return _0x39a001(_0x4629a8[_0x5bdf('0x10')][_0x5bdf('0x12')]);}logger[_0x5bdf('0x10')]('Condition,\x20%s,\x20%s',_0x35ad93,_0x4629a8[_0x5bdf('0x10')]['message']);return _0x24b0af(_0x4629a8[_0x5bdf('0x10')][_0x5bdf('0x12')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x35ad93,_0x5bdf('0xc'));_0x24b0af(_0x4629a8[_0x5bdf('0x13')][_0x5bdf('0x12')]);}})[_0x5bdf('0x14')](function(_0x23766a){logger[_0x5bdf('0x10')](_0x5bdf('0x15'),_0x35ad93,_0x23766a);_0x39a001(_0x23766a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index f57b34e..e329103 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 _0x4fc1=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','destroy','multer'];(function(_0x1eebbc,_0x3307b1){var _0x20c614=function(_0x32a556){while(--_0x32a556){_0x1eebbc['push'](_0x1eebbc['shift']());}};_0x20c614(++_0x3307b1);}(_0x4fc1,0xfb));var _0x14fc=function(_0x2f7035,_0x3f4dd3){_0x2f7035=_0x2f7035-0x0;var _0x47c1dc=_0x4fc1[_0x2f7035];return _0x47c1dc;};'use strict';var multer=require(_0x14fc('0x0'));var util=require(_0x14fc('0x1'));var path=require(_0x14fc('0x2'));var timeout=require('connect-timeout');var express=require(_0x14fc('0x3'));var router=express[_0x14fc('0x4')]();var fs_extra=require(_0x14fc('0x5'));var auth=require(_0x14fc('0x6'));var interaction=require(_0x14fc('0x7'));var config=require(_0x14fc('0x8'));var controller=require(_0x14fc('0x9'));router[_0x14fc('0xa')](_0x14fc('0xb'),auth[_0x14fc('0xc')](),controller['update']);router['delete'](_0x14fc('0xb'),auth[_0x14fc('0xc')](),controller[_0x14fc('0xd')]);module['exports']=router; \ No newline at end of file +var _0xfcef=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xfcef,0x1bc));var _0xffce=function(_0x88ecd7,_0x4f2694){_0x88ecd7=_0x88ecd7-0x0;var _0x30da65=_0xfcef[_0x88ecd7];return _0x30da65;};'use strict';var multer=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var path=require(_0xffce('0x2'));var timeout=require(_0xffce('0x3'));var express=require('express');var router=express[_0xffce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffce('0x5'));var interaction=require(_0xffce('0x6'));var config=require(_0xffce('0x7'));var controller=require(_0xffce('0x8'));router[_0xffce('0x9')](_0xffce('0xa'),auth['isAuthenticated'](),controller[_0xffce('0xb')]);router[_0xffce('0xc')](_0xffce('0xa'),auth[_0xffce('0xd')](),controller[_0xffce('0xe')]);module[_0xffce('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 0911c3c..0020864 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 _0xb7e7=['STRING','sequelize'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xb7e7[_0x9fd887];return _0x1a54ab;};'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 +var _0xb7e7=['STRING','sequelize'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xb7e7[_0x50aa2e];return _0x5e07f0;};'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 3b30bf9..5a71196 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 _0xe63d=['value','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrEmailAccounts','attrSmsAccounts','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','findOne','DashboardItem','order','getItems','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','autoAssociation','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat'];(function(_0x772d92,_0x23f0b0){var _0x1cdf3c=function(_0x29129e){while(--_0x29129e){_0x772d92['push'](_0x772d92['shift']());}};_0x1cdf3c(++_0x23f0b0);}(_0xe63d,0x19c));var _0xde63=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe63d[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xde63('0x0'));var rimraf=require(_0xde63('0x1'));var zipdir=require(_0xde63('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde63('0x3'));var moment=require(_0xde63('0x4'));var BPromise=require(_0xde63('0x5'));var Mustache=require(_0xde63('0x6'));var util=require('util');var path=require(_0xde63('0x7'));var sox=require(_0xde63('0x8'));var csv=require(_0xde63('0x9'));var ejs=require(_0xde63('0xa'));var fs=require('fs');var fs_extra=require(_0xde63('0xb'));var _=require(_0xde63('0xc'));var squel=require('squel');var crypto=require(_0xde63('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xde63('0x9'));var querystring=require(_0xde63('0xe'));var Papa=require(_0xde63('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde63('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde63('0x11'));var utils=require('../../config/utils');var config=require(_0xde63('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xde63('0x13'))['db'];config[_0xde63('0x14')]=_[_0xde63('0x15')](config[_0xde63('0x14')],{'host':_0xde63('0x16'),'port':0x18eb});var socket=require(_0xde63('0x17'))(new Redis(config['redis']));require(_0xde63('0x18'))[_0xde63('0x19')](socket);function respondWithStatusCode(_0x5bc4e3,_0x93d2da){_0x93d2da=_0x93d2da||0xcc;return function(_0x589d94){if(_0x589d94){return _0x5bc4e3['sendStatus'](_0x93d2da);}return _0x5bc4e3['status'](_0x93d2da)[_0xde63('0x1a')]();};}function respondWithResult(_0x2d9bad,_0x3877e4){_0x3877e4=_0x3877e4||0xc8;return function(_0x453b32){if(_0x453b32){return _0x2d9bad[_0xde63('0x1b')](_0x3877e4)[_0xde63('0x1c')](_0x453b32);}};}function respondWithFilteredResult(_0x529373,_0x2c3990){return function(_0x205fd3){if(_0x205fd3){var _0x4f110d=typeof _0x2c3990[_0xde63('0x1d')]===_0xde63('0x1e')&&typeof _0x2c3990[_0xde63('0x1f')]===_0xde63('0x1e');var _0x55193b=_0x205fd3['count'];var _0x3ba36b=_0x4f110d?0x0:_0x2c3990[_0xde63('0x1d')];var _0x142348=_0x4f110d?_0x205fd3[_0xde63('0x20')]:_0x2c3990[_0xde63('0x1d')]+_0x2c3990[_0xde63('0x1f')];var _0x37c4c5;if(_0x142348>=_0x55193b){_0x142348=_0x55193b;_0x37c4c5=0xc8;}else{_0x37c4c5=0xce;}_0x529373['status'](_0x37c4c5);return _0x529373[_0xde63('0x21')](_0xde63('0x22'),_0x3ba36b+'-'+_0x142348+'/'+_0x55193b)['json'](_0x205fd3);}return null;};}function patchUpdates(_0x1697b1){return function(_0x5aaa15){try{jsonpatch[_0xde63('0x23')](_0x5aaa15,_0x1697b1,!![]);}catch(_0x39c8d3){return BPromise[_0xde63('0x24')](_0x39c8d3);}return _0x5aaa15[_0xde63('0x25')]();};}function saveUpdates(_0x13b19e,_0x115a72){return function(_0x5ad14b){if(_0x5ad14b){return _0x5ad14b[_0xde63('0x26')](_0x13b19e)[_0xde63('0x27')](function(_0x5d2cc2){return _0x5d2cc2;});}return null;};}function removeEntity(_0x38d75c,_0x163be4){return function(_0x2f6d0d){if(_0x2f6d0d){return _0x2f6d0d[_0xde63('0x28')]()[_0xde63('0x27')](function(){var _0x4dc34a=_0x2f6d0d[_0xde63('0x29')]({'plain':!![]});var _0x81b747=_0xde63('0x2a');return db[_0xde63('0x2b')][_0xde63('0x28')]({'where':{'type':_0x81b747,'resourceId':_0x4dc34a['id']}})[_0xde63('0x27')](function(){return _0x2f6d0d;});})[_0xde63('0x27')](function(){_0x38d75c['status'](0xcc)[_0xde63('0x1a')]();});}};}function handleEntityNotFound(_0x5d536d,_0x2db73e){return function(_0x5d67b3){if(!_0x5d67b3){_0x5d536d[_0xde63('0x2c')](0x194);}return _0x5d67b3;};}function handleError(_0x107f3c,_0x1f6e6a){_0x1f6e6a=_0x1f6e6a||0x1f4;return function(_0x5d2c69){logger['error'](_0x5d2c69[_0xde63('0x2d')]);if(_0x5d2c69[_0xde63('0x2e')]){delete _0x5d2c69['name'];}_0x107f3c[_0xde63('0x1b')](_0x1f6e6a)[_0xde63('0x2f')](_0x5d2c69);};}exports[_0xde63('0x30')]=function(_0xb2edd1,_0x36ce6e){var _0x66cd5e={},_0x220fdc={},_0x42fe12={'count':0x0,'rows':[]};var _0x1c247a=_[_0xde63('0x31')](db['Dashboard']['rawAttributes'],function(_0x11c7d4){return{'name':_0x11c7d4['fieldName'],'type':_0x11c7d4[_0xde63('0x32')][_0xde63('0x33')]};});_0x220fdc[_0xde63('0x34')]=_['map'](_0x1c247a,_0xde63('0x2e'));_0x220fdc[_0xde63('0x35')]=_['keys'](_0xb2edd1[_0xde63('0x35')]);_0x220fdc[_0xde63('0x36')]=_[_0xde63('0x37')](_0x220fdc[_0xde63('0x34')],_0x220fdc['query']);_0x66cd5e[_0xde63('0x38')]=_[_0xde63('0x37')](_0x220fdc[_0xde63('0x34')],qs[_0xde63('0x39')](_0xb2edd1[_0xde63('0x35')][_0xde63('0x39')]));_0x66cd5e[_0xde63('0x38')]=_0x66cd5e['attributes']['length']?_0x66cd5e[_0xde63('0x38')]:_0x220fdc[_0xde63('0x34')];if(!_0xb2edd1[_0xde63('0x35')][_0xde63('0x3a')](_0xde63('0x3b'))){_0x66cd5e[_0xde63('0x1f')]=qs[_0xde63('0x1f')](_0xb2edd1[_0xde63('0x35')]['limit']);_0x66cd5e[_0xde63('0x1d')]=qs[_0xde63('0x1d')](_0xb2edd1['query'][_0xde63('0x1d')]);}_0x66cd5e['order']=qs[_0xde63('0x3c')](_0xb2edd1[_0xde63('0x35')][_0xde63('0x3c')]);_0x66cd5e[_0xde63('0x3d')]=qs['filters'](_[_0xde63('0x3e')](_0xb2edd1[_0xde63('0x35')],_0x220fdc['filters']),_0x1c247a);if(_0xb2edd1['query'][_0xde63('0x3f')]){_0x66cd5e[_0xde63('0x3d')]=_[_0xde63('0x40')](_0x66cd5e['where'],{'$or':_[_0xde63('0x31')](_0x1c247a,function(_0x4a5437){if(_0x4a5437[_0xde63('0x32')]!==_0xde63('0x41')){var _0x8c8839={};_0x8c8839[_0x4a5437[_0xde63('0x2e')]]={'$like':'%'+_0xb2edd1[_0xde63('0x35')][_0xde63('0x3f')]+'%'};return _0x8c8839;}})});}_0x66cd5e=_[_0xde63('0x40')]({},_0x66cd5e,_0xb2edd1[_0xde63('0x42')]);var _0x5384e0={'where':_0x66cd5e[_0xde63('0x3d')]};return db[_0xde63('0x43')][_0xde63('0x20')](_0x5384e0)['then'](function(_0x70cbd9){_0x42fe12['count']=_0x70cbd9;if(_0xb2edd1[_0xde63('0x35')][_0xde63('0x44')]){_0x66cd5e[_0xde63('0x45')]=[{'all':!![]}];}return db['Dashboard'][_0xde63('0x46')](_0x66cd5e);})[_0xde63('0x27')](function(_0x4a2249){_0x42fe12[_0xde63('0x47')]=_0x4a2249;return _0x42fe12;})[_0xde63('0x27')](respondWithFilteredResult(_0x36ce6e,_0x66cd5e))['catch'](handleError(_0x36ce6e,null));};exports[_0xde63('0x48')]=function(_0x56d730,_0x3c25a0){var _0x158116={'raw':![],'where':{'id':_0x56d730[_0xde63('0x49')]['id']}},_0x5cb4be={};_0x5cb4be[_0xde63('0x34')]=_[_0xde63('0x4a')](db[_0xde63('0x43')][_0xde63('0x4b')]);_0x5cb4be[_0xde63('0x35')]=_[_0xde63('0x4a')](_0x56d730[_0xde63('0x35')]);_0x5cb4be[_0xde63('0x36')]=_[_0xde63('0x37')](_0x5cb4be[_0xde63('0x34')],_0x5cb4be[_0xde63('0x35')]);_0x158116[_0xde63('0x38')]=_[_0xde63('0x37')](_0x5cb4be[_0xde63('0x34')],qs[_0xde63('0x39')](_0x56d730[_0xde63('0x35')][_0xde63('0x39')]));_0x158116[_0xde63('0x38')]=_0x158116[_0xde63('0x38')][_0xde63('0x4c')]?_0x158116[_0xde63('0x38')]:_0x5cb4be[_0xde63('0x34')];if(_0x56d730[_0xde63('0x35')][_0xde63('0x44')]){_0x158116[_0xde63('0x45')]=[{'all':!![]}];}_0x158116=_[_0xde63('0x40')]({},_0x158116,_0x56d730['options']);return db['Dashboard']['find'](_0x158116)['then'](handleEntityNotFound(_0x3c25a0,null))[_0xde63('0x27')](respondWithResult(_0x3c25a0,null))['catch'](handleError(_0x3c25a0,null));};exports['create']=function(_0x49bbac,_0x11c3a2){return db[_0xde63('0x43')][_0xde63('0x4d')](_0x49bbac['body'],{})[_0xde63('0x27')](function(_0xcd907f){var _0xd9817a=_0x49bbac[_0xde63('0x4e')][_0xde63('0x29')]({'plain':!![]});if(!_0xd9817a)throw new Error(_0xde63('0x4f'));if(_0xd9817a[_0xde63('0x50')]===_0xde63('0x4e')){var _0x6d2c29=_0xcd907f['get']({'plain':!![]});var _0x7d6496=_0xde63('0x2a');return db[_0xde63('0x51')][_0xde63('0x52')]({'where':{'name':_0x7d6496,'userProfileId':_0xd9817a[_0xde63('0x53')]},'raw':!![]})[_0xde63('0x27')](function(_0x4fed90){if(_0x4fed90&&_0x4fed90['autoAssociation']===0x0){return db[_0xde63('0x2b')]['create']({'name':_0x6d2c29[_0xde63('0x2e')],'resourceId':_0x6d2c29['id'],'type':_0x4fed90[_0xde63('0x2e')],'sectionId':_0x4fed90['id']},{})[_0xde63('0x27')](function(){return _0xcd907f;});}else{return _0xcd907f;}})[_0xde63('0x54')](function(_0x1475d8){logger[_0xde63('0x55')](_0xde63('0x56'),_0x1475d8);throw _0x1475d8;});}return _0xcd907f;})[_0xde63('0x27')](respondWithResult(_0x11c3a2,0xc9))['catch'](handleError(_0x11c3a2,null));};exports[_0xde63('0x57')]=function(_0x255dac,_0x219ce5){var _0x507cf7={'where':{'id':_0x255dac['params']['id']}},_0x43083b={};_0x43083b[_0xde63('0x34')]=_[_0xde63('0x4a')](db[_0xde63('0x43')]['rawAttributes']);_0x507cf7[_0xde63('0x38')]=_[_0xde63('0x37')](_0x43083b[_0xde63('0x34')],qs['fields'](_0x255dac[_0xde63('0x35')][_0xde63('0x39')]));_0x507cf7[_0xde63('0x38')]=_0x507cf7[_0xde63('0x38')][_0xde63('0x4c')]?_0x507cf7[_0xde63('0x38')]:_0x43083b[_0xde63('0x34')];if(_0x255dac[_0xde63('0x35')][_0xde63('0x44')]){_0x507cf7[_0xde63('0x45')]=[{'all':!![]}];}_0x507cf7=_[_0xde63('0x40')]({},_0x507cf7,_0x255dac[_0xde63('0x42')]);return db[_0xde63('0x43')][_0xde63('0x52')](_0x507cf7)[_0xde63('0x27')](handleEntityNotFound(_0x219ce5,null))['then'](function(_0x4c0480){if(_0x4c0480){var _0x2e3e41=_0x4c0480[_0xde63('0x29')]({'plain':!![]});_0x2e3e41=qs[_0xde63('0x58')](_0x2e3e41,['id',_0xde63('0x59'),_0xde63('0x5a')]);_0x255dac[_0xde63('0x5b')]=_['omit'](_0x255dac[_0xde63('0x5b')],['id','createdAt',_0xde63('0x5a')]);return db[_0xde63('0x43')]['create'](_['merge'](_0x2e3e41,_0x255dac[_0xde63('0x5b')]),{'include':_0x255dac['query'][_0xde63('0x44')]?[{'all':!![]}]:undefined})[_0xde63('0x27')](function(_0x1069a8){var _0xc475f0=_0x255dac[_0xde63('0x4e')]['get']({'plain':!![]});if(!_0xc475f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc475f0['role']===_0xde63('0x4e')){var _0xbdcb63=_0x1069a8[_0xde63('0x29')]({'plain':!![]});var _0x52b42a=_0xde63('0x2a');return db['UserProfileSection'][_0xde63('0x52')]({'where':{'name':_0x52b42a,'userProfileId':_0xc475f0[_0xde63('0x53')]},'raw':!![]})[_0xde63('0x27')](function(_0x4c389d){if(_0x4c389d&&_0x4c389d[_0xde63('0x5c')]===0x0){return db[_0xde63('0x2b')][_0xde63('0x4d')]({'name':_0xbdcb63[_0xde63('0x2e')],'resourceId':_0xbdcb63['id'],'type':_0x4c389d[_0xde63('0x2e')],'sectionId':_0x4c389d['id']},{})[_0xde63('0x27')](function(){return _0x1069a8;});}else{return _0x1069a8;}})[_0xde63('0x54')](function(_0x1b6d25){logger['error'](_0xde63('0x56'),_0x1b6d25);throw _0x1b6d25;});}return _0x1069a8;});}})[_0xde63('0x27')](respondWithResult(_0x219ce5,0xc9))[_0xde63('0x54')](handleError(_0x219ce5,null));};exports['update']=function(_0x5f4b0c,_0x40a706){if(_0x5f4b0c[_0xde63('0x5b')]['id']){delete _0x5f4b0c[_0xde63('0x5b')]['id'];}return db[_0xde63('0x43')][_0xde63('0x52')]({'where':{'id':_0x5f4b0c[_0xde63('0x49')]['id']}})[_0xde63('0x27')](handleEntityNotFound(_0x40a706,null))['then'](saveUpdates(_0x5f4b0c[_0xde63('0x5b')],null))[_0xde63('0x27')](respondWithResult(_0x40a706,null))[_0xde63('0x54')](handleError(_0x40a706,null));};exports[_0xde63('0x28')]=function(_0x3c136c,_0x3c973e){return db[_0xde63('0x43')]['find']({'where':{'id':_0x3c136c[_0xde63('0x49')]['id']}})[_0xde63('0x27')](handleEntityNotFound(_0x3c973e,null))[_0xde63('0x27')](removeEntity(_0x3c973e,null))[_0xde63('0x54')](handleError(_0x3c973e,null));};function widgetAttributes(_0x2347e8){try{switch(_0x2347e8[_0xde63('0x32')]){case'iframe':return[{'name':'attrUrl','value':_0x2347e8[_0xde63('0x5d')]||(_0x2347e8['attrs']&&_0x2347e8['attrs'][0x0]?_0x2347e8[_0xde63('0x5e')][0x0]['value']:undefined)||_0xde63('0x5f')}];case _0xde63('0x60'):return[{'name':_0xde63('0x61'),'value':_0x2347e8[_0xde63('0x61')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8['attrs'][0x0]?_0x2347e8[_0xde63('0x5e')][0x0]['value']:undefined)||''}];case _0xde63('0x62'):return[{'name':_0xde63('0x63'),'value':_0x2347e8[_0xde63('0x63')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x0]?_0x2347e8[_0xde63('0x5e')][0x0][_0xde63('0x64')]:undefined)||'HH:mm:ss'},{'name':_0xde63('0x65'),'value':_0x2347e8[_0xde63('0x65')]||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x1]?_0x2347e8[_0xde63('0x5e')][0x1][_0xde63('0x64')]:undefined)||'0.00'},{'name':_0xde63('0x66'),'value':_0x2347e8[_0xde63('0x66')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x2]?_0x2347e8['attrs'][0x2][_0xde63('0x64')]:undefined)||0xc}];case _0xde63('0x67'):return[{'name':'attrMetric','value':_0x2347e8[_0xde63('0x68')]||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x0]?_0x2347e8['attrs'][0x0][_0xde63('0x64')]:undefined)||_0xde63('0x69')},{'name':'attrVoiceQueues','value':_0x2347e8[_0xde63('0x6a')]||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x1]?_0x2347e8[_0xde63('0x5e')][0x1][_0xde63('0x64')]:undefined)||[]},{'name':_0xde63('0x66'),'value':_0x2347e8[_0xde63('0x66')]||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x2]?_0x2347e8[_0xde63('0x5e')][0x2][_0xde63('0x64')]:undefined)||0x14},{'name':_0xde63('0x6b'),'value':_0x2347e8[_0xde63('0x6b')]||(_0x2347e8['attrs']&&_0x2347e8['attrs'][0x3]?_0x2347e8[_0xde63('0x5e')][0x3]['value']:undefined)||_0xde63('0x6c')},{'name':'attrEmailAccounts','value':_0x2347e8['attrEmailAccounts']||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x4]?_0x2347e8[_0xde63('0x5e')][0x4][_0xde63('0x64')]:undefined)||''},{'name':_0xde63('0x6d'),'value':_0x2347e8['attrFaxAccounts']||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x5]?_0x2347e8[_0xde63('0x5e')][0x5][_0xde63('0x64')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2347e8['attrSmsAccounts']||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x6]?_0x2347e8[_0xde63('0x5e')][0x6]['value']:undefined)||''},{'name':_0xde63('0x6e'),'value':_0x2347e8['attrOpenchannelAccounts']||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x7]?_0x2347e8[_0xde63('0x5e')][0x7][_0xde63('0x64')]:undefined)||''},{'name':_0xde63('0x6f'),'value':_0x2347e8[_0xde63('0x6f')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8['attrs'][0x8]?_0x2347e8[_0xde63('0x5e')][0x8][_0xde63('0x64')]:undefined)||''},{'name':_0xde63('0x70'),'value':_0x2347e8[_0xde63('0x70')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x9]?_0x2347e8[_0xde63('0x5e')][0x9][_0xde63('0x64')]:undefined)||''}];case _0xde63('0x71'):case _0xde63('0x72'):return[{'name':_0xde63('0x73'),'value':_0x2347e8[_0xde63('0x73')]||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x0]?_0x2347e8[_0xde63('0x5e')][0x0][_0xde63('0x64')]:undefined)||'total'},{'name':_0xde63('0x74'),'value':_0x2347e8[_0xde63('0x74')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x1]?_0x2347e8[_0xde63('0x5e')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x2347e8['attrSerie3']||(_0x2347e8['attrs']&&_0x2347e8['attrs'][0x2]?_0x2347e8[_0xde63('0x5e')][0x2][_0xde63('0x64')]:undefined)||null},{'name':_0xde63('0x6a'),'value':_0x2347e8[_0xde63('0x6a')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x3]?_0x2347e8[_0xde63('0x5e')][0x3][_0xde63('0x64')]:undefined)||[]},{'name':_0xde63('0x6b'),'value':_0x2347e8[_0xde63('0x6b')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x4]?_0x2347e8[_0xde63('0x5e')][0x4][_0xde63('0x64')]:undefined)||_0xde63('0x6c')},{'name':_0xde63('0x75'),'value':_0x2347e8['attrEmailAccounts']||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8['attrs'][0x5]?_0x2347e8[_0xde63('0x5e')][0x5][_0xde63('0x64')]:undefined)||''},{'name':_0xde63('0x6d'),'value':_0x2347e8['attrFaxAccounts']||(_0x2347e8['attrs']&&_0x2347e8['attrs'][0x6]?_0x2347e8[_0xde63('0x5e')][0x6][_0xde63('0x64')]:undefined)||''},{'name':_0xde63('0x76'),'value':_0x2347e8[_0xde63('0x76')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x7]?_0x2347e8['attrs'][0x7][_0xde63('0x64')]:undefined)||''},{'name':_0xde63('0x6e'),'value':_0x2347e8['attrOpenchannelAccounts']||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x8]?_0x2347e8[_0xde63('0x5e')][0x8]['value']:undefined)||''},{'name':_0xde63('0x6f'),'value':_0x2347e8[_0xde63('0x6f')]||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x9]?_0x2347e8[_0xde63('0x5e')][0x9][_0xde63('0x64')]:undefined)||''},{'name':_0xde63('0x70'),'value':_0x2347e8[_0xde63('0x70')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0xa]?_0x2347e8[_0xde63('0x5e')][0xa][_0xde63('0x64')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x2347e8[_0xde63('0x77')]||(_0x2347e8['attrs']&&_0x2347e8[_0xde63('0x5e')][0x0]?_0x2347e8[_0xde63('0x5e')][0x0]['type']:undefined)||null,'value':_0x2347e8['attrReport']||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8['attrs'][0x0]?_0x2347e8[_0xde63('0x5e')][0x0][_0xde63('0x64')]:undefined)||null},{'name':_0xde63('0x78'),'value':_0x2347e8[_0xde63('0x78')]||(_0x2347e8[_0xde63('0x5e')]&&_0x2347e8[_0xde63('0x5e')][0x1]?_0x2347e8[_0xde63('0x5e')][0x1][_0xde63('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x2b6461){logger[_0xde63('0x55')](_0xde63('0x79'),JSON[_0xde63('0x7a')](_0x2b6461));return[];}}exports[_0xde63('0x7b')]=function(_0x59f36f,_0x1f7bcd,_0x31bda1){if(_0x59f36f[_0xde63('0x5b')]['id']){delete _0x59f36f[_0xde63('0x5b')]['id'];}return db[_0xde63('0x43')][_0xde63('0x52')]({'where':{'id':_0x59f36f[_0xde63('0x49')]['id']}})[_0xde63('0x27')](handleEntityNotFound(_0x1f7bcd,null))['then'](function(_0x26ea50){if(_0x26ea50){_0x59f36f[_0xde63('0x5b')]['DashboardId']=_0x26ea50['id'];_0x59f36f[_0xde63('0x5b')][_0xde63('0x5e')]=widgetAttributes(_0x59f36f['body']);return db['DashboardItem'][_0xde63('0x4d')](_0x59f36f[_0xde63('0x5b')]);}})[_0xde63('0x27')](respondWithResult(_0x1f7bcd,null))[_0xde63('0x54')](handleError(_0x1f7bcd,null));};exports['getItems']=function(_0x272a4f,_0x583430,_0x56e6ee){var _0x59c953={};var _0x5a0c7d={};var _0x1f29da;var _0x3fcf45;return db[_0xde63('0x43')][_0xde63('0x7c')]({'where':{'id':_0x272a4f['params']['id']}})[_0xde63('0x27')](handleEntityNotFound(_0x583430,null))[_0xde63('0x27')](function(_0x1c5be8){if(_0x1c5be8){_0x1f29da=_0x1c5be8;_0x5a0c7d[_0xde63('0x34')]=_[_0xde63('0x4a')](db[_0xde63('0x7d')][_0xde63('0x4b')]);_0x5a0c7d['query']=_[_0xde63('0x4a')](_0x272a4f[_0xde63('0x35')]);_0x5a0c7d['filters']=_[_0xde63('0x37')](_0x5a0c7d[_0xde63('0x34')],_0x5a0c7d[_0xde63('0x35')]);_0x59c953[_0xde63('0x38')]=_[_0xde63('0x37')](_0x5a0c7d['model'],qs[_0xde63('0x39')](_0x272a4f['query'][_0xde63('0x39')]));_0x59c953[_0xde63('0x38')]=_0x59c953[_0xde63('0x38')][_0xde63('0x4c')]?_0x59c953[_0xde63('0x38')]:_0x5a0c7d[_0xde63('0x34')];_0x59c953[_0xde63('0x7e')]=qs[_0xde63('0x3c')](_0x272a4f['query'][_0xde63('0x3c')]);_0x59c953['where']=qs[_0xde63('0x36')](_[_0xde63('0x3e')](_0x272a4f[_0xde63('0x35')],_0x5a0c7d[_0xde63('0x36')]));if(_0x272a4f[_0xde63('0x35')][_0xde63('0x3f')]){_0x59c953[_0xde63('0x3d')]=_[_0xde63('0x40')](_0x59c953['where'],{'$or':_['map'](_0x59c953['attributes'],function(_0x30739f){var _0x2dbe0c={};_0x2dbe0c[_0x30739f]={'$like':'%'+_0x272a4f[_0xde63('0x35')][_0xde63('0x3f')]+'%'};return _0x2dbe0c;})});}_0x59c953=_[_0xde63('0x40')]({},_0x59c953,_0x272a4f[_0xde63('0x42')]);return _0x1f29da[_0xde63('0x7f')](_0x59c953);}})[_0xde63('0x27')](function(_0x27f4dc){if(_0x27f4dc){_0x3fcf45=_0x27f4dc[_0xde63('0x4c')];if(!_0x272a4f[_0xde63('0x35')][_0xde63('0x3a')](_0xde63('0x3b'))){_0x59c953[_0xde63('0x1f')]=qs['limit'](_0x272a4f[_0xde63('0x35')][_0xde63('0x1f')]);_0x59c953[_0xde63('0x1d')]=qs[_0xde63('0x1d')](_0x272a4f['query'][_0xde63('0x1d')]);}return _0x1f29da['getItems'](_0x59c953);}})['then'](function(_0x3cc5a3){if(_0x3cc5a3){return _0x3cc5a3?{'count':_0x3fcf45,'rows':_0x3cc5a3}:null;}})['then'](respondWithResult(_0x583430,null))['catch'](handleError(_0x583430,null));}; \ No newline at end of file +var _0x9d4b=['socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','CustomDashboards','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','options','Dashboard','includeAll','rows','catch','show','params','include','create','user','role','UserProfileSection','find','userProfileId','UserProfileResource','clone','createdAt','updatedAt','body','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','filter','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','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/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x3ab370,_0x1972d0){var _0x1b68c6=function(_0x28fc23){while(--_0x28fc23){_0x3ab370['push'](_0x3ab370['shift']());}};_0x1b68c6(++_0x1972d0);}(_0x9d4b,0xea));var _0xb9d4=function(_0x4c0d3f,_0x295c56){_0x4c0d3f=_0x4c0d3f-0x0;var _0x7e4d7d=_0x9d4b[_0x4c0d3f];return _0x7e4d7d;};'use strict';var emlformat=require(_0xb9d4('0x0'));var rimraf=require(_0xb9d4('0x1'));var zipdir=require(_0xb9d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9d4('0x3'));var moment=require(_0xb9d4('0x4'));var BPromise=require(_0xb9d4('0x5'));var Mustache=require('mustache');var util=require(_0xb9d4('0x6'));var path=require(_0xb9d4('0x7'));var sox=require(_0xb9d4('0x8'));var csv=require(_0xb9d4('0x9'));var ejs=require(_0xb9d4('0xa'));var fs=require('fs');var fs_extra=require(_0xb9d4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb9d4('0xc'));var jsforce=require(_0xb9d4('0xd'));var deskjs=require(_0xb9d4('0xe'));var toCsv=require(_0xb9d4('0x9'));var querystring=require(_0xb9d4('0xf'));var Papa=require(_0xb9d4('0x10'));var Redis=require(_0xb9d4('0x11'));var authService=require(_0xb9d4('0x12'));var qs=require(_0xb9d4('0x13'));var as=require(_0xb9d4('0x14'));var hardwareService=require(_0xb9d4('0x15'));var logger=require(_0xb9d4('0x16'))(_0xb9d4('0x17'));var utils=require(_0xb9d4('0x18'));var config=require(_0xb9d4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9d4('0x1a'))['db'];config[_0xb9d4('0x1b')]=_[_0xb9d4('0x1c')](config[_0xb9d4('0x1b')],{'host':_0xb9d4('0x1d'),'port':0x18eb});var socket=require(_0xb9d4('0x1e'))(new Redis(config[_0xb9d4('0x1b')]));require(_0xb9d4('0x1f'))[_0xb9d4('0x20')](socket);function respondWithStatusCode(_0x1d47f6,_0x1cfa63){_0x1cfa63=_0x1cfa63||0xcc;return function(_0x1836f4){if(_0x1836f4){return _0x1d47f6[_0xb9d4('0x21')](_0x1cfa63);}return _0x1d47f6['status'](_0x1cfa63)[_0xb9d4('0x22')]();};}function respondWithResult(_0x1ffeec,_0x330320){_0x330320=_0x330320||0xc8;return function(_0x242c44){if(_0x242c44){return _0x1ffeec[_0xb9d4('0x23')](_0x330320)[_0xb9d4('0x24')](_0x242c44);}};}function respondWithFilteredResult(_0x3efdb6,_0x309848){return function(_0x585967){if(_0x585967){var _0x391939=typeof _0x309848[_0xb9d4('0x25')]==='undefined'&&typeof _0x309848['limit']===_0xb9d4('0x26');var _0x3d3261=_0x585967['count'];var _0xc8b473=_0x391939?0x0:_0x309848[_0xb9d4('0x25')];var _0xaa8f8d=_0x391939?_0x585967[_0xb9d4('0x27')]:_0x309848[_0xb9d4('0x25')]+_0x309848[_0xb9d4('0x28')];var _0x3322c3;if(_0xaa8f8d>=_0x3d3261){_0xaa8f8d=_0x3d3261;_0x3322c3=0xc8;}else{_0x3322c3=0xce;}_0x3efdb6['status'](_0x3322c3);return _0x3efdb6['set'](_0xb9d4('0x29'),_0xc8b473+'-'+_0xaa8f8d+'/'+_0x3d3261)[_0xb9d4('0x24')](_0x585967);}return null;};}function patchUpdates(_0x2c4792){return function(_0x52f1ab){try{jsonpatch[_0xb9d4('0x2a')](_0x52f1ab,_0x2c4792,!![]);}catch(_0x3ef8e4){return BPromise['reject'](_0x3ef8e4);}return _0x52f1ab[_0xb9d4('0x2b')]();};}function saveUpdates(_0x2f8418,_0xc516f8){return function(_0x2d1f28){if(_0x2d1f28){return _0x2d1f28[_0xb9d4('0x2c')](_0x2f8418)[_0xb9d4('0x2d')](function(_0x464fe3){return _0x464fe3;});}return null;};}function removeEntity(_0x4c97a1,_0x494794){return function(_0x679f4a){if(_0x679f4a){return _0x679f4a[_0xb9d4('0x2e')]()['then'](function(){var _0x5b5808=_0x679f4a[_0xb9d4('0x2f')]({'plain':!![]});var _0x52d98c=_0xb9d4('0x30');return db['UserProfileResource'][_0xb9d4('0x2e')]({'where':{'type':_0x52d98c,'resourceId':_0x5b5808['id']}})[_0xb9d4('0x2d')](function(){return _0x679f4a;});})[_0xb9d4('0x2d')](function(){_0x4c97a1[_0xb9d4('0x23')](0xcc)[_0xb9d4('0x22')]();});}};}function handleEntityNotFound(_0xf554b,_0x214425){return function(_0x433ee1){if(!_0x433ee1){_0xf554b[_0xb9d4('0x21')](0x194);}return _0x433ee1;};}function handleError(_0x387db1,_0x810ca1){_0x810ca1=_0x810ca1||0x1f4;return function(_0x5635e9){logger[_0xb9d4('0x31')](_0x5635e9['stack']);if(_0x5635e9[_0xb9d4('0x32')]){delete _0x5635e9['name'];}_0x387db1[_0xb9d4('0x23')](_0x810ca1)[_0xb9d4('0x33')](_0x5635e9);};}exports[_0xb9d4('0x34')]=function(_0x56843c,_0x32725b){var _0x54859b={},_0x177d2b={},_0x5df90e={'count':0x0,'rows':[]};var _0x2e577a=_[_0xb9d4('0x35')](db['Dashboard'][_0xb9d4('0x36')],function(_0x573b91){return{'name':_0x573b91[_0xb9d4('0x37')],'type':_0x573b91[_0xb9d4('0x38')][_0xb9d4('0x39')]};});_0x177d2b[_0xb9d4('0x3a')]=_['map'](_0x2e577a,_0xb9d4('0x32'));_0x177d2b[_0xb9d4('0x3b')]=_[_0xb9d4('0x3c')](_0x56843c['query']);_0x177d2b['filters']=_['intersection'](_0x177d2b[_0xb9d4('0x3a')],_0x177d2b[_0xb9d4('0x3b')]);_0x54859b[_0xb9d4('0x3d')]=_[_0xb9d4('0x3e')](_0x177d2b[_0xb9d4('0x3a')],qs[_0xb9d4('0x3f')](_0x56843c[_0xb9d4('0x3b')]['fields']));_0x54859b['attributes']=_0x54859b['attributes'][_0xb9d4('0x40')]?_0x54859b[_0xb9d4('0x3d')]:_0x177d2b[_0xb9d4('0x3a')];if(!_0x56843c['query']['hasOwnProperty']('nolimit')){_0x54859b[_0xb9d4('0x28')]=qs[_0xb9d4('0x28')](_0x56843c[_0xb9d4('0x3b')][_0xb9d4('0x28')]);_0x54859b[_0xb9d4('0x25')]=qs['offset'](_0x56843c[_0xb9d4('0x3b')][_0xb9d4('0x25')]);}_0x54859b[_0xb9d4('0x41')]=qs['sort'](_0x56843c[_0xb9d4('0x3b')][_0xb9d4('0x42')]);_0x54859b[_0xb9d4('0x43')]=qs[_0xb9d4('0x44')](_[_0xb9d4('0x45')](_0x56843c['query'],_0x177d2b[_0xb9d4('0x44')]),_0x2e577a);if(_0x56843c['query']['filter']){_0x54859b[_0xb9d4('0x43')]=_[_0xb9d4('0x46')](_0x54859b[_0xb9d4('0x43')],{'$or':_[_0xb9d4('0x35')](_0x2e577a,function(_0x1c6537){if(_0x1c6537[_0xb9d4('0x38')]!==_0xb9d4('0x47')){var _0x5e20ed={};_0x5e20ed[_0x1c6537[_0xb9d4('0x32')]]={'$like':'%'+_0x56843c[_0xb9d4('0x3b')]['filter']+'%'};return _0x5e20ed;}})});}_0x54859b=_[_0xb9d4('0x46')]({},_0x54859b,_0x56843c[_0xb9d4('0x48')]);var _0x3de6d6={'where':_0x54859b[_0xb9d4('0x43')]};return db[_0xb9d4('0x49')][_0xb9d4('0x27')](_0x3de6d6)[_0xb9d4('0x2d')](function(_0x5ae0e2){_0x5df90e[_0xb9d4('0x27')]=_0x5ae0e2;if(_0x56843c['query'][_0xb9d4('0x4a')]){_0x54859b['include']=[{'all':!![]}];}return db[_0xb9d4('0x49')]['findAll'](_0x54859b);})[_0xb9d4('0x2d')](function(_0x2f7b7f){_0x5df90e[_0xb9d4('0x4b')]=_0x2f7b7f;return _0x5df90e;})[_0xb9d4('0x2d')](respondWithFilteredResult(_0x32725b,_0x54859b))[_0xb9d4('0x4c')](handleError(_0x32725b,null));};exports[_0xb9d4('0x4d')]=function(_0x5348c7,_0xca5882){var _0x47f1f3={'raw':![],'where':{'id':_0x5348c7[_0xb9d4('0x4e')]['id']}},_0x335d74={};_0x335d74[_0xb9d4('0x3a')]=_[_0xb9d4('0x3c')](db['Dashboard'][_0xb9d4('0x36')]);_0x335d74[_0xb9d4('0x3b')]=_[_0xb9d4('0x3c')](_0x5348c7[_0xb9d4('0x3b')]);_0x335d74[_0xb9d4('0x44')]=_[_0xb9d4('0x3e')](_0x335d74['model'],_0x335d74['query']);_0x47f1f3[_0xb9d4('0x3d')]=_[_0xb9d4('0x3e')](_0x335d74[_0xb9d4('0x3a')],qs['fields'](_0x5348c7[_0xb9d4('0x3b')][_0xb9d4('0x3f')]));_0x47f1f3[_0xb9d4('0x3d')]=_0x47f1f3[_0xb9d4('0x3d')][_0xb9d4('0x40')]?_0x47f1f3[_0xb9d4('0x3d')]:_0x335d74[_0xb9d4('0x3a')];if(_0x5348c7[_0xb9d4('0x3b')]['includeAll']){_0x47f1f3[_0xb9d4('0x4f')]=[{'all':!![]}];}_0x47f1f3=_[_0xb9d4('0x46')]({},_0x47f1f3,_0x5348c7['options']);return db['Dashboard']['find'](_0x47f1f3)[_0xb9d4('0x2d')](handleEntityNotFound(_0xca5882,null))[_0xb9d4('0x2d')](respondWithResult(_0xca5882,null))[_0xb9d4('0x4c')](handleError(_0xca5882,null));};exports[_0xb9d4('0x50')]=function(_0x3f86f3,_0x524b0d){return db['Dashboard'][_0xb9d4('0x50')](_0x3f86f3['body'],{})['then'](function(_0x482d41){var _0x5375cb=_0x3f86f3[_0xb9d4('0x51')][_0xb9d4('0x2f')]({'plain':!![]});if(!_0x5375cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5375cb[_0xb9d4('0x52')]===_0xb9d4('0x51')){var _0x5c512d=_0x482d41['get']({'plain':!![]});var _0x3cd3c8='CustomDashboards';return db[_0xb9d4('0x53')][_0xb9d4('0x54')]({'where':{'name':_0x3cd3c8,'userProfileId':_0x5375cb[_0xb9d4('0x55')]},'raw':!![]})[_0xb9d4('0x2d')](function(_0x89179f){if(_0x89179f&&_0x89179f['autoAssociation']===0x0){return db[_0xb9d4('0x56')][_0xb9d4('0x50')]({'name':_0x5c512d[_0xb9d4('0x32')],'resourceId':_0x5c512d['id'],'type':_0x89179f[_0xb9d4('0x32')],'sectionId':_0x89179f['id']},{})['then'](function(){return _0x482d41;});}else{return _0x482d41;}})[_0xb9d4('0x4c')](function(_0x38980f){logger[_0xb9d4('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38980f);throw _0x38980f;});}return _0x482d41;})[_0xb9d4('0x2d')](respondWithResult(_0x524b0d,0xc9))['catch'](handleError(_0x524b0d,null));};exports[_0xb9d4('0x57')]=function(_0x4f184e,_0x1cc824){var _0x520374={'where':{'id':_0x4f184e[_0xb9d4('0x4e')]['id']}},_0x3298a6={};_0x3298a6[_0xb9d4('0x3a')]=_[_0xb9d4('0x3c')](db[_0xb9d4('0x49')]['rawAttributes']);_0x520374[_0xb9d4('0x3d')]=_[_0xb9d4('0x3e')](_0x3298a6['model'],qs['fields'](_0x4f184e[_0xb9d4('0x3b')][_0xb9d4('0x3f')]));_0x520374['attributes']=_0x520374['attributes']['length']?_0x520374[_0xb9d4('0x3d')]:_0x3298a6['model'];if(_0x4f184e[_0xb9d4('0x3b')]['includeAll']){_0x520374['include']=[{'all':!![]}];}_0x520374=_[_0xb9d4('0x46')]({},_0x520374,_0x4f184e[_0xb9d4('0x48')]);return db[_0xb9d4('0x49')][_0xb9d4('0x54')](_0x520374)[_0xb9d4('0x2d')](handleEntityNotFound(_0x1cc824,null))[_0xb9d4('0x2d')](function(_0x580987){if(_0x580987){var _0x4e95d7=_0x580987[_0xb9d4('0x2f')]({'plain':!![]});_0x4e95d7=qs['omit'](_0x4e95d7,['id',_0xb9d4('0x58'),_0xb9d4('0x59')]);_0x4f184e[_0xb9d4('0x5a')]=_[_0xb9d4('0x5b')](_0x4f184e[_0xb9d4('0x5a')],['id',_0xb9d4('0x58'),_0xb9d4('0x59')]);return db['Dashboard'][_0xb9d4('0x50')](_[_0xb9d4('0x46')](_0x4e95d7,_0x4f184e[_0xb9d4('0x5a')]),{'include':_0x4f184e[_0xb9d4('0x3b')][_0xb9d4('0x4a')]?[{'all':!![]}]:undefined})[_0xb9d4('0x2d')](function(_0x40e185){var _0x3fe701=_0x4f184e[_0xb9d4('0x51')][_0xb9d4('0x2f')]({'plain':!![]});if(!_0x3fe701)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fe701[_0xb9d4('0x52')]===_0xb9d4('0x51')){var _0x2317bd=_0x40e185['get']({'plain':!![]});var _0x3eb9fb=_0xb9d4('0x30');return db[_0xb9d4('0x53')][_0xb9d4('0x54')]({'where':{'name':_0x3eb9fb,'userProfileId':_0x3fe701[_0xb9d4('0x55')]},'raw':!![]})[_0xb9d4('0x2d')](function(_0x1a0db9){if(_0x1a0db9&&_0x1a0db9['autoAssociation']===0x0){return db[_0xb9d4('0x56')]['create']({'name':_0x2317bd['name'],'resourceId':_0x2317bd['id'],'type':_0x1a0db9['name'],'sectionId':_0x1a0db9['id']},{})[_0xb9d4('0x2d')](function(){return _0x40e185;});}else{return _0x40e185;}})[_0xb9d4('0x4c')](function(_0x395fc0){logger[_0xb9d4('0x31')](_0xb9d4('0x5c'),_0x395fc0);throw _0x395fc0;});}return _0x40e185;});}})[_0xb9d4('0x2d')](respondWithResult(_0x1cc824,0xc9))['catch'](handleError(_0x1cc824,null));};exports[_0xb9d4('0x2c')]=function(_0x2d7e42,_0x54fbea){if(_0x2d7e42[_0xb9d4('0x5a')]['id']){delete _0x2d7e42[_0xb9d4('0x5a')]['id'];}return db[_0xb9d4('0x49')][_0xb9d4('0x54')]({'where':{'id':_0x2d7e42[_0xb9d4('0x4e')]['id']}})[_0xb9d4('0x2d')](handleEntityNotFound(_0x54fbea,null))[_0xb9d4('0x2d')](saveUpdates(_0x2d7e42[_0xb9d4('0x5a')],null))[_0xb9d4('0x2d')](respondWithResult(_0x54fbea,null))[_0xb9d4('0x4c')](handleError(_0x54fbea,null));};exports[_0xb9d4('0x2e')]=function(_0x478797,_0xc021a4){return db[_0xb9d4('0x49')][_0xb9d4('0x54')]({'where':{'id':_0x478797['params']['id']}})[_0xb9d4('0x2d')](handleEntityNotFound(_0xc021a4,null))[_0xb9d4('0x2d')](removeEntity(_0xc021a4,null))[_0xb9d4('0x4c')](handleError(_0xc021a4,null));};function widgetAttributes(_0x23ee16){try{switch(_0x23ee16[_0xb9d4('0x38')]){case'iframe':return[{'name':_0xb9d4('0x5d'),'value':_0x23ee16[_0xb9d4('0x5d')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16['attrs'][0x0]?_0x23ee16[_0xb9d4('0x5e')][0x0][_0xb9d4('0x5f')]:undefined)||_0xb9d4('0x60')}];case _0xb9d4('0x61'):return[{'name':'attrPath','value':_0x23ee16['attrPath']||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x0]?_0x23ee16[_0xb9d4('0x5e')][0x0][_0xb9d4('0x5f')]:undefined)||''}];case _0xb9d4('0x62'):return[{'name':_0xb9d4('0x63'),'value':_0x23ee16['attrHourFormat']||(_0x23ee16['attrs']&&_0x23ee16['attrs'][0x0]?_0x23ee16[_0xb9d4('0x5e')][0x0]['value']:undefined)||_0xb9d4('0x64')},{'name':_0xb9d4('0x65'),'value':_0x23ee16['attrTimezone']||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x1]?_0x23ee16[_0xb9d4('0x5e')][0x1]['value']:undefined)||_0xb9d4('0x66')},{'name':_0xb9d4('0x67'),'value':_0x23ee16[_0xb9d4('0x67')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x2]?_0x23ee16[_0xb9d4('0x5e')][0x2]['value']:undefined)||0xc}];case _0xb9d4('0x68'):return[{'name':'attrMetric','value':_0x23ee16['attrMetric']||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16['attrs'][0x0]?_0x23ee16[_0xb9d4('0x5e')][0x0][_0xb9d4('0x5f')]:undefined)||_0xb9d4('0x69')},{'name':_0xb9d4('0x6a'),'value':_0x23ee16[_0xb9d4('0x6a')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x1]?_0x23ee16[_0xb9d4('0x5e')][0x1][_0xb9d4('0x5f')]:undefined)||[]},{'name':_0xb9d4('0x67'),'value':_0x23ee16[_0xb9d4('0x67')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x2]?_0x23ee16['attrs'][0x2]['value']:undefined)||0x14},{'name':_0xb9d4('0x6b'),'value':_0x23ee16[_0xb9d4('0x6b')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x3]?_0x23ee16[_0xb9d4('0x5e')][0x3]['value']:undefined)||'voice'},{'name':_0xb9d4('0x6c'),'value':_0x23ee16[_0xb9d4('0x6c')]||(_0x23ee16['attrs']&&_0x23ee16[_0xb9d4('0x5e')][0x4]?_0x23ee16[_0xb9d4('0x5e')][0x4]['value']:undefined)||''},{'name':_0xb9d4('0x6d'),'value':_0x23ee16[_0xb9d4('0x6d')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x5]?_0x23ee16['attrs'][0x5][_0xb9d4('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x23ee16[_0xb9d4('0x6e')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16['attrs'][0x6]?_0x23ee16[_0xb9d4('0x5e')][0x6]['value']:undefined)||''},{'name':_0xb9d4('0x6f'),'value':_0x23ee16[_0xb9d4('0x6f')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x7]?_0x23ee16['attrs'][0x7]['value']:undefined)||''},{'name':_0xb9d4('0x70'),'value':_0x23ee16[_0xb9d4('0x70')]||(_0x23ee16['attrs']&&_0x23ee16[_0xb9d4('0x5e')][0x8]?_0x23ee16[_0xb9d4('0x5e')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x23ee16[_0xb9d4('0x71')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x9]?_0x23ee16[_0xb9d4('0x5e')][0x9][_0xb9d4('0x5f')]:undefined)||''}];case _0xb9d4('0x72'):case _0xb9d4('0x73'):return[{'name':_0xb9d4('0x74'),'value':_0x23ee16[_0xb9d4('0x74')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x0]?_0x23ee16[_0xb9d4('0x5e')][0x0][_0xb9d4('0x5f')]:undefined)||_0xb9d4('0x69')},{'name':_0xb9d4('0x75'),'value':_0x23ee16[_0xb9d4('0x75')]||(_0x23ee16['attrs']&&_0x23ee16[_0xb9d4('0x5e')][0x1]?_0x23ee16[_0xb9d4('0x5e')][0x1]['value']:undefined)||null},{'name':_0xb9d4('0x76'),'value':_0x23ee16[_0xb9d4('0x76')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x2]?_0x23ee16['attrs'][0x2][_0xb9d4('0x5f')]:undefined)||null},{'name':_0xb9d4('0x6a'),'value':_0x23ee16[_0xb9d4('0x6a')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16['attrs'][0x3]?_0x23ee16[_0xb9d4('0x5e')][0x3][_0xb9d4('0x5f')]:undefined)||[]},{'name':'attrChannel','value':_0x23ee16[_0xb9d4('0x6b')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x4]?_0x23ee16[_0xb9d4('0x5e')][0x4][_0xb9d4('0x5f')]:undefined)||_0xb9d4('0x77')},{'name':_0xb9d4('0x6c'),'value':_0x23ee16[_0xb9d4('0x6c')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x5]?_0x23ee16[_0xb9d4('0x5e')][0x5][_0xb9d4('0x5f')]:undefined)||''},{'name':_0xb9d4('0x6d'),'value':_0x23ee16[_0xb9d4('0x6d')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16['attrs'][0x6]?_0x23ee16[_0xb9d4('0x5e')][0x6]['value']:undefined)||''},{'name':_0xb9d4('0x6e'),'value':_0x23ee16[_0xb9d4('0x6e')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16['attrs'][0x7]?_0x23ee16[_0xb9d4('0x5e')][0x7][_0xb9d4('0x5f')]:undefined)||''},{'name':_0xb9d4('0x6f'),'value':_0x23ee16[_0xb9d4('0x6f')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0x8]?_0x23ee16['attrs'][0x8][_0xb9d4('0x5f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x23ee16[_0xb9d4('0x70')]||(_0x23ee16['attrs']&&_0x23ee16[_0xb9d4('0x5e')][0x9]?_0x23ee16[_0xb9d4('0x5e')][0x9]['value']:undefined)||''},{'name':_0xb9d4('0x71'),'value':_0x23ee16[_0xb9d4('0x71')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16[_0xb9d4('0x5e')][0xa]?_0x23ee16[_0xb9d4('0x5e')][0xa][_0xb9d4('0x5f')]:undefined)||''}];case _0xb9d4('0x78'):return[{'name':_0xb9d4('0x79'),'type':_0x23ee16[_0xb9d4('0x7a')]||(_0x23ee16[_0xb9d4('0x5e')]&&_0x23ee16['attrs'][0x0]?_0x23ee16['attrs'][0x0]['type']:undefined)||null,'value':_0x23ee16[_0xb9d4('0x79')]||(_0x23ee16['attrs']&&_0x23ee16[_0xb9d4('0x5e')][0x0]?_0x23ee16['attrs'][0x0][_0xb9d4('0x5f')]:undefined)||null},{'name':_0xb9d4('0x7b'),'value':_0x23ee16[_0xb9d4('0x7b')]||(_0x23ee16['attrs']&&_0x23ee16[_0xb9d4('0x5e')][0x1]?_0x23ee16[_0xb9d4('0x5e')][0x1][_0xb9d4('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x30fd98){logger[_0xb9d4('0x31')]('widgetAttributes:\x20%s',JSON[_0xb9d4('0x7c')](_0x30fd98));return[];}}exports['addItem']=function(_0x3bfdc9,_0x49b477,_0x1f5b1d){if(_0x3bfdc9[_0xb9d4('0x5a')]['id']){delete _0x3bfdc9[_0xb9d4('0x5a')]['id'];}return db[_0xb9d4('0x49')][_0xb9d4('0x54')]({'where':{'id':_0x3bfdc9[_0xb9d4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49b477,null))[_0xb9d4('0x2d')](function(_0xc8b6a2){if(_0xc8b6a2){_0x3bfdc9['body'][_0xb9d4('0x7d')]=_0xc8b6a2['id'];_0x3bfdc9['body']['attrs']=widgetAttributes(_0x3bfdc9['body']);return db[_0xb9d4('0x7e')][_0xb9d4('0x50')](_0x3bfdc9['body']);}})[_0xb9d4('0x2d')](respondWithResult(_0x49b477,null))[_0xb9d4('0x4c')](handleError(_0x49b477,null));};exports[_0xb9d4('0x7f')]=function(_0x15897f,_0x4c3379,_0x29388b){var _0x44fde9={};var _0x2efb73={};var _0x1cccfc;var _0x366de7;return db[_0xb9d4('0x49')][_0xb9d4('0x80')]({'where':{'id':_0x15897f['params']['id']}})[_0xb9d4('0x2d')](handleEntityNotFound(_0x4c3379,null))[_0xb9d4('0x2d')](function(_0x5912f2){if(_0x5912f2){_0x1cccfc=_0x5912f2;_0x2efb73[_0xb9d4('0x3a')]=_['keys'](db[_0xb9d4('0x7e')][_0xb9d4('0x36')]);_0x2efb73[_0xb9d4('0x3b')]=_[_0xb9d4('0x3c')](_0x15897f[_0xb9d4('0x3b')]);_0x2efb73[_0xb9d4('0x44')]=_[_0xb9d4('0x3e')](_0x2efb73['model'],_0x2efb73[_0xb9d4('0x3b')]);_0x44fde9[_0xb9d4('0x3d')]=_['intersection'](_0x2efb73[_0xb9d4('0x3a')],qs['fields'](_0x15897f[_0xb9d4('0x3b')][_0xb9d4('0x3f')]));_0x44fde9[_0xb9d4('0x3d')]=_0x44fde9[_0xb9d4('0x3d')]['length']?_0x44fde9[_0xb9d4('0x3d')]:_0x2efb73[_0xb9d4('0x3a')];_0x44fde9['order']=qs[_0xb9d4('0x42')](_0x15897f[_0xb9d4('0x3b')]['sort']);_0x44fde9['where']=qs[_0xb9d4('0x44')](_['pick'](_0x15897f[_0xb9d4('0x3b')],_0x2efb73[_0xb9d4('0x44')]));if(_0x15897f[_0xb9d4('0x3b')][_0xb9d4('0x81')]){_0x44fde9[_0xb9d4('0x43')]=_[_0xb9d4('0x46')](_0x44fde9[_0xb9d4('0x43')],{'$or':_['map'](_0x44fde9['attributes'],function(_0x2acb02){var _0x3d4379={};_0x3d4379[_0x2acb02]={'$like':'%'+_0x15897f[_0xb9d4('0x3b')]['filter']+'%'};return _0x3d4379;})});}_0x44fde9=_[_0xb9d4('0x46')]({},_0x44fde9,_0x15897f[_0xb9d4('0x48')]);return _0x1cccfc[_0xb9d4('0x7f')](_0x44fde9);}})['then'](function(_0x4798ec){if(_0x4798ec){_0x366de7=_0x4798ec[_0xb9d4('0x40')];if(!_0x15897f[_0xb9d4('0x3b')][_0xb9d4('0x82')](_0xb9d4('0x83'))){_0x44fde9[_0xb9d4('0x28')]=qs[_0xb9d4('0x28')](_0x15897f['query'][_0xb9d4('0x28')]);_0x44fde9['offset']=qs[_0xb9d4('0x25')](_0x15897f[_0xb9d4('0x3b')][_0xb9d4('0x25')]);}return _0x1cccfc[_0xb9d4('0x7f')](_0x44fde9);}})['then'](function(_0x10d82c){if(_0x10d82c){return _0x10d82c?{'count':_0x366de7,'rows':_0x10d82c}:null;}})['then'](respondWithResult(_0x4c3379,null))[_0xb9d4('0x4c')](handleError(_0x4c3379,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 872a013..8902612 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 _0xcf90=['Dashboard','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x1f1272,_0x53ff8b){var _0x1416ab=function(_0x2f7c90){while(--_0x2f7c90){_0x1f1272['push'](_0x1f1272['shift']());}};_0x1416ab(++_0x53ff8b);}(_0xcf90,0xe9));var _0x0cf9=function(_0x278669,_0x5109ff){_0x278669=_0x278669-0x0;var _0x1e74cf=_0xcf90[_0x278669];return _0x1e74cf;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x0cf9('0x0'))['db'][_0x0cf9('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0cf9('0x2')](0x0);var events={'afterCreate':_0x0cf9('0x3'),'afterUpdate':_0x0cf9('0x4'),'afterDestroy':_0x0cf9('0x5')};function emitEvent(_0x4076de){return function(_0x2627b1,_0xfa6d81,_0x2e96ac){DashboardEvents['emit'](_0x4076de+':'+_0x2627b1['id'],_0x2627b1);DashboardEvents[_0x0cf9('0x6')](_0x4076de,_0x2627b1);_0x2e96ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x0cf9('0x7')](e,emitEvent(event));}}module[_0x0cf9('0x8')]=DashboardEvents; \ No newline at end of file +var _0xa0a1=['hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','save','emit'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x178a9c,_0x562a28){_0x178a9c=_0x178a9c-0x0;var _0x3fd933=_0xa0a1[_0x178a9c];return _0x3fd933;};'use strict';var EventEmitter=require(_0x1a0a('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x1a0a('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1a0a('0x2')](0x0);var events={'afterCreate':_0x1a0a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xeaff7a){return function(_0x22f069,_0x5114de,_0x27077a){DashboardEvents[_0x1a0a('0x4')](_0xeaff7a+':'+_0x22f069['id'],_0x22f069);DashboardEvents['emit'](_0xeaff7a,_0x22f069);_0x27077a(null);};}for(var e in events){if(events[_0x1a0a('0x5')](e)){var event=events[e];Dashboard[_0x1a0a('0x6')](e,emitEvent(event));}}module[_0x1a0a('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 0078e65..e1363b9 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 _0x4e52=['rimraf','../../config/environment','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x4e52,0x6e));var _0x24e5=function(_0x5b2f95,_0x4be9b8){_0x5b2f95=_0x5b2f95-0x0;var _0x55af1f=_0x4e52[_0x5b2f95];return _0x55af1f;};'use strict';var _=require(_0x24e5('0x0'));var util=require(_0x24e5('0x1'));var logger=require(_0x24e5('0x2'))(_0x24e5('0x3'));var moment=require(_0x24e5('0x4'));var BPromise=require('bluebird');var rp=require(_0x24e5('0x5'));var fs=require('fs');var path=require(_0x24e5('0x6'));var rimraf=require(_0x24e5('0x7'));var config=require(_0x24e5('0x8'));var attributes=require('./dashboard.attributes');module[_0x24e5('0x9')]=function(_0x10f78d,_0x539a1a){return _0x10f78d[_0x24e5('0xa')](_0x24e5('0xb'),attributes,{'tableName':_0x24e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3093=['define','Dashboard','dashboards','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x350862,_0x28b0de){var _0x48fa78=function(_0x3d0b68){while(--_0x3d0b68){_0x350862['push'](_0x350862['shift']());}};_0x48fa78(++_0x28b0de);}(_0x3093,0x183));var _0x3309=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x3093[_0x32d457];return _0x338386;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3309('0x0'))('api');var moment=require(_0x3309('0x1'));var BPromise=require(_0x3309('0x2'));var rp=require(_0x3309('0x3'));var fs=require('fs');var path=require(_0x3309('0x4'));var rimraf=require(_0x3309('0x5'));var config=require(_0x3309('0x6'));var attributes=require(_0x3309('0x7'));module[_0x3309('0x8')]=function(_0x1d3143,_0x31c3a6){return _0x1d3143[_0x3309('0x9')](_0x3309('0xa'),attributes,{'tableName':_0x3309('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index d46ec83..047d990 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 _0x2ee2=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x5e6183,_0x9b8e03){var _0x4e35fa=function(_0x23886c){while(--_0x23886c){_0x5e6183['push'](_0x5e6183['shift']());}};_0x4e35fa(++_0x9b8e03);}(_0x2ee2,0x69));var _0x22ee=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x2ee2[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x22ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x22ee('0x1'));var rs=require(_0x22ee('0x2'));var fs=require('fs');var Redis=require(_0x22ee('0x3'));var db=require(_0x22ee('0x4'))['db'];var utils=require(_0x22ee('0x5'));var logger=require(_0x22ee('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22ee('0x7'));var client=jayson[_0x22ee('0x8')][_0x22ee('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x22ee('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x22ee('0xb'))[_0x22ee('0xc')](socket);function respondWithRpcPromise(_0x3013d0,_0x226356,_0x344300){return new BPromise(function(_0x4af4ad,_0x398631){return client[_0x22ee('0xd')](_0x3013d0,_0x344300)[_0x22ee('0xe')](function(_0x5292dd){logger[_0x22ee('0xf')](_0x22ee('0x10'),_0x226356,_0x22ee('0x11'));logger[_0x22ee('0x12')](_0x22ee('0x13'),_0x226356,_0x22ee('0x11'),JSON['stringify'](_0x5292dd));if(_0x5292dd[_0x22ee('0x14')]){if(_0x5292dd[_0x22ee('0x14')][_0x22ee('0x15')]===0x1f4){logger['error'](_0x22ee('0x10'),_0x226356,_0x5292dd[_0x22ee('0x14')][_0x22ee('0x16')]);return _0x398631(_0x5292dd[_0x22ee('0x14')][_0x22ee('0x16')]);}logger[_0x22ee('0x14')]('Dashboard,\x20%s,\x20%s',_0x226356,_0x5292dd[_0x22ee('0x14')][_0x22ee('0x16')]);return _0x4af4ad(_0x5292dd[_0x22ee('0x14')][_0x22ee('0x16')]);}else{logger[_0x22ee('0xf')](_0x22ee('0x10'),_0x226356,_0x22ee('0x11'));_0x4af4ad(_0x5292dd[_0x22ee('0x17')][_0x22ee('0x16')]);}})[_0x22ee('0x18')](function(_0x16dfdc){logger[_0x22ee('0x14')](_0x22ee('0x10'),_0x226356,_0x16dfdc);_0x398631(_0x16dfdc);});});} \ No newline at end of file +var _0x0fe1=['info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request'];(function(_0x3cba1d,_0x2825ae){var _0x5f192b=function(_0x32ff5d){while(--_0x32ff5d){_0x3cba1d['push'](_0x3cba1d['shift']());}};_0x5f192b(++_0x2825ae);}(_0x0fe1,0x19f));var _0x10fe=function(_0x4eed04,_0x310fe4){_0x4eed04=_0x4eed04-0x0;var _0x473c4f=_0x0fe1[_0x4eed04];return _0x473c4f;};'use strict';var _=require(_0x10fe('0x0'));var util=require(_0x10fe('0x1'));var moment=require(_0x10fe('0x2'));var BPromise=require(_0x10fe('0x3'));var rs=require(_0x10fe('0x4'));var fs=require('fs');var Redis=require(_0x10fe('0x5'));var db=require(_0x10fe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x10fe('0x7'))(_0x10fe('0x8'));var config=require('../../config/environment');var jayson=require(_0x10fe('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x10fe('0xa')]=_[_0x10fe('0xb')](config[_0x10fe('0xa')],{'host':_0x10fe('0xc'),'port':0x18eb});var socket=require(_0x10fe('0xd'))(new Redis(config[_0x10fe('0xa')]));require(_0x10fe('0xe'))[_0x10fe('0xf')](socket);function respondWithRpcPromise(_0x568098,_0x3e135a,_0x4f7e09){return new BPromise(function(_0xf36ebf,_0x5336a7){return client[_0x10fe('0x10')](_0x568098,_0x4f7e09)['then'](function(_0x149c49){logger[_0x10fe('0x11')](_0x10fe('0x12'),_0x3e135a,_0x10fe('0x13'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x3e135a,_0x10fe('0x13'),JSON[_0x10fe('0x14')](_0x149c49));if(_0x149c49['error']){if(_0x149c49[_0x10fe('0x15')]['code']===0x1f4){logger[_0x10fe('0x15')](_0x10fe('0x12'),_0x3e135a,_0x149c49[_0x10fe('0x15')][_0x10fe('0x16')]);return _0x5336a7(_0x149c49['error']['message']);}logger[_0x10fe('0x15')]('Dashboard,\x20%s,\x20%s',_0x3e135a,_0x149c49[_0x10fe('0x15')]['message']);return _0xf36ebf(_0x149c49[_0x10fe('0x15')][_0x10fe('0x16')]);}else{logger[_0x10fe('0x11')](_0x10fe('0x12'),_0x3e135a,_0x10fe('0x13'));_0xf36ebf(_0x149c49[_0x10fe('0x17')]['message']);}})['catch'](function(_0x3759e3){logger[_0x10fe('0x15')](_0x10fe('0x12'),_0x3e135a,_0x3759e3);_0x5336a7(_0x3759e3);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b88008f..2e40875 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 _0xa987=['length','dashboard:','./dashboard.events','save','update','removeListener','register'];(function(_0x5828d0,_0x2c3e93){var _0x239b02=function(_0x702fe4){while(--_0x702fe4){_0x5828d0['push'](_0x5828d0['shift']());}};_0x239b02(++_0x2c3e93);}(_0xa987,0xbf));var _0x7a98=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa987[_0x4a53d];return _0x27410e;};'use strict';var DashboardEvents=require(_0x7a98('0x0'));var events=[_0x7a98('0x1'),'remove',_0x7a98('0x2')];function createListener(_0x1e4b24,_0x1be906){return function(_0x43d31d){_0x1be906['emit'](_0x1e4b24,_0x43d31d);};}function removeListener(_0x4b0fc4,_0x3a1b73){return function(){DashboardEvents[_0x7a98('0x3')](_0x4b0fc4,_0x3a1b73);};}exports[_0x7a98('0x4')]=function(_0x5a307f){for(var _0x2a3de0=0x0,_0xd23fbb=events[_0x7a98('0x5')];_0x2a3de0<_0xd23fbb;_0x2a3de0++){var _0x467d89=events[_0x2a3de0];var _0x4c4e54=createListener(_0x7a98('0x6')+_0x467d89,_0x5a307f);DashboardEvents['on'](_0x467d89,_0x4c4e54);}}; \ No newline at end of file +var _0xcd15=['./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0xda1e2,_0x4f979b){var _0x4e9706=function(_0x277d42){while(--_0x277d42){_0xda1e2['push'](_0xda1e2['shift']());}};_0x4e9706(++_0x4f979b);}(_0xcd15,0xb8));var _0x5cd1=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0xcd15[_0x5a2d95];return _0x2c3986;};'use strict';var DashboardEvents=require(_0x5cd1('0x0'));var events=[_0x5cd1('0x1'),_0x5cd1('0x2'),_0x5cd1('0x3')];function createListener(_0x405bac,_0x5b56ee){return function(_0x5c8789){_0x5b56ee[_0x5cd1('0x4')](_0x405bac,_0x5c8789);};}function removeListener(_0x5cbe68,_0x543af){return function(){DashboardEvents[_0x5cd1('0x5')](_0x5cbe68,_0x543af);};}exports[_0x5cd1('0x6')]=function(_0x15e36e){for(var _0x1dc754=0x0,_0x3c68e8=events[_0x5cd1('0x7')];_0x1dc754<_0x3c68e8;_0x1dc754++){var _0x328e41=events[_0x1dc754];var _0x597ea7=createListener('dashboard:'+_0x328e41,_0x15e36e);DashboardEvents['on'](_0x328e41,_0x597ea7);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 5bea6cc..b4be036 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 _0xab63=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./dashboard.controller','get','isAuthenticated','index','/:id/items','post','/:id/clone','clone','addItem','/:id','update','delete','destroy'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xab63,0xb1));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ab6('0x0'));var util=require(_0x3ab6('0x1'));var path=require(_0x3ab6('0x2'));var timeout=require(_0x3ab6('0x3'));var express=require(_0x3ab6('0x4'));var router=express[_0x3ab6('0x5')]();var fs_extra=require(_0x3ab6('0x6'));var auth=require(_0x3ab6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3ab6('0x8'));router[_0x3ab6('0x9')]('/',auth[_0x3ab6('0xa')](),controller[_0x3ab6('0xb')]);router[_0x3ab6('0x9')]('/:id',auth[_0x3ab6('0xa')](),controller['show']);router['get'](_0x3ab6('0xc'),auth[_0x3ab6('0xa')](),controller['getItems']);router[_0x3ab6('0xd')]('/',auth[_0x3ab6('0xa')](),controller['create']);router[_0x3ab6('0xd')](_0x3ab6('0xe'),auth[_0x3ab6('0xa')](),controller[_0x3ab6('0xf')]);router[_0x3ab6('0xd')]('/:id/items',auth['isAuthenticated'](),controller[_0x3ab6('0x10')]);router['put'](_0x3ab6('0x11'),auth['isAuthenticated'](),controller[_0x3ab6('0x12')]);router[_0x3ab6('0x13')](_0x3ab6('0x11'),auth[_0x3ab6('0xa')](),controller[_0x3ab6('0x14')]);module[_0x3ab6('0x15')]=router; \ No newline at end of file +var _0xee6f=['addItem','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','/:id/clone','clone'];(function(_0x4f909d,_0x6b8e92){var _0x200af9=function(_0xa965da){while(--_0xa965da){_0x4f909d['push'](_0x4f909d['shift']());}};_0x200af9(++_0x6b8e92);}(_0xee6f,0x186));var _0xfee6=function(_0x3cb11b,_0xfd38f4){_0x3cb11b=_0x3cb11b-0x0;var _0x37b8fc=_0xee6f[_0x3cb11b];return _0x37b8fc;};'use strict';var multer=require('multer');var util=require(_0xfee6('0x0'));var path=require(_0xfee6('0x1'));var timeout=require(_0xfee6('0x2'));var express=require(_0xfee6('0x3'));var router=express['Router']();var fs_extra=require(_0xfee6('0x4'));var auth=require(_0xfee6('0x5'));var interaction=require(_0xfee6('0x6'));var config=require(_0xfee6('0x7'));var controller=require('./dashboard.controller');router[_0xfee6('0x8')]('/',auth[_0xfee6('0x9')](),controller[_0xfee6('0xa')]);router[_0xfee6('0x8')](_0xfee6('0xb'),auth['isAuthenticated'](),controller[_0xfee6('0xc')]);router[_0xfee6('0x8')](_0xfee6('0xd'),auth[_0xfee6('0x9')](),controller[_0xfee6('0xe')]);router[_0xfee6('0xf')]('/',auth[_0xfee6('0x9')](),controller['create']);router[_0xfee6('0xf')](_0xfee6('0x10'),auth['isAuthenticated'](),controller[_0xfee6('0x11')]);router[_0xfee6('0xf')](_0xfee6('0xd'),auth['isAuthenticated'](),controller[_0xfee6('0x12')]);router[_0xfee6('0x13')]('/:id',auth[_0xfee6('0x9')](),controller[_0xfee6('0x14')]);router[_0xfee6('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xfee6('0x16')]);module[_0xfee6('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 de82fc1..c46496b 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 _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x4d3ed9,_0x27c565){var _0x468da2=function(_0x553e07){while(--_0x553e07){_0x4d3ed9['push'](_0x4d3ed9['shift']());}};_0x468da2(++_0x27c565);}(_0x2ef3,0xba));var _0x32ef=function(_0x1ca2bd,_0x418ffe){_0x1ca2bd=_0x1ca2bd-0x0;var _0x469e18=_0x2ef3[_0x1ca2bd];return _0x469e18;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x71ab=['setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x71ab,0x64));var _0xb71a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x71ab[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb71a('0x0'));var _=require('lodash');module[_0xb71a('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb71a('0x3')](_0xb71a('0x4')),'get':function(){try{return JSON[_0xb71a('0x5')](this[_0xb71a('0x6')](_0xb71a('0x7')));}catch(_0x2192e8){return[];}},'set':function(_0x38d931){try{this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')](_0x38d931));}catch(_0x2a4c86){this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb71a('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':_0xb71a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb71a('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 40a1d2f..c43d7af 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 _0xdc59=['stringify','body','create','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','json','offset','undefined','limit','status','Content-Range','apply','reject','update','destroy','error','stack','name','show','keys','DashboardItem','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','then','catch','params','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s'];(function(_0x3b5e04,_0x314310){var _0x4fac5e=function(_0x5b7893){while(--_0x5b7893){_0x3b5e04['push'](_0x3b5e04['shift']());}};_0x4fac5e(++_0x314310);}(_0xdc59,0x12c));var _0x9dc5=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xdc59[_0x3bab09];return _0x164376;};'use strict';var emlformat=require(_0x9dc5('0x0'));var rimraf=require(_0x9dc5('0x1'));var zipdir=require(_0x9dc5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9dc5('0x3'));var BPromise=require(_0x9dc5('0x4'));var Mustache=require(_0x9dc5('0x5'));var util=require(_0x9dc5('0x6'));var path=require(_0x9dc5('0x7'));var sox=require(_0x9dc5('0x8'));var csv=require(_0x9dc5('0x9'));var ejs=require(_0x9dc5('0xa'));var fs=require('fs');var fs_extra=require(_0x9dc5('0xb'));var _=require('lodash');var squel=require(_0x9dc5('0xc'));var crypto=require(_0x9dc5('0xd'));var jsforce=require(_0x9dc5('0xe'));var deskjs=require(_0x9dc5('0xf'));var toCsv=require(_0x9dc5('0x9'));var querystring=require(_0x9dc5('0x10'));var Papa=require(_0x9dc5('0x11'));var Redis=require(_0x9dc5('0x12'));var authService=require(_0x9dc5('0x13'));var qs=require(_0x9dc5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dc5('0x15'));var logger=require(_0x9dc5('0x16'))(_0x9dc5('0x17'));var utils=require(_0x9dc5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9dc5('0x19'));var db=require(_0x9dc5('0x1a'))['db'];config[_0x9dc5('0x1b')]=_['defaults'](config[_0x9dc5('0x1b')],{'host':_0x9dc5('0x1c'),'port':0x18eb});var socket=require(_0x9dc5('0x1d'))(new Redis(config[_0x9dc5('0x1b')]));require(_0x9dc5('0x1e'))[_0x9dc5('0x1f')](socket);function respondWithStatusCode(_0x786239,_0x1abc3f){_0x1abc3f=_0x1abc3f||0xcc;return function(_0x755ef){if(_0x755ef){return _0x786239[_0x9dc5('0x20')](_0x1abc3f);}return _0x786239['status'](_0x1abc3f)[_0x9dc5('0x21')]();};}function respondWithResult(_0x5ebe8b,_0x76737f){_0x76737f=_0x76737f||0xc8;return function(_0x9c1b35){if(_0x9c1b35){return _0x5ebe8b['status'](_0x76737f)[_0x9dc5('0x22')](_0x9c1b35);}};}function respondWithFilteredResult(_0x2f195a,_0x17e8d1){return function(_0x16fca8){if(_0x16fca8){var _0x4e1529=typeof _0x17e8d1[_0x9dc5('0x23')]===_0x9dc5('0x24')&&typeof _0x17e8d1[_0x9dc5('0x25')]===_0x9dc5('0x24');var _0x4100e7=_0x16fca8['count'];var _0x6355d2=_0x4e1529?0x0:_0x17e8d1[_0x9dc5('0x23')];var _0x8e7b1c=_0x4e1529?_0x16fca8['count']:_0x17e8d1['offset']+_0x17e8d1[_0x9dc5('0x25')];var _0x5e2da8;if(_0x8e7b1c>=_0x4100e7){_0x8e7b1c=_0x4100e7;_0x5e2da8=0xc8;}else{_0x5e2da8=0xce;}_0x2f195a[_0x9dc5('0x26')](_0x5e2da8);return _0x2f195a['set'](_0x9dc5('0x27'),_0x6355d2+'-'+_0x8e7b1c+'/'+_0x4100e7)['json'](_0x16fca8);}return null;};}function patchUpdates(_0x100ae7){return function(_0x4c885f){try{jsonpatch[_0x9dc5('0x28')](_0x4c885f,_0x100ae7,!![]);}catch(_0x1c3726){return BPromise[_0x9dc5('0x29')](_0x1c3726);}return _0x4c885f['save']();};}function saveUpdates(_0x184d78,_0x319d42){return function(_0xa55ce){if(_0xa55ce){return _0xa55ce[_0x9dc5('0x2a')](_0x184d78)['then'](function(_0x4ba5d2){return _0x4ba5d2;});}return null;};}function removeEntity(_0xdeab68,_0xf6da02){return function(_0x4570ed){if(_0x4570ed){return _0x4570ed[_0x9dc5('0x2b')]()['then'](function(){_0xdeab68['status'](0xcc)[_0x9dc5('0x21')]();});}};}function handleEntityNotFound(_0x427cc3,_0x483778){return function(_0xd1b613){if(!_0xd1b613){_0x427cc3[_0x9dc5('0x20')](0x194);}return _0xd1b613;};}function handleError(_0x3ddade,_0x5742e8){_0x5742e8=_0x5742e8||0x1f4;return function(_0x4777f0){logger[_0x9dc5('0x2c')](_0x4777f0[_0x9dc5('0x2d')]);if(_0x4777f0[_0x9dc5('0x2e')]){delete _0x4777f0[_0x9dc5('0x2e')];}_0x3ddade[_0x9dc5('0x26')](_0x5742e8)['send'](_0x4777f0);};}exports[_0x9dc5('0x2f')]=function(_0x25e8e9,_0x21b243){var _0x19b9b5={'raw':![],'where':{'id':_0x25e8e9['params']['id']}},_0x420158={};_0x420158['model']=_[_0x9dc5('0x30')](db[_0x9dc5('0x31')]['rawAttributes']);_0x420158[_0x9dc5('0x32')]=_[_0x9dc5('0x30')](_0x25e8e9[_0x9dc5('0x32')]);_0x420158[_0x9dc5('0x33')]=_[_0x9dc5('0x34')](_0x420158[_0x9dc5('0x35')],_0x420158[_0x9dc5('0x32')]);_0x19b9b5[_0x9dc5('0x36')]=_[_0x9dc5('0x34')](_0x420158['model'],qs[_0x9dc5('0x37')](_0x25e8e9[_0x9dc5('0x32')][_0x9dc5('0x37')]));_0x19b9b5[_0x9dc5('0x36')]=_0x19b9b5[_0x9dc5('0x36')][_0x9dc5('0x38')]?_0x19b9b5['attributes']:_0x420158[_0x9dc5('0x35')];if(_0x25e8e9['query'][_0x9dc5('0x39')]){_0x19b9b5['include']=[{'all':!![]}];}_0x19b9b5=_[_0x9dc5('0x3a')]({},_0x19b9b5,_0x25e8e9[_0x9dc5('0x3b')]);return db[_0x9dc5('0x31')][_0x9dc5('0x3c')](_0x19b9b5)[_0x9dc5('0x3d')](handleEntityNotFound(_0x21b243,null))[_0x9dc5('0x3d')](respondWithResult(_0x21b243,null))[_0x9dc5('0x3e')](handleError(_0x21b243,null));};exports[_0x9dc5('0x2b')]=function(_0x1c23fd,_0x216622){return db[_0x9dc5('0x31')]['find']({'where':{'id':_0x1c23fd[_0x9dc5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x216622,null))[_0x9dc5('0x3d')](removeEntity(_0x216622,null))[_0x9dc5('0x3e')](handleError(_0x216622,null));};function widgetAttributes(_0x2fb7ea){try{switch(_0x2fb7ea['type']){case _0x9dc5('0x40'):return[{'name':_0x9dc5('0x41'),'value':_0x2fb7ea[_0x9dc5('0x41')]||(_0x2fb7ea['attrs']&&_0x2fb7ea[_0x9dc5('0x42')][0x0]?_0x2fb7ea[_0x9dc5('0x42')][0x0][_0x9dc5('0x43')]:undefined)||_0x9dc5('0x44')}];case'custom':return[{'name':_0x9dc5('0x45'),'value':_0x2fb7ea[_0x9dc5('0x45')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x0]?_0x2fb7ea['attrs'][0x0][_0x9dc5('0x43')]:undefined)||''}];case'clock':return[{'name':_0x9dc5('0x46'),'value':_0x2fb7ea[_0x9dc5('0x46')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x0]?_0x2fb7ea['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x9dc5('0x47'),'value':_0x2fb7ea[_0x9dc5('0x47')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x1]?_0x2fb7ea['attrs'][0x1][_0x9dc5('0x43')]:undefined)||_0x9dc5('0x48')},{'name':_0x9dc5('0x49'),'value':_0x2fb7ea[_0x9dc5('0x49')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea['attrs'][0x2]?_0x2fb7ea['attrs'][0x2][_0x9dc5('0x43')]:undefined)||0xc}];case'counter':return[{'name':_0x9dc5('0x4a'),'value':_0x2fb7ea[_0x9dc5('0x4a')]||(_0x2fb7ea['attrs']&&_0x2fb7ea[_0x9dc5('0x42')][0x0]?_0x2fb7ea[_0x9dc5('0x42')][0x0][_0x9dc5('0x43')]:undefined)||_0x9dc5('0x4b')},{'name':_0x9dc5('0x4c'),'value':_0x2fb7ea[_0x9dc5('0x4c')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x1]?_0x2fb7ea[_0x9dc5('0x42')][0x1]['value']:undefined)||[]},{'name':_0x9dc5('0x49'),'value':_0x2fb7ea[_0x9dc5('0x49')]||(_0x2fb7ea['attrs']&&_0x2fb7ea['attrs'][0x2]?_0x2fb7ea[_0x9dc5('0x42')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x2fb7ea[_0x9dc5('0x4d')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x3]?_0x2fb7ea[_0x9dc5('0x42')][0x3]['value']:undefined)||_0x9dc5('0x4e')},{'name':'attrEmailAccounts','value':_0x2fb7ea[_0x9dc5('0x4f')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x4]?_0x2fb7ea['attrs'][0x4]['value']:undefined)||''},{'name':_0x9dc5('0x50'),'value':_0x2fb7ea[_0x9dc5('0x50')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x5]?_0x2fb7ea['attrs'][0x5][_0x9dc5('0x43')]:undefined)||''},{'name':_0x9dc5('0x51'),'value':_0x2fb7ea['attrSmsAccounts']||(_0x2fb7ea['attrs']&&_0x2fb7ea[_0x9dc5('0x42')][0x6]?_0x2fb7ea[_0x9dc5('0x42')][0x6][_0x9dc5('0x43')]:undefined)||''},{'name':_0x9dc5('0x52'),'value':_0x2fb7ea[_0x9dc5('0x52')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea['attrs'][0x7]?_0x2fb7ea[_0x9dc5('0x42')][0x7][_0x9dc5('0x43')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2fb7ea[_0x9dc5('0x53')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x8]?_0x2fb7ea[_0x9dc5('0x42')][0x8]['value']:undefined)||''},{'name':_0x9dc5('0x54'),'value':_0x2fb7ea[_0x9dc5('0x54')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x9]?_0x2fb7ea[_0x9dc5('0x42')][0x9][_0x9dc5('0x43')]:undefined)||''}];case _0x9dc5('0x55'):case _0x9dc5('0x56'):return[{'name':_0x9dc5('0x57'),'value':_0x2fb7ea['attrSerie1']||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x0]?_0x2fb7ea['attrs'][0x0][_0x9dc5('0x43')]:undefined)||_0x9dc5('0x4b')},{'name':_0x9dc5('0x58'),'value':_0x2fb7ea[_0x9dc5('0x58')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x1]?_0x2fb7ea[_0x9dc5('0x42')][0x1][_0x9dc5('0x43')]:undefined)||null},{'name':_0x9dc5('0x59'),'value':_0x2fb7ea[_0x9dc5('0x59')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea['attrs'][0x2]?_0x2fb7ea[_0x9dc5('0x42')][0x2]['value']:undefined)||null},{'name':_0x9dc5('0x4c'),'value':_0x2fb7ea[_0x9dc5('0x4c')]||(_0x2fb7ea['attrs']&&_0x2fb7ea[_0x9dc5('0x42')][0x3]?_0x2fb7ea[_0x9dc5('0x42')][0x3][_0x9dc5('0x43')]:undefined)||[]},{'name':'attrChannel','value':_0x2fb7ea[_0x9dc5('0x4d')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x4]?_0x2fb7ea[_0x9dc5('0x42')][0x4][_0x9dc5('0x43')]:undefined)||_0x9dc5('0x4e')},{'name':_0x9dc5('0x4f'),'value':_0x2fb7ea[_0x9dc5('0x4f')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x5]?_0x2fb7ea[_0x9dc5('0x42')][0x5][_0x9dc5('0x43')]:undefined)||''},{'name':_0x9dc5('0x50'),'value':_0x2fb7ea[_0x9dc5('0x50')]||(_0x2fb7ea['attrs']&&_0x2fb7ea[_0x9dc5('0x42')][0x6]?_0x2fb7ea[_0x9dc5('0x42')][0x6][_0x9dc5('0x43')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2fb7ea['attrSmsAccounts']||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x7]?_0x2fb7ea[_0x9dc5('0x42')][0x7][_0x9dc5('0x43')]:undefined)||''},{'name':_0x9dc5('0x52'),'value':_0x2fb7ea[_0x9dc5('0x52')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x8]?_0x2fb7ea[_0x9dc5('0x42')][0x8][_0x9dc5('0x43')]:undefined)||''},{'name':_0x9dc5('0x53'),'value':_0x2fb7ea[_0x9dc5('0x53')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x9]?_0x2fb7ea[_0x9dc5('0x42')][0x9][_0x9dc5('0x43')]:undefined)||''},{'name':_0x9dc5('0x54'),'value':_0x2fb7ea[_0x9dc5('0x54')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0xa]?_0x2fb7ea[_0x9dc5('0x42')][0xa][_0x9dc5('0x43')]:undefined)||''}];case _0x9dc5('0x5a'):return[{'name':_0x9dc5('0x5b'),'type':_0x2fb7ea[_0x9dc5('0x5c')]||(_0x2fb7ea['attrs']&&_0x2fb7ea[_0x9dc5('0x42')][0x0]?_0x2fb7ea[_0x9dc5('0x42')][0x0][_0x9dc5('0x5d')]:undefined)||null,'value':_0x2fb7ea[_0x9dc5('0x5b')]||(_0x2fb7ea[_0x9dc5('0x42')]&&_0x2fb7ea[_0x9dc5('0x42')][0x0]?_0x2fb7ea[_0x9dc5('0x42')][0x0][_0x9dc5('0x43')]:undefined)||null},{'name':_0x9dc5('0x5e'),'value':_0x2fb7ea['attrRefresh']||(_0x2fb7ea['attrs']&&_0x2fb7ea['attrs'][0x1]?_0x2fb7ea['attrs'][0x1][_0x9dc5('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x9ec9e6){logger[_0x9dc5('0x2c')](_0x9dc5('0x5f'),JSON[_0x9dc5('0x60')](_0x9ec9e6));return[];}}exports['create']=function(_0x379fe6,_0x141c26){if(_0x379fe6[_0x9dc5('0x61')]){_0x379fe6[_0x9dc5('0x61')]['attrs']=widgetAttributes(_0x379fe6['body']);}return db['DashboardItem'][_0x9dc5('0x62')](_0x379fe6['body'],{})['then'](respondWithResult(_0x141c26,0xc9))[_0x9dc5('0x3e')](handleError(_0x141c26,null));};exports[_0x9dc5('0x2a')]=function(_0x36b51,_0x414e7d){if(_0x36b51[_0x9dc5('0x61')]['id']){delete _0x36b51[_0x9dc5('0x61')]['id'];}_0x36b51['body'][_0x9dc5('0x42')]=widgetAttributes(_0x36b51['body']);return db[_0x9dc5('0x31')][_0x9dc5('0x3c')]({'where':{'id':_0x36b51['params']['id']}})[_0x9dc5('0x3d')](handleEntityNotFound(_0x414e7d,null))[_0x9dc5('0x3d')](saveUpdates(_0x36b51[_0x9dc5('0x61')],null))[_0x9dc5('0x3d')](respondWithResult(_0x414e7d,null))['catch'](handleError(_0x414e7d,null));}; \ No newline at end of file +var _0xf8af=['https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','create','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','error','stack','send','show','params','model','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','type','attrUrl','attrs'];(function(_0x23e68d,_0x493da8){var _0x11d874=function(_0x4bd65c){while(--_0x4bd65c){_0x23e68d['push'](_0x23e68d['shift']());}};_0x11d874(++_0x493da8);}(_0xf8af,0x8b));var _0xff8a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf8af[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var jsonpatch=require(_0xff8a('0x2'));var rp=require(_0xff8a('0x3'));var moment=require(_0xff8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff8a('0x5'));var util=require(_0xff8a('0x6'));var path=require(_0xff8a('0x7'));var sox=require(_0xff8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8a('0x9'));var _=require('lodash');var squel=require(_0xff8a('0xa'));var crypto=require(_0xff8a('0xb'));var jsforce=require(_0xff8a('0xc'));var deskjs=require(_0xff8a('0xd'));var toCsv=require(_0xff8a('0xe'));var querystring=require(_0xff8a('0xf'));var Papa=require(_0xff8a('0x10'));var Redis=require(_0xff8a('0x11'));var authService=require(_0xff8a('0x12'));var qs=require(_0xff8a('0x13'));var as=require(_0xff8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8a('0x15'))(_0xff8a('0x16'));var utils=require(_0xff8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff8a('0x18'));var db=require(_0xff8a('0x19'))['db'];config[_0xff8a('0x1a')]=_[_0xff8a('0x1b')](config[_0xff8a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff8a('0x1c'))(new Redis(config[_0xff8a('0x1a')]));require(_0xff8a('0x1d'))[_0xff8a('0x1e')](socket);function respondWithStatusCode(_0x5d793b,_0x5a17f8){_0x5a17f8=_0x5a17f8||0xcc;return function(_0x559371){if(_0x559371){return _0x5d793b['sendStatus'](_0x5a17f8);}return _0x5d793b[_0xff8a('0x1f')](_0x5a17f8)['end']();};}function respondWithResult(_0x279441,_0x2917a7){_0x2917a7=_0x2917a7||0xc8;return function(_0x4e98b0){if(_0x4e98b0){return _0x279441[_0xff8a('0x1f')](_0x2917a7)['json'](_0x4e98b0);}};}function respondWithFilteredResult(_0x5ed382,_0x392f43){return function(_0x68524a){if(_0x68524a){var _0x124cb9=typeof _0x392f43['offset']===_0xff8a('0x20')&&typeof _0x392f43['limit']===_0xff8a('0x20');var _0x4bb5ec=_0x68524a[_0xff8a('0x21')];var _0x1b4272=_0x124cb9?0x0:_0x392f43[_0xff8a('0x22')];var _0xdb1027=_0x124cb9?_0x68524a[_0xff8a('0x21')]:_0x392f43[_0xff8a('0x22')]+_0x392f43[_0xff8a('0x23')];var _0x1ba1f1;if(_0xdb1027>=_0x4bb5ec){_0xdb1027=_0x4bb5ec;_0x1ba1f1=0xc8;}else{_0x1ba1f1=0xce;}_0x5ed382[_0xff8a('0x1f')](_0x1ba1f1);return _0x5ed382[_0xff8a('0x24')](_0xff8a('0x25'),_0x1b4272+'-'+_0xdb1027+'/'+_0x4bb5ec)[_0xff8a('0x26')](_0x68524a);}return null;};}function patchUpdates(_0x3bb4ac){return function(_0x1d9a9b){try{jsonpatch[_0xff8a('0x27')](_0x1d9a9b,_0x3bb4ac,!![]);}catch(_0x5e7897){return BPromise[_0xff8a('0x28')](_0x5e7897);}return _0x1d9a9b[_0xff8a('0x29')]();};}function saveUpdates(_0x2d6d8f,_0x303050){return function(_0x518d33){if(_0x518d33){return _0x518d33[_0xff8a('0x2a')](_0x2d6d8f)['then'](function(_0x1c9ecc){return _0x1c9ecc;});}return null;};}function removeEntity(_0x3f03ce,_0x2c67c2){return function(_0x3fdce3){if(_0x3fdce3){return _0x3fdce3[_0xff8a('0x2b')]()['then'](function(){_0x3f03ce[_0xff8a('0x1f')](0xcc)[_0xff8a('0x2c')]();});}};}function handleEntityNotFound(_0x3063b1,_0x5153f6){return function(_0x2458a0){if(!_0x2458a0){_0x3063b1[_0xff8a('0x2d')](0x194);}return _0x2458a0;};}function handleError(_0x30c36f,_0x2d69d2){_0x2d69d2=_0x2d69d2||0x1f4;return function(_0x38188f){logger[_0xff8a('0x2e')](_0x38188f[_0xff8a('0x2f')]);if(_0x38188f['name']){delete _0x38188f['name'];}_0x30c36f[_0xff8a('0x1f')](_0x2d69d2)[_0xff8a('0x30')](_0x38188f);};}exports[_0xff8a('0x31')]=function(_0x279347,_0x430cbd){var _0x184254={'raw':![],'where':{'id':_0x279347[_0xff8a('0x32')]['id']}},_0x50cb0f={};_0x50cb0f[_0xff8a('0x33')]=_['keys'](db[_0xff8a('0x34')][_0xff8a('0x35')]);_0x50cb0f[_0xff8a('0x36')]=_['keys'](_0x279347[_0xff8a('0x36')]);_0x50cb0f[_0xff8a('0x37')]=_['intersection'](_0x50cb0f[_0xff8a('0x33')],_0x50cb0f[_0xff8a('0x36')]);_0x184254[_0xff8a('0x38')]=_[_0xff8a('0x39')](_0x50cb0f[_0xff8a('0x33')],qs[_0xff8a('0x3a')](_0x279347[_0xff8a('0x36')][_0xff8a('0x3a')]));_0x184254[_0xff8a('0x38')]=_0x184254['attributes'][_0xff8a('0x3b')]?_0x184254[_0xff8a('0x38')]:_0x50cb0f['model'];if(_0x279347[_0xff8a('0x36')][_0xff8a('0x3c')]){_0x184254[_0xff8a('0x3d')]=[{'all':!![]}];}_0x184254=_[_0xff8a('0x3e')]({},_0x184254,_0x279347[_0xff8a('0x3f')]);return db[_0xff8a('0x34')][_0xff8a('0x40')](_0x184254)[_0xff8a('0x41')](handleEntityNotFound(_0x430cbd,null))[_0xff8a('0x41')](respondWithResult(_0x430cbd,null))['catch'](handleError(_0x430cbd,null));};exports['destroy']=function(_0x15a96b,_0x3f58a4){return db['DashboardItem'][_0xff8a('0x40')]({'where':{'id':_0x15a96b[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f58a4,null))['then'](removeEntity(_0x3f58a4,null))['catch'](handleError(_0x3f58a4,null));};function widgetAttributes(_0x2fd75f){try{switch(_0x2fd75f[_0xff8a('0x42')]){case'iframe':return[{'name':_0xff8a('0x43'),'value':_0x2fd75f[_0xff8a('0x43')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['value']:undefined)||_0xff8a('0x45')}];case _0xff8a('0x46'):return[{'name':'attrPath','value':_0x2fd75f[_0xff8a('0x47')]||(_0x2fd75f['attrs']&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x49'):return[{'name':_0xff8a('0x4a'),'value':_0x2fd75f[_0xff8a('0x4a')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x4b')},{'name':_0xff8a('0x4c'),'value':_0x2fd75f[_0xff8a('0x4c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||_0xff8a('0x4d')},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0xc}];case _0xff8a('0x4f'):return[{'name':_0xff8a('0x50'),'value':_0x2fd75f['attrMetric']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||[]},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0x14},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3][_0xff8a('0x48')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f[_0xff8a('0x57')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f[_0xff8a('0x44')][0x8][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x5a'):case _0xff8a('0x5b'):return[{'name':'attrSerie1','value':_0x2fd75f[_0xff8a('0x5c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x5d'),'value':_0x2fd75f[_0xff8a('0x5d')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x5e'),'value':_0x2fd75f[_0xff8a('0x5e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3]['value']:undefined)||[]},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4][_0xff8a('0x48')]:undefined)||_0xff8a('0x5f')},{'name':_0xff8a('0x54'),'value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f['attrOpenchannelAccounts']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f['attrs'][0x8]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9]['value']:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0xa]?_0x2fd75f['attrs'][0xa][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x60'):return[{'name':_0xff8a('0x61'),'type':_0x2fd75f[_0xff8a('0x62')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['type']:undefined)||null,'value':_0x2fd75f[_0xff8a('0x61')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x63'),'value':_0x2fd75f[_0xff8a('0x63')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5acf87){logger[_0xff8a('0x2e')](_0xff8a('0x64'),JSON['stringify'](_0x5acf87));return[];}}exports['create']=function(_0x40e4ee,_0x4ddc06){if(_0x40e4ee[_0xff8a('0x65')]){_0x40e4ee[_0xff8a('0x65')][_0xff8a('0x44')]=widgetAttributes(_0x40e4ee[_0xff8a('0x65')]);}return db[_0xff8a('0x34')][_0xff8a('0x66')](_0x40e4ee[_0xff8a('0x65')],{})[_0xff8a('0x41')](respondWithResult(_0x4ddc06,0xc9))[_0xff8a('0x67')](handleError(_0x4ddc06,null));};exports[_0xff8a('0x2a')]=function(_0x182026,_0x48d8e7){if(_0x182026[_0xff8a('0x65')]['id']){delete _0x182026[_0xff8a('0x65')]['id'];}_0x182026[_0xff8a('0x65')]['attrs']=widgetAttributes(_0x182026[_0xff8a('0x65')]);return db[_0xff8a('0x34')]['find']({'where':{'id':_0x182026[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x48d8e7,null))[_0xff8a('0x41')](saveUpdates(_0x182026[_0xff8a('0x65')],null))[_0xff8a('0x41')](respondWithResult(_0x48d8e7,null))[_0xff8a('0x67')](handleError(_0x48d8e7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a1795cb..da39004 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 _0xabd7=['emit','hook','events','../../mysqldb','DashboardItem','setMaxListeners','update'];(function(_0x9b678a,_0x2c797e){var _0x28fca4=function(_0x2abfef){while(--_0x2abfef){_0x9b678a['push'](_0x9b678a['shift']());}};_0x28fca4(++_0x2c797e);}(_0xabd7,0x121));var _0x7abd=function(_0x5a1149,_0x436fca){_0x5a1149=_0x5a1149-0x0;var _0x58131e=_0xabd7[_0x5a1149];return _0x58131e;};'use strict';var EventEmitter=require(_0x7abd('0x0'));var DashboardItem=require(_0x7abd('0x1'))['db'][_0x7abd('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7abd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7abd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d5649){return function(_0x512c3b,_0x2eb373,_0x5174f1){DashboardItemEvents['emit'](_0x5d5649+':'+_0x512c3b['id'],_0x512c3b);DashboardItemEvents[_0x7abd('0x5')](_0x5d5649,_0x512c3b);_0x5174f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x7abd('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x1d5f=['events','../../mysqldb','DashboardItem','save','update','emit','hook','exports'];(function(_0xdd23fc,_0x3173db){var _0x1bdb90=function(_0x527c50){while(--_0x527c50){_0xdd23fc['push'](_0xdd23fc['shift']());}};_0x1bdb90(++_0x3173db);}(_0x1d5f,0x110));var _0xf1d5=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x1d5f[_0x349148];return _0x2f2b0f;};'use strict';var EventEmitter=require(_0xf1d5('0x0'));var DashboardItem=require(_0xf1d5('0x1'))['db'][_0xf1d5('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf1d5('0x3'),'afterUpdate':_0xf1d5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x549c4e){return function(_0x20fe29,_0x120fa4,_0x4120ae){DashboardItemEvents['emit'](_0x549c4e+':'+_0x20fe29['id'],_0x20fe29);DashboardItemEvents[_0xf1d5('0x5')](_0x549c4e,_0x20fe29);_0x4120ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xf1d5('0x6')](e,emitEvent(event));}}module[_0xf1d5('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 68d1a57..d03f028 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 _0xf50b=['bluebird','request-promise','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','api','moment'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0xf50b,0xc8));var _0xbf50=function(_0x197f8e,_0x5bf6d7){_0x197f8e=_0x197f8e-0x0;var _0x356446=_0xf50b[_0x197f8e];return _0x356446;};'use strict';var _=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var logger=require('../../config/logger')(_0xbf50('0x2'));var moment=require(_0xbf50('0x3'));var BPromise=require(_0xbf50('0x4'));var rp=require(_0xbf50('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf50('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf50('0x7'));module[_0xbf50('0x8')]=function(_0x1ecb62,_0x117cc8){return _0x1ecb62[_0xbf50('0x9')](_0xbf50('0xa'),attributes,{'tableName':_0xbf50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0e6=['util','api','moment','bluebird','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items'];(function(_0x28410c,_0xb5f10f){var _0x454c7f=function(_0x2705bb){while(--_0x2705bb){_0x28410c['push'](_0x28410c['shift']());}};_0x454c7f(++_0xb5f10f);}(_0xc0e6,0x1b8));var _0x6c0e=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc0e6[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require(_0x6c0e('0x0'));var logger=require('../../config/logger')(_0x6c0e('0x1'));var moment=require(_0x6c0e('0x2'));var BPromise=require(_0x6c0e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6c0e('0x4'));var config=require(_0x6c0e('0x5'));var attributes=require(_0x6c0e('0x6'));module[_0x6c0e('0x7')]=function(_0x28b74e,_0x4c3847){return _0x28b74e[_0x6c0e('0x8')](_0x6c0e('0x9'),attributes,{'tableName':_0x6c0e('0xa'),'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 53e5b73..0c04995 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 _0xb378=['redis','defaults','localhost','register','request','then','info','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0xb378,0x194));var _0x8b37=function(_0x369545,_0x405ae6){_0x369545=_0x369545-0x0;var _0x971065=_0xb378[_0x369545];return _0x971065;};'use strict';var _=require(_0x8b37('0x0'));var util=require(_0x8b37('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8b37('0x2'));var fs=require('fs');var Redis=require(_0x8b37('0x3'));var db=require(_0x8b37('0x4'))['db'];var utils=require(_0x8b37('0x5'));var logger=require(_0x8b37('0x6'))(_0x8b37('0x7'));var config=require(_0x8b37('0x8'));var jayson=require(_0x8b37('0x9'));var client=jayson[_0x8b37('0xa')][_0x8b37('0xb')]({'port':0x232a});config[_0x8b37('0xc')]=_[_0x8b37('0xd')](config[_0x8b37('0xc')],{'host':_0x8b37('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b37('0xc')]));require('./dashboardItem.socket')[_0x8b37('0xf')](socket);function respondWithRpcPromise(_0x16a466,_0x1c6231,_0x5012ae){return new BPromise(function(_0x1fae73,_0x38f2ed){return client[_0x8b37('0x10')](_0x16a466,_0x5012ae)[_0x8b37('0x11')](function(_0x160e27){logger[_0x8b37('0x12')]('DashboardItem,\x20%s,\x20%s',_0x1c6231,_0x8b37('0x13'));logger['debug'](_0x8b37('0x14'),_0x1c6231,_0x8b37('0x13'),JSON['stringify'](_0x160e27));if(_0x160e27[_0x8b37('0x15')]){if(_0x160e27['error'][_0x8b37('0x16')]===0x1f4){logger['error'](_0x8b37('0x17'),_0x1c6231,_0x160e27[_0x8b37('0x15')][_0x8b37('0x18')]);return _0x38f2ed(_0x160e27[_0x8b37('0x15')][_0x8b37('0x18')]);}logger[_0x8b37('0x15')](_0x8b37('0x17'),_0x1c6231,_0x160e27[_0x8b37('0x15')]['message']);return _0x1fae73(_0x160e27['error'][_0x8b37('0x18')]);}else{logger[_0x8b37('0x12')](_0x8b37('0x17'),_0x1c6231,'request\x20sent');_0x1fae73(_0x160e27['result'][_0x8b37('0x18')]);}})[_0x8b37('0x19')](function(_0x1be3b1){logger[_0x8b37('0x15')](_0x8b37('0x17'),_0x1c6231,_0x1be3b1);_0x38f2ed(_0x1be3b1);});});} \ No newline at end of file +var _0xe2a2=['then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2a2,0x194));var _0x2e2a=function(_0x18d2e3,_0x14c72d){_0x18d2e3=_0x18d2e3-0x0;var _0x997ef6=_0xe2a2[_0x18d2e3];return _0x997ef6;};'use strict';var _=require(_0x2e2a('0x0'));var util=require('util');var moment=require(_0x2e2a('0x1'));var BPromise=require(_0x2e2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e2a('0x3'));var db=require(_0x2e2a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e2a('0x5'))(_0x2e2a('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e2a('0x7'));var client=jayson[_0x2e2a('0x8')][_0x2e2a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2e2a('0xa')],{'host':_0x2e2a('0xb'),'port':0x18eb});var socket=require(_0x2e2a('0xc'))(new Redis(config[_0x2e2a('0xa')]));require(_0x2e2a('0xd'))[_0x2e2a('0xe')](socket);function respondWithRpcPromise(_0x37ac86,_0x962e01,_0x5dfe65){return new BPromise(function(_0x210b87,_0x54b431){return client[_0x2e2a('0xf')](_0x37ac86,_0x5dfe65)[_0x2e2a('0x10')](function(_0xfe9445){logger[_0x2e2a('0x11')]('DashboardItem,\x20%s,\x20%s',_0x962e01,_0x2e2a('0x12'));logger[_0x2e2a('0x13')](_0x2e2a('0x14'),_0x962e01,_0x2e2a('0x12'),JSON[_0x2e2a('0x15')](_0xfe9445));if(_0xfe9445['error']){if(_0xfe9445[_0x2e2a('0x16')][_0x2e2a('0x17')]===0x1f4){logger[_0x2e2a('0x16')]('DashboardItem,\x20%s,\x20%s',_0x962e01,_0xfe9445[_0x2e2a('0x16')][_0x2e2a('0x18')]);return _0x54b431(_0xfe9445[_0x2e2a('0x16')]['message']);}logger[_0x2e2a('0x16')]('DashboardItem,\x20%s,\x20%s',_0x962e01,_0xfe9445[_0x2e2a('0x16')][_0x2e2a('0x18')]);return _0x210b87(_0xfe9445[_0x2e2a('0x16')]['message']);}else{logger[_0x2e2a('0x11')](_0x2e2a('0x19'),_0x962e01,_0x2e2a('0x12'));_0x210b87(_0xfe9445[_0x2e2a('0x1a')]['message']);}})[_0x2e2a('0x1b')](function(_0x430266){logger['error'](_0x2e2a('0x19'),_0x962e01,_0x430266);_0x54b431(_0x430266);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 657a116..9d6a761 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 _0x7321=['./dashboardItem.events','save','remove','emit','removeListener','length'];(function(_0x3404fa,_0x4a6246){var _0x1ebdaa=function(_0x2fa10d){while(--_0x2fa10d){_0x3404fa['push'](_0x3404fa['shift']());}};_0x1ebdaa(++_0x4a6246);}(_0x7321,0xc6));var _0x1732=function(_0x408b1a,_0x311049){_0x408b1a=_0x408b1a-0x0;var _0x5e6427=_0x7321[_0x408b1a];return _0x5e6427;};'use strict';var DashboardItemEvents=require(_0x1732('0x0'));var events=[_0x1732('0x1'),_0x1732('0x2'),'update'];function createListener(_0x19eb8d,_0x19c859){return function(_0x431928){_0x19c859[_0x1732('0x3')](_0x19eb8d,_0x431928);};}function removeListener(_0x1ddf9e,_0x5e52eb){return function(){DashboardItemEvents[_0x1732('0x4')](_0x1ddf9e,_0x5e52eb);};}exports['register']=function(_0x253a02){for(var _0x2883f0=0x0,_0xf293db=events[_0x1732('0x5')];_0x2883f0<_0xf293db;_0x2883f0++){var _0x4b621d=events[_0x2883f0];var _0x5ccdcf=createListener('dashboardItem:'+_0x4b621d,_0x253a02);DashboardItemEvents['on'](_0x4b621d,_0x5ccdcf);}}; \ No newline at end of file +var _0xa5fd=['remove','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x42d043,_0x18af25){var _0x5bdb51=function(_0x173cb4){while(--_0x173cb4){_0x42d043['push'](_0x42d043['shift']());}};_0x5bdb51(++_0x18af25);}(_0xa5fd,0x1e9));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardItemEvents=require(_0xda5f('0x0'));var events=['save',_0xda5f('0x1'),'update'];function createListener(_0x262eac,_0x54f96e){return function(_0x265b9d){_0x54f96e[_0xda5f('0x2')](_0x262eac,_0x265b9d);};}function removeListener(_0x486cb3,_0x4c1f3e){return function(){DashboardItemEvents[_0xda5f('0x3')](_0x486cb3,_0x4c1f3e);};}exports[_0xda5f('0x4')]=function(_0x3bf448){for(var _0x9f3b49=0x0,_0x2cc11e=events[_0xda5f('0x5')];_0x9f3b49<_0x2cc11e;_0x9f3b49++){var _0x232a89=events[_0x9f3b49];var _0x350058=createListener(_0xda5f('0x6')+_0x232a89,_0x3bf448);DashboardItemEvents['on'](_0x232a89,_0x350058);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a2641bb..3b68853 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 _0x8cd4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x8cd4,0x8a));var _0x48cd=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0x8cd4[_0x1c5142];return _0x1268cb;};'use strict';var multer=require(_0x48cd('0x0'));var util=require(_0x48cd('0x1'));var path=require(_0x48cd('0x2'));var timeout=require(_0x48cd('0x3'));var express=require(_0x48cd('0x4'));var router=express[_0x48cd('0x5')]();var fs_extra=require(_0x48cd('0x6'));var auth=require(_0x48cd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x48cd('0x8'));var controller=require(_0x48cd('0x9'));router[_0x48cd('0xa')](_0x48cd('0xb'),auth[_0x48cd('0xc')](),controller[_0x48cd('0xd')]);router[_0x48cd('0xe')]('/',auth[_0x48cd('0xc')](),controller[_0x48cd('0xf')]);router[_0x48cd('0x10')](_0x48cd('0xb'),auth['isAuthenticated'](),controller[_0x48cd('0x11')]);router['delete'](_0x48cd('0xb'),auth[_0x48cd('0xc')](),controller[_0x48cd('0x12')]);module[_0x48cd('0x13')]=router; \ No newline at end of file +var _0x3ef7=['Router','fs-extra','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path'];(function(_0x9499c7,_0x597e86){var _0x46cee2=function(_0x1fbc6d){while(--_0x1fbc6d){_0x9499c7['push'](_0x9499c7['shift']());}};_0x46cee2(++_0x597e86);}(_0x3ef7,0x6d));var _0x73ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ef7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x73ef('0x0'));var util=require(_0x73ef('0x1'));var path=require(_0x73ef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x73ef('0x3')]();var fs_extra=require(_0x73ef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73ef('0x5'));var config=require('../../config/environment');var controller=require(_0x73ef('0x6'));router[_0x73ef('0x7')](_0x73ef('0x8'),auth[_0x73ef('0x9')](),controller[_0x73ef('0xa')]);router[_0x73ef('0xb')]('/',auth['isAuthenticated'](),controller[_0x73ef('0xc')]);router['put'](_0x73ef('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x73ef('0xd')](_0x73ef('0x8'),auth[_0x73ef('0x9')](),controller[_0x73ef('0xe')]);module[_0x73ef('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 cea8352..357b8a3 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 _0x4140=['ENUM','first','third','sequelize','STRING'];(function(_0x19114f,_0x180d0f){var _0xe66c2e=function(_0x4d898f){while(--_0x4d898f){_0x19114f['push'](_0x19114f['shift']());}};_0xe66c2e(++_0x180d0f);}(_0x4140,0x1e8));var _0x0414=function(_0x4c60ca,_0x34c331){_0x4c60ca=_0x4c60ca-0x0;var _0x1087fd=_0x4140[_0x4c60ca];return _0x1087fd;};'use strict';var Sequelize=require(_0x0414('0x0'));module['exports']={'name':{'type':Sequelize[_0x0414('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x0414('0x2')](_0x0414('0x3'),'second',_0x0414('0x4')),'allowNull':![],'defaultValue':_0x0414('0x3')},'description':{'type':Sequelize[_0x0414('0x1')]}}; \ No newline at end of file +var _0x52cf=['STRING','sequelize','exports','ENUM','second','third','first'];(function(_0x41bdbe,_0x1f3bc4){var _0x596b9c=function(_0x397458){while(--_0x397458){_0x41bdbe['push'](_0x41bdbe['shift']());}};_0x596b9c(++_0x1f3bc4);}(_0x52cf,0x16d));var _0xf52c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x52cf[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0xf52c('0x0'));module[_0xf52c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xf52c('0x2')]('first',_0xf52c('0x3'),_0xf52c('0x4')),'allowNull':![],'defaultValue':_0xf52c('0x5')},'description':{'type':Sequelize[_0xf52c('0x6')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 2bf517b..082ff7e 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 _0x9efe=['then','destroy','get','UserProfileResource','error','stack','name','index','map','Disposition','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','catch','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x2d7f32,_0x271058){var _0x20f1d2=function(_0x32b20a){while(--_0x32b20a){_0x2d7f32['push'](_0x2d7f32['shift']());}};_0x20f1d2(++_0x271058);}(_0x9efe,0xca));var _0xe9ef=function(_0x164e76,_0x4446cc){_0x164e76=_0x164e76-0x0;var _0x44e4b4=_0x9efe[_0x164e76];return _0x44e4b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9ef('0x0'));var zipdir=require(_0xe9ef('0x1'));var jsonpatch=require(_0xe9ef('0x2'));var rp=require(_0xe9ef('0x3'));var moment=require(_0xe9ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9ef('0x5'));var util=require(_0xe9ef('0x6'));var path=require(_0xe9ef('0x7'));var sox=require(_0xe9ef('0x8'));var csv=require(_0xe9ef('0x9'));var ejs=require(_0xe9ef('0xa'));var fs=require('fs');var fs_extra=require(_0xe9ef('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe9ef('0xc'));var deskjs=require(_0xe9ef('0xd'));var toCsv=require(_0xe9ef('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe9ef('0xe'));var as=require(_0xe9ef('0xf'));var hardwareService=require(_0xe9ef('0x10'));var logger=require('../../config/logger')(_0xe9ef('0x11'));var utils=require(_0xe9ef('0x12'));var config=require(_0xe9ef('0x13'));var licenseUtil=require(_0xe9ef('0x14'));var db=require(_0xe9ef('0x15'))['db'];function respondWithStatusCode(_0x28f4e5,_0x58df0a){_0x58df0a=_0x58df0a||0xcc;return function(_0x45ae9a){if(_0x45ae9a){return _0x28f4e5[_0xe9ef('0x16')](_0x58df0a);}return _0x28f4e5[_0xe9ef('0x17')](_0x58df0a)[_0xe9ef('0x18')]();};}function respondWithResult(_0xbe7e,_0x498a53){_0x498a53=_0x498a53||0xc8;return function(_0x1427cb){if(_0x1427cb){return _0xbe7e[_0xe9ef('0x17')](_0x498a53)[_0xe9ef('0x19')](_0x1427cb);}};}function respondWithFilteredResult(_0x1f2698,_0x2c7f15){return function(_0x4c57c3){if(_0x4c57c3){var _0x537d17=typeof _0x2c7f15[_0xe9ef('0x1a')]==='undefined'&&typeof _0x2c7f15[_0xe9ef('0x1b')]===_0xe9ef('0x1c');var _0x3c94c3=_0x4c57c3['count'];var _0x104f82=_0x537d17?0x0:_0x2c7f15[_0xe9ef('0x1a')];var _0x2caa88=_0x537d17?_0x4c57c3[_0xe9ef('0x1d')]:_0x2c7f15['offset']+_0x2c7f15[_0xe9ef('0x1b')];var _0x5d99c2;if(_0x2caa88>=_0x3c94c3){_0x2caa88=_0x3c94c3;_0x5d99c2=0xc8;}else{_0x5d99c2=0xce;}_0x1f2698['status'](_0x5d99c2);return _0x1f2698[_0xe9ef('0x1e')](_0xe9ef('0x1f'),_0x104f82+'-'+_0x2caa88+'/'+_0x3c94c3)['json'](_0x4c57c3);}return null;};}function patchUpdates(_0x3d4780){return function(_0x275012){try{jsonpatch[_0xe9ef('0x20')](_0x275012,_0x3d4780,!![]);}catch(_0x540682){return BPromise[_0xe9ef('0x21')](_0x540682);}return _0x275012[_0xe9ef('0x22')]();};}function saveUpdates(_0x21de44,_0xf54d38){return function(_0x5cdd83){if(_0x5cdd83){return _0x5cdd83['update'](_0x21de44)[_0xe9ef('0x23')](function(_0x2144a2){return _0x2144a2;});}return null;};}function removeEntity(_0x14384b,_0x46e0ae){return function(_0x239f4e){if(_0x239f4e){return _0x239f4e[_0xe9ef('0x24')]()[_0xe9ef('0x23')](function(){var _0x4b87f3=_0x239f4e[_0xe9ef('0x25')]({'plain':!![]});var _0x54e793='Dispositions';return db[_0xe9ef('0x26')][_0xe9ef('0x24')]({'where':{'type':_0x54e793,'resourceId':_0x4b87f3['id']}})[_0xe9ef('0x23')](function(){return _0x239f4e;});})[_0xe9ef('0x23')](function(){_0x14384b[_0xe9ef('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d90e0,_0x3bedc4){return function(_0x368a5d){if(!_0x368a5d){_0x5d90e0[_0xe9ef('0x16')](0x194);}return _0x368a5d;};}function handleError(_0x1ea8af,_0x31d562){_0x31d562=_0x31d562||0x1f4;return function(_0x3866c){logger[_0xe9ef('0x27')](_0x3866c[_0xe9ef('0x28')]);if(_0x3866c[_0xe9ef('0x29')]){delete _0x3866c[_0xe9ef('0x29')];}_0x1ea8af[_0xe9ef('0x17')](_0x31d562)['send'](_0x3866c);};}exports[_0xe9ef('0x2a')]=function(_0x5ad8d5,_0x134ae3){var _0x22a238={},_0x1a2d2e={},_0xcaebae={'count':0x0,'rows':[]};var _0x3175bd=_[_0xe9ef('0x2b')](db[_0xe9ef('0x2c')][_0xe9ef('0x2d')],function(_0x302904){return{'name':_0x302904['fieldName'],'type':_0x302904[_0xe9ef('0x2e')]['key']};});_0x1a2d2e['model']=_[_0xe9ef('0x2b')](_0x3175bd,_0xe9ef('0x29'));_0x1a2d2e[_0xe9ef('0x2f')]=_[_0xe9ef('0x30')](_0x5ad8d5[_0xe9ef('0x2f')]);_0x1a2d2e[_0xe9ef('0x31')]=_[_0xe9ef('0x32')](_0x1a2d2e[_0xe9ef('0x33')],_0x1a2d2e[_0xe9ef('0x2f')]);_0x22a238[_0xe9ef('0x34')]=_[_0xe9ef('0x32')](_0x1a2d2e[_0xe9ef('0x33')],qs['fields'](_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x35')]));_0x22a238[_0xe9ef('0x34')]=_0x22a238[_0xe9ef('0x34')]['length']?_0x22a238[_0xe9ef('0x34')]:_0x1a2d2e[_0xe9ef('0x33')];if(!_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x36')](_0xe9ef('0x37'))){_0x22a238[_0xe9ef('0x1b')]=qs[_0xe9ef('0x1b')](_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x1b')]);_0x22a238[_0xe9ef('0x1a')]=qs[_0xe9ef('0x1a')](_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x1a')]);}_0x22a238[_0xe9ef('0x38')]=qs[_0xe9ef('0x39')](_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x39')]);_0x22a238[_0xe9ef('0x3a')]=qs[_0xe9ef('0x31')](_[_0xe9ef('0x3b')](_0x5ad8d5[_0xe9ef('0x2f')],_0x1a2d2e[_0xe9ef('0x31')]),_0x3175bd);if(_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x3c')]){_0x22a238[_0xe9ef('0x3a')]=_['merge'](_0x22a238[_0xe9ef('0x3a')],{'$or':_[_0xe9ef('0x2b')](_0x3175bd,function(_0x496168){if(_0x496168[_0xe9ef('0x2e')]!=='VIRTUAL'){var _0x3db316={};_0x3db316[_0x496168[_0xe9ef('0x29')]]={'$like':'%'+_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x3c')]+'%'};return _0x3db316;}})});}_0x22a238=_['merge']({},_0x22a238,_0x5ad8d5[_0xe9ef('0x3d')]);var _0xa80c48={'where':_0x22a238[_0xe9ef('0x3a')]};return db[_0xe9ef('0x2c')][_0xe9ef('0x1d')](_0xa80c48)['then'](function(_0x484973){_0xcaebae[_0xe9ef('0x1d')]=_0x484973;if(_0x5ad8d5[_0xe9ef('0x2f')][_0xe9ef('0x3e')]){_0x22a238[_0xe9ef('0x3f')]=[{'all':!![]}];}return db[_0xe9ef('0x2c')][_0xe9ef('0x40')](_0x22a238);})[_0xe9ef('0x23')](function(_0x149f32){_0xcaebae['rows']=_0x149f32;return _0xcaebae;})[_0xe9ef('0x23')](respondWithFilteredResult(_0x134ae3,_0x22a238))[_0xe9ef('0x41')](handleError(_0x134ae3,null));};exports['show']=function(_0x388859,_0x2dd399){var _0x39e406={'raw':!![],'where':{'id':_0x388859[_0xe9ef('0x42')]['id']}},_0x176c32={};_0x176c32[_0xe9ef('0x33')]=_[_0xe9ef('0x30')](db[_0xe9ef('0x2c')][_0xe9ef('0x2d')]);_0x176c32[_0xe9ef('0x2f')]=_['keys'](_0x388859['query']);_0x176c32['filters']=_[_0xe9ef('0x32')](_0x176c32[_0xe9ef('0x33')],_0x176c32[_0xe9ef('0x2f')]);_0x39e406['attributes']=_['intersection'](_0x176c32[_0xe9ef('0x33')],qs['fields'](_0x388859[_0xe9ef('0x2f')]['fields']));_0x39e406[_0xe9ef('0x34')]=_0x39e406[_0xe9ef('0x34')][_0xe9ef('0x43')]?_0x39e406[_0xe9ef('0x34')]:_0x176c32[_0xe9ef('0x33')];if(_0x388859[_0xe9ef('0x2f')][_0xe9ef('0x3e')]){_0x39e406['include']=[{'all':!![]}];}_0x39e406=_['merge']({},_0x39e406,_0x388859['options']);return db[_0xe9ef('0x2c')]['find'](_0x39e406)[_0xe9ef('0x23')](handleEntityNotFound(_0x2dd399,null))['then'](respondWithResult(_0x2dd399,null))[_0xe9ef('0x41')](handleError(_0x2dd399,null));};exports[_0xe9ef('0x44')]=function(_0x358c3c,_0x29ed7d){return db[_0xe9ef('0x2c')][_0xe9ef('0x44')](_0x358c3c[_0xe9ef('0x45')],{})['then'](function(_0x58136a){var _0x1d8b7b=_0x358c3c[_0xe9ef('0x46')][_0xe9ef('0x25')]({'plain':!![]});if(!_0x1d8b7b)throw new Error(_0xe9ef('0x47'));if(_0x1d8b7b[_0xe9ef('0x48')]===_0xe9ef('0x46')){var _0xadb769=_0x58136a[_0xe9ef('0x25')]({'plain':!![]});var _0x4b456c=_0xe9ef('0x49');return db[_0xe9ef('0x4a')][_0xe9ef('0x4b')]({'where':{'name':_0x4b456c,'userProfileId':_0x1d8b7b[_0xe9ef('0x4c')]},'raw':!![]})[_0xe9ef('0x23')](function(_0x3934f0){if(_0x3934f0&&_0x3934f0['autoAssociation']===0x0){return db[_0xe9ef('0x26')][_0xe9ef('0x44')]({'name':_0xadb769[_0xe9ef('0x29')],'resourceId':_0xadb769['id'],'type':_0x3934f0[_0xe9ef('0x29')],'sectionId':_0x3934f0['id']},{})[_0xe9ef('0x23')](function(){return _0x58136a;});}else{return _0x58136a;}})['catch'](function(_0x4ee83e){logger[_0xe9ef('0x27')](_0xe9ef('0x4d'),_0x4ee83e);throw _0x4ee83e;});}return _0x58136a;})[_0xe9ef('0x23')](respondWithResult(_0x29ed7d,0xc9))[_0xe9ef('0x41')](handleError(_0x29ed7d,null));};exports[_0xe9ef('0x4e')]=function(_0x516338,_0x6d0473){if(_0x516338[_0xe9ef('0x45')]['id']){delete _0x516338[_0xe9ef('0x45')]['id'];}return db[_0xe9ef('0x2c')][_0xe9ef('0x4b')]({'where':{'id':_0x516338[_0xe9ef('0x42')]['id']}})[_0xe9ef('0x23')](handleEntityNotFound(_0x6d0473,null))[_0xe9ef('0x23')](saveUpdates(_0x516338[_0xe9ef('0x45')],null))['then'](respondWithResult(_0x6d0473,null))[_0xe9ef('0x41')](handleError(_0x6d0473,null));};exports['destroy']=function(_0x3e66e4,_0x1ab5da){return db['Disposition'][_0xe9ef('0x4b')]({'where':{'id':_0x3e66e4['params']['id']}})[_0xe9ef('0x23')](handleEntityNotFound(_0x1ab5da,null))[_0xe9ef('0x23')](removeEntity(_0x1ab5da,null))[_0xe9ef('0x41')](handleError(_0x1ab5da,null));}; \ No newline at end of file +var _0x600f=['rows','catch','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','index','map','Disposition','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll'];(function(_0x2e2169,_0x4bf9e8){var _0xb1135e=function(_0x26735c){while(--_0x26735c){_0x2e2169['push'](_0x2e2169['shift']());}};_0xb1135e(++_0x4bf9e8);}(_0x600f,0xb4));var _0xf600=function(_0x6c0b0a,_0x496391){_0x6c0b0a=_0x6c0b0a-0x0;var _0x5f456a=_0x600f[_0x6c0b0a];return _0x5f456a;};'use strict';var emlformat=require(_0xf600('0x0'));var rimraf=require(_0xf600('0x1'));var zipdir=require(_0xf600('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf600('0x3'));var moment=require('moment');var BPromise=require(_0xf600('0x4'));var Mustache=require(_0xf600('0x5'));var util=require(_0xf600('0x6'));var path=require(_0xf600('0x7'));var sox=require(_0xf600('0x8'));var csv=require(_0xf600('0x9'));var ejs=require(_0xf600('0xa'));var fs=require('fs');var fs_extra=require(_0xf600('0xb'));var _=require('lodash');var squel=require(_0xf600('0xc'));var crypto=require('crypto');var jsforce=require(_0xf600('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf600('0x9'));var querystring=require(_0xf600('0xe'));var Papa=require(_0xf600('0xf'));var Redis=require(_0xf600('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf600('0x11'));var as=require(_0xf600('0x12'));var hardwareService=require(_0xf600('0x13'));var logger=require(_0xf600('0x14'))('api');var utils=require(_0xf600('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf600('0x16'));var db=require(_0xf600('0x17'))['db'];function respondWithStatusCode(_0xe45a38,_0x436d6d){_0x436d6d=_0x436d6d||0xcc;return function(_0xc0ca75){if(_0xc0ca75){return _0xe45a38[_0xf600('0x18')](_0x436d6d);}return _0xe45a38[_0xf600('0x19')](_0x436d6d)[_0xf600('0x1a')]();};}function respondWithResult(_0x4cec23,_0x336ec5){_0x336ec5=_0x336ec5||0xc8;return function(_0x1f8f1e){if(_0x1f8f1e){return _0x4cec23[_0xf600('0x19')](_0x336ec5)['json'](_0x1f8f1e);}};}function respondWithFilteredResult(_0x265c6a,_0x5cd205){return function(_0x4ae962){if(_0x4ae962){var _0x20d9c3=typeof _0x5cd205[_0xf600('0x1b')]===_0xf600('0x1c')&&typeof _0x5cd205[_0xf600('0x1d')]===_0xf600('0x1c');var _0x506667=_0x4ae962[_0xf600('0x1e')];var _0x1e4efa=_0x20d9c3?0x0:_0x5cd205[_0xf600('0x1b')];var _0x2c9a76=_0x20d9c3?_0x4ae962[_0xf600('0x1e')]:_0x5cd205[_0xf600('0x1b')]+_0x5cd205[_0xf600('0x1d')];var _0x5f488c;if(_0x2c9a76>=_0x506667){_0x2c9a76=_0x506667;_0x5f488c=0xc8;}else{_0x5f488c=0xce;}_0x265c6a[_0xf600('0x19')](_0x5f488c);return _0x265c6a['set'](_0xf600('0x1f'),_0x1e4efa+'-'+_0x2c9a76+'/'+_0x506667)[_0xf600('0x20')](_0x4ae962);}return null;};}function patchUpdates(_0x287e86){return function(_0x2dc1ca){try{jsonpatch[_0xf600('0x21')](_0x2dc1ca,_0x287e86,!![]);}catch(_0x4968c7){return BPromise[_0xf600('0x22')](_0x4968c7);}return _0x2dc1ca[_0xf600('0x23')]();};}function saveUpdates(_0x1a5856,_0x328a9b){return function(_0x4083c5){if(_0x4083c5){return _0x4083c5[_0xf600('0x24')](_0x1a5856)[_0xf600('0x25')](function(_0x74a9de){return _0x74a9de;});}return null;};}function removeEntity(_0x2c066f,_0x259a3c){return function(_0x5ab4fe){if(_0x5ab4fe){return _0x5ab4fe['destroy']()['then'](function(){var _0x2f9aaa=_0x5ab4fe[_0xf600('0x26')]({'plain':!![]});var _0xf5299c=_0xf600('0x27');return db[_0xf600('0x28')][_0xf600('0x29')]({'where':{'type':_0xf5299c,'resourceId':_0x2f9aaa['id']}})[_0xf600('0x25')](function(){return _0x5ab4fe;});})[_0xf600('0x25')](function(){_0x2c066f[_0xf600('0x19')](0xcc)[_0xf600('0x1a')]();});}};}function handleEntityNotFound(_0xfa3730,_0x242bab){return function(_0x370027){if(!_0x370027){_0xfa3730[_0xf600('0x18')](0x194);}return _0x370027;};}function handleError(_0x1e3ba1,_0x324eed){_0x324eed=_0x324eed||0x1f4;return function(_0xc59f05){logger[_0xf600('0x2a')](_0xc59f05[_0xf600('0x2b')]);if(_0xc59f05[_0xf600('0x2c')]){delete _0xc59f05['name'];}_0x1e3ba1[_0xf600('0x19')](_0x324eed)['send'](_0xc59f05);};}exports[_0xf600('0x2d')]=function(_0x247aab,_0x2913a0){var _0x2dfdc9={},_0x45c957={},_0x32f144={'count':0x0,'rows':[]};var _0x5bf5ef=_[_0xf600('0x2e')](db[_0xf600('0x2f')][_0xf600('0x30')],function(_0x15ea7a){return{'name':_0x15ea7a[_0xf600('0x31')],'type':_0x15ea7a[_0xf600('0x32')]['key']};});_0x45c957[_0xf600('0x33')]=_[_0xf600('0x2e')](_0x5bf5ef,'name');_0x45c957['query']=_[_0xf600('0x34')](_0x247aab[_0xf600('0x35')]);_0x45c957[_0xf600('0x36')]=_[_0xf600('0x37')](_0x45c957[_0xf600('0x33')],_0x45c957[_0xf600('0x35')]);_0x2dfdc9['attributes']=_[_0xf600('0x37')](_0x45c957[_0xf600('0x33')],qs[_0xf600('0x38')](_0x247aab[_0xf600('0x35')][_0xf600('0x38')]));_0x2dfdc9[_0xf600('0x39')]=_0x2dfdc9[_0xf600('0x39')]['length']?_0x2dfdc9[_0xf600('0x39')]:_0x45c957[_0xf600('0x33')];if(!_0x247aab[_0xf600('0x35')][_0xf600('0x3a')](_0xf600('0x3b'))){_0x2dfdc9[_0xf600('0x1d')]=qs[_0xf600('0x1d')](_0x247aab[_0xf600('0x35')][_0xf600('0x1d')]);_0x2dfdc9['offset']=qs[_0xf600('0x1b')](_0x247aab['query'][_0xf600('0x1b')]);}_0x2dfdc9[_0xf600('0x3c')]=qs[_0xf600('0x3d')](_0x247aab['query']['sort']);_0x2dfdc9[_0xf600('0x3e')]=qs[_0xf600('0x36')](_[_0xf600('0x3f')](_0x247aab['query'],_0x45c957[_0xf600('0x36')]),_0x5bf5ef);if(_0x247aab[_0xf600('0x35')][_0xf600('0x40')]){_0x2dfdc9['where']=_[_0xf600('0x41')](_0x2dfdc9['where'],{'$or':_['map'](_0x5bf5ef,function(_0x3b4353){if(_0x3b4353[_0xf600('0x32')]!=='VIRTUAL'){var _0x150a37={};_0x150a37[_0x3b4353['name']]={'$like':'%'+_0x247aab[_0xf600('0x35')]['filter']+'%'};return _0x150a37;}})});}_0x2dfdc9=_[_0xf600('0x41')]({},_0x2dfdc9,_0x247aab['options']);var _0x2e2ba1={'where':_0x2dfdc9[_0xf600('0x3e')]};return db['Disposition'][_0xf600('0x1e')](_0x2e2ba1)[_0xf600('0x25')](function(_0x7753ae){_0x32f144['count']=_0x7753ae;if(_0x247aab[_0xf600('0x35')][_0xf600('0x42')]){_0x2dfdc9[_0xf600('0x43')]=[{'all':!![]}];}return db[_0xf600('0x2f')][_0xf600('0x44')](_0x2dfdc9);})[_0xf600('0x25')](function(_0x5420df){_0x32f144[_0xf600('0x45')]=_0x5420df;return _0x32f144;})[_0xf600('0x25')](respondWithFilteredResult(_0x2913a0,_0x2dfdc9))[_0xf600('0x46')](handleError(_0x2913a0,null));};exports['show']=function(_0xb6fffe,_0x4e7379){var _0x2b07f9={'raw':!![],'where':{'id':_0xb6fffe[_0xf600('0x47')]['id']}},_0x4deb0b={};_0x4deb0b[_0xf600('0x33')]=_['keys'](db[_0xf600('0x2f')][_0xf600('0x30')]);_0x4deb0b['query']=_['keys'](_0xb6fffe[_0xf600('0x35')]);_0x4deb0b[_0xf600('0x36')]=_[_0xf600('0x37')](_0x4deb0b['model'],_0x4deb0b[_0xf600('0x35')]);_0x2b07f9[_0xf600('0x39')]=_[_0xf600('0x37')](_0x4deb0b['model'],qs[_0xf600('0x38')](_0xb6fffe[_0xf600('0x35')]['fields']));_0x2b07f9[_0xf600('0x39')]=_0x2b07f9[_0xf600('0x39')][_0xf600('0x48')]?_0x2b07f9['attributes']:_0x4deb0b[_0xf600('0x33')];if(_0xb6fffe[_0xf600('0x35')][_0xf600('0x42')]){_0x2b07f9[_0xf600('0x43')]=[{'all':!![]}];}_0x2b07f9=_['merge']({},_0x2b07f9,_0xb6fffe[_0xf600('0x49')]);return db[_0xf600('0x2f')][_0xf600('0x4a')](_0x2b07f9)[_0xf600('0x25')](handleEntityNotFound(_0x4e7379,null))[_0xf600('0x25')](respondWithResult(_0x4e7379,null))[_0xf600('0x46')](handleError(_0x4e7379,null));};exports[_0xf600('0x4b')]=function(_0x549b09,_0xb0453e){return db[_0xf600('0x2f')]['create'](_0x549b09['body'],{})[_0xf600('0x25')](function(_0x1f1bf9){var _0x1dc768=_0x549b09[_0xf600('0x4c')]['get']({'plain':!![]});if(!_0x1dc768)throw new Error(_0xf600('0x4d'));if(_0x1dc768[_0xf600('0x4e')]===_0xf600('0x4c')){var _0x5e8c0d=_0x1f1bf9[_0xf600('0x26')]({'plain':!![]});var _0x309962='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x309962,'userProfileId':_0x1dc768[_0xf600('0x4f')]},'raw':!![]})[_0xf600('0x25')](function(_0x12f86b){if(_0x12f86b&&_0x12f86b[_0xf600('0x50')]===0x0){return db[_0xf600('0x28')][_0xf600('0x4b')]({'name':_0x5e8c0d[_0xf600('0x2c')],'resourceId':_0x5e8c0d['id'],'type':_0x12f86b[_0xf600('0x2c')],'sectionId':_0x12f86b['id']},{})['then'](function(){return _0x1f1bf9;});}else{return _0x1f1bf9;}})['catch'](function(_0x155f51){logger[_0xf600('0x2a')](_0xf600('0x51'),_0x155f51);throw _0x155f51;});}return _0x1f1bf9;})[_0xf600('0x25')](respondWithResult(_0xb0453e,0xc9))[_0xf600('0x46')](handleError(_0xb0453e,null));};exports[_0xf600('0x24')]=function(_0xf3940f,_0x3e62ab){if(_0xf3940f[_0xf600('0x52')]['id']){delete _0xf3940f[_0xf600('0x52')]['id'];}return db['Disposition'][_0xf600('0x4a')]({'where':{'id':_0xf3940f[_0xf600('0x47')]['id']}})[_0xf600('0x25')](handleEntityNotFound(_0x3e62ab,null))[_0xf600('0x25')](saveUpdates(_0xf3940f[_0xf600('0x52')],null))['then'](respondWithResult(_0x3e62ab,null))['catch'](handleError(_0x3e62ab,null));};exports[_0xf600('0x29')]=function(_0x1704a4,_0x438c47){return db[_0xf600('0x2f')][_0xf600('0x4a')]({'where':{'id':_0x1704a4[_0xf600('0x47')]['id']}})['then'](handleEntityNotFound(_0x438c47,null))[_0xf600('0x25')](removeEntity(_0x438c47,null))[_0xf600('0x46')](handleError(_0x438c47,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index c8c8423..c1a763e 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 _0x83a4=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0x155574,_0x4e0b0b){var _0x56b559=function(_0x1a4b1d){while(--_0x1a4b1d){_0x155574['push'](_0x155574['shift']());}};_0x56b559(++_0x4e0b0b);}(_0x83a4,0x64));var _0x483a=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x83a4[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x483a('0x0'));var util=require(_0x483a('0x1'));var logger=require(_0x483a('0x2'))('api');var moment=require(_0x483a('0x3'));var BPromise=require(_0x483a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x483a('0x5'));var rimraf=require(_0x483a('0x6'));var config=require(_0x483a('0x7'));var attributes=require(_0x483a('0x8'));module['exports']=function(_0x4833f0,_0x16ba1){return _0x4833f0[_0x483a('0x9')](_0x483a('0xa'),attributes,{'tableName':_0x483a('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x483a('0xc'),'fields':[_0x483a('0xd'),_0x483a('0xe')]},{'unique':!![],'name':_0x483a('0xf'),'fields':[_0x483a('0xd'),_0x483a('0x10')]},{'unique':!![],'name':_0x483a('0x11'),'fields':[_0x483a('0xd'),_0x483a('0x12')]},{'unique':!![],'name':_0x483a('0x13'),'fields':[_0x483a('0xd'),_0x483a('0x14')]},{'unique':!![],'name':'name_fax','fields':[_0x483a('0xd'),_0x483a('0x15')]},{'unique':!![],'name':_0x483a('0x16'),'fields':[_0x483a('0xd'),_0x483a('0x17')]},{'unique':!![],'name':_0x483a('0x18'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1afe=['moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','ListId','name_chat','name_mail','name','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1afe,0x98));var _0xe1af=function(_0x2a0e26,_0x443e52){_0x2a0e26=_0x2a0e26-0x0;var _0x47a49b=_0x1afe[_0x2a0e26];return _0x47a49b;};'use strict';var _=require(_0xe1af('0x0'));var util=require(_0xe1af('0x1'));var logger=require(_0xe1af('0x2'))(_0xe1af('0x3'));var moment=require(_0xe1af('0x4'));var BPromise=require(_0xe1af('0x5'));var rp=require(_0xe1af('0x6'));var fs=require('fs');var path=require(_0xe1af('0x7'));var rimraf=require('rimraf');var config=require(_0xe1af('0x8'));var attributes=require(_0xe1af('0x9'));module[_0xe1af('0xa')]=function(_0x54f17c,_0x455192){return _0x54f17c[_0xe1af('0xb')]('Disposition',attributes,{'tableName':_0xe1af('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe1af('0xd'),'fields':['name',_0xe1af('0xe')]},{'unique':!![],'name':_0xe1af('0xf'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0xe1af('0x10'),'fields':[_0xe1af('0x11'),_0xe1af('0x12')]},{'unique':!![],'name':_0xe1af('0x13'),'fields':['name',_0xe1af('0x14')]},{'unique':!![],'name':_0xe1af('0x15'),'fields':[_0xe1af('0x11'),'FaxAccountId']},{'unique':!![],'name':_0xe1af('0x16'),'fields':[_0xe1af('0x11'),_0xe1af('0x17')]},{'unique':!![],'name':_0xe1af('0x18'),'fields':[_0xe1af('0x11'),_0xe1af('0x19')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 47cdf9a..d4f03ab 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(_0x3e28cb,_0x226ac8){var _0x367358=function(_0x364842){while(--_0x364842){_0x3e28cb['push'](_0x3e28cb['shift']());}};_0x367358(++_0x226ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x5ec852,_0x23dda7){var _0x50c8b6=function(_0x37ff13){while(--_0x37ff13){_0x5ec852['push'](_0x5ec852['shift']());}};_0x50c8b6(++_0x23dda7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 7514d86..d19b041 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 _0xc38f=['exports','multer','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','post','create','/:id','update','destroy'];(function(_0x22eae9,_0x1c305c){var _0x58fbf7=function(_0x4f5fb8){while(--_0x4f5fb8){_0x22eae9['push'](_0x22eae9['shift']());}};_0x58fbf7(++_0x1c305c);}(_0xc38f,0x1eb));var _0xfc38=function(_0x5e2968,_0x4cf67f){_0x5e2968=_0x5e2968-0x0;var _0x2aacf8=_0xc38f[_0x5e2968];return _0x2aacf8;};'use strict';var multer=require(_0xfc38('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfc38('0x1'));var router=express[_0xfc38('0x2')]();var fs_extra=require(_0xfc38('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfc38('0x4'));var controller=require('./disposition.controller');router[_0xfc38('0x5')]('/',auth[_0xfc38('0x6')](),controller[_0xfc38('0x7')]);router[_0xfc38('0x5')]('/:id',auth[_0xfc38('0x6')](),controller['show']);router[_0xfc38('0x8')]('/',auth['isAuthenticated'](),controller[_0xfc38('0x9')]);router['put'](_0xfc38('0xa'),auth['isAuthenticated'](),controller[_0xfc38('0xb')]);router['delete'](_0xfc38('0xa'),auth[_0xfc38('0x6')](),controller[_0xfc38('0xc')]);module[_0xfc38('0xd')]=router; \ No newline at end of file +var _0x6dd4=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','util'];(function(_0x2372ae,_0x531dbe){var _0x3f43d2=function(_0x2dfa6f){while(--_0x2dfa6f){_0x2372ae['push'](_0x2372ae['shift']());}};_0x3f43d2(++_0x531dbe);}(_0x6dd4,0x1cf));var _0x46dd=function(_0x58c15a,_0x111414){_0x58c15a=_0x58c15a-0x0;var _0x1ea91e=_0x6dd4[_0x58c15a];return _0x1ea91e;};'use strict';var multer=require('multer');var util=require(_0x46dd('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x46dd('0x1'));var router=express[_0x46dd('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x46dd('0x3'));var interaction=require(_0x46dd('0x4'));var config=require(_0x46dd('0x5'));var controller=require('./disposition.controller');router[_0x46dd('0x6')]('/',auth[_0x46dd('0x7')](),controller['index']);router['get'](_0x46dd('0x8'),auth[_0x46dd('0x7')](),controller[_0x46dd('0x9')]);router[_0x46dd('0xa')]('/',auth[_0x46dd('0x7')](),controller['create']);router[_0x46dd('0xb')](_0x46dd('0x8'),auth[_0x46dd('0x7')](),controller[_0x46dd('0xc')]);router[_0x46dd('0xd')](_0x46dd('0x8'),auth[_0x46dd('0x7')](),controller[_0x46dd('0xe')]);module[_0x46dd('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 5785f07..a00cc76 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 _0x879a=['xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','SIP','IAX','DADHI','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports','STRING','ENUM','yes'];(function(_0x2f0849,_0x3021ba){var _0x5eafd9=function(_0x3a86d9){while(--_0x3a86d9){_0x2f0849['push'](_0x2f0849['shift']());}};_0x5eafd9(++_0x3021ba);}(_0x879a,0xc2));var _0xa879=function(_0x243ac9,_0xa2ff5a){_0x243ac9=_0x243ac9-0x0;var _0x547036=_0x879a[_0x243ac9];return _0x547036;};'use strict';var Sequelize=require('sequelize');module[_0xa879('0x0')]={'name':{'type':Sequelize[_0xa879('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa879('0x1')]},'ecm':{'type':Sequelize[_0xa879('0x2')](_0xa879('0x3'),'no'),'defaultValue':_0xa879('0x3')},'headerinfo':{'type':Sequelize[_0xa879('0x1')],'defaultValue':_0xa879('0x4')},'localstationid':{'type':Sequelize[_0xa879('0x1')],'unique':_0xa879('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xa879('0x6'),_0xa879('0x7'),_0xa879('0x8'),_0xa879('0x9'),_0xa879('0xa'),_0xa879('0xb')),'defaultValue':_0xa879('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0xa879('0x6'),_0xa879('0x7'),_0xa879('0x8'),_0xa879('0x9'),_0xa879('0xa'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xa879('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xa879('0x2')](_0xa879('0xc'),_0xa879('0xd'),_0xa879('0xe'),'KHOMP'),'defaultValue':_0xa879('0xc')},'key':{'type':Sequelize[_0xa879('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa879('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa879('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa879('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa879('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa879('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xa879('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xa879('0x10')],'defaultValue':![],'comment':_0xa879('0x13'),'set':function(_0x52985f){if(!_0x52985f)this[_0xa879('0x14')](_0xa879('0x15'),null);this['setDataValue']('mandatoryDisposition',_0x52985f);}}}; \ No newline at end of file +var _0xfe96=['4800','7200','9600','14400','12000','IAX','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xfe96,0x130));var _0x6fe9=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xfe96[_0x511bd1];return _0x4c48ec;};'use strict';var Sequelize=require(_0x6fe9('0x0'));module[_0x6fe9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6fe9('0x2')]},'ecm':{'type':Sequelize[_0x6fe9('0x3')](_0x6fe9('0x4'),'no'),'defaultValue':_0x6fe9('0x4')},'headerinfo':{'type':Sequelize[_0x6fe9('0x2')],'defaultValue':_0x6fe9('0x5')},'localstationid':{'type':Sequelize[_0x6fe9('0x2')],'unique':_0x6fe9('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x6fe9('0x7'),_0x6fe9('0x8'),_0x6fe9('0x9'),_0x6fe9('0xa'),'12000',_0x6fe9('0xb')),'defaultValue':_0x6fe9('0x8')},'maxrate':{'type':Sequelize[_0x6fe9('0x3')]('2400',_0x6fe9('0x8'),'7200',_0x6fe9('0xa'),_0x6fe9('0xc'),_0x6fe9('0xb')),'defaultValue':_0x6fe9('0xb')},'modem':{'type':Sequelize[_0x6fe9('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x6fe9('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6fe9('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6fe9('0x3')]('SIP',_0x6fe9('0xd'),'DADHI',_0x6fe9('0xe')),'defaultValue':_0x6fe9('0xf')},'key':{'type':Sequelize[_0x6fe9('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6fe9('0x10')],'defaultValue':function(){return _0x6fe9('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6fe9('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6fe9('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6fe9('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6fe9('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x6fe9('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x6fe9('0x13')],'defaultValue':![],'comment':_0x6fe9('0x15'),'set':function(_0x5a8cbe){if(!_0x5a8cbe)this[_0x6fe9('0x16')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x6fe9('0x17'),_0x5a8cbe);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 80cf070..9173ea8 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 _0xe3a8=['Tags','tag','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','stack','finally','getApplications','from-voip-provider','exten','app','system','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','Wait','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','ListId','findById','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','attachments','join','root','basename','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','end','sendStatus','name','send','index','mandatoryDispositionPause','map','rawAttributes','key','query','keys','intersection','model','fields','attributes','length','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','options','FaxAccount','include','findAll','rows','show','Pause','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','pick','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','internal','Tag'];(function(_0x35e82e,_0x5cf85e){var _0x1417e9=function(_0x556abf){while(--_0x556abf){_0x35e82e['push'](_0x35e82e['shift']());}};_0x1417e9(++_0x5cf85e);}(_0xe3a8,0x1cb));var _0x8e3a=function(_0x3828cb,_0x4e723a){_0x3828cb=_0x3828cb-0x0;var _0xd26e68=_0xe3a8[_0x3828cb];return _0xd26e68;};'use strict';var emlformat=require(_0x8e3a('0x0'));var rimraf=require(_0x8e3a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e3a('0x2'));var moment=require(_0x8e3a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e3a('0x4'));var path=require('path');var sox=require(_0x8e3a('0x5'));var csv=require(_0x8e3a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e3a('0x7'));var squel=require(_0x8e3a('0x8'));var crypto=require(_0x8e3a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8e3a('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8e3a('0xb'));var Papa=require(_0x8e3a('0xc'));var Redis=require(_0x8e3a('0xd'));var authService=require(_0x8e3a('0xe'));var qs=require(_0x8e3a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e3a('0x10'));var logger=require(_0x8e3a('0x11'))(_0x8e3a('0x12'));var utils=require(_0x8e3a('0x13'));var config=require(_0x8e3a('0x14'));var licenseUtil=require(_0x8e3a('0x15'));var db=require(_0x8e3a('0x16'))['db'];config[_0x8e3a('0x17')]=_['defaults'](config[_0x8e3a('0x17')],{'host':_0x8e3a('0x18'),'port':0x18eb});var socket=require(_0x8e3a('0x19'))(new Redis(config['redis']));require(_0x8e3a('0x1a'))[_0x8e3a('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8e3a('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8e3a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3bb2e0,_0x47a808,_0x188ec4,_0x63b704){return new BPromise(function(_0x2e512c,_0x5a48ab){var _0x6b4832=_0x63b704||client;return _0x6b4832['request'](_0x3bb2e0,_0x188ec4)[_0x8e3a('0x1e')](function(_0x375b26){logger[_0x8e3a('0x1f')](_0x8e3a('0x20'),_0x47a808,_0x8e3a('0x21'));logger['debug'](_0x8e3a('0x22'),_0x47a808,_0x8e3a('0x21'),JSON[_0x8e3a('0x23')](_0x375b26));if(_0x375b26[_0x8e3a('0x24')]){if(_0x375b26[_0x8e3a('0x24')][_0x8e3a('0x25')]===0x1f4){logger[_0x8e3a('0x24')](_0x8e3a('0x20'),_0x47a808,_0x375b26[_0x8e3a('0x24')][_0x8e3a('0x26')]);return _0x5a48ab(_0x375b26['error']['message']);}logger[_0x8e3a('0x24')](_0x8e3a('0x20'),_0x47a808,_0x375b26[_0x8e3a('0x24')][_0x8e3a('0x26')]);return _0x2e512c(_0x375b26[_0x8e3a('0x24')][_0x8e3a('0x26')]);}else{logger[_0x8e3a('0x1f')](_0x8e3a('0x20'),_0x47a808,'request\x20sent');_0x2e512c(_0x375b26[_0x8e3a('0x27')][_0x8e3a('0x26')]);}})[_0x8e3a('0x28')](function(_0x35521a){logger[_0x8e3a('0x24')](_0x8e3a('0x20'),_0x47a808,_0x35521a);_0x5a48ab(_0x35521a);});});}function respondWithStatusCode(_0x17eaaf,_0x38f0fe){_0x38f0fe=_0x38f0fe||0xcc;return function(_0x36b206){if(_0x36b206){return _0x17eaaf['sendStatus'](_0x38f0fe);}return _0x17eaaf[_0x8e3a('0x29')](_0x38f0fe)['end']();};}function respondWithResult(_0x44938c,_0x23fda5){_0x23fda5=_0x23fda5||0xc8;return function(_0x5d1c00){if(_0x5d1c00){return _0x44938c[_0x8e3a('0x29')](_0x23fda5)[_0x8e3a('0x2a')](_0x5d1c00);}};}function respondWithFilteredResult(_0x417a6b,_0x59dd63){return function(_0x7b206){if(_0x7b206){var _0x593863=typeof _0x59dd63[_0x8e3a('0x2b')]==='undefined'&&typeof _0x59dd63[_0x8e3a('0x2c')]===_0x8e3a('0x2d');var _0x2622ca=_0x7b206['count'];var _0x190fba=_0x593863?0x0:_0x59dd63[_0x8e3a('0x2b')];var _0x504c01=_0x593863?_0x7b206[_0x8e3a('0x2e')]:_0x59dd63['offset']+_0x59dd63['limit'];var _0x53f91e;if(_0x504c01>=_0x2622ca){_0x504c01=_0x2622ca;_0x53f91e=0xc8;}else{_0x53f91e=0xce;}_0x417a6b['status'](_0x53f91e);return _0x417a6b[_0x8e3a('0x2f')](_0x8e3a('0x30'),_0x190fba+'-'+_0x504c01+'/'+_0x2622ca)[_0x8e3a('0x2a')](_0x7b206);}return null;};}function patchUpdates(_0x101fc7){return function(_0x326a1a){try{jsonpatch[_0x8e3a('0x31')](_0x326a1a,_0x101fc7,!![]);}catch(_0x1dbe02){return BPromise[_0x8e3a('0x32')](_0x1dbe02);}return _0x326a1a[_0x8e3a('0x33')]();};}function saveUpdates(_0x467092,_0x2934a1){return function(_0x30c743){if(_0x30c743){return _0x30c743[_0x8e3a('0x34')](_0x467092)[_0x8e3a('0x1e')](function(_0xdc6a70){return _0xdc6a70;});}return null;};}function removeEntity(_0x132478,_0xc7bc8f){return function(_0x6e67bb){if(_0x6e67bb){return _0x6e67bb[_0x8e3a('0x35')]()['then'](function(){var _0x300f93=_0x6e67bb[_0x8e3a('0x36')]({'plain':!![]});var _0x3c8318=_0x8e3a('0x37');return db[_0x8e3a('0x38')][_0x8e3a('0x35')]({'where':{'type':_0x3c8318,'resourceId':_0x300f93['id']}})[_0x8e3a('0x1e')](function(){return _0x6e67bb;});})[_0x8e3a('0x1e')](function(){_0x132478[_0x8e3a('0x29')](0xcc)[_0x8e3a('0x39')]();});}};}function handleEntityNotFound(_0x296c85,_0x2aed01){return function(_0x3bd486){if(!_0x3bd486){_0x296c85[_0x8e3a('0x3a')](0x194);}return _0x3bd486;};}function handleError(_0x1be62c,_0x370597){_0x370597=_0x370597||0x1f4;return function(_0x5b0071){logger[_0x8e3a('0x24')](_0x5b0071['stack']);if(_0x5b0071[_0x8e3a('0x3b')]){delete _0x5b0071[_0x8e3a('0x3b')];}_0x1be62c[_0x8e3a('0x29')](_0x370597)[_0x8e3a('0x3c')](_0x5b0071);};}exports[_0x8e3a('0x3d')]=function(_0x1e3353,_0x298d43){var _0x1a7b4c={'include':[{'model':db['Pause'],'as':_0x8e3a('0x3e')}]},_0x37ef1c={},_0xc74998={'count':0x0,'rows':[]};var _0xbeddd5=_[_0x8e3a('0x3f')](db['FaxAccount'][_0x8e3a('0x40')],function(_0x1e2710){return{'name':_0x1e2710['fieldName'],'type':_0x1e2710['type'][_0x8e3a('0x41')]};});_0x37ef1c['model']=_[_0x8e3a('0x3f')](_0xbeddd5,'name');_0x37ef1c[_0x8e3a('0x42')]=_[_0x8e3a('0x43')](_0x1e3353[_0x8e3a('0x42')]);_0x37ef1c['filters']=_[_0x8e3a('0x44')](_0x37ef1c[_0x8e3a('0x45')],_0x37ef1c[_0x8e3a('0x42')]);_0x1a7b4c['attributes']=_[_0x8e3a('0x44')](_0x37ef1c[_0x8e3a('0x45')],qs[_0x8e3a('0x46')](_0x1e3353[_0x8e3a('0x42')][_0x8e3a('0x46')]));_0x1a7b4c[_0x8e3a('0x47')]=_0x1a7b4c[_0x8e3a('0x47')][_0x8e3a('0x48')]?_0x1a7b4c[_0x8e3a('0x47')]:_0x37ef1c[_0x8e3a('0x45')];if(!_0x1e3353['query']['hasOwnProperty'](_0x8e3a('0x49'))){_0x1a7b4c[_0x8e3a('0x2c')]=qs['limit'](_0x1e3353[_0x8e3a('0x42')][_0x8e3a('0x2c')]);_0x1a7b4c[_0x8e3a('0x2b')]=qs[_0x8e3a('0x2b')](_0x1e3353['query'][_0x8e3a('0x2b')]);}_0x1a7b4c['order']=qs[_0x8e3a('0x4a')](_0x1e3353[_0x8e3a('0x42')][_0x8e3a('0x4a')]);_0x1a7b4c[_0x8e3a('0x4b')]=qs[_0x8e3a('0x4c')](_['pick'](_0x1e3353[_0x8e3a('0x42')],_0x37ef1c[_0x8e3a('0x4c')]),_0xbeddd5);if(_0x1e3353[_0x8e3a('0x42')][_0x8e3a('0x4d')]){_0x1a7b4c[_0x8e3a('0x4b')]=_['merge'](_0x1a7b4c['where'],{'$or':_['map'](_0xbeddd5,function(_0x233728){if(_0x233728[_0x8e3a('0x4e')]!==_0x8e3a('0x4f')){var _0x458b84={};_0x458b84[_0x233728['name']]={'$like':'%'+_0x1e3353['query'][_0x8e3a('0x4d')]+'%'};return _0x458b84;}})});}_0x1a7b4c=_[_0x8e3a('0x50')]({},_0x1a7b4c,_0x1e3353[_0x8e3a('0x51')]);var _0x56bc68={'where':_0x1a7b4c[_0x8e3a('0x4b')]};return db[_0x8e3a('0x52')]['count'](_0x56bc68)[_0x8e3a('0x1e')](function(_0x3461a5){_0xc74998[_0x8e3a('0x2e')]=_0x3461a5;if(_0x1e3353[_0x8e3a('0x42')]['includeAll']){_0x1a7b4c[_0x8e3a('0x53')]=[{'all':!![]}];}return db[_0x8e3a('0x52')][_0x8e3a('0x54')](_0x1a7b4c);})['then'](function(_0x6d08d){_0xc74998[_0x8e3a('0x55')]=_0x6d08d;return _0xc74998;})['then'](respondWithFilteredResult(_0x298d43,_0x1a7b4c))[_0x8e3a('0x28')](handleError(_0x298d43,null));};exports[_0x8e3a('0x56')]=function(_0xcc8dfb,_0x677a16){var _0x2fcab0={'raw':![],'where':{'id':_0xcc8dfb['params']['id']},'include':[{'model':db[_0x8e3a('0x57')],'as':_0x8e3a('0x3e')}]},_0x59ad8e={};_0x59ad8e[_0x8e3a('0x45')]=_[_0x8e3a('0x43')](db[_0x8e3a('0x52')]['rawAttributes']);_0x59ad8e[_0x8e3a('0x42')]=_[_0x8e3a('0x43')](_0xcc8dfb[_0x8e3a('0x42')]);_0x59ad8e[_0x8e3a('0x4c')]=_['intersection'](_0x59ad8e['model'],_0x59ad8e[_0x8e3a('0x42')]);_0x2fcab0[_0x8e3a('0x47')]=_[_0x8e3a('0x44')](_0x59ad8e[_0x8e3a('0x45')],qs[_0x8e3a('0x46')](_0xcc8dfb[_0x8e3a('0x42')][_0x8e3a('0x46')]));_0x2fcab0[_0x8e3a('0x47')]=_0x2fcab0['attributes']['length']?_0x2fcab0[_0x8e3a('0x47')]:_0x59ad8e[_0x8e3a('0x45')];if(_0xcc8dfb[_0x8e3a('0x42')][_0x8e3a('0x58')]){_0x2fcab0['include']=[{'all':!![]}];}_0x2fcab0=_[_0x8e3a('0x50')]({},_0x2fcab0,_0xcc8dfb[_0x8e3a('0x51')]);return db[_0x8e3a('0x52')][_0x8e3a('0x59')](_0x2fcab0)[_0x8e3a('0x1e')](handleEntityNotFound(_0x677a16,null))[_0x8e3a('0x1e')](respondWithResult(_0x677a16,null))[_0x8e3a('0x28')](handleError(_0x677a16,null));};exports[_0x8e3a('0x5a')]=function(_0x4e13d1,_0x1b9881){return db[_0x8e3a('0x52')]['create'](_0x4e13d1[_0x8e3a('0x5b')],{})[_0x8e3a('0x1e')](function(_0x13d185){var _0x2923da=_0x4e13d1[_0x8e3a('0x5c')][_0x8e3a('0x36')]({'plain':!![]});if(!_0x2923da)throw new Error(_0x8e3a('0x5d'));if(_0x2923da[_0x8e3a('0x5e')]===_0x8e3a('0x5c')){var _0x24c02c=_0x13d185[_0x8e3a('0x36')]({'plain':!![]});var _0x457f2b=_0x8e3a('0x37');return db['UserProfileSection'][_0x8e3a('0x59')]({'where':{'name':_0x457f2b,'userProfileId':_0x2923da[_0x8e3a('0x5f')]},'raw':!![]})[_0x8e3a('0x1e')](function(_0x3bf615){if(_0x3bf615&&_0x3bf615[_0x8e3a('0x60')]===0x0){return db[_0x8e3a('0x38')]['create']({'name':_0x24c02c[_0x8e3a('0x3b')],'resourceId':_0x24c02c['id'],'type':_0x3bf615[_0x8e3a('0x3b')],'sectionId':_0x3bf615['id']},{})[_0x8e3a('0x1e')](function(){return _0x13d185;});}else{return _0x13d185;}})[_0x8e3a('0x28')](function(_0x2129f8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2129f8);throw _0x2129f8;});}return _0x13d185;})[_0x8e3a('0x1e')](respondWithResult(_0x1b9881,0xc9))[_0x8e3a('0x28')](handleError(_0x1b9881,null));};exports[_0x8e3a('0x34')]=function(_0x250527,_0x2db7d2){if(_0x250527[_0x8e3a('0x5b')]['id']){delete _0x250527[_0x8e3a('0x5b')]['id'];}return db[_0x8e3a('0x52')][_0x8e3a('0x59')]({'where':{'id':_0x250527[_0x8e3a('0x61')]['id']},'include':[{'model':db[_0x8e3a('0x57')],'as':_0x8e3a('0x3e')}]})[_0x8e3a('0x1e')](handleEntityNotFound(_0x2db7d2,null))[_0x8e3a('0x1e')](saveUpdates(_0x250527[_0x8e3a('0x5b')],null))[_0x8e3a('0x1e')](respondWithResult(_0x2db7d2,null))[_0x8e3a('0x28')](handleError(_0x2db7d2,null));};exports[_0x8e3a('0x35')]=function(_0x1d6a90,_0x3de761){return db[_0x8e3a('0x52')][_0x8e3a('0x59')]({'where':{'id':_0x1d6a90[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x3de761,null))[_0x8e3a('0x1e')](removeEntity(_0x3de761,null))['catch'](handleError(_0x3de761,null));};exports['describe']=function(_0x2c6d57,_0x3ff048){return db[_0x8e3a('0x52')][_0x8e3a('0x62')]()[_0x8e3a('0x1e')](respondWithResult(_0x3ff048,null))['catch'](handleError(_0x3ff048,null));};exports[_0x8e3a('0x63')]=function(_0x92693f,_0x33ee51,_0x2b401f){if(_0x92693f[_0x8e3a('0x5b')]['id']){delete _0x92693f['body']['id'];}return db[_0x8e3a('0x52')]['find']({'where':{'id':_0x92693f[_0x8e3a('0x61')]['id']}})['then'](handleEntityNotFound(_0x33ee51,null))[_0x8e3a('0x1e')](function(_0x251f8f){if(_0x251f8f){_0x92693f[_0x8e3a('0x5b')][_0x8e3a('0x64')]=_0x251f8f['id'];return db[_0x8e3a('0x65')][_0x8e3a('0x5a')](_0x92693f[_0x8e3a('0x5b')]);}})[_0x8e3a('0x1e')](respondWithResult(_0x33ee51,null))[_0x8e3a('0x28')](handleError(_0x33ee51,null));};exports[_0x8e3a('0x66')]=function(_0x311310,_0x21d0e1,_0xdc0e39){var _0x38a859={'raw':![],'where':{}};var _0x3fa187={};var _0xc14257={'count':0x0,'rows':[]};return db[_0x8e3a('0x52')][_0x8e3a('0x67')]({'where':{'id':_0x311310['params']['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x21d0e1,null))[_0x8e3a('0x1e')](function(_0x55473a){if(_0x55473a){_0x3fa187[_0x8e3a('0x45')]=_[_0x8e3a('0x43')](db['Disposition'][_0x8e3a('0x40')]);_0x3fa187[_0x8e3a('0x42')]=_[_0x8e3a('0x43')](_0x311310[_0x8e3a('0x42')]);_0x3fa187[_0x8e3a('0x4c')]=_[_0x8e3a('0x44')](_0x3fa187['model'],_0x3fa187[_0x8e3a('0x42')]);_0x38a859[_0x8e3a('0x47')]=_[_0x8e3a('0x44')](_0x3fa187[_0x8e3a('0x45')],qs[_0x8e3a('0x46')](_0x311310[_0x8e3a('0x42')][_0x8e3a('0x46')]));_0x38a859[_0x8e3a('0x47')]=_0x38a859[_0x8e3a('0x47')][_0x8e3a('0x48')]?_0x38a859['attributes']:_0x3fa187[_0x8e3a('0x45')];if(!_0x311310[_0x8e3a('0x42')]['hasOwnProperty'](_0x8e3a('0x49'))){_0x38a859[_0x8e3a('0x2c')]=qs['limit'](_0x311310[_0x8e3a('0x42')][_0x8e3a('0x2c')]);_0x38a859[_0x8e3a('0x2b')]=qs[_0x8e3a('0x2b')](_0x311310[_0x8e3a('0x42')][_0x8e3a('0x2b')]);}_0x38a859[_0x8e3a('0x68')]=qs[_0x8e3a('0x4a')](_0x311310[_0x8e3a('0x42')]['sort']);_0x38a859[_0x8e3a('0x4b')]=qs[_0x8e3a('0x4c')](_[_0x8e3a('0x69')](_0x311310['query'],_0x3fa187['filters']));_0x38a859[_0x8e3a('0x4b')]['FaxAccountId']=_0x55473a['id'];if(_0x311310['query']['filter']){_0x38a859[_0x8e3a('0x4b')]=_[_0x8e3a('0x50')](_0x38a859[_0x8e3a('0x4b')],{'$or':_[_0x8e3a('0x3f')](_0x38a859[_0x8e3a('0x47')],function(_0x3141c4){var _0x28093c={};_0x28093c[_0x3141c4]={'$like':'%'+_0x311310[_0x8e3a('0x42')]['filter']+'%'};return _0x28093c;})});}_0x38a859=_[_0x8e3a('0x50')]({},_0x38a859,_0x311310[_0x8e3a('0x51')]);return db['Disposition']['count']({'where':_0x38a859['where']})[_0x8e3a('0x1e')](function(_0x5da19e){_0xc14257[_0x8e3a('0x2e')]=_0x5da19e;if(_0x311310[_0x8e3a('0x42')][_0x8e3a('0x58')]){_0x38a859[_0x8e3a('0x53')]=[{'all':!![]}];}return db[_0x8e3a('0x65')][_0x8e3a('0x54')](_0x38a859);})[_0x8e3a('0x1e')](function(_0xf506b9){_0xc14257[_0x8e3a('0x55')]=_0xf506b9;return _0xc14257;});}})[_0x8e3a('0x1e')](respondWithFilteredResult(_0x21d0e1,_0x38a859))['catch'](handleError(_0x21d0e1,null));};exports['removeDispositions']=function(_0x8ee630,_0x298f2a,_0x41c431){return db[_0x8e3a('0x52')]['find']({'where':{'id':_0x8ee630[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x298f2a,null))[_0x8e3a('0x1e')](function(_0x3a0255){if(_0x3a0255){return _0x3a0255[_0x8e3a('0x6a')](_0x8ee630[_0x8e3a('0x42')][_0x8e3a('0x6b')]);}})[_0x8e3a('0x1e')](respondWithStatusCode(_0x298f2a,null))['catch'](handleError(_0x298f2a,null));};exports['addAnswer']=function(_0x5c90b4,_0x21edb0,_0xedc5e8){if(_0x5c90b4['body']['id']){delete _0x5c90b4[_0x8e3a('0x5b')]['id'];}return db[_0x8e3a('0x52')]['find']({'where':{'id':_0x5c90b4[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x21edb0,null))[_0x8e3a('0x1e')](function(_0x257f1e){if(_0x257f1e){_0x5c90b4['body']['FaxAccountId']=_0x257f1e['id'];return db[_0x8e3a('0x6c')][_0x8e3a('0x5a')](_0x5c90b4['body']);}})[_0x8e3a('0x1e')](respondWithResult(_0x21edb0,null))[_0x8e3a('0x28')](handleError(_0x21edb0,null));};exports[_0x8e3a('0x6d')]=function(_0x3986fd,_0xbd4603,_0x3f26f7){var _0xebcddf={'raw':![],'where':{}};var _0x1c90d8={};var _0x5dd71d={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8e3a('0x67')]({'where':{'id':_0x3986fd[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0xbd4603,null))['then'](function(_0x4cdf94){if(_0x4cdf94){_0x1c90d8[_0x8e3a('0x45')]=_['keys'](db[_0x8e3a('0x6c')][_0x8e3a('0x40')]);_0x1c90d8[_0x8e3a('0x42')]=_[_0x8e3a('0x43')](_0x3986fd[_0x8e3a('0x42')]);_0x1c90d8[_0x8e3a('0x4c')]=_[_0x8e3a('0x44')](_0x1c90d8[_0x8e3a('0x45')],_0x1c90d8[_0x8e3a('0x42')]);_0xebcddf[_0x8e3a('0x47')]=_[_0x8e3a('0x44')](_0x1c90d8['model'],qs['fields'](_0x3986fd['query'][_0x8e3a('0x46')]));_0xebcddf[_0x8e3a('0x47')]=_0xebcddf['attributes'][_0x8e3a('0x48')]?_0xebcddf['attributes']:_0x1c90d8[_0x8e3a('0x45')];if(!_0x3986fd[_0x8e3a('0x42')][_0x8e3a('0x6e')](_0x8e3a('0x49'))){_0xebcddf[_0x8e3a('0x2c')]=qs[_0x8e3a('0x2c')](_0x3986fd['query'][_0x8e3a('0x2c')]);_0xebcddf[_0x8e3a('0x2b')]=qs[_0x8e3a('0x2b')](_0x3986fd[_0x8e3a('0x42')][_0x8e3a('0x2b')]);}_0xebcddf['order']=qs['sort'](_0x3986fd['query'][_0x8e3a('0x4a')]);_0xebcddf[_0x8e3a('0x4b')]=qs[_0x8e3a('0x4c')](_[_0x8e3a('0x69')](_0x3986fd[_0x8e3a('0x42')],_0x1c90d8['filters']));_0xebcddf[_0x8e3a('0x4b')][_0x8e3a('0x64')]=_0x4cdf94['id'];if(_0x3986fd[_0x8e3a('0x42')][_0x8e3a('0x4d')]){_0xebcddf[_0x8e3a('0x4b')]=_['merge'](_0xebcddf[_0x8e3a('0x4b')],{'$or':_[_0x8e3a('0x3f')](_0xebcddf['attributes'],function(_0x4e7f58){var _0x439204={};_0x439204[_0x4e7f58]={'$like':'%'+_0x3986fd[_0x8e3a('0x42')][_0x8e3a('0x4d')]+'%'};return _0x439204;})});}_0xebcddf=_['merge']({},_0xebcddf,_0x3986fd[_0x8e3a('0x51')]);return db[_0x8e3a('0x6c')][_0x8e3a('0x2e')]({'where':_0xebcddf['where']})['then'](function(_0x57f575){_0x5dd71d[_0x8e3a('0x2e')]=_0x57f575;if(_0x3986fd[_0x8e3a('0x42')][_0x8e3a('0x58')]){_0xebcddf[_0x8e3a('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8e3a('0x54')](_0xebcddf);})[_0x8e3a('0x1e')](function(_0x24fb2e){_0x5dd71d[_0x8e3a('0x55')]=_0x24fb2e;return _0x5dd71d;});}})['then'](respondWithFilteredResult(_0xbd4603,_0xebcddf))[_0x8e3a('0x28')](handleError(_0xbd4603,null));};exports['removeAnswers']=function(_0x1c4103,_0x14fde4,_0x23becf){return db[_0x8e3a('0x52')][_0x8e3a('0x59')]({'where':{'id':_0x1c4103[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x14fde4,null))['then'](function(_0x4c9313){if(_0x4c9313){return _0x4c9313['removeAnswers'](_0x1c4103[_0x8e3a('0x42')][_0x8e3a('0x6b')]);}})['then'](respondWithStatusCode(_0x14fde4,null))[_0x8e3a('0x28')](handleError(_0x14fde4,null));};exports[_0x8e3a('0x6f')]=function(_0x559804,_0x588f69,_0x5ead94){return db[_0x8e3a('0x70')][_0x8e3a('0x59')]({'where':{'id':_0x559804[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x588f69,null))[_0x8e3a('0x1e')](function(_0x107c89){if(_0x107c89){return _0x107c89['addInteraction'](_0x559804[_0x8e3a('0x5b')][_0x8e3a('0x6b')],_['omit'](_0x559804['body'],[_0x8e3a('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x588f69,null))[_0x8e3a('0x28')](handleError(_0x588f69,null));};exports[_0x8e3a('0x71')]=function(_0x3f40bb,_0x5c949b,_0x2f24e8){var _0x4a4254={'raw':![],'where':{}};var _0x1df2cd={};var _0x209584={'count':0x0,'rows':[]};return db[_0x8e3a('0x52')][_0x8e3a('0x67')]({'where':{'id':_0x3f40bb[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x5c949b,null))[_0x8e3a('0x1e')](function(_0x461bea){if(_0x461bea){_0x1df2cd[_0x8e3a('0x45')]=_[_0x8e3a('0x43')](db[_0x8e3a('0x70')][_0x8e3a('0x40')]);_0x1df2cd[_0x8e3a('0x42')]=_[_0x8e3a('0x43')](_0x3f40bb[_0x8e3a('0x42')]);_0x1df2cd[_0x8e3a('0x4c')]=_[_0x8e3a('0x44')](_0x1df2cd[_0x8e3a('0x45')],_0x1df2cd['query']);_0x4a4254[_0x8e3a('0x47')]=_[_0x8e3a('0x44')](_0x1df2cd['model'],qs[_0x8e3a('0x46')](_0x3f40bb[_0x8e3a('0x42')]['fields']));_0x4a4254[_0x8e3a('0x47')]=_0x4a4254[_0x8e3a('0x47')][_0x8e3a('0x48')]?_0x4a4254['attributes']:_0x1df2cd[_0x8e3a('0x45')];if(!_0x3f40bb['query']['hasOwnProperty']('nolimit')){_0x4a4254[_0x8e3a('0x2c')]=qs[_0x8e3a('0x2c')](_0x3f40bb['query']['limit']);_0x4a4254[_0x8e3a('0x2b')]=qs[_0x8e3a('0x2b')](_0x3f40bb['query']['offset']);}_0x4a4254[_0x8e3a('0x68')]=qs[_0x8e3a('0x4a')](_0x3f40bb[_0x8e3a('0x42')][_0x8e3a('0x4a')]);_0x4a4254[_0x8e3a('0x4b')]=qs['filters'](_[_0x8e3a('0x69')](_0x3f40bb[_0x8e3a('0x42')],_0x1df2cd['filters']));_0x4a4254['where']['FaxAccountId']=_0x461bea['id'];if(_0x3f40bb[_0x8e3a('0x42')][_0x8e3a('0x4d')]){_0x4a4254[_0x8e3a('0x4b')]=_[_0x8e3a('0x50')](_0x4a4254['where'],{'$or':_[_0x8e3a('0x3f')](_0x4a4254[_0x8e3a('0x47')],function(_0x1801af){var _0xb34aa2={};_0xb34aa2[_0x1801af]={'$like':'%'+_0x3f40bb[_0x8e3a('0x42')]['filter']+'%'};return _0xb34aa2;})});}_0x4a4254=_['merge']({},_0x4a4254,_0x3f40bb[_0x8e3a('0x51')]);return db[_0x8e3a('0x70')][_0x8e3a('0x2e')]({'where':_0x4a4254[_0x8e3a('0x4b')]})[_0x8e3a('0x1e')](function(_0x1b2228){_0x209584[_0x8e3a('0x2e')]=_0x1b2228;if(_0x3f40bb[_0x8e3a('0x42')][_0x8e3a('0x58')]){_0x4a4254[_0x8e3a('0x53')]=[{'model':db[_0x8e3a('0x72')],'as':_0x8e3a('0x73'),'required':![]},{'model':db[_0x8e3a('0x74')],'as':_0x8e3a('0x75'),'attributes':[_0x8e3a('0x3b'),'fullname',_0x8e3a('0x76')],'required':![]},{'model':db[_0x8e3a('0x77')],'as':_0x8e3a('0x78'),'attributes':['id',_0x8e3a('0x3b'),'color'],'where':_0x3f40bb[_0x8e3a('0x42')]['tag']?{'id':_0x3f40bb[_0x8e3a('0x42')][_0x8e3a('0x79')]}:undefined,'required':_0x3f40bb[_0x8e3a('0x42')][_0x8e3a('0x79')]?!![]:![]}];}return db[_0x8e3a('0x70')][_0x8e3a('0x54')](_0x4a4254);})['then'](function(_0x1d469a){_0x209584[_0x8e3a('0x55')]=_0x1d469a;return _0x209584;});}})['then'](respondWithFilteredResult(_0x5c949b,_0x4a4254))[_0x8e3a('0x28')](handleError(_0x5c949b,null));};exports['addApplications']=function(_0x41e62d,_0x487897){var _0x4627dd=_0x41e62d[_0x8e3a('0x61')]['id'];var _0x262d8a=_0x41e62d[_0x8e3a('0x5b')];var _0x3d470a=0xc8;var _0x192276=null;return db[_0x8e3a('0x7a')][_0x8e3a('0x7b')]({'isolationLevel':db[_0x8e3a('0x7a')]['Transaction'][_0x8e3a('0x7c')][_0x8e3a('0x7d')]},function(_0x38e4bc){return db[_0x8e3a('0x52')][_0x8e3a('0x67')]({'where':{'id':_0x4627dd},'transaction':_0x38e4bc})[_0x8e3a('0x1e')](function(_0xb70542){if(_0xb70542){return db[_0x8e3a('0x7e')][_0x8e3a('0x35')]({'where':{'FaxAccountId':_0x4627dd},'transaction':_0x38e4bc})['then'](function(){var _0x5461b6=_[_0x8e3a('0x3f')](_0x262d8a,function(_0x24ac48){_0x24ac48['FaxAccountId']=_0x4627dd;return _0x24ac48;});return db[_0x8e3a('0x7e')][_0x8e3a('0x7f')](_0x5461b6,{'transaction':_0x38e4bc});});}else{_0x3d470a=0x194;_0x192276=[];}});})['then'](function(){if(_0x3d470a!==0x194){return db[_0x8e3a('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x4627dd},'order':_0x8e3a('0x80')})[_0x8e3a('0x1e')](function(_0x1ea43e){_0x192276=_0x1ea43e;});}})[_0x8e3a('0x28')](function(_0x2c5460){_0x3d470a=0x1f4;logger[_0x8e3a('0x24')](_0x2c5460[_0x8e3a('0x81')]);if(_0x2c5460['name']){delete _0x2c5460[_0x8e3a('0x3b')];}_0x192276=_0x2c5460;})[_0x8e3a('0x82')](function(){if(_0x192276===null){_0x487897[_0x8e3a('0x3a')](_0x3d470a);}else{if(_0x3d470a===0x1f4){_0x487897['status'](_0x3d470a)[_0x8e3a('0x3c')](_0x192276);}else{_0x487897[_0x8e3a('0x29')](_0x3d470a)[_0x8e3a('0x2a')](_0x192276);}}});};exports[_0x8e3a('0x83')]=function(_0x49da17,_0x4741ac,_0x1a703c){var _0x1d3e40={};var _0x5758b4={};var _0x2899b8;var _0x4574ad;return db[_0x8e3a('0x52')][_0x8e3a('0x67')]({'where':{'id':_0x49da17[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x4741ac,null))[_0x8e3a('0x1e')](function(_0x20ac4a){if(_0x20ac4a){_0x2899b8=_0x20ac4a;_0x5758b4[_0x8e3a('0x45')]=_[_0x8e3a('0x43')](db[_0x8e3a('0x7e')][_0x8e3a('0x40')]);_0x5758b4['query']=_['keys'](_0x49da17[_0x8e3a('0x42')]);_0x5758b4[_0x8e3a('0x4c')]=_[_0x8e3a('0x44')](_0x5758b4[_0x8e3a('0x45')],_0x5758b4[_0x8e3a('0x42')]);_0x1d3e40['attributes']=_['intersection'](_0x5758b4[_0x8e3a('0x45')],qs[_0x8e3a('0x46')](_0x49da17[_0x8e3a('0x42')][_0x8e3a('0x46')]));_0x1d3e40[_0x8e3a('0x47')]=_0x1d3e40[_0x8e3a('0x47')][_0x8e3a('0x48')]?_0x1d3e40[_0x8e3a('0x47')]:_0x5758b4[_0x8e3a('0x45')];_0x1d3e40['order']=qs[_0x8e3a('0x4a')](_0x49da17[_0x8e3a('0x42')]['sort']);_0x1d3e40['where']=qs[_0x8e3a('0x4c')](_['pick'](_0x49da17[_0x8e3a('0x42')],_0x5758b4[_0x8e3a('0x4c')]));if(_0x49da17[_0x8e3a('0x42')][_0x8e3a('0x4d')]){_0x1d3e40[_0x8e3a('0x4b')]=_[_0x8e3a('0x50')](_0x1d3e40[_0x8e3a('0x4b')],{'$or':_[_0x8e3a('0x3f')](_0x1d3e40[_0x8e3a('0x47')],function(_0x330a95){var _0x4201e6={};_0x4201e6[_0x330a95]={'$like':'%'+_0x49da17['query']['filter']+'%'};return _0x4201e6;})});}_0x1d3e40=_['merge']({},_0x1d3e40,_0x49da17[_0x8e3a('0x51')]);return _0x2899b8[_0x8e3a('0x83')](_0x1d3e40);}})[_0x8e3a('0x1e')](function(_0x3d4fde){if(_0x3d4fde){_0x4574ad=_0x3d4fde[_0x8e3a('0x48')];if(!_0x49da17[_0x8e3a('0x42')]['hasOwnProperty'](_0x8e3a('0x49'))){_0x1d3e40[_0x8e3a('0x2c')]=qs['limit'](_0x49da17['query']['limit']);_0x1d3e40[_0x8e3a('0x2b')]=qs[_0x8e3a('0x2b')](_0x49da17['query'][_0x8e3a('0x2b')]);}return _0x2899b8[_0x8e3a('0x83')](_0x1d3e40);}})['then'](function(_0x286db9){if(_0x286db9){return _0x286db9?{'count':_0x4574ad,'rows':_0x286db9}:null;}})[_0x8e3a('0x1e')](respondWithResult(_0x4741ac,null))[_0x8e3a('0x28')](handleError(_0x4741ac,null));};function Extension(_0x6503ac,_0x3e8572,_0x19a75a,_0x469e1d){this['context']=_0x8e3a('0x84');this[_0x8e3a('0x85')]=_0x6503ac['localstationid'];this[_0x8e3a('0x86')]=_0x469e1d;this[_0x8e3a('0x4e')]=_0x8e3a('0x87');this['description']=_0x8e3a('0x88');this[_0x8e3a('0x64')]=_0x6503ac['id'];this['priority']=_0x3e8572;this[_0x8e3a('0x89')]=_0x19a75a;}function createExtensionsReciveFax(_0x4f05a7){var _0x1064bf=0x1;var _0xed1d8e=[];_0xed1d8e['push'](new Extension(_0x4f05a7,_0x1064bf,'','Answer'));_0x1064bf+=0x1;_0xed1d8e[_0x8e3a('0x8a')](new Extension(_0x4f05a7,_0x1064bf,_0x8e3a('0x8b'),_0x8e3a('0x8c')));_0x1064bf+=0x1;for(var _0x3f1584 in _0x4f05a7){if(_0x4f05a7[_0x8e3a('0x6e')](_0x3f1584)&&(_0x3f1584==='ecm'||_0x3f1584===_0x8e3a('0x8d')||_0x3f1584===_0x8e3a('0x8e')||_0x3f1584===_0x8e3a('0x8f')||_0x3f1584===_0x8e3a('0x90')||_0x3f1584===_0x8e3a('0x91')||_0x3f1584===_0x8e3a('0x92')||_0x3f1584==='modem'||_0x3f1584===_0x8e3a('0x93'))){_0xed1d8e[_0x8e3a('0x8a')](new Extension(_0x4f05a7,_0x1064bf,'FAXOPT('+_0x3f1584+')='+_0x4f05a7[_0x3f1584],_0x8e3a('0x8c')));_0x1064bf+=0x1;}}_0xed1d8e['push'](new Extension(_0x4f05a7,_0x1064bf,'6',_0x8e3a('0x94')));_0x1064bf+=0x1;_0xed1d8e[_0x8e3a('0x8a')](new Extension(_0x4f05a7,_0x1064bf,'/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',_0x8e3a('0x95')));_0x1064bf=0x0;return _0xed1d8e;}exports[_0x8e3a('0x96')]=function(_0x5c6a38,_0x36efc6,_0x462a8c){var _0x4e6077;return db[_0x8e3a('0x7a')][_0x8e3a('0x7b')](function(_0x79bfb2){return db[_0x8e3a('0x52')]['create'](_0x5c6a38[_0x8e3a('0x5b')],{'transaction':_0x79bfb2})[_0x8e3a('0x1e')](function(_0x3b24d0){_0x4e6077=_0x3b24d0[_0x8e3a('0x36')]({'plain':!![]});return db[_0x8e3a('0x97')][_0x8e3a('0x7f')](createExtensionsReciveFax(_0x4e6077),{'transaction':_0x79bfb2});});})[_0x8e3a('0x1e')](function(){return _0x4e6077;})[_0x8e3a('0x1e')](respondWithResult(_0x36efc6,null))[_0x8e3a('0x28')](handleError(_0x36efc6,null));};exports['updateAccountApplications']=function(_0x32dc9b,_0x1fdbf7,_0x2c4a73){var _0x286df3;return db[_0x8e3a('0x7a')]['transaction'](function(_0x262922){return db['FaxAccount'][_0x8e3a('0x34')](_0x32dc9b[_0x8e3a('0x5b')],{'where':{'id':_0x32dc9b[_0x8e3a('0x5b')]['id']},'transaction':_0x262922})[_0x8e3a('0x1e')](function(_0x32a818){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x32dc9b[_0x8e3a('0x5b')]['id']},'transaction':_0x262922})[_0x8e3a('0x1e')](function(_0x4f67d3){return db['VoiceExtension'][_0x8e3a('0x7f')](createExtensionsReciveFax(_['omit'](_0x32dc9b[_0x8e3a('0x5b')],[_0x8e3a('0x98'),_0x8e3a('0x41'),_0x8e3a('0x99'),'updatedAt','TrunkId',_0x8e3a('0x9a')])),{'transaction':_0x262922});});});})[_0x8e3a('0x1e')](function(){return db['FaxAccount'][_0x8e3a('0x9b')](_0x32dc9b['body']['id']);})[_0x8e3a('0x1e')](respondWithResult(_0x1fdbf7,null))['catch'](handleError(_0x1fdbf7,null));};exports[_0x8e3a('0x9c')]=function(_0x4af929,_0x4d5e6f,_0x234465){var _0x107078={'raw':!![],'where':{}};var _0x52ac36={};var _0x45c047={'count':0x0,'rows':[]};return db[_0x8e3a('0x52')][_0x8e3a('0x67')]({'where':{'id':_0x4af929[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x4d5e6f,null))[_0x8e3a('0x1e')](function(_0x35d920){if(_0x35d920){_0x52ac36[_0x8e3a('0x45')]=_[_0x8e3a('0x43')](db[_0x8e3a('0x9d')][_0x8e3a('0x40')]);_0x52ac36[_0x8e3a('0x42')]=_[_0x8e3a('0x43')](_0x4af929['query']);_0x52ac36['filters']=_[_0x8e3a('0x44')](_0x52ac36[_0x8e3a('0x45')],_0x52ac36[_0x8e3a('0x42')]);_0x107078[_0x8e3a('0x47')]=_[_0x8e3a('0x44')](_0x52ac36[_0x8e3a('0x45')],qs['fields'](_0x4af929[_0x8e3a('0x42')][_0x8e3a('0x46')]));_0x107078[_0x8e3a('0x47')]=_0x107078['attributes']['length']?_0x107078[_0x8e3a('0x47')]:_0x52ac36[_0x8e3a('0x45')];if(!_0x4af929[_0x8e3a('0x42')][_0x8e3a('0x6e')](_0x8e3a('0x49'))){_0x107078[_0x8e3a('0x2c')]=qs[_0x8e3a('0x2c')](_0x4af929[_0x8e3a('0x42')]['limit']);_0x107078['offset']=qs[_0x8e3a('0x2b')](_0x4af929[_0x8e3a('0x42')]['offset']);}_0x107078['order']=qs[_0x8e3a('0x4a')](_0x4af929[_0x8e3a('0x42')][_0x8e3a('0x4a')]);_0x107078[_0x8e3a('0x4b')]=qs[_0x8e3a('0x4c')](_[_0x8e3a('0x69')](_0x4af929[_0x8e3a('0x42')],_0x52ac36[_0x8e3a('0x4c')]));_0x107078[_0x8e3a('0x4b')]['FaxAccountId']=_0x35d920['id'];if(_0x4af929[_0x8e3a('0x42')]['filter']){_0x107078[_0x8e3a('0x4b')]=_[_0x8e3a('0x50')](_0x107078[_0x8e3a('0x4b')],{'$or':_[_0x8e3a('0x3f')](_0x107078[_0x8e3a('0x47')],function(_0x40ec0a){var _0x5eead6={};_0x5eead6[_0x40ec0a]={'$like':'%'+_0x4af929[_0x8e3a('0x42')][_0x8e3a('0x4d')]+'%'};return _0x5eead6;})});}if(_0x4af929['query'][_0x8e3a('0x9e')]){var _0x2cc19f=_0x4af929[_0x8e3a('0x42')]['$gte']['split'](',');var _0x284095={};_0x284095[_0x2cc19f[0x0]]={'$gte':moment(_0x2cc19f[0x1])['format'](_0x8e3a('0x9f'))};_0x107078['where']=_['merge'](_0x107078[_0x8e3a('0x4b')],_0x284095);}_0x107078=_['merge']({},_0x107078,_0x4af929[_0x8e3a('0x51')]);return db['FaxMessage'][_0x8e3a('0x2e')]({'where':_0x107078[_0x8e3a('0x4b')]})[_0x8e3a('0x1e')](function(_0x3ed6b5){_0x45c047[_0x8e3a('0x2e')]=_0x3ed6b5;if(_0x4af929[_0x8e3a('0x42')][_0x8e3a('0x58')]){_0x107078['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x107078);})[_0x8e3a('0x1e')](function(_0x28f254){_0x45c047['rows']=_0x28f254;return _0x45c047;});}})[_0x8e3a('0x1e')](respondWithFilteredResult(_0x4d5e6f,_0x107078))[_0x8e3a('0x28')](handleError(_0x4d5e6f,null));};exports[_0x8e3a('0x3c')]=function(_0x4294f8,_0x200a7f,_0x9d78c4){var _0x2214e0,_0x3fd11d={},_0x91c92e;if(_0x4294f8[_0x8e3a('0x5b')]['to']){_0x91c92e=_0x4294f8['body']['to'][0x0];}return db['FaxAccount'][_0x8e3a('0x59')]({'where':{'id':_0x4294f8[_0x8e3a('0x61')]['id']},'include':[{'model':db[_0x8e3a('0xa0')],'as':_0x8e3a('0xa1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x91c92e},'limit':0x1,'order':[[_0x8e3a('0xa2'),_0x8e3a('0xa3')]]}]}]})[_0x8e3a('0x1e')](handleEntityNotFound(_0x200a7f,null))[_0x8e3a('0x1e')](function(_0x25d0ad){_0x2214e0=_0x25d0ad;if(_0x4294f8[_0x8e3a('0x5b')]['attachments']&&_0x4294f8[_0x8e3a('0x5b')][_0x8e3a('0xa4')][_0x8e3a('0x48')]){for(var _0x400131=0x0;_0x400131<_0x4294f8['body'][_0x8e3a('0xa4')][_0x8e3a('0x48')];_0x400131+=0x1){_0x4294f8[_0x8e3a('0x5b')]['attachments'][_0x400131]={'filename':_0x4294f8['body'][_0x8e3a('0xa4')][_0x400131][_0x8e3a('0x3b')],'id':_0x4294f8[_0x8e3a('0x5b')][_0x8e3a('0xa4')][_0x400131]['id'],'path':path[_0x8e3a('0xa5')](config[_0x8e3a('0xa6')],'server/files/attachments',_0x4294f8['body'][_0x8e3a('0xa4')][_0x400131][_0x8e3a('0xa7')])};}}return respondWithRpcPromise(_0x8e3a('0xa8'),_0x8e3a('0xa8'),{'FaxAccountId':_['isNil'](_0x4294f8[_0x8e3a('0x61')]['id'])?undefined:_0x4294f8[_0x8e3a('0x61')]['id'],'path':_[_0x8e3a('0xa9')](_0x4294f8[_0x8e3a('0x5b')]['attachments'][0x0][_0x8e3a('0xaa')])?undefined:_0x4294f8[_0x8e3a('0x5b')][_0x8e3a('0xa4')][0x0][_0x8e3a('0xaa')],'fax':_['isNil'](_0x4294f8[_0x8e3a('0x5b')]['to'][0x0])?undefined:_0x4294f8[_0x8e3a('0x5b')]['to'][0x0]},client9002);})[_0x8e3a('0x1e')](function(){if(_0x2214e0){if(_[_0x8e3a('0xa9')](_0x4294f8[_0x8e3a('0x5b')]['from'])){_0x4294f8['body'][_0x8e3a('0xab')]=util[_0x8e3a('0xac')](_0x8e3a('0xad'),_0x2214e0['name'],_0x2214e0[_0x8e3a('0xae')]);}if(_0x2214e0['List']){if(_0x2214e0[_0x8e3a('0xa1')]['Contacts'][_0x8e3a('0x48')]){return _0x2214e0[_0x8e3a('0xa1')][_0x8e3a('0xaf')][0x0];}else{return db[_0x8e3a('0x72')][_0x8e3a('0x5a')](_['defaults'](_0x4294f8[_0x8e3a('0x5b')],{'firstName':_0x4294f8[_0x8e3a('0x5b')]['to'][0x0],'phone':_0x4294f8[_0x8e3a('0x5b')]['to'][0x0],'fax':_0x4294f8[_0x8e3a('0x5b')]['to'][0x0],'ListId':_0x2214e0['ListId']}));}}else{throw new Error(_0x8e3a('0xb0'));}}else{throw new Error(_0x8e3a('0xb1'));}})[_0x8e3a('0x1e')](function(_0x34d843){if(_0x34d843){return db[_0x8e3a('0x70')][_0x8e3a('0x59')]({'where':{'ContactId':_0x34d843['id'],'closed':![],'FaxAccountId':_0x2214e0['id']}})['then'](function(_0x3c4dfe){if(_0x3c4dfe){return[_0x3c4dfe,![]];}return db[_0x8e3a('0x70')][_0x8e3a('0x5a')]({'UserId':_0x4294f8[_0x8e3a('0x5c')]['id'],'ContactId':_0x34d843['id'],'FaxAccountId':_0x2214e0['id'],'fax':_0x4294f8['body']['to'][0x0],'firstMsgDirection':_0x8e3a('0xb2'),'Messages':[_[_0x8e3a('0x50')](_0x4294f8[_0x8e3a('0x5b')],{'read':![],'body':_0x4294f8['body'][_0x8e3a('0xa4')][0x0][_0x8e3a('0xb3')],'FaxAccountId':_0x2214e0['id'],'UserId':_0x4294f8[_0x8e3a('0x5c')]['id'],'ContactId':_0x34d843['id'],'AttachmentId':_0x4294f8['body'][_0x8e3a('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x8e3a('0x9d')],'as':_0x8e3a('0xb4')}]})[_0x8e3a('0x1e')](function(_0x4ec448){return[_0x4ec448,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8e3a('0xb5')](function(_0xd7b5fa,_0x423863){if(_0x423863){return _0xd7b5fa;}return db[_0x8e3a('0x9d')][_0x8e3a('0x5a')]({'direction':_0x8e3a('0xb2'),'read':![],'body':_0x4294f8[_0x8e3a('0x5b')][_0x8e3a('0xa4')][0x0][_0x8e3a('0xb3')],'FaxAccountId':_0x2214e0['id'],'FaxInteractionId':_0xd7b5fa['id'],'UserId':_0x4294f8[_0x8e3a('0x5c')]['id'],'ContactId':_0xd7b5fa['ContactId'],'AttachmentId':_0x4294f8[_0x8e3a('0x5b')][_0x8e3a('0xa4')][0x0]['id']})[_0x8e3a('0x1e')](function(_0x4a2974){_0xd7b5fa[_0x8e3a('0xb6')][_0x8e3a('0xb4')]=[];_0xd7b5fa[_0x8e3a('0xb6')]['Messages']['push'](_0x4a2974[_0x8e3a('0xb6')]);return _0xd7b5fa;});})[_0x8e3a('0x1e')](function(_0x3618ec){respondWithRpcPromise('SendFax',_0x8e3a('0xb7'),{'FaxAccountId':_[_0x8e3a('0xa9')](_0x4294f8[_0x8e3a('0x61')]['id'])?undefined:_0x4294f8[_0x8e3a('0x61')]['id'],'path':_[_0x8e3a('0xa9')](_0x4294f8['body']['attachments'][0x0][_0x8e3a('0xaa')])?undefined:_0x4294f8[_0x8e3a('0x5b')][_0x8e3a('0xa4')][0x0][_0x8e3a('0xaa')],'fax':_[_0x8e3a('0xa9')](_0x4294f8[_0x8e3a('0x5b')]['to'][0x0])?undefined:_0x4294f8['body']['to'][0x0],'AttachmentId':_0x4294f8[_0x8e3a('0x5b')][_0x8e3a('0xa4')][0x0]['id']},client9002)['then'](function(_0x44940d){logger['info']('SendFaxRpc,\x20%s',_0x44940d);})[_0x8e3a('0x28')](function(_0x4accdd){logger['info'](_0x8e3a('0xb8'),_0x4accdd);});return _0x3618ec;})[_0x8e3a('0x1e')](respondWithResult(_0x200a7f,null))['catch'](handleError(_0x200a7f,null));};exports[_0x8e3a('0xb9')]=function(_0x1fea71,_0xe25ed8,_0x2ded4c){return db[_0x8e3a('0x52')][_0x8e3a('0x59')]({'where':{'id':_0x1fea71[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0xe25ed8,null))[_0x8e3a('0x1e')](function(_0x50cd0c){if(_0x50cd0c){return _0x50cd0c[_0x8e3a('0xb9')](_0x1fea71[_0x8e3a('0x5b')][_0x8e3a('0x6b')],_[_0x8e3a('0xba')](_0x1fea71['body'],[_0x8e3a('0x6b'),'id'])||{})[_0x8e3a('0xb5')](function(_0x5f30cd){for(var _0x509cd6=0x0;_0x509cd6<_0x1fea71[_0x8e3a('0x5b')]['ids']['length'];_0x509cd6+=0x1){socket[_0x8e3a('0xbb')](_0x8e3a('0xbc'),{'UserId':Number(_0x1fea71['body']['ids'][_0x509cd6]),'FaxAccountId':Number(_0x1fea71[_0x8e3a('0x61')]['id'])});}return _0x5f30cd;});}})['then'](respondWithResult(_0xe25ed8,null))[_0x8e3a('0x28')](handleError(_0xe25ed8,null));};exports[_0x8e3a('0xbd')]=function(_0x8e5e19,_0x401eba,_0x42e643){return db['FaxAccount'][_0x8e3a('0x59')]({'where':{'id':_0x8e5e19[_0x8e3a('0x61')]['id']}})[_0x8e3a('0x1e')](handleEntityNotFound(_0x401eba,null))[_0x8e3a('0x1e')](function(_0x363d57){if(_0x363d57){return _0x363d57[_0x8e3a('0xbd')](_0x8e5e19[_0x8e3a('0x42')][_0x8e3a('0x6b')])[_0x8e3a('0x1e')](function(){if(_[_0x8e3a('0xbe')](_0x8e5e19[_0x8e3a('0x42')][_0x8e3a('0x6b')])){for(var _0xd53c86=0x0;_0xd53c86<_0x8e5e19[_0x8e3a('0x42')]['ids'][_0x8e3a('0x48')];_0xd53c86+=0x1){socket[_0x8e3a('0xbb')](_0x8e3a('0xbf'),{'UserId':Number(_0x8e5e19[_0x8e3a('0x42')][_0x8e3a('0x6b')][_0xd53c86]),'FaxAccountId':Number(_0x8e5e19[_0x8e3a('0x61')]['id'])});}}else{socket[_0x8e3a('0xbb')](_0x8e3a('0xbf'),{'UserId':Number(_0x8e5e19['query'][_0x8e3a('0x6b')]),'FaxAccountId':Number(_0x8e5e19[_0x8e3a('0x61')]['id'])});}});}})[_0x8e3a('0x1e')](respondWithStatusCode(_0x401eba,null))[_0x8e3a('0x28')](handleError(_0x401eba,null));};exports[_0x8e3a('0xc0')]=function(_0x2b9075,_0x3d34f1,_0x37e19e){var _0x4ae34e={};var _0x32822f={};var _0x1dc3be;var _0xab07f4;return db[_0x8e3a('0x52')][_0x8e3a('0x67')]({'where':{'id':_0x2b9075[_0x8e3a('0x61')]['id']}})['then'](handleEntityNotFound(_0x3d34f1,null))['then'](function(_0x2cc9c4){if(_0x2cc9c4){_0x1dc3be=_0x2cc9c4;_0x32822f[_0x8e3a('0x45')]=_[_0x8e3a('0x43')](db[_0x8e3a('0x74')][_0x8e3a('0x40')]);_0x32822f[_0x8e3a('0x42')]=_[_0x8e3a('0x43')](_0x2b9075['query']);_0x32822f[_0x8e3a('0x4c')]=_[_0x8e3a('0x44')](_0x32822f[_0x8e3a('0x45')],_0x32822f[_0x8e3a('0x42')]);_0x4ae34e[_0x8e3a('0x47')]=_[_0x8e3a('0x44')](_0x32822f['model'],qs[_0x8e3a('0x46')](_0x2b9075[_0x8e3a('0x42')][_0x8e3a('0x46')]));_0x4ae34e[_0x8e3a('0x47')]=_0x4ae34e[_0x8e3a('0x47')][_0x8e3a('0x48')]?_0x4ae34e[_0x8e3a('0x47')]:_0x32822f['model'];_0x4ae34e[_0x8e3a('0x68')]=qs[_0x8e3a('0x4a')](_0x2b9075[_0x8e3a('0x42')][_0x8e3a('0x4a')]);_0x4ae34e[_0x8e3a('0x4b')]=qs[_0x8e3a('0x4c')](_['pick'](_0x2b9075[_0x8e3a('0x42')],_0x32822f[_0x8e3a('0x4c')]));if(_0x2b9075[_0x8e3a('0x42')][_0x8e3a('0x4d')]){_0x4ae34e['where']=_[_0x8e3a('0x50')](_0x4ae34e[_0x8e3a('0x4b')],{'$or':_[_0x8e3a('0x3f')](_0x4ae34e[_0x8e3a('0x47')],function(_0x33bdde){var _0x402f7b={};_0x402f7b[_0x33bdde]={'$like':'%'+_0x2b9075[_0x8e3a('0x42')][_0x8e3a('0x4d')]+'%'};return _0x402f7b;})});}_0x4ae34e=_[_0x8e3a('0x50')]({},_0x4ae34e,_0x2b9075[_0x8e3a('0x51')]);return _0x1dc3be['getAgents'](_0x4ae34e);}})[_0x8e3a('0x1e')](function(_0x3b7071){if(_0x3b7071){_0xab07f4=_0x3b7071[_0x8e3a('0x48')];if(!_0x2b9075[_0x8e3a('0x42')]['hasOwnProperty'](_0x8e3a('0x49'))){_0x4ae34e[_0x8e3a('0x2c')]=qs['limit'](_0x2b9075[_0x8e3a('0x42')][_0x8e3a('0x2c')]);_0x4ae34e[_0x8e3a('0x2b')]=qs[_0x8e3a('0x2b')](_0x2b9075[_0x8e3a('0x42')][_0x8e3a('0x2b')]);}return _0x1dc3be['getAgents'](_0x4ae34e);}})['then'](function(_0x3581ed){if(_0x3581ed){return _0x3581ed?{'count':_0xab07f4,'rows':_0x3581ed}:null;}})[_0x8e3a('0x1e')](respondWithResult(_0x3d34f1,null))[_0x8e3a('0x28')](handleError(_0x3d34f1,null));}; \ No newline at end of file +var _0x42de=['updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','format','send','CmList','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','Contacts','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxAccounts','sendStatus','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','FaxAccount','includeAll','include','findAll','rows','catch','params','length','options','create','body','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','order','removeDispositions','CannedAnswer','removeAnswers','ids','addInteraction','omit','findOne','FaxInteraction','CmContact','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','bulkCreate','tech'];(function(_0x39f532,_0x27b526){var _0x442459=function(_0x4f0e6a){while(--_0x4f0e6a){_0x39f532['push'](_0x39f532['shift']());}};_0x442459(++_0x27b526);}(_0x42de,0xe6));var _0xe42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42de[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe42d('0x0'));var jsonpatch=require(_0xe42d('0x1'));var rp=require(_0xe42d('0x2'));var moment=require('moment');var BPromise=require(_0xe42d('0x3'));var Mustache=require('mustache');var util=require(_0xe42d('0x4'));var path=require('path');var sox=require(_0xe42d('0x5'));var csv=require('to-csv');var ejs=require(_0xe42d('0x6'));var fs=require('fs');var fs_extra=require(_0xe42d('0x7'));var _=require('lodash');var squel=require(_0xe42d('0x8'));var crypto=require(_0xe42d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe42d('0xa'));var toCsv=require(_0xe42d('0xb'));var querystring=require(_0xe42d('0xc'));var Papa=require(_0xe42d('0xd'));var Redis=require(_0xe42d('0xe'));var authService=require(_0xe42d('0xf'));var qs=require(_0xe42d('0x10'));var as=require(_0xe42d('0x11'));var hardwareService=require(_0xe42d('0x12'));var logger=require(_0xe42d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe42d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe42d('0x15'))['db'];config[_0xe42d('0x16')]=_['defaults'](config['redis'],{'host':_0xe42d('0x17'),'port':0x18eb});var socket=require(_0xe42d('0x18'))(new Redis(config[_0xe42d('0x16')]));require(_0xe42d('0x19'))[_0xe42d('0x1a')](socket);var jayson=require(_0xe42d('0x1b'));var client=jayson['client'][_0xe42d('0x1c')]({'port':0x232c});var client9002=jayson[_0xe42d('0x1d')][_0xe42d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x52989d,_0x3bafab,_0x7406dc,_0x4370be){return new BPromise(function(_0x3a561f,_0x606cea){var _0x59601e=_0x4370be||client;return _0x59601e[_0xe42d('0x1e')](_0x52989d,_0x7406dc)['then'](function(_0x42e8a3){logger[_0xe42d('0x1f')](_0xe42d('0x20'),_0x3bafab,'request\x20sent');logger['debug'](_0xe42d('0x21'),_0x3bafab,_0xe42d('0x22'),JSON[_0xe42d('0x23')](_0x42e8a3));if(_0x42e8a3['error']){if(_0x42e8a3[_0xe42d('0x24')][_0xe42d('0x25')]===0x1f4){logger[_0xe42d('0x24')](_0xe42d('0x20'),_0x3bafab,_0x42e8a3[_0xe42d('0x24')][_0xe42d('0x26')]);return _0x606cea(_0x42e8a3[_0xe42d('0x24')][_0xe42d('0x26')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x3bafab,_0x42e8a3['error'][_0xe42d('0x26')]);return _0x3a561f(_0x42e8a3['error'][_0xe42d('0x26')]);}else{logger[_0xe42d('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x3bafab,_0xe42d('0x22'));_0x3a561f(_0x42e8a3[_0xe42d('0x27')][_0xe42d('0x26')]);}})['catch'](function(_0x57bf64){logger[_0xe42d('0x24')](_0xe42d('0x20'),_0x3bafab,_0x57bf64);_0x606cea(_0x57bf64);});});}function respondWithStatusCode(_0x3d2365,_0xffe7ba){_0xffe7ba=_0xffe7ba||0xcc;return function(_0xd4ef90){if(_0xd4ef90){return _0x3d2365['sendStatus'](_0xffe7ba);}return _0x3d2365['status'](_0xffe7ba)[_0xe42d('0x28')]();};}function respondWithResult(_0x8ff145,_0x157a83){_0x157a83=_0x157a83||0xc8;return function(_0x31b291){if(_0x31b291){return _0x8ff145[_0xe42d('0x29')](_0x157a83)[_0xe42d('0x2a')](_0x31b291);}};}function respondWithFilteredResult(_0x333787,_0x466473){return function(_0x144aa5){if(_0x144aa5){var _0x3aac83=typeof _0x466473[_0xe42d('0x2b')]===_0xe42d('0x2c')&&typeof _0x466473[_0xe42d('0x2d')]===_0xe42d('0x2c');var _0x12e54f=_0x144aa5[_0xe42d('0x2e')];var _0x5be674=_0x3aac83?0x0:_0x466473[_0xe42d('0x2b')];var _0x452325=_0x3aac83?_0x144aa5[_0xe42d('0x2e')]:_0x466473[_0xe42d('0x2b')]+_0x466473[_0xe42d('0x2d')];var _0x18c4c7;if(_0x452325>=_0x12e54f){_0x452325=_0x12e54f;_0x18c4c7=0xc8;}else{_0x18c4c7=0xce;}_0x333787['status'](_0x18c4c7);return _0x333787[_0xe42d('0x2f')](_0xe42d('0x30'),_0x5be674+'-'+_0x452325+'/'+_0x12e54f)[_0xe42d('0x2a')](_0x144aa5);}return null;};}function patchUpdates(_0x5301e2){return function(_0x31fbaa){try{jsonpatch[_0xe42d('0x31')](_0x31fbaa,_0x5301e2,!![]);}catch(_0x4e0d39){return BPromise[_0xe42d('0x32')](_0x4e0d39);}return _0x31fbaa[_0xe42d('0x33')]();};}function saveUpdates(_0x5b1430,_0x14dc89){return function(_0x3e2432){if(_0x3e2432){return _0x3e2432[_0xe42d('0x34')](_0x5b1430)[_0xe42d('0x35')](function(_0x5e454d){return _0x5e454d;});}return null;};}function removeEntity(_0x299f02,_0x211c77){return function(_0x5a4cf8){if(_0x5a4cf8){return _0x5a4cf8[_0xe42d('0x36')]()[_0xe42d('0x35')](function(){var _0x74a02a=_0x5a4cf8[_0xe42d('0x37')]({'plain':!![]});var _0x4a3fa9=_0xe42d('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a3fa9,'resourceId':_0x74a02a['id']}})[_0xe42d('0x35')](function(){return _0x5a4cf8;});})['then'](function(){_0x299f02[_0xe42d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22464d,_0x3286f7){return function(_0x50ce3c){if(!_0x50ce3c){_0x22464d[_0xe42d('0x39')](0x194);}return _0x50ce3c;};}function handleError(_0x5ba8b7,_0x505bac){_0x505bac=_0x505bac||0x1f4;return function(_0x43a002){logger['error'](_0x43a002['stack']);if(_0x43a002[_0xe42d('0x3a')]){delete _0x43a002[_0xe42d('0x3a')];}_0x5ba8b7[_0xe42d('0x29')](_0x505bac)['send'](_0x43a002);};}exports[_0xe42d('0x3b')]=function(_0x278cae,_0x52bb0c){var _0x237654={'include':[{'model':db[_0xe42d('0x3c')],'as':_0xe42d('0x3d')}]},_0x5e6b0a={},_0x5d1e03={'count':0x0,'rows':[]};var _0x18f7e5=_[_0xe42d('0x3e')](db['FaxAccount'][_0xe42d('0x3f')],function(_0x19edae){return{'name':_0x19edae['fieldName'],'type':_0x19edae['type'][_0xe42d('0x40')]};});_0x5e6b0a['model']=_[_0xe42d('0x3e')](_0x18f7e5,_0xe42d('0x3a'));_0x5e6b0a[_0xe42d('0x41')]=_[_0xe42d('0x42')](_0x278cae['query']);_0x5e6b0a[_0xe42d('0x43')]=_[_0xe42d('0x44')](_0x5e6b0a[_0xe42d('0x45')],_0x5e6b0a[_0xe42d('0x41')]);_0x237654[_0xe42d('0x46')]=_['intersection'](_0x5e6b0a[_0xe42d('0x45')],qs[_0xe42d('0x47')](_0x278cae[_0xe42d('0x41')][_0xe42d('0x47')]));_0x237654[_0xe42d('0x46')]=_0x237654[_0xe42d('0x46')]['length']?_0x237654[_0xe42d('0x46')]:_0x5e6b0a[_0xe42d('0x45')];if(!_0x278cae[_0xe42d('0x41')][_0xe42d('0x48')](_0xe42d('0x49'))){_0x237654[_0xe42d('0x2d')]=qs[_0xe42d('0x2d')](_0x278cae['query'][_0xe42d('0x2d')]);_0x237654[_0xe42d('0x2b')]=qs['offset'](_0x278cae[_0xe42d('0x41')][_0xe42d('0x2b')]);}_0x237654['order']=qs[_0xe42d('0x4a')](_0x278cae[_0xe42d('0x41')]['sort']);_0x237654[_0xe42d('0x4b')]=qs['filters'](_[_0xe42d('0x4c')](_0x278cae['query'],_0x5e6b0a[_0xe42d('0x43')]),_0x18f7e5);if(_0x278cae[_0xe42d('0x41')][_0xe42d('0x4d')]){_0x237654[_0xe42d('0x4b')]=_[_0xe42d('0x4e')](_0x237654[_0xe42d('0x4b')],{'$or':_[_0xe42d('0x3e')](_0x18f7e5,function(_0x538d33){if(_0x538d33[_0xe42d('0x4f')]!==_0xe42d('0x50')){var _0x5d28d2={};_0x5d28d2[_0x538d33['name']]={'$like':'%'+_0x278cae[_0xe42d('0x41')][_0xe42d('0x4d')]+'%'};return _0x5d28d2;}})});}_0x237654=_[_0xe42d('0x4e')]({},_0x237654,_0x278cae['options']);var _0x4f2668={'where':_0x237654[_0xe42d('0x4b')]};return db[_0xe42d('0x51')][_0xe42d('0x2e')](_0x4f2668)[_0xe42d('0x35')](function(_0x5ccff6){_0x5d1e03['count']=_0x5ccff6;if(_0x278cae[_0xe42d('0x41')][_0xe42d('0x52')]){_0x237654[_0xe42d('0x53')]=[{'all':!![]}];}return db[_0xe42d('0x51')][_0xe42d('0x54')](_0x237654);})[_0xe42d('0x35')](function(_0x47f016){_0x5d1e03[_0xe42d('0x55')]=_0x47f016;return _0x5d1e03;})['then'](respondWithFilteredResult(_0x52bb0c,_0x237654))[_0xe42d('0x56')](handleError(_0x52bb0c,null));};exports['show']=function(_0x278918,_0x26aa47){var _0x584678={'raw':![],'where':{'id':_0x278918[_0xe42d('0x57')]['id']},'include':[{'model':db[_0xe42d('0x3c')],'as':_0xe42d('0x3d')}]},_0x4ff22f={};_0x4ff22f[_0xe42d('0x45')]=_['keys'](db[_0xe42d('0x51')][_0xe42d('0x3f')]);_0x4ff22f[_0xe42d('0x41')]=_[_0xe42d('0x42')](_0x278918[_0xe42d('0x41')]);_0x4ff22f['filters']=_[_0xe42d('0x44')](_0x4ff22f[_0xe42d('0x45')],_0x4ff22f[_0xe42d('0x41')]);_0x584678['attributes']=_['intersection'](_0x4ff22f[_0xe42d('0x45')],qs['fields'](_0x278918[_0xe42d('0x41')][_0xe42d('0x47')]));_0x584678['attributes']=_0x584678['attributes'][_0xe42d('0x58')]?_0x584678[_0xe42d('0x46')]:_0x4ff22f[_0xe42d('0x45')];if(_0x278918[_0xe42d('0x41')]['includeAll']){_0x584678[_0xe42d('0x53')]=[{'all':!![]}];}_0x584678=_[_0xe42d('0x4e')]({},_0x584678,_0x278918[_0xe42d('0x59')]);return db[_0xe42d('0x51')]['find'](_0x584678)['then'](handleEntityNotFound(_0x26aa47,null))[_0xe42d('0x35')](respondWithResult(_0x26aa47,null))['catch'](handleError(_0x26aa47,null));};exports[_0xe42d('0x5a')]=function(_0xcf509b,_0x3dfa97){return db[_0xe42d('0x51')][_0xe42d('0x5a')](_0xcf509b[_0xe42d('0x5b')],{})[_0xe42d('0x35')](function(_0x3dbfaa){var _0x4f844f=_0xcf509b[_0xe42d('0x5c')][_0xe42d('0x37')]({'plain':!![]});if(!_0x4f844f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f844f[_0xe42d('0x5d')]===_0xe42d('0x5c')){var _0x5ea16e=_0x3dbfaa['get']({'plain':!![]});var _0x253fbe=_0xe42d('0x38');return db[_0xe42d('0x5e')][_0xe42d('0x5f')]({'where':{'name':_0x253fbe,'userProfileId':_0x4f844f[_0xe42d('0x60')]},'raw':!![]})[_0xe42d('0x35')](function(_0x81f194){if(_0x81f194&&_0x81f194['autoAssociation']===0x0){return db['UserProfileResource'][_0xe42d('0x5a')]({'name':_0x5ea16e[_0xe42d('0x3a')],'resourceId':_0x5ea16e['id'],'type':_0x81f194[_0xe42d('0x3a')],'sectionId':_0x81f194['id']},{})[_0xe42d('0x35')](function(){return _0x3dbfaa;});}else{return _0x3dbfaa;}})[_0xe42d('0x56')](function(_0x298be3){logger['error'](_0xe42d('0x61'),_0x298be3);throw _0x298be3;});}return _0x3dbfaa;})[_0xe42d('0x35')](respondWithResult(_0x3dfa97,0xc9))[_0xe42d('0x56')](handleError(_0x3dfa97,null));};exports['update']=function(_0x56f7c4,_0x55e6f6){if(_0x56f7c4[_0xe42d('0x5b')]['id']){delete _0x56f7c4[_0xe42d('0x5b')]['id'];}return db[_0xe42d('0x51')]['find']({'where':{'id':_0x56f7c4['params']['id']},'include':[{'model':db[_0xe42d('0x3c')],'as':_0xe42d('0x3d')}]})[_0xe42d('0x35')](handleEntityNotFound(_0x55e6f6,null))[_0xe42d('0x35')](saveUpdates(_0x56f7c4[_0xe42d('0x5b')],null))[_0xe42d('0x35')](respondWithResult(_0x55e6f6,null))[_0xe42d('0x56')](handleError(_0x55e6f6,null));};exports[_0xe42d('0x36')]=function(_0x1b4f19,_0x12d294){return db[_0xe42d('0x51')][_0xe42d('0x5f')]({'where':{'id':_0x1b4f19[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x12d294,null))[_0xe42d('0x35')](removeEntity(_0x12d294,null))[_0xe42d('0x56')](handleError(_0x12d294,null));};exports['describe']=function(_0x1efeee,_0x5ed8eb){return db[_0xe42d('0x51')][_0xe42d('0x62')]()['then'](respondWithResult(_0x5ed8eb,null))[_0xe42d('0x56')](handleError(_0x5ed8eb,null));};exports[_0xe42d('0x63')]=function(_0x4e5fc2,_0x4a4a35,_0x20f039){if(_0x4e5fc2[_0xe42d('0x5b')]['id']){delete _0x4e5fc2[_0xe42d('0x5b')]['id'];}return db[_0xe42d('0x51')][_0xe42d('0x5f')]({'where':{'id':_0x4e5fc2['params']['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x4a4a35,null))[_0xe42d('0x35')](function(_0x3d6f0e){if(_0x3d6f0e){_0x4e5fc2[_0xe42d('0x5b')][_0xe42d('0x64')]=_0x3d6f0e['id'];return db[_0xe42d('0x65')]['create'](_0x4e5fc2[_0xe42d('0x5b')]);}})['then'](respondWithResult(_0x4a4a35,null))[_0xe42d('0x56')](handleError(_0x4a4a35,null));};exports[_0xe42d('0x66')]=function(_0x33a452,_0x326b02,_0x9670d5){var _0x23b3a8={'raw':![],'where':{}};var _0x1cf78e={};var _0x5e1145={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x33a452['params']['id']}})['then'](handleEntityNotFound(_0x326b02,null))[_0xe42d('0x35')](function(_0x5f3077){if(_0x5f3077){_0x1cf78e['model']=_[_0xe42d('0x42')](db['Disposition'][_0xe42d('0x3f')]);_0x1cf78e[_0xe42d('0x41')]=_[_0xe42d('0x42')](_0x33a452[_0xe42d('0x41')]);_0x1cf78e['filters']=_[_0xe42d('0x44')](_0x1cf78e[_0xe42d('0x45')],_0x1cf78e['query']);_0x23b3a8[_0xe42d('0x46')]=_[_0xe42d('0x44')](_0x1cf78e[_0xe42d('0x45')],qs['fields'](_0x33a452[_0xe42d('0x41')][_0xe42d('0x47')]));_0x23b3a8[_0xe42d('0x46')]=_0x23b3a8[_0xe42d('0x46')]['length']?_0x23b3a8[_0xe42d('0x46')]:_0x1cf78e[_0xe42d('0x45')];if(!_0x33a452[_0xe42d('0x41')]['hasOwnProperty'](_0xe42d('0x49'))){_0x23b3a8[_0xe42d('0x2d')]=qs[_0xe42d('0x2d')](_0x33a452[_0xe42d('0x41')][_0xe42d('0x2d')]);_0x23b3a8['offset']=qs['offset'](_0x33a452['query'][_0xe42d('0x2b')]);}_0x23b3a8[_0xe42d('0x67')]=qs[_0xe42d('0x4a')](_0x33a452[_0xe42d('0x41')][_0xe42d('0x4a')]);_0x23b3a8[_0xe42d('0x4b')]=qs[_0xe42d('0x43')](_[_0xe42d('0x4c')](_0x33a452[_0xe42d('0x41')],_0x1cf78e[_0xe42d('0x43')]));_0x23b3a8[_0xe42d('0x4b')][_0xe42d('0x64')]=_0x5f3077['id'];if(_0x33a452[_0xe42d('0x41')][_0xe42d('0x4d')]){_0x23b3a8[_0xe42d('0x4b')]=_[_0xe42d('0x4e')](_0x23b3a8[_0xe42d('0x4b')],{'$or':_[_0xe42d('0x3e')](_0x23b3a8[_0xe42d('0x46')],function(_0x3d893f){var _0x28a595={};_0x28a595[_0x3d893f]={'$like':'%'+_0x33a452[_0xe42d('0x41')]['filter']+'%'};return _0x28a595;})});}_0x23b3a8=_['merge']({},_0x23b3a8,_0x33a452[_0xe42d('0x59')]);return db[_0xe42d('0x65')][_0xe42d('0x2e')]({'where':_0x23b3a8[_0xe42d('0x4b')]})[_0xe42d('0x35')](function(_0x1f94d6){_0x5e1145[_0xe42d('0x2e')]=_0x1f94d6;if(_0x33a452[_0xe42d('0x41')]['includeAll']){_0x23b3a8[_0xe42d('0x53')]=[{'all':!![]}];}return db[_0xe42d('0x65')][_0xe42d('0x54')](_0x23b3a8);})[_0xe42d('0x35')](function(_0x586f3c){_0x5e1145[_0xe42d('0x55')]=_0x586f3c;return _0x5e1145;});}})[_0xe42d('0x35')](respondWithFilteredResult(_0x326b02,_0x23b3a8))[_0xe42d('0x56')](handleError(_0x326b02,null));};exports[_0xe42d('0x68')]=function(_0x84b65a,_0x155622,_0x4d8c7f){return db[_0xe42d('0x51')][_0xe42d('0x5f')]({'where':{'id':_0x84b65a[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x155622,null))[_0xe42d('0x35')](function(_0x244aa7){if(_0x244aa7){return _0x244aa7[_0xe42d('0x68')](_0x84b65a[_0xe42d('0x41')]['ids']);}})[_0xe42d('0x35')](respondWithStatusCode(_0x155622,null))[_0xe42d('0x56')](handleError(_0x155622,null));};exports['addAnswer']=function(_0x568dcc,_0x58b170,_0x10a342){if(_0x568dcc['body']['id']){delete _0x568dcc[_0xe42d('0x5b')]['id'];}return db[_0xe42d('0x51')][_0xe42d('0x5f')]({'where':{'id':_0x568dcc[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x58b170,null))[_0xe42d('0x35')](function(_0x1c5d7c){if(_0x1c5d7c){_0x568dcc['body']['FaxAccountId']=_0x1c5d7c['id'];return db[_0xe42d('0x69')][_0xe42d('0x5a')](_0x568dcc[_0xe42d('0x5b')]);}})[_0xe42d('0x35')](respondWithResult(_0x58b170,null))[_0xe42d('0x56')](handleError(_0x58b170,null));};exports['getAnswers']=function(_0x3c764a,_0x59b87d,_0x28ae01){var _0x1f6e4d={'raw':![],'where':{}};var _0x3cf9b6={};var _0x3b47b1={'count':0x0,'rows':[]};return db[_0xe42d('0x51')]['findOne']({'where':{'id':_0x3c764a['params']['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x59b87d,null))[_0xe42d('0x35')](function(_0x20b493){if(_0x20b493){_0x3cf9b6[_0xe42d('0x45')]=_['keys'](db[_0xe42d('0x69')][_0xe42d('0x3f')]);_0x3cf9b6['query']=_['keys'](_0x3c764a[_0xe42d('0x41')]);_0x3cf9b6['filters']=_[_0xe42d('0x44')](_0x3cf9b6['model'],_0x3cf9b6['query']);_0x1f6e4d['attributes']=_[_0xe42d('0x44')](_0x3cf9b6[_0xe42d('0x45')],qs[_0xe42d('0x47')](_0x3c764a[_0xe42d('0x41')][_0xe42d('0x47')]));_0x1f6e4d[_0xe42d('0x46')]=_0x1f6e4d[_0xe42d('0x46')]['length']?_0x1f6e4d[_0xe42d('0x46')]:_0x3cf9b6['model'];if(!_0x3c764a[_0xe42d('0x41')]['hasOwnProperty']('nolimit')){_0x1f6e4d['limit']=qs[_0xe42d('0x2d')](_0x3c764a['query']['limit']);_0x1f6e4d['offset']=qs[_0xe42d('0x2b')](_0x3c764a['query'][_0xe42d('0x2b')]);}_0x1f6e4d[_0xe42d('0x67')]=qs[_0xe42d('0x4a')](_0x3c764a[_0xe42d('0x41')][_0xe42d('0x4a')]);_0x1f6e4d[_0xe42d('0x4b')]=qs[_0xe42d('0x43')](_['pick'](_0x3c764a[_0xe42d('0x41')],_0x3cf9b6[_0xe42d('0x43')]));_0x1f6e4d['where'][_0xe42d('0x64')]=_0x20b493['id'];if(_0x3c764a[_0xe42d('0x41')][_0xe42d('0x4d')]){_0x1f6e4d[_0xe42d('0x4b')]=_[_0xe42d('0x4e')](_0x1f6e4d['where'],{'$or':_[_0xe42d('0x3e')](_0x1f6e4d[_0xe42d('0x46')],function(_0x28cce8){var _0x5f3793={};_0x5f3793[_0x28cce8]={'$like':'%'+_0x3c764a[_0xe42d('0x41')][_0xe42d('0x4d')]+'%'};return _0x5f3793;})});}_0x1f6e4d=_[_0xe42d('0x4e')]({},_0x1f6e4d,_0x3c764a[_0xe42d('0x59')]);return db['CannedAnswer'][_0xe42d('0x2e')]({'where':_0x1f6e4d[_0xe42d('0x4b')]})[_0xe42d('0x35')](function(_0x777acf){_0x3b47b1[_0xe42d('0x2e')]=_0x777acf;if(_0x3c764a[_0xe42d('0x41')][_0xe42d('0x52')]){_0x1f6e4d[_0xe42d('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe42d('0x54')](_0x1f6e4d);})[_0xe42d('0x35')](function(_0x49363d){_0x3b47b1[_0xe42d('0x55')]=_0x49363d;return _0x3b47b1;});}})[_0xe42d('0x35')](respondWithFilteredResult(_0x59b87d,_0x1f6e4d))[_0xe42d('0x56')](handleError(_0x59b87d,null));};exports[_0xe42d('0x6a')]=function(_0x3ced12,_0x57b553,_0x28889e){return db['FaxAccount'][_0xe42d('0x5f')]({'where':{'id':_0x3ced12['params']['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x57b553,null))[_0xe42d('0x35')](function(_0x1f4976){if(_0x1f4976){return _0x1f4976[_0xe42d('0x6a')](_0x3ced12['query'][_0xe42d('0x6b')]);}})[_0xe42d('0x35')](respondWithStatusCode(_0x57b553,null))['catch'](handleError(_0x57b553,null));};exports[_0xe42d('0x6c')]=function(_0x1f269c,_0x2e966b,_0x25dc44){return db['FaxInteraction'][_0xe42d('0x5f')]({'where':{'id':_0x1f269c[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x2e966b,null))[_0xe42d('0x35')](function(_0x317c93){if(_0x317c93){return _0x317c93[_0xe42d('0x6c')](_0x1f269c[_0xe42d('0x5b')][_0xe42d('0x6b')],_[_0xe42d('0x6d')](_0x1f269c[_0xe42d('0x5b')],[_0xe42d('0x6b'),'id'])||{});}})[_0xe42d('0x35')](respondWithResult(_0x2e966b,null))[_0xe42d('0x56')](handleError(_0x2e966b,null));};exports['getInteractions']=function(_0x1d49da,_0x49bfaf,_0x5c43b7){var _0x22d2f3={'raw':![],'where':{}};var _0x237c7e={};var _0x345f96={'count':0x0,'rows':[]};return db[_0xe42d('0x51')][_0xe42d('0x6e')]({'where':{'id':_0x1d49da[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x49bfaf,null))[_0xe42d('0x35')](function(_0x19f85a){if(_0x19f85a){_0x237c7e[_0xe42d('0x45')]=_[_0xe42d('0x42')](db[_0xe42d('0x6f')][_0xe42d('0x3f')]);_0x237c7e[_0xe42d('0x41')]=_[_0xe42d('0x42')](_0x1d49da[_0xe42d('0x41')]);_0x237c7e[_0xe42d('0x43')]=_[_0xe42d('0x44')](_0x237c7e[_0xe42d('0x45')],_0x237c7e[_0xe42d('0x41')]);_0x22d2f3[_0xe42d('0x46')]=_[_0xe42d('0x44')](_0x237c7e[_0xe42d('0x45')],qs[_0xe42d('0x47')](_0x1d49da[_0xe42d('0x41')][_0xe42d('0x47')]));_0x22d2f3[_0xe42d('0x46')]=_0x22d2f3['attributes'][_0xe42d('0x58')]?_0x22d2f3['attributes']:_0x237c7e[_0xe42d('0x45')];if(!_0x1d49da[_0xe42d('0x41')][_0xe42d('0x48')]('nolimit')){_0x22d2f3[_0xe42d('0x2d')]=qs['limit'](_0x1d49da['query'][_0xe42d('0x2d')]);_0x22d2f3[_0xe42d('0x2b')]=qs['offset'](_0x1d49da[_0xe42d('0x41')]['offset']);}_0x22d2f3[_0xe42d('0x67')]=qs[_0xe42d('0x4a')](_0x1d49da[_0xe42d('0x41')][_0xe42d('0x4a')]);_0x22d2f3[_0xe42d('0x4b')]=qs['filters'](_[_0xe42d('0x4c')](_0x1d49da[_0xe42d('0x41')],_0x237c7e[_0xe42d('0x43')]));_0x22d2f3[_0xe42d('0x4b')][_0xe42d('0x64')]=_0x19f85a['id'];if(_0x1d49da[_0xe42d('0x41')]['filter']){_0x22d2f3[_0xe42d('0x4b')]=_['merge'](_0x22d2f3[_0xe42d('0x4b')],{'$or':_['map'](_0x22d2f3[_0xe42d('0x46')],function(_0x1faf7d){var _0x349a45={};_0x349a45[_0x1faf7d]={'$like':'%'+_0x1d49da[_0xe42d('0x41')][_0xe42d('0x4d')]+'%'};return _0x349a45;})});}_0x22d2f3=_[_0xe42d('0x4e')]({},_0x22d2f3,_0x1d49da[_0xe42d('0x59')]);return db['FaxInteraction'][_0xe42d('0x2e')]({'where':_0x22d2f3[_0xe42d('0x4b')]})[_0xe42d('0x35')](function(_0x2a32cc){_0x345f96[_0xe42d('0x2e')]=_0x2a32cc;if(_0x1d49da[_0xe42d('0x41')][_0xe42d('0x52')]){_0x22d2f3['include']=[{'model':db[_0xe42d('0x70')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xe42d('0x71'),'attributes':['name','fullname',_0xe42d('0x72')],'required':![]},{'model':db[_0xe42d('0x73')],'as':_0xe42d('0x74'),'attributes':['id',_0xe42d('0x3a'),'color'],'where':_0x1d49da[_0xe42d('0x41')][_0xe42d('0x75')]?{'id':_0x1d49da[_0xe42d('0x41')][_0xe42d('0x75')]}:undefined,'required':_0x1d49da[_0xe42d('0x41')][_0xe42d('0x75')]?!![]:![]}];}return db[_0xe42d('0x6f')][_0xe42d('0x54')](_0x22d2f3);})[_0xe42d('0x35')](function(_0x46776e){_0x345f96['rows']=_0x46776e;return _0x345f96;});}})['then'](respondWithFilteredResult(_0x49bfaf,_0x22d2f3))['catch'](handleError(_0x49bfaf,null));};exports[_0xe42d('0x76')]=function(_0x1a1e32,_0xb5bfe7){var _0x203be1=_0x1a1e32[_0xe42d('0x57')]['id'];var _0x36d407=_0x1a1e32[_0xe42d('0x5b')];var _0x462368=0xc8;var _0x43c5f5=null;return db[_0xe42d('0x77')][_0xe42d('0x78')]({'isolationLevel':db[_0xe42d('0x77')][_0xe42d('0x79')]['ISOLATION_LEVELS'][_0xe42d('0x7a')]},function(_0x1dba5e){return db[_0xe42d('0x51')][_0xe42d('0x6e')]({'where':{'id':_0x203be1},'transaction':_0x1dba5e})[_0xe42d('0x35')](function(_0x42a835){if(_0x42a835){return db['FaxApplication'][_0xe42d('0x36')]({'where':{'FaxAccountId':_0x203be1},'transaction':_0x1dba5e})[_0xe42d('0x35')](function(){var _0x381545=_[_0xe42d('0x3e')](_0x36d407,function(_0x28e327){_0x28e327[_0xe42d('0x64')]=_0x203be1;return _0x28e327;});return db[_0xe42d('0x7b')]['bulkCreate'](_0x381545,{'transaction':_0x1dba5e});});}else{_0x462368=0x194;_0x43c5f5=[];}});})['then'](function(){if(_0x462368!==0x194){return db[_0xe42d('0x7b')]['findAndCountAll']({'where':{'FaxAccountId':_0x203be1},'order':_0xe42d('0x7c')})[_0xe42d('0x35')](function(_0x374cd6){_0x43c5f5=_0x374cd6;});}})[_0xe42d('0x56')](function(_0x192213){_0x462368=0x1f4;logger[_0xe42d('0x24')](_0x192213['stack']);if(_0x192213['name']){delete _0x192213[_0xe42d('0x3a')];}_0x43c5f5=_0x192213;})['finally'](function(){if(_0x43c5f5===null){_0xb5bfe7[_0xe42d('0x39')](_0x462368);}else{if(_0x462368===0x1f4){_0xb5bfe7[_0xe42d('0x29')](_0x462368)['send'](_0x43c5f5);}else{_0xb5bfe7['status'](_0x462368)[_0xe42d('0x2a')](_0x43c5f5);}}});};exports[_0xe42d('0x7d')]=function(_0x59ae0f,_0x419fcd,_0x1a6468){var _0x534592={};var _0x28a97f={};var _0x283e1f;var _0x54d092;return db[_0xe42d('0x51')][_0xe42d('0x6e')]({'where':{'id':_0x59ae0f[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x419fcd,null))[_0xe42d('0x35')](function(_0x31a19d){if(_0x31a19d){_0x283e1f=_0x31a19d;_0x28a97f[_0xe42d('0x45')]=_[_0xe42d('0x42')](db[_0xe42d('0x7b')][_0xe42d('0x3f')]);_0x28a97f[_0xe42d('0x41')]=_[_0xe42d('0x42')](_0x59ae0f[_0xe42d('0x41')]);_0x28a97f[_0xe42d('0x43')]=_[_0xe42d('0x44')](_0x28a97f[_0xe42d('0x45')],_0x28a97f['query']);_0x534592[_0xe42d('0x46')]=_[_0xe42d('0x44')](_0x28a97f[_0xe42d('0x45')],qs['fields'](_0x59ae0f[_0xe42d('0x41')][_0xe42d('0x47')]));_0x534592['attributes']=_0x534592[_0xe42d('0x46')][_0xe42d('0x58')]?_0x534592['attributes']:_0x28a97f[_0xe42d('0x45')];_0x534592[_0xe42d('0x67')]=qs[_0xe42d('0x4a')](_0x59ae0f[_0xe42d('0x41')][_0xe42d('0x4a')]);_0x534592[_0xe42d('0x4b')]=qs[_0xe42d('0x43')](_[_0xe42d('0x4c')](_0x59ae0f['query'],_0x28a97f[_0xe42d('0x43')]));if(_0x59ae0f[_0xe42d('0x41')][_0xe42d('0x4d')]){_0x534592[_0xe42d('0x4b')]=_[_0xe42d('0x4e')](_0x534592[_0xe42d('0x4b')],{'$or':_[_0xe42d('0x3e')](_0x534592['attributes'],function(_0x297339){var _0x173cf9={};_0x173cf9[_0x297339]={'$like':'%'+_0x59ae0f[_0xe42d('0x41')][_0xe42d('0x4d')]+'%'};return _0x173cf9;})});}_0x534592=_[_0xe42d('0x4e')]({},_0x534592,_0x59ae0f[_0xe42d('0x59')]);return _0x283e1f[_0xe42d('0x7d')](_0x534592);}})[_0xe42d('0x35')](function(_0x379736){if(_0x379736){_0x54d092=_0x379736[_0xe42d('0x58')];if(!_0x59ae0f[_0xe42d('0x41')][_0xe42d('0x48')](_0xe42d('0x49'))){_0x534592[_0xe42d('0x2d')]=qs[_0xe42d('0x2d')](_0x59ae0f['query'][_0xe42d('0x2d')]);_0x534592['offset']=qs[_0xe42d('0x2b')](_0x59ae0f[_0xe42d('0x41')]['offset']);}return _0x283e1f[_0xe42d('0x7d')](_0x534592);}})[_0xe42d('0x35')](function(_0x463c2c){if(_0x463c2c){return _0x463c2c?{'count':_0x54d092,'rows':_0x463c2c}:null;}})['then'](respondWithResult(_0x419fcd,null))[_0xe42d('0x56')](handleError(_0x419fcd,null));};function Extension(_0x286e44,_0x485e4f,_0x517434,_0x16984b){this[_0xe42d('0x7e')]=_0xe42d('0x7f');this[_0xe42d('0x80')]=_0x286e44[_0xe42d('0x81')];this[_0xe42d('0x82')]=_0x16984b;this['type']=_0xe42d('0x83');this[_0xe42d('0x84')]=_0xe42d('0x85');this[_0xe42d('0x64')]=_0x286e44['id'];this[_0xe42d('0x7c')]=_0x485e4f;this[_0xe42d('0x86')]=_0x517434;}function createExtensionsReciveFax(_0x60d11){var _0x9b3d71=0x1;var _0x54f5a0=[];_0x54f5a0[_0xe42d('0x87')](new Extension(_0x60d11,_0x9b3d71,'',_0xe42d('0x88')));_0x9b3d71+=0x1;_0x54f5a0[_0xe42d('0x87')](new Extension(_0x60d11,_0x9b3d71,_0xe42d('0x89'),_0xe42d('0x8a')));_0x9b3d71+=0x1;for(var _0x5337ac in _0x60d11){if(_0x60d11['hasOwnProperty'](_0x5337ac)&&(_0x5337ac===_0xe42d('0x8b')||_0x5337ac===_0xe42d('0x81')||_0x5337ac==='gateway'||_0x5337ac===_0xe42d('0x8c')||_0x5337ac===_0xe42d('0x8d')||_0x5337ac===_0xe42d('0x8e')||_0x5337ac==='minrate'||_0x5337ac===_0xe42d('0x8f')||_0x5337ac===_0xe42d('0x90'))){_0x54f5a0['push'](new Extension(_0x60d11,_0x9b3d71,_0xe42d('0x91')+_0x5337ac+')='+_0x60d11[_0x5337ac],'Set'));_0x9b3d71+=0x1;}}_0x54f5a0[_0xe42d('0x87')](new Extension(_0x60d11,_0x9b3d71,'6','Wait'));_0x9b3d71+=0x1;_0x54f5a0[_0xe42d('0x87')](new Extension(_0x60d11,_0x9b3d71,_0xe42d('0x92'),_0xe42d('0x93')));_0x9b3d71=0x0;return _0x54f5a0;}exports['addAccountApplications']=function(_0x40d17f,_0x3b4d23,_0x4f296e){var _0x4052e7;return db[_0xe42d('0x77')][_0xe42d('0x78')](function(_0x1dada6){return db[_0xe42d('0x51')][_0xe42d('0x5a')](_0x40d17f[_0xe42d('0x5b')],{'transaction':_0x1dada6})[_0xe42d('0x35')](function(_0x175ae0){_0x4052e7=_0x175ae0[_0xe42d('0x37')]({'plain':!![]});return db[_0xe42d('0x94')]['bulkCreate'](createExtensionsReciveFax(_0x4052e7),{'transaction':_0x1dada6});});})[_0xe42d('0x35')](function(){return _0x4052e7;})[_0xe42d('0x35')](respondWithResult(_0x3b4d23,null))[_0xe42d('0x56')](handleError(_0x3b4d23,null));};exports[_0xe42d('0x95')]=function(_0x2a1667,_0x35a143,_0x3a8041){var _0x21d46b;return db[_0xe42d('0x77')]['transaction'](function(_0x5304fb){return db['FaxAccount'][_0xe42d('0x34')](_0x2a1667[_0xe42d('0x5b')],{'where':{'id':_0x2a1667['body']['id']},'transaction':_0x5304fb})[_0xe42d('0x35')](function(_0x56265b){return db[_0xe42d('0x94')][_0xe42d('0x36')]({'where':{'FaxAccountId':_0x2a1667['body']['id']},'transaction':_0x5304fb})[_0xe42d('0x35')](function(_0x2d4d8e){return db[_0xe42d('0x94')][_0xe42d('0x96')](createExtensionsReciveFax(_[_0xe42d('0x6d')](_0x2a1667[_0xe42d('0x5b')],[_0xe42d('0x97'),_0xe42d('0x40'),'createdAt',_0xe42d('0x98'),_0xe42d('0x99'),_0xe42d('0x9a')])),{'transaction':_0x5304fb});});});})['then'](function(){return db['FaxAccount']['findById'](_0x2a1667['body']['id']);})[_0xe42d('0x35')](respondWithResult(_0x35a143,null))['catch'](handleError(_0x35a143,null));};exports[_0xe42d('0x9b')]=function(_0x3c2d5b,_0x31523e,_0x3cc7d2){var _0x26384c={'raw':!![],'where':{}};var _0x4c168b={};var _0x574f70={'count':0x0,'rows':[]};return db[_0xe42d('0x51')][_0xe42d('0x6e')]({'where':{'id':_0x3c2d5b[_0xe42d('0x57')]['id']}})['then'](handleEntityNotFound(_0x31523e,null))['then'](function(_0x5a1d2c){if(_0x5a1d2c){_0x4c168b['model']=_[_0xe42d('0x42')](db[_0xe42d('0x9c')][_0xe42d('0x3f')]);_0x4c168b[_0xe42d('0x41')]=_[_0xe42d('0x42')](_0x3c2d5b['query']);_0x4c168b['filters']=_[_0xe42d('0x44')](_0x4c168b[_0xe42d('0x45')],_0x4c168b[_0xe42d('0x41')]);_0x26384c[_0xe42d('0x46')]=_[_0xe42d('0x44')](_0x4c168b[_0xe42d('0x45')],qs[_0xe42d('0x47')](_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x47')]));_0x26384c[_0xe42d('0x46')]=_0x26384c['attributes'][_0xe42d('0x58')]?_0x26384c[_0xe42d('0x46')]:_0x4c168b[_0xe42d('0x45')];if(!_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x48')](_0xe42d('0x49'))){_0x26384c[_0xe42d('0x2d')]=qs[_0xe42d('0x2d')](_0x3c2d5b['query'][_0xe42d('0x2d')]);_0x26384c['offset']=qs['offset'](_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x2b')]);}_0x26384c[_0xe42d('0x67')]=qs[_0xe42d('0x4a')](_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x4a')]);_0x26384c[_0xe42d('0x4b')]=qs[_0xe42d('0x43')](_[_0xe42d('0x4c')](_0x3c2d5b['query'],_0x4c168b[_0xe42d('0x43')]));_0x26384c['where'][_0xe42d('0x64')]=_0x5a1d2c['id'];if(_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x4d')]){_0x26384c[_0xe42d('0x4b')]=_[_0xe42d('0x4e')](_0x26384c[_0xe42d('0x4b')],{'$or':_[_0xe42d('0x3e')](_0x26384c[_0xe42d('0x46')],function(_0x3797d5){var _0x55fe7e={};_0x55fe7e[_0x3797d5]={'$like':'%'+_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x4d')]+'%'};return _0x55fe7e;})});}if(_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x9d')]){var _0x3b8f7f=_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x9d')]['split'](',');var _0x71a65a={};_0x71a65a[_0x3b8f7f[0x0]]={'$gte':moment(_0x3b8f7f[0x1])[_0xe42d('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x26384c[_0xe42d('0x4b')]=_[_0xe42d('0x4e')](_0x26384c[_0xe42d('0x4b')],_0x71a65a);}_0x26384c=_[_0xe42d('0x4e')]({},_0x26384c,_0x3c2d5b[_0xe42d('0x59')]);return db[_0xe42d('0x9c')][_0xe42d('0x2e')]({'where':_0x26384c[_0xe42d('0x4b')]})[_0xe42d('0x35')](function(_0x34da71){_0x574f70['count']=_0x34da71;if(_0x3c2d5b[_0xe42d('0x41')][_0xe42d('0x52')]){_0x26384c[_0xe42d('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0xe42d('0x54')](_0x26384c);})[_0xe42d('0x35')](function(_0xdfdde5){_0x574f70[_0xe42d('0x55')]=_0xdfdde5;return _0x574f70;});}})[_0xe42d('0x35')](respondWithFilteredResult(_0x31523e,_0x26384c))['catch'](handleError(_0x31523e,null));};exports[_0xe42d('0x9f')]=function(_0x527c99,_0x2823d9,_0xacf422){var _0xeabce8,_0x23ef34={},_0x4aaaa1;if(_0x527c99['body']['to']){_0x4aaaa1=_0x527c99[_0xe42d('0x5b')]['to'][0x0];}return db[_0xe42d('0x51')][_0xe42d('0x5f')]({'where':{'id':_0x527c99[_0xe42d('0x57')]['id']},'include':[{'model':db[_0xe42d('0xa0')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x4aaaa1},'limit':0x1,'order':[[_0xe42d('0x98'),_0xe42d('0xa1')]]}]}]})[_0xe42d('0x35')](handleEntityNotFound(_0x2823d9,null))[_0xe42d('0x35')](function(_0xe403dd){_0xeabce8=_0xe403dd;if(_0x527c99[_0xe42d('0x5b')]['attachments']&&_0x527c99['body'][_0xe42d('0xa2')][_0xe42d('0x58')]){for(var _0x32fef5=0x0;_0x32fef5<_0x527c99['body'][_0xe42d('0xa2')][_0xe42d('0x58')];_0x32fef5+=0x1){_0x527c99[_0xe42d('0x5b')][_0xe42d('0xa2')][_0x32fef5]={'filename':_0x527c99[_0xe42d('0x5b')][_0xe42d('0xa2')][_0x32fef5][_0xe42d('0x3a')],'id':_0x527c99[_0xe42d('0x5b')][_0xe42d('0xa2')][_0x32fef5]['id'],'path':path['join'](config[_0xe42d('0xa3')],_0xe42d('0xa4'),_0x527c99[_0xe42d('0x5b')]['attachments'][_0x32fef5][_0xe42d('0xa5')])};}}return respondWithRpcPromise('CheckAfterSend',_0xe42d('0xa6'),{'FaxAccountId':_[_0xe42d('0xa7')](_0x527c99['params']['id'])?undefined:_0x527c99[_0xe42d('0x57')]['id'],'path':_[_0xe42d('0xa7')](_0x527c99['body']['attachments'][0x0][_0xe42d('0xa8')])?undefined:_0x527c99[_0xe42d('0x5b')]['attachments'][0x0][_0xe42d('0xa8')],'fax':_[_0xe42d('0xa7')](_0x527c99[_0xe42d('0x5b')]['to'][0x0])?undefined:_0x527c99['body']['to'][0x0]},client9002);})[_0xe42d('0x35')](function(){if(_0xeabce8){if(_[_0xe42d('0xa7')](_0x527c99['body']['from'])){_0x527c99['body'][_0xe42d('0xa9')]=util['format'](_0xe42d('0xaa'),_0xeabce8[_0xe42d('0x3a')],_0xeabce8[_0xe42d('0xab')]);}if(_0xeabce8['List']){if(_0xeabce8['List'][_0xe42d('0xac')][_0xe42d('0x58')]){return _0xeabce8[_0xe42d('0xad')]['Contacts'][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x527c99[_0xe42d('0x5b')],{'firstName':_0x527c99['body']['to'][0x0],'phone':_0x527c99[_0xe42d('0x5b')]['to'][0x0],'fax':_0x527c99[_0xe42d('0x5b')]['to'][0x0],'ListId':_0xeabce8[_0xe42d('0x9a')]}));}}else{throw new Error(_0xe42d('0xae'));}}else{throw new Error(_0xe42d('0xaf'));}})['then'](function(_0x1445fd){if(_0x1445fd){return db[_0xe42d('0x6f')][_0xe42d('0x5f')]({'where':{'ContactId':_0x1445fd['id'],'closed':![],'FaxAccountId':_0xeabce8['id']}})[_0xe42d('0x35')](function(_0x1f26f6){if(_0x1f26f6){return[_0x1f26f6,![]];}return db[_0xe42d('0x6f')][_0xe42d('0x5a')]({'UserId':_0x527c99[_0xe42d('0x5c')]['id'],'ContactId':_0x1445fd['id'],'FaxAccountId':_0xeabce8['id'],'fax':_0x527c99[_0xe42d('0x5b')]['to'][0x0],'firstMsgDirection':_0xe42d('0xb0'),'Messages':[_['merge'](_0x527c99[_0xe42d('0x5b')],{'read':![],'body':_0x527c99[_0xe42d('0x5b')][_0xe42d('0xa2')][0x0][_0xe42d('0xb1')],'FaxAccountId':_0xeabce8['id'],'UserId':_0x527c99[_0xe42d('0x5c')]['id'],'ContactId':_0x1445fd['id'],'AttachmentId':_0x527c99[_0xe42d('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xe42d('0x9c')],'as':_0xe42d('0xb2')}]})[_0xe42d('0x35')](function(_0x883c44){return[_0x883c44,!![]];});});}else{throw new Error(_0xe42d('0xb3'));}})[_0xe42d('0xb4')](function(_0x440d81,_0x3c869f){if(_0x3c869f){return _0x440d81;}return db[_0xe42d('0x9c')][_0xe42d('0x5a')]({'direction':_0xe42d('0xb0'),'read':![],'body':_0x527c99['body'][_0xe42d('0xa2')][0x0][_0xe42d('0xb1')],'FaxAccountId':_0xeabce8['id'],'FaxInteractionId':_0x440d81['id'],'UserId':_0x527c99['user']['id'],'ContactId':_0x440d81['ContactId'],'AttachmentId':_0x527c99[_0xe42d('0x5b')][_0xe42d('0xa2')][0x0]['id']})['then'](function(_0x37afe4){_0x440d81[_0xe42d('0xb5')][_0xe42d('0xb2')]=[];_0x440d81['dataValues'][_0xe42d('0xb2')][_0xe42d('0x87')](_0x37afe4[_0xe42d('0xb5')]);return _0x440d81;});})[_0xe42d('0x35')](function(_0x33b649){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x527c99[_0xe42d('0x57')]['id'])?undefined:_0x527c99[_0xe42d('0x57')]['id'],'path':_[_0xe42d('0xa7')](_0x527c99['body']['attachments'][0x0]['path'])?undefined:_0x527c99[_0xe42d('0x5b')][_0xe42d('0xa2')][0x0][_0xe42d('0xa8')],'fax':_['isNil'](_0x527c99[_0xe42d('0x5b')]['to'][0x0])?undefined:_0x527c99[_0xe42d('0x5b')]['to'][0x0],'AttachmentId':_0x527c99['body'][_0xe42d('0xa2')][0x0]['id']},client9002)[_0xe42d('0x35')](function(_0x5add05){logger[_0xe42d('0x1f')](_0xe42d('0xb6'),_0x5add05);})[_0xe42d('0x56')](function(_0x1ddc4d){logger[_0xe42d('0x1f')](_0xe42d('0xb6'),_0x1ddc4d);});return _0x33b649;})[_0xe42d('0x35')](respondWithResult(_0x2823d9,null))[_0xe42d('0x56')](handleError(_0x2823d9,null));};exports['addAgents']=function(_0x4d10c9,_0x28928f,_0xbc1878){return db[_0xe42d('0x51')][_0xe42d('0x5f')]({'where':{'id':_0x4d10c9[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0x28928f,null))[_0xe42d('0x35')](function(_0x39499c){if(_0x39499c){return _0x39499c[_0xe42d('0xb7')](_0x4d10c9['body'][_0xe42d('0x6b')],_[_0xe42d('0x6d')](_0x4d10c9['body'],[_0xe42d('0x6b'),'id'])||{})[_0xe42d('0xb4')](function(_0x3f0e0e){for(var _0x4013cf=0x0;_0x4013cf<_0x4d10c9[_0xe42d('0x5b')][_0xe42d('0x6b')]['length'];_0x4013cf+=0x1){socket['emit'](_0xe42d('0xb8'),{'UserId':Number(_0x4d10c9[_0xe42d('0x5b')]['ids'][_0x4013cf]),'FaxAccountId':Number(_0x4d10c9[_0xe42d('0x57')]['id'])});}return _0x3f0e0e;});}})[_0xe42d('0x35')](respondWithResult(_0x28928f,null))['catch'](handleError(_0x28928f,null));};exports[_0xe42d('0xb9')]=function(_0x2a128c,_0x1fd954,_0x5a2931){return db['FaxAccount'][_0xe42d('0x5f')]({'where':{'id':_0x2a128c[_0xe42d('0x57')]['id']}})['then'](handleEntityNotFound(_0x1fd954,null))['then'](function(_0x496782){if(_0x496782){return _0x496782[_0xe42d('0xb9')](_0x2a128c[_0xe42d('0x41')][_0xe42d('0x6b')])[_0xe42d('0x35')](function(){if(_[_0xe42d('0xba')](_0x2a128c['query'][_0xe42d('0x6b')])){for(var _0x2f631d=0x0;_0x2f631d<_0x2a128c['query'][_0xe42d('0x6b')][_0xe42d('0x58')];_0x2f631d+=0x1){socket[_0xe42d('0xbb')](_0xe42d('0xbc'),{'UserId':Number(_0x2a128c[_0xe42d('0x41')]['ids'][_0x2f631d]),'FaxAccountId':Number(_0x2a128c[_0xe42d('0x57')]['id'])});}}else{socket[_0xe42d('0xbb')]('userFaxAccount:remove',{'UserId':Number(_0x2a128c[_0xe42d('0x41')][_0xe42d('0x6b')]),'FaxAccountId':Number(_0x2a128c[_0xe42d('0x57')]['id'])});}});}})[_0xe42d('0x35')](respondWithStatusCode(_0x1fd954,null))[_0xe42d('0x56')](handleError(_0x1fd954,null));};exports[_0xe42d('0xbd')]=function(_0x2690e1,_0xf82823,_0x4af570){var _0x1e0c29={};var _0x3df9b0={};var _0x2f8c0a;var _0x463058;return db[_0xe42d('0x51')][_0xe42d('0x6e')]({'where':{'id':_0x2690e1[_0xe42d('0x57')]['id']}})[_0xe42d('0x35')](handleEntityNotFound(_0xf82823,null))['then'](function(_0x3107af){if(_0x3107af){_0x2f8c0a=_0x3107af;_0x3df9b0[_0xe42d('0x45')]=_[_0xe42d('0x42')](db[_0xe42d('0xbe')][_0xe42d('0x3f')]);_0x3df9b0[_0xe42d('0x41')]=_[_0xe42d('0x42')](_0x2690e1[_0xe42d('0x41')]);_0x3df9b0[_0xe42d('0x43')]=_['intersection'](_0x3df9b0[_0xe42d('0x45')],_0x3df9b0[_0xe42d('0x41')]);_0x1e0c29[_0xe42d('0x46')]=_[_0xe42d('0x44')](_0x3df9b0[_0xe42d('0x45')],qs[_0xe42d('0x47')](_0x2690e1[_0xe42d('0x41')][_0xe42d('0x47')]));_0x1e0c29[_0xe42d('0x46')]=_0x1e0c29[_0xe42d('0x46')][_0xe42d('0x58')]?_0x1e0c29[_0xe42d('0x46')]:_0x3df9b0[_0xe42d('0x45')];_0x1e0c29[_0xe42d('0x67')]=qs[_0xe42d('0x4a')](_0x2690e1[_0xe42d('0x41')][_0xe42d('0x4a')]);_0x1e0c29[_0xe42d('0x4b')]=qs[_0xe42d('0x43')](_['pick'](_0x2690e1[_0xe42d('0x41')],_0x3df9b0['filters']));if(_0x2690e1[_0xe42d('0x41')][_0xe42d('0x4d')]){_0x1e0c29[_0xe42d('0x4b')]=_[_0xe42d('0x4e')](_0x1e0c29[_0xe42d('0x4b')],{'$or':_[_0xe42d('0x3e')](_0x1e0c29[_0xe42d('0x46')],function(_0x41b606){var _0x2f1e7e={};_0x2f1e7e[_0x41b606]={'$like':'%'+_0x2690e1[_0xe42d('0x41')]['filter']+'%'};return _0x2f1e7e;})});}_0x1e0c29=_['merge']({},_0x1e0c29,_0x2690e1[_0xe42d('0x59')]);return _0x2f8c0a[_0xe42d('0xbd')](_0x1e0c29);}})[_0xe42d('0x35')](function(_0x2ee8a5){if(_0x2ee8a5){_0x463058=_0x2ee8a5[_0xe42d('0x58')];if(!_0x2690e1[_0xe42d('0x41')][_0xe42d('0x48')]('nolimit')){_0x1e0c29['limit']=qs[_0xe42d('0x2d')](_0x2690e1['query'][_0xe42d('0x2d')]);_0x1e0c29[_0xe42d('0x2b')]=qs['offset'](_0x2690e1[_0xe42d('0x41')]['offset']);}return _0x2f8c0a[_0xe42d('0xbd')](_0x1e0c29);}})['then'](function(_0x2402f1){if(_0x2402f1){return _0x2402f1?{'count':_0x463058,'rows':_0x2402f1}:null;}})['then'](respondWithResult(_0xf82823,null))[_0xe42d('0x56')](handleError(_0xf82823,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 261d91e..d55e06d 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 _0x8ac4=['FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1c2928,_0x259f3f){var _0x56aec4=function(_0x3d2b79){while(--_0x3d2b79){_0x1c2928['push'](_0x1c2928['shift']());}};_0x56aec4(++_0x259f3f);}(_0x8ac4,0x138));var _0x48ac=function(_0x13b0ce,_0x130312){_0x13b0ce=_0x13b0ce-0x0;var _0x3b8040=_0x8ac4[_0x13b0ce];return _0x3b8040;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x48ac('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x48ac('0x1')](0x0);var events={'afterCreate':_0x48ac('0x2'),'afterUpdate':_0x48ac('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44d95d){return function(_0x5c2708,_0x288259,_0x5cd43e){FaxAccountEvents[_0x48ac('0x4')](_0x44d95d+':'+_0x5c2708['id'],_0x5c2708);FaxAccountEvents['emit'](_0x44d95d,_0x5c2708);_0x5cd43e(null);};}for(var e in events){if(events[_0x48ac('0x5')](e)){var event=events[e];FaxAccount[_0x48ac('0x6')](e,emitEvent(event));}}module[_0x48ac('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x1e73ff,_0x2f54e4){var _0x5c1c3d=function(_0xf8120d){while(--_0xf8120d){_0x1e73ff['push'](_0x1e73ff['shift']());}};_0x5c1c3d(++_0x2f54e4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49bb91,_0x86ecf3){_0x49bb91=_0x49bb91-0x0;var _0x2b4339=_0x5f2f[_0x49bb91];return _0x2b4339;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var FaxAccount=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){FaxAccountEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);FaxAccountEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];FaxAccount[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 9a1c8fe..9a04b5d 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 _0xb89d=['request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xb89d,0xa4));var _0xdb89=function(_0x10a2ea,_0x487cf2){_0x10a2ea=_0x10a2ea-0x0;var _0x347b66=_0xb89d[_0x10a2ea];return _0x347b66;};'use strict';var _=require(_0xdb89('0x0'));var util=require(_0xdb89('0x1'));var logger=require(_0xdb89('0x2'))(_0xdb89('0x3'));var moment=require(_0xdb89('0x4'));var BPromise=require('bluebird');var rp=require(_0xdb89('0x5'));var fs=require('fs');var path=require(_0xdb89('0x6'));var rimraf=require('rimraf');var config=require(_0xdb89('0x7'));var attributes=require(_0xdb89('0x8'));module[_0xdb89('0x9')]=function(_0x2210ba,_0x218d87){return _0x2210ba[_0xdb89('0xa')](_0xdb89('0xb'),attributes,{'tableName':_0xdb89('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b67=['fax_accounts','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x537265,_0x85c954){var _0x47461c=function(_0x490823){while(--_0x490823){_0x537265['push'](_0x537265['shift']());}};_0x47461c(++_0x85c954);}(_0x6b67,0xcd));var _0x76b6=function(_0x1d5476,_0x2f8795){_0x1d5476=_0x1d5476-0x0;var _0x4ac71f=_0x6b67[_0x1d5476];return _0x4ac71f;};'use strict';var _=require(_0x76b6('0x0'));var util=require('util');var logger=require(_0x76b6('0x1'))(_0x76b6('0x2'));var moment=require(_0x76b6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76b6('0x4'));var rimraf=require(_0x76b6('0x5'));var config=require(_0x76b6('0x6'));var attributes=require(_0x76b6('0x7'));module[_0x76b6('0x8')]=function(_0x446048,_0x530ae5){return _0x446048[_0x76b6('0x9')](_0x76b6('0xa'),attributes,{'tableName':_0x76b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 97aeb7f..2f79a3d 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 _0x967f=['fax','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','body','from','from\x20is\x20mandatory','isNil','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','FaxAccount','find','account','List','CmContact','DESC','FaxApplication','get','applications','Applications','asc','length','Contacts','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','register','request','then','request\x20sent','debug','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetFaxAccount'];(function(_0x20076b,_0x4f218e){var _0x1ae3de=function(_0x545d7a){while(--_0x545d7a){_0x20076b['push'](_0x20076b['shift']());}};_0x1ae3de(++_0x4f218e);}(_0x967f,0xd9));var _0xf967=function(_0x564b11,_0x208c41){_0x564b11=_0x564b11-0x0;var _0x2ef645=_0x967f[_0x564b11];return _0x2ef645;};'use strict';var _=require(_0xf967('0x0'));var util=require(_0xf967('0x1'));var moment=require(_0xf967('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf967('0x3'))['db'];var utils=require(_0xf967('0x4'));var logger=require(_0xf967('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf967('0x6'));var client=jayson[_0xf967('0x7')][_0xf967('0x8')]({'port':0x232c});config[_0xf967('0x9')]=_[_0xf967('0xa')](config[_0xf967('0x9')],{'host':_0xf967('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf967('0xc'))[_0xf967('0xd')](socket);function respondWithRpcPromise(_0x2538f7,_0x22bf1f,_0x2696d9){return new BPromise(function(_0x443730,_0x49dbf9){return client[_0xf967('0xe')](_0x2538f7,_0x2696d9)[_0xf967('0xf')](function(_0x343247){logger['info']('FaxAccount,\x20%s,\x20%s',_0x22bf1f,_0xf967('0x10'));logger[_0xf967('0x11')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x22bf1f,_0xf967('0x10'),JSON['stringify'](_0x343247));if(_0x343247['error']){if(_0x343247[_0xf967('0x12')][_0xf967('0x13')]===0x1f4){logger['error'](_0xf967('0x14'),_0x22bf1f,_0x343247[_0xf967('0x12')][_0xf967('0x15')]);return _0x49dbf9(_0x343247[_0xf967('0x12')][_0xf967('0x15')]);}logger[_0xf967('0x12')](_0xf967('0x14'),_0x22bf1f,_0x343247[_0xf967('0x12')]['message']);return _0x443730(_0x343247[_0xf967('0x12')]['message']);}else{logger[_0xf967('0x16')](_0xf967('0x14'),_0x22bf1f,_0xf967('0x10'));_0x443730(_0x343247[_0xf967('0x17')]['message']);}})[_0xf967('0x18')](function(_0x432ebc){logger[_0xf967('0x12')](_0xf967('0x14'),_0x22bf1f,_0x432ebc);_0x49dbf9(_0x432ebc);});});}exports['GetFaxAccount']=function(_0x43163a){var _0x3dccce=this;return new Promise(function(_0x2cba4a,_0x22acac){return db['FaxAccount'][_0xf967('0x19')]({'raw':_0x43163a[_0xf967('0x1a')]?_0x43163a['options'][_0xf967('0x1b')]===undefined?!![]:![]:!![],'where':_0x43163a['options']?_0x43163a[_0xf967('0x1a')][_0xf967('0x1c')]||null:null,'attributes':_0x43163a[_0xf967('0x1a')]?_0x43163a[_0xf967('0x1a')]['attributes']||null:null,'limit':_0x43163a[_0xf967('0x1a')]?_0x43163a['options'][_0xf967('0x1d')]||null:null,'include':_0x43163a['options']?_0x43163a[_0xf967('0x1a')][_0xf967('0x1e')]?_[_0xf967('0x1f')](_0x43163a[_0xf967('0x1a')][_0xf967('0x1e')],function(_0x37b80a){return{'model':db[_0x37b80a[_0xf967('0x20')]],'as':_0x37b80a['as'],'attributes':_0x37b80a[_0xf967('0x21')],'include':_0x37b80a[_0xf967('0x1e')]?_[_0xf967('0x1f')](_0x37b80a[_0xf967('0x1e')],function(_0x3c6f35){return{'model':db[_0x3c6f35[_0xf967('0x20')]],'as':_0x3c6f35['as'],'attributes':_0x3c6f35[_0xf967('0x21')],'include':_0x3c6f35[_0xf967('0x1e')]?_[_0xf967('0x1f')](_0x3c6f35['include'],function(_0x3a8625){return{'model':db[_0x3a8625[_0xf967('0x20')]],'as':_0x3a8625['as'],'attributes':_0x3a8625['attributes']};}):[]};}):[]};}):[]:[]})[_0xf967('0xf')](function(_0x240835){logger[_0xf967('0x16')](_0xf967('0x22'),_0x43163a);logger[_0xf967('0x11')](_0xf967('0x22'),_0x43163a,JSON['stringify'](_0x240835));_0x2cba4a(_0x240835);})[_0xf967('0x18')](function(_0x5891c4){logger[_0xf967('0x12')](_0xf967('0x22'),_0x5891c4[_0xf967('0x15')],_0x43163a);_0x22acac(_0x3dccce['error'](0x1f4,_0x5891c4[_0xf967('0x15')]));});});};exports['NotifyFaxAccount']=function(_0x4ec0b5,_0x169584,_0x195e7a){var _0x1d10a9=this;return new Promise(function(_0xc9a468,_0x2681e8){var _0x4fb282={'body':_0x4ec0b5['body'],'channel':_0xf967('0x23')};var _0x33a50a=[];var _0x22f320=[];var _0x55c921={};return db['CmContact'][_0xf967('0x24')]()[_0xf967('0xf')](function(_0x109082){if(!_0x109082){throw new db[(_0xf967('0x25'))][(_0xf967('0x26'))]('no\x20available\x20attributes');}_0x33a50a=_[_0xf967('0x27')](_[_0xf967('0x28')](_0x109082),[_0xf967('0x29'),_0xf967('0x2a')]);_0x22f320=_['difference'](_[_0xf967('0x28')](_0x109082),[_0xf967('0x29'),'updatedAt','CompanyId',_0xf967('0x2b')]);if(_0x4ec0b5[_0xf967('0x2c')]['id']){delete _0x4ec0b5[_0xf967('0x2c')]['id'];}if(_['isNil'](_0x4ec0b5[_0xf967('0x2c')][_0xf967('0x2d')])){throw new db[(_0xf967('0x25'))][(_0xf967('0x26'))](_0xf967('0x2e'));}if(_[_0xf967('0x2f')](_0x4ec0b5[_0xf967('0x2c')][_0xf967('0x2c')])||_0x4ec0b5[_0xf967('0x2c')]['body']===''){throw new db[(_0xf967('0x25'))][(_0xf967('0x26'))](_0xf967('0x30'));}if(_['isNil'](_0x4ec0b5[_0xf967('0x2c')][_0xf967('0x31')])){throw new db[(_0xf967('0x25'))][(_0xf967('0x26'))](_0xf967('0x32')+_0x22f320);}if(!_[_0xf967('0x33')](_0x22f320,_0x4ec0b5[_0xf967('0x2c')][_0xf967('0x31')])){throw new db[(_0xf967('0x25'))][(_0xf967('0x26'))](_0xf967('0x34')+_0x22f320);}_0x55c921[_0x4ec0b5[_0xf967('0x2c')]['mapKey']]=_0x4ec0b5[_0xf967('0x2c')][_0xf967('0x2d')];})[_0xf967('0xf')](function(){return db[_0xf967('0x35')][_0xf967('0x36')]({'where':{'id':_0x4ec0b5[_0xf967('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xf967('0x38'),'include':[{'model':db[_0xf967('0x39')],'as':'Contacts','where':_0x55c921,'limit':0x1,'order':[['updatedAt',_0xf967('0x3a')]]}]},{'model':db[_0xf967('0x3b')],'as':'Applications'}]});})[_0xf967('0xf')](function(_0x3ae286){if(_0x3ae286&&_0x3ae286[_0xf967('0x38')]){var _0x15296a=_0x3ae286[_0xf967('0x3c')]({'plain':!![]});_0x4fb282[_0xf967('0x37')]=_0x15296a;_0x4fb282[_0xf967('0x3d')]=_0x15296a[_0xf967('0x3e')];_0x4fb282['list']=_0x15296a[_0xf967('0x38')];_0x4fb282[_0xf967('0x3d')]=_['orderBy'](_0x4fb282[_0xf967('0x3d')],['priority'],[_0xf967('0x3f')]);if(_0x4fb282[_0xf967('0x37')][_0xf967('0x3e')]){delete _0x4fb282[_0xf967('0x37')][_0xf967('0x3e')];}if(_0x4fb282[_0xf967('0x37')][_0xf967('0x38')]&&_0x4fb282[_0xf967('0x37')][_0xf967('0x38')]['Contacts'][_0xf967('0x40')]){return _0x4fb282['account'][_0xf967('0x38')][_0xf967('0x41')][0x0];}var _0x18f3f3=_['defaults'](_0x4ec0b5[_0xf967('0x2c')],{'firstName':_0x4ec0b5[_0xf967('0x2c')][_0xf967('0x2d')],'ListId':_0x15296a[_0xf967('0x2b')]});_0x18f3f3[_0x4ec0b5['body'][_0xf967('0x31')]]=_0x4ec0b5['body'][_0xf967('0x2d')];return db[_0xf967('0x39')][_0xf967('0x42')](_0x18f3f3,{'fields':_0x33a50a,'raw':!![]});}})['then'](function(_0x43f085){_0x4fb282[_0xf967('0x43')]=_0x43f085;if(_0x43f085){var _0x3a0345={'ContactId':_0x43f085['id'],'FaxAccountId':_0x4ec0b5['account']['id'],'fax':_0x43f085[_0xf967('0x23')]};return db[_0xf967('0x44')][_0xf967('0x36')]({'where':{'ContactId':_0x43f085['id'],'closed':![],'FaxAccountId':_0x4ec0b5[_0xf967('0x37')]['id']}})[_0xf967('0xf')](function(_0x3a8997){if(_0x3a8997){return[_0x3a8997,![]];}return db[_0xf967('0x44')][_0xf967('0x42')](_0x3a0345)['then'](function(_0x28039e){return[_0x28039e,!![]];});});}else{throw new Error(_0xf967('0x45'));}})[_0xf967('0x46')](function(_0x599a6b,_0x46fa87){var _0x2679d9=_0x599a6b['get']({'plain':!![]});if(_0x46fa87){if(_0x4fb282['account']['autoclose']){_0x4fb282['applications'][_0xf967('0x47')]({'id':0x0,'priority':_0x4fb282[_0xf967('0x3d')][_0xf967('0x40')]+0x1,'app':_0xf967('0x48'),'appdata':_0xf967('0x49'),'interval':_0xf967('0x4a')});}_0x2679d9[_0xf967('0x4b')]=!![];}else{_0x2679d9['created']=![];}_0x4fb282[_0xf967('0x4c')]=_0x2679d9;return db[_0xf967('0x4d')]['create']({'body':_0x4ec0b5['body'][_0xf967('0x2c')],'FaxAccountId':_0x4ec0b5[_0xf967('0x37')]['id'],'FaxInteractionId':_0x599a6b['id'],'direction':'in','ContactId':_0x599a6b['ContactId'],'AttachmentId':_0x4ec0b5[_0xf967('0x2c')][_0xf967('0x4e')]});})['then'](function(_0xc553dd){_0x4fb282[_0xf967('0x15')]=_0xc553dd;if(_0x4fb282[_0xf967('0x4c')][_0xf967('0x4f')]){return db[_0xf967('0x50')][_0xf967('0x36')]({'attributes':['id','name'],'where':{'id':_0x4fb282[_0xf967('0x4c')][_0xf967('0x4f')]}})[_0xf967('0xf')](function(_0x35f412){if(_0x35f412){_0x4fb282[_0xf967('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x35f412['name']+','+(_0x4fb282[_0xf967('0x37')][_0xf967('0x51')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf967('0x52'),_0xf967('0x53'),_0x4fb282);});}return respondWithRpcPromise(_0xf967('0x52'),'startRouting',_0x4fb282);})['then'](function(_0x5e898c){_0xc9a468(_0x5e898c);})['catch'](function(_0x4e7bbc){_0x2681e8(_0x1d10a9[_0xf967('0x12')](0x1f4,_0x4e7bbc[_0xf967('0x15')]));});});}; \ No newline at end of file +var _0xd6e8=['include','map','model','then','GetFaxAccount','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','difference','keys','updatedAt','createdAt','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','FaxAccount','account','List','DESC','FaxApplication','get','applications','Applications','orderBy','priority','asc','Contacts','length','ListId','create','contact','FaxInteraction','find','Contact\x20not\x20found','autoclose','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','options','raw','where','attributes','limit'];(function(_0x477c8d,_0x441c8b){var _0x4aca80=function(_0x424cfe){while(--_0x424cfe){_0x477c8d['push'](_0x477c8d['shift']());}};_0x4aca80(++_0x441c8b);}(_0xd6e8,0x1f1));var _0x8d6e=function(_0x619fcc,_0x3bd756){_0x619fcc=_0x619fcc-0x0;var _0x4737a6=_0xd6e8[_0x619fcc];return _0x4737a6;};'use strict';var _=require(_0x8d6e('0x0'));var util=require(_0x8d6e('0x1'));var moment=require(_0x8d6e('0x2'));var BPromise=require(_0x8d6e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d6e('0x4'));var db=require(_0x8d6e('0x5'))['db'];var utils=require(_0x8d6e('0x6'));var logger=require('../../config/logger')(_0x8d6e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8d6e('0x8')][_0x8d6e('0x9')]({'port':0x232c});config[_0x8d6e('0xa')]=_[_0x8d6e('0xb')](config[_0x8d6e('0xa')],{'host':_0x8d6e('0xc'),'port':0x18eb});var socket=require(_0x8d6e('0xd'))(new Redis(config[_0x8d6e('0xa')]));require(_0x8d6e('0xe'))[_0x8d6e('0xf')](socket);function respondWithRpcPromise(_0x2e01b9,_0x548ae7,_0x1b8fbe){return new BPromise(function(_0x24cd94,_0x21cfdf){return client[_0x8d6e('0x10')](_0x2e01b9,_0x1b8fbe)['then'](function(_0x3ac03e){logger['info'](_0x8d6e('0x11'),_0x548ae7,'request\x20sent');logger[_0x8d6e('0x12')](_0x8d6e('0x13'),_0x548ae7,_0x8d6e('0x14'),JSON['stringify'](_0x3ac03e));if(_0x3ac03e['error']){if(_0x3ac03e[_0x8d6e('0x15')][_0x8d6e('0x16')]===0x1f4){logger[_0x8d6e('0x15')]('FaxAccount,\x20%s,\x20%s',_0x548ae7,_0x3ac03e['error'][_0x8d6e('0x17')]);return _0x21cfdf(_0x3ac03e[_0x8d6e('0x15')][_0x8d6e('0x17')]);}logger[_0x8d6e('0x15')](_0x8d6e('0x11'),_0x548ae7,_0x3ac03e['error'][_0x8d6e('0x17')]);return _0x24cd94(_0x3ac03e['error']['message']);}else{logger[_0x8d6e('0x18')]('FaxAccount,\x20%s,\x20%s',_0x548ae7,_0x8d6e('0x14'));_0x24cd94(_0x3ac03e['result'][_0x8d6e('0x17')]);}})[_0x8d6e('0x19')](function(_0x2c0515){logger['error'](_0x8d6e('0x11'),_0x548ae7,_0x2c0515);_0x21cfdf(_0x2c0515);});});}exports['GetFaxAccount']=function(_0x5d86b4){var _0xc2c2b7=this;return new Promise(function(_0x1af023,_0x41ddae){return db['FaxAccount']['findAll']({'raw':_0x5d86b4[_0x8d6e('0x1a')]?_0x5d86b4[_0x8d6e('0x1a')][_0x8d6e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d86b4[_0x8d6e('0x1a')]?_0x5d86b4[_0x8d6e('0x1a')][_0x8d6e('0x1c')]||null:null,'attributes':_0x5d86b4[_0x8d6e('0x1a')]?_0x5d86b4['options'][_0x8d6e('0x1d')]||null:null,'limit':_0x5d86b4[_0x8d6e('0x1a')]?_0x5d86b4[_0x8d6e('0x1a')][_0x8d6e('0x1e')]||null:null,'include':_0x5d86b4['options']?_0x5d86b4['options'][_0x8d6e('0x1f')]?_[_0x8d6e('0x20')](_0x5d86b4[_0x8d6e('0x1a')]['include'],function(_0x224fd9){return{'model':db[_0x224fd9[_0x8d6e('0x21')]],'as':_0x224fd9['as'],'attributes':_0x224fd9[_0x8d6e('0x1d')],'include':_0x224fd9[_0x8d6e('0x1f')]?_[_0x8d6e('0x20')](_0x224fd9[_0x8d6e('0x1f')],function(_0x5cb71a){return{'model':db[_0x5cb71a['model']],'as':_0x5cb71a['as'],'attributes':_0x5cb71a[_0x8d6e('0x1d')],'include':_0x5cb71a[_0x8d6e('0x1f')]?_[_0x8d6e('0x20')](_0x5cb71a['include'],function(_0x522e8f){return{'model':db[_0x522e8f[_0x8d6e('0x21')]],'as':_0x522e8f['as'],'attributes':_0x522e8f['attributes']};}):[]};}):[]};}):[]:[]})[_0x8d6e('0x22')](function(_0x98c03d){logger[_0x8d6e('0x18')](_0x8d6e('0x23'),_0x5d86b4);logger[_0x8d6e('0x12')]('GetFaxAccount',_0x5d86b4,JSON[_0x8d6e('0x24')](_0x98c03d));_0x1af023(_0x98c03d);})[_0x8d6e('0x19')](function(_0x3df2a0){logger[_0x8d6e('0x15')](_0x8d6e('0x23'),_0x3df2a0['message'],_0x5d86b4);_0x41ddae(_0xc2c2b7['error'](0x1f4,_0x3df2a0['message']));});});};exports[_0x8d6e('0x25')]=function(_0x2bd7a6,_0x1eea2a,_0x367b85){var _0x13cf7b=this;return new Promise(function(_0x415236,_0x89c7b3){var _0x2eb734={'body':_0x2bd7a6[_0x8d6e('0x26')],'channel':_0x8d6e('0x27')};var _0x4182e9=[];var _0x3f010c=[];var _0x2ae864={};return db[_0x8d6e('0x28')]['describe']()[_0x8d6e('0x22')](function(_0x1c53fd){if(!_0x1c53fd){throw new db[(_0x8d6e('0x29'))][(_0x8d6e('0x2a'))]('no\x20available\x20attributes');}_0x4182e9=_[_0x8d6e('0x2b')](_[_0x8d6e('0x2c')](_0x1c53fd),['createdAt',_0x8d6e('0x2d')]);_0x3f010c=_['difference'](_[_0x8d6e('0x2c')](_0x1c53fd),[_0x8d6e('0x2e'),_0x8d6e('0x2d'),'CompanyId','ListId']);if(_0x2bd7a6[_0x8d6e('0x26')]['id']){delete _0x2bd7a6['body']['id'];}if(_['isNil'](_0x2bd7a6[_0x8d6e('0x26')]['from'])){throw new db['Sequelize'][(_0x8d6e('0x2a'))](_0x8d6e('0x2f'));}if(_[_0x8d6e('0x30')](_0x2bd7a6['body'][_0x8d6e('0x26')])||_0x2bd7a6[_0x8d6e('0x26')][_0x8d6e('0x26')]===''){throw new db[(_0x8d6e('0x29'))]['ValidationError'](_0x8d6e('0x31'));}if(_[_0x8d6e('0x30')](_0x2bd7a6[_0x8d6e('0x26')][_0x8d6e('0x32')])){throw new db[(_0x8d6e('0x29'))][(_0x8d6e('0x2a'))](_0x8d6e('0x33')+_0x3f010c);}if(!_[_0x8d6e('0x34')](_0x3f010c,_0x2bd7a6['body'][_0x8d6e('0x32')])){throw new db[(_0x8d6e('0x29'))][(_0x8d6e('0x2a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f010c);}_0x2ae864[_0x2bd7a6[_0x8d6e('0x26')]['mapKey']]=_0x2bd7a6['body'][_0x8d6e('0x35')];})[_0x8d6e('0x22')](function(){return db[_0x8d6e('0x36')]['find']({'where':{'id':_0x2bd7a6[_0x8d6e('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x8d6e('0x38'),'include':[{'model':db[_0x8d6e('0x28')],'as':'Contacts','where':_0x2ae864,'limit':0x1,'order':[[_0x8d6e('0x2d'),_0x8d6e('0x39')]]}]},{'model':db[_0x8d6e('0x3a')],'as':'Applications'}]});})[_0x8d6e('0x22')](function(_0x3fb693){if(_0x3fb693&&_0x3fb693[_0x8d6e('0x38')]){var _0x28c85a=_0x3fb693[_0x8d6e('0x3b')]({'plain':!![]});_0x2eb734[_0x8d6e('0x37')]=_0x28c85a;_0x2eb734[_0x8d6e('0x3c')]=_0x28c85a[_0x8d6e('0x3d')];_0x2eb734['list']=_0x28c85a[_0x8d6e('0x38')];_0x2eb734[_0x8d6e('0x3c')]=_[_0x8d6e('0x3e')](_0x2eb734[_0x8d6e('0x3c')],[_0x8d6e('0x3f')],[_0x8d6e('0x40')]);if(_0x2eb734[_0x8d6e('0x37')]['Applications']){delete _0x2eb734[_0x8d6e('0x37')][_0x8d6e('0x3d')];}if(_0x2eb734[_0x8d6e('0x37')][_0x8d6e('0x38')]&&_0x2eb734[_0x8d6e('0x37')][_0x8d6e('0x38')][_0x8d6e('0x41')][_0x8d6e('0x42')]){return _0x2eb734[_0x8d6e('0x37')][_0x8d6e('0x38')][_0x8d6e('0x41')][0x0];}var _0x5eb7f7=_['defaults'](_0x2bd7a6[_0x8d6e('0x26')],{'firstName':_0x2bd7a6[_0x8d6e('0x26')][_0x8d6e('0x35')],'ListId':_0x28c85a[_0x8d6e('0x43')]});_0x5eb7f7[_0x2bd7a6[_0x8d6e('0x26')][_0x8d6e('0x32')]]=_0x2bd7a6[_0x8d6e('0x26')][_0x8d6e('0x35')];return db[_0x8d6e('0x28')][_0x8d6e('0x44')](_0x5eb7f7,{'fields':_0x4182e9,'raw':!![]});}})[_0x8d6e('0x22')](function(_0x3e2e32){_0x2eb734[_0x8d6e('0x45')]=_0x3e2e32;if(_0x3e2e32){var _0x39fd24={'ContactId':_0x3e2e32['id'],'FaxAccountId':_0x2bd7a6[_0x8d6e('0x37')]['id'],'fax':_0x3e2e32[_0x8d6e('0x27')]};return db[_0x8d6e('0x46')][_0x8d6e('0x47')]({'where':{'ContactId':_0x3e2e32['id'],'closed':![],'FaxAccountId':_0x2bd7a6[_0x8d6e('0x37')]['id']}})[_0x8d6e('0x22')](function(_0x5b12e0){if(_0x5b12e0){return[_0x5b12e0,![]];}return db['FaxInteraction'][_0x8d6e('0x44')](_0x39fd24)[_0x8d6e('0x22')](function(_0x4516b6){return[_0x4516b6,!![]];});});}else{throw new Error(_0x8d6e('0x48'));}})['spread'](function(_0x39aa12,_0x519842){var _0x3bd0dc=_0x39aa12[_0x8d6e('0x3b')]({'plain':!![]});if(_0x519842){if(_0x2eb734[_0x8d6e('0x37')][_0x8d6e('0x49')]){_0x2eb734[_0x8d6e('0x3c')]['push']({'id':0x0,'priority':_0x2eb734[_0x8d6e('0x3c')][_0x8d6e('0x42')]+0x1,'app':'close','appdata':_0x8d6e('0x4a'),'interval':_0x8d6e('0x4b')});}_0x3bd0dc[_0x8d6e('0x4c')]=!![];}else{_0x3bd0dc[_0x8d6e('0x4c')]=![];}_0x2eb734[_0x8d6e('0x4d')]=_0x3bd0dc;return db[_0x8d6e('0x4e')][_0x8d6e('0x44')]({'body':_0x2bd7a6[_0x8d6e('0x26')][_0x8d6e('0x26')],'FaxAccountId':_0x2bd7a6[_0x8d6e('0x37')]['id'],'FaxInteractionId':_0x39aa12['id'],'direction':'in','ContactId':_0x39aa12[_0x8d6e('0x4f')],'AttachmentId':_0x2bd7a6['body']['AttachmentId']});})[_0x8d6e('0x22')](function(_0x433f69){_0x2eb734[_0x8d6e('0x17')]=_0x433f69;if(_0x2eb734[_0x8d6e('0x4d')][_0x8d6e('0x50')]){return db[_0x8d6e('0x51')]['find']({'attributes':['id',_0x8d6e('0x52')],'where':{'id':_0x2eb734[_0x8d6e('0x4d')]['UserId']}})[_0x8d6e('0x22')](function(_0x3d933e){if(_0x3d933e){_0x2eb734[_0x8d6e('0x3c')][_0x8d6e('0x53')]({'id':0x0,'priority':0x0,'app':_0x8d6e('0x54'),'appdata':_0x3d933e[_0x8d6e('0x52')]+','+(_0x2eb734[_0x8d6e('0x37')][_0x8d6e('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x8d6e('0x56'),_0x8d6e('0x57'),_0x2eb734);});}return respondWithRpcPromise(_0x8d6e('0x56'),_0x8d6e('0x57'),_0x2eb734);})[_0x8d6e('0x22')](function(_0x24169c){_0x415236(_0x24169c);})[_0x8d6e('0x19')](function(_0x5c211a){_0x89c7b3(_0x13cf7b[_0x8d6e('0x15')](0x1f4,_0x5c211a[_0x8d6e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index cd5edb4..b6e0283 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 _0x56e5=['save','update','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x2ef1a3,_0x3d082e){var _0x5952d9=function(_0x5abd0a){while(--_0x5abd0a){_0x2ef1a3['push'](_0x2ef1a3['shift']());}};_0x5952d9(++_0x3d082e);}(_0x56e5,0x109));var _0x556e=function(_0xc76ae7,_0x1428aa){_0xc76ae7=_0xc76ae7-0x0;var _0x128025=_0x56e5[_0xc76ae7];return _0x128025;};'use strict';var FaxAccountEvents=require(_0x556e('0x0'));var events=[_0x556e('0x1'),'remove',_0x556e('0x2')];function createListener(_0xd2d595,_0x18b8c6){return function(_0x445f30){_0x18b8c6['emit'](_0xd2d595,_0x445f30);};}function removeListener(_0x4d57b6,_0x272c2b){return function(){FaxAccountEvents[_0x556e('0x3')](_0x4d57b6,_0x272c2b);};}exports[_0x556e('0x4')]=function(_0x3e0d3a){for(var _0x2be579=0x0,_0x5c3046=events[_0x556e('0x5')];_0x2be579<_0x5c3046;_0x2be579++){var _0x54230b=events[_0x2be579];var _0x183f57=createListener(_0x556e('0x6')+_0x54230b,_0x3e0d3a);FaxAccountEvents['on'](_0x54230b,_0x183f57);}}; \ No newline at end of file +var _0x5d3a=['removeListener','register','length','faxAccount:','save','update','emit'];(function(_0x3e1d35,_0x205c38){var _0x3396cd=function(_0x26a40c){while(--_0x26a40c){_0x3e1d35['push'](_0x3e1d35['shift']());}};_0x3396cd(++_0x205c38);}(_0x5d3a,0x1bd));var _0xa5d3=function(_0x2755fb,_0x5970f1){_0x2755fb=_0x2755fb-0x0;var _0x293f12=_0x5d3a[_0x2755fb];return _0x293f12;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xa5d3('0x0'),'remove',_0xa5d3('0x1')];function createListener(_0x2cb368,_0x37a203){return function(_0x26409e){_0x37a203[_0xa5d3('0x2')](_0x2cb368,_0x26409e);};}function removeListener(_0x492024,_0x9bb219){return function(){FaxAccountEvents[_0xa5d3('0x3')](_0x492024,_0x9bb219);};}exports[_0xa5d3('0x4')]=function(_0x47ff75){for(var _0x7a4bde=0x0,_0x3c89f3=events[_0xa5d3('0x5')];_0x7a4bde<_0x3c89f3;_0x7a4bde++){var _0x35001b=events[_0x7a4bde];var _0x3dfc79=createListener(_0xa5d3('0x6')+_0x35001b,_0x47ff75);FaxAccountEvents['on'](_0x35001b,_0x3dfc79);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 61207d6..728c7d3 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(_0xc16cc9,_0x2413d7){var _0x54a19a=function(_0x3c8b5f){while(--_0x3c8b5f){_0xc16cc9['push'](_0xc16cc9['shift']());}};_0x54a19a(++_0x2413d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x305713,_0x1e0011){var _0x4483bc=function(_0x51eb2c){while(--_0x51eb2c){_0x305713['push'](_0x305713['shift']());}};_0x4483bc(++_0x1e0011);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 05d817a..c39862b 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 _0x6aee=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x5076a3,_0x19f7c2){var _0x4c9d11=function(_0x4679c6){while(--_0x4679c6){_0x5076a3['push'](_0x5076a3['shift']());}};_0x4c9d11(++_0x19f7c2);}(_0x6aee,0x11b));var _0xe6ae=function(_0xefd582,_0x3f1ebd){_0xefd582=_0xefd582-0x0;var _0x3b0d07=_0x6aee[_0xefd582];return _0x3b0d07;};'use strict';var Sequelize=require(_0xe6ae('0x0'));module[_0xe6ae('0x1')]={'priority':{'type':Sequelize[_0xe6ae('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe6ae('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe6ae('0x4')]()},'description':{'type':Sequelize[_0xe6ae('0x3')]},'interval':{'type':Sequelize[_0xe6ae('0x3')],'defaultValue':_0xe6ae('0x5')}}; \ No newline at end of file +var _0xd312=['*,*,*,*','sequelize','noop','TEXT','STRING'];(function(_0xc78045,_0x56b055){var _0x1c7b5e=function(_0x40675d){while(--_0x40675d){_0xc78045['push'](_0xc78045['shift']());}};_0x1c7b5e(++_0x56b055);}(_0xd312,0x1be));var _0x2d31=function(_0x2f4603,_0x52d845){_0x2f4603=_0x2f4603-0x0;var _0x516f0c=_0xd312[_0x2f4603];return _0x516f0c;};'use strict';var Sequelize=require(_0x2d31('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2d31('0x1')},'appdata':{'type':Sequelize[_0x2d31('0x2')]()},'description':{'type':Sequelize[_0x2d31('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2d31('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 3958eaa..d896899 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 _0xcd89=['moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../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','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xbb6084,_0x1612c1){var _0x2db4f0=function(_0x59048){while(--_0x59048){_0xbb6084['push'](_0xbb6084['shift']());}};_0x2db4f0(++_0x1612c1);}(_0xcd89,0x1b8));var _0x9cd8=function(_0x408193,_0x388396){_0x408193=_0x408193-0x0;var _0x40e295=_0xcd89[_0x408193];return _0x40e295;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9cd8('0x0'));var zipdir=require(_0x9cd8('0x1'));var jsonpatch=require(_0x9cd8('0x2'));var rp=require(_0x9cd8('0x3'));var moment=require(_0x9cd8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9cd8('0x5'));var util=require(_0x9cd8('0x6'));var path=require(_0x9cd8('0x7'));var sox=require(_0x9cd8('0x8'));var csv=require(_0x9cd8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cd8('0xa'));var _=require('lodash');var squel=require(_0x9cd8('0xb'));var crypto=require('crypto');var jsforce=require(_0x9cd8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9cd8('0x9'));var querystring=require('querystring');var Papa=require(_0x9cd8('0xd'));var Redis=require(_0x9cd8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9cd8('0xf'));var as=require(_0x9cd8('0x10'));var hardwareService=require(_0x9cd8('0x11'));var logger=require(_0x9cd8('0x12'))(_0x9cd8('0x13'));var utils=require(_0x9cd8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9cd8('0x15'));var db=require(_0x9cd8('0x16'))['db'];function respondWithStatusCode(_0x2cf305,_0x359cd3){_0x359cd3=_0x359cd3||0xcc;return function(_0x186217){if(_0x186217){return _0x2cf305[_0x9cd8('0x17')](_0x359cd3);}return _0x2cf305['status'](_0x359cd3)[_0x9cd8('0x18')]();};}function respondWithResult(_0x2ce07f,_0x578159){_0x578159=_0x578159||0xc8;return function(_0x2c3fcd){if(_0x2c3fcd){return _0x2ce07f[_0x9cd8('0x19')](_0x578159)[_0x9cd8('0x1a')](_0x2c3fcd);}};}function respondWithFilteredResult(_0x41d8f1,_0xf9daaa){return function(_0x3766af){if(_0x3766af){var _0x13bd8a=typeof _0xf9daaa[_0x9cd8('0x1b')]===_0x9cd8('0x1c')&&typeof _0xf9daaa[_0x9cd8('0x1d')]===_0x9cd8('0x1c');var _0x1e797c=_0x3766af[_0x9cd8('0x1e')];var _0x43708a=_0x13bd8a?0x0:_0xf9daaa[_0x9cd8('0x1b')];var _0x3c6a5c=_0x13bd8a?_0x3766af[_0x9cd8('0x1e')]:_0xf9daaa[_0x9cd8('0x1b')]+_0xf9daaa[_0x9cd8('0x1d')];var _0x112085;if(_0x3c6a5c>=_0x1e797c){_0x3c6a5c=_0x1e797c;_0x112085=0xc8;}else{_0x112085=0xce;}_0x41d8f1['status'](_0x112085);return _0x41d8f1[_0x9cd8('0x1f')](_0x9cd8('0x20'),_0x43708a+'-'+_0x3c6a5c+'/'+_0x1e797c)[_0x9cd8('0x1a')](_0x3766af);}return null;};}function patchUpdates(_0x240087){return function(_0xb1db79){try{jsonpatch[_0x9cd8('0x21')](_0xb1db79,_0x240087,!![]);}catch(_0x2236f7){return BPromise[_0x9cd8('0x22')](_0x2236f7);}return _0xb1db79[_0x9cd8('0x23')]();};}function saveUpdates(_0x43a149,_0x358e40){return function(_0x148f66){if(_0x148f66){return _0x148f66[_0x9cd8('0x24')](_0x43a149)[_0x9cd8('0x25')](function(_0xebdabb){return _0xebdabb;});}return null;};}function removeEntity(_0x26b91c,_0x1bb9f5){return function(_0xc8c2e0){if(_0xc8c2e0){return _0xc8c2e0[_0x9cd8('0x26')]()[_0x9cd8('0x25')](function(){_0x26b91c[_0x9cd8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d2e42,_0x51d06f){return function(_0x25d81d){if(!_0x25d81d){_0x4d2e42[_0x9cd8('0x17')](0x194);}return _0x25d81d;};}function handleError(_0xdfa725,_0x47cde2){_0x47cde2=_0x47cde2||0x1f4;return function(_0x514507){logger[_0x9cd8('0x27')](_0x514507[_0x9cd8('0x28')]);if(_0x514507[_0x9cd8('0x29')]){delete _0x514507[_0x9cd8('0x29')];}_0xdfa725[_0x9cd8('0x19')](_0x47cde2)[_0x9cd8('0x2a')](_0x514507);};}exports[_0x9cd8('0x2b')]=function(_0x4c4507,_0x1bd6b2){var _0x1ff116={},_0x4d0446={},_0x2ea138={'count':0x0,'rows':[]};var _0x3219c0=_[_0x9cd8('0x2c')](db[_0x9cd8('0x2d')][_0x9cd8('0x2e')],function(_0xc2d2f7){return{'name':_0xc2d2f7['fieldName'],'type':_0xc2d2f7[_0x9cd8('0x2f')]['key']};});_0x4d0446[_0x9cd8('0x30')]=_[_0x9cd8('0x2c')](_0x3219c0,'name');_0x4d0446[_0x9cd8('0x31')]=_[_0x9cd8('0x32')](_0x4c4507['query']);_0x4d0446[_0x9cd8('0x33')]=_[_0x9cd8('0x34')](_0x4d0446[_0x9cd8('0x30')],_0x4d0446[_0x9cd8('0x31')]);_0x1ff116[_0x9cd8('0x35')]=_[_0x9cd8('0x34')](_0x4d0446[_0x9cd8('0x30')],qs['fields'](_0x4c4507[_0x9cd8('0x31')][_0x9cd8('0x36')]));_0x1ff116[_0x9cd8('0x35')]=_0x1ff116['attributes'][_0x9cd8('0x37')]?_0x1ff116[_0x9cd8('0x35')]:_0x4d0446[_0x9cd8('0x30')];if(!_0x4c4507[_0x9cd8('0x31')][_0x9cd8('0x38')](_0x9cd8('0x39'))){_0x1ff116[_0x9cd8('0x1d')]=qs['limit'](_0x4c4507[_0x9cd8('0x31')]['limit']);_0x1ff116[_0x9cd8('0x1b')]=qs[_0x9cd8('0x1b')](_0x4c4507[_0x9cd8('0x31')][_0x9cd8('0x1b')]);}_0x1ff116[_0x9cd8('0x3a')]=qs['sort'](_0x4c4507[_0x9cd8('0x31')][_0x9cd8('0x3b')]);_0x1ff116[_0x9cd8('0x3c')]=qs[_0x9cd8('0x33')](_['pick'](_0x4c4507[_0x9cd8('0x31')],_0x4d0446[_0x9cd8('0x33')]),_0x3219c0);if(_0x4c4507[_0x9cd8('0x31')][_0x9cd8('0x3d')]){_0x1ff116[_0x9cd8('0x3c')]=_[_0x9cd8('0x3e')](_0x1ff116['where'],{'$or':_[_0x9cd8('0x2c')](_0x3219c0,function(_0x544a39){if(_0x544a39[_0x9cd8('0x2f')]!==_0x9cd8('0x3f')){var _0x482070={};_0x482070[_0x544a39[_0x9cd8('0x29')]]={'$like':'%'+_0x4c4507[_0x9cd8('0x31')]['filter']+'%'};return _0x482070;}})});}_0x1ff116=_['merge']({},_0x1ff116,_0x4c4507[_0x9cd8('0x40')]);var _0x44546e={'where':_0x1ff116[_0x9cd8('0x3c')]};return db['FaxApplication'][_0x9cd8('0x1e')](_0x44546e)[_0x9cd8('0x25')](function(_0xe5ce6d){_0x2ea138[_0x9cd8('0x1e')]=_0xe5ce6d;if(_0x4c4507[_0x9cd8('0x31')]['includeAll']){_0x1ff116[_0x9cd8('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0x9cd8('0x42')](_0x1ff116);})[_0x9cd8('0x25')](function(_0x11aab4){_0x2ea138[_0x9cd8('0x43')]=_0x11aab4;return _0x2ea138;})[_0x9cd8('0x25')](respondWithFilteredResult(_0x1bd6b2,_0x1ff116))[_0x9cd8('0x44')](handleError(_0x1bd6b2,null));};exports[_0x9cd8('0x45')]=function(_0x2fc019,_0xc557f3){var _0x1a77c0={'raw':!![],'where':{'id':_0x2fc019[_0x9cd8('0x46')]['id']}},_0x3680e0={};_0x3680e0[_0x9cd8('0x30')]=_[_0x9cd8('0x32')](db['FaxApplication'][_0x9cd8('0x2e')]);_0x3680e0[_0x9cd8('0x31')]=_[_0x9cd8('0x32')](_0x2fc019[_0x9cd8('0x31')]);_0x3680e0[_0x9cd8('0x33')]=_[_0x9cd8('0x34')](_0x3680e0[_0x9cd8('0x30')],_0x3680e0[_0x9cd8('0x31')]);_0x1a77c0[_0x9cd8('0x35')]=_['intersection'](_0x3680e0['model'],qs[_0x9cd8('0x36')](_0x2fc019['query']['fields']));_0x1a77c0[_0x9cd8('0x35')]=_0x1a77c0[_0x9cd8('0x35')][_0x9cd8('0x37')]?_0x1a77c0[_0x9cd8('0x35')]:_0x3680e0[_0x9cd8('0x30')];if(_0x2fc019[_0x9cd8('0x31')]['includeAll']){_0x1a77c0['include']=[{'all':!![]}];}_0x1a77c0=_['merge']({},_0x1a77c0,_0x2fc019[_0x9cd8('0x40')]);return db[_0x9cd8('0x2d')][_0x9cd8('0x47')](_0x1a77c0)[_0x9cd8('0x25')](handleEntityNotFound(_0xc557f3,null))[_0x9cd8('0x25')](respondWithResult(_0xc557f3,null))['catch'](handleError(_0xc557f3,null));};exports[_0x9cd8('0x48')]=function(_0x48f052,_0x3f3785){return db['FaxApplication'][_0x9cd8('0x48')](_0x48f052[_0x9cd8('0x49')],{})[_0x9cd8('0x25')](respondWithResult(_0x3f3785,0xc9))[_0x9cd8('0x44')](handleError(_0x3f3785,null));};exports[_0x9cd8('0x24')]=function(_0x38aa8c,_0x42d09f){if(_0x38aa8c[_0x9cd8('0x49')]['id']){delete _0x38aa8c[_0x9cd8('0x49')]['id'];}return db[_0x9cd8('0x2d')][_0x9cd8('0x47')]({'where':{'id':_0x38aa8c[_0x9cd8('0x46')]['id']}})[_0x9cd8('0x25')](handleEntityNotFound(_0x42d09f,null))[_0x9cd8('0x25')](saveUpdates(_0x38aa8c[_0x9cd8('0x49')],null))[_0x9cd8('0x25')](respondWithResult(_0x42d09f,null))[_0x9cd8('0x44')](handleError(_0x42d09f,null));};exports['destroy']=function(_0x590592,_0x25c3e4){return db['FaxApplication']['find']({'where':{'id':_0x590592[_0x9cd8('0x46')]['id']}})[_0x9cd8('0x25')](handleEntityNotFound(_0x25c3e4,null))[_0x9cd8('0x25')](removeEntity(_0x25c3e4,null))[_0x9cd8('0x44')](handleError(_0x25c3e4,null));}; \ No newline at end of file +var _0x0506=['FaxApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x0506,0x1f4));var _0x6050=function(_0x40bb6d,_0x29ebe7){_0x40bb6d=_0x40bb6d-0x0;var _0x10a8f3=_0x0506[_0x40bb6d];return _0x10a8f3;};'use strict';var emlformat=require(_0x6050('0x0'));var rimraf=require(_0x6050('0x1'));var zipdir=require(_0x6050('0x2'));var jsonpatch=require(_0x6050('0x3'));var rp=require('request-promise');var moment=require(_0x6050('0x4'));var BPromise=require(_0x6050('0x5'));var Mustache=require('mustache');var util=require(_0x6050('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6050('0x7'));var ejs=require(_0x6050('0x8'));var fs=require('fs');var fs_extra=require(_0x6050('0x9'));var _=require(_0x6050('0xa'));var squel=require(_0x6050('0xb'));var crypto=require(_0x6050('0xc'));var jsforce=require(_0x6050('0xd'));var deskjs=require(_0x6050('0xe'));var toCsv=require(_0x6050('0x7'));var querystring=require(_0x6050('0xf'));var Papa=require(_0x6050('0x10'));var Redis=require('ioredis');var authService=require(_0x6050('0x11'));var qs=require(_0x6050('0x12'));var as=require(_0x6050('0x13'));var hardwareService=require(_0x6050('0x14'));var logger=require(_0x6050('0x15'))('api');var utils=require(_0x6050('0x16'));var config=require(_0x6050('0x17'));var licenseUtil=require(_0x6050('0x18'));var db=require(_0x6050('0x19'))['db'];function respondWithStatusCode(_0xd65078,_0x5a7d1e){_0x5a7d1e=_0x5a7d1e||0xcc;return function(_0x1c66e7){if(_0x1c66e7){return _0xd65078[_0x6050('0x1a')](_0x5a7d1e);}return _0xd65078[_0x6050('0x1b')](_0x5a7d1e)[_0x6050('0x1c')]();};}function respondWithResult(_0x2fb425,_0xcd9a92){_0xcd9a92=_0xcd9a92||0xc8;return function(_0x3e4e35){if(_0x3e4e35){return _0x2fb425[_0x6050('0x1b')](_0xcd9a92)[_0x6050('0x1d')](_0x3e4e35);}};}function respondWithFilteredResult(_0x46653c,_0x302061){return function(_0x1f05d5){if(_0x1f05d5){var _0x595acf=typeof _0x302061[_0x6050('0x1e')]===_0x6050('0x1f')&&typeof _0x302061[_0x6050('0x20')]==='undefined';var _0x2989e6=_0x1f05d5[_0x6050('0x21')];var _0x4723af=_0x595acf?0x0:_0x302061[_0x6050('0x1e')];var _0x59e0e1=_0x595acf?_0x1f05d5['count']:_0x302061[_0x6050('0x1e')]+_0x302061[_0x6050('0x20')];var _0x12a3eb;if(_0x59e0e1>=_0x2989e6){_0x59e0e1=_0x2989e6;_0x12a3eb=0xc8;}else{_0x12a3eb=0xce;}_0x46653c[_0x6050('0x1b')](_0x12a3eb);return _0x46653c[_0x6050('0x22')]('Content-Range',_0x4723af+'-'+_0x59e0e1+'/'+_0x2989e6)[_0x6050('0x1d')](_0x1f05d5);}return null;};}function patchUpdates(_0x34727d){return function(_0x22d1e1){try{jsonpatch[_0x6050('0x23')](_0x22d1e1,_0x34727d,!![]);}catch(_0x139808){return BPromise[_0x6050('0x24')](_0x139808);}return _0x22d1e1[_0x6050('0x25')]();};}function saveUpdates(_0x575a44,_0x30d853){return function(_0x5cb6ef){if(_0x5cb6ef){return _0x5cb6ef[_0x6050('0x26')](_0x575a44)[_0x6050('0x27')](function(_0x56c1a5){return _0x56c1a5;});}return null;};}function removeEntity(_0x2782a5,_0x369a08){return function(_0x120ff5){if(_0x120ff5){return _0x120ff5[_0x6050('0x28')]()[_0x6050('0x27')](function(){_0x2782a5['status'](0xcc)[_0x6050('0x1c')]();});}};}function handleEntityNotFound(_0xa65407,_0x1d0b93){return function(_0x5ac3d8){if(!_0x5ac3d8){_0xa65407[_0x6050('0x1a')](0x194);}return _0x5ac3d8;};}function handleError(_0x2a7abf,_0xb4c9d1){_0xb4c9d1=_0xb4c9d1||0x1f4;return function(_0x2a8e01){logger[_0x6050('0x29')](_0x2a8e01['stack']);if(_0x2a8e01[_0x6050('0x2a')]){delete _0x2a8e01['name'];}_0x2a7abf[_0x6050('0x1b')](_0xb4c9d1)[_0x6050('0x2b')](_0x2a8e01);};}exports[_0x6050('0x2c')]=function(_0x4f9c40,_0x8921a5){var _0x5c9ab8={},_0x54fe16={},_0x5b96ec={'count':0x0,'rows':[]};var _0x489450=_[_0x6050('0x2d')](db[_0x6050('0x2e')][_0x6050('0x2f')],function(_0x4ba548){return{'name':_0x4ba548[_0x6050('0x30')],'type':_0x4ba548['type'][_0x6050('0x31')]};});_0x54fe16[_0x6050('0x32')]=_[_0x6050('0x2d')](_0x489450,_0x6050('0x2a'));_0x54fe16[_0x6050('0x33')]=_[_0x6050('0x34')](_0x4f9c40['query']);_0x54fe16[_0x6050('0x35')]=_['intersection'](_0x54fe16[_0x6050('0x32')],_0x54fe16[_0x6050('0x33')]);_0x5c9ab8['attributes']=_[_0x6050('0x36')](_0x54fe16[_0x6050('0x32')],qs[_0x6050('0x37')](_0x4f9c40[_0x6050('0x33')]['fields']));_0x5c9ab8['attributes']=_0x5c9ab8[_0x6050('0x38')][_0x6050('0x39')]?_0x5c9ab8[_0x6050('0x38')]:_0x54fe16[_0x6050('0x32')];if(!_0x4f9c40[_0x6050('0x33')][_0x6050('0x3a')](_0x6050('0x3b'))){_0x5c9ab8[_0x6050('0x20')]=qs['limit'](_0x4f9c40[_0x6050('0x33')]['limit']);_0x5c9ab8['offset']=qs[_0x6050('0x1e')](_0x4f9c40[_0x6050('0x33')][_0x6050('0x1e')]);}_0x5c9ab8[_0x6050('0x3c')]=qs[_0x6050('0x3d')](_0x4f9c40[_0x6050('0x33')]['sort']);_0x5c9ab8[_0x6050('0x3e')]=qs['filters'](_[_0x6050('0x3f')](_0x4f9c40[_0x6050('0x33')],_0x54fe16[_0x6050('0x35')]),_0x489450);if(_0x4f9c40[_0x6050('0x33')]['filter']){_0x5c9ab8['where']=_[_0x6050('0x40')](_0x5c9ab8[_0x6050('0x3e')],{'$or':_[_0x6050('0x2d')](_0x489450,function(_0x31bbe5){if(_0x31bbe5[_0x6050('0x41')]!==_0x6050('0x42')){var _0x401044={};_0x401044[_0x31bbe5['name']]={'$like':'%'+_0x4f9c40[_0x6050('0x33')]['filter']+'%'};return _0x401044;}})});}_0x5c9ab8=_[_0x6050('0x40')]({},_0x5c9ab8,_0x4f9c40['options']);var _0x5f4179={'where':_0x5c9ab8[_0x6050('0x3e')]};return db['FaxApplication'][_0x6050('0x21')](_0x5f4179)[_0x6050('0x27')](function(_0x372bcb){_0x5b96ec[_0x6050('0x21')]=_0x372bcb;if(_0x4f9c40[_0x6050('0x33')][_0x6050('0x43')]){_0x5c9ab8[_0x6050('0x44')]=[{'all':!![]}];}return db[_0x6050('0x2e')][_0x6050('0x45')](_0x5c9ab8);})[_0x6050('0x27')](function(_0x1499cd){_0x5b96ec[_0x6050('0x46')]=_0x1499cd;return _0x5b96ec;})[_0x6050('0x27')](respondWithFilteredResult(_0x8921a5,_0x5c9ab8))[_0x6050('0x47')](handleError(_0x8921a5,null));};exports[_0x6050('0x48')]=function(_0x22c85a,_0x2acc91){var _0x5e83a4={'raw':!![],'where':{'id':_0x22c85a[_0x6050('0x49')]['id']}},_0x39e191={};_0x39e191['model']=_['keys'](db[_0x6050('0x2e')][_0x6050('0x2f')]);_0x39e191[_0x6050('0x33')]=_[_0x6050('0x34')](_0x22c85a[_0x6050('0x33')]);_0x39e191['filters']=_['intersection'](_0x39e191[_0x6050('0x32')],_0x39e191[_0x6050('0x33')]);_0x5e83a4[_0x6050('0x38')]=_[_0x6050('0x36')](_0x39e191['model'],qs[_0x6050('0x37')](_0x22c85a[_0x6050('0x33')][_0x6050('0x37')]));_0x5e83a4['attributes']=_0x5e83a4[_0x6050('0x38')][_0x6050('0x39')]?_0x5e83a4[_0x6050('0x38')]:_0x39e191['model'];if(_0x22c85a[_0x6050('0x33')][_0x6050('0x43')]){_0x5e83a4[_0x6050('0x44')]=[{'all':!![]}];}_0x5e83a4=_[_0x6050('0x40')]({},_0x5e83a4,_0x22c85a[_0x6050('0x4a')]);return db[_0x6050('0x2e')][_0x6050('0x4b')](_0x5e83a4)[_0x6050('0x27')](handleEntityNotFound(_0x2acc91,null))[_0x6050('0x27')](respondWithResult(_0x2acc91,null))['catch'](handleError(_0x2acc91,null));};exports[_0x6050('0x4c')]=function(_0x37eee5,_0xb0fc31){return db[_0x6050('0x2e')][_0x6050('0x4c')](_0x37eee5[_0x6050('0x4d')],{})[_0x6050('0x27')](respondWithResult(_0xb0fc31,0xc9))['catch'](handleError(_0xb0fc31,null));};exports['update']=function(_0x4db6a1,_0x4d7946){if(_0x4db6a1['body']['id']){delete _0x4db6a1[_0x6050('0x4d')]['id'];}return db[_0x6050('0x2e')][_0x6050('0x4b')]({'where':{'id':_0x4db6a1[_0x6050('0x49')]['id']}})[_0x6050('0x27')](handleEntityNotFound(_0x4d7946,null))[_0x6050('0x27')](saveUpdates(_0x4db6a1[_0x6050('0x4d')],null))[_0x6050('0x27')](respondWithResult(_0x4d7946,null))[_0x6050('0x47')](handleError(_0x4d7946,null));};exports[_0x6050('0x28')]=function(_0x17b676,_0x1888e3){return db[_0x6050('0x2e')]['find']({'where':{'id':_0x17b676[_0x6050('0x49')]['id']}})[_0x6050('0x27')](handleEntityNotFound(_0x1888e3,null))[_0x6050('0x27')](removeEntity(_0x1888e3,null))[_0x6050('0x47')](handleError(_0x1888e3,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 0333fed..8c866c1 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 _0x7363=['../../config/logger','moment','request-promise','path','rimraf','./faxApplication.attributes','define','FaxApplication','fax_applications','lodash'];(function(_0x2782e3,_0x9d4bab){var _0x38a248=function(_0x25d076){while(--_0x25d076){_0x2782e3['push'](_0x2782e3['shift']());}};_0x38a248(++_0x9d4bab);}(_0x7363,0x6d));var _0x3736=function(_0x2cf5ea,_0x196c13){_0x2cf5ea=_0x2cf5ea-0x0;var _0x215d39=_0x7363[_0x2cf5ea];return _0x215d39;};'use strict';var _=require(_0x3736('0x0'));var util=require('util');var logger=require(_0x3736('0x1'))('api');var moment=require(_0x3736('0x2'));var BPromise=require('bluebird');var rp=require(_0x3736('0x3'));var fs=require('fs');var path=require(_0x3736('0x4'));var rimraf=require(_0x3736('0x5'));var config=require('../../config/environment');var attributes=require(_0x3736('0x6'));module['exports']=function(_0x31d3d4,_0x2289b7){return _0x31d3d4[_0x3736('0x7')](_0x3736('0x8'),attributes,{'tableName':_0x3736('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xdd2e=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','FaxApplication','fax_applications','utf8mb4_unicode_ci'];(function(_0x15cb90,_0x523537){var _0x48f06c=function(_0x16143c){while(--_0x16143c){_0x15cb90['push'](_0x15cb90['shift']());}};_0x48f06c(++_0x523537);}(_0xdd2e,0x6c));var _0xedd2=function(_0x2b919d,_0x19a60a){_0x2b919d=_0x2b919d-0x0;var _0x374b62=_0xdd2e[_0x2b919d];return _0x374b62;};'use strict';var _=require(_0xedd2('0x0'));var util=require(_0xedd2('0x1'));var logger=require('../../config/logger')(_0xedd2('0x2'));var moment=require(_0xedd2('0x3'));var BPromise=require(_0xedd2('0x4'));var rp=require(_0xedd2('0x5'));var fs=require('fs');var path=require(_0xedd2('0x6'));var rimraf=require('rimraf');var config=require(_0xedd2('0x7'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x172e16,_0xab466f){return _0x172e16[_0xedd2('0x8')](_0xedd2('0x9'),attributes,{'tableName':_0xedd2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xedd2('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 560e69c..21ce668 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 _0x5db6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','limit','lodash','ioredis','../../mysqldb','../../config/utils'];(function(_0xe904ce,_0x224e36){var _0x45437a=function(_0x53ab11){while(--_0x53ab11){_0xe904ce['push'](_0xe904ce['shift']());}};_0x45437a(++_0x224e36);}(_0x5db6,0x88));var _0x65db=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0x5db6[_0x42f270];return _0x57bc5b;};'use strict';var _=require(_0x65db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65db('0x1'));var db=require(_0x65db('0x2'))['db'];var utils=require(_0x65db('0x3'));var logger=require(_0x65db('0x4'))(_0x65db('0x5'));var config=require(_0x65db('0x6'));var jayson=require(_0x65db('0x7'));var client=jayson[_0x65db('0x8')][_0x65db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15cf75,_0x21a7c5,_0x36242b){return new BPromise(function(_0x254457,_0x439251){return client[_0x65db('0xa')](_0x15cf75,_0x36242b)[_0x65db('0xb')](function(_0x37215c){logger[_0x65db('0xc')]('FaxApplication,\x20%s,\x20%s',_0x21a7c5,_0x65db('0xd'));logger[_0x65db('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x21a7c5,'request\x20sent',JSON[_0x65db('0xf')](_0x37215c));if(_0x37215c[_0x65db('0x10')]){if(_0x37215c[_0x65db('0x10')]['code']===0x1f4){logger[_0x65db('0x10')](_0x65db('0x11'),_0x21a7c5,_0x37215c[_0x65db('0x10')]['message']);return _0x439251(_0x37215c[_0x65db('0x10')]['message']);}logger[_0x65db('0x10')](_0x65db('0x11'),_0x21a7c5,_0x37215c['error'][_0x65db('0x12')]);return _0x254457(_0x37215c[_0x65db('0x10')][_0x65db('0x12')]);}else{logger[_0x65db('0xc')](_0x65db('0x11'),_0x21a7c5,_0x65db('0xd'));_0x254457(_0x37215c[_0x65db('0x13')][_0x65db('0x12')]);}})[_0x65db('0x14')](function(_0x333ff0){logger['error'](_0x65db('0x11'),_0x21a7c5,_0x333ff0);_0x439251(_0x333ff0);});});}exports[_0x65db('0x15')]=function(_0x2be1c5){var _0x57f88f=this;return new Promise(function(_0x12a452,_0x3ebc70){return db[_0x65db('0x16')][_0x65db('0x17')](_0x2be1c5[_0x65db('0x18')],{'raw':_0x2be1c5[_0x65db('0x19')]?_0x2be1c5[_0x65db('0x19')][_0x65db('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2be1c5[_0x65db('0x19')]?_0x2be1c5[_0x65db('0x19')]['where']||null:null,'attributes':_0x2be1c5['options']?_0x2be1c5[_0x65db('0x19')]['attributes']||null:null,'limit':_0x2be1c5[_0x65db('0x19')]?_0x2be1c5[_0x65db('0x19')][_0x65db('0x1b')]||null:null})['then'](function(_0xe9bdbe){logger[_0x65db('0xc')]('UpdateFaxApplication',_0x2be1c5);logger[_0x65db('0xe')](_0x65db('0x15'),_0x2be1c5,JSON[_0x65db('0xf')](_0xe9bdbe));_0x12a452(_0xe9bdbe);})[_0x65db('0x14')](function(_0x19aff2){logger[_0x65db('0x10')](_0x65db('0x15'),_0x19aff2['message'],_0x2be1c5);_0x3ebc70(_0x57f88f[_0x65db('0x10')](0x1f4,_0x19aff2[_0x65db('0x12')]));});});}; \ No newline at end of file +var _0x8a06=['where','attributes','limit','then','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','update','body','options','raw'];(function(_0x5b890b,_0x49d74d){var _0x55e30b=function(_0x378107){while(--_0x378107){_0x5b890b['push'](_0x5b890b['shift']());}};_0x55e30b(++_0x49d74d);}(_0x8a06,0x1c6));var _0x68a0=function(_0xc2c0c3,_0x2bf8a9){_0xc2c0c3=_0xc2c0c3-0x0;var _0x292acf=_0x8a06[_0xc2c0c3];return _0x292acf;};'use strict';var _=require(_0x68a0('0x0'));var util=require(_0x68a0('0x1'));var moment=require(_0x68a0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68a0('0x3'));var db=require(_0x68a0('0x4'))['db'];var utils=require(_0x68a0('0x5'));var logger=require(_0x68a0('0x6'))(_0x68a0('0x7'));var config=require(_0x68a0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x68a0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa12d,_0x5e3beb,_0x38641a){return new BPromise(function(_0xc3fd0f,_0x303cc1){return client[_0x68a0('0xa')](_0x3aa12d,_0x38641a)['then'](function(_0x5ab820){logger[_0x68a0('0xb')]('FaxApplication,\x20%s,\x20%s',_0x5e3beb,_0x68a0('0xc'));logger[_0x68a0('0xd')](_0x68a0('0xe'),_0x5e3beb,_0x68a0('0xc'),JSON[_0x68a0('0xf')](_0x5ab820));if(_0x5ab820[_0x68a0('0x10')]){if(_0x5ab820[_0x68a0('0x10')]['code']===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x5e3beb,_0x5ab820[_0x68a0('0x10')][_0x68a0('0x11')]);return _0x303cc1(_0x5ab820[_0x68a0('0x10')][_0x68a0('0x11')]);}logger['error'](_0x68a0('0x12'),_0x5e3beb,_0x5ab820[_0x68a0('0x10')]['message']);return _0xc3fd0f(_0x5ab820[_0x68a0('0x10')][_0x68a0('0x11')]);}else{logger[_0x68a0('0xb')](_0x68a0('0x12'),_0x5e3beb,_0x68a0('0xc'));_0xc3fd0f(_0x5ab820[_0x68a0('0x13')]['message']);}})[_0x68a0('0x14')](function(_0x289e03){logger[_0x68a0('0x10')](_0x68a0('0x12'),_0x5e3beb,_0x289e03);_0x303cc1(_0x289e03);});});}exports[_0x68a0('0x15')]=function(_0xb0942a){var _0x3f91ca=this;return new Promise(function(_0x31bc5f,_0x3339ae){return db['FaxApplication'][_0x68a0('0x16')](_0xb0942a[_0x68a0('0x17')],{'raw':_0xb0942a[_0x68a0('0x18')]?_0xb0942a[_0x68a0('0x18')][_0x68a0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb0942a[_0x68a0('0x18')]?_0xb0942a[_0x68a0('0x18')][_0x68a0('0x1a')]||null:null,'attributes':_0xb0942a[_0x68a0('0x18')]?_0xb0942a[_0x68a0('0x18')][_0x68a0('0x1b')]||null:null,'limit':_0xb0942a[_0x68a0('0x18')]?_0xb0942a[_0x68a0('0x18')][_0x68a0('0x1c')]||null:null})[_0x68a0('0x1d')](function(_0x1a2dd5){logger[_0x68a0('0xb')](_0x68a0('0x15'),_0xb0942a);logger[_0x68a0('0xd')](_0x68a0('0x15'),_0xb0942a,JSON[_0x68a0('0xf')](_0x1a2dd5));_0x31bc5f(_0x1a2dd5);})[_0x68a0('0x14')](function(_0x1c7904){logger[_0x68a0('0x10')](_0x68a0('0x15'),_0x1c7904[_0x68a0('0x11')],_0xb0942a);_0x3339ae(_0x3f91ca[_0x68a0('0x10')](0x1f4,_0x1c7904['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 26ec0df..a7f8110 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 _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xb688,0xcf));var _0x8b68=function(_0x2067b2,_0x34acb4){_0x2067b2=_0x2067b2-0x0;var _0xe76c18=_0xb688[_0x2067b2];return _0xe76c18;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=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(_0x6843c6,_0x404fb2){var _0x3d59a6=function(_0x458cc0){while(--_0x458cc0){_0x6843c6['push'](_0x6843c6['shift']());}};_0x3d59a6(++_0x404fb2);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0xe5b5[_0x26b80e];return _0x84a8a8;};'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 29af09c..9112c19 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 _0xd006=['STRING','out','sequelize','BOOLEAN','DATE'];(function(_0x36e3ba,_0x1912e8){var _0x7972c7=function(_0x52e712){while(--_0x52e712){_0x36e3ba['push'](_0x36e3ba['shift']());}};_0x7972c7(++_0x1912e8);}(_0xd006,0x1c4));var _0x6d00=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd006[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x6d00('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6d00('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6d00('0x2')]},'disposition':{'type':Sequelize[_0x6d00('0x3')]},'secondDisposition':{'type':Sequelize[_0x6d00('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6d00('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6d00('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6d00('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6d00('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6d00('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0410=['DATE','sequelize','exports','BOOLEAN','STRING','ENUM','out'];(function(_0x178b9c,_0x4d90b3){var _0xad076f=function(_0x1a9b8b){while(--_0x1a9b8b){_0x178b9c['push'](_0x178b9c['shift']());}};_0xad076f(++_0x4d90b3);}(_0x0410,0x1c1));var _0x0041=function(_0x7068e,_0x504b5d){_0x7068e=_0x7068e-0x0;var _0x25fae9=_0x0410[_0x7068e];return _0x25fae9;};'use strict';var Sequelize=require(_0x0041('0x0'));module[_0x0041('0x1')]={'closed':{'type':Sequelize[_0x0041('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0041('0x3')]},'secondDisposition':{'type':Sequelize[_0x0041('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0041('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x0041('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0041('0x4')]('in',_0x0041('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0041('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x0041('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 12339e0..3c89c37 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 _0x38dc=['omit','spread','Tag','emit','faxInteractionTags:save','download','join','root','server','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','then','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','FaxInteraction','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','start','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','text','compact','isEmpty','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\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','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','FaxAccountId','sequelize','toString','count','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','params','rawAttributes','includeAll','include','merge','options','create','describe','FaxMessage','addMessage','ids','getMessages','findOne','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags'];(function(_0x16ec9d,_0x36ac5d){var _0x1e98b=function(_0x18a954){while(--_0x18a954){_0x16ec9d['push'](_0x16ec9d['shift']());}};_0x1e98b(++_0x36ac5d);}(_0x38dc,0xfc));var _0xc38d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x38dc[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xc38d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc38d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc38d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc38d('0x3'));var path=require(_0xc38d('0x4'));var sox=require(_0xc38d('0x5'));var csv=require(_0xc38d('0x6'));var ejs=require(_0xc38d('0x7'));var fs=require('fs');var fs_extra=require(_0xc38d('0x8'));var _=require(_0xc38d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc38d('0xa'));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(_0xc38d('0xb'));var qs=require(_0xc38d('0xc'));var as=require(_0xc38d('0xd'));var hardwareService=require(_0xc38d('0xe'));var logger=require(_0xc38d('0xf'))('api');var utils=require(_0xc38d('0x10'));var config=require(_0xc38d('0x11'));var licenseUtil=require(_0xc38d('0x12'));var db=require(_0xc38d('0x13'))['db'];config[_0xc38d('0x14')]=_['defaults'](config[_0xc38d('0x14')],{'host':_0xc38d('0x15'),'port':0x18eb});var socket=require(_0xc38d('0x16'))(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5e272e,_0x1f5227){_0x1f5227=_0x1f5227||0xcc;return function(_0x1bb100){if(_0x1bb100){return _0x5e272e[_0xc38d('0x17')](_0x1f5227);}return _0x5e272e[_0xc38d('0x18')](_0x1f5227)['end']();};}function respondWithResult(_0x481735,_0x20bf12){_0x20bf12=_0x20bf12||0xc8;return function(_0x36968a){if(_0x36968a){return _0x481735['status'](_0x20bf12)[_0xc38d('0x19')](_0x36968a);}};}function respondWithFilteredResult(_0x1cc35b,_0xdc3113){return function(_0x48f365){if(_0x48f365){var _0x1db444=typeof _0xdc3113['offset']===_0xc38d('0x1a')&&typeof _0xdc3113['limit']===_0xc38d('0x1a');var _0x51db5d=_0x48f365['count'];var _0x4fc32e=_0x1db444?0x0:_0xdc3113['offset'];var _0x248c22=_0x1db444?_0x48f365['count']:_0xdc3113[_0xc38d('0x1b')]+_0xdc3113[_0xc38d('0x1c')];var _0x1df5f6;if(_0x248c22>=_0x51db5d){_0x248c22=_0x51db5d;_0x1df5f6=0xc8;}else{_0x1df5f6=0xce;}_0x1cc35b[_0xc38d('0x18')](_0x1df5f6);return _0x1cc35b[_0xc38d('0x1d')](_0xc38d('0x1e'),_0x4fc32e+'-'+_0x248c22+'/'+_0x51db5d)[_0xc38d('0x19')](_0x48f365);}return null;};}function patchUpdates(_0x23e17e){return function(_0x4af6fa){try{jsonpatch[_0xc38d('0x1f')](_0x4af6fa,_0x23e17e,!![]);}catch(_0x3f8355){return BPromise[_0xc38d('0x20')](_0x3f8355);}return _0x4af6fa[_0xc38d('0x21')]();};}function saveUpdates(_0x4f9963,_0x9610b9){return function(_0x41df9c){if(_0x41df9c){return _0x41df9c[_0xc38d('0x22')](_0x4f9963)['then'](function(_0x899b8e){return _0x899b8e;});}return null;};}function removeEntity(_0x1dd111,_0x3fc43f){return function(_0x35cce1){if(_0x35cce1){return _0x35cce1[_0xc38d('0x23')]()['then'](function(){_0x1dd111['status'](0xcc)[_0xc38d('0x24')]();});}};}function handleEntityNotFound(_0x7bc6f9,_0x59dc4a){return function(_0x114d5d){if(!_0x114d5d){_0x7bc6f9[_0xc38d('0x17')](0x194);}return _0x114d5d;};}function handleError(_0x1970f5,_0x4f95e6){_0x4f95e6=_0x4f95e6||0x1f4;return function(_0x299dbb){logger[_0xc38d('0x25')](_0x299dbb[_0xc38d('0x26')]);if(_0x299dbb[_0xc38d('0x27')]){delete _0x299dbb[_0xc38d('0x27')];}_0x1970f5[_0xc38d('0x18')](_0x4f95e6)['send'](_0x299dbb);};}function getInteractionUsers(_0x2f41cb,_0x15aed8){return new BPromise(function(_0x49ff6a,_0xc28594){try{if(_0x15aed8[_0x2f41cb['id']]){_0x2f41cb[_0xc38d('0x28')]=_[_0xc38d('0x29')](_0x15aed8[_0x2f41cb['id']],function(_0x58cc70){return{'id':_0x58cc70['id'],'fullname':_0x58cc70[_0xc38d('0x2a')]};});}}catch(_0x175970){_0xc28594(_0x175970);}_0x49ff6a(_0x2f41cb);});}function getInteractionTags(_0x5b1707,_0x2d5b4a){return new BPromise(function(_0x80d748,_0x15c4f9){try{if(_0x5b1707[_0xc38d('0x2b')]){_0x5b1707[_0xc38d('0x2c')]=[];_0x5b1707['TagIds'][_0xc38d('0x2d')](',')[_0xc38d('0x2e')](function(_0x288148){_0x5b1707[_0xc38d('0x2c')][_0xc38d('0x2f')](_0x2d5b4a[_0x288148]);});}delete _0x5b1707[_0xc38d('0x2b')];}catch(_0x5871e1){_0x15c4f9(_0x5871e1);}_0x80d748(_0x5b1707);});}function updateFaxInteraction(_0x5cd01b,_0x58c776,_0xfae70a){return new BPromise(function(_0x4b99c4,_0x353de9){return getInteractionUsers(_0x5cd01b,_0xfae70a)[_0xc38d('0x30')](function(_0x24cff2){return getInteractionTags(_0x24cff2,_0x58c776);})[_0xc38d('0x30')](function(_0xa64de4){return getStateInteraction(_0xa64de4);})['then'](function(_0x3b5590){_0x4b99c4(_0x3b5590);})[_0xc38d('0x31')](function(_0xf9a787){_0x353de9(_0xf9a787);});});}function getStateInteraction(_0x1379aa){return new BPromise(function(_0x27ea46){_0x1379aa[_0xc38d('0x32')]=0x0;_0x1379aa[_0xc38d('0x33')]=0x0;_0x1379aa[_0xc38d('0x34')]=0x0;_0x1379aa[_0xc38d('0x35')]=0x0;_0x1379aa[_0xc38d('0x36')]=0x0;if(!_0x1379aa[_0xc38d('0x37')]&&!_0x1379aa[_0xc38d('0x38')]){_0x1379aa[_0xc38d('0x32')]+=0x1;}if(!_0x1379aa[_0xc38d('0x37')]&&_0x1379aa[_0xc38d('0x38')]){_0x1379aa['talking']+=0x1;if(_0x1379aa['waiting']){_0x1379aa[_0xc38d('0x32')]-=0x1;}}if(_0x1379aa[_0xc38d('0x37')]&&_0x1379aa[_0xc38d('0x38')]){_0x1379aa[_0xc38d('0x34')]+=0x1;if(_0x1379aa[_0xc38d('0x33')]){_0x1379aa[_0xc38d('0x33')]-=0x1;}}if(_0x1379aa[_0xc38d('0x37')]&&!_0x1379aa[_0xc38d('0x38')]){_0x1379aa['unmanaged']+=0x1;if(_0x1379aa[_0xc38d('0x32')]){_0x1379aa[_0xc38d('0x32')]-=0x1;}}_0x1379aa[_0xc38d('0x36')]+=0x1;_0x27ea46(_0x1379aa);});}exports[_0xc38d('0x39')]=function(_0x23499b,_0x525d06){var _0x5c1b75={},_0x5af3ed={},_0xd13521={'count':0x0,'rows':[]};var _0xa20e44=_[_0xc38d('0x29')](db[_0xc38d('0x3a')]['rawAttributes'],function(_0x30d300){return{'name':_0x30d300[_0xc38d('0x3b')],'type':_0x30d300['type'][_0xc38d('0x3c')]};});_0x5af3ed[_0xc38d('0x3d')]=_[_0xc38d('0x29')](_0xa20e44,_0xc38d('0x27'));_0x5af3ed['query']=_[_0xc38d('0x3e')](_0x23499b[_0xc38d('0x3f')]);_0x5af3ed[_0xc38d('0x40')]=_[_0xc38d('0x41')](_0x5af3ed[_0xc38d('0x3d')],_0x5af3ed[_0xc38d('0x3f')]);_0x5c1b75[_0xc38d('0x42')]=_[_0xc38d('0x41')](_0x5af3ed['model'],qs[_0xc38d('0x43')](_0x23499b[_0xc38d('0x3f')][_0xc38d('0x43')]));_0x5c1b75[_0xc38d('0x42')]=_0x5c1b75[_0xc38d('0x42')][_0xc38d('0x44')]?_0x5c1b75['attributes']:_0x5af3ed[_0xc38d('0x3d')];if(!_0x23499b['query'][_0xc38d('0x45')]('nolimit')){_0x5c1b75['limit']=qs[_0xc38d('0x1c')](_0x23499b[_0xc38d('0x3f')][_0xc38d('0x1c')]);_0x5c1b75['offset']=qs[_0xc38d('0x1b')](_0x23499b[_0xc38d('0x3f')][_0xc38d('0x1b')]);}_0x5c1b75[_0xc38d('0x46')]=qs[_0xc38d('0x47')](_0x23499b[_0xc38d('0x3f')][_0xc38d('0x47')]);_0x5c1b75['where']=qs['filters'](_[_0xc38d('0x48')](_0x23499b[_0xc38d('0x3f')],_0x5af3ed[_0xc38d('0x40')]),_0xa20e44);var _0x143787=[];var _0x2de28d=squel[_0xc38d('0x49')]()['field']('id')[_0xc38d('0x4a')]('name')[_0xc38d('0x4a')](_0xc38d('0x4b'))[_0xc38d('0x4c')](_0xc38d('0x4d'));var _0x543400=squel[_0xc38d('0x49')]()['field'](_0xc38d('0x4e'))[_0xc38d('0x4a')](_0xc38d('0x4f'))['field'](_0xc38d('0x50'))[_0xc38d('0x4c')](_0xc38d('0x51'),'ui')['left_join'](_0xc38d('0x52'),'u',_0xc38d('0x53'));var _0x22eaa2=squel['select']()['from'](_0xc38d('0x54'),'i')[_0xc38d('0x55')](_0xc38d('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xc38d('0x55')](_0xc38d('0x52'),'o',_0xc38d('0x57'))[_0xc38d('0x55')](_0xc38d('0x58'),'a','a.id\x20=\x20i.FaxAccountId')[_0xc38d('0x55')](_0xc38d('0x59'),'me',_0xc38d('0x5a'))['left_join'](_0xc38d('0x5b'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xc38d('0x55')](_0xc38d('0x4d'),'t','t.id\x20=\x20it.TagId');var _0xff9870=squel['expr']();var _0x3960c3=[];var _0x3af197=squel[_0xc38d('0x5c')]();var _0x2215cb;if(_0x23499b['query'][_0xc38d('0x5d')]){_0x2215cb=as[_0xc38d('0x5e')](_0x23499b['query'][_0xc38d('0x5d')]);var _0x3d9c0c=_0x2215cb['sqlOperator'];for(var _0x1bf6bc=0x0;_0x1bf6bc<_0x2215cb[_0xc38d('0x5f')]['length'];_0x1bf6bc++){var _0x511f15=_0x2215cb[_0xc38d('0x5f')][_0x1bf6bc];var _0x1aa1ec='i';var _0x842ee6=_[_0xc38d('0x60')](_0xa20e44,[_0xc38d('0x27'),_0x511f15['field']]);if(!_0x842ee6){switch(_0x511f15['field']){case'unreadMessages':if(_0x511f15['value']==0x1){_0x22eaa2[_0xc38d('0x61')]('`'+_0x511f15[_0xc38d('0x4a')]+_0xc38d('0x62'));}else{_0x22eaa2[_0xc38d('0x61')]('`'+_0x511f15[_0xc38d('0x4a')]+_0xc38d('0x63'));}break;case _0xc38d('0x64'):if(_0x511f15[_0xc38d('0x65')]==='$substring'){if(_0x511f15[_0xc38d('0x66')][_0xc38d('0x2d')]('\x20')['length']>0x1){_0xff9870[_0x3d9c0c](_0xc38d('0x67'),qs[_0xc38d('0x68')](_0x511f15[_0xc38d('0x66')]),null);}else{var _0x5d6a60='%'+_0x511f15[_0xc38d('0x66')]+'%';_0xff9870[_0x3d9c0c](_0xc38d('0x69'),_0x5d6a60,_0x5d6a60,_0x5d6a60);}}else{_0x842ee6=_[_0xc38d('0x60')](_0xa20e44,[_0xc38d('0x27'),_0xc38d('0x6a')]);_0x511f15['field']=_0xc38d('0x6a');_0x36b973=as['buildExpression'](_0x1aa1ec,_0x842ee6[_0xc38d('0x6b')],_0x511f15);_0xff9870[_0x3d9c0c](_0x36b973['text'],_0x36b973[_0xc38d('0x66')][_0xc38d('0x6c')],_0x36b973[_0xc38d('0x66')]['end']);}break;case'Tag':var _0x7b3144=_0x511f15[_0xc38d('0x66')][_0xc38d('0x2d')](',')[_0xc38d('0x29')](function(_0x40c602){return Number(_0x40c602);});_0x7b3144[_0xc38d('0x2e')](function(_0x3c4077){_0x3af197['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c4077+',%');});_0x3960c3=_[_0xc38d('0x6d')](_0x3960c3,_0x7b3144);break;case _0xc38d('0x6e'):if(_0x511f15['operator']===_0xc38d('0x6f')){_0xff9870[_0x3d9c0c](_0xc38d('0x70'),'%'+_0x511f15[_0xc38d('0x66')]+'%',null);}else{_0x842ee6=_[_0xc38d('0x60')](_0xa20e44,[_0xc38d('0x27'),_0xc38d('0x38')]);_0x511f15[_0xc38d('0x4a')]='UserId';_0x36b973=as[_0xc38d('0x71')](_0x1aa1ec,_0x842ee6[_0xc38d('0x6b')],_0x511f15);_0xff9870[_0x3d9c0c](_0x36b973['text'],_0x36b973[_0xc38d('0x66')]['start'],_0x36b973[_0xc38d('0x66')][_0xc38d('0x24')]);}break;case _0xc38d('0x72'):_0x36b973=as[_0xc38d('0x71')]('me',null,_0x511f15);_0xff9870[_0x3d9c0c](_0x36b973[_0xc38d('0x73')],_0x36b973[_0xc38d('0x66')]['start'],_0x36b973['value']['end']);break;}}else{var _0x36b973=as[_0xc38d('0x71')](_0x1aa1ec,_0x842ee6[_0xc38d('0x6b')],_0x511f15);_0xff9870[_0x3d9c0c](_0x36b973[_0xc38d('0x73')],_0x36b973[_0xc38d('0x66')][_0xc38d('0x6c')],_0x36b973[_0xc38d('0x66')][_0xc38d('0x24')]);}}}else{var _0x454c45=_(_0x23499b[_0xc38d('0x3f')])[_0xc38d('0x3e')]()[_0xc38d('0x29')](function(_0x199b11){return _['some'](_0xa20e44,[_0xc38d('0x27'),_0x199b11])?_0x199b11:undefined;})[_0xc38d('0x74')]()[_0xc38d('0x66')]();if(!_[_0xc38d('0x75')](_0x454c45)){_0x454c45[_0xc38d('0x2e')](function(_0x16d16a){if(_0x16d16a==='FaxAccountId'){_0x22eaa2[_0xc38d('0x76')](_0xc38d('0x77'),[][_0xc38d('0x78')](_0x23499b[_0xc38d('0x3f')][_0x16d16a]));}else if(_0x16d16a===_0xc38d('0x79')){var _0x211adc=JSON['parse'](_0x23499b['query'][_0x16d16a])[_0xc38d('0x7a')];var _0xc63b8d=JSON['parse'](_0x23499b[_0xc38d('0x3f')][_0x16d16a])['$lte'];_0x22eaa2[_0xc38d('0x76')](_0xc38d('0x7b'),_0x211adc,_0xc63b8d);}else{if(_0x23499b[_0xc38d('0x3f')][_0x16d16a]==='null'){_0x22eaa2[_0xc38d('0x76')]('i.'+_0x16d16a+_0xc38d('0x7c'));}else{_0x22eaa2[_0xc38d('0x76')]('i.'+_0x16d16a+_0xc38d('0x7d'),_0x23499b[_0xc38d('0x3f')][_0x16d16a]);}}});}if(_0x23499b['query'][_0xc38d('0x7e')]){if(_0x23499b[_0xc38d('0x3f')]['read']==0x1){_0x22eaa2['having'](_0xc38d('0x7f'));}else{_0x22eaa2[_0xc38d('0x61')](_0xc38d('0x80'));}}if(_0x23499b[_0xc38d('0x3f')][_0xc38d('0x81')]){_0x3960c3=_[_0xc38d('0x82')](_0x23499b[_0xc38d('0x3f')][_0xc38d('0x81')])?_0x23499b[_0xc38d('0x3f')][_0xc38d('0x81')]:new Array(_0x23499b[_0xc38d('0x3f')][_0xc38d('0x81')]);_0x3960c3[_0xc38d('0x2e')](function(_0x249b76){_0x3af197['or'](_0xc38d('0x83'),'%,'+_0x249b76+',%');});}if(_0x23499b[_0xc38d('0x3f')][_0xc38d('0x84')]){var _0x304d3e=_0x23499b[_0xc38d('0x3f')][_0xc38d('0x84')][_0xc38d('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc38d('0x86')](_0x304d3e)){_0xff9870['or'](_0xc38d('0x87'),_0x304d3e+'%')['or'](_0xc38d('0x88'),_0x304d3e+'%');}_0xff9870['or'](_0xc38d('0x89'),_0x304d3e+'%');}}_0x22eaa2[_0xc38d('0x76')](_0xff9870);_0x22eaa2[_0xc38d('0x8a')](_0xc38d('0x8b'));var _0x4d73d1={'type':db[_0xc38d('0x8c')][_0xc38d('0x8d')][_0xc38d('0x8e')],'raw':!![]};var _0x57a9cf=_0x22eaa2[_0xc38d('0x8f')]();_0x57a9cf[_0xc38d('0x4a')](_0xc38d('0x8b'));_0x57a9cf['field'](_0xc38d('0x90'),_0xc38d('0x91'));if(_0x5c1b75[_0xc38d('0x46')]){_0x5c1b75[_0xc38d('0x46')][_0xc38d('0x2e')](function(_0x32f9e3){var _0x54bda7=_0x32f9e3[0x0]===_0xc38d('0x92')?_0x32f9e3[0x0]:'i.'+_0x32f9e3[0x0];_0x22eaa2['order'](_0x54bda7,_0x32f9e3[0x1]===_0xc38d('0x93')?![]:!![]);});}if(!_[_0xc38d('0x75')](_0x3960c3)){_0x22eaa2['having'](_0x3af197);_0x57a9cf[_0xc38d('0x76')](_0xc38d('0x94'),_0x3960c3);}BPromise[_0xc38d('0x95')]()[_0xc38d('0x30')](function(){if(!_0x2215cb){if(_0x23499b[_0xc38d('0x3f')]['FaxAccountId'])return;_0x57a9cf[_0xc38d('0x76')](_0xc38d('0x96'));_0x22eaa2[_0xc38d('0x76')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x23499b[_0xc38d('0x97')][_0xc38d('0x98')]!==_0xc38d('0x99'))return;return _0x23499b['user'][_0xc38d('0x9a')]({'attributes':['id'],'raw':!![]})[_0xc38d('0x30')](function(_0x2eefa2){if(_['isEmpty'](_0x2eefa2)){_0x57a9cf[_0xc38d('0x76')](_0xc38d('0x9b'));_0x22eaa2[_0xc38d('0x76')](_0xc38d('0x9b'));}else{_0x57a9cf[_0xc38d('0x76')](_0xc38d('0x77'),_[_0xc38d('0x29')](_0x2eefa2,'id'));_0x22eaa2[_0xc38d('0x76')]('i.FaxAccountId\x20IN\x20?',_[_0xc38d('0x29')](_0x2eefa2,'id'));}});})[_0xc38d('0x30')](function(){if(_0x23499b['user'][_0xc38d('0x98')]===_0xc38d('0x99')&&!_0x2215cb&&!_0x23499b['query'][_0xc38d('0x9c')])return[];return db[_0xc38d('0x9d')]['query'](_0x57a9cf[_0xc38d('0x9e')](),_0x4d73d1);})[_0xc38d('0x30')](function(_0x3c5aa0){_0xd13521[_0xc38d('0x9f')]=_0x3c5aa0[_0xc38d('0x44')];if(_0xd13521[_0xc38d('0x9f')]===0x0)return[];return db['sequelize'][_0xc38d('0x3f')](_0x2de28d[_0xc38d('0x9e')](),_0x4d73d1)[_0xc38d('0x30')](function(_0x4aa89d){_0x143787=_[_0xc38d('0xa0')](_0x4aa89d,'id');_0x4d73d1=_['merge'](_0x4d73d1,{'model':db[_0xc38d('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23499b[_0xc38d('0x3f')]['fields']){_0x5c1b75[_0xc38d('0x42')]['forEach'](function(_0x4deb2a){_0x22eaa2[_0xc38d('0x4a')]('i.'+_0x4deb2a);});}else{_0x22eaa2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc38d('0x91'));_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xa1'),_0xc38d('0xa2'));_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xa3'),_0xc38d('0xa4'));_0x22eaa2['field'](_0xc38d('0xa5'),'contactName');_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xa6'));_0x22eaa2[_0xc38d('0x4a')]('c.firstName',_0xc38d('0xa7'));_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xa8'),_0xc38d('0xa9'));_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xaa'),'Contact.email');_0x22eaa2['field'](_0xc38d('0xab'),_0xc38d('0xac'));_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xad'),'Contact.mobile');_0x22eaa2['field'](_0xc38d('0xae'),'Contact.fax');_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xaf'),_0xc38d('0xb0'));_0x22eaa2[_0xc38d('0x4a')](_0xc38d('0xb1'),_0xc38d('0xb2'));_0x22eaa2['field'](_0xc38d('0xb3'),_0xc38d('0x2b'));}if(_0x5c1b75['limit'])_0x22eaa2[_0xc38d('0x1c')](_0x5c1b75['limit']);if(_0x5c1b75[_0xc38d('0x1b')])_0x22eaa2['offset'](_0x5c1b75[_0xc38d('0x1b')]);return db['sequelize']['query'](_0x22eaa2[_0xc38d('0x9e')](),_0x4d73d1);})[_0xc38d('0x30')](function(_0x1a1d49){if(_0x1a1d49[_0xc38d('0x44')]>0x0)_0x543400['where'](_0xc38d('0xb4'),_[_0xc38d('0x29')](_0x1a1d49,'id'));return db[_0xc38d('0x9d')]['query'](_0x543400['toString'](),_0x4d73d1)['then'](function(_0x552051){var _0x3f2837=_[_0xc38d('0xb5')](_0x552051,_0xc38d('0xb6'));var _0x4b23cb=[];_0x1a1d49[_0xc38d('0x2e')](function(_0x211db3){_0x4b23cb['push'](updateFaxInteraction(_0x211db3,_0x143787,_0x3f2837));});return BPromise['all'](_0x4b23cb);});});})[_0xc38d('0x30')](function(_0x5debbd){_0xd13521[_0xc38d('0xb7')]=_0x5debbd;return _0xd13521;})[_0xc38d('0x30')](respondWithFilteredResult(_0x525d06,_0x5c1b75))[_0xc38d('0x31')](handleError(_0x525d06,null));};exports[_0xc38d('0xb8')]=function(_0x2f8c4a,_0xa65dd1){var _0x43e9e7={'raw':![],'where':{'id':_0x2f8c4a[_0xc38d('0xb9')]['id']}},_0x34a23b={};_0x34a23b[_0xc38d('0x3d')]=_[_0xc38d('0x3e')](db[_0xc38d('0x3a')][_0xc38d('0xba')]);_0x34a23b[_0xc38d('0x3f')]=_[_0xc38d('0x3e')](_0x2f8c4a['query']);_0x34a23b[_0xc38d('0x40')]=_[_0xc38d('0x41')](_0x34a23b[_0xc38d('0x3d')],_0x34a23b['query']);_0x43e9e7[_0xc38d('0x42')]=_[_0xc38d('0x41')](_0x34a23b[_0xc38d('0x3d')],qs[_0xc38d('0x43')](_0x2f8c4a[_0xc38d('0x3f')][_0xc38d('0x43')]));_0x43e9e7[_0xc38d('0x42')]=_0x43e9e7['attributes'][_0xc38d('0x44')]?_0x43e9e7[_0xc38d('0x42')]:_0x34a23b[_0xc38d('0x3d')];if(_0x2f8c4a[_0xc38d('0x3f')][_0xc38d('0xbb')]){_0x43e9e7[_0xc38d('0xbc')]=[{'all':!![]}];}_0x43e9e7=_[_0xc38d('0xbd')]({},_0x43e9e7,_0x2f8c4a[_0xc38d('0xbe')]);return db['FaxInteraction']['find'](_0x43e9e7)[_0xc38d('0x30')](handleEntityNotFound(_0xa65dd1,null))['then'](respondWithResult(_0xa65dd1,null))[_0xc38d('0x31')](handleError(_0xa65dd1,null));};exports[_0xc38d('0xbf')]=function(_0xa2a743,_0x3c7aa8){return db[_0xc38d('0x3a')][_0xc38d('0xbf')](_0xa2a743[_0xc38d('0x72')],{})[_0xc38d('0x30')](respondWithResult(_0x3c7aa8,0xc9))[_0xc38d('0x31')](handleError(_0x3c7aa8,null));};exports[_0xc38d('0x22')]=function(_0x541c2e,_0x2f0e9b){if(_0x541c2e[_0xc38d('0x72')]['id']){delete _0x541c2e['body']['id'];}return db[_0xc38d('0x3a')]['find']({'where':{'id':_0x541c2e[_0xc38d('0xb9')]['id']}})['then'](handleEntityNotFound(_0x2f0e9b,null))['then'](saveUpdates(_0x541c2e[_0xc38d('0x72')],null))[_0xc38d('0x30')](respondWithResult(_0x2f0e9b,null))[_0xc38d('0x31')](handleError(_0x2f0e9b,null));};exports[_0xc38d('0x23')]=function(_0x2c1bac,_0xdf8972){return db[_0xc38d('0x3a')][_0xc38d('0x60')]({'where':{'id':_0x2c1bac[_0xc38d('0xb9')]['id']}})[_0xc38d('0x30')](handleEntityNotFound(_0xdf8972,null))[_0xc38d('0x30')](removeEntity(_0xdf8972,null))[_0xc38d('0x31')](handleError(_0xdf8972,null));};exports[_0xc38d('0xc0')]=function(_0x3aa1c4,_0x9e6f34){return db[_0xc38d('0x3a')][_0xc38d('0xc0')]()['then'](respondWithResult(_0x9e6f34,null))[_0xc38d('0x31')](handleError(_0x9e6f34,null));};exports['addMessage']=function(_0x23355f,_0x5aad6b,_0x1b2b50){return db[_0xc38d('0xc1')]['find']({'where':{'id':_0x23355f[_0xc38d('0xb9')]['id']}})[_0xc38d('0x30')](handleEntityNotFound(_0x5aad6b,null))[_0xc38d('0x30')](function(_0x5d94e5){if(_0x5d94e5){return _0x5d94e5[_0xc38d('0xc2')](_0x23355f[_0xc38d('0x72')][_0xc38d('0xc3')],_['omit'](_0x23355f['body'],['ids','id'])||{});}})[_0xc38d('0x30')](respondWithResult(_0x5aad6b,null))['catch'](handleError(_0x5aad6b,null));};exports[_0xc38d('0xc4')]=function(_0xb0ab6f,_0x25f951,_0x2b7b1b){var _0x4d0245={'raw':![],'where':{}};var _0x4200b0={};var _0x791ccf={'count':0x0,'rows':[]};return db[_0xc38d('0x3a')][_0xc38d('0xc5')]({'where':{'id':_0xb0ab6f[_0xc38d('0xb9')]['id']}})['then'](handleEntityNotFound(_0x25f951,null))[_0xc38d('0x30')](function(_0x30ef08){if(_0x30ef08){_0x4200b0[_0xc38d('0x3d')]=_[_0xc38d('0x3e')](db['FaxMessage']['rawAttributes']);_0x4200b0[_0xc38d('0x3f')]=_['keys'](_0xb0ab6f['query']);_0x4200b0[_0xc38d('0x40')]=_[_0xc38d('0x41')](_0x4200b0[_0xc38d('0x3d')],_0x4200b0[_0xc38d('0x3f')]);_0x4d0245[_0xc38d('0x42')]=_[_0xc38d('0x41')](_0x4200b0[_0xc38d('0x3d')],qs[_0xc38d('0x43')](_0xb0ab6f[_0xc38d('0x3f')][_0xc38d('0x43')]));_0x4d0245[_0xc38d('0x42')]=_0x4d0245[_0xc38d('0x42')][_0xc38d('0x44')]?_0x4d0245[_0xc38d('0x42')]:_0x4200b0[_0xc38d('0x3d')];if(!_0xb0ab6f[_0xc38d('0x3f')]['hasOwnProperty'](_0xc38d('0xc6'))){_0x4d0245[_0xc38d('0x1c')]=qs[_0xc38d('0x1c')](_0xb0ab6f[_0xc38d('0x3f')][_0xc38d('0x1c')]);_0x4d0245['offset']=qs[_0xc38d('0x1b')](_0xb0ab6f[_0xc38d('0x3f')]['offset']);}_0x4d0245['order']=qs['sort'](_0xb0ab6f[_0xc38d('0x3f')]['sort']);_0x4d0245[_0xc38d('0x76')]=qs[_0xc38d('0x40')](_[_0xc38d('0x48')](_0xb0ab6f[_0xc38d('0x3f')],_0x4200b0[_0xc38d('0x40')]));_0x4d0245['where'][_0xc38d('0xb6')]=_0x30ef08['id'];if(_0xb0ab6f[_0xc38d('0x3f')][_0xc38d('0x84')]){_0x4d0245['where']=_[_0xc38d('0xbd')](_0x4d0245[_0xc38d('0x76')],{'$or':_[_0xc38d('0x29')](_0x4d0245[_0xc38d('0x42')],function(_0xf8b7cf){var _0x5030fa={};_0x5030fa[_0xf8b7cf]={'$like':'%'+_0xb0ab6f[_0xc38d('0x3f')][_0xc38d('0x84')]+'%'};return _0x5030fa;})});}if(_0xb0ab6f['query'][_0xc38d('0x7a')]){var _0x1cc28b=_0xb0ab6f[_0xc38d('0x3f')]['$gte'][_0xc38d('0x2d')](',');var _0x2fce4f={};_0x2fce4f[_0x1cc28b[0x0]]={'$gte':moment(_0x1cc28b[0x1])['format'](_0xc38d('0xc7'))};_0x4d0245[_0xc38d('0x76')]=_['merge'](_0x4d0245['where'],_0x2fce4f);}_0x4d0245=_[_0xc38d('0xbd')]({},_0x4d0245,_0xb0ab6f['options']);return db['FaxMessage'][_0xc38d('0x9f')]({'where':_0x4d0245[_0xc38d('0x76')]})['then'](function(_0x177db2){_0x791ccf['count']=_0x177db2;if(_0xb0ab6f['query'][_0xc38d('0xbb')]){_0x4d0245[_0xc38d('0xbc')]=[{'all':!![]}];}return db[_0xc38d('0xc1')][_0xc38d('0xc8')](_0x4d0245);})[_0xc38d('0x30')](function(_0x574355){_0x791ccf[_0xc38d('0xb7')]=_0x574355;return _0x791ccf;});}})['then'](respondWithFilteredResult(_0x25f951,_0x4d0245))[_0xc38d('0x31')](handleError(_0x25f951,null));};exports['addTags']=function(_0x203b4e,_0x2910e2,_0x2ae637){return db[_0xc38d('0x3a')][_0xc38d('0x60')]({'where':{'id':_0x203b4e[_0xc38d('0xb9')]['id']}})[_0xc38d('0x30')](handleEntityNotFound(_0x2910e2,null))[_0xc38d('0x30')](function(_0x14ad1e){if(_0x14ad1e){return _0x14ad1e[_0xc38d('0xc9')](_0x203b4e[_0xc38d('0x72')][_0xc38d('0xc3')],_[_0xc38d('0xca')](_0x203b4e['body'],[_0xc38d('0xc3'),'id'])||{})[_0xc38d('0xcb')](function(){return db[_0xc38d('0xcc')]['findAll']({'attributes':['id',_0xc38d('0x27'),_0xc38d('0x4b')],'where':{'id':_0x203b4e[_0xc38d('0x72')]['ids']}});})['then'](function(_0x58bfb0){socket[_0xc38d('0xcd')](_0xc38d('0xce'),{'id':Number(_0x203b4e[_0xc38d('0xb9')]['id']),'tags':_0x58bfb0||[]});return{'id':Number(_0x203b4e['params']['id']),'tags':_0x58bfb0||[]};});}})[_0xc38d('0x30')](respondWithResult(_0x2910e2,null))[_0xc38d('0x31')](handleError(_0x2910e2,null));};exports['removeTags']=function(_0x2ece47,_0x417f81,_0xbf0caa){return db[_0xc38d('0x3a')][_0xc38d('0x60')]({'where':{'id':_0x2ece47[_0xc38d('0xb9')]['id']}})['then'](handleEntityNotFound(_0x417f81,null))['then'](function(_0x8952f){if(_0x8952f){return _0x8952f['removeTags'](_0x2ece47[_0xc38d('0x3f')][_0xc38d('0xc3')]);}})[_0xc38d('0x30')](respondWithStatusCode(_0x417f81,null))[_0xc38d('0x31')](handleError(_0x417f81,null));};exports[_0xc38d('0xcf')]=function(_0x49b277,_0x1ee817){var _0x25794d=moment()['unix']()[_0xc38d('0x9e')]();var _0x23cefb=path[_0xc38d('0xd0')](config[_0xc38d('0xd1')],_0xc38d('0xd2'),'files',_0xc38d('0xd3'));var _0x2c1470=path[_0xc38d('0xd0')](config[_0xc38d('0xd1')],_0xc38d('0xd2'),'files',_0xc38d('0xd4'));var _0x3dc93b=path[_0xc38d('0xd0')](_0x23cefb,_0x25794d);var _0x15f768=util[_0xc38d('0xd5')](_0xc38d('0xd6'),_0x49b277[_0xc38d('0xb9')]['id'],_0x25794d);var _0x2086c0=path['join'](_0x23cefb,_0x15f768);var _0x28d7aa=[];_0x28d7aa[_0xc38d('0x2f')]({'model':db[_0xc38d('0xd7')],'as':_0xc38d('0xd7'),'raw':!![]});var _0x37a0cd=[{'model':db[_0xc38d('0xc1')],'as':_0xc38d('0xd8'),'attributes':['id',_0xc38d('0x72'),_0xc38d('0x79')],'include':_0x28d7aa}];return db['FaxInteraction'][_0xc38d('0x60')]({'where':{'id':_0x49b277['params']['id']},'include':_0x37a0cd})[_0xc38d('0x30')](handleEntityNotFound(_0x1ee817,null))['then'](function(_0x2851d4){if(_0x2851d4&&_0x2851d4[_0xc38d('0xd8')]){var _0x29e2a2=_0x2851d4[_0xc38d('0xd9')]({'plain':!![]});fs[_0xc38d('0xda')](_0x3dc93b);for(var _0x18a967=0x0;_0x18a967<_0x29e2a2[_0xc38d('0xd8')]['length'];_0x18a967++){var _0x2fd3b7=_0x29e2a2[_0xc38d('0xd8')][_0x18a967][_0xc38d('0xd7')];if(_0x2fd3b7){var _0x5aa1cf=path[_0xc38d('0xd0')](_0x2c1470,_0x2fd3b7[_0xc38d('0xdb')]);if(fs[_0xc38d('0xdc')](_0x5aa1cf)){fs[_0xc38d('0xdd')](_0x5aa1cf)[_0xc38d('0xde')](fs[_0xc38d('0xdf')](path[_0xc38d('0xd0')](_0x3dc93b,_0x2fd3b7[_0xc38d('0xdb')])));}}}return BPromise[_0xc38d('0x95')]()[_0xc38d('0x30')](function(){return new BPromise(function(_0x138905,_0x10cfbf){zipdir(_0x3dc93b,{'saveTo':_0x2086c0},function(_0x2d82f5,_0x4df388){if(_0x2d82f5)return _0x10cfbf(_0x2d82f5);return _0x138905(_0x4df388);});})['then'](function(){return new BPromise(function(_0x35fcc9,_0x4d8dc0){rimraf(_0x3dc93b,function(_0x235114){if(_0x235114)_0x4d8dc0(_0x235114);return _0x35fcc9();});});})[_0xc38d('0x30')](function(){return _0x1ee817[_0xc38d('0xcf')](_0x2086c0,_0x15f768,function(_0x3400cc){if(_0x3400cc){console[_0xc38d('0xe0')](_0xc38d('0xe1'),_0x3400cc);}else{fs[_0xc38d('0xe2')](_0x2086c0);}});});});}else{return _0x1ee817[_0xc38d('0x17')](0xc8);}})[_0xc38d('0x31')](handleError(_0x1ee817,null));}; \ No newline at end of file +var _0x1c01=['unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','Users','fullname','TagIds','Tags','push','catch','waiting','talking','answered','total','closed','UserId','index','map','FaxInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','find','body','some','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','FaxAccountId','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','contactName','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','params','include','options','create','update','describe','addMessage','ids','omit','findOne','FaxMessage','FaxInteractionId','$gte','format','includeAll','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1c01,0xf5));var _0x11c0=function(_0x5adc6b,_0x26b9b2){_0x5adc6b=_0x5adc6b-0x0;var _0x5c3cb9=_0x1c01[_0x5adc6b];return _0x5c3cb9;};'use strict';var emlformat=require(_0x11c0('0x0'));var rimraf=require(_0x11c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11c0('0x2'));var rp=require('request-promise');var moment=require(_0x11c0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x11c0('0x4'));var csv=require(_0x11c0('0x5'));var ejs=require(_0x11c0('0x6'));var fs=require('fs');var fs_extra=require(_0x11c0('0x7'));var _=require(_0x11c0('0x8'));var squel=require(_0x11c0('0x9'));var crypto=require(_0x11c0('0xa'));var jsforce=require(_0x11c0('0xb'));var deskjs=require(_0x11c0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x11c0('0xd'));var Papa=require(_0x11c0('0xe'));var Redis=require(_0x11c0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x11c0('0x10'));var as=require(_0x11c0('0x11'));var hardwareService=require(_0x11c0('0x12'));var logger=require(_0x11c0('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x11c0('0x14'));var licenseUtil=require(_0x11c0('0x15'));var db=require(_0x11c0('0x16'))['db'];config[_0x11c0('0x17')]=_[_0x11c0('0x18')](config[_0x11c0('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x11c0('0x19'))(new Redis(config[_0x11c0('0x17')]));require(_0x11c0('0x1a'))[_0x11c0('0x1b')](socket);function respondWithStatusCode(_0x1e3b0f,_0x15a008){_0x15a008=_0x15a008||0xcc;return function(_0x2139b6){if(_0x2139b6){return _0x1e3b0f['sendStatus'](_0x15a008);}return _0x1e3b0f[_0x11c0('0x1c')](_0x15a008)[_0x11c0('0x1d')]();};}function respondWithResult(_0x1cfd28,_0x35dd49){_0x35dd49=_0x35dd49||0xc8;return function(_0x40f5f8){if(_0x40f5f8){return _0x1cfd28[_0x11c0('0x1c')](_0x35dd49)['json'](_0x40f5f8);}};}function respondWithFilteredResult(_0x54920d,_0x36d21d){return function(_0x867cd){if(_0x867cd){var _0x39586e=typeof _0x36d21d[_0x11c0('0x1e')]==='undefined'&&typeof _0x36d21d[_0x11c0('0x1f')]===_0x11c0('0x20');var _0x9e8720=_0x867cd[_0x11c0('0x21')];var _0x55616c=_0x39586e?0x0:_0x36d21d[_0x11c0('0x1e')];var _0x1d7fe7=_0x39586e?_0x867cd[_0x11c0('0x21')]:_0x36d21d[_0x11c0('0x1e')]+_0x36d21d[_0x11c0('0x1f')];var _0x43e061;if(_0x1d7fe7>=_0x9e8720){_0x1d7fe7=_0x9e8720;_0x43e061=0xc8;}else{_0x43e061=0xce;}_0x54920d['status'](_0x43e061);return _0x54920d[_0x11c0('0x22')](_0x11c0('0x23'),_0x55616c+'-'+_0x1d7fe7+'/'+_0x9e8720)['json'](_0x867cd);}return null;};}function patchUpdates(_0x4a3150){return function(_0x3775e3){try{jsonpatch[_0x11c0('0x24')](_0x3775e3,_0x4a3150,!![]);}catch(_0x159d2b){return BPromise['reject'](_0x159d2b);}return _0x3775e3[_0x11c0('0x25')]();};}function saveUpdates(_0x401e8f,_0x3cc72b){return function(_0x2a6c6c){if(_0x2a6c6c){return _0x2a6c6c['update'](_0x401e8f)[_0x11c0('0x26')](function(_0x58fbe4){return _0x58fbe4;});}return null;};}function removeEntity(_0x432e89,_0x4f4316){return function(_0x4889f1){if(_0x4889f1){return _0x4889f1[_0x11c0('0x27')]()['then'](function(){_0x432e89[_0x11c0('0x1c')](0xcc)[_0x11c0('0x1d')]();});}};}function handleEntityNotFound(_0x45f8cb,_0x2eac31){return function(_0x63371c){if(!_0x63371c){_0x45f8cb[_0x11c0('0x28')](0x194);}return _0x63371c;};}function handleError(_0x322bc0,_0x10167b){_0x10167b=_0x10167b||0x1f4;return function(_0x1af4d7){logger[_0x11c0('0x29')](_0x1af4d7[_0x11c0('0x2a')]);if(_0x1af4d7['name']){delete _0x1af4d7[_0x11c0('0x2b')];}_0x322bc0[_0x11c0('0x1c')](_0x10167b)['send'](_0x1af4d7);};}function getInteractionUsers(_0x4b104f,_0x5626bf){return new BPromise(function(_0x25e0d5,_0x389c0f){try{if(_0x5626bf[_0x4b104f['id']]){_0x4b104f[_0x11c0('0x2c')]=_['map'](_0x5626bf[_0x4b104f['id']],function(_0x3bda3c){return{'id':_0x3bda3c['id'],'fullname':_0x3bda3c[_0x11c0('0x2d')]};});}}catch(_0x3441c5){_0x389c0f(_0x3441c5);}_0x25e0d5(_0x4b104f);});}function getInteractionTags(_0x1daefe,_0xb386e1){return new BPromise(function(_0x1e8087,_0x2cc0f3){try{if(_0x1daefe[_0x11c0('0x2e')]){_0x1daefe['Tags']=[];_0x1daefe[_0x11c0('0x2e')]['split'](',')['forEach'](function(_0x20dc8d){_0x1daefe[_0x11c0('0x2f')][_0x11c0('0x30')](_0xb386e1[_0x20dc8d]);});}delete _0x1daefe[_0x11c0('0x2e')];}catch(_0xb655b9){_0x2cc0f3(_0xb655b9);}_0x1e8087(_0x1daefe);});}function updateFaxInteraction(_0x574b28,_0x3bb221,_0xa9d1b2){return new BPromise(function(_0x3c7700,_0x46d0b6){return getInteractionUsers(_0x574b28,_0xa9d1b2)[_0x11c0('0x26')](function(_0x54b8f3){return getInteractionTags(_0x54b8f3,_0x3bb221);})[_0x11c0('0x26')](function(_0x178ffe){return getStateInteraction(_0x178ffe);})[_0x11c0('0x26')](function(_0xca820c){_0x3c7700(_0xca820c);})[_0x11c0('0x31')](function(_0x597d2b){_0x46d0b6(_0x597d2b);});});}function getStateInteraction(_0x2fabcb){return new BPromise(function(_0x2e27fb){_0x2fabcb[_0x11c0('0x32')]=0x0;_0x2fabcb[_0x11c0('0x33')]=0x0;_0x2fabcb[_0x11c0('0x34')]=0x0;_0x2fabcb['unmanaged']=0x0;_0x2fabcb[_0x11c0('0x35')]=0x0;if(!_0x2fabcb[_0x11c0('0x36')]&&!_0x2fabcb[_0x11c0('0x37')]){_0x2fabcb[_0x11c0('0x32')]+=0x1;}if(!_0x2fabcb[_0x11c0('0x36')]&&_0x2fabcb['UserId']){_0x2fabcb['talking']+=0x1;if(_0x2fabcb[_0x11c0('0x32')]){_0x2fabcb[_0x11c0('0x32')]-=0x1;}}if(_0x2fabcb['closed']&&_0x2fabcb['UserId']){_0x2fabcb[_0x11c0('0x34')]+=0x1;if(_0x2fabcb[_0x11c0('0x33')]){_0x2fabcb[_0x11c0('0x33')]-=0x1;}}if(_0x2fabcb[_0x11c0('0x36')]&&!_0x2fabcb[_0x11c0('0x37')]){_0x2fabcb['unmanaged']+=0x1;if(_0x2fabcb['waiting']){_0x2fabcb[_0x11c0('0x32')]-=0x1;}}_0x2fabcb[_0x11c0('0x35')]+=0x1;_0x2e27fb(_0x2fabcb);});}exports[_0x11c0('0x38')]=function(_0x3ca2b7,_0x3120ce){var _0x3a6055={},_0x15b848={},_0x528346={'count':0x0,'rows':[]};var _0x4cf691=_[_0x11c0('0x39')](db[_0x11c0('0x3a')][_0x11c0('0x3b')],function(_0x2b51d9){return{'name':_0x2b51d9[_0x11c0('0x3c')],'type':_0x2b51d9['type'][_0x11c0('0x3d')]};});_0x15b848[_0x11c0('0x3e')]=_[_0x11c0('0x39')](_0x4cf691,_0x11c0('0x2b'));_0x15b848[_0x11c0('0x3f')]=_[_0x11c0('0x40')](_0x3ca2b7['query']);_0x15b848[_0x11c0('0x41')]=_[_0x11c0('0x42')](_0x15b848[_0x11c0('0x3e')],_0x15b848['query']);_0x3a6055[_0x11c0('0x43')]=_[_0x11c0('0x42')](_0x15b848[_0x11c0('0x3e')],qs[_0x11c0('0x44')](_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x44')]));_0x3a6055['attributes']=_0x3a6055[_0x11c0('0x43')]['length']?_0x3a6055[_0x11c0('0x43')]:_0x15b848[_0x11c0('0x3e')];if(!_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x45')](_0x11c0('0x46'))){_0x3a6055[_0x11c0('0x1f')]=qs[_0x11c0('0x1f')](_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x1f')]);_0x3a6055[_0x11c0('0x1e')]=qs[_0x11c0('0x1e')](_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x1e')]);}_0x3a6055['order']=qs[_0x11c0('0x47')](_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x47')]);_0x3a6055[_0x11c0('0x48')]=qs['filters'](_[_0x11c0('0x49')](_0x3ca2b7['query'],_0x15b848[_0x11c0('0x41')]),_0x4cf691);var _0x2dad19=[];var _0x11f365=squel[_0x11c0('0x4a')]()['field']('id')[_0x11c0('0x4b')](_0x11c0('0x2b'))[_0x11c0('0x4b')](_0x11c0('0x4c'))[_0x11c0('0x4d')]('tools_tags');var _0x12b6cf=squel['select']()[_0x11c0('0x4b')]('u.id')['field'](_0x11c0('0x4e'))[_0x11c0('0x4b')](_0x11c0('0x4f'))['from'](_0x11c0('0x50'),'ui')[_0x11c0('0x51')](_0x11c0('0x52'),'u',_0x11c0('0x53'));var _0x415ba4=squel[_0x11c0('0x4a')]()[_0x11c0('0x4d')](_0x11c0('0x54'),'i')[_0x11c0('0x51')](_0x11c0('0x55'),'c',_0x11c0('0x56'))[_0x11c0('0x51')]('users','o',_0x11c0('0x57'))[_0x11c0('0x51')]('fax_accounts','a',_0x11c0('0x58'))[_0x11c0('0x51')](_0x11c0('0x59'),'me',_0x11c0('0x5a'))[_0x11c0('0x51')](_0x11c0('0x5b'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x11c0('0x51')](_0x11c0('0x5c'),'t','t.id\x20=\x20it.TagId');var _0x5054a9=squel[_0x11c0('0x5d')]();var _0x48a8aa=[];var _0x2e9c17=squel[_0x11c0('0x5d')]();var _0x5f38e4;if(_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x5e')]){_0x5f38e4=as[_0x11c0('0x5f')](_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x5e')]);var _0x459f5a=_0x5f38e4[_0x11c0('0x60')];for(var _0x48d0ab=0x0;_0x48d0ab<_0x5f38e4[_0x11c0('0x61')][_0x11c0('0x62')];_0x48d0ab++){var _0x9e65a9=_0x5f38e4[_0x11c0('0x61')][_0x48d0ab];var _0xb9dd74='i';var _0xaf76a6=_['find'](_0x4cf691,['name',_0x9e65a9[_0x11c0('0x4b')]]);if(!_0xaf76a6){switch(_0x9e65a9[_0x11c0('0x4b')]){case _0x11c0('0x63'):if(_0x9e65a9[_0x11c0('0x64')]==0x1){_0x415ba4[_0x11c0('0x65')]('`'+_0x9e65a9[_0x11c0('0x4b')]+_0x11c0('0x66'));}else{_0x415ba4[_0x11c0('0x65')]('`'+_0x9e65a9[_0x11c0('0x4b')]+_0x11c0('0x67'));}break;case _0x11c0('0x68'):if(_0x9e65a9['operator']==='$substring'){if(_0x9e65a9['value'][_0x11c0('0x69')]('\x20')[_0x11c0('0x62')]>0x1){_0x5054a9[_0x459f5a](_0x11c0('0x6a'),qs['getFullTextValue'](_0x9e65a9[_0x11c0('0x64')]),null);}else{var _0x58d86f='%'+_0x9e65a9[_0x11c0('0x64')]+'%';_0x5054a9[_0x459f5a](_0x11c0('0x6b'),_0x58d86f,_0x58d86f,_0x58d86f);}}else{_0xaf76a6=_['find'](_0x4cf691,[_0x11c0('0x2b'),_0x11c0('0x6c')]);_0x9e65a9['field']='ContactId';_0x3e851d=as[_0x11c0('0x6d')](_0xb9dd74,_0xaf76a6[_0x11c0('0x6e')],_0x9e65a9);_0x5054a9[_0x459f5a](_0x3e851d[_0x11c0('0x6f')],_0x3e851d['value'][_0x11c0('0x70')],_0x3e851d[_0x11c0('0x64')][_0x11c0('0x1d')]);}break;case _0x11c0('0x71'):var _0x42769f=_0x9e65a9[_0x11c0('0x64')][_0x11c0('0x69')](',')['map'](function(_0x2f66d6){return Number(_0x2f66d6);});_0x42769f[_0x11c0('0x72')](function(_0x1061bb){_0x2e9c17['or'](_0x11c0('0x73'),'%,'+_0x1061bb+',%');});_0x48a8aa=_[_0x11c0('0x74')](_0x48a8aa,_0x42769f);break;case _0x11c0('0x75'):if(_0x9e65a9[_0x11c0('0x76')]===_0x11c0('0x77')){_0x5054a9[_0x459f5a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x9e65a9[_0x11c0('0x64')]+'%',null);}else{_0xaf76a6=_[_0x11c0('0x78')](_0x4cf691,[_0x11c0('0x2b'),'UserId']);_0x9e65a9['field']=_0x11c0('0x37');_0x3e851d=as['buildExpression'](_0xb9dd74,_0xaf76a6[_0x11c0('0x6e')],_0x9e65a9);_0x5054a9[_0x459f5a](_0x3e851d[_0x11c0('0x6f')],_0x3e851d[_0x11c0('0x64')][_0x11c0('0x70')],_0x3e851d[_0x11c0('0x64')][_0x11c0('0x1d')]);}break;case _0x11c0('0x79'):_0x3e851d=as[_0x11c0('0x6d')]('me',null,_0x9e65a9);_0x5054a9[_0x459f5a](_0x3e851d['text'],_0x3e851d[_0x11c0('0x64')][_0x11c0('0x70')],_0x3e851d[_0x11c0('0x64')][_0x11c0('0x1d')]);break;}}else{var _0x3e851d=as[_0x11c0('0x6d')](_0xb9dd74,_0xaf76a6['type'],_0x9e65a9);_0x5054a9[_0x459f5a](_0x3e851d[_0x11c0('0x6f')],_0x3e851d[_0x11c0('0x64')]['start'],_0x3e851d[_0x11c0('0x64')][_0x11c0('0x1d')]);}}}else{var _0x5d4a06=_(_0x3ca2b7[_0x11c0('0x3f')])[_0x11c0('0x40')]()[_0x11c0('0x39')](function(_0x420011){return _[_0x11c0('0x7a')](_0x4cf691,[_0x11c0('0x2b'),_0x420011])?_0x420011:undefined;})['compact']()[_0x11c0('0x64')]();if(!_['isEmpty'](_0x5d4a06)){_0x5d4a06['forEach'](function(_0x3dd3fe){if(_0x3dd3fe==='FaxAccountId'){_0x415ba4['where']('i.FaxAccountId\x20IN\x20?',[][_0x11c0('0x7b')](_0x3ca2b7[_0x11c0('0x3f')][_0x3dd3fe]));}else if(_0x3dd3fe===_0x11c0('0x7c')){var _0x262004=JSON[_0x11c0('0x7d')](_0x3ca2b7[_0x11c0('0x3f')][_0x3dd3fe])['$gte'];var _0x27d4a6=JSON['parse'](_0x3ca2b7[_0x11c0('0x3f')][_0x3dd3fe])[_0x11c0('0x7e')];_0x415ba4['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x262004,_0x27d4a6);}else{if(_0x3ca2b7[_0x11c0('0x3f')][_0x3dd3fe]===_0x11c0('0x7f')){_0x415ba4[_0x11c0('0x48')]('i.'+_0x3dd3fe+_0x11c0('0x80'));}else{_0x415ba4[_0x11c0('0x48')]('i.'+_0x3dd3fe+_0x11c0('0x81'),_0x3ca2b7[_0x11c0('0x3f')][_0x3dd3fe]);}}});}if(_0x3ca2b7['query'][_0x11c0('0x82')]){if(_0x3ca2b7[_0x11c0('0x3f')]['read']==0x1){_0x415ba4[_0x11c0('0x65')]('`unreadMessages`\x20=\x200');}else{_0x415ba4[_0x11c0('0x65')](_0x11c0('0x83'));}}if(_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x84')]){_0x48a8aa=_[_0x11c0('0x85')](_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x84')])?_0x3ca2b7['query'][_0x11c0('0x84')]:new Array(_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x84')]);_0x48a8aa['forEach'](function(_0x5bcd24){_0x2e9c17['or'](_0x11c0('0x73'),'%,'+_0x5bcd24+',%');});}if(_0x3ca2b7[_0x11c0('0x3f')]['filter']){var _0x5a9f36=_0x3ca2b7['query'][_0x11c0('0x86')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x11c0('0x87')](_0x5a9f36)){_0x5054a9['or'](_0x11c0('0x88'),_0x5a9f36+'%')['or'](_0x11c0('0x89'),_0x5a9f36+'%');}_0x5054a9['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5a9f36+'%');}}_0x415ba4['where'](_0x5054a9);_0x415ba4[_0x11c0('0x8a')](_0x11c0('0x8b'));var _0x4f8162={'type':db[_0x11c0('0x8c')][_0x11c0('0x8d')][_0x11c0('0x8e')],'raw':!![]};var _0x24db2e=_0x415ba4[_0x11c0('0x8f')]();_0x24db2e[_0x11c0('0x4b')](_0x11c0('0x8b'));_0x24db2e['field'](_0x11c0('0x90'),_0x11c0('0x63'));if(_0x3a6055[_0x11c0('0x91')]){_0x3a6055[_0x11c0('0x91')][_0x11c0('0x72')](function(_0x13e5be){var _0x18b140=_0x13e5be[0x0]==='contactName'?_0x13e5be[0x0]:'i.'+_0x13e5be[0x0];_0x415ba4[_0x11c0('0x91')](_0x18b140,_0x13e5be[0x1]==='DESC'?![]:!![]);});}if(!_[_0x11c0('0x92')](_0x48a8aa)){_0x415ba4[_0x11c0('0x65')](_0x2e9c17);_0x24db2e['where'](_0x11c0('0x93'),_0x48a8aa);}BPromise[_0x11c0('0x94')]()['then'](function(){if(!_0x5f38e4){if(_0x3ca2b7['query']['FaxAccountId'])return;_0x24db2e[_0x11c0('0x48')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x415ba4[_0x11c0('0x48')](_0x11c0('0x95'));return;}if(_0x3ca2b7[_0x11c0('0x96')]['role']!==_0x11c0('0x97'))return;return _0x3ca2b7['user'][_0x11c0('0x98')]({'attributes':['id'],'raw':!![]})[_0x11c0('0x26')](function(_0x65021a){if(_[_0x11c0('0x92')](_0x65021a)){_0x24db2e[_0x11c0('0x48')](_0x11c0('0x99'));_0x415ba4['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x24db2e['where'](_0x11c0('0x9a'),_['map'](_0x65021a,'id'));_0x415ba4[_0x11c0('0x48')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x65021a,'id'));}});})[_0x11c0('0x26')](function(){if(_0x3ca2b7[_0x11c0('0x96')][_0x11c0('0x9b')]===_0x11c0('0x97')&&!_0x5f38e4&&!_0x3ca2b7[_0x11c0('0x3f')][_0x11c0('0x9c')])return[];return db[_0x11c0('0x9d')]['query'](_0x24db2e[_0x11c0('0x9e')](),_0x4f8162);})[_0x11c0('0x26')](function(_0xf75141){_0x528346[_0x11c0('0x21')]=_0xf75141[_0x11c0('0x62')];if(_0x528346[_0x11c0('0x21')]===0x0)return[];return db[_0x11c0('0x9d')]['query'](_0x11f365['toString'](),_0x4f8162)[_0x11c0('0x26')](function(_0x164f7a){_0x2dad19=_[_0x11c0('0x9f')](_0x164f7a,'id');_0x4f8162=_[_0x11c0('0xa0')](_0x4f8162,{'model':db[_0x11c0('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ca2b7[_0x11c0('0x3f')]['fields']){_0x3a6055[_0x11c0('0x43')][_0x11c0('0x72')](function(_0x4c92b2){_0x415ba4['field']('i.'+_0x4c92b2);});}else{_0x415ba4[_0x11c0('0x4b')](_0x11c0('0x90'),_0x11c0('0x63'));_0x415ba4[_0x11c0('0x4b')](_0x11c0('0xa1'),_0x11c0('0xa2'));_0x415ba4[_0x11c0('0x4b')](_0x11c0('0xa3'),_0x11c0('0xa4'));_0x415ba4['field'](_0x11c0('0xa5'),_0x11c0('0xa6'));_0x415ba4['field']('i.*');_0x415ba4[_0x11c0('0x4b')](_0x11c0('0xa7'),_0x11c0('0xa8'));_0x415ba4['field']('c.lastName',_0x11c0('0xa9'));_0x415ba4['field']('c.email',_0x11c0('0xaa'));_0x415ba4[_0x11c0('0x4b')](_0x11c0('0xab'),_0x11c0('0xac'));_0x415ba4[_0x11c0('0x4b')](_0x11c0('0xad'),_0x11c0('0xae'));_0x415ba4['field'](_0x11c0('0xaf'),_0x11c0('0xb0'));_0x415ba4[_0x11c0('0x4b')](_0x11c0('0xb1'),_0x11c0('0xb2'));_0x415ba4['field'](_0x11c0('0xb3'),_0x11c0('0xb4'));_0x415ba4['field'](_0x11c0('0xb5'),'TagIds');}if(_0x3a6055['limit'])_0x415ba4[_0x11c0('0x1f')](_0x3a6055[_0x11c0('0x1f')]);if(_0x3a6055[_0x11c0('0x1e')])_0x415ba4[_0x11c0('0x1e')](_0x3a6055[_0x11c0('0x1e')]);return db['sequelize'][_0x11c0('0x3f')](_0x415ba4[_0x11c0('0x9e')](),_0x4f8162);})[_0x11c0('0x26')](function(_0x1a2f27){if(_0x1a2f27[_0x11c0('0x62')]>0x0)_0x12b6cf[_0x11c0('0x48')](_0x11c0('0xb6'),_['map'](_0x1a2f27,'id'));return db[_0x11c0('0x9d')][_0x11c0('0x3f')](_0x12b6cf['toString'](),_0x4f8162)[_0x11c0('0x26')](function(_0x5b62fc){var _0x5396b5=_[_0x11c0('0xb7')](_0x5b62fc,'FaxInteractionId');var _0x385c89=[];_0x1a2f27[_0x11c0('0x72')](function(_0x187650){_0x385c89['push'](updateFaxInteraction(_0x187650,_0x2dad19,_0x5396b5));});return BPromise[_0x11c0('0xb8')](_0x385c89);});});})[_0x11c0('0x26')](function(_0x55d254){_0x528346[_0x11c0('0xb9')]=_0x55d254;return _0x528346;})[_0x11c0('0x26')](respondWithFilteredResult(_0x3120ce,_0x3a6055))[_0x11c0('0x31')](handleError(_0x3120ce,null));};exports[_0x11c0('0xba')]=function(_0x3c332d,_0x519edd){var _0x1bfd46={'raw':![],'where':{'id':_0x3c332d[_0x11c0('0xbb')]['id']}},_0x5ee819={};_0x5ee819[_0x11c0('0x3e')]=_[_0x11c0('0x40')](db[_0x11c0('0x3a')][_0x11c0('0x3b')]);_0x5ee819['query']=_[_0x11c0('0x40')](_0x3c332d[_0x11c0('0x3f')]);_0x5ee819[_0x11c0('0x41')]=_[_0x11c0('0x42')](_0x5ee819[_0x11c0('0x3e')],_0x5ee819[_0x11c0('0x3f')]);_0x1bfd46[_0x11c0('0x43')]=_[_0x11c0('0x42')](_0x5ee819[_0x11c0('0x3e')],qs[_0x11c0('0x44')](_0x3c332d[_0x11c0('0x3f')]['fields']));_0x1bfd46['attributes']=_0x1bfd46[_0x11c0('0x43')][_0x11c0('0x62')]?_0x1bfd46['attributes']:_0x5ee819['model'];if(_0x3c332d['query']['includeAll']){_0x1bfd46[_0x11c0('0xbc')]=[{'all':!![]}];}_0x1bfd46=_['merge']({},_0x1bfd46,_0x3c332d[_0x11c0('0xbd')]);return db[_0x11c0('0x3a')][_0x11c0('0x78')](_0x1bfd46)[_0x11c0('0x26')](handleEntityNotFound(_0x519edd,null))[_0x11c0('0x26')](respondWithResult(_0x519edd,null))[_0x11c0('0x31')](handleError(_0x519edd,null));};exports[_0x11c0('0xbe')]=function(_0x3a7104,_0x1bafcc){return db['FaxInteraction'][_0x11c0('0xbe')](_0x3a7104[_0x11c0('0x79')],{})[_0x11c0('0x26')](respondWithResult(_0x1bafcc,0xc9))['catch'](handleError(_0x1bafcc,null));};exports[_0x11c0('0xbf')]=function(_0x18a288,_0x5c375c){if(_0x18a288['body']['id']){delete _0x18a288[_0x11c0('0x79')]['id'];}return db['FaxInteraction'][_0x11c0('0x78')]({'where':{'id':_0x18a288[_0x11c0('0xbb')]['id']}})[_0x11c0('0x26')](handleEntityNotFound(_0x5c375c,null))['then'](saveUpdates(_0x18a288[_0x11c0('0x79')],null))[_0x11c0('0x26')](respondWithResult(_0x5c375c,null))[_0x11c0('0x31')](handleError(_0x5c375c,null));};exports[_0x11c0('0x27')]=function(_0x2713b6,_0x3521ca){return db[_0x11c0('0x3a')][_0x11c0('0x78')]({'where':{'id':_0x2713b6[_0x11c0('0xbb')]['id']}})[_0x11c0('0x26')](handleEntityNotFound(_0x3521ca,null))[_0x11c0('0x26')](removeEntity(_0x3521ca,null))[_0x11c0('0x31')](handleError(_0x3521ca,null));};exports[_0x11c0('0xc0')]=function(_0x3b10a5,_0x10acef){return db[_0x11c0('0x3a')][_0x11c0('0xc0')]()[_0x11c0('0x26')](respondWithResult(_0x10acef,null))['catch'](handleError(_0x10acef,null));};exports[_0x11c0('0xc1')]=function(_0x584d8f,_0x4ea151,_0x5c131b){return db['FaxMessage']['find']({'where':{'id':_0x584d8f['params']['id']}})[_0x11c0('0x26')](handleEntityNotFound(_0x4ea151,null))[_0x11c0('0x26')](function(_0x2925ef){if(_0x2925ef){return _0x2925ef[_0x11c0('0xc1')](_0x584d8f[_0x11c0('0x79')][_0x11c0('0xc2')],_[_0x11c0('0xc3')](_0x584d8f[_0x11c0('0x79')],['ids','id'])||{});}})[_0x11c0('0x26')](respondWithResult(_0x4ea151,null))[_0x11c0('0x31')](handleError(_0x4ea151,null));};exports['getMessages']=function(_0x579961,_0x3a9163,_0x4d5f35){var _0x89b4cb={'raw':![],'where':{}};var _0x4f2a5f={};var _0x3ddd8c={'count':0x0,'rows':[]};return db[_0x11c0('0x3a')][_0x11c0('0xc4')]({'where':{'id':_0x579961[_0x11c0('0xbb')]['id']}})[_0x11c0('0x26')](handleEntityNotFound(_0x3a9163,null))[_0x11c0('0x26')](function(_0x162d47){if(_0x162d47){_0x4f2a5f[_0x11c0('0x3e')]=_[_0x11c0('0x40')](db[_0x11c0('0xc5')]['rawAttributes']);_0x4f2a5f[_0x11c0('0x3f')]=_['keys'](_0x579961[_0x11c0('0x3f')]);_0x4f2a5f[_0x11c0('0x41')]=_[_0x11c0('0x42')](_0x4f2a5f[_0x11c0('0x3e')],_0x4f2a5f['query']);_0x89b4cb[_0x11c0('0x43')]=_['intersection'](_0x4f2a5f[_0x11c0('0x3e')],qs[_0x11c0('0x44')](_0x579961[_0x11c0('0x3f')][_0x11c0('0x44')]));_0x89b4cb['attributes']=_0x89b4cb['attributes'][_0x11c0('0x62')]?_0x89b4cb['attributes']:_0x4f2a5f[_0x11c0('0x3e')];if(!_0x579961[_0x11c0('0x3f')][_0x11c0('0x45')](_0x11c0('0x46'))){_0x89b4cb[_0x11c0('0x1f')]=qs[_0x11c0('0x1f')](_0x579961[_0x11c0('0x3f')][_0x11c0('0x1f')]);_0x89b4cb[_0x11c0('0x1e')]=qs['offset'](_0x579961[_0x11c0('0x3f')]['offset']);}_0x89b4cb['order']=qs['sort'](_0x579961[_0x11c0('0x3f')][_0x11c0('0x47')]);_0x89b4cb['where']=qs[_0x11c0('0x41')](_[_0x11c0('0x49')](_0x579961[_0x11c0('0x3f')],_0x4f2a5f[_0x11c0('0x41')]));_0x89b4cb[_0x11c0('0x48')][_0x11c0('0xc6')]=_0x162d47['id'];if(_0x579961[_0x11c0('0x3f')][_0x11c0('0x86')]){_0x89b4cb[_0x11c0('0x48')]=_[_0x11c0('0xa0')](_0x89b4cb[_0x11c0('0x48')],{'$or':_[_0x11c0('0x39')](_0x89b4cb[_0x11c0('0x43')],function(_0x1fea2c){var _0x129eb1={};_0x129eb1[_0x1fea2c]={'$like':'%'+_0x579961[_0x11c0('0x3f')][_0x11c0('0x86')]+'%'};return _0x129eb1;})});}if(_0x579961['query'][_0x11c0('0xc7')]){var _0x413bac=_0x579961['query']['$gte'][_0x11c0('0x69')](',');var _0x3d5ffa={};_0x3d5ffa[_0x413bac[0x0]]={'$gte':moment(_0x413bac[0x1])[_0x11c0('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x89b4cb['where']=_[_0x11c0('0xa0')](_0x89b4cb[_0x11c0('0x48')],_0x3d5ffa);}_0x89b4cb=_[_0x11c0('0xa0')]({},_0x89b4cb,_0x579961[_0x11c0('0xbd')]);return db[_0x11c0('0xc5')][_0x11c0('0x21')]({'where':_0x89b4cb[_0x11c0('0x48')]})['then'](function(_0x1768bf){_0x3ddd8c[_0x11c0('0x21')]=_0x1768bf;if(_0x579961[_0x11c0('0x3f')][_0x11c0('0xc9')]){_0x89b4cb[_0x11c0('0xbc')]=[{'all':!![]}];}return db['FaxMessage'][_0x11c0('0xca')](_0x89b4cb);})[_0x11c0('0x26')](function(_0x12f4ec){_0x3ddd8c[_0x11c0('0xb9')]=_0x12f4ec;return _0x3ddd8c;});}})['then'](respondWithFilteredResult(_0x3a9163,_0x89b4cb))['catch'](handleError(_0x3a9163,null));};exports[_0x11c0('0xcb')]=function(_0x34b828,_0x1e2dc9,_0x520880){return db[_0x11c0('0x3a')][_0x11c0('0x78')]({'where':{'id':_0x34b828[_0x11c0('0xbb')]['id']}})[_0x11c0('0x26')](handleEntityNotFound(_0x1e2dc9,null))[_0x11c0('0x26')](function(_0x47282c){if(_0x47282c){return _0x47282c[_0x11c0('0xcc')](_0x34b828[_0x11c0('0x79')][_0x11c0('0xc2')],_[_0x11c0('0xc3')](_0x34b828[_0x11c0('0x79')],[_0x11c0('0xc2'),'id'])||{})[_0x11c0('0xcd')](function(){return db[_0x11c0('0x71')]['findAll']({'attributes':['id',_0x11c0('0x2b'),_0x11c0('0x4c')],'where':{'id':_0x34b828['body'][_0x11c0('0xc2')]}});})['then'](function(_0x13f9e5){socket[_0x11c0('0xce')](_0x11c0('0xcf'),{'id':Number(_0x34b828['params']['id']),'tags':_0x13f9e5||[]});return{'id':Number(_0x34b828[_0x11c0('0xbb')]['id']),'tags':_0x13f9e5||[]};});}})['then'](respondWithResult(_0x1e2dc9,null))[_0x11c0('0x31')](handleError(_0x1e2dc9,null));};exports[_0x11c0('0xd0')]=function(_0x4bd0bc,_0xd2eac1,_0xed1f4a){return db[_0x11c0('0x3a')]['find']({'where':{'id':_0x4bd0bc[_0x11c0('0xbb')]['id']}})['then'](handleEntityNotFound(_0xd2eac1,null))[_0x11c0('0x26')](function(_0xeae9f1){if(_0xeae9f1){return _0xeae9f1[_0x11c0('0xd0')](_0x4bd0bc[_0x11c0('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0xd2eac1,null))[_0x11c0('0x31')](handleError(_0xd2eac1,null));};exports['download']=function(_0x449aa7,_0x384038){var _0x28b6de=moment()[_0x11c0('0xd1')]()[_0x11c0('0x9e')]();var _0x56b790=path[_0x11c0('0xd2')](config[_0x11c0('0xd3')],_0x11c0('0xd4'),_0x11c0('0xd5'),'tmp');var _0xf599f4=path[_0x11c0('0xd2')](config['root'],_0x11c0('0xd4'),_0x11c0('0xd5'),_0x11c0('0xd6'));var _0x498e1f=path[_0x11c0('0xd2')](_0x56b790,_0x28b6de);var _0x58ed4b=util[_0x11c0('0xc8')](_0x11c0('0xd7'),_0x449aa7[_0x11c0('0xbb')]['id'],_0x28b6de);var _0x46eb61=path['join'](_0x56b790,_0x58ed4b);var _0x1f89ed=[];_0x1f89ed[_0x11c0('0x30')]({'model':db[_0x11c0('0xd8')],'as':_0x11c0('0xd8'),'raw':!![]});var _0xce7d69=[{'model':db[_0x11c0('0xc5')],'as':'Messages','attributes':['id',_0x11c0('0x79'),_0x11c0('0x7c')],'include':_0x1f89ed}];return db[_0x11c0('0x3a')]['find']({'where':{'id':_0x449aa7[_0x11c0('0xbb')]['id']},'include':_0xce7d69})[_0x11c0('0x26')](handleEntityNotFound(_0x384038,null))['then'](function(_0x59f73a){if(_0x59f73a&&_0x59f73a[_0x11c0('0xd9')]){var _0x408ccf=_0x59f73a['get']({'plain':!![]});fs[_0x11c0('0xda')](_0x498e1f);for(var _0x483c5a=0x0;_0x483c5a<_0x408ccf[_0x11c0('0xd9')][_0x11c0('0x62')];_0x483c5a++){var _0x1eae06=_0x408ccf[_0x11c0('0xd9')][_0x483c5a][_0x11c0('0xd8')];if(_0x1eae06){var _0x36e794=path['join'](_0xf599f4,_0x1eae06[_0x11c0('0xdb')]);if(fs['existsSync'](_0x36e794)){fs[_0x11c0('0xdc')](_0x36e794)[_0x11c0('0xdd')](fs[_0x11c0('0xde')](path[_0x11c0('0xd2')](_0x498e1f,_0x1eae06['basename'])));}}}return BPromise['resolve']()[_0x11c0('0x26')](function(){return new BPromise(function(_0x19356b,_0x2b8c46){zipdir(_0x498e1f,{'saveTo':_0x46eb61},function(_0x12c6e1,_0x558107){if(_0x12c6e1)return _0x2b8c46(_0x12c6e1);return _0x19356b(_0x558107);});})['then'](function(){return new BPromise(function(_0x513786,_0x1e2101){rimraf(_0x498e1f,function(_0x1e74a6){if(_0x1e74a6)_0x1e2101(_0x1e74a6);return _0x513786();});});})['then'](function(){return _0x384038[_0x11c0('0xdf')](_0x46eb61,_0x58ed4b,function(_0x49e285){if(_0x49e285){console[_0x11c0('0xe0')](_0x11c0('0xe1'),_0x49e285);}else{fs[_0x11c0('0xe2')](_0x46eb61);}});});});}else{return _0x384038[_0x11c0('0x28')](0xc8);}})[_0x11c0('0x31')](handleError(_0x384038,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 15e323d..fa59faa 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 _0x4132=['then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','setMaxListeners','update','remove'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x4132,0x1ea));var _0x2413=function(_0x3171b3,_0x14e2b1){_0x3171b3=_0x3171b3-0x0;var _0x4eac23=_0x4132[_0x3171b3];return _0x4eac23;};'use strict';var EventEmitter=require(_0x2413('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x2413('0x1')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2413('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2413('0x3'),'afterDestroy':_0x2413('0x4')};function emitEvent(_0x3a8d38){return function(_0x57facf,_0x5126cf,_0x15c5c6){_0x57facf['getUsers']({'attributes':['id'],'raw':!![]})[_0x2413('0x5')](function(_0x53e283){_0x57facf[_0x2413('0x6')](_0x2413('0x7'),_0x53e283[_0x2413('0x8')](function(_0x30ef54){return{'id':_0x30ef54['id']};}));return FaxMessage[_0x2413('0x9')]({'where':{'FaxInteractionId':_0x57facf['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4b5bc2){_0x57facf[_0x2413('0x6')]('unreadMessages',_0x4b5bc2['length']);FaxInteractionEvents[_0x2413('0xa')](_0x3a8d38+':'+_0x57facf['id'],_0x57facf);FaxInteractionEvents[_0x2413('0xa')](_0x3a8d38,_0x57facf);_0x15c5c6(null);})[_0x2413('0xb')](_0x15c5c6(null));};}for(var e in events){if(events[_0x2413('0xc')](e)){var event=events[e];FaxInteraction[_0x2413('0xd')](e,emitEvent(event));}}module[_0x2413('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x7eaa=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','update','getUsers'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x7eaa,0x15a));var _0xa7ea=function(_0x561b7f,_0x514c3e){_0x561b7f=_0x561b7f-0x0;var _0x2b8f74=_0x7eaa[_0x561b7f];return _0x2b8f74;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xa7ea('0x0'))['db'][_0xa7ea('0x1')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa7ea('0x2')](0x0);var events={'afterCreate':_0xa7ea('0x3'),'afterUpdate':_0xa7ea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45d6cf){return function(_0x200c61,_0x48ff23,_0x287d91){_0x200c61[_0xa7ea('0x5')]({'attributes':['id'],'raw':!![]})[_0xa7ea('0x6')](function(_0x3f4bd0){_0x200c61[_0xa7ea('0x7')](_0xa7ea('0x8'),_0x3f4bd0[_0xa7ea('0x9')](function(_0x41cc7b){return{'id':_0x41cc7b['id']};}));return FaxMessage[_0xa7ea('0xa')]({'where':{'FaxInteractionId':_0x200c61['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa7ea('0x6')](function(_0x577aeb){_0x200c61[_0xa7ea('0x7')](_0xa7ea('0xb'),_0x577aeb[_0xa7ea('0xc')]);FaxInteractionEvents[_0xa7ea('0xd')](_0x45d6cf+':'+_0x200c61['id'],_0x200c61);FaxInteractionEvents[_0xa7ea('0xd')](_0x45d6cf,_0x200c61);_0x287d91(null);})['catch'](_0x287d91(null));};}for(var e in events){if(events[_0xa7ea('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xa7ea('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 fe8b318..56a7ae7 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 _0xe798=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions'];(function(_0x8127a9,_0x367e21){var _0x4c5885=function(_0x5030b8){while(--_0x5030b8){_0x8127a9['push'](_0x8127a9['shift']());}};_0x4c5885(++_0x367e21);}(_0xe798,0xe4));var _0x8e79=function(_0x48c518,_0x44acec){_0x48c518=_0x48c518-0x0;var _0x37a9e9=_0xe798[_0x48c518];return _0x37a9e9;};'use strict';var _=require(_0x8e79('0x0'));var util=require(_0x8e79('0x1'));var logger=require(_0x8e79('0x2'))('api');var moment=require(_0x8e79('0x3'));var BPromise=require(_0x8e79('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e79('0x5'));var rimraf=require(_0x8e79('0x6'));var config=require(_0x8e79('0x7'));var attributes=require(_0x8e79('0x8'));module['exports']=function(_0x3f876e,_0x5a7a26){return _0x3f876e[_0x8e79('0x9')](_0x8e79('0xa'),attributes,{'tableName':_0x8e79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8fee14,_0x53bce4,_0x524c10){if(_0x8fee14[_0x8e79('0xc')](_0x8e79('0xd'))){_0x8fee14['closedAt']=moment()[_0x8e79('0xe')](_0x8e79('0xf'));}_0x524c10(null,_0x8fee14);}}});}; \ No newline at end of file +var _0x7acb=['../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3ed4c5,_0x3854f6){var _0xf8b90=function(_0x9acd93){while(--_0x9acd93){_0x3ed4c5['push'](_0x3ed4c5['shift']());}};_0xf8b90(++_0x3854f6);}(_0x7acb,0xbf));var _0xb7ac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7acb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb7ac('0x0'));var util=require('util');var logger=require(_0xb7ac('0x1'))(_0xb7ac('0x2'));var moment=require('moment');var BPromise=require(_0xb7ac('0x3'));var rp=require(_0xb7ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7ac('0x5'));var attributes=require(_0xb7ac('0x6'));module['exports']=function(_0x4d5e31,_0xe305a5){return _0x4d5e31[_0xb7ac('0x7')](_0xb7ac('0x8'),attributes,{'tableName':_0xb7ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x327fd6,_0x43b289,_0x12e27e){if(_0x327fd6[_0xb7ac('0xa')](_0xb7ac('0xb'))){_0x327fd6[_0xb7ac('0xc')]=moment()['format'](_0xb7ac('0xd'));}_0x12e27e(null,_0x327fd6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a58c89f..0a0b971 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 _0xa2e4=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','limit','find','omit','ids','lodash'];(function(_0x307293,_0xeb40f7){var _0x2dbc11=function(_0x2ff654){while(--_0x2ff654){_0x307293['push'](_0x307293['shift']());}};_0x2dbc11(++_0xeb40f7);}(_0xa2e4,0x1e9));var _0x4a2e=function(_0x468eba,_0x172609){_0x468eba=_0x468eba-0x0;var _0x5d27d1=_0xa2e4[_0x468eba];return _0x5d27d1;};'use strict';var _=require(_0x4a2e('0x0'));var util=require(_0x4a2e('0x1'));var moment=require(_0x4a2e('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a2e('0x3'));var fs=require('fs');var Redis=require(_0x4a2e('0x4'));var db=require(_0x4a2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a2e('0x6'))(_0x4a2e('0x7'));var config=require(_0x4a2e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4a2e('0x9')]['http']({'port':0x232a});config[_0x4a2e('0xa')]=_[_0x4a2e('0xb')](config[_0x4a2e('0xa')],{'host':_0x4a2e('0xc'),'port':0x18eb});var socket=require(_0x4a2e('0xd'))(new Redis(config[_0x4a2e('0xa')]));require(_0x4a2e('0xe'))[_0x4a2e('0xf')](socket);function respondWithRpcPromise(_0x24aa25,_0x30e3f6,_0x2d781e){return new BPromise(function(_0x13b623,_0x34f0c7){return client['request'](_0x24aa25,_0x2d781e)[_0x4a2e('0x10')](function(_0x8df8cf){logger[_0x4a2e('0x11')](_0x4a2e('0x12'),_0x30e3f6,_0x4a2e('0x13'));logger[_0x4a2e('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x30e3f6,_0x4a2e('0x13'),JSON[_0x4a2e('0x15')](_0x8df8cf));if(_0x8df8cf['error']){if(_0x8df8cf[_0x4a2e('0x16')]['code']===0x1f4){logger['error'](_0x4a2e('0x12'),_0x30e3f6,_0x8df8cf['error'][_0x4a2e('0x17')]);return _0x34f0c7(_0x8df8cf[_0x4a2e('0x16')][_0x4a2e('0x17')]);}logger[_0x4a2e('0x16')](_0x4a2e('0x12'),_0x30e3f6,_0x8df8cf['error'][_0x4a2e('0x17')]);return _0x13b623(_0x8df8cf[_0x4a2e('0x16')][_0x4a2e('0x17')]);}else{logger[_0x4a2e('0x11')](_0x4a2e('0x12'),_0x30e3f6,_0x4a2e('0x13'));_0x13b623(_0x8df8cf['result'][_0x4a2e('0x17')]);}})[_0x4a2e('0x18')](function(_0x55db15){logger[_0x4a2e('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x30e3f6,_0x55db15);_0x34f0c7(_0x55db15);});});}exports[_0x4a2e('0x19')]=function(_0x2f22c4){var _0x4e9e72=this;return new Promise(function(_0x135b49,_0x4f3915){return db[_0x4a2e('0x1a')]['update'](_0x2f22c4[_0x4a2e('0x1b')],{'raw':_0x2f22c4[_0x4a2e('0x1c')]?_0x2f22c4[_0x4a2e('0x1c')][_0x4a2e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f22c4['options']?_0x2f22c4[_0x4a2e('0x1c')][_0x4a2e('0x1e')]||null:null,'attributes':_0x2f22c4[_0x4a2e('0x1c')]?_0x2f22c4[_0x4a2e('0x1c')]['attributes']||null:null,'limit':_0x2f22c4[_0x4a2e('0x1c')]?_0x2f22c4[_0x4a2e('0x1c')][_0x4a2e('0x1f')]||null:null})[_0x4a2e('0x10')](function(_0x2e05e2){logger[_0x4a2e('0x11')](_0x4a2e('0x19'),_0x2f22c4);logger['debug'](_0x4a2e('0x19'),_0x2f22c4,JSON[_0x4a2e('0x15')](_0x2e05e2));_0x135b49(_0x2e05e2);})[_0x4a2e('0x18')](function(_0x25fea5){logger[_0x4a2e('0x16')](_0x4a2e('0x19'),_0x25fea5['message'],_0x2f22c4);_0x4f3915(_0x4e9e72[_0x4a2e('0x16')](0x1f4,_0x25fea5[_0x4a2e('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x35c4f1){return new Promise(function(_0x138bde,_0x3adb53){return db[_0x4a2e('0x1a')][_0x4a2e('0x20')]({'where':_0x35c4f1[_0x4a2e('0x1c')]?_0x35c4f1[_0x4a2e('0x1c')][_0x4a2e('0x1e')]||null:null})[_0x4a2e('0x10')](function(_0x5378be){if(_0x5378be){return _0x5378be['addTags'](_0x35c4f1[_0x4a2e('0x1b')]['ids'],_[_0x4a2e('0x21')](_0x35c4f1[_0x4a2e('0x1b')],[_0x4a2e('0x22'),'id'])||{});}})['spread'](function(_0x2e66b1){logger[_0x4a2e('0x11')]('AddTags',_0x35c4f1);logger['debug']('AddTags',_0x35c4f1,JSON[_0x4a2e('0x15')](_0x2e66b1));_0x138bde(_0x2e66b1);})['catch'](function(_0x131df5){logger[_0x4a2e('0x16')]('AddTags',_0x131df5[_0x4a2e('0x17')],_0x35c4f1);_0x3adb53(_this[_0x4a2e('0x16')](0x1f4,_0x131df5[_0x4a2e('0x17')]));});});}; \ No newline at end of file +var _0xcfb8=['register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','find','addTags','ids','spread','AddTags','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket'];(function(_0x141852,_0x45d034){var _0x3c3f28=function(_0x48b97c){while(--_0x48b97c){_0x141852['push'](_0x141852['shift']());}};_0x3c3f28(++_0x45d034);}(_0xcfb8,0x151));var _0x8cfb=function(_0x2a63f2,_0x268df9){_0x2a63f2=_0x2a63f2-0x0;var _0x113ada=_0xcfb8[_0x2a63f2];return _0x113ada;};'use strict';var _=require('lodash');var util=require(_0x8cfb('0x0'));var moment=require('moment');var BPromise=require(_0x8cfb('0x1'));var rs=require(_0x8cfb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8cfb('0x3'));var logger=require(_0x8cfb('0x4'))(_0x8cfb('0x5'));var config=require(_0x8cfb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8cfb('0x7')][_0x8cfb('0x8')]({'port':0x232a});config['redis']=_[_0x8cfb('0x9')](config['redis'],{'host':_0x8cfb('0xa'),'port':0x18eb});var socket=require(_0x8cfb('0xb'))(new Redis(config[_0x8cfb('0xc')]));require(_0x8cfb('0xd'))[_0x8cfb('0xe')](socket);function respondWithRpcPromise(_0x3427e0,_0x354e1f,_0x1f711d){return new BPromise(function(_0x1f6e42,_0x2b896c){return client[_0x8cfb('0xf')](_0x3427e0,_0x1f711d)[_0x8cfb('0x10')](function(_0x4e55fd){logger[_0x8cfb('0x11')](_0x8cfb('0x12'),_0x354e1f,'request\x20sent');logger[_0x8cfb('0x13')](_0x8cfb('0x14'),_0x354e1f,'request\x20sent',JSON[_0x8cfb('0x15')](_0x4e55fd));if(_0x4e55fd['error']){if(_0x4e55fd[_0x8cfb('0x16')][_0x8cfb('0x17')]===0x1f4){logger['error'](_0x8cfb('0x12'),_0x354e1f,_0x4e55fd[_0x8cfb('0x16')][_0x8cfb('0x18')]);return _0x2b896c(_0x4e55fd[_0x8cfb('0x16')][_0x8cfb('0x18')]);}logger[_0x8cfb('0x16')](_0x8cfb('0x12'),_0x354e1f,_0x4e55fd['error'][_0x8cfb('0x18')]);return _0x1f6e42(_0x4e55fd[_0x8cfb('0x16')][_0x8cfb('0x18')]);}else{logger[_0x8cfb('0x11')](_0x8cfb('0x12'),_0x354e1f,'request\x20sent');_0x1f6e42(_0x4e55fd['result'][_0x8cfb('0x18')]);}})[_0x8cfb('0x19')](function(_0x81fe59){logger[_0x8cfb('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x354e1f,_0x81fe59);_0x2b896c(_0x81fe59);});});}exports[_0x8cfb('0x1a')]=function(_0x18da78){var _0xfa5dd1=this;return new Promise(function(_0x3e69f3,_0x543ba0){return db[_0x8cfb('0x1b')]['update'](_0x18da78[_0x8cfb('0x1c')],{'raw':_0x18da78[_0x8cfb('0x1d')]?_0x18da78['options'][_0x8cfb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18da78[_0x8cfb('0x1d')]?_0x18da78['options'][_0x8cfb('0x1f')]||null:null,'attributes':_0x18da78['options']?_0x18da78[_0x8cfb('0x1d')][_0x8cfb('0x20')]||null:null,'limit':_0x18da78[_0x8cfb('0x1d')]?_0x18da78[_0x8cfb('0x1d')][_0x8cfb('0x21')]||null:null})[_0x8cfb('0x10')](function(_0x570445){logger['info']('UpdateFaxInteraction',_0x18da78);logger[_0x8cfb('0x13')](_0x8cfb('0x1a'),_0x18da78,JSON['stringify'](_0x570445));_0x3e69f3(_0x570445);})[_0x8cfb('0x19')](function(_0x11ee62){logger[_0x8cfb('0x16')](_0x8cfb('0x1a'),_0x11ee62[_0x8cfb('0x18')],_0x18da78);_0x543ba0(_0xfa5dd1[_0x8cfb('0x16')](0x1f4,_0x11ee62['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x53584c){return new Promise(function(_0x20e0a9,_0x14a8ba){return db['FaxInteraction'][_0x8cfb('0x22')]({'where':_0x53584c[_0x8cfb('0x1d')]?_0x53584c['options'][_0x8cfb('0x1f')]||null:null})[_0x8cfb('0x10')](function(_0x10dae7){if(_0x10dae7){return _0x10dae7[_0x8cfb('0x23')](_0x53584c[_0x8cfb('0x1c')][_0x8cfb('0x24')],_['omit'](_0x53584c[_0x8cfb('0x1c')],[_0x8cfb('0x24'),'id'])||{});}})[_0x8cfb('0x25')](function(_0x53b2a8){logger['info'](_0x8cfb('0x26'),_0x53584c);logger[_0x8cfb('0x13')](_0x8cfb('0x26'),_0x53584c,JSON['stringify'](_0x53b2a8));_0x20e0a9(_0x53b2a8);})[_0x8cfb('0x19')](function(_0x4538a7){logger[_0x8cfb('0x16')](_0x8cfb('0x26'),_0x4538a7[_0x8cfb('0x18')],_0x53584c);_0x14a8ba(_this['error'](0x1f4,_0x4538a7[_0x8cfb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d6bbacc..bd19a7f 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 _0xd5ea=['update','emit','removeListener','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x4a2447,_0x5d1532){var _0xd57047=function(_0x55899b){while(--_0x55899b){_0x4a2447['push'](_0x4a2447['shift']());}};_0xd57047(++_0x5d1532);}(_0xd5ea,0x75));var _0xad5e=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd5ea[_0x2be8c2];return _0x97f531;};'use strict';var FaxInteractionEvents=require(_0xad5e('0x0'));var events=[_0xad5e('0x1'),_0xad5e('0x2'),_0xad5e('0x3')];function createListener(_0x312075,_0x15806c){return function(_0x2ff3eb){_0x15806c[_0xad5e('0x4')](_0x312075,_0x2ff3eb);};}function removeListener(_0x3d7082,_0x2328b0){return function(){FaxInteractionEvents[_0xad5e('0x5')](_0x3d7082,_0x2328b0);};}exports['register']=function(_0x2597d4){for(var _0x263802=0x0,_0x4ecec9=events[_0xad5e('0x6')];_0x263802<_0x4ecec9;_0x263802++){var _0x5508b6=events[_0x263802];var _0x59b3e3=createListener(_0xad5e('0x7')+_0x5508b6,_0x2597d4);FaxInteractionEvents['on'](_0x5508b6,_0x59b3e3);}}; \ No newline at end of file +var _0x60d6=['./faxInteraction.events','remove','update','removeListener','length','faxInteraction:'];(function(_0x360a0f,_0x5e9645){var _0x514be8=function(_0x40fefe){while(--_0x40fefe){_0x360a0f['push'](_0x360a0f['shift']());}};_0x514be8(++_0x5e9645);}(_0x60d6,0x1c2));var _0x660d=function(_0x49e33d,_0xfb7847){_0x49e33d=_0x49e33d-0x0;var _0x199e76=_0x60d6[_0x49e33d];return _0x199e76;};'use strict';var FaxInteractionEvents=require(_0x660d('0x0'));var events=['save',_0x660d('0x1'),_0x660d('0x2')];function createListener(_0xa144e7,_0x2b8a49){return function(_0xf7c1f7){_0x2b8a49['emit'](_0xa144e7,_0xf7c1f7);};}function removeListener(_0x222148,_0x12089d){return function(){FaxInteractionEvents[_0x660d('0x3')](_0x222148,_0x12089d);};}exports['register']=function(_0x2b1986){for(var _0x32164f=0x0,_0x236fe0=events[_0x660d('0x4')];_0x32164f<_0x236fe0;_0x32164f++){var _0x1f37d1=events[_0x32164f];var _0x24f505=createListener(_0x660d('0x5')+_0x1f37d1,_0x2b1986);FaxInteractionEvents['on'](_0x1f37d1,_0x24f505);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 57cd627..94c2724 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 _0xfd4e=['addTags','put','faxinteraction:update','update','faxinteraction:destroy','delete','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags'];(function(_0x4423ed,_0x190510){var _0x51bbcf=function(_0x869956){while(--_0x869956){_0x4423ed['push'](_0x4423ed['shift']());}};_0x51bbcf(++_0x190510);}(_0xfd4e,0x100));var _0xefd4=function(_0x2b28c2,_0x5e9075){_0x2b28c2=_0x2b28c2-0x0;var _0x22db7c=_0xfd4e[_0x2b28c2];return _0x22db7c;};'use strict';var multer=require(_0xefd4('0x0'));var util=require('util');var path=require(_0xefd4('0x1'));var timeout=require(_0xefd4('0x2'));var express=require('express');var router=express[_0xefd4('0x3')]();var fs_extra=require(_0xefd4('0x4'));var auth=require(_0xefd4('0x5'));var interaction=require(_0xefd4('0x6'));var config=require(_0xefd4('0x7'));var controller=require('./faxInteraction.controller');router[_0xefd4('0x8')]('/',auth[_0xefd4('0x9')](),controller['index']);router[_0xefd4('0x8')]('/describe',auth[_0xefd4('0x9')](),controller[_0xefd4('0xa')]);router[_0xefd4('0x8')](_0xefd4('0xb'),auth[_0xefd4('0x9')](),controller[_0xefd4('0xc')]);router[_0xefd4('0x8')](_0xefd4('0xd'),auth[_0xefd4('0x9')](),controller['getMessages']);router[_0xefd4('0x8')](_0xefd4('0xe'),auth[_0xefd4('0x9')](),controller[_0xefd4('0xf')]);router[_0xefd4('0x10')]('/',auth[_0xefd4('0x9')](),controller[_0xefd4('0x11')]);router[_0xefd4('0x10')]('/:id/messages',auth[_0xefd4('0x9')](),controller[_0xefd4('0x12')]);router[_0xefd4('0x10')](_0xefd4('0x13'),auth[_0xefd4('0x9')](),interaction[_0xefd4('0x14')](_0xefd4('0x15'),_0xefd4('0x16')),controller[_0xefd4('0x17')]);router[_0xefd4('0x18')](_0xefd4('0xb'),auth[_0xefd4('0x9')](),interaction['tracked']('fax',_0xefd4('0x19')),controller[_0xefd4('0x1a')]);router['delete']('/:id',auth[_0xefd4('0x9')](),interaction[_0xefd4('0x14')](_0xefd4('0x15'),_0xefd4('0x1b')),controller['destroy']);router[_0xefd4('0x1c')](_0xefd4('0x13'),auth[_0xefd4('0x9')](),controller[_0xefd4('0x1d')]);module[_0xefd4('0x1e')]=router; \ No newline at end of file +var _0x921f=['update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x921f,0x186));var _0xf921=function(_0x2c8ca1,_0x150473){_0x2c8ca1=_0x2c8ca1-0x0;var _0x1b0f68=_0x921f[_0x2c8ca1];return _0x1b0f68;};'use strict';var multer=require('multer');var util=require(_0xf921('0x0'));var path=require(_0xf921('0x1'));var timeout=require('connect-timeout');var express=require(_0xf921('0x2'));var router=express[_0xf921('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf921('0x4'));var interaction=require(_0xf921('0x5'));var config=require(_0xf921('0x6'));var controller=require(_0xf921('0x7'));router['get']('/',auth[_0xf921('0x8')](),controller['index']);router[_0xf921('0x9')](_0xf921('0xa'),auth[_0xf921('0x8')](),controller[_0xf921('0xb')]);router[_0xf921('0x9')](_0xf921('0xc'),auth['isAuthenticated'](),controller[_0xf921('0xd')]);router[_0xf921('0x9')](_0xf921('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0xf921('0x9')](_0xf921('0xf'),auth[_0xf921('0x8')](),controller[_0xf921('0x10')]);router[_0xf921('0x11')]('/',auth['isAuthenticated'](),controller[_0xf921('0x12')]);router[_0xf921('0x11')](_0xf921('0xe'),auth[_0xf921('0x8')](),controller['addMessage']);router[_0xf921('0x11')](_0xf921('0x13'),auth[_0xf921('0x8')](),interaction[_0xf921('0x14')](_0xf921('0x15'),_0xf921('0x16')),controller[_0xf921('0x17')]);router[_0xf921('0x18')](_0xf921('0xc'),auth['isAuthenticated'](),interaction[_0xf921('0x14')](_0xf921('0x15'),_0xf921('0x19')),controller[_0xf921('0x1a')]);router[_0xf921('0x1b')](_0xf921('0xc'),auth[_0xf921('0x8')](),interaction[_0xf921('0x14')](_0xf921('0x15'),_0xf921('0x1c')),controller[_0xf921('0x1d')]);router[_0xf921('0x1b')]('/:id/tags',auth[_0xf921('0x8')](),controller[_0xf921('0x1e')]);module[_0xf921('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 893adfd..e9d9e38 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 _0x5044=['ENUM','out','TEXT','DATE','exports','medium','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5044,0xc8));var _0x4504=function(_0xb14b26,_0x38cf9f){_0xb14b26=_0xb14b26-0x0;var _0xfdb28a=_0x5044[_0xb14b26];return _0xfdb28a;};'use strict';var Sequelize=require('sequelize');module[_0x4504('0x0')]={'body':{'type':Sequelize['TEXT'](_0x4504('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4504('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4504('0x3')]('in',_0x4504('0x4')),'defaultValue':_0x4504('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4504('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x4504('0x6')]}}; \ No newline at end of file +var _0x49e9=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0xed9fea,_0x5ed774){var _0x198f12=function(_0xfb85f6){while(--_0xfb85f6){_0xed9fea['push'](_0xed9fea['shift']());}};_0x198f12(++_0x5ed774);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x949e('0x0'));module[_0x949e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x949e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x949e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x949e('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x949e('0x5')],'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 8df2160..e090c47 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 _0x1338=['FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','Sequelize','SELECT','rejectmessage','create','findOne','AttachmentId','SendFax','FaxAccountId','/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','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','client','http','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','findAll','rows','params','body','find','describe','../../config/logger','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get'];(function(_0x4c5a90,_0x39edaf){var _0x8e83e8=function(_0xce4f7e){while(--_0xce4f7e){_0x4c5a90['push'](_0x4c5a90['shift']());}};_0x8e83e8(++_0x39edaf);}(_0x1338,0x1ec));var _0x8133=function(_0x2ebf64,_0x28d567){_0x2ebf64=_0x2ebf64-0x0;var _0x4b3e84=_0x1338[_0x2ebf64];return _0x4b3e84;};'use strict';var emlformat=require(_0x8133('0x0'));var rimraf=require(_0x8133('0x1'));var zipdir=require(_0x8133('0x2'));var jsonpatch=require(_0x8133('0x3'));var rp=require(_0x8133('0x4'));var moment=require(_0x8133('0x5'));var BPromise=require(_0x8133('0x6'));var Mustache=require(_0x8133('0x7'));var util=require(_0x8133('0x8'));var path=require(_0x8133('0x9'));var sox=require(_0x8133('0xa'));var csv=require('to-csv');var ejs=require(_0x8133('0xb'));var fs=require('fs');var fs_extra=require(_0x8133('0xc'));var _=require(_0x8133('0xd'));var squel=require(_0x8133('0xe'));var crypto=require(_0x8133('0xf'));var jsforce=require(_0x8133('0x10'));var deskjs=require(_0x8133('0x11'));var toCsv=require(_0x8133('0x12'));var querystring=require(_0x8133('0x13'));var Papa=require(_0x8133('0x14'));var Redis=require(_0x8133('0x15'));var authService=require(_0x8133('0x16'));var qs=require(_0x8133('0x17'));var as=require(_0x8133('0x18'));var hardwareService=require(_0x8133('0x19'));var logger=require('../../config/logger')(_0x8133('0x1a'));var utils=require(_0x8133('0x1b'));var config=require(_0x8133('0x1c'));var licenseUtil=require(_0x8133('0x1d'));var db=require(_0x8133('0x1e'))['db'];config['redis']=_[_0x8133('0x1f')](config[_0x8133('0x20')],{'host':'localhost','port':0x18eb});var socket=require(_0x8133('0x21'))(new Redis(config[_0x8133('0x20')]));require('./faxMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8133('0x22')][_0x8133('0x23')]({'port':0x232c});var client9002=jayson[_0x8133('0x22')][_0x8133('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x292dbb,_0x5eb566,_0x23d4f1,_0x5c0eee){return new BPromise(function(_0x28b5c2,_0xe648a5){var _0x9f851e=_0x5c0eee||client;return _0x9f851e[_0x8133('0x24')](_0x292dbb,_0x23d4f1)[_0x8133('0x25')](function(_0x327508){logger[_0x8133('0x26')]('FaxMessage,\x20%s,\x20%s',_0x5eb566,_0x8133('0x27'));logger['debug'](_0x8133('0x28'),_0x5eb566,_0x8133('0x27'),JSON['stringify'](_0x327508));if(_0x327508[_0x8133('0x29')]){if(_0x327508[_0x8133('0x29')]['code']===0x1f4){logger[_0x8133('0x29')]('FaxMessage,\x20%s,\x20%s',_0x5eb566,_0x327508[_0x8133('0x29')][_0x8133('0x2a')]);return _0xe648a5(_0x327508[_0x8133('0x29')][_0x8133('0x2a')]);}logger[_0x8133('0x29')](_0x8133('0x2b'),_0x5eb566,_0x327508['error'][_0x8133('0x2a')]);return _0x28b5c2(_0x327508['error']['message']);}else{logger['info'](_0x8133('0x2b'),_0x5eb566,_0x8133('0x27'));_0x28b5c2(_0x327508[_0x8133('0x2c')][_0x8133('0x2a')]);}})[_0x8133('0x2d')](function(_0x1d97eb){logger[_0x8133('0x29')](_0x8133('0x2b'),_0x5eb566,_0x1d97eb);_0xe648a5(_0x1d97eb);});});}function respondWithStatusCode(_0x1df436,_0x2b5e2f){_0x2b5e2f=_0x2b5e2f||0xcc;return function(_0x26b0b9){if(_0x26b0b9){return _0x1df436[_0x8133('0x2e')](_0x2b5e2f);}return _0x1df436[_0x8133('0x2f')](_0x2b5e2f)[_0x8133('0x30')]();};}function respondWithResult(_0x435b12,_0x17dd88){_0x17dd88=_0x17dd88||0xc8;return function(_0x38da13){if(_0x38da13){return _0x435b12[_0x8133('0x2f')](_0x17dd88)[_0x8133('0x31')](_0x38da13);}};}function respondWithFilteredResult(_0x50d555,_0x32955d){return function(_0x4df208){if(_0x4df208){var _0x5db2ce=typeof _0x32955d[_0x8133('0x32')]===_0x8133('0x33')&&typeof _0x32955d[_0x8133('0x34')]===_0x8133('0x33');var _0x532a20=_0x4df208[_0x8133('0x35')];var _0x47b937=_0x5db2ce?0x0:_0x32955d[_0x8133('0x32')];var _0x276b55=_0x5db2ce?_0x4df208[_0x8133('0x35')]:_0x32955d[_0x8133('0x32')]+_0x32955d['limit'];var _0xf21589;if(_0x276b55>=_0x532a20){_0x276b55=_0x532a20;_0xf21589=0xc8;}else{_0xf21589=0xce;}_0x50d555[_0x8133('0x2f')](_0xf21589);return _0x50d555[_0x8133('0x36')](_0x8133('0x37'),_0x47b937+'-'+_0x276b55+'/'+_0x532a20)['json'](_0x4df208);}return null;};}function patchUpdates(_0x290109){return function(_0x336f0a){try{jsonpatch['apply'](_0x336f0a,_0x290109,!![]);}catch(_0x251303){return BPromise[_0x8133('0x38')](_0x251303);}return _0x336f0a['save']();};}function saveUpdates(_0x270d04,_0x43d2a4){return function(_0x111cd7){if(_0x111cd7){return _0x111cd7[_0x8133('0x39')](_0x270d04)[_0x8133('0x25')](function(_0x24e19b){return _0x24e19b;});}return null;};}function removeEntity(_0x465ae2,_0x1f615f){return function(_0x5b6306){if(_0x5b6306){return _0x5b6306[_0x8133('0x3a')]()['then'](function(){_0x465ae2['status'](0xcc)[_0x8133('0x30')]();});}};}function handleEntityNotFound(_0x175448,_0x511077){return function(_0x294baf){if(!_0x294baf){_0x175448[_0x8133('0x2e')](0x194);}return _0x294baf;};}function handleError(_0x1eb2f0,_0x490753){_0x490753=_0x490753||0x1f4;return function(_0x5505cf){logger['error'](_0x5505cf['stack']);if(_0x5505cf[_0x8133('0x3b')]){delete _0x5505cf[_0x8133('0x3b')];}_0x1eb2f0['status'](_0x490753)[_0x8133('0x3c')](_0x5505cf);};}exports[_0x8133('0x3d')]=function(_0x5ef01f,_0x5a509c){var _0x106202={},_0x365763={},_0x2016de={'count':0x0,'rows':[]};var _0x3e87b8=_[_0x8133('0x3e')](db['FaxMessage'][_0x8133('0x3f')],function(_0x505e29){return{'name':_0x505e29[_0x8133('0x40')],'type':_0x505e29[_0x8133('0x41')][_0x8133('0x42')]};});_0x365763[_0x8133('0x43')]=_['map'](_0x3e87b8,'name');_0x365763[_0x8133('0x44')]=_[_0x8133('0x45')](_0x5ef01f[_0x8133('0x44')]);_0x365763[_0x8133('0x46')]=_['intersection'](_0x365763[_0x8133('0x43')],_0x365763[_0x8133('0x44')]);_0x106202['attributes']=_[_0x8133('0x47')](_0x365763['model'],qs[_0x8133('0x48')](_0x5ef01f[_0x8133('0x44')]['fields']));_0x106202['attributes']=_0x106202[_0x8133('0x49')][_0x8133('0x4a')]?_0x106202[_0x8133('0x49')]:_0x365763['model'];if(!_0x5ef01f[_0x8133('0x44')][_0x8133('0x4b')](_0x8133('0x4c'))){_0x106202['limit']=qs['limit'](_0x5ef01f['query']['limit']);_0x106202[_0x8133('0x32')]=qs['offset'](_0x5ef01f[_0x8133('0x44')][_0x8133('0x32')]);}_0x106202[_0x8133('0x4d')]=qs[_0x8133('0x4e')](_0x5ef01f[_0x8133('0x44')][_0x8133('0x4e')]);_0x106202[_0x8133('0x4f')]=qs[_0x8133('0x46')](_['pick'](_0x5ef01f[_0x8133('0x44')],_0x365763[_0x8133('0x46')]),_0x3e87b8);if(_0x5ef01f[_0x8133('0x44')][_0x8133('0x50')]){_0x106202[_0x8133('0x4f')]=_[_0x8133('0x51')](_0x106202['where'],{'$or':_[_0x8133('0x3e')](_0x3e87b8,function(_0x3e86dd){if(_0x3e86dd[_0x8133('0x41')]!==_0x8133('0x52')){var _0x36a673={};_0x36a673[_0x3e86dd[_0x8133('0x3b')]]={'$like':'%'+_0x5ef01f['query'][_0x8133('0x50')]+'%'};return _0x36a673;}})});}_0x106202=_[_0x8133('0x51')]({},_0x106202,_0x5ef01f[_0x8133('0x53')]);var _0x3fdcc9={'where':_0x106202[_0x8133('0x4f')]};return db[_0x8133('0x54')][_0x8133('0x35')](_0x3fdcc9)[_0x8133('0x25')](function(_0x4ab492){_0x2016de[_0x8133('0x35')]=_0x4ab492;if(_0x5ef01f[_0x8133('0x44')][_0x8133('0x55')]){_0x106202[_0x8133('0x56')]=[{'all':!![]}];}return db[_0x8133('0x54')][_0x8133('0x57')](_0x106202);})['then'](function(_0x3f092d){_0x2016de[_0x8133('0x58')]=_0x3f092d;return _0x2016de;})[_0x8133('0x25')](respondWithFilteredResult(_0x5a509c,_0x106202))[_0x8133('0x2d')](handleError(_0x5a509c,null));};exports['show']=function(_0x6b26f3,_0x412f3a){var _0x1d96a2={'raw':!![],'where':{'id':_0x6b26f3[_0x8133('0x59')]['id']}},_0x40ac23={};_0x40ac23['model']=_[_0x8133('0x45')](db[_0x8133('0x54')][_0x8133('0x3f')]);_0x40ac23[_0x8133('0x44')]=_[_0x8133('0x45')](_0x6b26f3[_0x8133('0x44')]);_0x40ac23['filters']=_[_0x8133('0x47')](_0x40ac23[_0x8133('0x43')],_0x40ac23[_0x8133('0x44')]);_0x1d96a2[_0x8133('0x49')]=_[_0x8133('0x47')](_0x40ac23[_0x8133('0x43')],qs[_0x8133('0x48')](_0x6b26f3[_0x8133('0x44')][_0x8133('0x48')]));_0x1d96a2[_0x8133('0x49')]=_0x1d96a2['attributes'][_0x8133('0x4a')]?_0x1d96a2[_0x8133('0x49')]:_0x40ac23[_0x8133('0x43')];if(_0x6b26f3['query'][_0x8133('0x55')]){_0x1d96a2[_0x8133('0x56')]=[{'all':!![]}];}_0x1d96a2=_['merge']({},_0x1d96a2,_0x6b26f3[_0x8133('0x53')]);return db[_0x8133('0x54')]['find'](_0x1d96a2)['then'](handleEntityNotFound(_0x412f3a,null))['then'](respondWithResult(_0x412f3a,null))[_0x8133('0x2d')](handleError(_0x412f3a,null));};exports[_0x8133('0x39')]=function(_0x4aec2a,_0x3e7bce){if(_0x4aec2a['body']['id']){delete _0x4aec2a[_0x8133('0x5a')]['id'];}return db[_0x8133('0x54')][_0x8133('0x5b')]({'where':{'id':_0x4aec2a['params']['id']}})['then'](handleEntityNotFound(_0x3e7bce,null))[_0x8133('0x25')](saveUpdates(_0x4aec2a[_0x8133('0x5a')],null))[_0x8133('0x25')](respondWithResult(_0x3e7bce,null))[_0x8133('0x2d')](handleError(_0x3e7bce,null));};exports[_0x8133('0x3a')]=function(_0x88cd0c,_0x4fa459){return db[_0x8133('0x54')][_0x8133('0x5b')]({'where':{'id':_0x88cd0c[_0x8133('0x59')]['id']}})[_0x8133('0x25')](handleEntityNotFound(_0x4fa459,null))[_0x8133('0x25')](removeEntity(_0x4fa459,null))[_0x8133('0x2d')](handleError(_0x4fa459,null));};exports['describe']=function(_0x2d8a91,_0xa541b7){return db[_0x8133('0x54')][_0x8133('0x5c')]()['then'](respondWithResult(_0xa541b7,null))['catch'](handleError(_0xa541b7,null));};var interaction_log=require(_0x8133('0x5d'))(_0x8133('0x5e'));exports[_0x8133('0x5f')]=function(_0x1fd011,_0x429931,_0x189885){var _0x32d58b={'agent':{},'channel':_0x8133('0x60')};if(_0x1fd011[_0x8133('0x5a')]['id']){delete _0x1fd011['body']['id'];}_0x1fd011[_0x8133('0x5a')]['read']=!![];_0x1fd011[_0x8133('0x5a')][_0x8133('0x61')]=moment()[_0x8133('0x62')](_0x8133('0x63'));_0x1fd011[_0x8133('0x5a')]['UserId']=_0x1fd011[_0x8133('0x5a')][_0x8133('0x64')]||_0x1fd011[_0x8133('0x65')]['id'];_0x32d58b[_0x8133('0x66')]['id']=_0x1fd011[_0x8133('0x5a')][_0x8133('0x64')];return db['FaxMessage']['find']({'where':{'id':_0x1fd011['params']['id'],'UserId':null}})[_0x8133('0x25')](handleEntityNotFound(_0x429931,null))['then'](saveUpdates(_0x1fd011[_0x8133('0x5a')],null))['then'](function(_0x37fc30){if(_0x37fc30){_0x32d58b[_0x8133('0x2a')]=_0x37fc30[_0x8133('0x67')]({'plain':!![]});return db[_0x8133('0x68')][_0x8133('0x5b')]({'where':{'id':_0x37fc30[_0x8133('0x69')]}});}return null;})[_0x8133('0x25')](handleEntityNotFound(_0x429931,null))[_0x8133('0x25')](function(_0xe80b5){if(_0xe80b5){return _0xe80b5[_0x8133('0x39')]({'UserId':_0x1fd011[_0x8133('0x5a')][_0x8133('0x64')],'read1stAt':_[_0x8133('0x6a')](_0xe80b5[_0x8133('0x6b')])?moment()[_0x8133('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8133('0x25')](function(_0x51cfef){if(_0x51cfef){_0x32d58b['interaction']=_0x51cfef[_0x8133('0x67')]({'plain':!![]});interaction_log['info'](_0x8133('0x6c'),_0x1fd011[_0x8133('0x65')]['id'],_0x1fd011[_0x8133('0x65')]['name'],_0x1fd011[_0x8133('0x65')][_0x8133('0x6d')],_0x32d58b[_0x8133('0x6e')]['id'],_0x1fd011[_0x8133('0x5a')]?JSON['stringify'](_0x1fd011[_0x8133('0x5a')]):'null');return respondWithRpcPromise(_0x8133('0x6f'),_0x8133('0x70'),_0x32d58b);}return null;})[_0x8133('0x25')](function(_0x2d654d){var _0x2f9f3d=_0x8133('0x71')+_0x2d654d[_0x8133('0x2a')][_0x8133('0x72')];return db[_0x8133('0x73')][_0x8133('0x44')](_0x2f9f3d,{'type':db['Sequelize'][_0x8133('0x74')]['SELECT'],'raw':!![]})[_0x8133('0x25')](function(_0x2f9dda){return _0x2f9dda;});})[_0x8133('0x25')](function(_0x2b7db9){if(_0x2b7db9){_0x32d58b[_0x8133('0x2a')][_0x8133('0x75')]=_0x2b7db9[0x0];if(!_0x1fd011['body']['UserId'])return;return db[_0x8133('0x76')]['find']({'where':{'id':_0x1fd011['body']['UserId'],'role':'agent'},'attributes':['id',_0x8133('0x3b'),_0x8133('0x77'),_0x8133('0x78'),_0x8133('0x79')],'raw':!![]});}return null;})[_0x8133('0x25')](function(_0xeff19d){if(!_0xeff19d)return null;_0x32d58b[_0x8133('0x2a')]['agent']=_0xeff19d;return _0x32d58b;})[_0x8133('0x25')](function(_0x2db789){if(_0x2db789){if(_0x1fd011[_0x8133('0x5a')]['manual']){_0x32d58b[_0x8133('0x2a')][_0x8133('0x7a')]=util['format'](_0x8133('0x7b'),_0x1fd011[_0x8133('0x65')]['name']);_0x32d58b[_0x8133('0x2a')]['channel']=_0x32d58b[_0x8133('0x7c')];_0x32d58b[_0x8133('0x2a')][_0x8133('0x7d')]=_0x32d58b[_0x8133('0x7c')];_0x32d58b[_0x8133('0x2a')][_0x8133('0x7e')]=_0x8133('0x5f');return respondWithRpcPromise(_0x8133('0x7f'),_0x8133('0x7f'),{'event':_0x8133('0x80'),'message':_0x32d58b['message']},client9002)['then'](function(){return _0x32d58b;});}return _0x32d58b;}return null;})[_0x8133('0x25')](respondWithResult(_0x429931,null))[_0x8133('0x2d')](handleError(_0x429931,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x8133('0x38')]=function(_0x1eadea,_0x39c1fd,_0x4cfb46){var _0x1ad6d8={'agent':{},'channel':_0x8133('0x60')};if(_0x1eadea[_0x8133('0x5a')]['id']){delete _0x1eadea[_0x8133('0x5a')]['id'];}_0x1eadea[_0x8133('0x5a')][_0x8133('0x64')]=_0x1eadea[_0x8133('0x5a')][_0x8133('0x64')]||_0x1eadea[_0x8133('0x65')]['id'];_0x1ad6d8[_0x8133('0x66')]['id']=_0x1eadea['body']['UserId'];return db[_0x8133('0x54')][_0x8133('0x5b')]({'where':{'id':_0x1eadea[_0x8133('0x59')]['id'],'UserId':null}})[_0x8133('0x25')](handleEntityNotFound(_0x39c1fd,null))[_0x8133('0x25')](function(_0x3447de){if(_0x3447de){_0x1ad6d8[_0x8133('0x2a')]=_0x3447de[_0x8133('0x67')]({'plain':!![]});return db['FaxInteraction'][_0x8133('0x5b')]({'where':{'id':_0x3447de['FaxInteractionId']}});}return null;})[_0x8133('0x25')](handleEntityNotFound(_0x39c1fd,null))[_0x8133('0x25')](function(_0x51aaff){if(_0x51aaff){_0x1ad6d8[_0x8133('0x6e')]=_0x51aaff[_0x8133('0x67')]({'plain':!![]});interaction_log['info'](_0x8133('0x81'),_0x1eadea['user']['id'],_0x1eadea[_0x8133('0x65')][_0x8133('0x3b')],_0x1eadea['user'][_0x8133('0x6d')],_0x1ad6d8['interaction']['id'],_0x1eadea[_0x8133('0x5a')]?JSON[_0x8133('0x82')](_0x1eadea[_0x8133('0x5a')]):_0x8133('0x83'));return respondWithRpcPromise(_0x8133('0x84'),_0x8133('0x85'),_0x1ad6d8);}return null;})[_0x8133('0x25')](function(_0x5ae9da){var _0x4efcc0=_0x8133('0x71')+_0x5ae9da['message'][_0x8133('0x72')];return db[_0x8133('0x73')][_0x8133('0x44')](_0x4efcc0,{'type':db[_0x8133('0x86')][_0x8133('0x74')][_0x8133('0x87')],'raw':!![]})['then'](function(_0x1b5f35){return _0x1b5f35;});})[_0x8133('0x25')](function(_0x10c619){if(_0x10c619){_0x1ad6d8[_0x8133('0x2a')]['contact']=_0x10c619[0x0];if(!_0x1eadea['body'][_0x8133('0x64')])return;return db['User'][_0x8133('0x5b')]({'where':{'id':_0x1eadea[_0x8133('0x5a')]['UserId'],'role':_0x8133('0x66')},'attributes':['id',_0x8133('0x3b'),_0x8133('0x77'),_0x8133('0x78'),_0x8133('0x79')],'raw':!![]});}return null;})['then'](function(_0x362924){if(!_0x362924)return null;_0x1ad6d8['message'][_0x8133('0x66')]=_0x362924;return _0x1ad6d8;})[_0x8133('0x25')](function(_0x77b005){if(_0x77b005){_0x77b005[_0x8133('0x2a')]['interface']=util[_0x8133('0x62')](_0x8133('0x7b'),_0x1eadea[_0x8133('0x65')][_0x8133('0x3b')]);_0x77b005[_0x8133('0x2a')]['channel']=_0x1ad6d8[_0x8133('0x7c')];_0x77b005[_0x8133('0x2a')][_0x8133('0x7d')]=_0x1ad6d8['channel'];_0x77b005[_0x8133('0x2a')][_0x8133('0x7e')]=_0x8133('0x38');respondWithRpcPromise(_0x8133('0x7f'),_0x8133('0x7f'),{'event':_0x8133('0x88'),'message':_0x77b005[_0x8133('0x2a')]},client9002);return _0x1ad6d8;}return null;})['then'](respondWithResult(_0x39c1fd,null))[_0x8133('0x2d')](handleError(_0x39c1fd,null));};exports[_0x8133('0x89')]=function(_0x19bfbb,_0x1e2585){var _0x87d67a;return db[_0x8133('0x54')][_0x8133('0x89')](_0x19bfbb[_0x8133('0x5a')],{})[_0x8133('0x25')](function(_0x3f980a){_0x87d67a=_0x3f980a;return db['CmContact'][_0x8133('0x8a')]({'where':{'id':_0x87d67a[_0x8133('0x72')]}});})['then'](function(_0x71981b){if(_[_0x8133('0x6a')](_0x71981b)){return;}else{_0x87d67a[_0x8133('0x60')]=_0x71981b[_0x8133('0x60')];return db['Attachment'][_0x8133('0x8a')]({'where':{'id':_0x87d67a[_0x8133('0x8b')]}});}})['then'](function(_0x35ba4c){return respondWithRpcPromise(_0x8133('0x8c'),'SendFax',{'FaxAccountId':_[_0x8133('0x6a')](_0x19bfbb[_0x8133('0x5a')])?undefined:_0x19bfbb[_0x8133('0x5a')][_0x8133('0x8d')],'path':_[_0x8133('0x6a')](_0x35ba4c)?undefined:util[_0x8133('0x62')](_0x8133('0x8e'),_0x35ba4c[_0x8133('0x8f')]),'fax':_['isNil'](_0x87d67a[_0x8133('0x60')])?undefined:_0x87d67a[_0x8133('0x60')],'AttachmentId':_0x87d67a[_0x8133('0x8b')]},client9002);})['then'](respondWithResult(_0x1e2585,0xc9))[_0x8133('0x2d')](handleError(_0x1e2585,null));};exports[_0x8133('0x90')]=function(_0xbdf329,_0x571613){var _0xcf40f=path[_0x8133('0x91')](config[_0x8133('0x92')],_0x8133('0x93'),_0x8133('0x94'),'attachments');return db[_0x8133('0x54')][_0x8133('0x5b')]({'where':{'id':_0xbdf329[_0x8133('0x59')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x8133('0x25')](handleEntityNotFound(_0x571613,null))[_0x8133('0x25')](function(_0x2cc564){if(_0x2cc564){return _0x571613[_0x8133('0x90')](path[_0x8133('0x91')](_0xcf40f,_0x2cc564['Attachment'][_0x8133('0x8f')]));}})[_0x8133('0x2d')](handleError(_0x571613,null));}; \ No newline at end of file +var _0x6f01=['findAll','rows','catch','show','rawAttributes','find','body','params','describe','fax-interactions','accept','fax','read','format','UserId','user','FaxInteraction','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','contact','User','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize','QueryTypes','internal','interface','rejectmessage','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','FaxMessage','type','key','model','map','query','keys','intersection','fields','attributes','length','where','filters','pick','merge','options','includeAll','include'];(function(_0x1b1699,_0x5d2d68){var _0x178230=function(_0x470011){while(--_0x470011){_0x1b1699['push'](_0x1b1699['shift']());}};_0x178230(++_0x5d2d68);}(_0x6f01,0xd0));var _0x16f0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6f01[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16f0('0x0'));var zipdir=require(_0x16f0('0x1'));var jsonpatch=require(_0x16f0('0x2'));var rp=require('request-promise');var moment=require(_0x16f0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x16f0('0x4'));var sox=require(_0x16f0('0x5'));var csv=require(_0x16f0('0x6'));var ejs=require(_0x16f0('0x7'));var fs=require('fs');var fs_extra=require(_0x16f0('0x8'));var _=require(_0x16f0('0x9'));var squel=require(_0x16f0('0xa'));var crypto=require(_0x16f0('0xb'));var jsforce=require(_0x16f0('0xc'));var deskjs=require(_0x16f0('0xd'));var toCsv=require(_0x16f0('0x6'));var querystring=require(_0x16f0('0xe'));var Papa=require(_0x16f0('0xf'));var Redis=require(_0x16f0('0x10'));var authService=require(_0x16f0('0x11'));var qs=require(_0x16f0('0x12'));var as=require(_0x16f0('0x13'));var hardwareService=require(_0x16f0('0x14'));var logger=require(_0x16f0('0x15'))(_0x16f0('0x16'));var utils=require(_0x16f0('0x17'));var config=require(_0x16f0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x16f0('0x19'))['db'];config[_0x16f0('0x1a')]=_[_0x16f0('0x1b')](config['redis'],{'host':_0x16f0('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x16f0('0x1a')]));require(_0x16f0('0x1d'))[_0x16f0('0x1e')](socket);var jayson=require(_0x16f0('0x1f'));var client=jayson['client'][_0x16f0('0x20')]({'port':0x232c});var client9002=jayson[_0x16f0('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ef7fd,_0x140ba3,_0x7b9410,_0xbbb13a){return new BPromise(function(_0x380933,_0x1a042d){var _0x16c02d=_0xbbb13a||client;return _0x16c02d[_0x16f0('0x22')](_0x2ef7fd,_0x7b9410)[_0x16f0('0x23')](function(_0x4c1eee){logger[_0x16f0('0x24')]('FaxMessage,\x20%s,\x20%s',_0x140ba3,_0x16f0('0x25'));logger[_0x16f0('0x26')](_0x16f0('0x27'),_0x140ba3,_0x16f0('0x25'),JSON[_0x16f0('0x28')](_0x4c1eee));if(_0x4c1eee[_0x16f0('0x29')]){if(_0x4c1eee['error'][_0x16f0('0x2a')]===0x1f4){logger[_0x16f0('0x29')](_0x16f0('0x2b'),_0x140ba3,_0x4c1eee[_0x16f0('0x29')][_0x16f0('0x2c')]);return _0x1a042d(_0x4c1eee[_0x16f0('0x29')]['message']);}logger[_0x16f0('0x29')](_0x16f0('0x2b'),_0x140ba3,_0x4c1eee['error'][_0x16f0('0x2c')]);return _0x380933(_0x4c1eee[_0x16f0('0x29')][_0x16f0('0x2c')]);}else{logger[_0x16f0('0x24')]('FaxMessage,\x20%s,\x20%s',_0x140ba3,_0x16f0('0x25'));_0x380933(_0x4c1eee['result'][_0x16f0('0x2c')]);}})['catch'](function(_0x4e477b){logger[_0x16f0('0x29')](_0x16f0('0x2b'),_0x140ba3,_0x4e477b);_0x1a042d(_0x4e477b);});});}function respondWithStatusCode(_0x252f70,_0x41ec4f){_0x41ec4f=_0x41ec4f||0xcc;return function(_0x15a0fa){if(_0x15a0fa){return _0x252f70[_0x16f0('0x2d')](_0x41ec4f);}return _0x252f70[_0x16f0('0x2e')](_0x41ec4f)[_0x16f0('0x2f')]();};}function respondWithResult(_0x1241ba,_0x39ff2b){_0x39ff2b=_0x39ff2b||0xc8;return function(_0x2ca460){if(_0x2ca460){return _0x1241ba[_0x16f0('0x2e')](_0x39ff2b)['json'](_0x2ca460);}};}function respondWithFilteredResult(_0x4a632f,_0x255910){return function(_0x470e76){if(_0x470e76){var _0x1703d9=typeof _0x255910['offset']===_0x16f0('0x30')&&typeof _0x255910[_0x16f0('0x31')]===_0x16f0('0x30');var _0x31810a=_0x470e76[_0x16f0('0x32')];var _0xb8bc7=_0x1703d9?0x0:_0x255910[_0x16f0('0x33')];var _0xfa78cf=_0x1703d9?_0x470e76['count']:_0x255910['offset']+_0x255910['limit'];var _0x14e941;if(_0xfa78cf>=_0x31810a){_0xfa78cf=_0x31810a;_0x14e941=0xc8;}else{_0x14e941=0xce;}_0x4a632f['status'](_0x14e941);return _0x4a632f[_0x16f0('0x34')](_0x16f0('0x35'),_0xb8bc7+'-'+_0xfa78cf+'/'+_0x31810a)[_0x16f0('0x36')](_0x470e76);}return null;};}function patchUpdates(_0x3fa66d){return function(_0x458b92){try{jsonpatch[_0x16f0('0x37')](_0x458b92,_0x3fa66d,!![]);}catch(_0x451a04){return BPromise[_0x16f0('0x38')](_0x451a04);}return _0x458b92[_0x16f0('0x39')]();};}function saveUpdates(_0x1415f6,_0x54e3e6){return function(_0x4c17b5){if(_0x4c17b5){return _0x4c17b5[_0x16f0('0x3a')](_0x1415f6)['then'](function(_0x6c7b56){return _0x6c7b56;});}return null;};}function removeEntity(_0x3e857f,_0x56fde4){return function(_0x339887){if(_0x339887){return _0x339887[_0x16f0('0x3b')]()['then'](function(){_0x3e857f[_0x16f0('0x2e')](0xcc)[_0x16f0('0x2f')]();});}};}function handleEntityNotFound(_0x538959,_0x1988a9){return function(_0x1c0889){if(!_0x1c0889){_0x538959[_0x16f0('0x2d')](0x194);}return _0x1c0889;};}function handleError(_0x3befe3,_0x588f93){_0x588f93=_0x588f93||0x1f4;return function(_0x54b5d5){logger[_0x16f0('0x29')](_0x54b5d5[_0x16f0('0x3c')]);if(_0x54b5d5[_0x16f0('0x3d')]){delete _0x54b5d5['name'];}_0x3befe3[_0x16f0('0x2e')](_0x588f93)[_0x16f0('0x3e')](_0x54b5d5);};}exports[_0x16f0('0x3f')]=function(_0x255934,_0x126348){var _0x49dac9={},_0x59cc3b={},_0x2fa0f2={'count':0x0,'rows':[]};var _0xedb818=_['map'](db[_0x16f0('0x40')]['rawAttributes'],function(_0x1c090b){return{'name':_0x1c090b['fieldName'],'type':_0x1c090b[_0x16f0('0x41')][_0x16f0('0x42')]};});_0x59cc3b[_0x16f0('0x43')]=_[_0x16f0('0x44')](_0xedb818,_0x16f0('0x3d'));_0x59cc3b[_0x16f0('0x45')]=_[_0x16f0('0x46')](_0x255934[_0x16f0('0x45')]);_0x59cc3b['filters']=_[_0x16f0('0x47')](_0x59cc3b['model'],_0x59cc3b[_0x16f0('0x45')]);_0x49dac9['attributes']=_[_0x16f0('0x47')](_0x59cc3b[_0x16f0('0x43')],qs[_0x16f0('0x48')](_0x255934[_0x16f0('0x45')][_0x16f0('0x48')]));_0x49dac9[_0x16f0('0x49')]=_0x49dac9[_0x16f0('0x49')][_0x16f0('0x4a')]?_0x49dac9[_0x16f0('0x49')]:_0x59cc3b['model'];if(!_0x255934[_0x16f0('0x45')]['hasOwnProperty']('nolimit')){_0x49dac9['limit']=qs['limit'](_0x255934[_0x16f0('0x45')]['limit']);_0x49dac9[_0x16f0('0x33')]=qs[_0x16f0('0x33')](_0x255934[_0x16f0('0x45')][_0x16f0('0x33')]);}_0x49dac9['order']=qs['sort'](_0x255934[_0x16f0('0x45')]['sort']);_0x49dac9[_0x16f0('0x4b')]=qs[_0x16f0('0x4c')](_[_0x16f0('0x4d')](_0x255934[_0x16f0('0x45')],_0x59cc3b[_0x16f0('0x4c')]),_0xedb818);if(_0x255934['query']['filter']){_0x49dac9[_0x16f0('0x4b')]=_[_0x16f0('0x4e')](_0x49dac9[_0x16f0('0x4b')],{'$or':_['map'](_0xedb818,function(_0x36bd2a){if(_0x36bd2a[_0x16f0('0x41')]!=='VIRTUAL'){var _0x46b142={};_0x46b142[_0x36bd2a[_0x16f0('0x3d')]]={'$like':'%'+_0x255934['query']['filter']+'%'};return _0x46b142;}})});}_0x49dac9=_[_0x16f0('0x4e')]({},_0x49dac9,_0x255934[_0x16f0('0x4f')]);var _0x1f8af9={'where':_0x49dac9[_0x16f0('0x4b')]};return db['FaxMessage']['count'](_0x1f8af9)[_0x16f0('0x23')](function(_0x423667){_0x2fa0f2[_0x16f0('0x32')]=_0x423667;if(_0x255934['query'][_0x16f0('0x50')]){_0x49dac9[_0x16f0('0x51')]=[{'all':!![]}];}return db[_0x16f0('0x40')][_0x16f0('0x52')](_0x49dac9);})[_0x16f0('0x23')](function(_0x40e8a2){_0x2fa0f2[_0x16f0('0x53')]=_0x40e8a2;return _0x2fa0f2;})['then'](respondWithFilteredResult(_0x126348,_0x49dac9))[_0x16f0('0x54')](handleError(_0x126348,null));};exports[_0x16f0('0x55')]=function(_0x38679c,_0x54f08f){var _0x24e52e={'raw':!![],'where':{'id':_0x38679c['params']['id']}},_0x5ee8bb={};_0x5ee8bb[_0x16f0('0x43')]=_[_0x16f0('0x46')](db[_0x16f0('0x40')][_0x16f0('0x56')]);_0x5ee8bb[_0x16f0('0x45')]=_[_0x16f0('0x46')](_0x38679c[_0x16f0('0x45')]);_0x5ee8bb[_0x16f0('0x4c')]=_[_0x16f0('0x47')](_0x5ee8bb[_0x16f0('0x43')],_0x5ee8bb[_0x16f0('0x45')]);_0x24e52e[_0x16f0('0x49')]=_['intersection'](_0x5ee8bb['model'],qs['fields'](_0x38679c[_0x16f0('0x45')][_0x16f0('0x48')]));_0x24e52e[_0x16f0('0x49')]=_0x24e52e['attributes'][_0x16f0('0x4a')]?_0x24e52e[_0x16f0('0x49')]:_0x5ee8bb['model'];if(_0x38679c['query'][_0x16f0('0x50')]){_0x24e52e[_0x16f0('0x51')]=[{'all':!![]}];}_0x24e52e=_[_0x16f0('0x4e')]({},_0x24e52e,_0x38679c['options']);return db[_0x16f0('0x40')][_0x16f0('0x57')](_0x24e52e)[_0x16f0('0x23')](handleEntityNotFound(_0x54f08f,null))['then'](respondWithResult(_0x54f08f,null))[_0x16f0('0x54')](handleError(_0x54f08f,null));};exports[_0x16f0('0x3a')]=function(_0x100133,_0x16a192){if(_0x100133[_0x16f0('0x58')]['id']){delete _0x100133[_0x16f0('0x58')]['id'];}return db[_0x16f0('0x40')][_0x16f0('0x57')]({'where':{'id':_0x100133[_0x16f0('0x59')]['id']}})[_0x16f0('0x23')](handleEntityNotFound(_0x16a192,null))['then'](saveUpdates(_0x100133[_0x16f0('0x58')],null))[_0x16f0('0x23')](respondWithResult(_0x16a192,null))[_0x16f0('0x54')](handleError(_0x16a192,null));};exports[_0x16f0('0x3b')]=function(_0x3e2c75,_0x188863){return db[_0x16f0('0x40')][_0x16f0('0x57')]({'where':{'id':_0x3e2c75['params']['id']}})[_0x16f0('0x23')](handleEntityNotFound(_0x188863,null))[_0x16f0('0x23')](removeEntity(_0x188863,null))['catch'](handleError(_0x188863,null));};exports[_0x16f0('0x5a')]=function(_0x5477ce,_0x3a80da){return db[_0x16f0('0x40')][_0x16f0('0x5a')]()[_0x16f0('0x23')](respondWithResult(_0x3a80da,null))[_0x16f0('0x54')](handleError(_0x3a80da,null));};var interaction_log=require('../../config/logger')(_0x16f0('0x5b'));exports[_0x16f0('0x5c')]=function(_0x3af72c,_0x271883,_0x5c7c87){var _0x549491={'agent':{},'channel':_0x16f0('0x5d')};if(_0x3af72c[_0x16f0('0x58')]['id']){delete _0x3af72c[_0x16f0('0x58')]['id'];}_0x3af72c['body'][_0x16f0('0x5e')]=!![];_0x3af72c[_0x16f0('0x58')]['readAt']=moment()[_0x16f0('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3af72c['body'][_0x16f0('0x60')]=_0x3af72c[_0x16f0('0x58')]['UserId']||_0x3af72c[_0x16f0('0x61')]['id'];_0x549491['agent']['id']=_0x3af72c[_0x16f0('0x58')][_0x16f0('0x60')];return db[_0x16f0('0x40')][_0x16f0('0x57')]({'where':{'id':_0x3af72c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x271883,null))[_0x16f0('0x23')](saveUpdates(_0x3af72c[_0x16f0('0x58')],null))['then'](function(_0x206ef3){if(_0x206ef3){_0x549491[_0x16f0('0x2c')]=_0x206ef3['get']({'plain':!![]});return db[_0x16f0('0x62')][_0x16f0('0x57')]({'where':{'id':_0x206ef3['FaxInteractionId']}});}return null;})[_0x16f0('0x23')](handleEntityNotFound(_0x271883,null))[_0x16f0('0x23')](function(_0x2b829a){if(_0x2b829a){return _0x2b829a[_0x16f0('0x3a')]({'UserId':_0x3af72c[_0x16f0('0x58')][_0x16f0('0x60')],'read1stAt':_[_0x16f0('0x63')](_0x2b829a[_0x16f0('0x64')])?moment()[_0x16f0('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x16f0('0x23')](function(_0x55a222){if(_0x55a222){_0x549491[_0x16f0('0x65')]=_0x55a222[_0x16f0('0x66')]({'plain':!![]});interaction_log[_0x16f0('0x24')](_0x16f0('0x67'),_0x3af72c[_0x16f0('0x61')]['id'],_0x3af72c[_0x16f0('0x61')][_0x16f0('0x3d')],_0x3af72c[_0x16f0('0x61')][_0x16f0('0x68')],_0x549491[_0x16f0('0x65')]['id'],_0x3af72c['body']?JSON[_0x16f0('0x28')](_0x3af72c[_0x16f0('0x58')]):_0x16f0('0x69'));return respondWithRpcPromise(_0x16f0('0x6a'),_0x16f0('0x6b'),_0x549491);}return null;})['then'](function(_0x26fd1d){var _0x14a00f=_0x16f0('0x6c')+_0x26fd1d[_0x16f0('0x2c')][_0x16f0('0x6d')];return db['sequelize'][_0x16f0('0x45')](_0x14a00f,{'type':db['Sequelize']['QueryTypes'][_0x16f0('0x6e')],'raw':!![]})[_0x16f0('0x23')](function(_0x4dcf2a){return _0x4dcf2a;});})[_0x16f0('0x23')](function(_0x352fa5){if(_0x352fa5){_0x549491[_0x16f0('0x2c')][_0x16f0('0x6f')]=_0x352fa5[0x0];if(!_0x3af72c['body']['UserId'])return;return db[_0x16f0('0x70')]['find']({'where':{'id':_0x3af72c[_0x16f0('0x58')][_0x16f0('0x60')],'role':_0x16f0('0x71')},'attributes':['id',_0x16f0('0x3d'),_0x16f0('0x72'),_0x16f0('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x473b2f){if(!_0x473b2f)return null;_0x549491[_0x16f0('0x2c')][_0x16f0('0x71')]=_0x473b2f;return _0x549491;})['then'](function(_0x236abf){if(_0x236abf){if(_0x3af72c[_0x16f0('0x58')][_0x16f0('0x74')]){_0x549491[_0x16f0('0x2c')]['interface']=util[_0x16f0('0x5f')](_0x16f0('0x75'),_0x3af72c[_0x16f0('0x61')][_0x16f0('0x3d')]);_0x549491[_0x16f0('0x2c')][_0x16f0('0x76')]=_0x549491[_0x16f0('0x76')];_0x549491[_0x16f0('0x2c')][_0x16f0('0x77')]=_0x549491[_0x16f0('0x76')];_0x549491['message'][_0x16f0('0x78')]=_0x16f0('0x5c');return respondWithRpcPromise(_0x16f0('0x79'),_0x16f0('0x79'),{'event':_0x16f0('0x7a'),'message':_0x549491[_0x16f0('0x2c')]},client9002)[_0x16f0('0x23')](function(){return _0x549491;});}return _0x549491;}return null;})[_0x16f0('0x23')](respondWithResult(_0x271883,null))[_0x16f0('0x54')](handleError(_0x271883,null));};var interaction_log=require(_0x16f0('0x15'))('fax-interactions');exports[_0x16f0('0x38')]=function(_0x1554e3,_0x411e71,_0x40c18c){var _0x8ebb98={'agent':{},'channel':'fax'};if(_0x1554e3[_0x16f0('0x58')]['id']){delete _0x1554e3[_0x16f0('0x58')]['id'];}_0x1554e3[_0x16f0('0x58')][_0x16f0('0x60')]=_0x1554e3[_0x16f0('0x58')][_0x16f0('0x60')]||_0x1554e3[_0x16f0('0x61')]['id'];_0x8ebb98[_0x16f0('0x71')]['id']=_0x1554e3[_0x16f0('0x58')][_0x16f0('0x60')];return db[_0x16f0('0x40')]['find']({'where':{'id':_0x1554e3[_0x16f0('0x59')]['id'],'UserId':null}})[_0x16f0('0x23')](handleEntityNotFound(_0x411e71,null))['then'](function(_0x180107){if(_0x180107){_0x8ebb98[_0x16f0('0x2c')]=_0x180107[_0x16f0('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x16f0('0x57')]({'where':{'id':_0x180107[_0x16f0('0x7b')]}});}return null;})[_0x16f0('0x23')](handleEntityNotFound(_0x411e71,null))[_0x16f0('0x23')](function(_0x43d6d8){if(_0x43d6d8){_0x8ebb98[_0x16f0('0x65')]=_0x43d6d8['get']({'plain':!![]});interaction_log['info'](_0x16f0('0x7c'),_0x1554e3['user']['id'],_0x1554e3[_0x16f0('0x61')][_0x16f0('0x3d')],_0x1554e3[_0x16f0('0x61')][_0x16f0('0x68')],_0x8ebb98['interaction']['id'],_0x1554e3['body']?JSON['stringify'](_0x1554e3[_0x16f0('0x58')]):_0x16f0('0x69'));return respondWithRpcPromise(_0x16f0('0x7d'),'rejectMessage',_0x8ebb98);}return null;})[_0x16f0('0x23')](function(_0x2c1432){var _0x3a220d=_0x16f0('0x6c')+_0x2c1432[_0x16f0('0x2c')]['ContactId'];return db[_0x16f0('0x7e')][_0x16f0('0x45')](_0x3a220d,{'type':db[_0x16f0('0x7f')][_0x16f0('0x80')][_0x16f0('0x6e')],'raw':!![]})[_0x16f0('0x23')](function(_0x11a777){return _0x11a777;});})['then'](function(_0x2a2992){if(_0x2a2992){_0x8ebb98[_0x16f0('0x2c')][_0x16f0('0x6f')]=_0x2a2992[0x0];if(!_0x1554e3['body'][_0x16f0('0x60')])return;return db[_0x16f0('0x70')][_0x16f0('0x57')]({'where':{'id':_0x1554e3['body'][_0x16f0('0x60')],'role':_0x16f0('0x71')},'attributes':['id',_0x16f0('0x3d'),_0x16f0('0x72'),'email',_0x16f0('0x81')],'raw':!![]});}return null;})[_0x16f0('0x23')](function(_0x4c7d90){if(!_0x4c7d90)return null;_0x8ebb98[_0x16f0('0x2c')][_0x16f0('0x71')]=_0x4c7d90;return _0x8ebb98;})['then'](function(_0x41516e){if(_0x41516e){_0x41516e[_0x16f0('0x2c')][_0x16f0('0x82')]=util['format'](_0x16f0('0x75'),_0x1554e3[_0x16f0('0x61')][_0x16f0('0x3d')]);_0x41516e['message']['channel']=_0x8ebb98['channel'];_0x41516e[_0x16f0('0x2c')][_0x16f0('0x77')]=_0x8ebb98['channel'];_0x41516e[_0x16f0('0x2c')][_0x16f0('0x78')]=_0x16f0('0x38');respondWithRpcPromise(_0x16f0('0x79'),_0x16f0('0x79'),{'event':_0x16f0('0x83'),'message':_0x41516e['message']},client9002);return _0x8ebb98;}return null;})[_0x16f0('0x23')](respondWithResult(_0x411e71,null))[_0x16f0('0x54')](handleError(_0x411e71,null));};exports[_0x16f0('0x84')]=function(_0x4f6486,_0x54d09a){var _0x4d28df;return db[_0x16f0('0x40')]['create'](_0x4f6486[_0x16f0('0x58')],{})[_0x16f0('0x23')](function(_0x28b0db){_0x4d28df=_0x28b0db;return db['CmContact']['findOne']({'where':{'id':_0x4d28df['ContactId']}});})['then'](function(_0x599e45){if(_[_0x16f0('0x63')](_0x599e45)){return;}else{_0x4d28df['fax']=_0x599e45[_0x16f0('0x5d')];return db[_0x16f0('0x85')][_0x16f0('0x86')]({'where':{'id':_0x4d28df[_0x16f0('0x87')]}});}})[_0x16f0('0x23')](function(_0x4d542f){return respondWithRpcPromise('SendFax',_0x16f0('0x88'),{'FaxAccountId':_['isNil'](_0x4f6486[_0x16f0('0x58')])?undefined:_0x4f6486[_0x16f0('0x58')][_0x16f0('0x89')],'path':_['isNil'](_0x4d542f)?undefined:util[_0x16f0('0x5f')](_0x16f0('0x8a'),_0x4d542f[_0x16f0('0x8b')]),'fax':_[_0x16f0('0x63')](_0x4d28df[_0x16f0('0x5d')])?undefined:_0x4d28df[_0x16f0('0x5d')],'AttachmentId':_0x4d28df[_0x16f0('0x87')]},client9002);})['then'](respondWithResult(_0x54d09a,0xc9))[_0x16f0('0x54')](handleError(_0x54d09a,null));};exports[_0x16f0('0x8c')]=function(_0x58ab72,_0x1a9e49){var _0x1b5919=path[_0x16f0('0x8d')](config[_0x16f0('0x8e')],_0x16f0('0x8f'),'files',_0x16f0('0x90'));return db[_0x16f0('0x40')][_0x16f0('0x57')]({'where':{'id':_0x58ab72[_0x16f0('0x59')]['id']},'include':[{'model':db[_0x16f0('0x85')],'as':_0x16f0('0x85')}]})[_0x16f0('0x23')](handleEntityNotFound(_0x1a9e49,null))['then'](function(_0x22f6f8){if(_0x22f6f8){return _0x1a9e49[_0x16f0('0x8c')](path[_0x16f0('0x8d')](_0x1b5919,_0x22f6f8[_0x16f0('0x85')][_0x16f0('0x8b')]));}})[_0x16f0('0x54')](handleError(_0x1a9e49,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index d80f2e8..896545e 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 _0xf963=['emit','hook','exports','events','setMaxListeners','save'];(function(_0x34fe70,_0x351487){var _0x44204b=function(_0x5e72ac){while(--_0x5e72ac){_0x34fe70['push'](_0x34fe70['shift']());}};_0x44204b(++_0x351487);}(_0xf963,0x11d));var _0x3f96=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf963[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x3f96('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3f96('0x1')](0x0);var events={'afterCreate':_0x3f96('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f30a1){return function(_0x1e7cb9,_0x3a6815,_0x1a91ab){FaxMessageEvents['emit'](_0x1f30a1+':'+_0x1e7cb9['id'],_0x1e7cb9);FaxMessageEvents[_0x3f96('0x3')](_0x1f30a1,_0x1e7cb9);_0x1a91ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x3f96('0x4')](e,emitEvent(event));}}module[_0x3f96('0x5')]=FaxMessageEvents; \ No newline at end of file +var _0x4bd3=['events','FaxMessage','setMaxListeners','emit','hook','exports'];(function(_0x29fdd9,_0x9bff){var _0x244012=function(_0x1bc5ad){while(--_0x1bc5ad){_0x29fdd9['push'](_0x29fdd9['shift']());}};_0x244012(++_0x9bff);}(_0x4bd3,0x174));var _0x34bd=function(_0x3be5c0,_0x55ed8e){_0x3be5c0=_0x3be5c0-0x0;var _0x26ee97=_0x4bd3[_0x3be5c0];return _0x26ee97;};'use strict';var EventEmitter=require(_0x34bd('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x34bd('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x34bd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x22b921){return function(_0x44854a,_0x1fc8eb,_0x5846f3){FaxMessageEvents[_0x34bd('0x3')](_0x22b921+':'+_0x44854a['id'],_0x44854a);FaxMessageEvents[_0x34bd('0x3')](_0x22b921,_0x44854a);_0x5846f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x34bd('0x4')](e,emitEvent(event));}}module[_0x34bd('0x5')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 754488e..e8f96aa 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 _0xe015=['createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','FaxMessage','fax_messages','body','FULLTEXT','models','direction','out','secret','isNil','UserId','FaxInteraction','then','update'];(function(_0x8cf3f5,_0xe46ecb){var _0x24a0ca=function(_0x1883f7){while(--_0x1883f7){_0x8cf3f5['push'](_0x8cf3f5['shift']());}};_0x24a0ca(++_0xe46ecb);}(_0xe015,0xa8));var _0x5e01=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe015[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x5e01('0x0'));var logger=require(_0x5e01('0x1'))('api');var moment=require(_0x5e01('0x2'));var BPromise=require('bluebird');var rp=require(_0x5e01('0x3'));var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x529b6d,_0x18c8ce){return _0x529b6d['define'](_0x5e01('0x8'),attributes,{'tableName':_0x5e01('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x5e01('0xa')],'type':_0x5e01('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40f746,_0x5892c9,_0x512655){var _0x25a719=_0x529b6d[_0x5e01('0xc')];var _0x36d78b=_0x40f746['get']({'plain':!![]});if(_0x36d78b[_0x5e01('0xd')]['toLowerCase']()==='in'||_0x36d78b[_0x5e01('0xd')]['toLowerCase']()===_0x5e01('0xe')&&!_0x36d78b[_0x5e01('0xf')]&&!_[_0x5e01('0x10')](_0x36d78b[_0x5e01('0x11')])){_0x25a719[_0x5e01('0x12')]['findOne']({'where':{'id':_0x36d78b['FaxInteractionId']}})[_0x5e01('0x13')](function(_0x23899c){if(_0x23899c){_0x23899c[_0x5e01('0x14')]({'lastMsgAt':_0x36d78b[_0x5e01('0x15')],'lastMsgDirection':_0x36d78b[_0x5e01('0xd')][_0x5e01('0x16')]()});}})[_0x5e01('0x17')](function(_0x59c9fe){console[_0x5e01('0x18')](_0x59c9fe);});}_0x512655();}},'charset':_0x5e01('0x19'),'collate':_0x5e01('0x1a')});}; \ No newline at end of file +var _0xea8e=['createdAt','catch','error','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','rimraf','../../config/environment','define','fax_messages','fti_fax_messages','FULLTEXT','get','direction','out','secret','FaxInteraction','FaxInteractionId','then','update'];(function(_0x43e464,_0x2fc8b0){var _0x5c084c=function(_0x3440a2){while(--_0x3440a2){_0x43e464['push'](_0x43e464['shift']());}};_0x5c084c(++_0x2fc8b0);}(_0xea8e,0xbc));var _0xeea8=function(_0x3fe90c,_0x231b20){_0x3fe90c=_0x3fe90c-0x0;var _0x12c302=_0xea8e[_0x3fe90c];return _0x12c302;};'use strict';var _=require(_0xeea8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeea8('0x1'));var moment=require(_0xeea8('0x2'));var BPromise=require(_0xeea8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeea8('0x4'));var rimraf=require(_0xeea8('0x5'));var config=require(_0xeea8('0x6'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x3f94a7,_0xe4eb47){return _0x3f94a7[_0xeea8('0x7')]('FaxMessage',attributes,{'tableName':_0xeea8('0x8'),'paranoid':![],'indexes':[{'name':_0xeea8('0x9'),'fields':['body'],'type':_0xeea8('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x408345,_0x17376c,_0x292ff3){var _0x229bcb=_0x3f94a7['models'];var _0x38bf48=_0x408345[_0xeea8('0xb')]({'plain':!![]});if(_0x38bf48[_0xeea8('0xc')]['toLowerCase']()==='in'||_0x38bf48[_0xeea8('0xc')]['toLowerCase']()===_0xeea8('0xd')&&!_0x38bf48[_0xeea8('0xe')]&&!_['isNil'](_0x38bf48['UserId'])){_0x229bcb[_0xeea8('0xf')]['findOne']({'where':{'id':_0x38bf48[_0xeea8('0x10')]}})[_0xeea8('0x11')](function(_0x4c70c0){if(_0x4c70c0){_0x4c70c0[_0xeea8('0x12')]({'lastMsgAt':_0x38bf48[_0xeea8('0x13')],'lastMsgDirection':_0x38bf48[_0xeea8('0xc')]['toLowerCase']()});}})[_0xeea8('0x14')](function(_0x2d9211){console[_0xeea8('0x15')](_0x2d9211);});}_0x292ff3();}},'charset':'utf8mb4','collate':_0xeea8('0x16')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c4e581d..a44e0f3 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 _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x3c8bcc,_0x25f899){var _0x589fef=function(_0x17c84a){while(--_0x17c84a){_0x3c8bcc['push'](_0x3c8bcc['shift']());}};_0x589fef(++_0x25f899);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file +var _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0x461ac6,_0x671194){var _0x527ed6=function(_0x43e68a){while(--_0x43e68a){_0x461ac6['push'](_0x461ac6['shift']());}};_0x527ed6(++_0x671194);}(_0x0e85,0x7c));var _0x50e8=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x0e85[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 991642d..b3cc14f 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 _0x41ef=['register','faxMessage:','./faxMessage.events','save','remove','removeListener'];(function(_0x373609,_0x39e9b6){var _0x4eb4f6=function(_0x586e2d){while(--_0x586e2d){_0x373609['push'](_0x373609['shift']());}};_0x4eb4f6(++_0x39e9b6);}(_0x41ef,0xec));var _0xf41e=function(_0x168017,_0x214a84){_0x168017=_0x168017-0x0;var _0xb9fb2=_0x41ef[_0x168017];return _0xb9fb2;};'use strict';var FaxMessageEvents=require(_0xf41e('0x0'));var events=[_0xf41e('0x1'),_0xf41e('0x2'),'update'];function createListener(_0x2e5008,_0x2c8183){return function(_0x4cde5d){_0x2c8183['emit'](_0x2e5008,_0x4cde5d);};}function removeListener(_0x3d8974,_0x202746){return function(){FaxMessageEvents[_0xf41e('0x3')](_0x3d8974,_0x202746);};}exports[_0xf41e('0x4')]=function(_0x22aa78){for(var _0x59fd03=0x0,_0x4badc0=events['length'];_0x59fd03<_0x4badc0;_0x59fd03++){var _0xadc0b0=events[_0x59fd03];var _0x53fdac=createListener(_0xf41e('0x5')+_0xadc0b0,_0x22aa78);FaxMessageEvents['on'](_0xadc0b0,_0x53fdac);}}; \ No newline at end of file +var _0x5a21=['removeListener','register','faxMessage:','save','remove','emit'];(function(_0x3be658,_0x5b5905){var _0x8382ed=function(_0x361b7d){while(--_0x361b7d){_0x3be658['push'](_0x3be658['shift']());}};_0x8382ed(++_0x5b5905);}(_0x5a21,0x123));var _0x15a2=function(_0x5db7f2,_0x3d4bc9){_0x5db7f2=_0x5db7f2-0x0;var _0x1bacf9=_0x5a21[_0x5db7f2];return _0x1bacf9;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x15a2('0x0'),_0x15a2('0x1'),'update'];function createListener(_0x5d0b57,_0x386683){return function(_0x511841){_0x386683[_0x15a2('0x2')](_0x5d0b57,_0x511841);};}function removeListener(_0x1d1de9,_0x170791){return function(){FaxMessageEvents[_0x15a2('0x3')](_0x1d1de9,_0x170791);};}exports[_0x15a2('0x4')]=function(_0x386c4b){for(var _0x4d2a87=0x0,_0x2a9f20=events['length'];_0x4d2a87<_0x2a9f20;_0x4d2a87++){var _0x139a31=events[_0x4d2a87];var _0x630b2=createListener(_0x15a2('0x5')+_0x139a31,_0x386c4b);FaxMessageEvents['on'](_0x139a31,_0x630b2);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 23d62e3..f26d416 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 _0xcb91=['faxmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','index','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','fax'];(function(_0xa5b765,_0x2b6e0b){var _0x372272=function(_0x321d3b){while(--_0x321d3b){_0xa5b765['push'](_0xa5b765['shift']());}};_0x372272(++_0x2b6e0b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xcb91[_0xd09668];return _0x68726;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth['isAuthenticated'](),interaction[_0x1cb9('0xf')](_0x1cb9('0x10'),_0x1cb9('0x11')),controller[_0x1cb9('0x12')]);router[_0x1cb9('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x13')](_0x1cb9('0x14'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x15')]);router['put'](_0x1cb9('0x16'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x17')]);router[_0x1cb9('0x18')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1cb9('0x19')]=router; \ No newline at end of file +var _0x750a=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','tracked','faxmessage:create','create','update','/:id/accept','accept','put','/:id/reject','delete','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x3a05c9,_0xc20af1){var _0x35a735=function(_0x373f5f){while(--_0x373f5f){_0x3a05c9['push'](_0x3a05c9['shift']());}};_0x35a735(++_0xc20af1);}(_0x750a,0x140));var _0xa750=function(_0x5dd590,_0x294238){_0x5dd590=_0x5dd590-0x0;var _0x4408f2=_0x750a[_0x5dd590];return _0x4408f2;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/download',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa750('0xf')]('fax',_0xa750('0x10')),controller[_0xa750('0x11')]);router['put'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router['put'](_0xa750('0x13'),auth[_0xa750('0x9')](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0x16'),auth[_0xa750('0x9')](),controller['reject']);router[_0xa750('0x17')](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index cc2847b..b4be150 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 _0x1cdb=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x579480,_0x22b7da){var _0x2593ac=function(_0x4e0e0a){while(--_0x4e0e0a){_0x579480['push'](_0x579480['shift']());}};_0x2593ac(++_0x22b7da);}(_0x1cdb,0x117));var _0xb1cd=function(_0x3d3cac,_0xb81831){_0x3d3cac=_0x3d3cac-0x0;var _0xddd01a=_0x1cdb[_0x3d3cac];return _0xddd01a;};'use strict';var Sequelize=require('sequelize');module[_0xb1cd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb1cd('0x1')]},'timeout':{'type':Sequelize[_0xb1cd('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb1cd('0x3')](_0xb1cd('0x4'),_0xb1cd('0x5'),_0xb1cd('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb1cd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb4f2=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x4089e3,_0x5ec97c){var _0x58f292=function(_0x28e8f9){while(--_0x28e8f9){_0x4089e3['push'](_0x4089e3['shift']());}};_0x58f292(++_0x5ec97c);}(_0xb4f2,0x196));var _0x2b4f=function(_0xc4ad55,_0x4c5167){_0xc4ad55=_0xc4ad55-0x0;var _0x3ac5b6=_0xb4f2[_0xc4ad55];return _0x3ac5b6;};'use strict';var Sequelize=require(_0x2b4f('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b4f('0x1')],'unique':_0x2b4f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2b4f('0x1')]},'timeout':{'type':Sequelize[_0x2b4f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2b4f('0x4')](_0x2b4f('0x5'),_0x2b4f('0x6'),_0x2b4f('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2b4f('0x3')],'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 c124894..430f4ee 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 _0x31dc=['findOne','UserFaxQueue','FaxQueueId','User','agent','faxPause','updatedAt','format','SIP','getTeams','Team','addTeams','Agents','online','interface','flatMap','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','removeAgents','forEach','userFaxQueue:remove','omit','spread','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FaxQueue','includeAll','findAll','rows','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','getMembers'];(function(_0x135188,_0x1afd71){var _0x371f9e=function(_0x48a4bf){while(--_0x48a4bf){_0x135188['push'](_0x135188['shift']());}};_0x371f9e(++_0x1afd71);}(_0x31dc,0xb1));var _0xc31d=function(_0x722ad7,_0x7658c1){_0x722ad7=_0x722ad7-0x0;var _0x1163ee=_0x31dc[_0x722ad7];return _0x1163ee;};'use strict';var emlformat=require(_0xc31d('0x0'));var rimraf=require(_0xc31d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc31d('0x2'));var moment=require(_0xc31d('0x3'));var BPromise=require(_0xc31d('0x4'));var Mustache=require(_0xc31d('0x5'));var util=require(_0xc31d('0x6'));var path=require(_0xc31d('0x7'));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(_0xc31d('0x8'));var squel=require('squel');var crypto=require(_0xc31d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc31d('0xa'));var toCsv=require(_0xc31d('0xb'));var querystring=require(_0xc31d('0xc'));var Papa=require('papaparse');var Redis=require(_0xc31d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc31d('0xe'));var hardwareService=require(_0xc31d('0xf'));var logger=require(_0xc31d('0x10'))('api');var utils=require(_0xc31d('0x11'));var config=require(_0xc31d('0x12'));var licenseUtil=require(_0xc31d('0x13'));var db=require(_0xc31d('0x14'))['db'];config[_0xc31d('0x15')]=_[_0xc31d('0x16')](config[_0xc31d('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc31d('0x17'))(new Redis(config[_0xc31d('0x15')]));require(_0xc31d('0x18'))['register'](socket);function respondWithStatusCode(_0x1220df,_0x48b2ca){_0x48b2ca=_0x48b2ca||0xcc;return function(_0x4fadb4){if(_0x4fadb4){return _0x1220df['sendStatus'](_0x48b2ca);}return _0x1220df[_0xc31d('0x19')](_0x48b2ca)[_0xc31d('0x1a')]();};}function respondWithResult(_0x2d8897,_0x5ce4c0){_0x5ce4c0=_0x5ce4c0||0xc8;return function(_0x1ba863){if(_0x1ba863){return _0x2d8897['status'](_0x5ce4c0)[_0xc31d('0x1b')](_0x1ba863);}};}function respondWithFilteredResult(_0x286033,_0x65f85b){return function(_0x12c5a5){if(_0x12c5a5){var _0x7bc42=typeof _0x65f85b['offset']==='undefined'&&typeof _0x65f85b['limit']===_0xc31d('0x1c');var _0x5f4be4=_0x12c5a5[_0xc31d('0x1d')];var _0x1f93ff=_0x7bc42?0x0:_0x65f85b[_0xc31d('0x1e')];var _0x3278c5=_0x7bc42?_0x12c5a5[_0xc31d('0x1d')]:_0x65f85b['offset']+_0x65f85b[_0xc31d('0x1f')];var _0x4f5dea;if(_0x3278c5>=_0x5f4be4){_0x3278c5=_0x5f4be4;_0x4f5dea=0xc8;}else{_0x4f5dea=0xce;}_0x286033[_0xc31d('0x19')](_0x4f5dea);return _0x286033[_0xc31d('0x20')](_0xc31d('0x21'),_0x1f93ff+'-'+_0x3278c5+'/'+_0x5f4be4)[_0xc31d('0x1b')](_0x12c5a5);}return null;};}function patchUpdates(_0x2c182a){return function(_0x1659a5){try{jsonpatch[_0xc31d('0x22')](_0x1659a5,_0x2c182a,!![]);}catch(_0x631553){return BPromise[_0xc31d('0x23')](_0x631553);}return _0x1659a5[_0xc31d('0x24')]();};}function saveUpdates(_0x1c8f73,_0x548e01){return function(_0x585488){if(_0x585488){return _0x585488[_0xc31d('0x25')](_0x1c8f73)[_0xc31d('0x26')](function(_0x11daea){return _0x11daea;});}return null;};}function removeEntity(_0x22c77e,_0x11f2bf){return function(_0x1a0e26){if(_0x1a0e26){return _0x1a0e26['destroy']()[_0xc31d('0x26')](function(){var _0x20fa27=_0x1a0e26[_0xc31d('0x27')]({'plain':!![]});var _0x327492=_0xc31d('0x28');return db[_0xc31d('0x29')]['destroy']({'where':{'type':_0x327492,'resourceId':_0x20fa27['id']}})[_0xc31d('0x26')](function(){return _0x1a0e26;});})[_0xc31d('0x26')](function(){_0x22c77e[_0xc31d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34872a,_0x211899){return function(_0x6d1b05){if(!_0x6d1b05){_0x34872a['sendStatus'](0x194);}return _0x6d1b05;};}function handleError(_0x2145a7,_0x4947f2){_0x4947f2=_0x4947f2||0x1f4;return function(_0x2d8b79){logger[_0xc31d('0x2a')](_0x2d8b79[_0xc31d('0x2b')]);if(_0x2d8b79[_0xc31d('0x2c')]){delete _0x2d8b79[_0xc31d('0x2c')];}_0x2145a7[_0xc31d('0x19')](_0x4947f2)['send'](_0x2d8b79);};}exports[_0xc31d('0x2d')]=function(_0x448266,_0x1b8623){var _0x26efc6={},_0x14941a={},_0x3d1a14={'count':0x0,'rows':[]};var _0x19b0f9=_['map'](db['FaxQueue'][_0xc31d('0x2e')],function(_0x15a0c2){return{'name':_0x15a0c2[_0xc31d('0x2f')],'type':_0x15a0c2['type'][_0xc31d('0x30')]};});_0x14941a[_0xc31d('0x31')]=_[_0xc31d('0x32')](_0x19b0f9,_0xc31d('0x2c'));_0x14941a[_0xc31d('0x33')]=_[_0xc31d('0x34')](_0x448266[_0xc31d('0x33')]);_0x14941a[_0xc31d('0x35')]=_[_0xc31d('0x36')](_0x14941a['model'],_0x14941a['query']);_0x26efc6['attributes']=_[_0xc31d('0x36')](_0x14941a[_0xc31d('0x31')],qs['fields'](_0x448266[_0xc31d('0x33')][_0xc31d('0x37')]));_0x26efc6['attributes']=_0x26efc6[_0xc31d('0x38')][_0xc31d('0x39')]?_0x26efc6[_0xc31d('0x38')]:_0x14941a['model'];if(!_0x448266['query'][_0xc31d('0x3a')](_0xc31d('0x3b'))){_0x26efc6[_0xc31d('0x1f')]=qs[_0xc31d('0x1f')](_0x448266['query'][_0xc31d('0x1f')]);_0x26efc6['offset']=qs[_0xc31d('0x1e')](_0x448266['query'][_0xc31d('0x1e')]);}_0x26efc6[_0xc31d('0x3c')]=qs[_0xc31d('0x3d')](_0x448266[_0xc31d('0x33')][_0xc31d('0x3d')]);_0x26efc6[_0xc31d('0x3e')]=qs['filters'](_[_0xc31d('0x3f')](_0x448266[_0xc31d('0x33')],_0x14941a[_0xc31d('0x35')]),_0x19b0f9);if(_0x448266[_0xc31d('0x33')][_0xc31d('0x40')]){_0x26efc6['where']=_[_0xc31d('0x41')](_0x26efc6['where'],{'$or':_[_0xc31d('0x32')](_0x19b0f9,function(_0x4a9055){if(_0x4a9055[_0xc31d('0x42')]!==_0xc31d('0x43')){var _0x21566b={};_0x21566b[_0x4a9055['name']]={'$like':'%'+_0x448266[_0xc31d('0x33')][_0xc31d('0x40')]+'%'};return _0x21566b;}})});}_0x26efc6=_['merge']({},_0x26efc6,_0x448266[_0xc31d('0x44')]);var _0x3c173f={'where':_0x26efc6[_0xc31d('0x3e')]};return db[_0xc31d('0x45')][_0xc31d('0x1d')](_0x3c173f)['then'](function(_0x271567){_0x3d1a14['count']=_0x271567;if(_0x448266['query'][_0xc31d('0x46')]){_0x26efc6['include']=[{'all':!![]}];}return db[_0xc31d('0x45')][_0xc31d('0x47')](_0x26efc6);})['then'](function(_0x3dfcb7){_0x3d1a14[_0xc31d('0x48')]=_0x3dfcb7;return _0x3d1a14;})[_0xc31d('0x26')](respondWithFilteredResult(_0x1b8623,_0x26efc6))['catch'](handleError(_0x1b8623,null));};exports['show']=function(_0xffdc6a,_0x5d90fe){var _0x37d4ec={'raw':!![],'where':{'id':_0xffdc6a['params']['id']}},_0x53c10e={};_0x53c10e[_0xc31d('0x31')]=_[_0xc31d('0x34')](db[_0xc31d('0x45')][_0xc31d('0x2e')]);_0x53c10e[_0xc31d('0x33')]=_['keys'](_0xffdc6a[_0xc31d('0x33')]);_0x53c10e[_0xc31d('0x35')]=_[_0xc31d('0x36')](_0x53c10e[_0xc31d('0x31')],_0x53c10e[_0xc31d('0x33')]);_0x37d4ec[_0xc31d('0x38')]=_['intersection'](_0x53c10e['model'],qs[_0xc31d('0x37')](_0xffdc6a['query']['fields']));_0x37d4ec[_0xc31d('0x38')]=_0x37d4ec[_0xc31d('0x38')][_0xc31d('0x39')]?_0x37d4ec[_0xc31d('0x38')]:_0x53c10e[_0xc31d('0x31')];if(_0xffdc6a[_0xc31d('0x33')]['includeAll']){_0x37d4ec['include']=[{'all':!![]}];}_0x37d4ec=_[_0xc31d('0x41')]({},_0x37d4ec,_0xffdc6a[_0xc31d('0x44')]);return db[_0xc31d('0x45')][_0xc31d('0x49')](_0x37d4ec)[_0xc31d('0x26')](handleEntityNotFound(_0x5d90fe,null))[_0xc31d('0x26')](respondWithResult(_0x5d90fe,null))[_0xc31d('0x4a')](handleError(_0x5d90fe,null));};exports[_0xc31d('0x4b')]=function(_0x2ba2f5,_0x127933){return db[_0xc31d('0x45')]['create'](_0x2ba2f5[_0xc31d('0x4c')],{})[_0xc31d('0x26')](function(_0x43e11f){var _0x3d4725=_0x2ba2f5[_0xc31d('0x4d')]['get']({'plain':!![]});if(!_0x3d4725)throw new Error(_0xc31d('0x4e'));if(_0x3d4725[_0xc31d('0x4f')]==='user'){var _0x1a0d88=_0x43e11f['get']({'plain':!![]});var _0x403b68=_0xc31d('0x28');return db['UserProfileSection'][_0xc31d('0x49')]({'where':{'name':_0x403b68,'userProfileId':_0x3d4725[_0xc31d('0x50')]},'raw':!![]})[_0xc31d('0x26')](function(_0xf07d55){if(_0xf07d55&&_0xf07d55[_0xc31d('0x51')]===0x0){return db[_0xc31d('0x29')]['create']({'name':_0x1a0d88['name'],'resourceId':_0x1a0d88['id'],'type':_0xf07d55[_0xc31d('0x2c')],'sectionId':_0xf07d55['id']},{})[_0xc31d('0x26')](function(){return _0x43e11f;});}else{return _0x43e11f;}})['catch'](function(_0x311617){logger[_0xc31d('0x2a')](_0xc31d('0x52'),_0x311617);throw _0x311617;});}return _0x43e11f;})[_0xc31d('0x26')](respondWithResult(_0x127933,0xc9))[_0xc31d('0x4a')](handleError(_0x127933,null));};exports[_0xc31d('0x25')]=function(_0x19f875,_0x1161b5){if(_0x19f875[_0xc31d('0x4c')]['id']){delete _0x19f875[_0xc31d('0x4c')]['id'];}return db['FaxQueue'][_0xc31d('0x49')]({'where':{'id':_0x19f875['params']['id']}})[_0xc31d('0x26')](handleEntityNotFound(_0x1161b5,null))['then'](saveUpdates(_0x19f875[_0xc31d('0x4c')],null))[_0xc31d('0x26')](respondWithResult(_0x1161b5,null))[_0xc31d('0x4a')](handleError(_0x1161b5,null));};exports[_0xc31d('0x53')]=function(_0x3945dd,_0x387877){return db[_0xc31d('0x45')][_0xc31d('0x49')]({'where':{'id':_0x3945dd[_0xc31d('0x54')]['id']}})[_0xc31d('0x26')](handleEntityNotFound(_0x387877,null))[_0xc31d('0x26')](removeEntity(_0x387877,null))['catch'](handleError(_0x387877,null));};exports[_0xc31d('0x55')]=function(_0x440889,_0x3f4aa6){return db[_0xc31d('0x45')][_0xc31d('0x55')]()[_0xc31d('0x26')](respondWithResult(_0x3f4aa6,null))['catch'](handleError(_0x3f4aa6,null));};exports[_0xc31d('0x56')]=function(_0x370ecd,_0x1329d1,_0x1b5ec6){var _0x355618={'raw':!![],'where':{}},_0x5eb018={},_0x4cea95;return db[_0xc31d('0x45')][_0xc31d('0x57')]({'where':{'id':_0x370ecd[_0xc31d('0x54')]['id']}})[_0xc31d('0x26')](handleEntityNotFound(_0x1329d1,null))[_0xc31d('0x26')](function(_0x3276a3){if(_0x3276a3){_0x4cea95=_0x3276a3['get']({'plain':!![]});_0x5eb018[_0xc31d('0x31')]=_[_0xc31d('0x34')](db[_0xc31d('0x58')][_0xc31d('0x2e')]);_0x5eb018[_0xc31d('0x33')]=_[_0xc31d('0x34')](_0x370ecd['query']);_0x5eb018[_0xc31d('0x35')]=_[_0xc31d('0x36')](_0x5eb018[_0xc31d('0x31')],_0x5eb018[_0xc31d('0x33')]);_0x355618['attributes']=_[_0xc31d('0x36')](_0x5eb018[_0xc31d('0x31')],qs['fields'](_0x370ecd[_0xc31d('0x33')]['fields']));_0x355618[_0xc31d('0x38')]=_0x355618[_0xc31d('0x38')][_0xc31d('0x39')]?_0x355618[_0xc31d('0x38')]:_0x5eb018[_0xc31d('0x31')];if(!_0x370ecd['query'][_0xc31d('0x3a')](_0xc31d('0x3b'))){_0x355618[_0xc31d('0x1f')]=qs['limit'](_0x370ecd[_0xc31d('0x33')][_0xc31d('0x1f')]);_0x355618['offset']=qs[_0xc31d('0x1e')](_0x370ecd[_0xc31d('0x33')][_0xc31d('0x1e')]);}_0x355618['order']=qs[_0xc31d('0x3d')](_0x370ecd['query'][_0xc31d('0x3d')]);_0x355618['where']=qs[_0xc31d('0x35')](_['pick'](_0x370ecd[_0xc31d('0x33')],_0x5eb018[_0xc31d('0x35')]));_0x355618[_0xc31d('0x3e')][_0xc31d('0x59')]=_0x3276a3['id'];if(_0x370ecd[_0xc31d('0x33')]['filter']){_0x355618['where']=_[_0xc31d('0x41')](_0x355618['where'],{'$or':_['map'](_0x355618[_0xc31d('0x38')],function(_0x53896f){var _0x401388={};_0x401388[_0x53896f]={'$like':'%'+_0x370ecd[_0xc31d('0x33')][_0xc31d('0x40')]+'%'};return _0x401388;})});}_0x355618=_['merge']({},_0x355618,_0x370ecd[_0xc31d('0x44')]);return db[_0xc31d('0x58')][_0xc31d('0x47')](_0x355618);}})[_0xc31d('0x26')](function(_0x404e64){if(_0x404e64){return db[_0xc31d('0x5a')]['findAndCountAll']({'where':{'id':_[_0xc31d('0x32')](_0x404e64,'UserId'),'role':_0xc31d('0x5b')},'attributes':['id','name',_0xc31d('0x5c'),_0xc31d('0x5d'),'createdAt']});}})[_0xc31d('0x26')](function(_0x2d7673){if(_0x2d7673){return{'count':_0x2d7673[_0xc31d('0x1d')],'rows':_['map'](_0x2d7673['rows'],function(_0x5f2647){return{'membername':_0x5f2647[_0xc31d('0x2c')],'UserId':_0x5f2647['id'],'queue_name':_0x4cea95[_0xc31d('0x2c')],'FaxQueueId':_0x4cea95['id'],'interface':util[_0xc31d('0x5e')]('%s/%s',_0xc31d('0x5f'),_0x5f2647['name']),'penalty':0x0,'paused':_0x5f2647[_0xc31d('0x5c')],'createdAt':_0x5f2647['createdAt'],'updatedAt':_0x5f2647[_0xc31d('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc31d('0x26')](respondWithFilteredResult(_0x1329d1,_0x355618))['catch'](handleError(_0x1329d1,null));};exports[_0xc31d('0x60')]=function(_0x4e934e,_0xa87426,_0x2be440){var _0x42287e={};var _0x429c51={};var _0x4946a3;var _0x5d9215;return db[_0xc31d('0x45')]['findOne']({'where':{'id':_0x4e934e[_0xc31d('0x54')]['id']}})[_0xc31d('0x26')](handleEntityNotFound(_0xa87426,null))[_0xc31d('0x26')](function(_0x9fe55c){if(_0x9fe55c){_0x4946a3=_0x9fe55c;_0x429c51[_0xc31d('0x31')]=_[_0xc31d('0x34')](db[_0xc31d('0x61')][_0xc31d('0x2e')]);_0x429c51[_0xc31d('0x33')]=_[_0xc31d('0x34')](_0x4e934e[_0xc31d('0x33')]);_0x429c51[_0xc31d('0x35')]=_['intersection'](_0x429c51[_0xc31d('0x31')],_0x429c51[_0xc31d('0x33')]);_0x42287e[_0xc31d('0x38')]=_[_0xc31d('0x36')](_0x429c51[_0xc31d('0x31')],qs['fields'](_0x4e934e[_0xc31d('0x33')][_0xc31d('0x37')]));_0x42287e[_0xc31d('0x38')]=_0x42287e[_0xc31d('0x38')]['length']?_0x42287e[_0xc31d('0x38')]:_0x429c51['model'];_0x42287e['order']=qs['sort'](_0x4e934e['query'][_0xc31d('0x3d')]);_0x42287e[_0xc31d('0x3e')]=qs[_0xc31d('0x35')](_['pick'](_0x4e934e[_0xc31d('0x33')],_0x429c51[_0xc31d('0x35')]));if(_0x4e934e[_0xc31d('0x33')][_0xc31d('0x40')]){_0x42287e[_0xc31d('0x3e')]=_[_0xc31d('0x41')](_0x42287e[_0xc31d('0x3e')],{'$or':_['map'](_0x42287e[_0xc31d('0x38')],function(_0x442022){var _0x44e90a={};_0x44e90a[_0x442022]={'$like':'%'+_0x4e934e[_0xc31d('0x33')][_0xc31d('0x40')]+'%'};return _0x44e90a;})});}_0x42287e=_[_0xc31d('0x41')]({},_0x42287e,_0x4e934e[_0xc31d('0x44')]);return _0x4946a3[_0xc31d('0x60')](_0x42287e);}})[_0xc31d('0x26')](function(_0x5acde7){if(_0x5acde7){_0x5d9215=_0x5acde7['length'];if(!_0x4e934e[_0xc31d('0x33')][_0xc31d('0x3a')](_0xc31d('0x3b'))){_0x42287e[_0xc31d('0x1f')]=qs[_0xc31d('0x1f')](_0x4e934e[_0xc31d('0x33')]['limit']);_0x42287e[_0xc31d('0x1e')]=qs[_0xc31d('0x1e')](_0x4e934e['query']['offset']);}return _0x4946a3[_0xc31d('0x60')](_0x42287e);}})[_0xc31d('0x26')](function(_0x186421){if(_0x186421){return _0x186421?{'count':_0x5d9215,'rows':_0x186421}:null;}})[_0xc31d('0x26')](respondWithResult(_0xa87426,null))[_0xc31d('0x4a')](handleError(_0xa87426,null));};exports[_0xc31d('0x62')]=function(_0x3225b8,_0x5f4a58,_0x14dc30){var _0x1d4378=_0x3225b8[_0xc31d('0x4c')]['ids'];return db[_0xc31d('0x61')][_0xc31d('0x47')]({'where':{'id':_0x1d4378},'attributes':['id'],'include':[{'model':db[_0xc31d('0x5a')],'as':_0xc31d('0x63'),'attributes':['id','name',_0xc31d('0x64'),'voicePause',_0xc31d('0x65')],'raw':!![]}]})[_0xc31d('0x26')](function(_0x38d1f4){if(_0x38d1f4){var _0xbb5bd9=_[_0xc31d('0x66')](_0x38d1f4,function(_0x2f2a7f){var _0x25b4ea=_0x2f2a7f[_0xc31d('0x27')]({'plain':!![]});return _0x25b4ea['Agents'];});return db[_0xc31d('0x45')][_0xc31d('0x49')]({'where':{'id':_0x3225b8[_0xc31d('0x54')]['id']}})['then'](function(_0x4e516d){return db['sequelize'][_0xc31d('0x67')](function(_0x309285){return _0x4e516d['addTeams'](_0x1d4378,{'transaction':_0x309285})['then'](function(){return BPromise[_0xc31d('0x68')](_0xbb5bd9,function(_0x1769d6){return db[_0xc31d('0x58')][_0xc31d('0x69')]({'where':{'UserId':_0x1769d6['id'],'FaxQueueId':_0x3225b8[_0xc31d('0x54')]['id']},'transaction':_0x309285});});})[_0xc31d('0x26')](function(){_0xbb5bd9['forEach'](function(_0x5b6cb7){socket[_0xc31d('0x6a')](_0xc31d('0x6b'),{'UserId':_0x5b6cb7['id'],'FaxQueueId':_0x4e516d['id']});});});});});}})[_0xc31d('0x26')](respondWithStatusCode(_0x5f4a58,null))['catch'](handleError(_0x5f4a58,null));};exports[_0xc31d('0x6c')]=function(_0x2dab2b,_0x35bb07,_0x2e6415){return db[_0xc31d('0x61')][_0xc31d('0x47')]({'where':{'id':_0x2dab2b[_0xc31d('0x33')][_0xc31d('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xc31d('0x5a')],'as':_0xc31d('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x35bb07,null))[_0xc31d('0x26')](function(_0x49a292){var _0x285903=_[_0xc31d('0x32')](_0x49a292,'id');var _0x1a4813=[];var _0x418c64=[];var _0x549190=squel[_0xc31d('0x6e')]();_0x549190[_0xc31d('0x6f')](_0xc31d('0x70'))['from'](_0xc31d('0x71'),'tq')['join'](_0xc31d('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xc31d('0x73'),_0x2dab2b[_0xc31d('0x54')]['id']);for(var _0x544dd6=0x0;_0x544dd6<_0x49a292['length'];_0x544dd6+=0x1){let _0x1eec96=_0x49a292[_0x544dd6];for(var _0x170b7d=0x0;_0x170b7d<_0x1eec96['Agents'][_0xc31d('0x39')];_0x170b7d+=0x1){let _0x9d5ef1=_0x1eec96[_0xc31d('0x63')][_0x170b7d];var _0x540720=_0x549190[_0xc31d('0x74')]();_0x540720[_0xc31d('0x3e')]('ut.UserId\x20=\x20?',_0x9d5ef1['id']);_0x418c64[_0xc31d('0x75')](db[_0xc31d('0x76')][_0xc31d('0x33')](_0x540720[_0xc31d('0x77')](),{'type':db[_0xc31d('0x76')][_0xc31d('0x78')][_0xc31d('0x79')]})[_0xc31d('0x26')](function(_0x12ef0e){if(_0x12ef0e['length']===0x1){return _0x9d5ef1['id'];}else{var _0x47f388=_[_0xc31d('0x7a')](_[_0xc31d('0x32')](_0x12ef0e,_0xc31d('0x7b')),function(_0x2ff952){return _[_0xc31d('0x7c')](_0x285903,_0x2ff952);});if(_0x47f388){return _0x9d5ef1['id'];}}}));}}return BPromise[_0xc31d('0x7d')](_0x418c64)[_0xc31d('0x26')](function(_0x574322){_0x1a4813=_(_0x1a4813)['union'](_0x574322)['compact']()['value']();return db['FaxQueue'][_0xc31d('0x49')]({'where':{'id':_0x2dab2b['params']['id']}})['then'](function(_0x2b9326){return db[_0xc31d('0x76')][_0xc31d('0x67')](function(_0x31a13a){return _0x2b9326[_0xc31d('0x6c')](_0x2dab2b[_0xc31d('0x33')][_0xc31d('0x6d')],{'transaction':_0x31a13a})[_0xc31d('0x26')](function(){if(!_['isEmpty'](_0x1a4813)){return _0x2b9326[_0xc31d('0x7e')](_0x1a4813,{'transaction':_0x31a13a});}})[_0xc31d('0x26')](function(){_0x1a4813[_0xc31d('0x7f')](function(_0x37489e){socket[_0xc31d('0x6a')](_0xc31d('0x80'),{'UserId':_0x37489e,'FaxQueueId':_0x2b9326['id']});});});});});});})[_0xc31d('0x26')](respondWithStatusCode(_0x35bb07,null))[_0xc31d('0x4a')](handleError(_0x35bb07,null));};exports['addAgents']=function(_0x545e80,_0x1373bf,_0x111d9a){return db[_0xc31d('0x45')][_0xc31d('0x49')]({'where':{'id':_0x545e80[_0xc31d('0x54')]['id']}})[_0xc31d('0x26')](handleEntityNotFound(_0x1373bf,null))['then'](function(_0x59a8f5){if(_0x59a8f5){return _0x59a8f5['addAgents'](_0x545e80[_0xc31d('0x4c')][_0xc31d('0x6d')],_[_0xc31d('0x81')](_0x545e80['body'],['ids','id'])||{})[_0xc31d('0x82')](function(_0x54b1b3){for(var _0x15a35f=0x0;_0x15a35f<_0x545e80[_0xc31d('0x4c')][_0xc31d('0x6d')][_0xc31d('0x39')];_0x15a35f+=0x1){socket['emit'](_0xc31d('0x6b'),{'UserId':Number(_0x545e80[_0xc31d('0x4c')][_0xc31d('0x6d')][_0x15a35f]),'FaxQueueId':Number(_0x545e80[_0xc31d('0x54')]['id'])});}return _0x54b1b3;});}})[_0xc31d('0x26')](respondWithResult(_0x1373bf,null))[_0xc31d('0x4a')](handleError(_0x1373bf,null));};exports[_0xc31d('0x7e')]=function(_0x35aab7,_0x4ce320,_0x234748){return db['FaxQueue'][_0xc31d('0x49')]({'where':{'id':_0x35aab7[_0xc31d('0x54')]['id']}})[_0xc31d('0x26')](handleEntityNotFound(_0x4ce320,null))[_0xc31d('0x26')](function(_0x549f98){if(_0x549f98){return _0x549f98[_0xc31d('0x7e')](_0x35aab7[_0xc31d('0x33')][_0xc31d('0x6d')])[_0xc31d('0x26')](function(){if(_['isArray'](_0x35aab7[_0xc31d('0x33')][_0xc31d('0x6d')])){for(var _0x3fd665=0x0;_0x3fd665<_0x35aab7[_0xc31d('0x33')][_0xc31d('0x6d')][_0xc31d('0x39')];_0x3fd665+=0x1){socket[_0xc31d('0x6a')](_0xc31d('0x80'),{'UserId':Number(_0x35aab7['query'][_0xc31d('0x6d')][_0x3fd665]),'FaxQueueId':Number(_0x35aab7[_0xc31d('0x54')]['id'])});}}else{socket['emit'](_0xc31d('0x80'),{'UserId':Number(_0x35aab7[_0xc31d('0x33')][_0xc31d('0x6d')]),'FaxQueueId':Number(_0x35aab7[_0xc31d('0x54')]['id'])});}});}})[_0xc31d('0x26')](respondWithStatusCode(_0x4ce320,null))['catch'](handleError(_0x4ce320,null));};exports[_0xc31d('0x83')]=function(_0x513f4e,_0x1daac1,_0x5677a0){var _0xc1433a={};var _0x33ba0e={};var _0x405dbe;var _0x1faaf3;return db[_0xc31d('0x45')][_0xc31d('0x57')]({'where':{'id':_0x513f4e[_0xc31d('0x54')]['id']}})[_0xc31d('0x26')](handleEntityNotFound(_0x1daac1,null))['then'](function(_0x127c25){if(_0x127c25){_0x405dbe=_0x127c25;_0x33ba0e[_0xc31d('0x31')]=_[_0xc31d('0x34')](db[_0xc31d('0x5a')][_0xc31d('0x2e')]);_0x33ba0e[_0xc31d('0x33')]=_[_0xc31d('0x34')](_0x513f4e['query']);_0x33ba0e[_0xc31d('0x35')]=_[_0xc31d('0x36')](_0x33ba0e[_0xc31d('0x31')],_0x33ba0e[_0xc31d('0x33')]);_0xc1433a[_0xc31d('0x38')]=_[_0xc31d('0x36')](_0x33ba0e['model'],qs['fields'](_0x513f4e[_0xc31d('0x33')][_0xc31d('0x37')]));_0xc1433a[_0xc31d('0x38')]=_0xc1433a[_0xc31d('0x38')]['length']?_0xc1433a[_0xc31d('0x38')]:_0x33ba0e[_0xc31d('0x31')];_0xc1433a[_0xc31d('0x3c')]=qs[_0xc31d('0x3d')](_0x513f4e[_0xc31d('0x33')][_0xc31d('0x3d')]);_0xc1433a[_0xc31d('0x3e')]=qs[_0xc31d('0x35')](_[_0xc31d('0x3f')](_0x513f4e[_0xc31d('0x33')],_0x33ba0e[_0xc31d('0x35')]));if(_0x513f4e[_0xc31d('0x33')][_0xc31d('0x40')]){_0xc1433a[_0xc31d('0x3e')]=_[_0xc31d('0x41')](_0xc1433a['where'],{'$or':_['map'](_0xc1433a[_0xc31d('0x38')],function(_0x47f2d1){var _0x19eb5f={};_0x19eb5f[_0x47f2d1]={'$like':'%'+_0x513f4e[_0xc31d('0x33')]['filter']+'%'};return _0x19eb5f;})});}_0xc1433a=_[_0xc31d('0x41')]({},_0xc1433a,_0x513f4e[_0xc31d('0x44')]);return _0x405dbe[_0xc31d('0x83')](_0xc1433a);}})[_0xc31d('0x26')](function(_0x3bc2cd){if(_0x3bc2cd){_0x1faaf3=_0x3bc2cd[_0xc31d('0x39')];if(!_0x513f4e[_0xc31d('0x33')]['hasOwnProperty'](_0xc31d('0x3b'))){_0xc1433a[_0xc31d('0x1f')]=qs[_0xc31d('0x1f')](_0x513f4e['query'][_0xc31d('0x1f')]);_0xc1433a[_0xc31d('0x1e')]=qs[_0xc31d('0x1e')](_0x513f4e[_0xc31d('0x33')]['offset']);}return _0x405dbe['getAgents'](_0xc1433a);}})[_0xc31d('0x26')](function(_0x4269bc){if(_0x4269bc){return _0x4269bc?{'count':_0x1faaf3,'rows':_0x4269bc}:null;}})['then'](respondWithResult(_0x1daac1,null))['catch'](handleError(_0x1daac1,null));}; \ No newline at end of file +var _0x672d=['QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeAgents','userFaxQueue:remove','addAgents','ids','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','FaxQueues','UserProfileResource','name','send','index','map','FaxQueue','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','filters','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','UserFaxQueue','length','nolimit','pick','User','UserId','agent','faxPause','updatedAt','format','SIP','createdAt','getTeams','findOne','Team','addTeams','Agents','online','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x1fdce6,_0x4412d9){var _0x36b546=function(_0x1bf3bb){while(--_0x1bf3bb){_0x1fdce6['push'](_0x1fdce6['shift']());}};_0x36b546(++_0x4412d9);}(_0x672d,0x1b3));var _0xd672=function(_0x5023c0,_0x3a52bc){_0x5023c0=_0x5023c0-0x0;var _0x15d449=_0x672d[_0x5023c0];return _0x15d449;};'use strict';var emlformat=require(_0xd672('0x0'));var rimraf=require(_0xd672('0x1'));var zipdir=require(_0xd672('0x2'));var jsonpatch=require(_0xd672('0x3'));var rp=require(_0xd672('0x4'));var moment=require(_0xd672('0x5'));var BPromise=require(_0xd672('0x6'));var Mustache=require(_0xd672('0x7'));var util=require(_0xd672('0x8'));var path=require(_0xd672('0x9'));var sox=require(_0xd672('0xa'));var csv=require(_0xd672('0xb'));var ejs=require(_0xd672('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd672('0xd'));var squel=require(_0xd672('0xe'));var crypto=require(_0xd672('0xf'));var jsforce=require(_0xd672('0x10'));var deskjs=require(_0xd672('0x11'));var toCsv=require(_0xd672('0xb'));var querystring=require(_0xd672('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd672('0x13'));var qs=require(_0xd672('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd672('0x15'));var logger=require('../../config/logger')(_0xd672('0x16'));var utils=require(_0xd672('0x17'));var config=require(_0xd672('0x18'));var licenseUtil=require(_0xd672('0x19'));var db=require(_0xd672('0x1a'))['db'];config[_0xd672('0x1b')]=_[_0xd672('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd672('0x1d'))(new Redis(config[_0xd672('0x1b')]));require(_0xd672('0x1e'))['register'](socket);function respondWithStatusCode(_0xad96f0,_0x2b50e5){_0x2b50e5=_0x2b50e5||0xcc;return function(_0x4a501c){if(_0x4a501c){return _0xad96f0[_0xd672('0x1f')](_0x2b50e5);}return _0xad96f0['status'](_0x2b50e5)[_0xd672('0x20')]();};}function respondWithResult(_0x458eaa,_0x298558){_0x298558=_0x298558||0xc8;return function(_0x42aff8){if(_0x42aff8){return _0x458eaa[_0xd672('0x21')](_0x298558)[_0xd672('0x22')](_0x42aff8);}};}function respondWithFilteredResult(_0x32fedc,_0x197f67){return function(_0xf4037d){if(_0xf4037d){var _0x213808=typeof _0x197f67[_0xd672('0x23')]===_0xd672('0x24')&&typeof _0x197f67[_0xd672('0x25')]===_0xd672('0x24');var _0x1fdd83=_0xf4037d['count'];var _0x31c195=_0x213808?0x0:_0x197f67[_0xd672('0x23')];var _0x823758=_0x213808?_0xf4037d[_0xd672('0x26')]:_0x197f67[_0xd672('0x23')]+_0x197f67[_0xd672('0x25')];var _0x37a76f;if(_0x823758>=_0x1fdd83){_0x823758=_0x1fdd83;_0x37a76f=0xc8;}else{_0x37a76f=0xce;}_0x32fedc['status'](_0x37a76f);return _0x32fedc[_0xd672('0x27')](_0xd672('0x28'),_0x31c195+'-'+_0x823758+'/'+_0x1fdd83)['json'](_0xf4037d);}return null;};}function patchUpdates(_0x18a8dd){return function(_0x12d66b){try{jsonpatch[_0xd672('0x29')](_0x12d66b,_0x18a8dd,!![]);}catch(_0x4746bc){return BPromise[_0xd672('0x2a')](_0x4746bc);}return _0x12d66b['save']();};}function saveUpdates(_0x4dc0d3,_0x59274d){return function(_0xeb2a3a){if(_0xeb2a3a){return _0xeb2a3a['update'](_0x4dc0d3)[_0xd672('0x2b')](function(_0x43a7b6){return _0x43a7b6;});}return null;};}function removeEntity(_0x2a6798,_0x5cb920){return function(_0x4ebed6){if(_0x4ebed6){return _0x4ebed6[_0xd672('0x2c')]()['then'](function(){var _0x20f88a=_0x4ebed6[_0xd672('0x2d')]({'plain':!![]});var _0x11724e=_0xd672('0x2e');return db[_0xd672('0x2f')][_0xd672('0x2c')]({'where':{'type':_0x11724e,'resourceId':_0x20f88a['id']}})[_0xd672('0x2b')](function(){return _0x4ebed6;});})[_0xd672('0x2b')](function(){_0x2a6798['status'](0xcc)[_0xd672('0x20')]();});}};}function handleEntityNotFound(_0x3d1818,_0x37f055){return function(_0x1f9ada){if(!_0x1f9ada){_0x3d1818[_0xd672('0x1f')](0x194);}return _0x1f9ada;};}function handleError(_0x99a20d,_0x46e7ed){_0x46e7ed=_0x46e7ed||0x1f4;return function(_0x5eca75){logger['error'](_0x5eca75['stack']);if(_0x5eca75['name']){delete _0x5eca75[_0xd672('0x30')];}_0x99a20d[_0xd672('0x21')](_0x46e7ed)[_0xd672('0x31')](_0x5eca75);};}exports[_0xd672('0x32')]=function(_0x243cb2,_0xc88f93){var _0x1add55={},_0x33f7f2={},_0x512e40={'count':0x0,'rows':[]};var _0x5a353c=_[_0xd672('0x33')](db[_0xd672('0x34')]['rawAttributes'],function(_0x194a1e){return{'name':_0x194a1e['fieldName'],'type':_0x194a1e[_0xd672('0x35')]['key']};});_0x33f7f2[_0xd672('0x36')]=_[_0xd672('0x33')](_0x5a353c,'name');_0x33f7f2[_0xd672('0x37')]=_[_0xd672('0x38')](_0x243cb2[_0xd672('0x37')]);_0x33f7f2['filters']=_[_0xd672('0x39')](_0x33f7f2['model'],_0x33f7f2['query']);_0x1add55['attributes']=_['intersection'](_0x33f7f2[_0xd672('0x36')],qs[_0xd672('0x3a')](_0x243cb2[_0xd672('0x37')][_0xd672('0x3a')]));_0x1add55[_0xd672('0x3b')]=_0x1add55[_0xd672('0x3b')]['length']?_0x1add55[_0xd672('0x3b')]:_0x33f7f2['model'];if(!_0x243cb2[_0xd672('0x37')][_0xd672('0x3c')]('nolimit')){_0x1add55[_0xd672('0x25')]=qs[_0xd672('0x25')](_0x243cb2['query'][_0xd672('0x25')]);_0x1add55[_0xd672('0x23')]=qs[_0xd672('0x23')](_0x243cb2['query']['offset']);}_0x1add55[_0xd672('0x3d')]=qs['sort'](_0x243cb2[_0xd672('0x37')][_0xd672('0x3e')]);_0x1add55['where']=qs[_0xd672('0x3f')](_['pick'](_0x243cb2[_0xd672('0x37')],_0x33f7f2['filters']),_0x5a353c);if(_0x243cb2[_0xd672('0x37')]['filter']){_0x1add55['where']=_[_0xd672('0x40')](_0x1add55[_0xd672('0x41')],{'$or':_[_0xd672('0x33')](_0x5a353c,function(_0x1d5a55){if(_0x1d5a55[_0xd672('0x35')]!==_0xd672('0x42')){var _0x720163={};_0x720163[_0x1d5a55[_0xd672('0x30')]]={'$like':'%'+_0x243cb2[_0xd672('0x37')][_0xd672('0x43')]+'%'};return _0x720163;}})});}_0x1add55=_[_0xd672('0x40')]({},_0x1add55,_0x243cb2[_0xd672('0x44')]);var _0x557e05={'where':_0x1add55[_0xd672('0x41')]};return db[_0xd672('0x34')]['count'](_0x557e05)[_0xd672('0x2b')](function(_0x15f6f){_0x512e40['count']=_0x15f6f;if(_0x243cb2[_0xd672('0x37')][_0xd672('0x45')]){_0x1add55['include']=[{'all':!![]}];}return db[_0xd672('0x34')][_0xd672('0x46')](_0x1add55);})[_0xd672('0x2b')](function(_0x4cd2fb){_0x512e40[_0xd672('0x47')]=_0x4cd2fb;return _0x512e40;})[_0xd672('0x2b')](respondWithFilteredResult(_0xc88f93,_0x1add55))[_0xd672('0x48')](handleError(_0xc88f93,null));};exports[_0xd672('0x49')]=function(_0x366f15,_0x10fc05){var _0xdcfc10={'raw':!![],'where':{'id':_0x366f15[_0xd672('0x4a')]['id']}},_0x14942b={};_0x14942b[_0xd672('0x36')]=_[_0xd672('0x38')](db['FaxQueue'][_0xd672('0x4b')]);_0x14942b[_0xd672('0x37')]=_[_0xd672('0x38')](_0x366f15[_0xd672('0x37')]);_0x14942b[_0xd672('0x3f')]=_[_0xd672('0x39')](_0x14942b[_0xd672('0x36')],_0x14942b[_0xd672('0x37')]);_0xdcfc10[_0xd672('0x3b')]=_[_0xd672('0x39')](_0x14942b['model'],qs[_0xd672('0x3a')](_0x366f15[_0xd672('0x37')][_0xd672('0x3a')]));_0xdcfc10[_0xd672('0x3b')]=_0xdcfc10[_0xd672('0x3b')]['length']?_0xdcfc10['attributes']:_0x14942b[_0xd672('0x36')];if(_0x366f15[_0xd672('0x37')][_0xd672('0x45')]){_0xdcfc10[_0xd672('0x4c')]=[{'all':!![]}];}_0xdcfc10=_[_0xd672('0x40')]({},_0xdcfc10,_0x366f15[_0xd672('0x44')]);return db['FaxQueue']['find'](_0xdcfc10)[_0xd672('0x2b')](handleEntityNotFound(_0x10fc05,null))[_0xd672('0x2b')](respondWithResult(_0x10fc05,null))['catch'](handleError(_0x10fc05,null));};exports['create']=function(_0x4ce180,_0x2bf3c5){return db[_0xd672('0x34')][_0xd672('0x4d')](_0x4ce180[_0xd672('0x4e')],{})[_0xd672('0x2b')](function(_0x1ac188){var _0x10239f=_0x4ce180[_0xd672('0x4f')]['get']({'plain':!![]});if(!_0x10239f)throw new Error(_0xd672('0x50'));if(_0x10239f[_0xd672('0x51')]===_0xd672('0x4f')){var _0xc8746a=_0x1ac188[_0xd672('0x2d')]({'plain':!![]});var _0x3cb49f=_0xd672('0x2e');return db[_0xd672('0x52')]['find']({'where':{'name':_0x3cb49f,'userProfileId':_0x10239f[_0xd672('0x53')]},'raw':!![]})[_0xd672('0x2b')](function(_0x474f72){if(_0x474f72&&_0x474f72[_0xd672('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8746a[_0xd672('0x30')],'resourceId':_0xc8746a['id'],'type':_0x474f72[_0xd672('0x30')],'sectionId':_0x474f72['id']},{})[_0xd672('0x2b')](function(){return _0x1ac188;});}else{return _0x1ac188;}})['catch'](function(_0x26a7f8){logger['error'](_0xd672('0x55'),_0x26a7f8);throw _0x26a7f8;});}return _0x1ac188;})[_0xd672('0x2b')](respondWithResult(_0x2bf3c5,0xc9))[_0xd672('0x48')](handleError(_0x2bf3c5,null));};exports['update']=function(_0x9c846f,_0x2c52d9){if(_0x9c846f['body']['id']){delete _0x9c846f['body']['id'];}return db[_0xd672('0x34')][_0xd672('0x56')]({'where':{'id':_0x9c846f[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](handleEntityNotFound(_0x2c52d9,null))[_0xd672('0x2b')](saveUpdates(_0x9c846f[_0xd672('0x4e')],null))[_0xd672('0x2b')](respondWithResult(_0x2c52d9,null))[_0xd672('0x48')](handleError(_0x2c52d9,null));};exports[_0xd672('0x2c')]=function(_0x56e7bf,_0x693e9){return db[_0xd672('0x34')][_0xd672('0x56')]({'where':{'id':_0x56e7bf['params']['id']}})[_0xd672('0x2b')](handleEntityNotFound(_0x693e9,null))[_0xd672('0x2b')](removeEntity(_0x693e9,null))['catch'](handleError(_0x693e9,null));};exports['describe']=function(_0x5776d9,_0x12b944){return db['FaxQueue'][_0xd672('0x57')]()[_0xd672('0x2b')](respondWithResult(_0x12b944,null))[_0xd672('0x48')](handleError(_0x12b944,null));};exports[_0xd672('0x58')]=function(_0xa9c1f3,_0x5bc98d,_0x11864a){var _0x57ed3f={'raw':!![],'where':{}},_0x145f7f={},_0x127161;return db['FaxQueue']['findOne']({'where':{'id':_0xa9c1f3[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](handleEntityNotFound(_0x5bc98d,null))[_0xd672('0x2b')](function(_0x3a7948){if(_0x3a7948){_0x127161=_0x3a7948[_0xd672('0x2d')]({'plain':!![]});_0x145f7f[_0xd672('0x36')]=_[_0xd672('0x38')](db[_0xd672('0x59')][_0xd672('0x4b')]);_0x145f7f[_0xd672('0x37')]=_[_0xd672('0x38')](_0xa9c1f3[_0xd672('0x37')]);_0x145f7f[_0xd672('0x3f')]=_[_0xd672('0x39')](_0x145f7f['model'],_0x145f7f['query']);_0x57ed3f['attributes']=_[_0xd672('0x39')](_0x145f7f[_0xd672('0x36')],qs['fields'](_0xa9c1f3[_0xd672('0x37')]['fields']));_0x57ed3f[_0xd672('0x3b')]=_0x57ed3f[_0xd672('0x3b')][_0xd672('0x5a')]?_0x57ed3f[_0xd672('0x3b')]:_0x145f7f['model'];if(!_0xa9c1f3['query'][_0xd672('0x3c')](_0xd672('0x5b'))){_0x57ed3f[_0xd672('0x25')]=qs['limit'](_0xa9c1f3[_0xd672('0x37')][_0xd672('0x25')]);_0x57ed3f[_0xd672('0x23')]=qs[_0xd672('0x23')](_0xa9c1f3[_0xd672('0x37')][_0xd672('0x23')]);}_0x57ed3f[_0xd672('0x3d')]=qs[_0xd672('0x3e')](_0xa9c1f3[_0xd672('0x37')][_0xd672('0x3e')]);_0x57ed3f[_0xd672('0x41')]=qs['filters'](_[_0xd672('0x5c')](_0xa9c1f3['query'],_0x145f7f[_0xd672('0x3f')]));_0x57ed3f[_0xd672('0x41')]['FaxQueueId']=_0x3a7948['id'];if(_0xa9c1f3[_0xd672('0x37')][_0xd672('0x43')]){_0x57ed3f[_0xd672('0x41')]=_[_0xd672('0x40')](_0x57ed3f[_0xd672('0x41')],{'$or':_[_0xd672('0x33')](_0x57ed3f[_0xd672('0x3b')],function(_0x39c471){var _0x1f2574={};_0x1f2574[_0x39c471]={'$like':'%'+_0xa9c1f3[_0xd672('0x37')][_0xd672('0x43')]+'%'};return _0x1f2574;})});}_0x57ed3f=_[_0xd672('0x40')]({},_0x57ed3f,_0xa9c1f3['options']);return db[_0xd672('0x59')][_0xd672('0x46')](_0x57ed3f);}})[_0xd672('0x2b')](function(_0x4ff53d){if(_0x4ff53d){return db[_0xd672('0x5d')]['findAndCountAll']({'where':{'id':_[_0xd672('0x33')](_0x4ff53d,_0xd672('0x5e')),'role':_0xd672('0x5f')},'attributes':['id',_0xd672('0x30'),_0xd672('0x60'),_0xd672('0x61'),'createdAt']});}})[_0xd672('0x2b')](function(_0x41bd27){if(_0x41bd27){return{'count':_0x41bd27[_0xd672('0x26')],'rows':_[_0xd672('0x33')](_0x41bd27[_0xd672('0x47')],function(_0x67fd92){return{'membername':_0x67fd92[_0xd672('0x30')],'UserId':_0x67fd92['id'],'queue_name':_0x127161[_0xd672('0x30')],'FaxQueueId':_0x127161['id'],'interface':util[_0xd672('0x62')]('%s/%s',_0xd672('0x63'),_0x67fd92['name']),'penalty':0x0,'paused':_0x67fd92['faxPause'],'createdAt':_0x67fd92[_0xd672('0x64')],'updatedAt':_0x67fd92[_0xd672('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd672('0x2b')](respondWithFilteredResult(_0x5bc98d,_0x57ed3f))[_0xd672('0x48')](handleError(_0x5bc98d,null));};exports[_0xd672('0x65')]=function(_0x428832,_0x45d451,_0x534e01){var _0x5ea000={};var _0x32c98d={};var _0x4ff07a;var _0x5eeb82;return db[_0xd672('0x34')][_0xd672('0x66')]({'where':{'id':_0x428832[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](handleEntityNotFound(_0x45d451,null))[_0xd672('0x2b')](function(_0x20b973){if(_0x20b973){_0x4ff07a=_0x20b973;_0x32c98d[_0xd672('0x36')]=_[_0xd672('0x38')](db[_0xd672('0x67')][_0xd672('0x4b')]);_0x32c98d[_0xd672('0x37')]=_[_0xd672('0x38')](_0x428832[_0xd672('0x37')]);_0x32c98d[_0xd672('0x3f')]=_[_0xd672('0x39')](_0x32c98d[_0xd672('0x36')],_0x32c98d['query']);_0x5ea000[_0xd672('0x3b')]=_[_0xd672('0x39')](_0x32c98d[_0xd672('0x36')],qs[_0xd672('0x3a')](_0x428832[_0xd672('0x37')]['fields']));_0x5ea000['attributes']=_0x5ea000['attributes'][_0xd672('0x5a')]?_0x5ea000[_0xd672('0x3b')]:_0x32c98d['model'];_0x5ea000[_0xd672('0x3d')]=qs[_0xd672('0x3e')](_0x428832[_0xd672('0x37')]['sort']);_0x5ea000['where']=qs[_0xd672('0x3f')](_[_0xd672('0x5c')](_0x428832[_0xd672('0x37')],_0x32c98d['filters']));if(_0x428832[_0xd672('0x37')][_0xd672('0x43')]){_0x5ea000['where']=_[_0xd672('0x40')](_0x5ea000[_0xd672('0x41')],{'$or':_[_0xd672('0x33')](_0x5ea000[_0xd672('0x3b')],function(_0x3385a3){var _0x485d59={};_0x485d59[_0x3385a3]={'$like':'%'+_0x428832[_0xd672('0x37')][_0xd672('0x43')]+'%'};return _0x485d59;})});}_0x5ea000=_['merge']({},_0x5ea000,_0x428832[_0xd672('0x44')]);return _0x4ff07a['getTeams'](_0x5ea000);}})['then'](function(_0x2fec11){if(_0x2fec11){_0x5eeb82=_0x2fec11[_0xd672('0x5a')];if(!_0x428832[_0xd672('0x37')][_0xd672('0x3c')](_0xd672('0x5b'))){_0x5ea000[_0xd672('0x25')]=qs[_0xd672('0x25')](_0x428832[_0xd672('0x37')][_0xd672('0x25')]);_0x5ea000['offset']=qs[_0xd672('0x23')](_0x428832['query'][_0xd672('0x23')]);}return _0x4ff07a['getTeams'](_0x5ea000);}})[_0xd672('0x2b')](function(_0x4335fd){if(_0x4335fd){return _0x4335fd?{'count':_0x5eeb82,'rows':_0x4335fd}:null;}})[_0xd672('0x2b')](respondWithResult(_0x45d451,null))[_0xd672('0x48')](handleError(_0x45d451,null));};exports[_0xd672('0x68')]=function(_0x4faa5f,_0x4d230a,_0x5de591){var _0x36b93b=_0x4faa5f['body']['ids'];return db['Team'][_0xd672('0x46')]({'where':{'id':_0x36b93b},'attributes':['id'],'include':[{'model':db[_0xd672('0x5d')],'as':_0xd672('0x69'),'attributes':['id','name',_0xd672('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0xd672('0x2b')](function(_0x348201){if(_0x348201){var _0x303a68=_['flatMap'](_0x348201,function(_0x3b15e8){var _0x2f32b1=_0x3b15e8[_0xd672('0x2d')]({'plain':!![]});return _0x2f32b1[_0xd672('0x69')];});return db[_0xd672('0x34')][_0xd672('0x56')]({'where':{'id':_0x4faa5f[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](function(_0x1f00f2){return db[_0xd672('0x6b')]['transaction'](function(_0x4830b1){return _0x1f00f2['addTeams'](_0x36b93b,{'transaction':_0x4830b1})[_0xd672('0x2b')](function(){return BPromise[_0xd672('0x6c')](_0x303a68,function(_0x573fea){return db[_0xd672('0x59')][_0xd672('0x6d')]({'where':{'UserId':_0x573fea['id'],'FaxQueueId':_0x4faa5f[_0xd672('0x4a')]['id']},'transaction':_0x4830b1});});})[_0xd672('0x2b')](function(){_0x303a68[_0xd672('0x6e')](function(_0x328a7b){socket[_0xd672('0x6f')]('userFaxQueue:save',{'UserId':_0x328a7b['id'],'FaxQueueId':_0x1f00f2['id']});});});});});}})['then'](respondWithStatusCode(_0x4d230a,null))[_0xd672('0x48')](handleError(_0x4d230a,null));};exports[_0xd672('0x70')]=function(_0x191a8b,_0x1b50df,_0x1968df){return db[_0xd672('0x67')][_0xd672('0x46')]({'where':{'id':_0x191a8b[_0xd672('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd672('0x5d')],'as':_0xd672('0x69'),'attributes':['id'],'raw':!![]}]})[_0xd672('0x2b')](handleEntityNotFound(_0x1b50df,null))[_0xd672('0x2b')](function(_0x32be1f){var _0x1257a3=_[_0xd672('0x33')](_0x32be1f,'id');var _0x1ac8c3=[];var _0x16b907=[];var _0x3ebd6d=squel[_0xd672('0x71')]();_0x3ebd6d[_0xd672('0x72')](_0xd672('0x73'))[_0xd672('0x74')](_0xd672('0x75'),'tq')[_0xd672('0x76')](_0xd672('0x77'),'ut',_0xd672('0x78'))[_0xd672('0x41')]('FaxQueueId\x20=\x20?',_0x191a8b[_0xd672('0x4a')]['id']);for(var _0x4be72a=0x0;_0x4be72a<_0x32be1f['length'];_0x4be72a+=0x1){let _0x4229bb=_0x32be1f[_0x4be72a];for(var _0x94e4ed=0x0;_0x94e4ed<_0x4229bb[_0xd672('0x69')][_0xd672('0x5a')];_0x94e4ed+=0x1){let _0x30d1ae=_0x4229bb[_0xd672('0x69')][_0x94e4ed];var _0x37c6d7=_0x3ebd6d[_0xd672('0x79')]();_0x37c6d7['where'](_0xd672('0x7a'),_0x30d1ae['id']);_0x16b907[_0xd672('0x7b')](db[_0xd672('0x6b')][_0xd672('0x37')](_0x37c6d7[_0xd672('0x7c')](),{'type':db[_0xd672('0x6b')][_0xd672('0x7d')][_0xd672('0x7e')]})['then'](function(_0x1599d5){if(_0x1599d5[_0xd672('0x5a')]===0x1){return _0x30d1ae['id'];}else{var _0x15688a=_['every'](_['map'](_0x1599d5,_0xd672('0x7f')),function(_0x49ac97){return _[_0xd672('0x80')](_0x1257a3,_0x49ac97);});if(_0x15688a){return _0x30d1ae['id'];}}}));}}return BPromise[_0xd672('0x81')](_0x16b907)['then'](function(_0x5ac0df){_0x1ac8c3=_(_0x1ac8c3)[_0xd672('0x82')](_0x5ac0df)[_0xd672('0x83')]()[_0xd672('0x84')]();return db[_0xd672('0x34')][_0xd672('0x56')]({'where':{'id':_0x191a8b[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](function(_0x13625c){return db[_0xd672('0x6b')][_0xd672('0x85')](function(_0x46ddc2){return _0x13625c['removeTeams'](_0x191a8b['query']['ids'],{'transaction':_0x46ddc2})[_0xd672('0x2b')](function(){if(!_['isEmpty'](_0x1ac8c3)){return _0x13625c[_0xd672('0x86')](_0x1ac8c3,{'transaction':_0x46ddc2});}})[_0xd672('0x2b')](function(){_0x1ac8c3['forEach'](function(_0x53451c){socket[_0xd672('0x6f')](_0xd672('0x87'),{'UserId':_0x53451c,'FaxQueueId':_0x13625c['id']});});});});});});})[_0xd672('0x2b')](respondWithStatusCode(_0x1b50df,null))[_0xd672('0x48')](handleError(_0x1b50df,null));};exports[_0xd672('0x88')]=function(_0x580bc5,_0x4d9e32,_0x217efe){return db['FaxQueue'][_0xd672('0x56')]({'where':{'id':_0x580bc5[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](handleEntityNotFound(_0x4d9e32,null))[_0xd672('0x2b')](function(_0x4c527b){if(_0x4c527b){return _0x4c527b[_0xd672('0x88')](_0x580bc5[_0xd672('0x4e')][_0xd672('0x89')],_['omit'](_0x580bc5[_0xd672('0x4e')],['ids','id'])||{})[_0xd672('0x8a')](function(_0x17822d){for(var _0x485a88=0x0;_0x485a88<_0x580bc5[_0xd672('0x4e')][_0xd672('0x89')][_0xd672('0x5a')];_0x485a88+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x580bc5['body'][_0xd672('0x89')][_0x485a88]),'FaxQueueId':Number(_0x580bc5['params']['id'])});}return _0x17822d;});}})[_0xd672('0x2b')](respondWithResult(_0x4d9e32,null))['catch'](handleError(_0x4d9e32,null));};exports[_0xd672('0x86')]=function(_0x3d9585,_0x4a53c3,_0x387a09){return db[_0xd672('0x34')]['find']({'where':{'id':_0x3d9585[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](handleEntityNotFound(_0x4a53c3,null))[_0xd672('0x2b')](function(_0x283be0){if(_0x283be0){return _0x283be0[_0xd672('0x86')](_0x3d9585[_0xd672('0x37')]['ids'])['then'](function(){if(_['isArray'](_0x3d9585['query'][_0xd672('0x89')])){for(var _0x27f21e=0x0;_0x27f21e<_0x3d9585[_0xd672('0x37')][_0xd672('0x89')][_0xd672('0x5a')];_0x27f21e+=0x1){socket['emit'](_0xd672('0x87'),{'UserId':Number(_0x3d9585[_0xd672('0x37')][_0xd672('0x89')][_0x27f21e]),'FaxQueueId':Number(_0x3d9585[_0xd672('0x4a')]['id'])});}}else{socket[_0xd672('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x3d9585[_0xd672('0x37')][_0xd672('0x89')]),'FaxQueueId':Number(_0x3d9585['params']['id'])});}});}})[_0xd672('0x2b')](respondWithStatusCode(_0x4a53c3,null))['catch'](handleError(_0x4a53c3,null));};exports[_0xd672('0x8b')]=function(_0x3860c3,_0x258032,_0xb41d67){var _0x18ce15={};var _0x5dae25={};var _0x2f0ccb;var _0x4fd2ac;return db['FaxQueue'][_0xd672('0x66')]({'where':{'id':_0x3860c3[_0xd672('0x4a')]['id']}})[_0xd672('0x2b')](handleEntityNotFound(_0x258032,null))[_0xd672('0x2b')](function(_0x4acc79){if(_0x4acc79){_0x2f0ccb=_0x4acc79;_0x5dae25[_0xd672('0x36')]=_[_0xd672('0x38')](db[_0xd672('0x5d')][_0xd672('0x4b')]);_0x5dae25['query']=_[_0xd672('0x38')](_0x3860c3[_0xd672('0x37')]);_0x5dae25['filters']=_[_0xd672('0x39')](_0x5dae25[_0xd672('0x36')],_0x5dae25[_0xd672('0x37')]);_0x18ce15[_0xd672('0x3b')]=_['intersection'](_0x5dae25[_0xd672('0x36')],qs[_0xd672('0x3a')](_0x3860c3[_0xd672('0x37')][_0xd672('0x3a')]));_0x18ce15[_0xd672('0x3b')]=_0x18ce15[_0xd672('0x3b')][_0xd672('0x5a')]?_0x18ce15[_0xd672('0x3b')]:_0x5dae25[_0xd672('0x36')];_0x18ce15[_0xd672('0x3d')]=qs[_0xd672('0x3e')](_0x3860c3['query'][_0xd672('0x3e')]);_0x18ce15['where']=qs[_0xd672('0x3f')](_[_0xd672('0x5c')](_0x3860c3['query'],_0x5dae25[_0xd672('0x3f')]));if(_0x3860c3[_0xd672('0x37')][_0xd672('0x43')]){_0x18ce15[_0xd672('0x41')]=_[_0xd672('0x40')](_0x18ce15['where'],{'$or':_[_0xd672('0x33')](_0x18ce15[_0xd672('0x3b')],function(_0x23f653){var _0x3a59ea={};_0x3a59ea[_0x23f653]={'$like':'%'+_0x3860c3[_0xd672('0x37')][_0xd672('0x43')]+'%'};return _0x3a59ea;})});}_0x18ce15=_['merge']({},_0x18ce15,_0x3860c3[_0xd672('0x44')]);return _0x2f0ccb[_0xd672('0x8b')](_0x18ce15);}})[_0xd672('0x2b')](function(_0x4bf879){if(_0x4bf879){_0x4fd2ac=_0x4bf879['length'];if(!_0x3860c3['query'][_0xd672('0x3c')](_0xd672('0x5b'))){_0x18ce15[_0xd672('0x25')]=qs[_0xd672('0x25')](_0x3860c3[_0xd672('0x37')][_0xd672('0x25')]);_0x18ce15[_0xd672('0x23')]=qs[_0xd672('0x23')](_0x3860c3[_0xd672('0x37')][_0xd672('0x23')]);}return _0x2f0ccb[_0xd672('0x8b')](_0x18ce15);}})[_0xd672('0x2b')](function(_0x2e8f83){if(_0x2e8f83){return _0x2e8f83?{'count':_0x4fd2ac,'rows':_0x2e8f83}:null;}})[_0xd672('0x2b')](respondWithResult(_0x258032,null))[_0xd672('0x48')](handleError(_0x258032,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index bf25fd1..becb030 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 _0xefd6=['../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1d9dd7,_0x43d8c){var _0x2740c2=function(_0x433a92){while(--_0x433a92){_0x1d9dd7['push'](_0x1d9dd7['shift']());}};_0x2740c2(++_0x43d8c);}(_0xefd6,0x1c2));var _0x6efd=function(_0xd8ff8e,_0x353c88){_0xd8ff8e=_0xd8ff8e-0x0;var _0x3a61fc=_0xefd6[_0xd8ff8e];return _0x3a61fc;};'use strict';var EventEmitter=require(_0x6efd('0x0'));var FaxQueue=require(_0x6efd('0x1'))['db'][_0x6efd('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6efd('0x3')](0x0);var events={'afterCreate':_0x6efd('0x4'),'afterUpdate':_0x6efd('0x5'),'afterDestroy':_0x6efd('0x6')};function emitEvent(_0x2e82fc){return function(_0x5b5e2e,_0x321938,_0x40b2fc){FaxQueueEvents['emit'](_0x2e82fc+':'+_0x5b5e2e['id'],_0x5b5e2e);FaxQueueEvents[_0x6efd('0x7')](_0x2e82fc,_0x5b5e2e);_0x40b2fc(null);};}for(var e in events){if(events[_0x6efd('0x8')](e)){var event=events[e];FaxQueue[_0x6efd('0x9')](e,emitEvent(event));}}module[_0x6efd('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x17e1=['FaxQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0x17e1,0xd7));var _0x117e=function(_0x30b351,_0x38d58a){_0x30b351=_0x30b351-0x0;var _0x10e021=_0x17e1[_0x30b351];return _0x10e021;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x117e('0x0'))['db'][_0x117e('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x117e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x117e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f53af){return function(_0x44dd4b,_0x1d9105,_0x26607f){FaxQueueEvents['emit'](_0x2f53af+':'+_0x44dd4b['id'],_0x44dd4b);FaxQueueEvents[_0x117e('0x4')](_0x2f53af,_0x44dd4b);_0x26607f(null);};}for(var e in events){if(events[_0x117e('0x5')](e)){var event=events[e];FaxQueue[_0x117e('0x6')](e,emitEvent(event));}}module[_0x117e('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index a9c8386..6697079 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 _0x72c1=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x596a4e,_0x6710cd){var _0x348e48=function(_0x3d6966){while(--_0x3d6966){_0x596a4e['push'](_0x596a4e['shift']());}};_0x348e48(++_0x6710cd);}(_0x72c1,0xd3));var _0x172c=function(_0x89625b,_0x48eb2e){_0x89625b=_0x89625b-0x0;var _0x3414e7=_0x72c1[_0x89625b];return _0x3414e7;};'use strict';var _=require(_0x172c('0x0'));var util=require(_0x172c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x172c('0x2'));var BPromise=require(_0x172c('0x3'));var rp=require(_0x172c('0x4'));var fs=require('fs');var path=require(_0x172c('0x5'));var rimraf=require(_0x172c('0x6'));var config=require(_0x172c('0x7'));var attributes=require(_0x172c('0x8'));module[_0x172c('0x9')]=function(_0x32b964,_0x4894cc){return _0x32b964[_0x172c('0xa')]('FaxQueue',attributes,{'tableName':_0x172c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b0a=['path','rimraf','../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3427ac,_0x110031){var _0x26727b=function(_0x766012){while(--_0x766012){_0x3427ac['push'](_0x3427ac['shift']());}};_0x26727b(++_0x110031);}(_0x9b0a,0x181));var _0xa9b0=function(_0x4877f7,_0x2eab43){_0x4877f7=_0x4877f7-0x0;var _0xca30a8=_0x9b0a[_0x4877f7];return _0xca30a8;};'use strict';var _=require(_0xa9b0('0x0'));var util=require('util');var logger=require(_0xa9b0('0x1'))(_0xa9b0('0x2'));var moment=require(_0xa9b0('0x3'));var BPromise=require(_0xa9b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9b0('0x5'));var rimraf=require(_0xa9b0('0x6'));var config=require(_0xa9b0('0x7'));var attributes=require('./faxQueue.attributes');module[_0xa9b0('0x8')]=function(_0x4848df,_0xb627fb){return _0x4848df[_0xa9b0('0x9')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 49d5ee5..9b57a3a 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 _0xab9e=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','then','ShowFaxQueue','lodash','util','moment','randomstring'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0xab9e,0x1b8));var _0xeab9=function(_0x2cd12a,_0x5c35dc){_0x2cd12a=_0x2cd12a-0x0;var _0x32db3a=_0xab9e[_0x2cd12a];return _0x32db3a;};'use strict';var _=require(_0xeab9('0x0'));var util=require(_0xeab9('0x1'));var moment=require(_0xeab9('0x2'));var BPromise=require('bluebird');var rs=require(_0xeab9('0x3'));var fs=require('fs');var Redis=require(_0xeab9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeab9('0x5'));var logger=require(_0xeab9('0x6'))('rpc');var config=require(_0xeab9('0x7'));var jayson=require(_0xeab9('0x8'));var client=jayson[_0xeab9('0x9')][_0xeab9('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeab9('0xb')],{'host':_0xeab9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeab9('0xb')]));require(_0xeab9('0xd'))[_0xeab9('0xe')](socket);function respondWithRpcPromise(_0x5c00df,_0x5d0ae0,_0x7316ce){return new BPromise(function(_0x589c35,_0x8a124a){return client['request'](_0x5c00df,_0x7316ce)['then'](function(_0x1561c1){logger[_0xeab9('0xf')](_0xeab9('0x10'),_0x5d0ae0,'request\x20sent');logger[_0xeab9('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5d0ae0,_0xeab9('0x12'),JSON[_0xeab9('0x13')](_0x1561c1));if(_0x1561c1[_0xeab9('0x14')]){if(_0x1561c1[_0xeab9('0x14')][_0xeab9('0x15')]===0x1f4){logger['error'](_0xeab9('0x10'),_0x5d0ae0,_0x1561c1[_0xeab9('0x14')]['message']);return _0x8a124a(_0x1561c1[_0xeab9('0x14')][_0xeab9('0x16')]);}logger[_0xeab9('0x14')]('FaxQueue,\x20%s,\x20%s',_0x5d0ae0,_0x1561c1['error'][_0xeab9('0x16')]);return _0x589c35(_0x1561c1[_0xeab9('0x14')][_0xeab9('0x16')]);}else{logger[_0xeab9('0xf')](_0xeab9('0x10'),_0x5d0ae0,_0xeab9('0x12'));_0x589c35(_0x1561c1[_0xeab9('0x17')][_0xeab9('0x16')]);}})[_0xeab9('0x18')](function(_0xf3ec3e){logger[_0xeab9('0x14')](_0xeab9('0x10'),_0x5d0ae0,_0xf3ec3e);_0x8a124a(_0xf3ec3e);});});}exports[_0xeab9('0x19')]=function(_0x6829be){var _0x506dd7=this;return new Promise(function(_0x2e6f6e,_0x1238c3){return db[_0xeab9('0x1a')][_0xeab9('0x1b')]({'raw':_0x6829be[_0xeab9('0x1c')]?_0x6829be['options'][_0xeab9('0x1d')]===undefined?!![]:![]:!![],'where':_0x6829be['options']?_0x6829be[_0xeab9('0x1c')]['where']||null:null,'attributes':_0x6829be[_0xeab9('0x1c')]?_0x6829be[_0xeab9('0x1c')][_0xeab9('0x1e')]||null:null,'limit':_0x6829be[_0xeab9('0x1c')]?_0x6829be[_0xeab9('0x1c')][_0xeab9('0x1f')]||null:null,'include':_0x6829be[_0xeab9('0x1c')]?_0x6829be[_0xeab9('0x1c')][_0xeab9('0x20')]?_[_0xeab9('0x21')](_0x6829be[_0xeab9('0x1c')][_0xeab9('0x20')],function(_0x50b3f6){return{'model':db[_0x50b3f6[_0xeab9('0x22')]],'as':_0x50b3f6['as'],'attributes':_0x50b3f6[_0xeab9('0x1e')],'include':_0x50b3f6[_0xeab9('0x20')]?_[_0xeab9('0x21')](_0x50b3f6[_0xeab9('0x20')],function(_0x5add68){return{'model':db[_0x5add68[_0xeab9('0x22')]],'as':_0x5add68['as'],'attributes':_0x5add68['attributes'],'include':_0x5add68['include']?_['map'](_0x5add68['include'],function(_0x5721cf){return{'model':db[_0x5721cf[_0xeab9('0x22')]],'as':_0x5721cf['as'],'attributes':_0x5721cf['attributes']};}):[]};}):[]};}):[]:[]})[_0xeab9('0x23')](function(_0x15ebb1){logger[_0xeab9('0xf')](_0xeab9('0x19'),_0x6829be);logger['debug'](_0xeab9('0x19'),_0x6829be,JSON['stringify'](_0x15ebb1));_0x2e6f6e(_0x15ebb1);})[_0xeab9('0x18')](function(_0x2fc96b){logger[_0xeab9('0x14')](_0xeab9('0x19'),_0x2fc96b[_0xeab9('0x16')],_0x6829be);_0x1238c3(_0x506dd7[_0xeab9('0x14')](0x1f4,_0x2fc96b[_0xeab9('0x16')]));});});};exports[_0xeab9('0x24')]=function(_0x4b09eb){var _0x119ad0=this;return new Promise(function(_0x6c6826,_0x22c609){return db[_0xeab9('0x1a')]['find']({'raw':_0x4b09eb[_0xeab9('0x1c')]?_0x4b09eb[_0xeab9('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4b09eb['options']?_0x4b09eb[_0xeab9('0x1c')]['where']||null:null,'attributes':_0x4b09eb[_0xeab9('0x1c')]?_0x4b09eb[_0xeab9('0x1c')][_0xeab9('0x1e')]||null:null,'include':_0x4b09eb[_0xeab9('0x1c')]?_0x4b09eb[_0xeab9('0x1c')]['include']?_['map'](_0x4b09eb[_0xeab9('0x1c')][_0xeab9('0x20')],function(_0x41d210){return{'model':db[_0x41d210[_0xeab9('0x22')]],'as':_0x41d210['as'],'attributes':_0x41d210[_0xeab9('0x1e')],'include':_0x41d210[_0xeab9('0x20')]?_[_0xeab9('0x21')](_0x41d210['include'],function(_0x10fe7d){return{'model':db[_0x10fe7d[_0xeab9('0x22')]],'as':_0x10fe7d['as'],'attributes':_0x10fe7d[_0xeab9('0x1e')],'include':_0x10fe7d['include']?_[_0xeab9('0x21')](_0x10fe7d[_0xeab9('0x20')],function(_0x3b2c8e){return{'model':db[_0x3b2c8e[_0xeab9('0x22')]],'as':_0x3b2c8e['as'],'attributes':_0x3b2c8e[_0xeab9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeab9('0x23')](function(_0xb15446){logger['info'](_0xeab9('0x24'),_0x4b09eb);logger[_0xeab9('0x11')](_0xeab9('0x24'),_0x4b09eb,JSON[_0xeab9('0x13')](_0xb15446));_0x6c6826(_0xb15446);})[_0xeab9('0x18')](function(_0x2d3e0b){logger[_0xeab9('0x14')](_0xeab9('0x24'),_0x2d3e0b[_0xeab9('0x16')],_0x4b09eb);_0x22c609(_0x119ad0[_0xeab9('0x14')](0x1f4,_0x2d3e0b[_0xeab9('0x16')]));});});}; \ No newline at end of file +var _0x2942=['then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','include','map','model','GetFaxQueue','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request'];(function(_0xb2e458,_0x47f84a){var _0x42887d=function(_0x5cbfcd){while(--_0x5cbfcd){_0xb2e458['push'](_0xb2e458['shift']());}};_0x42887d(++_0x47f84a);}(_0x2942,0x1c4));var _0x2294=function(_0x1a6405,_0x18c483){_0x1a6405=_0x1a6405-0x0;var _0x520857=_0x2942[_0x1a6405];return _0x520857;};'use strict';var _=require(_0x2294('0x0'));var util=require(_0x2294('0x1'));var moment=require(_0x2294('0x2'));var BPromise=require(_0x2294('0x3'));var rs=require(_0x2294('0x4'));var fs=require('fs');var Redis=require(_0x2294('0x5'));var db=require(_0x2294('0x6'))['db'];var utils=require(_0x2294('0x7'));var logger=require(_0x2294('0x8'))(_0x2294('0x9'));var config=require(_0x2294('0xa'));var jayson=require(_0x2294('0xb'));var client=jayson[_0x2294('0xc')][_0x2294('0xd')]({'port':0x232a});config['redis']=_[_0x2294('0xe')](config[_0x2294('0xf')],{'host':_0x2294('0x10'),'port':0x18eb});var socket=require(_0x2294('0x11'))(new Redis(config[_0x2294('0xf')]));require(_0x2294('0x12'))[_0x2294('0x13')](socket);function respondWithRpcPromise(_0x289605,_0x119dfd,_0x59b7e4){return new BPromise(function(_0x382a1e,_0x5b5fd1){return client[_0x2294('0x14')](_0x289605,_0x59b7e4)[_0x2294('0x15')](function(_0x57384d){logger[_0x2294('0x16')](_0x2294('0x17'),_0x119dfd,_0x2294('0x18'));logger[_0x2294('0x19')](_0x2294('0x1a'),_0x119dfd,'request\x20sent',JSON['stringify'](_0x57384d));if(_0x57384d[_0x2294('0x1b')]){if(_0x57384d[_0x2294('0x1b')][_0x2294('0x1c')]===0x1f4){logger['error'](_0x2294('0x17'),_0x119dfd,_0x57384d[_0x2294('0x1b')][_0x2294('0x1d')]);return _0x5b5fd1(_0x57384d[_0x2294('0x1b')][_0x2294('0x1d')]);}logger['error'](_0x2294('0x17'),_0x119dfd,_0x57384d[_0x2294('0x1b')][_0x2294('0x1d')]);return _0x382a1e(_0x57384d[_0x2294('0x1b')]['message']);}else{logger[_0x2294('0x16')](_0x2294('0x17'),_0x119dfd,_0x2294('0x18'));_0x382a1e(_0x57384d[_0x2294('0x1e')][_0x2294('0x1d')]);}})[_0x2294('0x1f')](function(_0x1593e2){logger[_0x2294('0x1b')]('FaxQueue,\x20%s,\x20%s',_0x119dfd,_0x1593e2);_0x5b5fd1(_0x1593e2);});});}exports['GetFaxQueue']=function(_0x5f4c6c){var _0x20dd28=this;return new Promise(function(_0x2f1a64,_0x248b7c){return db['FaxQueue'][_0x2294('0x20')]({'raw':_0x5f4c6c[_0x2294('0x21')]?_0x5f4c6c['options'][_0x2294('0x22')]===undefined?!![]:![]:!![],'where':_0x5f4c6c[_0x2294('0x21')]?_0x5f4c6c['options'][_0x2294('0x23')]||null:null,'attributes':_0x5f4c6c[_0x2294('0x21')]?_0x5f4c6c[_0x2294('0x21')][_0x2294('0x24')]||null:null,'limit':_0x5f4c6c[_0x2294('0x21')]?_0x5f4c6c[_0x2294('0x21')]['limit']||null:null,'include':_0x5f4c6c[_0x2294('0x21')]?_0x5f4c6c[_0x2294('0x21')][_0x2294('0x25')]?_[_0x2294('0x26')](_0x5f4c6c[_0x2294('0x21')][_0x2294('0x25')],function(_0x327cde){return{'model':db[_0x327cde[_0x2294('0x27')]],'as':_0x327cde['as'],'attributes':_0x327cde[_0x2294('0x24')],'include':_0x327cde['include']?_['map'](_0x327cde[_0x2294('0x25')],function(_0x5dde0f){return{'model':db[_0x5dde0f[_0x2294('0x27')]],'as':_0x5dde0f['as'],'attributes':_0x5dde0f['attributes'],'include':_0x5dde0f[_0x2294('0x25')]?_[_0x2294('0x26')](_0x5dde0f[_0x2294('0x25')],function(_0x382a36){return{'model':db[_0x382a36['model']],'as':_0x382a36['as'],'attributes':_0x382a36['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x350664){logger['info'](_0x2294('0x28'),_0x5f4c6c);logger[_0x2294('0x19')](_0x2294('0x28'),_0x5f4c6c,JSON['stringify'](_0x350664));_0x2f1a64(_0x350664);})[_0x2294('0x1f')](function(_0x3e983d){logger[_0x2294('0x1b')](_0x2294('0x28'),_0x3e983d[_0x2294('0x1d')],_0x5f4c6c);_0x248b7c(_0x20dd28['error'](0x1f4,_0x3e983d['message']));});});};exports[_0x2294('0x29')]=function(_0x122883){var _0x55282f=this;return new Promise(function(_0x317b5e,_0x2c3e3a){return db['FaxQueue'][_0x2294('0x2a')]({'raw':_0x122883[_0x2294('0x21')]?_0x122883[_0x2294('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x122883['options']?_0x122883[_0x2294('0x21')][_0x2294('0x23')]||null:null,'attributes':_0x122883[_0x2294('0x21')]?_0x122883[_0x2294('0x21')]['attributes']||null:null,'include':_0x122883['options']?_0x122883[_0x2294('0x21')][_0x2294('0x25')]?_[_0x2294('0x26')](_0x122883[_0x2294('0x21')]['include'],function(_0x36012d){return{'model':db[_0x36012d[_0x2294('0x27')]],'as':_0x36012d['as'],'attributes':_0x36012d['attributes'],'include':_0x36012d[_0x2294('0x25')]?_[_0x2294('0x26')](_0x36012d['include'],function(_0x1b7825){return{'model':db[_0x1b7825['model']],'as':_0x1b7825['as'],'attributes':_0x1b7825[_0x2294('0x24')],'include':_0x1b7825[_0x2294('0x25')]?_[_0x2294('0x26')](_0x1b7825[_0x2294('0x25')],function(_0x5ef03e){return{'model':db[_0x5ef03e['model']],'as':_0x5ef03e['as'],'attributes':_0x5ef03e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xab0a9d){logger['info'](_0x2294('0x29'),_0x122883);logger[_0x2294('0x19')](_0x2294('0x29'),_0x122883,JSON['stringify'](_0xab0a9d));_0x317b5e(_0xab0a9d);})['catch'](function(_0x30e601){logger['error'](_0x2294('0x29'),_0x30e601[_0x2294('0x1d')],_0x122883);_0x2c3e3a(_0x55282f[_0x2294('0x1b')](0x1f4,_0x30e601[_0x2294('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 424aa2a..737a9bf 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 _0x6aa9=['register','length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x6aa9,0x66));var _0x96aa=function(_0x4d6087,_0x542af6){_0x4d6087=_0x4d6087-0x0;var _0x13c8d8=_0x6aa9[_0x4d6087];return _0x13c8d8;};'use strict';var FaxQueueEvents=require(_0x96aa('0x0'));var events=[_0x96aa('0x1'),_0x96aa('0x2'),_0x96aa('0x3')];function createListener(_0x294787,_0x3f856d){return function(_0x308765){_0x3f856d[_0x96aa('0x4')](_0x294787,_0x308765);};}function removeListener(_0x266829,_0x9716bb){return function(){FaxQueueEvents[_0x96aa('0x5')](_0x266829,_0x9716bb);};}exports[_0x96aa('0x6')]=function(_0x20a0f2){for(var _0x5386e7=0x0,_0x333985=events[_0x96aa('0x7')];_0x5386e7<_0x333985;_0x5386e7++){var _0x56d8c1=events[_0x5386e7];var _0x3c0571=createListener(_0x96aa('0x8')+_0x56d8c1,_0x20a0f2);FaxQueueEvents['on'](_0x56d8c1,_0x3c0571);}}; \ No newline at end of file +var _0xcdbd=['faxQueue:','./faxQueue.events','remove','update','removeListener','register'];(function(_0x2a6510,_0x48a560){var _0x5c1482=function(_0x146f92){while(--_0x146f92){_0x2a6510['push'](_0x2a6510['shift']());}};_0x5c1482(++_0x48a560);}(_0xcdbd,0x15d));var _0xdcdb=function(_0x3abd19,_0x2debfe){_0x3abd19=_0x3abd19-0x0;var _0x39193c=_0xcdbd[_0x3abd19];return _0x39193c;};'use strict';var FaxQueueEvents=require(_0xdcdb('0x0'));var events=['save',_0xdcdb('0x1'),_0xdcdb('0x2')];function createListener(_0x37e11a,_0x170b51){return function(_0x44dd2a){_0x170b51['emit'](_0x37e11a,_0x44dd2a);};}function removeListener(_0x17dd74,_0x2bcc94){return function(){FaxQueueEvents[_0xdcdb('0x3')](_0x17dd74,_0x2bcc94);};}exports[_0xdcdb('0x4')]=function(_0xfb5e7c){for(var _0x1a5242=0x0,_0x295fe7=events['length'];_0x1a5242<_0x295fe7;_0x1a5242++){var _0x65b26c=events[_0x1a5242];var _0x40cd1a=createListener(_0xdcdb('0x5')+_0x65b26c,_0xfb5e7c);FaxQueueEvents['on'](_0x65b26c,_0x40cd1a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 33cfb6e..e515403 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 _0xffd6=['/:id/users','post','create','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x2dc3db,_0x3e346e){var _0x248865=function(_0x256c0c){while(--_0x256c0c){_0x2dc3db['push'](_0x2dc3db['shift']());}};_0x248865(++_0x3e346e);}(_0xffd6,0x97));var _0x6ffd=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0xffd6[_0x13ff53];return _0x290228;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['get'](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router[_0x6ffd('0x8')](_0x6ffd('0xf'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x10')]);router['get'](_0x6ffd('0x11'),auth[_0x6ffd('0x9')](),controller['getAgents']);router[_0x6ffd('0x12')]('/',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x13')]);router[_0x6ffd('0x12')]('/:id/teams',auth[_0x6ffd('0x9')](),controller['addTeams']);router[_0x6ffd('0x12')]('/:id/users',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x14')]);router[_0x6ffd('0x15')]('/:id',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x16')]);router[_0x6ffd('0x17')](_0x6ffd('0x18'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x19')]);router[_0x6ffd('0x17')](_0x6ffd('0xf'),auth['isAuthenticated'](),controller[_0x6ffd('0x1a')]);router['delete']('/:id/users',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x36c3=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents','update','destroy','delete','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3fa0f7,_0x2f5821){var _0x4f2070=function(_0x2cf33f){while(--_0x2cf33f){_0x3fa0f7['push'](_0x3fa0f7['shift']());}};_0x4f2070(++_0x2f5821);}(_0x36c3,0x1a6));var _0x336c=function(_0xed9dd,_0x184eb5){_0xed9dd=_0xed9dd-0x0;var _0x2b0faf=_0x36c3[_0xed9dd];return _0x2b0faf;};'use strict';var multer=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var path=require('path');var timeout=require(_0x336c('0x2'));var express=require(_0x336c('0x3'));var router=express[_0x336c('0x4')]();var fs_extra=require(_0x336c('0x5'));var auth=require(_0x336c('0x6'));var interaction=require(_0x336c('0x7'));var config=require(_0x336c('0x8'));var controller=require('./faxQueue.controller');router[_0x336c('0x9')]('/',auth[_0x336c('0xa')](),controller[_0x336c('0xb')]);router[_0x336c('0x9')](_0x336c('0xc'),auth['isAuthenticated'](),controller[_0x336c('0xd')]);router[_0x336c('0x9')](_0x336c('0xe'),auth[_0x336c('0xa')](),controller[_0x336c('0xf')]);router[_0x336c('0x9')](_0x336c('0x10'),auth[_0x336c('0xa')](),controller[_0x336c('0x11')]);router[_0x336c('0x9')](_0x336c('0x12'),auth[_0x336c('0xa')](),controller[_0x336c('0x13')]);router[_0x336c('0x9')](_0x336c('0x14'),auth[_0x336c('0xa')](),controller[_0x336c('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x336c('0x16')]);router['post'](_0x336c('0x12'),auth[_0x336c('0xa')](),controller[_0x336c('0x17')]);router[_0x336c('0x18')]('/:id/users',auth[_0x336c('0xa')](),controller[_0x336c('0x19')]);router['put'](_0x336c('0xe'),auth['isAuthenticated'](),controller[_0x336c('0x1a')]);router['delete'](_0x336c('0xe'),auth['isAuthenticated'](),controller[_0x336c('0x1b')]);router[_0x336c('0x1c')]('/:id/teams',auth['isAuthenticated'](),controller[_0x336c('0x1d')]);router[_0x336c('0x1c')](_0x336c('0x14'),auth[_0x336c('0xa')](),controller[_0x336c('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 50c1679..208ed58 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 _0xe201=['exports','STRING','DATE','moment'];(function(_0x5f19a6,_0x51f1fc){var _0xdc4150=function(_0x50ab9b){while(--_0x50ab9b){_0x5f19a6['push'](_0x5f19a6['shift']());}};_0xdc4150(++_0x51f1fc);}(_0xe201,0x6f));var _0x1e20=function(_0x18eb9d,_0x5d9c1e){_0x18eb9d=_0x18eb9d-0x0;var _0xbb16ab=_0xe201[_0x18eb9d];return _0xbb16ab;};'use strict';var moment=require(_0x1e20('0x0'));var Sequelize=require('sequelize');module[_0x1e20('0x1')]={'uniqueid':{'type':Sequelize[_0x1e20('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1e20('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1e20('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1e20('0x2')]}}; \ No newline at end of file +var _0x6a39=['moment','sequelize','exports','STRING','DATE'];(function(_0x231b09,_0x4342ab){var _0x407bb6=function(_0x4744f7){while(--_0x4744f7){_0x231b09['push'](_0x231b09['shift']());}};_0x407bb6(++_0x4342ab);}(_0x6a39,0x140));var _0x96a3=function(_0x25db76,_0x42b5d3){_0x25db76=_0x25db76-0x0;var _0x42b540=_0x6a39[_0x25db76];return _0x42b540;};'use strict';var moment=require(_0x96a3('0x0'));var Sequelize=require(_0x96a3('0x1'));module[_0x96a3('0x2')]={'uniqueid':{'type':Sequelize[_0x96a3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x96a3('0x3')]},'joinAt':{'type':Sequelize[_0x96a3('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x96a3('0x4')]},'exitAt':{'type':Sequelize[_0x96a3('0x4')]},'reason':{'type':Sequelize[_0x96a3('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 21d7104..60a89bc 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 _0xbb53=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','end','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','keys','length','include','catch','create','body','find'];(function(_0x2a9548,_0x2742f6){var _0xf55c55=function(_0x2862d8){while(--_0x2862d8){_0x2a9548['push'](_0x2a9548['shift']());}};_0xf55c55(++_0x2742f6);}(_0xbb53,0x121));var _0x3bb5=function(_0x4b00f8,_0x15be49){_0x4b00f8=_0x4b00f8-0x0;var _0x2d3a9a=_0xbb53[_0x4b00f8];return _0x2d3a9a;};'use strict';var emlformat=require(_0x3bb5('0x0'));var rimraf=require(_0x3bb5('0x1'));var zipdir=require(_0x3bb5('0x2'));var jsonpatch=require(_0x3bb5('0x3'));var rp=require(_0x3bb5('0x4'));var moment=require(_0x3bb5('0x5'));var BPromise=require(_0x3bb5('0x6'));var Mustache=require(_0x3bb5('0x7'));var util=require(_0x3bb5('0x8'));var path=require(_0x3bb5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bb5('0xa'));var fs=require('fs');var fs_extra=require(_0x3bb5('0xb'));var _=require(_0x3bb5('0xc'));var squel=require(_0x3bb5('0xd'));var crypto=require(_0x3bb5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3bb5('0xf'));var Papa=require(_0x3bb5('0x10'));var Redis=require(_0x3bb5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3bb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bb5('0x13'))(_0x3bb5('0x14'));var utils=require('../../config/utils');var config=require(_0x3bb5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bb5('0x16'))['db'];function respondWithStatusCode(_0x511bd8,_0x526bf0){_0x526bf0=_0x526bf0||0xcc;return function(_0x223356){if(_0x223356){return _0x511bd8[_0x3bb5('0x17')](_0x526bf0);}return _0x511bd8[_0x3bb5('0x18')](_0x526bf0)['end']();};}function respondWithResult(_0xd578fc,_0x12e409){_0x12e409=_0x12e409||0xc8;return function(_0x519123){if(_0x519123){return _0xd578fc[_0x3bb5('0x18')](_0x12e409)[_0x3bb5('0x19')](_0x519123);}};}function respondWithFilteredResult(_0x5cec77,_0x5ca99f){return function(_0x50617f){if(_0x50617f){var _0x42ef1b=typeof _0x5ca99f[_0x3bb5('0x1a')]==='undefined'&&typeof _0x5ca99f[_0x3bb5('0x1b')]===_0x3bb5('0x1c');var _0x4656c4=_0x50617f[_0x3bb5('0x1d')];var _0x48bc25=_0x42ef1b?0x0:_0x5ca99f[_0x3bb5('0x1a')];var _0x1109d0=_0x42ef1b?_0x50617f[_0x3bb5('0x1d')]:_0x5ca99f['offset']+_0x5ca99f['limit'];var _0x19b177;if(_0x1109d0>=_0x4656c4){_0x1109d0=_0x4656c4;_0x19b177=0xc8;}else{_0x19b177=0xce;}_0x5cec77[_0x3bb5('0x18')](_0x19b177);return _0x5cec77[_0x3bb5('0x1e')]('Content-Range',_0x48bc25+'-'+_0x1109d0+'/'+_0x4656c4)[_0x3bb5('0x19')](_0x50617f);}return null;};}function patchUpdates(_0x2afe6e){return function(_0x3f94ad){try{jsonpatch[_0x3bb5('0x1f')](_0x3f94ad,_0x2afe6e,!![]);}catch(_0x21a3ff){return BPromise[_0x3bb5('0x20')](_0x21a3ff);}return _0x3f94ad['save']();};}function saveUpdates(_0x37444e,_0x3eae85){return function(_0x438a8d){if(_0x438a8d){return _0x438a8d[_0x3bb5('0x21')](_0x37444e)[_0x3bb5('0x22')](function(_0xfb9e8){return _0xfb9e8;});}return null;};}function removeEntity(_0x341a3f,_0x58c10f){return function(_0x1d2a24){if(_0x1d2a24){return _0x1d2a24[_0x3bb5('0x23')]()['then'](function(){_0x341a3f['status'](0xcc)[_0x3bb5('0x24')]();});}};}function handleEntityNotFound(_0x36cfda,_0x58acdb){return function(_0x483689){if(!_0x483689){_0x36cfda[_0x3bb5('0x17')](0x194);}return _0x483689;};}function handleError(_0x77a60f,_0x2fc543){_0x2fc543=_0x2fc543||0x1f4;return function(_0xc1c149){logger['error'](_0xc1c149['stack']);if(_0xc1c149[_0x3bb5('0x25')]){delete _0xc1c149['name'];}_0x77a60f[_0x3bb5('0x18')](_0x2fc543)[_0x3bb5('0x26')](_0xc1c149);};}exports[_0x3bb5('0x27')]=function(_0x534b15,_0x5f40ac){var _0x19e61d={},_0x39f1ad={},_0x17ada7={'count':0x0,'rows':[]};var _0x18304c=_[_0x3bb5('0x28')](db[_0x3bb5('0x29')][_0x3bb5('0x2a')],function(_0x5ce225){return{'name':_0x5ce225[_0x3bb5('0x2b')],'type':_0x5ce225[_0x3bb5('0x2c')][_0x3bb5('0x2d')]};});_0x39f1ad[_0x3bb5('0x2e')]=_[_0x3bb5('0x28')](_0x18304c,_0x3bb5('0x25'));_0x39f1ad[_0x3bb5('0x2f')]=_['keys'](_0x534b15[_0x3bb5('0x2f')]);_0x39f1ad[_0x3bb5('0x30')]=_['intersection'](_0x39f1ad[_0x3bb5('0x2e')],_0x39f1ad[_0x3bb5('0x2f')]);_0x19e61d[_0x3bb5('0x31')]=_[_0x3bb5('0x32')](_0x39f1ad[_0x3bb5('0x2e')],qs['fields'](_0x534b15[_0x3bb5('0x2f')][_0x3bb5('0x33')]));_0x19e61d[_0x3bb5('0x31')]=_0x19e61d[_0x3bb5('0x31')]['length']?_0x19e61d['attributes']:_0x39f1ad[_0x3bb5('0x2e')];if(!_0x534b15[_0x3bb5('0x2f')][_0x3bb5('0x34')](_0x3bb5('0x35'))){_0x19e61d[_0x3bb5('0x1b')]=qs[_0x3bb5('0x1b')](_0x534b15[_0x3bb5('0x2f')][_0x3bb5('0x1b')]);_0x19e61d[_0x3bb5('0x1a')]=qs['offset'](_0x534b15[_0x3bb5('0x2f')][_0x3bb5('0x1a')]);}_0x19e61d['order']=qs['sort'](_0x534b15[_0x3bb5('0x2f')][_0x3bb5('0x36')]);_0x19e61d[_0x3bb5('0x37')]=qs[_0x3bb5('0x30')](_['pick'](_0x534b15['query'],_0x39f1ad[_0x3bb5('0x30')]),_0x18304c);if(_0x534b15['query'][_0x3bb5('0x38')]){_0x19e61d['where']=_['merge'](_0x19e61d[_0x3bb5('0x37')],{'$or':_['map'](_0x18304c,function(_0x5edb47){if(_0x5edb47[_0x3bb5('0x2c')]!==_0x3bb5('0x39')){var _0x1384cd={};_0x1384cd[_0x5edb47['name']]={'$like':'%'+_0x534b15[_0x3bb5('0x2f')]['filter']+'%'};return _0x1384cd;}})});}_0x19e61d=_[_0x3bb5('0x3a')]({},_0x19e61d,_0x534b15['options']);var _0x235e3={'where':_0x19e61d[_0x3bb5('0x37')]};return db[_0x3bb5('0x29')][_0x3bb5('0x1d')](_0x235e3)[_0x3bb5('0x22')](function(_0x261d7b){_0x17ada7['count']=_0x261d7b;if(_0x534b15[_0x3bb5('0x2f')][_0x3bb5('0x3b')]){_0x19e61d['include']=[{'all':!![]}];}return db[_0x3bb5('0x29')][_0x3bb5('0x3c')](_0x19e61d);})[_0x3bb5('0x22')](function(_0x5cfb72){_0x17ada7[_0x3bb5('0x3d')]=_0x5cfb72;return _0x17ada7;})[_0x3bb5('0x22')](respondWithFilteredResult(_0x5f40ac,_0x19e61d))['catch'](handleError(_0x5f40ac,null));};exports[_0x3bb5('0x3e')]=function(_0x40da23,_0x7a294e){var _0x2291e9={'raw':!![],'where':{'id':_0x40da23[_0x3bb5('0x3f')]['id']}},_0x663685={};_0x663685[_0x3bb5('0x2e')]=_[_0x3bb5('0x40')](db[_0x3bb5('0x29')][_0x3bb5('0x2a')]);_0x663685[_0x3bb5('0x2f')]=_[_0x3bb5('0x40')](_0x40da23[_0x3bb5('0x2f')]);_0x663685[_0x3bb5('0x30')]=_['intersection'](_0x663685[_0x3bb5('0x2e')],_0x663685[_0x3bb5('0x2f')]);_0x2291e9['attributes']=_['intersection'](_0x663685[_0x3bb5('0x2e')],qs[_0x3bb5('0x33')](_0x40da23[_0x3bb5('0x2f')][_0x3bb5('0x33')]));_0x2291e9[_0x3bb5('0x31')]=_0x2291e9[_0x3bb5('0x31')][_0x3bb5('0x41')]?_0x2291e9[_0x3bb5('0x31')]:_0x663685['model'];if(_0x40da23['query'][_0x3bb5('0x3b')]){_0x2291e9[_0x3bb5('0x42')]=[{'all':!![]}];}_0x2291e9=_[_0x3bb5('0x3a')]({},_0x2291e9,_0x40da23['options']);return db[_0x3bb5('0x29')]['find'](_0x2291e9)[_0x3bb5('0x22')](handleEntityNotFound(_0x7a294e,null))[_0x3bb5('0x22')](respondWithResult(_0x7a294e,null))[_0x3bb5('0x43')](handleError(_0x7a294e,null));};exports[_0x3bb5('0x44')]=function(_0x11352e,_0x2b7c68){return db['FaxQueueReport'][_0x3bb5('0x44')](_0x11352e[_0x3bb5('0x45')],{})['then'](respondWithResult(_0x2b7c68,0xc9))[_0x3bb5('0x43')](handleError(_0x2b7c68,null));};exports[_0x3bb5('0x21')]=function(_0x5075bd,_0x41edf7){if(_0x5075bd[_0x3bb5('0x45')]['id']){delete _0x5075bd[_0x3bb5('0x45')]['id'];}return db[_0x3bb5('0x29')][_0x3bb5('0x46')]({'where':{'id':_0x5075bd['params']['id']}})[_0x3bb5('0x22')](handleEntityNotFound(_0x41edf7,null))[_0x3bb5('0x22')](saveUpdates(_0x5075bd['body'],null))['then'](respondWithResult(_0x41edf7,null))[_0x3bb5('0x43')](handleError(_0x41edf7,null));};exports[_0x3bb5('0x23')]=function(_0x1e5b64,_0x90d5b6){return db[_0x3bb5('0x29')]['find']({'where':{'id':_0x1e5b64[_0x3bb5('0x3f')]['id']}})[_0x3bb5('0x22')](handleEntityNotFound(_0x90d5b6,null))[_0x3bb5('0x22')](removeEntity(_0x90d5b6,null))[_0x3bb5('0x43')](handleError(_0x90d5b6,null));};exports[_0x3bb5('0x47')]=function(_0x2a6aa4,_0x3baf6a){return db['FaxQueueReport'][_0x3bb5('0x47')]()[_0x3bb5('0x22')](respondWithResult(_0x3baf6a,null))[_0x3bb5('0x43')](handleError(_0x3baf6a,null));}; \ No newline at end of file +var _0xbe31=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','FaxQueueReport','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x469a13,_0x353b26){var _0x34f57a=function(_0x5893ad){while(--_0x5893ad){_0x469a13['push'](_0x469a13['shift']());}};_0x34f57a(++_0x353b26);}(_0xbe31,0x83));var _0x1be3=function(_0xc34718,_0x384a34){_0xc34718=_0xc34718-0x0;var _0x1f7afc=_0xbe31[_0xc34718];return _0x1f7afc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be3('0x0'));var zipdir=require(_0x1be3('0x1'));var jsonpatch=require(_0x1be3('0x2'));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(_0x1be3('0x8'));var sox=require('sox');var csv=require(_0x1be3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1be3('0xa'));var _=require(_0x1be3('0xb'));var squel=require(_0x1be3('0xc'));var crypto=require(_0x1be3('0xd'));var jsforce=require(_0x1be3('0xe'));var deskjs=require(_0x1be3('0xf'));var toCsv=require(_0x1be3('0x9'));var querystring=require(_0x1be3('0x10'));var Papa=require(_0x1be3('0x11'));var Redis=require(_0x1be3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1be3('0x13'));var as=require(_0x1be3('0x14'));var hardwareService=require(_0x1be3('0x15'));var logger=require(_0x1be3('0x16'))(_0x1be3('0x17'));var utils=require(_0x1be3('0x18'));var config=require(_0x1be3('0x19'));var licenseUtil=require(_0x1be3('0x1a'));var db=require(_0x1be3('0x1b'))['db'];function respondWithStatusCode(_0x50552d,_0x3601f7){_0x3601f7=_0x3601f7||0xcc;return function(_0x492f66){if(_0x492f66){return _0x50552d[_0x1be3('0x1c')](_0x3601f7);}return _0x50552d[_0x1be3('0x1d')](_0x3601f7)['end']();};}function respondWithResult(_0x26f888,_0x573684){_0x573684=_0x573684||0xc8;return function(_0xc7cc3){if(_0xc7cc3){return _0x26f888[_0x1be3('0x1d')](_0x573684)[_0x1be3('0x1e')](_0xc7cc3);}};}function respondWithFilteredResult(_0xd30cd,_0x1156bc){return function(_0x269ac3){if(_0x269ac3){var _0x567919=typeof _0x1156bc['offset']==='undefined'&&typeof _0x1156bc['limit']===_0x1be3('0x1f');var _0x4ebba6=_0x269ac3[_0x1be3('0x20')];var _0x6b7edf=_0x567919?0x0:_0x1156bc[_0x1be3('0x21')];var _0x1d0c2b=_0x567919?_0x269ac3[_0x1be3('0x20')]:_0x1156bc[_0x1be3('0x21')]+_0x1156bc[_0x1be3('0x22')];var _0x41c2af;if(_0x1d0c2b>=_0x4ebba6){_0x1d0c2b=_0x4ebba6;_0x41c2af=0xc8;}else{_0x41c2af=0xce;}_0xd30cd[_0x1be3('0x1d')](_0x41c2af);return _0xd30cd[_0x1be3('0x23')](_0x1be3('0x24'),_0x6b7edf+'-'+_0x1d0c2b+'/'+_0x4ebba6)[_0x1be3('0x1e')](_0x269ac3);}return null;};}function patchUpdates(_0x57c78c){return function(_0x49123f){try{jsonpatch[_0x1be3('0x25')](_0x49123f,_0x57c78c,!![]);}catch(_0x4cacb9){return BPromise[_0x1be3('0x26')](_0x4cacb9);}return _0x49123f[_0x1be3('0x27')]();};}function saveUpdates(_0x4366e8,_0x3bd167){return function(_0x3c0564){if(_0x3c0564){return _0x3c0564[_0x1be3('0x28')](_0x4366e8)[_0x1be3('0x29')](function(_0x57c192){return _0x57c192;});}return null;};}function removeEntity(_0x186b8a,_0x48862c){return function(_0x237a6c){if(_0x237a6c){return _0x237a6c[_0x1be3('0x2a')]()['then'](function(){_0x186b8a[_0x1be3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134d79,_0x12023d){return function(_0x393f98){if(!_0x393f98){_0x134d79[_0x1be3('0x1c')](0x194);}return _0x393f98;};}function handleError(_0x4ce12f,_0x1e2943){_0x1e2943=_0x1e2943||0x1f4;return function(_0x8d1f58){logger['error'](_0x8d1f58[_0x1be3('0x2b')]);if(_0x8d1f58[_0x1be3('0x2c')]){delete _0x8d1f58[_0x1be3('0x2c')];}_0x4ce12f[_0x1be3('0x1d')](_0x1e2943)[_0x1be3('0x2d')](_0x8d1f58);};}exports[_0x1be3('0x2e')]=function(_0x5d35cf,_0x5bb993){var _0x49f0e0={},_0x25ed26={},_0x4be26f={'count':0x0,'rows':[]};var _0x28dd78=_[_0x1be3('0x2f')](db['FaxQueueReport']['rawAttributes'],function(_0x49f780){return{'name':_0x49f780[_0x1be3('0x30')],'type':_0x49f780[_0x1be3('0x31')][_0x1be3('0x32')]};});_0x25ed26[_0x1be3('0x33')]=_[_0x1be3('0x2f')](_0x28dd78,'name');_0x25ed26['query']=_['keys'](_0x5d35cf['query']);_0x25ed26[_0x1be3('0x34')]=_[_0x1be3('0x35')](_0x25ed26[_0x1be3('0x33')],_0x25ed26[_0x1be3('0x36')]);_0x49f0e0[_0x1be3('0x37')]=_[_0x1be3('0x35')](_0x25ed26[_0x1be3('0x33')],qs['fields'](_0x5d35cf[_0x1be3('0x36')][_0x1be3('0x38')]));_0x49f0e0[_0x1be3('0x37')]=_0x49f0e0[_0x1be3('0x37')][_0x1be3('0x39')]?_0x49f0e0[_0x1be3('0x37')]:_0x25ed26[_0x1be3('0x33')];if(!_0x5d35cf['query'][_0x1be3('0x3a')](_0x1be3('0x3b'))){_0x49f0e0[_0x1be3('0x22')]=qs['limit'](_0x5d35cf['query'][_0x1be3('0x22')]);_0x49f0e0[_0x1be3('0x21')]=qs[_0x1be3('0x21')](_0x5d35cf['query']['offset']);}_0x49f0e0['order']=qs[_0x1be3('0x3c')](_0x5d35cf[_0x1be3('0x36')][_0x1be3('0x3c')]);_0x49f0e0['where']=qs[_0x1be3('0x34')](_['pick'](_0x5d35cf[_0x1be3('0x36')],_0x25ed26[_0x1be3('0x34')]),_0x28dd78);if(_0x5d35cf['query'][_0x1be3('0x3d')]){_0x49f0e0[_0x1be3('0x3e')]=_[_0x1be3('0x3f')](_0x49f0e0[_0x1be3('0x3e')],{'$or':_[_0x1be3('0x2f')](_0x28dd78,function(_0x525ace){if(_0x525ace[_0x1be3('0x31')]!==_0x1be3('0x40')){var _0x39b8d9={};_0x39b8d9[_0x525ace['name']]={'$like':'%'+_0x5d35cf['query'][_0x1be3('0x3d')]+'%'};return _0x39b8d9;}})});}_0x49f0e0=_[_0x1be3('0x3f')]({},_0x49f0e0,_0x5d35cf['options']);var _0x40b38e={'where':_0x49f0e0['where']};return db[_0x1be3('0x41')][_0x1be3('0x20')](_0x40b38e)['then'](function(_0x55948b){_0x4be26f['count']=_0x55948b;if(_0x5d35cf[_0x1be3('0x36')][_0x1be3('0x42')]){_0x49f0e0[_0x1be3('0x43')]=[{'all':!![]}];}return db[_0x1be3('0x41')][_0x1be3('0x44')](_0x49f0e0);})['then'](function(_0x43b89d){_0x4be26f['rows']=_0x43b89d;return _0x4be26f;})[_0x1be3('0x29')](respondWithFilteredResult(_0x5bb993,_0x49f0e0))[_0x1be3('0x45')](handleError(_0x5bb993,null));};exports[_0x1be3('0x46')]=function(_0x3e8bd2,_0x371659){var _0x51da91={'raw':!![],'where':{'id':_0x3e8bd2['params']['id']}},_0x31ad7e={};_0x31ad7e[_0x1be3('0x33')]=_[_0x1be3('0x47')](db[_0x1be3('0x41')]['rawAttributes']);_0x31ad7e[_0x1be3('0x36')]=_[_0x1be3('0x47')](_0x3e8bd2[_0x1be3('0x36')]);_0x31ad7e[_0x1be3('0x34')]=_['intersection'](_0x31ad7e['model'],_0x31ad7e[_0x1be3('0x36')]);_0x51da91[_0x1be3('0x37')]=_[_0x1be3('0x35')](_0x31ad7e[_0x1be3('0x33')],qs[_0x1be3('0x38')](_0x3e8bd2['query'][_0x1be3('0x38')]));_0x51da91['attributes']=_0x51da91[_0x1be3('0x37')][_0x1be3('0x39')]?_0x51da91['attributes']:_0x31ad7e['model'];if(_0x3e8bd2[_0x1be3('0x36')]['includeAll']){_0x51da91['include']=[{'all':!![]}];}_0x51da91=_[_0x1be3('0x3f')]({},_0x51da91,_0x3e8bd2[_0x1be3('0x48')]);return db[_0x1be3('0x41')][_0x1be3('0x49')](_0x51da91)[_0x1be3('0x29')](handleEntityNotFound(_0x371659,null))['then'](respondWithResult(_0x371659,null))[_0x1be3('0x45')](handleError(_0x371659,null));};exports[_0x1be3('0x4a')]=function(_0x36475a,_0x584617){return db[_0x1be3('0x41')][_0x1be3('0x4a')](_0x36475a[_0x1be3('0x4b')],{})['then'](respondWithResult(_0x584617,0xc9))[_0x1be3('0x45')](handleError(_0x584617,null));};exports[_0x1be3('0x28')]=function(_0x5160b2,_0x495d2b){if(_0x5160b2['body']['id']){delete _0x5160b2['body']['id'];}return db[_0x1be3('0x41')][_0x1be3('0x49')]({'where':{'id':_0x5160b2[_0x1be3('0x4c')]['id']}})[_0x1be3('0x29')](handleEntityNotFound(_0x495d2b,null))[_0x1be3('0x29')](saveUpdates(_0x5160b2[_0x1be3('0x4b')],null))[_0x1be3('0x29')](respondWithResult(_0x495d2b,null))[_0x1be3('0x45')](handleError(_0x495d2b,null));};exports[_0x1be3('0x2a')]=function(_0x116c44,_0x55514e){return db[_0x1be3('0x41')][_0x1be3('0x49')]({'where':{'id':_0x116c44[_0x1be3('0x4c')]['id']}})[_0x1be3('0x29')](handleEntityNotFound(_0x55514e,null))[_0x1be3('0x29')](removeEntity(_0x55514e,null))[_0x1be3('0x45')](handleError(_0x55514e,null));};exports['describe']=function(_0x43ce9e,_0x50a137){return db[_0x1be3('0x41')][_0x1be3('0x4d')]()[_0x1be3('0x29')](respondWithResult(_0x50a137,null))[_0x1be3('0x45')](handleError(_0x50a137,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 1f6b9cb..d872407 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x1c12f6,_0x5976d9){var _0x48077a=function(_0x24a25b){while(--_0x24a25b){_0x1c12f6['push'](_0x1c12f6['shift']());}};_0x48077a(++_0x5976d9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5fc3[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20875e,_0x5e10fe){var _0x40dbb7=function(_0x5d3f2e){while(--_0x5d3f2e){_0x20875e['push'](_0x20875e['shift']());}};_0x40dbb7(++_0x5e10fe);}(_0x53ec,0x192));var _0xc53e=function(_0x5114aa,_0x4596b9){_0x5114aa=_0x5114aa-0x0;var _0x1841bc=_0x53ec[_0x5114aa];return _0x1841bc;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7dbc57a..84c9cb0 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 _0xbe38=['create','body','options','raw','UpdateFaxQueueReport','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','FaxQueueReport'];(function(_0x571d85,_0xda439c){var _0x3c2e07=function(_0x2d2144){while(--_0x2d2144){_0x571d85['push'](_0x571d85['shift']());}};_0x3c2e07(++_0xda439c);}(_0xbe38,0xa6));var _0x8be3=function(_0x4c7892,_0x1c2cb0){_0x4c7892=_0x4c7892-0x0;var _0x2a79c8=_0xbe38[_0x4c7892];return _0x2a79c8;};'use strict';var _=require(_0x8be3('0x0'));var util=require('util');var moment=require(_0x8be3('0x1'));var BPromise=require(_0x8be3('0x2'));var rs=require(_0x8be3('0x3'));var fs=require('fs');var Redis=require(_0x8be3('0x4'));var db=require(_0x8be3('0x5'))['db'];var utils=require(_0x8be3('0x6'));var logger=require(_0x8be3('0x7'))(_0x8be3('0x8'));var config=require(_0x8be3('0x9'));var jayson=require(_0x8be3('0xa'));var client=jayson[_0x8be3('0xb')][_0x8be3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x440cbb,_0x5e4cc4,_0xc39cea){return new BPromise(function(_0x2cbfbd,_0x20e815){return client['request'](_0x440cbb,_0xc39cea)[_0x8be3('0xd')](function(_0x1d393e){logger[_0x8be3('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x5e4cc4,_0x8be3('0xf'));logger[_0x8be3('0x10')](_0x8be3('0x11'),_0x5e4cc4,_0x8be3('0xf'),JSON[_0x8be3('0x12')](_0x1d393e));if(_0x1d393e['error']){if(_0x1d393e[_0x8be3('0x13')]['code']===0x1f4){logger[_0x8be3('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x5e4cc4,_0x1d393e[_0x8be3('0x13')][_0x8be3('0x14')]);return _0x20e815(_0x1d393e[_0x8be3('0x13')]['message']);}logger[_0x8be3('0x13')](_0x8be3('0x15'),_0x5e4cc4,_0x1d393e[_0x8be3('0x13')][_0x8be3('0x14')]);return _0x2cbfbd(_0x1d393e[_0x8be3('0x13')][_0x8be3('0x14')]);}else{logger['info'](_0x8be3('0x15'),_0x5e4cc4,_0x8be3('0xf'));_0x2cbfbd(_0x1d393e[_0x8be3('0x16')][_0x8be3('0x14')]);}})[_0x8be3('0x17')](function(_0x180e6d){logger[_0x8be3('0x13')](_0x8be3('0x15'),_0x5e4cc4,_0x180e6d);_0x20e815(_0x180e6d);});});}exports[_0x8be3('0x18')]=function(_0x15e01f){var _0x1c0950=this;return new Promise(function(_0x597739,_0x19f1cb){return db[_0x8be3('0x19')][_0x8be3('0x1a')](_0x15e01f[_0x8be3('0x1b')],{'raw':_0x15e01f['options']?_0x15e01f[_0x8be3('0x1c')][_0x8be3('0x1d')]===undefined?!![]:![]:!![]})[_0x8be3('0xd')](function(_0x2333fc){logger[_0x8be3('0xe')](_0x8be3('0x18'),_0x15e01f);logger[_0x8be3('0x10')](_0x8be3('0x18'),_0x15e01f,JSON[_0x8be3('0x12')](_0x2333fc));_0x597739(_0x2333fc);})['catch'](function(_0x3d44ae){logger[_0x8be3('0x13')](_0x8be3('0x18'),_0x3d44ae[_0x8be3('0x14')],_0x15e01f);_0x19f1cb(_0x1c0950[_0x8be3('0x13')](0x1f4,_0x3d44ae['message']));});});};exports[_0x8be3('0x1e')]=function(_0x8b76f8){var _0x33500a=this;return new Promise(function(_0x35d60f,_0xc19509){return db['FaxQueueReport']['update'](_0x8b76f8[_0x8be3('0x1b')],{'raw':_0x8b76f8['options']?_0x8b76f8[_0x8be3('0x1c')][_0x8be3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8b76f8[_0x8be3('0x1c')]?_0x8b76f8[_0x8be3('0x1c')]['where']||null:null,'attributes':_0x8b76f8[_0x8be3('0x1c')]?_0x8b76f8[_0x8be3('0x1c')]['attributes']||null:null,'limit':_0x8b76f8[_0x8be3('0x1c')]?_0x8b76f8[_0x8be3('0x1c')][_0x8be3('0x1f')]||null:null})['then'](function(_0x3fb2a6){logger[_0x8be3('0xe')](_0x8be3('0x1e'),_0x8b76f8);logger[_0x8be3('0x10')](_0x8be3('0x1e'),_0x8b76f8,JSON[_0x8be3('0x12')](_0x3fb2a6));_0x35d60f(_0x3fb2a6);})[_0x8be3('0x17')](function(_0x557dd6){logger[_0x8be3('0x13')](_0x8be3('0x1e'),_0x557dd6[_0x8be3('0x14')],_0x8b76f8);_0xc19509(_0x33500a[_0x8be3('0x13')](0x1f4,_0x557dd6[_0x8be3('0x14')]));});});}; \ No newline at end of file +var _0x1321=['jayson/promise','client','http','request','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','create','body','options','raw','then','FaxQueueReport','update','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2dfe07,_0x2b663f){var _0x30aee0=function(_0x1a070a){while(--_0x1a070a){_0x2dfe07['push'](_0x2dfe07['shift']());}};_0x30aee0(++_0x2b663f);}(_0x1321,0x1b0));var _0x1132=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1321[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x1132('0x0'));var util=require(_0x1132('0x1'));var moment=require(_0x1132('0x2'));var BPromise=require(_0x1132('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1132('0x4'));var db=require(_0x1132('0x5'))['db'];var utils=require(_0x1132('0x6'));var logger=require(_0x1132('0x7'))(_0x1132('0x8'));var config=require(_0x1132('0x9'));var jayson=require(_0x1132('0xa'));var client=jayson[_0x1132('0xb')][_0x1132('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x591191,_0x1f57ef,_0x1ffea9){return new BPromise(function(_0x2c7e2c,_0x1a907a){return client[_0x1132('0xd')](_0x591191,_0x1ffea9)['then'](function(_0x448c55){logger[_0x1132('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x1f57ef,'request\x20sent');logger[_0x1132('0xf')](_0x1132('0x10'),_0x1f57ef,_0x1132('0x11'),JSON[_0x1132('0x12')](_0x448c55));if(_0x448c55[_0x1132('0x13')]){if(_0x448c55[_0x1132('0x13')]['code']===0x1f4){logger['error'](_0x1132('0x14'),_0x1f57ef,_0x448c55['error']['message']);return _0x1a907a(_0x448c55['error'][_0x1132('0x15')]);}logger[_0x1132('0x13')](_0x1132('0x14'),_0x1f57ef,_0x448c55[_0x1132('0x13')][_0x1132('0x15')]);return _0x2c7e2c(_0x448c55['error'][_0x1132('0x15')]);}else{logger['info'](_0x1132('0x14'),_0x1f57ef,_0x1132('0x11'));_0x2c7e2c(_0x448c55[_0x1132('0x16')][_0x1132('0x15')]);}})[_0x1132('0x17')](function(_0x5d646c){logger[_0x1132('0x13')](_0x1132('0x14'),_0x1f57ef,_0x5d646c);_0x1a907a(_0x5d646c);});});}exports[_0x1132('0x18')]=function(_0x535aa7){var _0x2c5205=this;return new Promise(function(_0x2cec20,_0x403375){return db['FaxQueueReport'][_0x1132('0x19')](_0x535aa7[_0x1132('0x1a')],{'raw':_0x535aa7[_0x1132('0x1b')]?_0x535aa7[_0x1132('0x1b')][_0x1132('0x1c')]===undefined?!![]:![]:!![]})[_0x1132('0x1d')](function(_0x395914){logger[_0x1132('0xe')](_0x1132('0x18'),_0x535aa7);logger[_0x1132('0xf')](_0x1132('0x18'),_0x535aa7,JSON['stringify'](_0x395914));_0x2cec20(_0x395914);})[_0x1132('0x17')](function(_0x607e01){logger[_0x1132('0x13')](_0x1132('0x18'),_0x607e01['message'],_0x535aa7);_0x403375(_0x2c5205[_0x1132('0x13')](0x1f4,_0x607e01[_0x1132('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x5804b5){var _0x596fb0=this;return new Promise(function(_0x41833b,_0x4604f3){return db[_0x1132('0x1e')][_0x1132('0x1f')](_0x5804b5[_0x1132('0x1a')],{'raw':_0x5804b5['options']?_0x5804b5[_0x1132('0x1b')][_0x1132('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5804b5[_0x1132('0x1b')]?_0x5804b5[_0x1132('0x1b')]['where']||null:null,'attributes':_0x5804b5[_0x1132('0x1b')]?_0x5804b5[_0x1132('0x1b')]['attributes']||null:null,'limit':_0x5804b5[_0x1132('0x1b')]?_0x5804b5['options'][_0x1132('0x20')]||null:null})['then'](function(_0x59fc17){logger[_0x1132('0xe')](_0x1132('0x21'),_0x5804b5);logger[_0x1132('0xf')](_0x1132('0x21'),_0x5804b5,JSON[_0x1132('0x12')](_0x59fc17));_0x41833b(_0x59fc17);})[_0x1132('0x17')](function(_0x541f91){logger[_0x1132('0x13')](_0x1132('0x21'),_0x541f91[_0x1132('0x15')],_0x5804b5);_0x4604f3(_0x596fb0['error'](0x1f4,_0x541f91['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a36a1f2..f38c092 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 _0x9d14=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x4c8869,_0x2e6a58){var _0xdacb86=function(_0x587f76){while(--_0x587f76){_0x4c8869['push'](_0x4c8869['shift']());}};_0xdacb86(++_0x2e6a58);}(_0x9d14,0x11c));var _0x49d1=function(_0x5ec9e0,_0x593466){_0x5ec9e0=_0x5ec9e0-0x0;var _0x4a7267=_0x9d14[_0x5ec9e0];return _0x4a7267;};'use strict';var multer=require('multer');var util=require(_0x49d1('0x0'));var path=require(_0x49d1('0x1'));var timeout=require(_0x49d1('0x2'));var express=require(_0x49d1('0x3'));var router=express[_0x49d1('0x4')]();var fs_extra=require(_0x49d1('0x5'));var auth=require(_0x49d1('0x6'));var interaction=require(_0x49d1('0x7'));var config=require(_0x49d1('0x8'));var controller=require(_0x49d1('0x9'));router[_0x49d1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x49d1('0xb'),auth[_0x49d1('0xc')](),controller[_0x49d1('0xd')]);router['get'](_0x49d1('0xe'),auth['isAuthenticated'](),controller[_0x49d1('0xf')]);router['post']('/',auth[_0x49d1('0xc')](),controller['create']);router['put'](_0x49d1('0xe'),auth[_0x49d1('0xc')](),controller[_0x49d1('0x10')]);router[_0x49d1('0x11')](_0x49d1('0xe'),auth[_0x49d1('0xc')](),controller[_0x49d1('0x12')]);module[_0x49d1('0x13')]=router; \ No newline at end of file +var _0x32a9=['fs-extra','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x32a9,0x13f));var _0x932a=function(_0x2bb612,_0xaedf28){_0x2bb612=_0x2bb612-0x0;var _0x4ef64c=_0x32a9[_0x2bb612];return _0x4ef64c;};'use strict';var multer=require(_0x932a('0x0'));var util=require(_0x932a('0x1'));var path=require(_0x932a('0x2'));var timeout=require(_0x932a('0x3'));var express=require(_0x932a('0x4'));var router=express['Router']();var fs_extra=require(_0x932a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x932a('0x6'));var controller=require('./faxQueueReport.controller');router[_0x932a('0x7')]('/',auth[_0x932a('0x8')](),controller[_0x932a('0x9')]);router[_0x932a('0x7')]('/describe',auth[_0x932a('0x8')](),controller[_0x932a('0xa')]);router[_0x932a('0x7')](_0x932a('0xb'),auth[_0x932a('0x8')](),controller[_0x932a('0xc')]);router[_0x932a('0xd')]('/',auth[_0x932a('0x8')](),controller[_0x932a('0xe')]);router[_0x932a('0xf')](_0x932a('0xb'),auth[_0x932a('0x8')](),controller[_0x932a('0x10')]);router[_0x932a('0x11')](_0x932a('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 593362e..bc3a9be 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x44cb9d,_0xe6c2f0){var _0x39e2ac=function(_0x3a1293){while(--_0x3a1293){_0x44cb9d['push'](_0x44cb9d['shift']());}};_0x39e2ac(++_0xe6c2f0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x35e819,_0x3908c6){_0x35e819=_0x35e819-0x0;var _0x46bdb7=_0xf4eb[_0x35e819];return _0x46bdb7;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4f15c5,_0x24ac34){var _0x19db70=function(_0x3a8acf){while(--_0x3a8acf){_0x4f15c5['push'](_0x4f15c5['shift']());}};_0x19db70(++_0x24ac34);}(_0x70e0,0x17b));var _0x070e=function(_0x535c6f,_0x15717f){_0x535c6f=_0x535c6f-0x0;var _0x3e5e81=_0x70e0[_0x535c6f];return _0x3e5e81;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 959ee34..85fdbf9 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 _0xf223=['set','json','apply','save','destroy','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count'];(function(_0x2d57a9,_0x5ae060){var _0x1b9671=function(_0x95fb4e){while(--_0x95fb4e){_0x2d57a9['push'](_0x2d57a9['shift']());}};_0x1b9671(++_0x5ae060);}(_0xf223,0xc3));var _0x3f22=function(_0xde0b94,_0x4c80ce){_0xde0b94=_0xde0b94-0x0;var _0x1e4645=_0xf223[_0xde0b94];return _0x1e4645;};'use strict';var emlformat=require(_0x3f22('0x0'));var rimraf=require(_0x3f22('0x1'));var zipdir=require(_0x3f22('0x2'));var jsonpatch=require(_0x3f22('0x3'));var rp=require(_0x3f22('0x4'));var moment=require('moment');var BPromise=require(_0x3f22('0x5'));var Mustache=require(_0x3f22('0x6'));var util=require(_0x3f22('0x7'));var path=require(_0x3f22('0x8'));var sox=require(_0x3f22('0x9'));var csv=require(_0x3f22('0xa'));var ejs=require(_0x3f22('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f22('0xc'));var squel=require(_0x3f22('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f22('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3f22('0xa'));var querystring=require(_0x3f22('0xf'));var Papa=require(_0x3f22('0x10'));var Redis=require(_0x3f22('0x11'));var authService=require(_0x3f22('0x12'));var qs=require(_0x3f22('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f22('0x14'));var logger=require(_0x3f22('0x15'))(_0x3f22('0x16'));var utils=require(_0x3f22('0x17'));var config=require(_0x3f22('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f22('0x19'))['db'];function respondWithStatusCode(_0x5bbd05,_0x598250){_0x598250=_0x598250||0xcc;return function(_0x58e33b){if(_0x58e33b){return _0x5bbd05[_0x3f22('0x1a')](_0x598250);}return _0x5bbd05['status'](_0x598250)[_0x3f22('0x1b')]();};}function respondWithResult(_0x829bc2,_0x176432){_0x176432=_0x176432||0xc8;return function(_0x16e781){if(_0x16e781){return _0x829bc2[_0x3f22('0x1c')](_0x176432)['json'](_0x16e781);}};}function respondWithFilteredResult(_0x9e75fe,_0x164446){return function(_0x58ab32){if(_0x58ab32){var _0x2f1976=typeof _0x164446['offset']===_0x3f22('0x1d')&&typeof _0x164446[_0x3f22('0x1e')]===_0x3f22('0x1d');var _0x44a876=_0x58ab32['count'];var _0x143d62=_0x2f1976?0x0:_0x164446[_0x3f22('0x1f')];var _0x182a0e=_0x2f1976?_0x58ab32[_0x3f22('0x20')]:_0x164446[_0x3f22('0x1f')]+_0x164446[_0x3f22('0x1e')];var _0x3ab429;if(_0x182a0e>=_0x44a876){_0x182a0e=_0x44a876;_0x3ab429=0xc8;}else{_0x3ab429=0xce;}_0x9e75fe['status'](_0x3ab429);return _0x9e75fe[_0x3f22('0x21')]('Content-Range',_0x143d62+'-'+_0x182a0e+'/'+_0x44a876)[_0x3f22('0x22')](_0x58ab32);}return null;};}function patchUpdates(_0x3c1cd7){return function(_0x3b588e){try{jsonpatch[_0x3f22('0x23')](_0x3b588e,_0x3c1cd7,!![]);}catch(_0x11bdfa){return BPromise['reject'](_0x11bdfa);}return _0x3b588e[_0x3f22('0x24')]();};}function saveUpdates(_0x3df5fd,_0x410b15){return function(_0x1353f3){if(_0x1353f3){return _0x1353f3['update'](_0x3df5fd)['then'](function(_0x32c7e5){return _0x32c7e5;});}return null;};}function removeEntity(_0xb53a45,_0x2b7eff){return function(_0x11237d){if(_0x11237d){return _0x11237d[_0x3f22('0x25')]()[_0x3f22('0x26')](function(){_0xb53a45[_0x3f22('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253291,_0x4be72e){return function(_0x227f62){if(!_0x227f62){_0x253291[_0x3f22('0x1a')](0x194);}return _0x227f62;};}function handleError(_0x47393d,_0x12ddca){_0x12ddca=_0x12ddca||0x1f4;return function(_0x540cf8){logger[_0x3f22('0x27')](_0x540cf8[_0x3f22('0x28')]);if(_0x540cf8['name']){delete _0x540cf8[_0x3f22('0x29')];}_0x47393d[_0x3f22('0x1c')](_0x12ddca)[_0x3f22('0x2a')](_0x540cf8);};}exports[_0x3f22('0x2b')]=function(_0x28de71,_0x31c100){var _0x471681={},_0x584c76={},_0xb476c5={'count':0x0,'rows':[]};var _0x4b63d8=_[_0x3f22('0x2c')](db[_0x3f22('0x2d')][_0x3f22('0x2e')],function(_0x420f40){return{'name':_0x420f40['fieldName'],'type':_0x420f40['type']['key']};});_0x584c76[_0x3f22('0x2f')]=_[_0x3f22('0x2c')](_0x4b63d8,_0x3f22('0x29'));_0x584c76['query']=_['keys'](_0x28de71[_0x3f22('0x30')]);_0x584c76['filters']=_[_0x3f22('0x31')](_0x584c76['model'],_0x584c76[_0x3f22('0x30')]);_0x471681[_0x3f22('0x32')]=_[_0x3f22('0x31')](_0x584c76[_0x3f22('0x2f')],qs[_0x3f22('0x33')](_0x28de71[_0x3f22('0x30')][_0x3f22('0x33')]));_0x471681[_0x3f22('0x32')]=_0x471681['attributes'][_0x3f22('0x34')]?_0x471681[_0x3f22('0x32')]:_0x584c76[_0x3f22('0x2f')];if(!_0x28de71[_0x3f22('0x30')][_0x3f22('0x35')](_0x3f22('0x36'))){_0x471681[_0x3f22('0x1e')]=qs[_0x3f22('0x1e')](_0x28de71['query'][_0x3f22('0x1e')]);_0x471681[_0x3f22('0x1f')]=qs[_0x3f22('0x1f')](_0x28de71['query'][_0x3f22('0x1f')]);}_0x471681[_0x3f22('0x37')]=qs[_0x3f22('0x38')](_0x28de71['query']['sort']);_0x471681[_0x3f22('0x39')]=qs[_0x3f22('0x3a')](_[_0x3f22('0x3b')](_0x28de71['query'],_0x584c76[_0x3f22('0x3a')]),_0x4b63d8);if(_0x28de71[_0x3f22('0x30')][_0x3f22('0x3c')]){_0x471681[_0x3f22('0x39')]=_['merge'](_0x471681[_0x3f22('0x39')],{'$or':_[_0x3f22('0x2c')](_0x4b63d8,function(_0xf8bb64){if(_0xf8bb64['type']!==_0x3f22('0x3d')){var _0x564bf0={};_0x564bf0[_0xf8bb64[_0x3f22('0x29')]]={'$like':'%'+_0x28de71[_0x3f22('0x30')][_0x3f22('0x3c')]+'%'};return _0x564bf0;}})});}_0x471681=_[_0x3f22('0x3e')]({},_0x471681,_0x28de71[_0x3f22('0x3f')]);var _0x2c0691={'where':_0x471681['where']};return db['FaxTransferReport']['count'](_0x2c0691)[_0x3f22('0x26')](function(_0x5ee6c4){_0xb476c5['count']=_0x5ee6c4;if(_0x28de71[_0x3f22('0x30')][_0x3f22('0x40')]){_0x471681[_0x3f22('0x41')]=[{'all':!![]}];}return db[_0x3f22('0x2d')][_0x3f22('0x42')](_0x471681);})[_0x3f22('0x26')](function(_0x56725f){_0xb476c5['rows']=_0x56725f;return _0xb476c5;})[_0x3f22('0x26')](respondWithFilteredResult(_0x31c100,_0x471681))[_0x3f22('0x43')](handleError(_0x31c100,null));};exports[_0x3f22('0x44')]=function(_0x3675a5,_0x6f7e24){var _0x2137a2={'raw':!![],'where':{'id':_0x3675a5[_0x3f22('0x45')]['id']}},_0x3300d7={};_0x3300d7['model']=_[_0x3f22('0x46')](db['FaxTransferReport'][_0x3f22('0x2e')]);_0x3300d7[_0x3f22('0x30')]=_['keys'](_0x3675a5['query']);_0x3300d7['filters']=_[_0x3f22('0x31')](_0x3300d7[_0x3f22('0x2f')],_0x3300d7[_0x3f22('0x30')]);_0x2137a2[_0x3f22('0x32')]=_[_0x3f22('0x31')](_0x3300d7[_0x3f22('0x2f')],qs[_0x3f22('0x33')](_0x3675a5['query']['fields']));_0x2137a2[_0x3f22('0x32')]=_0x2137a2[_0x3f22('0x32')][_0x3f22('0x34')]?_0x2137a2[_0x3f22('0x32')]:_0x3300d7[_0x3f22('0x2f')];if(_0x3675a5['query'][_0x3f22('0x40')]){_0x2137a2[_0x3f22('0x41')]=[{'all':!![]}];}_0x2137a2=_[_0x3f22('0x3e')]({},_0x2137a2,_0x3675a5[_0x3f22('0x3f')]);return db[_0x3f22('0x2d')]['find'](_0x2137a2)[_0x3f22('0x26')](handleEntityNotFound(_0x6f7e24,null))[_0x3f22('0x26')](respondWithResult(_0x6f7e24,null))['catch'](handleError(_0x6f7e24,null));};exports[_0x3f22('0x47')]=function(_0x27ef81,_0x64fd76){return db[_0x3f22('0x2d')][_0x3f22('0x47')](_0x27ef81['body'],{})[_0x3f22('0x26')](respondWithResult(_0x64fd76,0xc9))[_0x3f22('0x43')](handleError(_0x64fd76,null));};exports[_0x3f22('0x48')]=function(_0x25d4bd,_0xc0b3a5){if(_0x25d4bd[_0x3f22('0x49')]['id']){delete _0x25d4bd[_0x3f22('0x49')]['id'];}return db[_0x3f22('0x2d')][_0x3f22('0x4a')]({'where':{'id':_0x25d4bd[_0x3f22('0x45')]['id']}})[_0x3f22('0x26')](handleEntityNotFound(_0xc0b3a5,null))[_0x3f22('0x26')](saveUpdates(_0x25d4bd[_0x3f22('0x49')],null))[_0x3f22('0x26')](respondWithResult(_0xc0b3a5,null))['catch'](handleError(_0xc0b3a5,null));};exports[_0x3f22('0x25')]=function(_0x2c8f23,_0x718c10){return db[_0x3f22('0x2d')][_0x3f22('0x4a')]({'where':{'id':_0x2c8f23['params']['id']}})[_0x3f22('0x26')](handleEntityNotFound(_0x718c10,null))[_0x3f22('0x26')](removeEntity(_0x718c10,null))['catch'](handleError(_0x718c10,null));};exports[_0x3f22('0x4b')]=function(_0x3a7363,_0xde25ec){return db[_0x3f22('0x2d')]['describe']()[_0x3f22('0x26')](respondWithResult(_0xde25ec,null))[_0x3f22('0x43')](handleError(_0xde25ec,null));}; \ No newline at end of file +var _0xfde0=['describe','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','FaxTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find'];(function(_0x24ccf0,_0x540f11){var _0x34133e=function(_0x43e79f){while(--_0x43e79f){_0x24ccf0['push'](_0x24ccf0['shift']());}};_0x34133e(++_0x540f11);}(_0xfde0,0x1c3));var _0x0fde=function(_0x500a42,_0x39adcf){_0x500a42=_0x500a42-0x0;var _0x322dd9=_0xfde0[_0x500a42];return _0x322dd9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0fde('0x0'));var jsonpatch=require(_0x0fde('0x1'));var rp=require('request-promise');var moment=require(_0x0fde('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fde('0x3'));var util=require(_0x0fde('0x4'));var path=require('path');var sox=require(_0x0fde('0x5'));var csv=require(_0x0fde('0x6'));var ejs=require(_0x0fde('0x7'));var fs=require('fs');var fs_extra=require(_0x0fde('0x8'));var _=require(_0x0fde('0x9'));var squel=require(_0x0fde('0xa'));var crypto=require(_0x0fde('0xb'));var jsforce=require(_0x0fde('0xc'));var deskjs=require(_0x0fde('0xd'));var toCsv=require(_0x0fde('0x6'));var querystring=require(_0x0fde('0xe'));var Papa=require(_0x0fde('0xf'));var Redis=require(_0x0fde('0x10'));var authService=require(_0x0fde('0x11'));var qs=require(_0x0fde('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fde('0x13'));var logger=require('../../config/logger')(_0x0fde('0x14'));var utils=require(_0x0fde('0x15'));var config=require(_0x0fde('0x16'));var licenseUtil=require(_0x0fde('0x17'));var db=require(_0x0fde('0x18'))['db'];function respondWithStatusCode(_0xafcbd7,_0x58e561){_0x58e561=_0x58e561||0xcc;return function(_0x20b58d){if(_0x20b58d){return _0xafcbd7[_0x0fde('0x19')](_0x58e561);}return _0xafcbd7[_0x0fde('0x1a')](_0x58e561)['end']();};}function respondWithResult(_0xcb04bc,_0xc3c662){_0xc3c662=_0xc3c662||0xc8;return function(_0x267c84){if(_0x267c84){return _0xcb04bc[_0x0fde('0x1a')](_0xc3c662)[_0x0fde('0x1b')](_0x267c84);}};}function respondWithFilteredResult(_0x39711c,_0xfcb13f){return function(_0x2cb378){if(_0x2cb378){var _0x2a73d4=typeof _0xfcb13f[_0x0fde('0x1c')]===_0x0fde('0x1d')&&typeof _0xfcb13f[_0x0fde('0x1e')]===_0x0fde('0x1d');var _0x1078b6=_0x2cb378[_0x0fde('0x1f')];var _0x32aefe=_0x2a73d4?0x0:_0xfcb13f[_0x0fde('0x1c')];var _0x44e037=_0x2a73d4?_0x2cb378[_0x0fde('0x1f')]:_0xfcb13f[_0x0fde('0x1c')]+_0xfcb13f['limit'];var _0x2c7fba;if(_0x44e037>=_0x1078b6){_0x44e037=_0x1078b6;_0x2c7fba=0xc8;}else{_0x2c7fba=0xce;}_0x39711c['status'](_0x2c7fba);return _0x39711c[_0x0fde('0x20')]('Content-Range',_0x32aefe+'-'+_0x44e037+'/'+_0x1078b6)[_0x0fde('0x1b')](_0x2cb378);}return null;};}function patchUpdates(_0x2f4c4d){return function(_0x157c03){try{jsonpatch[_0x0fde('0x21')](_0x157c03,_0x2f4c4d,!![]);}catch(_0x2aff40){return BPromise[_0x0fde('0x22')](_0x2aff40);}return _0x157c03['save']();};}function saveUpdates(_0x191fe5,_0x2dd4f9){return function(_0x3495da){if(_0x3495da){return _0x3495da[_0x0fde('0x23')](_0x191fe5)[_0x0fde('0x24')](function(_0x5d6bfb){return _0x5d6bfb;});}return null;};}function removeEntity(_0x1ac0c3,_0x47b6e0){return function(_0xfe5325){if(_0xfe5325){return _0xfe5325[_0x0fde('0x25')]()[_0x0fde('0x24')](function(){_0x1ac0c3[_0x0fde('0x1a')](0xcc)[_0x0fde('0x26')]();});}};}function handleEntityNotFound(_0x148539,_0xe05dd2){return function(_0x525be9){if(!_0x525be9){_0x148539['sendStatus'](0x194);}return _0x525be9;};}function handleError(_0x469f8e,_0x36a459){_0x36a459=_0x36a459||0x1f4;return function(_0x57bd42){logger[_0x0fde('0x27')](_0x57bd42[_0x0fde('0x28')]);if(_0x57bd42[_0x0fde('0x29')]){delete _0x57bd42[_0x0fde('0x29')];}_0x469f8e[_0x0fde('0x1a')](_0x36a459)[_0x0fde('0x2a')](_0x57bd42);};}exports[_0x0fde('0x2b')]=function(_0x2a130e,_0x5c2a95){var _0x25e3c3={},_0x4d4dcf={},_0x556077={'count':0x0,'rows':[]};var _0x262c52=_[_0x0fde('0x2c')](db[_0x0fde('0x2d')]['rawAttributes'],function(_0x3a06d0){return{'name':_0x3a06d0['fieldName'],'type':_0x3a06d0[_0x0fde('0x2e')][_0x0fde('0x2f')]};});_0x4d4dcf[_0x0fde('0x30')]=_[_0x0fde('0x2c')](_0x262c52,_0x0fde('0x29'));_0x4d4dcf[_0x0fde('0x31')]=_[_0x0fde('0x32')](_0x2a130e[_0x0fde('0x31')]);_0x4d4dcf[_0x0fde('0x33')]=_[_0x0fde('0x34')](_0x4d4dcf[_0x0fde('0x30')],_0x4d4dcf[_0x0fde('0x31')]);_0x25e3c3[_0x0fde('0x35')]=_[_0x0fde('0x34')](_0x4d4dcf[_0x0fde('0x30')],qs[_0x0fde('0x36')](_0x2a130e[_0x0fde('0x31')][_0x0fde('0x36')]));_0x25e3c3[_0x0fde('0x35')]=_0x25e3c3[_0x0fde('0x35')][_0x0fde('0x37')]?_0x25e3c3[_0x0fde('0x35')]:_0x4d4dcf[_0x0fde('0x30')];if(!_0x2a130e[_0x0fde('0x31')][_0x0fde('0x38')](_0x0fde('0x39'))){_0x25e3c3[_0x0fde('0x1e')]=qs['limit'](_0x2a130e[_0x0fde('0x31')][_0x0fde('0x1e')]);_0x25e3c3[_0x0fde('0x1c')]=qs[_0x0fde('0x1c')](_0x2a130e[_0x0fde('0x31')]['offset']);}_0x25e3c3[_0x0fde('0x3a')]=qs[_0x0fde('0x3b')](_0x2a130e['query'][_0x0fde('0x3b')]);_0x25e3c3[_0x0fde('0x3c')]=qs[_0x0fde('0x33')](_[_0x0fde('0x3d')](_0x2a130e['query'],_0x4d4dcf[_0x0fde('0x33')]),_0x262c52);if(_0x2a130e[_0x0fde('0x31')][_0x0fde('0x3e')]){_0x25e3c3[_0x0fde('0x3c')]=_[_0x0fde('0x3f')](_0x25e3c3['where'],{'$or':_[_0x0fde('0x2c')](_0x262c52,function(_0x52e8b9){if(_0x52e8b9[_0x0fde('0x2e')]!=='VIRTUAL'){var _0x54c5b7={};_0x54c5b7[_0x52e8b9['name']]={'$like':'%'+_0x2a130e['query']['filter']+'%'};return _0x54c5b7;}})});}_0x25e3c3=_[_0x0fde('0x3f')]({},_0x25e3c3,_0x2a130e[_0x0fde('0x40')]);var _0x2b7614={'where':_0x25e3c3['where']};return db[_0x0fde('0x2d')][_0x0fde('0x1f')](_0x2b7614)['then'](function(_0x143f68){_0x556077[_0x0fde('0x1f')]=_0x143f68;if(_0x2a130e[_0x0fde('0x31')][_0x0fde('0x41')]){_0x25e3c3[_0x0fde('0x42')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x0fde('0x43')](_0x25e3c3);})[_0x0fde('0x24')](function(_0x3b4b8b){_0x556077[_0x0fde('0x44')]=_0x3b4b8b;return _0x556077;})[_0x0fde('0x24')](respondWithFilteredResult(_0x5c2a95,_0x25e3c3))[_0x0fde('0x45')](handleError(_0x5c2a95,null));};exports['show']=function(_0x183647,_0x5db57c){var _0x2995bc={'raw':!![],'where':{'id':_0x183647[_0x0fde('0x46')]['id']}},_0x1385c8={};_0x1385c8['model']=_[_0x0fde('0x32')](db[_0x0fde('0x2d')]['rawAttributes']);_0x1385c8['query']=_[_0x0fde('0x32')](_0x183647['query']);_0x1385c8[_0x0fde('0x33')]=_[_0x0fde('0x34')](_0x1385c8[_0x0fde('0x30')],_0x1385c8[_0x0fde('0x31')]);_0x2995bc['attributes']=_[_0x0fde('0x34')](_0x1385c8[_0x0fde('0x30')],qs['fields'](_0x183647[_0x0fde('0x31')][_0x0fde('0x36')]));_0x2995bc['attributes']=_0x2995bc[_0x0fde('0x35')]['length']?_0x2995bc[_0x0fde('0x35')]:_0x1385c8['model'];if(_0x183647[_0x0fde('0x31')][_0x0fde('0x41')]){_0x2995bc[_0x0fde('0x42')]=[{'all':!![]}];}_0x2995bc=_[_0x0fde('0x3f')]({},_0x2995bc,_0x183647['options']);return db['FaxTransferReport']['find'](_0x2995bc)[_0x0fde('0x24')](handleEntityNotFound(_0x5db57c,null))[_0x0fde('0x24')](respondWithResult(_0x5db57c,null))[_0x0fde('0x45')](handleError(_0x5db57c,null));};exports[_0x0fde('0x47')]=function(_0x5823b7,_0x293b2c){return db[_0x0fde('0x2d')]['create'](_0x5823b7['body'],{})[_0x0fde('0x24')](respondWithResult(_0x293b2c,0xc9))[_0x0fde('0x45')](handleError(_0x293b2c,null));};exports[_0x0fde('0x23')]=function(_0x4d00c4,_0x4b41a0){if(_0x4d00c4[_0x0fde('0x48')]['id']){delete _0x4d00c4[_0x0fde('0x48')]['id'];}return db[_0x0fde('0x2d')][_0x0fde('0x49')]({'where':{'id':_0x4d00c4[_0x0fde('0x46')]['id']}})[_0x0fde('0x24')](handleEntityNotFound(_0x4b41a0,null))['then'](saveUpdates(_0x4d00c4[_0x0fde('0x48')],null))[_0x0fde('0x24')](respondWithResult(_0x4b41a0,null))[_0x0fde('0x45')](handleError(_0x4b41a0,null));};exports['destroy']=function(_0x5eac2a,_0x365428){return db[_0x0fde('0x2d')][_0x0fde('0x49')]({'where':{'id':_0x5eac2a[_0x0fde('0x46')]['id']}})[_0x0fde('0x24')](handleEntityNotFound(_0x365428,null))[_0x0fde('0x24')](removeEntity(_0x365428,null))[_0x0fde('0x45')](handleError(_0x365428,null));};exports[_0x0fde('0x4a')]=function(_0x40c061,_0x438943){return db[_0x0fde('0x2d')][_0x0fde('0x4a')]()[_0x0fde('0x24')](respondWithResult(_0x438943,null))[_0x0fde('0x45')](handleError(_0x438943,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index cf845bb..2e5f4ce 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 _0xff89=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash'];(function(_0x3c4714,_0x3a732f){var _0x287da8=function(_0x19bec8){while(--_0x19bec8){_0x3c4714['push'](_0x3c4714['shift']());}};_0x287da8(++_0x3a732f);}(_0xff89,0x149));var _0x9ff8=function(_0x50b25b,_0x3069ba){_0x50b25b=_0x50b25b-0x0;var _0x432d77=_0xff89[_0x50b25b];return _0x432d77;};'use strict';var _=require(_0x9ff8('0x0'));var util=require(_0x9ff8('0x1'));var logger=require(_0x9ff8('0x2'))(_0x9ff8('0x3'));var moment=require(_0x9ff8('0x4'));var BPromise=require(_0x9ff8('0x5'));var rp=require(_0x9ff8('0x6'));var fs=require('fs');var path=require(_0x9ff8('0x7'));var rimraf=require(_0x9ff8('0x8'));var config=require(_0x9ff8('0x9'));var attributes=require(_0x9ff8('0xa'));module[_0x9ff8('0xb')]=function(_0x512275,_0x1dd1df){return _0x512275[_0x9ff8('0xc')](_0x9ff8('0xd'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x9ff8('0xe'),'fields':[_0x9ff8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf0be=['path','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x6d4531,_0x162a71){var _0xf69490=function(_0x4cbb45){while(--_0x4cbb45){_0x6d4531['push'](_0x6d4531['shift']());}};_0xf69490(++_0x162a71);}(_0xf0be,0x1cf));var _0xef0b=function(_0x3fad19,_0x22a1f1){_0x3fad19=_0x3fad19-0x0;var _0xd5ec95=_0xf0be[_0x3fad19];return _0xd5ec95;};'use strict';var _=require(_0xef0b('0x0'));var util=require('util');var logger=require(_0xef0b('0x1'))(_0xef0b('0x2'));var moment=require(_0xef0b('0x3'));var BPromise=require(_0xef0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef0b('0x5'));var rimraf=require('rimraf');var config=require(_0xef0b('0x6'));var attributes=require(_0xef0b('0x7'));module[_0xef0b('0x8')]=function(_0x4afec9,_0x29482e){return _0x4afec9[_0xef0b('0x9')](_0xef0b('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xef0b('0xb'),'fields':[_0xef0b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 96ce3fb..e86bc9e 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 _0x0b36=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x0b36,0x14a));var _0x60b3=function(_0xeeb3e5,_0x103ee7){_0xeeb3e5=_0xeeb3e5-0x0;var _0x15609f=_0x0b36[_0xeeb3e5];return _0x15609f;};'use strict';var _=require(_0x60b3('0x0'));var util=require(_0x60b3('0x1'));var moment=require('moment');var BPromise=require(_0x60b3('0x2'));var rs=require(_0x60b3('0x3'));var fs=require('fs');var Redis=require(_0x60b3('0x4'));var db=require(_0x60b3('0x5'))['db'];var utils=require(_0x60b3('0x6'));var logger=require('../../config/logger')(_0x60b3('0x7'));var config=require(_0x60b3('0x8'));var jayson=require(_0x60b3('0x9'));var client=jayson[_0x60b3('0xa')][_0x60b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3836db,_0x2060dc,_0x162977){return new BPromise(function(_0x622a2b,_0x462194){return client[_0x60b3('0xc')](_0x3836db,_0x162977)[_0x60b3('0xd')](function(_0x35cff1){logger[_0x60b3('0xe')](_0x60b3('0xf'),_0x2060dc,_0x60b3('0x10'));logger[_0x60b3('0x11')](_0x60b3('0x12'),_0x2060dc,_0x60b3('0x10'),JSON[_0x60b3('0x13')](_0x35cff1));if(_0x35cff1['error']){if(_0x35cff1['error']['code']===0x1f4){logger[_0x60b3('0x14')](_0x60b3('0xf'),_0x2060dc,_0x35cff1[_0x60b3('0x14')]['message']);return _0x462194(_0x35cff1[_0x60b3('0x14')][_0x60b3('0x15')]);}logger[_0x60b3('0x14')](_0x60b3('0xf'),_0x2060dc,_0x35cff1[_0x60b3('0x14')]['message']);return _0x622a2b(_0x35cff1[_0x60b3('0x14')]['message']);}else{logger[_0x60b3('0xe')](_0x60b3('0xf'),_0x2060dc,_0x60b3('0x10'));_0x622a2b(_0x35cff1[_0x60b3('0x16')][_0x60b3('0x15')]);}})[_0x60b3('0x17')](function(_0x43e844){logger[_0x60b3('0x14')](_0x60b3('0xf'),_0x2060dc,_0x43e844);_0x462194(_0x43e844);});});} \ No newline at end of file +var _0x7089=['FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x565de9,_0x114287){var _0x5f5dab=function(_0x264405){while(--_0x264405){_0x565de9['push'](_0x565de9['shift']());}};_0x5f5dab(++_0x114287);}(_0x7089,0x1e7));var _0x9708=function(_0x34dc05,_0x4172ed){_0x34dc05=_0x34dc05-0x0;var _0x348b67=_0x7089[_0x34dc05];return _0x348b67;};'use strict';var _=require(_0x9708('0x0'));var util=require(_0x9708('0x1'));var moment=require(_0x9708('0x2'));var BPromise=require('bluebird');var rs=require(_0x9708('0x3'));var fs=require('fs');var Redis=require(_0x9708('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9708('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9708('0x6'));var client=jayson[_0x9708('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d442f,_0x2657b4,_0x482e54){return new BPromise(function(_0xbefc87,_0x5255d8){return client[_0x9708('0x8')](_0x5d442f,_0x482e54)[_0x9708('0x9')](function(_0x21a1b1){logger[_0x9708('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x2657b4,_0x9708('0xb'));logger[_0x9708('0xc')](_0x9708('0xd'),_0x2657b4,_0x9708('0xb'),JSON[_0x9708('0xe')](_0x21a1b1));if(_0x21a1b1[_0x9708('0xf')]){if(_0x21a1b1['error'][_0x9708('0x10')]===0x1f4){logger['error'](_0x9708('0x11'),_0x2657b4,_0x21a1b1[_0x9708('0xf')][_0x9708('0x12')]);return _0x5255d8(_0x21a1b1['error'][_0x9708('0x12')]);}logger[_0x9708('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2657b4,_0x21a1b1[_0x9708('0xf')][_0x9708('0x12')]);return _0xbefc87(_0x21a1b1[_0x9708('0xf')]['message']);}else{logger[_0x9708('0xa')](_0x9708('0x11'),_0x2657b4,_0x9708('0xb'));_0xbefc87(_0x21a1b1[_0x9708('0x13')][_0x9708('0x12')]);}})[_0x9708('0x14')](function(_0x111ea7){logger[_0x9708('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2657b4,_0x111ea7);_0x5255d8(_0x111ea7);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 13a6b13..5dde6e7 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 _0x5ac5=['get','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x5a6de2,_0x5c8b10){var _0x2c0525=function(_0x59d072){while(--_0x59d072){_0x5a6de2['push'](_0x5a6de2['shift']());}};_0x2c0525(++_0x5c8b10);}(_0x5ac5,0x123));var _0x55ac=function(_0x3a1cca,_0xf9cf7e){_0x3a1cca=_0x3a1cca-0x0;var _0x53b71c=_0x5ac5[_0x3a1cca];return _0x53b71c;};'use strict';var multer=require(_0x55ac('0x0'));var util=require('util');var path=require(_0x55ac('0x1'));var timeout=require(_0x55ac('0x2'));var express=require(_0x55ac('0x3'));var router=express['Router']();var fs_extra=require(_0x55ac('0x4'));var auth=require(_0x55ac('0x5'));var interaction=require(_0x55ac('0x6'));var config=require(_0x55ac('0x7'));var controller=require(_0x55ac('0x8'));router[_0x55ac('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x55ac('0xa'),auth[_0x55ac('0xb')](),controller[_0x55ac('0xc')]);router[_0x55ac('0x9')](_0x55ac('0xd'),auth[_0x55ac('0xb')](),controller[_0x55ac('0xe')]);router['post']('/',auth[_0x55ac('0xb')](),controller[_0x55ac('0xf')]);router[_0x55ac('0x10')](_0x55ac('0xd'),auth[_0x55ac('0xb')](),controller[_0x55ac('0x11')]);router['delete'](_0x55ac('0xd'),auth[_0x55ac('0xb')](),controller[_0x55ac('0x12')]);module[_0x55ac('0x13')]=router; \ No newline at end of file +var _0x440a=['multer','util','path','connect-timeout','Router','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','destroy','exports'];(function(_0x37b49f,_0x18c8ac){var _0x45988f=function(_0x41b5b2){while(--_0x41b5b2){_0x37b49f['push'](_0x37b49f['shift']());}};_0x45988f(++_0x18c8ac);}(_0x440a,0xab));var _0xa440=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x440a[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xa440('0x0'));var util=require(_0xa440('0x1'));var path=require(_0xa440('0x2'));var timeout=require(_0xa440('0x3'));var express=require('express');var router=express[_0xa440('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa440('0x5'));var config=require('../../config/environment');var controller=require(_0xa440('0x6'));router[_0xa440('0x7')]('/',auth[_0xa440('0x8')](),controller[_0xa440('0x9')]);router[_0xa440('0x7')](_0xa440('0xa'),auth['isAuthenticated'](),controller[_0xa440('0xb')]);router[_0xa440('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa440('0xc')]);router[_0xa440('0xd')]('/',auth[_0xa440('0x8')](),controller[_0xa440('0xe')]);router['put'](_0xa440('0xf'),auth[_0xa440('0x8')](),controller[_0xa440('0x10')]);router['delete'](_0xa440('0xf'),auth[_0xa440('0x8')](),controller[_0xa440('0x11')]);module[_0xa440('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 027185a..fbc468a 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 _0xca89=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','express'];(function(_0x524dba,_0x577658){var _0x3ddb71=function(_0xb257ce){while(--_0xb257ce){_0x524dba['push'](_0x524dba['shift']());}};_0x3ddb71(++_0x577658);}(_0xca89,0x183));var _0x9ca8=function(_0x5185ba,_0x52ac6b){_0x5185ba=_0x5185ba-0x0;var _0x313b6a=_0xca89[_0x5185ba];return _0x313b6a;};'use strict';var multer=require(_0x9ca8('0x0'));var util=require(_0x9ca8('0x1'));var path=require(_0x9ca8('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ca8('0x3'));var router=express[_0x9ca8('0x4')]();var fs_extra=require(_0x9ca8('0x5'));var auth=require(_0x9ca8('0x6'));var interaction=require(_0x9ca8('0x7'));var config=require(_0x9ca8('0x8'));var controller=require(_0x9ca8('0x9'));router['get']('/',auth[_0x9ca8('0xa')](),controller[_0x9ca8('0xb')]);router[_0x9ca8('0xc')](_0x9ca8('0xd'),auth[_0x9ca8('0xa')](),controller['show']);router[_0x9ca8('0xc')](_0x9ca8('0xe'),auth[_0x9ca8('0xa')](),controller[_0x9ca8('0xf')]);router[_0x9ca8('0xc')](_0x9ca8('0x10'),auth[_0x9ca8('0xa')](),controller[_0x9ca8('0x11')]);router[_0x9ca8('0x12')]('/',auth[_0x9ca8('0xa')](),controller[_0x9ca8('0x13')]);router[_0x9ca8('0x12')](_0x9ca8('0xe'),auth[_0x9ca8('0xa')](),controller['addConfiguration']);router[_0x9ca8('0x14')](_0x9ca8('0xd'),auth[_0x9ca8('0xa')](),controller['update']);router[_0x9ca8('0x15')]('/:id',auth[_0x9ca8('0xa')](),controller[_0x9ca8('0x16')]);module['exports']=router; \ No newline at end of file +var _0xca0f=['./intDeskAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1186c3,_0x4fd8fc){var _0x54962f=function(_0x1a165c){while(--_0x1a165c){_0x1186c3['push'](_0x1186c3['shift']());}};_0x54962f(++_0x4fd8fc);}(_0xca0f,0x101));var _0xfca0=function(_0x285e60,_0x2fa315){_0x285e60=_0x285e60-0x0;var _0x5a3fc4=_0xca0f[_0x285e60];return _0x5a3fc4;};'use strict';var multer=require('multer');var util=require(_0xfca0('0x0'));var path=require(_0xfca0('0x1'));var timeout=require('connect-timeout');var express=require(_0xfca0('0x2'));var router=express[_0xfca0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfca0('0x4'));var interaction=require(_0xfca0('0x5'));var config=require(_0xfca0('0x6'));var controller=require(_0xfca0('0x7'));router[_0xfca0('0x8')]('/',auth[_0xfca0('0x9')](),controller[_0xfca0('0xa')]);router['get']('/:id',auth[_0xfca0('0x9')](),controller['show']);router[_0xfca0('0x8')](_0xfca0('0xb'),auth[_0xfca0('0x9')](),controller[_0xfca0('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xfca0('0xd')]('/',auth['isAuthenticated'](),controller[_0xfca0('0xe')]);router[_0xfca0('0xd')]('/:id/configurations',auth[_0xfca0('0x9')](),controller[_0xfca0('0xf')]);router[_0xfca0('0x10')](_0xfca0('0x11'),auth[_0xfca0('0x9')](),controller[_0xfca0('0x12')]);router[_0xfca0('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xfca0('0x14')]);module[_0xfca0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d11d3d7..e52200d 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 _0x0b88=['sequelize','exports','STRING','basic','ENUM','newTab'];(function(_0x3f3859,_0x2a0d40){var _0xf4bfdd=function(_0x57d2f1){while(--_0x57d2f1){_0x3f3859['push'](_0x3f3859['shift']());}};_0xf4bfdd(++_0x2a0d40);}(_0x0b88,0x12c));var _0x80b8=function(_0x3253d7,_0x1cbcb4){_0x3253d7=_0x3253d7-0x0;var _0x2c6d28=_0x0b88[_0x3253d7];return _0x2c6d28;};'use strict';var Sequelize=require(_0x80b8('0x0'));module[_0x80b8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x80b8('0x2')]},'remoteUri':{'type':Sequelize[_0x80b8('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x80b8('0x3')),'defaultValue':_0x80b8('0x3')},'password':{'type':Sequelize[_0x80b8('0x2')]},'consumerKey':{'type':Sequelize[_0x80b8('0x2')]},'consumerSecret':{'type':Sequelize[_0x80b8('0x2')]},'token':{'type':Sequelize[_0x80b8('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x80b8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x80b8('0x4')]('integrationTab',_0x80b8('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xa53f=['STRING','basic','ENUM','newTab','exports'];(function(_0x639fd7,_0x2d4036){var _0x5b5c1a=function(_0x37a6bb){while(--_0x37a6bb){_0x639fd7['push'](_0x639fd7['shift']());}};_0x5b5c1a(++_0x2d4036);}(_0xa53f,0x1d5));var _0xfa53=function(_0x1eb445,_0x36331d){_0x1eb445=_0x1eb445-0x0;var _0x39d8d7=_0xa53f[_0x1eb445];return _0x39d8d7;};'use strict';var Sequelize=require('sequelize');module[_0xfa53('0x0')]={'name':{'type':Sequelize[_0xfa53('0x1')]},'description':{'type':Sequelize[_0xfa53('0x1')]},'username':{'type':Sequelize[_0xfa53('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xfa53('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xfa53('0x1')]},'consumerKey':{'type':Sequelize[_0xfa53('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xfa53('0x1')]},'tokenSecret':{'type':Sequelize[_0xfa53('0x1')]},'serverUrl':{'type':Sequelize[_0xfa53('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfa53('0x3')]('integrationTab',_0xfa53('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 4e48658..6300f35 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 _0x1870=['save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','filters','intersection','fields','query','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','DeskAccount','find','catch','create','update','body','findOne','DeskConfiguration','filter','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','toString','base64','entries','active','label','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../components/integrations/configuration','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject'];(function(_0x449c8c,_0x374beb){var _0x127e7a=function(_0xd2c3ed){while(--_0xd2c3ed){_0x449c8c['push'](_0x449c8c['shift']());}};_0x127e7a(++_0x374beb);}(_0x1870,0x144));var _0x0187=function(_0x46c75c,_0x5ee3ec){_0x46c75c=_0x46c75c-0x0;var _0x48e1d2=_0x1870[_0x46c75c];return _0x48e1d2;};'use strict';var emlformat=require(_0x0187('0x0'));var rimraf=require(_0x0187('0x1'));var zipdir=require(_0x0187('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0187('0x3'));var moment=require(_0x0187('0x4'));var BPromise=require(_0x0187('0x5'));var Mustache=require(_0x0187('0x6'));var util=require(_0x0187('0x7'));var path=require(_0x0187('0x8'));var sox=require(_0x0187('0x9'));var csv=require(_0x0187('0xa'));var ejs=require(_0x0187('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0187('0xc'));var jsforce=require(_0x0187('0xd'));var deskjs=require(_0x0187('0xe'));var toCsv=require(_0x0187('0xa'));var querystring=require(_0x0187('0xf'));var Papa=require(_0x0187('0x10'));var Redis=require(_0x0187('0x11'));var authService=require(_0x0187('0x12'));var qs=require(_0x0187('0x13'));var as=require(_0x0187('0x14'));var hardwareService=require(_0x0187('0x15'));var logger=require(_0x0187('0x16'))(_0x0187('0x17'));var utils=require(_0x0187('0x18'));var config=require(_0x0187('0x19'));var licenseUtil=require(_0x0187('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0187('0x1b'));function respondWithStatusCode(_0x2c7b63,_0x41065e){_0x41065e=_0x41065e||0xcc;return function(_0x44bdde){if(_0x44bdde){return _0x2c7b63[_0x0187('0x1c')](_0x41065e);}return _0x2c7b63['status'](_0x41065e)[_0x0187('0x1d')]();};}function respondWithResult(_0x1c951b,_0x1a3f5c){_0x1a3f5c=_0x1a3f5c||0xc8;return function(_0xcb5d69){if(_0xcb5d69){return _0x1c951b['status'](_0x1a3f5c)[_0x0187('0x1e')](_0xcb5d69);}};}function respondWithFilteredResult(_0x5639a5,_0x4f29fe){return function(_0x31bbe4){if(_0x31bbe4){var _0x578ef8=typeof _0x4f29fe['offset']===_0x0187('0x1f')&&typeof _0x4f29fe[_0x0187('0x20')]===_0x0187('0x1f');var _0x2adff2=_0x31bbe4[_0x0187('0x21')];var _0x20576a=_0x578ef8?0x0:_0x4f29fe[_0x0187('0x22')];var _0x1e966f=_0x578ef8?_0x31bbe4['count']:_0x4f29fe[_0x0187('0x22')]+_0x4f29fe['limit'];var _0x3fd1b3;if(_0x1e966f>=_0x2adff2){_0x1e966f=_0x2adff2;_0x3fd1b3=0xc8;}else{_0x3fd1b3=0xce;}_0x5639a5[_0x0187('0x23')](_0x3fd1b3);return _0x5639a5[_0x0187('0x24')](_0x0187('0x25'),_0x20576a+'-'+_0x1e966f+'/'+_0x2adff2)[_0x0187('0x1e')](_0x31bbe4);}return null;};}function patchUpdates(_0x4602e5){return function(_0x5a5d6e){try{jsonpatch['apply'](_0x5a5d6e,_0x4602e5,!![]);}catch(_0x58c0cb){return BPromise[_0x0187('0x26')](_0x58c0cb);}return _0x5a5d6e[_0x0187('0x27')]();};}function saveUpdates(_0x204f7b,_0x54d893){return function(_0x52e31c){if(_0x52e31c){return _0x52e31c['update'](_0x204f7b)[_0x0187('0x28')](function(_0x3e9ea3){return _0x3e9ea3;});}return null;};}function removeEntity(_0x143b8b,_0x3ada47){return function(_0x4244fe){if(_0x4244fe){return _0x4244fe[_0x0187('0x29')]()[_0x0187('0x28')](function(){_0x143b8b[_0x0187('0x23')](0xcc)[_0x0187('0x1d')]();});}};}function handleEntityNotFound(_0x236e6f,_0x5c55e5){return function(_0x952471){if(!_0x952471){_0x236e6f[_0x0187('0x1c')](0x194);}return _0x952471;};}function handleError(_0x2fe449,_0x1faf17){_0x1faf17=_0x1faf17||0x1f4;return function(_0x1d3842){logger[_0x0187('0x2a')](_0x1d3842[_0x0187('0x2b')]);if(_0x1d3842[_0x0187('0x2c')]){delete _0x1d3842[_0x0187('0x2c')];}_0x2fe449[_0x0187('0x23')](_0x1faf17)[_0x0187('0x2d')](_0x1d3842);};}exports[_0x0187('0x2e')]=function(_0x4d034e,_0x4cee56){var _0xc1fcd8={},_0x2659e0={},_0x4a0913={'count':0x0,'rows':[]};var _0x421cf3=_[_0x0187('0x2f')](db['DeskAccount'][_0x0187('0x30')],function(_0x3bfa3d){return{'name':_0x3bfa3d[_0x0187('0x31')],'type':_0x3bfa3d[_0x0187('0x32')][_0x0187('0x33')]};});_0x2659e0[_0x0187('0x34')]=_['map'](_0x421cf3,'name');_0x2659e0['query']=_['keys'](_0x4d034e['query']);_0x2659e0[_0x0187('0x35')]=_[_0x0187('0x36')](_0x2659e0[_0x0187('0x34')],_0x2659e0['query']);_0xc1fcd8['attributes']=_['intersection'](_0x2659e0[_0x0187('0x34')],qs[_0x0187('0x37')](_0x4d034e[_0x0187('0x38')][_0x0187('0x37')]));_0xc1fcd8[_0x0187('0x39')]=_0xc1fcd8[_0x0187('0x39')]['length']?_0xc1fcd8[_0x0187('0x39')]:_0x2659e0['model'];if(!_0x4d034e[_0x0187('0x38')]['hasOwnProperty'](_0x0187('0x3a'))){_0xc1fcd8[_0x0187('0x20')]=qs['limit'](_0x4d034e[_0x0187('0x38')][_0x0187('0x20')]);_0xc1fcd8[_0x0187('0x22')]=qs[_0x0187('0x22')](_0x4d034e[_0x0187('0x38')][_0x0187('0x22')]);}_0xc1fcd8[_0x0187('0x3b')]=qs[_0x0187('0x3c')](_0x4d034e['query'][_0x0187('0x3c')]);_0xc1fcd8['where']=qs['filters'](_[_0x0187('0x3d')](_0x4d034e[_0x0187('0x38')],_0x2659e0[_0x0187('0x35')]),_0x421cf3);if(_0x4d034e[_0x0187('0x38')]['filter']){_0xc1fcd8[_0x0187('0x3e')]=_[_0x0187('0x3f')](_0xc1fcd8[_0x0187('0x3e')],{'$or':_['map'](_0x421cf3,function(_0x1e733e){if(_0x1e733e[_0x0187('0x32')]!==_0x0187('0x40')){var _0x31f4bc={};_0x31f4bc[_0x1e733e[_0x0187('0x2c')]]={'$like':'%'+_0x4d034e['query']['filter']+'%'};return _0x31f4bc;}})});}_0xc1fcd8=_['merge']({},_0xc1fcd8,_0x4d034e[_0x0187('0x41')]);var _0x3a1c9d={'where':_0xc1fcd8[_0x0187('0x3e')]};return db['DeskAccount'][_0x0187('0x21')](_0x3a1c9d)['then'](function(_0x4e6d64){_0x4a0913['count']=_0x4e6d64;if(_0x4d034e[_0x0187('0x38')][_0x0187('0x42')]){_0xc1fcd8[_0x0187('0x43')]=[{'all':!![]}];}return db['DeskAccount'][_0x0187('0x44')](_0xc1fcd8);})[_0x0187('0x28')](function(_0x2891d7){_0x4a0913[_0x0187('0x45')]=_0x2891d7;return _0x4a0913;})[_0x0187('0x28')](respondWithFilteredResult(_0x4cee56,_0xc1fcd8))['catch'](handleError(_0x4cee56,null));};exports[_0x0187('0x46')]=function(_0x5e7561,_0x37d396){var _0x4b3ca9={'raw':![],'where':{'id':_0x5e7561[_0x0187('0x47')]['id']}},_0x2cf340={};_0x2cf340[_0x0187('0x34')]=_[_0x0187('0x48')](db['DeskAccount']['rawAttributes']);_0x2cf340['query']=_[_0x0187('0x48')](_0x5e7561['query']);_0x2cf340[_0x0187('0x35')]=_[_0x0187('0x36')](_0x2cf340['model'],_0x2cf340[_0x0187('0x38')]);_0x4b3ca9[_0x0187('0x39')]=_[_0x0187('0x36')](_0x2cf340[_0x0187('0x34')],qs['fields'](_0x5e7561[_0x0187('0x38')][_0x0187('0x37')]));_0x4b3ca9[_0x0187('0x39')]=_0x4b3ca9[_0x0187('0x39')][_0x0187('0x49')]?_0x4b3ca9[_0x0187('0x39')]:_0x2cf340[_0x0187('0x34')];if(_0x5e7561[_0x0187('0x38')][_0x0187('0x42')]){_0x4b3ca9[_0x0187('0x43')]=[{'all':!![]}];}_0x4b3ca9=_[_0x0187('0x3f')]({},_0x4b3ca9,_0x5e7561[_0x0187('0x41')]);return db[_0x0187('0x4a')][_0x0187('0x4b')](_0x4b3ca9)[_0x0187('0x28')](handleEntityNotFound(_0x37d396,null))[_0x0187('0x28')](respondWithResult(_0x37d396,null))[_0x0187('0x4c')](handleError(_0x37d396,null));};exports['create']=function(_0x4f23c,_0x1ce0ed){return db['DeskAccount'][_0x0187('0x4d')](_0x4f23c['body'],{})[_0x0187('0x28')](respondWithResult(_0x1ce0ed,0xc9))[_0x0187('0x4c')](handleError(_0x1ce0ed,null));};exports[_0x0187('0x4e')]=function(_0x2a795d,_0x2f6209){if(_0x2a795d['body']['id']){delete _0x2a795d[_0x0187('0x4f')]['id'];}return db[_0x0187('0x4a')][_0x0187('0x4b')]({'where':{'id':_0x2a795d[_0x0187('0x47')]['id']}})[_0x0187('0x28')](handleEntityNotFound(_0x2f6209,null))['then'](saveUpdates(_0x2a795d[_0x0187('0x4f')],null))[_0x0187('0x28')](respondWithResult(_0x2f6209,null))[_0x0187('0x4c')](handleError(_0x2f6209,null));};exports[_0x0187('0x29')]=function(_0x8e2586,_0x1b7821){return db['DeskAccount']['find']({'where':{'id':_0x8e2586['params']['id']}})[_0x0187('0x28')](handleEntityNotFound(_0x1b7821,null))['then'](removeEntity(_0x1b7821,null))[_0x0187('0x4c')](handleError(_0x1b7821,null));};exports['getConfigurations']=function(_0x3decfc,_0x21c3e4,_0x3d75a7){var _0x238277={};var _0x53ad48={};var _0x14a0ce;var _0x1f3d0a;return db[_0x0187('0x4a')][_0x0187('0x50')]({'where':{'id':_0x3decfc[_0x0187('0x47')]['id']}})[_0x0187('0x28')](handleEntityNotFound(_0x21c3e4,null))[_0x0187('0x28')](function(_0x17fc5b){if(_0x17fc5b){_0x14a0ce=_0x17fc5b;_0x53ad48['model']=_[_0x0187('0x48')](db[_0x0187('0x51')][_0x0187('0x30')]);_0x53ad48[_0x0187('0x38')]=_[_0x0187('0x48')](_0x3decfc[_0x0187('0x38')]);_0x53ad48[_0x0187('0x35')]=_[_0x0187('0x36')](_0x53ad48[_0x0187('0x34')],_0x53ad48[_0x0187('0x38')]);_0x238277[_0x0187('0x39')]=_[_0x0187('0x36')](_0x53ad48['model'],qs[_0x0187('0x37')](_0x3decfc[_0x0187('0x38')][_0x0187('0x37')]));_0x238277[_0x0187('0x39')]=_0x238277[_0x0187('0x39')][_0x0187('0x49')]?_0x238277['attributes']:_0x53ad48[_0x0187('0x34')];_0x238277[_0x0187('0x3b')]=qs[_0x0187('0x3c')](_0x3decfc[_0x0187('0x38')][_0x0187('0x3c')]);_0x238277[_0x0187('0x3e')]=qs['filters'](_[_0x0187('0x3d')](_0x3decfc['query'],_0x53ad48[_0x0187('0x35')]));if(_0x3decfc[_0x0187('0x38')][_0x0187('0x52')]){_0x238277[_0x0187('0x3e')]=_['merge'](_0x238277[_0x0187('0x3e')],{'$or':_['map'](_0x238277[_0x0187('0x39')],function(_0x1d4870){var _0x3d7e3f={};_0x3d7e3f[_0x1d4870]={'$like':'%'+_0x3decfc['query']['filter']+'%'};return _0x3d7e3f;})});}_0x238277=_[_0x0187('0x3f')]({},_0x238277,_0x3decfc['options']);return _0x14a0ce[_0x0187('0x53')](_0x238277);}})['then'](function(_0x3e4a9e){if(_0x3e4a9e){_0x1f3d0a=_0x3e4a9e['length'];if(!_0x3decfc[_0x0187('0x38')][_0x0187('0x54')](_0x0187('0x3a'))){_0x238277[_0x0187('0x20')]=qs['limit'](_0x3decfc[_0x0187('0x38')][_0x0187('0x20')]);_0x238277[_0x0187('0x22')]=qs[_0x0187('0x22')](_0x3decfc[_0x0187('0x38')][_0x0187('0x22')]);}return _0x14a0ce[_0x0187('0x53')](_0x238277);}})[_0x0187('0x28')](function(_0x286d5f){if(_0x286d5f){return _0x286d5f?{'count':_0x1f3d0a,'rows':_0x286d5f}:null;}})[_0x0187('0x28')](respondWithResult(_0x21c3e4,null))[_0x0187('0x4c')](handleError(_0x21c3e4,null));};exports[_0x0187('0x55')]=function(_0x3e5c85,_0x403d9c,_0x19db1e){if(_0x3e5c85[_0x0187('0x4f')]['id']){delete _0x3e5c85[_0x0187('0x4f')]['id'];}return db[_0x0187('0x4a')][_0x0187('0x50')]({'where':{'id':_0x3e5c85['params']['id']}})[_0x0187('0x28')](handleEntityNotFound(_0x403d9c,null))[_0x0187('0x28')](function(_0x22e57f){if(_0x22e57f){_0x3e5c85[_0x0187('0x4f')][_0x0187('0x56')]=_0x22e57f['id'];_0x3e5c85[_0x0187('0x4f')][_0x0187('0x57')]=integrations[_0x0187('0x58')](_0x3e5c85[_0x0187('0x4f')]['channel'],_0x3e5c85['body']['type']);_0x3e5c85[_0x0187('0x4f')]['Descriptions']=integrations[_0x0187('0x59')](_0x3e5c85[_0x0187('0x4f')][_0x0187('0x5a')],_0x3e5c85['body'][_0x0187('0x32')]);return db[_0x0187('0x51')][_0x0187('0x4d')](_0x3e5c85[_0x0187('0x4f')],{'include':[{'model':db[_0x0187('0x5b')],'as':_0x0187('0x57')},{'model':db[_0x0187('0x5b')],'as':_0x0187('0x5c')}]});}return null;})['then'](respondWithResult(_0x403d9c,null))[_0x0187('0x4c')](handleError(_0x403d9c,null));};exports[_0x0187('0x5d')]=function(_0x5ce03b,_0x4c79c0,_0x29825a){var _0x5dde10=[{'name':_0x0187('0x5e'),'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 _0x2277fe='';return db[_0x0187('0x4a')]['findOne']({'where':{'id':_0x5ce03b[_0x0187('0x47')]['id']},'attributes':['id',_0x0187('0x5f'),_0x0187('0x60'),_0x0187('0x61'),_0x0187('0x62'),_0x0187('0x63'),_0x0187('0x64'),_0x0187('0x65'),_0x0187('0x66')]})[_0x0187('0x28')](handleEntityNotFound(_0x4c79c0,null))[_0x0187('0x28')](function(_0x2bffd7){if(_0x2bffd7){_0x2277fe=_0x2bffd7[_0x0187('0x5f')];var _0x38949d=_0x2277fe[_0x0187('0x67')](-0x1);if(_0x38949d==='/'){_0x2277fe=_0x2277fe[_0x0187('0x68')](0x0,_0x2277fe[_0x0187('0x69')](_0x38949d));}var _0x3f52e5={'method':_0x0187('0x6a'),'uri':util[_0x0187('0x6b')](_0x0187('0x6c'),_0x2277fe),'headers':{'Content-Type':_0x0187('0x6d'),'Accept':'application/json'},'json':!![]};if(_0x2bffd7[_0x0187('0x60')]===_0x0187('0x6e')){_0x3f52e5[_0x0187('0x6f')][_0x0187('0x70')]=util[_0x0187('0x6b')]('Basic\x20%s',new Buffer(util[_0x0187('0x6b')]('%s:%s',_0x2bffd7[_0x0187('0x61')],_0x2bffd7['password']))[_0x0187('0x71')](_0x0187('0x72')));}return rp(_0x3f52e5)['then'](function(_0x3b363d){return _0x5dde10['concat'](_[_0x0187('0x2f')](_0x3b363d['_embedded'][_0x0187('0x73')],function(_0x3dae86){return{'id':_0x3dae86[_0x0187('0x2c')],'name':_0x3dae86[_0x0187('0x2c')],'type':_0x3dae86['type'],'active':_0x3dae86[_0x0187('0x74')],'label':_0x3dae86[_0x0187('0x75')],'custom':!![]};}));});}})['then'](function(_0x75cfd8){return{'count':_0x75cfd8[_0x0187('0x49')],'rows':_0x75cfd8};})[_0x0187('0x28')](respondWithResult(_0x4c79c0,null))['catch'](function(_0x4f04de){var _0x4225f2=_0x5ce03b['query'][_0x0187('0x76')]?0x1f4:_0x4f04de[_0x0187('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x0187('0x5d'),_0x4225f2,JSON['stringify'](_0x4f04de));delete _0x4f04de[_0x0187('0x2c')];if(_0x4225f2===0x191){_0x4225f2=0x190;}_0x4c79c0[_0x0187('0x23')](_0x4225f2)[_0x0187('0x2d')](_0x5ce03b['query'][_0x0187('0x76')]?{'message':_0x0187('0x78'),'statusCode':_0x4f04de['statusCode']}:_0x4f04de);});}; \ No newline at end of file +var _0x256e=['fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','options','includeAll','include','show','keys','find','catch','create','body','params','destroy','getConfigurations','DeskConfiguration','order','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','basic','headers','Authorization','format','Basic\x20%s','toString','base64','concat','_embedded','entries','active','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','undefined','count','offset','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','DeskAccount','rawAttributes'];(function(_0x552de1,_0x3abdb9){var _0x1a1fa3=function(_0x18af61){while(--_0x18af61){_0x552de1['push'](_0x552de1['shift']());}};_0x1a1fa3(++_0x3abdb9);}(_0x256e,0xb5));var _0xe256=function(_0x4e7170,_0x431ad8){_0x4e7170=_0x4e7170-0x0;var _0x305855=_0x256e[_0x4e7170];return _0x305855;};'use strict';var emlformat=require(_0xe256('0x0'));var rimraf=require(_0xe256('0x1'));var zipdir=require(_0xe256('0x2'));var jsonpatch=require(_0xe256('0x3'));var rp=require(_0xe256('0x4'));var moment=require(_0xe256('0x5'));var BPromise=require(_0xe256('0x6'));var Mustache=require(_0xe256('0x7'));var util=require('util');var path=require(_0xe256('0x8'));var sox=require(_0xe256('0x9'));var csv=require(_0xe256('0xa'));var ejs=require(_0xe256('0xb'));var fs=require('fs');var fs_extra=require(_0xe256('0xc'));var _=require(_0xe256('0xd'));var squel=require(_0xe256('0xe'));var crypto=require(_0xe256('0xf'));var jsforce=require(_0xe256('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe256('0xa'));var querystring=require('querystring');var Papa=require(_0xe256('0x11'));var Redis=require(_0xe256('0x12'));var authService=require(_0xe256('0x13'));var qs=require(_0xe256('0x14'));var as=require(_0xe256('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe256('0x16'))('api');var utils=require(_0xe256('0x17'));var config=require(_0xe256('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5a98fe,_0x1a5f9d){_0x1a5f9d=_0x1a5f9d||0xcc;return function(_0x276155){if(_0x276155){return _0x5a98fe[_0xe256('0x19')](_0x1a5f9d);}return _0x5a98fe[_0xe256('0x1a')](_0x1a5f9d)[_0xe256('0x1b')]();};}function respondWithResult(_0x350253,_0x5f5156){_0x5f5156=_0x5f5156||0xc8;return function(_0x536c7b){if(_0x536c7b){return _0x350253['status'](_0x5f5156)['json'](_0x536c7b);}};}function respondWithFilteredResult(_0x31aac4,_0x479dee){return function(_0x11628e){if(_0x11628e){var _0x43665a=typeof _0x479dee['offset']===_0xe256('0x1c')&&typeof _0x479dee['limit']===_0xe256('0x1c');var _0x48a390=_0x11628e[_0xe256('0x1d')];var _0x19898=_0x43665a?0x0:_0x479dee['offset'];var _0x3a7460=_0x43665a?_0x11628e[_0xe256('0x1d')]:_0x479dee[_0xe256('0x1e')]+_0x479dee['limit'];var _0x2b3397;if(_0x3a7460>=_0x48a390){_0x3a7460=_0x48a390;_0x2b3397=0xc8;}else{_0x2b3397=0xce;}_0x31aac4['status'](_0x2b3397);return _0x31aac4['set'](_0xe256('0x1f'),_0x19898+'-'+_0x3a7460+'/'+_0x48a390)[_0xe256('0x20')](_0x11628e);}return null;};}function patchUpdates(_0x48b48d){return function(_0x6cfa74){try{jsonpatch['apply'](_0x6cfa74,_0x48b48d,!![]);}catch(_0x314276){return BPromise[_0xe256('0x21')](_0x314276);}return _0x6cfa74[_0xe256('0x22')]();};}function saveUpdates(_0x3b226b,_0x3ccdb0){return function(_0x497fcf){if(_0x497fcf){return _0x497fcf[_0xe256('0x23')](_0x3b226b)['then'](function(_0x28bf2c){return _0x28bf2c;});}return null;};}function removeEntity(_0x2f5815,_0x4e357f){return function(_0x41542a){if(_0x41542a){return _0x41542a['destroy']()[_0xe256('0x24')](function(){_0x2f5815['status'](0xcc)[_0xe256('0x1b')]();});}};}function handleEntityNotFound(_0x377010,_0x4addfb){return function(_0xfb14a3){if(!_0xfb14a3){_0x377010[_0xe256('0x19')](0x194);}return _0xfb14a3;};}function handleError(_0x40931f,_0x5ba64c){_0x5ba64c=_0x5ba64c||0x1f4;return function(_0x58d569){logger[_0xe256('0x25')](_0x58d569[_0xe256('0x26')]);if(_0x58d569[_0xe256('0x27')]){delete _0x58d569[_0xe256('0x27')];}_0x40931f['status'](_0x5ba64c)[_0xe256('0x28')](_0x58d569);};}exports[_0xe256('0x29')]=function(_0x5ac197,_0x144f00){var _0x49b1d5={},_0x5969ed={},_0x465052={'count':0x0,'rows':[]};var _0x24044e=_[_0xe256('0x2a')](db[_0xe256('0x2b')][_0xe256('0x2c')],function(_0x2a622a){return{'name':_0x2a622a[_0xe256('0x2d')],'type':_0x2a622a[_0xe256('0x2e')][_0xe256('0x2f')]};});_0x5969ed[_0xe256('0x30')]=_['map'](_0x24044e,_0xe256('0x27'));_0x5969ed['query']=_['keys'](_0x5ac197[_0xe256('0x31')]);_0x5969ed[_0xe256('0x32')]=_[_0xe256('0x33')](_0x5969ed[_0xe256('0x30')],_0x5969ed[_0xe256('0x31')]);_0x49b1d5['attributes']=_['intersection'](_0x5969ed[_0xe256('0x30')],qs[_0xe256('0x34')](_0x5ac197[_0xe256('0x31')]['fields']));_0x49b1d5['attributes']=_0x49b1d5[_0xe256('0x35')][_0xe256('0x36')]?_0x49b1d5[_0xe256('0x35')]:_0x5969ed[_0xe256('0x30')];if(!_0x5ac197[_0xe256('0x31')][_0xe256('0x37')](_0xe256('0x38'))){_0x49b1d5[_0xe256('0x39')]=qs[_0xe256('0x39')](_0x5ac197['query'][_0xe256('0x39')]);_0x49b1d5[_0xe256('0x1e')]=qs[_0xe256('0x1e')](_0x5ac197['query'][_0xe256('0x1e')]);}_0x49b1d5['order']=qs[_0xe256('0x3a')](_0x5ac197['query'][_0xe256('0x3a')]);_0x49b1d5['where']=qs['filters'](_[_0xe256('0x3b')](_0x5ac197[_0xe256('0x31')],_0x5969ed[_0xe256('0x32')]),_0x24044e);if(_0x5ac197[_0xe256('0x31')][_0xe256('0x3c')]){_0x49b1d5['where']=_['merge'](_0x49b1d5[_0xe256('0x3d')],{'$or':_[_0xe256('0x2a')](_0x24044e,function(_0x483e22){if(_0x483e22[_0xe256('0x2e')]!=='VIRTUAL'){var _0x40dc36={};_0x40dc36[_0x483e22[_0xe256('0x27')]]={'$like':'%'+_0x5ac197['query'][_0xe256('0x3c')]+'%'};return _0x40dc36;}})});}_0x49b1d5=_[_0xe256('0x3e')]({},_0x49b1d5,_0x5ac197[_0xe256('0x3f')]);var _0x41cf98={'where':_0x49b1d5[_0xe256('0x3d')]};return db[_0xe256('0x2b')][_0xe256('0x1d')](_0x41cf98)[_0xe256('0x24')](function(_0x2aa130){_0x465052['count']=_0x2aa130;if(_0x5ac197[_0xe256('0x31')][_0xe256('0x40')]){_0x49b1d5[_0xe256('0x41')]=[{'all':!![]}];}return db[_0xe256('0x2b')]['findAll'](_0x49b1d5);})[_0xe256('0x24')](function(_0x1e23cf){_0x465052['rows']=_0x1e23cf;return _0x465052;})[_0xe256('0x24')](respondWithFilteredResult(_0x144f00,_0x49b1d5))['catch'](handleError(_0x144f00,null));};exports[_0xe256('0x42')]=function(_0x176e54,_0x4090b9){var _0x1564e4={'raw':![],'where':{'id':_0x176e54['params']['id']}},_0x3734c7={};_0x3734c7['model']=_[_0xe256('0x43')](db['DeskAccount'][_0xe256('0x2c')]);_0x3734c7[_0xe256('0x31')]=_[_0xe256('0x43')](_0x176e54[_0xe256('0x31')]);_0x3734c7[_0xe256('0x32')]=_[_0xe256('0x33')](_0x3734c7[_0xe256('0x30')],_0x3734c7[_0xe256('0x31')]);_0x1564e4[_0xe256('0x35')]=_[_0xe256('0x33')](_0x3734c7[_0xe256('0x30')],qs[_0xe256('0x34')](_0x176e54[_0xe256('0x31')][_0xe256('0x34')]));_0x1564e4[_0xe256('0x35')]=_0x1564e4[_0xe256('0x35')][_0xe256('0x36')]?_0x1564e4['attributes']:_0x3734c7[_0xe256('0x30')];if(_0x176e54['query'][_0xe256('0x40')]){_0x1564e4['include']=[{'all':!![]}];}_0x1564e4=_['merge']({},_0x1564e4,_0x176e54['options']);return db[_0xe256('0x2b')][_0xe256('0x44')](_0x1564e4)[_0xe256('0x24')](handleEntityNotFound(_0x4090b9,null))[_0xe256('0x24')](respondWithResult(_0x4090b9,null))[_0xe256('0x45')](handleError(_0x4090b9,null));};exports['create']=function(_0x34a79e,_0x11c74f){return db[_0xe256('0x2b')][_0xe256('0x46')](_0x34a79e[_0xe256('0x47')],{})[_0xe256('0x24')](respondWithResult(_0x11c74f,0xc9))['catch'](handleError(_0x11c74f,null));};exports[_0xe256('0x23')]=function(_0x1f9a2b,_0xec01cf){if(_0x1f9a2b[_0xe256('0x47')]['id']){delete _0x1f9a2b[_0xe256('0x47')]['id'];}return db['DeskAccount'][_0xe256('0x44')]({'where':{'id':_0x1f9a2b[_0xe256('0x48')]['id']}})['then'](handleEntityNotFound(_0xec01cf,null))[_0xe256('0x24')](saveUpdates(_0x1f9a2b[_0xe256('0x47')],null))[_0xe256('0x24')](respondWithResult(_0xec01cf,null))['catch'](handleError(_0xec01cf,null));};exports[_0xe256('0x49')]=function(_0x247827,_0x8ef407){return db[_0xe256('0x2b')][_0xe256('0x44')]({'where':{'id':_0x247827[_0xe256('0x48')]['id']}})[_0xe256('0x24')](handleEntityNotFound(_0x8ef407,null))[_0xe256('0x24')](removeEntity(_0x8ef407,null))[_0xe256('0x45')](handleError(_0x8ef407,null));};exports[_0xe256('0x4a')]=function(_0x3d649d,_0x56572f,_0x5a4450){var _0x404efa={};var _0x1d2b65={};var _0x2c063b;var _0x41cb49;return db['DeskAccount']['findOne']({'where':{'id':_0x3d649d[_0xe256('0x48')]['id']}})[_0xe256('0x24')](handleEntityNotFound(_0x56572f,null))[_0xe256('0x24')](function(_0x113ae1){if(_0x113ae1){_0x2c063b=_0x113ae1;_0x1d2b65['model']=_[_0xe256('0x43')](db[_0xe256('0x4b')]['rawAttributes']);_0x1d2b65['query']=_[_0xe256('0x43')](_0x3d649d[_0xe256('0x31')]);_0x1d2b65[_0xe256('0x32')]=_[_0xe256('0x33')](_0x1d2b65['model'],_0x1d2b65[_0xe256('0x31')]);_0x404efa['attributes']=_[_0xe256('0x33')](_0x1d2b65[_0xe256('0x30')],qs[_0xe256('0x34')](_0x3d649d[_0xe256('0x31')][_0xe256('0x34')]));_0x404efa[_0xe256('0x35')]=_0x404efa[_0xe256('0x35')][_0xe256('0x36')]?_0x404efa[_0xe256('0x35')]:_0x1d2b65['model'];_0x404efa[_0xe256('0x4c')]=qs['sort'](_0x3d649d['query'][_0xe256('0x3a')]);_0x404efa['where']=qs[_0xe256('0x32')](_[_0xe256('0x3b')](_0x3d649d[_0xe256('0x31')],_0x1d2b65[_0xe256('0x32')]));if(_0x3d649d[_0xe256('0x31')]['filter']){_0x404efa['where']=_[_0xe256('0x3e')](_0x404efa[_0xe256('0x3d')],{'$or':_[_0xe256('0x2a')](_0x404efa[_0xe256('0x35')],function(_0x469fd3){var _0x12ba2e={};_0x12ba2e[_0x469fd3]={'$like':'%'+_0x3d649d['query']['filter']+'%'};return _0x12ba2e;})});}_0x404efa=_[_0xe256('0x3e')]({},_0x404efa,_0x3d649d['options']);return _0x2c063b[_0xe256('0x4a')](_0x404efa);}})[_0xe256('0x24')](function(_0x31ce09){if(_0x31ce09){_0x41cb49=_0x31ce09['length'];if(!_0x3d649d[_0xe256('0x31')][_0xe256('0x37')]('nolimit')){_0x404efa[_0xe256('0x39')]=qs[_0xe256('0x39')](_0x3d649d[_0xe256('0x31')][_0xe256('0x39')]);_0x404efa[_0xe256('0x1e')]=qs[_0xe256('0x1e')](_0x3d649d[_0xe256('0x31')][_0xe256('0x1e')]);}return _0x2c063b['getConfigurations'](_0x404efa);}})[_0xe256('0x24')](function(_0x5d4017){if(_0x5d4017){return _0x5d4017?{'count':_0x41cb49,'rows':_0x5d4017}:null;}})[_0xe256('0x24')](respondWithResult(_0x56572f,null))[_0xe256('0x45')](handleError(_0x56572f,null));};exports['addConfiguration']=function(_0x1c4ddf,_0x2f814c,_0x2de049){if(_0x1c4ddf[_0xe256('0x47')]['id']){delete _0x1c4ddf['body']['id'];}return db['DeskAccount'][_0xe256('0x4d')]({'where':{'id':_0x1c4ddf['params']['id']}})['then'](handleEntityNotFound(_0x2f814c,null))[_0xe256('0x24')](function(_0x5ee927){if(_0x5ee927){_0x1c4ddf[_0xe256('0x47')][_0xe256('0x4e')]=_0x5ee927['id'];_0x1c4ddf[_0xe256('0x47')][_0xe256('0x4f')]=integrations[_0xe256('0x50')](_0x1c4ddf[_0xe256('0x47')][_0xe256('0x51')],_0x1c4ddf[_0xe256('0x47')][_0xe256('0x2e')]);_0x1c4ddf[_0xe256('0x47')][_0xe256('0x52')]=integrations[_0xe256('0x53')](_0x1c4ddf[_0xe256('0x47')][_0xe256('0x51')],_0x1c4ddf[_0xe256('0x47')]['type']);return db[_0xe256('0x4b')]['create'](_0x1c4ddf[_0xe256('0x47')],{'include':[{'model':db[_0xe256('0x54')],'as':_0xe256('0x4f')},{'model':db['DeskField'],'as':_0xe256('0x52')}]});}return null;})[_0xe256('0x24')](respondWithResult(_0x2f814c,null))[_0xe256('0x45')](handleError(_0x2f814c,null));};exports['getFields']=function(_0x2a431b,_0x408a8d,_0x4ccdb6){var _0x564638=[{'name':_0xe256('0x55'),'label':_0xe256('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x47ee56='';return db[_0xe256('0x2b')][_0xe256('0x4d')]({'where':{'id':_0x2a431b[_0xe256('0x48')]['id']},'attributes':['id','remoteUri',_0xe256('0x56'),_0xe256('0x57'),_0xe256('0x58'),_0xe256('0x59'),_0xe256('0x5a'),_0xe256('0x5b'),_0xe256('0x5c')]})[_0xe256('0x24')](handleEntityNotFound(_0x408a8d,null))[_0xe256('0x24')](function(_0x367f3f){if(_0x367f3f){_0x47ee56=_0x367f3f[_0xe256('0x5d')];var _0x3b102e=_0x47ee56[_0xe256('0x5e')](-0x1);if(_0x3b102e==='/'){_0x47ee56=_0x47ee56[_0xe256('0x5f')](0x0,_0x47ee56[_0xe256('0x60')](_0x3b102e));}var _0x596737={'method':_0xe256('0x61'),'uri':util['format']('%s/custom_fields',_0x47ee56),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x367f3f[_0xe256('0x56')]===_0xe256('0x62')){_0x596737[_0xe256('0x63')][_0xe256('0x64')]=util[_0xe256('0x65')](_0xe256('0x66'),new Buffer(util[_0xe256('0x65')]('%s:%s',_0x367f3f[_0xe256('0x57')],_0x367f3f[_0xe256('0x58')]))[_0xe256('0x67')](_0xe256('0x68')));}return rp(_0x596737)['then'](function(_0x2a8a2){return _0x564638[_0xe256('0x69')](_[_0xe256('0x2a')](_0x2a8a2[_0xe256('0x6a')][_0xe256('0x6b')],function(_0x9eea24){return{'id':_0x9eea24['name'],'name':_0x9eea24[_0xe256('0x27')],'type':_0x9eea24['type'],'active':_0x9eea24[_0xe256('0x6c')],'label':_0x9eea24['label'],'custom':!![]};}));});}})[_0xe256('0x24')](function(_0x5ede5d){return{'count':_0x5ede5d[_0xe256('0x36')],'rows':_0x5ede5d};})[_0xe256('0x24')](respondWithResult(_0x408a8d,null))[_0xe256('0x45')](function(_0x25da0e){var _0x435393=_0x2a431b[_0xe256('0x31')][_0xe256('0x6d')]?0x1f4:_0x25da0e[_0xe256('0x6e')]||0x1f4;logger[_0xe256('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x435393,JSON[_0xe256('0x6f')](_0x25da0e));delete _0x25da0e[_0xe256('0x27')];if(_0x435393===0x191){_0x435393=0x190;}_0x408a8d[_0xe256('0x1a')](_0x435393)[_0xe256('0x28')](_0x2a431b['query'][_0xe256('0x6d')]?{'message':_0xe256('0x70'),'statusCode':_0x25da0e[_0xe256('0x6e')]}:_0x25da0e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 0f42059..41c11c1 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 _0xf828=['../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','moment','bluebird','request-promise','path'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xf828,0x9c));var _0x8f82=function(_0x19199d,_0x477559){_0x19199d=_0x19199d-0x0;var _0x1f9ebd=_0xf828[_0x19199d];return _0x1f9ebd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8f82('0x0'));var BPromise=require(_0x8f82('0x1'));var rp=require(_0x8f82('0x2'));var fs=require('fs');var path=require(_0x8f82('0x3'));var rimraf=require('rimraf');var config=require(_0x8f82('0x4'));var attributes=require(_0x8f82('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x8f82('0x6')]=function(_0x40af5a,_0x1afa1a){return _0x40af5a[_0x8f82('0x7')](_0x8f82('0x8'),attributes,{'tableName':_0x8f82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecb0=['moment','bluebird','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','../../config/logger','api'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xecb0,0x75));var _0x0ecb=function(_0x168372,_0x29a0ed){_0x168372=_0x168372-0x0;var _0x541e66=_0xecb0[_0x168372];return _0x541e66;};'use strict';var _=require('lodash');var util=require(_0x0ecb('0x0'));var logger=require(_0x0ecb('0x1'))(_0x0ecb('0x2'));var moment=require(_0x0ecb('0x3'));var BPromise=require(_0x0ecb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ecb('0x5'));var config=require(_0x0ecb('0x6'));var attributes=require(_0x0ecb('0x7'));var integrations=require(_0x0ecb('0x8'));module[_0x0ecb('0x9')]=function(_0x49b620,_0x230747){return _0x49b620[_0x0ecb('0xa')]('DeskAccount',attributes,{'tableName':_0x0ecb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index e08c800..97d0356 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 _0x0dd0=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowDeskAccount','find'];(function(_0x2c8802,_0x4ad8e4){var _0x29fefc=function(_0x92772b){while(--_0x92772b){_0x2c8802['push'](_0x2c8802['shift']());}};_0x29fefc(++_0x4ad8e4);}(_0x0dd0,0xb4));var _0x00dd=function(_0x414f89,_0x356530){_0x414f89=_0x414f89-0x0;var _0x1ccd61=_0x0dd0[_0x414f89];return _0x1ccd61;};'use strict';var _=require(_0x00dd('0x0'));var util=require(_0x00dd('0x1'));var moment=require(_0x00dd('0x2'));var BPromise=require(_0x00dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00dd('0x4'));var db=require(_0x00dd('0x5'))['db'];var utils=require(_0x00dd('0x6'));var logger=require(_0x00dd('0x7'))('rpc');var config=require(_0x00dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x00dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45cf78,_0x1b3d8f,_0x9ebee7){return new BPromise(function(_0x30ecaa,_0x2710a5){return client[_0x00dd('0xa')](_0x45cf78,_0x9ebee7)[_0x00dd('0xb')](function(_0x16627a){logger[_0x00dd('0xc')]('DeskAccount,\x20%s,\x20%s',_0x1b3d8f,_0x00dd('0xd'));logger[_0x00dd('0xe')](_0x00dd('0xf'),_0x1b3d8f,_0x00dd('0xd'),JSON[_0x00dd('0x10')](_0x16627a));if(_0x16627a[_0x00dd('0x11')]){if(_0x16627a[_0x00dd('0x11')][_0x00dd('0x12')]===0x1f4){logger[_0x00dd('0x11')]('DeskAccount,\x20%s,\x20%s',_0x1b3d8f,_0x16627a[_0x00dd('0x11')][_0x00dd('0x13')]);return _0x2710a5(_0x16627a[_0x00dd('0x11')]['message']);}logger[_0x00dd('0x11')](_0x00dd('0x14'),_0x1b3d8f,_0x16627a['error'][_0x00dd('0x13')]);return _0x30ecaa(_0x16627a[_0x00dd('0x11')]['message']);}else{logger[_0x00dd('0xc')]('DeskAccount,\x20%s,\x20%s',_0x1b3d8f,_0x00dd('0xd'));_0x30ecaa(_0x16627a[_0x00dd('0x15')]['message']);}})[_0x00dd('0x16')](function(_0x3c147c){logger[_0x00dd('0x11')](_0x00dd('0x14'),_0x1b3d8f,_0x3c147c);_0x2710a5(_0x3c147c);});});}exports[_0x00dd('0x17')]=function(_0x499069){var _0x5e8317=this;return new Promise(function(_0x5012bd,_0x2b1a67){return db[_0x00dd('0x18')][_0x00dd('0x19')]({'raw':_0x499069[_0x00dd('0x1a')]?_0x499069[_0x00dd('0x1a')][_0x00dd('0x1b')]===undefined?!![]:![]:!![],'where':_0x499069['options']?_0x499069['options'][_0x00dd('0x1c')]||null:null,'attributes':_0x499069[_0x00dd('0x1a')]?_0x499069[_0x00dd('0x1a')]['attributes']||null:null,'limit':_0x499069[_0x00dd('0x1a')]?_0x499069[_0x00dd('0x1a')][_0x00dd('0x1d')]||null:null,'include':_0x499069['options']?_0x499069[_0x00dd('0x1a')][_0x00dd('0x1e')]?_[_0x00dd('0x1f')](_0x499069[_0x00dd('0x1a')]['include'],function(_0x3eb481){return{'model':db[_0x3eb481[_0x00dd('0x20')]],'as':_0x3eb481['as'],'attributes':_0x3eb481[_0x00dd('0x21')],'include':_0x3eb481['include']?_[_0x00dd('0x1f')](_0x3eb481[_0x00dd('0x1e')],function(_0x2da4be){return{'model':db[_0x2da4be[_0x00dd('0x20')]],'as':_0x2da4be['as'],'attributes':_0x2da4be[_0x00dd('0x21')],'include':_0x2da4be[_0x00dd('0x1e')]?_[_0x00dd('0x1f')](_0x2da4be['include'],function(_0x490c52){return{'model':db[_0x490c52[_0x00dd('0x20')]],'as':_0x490c52['as'],'attributes':_0x490c52['attributes']};}):[]};}):[]};}):[]:[]})[_0x00dd('0xb')](function(_0xbe5cf6){logger[_0x00dd('0xc')]('GetDeskAccount',_0x499069);logger['debug']('GetDeskAccount',_0x499069,JSON[_0x00dd('0x10')](_0xbe5cf6));_0x5012bd(_0xbe5cf6);})[_0x00dd('0x16')](function(_0x328877){logger[_0x00dd('0x11')](_0x00dd('0x17'),_0x328877[_0x00dd('0x13')],_0x499069);_0x2b1a67(_0x5e8317['error'](0x1f4,_0x328877[_0x00dd('0x13')]));});});};exports[_0x00dd('0x22')]=function(_0x44e295){var _0x409b4a=this;return new Promise(function(_0x521cfd,_0x4dba81){return db[_0x00dd('0x18')][_0x00dd('0x23')]({'raw':_0x44e295[_0x00dd('0x1a')]?_0x44e295[_0x00dd('0x1a')][_0x00dd('0x1b')]===undefined?!![]:![]:!![],'where':_0x44e295['options']?_0x44e295[_0x00dd('0x1a')]['where']||null:null,'attributes':_0x44e295[_0x00dd('0x1a')]?_0x44e295[_0x00dd('0x1a')]['attributes']||null:null,'include':_0x44e295[_0x00dd('0x1a')]?_0x44e295[_0x00dd('0x1a')][_0x00dd('0x1e')]?_[_0x00dd('0x1f')](_0x44e295[_0x00dd('0x1a')][_0x00dd('0x1e')],function(_0x2f3091){return{'model':db[_0x2f3091[_0x00dd('0x20')]],'as':_0x2f3091['as'],'attributes':_0x2f3091[_0x00dd('0x21')],'include':_0x2f3091[_0x00dd('0x1e')]?_[_0x00dd('0x1f')](_0x2f3091[_0x00dd('0x1e')],function(_0x5e75fa){return{'model':db[_0x5e75fa['model']],'as':_0x5e75fa['as'],'attributes':_0x5e75fa[_0x00dd('0x21')],'include':_0x5e75fa[_0x00dd('0x1e')]?_['map'](_0x5e75fa['include'],function(_0x2693c6){return{'model':db[_0x2693c6[_0x00dd('0x20')]],'as':_0x2693c6['as'],'attributes':_0x2693c6[_0x00dd('0x21')]};}):[]};}):[]};}):[]:[]})[_0x00dd('0xb')](function(_0x4e213a){logger[_0x00dd('0xc')](_0x00dd('0x22'),_0x44e295);logger[_0x00dd('0xe')]('ShowDeskAccount',_0x44e295,JSON[_0x00dd('0x10')](_0x4e213a));_0x521cfd(_0x4e213a);})[_0x00dd('0x16')](function(_0x293987){logger[_0x00dd('0x11')]('ShowDeskAccount',_0x293987[_0x00dd('0x13')],_0x44e295);_0x4dba81(_0x409b4a['error'](0x1f4,_0x293987[_0x00dd('0x13')]));});});}; \ No newline at end of file +var _0xc6d9=['limit','map','include','model','find','then','ShowDeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetDeskAccount','raw','options','where','attributes'];(function(_0x1b8c71,_0x41d8ab){var _0x539905=function(_0x395edd){while(--_0x395edd){_0x1b8c71['push'](_0x1b8c71['shift']());}};_0x539905(++_0x41d8ab);}(_0xc6d9,0x6a));var _0x9c6d=function(_0x1c9fc2,_0x251ca7){_0x1c9fc2=_0x1c9fc2-0x0;var _0x24289d=_0xc6d9[_0x1c9fc2];return _0x24289d;};'use strict';var _=require(_0x9c6d('0x0'));var util=require(_0x9c6d('0x1'));var moment=require('moment');var BPromise=require(_0x9c6d('0x2'));var rs=require(_0x9c6d('0x3'));var fs=require('fs');var Redis=require(_0x9c6d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c6d('0x5'));var logger=require(_0x9c6d('0x6'))(_0x9c6d('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c6d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e2288,_0x3cdcc8,_0x537cdf){return new BPromise(function(_0x501626,_0x518303){return client[_0x9c6d('0x9')](_0x5e2288,_0x537cdf)['then'](function(_0x5cdcd5){logger[_0x9c6d('0xa')](_0x9c6d('0xb'),_0x3cdcc8,'request\x20sent');logger[_0x9c6d('0xc')](_0x9c6d('0xd'),_0x3cdcc8,'request\x20sent',JSON[_0x9c6d('0xe')](_0x5cdcd5));if(_0x5cdcd5[_0x9c6d('0xf')]){if(_0x5cdcd5[_0x9c6d('0xf')][_0x9c6d('0x10')]===0x1f4){logger[_0x9c6d('0xf')](_0x9c6d('0xb'),_0x3cdcc8,_0x5cdcd5[_0x9c6d('0xf')][_0x9c6d('0x11')]);return _0x518303(_0x5cdcd5[_0x9c6d('0xf')][_0x9c6d('0x11')]);}logger[_0x9c6d('0xf')](_0x9c6d('0xb'),_0x3cdcc8,_0x5cdcd5['error'][_0x9c6d('0x11')]);return _0x501626(_0x5cdcd5[_0x9c6d('0xf')][_0x9c6d('0x11')]);}else{logger[_0x9c6d('0xa')](_0x9c6d('0xb'),_0x3cdcc8,_0x9c6d('0x12'));_0x501626(_0x5cdcd5[_0x9c6d('0x13')][_0x9c6d('0x11')]);}})[_0x9c6d('0x14')](function(_0x3d8ecf){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3cdcc8,_0x3d8ecf);_0x518303(_0x3d8ecf);});});}exports[_0x9c6d('0x15')]=function(_0x4987ae){var _0x10044b=this;return new Promise(function(_0x25f07e,_0x4ed339){return db['DeskAccount']['findAll']({'raw':_0x4987ae['options']?_0x4987ae['options'][_0x9c6d('0x16')]===undefined?!![]:![]:!![],'where':_0x4987ae['options']?_0x4987ae[_0x9c6d('0x17')][_0x9c6d('0x18')]||null:null,'attributes':_0x4987ae[_0x9c6d('0x17')]?_0x4987ae['options'][_0x9c6d('0x19')]||null:null,'limit':_0x4987ae[_0x9c6d('0x17')]?_0x4987ae[_0x9c6d('0x17')][_0x9c6d('0x1a')]||null:null,'include':_0x4987ae[_0x9c6d('0x17')]?_0x4987ae[_0x9c6d('0x17')]['include']?_[_0x9c6d('0x1b')](_0x4987ae[_0x9c6d('0x17')][_0x9c6d('0x1c')],function(_0xe8a1b7){return{'model':db[_0xe8a1b7[_0x9c6d('0x1d')]],'as':_0xe8a1b7['as'],'attributes':_0xe8a1b7[_0x9c6d('0x19')],'include':_0xe8a1b7[_0x9c6d('0x1c')]?_[_0x9c6d('0x1b')](_0xe8a1b7['include'],function(_0x3a977c){return{'model':db[_0x3a977c[_0x9c6d('0x1d')]],'as':_0x3a977c['as'],'attributes':_0x3a977c[_0x9c6d('0x19')],'include':_0x3a977c[_0x9c6d('0x1c')]?_[_0x9c6d('0x1b')](_0x3a977c[_0x9c6d('0x1c')],function(_0x2f9636){return{'model':db[_0x2f9636[_0x9c6d('0x1d')]],'as':_0x2f9636['as'],'attributes':_0x2f9636[_0x9c6d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44e445){logger[_0x9c6d('0xa')]('GetDeskAccount',_0x4987ae);logger[_0x9c6d('0xc')](_0x9c6d('0x15'),_0x4987ae,JSON['stringify'](_0x44e445));_0x25f07e(_0x44e445);})[_0x9c6d('0x14')](function(_0x5c984c){logger[_0x9c6d('0xf')](_0x9c6d('0x15'),_0x5c984c[_0x9c6d('0x11')],_0x4987ae);_0x4ed339(_0x10044b['error'](0x1f4,_0x5c984c[_0x9c6d('0x11')]));});});};exports['ShowDeskAccount']=function(_0x58b657){var _0x4e07e6=this;return new Promise(function(_0x3d559f,_0x423e90){return db['DeskAccount'][_0x9c6d('0x1e')]({'raw':_0x58b657[_0x9c6d('0x17')]?_0x58b657['options'][_0x9c6d('0x16')]===undefined?!![]:![]:!![],'where':_0x58b657[_0x9c6d('0x17')]?_0x58b657[_0x9c6d('0x17')]['where']||null:null,'attributes':_0x58b657['options']?_0x58b657[_0x9c6d('0x17')][_0x9c6d('0x19')]||null:null,'include':_0x58b657[_0x9c6d('0x17')]?_0x58b657[_0x9c6d('0x17')][_0x9c6d('0x1c')]?_[_0x9c6d('0x1b')](_0x58b657['options'][_0x9c6d('0x1c')],function(_0x172534){return{'model':db[_0x172534[_0x9c6d('0x1d')]],'as':_0x172534['as'],'attributes':_0x172534['attributes'],'include':_0x172534[_0x9c6d('0x1c')]?_[_0x9c6d('0x1b')](_0x172534['include'],function(_0x2b16dd){return{'model':db[_0x2b16dd[_0x9c6d('0x1d')]],'as':_0x2b16dd['as'],'attributes':_0x2b16dd[_0x9c6d('0x19')],'include':_0x2b16dd['include']?_[_0x9c6d('0x1b')](_0x2b16dd['include'],function(_0xe59e68){return{'model':db[_0xe59e68[_0x9c6d('0x1d')]],'as':_0xe59e68['as'],'attributes':_0xe59e68[_0x9c6d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9c6d('0x1f')](function(_0x1b9dc8){logger[_0x9c6d('0xa')](_0x9c6d('0x20'),_0x58b657);logger['debug'](_0x9c6d('0x20'),_0x58b657,JSON[_0x9c6d('0xe')](_0x1b9dc8));_0x3d559f(_0x1b9dc8);})['catch'](function(_0x22ef41){logger[_0x9c6d('0xf')](_0x9c6d('0x20'),_0x22ef41[_0x9c6d('0x11')],_0x58b657);_0x423e90(_0x4e07e6[_0x9c6d('0xf')](0x1f4,_0x22ef41['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index cf7c460..6932f6c 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x534a4b,_0x44c67a){var _0x311ed6=function(_0x48b06a){while(--_0x48b06a){_0x534a4b['push'](_0x534a4b['shift']());}};_0x311ed6(++_0x44c67a);}(_0x3e74,0x175));var _0x43e7=function(_0x4d965a,_0x36f273){_0x4d965a=_0x4d965a-0x0;var _0x402cee=_0x3e74[_0x4d965a];return _0x402cee;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5135f1,_0xf4d1b){var _0x1ad043=function(_0x2f8eb9){while(--_0x2f8eb9){_0x5135f1['push'](_0x5135f1['shift']());}};_0x1ad043(++_0xf4d1b);}(_0x3e74,0x175));var _0x43e7=function(_0x2596a3,_0x4bd6b2){_0x2596a3=_0x2596a3-0x0;var _0x535d18=_0x3e74[_0x2596a3];return _0x535d18;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 73408ed..b507d35 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 _0x4e4a=['sequelize','exports','STRING'];(function(_0x57af1e,_0x2e9394){var _0x19f1e1=function(_0x466b42){while(--_0x466b42){_0x57af1e['push'](_0x57af1e['shift']());}};_0x19f1e1(++_0x2e9394);}(_0x4e4a,0x150));var _0xa4e4=function(_0x24ccc4,_0x59822a){_0x24ccc4=_0x24ccc4-0x0;var _0x20afb0=_0x4e4a[_0x24ccc4];return _0x20afb0;};'use strict';var Sequelize=require(_0xa4e4('0x0'));module[_0xa4e4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa4e4('0x2')]}}; \ No newline at end of file +var _0x7f6c=['sequelize','STRING'];(function(_0x6c871f,_0x13ddf8){var _0x35da7c=function(_0x4e1fd7){while(--_0x4e1fd7){_0x6c871f['push'](_0x6c871f['shift']());}};_0x35da7c(++_0x13ddf8);}(_0x7f6c,0x1da));var _0xc7f6=function(_0x9a2bdb,_0x2808a8){_0x9a2bdb=_0x9a2bdb-0x0;var _0x43a1c1=_0x7f6c[_0x9a2bdb];return _0x43a1c1;};'use strict';var Sequelize=require(_0xc7f6('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7f6('0x1')]},'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 861262d..50c98aa 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 _0x70a4=['Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','getFields','findOne','DeskField','getSubjects','order','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set'];(function(_0x185826,_0x1aa14a){var _0x59dd4a=function(_0x4bd417){while(--_0x4bd417){_0x185826['push'](_0x185826['shift']());}};_0x59dd4a(++_0x1aa14a);}(_0x70a4,0x91));var _0x470a=function(_0x567ae4,_0x943c2f){_0x567ae4=_0x567ae4-0x0;var _0x2a8551=_0x70a4[_0x567ae4];return _0x2a8551;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x470a('0x0'));var zipdir=require(_0x470a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x470a('0x2'));var moment=require(_0x470a('0x3'));var BPromise=require(_0x470a('0x4'));var Mustache=require(_0x470a('0x5'));var util=require(_0x470a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x470a('0x7'));var ejs=require(_0x470a('0x8'));var fs=require('fs');var fs_extra=require(_0x470a('0x9'));var _=require(_0x470a('0xa'));var squel=require(_0x470a('0xb'));var crypto=require(_0x470a('0xc'));var jsforce=require(_0x470a('0xd'));var deskjs=require(_0x470a('0xe'));var toCsv=require(_0x470a('0x7'));var querystring=require(_0x470a('0xf'));var Papa=require(_0x470a('0x10'));var Redis=require(_0x470a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x470a('0x12'));var as=require(_0x470a('0x13'));var hardwareService=require(_0x470a('0x14'));var logger=require(_0x470a('0x15'))(_0x470a('0x16'));var utils=require(_0x470a('0x17'));var config=require(_0x470a('0x18'));var licenseUtil=require(_0x470a('0x19'));var db=require(_0x470a('0x1a'))['db'];function respondWithStatusCode(_0x27133a,_0x28a830){_0x28a830=_0x28a830||0xcc;return function(_0x76822b){if(_0x76822b){return _0x27133a[_0x470a('0x1b')](_0x28a830);}return _0x27133a['status'](_0x28a830)['end']();};}function respondWithResult(_0x230226,_0x4e68b8){_0x4e68b8=_0x4e68b8||0xc8;return function(_0x4a70c){if(_0x4a70c){return _0x230226['status'](_0x4e68b8)[_0x470a('0x1c')](_0x4a70c);}};}function respondWithFilteredResult(_0x1b40b4,_0x471f2d){return function(_0x5bb8e7){if(_0x5bb8e7){var _0x336cfd=typeof _0x471f2d[_0x470a('0x1d')]===_0x470a('0x1e')&&typeof _0x471f2d[_0x470a('0x1f')]==='undefined';var _0x5309f3=_0x5bb8e7[_0x470a('0x20')];var _0x2bb35c=_0x336cfd?0x0:_0x471f2d[_0x470a('0x1d')];var _0x3df25a=_0x336cfd?_0x5bb8e7[_0x470a('0x20')]:_0x471f2d[_0x470a('0x1d')]+_0x471f2d['limit'];var _0x31bf20;if(_0x3df25a>=_0x5309f3){_0x3df25a=_0x5309f3;_0x31bf20=0xc8;}else{_0x31bf20=0xce;}_0x1b40b4[_0x470a('0x21')](_0x31bf20);return _0x1b40b4[_0x470a('0x22')](_0x470a('0x23'),_0x2bb35c+'-'+_0x3df25a+'/'+_0x5309f3)[_0x470a('0x1c')](_0x5bb8e7);}return null;};}function patchUpdates(_0x190a23){return function(_0x1f374d){try{jsonpatch[_0x470a('0x24')](_0x1f374d,_0x190a23,!![]);}catch(_0x47ef72){return BPromise[_0x470a('0x25')](_0x47ef72);}return _0x1f374d[_0x470a('0x26')]();};}function saveUpdates(_0x4421bd,_0x4a99ba){return function(_0x1ddb83){if(_0x1ddb83){return _0x1ddb83['update'](_0x4421bd)[_0x470a('0x27')](function(_0x1fbd77){return _0x1fbd77;});}return null;};}function removeEntity(_0x35fbd7,_0x15911f){return function(_0x17c4bb){if(_0x17c4bb){return _0x17c4bb[_0x470a('0x28')]()[_0x470a('0x27')](function(){_0x35fbd7[_0x470a('0x21')](0xcc)[_0x470a('0x29')]();});}};}function handleEntityNotFound(_0x4b7cb3,_0x9c763b){return function(_0x50112d){if(!_0x50112d){_0x4b7cb3[_0x470a('0x1b')](0x194);}return _0x50112d;};}function handleError(_0x4dfb44,_0x8bf744){_0x8bf744=_0x8bf744||0x1f4;return function(_0x548503){logger[_0x470a('0x2a')](_0x548503[_0x470a('0x2b')]);if(_0x548503[_0x470a('0x2c')]){delete _0x548503[_0x470a('0x2c')];}_0x4dfb44['status'](_0x8bf744)[_0x470a('0x2d')](_0x548503);};}exports[_0x470a('0x2e')]=function(_0x9cad4b,_0xe39097){var _0x1f48fe={},_0x1757a0={},_0xcebc37={'count':0x0,'rows':[]};var _0x30b067=_['map'](db[_0x470a('0x2f')][_0x470a('0x30')],function(_0x1491de){return{'name':_0x1491de[_0x470a('0x31')],'type':_0x1491de[_0x470a('0x32')][_0x470a('0x33')]};});_0x1757a0[_0x470a('0x34')]=_['map'](_0x30b067,_0x470a('0x2c'));_0x1757a0[_0x470a('0x35')]=_['keys'](_0x9cad4b[_0x470a('0x35')]);_0x1757a0[_0x470a('0x36')]=_['intersection'](_0x1757a0[_0x470a('0x34')],_0x1757a0[_0x470a('0x35')]);_0x1f48fe[_0x470a('0x37')]=_[_0x470a('0x38')](_0x1757a0[_0x470a('0x34')],qs[_0x470a('0x39')](_0x9cad4b['query']['fields']));_0x1f48fe[_0x470a('0x37')]=_0x1f48fe['attributes'][_0x470a('0x3a')]?_0x1f48fe[_0x470a('0x37')]:_0x1757a0['model'];if(!_0x9cad4b[_0x470a('0x35')][_0x470a('0x3b')](_0x470a('0x3c'))){_0x1f48fe['limit']=qs['limit'](_0x9cad4b[_0x470a('0x35')][_0x470a('0x1f')]);_0x1f48fe[_0x470a('0x1d')]=qs[_0x470a('0x1d')](_0x9cad4b[_0x470a('0x35')][_0x470a('0x1d')]);}_0x1f48fe['order']=qs['sort'](_0x9cad4b[_0x470a('0x35')][_0x470a('0x3d')]);_0x1f48fe[_0x470a('0x3e')]=qs[_0x470a('0x36')](_[_0x470a('0x3f')](_0x9cad4b[_0x470a('0x35')],_0x1757a0[_0x470a('0x36')]),_0x30b067);if(_0x9cad4b['query'][_0x470a('0x40')]){_0x1f48fe['where']=_[_0x470a('0x41')](_0x1f48fe['where'],{'$or':_[_0x470a('0x42')](_0x30b067,function(_0x2b4b9f){if(_0x2b4b9f[_0x470a('0x32')]!==_0x470a('0x43')){var _0xcec8ae={};_0xcec8ae[_0x2b4b9f['name']]={'$like':'%'+_0x9cad4b[_0x470a('0x35')]['filter']+'%'};return _0xcec8ae;}})});}_0x1f48fe=_[_0x470a('0x41')]({},_0x1f48fe,_0x9cad4b['options']);var _0x774a53={'where':_0x1f48fe['where']};return db[_0x470a('0x2f')][_0x470a('0x20')](_0x774a53)['then'](function(_0x2fbbdb){_0xcebc37['count']=_0x2fbbdb;if(_0x9cad4b['query'][_0x470a('0x44')]){_0x1f48fe[_0x470a('0x45')]=[{'all':!![]}];}return db[_0x470a('0x2f')][_0x470a('0x46')](_0x1f48fe);})['then'](function(_0x3e68ce){_0xcebc37[_0x470a('0x47')]=_0x3e68ce;return _0xcebc37;})[_0x470a('0x27')](respondWithFilteredResult(_0xe39097,_0x1f48fe))[_0x470a('0x48')](handleError(_0xe39097,null));};exports[_0x470a('0x49')]=function(_0x12ad18,_0x43e312){var _0x2e74b5={'raw':![],'where':{'id':_0x12ad18['params']['id']}},_0x274a8b={};_0x274a8b[_0x470a('0x34')]=_[_0x470a('0x4a')](db[_0x470a('0x2f')][_0x470a('0x30')]);_0x274a8b[_0x470a('0x35')]=_[_0x470a('0x4a')](_0x12ad18[_0x470a('0x35')]);_0x274a8b[_0x470a('0x36')]=_[_0x470a('0x38')](_0x274a8b[_0x470a('0x34')],_0x274a8b['query']);_0x2e74b5[_0x470a('0x37')]=_[_0x470a('0x38')](_0x274a8b['model'],qs[_0x470a('0x39')](_0x12ad18[_0x470a('0x35')]['fields']));_0x2e74b5[_0x470a('0x37')]=_0x2e74b5[_0x470a('0x37')][_0x470a('0x3a')]?_0x2e74b5['attributes']:_0x274a8b[_0x470a('0x34')];if(_0x12ad18[_0x470a('0x35')][_0x470a('0x44')]){_0x2e74b5[_0x470a('0x45')]=[{'all':!![]}];}_0x2e74b5=_['merge']({},_0x2e74b5,_0x12ad18[_0x470a('0x4b')]);return db[_0x470a('0x2f')][_0x470a('0x4c')](_0x2e74b5)[_0x470a('0x27')](handleEntityNotFound(_0x43e312,null))[_0x470a('0x27')](respondWithResult(_0x43e312,null))[_0x470a('0x48')](handleError(_0x43e312,null));};exports[_0x470a('0x4d')]=function(_0x41bea8,_0x3e88fa){return db[_0x470a('0x2f')][_0x470a('0x4d')](_0x41bea8[_0x470a('0x4e')],{})[_0x470a('0x27')](respondWithResult(_0x3e88fa,0xc9))[_0x470a('0x48')](handleError(_0x3e88fa,null));};exports['update']=function(_0x1adf24,_0x2de19a){if(_0x1adf24[_0x470a('0x4e')]['id']){delete _0x1adf24[_0x470a('0x4e')]['id'];}return db[_0x470a('0x2f')]['find']({'where':{'id':_0x1adf24[_0x470a('0x4f')]['id']}})[_0x470a('0x27')](handleEntityNotFound(_0x2de19a,null))[_0x470a('0x27')](saveUpdates(_0x1adf24[_0x470a('0x4e')],null))['then'](respondWithResult(_0x2de19a,null))[_0x470a('0x48')](handleError(_0x2de19a,null));};exports[_0x470a('0x28')]=function(_0x2053d3,_0x1193c6){return db[_0x470a('0x2f')][_0x470a('0x4c')]({'where':{'id':_0x2053d3['params']['id']}})['then'](handleEntityNotFound(_0x1193c6,null))[_0x470a('0x27')](removeEntity(_0x1193c6,null))[_0x470a('0x48')](handleError(_0x1193c6,null));};exports[_0x470a('0x50')]=function(_0x5aeb25,_0x255c0c,_0x5bfff4){var _0x5cb9b1={};var _0x3d2652={};var _0x1961bd;var _0x37a2ef;return db['DeskConfiguration'][_0x470a('0x51')]({'where':{'id':_0x5aeb25[_0x470a('0x4f')]['id']}})[_0x470a('0x27')](handleEntityNotFound(_0x255c0c,null))[_0x470a('0x27')](function(_0x3e57fd){if(_0x3e57fd){_0x1961bd=_0x3e57fd;_0x3d2652['model']=_[_0x470a('0x4a')](db[_0x470a('0x52')][_0x470a('0x30')]);_0x3d2652[_0x470a('0x35')]=_['keys'](_0x5aeb25[_0x470a('0x35')]);_0x3d2652[_0x470a('0x36')]=_[_0x470a('0x38')](_0x3d2652[_0x470a('0x34')],_0x3d2652[_0x470a('0x35')]);_0x5cb9b1[_0x470a('0x37')]=_['intersection'](_0x3d2652[_0x470a('0x34')],qs[_0x470a('0x39')](_0x5aeb25[_0x470a('0x35')][_0x470a('0x39')]));_0x5cb9b1['attributes']=_0x5cb9b1[_0x470a('0x37')][_0x470a('0x3a')]?_0x5cb9b1[_0x470a('0x37')]:_0x3d2652[_0x470a('0x34')];_0x5cb9b1['order']=qs[_0x470a('0x3d')](_0x5aeb25[_0x470a('0x35')][_0x470a('0x3d')]);_0x5cb9b1[_0x470a('0x3e')]=qs[_0x470a('0x36')](_[_0x470a('0x3f')](_0x5aeb25['query'],_0x3d2652[_0x470a('0x36')]));if(_0x5aeb25[_0x470a('0x35')]['filter']){_0x5cb9b1[_0x470a('0x3e')]=_[_0x470a('0x41')](_0x5cb9b1['where'],{'$or':_[_0x470a('0x42')](_0x5cb9b1[_0x470a('0x37')],function(_0x48e6de){var _0x402d31={};_0x402d31[_0x48e6de]={'$like':'%'+_0x5aeb25[_0x470a('0x35')]['filter']+'%'};return _0x402d31;})});}_0x5cb9b1=_['merge']({},_0x5cb9b1,_0x5aeb25['options']);return _0x1961bd[_0x470a('0x50')](_0x5cb9b1);}})[_0x470a('0x27')](function(_0x2addb7){if(_0x2addb7){_0x37a2ef=_0x2addb7[_0x470a('0x3a')];if(!_0x5aeb25[_0x470a('0x35')][_0x470a('0x3b')]('nolimit')){_0x5cb9b1[_0x470a('0x1f')]=qs[_0x470a('0x1f')](_0x5aeb25['query']['limit']);_0x5cb9b1['offset']=qs[_0x470a('0x1d')](_0x5aeb25[_0x470a('0x35')][_0x470a('0x1d')]);}return _0x1961bd[_0x470a('0x50')](_0x5cb9b1);}})[_0x470a('0x27')](function(_0x4baabd){if(_0x4baabd){return _0x4baabd?{'count':_0x37a2ef,'rows':_0x4baabd}:null;}})[_0x470a('0x27')](respondWithResult(_0x255c0c,null))[_0x470a('0x48')](handleError(_0x255c0c,null));};exports[_0x470a('0x53')]=function(_0x34bff6,_0x1196b8,_0xe072ad){var _0x47f16b={};var _0x51721f={};var _0x2960ca;var _0x336ebc;return db[_0x470a('0x2f')]['findOne']({'where':{'id':_0x34bff6[_0x470a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1196b8,null))[_0x470a('0x27')](function(_0xfb2400){if(_0xfb2400){_0x2960ca=_0xfb2400;_0x51721f[_0x470a('0x34')]=_[_0x470a('0x4a')](db['DeskField'][_0x470a('0x30')]);_0x51721f['query']=_[_0x470a('0x4a')](_0x34bff6[_0x470a('0x35')]);_0x51721f[_0x470a('0x36')]=_['intersection'](_0x51721f['model'],_0x51721f[_0x470a('0x35')]);_0x47f16b[_0x470a('0x37')]=_[_0x470a('0x38')](_0x51721f['model'],qs[_0x470a('0x39')](_0x34bff6[_0x470a('0x35')][_0x470a('0x39')]));_0x47f16b['attributes']=_0x47f16b[_0x470a('0x37')]['length']?_0x47f16b['attributes']:_0x51721f[_0x470a('0x34')];_0x47f16b[_0x470a('0x54')]=qs[_0x470a('0x3d')](_0x34bff6['query'][_0x470a('0x3d')]);_0x47f16b[_0x470a('0x3e')]=qs[_0x470a('0x36')](_['pick'](_0x34bff6[_0x470a('0x35')],_0x51721f[_0x470a('0x36')]));if(_0x34bff6['query'][_0x470a('0x40')]){_0x47f16b[_0x470a('0x3e')]=_['merge'](_0x47f16b[_0x470a('0x3e')],{'$or':_[_0x470a('0x42')](_0x47f16b[_0x470a('0x37')],function(_0x1a45fe){var _0xb07a02={};_0xb07a02[_0x1a45fe]={'$like':'%'+_0x34bff6['query'][_0x470a('0x40')]+'%'};return _0xb07a02;})});}_0x47f16b=_[_0x470a('0x41')]({},_0x47f16b,_0x34bff6[_0x470a('0x4b')]);return _0x2960ca['getSubjects'](_0x47f16b);}})[_0x470a('0x27')](function(_0x80e990){if(_0x80e990){_0x336ebc=_0x80e990['length'];if(!_0x34bff6[_0x470a('0x35')][_0x470a('0x3b')](_0x470a('0x3c'))){_0x47f16b['limit']=qs[_0x470a('0x1f')](_0x34bff6[_0x470a('0x35')][_0x470a('0x1f')]);_0x47f16b[_0x470a('0x1d')]=qs[_0x470a('0x1d')](_0x34bff6['query'][_0x470a('0x1d')]);}return _0x2960ca[_0x470a('0x53')](_0x47f16b);}})[_0x470a('0x27')](function(_0x45eb9b){if(_0x45eb9b){return _0x45eb9b?{'count':_0x336ebc,'rows':_0x45eb9b}:null;}})['then'](respondWithResult(_0x1196b8,null))['catch'](handleError(_0x1196b8,null));};exports[_0x470a('0x55')]=function(_0x458b13,_0x6aac4,_0x33b7d7){var _0x2d31d5={};var _0x2b82d3={};var _0xfeda33;var _0x174baf;return db[_0x470a('0x2f')][_0x470a('0x51')]({'where':{'id':_0x458b13['params']['id']}})[_0x470a('0x27')](handleEntityNotFound(_0x6aac4,null))['then'](function(_0x20973f){if(_0x20973f){_0xfeda33=_0x20973f;_0x2b82d3[_0x470a('0x34')]=_[_0x470a('0x4a')](db[_0x470a('0x52')]['rawAttributes']);_0x2b82d3['query']=_[_0x470a('0x4a')](_0x458b13[_0x470a('0x35')]);_0x2b82d3[_0x470a('0x36')]=_[_0x470a('0x38')](_0x2b82d3[_0x470a('0x34')],_0x2b82d3[_0x470a('0x35')]);_0x2d31d5[_0x470a('0x37')]=_['intersection'](_0x2b82d3['model'],qs[_0x470a('0x39')](_0x458b13[_0x470a('0x35')][_0x470a('0x39')]));_0x2d31d5[_0x470a('0x37')]=_0x2d31d5['attributes'][_0x470a('0x3a')]?_0x2d31d5[_0x470a('0x37')]:_0x2b82d3[_0x470a('0x34')];_0x2d31d5['order']=qs['sort'](_0x458b13[_0x470a('0x35')][_0x470a('0x3d')]);_0x2d31d5[_0x470a('0x3e')]=qs[_0x470a('0x36')](_[_0x470a('0x3f')](_0x458b13[_0x470a('0x35')],_0x2b82d3[_0x470a('0x36')]));if(_0x458b13[_0x470a('0x35')][_0x470a('0x40')]){_0x2d31d5[_0x470a('0x3e')]=_[_0x470a('0x41')](_0x2d31d5[_0x470a('0x3e')],{'$or':_[_0x470a('0x42')](_0x2d31d5[_0x470a('0x37')],function(_0x3d50c8){var _0x154fc6={};_0x154fc6[_0x3d50c8]={'$like':'%'+_0x458b13[_0x470a('0x35')][_0x470a('0x40')]+'%'};return _0x154fc6;})});}_0x2d31d5=_['merge']({},_0x2d31d5,_0x458b13['options']);return _0xfeda33[_0x470a('0x55')](_0x2d31d5);}})[_0x470a('0x27')](function(_0x16ef0b){if(_0x16ef0b){_0x174baf=_0x16ef0b['length'];if(!_0x458b13[_0x470a('0x35')][_0x470a('0x3b')](_0x470a('0x3c'))){_0x2d31d5['limit']=qs[_0x470a('0x1f')](_0x458b13['query'][_0x470a('0x1f')]);_0x2d31d5[_0x470a('0x1d')]=qs[_0x470a('0x1d')](_0x458b13[_0x470a('0x35')]['offset']);}return _0xfeda33[_0x470a('0x55')](_0x2d31d5);}})[_0x470a('0x27')](function(_0x3adc28){if(_0x3adc28){return _0x3adc28?{'count':_0x174baf,'rows':_0x3adc28}:null;}})['then'](respondWithResult(_0x6aac4,null))[_0x470a('0x48')](handleError(_0x6aac4,null));};exports['getTags']=function(_0x407580,_0x5a61de,_0x57bab6){var _0x347ac6={};var _0xed5c3c={};var _0x427688;var _0x167d50;return db[_0x470a('0x2f')][_0x470a('0x51')]({'where':{'id':_0x407580[_0x470a('0x4f')]['id']}})[_0x470a('0x27')](handleEntityNotFound(_0x5a61de,null))['then'](function(_0x2545c5){if(_0x2545c5){_0x427688=_0x2545c5;_0xed5c3c[_0x470a('0x34')]=_[_0x470a('0x4a')](db[_0x470a('0x56')][_0x470a('0x30')]);_0xed5c3c['query']=_['keys'](_0x407580[_0x470a('0x35')]);_0xed5c3c[_0x470a('0x36')]=_[_0x470a('0x38')](_0xed5c3c[_0x470a('0x34')],_0xed5c3c['query']);_0x347ac6[_0x470a('0x37')]=_['intersection'](_0xed5c3c[_0x470a('0x34')],qs[_0x470a('0x39')](_0x407580[_0x470a('0x35')]['fields']));_0x347ac6[_0x470a('0x37')]=_0x347ac6['attributes'][_0x470a('0x3a')]?_0x347ac6[_0x470a('0x37')]:_0xed5c3c[_0x470a('0x34')];_0x347ac6[_0x470a('0x54')]=qs[_0x470a('0x3d')](_0x407580[_0x470a('0x35')][_0x470a('0x3d')]);_0x347ac6[_0x470a('0x3e')]=qs['filters'](_[_0x470a('0x3f')](_0x407580[_0x470a('0x35')],_0xed5c3c[_0x470a('0x36')]));if(_0x407580['query'][_0x470a('0x40')]){_0x347ac6[_0x470a('0x3e')]=_[_0x470a('0x41')](_0x347ac6['where'],{'$or':_[_0x470a('0x42')](_0x347ac6['attributes'],function(_0x4718a1){var _0x3ca56b={};_0x3ca56b[_0x4718a1]={'$like':'%'+_0x407580[_0x470a('0x35')][_0x470a('0x40')]+'%'};return _0x3ca56b;})});}_0x347ac6=_[_0x470a('0x41')]({},_0x347ac6,_0x407580[_0x470a('0x4b')]);return _0x427688['getTags'](_0x347ac6);}})['then'](function(_0x213604){if(_0x213604){_0x167d50=_0x213604[_0x470a('0x3a')];if(!_0x407580[_0x470a('0x35')][_0x470a('0x3b')](_0x470a('0x3c'))){_0x347ac6[_0x470a('0x1f')]=qs[_0x470a('0x1f')](_0x407580[_0x470a('0x35')][_0x470a('0x1f')]);_0x347ac6[_0x470a('0x1d')]=qs['offset'](_0x407580[_0x470a('0x35')]['offset']);}return _0x427688[_0x470a('0x57')](_0x347ac6);}})[_0x470a('0x27')](function(_0x525273){if(_0x525273){return _0x525273?{'count':_0x167d50,'rows':_0x525273}:null;}})[_0x470a('0x27')](respondWithResult(_0x5a61de,null))[_0x470a('0x48')](handleError(_0x5a61de,null));};exports['setTags']=function(_0x2fe8da,_0xe843e5,_0x19a9fe){if(_0x2fe8da[_0x470a('0x4e')]['id']){delete _0x2fe8da[_0x470a('0x4e')]['id'];}return db[_0x470a('0x2f')][_0x470a('0x51')]({'where':{'id':_0x2fe8da['params']['id']}})[_0x470a('0x27')](handleEntityNotFound(_0xe843e5,null))[_0x470a('0x27')](function(_0x3b1285){if(_0x3b1285){return _0x3b1285[_0x470a('0x58')](_0x2fe8da[_0x470a('0x4e')][_0x470a('0x59')]||[]);}return null;})['then'](respondWithResult(_0xe843e5,null))[_0x470a('0x48')](handleError(_0xe843e5,null));}; \ No newline at end of file +var _0x0da9=['undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','length','merge','catch','create','body','find','getFields','findOne','params','DeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0da9,0x1de));var _0x90da=function(_0x20abea,_0x48795e){_0x20abea=_0x20abea-0x0;var _0x1382f7=_0x0da9[_0x20abea];return _0x1382f7;};'use strict';var emlformat=require(_0x90da('0x0'));var rimraf=require(_0x90da('0x1'));var zipdir=require(_0x90da('0x2'));var jsonpatch=require(_0x90da('0x3'));var rp=require(_0x90da('0x4'));var moment=require('moment');var BPromise=require(_0x90da('0x5'));var Mustache=require(_0x90da('0x6'));var util=require(_0x90da('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x90da('0x8'));var fs=require('fs');var fs_extra=require(_0x90da('0x9'));var _=require('lodash');var squel=require(_0x90da('0xa'));var crypto=require('crypto');var jsforce=require(_0x90da('0xb'));var deskjs=require(_0x90da('0xc'));var toCsv=require(_0x90da('0xd'));var querystring=require(_0x90da('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x90da('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x90da('0x10'));var hardwareService=require(_0x90da('0x11'));var logger=require(_0x90da('0x12'))(_0x90da('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x90da('0x14'))['db'];function respondWithStatusCode(_0x428311,_0x39fdf6){_0x39fdf6=_0x39fdf6||0xcc;return function(_0x5d8c7f){if(_0x5d8c7f){return _0x428311['sendStatus'](_0x39fdf6);}return _0x428311[_0x90da('0x15')](_0x39fdf6)[_0x90da('0x16')]();};}function respondWithResult(_0x286eb9,_0x2a84d1){_0x2a84d1=_0x2a84d1||0xc8;return function(_0x4e977a){if(_0x4e977a){return _0x286eb9[_0x90da('0x15')](_0x2a84d1)[_0x90da('0x17')](_0x4e977a);}};}function respondWithFilteredResult(_0x357e4d,_0x3c0f1c){return function(_0x17c084){if(_0x17c084){var _0x133b31=typeof _0x3c0f1c[_0x90da('0x18')]==='undefined'&&typeof _0x3c0f1c[_0x90da('0x19')]===_0x90da('0x1a');var _0x2d5a72=_0x17c084[_0x90da('0x1b')];var _0x1e3956=_0x133b31?0x0:_0x3c0f1c[_0x90da('0x18')];var _0x58ef64=_0x133b31?_0x17c084[_0x90da('0x1b')]:_0x3c0f1c[_0x90da('0x18')]+_0x3c0f1c[_0x90da('0x19')];var _0x52b13d;if(_0x58ef64>=_0x2d5a72){_0x58ef64=_0x2d5a72;_0x52b13d=0xc8;}else{_0x52b13d=0xce;}_0x357e4d[_0x90da('0x15')](_0x52b13d);return _0x357e4d['set'](_0x90da('0x1c'),_0x1e3956+'-'+_0x58ef64+'/'+_0x2d5a72)[_0x90da('0x17')](_0x17c084);}return null;};}function patchUpdates(_0x22e91a){return function(_0xf28da3){try{jsonpatch[_0x90da('0x1d')](_0xf28da3,_0x22e91a,!![]);}catch(_0x2e6622){return BPromise[_0x90da('0x1e')](_0x2e6622);}return _0xf28da3[_0x90da('0x1f')]();};}function saveUpdates(_0x3a20ae,_0x173e80){return function(_0x57fefc){if(_0x57fefc){return _0x57fefc[_0x90da('0x20')](_0x3a20ae)[_0x90da('0x21')](function(_0x114307){return _0x114307;});}return null;};}function removeEntity(_0x2aae29,_0x10d8d1){return function(_0x26f1f4){if(_0x26f1f4){return _0x26f1f4[_0x90da('0x22')]()['then'](function(){_0x2aae29[_0x90da('0x15')](0xcc)[_0x90da('0x16')]();});}};}function handleEntityNotFound(_0x1d1230,_0x673b09){return function(_0x3b4a17){if(!_0x3b4a17){_0x1d1230[_0x90da('0x23')](0x194);}return _0x3b4a17;};}function handleError(_0x1e4ce8,_0x5814e2){_0x5814e2=_0x5814e2||0x1f4;return function(_0x41240c){logger[_0x90da('0x24')](_0x41240c[_0x90da('0x25')]);if(_0x41240c[_0x90da('0x26')]){delete _0x41240c[_0x90da('0x26')];}_0x1e4ce8['status'](_0x5814e2)[_0x90da('0x27')](_0x41240c);};}exports[_0x90da('0x28')]=function(_0x1a579c,_0x2ed9cf){var _0x3c60b4={},_0x5e52bc={},_0x3379cf={'count':0x0,'rows':[]};var _0x2610d2=_[_0x90da('0x29')](db[_0x90da('0x2a')][_0x90da('0x2b')],function(_0xf8ee78){return{'name':_0xf8ee78[_0x90da('0x2c')],'type':_0xf8ee78[_0x90da('0x2d')][_0x90da('0x2e')]};});_0x5e52bc[_0x90da('0x2f')]=_[_0x90da('0x29')](_0x2610d2,_0x90da('0x26'));_0x5e52bc[_0x90da('0x30')]=_[_0x90da('0x31')](_0x1a579c[_0x90da('0x30')]);_0x5e52bc[_0x90da('0x32')]=_[_0x90da('0x33')](_0x5e52bc[_0x90da('0x2f')],_0x5e52bc[_0x90da('0x30')]);_0x3c60b4[_0x90da('0x34')]=_[_0x90da('0x33')](_0x5e52bc['model'],qs[_0x90da('0x35')](_0x1a579c['query']['fields']));_0x3c60b4['attributes']=_0x3c60b4[_0x90da('0x34')]['length']?_0x3c60b4[_0x90da('0x34')]:_0x5e52bc[_0x90da('0x2f')];if(!_0x1a579c[_0x90da('0x30')][_0x90da('0x36')](_0x90da('0x37'))){_0x3c60b4[_0x90da('0x19')]=qs[_0x90da('0x19')](_0x1a579c[_0x90da('0x30')]['limit']);_0x3c60b4[_0x90da('0x18')]=qs[_0x90da('0x18')](_0x1a579c[_0x90da('0x30')][_0x90da('0x18')]);}_0x3c60b4[_0x90da('0x38')]=qs[_0x90da('0x39')](_0x1a579c[_0x90da('0x30')][_0x90da('0x39')]);_0x3c60b4[_0x90da('0x3a')]=qs[_0x90da('0x32')](_['pick'](_0x1a579c[_0x90da('0x30')],_0x5e52bc[_0x90da('0x32')]),_0x2610d2);if(_0x1a579c[_0x90da('0x30')][_0x90da('0x3b')]){_0x3c60b4[_0x90da('0x3a')]=_['merge'](_0x3c60b4[_0x90da('0x3a')],{'$or':_[_0x90da('0x29')](_0x2610d2,function(_0x2e65b0){if(_0x2e65b0[_0x90da('0x2d')]!==_0x90da('0x3c')){var _0x3d2dd9={};_0x3d2dd9[_0x2e65b0['name']]={'$like':'%'+_0x1a579c[_0x90da('0x30')][_0x90da('0x3b')]+'%'};return _0x3d2dd9;}})});}_0x3c60b4=_['merge']({},_0x3c60b4,_0x1a579c[_0x90da('0x3d')]);var _0x29f8b0={'where':_0x3c60b4[_0x90da('0x3a')]};return db['DeskConfiguration']['count'](_0x29f8b0)[_0x90da('0x21')](function(_0x5df525){_0x3379cf[_0x90da('0x1b')]=_0x5df525;if(_0x1a579c[_0x90da('0x30')][_0x90da('0x3e')]){_0x3c60b4[_0x90da('0x3f')]=[{'all':!![]}];}return db[_0x90da('0x2a')][_0x90da('0x40')](_0x3c60b4);})['then'](function(_0x142dec){_0x3379cf[_0x90da('0x41')]=_0x142dec;return _0x3379cf;})[_0x90da('0x21')](respondWithFilteredResult(_0x2ed9cf,_0x3c60b4))['catch'](handleError(_0x2ed9cf,null));};exports[_0x90da('0x42')]=function(_0x51299f,_0x53e97f){var _0x2d0f23={'raw':![],'where':{'id':_0x51299f['params']['id']}},_0x2f9bc0={};_0x2f9bc0[_0x90da('0x2f')]=_[_0x90da('0x31')](db['DeskConfiguration'][_0x90da('0x2b')]);_0x2f9bc0['query']=_[_0x90da('0x31')](_0x51299f[_0x90da('0x30')]);_0x2f9bc0[_0x90da('0x32')]=_[_0x90da('0x33')](_0x2f9bc0[_0x90da('0x2f')],_0x2f9bc0['query']);_0x2d0f23[_0x90da('0x34')]=_[_0x90da('0x33')](_0x2f9bc0['model'],qs['fields'](_0x51299f['query'][_0x90da('0x35')]));_0x2d0f23[_0x90da('0x34')]=_0x2d0f23[_0x90da('0x34')][_0x90da('0x43')]?_0x2d0f23[_0x90da('0x34')]:_0x2f9bc0[_0x90da('0x2f')];if(_0x51299f[_0x90da('0x30')][_0x90da('0x3e')]){_0x2d0f23[_0x90da('0x3f')]=[{'all':!![]}];}_0x2d0f23=_[_0x90da('0x44')]({},_0x2d0f23,_0x51299f[_0x90da('0x3d')]);return db[_0x90da('0x2a')]['find'](_0x2d0f23)['then'](handleEntityNotFound(_0x53e97f,null))[_0x90da('0x21')](respondWithResult(_0x53e97f,null))[_0x90da('0x45')](handleError(_0x53e97f,null));};exports[_0x90da('0x46')]=function(_0x7e1331,_0xed9b){return db['DeskConfiguration'][_0x90da('0x46')](_0x7e1331[_0x90da('0x47')],{})[_0x90da('0x21')](respondWithResult(_0xed9b,0xc9))[_0x90da('0x45')](handleError(_0xed9b,null));};exports[_0x90da('0x20')]=function(_0xdac1ef,_0x547492){if(_0xdac1ef[_0x90da('0x47')]['id']){delete _0xdac1ef[_0x90da('0x47')]['id'];}return db[_0x90da('0x2a')][_0x90da('0x48')]({'where':{'id':_0xdac1ef['params']['id']}})[_0x90da('0x21')](handleEntityNotFound(_0x547492,null))[_0x90da('0x21')](saveUpdates(_0xdac1ef[_0x90da('0x47')],null))[_0x90da('0x21')](respondWithResult(_0x547492,null))[_0x90da('0x45')](handleError(_0x547492,null));};exports[_0x90da('0x22')]=function(_0x269b95,_0x273db0){return db[_0x90da('0x2a')]['find']({'where':{'id':_0x269b95['params']['id']}})[_0x90da('0x21')](handleEntityNotFound(_0x273db0,null))[_0x90da('0x21')](removeEntity(_0x273db0,null))[_0x90da('0x45')](handleError(_0x273db0,null));};exports[_0x90da('0x49')]=function(_0x2bcedd,_0x2b5198,_0x28f0c7){var _0x2e522b={};var _0x3491c1={};var _0x2272c7;var _0x575e2a;return db[_0x90da('0x2a')][_0x90da('0x4a')]({'where':{'id':_0x2bcedd[_0x90da('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2b5198,null))[_0x90da('0x21')](function(_0x3e8af9){if(_0x3e8af9){_0x2272c7=_0x3e8af9;_0x3491c1[_0x90da('0x2f')]=_[_0x90da('0x31')](db[_0x90da('0x4c')][_0x90da('0x2b')]);_0x3491c1['query']=_[_0x90da('0x31')](_0x2bcedd[_0x90da('0x30')]);_0x3491c1[_0x90da('0x32')]=_[_0x90da('0x33')](_0x3491c1[_0x90da('0x2f')],_0x3491c1[_0x90da('0x30')]);_0x2e522b[_0x90da('0x34')]=_[_0x90da('0x33')](_0x3491c1['model'],qs['fields'](_0x2bcedd['query'][_0x90da('0x35')]));_0x2e522b[_0x90da('0x34')]=_0x2e522b[_0x90da('0x34')][_0x90da('0x43')]?_0x2e522b[_0x90da('0x34')]:_0x3491c1['model'];_0x2e522b['order']=qs[_0x90da('0x39')](_0x2bcedd[_0x90da('0x30')][_0x90da('0x39')]);_0x2e522b[_0x90da('0x3a')]=qs[_0x90da('0x32')](_[_0x90da('0x4d')](_0x2bcedd[_0x90da('0x30')],_0x3491c1[_0x90da('0x32')]));if(_0x2bcedd[_0x90da('0x30')][_0x90da('0x3b')]){_0x2e522b['where']=_[_0x90da('0x44')](_0x2e522b[_0x90da('0x3a')],{'$or':_[_0x90da('0x29')](_0x2e522b[_0x90da('0x34')],function(_0x4ffc4a){var _0x698256={};_0x698256[_0x4ffc4a]={'$like':'%'+_0x2bcedd['query'][_0x90da('0x3b')]+'%'};return _0x698256;})});}_0x2e522b=_[_0x90da('0x44')]({},_0x2e522b,_0x2bcedd[_0x90da('0x3d')]);return _0x2272c7[_0x90da('0x49')](_0x2e522b);}})[_0x90da('0x21')](function(_0x34a075){if(_0x34a075){_0x575e2a=_0x34a075[_0x90da('0x43')];if(!_0x2bcedd[_0x90da('0x30')][_0x90da('0x36')]('nolimit')){_0x2e522b['limit']=qs[_0x90da('0x19')](_0x2bcedd[_0x90da('0x30')][_0x90da('0x19')]);_0x2e522b[_0x90da('0x18')]=qs[_0x90da('0x18')](_0x2bcedd[_0x90da('0x30')][_0x90da('0x18')]);}return _0x2272c7[_0x90da('0x49')](_0x2e522b);}})['then'](function(_0x16322d){if(_0x16322d){return _0x16322d?{'count':_0x575e2a,'rows':_0x16322d}:null;}})[_0x90da('0x21')](respondWithResult(_0x2b5198,null))[_0x90da('0x45')](handleError(_0x2b5198,null));};exports['getSubjects']=function(_0x359bdd,_0xbe1234,_0x14e130){var _0x57b588={};var _0x3a0d3b={};var _0xf96c86;var _0x4606c4;return db['DeskConfiguration'][_0x90da('0x4a')]({'where':{'id':_0x359bdd[_0x90da('0x4b')]['id']}})['then'](handleEntityNotFound(_0xbe1234,null))[_0x90da('0x21')](function(_0xb33e71){if(_0xb33e71){_0xf96c86=_0xb33e71;_0x3a0d3b[_0x90da('0x2f')]=_['keys'](db[_0x90da('0x4c')][_0x90da('0x2b')]);_0x3a0d3b['query']=_[_0x90da('0x31')](_0x359bdd[_0x90da('0x30')]);_0x3a0d3b[_0x90da('0x32')]=_[_0x90da('0x33')](_0x3a0d3b['model'],_0x3a0d3b['query']);_0x57b588[_0x90da('0x34')]=_[_0x90da('0x33')](_0x3a0d3b['model'],qs[_0x90da('0x35')](_0x359bdd[_0x90da('0x30')]['fields']));_0x57b588[_0x90da('0x34')]=_0x57b588[_0x90da('0x34')]['length']?_0x57b588[_0x90da('0x34')]:_0x3a0d3b[_0x90da('0x2f')];_0x57b588[_0x90da('0x38')]=qs['sort'](_0x359bdd[_0x90da('0x30')][_0x90da('0x39')]);_0x57b588[_0x90da('0x3a')]=qs['filters'](_[_0x90da('0x4d')](_0x359bdd[_0x90da('0x30')],_0x3a0d3b[_0x90da('0x32')]));if(_0x359bdd['query'][_0x90da('0x3b')]){_0x57b588[_0x90da('0x3a')]=_[_0x90da('0x44')](_0x57b588[_0x90da('0x3a')],{'$or':_['map'](_0x57b588[_0x90da('0x34')],function(_0x4d299a){var _0x4f3cfa={};_0x4f3cfa[_0x4d299a]={'$like':'%'+_0x359bdd[_0x90da('0x30')][_0x90da('0x3b')]+'%'};return _0x4f3cfa;})});}_0x57b588=_['merge']({},_0x57b588,_0x359bdd[_0x90da('0x3d')]);return _0xf96c86['getSubjects'](_0x57b588);}})[_0x90da('0x21')](function(_0x2a674a){if(_0x2a674a){_0x4606c4=_0x2a674a['length'];if(!_0x359bdd[_0x90da('0x30')][_0x90da('0x36')](_0x90da('0x37'))){_0x57b588[_0x90da('0x19')]=qs[_0x90da('0x19')](_0x359bdd['query']['limit']);_0x57b588[_0x90da('0x18')]=qs[_0x90da('0x18')](_0x359bdd[_0x90da('0x30')][_0x90da('0x18')]);}return _0xf96c86[_0x90da('0x4e')](_0x57b588);}})['then'](function(_0x219af7){if(_0x219af7){return _0x219af7?{'count':_0x4606c4,'rows':_0x219af7}:null;}})[_0x90da('0x21')](respondWithResult(_0xbe1234,null))[_0x90da('0x45')](handleError(_0xbe1234,null));};exports[_0x90da('0x4f')]=function(_0x1dc289,_0x1aec3b,_0x4c33a9){var _0x3e0c69={};var _0x53d3ab={};var _0x2537ee;var _0x6827b6;return db[_0x90da('0x2a')][_0x90da('0x4a')]({'where':{'id':_0x1dc289[_0x90da('0x4b')]['id']}})[_0x90da('0x21')](handleEntityNotFound(_0x1aec3b,null))[_0x90da('0x21')](function(_0x2c121c){if(_0x2c121c){_0x2537ee=_0x2c121c;_0x53d3ab[_0x90da('0x2f')]=_[_0x90da('0x31')](db['DeskField']['rawAttributes']);_0x53d3ab[_0x90da('0x30')]=_[_0x90da('0x31')](_0x1dc289[_0x90da('0x30')]);_0x53d3ab[_0x90da('0x32')]=_['intersection'](_0x53d3ab[_0x90da('0x2f')],_0x53d3ab[_0x90da('0x30')]);_0x3e0c69[_0x90da('0x34')]=_[_0x90da('0x33')](_0x53d3ab['model'],qs[_0x90da('0x35')](_0x1dc289[_0x90da('0x30')][_0x90da('0x35')]));_0x3e0c69[_0x90da('0x34')]=_0x3e0c69[_0x90da('0x34')]['length']?_0x3e0c69[_0x90da('0x34')]:_0x53d3ab['model'];_0x3e0c69[_0x90da('0x38')]=qs[_0x90da('0x39')](_0x1dc289[_0x90da('0x30')][_0x90da('0x39')]);_0x3e0c69['where']=qs[_0x90da('0x32')](_[_0x90da('0x4d')](_0x1dc289[_0x90da('0x30')],_0x53d3ab[_0x90da('0x32')]));if(_0x1dc289[_0x90da('0x30')]['filter']){_0x3e0c69[_0x90da('0x3a')]=_[_0x90da('0x44')](_0x3e0c69[_0x90da('0x3a')],{'$or':_[_0x90da('0x29')](_0x3e0c69[_0x90da('0x34')],function(_0x274c12){var _0x238523={};_0x238523[_0x274c12]={'$like':'%'+_0x1dc289[_0x90da('0x30')][_0x90da('0x3b')]+'%'};return _0x238523;})});}_0x3e0c69=_['merge']({},_0x3e0c69,_0x1dc289['options']);return _0x2537ee[_0x90da('0x4f')](_0x3e0c69);}})[_0x90da('0x21')](function(_0x6e90a6){if(_0x6e90a6){_0x6827b6=_0x6e90a6['length'];if(!_0x1dc289[_0x90da('0x30')][_0x90da('0x36')](_0x90da('0x37'))){_0x3e0c69[_0x90da('0x19')]=qs[_0x90da('0x19')](_0x1dc289['query'][_0x90da('0x19')]);_0x3e0c69['offset']=qs[_0x90da('0x18')](_0x1dc289[_0x90da('0x30')][_0x90da('0x18')]);}return _0x2537ee[_0x90da('0x4f')](_0x3e0c69);}})['then'](function(_0xb2df46){if(_0xb2df46){return _0xb2df46?{'count':_0x6827b6,'rows':_0xb2df46}:null;}})[_0x90da('0x21')](respondWithResult(_0x1aec3b,null))[_0x90da('0x45')](handleError(_0x1aec3b,null));};exports[_0x90da('0x50')]=function(_0x503a2d,_0x2ea4ab,_0x1dabe9){var _0x1a2d3e={};var _0x2a6e73={};var _0x3a1f1d;var _0x2b79f2;return db[_0x90da('0x2a')]['findOne']({'where':{'id':_0x503a2d[_0x90da('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ea4ab,null))[_0x90da('0x21')](function(_0x32a256){if(_0x32a256){_0x3a1f1d=_0x32a256;_0x2a6e73[_0x90da('0x2f')]=_[_0x90da('0x31')](db[_0x90da('0x51')][_0x90da('0x2b')]);_0x2a6e73[_0x90da('0x30')]=_['keys'](_0x503a2d[_0x90da('0x30')]);_0x2a6e73[_0x90da('0x32')]=_[_0x90da('0x33')](_0x2a6e73[_0x90da('0x2f')],_0x2a6e73[_0x90da('0x30')]);_0x1a2d3e[_0x90da('0x34')]=_[_0x90da('0x33')](_0x2a6e73[_0x90da('0x2f')],qs[_0x90da('0x35')](_0x503a2d[_0x90da('0x30')][_0x90da('0x35')]));_0x1a2d3e[_0x90da('0x34')]=_0x1a2d3e[_0x90da('0x34')][_0x90da('0x43')]?_0x1a2d3e[_0x90da('0x34')]:_0x2a6e73[_0x90da('0x2f')];_0x1a2d3e[_0x90da('0x38')]=qs[_0x90da('0x39')](_0x503a2d[_0x90da('0x30')][_0x90da('0x39')]);_0x1a2d3e['where']=qs[_0x90da('0x32')](_[_0x90da('0x4d')](_0x503a2d[_0x90da('0x30')],_0x2a6e73[_0x90da('0x32')]));if(_0x503a2d[_0x90da('0x30')][_0x90da('0x3b')]){_0x1a2d3e[_0x90da('0x3a')]=_[_0x90da('0x44')](_0x1a2d3e[_0x90da('0x3a')],{'$or':_[_0x90da('0x29')](_0x1a2d3e[_0x90da('0x34')],function(_0x41f4fa){var _0x50de5a={};_0x50de5a[_0x41f4fa]={'$like':'%'+_0x503a2d[_0x90da('0x30')][_0x90da('0x3b')]+'%'};return _0x50de5a;})});}_0x1a2d3e=_[_0x90da('0x44')]({},_0x1a2d3e,_0x503a2d[_0x90da('0x3d')]);return _0x3a1f1d[_0x90da('0x50')](_0x1a2d3e);}})[_0x90da('0x21')](function(_0x232018){if(_0x232018){_0x2b79f2=_0x232018[_0x90da('0x43')];if(!_0x503a2d[_0x90da('0x30')][_0x90da('0x36')](_0x90da('0x37'))){_0x1a2d3e['limit']=qs[_0x90da('0x19')](_0x503a2d['query'][_0x90da('0x19')]);_0x1a2d3e['offset']=qs[_0x90da('0x18')](_0x503a2d[_0x90da('0x30')][_0x90da('0x18')]);}return _0x3a1f1d[_0x90da('0x50')](_0x1a2d3e);}})['then'](function(_0x1fe602){if(_0x1fe602){return _0x1fe602?{'count':_0x2b79f2,'rows':_0x1fe602}:null;}})[_0x90da('0x21')](respondWithResult(_0x2ea4ab,null))[_0x90da('0x45')](handleError(_0x2ea4ab,null));};exports[_0x90da('0x52')]=function(_0x1b7834,_0x13e74c,_0x29dbc7){if(_0x1b7834[_0x90da('0x47')]['id']){delete _0x1b7834[_0x90da('0x47')]['id'];}return db[_0x90da('0x2a')][_0x90da('0x4a')]({'where':{'id':_0x1b7834[_0x90da('0x4b')]['id']}})[_0x90da('0x21')](handleEntityNotFound(_0x13e74c,null))['then'](function(_0x205e13){if(_0x205e13){return _0x205e13[_0x90da('0x52')](_0x1b7834[_0x90da('0x47')][_0x90da('0x53')]||[]);}return null;})[_0x90da('0x21')](respondWithResult(_0x13e74c,null))[_0x90da('0x45')](handleError(_0x13e74c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7e8020b..70356e5 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 _0x65ad=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x65ad,0x18b));var _0xd65a=function(_0x105a4b,_0x280e5b){_0x105a4b=_0x105a4b-0x0;var _0x4a50eb=_0x65ad[_0x105a4b];return _0x4a50eb;};'use strict';var _=require(_0xd65a('0x0'));var util=require(_0xd65a('0x1'));var logger=require(_0xd65a('0x2'))(_0xd65a('0x3'));var moment=require(_0xd65a('0x4'));var BPromise=require(_0xd65a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd65a('0x6'));var rimraf=require('rimraf');var config=require(_0xd65a('0x7'));var attributes=require(_0xd65a('0x8'));module[_0xd65a('0x9')]=function(_0x425131,_0x2f4b89){return _0x425131[_0xd65a('0xa')](_0xd65a('0xb'),attributes,{'tableName':_0xd65a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1987=['DeskConfiguration','int_desk_configurations','util','../../config/logger','bluebird','rimraf','./intDeskConfiguration.attributes','exports'];(function(_0x201415,_0x3c47c2){var _0x135533=function(_0x14e302){while(--_0x14e302){_0x201415['push'](_0x201415['shift']());}};_0x135533(++_0x3c47c2);}(_0x1987,0x1f2));var _0x7198=function(_0x52bda5,_0x40d5b1){_0x52bda5=_0x52bda5-0x0;var _0x4b0094=_0x1987[_0x52bda5];return _0x4b0094;};'use strict';var _=require('lodash');var util=require(_0x7198('0x0'));var logger=require(_0x7198('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7198('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7198('0x3'));var config=require('../../config/environment');var attributes=require(_0x7198('0x4'));module[_0x7198('0x5')]=function(_0x4529bf,_0x37bb5b){return _0x4529bf['define'](_0x7198('0x6'),attributes,{'tableName':_0x7198('0x7'),'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 698a664..efb9f60 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 _0x9a4d=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x49091a,_0x56e33c){var _0x595697=function(_0x29aaeb){while(--_0x29aaeb){_0x49091a['push'](_0x49091a['shift']());}};_0x595697(++_0x56e33c);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x1cc9b2,_0xe77730){_0x1cc9b2=_0x1cc9b2-0x0;var _0x30b919=_0x9a4d[_0x1cc9b2];return _0x30b919;};'use strict';var _=require(_0xd9a4('0x0'));var util=require(_0xd9a4('0x1'));var moment=require(_0xd9a4('0x2'));var BPromise=require(_0xd9a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd9a4('0x4'));var logger=require(_0xd9a4('0x5'))(_0xd9a4('0x6'));var config=require(_0xd9a4('0x7'));var jayson=require(_0xd9a4('0x8'));var client=jayson['client'][_0xd9a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f3b61,_0x32ff8d,_0x28cff6){return new BPromise(function(_0xbec704,_0x407c40){return client['request'](_0x3f3b61,_0x28cff6)[_0xd9a4('0xa')](function(_0x297439){logger[_0xd9a4('0xb')](_0xd9a4('0xc'),_0x32ff8d,'request\x20sent');logger[_0xd9a4('0xd')](_0xd9a4('0xe'),_0x32ff8d,_0xd9a4('0xf'),JSON[_0xd9a4('0x10')](_0x297439));if(_0x297439[_0xd9a4('0x11')]){if(_0x297439['error'][_0xd9a4('0x12')]===0x1f4){logger[_0xd9a4('0x11')](_0xd9a4('0xc'),_0x32ff8d,_0x297439['error'][_0xd9a4('0x13')]);return _0x407c40(_0x297439[_0xd9a4('0x11')][_0xd9a4('0x13')]);}logger[_0xd9a4('0x11')](_0xd9a4('0xc'),_0x32ff8d,_0x297439[_0xd9a4('0x11')][_0xd9a4('0x13')]);return _0xbec704(_0x297439[_0xd9a4('0x11')][_0xd9a4('0x13')]);}else{logger['info'](_0xd9a4('0xc'),_0x32ff8d,_0xd9a4('0xf'));_0xbec704(_0x297439['result'][_0xd9a4('0x13')]);}})[_0xd9a4('0x14')](function(_0x303cab){logger[_0xd9a4('0x11')](_0xd9a4('0xc'),_0x32ff8d,_0x303cab);_0x407c40(_0x303cab);});});} \ No newline at end of file +var _0x8ba6=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ba6,0x11b));var _0x68ba=function(_0x3e3925,_0x24c76c){_0x3e3925=_0x3e3925-0x0;var _0x487814=_0x8ba6[_0x3e3925];return _0x487814;};'use strict';var _=require(_0x68ba('0x0'));var util=require('util');var moment=require(_0x68ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x68ba('0x2'));var fs=require('fs');var Redis=require(_0x68ba('0x3'));var db=require(_0x68ba('0x4'))['db'];var utils=require(_0x68ba('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x68ba('0x6'));var jayson=require(_0x68ba('0x7'));var client=jayson[_0x68ba('0x8')][_0x68ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ad848,_0x1ba7fa,_0x97b7a){return new BPromise(function(_0xc67bf0,_0x5aa5bd){return client[_0x68ba('0xa')](_0x2ad848,_0x97b7a)[_0x68ba('0xb')](function(_0x1ec922){logger[_0x68ba('0xc')](_0x68ba('0xd'),_0x1ba7fa,_0x68ba('0xe'));logger[_0x68ba('0xf')](_0x68ba('0x10'),_0x1ba7fa,_0x68ba('0xe'),JSON[_0x68ba('0x11')](_0x1ec922));if(_0x1ec922['error']){if(_0x1ec922[_0x68ba('0x12')][_0x68ba('0x13')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x1ba7fa,_0x1ec922[_0x68ba('0x12')]['message']);return _0x5aa5bd(_0x1ec922[_0x68ba('0x12')][_0x68ba('0x14')]);}logger[_0x68ba('0x12')](_0x68ba('0xd'),_0x1ba7fa,_0x1ec922[_0x68ba('0x12')][_0x68ba('0x14')]);return _0xc67bf0(_0x1ec922[_0x68ba('0x12')]['message']);}else{logger[_0x68ba('0xc')](_0x68ba('0xd'),_0x1ba7fa,_0x68ba('0xe'));_0xc67bf0(_0x1ec922[_0x68ba('0x15')][_0x68ba('0x14')]);}})['catch'](function(_0x2babf4){logger[_0x68ba('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x1ba7fa,_0x2babf4);_0x5aa5bd(_0x2babf4);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 9665b33..a75cbad 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 _0x5952=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x6a5666,_0x587426){var _0x1abf22=function(_0x53e78e){while(--_0x53e78e){_0x6a5666['push'](_0x6a5666['shift']());}};_0x1abf22(++_0x587426);}(_0x5952,0x10d));var _0x2595=function(_0x346fbb,_0x511040){_0x346fbb=_0x346fbb-0x0;var _0x38fac1=_0x5952[_0x346fbb];return _0x38fac1;};'use strict';var multer=require(_0x2595('0x0'));var util=require(_0x2595('0x1'));var path=require('path');var timeout=require(_0x2595('0x2'));var express=require(_0x2595('0x3'));var router=express[_0x2595('0x4')]();var fs_extra=require(_0x2595('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2595('0x6'));var config=require(_0x2595('0x7'));var controller=require(_0x2595('0x8'));router[_0x2595('0x9')]('/',auth[_0x2595('0xa')](),controller[_0x2595('0xb')]);router[_0x2595('0x9')](_0x2595('0xc'),auth[_0x2595('0xa')](),controller[_0x2595('0xd')]);router[_0x2595('0xe')]('/',auth[_0x2595('0xa')](),controller[_0x2595('0xf')]);router[_0x2595('0x10')](_0x2595('0xc'),auth['isAuthenticated'](),controller[_0x2595('0x11')]);router[_0x2595('0x12')](_0x2595('0xc'),auth[_0x2595('0xa')](),controller[_0x2595('0x13')]);module[_0x2595('0x14')]=router; \ No newline at end of file +var _0x3ef7=['get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x112734,_0x2e0d98){var _0x4a82ef=function(_0x4fde0f){while(--_0x4fde0f){_0x112734['push'](_0x112734['shift']());}};_0x4a82ef(++_0x2e0d98);}(_0x3ef7,0xa2));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x73ef('0x0'));var util=require('util');var path=require(_0x73ef('0x1'));var timeout=require(_0x73ef('0x2'));var express=require(_0x73ef('0x3'));var router=express[_0x73ef('0x4')]();var fs_extra=require(_0x73ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x73ef('0x6'));var config=require(_0x73ef('0x7'));var controller=require(_0x73ef('0x8'));router[_0x73ef('0x9')]('/',auth['isAuthenticated'](),controller[_0x73ef('0xa')]);router[_0x73ef('0x9')](_0x73ef('0xb'),auth[_0x73ef('0xc')](),controller[_0x73ef('0xd')]);router['post']('/',auth[_0x73ef('0xc')](),controller[_0x73ef('0xe')]);router['put'](_0x73ef('0xb'),auth[_0x73ef('0xc')](),controller[_0x73ef('0xf')]);router[_0x73ef('0x10')](_0x73ef('0xb'),auth['isAuthenticated'](),controller[_0x73ef('0x11')]);module[_0x73ef('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 5229b3f..8031a19 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 _0x9f57=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x51e164,_0x5d0a89){var _0x3db689=function(_0xe88a8a){while(--_0xe88a8a){_0x51e164['push'](_0x51e164['shift']());}};_0x3db689(++_0x5d0a89);}(_0x9f57,0x128));var _0x79f5=function(_0x922353,_0x2aff9e){_0x922353=_0x922353-0x0;var _0x65c2ca=_0x9f57[_0x922353];return _0x65c2ca;};'use strict';var Sequelize=require(_0x79f5('0x0'));module[_0x79f5('0x1')]={'type':{'type':Sequelize[_0x79f5('0x2')]('string',_0x79f5('0x3'),_0x79f5('0x4'),_0x79f5('0x5'),_0x79f5('0x6')),'defaultValue':_0x79f5('0x7')},'content':{'type':Sequelize[_0x79f5('0x8')]},'key':{'type':Sequelize[_0x79f5('0x8')]},'keyType':{'type':Sequelize[_0x79f5('0x2')](_0x79f5('0x7'),_0x79f5('0x3'),_0x79f5('0x4'))},'keyContent':{'type':Sequelize[_0x79f5('0x8')]},'idField':{'type':Sequelize[_0x79f5('0x8')]},'nameField':{'type':Sequelize[_0x79f5('0x8')]},'customField':{'type':Sequelize[_0x79f5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x79f5('0x8')]}}; \ No newline at end of file +var _0xc363=['BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING','ENUM'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xc363,0xfb));var _0x3c36=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0xc363[_0x7148a3];return _0x52f31d;};'use strict';var Sequelize=require(_0x3c36('0x0'));module[_0x3c36('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x3c36('0x2'),_0x3c36('0x3'),_0x3c36('0x4'),_0x3c36('0x5')),'defaultValue':_0x3c36('0x6')},'content':{'type':Sequelize[_0x3c36('0x7')]},'key':{'type':Sequelize[_0x3c36('0x7')]},'keyType':{'type':Sequelize[_0x3c36('0x8')](_0x3c36('0x6'),_0x3c36('0x2'),_0x3c36('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3c36('0x7')]},'nameField':{'type':Sequelize[_0x3c36('0x7')]},'customField':{'type':Sequelize[_0x3c36('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3c36('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index b08bb10..0f64005 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 _0x9797=['DeskField','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x16006f,_0x4deb55){var _0x38c94e=function(_0x421ed6){while(--_0x421ed6){_0x16006f['push'](_0x16006f['shift']());}};_0x38c94e(++_0x4deb55);}(_0x9797,0x1c9));var _0x7979=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x9797[_0x8de54f];return _0x14cba4;};'use strict';var emlformat=require(_0x7979('0x0'));var rimraf=require(_0x7979('0x1'));var zipdir=require(_0x7979('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7979('0x3'));var moment=require(_0x7979('0x4'));var BPromise=require(_0x7979('0x5'));var Mustache=require(_0x7979('0x6'));var util=require(_0x7979('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7979('0x8'));var ejs=require(_0x7979('0x9'));var fs=require('fs');var fs_extra=require(_0x7979('0xa'));var _=require(_0x7979('0xb'));var squel=require('squel');var crypto=require(_0x7979('0xc'));var jsforce=require(_0x7979('0xd'));var deskjs=require(_0x7979('0xe'));var toCsv=require(_0x7979('0x8'));var querystring=require(_0x7979('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7979('0x10'));var qs=require(_0x7979('0x11'));var as=require(_0x7979('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7979('0x13'));var utils=require(_0x7979('0x14'));var config=require(_0x7979('0x15'));var licenseUtil=require(_0x7979('0x16'));var db=require(_0x7979('0x17'))['db'];function respondWithStatusCode(_0x589298,_0x4d2f8a){_0x4d2f8a=_0x4d2f8a||0xcc;return function(_0x30d530){if(_0x30d530){return _0x589298['sendStatus'](_0x4d2f8a);}return _0x589298['status'](_0x4d2f8a)[_0x7979('0x18')]();};}function respondWithResult(_0xb4cd31,_0x459e51){_0x459e51=_0x459e51||0xc8;return function(_0x5d8d08){if(_0x5d8d08){return _0xb4cd31[_0x7979('0x19')](_0x459e51)[_0x7979('0x1a')](_0x5d8d08);}};}function respondWithFilteredResult(_0xd7a017,_0x41f87a){return function(_0x52f019){if(_0x52f019){var _0x47218d=typeof _0x41f87a[_0x7979('0x1b')]===_0x7979('0x1c')&&typeof _0x41f87a[_0x7979('0x1d')]===_0x7979('0x1c');var _0x432282=_0x52f019[_0x7979('0x1e')];var _0x2f0da1=_0x47218d?0x0:_0x41f87a[_0x7979('0x1b')];var _0x2b96dd=_0x47218d?_0x52f019[_0x7979('0x1e')]:_0x41f87a[_0x7979('0x1b')]+_0x41f87a[_0x7979('0x1d')];var _0x3f4ee1;if(_0x2b96dd>=_0x432282){_0x2b96dd=_0x432282;_0x3f4ee1=0xc8;}else{_0x3f4ee1=0xce;}_0xd7a017[_0x7979('0x19')](_0x3f4ee1);return _0xd7a017[_0x7979('0x1f')](_0x7979('0x20'),_0x2f0da1+'-'+_0x2b96dd+'/'+_0x432282)['json'](_0x52f019);}return null;};}function patchUpdates(_0x39be8d){return function(_0x3caa42){try{jsonpatch[_0x7979('0x21')](_0x3caa42,_0x39be8d,!![]);}catch(_0x570616){return BPromise['reject'](_0x570616);}return _0x3caa42['save']();};}function saveUpdates(_0x2c20a8,_0x43580d){return function(_0x43e146){if(_0x43e146){return _0x43e146[_0x7979('0x22')](_0x2c20a8)[_0x7979('0x23')](function(_0x389afe){return _0x389afe;});}return null;};}function removeEntity(_0x3da389,_0x2cd387){return function(_0xefb493){if(_0xefb493){return _0xefb493['destroy']()[_0x7979('0x23')](function(){_0x3da389['status'](0xcc)[_0x7979('0x18')]();});}};}function handleEntityNotFound(_0x3cf16f,_0x2fdc17){return function(_0x43936e){if(!_0x43936e){_0x3cf16f[_0x7979('0x24')](0x194);}return _0x43936e;};}function handleError(_0x2c6140,_0x10875e){_0x10875e=_0x10875e||0x1f4;return function(_0x99140c){logger[_0x7979('0x25')](_0x99140c[_0x7979('0x26')]);if(_0x99140c[_0x7979('0x27')]){delete _0x99140c[_0x7979('0x27')];}_0x2c6140['status'](_0x10875e)[_0x7979('0x28')](_0x99140c);};}exports['index']=function(_0x43c73d,_0x5b75d0){var _0x56d090={},_0x151f57={},_0x152d01={'count':0x0,'rows':[]};var _0x319ef8=_[_0x7979('0x29')](db['DeskField'][_0x7979('0x2a')],function(_0x9051fa){return{'name':_0x9051fa['fieldName'],'type':_0x9051fa[_0x7979('0x2b')][_0x7979('0x2c')]};});_0x151f57[_0x7979('0x2d')]=_[_0x7979('0x29')](_0x319ef8,_0x7979('0x27'));_0x151f57[_0x7979('0x2e')]=_[_0x7979('0x2f')](_0x43c73d[_0x7979('0x2e')]);_0x151f57[_0x7979('0x30')]=_[_0x7979('0x31')](_0x151f57[_0x7979('0x2d')],_0x151f57[_0x7979('0x2e')]);_0x56d090[_0x7979('0x32')]=_[_0x7979('0x31')](_0x151f57[_0x7979('0x2d')],qs['fields'](_0x43c73d[_0x7979('0x2e')]['fields']));_0x56d090['attributes']=_0x56d090[_0x7979('0x32')][_0x7979('0x33')]?_0x56d090[_0x7979('0x32')]:_0x151f57[_0x7979('0x2d')];if(!_0x43c73d[_0x7979('0x2e')]['hasOwnProperty'](_0x7979('0x34'))){_0x56d090['limit']=qs[_0x7979('0x1d')](_0x43c73d['query'][_0x7979('0x1d')]);_0x56d090[_0x7979('0x1b')]=qs[_0x7979('0x1b')](_0x43c73d['query'][_0x7979('0x1b')]);}_0x56d090[_0x7979('0x35')]=qs['sort'](_0x43c73d[_0x7979('0x2e')][_0x7979('0x36')]);_0x56d090[_0x7979('0x37')]=qs[_0x7979('0x30')](_[_0x7979('0x38')](_0x43c73d[_0x7979('0x2e')],_0x151f57[_0x7979('0x30')]),_0x319ef8);if(_0x43c73d['query'][_0x7979('0x39')]){_0x56d090['where']=_[_0x7979('0x3a')](_0x56d090['where'],{'$or':_[_0x7979('0x29')](_0x319ef8,function(_0x5abfee){if(_0x5abfee[_0x7979('0x2b')]!==_0x7979('0x3b')){var _0xc68913={};_0xc68913[_0x5abfee[_0x7979('0x27')]]={'$like':'%'+_0x43c73d[_0x7979('0x2e')][_0x7979('0x39')]+'%'};return _0xc68913;}})});}_0x56d090=_[_0x7979('0x3a')]({},_0x56d090,_0x43c73d[_0x7979('0x3c')]);var _0x1ce88e={'where':_0x56d090[_0x7979('0x37')]};return db[_0x7979('0x3d')]['count'](_0x1ce88e)['then'](function(_0x3351c7){_0x152d01['count']=_0x3351c7;if(_0x43c73d[_0x7979('0x2e')][_0x7979('0x3e')]){_0x56d090[_0x7979('0x3f')]=[{'all':!![]}];}return db[_0x7979('0x3d')][_0x7979('0x40')](_0x56d090);})['then'](function(_0x53fe80){_0x152d01[_0x7979('0x41')]=_0x53fe80;return _0x152d01;})[_0x7979('0x23')](respondWithFilteredResult(_0x5b75d0,_0x56d090))[_0x7979('0x42')](handleError(_0x5b75d0,null));};exports[_0x7979('0x43')]=function(_0x4baa63,_0xdca5ac){var _0x274df6={'raw':!![],'where':{'id':_0x4baa63[_0x7979('0x44')]['id']}},_0x33601c={};_0x33601c['model']=_[_0x7979('0x2f')](db[_0x7979('0x3d')][_0x7979('0x2a')]);_0x33601c[_0x7979('0x2e')]=_['keys'](_0x4baa63['query']);_0x33601c[_0x7979('0x30')]=_[_0x7979('0x31')](_0x33601c[_0x7979('0x2d')],_0x33601c['query']);_0x274df6[_0x7979('0x32')]=_[_0x7979('0x31')](_0x33601c[_0x7979('0x2d')],qs[_0x7979('0x45')](_0x4baa63[_0x7979('0x2e')][_0x7979('0x45')]));_0x274df6[_0x7979('0x32')]=_0x274df6[_0x7979('0x32')][_0x7979('0x33')]?_0x274df6['attributes']:_0x33601c[_0x7979('0x2d')];if(_0x4baa63[_0x7979('0x2e')][_0x7979('0x3e')]){_0x274df6[_0x7979('0x3f')]=[{'all':!![]}];}_0x274df6=_[_0x7979('0x3a')]({},_0x274df6,_0x4baa63[_0x7979('0x3c')]);return db[_0x7979('0x3d')][_0x7979('0x46')](_0x274df6)[_0x7979('0x23')](handleEntityNotFound(_0xdca5ac,null))['then'](respondWithResult(_0xdca5ac,null))[_0x7979('0x42')](handleError(_0xdca5ac,null));};exports['create']=function(_0x29f6c9,_0x20eb96){return db[_0x7979('0x3d')][_0x7979('0x47')](_0x29f6c9[_0x7979('0x48')],{})[_0x7979('0x23')](respondWithResult(_0x20eb96,0xc9))['catch'](handleError(_0x20eb96,null));};exports[_0x7979('0x22')]=function(_0x3df62c,_0x52401c){if(_0x3df62c[_0x7979('0x48')]['id']){delete _0x3df62c[_0x7979('0x48')]['id'];}return db[_0x7979('0x3d')][_0x7979('0x46')]({'where':{'id':_0x3df62c[_0x7979('0x44')]['id']}})[_0x7979('0x23')](handleEntityNotFound(_0x52401c,null))[_0x7979('0x23')](saveUpdates(_0x3df62c[_0x7979('0x48')],null))[_0x7979('0x23')](respondWithResult(_0x52401c,null))['catch'](handleError(_0x52401c,null));};exports[_0x7979('0x49')]=function(_0x28d7ac,_0x16e35a){return db['DeskField'][_0x7979('0x46')]({'where':{'id':_0x28d7ac[_0x7979('0x44')]['id']}})[_0x7979('0x23')](handleEntityNotFound(_0x16e35a,null))[_0x7979('0x23')](removeEntity(_0x16e35a,null))[_0x7979('0x42')](handleError(_0x16e35a,null));}; \ No newline at end of file +var _0xc130=['limit','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','send','index','map','DeskField','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xc130,0x7c));var _0x0c13=function(_0x17dc87,_0x46179b){_0x17dc87=_0x17dc87-0x0;var _0x791404=_0xc130[_0x17dc87];return _0x791404;};'use strict';var emlformat=require(_0x0c13('0x0'));var rimraf=require(_0x0c13('0x1'));var zipdir=require(_0x0c13('0x2'));var jsonpatch=require(_0x0c13('0x3'));var rp=require(_0x0c13('0x4'));var moment=require(_0x0c13('0x5'));var BPromise=require(_0x0c13('0x6'));var Mustache=require(_0x0c13('0x7'));var util=require(_0x0c13('0x8'));var path=require(_0x0c13('0x9'));var sox=require(_0x0c13('0xa'));var csv=require(_0x0c13('0xb'));var ejs=require(_0x0c13('0xc'));var fs=require('fs');var fs_extra=require(_0x0c13('0xd'));var _=require(_0x0c13('0xe'));var squel=require(_0x0c13('0xf'));var crypto=require(_0x0c13('0x10'));var jsforce=require(_0x0c13('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x0c13('0xb'));var querystring=require(_0x0c13('0x12'));var Papa=require('papaparse');var Redis=require(_0x0c13('0x13'));var authService=require(_0x0c13('0x14'));var qs=require(_0x0c13('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c13('0x16'));var logger=require('../../config/logger')(_0x0c13('0x17'));var utils=require(_0x0c13('0x18'));var config=require(_0x0c13('0x19'));var licenseUtil=require(_0x0c13('0x1a'));var db=require(_0x0c13('0x1b'))['db'];function respondWithStatusCode(_0xcfd3a4,_0x38d932){_0x38d932=_0x38d932||0xcc;return function(_0xff0f1a){if(_0xff0f1a){return _0xcfd3a4[_0x0c13('0x1c')](_0x38d932);}return _0xcfd3a4[_0x0c13('0x1d')](_0x38d932)['end']();};}function respondWithResult(_0x4b4a46,_0x329ce9){_0x329ce9=_0x329ce9||0xc8;return function(_0x62673a){if(_0x62673a){return _0x4b4a46[_0x0c13('0x1d')](_0x329ce9)['json'](_0x62673a);}};}function respondWithFilteredResult(_0x235e46,_0x5d6711){return function(_0x449611){if(_0x449611){var _0x58ba58=typeof _0x5d6711[_0x0c13('0x1e')]===_0x0c13('0x1f')&&typeof _0x5d6711[_0x0c13('0x20')]===_0x0c13('0x1f');var _0x2d55b2=_0x449611['count'];var _0x1e4999=_0x58ba58?0x0:_0x5d6711[_0x0c13('0x1e')];var _0x55839b=_0x58ba58?_0x449611['count']:_0x5d6711['offset']+_0x5d6711[_0x0c13('0x20')];var _0x30938a;if(_0x55839b>=_0x2d55b2){_0x55839b=_0x2d55b2;_0x30938a=0xc8;}else{_0x30938a=0xce;}_0x235e46[_0x0c13('0x1d')](_0x30938a);return _0x235e46[_0x0c13('0x21')](_0x0c13('0x22'),_0x1e4999+'-'+_0x55839b+'/'+_0x2d55b2)[_0x0c13('0x23')](_0x449611);}return null;};}function patchUpdates(_0xdb396e){return function(_0x3a02e8){try{jsonpatch[_0x0c13('0x24')](_0x3a02e8,_0xdb396e,!![]);}catch(_0x30b00d){return BPromise[_0x0c13('0x25')](_0x30b00d);}return _0x3a02e8['save']();};}function saveUpdates(_0x3b9bda,_0x1dbdef){return function(_0x2e6e8a){if(_0x2e6e8a){return _0x2e6e8a[_0x0c13('0x26')](_0x3b9bda)[_0x0c13('0x27')](function(_0x1736e9){return _0x1736e9;});}return null;};}function removeEntity(_0x5ab22d,_0x2777ad){return function(_0x28524d){if(_0x28524d){return _0x28524d[_0x0c13('0x28')]()['then'](function(){_0x5ab22d[_0x0c13('0x1d')](0xcc)[_0x0c13('0x29')]();});}};}function handleEntityNotFound(_0x4046ae,_0x2a1264){return function(_0x199a53){if(!_0x199a53){_0x4046ae[_0x0c13('0x1c')](0x194);}return _0x199a53;};}function handleError(_0x25380d,_0x576ffa){_0x576ffa=_0x576ffa||0x1f4;return function(_0x410159){logger[_0x0c13('0x2a')](_0x410159['stack']);if(_0x410159[_0x0c13('0x2b')]){delete _0x410159[_0x0c13('0x2b')];}_0x25380d[_0x0c13('0x1d')](_0x576ffa)[_0x0c13('0x2c')](_0x410159);};}exports[_0x0c13('0x2d')]=function(_0x588ab0,_0x3bebd5){var _0x22ed19={},_0xd02fc8={},_0x393160={'count':0x0,'rows':[]};var _0x4798ad=_[_0x0c13('0x2e')](db[_0x0c13('0x2f')]['rawAttributes'],function(_0x2b21fd){return{'name':_0x2b21fd['fieldName'],'type':_0x2b21fd[_0x0c13('0x30')][_0x0c13('0x31')]};});_0xd02fc8[_0x0c13('0x32')]=_[_0x0c13('0x2e')](_0x4798ad,_0x0c13('0x2b'));_0xd02fc8[_0x0c13('0x33')]=_['keys'](_0x588ab0['query']);_0xd02fc8[_0x0c13('0x34')]=_[_0x0c13('0x35')](_0xd02fc8[_0x0c13('0x32')],_0xd02fc8[_0x0c13('0x33')]);_0x22ed19[_0x0c13('0x36')]=_[_0x0c13('0x35')](_0xd02fc8[_0x0c13('0x32')],qs[_0x0c13('0x37')](_0x588ab0['query']['fields']));_0x22ed19['attributes']=_0x22ed19[_0x0c13('0x36')]['length']?_0x22ed19[_0x0c13('0x36')]:_0xd02fc8[_0x0c13('0x32')];if(!_0x588ab0[_0x0c13('0x33')]['hasOwnProperty'](_0x0c13('0x38'))){_0x22ed19[_0x0c13('0x20')]=qs[_0x0c13('0x20')](_0x588ab0[_0x0c13('0x33')][_0x0c13('0x20')]);_0x22ed19[_0x0c13('0x1e')]=qs['offset'](_0x588ab0[_0x0c13('0x33')][_0x0c13('0x1e')]);}_0x22ed19[_0x0c13('0x39')]=qs[_0x0c13('0x3a')](_0x588ab0[_0x0c13('0x33')]['sort']);_0x22ed19[_0x0c13('0x3b')]=qs[_0x0c13('0x34')](_['pick'](_0x588ab0[_0x0c13('0x33')],_0xd02fc8[_0x0c13('0x34')]),_0x4798ad);if(_0x588ab0['query'][_0x0c13('0x3c')]){_0x22ed19[_0x0c13('0x3b')]=_[_0x0c13('0x3d')](_0x22ed19['where'],{'$or':_[_0x0c13('0x2e')](_0x4798ad,function(_0x221a73){if(_0x221a73[_0x0c13('0x30')]!==_0x0c13('0x3e')){var _0x37189b={};_0x37189b[_0x221a73[_0x0c13('0x2b')]]={'$like':'%'+_0x588ab0['query'][_0x0c13('0x3c')]+'%'};return _0x37189b;}})});}_0x22ed19=_[_0x0c13('0x3d')]({},_0x22ed19,_0x588ab0['options']);var _0x44293c={'where':_0x22ed19['where']};return db[_0x0c13('0x2f')][_0x0c13('0x3f')](_0x44293c)[_0x0c13('0x27')](function(_0x1d8f83){_0x393160[_0x0c13('0x3f')]=_0x1d8f83;if(_0x588ab0[_0x0c13('0x33')][_0x0c13('0x40')]){_0x22ed19[_0x0c13('0x41')]=[{'all':!![]}];}return db[_0x0c13('0x2f')][_0x0c13('0x42')](_0x22ed19);})[_0x0c13('0x27')](function(_0xe06699){_0x393160[_0x0c13('0x43')]=_0xe06699;return _0x393160;})[_0x0c13('0x27')](respondWithFilteredResult(_0x3bebd5,_0x22ed19))[_0x0c13('0x44')](handleError(_0x3bebd5,null));};exports[_0x0c13('0x45')]=function(_0x4b73a8,_0x5ac4d5){var _0x2a06fa={'raw':!![],'where':{'id':_0x4b73a8[_0x0c13('0x46')]['id']}},_0x448589={};_0x448589['model']=_[_0x0c13('0x47')](db[_0x0c13('0x2f')][_0x0c13('0x48')]);_0x448589[_0x0c13('0x33')]=_[_0x0c13('0x47')](_0x4b73a8['query']);_0x448589['filters']=_['intersection'](_0x448589[_0x0c13('0x32')],_0x448589[_0x0c13('0x33')]);_0x2a06fa[_0x0c13('0x36')]=_[_0x0c13('0x35')](_0x448589[_0x0c13('0x32')],qs[_0x0c13('0x37')](_0x4b73a8[_0x0c13('0x33')]['fields']));_0x2a06fa[_0x0c13('0x36')]=_0x2a06fa[_0x0c13('0x36')][_0x0c13('0x49')]?_0x2a06fa['attributes']:_0x448589['model'];if(_0x4b73a8[_0x0c13('0x33')][_0x0c13('0x40')]){_0x2a06fa['include']=[{'all':!![]}];}_0x2a06fa=_['merge']({},_0x2a06fa,_0x4b73a8[_0x0c13('0x4a')]);return db[_0x0c13('0x2f')]['find'](_0x2a06fa)[_0x0c13('0x27')](handleEntityNotFound(_0x5ac4d5,null))[_0x0c13('0x27')](respondWithResult(_0x5ac4d5,null))[_0x0c13('0x44')](handleError(_0x5ac4d5,null));};exports[_0x0c13('0x4b')]=function(_0x3593de,_0x4e2fda){return db['DeskField'][_0x0c13('0x4b')](_0x3593de[_0x0c13('0x4c')],{})[_0x0c13('0x27')](respondWithResult(_0x4e2fda,0xc9))[_0x0c13('0x44')](handleError(_0x4e2fda,null));};exports[_0x0c13('0x26')]=function(_0x512aea,_0x41adc8){if(_0x512aea['body']['id']){delete _0x512aea[_0x0c13('0x4c')]['id'];}return db[_0x0c13('0x2f')][_0x0c13('0x4d')]({'where':{'id':_0x512aea[_0x0c13('0x46')]['id']}})[_0x0c13('0x27')](handleEntityNotFound(_0x41adc8,null))[_0x0c13('0x27')](saveUpdates(_0x512aea['body'],null))[_0x0c13('0x27')](respondWithResult(_0x41adc8,null))[_0x0c13('0x44')](handleError(_0x41adc8,null));};exports[_0x0c13('0x28')]=function(_0x10b304,_0x3c6388){return db['DeskField'][_0x0c13('0x4d')]({'where':{'id':_0x10b304[_0x0c13('0x46')]['id']}})[_0x0c13('0x27')](handleEntityNotFound(_0x3c6388,null))[_0x0c13('0x27')](removeEntity(_0x3c6388,null))[_0x0c13('0x44')](handleError(_0x3c6388,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 8154822..7966577 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 _0x4395=['DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4395,0x11c));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5439('0x0'));var util=require(_0x5439('0x1'));var logger=require('../../config/logger')(_0x5439('0x2'));var moment=require(_0x5439('0x3'));var BPromise=require('bluebird');var rp=require(_0x5439('0x4'));var fs=require('fs');var path=require(_0x5439('0x5'));var rimraf=require(_0x5439('0x6'));var config=require(_0x5439('0x7'));var attributes=require(_0x5439('0x8'));module[_0x5439('0x9')]=function(_0x341a57,_0x47cb9f){return _0x341a57['define'](_0x5439('0xa'),attributes,{'tableName':_0x5439('0xb'),'paranoid':![],'indexes':[{'name':_0x5439('0xc'),'fields':['idField',_0x5439('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa160=['../../config/environment','exports','define','desk_unique_index','idField','FieldId','lodash','api','bluebird','request-promise','path'];(function(_0xcdc907,_0x3132d3){var _0x14a331=function(_0x316f40){while(--_0x316f40){_0xcdc907['push'](_0xcdc907['shift']());}};_0x14a331(++_0x3132d3);}(_0xa160,0xed));var _0x0a16=function(_0x17b1c0,_0x5f48f5){_0x17b1c0=_0x17b1c0-0x0;var _0x5b0ff5=_0xa160[_0x17b1c0];return _0x5b0ff5;};'use strict';var _=require(_0x0a16('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0a16('0x1'));var moment=require('moment');var BPromise=require(_0x0a16('0x2'));var rp=require(_0x0a16('0x3'));var fs=require('fs');var path=require(_0x0a16('0x4'));var rimraf=require('rimraf');var config=require(_0x0a16('0x5'));var attributes=require('./intDeskField.attributes');module[_0x0a16('0x6')]=function(_0x59f9fe,_0x51e03a){return _0x59f9fe[_0x0a16('0x7')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x0a16('0x8'),'fields':[_0x0a16('0x9'),_0x0a16('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index cbac817..698f3dd 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 _0xba20=['rpc','../../config/environment','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xa5e63b,_0x138878){var _0xa74db0=function(_0x14dfe5){while(--_0x14dfe5){_0xa5e63b['push'](_0xa5e63b['shift']());}};_0xa74db0(++_0x138878);}(_0xba20,0x16e));var _0x0ba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba20[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0ba2('0x0'));var util=require(_0x0ba2('0x1'));var moment=require(_0x0ba2('0x2'));var BPromise=require(_0x0ba2('0x3'));var rs=require(_0x0ba2('0x4'));var fs=require('fs');var Redis=require(_0x0ba2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ba2('0x6'));var logger=require(_0x0ba2('0x7'))(_0x0ba2('0x8'));var config=require(_0x0ba2('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ba2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34926b,_0x4331b4,_0x309df4){return new BPromise(function(_0x164eb1,_0x24d468){return client['request'](_0x34926b,_0x309df4)[_0x0ba2('0xb')](function(_0x4d89e5){logger[_0x0ba2('0xc')](_0x0ba2('0xd'),_0x4331b4,_0x0ba2('0xe'));logger[_0x0ba2('0xf')](_0x0ba2('0x10'),_0x4331b4,_0x0ba2('0xe'),JSON[_0x0ba2('0x11')](_0x4d89e5));if(_0x4d89e5[_0x0ba2('0x12')]){if(_0x4d89e5['error'][_0x0ba2('0x13')]===0x1f4){logger[_0x0ba2('0x12')](_0x0ba2('0xd'),_0x4331b4,_0x4d89e5[_0x0ba2('0x12')][_0x0ba2('0x14')]);return _0x24d468(_0x4d89e5[_0x0ba2('0x12')][_0x0ba2('0x14')]);}logger[_0x0ba2('0x12')](_0x0ba2('0xd'),_0x4331b4,_0x4d89e5[_0x0ba2('0x12')][_0x0ba2('0x14')]);return _0x164eb1(_0x4d89e5[_0x0ba2('0x12')][_0x0ba2('0x14')]);}else{logger['info'](_0x0ba2('0xd'),_0x4331b4,_0x0ba2('0xe'));_0x164eb1(_0x4d89e5[_0x0ba2('0x15')][_0x0ba2('0x14')]);}})['catch'](function(_0xc8bf2){logger['error'](_0x0ba2('0xd'),_0x4331b4,_0xc8bf2);_0x24d468(_0xc8bf2);});});} \ No newline at end of file +var _0xea99=['client','http','request','then','info','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x199e8e,_0xf1472f){var _0x52f3c2=function(_0x52780d){while(--_0x52780d){_0x199e8e['push'](_0x199e8e['shift']());}};_0x52f3c2(++_0xf1472f);}(_0xea99,0x1f1));var _0x9ea9=function(_0x304540,_0x110c59){_0x304540=_0x304540-0x0;var _0x25b2ba=_0xea99[_0x304540];return _0x25b2ba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9ea9('0x0'));var BPromise=require(_0x9ea9('0x1'));var rs=require(_0x9ea9('0x2'));var fs=require('fs');var Redis=require(_0x9ea9('0x3'));var db=require(_0x9ea9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9ea9('0x5'));var jayson=require(_0x9ea9('0x6'));var client=jayson[_0x9ea9('0x7')][_0x9ea9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x398244,_0x93e731,_0x343d28){return new BPromise(function(_0xb4be3f,_0x337b3a){return client[_0x9ea9('0x9')](_0x398244,_0x343d28)[_0x9ea9('0xa')](function(_0x4adc4f){logger[_0x9ea9('0xb')](_0x9ea9('0xc'),_0x93e731,'request\x20sent');logger['debug'](_0x9ea9('0xd'),_0x93e731,_0x9ea9('0xe'),JSON[_0x9ea9('0xf')](_0x4adc4f));if(_0x4adc4f[_0x9ea9('0x10')]){if(_0x4adc4f['error'][_0x9ea9('0x11')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x93e731,_0x4adc4f[_0x9ea9('0x10')][_0x9ea9('0x12')]);return _0x337b3a(_0x4adc4f[_0x9ea9('0x10')][_0x9ea9('0x12')]);}logger['error'](_0x9ea9('0xc'),_0x93e731,_0x4adc4f['error'][_0x9ea9('0x12')]);return _0xb4be3f(_0x4adc4f['error'][_0x9ea9('0x12')]);}else{logger['info'](_0x9ea9('0xc'),_0x93e731,_0x9ea9('0xe'));_0xb4be3f(_0x4adc4f[_0x9ea9('0x13')]['message']);}})[_0x9ea9('0x14')](function(_0x25cd0d){logger['error'](_0x9ea9('0xc'),_0x93e731,_0x25cd0d);_0x337b3a(_0x25cd0d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b4e3420..7b45f60 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 _0xc06e=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0xc06e,0x1bd));var _0xec06=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xc06e[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0xec06('0x0'));var util=require(_0xec06('0x1'));var path=require(_0xec06('0x2'));var timeout=require(_0xec06('0x3'));var express=require(_0xec06('0x4'));var router=express[_0xec06('0x5')]();var fs_extra=require(_0xec06('0x6'));var auth=require(_0xec06('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xec06('0x8'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0xec06('0x9')](),controller['index']);router[_0xec06('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xec06('0xa')](_0xec06('0xb'),auth['isAuthenticated'](),controller[_0xec06('0xc')]);router[_0xec06('0xa')](_0xec06('0xd'),auth[_0xec06('0x9')](),controller['getFields']);router['post']('/',auth[_0xec06('0x9')](),controller[_0xec06('0xe')]);router['post'](_0xec06('0xb'),auth[_0xec06('0x9')](),controller[_0xec06('0xf')]);router[_0xec06('0x10')](_0xec06('0x11'),auth[_0xec06('0x9')](),controller[_0xec06('0x12')]);router[_0xec06('0x13')](_0xec06('0x11'),auth[_0xec06('0x9')](),controller[_0xec06('0x14')]);module[_0xec06('0x15')]=router; \ No newline at end of file +var _0xb2cd=['create','addConfiguration','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post'];(function(_0x3ce926,_0x503fe2){var _0x3c0608=function(_0x397ade){while(--_0x397ade){_0x3ce926['push'](_0x3ce926['shift']());}};_0x3c0608(++_0x503fe2);}(_0xb2cd,0xa6));var _0xdb2c=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xb2cd[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0xdb2c('0x0'));var util=require(_0xdb2c('0x1'));var path=require(_0xdb2c('0x2'));var timeout=require(_0xdb2c('0x3'));var express=require('express');var router=express[_0xdb2c('0x4')]();var fs_extra=require(_0xdb2c('0x5'));var auth=require(_0xdb2c('0x6'));var interaction=require(_0xdb2c('0x7'));var config=require(_0xdb2c('0x8'));var controller=require(_0xdb2c('0x9'));router[_0xdb2c('0xa')]('/',auth[_0xdb2c('0xb')](),controller[_0xdb2c('0xc')]);router['get'](_0xdb2c('0xd'),auth[_0xdb2c('0xb')](),controller['show']);router[_0xdb2c('0xa')](_0xdb2c('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xdb2c('0xa')](_0xdb2c('0xf'),auth[_0xdb2c('0xb')](),controller[_0xdb2c('0x10')]);router[_0xdb2c('0x11')]('/',auth[_0xdb2c('0xb')](),controller[_0xdb2c('0x12')]);router[_0xdb2c('0x11')](_0xdb2c('0xe'),auth[_0xdb2c('0xb')](),controller[_0xdb2c('0x13')]);router[_0xdb2c('0x14')]('/:id',auth[_0xdb2c('0xb')](),controller[_0xdb2c('0x15')]);router[_0xdb2c('0x16')](_0xdb2c('0xd'),auth[_0xdb2c('0xb')](),controller['destroy']);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 02d9af5..f123042 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 _0x5df4=['sequelize','exports','STRING'];(function(_0x37cde1,_0x3f4cb2){var _0x7b4ee0=function(_0x4567ce){while(--_0x4567ce){_0x37cde1['push'](_0x37cde1['shift']());}};_0x7b4ee0(++_0x3f4cb2);}(_0x5df4,0x144));var _0x45df=function(_0x2fb214,_0x568201){_0x2fb214=_0x2fb214-0x0;var _0xabc9cf=_0x5df4[_0x2fb214];return _0xabc9cf;};'use strict';var Sequelize=require(_0x45df('0x0'));module[_0x45df('0x1')]={'name':{'type':Sequelize[_0x45df('0x2')]},'username':{'type':Sequelize[_0x45df('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x45df('0x2')]},'tenantId':{'type':Sequelize[_0x45df('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x45df('0x2')]},'serverUrl':{'type':Sequelize[_0x45df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x45df('0x2')]}}; \ No newline at end of file +var _0x0df0=['exports','STRING'];(function(_0xf363f0,_0x3b5eeb){var _0x55a386=function(_0x548349){while(--_0x548349){_0xf363f0['push'](_0xf363f0['shift']());}};_0x55a386(++_0x3b5eeb);}(_0x0df0,0x18c));var _0x00df=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0x0df0[_0x1b4002];return _0x1716f3;};'use strict';var Sequelize=require('sequelize');module[_0x00df('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x00df('0x1')]},'remoteUri':{'type':Sequelize[_0x00df('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x00df('0x1')]},'clientSecret':{'type':Sequelize[_0x00df('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f5612ac..d8e11c9 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 _0xad53=['modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','clientSecret','slice','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','MetadataId','forEach','isNil','substring','lastIndexOf','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','error','stack','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','name','index','map','Dynamics365Account','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','create','Subjects','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','influencescore','modifiedbyexternalpartyyominame','modifiedbyname'];(function(_0x2313c9,_0x48f0ca){var _0x290567=function(_0x1d45e0){while(--_0x1d45e0){_0x2313c9['push'](_0x2313c9['shift']());}};_0x290567(++_0x48f0ca);}(_0xad53,0x1ea));var _0x3ad5=function(_0x756c40,_0x1072b9){_0x756c40=_0x756c40-0x0;var _0x2f66a7=_0xad53[_0x756c40];return _0x2f66a7;};'use strict';var emlformat=require(_0x3ad5('0x0'));var rimraf=require(_0x3ad5('0x1'));var zipdir=require(_0x3ad5('0x2'));var jsonpatch=require(_0x3ad5('0x3'));var rp=require(_0x3ad5('0x4'));var moment=require(_0x3ad5('0x5'));var BPromise=require(_0x3ad5('0x6'));var Mustache=require(_0x3ad5('0x7'));var util=require('util');var path=require(_0x3ad5('0x8'));var sox=require(_0x3ad5('0x9'));var csv=require(_0x3ad5('0xa'));var ejs=require(_0x3ad5('0xb'));var fs=require('fs');var fs_extra=require(_0x3ad5('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ad5('0xd'));var deskjs=require(_0x3ad5('0xe'));var toCsv=require(_0x3ad5('0xa'));var querystring=require(_0x3ad5('0xf'));var Papa=require(_0x3ad5('0x10'));var Redis=require(_0x3ad5('0x11'));var authService=require(_0x3ad5('0x12'));var qs=require(_0x3ad5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ad5('0x14'));var logger=require(_0x3ad5('0x15'))(_0x3ad5('0x16'));var utils=require(_0x3ad5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3ad5('0x18'));var db=require(_0x3ad5('0x19'))['db'];var integrations=require(_0x3ad5('0x1a'));function respondWithStatusCode(_0x542e82,_0x1bd82f){_0x1bd82f=_0x1bd82f||0xcc;return function(_0xfbc961){if(_0xfbc961){return _0x542e82[_0x3ad5('0x1b')](_0x1bd82f);}return _0x542e82[_0x3ad5('0x1c')](_0x1bd82f)[_0x3ad5('0x1d')]();};}function respondWithResult(_0x28d6ad,_0x50758e){_0x50758e=_0x50758e||0xc8;return function(_0x5bdecb){if(_0x5bdecb){return _0x28d6ad[_0x3ad5('0x1c')](_0x50758e)[_0x3ad5('0x1e')](_0x5bdecb);}};}function respondWithFilteredResult(_0xabcbc0,_0x70aec9){return function(_0x1d5868){if(_0x1d5868){var _0x365f38=typeof _0x70aec9['offset']==='undefined'&&typeof _0x70aec9[_0x3ad5('0x1f')]===_0x3ad5('0x20');var _0x5df744=_0x1d5868['count'];var _0x445741=_0x365f38?0x0:_0x70aec9[_0x3ad5('0x21')];var _0x179cda=_0x365f38?_0x1d5868[_0x3ad5('0x22')]:_0x70aec9['offset']+_0x70aec9[_0x3ad5('0x1f')];var _0x36780a;if(_0x179cda>=_0x5df744){_0x179cda=_0x5df744;_0x36780a=0xc8;}else{_0x36780a=0xce;}_0xabcbc0[_0x3ad5('0x1c')](_0x36780a);return _0xabcbc0[_0x3ad5('0x23')](_0x3ad5('0x24'),_0x445741+'-'+_0x179cda+'/'+_0x5df744)[_0x3ad5('0x1e')](_0x1d5868);}return null;};}function patchUpdates(_0x3aaef8){return function(_0x3a8960){try{jsonpatch[_0x3ad5('0x25')](_0x3a8960,_0x3aaef8,!![]);}catch(_0x5721e8){return BPromise[_0x3ad5('0x26')](_0x5721e8);}return _0x3a8960['save']();};}function saveUpdates(_0x936a29,_0x58a06f){return function(_0x88a840){if(_0x88a840){return _0x88a840[_0x3ad5('0x27')](_0x936a29)[_0x3ad5('0x28')](function(_0xeaf8f7){return _0xeaf8f7;});}return null;};}function removeEntity(_0x24d2ee,_0x26b402){return function(_0x4c59dc){if(_0x4c59dc){return _0x4c59dc[_0x3ad5('0x29')]()[_0x3ad5('0x28')](function(){_0x24d2ee['status'](0xcc)[_0x3ad5('0x1d')]();});}};}function handleEntityNotFound(_0x24f7e1,_0x42c242){return function(_0x494adf){if(!_0x494adf){_0x24f7e1[_0x3ad5('0x1b')](0x194);}return _0x494adf;};}function handleError(_0x429ea6,_0x40da5d){_0x40da5d=_0x40da5d||0x1f4;return function(_0x4d73b1){logger['error'](_0x4d73b1['stack']);if(_0x4d73b1[_0x3ad5('0x2a')]){delete _0x4d73b1[_0x3ad5('0x2a')];}_0x429ea6[_0x3ad5('0x1c')](_0x40da5d)['send'](_0x4d73b1);};}exports[_0x3ad5('0x2b')]=function(_0x1724fc,_0x489de6){var _0x4c66f7={},_0x2a402c={},_0x5c2d1e={'count':0x0,'rows':[]};var _0x180729=_[_0x3ad5('0x2c')](db[_0x3ad5('0x2d')][_0x3ad5('0x2e')],function(_0x1fb6f3){return{'name':_0x1fb6f3['fieldName'],'type':_0x1fb6f3['type'][_0x3ad5('0x2f')]};});_0x2a402c[_0x3ad5('0x30')]=_[_0x3ad5('0x2c')](_0x180729,_0x3ad5('0x2a'));_0x2a402c['query']=_[_0x3ad5('0x31')](_0x1724fc[_0x3ad5('0x32')]);_0x2a402c[_0x3ad5('0x33')]=_[_0x3ad5('0x34')](_0x2a402c[_0x3ad5('0x30')],_0x2a402c[_0x3ad5('0x32')]);_0x4c66f7[_0x3ad5('0x35')]=_[_0x3ad5('0x34')](_0x2a402c[_0x3ad5('0x30')],qs[_0x3ad5('0x36')](_0x1724fc['query'][_0x3ad5('0x36')]));_0x4c66f7[_0x3ad5('0x35')]=_0x4c66f7[_0x3ad5('0x35')][_0x3ad5('0x37')]?_0x4c66f7[_0x3ad5('0x35')]:_0x2a402c[_0x3ad5('0x30')];if(!_0x1724fc[_0x3ad5('0x32')]['hasOwnProperty']('nolimit')){_0x4c66f7[_0x3ad5('0x1f')]=qs[_0x3ad5('0x1f')](_0x1724fc['query'][_0x3ad5('0x1f')]);_0x4c66f7[_0x3ad5('0x21')]=qs[_0x3ad5('0x21')](_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x21')]);}_0x4c66f7[_0x3ad5('0x38')]=qs[_0x3ad5('0x39')](_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x39')]);_0x4c66f7[_0x3ad5('0x3a')]=qs[_0x3ad5('0x33')](_[_0x3ad5('0x3b')](_0x1724fc[_0x3ad5('0x32')],_0x2a402c['filters']),_0x180729);if(_0x1724fc[_0x3ad5('0x32')]['filter']){_0x4c66f7[_0x3ad5('0x3a')]=_[_0x3ad5('0x3c')](_0x4c66f7[_0x3ad5('0x3a')],{'$or':_[_0x3ad5('0x2c')](_0x180729,function(_0x1d9393){if(_0x1d9393[_0x3ad5('0x3d')]!==_0x3ad5('0x3e')){var _0x4a462f={};_0x4a462f[_0x1d9393['name']]={'$like':'%'+_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x3f')]+'%'};return _0x4a462f;}})});}_0x4c66f7=_[_0x3ad5('0x3c')]({},_0x4c66f7,_0x1724fc[_0x3ad5('0x40')]);var _0x35e090={'where':_0x4c66f7[_0x3ad5('0x3a')]};return db[_0x3ad5('0x2d')][_0x3ad5('0x22')](_0x35e090)[_0x3ad5('0x28')](function(_0x135fa0){_0x5c2d1e[_0x3ad5('0x22')]=_0x135fa0;if(_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x41')]){_0x4c66f7[_0x3ad5('0x42')]=[{'all':!![]}];}return db[_0x3ad5('0x2d')][_0x3ad5('0x43')](_0x4c66f7);})[_0x3ad5('0x28')](function(_0x29726b){_0x5c2d1e['rows']=_0x29726b;return _0x5c2d1e;})['then'](respondWithFilteredResult(_0x489de6,_0x4c66f7))[_0x3ad5('0x44')](handleError(_0x489de6,null));};exports[_0x3ad5('0x45')]=function(_0x550c1c,_0x6a73f3){var _0x47f797={'raw':![],'where':{'id':_0x550c1c[_0x3ad5('0x46')]['id']}},_0x543529={};_0x543529[_0x3ad5('0x30')]=_[_0x3ad5('0x31')](db[_0x3ad5('0x2d')][_0x3ad5('0x2e')]);_0x543529[_0x3ad5('0x32')]=_[_0x3ad5('0x31')](_0x550c1c['query']);_0x543529[_0x3ad5('0x33')]=_[_0x3ad5('0x34')](_0x543529[_0x3ad5('0x30')],_0x543529[_0x3ad5('0x32')]);_0x47f797[_0x3ad5('0x35')]=_['intersection'](_0x543529[_0x3ad5('0x30')],qs[_0x3ad5('0x36')](_0x550c1c[_0x3ad5('0x32')][_0x3ad5('0x36')]));_0x47f797['attributes']=_0x47f797['attributes']['length']?_0x47f797[_0x3ad5('0x35')]:_0x543529[_0x3ad5('0x30')];if(_0x550c1c[_0x3ad5('0x32')][_0x3ad5('0x41')]){_0x47f797['include']=[{'all':!![]}];}_0x47f797=_['merge']({},_0x47f797,_0x550c1c[_0x3ad5('0x40')]);return db[_0x3ad5('0x2d')][_0x3ad5('0x47')](_0x47f797)['then'](handleEntityNotFound(_0x6a73f3,null))[_0x3ad5('0x28')](respondWithResult(_0x6a73f3,null))[_0x3ad5('0x44')](handleError(_0x6a73f3,null));};exports['create']=function(_0x26acf4,_0x31f25c){return db[_0x3ad5('0x2d')]['create'](_0x26acf4['body'],{})[_0x3ad5('0x28')](respondWithResult(_0x31f25c,0xc9))['catch'](handleError(_0x31f25c,null));};exports[_0x3ad5('0x27')]=function(_0x5351d9,_0x2efc15){if(_0x5351d9[_0x3ad5('0x48')]['id']){delete _0x5351d9['body']['id'];}return db[_0x3ad5('0x2d')][_0x3ad5('0x47')]({'where':{'id':_0x5351d9[_0x3ad5('0x46')]['id']}})['then'](handleEntityNotFound(_0x2efc15,null))['then'](saveUpdates(_0x5351d9[_0x3ad5('0x48')],null))[_0x3ad5('0x28')](respondWithResult(_0x2efc15,null))[_0x3ad5('0x44')](handleError(_0x2efc15,null));};exports[_0x3ad5('0x29')]=function(_0x1b423c,_0x4e82c0){return db[_0x3ad5('0x2d')][_0x3ad5('0x47')]({'where':{'id':_0x1b423c['params']['id']}})[_0x3ad5('0x28')](handleEntityNotFound(_0x4e82c0,null))['then'](removeEntity(_0x4e82c0,null))[_0x3ad5('0x44')](handleError(_0x4e82c0,null));};exports[_0x3ad5('0x49')]=function(_0x28ca27,_0x13f65b,_0x38634a){var _0x204bae={};var _0x386f76={};var _0x3b4609;var _0x4506f6;return db[_0x3ad5('0x2d')]['findOne']({'where':{'id':_0x28ca27[_0x3ad5('0x46')]['id']}})[_0x3ad5('0x28')](handleEntityNotFound(_0x13f65b,null))['then'](function(_0x137b1d){if(_0x137b1d){_0x3b4609=_0x137b1d;_0x386f76['model']=_[_0x3ad5('0x31')](db['Dynamics365Configuration'][_0x3ad5('0x2e')]);_0x386f76[_0x3ad5('0x32')]=_['keys'](_0x28ca27[_0x3ad5('0x32')]);_0x386f76['filters']=_[_0x3ad5('0x34')](_0x386f76[_0x3ad5('0x30')],_0x386f76[_0x3ad5('0x32')]);_0x204bae['attributes']=_[_0x3ad5('0x34')](_0x386f76['model'],qs[_0x3ad5('0x36')](_0x28ca27['query'][_0x3ad5('0x36')]));_0x204bae[_0x3ad5('0x35')]=_0x204bae[_0x3ad5('0x35')][_0x3ad5('0x37')]?_0x204bae['attributes']:_0x386f76['model'];_0x204bae[_0x3ad5('0x38')]=qs[_0x3ad5('0x39')](_0x28ca27[_0x3ad5('0x32')]['sort']);_0x204bae['where']=qs[_0x3ad5('0x33')](_[_0x3ad5('0x3b')](_0x28ca27[_0x3ad5('0x32')],_0x386f76[_0x3ad5('0x33')]));if(_0x28ca27['query'][_0x3ad5('0x3f')]){_0x204bae[_0x3ad5('0x3a')]=_[_0x3ad5('0x3c')](_0x204bae[_0x3ad5('0x3a')],{'$or':_[_0x3ad5('0x2c')](_0x204bae[_0x3ad5('0x35')],function(_0x5b5845){var _0x49bb31={};_0x49bb31[_0x5b5845]={'$like':'%'+_0x28ca27[_0x3ad5('0x32')][_0x3ad5('0x3f')]+'%'};return _0x49bb31;})});}_0x204bae=_[_0x3ad5('0x3c')]({},_0x204bae,_0x28ca27['options']);return _0x3b4609['getConfigurations'](_0x204bae);}})['then'](function(_0x4b321e){if(_0x4b321e){_0x4506f6=_0x4b321e['length'];if(!_0x28ca27['query'][_0x3ad5('0x4a')]('nolimit')){_0x204bae[_0x3ad5('0x1f')]=qs['limit'](_0x28ca27[_0x3ad5('0x32')][_0x3ad5('0x1f')]);_0x204bae[_0x3ad5('0x21')]=qs[_0x3ad5('0x21')](_0x28ca27[_0x3ad5('0x32')][_0x3ad5('0x21')]);}return _0x3b4609['getConfigurations'](_0x204bae);}})[_0x3ad5('0x28')](function(_0x4801cd){if(_0x4801cd){return _0x4801cd?{'count':_0x4506f6,'rows':_0x4801cd}:null;}})['then'](respondWithResult(_0x13f65b,null))['catch'](handleError(_0x13f65b,null));};exports[_0x3ad5('0x4b')]=function(_0x3121d1,_0x24f4fa,_0x15bf13){if(_0x3121d1[_0x3ad5('0x48')]['id']){delete _0x3121d1[_0x3ad5('0x48')]['id'];}return db['Dynamics365Account'][_0x3ad5('0x4c')]({'where':{'id':_0x3121d1[_0x3ad5('0x46')]['id']}})[_0x3ad5('0x28')](handleEntityNotFound(_0x24f4fa,null))[_0x3ad5('0x28')](function(_0x395f10){if(_0x395f10){_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x4d')]=_0x395f10['id'];_0x3121d1[_0x3ad5('0x48')]['Subjects']=integrations[_0x3ad5('0x4e')](_0x3121d1['body'][_0x3ad5('0x4f')],_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x3d')]);_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x50')]=integrations[_0x3ad5('0x51')](_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x4f')],_0x3121d1['body']['type']);return db[_0x3ad5('0x52')][_0x3ad5('0x53')](_0x3121d1['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x3ad5('0x54')},{'model':db[_0x3ad5('0x55')],'as':_0x3ad5('0x50')}]});}return null;})['then'](respondWithResult(_0x24f4fa,null))[_0x3ad5('0x44')](handleError(_0x24f4fa,null));};exports[_0x3ad5('0x56')]=function(_0x45ace8,_0x50f562,_0x5777df){var _0x41ed33=_0x45ace8[_0x3ad5('0x32')][_0x3ad5('0x57')];var _0x45de70=_0x41ed33===_0x3ad5('0x58')?_0x3ad5('0x59'):_0x3ad5('0x5a');var _0x2d0670='';var _0x269ee1='';var _0x41e409='';var _0x220335='';var _0x6dd459='';var _0x7a08dd='';var _0x473e66='';var _0x35619b='';var _0x2d483b=['title',_0x3ad5('0x5b'),_0x3ad5('0x5c'),'ownerid',_0x3ad5('0x5d'),_0x3ad5('0x5e'),_0x3ad5('0x5f'),_0x3ad5('0x60'),_0x3ad5('0x61'),'phonecall_activity_parties'];var _0x120a09=['accountidname','accountidyominame',_0x3ad5('0x62'),'billedserviceunits',_0x3ad5('0x63'),'contactidyominame',_0x3ad5('0x64'),_0x3ad5('0x65'),_0x3ad5('0x66'),_0x3ad5('0x67'),_0x3ad5('0x68'),'createdbyyominame','createdon',_0x3ad5('0x69'),_0x3ad5('0x6a'),_0x3ad5('0x6b'),_0x3ad5('0x6c'),'customeridyominame',_0x3ad5('0x6d'),_0x3ad5('0x6e'),_0x3ad5('0x6f'),_0x3ad5('0x70'),_0x3ad5('0x71'),_0x3ad5('0x72'),_0x3ad5('0x73'),'followupby','importsequencenumber',_0x3ad5('0x74'),'kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname',_0x3ad5('0x75'),_0x3ad5('0x76'),_0x3ad5('0x77'),_0x3ad5('0x78'),_0x3ad5('0x79'),_0x3ad5('0x7a'),_0x3ad5('0x7b'),_0x3ad5('0x7c'),_0x3ad5('0x7d'),'onholdtime',_0x3ad5('0x7e'),_0x3ad5('0x7f'),_0x3ad5('0x80'),_0x3ad5('0x81'),_0x3ad5('0x82'),_0x3ad5('0x83'),_0x3ad5('0x84'),_0x3ad5('0x85'),_0x3ad5('0x86'),'productserialnumber',_0x3ad5('0x87'),'resolvebykpiidname',_0x3ad5('0x88'),_0x3ad5('0x89'),_0x3ad5('0x8a'),_0x3ad5('0x8b'),_0x3ad5('0x8c'),'slaname','socialprofileidname',_0x3ad5('0x8d'),_0x3ad5('0x8e'),_0x3ad5('0x8f'),_0x3ad5('0x90'),'timezoneruleversionnumber',_0x3ad5('0x91'),_0x3ad5('0x92'),'utcconversiontimezonecode',_0x3ad5('0x93')];var _0xcff7d3=_0x2d483b[_0x3ad5('0x94')](_0x120a09);return db['Dynamics365Account'][_0x3ad5('0x4c')]({'where':{'id':_0x45ace8['params']['id']},'attributes':['id',_0x3ad5('0x95'),_0x3ad5('0x96'),_0x3ad5('0x97'),'tenantId','clientId',_0x3ad5('0x98')]})[_0x3ad5('0x28')](handleEntityNotFound(_0x50f562,null))['then'](function(_0x594b92){if(_0x594b92){_0x35619b=_0x594b92[_0x3ad5('0x97')];var _0x3c007c=_0x35619b[_0x3ad5('0x99')](-0x1);if(_0x3c007c==='/'){_0x35619b=_0x35619b['substring'](0x0,_0x35619b['lastIndexOf'](_0x3c007c));}_0x473e66=util['format'](_0x3ad5('0x9a'),_0x35619b);var _0x1954d4={'method':_0x3ad5('0x9b'),'uri':_0x3ad5('0x9c')+_0x594b92[_0x3ad5('0x9d')]+_0x3ad5('0x9e'),'form':{'client_id':_0x594b92[_0x3ad5('0x9f')],'resource':_0x35619b,'username':_0x594b92[_0x3ad5('0x95')],'password':_0x594b92[_0x3ad5('0x96')],'grant_type':'password','client_secret':_0x594b92[_0x3ad5('0x98')]},'json':!![]};return rp(_0x1954d4);}})[_0x3ad5('0x28')](function(_0x28e800){_0x7a08dd=_0x28e800['access_token'];var _0x595879={'method':_0x3ad5('0xa0'),'uri':encodeURI(_0x473e66+_0x3ad5('0xa1')+_0x45de70+'\x27'),'headers':{'Authorization':_0x3ad5('0xa2')+_0x7a08dd,'If-None-Match':null,'OData-Version':_0x3ad5('0xa3')},'json':!![]};return rp(_0x595879);})[_0x3ad5('0x28')](function(_0x32e899){var _0x372afb=_0x32e899[_0x3ad5('0xa4')][0x0];var _0xa3fe7c=_0x372afb['MetadataId'];var _0x16947f={'method':_0x3ad5('0xa0'),'uri':_0x473e66+_0x3ad5('0xa5')+_0xa3fe7c+_0x3ad5('0xa6'),'headers':{'Authorization':'Bearer\x20'+_0x7a08dd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x16947f);})[_0x3ad5('0x28')](function(_0x114b4d){_0x2d0670=_0x114b4d;_0x269ee1=_0x2d0670['Attributes'];_0x269ee1=_[_0x3ad5('0xa7')](_0x269ee1,function(_0x56709e){return!_0xcff7d3[_0x3ad5('0xa8')](_0x56709e[_0x3ad5('0xa9')]);});var _0x1a3f57=[];var _0x16f6e4=[];_0x269ee1['forEach'](function(_0x37c35c){if(_0x37c35c[_0x3ad5('0xaa')]){var _0x52eebb=_0x37c35c['@odata.type']['substring'](_0x37c35c[_0x3ad5('0xaa')]['lastIndexOf']('.')+0x1);if(_0x52eebb===_0x3ad5('0xab')){_0x1a3f57['push'](getSelectList(_0x473e66,_0x41ed33,_0x16f6e4,_0x2d0670['MetadataId'],_0x37c35c[_0x3ad5('0xac')],_0x7a08dd));}}});return Promise['all'](_0x1a3f57);})[_0x3ad5('0x28')](function(_0x2a8f1){_0x41e409=_0x2a8f1[0x0];var _0x375747=[];var _0x39b461=[];_0x269ee1[_0x3ad5('0xad')](function(_0x34f6d2){if(!_[_0x3ad5('0xae')](_0x34f6d2[_0x3ad5('0xaa')])){var _0x4c9994=_0x34f6d2[_0x3ad5('0xaa')][_0x3ad5('0xaf')](_0x34f6d2[_0x3ad5('0xaa')][_0x3ad5('0xb0')]('.')+0x1);if(_0x4c9994===_0x3ad5('0xb1')){_0x375747[_0x3ad5('0xb2')](getBooleanList(_0x473e66,_0x41ed33,_0x39b461,_0x2d0670[_0x3ad5('0xac')],_0x34f6d2[_0x3ad5('0xac')],_0x7a08dd));}}});return Promise['all'](_0x375747);})[_0x3ad5('0x28')](function(_0x196d83){_0x220335=_0x196d83[0x0];var _0x5c9049=[];var _0x58b706=[];_0x269ee1[_0x3ad5('0xad')](function(_0x55abe3){if(_0x55abe3[_0x3ad5('0xaa')]){var _0x500ace=_0x55abe3[_0x3ad5('0xaa')][_0x3ad5('0xaf')](_0x55abe3['@odata.type'][_0x3ad5('0xb0')]('.')+0x1);if(_0x500ace==='StringAttributeMetadata'||_0x500ace===_0x3ad5('0xb3')||_0x500ace===_0x3ad5('0xb4')||_0x500ace===_0x3ad5('0xb5')||_0x500ace===_0x3ad5('0xb6')||_0x500ace==='DateTimeAttributeMetadata'||_0x500ace===_0x3ad5('0xb7')||_0x500ace===_0x3ad5('0xb8')||_0x500ace===_0x3ad5('0xb9')||_0x500ace==='DecimalAttributeMetadata'){_0x5c9049[_0x3ad5('0xb2')](getInputList(_0x473e66,_0x41ed33,_0x500ace,_0x58b706,_0x2d0670['MetadataId'],_0x55abe3[_0x3ad5('0xac')],_0x7a08dd));}}});return Promise['all'](_0x5c9049);})[_0x3ad5('0x28')](function(_0x373818){_0x6dd459=_0x373818[0x0];var _0x2c06ac=_0x41e409[_0x3ad5('0x94')](_0x220335)['concat'](_0x6dd459);var _0x20f75a={'count':_0x2c06ac[_0x3ad5('0x37')],'rows':_0x2c06ac};return _0x20f75a;})[_0x3ad5('0x28')](respondWithResult(_0x50f562,null))[_0x3ad5('0x44')](function(_0x4009e7){var _0x38fc64=_0x45ace8[_0x3ad5('0x32')][_0x3ad5('0xba')]?0x1f4:_0x4009e7['statusCode']||0x1f4;logger[_0x3ad5('0xbb')](_0x4009e7[_0x3ad5('0xbc')]);delete _0x4009e7['name'];if(_0x38fc64===0x191){_0x38fc64=0x190;}_0x50f562[_0x3ad5('0x1c')](_0x38fc64)[_0x3ad5('0xbd')](_0x45ace8[_0x3ad5('0x32')][_0x3ad5('0xba')]?{'message':_0x3ad5('0xbe'),'statusCode':_0x4009e7[_0x3ad5('0xbf')]}:_0x4009e7);});};function getSelectList(_0x509f71,_0x194030,_0x42e3f8,_0x4970d6,_0xb7b958,_0x227dcb){var _0x43de5b={'method':_0x3ad5('0xa0'),'uri':_0x509f71+_0x3ad5('0xa5')+_0x4970d6+_0x3ad5('0xc0')+_0xb7b958+_0x3ad5('0xc1')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x227dcb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x43de5b)[_0x3ad5('0x28')](function(_0x57f1ae){var _0x20b6af=[];var _0x58fb0c=_0x57f1ae[_0x3ad5('0xc2')]['Options'];_0x58fb0c[_0x3ad5('0xad')](function(_0x3c3d6c){_0x20b6af['push']({'name':_0x3c3d6c[_0x3ad5('0xc3')][_0x3ad5('0xc4')][_0x3ad5('0xc3')],'value':String(_0x3c3d6c['Value'])});});var _0x253b7d={'id':_0x194030+'_'+_0x57f1ae[_0x3ad5('0xa9')],'name':_0x57f1ae[_0x3ad5('0xc5')]['UserLocalizedLabel'][_0x3ad5('0xc3')],'custom':![],'options':_0x20b6af};_0x42e3f8['push'](_0x253b7d);return _0x42e3f8;});}function getBooleanList(_0x5ab6d3,_0x26e149,_0x320b88,_0x22b548,_0x5dee23,_0xe66d9a){var _0x3dad={'method':_0x3ad5('0xa0'),'uri':_0x5ab6d3+_0x3ad5('0xa5')+_0x22b548+')/Attributes('+_0x5dee23+_0x3ad5('0xc6'),'headers':{'Authorization':_0x3ad5('0xa2')+_0xe66d9a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3dad)[_0x3ad5('0x28')](function(_0xf362c2){var _0x387fc2=[];_0x387fc2[_0x3ad5('0xb2')]({'name':_0xf362c2[_0x3ad5('0xc2')][_0x3ad5('0xc7')]['Label'][_0x3ad5('0xc4')][_0x3ad5('0xc3')],'value':_0x3ad5('0xc8')},{'name':_0xf362c2['OptionSet'][_0x3ad5('0xc9')][_0x3ad5('0xc3')][_0x3ad5('0xc4')][_0x3ad5('0xc3')],'value':'false'});var _0x53829d={'id':_0x26e149+'_'+_0xf362c2[_0x3ad5('0xa9')],'name':_0xf362c2[_0x3ad5('0xc5')][_0x3ad5('0xc4')]['Label'],'custom':![],'options':_0x387fc2};_0x320b88[_0x3ad5('0xb2')](_0x53829d);return _0x320b88;});}function getInputList(_0x55db44,_0x1048a4,_0x11a02a,_0x411225,_0x4bb705,_0x23e856,_0x112841){var _0x59c4ce={'method':'GET','uri':_0x55db44+_0x3ad5('0xa5')+_0x4bb705+_0x3ad5('0xc0')+_0x23e856+')/Microsoft.Dynamics.CRM.'+_0x11a02a+_0x3ad5('0xca'),'headers':{'Authorization':'Bearer\x20'+_0x112841,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x59c4ce)[_0x3ad5('0x28')](function(_0xa0f010){var _0x1ec706={'id':_0x1048a4+'_'+_0xa0f010[_0x3ad5('0xa9')],'name':_0xa0f010[_0x3ad5('0xc5')][_0x3ad5('0xc4')]?_0xa0f010[_0x3ad5('0xc5')][_0x3ad5('0xc4')]['Label']:_0xa0f010[_0x3ad5('0xa9')],'custom':![],'options':[]};_0x411225[_0x3ad5('0xb2')](_0x1ec706);return _0x411225;});} \ No newline at end of file +var _0xbed7=['keys','length','create','body','find','destroy','findOne','Dynamics365Configuration','rawAttributes','getConfigurations','addConfiguration','Subjects','getSubjects','getDescriptions','channel','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statecode','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','slice','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','substring','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','LogicalName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','DisplayName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','Dynamics365Account'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xbed7,0x14b));var _0x7bed=function(_0xe60218,_0x518c92){_0xe60218=_0xe60218-0x0;var _0x466367=_0xbed7[_0xe60218];return _0x466367;};'use strict';var emlformat=require(_0x7bed('0x0'));var rimraf=require(_0x7bed('0x1'));var zipdir=require(_0x7bed('0x2'));var jsonpatch=require(_0x7bed('0x3'));var rp=require(_0x7bed('0x4'));var moment=require('moment');var BPromise=require(_0x7bed('0x5'));var Mustache=require(_0x7bed('0x6'));var util=require(_0x7bed('0x7'));var path=require(_0x7bed('0x8'));var sox=require(_0x7bed('0x9'));var csv=require(_0x7bed('0xa'));var ejs=require(_0x7bed('0xb'));var fs=require('fs');var fs_extra=require(_0x7bed('0xc'));var _=require(_0x7bed('0xd'));var squel=require('squel');var crypto=require(_0x7bed('0xe'));var jsforce=require(_0x7bed('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7bed('0xa'));var querystring=require(_0x7bed('0x10'));var Papa=require('papaparse');var Redis=require(_0x7bed('0x11'));var authService=require(_0x7bed('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7bed('0x13'));var hardwareService=require(_0x7bed('0x14'));var logger=require(_0x7bed('0x15'))(_0x7bed('0x16'));var utils=require('../../config/utils');var config=require(_0x7bed('0x17'));var licenseUtil=require(_0x7bed('0x18'));var db=require(_0x7bed('0x19'))['db'];var integrations=require(_0x7bed('0x1a'));function respondWithStatusCode(_0x3ded9d,_0x1b9809){_0x1b9809=_0x1b9809||0xcc;return function(_0x58e75b){if(_0x58e75b){return _0x3ded9d[_0x7bed('0x1b')](_0x1b9809);}return _0x3ded9d[_0x7bed('0x1c')](_0x1b9809)[_0x7bed('0x1d')]();};}function respondWithResult(_0x3befe2,_0x4aa30e){_0x4aa30e=_0x4aa30e||0xc8;return function(_0x212864){if(_0x212864){return _0x3befe2[_0x7bed('0x1c')](_0x4aa30e)[_0x7bed('0x1e')](_0x212864);}};}function respondWithFilteredResult(_0x274ea8,_0xbd9739){return function(_0x42c965){if(_0x42c965){var _0xf62393=typeof _0xbd9739['offset']==='undefined'&&typeof _0xbd9739[_0x7bed('0x1f')]===_0x7bed('0x20');var _0x278019=_0x42c965[_0x7bed('0x21')];var _0x202d48=_0xf62393?0x0:_0xbd9739[_0x7bed('0x22')];var _0x210e7a=_0xf62393?_0x42c965[_0x7bed('0x21')]:_0xbd9739[_0x7bed('0x22')]+_0xbd9739[_0x7bed('0x1f')];var _0x3c4ea0;if(_0x210e7a>=_0x278019){_0x210e7a=_0x278019;_0x3c4ea0=0xc8;}else{_0x3c4ea0=0xce;}_0x274ea8[_0x7bed('0x1c')](_0x3c4ea0);return _0x274ea8['set'](_0x7bed('0x23'),_0x202d48+'-'+_0x210e7a+'/'+_0x278019)[_0x7bed('0x1e')](_0x42c965);}return null;};}function patchUpdates(_0x916fbe){return function(_0x2ffbb9){try{jsonpatch[_0x7bed('0x24')](_0x2ffbb9,_0x916fbe,!![]);}catch(_0x25219a){return BPromise[_0x7bed('0x25')](_0x25219a);}return _0x2ffbb9[_0x7bed('0x26')]();};}function saveUpdates(_0x3080d6,_0x3a9725){return function(_0xe8d590){if(_0xe8d590){return _0xe8d590[_0x7bed('0x27')](_0x3080d6)[_0x7bed('0x28')](function(_0x42c63f){return _0x42c63f;});}return null;};}function removeEntity(_0x31d6cc,_0x5941b5){return function(_0x52c2be){if(_0x52c2be){return _0x52c2be['destroy']()['then'](function(){_0x31d6cc[_0x7bed('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9f5c,_0x167e0c){return function(_0x221fd3){if(!_0x221fd3){_0x2e9f5c[_0x7bed('0x1b')](0x194);}return _0x221fd3;};}function handleError(_0x53e281,_0xb1b1a7){_0xb1b1a7=_0xb1b1a7||0x1f4;return function(_0x2e34df){logger[_0x7bed('0x29')](_0x2e34df[_0x7bed('0x2a')]);if(_0x2e34df[_0x7bed('0x2b')]){delete _0x2e34df[_0x7bed('0x2b')];}_0x53e281[_0x7bed('0x1c')](_0xb1b1a7)[_0x7bed('0x2c')](_0x2e34df);};}exports['index']=function(_0x1cc573,_0x124f03){var _0x24c388={},_0x4e359a={},_0x9eccbf={'count':0x0,'rows':[]};var _0x5f498c=_[_0x7bed('0x2d')](db['Dynamics365Account']['rawAttributes'],function(_0x4e526c){return{'name':_0x4e526c[_0x7bed('0x2e')],'type':_0x4e526c[_0x7bed('0x2f')]['key']};});_0x4e359a[_0x7bed('0x30')]=_[_0x7bed('0x2d')](_0x5f498c,_0x7bed('0x2b'));_0x4e359a['query']=_['keys'](_0x1cc573[_0x7bed('0x31')]);_0x4e359a[_0x7bed('0x32')]=_[_0x7bed('0x33')](_0x4e359a[_0x7bed('0x30')],_0x4e359a[_0x7bed('0x31')]);_0x24c388[_0x7bed('0x34')]=_[_0x7bed('0x33')](_0x4e359a[_0x7bed('0x30')],qs[_0x7bed('0x35')](_0x1cc573[_0x7bed('0x31')][_0x7bed('0x35')]));_0x24c388[_0x7bed('0x34')]=_0x24c388[_0x7bed('0x34')]['length']?_0x24c388[_0x7bed('0x34')]:_0x4e359a['model'];if(!_0x1cc573['query'][_0x7bed('0x36')](_0x7bed('0x37'))){_0x24c388[_0x7bed('0x1f')]=qs[_0x7bed('0x1f')](_0x1cc573[_0x7bed('0x31')]['limit']);_0x24c388['offset']=qs[_0x7bed('0x22')](_0x1cc573[_0x7bed('0x31')]['offset']);}_0x24c388[_0x7bed('0x38')]=qs['sort'](_0x1cc573[_0x7bed('0x31')][_0x7bed('0x39')]);_0x24c388['where']=qs[_0x7bed('0x32')](_[_0x7bed('0x3a')](_0x1cc573[_0x7bed('0x31')],_0x4e359a[_0x7bed('0x32')]),_0x5f498c);if(_0x1cc573[_0x7bed('0x31')][_0x7bed('0x3b')]){_0x24c388['where']=_[_0x7bed('0x3c')](_0x24c388[_0x7bed('0x3d')],{'$or':_[_0x7bed('0x2d')](_0x5f498c,function(_0x18641e){if(_0x18641e['type']!==_0x7bed('0x3e')){var _0x31a35b={};_0x31a35b[_0x18641e[_0x7bed('0x2b')]]={'$like':'%'+_0x1cc573[_0x7bed('0x31')][_0x7bed('0x3b')]+'%'};return _0x31a35b;}})});}_0x24c388=_['merge']({},_0x24c388,_0x1cc573[_0x7bed('0x3f')]);var _0x4dd1b0={'where':_0x24c388[_0x7bed('0x3d')]};return db['Dynamics365Account'][_0x7bed('0x21')](_0x4dd1b0)['then'](function(_0x4d836d){_0x9eccbf[_0x7bed('0x21')]=_0x4d836d;if(_0x1cc573[_0x7bed('0x31')][_0x7bed('0x40')]){_0x24c388[_0x7bed('0x41')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x24c388);})[_0x7bed('0x28')](function(_0x548c86){_0x9eccbf[_0x7bed('0x42')]=_0x548c86;return _0x9eccbf;})[_0x7bed('0x28')](respondWithFilteredResult(_0x124f03,_0x24c388))[_0x7bed('0x43')](handleError(_0x124f03,null));};exports[_0x7bed('0x44')]=function(_0x5a2e01,_0x1442f3){var _0x48016b={'raw':![],'where':{'id':_0x5a2e01[_0x7bed('0x45')]['id']}},_0x25df83={};_0x25df83[_0x7bed('0x30')]=_['keys'](db[_0x7bed('0x46')]['rawAttributes']);_0x25df83[_0x7bed('0x31')]=_[_0x7bed('0x47')](_0x5a2e01['query']);_0x25df83[_0x7bed('0x32')]=_[_0x7bed('0x33')](_0x25df83[_0x7bed('0x30')],_0x25df83[_0x7bed('0x31')]);_0x48016b[_0x7bed('0x34')]=_[_0x7bed('0x33')](_0x25df83['model'],qs[_0x7bed('0x35')](_0x5a2e01[_0x7bed('0x31')]['fields']));_0x48016b[_0x7bed('0x34')]=_0x48016b[_0x7bed('0x34')][_0x7bed('0x48')]?_0x48016b[_0x7bed('0x34')]:_0x25df83[_0x7bed('0x30')];if(_0x5a2e01[_0x7bed('0x31')][_0x7bed('0x40')]){_0x48016b['include']=[{'all':!![]}];}_0x48016b=_['merge']({},_0x48016b,_0x5a2e01[_0x7bed('0x3f')]);return db['Dynamics365Account']['find'](_0x48016b)[_0x7bed('0x28')](handleEntityNotFound(_0x1442f3,null))[_0x7bed('0x28')](respondWithResult(_0x1442f3,null))[_0x7bed('0x43')](handleError(_0x1442f3,null));};exports[_0x7bed('0x49')]=function(_0xd4f4f2,_0x45e4f9){return db[_0x7bed('0x46')]['create'](_0xd4f4f2[_0x7bed('0x4a')],{})['then'](respondWithResult(_0x45e4f9,0xc9))['catch'](handleError(_0x45e4f9,null));};exports[_0x7bed('0x27')]=function(_0x343df3,_0x3419b0){if(_0x343df3['body']['id']){delete _0x343df3['body']['id'];}return db[_0x7bed('0x46')][_0x7bed('0x4b')]({'where':{'id':_0x343df3[_0x7bed('0x45')]['id']}})['then'](handleEntityNotFound(_0x3419b0,null))['then'](saveUpdates(_0x343df3[_0x7bed('0x4a')],null))[_0x7bed('0x28')](respondWithResult(_0x3419b0,null))[_0x7bed('0x43')](handleError(_0x3419b0,null));};exports[_0x7bed('0x4c')]=function(_0x174dc9,_0x2d264e){return db['Dynamics365Account'][_0x7bed('0x4b')]({'where':{'id':_0x174dc9['params']['id']}})[_0x7bed('0x28')](handleEntityNotFound(_0x2d264e,null))[_0x7bed('0x28')](removeEntity(_0x2d264e,null))[_0x7bed('0x43')](handleError(_0x2d264e,null));};exports['getConfigurations']=function(_0x479568,_0x25f5e7,_0x230bff){var _0x3d8dfc={};var _0x5e82c7={};var _0x32c457;var _0x1bcc25;return db[_0x7bed('0x46')][_0x7bed('0x4d')]({'where':{'id':_0x479568[_0x7bed('0x45')]['id']}})[_0x7bed('0x28')](handleEntityNotFound(_0x25f5e7,null))['then'](function(_0x232a21){if(_0x232a21){_0x32c457=_0x232a21;_0x5e82c7['model']=_[_0x7bed('0x47')](db[_0x7bed('0x4e')][_0x7bed('0x4f')]);_0x5e82c7[_0x7bed('0x31')]=_[_0x7bed('0x47')](_0x479568['query']);_0x5e82c7['filters']=_['intersection'](_0x5e82c7[_0x7bed('0x30')],_0x5e82c7['query']);_0x3d8dfc[_0x7bed('0x34')]=_[_0x7bed('0x33')](_0x5e82c7[_0x7bed('0x30')],qs['fields'](_0x479568['query']['fields']));_0x3d8dfc['attributes']=_0x3d8dfc[_0x7bed('0x34')][_0x7bed('0x48')]?_0x3d8dfc['attributes']:_0x5e82c7['model'];_0x3d8dfc[_0x7bed('0x38')]=qs[_0x7bed('0x39')](_0x479568[_0x7bed('0x31')][_0x7bed('0x39')]);_0x3d8dfc[_0x7bed('0x3d')]=qs[_0x7bed('0x32')](_['pick'](_0x479568[_0x7bed('0x31')],_0x5e82c7[_0x7bed('0x32')]));if(_0x479568['query'][_0x7bed('0x3b')]){_0x3d8dfc[_0x7bed('0x3d')]=_['merge'](_0x3d8dfc[_0x7bed('0x3d')],{'$or':_[_0x7bed('0x2d')](_0x3d8dfc[_0x7bed('0x34')],function(_0x3ebece){var _0x2683f7={};_0x2683f7[_0x3ebece]={'$like':'%'+_0x479568[_0x7bed('0x31')][_0x7bed('0x3b')]+'%'};return _0x2683f7;})});}_0x3d8dfc=_['merge']({},_0x3d8dfc,_0x479568['options']);return _0x32c457[_0x7bed('0x50')](_0x3d8dfc);}})[_0x7bed('0x28')](function(_0x50f531){if(_0x50f531){_0x1bcc25=_0x50f531[_0x7bed('0x48')];if(!_0x479568['query'][_0x7bed('0x36')]('nolimit')){_0x3d8dfc['limit']=qs['limit'](_0x479568[_0x7bed('0x31')][_0x7bed('0x1f')]);_0x3d8dfc[_0x7bed('0x22')]=qs[_0x7bed('0x22')](_0x479568[_0x7bed('0x31')][_0x7bed('0x22')]);}return _0x32c457[_0x7bed('0x50')](_0x3d8dfc);}})[_0x7bed('0x28')](function(_0x350342){if(_0x350342){return _0x350342?{'count':_0x1bcc25,'rows':_0x350342}:null;}})['then'](respondWithResult(_0x25f5e7,null))[_0x7bed('0x43')](handleError(_0x25f5e7,null));};exports[_0x7bed('0x51')]=function(_0xbaef3c,_0x480927,_0x9f8331){if(_0xbaef3c['body']['id']){delete _0xbaef3c['body']['id'];}return db[_0x7bed('0x46')][_0x7bed('0x4d')]({'where':{'id':_0xbaef3c['params']['id']}})['then'](handleEntityNotFound(_0x480927,null))[_0x7bed('0x28')](function(_0x4363a5){if(_0x4363a5){_0xbaef3c[_0x7bed('0x4a')]['AccountId']=_0x4363a5['id'];_0xbaef3c[_0x7bed('0x4a')][_0x7bed('0x52')]=integrations[_0x7bed('0x53')](_0xbaef3c[_0x7bed('0x4a')]['channel'],_0xbaef3c[_0x7bed('0x4a')][_0x7bed('0x2f')]);_0xbaef3c[_0x7bed('0x4a')]['Descriptions']=integrations[_0x7bed('0x54')](_0xbaef3c['body'][_0x7bed('0x55')],_0xbaef3c[_0x7bed('0x4a')][_0x7bed('0x2f')]);return db['Dynamics365Configuration'][_0x7bed('0x49')](_0xbaef3c['body'],{'include':[{'model':db[_0x7bed('0x56')],'as':_0x7bed('0x52')},{'model':db['Dynamics365Field'],'as':_0x7bed('0x57')}]});}return null;})['then'](respondWithResult(_0x480927,null))[_0x7bed('0x43')](handleError(_0x480927,null));};exports[_0x7bed('0x58')]=function(_0x45d818,_0x5eab2f,_0x4a6eda){var _0x1f7ed7=_0x45d818[_0x7bed('0x31')][_0x7bed('0x59')];var _0x40cf05=_0x1f7ed7===_0x7bed('0x5a')?_0x7bed('0x5b'):_0x7bed('0x5c');var _0x101ef2='';var _0x490259='';var _0x13943f='';var _0x527ab7='';var _0x5591a4='';var _0x591b84='';var _0x996356='';var _0x4bef08='';var _0x3c2bba=[_0x7bed('0x5d'),_0x7bed('0x5e'),_0x7bed('0x5f'),'ownerid','caseorigincode',_0x7bed('0x60'),_0x7bed('0x61'),_0x7bed('0x62'),_0x7bed('0x63'),_0x7bed('0x64')];var _0x51916c=[_0x7bed('0x65'),_0x7bed('0x66'),_0x7bed('0x67'),'billedserviceunits',_0x7bed('0x68'),_0x7bed('0x69'),_0x7bed('0x6a'),'contractidname',_0x7bed('0x6b'),'createdbyexternalpartyyominame',_0x7bed('0x6c'),'createdbyyominame',_0x7bed('0x6d'),_0x7bed('0x6e'),_0x7bed('0x6f'),_0x7bed('0x70'),'customeridtype',_0x7bed('0x71'),'emailaddress',_0x7bed('0x72'),_0x7bed('0x73'),'entityimage_url','escalatedon',_0x7bed('0x74'),_0x7bed('0x75'),_0x7bed('0x76'),'importsequencenumber',_0x7bed('0x77'),_0x7bed('0x78'),_0x7bed('0x79'),_0x7bed('0x7a'),_0x7bed('0x7b'),_0x7bed('0x7c'),_0x7bed('0x7d'),_0x7bed('0x7e'),'modifiedon',_0x7bed('0x7f'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x7bed('0x80'),_0x7bed('0x81'),'onholdtime',_0x7bed('0x82'),'owneridname',_0x7bed('0x83'),_0x7bed('0x84'),_0x7bed('0x85'),_0x7bed('0x86'),_0x7bed('0x87'),_0x7bed('0x88'),'productidname','productserialnumber','resolveby',_0x7bed('0x89'),_0x7bed('0x8a'),_0x7bed('0x8b'),_0x7bed('0x8c'),'sentimentvalue','slainvokedidname',_0x7bed('0x8d'),_0x7bed('0x8e'),_0x7bed('0x8f'),_0x7bed('0x90'),'subjectidname',_0x7bed('0x91'),'timezoneruleversionnumber',_0x7bed('0x92'),_0x7bed('0x93'),_0x7bed('0x94'),_0x7bed('0x95')];var _0x460fac=_0x3c2bba[_0x7bed('0x96')](_0x51916c);return db[_0x7bed('0x46')][_0x7bed('0x4d')]({'where':{'id':_0x45d818[_0x7bed('0x45')]['id']},'attributes':['id',_0x7bed('0x97'),'password',_0x7bed('0x98'),_0x7bed('0x99'),_0x7bed('0x9a'),_0x7bed('0x9b')]})[_0x7bed('0x28')](handleEntityNotFound(_0x5eab2f,null))[_0x7bed('0x28')](function(_0x35d49b){if(_0x35d49b){_0x4bef08=_0x35d49b['remoteUri'];var _0x2ef501=_0x4bef08[_0x7bed('0x9c')](-0x1);if(_0x2ef501==='/'){_0x4bef08=_0x4bef08['substring'](0x0,_0x4bef08['lastIndexOf'](_0x2ef501));}_0x996356=util[_0x7bed('0x9d')](_0x7bed('0x9e'),_0x4bef08);var _0x5c4e4c={'method':'POST','uri':_0x7bed('0x9f')+_0x35d49b['tenantId']+'/oauth2/token','form':{'client_id':_0x35d49b[_0x7bed('0x9a')],'resource':_0x4bef08,'username':_0x35d49b[_0x7bed('0x97')],'password':_0x35d49b['password'],'grant_type':'password','client_secret':_0x35d49b[_0x7bed('0x9b')]},'json':!![]};return rp(_0x5c4e4c);}})[_0x7bed('0x28')](function(_0x5ba69c){_0x591b84=_0x5ba69c[_0x7bed('0xa0')];var _0x36e65d={'method':_0x7bed('0xa1'),'uri':encodeURI(_0x996356+_0x7bed('0xa2')+_0x40cf05+'\x27'),'headers':{'Authorization':_0x7bed('0xa3')+_0x591b84,'If-None-Match':null,'OData-Version':_0x7bed('0xa4')},'json':!![]};return rp(_0x36e65d);})[_0x7bed('0x28')](function(_0x2bff5c){var _0x4f9f7e=_0x2bff5c[_0x7bed('0xa5')][0x0];var _0x1ffba0=_0x4f9f7e[_0x7bed('0xa6')];var _0x5b42f6={'method':_0x7bed('0xa1'),'uri':_0x996356+_0x7bed('0xa7')+_0x1ffba0+_0x7bed('0xa8'),'headers':{'Authorization':_0x7bed('0xa3')+_0x591b84,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5b42f6);})[_0x7bed('0x28')](function(_0x2984af){_0x101ef2=_0x2984af;_0x490259=_0x101ef2[_0x7bed('0xa9')];_0x490259=_[_0x7bed('0xaa')](_0x490259,function(_0x1b5917){return!_0x460fac[_0x7bed('0xab')](_0x1b5917['LogicalName']);});var _0x4044b1=[];var _0x47476d=[];_0x490259[_0x7bed('0xac')](function(_0x4f192b){if(_0x4f192b[_0x7bed('0xad')]){var _0x14b83b=_0x4f192b[_0x7bed('0xad')]['substring'](_0x4f192b[_0x7bed('0xad')][_0x7bed('0xae')]('.')+0x1);if(_0x14b83b===_0x7bed('0xaf')){_0x4044b1[_0x7bed('0xb0')](getSelectList(_0x996356,_0x1f7ed7,_0x47476d,_0x101ef2['MetadataId'],_0x4f192b[_0x7bed('0xa6')],_0x591b84));}}});return Promise[_0x7bed('0xb1')](_0x4044b1);})[_0x7bed('0x28')](function(_0x53c909){_0x13943f=_0x53c909[0x0];var _0xa2ddcb=[];var _0x5ec956=[];_0x490259[_0x7bed('0xac')](function(_0x2af715){if(!_['isNil'](_0x2af715['@odata.type'])){var _0x3be0c1=_0x2af715[_0x7bed('0xad')][_0x7bed('0xb2')](_0x2af715[_0x7bed('0xad')][_0x7bed('0xae')]('.')+0x1);if(_0x3be0c1===_0x7bed('0xb3')){_0xa2ddcb[_0x7bed('0xb0')](getBooleanList(_0x996356,_0x1f7ed7,_0x5ec956,_0x101ef2[_0x7bed('0xa6')],_0x2af715[_0x7bed('0xa6')],_0x591b84));}}});return Promise['all'](_0xa2ddcb);})[_0x7bed('0x28')](function(_0x29e589){_0x527ab7=_0x29e589[0x0];var _0x47b5b5=[];var _0x4d34cb=[];_0x490259[_0x7bed('0xac')](function(_0x2cf009){if(_0x2cf009[_0x7bed('0xad')]){var _0xf3e74c=_0x2cf009['@odata.type']['substring'](_0x2cf009['@odata.type']['lastIndexOf']('.')+0x1);if(_0xf3e74c===_0x7bed('0xb4')||_0xf3e74c===_0x7bed('0xb5')||_0xf3e74c==='BigIntAttributeMetadata'||_0xf3e74c===_0x7bed('0xb6')||_0xf3e74c==='MemoAttributeMetadata'||_0xf3e74c===_0x7bed('0xb7')||_0xf3e74c===_0x7bed('0xb8')||_0xf3e74c==='EntityNameAttributeMetadata'||_0xf3e74c===_0x7bed('0xb9')||_0xf3e74c===_0x7bed('0xba')){_0x47b5b5['push'](getInputList(_0x996356,_0x1f7ed7,_0xf3e74c,_0x4d34cb,_0x101ef2['MetadataId'],_0x2cf009[_0x7bed('0xa6')],_0x591b84));}}});return Promise[_0x7bed('0xb1')](_0x47b5b5);})['then'](function(_0x55f07c){_0x5591a4=_0x55f07c[0x0];var _0x318998=_0x13943f['concat'](_0x527ab7)[_0x7bed('0x96')](_0x5591a4);var _0x12bab3={'count':_0x318998[_0x7bed('0x48')],'rows':_0x318998};return _0x12bab3;})[_0x7bed('0x28')](respondWithResult(_0x5eab2f,null))[_0x7bed('0x43')](function(_0x5ce011){var _0x104f81=_0x45d818[_0x7bed('0x31')][_0x7bed('0xbb')]?0x1f4:_0x5ce011[_0x7bed('0xbc')]||0x1f4;logger['error'](_0x5ce011[_0x7bed('0x2a')]);delete _0x5ce011[_0x7bed('0x2b')];if(_0x104f81===0x191){_0x104f81=0x190;}_0x5eab2f[_0x7bed('0x1c')](_0x104f81)['send'](_0x45d818[_0x7bed('0x31')][_0x7bed('0xbb')]?{'message':'Wrong\x20credentials','statusCode':_0x5ce011[_0x7bed('0xbc')]}:_0x5ce011);});};function getSelectList(_0x3330ee,_0x326147,_0x3693e3,_0x45e07d,_0x356442,_0x1090f7){var _0x1dcce9={'method':_0x7bed('0xa1'),'uri':_0x3330ee+'EntityDefinitions('+_0x45e07d+_0x7bed('0xbd')+_0x356442+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x7bed('0xbe'),'headers':{'Authorization':_0x7bed('0xa3')+_0x1090f7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1dcce9)[_0x7bed('0x28')](function(_0x120cd2){var _0x4f453e=[];var _0x1d551a=_0x120cd2[_0x7bed('0xbf')]['Options'];_0x1d551a[_0x7bed('0xac')](function(_0x148190){_0x4f453e[_0x7bed('0xb0')]({'name':_0x148190[_0x7bed('0xc0')][_0x7bed('0xc1')][_0x7bed('0xc0')],'value':String(_0x148190['Value'])});});var _0x55ad53={'id':_0x326147+'_'+_0x120cd2[_0x7bed('0xc2')],'name':_0x120cd2['DisplayName'][_0x7bed('0xc1')][_0x7bed('0xc0')],'custom':![],'options':_0x4f453e};_0x3693e3[_0x7bed('0xb0')](_0x55ad53);return _0x3693e3;});}function getBooleanList(_0x1937f3,_0x464165,_0x3e56b3,_0x13f205,_0x3fcf8c,_0x3a8256){var _0x2b6bde={'method':'GET','uri':_0x1937f3+_0x7bed('0xa7')+_0x13f205+')/Attributes('+_0x3fcf8c+_0x7bed('0xc3'),'headers':{'Authorization':_0x7bed('0xa3')+_0x3a8256,'If-None-Match':null,'OData-Version':_0x7bed('0xa4')},'json':!![]};return rp(_0x2b6bde)[_0x7bed('0x28')](function(_0x43936b){var _0x4b9287=[];_0x4b9287['push']({'name':_0x43936b[_0x7bed('0xbf')]['TrueOption'][_0x7bed('0xc0')][_0x7bed('0xc1')][_0x7bed('0xc0')],'value':_0x7bed('0xc4')},{'name':_0x43936b[_0x7bed('0xbf')][_0x7bed('0xc5')]['Label'][_0x7bed('0xc1')]['Label'],'value':_0x7bed('0xc6')});var _0x3fc453={'id':_0x464165+'_'+_0x43936b[_0x7bed('0xc2')],'name':_0x43936b['DisplayName']['UserLocalizedLabel'][_0x7bed('0xc0')],'custom':![],'options':_0x4b9287};_0x3e56b3['push'](_0x3fc453);return _0x3e56b3;});}function getInputList(_0x5d07f8,_0x3bb0da,_0x109da0,_0x1338a8,_0x3786ff,_0xe581f9,_0x19cba2){var _0x50c4a3={'method':_0x7bed('0xa1'),'uri':_0x5d07f8+'EntityDefinitions('+_0x3786ff+_0x7bed('0xbd')+_0xe581f9+_0x7bed('0xc7')+_0x109da0+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x19cba2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x50c4a3)['then'](function(_0x2a48d5){var _0x19ea4b={'id':_0x3bb0da+'_'+_0x2a48d5[_0x7bed('0xc2')],'name':_0x2a48d5['DisplayName'][_0x7bed('0xc1')]?_0x2a48d5[_0x7bed('0xc8')]['UserLocalizedLabel'][_0x7bed('0xc0')]:_0x2a48d5[_0x7bed('0xc2')],'custom':![],'options':[]};_0x1338a8[_0x7bed('0xb0')](_0x19ea4b);return _0x1338a8;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c4b6642..a1bf268 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x4ee94a,_0x153465){var _0x5d7b98=function(_0x103bf9){while(--_0x103bf9){_0x4ee94a['push'](_0x4ee94a['shift']());}};_0x5d7b98(++_0x153465);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xcb91[_0x5e9a69];return _0x5979c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x50b2b4,_0x4ef370){var _0x15f1da=function(_0x256102){while(--_0x256102){_0x50b2b4['push'](_0x50b2b4['shift']());}};_0x15f1da(++_0x4ef370);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xcb91[_0x4164f2];return _0x2575c7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 5aaa6fc..2deb182 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 _0x39cc=['raw','where','attributes','include','map','model','ShowDynamics365Account','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options'];(function(_0x38471f,_0x38a7d4){var _0x321f74=function(_0x16f1e9){while(--_0x16f1e9){_0x38471f['push'](_0x38471f['shift']());}};_0x321f74(++_0x38a7d4);}(_0x39cc,0x104));var _0xc39c=function(_0x444dd8,_0x46b252){_0x444dd8=_0x444dd8-0x0;var _0x3b37b7=_0x39cc[_0x444dd8];return _0x3b37b7;};'use strict';var _=require(_0xc39c('0x0'));var util=require(_0xc39c('0x1'));var moment=require(_0xc39c('0x2'));var BPromise=require('bluebird');var rs=require(_0xc39c('0x3'));var fs=require('fs');var Redis=require(_0xc39c('0x4'));var db=require(_0xc39c('0x5'))['db'];var utils=require(_0xc39c('0x6'));var logger=require('../../config/logger')(_0xc39c('0x7'));var config=require(_0xc39c('0x8'));var jayson=require(_0xc39c('0x9'));var client=jayson[_0xc39c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f219b,_0x47ab09,_0x30f622){return new BPromise(function(_0x4fb005,_0x324e7b){return client[_0xc39c('0xb')](_0x5f219b,_0x30f622)[_0xc39c('0xc')](function(_0x21a6e7){logger[_0xc39c('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x47ab09,_0xc39c('0xe'));logger[_0xc39c('0xf')](_0xc39c('0x10'),_0x47ab09,_0xc39c('0xe'),JSON[_0xc39c('0x11')](_0x21a6e7));if(_0x21a6e7['error']){if(_0x21a6e7[_0xc39c('0x12')][_0xc39c('0x13')]===0x1f4){logger[_0xc39c('0x12')](_0xc39c('0x14'),_0x47ab09,_0x21a6e7[_0xc39c('0x12')][_0xc39c('0x15')]);return _0x324e7b(_0x21a6e7[_0xc39c('0x12')][_0xc39c('0x15')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x47ab09,_0x21a6e7[_0xc39c('0x12')][_0xc39c('0x15')]);return _0x4fb005(_0x21a6e7[_0xc39c('0x12')]['message']);}else{logger[_0xc39c('0xd')](_0xc39c('0x14'),_0x47ab09,'request\x20sent');_0x4fb005(_0x21a6e7[_0xc39c('0x16')][_0xc39c('0x15')]);}})[_0xc39c('0x17')](function(_0x409eb6){logger[_0xc39c('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x47ab09,_0x409eb6);_0x324e7b(_0x409eb6);});});}exports[_0xc39c('0x18')]=function(_0x55c576){var _0x423d77=this;return new Promise(function(_0x2cf740,_0x1fde27){return db[_0xc39c('0x19')][_0xc39c('0x1a')]({'raw':_0x55c576[_0xc39c('0x1b')]?_0x55c576['options'][_0xc39c('0x1c')]===undefined?!![]:![]:!![],'where':_0x55c576['options']?_0x55c576[_0xc39c('0x1b')][_0xc39c('0x1d')]||null:null,'attributes':_0x55c576[_0xc39c('0x1b')]?_0x55c576['options'][_0xc39c('0x1e')]||null:null,'limit':_0x55c576[_0xc39c('0x1b')]?_0x55c576[_0xc39c('0x1b')]['limit']||null:null,'include':_0x55c576[_0xc39c('0x1b')]?_0x55c576['options'][_0xc39c('0x1f')]?_[_0xc39c('0x20')](_0x55c576[_0xc39c('0x1b')][_0xc39c('0x1f')],function(_0x7b549a){return{'model':db[_0x7b549a['model']],'as':_0x7b549a['as'],'attributes':_0x7b549a[_0xc39c('0x1e')],'include':_0x7b549a[_0xc39c('0x1f')]?_[_0xc39c('0x20')](_0x7b549a['include'],function(_0x3c3667){return{'model':db[_0x3c3667[_0xc39c('0x21')]],'as':_0x3c3667['as'],'attributes':_0x3c3667[_0xc39c('0x1e')],'include':_0x3c3667[_0xc39c('0x1f')]?_[_0xc39c('0x20')](_0x3c3667[_0xc39c('0x1f')],function(_0x30ec12){return{'model':db[_0x30ec12[_0xc39c('0x21')]],'as':_0x30ec12['as'],'attributes':_0x30ec12[_0xc39c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d068a){logger['info'](_0xc39c('0x18'),_0x55c576);logger[_0xc39c('0xf')](_0xc39c('0x18'),_0x55c576,JSON[_0xc39c('0x11')](_0x3d068a));_0x2cf740(_0x3d068a);})[_0xc39c('0x17')](function(_0x10879f){logger[_0xc39c('0x12')](_0xc39c('0x18'),_0x10879f[_0xc39c('0x15')],_0x55c576);_0x1fde27(_0x423d77[_0xc39c('0x12')](0x1f4,_0x10879f[_0xc39c('0x15')]));});});};exports[_0xc39c('0x22')]=function(_0x4ff4d9){var _0x48914c=this;return new Promise(function(_0xdf592b,_0x25c7d0){return db['Dynamics365Account'][_0xc39c('0x23')]({'raw':_0x4ff4d9[_0xc39c('0x1b')]?_0x4ff4d9['options'][_0xc39c('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ff4d9[_0xc39c('0x1b')]?_0x4ff4d9[_0xc39c('0x1b')]['where']||null:null,'attributes':_0x4ff4d9['options']?_0x4ff4d9[_0xc39c('0x1b')]['attributes']||null:null,'include':_0x4ff4d9['options']?_0x4ff4d9['options'][_0xc39c('0x1f')]?_[_0xc39c('0x20')](_0x4ff4d9[_0xc39c('0x1b')]['include'],function(_0x27cd4c){return{'model':db[_0x27cd4c[_0xc39c('0x21')]],'as':_0x27cd4c['as'],'attributes':_0x27cd4c['attributes'],'include':_0x27cd4c['include']?_[_0xc39c('0x20')](_0x27cd4c[_0xc39c('0x1f')],function(_0x36d462){return{'model':db[_0x36d462[_0xc39c('0x21')]],'as':_0x36d462['as'],'attributes':_0x36d462['attributes'],'include':_0x36d462[_0xc39c('0x1f')]?_['map'](_0x36d462[_0xc39c('0x1f')],function(_0x224ade){return{'model':db[_0x224ade[_0xc39c('0x21')]],'as':_0x224ade['as'],'attributes':_0x224ade[_0xc39c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc39c('0xc')](function(_0x228e7b){logger[_0xc39c('0xd')](_0xc39c('0x22'),_0x4ff4d9);logger[_0xc39c('0xf')](_0xc39c('0x22'),_0x4ff4d9,JSON['stringify'](_0x228e7b));_0xdf592b(_0x228e7b);})[_0xc39c('0x17')](function(_0x952b75){logger[_0xc39c('0x12')]('ShowDynamics365Account',_0x952b75[_0xc39c('0x15')],_0x4ff4d9);_0x25c7d0(_0x48914c[_0xc39c('0x12')](0x1f4,_0x952b75['message']));});});}; \ No newline at end of file +var _0x722c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','Dynamics365Account,\x20%s,\x20%s','error','message','result','catch','options','raw','attributes','limit','map','include','model','GetDynamics365Account','debug','ShowDynamics365Account','Dynamics365Account','where','util','moment'];(function(_0x454ce2,_0x397cf1){var _0xd4c63b=function(_0x5723ce){while(--_0x5723ce){_0x454ce2['push'](_0x454ce2['shift']());}};_0xd4c63b(++_0x397cf1);}(_0x722c,0x139));var _0xc722=function(_0x2a4b5f,_0x4e4c29){_0x2a4b5f=_0x2a4b5f-0x0;var _0x10e587=_0x722c[_0x2a4b5f];return _0x10e587;};'use strict';var _=require('lodash');var util=require(_0xc722('0x0'));var moment=require(_0xc722('0x1'));var BPromise=require(_0xc722('0x2'));var rs=require(_0xc722('0x3'));var fs=require('fs');var Redis=require(_0xc722('0x4'));var db=require(_0xc722('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc722('0x6'))(_0xc722('0x7'));var config=require(_0xc722('0x8'));var jayson=require(_0xc722('0x9'));var client=jayson[_0xc722('0xa')][_0xc722('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe9fe2,_0x3fbdf9,_0x3b0c6a){return new BPromise(function(_0x14dd17,_0x208ea6){return client[_0xc722('0xc')](_0xe9fe2,_0x3b0c6a)[_0xc722('0xd')](function(_0x4eea2c){logger[_0xc722('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x3fbdf9,_0xc722('0xf'));logger['debug'](_0xc722('0x10'),_0x3fbdf9,_0xc722('0xf'),JSON[_0xc722('0x11')](_0x4eea2c));if(_0x4eea2c['error']){if(_0x4eea2c['error']['code']===0x1f4){logger['error'](_0xc722('0x12'),_0x3fbdf9,_0x4eea2c['error']['message']);return _0x208ea6(_0x4eea2c[_0xc722('0x13')][_0xc722('0x14')]);}logger[_0xc722('0x13')](_0xc722('0x12'),_0x3fbdf9,_0x4eea2c[_0xc722('0x13')][_0xc722('0x14')]);return _0x14dd17(_0x4eea2c[_0xc722('0x13')][_0xc722('0x14')]);}else{logger[_0xc722('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x3fbdf9,_0xc722('0xf'));_0x14dd17(_0x4eea2c[_0xc722('0x15')][_0xc722('0x14')]);}})[_0xc722('0x16')](function(_0x312314){logger[_0xc722('0x13')](_0xc722('0x12'),_0x3fbdf9,_0x312314);_0x208ea6(_0x312314);});});}exports['GetDynamics365Account']=function(_0xf6a1a6){var _0x3717dd=this;return new Promise(function(_0x35fbfc,_0xaca57c){return db['Dynamics365Account']['findAll']({'raw':_0xf6a1a6[_0xc722('0x17')]?_0xf6a1a6[_0xc722('0x17')][_0xc722('0x18')]===undefined?!![]:![]:!![],'where':_0xf6a1a6[_0xc722('0x17')]?_0xf6a1a6['options']['where']||null:null,'attributes':_0xf6a1a6['options']?_0xf6a1a6[_0xc722('0x17')][_0xc722('0x19')]||null:null,'limit':_0xf6a1a6[_0xc722('0x17')]?_0xf6a1a6['options'][_0xc722('0x1a')]||null:null,'include':_0xf6a1a6[_0xc722('0x17')]?_0xf6a1a6[_0xc722('0x17')]['include']?_[_0xc722('0x1b')](_0xf6a1a6[_0xc722('0x17')][_0xc722('0x1c')],function(_0x1b6901){return{'model':db[_0x1b6901[_0xc722('0x1d')]],'as':_0x1b6901['as'],'attributes':_0x1b6901[_0xc722('0x19')],'include':_0x1b6901[_0xc722('0x1c')]?_[_0xc722('0x1b')](_0x1b6901[_0xc722('0x1c')],function(_0x545e01){return{'model':db[_0x545e01['model']],'as':_0x545e01['as'],'attributes':_0x545e01[_0xc722('0x19')],'include':_0x545e01[_0xc722('0x1c')]?_[_0xc722('0x1b')](_0x545e01[_0xc722('0x1c')],function(_0x4804fb){return{'model':db[_0x4804fb[_0xc722('0x1d')]],'as':_0x4804fb['as'],'attributes':_0x4804fb[_0xc722('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc722('0xd')](function(_0x39f4ef){logger[_0xc722('0xe')](_0xc722('0x1e'),_0xf6a1a6);logger[_0xc722('0x1f')](_0xc722('0x1e'),_0xf6a1a6,JSON[_0xc722('0x11')](_0x39f4ef));_0x35fbfc(_0x39f4ef);})['catch'](function(_0x101254){logger[_0xc722('0x13')](_0xc722('0x1e'),_0x101254[_0xc722('0x14')],_0xf6a1a6);_0xaca57c(_0x3717dd[_0xc722('0x13')](0x1f4,_0x101254[_0xc722('0x14')]));});});};exports[_0xc722('0x20')]=function(_0x59c1e4){var _0x231083=this;return new Promise(function(_0x5ca158,_0x2a28fa){return db[_0xc722('0x21')]['find']({'raw':_0x59c1e4[_0xc722('0x17')]?_0x59c1e4[_0xc722('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x59c1e4[_0xc722('0x17')]?_0x59c1e4[_0xc722('0x17')][_0xc722('0x22')]||null:null,'attributes':_0x59c1e4[_0xc722('0x17')]?_0x59c1e4['options']['attributes']||null:null,'include':_0x59c1e4[_0xc722('0x17')]?_0x59c1e4[_0xc722('0x17')][_0xc722('0x1c')]?_[_0xc722('0x1b')](_0x59c1e4['options']['include'],function(_0xc918e9){return{'model':db[_0xc918e9[_0xc722('0x1d')]],'as':_0xc918e9['as'],'attributes':_0xc918e9[_0xc722('0x19')],'include':_0xc918e9[_0xc722('0x1c')]?_[_0xc722('0x1b')](_0xc918e9[_0xc722('0x1c')],function(_0x3fe4ed){return{'model':db[_0x3fe4ed[_0xc722('0x1d')]],'as':_0x3fe4ed['as'],'attributes':_0x3fe4ed[_0xc722('0x19')],'include':_0x3fe4ed['include']?_['map'](_0x3fe4ed[_0xc722('0x1c')],function(_0x3047ed){return{'model':db[_0x3047ed[_0xc722('0x1d')]],'as':_0x3047ed['as'],'attributes':_0x3047ed[_0xc722('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc722('0xd')](function(_0x4e7f87){logger[_0xc722('0xe')]('ShowDynamics365Account',_0x59c1e4);logger[_0xc722('0x1f')](_0xc722('0x20'),_0x59c1e4,JSON[_0xc722('0x11')](_0x4e7f87));_0x5ca158(_0x4e7f87);})[_0xc722('0x16')](function(_0x7e43f7){logger['error']('ShowDynamics365Account',_0x7e43f7[_0xc722('0x14')],_0x59c1e4);_0x2a28fa(_0x231083[_0xc722('0x13')](0x1f4,_0x7e43f7['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 2233572..28ba6ff 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 _0x7dbc=['getDescriptions','create','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x37d0e6,_0xa7f115){var _0x22fe23=function(_0x4a450a){while(--_0x4a450a){_0x37d0e6['push'](_0x37d0e6['shift']());}};_0x22fe23(++_0xa7f115);}(_0x7dbc,0xe0));var _0xc7db=function(_0x11e18b,_0x1ace79){_0x11e18b=_0x11e18b-0x0;var _0xe74b5d=_0x7dbc[_0x11e18b];return _0xe74b5d;};'use strict';var multer=require(_0xc7db('0x0'));var util=require(_0xc7db('0x1'));var path=require(_0xc7db('0x2'));var timeout=require('connect-timeout');var express=require(_0xc7db('0x3'));var router=express[_0xc7db('0x4')]();var fs_extra=require(_0xc7db('0x5'));var auth=require(_0xc7db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc7db('0x7'));var controller=require(_0xc7db('0x8'));router['get']('/',auth[_0xc7db('0x9')](),controller[_0xc7db('0xa')]);router[_0xc7db('0xb')](_0xc7db('0xc'),auth[_0xc7db('0x9')](),controller[_0xc7db('0xd')]);router[_0xc7db('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc7db('0xe')]);router['get'](_0xc7db('0xf'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x10')]);router[_0xc7db('0xb')](_0xc7db('0x11'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc7db('0x13')]);router['put'](_0xc7db('0xc'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x14')]);router['delete'](_0xc7db('0xc'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9e38=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update'];(function(_0x13a7b5,_0x17ad76){var _0x23ecf2=function(_0x243eee){while(--_0x243eee){_0x13a7b5['push'](_0x13a7b5['shift']());}};_0x23ecf2(++_0x17ad76);}(_0x9e38,0x155));var _0x89e3=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0x9e38[_0x3186aa];return _0x2d8c36;};'use strict';var multer=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var path=require(_0x89e3('0x2'));var timeout=require(_0x89e3('0x3'));var express=require(_0x89e3('0x4'));var router=express[_0x89e3('0x5')]();var fs_extra=require(_0x89e3('0x6'));var auth=require(_0x89e3('0x7'));var interaction=require(_0x89e3('0x8'));var config=require(_0x89e3('0x9'));var controller=require(_0x89e3('0xa'));router[_0x89e3('0xb')]('/',auth[_0x89e3('0xc')](),controller['index']);router[_0x89e3('0xb')](_0x89e3('0xd'),auth[_0x89e3('0xc')](),controller[_0x89e3('0xe')]);router[_0x89e3('0xb')](_0x89e3('0xf'),auth[_0x89e3('0xc')](),controller[_0x89e3('0x10')]);router[_0x89e3('0xb')](_0x89e3('0x11'),auth['isAuthenticated'](),controller[_0x89e3('0x12')]);router[_0x89e3('0xb')](_0x89e3('0x13'),auth[_0x89e3('0xc')](),controller['getDescriptions']);router[_0x89e3('0x14')]('/',auth[_0x89e3('0xc')](),controller[_0x89e3('0x15')]);router['put'](_0x89e3('0xd'),auth['isAuthenticated'](),controller[_0x89e3('0x16')]);router[_0x89e3('0x17')](_0x89e3('0xd'),auth[_0x89e3('0xc')](),controller[_0x89e3('0x18')]);module[_0x89e3('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index c450880..aa42daf 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 _0x035e=['sequelize','exports','STRING','ENUM','incident','phonecall','contact','nothing'];(function(_0x55fd07,_0x134c23){var _0x180c25=function(_0x5cc922){while(--_0x5cc922){_0x55fd07['push'](_0x55fd07['shift']());}};_0x180c25(++_0x134c23);}(_0x035e,0x128));var _0xe035=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x035e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe035('0x0'));module[_0xe035('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe035('0x2')]},'ticketType':{'type':Sequelize[_0xe035('0x3')](_0xe035('0x4'),_0xe035('0x5')),'defaultValue':_0xe035('0x4')},'moduleCreate':{'type':Sequelize[_0xe035('0x3')](_0xe035('0x6'),_0xe035('0x7')),'defaultValue':_0xe035('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x23d6=['sequelize','exports','STRING','ENUM','phonecall','nothing','contact'];(function(_0x2021b2,_0x2b6b88){var _0x1d208b=function(_0x172f9b){while(--_0x172f9b){_0x2021b2['push'](_0x2021b2['shift']());}};_0x1d208b(++_0x2b6b88);}(_0x23d6,0x69));var _0x623d=function(_0x127ef3,_0x3fd9b5){_0x127ef3=_0x127ef3-0x0;var _0x12e618=_0x23d6[_0x127ef3];return _0x12e618;};'use strict';var Sequelize=require(_0x623d('0x0'));module[_0x623d('0x1')]={'name':{'type':Sequelize[_0x623d('0x2')]},'description':{'type':Sequelize[_0x623d('0x2')]},'ticketType':{'type':Sequelize[_0x623d('0x3')]('incident',_0x623d('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0x623d('0x5')),'defaultValue':_0x623d('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 55c96d8..e0a6089 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 _0x7e29=['options','Dynamics365Configuration','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','getFields','Dynamics365Field','order','pick','hasOwnProperty','findOne','rawAttributes','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','filter'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x7e29,0x1ab));var _0x97e2=function(_0x26967d,_0x3e2cef){_0x26967d=_0x26967d-0x0;var _0xc245ba=_0x7e29[_0x26967d];return _0xc245ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97e2('0x0'));var zipdir=require(_0x97e2('0x1'));var jsonpatch=require(_0x97e2('0x2'));var rp=require('request-promise');var moment=require(_0x97e2('0x3'));var BPromise=require(_0x97e2('0x4'));var Mustache=require(_0x97e2('0x5'));var util=require(_0x97e2('0x6'));var path=require(_0x97e2('0x7'));var sox=require(_0x97e2('0x8'));var csv=require(_0x97e2('0x9'));var ejs=require(_0x97e2('0xa'));var fs=require('fs');var fs_extra=require(_0x97e2('0xb'));var _=require('lodash');var squel=require(_0x97e2('0xc'));var crypto=require(_0x97e2('0xd'));var jsforce=require(_0x97e2('0xe'));var deskjs=require(_0x97e2('0xf'));var toCsv=require(_0x97e2('0x9'));var querystring=require(_0x97e2('0x10'));var Papa=require('papaparse');var Redis=require(_0x97e2('0x11'));var authService=require(_0x97e2('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x97e2('0x13'))(_0x97e2('0x14'));var utils=require(_0x97e2('0x15'));var config=require(_0x97e2('0x16'));var licenseUtil=require(_0x97e2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x291a74,_0x5e9a8c){_0x5e9a8c=_0x5e9a8c||0xcc;return function(_0x43c2ba){if(_0x43c2ba){return _0x291a74[_0x97e2('0x18')](_0x5e9a8c);}return _0x291a74[_0x97e2('0x19')](_0x5e9a8c)[_0x97e2('0x1a')]();};}function respondWithResult(_0x4c3e72,_0x2a13c7){_0x2a13c7=_0x2a13c7||0xc8;return function(_0x4b8912){if(_0x4b8912){return _0x4c3e72[_0x97e2('0x19')](_0x2a13c7)[_0x97e2('0x1b')](_0x4b8912);}};}function respondWithFilteredResult(_0xf88601,_0x38eba5){return function(_0x4e05ae){if(_0x4e05ae){var _0x1230eb=typeof _0x38eba5[_0x97e2('0x1c')]===_0x97e2('0x1d')&&typeof _0x38eba5[_0x97e2('0x1e')]===_0x97e2('0x1d');var _0x239571=_0x4e05ae[_0x97e2('0x1f')];var _0x1d9a3c=_0x1230eb?0x0:_0x38eba5[_0x97e2('0x1c')];var _0x388178=_0x1230eb?_0x4e05ae[_0x97e2('0x1f')]:_0x38eba5[_0x97e2('0x1c')]+_0x38eba5[_0x97e2('0x1e')];var _0x2597fe;if(_0x388178>=_0x239571){_0x388178=_0x239571;_0x2597fe=0xc8;}else{_0x2597fe=0xce;}_0xf88601[_0x97e2('0x19')](_0x2597fe);return _0xf88601[_0x97e2('0x20')](_0x97e2('0x21'),_0x1d9a3c+'-'+_0x388178+'/'+_0x239571)[_0x97e2('0x1b')](_0x4e05ae);}return null;};}function patchUpdates(_0x4e7be4){return function(_0x4c2ca5){try{jsonpatch[_0x97e2('0x22')](_0x4c2ca5,_0x4e7be4,!![]);}catch(_0x127a76){return BPromise[_0x97e2('0x23')](_0x127a76);}return _0x4c2ca5['save']();};}function saveUpdates(_0x41b0b0,_0x24a4e6){return function(_0x2fc185){if(_0x2fc185){return _0x2fc185[_0x97e2('0x24')](_0x41b0b0)[_0x97e2('0x25')](function(_0x48d2c9){return _0x48d2c9;});}return null;};}function removeEntity(_0x1eba91,_0x4d9fdb){return function(_0x432138){if(_0x432138){return _0x432138[_0x97e2('0x26')]()['then'](function(){_0x1eba91[_0x97e2('0x19')](0xcc)[_0x97e2('0x1a')]();});}};}function handleEntityNotFound(_0x5e7752,_0x3de599){return function(_0x2fc9c6){if(!_0x2fc9c6){_0x5e7752['sendStatus'](0x194);}return _0x2fc9c6;};}function handleError(_0x23af27,_0x2c1e39){_0x2c1e39=_0x2c1e39||0x1f4;return function(_0x33d40a){logger[_0x97e2('0x27')](_0x33d40a[_0x97e2('0x28')]);if(_0x33d40a[_0x97e2('0x29')]){delete _0x33d40a[_0x97e2('0x29')];}_0x23af27[_0x97e2('0x19')](_0x2c1e39)[_0x97e2('0x2a')](_0x33d40a);};}exports[_0x97e2('0x2b')]=function(_0x5ee3b2,_0x30c092){var _0x10eae3={},_0xe21343={},_0x152b15={'count':0x0,'rows':[]};var _0x177751=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x555d27){return{'name':_0x555d27[_0x97e2('0x2c')],'type':_0x555d27['type'][_0x97e2('0x2d')]};});_0xe21343[_0x97e2('0x2e')]=_[_0x97e2('0x2f')](_0x177751,_0x97e2('0x29'));_0xe21343[_0x97e2('0x30')]=_['keys'](_0x5ee3b2[_0x97e2('0x30')]);_0xe21343[_0x97e2('0x31')]=_[_0x97e2('0x32')](_0xe21343[_0x97e2('0x2e')],_0xe21343[_0x97e2('0x30')]);_0x10eae3[_0x97e2('0x33')]=_[_0x97e2('0x32')](_0xe21343[_0x97e2('0x2e')],qs[_0x97e2('0x34')](_0x5ee3b2[_0x97e2('0x30')][_0x97e2('0x34')]));_0x10eae3[_0x97e2('0x33')]=_0x10eae3[_0x97e2('0x33')][_0x97e2('0x35')]?_0x10eae3[_0x97e2('0x33')]:_0xe21343[_0x97e2('0x2e')];if(!_0x5ee3b2[_0x97e2('0x30')]['hasOwnProperty'](_0x97e2('0x36'))){_0x10eae3[_0x97e2('0x1e')]=qs[_0x97e2('0x1e')](_0x5ee3b2[_0x97e2('0x30')]['limit']);_0x10eae3['offset']=qs[_0x97e2('0x1c')](_0x5ee3b2[_0x97e2('0x30')]['offset']);}_0x10eae3['order']=qs[_0x97e2('0x37')](_0x5ee3b2[_0x97e2('0x30')][_0x97e2('0x37')]);_0x10eae3['where']=qs[_0x97e2('0x31')](_['pick'](_0x5ee3b2[_0x97e2('0x30')],_0xe21343[_0x97e2('0x31')]),_0x177751);if(_0x5ee3b2[_0x97e2('0x30')]['filter']){_0x10eae3[_0x97e2('0x38')]=_[_0x97e2('0x39')](_0x10eae3[_0x97e2('0x38')],{'$or':_[_0x97e2('0x2f')](_0x177751,function(_0x3ae8d4){if(_0x3ae8d4['type']!=='VIRTUAL'){var _0x4852b8={};_0x4852b8[_0x3ae8d4[_0x97e2('0x29')]]={'$like':'%'+_0x5ee3b2[_0x97e2('0x30')][_0x97e2('0x3a')]+'%'};return _0x4852b8;}})});}_0x10eae3=_['merge']({},_0x10eae3,_0x5ee3b2[_0x97e2('0x3b')]);var _0x451c73={'where':_0x10eae3[_0x97e2('0x38')]};return db[_0x97e2('0x3c')][_0x97e2('0x1f')](_0x451c73)['then'](function(_0x149ddd){_0x152b15[_0x97e2('0x1f')]=_0x149ddd;if(_0x5ee3b2[_0x97e2('0x30')][_0x97e2('0x3d')]){_0x10eae3[_0x97e2('0x3e')]=[{'all':!![]}];}return db[_0x97e2('0x3c')][_0x97e2('0x3f')](_0x10eae3);})[_0x97e2('0x25')](function(_0x1afe76){_0x152b15[_0x97e2('0x40')]=_0x1afe76;return _0x152b15;})[_0x97e2('0x25')](respondWithFilteredResult(_0x30c092,_0x10eae3))['catch'](handleError(_0x30c092,null));};exports[_0x97e2('0x41')]=function(_0x15bce2,_0x30b908){var _0xacf967={'raw':![],'where':{'id':_0x15bce2[_0x97e2('0x42')]['id']}},_0xfe7645={};_0xfe7645['model']=_['keys'](db[_0x97e2('0x3c')]['rawAttributes']);_0xfe7645[_0x97e2('0x30')]=_[_0x97e2('0x43')](_0x15bce2[_0x97e2('0x30')]);_0xfe7645[_0x97e2('0x31')]=_[_0x97e2('0x32')](_0xfe7645[_0x97e2('0x2e')],_0xfe7645[_0x97e2('0x30')]);_0xacf967['attributes']=_[_0x97e2('0x32')](_0xfe7645[_0x97e2('0x2e')],qs['fields'](_0x15bce2[_0x97e2('0x30')][_0x97e2('0x34')]));_0xacf967['attributes']=_0xacf967[_0x97e2('0x33')][_0x97e2('0x35')]?_0xacf967[_0x97e2('0x33')]:_0xfe7645[_0x97e2('0x2e')];if(_0x15bce2['query']['includeAll']){_0xacf967[_0x97e2('0x3e')]=[{'all':!![]}];}_0xacf967=_[_0x97e2('0x39')]({},_0xacf967,_0x15bce2['options']);return db[_0x97e2('0x3c')]['find'](_0xacf967)[_0x97e2('0x25')](handleEntityNotFound(_0x30b908,null))[_0x97e2('0x25')](respondWithResult(_0x30b908,null))[_0x97e2('0x44')](handleError(_0x30b908,null));};exports[_0x97e2('0x45')]=function(_0x24715e,_0x133c88){return db[_0x97e2('0x3c')][_0x97e2('0x45')](_0x24715e[_0x97e2('0x46')],{})[_0x97e2('0x25')](respondWithResult(_0x133c88,0xc9))[_0x97e2('0x44')](handleError(_0x133c88,null));};exports[_0x97e2('0x24')]=function(_0x9a8019,_0x10d2fc){if(_0x9a8019[_0x97e2('0x46')]['id']){delete _0x9a8019[_0x97e2('0x46')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x9a8019['params']['id']}})[_0x97e2('0x25')](handleEntityNotFound(_0x10d2fc,null))[_0x97e2('0x25')](saveUpdates(_0x9a8019[_0x97e2('0x46')],null))[_0x97e2('0x25')](respondWithResult(_0x10d2fc,null))[_0x97e2('0x44')](handleError(_0x10d2fc,null));};exports[_0x97e2('0x26')]=function(_0x98208e,_0x45ad07){return db[_0x97e2('0x3c')][_0x97e2('0x47')]({'where':{'id':_0x98208e['params']['id']}})[_0x97e2('0x25')](handleEntityNotFound(_0x45ad07,null))[_0x97e2('0x25')](removeEntity(_0x45ad07,null))[_0x97e2('0x44')](handleError(_0x45ad07,null));};exports[_0x97e2('0x48')]=function(_0x54f57d,_0x45d1db,_0x261350){var _0x1ff558={};var _0x20e8b9={};var _0x24a461;var _0x3a04d2;return db[_0x97e2('0x3c')]['findOne']({'where':{'id':_0x54f57d['params']['id']}})[_0x97e2('0x25')](handleEntityNotFound(_0x45d1db,null))[_0x97e2('0x25')](function(_0x24cd6c){if(_0x24cd6c){_0x24a461=_0x24cd6c;_0x20e8b9[_0x97e2('0x2e')]=_['keys'](db[_0x97e2('0x49')]['rawAttributes']);_0x20e8b9[_0x97e2('0x30')]=_['keys'](_0x54f57d[_0x97e2('0x30')]);_0x20e8b9[_0x97e2('0x31')]=_[_0x97e2('0x32')](_0x20e8b9['model'],_0x20e8b9[_0x97e2('0x30')]);_0x1ff558['attributes']=_['intersection'](_0x20e8b9[_0x97e2('0x2e')],qs[_0x97e2('0x34')](_0x54f57d['query'][_0x97e2('0x34')]));_0x1ff558[_0x97e2('0x33')]=_0x1ff558[_0x97e2('0x33')][_0x97e2('0x35')]?_0x1ff558[_0x97e2('0x33')]:_0x20e8b9[_0x97e2('0x2e')];_0x1ff558[_0x97e2('0x4a')]=qs[_0x97e2('0x37')](_0x54f57d[_0x97e2('0x30')]['sort']);_0x1ff558['where']=qs[_0x97e2('0x31')](_[_0x97e2('0x4b')](_0x54f57d[_0x97e2('0x30')],_0x20e8b9[_0x97e2('0x31')]));if(_0x54f57d[_0x97e2('0x30')][_0x97e2('0x3a')]){_0x1ff558['where']=_[_0x97e2('0x39')](_0x1ff558[_0x97e2('0x38')],{'$or':_[_0x97e2('0x2f')](_0x1ff558[_0x97e2('0x33')],function(_0x258c41){var _0x4b7e97={};_0x4b7e97[_0x258c41]={'$like':'%'+_0x54f57d[_0x97e2('0x30')][_0x97e2('0x3a')]+'%'};return _0x4b7e97;})});}_0x1ff558=_['merge']({},_0x1ff558,_0x54f57d[_0x97e2('0x3b')]);return _0x24a461[_0x97e2('0x48')](_0x1ff558);}})[_0x97e2('0x25')](function(_0x23dbd5){if(_0x23dbd5){_0x3a04d2=_0x23dbd5['length'];if(!_0x54f57d[_0x97e2('0x30')][_0x97e2('0x4c')](_0x97e2('0x36'))){_0x1ff558[_0x97e2('0x1e')]=qs['limit'](_0x54f57d[_0x97e2('0x30')][_0x97e2('0x1e')]);_0x1ff558[_0x97e2('0x1c')]=qs[_0x97e2('0x1c')](_0x54f57d[_0x97e2('0x30')]['offset']);}return _0x24a461[_0x97e2('0x48')](_0x1ff558);}})[_0x97e2('0x25')](function(_0x1fdd86){if(_0x1fdd86){return _0x1fdd86?{'count':_0x3a04d2,'rows':_0x1fdd86}:null;}})[_0x97e2('0x25')](respondWithResult(_0x45d1db,null))[_0x97e2('0x44')](handleError(_0x45d1db,null));};exports['getSubjects']=function(_0x1fe92a,_0x519fdb,_0x237fc9){var _0x290229={};var _0x4ca507={};var _0x4df70b;var _0x5daa1b;return db['Dynamics365Configuration'][_0x97e2('0x4d')]({'where':{'id':_0x1fe92a[_0x97e2('0x42')]['id']}})[_0x97e2('0x25')](handleEntityNotFound(_0x519fdb,null))[_0x97e2('0x25')](function(_0x351403){if(_0x351403){_0x4df70b=_0x351403;_0x4ca507[_0x97e2('0x2e')]=_[_0x97e2('0x43')](db[_0x97e2('0x49')][_0x97e2('0x4e')]);_0x4ca507[_0x97e2('0x30')]=_[_0x97e2('0x43')](_0x1fe92a[_0x97e2('0x30')]);_0x4ca507[_0x97e2('0x31')]=_[_0x97e2('0x32')](_0x4ca507['model'],_0x4ca507[_0x97e2('0x30')]);_0x290229['attributes']=_[_0x97e2('0x32')](_0x4ca507[_0x97e2('0x2e')],qs[_0x97e2('0x34')](_0x1fe92a[_0x97e2('0x30')][_0x97e2('0x34')]));_0x290229[_0x97e2('0x33')]=_0x290229[_0x97e2('0x33')]['length']?_0x290229[_0x97e2('0x33')]:_0x4ca507[_0x97e2('0x2e')];_0x290229[_0x97e2('0x4a')]=qs['sort'](_0x1fe92a[_0x97e2('0x30')][_0x97e2('0x37')]);_0x290229['where']=qs[_0x97e2('0x31')](_['pick'](_0x1fe92a[_0x97e2('0x30')],_0x4ca507[_0x97e2('0x31')]));if(_0x1fe92a['query']['filter']){_0x290229[_0x97e2('0x38')]=_[_0x97e2('0x39')](_0x290229[_0x97e2('0x38')],{'$or':_[_0x97e2('0x2f')](_0x290229[_0x97e2('0x33')],function(_0x36b9a8){var _0x547c33={};_0x547c33[_0x36b9a8]={'$like':'%'+_0x1fe92a['query'][_0x97e2('0x3a')]+'%'};return _0x547c33;})});}_0x290229=_['merge']({},_0x290229,_0x1fe92a[_0x97e2('0x3b')]);return _0x4df70b[_0x97e2('0x4f')](_0x290229);}})[_0x97e2('0x25')](function(_0x3c47c7){if(_0x3c47c7){_0x5daa1b=_0x3c47c7[_0x97e2('0x35')];if(!_0x1fe92a[_0x97e2('0x30')][_0x97e2('0x4c')]('nolimit')){_0x290229[_0x97e2('0x1e')]=qs['limit'](_0x1fe92a[_0x97e2('0x30')][_0x97e2('0x1e')]);_0x290229['offset']=qs['offset'](_0x1fe92a[_0x97e2('0x30')][_0x97e2('0x1c')]);}return _0x4df70b[_0x97e2('0x4f')](_0x290229);}})['then'](function(_0x46e660){if(_0x46e660){return _0x46e660?{'count':_0x5daa1b,'rows':_0x46e660}:null;}})[_0x97e2('0x25')](respondWithResult(_0x519fdb,null))['catch'](handleError(_0x519fdb,null));};exports['getDescriptions']=function(_0x270c98,_0x40febf,_0x5bde0a){var _0x12e3e6={};var _0x500fd6={};var _0x4a4515;var _0x4e5c61;return db['Dynamics365Configuration'][_0x97e2('0x4d')]({'where':{'id':_0x270c98[_0x97e2('0x42')]['id']}})[_0x97e2('0x25')](handleEntityNotFound(_0x40febf,null))[_0x97e2('0x25')](function(_0x2899b5){if(_0x2899b5){_0x4a4515=_0x2899b5;_0x500fd6[_0x97e2('0x2e')]=_[_0x97e2('0x43')](db[_0x97e2('0x49')][_0x97e2('0x4e')]);_0x500fd6[_0x97e2('0x30')]=_['keys'](_0x270c98[_0x97e2('0x30')]);_0x500fd6['filters']=_[_0x97e2('0x32')](_0x500fd6['model'],_0x500fd6[_0x97e2('0x30')]);_0x12e3e6['attributes']=_['intersection'](_0x500fd6[_0x97e2('0x2e')],qs[_0x97e2('0x34')](_0x270c98[_0x97e2('0x30')][_0x97e2('0x34')]));_0x12e3e6['attributes']=_0x12e3e6[_0x97e2('0x33')][_0x97e2('0x35')]?_0x12e3e6[_0x97e2('0x33')]:_0x500fd6[_0x97e2('0x2e')];_0x12e3e6['order']=qs['sort'](_0x270c98[_0x97e2('0x30')]['sort']);_0x12e3e6[_0x97e2('0x38')]=qs[_0x97e2('0x31')](_[_0x97e2('0x4b')](_0x270c98['query'],_0x500fd6[_0x97e2('0x31')]));if(_0x270c98[_0x97e2('0x30')][_0x97e2('0x3a')]){_0x12e3e6[_0x97e2('0x38')]=_[_0x97e2('0x39')](_0x12e3e6['where'],{'$or':_[_0x97e2('0x2f')](_0x12e3e6[_0x97e2('0x33')],function(_0x49313e){var _0xe1f66e={};_0xe1f66e[_0x49313e]={'$like':'%'+_0x270c98[_0x97e2('0x30')][_0x97e2('0x3a')]+'%'};return _0xe1f66e;})});}_0x12e3e6=_[_0x97e2('0x39')]({},_0x12e3e6,_0x270c98[_0x97e2('0x3b')]);return _0x4a4515['getDescriptions'](_0x12e3e6);}})['then'](function(_0x23923b){if(_0x23923b){_0x4e5c61=_0x23923b[_0x97e2('0x35')];if(!_0x270c98[_0x97e2('0x30')][_0x97e2('0x4c')](_0x97e2('0x36'))){_0x12e3e6[_0x97e2('0x1e')]=qs[_0x97e2('0x1e')](_0x270c98[_0x97e2('0x30')][_0x97e2('0x1e')]);_0x12e3e6['offset']=qs[_0x97e2('0x1c')](_0x270c98[_0x97e2('0x30')][_0x97e2('0x1c')]);}return _0x4a4515[_0x97e2('0x50')](_0x12e3e6);}})[_0x97e2('0x25')](function(_0x18c926){if(_0x18c926){return _0x18c926?{'count':_0x4e5c61,'rows':_0x18c926}:null;}})[_0x97e2('0x25')](respondWithResult(_0x40febf,null))[_0x97e2('0x44')](handleError(_0x40febf,null));}; \ No newline at end of file +var _0x0626=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','sort','pick','filter','where','merge','options','include','findAll','catch','show','params','length','includeAll','create','body','find','getFields','Dynamics365Field','order','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x0626,0x1b4));var _0x6062=function(_0x165cb1,_0x444114){_0x165cb1=_0x165cb1-0x0;var _0x2a4073=_0x0626[_0x165cb1];return _0x2a4073;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6062('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6062('0x1'));var rp=require(_0x6062('0x2'));var moment=require(_0x6062('0x3'));var BPromise=require(_0x6062('0x4'));var Mustache=require(_0x6062('0x5'));var util=require('util');var path=require(_0x6062('0x6'));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(_0x6062('0x7'));var jsforce=require(_0x6062('0x8'));var deskjs=require(_0x6062('0x9'));var toCsv=require(_0x6062('0xa'));var querystring=require(_0x6062('0xb'));var Papa=require(_0x6062('0xc'));var Redis=require(_0x6062('0xd'));var authService=require(_0x6062('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6062('0xf'));var hardwareService=require(_0x6062('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x6062('0x11'));var config=require(_0x6062('0x12'));var licenseUtil=require(_0x6062('0x13'));var db=require(_0x6062('0x14'))['db'];function respondWithStatusCode(_0x2074ed,_0xd1b34e){_0xd1b34e=_0xd1b34e||0xcc;return function(_0x3d9707){if(_0x3d9707){return _0x2074ed[_0x6062('0x15')](_0xd1b34e);}return _0x2074ed['status'](_0xd1b34e)[_0x6062('0x16')]();};}function respondWithResult(_0x46d298,_0x56d4df){_0x56d4df=_0x56d4df||0xc8;return function(_0x5316ae){if(_0x5316ae){return _0x46d298[_0x6062('0x17')](_0x56d4df)[_0x6062('0x18')](_0x5316ae);}};}function respondWithFilteredResult(_0x2fdcd7,_0x220115){return function(_0x70fb2e){if(_0x70fb2e){var _0x386656=typeof _0x220115[_0x6062('0x19')]===_0x6062('0x1a')&&typeof _0x220115[_0x6062('0x1b')]==='undefined';var _0x52c4ef=_0x70fb2e[_0x6062('0x1c')];var _0x5315d9=_0x386656?0x0:_0x220115[_0x6062('0x19')];var _0x17af28=_0x386656?_0x70fb2e['count']:_0x220115[_0x6062('0x19')]+_0x220115[_0x6062('0x1b')];var _0x2030f7;if(_0x17af28>=_0x52c4ef){_0x17af28=_0x52c4ef;_0x2030f7=0xc8;}else{_0x2030f7=0xce;}_0x2fdcd7[_0x6062('0x17')](_0x2030f7);return _0x2fdcd7['set'](_0x6062('0x1d'),_0x5315d9+'-'+_0x17af28+'/'+_0x52c4ef)['json'](_0x70fb2e);}return null;};}function patchUpdates(_0x5ab5f3){return function(_0x3dac6b){try{jsonpatch[_0x6062('0x1e')](_0x3dac6b,_0x5ab5f3,!![]);}catch(_0x51c5d1){return BPromise[_0x6062('0x1f')](_0x51c5d1);}return _0x3dac6b[_0x6062('0x20')]();};}function saveUpdates(_0x5943dc,_0x2acd1d){return function(_0x35acaa){if(_0x35acaa){return _0x35acaa[_0x6062('0x21')](_0x5943dc)[_0x6062('0x22')](function(_0xced4dd){return _0xced4dd;});}return null;};}function removeEntity(_0x500028,_0x54cba5){return function(_0x1718d3){if(_0x1718d3){return _0x1718d3[_0x6062('0x23')]()[_0x6062('0x22')](function(){_0x500028[_0x6062('0x17')](0xcc)[_0x6062('0x16')]();});}};}function handleEntityNotFound(_0x2ccc17,_0x1adfab){return function(_0x328496){if(!_0x328496){_0x2ccc17[_0x6062('0x15')](0x194);}return _0x328496;};}function handleError(_0x162038,_0x1943b2){_0x1943b2=_0x1943b2||0x1f4;return function(_0x2ef37e){logger[_0x6062('0x24')](_0x2ef37e[_0x6062('0x25')]);if(_0x2ef37e[_0x6062('0x26')]){delete _0x2ef37e['name'];}_0x162038['status'](_0x1943b2)['send'](_0x2ef37e);};}exports[_0x6062('0x27')]=function(_0x1d4adf,_0x2316e7){var _0x44d12c={},_0x309841={},_0x38e813={'count':0x0,'rows':[]};var _0x181ccf=_[_0x6062('0x28')](db[_0x6062('0x29')][_0x6062('0x2a')],function(_0x2b012e){return{'name':_0x2b012e[_0x6062('0x2b')],'type':_0x2b012e['type'][_0x6062('0x2c')]};});_0x309841['model']=_['map'](_0x181ccf,'name');_0x309841[_0x6062('0x2d')]=_[_0x6062('0x2e')](_0x1d4adf[_0x6062('0x2d')]);_0x309841[_0x6062('0x2f')]=_[_0x6062('0x30')](_0x309841[_0x6062('0x31')],_0x309841[_0x6062('0x2d')]);_0x44d12c[_0x6062('0x32')]=_[_0x6062('0x30')](_0x309841[_0x6062('0x31')],qs[_0x6062('0x33')](_0x1d4adf[_0x6062('0x2d')][_0x6062('0x33')]));_0x44d12c[_0x6062('0x32')]=_0x44d12c['attributes']['length']?_0x44d12c[_0x6062('0x32')]:_0x309841[_0x6062('0x31')];if(!_0x1d4adf['query']['hasOwnProperty']('nolimit')){_0x44d12c[_0x6062('0x1b')]=qs[_0x6062('0x1b')](_0x1d4adf['query']['limit']);_0x44d12c[_0x6062('0x19')]=qs[_0x6062('0x19')](_0x1d4adf[_0x6062('0x2d')][_0x6062('0x19')]);}_0x44d12c['order']=qs[_0x6062('0x34')](_0x1d4adf['query'][_0x6062('0x34')]);_0x44d12c['where']=qs[_0x6062('0x2f')](_[_0x6062('0x35')](_0x1d4adf['query'],_0x309841[_0x6062('0x2f')]),_0x181ccf);if(_0x1d4adf[_0x6062('0x2d')][_0x6062('0x36')]){_0x44d12c[_0x6062('0x37')]=_[_0x6062('0x38')](_0x44d12c[_0x6062('0x37')],{'$or':_[_0x6062('0x28')](_0x181ccf,function(_0x11685c){if(_0x11685c['type']!=='VIRTUAL'){var _0x33882d={};_0x33882d[_0x11685c[_0x6062('0x26')]]={'$like':'%'+_0x1d4adf['query'][_0x6062('0x36')]+'%'};return _0x33882d;}})});}_0x44d12c=_[_0x6062('0x38')]({},_0x44d12c,_0x1d4adf[_0x6062('0x39')]);var _0x19f116={'where':_0x44d12c['where']};return db['Dynamics365Configuration'][_0x6062('0x1c')](_0x19f116)[_0x6062('0x22')](function(_0x164b51){_0x38e813[_0x6062('0x1c')]=_0x164b51;if(_0x1d4adf[_0x6062('0x2d')]['includeAll']){_0x44d12c[_0x6062('0x3a')]=[{'all':!![]}];}return db[_0x6062('0x29')][_0x6062('0x3b')](_0x44d12c);})['then'](function(_0x1be372){_0x38e813['rows']=_0x1be372;return _0x38e813;})[_0x6062('0x22')](respondWithFilteredResult(_0x2316e7,_0x44d12c))[_0x6062('0x3c')](handleError(_0x2316e7,null));};exports[_0x6062('0x3d')]=function(_0xe19272,_0x4b195f){var _0x47075b={'raw':![],'where':{'id':_0xe19272[_0x6062('0x3e')]['id']}},_0x9b88f8={};_0x9b88f8['model']=_[_0x6062('0x2e')](db[_0x6062('0x29')][_0x6062('0x2a')]);_0x9b88f8[_0x6062('0x2d')]=_['keys'](_0xe19272[_0x6062('0x2d')]);_0x9b88f8[_0x6062('0x2f')]=_[_0x6062('0x30')](_0x9b88f8[_0x6062('0x31')],_0x9b88f8[_0x6062('0x2d')]);_0x47075b[_0x6062('0x32')]=_['intersection'](_0x9b88f8[_0x6062('0x31')],qs[_0x6062('0x33')](_0xe19272['query'][_0x6062('0x33')]));_0x47075b[_0x6062('0x32')]=_0x47075b[_0x6062('0x32')][_0x6062('0x3f')]?_0x47075b['attributes']:_0x9b88f8[_0x6062('0x31')];if(_0xe19272[_0x6062('0x2d')][_0x6062('0x40')]){_0x47075b[_0x6062('0x3a')]=[{'all':!![]}];}_0x47075b=_[_0x6062('0x38')]({},_0x47075b,_0xe19272['options']);return db[_0x6062('0x29')]['find'](_0x47075b)['then'](handleEntityNotFound(_0x4b195f,null))['then'](respondWithResult(_0x4b195f,null))[_0x6062('0x3c')](handleError(_0x4b195f,null));};exports[_0x6062('0x41')]=function(_0x5163c2,_0x52cfab){return db[_0x6062('0x29')]['create'](_0x5163c2[_0x6062('0x42')],{})['then'](respondWithResult(_0x52cfab,0xc9))[_0x6062('0x3c')](handleError(_0x52cfab,null));};exports['update']=function(_0x13882a,_0x4790a8){if(_0x13882a[_0x6062('0x42')]['id']){delete _0x13882a[_0x6062('0x42')]['id'];}return db['Dynamics365Configuration'][_0x6062('0x43')]({'where':{'id':_0x13882a['params']['id']}})['then'](handleEntityNotFound(_0x4790a8,null))['then'](saveUpdates(_0x13882a[_0x6062('0x42')],null))[_0x6062('0x22')](respondWithResult(_0x4790a8,null))[_0x6062('0x3c')](handleError(_0x4790a8,null));};exports[_0x6062('0x23')]=function(_0x16cc3e,_0x221f5f){return db[_0x6062('0x29')]['find']({'where':{'id':_0x16cc3e[_0x6062('0x3e')]['id']}})[_0x6062('0x22')](handleEntityNotFound(_0x221f5f,null))[_0x6062('0x22')](removeEntity(_0x221f5f,null))[_0x6062('0x3c')](handleError(_0x221f5f,null));};exports[_0x6062('0x44')]=function(_0x56000f,_0x31052e,_0x3d376f){var _0x2ef47b={};var _0x34d038={};var _0x115836;var _0x5bfa9c;return db[_0x6062('0x29')]['findOne']({'where':{'id':_0x56000f['params']['id']}})['then'](handleEntityNotFound(_0x31052e,null))[_0x6062('0x22')](function(_0x1b1f89){if(_0x1b1f89){_0x115836=_0x1b1f89;_0x34d038[_0x6062('0x31')]=_[_0x6062('0x2e')](db[_0x6062('0x45')][_0x6062('0x2a')]);_0x34d038[_0x6062('0x2d')]=_[_0x6062('0x2e')](_0x56000f[_0x6062('0x2d')]);_0x34d038[_0x6062('0x2f')]=_['intersection'](_0x34d038[_0x6062('0x31')],_0x34d038[_0x6062('0x2d')]);_0x2ef47b[_0x6062('0x32')]=_[_0x6062('0x30')](_0x34d038['model'],qs[_0x6062('0x33')](_0x56000f['query'][_0x6062('0x33')]));_0x2ef47b[_0x6062('0x32')]=_0x2ef47b['attributes'][_0x6062('0x3f')]?_0x2ef47b[_0x6062('0x32')]:_0x34d038['model'];_0x2ef47b[_0x6062('0x46')]=qs[_0x6062('0x34')](_0x56000f[_0x6062('0x2d')][_0x6062('0x34')]);_0x2ef47b['where']=qs[_0x6062('0x2f')](_[_0x6062('0x35')](_0x56000f[_0x6062('0x2d')],_0x34d038['filters']));if(_0x56000f[_0x6062('0x2d')]['filter']){_0x2ef47b[_0x6062('0x37')]=_[_0x6062('0x38')](_0x2ef47b[_0x6062('0x37')],{'$or':_[_0x6062('0x28')](_0x2ef47b['attributes'],function(_0x29b35b){var _0x17573a={};_0x17573a[_0x29b35b]={'$like':'%'+_0x56000f[_0x6062('0x2d')]['filter']+'%'};return _0x17573a;})});}_0x2ef47b=_[_0x6062('0x38')]({},_0x2ef47b,_0x56000f[_0x6062('0x39')]);return _0x115836[_0x6062('0x44')](_0x2ef47b);}})[_0x6062('0x22')](function(_0x372990){if(_0x372990){_0x5bfa9c=_0x372990[_0x6062('0x3f')];if(!_0x56000f[_0x6062('0x2d')][_0x6062('0x47')](_0x6062('0x48'))){_0x2ef47b[_0x6062('0x1b')]=qs['limit'](_0x56000f[_0x6062('0x2d')][_0x6062('0x1b')]);_0x2ef47b[_0x6062('0x19')]=qs['offset'](_0x56000f['query'][_0x6062('0x19')]);}return _0x115836['getFields'](_0x2ef47b);}})['then'](function(_0x8f5530){if(_0x8f5530){return _0x8f5530?{'count':_0x5bfa9c,'rows':_0x8f5530}:null;}})[_0x6062('0x22')](respondWithResult(_0x31052e,null))[_0x6062('0x3c')](handleError(_0x31052e,null));};exports[_0x6062('0x49')]=function(_0x2dc652,_0x30a158,_0x2592ce){var _0x154cfc={};var _0x2cbfb9={};var _0x1a1263;var _0x4c04c8;return db[_0x6062('0x29')]['findOne']({'where':{'id':_0x2dc652[_0x6062('0x3e')]['id']}})['then'](handleEntityNotFound(_0x30a158,null))['then'](function(_0x1d06bd){if(_0x1d06bd){_0x1a1263=_0x1d06bd;_0x2cbfb9[_0x6062('0x31')]=_[_0x6062('0x2e')](db[_0x6062('0x45')]['rawAttributes']);_0x2cbfb9[_0x6062('0x2d')]=_[_0x6062('0x2e')](_0x2dc652['query']);_0x2cbfb9[_0x6062('0x2f')]=_[_0x6062('0x30')](_0x2cbfb9[_0x6062('0x31')],_0x2cbfb9[_0x6062('0x2d')]);_0x154cfc['attributes']=_[_0x6062('0x30')](_0x2cbfb9[_0x6062('0x31')],qs['fields'](_0x2dc652['query'][_0x6062('0x33')]));_0x154cfc[_0x6062('0x32')]=_0x154cfc[_0x6062('0x32')]['length']?_0x154cfc['attributes']:_0x2cbfb9[_0x6062('0x31')];_0x154cfc['order']=qs[_0x6062('0x34')](_0x2dc652['query'][_0x6062('0x34')]);_0x154cfc[_0x6062('0x37')]=qs[_0x6062('0x2f')](_[_0x6062('0x35')](_0x2dc652[_0x6062('0x2d')],_0x2cbfb9[_0x6062('0x2f')]));if(_0x2dc652[_0x6062('0x2d')][_0x6062('0x36')]){_0x154cfc['where']=_['merge'](_0x154cfc['where'],{'$or':_[_0x6062('0x28')](_0x154cfc[_0x6062('0x32')],function(_0x27cdbf){var _0x405198={};_0x405198[_0x27cdbf]={'$like':'%'+_0x2dc652[_0x6062('0x2d')]['filter']+'%'};return _0x405198;})});}_0x154cfc=_[_0x6062('0x38')]({},_0x154cfc,_0x2dc652['options']);return _0x1a1263[_0x6062('0x49')](_0x154cfc);}})[_0x6062('0x22')](function(_0x46d5dc){if(_0x46d5dc){_0x4c04c8=_0x46d5dc[_0x6062('0x3f')];if(!_0x2dc652[_0x6062('0x2d')][_0x6062('0x47')](_0x6062('0x48'))){_0x154cfc['limit']=qs['limit'](_0x2dc652['query']['limit']);_0x154cfc[_0x6062('0x19')]=qs[_0x6062('0x19')](_0x2dc652[_0x6062('0x2d')][_0x6062('0x19')]);}return _0x1a1263[_0x6062('0x49')](_0x154cfc);}})['then'](function(_0xfeb0ff){if(_0xfeb0ff){return _0xfeb0ff?{'count':_0x4c04c8,'rows':_0xfeb0ff}:null;}})[_0x6062('0x22')](respondWithResult(_0x30a158,null))[_0x6062('0x3c')](handleError(_0x30a158,null));};exports['getDescriptions']=function(_0x12df03,_0x1e5bf7,_0x3c3f85){var _0x3940c5={};var _0x462a25={};var _0x27899d;var _0x5daa11;return db[_0x6062('0x29')][_0x6062('0x4a')]({'where':{'id':_0x12df03['params']['id']}})['then'](handleEntityNotFound(_0x1e5bf7,null))[_0x6062('0x22')](function(_0xd93c77){if(_0xd93c77){_0x27899d=_0xd93c77;_0x462a25[_0x6062('0x31')]=_['keys'](db[_0x6062('0x45')][_0x6062('0x2a')]);_0x462a25[_0x6062('0x2d')]=_[_0x6062('0x2e')](_0x12df03[_0x6062('0x2d')]);_0x462a25['filters']=_[_0x6062('0x30')](_0x462a25[_0x6062('0x31')],_0x462a25[_0x6062('0x2d')]);_0x3940c5[_0x6062('0x32')]=_[_0x6062('0x30')](_0x462a25['model'],qs[_0x6062('0x33')](_0x12df03[_0x6062('0x2d')][_0x6062('0x33')]));_0x3940c5[_0x6062('0x32')]=_0x3940c5[_0x6062('0x32')]['length']?_0x3940c5[_0x6062('0x32')]:_0x462a25[_0x6062('0x31')];_0x3940c5['order']=qs['sort'](_0x12df03[_0x6062('0x2d')][_0x6062('0x34')]);_0x3940c5[_0x6062('0x37')]=qs[_0x6062('0x2f')](_[_0x6062('0x35')](_0x12df03[_0x6062('0x2d')],_0x462a25[_0x6062('0x2f')]));if(_0x12df03[_0x6062('0x2d')][_0x6062('0x36')]){_0x3940c5[_0x6062('0x37')]=_[_0x6062('0x38')](_0x3940c5[_0x6062('0x37')],{'$or':_[_0x6062('0x28')](_0x3940c5[_0x6062('0x32')],function(_0x12403b){var _0x509336={};_0x509336[_0x12403b]={'$like':'%'+_0x12df03['query'][_0x6062('0x36')]+'%'};return _0x509336;})});}_0x3940c5=_[_0x6062('0x38')]({},_0x3940c5,_0x12df03[_0x6062('0x39')]);return _0x27899d[_0x6062('0x4b')](_0x3940c5);}})[_0x6062('0x22')](function(_0x1b8605){if(_0x1b8605){_0x5daa11=_0x1b8605[_0x6062('0x3f')];if(!_0x12df03[_0x6062('0x2d')][_0x6062('0x47')](_0x6062('0x48'))){_0x3940c5[_0x6062('0x1b')]=qs[_0x6062('0x1b')](_0x12df03[_0x6062('0x2d')][_0x6062('0x1b')]);_0x3940c5['offset']=qs[_0x6062('0x19')](_0x12df03[_0x6062('0x2d')]['offset']);}return _0x27899d['getDescriptions'](_0x3940c5);}})[_0x6062('0x22')](function(_0x5deb9b){if(_0x5deb9b){return _0x5deb9b?{'count':_0x5daa11,'rows':_0x5deb9b}:null;}})[_0x6062('0x22')](respondWithResult(_0x1e5bf7,null))[_0x6062('0x3c')](handleError(_0x1e5bf7,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5668227..1dfad6f 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 _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x008c,0x188));var _0xc008=function(_0x5480fd,_0x46600d){_0x5480fd=_0x5480fd-0x0;var _0x2ec312=_0x008c[_0x5480fd];return _0x2ec312;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x11b218,_0x40a115){var _0x36f4c5=function(_0x23f01e){while(--_0x23f01e){_0x11b218['push'](_0x11b218['shift']());}};_0x36f4c5(++_0x40a115);}(_0x9f62,0x154));var _0x29f6=function(_0x2a7f70,_0x4a78a7){_0x2a7f70=_0x2a7f70-0x0;var _0x4427df=_0x9f62[_0x2a7f70];return _0x4427df;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 77052ca..7db71d4 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 _0xc9d0=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4ffeaf,_0x4f6532){var _0x555898=function(_0x46fa33){while(--_0x46fa33){_0x4ffeaf['push'](_0x4ffeaf['shift']());}};_0x555898(++_0x4f6532);}(_0xc9d0,0x124));var _0x0c9d=function(_0x195b11,_0x1dc5aa){_0x195b11=_0x195b11-0x0;var _0x1e4d86=_0xc9d0[_0x195b11];return _0x1e4d86;};'use strict';var _=require(_0x0c9d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0c9d('0x1'));var rs=require(_0x0c9d('0x2'));var fs=require('fs');var Redis=require(_0x0c9d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c9d('0x4'));var logger=require(_0x0c9d('0x5'))('rpc');var config=require(_0x0c9d('0x6'));var jayson=require(_0x0c9d('0x7'));var client=jayson[_0x0c9d('0x8')][_0x0c9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a5990,_0x142bed,_0x88d0b8){return new BPromise(function(_0x4cee5a,_0x1e1c5a){return client[_0x0c9d('0xa')](_0x5a5990,_0x88d0b8)[_0x0c9d('0xb')](function(_0x3d8e91){logger['info'](_0x0c9d('0xc'),_0x142bed,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x142bed,_0x0c9d('0xd'),JSON[_0x0c9d('0xe')](_0x3d8e91));if(_0x3d8e91['error']){if(_0x3d8e91['error'][_0x0c9d('0xf')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x142bed,_0x3d8e91[_0x0c9d('0x10')][_0x0c9d('0x11')]);return _0x1e1c5a(_0x3d8e91[_0x0c9d('0x10')]['message']);}logger[_0x0c9d('0x10')](_0x0c9d('0xc'),_0x142bed,_0x3d8e91[_0x0c9d('0x10')][_0x0c9d('0x11')]);return _0x4cee5a(_0x3d8e91['error']['message']);}else{logger['info'](_0x0c9d('0xc'),_0x142bed,'request\x20sent');_0x4cee5a(_0x3d8e91['result'][_0x0c9d('0x11')]);}})[_0x0c9d('0x12')](function(_0x252f38){logger[_0x0c9d('0x10')](_0x0c9d('0xc'),_0x142bed,_0x252f38);_0x1e1c5a(_0x252f38);});});} \ No newline at end of file +var _0x59a3=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x59a3,0x141));var _0x359a=function(_0xea10da,_0x698384){_0xea10da=_0xea10da-0x0;var _0x396849=_0x59a3[_0xea10da];return _0x396849;};'use strict';var _=require(_0x359a('0x0'));var util=require(_0x359a('0x1'));var moment=require(_0x359a('0x2'));var BPromise=require(_0x359a('0x3'));var rs=require(_0x359a('0x4'));var fs=require('fs');var Redis=require(_0x359a('0x5'));var db=require(_0x359a('0x6'))['db'];var utils=require(_0x359a('0x7'));var logger=require('../../config/logger')(_0x359a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x359a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e9aee,_0xdb4f43,_0x31b1d5){return new BPromise(function(_0x5971bd,_0x4c1864){return client['request'](_0x1e9aee,_0x31b1d5)['then'](function(_0x280755){logger[_0x359a('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0xdb4f43,_0x359a('0xb'));logger[_0x359a('0xc')](_0x359a('0xd'),_0xdb4f43,_0x359a('0xb'),JSON[_0x359a('0xe')](_0x280755));if(_0x280755[_0x359a('0xf')]){if(_0x280755[_0x359a('0xf')][_0x359a('0x10')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xdb4f43,_0x280755[_0x359a('0xf')][_0x359a('0x11')]);return _0x4c1864(_0x280755[_0x359a('0xf')][_0x359a('0x11')]);}logger[_0x359a('0xf')](_0x359a('0x12'),_0xdb4f43,_0x280755[_0x359a('0xf')]['message']);return _0x5971bd(_0x280755[_0x359a('0xf')][_0x359a('0x11')]);}else{logger['info'](_0x359a('0x12'),_0xdb4f43,_0x359a('0xb'));_0x5971bd(_0x280755['result']['message']);}})[_0x359a('0x13')](function(_0x3c62fb){logger['error'](_0x359a('0x12'),_0xdb4f43,_0x3c62fb);_0x4c1864(_0x3c62fb);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index b353fc0..9536970 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 _0xe777=['express','Router','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index','get','post','put','/:id','update','delete','destroy','exports','path','connect-timeout'];(function(_0x57adf1,_0x4ead12){var _0xcec554=function(_0x8a9579){while(--_0x8a9579){_0x57adf1['push'](_0x57adf1['shift']());}};_0xcec554(++_0x4ead12);}(_0xe777,0xae));var _0x7e77=function(_0x30d15a,_0x3aa865){_0x30d15a=_0x30d15a-0x0;var _0x4e17be=_0xe777[_0x30d15a];return _0x4e17be;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e77('0x0'));var timeout=require(_0x7e77('0x1'));var express=require(_0x7e77('0x2'));var router=express[_0x7e77('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7e77('0x4'));var config=require('../../config/environment');var controller=require(_0x7e77('0x5'));router['get']('/',auth[_0x7e77('0x6')](),controller[_0x7e77('0x7')]);router[_0x7e77('0x8')]('/:id',auth[_0x7e77('0x6')](),controller['show']);router[_0x7e77('0x9')]('/',auth[_0x7e77('0x6')](),controller['create']);router[_0x7e77('0xa')](_0x7e77('0xb'),auth['isAuthenticated'](),controller[_0x7e77('0xc')]);router[_0x7e77('0xd')](_0x7e77('0xb'),auth[_0x7e77('0x6')](),controller[_0x7e77('0xe')]);module[_0x7e77('0xf')]=router; \ No newline at end of file +var _0x46ca=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x2e883d,_0x497040){var _0x41939a=function(_0x397967){while(--_0x397967){_0x2e883d['push'](_0x2e883d['shift']());}};_0x41939a(++_0x497040);}(_0x46ca,0x146));var _0xa46c=function(_0x126264,_0x47e262){_0x126264=_0x126264-0x0;var _0x5e1b30=_0x46ca[_0x126264];return _0x5e1b30;};'use strict';var multer=require(_0xa46c('0x0'));var util=require(_0xa46c('0x1'));var path=require(_0xa46c('0x2'));var timeout=require(_0xa46c('0x3'));var express=require(_0xa46c('0x4'));var router=express[_0xa46c('0x5')]();var fs_extra=require(_0xa46c('0x6'));var auth=require(_0xa46c('0x7'));var interaction=require(_0xa46c('0x8'));var config=require(_0xa46c('0x9'));var controller=require('./intDynamics365Field.controller');router[_0xa46c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa46c('0xb'),auth[_0xa46c('0xc')](),controller[_0xa46c('0xd')]);router[_0xa46c('0xe')]('/',auth['isAuthenticated'](),controller[_0xa46c('0xf')]);router['put'](_0xa46c('0xb'),auth[_0xa46c('0xc')](),controller[_0xa46c('0x10')]);router[_0xa46c('0x11')](_0xa46c('0xb'),auth[_0xa46c('0xc')](),controller[_0xa46c('0x12')]);module[_0xa46c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 75ecd79..db5441d 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 _0x2e6f=['string','picklist','STRING','variable','customVariable','exports','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2e6f,0x91));var _0xf2e6=function(_0x3d47d6,_0x499952){_0x3d47d6=_0x3d47d6-0x0;var _0xf67c7c=_0x2e6f[_0x3d47d6];return _0xf67c7c;};'use strict';var Sequelize=require('sequelize');module[_0xf2e6('0x0')]={'type':{'type':Sequelize[_0xf2e6('0x1')](_0xf2e6('0x2'),'variable','customVariable','keyValue',_0xf2e6('0x3')),'defaultValue':_0xf2e6('0x2')},'content':{'type':Sequelize[_0xf2e6('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf2e6('0x1')](_0xf2e6('0x2'),_0xf2e6('0x5'),_0xf2e6('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf2e6('0x4')]},'nameField':{'type':Sequelize[_0xf2e6('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x910c=['keyValue','picklist','string','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','variable'];(function(_0x5b3d99,_0x37fb9a){var _0x1fb4ee=function(_0x466b20){while(--_0x466b20){_0x5b3d99['push'](_0x5b3d99['shift']());}};_0x1fb4ee(++_0x37fb9a);}(_0x910c,0x129));var _0xc910=function(_0x463376,_0x13871c){_0x463376=_0x463376-0x0;var _0x336ccd=_0x910c[_0x463376];return _0x336ccd;};'use strict';var Sequelize=require(_0xc910('0x0'));module[_0xc910('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xc910('0x2'),'customVariable',_0xc910('0x3'),_0xc910('0x4')),'defaultValue':_0xc910('0x5')},'content':{'type':Sequelize[_0xc910('0x6')]},'key':{'type':Sequelize[_0xc910('0x6')]},'keyType':{'type':Sequelize[_0xc910('0x7')]('string',_0xc910('0x2'),_0xc910('0x8'))},'keyContent':{'type':Sequelize[_0xc910('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc910('0x6')]},'customField':{'type':Sequelize[_0xc910('0x9')],'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 d7f3666..6da116d 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 _0x0952=['destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x0952,0x6e));var _0x2095=function(_0x2b91ee,_0x38f99b){_0x2b91ee=_0x2b91ee-0x0;var _0x455f94=_0x0952[_0x2b91ee];return _0x455f94;};'use strict';var emlformat=require(_0x2095('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2095('0x1'));var jsonpatch=require(_0x2095('0x2'));var rp=require(_0x2095('0x3'));var moment=require(_0x2095('0x4'));var BPromise=require(_0x2095('0x5'));var Mustache=require(_0x2095('0x6'));var util=require(_0x2095('0x7'));var path=require(_0x2095('0x8'));var sox=require(_0x2095('0x9'));var csv=require(_0x2095('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2095('0xb'));var _=require('lodash');var squel=require(_0x2095('0xc'));var crypto=require(_0x2095('0xd'));var jsforce=require(_0x2095('0xe'));var deskjs=require(_0x2095('0xf'));var toCsv=require(_0x2095('0xa'));var querystring=require(_0x2095('0x10'));var Papa=require('papaparse');var Redis=require(_0x2095('0x11'));var authService=require(_0x2095('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2095('0x13'));var hardwareService=require(_0x2095('0x14'));var logger=require('../../config/logger')(_0x2095('0x15'));var utils=require(_0x2095('0x16'));var config=require(_0x2095('0x17'));var licenseUtil=require(_0x2095('0x18'));var db=require(_0x2095('0x19'))['db'];function respondWithStatusCode(_0x3792c2,_0x36d9e1){_0x36d9e1=_0x36d9e1||0xcc;return function(_0x4a2aa8){if(_0x4a2aa8){return _0x3792c2[_0x2095('0x1a')](_0x36d9e1);}return _0x3792c2[_0x2095('0x1b')](_0x36d9e1)[_0x2095('0x1c')]();};}function respondWithResult(_0x373cf7,_0x5f1846){_0x5f1846=_0x5f1846||0xc8;return function(_0x21f3d0){if(_0x21f3d0){return _0x373cf7['status'](_0x5f1846)[_0x2095('0x1d')](_0x21f3d0);}};}function respondWithFilteredResult(_0x4ffb94,_0x24e2b8){return function(_0x2ed6db){if(_0x2ed6db){var _0x9d5650=typeof _0x24e2b8[_0x2095('0x1e')]==='undefined'&&typeof _0x24e2b8[_0x2095('0x1f')]===_0x2095('0x20');var _0x12ad62=_0x2ed6db['count'];var _0x298e18=_0x9d5650?0x0:_0x24e2b8[_0x2095('0x1e')];var _0x33209e=_0x9d5650?_0x2ed6db[_0x2095('0x21')]:_0x24e2b8[_0x2095('0x1e')]+_0x24e2b8[_0x2095('0x1f')];var _0x183512;if(_0x33209e>=_0x12ad62){_0x33209e=_0x12ad62;_0x183512=0xc8;}else{_0x183512=0xce;}_0x4ffb94[_0x2095('0x1b')](_0x183512);return _0x4ffb94[_0x2095('0x22')]('Content-Range',_0x298e18+'-'+_0x33209e+'/'+_0x12ad62)[_0x2095('0x1d')](_0x2ed6db);}return null;};}function patchUpdates(_0x5f2c8f){return function(_0x2d22c3){try{jsonpatch[_0x2095('0x23')](_0x2d22c3,_0x5f2c8f,!![]);}catch(_0x24cd5c){return BPromise[_0x2095('0x24')](_0x24cd5c);}return _0x2d22c3['save']();};}function saveUpdates(_0x2d6221,_0x1bc58a){return function(_0xdd77bb){if(_0xdd77bb){return _0xdd77bb['update'](_0x2d6221)[_0x2095('0x25')](function(_0x324d1d){return _0x324d1d;});}return null;};}function removeEntity(_0x431a9c,_0x4112fa){return function(_0x592945){if(_0x592945){return _0x592945[_0x2095('0x26')]()[_0x2095('0x25')](function(){_0x431a9c[_0x2095('0x1b')](0xcc)[_0x2095('0x1c')]();});}};}function handleEntityNotFound(_0x47d7f1,_0x42f919){return function(_0x33492b){if(!_0x33492b){_0x47d7f1[_0x2095('0x1a')](0x194);}return _0x33492b;};}function handleError(_0x1b8550,_0x275e4d){_0x275e4d=_0x275e4d||0x1f4;return function(_0x56b8ec){logger[_0x2095('0x27')](_0x56b8ec[_0x2095('0x28')]);if(_0x56b8ec[_0x2095('0x29')]){delete _0x56b8ec[_0x2095('0x29')];}_0x1b8550[_0x2095('0x1b')](_0x275e4d)[_0x2095('0x2a')](_0x56b8ec);};}exports[_0x2095('0x2b')]=function(_0x1ff6bf,_0x3c9771){var _0x4c9b2c={},_0x5c588d={},_0x25c9b2={'count':0x0,'rows':[]};var _0x21ace6=_[_0x2095('0x2c')](db[_0x2095('0x2d')][_0x2095('0x2e')],function(_0x1a86aa){return{'name':_0x1a86aa[_0x2095('0x2f')],'type':_0x1a86aa['type']['key']};});_0x5c588d[_0x2095('0x30')]=_[_0x2095('0x2c')](_0x21ace6,_0x2095('0x29'));_0x5c588d[_0x2095('0x31')]=_[_0x2095('0x32')](_0x1ff6bf[_0x2095('0x31')]);_0x5c588d[_0x2095('0x33')]=_[_0x2095('0x34')](_0x5c588d[_0x2095('0x30')],_0x5c588d['query']);_0x4c9b2c[_0x2095('0x35')]=_[_0x2095('0x34')](_0x5c588d['model'],qs[_0x2095('0x36')](_0x1ff6bf[_0x2095('0x31')][_0x2095('0x36')]));_0x4c9b2c[_0x2095('0x35')]=_0x4c9b2c[_0x2095('0x35')][_0x2095('0x37')]?_0x4c9b2c['attributes']:_0x5c588d['model'];if(!_0x1ff6bf[_0x2095('0x31')][_0x2095('0x38')]('nolimit')){_0x4c9b2c[_0x2095('0x1f')]=qs[_0x2095('0x1f')](_0x1ff6bf[_0x2095('0x31')][_0x2095('0x1f')]);_0x4c9b2c['offset']=qs[_0x2095('0x1e')](_0x1ff6bf[_0x2095('0x31')][_0x2095('0x1e')]);}_0x4c9b2c['order']=qs['sort'](_0x1ff6bf[_0x2095('0x31')][_0x2095('0x39')]);_0x4c9b2c[_0x2095('0x3a')]=qs[_0x2095('0x33')](_[_0x2095('0x3b')](_0x1ff6bf[_0x2095('0x31')],_0x5c588d[_0x2095('0x33')]),_0x21ace6);if(_0x1ff6bf[_0x2095('0x31')][_0x2095('0x3c')]){_0x4c9b2c[_0x2095('0x3a')]=_[_0x2095('0x3d')](_0x4c9b2c[_0x2095('0x3a')],{'$or':_[_0x2095('0x2c')](_0x21ace6,function(_0x3265d5){if(_0x3265d5[_0x2095('0x3e')]!=='VIRTUAL'){var _0x48f73f={};_0x48f73f[_0x3265d5['name']]={'$like':'%'+_0x1ff6bf['query']['filter']+'%'};return _0x48f73f;}})});}_0x4c9b2c=_['merge']({},_0x4c9b2c,_0x1ff6bf[_0x2095('0x3f')]);var _0x3a569f={'where':_0x4c9b2c[_0x2095('0x3a')]};return db[_0x2095('0x2d')][_0x2095('0x21')](_0x3a569f)[_0x2095('0x25')](function(_0x4ba95c){_0x25c9b2[_0x2095('0x21')]=_0x4ba95c;if(_0x1ff6bf['query'][_0x2095('0x40')]){_0x4c9b2c[_0x2095('0x41')]=[{'all':!![]}];}return db[_0x2095('0x2d')]['findAll'](_0x4c9b2c);})[_0x2095('0x25')](function(_0x4159c2){_0x25c9b2[_0x2095('0x42')]=_0x4159c2;return _0x25c9b2;})[_0x2095('0x25')](respondWithFilteredResult(_0x3c9771,_0x4c9b2c))[_0x2095('0x43')](handleError(_0x3c9771,null));};exports[_0x2095('0x44')]=function(_0x1907ec,_0x13883d){var _0x26c4f4={'raw':!![],'where':{'id':_0x1907ec[_0x2095('0x45')]['id']}},_0x45f130={};_0x45f130[_0x2095('0x30')]=_[_0x2095('0x32')](db['Dynamics365Field'][_0x2095('0x2e')]);_0x45f130[_0x2095('0x31')]=_['keys'](_0x1907ec[_0x2095('0x31')]);_0x45f130[_0x2095('0x33')]=_[_0x2095('0x34')](_0x45f130[_0x2095('0x30')],_0x45f130[_0x2095('0x31')]);_0x26c4f4[_0x2095('0x35')]=_[_0x2095('0x34')](_0x45f130[_0x2095('0x30')],qs[_0x2095('0x36')](_0x1907ec[_0x2095('0x31')][_0x2095('0x36')]));_0x26c4f4[_0x2095('0x35')]=_0x26c4f4[_0x2095('0x35')][_0x2095('0x37')]?_0x26c4f4[_0x2095('0x35')]:_0x45f130[_0x2095('0x30')];if(_0x1907ec[_0x2095('0x31')]['includeAll']){_0x26c4f4[_0x2095('0x41')]=[{'all':!![]}];}_0x26c4f4=_[_0x2095('0x3d')]({},_0x26c4f4,_0x1907ec['options']);return db[_0x2095('0x2d')][_0x2095('0x46')](_0x26c4f4)[_0x2095('0x25')](handleEntityNotFound(_0x13883d,null))[_0x2095('0x25')](respondWithResult(_0x13883d,null))['catch'](handleError(_0x13883d,null));};exports[_0x2095('0x47')]=function(_0x440f7c,_0x57c539){return db['Dynamics365Field'][_0x2095('0x47')](_0x440f7c[_0x2095('0x48')],{})[_0x2095('0x25')](respondWithResult(_0x57c539,0xc9))['catch'](handleError(_0x57c539,null));};exports[_0x2095('0x49')]=function(_0x382be3,_0x25c090){if(_0x382be3[_0x2095('0x48')]['id']){delete _0x382be3[_0x2095('0x48')]['id'];}return db['Dynamics365Field'][_0x2095('0x46')]({'where':{'id':_0x382be3[_0x2095('0x45')]['id']}})[_0x2095('0x25')](handleEntityNotFound(_0x25c090,null))[_0x2095('0x25')](saveUpdates(_0x382be3[_0x2095('0x48')],null))['then'](respondWithResult(_0x25c090,null))[_0x2095('0x43')](handleError(_0x25c090,null));};exports[_0x2095('0x26')]=function(_0x49e901,_0x821a65){return db[_0x2095('0x2d')][_0x2095('0x46')]({'where':{'id':_0x49e901[_0x2095('0x45')]['id']}})[_0x2095('0x25')](handleEntityNotFound(_0x821a65,null))[_0x2095('0x25')](removeEntity(_0x821a65,null))[_0x2095('0x43')](handleError(_0x821a65,null));}; \ No newline at end of file +var _0x536c=['reject','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','catch','show','params','find','create','body','update','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x57fd01,_0x5cf253){var _0x37984b=function(_0x1fca44){while(--_0x1fca44){_0x57fd01['push'](_0x57fd01['shift']());}};_0x37984b(++_0x5cf253);}(_0x536c,0x180));var _0xc536=function(_0x221fe1,_0x2da104){_0x221fe1=_0x221fe1-0x0;var _0x4e1767=_0x536c[_0x221fe1];return _0x4e1767;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc536('0x0'));var jsonpatch=require(_0xc536('0x1'));var rp=require(_0xc536('0x2'));var moment=require('moment');var BPromise=require(_0xc536('0x3'));var Mustache=require(_0xc536('0x4'));var util=require(_0xc536('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc536('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc536('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc536('0x8'));var jsforce=require(_0xc536('0x9'));var deskjs=require(_0xc536('0xa'));var toCsv=require(_0xc536('0x6'));var querystring=require(_0xc536('0xb'));var Papa=require(_0xc536('0xc'));var Redis=require('ioredis');var authService=require(_0xc536('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc536('0xe'));var hardwareService=require(_0xc536('0xf'));var logger=require(_0xc536('0x10'))('api');var utils=require(_0xc536('0x11'));var config=require(_0xc536('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc536('0x13'))['db'];function respondWithStatusCode(_0x1f7f7e,_0x21f71f){_0x21f71f=_0x21f71f||0xcc;return function(_0x50e048){if(_0x50e048){return _0x1f7f7e[_0xc536('0x14')](_0x21f71f);}return _0x1f7f7e[_0xc536('0x15')](_0x21f71f)[_0xc536('0x16')]();};}function respondWithResult(_0x4143b7,_0x4e468f){_0x4e468f=_0x4e468f||0xc8;return function(_0x1d8240){if(_0x1d8240){return _0x4143b7['status'](_0x4e468f)[_0xc536('0x17')](_0x1d8240);}};}function respondWithFilteredResult(_0x18069a,_0x1d49cf){return function(_0x412a35){if(_0x412a35){var _0x538566=typeof _0x1d49cf[_0xc536('0x18')]===_0xc536('0x19')&&typeof _0x1d49cf[_0xc536('0x1a')]===_0xc536('0x19');var _0x477c88=_0x412a35[_0xc536('0x1b')];var _0xe00d28=_0x538566?0x0:_0x1d49cf[_0xc536('0x18')];var _0x4dd2d2=_0x538566?_0x412a35[_0xc536('0x1b')]:_0x1d49cf[_0xc536('0x18')]+_0x1d49cf[_0xc536('0x1a')];var _0x36d0f0;if(_0x4dd2d2>=_0x477c88){_0x4dd2d2=_0x477c88;_0x36d0f0=0xc8;}else{_0x36d0f0=0xce;}_0x18069a[_0xc536('0x15')](_0x36d0f0);return _0x18069a[_0xc536('0x1c')]('Content-Range',_0xe00d28+'-'+_0x4dd2d2+'/'+_0x477c88)[_0xc536('0x17')](_0x412a35);}return null;};}function patchUpdates(_0x315bfc){return function(_0x401ecd){try{jsonpatch[_0xc536('0x1d')](_0x401ecd,_0x315bfc,!![]);}catch(_0x32651c){return BPromise[_0xc536('0x1e')](_0x32651c);}return _0x401ecd[_0xc536('0x1f')]();};}function saveUpdates(_0x400827,_0x243ee6){return function(_0x2dc1a7){if(_0x2dc1a7){return _0x2dc1a7['update'](_0x400827)['then'](function(_0x46accc){return _0x46accc;});}return null;};}function removeEntity(_0x4bd4f4,_0x35dce8){return function(_0x855c63){if(_0x855c63){return _0x855c63[_0xc536('0x20')]()[_0xc536('0x21')](function(){_0x4bd4f4[_0xc536('0x15')](0xcc)[_0xc536('0x16')]();});}};}function handleEntityNotFound(_0x4b890d,_0x14907b){return function(_0x986e97){if(!_0x986e97){_0x4b890d[_0xc536('0x14')](0x194);}return _0x986e97;};}function handleError(_0x10dfca,_0x48302a){_0x48302a=_0x48302a||0x1f4;return function(_0x4628f3){logger[_0xc536('0x22')](_0x4628f3[_0xc536('0x23')]);if(_0x4628f3[_0xc536('0x24')]){delete _0x4628f3[_0xc536('0x24')];}_0x10dfca['status'](_0x48302a)['send'](_0x4628f3);};}exports[_0xc536('0x25')]=function(_0x3257ca,_0x52c60c){var _0x103602={},_0x313a9d={},_0x4419b4={'count':0x0,'rows':[]};var _0x198885=_[_0xc536('0x26')](db['Dynamics365Field'][_0xc536('0x27')],function(_0x918b26){return{'name':_0x918b26[_0xc536('0x28')],'type':_0x918b26[_0xc536('0x29')][_0xc536('0x2a')]};});_0x313a9d[_0xc536('0x2b')]=_[_0xc536('0x26')](_0x198885,'name');_0x313a9d[_0xc536('0x2c')]=_[_0xc536('0x2d')](_0x3257ca[_0xc536('0x2c')]);_0x313a9d[_0xc536('0x2e')]=_['intersection'](_0x313a9d['model'],_0x313a9d['query']);_0x103602[_0xc536('0x2f')]=_[_0xc536('0x30')](_0x313a9d[_0xc536('0x2b')],qs[_0xc536('0x31')](_0x3257ca['query'][_0xc536('0x31')]));_0x103602[_0xc536('0x2f')]=_0x103602[_0xc536('0x2f')][_0xc536('0x32')]?_0x103602[_0xc536('0x2f')]:_0x313a9d['model'];if(!_0x3257ca[_0xc536('0x2c')]['hasOwnProperty'](_0xc536('0x33'))){_0x103602[_0xc536('0x1a')]=qs[_0xc536('0x1a')](_0x3257ca['query']['limit']);_0x103602[_0xc536('0x18')]=qs[_0xc536('0x18')](_0x3257ca[_0xc536('0x2c')]['offset']);}_0x103602[_0xc536('0x34')]=qs[_0xc536('0x35')](_0x3257ca[_0xc536('0x2c')][_0xc536('0x35')]);_0x103602[_0xc536('0x36')]=qs['filters'](_['pick'](_0x3257ca[_0xc536('0x2c')],_0x313a9d[_0xc536('0x2e')]),_0x198885);if(_0x3257ca['query']['filter']){_0x103602[_0xc536('0x36')]=_[_0xc536('0x37')](_0x103602[_0xc536('0x36')],{'$or':_[_0xc536('0x26')](_0x198885,function(_0x1c9caa){if(_0x1c9caa[_0xc536('0x29')]!==_0xc536('0x38')){var _0x5b96d1={};_0x5b96d1[_0x1c9caa['name']]={'$like':'%'+_0x3257ca[_0xc536('0x2c')]['filter']+'%'};return _0x5b96d1;}})});}_0x103602=_[_0xc536('0x37')]({},_0x103602,_0x3257ca[_0xc536('0x39')]);var _0x1271ad={'where':_0x103602[_0xc536('0x36')]};return db[_0xc536('0x3a')]['count'](_0x1271ad)['then'](function(_0x770488){_0x4419b4[_0xc536('0x1b')]=_0x770488;if(_0x3257ca[_0xc536('0x2c')][_0xc536('0x3b')]){_0x103602[_0xc536('0x3c')]=[{'all':!![]}];}return db[_0xc536('0x3a')][_0xc536('0x3d')](_0x103602);})[_0xc536('0x21')](function(_0x7a6573){_0x4419b4['rows']=_0x7a6573;return _0x4419b4;})[_0xc536('0x21')](respondWithFilteredResult(_0x52c60c,_0x103602))[_0xc536('0x3e')](handleError(_0x52c60c,null));};exports[_0xc536('0x3f')]=function(_0x1a9a47,_0x5b318b){var _0x268147={'raw':!![],'where':{'id':_0x1a9a47[_0xc536('0x40')]['id']}},_0x28d325={};_0x28d325[_0xc536('0x2b')]=_[_0xc536('0x2d')](db[_0xc536('0x3a')][_0xc536('0x27')]);_0x28d325[_0xc536('0x2c')]=_[_0xc536('0x2d')](_0x1a9a47[_0xc536('0x2c')]);_0x28d325[_0xc536('0x2e')]=_[_0xc536('0x30')](_0x28d325[_0xc536('0x2b')],_0x28d325[_0xc536('0x2c')]);_0x268147['attributes']=_[_0xc536('0x30')](_0x28d325[_0xc536('0x2b')],qs[_0xc536('0x31')](_0x1a9a47[_0xc536('0x2c')][_0xc536('0x31')]));_0x268147[_0xc536('0x2f')]=_0x268147[_0xc536('0x2f')]['length']?_0x268147['attributes']:_0x28d325[_0xc536('0x2b')];if(_0x1a9a47[_0xc536('0x2c')][_0xc536('0x3b')]){_0x268147[_0xc536('0x3c')]=[{'all':!![]}];}_0x268147=_[_0xc536('0x37')]({},_0x268147,_0x1a9a47[_0xc536('0x39')]);return db[_0xc536('0x3a')][_0xc536('0x41')](_0x268147)['then'](handleEntityNotFound(_0x5b318b,null))[_0xc536('0x21')](respondWithResult(_0x5b318b,null))[_0xc536('0x3e')](handleError(_0x5b318b,null));};exports[_0xc536('0x42')]=function(_0x83b256,_0x4cfd30){return db[_0xc536('0x3a')][_0xc536('0x42')](_0x83b256[_0xc536('0x43')],{})[_0xc536('0x21')](respondWithResult(_0x4cfd30,0xc9))[_0xc536('0x3e')](handleError(_0x4cfd30,null));};exports[_0xc536('0x44')]=function(_0x66fb3d,_0x5c5291){if(_0x66fb3d['body']['id']){delete _0x66fb3d[_0xc536('0x43')]['id'];}return db[_0xc536('0x3a')]['find']({'where':{'id':_0x66fb3d[_0xc536('0x40')]['id']}})[_0xc536('0x21')](handleEntityNotFound(_0x5c5291,null))[_0xc536('0x21')](saveUpdates(_0x66fb3d['body'],null))[_0xc536('0x21')](respondWithResult(_0x5c5291,null))['catch'](handleError(_0x5c5291,null));};exports['destroy']=function(_0x1f9e1d,_0xe0da9){return db[_0xc536('0x3a')]['find']({'where':{'id':_0x1f9e1d[_0xc536('0x40')]['id']}})[_0xc536('0x21')](handleEntityNotFound(_0xe0da9,null))[_0xc536('0x21')](removeEntity(_0xe0da9,null))[_0xc536('0x3e')](handleError(_0xe0da9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 78fe52e..9014a96 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 _0xd6bd=['exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','util','api','request-promise','../../config/environment','./intDynamics365Field.attributes'];(function(_0x42c069,_0xdfa0f9){var _0x4f0740=function(_0x4c9fd9){while(--_0x4c9fd9){_0x42c069['push'](_0x42c069['shift']());}};_0x4f0740(++_0xdfa0f9);}(_0xd6bd,0x175));var _0xdd6b=function(_0x2d1df1,_0x13386b){_0x2d1df1=_0x2d1df1-0x0;var _0x477dff=_0xd6bd[_0x2d1df1];return _0x477dff;};'use strict';var _=require('lodash');var util=require(_0xdd6b('0x0'));var logger=require('../../config/logger')(_0xdd6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd6b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdd6b('0x3'));var attributes=require(_0xdd6b('0x4'));module[_0xdd6b('0x5')]=function(_0x168219,_0x3dd29b){return _0x168219['define'](_0xdd6b('0x6'),attributes,{'tableName':_0xdd6b('0x7'),'paranoid':![],'indexes':[{'name':_0xdd6b('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xedce=['FieldId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x4612de,_0x5cf536){var _0x5be94b=function(_0x3fec62){while(--_0x3fec62){_0x4612de['push'](_0x4612de['shift']());}};_0x5be94b(++_0x5cf536);}(_0xedce,0x199));var _0xeedc=function(_0x3fcdf5,_0x503ca0){_0x3fcdf5=_0x3fcdf5-0x0;var _0x2d0786=_0xedce[_0x3fcdf5];return _0x2d0786;};'use strict';var _=require(_0xeedc('0x0'));var util=require(_0xeedc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeedc('0x2'));var BPromise=require(_0xeedc('0x3'));var rp=require(_0xeedc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeedc('0x5'));var config=require(_0xeedc('0x6'));var attributes=require(_0xeedc('0x7'));module['exports']=function(_0x304701,_0x1d60a2){return _0x304701[_0xeedc('0x8')](_0xeedc('0x9'),attributes,{'tableName':_0xeedc('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0xeedc('0xb')],'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 47c493b..b41159c 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 _0x29a0=['rpc','../../config/environment','jayson/promise','client','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x24f3ea,_0xf4cbc5){var _0x2e478d=function(_0x19c681){while(--_0x19c681){_0x24f3ea['push'](_0x24f3ea['shift']());}};_0x2e478d(++_0xf4cbc5);}(_0x29a0,0x149));var _0x029a=function(_0x36f443,_0x3ccb5f){_0x36f443=_0x36f443-0x0;var _0x2b2295=_0x29a0[_0x36f443];return _0x2b2295;};'use strict';var _=require('lodash');var util=require(_0x029a('0x0'));var moment=require(_0x029a('0x1'));var BPromise=require('bluebird');var rs=require(_0x029a('0x2'));var fs=require('fs');var Redis=require(_0x029a('0x3'));var db=require(_0x029a('0x4'))['db'];var utils=require(_0x029a('0x5'));var logger=require(_0x029a('0x6'))(_0x029a('0x7'));var config=require(_0x029a('0x8'));var jayson=require(_0x029a('0x9'));var client=jayson[_0x029a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3debb2,_0x3da400,_0x2a4791){return new BPromise(function(_0x33ef1a,_0x44f7b9){return client[_0x029a('0xb')](_0x3debb2,_0x2a4791)[_0x029a('0xc')](function(_0x1560aa){logger['info'](_0x029a('0xd'),_0x3da400,_0x029a('0xe'));logger[_0x029a('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3da400,_0x029a('0xe'),JSON['stringify'](_0x1560aa));if(_0x1560aa['error']){if(_0x1560aa[_0x029a('0x10')]['code']===0x1f4){logger['error'](_0x029a('0xd'),_0x3da400,_0x1560aa['error'][_0x029a('0x11')]);return _0x44f7b9(_0x1560aa[_0x029a('0x10')]['message']);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3da400,_0x1560aa[_0x029a('0x10')][_0x029a('0x11')]);return _0x33ef1a(_0x1560aa[_0x029a('0x10')][_0x029a('0x11')]);}else{logger[_0x029a('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x3da400,_0x029a('0xe'));_0x33ef1a(_0x1560aa[_0x029a('0x13')][_0x029a('0x11')]);}})[_0x029a('0x14')](function(_0x36d8a3){logger[_0x029a('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x3da400,_0x36d8a3);_0x44f7b9(_0x36d8a3);});});} \ No newline at end of file +var _0xf169=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x3e7d7d,_0x3d16bf){var _0x418562=function(_0x4483ba){while(--_0x4483ba){_0x3e7d7d['push'](_0x3e7d7d['shift']());}};_0x418562(++_0x3d16bf);}(_0xf169,0x13c));var _0x9f16=function(_0x1a4a02,_0x16ea26){_0x1a4a02=_0x1a4a02-0x0;var _0x33ce47=_0xf169[_0x1a4a02];return _0x33ce47;};'use strict';var _=require(_0x9f16('0x0'));var util=require(_0x9f16('0x1'));var moment=require(_0x9f16('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f16('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f16('0x5'))(_0x9f16('0x6'));var config=require(_0x9f16('0x7'));var jayson=require(_0x9f16('0x8'));var client=jayson[_0x9f16('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bb1c5,_0x184632,_0x41b983){return new BPromise(function(_0x31f5e7,_0x39bbb4){return client['request'](_0x3bb1c5,_0x41b983)['then'](function(_0x568dab){logger[_0x9f16('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x184632,_0x9f16('0xb'));logger[_0x9f16('0xc')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x184632,_0x9f16('0xb'),JSON[_0x9f16('0xd')](_0x568dab));if(_0x568dab[_0x9f16('0xe')]){if(_0x568dab[_0x9f16('0xe')][_0x9f16('0xf')]===0x1f4){logger[_0x9f16('0xe')](_0x9f16('0x10'),_0x184632,_0x568dab[_0x9f16('0xe')]['message']);return _0x39bbb4(_0x568dab[_0x9f16('0xe')][_0x9f16('0x11')]);}logger[_0x9f16('0xe')](_0x9f16('0x10'),_0x184632,_0x568dab[_0x9f16('0xe')][_0x9f16('0x11')]);return _0x31f5e7(_0x568dab['error']['message']);}else{logger[_0x9f16('0xa')](_0x9f16('0x10'),_0x184632,_0x9f16('0xb'));_0x31f5e7(_0x568dab[_0x9f16('0x12')][_0x9f16('0x11')]);}})[_0x9f16('0x13')](function(_0x17999c){logger[_0x9f16('0xe')](_0x9f16('0x10'),_0x184632,_0x17999c);_0x39bbb4(_0x17999c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 7f7e5db..0ca0c26 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 _0x47db=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','/:id','update'];(function(_0x5a7b37,_0x1b5842){var _0x5ec621=function(_0x4ad8cf){while(--_0x4ad8cf){_0x5a7b37['push'](_0x5a7b37['shift']());}};_0x5ec621(++_0x1b5842);}(_0x47db,0x67));var _0xb47d=function(_0x57600f,_0x16b139){_0x57600f=_0x57600f-0x0;var _0x4bb54f=_0x47db[_0x57600f];return _0x4bb54f;};'use strict';var multer=require('multer');var util=require(_0xb47d('0x0'));var path=require(_0xb47d('0x1'));var timeout=require(_0xb47d('0x2'));var express=require(_0xb47d('0x3'));var router=express[_0xb47d('0x4')]();var fs_extra=require(_0xb47d('0x5'));var auth=require(_0xb47d('0x6'));var interaction=require(_0xb47d('0x7'));var config=require(_0xb47d('0x8'));var controller=require(_0xb47d('0x9'));router[_0xb47d('0xa')]('/',auth[_0xb47d('0xb')](),controller[_0xb47d('0xc')]);router[_0xb47d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb47d('0xd')]);router[_0xb47d('0xa')](_0xb47d('0xe'),auth[_0xb47d('0xb')](),controller[_0xb47d('0xf')]);router[_0xb47d('0xa')](_0xb47d('0x10'),auth[_0xb47d('0xb')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xb47d('0x11')]);router['post']('/:id/configurations',auth[_0xb47d('0xb')](),controller[_0xb47d('0x12')]);router[_0xb47d('0x13')](_0xb47d('0x14'),auth[_0xb47d('0xb')](),controller[_0xb47d('0x15')]);router[_0xb47d('0x16')](_0xb47d('0x14'),auth[_0xb47d('0xb')](),controller[_0xb47d('0x17')]);module[_0xb47d('0x18')]=router; \ No newline at end of file +var _0x4318=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations'];(function(_0x5277dd,_0x32d960){var _0x337224=function(_0x596720){while(--_0x596720){_0x5277dd['push'](_0x5277dd['shift']());}};_0x337224(++_0x32d960);}(_0x4318,0x73));var _0x8431=function(_0x4e8b43,_0x4a9862){_0x4e8b43=_0x4e8b43-0x0;var _0x20372b=_0x4318[_0x4e8b43];return _0x20372b;};'use strict';var multer=require(_0x8431('0x0'));var util=require(_0x8431('0x1'));var path=require(_0x8431('0x2'));var timeout=require(_0x8431('0x3'));var express=require(_0x8431('0x4'));var router=express[_0x8431('0x5')]();var fs_extra=require(_0x8431('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8431('0x7'));var controller=require(_0x8431('0x8'));router[_0x8431('0x9')]('/',auth[_0x8431('0xa')](),controller[_0x8431('0xb')]);router['get'](_0x8431('0xc'),auth[_0x8431('0xa')](),controller[_0x8431('0xd')]);router[_0x8431('0x9')]('/:id/configurations',auth[_0x8431('0xa')](),controller[_0x8431('0xe')]);router[_0x8431('0x9')](_0x8431('0xf'),auth[_0x8431('0xa')](),controller[_0x8431('0x10')]);router[_0x8431('0x11')]('/',auth['isAuthenticated'](),controller[_0x8431('0x12')]);router[_0x8431('0x11')](_0x8431('0x13'),auth[_0x8431('0xa')](),controller[_0x8431('0x14')]);router[_0x8431('0x15')](_0x8431('0xc'),auth[_0x8431('0xa')](),controller[_0x8431('0x16')]);router[_0x8431('0x17')]('/:id',auth[_0x8431('0xa')](),controller[_0x8431('0x18')]);module[_0x8431('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 12eab42..e29919d 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 _0x8603=['remoteUri','exports','STRING'];(function(_0x55ec54,_0x2538e4){var _0x31d357=function(_0x133ecc){while(--_0x133ecc){_0x55ec54['push'](_0x55ec54['shift']());}};_0x31d357(++_0x2538e4);}(_0x8603,0x190));var _0x3860=function(_0x43c62f,_0x539ddf){_0x43c62f=_0x43c62f-0x0;var _0x50a638=_0x8603[_0x43c62f];return _0x50a638;};'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 +var _0x9536=['username','remoteUri','sequelize','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9536,0x179));var _0x6953=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x9536[_0x245afe];return _0x4eefde;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')]},'description':{'type':Sequelize[_0x6953('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6953('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6953('0x2')],'unique':_0x6953('0x4')},'serverUrl':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 885b8a5..95cf9dc 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 _0xf194=['channel','getDescriptions','FreshdeskField','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','%s:X','apiKey','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','default','custom_dropdown','choices','capitalize','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','FreshdeskAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects'];(function(_0x38c0b2,_0x6a67a5){var _0x283c00=function(_0x259f03){while(--_0x259f03){_0x38c0b2['push'](_0x38c0b2['shift']());}};_0x283c00(++_0x6a67a5);}(_0xf194,0x91));var _0x4f19=function(_0x3c910d,_0x1a0f0b){_0x3c910d=_0x3c910d-0x0;var _0x311024=_0xf194[_0x3c910d];return _0x311024;};'use strict';var emlformat=require(_0x4f19('0x0'));var rimraf=require(_0x4f19('0x1'));var zipdir=require(_0x4f19('0x2'));var jsonpatch=require(_0x4f19('0x3'));var rp=require('request-promise');var moment=require(_0x4f19('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f19('0x5'));var sox=require(_0x4f19('0x6'));var csv=require(_0x4f19('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f19('0x8'));var _=require(_0x4f19('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f19('0xa'));var deskjs=require(_0x4f19('0xb'));var toCsv=require(_0x4f19('0x7'));var querystring=require(_0x4f19('0xc'));var Papa=require('papaparse');var Redis=require(_0x4f19('0xd'));var authService=require(_0x4f19('0xe'));var qs=require(_0x4f19('0xf'));var as=require(_0x4f19('0x10'));var hardwareService=require(_0x4f19('0x11'));var logger=require(_0x4f19('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4f19('0x13'));var db=require(_0x4f19('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x6280a0,_0x26348c){_0x26348c=_0x26348c||0xcc;return function(_0x11cd01){if(_0x11cd01){return _0x6280a0[_0x4f19('0x15')](_0x26348c);}return _0x6280a0['status'](_0x26348c)[_0x4f19('0x16')]();};}function respondWithResult(_0x25e5ce,_0x4b7198){_0x4b7198=_0x4b7198||0xc8;return function(_0x1202d5){if(_0x1202d5){return _0x25e5ce[_0x4f19('0x17')](_0x4b7198)['json'](_0x1202d5);}};}function respondWithFilteredResult(_0x298562,_0x55e1f8){return function(_0x33bded){if(_0x33bded){var _0x16405f=typeof _0x55e1f8['offset']==='undefined'&&typeof _0x55e1f8[_0x4f19('0x18')]===_0x4f19('0x19');var _0x2d3f1a=_0x33bded['count'];var _0x1d9bf3=_0x16405f?0x0:_0x55e1f8[_0x4f19('0x1a')];var _0x1b4d79=_0x16405f?_0x33bded[_0x4f19('0x1b')]:_0x55e1f8[_0x4f19('0x1a')]+_0x55e1f8['limit'];var _0xf401d7;if(_0x1b4d79>=_0x2d3f1a){_0x1b4d79=_0x2d3f1a;_0xf401d7=0xc8;}else{_0xf401d7=0xce;}_0x298562[_0x4f19('0x17')](_0xf401d7);return _0x298562['set'](_0x4f19('0x1c'),_0x1d9bf3+'-'+_0x1b4d79+'/'+_0x2d3f1a)[_0x4f19('0x1d')](_0x33bded);}return null;};}function patchUpdates(_0x3312f8){return function(_0x327605){try{jsonpatch['apply'](_0x327605,_0x3312f8,!![]);}catch(_0x43c28c){return BPromise[_0x4f19('0x1e')](_0x43c28c);}return _0x327605[_0x4f19('0x1f')]();};}function saveUpdates(_0xcbe002,_0x11a272){return function(_0x752763){if(_0x752763){return _0x752763[_0x4f19('0x20')](_0xcbe002)[_0x4f19('0x21')](function(_0x9e3298){return _0x9e3298;});}return null;};}function removeEntity(_0x10e164,_0x4531f4){return function(_0x2e2bf5){if(_0x2e2bf5){return _0x2e2bf5[_0x4f19('0x22')]()[_0x4f19('0x21')](function(){_0x10e164[_0x4f19('0x17')](0xcc)[_0x4f19('0x16')]();});}};}function handleEntityNotFound(_0x2fc1a4,_0x3fede9){return function(_0x2f6c41){if(!_0x2f6c41){_0x2fc1a4['sendStatus'](0x194);}return _0x2f6c41;};}function handleError(_0xabade8,_0x5218c6){_0x5218c6=_0x5218c6||0x1f4;return function(_0x2c1edd){logger['error'](_0x2c1edd[_0x4f19('0x23')]);if(_0x2c1edd['name']){delete _0x2c1edd[_0x4f19('0x24')];}_0xabade8[_0x4f19('0x17')](_0x5218c6)[_0x4f19('0x25')](_0x2c1edd);};}exports['index']=function(_0x444858,_0x3a18b3){var _0x2175ff={},_0xdc6431={},_0x13f820={'count':0x0,'rows':[]};var _0x524471=_[_0x4f19('0x26')](db[_0x4f19('0x27')]['rawAttributes'],function(_0x3531d9){return{'name':_0x3531d9[_0x4f19('0x28')],'type':_0x3531d9[_0x4f19('0x29')][_0x4f19('0x2a')]};});_0xdc6431[_0x4f19('0x2b')]=_[_0x4f19('0x26')](_0x524471,'name');_0xdc6431[_0x4f19('0x2c')]=_[_0x4f19('0x2d')](_0x444858[_0x4f19('0x2c')]);_0xdc6431['filters']=_[_0x4f19('0x2e')](_0xdc6431[_0x4f19('0x2b')],_0xdc6431[_0x4f19('0x2c')]);_0x2175ff[_0x4f19('0x2f')]=_[_0x4f19('0x2e')](_0xdc6431[_0x4f19('0x2b')],qs['fields'](_0x444858[_0x4f19('0x2c')][_0x4f19('0x30')]));_0x2175ff['attributes']=_0x2175ff[_0x4f19('0x2f')][_0x4f19('0x31')]?_0x2175ff[_0x4f19('0x2f')]:_0xdc6431[_0x4f19('0x2b')];if(!_0x444858[_0x4f19('0x2c')][_0x4f19('0x32')](_0x4f19('0x33'))){_0x2175ff['limit']=qs[_0x4f19('0x18')](_0x444858[_0x4f19('0x2c')][_0x4f19('0x18')]);_0x2175ff[_0x4f19('0x1a')]=qs[_0x4f19('0x1a')](_0x444858[_0x4f19('0x2c')][_0x4f19('0x1a')]);}_0x2175ff[_0x4f19('0x34')]=qs[_0x4f19('0x35')](_0x444858['query'][_0x4f19('0x35')]);_0x2175ff[_0x4f19('0x36')]=qs[_0x4f19('0x37')](_[_0x4f19('0x38')](_0x444858[_0x4f19('0x2c')],_0xdc6431['filters']),_0x524471);if(_0x444858['query'][_0x4f19('0x39')]){_0x2175ff[_0x4f19('0x36')]=_['merge'](_0x2175ff['where'],{'$or':_[_0x4f19('0x26')](_0x524471,function(_0x1617b7){if(_0x1617b7['type']!=='VIRTUAL'){var _0x1bd47c={};_0x1bd47c[_0x1617b7['name']]={'$like':'%'+_0x444858[_0x4f19('0x2c')][_0x4f19('0x39')]+'%'};return _0x1bd47c;}})});}_0x2175ff=_[_0x4f19('0x3a')]({},_0x2175ff,_0x444858[_0x4f19('0x3b')]);var _0x30bd8a={'where':_0x2175ff[_0x4f19('0x36')]};return db[_0x4f19('0x27')][_0x4f19('0x1b')](_0x30bd8a)[_0x4f19('0x21')](function(_0x4aaac4){_0x13f820[_0x4f19('0x1b')]=_0x4aaac4;if(_0x444858['query'][_0x4f19('0x3c')]){_0x2175ff[_0x4f19('0x3d')]=[{'all':!![]}];}return db[_0x4f19('0x27')][_0x4f19('0x3e')](_0x2175ff);})[_0x4f19('0x21')](function(_0x1690b0){_0x13f820['rows']=_0x1690b0;return _0x13f820;})['then'](respondWithFilteredResult(_0x3a18b3,_0x2175ff))[_0x4f19('0x3f')](handleError(_0x3a18b3,null));};exports[_0x4f19('0x40')]=function(_0x16a7ee,_0x4f8e04){var _0x41257f={'raw':![],'where':{'id':_0x16a7ee[_0x4f19('0x41')]['id']}},_0x22f55f={};_0x22f55f['model']=_[_0x4f19('0x2d')](db[_0x4f19('0x27')][_0x4f19('0x42')]);_0x22f55f['query']=_['keys'](_0x16a7ee[_0x4f19('0x2c')]);_0x22f55f[_0x4f19('0x37')]=_[_0x4f19('0x2e')](_0x22f55f['model'],_0x22f55f['query']);_0x41257f[_0x4f19('0x2f')]=_[_0x4f19('0x2e')](_0x22f55f[_0x4f19('0x2b')],qs[_0x4f19('0x30')](_0x16a7ee[_0x4f19('0x2c')][_0x4f19('0x30')]));_0x41257f[_0x4f19('0x2f')]=_0x41257f[_0x4f19('0x2f')][_0x4f19('0x31')]?_0x41257f[_0x4f19('0x2f')]:_0x22f55f['model'];if(_0x16a7ee[_0x4f19('0x2c')][_0x4f19('0x3c')]){_0x41257f[_0x4f19('0x3d')]=[{'all':!![]}];}_0x41257f=_[_0x4f19('0x3a')]({},_0x41257f,_0x16a7ee[_0x4f19('0x3b')]);return db[_0x4f19('0x27')][_0x4f19('0x43')](_0x41257f)[_0x4f19('0x21')](handleEntityNotFound(_0x4f8e04,null))[_0x4f19('0x21')](respondWithResult(_0x4f8e04,null))[_0x4f19('0x3f')](handleError(_0x4f8e04,null));};exports[_0x4f19('0x44')]=function(_0x50e616,_0x40a5b1){return db['FreshdeskAccount']['create'](_0x50e616[_0x4f19('0x45')],{})[_0x4f19('0x21')](respondWithResult(_0x40a5b1,0xc9))[_0x4f19('0x3f')](handleError(_0x40a5b1,null));};exports[_0x4f19('0x20')]=function(_0x4b7c50,_0x4d2de4){if(_0x4b7c50['body']['id']){delete _0x4b7c50['body']['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x4b7c50['params']['id']}})[_0x4f19('0x21')](handleEntityNotFound(_0x4d2de4,null))[_0x4f19('0x21')](saveUpdates(_0x4b7c50[_0x4f19('0x45')],null))[_0x4f19('0x21')](respondWithResult(_0x4d2de4,null))[_0x4f19('0x3f')](handleError(_0x4d2de4,null));};exports[_0x4f19('0x22')]=function(_0x4a0669,_0x454f0f){return db[_0x4f19('0x27')][_0x4f19('0x43')]({'where':{'id':_0x4a0669[_0x4f19('0x41')]['id']}})['then'](handleEntityNotFound(_0x454f0f,null))['then'](removeEntity(_0x454f0f,null))[_0x4f19('0x3f')](handleError(_0x454f0f,null));};exports[_0x4f19('0x46')]=function(_0x371a17,_0x56bea3,_0x3ad2d6){var _0x44d29c={};var _0x3e8433={};var _0x9f57e7;var _0xbf80ab;return db[_0x4f19('0x27')][_0x4f19('0x47')]({'where':{'id':_0x371a17[_0x4f19('0x41')]['id']}})['then'](handleEntityNotFound(_0x56bea3,null))[_0x4f19('0x21')](function(_0x6330c3){if(_0x6330c3){_0x9f57e7=_0x6330c3;_0x3e8433[_0x4f19('0x2b')]=_[_0x4f19('0x2d')](db[_0x4f19('0x48')][_0x4f19('0x42')]);_0x3e8433[_0x4f19('0x2c')]=_[_0x4f19('0x2d')](_0x371a17['query']);_0x3e8433[_0x4f19('0x37')]=_['intersection'](_0x3e8433['model'],_0x3e8433[_0x4f19('0x2c')]);_0x44d29c[_0x4f19('0x2f')]=_[_0x4f19('0x2e')](_0x3e8433[_0x4f19('0x2b')],qs[_0x4f19('0x30')](_0x371a17[_0x4f19('0x2c')][_0x4f19('0x30')]));_0x44d29c[_0x4f19('0x2f')]=_0x44d29c['attributes'][_0x4f19('0x31')]?_0x44d29c[_0x4f19('0x2f')]:_0x3e8433[_0x4f19('0x2b')];_0x44d29c[_0x4f19('0x34')]=qs['sort'](_0x371a17[_0x4f19('0x2c')][_0x4f19('0x35')]);_0x44d29c[_0x4f19('0x36')]=qs[_0x4f19('0x37')](_[_0x4f19('0x38')](_0x371a17[_0x4f19('0x2c')],_0x3e8433[_0x4f19('0x37')]));if(_0x371a17[_0x4f19('0x2c')]['filter']){_0x44d29c[_0x4f19('0x36')]=_[_0x4f19('0x3a')](_0x44d29c[_0x4f19('0x36')],{'$or':_[_0x4f19('0x26')](_0x44d29c[_0x4f19('0x2f')],function(_0x19037a){var _0x36fc0c={};_0x36fc0c[_0x19037a]={'$like':'%'+_0x371a17[_0x4f19('0x2c')][_0x4f19('0x39')]+'%'};return _0x36fc0c;})});}_0x44d29c=_[_0x4f19('0x3a')]({},_0x44d29c,_0x371a17[_0x4f19('0x3b')]);return _0x9f57e7[_0x4f19('0x46')](_0x44d29c);}})['then'](function(_0x14a811){if(_0x14a811){_0xbf80ab=_0x14a811[_0x4f19('0x31')];if(!_0x371a17[_0x4f19('0x2c')][_0x4f19('0x32')](_0x4f19('0x33'))){_0x44d29c[_0x4f19('0x18')]=qs[_0x4f19('0x18')](_0x371a17[_0x4f19('0x2c')][_0x4f19('0x18')]);_0x44d29c[_0x4f19('0x1a')]=qs[_0x4f19('0x1a')](_0x371a17[_0x4f19('0x2c')][_0x4f19('0x1a')]);}return _0x9f57e7[_0x4f19('0x46')](_0x44d29c);}})[_0x4f19('0x21')](function(_0x1a51fc){if(_0x1a51fc){return _0x1a51fc?{'count':_0xbf80ab,'rows':_0x1a51fc}:null;}})[_0x4f19('0x21')](respondWithResult(_0x56bea3,null))['catch'](handleError(_0x56bea3,null));};exports[_0x4f19('0x49')]=function(_0x3f0dd1,_0x3b7de5,_0x5abb46){if(_0x3f0dd1[_0x4f19('0x45')]['id']){delete _0x3f0dd1[_0x4f19('0x45')]['id'];}return db[_0x4f19('0x27')]['findOne']({'where':{'id':_0x3f0dd1[_0x4f19('0x41')]['id']}})[_0x4f19('0x21')](handleEntityNotFound(_0x3b7de5,null))[_0x4f19('0x21')](function(_0x49e2dd){if(_0x49e2dd){_0x3f0dd1[_0x4f19('0x45')][_0x4f19('0x4a')]=_0x49e2dd['id'];_0x3f0dd1[_0x4f19('0x45')][_0x4f19('0x4b')]=integrations[_0x4f19('0x4c')](_0x3f0dd1[_0x4f19('0x45')][_0x4f19('0x4d')],_0x3f0dd1[_0x4f19('0x45')][_0x4f19('0x29')]);_0x3f0dd1['body']['Descriptions']=integrations[_0x4f19('0x4e')](_0x3f0dd1[_0x4f19('0x45')]['channel'],_0x3f0dd1[_0x4f19('0x45')][_0x4f19('0x29')]);return db['FreshdeskConfiguration'][_0x4f19('0x44')](_0x3f0dd1[_0x4f19('0x45')],{'include':[{'model':db[_0x4f19('0x4f')],'as':'Subjects'},{'model':db[_0x4f19('0x4f')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3b7de5,null))[_0x4f19('0x3f')](handleError(_0x3b7de5,null));};exports['getFields']=function(_0x44310d,_0x2d8d39,_0x3b0f83){var _0x21f384='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x44310d[_0x4f19('0x41')]['id']},'attributes':['id',_0x4f19('0x50'),'apiKey']})[_0x4f19('0x21')](handleEntityNotFound(_0x2d8d39,null))[_0x4f19('0x21')](function(_0x9c0920){if(_0x9c0920){_0x21f384=_0x9c0920[_0x4f19('0x50')];var _0x1ae316=_0x21f384[_0x4f19('0x51')](-0x1);if(_0x1ae316==='/'){_0x21f384=_0x21f384[_0x4f19('0x52')](0x0,_0x21f384[_0x4f19('0x53')](_0x1ae316));}return rp({'method':_0x4f19('0x54'),'uri':util['format'](_0x4f19('0x55'),_0x21f384,_0x4f19('0x56')),'headers':{'Authorization':util[_0x4f19('0x57')]('Basic\x20%s',new Buffer(util['format'](_0x4f19('0x58'),_0x9c0920[_0x4f19('0x59')]))[_0x4f19('0x5a')](_0x4f19('0x5b')))},'json':!![]});}})[_0x4f19('0x21')](function(_0x16a0e2){if(_0x16a0e2){var _0x141a7f=[_0x4f19('0x5c'),_0x4f19('0x5d'),_0x4f19('0x5e'),_0x4f19('0x5f'),_0x4f19('0x17'),_0x4f19('0x60'),_0x4f19('0x61'),_0x4f19('0x62'),_0x4f19('0x63'),_0x4f19('0x61'),_0x4f19('0x64')];_['remove'](_0x16a0e2,function(_0x4613e1){return _0x141a7f['includes'](_0x4613e1[_0x4f19('0x24')])||!_0x4613e1[_0x4f19('0x65')]&&_0x4613e1[_0x4f19('0x29')]!=='custom_text'&&_0x4613e1[_0x4f19('0x29')]!==_0x4f19('0x66');});return{'count':_0x16a0e2[_0x4f19('0x31')],'rows':_[_0x4f19('0x26')](_0x16a0e2,function(_0x4b4f72){return{'id':_0x4b4f72['name'],'name':_0x4b4f72['label'],'custom':!_0x4b4f72[_0x4f19('0x65')],'options':_0x4b4f72[_0x4f19('0x67')]?_[_0x4f19('0x26')](_0x4b4f72[_0x4f19('0x67')],function(_0x3c6fa0){return{'name':_[_0x4f19('0x68')](_0x3c6fa0),'value':_0x3c6fa0};}):[]};})};}})[_0x4f19('0x21')](respondWithResult(_0x2d8d39,null))['catch'](function(_0x44d17d){var _0x5d6042=_0x44310d['query'][_0x4f19('0x69')]?0x1f4:_0x44d17d['statusCode']||0x1f4;logger[_0x4f19('0x6a')](_0x4f19('0x6b'),'getFields',_0x5d6042,JSON[_0x4f19('0x6c')](_0x44d17d));delete _0x44d17d[_0x4f19('0x24')];if(_0x5d6042===0x191){_0x5d6042=0x190;}_0x2d8d39[_0x4f19('0x17')](_0x5d6042)[_0x4f19('0x25')](_0x44310d[_0x4f19('0x2c')][_0x4f19('0x69')]?{'message':_0x4f19('0x6d'),'statusCode':_0x44d17d[_0x4f19('0x6e')]}:_0x44d17d);});}; \ No newline at end of file +var _0xa047=['default','custom_text','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','FreshdeskAccount','includeAll','findAll','catch','show','include','find','create','body','params','destroy','FreshdeskConfiguration','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','lastIndexOf','GET','%s/%s','format','Basic\x20%s','%s:X','toString','subject','agent','priority','group','ticket_type','company','remove','includes'];(function(_0x87e829,_0x958e0){var _0x1bff1c=function(_0x4e0789){while(--_0x4e0789){_0x87e829['push'](_0x87e829['shift']());}};_0x1bff1c(++_0x958e0);}(_0xa047,0x1c5));var _0x7a04=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xa047[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x7a04('0x0'));var rimraf=require(_0x7a04('0x1'));var zipdir=require(_0x7a04('0x2'));var jsonpatch=require(_0x7a04('0x3'));var rp=require('request-promise');var moment=require(_0x7a04('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a04('0x5'));var util=require(_0x7a04('0x6'));var path=require(_0x7a04('0x7'));var sox=require(_0x7a04('0x8'));var csv=require(_0x7a04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a04('0xa'));var _=require(_0x7a04('0xb'));var squel=require(_0x7a04('0xc'));var crypto=require('crypto');var jsforce=require(_0x7a04('0xd'));var deskjs=require(_0x7a04('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7a04('0xf'));var Papa=require(_0x7a04('0x10'));var Redis=require('ioredis');var authService=require(_0x7a04('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a04('0x12'));var logger=require(_0x7a04('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7a04('0x14'));var db=require(_0x7a04('0x15'))['db'];var integrations=require(_0x7a04('0x16'));function respondWithStatusCode(_0x15a002,_0x10931c){_0x10931c=_0x10931c||0xcc;return function(_0x44a0a1){if(_0x44a0a1){return _0x15a002[_0x7a04('0x17')](_0x10931c);}return _0x15a002[_0x7a04('0x18')](_0x10931c)[_0x7a04('0x19')]();};}function respondWithResult(_0x5ae457,_0x3b601d){_0x3b601d=_0x3b601d||0xc8;return function(_0x280398){if(_0x280398){return _0x5ae457[_0x7a04('0x18')](_0x3b601d)[_0x7a04('0x1a')](_0x280398);}};}function respondWithFilteredResult(_0x2bb838,_0x328973){return function(_0x4f434f){if(_0x4f434f){var _0x3542d4=typeof _0x328973[_0x7a04('0x1b')]===_0x7a04('0x1c')&&typeof _0x328973['limit']==='undefined';var _0x3b27b8=_0x4f434f[_0x7a04('0x1d')];var _0x247abd=_0x3542d4?0x0:_0x328973['offset'];var _0x180f01=_0x3542d4?_0x4f434f[_0x7a04('0x1d')]:_0x328973['offset']+_0x328973[_0x7a04('0x1e')];var _0x5a5bf5;if(_0x180f01>=_0x3b27b8){_0x180f01=_0x3b27b8;_0x5a5bf5=0xc8;}else{_0x5a5bf5=0xce;}_0x2bb838[_0x7a04('0x18')](_0x5a5bf5);return _0x2bb838['set'](_0x7a04('0x1f'),_0x247abd+'-'+_0x180f01+'/'+_0x3b27b8)[_0x7a04('0x1a')](_0x4f434f);}return null;};}function patchUpdates(_0x51b13b){return function(_0x37494a){try{jsonpatch[_0x7a04('0x20')](_0x37494a,_0x51b13b,!![]);}catch(_0x594d06){return BPromise[_0x7a04('0x21')](_0x594d06);}return _0x37494a[_0x7a04('0x22')]();};}function saveUpdates(_0x57eaa5,_0x281562){return function(_0x130bc9){if(_0x130bc9){return _0x130bc9[_0x7a04('0x23')](_0x57eaa5)[_0x7a04('0x24')](function(_0x2f8ff6){return _0x2f8ff6;});}return null;};}function removeEntity(_0x21b668,_0x1deb47){return function(_0x32e678){if(_0x32e678){return _0x32e678['destroy']()[_0x7a04('0x24')](function(){_0x21b668['status'](0xcc)[_0x7a04('0x19')]();});}};}function handleEntityNotFound(_0x415d54,_0x2da06b){return function(_0x2cd2e4){if(!_0x2cd2e4){_0x415d54[_0x7a04('0x17')](0x194);}return _0x2cd2e4;};}function handleError(_0x1ff41b,_0x3743b3){_0x3743b3=_0x3743b3||0x1f4;return function(_0x5f9fd1){logger[_0x7a04('0x25')](_0x5f9fd1[_0x7a04('0x26')]);if(_0x5f9fd1[_0x7a04('0x27')]){delete _0x5f9fd1['name'];}_0x1ff41b[_0x7a04('0x18')](_0x3743b3)['send'](_0x5f9fd1);};}exports[_0x7a04('0x28')]=function(_0x246310,_0x1b6eba){var _0x3a9d10={},_0x99b61d={},_0x22a8e6={'count':0x0,'rows':[]};var _0x4ce6f2=_[_0x7a04('0x29')](db['FreshdeskAccount'][_0x7a04('0x2a')],function(_0x444daa){return{'name':_0x444daa['fieldName'],'type':_0x444daa[_0x7a04('0x2b')][_0x7a04('0x2c')]};});_0x99b61d['model']=_['map'](_0x4ce6f2,_0x7a04('0x27'));_0x99b61d[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x246310[_0x7a04('0x2d')]);_0x99b61d[_0x7a04('0x2f')]=_[_0x7a04('0x30')](_0x99b61d[_0x7a04('0x31')],_0x99b61d[_0x7a04('0x2d')]);_0x3a9d10['attributes']=_[_0x7a04('0x30')](_0x99b61d[_0x7a04('0x31')],qs['fields'](_0x246310[_0x7a04('0x2d')][_0x7a04('0x32')]));_0x3a9d10[_0x7a04('0x33')]=_0x3a9d10[_0x7a04('0x33')][_0x7a04('0x34')]?_0x3a9d10[_0x7a04('0x33')]:_0x99b61d[_0x7a04('0x31')];if(!_0x246310['query'][_0x7a04('0x35')](_0x7a04('0x36'))){_0x3a9d10['limit']=qs['limit'](_0x246310[_0x7a04('0x2d')]['limit']);_0x3a9d10[_0x7a04('0x1b')]=qs['offset'](_0x246310[_0x7a04('0x2d')][_0x7a04('0x1b')]);}_0x3a9d10[_0x7a04('0x37')]=qs[_0x7a04('0x38')](_0x246310[_0x7a04('0x2d')][_0x7a04('0x38')]);_0x3a9d10[_0x7a04('0x39')]=qs[_0x7a04('0x2f')](_[_0x7a04('0x3a')](_0x246310['query'],_0x99b61d['filters']),_0x4ce6f2);if(_0x246310['query']['filter']){_0x3a9d10[_0x7a04('0x39')]=_['merge'](_0x3a9d10[_0x7a04('0x39')],{'$or':_[_0x7a04('0x29')](_0x4ce6f2,function(_0x19f7ec){if(_0x19f7ec[_0x7a04('0x2b')]!==_0x7a04('0x3b')){var _0x2fb643={};_0x2fb643[_0x19f7ec[_0x7a04('0x27')]]={'$like':'%'+_0x246310['query'][_0x7a04('0x3c')]+'%'};return _0x2fb643;}})});}_0x3a9d10=_[_0x7a04('0x3d')]({},_0x3a9d10,_0x246310[_0x7a04('0x3e')]);var _0x4fda19={'where':_0x3a9d10[_0x7a04('0x39')]};return db[_0x7a04('0x3f')][_0x7a04('0x1d')](_0x4fda19)[_0x7a04('0x24')](function(_0x2dc001){_0x22a8e6[_0x7a04('0x1d')]=_0x2dc001;if(_0x246310[_0x7a04('0x2d')][_0x7a04('0x40')]){_0x3a9d10['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7a04('0x41')](_0x3a9d10);})[_0x7a04('0x24')](function(_0x5c5a69){_0x22a8e6['rows']=_0x5c5a69;return _0x22a8e6;})['then'](respondWithFilteredResult(_0x1b6eba,_0x3a9d10))[_0x7a04('0x42')](handleError(_0x1b6eba,null));};exports[_0x7a04('0x43')]=function(_0x295c5b,_0x2bba60){var _0x4780dd={'raw':![],'where':{'id':_0x295c5b['params']['id']}},_0x2bec59={};_0x2bec59[_0x7a04('0x31')]=_[_0x7a04('0x2e')](db['FreshdeskAccount']['rawAttributes']);_0x2bec59[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x295c5b[_0x7a04('0x2d')]);_0x2bec59[_0x7a04('0x2f')]=_[_0x7a04('0x30')](_0x2bec59[_0x7a04('0x31')],_0x2bec59['query']);_0x4780dd[_0x7a04('0x33')]=_[_0x7a04('0x30')](_0x2bec59[_0x7a04('0x31')],qs[_0x7a04('0x32')](_0x295c5b[_0x7a04('0x2d')][_0x7a04('0x32')]));_0x4780dd[_0x7a04('0x33')]=_0x4780dd['attributes'][_0x7a04('0x34')]?_0x4780dd[_0x7a04('0x33')]:_0x2bec59['model'];if(_0x295c5b['query']['includeAll']){_0x4780dd[_0x7a04('0x44')]=[{'all':!![]}];}_0x4780dd=_[_0x7a04('0x3d')]({},_0x4780dd,_0x295c5b[_0x7a04('0x3e')]);return db[_0x7a04('0x3f')][_0x7a04('0x45')](_0x4780dd)['then'](handleEntityNotFound(_0x2bba60,null))['then'](respondWithResult(_0x2bba60,null))[_0x7a04('0x42')](handleError(_0x2bba60,null));};exports[_0x7a04('0x46')]=function(_0x278f04,_0x14e42e){return db['FreshdeskAccount']['create'](_0x278f04[_0x7a04('0x47')],{})['then'](respondWithResult(_0x14e42e,0xc9))[_0x7a04('0x42')](handleError(_0x14e42e,null));};exports['update']=function(_0x467fcf,_0x143bcf){if(_0x467fcf[_0x7a04('0x47')]['id']){delete _0x467fcf[_0x7a04('0x47')]['id'];}return db[_0x7a04('0x3f')][_0x7a04('0x45')]({'where':{'id':_0x467fcf[_0x7a04('0x48')]['id']}})['then'](handleEntityNotFound(_0x143bcf,null))['then'](saveUpdates(_0x467fcf[_0x7a04('0x47')],null))[_0x7a04('0x24')](respondWithResult(_0x143bcf,null))[_0x7a04('0x42')](handleError(_0x143bcf,null));};exports[_0x7a04('0x49')]=function(_0x132c1d,_0x43e537){return db[_0x7a04('0x3f')][_0x7a04('0x45')]({'where':{'id':_0x132c1d['params']['id']}})['then'](handleEntityNotFound(_0x43e537,null))[_0x7a04('0x24')](removeEntity(_0x43e537,null))[_0x7a04('0x42')](handleError(_0x43e537,null));};exports['getConfigurations']=function(_0x30e0d2,_0x576300,_0x5c28c3){var _0x83a38b={};var _0x5a45bf={};var _0x1d273b;var _0x44b4ba;return db[_0x7a04('0x3f')]['findOne']({'where':{'id':_0x30e0d2[_0x7a04('0x48')]['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x576300,null))[_0x7a04('0x24')](function(_0x53f355){if(_0x53f355){_0x1d273b=_0x53f355;_0x5a45bf['model']=_[_0x7a04('0x2e')](db[_0x7a04('0x4a')][_0x7a04('0x2a')]);_0x5a45bf[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x30e0d2[_0x7a04('0x2d')]);_0x5a45bf[_0x7a04('0x2f')]=_[_0x7a04('0x30')](_0x5a45bf[_0x7a04('0x31')],_0x5a45bf[_0x7a04('0x2d')]);_0x83a38b[_0x7a04('0x33')]=_[_0x7a04('0x30')](_0x5a45bf[_0x7a04('0x31')],qs['fields'](_0x30e0d2['query']['fields']));_0x83a38b[_0x7a04('0x33')]=_0x83a38b[_0x7a04('0x33')]['length']?_0x83a38b[_0x7a04('0x33')]:_0x5a45bf[_0x7a04('0x31')];_0x83a38b[_0x7a04('0x37')]=qs[_0x7a04('0x38')](_0x30e0d2['query']['sort']);_0x83a38b[_0x7a04('0x39')]=qs[_0x7a04('0x2f')](_['pick'](_0x30e0d2['query'],_0x5a45bf[_0x7a04('0x2f')]));if(_0x30e0d2[_0x7a04('0x2d')][_0x7a04('0x3c')]){_0x83a38b[_0x7a04('0x39')]=_[_0x7a04('0x3d')](_0x83a38b[_0x7a04('0x39')],{'$or':_['map'](_0x83a38b[_0x7a04('0x33')],function(_0x4bc950){var _0x2a5acd={};_0x2a5acd[_0x4bc950]={'$like':'%'+_0x30e0d2['query']['filter']+'%'};return _0x2a5acd;})});}_0x83a38b=_[_0x7a04('0x3d')]({},_0x83a38b,_0x30e0d2['options']);return _0x1d273b[_0x7a04('0x4b')](_0x83a38b);}})[_0x7a04('0x24')](function(_0x4ef0f1){if(_0x4ef0f1){_0x44b4ba=_0x4ef0f1[_0x7a04('0x34')];if(!_0x30e0d2[_0x7a04('0x2d')][_0x7a04('0x35')](_0x7a04('0x36'))){_0x83a38b[_0x7a04('0x1e')]=qs[_0x7a04('0x1e')](_0x30e0d2['query']['limit']);_0x83a38b[_0x7a04('0x1b')]=qs[_0x7a04('0x1b')](_0x30e0d2[_0x7a04('0x2d')]['offset']);}return _0x1d273b[_0x7a04('0x4b')](_0x83a38b);}})[_0x7a04('0x24')](function(_0x4d154b){if(_0x4d154b){return _0x4d154b?{'count':_0x44b4ba,'rows':_0x4d154b}:null;}})[_0x7a04('0x24')](respondWithResult(_0x576300,null))[_0x7a04('0x42')](handleError(_0x576300,null));};exports['addConfiguration']=function(_0x1e0bd5,_0x375e1a,_0x881908){if(_0x1e0bd5[_0x7a04('0x47')]['id']){delete _0x1e0bd5[_0x7a04('0x47')]['id'];}return db[_0x7a04('0x3f')][_0x7a04('0x4c')]({'where':{'id':_0x1e0bd5[_0x7a04('0x48')]['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x375e1a,null))[_0x7a04('0x24')](function(_0x1d24db){if(_0x1d24db){_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x4d')]=_0x1d24db['id'];_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x4e')]=integrations['getSubjects'](_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x4f')],_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x2b')]);_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x50')]=integrations[_0x7a04('0x51')](_0x1e0bd5['body'][_0x7a04('0x4f')],_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x2b')]);return db[_0x7a04('0x4a')][_0x7a04('0x46')](_0x1e0bd5[_0x7a04('0x47')],{'include':[{'model':db[_0x7a04('0x52')],'as':_0x7a04('0x4e')},{'model':db['FreshdeskField'],'as':_0x7a04('0x50')}]});}return null;})[_0x7a04('0x24')](respondWithResult(_0x375e1a,null))[_0x7a04('0x42')](handleError(_0x375e1a,null));};exports[_0x7a04('0x53')]=function(_0x261b10,_0x2c6970,_0x2bea05){var _0x5e688c='';return db['FreshdeskAccount'][_0x7a04('0x4c')]({'where':{'id':_0x261b10[_0x7a04('0x48')]['id']},'attributes':['id','remoteUri',_0x7a04('0x54')]})['then'](handleEntityNotFound(_0x2c6970,null))[_0x7a04('0x24')](function(_0x2df085){if(_0x2df085){_0x5e688c=_0x2df085[_0x7a04('0x55')];var _0x2c263c=_0x5e688c[_0x7a04('0x56')](-0x1);if(_0x2c263c==='/'){_0x5e688c=_0x5e688c['substring'](0x0,_0x5e688c[_0x7a04('0x57')](_0x2c263c));}return rp({'method':_0x7a04('0x58'),'uri':util['format'](_0x7a04('0x59'),_0x5e688c,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x7a04('0x5a')](_0x7a04('0x5b'),new Buffer(util[_0x7a04('0x5a')](_0x7a04('0x5c'),_0x2df085[_0x7a04('0x54')]))[_0x7a04('0x5d')]('base64'))},'json':!![]});}})[_0x7a04('0x24')](function(_0x40f6c8){if(_0x40f6c8){var _0x1a698b=['requester',_0x7a04('0x5e'),_0x7a04('0x5f'),'description',_0x7a04('0x18'),_0x7a04('0x60'),_0x7a04('0x61'),'source',_0x7a04('0x62'),'group',_0x7a04('0x63')];_[_0x7a04('0x64')](_0x40f6c8,function(_0x2f2d26){return _0x1a698b[_0x7a04('0x65')](_0x2f2d26[_0x7a04('0x27')])||!_0x2f2d26[_0x7a04('0x66')]&&_0x2f2d26[_0x7a04('0x2b')]!==_0x7a04('0x67')&&_0x2f2d26[_0x7a04('0x2b')]!=='custom_dropdown';});return{'count':_0x40f6c8[_0x7a04('0x34')],'rows':_[_0x7a04('0x29')](_0x40f6c8,function(_0x44eae7){return{'id':_0x44eae7[_0x7a04('0x27')],'name':_0x44eae7['label'],'custom':!_0x44eae7[_0x7a04('0x66')],'options':_0x44eae7['choices']?_['map'](_0x44eae7[_0x7a04('0x68')],function(_0x3b009a){return{'name':_['capitalize'](_0x3b009a),'value':_0x3b009a};}):[]};})};}})['then'](respondWithResult(_0x2c6970,null))['catch'](function(_0x1c0703){var _0x5c75b6=_0x261b10[_0x7a04('0x2d')][_0x7a04('0x69')]?0x1f4:_0x1c0703['statusCode']||0x1f4;logger[_0x7a04('0x25')](_0x7a04('0x6a'),'getFields',_0x5c75b6,JSON[_0x7a04('0x6b')](_0x1c0703));delete _0x1c0703[_0x7a04('0x27')];if(_0x5c75b6===0x191){_0x5c75b6=0x190;}_0x2c6970[_0x7a04('0x18')](_0x5c75b6)[_0x7a04('0x6c')](_0x261b10[_0x7a04('0x2d')]['test']?{'message':_0x7a04('0x6d'),'statusCode':_0x1c0703[_0x7a04('0x6e')]}:_0x1c0703);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index d343117..5863d79 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 _0x440b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x440b,0xc1));var _0xb440=function(_0x35167f,_0x3c9b67){_0x35167f=_0x35167f-0x0;var _0x302aec=_0x440b[_0x35167f];return _0x302aec;};'use strict';var _=require(_0xb440('0x0'));var util=require(_0xb440('0x1'));var logger=require(_0xb440('0x2'))(_0xb440('0x3'));var moment=require(_0xb440('0x4'));var BPromise=require(_0xb440('0x5'));var rp=require(_0xb440('0x6'));var fs=require('fs');var path=require(_0xb440('0x7'));var rimraf=require(_0xb440('0x8'));var config=require(_0xb440('0x9'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x29dc03,_0x498155){return _0x29dc03[_0xb440('0xa')](_0xb440('0xb'),attributes,{'tableName':_0xb440('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9aa5=['int_freshdesk_accounts','lodash','moment','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x3a3e91,_0x47e693){var _0x279162=function(_0x2db80d){while(--_0x2db80d){_0x3a3e91['push'](_0x3a3e91['shift']());}};_0x279162(++_0x47e693);}(_0x9aa5,0x97));var _0x59aa=function(_0x50d7fd,_0x30cd62){_0x50d7fd=_0x50d7fd-0x0;var _0x512b17=_0x9aa5[_0x50d7fd];return _0x512b17;};'use strict';var _=require(_0x59aa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x59aa('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x59aa('0x2'));var rimraf=require(_0x59aa('0x3'));var config=require('../../config/environment');var attributes=require(_0x59aa('0x4'));var integrations=require(_0x59aa('0x5'));module[_0x59aa('0x6')]=function(_0x156962,_0x3f02eb){return _0x156962[_0x59aa('0x7')](_0x59aa('0x8'),attributes,{'tableName':_0x59aa('0x9'),'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 0636b84..4275d9d 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 _0x4f15=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','ShowFreshdeskAccount','find','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x41fd49,_0xdb554b){var _0x383b2c=function(_0x262f49){while(--_0x262f49){_0x41fd49['push'](_0x41fd49['shift']());}};_0x383b2c(++_0xdb554b);}(_0x4f15,0x82));var _0x54f1=function(_0x2d664b,_0x3485d5){_0x2d664b=_0x2d664b-0x0;var _0x11d989=_0x4f15[_0x2d664b];return _0x11d989;};'use strict';var _=require(_0x54f1('0x0'));var util=require(_0x54f1('0x1'));var moment=require(_0x54f1('0x2'));var BPromise=require(_0x54f1('0x3'));var rs=require(_0x54f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54f1('0x5'))['db'];var utils=require(_0x54f1('0x6'));var logger=require(_0x54f1('0x7'))(_0x54f1('0x8'));var config=require('../../config/environment');var jayson=require(_0x54f1('0x9'));var client=jayson['client'][_0x54f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ad5d1,_0x2c0c0b,_0x4ab324){return new BPromise(function(_0x4b85bf,_0x370bff){return client['request'](_0x5ad5d1,_0x4ab324)[_0x54f1('0xb')](function(_0x390ea1){logger[_0x54f1('0xc')](_0x54f1('0xd'),_0x2c0c0b,_0x54f1('0xe'));logger[_0x54f1('0xf')](_0x54f1('0x10'),_0x2c0c0b,'request\x20sent',JSON['stringify'](_0x390ea1));if(_0x390ea1[_0x54f1('0x11')]){if(_0x390ea1['error'][_0x54f1('0x12')]===0x1f4){logger[_0x54f1('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x2c0c0b,_0x390ea1[_0x54f1('0x11')][_0x54f1('0x13')]);return _0x370bff(_0x390ea1['error']['message']);}logger[_0x54f1('0x11')](_0x54f1('0xd'),_0x2c0c0b,_0x390ea1[_0x54f1('0x11')]['message']);return _0x4b85bf(_0x390ea1[_0x54f1('0x11')][_0x54f1('0x13')]);}else{logger['info'](_0x54f1('0xd'),_0x2c0c0b,_0x54f1('0xe'));_0x4b85bf(_0x390ea1[_0x54f1('0x14')][_0x54f1('0x13')]);}})[_0x54f1('0x15')](function(_0x46d395){logger[_0x54f1('0x11')](_0x54f1('0xd'),_0x2c0c0b,_0x46d395);_0x370bff(_0x46d395);});});}exports[_0x54f1('0x16')]=function(_0x5a9d43){var _0x4bdad4=this;return new Promise(function(_0x318e7e,_0x2a2527){return db[_0x54f1('0x17')][_0x54f1('0x18')]({'raw':_0x5a9d43[_0x54f1('0x19')]?_0x5a9d43[_0x54f1('0x19')][_0x54f1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a9d43['options']?_0x5a9d43['options'][_0x54f1('0x1b')]||null:null,'attributes':_0x5a9d43[_0x54f1('0x19')]?_0x5a9d43[_0x54f1('0x19')][_0x54f1('0x1c')]||null:null,'limit':_0x5a9d43['options']?_0x5a9d43[_0x54f1('0x19')][_0x54f1('0x1d')]||null:null,'include':_0x5a9d43[_0x54f1('0x19')]?_0x5a9d43[_0x54f1('0x19')]['include']?_[_0x54f1('0x1e')](_0x5a9d43['options']['include'],function(_0x46e598){return{'model':db[_0x46e598[_0x54f1('0x1f')]],'as':_0x46e598['as'],'attributes':_0x46e598[_0x54f1('0x1c')],'include':_0x46e598[_0x54f1('0x20')]?_[_0x54f1('0x1e')](_0x46e598[_0x54f1('0x20')],function(_0x59b97d){return{'model':db[_0x59b97d[_0x54f1('0x1f')]],'as':_0x59b97d['as'],'attributes':_0x59b97d[_0x54f1('0x1c')],'include':_0x59b97d[_0x54f1('0x20')]?_[_0x54f1('0x1e')](_0x59b97d[_0x54f1('0x20')],function(_0x522883){return{'model':db[_0x522883[_0x54f1('0x1f')]],'as':_0x522883['as'],'attributes':_0x522883[_0x54f1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x54f1('0xb')](function(_0x1d191f){logger[_0x54f1('0xc')]('GetFreshdeskAccount',_0x5a9d43);logger['debug'](_0x54f1('0x16'),_0x5a9d43,JSON['stringify'](_0x1d191f));_0x318e7e(_0x1d191f);})['catch'](function(_0x4bb3be){logger[_0x54f1('0x11')](_0x54f1('0x16'),_0x4bb3be[_0x54f1('0x13')],_0x5a9d43);_0x2a2527(_0x4bdad4['error'](0x1f4,_0x4bb3be['message']));});});};exports[_0x54f1('0x21')]=function(_0x5b9025){var _0x5ddcaa=this;return new Promise(function(_0x5a2849,_0x26e281){return db['FreshdeskAccount'][_0x54f1('0x22')]({'raw':_0x5b9025[_0x54f1('0x19')]?_0x5b9025['options'][_0x54f1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b9025[_0x54f1('0x19')]?_0x5b9025['options'][_0x54f1('0x1b')]||null:null,'attributes':_0x5b9025[_0x54f1('0x19')]?_0x5b9025[_0x54f1('0x19')]['attributes']||null:null,'include':_0x5b9025[_0x54f1('0x19')]?_0x5b9025['options'][_0x54f1('0x20')]?_[_0x54f1('0x1e')](_0x5b9025[_0x54f1('0x19')][_0x54f1('0x20')],function(_0x5ec7c5){return{'model':db[_0x5ec7c5['model']],'as':_0x5ec7c5['as'],'attributes':_0x5ec7c5['attributes'],'include':_0x5ec7c5['include']?_['map'](_0x5ec7c5[_0x54f1('0x20')],function(_0x3c233c){return{'model':db[_0x3c233c[_0x54f1('0x1f')]],'as':_0x3c233c['as'],'attributes':_0x3c233c['attributes'],'include':_0x3c233c[_0x54f1('0x20')]?_[_0x54f1('0x1e')](_0x3c233c['include'],function(_0x4db9fd){return{'model':db[_0x4db9fd[_0x54f1('0x1f')]],'as':_0x4db9fd['as'],'attributes':_0x4db9fd[_0x54f1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x54f1('0xb')](function(_0x3823a9){logger[_0x54f1('0xc')]('ShowFreshdeskAccount',_0x5b9025);logger[_0x54f1('0xf')](_0x54f1('0x21'),_0x5b9025,JSON[_0x54f1('0x23')](_0x3823a9));_0x5a2849(_0x3823a9);})['catch'](function(_0x51a339){logger[_0x54f1('0x11')]('ShowFreshdeskAccount',_0x51a339[_0x54f1('0x13')],_0x5b9025);_0x26e281(_0x5ddcaa[_0x54f1('0x11')](0x1f4,_0x51a339[_0x54f1('0x13')]));});});}; \ No newline at end of file +var _0xdcbd=['code','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','include','map','model','attributes','then','stringify','ShowFreshdeskAccount','find','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xdcbd,0xb6));var _0xddcb=function(_0x477bf5,_0x1254f9){_0x477bf5=_0x477bf5-0x0;var _0x236554=_0xdcbd[_0x477bf5];return _0x236554;};'use strict';var _=require(_0xddcb('0x0'));var util=require('util');var moment=require(_0xddcb('0x1'));var BPromise=require(_0xddcb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddcb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xddcb('0x4'))(_0xddcb('0x5'));var config=require(_0xddcb('0x6'));var jayson=require(_0xddcb('0x7'));var client=jayson[_0xddcb('0x8')][_0xddcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x593eed,_0x371e6c,_0x3d4be8){return new BPromise(function(_0x10cdc3,_0x1af97a){return client['request'](_0x593eed,_0x3d4be8)['then'](function(_0x2c3039){logger[_0xddcb('0xa')](_0xddcb('0xb'),_0x371e6c,_0xddcb('0xc'));logger[_0xddcb('0xd')](_0xddcb('0xe'),_0x371e6c,_0xddcb('0xc'),JSON['stringify'](_0x2c3039));if(_0x2c3039[_0xddcb('0xf')]){if(_0x2c3039[_0xddcb('0xf')][_0xddcb('0x10')]===0x1f4){logger[_0xddcb('0xf')](_0xddcb('0xb'),_0x371e6c,_0x2c3039['error'][_0xddcb('0x11')]);return _0x1af97a(_0x2c3039['error'][_0xddcb('0x11')]);}logger[_0xddcb('0xf')](_0xddcb('0xb'),_0x371e6c,_0x2c3039['error'][_0xddcb('0x11')]);return _0x10cdc3(_0x2c3039[_0xddcb('0xf')][_0xddcb('0x11')]);}else{logger[_0xddcb('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x371e6c,'request\x20sent');_0x10cdc3(_0x2c3039['result'][_0xddcb('0x11')]);}})[_0xddcb('0x12')](function(_0x51ba41){logger[_0xddcb('0xf')](_0xddcb('0xb'),_0x371e6c,_0x51ba41);_0x1af97a(_0x51ba41);});});}exports[_0xddcb('0x13')]=function(_0x3ebe62){var _0x2598e5=this;return new Promise(function(_0x189cba,_0x181703){return db[_0xddcb('0x14')]['findAll']({'raw':_0x3ebe62[_0xddcb('0x15')]?_0x3ebe62[_0xddcb('0x15')][_0xddcb('0x16')]===undefined?!![]:![]:!![],'where':_0x3ebe62[_0xddcb('0x15')]?_0x3ebe62[_0xddcb('0x15')][_0xddcb('0x17')]||null:null,'attributes':_0x3ebe62[_0xddcb('0x15')]?_0x3ebe62['options']['attributes']||null:null,'limit':_0x3ebe62[_0xddcb('0x15')]?_0x3ebe62[_0xddcb('0x15')][_0xddcb('0x18')]||null:null,'include':_0x3ebe62[_0xddcb('0x15')]?_0x3ebe62[_0xddcb('0x15')][_0xddcb('0x19')]?_[_0xddcb('0x1a')](_0x3ebe62[_0xddcb('0x15')][_0xddcb('0x19')],function(_0x2fcae5){return{'model':db[_0x2fcae5[_0xddcb('0x1b')]],'as':_0x2fcae5['as'],'attributes':_0x2fcae5['attributes'],'include':_0x2fcae5[_0xddcb('0x19')]?_[_0xddcb('0x1a')](_0x2fcae5['include'],function(_0x30c5e5){return{'model':db[_0x30c5e5[_0xddcb('0x1b')]],'as':_0x30c5e5['as'],'attributes':_0x30c5e5['attributes'],'include':_0x30c5e5[_0xddcb('0x19')]?_[_0xddcb('0x1a')](_0x30c5e5[_0xddcb('0x19')],function(_0x45f62d){return{'model':db[_0x45f62d[_0xddcb('0x1b')]],'as':_0x45f62d['as'],'attributes':_0x45f62d[_0xddcb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xddcb('0x1d')](function(_0x5ad701){logger[_0xddcb('0xa')]('GetFreshdeskAccount',_0x3ebe62);logger['debug'](_0xddcb('0x13'),_0x3ebe62,JSON[_0xddcb('0x1e')](_0x5ad701));_0x189cba(_0x5ad701);})[_0xddcb('0x12')](function(_0x4c97a5){logger[_0xddcb('0xf')](_0xddcb('0x13'),_0x4c97a5[_0xddcb('0x11')],_0x3ebe62);_0x181703(_0x2598e5[_0xddcb('0xf')](0x1f4,_0x4c97a5[_0xddcb('0x11')]));});});};exports[_0xddcb('0x1f')]=function(_0x435e33){var _0x38f348=this;return new Promise(function(_0x4732cf,_0x242d14){return db[_0xddcb('0x14')][_0xddcb('0x20')]({'raw':_0x435e33[_0xddcb('0x15')]?_0x435e33[_0xddcb('0x15')][_0xddcb('0x16')]===undefined?!![]:![]:!![],'where':_0x435e33[_0xddcb('0x15')]?_0x435e33[_0xddcb('0x15')][_0xddcb('0x17')]||null:null,'attributes':_0x435e33['options']?_0x435e33[_0xddcb('0x15')][_0xddcb('0x1c')]||null:null,'include':_0x435e33[_0xddcb('0x15')]?_0x435e33[_0xddcb('0x15')][_0xddcb('0x19')]?_['map'](_0x435e33['options']['include'],function(_0xbc970c){return{'model':db[_0xbc970c['model']],'as':_0xbc970c['as'],'attributes':_0xbc970c[_0xddcb('0x1c')],'include':_0xbc970c[_0xddcb('0x19')]?_[_0xddcb('0x1a')](_0xbc970c[_0xddcb('0x19')],function(_0x57f726){return{'model':db[_0x57f726[_0xddcb('0x1b')]],'as':_0x57f726['as'],'attributes':_0x57f726[_0xddcb('0x1c')],'include':_0x57f726[_0xddcb('0x19')]?_['map'](_0x57f726[_0xddcb('0x19')],function(_0x355e0c){return{'model':db[_0x355e0c[_0xddcb('0x1b')]],'as':_0x355e0c['as'],'attributes':_0x355e0c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57a835){logger['info']('ShowFreshdeskAccount',_0x435e33);logger[_0xddcb('0xd')]('ShowFreshdeskAccount',_0x435e33,JSON['stringify'](_0x57a835));_0x4732cf(_0x57a835);})[_0xddcb('0x12')](function(_0x2b0a42){logger[_0xddcb('0xf')](_0xddcb('0x1f'),_0x2b0a42[_0xddcb('0x11')],_0x435e33);_0x242d14(_0x38f348[_0xddcb('0xf')](0x1f4,_0x2b0a42[_0xddcb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 329109b..59e0ade 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 _0x2ede=['util','path','connect-timeout','express','Router','fs-extra','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','/:id/descriptions','getTags','create','post','/:id/tags','setTags','update','delete','exports'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0x2ede,0x6e));var _0xe2ed=function(_0x43dc49,_0x4fe6ee){_0x43dc49=_0x43dc49-0x0;var _0x503b65=_0x2ede[_0x43dc49];return _0x503b65;};'use strict';var multer=require('multer');var util=require(_0xe2ed('0x0'));var path=require(_0xe2ed('0x1'));var timeout=require(_0xe2ed('0x2'));var express=require(_0xe2ed('0x3'));var router=express[_0xe2ed('0x4')]();var fs_extra=require(_0xe2ed('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe2ed('0x6'));router[_0xe2ed('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe2ed('0x7')](_0xe2ed('0x8'),auth[_0xe2ed('0x9')](),controller[_0xe2ed('0xa')]);router[_0xe2ed('0x7')]('/:id/fields',auth[_0xe2ed('0x9')](),controller[_0xe2ed('0xb')]);router[_0xe2ed('0x7')](_0xe2ed('0xc'),auth[_0xe2ed('0x9')](),controller['getSubjects']);router[_0xe2ed('0x7')](_0xe2ed('0xd'),auth[_0xe2ed('0x9')](),controller['getDescriptions']);router[_0xe2ed('0x7')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe2ed('0xe')]);router['post']('/',auth[_0xe2ed('0x9')](),controller[_0xe2ed('0xf')]);router[_0xe2ed('0x10')](_0xe2ed('0x11'),auth[_0xe2ed('0x9')](),controller[_0xe2ed('0x12')]);router['put'](_0xe2ed('0x8'),auth[_0xe2ed('0x9')](),controller[_0xe2ed('0x13')]);router[_0xe2ed('0x14')](_0xe2ed('0x8'),auth[_0xe2ed('0x9')](),controller['destroy']);module[_0xe2ed('0x15')]=router; \ No newline at end of file +var _0x6a53=['post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x6a53,0x99));var _0x36a5=function(_0x1508e9,_0x5dfaec){_0x1508e9=_0x1508e9-0x0;var _0x5a0bf5=_0x6a53[_0x1508e9];return _0x5a0bf5;};'use strict';var multer=require('multer');var util=require(_0x36a5('0x0'));var path=require(_0x36a5('0x1'));var timeout=require(_0x36a5('0x2'));var express=require(_0x36a5('0x3'));var router=express[_0x36a5('0x4')]();var fs_extra=require(_0x36a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x36a5('0x6'));var config=require(_0x36a5('0x7'));var controller=require(_0x36a5('0x8'));router['get']('/',auth[_0x36a5('0x9')](),controller[_0x36a5('0xa')]);router[_0x36a5('0xb')](_0x36a5('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x36a5('0xd'),auth[_0x36a5('0x9')](),controller[_0x36a5('0xe')]);router['get'](_0x36a5('0xf'),auth[_0x36a5('0x9')](),controller[_0x36a5('0x10')]);router[_0x36a5('0xb')](_0x36a5('0x11'),auth['isAuthenticated'](),controller[_0x36a5('0x12')]);router['get'](_0x36a5('0x13'),auth['isAuthenticated'](),controller[_0x36a5('0x14')]);router[_0x36a5('0x15')]('/',auth[_0x36a5('0x9')](),controller[_0x36a5('0x16')]);router[_0x36a5('0x15')](_0x36a5('0x13'),auth[_0x36a5('0x9')](),controller[_0x36a5('0x17')]);router[_0x36a5('0x18')](_0x36a5('0xc'),auth[_0x36a5('0x9')](),controller[_0x36a5('0x19')]);router[_0x36a5('0x1a')](_0x36a5('0xc'),auth[_0x36a5('0x9')](),controller[_0x36a5('0x1b')]);module[_0x36a5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 4056254..604a222 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 _0xf440=['STRING','exports'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xf440,0x149));var _0x0f44=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf440[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0x0f44('0x0')]={'name':{'type':Sequelize[_0x0f44('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0b09=['STRING'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x0b09,0x163));var _0x90b0=function(_0x2aaa17,_0x402daa){_0x2aaa17=_0x2aaa17-0x0;var _0x2b5678=_0x0b09[_0x2aaa17];return _0x2b5678;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x90b0('0x0')]},'description':{'type':Sequelize[_0x90b0('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 374ccf0..35798ae 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 _0xca24=['../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','save','then','destroy','error','name','send','index','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskConfiguration','include','findAll','rows','catch','params','rawAttributes','find','create','body','update','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','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'];(function(_0x3c9268,_0x1a0c1f){var _0x4c62e5=function(_0x1d79c0){while(--_0x1d79c0){_0x3c9268['push'](_0x3c9268['shift']());}};_0x4c62e5(++_0x1a0c1f);}(_0xca24,0xe9));var _0x4ca2=function(_0x2cfda1,_0x2cfe2a){_0x2cfda1=_0x2cfda1-0x0;var _0x3c61cf=_0xca24[_0x2cfda1];return _0x3c61cf;};'use strict';var emlformat=require(_0x4ca2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ca2('0x1'));var jsonpatch=require(_0x4ca2('0x2'));var rp=require('request-promise');var moment=require(_0x4ca2('0x3'));var BPromise=require(_0x4ca2('0x4'));var Mustache=require('mustache');var util=require(_0x4ca2('0x5'));var path=require(_0x4ca2('0x6'));var sox=require(_0x4ca2('0x7'));var csv=require(_0x4ca2('0x8'));var ejs=require(_0x4ca2('0x9'));var fs=require('fs');var fs_extra=require(_0x4ca2('0xa'));var _=require(_0x4ca2('0xb'));var squel=require(_0x4ca2('0xc'));var crypto=require(_0x4ca2('0xd'));var jsforce=require(_0x4ca2('0xe'));var deskjs=require(_0x4ca2('0xf'));var toCsv=require(_0x4ca2('0x8'));var querystring=require(_0x4ca2('0x10'));var Papa=require(_0x4ca2('0x11'));var Redis=require(_0x4ca2('0x12'));var authService=require(_0x4ca2('0x13'));var qs=require(_0x4ca2('0x14'));var as=require(_0x4ca2('0x15'));var hardwareService=require(_0x4ca2('0x16'));var logger=require(_0x4ca2('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4ca2('0x18'));var licenseUtil=require(_0x4ca2('0x19'));var db=require(_0x4ca2('0x1a'))['db'];function respondWithStatusCode(_0x5a2273,_0x1c8def){_0x1c8def=_0x1c8def||0xcc;return function(_0xc86e71){if(_0xc86e71){return _0x5a2273[_0x4ca2('0x1b')](_0x1c8def);}return _0x5a2273['status'](_0x1c8def)[_0x4ca2('0x1c')]();};}function respondWithResult(_0x8ce1d4,_0x45232d){_0x45232d=_0x45232d||0xc8;return function(_0x20572b){if(_0x20572b){return _0x8ce1d4['status'](_0x45232d)['json'](_0x20572b);}};}function respondWithFilteredResult(_0x1a1ed6,_0x516cec){return function(_0x538396){if(_0x538396){var _0x354fd3=typeof _0x516cec[_0x4ca2('0x1d')]===_0x4ca2('0x1e')&&typeof _0x516cec[_0x4ca2('0x1f')]===_0x4ca2('0x1e');var _0x1d506c=_0x538396[_0x4ca2('0x20')];var _0x43a1b0=_0x354fd3?0x0:_0x516cec[_0x4ca2('0x1d')];var _0x4d21f0=_0x354fd3?_0x538396[_0x4ca2('0x20')]:_0x516cec[_0x4ca2('0x1d')]+_0x516cec['limit'];var _0x565687;if(_0x4d21f0>=_0x1d506c){_0x4d21f0=_0x1d506c;_0x565687=0xc8;}else{_0x565687=0xce;}_0x1a1ed6[_0x4ca2('0x21')](_0x565687);return _0x1a1ed6[_0x4ca2('0x22')](_0x4ca2('0x23'),_0x43a1b0+'-'+_0x4d21f0+'/'+_0x1d506c)[_0x4ca2('0x24')](_0x538396);}return null;};}function patchUpdates(_0xc5744f){return function(_0x1ae9c8){try{jsonpatch['apply'](_0x1ae9c8,_0xc5744f,!![]);}catch(_0x4fe78b){return BPromise['reject'](_0x4fe78b);}return _0x1ae9c8[_0x4ca2('0x25')]();};}function saveUpdates(_0xf846cf,_0xb429b9){return function(_0x1c998b){if(_0x1c998b){return _0x1c998b['update'](_0xf846cf)[_0x4ca2('0x26')](function(_0x44f420){return _0x44f420;});}return null;};}function removeEntity(_0x420694,_0x2fd673){return function(_0xee2067){if(_0xee2067){return _0xee2067[_0x4ca2('0x27')]()[_0x4ca2('0x26')](function(){_0x420694[_0x4ca2('0x21')](0xcc)[_0x4ca2('0x1c')]();});}};}function handleEntityNotFound(_0x410141,_0x1c8b8f){return function(_0x5f0829){if(!_0x5f0829){_0x410141['sendStatus'](0x194);}return _0x5f0829;};}function handleError(_0x5407ef,_0x4b0054){_0x4b0054=_0x4b0054||0x1f4;return function(_0x890490){logger[_0x4ca2('0x28')](_0x890490['stack']);if(_0x890490[_0x4ca2('0x29')]){delete _0x890490[_0x4ca2('0x29')];}_0x5407ef[_0x4ca2('0x21')](_0x4b0054)[_0x4ca2('0x2a')](_0x890490);};}exports[_0x4ca2('0x2b')]=function(_0x122fdf,_0x596ce8){var _0x201f91={},_0x1004d6={},_0xc67d40={'count':0x0,'rows':[]};var _0x4f00f2=_['map'](db['FreshdeskConfiguration']['rawAttributes'],function(_0x329aea){return{'name':_0x329aea[_0x4ca2('0x2c')],'type':_0x329aea['type'][_0x4ca2('0x2d')]};});_0x1004d6[_0x4ca2('0x2e')]=_[_0x4ca2('0x2f')](_0x4f00f2,'name');_0x1004d6['query']=_[_0x4ca2('0x30')](_0x122fdf['query']);_0x1004d6[_0x4ca2('0x31')]=_[_0x4ca2('0x32')](_0x1004d6[_0x4ca2('0x2e')],_0x1004d6[_0x4ca2('0x33')]);_0x201f91[_0x4ca2('0x34')]=_[_0x4ca2('0x32')](_0x1004d6[_0x4ca2('0x2e')],qs['fields'](_0x122fdf[_0x4ca2('0x33')][_0x4ca2('0x35')]));_0x201f91['attributes']=_0x201f91[_0x4ca2('0x34')][_0x4ca2('0x36')]?_0x201f91[_0x4ca2('0x34')]:_0x1004d6['model'];if(!_0x122fdf[_0x4ca2('0x33')]['hasOwnProperty'](_0x4ca2('0x37'))){_0x201f91['limit']=qs['limit'](_0x122fdf['query'][_0x4ca2('0x1f')]);_0x201f91[_0x4ca2('0x1d')]=qs[_0x4ca2('0x1d')](_0x122fdf[_0x4ca2('0x33')]['offset']);}_0x201f91[_0x4ca2('0x38')]=qs[_0x4ca2('0x39')](_0x122fdf[_0x4ca2('0x33')][_0x4ca2('0x39')]);_0x201f91[_0x4ca2('0x3a')]=qs['filters'](_[_0x4ca2('0x3b')](_0x122fdf[_0x4ca2('0x33')],_0x1004d6[_0x4ca2('0x31')]),_0x4f00f2);if(_0x122fdf[_0x4ca2('0x33')][_0x4ca2('0x3c')]){_0x201f91[_0x4ca2('0x3a')]=_[_0x4ca2('0x3d')](_0x201f91[_0x4ca2('0x3a')],{'$or':_[_0x4ca2('0x2f')](_0x4f00f2,function(_0x266137){if(_0x266137[_0x4ca2('0x3e')]!==_0x4ca2('0x3f')){var _0x2b55f8={};_0x2b55f8[_0x266137[_0x4ca2('0x29')]]={'$like':'%'+_0x122fdf[_0x4ca2('0x33')][_0x4ca2('0x3c')]+'%'};return _0x2b55f8;}})});}_0x201f91=_[_0x4ca2('0x3d')]({},_0x201f91,_0x122fdf[_0x4ca2('0x40')]);var _0x2bc87f={'where':_0x201f91['where']};return db[_0x4ca2('0x41')][_0x4ca2('0x20')](_0x2bc87f)[_0x4ca2('0x26')](function(_0x209415){_0xc67d40[_0x4ca2('0x20')]=_0x209415;if(_0x122fdf[_0x4ca2('0x33')]['includeAll']){_0x201f91[_0x4ca2('0x42')]=[{'all':!![]}];}return db[_0x4ca2('0x41')][_0x4ca2('0x43')](_0x201f91);})[_0x4ca2('0x26')](function(_0x25e909){_0xc67d40[_0x4ca2('0x44')]=_0x25e909;return _0xc67d40;})[_0x4ca2('0x26')](respondWithFilteredResult(_0x596ce8,_0x201f91))[_0x4ca2('0x45')](handleError(_0x596ce8,null));};exports['show']=function(_0x777dff,_0x4f0dfc){var _0x3e87e6={'raw':![],'where':{'id':_0x777dff[_0x4ca2('0x46')]['id']}},_0x562575={};_0x562575[_0x4ca2('0x2e')]=_[_0x4ca2('0x30')](db[_0x4ca2('0x41')][_0x4ca2('0x47')]);_0x562575[_0x4ca2('0x33')]=_[_0x4ca2('0x30')](_0x777dff[_0x4ca2('0x33')]);_0x562575[_0x4ca2('0x31')]=_['intersection'](_0x562575['model'],_0x562575[_0x4ca2('0x33')]);_0x3e87e6[_0x4ca2('0x34')]=_[_0x4ca2('0x32')](_0x562575['model'],qs[_0x4ca2('0x35')](_0x777dff['query']['fields']));_0x3e87e6[_0x4ca2('0x34')]=_0x3e87e6['attributes'][_0x4ca2('0x36')]?_0x3e87e6[_0x4ca2('0x34')]:_0x562575['model'];if(_0x777dff[_0x4ca2('0x33')]['includeAll']){_0x3e87e6[_0x4ca2('0x42')]=[{'all':!![]}];}_0x3e87e6=_[_0x4ca2('0x3d')]({},_0x3e87e6,_0x777dff[_0x4ca2('0x40')]);return db['FreshdeskConfiguration'][_0x4ca2('0x48')](_0x3e87e6)[_0x4ca2('0x26')](handleEntityNotFound(_0x4f0dfc,null))[_0x4ca2('0x26')](respondWithResult(_0x4f0dfc,null))[_0x4ca2('0x45')](handleError(_0x4f0dfc,null));};exports[_0x4ca2('0x49')]=function(_0x2059b3,_0x3abd6b){return db['FreshdeskConfiguration'][_0x4ca2('0x49')](_0x2059b3[_0x4ca2('0x4a')],{})[_0x4ca2('0x26')](respondWithResult(_0x3abd6b,0xc9))[_0x4ca2('0x45')](handleError(_0x3abd6b,null));};exports[_0x4ca2('0x4b')]=function(_0x27b83e,_0x5e84fb){if(_0x27b83e['body']['id']){delete _0x27b83e['body']['id'];}return db['FreshdeskConfiguration'][_0x4ca2('0x48')]({'where':{'id':_0x27b83e[_0x4ca2('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e84fb,null))[_0x4ca2('0x26')](saveUpdates(_0x27b83e[_0x4ca2('0x4a')],null))['then'](respondWithResult(_0x5e84fb,null))[_0x4ca2('0x45')](handleError(_0x5e84fb,null));};exports['destroy']=function(_0x41764d,_0x44d1f7){return db[_0x4ca2('0x41')][_0x4ca2('0x48')]({'where':{'id':_0x41764d['params']['id']}})['then'](handleEntityNotFound(_0x44d1f7,null))['then'](removeEntity(_0x44d1f7,null))['catch'](handleError(_0x44d1f7,null));};exports[_0x4ca2('0x4c')]=function(_0x36b521,_0x4a3f67,_0x3890c6){var _0x222a02={};var _0x5e4e69={};var _0xf4b2a1;var _0x2a1c2c;return db['FreshdeskConfiguration'][_0x4ca2('0x4d')]({'where':{'id':_0x36b521[_0x4ca2('0x46')]['id']}})[_0x4ca2('0x26')](handleEntityNotFound(_0x4a3f67,null))[_0x4ca2('0x26')](function(_0x5444ab){if(_0x5444ab){_0xf4b2a1=_0x5444ab;_0x5e4e69[_0x4ca2('0x2e')]=_[_0x4ca2('0x30')](db[_0x4ca2('0x4e')]['rawAttributes']);_0x5e4e69[_0x4ca2('0x33')]=_[_0x4ca2('0x30')](_0x36b521[_0x4ca2('0x33')]);_0x5e4e69[_0x4ca2('0x31')]=_[_0x4ca2('0x32')](_0x5e4e69['model'],_0x5e4e69['query']);_0x222a02[_0x4ca2('0x34')]=_[_0x4ca2('0x32')](_0x5e4e69[_0x4ca2('0x2e')],qs[_0x4ca2('0x35')](_0x36b521[_0x4ca2('0x33')][_0x4ca2('0x35')]));_0x222a02[_0x4ca2('0x34')]=_0x222a02[_0x4ca2('0x34')]['length']?_0x222a02[_0x4ca2('0x34')]:_0x5e4e69['model'];_0x222a02[_0x4ca2('0x38')]=qs[_0x4ca2('0x39')](_0x36b521[_0x4ca2('0x33')][_0x4ca2('0x39')]);_0x222a02[_0x4ca2('0x3a')]=qs[_0x4ca2('0x31')](_['pick'](_0x36b521[_0x4ca2('0x33')],_0x5e4e69[_0x4ca2('0x31')]));if(_0x36b521['query'][_0x4ca2('0x3c')]){_0x222a02[_0x4ca2('0x3a')]=_[_0x4ca2('0x3d')](_0x222a02['where'],{'$or':_[_0x4ca2('0x2f')](_0x222a02[_0x4ca2('0x34')],function(_0xad0df2){var _0x1368c6={};_0x1368c6[_0xad0df2]={'$like':'%'+_0x36b521[_0x4ca2('0x33')][_0x4ca2('0x3c')]+'%'};return _0x1368c6;})});}_0x222a02=_[_0x4ca2('0x3d')]({},_0x222a02,_0x36b521['options']);return _0xf4b2a1[_0x4ca2('0x4c')](_0x222a02);}})[_0x4ca2('0x26')](function(_0x4426e3){if(_0x4426e3){_0x2a1c2c=_0x4426e3[_0x4ca2('0x36')];if(!_0x36b521[_0x4ca2('0x33')][_0x4ca2('0x4f')](_0x4ca2('0x37'))){_0x222a02[_0x4ca2('0x1f')]=qs[_0x4ca2('0x1f')](_0x36b521[_0x4ca2('0x33')][_0x4ca2('0x1f')]);_0x222a02[_0x4ca2('0x1d')]=qs[_0x4ca2('0x1d')](_0x36b521[_0x4ca2('0x33')][_0x4ca2('0x1d')]);}return _0xf4b2a1[_0x4ca2('0x4c')](_0x222a02);}})['then'](function(_0x268fe7){if(_0x268fe7){return _0x268fe7?{'count':_0x2a1c2c,'rows':_0x268fe7}:null;}})[_0x4ca2('0x26')](respondWithResult(_0x4a3f67,null))['catch'](handleError(_0x4a3f67,null));};exports[_0x4ca2('0x50')]=function(_0x412a5b,_0x15508b,_0x51a105){var _0x1d971c={};var _0xb74e4f={};var _0x3d2d74;var _0x3b6047;return db[_0x4ca2('0x41')][_0x4ca2('0x4d')]({'where':{'id':_0x412a5b[_0x4ca2('0x46')]['id']}})[_0x4ca2('0x26')](handleEntityNotFound(_0x15508b,null))[_0x4ca2('0x26')](function(_0x5f082c){if(_0x5f082c){_0x3d2d74=_0x5f082c;_0xb74e4f[_0x4ca2('0x2e')]=_[_0x4ca2('0x30')](db[_0x4ca2('0x4e')][_0x4ca2('0x47')]);_0xb74e4f[_0x4ca2('0x33')]=_[_0x4ca2('0x30')](_0x412a5b['query']);_0xb74e4f['filters']=_[_0x4ca2('0x32')](_0xb74e4f[_0x4ca2('0x2e')],_0xb74e4f['query']);_0x1d971c[_0x4ca2('0x34')]=_[_0x4ca2('0x32')](_0xb74e4f[_0x4ca2('0x2e')],qs[_0x4ca2('0x35')](_0x412a5b['query']['fields']));_0x1d971c[_0x4ca2('0x34')]=_0x1d971c['attributes'][_0x4ca2('0x36')]?_0x1d971c['attributes']:_0xb74e4f['model'];_0x1d971c['order']=qs[_0x4ca2('0x39')](_0x412a5b['query']['sort']);_0x1d971c['where']=qs[_0x4ca2('0x31')](_[_0x4ca2('0x3b')](_0x412a5b[_0x4ca2('0x33')],_0xb74e4f[_0x4ca2('0x31')]));if(_0x412a5b[_0x4ca2('0x33')][_0x4ca2('0x3c')]){_0x1d971c['where']=_[_0x4ca2('0x3d')](_0x1d971c['where'],{'$or':_[_0x4ca2('0x2f')](_0x1d971c[_0x4ca2('0x34')],function(_0x43d5a1){var _0x12b258={};_0x12b258[_0x43d5a1]={'$like':'%'+_0x412a5b['query']['filter']+'%'};return _0x12b258;})});}_0x1d971c=_[_0x4ca2('0x3d')]({},_0x1d971c,_0x412a5b['options']);return _0x3d2d74[_0x4ca2('0x50')](_0x1d971c);}})[_0x4ca2('0x26')](function(_0x4b7a02){if(_0x4b7a02){_0x3b6047=_0x4b7a02[_0x4ca2('0x36')];if(!_0x412a5b[_0x4ca2('0x33')][_0x4ca2('0x4f')](_0x4ca2('0x37'))){_0x1d971c[_0x4ca2('0x1f')]=qs[_0x4ca2('0x1f')](_0x412a5b[_0x4ca2('0x33')][_0x4ca2('0x1f')]);_0x1d971c[_0x4ca2('0x1d')]=qs[_0x4ca2('0x1d')](_0x412a5b[_0x4ca2('0x33')][_0x4ca2('0x1d')]);}return _0x3d2d74[_0x4ca2('0x50')](_0x1d971c);}})[_0x4ca2('0x26')](function(_0x4c177e){if(_0x4c177e){return _0x4c177e?{'count':_0x3b6047,'rows':_0x4c177e}:null;}})[_0x4ca2('0x26')](respondWithResult(_0x15508b,null))['catch'](handleError(_0x15508b,null));};exports[_0x4ca2('0x51')]=function(_0x51b4ad,_0x26f9d4,_0x38ebdb){var _0x5496e4={};var _0x7be125={};var _0x36fd42;var _0x7116d;return db['FreshdeskConfiguration'][_0x4ca2('0x4d')]({'where':{'id':_0x51b4ad[_0x4ca2('0x46')]['id']}})[_0x4ca2('0x26')](handleEntityNotFound(_0x26f9d4,null))[_0x4ca2('0x26')](function(_0x343025){if(_0x343025){_0x36fd42=_0x343025;_0x7be125[_0x4ca2('0x2e')]=_[_0x4ca2('0x30')](db[_0x4ca2('0x4e')][_0x4ca2('0x47')]);_0x7be125['query']=_[_0x4ca2('0x30')](_0x51b4ad['query']);_0x7be125['filters']=_[_0x4ca2('0x32')](_0x7be125[_0x4ca2('0x2e')],_0x7be125[_0x4ca2('0x33')]);_0x5496e4[_0x4ca2('0x34')]=_[_0x4ca2('0x32')](_0x7be125[_0x4ca2('0x2e')],qs[_0x4ca2('0x35')](_0x51b4ad['query']['fields']));_0x5496e4['attributes']=_0x5496e4[_0x4ca2('0x34')]['length']?_0x5496e4['attributes']:_0x7be125[_0x4ca2('0x2e')];_0x5496e4['order']=qs[_0x4ca2('0x39')](_0x51b4ad[_0x4ca2('0x33')][_0x4ca2('0x39')]);_0x5496e4[_0x4ca2('0x3a')]=qs[_0x4ca2('0x31')](_['pick'](_0x51b4ad[_0x4ca2('0x33')],_0x7be125[_0x4ca2('0x31')]));if(_0x51b4ad[_0x4ca2('0x33')][_0x4ca2('0x3c')]){_0x5496e4['where']=_[_0x4ca2('0x3d')](_0x5496e4[_0x4ca2('0x3a')],{'$or':_['map'](_0x5496e4['attributes'],function(_0x58c0b2){var _0x219f43={};_0x219f43[_0x58c0b2]={'$like':'%'+_0x51b4ad[_0x4ca2('0x33')]['filter']+'%'};return _0x219f43;})});}_0x5496e4=_[_0x4ca2('0x3d')]({},_0x5496e4,_0x51b4ad['options']);return _0x36fd42[_0x4ca2('0x51')](_0x5496e4);}})[_0x4ca2('0x26')](function(_0x4ee59f){if(_0x4ee59f){_0x7116d=_0x4ee59f[_0x4ca2('0x36')];if(!_0x51b4ad[_0x4ca2('0x33')]['hasOwnProperty'](_0x4ca2('0x37'))){_0x5496e4[_0x4ca2('0x1f')]=qs[_0x4ca2('0x1f')](_0x51b4ad[_0x4ca2('0x33')]['limit']);_0x5496e4['offset']=qs[_0x4ca2('0x1d')](_0x51b4ad[_0x4ca2('0x33')][_0x4ca2('0x1d')]);}return _0x36fd42[_0x4ca2('0x51')](_0x5496e4);}})[_0x4ca2('0x26')](function(_0x27335e){if(_0x27335e){return _0x27335e?{'count':_0x7116d,'rows':_0x27335e}:null;}})[_0x4ca2('0x26')](respondWithResult(_0x26f9d4,null))[_0x4ca2('0x45')](handleError(_0x26f9d4,null));};exports[_0x4ca2('0x52')]=function(_0x589f5b,_0x315b5a,_0x37a868){var _0x15b84a={};var _0x4bdde8={};var _0x41c2de;var _0xe8c779;return db[_0x4ca2('0x41')][_0x4ca2('0x4d')]({'where':{'id':_0x589f5b[_0x4ca2('0x46')]['id']}})[_0x4ca2('0x26')](handleEntityNotFound(_0x315b5a,null))[_0x4ca2('0x26')](function(_0x524bcd){if(_0x524bcd){_0x41c2de=_0x524bcd;_0x4bdde8['model']=_[_0x4ca2('0x30')](db[_0x4ca2('0x53')][_0x4ca2('0x47')]);_0x4bdde8[_0x4ca2('0x33')]=_[_0x4ca2('0x30')](_0x589f5b[_0x4ca2('0x33')]);_0x4bdde8[_0x4ca2('0x31')]=_['intersection'](_0x4bdde8[_0x4ca2('0x2e')],_0x4bdde8['query']);_0x15b84a[_0x4ca2('0x34')]=_[_0x4ca2('0x32')](_0x4bdde8['model'],qs[_0x4ca2('0x35')](_0x589f5b[_0x4ca2('0x33')][_0x4ca2('0x35')]));_0x15b84a['attributes']=_0x15b84a[_0x4ca2('0x34')][_0x4ca2('0x36')]?_0x15b84a[_0x4ca2('0x34')]:_0x4bdde8[_0x4ca2('0x2e')];_0x15b84a['order']=qs[_0x4ca2('0x39')](_0x589f5b[_0x4ca2('0x33')]['sort']);_0x15b84a[_0x4ca2('0x3a')]=qs[_0x4ca2('0x31')](_['pick'](_0x589f5b[_0x4ca2('0x33')],_0x4bdde8[_0x4ca2('0x31')]));if(_0x589f5b[_0x4ca2('0x33')]['filter']){_0x15b84a[_0x4ca2('0x3a')]=_[_0x4ca2('0x3d')](_0x15b84a[_0x4ca2('0x3a')],{'$or':_[_0x4ca2('0x2f')](_0x15b84a[_0x4ca2('0x34')],function(_0x527a45){var _0x43f2ce={};_0x43f2ce[_0x527a45]={'$like':'%'+_0x589f5b[_0x4ca2('0x33')][_0x4ca2('0x3c')]+'%'};return _0x43f2ce;})});}_0x15b84a=_[_0x4ca2('0x3d')]({},_0x15b84a,_0x589f5b[_0x4ca2('0x40')]);return _0x41c2de['getTags'](_0x15b84a);}})[_0x4ca2('0x26')](function(_0x4363f9){if(_0x4363f9){_0xe8c779=_0x4363f9[_0x4ca2('0x36')];if(!_0x589f5b[_0x4ca2('0x33')]['hasOwnProperty']('nolimit')){_0x15b84a['limit']=qs[_0x4ca2('0x1f')](_0x589f5b['query']['limit']);_0x15b84a[_0x4ca2('0x1d')]=qs[_0x4ca2('0x1d')](_0x589f5b[_0x4ca2('0x33')][_0x4ca2('0x1d')]);}return _0x41c2de[_0x4ca2('0x52')](_0x15b84a);}})[_0x4ca2('0x26')](function(_0x36fb1e){if(_0x36fb1e){return _0x36fb1e?{'count':_0xe8c779,'rows':_0x36fb1e}:null;}})[_0x4ca2('0x26')](respondWithResult(_0x315b5a,null))[_0x4ca2('0x45')](handleError(_0x315b5a,null));};exports['setTags']=function(_0x4ed4b8,_0x25f417,_0x2a84f3){if(_0x4ed4b8[_0x4ca2('0x4a')]['id']){delete _0x4ed4b8[_0x4ca2('0x4a')]['id'];}return db[_0x4ca2('0x41')][_0x4ca2('0x4d')]({'where':{'id':_0x4ed4b8[_0x4ca2('0x46')]['id']}})[_0x4ca2('0x26')](handleEntityNotFound(_0x25f417,null))[_0x4ca2('0x26')](function(_0x52a7f6){if(_0x52a7f6){return _0x52a7f6[_0x4ca2('0x54')](_0x4ed4b8[_0x4ca2('0x4a')][_0x4ca2('0x55')]||[]);}return null;})[_0x4ca2('0x26')](respondWithResult(_0x25f417,null))[_0x4ca2('0x45')](handleError(_0x25f417,null));}; \ No newline at end of file +var _0x5c29=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','FreshdeskConfiguration','count','includeAll','rows','catch','show','params','find','create','body','getFields','findOne','FreshdeskField','nolimit','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra'];(function(_0x51caa0,_0x2b5511){var _0x2d89e4=function(_0x1cec4f){while(--_0x1cec4f){_0x51caa0['push'](_0x51caa0['shift']());}};_0x2d89e4(++_0x2b5511);}(_0x5c29,0x13a));var _0x95c2=function(_0x13b3bf,_0x107385){_0x13b3bf=_0x13b3bf-0x0;var _0x7968b8=_0x5c29[_0x13b3bf];return _0x7968b8;};'use strict';var emlformat=require(_0x95c2('0x0'));var rimraf=require(_0x95c2('0x1'));var zipdir=require(_0x95c2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95c2('0x3'));var moment=require(_0x95c2('0x4'));var BPromise=require(_0x95c2('0x5'));var Mustache=require(_0x95c2('0x6'));var util=require('util');var path=require(_0x95c2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x95c2('0x8'));var fs=require('fs');var fs_extra=require(_0x95c2('0x9'));var _=require(_0x95c2('0xa'));var squel=require(_0x95c2('0xb'));var crypto=require(_0x95c2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x95c2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x95c2('0xe'));var Papa=require('papaparse');var Redis=require(_0x95c2('0xf'));var authService=require(_0x95c2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95c2('0x11'));var logger=require(_0x95c2('0x12'))('api');var utils=require(_0x95c2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x95c2('0x14'));var db=require(_0x95c2('0x15'))['db'];function respondWithStatusCode(_0x4937e4,_0x5057d7){_0x5057d7=_0x5057d7||0xcc;return function(_0x1efa5c){if(_0x1efa5c){return _0x4937e4[_0x95c2('0x16')](_0x5057d7);}return _0x4937e4[_0x95c2('0x17')](_0x5057d7)[_0x95c2('0x18')]();};}function respondWithResult(_0x5b2860,_0x282118){_0x282118=_0x282118||0xc8;return function(_0x38f00a){if(_0x38f00a){return _0x5b2860[_0x95c2('0x17')](_0x282118)['json'](_0x38f00a);}};}function respondWithFilteredResult(_0x229071,_0x38ebea){return function(_0x3dec28){if(_0x3dec28){var _0x123d66=typeof _0x38ebea[_0x95c2('0x19')]===_0x95c2('0x1a')&&typeof _0x38ebea[_0x95c2('0x1b')]===_0x95c2('0x1a');var _0x3b8029=_0x3dec28['count'];var _0x3effa2=_0x123d66?0x0:_0x38ebea[_0x95c2('0x19')];var _0x4a060c=_0x123d66?_0x3dec28['count']:_0x38ebea[_0x95c2('0x19')]+_0x38ebea['limit'];var _0x5930bc;if(_0x4a060c>=_0x3b8029){_0x4a060c=_0x3b8029;_0x5930bc=0xc8;}else{_0x5930bc=0xce;}_0x229071[_0x95c2('0x17')](_0x5930bc);return _0x229071[_0x95c2('0x1c')](_0x95c2('0x1d'),_0x3effa2+'-'+_0x4a060c+'/'+_0x3b8029)[_0x95c2('0x1e')](_0x3dec28);}return null;};}function patchUpdates(_0x122989){return function(_0x11b73d){try{jsonpatch[_0x95c2('0x1f')](_0x11b73d,_0x122989,!![]);}catch(_0x4b0b34){return BPromise[_0x95c2('0x20')](_0x4b0b34);}return _0x11b73d[_0x95c2('0x21')]();};}function saveUpdates(_0x400dc6,_0x368249){return function(_0x237bca){if(_0x237bca){return _0x237bca[_0x95c2('0x22')](_0x400dc6)['then'](function(_0x46a8b1){return _0x46a8b1;});}return null;};}function removeEntity(_0x1775a0,_0x28b7ea){return function(_0x19356c){if(_0x19356c){return _0x19356c[_0x95c2('0x23')]()[_0x95c2('0x24')](function(){_0x1775a0[_0x95c2('0x17')](0xcc)[_0x95c2('0x18')]();});}};}function handleEntityNotFound(_0x64a91b,_0x41bc5e){return function(_0x4edf81){if(!_0x4edf81){_0x64a91b[_0x95c2('0x16')](0x194);}return _0x4edf81;};}function handleError(_0x3e79d3,_0x4dabd8){_0x4dabd8=_0x4dabd8||0x1f4;return function(_0x54134f){logger['error'](_0x54134f['stack']);if(_0x54134f['name']){delete _0x54134f[_0x95c2('0x25')];}_0x3e79d3[_0x95c2('0x17')](_0x4dabd8)[_0x95c2('0x26')](_0x54134f);};}exports[_0x95c2('0x27')]=function(_0x13ca10,_0x1cec6f){var _0xf3288b={},_0xc83425={},_0x4b419f={'count':0x0,'rows':[]};var _0x455f20=_[_0x95c2('0x28')](db['FreshdeskConfiguration'][_0x95c2('0x29')],function(_0x22cdcf){return{'name':_0x22cdcf[_0x95c2('0x2a')],'type':_0x22cdcf['type'][_0x95c2('0x2b')]};});_0xc83425[_0x95c2('0x2c')]=_[_0x95c2('0x28')](_0x455f20,'name');_0xc83425[_0x95c2('0x2d')]=_[_0x95c2('0x2e')](_0x13ca10['query']);_0xc83425[_0x95c2('0x2f')]=_[_0x95c2('0x30')](_0xc83425['model'],_0xc83425['query']);_0xf3288b[_0x95c2('0x31')]=_[_0x95c2('0x30')](_0xc83425['model'],qs[_0x95c2('0x32')](_0x13ca10[_0x95c2('0x2d')][_0x95c2('0x32')]));_0xf3288b[_0x95c2('0x31')]=_0xf3288b[_0x95c2('0x31')][_0x95c2('0x33')]?_0xf3288b[_0x95c2('0x31')]:_0xc83425['model'];if(!_0x13ca10[_0x95c2('0x2d')][_0x95c2('0x34')]('nolimit')){_0xf3288b[_0x95c2('0x1b')]=qs[_0x95c2('0x1b')](_0x13ca10[_0x95c2('0x2d')][_0x95c2('0x1b')]);_0xf3288b['offset']=qs[_0x95c2('0x19')](_0x13ca10[_0x95c2('0x2d')][_0x95c2('0x19')]);}_0xf3288b['order']=qs[_0x95c2('0x35')](_0x13ca10[_0x95c2('0x2d')]['sort']);_0xf3288b['where']=qs[_0x95c2('0x2f')](_[_0x95c2('0x36')](_0x13ca10[_0x95c2('0x2d')],_0xc83425['filters']),_0x455f20);if(_0x13ca10['query']['filter']){_0xf3288b[_0x95c2('0x37')]=_[_0x95c2('0x38')](_0xf3288b[_0x95c2('0x37')],{'$or':_[_0x95c2('0x28')](_0x455f20,function(_0x280de8){if(_0x280de8['type']!==_0x95c2('0x39')){var _0x24fd43={};_0x24fd43[_0x280de8[_0x95c2('0x25')]]={'$like':'%'+_0x13ca10['query'][_0x95c2('0x3a')]+'%'};return _0x24fd43;}})});}_0xf3288b=_[_0x95c2('0x38')]({},_0xf3288b,_0x13ca10[_0x95c2('0x3b')]);var _0xb9bc7e={'where':_0xf3288b[_0x95c2('0x37')]};return db[_0x95c2('0x3c')][_0x95c2('0x3d')](_0xb9bc7e)[_0x95c2('0x24')](function(_0x14e04f){_0x4b419f[_0x95c2('0x3d')]=_0x14e04f;if(_0x13ca10[_0x95c2('0x2d')][_0x95c2('0x3e')]){_0xf3288b['include']=[{'all':!![]}];}return db[_0x95c2('0x3c')]['findAll'](_0xf3288b);})[_0x95c2('0x24')](function(_0x3019c9){_0x4b419f[_0x95c2('0x3f')]=_0x3019c9;return _0x4b419f;})['then'](respondWithFilteredResult(_0x1cec6f,_0xf3288b))[_0x95c2('0x40')](handleError(_0x1cec6f,null));};exports[_0x95c2('0x41')]=function(_0x25e6af,_0x49a51b){var _0x4c01cc={'raw':![],'where':{'id':_0x25e6af[_0x95c2('0x42')]['id']}},_0x2ac770={};_0x2ac770[_0x95c2('0x2c')]=_['keys'](db[_0x95c2('0x3c')][_0x95c2('0x29')]);_0x2ac770[_0x95c2('0x2d')]=_['keys'](_0x25e6af[_0x95c2('0x2d')]);_0x2ac770[_0x95c2('0x2f')]=_[_0x95c2('0x30')](_0x2ac770['model'],_0x2ac770[_0x95c2('0x2d')]);_0x4c01cc[_0x95c2('0x31')]=_[_0x95c2('0x30')](_0x2ac770[_0x95c2('0x2c')],qs[_0x95c2('0x32')](_0x25e6af[_0x95c2('0x2d')][_0x95c2('0x32')]));_0x4c01cc['attributes']=_0x4c01cc[_0x95c2('0x31')][_0x95c2('0x33')]?_0x4c01cc[_0x95c2('0x31')]:_0x2ac770[_0x95c2('0x2c')];if(_0x25e6af[_0x95c2('0x2d')]['includeAll']){_0x4c01cc['include']=[{'all':!![]}];}_0x4c01cc=_[_0x95c2('0x38')]({},_0x4c01cc,_0x25e6af[_0x95c2('0x3b')]);return db[_0x95c2('0x3c')][_0x95c2('0x43')](_0x4c01cc)[_0x95c2('0x24')](handleEntityNotFound(_0x49a51b,null))[_0x95c2('0x24')](respondWithResult(_0x49a51b,null))[_0x95c2('0x40')](handleError(_0x49a51b,null));};exports[_0x95c2('0x44')]=function(_0x2f4859,_0x2a493d){return db[_0x95c2('0x3c')][_0x95c2('0x44')](_0x2f4859['body'],{})[_0x95c2('0x24')](respondWithResult(_0x2a493d,0xc9))[_0x95c2('0x40')](handleError(_0x2a493d,null));};exports['update']=function(_0x4ed02d,_0x3d7fbc){if(_0x4ed02d[_0x95c2('0x45')]['id']){delete _0x4ed02d['body']['id'];}return db[_0x95c2('0x3c')]['find']({'where':{'id':_0x4ed02d[_0x95c2('0x42')]['id']}})[_0x95c2('0x24')](handleEntityNotFound(_0x3d7fbc,null))[_0x95c2('0x24')](saveUpdates(_0x4ed02d['body'],null))[_0x95c2('0x24')](respondWithResult(_0x3d7fbc,null))['catch'](handleError(_0x3d7fbc,null));};exports[_0x95c2('0x23')]=function(_0x548170,_0x7ca681){return db[_0x95c2('0x3c')][_0x95c2('0x43')]({'where':{'id':_0x548170['params']['id']}})[_0x95c2('0x24')](handleEntityNotFound(_0x7ca681,null))[_0x95c2('0x24')](removeEntity(_0x7ca681,null))[_0x95c2('0x40')](handleError(_0x7ca681,null));};exports[_0x95c2('0x46')]=function(_0x1e734c,_0x566c52,_0x7742dd){var _0x3edc8f={};var _0x4136ce={};var _0x17efe9;var _0x45de10;return db['FreshdeskConfiguration'][_0x95c2('0x47')]({'where':{'id':_0x1e734c[_0x95c2('0x42')]['id']}})[_0x95c2('0x24')](handleEntityNotFound(_0x566c52,null))[_0x95c2('0x24')](function(_0xac2ab7){if(_0xac2ab7){_0x17efe9=_0xac2ab7;_0x4136ce[_0x95c2('0x2c')]=_['keys'](db[_0x95c2('0x48')][_0x95c2('0x29')]);_0x4136ce[_0x95c2('0x2d')]=_['keys'](_0x1e734c[_0x95c2('0x2d')]);_0x4136ce[_0x95c2('0x2f')]=_[_0x95c2('0x30')](_0x4136ce['model'],_0x4136ce[_0x95c2('0x2d')]);_0x3edc8f[_0x95c2('0x31')]=_[_0x95c2('0x30')](_0x4136ce[_0x95c2('0x2c')],qs[_0x95c2('0x32')](_0x1e734c[_0x95c2('0x2d')][_0x95c2('0x32')]));_0x3edc8f[_0x95c2('0x31')]=_0x3edc8f[_0x95c2('0x31')][_0x95c2('0x33')]?_0x3edc8f[_0x95c2('0x31')]:_0x4136ce[_0x95c2('0x2c')];_0x3edc8f['order']=qs[_0x95c2('0x35')](_0x1e734c[_0x95c2('0x2d')][_0x95c2('0x35')]);_0x3edc8f[_0x95c2('0x37')]=qs[_0x95c2('0x2f')](_[_0x95c2('0x36')](_0x1e734c[_0x95c2('0x2d')],_0x4136ce['filters']));if(_0x1e734c['query'][_0x95c2('0x3a')]){_0x3edc8f[_0x95c2('0x37')]=_[_0x95c2('0x38')](_0x3edc8f['where'],{'$or':_[_0x95c2('0x28')](_0x3edc8f[_0x95c2('0x31')],function(_0x600681){var _0x537a82={};_0x537a82[_0x600681]={'$like':'%'+_0x1e734c[_0x95c2('0x2d')][_0x95c2('0x3a')]+'%'};return _0x537a82;})});}_0x3edc8f=_[_0x95c2('0x38')]({},_0x3edc8f,_0x1e734c['options']);return _0x17efe9[_0x95c2('0x46')](_0x3edc8f);}})['then'](function(_0x55cdca){if(_0x55cdca){_0x45de10=_0x55cdca['length'];if(!_0x1e734c['query'][_0x95c2('0x34')](_0x95c2('0x49'))){_0x3edc8f['limit']=qs[_0x95c2('0x1b')](_0x1e734c[_0x95c2('0x2d')][_0x95c2('0x1b')]);_0x3edc8f[_0x95c2('0x19')]=qs['offset'](_0x1e734c[_0x95c2('0x2d')][_0x95c2('0x19')]);}return _0x17efe9['getFields'](_0x3edc8f);}})[_0x95c2('0x24')](function(_0x25047a){if(_0x25047a){return _0x25047a?{'count':_0x45de10,'rows':_0x25047a}:null;}})['then'](respondWithResult(_0x566c52,null))[_0x95c2('0x40')](handleError(_0x566c52,null));};exports['getSubjects']=function(_0x164581,_0x58024f,_0x187c9b){var _0x1de6c9={};var _0x2fd120={};var _0x48c0ff;var _0x35f23e;return db[_0x95c2('0x3c')][_0x95c2('0x47')]({'where':{'id':_0x164581[_0x95c2('0x42')]['id']}})['then'](handleEntityNotFound(_0x58024f,null))['then'](function(_0x11af61){if(_0x11af61){_0x48c0ff=_0x11af61;_0x2fd120['model']=_[_0x95c2('0x2e')](db[_0x95c2('0x48')][_0x95c2('0x29')]);_0x2fd120[_0x95c2('0x2d')]=_[_0x95c2('0x2e')](_0x164581['query']);_0x2fd120[_0x95c2('0x2f')]=_['intersection'](_0x2fd120[_0x95c2('0x2c')],_0x2fd120['query']);_0x1de6c9[_0x95c2('0x31')]=_[_0x95c2('0x30')](_0x2fd120['model'],qs[_0x95c2('0x32')](_0x164581[_0x95c2('0x2d')][_0x95c2('0x32')]));_0x1de6c9[_0x95c2('0x31')]=_0x1de6c9['attributes'][_0x95c2('0x33')]?_0x1de6c9[_0x95c2('0x31')]:_0x2fd120['model'];_0x1de6c9[_0x95c2('0x4a')]=qs[_0x95c2('0x35')](_0x164581[_0x95c2('0x2d')][_0x95c2('0x35')]);_0x1de6c9[_0x95c2('0x37')]=qs[_0x95c2('0x2f')](_[_0x95c2('0x36')](_0x164581['query'],_0x2fd120[_0x95c2('0x2f')]));if(_0x164581[_0x95c2('0x2d')][_0x95c2('0x3a')]){_0x1de6c9[_0x95c2('0x37')]=_[_0x95c2('0x38')](_0x1de6c9[_0x95c2('0x37')],{'$or':_[_0x95c2('0x28')](_0x1de6c9[_0x95c2('0x31')],function(_0x36b61b){var _0x3ed949={};_0x3ed949[_0x36b61b]={'$like':'%'+_0x164581['query']['filter']+'%'};return _0x3ed949;})});}_0x1de6c9=_[_0x95c2('0x38')]({},_0x1de6c9,_0x164581[_0x95c2('0x3b')]);return _0x48c0ff[_0x95c2('0x4b')](_0x1de6c9);}})[_0x95c2('0x24')](function(_0x4658a4){if(_0x4658a4){_0x35f23e=_0x4658a4[_0x95c2('0x33')];if(!_0x164581['query']['hasOwnProperty']('nolimit')){_0x1de6c9[_0x95c2('0x1b')]=qs[_0x95c2('0x1b')](_0x164581[_0x95c2('0x2d')]['limit']);_0x1de6c9[_0x95c2('0x19')]=qs[_0x95c2('0x19')](_0x164581[_0x95c2('0x2d')][_0x95c2('0x19')]);}return _0x48c0ff[_0x95c2('0x4b')](_0x1de6c9);}})[_0x95c2('0x24')](function(_0x502bc9){if(_0x502bc9){return _0x502bc9?{'count':_0x35f23e,'rows':_0x502bc9}:null;}})['then'](respondWithResult(_0x58024f,null))[_0x95c2('0x40')](handleError(_0x58024f,null));};exports[_0x95c2('0x4c')]=function(_0x2990d5,_0x3b2d5a,_0x379f83){var _0xa0a906={};var _0x326330={};var _0x27b8fe;var _0x1900e;return db['FreshdeskConfiguration'][_0x95c2('0x47')]({'where':{'id':_0x2990d5[_0x95c2('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b2d5a,null))[_0x95c2('0x24')](function(_0x39a29b){if(_0x39a29b){_0x27b8fe=_0x39a29b;_0x326330['model']=_['keys'](db['FreshdeskField'][_0x95c2('0x29')]);_0x326330[_0x95c2('0x2d')]=_[_0x95c2('0x2e')](_0x2990d5[_0x95c2('0x2d')]);_0x326330[_0x95c2('0x2f')]=_[_0x95c2('0x30')](_0x326330[_0x95c2('0x2c')],_0x326330['query']);_0xa0a906['attributes']=_[_0x95c2('0x30')](_0x326330[_0x95c2('0x2c')],qs[_0x95c2('0x32')](_0x2990d5['query'][_0x95c2('0x32')]));_0xa0a906['attributes']=_0xa0a906[_0x95c2('0x31')][_0x95c2('0x33')]?_0xa0a906['attributes']:_0x326330[_0x95c2('0x2c')];_0xa0a906[_0x95c2('0x4a')]=qs[_0x95c2('0x35')](_0x2990d5[_0x95c2('0x2d')][_0x95c2('0x35')]);_0xa0a906['where']=qs[_0x95c2('0x2f')](_['pick'](_0x2990d5[_0x95c2('0x2d')],_0x326330[_0x95c2('0x2f')]));if(_0x2990d5[_0x95c2('0x2d')][_0x95c2('0x3a')]){_0xa0a906[_0x95c2('0x37')]=_[_0x95c2('0x38')](_0xa0a906[_0x95c2('0x37')],{'$or':_[_0x95c2('0x28')](_0xa0a906[_0x95c2('0x31')],function(_0x10d3a0){var _0x1ebe3c={};_0x1ebe3c[_0x10d3a0]={'$like':'%'+_0x2990d5[_0x95c2('0x2d')]['filter']+'%'};return _0x1ebe3c;})});}_0xa0a906=_[_0x95c2('0x38')]({},_0xa0a906,_0x2990d5[_0x95c2('0x3b')]);return _0x27b8fe[_0x95c2('0x4c')](_0xa0a906);}})[_0x95c2('0x24')](function(_0x2be8c1){if(_0x2be8c1){_0x1900e=_0x2be8c1[_0x95c2('0x33')];if(!_0x2990d5[_0x95c2('0x2d')]['hasOwnProperty'](_0x95c2('0x49'))){_0xa0a906['limit']=qs[_0x95c2('0x1b')](_0x2990d5[_0x95c2('0x2d')][_0x95c2('0x1b')]);_0xa0a906['offset']=qs[_0x95c2('0x19')](_0x2990d5[_0x95c2('0x2d')][_0x95c2('0x19')]);}return _0x27b8fe[_0x95c2('0x4c')](_0xa0a906);}})[_0x95c2('0x24')](function(_0x2c94b0){if(_0x2c94b0){return _0x2c94b0?{'count':_0x1900e,'rows':_0x2c94b0}:null;}})[_0x95c2('0x24')](respondWithResult(_0x3b2d5a,null))[_0x95c2('0x40')](handleError(_0x3b2d5a,null));};exports['getTags']=function(_0x3f7677,_0x3c1cc5,_0x44dcc5){var _0x1ab285={};var _0x56ef38={};var _0x5d365e;var _0x4973aa;return db[_0x95c2('0x3c')]['findOne']({'where':{'id':_0x3f7677[_0x95c2('0x42')]['id']}})[_0x95c2('0x24')](handleEntityNotFound(_0x3c1cc5,null))['then'](function(_0x5cbe66){if(_0x5cbe66){_0x5d365e=_0x5cbe66;_0x56ef38['model']=_[_0x95c2('0x2e')](db[_0x95c2('0x4d')]['rawAttributes']);_0x56ef38[_0x95c2('0x2d')]=_[_0x95c2('0x2e')](_0x3f7677[_0x95c2('0x2d')]);_0x56ef38[_0x95c2('0x2f')]=_[_0x95c2('0x30')](_0x56ef38[_0x95c2('0x2c')],_0x56ef38[_0x95c2('0x2d')]);_0x1ab285[_0x95c2('0x31')]=_[_0x95c2('0x30')](_0x56ef38[_0x95c2('0x2c')],qs['fields'](_0x3f7677['query'][_0x95c2('0x32')]));_0x1ab285[_0x95c2('0x31')]=_0x1ab285[_0x95c2('0x31')][_0x95c2('0x33')]?_0x1ab285[_0x95c2('0x31')]:_0x56ef38[_0x95c2('0x2c')];_0x1ab285[_0x95c2('0x4a')]=qs[_0x95c2('0x35')](_0x3f7677[_0x95c2('0x2d')][_0x95c2('0x35')]);_0x1ab285[_0x95c2('0x37')]=qs[_0x95c2('0x2f')](_[_0x95c2('0x36')](_0x3f7677[_0x95c2('0x2d')],_0x56ef38[_0x95c2('0x2f')]));if(_0x3f7677['query'][_0x95c2('0x3a')]){_0x1ab285[_0x95c2('0x37')]=_[_0x95c2('0x38')](_0x1ab285['where'],{'$or':_['map'](_0x1ab285[_0x95c2('0x31')],function(_0x2922a7){var _0x6aff92={};_0x6aff92[_0x2922a7]={'$like':'%'+_0x3f7677['query'][_0x95c2('0x3a')]+'%'};return _0x6aff92;})});}_0x1ab285=_[_0x95c2('0x38')]({},_0x1ab285,_0x3f7677[_0x95c2('0x3b')]);return _0x5d365e[_0x95c2('0x4e')](_0x1ab285);}})[_0x95c2('0x24')](function(_0x476038){if(_0x476038){_0x4973aa=_0x476038[_0x95c2('0x33')];if(!_0x3f7677[_0x95c2('0x2d')]['hasOwnProperty'](_0x95c2('0x49'))){_0x1ab285[_0x95c2('0x1b')]=qs[_0x95c2('0x1b')](_0x3f7677[_0x95c2('0x2d')][_0x95c2('0x1b')]);_0x1ab285[_0x95c2('0x19')]=qs[_0x95c2('0x19')](_0x3f7677[_0x95c2('0x2d')]['offset']);}return _0x5d365e['getTags'](_0x1ab285);}})[_0x95c2('0x24')](function(_0x4ffe90){if(_0x4ffe90){return _0x4ffe90?{'count':_0x4973aa,'rows':_0x4ffe90}:null;}})[_0x95c2('0x24')](respondWithResult(_0x3c1cc5,null))['catch'](handleError(_0x3c1cc5,null));};exports[_0x95c2('0x4f')]=function(_0x4bd136,_0x178119,_0x56beee){if(_0x4bd136[_0x95c2('0x45')]['id']){delete _0x4bd136[_0x95c2('0x45')]['id'];}return db[_0x95c2('0x3c')][_0x95c2('0x47')]({'where':{'id':_0x4bd136[_0x95c2('0x42')]['id']}})[_0x95c2('0x24')](handleEntityNotFound(_0x178119,null))['then'](function(_0x9011ab){if(_0x9011ab){return _0x9011ab[_0x95c2('0x4f')](_0x4bd136[_0x95c2('0x45')][_0x95c2('0x50')]||[]);}return null;})[_0x95c2('0x24')](respondWithResult(_0x178119,null))[_0x95c2('0x40')](handleError(_0x178119,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 0386a1e..2ca5569 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 _0x7566=['bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','api','moment'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x7566,0x14d));var _0x6756=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0x7566[_0x256684];return _0x37a0c9;};'use strict';var _=require(_0x6756('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6756('0x1'));var moment=require(_0x6756('0x2'));var BPromise=require(_0x6756('0x3'));var rp=require(_0x6756('0x4'));var fs=require('fs');var path=require(_0x6756('0x5'));var rimraf=require('rimraf');var config=require(_0x6756('0x6'));var attributes=require(_0x6756('0x7'));module[_0x6756('0x8')]=function(_0x168a48,_0x4df048){return _0x168a48[_0x6756('0x9')](_0x6756('0xa'),attributes,{'tableName':_0x6756('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe464=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','api','bluebird','request-promise','path'];(function(_0x44419a,_0x5fb47c){var _0x5bd8d0=function(_0x399376){while(--_0x399376){_0x44419a['push'](_0x44419a['shift']());}};_0x5bd8d0(++_0x5fb47c);}(_0xe464,0x1e7));var _0x4e46=function(_0x44642a,_0x110845){_0x44642a=_0x44642a-0x0;var _0x26a3d5=_0xe464[_0x44642a];return _0x26a3d5;};'use strict';var _=require('lodash');var util=require(_0x4e46('0x0'));var logger=require('../../config/logger')(_0x4e46('0x1'));var moment=require('moment');var BPromise=require(_0x4e46('0x2'));var rp=require(_0x4e46('0x3'));var fs=require('fs');var path=require(_0x4e46('0x4'));var rimraf=require(_0x4e46('0x5'));var config=require(_0x4e46('0x6'));var attributes=require(_0x4e46('0x7'));module[_0x4e46('0x8')]=function(_0xdd0933,_0x33f379){return _0xdd0933[_0x4e46('0x9')](_0x4e46('0xa'),attributes,{'tableName':_0x4e46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 9b185f0..944bd1a 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 _0xcbbe=['client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xcbbe,0x12b));var _0xecbb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcbbe[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xecbb('0x0'));var util=require(_0xecbb('0x1'));var moment=require(_0xecbb('0x2'));var BPromise=require(_0xecbb('0x3'));var rs=require(_0xecbb('0x4'));var fs=require('fs');var Redis=require(_0xecbb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xecbb('0x6'));var logger=require('../../config/logger')(_0xecbb('0x7'));var config=require(_0xecbb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xecbb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x79df52,_0x3a73b2,_0x2944bb){return new BPromise(function(_0x39314f,_0x4e20f8){return client[_0xecbb('0xa')](_0x79df52,_0x2944bb)[_0xecbb('0xb')](function(_0x5c2b78){logger[_0xecbb('0xc')](_0xecbb('0xd'),_0x3a73b2,_0xecbb('0xe'));logger[_0xecbb('0xf')](_0xecbb('0x10'),_0x3a73b2,_0xecbb('0xe'),JSON[_0xecbb('0x11')](_0x5c2b78));if(_0x5c2b78['error']){if(_0x5c2b78[_0xecbb('0x12')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a73b2,_0x5c2b78[_0xecbb('0x12')]['message']);return _0x4e20f8(_0x5c2b78[_0xecbb('0x12')][_0xecbb('0x13')]);}logger[_0xecbb('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a73b2,_0x5c2b78[_0xecbb('0x12')][_0xecbb('0x13')]);return _0x39314f(_0x5c2b78['error']['message']);}else{logger[_0xecbb('0xc')](_0xecbb('0xd'),_0x3a73b2,'request\x20sent');_0x39314f(_0x5c2b78[_0xecbb('0x14')]['message']);}})[_0xecbb('0x15')](function(_0x563489){logger[_0xecbb('0x12')](_0xecbb('0xd'),_0x3a73b2,_0x563489);_0x4e20f8(_0x563489);});});} \ No newline at end of file +var _0x220a=['info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x4809b8,_0x25b135){var _0x5e159d=function(_0x542b37){while(--_0x542b37){_0x4809b8['push'](_0x4809b8['shift']());}};_0x5e159d(++_0x25b135);}(_0x220a,0x1ef));var _0xa220=function(_0x113822,_0x5684b5){_0x113822=_0x113822-0x0;var _0x532e5d=_0x220a[_0x113822];return _0x532e5d;};'use strict';var _=require('lodash');var util=require(_0xa220('0x0'));var moment=require('moment');var BPromise=require(_0xa220('0x1'));var rs=require(_0xa220('0x2'));var fs=require('fs');var Redis=require(_0xa220('0x3'));var db=require(_0xa220('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa220('0x5'))(_0xa220('0x6'));var config=require(_0xa220('0x7'));var jayson=require(_0xa220('0x8'));var client=jayson['client'][_0xa220('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fe328,_0x3bb14a,_0x3d063d){return new BPromise(function(_0x27d400,_0x59a227){return client['request'](_0x3fe328,_0x3d063d)[_0xa220('0xa')](function(_0xa1b58a){logger[_0xa220('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bb14a,_0xa220('0xc'));logger[_0xa220('0xd')](_0xa220('0xe'),_0x3bb14a,_0xa220('0xc'),JSON[_0xa220('0xf')](_0xa1b58a));if(_0xa1b58a[_0xa220('0x10')]){if(_0xa1b58a[_0xa220('0x10')][_0xa220('0x11')]===0x1f4){logger[_0xa220('0x10')](_0xa220('0x12'),_0x3bb14a,_0xa1b58a[_0xa220('0x10')][_0xa220('0x13')]);return _0x59a227(_0xa1b58a[_0xa220('0x10')][_0xa220('0x13')]);}logger['error'](_0xa220('0x12'),_0x3bb14a,_0xa1b58a[_0xa220('0x10')][_0xa220('0x13')]);return _0x27d400(_0xa1b58a[_0xa220('0x10')][_0xa220('0x13')]);}else{logger[_0xa220('0xb')](_0xa220('0x12'),_0x3bb14a,_0xa220('0xc'));_0x27d400(_0xa1b58a[_0xa220('0x14')]['message']);}})[_0xa220('0x15')](function(_0x296371){logger[_0xa220('0x10')](_0xa220('0x12'),_0x3bb14a,_0x296371);_0x59a227(_0x296371);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 8941f87..3a960c7 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 _0xf05e=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','create','put','update'];(function(_0x37d7da,_0x1b3451){var _0x517140=function(_0x579459){while(--_0x579459){_0x37d7da['push'](_0x37d7da['shift']());}};_0x517140(++_0x1b3451);}(_0xf05e,0x1d7));var _0xef05=function(_0x206fb0,_0x22766f){_0x206fb0=_0x206fb0-0x0;var _0x54d2c6=_0xf05e[_0x206fb0];return _0x54d2c6;};'use strict';var multer=require('multer');var util=require(_0xef05('0x0'));var path=require(_0xef05('0x1'));var timeout=require(_0xef05('0x2'));var express=require(_0xef05('0x3'));var router=express[_0xef05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef05('0x5'));var interaction=require(_0xef05('0x6'));var config=require('../../config/environment');var controller=require(_0xef05('0x7'));router[_0xef05('0x8')]('/',auth[_0xef05('0x9')](),controller[_0xef05('0xa')]);router[_0xef05('0x8')](_0xef05('0xb'),auth[_0xef05('0x9')](),controller['show']);router['post']('/',auth[_0xef05('0x9')](),controller[_0xef05('0xc')]);router[_0xef05('0xd')](_0xef05('0xb'),auth[_0xef05('0x9')](),controller[_0xef05('0xe')]);router[_0xef05('0xf')](_0xef05('0xb'),auth[_0xef05('0x9')](),controller[_0xef05('0x10')]);module[_0xef05('0x11')]=router; \ No newline at end of file +var _0x96ce=['./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','destroy','exports','multer','path','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96ce,0x15a));var _0xe96c=function(_0x45cea1,_0x45db40){_0x45cea1=_0x45cea1-0x0;var _0xda8ddd=_0x96ce[_0x45cea1];return _0xda8ddd;};'use strict';var multer=require(_0xe96c('0x0'));var util=require('util');var path=require(_0xe96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xe96c('0x2'));var router=express['Router']();var fs_extra=require(_0xe96c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe96c('0x4'));router[_0xe96c('0x5')]('/',auth[_0xe96c('0x6')](),controller[_0xe96c('0x7')]);router['get'](_0xe96c('0x8'),auth[_0xe96c('0x6')](),controller[_0xe96c('0x9')]);router[_0xe96c('0xa')]('/',auth[_0xe96c('0x6')](),controller['create']);router[_0xe96c('0xb')](_0xe96c('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe96c('0x8'),auth[_0xe96c('0x6')](),controller[_0xe96c('0xc')]);module[_0xe96c('0xd')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 48d9d29..2eb1501 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 _0xa337=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x3ca62c,_0x4c611b){var _0x12db0d=function(_0x5d6ed4){while(--_0x5d6ed4){_0x3ca62c['push'](_0x3ca62c['shift']());}};_0x12db0d(++_0x4c611b);}(_0xa337,0x135));var _0x7a33=function(_0x57fd06,_0x6ad7ce){_0x57fd06=_0x57fd06-0x0;var _0x458d47=_0xa337[_0x57fd06];return _0x458d47;};'use strict';var Sequelize=require(_0x7a33('0x0'));module[_0x7a33('0x1')]={'type':{'type':Sequelize[_0x7a33('0x2')]('string',_0x7a33('0x3'),_0x7a33('0x4'),_0x7a33('0x5'),_0x7a33('0x6')),'defaultValue':_0x7a33('0x7')},'content':{'type':Sequelize[_0x7a33('0x8')]},'key':{'type':Sequelize[_0x7a33('0x8')]},'keyType':{'type':Sequelize[_0x7a33('0x2')]('string',_0x7a33('0x3'),_0x7a33('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7a33('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7a33('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7a33('0x8')]}}; \ No newline at end of file +var _0x062c=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x5722b5,_0x4c5f26){var _0x32ac18=function(_0x305226){while(--_0x305226){_0x5722b5['push'](_0x5722b5['shift']());}};_0x32ac18(++_0x4c5f26);}(_0x062c,0x1b1));var _0xc062=function(_0x46c951,_0x4651a8){_0x46c951=_0x46c951-0x0;var _0x462f2f=_0x062c[_0x46c951];return _0x462f2f;};'use strict';var Sequelize=require(_0xc062('0x0'));module['exports']={'type':{'type':Sequelize[_0xc062('0x1')](_0xc062('0x2'),_0xc062('0x3'),_0xc062('0x4'),'keyValue',_0xc062('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc062('0x6')]},'keyType':{'type':Sequelize[_0xc062('0x1')]('string',_0xc062('0x3'),_0xc062('0x4'))},'keyContent':{'type':Sequelize[_0xc062('0x6')]},'idField':{'type':Sequelize[_0xc062('0x6')]},'nameField':{'type':Sequelize[_0xc062('0x6')]},'customField':{'type':Sequelize[_0xc062('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc062('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 5205dc6..009e85d 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 _0xca66=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','name','send','FreshdeskField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','merge','includeAll','include','rows','catch','params','find','create','body','eml-format','fast-json-patch','request-promise','moment','mustache','path','to-csv'];(function(_0xb003da,_0x52d8a6){var _0x1a53da=function(_0x5cfef8){while(--_0x5cfef8){_0xb003da['push'](_0xb003da['shift']());}};_0x1a53da(++_0x52d8a6);}(_0xca66,0x8b));var _0x6ca6=function(_0x584ed2,_0x194ac6){_0x584ed2=_0x584ed2-0x0;var _0x144cb0=_0xca66[_0x584ed2];return _0x144cb0;};'use strict';var emlformat=require(_0x6ca6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ca6('0x1'));var rp=require(_0x6ca6('0x2'));var moment=require(_0x6ca6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ca6('0x4'));var util=require('util');var path=require(_0x6ca6('0x5'));var sox=require('sox');var csv=require(_0x6ca6('0x6'));var ejs=require(_0x6ca6('0x7'));var fs=require('fs');var fs_extra=require(_0x6ca6('0x8'));var _=require(_0x6ca6('0x9'));var squel=require(_0x6ca6('0xa'));var crypto=require(_0x6ca6('0xb'));var jsforce=require(_0x6ca6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ca6('0x6'));var querystring=require(_0x6ca6('0xd'));var Papa=require(_0x6ca6('0xe'));var Redis=require(_0x6ca6('0xf'));var authService=require(_0x6ca6('0x10'));var qs=require(_0x6ca6('0x11'));var as=require(_0x6ca6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ca6('0x13'))(_0x6ca6('0x14'));var utils=require(_0x6ca6('0x15'));var config=require(_0x6ca6('0x16'));var licenseUtil=require(_0x6ca6('0x17'));var db=require(_0x6ca6('0x18'))['db'];function respondWithStatusCode(_0x4c05e9,_0x152e63){_0x152e63=_0x152e63||0xcc;return function(_0x38de67){if(_0x38de67){return _0x4c05e9['sendStatus'](_0x152e63);}return _0x4c05e9[_0x6ca6('0x19')](_0x152e63)[_0x6ca6('0x1a')]();};}function respondWithResult(_0x3f417f,_0x3570f1){_0x3570f1=_0x3570f1||0xc8;return function(_0xc774c){if(_0xc774c){return _0x3f417f[_0x6ca6('0x19')](_0x3570f1)['json'](_0xc774c);}};}function respondWithFilteredResult(_0x52c59a,_0x5785b1){return function(_0x36ff3e){if(_0x36ff3e){var _0x19e94f=typeof _0x5785b1[_0x6ca6('0x1b')]===_0x6ca6('0x1c')&&typeof _0x5785b1[_0x6ca6('0x1d')]===_0x6ca6('0x1c');var _0x25dc6c=_0x36ff3e['count'];var _0x2391ce=_0x19e94f?0x0:_0x5785b1[_0x6ca6('0x1b')];var _0xc97f0=_0x19e94f?_0x36ff3e[_0x6ca6('0x1e')]:_0x5785b1[_0x6ca6('0x1b')]+_0x5785b1[_0x6ca6('0x1d')];var _0x16a3d7;if(_0xc97f0>=_0x25dc6c){_0xc97f0=_0x25dc6c;_0x16a3d7=0xc8;}else{_0x16a3d7=0xce;}_0x52c59a[_0x6ca6('0x19')](_0x16a3d7);return _0x52c59a[_0x6ca6('0x1f')](_0x6ca6('0x20'),_0x2391ce+'-'+_0xc97f0+'/'+_0x25dc6c)[_0x6ca6('0x21')](_0x36ff3e);}return null;};}function patchUpdates(_0x4c3be9){return function(_0x28a982){try{jsonpatch[_0x6ca6('0x22')](_0x28a982,_0x4c3be9,!![]);}catch(_0x38cad4){return BPromise[_0x6ca6('0x23')](_0x38cad4);}return _0x28a982[_0x6ca6('0x24')]();};}function saveUpdates(_0x438694,_0x593f15){return function(_0xfb962d){if(_0xfb962d){return _0xfb962d[_0x6ca6('0x25')](_0x438694)['then'](function(_0x4927c1){return _0x4927c1;});}return null;};}function removeEntity(_0xfbf496,_0x216701){return function(_0xfe0760){if(_0xfe0760){return _0xfe0760[_0x6ca6('0x26')]()[_0x6ca6('0x27')](function(){_0xfbf496['status'](0xcc)[_0x6ca6('0x1a')]();});}};}function handleEntityNotFound(_0x1d6caa,_0x1c43ee){return function(_0x2d8c64){if(!_0x2d8c64){_0x1d6caa[_0x6ca6('0x28')](0x194);}return _0x2d8c64;};}function handleError(_0x29f37e,_0x3c32ae){_0x3c32ae=_0x3c32ae||0x1f4;return function(_0x2a1e2d){logger['error'](_0x2a1e2d['stack']);if(_0x2a1e2d[_0x6ca6('0x29')]){delete _0x2a1e2d[_0x6ca6('0x29')];}_0x29f37e[_0x6ca6('0x19')](_0x3c32ae)[_0x6ca6('0x2a')](_0x2a1e2d);};}exports['index']=function(_0x5ea6f7,_0x306583){var _0x47cf48={},_0x4ab84c={},_0x141e78={'count':0x0,'rows':[]};var _0xefd407=_['map'](db[_0x6ca6('0x2b')][_0x6ca6('0x2c')],function(_0xac50e8){return{'name':_0xac50e8[_0x6ca6('0x2d')],'type':_0xac50e8['type'][_0x6ca6('0x2e')]};});_0x4ab84c[_0x6ca6('0x2f')]=_[_0x6ca6('0x30')](_0xefd407,_0x6ca6('0x29'));_0x4ab84c['query']=_[_0x6ca6('0x31')](_0x5ea6f7[_0x6ca6('0x32')]);_0x4ab84c[_0x6ca6('0x33')]=_[_0x6ca6('0x34')](_0x4ab84c['model'],_0x4ab84c['query']);_0x47cf48['attributes']=_['intersection'](_0x4ab84c['model'],qs[_0x6ca6('0x35')](_0x5ea6f7[_0x6ca6('0x32')][_0x6ca6('0x35')]));_0x47cf48['attributes']=_0x47cf48[_0x6ca6('0x36')][_0x6ca6('0x37')]?_0x47cf48[_0x6ca6('0x36')]:_0x4ab84c[_0x6ca6('0x2f')];if(!_0x5ea6f7['query'][_0x6ca6('0x38')](_0x6ca6('0x39'))){_0x47cf48[_0x6ca6('0x1d')]=qs[_0x6ca6('0x1d')](_0x5ea6f7['query'][_0x6ca6('0x1d')]);_0x47cf48['offset']=qs[_0x6ca6('0x1b')](_0x5ea6f7['query']['offset']);}_0x47cf48[_0x6ca6('0x3a')]=qs[_0x6ca6('0x3b')](_0x5ea6f7[_0x6ca6('0x32')][_0x6ca6('0x3b')]);_0x47cf48['where']=qs['filters'](_[_0x6ca6('0x3c')](_0x5ea6f7[_0x6ca6('0x32')],_0x4ab84c['filters']),_0xefd407);if(_0x5ea6f7[_0x6ca6('0x32')]['filter']){_0x47cf48[_0x6ca6('0x3d')]=_['merge'](_0x47cf48[_0x6ca6('0x3d')],{'$or':_[_0x6ca6('0x30')](_0xefd407,function(_0x254733){if(_0x254733[_0x6ca6('0x3e')]!==_0x6ca6('0x3f')){var _0x3ca258={};_0x3ca258[_0x254733[_0x6ca6('0x29')]]={'$like':'%'+_0x5ea6f7[_0x6ca6('0x32')]['filter']+'%'};return _0x3ca258;}})});}_0x47cf48=_[_0x6ca6('0x40')]({},_0x47cf48,_0x5ea6f7['options']);var _0x57186c={'where':_0x47cf48[_0x6ca6('0x3d')]};return db[_0x6ca6('0x2b')]['count'](_0x57186c)[_0x6ca6('0x27')](function(_0x500ed4){_0x141e78[_0x6ca6('0x1e')]=_0x500ed4;if(_0x5ea6f7[_0x6ca6('0x32')][_0x6ca6('0x41')]){_0x47cf48[_0x6ca6('0x42')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x47cf48);})[_0x6ca6('0x27')](function(_0x3813d6){_0x141e78[_0x6ca6('0x43')]=_0x3813d6;return _0x141e78;})[_0x6ca6('0x27')](respondWithFilteredResult(_0x306583,_0x47cf48))[_0x6ca6('0x44')](handleError(_0x306583,null));};exports['show']=function(_0x76db8d,_0x2ffdfc){var _0x5bed6e={'raw':!![],'where':{'id':_0x76db8d[_0x6ca6('0x45')]['id']}},_0x317b5e={};_0x317b5e[_0x6ca6('0x2f')]=_[_0x6ca6('0x31')](db[_0x6ca6('0x2b')][_0x6ca6('0x2c')]);_0x317b5e[_0x6ca6('0x32')]=_[_0x6ca6('0x31')](_0x76db8d[_0x6ca6('0x32')]);_0x317b5e['filters']=_[_0x6ca6('0x34')](_0x317b5e[_0x6ca6('0x2f')],_0x317b5e[_0x6ca6('0x32')]);_0x5bed6e[_0x6ca6('0x36')]=_[_0x6ca6('0x34')](_0x317b5e[_0x6ca6('0x2f')],qs[_0x6ca6('0x35')](_0x76db8d[_0x6ca6('0x32')]['fields']));_0x5bed6e['attributes']=_0x5bed6e[_0x6ca6('0x36')][_0x6ca6('0x37')]?_0x5bed6e[_0x6ca6('0x36')]:_0x317b5e[_0x6ca6('0x2f')];if(_0x76db8d[_0x6ca6('0x32')][_0x6ca6('0x41')]){_0x5bed6e[_0x6ca6('0x42')]=[{'all':!![]}];}_0x5bed6e=_['merge']({},_0x5bed6e,_0x76db8d['options']);return db[_0x6ca6('0x2b')][_0x6ca6('0x46')](_0x5bed6e)['then'](handleEntityNotFound(_0x2ffdfc,null))[_0x6ca6('0x27')](respondWithResult(_0x2ffdfc,null))[_0x6ca6('0x44')](handleError(_0x2ffdfc,null));};exports[_0x6ca6('0x47')]=function(_0x34a388,_0xc1928f){return db[_0x6ca6('0x2b')][_0x6ca6('0x47')](_0x34a388['body'],{})[_0x6ca6('0x27')](respondWithResult(_0xc1928f,0xc9))[_0x6ca6('0x44')](handleError(_0xc1928f,null));};exports[_0x6ca6('0x25')]=function(_0x4fde51,_0x408df3){if(_0x4fde51['body']['id']){delete _0x4fde51[_0x6ca6('0x48')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x4fde51['params']['id']}})[_0x6ca6('0x27')](handleEntityNotFound(_0x408df3,null))[_0x6ca6('0x27')](saveUpdates(_0x4fde51[_0x6ca6('0x48')],null))['then'](respondWithResult(_0x408df3,null))[_0x6ca6('0x44')](handleError(_0x408df3,null));};exports['destroy']=function(_0x1f552d,_0x1010a6){return db[_0x6ca6('0x2b')][_0x6ca6('0x46')]({'where':{'id':_0x1f552d[_0x6ca6('0x45')]['id']}})[_0x6ca6('0x27')](handleEntityNotFound(_0x1010a6,null))[_0x6ca6('0x27')](removeEntity(_0x1010a6,null))[_0x6ca6('0x44')](handleError(_0x1010a6,null));}; \ No newline at end of file +var _0xae60=['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','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','FreshdeskField','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x5dcf51,_0x1ac1e5){var _0xa3b11b=function(_0x10e574){while(--_0x10e574){_0x5dcf51['push'](_0x5dcf51['shift']());}};_0xa3b11b(++_0x1ac1e5);}(_0xae60,0x1c7));var _0x0ae6=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xae60[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x5b86fe,_0x3630e6){return function(_0x2dcdb7){if(!_0x2dcdb7){_0x5b86fe['sendStatus'](0x194);}return _0x2dcdb7;};}function handleError(_0x55dbe1,_0x44eb95){_0x44eb95=_0x44eb95||0x1f4;return function(_0x3255a7){logger[_0x0ae6('0x2b')](_0x3255a7['stack']);if(_0x3255a7[_0x0ae6('0x2c')]){delete _0x3255a7[_0x0ae6('0x2c')];}_0x55dbe1[_0x0ae6('0x1d')](_0x44eb95)['send'](_0x3255a7);};}exports[_0x0ae6('0x2d')]=function(_0x29fef3,_0x449c33){var _0x232fbd={},_0x14eed5={},_0x257af5={'count':0x0,'rows':[]};var _0x4fc7bd=_['map'](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')],function(_0x4e6df8){return{'name':_0x4e6df8['fieldName'],'type':_0x4e6df8[_0x0ae6('0x30')][_0x0ae6('0x31')]};});_0x14eed5[_0x0ae6('0x32')]=_[_0x0ae6('0x33')](_0x4fc7bd,'name');_0x14eed5[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x29fef3[_0x0ae6('0x34')]);_0x14eed5['filters']=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],_0x14eed5[_0x0ae6('0x34')]);_0x232fbd[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x38')]));_0x232fbd[_0x0ae6('0x37')]=_0x232fbd['attributes'][_0x0ae6('0x39')]?_0x232fbd[_0x0ae6('0x37')]:_0x14eed5['model'];if(!_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3a')](_0x0ae6('0x3b'))){_0x232fbd['limit']=qs[_0x0ae6('0x22')](_0x29fef3['query']['limit']);_0x232fbd[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x20')]);}_0x232fbd[_0x0ae6('0x3c')]=qs['sort'](_0x29fef3['query'][_0x0ae6('0x3d')]);_0x232fbd['where']=qs[_0x0ae6('0x3e')](_['pick'](_0x29fef3[_0x0ae6('0x34')],_0x14eed5['filters']),_0x4fc7bd);if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3f')]){_0x232fbd[_0x0ae6('0x40')]=_[_0x0ae6('0x41')](_0x232fbd['where'],{'$or':_['map'](_0x4fc7bd,function(_0x43414c){if(_0x43414c[_0x0ae6('0x30')]!==_0x0ae6('0x42')){var _0x59480a={};_0x59480a[_0x43414c[_0x0ae6('0x2c')]]={'$like':'%'+_0x29fef3['query'][_0x0ae6('0x3f')]+'%'};return _0x59480a;}})});}_0x232fbd=_[_0x0ae6('0x41')]({},_0x232fbd,_0x29fef3[_0x0ae6('0x43')]);var _0x19403c={'where':_0x232fbd[_0x0ae6('0x40')]};return db[_0x0ae6('0x2e')]['count'](_0x19403c)[_0x0ae6('0x29')](function(_0x601ef9){_0x257af5[_0x0ae6('0x23')]=_0x601ef9;if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x44')]){_0x232fbd[_0x0ae6('0x45')]=[{'all':!![]}];}return db[_0x0ae6('0x2e')][_0x0ae6('0x46')](_0x232fbd);})['then'](function(_0x38faeb){_0x257af5[_0x0ae6('0x47')]=_0x38faeb;return _0x257af5;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x449c33,_0x232fbd))[_0x0ae6('0x48')](handleError(_0x449c33,null));};exports[_0x0ae6('0x49')]=function(_0x167ed1,_0x24c021){var _0x21431e={'raw':!![],'where':{'id':_0x167ed1[_0x0ae6('0x4a')]['id']}},_0xb38cbb={};_0xb38cbb[_0x0ae6('0x32')]=_[_0x0ae6('0x35')](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')]);_0xb38cbb[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x167ed1[_0x0ae6('0x34')]);_0xb38cbb[_0x0ae6('0x3e')]=_['intersection'](_0xb38cbb[_0x0ae6('0x32')],_0xb38cbb[_0x0ae6('0x34')]);_0x21431e[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0xb38cbb[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x167ed1['query'][_0x0ae6('0x38')]));_0x21431e[_0x0ae6('0x37')]=_0x21431e[_0x0ae6('0x37')][_0x0ae6('0x39')]?_0x21431e['attributes']:_0xb38cbb['model'];if(_0x167ed1['query'][_0x0ae6('0x44')]){_0x21431e[_0x0ae6('0x45')]=[{'all':!![]}];}_0x21431e=_[_0x0ae6('0x41')]({},_0x21431e,_0x167ed1['options']);return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')](_0x21431e)['then'](handleEntityNotFound(_0x24c021,null))[_0x0ae6('0x29')](respondWithResult(_0x24c021,null))[_0x0ae6('0x48')](handleError(_0x24c021,null));};exports['create']=function(_0x354efd,_0x3d1e75){return db['FreshdeskField'][_0x0ae6('0x4c')](_0x354efd[_0x0ae6('0x4d')],{})[_0x0ae6('0x29')](respondWithResult(_0x3d1e75,0xc9))['catch'](handleError(_0x3d1e75,null));};exports[_0x0ae6('0x28')]=function(_0x21de54,_0x46075a){if(_0x21de54[_0x0ae6('0x4d')]['id']){delete _0x21de54[_0x0ae6('0x4d')]['id'];}return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x21de54['params']['id']}})['then'](handleEntityNotFound(_0x46075a,null))[_0x0ae6('0x29')](saveUpdates(_0x21de54[_0x0ae6('0x4d')],null))[_0x0ae6('0x29')](respondWithResult(_0x46075a,null))['catch'](handleError(_0x46075a,null));};exports[_0x0ae6('0x2a')]=function(_0x51df5c,_0x582a5e){return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x51df5c[_0x0ae6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582a5e,null))[_0x0ae6('0x29')](removeEntity(_0x582a5e,null))[_0x0ae6('0x48')](handleError(_0x582a5e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 20dbede..9351779 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 _0x14b9=['request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird'];(function(_0x37f5b4,_0x4b7c58){var _0x540279=function(_0x3b45dd){while(--_0x3b45dd){_0x37f5b4['push'](_0x37f5b4['shift']());}};_0x540279(++_0x4b7c58);}(_0x14b9,0x191));var _0x914b=function(_0x3008ee,_0x198d39){_0x3008ee=_0x3008ee-0x0;var _0x50a204=_0x14b9[_0x3008ee];return _0x50a204;};'use strict';var _=require(_0x914b('0x0'));var util=require('util');var logger=require(_0x914b('0x1'))(_0x914b('0x2'));var moment=require(_0x914b('0x3'));var BPromise=require(_0x914b('0x4'));var rp=require(_0x914b('0x5'));var fs=require('fs');var path=require(_0x914b('0x6'));var rimraf=require('rimraf');var config=require(_0x914b('0x7'));var attributes=require(_0x914b('0x8'));module[_0x914b('0x9')]=function(_0x105ca0,_0x3aaec8){return _0x105ca0['define'](_0x914b('0xa'),attributes,{'tableName':_0x914b('0xb'),'paranoid':![],'indexes':[{'name':_0x914b('0xc'),'fields':[_0x914b('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bb7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','freshdesk_unique_index','FieldId'];(function(_0x3e7abd,_0x1f7626){var _0x563910=function(_0x4660cd){while(--_0x4660cd){_0x3e7abd['push'](_0x3e7abd['shift']());}};_0x563910(++_0x1f7626);}(_0x5bb7,0x1ee));var _0x75bb=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x5bb7[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x75bb('0x0'));var util=require(_0x75bb('0x1'));var logger=require(_0x75bb('0x2'))(_0x75bb('0x3'));var moment=require(_0x75bb('0x4'));var BPromise=require(_0x75bb('0x5'));var rp=require(_0x75bb('0x6'));var fs=require('fs');var path=require(_0x75bb('0x7'));var rimraf=require('rimraf');var config=require(_0x75bb('0x8'));var attributes=require(_0x75bb('0x9'));module[_0x75bb('0xa')]=function(_0x16d98f,_0x2b5abd){return _0x16d98f['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x75bb('0xb'),'fields':['idField',_0x75bb('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index b466bcf..58325a4 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 _0xdae5=['../../config/utils','../../config/logger','rpc','jayson/promise','http','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1eff28,_0x5784a4){var _0x157996=function(_0x48ff16){while(--_0x48ff16){_0x1eff28['push'](_0x1eff28['shift']());}};_0x157996(++_0x5784a4);}(_0xdae5,0x163));var _0x5dae=function(_0x1893d4,_0x1f1a2b){_0x1893d4=_0x1893d4-0x0;var _0x4fa6ec=_0xdae5[_0x1893d4];return _0x4fa6ec;};'use strict';var _=require(_0x5dae('0x0'));var util=require(_0x5dae('0x1'));var moment=require(_0x5dae('0x2'));var BPromise=require(_0x5dae('0x3'));var rs=require(_0x5dae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5dae('0x5'))['db'];var utils=require(_0x5dae('0x6'));var logger=require(_0x5dae('0x7'))(_0x5dae('0x8'));var config=require('../../config/environment');var jayson=require(_0x5dae('0x9'));var client=jayson['client'][_0x5dae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x214bb0,_0x502337,_0x5c7296){return new BPromise(function(_0x288f06,_0x2accbe){return client['request'](_0x214bb0,_0x5c7296)[_0x5dae('0xb')](function(_0x3d9d3f){logger['info'](_0x5dae('0xc'),_0x502337,_0x5dae('0xd'));logger['debug'](_0x5dae('0xe'),_0x502337,_0x5dae('0xd'),JSON['stringify'](_0x3d9d3f));if(_0x3d9d3f[_0x5dae('0xf')]){if(_0x3d9d3f['error'][_0x5dae('0x10')]===0x1f4){logger[_0x5dae('0xf')](_0x5dae('0xc'),_0x502337,_0x3d9d3f['error'][_0x5dae('0x11')]);return _0x2accbe(_0x3d9d3f[_0x5dae('0xf')]['message']);}logger[_0x5dae('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x502337,_0x3d9d3f[_0x5dae('0xf')][_0x5dae('0x11')]);return _0x288f06(_0x3d9d3f[_0x5dae('0xf')][_0x5dae('0x11')]);}else{logger['info'](_0x5dae('0xc'),_0x502337,_0x5dae('0xd'));_0x288f06(_0x3d9d3f['result'][_0x5dae('0x11')]);}})[_0x5dae('0x12')](function(_0x341131){logger[_0x5dae('0xf')](_0x5dae('0xc'),_0x502337,_0x341131);_0x2accbe(_0x341131);});});} \ No newline at end of file +var _0x0e44=['code','message','request\x20sent','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5944e9,_0xf3da60){var _0x1098b8=function(_0x265f4){while(--_0x265f4){_0x5944e9['push'](_0x5944e9['shift']());}};_0x1098b8(++_0xf3da60);}(_0x0e44,0x73));var _0x40e4=function(_0x40c89d,_0x327cfd){_0x40c89d=_0x40c89d-0x0;var _0x1ce714=_0x0e44[_0x40c89d];return _0x1ce714;};'use strict';var _=require(_0x40e4('0x0'));var util=require('util');var moment=require(_0x40e4('0x1'));var BPromise=require(_0x40e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40e4('0x3'))['db'];var utils=require(_0x40e4('0x4'));var logger=require(_0x40e4('0x5'))('rpc');var config=require(_0x40e4('0x6'));var jayson=require(_0x40e4('0x7'));var client=jayson[_0x40e4('0x8')][_0x40e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dad8d,_0x1b17a8,_0x15f207){return new BPromise(function(_0x5bddc9,_0x3a28b0){return client[_0x40e4('0xa')](_0x4dad8d,_0x15f207)['then'](function(_0x48866d){logger[_0x40e4('0xb')](_0x40e4('0xc'),_0x1b17a8,'request\x20sent');logger[_0x40e4('0xd')](_0x40e4('0xe'),_0x1b17a8,'request\x20sent',JSON[_0x40e4('0xf')](_0x48866d));if(_0x48866d[_0x40e4('0x10')]){if(_0x48866d[_0x40e4('0x10')][_0x40e4('0x11')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x1b17a8,_0x48866d[_0x40e4('0x10')][_0x40e4('0x12')]);return _0x3a28b0(_0x48866d['error'][_0x40e4('0x12')]);}logger['error'](_0x40e4('0xc'),_0x1b17a8,_0x48866d[_0x40e4('0x10')][_0x40e4('0x12')]);return _0x5bddc9(_0x48866d[_0x40e4('0x10')][_0x40e4('0x12')]);}else{logger[_0x40e4('0xb')](_0x40e4('0xc'),_0x1b17a8,_0x40e4('0x13'));_0x5bddc9(_0x48866d[_0x40e4('0x14')][_0x40e4('0x12')]);}})[_0x40e4('0x15')](function(_0x66e008){logger[_0x40e4('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x1b17a8,_0x66e008);_0x3a28b0(_0x66e008);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 77d4830..2eea4af 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 _0x750a=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','put','delete','destroy','exports'];(function(_0x5975d6,_0x36c521){var _0x16d3a2=function(_0x481d2d){while(--_0x481d2d){_0x5975d6['push'](_0x5975d6['shift']());}};_0x16d3a2(++_0x36c521);}(_0x750a,0x140));var _0xa750=function(_0x32d30e,_0x2b0c4a){_0x32d30e=_0x32d30e-0x0;var _0x284135=_0x750a[_0x32d30e];return _0x284135;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/fields',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router['post'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['addConfiguration']);router[_0xa750('0x10')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['update']);router[_0xa750('0x11')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);module[_0xa750('0x13')]=router; \ No newline at end of file +var _0xbdb7=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','index','get','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','/:id','multer','util','path','connect-timeout','express','Router'];(function(_0x3c7ad6,_0x1bcbe4){var _0x5afddf=function(_0x52e47b){while(--_0x52e47b){_0x3c7ad6['push'](_0x3c7ad6['shift']());}};_0x5afddf(++_0x1bcbe4);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x391507,_0x564142){_0x391507=_0x391507-0x0;var _0x47fdc4=_0xbdb7[_0x391507];return _0x47fdc4;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')]('/',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x7bdb('0x13')]);router[_0x7bdb('0x14')]('/:id',auth[_0x7bdb('0xf')](),controller['update']);router['delete'](_0x7bdb('0x15'),auth[_0x7bdb('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index f6e2af3..16707ff 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 _0x0120=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1837ee,_0x1b94a6){var _0x50f7f3=function(_0x396f35){while(--_0x396f35){_0x1837ee['push'](_0x1837ee['shift']());}};_0x50f7f3(++_0x1b94a6);}(_0x0120,0x6f));var _0x0012=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0120[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'apiKey':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'serverUrl':{'type':Sequelize[_0x0012('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe2cf=['remoteUri','exports','STRING','username'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x1c14ae,_0x25ecce){_0x1c14ae=_0x1c14ae-0x0;var _0x24c7cf=_0xe2cf[_0x1c14ae];return _0x24c7cf;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfe2c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xfe2c('0x2')},'apiKey':{'type':Sequelize[_0xfe2c('0x1')]},'remoteUri':{'type':Sequelize[_0xfe2c('0x1')],'unique':_0xfe2c('0x3')},'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 b9a1f7a..bf46219 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 _0xc9e0=['filter','merge','VIRTUAL','options','count','includeAll','include','FreshsalesAccount','findAll','rows','show','rawAttributes','length','catch','create','body','find','params','getConfigurations','hasOwnProperty','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','username','remoteUri','apiKey','slice','substring','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields','stringify','Wrong\x20credentials','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x5bd998,_0x126d27){var _0x16128e=function(_0x149dbf){while(--_0x149dbf){_0x5bd998['push'](_0x5bd998['shift']());}};_0x16128e(++_0x126d27);}(_0xc9e0,0x91));var _0x0c9e=function(_0xda3821,_0x2d14b9){_0xda3821=_0xda3821-0x0;var _0xe3b085=_0xc9e0[_0xda3821];return _0xe3b085;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c9e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0c9e('0x1'));var BPromise=require(_0x0c9e('0x2'));var Mustache=require(_0x0c9e('0x3'));var util=require(_0x0c9e('0x4'));var path=require('path');var sox=require(_0x0c9e('0x5'));var csv=require(_0x0c9e('0x6'));var ejs=require(_0x0c9e('0x7'));var fs=require('fs');var fs_extra=require(_0x0c9e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0c9e('0x9'));var jsforce=require(_0x0c9e('0xa'));var deskjs=require(_0x0c9e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c9e('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0c9e('0xd'));var hardwareService=require(_0x0c9e('0xe'));var logger=require(_0x0c9e('0xf'))(_0x0c9e('0x10'));var utils=require(_0x0c9e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x0c9e('0x12'));var db=require(_0x0c9e('0x13'))['db'];var integrations=require(_0x0c9e('0x14'));function respondWithStatusCode(_0x3f6913,_0x136a44){_0x136a44=_0x136a44||0xcc;return function(_0x5a7ee9){if(_0x5a7ee9){return _0x3f6913[_0x0c9e('0x15')](_0x136a44);}return _0x3f6913[_0x0c9e('0x16')](_0x136a44)[_0x0c9e('0x17')]();};}function respondWithResult(_0x37b434,_0x2d4a09){_0x2d4a09=_0x2d4a09||0xc8;return function(_0x46c6ec){if(_0x46c6ec){return _0x37b434['status'](_0x2d4a09)[_0x0c9e('0x18')](_0x46c6ec);}};}function respondWithFilteredResult(_0x18454c,_0x34f7e4){return function(_0x46e287){if(_0x46e287){var _0x20d3e9=typeof _0x34f7e4['offset']===_0x0c9e('0x19')&&typeof _0x34f7e4['limit']===_0x0c9e('0x19');var _0x30c26a=_0x46e287['count'];var _0x434858=_0x20d3e9?0x0:_0x34f7e4[_0x0c9e('0x1a')];var _0x172e06=_0x20d3e9?_0x46e287['count']:_0x34f7e4[_0x0c9e('0x1a')]+_0x34f7e4[_0x0c9e('0x1b')];var _0x29f242;if(_0x172e06>=_0x30c26a){_0x172e06=_0x30c26a;_0x29f242=0xc8;}else{_0x29f242=0xce;}_0x18454c[_0x0c9e('0x16')](_0x29f242);return _0x18454c[_0x0c9e('0x1c')](_0x0c9e('0x1d'),_0x434858+'-'+_0x172e06+'/'+_0x30c26a)['json'](_0x46e287);}return null;};}function patchUpdates(_0x10ef1d){return function(_0x5a0c95){try{jsonpatch[_0x0c9e('0x1e')](_0x5a0c95,_0x10ef1d,!![]);}catch(_0x370f4a){return BPromise[_0x0c9e('0x1f')](_0x370f4a);}return _0x5a0c95[_0x0c9e('0x20')]();};}function saveUpdates(_0x3aa675,_0x51efac){return function(_0x5a2c64){if(_0x5a2c64){return _0x5a2c64[_0x0c9e('0x21')](_0x3aa675)[_0x0c9e('0x22')](function(_0x11d373){return _0x11d373;});}return null;};}function removeEntity(_0x545293,_0x3b0a44){return function(_0x1593c7){if(_0x1593c7){return _0x1593c7[_0x0c9e('0x23')]()[_0x0c9e('0x22')](function(){_0x545293[_0x0c9e('0x16')](0xcc)[_0x0c9e('0x17')]();});}};}function handleEntityNotFound(_0x166f02,_0x751e){return function(_0x4e372d){if(!_0x4e372d){_0x166f02[_0x0c9e('0x15')](0x194);}return _0x4e372d;};}function handleError(_0x20dead,_0x18949e){_0x18949e=_0x18949e||0x1f4;return function(_0x4c00b6){logger[_0x0c9e('0x24')](_0x4c00b6[_0x0c9e('0x25')]);if(_0x4c00b6[_0x0c9e('0x26')]){delete _0x4c00b6[_0x0c9e('0x26')];}_0x20dead['status'](_0x18949e)[_0x0c9e('0x27')](_0x4c00b6);};}exports[_0x0c9e('0x28')]=function(_0x32f13,_0x4d7544){var _0x334366={},_0x1f8e84={},_0x3d0523={'count':0x0,'rows':[]};var _0x4dfcf9=_[_0x0c9e('0x29')](db['FreshsalesAccount']['rawAttributes'],function(_0x1cb3df){return{'name':_0x1cb3df[_0x0c9e('0x2a')],'type':_0x1cb3df[_0x0c9e('0x2b')][_0x0c9e('0x2c')]};});_0x1f8e84[_0x0c9e('0x2d')]=_['map'](_0x4dfcf9,_0x0c9e('0x26'));_0x1f8e84[_0x0c9e('0x2e')]=_[_0x0c9e('0x2f')](_0x32f13[_0x0c9e('0x2e')]);_0x1f8e84[_0x0c9e('0x30')]=_[_0x0c9e('0x31')](_0x1f8e84['model'],_0x1f8e84[_0x0c9e('0x2e')]);_0x334366[_0x0c9e('0x32')]=_[_0x0c9e('0x31')](_0x1f8e84['model'],qs[_0x0c9e('0x33')](_0x32f13[_0x0c9e('0x2e')][_0x0c9e('0x33')]));_0x334366[_0x0c9e('0x32')]=_0x334366['attributes']['length']?_0x334366[_0x0c9e('0x32')]:_0x1f8e84[_0x0c9e('0x2d')];if(!_0x32f13[_0x0c9e('0x2e')]['hasOwnProperty'](_0x0c9e('0x34'))){_0x334366[_0x0c9e('0x1b')]=qs['limit'](_0x32f13[_0x0c9e('0x2e')][_0x0c9e('0x1b')]);_0x334366[_0x0c9e('0x1a')]=qs[_0x0c9e('0x1a')](_0x32f13['query']['offset']);}_0x334366[_0x0c9e('0x35')]=qs[_0x0c9e('0x36')](_0x32f13['query'][_0x0c9e('0x36')]);_0x334366[_0x0c9e('0x37')]=qs[_0x0c9e('0x30')](_[_0x0c9e('0x38')](_0x32f13['query'],_0x1f8e84[_0x0c9e('0x30')]),_0x4dfcf9);if(_0x32f13['query'][_0x0c9e('0x39')]){_0x334366[_0x0c9e('0x37')]=_[_0x0c9e('0x3a')](_0x334366['where'],{'$or':_['map'](_0x4dfcf9,function(_0x1de393){if(_0x1de393[_0x0c9e('0x2b')]!==_0x0c9e('0x3b')){var _0x2d1ac3={};_0x2d1ac3[_0x1de393[_0x0c9e('0x26')]]={'$like':'%'+_0x32f13[_0x0c9e('0x2e')][_0x0c9e('0x39')]+'%'};return _0x2d1ac3;}})});}_0x334366=_[_0x0c9e('0x3a')]({},_0x334366,_0x32f13[_0x0c9e('0x3c')]);var _0x2c64b0={'where':_0x334366[_0x0c9e('0x37')]};return db['FreshsalesAccount'][_0x0c9e('0x3d')](_0x2c64b0)[_0x0c9e('0x22')](function(_0x4a2973){_0x3d0523[_0x0c9e('0x3d')]=_0x4a2973;if(_0x32f13[_0x0c9e('0x2e')][_0x0c9e('0x3e')]){_0x334366[_0x0c9e('0x3f')]=[{'all':!![]}];}return db[_0x0c9e('0x40')][_0x0c9e('0x41')](_0x334366);})[_0x0c9e('0x22')](function(_0x52971a){_0x3d0523[_0x0c9e('0x42')]=_0x52971a;return _0x3d0523;})[_0x0c9e('0x22')](respondWithFilteredResult(_0x4d7544,_0x334366))['catch'](handleError(_0x4d7544,null));};exports[_0x0c9e('0x43')]=function(_0x50188d,_0xabffa9){var _0x107ee5={'raw':![],'where':{'id':_0x50188d['params']['id']}},_0x26143d={};_0x26143d['model']=_[_0x0c9e('0x2f')](db[_0x0c9e('0x40')][_0x0c9e('0x44')]);_0x26143d[_0x0c9e('0x2e')]=_[_0x0c9e('0x2f')](_0x50188d[_0x0c9e('0x2e')]);_0x26143d['filters']=_[_0x0c9e('0x31')](_0x26143d[_0x0c9e('0x2d')],_0x26143d[_0x0c9e('0x2e')]);_0x107ee5['attributes']=_[_0x0c9e('0x31')](_0x26143d[_0x0c9e('0x2d')],qs[_0x0c9e('0x33')](_0x50188d['query'][_0x0c9e('0x33')]));_0x107ee5[_0x0c9e('0x32')]=_0x107ee5[_0x0c9e('0x32')][_0x0c9e('0x45')]?_0x107ee5['attributes']:_0x26143d[_0x0c9e('0x2d')];if(_0x50188d[_0x0c9e('0x2e')][_0x0c9e('0x3e')]){_0x107ee5['include']=[{'all':!![]}];}_0x107ee5=_[_0x0c9e('0x3a')]({},_0x107ee5,_0x50188d[_0x0c9e('0x3c')]);return db['FreshsalesAccount']['find'](_0x107ee5)[_0x0c9e('0x22')](handleEntityNotFound(_0xabffa9,null))[_0x0c9e('0x22')](respondWithResult(_0xabffa9,null))[_0x0c9e('0x46')](handleError(_0xabffa9,null));};exports[_0x0c9e('0x47')]=function(_0x375a3f,_0x106afc){return db['FreshsalesAccount'][_0x0c9e('0x47')](_0x375a3f['body'],{})[_0x0c9e('0x22')](respondWithResult(_0x106afc,0xc9))[_0x0c9e('0x46')](handleError(_0x106afc,null));};exports[_0x0c9e('0x21')]=function(_0x5a9d4b,_0x13a8a7){if(_0x5a9d4b['body']['id']){delete _0x5a9d4b[_0x0c9e('0x48')]['id'];}return db[_0x0c9e('0x40')]['find']({'where':{'id':_0x5a9d4b['params']['id']}})[_0x0c9e('0x22')](handleEntityNotFound(_0x13a8a7,null))[_0x0c9e('0x22')](saveUpdates(_0x5a9d4b['body'],null))[_0x0c9e('0x22')](respondWithResult(_0x13a8a7,null))['catch'](handleError(_0x13a8a7,null));};exports[_0x0c9e('0x23')]=function(_0x250e41,_0x3d424d){return db['FreshsalesAccount'][_0x0c9e('0x49')]({'where':{'id':_0x250e41[_0x0c9e('0x4a')]['id']}})[_0x0c9e('0x22')](handleEntityNotFound(_0x3d424d,null))[_0x0c9e('0x22')](removeEntity(_0x3d424d,null))['catch'](handleError(_0x3d424d,null));};exports[_0x0c9e('0x4b')]=function(_0x1ddb44,_0x4c6511,_0x3a2bd4){var _0x52ce0c={};var _0x1f44e5={};var _0x509e74;var _0x1adbdb;return db[_0x0c9e('0x40')]['findOne']({'where':{'id':_0x1ddb44['params']['id']}})['then'](handleEntityNotFound(_0x4c6511,null))['then'](function(_0x3a2593){if(_0x3a2593){_0x509e74=_0x3a2593;_0x1f44e5[_0x0c9e('0x2d')]=_[_0x0c9e('0x2f')](db['FreshsalesConfiguration'][_0x0c9e('0x44')]);_0x1f44e5[_0x0c9e('0x2e')]=_[_0x0c9e('0x2f')](_0x1ddb44[_0x0c9e('0x2e')]);_0x1f44e5['filters']=_[_0x0c9e('0x31')](_0x1f44e5[_0x0c9e('0x2d')],_0x1f44e5['query']);_0x52ce0c[_0x0c9e('0x32')]=_[_0x0c9e('0x31')](_0x1f44e5['model'],qs['fields'](_0x1ddb44['query']['fields']));_0x52ce0c['attributes']=_0x52ce0c[_0x0c9e('0x32')][_0x0c9e('0x45')]?_0x52ce0c[_0x0c9e('0x32')]:_0x1f44e5[_0x0c9e('0x2d')];_0x52ce0c[_0x0c9e('0x35')]=qs[_0x0c9e('0x36')](_0x1ddb44[_0x0c9e('0x2e')][_0x0c9e('0x36')]);_0x52ce0c[_0x0c9e('0x37')]=qs[_0x0c9e('0x30')](_['pick'](_0x1ddb44[_0x0c9e('0x2e')],_0x1f44e5['filters']));if(_0x1ddb44['query'][_0x0c9e('0x39')]){_0x52ce0c[_0x0c9e('0x37')]=_['merge'](_0x52ce0c['where'],{'$or':_['map'](_0x52ce0c[_0x0c9e('0x32')],function(_0x2d3262){var _0x52f015={};_0x52f015[_0x2d3262]={'$like':'%'+_0x1ddb44[_0x0c9e('0x2e')][_0x0c9e('0x39')]+'%'};return _0x52f015;})});}_0x52ce0c=_[_0x0c9e('0x3a')]({},_0x52ce0c,_0x1ddb44['options']);return _0x509e74['getConfigurations'](_0x52ce0c);}})[_0x0c9e('0x22')](function(_0x360c66){if(_0x360c66){_0x1adbdb=_0x360c66[_0x0c9e('0x45')];if(!_0x1ddb44['query'][_0x0c9e('0x4c')](_0x0c9e('0x34'))){_0x52ce0c['limit']=qs[_0x0c9e('0x1b')](_0x1ddb44[_0x0c9e('0x2e')]['limit']);_0x52ce0c['offset']=qs[_0x0c9e('0x1a')](_0x1ddb44[_0x0c9e('0x2e')][_0x0c9e('0x1a')]);}return _0x509e74['getConfigurations'](_0x52ce0c);}})[_0x0c9e('0x22')](function(_0x1d5cd0){if(_0x1d5cd0){return _0x1d5cd0?{'count':_0x1adbdb,'rows':_0x1d5cd0}:null;}})['then'](respondWithResult(_0x4c6511,null))['catch'](handleError(_0x4c6511,null));};exports[_0x0c9e('0x4d')]=function(_0x49c2c9,_0x4deb9c,_0x28d429){if(_0x49c2c9['body']['id']){delete _0x49c2c9['body']['id'];}return db[_0x0c9e('0x40')][_0x0c9e('0x4e')]({'where':{'id':_0x49c2c9[_0x0c9e('0x4a')]['id']}})[_0x0c9e('0x22')](handleEntityNotFound(_0x4deb9c,null))[_0x0c9e('0x22')](function(_0x26f602){if(_0x26f602){_0x49c2c9[_0x0c9e('0x48')]['AccountId']=_0x26f602['id'];_0x49c2c9[_0x0c9e('0x48')]['Subjects']=integrations[_0x0c9e('0x4f')](_0x49c2c9[_0x0c9e('0x48')][_0x0c9e('0x50')],_0x49c2c9[_0x0c9e('0x48')]['type']);_0x49c2c9['body'][_0x0c9e('0x51')]=integrations[_0x0c9e('0x52')](_0x49c2c9[_0x0c9e('0x48')][_0x0c9e('0x50')],_0x49c2c9[_0x0c9e('0x48')]['type']);return db[_0x0c9e('0x53')][_0x0c9e('0x47')](_0x49c2c9[_0x0c9e('0x48')],{'include':[{'model':db[_0x0c9e('0x54')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x0c9e('0x51')}]});}return null;})[_0x0c9e('0x22')](respondWithResult(_0x4deb9c,null))[_0x0c9e('0x46')](handleError(_0x4deb9c,null));};exports['getFields']=function(_0x378241,_0xffe482,_0x4d3430){var _0x122ad3='';var _0x33960b='';return db[_0x0c9e('0x40')][_0x0c9e('0x4e')]({'where':{'id':_0x378241[_0x0c9e('0x4a')]['id']},'attributes':['id',_0x0c9e('0x55'),_0x0c9e('0x56'),_0x0c9e('0x57')]})['then'](handleEntityNotFound(_0xffe482,null))[_0x0c9e('0x22')](function(_0x376844){if(_0x376844){_0x33960b=_0x376844['username'];_0x122ad3=_0x376844[_0x0c9e('0x56')];var _0x36575a=_0x376844[_0x0c9e('0x56')][_0x0c9e('0x58')](-0x1);if(_0x36575a==='/'){_0x122ad3=_0x122ad3[_0x0c9e('0x59')](0x0,_0x122ad3['lastIndexOf'](_0x36575a));}return rp({'method':'GET','uri':util[_0x0c9e('0x5a')]('%s%s',_0x122ad3,_0x0c9e('0x5b')),'headers':{'Authorization':_0x0c9e('0x5c')+_0x376844[_0x0c9e('0x57')]},'json':!![]});}})[_0x0c9e('0x22')](function(_0x244d40){if(_0x244d40){var _0x160260=_0x244d40[_0x0c9e('0x5d')];var _0xa055f2=![];var _0xfa9e67=null;for(_0xfa9e67=0x0;_0xfa9e67<_0x160260['length'];_0xfa9e67++){if(_0x160260[_0xfa9e67][_0x0c9e('0x5e')]===_0x33960b){_0xa055f2=!![];}}if(_0xa055f2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0c9e('0x5f')});}}})[_0x0c9e('0x22')](respondWithResult(_0xffe482,null))[_0x0c9e('0x46')](function(_0x3ece95){var _0x502591=_0x378241[_0x0c9e('0x2e')][_0x0c9e('0x60')]?0x1f4:_0x3ece95[_0x0c9e('0x61')]||0x1f4;logger[_0x0c9e('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x0c9e('0x62'),_0x502591,JSON[_0x0c9e('0x63')](_0x3ece95));delete _0x3ece95['name'];if(_0x502591===0x191){_0x502591=0x190;}_0xffe482['status'](_0x502591)[_0x0c9e('0x27')](_0x378241[_0x0c9e('0x2e')][_0x0c9e('0x60')]?{'message':_0x0c9e('0x64'),'statusCode':_0x3ece95[_0x0c9e('0x61')]}:_0x3ece95);});}; \ No newline at end of file +var _0xb195=['status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xb195,0x1e2));var _0x5b19=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xb195[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b19('0x0'));var zipdir=require(_0x5b19('0x1'));var jsonpatch=require(_0x5b19('0x2'));var rp=require('request-promise');var moment=require(_0x5b19('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5b19('0x4'));var util=require(_0x5b19('0x5'));var path=require(_0x5b19('0x6'));var sox=require('sox');var csv=require(_0x5b19('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b19('0x8'));var _=require(_0x5b19('0x9'));var squel=require(_0x5b19('0xa'));var crypto=require('crypto');var jsforce=require(_0x5b19('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b19('0x7'));var querystring=require(_0x5b19('0xc'));var Papa=require(_0x5b19('0xd'));var Redis=require('ioredis');var authService=require(_0x5b19('0xe'));var qs=require(_0x5b19('0xf'));var as=require(_0x5b19('0x10'));var hardwareService=require(_0x5b19('0x11'));var logger=require(_0x5b19('0x12'))(_0x5b19('0x13'));var utils=require('../../config/utils');var config=require(_0x5b19('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b19('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2da45d,_0x315be5){_0x315be5=_0x315be5||0xcc;return function(_0x81ecf){if(_0x81ecf){return _0x2da45d[_0x5b19('0x16')](_0x315be5);}return _0x2da45d[_0x5b19('0x17')](_0x315be5)[_0x5b19('0x18')]();};}function respondWithResult(_0x2d4e39,_0x1d751b){_0x1d751b=_0x1d751b||0xc8;return function(_0x5d2e56){if(_0x5d2e56){return _0x2d4e39['status'](_0x1d751b)['json'](_0x5d2e56);}};}function respondWithFilteredResult(_0x76bee0,_0xf91ebc){return function(_0x3cd4c3){if(_0x3cd4c3){var _0x2c6e01=typeof _0xf91ebc['offset']===_0x5b19('0x19')&&typeof _0xf91ebc[_0x5b19('0x1a')]==='undefined';var _0x1d96cf=_0x3cd4c3[_0x5b19('0x1b')];var _0x10b8c4=_0x2c6e01?0x0:_0xf91ebc['offset'];var _0x274ce7=_0x2c6e01?_0x3cd4c3['count']:_0xf91ebc[_0x5b19('0x1c')]+_0xf91ebc[_0x5b19('0x1a')];var _0x51de8f;if(_0x274ce7>=_0x1d96cf){_0x274ce7=_0x1d96cf;_0x51de8f=0xc8;}else{_0x51de8f=0xce;}_0x76bee0[_0x5b19('0x17')](_0x51de8f);return _0x76bee0['set'](_0x5b19('0x1d'),_0x10b8c4+'-'+_0x274ce7+'/'+_0x1d96cf)[_0x5b19('0x1e')](_0x3cd4c3);}return null;};}function patchUpdates(_0x54bda3){return function(_0x141da9){try{jsonpatch[_0x5b19('0x1f')](_0x141da9,_0x54bda3,!![]);}catch(_0x102e35){return BPromise[_0x5b19('0x20')](_0x102e35);}return _0x141da9[_0x5b19('0x21')]();};}function saveUpdates(_0x295051,_0x5de085){return function(_0x52afcc){if(_0x52afcc){return _0x52afcc[_0x5b19('0x22')](_0x295051)[_0x5b19('0x23')](function(_0x2f1293){return _0x2f1293;});}return null;};}function removeEntity(_0x40286d,_0x521061){return function(_0x3fb2cc){if(_0x3fb2cc){return _0x3fb2cc[_0x5b19('0x24')]()[_0x5b19('0x23')](function(){_0x40286d['status'](0xcc)[_0x5b19('0x18')]();});}};}function handleEntityNotFound(_0x361adb,_0x5d9a2d){return function(_0x56062c){if(!_0x56062c){_0x361adb[_0x5b19('0x16')](0x194);}return _0x56062c;};}function handleError(_0x49c66f,_0xec3189){_0xec3189=_0xec3189||0x1f4;return function(_0x540f2b){logger[_0x5b19('0x25')](_0x540f2b[_0x5b19('0x26')]);if(_0x540f2b[_0x5b19('0x27')]){delete _0x540f2b[_0x5b19('0x27')];}_0x49c66f[_0x5b19('0x17')](_0xec3189)['send'](_0x540f2b);};}exports[_0x5b19('0x28')]=function(_0x12d80b,_0x18b34c){var _0x1f46c5={},_0x37472={},_0x5a3701={'count':0x0,'rows':[]};var _0x102c72=_[_0x5b19('0x29')](db[_0x5b19('0x2a')][_0x5b19('0x2b')],function(_0x62b7f2){return{'name':_0x62b7f2[_0x5b19('0x2c')],'type':_0x62b7f2[_0x5b19('0x2d')][_0x5b19('0x2e')]};});_0x37472[_0x5b19('0x2f')]=_[_0x5b19('0x29')](_0x102c72,'name');_0x37472[_0x5b19('0x30')]=_['keys'](_0x12d80b[_0x5b19('0x30')]);_0x37472[_0x5b19('0x31')]=_[_0x5b19('0x32')](_0x37472[_0x5b19('0x2f')],_0x37472[_0x5b19('0x30')]);_0x1f46c5[_0x5b19('0x33')]=_['intersection'](_0x37472['model'],qs[_0x5b19('0x34')](_0x12d80b['query'][_0x5b19('0x34')]));_0x1f46c5[_0x5b19('0x33')]=_0x1f46c5['attributes'][_0x5b19('0x35')]?_0x1f46c5['attributes']:_0x37472[_0x5b19('0x2f')];if(!_0x12d80b['query']['hasOwnProperty']('nolimit')){_0x1f46c5[_0x5b19('0x1a')]=qs[_0x5b19('0x1a')](_0x12d80b[_0x5b19('0x30')][_0x5b19('0x1a')]);_0x1f46c5[_0x5b19('0x1c')]=qs[_0x5b19('0x1c')](_0x12d80b[_0x5b19('0x30')][_0x5b19('0x1c')]);}_0x1f46c5[_0x5b19('0x36')]=qs[_0x5b19('0x37')](_0x12d80b[_0x5b19('0x30')][_0x5b19('0x37')]);_0x1f46c5['where']=qs['filters'](_[_0x5b19('0x38')](_0x12d80b[_0x5b19('0x30')],_0x37472['filters']),_0x102c72);if(_0x12d80b['query'][_0x5b19('0x39')]){_0x1f46c5['where']=_[_0x5b19('0x3a')](_0x1f46c5[_0x5b19('0x3b')],{'$or':_[_0x5b19('0x29')](_0x102c72,function(_0x4d7681){if(_0x4d7681[_0x5b19('0x2d')]!==_0x5b19('0x3c')){var _0x405ff9={};_0x405ff9[_0x4d7681[_0x5b19('0x27')]]={'$like':'%'+_0x12d80b[_0x5b19('0x30')]['filter']+'%'};return _0x405ff9;}})});}_0x1f46c5=_[_0x5b19('0x3a')]({},_0x1f46c5,_0x12d80b[_0x5b19('0x3d')]);var _0x3aac23={'where':_0x1f46c5[_0x5b19('0x3b')]};return db['FreshsalesAccount'][_0x5b19('0x1b')](_0x3aac23)[_0x5b19('0x23')](function(_0x540b4a){_0x5a3701[_0x5b19('0x1b')]=_0x540b4a;if(_0x12d80b[_0x5b19('0x30')][_0x5b19('0x3e')]){_0x1f46c5[_0x5b19('0x3f')]=[{'all':!![]}];}return db[_0x5b19('0x2a')][_0x5b19('0x40')](_0x1f46c5);})[_0x5b19('0x23')](function(_0x174fa7){_0x5a3701[_0x5b19('0x41')]=_0x174fa7;return _0x5a3701;})[_0x5b19('0x23')](respondWithFilteredResult(_0x18b34c,_0x1f46c5))[_0x5b19('0x42')](handleError(_0x18b34c,null));};exports[_0x5b19('0x43')]=function(_0x2090cd,_0x24d225){var _0x720799={'raw':![],'where':{'id':_0x2090cd[_0x5b19('0x44')]['id']}},_0x38d26f={};_0x38d26f['model']=_['keys'](db[_0x5b19('0x2a')][_0x5b19('0x2b')]);_0x38d26f[_0x5b19('0x30')]=_[_0x5b19('0x45')](_0x2090cd[_0x5b19('0x30')]);_0x38d26f[_0x5b19('0x31')]=_['intersection'](_0x38d26f['model'],_0x38d26f['query']);_0x720799[_0x5b19('0x33')]=_[_0x5b19('0x32')](_0x38d26f[_0x5b19('0x2f')],qs[_0x5b19('0x34')](_0x2090cd[_0x5b19('0x30')][_0x5b19('0x34')]));_0x720799[_0x5b19('0x33')]=_0x720799[_0x5b19('0x33')][_0x5b19('0x35')]?_0x720799['attributes']:_0x38d26f[_0x5b19('0x2f')];if(_0x2090cd[_0x5b19('0x30')][_0x5b19('0x3e')]){_0x720799[_0x5b19('0x3f')]=[{'all':!![]}];}_0x720799=_[_0x5b19('0x3a')]({},_0x720799,_0x2090cd[_0x5b19('0x3d')]);return db['FreshsalesAccount'][_0x5b19('0x46')](_0x720799)['then'](handleEntityNotFound(_0x24d225,null))[_0x5b19('0x23')](respondWithResult(_0x24d225,null))[_0x5b19('0x42')](handleError(_0x24d225,null));};exports[_0x5b19('0x47')]=function(_0x417aad,_0x1575b5){return db[_0x5b19('0x2a')][_0x5b19('0x47')](_0x417aad[_0x5b19('0x48')],{})['then'](respondWithResult(_0x1575b5,0xc9))[_0x5b19('0x42')](handleError(_0x1575b5,null));};exports[_0x5b19('0x22')]=function(_0x27daaa,_0x41630f){if(_0x27daaa[_0x5b19('0x48')]['id']){delete _0x27daaa[_0x5b19('0x48')]['id'];}return db[_0x5b19('0x2a')][_0x5b19('0x46')]({'where':{'id':_0x27daaa[_0x5b19('0x44')]['id']}})[_0x5b19('0x23')](handleEntityNotFound(_0x41630f,null))['then'](saveUpdates(_0x27daaa[_0x5b19('0x48')],null))[_0x5b19('0x23')](respondWithResult(_0x41630f,null))[_0x5b19('0x42')](handleError(_0x41630f,null));};exports[_0x5b19('0x24')]=function(_0x77f3a9,_0x26feab){return db[_0x5b19('0x2a')]['find']({'where':{'id':_0x77f3a9[_0x5b19('0x44')]['id']}})[_0x5b19('0x23')](handleEntityNotFound(_0x26feab,null))['then'](removeEntity(_0x26feab,null))[_0x5b19('0x42')](handleError(_0x26feab,null));};exports[_0x5b19('0x49')]=function(_0xc84306,_0x478a76,_0x362eaf){var _0x5929ad={};var _0x41153d={};var _0x20fd71;var _0x2cd173;return db[_0x5b19('0x2a')][_0x5b19('0x4a')]({'where':{'id':_0xc84306['params']['id']}})[_0x5b19('0x23')](handleEntityNotFound(_0x478a76,null))[_0x5b19('0x23')](function(_0x157009){if(_0x157009){_0x20fd71=_0x157009;_0x41153d['model']=_[_0x5b19('0x45')](db[_0x5b19('0x4b')]['rawAttributes']);_0x41153d[_0x5b19('0x30')]=_[_0x5b19('0x45')](_0xc84306['query']);_0x41153d[_0x5b19('0x31')]=_[_0x5b19('0x32')](_0x41153d[_0x5b19('0x2f')],_0x41153d['query']);_0x5929ad[_0x5b19('0x33')]=_['intersection'](_0x41153d[_0x5b19('0x2f')],qs[_0x5b19('0x34')](_0xc84306[_0x5b19('0x30')]['fields']));_0x5929ad[_0x5b19('0x33')]=_0x5929ad[_0x5b19('0x33')][_0x5b19('0x35')]?_0x5929ad[_0x5b19('0x33')]:_0x41153d[_0x5b19('0x2f')];_0x5929ad['order']=qs[_0x5b19('0x37')](_0xc84306[_0x5b19('0x30')]['sort']);_0x5929ad['where']=qs[_0x5b19('0x31')](_[_0x5b19('0x38')](_0xc84306['query'],_0x41153d[_0x5b19('0x31')]));if(_0xc84306[_0x5b19('0x30')][_0x5b19('0x39')]){_0x5929ad[_0x5b19('0x3b')]=_[_0x5b19('0x3a')](_0x5929ad[_0x5b19('0x3b')],{'$or':_[_0x5b19('0x29')](_0x5929ad['attributes'],function(_0x35be5a){var _0x2ce9aa={};_0x2ce9aa[_0x35be5a]={'$like':'%'+_0xc84306['query'][_0x5b19('0x39')]+'%'};return _0x2ce9aa;})});}_0x5929ad=_['merge']({},_0x5929ad,_0xc84306[_0x5b19('0x3d')]);return _0x20fd71[_0x5b19('0x49')](_0x5929ad);}})['then'](function(_0x13f583){if(_0x13f583){_0x2cd173=_0x13f583['length'];if(!_0xc84306[_0x5b19('0x30')]['hasOwnProperty'](_0x5b19('0x4c'))){_0x5929ad['limit']=qs[_0x5b19('0x1a')](_0xc84306['query'][_0x5b19('0x1a')]);_0x5929ad[_0x5b19('0x1c')]=qs['offset'](_0xc84306['query'][_0x5b19('0x1c')]);}return _0x20fd71[_0x5b19('0x49')](_0x5929ad);}})[_0x5b19('0x23')](function(_0x1a251d){if(_0x1a251d){return _0x1a251d?{'count':_0x2cd173,'rows':_0x1a251d}:null;}})[_0x5b19('0x23')](respondWithResult(_0x478a76,null))[_0x5b19('0x42')](handleError(_0x478a76,null));};exports[_0x5b19('0x4d')]=function(_0x3e5df1,_0x38c4b0,_0x46bdec){if(_0x3e5df1['body']['id']){delete _0x3e5df1['body']['id'];}return db[_0x5b19('0x2a')][_0x5b19('0x4a')]({'where':{'id':_0x3e5df1[_0x5b19('0x44')]['id']}})['then'](handleEntityNotFound(_0x38c4b0,null))['then'](function(_0x379c3f){if(_0x379c3f){_0x3e5df1[_0x5b19('0x48')][_0x5b19('0x4e')]=_0x379c3f['id'];_0x3e5df1[_0x5b19('0x48')]['Subjects']=integrations[_0x5b19('0x4f')](_0x3e5df1[_0x5b19('0x48')][_0x5b19('0x50')],_0x3e5df1[_0x5b19('0x48')][_0x5b19('0x2d')]);_0x3e5df1[_0x5b19('0x48')][_0x5b19('0x51')]=integrations[_0x5b19('0x52')](_0x3e5df1[_0x5b19('0x48')][_0x5b19('0x50')],_0x3e5df1[_0x5b19('0x48')][_0x5b19('0x2d')]);return db[_0x5b19('0x4b')]['create'](_0x3e5df1[_0x5b19('0x48')],{'include':[{'model':db[_0x5b19('0x53')],'as':'Subjects'},{'model':db[_0x5b19('0x53')],'as':_0x5b19('0x51')}]});}return null;})[_0x5b19('0x23')](respondWithResult(_0x38c4b0,null))['catch'](handleError(_0x38c4b0,null));};exports[_0x5b19('0x54')]=function(_0x35808e,_0x30dc3d,_0x4c4023){var _0x38e8d6='';var _0x122151='';return db[_0x5b19('0x2a')][_0x5b19('0x4a')]({'where':{'id':_0x35808e['params']['id']},'attributes':['id',_0x5b19('0x55'),_0x5b19('0x56'),_0x5b19('0x57')]})[_0x5b19('0x23')](handleEntityNotFound(_0x30dc3d,null))['then'](function(_0x1d77f9){if(_0x1d77f9){_0x122151=_0x1d77f9[_0x5b19('0x55')];_0x38e8d6=_0x1d77f9['remoteUri'];var _0xc4c018=_0x1d77f9[_0x5b19('0x56')][_0x5b19('0x58')](-0x1);if(_0xc4c018==='/'){_0x38e8d6=_0x38e8d6['substring'](0x0,_0x38e8d6[_0x5b19('0x59')](_0xc4c018));}return rp({'method':_0x5b19('0x5a'),'uri':util[_0x5b19('0x5b')](_0x5b19('0x5c'),_0x38e8d6,_0x5b19('0x5d')),'headers':{'Authorization':_0x5b19('0x5e')+_0x1d77f9[_0x5b19('0x57')]},'json':!![]});}})['then'](function(_0x4134e7){if(_0x4134e7){var _0x33d641=_0x4134e7[_0x5b19('0x5f')];var _0x3f7480=![];var _0x4e7e4b=null;for(_0x4e7e4b=0x0;_0x4e7e4b<_0x33d641[_0x5b19('0x35')];_0x4e7e4b++){if(_0x33d641[_0x4e7e4b]['email']===_0x122151){_0x3f7480=!![];}}if(_0x3f7480){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5b19('0x60')});}}})[_0x5b19('0x23')](respondWithResult(_0x30dc3d,null))[_0x5b19('0x42')](function(_0x1fb793){var _0x50634e=_0x35808e[_0x5b19('0x30')][_0x5b19('0x61')]?0x1f4:_0x1fb793['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x5b19('0x54'),_0x50634e,JSON[_0x5b19('0x62')](_0x1fb793));delete _0x1fb793['name'];if(_0x50634e===0x191){_0x50634e=0x190;}_0x30dc3d[_0x5b19('0x17')](_0x50634e)[_0x5b19('0x63')](_0x35808e[_0x5b19('0x30')]['test']?{'message':_0x5b19('0x64'),'statusCode':_0x1fb793['statusCode']}:_0x1fb793);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 4a4fb02..fd34e08 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 _0x4745=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4d3609,_0x5ee78a){var _0x1e6bcd=function(_0x21ceda){while(--_0x21ceda){_0x4d3609['push'](_0x4d3609['shift']());}};_0x1e6bcd(++_0x5ee78a);}(_0x4745,0x1e7));var _0x5474=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x4745[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));var integrations=require(_0x5474('0xb'));module['exports']=function(_0x3d1e1,_0x431f81){return _0x3d1e1['define'](_0x5474('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x403ced,_0x58a778){var _0x3674c5=function(_0x37bd64){while(--_0x37bd64){_0x403ced['push'](_0x403ced['shift']());}};_0x3674c5(++_0x58a778);}(_0x4c60,0xc1));var _0x04c6=function(_0x4e41bf,_0xe82655){_0x4e41bf=_0x4e41bf-0x0;var _0x35f898=_0x4c60[_0x4e41bf];return _0x35f898;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('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(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_freshsales_accounts','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 a7d4ce2..f2bb22d 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 _0x627e=['request','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','raw','options','where','map','model','attributes','include','then','debug','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x51edca,_0x18ad70){var _0x2b77ec=function(_0x55a549){while(--_0x55a549){_0x51edca['push'](_0x51edca['shift']());}};_0x2b77ec(++_0x18ad70);}(_0x627e,0x14a));var _0xe627=function(_0x983d34,_0x46938e){_0x983d34=_0x983d34-0x0;var _0x3d81a6=_0x627e[_0x983d34];return _0x3d81a6;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});}exports[_0xe627('0x14')]=function(_0x56559b){var _0x2fe46a=this;return new Promise(function(_0x538b22,_0x24fddd){return db['FreshsalesAccount'][_0xe627('0x15')]({'raw':_0x56559b['options']?_0x56559b['options'][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x56559b['options']?_0x56559b[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x56559b['options']?_0x56559b['options']['attributes']||null:null,'limit':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['limit']||null:null,'include':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['include']?_[_0xe627('0x19')](_0x56559b[_0xe627('0x17')]['include'],function(_0x42f3d1){return{'model':db[_0x42f3d1[_0xe627('0x1a')]],'as':_0x42f3d1['as'],'attributes':_0x42f3d1[_0xe627('0x1b')],'include':_0x42f3d1['include']?_[_0xe627('0x19')](_0x42f3d1[_0xe627('0x1c')],function(_0x1a5081){return{'model':db[_0x1a5081[_0xe627('0x1a')]],'as':_0x1a5081['as'],'attributes':_0x1a5081['attributes'],'include':_0x1a5081[_0xe627('0x1c')]?_[_0xe627('0x19')](_0x1a5081[_0xe627('0x1c')],function(_0x29eb8e){return{'model':db[_0x29eb8e[_0xe627('0x1a')]],'as':_0x29eb8e['as'],'attributes':_0x29eb8e[_0xe627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x44c9f7){logger[_0xe627('0xb')]('GetFreshsalesAccount',_0x56559b);logger[_0xe627('0x1e')]('GetFreshsalesAccount',_0x56559b,JSON['stringify'](_0x44c9f7));_0x538b22(_0x44c9f7);})[_0xe627('0x13')](function(_0xdf63c8){logger['error'](_0xe627('0x14'),_0xdf63c8['message'],_0x56559b);_0x24fddd(_0x2fe46a[_0xe627('0x10')](0x1f4,_0xdf63c8['message']));});});};exports[_0xe627('0x1f')]=function(_0x26833a){var _0x5d8992=this;return new Promise(function(_0x33e9dd,_0x4f92c9){return db[_0xe627('0x20')][_0xe627('0x21')]({'raw':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x1b')]||null:null,'include':_0x26833a['options']?_0x26833a['options'][_0xe627('0x1c')]?_['map'](_0x26833a[_0xe627('0x17')]['include'],function(_0x56d1d7){return{'model':db[_0x56d1d7[_0xe627('0x1a')]],'as':_0x56d1d7['as'],'attributes':_0x56d1d7['attributes'],'include':_0x56d1d7['include']?_[_0xe627('0x19')](_0x56d1d7[_0xe627('0x1c')],function(_0x55f001){return{'model':db[_0x55f001['model']],'as':_0x55f001['as'],'attributes':_0x55f001['attributes'],'include':_0x55f001['include']?_[_0xe627('0x19')](_0x55f001['include'],function(_0x39338c){return{'model':db[_0x39338c[_0xe627('0x1a')]],'as':_0x39338c['as'],'attributes':_0x39338c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x35a303){logger['info'](_0xe627('0x1f'),_0x26833a);logger[_0xe627('0x1e')](_0xe627('0x1f'),_0x26833a,JSON[_0xe627('0xf')](_0x35a303));_0x33e9dd(_0x35a303);})[_0xe627('0x13')](function(_0x28fd59){logger['error'](_0xe627('0x1f'),_0x28fd59['message'],_0x26833a);_0x4f92c9(_0x5d8992[_0xe627('0x10')](0x1f4,_0x28fd59['message']));});});}; \ No newline at end of file +var _0x524e=['http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshsalesAccount','catch','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52074a,_0x286c9e){var _0x2f49ae=function(_0x44107b){while(--_0x44107b){_0x52074a['push'](_0x52074a['shift']());}};_0x2f49ae(++_0x286c9e);}(_0x524e,0x15e));var _0xe524=function(_0x21d9a3,_0x312bc7){_0x21d9a3=_0x21d9a3-0x0;var _0x273666=_0x524e[_0x21d9a3];return _0x273666;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['GetFreshsalesAccount']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')]({'raw':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]===undefined?!![]:![]:!![],'where':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1c')]||null:null,'include':_0x3a4027[_0xe524('0x18')]?_0x3a4027['options'][_0xe524('0x1d')]?_['map'](_0x3a4027['options'][_0xe524('0x1d')],function(_0x23df5e){return{'model':db[_0x23df5e[_0xe524('0x1e')]],'as':_0x23df5e['as'],'attributes':_0x23df5e[_0xe524('0x1b')],'include':_0x23df5e['include']?_[_0xe524('0x1f')](_0x23df5e['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x1e')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1b')],'include':_0x17e245[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x17e245[_0xe524('0x1d')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x45abad){logger[_0xe524('0xd')](_0xe524('0x20'),_0x3a4027);logger[_0xe524('0x10')]('GetFreshsalesAccount',_0x3a4027,JSON['stringify'](_0x45abad));_0x11b2a1(_0x45abad);})[_0xe524('0x21')](function(_0x25e7a7){logger[_0xe524('0x13')](_0xe524('0x20'),_0x25e7a7[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x25e7a7[_0xe524('0x15')]));});});};exports[_0xe524('0x22')]=function(_0x4a4e15){var _0x5b7ded=this;return new Promise(function(_0x20688e,_0x376324){return db['FreshsalesAccount'][_0xe524('0x23')]({'raw':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['attributes']||null:null,'include':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')]?_['map'](_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')],function(_0x49c43e){return{'model':db[_0x49c43e[_0xe524('0x1e')]],'as':_0x49c43e['as'],'attributes':_0x49c43e[_0xe524('0x1b')],'include':_0x49c43e[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x49c43e['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x1e')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1b')],'include':_0x415450[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x415450[_0xe524('0x1d')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x1e')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x56f371){logger[_0xe524('0xd')](_0xe524('0x22'),_0x4a4e15);logger['debug'](_0xe524('0x22'),_0x4a4e15,JSON['stringify'](_0x56f371));_0x20688e(_0x56f371);})[_0xe524('0x21')](function(_0x41af26){logger[_0xe524('0x13')](_0xe524('0x22'),_0x41af26[_0xe524('0x15')],_0x4a4e15);_0x376324(_0x5b7ded[_0xe524('0x13')](0x1f4,_0x41af26[_0xe524('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 5ba4a75..a10e4b2 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 _0x39b8=['show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x39b8,0xfa));var _0x839b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x39b8[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x839b('0x0'));var util=require(_0x839b('0x1'));var path=require(_0x839b('0x2'));var timeout=require(_0x839b('0x3'));var express=require(_0x839b('0x4'));var router=express[_0x839b('0x5')]();var fs_extra=require(_0x839b('0x6'));var auth=require(_0x839b('0x7'));var interaction=require(_0x839b('0x8'));var config=require(_0x839b('0x9'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x839b('0xa')]);router[_0x839b('0xb')](_0x839b('0xc'),auth[_0x839b('0xd')](),controller[_0x839b('0xe')]);router[_0x839b('0xb')](_0x839b('0xf'),auth[_0x839b('0xd')](),controller[_0x839b('0x10')]);router['get'](_0x839b('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x839b('0xb')](_0x839b('0x12'),auth[_0x839b('0xd')](),controller[_0x839b('0x13')]);router[_0x839b('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x839b('0x15')]('/:id',auth[_0x839b('0xd')](),controller['update']);router[_0x839b('0x16')](_0x839b('0xc'),auth[_0x839b('0xd')](),controller[_0x839b('0x17')]);module['exports']=router; \ No newline at end of file +var _0xfa3c=['show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','/:id','destroy','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x3d4c0e,_0x332321){var _0x548a9d=function(_0x133d75){while(--_0x133d75){_0x3d4c0e['push'](_0x3d4c0e['shift']());}};_0x548a9d(++_0x332321);}(_0xfa3c,0x15e));var _0xcfa3=function(_0x32e4de,_0x7da1c5){_0x32e4de=_0x32e4de-0x0;var _0x51ba2a=_0xfa3c[_0x32e4de];return _0x51ba2a;};'use strict';var multer=require('multer');var util=require(_0xcfa3('0x0'));var path=require(_0xcfa3('0x1'));var timeout=require(_0xcfa3('0x2'));var express=require('express');var router=express[_0xcfa3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcfa3('0x4'));var config=require(_0xcfa3('0x5'));var controller=require(_0xcfa3('0x6'));router[_0xcfa3('0x7')]('/',auth[_0xcfa3('0x8')](),controller[_0xcfa3('0x9')]);router[_0xcfa3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xcfa3('0xa')]);router[_0xcfa3('0x7')](_0xcfa3('0xb'),auth[_0xcfa3('0x8')](),controller[_0xcfa3('0xc')]);router[_0xcfa3('0x7')](_0xcfa3('0xd'),auth[_0xcfa3('0x8')](),controller[_0xcfa3('0xe')]);router['get'](_0xcfa3('0xf'),auth[_0xcfa3('0x8')](),controller[_0xcfa3('0x10')]);router[_0xcfa3('0x11')]('/',auth[_0xcfa3('0x8')](),controller[_0xcfa3('0x12')]);router[_0xcfa3('0x13')]('/:id',auth[_0xcfa3('0x8')](),controller[_0xcfa3('0x14')]);router[_0xcfa3('0x15')](_0xcfa3('0x16'),auth[_0xcfa3('0x8')](),controller[_0xcfa3('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 3779e6e..c770cad 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 _0xf59e=['STRING','sequelize'];(function(_0x2b4d8f,_0x530c11){var _0x143875=function(_0x408885){while(--_0x408885){_0x2b4d8f['push'](_0x2b4d8f['shift']());}};_0x143875(++_0x530c11);}(_0xf59e,0x113));var _0xef59=function(_0x526ecd,_0x5c5958){_0x526ecd=_0x526ecd-0x0;var _0x83b053=_0xf59e[_0x526ecd];return _0x83b053;};'use strict';var Sequelize=require(_0xef59('0x0'));module['exports']={'name':{'type':Sequelize[_0xef59('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6411=['STRING','sequelize'];(function(_0xad0183,_0x2745cf){var _0x466919=function(_0xe4026b){while(--_0xe4026b){_0xad0183['push'](_0xad0183['shift']());}};_0x466919(++_0x2745cf);}(_0x6411,0xb1));var _0x1641=function(_0x24cc9e,_0x4dee29){_0x24cc9e=_0x24cc9e-0x0;var _0x22cfec=_0x6411[_0x24cc9e];return _0x22cfec;};'use strict';var Sequelize=require(_0x1641('0x0'));module['exports']={'name':{'type':Sequelize[_0x1641('0x1')]},'description':{'type':Sequelize[_0x1641('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 1d2ce91..f6a9aff 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 _0xb438=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/logger','api','../../config/utils','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','error','name','send','map','fieldName','model','query','keys','intersection','attributes','fields','sort','filters','pick','filter','where','type','VIRTUAL','merge','FreshsalesConfiguration','include','findAll','rows','then','catch','show','params','rawAttributes','length','includeAll','options','find','create','update','body','destroy','getSubjects','hasOwnProperty','nolimit','getDescriptions','findOne','getFields','FreshsalesField','order'];(function(_0x4d4f02,_0x28809a){var _0x1b2eed=function(_0x18779d){while(--_0x18779d){_0x4d4f02['push'](_0x4d4f02['shift']());}};_0x1b2eed(++_0x28809a);}(_0xb438,0x186));var _0x8b43=function(_0x365327,_0x582980){_0x365327=_0x365327-0x0;var _0x2390d7=_0xb438[_0x365327];return _0x2390d7;};'use strict';var emlformat=require(_0x8b43('0x0'));var rimraf=require(_0x8b43('0x1'));var zipdir=require(_0x8b43('0x2'));var jsonpatch=require(_0x8b43('0x3'));var rp=require('request-promise');var moment=require(_0x8b43('0x4'));var BPromise=require(_0x8b43('0x5'));var Mustache=require(_0x8b43('0x6'));var util=require('util');var path=require(_0x8b43('0x7'));var sox=require(_0x8b43('0x8'));var csv=require('to-csv');var ejs=require(_0x8b43('0x9'));var fs=require('fs');var fs_extra=require(_0x8b43('0xa'));var _=require(_0x8b43('0xb'));var squel=require(_0x8b43('0xc'));var crypto=require(_0x8b43('0xd'));var jsforce=require(_0x8b43('0xe'));var deskjs=require(_0x8b43('0xf'));var toCsv=require(_0x8b43('0x10'));var querystring=require(_0x8b43('0x11'));var Papa=require('papaparse');var Redis=require(_0x8b43('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b43('0x13'))(_0x8b43('0x14'));var utils=require(_0x8b43('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f23c3,_0xc563d6){_0xc563d6=_0xc563d6||0xcc;return function(_0x52ae22){if(_0x52ae22){return _0x1f23c3[_0x8b43('0x16')](_0xc563d6);}return _0x1f23c3[_0x8b43('0x17')](_0xc563d6)[_0x8b43('0x18')]();};}function respondWithResult(_0x24c8cd,_0x1bab14){_0x1bab14=_0x1bab14||0xc8;return function(_0x1dbd2c){if(_0x1dbd2c){return _0x24c8cd[_0x8b43('0x17')](_0x1bab14)['json'](_0x1dbd2c);}};}function respondWithFilteredResult(_0x5d4d53,_0x38e35a){return function(_0x37c328){if(_0x37c328){var _0x1c171b=typeof _0x38e35a['offset']===_0x8b43('0x19')&&typeof _0x38e35a[_0x8b43('0x1a')]===_0x8b43('0x19');var _0x9c8504=_0x37c328[_0x8b43('0x1b')];var _0x55a11b=_0x1c171b?0x0:_0x38e35a[_0x8b43('0x1c')];var _0x33d3a5=_0x1c171b?_0x37c328[_0x8b43('0x1b')]:_0x38e35a[_0x8b43('0x1c')]+_0x38e35a[_0x8b43('0x1a')];var _0x4b93e4;if(_0x33d3a5>=_0x9c8504){_0x33d3a5=_0x9c8504;_0x4b93e4=0xc8;}else{_0x4b93e4=0xce;}_0x5d4d53[_0x8b43('0x17')](_0x4b93e4);return _0x5d4d53[_0x8b43('0x1d')](_0x8b43('0x1e'),_0x55a11b+'-'+_0x33d3a5+'/'+_0x9c8504)[_0x8b43('0x1f')](_0x37c328);}return null;};}function patchUpdates(_0x1052f9){return function(_0x1b0de5){try{jsonpatch[_0x8b43('0x20')](_0x1b0de5,_0x1052f9,!![]);}catch(_0x41d6c8){return BPromise[_0x8b43('0x21')](_0x41d6c8);}return _0x1b0de5['save']();};}function saveUpdates(_0x15c65d,_0x5007f9){return function(_0x5d918d){if(_0x5d918d){return _0x5d918d['update'](_0x15c65d)['then'](function(_0x54d3fa){return _0x54d3fa;});}return null;};}function removeEntity(_0x532d86,_0x59023c){return function(_0x4de0bd){if(_0x4de0bd){return _0x4de0bd['destroy']()['then'](function(){_0x532d86['status'](0xcc)[_0x8b43('0x18')]();});}};}function handleEntityNotFound(_0x12002,_0x520f7b){return function(_0x121ee7){if(!_0x121ee7){_0x12002[_0x8b43('0x16')](0x194);}return _0x121ee7;};}function handleError(_0x41dcdf,_0xfc0cc1){_0xfc0cc1=_0xfc0cc1||0x1f4;return function(_0x421077){logger[_0x8b43('0x22')](_0x421077['stack']);if(_0x421077[_0x8b43('0x23')]){delete _0x421077['name'];}_0x41dcdf['status'](_0xfc0cc1)[_0x8b43('0x24')](_0x421077);};}exports['index']=function(_0x240fa9,_0x46aeaa){var _0x426d44={},_0x4a51f9={},_0x41d0c7={'count':0x0,'rows':[]};var _0x5de368=_[_0x8b43('0x25')](db['FreshsalesConfiguration']['rawAttributes'],function(_0xe0680){return{'name':_0xe0680[_0x8b43('0x26')],'type':_0xe0680['type']['key']};});_0x4a51f9[_0x8b43('0x27')]=_[_0x8b43('0x25')](_0x5de368,_0x8b43('0x23'));_0x4a51f9[_0x8b43('0x28')]=_[_0x8b43('0x29')](_0x240fa9[_0x8b43('0x28')]);_0x4a51f9['filters']=_[_0x8b43('0x2a')](_0x4a51f9[_0x8b43('0x27')],_0x4a51f9[_0x8b43('0x28')]);_0x426d44[_0x8b43('0x2b')]=_[_0x8b43('0x2a')](_0x4a51f9[_0x8b43('0x27')],qs[_0x8b43('0x2c')](_0x240fa9[_0x8b43('0x28')][_0x8b43('0x2c')]));_0x426d44['attributes']=_0x426d44[_0x8b43('0x2b')]['length']?_0x426d44[_0x8b43('0x2b')]:_0x4a51f9[_0x8b43('0x27')];if(!_0x240fa9['query']['hasOwnProperty']('nolimit')){_0x426d44[_0x8b43('0x1a')]=qs['limit'](_0x240fa9[_0x8b43('0x28')][_0x8b43('0x1a')]);_0x426d44[_0x8b43('0x1c')]=qs[_0x8b43('0x1c')](_0x240fa9['query']['offset']);}_0x426d44['order']=qs['sort'](_0x240fa9[_0x8b43('0x28')][_0x8b43('0x2d')]);_0x426d44['where']=qs[_0x8b43('0x2e')](_[_0x8b43('0x2f')](_0x240fa9[_0x8b43('0x28')],_0x4a51f9['filters']),_0x5de368);if(_0x240fa9[_0x8b43('0x28')][_0x8b43('0x30')]){_0x426d44['where']=_['merge'](_0x426d44[_0x8b43('0x31')],{'$or':_['map'](_0x5de368,function(_0x1b219b){if(_0x1b219b[_0x8b43('0x32')]!==_0x8b43('0x33')){var _0x5a8768={};_0x5a8768[_0x1b219b[_0x8b43('0x23')]]={'$like':'%'+_0x240fa9['query'][_0x8b43('0x30')]+'%'};return _0x5a8768;}})});}_0x426d44=_[_0x8b43('0x34')]({},_0x426d44,_0x240fa9['options']);var _0x1cd9ae={'where':_0x426d44[_0x8b43('0x31')]};return db[_0x8b43('0x35')][_0x8b43('0x1b')](_0x1cd9ae)['then'](function(_0x509b33){_0x41d0c7['count']=_0x509b33;if(_0x240fa9['query']['includeAll']){_0x426d44[_0x8b43('0x36')]=[{'all':!![]}];}return db[_0x8b43('0x35')][_0x8b43('0x37')](_0x426d44);})['then'](function(_0x16100c){_0x41d0c7[_0x8b43('0x38')]=_0x16100c;return _0x41d0c7;})[_0x8b43('0x39')](respondWithFilteredResult(_0x46aeaa,_0x426d44))[_0x8b43('0x3a')](handleError(_0x46aeaa,null));};exports[_0x8b43('0x3b')]=function(_0x332daf,_0x9e33b5){var _0x2483f3={'raw':![],'where':{'id':_0x332daf[_0x8b43('0x3c')]['id']}},_0x5a7313={};_0x5a7313[_0x8b43('0x27')]=_[_0x8b43('0x29')](db[_0x8b43('0x35')][_0x8b43('0x3d')]);_0x5a7313[_0x8b43('0x28')]=_[_0x8b43('0x29')](_0x332daf[_0x8b43('0x28')]);_0x5a7313[_0x8b43('0x2e')]=_[_0x8b43('0x2a')](_0x5a7313['model'],_0x5a7313[_0x8b43('0x28')]);_0x2483f3[_0x8b43('0x2b')]=_[_0x8b43('0x2a')](_0x5a7313[_0x8b43('0x27')],qs['fields'](_0x332daf[_0x8b43('0x28')][_0x8b43('0x2c')]));_0x2483f3[_0x8b43('0x2b')]=_0x2483f3[_0x8b43('0x2b')][_0x8b43('0x3e')]?_0x2483f3['attributes']:_0x5a7313[_0x8b43('0x27')];if(_0x332daf['query'][_0x8b43('0x3f')]){_0x2483f3[_0x8b43('0x36')]=[{'all':!![]}];}_0x2483f3=_[_0x8b43('0x34')]({},_0x2483f3,_0x332daf[_0x8b43('0x40')]);return db[_0x8b43('0x35')][_0x8b43('0x41')](_0x2483f3)[_0x8b43('0x39')](handleEntityNotFound(_0x9e33b5,null))[_0x8b43('0x39')](respondWithResult(_0x9e33b5,null))[_0x8b43('0x3a')](handleError(_0x9e33b5,null));};exports[_0x8b43('0x42')]=function(_0x50405e,_0x5ba3e7){return db['FreshsalesConfiguration'][_0x8b43('0x42')](_0x50405e['body'],{})[_0x8b43('0x39')](respondWithResult(_0x5ba3e7,0xc9))[_0x8b43('0x3a')](handleError(_0x5ba3e7,null));};exports[_0x8b43('0x43')]=function(_0x40c274,_0x29c68a){if(_0x40c274[_0x8b43('0x44')]['id']){delete _0x40c274[_0x8b43('0x44')]['id'];}return db[_0x8b43('0x35')][_0x8b43('0x41')]({'where':{'id':_0x40c274[_0x8b43('0x3c')]['id']}})[_0x8b43('0x39')](handleEntityNotFound(_0x29c68a,null))[_0x8b43('0x39')](saveUpdates(_0x40c274[_0x8b43('0x44')],null))[_0x8b43('0x39')](respondWithResult(_0x29c68a,null))[_0x8b43('0x3a')](handleError(_0x29c68a,null));};exports[_0x8b43('0x45')]=function(_0x4be87e,_0x2d630e){return db[_0x8b43('0x35')][_0x8b43('0x41')]({'where':{'id':_0x4be87e[_0x8b43('0x3c')]['id']}})[_0x8b43('0x39')](handleEntityNotFound(_0x2d630e,null))[_0x8b43('0x39')](removeEntity(_0x2d630e,null))[_0x8b43('0x3a')](handleError(_0x2d630e,null));};exports[_0x8b43('0x46')]=function(_0x1eaa50,_0x693a01,_0x14b7c6){var _0x1187b4={};var _0x45250b={};var _0x44a574;var _0x3d474f;return db[_0x8b43('0x35')]['findOne']({'where':{'id':_0x1eaa50['params']['id']}})[_0x8b43('0x39')](handleEntityNotFound(_0x693a01,null))['then'](function(_0x48495f){if(_0x48495f){_0x44a574=_0x48495f;_0x45250b['model']=_['keys'](db['FreshsalesField'][_0x8b43('0x3d')]);_0x45250b['query']=_[_0x8b43('0x29')](_0x1eaa50[_0x8b43('0x28')]);_0x45250b['filters']=_[_0x8b43('0x2a')](_0x45250b[_0x8b43('0x27')],_0x45250b[_0x8b43('0x28')]);_0x1187b4[_0x8b43('0x2b')]=_[_0x8b43('0x2a')](_0x45250b[_0x8b43('0x27')],qs[_0x8b43('0x2c')](_0x1eaa50[_0x8b43('0x28')][_0x8b43('0x2c')]));_0x1187b4[_0x8b43('0x2b')]=_0x1187b4[_0x8b43('0x2b')][_0x8b43('0x3e')]?_0x1187b4[_0x8b43('0x2b')]:_0x45250b[_0x8b43('0x27')];_0x1187b4['order']=qs['sort'](_0x1eaa50[_0x8b43('0x28')][_0x8b43('0x2d')]);_0x1187b4['where']=qs[_0x8b43('0x2e')](_[_0x8b43('0x2f')](_0x1eaa50[_0x8b43('0x28')],_0x45250b[_0x8b43('0x2e')]));if(_0x1eaa50[_0x8b43('0x28')][_0x8b43('0x30')]){_0x1187b4[_0x8b43('0x31')]=_[_0x8b43('0x34')](_0x1187b4['where'],{'$or':_['map'](_0x1187b4[_0x8b43('0x2b')],function(_0x566a10){var _0x524938={};_0x524938[_0x566a10]={'$like':'%'+_0x1eaa50[_0x8b43('0x28')]['filter']+'%'};return _0x524938;})});}_0x1187b4=_[_0x8b43('0x34')]({},_0x1187b4,_0x1eaa50['options']);return _0x44a574['getSubjects'](_0x1187b4);}})[_0x8b43('0x39')](function(_0x56e7a8){if(_0x56e7a8){_0x3d474f=_0x56e7a8[_0x8b43('0x3e')];if(!_0x1eaa50[_0x8b43('0x28')][_0x8b43('0x47')](_0x8b43('0x48'))){_0x1187b4[_0x8b43('0x1a')]=qs[_0x8b43('0x1a')](_0x1eaa50[_0x8b43('0x28')][_0x8b43('0x1a')]);_0x1187b4[_0x8b43('0x1c')]=qs[_0x8b43('0x1c')](_0x1eaa50[_0x8b43('0x28')][_0x8b43('0x1c')]);}return _0x44a574[_0x8b43('0x46')](_0x1187b4);}})[_0x8b43('0x39')](function(_0x4b11c3){if(_0x4b11c3){return _0x4b11c3?{'count':_0x3d474f,'rows':_0x4b11c3}:null;}})[_0x8b43('0x39')](respondWithResult(_0x693a01,null))['catch'](handleError(_0x693a01,null));};exports[_0x8b43('0x49')]=function(_0x2327a2,_0x54ab99,_0x334e9b){var _0x4a60ba={};var _0x3260bd={};var _0x24c0c8;var _0x52227e;return db[_0x8b43('0x35')][_0x8b43('0x4a')]({'where':{'id':_0x2327a2[_0x8b43('0x3c')]['id']}})[_0x8b43('0x39')](handleEntityNotFound(_0x54ab99,null))[_0x8b43('0x39')](function(_0x40f5ed){if(_0x40f5ed){_0x24c0c8=_0x40f5ed;_0x3260bd[_0x8b43('0x27')]=_[_0x8b43('0x29')](db['FreshsalesField']['rawAttributes']);_0x3260bd[_0x8b43('0x28')]=_[_0x8b43('0x29')](_0x2327a2[_0x8b43('0x28')]);_0x3260bd[_0x8b43('0x2e')]=_[_0x8b43('0x2a')](_0x3260bd[_0x8b43('0x27')],_0x3260bd['query']);_0x4a60ba[_0x8b43('0x2b')]=_[_0x8b43('0x2a')](_0x3260bd['model'],qs['fields'](_0x2327a2[_0x8b43('0x28')][_0x8b43('0x2c')]));_0x4a60ba[_0x8b43('0x2b')]=_0x4a60ba[_0x8b43('0x2b')][_0x8b43('0x3e')]?_0x4a60ba[_0x8b43('0x2b')]:_0x3260bd[_0x8b43('0x27')];_0x4a60ba['order']=qs[_0x8b43('0x2d')](_0x2327a2[_0x8b43('0x28')][_0x8b43('0x2d')]);_0x4a60ba[_0x8b43('0x31')]=qs['filters'](_[_0x8b43('0x2f')](_0x2327a2[_0x8b43('0x28')],_0x3260bd[_0x8b43('0x2e')]));if(_0x2327a2[_0x8b43('0x28')][_0x8b43('0x30')]){_0x4a60ba[_0x8b43('0x31')]=_[_0x8b43('0x34')](_0x4a60ba[_0x8b43('0x31')],{'$or':_['map'](_0x4a60ba[_0x8b43('0x2b')],function(_0x5eda60){var _0x40a9f6={};_0x40a9f6[_0x5eda60]={'$like':'%'+_0x2327a2[_0x8b43('0x28')][_0x8b43('0x30')]+'%'};return _0x40a9f6;})});}_0x4a60ba=_[_0x8b43('0x34')]({},_0x4a60ba,_0x2327a2[_0x8b43('0x40')]);return _0x24c0c8['getDescriptions'](_0x4a60ba);}})[_0x8b43('0x39')](function(_0x2f4935){if(_0x2f4935){_0x52227e=_0x2f4935[_0x8b43('0x3e')];if(!_0x2327a2['query'][_0x8b43('0x47')](_0x8b43('0x48'))){_0x4a60ba[_0x8b43('0x1a')]=qs['limit'](_0x2327a2['query'][_0x8b43('0x1a')]);_0x4a60ba['offset']=qs[_0x8b43('0x1c')](_0x2327a2['query'][_0x8b43('0x1c')]);}return _0x24c0c8[_0x8b43('0x49')](_0x4a60ba);}})['then'](function(_0x379513){if(_0x379513){return _0x379513?{'count':_0x52227e,'rows':_0x379513}:null;}})[_0x8b43('0x39')](respondWithResult(_0x54ab99,null))[_0x8b43('0x3a')](handleError(_0x54ab99,null));};exports[_0x8b43('0x4b')]=function(_0xf5de2c,_0x1e50ee,_0x5995ec){var _0x6fc359={};var _0x1d1698={};var _0x4792a8;var _0x52fdfe;return db[_0x8b43('0x35')][_0x8b43('0x4a')]({'where':{'id':_0xf5de2c[_0x8b43('0x3c')]['id']}})[_0x8b43('0x39')](handleEntityNotFound(_0x1e50ee,null))[_0x8b43('0x39')](function(_0x476934){if(_0x476934){_0x4792a8=_0x476934;_0x1d1698[_0x8b43('0x27')]=_['keys'](db[_0x8b43('0x4c')]['rawAttributes']);_0x1d1698['query']=_[_0x8b43('0x29')](_0xf5de2c[_0x8b43('0x28')]);_0x1d1698[_0x8b43('0x2e')]=_[_0x8b43('0x2a')](_0x1d1698['model'],_0x1d1698[_0x8b43('0x28')]);_0x6fc359['attributes']=_[_0x8b43('0x2a')](_0x1d1698[_0x8b43('0x27')],qs[_0x8b43('0x2c')](_0xf5de2c['query'][_0x8b43('0x2c')]));_0x6fc359[_0x8b43('0x2b')]=_0x6fc359[_0x8b43('0x2b')][_0x8b43('0x3e')]?_0x6fc359['attributes']:_0x1d1698[_0x8b43('0x27')];_0x6fc359[_0x8b43('0x4d')]=qs['sort'](_0xf5de2c[_0x8b43('0x28')][_0x8b43('0x2d')]);_0x6fc359[_0x8b43('0x31')]=qs[_0x8b43('0x2e')](_[_0x8b43('0x2f')](_0xf5de2c[_0x8b43('0x28')],_0x1d1698[_0x8b43('0x2e')]));if(_0xf5de2c['query'][_0x8b43('0x30')]){_0x6fc359['where']=_['merge'](_0x6fc359[_0x8b43('0x31')],{'$or':_[_0x8b43('0x25')](_0x6fc359[_0x8b43('0x2b')],function(_0x40a24f){var _0x4a3dc2={};_0x4a3dc2[_0x40a24f]={'$like':'%'+_0xf5de2c[_0x8b43('0x28')][_0x8b43('0x30')]+'%'};return _0x4a3dc2;})});}_0x6fc359=_['merge']({},_0x6fc359,_0xf5de2c[_0x8b43('0x40')]);return _0x4792a8[_0x8b43('0x4b')](_0x6fc359);}})[_0x8b43('0x39')](function(_0x3e5882){if(_0x3e5882){_0x52fdfe=_0x3e5882[_0x8b43('0x3e')];if(!_0xf5de2c[_0x8b43('0x28')]['hasOwnProperty'](_0x8b43('0x48'))){_0x6fc359[_0x8b43('0x1a')]=qs['limit'](_0xf5de2c[_0x8b43('0x28')]['limit']);_0x6fc359[_0x8b43('0x1c')]=qs[_0x8b43('0x1c')](_0xf5de2c[_0x8b43('0x28')][_0x8b43('0x1c')]);}return _0x4792a8[_0x8b43('0x4b')](_0x6fc359);}})[_0x8b43('0x39')](function(_0x51a516){if(_0x51a516){return _0x51a516?{'count':_0x52fdfe,'rows':_0x51a516}:null;}})[_0x8b43('0x39')](respondWithResult(_0x1e50ee,null))[_0x8b43('0x3a')](handleError(_0x1e50ee,null));}; \ No newline at end of file +var _0xa252=['FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','getSubjects','FreshsalesField','pick','findOne','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options'];(function(_0x485038,_0x3e26e8){var _0xa87ace=function(_0x1cf247){while(--_0x1cf247){_0x485038['push'](_0x485038['shift']());}};_0xa87ace(++_0x3e26e8);}(_0xa252,0x166));var _0x2a25=function(_0x3ac72d,_0x591c5d){_0x3ac72d=_0x3ac72d-0x0;var _0x19273a=_0xa252[_0x3ac72d];return _0x19273a;};'use strict';var emlformat=require(_0x2a25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a25('0x1'));var jsonpatch=require(_0x2a25('0x2'));var rp=require(_0x2a25('0x3'));var moment=require(_0x2a25('0x4'));var BPromise=require(_0x2a25('0x5'));var Mustache=require(_0x2a25('0x6'));var util=require(_0x2a25('0x7'));var path=require(_0x2a25('0x8'));var sox=require(_0x2a25('0x9'));var csv=require(_0x2a25('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a25('0xb'));var _=require(_0x2a25('0xc'));var squel=require(_0x2a25('0xd'));var crypto=require(_0x2a25('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2a25('0xf'));var toCsv=require(_0x2a25('0xa'));var querystring=require(_0x2a25('0x10'));var Papa=require(_0x2a25('0x11'));var Redis=require(_0x2a25('0x12'));var authService=require(_0x2a25('0x13'));var qs=require(_0x2a25('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a25('0x15'));var logger=require('../../config/logger')(_0x2a25('0x16'));var utils=require(_0x2a25('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2a25('0x18'));var db=require(_0x2a25('0x19'))['db'];function respondWithStatusCode(_0x5cb6f1,_0x185321){_0x185321=_0x185321||0xcc;return function(_0x54fa8c){if(_0x54fa8c){return _0x5cb6f1[_0x2a25('0x1a')](_0x185321);}return _0x5cb6f1[_0x2a25('0x1b')](_0x185321)[_0x2a25('0x1c')]();};}function respondWithResult(_0xb1860f,_0x32579d){_0x32579d=_0x32579d||0xc8;return function(_0x2b1cb9){if(_0x2b1cb9){return _0xb1860f['status'](_0x32579d)['json'](_0x2b1cb9);}};}function respondWithFilteredResult(_0x4f6876,_0x35d654){return function(_0x4b5396){if(_0x4b5396){var _0x2f7164=typeof _0x35d654[_0x2a25('0x1d')]===_0x2a25('0x1e')&&typeof _0x35d654[_0x2a25('0x1f')]===_0x2a25('0x1e');var _0xea3cf0=_0x4b5396[_0x2a25('0x20')];var _0x245796=_0x2f7164?0x0:_0x35d654[_0x2a25('0x1d')];var _0x286928=_0x2f7164?_0x4b5396[_0x2a25('0x20')]:_0x35d654['offset']+_0x35d654[_0x2a25('0x1f')];var _0x1a0527;if(_0x286928>=_0xea3cf0){_0x286928=_0xea3cf0;_0x1a0527=0xc8;}else{_0x1a0527=0xce;}_0x4f6876[_0x2a25('0x1b')](_0x1a0527);return _0x4f6876[_0x2a25('0x21')](_0x2a25('0x22'),_0x245796+'-'+_0x286928+'/'+_0xea3cf0)[_0x2a25('0x23')](_0x4b5396);}return null;};}function patchUpdates(_0x1b39db){return function(_0x5cef14){try{jsonpatch[_0x2a25('0x24')](_0x5cef14,_0x1b39db,!![]);}catch(_0x52bdaa){return BPromise[_0x2a25('0x25')](_0x52bdaa);}return _0x5cef14[_0x2a25('0x26')]();};}function saveUpdates(_0x6f7ce4,_0x36cb51){return function(_0x354a58){if(_0x354a58){return _0x354a58['update'](_0x6f7ce4)[_0x2a25('0x27')](function(_0x11e092){return _0x11e092;});}return null;};}function removeEntity(_0x4db91d,_0x47535b){return function(_0x41ee31){if(_0x41ee31){return _0x41ee31[_0x2a25('0x28')]()[_0x2a25('0x27')](function(){_0x4db91d[_0x2a25('0x1b')](0xcc)[_0x2a25('0x1c')]();});}};}function handleEntityNotFound(_0x49dc52,_0x233ac6){return function(_0xb2d818){if(!_0xb2d818){_0x49dc52['sendStatus'](0x194);}return _0xb2d818;};}function handleError(_0x2722f7,_0x3c0697){_0x3c0697=_0x3c0697||0x1f4;return function(_0x5d5594){logger[_0x2a25('0x29')](_0x5d5594[_0x2a25('0x2a')]);if(_0x5d5594['name']){delete _0x5d5594['name'];}_0x2722f7[_0x2a25('0x1b')](_0x3c0697)[_0x2a25('0x2b')](_0x5d5594);};}exports['index']=function(_0x30f7e2,_0x4dedd7){var _0x35adfd={},_0x2f9565={},_0xdd8860={'count':0x0,'rows':[]};var _0x61becb=_[_0x2a25('0x2c')](db['FreshsalesConfiguration'][_0x2a25('0x2d')],function(_0x36b2bc){return{'name':_0x36b2bc[_0x2a25('0x2e')],'type':_0x36b2bc[_0x2a25('0x2f')][_0x2a25('0x30')]};});_0x2f9565['model']=_['map'](_0x61becb,'name');_0x2f9565[_0x2a25('0x31')]=_[_0x2a25('0x32')](_0x30f7e2[_0x2a25('0x31')]);_0x2f9565[_0x2a25('0x33')]=_[_0x2a25('0x34')](_0x2f9565[_0x2a25('0x35')],_0x2f9565[_0x2a25('0x31')]);_0x35adfd[_0x2a25('0x36')]=_[_0x2a25('0x34')](_0x2f9565['model'],qs[_0x2a25('0x37')](_0x30f7e2['query'][_0x2a25('0x37')]));_0x35adfd[_0x2a25('0x36')]=_0x35adfd[_0x2a25('0x36')][_0x2a25('0x38')]?_0x35adfd[_0x2a25('0x36')]:_0x2f9565['model'];if(!_0x30f7e2[_0x2a25('0x31')][_0x2a25('0x39')](_0x2a25('0x3a'))){_0x35adfd[_0x2a25('0x1f')]=qs[_0x2a25('0x1f')](_0x30f7e2[_0x2a25('0x31')]['limit']);_0x35adfd[_0x2a25('0x1d')]=qs[_0x2a25('0x1d')](_0x30f7e2[_0x2a25('0x31')]['offset']);}_0x35adfd[_0x2a25('0x3b')]=qs[_0x2a25('0x3c')](_0x30f7e2['query'][_0x2a25('0x3c')]);_0x35adfd[_0x2a25('0x3d')]=qs['filters'](_['pick'](_0x30f7e2['query'],_0x2f9565[_0x2a25('0x33')]),_0x61becb);if(_0x30f7e2['query'][_0x2a25('0x3e')]){_0x35adfd[_0x2a25('0x3d')]=_[_0x2a25('0x3f')](_0x35adfd[_0x2a25('0x3d')],{'$or':_[_0x2a25('0x2c')](_0x61becb,function(_0x2de3fa){if(_0x2de3fa[_0x2a25('0x2f')]!==_0x2a25('0x40')){var _0x12c70b={};_0x12c70b[_0x2de3fa[_0x2a25('0x41')]]={'$like':'%'+_0x30f7e2[_0x2a25('0x31')][_0x2a25('0x3e')]+'%'};return _0x12c70b;}})});}_0x35adfd=_[_0x2a25('0x3f')]({},_0x35adfd,_0x30f7e2[_0x2a25('0x42')]);var _0x5d1984={'where':_0x35adfd[_0x2a25('0x3d')]};return db[_0x2a25('0x43')][_0x2a25('0x20')](_0x5d1984)['then'](function(_0x5a7402){_0xdd8860['count']=_0x5a7402;if(_0x30f7e2[_0x2a25('0x31')][_0x2a25('0x44')]){_0x35adfd[_0x2a25('0x45')]=[{'all':!![]}];}return db[_0x2a25('0x43')][_0x2a25('0x46')](_0x35adfd);})[_0x2a25('0x27')](function(_0x3bb0dd){_0xdd8860[_0x2a25('0x47')]=_0x3bb0dd;return _0xdd8860;})[_0x2a25('0x27')](respondWithFilteredResult(_0x4dedd7,_0x35adfd))[_0x2a25('0x48')](handleError(_0x4dedd7,null));};exports[_0x2a25('0x49')]=function(_0x291dbb,_0x58891c){var _0x450eb0={'raw':![],'where':{'id':_0x291dbb['params']['id']}},_0x57143e={};_0x57143e['model']=_[_0x2a25('0x32')](db['FreshsalesConfiguration'][_0x2a25('0x2d')]);_0x57143e['query']=_[_0x2a25('0x32')](_0x291dbb[_0x2a25('0x31')]);_0x57143e['filters']=_[_0x2a25('0x34')](_0x57143e[_0x2a25('0x35')],_0x57143e[_0x2a25('0x31')]);_0x450eb0['attributes']=_[_0x2a25('0x34')](_0x57143e[_0x2a25('0x35')],qs[_0x2a25('0x37')](_0x291dbb[_0x2a25('0x31')][_0x2a25('0x37')]));_0x450eb0[_0x2a25('0x36')]=_0x450eb0[_0x2a25('0x36')][_0x2a25('0x38')]?_0x450eb0['attributes']:_0x57143e[_0x2a25('0x35')];if(_0x291dbb[_0x2a25('0x31')]['includeAll']){_0x450eb0[_0x2a25('0x45')]=[{'all':!![]}];}_0x450eb0=_[_0x2a25('0x3f')]({},_0x450eb0,_0x291dbb['options']);return db[_0x2a25('0x43')][_0x2a25('0x4a')](_0x450eb0)['then'](handleEntityNotFound(_0x58891c,null))[_0x2a25('0x27')](respondWithResult(_0x58891c,null))[_0x2a25('0x48')](handleError(_0x58891c,null));};exports[_0x2a25('0x4b')]=function(_0x95f5bd,_0x56c837){return db[_0x2a25('0x43')][_0x2a25('0x4b')](_0x95f5bd[_0x2a25('0x4c')],{})['then'](respondWithResult(_0x56c837,0xc9))[_0x2a25('0x48')](handleError(_0x56c837,null));};exports[_0x2a25('0x4d')]=function(_0x3c8f9e,_0x131a5e){if(_0x3c8f9e[_0x2a25('0x4c')]['id']){delete _0x3c8f9e['body']['id'];}return db[_0x2a25('0x43')][_0x2a25('0x4a')]({'where':{'id':_0x3c8f9e[_0x2a25('0x4e')]['id']}})[_0x2a25('0x27')](handleEntityNotFound(_0x131a5e,null))['then'](saveUpdates(_0x3c8f9e[_0x2a25('0x4c')],null))[_0x2a25('0x27')](respondWithResult(_0x131a5e,null))[_0x2a25('0x48')](handleError(_0x131a5e,null));};exports[_0x2a25('0x28')]=function(_0xcf2657,_0x329372){return db['FreshsalesConfiguration'][_0x2a25('0x4a')]({'where':{'id':_0xcf2657['params']['id']}})['then'](handleEntityNotFound(_0x329372,null))[_0x2a25('0x27')](removeEntity(_0x329372,null))[_0x2a25('0x48')](handleError(_0x329372,null));};exports[_0x2a25('0x4f')]=function(_0x9c7ff8,_0x36f78e,_0x466cee){var _0x5311f9={};var _0x34f5f9={};var _0x52d994;var _0x1cecbb;return db[_0x2a25('0x43')]['findOne']({'where':{'id':_0x9c7ff8[_0x2a25('0x4e')]['id']}})[_0x2a25('0x27')](handleEntityNotFound(_0x36f78e,null))[_0x2a25('0x27')](function(_0xb3155d){if(_0xb3155d){_0x52d994=_0xb3155d;_0x34f5f9[_0x2a25('0x35')]=_[_0x2a25('0x32')](db[_0x2a25('0x50')][_0x2a25('0x2d')]);_0x34f5f9[_0x2a25('0x31')]=_[_0x2a25('0x32')](_0x9c7ff8[_0x2a25('0x31')]);_0x34f5f9[_0x2a25('0x33')]=_[_0x2a25('0x34')](_0x34f5f9[_0x2a25('0x35')],_0x34f5f9['query']);_0x5311f9[_0x2a25('0x36')]=_[_0x2a25('0x34')](_0x34f5f9[_0x2a25('0x35')],qs[_0x2a25('0x37')](_0x9c7ff8[_0x2a25('0x31')][_0x2a25('0x37')]));_0x5311f9['attributes']=_0x5311f9[_0x2a25('0x36')]['length']?_0x5311f9['attributes']:_0x34f5f9['model'];_0x5311f9[_0x2a25('0x3b')]=qs['sort'](_0x9c7ff8[_0x2a25('0x31')][_0x2a25('0x3c')]);_0x5311f9['where']=qs['filters'](_[_0x2a25('0x51')](_0x9c7ff8['query'],_0x34f5f9['filters']));if(_0x9c7ff8['query']['filter']){_0x5311f9[_0x2a25('0x3d')]=_[_0x2a25('0x3f')](_0x5311f9[_0x2a25('0x3d')],{'$or':_[_0x2a25('0x2c')](_0x5311f9[_0x2a25('0x36')],function(_0x1c1ffe){var _0x657050={};_0x657050[_0x1c1ffe]={'$like':'%'+_0x9c7ff8['query'][_0x2a25('0x3e')]+'%'};return _0x657050;})});}_0x5311f9=_[_0x2a25('0x3f')]({},_0x5311f9,_0x9c7ff8[_0x2a25('0x42')]);return _0x52d994[_0x2a25('0x4f')](_0x5311f9);}})[_0x2a25('0x27')](function(_0xbed4){if(_0xbed4){_0x1cecbb=_0xbed4['length'];if(!_0x9c7ff8[_0x2a25('0x31')][_0x2a25('0x39')]('nolimit')){_0x5311f9['limit']=qs[_0x2a25('0x1f')](_0x9c7ff8[_0x2a25('0x31')][_0x2a25('0x1f')]);_0x5311f9[_0x2a25('0x1d')]=qs[_0x2a25('0x1d')](_0x9c7ff8['query'][_0x2a25('0x1d')]);}return _0x52d994[_0x2a25('0x4f')](_0x5311f9);}})[_0x2a25('0x27')](function(_0x220ba6){if(_0x220ba6){return _0x220ba6?{'count':_0x1cecbb,'rows':_0x220ba6}:null;}})[_0x2a25('0x27')](respondWithResult(_0x36f78e,null))[_0x2a25('0x48')](handleError(_0x36f78e,null));};exports['getDescriptions']=function(_0x44b2a,_0x13fb0e,_0x278ef9){var _0x3782e8={};var _0x205324={};var _0x144fbc;var _0x2cef9c;return db['FreshsalesConfiguration'][_0x2a25('0x52')]({'where':{'id':_0x44b2a[_0x2a25('0x4e')]['id']}})[_0x2a25('0x27')](handleEntityNotFound(_0x13fb0e,null))[_0x2a25('0x27')](function(_0x2d1f09){if(_0x2d1f09){_0x144fbc=_0x2d1f09;_0x205324['model']=_[_0x2a25('0x32')](db[_0x2a25('0x50')][_0x2a25('0x2d')]);_0x205324['query']=_['keys'](_0x44b2a[_0x2a25('0x31')]);_0x205324[_0x2a25('0x33')]=_[_0x2a25('0x34')](_0x205324[_0x2a25('0x35')],_0x205324[_0x2a25('0x31')]);_0x3782e8['attributes']=_[_0x2a25('0x34')](_0x205324['model'],qs[_0x2a25('0x37')](_0x44b2a[_0x2a25('0x31')][_0x2a25('0x37')]));_0x3782e8[_0x2a25('0x36')]=_0x3782e8[_0x2a25('0x36')]['length']?_0x3782e8[_0x2a25('0x36')]:_0x205324[_0x2a25('0x35')];_0x3782e8['order']=qs['sort'](_0x44b2a[_0x2a25('0x31')][_0x2a25('0x3c')]);_0x3782e8[_0x2a25('0x3d')]=qs[_0x2a25('0x33')](_[_0x2a25('0x51')](_0x44b2a[_0x2a25('0x31')],_0x205324['filters']));if(_0x44b2a[_0x2a25('0x31')][_0x2a25('0x3e')]){_0x3782e8[_0x2a25('0x3d')]=_['merge'](_0x3782e8[_0x2a25('0x3d')],{'$or':_[_0x2a25('0x2c')](_0x3782e8[_0x2a25('0x36')],function(_0x1f2840){var _0x34b5f7={};_0x34b5f7[_0x1f2840]={'$like':'%'+_0x44b2a[_0x2a25('0x31')][_0x2a25('0x3e')]+'%'};return _0x34b5f7;})});}_0x3782e8=_['merge']({},_0x3782e8,_0x44b2a[_0x2a25('0x42')]);return _0x144fbc[_0x2a25('0x53')](_0x3782e8);}})[_0x2a25('0x27')](function(_0x11093c){if(_0x11093c){_0x2cef9c=_0x11093c[_0x2a25('0x38')];if(!_0x44b2a[_0x2a25('0x31')][_0x2a25('0x39')](_0x2a25('0x3a'))){_0x3782e8[_0x2a25('0x1f')]=qs[_0x2a25('0x1f')](_0x44b2a[_0x2a25('0x31')]['limit']);_0x3782e8[_0x2a25('0x1d')]=qs[_0x2a25('0x1d')](_0x44b2a['query'][_0x2a25('0x1d')]);}return _0x144fbc['getDescriptions'](_0x3782e8);}})[_0x2a25('0x27')](function(_0x1c486a){if(_0x1c486a){return _0x1c486a?{'count':_0x2cef9c,'rows':_0x1c486a}:null;}})[_0x2a25('0x27')](respondWithResult(_0x13fb0e,null))['catch'](handleError(_0x13fb0e,null));};exports[_0x2a25('0x54')]=function(_0x56b68c,_0x473dbf,_0x4872ae){var _0x5e750c={};var _0x4e7c8a={};var _0x184b63;var _0x9eeea5;return db[_0x2a25('0x43')]['findOne']({'where':{'id':_0x56b68c['params']['id']}})[_0x2a25('0x27')](handleEntityNotFound(_0x473dbf,null))['then'](function(_0x701939){if(_0x701939){_0x184b63=_0x701939;_0x4e7c8a[_0x2a25('0x35')]=_[_0x2a25('0x32')](db[_0x2a25('0x50')]['rawAttributes']);_0x4e7c8a['query']=_[_0x2a25('0x32')](_0x56b68c['query']);_0x4e7c8a[_0x2a25('0x33')]=_[_0x2a25('0x34')](_0x4e7c8a[_0x2a25('0x35')],_0x4e7c8a[_0x2a25('0x31')]);_0x5e750c[_0x2a25('0x36')]=_[_0x2a25('0x34')](_0x4e7c8a['model'],qs[_0x2a25('0x37')](_0x56b68c[_0x2a25('0x31')][_0x2a25('0x37')]));_0x5e750c['attributes']=_0x5e750c['attributes'][_0x2a25('0x38')]?_0x5e750c[_0x2a25('0x36')]:_0x4e7c8a[_0x2a25('0x35')];_0x5e750c[_0x2a25('0x3b')]=qs['sort'](_0x56b68c[_0x2a25('0x31')]['sort']);_0x5e750c[_0x2a25('0x3d')]=qs[_0x2a25('0x33')](_[_0x2a25('0x51')](_0x56b68c[_0x2a25('0x31')],_0x4e7c8a[_0x2a25('0x33')]));if(_0x56b68c[_0x2a25('0x31')]['filter']){_0x5e750c[_0x2a25('0x3d')]=_['merge'](_0x5e750c[_0x2a25('0x3d')],{'$or':_['map'](_0x5e750c[_0x2a25('0x36')],function(_0x260f24){var _0x2a6b25={};_0x2a6b25[_0x260f24]={'$like':'%'+_0x56b68c[_0x2a25('0x31')]['filter']+'%'};return _0x2a6b25;})});}_0x5e750c=_[_0x2a25('0x3f')]({},_0x5e750c,_0x56b68c[_0x2a25('0x42')]);return _0x184b63['getFields'](_0x5e750c);}})[_0x2a25('0x27')](function(_0x4cf030){if(_0x4cf030){_0x9eeea5=_0x4cf030['length'];if(!_0x56b68c[_0x2a25('0x31')]['hasOwnProperty'](_0x2a25('0x3a'))){_0x5e750c['limit']=qs[_0x2a25('0x1f')](_0x56b68c[_0x2a25('0x31')][_0x2a25('0x1f')]);_0x5e750c['offset']=qs[_0x2a25('0x1d')](_0x56b68c['query'][_0x2a25('0x1d')]);}return _0x184b63[_0x2a25('0x54')](_0x5e750c);}})['then'](function(_0x464c77){if(_0x464c77){return _0x464c77?{'count':_0x9eeea5,'rows':_0x464c77}:null;}})[_0x2a25('0x27')](respondWithResult(_0x473dbf,null))[_0x2a25('0x48')](handleError(_0x473dbf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 4fa6a5a..6dd67c2 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 _0xf717=['request-promise','path','rimraf','define','int_freshsales_configurations','lodash','util','moment','bluebird'];(function(_0x47da4c,_0x45cd29){var _0x3c09c4=function(_0x3253c2){while(--_0x3253c2){_0x47da4c['push'](_0x47da4c['shift']());}};_0x3c09c4(++_0x45cd29);}(_0xf717,0x19a));var _0x7f71=function(_0x2d1d38,_0x2551e6){_0x2d1d38=_0x2d1d38-0x0;var _0x1e443c=_0xf717[_0x2d1d38];return _0x1e443c;};'use strict';var _=require(_0x7f71('0x0'));var util=require(_0x7f71('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7f71('0x2'));var BPromise=require(_0x7f71('0x3'));var rp=require(_0x7f71('0x4'));var fs=require('fs');var path=require(_0x7f71('0x5'));var rimraf=require(_0x7f71('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x47cd08,_0xc8287){return _0x47cd08[_0x7f71('0x7')]('FreshsalesConfiguration',attributes,{'tableName':_0x7f71('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9cf=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x21595e,_0x554025){var _0x13a181=function(_0x4e1603){while(--_0x4e1603){_0x21595e['push'](_0x21595e['shift']());}};_0x13a181(++_0x554025);}(_0xa9cf,0xad));var _0xfa9c=function(_0x3d76c7,_0x166fc4){_0x3d76c7=_0x3d76c7-0x0;var _0x43264b=_0xa9cf[_0x3d76c7];return _0x43264b;};'use strict';var _=require(_0xfa9c('0x0'));var util=require(_0xfa9c('0x1'));var logger=require(_0xfa9c('0x2'))('api');var moment=require(_0xfa9c('0x3'));var BPromise=require(_0xfa9c('0x4'));var rp=require(_0xfa9c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa9c('0x6'));var config=require(_0xfa9c('0x7'));var attributes=require(_0xfa9c('0x8'));module[_0xfa9c('0x9')]=function(_0x422106,_0x32d869){return _0x422106[_0xfa9c('0xa')](_0xfa9c('0xb'),attributes,{'tableName':_0xfa9c('0xc'),'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 96ec2d3..1e23133 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 _0x3170=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x3170,0x7d));var _0x0317=function(_0x44a101,_0x3729bc){_0x44a101=_0x44a101-0x0;var _0x351900=_0x3170[_0x44a101];return _0x351900;};'use strict';var _=require(_0x0317('0x0'));var util=require(_0x0317('0x1'));var moment=require(_0x0317('0x2'));var BPromise=require(_0x0317('0x3'));var rs=require(_0x0317('0x4'));var fs=require('fs');var Redis=require(_0x0317('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0317('0x6'));var logger=require(_0x0317('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c907d,_0x5e159c,_0x222db8){return new BPromise(function(_0x3e510c,_0x322a61){return client[_0x0317('0x8')](_0x2c907d,_0x222db8)[_0x0317('0x9')](function(_0x405bb9){logger[_0x0317('0xa')](_0x0317('0xb'),_0x5e159c,'request\x20sent');logger['debug'](_0x0317('0xc'),_0x5e159c,_0x0317('0xd'),JSON[_0x0317('0xe')](_0x405bb9));if(_0x405bb9[_0x0317('0xf')]){if(_0x405bb9[_0x0317('0xf')][_0x0317('0x10')]===0x1f4){logger[_0x0317('0xf')](_0x0317('0xb'),_0x5e159c,_0x405bb9['error'][_0x0317('0x11')]);return _0x322a61(_0x405bb9[_0x0317('0xf')][_0x0317('0x11')]);}logger['error'](_0x0317('0xb'),_0x5e159c,_0x405bb9[_0x0317('0xf')][_0x0317('0x11')]);return _0x3e510c(_0x405bb9[_0x0317('0xf')][_0x0317('0x11')]);}else{logger[_0x0317('0xa')](_0x0317('0xb'),_0x5e159c,_0x0317('0xd'));_0x3e510c(_0x405bb9['result'][_0x0317('0x11')]);}})[_0x0317('0x12')](function(_0x1a7f1c){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x5e159c,_0x1a7f1c);_0x322a61(_0x1a7f1c);});});} \ No newline at end of file +var _0xf2a7=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x2e30d3,_0x6530f7){var _0xb9dbf2=function(_0x7187f0){while(--_0x7187f0){_0x2e30d3['push'](_0x2e30d3['shift']());}};_0xb9dbf2(++_0x6530f7);}(_0xf2a7,0x167));var _0x7f2a=function(_0x10c35d,_0x3bdb63){_0x10c35d=_0x10c35d-0x0;var _0x3807f0=_0xf2a7[_0x10c35d];return _0x3807f0;};'use strict';var _=require(_0x7f2a('0x0'));var util=require(_0x7f2a('0x1'));var moment=require(_0x7f2a('0x2'));var BPromise=require(_0x7f2a('0x3'));var rs=require(_0x7f2a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7f2a('0x5'));var logger=require(_0x7f2a('0x6'))(_0x7f2a('0x7'));var config=require(_0x7f2a('0x8'));var jayson=require(_0x7f2a('0x9'));var client=jayson[_0x7f2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x113056,_0x57f31d,_0x472353){return new BPromise(function(_0x38a624,_0x1dcc80){return client[_0x7f2a('0xb')](_0x113056,_0x472353)[_0x7f2a('0xc')](function(_0x256d4c){logger[_0x7f2a('0xd')](_0x7f2a('0xe'),_0x57f31d,_0x7f2a('0xf'));logger[_0x7f2a('0x10')](_0x7f2a('0x11'),_0x57f31d,_0x7f2a('0xf'),JSON[_0x7f2a('0x12')](_0x256d4c));if(_0x256d4c['error']){if(_0x256d4c[_0x7f2a('0x13')][_0x7f2a('0x14')]===0x1f4){logger[_0x7f2a('0x13')](_0x7f2a('0xe'),_0x57f31d,_0x256d4c['error'][_0x7f2a('0x15')]);return _0x1dcc80(_0x256d4c['error'][_0x7f2a('0x15')]);}logger['error'](_0x7f2a('0xe'),_0x57f31d,_0x256d4c[_0x7f2a('0x13')]['message']);return _0x38a624(_0x256d4c['error']['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x57f31d,_0x7f2a('0xf'));_0x38a624(_0x256d4c[_0x7f2a('0x16')][_0x7f2a('0x15')]);}})[_0x7f2a('0x17')](function(_0x1f583b){logger['error'](_0x7f2a('0xe'),_0x57f31d,_0x1f583b);_0x1dcc80(_0x1f583b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 770cddb..a83f10c 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 _0xb63f=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','create','put','update','delete','destroy'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xb63f,0xa3));var _0xfb63=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb63f[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfb63('0x0'));var timeout=require(_0xfb63('0x1'));var express=require(_0xfb63('0x2'));var router=express[_0xfb63('0x3')]();var fs_extra=require(_0xfb63('0x4'));var auth=require(_0xfb63('0x5'));var interaction=require(_0xfb63('0x6'));var config=require(_0xfb63('0x7'));var controller=require(_0xfb63('0x8'));router['get']('/',auth[_0xfb63('0x9')](),controller['index']);router[_0xfb63('0xa')](_0xfb63('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xfb63('0x9')](),controller[_0xfb63('0xc')]);router[_0xfb63('0xd')]('/:id',auth[_0xfb63('0x9')](),controller[_0xfb63('0xe')]);router[_0xfb63('0xf')](_0xfb63('0xb'),auth[_0xfb63('0x9')](),controller[_0xfb63('0x10')]);module[_0xfb63('0x11')]=router; \ No newline at end of file +var _0xd957=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer','util','connect-timeout'];(function(_0x3f2b1e,_0x7a1f07){var _0x555900=function(_0x484c21){while(--_0x484c21){_0x3f2b1e['push'](_0x3f2b1e['shift']());}};_0x555900(++_0x7a1f07);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var path=require('path');var timeout=require(_0x7d95('0x2'));var express=require(_0x7d95('0x3'));var router=express['Router']();var fs_extra=require(_0x7d95('0x4'));var auth=require(_0x7d95('0x5'));var interaction=require(_0x7d95('0x6'));var config=require(_0x7d95('0x7'));var controller=require(_0x7d95('0x8'));router[_0x7d95('0x9')]('/',auth[_0x7d95('0xa')](),controller['index']);router[_0x7d95('0x9')](_0x7d95('0xb'),auth['isAuthenticated'](),controller[_0x7d95('0xc')]);router[_0x7d95('0xd')]('/',auth[_0x7d95('0xa')](),controller[_0x7d95('0xe')]);router[_0x7d95('0xf')]('/:id',auth[_0x7d95('0xa')](),controller[_0x7d95('0x10')]);router[_0x7d95('0x11')](_0x7d95('0xb'),auth[_0x7d95('0xa')](),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 cb79d26..ea1b84f 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 _0x12e3=['sequelize','ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0x12e3,0x1a7));var _0x312e=function(_0x58c3d7,_0x19d65c){_0x58c3d7=_0x58c3d7-0x0;var _0x3d6c6d=_0x12e3[_0x58c3d7];return _0x3d6c6d;};'use strict';var Sequelize=require(_0x312e('0x0'));module['exports']={'type':{'type':Sequelize[_0x312e('0x1')](_0x312e('0x2'),'variable',_0x312e('0x3'),_0x312e('0x4'),_0x312e('0x5')),'defaultValue':_0x312e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x312e('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x312e('0x2'),_0x312e('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x312e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x312e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x312e('0x6')]}}; \ No newline at end of file +var _0xab68=['string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x359a84,_0x3e9211){var _0x4f80eb=function(_0x1dacf8){while(--_0x1dacf8){_0x359a84['push'](_0x359a84['shift']());}};_0x4f80eb(++_0x3e9211);}(_0xab68,0x134));var _0x8ab6=function(_0x40a921,_0x1bad64){_0x40a921=_0x40a921-0x0;var _0x2981d7=_0xab68[_0x40a921];return _0x2981d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x8ab6('0x0'),_0x8ab6('0x1'),_0x8ab6('0x2'),_0x8ab6('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x8ab6('0x4')]},'key':{'type':Sequelize[_0x8ab6('0x4')]},'keyType':{'type':Sequelize[_0x8ab6('0x5')](_0x8ab6('0x0'),_0x8ab6('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x8ab6('0x4')]},'idField':{'type':Sequelize[_0x8ab6('0x4')]},'nameField':{'type':Sequelize[_0x8ab6('0x4')]},'customField':{'type':Sequelize[_0x8ab6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8ab6('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index eca8af3..c001835 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 _0x0b4a=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','FreshsalesField','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment'];(function(_0xfbaf14,_0x5f4cc1){var _0x5e00ca=function(_0x587485){while(--_0x587485){_0xfbaf14['push'](_0xfbaf14['shift']());}};_0x5e00ca(++_0x5f4cc1);}(_0x0b4a,0x124));var _0xa0b4=function(_0x29a200,_0x539ea5){_0x29a200=_0x29a200-0x0;var _0x44f2ed=_0x0b4a[_0x29a200];return _0x44f2ed;};'use strict';var emlformat=require(_0xa0b4('0x0'));var rimraf=require(_0xa0b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0b4('0x2'));var rp=require('request-promise');var moment=require(_0xa0b4('0x3'));var BPromise=require(_0xa0b4('0x4'));var Mustache=require(_0xa0b4('0x5'));var util=require(_0xa0b4('0x6'));var path=require(_0xa0b4('0x7'));var sox=require(_0xa0b4('0x8'));var csv=require('to-csv');var ejs=require(_0xa0b4('0x9'));var fs=require('fs');var fs_extra=require(_0xa0b4('0xa'));var _=require(_0xa0b4('0xb'));var squel=require('squel');var crypto=require(_0xa0b4('0xc'));var jsforce=require(_0xa0b4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa0b4('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa0b4('0xf'));var authService=require(_0xa0b4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa0b4('0x11'));var hardwareService=require(_0xa0b4('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa0b4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa0b4('0x14'));var db=require(_0xa0b4('0x15'))['db'];function respondWithStatusCode(_0x5d4e87,_0x4540af){_0x4540af=_0x4540af||0xcc;return function(_0x41ec3e){if(_0x41ec3e){return _0x5d4e87[_0xa0b4('0x16')](_0x4540af);}return _0x5d4e87[_0xa0b4('0x17')](_0x4540af)[_0xa0b4('0x18')]();};}function respondWithResult(_0x172c1b,_0x2b3daa){_0x2b3daa=_0x2b3daa||0xc8;return function(_0x7e4f62){if(_0x7e4f62){return _0x172c1b[_0xa0b4('0x17')](_0x2b3daa)[_0xa0b4('0x19')](_0x7e4f62);}};}function respondWithFilteredResult(_0xde2f57,_0x5b93b0){return function(_0x32d195){if(_0x32d195){var _0x2607fc=typeof _0x5b93b0[_0xa0b4('0x1a')]===_0xa0b4('0x1b')&&typeof _0x5b93b0[_0xa0b4('0x1c')]==='undefined';var _0x48b6ba=_0x32d195['count'];var _0x61638c=_0x2607fc?0x0:_0x5b93b0['offset'];var _0x2c938b=_0x2607fc?_0x32d195[_0xa0b4('0x1d')]:_0x5b93b0[_0xa0b4('0x1a')]+_0x5b93b0[_0xa0b4('0x1c')];var _0x28f4f0;if(_0x2c938b>=_0x48b6ba){_0x2c938b=_0x48b6ba;_0x28f4f0=0xc8;}else{_0x28f4f0=0xce;}_0xde2f57[_0xa0b4('0x17')](_0x28f4f0);return _0xde2f57[_0xa0b4('0x1e')](_0xa0b4('0x1f'),_0x61638c+'-'+_0x2c938b+'/'+_0x48b6ba)[_0xa0b4('0x19')](_0x32d195);}return null;};}function patchUpdates(_0x1711fc){return function(_0x2ce71a){try{jsonpatch[_0xa0b4('0x20')](_0x2ce71a,_0x1711fc,!![]);}catch(_0xe76d40){return BPromise[_0xa0b4('0x21')](_0xe76d40);}return _0x2ce71a[_0xa0b4('0x22')]();};}function saveUpdates(_0x417b1b,_0x2ffcae){return function(_0x497369){if(_0x497369){return _0x497369[_0xa0b4('0x23')](_0x417b1b)[_0xa0b4('0x24')](function(_0x372416){return _0x372416;});}return null;};}function removeEntity(_0x4694d0,_0x20a15a){return function(_0x55fcde){if(_0x55fcde){return _0x55fcde['destroy']()[_0xa0b4('0x24')](function(){_0x4694d0['status'](0xcc)[_0xa0b4('0x18')]();});}};}function handleEntityNotFound(_0xdc4eb9,_0x3a5442){return function(_0x158f86){if(!_0x158f86){_0xdc4eb9[_0xa0b4('0x16')](0x194);}return _0x158f86;};}function handleError(_0x3832c5,_0x21cfc2){_0x21cfc2=_0x21cfc2||0x1f4;return function(_0x5ec8de){logger[_0xa0b4('0x25')](_0x5ec8de[_0xa0b4('0x26')]);if(_0x5ec8de[_0xa0b4('0x27')]){delete _0x5ec8de[_0xa0b4('0x27')];}_0x3832c5[_0xa0b4('0x17')](_0x21cfc2)['send'](_0x5ec8de);};}exports[_0xa0b4('0x28')]=function(_0x618785,_0x4f729b){var _0x5a594e={},_0x5dc922={},_0x50c997={'count':0x0,'rows':[]};var _0xe6ac6a=_[_0xa0b4('0x29')](db['FreshsalesField']['rawAttributes'],function(_0x1b36ed){return{'name':_0x1b36ed['fieldName'],'type':_0x1b36ed[_0xa0b4('0x2a')][_0xa0b4('0x2b')]};});_0x5dc922[_0xa0b4('0x2c')]=_['map'](_0xe6ac6a,'name');_0x5dc922[_0xa0b4('0x2d')]=_[_0xa0b4('0x2e')](_0x618785['query']);_0x5dc922[_0xa0b4('0x2f')]=_['intersection'](_0x5dc922[_0xa0b4('0x2c')],_0x5dc922[_0xa0b4('0x2d')]);_0x5a594e[_0xa0b4('0x30')]=_['intersection'](_0x5dc922[_0xa0b4('0x2c')],qs[_0xa0b4('0x31')](_0x618785[_0xa0b4('0x2d')][_0xa0b4('0x31')]));_0x5a594e[_0xa0b4('0x30')]=_0x5a594e[_0xa0b4('0x30')][_0xa0b4('0x32')]?_0x5a594e['attributes']:_0x5dc922[_0xa0b4('0x2c')];if(!_0x618785['query'][_0xa0b4('0x33')](_0xa0b4('0x34'))){_0x5a594e['limit']=qs[_0xa0b4('0x1c')](_0x618785['query']['limit']);_0x5a594e[_0xa0b4('0x1a')]=qs[_0xa0b4('0x1a')](_0x618785['query']['offset']);}_0x5a594e['order']=qs['sort'](_0x618785[_0xa0b4('0x2d')][_0xa0b4('0x35')]);_0x5a594e[_0xa0b4('0x36')]=qs['filters'](_[_0xa0b4('0x37')](_0x618785[_0xa0b4('0x2d')],_0x5dc922[_0xa0b4('0x2f')]),_0xe6ac6a);if(_0x618785['query']['filter']){_0x5a594e[_0xa0b4('0x36')]=_[_0xa0b4('0x38')](_0x5a594e[_0xa0b4('0x36')],{'$or':_[_0xa0b4('0x29')](_0xe6ac6a,function(_0x3577d6){if(_0x3577d6['type']!==_0xa0b4('0x39')){var _0x475e81={};_0x475e81[_0x3577d6['name']]={'$like':'%'+_0x618785[_0xa0b4('0x2d')][_0xa0b4('0x3a')]+'%'};return _0x475e81;}})});}_0x5a594e=_['merge']({},_0x5a594e,_0x618785[_0xa0b4('0x3b')]);var _0x34cae6={'where':_0x5a594e[_0xa0b4('0x36')]};return db['FreshsalesField']['count'](_0x34cae6)['then'](function(_0x190bd2){_0x50c997['count']=_0x190bd2;if(_0x618785[_0xa0b4('0x2d')]['includeAll']){_0x5a594e[_0xa0b4('0x3c')]=[{'all':!![]}];}return db[_0xa0b4('0x3d')][_0xa0b4('0x3e')](_0x5a594e);})[_0xa0b4('0x24')](function(_0x2c077b){_0x50c997[_0xa0b4('0x3f')]=_0x2c077b;return _0x50c997;})[_0xa0b4('0x24')](respondWithFilteredResult(_0x4f729b,_0x5a594e))[_0xa0b4('0x40')](handleError(_0x4f729b,null));};exports[_0xa0b4('0x41')]=function(_0xe2e0e4,_0x1c08e2){var _0x4a9c64={'raw':!![],'where':{'id':_0xe2e0e4[_0xa0b4('0x42')]['id']}},_0x48b5c9={};_0x48b5c9[_0xa0b4('0x2c')]=_['keys'](db[_0xa0b4('0x3d')][_0xa0b4('0x43')]);_0x48b5c9[_0xa0b4('0x2d')]=_[_0xa0b4('0x2e')](_0xe2e0e4[_0xa0b4('0x2d')]);_0x48b5c9['filters']=_[_0xa0b4('0x44')](_0x48b5c9[_0xa0b4('0x2c')],_0x48b5c9[_0xa0b4('0x2d')]);_0x4a9c64['attributes']=_[_0xa0b4('0x44')](_0x48b5c9[_0xa0b4('0x2c')],qs['fields'](_0xe2e0e4['query'][_0xa0b4('0x31')]));_0x4a9c64[_0xa0b4('0x30')]=_0x4a9c64[_0xa0b4('0x30')]['length']?_0x4a9c64[_0xa0b4('0x30')]:_0x48b5c9['model'];if(_0xe2e0e4[_0xa0b4('0x2d')][_0xa0b4('0x45')]){_0x4a9c64['include']=[{'all':!![]}];}_0x4a9c64=_[_0xa0b4('0x38')]({},_0x4a9c64,_0xe2e0e4[_0xa0b4('0x3b')]);return db[_0xa0b4('0x3d')][_0xa0b4('0x46')](_0x4a9c64)['then'](handleEntityNotFound(_0x1c08e2,null))[_0xa0b4('0x24')](respondWithResult(_0x1c08e2,null))['catch'](handleError(_0x1c08e2,null));};exports[_0xa0b4('0x47')]=function(_0xd9a607,_0xd4adb){return db[_0xa0b4('0x3d')][_0xa0b4('0x47')](_0xd9a607['body'],{})['then'](respondWithResult(_0xd4adb,0xc9))[_0xa0b4('0x40')](handleError(_0xd4adb,null));};exports['update']=function(_0x576fdf,_0x1845c2){if(_0x576fdf['body']['id']){delete _0x576fdf[_0xa0b4('0x48')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x576fdf[_0xa0b4('0x42')]['id']}})[_0xa0b4('0x24')](handleEntityNotFound(_0x1845c2,null))[_0xa0b4('0x24')](saveUpdates(_0x576fdf[_0xa0b4('0x48')],null))[_0xa0b4('0x24')](respondWithResult(_0x1845c2,null))[_0xa0b4('0x40')](handleError(_0x1845c2,null));};exports[_0xa0b4('0x49')]=function(_0x465d7b,_0x4c9019){return db[_0xa0b4('0x3d')][_0xa0b4('0x46')]({'where':{'id':_0x465d7b[_0xa0b4('0x42')]['id']}})[_0xa0b4('0x24')](handleEntityNotFound(_0x4c9019,null))[_0xa0b4('0x24')](removeEntity(_0x4c9019,null))[_0xa0b4('0x40')](handleError(_0x4c9019,null));}; \ No newline at end of file +var _0x3445=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','fieldName','type','model','query','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','rawAttributes','keys','length','includeAll','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x4c20b6,_0x2015d6){var _0x1c09bd=function(_0x5d3c78){while(--_0x5d3c78){_0x4c20b6['push'](_0x4c20b6['shift']());}};_0x1c09bd(++_0x2015d6);}(_0x3445,0x19b));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5344('0x0'));var rimraf=require(_0x5344('0x1'));var zipdir=require(_0x5344('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5344('0x3'));var moment=require(_0x5344('0x4'));var BPromise=require(_0x5344('0x5'));var Mustache=require('mustache');var util=require(_0x5344('0x6'));var path=require(_0x5344('0x7'));var sox=require(_0x5344('0x8'));var csv=require(_0x5344('0x9'));var ejs=require(_0x5344('0xa'));var fs=require('fs');var fs_extra=require(_0x5344('0xb'));var _=require(_0x5344('0xc'));var squel=require(_0x5344('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5344('0xe'));var toCsv=require(_0x5344('0x9'));var querystring=require(_0x5344('0xf'));var Papa=require(_0x5344('0x10'));var Redis=require(_0x5344('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5344('0x12'));var as=require(_0x5344('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5344('0x14'))('api');var utils=require(_0x5344('0x15'));var config=require(_0x5344('0x16'));var licenseUtil=require(_0x5344('0x17'));var db=require(_0x5344('0x18'))['db'];function respondWithStatusCode(_0x4e5a3e,_0x1758bc){_0x1758bc=_0x1758bc||0xcc;return function(_0x584f7f){if(_0x584f7f){return _0x4e5a3e[_0x5344('0x19')](_0x1758bc);}return _0x4e5a3e['status'](_0x1758bc)[_0x5344('0x1a')]();};}function respondWithResult(_0x381a1,_0x552727){_0x552727=_0x552727||0xc8;return function(_0x56302a){if(_0x56302a){return _0x381a1[_0x5344('0x1b')](_0x552727)[_0x5344('0x1c')](_0x56302a);}};}function respondWithFilteredResult(_0x1358bd,_0x351458){return function(_0x5b576d){if(_0x5b576d){var _0x442cad=typeof _0x351458[_0x5344('0x1d')]==='undefined'&&typeof _0x351458['limit']===_0x5344('0x1e');var _0x48a71a=_0x5b576d[_0x5344('0x1f')];var _0x5053d0=_0x442cad?0x0:_0x351458[_0x5344('0x1d')];var _0x3b0aa4=_0x442cad?_0x5b576d[_0x5344('0x1f')]:_0x351458['offset']+_0x351458[_0x5344('0x20')];var _0x24e988;if(_0x3b0aa4>=_0x48a71a){_0x3b0aa4=_0x48a71a;_0x24e988=0xc8;}else{_0x24e988=0xce;}_0x1358bd[_0x5344('0x1b')](_0x24e988);return _0x1358bd[_0x5344('0x21')](_0x5344('0x22'),_0x5053d0+'-'+_0x3b0aa4+'/'+_0x48a71a)[_0x5344('0x1c')](_0x5b576d);}return null;};}function patchUpdates(_0x1fa7be){return function(_0x2eaf08){try{jsonpatch[_0x5344('0x23')](_0x2eaf08,_0x1fa7be,!![]);}catch(_0x48a136){return BPromise[_0x5344('0x24')](_0x48a136);}return _0x2eaf08['save']();};}function saveUpdates(_0x46e63f,_0x2aeaa2){return function(_0x53e243){if(_0x53e243){return _0x53e243[_0x5344('0x25')](_0x46e63f)[_0x5344('0x26')](function(_0xc2bd0a){return _0xc2bd0a;});}return null;};}function removeEntity(_0x48600f,_0x4ac906){return function(_0x51d17a){if(_0x51d17a){return _0x51d17a[_0x5344('0x27')]()[_0x5344('0x26')](function(){_0x48600f[_0x5344('0x1b')](0xcc)[_0x5344('0x1a')]();});}};}function handleEntityNotFound(_0x1e4608,_0x4f06ec){return function(_0x44d585){if(!_0x44d585){_0x1e4608[_0x5344('0x19')](0x194);}return _0x44d585;};}function handleError(_0x316290,_0x37681f){_0x37681f=_0x37681f||0x1f4;return function(_0x328e0c){logger[_0x5344('0x28')](_0x328e0c[_0x5344('0x29')]);if(_0x328e0c[_0x5344('0x2a')]){delete _0x328e0c[_0x5344('0x2a')];}_0x316290['status'](_0x37681f)[_0x5344('0x2b')](_0x328e0c);};}exports[_0x5344('0x2c')]=function(_0x2ab85d,_0x23cf73){var _0x5c949e={},_0x28e5ac={},_0x178268={'count':0x0,'rows':[]};var _0x4cf9c6=_[_0x5344('0x2d')](db[_0x5344('0x2e')]['rawAttributes'],function(_0x230b54){return{'name':_0x230b54[_0x5344('0x2f')],'type':_0x230b54[_0x5344('0x30')]['key']};});_0x28e5ac[_0x5344('0x31')]=_['map'](_0x4cf9c6,_0x5344('0x2a'));_0x28e5ac['query']=_['keys'](_0x2ab85d[_0x5344('0x32')]);_0x28e5ac['filters']=_[_0x5344('0x33')](_0x28e5ac[_0x5344('0x31')],_0x28e5ac[_0x5344('0x32')]);_0x5c949e['attributes']=_[_0x5344('0x33')](_0x28e5ac[_0x5344('0x31')],qs[_0x5344('0x34')](_0x2ab85d['query'][_0x5344('0x34')]));_0x5c949e[_0x5344('0x35')]=_0x5c949e[_0x5344('0x35')]['length']?_0x5c949e[_0x5344('0x35')]:_0x28e5ac[_0x5344('0x31')];if(!_0x2ab85d['query']['hasOwnProperty'](_0x5344('0x36'))){_0x5c949e[_0x5344('0x20')]=qs[_0x5344('0x20')](_0x2ab85d[_0x5344('0x32')][_0x5344('0x20')]);_0x5c949e[_0x5344('0x1d')]=qs[_0x5344('0x1d')](_0x2ab85d[_0x5344('0x32')]['offset']);}_0x5c949e[_0x5344('0x37')]=qs[_0x5344('0x38')](_0x2ab85d['query'][_0x5344('0x38')]);_0x5c949e[_0x5344('0x39')]=qs['filters'](_['pick'](_0x2ab85d['query'],_0x28e5ac['filters']),_0x4cf9c6);if(_0x2ab85d['query'][_0x5344('0x3a')]){_0x5c949e[_0x5344('0x39')]=_[_0x5344('0x3b')](_0x5c949e['where'],{'$or':_[_0x5344('0x2d')](_0x4cf9c6,function(_0x1a3e2a){if(_0x1a3e2a[_0x5344('0x30')]!=='VIRTUAL'){var _0x23f27b={};_0x23f27b[_0x1a3e2a[_0x5344('0x2a')]]={'$like':'%'+_0x2ab85d[_0x5344('0x32')][_0x5344('0x3a')]+'%'};return _0x23f27b;}})});}_0x5c949e=_[_0x5344('0x3b')]({},_0x5c949e,_0x2ab85d[_0x5344('0x3c')]);var _0x41e89e={'where':_0x5c949e[_0x5344('0x39')]};return db[_0x5344('0x2e')][_0x5344('0x1f')](_0x41e89e)[_0x5344('0x26')](function(_0x12378e){_0x178268[_0x5344('0x1f')]=_0x12378e;if(_0x2ab85d['query']['includeAll']){_0x5c949e[_0x5344('0x3d')]=[{'all':!![]}];}return db[_0x5344('0x2e')][_0x5344('0x3e')](_0x5c949e);})[_0x5344('0x26')](function(_0x5dfe09){_0x178268['rows']=_0x5dfe09;return _0x178268;})['then'](respondWithFilteredResult(_0x23cf73,_0x5c949e))[_0x5344('0x3f')](handleError(_0x23cf73,null));};exports[_0x5344('0x40')]=function(_0x1f1073,_0x1ab5aa){var _0x4793cc={'raw':!![],'where':{'id':_0x1f1073['params']['id']}},_0x4d580f={};_0x4d580f[_0x5344('0x31')]=_['keys'](db[_0x5344('0x2e')][_0x5344('0x41')]);_0x4d580f[_0x5344('0x32')]=_[_0x5344('0x42')](_0x1f1073[_0x5344('0x32')]);_0x4d580f['filters']=_[_0x5344('0x33')](_0x4d580f[_0x5344('0x31')],_0x4d580f[_0x5344('0x32')]);_0x4793cc[_0x5344('0x35')]=_[_0x5344('0x33')](_0x4d580f[_0x5344('0x31')],qs[_0x5344('0x34')](_0x1f1073[_0x5344('0x32')][_0x5344('0x34')]));_0x4793cc[_0x5344('0x35')]=_0x4793cc['attributes'][_0x5344('0x43')]?_0x4793cc[_0x5344('0x35')]:_0x4d580f[_0x5344('0x31')];if(_0x1f1073[_0x5344('0x32')][_0x5344('0x44')]){_0x4793cc['include']=[{'all':!![]}];}_0x4793cc=_[_0x5344('0x3b')]({},_0x4793cc,_0x1f1073[_0x5344('0x3c')]);return db[_0x5344('0x2e')]['find'](_0x4793cc)[_0x5344('0x26')](handleEntityNotFound(_0x1ab5aa,null))['then'](respondWithResult(_0x1ab5aa,null))[_0x5344('0x3f')](handleError(_0x1ab5aa,null));};exports[_0x5344('0x45')]=function(_0x2cbe9f,_0x2c623f){return db[_0x5344('0x2e')][_0x5344('0x45')](_0x2cbe9f[_0x5344('0x46')],{})['then'](respondWithResult(_0x2c623f,0xc9))[_0x5344('0x3f')](handleError(_0x2c623f,null));};exports['update']=function(_0x174cd6,_0x5747ff){if(_0x174cd6[_0x5344('0x46')]['id']){delete _0x174cd6[_0x5344('0x46')]['id'];}return db[_0x5344('0x2e')][_0x5344('0x47')]({'where':{'id':_0x174cd6[_0x5344('0x48')]['id']}})[_0x5344('0x26')](handleEntityNotFound(_0x5747ff,null))['then'](saveUpdates(_0x174cd6[_0x5344('0x46')],null))[_0x5344('0x26')](respondWithResult(_0x5747ff,null))['catch'](handleError(_0x5747ff,null));};exports[_0x5344('0x27')]=function(_0x4d166d,_0x434c98){return db[_0x5344('0x2e')][_0x5344('0x47')]({'where':{'id':_0x4d166d[_0x5344('0x48')]['id']}})[_0x5344('0x26')](handleEntityNotFound(_0x434c98,null))['then'](removeEntity(_0x434c98,null))[_0x5344('0x3f')](handleError(_0x434c98,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 044f8cc..3b23595 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 _0x1867=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash'];(function(_0x166deb,_0x50a294){var _0x2a29d6=function(_0x115134){while(--_0x115134){_0x166deb['push'](_0x166deb['shift']());}};_0x2a29d6(++_0x50a294);}(_0x1867,0xb5));var _0x7186=function(_0xac0960,_0x31fb6c){_0xac0960=_0xac0960-0x0;var _0x221bbe=_0x1867[_0xac0960];return _0x221bbe;};'use strict';var _=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var logger=require('../../config/logger')(_0x7186('0x2'));var moment=require('moment');var BPromise=require(_0x7186('0x3'));var rp=require(_0x7186('0x4'));var fs=require('fs');var path=require(_0x7186('0x5'));var rimraf=require(_0x7186('0x6'));var config=require(_0x7186('0x7'));var attributes=require(_0x7186('0x8'));module[_0x7186('0x9')]=function(_0x27bd91,_0x349203){return _0x27bd91['define'](_0x7186('0xa'),attributes,{'tableName':_0x7186('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x7186('0xc'),_0x7186('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82d8=['idField','FieldId','lodash','../../config/logger','bluebird','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x82d8,0xff));var _0x882d=function(_0x1e504b,_0x58fab1){_0x1e504b=_0x1e504b-0x0;var _0x1d38e0=_0x82d8[_0x1e504b];return _0x1d38e0;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var logger=require(_0x882d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x882d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x882d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x882d('0x4'));module[_0x882d('0x5')]=function(_0x19f644,_0xa928f7){return _0x19f644[_0x882d('0x6')](_0x882d('0x7'),attributes,{'tableName':_0x882d('0x8'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x882d('0x9'),_0x882d('0xa')],'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 8339e39..934f3c1 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 _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x1fd155,_0x340af9){var _0x250e2f=function(_0x3cef99){while(--_0x3cef99){_0x1fd155['push'](_0x1fd155['shift']());}};_0x250e2f(++_0x340af9);}(_0x7c09,0x102));var _0x97c0=function(_0x832ad,_0x553e9d){_0x832ad=_0x832ad-0x0;var _0x53ff3f=_0x7c09[_0x832ad];return _0x53ff3f;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});} \ No newline at end of file +var _0x1967=['then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x1967,0x173));var _0x7196=function(_0xa049b6,_0x561d19){_0xa049b6=_0xa049b6-0x0;var _0x88cf4d=_0x1967[_0xa049b6];return _0x88cf4d;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 11be273..d8b4263 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(_0x255957,_0x13b623){var _0x51252e=function(_0x4faeb9){while(--_0x4faeb9){_0x255957['push'](_0x255957['shift']());}};_0x51252e(++_0x13b623);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0xf7b159,_0x54c2c6){var _0x3967be=function(_0x4a42fe){while(--_0x4a42fe){_0xf7b159['push'](_0xf7b159['shift']());}};_0x3967be(++_0x54c2c6);}(_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/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 61adb78..b934af5 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 _0x078f=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x078f,0x1b4));var _0xf078=function(_0x4dc282,_0x26da82){_0x4dc282=_0x4dc282-0x0;var _0x31de14=_0x078f[_0x4dc282];return _0x31de14;};'use strict';var Sequelize=require('sequelize');module[_0xf078('0x0')]={'name':{'type':Sequelize[_0xf078('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf078('0x1')],'unique':_0xf078('0x2')},'remoteUri':{'type':Sequelize[_0xf078('0x1')]},'password':{'type':Sequelize[_0xf078('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xf078('0x1')]},'securityToken':{'type':Sequelize[_0xf078('0x1')]},'serverUrl':{'type':Sequelize[_0xf078('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x4'),_0xf078('0x5')),'defaultValue':_0xf078('0x4')}}; \ No newline at end of file +var _0xf7a1=['username','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xf7a1,0xed));var _0x1f7a=function(_0x349f58,_0x43c6ef){_0x349f58=_0x349f58-0x0;var _0x2555c3=_0xf7a1[_0x349f58];return _0x2555c3;};'use strict';var Sequelize=require(_0x1f7a('0x0'));module[_0x1f7a('0x1')]={'name':{'type':Sequelize[_0x1f7a('0x2')]},'description':{'type':Sequelize[_0x1f7a('0x2')]},'username':{'type':Sequelize[_0x1f7a('0x2')],'unique':_0x1f7a('0x3')},'remoteUri':{'type':Sequelize[_0x1f7a('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x1f7a('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x1f7a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1f7a('0x4'),_0x1f7a('0x5')),'defaultValue':_0x1f7a('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f2cf8ca..1600595 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 _0x362e=['sobject','describe','ActivityDate','IsReminderSet','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','True','False','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../components/integrations/configuration','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','send','index','map','SalesforceAccount','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','SalesforceConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil'];(function(_0x568bc8,_0x44e664){var _0x44105c=function(_0xcc1f07){while(--_0xcc1f07){_0x568bc8['push'](_0x568bc8['shift']());}};_0x44105c(++_0x44e664);}(_0x362e,0x189));var _0xe362=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x362e[_0x1e381c];return _0x9b5ea9;};'use strict';var emlformat=require(_0xe362('0x0'));var rimraf=require(_0xe362('0x1'));var zipdir=require(_0xe362('0x2'));var jsonpatch=require(_0xe362('0x3'));var rp=require('request-promise');var moment=require(_0xe362('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe362('0x5'));var path=require(_0xe362('0x6'));var sox=require(_0xe362('0x7'));var csv=require(_0xe362('0x8'));var ejs=require(_0xe362('0x9'));var fs=require('fs');var fs_extra=require(_0xe362('0xa'));var _=require(_0xe362('0xb'));var squel=require(_0xe362('0xc'));var crypto=require(_0xe362('0xd'));var jsforce=require(_0xe362('0xe'));var deskjs=require(_0xe362('0xf'));var toCsv=require(_0xe362('0x8'));var querystring=require(_0xe362('0x10'));var Papa=require('papaparse');var Redis=require(_0xe362('0x11'));var authService=require(_0xe362('0x12'));var qs=require(_0xe362('0x13'));var as=require(_0xe362('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe362('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe362('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe362('0x17'));function respondWithStatusCode(_0x332b3e,_0xe94b32){_0xe94b32=_0xe94b32||0xcc;return function(_0x3c8896){if(_0x3c8896){return _0x332b3e['sendStatus'](_0xe94b32);}return _0x332b3e['status'](_0xe94b32)[_0xe362('0x18')]();};}function respondWithResult(_0x372757,_0x4ff724){_0x4ff724=_0x4ff724||0xc8;return function(_0x17699b){if(_0x17699b){return _0x372757[_0xe362('0x19')](_0x4ff724)[_0xe362('0x1a')](_0x17699b);}};}function respondWithFilteredResult(_0x3b6374,_0x1de57b){return function(_0x111bf7){if(_0x111bf7){var _0xfc118b=typeof _0x1de57b[_0xe362('0x1b')]==='undefined'&&typeof _0x1de57b[_0xe362('0x1c')]===_0xe362('0x1d');var _0x1a4ea7=_0x111bf7[_0xe362('0x1e')];var _0x2c861b=_0xfc118b?0x0:_0x1de57b[_0xe362('0x1b')];var _0x39b572=_0xfc118b?_0x111bf7[_0xe362('0x1e')]:_0x1de57b[_0xe362('0x1b')]+_0x1de57b['limit'];var _0x234412;if(_0x39b572>=_0x1a4ea7){_0x39b572=_0x1a4ea7;_0x234412=0xc8;}else{_0x234412=0xce;}_0x3b6374['status'](_0x234412);return _0x3b6374[_0xe362('0x1f')](_0xe362('0x20'),_0x2c861b+'-'+_0x39b572+'/'+_0x1a4ea7)[_0xe362('0x1a')](_0x111bf7);}return null;};}function patchUpdates(_0x5d0119){return function(_0x22d7a0){try{jsonpatch[_0xe362('0x21')](_0x22d7a0,_0x5d0119,!![]);}catch(_0x5c0f2c){return BPromise['reject'](_0x5c0f2c);}return _0x22d7a0[_0xe362('0x22')]();};}function saveUpdates(_0x1746d3,_0x2131f6){return function(_0xdef00b){if(_0xdef00b){return _0xdef00b[_0xe362('0x23')](_0x1746d3)[_0xe362('0x24')](function(_0x228936){return _0x228936;});}return null;};}function removeEntity(_0x265b86,_0x1a8316){return function(_0x2926c9){if(_0x2926c9){return _0x2926c9['destroy']()[_0xe362('0x24')](function(){_0x265b86['status'](0xcc)[_0xe362('0x18')]();});}};}function handleEntityNotFound(_0x298ae6,_0x1e27b9){return function(_0x9e7351){if(!_0x9e7351){_0x298ae6[_0xe362('0x25')](0x194);}return _0x9e7351;};}function handleError(_0x20387f,_0x4730a1){_0x4730a1=_0x4730a1||0x1f4;return function(_0x2082c1){logger[_0xe362('0x26')](_0x2082c1[_0xe362('0x27')]);if(_0x2082c1['name']){delete _0x2082c1['name'];}_0x20387f['status'](_0x4730a1)[_0xe362('0x28')](_0x2082c1);};}exports[_0xe362('0x29')]=function(_0x26dcea,_0x3a8c8b){var _0x57714b={},_0x547242={},_0x2427ca={'count':0x0,'rows':[]};var _0x376b25=_[_0xe362('0x2a')](db[_0xe362('0x2b')][_0xe362('0x2c')],function(_0x5ef672){return{'name':_0x5ef672['fieldName'],'type':_0x5ef672[_0xe362('0x2d')][_0xe362('0x2e')]};});_0x547242[_0xe362('0x2f')]=_['map'](_0x376b25,_0xe362('0x30'));_0x547242[_0xe362('0x31')]=_[_0xe362('0x32')](_0x26dcea[_0xe362('0x31')]);_0x547242[_0xe362('0x33')]=_[_0xe362('0x34')](_0x547242[_0xe362('0x2f')],_0x547242['query']);_0x57714b[_0xe362('0x35')]=_[_0xe362('0x34')](_0x547242[_0xe362('0x2f')],qs[_0xe362('0x36')](_0x26dcea[_0xe362('0x31')]['fields']));_0x57714b[_0xe362('0x35')]=_0x57714b['attributes'][_0xe362('0x37')]?_0x57714b[_0xe362('0x35')]:_0x547242[_0xe362('0x2f')];if(!_0x26dcea['query'][_0xe362('0x38')](_0xe362('0x39'))){_0x57714b[_0xe362('0x1c')]=qs['limit'](_0x26dcea[_0xe362('0x31')]['limit']);_0x57714b['offset']=qs[_0xe362('0x1b')](_0x26dcea[_0xe362('0x31')][_0xe362('0x1b')]);}_0x57714b[_0xe362('0x3a')]=qs[_0xe362('0x3b')](_0x26dcea[_0xe362('0x31')]['sort']);_0x57714b[_0xe362('0x3c')]=qs[_0xe362('0x33')](_[_0xe362('0x3d')](_0x26dcea[_0xe362('0x31')],_0x547242['filters']),_0x376b25);if(_0x26dcea[_0xe362('0x31')]['filter']){_0x57714b[_0xe362('0x3c')]=_[_0xe362('0x3e')](_0x57714b['where'],{'$or':_[_0xe362('0x2a')](_0x376b25,function(_0x4709a1){if(_0x4709a1[_0xe362('0x2d')]!==_0xe362('0x3f')){var _0x1b8fb2={};_0x1b8fb2[_0x4709a1[_0xe362('0x30')]]={'$like':'%'+_0x26dcea[_0xe362('0x31')]['filter']+'%'};return _0x1b8fb2;}})});}_0x57714b=_['merge']({},_0x57714b,_0x26dcea[_0xe362('0x40')]);var _0xdcaeb5={'where':_0x57714b[_0xe362('0x3c')]};return db[_0xe362('0x2b')][_0xe362('0x1e')](_0xdcaeb5)[_0xe362('0x24')](function(_0x40e651){_0x2427ca['count']=_0x40e651;if(_0x26dcea[_0xe362('0x31')][_0xe362('0x41')]){_0x57714b[_0xe362('0x42')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xe362('0x43')](_0x57714b);})[_0xe362('0x24')](function(_0x9b8159){_0x2427ca[_0xe362('0x44')]=_0x9b8159;return _0x2427ca;})[_0xe362('0x24')](respondWithFilteredResult(_0x3a8c8b,_0x57714b))[_0xe362('0x45')](handleError(_0x3a8c8b,null));};exports['show']=function(_0x2dd5e7,_0x45177c){var _0x18a929={'raw':![],'where':{'id':_0x2dd5e7[_0xe362('0x46')]['id']}},_0x2af203={};_0x2af203[_0xe362('0x2f')]=_[_0xe362('0x32')](db[_0xe362('0x2b')][_0xe362('0x2c')]);_0x2af203['query']=_[_0xe362('0x32')](_0x2dd5e7[_0xe362('0x31')]);_0x2af203['filters']=_[_0xe362('0x34')](_0x2af203[_0xe362('0x2f')],_0x2af203['query']);_0x18a929[_0xe362('0x35')]=_[_0xe362('0x34')](_0x2af203[_0xe362('0x2f')],qs[_0xe362('0x36')](_0x2dd5e7['query'][_0xe362('0x36')]));_0x18a929[_0xe362('0x35')]=_0x18a929[_0xe362('0x35')][_0xe362('0x37')]?_0x18a929[_0xe362('0x35')]:_0x2af203[_0xe362('0x2f')];if(_0x2dd5e7[_0xe362('0x31')]['includeAll']){_0x18a929[_0xe362('0x42')]=[{'all':!![]}];}_0x18a929=_[_0xe362('0x3e')]({},_0x18a929,_0x2dd5e7[_0xe362('0x40')]);return db[_0xe362('0x2b')][_0xe362('0x47')](_0x18a929)[_0xe362('0x24')](handleEntityNotFound(_0x45177c,null))[_0xe362('0x24')](respondWithResult(_0x45177c,null))[_0xe362('0x45')](handleError(_0x45177c,null));};exports['create']=function(_0x578c5a,_0x3d1283){return db[_0xe362('0x2b')][_0xe362('0x48')](_0x578c5a['body'],{})[_0xe362('0x24')](respondWithResult(_0x3d1283,0xc9))['catch'](handleError(_0x3d1283,null));};exports[_0xe362('0x23')]=function(_0x4baa05,_0x3029c2){if(_0x4baa05[_0xe362('0x49')]['id']){delete _0x4baa05[_0xe362('0x49')]['id'];}return db[_0xe362('0x2b')][_0xe362('0x47')]({'where':{'id':_0x4baa05['params']['id']}})[_0xe362('0x24')](handleEntityNotFound(_0x3029c2,null))[_0xe362('0x24')](saveUpdates(_0x4baa05[_0xe362('0x49')],null))['then'](respondWithResult(_0x3029c2,null))['catch'](handleError(_0x3029c2,null));};exports[_0xe362('0x4a')]=function(_0x4d7193,_0x1fb110){return db[_0xe362('0x2b')][_0xe362('0x47')]({'where':{'id':_0x4d7193[_0xe362('0x46')]['id']}})[_0xe362('0x24')](handleEntityNotFound(_0x1fb110,null))[_0xe362('0x24')](removeEntity(_0x1fb110,null))[_0xe362('0x45')](handleError(_0x1fb110,null));};exports[_0xe362('0x4b')]=function(_0x282525,_0x2f62b4,_0x387f4a){var _0xd038a6={};var _0x164a83={};var _0x3ae749;var _0x374760;return db[_0xe362('0x2b')]['findOne']({'where':{'id':_0x282525[_0xe362('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f62b4,null))['then'](function(_0x1d5838){if(_0x1d5838){_0x3ae749=_0x1d5838;_0x164a83[_0xe362('0x2f')]=_[_0xe362('0x32')](db[_0xe362('0x4c')][_0xe362('0x2c')]);_0x164a83[_0xe362('0x31')]=_[_0xe362('0x32')](_0x282525['query']);_0x164a83[_0xe362('0x33')]=_[_0xe362('0x34')](_0x164a83[_0xe362('0x2f')],_0x164a83[_0xe362('0x31')]);_0xd038a6['attributes']=_[_0xe362('0x34')](_0x164a83[_0xe362('0x2f')],qs['fields'](_0x282525[_0xe362('0x31')][_0xe362('0x36')]));_0xd038a6[_0xe362('0x35')]=_0xd038a6[_0xe362('0x35')][_0xe362('0x37')]?_0xd038a6[_0xe362('0x35')]:_0x164a83['model'];_0xd038a6[_0xe362('0x3a')]=qs['sort'](_0x282525[_0xe362('0x31')][_0xe362('0x3b')]);_0xd038a6[_0xe362('0x3c')]=qs[_0xe362('0x33')](_[_0xe362('0x3d')](_0x282525[_0xe362('0x31')],_0x164a83['filters']));if(_0x282525['query']['filter']){_0xd038a6[_0xe362('0x3c')]=_[_0xe362('0x3e')](_0xd038a6['where'],{'$or':_[_0xe362('0x2a')](_0xd038a6[_0xe362('0x35')],function(_0x361046){var _0x431c29={};_0x431c29[_0x361046]={'$like':'%'+_0x282525['query']['filter']+'%'};return _0x431c29;})});}_0xd038a6=_[_0xe362('0x3e')]({},_0xd038a6,_0x282525['options']);return _0x3ae749[_0xe362('0x4b')](_0xd038a6);}})[_0xe362('0x24')](function(_0x54ff70){if(_0x54ff70){_0x374760=_0x54ff70['length'];if(!_0x282525[_0xe362('0x31')][_0xe362('0x38')](_0xe362('0x39'))){_0xd038a6['limit']=qs['limit'](_0x282525[_0xe362('0x31')][_0xe362('0x1c')]);_0xd038a6[_0xe362('0x1b')]=qs[_0xe362('0x1b')](_0x282525[_0xe362('0x31')][_0xe362('0x1b')]);}return _0x3ae749[_0xe362('0x4b')](_0xd038a6);}})[_0xe362('0x24')](function(_0x1aaa38){if(_0x1aaa38){return _0x1aaa38?{'count':_0x374760,'rows':_0x1aaa38}:null;}})[_0xe362('0x24')](respondWithResult(_0x2f62b4,null))['catch'](handleError(_0x2f62b4,null));};exports['addConfiguration']=function(_0x9d148,_0x156a66,_0x13eba6){if(_0x9d148[_0xe362('0x49')]['id']){delete _0x9d148[_0xe362('0x49')]['id'];}return db[_0xe362('0x2b')][_0xe362('0x4d')]({'where':{'id':_0x9d148[_0xe362('0x46')]['id']}})['then'](handleEntityNotFound(_0x156a66,null))['then'](function(_0x56a900){if(_0x56a900){_0x9d148[_0xe362('0x49')][_0xe362('0x4e')]=_0x56a900['id'];_0x9d148[_0xe362('0x49')][_0xe362('0x4f')]=integrations[_0xe362('0x50')](_0x9d148[_0xe362('0x49')][_0xe362('0x51')],_0x9d148[_0xe362('0x49')][_0xe362('0x2d')]);_0x9d148['body'][_0xe362('0x52')]=integrations['getDescriptions'](_0x9d148['body'][_0xe362('0x51')],_0x9d148['body'][_0xe362('0x2d')]);return db[_0xe362('0x4c')]['create'](_0x9d148['body'],{'include':[{'model':db['SalesforceField'],'as':_0xe362('0x4f')},{'model':db[_0xe362('0x53')],'as':_0xe362('0x52')}]});}return null;})[_0xe362('0x24')](respondWithResult(_0x156a66,null))[_0xe362('0x45')](handleError(_0x156a66,null));};exports[_0xe362('0x54')]=function(_0x41f43e,_0x21917d,_0x499e94){var _0x2d15e5;var _0x21be86='';var _0x279fe8=_0xe362('0x55');return db[_0xe362('0x2b')][_0xe362('0x4d')]({'where':{'id':_0x41f43e[_0xe362('0x46')]['id']},'attributes':['id',_0xe362('0x56'),_0xe362('0x57'),_0xe362('0x58'),_0xe362('0x59'),_0xe362('0x5a'),_0xe362('0x5b')]})[_0xe362('0x24')](handleEntityNotFound(_0x21917d,null))[_0xe362('0x24')](function(_0x2e9b27){if(_0x2e9b27){_0x21be86=_0x2e9b27[_0xe362('0x56')];var _0xebb308=_0x21be86[_0xe362('0x5c')](-0x1);if(_0xebb308==='/'){_0x21be86=_0x21be86[_0xe362('0x5d')](0x0,_0x21be86[_0xe362('0x5e')](_0xebb308));}_0x2d15e5=new jsforce[(_0xe362('0x5f'))]({'oauth2':{'loginUrl':_0x21be86,'clientId':_0x2e9b27[_0xe362('0x57')],'clientSecret':_0x2e9b27[_0xe362('0x58')]}});return _0x2d15e5[_0xe362('0x60')](_0x2e9b27[_0xe362('0x59')],_0x2e9b27[_0xe362('0x5a')][_0xe362('0x61')](_0x2e9b27[_0xe362('0x5b')]));}})[_0xe362('0x24')](function(_0x215a09){if(_0x215a09){if(!_[_0xe362('0x62')](_0x41f43e[_0xe362('0x31')]['ticketType'])){_0x279fe8=_0x41f43e[_0xe362('0x31')]['ticketType'];}return _0x2d15e5[_0xe362('0x63')](_0x279fe8)[_0xe362('0x64')]();}})[_0xe362('0x24')](function(_0x1085a7){var _0x51bd87=['OwnerId',_0xe362('0x65'),_0xe362('0x66'),'IsRecurrence','Subject',_0xe362('0x67')];var _0x1457ea=[_0xe362('0x68'),_0xe362('0x69'),_0xe362('0x6a'),_0xe362('0x6b'),_0xe362('0x6c'),_0xe362('0x6d'),_0xe362('0x6e')];if(_0x1085a7){_[_0xe362('0x6f')](_0x1085a7['fields'],function(_0xd4256a){return _0x51bd87[_0xe362('0x70')](_0xd4256a[_0xe362('0x30')])||!_0x1457ea['includes'](_0xd4256a['type']);});return{'count':_0x1085a7[_0xe362('0x36')][_0xe362('0x37')],'rows':_[_0xe362('0x2a')](_0x1085a7['fields'],function(_0x469b62){return{'id':_0x469b62[_0xe362('0x30')],'name':_0x469b62['label'],'custom':_0x469b62[_0xe362('0x71')],'options':_0x469b62[_0xe362('0x72')][_0xe362('0x37')]>0x0?_[_0xe362('0x2a')](_0x469b62[_0xe362('0x72')],function(_0x52e00e){return{'name':_0x52e00e[_0xe362('0x73')],'value':_0x52e00e[_0xe362('0x74')]};}):_0x469b62[_0xe362('0x2d')]==_0xe362('0x6b')?[{'name':_0xe362('0x75'),'value':'true'},{'name':_0xe362('0x76'),'value':'false'}]:[]};})};}})[_0xe362('0x24')](respondWithResult(_0x21917d,null))[_0xe362('0x45')](function(_0x546576){var _0x5cf3fb=_0x41f43e[_0xe362('0x31')][_0xe362('0x77')]?0x1f4:_0x546576[_0xe362('0x78')]||0x1f4;logger[_0xe362('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xe362('0x54'),_0x5cf3fb,JSON[_0xe362('0x79')](_0x546576));delete _0x546576['name'];if(_0x5cf3fb===0x191){_0x5cf3fb=0x190;}_0x21917d[_0xe362('0x19')](_0x5cf3fb)['send'](_0x41f43e['query'][_0xe362('0x77')]?{'message':_0xe362('0x7a'),'statusCode':_0x546576[_0xe362('0x78')]}:_0x546576);});}; \ No newline at end of file +var _0x8941=['lastIndexOf','Connection','clientSecret','concat','ticketType','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceAccount','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','rows','rawAttributes','includeAll','include','find','catch','create','body','params','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','remoteUri','clientId','password','securityToken','slice','substring'];(function(_0x457d22,_0x55a1d4){var _0x549fa8=function(_0x44adb6){while(--_0x44adb6){_0x457d22['push'](_0x457d22['shift']());}};_0x549fa8(++_0x55a1d4);}(_0x8941,0x191));var _0x1894=function(_0x464ff7,_0x259711){_0x464ff7=_0x464ff7-0x0;var _0x257314=_0x8941[_0x464ff7];return _0x257314;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1894('0x0'));var zipdir=require(_0x1894('0x1'));var jsonpatch=require(_0x1894('0x2'));var rp=require(_0x1894('0x3'));var moment=require(_0x1894('0x4'));var BPromise=require(_0x1894('0x5'));var Mustache=require(_0x1894('0x6'));var util=require(_0x1894('0x7'));var path=require(_0x1894('0x8'));var sox=require(_0x1894('0x9'));var csv=require(_0x1894('0xa'));var ejs=require(_0x1894('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1894('0xc'));var squel=require(_0x1894('0xd'));var crypto=require('crypto');var jsforce=require(_0x1894('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1894('0xa'));var querystring=require('querystring');var Papa=require(_0x1894('0xf'));var Redis=require(_0x1894('0x10'));var authService=require(_0x1894('0x11'));var qs=require(_0x1894('0x12'));var as=require(_0x1894('0x13'));var hardwareService=require(_0x1894('0x14'));var logger=require(_0x1894('0x15'))(_0x1894('0x16'));var utils=require(_0x1894('0x17'));var config=require(_0x1894('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1894('0x19'))['db'];var integrations=require(_0x1894('0x1a'));function respondWithStatusCode(_0x3f7d8b,_0x3457b8){_0x3457b8=_0x3457b8||0xcc;return function(_0x1770af){if(_0x1770af){return _0x3f7d8b[_0x1894('0x1b')](_0x3457b8);}return _0x3f7d8b['status'](_0x3457b8)[_0x1894('0x1c')]();};}function respondWithResult(_0x40e663,_0x51a468){_0x51a468=_0x51a468||0xc8;return function(_0x95457d){if(_0x95457d){return _0x40e663[_0x1894('0x1d')](_0x51a468)[_0x1894('0x1e')](_0x95457d);}};}function respondWithFilteredResult(_0x2e8652,_0x1a72b6){return function(_0x163236){if(_0x163236){var _0x33ee8f=typeof _0x1a72b6[_0x1894('0x1f')]===_0x1894('0x20')&&typeof _0x1a72b6['limit']===_0x1894('0x20');var _0x4a9c83=_0x163236['count'];var _0x3f9087=_0x33ee8f?0x0:_0x1a72b6[_0x1894('0x1f')];var _0x57b897=_0x33ee8f?_0x163236[_0x1894('0x21')]:_0x1a72b6[_0x1894('0x1f')]+_0x1a72b6[_0x1894('0x22')];var _0x2c79a6;if(_0x57b897>=_0x4a9c83){_0x57b897=_0x4a9c83;_0x2c79a6=0xc8;}else{_0x2c79a6=0xce;}_0x2e8652[_0x1894('0x1d')](_0x2c79a6);return _0x2e8652[_0x1894('0x23')](_0x1894('0x24'),_0x3f9087+'-'+_0x57b897+'/'+_0x4a9c83)[_0x1894('0x1e')](_0x163236);}return null;};}function patchUpdates(_0x1d63f8){return function(_0x4a9123){try{jsonpatch[_0x1894('0x25')](_0x4a9123,_0x1d63f8,!![]);}catch(_0x551ca8){return BPromise[_0x1894('0x26')](_0x551ca8);}return _0x4a9123[_0x1894('0x27')]();};}function saveUpdates(_0x55d403,_0x29381a){return function(_0x5c61ac){if(_0x5c61ac){return _0x5c61ac[_0x1894('0x28')](_0x55d403)[_0x1894('0x29')](function(_0x58dcc8){return _0x58dcc8;});}return null;};}function removeEntity(_0x9e7e39,_0x362a9b){return function(_0x30ecc7){if(_0x30ecc7){return _0x30ecc7[_0x1894('0x2a')]()[_0x1894('0x29')](function(){_0x9e7e39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d3141,_0x518643){return function(_0x592aee){if(!_0x592aee){_0x3d3141['sendStatus'](0x194);}return _0x592aee;};}function handleError(_0x46d2a0,_0x52a96b){_0x52a96b=_0x52a96b||0x1f4;return function(_0x364384){logger[_0x1894('0x2b')](_0x364384[_0x1894('0x2c')]);if(_0x364384[_0x1894('0x2d')]){delete _0x364384[_0x1894('0x2d')];}_0x46d2a0[_0x1894('0x1d')](_0x52a96b)[_0x1894('0x2e')](_0x364384);};}exports[_0x1894('0x2f')]=function(_0x317de1,_0x262490){var _0x22cd8b={},_0x50e2c9={},_0xf3f49e={'count':0x0,'rows':[]};var _0x3c9045=_['map'](db[_0x1894('0x30')]['rawAttributes'],function(_0x270412){return{'name':_0x270412['fieldName'],'type':_0x270412[_0x1894('0x31')][_0x1894('0x32')]};});_0x50e2c9[_0x1894('0x33')]=_[_0x1894('0x34')](_0x3c9045,'name');_0x50e2c9[_0x1894('0x35')]=_[_0x1894('0x36')](_0x317de1[_0x1894('0x35')]);_0x50e2c9[_0x1894('0x37')]=_[_0x1894('0x38')](_0x50e2c9['model'],_0x50e2c9[_0x1894('0x35')]);_0x22cd8b[_0x1894('0x39')]=_[_0x1894('0x38')](_0x50e2c9['model'],qs[_0x1894('0x3a')](_0x317de1[_0x1894('0x35')][_0x1894('0x3a')]));_0x22cd8b['attributes']=_0x22cd8b[_0x1894('0x39')][_0x1894('0x3b')]?_0x22cd8b[_0x1894('0x39')]:_0x50e2c9[_0x1894('0x33')];if(!_0x317de1[_0x1894('0x35')][_0x1894('0x3c')](_0x1894('0x3d'))){_0x22cd8b['limit']=qs[_0x1894('0x22')](_0x317de1[_0x1894('0x35')][_0x1894('0x22')]);_0x22cd8b[_0x1894('0x1f')]=qs[_0x1894('0x1f')](_0x317de1[_0x1894('0x35')][_0x1894('0x1f')]);}_0x22cd8b[_0x1894('0x3e')]=qs[_0x1894('0x3f')](_0x317de1[_0x1894('0x35')][_0x1894('0x3f')]);_0x22cd8b[_0x1894('0x40')]=qs['filters'](_[_0x1894('0x41')](_0x317de1['query'],_0x50e2c9[_0x1894('0x37')]),_0x3c9045);if(_0x317de1[_0x1894('0x35')][_0x1894('0x42')]){_0x22cd8b['where']=_[_0x1894('0x43')](_0x22cd8b[_0x1894('0x40')],{'$or':_[_0x1894('0x34')](_0x3c9045,function(_0x43d50e){if(_0x43d50e[_0x1894('0x31')]!=='VIRTUAL'){var _0x25c712={};_0x25c712[_0x43d50e[_0x1894('0x2d')]]={'$like':'%'+_0x317de1[_0x1894('0x35')][_0x1894('0x42')]+'%'};return _0x25c712;}})});}_0x22cd8b=_[_0x1894('0x43')]({},_0x22cd8b,_0x317de1[_0x1894('0x44')]);var _0x3c19f7={'where':_0x22cd8b['where']};return db['SalesforceAccount'][_0x1894('0x21')](_0x3c19f7)[_0x1894('0x29')](function(_0x8635a0){_0xf3f49e[_0x1894('0x21')]=_0x8635a0;if(_0x317de1[_0x1894('0x35')]['includeAll']){_0x22cd8b['include']=[{'all':!![]}];}return db[_0x1894('0x30')]['findAll'](_0x22cd8b);})[_0x1894('0x29')](function(_0x47bcde){_0xf3f49e[_0x1894('0x45')]=_0x47bcde;return _0xf3f49e;})['then'](respondWithFilteredResult(_0x262490,_0x22cd8b))['catch'](handleError(_0x262490,null));};exports['show']=function(_0x52b311,_0x4ffe42){var _0x3eed90={'raw':![],'where':{'id':_0x52b311['params']['id']}},_0x1784fe={};_0x1784fe[_0x1894('0x33')]=_[_0x1894('0x36')](db[_0x1894('0x30')][_0x1894('0x46')]);_0x1784fe['query']=_[_0x1894('0x36')](_0x52b311['query']);_0x1784fe[_0x1894('0x37')]=_[_0x1894('0x38')](_0x1784fe[_0x1894('0x33')],_0x1784fe[_0x1894('0x35')]);_0x3eed90[_0x1894('0x39')]=_[_0x1894('0x38')](_0x1784fe[_0x1894('0x33')],qs['fields'](_0x52b311['query'][_0x1894('0x3a')]));_0x3eed90[_0x1894('0x39')]=_0x3eed90[_0x1894('0x39')][_0x1894('0x3b')]?_0x3eed90['attributes']:_0x1784fe[_0x1894('0x33')];if(_0x52b311[_0x1894('0x35')][_0x1894('0x47')]){_0x3eed90[_0x1894('0x48')]=[{'all':!![]}];}_0x3eed90=_[_0x1894('0x43')]({},_0x3eed90,_0x52b311['options']);return db['SalesforceAccount'][_0x1894('0x49')](_0x3eed90)[_0x1894('0x29')](handleEntityNotFound(_0x4ffe42,null))[_0x1894('0x29')](respondWithResult(_0x4ffe42,null))[_0x1894('0x4a')](handleError(_0x4ffe42,null));};exports[_0x1894('0x4b')]=function(_0x1fa0bc,_0xb54269){return db[_0x1894('0x30')][_0x1894('0x4b')](_0x1fa0bc[_0x1894('0x4c')],{})[_0x1894('0x29')](respondWithResult(_0xb54269,0xc9))[_0x1894('0x4a')](handleError(_0xb54269,null));};exports[_0x1894('0x28')]=function(_0x547bf8,_0x3d5f48){if(_0x547bf8[_0x1894('0x4c')]['id']){delete _0x547bf8[_0x1894('0x4c')]['id'];}return db['SalesforceAccount'][_0x1894('0x49')]({'where':{'id':_0x547bf8[_0x1894('0x4d')]['id']}})[_0x1894('0x29')](handleEntityNotFound(_0x3d5f48,null))[_0x1894('0x29')](saveUpdates(_0x547bf8['body'],null))[_0x1894('0x29')](respondWithResult(_0x3d5f48,null))['catch'](handleError(_0x3d5f48,null));};exports[_0x1894('0x2a')]=function(_0x5be22d,_0x58097f){return db[_0x1894('0x30')][_0x1894('0x49')]({'where':{'id':_0x5be22d['params']['id']}})[_0x1894('0x29')](handleEntityNotFound(_0x58097f,null))[_0x1894('0x29')](removeEntity(_0x58097f,null))['catch'](handleError(_0x58097f,null));};exports['getConfigurations']=function(_0x11c6f8,_0x2fdbee,_0x393ecb){var _0x170b0e={};var _0x42c100={};var _0x53db3c;var _0x2fdf88;return db['SalesforceAccount'][_0x1894('0x4e')]({'where':{'id':_0x11c6f8[_0x1894('0x4d')]['id']}})[_0x1894('0x29')](handleEntityNotFound(_0x2fdbee,null))['then'](function(_0x2628b6){if(_0x2628b6){_0x53db3c=_0x2628b6;_0x42c100[_0x1894('0x33')]=_[_0x1894('0x36')](db[_0x1894('0x4f')]['rawAttributes']);_0x42c100[_0x1894('0x35')]=_[_0x1894('0x36')](_0x11c6f8['query']);_0x42c100[_0x1894('0x37')]=_[_0x1894('0x38')](_0x42c100[_0x1894('0x33')],_0x42c100[_0x1894('0x35')]);_0x170b0e['attributes']=_['intersection'](_0x42c100['model'],qs[_0x1894('0x3a')](_0x11c6f8[_0x1894('0x35')][_0x1894('0x3a')]));_0x170b0e[_0x1894('0x39')]=_0x170b0e['attributes'][_0x1894('0x3b')]?_0x170b0e['attributes']:_0x42c100['model'];_0x170b0e[_0x1894('0x3e')]=qs['sort'](_0x11c6f8[_0x1894('0x35')][_0x1894('0x3f')]);_0x170b0e[_0x1894('0x40')]=qs[_0x1894('0x37')](_[_0x1894('0x41')](_0x11c6f8['query'],_0x42c100[_0x1894('0x37')]));if(_0x11c6f8[_0x1894('0x35')]['filter']){_0x170b0e[_0x1894('0x40')]=_[_0x1894('0x43')](_0x170b0e[_0x1894('0x40')],{'$or':_[_0x1894('0x34')](_0x170b0e[_0x1894('0x39')],function(_0x3211ea){var _0x118296={};_0x118296[_0x3211ea]={'$like':'%'+_0x11c6f8[_0x1894('0x35')]['filter']+'%'};return _0x118296;})});}_0x170b0e=_[_0x1894('0x43')]({},_0x170b0e,_0x11c6f8[_0x1894('0x44')]);return _0x53db3c[_0x1894('0x50')](_0x170b0e);}})[_0x1894('0x29')](function(_0x40f8fb){if(_0x40f8fb){_0x2fdf88=_0x40f8fb[_0x1894('0x3b')];if(!_0x11c6f8[_0x1894('0x35')]['hasOwnProperty'](_0x1894('0x3d'))){_0x170b0e[_0x1894('0x22')]=qs[_0x1894('0x22')](_0x11c6f8['query'][_0x1894('0x22')]);_0x170b0e[_0x1894('0x1f')]=qs[_0x1894('0x1f')](_0x11c6f8[_0x1894('0x35')]['offset']);}return _0x53db3c[_0x1894('0x50')](_0x170b0e);}})[_0x1894('0x29')](function(_0x346c30){if(_0x346c30){return _0x346c30?{'count':_0x2fdf88,'rows':_0x346c30}:null;}})[_0x1894('0x29')](respondWithResult(_0x2fdbee,null))[_0x1894('0x4a')](handleError(_0x2fdbee,null));};exports[_0x1894('0x51')]=function(_0x4d964c,_0x192af4,_0x74ba7a){if(_0x4d964c[_0x1894('0x4c')]['id']){delete _0x4d964c[_0x1894('0x4c')]['id'];}return db['SalesforceAccount'][_0x1894('0x4e')]({'where':{'id':_0x4d964c[_0x1894('0x4d')]['id']}})[_0x1894('0x29')](handleEntityNotFound(_0x192af4,null))[_0x1894('0x29')](function(_0x46a352){if(_0x46a352){_0x4d964c[_0x1894('0x4c')]['AccountId']=_0x46a352['id'];_0x4d964c[_0x1894('0x4c')][_0x1894('0x52')]=integrations[_0x1894('0x53')](_0x4d964c[_0x1894('0x4c')][_0x1894('0x54')],_0x4d964c[_0x1894('0x4c')][_0x1894('0x31')]);_0x4d964c['body']['Descriptions']=integrations[_0x1894('0x55')](_0x4d964c['body'][_0x1894('0x54')],_0x4d964c[_0x1894('0x4c')][_0x1894('0x31')]);return db[_0x1894('0x4f')][_0x1894('0x4b')](_0x4d964c[_0x1894('0x4c')],{'include':[{'model':db[_0x1894('0x56')],'as':'Subjects'},{'model':db[_0x1894('0x56')],'as':_0x1894('0x57')}]});}return null;})[_0x1894('0x29')](respondWithResult(_0x192af4,null))['catch'](handleError(_0x192af4,null));};exports[_0x1894('0x58')]=function(_0x62cd74,_0x1eb302,_0x549673){var _0x1339be;var _0x3d449f='';var _0x45e682='Task';return db['SalesforceAccount'][_0x1894('0x4e')]({'where':{'id':_0x62cd74[_0x1894('0x4d')]['id']},'attributes':['id',_0x1894('0x59'),_0x1894('0x5a'),'clientSecret','username',_0x1894('0x5b'),_0x1894('0x5c')]})[_0x1894('0x29')](handleEntityNotFound(_0x1eb302,null))[_0x1894('0x29')](function(_0x220fce){if(_0x220fce){_0x3d449f=_0x220fce[_0x1894('0x59')];var _0x4ba078=_0x3d449f[_0x1894('0x5d')](-0x1);if(_0x4ba078==='/'){_0x3d449f=_0x3d449f[_0x1894('0x5e')](0x0,_0x3d449f[_0x1894('0x5f')](_0x4ba078));}_0x1339be=new jsforce[(_0x1894('0x60'))]({'oauth2':{'loginUrl':_0x3d449f,'clientId':_0x220fce[_0x1894('0x5a')],'clientSecret':_0x220fce[_0x1894('0x61')]}});return _0x1339be['login'](_0x220fce['username'],_0x220fce[_0x1894('0x5b')][_0x1894('0x62')](_0x220fce['securityToken']));}})['then'](function(_0x32ba39){if(_0x32ba39){if(!_['isNil'](_0x62cd74['query'][_0x1894('0x63')])){_0x45e682=_0x62cd74['query'][_0x1894('0x63')];}return _0x1339be['sobject'](_0x45e682)[_0x1894('0x64')]();}})[_0x1894('0x29')](function(_0x5db3d5){var _0x488549=[_0x1894('0x65'),'ActivityDate',_0x1894('0x66'),_0x1894('0x67'),_0x1894('0x68'),'Description'];var _0x5a7852=[_0x1894('0x69'),_0x1894('0x6a'),_0x1894('0x6b'),_0x1894('0x6c'),_0x1894('0x6d'),_0x1894('0x6e'),_0x1894('0x6f')];if(_0x5db3d5){_[_0x1894('0x70')](_0x5db3d5[_0x1894('0x3a')],function(_0x3fa809){return _0x488549['includes'](_0x3fa809[_0x1894('0x2d')])||!_0x5a7852[_0x1894('0x71')](_0x3fa809[_0x1894('0x31')]);});return{'count':_0x5db3d5[_0x1894('0x3a')][_0x1894('0x3b')],'rows':_[_0x1894('0x34')](_0x5db3d5['fields'],function(_0x11a283){return{'id':_0x11a283['name'],'name':_0x11a283[_0x1894('0x72')],'custom':_0x11a283[_0x1894('0x73')],'options':_0x11a283[_0x1894('0x74')][_0x1894('0x3b')]>0x0?_[_0x1894('0x34')](_0x11a283[_0x1894('0x74')],function(_0x13c235){return{'name':_0x13c235[_0x1894('0x72')],'value':_0x13c235['value']};}):_0x11a283['type']==_0x1894('0x6c')?[{'name':_0x1894('0x75'),'value':_0x1894('0x76')},{'name':_0x1894('0x77'),'value':_0x1894('0x78')}]:[]};})};}})[_0x1894('0x29')](respondWithResult(_0x1eb302,null))['catch'](function(_0x10841c){var _0x477237=_0x62cd74['query'][_0x1894('0x79')]?0x1f4:_0x10841c[_0x1894('0x7a')]||0x1f4;logger[_0x1894('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x1894('0x58'),_0x477237,JSON['stringify'](_0x10841c));delete _0x10841c[_0x1894('0x2d')];if(_0x477237===0x191){_0x477237=0x190;}_0x1eb302['status'](_0x477237)[_0x1894('0x2e')](_0x62cd74[_0x1894('0x35')]['test']?{'message':_0x1894('0x7b'),'statusCode':_0x10841c['statusCode']}:_0x10841c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index c2835da..978b352 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 _0xf0da=['rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','path'];(function(_0x125fe8,_0x36c9f0){var _0x1094b6=function(_0x5adec7){while(--_0x5adec7){_0x125fe8['push'](_0x125fe8['shift']());}};_0x1094b6(++_0x36c9f0);}(_0xf0da,0xe4));var _0xaf0d=function(_0x27cde2,_0x7c7cb4){_0x27cde2=_0x27cde2-0x0;var _0x5ba109=_0xf0da[_0x27cde2];return _0x5ba109;};'use strict';var _=require(_0xaf0d('0x0'));var util=require(_0xaf0d('0x1'));var logger=require(_0xaf0d('0x2'))(_0xaf0d('0x3'));var moment=require(_0xaf0d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf0d('0x5'));var rimraf=require(_0xaf0d('0x6'));var config=require(_0xaf0d('0x7'));var attributes=require(_0xaf0d('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xaf0d('0x9')]=function(_0x5194dc,_0x459ed5){return _0x5194dc[_0xaf0d('0xa')](_0xaf0d('0xb'),attributes,{'tableName':_0xaf0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d08=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','api','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x3bd1fd,_0x1472ce){var _0x28ea80=function(_0x2222fa){while(--_0x2222fa){_0x3bd1fd['push'](_0x3bd1fd['shift']());}};_0x28ea80(++_0x1472ce);}(_0x9d08,0x1b3));var _0x89d0=function(_0x14b8a3,_0x110e3e){_0x14b8a3=_0x14b8a3-0x0;var _0x4fa766=_0x9d08[_0x14b8a3];return _0x4fa766;};'use strict';var _=require(_0x89d0('0x0'));var util=require(_0x89d0('0x1'));var logger=require('../../config/logger')(_0x89d0('0x2'));var moment=require('moment');var BPromise=require(_0x89d0('0x3'));var rp=require(_0x89d0('0x4'));var fs=require('fs');var path=require(_0x89d0('0x5'));var rimraf=require('rimraf');var config=require(_0x89d0('0x6'));var attributes=require(_0x89d0('0x7'));var integrations=require(_0x89d0('0x8'));module['exports']=function(_0x503682,_0x35d4be){return _0x503682[_0x89d0('0x9')](_0x89d0('0xa'),attributes,{'tableName':_0x89d0('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 f16c672..efddb00 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 _0x4ce5=['stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','raw','options','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0x4ce5,0xf0));var _0x54ce=function(_0x356e40,_0x56c17f){_0x356e40=_0x356e40-0x0;var _0x1e7c1e=_0x4ce5[_0x356e40];return _0x1e7c1e;};'use strict';var _=require(_0x54ce('0x0'));var util=require(_0x54ce('0x1'));var moment=require(_0x54ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x54ce('0x3'));var fs=require('fs');var Redis=require(_0x54ce('0x4'));var db=require(_0x54ce('0x5'))['db'];var utils=require(_0x54ce('0x6'));var logger=require(_0x54ce('0x7'))(_0x54ce('0x8'));var config=require(_0x54ce('0x9'));var jayson=require(_0x54ce('0xa'));var client=jayson['client'][_0x54ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16209a,_0x20b020,_0x269d8d){return new BPromise(function(_0x52e61d,_0x392917){return client[_0x54ce('0xc')](_0x16209a,_0x269d8d)[_0x54ce('0xd')](function(_0x84c218){logger[_0x54ce('0xe')](_0x54ce('0xf'),_0x20b020,'request\x20sent');logger[_0x54ce('0x10')](_0x54ce('0x11'),_0x20b020,_0x54ce('0x12'),JSON[_0x54ce('0x13')](_0x84c218));if(_0x84c218[_0x54ce('0x14')]){if(_0x84c218[_0x54ce('0x14')][_0x54ce('0x15')]===0x1f4){logger[_0x54ce('0x14')](_0x54ce('0xf'),_0x20b020,_0x84c218[_0x54ce('0x14')]['message']);return _0x392917(_0x84c218[_0x54ce('0x14')][_0x54ce('0x16')]);}logger[_0x54ce('0x14')](_0x54ce('0xf'),_0x20b020,_0x84c218[_0x54ce('0x14')][_0x54ce('0x16')]);return _0x52e61d(_0x84c218[_0x54ce('0x14')][_0x54ce('0x16')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x20b020,'request\x20sent');_0x52e61d(_0x84c218[_0x54ce('0x17')][_0x54ce('0x16')]);}})['catch'](function(_0x258a50){logger[_0x54ce('0x14')](_0x54ce('0xf'),_0x20b020,_0x258a50);_0x392917(_0x258a50);});});}exports[_0x54ce('0x18')]=function(_0x17ba53){var _0x4202f3=this;return new Promise(function(_0x532086,_0x2baa23){return db[_0x54ce('0x19')]['findAll']({'raw':_0x17ba53['options']?_0x17ba53['options'][_0x54ce('0x1a')]===undefined?!![]:![]:!![],'where':_0x17ba53[_0x54ce('0x1b')]?_0x17ba53[_0x54ce('0x1b')][_0x54ce('0x1c')]||null:null,'attributes':_0x17ba53[_0x54ce('0x1b')]?_0x17ba53[_0x54ce('0x1b')][_0x54ce('0x1d')]||null:null,'limit':_0x17ba53[_0x54ce('0x1b')]?_0x17ba53[_0x54ce('0x1b')][_0x54ce('0x1e')]||null:null,'include':_0x17ba53[_0x54ce('0x1b')]?_0x17ba53[_0x54ce('0x1b')][_0x54ce('0x1f')]?_['map'](_0x17ba53[_0x54ce('0x1b')][_0x54ce('0x1f')],function(_0x4fe772){return{'model':db[_0x4fe772['model']],'as':_0x4fe772['as'],'attributes':_0x4fe772['attributes'],'include':_0x4fe772[_0x54ce('0x1f')]?_[_0x54ce('0x20')](_0x4fe772[_0x54ce('0x1f')],function(_0x5264f6){return{'model':db[_0x5264f6['model']],'as':_0x5264f6['as'],'attributes':_0x5264f6['attributes'],'include':_0x5264f6[_0x54ce('0x1f')]?_[_0x54ce('0x20')](_0x5264f6[_0x54ce('0x1f')],function(_0x4cdc45){return{'model':db[_0x4cdc45[_0x54ce('0x21')]],'as':_0x4cdc45['as'],'attributes':_0x4cdc45['attributes']};}):[]};}):[]};}):[]:[]})[_0x54ce('0xd')](function(_0x4af939){logger[_0x54ce('0xe')](_0x54ce('0x18'),_0x17ba53);logger[_0x54ce('0x10')]('GetSalesforceAccount',_0x17ba53,JSON[_0x54ce('0x13')](_0x4af939));_0x532086(_0x4af939);})['catch'](function(_0x315b9d){logger['error'](_0x54ce('0x18'),_0x315b9d[_0x54ce('0x16')],_0x17ba53);_0x2baa23(_0x4202f3[_0x54ce('0x14')](0x1f4,_0x315b9d['message']));});});};exports[_0x54ce('0x22')]=function(_0x2fc1d5){var _0x5b3817=this;return new Promise(function(_0x438387,_0x3a1919){return db[_0x54ce('0x19')][_0x54ce('0x23')]({'raw':_0x2fc1d5[_0x54ce('0x1b')]?_0x2fc1d5['options'][_0x54ce('0x1a')]===undefined?!![]:![]:!![],'where':_0x2fc1d5[_0x54ce('0x1b')]?_0x2fc1d5[_0x54ce('0x1b')][_0x54ce('0x1c')]||null:null,'attributes':_0x2fc1d5[_0x54ce('0x1b')]?_0x2fc1d5[_0x54ce('0x1b')][_0x54ce('0x1d')]||null:null,'include':_0x2fc1d5[_0x54ce('0x1b')]?_0x2fc1d5['options'][_0x54ce('0x1f')]?_[_0x54ce('0x20')](_0x2fc1d5[_0x54ce('0x1b')]['include'],function(_0x4d8234){return{'model':db[_0x4d8234[_0x54ce('0x21')]],'as':_0x4d8234['as'],'attributes':_0x4d8234[_0x54ce('0x1d')],'include':_0x4d8234[_0x54ce('0x1f')]?_['map'](_0x4d8234[_0x54ce('0x1f')],function(_0x354290){return{'model':db[_0x354290[_0x54ce('0x21')]],'as':_0x354290['as'],'attributes':_0x354290[_0x54ce('0x1d')],'include':_0x354290[_0x54ce('0x1f')]?_['map'](_0x354290[_0x54ce('0x1f')],function(_0x58b161){return{'model':db[_0x58b161[_0x54ce('0x21')]],'as':_0x58b161['as'],'attributes':_0x58b161['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x351a54){logger[_0x54ce('0xe')]('ShowSalesforceAccount',_0x2fc1d5);logger['debug']('ShowSalesforceAccount',_0x2fc1d5,JSON[_0x54ce('0x13')](_0x351a54));_0x438387(_0x351a54);})[_0x54ce('0x24')](function(_0x2152c1){logger[_0x54ce('0x14')](_0x54ce('0x22'),_0x2152c1[_0x54ce('0x16')],_0x2fc1d5);_0x3a1919(_0x5b3817[_0x54ce('0x14')](0x1f4,_0x2152c1[_0x54ce('0x16')]));});});}; \ No newline at end of file +var _0x0c45=['ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SalesforceAccount','options','raw','where','attributes','limit','include','model','map','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','bluebird','randomstring'];(function(_0x54e0f8,_0x2092ff){var _0x45e334=function(_0x485315){while(--_0x485315){_0x54e0f8['push'](_0x54e0f8['shift']());}};_0x45e334(++_0x2092ff);}(_0x0c45,0x1ec));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50c4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x50c4('0x1'));var rs=require(_0x50c4('0x2'));var fs=require('fs');var Redis=require(_0x50c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x50c4('0x4'));var config=require(_0x50c4('0x5'));var jayson=require(_0x50c4('0x6'));var client=jayson[_0x50c4('0x7')][_0x50c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x312155,_0x4e5f2a,_0x2433ed){return new BPromise(function(_0x4d2bba,_0x16b206){return client[_0x50c4('0x9')](_0x312155,_0x2433ed)[_0x50c4('0xa')](function(_0x551c86){logger[_0x50c4('0xb')](_0x50c4('0xc'),_0x4e5f2a,_0x50c4('0xd'));logger[_0x50c4('0xe')](_0x50c4('0xf'),_0x4e5f2a,_0x50c4('0xd'),JSON[_0x50c4('0x10')](_0x551c86));if(_0x551c86[_0x50c4('0x11')]){if(_0x551c86[_0x50c4('0x11')]['code']===0x1f4){logger[_0x50c4('0x11')](_0x50c4('0xc'),_0x4e5f2a,_0x551c86[_0x50c4('0x11')]['message']);return _0x16b206(_0x551c86[_0x50c4('0x11')][_0x50c4('0x12')]);}logger['error'](_0x50c4('0xc'),_0x4e5f2a,_0x551c86[_0x50c4('0x11')][_0x50c4('0x12')]);return _0x4d2bba(_0x551c86[_0x50c4('0x11')][_0x50c4('0x12')]);}else{logger[_0x50c4('0xb')](_0x50c4('0xc'),_0x4e5f2a,_0x50c4('0xd'));_0x4d2bba(_0x551c86[_0x50c4('0x13')]['message']);}})[_0x50c4('0x14')](function(_0x3098ce){logger[_0x50c4('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x4e5f2a,_0x3098ce);_0x16b206(_0x3098ce);});});}exports['GetSalesforceAccount']=function(_0x9d542e){var _0x2ebf9d=this;return new Promise(function(_0x16051d,_0x4e90a2){return db[_0x50c4('0x15')]['findAll']({'raw':_0x9d542e[_0x50c4('0x16')]?_0x9d542e['options'][_0x50c4('0x17')]===undefined?!![]:![]:!![],'where':_0x9d542e[_0x50c4('0x16')]?_0x9d542e[_0x50c4('0x16')][_0x50c4('0x18')]||null:null,'attributes':_0x9d542e[_0x50c4('0x16')]?_0x9d542e[_0x50c4('0x16')][_0x50c4('0x19')]||null:null,'limit':_0x9d542e[_0x50c4('0x16')]?_0x9d542e['options'][_0x50c4('0x1a')]||null:null,'include':_0x9d542e['options']?_0x9d542e['options'][_0x50c4('0x1b')]?_['map'](_0x9d542e[_0x50c4('0x16')]['include'],function(_0x340d72){return{'model':db[_0x340d72[_0x50c4('0x1c')]],'as':_0x340d72['as'],'attributes':_0x340d72[_0x50c4('0x19')],'include':_0x340d72['include']?_[_0x50c4('0x1d')](_0x340d72['include'],function(_0x5dfee7){return{'model':db[_0x5dfee7['model']],'as':_0x5dfee7['as'],'attributes':_0x5dfee7[_0x50c4('0x19')],'include':_0x5dfee7['include']?_[_0x50c4('0x1d')](_0x5dfee7['include'],function(_0x345177){return{'model':db[_0x345177[_0x50c4('0x1c')]],'as':_0x345177['as'],'attributes':_0x345177['attributes']};}):[]};}):[]};}):[]:[]})[_0x50c4('0xa')](function(_0x36300d){logger[_0x50c4('0xb')](_0x50c4('0x1e'),_0x9d542e);logger[_0x50c4('0xe')]('GetSalesforceAccount',_0x9d542e,JSON[_0x50c4('0x10')](_0x36300d));_0x16051d(_0x36300d);})['catch'](function(_0x3064bf){logger[_0x50c4('0x11')](_0x50c4('0x1e'),_0x3064bf['message'],_0x9d542e);_0x4e90a2(_0x2ebf9d[_0x50c4('0x11')](0x1f4,_0x3064bf[_0x50c4('0x12')]));});});};exports[_0x50c4('0x1f')]=function(_0x3bfea8){var _0x38e60a=this;return new Promise(function(_0x357f2b,_0x144834){return db['SalesforceAccount'][_0x50c4('0x20')]({'raw':_0x3bfea8[_0x50c4('0x16')]?_0x3bfea8[_0x50c4('0x16')][_0x50c4('0x17')]===undefined?!![]:![]:!![],'where':_0x3bfea8[_0x50c4('0x16')]?_0x3bfea8['options']['where']||null:null,'attributes':_0x3bfea8[_0x50c4('0x16')]?_0x3bfea8[_0x50c4('0x16')]['attributes']||null:null,'include':_0x3bfea8[_0x50c4('0x16')]?_0x3bfea8[_0x50c4('0x16')][_0x50c4('0x1b')]?_[_0x50c4('0x1d')](_0x3bfea8[_0x50c4('0x16')][_0x50c4('0x1b')],function(_0x4bb0cc){return{'model':db[_0x4bb0cc['model']],'as':_0x4bb0cc['as'],'attributes':_0x4bb0cc['attributes'],'include':_0x4bb0cc['include']?_[_0x50c4('0x1d')](_0x4bb0cc[_0x50c4('0x1b')],function(_0x2d8abd){return{'model':db[_0x2d8abd[_0x50c4('0x1c')]],'as':_0x2d8abd['as'],'attributes':_0x2d8abd[_0x50c4('0x19')],'include':_0x2d8abd[_0x50c4('0x1b')]?_['map'](_0x2d8abd[_0x50c4('0x1b')],function(_0xcd2c7){return{'model':db[_0xcd2c7[_0x50c4('0x1c')]],'as':_0xcd2c7['as'],'attributes':_0xcd2c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x50c4('0xa')](function(_0x538490){logger[_0x50c4('0xb')]('ShowSalesforceAccount',_0x3bfea8);logger[_0x50c4('0xe')](_0x50c4('0x1f'),_0x3bfea8,JSON['stringify'](_0x538490));_0x357f2b(_0x538490);})[_0x50c4('0x14')](function(_0x4e606e){logger[_0x50c4('0x11')]('ShowSalesforceAccount',_0x4e606e[_0x50c4('0x12')],_0x3bfea8);_0x144834(_0x38e60a[_0x50c4('0x11')](0x1f4,_0x4e606e[_0x50c4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 10afff5..e4c54d6 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 _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(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x476c6c,_0x434db8){_0x476c6c=_0x476c6c-0x0;var _0xbb94db=_0x0b0e[_0x476c6c];return _0xbb94db;};'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 +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(_0x11a175,_0x19e561){var _0x3dc010=function(_0x16ec4a){while(--_0x16ec4a){_0x11a175['push'](_0x11a175['shift']());}};_0x3dc010(++_0x19e561);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 1dc1ae6..59d9306 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 _0xfb5b=['lead','account_contact_lead','account','sequelize','exports','STRING','ENUM','Task','contact_lead','contact'];(function(_0x35b6ff,_0x554aaa){var _0x43028c=function(_0x46562f){while(--_0x46562f){_0x35b6ff['push'](_0x35b6ff['shift']());}};_0x43028c(++_0x554aaa);}(_0xfb5b,0xdf));var _0xbfb5=function(_0x220b36,_0x396e35){_0x220b36=_0x220b36-0x0;var _0x13a7ac=_0xfb5b[_0x220b36];return _0x13a7ac;};'use strict';var Sequelize=require(_0xbfb5('0x0'));module[_0xbfb5('0x1')]={'name':{'type':Sequelize[_0xbfb5('0x2')]},'description':{'type':Sequelize[_0xbfb5('0x2')]},'ticketType':{'type':Sequelize[_0xbfb5('0x3')](_0xbfb5('0x4'),'Case'),'defaultValue':_0xbfb5('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xbfb5('0x5'),_0xbfb5('0x6'),_0xbfb5('0x7'),_0xbfb5('0x8'),_0xbfb5('0x9')),'defaultValue':_0xbfb5('0x5')},'moduleCreate':{'type':Sequelize['ENUM']('nothing','contact',_0xbfb5('0x7'),_0xbfb5('0x9')),'defaultValue':_0xbfb5('0x7')},'leadId':{'type':Sequelize[_0xbfb5('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xbfb5('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3bc2=['account','sequelize','STRING','Case','Task','ENUM','contact_lead','contact','lead'];(function(_0x4459ea,_0x546cdb){var _0x1311c3=function(_0x1fdb41){while(--_0x1fdb41){_0x4459ea['push'](_0x4459ea['shift']());}};_0x1311c3(++_0x546cdb);}(_0x3bc2,0xc7));var _0x23bc=function(_0x2d50c0,_0x43a797){_0x2d50c0=_0x2d50c0-0x0;var _0x42a979=_0x3bc2[_0x2d50c0];return _0x42a979;};'use strict';var Sequelize=require(_0x23bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x23bc('0x1')]},'description':{'type':Sequelize[_0x23bc('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x23bc('0x2')),'defaultValue':_0x23bc('0x3')},'moduleSearch':{'type':Sequelize[_0x23bc('0x4')](_0x23bc('0x5'),_0x23bc('0x6'),_0x23bc('0x7'),'account_contact_lead',_0x23bc('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x23bc('0x4')]('nothing',_0x23bc('0x6'),_0x23bc('0x7'),_0x23bc('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x23bc('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x23bc('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 7dc5dee..d33df39 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 _0x47d6=['count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','getFields','findOne','SalesforceField','length','order','pick','merge','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x26903f,_0x9a89c6){var _0x509332=function(_0x3729d1){while(--_0x3729d1){_0x26903f['push'](_0x26903f['shift']());}};_0x509332(++_0x9a89c6);}(_0x47d6,0x1de));var _0x647d=function(_0x52db86,_0x1e65dc){_0x52db86=_0x52db86-0x0;var _0x48d83b=_0x47d6[_0x52db86];return _0x48d83b;};'use strict';var emlformat=require(_0x647d('0x0'));var rimraf=require(_0x647d('0x1'));var zipdir=require(_0x647d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x647d('0x3'));var BPromise=require(_0x647d('0x4'));var Mustache=require(_0x647d('0x5'));var util=require('util');var path=require(_0x647d('0x6'));var sox=require(_0x647d('0x7'));var csv=require(_0x647d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x647d('0x9'));var _=require(_0x647d('0xa'));var squel=require(_0x647d('0xb'));var crypto=require(_0x647d('0xc'));var jsforce=require(_0x647d('0xd'));var deskjs=require(_0x647d('0xe'));var toCsv=require(_0x647d('0x8'));var querystring=require(_0x647d('0xf'));var Papa=require(_0x647d('0x10'));var Redis=require(_0x647d('0x11'));var authService=require(_0x647d('0x12'));var qs=require(_0x647d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x647d('0x14'));var logger=require(_0x647d('0x15'))(_0x647d('0x16'));var utils=require(_0x647d('0x17'));var config=require(_0x647d('0x18'));var licenseUtil=require(_0x647d('0x19'));var db=require(_0x647d('0x1a'))['db'];function respondWithStatusCode(_0x26cb0b,_0x52570d){_0x52570d=_0x52570d||0xcc;return function(_0x412e63){if(_0x412e63){return _0x26cb0b[_0x647d('0x1b')](_0x52570d);}return _0x26cb0b[_0x647d('0x1c')](_0x52570d)[_0x647d('0x1d')]();};}function respondWithResult(_0x4b224d,_0x18ef9e){_0x18ef9e=_0x18ef9e||0xc8;return function(_0x368b52){if(_0x368b52){return _0x4b224d[_0x647d('0x1c')](_0x18ef9e)['json'](_0x368b52);}};}function respondWithFilteredResult(_0x25fa4a,_0x4c175c){return function(_0x264e53){if(_0x264e53){var _0x5740ff=typeof _0x4c175c[_0x647d('0x1e')]===_0x647d('0x1f')&&typeof _0x4c175c['limit']===_0x647d('0x1f');var _0x539fe4=_0x264e53[_0x647d('0x20')];var _0x30a107=_0x5740ff?0x0:_0x4c175c[_0x647d('0x1e')];var _0x407788=_0x5740ff?_0x264e53[_0x647d('0x20')]:_0x4c175c[_0x647d('0x1e')]+_0x4c175c[_0x647d('0x21')];var _0x29168d;if(_0x407788>=_0x539fe4){_0x407788=_0x539fe4;_0x29168d=0xc8;}else{_0x29168d=0xce;}_0x25fa4a[_0x647d('0x1c')](_0x29168d);return _0x25fa4a[_0x647d('0x22')](_0x647d('0x23'),_0x30a107+'-'+_0x407788+'/'+_0x539fe4)[_0x647d('0x24')](_0x264e53);}return null;};}function patchUpdates(_0x33145c){return function(_0x13dcb6){try{jsonpatch[_0x647d('0x25')](_0x13dcb6,_0x33145c,!![]);}catch(_0x40484c){return BPromise[_0x647d('0x26')](_0x40484c);}return _0x13dcb6[_0x647d('0x27')]();};}function saveUpdates(_0x266982,_0x5e354e){return function(_0x417a03){if(_0x417a03){return _0x417a03[_0x647d('0x28')](_0x266982)['then'](function(_0x25bd0e){return _0x25bd0e;});}return null;};}function removeEntity(_0x3d8e69,_0x1f4c09){return function(_0x1e508a){if(_0x1e508a){return _0x1e508a['destroy']()[_0x647d('0x29')](function(){_0x3d8e69[_0x647d('0x1c')](0xcc)[_0x647d('0x1d')]();});}};}function handleEntityNotFound(_0x2a974c,_0x141b25){return function(_0x5db555){if(!_0x5db555){_0x2a974c[_0x647d('0x1b')](0x194);}return _0x5db555;};}function handleError(_0x248ab7,_0x1c6888){_0x1c6888=_0x1c6888||0x1f4;return function(_0x4499b2){logger[_0x647d('0x2a')](_0x4499b2[_0x647d('0x2b')]);if(_0x4499b2[_0x647d('0x2c')]){delete _0x4499b2[_0x647d('0x2c')];}_0x248ab7['status'](_0x1c6888)['send'](_0x4499b2);};}exports[_0x647d('0x2d')]=function(_0x20d08d,_0x1a0360){var _0x427915={},_0xefdb81={},_0x17500f={'count':0x0,'rows':[]};var _0x344fb5=_[_0x647d('0x2e')](db[_0x647d('0x2f')][_0x647d('0x30')],function(_0x4591c9){return{'name':_0x4591c9[_0x647d('0x31')],'type':_0x4591c9[_0x647d('0x32')][_0x647d('0x33')]};});_0xefdb81[_0x647d('0x34')]=_[_0x647d('0x2e')](_0x344fb5,'name');_0xefdb81[_0x647d('0x35')]=_[_0x647d('0x36')](_0x20d08d[_0x647d('0x35')]);_0xefdb81[_0x647d('0x37')]=_[_0x647d('0x38')](_0xefdb81[_0x647d('0x34')],_0xefdb81[_0x647d('0x35')]);_0x427915[_0x647d('0x39')]=_['intersection'](_0xefdb81[_0x647d('0x34')],qs[_0x647d('0x3a')](_0x20d08d[_0x647d('0x35')]['fields']));_0x427915[_0x647d('0x39')]=_0x427915[_0x647d('0x39')]['length']?_0x427915[_0x647d('0x39')]:_0xefdb81[_0x647d('0x34')];if(!_0x20d08d[_0x647d('0x35')][_0x647d('0x3b')](_0x647d('0x3c'))){_0x427915[_0x647d('0x21')]=qs[_0x647d('0x21')](_0x20d08d[_0x647d('0x35')][_0x647d('0x21')]);_0x427915[_0x647d('0x1e')]=qs[_0x647d('0x1e')](_0x20d08d[_0x647d('0x35')][_0x647d('0x1e')]);}_0x427915['order']=qs[_0x647d('0x3d')](_0x20d08d['query'][_0x647d('0x3d')]);_0x427915[_0x647d('0x3e')]=qs[_0x647d('0x37')](_['pick'](_0x20d08d[_0x647d('0x35')],_0xefdb81[_0x647d('0x37')]),_0x344fb5);if(_0x20d08d[_0x647d('0x35')]['filter']){_0x427915[_0x647d('0x3e')]=_['merge'](_0x427915[_0x647d('0x3e')],{'$or':_['map'](_0x344fb5,function(_0x2d261b){if(_0x2d261b[_0x647d('0x32')]!==_0x647d('0x3f')){var _0x6c58e8={};_0x6c58e8[_0x2d261b[_0x647d('0x2c')]]={'$like':'%'+_0x20d08d[_0x647d('0x35')][_0x647d('0x40')]+'%'};return _0x6c58e8;}})});}_0x427915=_['merge']({},_0x427915,_0x20d08d['options']);var _0xdd44ba={'where':_0x427915[_0x647d('0x3e')]};return db[_0x647d('0x2f')]['count'](_0xdd44ba)[_0x647d('0x29')](function(_0x40c436){_0x17500f[_0x647d('0x20')]=_0x40c436;if(_0x20d08d[_0x647d('0x35')][_0x647d('0x41')]){_0x427915[_0x647d('0x42')]=[{'all':!![]}];}return db[_0x647d('0x2f')][_0x647d('0x43')](_0x427915);})[_0x647d('0x29')](function(_0x1a260e){_0x17500f['rows']=_0x1a260e;return _0x17500f;})['then'](respondWithFilteredResult(_0x1a0360,_0x427915))[_0x647d('0x44')](handleError(_0x1a0360,null));};exports[_0x647d('0x45')]=function(_0x4a54a8,_0x41c54c){var _0x2e8784={'raw':![],'where':{'id':_0x4a54a8[_0x647d('0x46')]['id']}},_0x4a3535={};_0x4a3535[_0x647d('0x34')]=_[_0x647d('0x36')](db[_0x647d('0x2f')][_0x647d('0x30')]);_0x4a3535['query']=_[_0x647d('0x36')](_0x4a54a8['query']);_0x4a3535[_0x647d('0x37')]=_[_0x647d('0x38')](_0x4a3535[_0x647d('0x34')],_0x4a3535[_0x647d('0x35')]);_0x2e8784[_0x647d('0x39')]=_[_0x647d('0x38')](_0x4a3535[_0x647d('0x34')],qs[_0x647d('0x3a')](_0x4a54a8[_0x647d('0x35')]['fields']));_0x2e8784[_0x647d('0x39')]=_0x2e8784[_0x647d('0x39')]['length']?_0x2e8784[_0x647d('0x39')]:_0x4a3535[_0x647d('0x34')];if(_0x4a54a8[_0x647d('0x35')][_0x647d('0x41')]){_0x2e8784[_0x647d('0x42')]=[{'all':!![]}];}_0x2e8784=_['merge']({},_0x2e8784,_0x4a54a8[_0x647d('0x47')]);return db[_0x647d('0x2f')][_0x647d('0x48')](_0x2e8784)[_0x647d('0x29')](handleEntityNotFound(_0x41c54c,null))[_0x647d('0x29')](respondWithResult(_0x41c54c,null))[_0x647d('0x44')](handleError(_0x41c54c,null));};exports['create']=function(_0xcc4c44,_0x5e69ad){return db['SalesforceConfiguration'][_0x647d('0x49')](_0xcc4c44['body'],{})[_0x647d('0x29')](respondWithResult(_0x5e69ad,0xc9))[_0x647d('0x44')](handleError(_0x5e69ad,null));};exports[_0x647d('0x28')]=function(_0x10f33b,_0x5bc07b){if(_0x10f33b[_0x647d('0x4a')]['id']){delete _0x10f33b['body']['id'];}return db[_0x647d('0x2f')][_0x647d('0x48')]({'where':{'id':_0x10f33b[_0x647d('0x46')]['id']}})[_0x647d('0x29')](handleEntityNotFound(_0x5bc07b,null))[_0x647d('0x29')](saveUpdates(_0x10f33b['body'],null))[_0x647d('0x29')](respondWithResult(_0x5bc07b,null))[_0x647d('0x44')](handleError(_0x5bc07b,null));};exports[_0x647d('0x4b')]=function(_0x480cc1,_0x46e349){return db[_0x647d('0x2f')][_0x647d('0x48')]({'where':{'id':_0x480cc1['params']['id']}})[_0x647d('0x29')](handleEntityNotFound(_0x46e349,null))[_0x647d('0x29')](removeEntity(_0x46e349,null))[_0x647d('0x44')](handleError(_0x46e349,null));};exports[_0x647d('0x4c')]=function(_0x4ffe75,_0x4fc9f9,_0x510f3d){var _0xf0f740={};var _0x5e9ac8={};var _0xf7aadf;var _0x2ec41f;return db[_0x647d('0x2f')][_0x647d('0x4d')]({'where':{'id':_0x4ffe75['params']['id']}})[_0x647d('0x29')](handleEntityNotFound(_0x4fc9f9,null))[_0x647d('0x29')](function(_0x4070de){if(_0x4070de){_0xf7aadf=_0x4070de;_0x5e9ac8[_0x647d('0x34')]=_[_0x647d('0x36')](db[_0x647d('0x4e')][_0x647d('0x30')]);_0x5e9ac8['query']=_[_0x647d('0x36')](_0x4ffe75[_0x647d('0x35')]);_0x5e9ac8[_0x647d('0x37')]=_['intersection'](_0x5e9ac8[_0x647d('0x34')],_0x5e9ac8[_0x647d('0x35')]);_0xf0f740[_0x647d('0x39')]=_['intersection'](_0x5e9ac8['model'],qs[_0x647d('0x3a')](_0x4ffe75[_0x647d('0x35')][_0x647d('0x3a')]));_0xf0f740[_0x647d('0x39')]=_0xf0f740[_0x647d('0x39')][_0x647d('0x4f')]?_0xf0f740[_0x647d('0x39')]:_0x5e9ac8['model'];_0xf0f740[_0x647d('0x50')]=qs[_0x647d('0x3d')](_0x4ffe75[_0x647d('0x35')][_0x647d('0x3d')]);_0xf0f740[_0x647d('0x3e')]=qs[_0x647d('0x37')](_[_0x647d('0x51')](_0x4ffe75[_0x647d('0x35')],_0x5e9ac8[_0x647d('0x37')]));if(_0x4ffe75['query'][_0x647d('0x40')]){_0xf0f740[_0x647d('0x3e')]=_[_0x647d('0x52')](_0xf0f740['where'],{'$or':_[_0x647d('0x2e')](_0xf0f740[_0x647d('0x39')],function(_0x525da1){var _0x5bff49={};_0x5bff49[_0x525da1]={'$like':'%'+_0x4ffe75[_0x647d('0x35')][_0x647d('0x40')]+'%'};return _0x5bff49;})});}_0xf0f740=_[_0x647d('0x52')]({},_0xf0f740,_0x4ffe75[_0x647d('0x47')]);return _0xf7aadf['getFields'](_0xf0f740);}})[_0x647d('0x29')](function(_0x4522e7){if(_0x4522e7){_0x2ec41f=_0x4522e7['length'];if(!_0x4ffe75[_0x647d('0x35')]['hasOwnProperty'](_0x647d('0x3c'))){_0xf0f740['limit']=qs[_0x647d('0x21')](_0x4ffe75[_0x647d('0x35')][_0x647d('0x21')]);_0xf0f740[_0x647d('0x1e')]=qs[_0x647d('0x1e')](_0x4ffe75['query'][_0x647d('0x1e')]);}return _0xf7aadf[_0x647d('0x4c')](_0xf0f740);}})['then'](function(_0x5255b3){if(_0x5255b3){return _0x5255b3?{'count':_0x2ec41f,'rows':_0x5255b3}:null;}})[_0x647d('0x29')](respondWithResult(_0x4fc9f9,null))[_0x647d('0x44')](handleError(_0x4fc9f9,null));};exports[_0x647d('0x53')]=function(_0x7d640c,_0x2de23c,_0x57e092){var _0x53a10c={};var _0x5b998e={};var _0x28f7ee;var _0x39909a;return db[_0x647d('0x2f')][_0x647d('0x4d')]({'where':{'id':_0x7d640c[_0x647d('0x46')]['id']}})['then'](handleEntityNotFound(_0x2de23c,null))[_0x647d('0x29')](function(_0x26214d){if(_0x26214d){_0x28f7ee=_0x26214d;_0x5b998e[_0x647d('0x34')]=_[_0x647d('0x36')](db[_0x647d('0x4e')][_0x647d('0x30')]);_0x5b998e[_0x647d('0x35')]=_[_0x647d('0x36')](_0x7d640c[_0x647d('0x35')]);_0x5b998e[_0x647d('0x37')]=_[_0x647d('0x38')](_0x5b998e[_0x647d('0x34')],_0x5b998e[_0x647d('0x35')]);_0x53a10c[_0x647d('0x39')]=_[_0x647d('0x38')](_0x5b998e[_0x647d('0x34')],qs[_0x647d('0x3a')](_0x7d640c[_0x647d('0x35')][_0x647d('0x3a')]));_0x53a10c['attributes']=_0x53a10c[_0x647d('0x39')]['length']?_0x53a10c['attributes']:_0x5b998e['model'];_0x53a10c['order']=qs[_0x647d('0x3d')](_0x7d640c[_0x647d('0x35')][_0x647d('0x3d')]);_0x53a10c['where']=qs[_0x647d('0x37')](_[_0x647d('0x51')](_0x7d640c['query'],_0x5b998e['filters']));if(_0x7d640c[_0x647d('0x35')][_0x647d('0x40')]){_0x53a10c['where']=_[_0x647d('0x52')](_0x53a10c[_0x647d('0x3e')],{'$or':_[_0x647d('0x2e')](_0x53a10c[_0x647d('0x39')],function(_0x31dfee){var _0x31ae38={};_0x31ae38[_0x31dfee]={'$like':'%'+_0x7d640c[_0x647d('0x35')][_0x647d('0x40')]+'%'};return _0x31ae38;})});}_0x53a10c=_[_0x647d('0x52')]({},_0x53a10c,_0x7d640c[_0x647d('0x47')]);return _0x28f7ee[_0x647d('0x53')](_0x53a10c);}})[_0x647d('0x29')](function(_0x275b6f){if(_0x275b6f){_0x39909a=_0x275b6f[_0x647d('0x4f')];if(!_0x7d640c[_0x647d('0x35')][_0x647d('0x3b')](_0x647d('0x3c'))){_0x53a10c[_0x647d('0x21')]=qs['limit'](_0x7d640c[_0x647d('0x35')]['limit']);_0x53a10c[_0x647d('0x1e')]=qs['offset'](_0x7d640c[_0x647d('0x35')][_0x647d('0x1e')]);}return _0x28f7ee['getSubjects'](_0x53a10c);}})[_0x647d('0x29')](function(_0x113c6d){if(_0x113c6d){return _0x113c6d?{'count':_0x39909a,'rows':_0x113c6d}:null;}})[_0x647d('0x29')](respondWithResult(_0x2de23c,null))[_0x647d('0x44')](handleError(_0x2de23c,null));};exports[_0x647d('0x54')]=function(_0x1555f2,_0x3a20be,_0x48b1ec){var _0x1a3c8c={};var _0x51ce28={};var _0x1a66aa;var _0x37f903;return db[_0x647d('0x2f')]['findOne']({'where':{'id':_0x1555f2[_0x647d('0x46')]['id']}})[_0x647d('0x29')](handleEntityNotFound(_0x3a20be,null))[_0x647d('0x29')](function(_0x4459fa){if(_0x4459fa){_0x1a66aa=_0x4459fa;_0x51ce28['model']=_['keys'](db[_0x647d('0x4e')]['rawAttributes']);_0x51ce28[_0x647d('0x35')]=_[_0x647d('0x36')](_0x1555f2[_0x647d('0x35')]);_0x51ce28[_0x647d('0x37')]=_[_0x647d('0x38')](_0x51ce28['model'],_0x51ce28[_0x647d('0x35')]);_0x1a3c8c[_0x647d('0x39')]=_['intersection'](_0x51ce28['model'],qs[_0x647d('0x3a')](_0x1555f2[_0x647d('0x35')][_0x647d('0x3a')]));_0x1a3c8c[_0x647d('0x39')]=_0x1a3c8c[_0x647d('0x39')][_0x647d('0x4f')]?_0x1a3c8c[_0x647d('0x39')]:_0x51ce28[_0x647d('0x34')];_0x1a3c8c[_0x647d('0x50')]=qs[_0x647d('0x3d')](_0x1555f2[_0x647d('0x35')][_0x647d('0x3d')]);_0x1a3c8c[_0x647d('0x3e')]=qs['filters'](_[_0x647d('0x51')](_0x1555f2[_0x647d('0x35')],_0x51ce28[_0x647d('0x37')]));if(_0x1555f2['query']['filter']){_0x1a3c8c['where']=_['merge'](_0x1a3c8c[_0x647d('0x3e')],{'$or':_[_0x647d('0x2e')](_0x1a3c8c[_0x647d('0x39')],function(_0x1f8ee8){var _0x4e6d7b={};_0x4e6d7b[_0x1f8ee8]={'$like':'%'+_0x1555f2[_0x647d('0x35')][_0x647d('0x40')]+'%'};return _0x4e6d7b;})});}_0x1a3c8c=_['merge']({},_0x1a3c8c,_0x1555f2['options']);return _0x1a66aa[_0x647d('0x54')](_0x1a3c8c);}})[_0x647d('0x29')](function(_0x55a066){if(_0x55a066){_0x37f903=_0x55a066[_0x647d('0x4f')];if(!_0x1555f2['query'][_0x647d('0x3b')](_0x647d('0x3c'))){_0x1a3c8c[_0x647d('0x21')]=qs['limit'](_0x1555f2[_0x647d('0x35')][_0x647d('0x21')]);_0x1a3c8c[_0x647d('0x1e')]=qs[_0x647d('0x1e')](_0x1555f2['query'][_0x647d('0x1e')]);}return _0x1a66aa[_0x647d('0x54')](_0x1a3c8c);}})[_0x647d('0x29')](function(_0x1d0b00){if(_0x1d0b00){return _0x1d0b00?{'count':_0x37f903,'rows':_0x1d0b00}:null;}})['then'](respondWithResult(_0x3a20be,null))[_0x647d('0x44')](handleError(_0x3a20be,null));}; \ No newline at end of file +var _0x4dca=['fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','SalesforceField','rawAttributes','order','getFields','findOne','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','then','destroy','name','send','map','SalesforceConfiguration','fieldName','type','key','model','query','intersection'];(function(_0x2f3ee9,_0x44b51d){var _0x28c497=function(_0x4f3013){while(--_0x4f3013){_0x2f3ee9['push'](_0x2f3ee9['shift']());}};_0x28c497(++_0x44b51d);}(_0x4dca,0x14e));var _0xa4dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4dca[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xa4dc('0x0'));var rimraf=require(_0xa4dc('0x1'));var zipdir=require(_0xa4dc('0x2'));var jsonpatch=require(_0xa4dc('0x3'));var rp=require(_0xa4dc('0x4'));var moment=require(_0xa4dc('0x5'));var BPromise=require(_0xa4dc('0x6'));var Mustache=require(_0xa4dc('0x7'));var util=require('util');var path=require(_0xa4dc('0x8'));var sox=require(_0xa4dc('0x9'));var csv=require(_0xa4dc('0xa'));var ejs=require(_0xa4dc('0xb'));var fs=require('fs');var fs_extra=require(_0xa4dc('0xc'));var _=require(_0xa4dc('0xd'));var squel=require(_0xa4dc('0xe'));var crypto=require(_0xa4dc('0xf'));var jsforce=require(_0xa4dc('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa4dc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa4dc('0x11'));var authService=require(_0xa4dc('0x12'));var qs=require(_0xa4dc('0x13'));var as=require(_0xa4dc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4dc('0x15'))('api');var utils=require(_0xa4dc('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4dc('0x17'))['db'];function respondWithStatusCode(_0x3ed238,_0x2b5713){_0x2b5713=_0x2b5713||0xcc;return function(_0x35949d){if(_0x35949d){return _0x3ed238[_0xa4dc('0x18')](_0x2b5713);}return _0x3ed238[_0xa4dc('0x19')](_0x2b5713)[_0xa4dc('0x1a')]();};}function respondWithResult(_0x4b44bf,_0x527f96){_0x527f96=_0x527f96||0xc8;return function(_0x543b8e){if(_0x543b8e){return _0x4b44bf[_0xa4dc('0x19')](_0x527f96)[_0xa4dc('0x1b')](_0x543b8e);}};}function respondWithFilteredResult(_0x437502,_0x35278e){return function(_0x28bd1a){if(_0x28bd1a){var _0x49d20f=typeof _0x35278e['offset']==='undefined'&&typeof _0x35278e[_0xa4dc('0x1c')]===_0xa4dc('0x1d');var _0x9342c8=_0x28bd1a[_0xa4dc('0x1e')];var _0x1334ea=_0x49d20f?0x0:_0x35278e[_0xa4dc('0x1f')];var _0x25549e=_0x49d20f?_0x28bd1a[_0xa4dc('0x1e')]:_0x35278e[_0xa4dc('0x1f')]+_0x35278e[_0xa4dc('0x1c')];var _0x34cee2;if(_0x25549e>=_0x9342c8){_0x25549e=_0x9342c8;_0x34cee2=0xc8;}else{_0x34cee2=0xce;}_0x437502[_0xa4dc('0x19')](_0x34cee2);return _0x437502['set'](_0xa4dc('0x20'),_0x1334ea+'-'+_0x25549e+'/'+_0x9342c8)[_0xa4dc('0x1b')](_0x28bd1a);}return null;};}function patchUpdates(_0x121bb8){return function(_0x4e087d){try{jsonpatch['apply'](_0x4e087d,_0x121bb8,!![]);}catch(_0x27749e){return BPromise[_0xa4dc('0x21')](_0x27749e);}return _0x4e087d['save']();};}function saveUpdates(_0x227f4e,_0x28556c){return function(_0x5e2a55){if(_0x5e2a55){return _0x5e2a55['update'](_0x227f4e)[_0xa4dc('0x22')](function(_0x36a719){return _0x36a719;});}return null;};}function removeEntity(_0x124719,_0x43c3c5){return function(_0x2bedea){if(_0x2bedea){return _0x2bedea[_0xa4dc('0x23')]()[_0xa4dc('0x22')](function(){_0x124719[_0xa4dc('0x19')](0xcc)[_0xa4dc('0x1a')]();});}};}function handleEntityNotFound(_0x29e713,_0x5d33d4){return function(_0x179331){if(!_0x179331){_0x29e713[_0xa4dc('0x18')](0x194);}return _0x179331;};}function handleError(_0x3a35bf,_0x149300){_0x149300=_0x149300||0x1f4;return function(_0x51a543){logger['error'](_0x51a543['stack']);if(_0x51a543[_0xa4dc('0x24')]){delete _0x51a543[_0xa4dc('0x24')];}_0x3a35bf[_0xa4dc('0x19')](_0x149300)[_0xa4dc('0x25')](_0x51a543);};}exports['index']=function(_0x51b6aa,_0x3cacd0){var _0x525a38={},_0x522ee4={},_0x4f1820={'count':0x0,'rows':[]};var _0x25ebbe=_[_0xa4dc('0x26')](db[_0xa4dc('0x27')]['rawAttributes'],function(_0x267a6b){return{'name':_0x267a6b[_0xa4dc('0x28')],'type':_0x267a6b[_0xa4dc('0x29')][_0xa4dc('0x2a')]};});_0x522ee4[_0xa4dc('0x2b')]=_[_0xa4dc('0x26')](_0x25ebbe,_0xa4dc('0x24'));_0x522ee4[_0xa4dc('0x2c')]=_['keys'](_0x51b6aa['query']);_0x522ee4['filters']=_[_0xa4dc('0x2d')](_0x522ee4['model'],_0x522ee4['query']);_0x525a38['attributes']=_[_0xa4dc('0x2d')](_0x522ee4[_0xa4dc('0x2b')],qs[_0xa4dc('0x2e')](_0x51b6aa[_0xa4dc('0x2c')][_0xa4dc('0x2e')]));_0x525a38[_0xa4dc('0x2f')]=_0x525a38[_0xa4dc('0x2f')][_0xa4dc('0x30')]?_0x525a38['attributes']:_0x522ee4[_0xa4dc('0x2b')];if(!_0x51b6aa['query']['hasOwnProperty'](_0xa4dc('0x31'))){_0x525a38[_0xa4dc('0x1c')]=qs[_0xa4dc('0x1c')](_0x51b6aa['query'][_0xa4dc('0x1c')]);_0x525a38[_0xa4dc('0x1f')]=qs[_0xa4dc('0x1f')](_0x51b6aa[_0xa4dc('0x2c')][_0xa4dc('0x1f')]);}_0x525a38['order']=qs[_0xa4dc('0x32')](_0x51b6aa[_0xa4dc('0x2c')][_0xa4dc('0x32')]);_0x525a38[_0xa4dc('0x33')]=qs['filters'](_[_0xa4dc('0x34')](_0x51b6aa[_0xa4dc('0x2c')],_0x522ee4[_0xa4dc('0x35')]),_0x25ebbe);if(_0x51b6aa[_0xa4dc('0x2c')][_0xa4dc('0x36')]){_0x525a38['where']=_['merge'](_0x525a38['where'],{'$or':_[_0xa4dc('0x26')](_0x25ebbe,function(_0x8f1cd4){if(_0x8f1cd4[_0xa4dc('0x29')]!=='VIRTUAL'){var _0xd33200={};_0xd33200[_0x8f1cd4[_0xa4dc('0x24')]]={'$like':'%'+_0x51b6aa[_0xa4dc('0x2c')]['filter']+'%'};return _0xd33200;}})});}_0x525a38=_[_0xa4dc('0x37')]({},_0x525a38,_0x51b6aa[_0xa4dc('0x38')]);var _0x23263b={'where':_0x525a38[_0xa4dc('0x33')]};return db['SalesforceConfiguration'][_0xa4dc('0x1e')](_0x23263b)[_0xa4dc('0x22')](function(_0x2c07b2){_0x4f1820[_0xa4dc('0x1e')]=_0x2c07b2;if(_0x51b6aa[_0xa4dc('0x2c')][_0xa4dc('0x39')]){_0x525a38[_0xa4dc('0x3a')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xa4dc('0x3b')](_0x525a38);})['then'](function(_0x19f2e8){_0x4f1820[_0xa4dc('0x3c')]=_0x19f2e8;return _0x4f1820;})[_0xa4dc('0x22')](respondWithFilteredResult(_0x3cacd0,_0x525a38))['catch'](handleError(_0x3cacd0,null));};exports[_0xa4dc('0x3d')]=function(_0xa23d8e,_0x37c90a){var _0x23f67e={'raw':![],'where':{'id':_0xa23d8e[_0xa4dc('0x3e')]['id']}},_0xee6d8a={};_0xee6d8a[_0xa4dc('0x2b')]=_[_0xa4dc('0x3f')](db['SalesforceConfiguration']['rawAttributes']);_0xee6d8a[_0xa4dc('0x2c')]=_[_0xa4dc('0x3f')](_0xa23d8e['query']);_0xee6d8a[_0xa4dc('0x35')]=_[_0xa4dc('0x2d')](_0xee6d8a['model'],_0xee6d8a[_0xa4dc('0x2c')]);_0x23f67e['attributes']=_[_0xa4dc('0x2d')](_0xee6d8a[_0xa4dc('0x2b')],qs[_0xa4dc('0x2e')](_0xa23d8e[_0xa4dc('0x2c')][_0xa4dc('0x2e')]));_0x23f67e[_0xa4dc('0x2f')]=_0x23f67e[_0xa4dc('0x2f')][_0xa4dc('0x30')]?_0x23f67e[_0xa4dc('0x2f')]:_0xee6d8a[_0xa4dc('0x2b')];if(_0xa23d8e[_0xa4dc('0x2c')][_0xa4dc('0x39')]){_0x23f67e[_0xa4dc('0x3a')]=[{'all':!![]}];}_0x23f67e=_[_0xa4dc('0x37')]({},_0x23f67e,_0xa23d8e[_0xa4dc('0x38')]);return db[_0xa4dc('0x27')][_0xa4dc('0x40')](_0x23f67e)[_0xa4dc('0x22')](handleEntityNotFound(_0x37c90a,null))[_0xa4dc('0x22')](respondWithResult(_0x37c90a,null))[_0xa4dc('0x41')](handleError(_0x37c90a,null));};exports['create']=function(_0x2e6b4a,_0x4ea11b){return db['SalesforceConfiguration'][_0xa4dc('0x42')](_0x2e6b4a[_0xa4dc('0x43')],{})['then'](respondWithResult(_0x4ea11b,0xc9))[_0xa4dc('0x41')](handleError(_0x4ea11b,null));};exports['update']=function(_0x3bf91,_0x5945c2){if(_0x3bf91[_0xa4dc('0x43')]['id']){delete _0x3bf91[_0xa4dc('0x43')]['id'];}return db[_0xa4dc('0x27')][_0xa4dc('0x40')]({'where':{'id':_0x3bf91[_0xa4dc('0x3e')]['id']}})[_0xa4dc('0x22')](handleEntityNotFound(_0x5945c2,null))[_0xa4dc('0x22')](saveUpdates(_0x3bf91[_0xa4dc('0x43')],null))['then'](respondWithResult(_0x5945c2,null))['catch'](handleError(_0x5945c2,null));};exports['destroy']=function(_0x2cc1f9,_0x213865){return db[_0xa4dc('0x27')][_0xa4dc('0x40')]({'where':{'id':_0x2cc1f9[_0xa4dc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x213865,null))['then'](removeEntity(_0x213865,null))['catch'](handleError(_0x213865,null));};exports['getFields']=function(_0x251209,_0x23be70,_0x3785ca){var _0xdadcc2={};var _0x5238d6={};var _0x4a0902;var _0x45c874;return db[_0xa4dc('0x27')]['findOne']({'where':{'id':_0x251209[_0xa4dc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x23be70,null))[_0xa4dc('0x22')](function(_0x2d9246){if(_0x2d9246){_0x4a0902=_0x2d9246;_0x5238d6[_0xa4dc('0x2b')]=_[_0xa4dc('0x3f')](db[_0xa4dc('0x44')][_0xa4dc('0x45')]);_0x5238d6[_0xa4dc('0x2c')]=_[_0xa4dc('0x3f')](_0x251209[_0xa4dc('0x2c')]);_0x5238d6['filters']=_[_0xa4dc('0x2d')](_0x5238d6[_0xa4dc('0x2b')],_0x5238d6[_0xa4dc('0x2c')]);_0xdadcc2[_0xa4dc('0x2f')]=_[_0xa4dc('0x2d')](_0x5238d6[_0xa4dc('0x2b')],qs[_0xa4dc('0x2e')](_0x251209[_0xa4dc('0x2c')][_0xa4dc('0x2e')]));_0xdadcc2[_0xa4dc('0x2f')]=_0xdadcc2['attributes']['length']?_0xdadcc2['attributes']:_0x5238d6['model'];_0xdadcc2[_0xa4dc('0x46')]=qs[_0xa4dc('0x32')](_0x251209[_0xa4dc('0x2c')][_0xa4dc('0x32')]);_0xdadcc2[_0xa4dc('0x33')]=qs[_0xa4dc('0x35')](_[_0xa4dc('0x34')](_0x251209[_0xa4dc('0x2c')],_0x5238d6[_0xa4dc('0x35')]));if(_0x251209[_0xa4dc('0x2c')][_0xa4dc('0x36')]){_0xdadcc2[_0xa4dc('0x33')]=_[_0xa4dc('0x37')](_0xdadcc2[_0xa4dc('0x33')],{'$or':_[_0xa4dc('0x26')](_0xdadcc2[_0xa4dc('0x2f')],function(_0x3a7862){var _0x4b62ba={};_0x4b62ba[_0x3a7862]={'$like':'%'+_0x251209[_0xa4dc('0x2c')][_0xa4dc('0x36')]+'%'};return _0x4b62ba;})});}_0xdadcc2=_['merge']({},_0xdadcc2,_0x251209[_0xa4dc('0x38')]);return _0x4a0902[_0xa4dc('0x47')](_0xdadcc2);}})['then'](function(_0x586833){if(_0x586833){_0x45c874=_0x586833[_0xa4dc('0x30')];if(!_0x251209[_0xa4dc('0x2c')]['hasOwnProperty']('nolimit')){_0xdadcc2[_0xa4dc('0x1c')]=qs[_0xa4dc('0x1c')](_0x251209[_0xa4dc('0x2c')][_0xa4dc('0x1c')]);_0xdadcc2[_0xa4dc('0x1f')]=qs[_0xa4dc('0x1f')](_0x251209[_0xa4dc('0x2c')][_0xa4dc('0x1f')]);}return _0x4a0902[_0xa4dc('0x47')](_0xdadcc2);}})[_0xa4dc('0x22')](function(_0x1de7d4){if(_0x1de7d4){return _0x1de7d4?{'count':_0x45c874,'rows':_0x1de7d4}:null;}})['then'](respondWithResult(_0x23be70,null))['catch'](handleError(_0x23be70,null));};exports['getSubjects']=function(_0x2e102a,_0x1f3ee3,_0x36ac62){var _0x3d5ee0={};var _0x171a54={};var _0x5d1d34;var _0x3299a7;return db[_0xa4dc('0x27')][_0xa4dc('0x48')]({'where':{'id':_0x2e102a[_0xa4dc('0x3e')]['id']}})[_0xa4dc('0x22')](handleEntityNotFound(_0x1f3ee3,null))[_0xa4dc('0x22')](function(_0x4af250){if(_0x4af250){_0x5d1d34=_0x4af250;_0x171a54[_0xa4dc('0x2b')]=_[_0xa4dc('0x3f')](db[_0xa4dc('0x44')][_0xa4dc('0x45')]);_0x171a54[_0xa4dc('0x2c')]=_[_0xa4dc('0x3f')](_0x2e102a[_0xa4dc('0x2c')]);_0x171a54[_0xa4dc('0x35')]=_[_0xa4dc('0x2d')](_0x171a54[_0xa4dc('0x2b')],_0x171a54['query']);_0x3d5ee0['attributes']=_[_0xa4dc('0x2d')](_0x171a54[_0xa4dc('0x2b')],qs[_0xa4dc('0x2e')](_0x2e102a[_0xa4dc('0x2c')][_0xa4dc('0x2e')]));_0x3d5ee0[_0xa4dc('0x2f')]=_0x3d5ee0[_0xa4dc('0x2f')]['length']?_0x3d5ee0[_0xa4dc('0x2f')]:_0x171a54['model'];_0x3d5ee0[_0xa4dc('0x46')]=qs['sort'](_0x2e102a['query'][_0xa4dc('0x32')]);_0x3d5ee0['where']=qs[_0xa4dc('0x35')](_[_0xa4dc('0x34')](_0x2e102a[_0xa4dc('0x2c')],_0x171a54['filters']));if(_0x2e102a['query']['filter']){_0x3d5ee0[_0xa4dc('0x33')]=_['merge'](_0x3d5ee0[_0xa4dc('0x33')],{'$or':_[_0xa4dc('0x26')](_0x3d5ee0[_0xa4dc('0x2f')],function(_0x33582a){var _0xb390d7={};_0xb390d7[_0x33582a]={'$like':'%'+_0x2e102a[_0xa4dc('0x2c')][_0xa4dc('0x36')]+'%'};return _0xb390d7;})});}_0x3d5ee0=_[_0xa4dc('0x37')]({},_0x3d5ee0,_0x2e102a[_0xa4dc('0x38')]);return _0x5d1d34[_0xa4dc('0x49')](_0x3d5ee0);}})[_0xa4dc('0x22')](function(_0x360c97){if(_0x360c97){_0x3299a7=_0x360c97[_0xa4dc('0x30')];if(!_0x2e102a[_0xa4dc('0x2c')][_0xa4dc('0x4a')](_0xa4dc('0x31'))){_0x3d5ee0[_0xa4dc('0x1c')]=qs[_0xa4dc('0x1c')](_0x2e102a[_0xa4dc('0x2c')][_0xa4dc('0x1c')]);_0x3d5ee0['offset']=qs[_0xa4dc('0x1f')](_0x2e102a[_0xa4dc('0x2c')][_0xa4dc('0x1f')]);}return _0x5d1d34[_0xa4dc('0x49')](_0x3d5ee0);}})[_0xa4dc('0x22')](function(_0x3db2d8){if(_0x3db2d8){return _0x3db2d8?{'count':_0x3299a7,'rows':_0x3db2d8}:null;}})['then'](respondWithResult(_0x1f3ee3,null))['catch'](handleError(_0x1f3ee3,null));};exports['getDescriptions']=function(_0x2c2af4,_0x49d58e,_0x3b770c){var _0x3d1f6f={};var _0x671f45={};var _0xdc3c7;var _0x250dd6;return db[_0xa4dc('0x27')][_0xa4dc('0x48')]({'where':{'id':_0x2c2af4['params']['id']}})[_0xa4dc('0x22')](handleEntityNotFound(_0x49d58e,null))[_0xa4dc('0x22')](function(_0x350b80){if(_0x350b80){_0xdc3c7=_0x350b80;_0x671f45[_0xa4dc('0x2b')]=_['keys'](db[_0xa4dc('0x44')][_0xa4dc('0x45')]);_0x671f45[_0xa4dc('0x2c')]=_[_0xa4dc('0x3f')](_0x2c2af4[_0xa4dc('0x2c')]);_0x671f45[_0xa4dc('0x35')]=_['intersection'](_0x671f45[_0xa4dc('0x2b')],_0x671f45[_0xa4dc('0x2c')]);_0x3d1f6f[_0xa4dc('0x2f')]=_[_0xa4dc('0x2d')](_0x671f45[_0xa4dc('0x2b')],qs[_0xa4dc('0x2e')](_0x2c2af4[_0xa4dc('0x2c')][_0xa4dc('0x2e')]));_0x3d1f6f[_0xa4dc('0x2f')]=_0x3d1f6f[_0xa4dc('0x2f')][_0xa4dc('0x30')]?_0x3d1f6f['attributes']:_0x671f45[_0xa4dc('0x2b')];_0x3d1f6f[_0xa4dc('0x46')]=qs[_0xa4dc('0x32')](_0x2c2af4['query'][_0xa4dc('0x32')]);_0x3d1f6f['where']=qs[_0xa4dc('0x35')](_['pick'](_0x2c2af4['query'],_0x671f45['filters']));if(_0x2c2af4[_0xa4dc('0x2c')][_0xa4dc('0x36')]){_0x3d1f6f['where']=_[_0xa4dc('0x37')](_0x3d1f6f['where'],{'$or':_['map'](_0x3d1f6f[_0xa4dc('0x2f')],function(_0x4e20cd){var _0x4719b0={};_0x4719b0[_0x4e20cd]={'$like':'%'+_0x2c2af4[_0xa4dc('0x2c')]['filter']+'%'};return _0x4719b0;})});}_0x3d1f6f=_[_0xa4dc('0x37')]({},_0x3d1f6f,_0x2c2af4[_0xa4dc('0x38')]);return _0xdc3c7[_0xa4dc('0x4b')](_0x3d1f6f);}})[_0xa4dc('0x22')](function(_0x20bc06){if(_0x20bc06){_0x250dd6=_0x20bc06[_0xa4dc('0x30')];if(!_0x2c2af4[_0xa4dc('0x2c')][_0xa4dc('0x4a')](_0xa4dc('0x31'))){_0x3d1f6f[_0xa4dc('0x1c')]=qs[_0xa4dc('0x1c')](_0x2c2af4[_0xa4dc('0x2c')][_0xa4dc('0x1c')]);_0x3d1f6f['offset']=qs['offset'](_0x2c2af4[_0xa4dc('0x2c')][_0xa4dc('0x1f')]);}return _0xdc3c7[_0xa4dc('0x4b')](_0x3d1f6f);}})[_0xa4dc('0x22')](function(_0x57e7a9){if(_0x57e7a9){return _0x57e7a9?{'count':_0x250dd6,'rows':_0x57e7a9}:null;}})[_0xa4dc('0x22')](respondWithResult(_0x49d58e,null))[_0xa4dc('0x41')](handleError(_0x49d58e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7df62b7..7844afd 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 _0xb1ae=['lodash','util','../../config/logger','moment','bluebird','request-promise','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x2d0933,_0x4be835){var _0x1f76bc=function(_0x43147e){while(--_0x43147e){_0x2d0933['push'](_0x2d0933['shift']());}};_0x1f76bc(++_0x4be835);}(_0xb1ae,0x168));var _0xeb1a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xeb1a('0x0'));var util=require(_0xeb1a('0x1'));var logger=require(_0xeb1a('0x2'))('api');var moment=require(_0xeb1a('0x3'));var BPromise=require(_0xeb1a('0x4'));var rp=require(_0xeb1a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x40d3c3,_0x4ff281){return _0x40d3c3[_0xeb1a('0x6')](_0xeb1a('0x7'),attributes,{'tableName':_0xeb1a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cca=['moment','bluebird','path','rimraf','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x37bb7f,_0xe85a88){var _0x4b2572=function(_0x32a2cd){while(--_0x32a2cd){_0x37bb7f['push'](_0x37bb7f['shift']());}};_0x4b2572(++_0xe85a88);}(_0x2cca,0x152));var _0xa2cc=function(_0x45b24b,_0x3da970){_0x45b24b=_0x45b24b-0x0;var _0x24f73d=_0x2cca[_0x45b24b];return _0x24f73d;};'use strict';var _=require(_0xa2cc('0x0'));var util=require(_0xa2cc('0x1'));var logger=require(_0xa2cc('0x2'))('api');var moment=require(_0xa2cc('0x3'));var BPromise=require(_0xa2cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2cc('0x5'));var rimraf=require(_0xa2cc('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xa2cc('0x7')]=function(_0x1baf13,_0x45657d){return _0x1baf13[_0xa2cc('0x8')](_0xa2cc('0x9'),attributes,{'tableName':_0xa2cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 3608164..4ee655a 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 _0x222b=['code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x222b,0xb0));var _0xb222=function(_0x427d22,_0x358ab6){_0x427d22=_0x427d22-0x0;var _0x3217af=_0x222b[_0x427d22];return _0x3217af;};'use strict';var _=require('lodash');var util=require(_0xb222('0x0'));var moment=require(_0xb222('0x1'));var BPromise=require(_0xb222('0x2'));var rs=require(_0xb222('0x3'));var fs=require('fs');var Redis=require(_0xb222('0x4'));var db=require(_0xb222('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb222('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb222('0x7')][_0xb222('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3114f5,_0x33469a,_0x48a09e){return new BPromise(function(_0x1eb1a3,_0x2dd1e1){return client['request'](_0x3114f5,_0x48a09e)[_0xb222('0x9')](function(_0x3dd20b){logger['info'](_0xb222('0xa'),_0x33469a,_0xb222('0xb'));logger['debug'](_0xb222('0xc'),_0x33469a,'request\x20sent',JSON['stringify'](_0x3dd20b));if(_0x3dd20b[_0xb222('0xd')]){if(_0x3dd20b[_0xb222('0xd')][_0xb222('0xe')]===0x1f4){logger['error'](_0xb222('0xa'),_0x33469a,_0x3dd20b[_0xb222('0xd')][_0xb222('0xf')]);return _0x2dd1e1(_0x3dd20b[_0xb222('0xd')]['message']);}logger['error'](_0xb222('0xa'),_0x33469a,_0x3dd20b['error'][_0xb222('0xf')]);return _0x1eb1a3(_0x3dd20b[_0xb222('0xd')]['message']);}else{logger[_0xb222('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x33469a,_0xb222('0xb'));_0x1eb1a3(_0x3dd20b[_0xb222('0x11')][_0xb222('0xf')]);}})[_0xb222('0x12')](function(_0x31284a){logger[_0xb222('0xd')](_0xb222('0xa'),_0x33469a,_0x31284a);_0x2dd1e1(_0x31284a);});});} \ No newline at end of file +var _0x016a=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','util','moment','ioredis','../../mysqldb'];(function(_0x5b1a6d,_0x4c796e){var _0x231508=function(_0xc7d2a8){while(--_0xc7d2a8){_0x5b1a6d['push'](_0x5b1a6d['shift']());}};_0x231508(++_0x4c796e);}(_0x016a,0x1df));var _0xa016=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x016a[_0x3e112d];return _0x531c31;};'use strict';var _=require('lodash');var util=require(_0xa016('0x0'));var moment=require(_0xa016('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa016('0x2'));var db=require(_0xa016('0x3'))['db'];var utils=require(_0xa016('0x4'));var logger=require(_0xa016('0x5'))(_0xa016('0x6'));var config=require('../../config/environment');var jayson=require(_0xa016('0x7'));var client=jayson[_0xa016('0x8')][_0xa016('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38c1d2,_0x170369,_0x21a829){return new BPromise(function(_0x11017a,_0x223ed6){return client[_0xa016('0xa')](_0x38c1d2,_0x21a829)[_0xa016('0xb')](function(_0x4c1549){logger[_0xa016('0xc')](_0xa016('0xd'),_0x170369,'request\x20sent');logger[_0xa016('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x170369,_0xa016('0xf'),JSON[_0xa016('0x10')](_0x4c1549));if(_0x4c1549['error']){if(_0x4c1549['error'][_0xa016('0x11')]===0x1f4){logger[_0xa016('0x12')](_0xa016('0xd'),_0x170369,_0x4c1549[_0xa016('0x12')]['message']);return _0x223ed6(_0x4c1549[_0xa016('0x12')][_0xa016('0x13')]);}logger[_0xa016('0x12')](_0xa016('0xd'),_0x170369,_0x4c1549[_0xa016('0x12')]['message']);return _0x11017a(_0x4c1549[_0xa016('0x12')][_0xa016('0x13')]);}else{logger[_0xa016('0xc')](_0xa016('0xd'),_0x170369,_0xa016('0xf'));_0x11017a(_0x4c1549[_0xa016('0x14')]['message']);}})['catch'](function(_0x186a91){logger['error'](_0xa016('0xd'),_0x170369,_0x186a91);_0x223ed6(_0x186a91);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index fc7afc5..b6fdc53 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 _0x62d5=['update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','put'];(function(_0x38250f,_0x330792){var _0x4c438d=function(_0x3cd5c8){while(--_0x3cd5c8){_0x38250f['push'](_0x38250f['shift']());}};_0x4c438d(++_0x330792);}(_0x62d5,0x94));var _0x562d=function(_0x5024e1,_0x2a8d6c){_0x5024e1=_0x5024e1-0x0;var _0x394a3a=_0x62d5[_0x5024e1];return _0x394a3a;};'use strict';var multer=require(_0x562d('0x0'));var util=require(_0x562d('0x1'));var path=require(_0x562d('0x2'));var timeout=require(_0x562d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x562d('0x4'));var interaction=require(_0x562d('0x5'));var config=require(_0x562d('0x6'));var controller=require(_0x562d('0x7'));router[_0x562d('0x8')]('/',auth[_0x562d('0x9')](),controller['index']);router[_0x562d('0x8')](_0x562d('0xa'),auth[_0x562d('0x9')](),controller[_0x562d('0xb')]);router[_0x562d('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x562d('0xd')](_0x562d('0xa'),auth[_0x562d('0x9')](),controller[_0x562d('0xe')]);router[_0x562d('0xf')](_0x562d('0xa'),auth[_0x562d('0x9')](),controller[_0x562d('0x10')]);module[_0x562d('0x11')]=router; \ No newline at end of file +var _0x046c=['put','/:id','update','destroy','util','express','Router','fs-extra','../../components/auth/service','./intSalesforceField.controller','isAuthenticated','get','show'];(function(_0x160b71,_0x2ed489){var _0x32a6e1=function(_0x57c9b3){while(--_0x57c9b3){_0x160b71['push'](_0x160b71['shift']());}};_0x32a6e1(++_0x2ed489);}(_0x046c,0x13c));var _0xc046=function(_0x59b0af,_0x25942d){_0x59b0af=_0x59b0af-0x0;var _0x26f45b=_0x046c[_0x59b0af];return _0x26f45b;};'use strict';var multer=require('multer');var util=require(_0xc046('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc046('0x1'));var router=express[_0xc046('0x2')]();var fs_extra=require(_0xc046('0x3'));var auth=require(_0xc046('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc046('0x5'));router['get']('/',auth[_0xc046('0x6')](),controller['index']);router[_0xc046('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc046('0x8')]);router['post']('/',auth[_0xc046('0x6')](),controller['create']);router[_0xc046('0x9')](_0xc046('0xa'),auth['isAuthenticated'](),controller[_0xc046('0xb')]);router['delete'](_0xc046('0xa'),auth[_0xc046('0x6')](),controller[_0xc046('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 90540f3..ae68d1f 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 _0x1589=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x1589,0x13e));var _0x9158=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0x1589[_0x50a004];return _0x5e9992;};'use strict';var Sequelize=require(_0x9158('0x0'));module[_0x9158('0x1')]={'type':{'type':Sequelize[_0x9158('0x2')](_0x9158('0x3'),_0x9158('0x4'),_0x9158('0x5'),_0x9158('0x6'),'picklist'),'defaultValue':_0x9158('0x3')},'content':{'type':Sequelize[_0x9158('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9158('0x2')](_0x9158('0x3'),_0x9158('0x4'),_0x9158('0x5'))},'keyContent':{'type':Sequelize[_0x9158('0x7')]},'idField':{'type':Sequelize[_0x9158('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7b8=['customVariable','keyValue','picklist','string','STRING','exports','ENUM','variable'];(function(_0x789179,_0x455e5f){var _0x10878f=function(_0x450629){while(--_0x450629){_0x789179['push'](_0x789179['shift']());}};_0x10878f(++_0x455e5f);}(_0xb7b8,0x1cd));var _0x8b7b=function(_0x505277,_0x2336bf){_0x505277=_0x505277-0x0;var _0x411f65=_0xb7b8[_0x505277];return _0x411f65;};'use strict';var Sequelize=require('sequelize');module[_0x8b7b('0x0')]={'type':{'type':Sequelize[_0x8b7b('0x1')]('string',_0x8b7b('0x2'),_0x8b7b('0x3'),_0x8b7b('0x4'),_0x8b7b('0x5')),'defaultValue':_0x8b7b('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8b7b('0x7')]},'keyType':{'type':Sequelize[_0x8b7b('0x1')]('string',_0x8b7b('0x2'),_0x8b7b('0x3'))},'keyContent':{'type':Sequelize[_0x8b7b('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 18536fd..e991f48 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 _0x7f49=['filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','length','include','options','find','create','body','update','destroy','eml-format','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','error','stack','name','send','index','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x29881c,_0x1b3930){var _0x499851=function(_0x330857){while(--_0x330857){_0x29881c['push'](_0x29881c['shift']());}};_0x499851(++_0x1b3930);}(_0x7f49,0x17b));var _0x97f4=function(_0x2c18b4,_0x1965ed){_0x2c18b4=_0x2c18b4-0x0;var _0x1a3825=_0x7f49[_0x2c18b4];return _0x1a3825;};'use strict';var emlformat=require(_0x97f4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97f4('0x1'));var rp=require('request-promise');var moment=require(_0x97f4('0x2'));var BPromise=require(_0x97f4('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x97f4('0x4'));var sox=require('sox');var csv=require(_0x97f4('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97f4('0x6'));var _=require(_0x97f4('0x7'));var squel=require(_0x97f4('0x8'));var crypto=require(_0x97f4('0x9'));var jsforce=require(_0x97f4('0xa'));var deskjs=require(_0x97f4('0xb'));var toCsv=require(_0x97f4('0x5'));var querystring=require(_0x97f4('0xc'));var Papa=require(_0x97f4('0xd'));var Redis=require('ioredis');var authService=require(_0x97f4('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x97f4('0xf'))(_0x97f4('0x10'));var utils=require(_0x97f4('0x11'));var config=require(_0x97f4('0x12'));var licenseUtil=require(_0x97f4('0x13'));var db=require(_0x97f4('0x14'))['db'];function respondWithStatusCode(_0x4d96be,_0x3d255b){_0x3d255b=_0x3d255b||0xcc;return function(_0x48f09c){if(_0x48f09c){return _0x4d96be[_0x97f4('0x15')](_0x3d255b);}return _0x4d96be[_0x97f4('0x16')](_0x3d255b)['end']();};}function respondWithResult(_0x598e2d,_0x355bd6){_0x355bd6=_0x355bd6||0xc8;return function(_0x2efe07){if(_0x2efe07){return _0x598e2d['status'](_0x355bd6)[_0x97f4('0x17')](_0x2efe07);}};}function respondWithFilteredResult(_0x17f5a3,_0x461b3a){return function(_0x5775a9){if(_0x5775a9){var _0x40bf77=typeof _0x461b3a[_0x97f4('0x18')]==='undefined'&&typeof _0x461b3a['limit']===_0x97f4('0x19');var _0x113e19=_0x5775a9['count'];var _0x4d9fa0=_0x40bf77?0x0:_0x461b3a[_0x97f4('0x18')];var _0x78cfbc=_0x40bf77?_0x5775a9[_0x97f4('0x1a')]:_0x461b3a[_0x97f4('0x18')]+_0x461b3a[_0x97f4('0x1b')];var _0x153f71;if(_0x78cfbc>=_0x113e19){_0x78cfbc=_0x113e19;_0x153f71=0xc8;}else{_0x153f71=0xce;}_0x17f5a3[_0x97f4('0x16')](_0x153f71);return _0x17f5a3['set'](_0x97f4('0x1c'),_0x4d9fa0+'-'+_0x78cfbc+'/'+_0x113e19)[_0x97f4('0x17')](_0x5775a9);}return null;};}function patchUpdates(_0x497e44){return function(_0x1dbafb){try{jsonpatch[_0x97f4('0x1d')](_0x1dbafb,_0x497e44,!![]);}catch(_0x580bb1){return BPromise['reject'](_0x580bb1);}return _0x1dbafb[_0x97f4('0x1e')]();};}function saveUpdates(_0x5a6966,_0x97479c){return function(_0x1a5658){if(_0x1a5658){return _0x1a5658['update'](_0x5a6966)[_0x97f4('0x1f')](function(_0x4cb17a){return _0x4cb17a;});}return null;};}function removeEntity(_0x22fa8f,_0x5bac7c){return function(_0x41622d){if(_0x41622d){return _0x41622d['destroy']()[_0x97f4('0x1f')](function(){_0x22fa8f[_0x97f4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43aab3,_0xec5a8f){return function(_0x4081ae){if(!_0x4081ae){_0x43aab3[_0x97f4('0x15')](0x194);}return _0x4081ae;};}function handleError(_0x1e142e,_0x2525a0){_0x2525a0=_0x2525a0||0x1f4;return function(_0x3c698b){logger[_0x97f4('0x20')](_0x3c698b[_0x97f4('0x21')]);if(_0x3c698b[_0x97f4('0x22')]){delete _0x3c698b[_0x97f4('0x22')];}_0x1e142e[_0x97f4('0x16')](_0x2525a0)[_0x97f4('0x23')](_0x3c698b);};}exports[_0x97f4('0x24')]=function(_0x2c9513,_0x58f3a4){var _0x3ad94c={},_0x592f2d={},_0xedb5c1={'count':0x0,'rows':[]};var _0x4f666e=_[_0x97f4('0x25')](db[_0x97f4('0x26')]['rawAttributes'],function(_0x5aa897){return{'name':_0x5aa897[_0x97f4('0x27')],'type':_0x5aa897[_0x97f4('0x28')][_0x97f4('0x29')]};});_0x592f2d[_0x97f4('0x2a')]=_[_0x97f4('0x25')](_0x4f666e,_0x97f4('0x22'));_0x592f2d[_0x97f4('0x2b')]=_[_0x97f4('0x2c')](_0x2c9513[_0x97f4('0x2b')]);_0x592f2d[_0x97f4('0x2d')]=_[_0x97f4('0x2e')](_0x592f2d['model'],_0x592f2d['query']);_0x3ad94c[_0x97f4('0x2f')]=_[_0x97f4('0x2e')](_0x592f2d['model'],qs['fields'](_0x2c9513[_0x97f4('0x2b')]['fields']));_0x3ad94c[_0x97f4('0x2f')]=_0x3ad94c['attributes']['length']?_0x3ad94c[_0x97f4('0x2f')]:_0x592f2d[_0x97f4('0x2a')];if(!_0x2c9513[_0x97f4('0x2b')][_0x97f4('0x30')](_0x97f4('0x31'))){_0x3ad94c[_0x97f4('0x1b')]=qs[_0x97f4('0x1b')](_0x2c9513[_0x97f4('0x2b')][_0x97f4('0x1b')]);_0x3ad94c[_0x97f4('0x18')]=qs['offset'](_0x2c9513['query']['offset']);}_0x3ad94c[_0x97f4('0x32')]=qs[_0x97f4('0x33')](_0x2c9513[_0x97f4('0x2b')][_0x97f4('0x33')]);_0x3ad94c['where']=qs['filters'](_[_0x97f4('0x34')](_0x2c9513[_0x97f4('0x2b')],_0x592f2d[_0x97f4('0x2d')]),_0x4f666e);if(_0x2c9513[_0x97f4('0x2b')][_0x97f4('0x35')]){_0x3ad94c[_0x97f4('0x36')]=_[_0x97f4('0x37')](_0x3ad94c[_0x97f4('0x36')],{'$or':_[_0x97f4('0x25')](_0x4f666e,function(_0x392b5c){if(_0x392b5c['type']!==_0x97f4('0x38')){var _0x24914f={};_0x24914f[_0x392b5c[_0x97f4('0x22')]]={'$like':'%'+_0x2c9513[_0x97f4('0x2b')]['filter']+'%'};return _0x24914f;}})});}_0x3ad94c=_[_0x97f4('0x37')]({},_0x3ad94c,_0x2c9513['options']);var _0x38d88d={'where':_0x3ad94c[_0x97f4('0x36')]};return db['SalesforceField'][_0x97f4('0x1a')](_0x38d88d)[_0x97f4('0x1f')](function(_0x1af630){_0xedb5c1[_0x97f4('0x1a')]=_0x1af630;if(_0x2c9513[_0x97f4('0x2b')][_0x97f4('0x39')]){_0x3ad94c['include']=[{'all':!![]}];}return db[_0x97f4('0x26')][_0x97f4('0x3a')](_0x3ad94c);})[_0x97f4('0x1f')](function(_0x2e4533){_0xedb5c1[_0x97f4('0x3b')]=_0x2e4533;return _0xedb5c1;})[_0x97f4('0x1f')](respondWithFilteredResult(_0x58f3a4,_0x3ad94c))[_0x97f4('0x3c')](handleError(_0x58f3a4,null));};exports[_0x97f4('0x3d')]=function(_0x3b3047,_0x337afd){var _0x1a4145={'raw':!![],'where':{'id':_0x3b3047[_0x97f4('0x3e')]['id']}},_0xa87426={};_0xa87426[_0x97f4('0x2a')]=_[_0x97f4('0x2c')](db[_0x97f4('0x26')]['rawAttributes']);_0xa87426[_0x97f4('0x2b')]=_[_0x97f4('0x2c')](_0x3b3047['query']);_0xa87426[_0x97f4('0x2d')]=_[_0x97f4('0x2e')](_0xa87426[_0x97f4('0x2a')],_0xa87426[_0x97f4('0x2b')]);_0x1a4145['attributes']=_['intersection'](_0xa87426[_0x97f4('0x2a')],qs['fields'](_0x3b3047[_0x97f4('0x2b')][_0x97f4('0x3f')]));_0x1a4145[_0x97f4('0x2f')]=_0x1a4145[_0x97f4('0x2f')][_0x97f4('0x40')]?_0x1a4145[_0x97f4('0x2f')]:_0xa87426[_0x97f4('0x2a')];if(_0x3b3047['query'][_0x97f4('0x39')]){_0x1a4145[_0x97f4('0x41')]=[{'all':!![]}];}_0x1a4145=_[_0x97f4('0x37')]({},_0x1a4145,_0x3b3047[_0x97f4('0x42')]);return db['SalesforceField'][_0x97f4('0x43')](_0x1a4145)[_0x97f4('0x1f')](handleEntityNotFound(_0x337afd,null))[_0x97f4('0x1f')](respondWithResult(_0x337afd,null))[_0x97f4('0x3c')](handleError(_0x337afd,null));};exports[_0x97f4('0x44')]=function(_0x2de8f5,_0x80b0e0){return db[_0x97f4('0x26')]['create'](_0x2de8f5[_0x97f4('0x45')],{})['then'](respondWithResult(_0x80b0e0,0xc9))[_0x97f4('0x3c')](handleError(_0x80b0e0,null));};exports[_0x97f4('0x46')]=function(_0x130a80,_0x4ab8be){if(_0x130a80[_0x97f4('0x45')]['id']){delete _0x130a80[_0x97f4('0x45')]['id'];}return db['SalesforceField'][_0x97f4('0x43')]({'where':{'id':_0x130a80[_0x97f4('0x3e')]['id']}})[_0x97f4('0x1f')](handleEntityNotFound(_0x4ab8be,null))[_0x97f4('0x1f')](saveUpdates(_0x130a80[_0x97f4('0x45')],null))[_0x97f4('0x1f')](respondWithResult(_0x4ab8be,null))[_0x97f4('0x3c')](handleError(_0x4ab8be,null));};exports[_0x97f4('0x47')]=function(_0x33bfa7,_0x5435d9){return db[_0x97f4('0x26')]['find']({'where':{'id':_0x33bfa7[_0x97f4('0x3e')]['id']}})[_0x97f4('0x1f')](handleEntityNotFound(_0x5435d9,null))['then'](removeEntity(_0x5435d9,null))[_0x97f4('0x3c')](handleError(_0x5435d9,null));}; \ No newline at end of file +var _0x9d3e=['send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','SalesforceField','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','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','sendStatus','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject','save','then','end','error','stack','name'];(function(_0x49a4dd,_0x462954){var _0x3653e2=function(_0x308b06){while(--_0x308b06){_0x49a4dd['push'](_0x49a4dd['shift']());}};_0x3653e2(++_0x462954);}(_0x9d3e,0x19d));var _0xe9d3=function(_0x1716ae,_0x342e81){_0x1716ae=_0x1716ae-0x0;var _0x468275=_0x9d3e[_0x1716ae];return _0x468275;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9d3('0x0'));var zipdir=require(_0xe9d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9d3('0x2'));var moment=require(_0xe9d3('0x3'));var BPromise=require(_0xe9d3('0x4'));var Mustache=require(_0xe9d3('0x5'));var util=require('util');var path=require(_0xe9d3('0x6'));var sox=require(_0xe9d3('0x7'));var csv=require('to-csv');var ejs=require(_0xe9d3('0x8'));var fs=require('fs');var fs_extra=require(_0xe9d3('0x9'));var _=require(_0xe9d3('0xa'));var squel=require(_0xe9d3('0xb'));var crypto=require(_0xe9d3('0xc'));var jsforce=require(_0xe9d3('0xd'));var deskjs=require(_0xe9d3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe9d3('0xf'));var Papa=require(_0xe9d3('0x10'));var Redis=require(_0xe9d3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe9d3('0x12'));var as=require(_0xe9d3('0x13'));var hardwareService=require(_0xe9d3('0x14'));var logger=require(_0xe9d3('0x15'))(_0xe9d3('0x16'));var utils=require(_0xe9d3('0x17'));var config=require(_0xe9d3('0x18'));var licenseUtil=require(_0xe9d3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xecd527,_0x186267){_0x186267=_0x186267||0xcc;return function(_0x514a64){if(_0x514a64){return _0xecd527[_0xe9d3('0x1a')](_0x186267);}return _0xecd527['status'](_0x186267)['end']();};}function respondWithResult(_0x3f58c5,_0x4cd37d){_0x4cd37d=_0x4cd37d||0xc8;return function(_0x492fbf){if(_0x492fbf){return _0x3f58c5['status'](_0x4cd37d)[_0xe9d3('0x1b')](_0x492fbf);}};}function respondWithFilteredResult(_0x2e8cfa,_0x40b513){return function(_0x19ddee){if(_0x19ddee){var _0xf446fb=typeof _0x40b513['offset']===_0xe9d3('0x1c')&&typeof _0x40b513[_0xe9d3('0x1d')]===_0xe9d3('0x1c');var _0x2c4325=_0x19ddee['count'];var _0x2f2b57=_0xf446fb?0x0:_0x40b513[_0xe9d3('0x1e')];var _0x4dc0d7=_0xf446fb?_0x19ddee[_0xe9d3('0x1f')]:_0x40b513['offset']+_0x40b513[_0xe9d3('0x1d')];var _0x2c6d06;if(_0x4dc0d7>=_0x2c4325){_0x4dc0d7=_0x2c4325;_0x2c6d06=0xc8;}else{_0x2c6d06=0xce;}_0x2e8cfa[_0xe9d3('0x20')](_0x2c6d06);return _0x2e8cfa[_0xe9d3('0x21')](_0xe9d3('0x22'),_0x2f2b57+'-'+_0x4dc0d7+'/'+_0x2c4325)[_0xe9d3('0x1b')](_0x19ddee);}return null;};}function patchUpdates(_0x3f5543){return function(_0x1df202){try{jsonpatch[_0xe9d3('0x23')](_0x1df202,_0x3f5543,!![]);}catch(_0x2130cf){return BPromise[_0xe9d3('0x24')](_0x2130cf);}return _0x1df202[_0xe9d3('0x25')]();};}function saveUpdates(_0x14e5df,_0x4fa5d7){return function(_0xa90c93){if(_0xa90c93){return _0xa90c93['update'](_0x14e5df)['then'](function(_0x55cd0a){return _0x55cd0a;});}return null;};}function removeEntity(_0xc0d0cd,_0x53e38e){return function(_0x272a9b){if(_0x272a9b){return _0x272a9b['destroy']()[_0xe9d3('0x26')](function(){_0xc0d0cd[_0xe9d3('0x20')](0xcc)[_0xe9d3('0x27')]();});}};}function handleEntityNotFound(_0x5bffd,_0x4c65bb){return function(_0xfced71){if(!_0xfced71){_0x5bffd[_0xe9d3('0x1a')](0x194);}return _0xfced71;};}function handleError(_0x3ecace,_0x254b7d){_0x254b7d=_0x254b7d||0x1f4;return function(_0x17e03b){logger[_0xe9d3('0x28')](_0x17e03b[_0xe9d3('0x29')]);if(_0x17e03b[_0xe9d3('0x2a')]){delete _0x17e03b[_0xe9d3('0x2a')];}_0x3ecace['status'](_0x254b7d)[_0xe9d3('0x2b')](_0x17e03b);};}exports['index']=function(_0x23440b,_0x3d7c2d){var _0xc2c87={},_0x936ba6={},_0x5262be={'count':0x0,'rows':[]};var _0x1023ac=_[_0xe9d3('0x2c')](db['SalesforceField']['rawAttributes'],function(_0x3625a5){return{'name':_0x3625a5['fieldName'],'type':_0x3625a5[_0xe9d3('0x2d')][_0xe9d3('0x2e')]};});_0x936ba6[_0xe9d3('0x2f')]=_[_0xe9d3('0x2c')](_0x1023ac,_0xe9d3('0x2a'));_0x936ba6[_0xe9d3('0x30')]=_[_0xe9d3('0x31')](_0x23440b[_0xe9d3('0x30')]);_0x936ba6[_0xe9d3('0x32')]=_[_0xe9d3('0x33')](_0x936ba6[_0xe9d3('0x2f')],_0x936ba6[_0xe9d3('0x30')]);_0xc2c87[_0xe9d3('0x34')]=_[_0xe9d3('0x33')](_0x936ba6[_0xe9d3('0x2f')],qs[_0xe9d3('0x35')](_0x23440b[_0xe9d3('0x30')][_0xe9d3('0x35')]));_0xc2c87[_0xe9d3('0x34')]=_0xc2c87[_0xe9d3('0x34')][_0xe9d3('0x36')]?_0xc2c87[_0xe9d3('0x34')]:_0x936ba6[_0xe9d3('0x2f')];if(!_0x23440b[_0xe9d3('0x30')][_0xe9d3('0x37')](_0xe9d3('0x38'))){_0xc2c87[_0xe9d3('0x1d')]=qs[_0xe9d3('0x1d')](_0x23440b[_0xe9d3('0x30')]['limit']);_0xc2c87[_0xe9d3('0x1e')]=qs['offset'](_0x23440b['query'][_0xe9d3('0x1e')]);}_0xc2c87[_0xe9d3('0x39')]=qs['sort'](_0x23440b[_0xe9d3('0x30')]['sort']);_0xc2c87['where']=qs[_0xe9d3('0x32')](_[_0xe9d3('0x3a')](_0x23440b[_0xe9d3('0x30')],_0x936ba6[_0xe9d3('0x32')]),_0x1023ac);if(_0x23440b[_0xe9d3('0x30')][_0xe9d3('0x3b')]){_0xc2c87[_0xe9d3('0x3c')]=_[_0xe9d3('0x3d')](_0xc2c87[_0xe9d3('0x3c')],{'$or':_['map'](_0x1023ac,function(_0x19c962){if(_0x19c962['type']!==_0xe9d3('0x3e')){var _0x56ddb4={};_0x56ddb4[_0x19c962['name']]={'$like':'%'+_0x23440b[_0xe9d3('0x30')]['filter']+'%'};return _0x56ddb4;}})});}_0xc2c87=_['merge']({},_0xc2c87,_0x23440b[_0xe9d3('0x3f')]);var _0x5ea7b9={'where':_0xc2c87['where']};return db[_0xe9d3('0x40')][_0xe9d3('0x1f')](_0x5ea7b9)[_0xe9d3('0x26')](function(_0x26abdc){_0x5262be[_0xe9d3('0x1f')]=_0x26abdc;if(_0x23440b[_0xe9d3('0x30')][_0xe9d3('0x41')]){_0xc2c87[_0xe9d3('0x42')]=[{'all':!![]}];}return db[_0xe9d3('0x40')][_0xe9d3('0x43')](_0xc2c87);})[_0xe9d3('0x26')](function(_0x202d0a){_0x5262be[_0xe9d3('0x44')]=_0x202d0a;return _0x5262be;})[_0xe9d3('0x26')](respondWithFilteredResult(_0x3d7c2d,_0xc2c87))[_0xe9d3('0x45')](handleError(_0x3d7c2d,null));};exports[_0xe9d3('0x46')]=function(_0x95f2c,_0x45ba89){var _0x51c35f={'raw':!![],'where':{'id':_0x95f2c[_0xe9d3('0x47')]['id']}},_0x244485={};_0x244485[_0xe9d3('0x2f')]=_['keys'](db[_0xe9d3('0x40')]['rawAttributes']);_0x244485[_0xe9d3('0x30')]=_[_0xe9d3('0x31')](_0x95f2c[_0xe9d3('0x30')]);_0x244485[_0xe9d3('0x32')]=_[_0xe9d3('0x33')](_0x244485[_0xe9d3('0x2f')],_0x244485['query']);_0x51c35f[_0xe9d3('0x34')]=_[_0xe9d3('0x33')](_0x244485[_0xe9d3('0x2f')],qs[_0xe9d3('0x35')](_0x95f2c[_0xe9d3('0x30')][_0xe9d3('0x35')]));_0x51c35f[_0xe9d3('0x34')]=_0x51c35f[_0xe9d3('0x34')][_0xe9d3('0x36')]?_0x51c35f[_0xe9d3('0x34')]:_0x244485[_0xe9d3('0x2f')];if(_0x95f2c[_0xe9d3('0x30')][_0xe9d3('0x41')]){_0x51c35f[_0xe9d3('0x42')]=[{'all':!![]}];}_0x51c35f=_[_0xe9d3('0x3d')]({},_0x51c35f,_0x95f2c[_0xe9d3('0x3f')]);return db[_0xe9d3('0x40')][_0xe9d3('0x48')](_0x51c35f)['then'](handleEntityNotFound(_0x45ba89,null))[_0xe9d3('0x26')](respondWithResult(_0x45ba89,null))[_0xe9d3('0x45')](handleError(_0x45ba89,null));};exports[_0xe9d3('0x49')]=function(_0x47c25c,_0x3128e9){return db[_0xe9d3('0x40')][_0xe9d3('0x49')](_0x47c25c['body'],{})[_0xe9d3('0x26')](respondWithResult(_0x3128e9,0xc9))[_0xe9d3('0x45')](handleError(_0x3128e9,null));};exports['update']=function(_0x29c26f,_0x592b86){if(_0x29c26f[_0xe9d3('0x4a')]['id']){delete _0x29c26f['body']['id'];}return db[_0xe9d3('0x40')][_0xe9d3('0x48')]({'where':{'id':_0x29c26f[_0xe9d3('0x47')]['id']}})['then'](handleEntityNotFound(_0x592b86,null))[_0xe9d3('0x26')](saveUpdates(_0x29c26f['body'],null))[_0xe9d3('0x26')](respondWithResult(_0x592b86,null))[_0xe9d3('0x45')](handleError(_0x592b86,null));};exports[_0xe9d3('0x4b')]=function(_0x444a28,_0x490102){return db[_0xe9d3('0x40')][_0xe9d3('0x48')]({'where':{'id':_0x444a28[_0xe9d3('0x47')]['id']}})[_0xe9d3('0x26')](handleEntityNotFound(_0x490102,null))['then'](removeEntity(_0x490102,null))[_0xe9d3('0x45')](handleError(_0x490102,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index ac54a7f..67be2b5 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 _0xc1c0=['define','SalesforceField','idField','FieldId','lodash','api','moment','bluebird','path','rimraf','./intSalesforceField.attributes','exports'];(function(_0x58b880,_0x4e1ed8){var _0x322eb0=function(_0x19ed60){while(--_0x19ed60){_0x58b880['push'](_0x58b880['shift']());}};_0x322eb0(++_0x4e1ed8);}(_0xc1c0,0x1c0));var _0x0c1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c1c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c1c('0x1'));var moment=require(_0x0c1c('0x2'));var BPromise=require(_0x0c1c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c1c('0x4'));var rimraf=require(_0x0c1c('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c1c('0x6'));module[_0x0c1c('0x7')]=function(_0x57dfa2,_0xe8590e){return _0x57dfa2[_0x0c1c('0x8')](_0x0c1c('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x0c1c('0xa'),_0x0c1c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9f7=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x1156cf,_0xc26149){var _0x4648a8=function(_0x12e645){while(--_0x12e645){_0x1156cf['push'](_0x1156cf['shift']());}};_0x4648a8(++_0xc26149);}(_0xf9f7,0x87));var _0x7f9f=function(_0x14ec75,_0x56a3d4){_0x14ec75=_0x14ec75-0x0;var _0x40b9e9=_0xf9f7[_0x14ec75];return _0x40b9e9;};'use strict';var _=require(_0x7f9f('0x0'));var util=require('util');var logger=require(_0x7f9f('0x1'))('api');var moment=require(_0x7f9f('0x2'));var BPromise=require('bluebird');var rp=require(_0x7f9f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f9f('0x4'));var config=require(_0x7f9f('0x5'));var attributes=require('./intSalesforceField.attributes');module[_0x7f9f('0x6')]=function(_0x4c8405,_0x1b88d1){return _0x4c8405[_0x7f9f('0x7')](_0x7f9f('0x8'),attributes,{'tableName':_0x7f9f('0x9'),'paranoid':![],'indexes':[{'name':_0x7f9f('0xa'),'fields':[_0x7f9f('0xb'),_0x7f9f('0xc')],'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 1852885..5c0e0f7 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 _0xd7bf=['lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x2ed93a,_0x357d2c){var _0x1fc308=function(_0x17b2a9){while(--_0x17b2a9){_0x2ed93a['push'](_0x2ed93a['shift']());}};_0x1fc308(++_0x357d2c);}(_0xd7bf,0x160));var _0xfd7b=function(_0x2d0147,_0x4a9ad7){_0x2d0147=_0x2d0147-0x0;var _0x52807e=_0xd7bf[_0x2d0147];return _0x52807e;};'use strict';var _=require(_0xfd7b('0x0'));var util=require(_0xfd7b('0x1'));var moment=require(_0xfd7b('0x2'));var BPromise=require(_0xfd7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd7b('0x5'));var logger=require('../../config/logger')(_0xfd7b('0x6'));var config=require(_0xfd7b('0x7'));var jayson=require(_0xfd7b('0x8'));var client=jayson[_0xfd7b('0x9')][_0xfd7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fd86f,_0x263e58,_0x210f53){return new BPromise(function(_0x5b2d6d,_0x2c1488){return client['request'](_0x2fd86f,_0x210f53)[_0xfd7b('0xb')](function(_0x206fd0){logger[_0xfd7b('0xc')](_0xfd7b('0xd'),_0x263e58,_0xfd7b('0xe'));logger[_0xfd7b('0xf')](_0xfd7b('0x10'),_0x263e58,_0xfd7b('0xe'),JSON[_0xfd7b('0x11')](_0x206fd0));if(_0x206fd0['error']){if(_0x206fd0[_0xfd7b('0x12')]['code']===0x1f4){logger[_0xfd7b('0x12')](_0xfd7b('0xd'),_0x263e58,_0x206fd0['error'][_0xfd7b('0x13')]);return _0x2c1488(_0x206fd0['error'][_0xfd7b('0x13')]);}logger[_0xfd7b('0x12')]('SalesforceField,\x20%s,\x20%s',_0x263e58,_0x206fd0['error'][_0xfd7b('0x13')]);return _0x5b2d6d(_0x206fd0[_0xfd7b('0x12')]['message']);}else{logger['info'](_0xfd7b('0xd'),_0x263e58,'request\x20sent');_0x5b2d6d(_0x206fd0[_0xfd7b('0x14')]['message']);}})[_0xfd7b('0x15')](function(_0x355f53){logger['error'](_0xfd7b('0xd'),_0x263e58,_0x355f53);_0x2c1488(_0x355f53);});});} \ No newline at end of file +var _0x8aec=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','SalesforceField,\x20%s,\x20%s'];(function(_0x450501,_0x358d18){var _0x49bc48=function(_0xcbcabb){while(--_0xcbcabb){_0x450501['push'](_0x450501['shift']());}};_0x49bc48(++_0x358d18);}(_0x8aec,0x114));var _0xc8ae=function(_0x51341c,_0x4a473f){_0x51341c=_0x51341c-0x0;var _0x93b70b=_0x8aec[_0x51341c];return _0x93b70b;};'use strict';var _=require(_0xc8ae('0x0'));var util=require(_0xc8ae('0x1'));var moment=require(_0xc8ae('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8ae('0x3'));var db=require(_0xc8ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8ae('0x5'))(_0xc8ae('0x6'));var config=require(_0xc8ae('0x7'));var jayson=require(_0xc8ae('0x8'));var client=jayson[_0xc8ae('0x9')][_0xc8ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x248cdf,_0x518ac7,_0x3a6522){return new BPromise(function(_0x44f047,_0x55522a){return client[_0xc8ae('0xb')](_0x248cdf,_0x3a6522)[_0xc8ae('0xc')](function(_0x2f3353){logger[_0xc8ae('0xd')]('SalesforceField,\x20%s,\x20%s',_0x518ac7,_0xc8ae('0xe'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x518ac7,_0xc8ae('0xe'),JSON[_0xc8ae('0xf')](_0x2f3353));if(_0x2f3353[_0xc8ae('0x10')]){if(_0x2f3353['error']['code']===0x1f4){logger['error'](_0xc8ae('0x11'),_0x518ac7,_0x2f3353[_0xc8ae('0x10')]['message']);return _0x55522a(_0x2f3353[_0xc8ae('0x10')]['message']);}logger[_0xc8ae('0x10')](_0xc8ae('0x11'),_0x518ac7,_0x2f3353[_0xc8ae('0x10')][_0xc8ae('0x12')]);return _0x44f047(_0x2f3353[_0xc8ae('0x10')][_0xc8ae('0x12')]);}else{logger[_0xc8ae('0xd')]('SalesforceField,\x20%s,\x20%s',_0x518ac7,'request\x20sent');_0x44f047(_0x2f3353[_0xc8ae('0x13')]['message']);}})[_0xc8ae('0x14')](function(_0x1b5d29){logger['error']('SalesforceField,\x20%s,\x20%s',_0x518ac7,_0x1b5d29);_0x55522a(_0x1b5d29);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index d714edb..a2e3228 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 _0x79d8=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get'];(function(_0x59d775,_0x56522a){var _0x42cf92=function(_0x1ea47e){while(--_0x1ea47e){_0x59d775['push'](_0x59d775['shift']());}};_0x42cf92(++_0x56522a);}(_0x79d8,0x67));var _0x879d=function(_0xfce3a4,_0x14c42f){_0xfce3a4=_0xfce3a4-0x0;var _0x8b84e0=_0x79d8[_0xfce3a4];return _0x8b84e0;};'use strict';var multer=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var path=require(_0x879d('0x2'));var timeout=require(_0x879d('0x3'));var express=require('express');var router=express[_0x879d('0x4')]();var fs_extra=require(_0x879d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x879d('0x6'));var config=require(_0x879d('0x7'));var controller=require(_0x879d('0x8'));router['get']('/',auth[_0x879d('0x9')](),controller[_0x879d('0xa')]);router[_0x879d('0xb')](_0x879d('0xc'),auth['isAuthenticated'](),controller[_0x879d('0xd')]);router[_0x879d('0xb')](_0x879d('0xe'),auth[_0x879d('0x9')](),controller[_0x879d('0xf')]);router['get'](_0x879d('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x879d('0x11')]('/',auth[_0x879d('0x9')](),controller[_0x879d('0x12')]);router['post'](_0x879d('0xe'),auth[_0x879d('0x9')](),controller['addConfiguration']);router[_0x879d('0x13')](_0x879d('0xc'),auth['isAuthenticated'](),controller[_0x879d('0x14')]);router['delete'](_0x879d('0xc'),auth[_0x879d('0x9')](),controller[_0x879d('0x15')]);module[_0x879d('0x16')]=router; \ No newline at end of file +var _0xa90f=['index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xa90f,0x1a4));var _0xfa90=function(_0x4f229e,_0x1b1e6c){_0x4f229e=_0x4f229e-0x0;var _0x407c5e=_0xa90f[_0x4f229e];return _0x407c5e;};'use strict';var multer=require(_0xfa90('0x0'));var util=require(_0xfa90('0x1'));var path=require('path');var timeout=require(_0xfa90('0x2'));var express=require(_0xfa90('0x3'));var router=express[_0xfa90('0x4')]();var fs_extra=require(_0xfa90('0x5'));var auth=require(_0xfa90('0x6'));var interaction=require(_0xfa90('0x7'));var config=require(_0xfa90('0x8'));var controller=require(_0xfa90('0x9'));router[_0xfa90('0xa')]('/',auth[_0xfa90('0xb')](),controller[_0xfa90('0xc')]);router[_0xfa90('0xa')](_0xfa90('0xd'),auth['isAuthenticated'](),controller[_0xfa90('0xe')]);router[_0xfa90('0xa')]('/:id/configurations',auth[_0xfa90('0xb')](),controller[_0xfa90('0xf')]);router[_0xfa90('0xa')](_0xfa90('0x10'),auth['isAuthenticated'](),controller[_0xfa90('0x11')]);router[_0xfa90('0x12')]('/',auth[_0xfa90('0xb')](),controller['create']);router[_0xfa90('0x12')](_0xfa90('0x13'),auth[_0xfa90('0xb')](),controller[_0xfa90('0x14')]);router['put'](_0xfa90('0xd'),auth[_0xfa90('0xb')](),controller[_0xfa90('0x15')]);router[_0xfa90('0x16')]('/:id',auth[_0xfa90('0xb')](),controller[_0xfa90('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 9b61b38..b8a020a 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 _0x88cc=['username','remoteUri','sequelize','exports','STRING'];(function(_0x49523a,_0x1ec62a){var _0x3b234e=function(_0x3d25ed){while(--_0x3d25ed){_0x49523a['push'](_0x49523a['shift']());}};_0x3b234e(++_0x1ec62a);}(_0x88cc,0x98));var _0xc88c=function(_0x5ec21d,_0x5d0772){_0x5ec21d=_0x5ec21d-0x0;var _0x43bde8=_0x88cc[_0x5ec21d];return _0x43bde8;};'use strict';var Sequelize=require(_0xc88c('0x0'));module[_0xc88c('0x1')]={'name':{'type':Sequelize[_0xc88c('0x2')]},'description':{'type':Sequelize[_0xc88c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc88c('0x3')},'password':{'type':Sequelize[_0xc88c('0x2')]},'email':{'type':Sequelize[_0xc88c('0x2')]},'remoteUri':{'type':Sequelize[_0xc88c('0x2')],'unique':_0xc88c('0x4')},'serverUrl':{'type':Sequelize[_0xc88c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf580=['remoteUri','sequelize','STRING'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0xf580,0x73));var _0x0f58=function(_0x45c71,_0x4e1da2){_0x45c71=_0x45c71-0x0;var _0x4189fd=_0xf580[_0x45c71];return _0x4189fd;};'use strict';var Sequelize=require(_0x0f58('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f58('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0f58('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x0f58('0x1')]},'email':{'type':Sequelize[_0x0f58('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0f58('0x2')},'serverUrl':{'type':Sequelize[_0x0f58('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index ea05d66..9743ae0 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 _0xcd56=['short_description','close_code','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','sys_id','contact_type','incident_state','urgency','problem_id','reassignment_count','activity_due','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','username','serverUrl','remoteUri','substring','lastIndexOf','format','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','set','update','then','destroy','error','stack','name','send','index','ServicenowAccount','rawAttributes','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','rows','catch','show','fields','include','find','body','params','getConfigurations','keys','pick','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','create','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','time_worked','expected_start','opened_at','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes'];(function(_0x3a1c39,_0x2af254){var _0x28132b=function(_0x31feb6){while(--_0x31feb6){_0x3a1c39['push'](_0x3a1c39['shift']());}};_0x28132b(++_0x2af254);}(_0xcd56,0xe8));var _0x6cd5=function(_0x287948,_0x578f98){_0x287948=_0x287948-0x0;var _0x54588d=_0xcd56[_0x287948];return _0x54588d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6cd5('0x0'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cd5('0x1'));var path=require(_0x6cd5('0x2'));var sox=require(_0x6cd5('0x3'));var csv=require(_0x6cd5('0x4'));var ejs=require(_0x6cd5('0x5'));var fs=require('fs');var fs_extra=require(_0x6cd5('0x6'));var _=require(_0x6cd5('0x7'));var squel=require(_0x6cd5('0x8'));var crypto=require(_0x6cd5('0x9'));var jsforce=require(_0x6cd5('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6cd5('0xb'));var Redis=require(_0x6cd5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6cd5('0xd'));var as=require(_0x6cd5('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cd5('0xf'))('api');var utils=require(_0x6cd5('0x10'));var config=require(_0x6cd5('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cd5('0x12'))['db'];var integrations=require(_0x6cd5('0x13'));function respondWithStatusCode(_0x573fa0,_0x21f549){_0x21f549=_0x21f549||0xcc;return function(_0x4d499c){if(_0x4d499c){return _0x573fa0[_0x6cd5('0x14')](_0x21f549);}return _0x573fa0['status'](_0x21f549)[_0x6cd5('0x15')]();};}function respondWithResult(_0x49f49b,_0x5baa02){_0x5baa02=_0x5baa02||0xc8;return function(_0x5eda24){if(_0x5eda24){return _0x49f49b['status'](_0x5baa02)[_0x6cd5('0x16')](_0x5eda24);}};}function respondWithFilteredResult(_0x4d27b4,_0x4d7aeb){return function(_0x29a732){if(_0x29a732){var _0x4882a9=typeof _0x4d7aeb[_0x6cd5('0x17')]===_0x6cd5('0x18')&&typeof _0x4d7aeb['limit']==='undefined';var _0x311b5a=_0x29a732[_0x6cd5('0x19')];var _0x2a09ce=_0x4882a9?0x0:_0x4d7aeb[_0x6cd5('0x17')];var _0x5cb727=_0x4882a9?_0x29a732[_0x6cd5('0x19')]:_0x4d7aeb['offset']+_0x4d7aeb[_0x6cd5('0x1a')];var _0x47e87e;if(_0x5cb727>=_0x311b5a){_0x5cb727=_0x311b5a;_0x47e87e=0xc8;}else{_0x47e87e=0xce;}_0x4d27b4[_0x6cd5('0x1b')](_0x47e87e);return _0x4d27b4[_0x6cd5('0x1c')]('Content-Range',_0x2a09ce+'-'+_0x5cb727+'/'+_0x311b5a)[_0x6cd5('0x16')](_0x29a732);}return null;};}function patchUpdates(_0x8d8f60){return function(_0x5aea28){try{jsonpatch['apply'](_0x5aea28,_0x8d8f60,!![]);}catch(_0x56b518){return BPromise['reject'](_0x56b518);}return _0x5aea28['save']();};}function saveUpdates(_0x1592f9,_0x213704){return function(_0x3e4cd6){if(_0x3e4cd6){return _0x3e4cd6[_0x6cd5('0x1d')](_0x1592f9)[_0x6cd5('0x1e')](function(_0xc00803){return _0xc00803;});}return null;};}function removeEntity(_0x1abe47,_0x300084){return function(_0x698ae4){if(_0x698ae4){return _0x698ae4[_0x6cd5('0x1f')]()['then'](function(){_0x1abe47[_0x6cd5('0x1b')](0xcc)[_0x6cd5('0x15')]();});}};}function handleEntityNotFound(_0x519fc0,_0x4d142d){return function(_0x472c7a){if(!_0x472c7a){_0x519fc0['sendStatus'](0x194);}return _0x472c7a;};}function handleError(_0x3f308d,_0x1dccc1){_0x1dccc1=_0x1dccc1||0x1f4;return function(_0x2e5101){logger[_0x6cd5('0x20')](_0x2e5101[_0x6cd5('0x21')]);if(_0x2e5101[_0x6cd5('0x22')]){delete _0x2e5101[_0x6cd5('0x22')];}_0x3f308d['status'](_0x1dccc1)[_0x6cd5('0x23')](_0x2e5101);};}exports[_0x6cd5('0x24')]=function(_0x1335a8,_0x193feb){var _0x3989f3={},_0x305ca2={},_0x2fc964={'count':0x0,'rows':[]};var _0x195af8=_['map'](db[_0x6cd5('0x25')][_0x6cd5('0x26')],function(_0x2ced8a){return{'name':_0x2ced8a['fieldName'],'type':_0x2ced8a['type'][_0x6cd5('0x27')]};});_0x305ca2[_0x6cd5('0x28')]=_[_0x6cd5('0x29')](_0x195af8,'name');_0x305ca2[_0x6cd5('0x2a')]=_['keys'](_0x1335a8['query']);_0x305ca2[_0x6cd5('0x2b')]=_[_0x6cd5('0x2c')](_0x305ca2['model'],_0x305ca2[_0x6cd5('0x2a')]);_0x3989f3[_0x6cd5('0x2d')]=_[_0x6cd5('0x2c')](_0x305ca2[_0x6cd5('0x28')],qs['fields'](_0x1335a8[_0x6cd5('0x2a')]['fields']));_0x3989f3[_0x6cd5('0x2d')]=_0x3989f3['attributes'][_0x6cd5('0x2e')]?_0x3989f3[_0x6cd5('0x2d')]:_0x305ca2[_0x6cd5('0x28')];if(!_0x1335a8[_0x6cd5('0x2a')][_0x6cd5('0x2f')](_0x6cd5('0x30'))){_0x3989f3[_0x6cd5('0x1a')]=qs[_0x6cd5('0x1a')](_0x1335a8[_0x6cd5('0x2a')][_0x6cd5('0x1a')]);_0x3989f3[_0x6cd5('0x17')]=qs[_0x6cd5('0x17')](_0x1335a8[_0x6cd5('0x2a')][_0x6cd5('0x17')]);}_0x3989f3[_0x6cd5('0x31')]=qs[_0x6cd5('0x32')](_0x1335a8[_0x6cd5('0x2a')][_0x6cd5('0x32')]);_0x3989f3[_0x6cd5('0x33')]=qs[_0x6cd5('0x2b')](_['pick'](_0x1335a8[_0x6cd5('0x2a')],_0x305ca2['filters']),_0x195af8);if(_0x1335a8['query'][_0x6cd5('0x34')]){_0x3989f3[_0x6cd5('0x33')]=_['merge'](_0x3989f3['where'],{'$or':_[_0x6cd5('0x29')](_0x195af8,function(_0x5e8413){if(_0x5e8413[_0x6cd5('0x35')]!=='VIRTUAL'){var _0x57b77f={};_0x57b77f[_0x5e8413[_0x6cd5('0x22')]]={'$like':'%'+_0x1335a8[_0x6cd5('0x2a')]['filter']+'%'};return _0x57b77f;}})});}_0x3989f3=_[_0x6cd5('0x36')]({},_0x3989f3,_0x1335a8[_0x6cd5('0x37')]);var _0x1aaed2={'where':_0x3989f3[_0x6cd5('0x33')]};return db[_0x6cd5('0x25')][_0x6cd5('0x19')](_0x1aaed2)[_0x6cd5('0x1e')](function(_0x138121){_0x2fc964[_0x6cd5('0x19')]=_0x138121;if(_0x1335a8[_0x6cd5('0x2a')][_0x6cd5('0x38')]){_0x3989f3['include']=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x3989f3);})[_0x6cd5('0x1e')](function(_0xd32536){_0x2fc964[_0x6cd5('0x39')]=_0xd32536;return _0x2fc964;})[_0x6cd5('0x1e')](respondWithFilteredResult(_0x193feb,_0x3989f3))[_0x6cd5('0x3a')](handleError(_0x193feb,null));};exports[_0x6cd5('0x3b')]=function(_0x3423f6,_0xd35554){var _0x1e1248={'raw':![],'where':{'id':_0x3423f6['params']['id']}},_0x1d13ae={};_0x1d13ae[_0x6cd5('0x28')]=_['keys'](db[_0x6cd5('0x25')][_0x6cd5('0x26')]);_0x1d13ae['query']=_['keys'](_0x3423f6['query']);_0x1d13ae[_0x6cd5('0x2b')]=_[_0x6cd5('0x2c')](_0x1d13ae[_0x6cd5('0x28')],_0x1d13ae[_0x6cd5('0x2a')]);_0x1e1248[_0x6cd5('0x2d')]=_[_0x6cd5('0x2c')](_0x1d13ae[_0x6cd5('0x28')],qs[_0x6cd5('0x3c')](_0x3423f6['query'][_0x6cd5('0x3c')]));_0x1e1248[_0x6cd5('0x2d')]=_0x1e1248['attributes'][_0x6cd5('0x2e')]?_0x1e1248[_0x6cd5('0x2d')]:_0x1d13ae[_0x6cd5('0x28')];if(_0x3423f6[_0x6cd5('0x2a')][_0x6cd5('0x38')]){_0x1e1248[_0x6cd5('0x3d')]=[{'all':!![]}];}_0x1e1248=_[_0x6cd5('0x36')]({},_0x1e1248,_0x3423f6[_0x6cd5('0x37')]);return db[_0x6cd5('0x25')][_0x6cd5('0x3e')](_0x1e1248)[_0x6cd5('0x1e')](handleEntityNotFound(_0xd35554,null))[_0x6cd5('0x1e')](respondWithResult(_0xd35554,null))['catch'](handleError(_0xd35554,null));};exports['create']=function(_0x1561e6,_0xa917be){return db['ServicenowAccount']['create'](_0x1561e6[_0x6cd5('0x3f')],{})[_0x6cd5('0x1e')](respondWithResult(_0xa917be,0xc9))[_0x6cd5('0x3a')](handleError(_0xa917be,null));};exports[_0x6cd5('0x1d')]=function(_0x3ea07c,_0x52958d){if(_0x3ea07c[_0x6cd5('0x3f')]['id']){delete _0x3ea07c['body']['id'];}return db[_0x6cd5('0x25')]['find']({'where':{'id':_0x3ea07c[_0x6cd5('0x40')]['id']}})[_0x6cd5('0x1e')](handleEntityNotFound(_0x52958d,null))['then'](saveUpdates(_0x3ea07c['body'],null))['then'](respondWithResult(_0x52958d,null))[_0x6cd5('0x3a')](handleError(_0x52958d,null));};exports[_0x6cd5('0x1f')]=function(_0x2ae511,_0x68e10b){return db[_0x6cd5('0x25')][_0x6cd5('0x3e')]({'where':{'id':_0x2ae511[_0x6cd5('0x40')]['id']}})[_0x6cd5('0x1e')](handleEntityNotFound(_0x68e10b,null))[_0x6cd5('0x1e')](removeEntity(_0x68e10b,null))[_0x6cd5('0x3a')](handleError(_0x68e10b,null));};exports[_0x6cd5('0x41')]=function(_0x3ffeae,_0xccd91e,_0x1dac15){var _0x31faac={};var _0x4bda96={};var _0x481173;var _0xba02b1;return db[_0x6cd5('0x25')]['findOne']({'where':{'id':_0x3ffeae[_0x6cd5('0x40')]['id']}})[_0x6cd5('0x1e')](handleEntityNotFound(_0xccd91e,null))[_0x6cd5('0x1e')](function(_0x424690){if(_0x424690){_0x481173=_0x424690;_0x4bda96[_0x6cd5('0x28')]=_[_0x6cd5('0x42')](db['ServicenowConfiguration'][_0x6cd5('0x26')]);_0x4bda96['query']=_[_0x6cd5('0x42')](_0x3ffeae[_0x6cd5('0x2a')]);_0x4bda96[_0x6cd5('0x2b')]=_['intersection'](_0x4bda96[_0x6cd5('0x28')],_0x4bda96[_0x6cd5('0x2a')]);_0x31faac[_0x6cd5('0x2d')]=_['intersection'](_0x4bda96[_0x6cd5('0x28')],qs[_0x6cd5('0x3c')](_0x3ffeae[_0x6cd5('0x2a')][_0x6cd5('0x3c')]));_0x31faac[_0x6cd5('0x2d')]=_0x31faac[_0x6cd5('0x2d')][_0x6cd5('0x2e')]?_0x31faac[_0x6cd5('0x2d')]:_0x4bda96[_0x6cd5('0x28')];_0x31faac['order']=qs[_0x6cd5('0x32')](_0x3ffeae[_0x6cd5('0x2a')][_0x6cd5('0x32')]);_0x31faac[_0x6cd5('0x33')]=qs[_0x6cd5('0x2b')](_[_0x6cd5('0x43')](_0x3ffeae[_0x6cd5('0x2a')],_0x4bda96[_0x6cd5('0x2b')]));if(_0x3ffeae['query'][_0x6cd5('0x34')]){_0x31faac[_0x6cd5('0x33')]=_[_0x6cd5('0x36')](_0x31faac['where'],{'$or':_[_0x6cd5('0x29')](_0x31faac[_0x6cd5('0x2d')],function(_0x5c07f8){var _0x441e0c={};_0x441e0c[_0x5c07f8]={'$like':'%'+_0x3ffeae[_0x6cd5('0x2a')][_0x6cd5('0x34')]+'%'};return _0x441e0c;})});}_0x31faac=_[_0x6cd5('0x36')]({},_0x31faac,_0x3ffeae['options']);return _0x481173[_0x6cd5('0x41')](_0x31faac);}})[_0x6cd5('0x1e')](function(_0x1f066c){if(_0x1f066c){_0xba02b1=_0x1f066c['length'];if(!_0x3ffeae['query'][_0x6cd5('0x2f')](_0x6cd5('0x30'))){_0x31faac['limit']=qs[_0x6cd5('0x1a')](_0x3ffeae[_0x6cd5('0x2a')][_0x6cd5('0x1a')]);_0x31faac[_0x6cd5('0x17')]=qs[_0x6cd5('0x17')](_0x3ffeae[_0x6cd5('0x2a')]['offset']);}return _0x481173[_0x6cd5('0x41')](_0x31faac);}})[_0x6cd5('0x1e')](function(_0x4be402){if(_0x4be402){return _0x4be402?{'count':_0xba02b1,'rows':_0x4be402}:null;}})['then'](respondWithResult(_0xccd91e,null))[_0x6cd5('0x3a')](handleError(_0xccd91e,null));};exports['addConfiguration']=function(_0x2fd25f,_0x428df1,_0x3b0150){if(_0x2fd25f[_0x6cd5('0x3f')]['id']){delete _0x2fd25f[_0x6cd5('0x3f')]['id'];}return db[_0x6cd5('0x25')][_0x6cd5('0x44')]({'where':{'id':_0x2fd25f[_0x6cd5('0x40')]['id']}})['then'](handleEntityNotFound(_0x428df1,null))[_0x6cd5('0x1e')](function(_0x29985a){if(_0x29985a){_0x2fd25f[_0x6cd5('0x3f')][_0x6cd5('0x45')]=_0x29985a['id'];_0x2fd25f[_0x6cd5('0x3f')][_0x6cd5('0x46')]=integrations[_0x6cd5('0x47')](_0x2fd25f[_0x6cd5('0x3f')][_0x6cd5('0x48')],_0x2fd25f[_0x6cd5('0x3f')][_0x6cd5('0x35')]);_0x2fd25f[_0x6cd5('0x3f')][_0x6cd5('0x49')]=integrations['getDescriptions'](_0x2fd25f[_0x6cd5('0x3f')][_0x6cd5('0x48')],_0x2fd25f[_0x6cd5('0x3f')][_0x6cd5('0x35')]);return db['ServicenowConfiguration'][_0x6cd5('0x4a')](_0x2fd25f[_0x6cd5('0x3f')],{'include':[{'model':db[_0x6cd5('0x4b')],'as':_0x6cd5('0x46')},{'model':db['ServicenowField'],'as':_0x6cd5('0x49')}]});}return null;})[_0x6cd5('0x1e')](respondWithResult(_0x428df1,null))['catch'](handleError(_0x428df1,null));};exports[_0x6cd5('0x4c')]=function(_0x1fef48,_0x189385,_0x400ca7){var _0x58a7cf=[_0x6cd5('0x4d'),_0x6cd5('0x4e'),_0x6cd5('0x4f'),'subcategory','close_code',_0x6cd5('0x50'),'incident_state','severity',_0x6cd5('0x51')];var _0x5860bf=[_0x6cd5('0x52'),'made_sla',_0x6cd5('0x53'),_0x6cd5('0x54'),_0x6cd5('0x55'),'sys_updated_on',_0x6cd5('0x56'),'hold_reason',_0x6cd5('0x57'),_0x6cd5('0x58'),'resolved_by','sys_updated_by','opened_by',_0x6cd5('0x59'),_0x6cd5('0x5a'),_0x6cd5('0x5b'),'state',_0x6cd5('0x5c'),_0x6cd5('0x4f'),_0x6cd5('0x31'),_0x6cd5('0x5d'),_0x6cd5('0x5e'),_0x6cd5('0x5f'),_0x6cd5('0x60'),_0x6cd5('0x61'),_0x6cd5('0x62'),_0x6cd5('0x63'),'business_service',_0x6cd5('0x64'),_0x6cd5('0x65'),'rfc',_0x6cd5('0x66'),_0x6cd5('0x67'),_0x6cd5('0x68'),'business_duration','group_list',_0x6cd5('0x69'),_0x6cd5('0x6a'),_0x6cd5('0x6b'),_0x6cd5('0x6c'),_0x6cd5('0x6d'),_0x6cd5('0x6e'),_0x6cd5('0x6f'),_0x6cd5('0x70'),_0x6cd5('0x71'),'correlation_display',_0x6cd5('0x72'),_0x6cd5('0x73'),_0x6cd5('0x74'),'business_stc',_0x6cd5('0x75'),_0x6cd5('0x76'),_0x6cd5('0x77'),'notify',_0x6cd5('0x78'),_0x6cd5('0x79'),_0x6cd5('0x7a'),'follow_up','parent_incident',_0x6cd5('0x7b'),_0x6cd5('0x7c'),'reopened_by',_0x6cd5('0x7d'),_0x6cd5('0x7e'),_0x6cd5('0x7f'),'company',_0x6cd5('0x80'),_0x6cd5('0x81'),'assigned_to','severity','comments',_0x6cd5('0x82'),_0x6cd5('0x83'),_0x6cd5('0x84'),_0x6cd5('0x85'),_0x6cd5('0x86'),'reopen_count',_0x6cd5('0x87'),_0x6cd5('0x88'),_0x6cd5('0x89'),_0x6cd5('0x8a'),'location',_0x6cd5('0x51')];var _0x47ab11='';var _0x99f8ff='';var _0x36b960=[];var _0x16a16f='';var _0x16a420='';var _0x1df94e=[];var _0x8c9052='';var _0x4d9aa0='';var _0x3b4a21={};var _0x330954='';return db['ServicenowAccount'][_0x6cd5('0x44')]({'where':{'id':_0x1fef48[_0x6cd5('0x40')]['id']},'attributes':['id',_0x6cd5('0x8b'),'password','email','remoteUri',_0x6cd5('0x8c')]})[_0x6cd5('0x1e')](handleEntityNotFound(_0x189385,null))[_0x6cd5('0x1e')](function(_0x142470){if(_0x142470){_0x330954=_0x142470[_0x6cd5('0x8d')];var _0x479b58=_0x330954['slice'](-0x1);if(_0x479b58==='/'){_0x330954=_0x330954[_0x6cd5('0x8e')](0x0,_0x330954[_0x6cd5('0x8f')](_0x479b58));}_0x4d9aa0=util[_0x6cd5('0x90')]('%s/api/now/doc/table/schema/',_0x330954);_0x8c9052=util['format']('%s/api/now/table/',_0x330954);_0x3b4a21={'user':_0x142470[_0x6cd5('0x8b')],'pass':_0x142470[_0x6cd5('0x91')]};var _0x8bf647={'method':_0x6cd5('0x92'),'uri':_0x4d9aa0+_0x6cd5('0x93'),'auth':_0x3b4a21,'json':!![]};return rp(_0x8bf647);}})[_0x6cd5('0x1e')](function(_0x2306fa){if(_0x2306fa[_0x6cd5('0x94')]['length']>0x0){_0x47ab11=_0x2306fa[_0x6cd5('0x94')];}console[_0x6cd5('0x95')](_0x6cd5('0x96'),_0x47ab11);_0x1df94e=[];_0x99f8ff=Object[_0x6cd5('0x97')]([],_0x47ab11);_[_0x6cd5('0x98')](_0x99f8ff,function(_0x3b5088){return!_0x58a7cf[_0x6cd5('0x99')](_0x3b5088[_0x6cd5('0x22')]);});_0x99f8ff[_0x6cd5('0x9a')](function(_0x1a99eb){var _0x445f07=createFieldObject(_0x8c9052,_0x3b4a21,_0x1a99eb['internalType'],_0x1a99eb['name'],_0x1a99eb[_0x6cd5('0x9b')],![]);_0x1df94e[_0x6cd5('0x9c')](_0x445f07);});return Promise[_0x6cd5('0x9d')](_0x1df94e);})['then'](function(_0x5231ea){_0x36b960=_0x5231ea;_0x16a16f=Object[_0x6cd5('0x97')]([],_0x47ab11);console[_0x6cd5('0x95')](_0x6cd5('0x9e'),_0x47ab11);_[_0x6cd5('0x98')](_0x16a16f,function(_0x6a743f){return _0x5860bf['includes'](_0x6a743f[_0x6cd5('0x22')]);});console['log'](_0x6cd5('0x9f'),_0x16a16f);_0x1df94e=[];_0x16a16f[_0x6cd5('0x9a')](function(_0x25fbd8){var _0x7c72a1=createFieldObject(_0x8c9052,_0x3b4a21,_0x25fbd8[_0x6cd5('0xa0')],_0x25fbd8[_0x6cd5('0x22')],_0x25fbd8[_0x6cd5('0x9b')],!![]);_0x1df94e[_0x6cd5('0x9c')](_0x7c72a1);});return Promise[_0x6cd5('0x9d')](_0x1df94e);})[_0x6cd5('0x1e')](function(_0x547de8){_0x16a420=_0x547de8;var _0x4c56a7=_0x36b960[_0x6cd5('0xa1')](_0x16a420);return{'count':_0x4c56a7['length'],'rows':_0x4c56a7};})[_0x6cd5('0x1e')](respondWithResult(_0x189385,null))[_0x6cd5('0x3a')](function(_0x3ed7de){console[_0x6cd5('0x95')](_0x6cd5('0xa2')+_0x3ed7de);var _0xb2c6b5=_0x1fef48[_0x6cd5('0x2a')]['test']?0x1f4:_0x3ed7de[_0x6cd5('0xa3')]||0x1f4;logger['error'](_0x3ed7de[_0x6cd5('0x21')]);delete _0x3ed7de[_0x6cd5('0x22')];if(_0xb2c6b5===0x191){_0xb2c6b5=0x190;}_0x189385[_0x6cd5('0x1b')](_0xb2c6b5)[_0x6cd5('0x23')](_0x1fef48[_0x6cd5('0x2a')]['test']?{'message':_0x6cd5('0xa4'),'statusCode':_0x3ed7de[_0x6cd5('0xa3')]}:_0x3ed7de);});};function createFieldObject(_0x593122,_0x5d191f,_0x244020,_0x2244a8,_0x2c67aa,_0x1541ad){return new Promise(function(_0x523173,_0x3c6a37){var _0x3eccb4={'id':_0x2244a8,'name':_0x2c67aa,'custom':_0x1541ad};if(_0x244020==='boolean'){_0x3eccb4[_0x6cd5('0x37')]=[{'name':_0x6cd5('0xa5'),'value':_0x6cd5('0xa6')},{'name':_0x6cd5('0xa7'),'value':_0x6cd5('0xa8')}];_0x523173(_0x3eccb4);}else{var _0x4bfea9={'method':_0x6cd5('0x92'),'uri':_0x593122+_0x6cd5('0xa9')+_0x2244a8,'auth':_0x5d191f,'json':!![]};return rp(_0x4bfea9)[_0x6cd5('0x1e')](function(_0x56bdf9){var _0x4909e2=[];if(_0x56bdf9[_0x6cd5('0x94')][_0x6cd5('0x2e')]>0x0){_0x56bdf9[_0x6cd5('0x94')][_0x6cd5('0x9a')](function(_0x4b4636){if(_0x4b4636[_0x6cd5('0xaa')]==='false'){var _0x1b6940={'name':_0x4b4636['label'],'value':_0x4b4636[_0x6cd5('0xab')]};_0x4909e2['push'](_0x1b6940);}});}_0x3eccb4[_0x6cd5('0x37')]=_0x4909e2;if(_0x3eccb4[_0x6cd5('0x37')]['length']>0x0){_0x523173(_0x3eccb4);}else{if(_0x1541ad==![]){_0x523173();}else{_0x523173(_0x3eccb4);}}});}});} \ No newline at end of file +var _0x4d52=['delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','work_start','assignment_group','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','internalType','label','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','forEach','inactive','false','value','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','then','error','name','send','index','map','ServicenowAccount','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','destroy','getConfigurations','findOne','ServicenowConfiguration','rawAttributes','order','addConfiguration','Subjects','getSubjects','channel','ServicenowField','Descriptions','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x4d52,0x116));var _0x24d5=function(_0x597c3a,_0xff275e){_0x597c3a=_0x597c3a-0x0;var _0x28195f=_0x4d52[_0x597c3a];return _0x28195f;};'use strict';var emlformat=require(_0x24d5('0x0'));var rimraf=require(_0x24d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24d5('0x2'));var rp=require(_0x24d5('0x3'));var moment=require('moment');var BPromise=require(_0x24d5('0x4'));var Mustache=require(_0x24d5('0x5'));var util=require(_0x24d5('0x6'));var path=require(_0x24d5('0x7'));var sox=require(_0x24d5('0x8'));var csv=require(_0x24d5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24d5('0xa'));var _=require(_0x24d5('0xb'));var squel=require(_0x24d5('0xc'));var crypto=require(_0x24d5('0xd'));var jsforce=require(_0x24d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x24d5('0x9'));var querystring=require(_0x24d5('0xf'));var Papa=require(_0x24d5('0x10'));var Redis=require('ioredis');var authService=require(_0x24d5('0x11'));var qs=require(_0x24d5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24d5('0x13'));var logger=require(_0x24d5('0x14'))(_0x24d5('0x15'));var utils=require(_0x24d5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x24d5('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x24d5('0x18'));function respondWithStatusCode(_0x4b1df6,_0x349cab){_0x349cab=_0x349cab||0xcc;return function(_0x5bbfb8){if(_0x5bbfb8){return _0x4b1df6[_0x24d5('0x19')](_0x349cab);}return _0x4b1df6[_0x24d5('0x1a')](_0x349cab)[_0x24d5('0x1b')]();};}function respondWithResult(_0x183684,_0xff6b5d){_0xff6b5d=_0xff6b5d||0xc8;return function(_0x4dcf12){if(_0x4dcf12){return _0x183684[_0x24d5('0x1a')](_0xff6b5d)[_0x24d5('0x1c')](_0x4dcf12);}};}function respondWithFilteredResult(_0x4d1a11,_0x3cae3e){return function(_0x45f9c1){if(_0x45f9c1){var _0x426d34=typeof _0x3cae3e[_0x24d5('0x1d')]===_0x24d5('0x1e')&&typeof _0x3cae3e[_0x24d5('0x1f')]===_0x24d5('0x1e');var _0x16b160=_0x45f9c1['count'];var _0x5e8493=_0x426d34?0x0:_0x3cae3e[_0x24d5('0x1d')];var _0x25eeda=_0x426d34?_0x45f9c1['count']:_0x3cae3e[_0x24d5('0x1d')]+_0x3cae3e['limit'];var _0x57d325;if(_0x25eeda>=_0x16b160){_0x25eeda=_0x16b160;_0x57d325=0xc8;}else{_0x57d325=0xce;}_0x4d1a11[_0x24d5('0x1a')](_0x57d325);return _0x4d1a11[_0x24d5('0x20')](_0x24d5('0x21'),_0x5e8493+'-'+_0x25eeda+'/'+_0x16b160)[_0x24d5('0x1c')](_0x45f9c1);}return null;};}function patchUpdates(_0x27406d){return function(_0x1b2bcd){try{jsonpatch[_0x24d5('0x22')](_0x1b2bcd,_0x27406d,!![]);}catch(_0x20e14c){return BPromise['reject'](_0x20e14c);}return _0x1b2bcd[_0x24d5('0x23')]();};}function saveUpdates(_0x4d3930,_0x24429a){return function(_0x498c77){if(_0x498c77){return _0x498c77['update'](_0x4d3930)[_0x24d5('0x24')](function(_0x141f67){return _0x141f67;});}return null;};}function removeEntity(_0x441d65,_0x4c2063){return function(_0x2624ee){if(_0x2624ee){return _0x2624ee['destroy']()[_0x24d5('0x24')](function(){_0x441d65['status'](0xcc)[_0x24d5('0x1b')]();});}};}function handleEntityNotFound(_0xaa2c24,_0x1ba595){return function(_0x34b13f){if(!_0x34b13f){_0xaa2c24[_0x24d5('0x19')](0x194);}return _0x34b13f;};}function handleError(_0x138578,_0x5e0dc9){_0x5e0dc9=_0x5e0dc9||0x1f4;return function(_0x41d90d){logger[_0x24d5('0x25')](_0x41d90d['stack']);if(_0x41d90d[_0x24d5('0x26')]){delete _0x41d90d[_0x24d5('0x26')];}_0x138578[_0x24d5('0x1a')](_0x5e0dc9)[_0x24d5('0x27')](_0x41d90d);};}exports[_0x24d5('0x28')]=function(_0x382160,_0x1421ca){var _0xa284c3={},_0x242e38={},_0x2e6977={'count':0x0,'rows':[]};var _0x21e001=_[_0x24d5('0x29')](db[_0x24d5('0x2a')]['rawAttributes'],function(_0x2e250f){return{'name':_0x2e250f[_0x24d5('0x2b')],'type':_0x2e250f[_0x24d5('0x2c')][_0x24d5('0x2d')]};});_0x242e38['model']=_[_0x24d5('0x29')](_0x21e001,'name');_0x242e38[_0x24d5('0x2e')]=_['keys'](_0x382160[_0x24d5('0x2e')]);_0x242e38['filters']=_[_0x24d5('0x2f')](_0x242e38[_0x24d5('0x30')],_0x242e38[_0x24d5('0x2e')]);_0xa284c3['attributes']=_[_0x24d5('0x2f')](_0x242e38[_0x24d5('0x30')],qs['fields'](_0x382160[_0x24d5('0x2e')][_0x24d5('0x31')]));_0xa284c3[_0x24d5('0x32')]=_0xa284c3['attributes'][_0x24d5('0x33')]?_0xa284c3[_0x24d5('0x32')]:_0x242e38['model'];if(!_0x382160['query'][_0x24d5('0x34')](_0x24d5('0x35'))){_0xa284c3[_0x24d5('0x1f')]=qs[_0x24d5('0x1f')](_0x382160['query'][_0x24d5('0x1f')]);_0xa284c3['offset']=qs['offset'](_0x382160[_0x24d5('0x2e')][_0x24d5('0x1d')]);}_0xa284c3['order']=qs[_0x24d5('0x36')](_0x382160[_0x24d5('0x2e')]['sort']);_0xa284c3[_0x24d5('0x37')]=qs[_0x24d5('0x38')](_[_0x24d5('0x39')](_0x382160[_0x24d5('0x2e')],_0x242e38[_0x24d5('0x38')]),_0x21e001);if(_0x382160[_0x24d5('0x2e')]['filter']){_0xa284c3['where']=_['merge'](_0xa284c3[_0x24d5('0x37')],{'$or':_[_0x24d5('0x29')](_0x21e001,function(_0x4b0696){if(_0x4b0696['type']!=='VIRTUAL'){var _0x545e37={};_0x545e37[_0x4b0696[_0x24d5('0x26')]]={'$like':'%'+_0x382160[_0x24d5('0x2e')][_0x24d5('0x3a')]+'%'};return _0x545e37;}})});}_0xa284c3=_[_0x24d5('0x3b')]({},_0xa284c3,_0x382160[_0x24d5('0x3c')]);var _0x466bd7={'where':_0xa284c3['where']};return db['ServicenowAccount'][_0x24d5('0x3d')](_0x466bd7)[_0x24d5('0x24')](function(_0x136659){_0x2e6977[_0x24d5('0x3d')]=_0x136659;if(_0x382160[_0x24d5('0x2e')][_0x24d5('0x3e')]){_0xa284c3[_0x24d5('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x24d5('0x40')](_0xa284c3);})['then'](function(_0x4b9875){_0x2e6977[_0x24d5('0x41')]=_0x4b9875;return _0x2e6977;})[_0x24d5('0x24')](respondWithFilteredResult(_0x1421ca,_0xa284c3))[_0x24d5('0x42')](handleError(_0x1421ca,null));};exports[_0x24d5('0x43')]=function(_0x1293b4,_0x472c6a){var _0x595e7e={'raw':![],'where':{'id':_0x1293b4[_0x24d5('0x44')]['id']}},_0x1e0aeb={};_0x1e0aeb[_0x24d5('0x30')]=_[_0x24d5('0x45')](db['ServicenowAccount']['rawAttributes']);_0x1e0aeb[_0x24d5('0x2e')]=_[_0x24d5('0x45')](_0x1293b4[_0x24d5('0x2e')]);_0x1e0aeb[_0x24d5('0x38')]=_[_0x24d5('0x2f')](_0x1e0aeb['model'],_0x1e0aeb[_0x24d5('0x2e')]);_0x595e7e['attributes']=_[_0x24d5('0x2f')](_0x1e0aeb[_0x24d5('0x30')],qs[_0x24d5('0x31')](_0x1293b4['query']['fields']));_0x595e7e[_0x24d5('0x32')]=_0x595e7e['attributes'][_0x24d5('0x33')]?_0x595e7e[_0x24d5('0x32')]:_0x1e0aeb[_0x24d5('0x30')];if(_0x1293b4['query'][_0x24d5('0x3e')]){_0x595e7e[_0x24d5('0x3f')]=[{'all':!![]}];}_0x595e7e=_[_0x24d5('0x3b')]({},_0x595e7e,_0x1293b4['options']);return db['ServicenowAccount'][_0x24d5('0x46')](_0x595e7e)['then'](handleEntityNotFound(_0x472c6a,null))[_0x24d5('0x24')](respondWithResult(_0x472c6a,null))[_0x24d5('0x42')](handleError(_0x472c6a,null));};exports[_0x24d5('0x47')]=function(_0x5a92e9,_0xd8d302){return db[_0x24d5('0x2a')]['create'](_0x5a92e9[_0x24d5('0x48')],{})[_0x24d5('0x24')](respondWithResult(_0xd8d302,0xc9))[_0x24d5('0x42')](handleError(_0xd8d302,null));};exports[_0x24d5('0x49')]=function(_0x23016d,_0x50de81){if(_0x23016d[_0x24d5('0x48')]['id']){delete _0x23016d[_0x24d5('0x48')]['id'];}return db[_0x24d5('0x2a')]['find']({'where':{'id':_0x23016d['params']['id']}})[_0x24d5('0x24')](handleEntityNotFound(_0x50de81,null))[_0x24d5('0x24')](saveUpdates(_0x23016d[_0x24d5('0x48')],null))[_0x24d5('0x24')](respondWithResult(_0x50de81,null))[_0x24d5('0x42')](handleError(_0x50de81,null));};exports[_0x24d5('0x4a')]=function(_0x266da5,_0x4fc3ae){return db['ServicenowAccount'][_0x24d5('0x46')]({'where':{'id':_0x266da5[_0x24d5('0x44')]['id']}})[_0x24d5('0x24')](handleEntityNotFound(_0x4fc3ae,null))[_0x24d5('0x24')](removeEntity(_0x4fc3ae,null))[_0x24d5('0x42')](handleError(_0x4fc3ae,null));};exports[_0x24d5('0x4b')]=function(_0x23c17d,_0x2ef154,_0x2ee382){var _0x5ce732={};var _0x426c1c={};var _0x5e85db;var _0x4e5bd9;return db[_0x24d5('0x2a')][_0x24d5('0x4c')]({'where':{'id':_0x23c17d[_0x24d5('0x44')]['id']}})[_0x24d5('0x24')](handleEntityNotFound(_0x2ef154,null))[_0x24d5('0x24')](function(_0x1d6b58){if(_0x1d6b58){_0x5e85db=_0x1d6b58;_0x426c1c[_0x24d5('0x30')]=_[_0x24d5('0x45')](db[_0x24d5('0x4d')][_0x24d5('0x4e')]);_0x426c1c[_0x24d5('0x2e')]=_[_0x24d5('0x45')](_0x23c17d[_0x24d5('0x2e')]);_0x426c1c['filters']=_[_0x24d5('0x2f')](_0x426c1c[_0x24d5('0x30')],_0x426c1c[_0x24d5('0x2e')]);_0x5ce732['attributes']=_[_0x24d5('0x2f')](_0x426c1c[_0x24d5('0x30')],qs[_0x24d5('0x31')](_0x23c17d['query'][_0x24d5('0x31')]));_0x5ce732['attributes']=_0x5ce732[_0x24d5('0x32')][_0x24d5('0x33')]?_0x5ce732[_0x24d5('0x32')]:_0x426c1c[_0x24d5('0x30')];_0x5ce732[_0x24d5('0x4f')]=qs[_0x24d5('0x36')](_0x23c17d[_0x24d5('0x2e')][_0x24d5('0x36')]);_0x5ce732[_0x24d5('0x37')]=qs[_0x24d5('0x38')](_[_0x24d5('0x39')](_0x23c17d[_0x24d5('0x2e')],_0x426c1c[_0x24d5('0x38')]));if(_0x23c17d[_0x24d5('0x2e')][_0x24d5('0x3a')]){_0x5ce732[_0x24d5('0x37')]=_['merge'](_0x5ce732[_0x24d5('0x37')],{'$or':_[_0x24d5('0x29')](_0x5ce732['attributes'],function(_0x467773){var _0x3a1ab6={};_0x3a1ab6[_0x467773]={'$like':'%'+_0x23c17d[_0x24d5('0x2e')][_0x24d5('0x3a')]+'%'};return _0x3a1ab6;})});}_0x5ce732=_[_0x24d5('0x3b')]({},_0x5ce732,_0x23c17d['options']);return _0x5e85db[_0x24d5('0x4b')](_0x5ce732);}})[_0x24d5('0x24')](function(_0x33b363){if(_0x33b363){_0x4e5bd9=_0x33b363[_0x24d5('0x33')];if(!_0x23c17d[_0x24d5('0x2e')][_0x24d5('0x34')]('nolimit')){_0x5ce732[_0x24d5('0x1f')]=qs[_0x24d5('0x1f')](_0x23c17d[_0x24d5('0x2e')][_0x24d5('0x1f')]);_0x5ce732['offset']=qs['offset'](_0x23c17d[_0x24d5('0x2e')][_0x24d5('0x1d')]);}return _0x5e85db[_0x24d5('0x4b')](_0x5ce732);}})[_0x24d5('0x24')](function(_0x3362ba){if(_0x3362ba){return _0x3362ba?{'count':_0x4e5bd9,'rows':_0x3362ba}:null;}})[_0x24d5('0x24')](respondWithResult(_0x2ef154,null))[_0x24d5('0x42')](handleError(_0x2ef154,null));};exports[_0x24d5('0x50')]=function(_0x4e406d,_0x2ecd8f,_0x20861d){if(_0x4e406d[_0x24d5('0x48')]['id']){delete _0x4e406d[_0x24d5('0x48')]['id'];}return db[_0x24d5('0x2a')]['findOne']({'where':{'id':_0x4e406d[_0x24d5('0x44')]['id']}})[_0x24d5('0x24')](handleEntityNotFound(_0x2ecd8f,null))[_0x24d5('0x24')](function(_0x18333a){if(_0x18333a){_0x4e406d[_0x24d5('0x48')]['AccountId']=_0x18333a['id'];_0x4e406d[_0x24d5('0x48')][_0x24d5('0x51')]=integrations[_0x24d5('0x52')](_0x4e406d[_0x24d5('0x48')]['channel'],_0x4e406d[_0x24d5('0x48')]['type']);_0x4e406d[_0x24d5('0x48')]['Descriptions']=integrations['getDescriptions'](_0x4e406d[_0x24d5('0x48')][_0x24d5('0x53')],_0x4e406d['body'][_0x24d5('0x2c')]);return db[_0x24d5('0x4d')]['create'](_0x4e406d['body'],{'include':[{'model':db[_0x24d5('0x54')],'as':'Subjects'},{'model':db[_0x24d5('0x54')],'as':_0x24d5('0x55')}]});}return null;})[_0x24d5('0x24')](respondWithResult(_0x2ecd8f,null))[_0x24d5('0x42')](handleError(_0x2ecd8f,null));};exports['getFields']=function(_0xbb9a0c,_0x5d7a47,_0x4ee0bd){var _0x11534d=[_0x24d5('0x56'),_0x24d5('0x57'),_0x24d5('0x58'),_0x24d5('0x59'),_0x24d5('0x5a'),_0x24d5('0x5b'),_0x24d5('0x5c'),'severity',_0x24d5('0x5d')];var _0x3edaa5=[_0x24d5('0x5e'),_0x24d5('0x56'),_0x24d5('0x5f'),_0x24d5('0x60'),'upon_reject',_0x24d5('0x61'),_0x24d5('0x62'),_0x24d5('0x57'),_0x24d5('0x63'),'number','resolved_by',_0x24d5('0x64'),_0x24d5('0x65'),_0x24d5('0x66'),_0x24d5('0x67'),_0x24d5('0x68'),_0x24d5('0x69'),_0x24d5('0x6a'),_0x24d5('0x58'),_0x24d5('0x4f'),_0x24d5('0x6b'),_0x24d5('0x6c'),_0x24d5('0x6d'),_0x24d5('0x6e'),_0x24d5('0x6f'),_0x24d5('0x70'),_0x24d5('0x71'),'business_service',_0x24d5('0x72'),_0x24d5('0x73'),_0x24d5('0x74'),_0x24d5('0x75'),_0x24d5('0x76'),_0x24d5('0x77'),_0x24d5('0x78'),_0x24d5('0x79'),_0x24d5('0x7a'),_0x24d5('0x7b'),_0x24d5('0x7c'),_0x24d5('0x7d'),_0x24d5('0x7e'),'subcategory','work_notes',_0x24d5('0x7f'),_0x24d5('0x5a'),_0x24d5('0x80'),'delivery_task',_0x24d5('0x81'),_0x24d5('0x82'),'business_stc',_0x24d5('0x83'),_0x24d5('0x84'),'calendar_duration','notify',_0x24d5('0x85'),_0x24d5('0x86'),_0x24d5('0x87'),_0x24d5('0x88'),'parent_incident','sys_id',_0x24d5('0x89'),_0x24d5('0x8a'),'incident_state',_0x24d5('0x8b'),_0x24d5('0x8c'),_0x24d5('0x8d'),_0x24d5('0x8e'),_0x24d5('0x8f'),_0x24d5('0x90'),_0x24d5('0x91'),_0x24d5('0x92'),_0x24d5('0x93'),_0x24d5('0x94'),_0x24d5('0x95'),_0x24d5('0x96'),_0x24d5('0x97'),'reopen_count',_0x24d5('0x98'),_0x24d5('0x99'),_0x24d5('0x9a'),_0x24d5('0x9b'),_0x24d5('0x9c'),_0x24d5('0x5d')];var _0x280da3='';var _0xd946ae='';var _0x407f03=[];var _0x4a1070='';var _0x48e113='';var _0x5e78a7=[];var _0x17e230='';var _0x2a5171='';var _0x3f33c3={};var _0x45fbd8='';return db['ServicenowAccount']['findOne']({'where':{'id':_0xbb9a0c[_0x24d5('0x44')]['id']},'attributes':['id',_0x24d5('0x9d'),_0x24d5('0x9e'),_0x24d5('0x9f'),_0x24d5('0xa0'),_0x24d5('0xa1')]})[_0x24d5('0x24')](handleEntityNotFound(_0x5d7a47,null))['then'](function(_0x371e17){if(_0x371e17){_0x45fbd8=_0x371e17[_0x24d5('0xa0')];var _0x156000=_0x45fbd8[_0x24d5('0xa2')](-0x1);if(_0x156000==='/'){_0x45fbd8=_0x45fbd8[_0x24d5('0xa3')](0x0,_0x45fbd8[_0x24d5('0xa4')](_0x156000));}_0x2a5171=util['format'](_0x24d5('0xa5'),_0x45fbd8);_0x17e230=util[_0x24d5('0xa6')](_0x24d5('0xa7'),_0x45fbd8);_0x3f33c3={'user':_0x371e17[_0x24d5('0x9d')],'pass':_0x371e17['password']};var _0x8f42be={'method':_0x24d5('0xa8'),'uri':_0x2a5171+_0x24d5('0xa9'),'auth':_0x3f33c3,'json':!![]};return rp(_0x8f42be);}})[_0x24d5('0x24')](function(_0xfe6591){if(_0xfe6591[_0x24d5('0xaa')][_0x24d5('0x33')]>0x0){_0x280da3=_0xfe6591[_0x24d5('0xaa')];}console['log'](_0x24d5('0xab'),_0x280da3);_0x5e78a7=[];_0xd946ae=Object[_0x24d5('0xac')]([],_0x280da3);_[_0x24d5('0xad')](_0xd946ae,function(_0x369fc3){return!_0x11534d[_0x24d5('0xae')](_0x369fc3['name']);});_0xd946ae['forEach'](function(_0x465ec2){var _0x472686=createFieldObject(_0x17e230,_0x3f33c3,_0x465ec2[_0x24d5('0xaf')],_0x465ec2['name'],_0x465ec2[_0x24d5('0xb0')],![]);_0x5e78a7['push'](_0x472686);});return Promise[_0x24d5('0xb1')](_0x5e78a7);})[_0x24d5('0x24')](function(_0x251b9f){_0x407f03=_0x251b9f;_0x4a1070=Object[_0x24d5('0xac')]([],_0x280da3);console[_0x24d5('0xb2')](_0x24d5('0xb3'),_0x280da3);_[_0x24d5('0xad')](_0x4a1070,function(_0x9d870e){return _0x3edaa5[_0x24d5('0xae')](_0x9d870e['name']);});console[_0x24d5('0xb2')](_0x24d5('0xb4'),_0x4a1070);_0x5e78a7=[];_0x4a1070['forEach'](function(_0x1b8fe9){var _0x4f1ef7=createFieldObject(_0x17e230,_0x3f33c3,_0x1b8fe9[_0x24d5('0xaf')],_0x1b8fe9[_0x24d5('0x26')],_0x1b8fe9[_0x24d5('0xb0')],!![]);_0x5e78a7[_0x24d5('0xb5')](_0x4f1ef7);});return Promise[_0x24d5('0xb1')](_0x5e78a7);})[_0x24d5('0x24')](function(_0x4cc0c9){_0x48e113=_0x4cc0c9;var _0x29c7b3=_0x407f03[_0x24d5('0xb6')](_0x48e113);return{'count':_0x29c7b3[_0x24d5('0x33')],'rows':_0x29c7b3};})[_0x24d5('0x24')](respondWithResult(_0x5d7a47,null))[_0x24d5('0x42')](function(_0x4189db){console[_0x24d5('0xb2')](_0x24d5('0xb7')+_0x4189db);var _0x12a74a=_0xbb9a0c['query'][_0x24d5('0xb8')]?0x1f4:_0x4189db[_0x24d5('0xb9')]||0x1f4;logger[_0x24d5('0x25')](_0x4189db['stack']);delete _0x4189db[_0x24d5('0x26')];if(_0x12a74a===0x191){_0x12a74a=0x190;}_0x5d7a47['status'](_0x12a74a)[_0x24d5('0x27')](_0xbb9a0c['query'][_0x24d5('0xb8')]?{'message':'Wrong\x20credentials','statusCode':_0x4189db[_0x24d5('0xb9')]}:_0x4189db);});};function createFieldObject(_0x1fdd1e,_0x29d309,_0xe79039,_0x19d0ed,_0x25a955,_0xb7239b){return new Promise(function(_0x1fe9f4,_0x5e0a12){var _0x1dbc25={'id':_0x19d0ed,'name':_0x25a955,'custom':_0xb7239b};if(_0xe79039===_0x24d5('0xba')){_0x1dbc25[_0x24d5('0x3c')]=[{'name':_0x24d5('0xbb'),'value':_0x24d5('0xbc')},{'name':_0x24d5('0xbd'),'value':'false'}];_0x1fe9f4(_0x1dbc25);}else{var _0x3afa7e={'method':_0x24d5('0xa8'),'uri':_0x1fdd1e+'sys_choice?sysparm_query=name=incident^element='+_0x19d0ed,'auth':_0x29d309,'json':!![]};return rp(_0x3afa7e)[_0x24d5('0x24')](function(_0x5b256d){var _0x2de4ae=[];if(_0x5b256d[_0x24d5('0xaa')][_0x24d5('0x33')]>0x0){_0x5b256d['result'][_0x24d5('0xbe')](function(_0x412149){if(_0x412149[_0x24d5('0xbf')]===_0x24d5('0xc0')){var _0x377316={'name':_0x412149[_0x24d5('0xb0')],'value':_0x412149[_0x24d5('0xc1')]};_0x2de4ae['push'](_0x377316);}});}_0x1dbc25[_0x24d5('0x3c')]=_0x2de4ae;if(_0x1dbc25[_0x24d5('0x3c')]['length']>0x0){_0x1fe9f4(_0x1dbc25);}else{if(_0xb7239b==![]){_0x1fe9f4();}else{_0x1fe9f4(_0x1dbc25);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 094b27a..68594e3 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 _0x46ed=['bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment'];(function(_0x238746,_0x15a0e8){var _0x332f77=function(_0x2a2679){while(--_0x2a2679){_0x238746['push'](_0x238746['shift']());}};_0x332f77(++_0x15a0e8);}(_0x46ed,0x168));var _0xd46e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x46ed[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));var integrations=require(_0xd46e('0x8'));module[_0xd46e('0x9')]=function(_0x25cf78,_0x45e680){return _0x25cf78[_0xd46e('0xa')](_0xd46e('0xb'),attributes,{'tableName':_0xd46e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','bluebird'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0x5d58,0x187));var _0x85d5=function(_0x16119b,_0x380ad0){_0x16119b=_0x16119b-0x0;var _0xd4a204=_0x5d58[_0x16119b];return _0xd4a204;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'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 5fcf124..4382ce2 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 _0x84b5=['raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','GetServicenowAccount','stringify','catch','ShowServicenowAccount'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x84b5,0x109));var _0x584b=function(_0x4cde00,_0x11bb2c){_0x4cde00=_0x4cde00-0x0;var _0x224049=_0x84b5[_0x4cde00];return _0x224049;};'use strict';var _=require(_0x584b('0x0'));var util=require(_0x584b('0x1'));var moment=require('moment');var BPromise=require(_0x584b('0x2'));var rs=require(_0x584b('0x3'));var fs=require('fs');var Redis=require(_0x584b('0x4'));var db=require(_0x584b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x584b('0x6'));var jayson=require(_0x584b('0x7'));var client=jayson[_0x584b('0x8')][_0x584b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc75372,_0x312109,_0x39885e){return new BPromise(function(_0x1b0a7d,_0x16a7b3){return client[_0x584b('0xa')](_0xc75372,_0x39885e)[_0x584b('0xb')](function(_0x5a9832){logger[_0x584b('0xc')](_0x584b('0xd'),_0x312109,'request\x20sent');logger[_0x584b('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x312109,_0x584b('0xf'),JSON['stringify'](_0x5a9832));if(_0x5a9832[_0x584b('0x10')]){if(_0x5a9832['error'][_0x584b('0x11')]===0x1f4){logger[_0x584b('0x10')](_0x584b('0xd'),_0x312109,_0x5a9832[_0x584b('0x10')][_0x584b('0x12')]);return _0x16a7b3(_0x5a9832[_0x584b('0x10')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x312109,_0x5a9832[_0x584b('0x10')][_0x584b('0x12')]);return _0x1b0a7d(_0x5a9832[_0x584b('0x10')][_0x584b('0x12')]);}else{logger[_0x584b('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x312109,_0x584b('0xf'));_0x1b0a7d(_0x5a9832['result']['message']);}})['catch'](function(_0x8b5f37){logger['error'](_0x584b('0xd'),_0x312109,_0x8b5f37);_0x16a7b3(_0x8b5f37);});});}exports['GetServicenowAccount']=function(_0x246714){var _0x404c98=this;return new Promise(function(_0x1506df,_0x3ecb4d){return db[_0x584b('0x13')][_0x584b('0x14')]({'raw':_0x246714[_0x584b('0x15')]?_0x246714[_0x584b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x246714[_0x584b('0x15')]?_0x246714[_0x584b('0x15')][_0x584b('0x16')]||null:null,'attributes':_0x246714[_0x584b('0x15')]?_0x246714[_0x584b('0x15')][_0x584b('0x17')]||null:null,'limit':_0x246714[_0x584b('0x15')]?_0x246714['options'][_0x584b('0x18')]||null:null,'include':_0x246714[_0x584b('0x15')]?_0x246714[_0x584b('0x15')][_0x584b('0x19')]?_[_0x584b('0x1a')](_0x246714[_0x584b('0x15')][_0x584b('0x19')],function(_0x16a36b){return{'model':db[_0x16a36b[_0x584b('0x1b')]],'as':_0x16a36b['as'],'attributes':_0x16a36b[_0x584b('0x17')],'include':_0x16a36b['include']?_[_0x584b('0x1a')](_0x16a36b[_0x584b('0x19')],function(_0x1ec1d7){return{'model':db[_0x1ec1d7[_0x584b('0x1b')]],'as':_0x1ec1d7['as'],'attributes':_0x1ec1d7['attributes'],'include':_0x1ec1d7[_0x584b('0x19')]?_[_0x584b('0x1a')](_0x1ec1d7[_0x584b('0x19')],function(_0x125785){return{'model':db[_0x125785[_0x584b('0x1b')]],'as':_0x125785['as'],'attributes':_0x125785[_0x584b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x584b('0xb')](function(_0x3ca2b5){logger[_0x584b('0xc')](_0x584b('0x1c'),_0x246714);logger['debug'](_0x584b('0x1c'),_0x246714,JSON[_0x584b('0x1d')](_0x3ca2b5));_0x1506df(_0x3ca2b5);})[_0x584b('0x1e')](function(_0x3aa8a4){logger['error'](_0x584b('0x1c'),_0x3aa8a4[_0x584b('0x12')],_0x246714);_0x3ecb4d(_0x404c98[_0x584b('0x10')](0x1f4,_0x3aa8a4[_0x584b('0x12')]));});});};exports[_0x584b('0x1f')]=function(_0x57e79c){var _0x29ab5d=this;return new Promise(function(_0x32b209,_0x4ab6e4){return db['ServicenowAccount']['find']({'raw':_0x57e79c[_0x584b('0x15')]?_0x57e79c[_0x584b('0x15')][_0x584b('0x20')]===undefined?!![]:![]:!![],'where':_0x57e79c[_0x584b('0x15')]?_0x57e79c[_0x584b('0x15')]['where']||null:null,'attributes':_0x57e79c['options']?_0x57e79c['options']['attributes']||null:null,'include':_0x57e79c[_0x584b('0x15')]?_0x57e79c[_0x584b('0x15')][_0x584b('0x19')]?_[_0x584b('0x1a')](_0x57e79c['options'][_0x584b('0x19')],function(_0x77e261){return{'model':db[_0x77e261[_0x584b('0x1b')]],'as':_0x77e261['as'],'attributes':_0x77e261['attributes'],'include':_0x77e261[_0x584b('0x19')]?_[_0x584b('0x1a')](_0x77e261[_0x584b('0x19')],function(_0x38fe8e){return{'model':db[_0x38fe8e[_0x584b('0x1b')]],'as':_0x38fe8e['as'],'attributes':_0x38fe8e[_0x584b('0x17')],'include':_0x38fe8e[_0x584b('0x19')]?_[_0x584b('0x1a')](_0x38fe8e[_0x584b('0x19')],function(_0x2fd562){return{'model':db[_0x2fd562[_0x584b('0x1b')]],'as':_0x2fd562['as'],'attributes':_0x2fd562[_0x584b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x584b('0xb')](function(_0xc58d1a){logger[_0x584b('0xc')](_0x584b('0x1f'),_0x57e79c);logger[_0x584b('0xe')]('ShowServicenowAccount',_0x57e79c,JSON['stringify'](_0xc58d1a));_0x32b209(_0xc58d1a);})[_0x584b('0x1e')](function(_0x10dbfe){logger['error'](_0x584b('0x1f'),_0x10dbfe['message'],_0x57e79c);_0x4ab6e4(_0x29ab5d['error'](0x1f4,_0x10dbfe[_0x584b('0x12')]));});});}; \ No newline at end of file +var _0x8b2b=['http','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetServicenowAccount','ServicenowAccount','options','raw','where','limit','include','map','model','attributes','catch','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8b2b,0x18b));var _0xb8b2=function(_0x4d330c,_0x95121e){_0x4d330c=_0x4d330c-0x0;var _0xd0f399=_0x8b2b[_0x4d330c];return _0xd0f399;};'use strict';var _=require(_0xb8b2('0x0'));var util=require(_0xb8b2('0x1'));var moment=require(_0xb8b2('0x2'));var BPromise=require(_0xb8b2('0x3'));var rs=require(_0xb8b2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8b2('0x5'))['db'];var utils=require(_0xb8b2('0x6'));var logger=require(_0xb8b2('0x7'))(_0xb8b2('0x8'));var config=require(_0xb8b2('0x9'));var jayson=require(_0xb8b2('0xa'));var client=jayson[_0xb8b2('0xb')][_0xb8b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f8f75,_0x241322,_0x3740ef){return new BPromise(function(_0x31a35f,_0x352387){return client[_0xb8b2('0xd')](_0x4f8f75,_0x3740ef)[_0xb8b2('0xe')](function(_0x5a48bc){logger['info'](_0xb8b2('0xf'),_0x241322,'request\x20sent');logger[_0xb8b2('0x10')](_0xb8b2('0x11'),_0x241322,_0xb8b2('0x12'),JSON[_0xb8b2('0x13')](_0x5a48bc));if(_0x5a48bc['error']){if(_0x5a48bc[_0xb8b2('0x14')][_0xb8b2('0x15')]===0x1f4){logger['error'](_0xb8b2('0xf'),_0x241322,_0x5a48bc[_0xb8b2('0x14')][_0xb8b2('0x16')]);return _0x352387(_0x5a48bc[_0xb8b2('0x14')][_0xb8b2('0x16')]);}logger[_0xb8b2('0x14')](_0xb8b2('0xf'),_0x241322,_0x5a48bc['error'][_0xb8b2('0x16')]);return _0x31a35f(_0x5a48bc['error'][_0xb8b2('0x16')]);}else{logger[_0xb8b2('0x17')](_0xb8b2('0xf'),_0x241322,'request\x20sent');_0x31a35f(_0x5a48bc['result']['message']);}})['catch'](function(_0x1edfef){logger[_0xb8b2('0x14')](_0xb8b2('0xf'),_0x241322,_0x1edfef);_0x352387(_0x1edfef);});});}exports[_0xb8b2('0x18')]=function(_0x1d7a45){var _0x1f6a78=this;return new Promise(function(_0x2c8606,_0x2cc297){return db[_0xb8b2('0x19')]['findAll']({'raw':_0x1d7a45[_0xb8b2('0x1a')]?_0x1d7a45[_0xb8b2('0x1a')][_0xb8b2('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d7a45[_0xb8b2('0x1a')]?_0x1d7a45['options'][_0xb8b2('0x1c')]||null:null,'attributes':_0x1d7a45[_0xb8b2('0x1a')]?_0x1d7a45[_0xb8b2('0x1a')]['attributes']||null:null,'limit':_0x1d7a45['options']?_0x1d7a45['options'][_0xb8b2('0x1d')]||null:null,'include':_0x1d7a45[_0xb8b2('0x1a')]?_0x1d7a45['options'][_0xb8b2('0x1e')]?_[_0xb8b2('0x1f')](_0x1d7a45['options']['include'],function(_0x46786f){return{'model':db[_0x46786f[_0xb8b2('0x20')]],'as':_0x46786f['as'],'attributes':_0x46786f[_0xb8b2('0x21')],'include':_0x46786f[_0xb8b2('0x1e')]?_[_0xb8b2('0x1f')](_0x46786f[_0xb8b2('0x1e')],function(_0x1fd643){return{'model':db[_0x1fd643[_0xb8b2('0x20')]],'as':_0x1fd643['as'],'attributes':_0x1fd643[_0xb8b2('0x21')],'include':_0x1fd643['include']?_['map'](_0x1fd643[_0xb8b2('0x1e')],function(_0x55ad5a){return{'model':db[_0x55ad5a[_0xb8b2('0x20')]],'as':_0x55ad5a['as'],'attributes':_0x55ad5a['attributes']};}):[]};}):[]};}):[]:[]})[_0xb8b2('0xe')](function(_0x47211b){logger[_0xb8b2('0x17')](_0xb8b2('0x18'),_0x1d7a45);logger[_0xb8b2('0x10')](_0xb8b2('0x18'),_0x1d7a45,JSON[_0xb8b2('0x13')](_0x47211b));_0x2c8606(_0x47211b);})[_0xb8b2('0x22')](function(_0x5982b0){logger[_0xb8b2('0x14')](_0xb8b2('0x18'),_0x5982b0['message'],_0x1d7a45);_0x2cc297(_0x1f6a78[_0xb8b2('0x14')](0x1f4,_0x5982b0['message']));});});};exports[_0xb8b2('0x23')]=function(_0x43bc61){var _0x461e61=this;return new Promise(function(_0xda7b3c,_0x6b528d){return db[_0xb8b2('0x19')][_0xb8b2('0x24')]({'raw':_0x43bc61[_0xb8b2('0x1a')]?_0x43bc61[_0xb8b2('0x1a')][_0xb8b2('0x1b')]===undefined?!![]:![]:!![],'where':_0x43bc61[_0xb8b2('0x1a')]?_0x43bc61[_0xb8b2('0x1a')][_0xb8b2('0x1c')]||null:null,'attributes':_0x43bc61[_0xb8b2('0x1a')]?_0x43bc61[_0xb8b2('0x1a')]['attributes']||null:null,'include':_0x43bc61[_0xb8b2('0x1a')]?_0x43bc61[_0xb8b2('0x1a')][_0xb8b2('0x1e')]?_['map'](_0x43bc61['options'][_0xb8b2('0x1e')],function(_0x47d21b){return{'model':db[_0x47d21b['model']],'as':_0x47d21b['as'],'attributes':_0x47d21b[_0xb8b2('0x21')],'include':_0x47d21b[_0xb8b2('0x1e')]?_[_0xb8b2('0x1f')](_0x47d21b['include'],function(_0x2e289d){return{'model':db[_0x2e289d[_0xb8b2('0x20')]],'as':_0x2e289d['as'],'attributes':_0x2e289d[_0xb8b2('0x21')],'include':_0x2e289d[_0xb8b2('0x1e')]?_[_0xb8b2('0x1f')](_0x2e289d[_0xb8b2('0x1e')],function(_0x4f7c47){return{'model':db[_0x4f7c47[_0xb8b2('0x20')]],'as':_0x4f7c47['as'],'attributes':_0x4f7c47['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c2278){logger[_0xb8b2('0x17')](_0xb8b2('0x23'),_0x43bc61);logger[_0xb8b2('0x10')](_0xb8b2('0x23'),_0x43bc61,JSON[_0xb8b2('0x13')](_0x1c2278));_0xda7b3c(_0x1c2278);})[_0xb8b2('0x22')](function(_0x16b06a){logger[_0xb8b2('0x14')](_0xb8b2('0x23'),_0x16b06a[_0xb8b2('0x16')],_0x43bc61);_0x6b528d(_0x461e61[_0xb8b2('0x14')](0x1f4,_0x16b06a[_0xb8b2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 574a985..7f4391b 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 _0xa99a=['/:id/descriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x5b2c44,_0x586067){var _0x4982f5=function(_0x548877){while(--_0x548877){_0x5b2c44['push'](_0x5b2c44['shift']());}};_0x4982f5(++_0x586067);}(_0xa99a,0x177));var _0xaa99=function(_0x5a0eb,_0x461419){_0x5a0eb=_0x5a0eb-0x0;var _0x314bc7=_0xa99a[_0x5a0eb];return _0x314bc7;};'use strict';var multer=require('multer');var util=require(_0xaa99('0x0'));var path=require(_0xaa99('0x1'));var timeout=require(_0xaa99('0x2'));var express=require(_0xaa99('0x3'));var router=express['Router']();var fs_extra=require(_0xaa99('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaa99('0x5'));var controller=require(_0xaa99('0x6'));router[_0xaa99('0x7')]('/',auth[_0xaa99('0x8')](),controller[_0xaa99('0x9')]);router[_0xaa99('0x7')](_0xaa99('0xa'),auth[_0xaa99('0x8')](),controller[_0xaa99('0xb')]);router[_0xaa99('0x7')](_0xaa99('0xc'),auth[_0xaa99('0x8')](),controller[_0xaa99('0xd')]);router[_0xaa99('0x7')](_0xaa99('0xe'),auth[_0xaa99('0x8')](),controller[_0xaa99('0xf')]);router[_0xaa99('0x7')](_0xaa99('0x10'),auth[_0xaa99('0x8')](),controller['getDescriptions']);router[_0xaa99('0x11')]('/',auth[_0xaa99('0x8')](),controller['create']);router[_0xaa99('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xaa99('0x13')]);router[_0xaa99('0x14')](_0xaa99('0xa'),auth[_0xaa99('0x8')](),controller[_0xaa99('0x15')]);module[_0xaa99('0x16')]=router; \ No newline at end of file +var _0x993c=['create','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','./intServicenowConfiguration.controller','index','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x15cfcb,_0x3ec740){var _0x50b352=function(_0x15837e){while(--_0x15837e){_0x15cfcb['push'](_0x15cfcb['shift']());}};_0x50b352(++_0x3ec740);}(_0x993c,0x17f));var _0xc993=function(_0x4a06a5,_0x524b5c){_0x4a06a5=_0x4a06a5-0x0;var _0x149406=_0x993c[_0x4a06a5];return _0x149406;};'use strict';var multer=require(_0xc993('0x0'));var util=require('util');var path=require(_0xc993('0x1'));var timeout=require(_0xc993('0x2'));var express=require(_0xc993('0x3'));var router=express[_0xc993('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(_0xc993('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xc993('0x6')]);router[_0xc993('0x7')]('/:id',auth[_0xc993('0x8')](),controller[_0xc993('0x9')]);router['get'](_0xc993('0xa'),auth[_0xc993('0x8')](),controller[_0xc993('0xb')]);router[_0xc993('0x7')](_0xc993('0xc'),auth[_0xc993('0x8')](),controller[_0xc993('0xd')]);router['get'](_0xc993('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xc993('0xf')]('/',auth[_0xc993('0x8')](),controller[_0xc993('0x10')]);router[_0xc993('0x11')](_0xc993('0x12'),auth['isAuthenticated'](),controller[_0xc993('0x13')]);router['delete']('/:id',auth[_0xc993('0x8')](),controller[_0xc993('0x14')]);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 96a7874..8de94e7 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 _0xf422=['STRING','sequelize'];(function(_0x1690fb,_0x22ffcb){var _0xbec96f=function(_0x36e94b){while(--_0x36e94b){_0x1690fb['push'](_0x1690fb['shift']());}};_0xbec96f(++_0x22ffcb);}(_0xf422,0x1ad));var _0x2f42=function(_0x15850c,_0x40f81b){_0x15850c=_0x15850c-0x0;var _0x1c0a95=_0xf422[_0x15850c];return _0x1c0a95;};'use strict';var Sequelize=require(_0x2f42('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f42('0x1')]},'description':{'type':Sequelize[_0x2f42('0x1')]}}; \ No newline at end of file +var _0x7068=['sequelize','exports','STRING'];(function(_0x2b8a99,_0x1403fc){var _0x47526a=function(_0x306a27){while(--_0x306a27){_0x2b8a99['push'](_0x2b8a99['shift']());}};_0x47526a(++_0x1403fc);}(_0x7068,0x144));var _0x8706=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x7068[_0x149a9b];return _0x2c2bf6;};'use strict';var Sequelize=require(_0x8706('0x0'));module[_0x8706('0x1')]={'name':{'type':Sequelize[_0x8706('0x2')]},'description':{'type':Sequelize[_0x8706('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 5d6a5c4..e8ee7b8 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 _0x2743=['order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','findOne','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x2743,0xb6));var _0x3274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2743[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3274('0x0'));var rimraf=require(_0x3274('0x1'));var zipdir=require(_0x3274('0x2'));var jsonpatch=require(_0x3274('0x3'));var rp=require('request-promise');var moment=require(_0x3274('0x4'));var BPromise=require(_0x3274('0x5'));var Mustache=require(_0x3274('0x6'));var util=require(_0x3274('0x7'));var path=require(_0x3274('0x8'));var sox=require(_0x3274('0x9'));var csv=require(_0x3274('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3274('0xb'));var _=require(_0x3274('0xc'));var squel=require('squel');var crypto=require(_0x3274('0xd'));var jsforce=require(_0x3274('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3274('0xa'));var querystring=require('querystring');var Papa=require(_0x3274('0xf'));var Redis=require('ioredis');var authService=require(_0x3274('0x10'));var qs=require(_0x3274('0x11'));var as=require(_0x3274('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3274('0x13'))(_0x3274('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3274('0x15'));var db=require(_0x3274('0x16'))['db'];function respondWithStatusCode(_0x5c6421,_0x7296c6){_0x7296c6=_0x7296c6||0xcc;return function(_0x2b81f6){if(_0x2b81f6){return _0x5c6421[_0x3274('0x17')](_0x7296c6);}return _0x5c6421['status'](_0x7296c6)[_0x3274('0x18')]();};}function respondWithResult(_0x50b9f4,_0xa9bc39){_0xa9bc39=_0xa9bc39||0xc8;return function(_0x2c6431){if(_0x2c6431){return _0x50b9f4[_0x3274('0x19')](_0xa9bc39)['json'](_0x2c6431);}};}function respondWithFilteredResult(_0xc38425,_0x47ee8f){return function(_0x3cefd5){if(_0x3cefd5){var _0x531bb8=typeof _0x47ee8f[_0x3274('0x1a')]===_0x3274('0x1b')&&typeof _0x47ee8f[_0x3274('0x1c')]===_0x3274('0x1b');var _0x51d047=_0x3cefd5[_0x3274('0x1d')];var _0x4d6c20=_0x531bb8?0x0:_0x47ee8f['offset'];var _0x8f5f5=_0x531bb8?_0x3cefd5[_0x3274('0x1d')]:_0x47ee8f['offset']+_0x47ee8f['limit'];var _0x43f46e;if(_0x8f5f5>=_0x51d047){_0x8f5f5=_0x51d047;_0x43f46e=0xc8;}else{_0x43f46e=0xce;}_0xc38425[_0x3274('0x19')](_0x43f46e);return _0xc38425[_0x3274('0x1e')](_0x3274('0x1f'),_0x4d6c20+'-'+_0x8f5f5+'/'+_0x51d047)['json'](_0x3cefd5);}return null;};}function patchUpdates(_0x442294){return function(_0x520c69){try{jsonpatch[_0x3274('0x20')](_0x520c69,_0x442294,!![]);}catch(_0x289e1a){return BPromise[_0x3274('0x21')](_0x289e1a);}return _0x520c69[_0x3274('0x22')]();};}function saveUpdates(_0x596f10,_0x36b83d){return function(_0x9a3f9b){if(_0x9a3f9b){return _0x9a3f9b[_0x3274('0x23')](_0x596f10)[_0x3274('0x24')](function(_0x1f03ac){return _0x1f03ac;});}return null;};}function removeEntity(_0x6910bc,_0x439e4c){return function(_0x3a7e4e){if(_0x3a7e4e){return _0x3a7e4e['destroy']()[_0x3274('0x24')](function(){_0x6910bc[_0x3274('0x19')](0xcc)[_0x3274('0x18')]();});}};}function handleEntityNotFound(_0x41420a,_0x561dea){return function(_0x2c686c){if(!_0x2c686c){_0x41420a['sendStatus'](0x194);}return _0x2c686c;};}function handleError(_0x3b4174,_0x2f35d1){_0x2f35d1=_0x2f35d1||0x1f4;return function(_0xa20739){logger[_0x3274('0x25')](_0xa20739[_0x3274('0x26')]);if(_0xa20739[_0x3274('0x27')]){delete _0xa20739[_0x3274('0x27')];}_0x3b4174[_0x3274('0x19')](_0x2f35d1)[_0x3274('0x28')](_0xa20739);};}exports[_0x3274('0x29')]=function(_0x569928,_0x43aee8){var _0x38d18d={},_0xb7cfae={},_0x177210={'count':0x0,'rows':[]};var _0x92c0ec=_['map'](db[_0x3274('0x2a')][_0x3274('0x2b')],function(_0x2bc608){return{'name':_0x2bc608[_0x3274('0x2c')],'type':_0x2bc608[_0x3274('0x2d')][_0x3274('0x2e')]};});_0xb7cfae['model']=_[_0x3274('0x2f')](_0x92c0ec,_0x3274('0x27'));_0xb7cfae[_0x3274('0x30')]=_[_0x3274('0x31')](_0x569928['query']);_0xb7cfae[_0x3274('0x32')]=_[_0x3274('0x33')](_0xb7cfae[_0x3274('0x34')],_0xb7cfae[_0x3274('0x30')]);_0x38d18d[_0x3274('0x35')]=_[_0x3274('0x33')](_0xb7cfae[_0x3274('0x34')],qs[_0x3274('0x36')](_0x569928[_0x3274('0x30')]['fields']));_0x38d18d[_0x3274('0x35')]=_0x38d18d[_0x3274('0x35')][_0x3274('0x37')]?_0x38d18d[_0x3274('0x35')]:_0xb7cfae[_0x3274('0x34')];if(!_0x569928[_0x3274('0x30')][_0x3274('0x38')](_0x3274('0x39'))){_0x38d18d['limit']=qs[_0x3274('0x1c')](_0x569928[_0x3274('0x30')][_0x3274('0x1c')]);_0x38d18d[_0x3274('0x1a')]=qs[_0x3274('0x1a')](_0x569928[_0x3274('0x30')][_0x3274('0x1a')]);}_0x38d18d[_0x3274('0x3a')]=qs[_0x3274('0x3b')](_0x569928[_0x3274('0x30')][_0x3274('0x3b')]);_0x38d18d[_0x3274('0x3c')]=qs['filters'](_['pick'](_0x569928['query'],_0xb7cfae[_0x3274('0x32')]),_0x92c0ec);if(_0x569928[_0x3274('0x30')][_0x3274('0x3d')]){_0x38d18d[_0x3274('0x3c')]=_['merge'](_0x38d18d['where'],{'$or':_[_0x3274('0x2f')](_0x92c0ec,function(_0x3c5b39){if(_0x3c5b39['type']!==_0x3274('0x3e')){var _0x41b29f={};_0x41b29f[_0x3c5b39[_0x3274('0x27')]]={'$like':'%'+_0x569928[_0x3274('0x30')][_0x3274('0x3d')]+'%'};return _0x41b29f;}})});}_0x38d18d=_[_0x3274('0x3f')]({},_0x38d18d,_0x569928[_0x3274('0x40')]);var _0x10f7d7={'where':_0x38d18d[_0x3274('0x3c')]};return db[_0x3274('0x2a')][_0x3274('0x1d')](_0x10f7d7)[_0x3274('0x24')](function(_0x4472e5){_0x177210[_0x3274('0x1d')]=_0x4472e5;if(_0x569928[_0x3274('0x30')][_0x3274('0x41')]){_0x38d18d[_0x3274('0x42')]=[{'all':!![]}];}return db[_0x3274('0x2a')][_0x3274('0x43')](_0x38d18d);})[_0x3274('0x24')](function(_0x5525c1){_0x177210[_0x3274('0x44')]=_0x5525c1;return _0x177210;})[_0x3274('0x24')](respondWithFilteredResult(_0x43aee8,_0x38d18d))['catch'](handleError(_0x43aee8,null));};exports[_0x3274('0x45')]=function(_0x3bc582,_0x5d1e06){var _0x3f0cf4={'raw':![],'where':{'id':_0x3bc582[_0x3274('0x46')]['id']}},_0x3938a7={};_0x3938a7[_0x3274('0x34')]=_['keys'](db['ServicenowConfiguration'][_0x3274('0x2b')]);_0x3938a7[_0x3274('0x30')]=_[_0x3274('0x31')](_0x3bc582['query']);_0x3938a7['filters']=_['intersection'](_0x3938a7['model'],_0x3938a7[_0x3274('0x30')]);_0x3f0cf4[_0x3274('0x35')]=_['intersection'](_0x3938a7[_0x3274('0x34')],qs[_0x3274('0x36')](_0x3bc582[_0x3274('0x30')][_0x3274('0x36')]));_0x3f0cf4[_0x3274('0x35')]=_0x3f0cf4['attributes'][_0x3274('0x37')]?_0x3f0cf4[_0x3274('0x35')]:_0x3938a7[_0x3274('0x34')];if(_0x3bc582[_0x3274('0x30')][_0x3274('0x41')]){_0x3f0cf4['include']=[{'all':!![]}];}_0x3f0cf4=_[_0x3274('0x3f')]({},_0x3f0cf4,_0x3bc582['options']);return db[_0x3274('0x2a')]['find'](_0x3f0cf4)[_0x3274('0x24')](handleEntityNotFound(_0x5d1e06,null))[_0x3274('0x24')](respondWithResult(_0x5d1e06,null))['catch'](handleError(_0x5d1e06,null));};exports[_0x3274('0x47')]=function(_0x3949dd,_0x496d64){return db['ServicenowConfiguration'][_0x3274('0x47')](_0x3949dd[_0x3274('0x48')],{})[_0x3274('0x24')](respondWithResult(_0x496d64,0xc9))[_0x3274('0x49')](handleError(_0x496d64,null));};exports['update']=function(_0x589d2a,_0x30a19c){if(_0x589d2a[_0x3274('0x48')]['id']){delete _0x589d2a[_0x3274('0x48')]['id'];}return db[_0x3274('0x2a')][_0x3274('0x4a')]({'where':{'id':_0x589d2a[_0x3274('0x46')]['id']}})[_0x3274('0x24')](handleEntityNotFound(_0x30a19c,null))[_0x3274('0x24')](saveUpdates(_0x589d2a[_0x3274('0x48')],null))[_0x3274('0x24')](respondWithResult(_0x30a19c,null))[_0x3274('0x49')](handleError(_0x30a19c,null));};exports['destroy']=function(_0x5f3d72,_0x34a5ad){return db['ServicenowConfiguration'][_0x3274('0x4a')]({'where':{'id':_0x5f3d72[_0x3274('0x46')]['id']}})['then'](handleEntityNotFound(_0x34a5ad,null))['then'](removeEntity(_0x34a5ad,null))[_0x3274('0x49')](handleError(_0x34a5ad,null));};exports['getFields']=function(_0x307640,_0x22df10,_0x476754){var _0x365d85={};var _0x191841={};var _0x4a3085;var _0x146abc;return db['ServicenowConfiguration'][_0x3274('0x4b')]({'where':{'id':_0x307640[_0x3274('0x46')]['id']}})[_0x3274('0x24')](handleEntityNotFound(_0x22df10,null))[_0x3274('0x24')](function(_0x2542c9){if(_0x2542c9){_0x4a3085=_0x2542c9;_0x191841[_0x3274('0x34')]=_[_0x3274('0x31')](db['ServicenowField'][_0x3274('0x2b')]);_0x191841[_0x3274('0x30')]=_[_0x3274('0x31')](_0x307640[_0x3274('0x30')]);_0x191841[_0x3274('0x32')]=_['intersection'](_0x191841[_0x3274('0x34')],_0x191841[_0x3274('0x30')]);_0x365d85['attributes']=_[_0x3274('0x33')](_0x191841[_0x3274('0x34')],qs[_0x3274('0x36')](_0x307640[_0x3274('0x30')][_0x3274('0x36')]));_0x365d85['attributes']=_0x365d85[_0x3274('0x35')][_0x3274('0x37')]?_0x365d85[_0x3274('0x35')]:_0x191841[_0x3274('0x34')];_0x365d85[_0x3274('0x3a')]=qs[_0x3274('0x3b')](_0x307640[_0x3274('0x30')][_0x3274('0x3b')]);_0x365d85[_0x3274('0x3c')]=qs[_0x3274('0x32')](_[_0x3274('0x4c')](_0x307640[_0x3274('0x30')],_0x191841['filters']));if(_0x307640[_0x3274('0x30')][_0x3274('0x3d')]){_0x365d85['where']=_[_0x3274('0x3f')](_0x365d85['where'],{'$or':_[_0x3274('0x2f')](_0x365d85[_0x3274('0x35')],function(_0xa1406){var _0x32dc1b={};_0x32dc1b[_0xa1406]={'$like':'%'+_0x307640[_0x3274('0x30')][_0x3274('0x3d')]+'%'};return _0x32dc1b;})});}_0x365d85=_[_0x3274('0x3f')]({},_0x365d85,_0x307640[_0x3274('0x40')]);return _0x4a3085[_0x3274('0x4d')](_0x365d85);}})[_0x3274('0x24')](function(_0x468be6){if(_0x468be6){_0x146abc=_0x468be6[_0x3274('0x37')];if(!_0x307640[_0x3274('0x30')]['hasOwnProperty'](_0x3274('0x39'))){_0x365d85['limit']=qs['limit'](_0x307640['query'][_0x3274('0x1c')]);_0x365d85[_0x3274('0x1a')]=qs[_0x3274('0x1a')](_0x307640[_0x3274('0x30')]['offset']);}return _0x4a3085[_0x3274('0x4d')](_0x365d85);}})[_0x3274('0x24')](function(_0x34cc28){if(_0x34cc28){return _0x34cc28?{'count':_0x146abc,'rows':_0x34cc28}:null;}})[_0x3274('0x24')](respondWithResult(_0x22df10,null))[_0x3274('0x49')](handleError(_0x22df10,null));};exports[_0x3274('0x4e')]=function(_0xa7f39d,_0xad40fa,_0x34d4f6){var _0x3241be={};var _0x41eec0={};var _0x208195;var _0xc8bbbf;return db[_0x3274('0x2a')][_0x3274('0x4b')]({'where':{'id':_0xa7f39d[_0x3274('0x46')]['id']}})[_0x3274('0x24')](handleEntityNotFound(_0xad40fa,null))[_0x3274('0x24')](function(_0x199da3){if(_0x199da3){_0x208195=_0x199da3;_0x41eec0[_0x3274('0x34')]=_[_0x3274('0x31')](db['ServicenowField'][_0x3274('0x2b')]);_0x41eec0['query']=_['keys'](_0xa7f39d[_0x3274('0x30')]);_0x41eec0[_0x3274('0x32')]=_[_0x3274('0x33')](_0x41eec0[_0x3274('0x34')],_0x41eec0[_0x3274('0x30')]);_0x3241be[_0x3274('0x35')]=_[_0x3274('0x33')](_0x41eec0[_0x3274('0x34')],qs['fields'](_0xa7f39d[_0x3274('0x30')][_0x3274('0x36')]));_0x3241be[_0x3274('0x35')]=_0x3241be[_0x3274('0x35')][_0x3274('0x37')]?_0x3241be[_0x3274('0x35')]:_0x41eec0[_0x3274('0x34')];_0x3241be[_0x3274('0x3a')]=qs[_0x3274('0x3b')](_0xa7f39d[_0x3274('0x30')][_0x3274('0x3b')]);_0x3241be[_0x3274('0x3c')]=qs[_0x3274('0x32')](_[_0x3274('0x4c')](_0xa7f39d[_0x3274('0x30')],_0x41eec0[_0x3274('0x32')]));if(_0xa7f39d[_0x3274('0x30')]['filter']){_0x3241be['where']=_['merge'](_0x3241be['where'],{'$or':_[_0x3274('0x2f')](_0x3241be[_0x3274('0x35')],function(_0x57f986){var _0x48b18c={};_0x48b18c[_0x57f986]={'$like':'%'+_0xa7f39d[_0x3274('0x30')][_0x3274('0x3d')]+'%'};return _0x48b18c;})});}_0x3241be=_[_0x3274('0x3f')]({},_0x3241be,_0xa7f39d[_0x3274('0x40')]);return _0x208195[_0x3274('0x4e')](_0x3241be);}})[_0x3274('0x24')](function(_0x1be7a6){if(_0x1be7a6){_0xc8bbbf=_0x1be7a6[_0x3274('0x37')];if(!_0xa7f39d[_0x3274('0x30')][_0x3274('0x38')]('nolimit')){_0x3241be[_0x3274('0x1c')]=qs[_0x3274('0x1c')](_0xa7f39d[_0x3274('0x30')][_0x3274('0x1c')]);_0x3241be[_0x3274('0x1a')]=qs[_0x3274('0x1a')](_0xa7f39d[_0x3274('0x30')]['offset']);}return _0x208195['getSubjects'](_0x3241be);}})[_0x3274('0x24')](function(_0x11b2a1){if(_0x11b2a1){return _0x11b2a1?{'count':_0xc8bbbf,'rows':_0x11b2a1}:null;}})[_0x3274('0x24')](respondWithResult(_0xad40fa,null))[_0x3274('0x49')](handleError(_0xad40fa,null));};exports[_0x3274('0x4f')]=function(_0x54c41d,_0x575439,_0x1424b6){var _0x4ed980={};var _0x1952a0={};var _0x500422;var _0x5eb2d1;return db['ServicenowConfiguration'][_0x3274('0x4b')]({'where':{'id':_0x54c41d['params']['id']}})['then'](handleEntityNotFound(_0x575439,null))[_0x3274('0x24')](function(_0x4e1f04){if(_0x4e1f04){_0x500422=_0x4e1f04;_0x1952a0[_0x3274('0x34')]=_[_0x3274('0x31')](db['ServicenowField']['rawAttributes']);_0x1952a0[_0x3274('0x30')]=_[_0x3274('0x31')](_0x54c41d[_0x3274('0x30')]);_0x1952a0[_0x3274('0x32')]=_[_0x3274('0x33')](_0x1952a0[_0x3274('0x34')],_0x1952a0['query']);_0x4ed980[_0x3274('0x35')]=_[_0x3274('0x33')](_0x1952a0[_0x3274('0x34')],qs['fields'](_0x54c41d[_0x3274('0x30')][_0x3274('0x36')]));_0x4ed980['attributes']=_0x4ed980[_0x3274('0x35')]['length']?_0x4ed980[_0x3274('0x35')]:_0x1952a0[_0x3274('0x34')];_0x4ed980[_0x3274('0x3a')]=qs[_0x3274('0x3b')](_0x54c41d[_0x3274('0x30')][_0x3274('0x3b')]);_0x4ed980[_0x3274('0x3c')]=qs[_0x3274('0x32')](_[_0x3274('0x4c')](_0x54c41d[_0x3274('0x30')],_0x1952a0['filters']));if(_0x54c41d[_0x3274('0x30')][_0x3274('0x3d')]){_0x4ed980['where']=_[_0x3274('0x3f')](_0x4ed980[_0x3274('0x3c')],{'$or':_[_0x3274('0x2f')](_0x4ed980[_0x3274('0x35')],function(_0x4cf4d8){var _0x8524aa={};_0x8524aa[_0x4cf4d8]={'$like':'%'+_0x54c41d[_0x3274('0x30')][_0x3274('0x3d')]+'%'};return _0x8524aa;})});}_0x4ed980=_[_0x3274('0x3f')]({},_0x4ed980,_0x54c41d[_0x3274('0x40')]);return _0x500422[_0x3274('0x4f')](_0x4ed980);}})[_0x3274('0x24')](function(_0x16a65d){if(_0x16a65d){_0x5eb2d1=_0x16a65d['length'];if(!_0x54c41d[_0x3274('0x30')]['hasOwnProperty'](_0x3274('0x39'))){_0x4ed980[_0x3274('0x1c')]=qs[_0x3274('0x1c')](_0x54c41d[_0x3274('0x30')][_0x3274('0x1c')]);_0x4ed980[_0x3274('0x1a')]=qs[_0x3274('0x1a')](_0x54c41d[_0x3274('0x30')][_0x3274('0x1a')]);}return _0x500422['getDescriptions'](_0x4ed980);}})[_0x3274('0x24')](function(_0x2a7828){if(_0x2a7828){return _0x2a7828?{'count':_0x5eb2d1,'rows':_0x2a7828}:null;}})[_0x3274('0x24')](respondWithResult(_0x575439,null))['catch'](handleError(_0x575439,null));}; \ No newline at end of file +var _0x6cc1=['includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6cc1,0xb6));var _0x16cc=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x6cc1[_0x2405bc];return _0x5272d4;};'use strict';var emlformat=require(_0x16cc('0x0'));var rimraf=require(_0x16cc('0x1'));var zipdir=require(_0x16cc('0x2'));var jsonpatch=require(_0x16cc('0x3'));var rp=require(_0x16cc('0x4'));var moment=require(_0x16cc('0x5'));var BPromise=require(_0x16cc('0x6'));var Mustache=require(_0x16cc('0x7'));var util=require('util');var path=require(_0x16cc('0x8'));var sox=require('sox');var csv=require(_0x16cc('0x9'));var ejs=require(_0x16cc('0xa'));var fs=require('fs');var fs_extra=require(_0x16cc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x16cc('0xc'));var deskjs=require(_0x16cc('0xd'));var toCsv=require(_0x16cc('0x9'));var querystring=require(_0x16cc('0xe'));var Papa=require(_0x16cc('0xf'));var Redis=require('ioredis');var authService=require(_0x16cc('0x10'));var qs=require(_0x16cc('0x11'));var as=require(_0x16cc('0x12'));var hardwareService=require(_0x16cc('0x13'));var logger=require(_0x16cc('0x14'))(_0x16cc('0x15'));var utils=require(_0x16cc('0x16'));var config=require(_0x16cc('0x17'));var licenseUtil=require(_0x16cc('0x18'));var db=require(_0x16cc('0x19'))['db'];function respondWithStatusCode(_0xac343b,_0x14b380){_0x14b380=_0x14b380||0xcc;return function(_0xbd8089){if(_0xbd8089){return _0xac343b['sendStatus'](_0x14b380);}return _0xac343b['status'](_0x14b380)[_0x16cc('0x1a')]();};}function respondWithResult(_0x1c921b,_0x422708){_0x422708=_0x422708||0xc8;return function(_0x57418d){if(_0x57418d){return _0x1c921b[_0x16cc('0x1b')](_0x422708)[_0x16cc('0x1c')](_0x57418d);}};}function respondWithFilteredResult(_0x16564a,_0x6e7f7f){return function(_0x26b830){if(_0x26b830){var _0x3595c4=typeof _0x6e7f7f[_0x16cc('0x1d')]===_0x16cc('0x1e')&&typeof _0x6e7f7f[_0x16cc('0x1f')]===_0x16cc('0x1e');var _0xf6b44c=_0x26b830[_0x16cc('0x20')];var _0x309327=_0x3595c4?0x0:_0x6e7f7f[_0x16cc('0x1d')];var _0xd7b333=_0x3595c4?_0x26b830['count']:_0x6e7f7f[_0x16cc('0x1d')]+_0x6e7f7f['limit'];var _0x55685d;if(_0xd7b333>=_0xf6b44c){_0xd7b333=_0xf6b44c;_0x55685d=0xc8;}else{_0x55685d=0xce;}_0x16564a['status'](_0x55685d);return _0x16564a[_0x16cc('0x21')](_0x16cc('0x22'),_0x309327+'-'+_0xd7b333+'/'+_0xf6b44c)[_0x16cc('0x1c')](_0x26b830);}return null;};}function patchUpdates(_0x25f152){return function(_0xb0ad31){try{jsonpatch[_0x16cc('0x23')](_0xb0ad31,_0x25f152,!![]);}catch(_0x11b66b){return BPromise[_0x16cc('0x24')](_0x11b66b);}return _0xb0ad31[_0x16cc('0x25')]();};}function saveUpdates(_0x3ffb90,_0x4467d5){return function(_0x2e8f97){if(_0x2e8f97){return _0x2e8f97['update'](_0x3ffb90)[_0x16cc('0x26')](function(_0x977350){return _0x977350;});}return null;};}function removeEntity(_0x428426,_0x21ed35){return function(_0x513bf8){if(_0x513bf8){return _0x513bf8['destroy']()[_0x16cc('0x26')](function(){_0x428426[_0x16cc('0x1b')](0xcc)[_0x16cc('0x1a')]();});}};}function handleEntityNotFound(_0xf962a1,_0x428fdc){return function(_0xeba7ba){if(!_0xeba7ba){_0xf962a1['sendStatus'](0x194);}return _0xeba7ba;};}function handleError(_0x2daf69,_0x15c3ed){_0x15c3ed=_0x15c3ed||0x1f4;return function(_0x27c2a9){logger[_0x16cc('0x27')](_0x27c2a9[_0x16cc('0x28')]);if(_0x27c2a9['name']){delete _0x27c2a9[_0x16cc('0x29')];}_0x2daf69[_0x16cc('0x1b')](_0x15c3ed)[_0x16cc('0x2a')](_0x27c2a9);};}exports[_0x16cc('0x2b')]=function(_0x1a29f7,_0x288f0e){var _0x4022a2={},_0x3e9a60={},_0x3ba80c={'count':0x0,'rows':[]};var _0x1ae8b6=_['map'](db[_0x16cc('0x2c')][_0x16cc('0x2d')],function(_0x172642){return{'name':_0x172642[_0x16cc('0x2e')],'type':_0x172642[_0x16cc('0x2f')][_0x16cc('0x30')]};});_0x3e9a60[_0x16cc('0x31')]=_[_0x16cc('0x32')](_0x1ae8b6,_0x16cc('0x29'));_0x3e9a60[_0x16cc('0x33')]=_[_0x16cc('0x34')](_0x1a29f7[_0x16cc('0x33')]);_0x3e9a60['filters']=_['intersection'](_0x3e9a60['model'],_0x3e9a60[_0x16cc('0x33')]);_0x4022a2[_0x16cc('0x35')]=_[_0x16cc('0x36')](_0x3e9a60[_0x16cc('0x31')],qs[_0x16cc('0x37')](_0x1a29f7['query']['fields']));_0x4022a2[_0x16cc('0x35')]=_0x4022a2['attributes'][_0x16cc('0x38')]?_0x4022a2[_0x16cc('0x35')]:_0x3e9a60['model'];if(!_0x1a29f7[_0x16cc('0x33')][_0x16cc('0x39')](_0x16cc('0x3a'))){_0x4022a2[_0x16cc('0x1f')]=qs['limit'](_0x1a29f7[_0x16cc('0x33')][_0x16cc('0x1f')]);_0x4022a2[_0x16cc('0x1d')]=qs[_0x16cc('0x1d')](_0x1a29f7[_0x16cc('0x33')][_0x16cc('0x1d')]);}_0x4022a2[_0x16cc('0x3b')]=qs[_0x16cc('0x3c')](_0x1a29f7['query']['sort']);_0x4022a2[_0x16cc('0x3d')]=qs[_0x16cc('0x3e')](_[_0x16cc('0x3f')](_0x1a29f7[_0x16cc('0x33')],_0x3e9a60[_0x16cc('0x3e')]),_0x1ae8b6);if(_0x1a29f7[_0x16cc('0x33')][_0x16cc('0x40')]){_0x4022a2[_0x16cc('0x3d')]=_[_0x16cc('0x41')](_0x4022a2[_0x16cc('0x3d')],{'$or':_[_0x16cc('0x32')](_0x1ae8b6,function(_0x417d18){if(_0x417d18[_0x16cc('0x2f')]!=='VIRTUAL'){var _0x53abaa={};_0x53abaa[_0x417d18[_0x16cc('0x29')]]={'$like':'%'+_0x1a29f7[_0x16cc('0x33')][_0x16cc('0x40')]+'%'};return _0x53abaa;}})});}_0x4022a2=_[_0x16cc('0x41')]({},_0x4022a2,_0x1a29f7[_0x16cc('0x42')]);var _0x73eaae={'where':_0x4022a2['where']};return db['ServicenowConfiguration'][_0x16cc('0x20')](_0x73eaae)[_0x16cc('0x26')](function(_0x3ef4e0){_0x3ba80c[_0x16cc('0x20')]=_0x3ef4e0;if(_0x1a29f7[_0x16cc('0x33')][_0x16cc('0x43')]){_0x4022a2['include']=[{'all':!![]}];}return db[_0x16cc('0x2c')][_0x16cc('0x44')](_0x4022a2);})[_0x16cc('0x26')](function(_0x15a57e){_0x3ba80c[_0x16cc('0x45')]=_0x15a57e;return _0x3ba80c;})[_0x16cc('0x26')](respondWithFilteredResult(_0x288f0e,_0x4022a2))[_0x16cc('0x46')](handleError(_0x288f0e,null));};exports[_0x16cc('0x47')]=function(_0x39a64e,_0x27e3c7){var _0x5675d1={'raw':![],'where':{'id':_0x39a64e[_0x16cc('0x48')]['id']}},_0x2bde4d={};_0x2bde4d[_0x16cc('0x31')]=_[_0x16cc('0x34')](db[_0x16cc('0x2c')]['rawAttributes']);_0x2bde4d[_0x16cc('0x33')]=_['keys'](_0x39a64e['query']);_0x2bde4d[_0x16cc('0x3e')]=_[_0x16cc('0x36')](_0x2bde4d[_0x16cc('0x31')],_0x2bde4d['query']);_0x5675d1[_0x16cc('0x35')]=_[_0x16cc('0x36')](_0x2bde4d[_0x16cc('0x31')],qs[_0x16cc('0x37')](_0x39a64e[_0x16cc('0x33')][_0x16cc('0x37')]));_0x5675d1[_0x16cc('0x35')]=_0x5675d1[_0x16cc('0x35')]['length']?_0x5675d1['attributes']:_0x2bde4d[_0x16cc('0x31')];if(_0x39a64e['query'][_0x16cc('0x43')]){_0x5675d1[_0x16cc('0x49')]=[{'all':!![]}];}_0x5675d1=_[_0x16cc('0x41')]({},_0x5675d1,_0x39a64e[_0x16cc('0x42')]);return db[_0x16cc('0x2c')][_0x16cc('0x4a')](_0x5675d1)[_0x16cc('0x26')](handleEntityNotFound(_0x27e3c7,null))[_0x16cc('0x26')](respondWithResult(_0x27e3c7,null))['catch'](handleError(_0x27e3c7,null));};exports[_0x16cc('0x4b')]=function(_0x230db8,_0x3d41c2){return db[_0x16cc('0x2c')][_0x16cc('0x4b')](_0x230db8[_0x16cc('0x4c')],{})[_0x16cc('0x26')](respondWithResult(_0x3d41c2,0xc9))['catch'](handleError(_0x3d41c2,null));};exports[_0x16cc('0x4d')]=function(_0x4d7f4b,_0x3a65e3){if(_0x4d7f4b[_0x16cc('0x4c')]['id']){delete _0x4d7f4b[_0x16cc('0x4c')]['id'];}return db[_0x16cc('0x2c')]['find']({'where':{'id':_0x4d7f4b[_0x16cc('0x48')]['id']}})[_0x16cc('0x26')](handleEntityNotFound(_0x3a65e3,null))[_0x16cc('0x26')](saveUpdates(_0x4d7f4b[_0x16cc('0x4c')],null))[_0x16cc('0x26')](respondWithResult(_0x3a65e3,null))['catch'](handleError(_0x3a65e3,null));};exports[_0x16cc('0x4e')]=function(_0x38c7e7,_0x4a1ac9){return db[_0x16cc('0x2c')][_0x16cc('0x4a')]({'where':{'id':_0x38c7e7['params']['id']}})['then'](handleEntityNotFound(_0x4a1ac9,null))['then'](removeEntity(_0x4a1ac9,null))['catch'](handleError(_0x4a1ac9,null));};exports['getFields']=function(_0x11de89,_0x524fae,_0x168e45){var _0x8ba494={};var _0x14cce9={};var _0x12c4f6;var _0x24f99d;return db[_0x16cc('0x2c')][_0x16cc('0x4f')]({'where':{'id':_0x11de89[_0x16cc('0x48')]['id']}})[_0x16cc('0x26')](handleEntityNotFound(_0x524fae,null))[_0x16cc('0x26')](function(_0x2d89bf){if(_0x2d89bf){_0x12c4f6=_0x2d89bf;_0x14cce9[_0x16cc('0x31')]=_[_0x16cc('0x34')](db[_0x16cc('0x50')][_0x16cc('0x2d')]);_0x14cce9[_0x16cc('0x33')]=_[_0x16cc('0x34')](_0x11de89['query']);_0x14cce9[_0x16cc('0x3e')]=_[_0x16cc('0x36')](_0x14cce9[_0x16cc('0x31')],_0x14cce9[_0x16cc('0x33')]);_0x8ba494[_0x16cc('0x35')]=_['intersection'](_0x14cce9['model'],qs[_0x16cc('0x37')](_0x11de89['query'][_0x16cc('0x37')]));_0x8ba494['attributes']=_0x8ba494['attributes'][_0x16cc('0x38')]?_0x8ba494[_0x16cc('0x35')]:_0x14cce9[_0x16cc('0x31')];_0x8ba494['order']=qs[_0x16cc('0x3c')](_0x11de89[_0x16cc('0x33')]['sort']);_0x8ba494[_0x16cc('0x3d')]=qs[_0x16cc('0x3e')](_[_0x16cc('0x3f')](_0x11de89[_0x16cc('0x33')],_0x14cce9[_0x16cc('0x3e')]));if(_0x11de89[_0x16cc('0x33')][_0x16cc('0x40')]){_0x8ba494[_0x16cc('0x3d')]=_[_0x16cc('0x41')](_0x8ba494['where'],{'$or':_[_0x16cc('0x32')](_0x8ba494[_0x16cc('0x35')],function(_0x5768cb){var _0x2ac767={};_0x2ac767[_0x5768cb]={'$like':'%'+_0x11de89['query'][_0x16cc('0x40')]+'%'};return _0x2ac767;})});}_0x8ba494=_[_0x16cc('0x41')]({},_0x8ba494,_0x11de89['options']);return _0x12c4f6['getFields'](_0x8ba494);}})[_0x16cc('0x26')](function(_0x39211f){if(_0x39211f){_0x24f99d=_0x39211f[_0x16cc('0x38')];if(!_0x11de89[_0x16cc('0x33')][_0x16cc('0x39')]('nolimit')){_0x8ba494[_0x16cc('0x1f')]=qs[_0x16cc('0x1f')](_0x11de89[_0x16cc('0x33')][_0x16cc('0x1f')]);_0x8ba494[_0x16cc('0x1d')]=qs[_0x16cc('0x1d')](_0x11de89[_0x16cc('0x33')][_0x16cc('0x1d')]);}return _0x12c4f6['getFields'](_0x8ba494);}})['then'](function(_0x574270){if(_0x574270){return _0x574270?{'count':_0x24f99d,'rows':_0x574270}:null;}})[_0x16cc('0x26')](respondWithResult(_0x524fae,null))[_0x16cc('0x46')](handleError(_0x524fae,null));};exports[_0x16cc('0x51')]=function(_0x2a1d6c,_0x21b511,_0x4a3096){var _0x4460e7={};var _0x2c18b1={};var _0xc8959e;var _0x61da26;return db[_0x16cc('0x2c')][_0x16cc('0x4f')]({'where':{'id':_0x2a1d6c[_0x16cc('0x48')]['id']}})[_0x16cc('0x26')](handleEntityNotFound(_0x21b511,null))['then'](function(_0x49c4fa){if(_0x49c4fa){_0xc8959e=_0x49c4fa;_0x2c18b1[_0x16cc('0x31')]=_['keys'](db['ServicenowField'][_0x16cc('0x2d')]);_0x2c18b1[_0x16cc('0x33')]=_[_0x16cc('0x34')](_0x2a1d6c['query']);_0x2c18b1['filters']=_[_0x16cc('0x36')](_0x2c18b1[_0x16cc('0x31')],_0x2c18b1[_0x16cc('0x33')]);_0x4460e7[_0x16cc('0x35')]=_[_0x16cc('0x36')](_0x2c18b1['model'],qs[_0x16cc('0x37')](_0x2a1d6c[_0x16cc('0x33')][_0x16cc('0x37')]));_0x4460e7[_0x16cc('0x35')]=_0x4460e7[_0x16cc('0x35')][_0x16cc('0x38')]?_0x4460e7[_0x16cc('0x35')]:_0x2c18b1['model'];_0x4460e7[_0x16cc('0x3b')]=qs[_0x16cc('0x3c')](_0x2a1d6c[_0x16cc('0x33')][_0x16cc('0x3c')]);_0x4460e7[_0x16cc('0x3d')]=qs[_0x16cc('0x3e')](_[_0x16cc('0x3f')](_0x2a1d6c[_0x16cc('0x33')],_0x2c18b1[_0x16cc('0x3e')]));if(_0x2a1d6c[_0x16cc('0x33')]['filter']){_0x4460e7[_0x16cc('0x3d')]=_[_0x16cc('0x41')](_0x4460e7[_0x16cc('0x3d')],{'$or':_[_0x16cc('0x32')](_0x4460e7[_0x16cc('0x35')],function(_0xe0d531){var _0x460794={};_0x460794[_0xe0d531]={'$like':'%'+_0x2a1d6c[_0x16cc('0x33')][_0x16cc('0x40')]+'%'};return _0x460794;})});}_0x4460e7=_[_0x16cc('0x41')]({},_0x4460e7,_0x2a1d6c[_0x16cc('0x42')]);return _0xc8959e[_0x16cc('0x51')](_0x4460e7);}})['then'](function(_0x143918){if(_0x143918){_0x61da26=_0x143918[_0x16cc('0x38')];if(!_0x2a1d6c['query'][_0x16cc('0x39')](_0x16cc('0x3a'))){_0x4460e7[_0x16cc('0x1f')]=qs[_0x16cc('0x1f')](_0x2a1d6c[_0x16cc('0x33')][_0x16cc('0x1f')]);_0x4460e7[_0x16cc('0x1d')]=qs['offset'](_0x2a1d6c[_0x16cc('0x33')][_0x16cc('0x1d')]);}return _0xc8959e[_0x16cc('0x51')](_0x4460e7);}})[_0x16cc('0x26')](function(_0x2902f4){if(_0x2902f4){return _0x2902f4?{'count':_0x61da26,'rows':_0x2902f4}:null;}})[_0x16cc('0x26')](respondWithResult(_0x21b511,null))[_0x16cc('0x46')](handleError(_0x21b511,null));};exports[_0x16cc('0x52')]=function(_0x28fef5,_0x5cd3a3,_0x183599){var _0x9548bf={};var _0x1a5d50={};var _0x3f167e;var _0xad98b6;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x28fef5['params']['id']}})[_0x16cc('0x26')](handleEntityNotFound(_0x5cd3a3,null))[_0x16cc('0x26')](function(_0x47d7b4){if(_0x47d7b4){_0x3f167e=_0x47d7b4;_0x1a5d50[_0x16cc('0x31')]=_[_0x16cc('0x34')](db['ServicenowField']['rawAttributes']);_0x1a5d50[_0x16cc('0x33')]=_[_0x16cc('0x34')](_0x28fef5[_0x16cc('0x33')]);_0x1a5d50[_0x16cc('0x3e')]=_[_0x16cc('0x36')](_0x1a5d50[_0x16cc('0x31')],_0x1a5d50[_0x16cc('0x33')]);_0x9548bf['attributes']=_['intersection'](_0x1a5d50['model'],qs[_0x16cc('0x37')](_0x28fef5[_0x16cc('0x33')][_0x16cc('0x37')]));_0x9548bf[_0x16cc('0x35')]=_0x9548bf[_0x16cc('0x35')][_0x16cc('0x38')]?_0x9548bf['attributes']:_0x1a5d50['model'];_0x9548bf[_0x16cc('0x3b')]=qs['sort'](_0x28fef5[_0x16cc('0x33')][_0x16cc('0x3c')]);_0x9548bf[_0x16cc('0x3d')]=qs[_0x16cc('0x3e')](_['pick'](_0x28fef5[_0x16cc('0x33')],_0x1a5d50['filters']));if(_0x28fef5[_0x16cc('0x33')][_0x16cc('0x40')]){_0x9548bf[_0x16cc('0x3d')]=_[_0x16cc('0x41')](_0x9548bf[_0x16cc('0x3d')],{'$or':_[_0x16cc('0x32')](_0x9548bf['attributes'],function(_0x420f77){var _0x18b1b6={};_0x18b1b6[_0x420f77]={'$like':'%'+_0x28fef5[_0x16cc('0x33')][_0x16cc('0x40')]+'%'};return _0x18b1b6;})});}_0x9548bf=_[_0x16cc('0x41')]({},_0x9548bf,_0x28fef5['options']);return _0x3f167e[_0x16cc('0x52')](_0x9548bf);}})[_0x16cc('0x26')](function(_0x3a8890){if(_0x3a8890){_0xad98b6=_0x3a8890[_0x16cc('0x38')];if(!_0x28fef5[_0x16cc('0x33')][_0x16cc('0x39')](_0x16cc('0x3a'))){_0x9548bf['limit']=qs['limit'](_0x28fef5[_0x16cc('0x33')][_0x16cc('0x1f')]);_0x9548bf[_0x16cc('0x1d')]=qs[_0x16cc('0x1d')](_0x28fef5[_0x16cc('0x33')][_0x16cc('0x1d')]);}return _0x3f167e['getDescriptions'](_0x9548bf);}})[_0x16cc('0x26')](function(_0x45e8de){if(_0x45e8de){return _0x45e8de?{'count':_0xad98b6,'rows':_0x45e8de}:null;}})[_0x16cc('0x26')](respondWithResult(_0x5cd3a3,null))[_0x16cc('0x46')](handleError(_0x5cd3a3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 912d042..cb9eeba 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 _0xceef=['rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','../../config/logger','api','bluebird','path'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0xceef,0xf6));var _0xfcee=function(_0x39157f,_0x3d8c1e){_0x39157f=_0x39157f-0x0;var _0x1ae4e2=_0xceef[_0x39157f];return _0x1ae4e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfcee('0x0'))(_0xfcee('0x1'));var moment=require('moment');var BPromise=require(_0xfcee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcee('0x3'));var rimraf=require(_0xfcee('0x4'));var config=require('../../config/environment');var attributes=require(_0xfcee('0x5'));module[_0xfcee('0x6')]=function(_0x4f3321,_0x59b784){return _0x4f3321[_0xfcee('0x7')](_0xfcee('0x8'),attributes,{'tableName':_0xfcee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97e7=['ServicenowConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x97e7,0x1a1));var _0x797e=function(_0x15c652,_0x239781){_0x15c652=_0x15c652-0x0;var _0x336956=_0x97e7[_0x15c652];return _0x336956;};'use strict';var _=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var logger=require(_0x797e('0x2'))('api');var moment=require(_0x797e('0x3'));var BPromise=require(_0x797e('0x4'));var rp=require(_0x797e('0x5'));var fs=require('fs');var path=require(_0x797e('0x6'));var rimraf=require(_0x797e('0x7'));var config=require(_0x797e('0x8'));var attributes=require(_0x797e('0x9'));module[_0x797e('0xa')]=function(_0x445e60,_0x204c83){return _0x445e60[_0x797e('0xb')](_0x797e('0xc'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index a88eb1f..cbd11dc 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 _0x4c50=['../../config/logger','rpc','jayson/promise','client','http','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4e3844,_0x1272ac){var _0x2c5f97=function(_0x323393){while(--_0x323393){_0x4e3844['push'](_0x4e3844['shift']());}};_0x2c5f97(++_0x1272ac);}(_0x4c50,0xf7));var _0x04c5=function(_0x303c1d,_0x5dda18){_0x303c1d=_0x303c1d-0x0;var _0x4c0feb=_0x4c50[_0x303c1d];return _0x4c0feb;};'use strict';var _=require('lodash');var util=require(_0x04c5('0x0'));var moment=require(_0x04c5('0x1'));var BPromise=require(_0x04c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04c5('0x3'))['db'];var utils=require(_0x04c5('0x4'));var logger=require(_0x04c5('0x5'))(_0x04c5('0x6'));var config=require('../../config/environment');var jayson=require(_0x04c5('0x7'));var client=jayson[_0x04c5('0x8')][_0x04c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x129756,_0x435832,_0x50dcb4){return new BPromise(function(_0x2fd60a,_0x9d9e71){return client['request'](_0x129756,_0x50dcb4)['then'](function(_0x3b7e2e){logger[_0x04c5('0xa')](_0x04c5('0xb'),_0x435832,'request\x20sent');logger[_0x04c5('0xc')](_0x04c5('0xd'),_0x435832,_0x04c5('0xe'),JSON[_0x04c5('0xf')](_0x3b7e2e));if(_0x3b7e2e[_0x04c5('0x10')]){if(_0x3b7e2e[_0x04c5('0x10')][_0x04c5('0x11')]===0x1f4){logger[_0x04c5('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x435832,_0x3b7e2e['error'][_0x04c5('0x12')]);return _0x9d9e71(_0x3b7e2e[_0x04c5('0x10')][_0x04c5('0x12')]);}logger[_0x04c5('0x10')](_0x04c5('0xb'),_0x435832,_0x3b7e2e[_0x04c5('0x10')][_0x04c5('0x12')]);return _0x2fd60a(_0x3b7e2e[_0x04c5('0x10')][_0x04c5('0x12')]);}else{logger[_0x04c5('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x435832,_0x04c5('0xe'));_0x2fd60a(_0x3b7e2e[_0x04c5('0x13')]['message']);}})[_0x04c5('0x14')](function(_0x2f401e){logger[_0x04c5('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x435832,_0x2f401e);_0x9d9e71(_0x2f401e);});});} \ No newline at end of file +var _0x4071=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x4071,0x1e6));var _0x1407=function(_0x2b8c54,_0x362604){_0x2b8c54=_0x2b8c54-0x0;var _0x2342aa=_0x4071[_0x2b8c54];return _0x2342aa;};'use strict';var _=require(_0x1407('0x0'));var util=require(_0x1407('0x1'));var moment=require(_0x1407('0x2'));var BPromise=require(_0x1407('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1407('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1407('0x5'));var logger=require(_0x1407('0x6'))(_0x1407('0x7'));var config=require('../../config/environment');var jayson=require(_0x1407('0x8'));var client=jayson[_0x1407('0x9')][_0x1407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x560e24,_0x366dee,_0xc875da){return new BPromise(function(_0x354550,_0xb886d0){return client['request'](_0x560e24,_0xc875da)[_0x1407('0xb')](function(_0x3cbe6a){logger[_0x1407('0xc')](_0x1407('0xd'),_0x366dee,_0x1407('0xe'));logger[_0x1407('0xf')](_0x1407('0x10'),_0x366dee,_0x1407('0xe'),JSON[_0x1407('0x11')](_0x3cbe6a));if(_0x3cbe6a['error']){if(_0x3cbe6a[_0x1407('0x12')][_0x1407('0x13')]===0x1f4){logger[_0x1407('0x12')](_0x1407('0xd'),_0x366dee,_0x3cbe6a[_0x1407('0x12')]['message']);return _0xb886d0(_0x3cbe6a[_0x1407('0x12')][_0x1407('0x14')]);}logger['error'](_0x1407('0xd'),_0x366dee,_0x3cbe6a[_0x1407('0x12')][_0x1407('0x14')]);return _0x354550(_0x3cbe6a['error'][_0x1407('0x14')]);}else{logger['info'](_0x1407('0xd'),_0x366dee,_0x1407('0xe'));_0x354550(_0x3cbe6a[_0x1407('0x15')][_0x1407('0x14')]);}})[_0x1407('0x16')](function(_0x149e7c){logger[_0x1407('0x12')](_0x1407('0xd'),_0x366dee,_0x149e7c);_0xb886d0(_0x149e7c);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7e4aa48..24ae3a7 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 _0x1edd=['./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1adff6,_0x5ac1e5){var _0x9a364d=function(_0x205370){while(--_0x205370){_0x1adff6['push'](_0x1adff6['shift']());}};_0x9a364d(++_0x5ac1e5);}(_0x1edd,0xf3));var _0xd1ed=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x1edd[_0x2b152a];return _0x2ad4c7;};'use strict';var multer=require(_0xd1ed('0x0'));var util=require(_0xd1ed('0x1'));var path=require(_0xd1ed('0x2'));var timeout=require(_0xd1ed('0x3'));var express=require(_0xd1ed('0x4'));var router=express[_0xd1ed('0x5')]();var fs_extra=require(_0xd1ed('0x6'));var auth=require(_0xd1ed('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd1ed('0x8'));var controller=require(_0xd1ed('0x9'));router[_0xd1ed('0xa')]('/',auth[_0xd1ed('0xb')](),controller[_0xd1ed('0xc')]);router[_0xd1ed('0xa')](_0xd1ed('0xd'),auth['isAuthenticated'](),controller[_0xd1ed('0xe')]);router['post']('/',auth[_0xd1ed('0xb')](),controller[_0xd1ed('0xf')]);router[_0xd1ed('0x10')](_0xd1ed('0xd'),auth[_0xd1ed('0xb')](),controller[_0xd1ed('0x11')]);router[_0xd1ed('0x12')](_0xd1ed('0xd'),auth[_0xd1ed('0xb')](),controller[_0xd1ed('0x13')]);module[_0xd1ed('0x14')]=router; \ No newline at end of file +var _0x483f=['put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x45216c,_0x84c45b){var _0x28d35d=function(_0x575223){while(--_0x575223){_0x45216c['push'](_0x45216c['shift']());}};_0x28d35d(++_0x84c45b);}(_0x483f,0xee));var _0xf483=function(_0x4d5bde,_0x457568){_0x4d5bde=_0x4d5bde-0x0;var _0xc8c0f3=_0x483f[_0x4d5bde];return _0xc8c0f3;};'use strict';var multer=require(_0xf483('0x0'));var util=require(_0xf483('0x1'));var path=require('path');var timeout=require(_0xf483('0x2'));var express=require('express');var router=express[_0xf483('0x3')]();var fs_extra=require(_0xf483('0x4'));var auth=require(_0xf483('0x5'));var interaction=require(_0xf483('0x6'));var config=require(_0xf483('0x7'));var controller=require(_0xf483('0x8'));router[_0xf483('0x9')]('/',auth[_0xf483('0xa')](),controller[_0xf483('0xb')]);router[_0xf483('0x9')](_0xf483('0xc'),auth[_0xf483('0xa')](),controller['show']);router[_0xf483('0xd')]('/',auth[_0xf483('0xa')](),controller['create']);router[_0xf483('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf483('0xf')]);router[_0xf483('0x10')](_0xf483('0xc'),auth[_0xf483('0xa')](),controller['destroy']);module[_0xf483('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 838f459..53e4475 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 _0x1c55=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x3464ab,_0xe62f48){var _0x505b94=function(_0x267af3){while(--_0x267af3){_0x3464ab['push'](_0x3464ab['shift']());}};_0x505b94(++_0xe62f48);}(_0x1c55,0x1c1));var _0x51c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c55[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x51c5('0x0'));module[_0x51c5('0x1')]={'type':{'type':Sequelize[_0x51c5('0x2')](_0x51c5('0x3'),'variable',_0x51c5('0x4'),_0x51c5('0x5'),_0x51c5('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x51c5('0x7')]},'key':{'type':Sequelize[_0x51c5('0x7')]},'keyType':{'type':Sequelize[_0x51c5('0x2')]('string',_0x51c5('0x8'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x51c5('0x7')]},'nameField':{'type':Sequelize[_0x51c5('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x51c5('0x7')]}}; \ No newline at end of file +var _0xe793=['BOOLEAN','sequelize','ENUM','customVariable','keyValue','picklist','STRING','variable'];(function(_0x2ace72,_0x814809){var _0x33d102=function(_0x505fd1){while(--_0x505fd1){_0x2ace72['push'](_0x2ace72['shift']());}};_0x33d102(++_0x814809);}(_0xe793,0x139));var _0x3e79=function(_0x3589a5,_0x2eacb4){_0x3589a5=_0x3589a5-0x0;var _0x55561a=_0xe793[_0x3589a5];return _0x55561a;};'use strict';var Sequelize=require(_0x3e79('0x0'));module['exports']={'type':{'type':Sequelize[_0x3e79('0x1')]('string','variable',_0x3e79('0x2'),_0x3e79('0x3'),_0x3e79('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3e79('0x5')]},'key':{'type':Sequelize[_0x3e79('0x5')]},'keyType':{'type':Sequelize[_0x3e79('0x1')]('string',_0x3e79('0x6'),_0x3e79('0x2'))},'keyContent':{'type':Sequelize[_0x3e79('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3e79('0x5')]},'customField':{'type':Sequelize[_0x3e79('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3e79('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a7a8516..101598c 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 _0xed48=['find','destroy','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','query','model','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','ServicenowField','includeAll','include','findAll','rows','catch','params','keys','length','options','create','body'];(function(_0x12cc27,_0x3d7286){var _0x18b952=function(_0x4d28cc){while(--_0x4d28cc){_0x12cc27['push'](_0x12cc27['shift']());}};_0x18b952(++_0x3d7286);}(_0xed48,0x122));var _0x8ed4=function(_0x325c1d,_0xaac33){_0x325c1d=_0x325c1d-0x0;var _0x41620d=_0xed48[_0x325c1d];return _0x41620d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed4('0x0'));var zipdir=require(_0x8ed4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8ed4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8ed4('0x3'));var util=require(_0x8ed4('0x4'));var path=require('path');var sox=require(_0x8ed4('0x5'));var csv=require(_0x8ed4('0x6'));var ejs=require(_0x8ed4('0x7'));var fs=require('fs');var fs_extra=require(_0x8ed4('0x8'));var _=require(_0x8ed4('0x9'));var squel=require(_0x8ed4('0xa'));var crypto=require('crypto');var jsforce=require(_0x8ed4('0xb'));var deskjs=require(_0x8ed4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8ed4('0xd'));var Papa=require(_0x8ed4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ed4('0xf'));var as=require(_0x8ed4('0x10'));var hardwareService=require(_0x8ed4('0x11'));var logger=require(_0x8ed4('0x12'))(_0x8ed4('0x13'));var utils=require(_0x8ed4('0x14'));var config=require(_0x8ed4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ed4('0x16'))['db'];function respondWithStatusCode(_0x45415d,_0x4d42ef){_0x4d42ef=_0x4d42ef||0xcc;return function(_0xdfba85){if(_0xdfba85){return _0x45415d[_0x8ed4('0x17')](_0x4d42ef);}return _0x45415d['status'](_0x4d42ef)[_0x8ed4('0x18')]();};}function respondWithResult(_0x44678c,_0x4151a1){_0x4151a1=_0x4151a1||0xc8;return function(_0x4e33d5){if(_0x4e33d5){return _0x44678c[_0x8ed4('0x19')](_0x4151a1)[_0x8ed4('0x1a')](_0x4e33d5);}};}function respondWithFilteredResult(_0x578253,_0x55d890){return function(_0x30190f){if(_0x30190f){var _0x4ad184=typeof _0x55d890[_0x8ed4('0x1b')]==='undefined'&&typeof _0x55d890[_0x8ed4('0x1c')]===_0x8ed4('0x1d');var _0x4d6e20=_0x30190f[_0x8ed4('0x1e')];var _0x1bf41e=_0x4ad184?0x0:_0x55d890[_0x8ed4('0x1b')];var _0x571ea8=_0x4ad184?_0x30190f['count']:_0x55d890[_0x8ed4('0x1b')]+_0x55d890[_0x8ed4('0x1c')];var _0x25d846;if(_0x571ea8>=_0x4d6e20){_0x571ea8=_0x4d6e20;_0x25d846=0xc8;}else{_0x25d846=0xce;}_0x578253[_0x8ed4('0x19')](_0x25d846);return _0x578253[_0x8ed4('0x1f')](_0x8ed4('0x20'),_0x1bf41e+'-'+_0x571ea8+'/'+_0x4d6e20)['json'](_0x30190f);}return null;};}function patchUpdates(_0x3df514){return function(_0x1e999c){try{jsonpatch['apply'](_0x1e999c,_0x3df514,!![]);}catch(_0x5b49dd){return BPromise[_0x8ed4('0x21')](_0x5b49dd);}return _0x1e999c[_0x8ed4('0x22')]();};}function saveUpdates(_0x3eedfa,_0x1cff7c){return function(_0x4a63e2){if(_0x4a63e2){return _0x4a63e2[_0x8ed4('0x23')](_0x3eedfa)[_0x8ed4('0x24')](function(_0x2ecbf2){return _0x2ecbf2;});}return null;};}function removeEntity(_0xff1cba,_0x454018){return function(_0x56286f){if(_0x56286f){return _0x56286f['destroy']()['then'](function(){_0xff1cba[_0x8ed4('0x19')](0xcc)[_0x8ed4('0x18')]();});}};}function handleEntityNotFound(_0x5ccdd6,_0x5cf2ee){return function(_0x12cec8){if(!_0x12cec8){_0x5ccdd6[_0x8ed4('0x17')](0x194);}return _0x12cec8;};}function handleError(_0x244955,_0x100ea0){_0x100ea0=_0x100ea0||0x1f4;return function(_0xc7defc){logger[_0x8ed4('0x25')](_0xc7defc[_0x8ed4('0x26')]);if(_0xc7defc[_0x8ed4('0x27')]){delete _0xc7defc[_0x8ed4('0x27')];}_0x244955[_0x8ed4('0x19')](_0x100ea0)['send'](_0xc7defc);};}exports[_0x8ed4('0x28')]=function(_0x1aad79,_0x10085b){var _0x444c63={},_0x5e90b1={},_0x2cc960={'count':0x0,'rows':[]};var _0x40c4f1=_[_0x8ed4('0x29')](db['ServicenowField'][_0x8ed4('0x2a')],function(_0x225410){return{'name':_0x225410[_0x8ed4('0x2b')],'type':_0x225410['type']['key']};});_0x5e90b1['model']=_['map'](_0x40c4f1,_0x8ed4('0x27'));_0x5e90b1[_0x8ed4('0x2c')]=_['keys'](_0x1aad79[_0x8ed4('0x2c')]);_0x5e90b1['filters']=_['intersection'](_0x5e90b1[_0x8ed4('0x2d')],_0x5e90b1[_0x8ed4('0x2c')]);_0x444c63[_0x8ed4('0x2e')]=_[_0x8ed4('0x2f')](_0x5e90b1['model'],qs[_0x8ed4('0x30')](_0x1aad79['query'][_0x8ed4('0x30')]));_0x444c63['attributes']=_0x444c63['attributes']['length']?_0x444c63['attributes']:_0x5e90b1[_0x8ed4('0x2d')];if(!_0x1aad79[_0x8ed4('0x2c')]['hasOwnProperty'](_0x8ed4('0x31'))){_0x444c63['limit']=qs['limit'](_0x1aad79[_0x8ed4('0x2c')][_0x8ed4('0x1c')]);_0x444c63[_0x8ed4('0x1b')]=qs[_0x8ed4('0x1b')](_0x1aad79[_0x8ed4('0x2c')][_0x8ed4('0x1b')]);}_0x444c63[_0x8ed4('0x32')]=qs[_0x8ed4('0x33')](_0x1aad79[_0x8ed4('0x2c')][_0x8ed4('0x33')]);_0x444c63[_0x8ed4('0x34')]=qs[_0x8ed4('0x35')](_[_0x8ed4('0x36')](_0x1aad79[_0x8ed4('0x2c')],_0x5e90b1[_0x8ed4('0x35')]),_0x40c4f1);if(_0x1aad79[_0x8ed4('0x2c')][_0x8ed4('0x37')]){_0x444c63['where']=_[_0x8ed4('0x38')](_0x444c63['where'],{'$or':_[_0x8ed4('0x29')](_0x40c4f1,function(_0x3e90b1){if(_0x3e90b1[_0x8ed4('0x39')]!=='VIRTUAL'){var _0xc1d2b8={};_0xc1d2b8[_0x3e90b1[_0x8ed4('0x27')]]={'$like':'%'+_0x1aad79[_0x8ed4('0x2c')][_0x8ed4('0x37')]+'%'};return _0xc1d2b8;}})});}_0x444c63=_['merge']({},_0x444c63,_0x1aad79['options']);var _0x5ed418={'where':_0x444c63[_0x8ed4('0x34')]};return db[_0x8ed4('0x3a')][_0x8ed4('0x1e')](_0x5ed418)[_0x8ed4('0x24')](function(_0x37ea1d){_0x2cc960[_0x8ed4('0x1e')]=_0x37ea1d;if(_0x1aad79[_0x8ed4('0x2c')][_0x8ed4('0x3b')]){_0x444c63[_0x8ed4('0x3c')]=[{'all':!![]}];}return db[_0x8ed4('0x3a')][_0x8ed4('0x3d')](_0x444c63);})[_0x8ed4('0x24')](function(_0x2e65c1){_0x2cc960[_0x8ed4('0x3e')]=_0x2e65c1;return _0x2cc960;})[_0x8ed4('0x24')](respondWithFilteredResult(_0x10085b,_0x444c63))[_0x8ed4('0x3f')](handleError(_0x10085b,null));};exports['show']=function(_0x328864,_0x110966){var _0x5c9af2={'raw':!![],'where':{'id':_0x328864[_0x8ed4('0x40')]['id']}},_0x3809d4={};_0x3809d4[_0x8ed4('0x2d')]=_[_0x8ed4('0x41')](db[_0x8ed4('0x3a')][_0x8ed4('0x2a')]);_0x3809d4['query']=_['keys'](_0x328864['query']);_0x3809d4[_0x8ed4('0x35')]=_[_0x8ed4('0x2f')](_0x3809d4['model'],_0x3809d4['query']);_0x5c9af2['attributes']=_['intersection'](_0x3809d4[_0x8ed4('0x2d')],qs[_0x8ed4('0x30')](_0x328864[_0x8ed4('0x2c')][_0x8ed4('0x30')]));_0x5c9af2[_0x8ed4('0x2e')]=_0x5c9af2[_0x8ed4('0x2e')][_0x8ed4('0x42')]?_0x5c9af2[_0x8ed4('0x2e')]:_0x3809d4[_0x8ed4('0x2d')];if(_0x328864[_0x8ed4('0x2c')][_0x8ed4('0x3b')]){_0x5c9af2[_0x8ed4('0x3c')]=[{'all':!![]}];}_0x5c9af2=_['merge']({},_0x5c9af2,_0x328864[_0x8ed4('0x43')]);return db['ServicenowField']['find'](_0x5c9af2)[_0x8ed4('0x24')](handleEntityNotFound(_0x110966,null))[_0x8ed4('0x24')](respondWithResult(_0x110966,null))[_0x8ed4('0x3f')](handleError(_0x110966,null));};exports[_0x8ed4('0x44')]=function(_0x1ea622,_0x40ecbc){return db[_0x8ed4('0x3a')]['create'](_0x1ea622['body'],{})[_0x8ed4('0x24')](respondWithResult(_0x40ecbc,0xc9))['catch'](handleError(_0x40ecbc,null));};exports[_0x8ed4('0x23')]=function(_0x178d5c,_0x55401a){if(_0x178d5c['body']['id']){delete _0x178d5c[_0x8ed4('0x45')]['id'];}return db[_0x8ed4('0x3a')][_0x8ed4('0x46')]({'where':{'id':_0x178d5c[_0x8ed4('0x40')]['id']}})[_0x8ed4('0x24')](handleEntityNotFound(_0x55401a,null))[_0x8ed4('0x24')](saveUpdates(_0x178d5c['body'],null))[_0x8ed4('0x24')](respondWithResult(_0x55401a,null))[_0x8ed4('0x3f')](handleError(_0x55401a,null));};exports[_0x8ed4('0x47')]=function(_0x4757eb,_0x26a458){return db[_0x8ed4('0x3a')][_0x8ed4('0x46')]({'where':{'id':_0x4757eb[_0x8ed4('0x40')]['id']}})[_0x8ed4('0x24')](handleEntityNotFound(_0x26a458,null))[_0x8ed4('0x24')](removeEntity(_0x26a458,null))[_0x8ed4('0x3f')](handleError(_0x26a458,null));}; \ No newline at end of file +var _0x5ee5=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','set','Content-Range','save','update','then','end','error','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','VIRTUAL','options','ServicenowField','includeAll','include','rows','catch','show','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x28dce8,_0x5476ba){var _0x5e22dc=function(_0x1064b2){while(--_0x1064b2){_0x28dce8['push'](_0x28dce8['shift']());}};_0x5e22dc(++_0x5476ba);}(_0x5ee5,0x113));var _0x55ee=function(_0x2c87dc,_0x139292){_0x2c87dc=_0x2c87dc-0x0;var _0x2b78ec=_0x5ee5[_0x2c87dc];return _0x2b78ec;};'use strict';var emlformat=require(_0x55ee('0x0'));var rimraf=require(_0x55ee('0x1'));var zipdir=require(_0x55ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x55ee('0x3'));var moment=require('moment');var BPromise=require(_0x55ee('0x4'));var Mustache=require(_0x55ee('0x5'));var util=require(_0x55ee('0x6'));var path=require(_0x55ee('0x7'));var sox=require(_0x55ee('0x8'));var csv=require(_0x55ee('0x9'));var ejs=require(_0x55ee('0xa'));var fs=require('fs');var fs_extra=require(_0x55ee('0xb'));var _=require(_0x55ee('0xc'));var squel=require(_0x55ee('0xd'));var crypto=require(_0x55ee('0xe'));var jsforce=require(_0x55ee('0xf'));var deskjs=require(_0x55ee('0x10'));var toCsv=require(_0x55ee('0x9'));var querystring=require(_0x55ee('0x11'));var Papa=require('papaparse');var Redis=require(_0x55ee('0x12'));var authService=require(_0x55ee('0x13'));var qs=require(_0x55ee('0x14'));var as=require(_0x55ee('0x15'));var hardwareService=require(_0x55ee('0x16'));var logger=require(_0x55ee('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x55ee('0x18'));var licenseUtil=require(_0x55ee('0x19'));var db=require(_0x55ee('0x1a'))['db'];function respondWithStatusCode(_0x296d64,_0x46aebe){_0x46aebe=_0x46aebe||0xcc;return function(_0x15be7e){if(_0x15be7e){return _0x296d64[_0x55ee('0x1b')](_0x46aebe);}return _0x296d64[_0x55ee('0x1c')](_0x46aebe)['end']();};}function respondWithResult(_0x22cd4b,_0x232be5){_0x232be5=_0x232be5||0xc8;return function(_0x568c11){if(_0x568c11){return _0x22cd4b[_0x55ee('0x1c')](_0x232be5)[_0x55ee('0x1d')](_0x568c11);}};}function respondWithFilteredResult(_0x45991e,_0x5884c4){return function(_0x137894){if(_0x137894){var _0x38617c=typeof _0x5884c4['offset']===_0x55ee('0x1e')&&typeof _0x5884c4['limit']==='undefined';var _0x19184=_0x137894['count'];var _0x3cf5cf=_0x38617c?0x0:_0x5884c4[_0x55ee('0x1f')];var _0x1fb934=_0x38617c?_0x137894[_0x55ee('0x20')]:_0x5884c4[_0x55ee('0x1f')]+_0x5884c4['limit'];var _0x5ba0db;if(_0x1fb934>=_0x19184){_0x1fb934=_0x19184;_0x5ba0db=0xc8;}else{_0x5ba0db=0xce;}_0x45991e['status'](_0x5ba0db);return _0x45991e[_0x55ee('0x21')](_0x55ee('0x22'),_0x3cf5cf+'-'+_0x1fb934+'/'+_0x19184)[_0x55ee('0x1d')](_0x137894);}return null;};}function patchUpdates(_0x188dac){return function(_0xa08f4e){try{jsonpatch['apply'](_0xa08f4e,_0x188dac,!![]);}catch(_0x464aa2){return BPromise['reject'](_0x464aa2);}return _0xa08f4e[_0x55ee('0x23')]();};}function saveUpdates(_0x586ead,_0x351db8){return function(_0x31fbb3){if(_0x31fbb3){return _0x31fbb3[_0x55ee('0x24')](_0x586ead)[_0x55ee('0x25')](function(_0x22b320){return _0x22b320;});}return null;};}function removeEntity(_0x1ed3f5,_0x28e1e3){return function(_0x5d5849){if(_0x5d5849){return _0x5d5849['destroy']()[_0x55ee('0x25')](function(){_0x1ed3f5['status'](0xcc)[_0x55ee('0x26')]();});}};}function handleEntityNotFound(_0x27057a,_0xe472e6){return function(_0x134110){if(!_0x134110){_0x27057a[_0x55ee('0x1b')](0x194);}return _0x134110;};}function handleError(_0x2a986c,_0x5708ea){_0x5708ea=_0x5708ea||0x1f4;return function(_0x1be814){logger[_0x55ee('0x27')](_0x1be814['stack']);if(_0x1be814[_0x55ee('0x28')]){delete _0x1be814[_0x55ee('0x28')];}_0x2a986c[_0x55ee('0x1c')](_0x5708ea)[_0x55ee('0x29')](_0x1be814);};}exports['index']=function(_0xdbd858,_0x55bcd3){var _0x38c087={},_0x2f4ee8={},_0x45ed34={'count':0x0,'rows':[]};var _0x4ec6bc=_[_0x55ee('0x2a')](db['ServicenowField']['rawAttributes'],function(_0x4b8d44){return{'name':_0x4b8d44[_0x55ee('0x2b')],'type':_0x4b8d44['type'][_0x55ee('0x2c')]};});_0x2f4ee8[_0x55ee('0x2d')]=_[_0x55ee('0x2a')](_0x4ec6bc,'name');_0x2f4ee8[_0x55ee('0x2e')]=_[_0x55ee('0x2f')](_0xdbd858[_0x55ee('0x2e')]);_0x2f4ee8[_0x55ee('0x30')]=_[_0x55ee('0x31')](_0x2f4ee8[_0x55ee('0x2d')],_0x2f4ee8[_0x55ee('0x2e')]);_0x38c087[_0x55ee('0x32')]=_[_0x55ee('0x31')](_0x2f4ee8['model'],qs['fields'](_0xdbd858[_0x55ee('0x2e')][_0x55ee('0x33')]));_0x38c087[_0x55ee('0x32')]=_0x38c087[_0x55ee('0x32')][_0x55ee('0x34')]?_0x38c087[_0x55ee('0x32')]:_0x2f4ee8[_0x55ee('0x2d')];if(!_0xdbd858[_0x55ee('0x2e')][_0x55ee('0x35')](_0x55ee('0x36'))){_0x38c087[_0x55ee('0x37')]=qs[_0x55ee('0x37')](_0xdbd858[_0x55ee('0x2e')][_0x55ee('0x37')]);_0x38c087[_0x55ee('0x1f')]=qs[_0x55ee('0x1f')](_0xdbd858[_0x55ee('0x2e')][_0x55ee('0x1f')]);}_0x38c087['order']=qs[_0x55ee('0x38')](_0xdbd858['query'][_0x55ee('0x38')]);_0x38c087['where']=qs[_0x55ee('0x30')](_[_0x55ee('0x39')](_0xdbd858['query'],_0x2f4ee8[_0x55ee('0x30')]),_0x4ec6bc);if(_0xdbd858[_0x55ee('0x2e')][_0x55ee('0x3a')]){_0x38c087[_0x55ee('0x3b')]=_[_0x55ee('0x3c')](_0x38c087[_0x55ee('0x3b')],{'$or':_[_0x55ee('0x2a')](_0x4ec6bc,function(_0x409271){if(_0x409271[_0x55ee('0x3d')]!==_0x55ee('0x3e')){var _0x301d6d={};_0x301d6d[_0x409271[_0x55ee('0x28')]]={'$like':'%'+_0xdbd858[_0x55ee('0x2e')][_0x55ee('0x3a')]+'%'};return _0x301d6d;}})});}_0x38c087=_[_0x55ee('0x3c')]({},_0x38c087,_0xdbd858[_0x55ee('0x3f')]);var _0x447288={'where':_0x38c087[_0x55ee('0x3b')]};return db[_0x55ee('0x40')]['count'](_0x447288)[_0x55ee('0x25')](function(_0x48dfee){_0x45ed34['count']=_0x48dfee;if(_0xdbd858[_0x55ee('0x2e')][_0x55ee('0x41')]){_0x38c087[_0x55ee('0x42')]=[{'all':!![]}];}return db[_0x55ee('0x40')]['findAll'](_0x38c087);})['then'](function(_0x4409d1){_0x45ed34[_0x55ee('0x43')]=_0x4409d1;return _0x45ed34;})['then'](respondWithFilteredResult(_0x55bcd3,_0x38c087))[_0x55ee('0x44')](handleError(_0x55bcd3,null));};exports[_0x55ee('0x45')]=function(_0x482fde,_0x361100){var _0x105764={'raw':!![],'where':{'id':_0x482fde['params']['id']}},_0x1f4d15={};_0x1f4d15[_0x55ee('0x2d')]=_[_0x55ee('0x2f')](db[_0x55ee('0x40')]['rawAttributes']);_0x1f4d15['query']=_[_0x55ee('0x2f')](_0x482fde[_0x55ee('0x2e')]);_0x1f4d15['filters']=_['intersection'](_0x1f4d15[_0x55ee('0x2d')],_0x1f4d15[_0x55ee('0x2e')]);_0x105764[_0x55ee('0x32')]=_[_0x55ee('0x31')](_0x1f4d15[_0x55ee('0x2d')],qs[_0x55ee('0x33')](_0x482fde['query']['fields']));_0x105764[_0x55ee('0x32')]=_0x105764[_0x55ee('0x32')][_0x55ee('0x34')]?_0x105764[_0x55ee('0x32')]:_0x1f4d15[_0x55ee('0x2d')];if(_0x482fde[_0x55ee('0x2e')][_0x55ee('0x41')]){_0x105764['include']=[{'all':!![]}];}_0x105764=_[_0x55ee('0x3c')]({},_0x105764,_0x482fde[_0x55ee('0x3f')]);return db['ServicenowField'][_0x55ee('0x46')](_0x105764)[_0x55ee('0x25')](handleEntityNotFound(_0x361100,null))[_0x55ee('0x25')](respondWithResult(_0x361100,null))[_0x55ee('0x44')](handleError(_0x361100,null));};exports[_0x55ee('0x47')]=function(_0x579d2e,_0x31c5f3){return db[_0x55ee('0x40')][_0x55ee('0x47')](_0x579d2e[_0x55ee('0x48')],{})[_0x55ee('0x25')](respondWithResult(_0x31c5f3,0xc9))[_0x55ee('0x44')](handleError(_0x31c5f3,null));};exports[_0x55ee('0x24')]=function(_0x544dcb,_0x59af89){if(_0x544dcb['body']['id']){delete _0x544dcb['body']['id'];}return db[_0x55ee('0x40')][_0x55ee('0x46')]({'where':{'id':_0x544dcb[_0x55ee('0x49')]['id']}})[_0x55ee('0x25')](handleEntityNotFound(_0x59af89,null))[_0x55ee('0x25')](saveUpdates(_0x544dcb[_0x55ee('0x48')],null))[_0x55ee('0x25')](respondWithResult(_0x59af89,null))[_0x55ee('0x44')](handleError(_0x59af89,null));};exports[_0x55ee('0x4a')]=function(_0x6bd272,_0x340d5f){return db['ServicenowField'][_0x55ee('0x46')]({'where':{'id':_0x6bd272[_0x55ee('0x49')]['id']}})[_0x55ee('0x25')](handleEntityNotFound(_0x340d5f,null))[_0x55ee('0x25')](removeEntity(_0x340d5f,null))['catch'](handleError(_0x340d5f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index f83399c..cc81b99 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 _0x7958=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','moment','request-promise','path','exports'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7958,0xf5));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8795('0x0'));var util=require(_0x8795('0x1'));var logger=require(_0x8795('0x2'))('api');var moment=require(_0x8795('0x3'));var BPromise=require('bluebird');var rp=require(_0x8795('0x4'));var fs=require('fs');var path=require(_0x8795('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x8795('0x6')]=function(_0x134823,_0x47d7d5){return _0x134823[_0x8795('0x7')](_0x8795('0x8'),attributes,{'tableName':_0x8795('0x9'),'paranoid':![],'indexes':[{'name':_0x8795('0xa'),'fields':['idField',_0x8795('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x798e=['FieldId','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x798e,0x187));var _0xe798=function(_0x3383c1,_0x37f347){_0x3383c1=_0x3383c1-0x0;var _0x168c86=_0x798e[_0x3383c1];return _0x168c86;};'use strict';var _=require(_0xe798('0x0'));var util=require('util');var logger=require(_0xe798('0x1'))(_0xe798('0x2'));var moment=require(_0xe798('0x3'));var BPromise=require('bluebird');var rp=require(_0xe798('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe798('0x5'));var config=require(_0xe798('0x6'));var attributes=require(_0xe798('0x7'));module[_0xe798('0x8')]=function(_0x450efb,_0x4a4716){return _0x450efb[_0xe798('0x9')](_0xe798('0xa'),attributes,{'tableName':_0xe798('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0xe798('0xc')],'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 554f46d..59291e4 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x538e03,_0x9ddbb){var _0xe4d450=function(_0x242493){while(--_0x242493){_0x538e03['push'](_0x538e03['shift']());}};_0xe4d450(++_0x9ddbb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0xe6c7,_0x310c5c){var _0x22bd04=function(_0x5f1280){while(--_0x5f1280){_0xe6c7['push'](_0xe6c7['shift']());}};_0x22bd04(++_0x310c5c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x27fb7c,_0x5c0f92){_0x27fb7c=_0x27fb7c-0x0;var _0x53ffeb=_0x9ffd[_0x27fb7c];return _0x53ffeb;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 413442a..e62f3a2 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x423b2a,_0x452f55){var _0x40a38a=function(_0x2069ee){while(--_0x2069ee){_0x423b2a['push'](_0x423b2a['shift']());}};_0x40a38a(++_0x452f55);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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 ad18ec0..528f003 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(_0x532087,_0x1302bf){var _0x4de2ed=function(_0x11e84a){while(--_0x11e84a){_0x532087['push'](_0x532087['shift']());}};_0x4de2ed(++_0x1302bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x3ab2c8,_0x353778){var _0x339c60=function(_0x16377f){while(--_0x16377f){_0x3ab2c8['push'](_0x3ab2c8['shift']());}};_0x339c60(++_0x353778);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 d0e8708..2e8486e 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 _0x29cb=['POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','Invalid\x20Login','Password\x20Expired','get_module_fields','module_fields','remove','includes','label','endsWith','values','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','destroy','getConfigurations','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne','username','password','remoteUri','lastIndexOf'];(function(_0x57d4c9,_0x131b7f){var _0x48d275=function(_0x4560c5){while(--_0x4560c5){_0x57d4c9['push'](_0x57d4c9['shift']());}};_0x48d275(++_0x131b7f);}(_0x29cb,0x107));var _0xb29c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x29cb[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0xb29c('0x0'));var rimraf=require(_0xb29c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb29c('0x2'));var moment=require(_0xb29c('0x3'));var BPromise=require(_0xb29c('0x4'));var Mustache=require(_0xb29c('0x5'));var util=require('util');var path=require(_0xb29c('0x6'));var sox=require('sox');var csv=require(_0xb29c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb29c('0x8'));var _=require(_0xb29c('0x9'));var squel=require(_0xb29c('0xa'));var crypto=require(_0xb29c('0xb'));var jsforce=require(_0xb29c('0xc'));var deskjs=require(_0xb29c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb29c('0xe'));var Redis=require(_0xb29c('0xf'));var authService=require(_0xb29c('0x10'));var qs=require(_0xb29c('0x11'));var as=require(_0xb29c('0x12'));var hardwareService=require(_0xb29c('0x13'));var logger=require(_0xb29c('0x14'))(_0xb29c('0x15'));var utils=require(_0xb29c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb29c('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb29c('0x18'));function respondWithStatusCode(_0x436041,_0x4d4b3f){_0x4d4b3f=_0x4d4b3f||0xcc;return function(_0x20734e){if(_0x20734e){return _0x436041[_0xb29c('0x19')](_0x4d4b3f);}return _0x436041[_0xb29c('0x1a')](_0x4d4b3f)[_0xb29c('0x1b')]();};}function respondWithResult(_0x195cba,_0x247c94){_0x247c94=_0x247c94||0xc8;return function(_0x304a55){if(_0x304a55){return _0x195cba[_0xb29c('0x1a')](_0x247c94)[_0xb29c('0x1c')](_0x304a55);}};}function respondWithFilteredResult(_0x5b6261,_0x116f26){return function(_0x4fe34b){if(_0x4fe34b){var _0x2e5149=typeof _0x116f26[_0xb29c('0x1d')]===_0xb29c('0x1e')&&typeof _0x116f26[_0xb29c('0x1f')]===_0xb29c('0x1e');var _0x5a9c6e=_0x4fe34b['count'];var _0x39271e=_0x2e5149?0x0:_0x116f26[_0xb29c('0x1d')];var _0x2b2e11=_0x2e5149?_0x4fe34b[_0xb29c('0x20')]:_0x116f26[_0xb29c('0x1d')]+_0x116f26[_0xb29c('0x1f')];var _0x1b3405;if(_0x2b2e11>=_0x5a9c6e){_0x2b2e11=_0x5a9c6e;_0x1b3405=0xc8;}else{_0x1b3405=0xce;}_0x5b6261[_0xb29c('0x1a')](_0x1b3405);return _0x5b6261['set'](_0xb29c('0x21'),_0x39271e+'-'+_0x2b2e11+'/'+_0x5a9c6e)[_0xb29c('0x1c')](_0x4fe34b);}return null;};}function patchUpdates(_0x169690){return function(_0x2ae1a7){try{jsonpatch[_0xb29c('0x22')](_0x2ae1a7,_0x169690,!![]);}catch(_0x594117){return BPromise[_0xb29c('0x23')](_0x594117);}return _0x2ae1a7[_0xb29c('0x24')]();};}function saveUpdates(_0x526ea3,_0x42629c){return function(_0x2ccd2e){if(_0x2ccd2e){return _0x2ccd2e[_0xb29c('0x25')](_0x526ea3)[_0xb29c('0x26')](function(_0x42e475){return _0x42e475;});}return null;};}function removeEntity(_0x18b610,_0x2645b4){return function(_0x4ea001){if(_0x4ea001){return _0x4ea001['destroy']()[_0xb29c('0x26')](function(){_0x18b610[_0xb29c('0x1a')](0xcc)[_0xb29c('0x1b')]();});}};}function handleEntityNotFound(_0xc29f03,_0xf0ab47){return function(_0x4c3298){if(!_0x4c3298){_0xc29f03['sendStatus'](0x194);}return _0x4c3298;};}function handleError(_0x39fba5,_0x195f59){_0x195f59=_0x195f59||0x1f4;return function(_0x21e2f5){logger[_0xb29c('0x27')](_0x21e2f5[_0xb29c('0x28')]);if(_0x21e2f5[_0xb29c('0x29')]){delete _0x21e2f5['name'];}_0x39fba5[_0xb29c('0x1a')](_0x195f59)[_0xb29c('0x2a')](_0x21e2f5);};}exports[_0xb29c('0x2b')]=function(_0x2660b0,_0x3926bf){var _0x2a06eb={},_0x484ff2={},_0x217c42={'count':0x0,'rows':[]};var _0x99fbe=_[_0xb29c('0x2c')](db[_0xb29c('0x2d')][_0xb29c('0x2e')],function(_0x4b0f00){return{'name':_0x4b0f00[_0xb29c('0x2f')],'type':_0x4b0f00['type'][_0xb29c('0x30')]};});_0x484ff2[_0xb29c('0x31')]=_[_0xb29c('0x2c')](_0x99fbe,_0xb29c('0x29'));_0x484ff2[_0xb29c('0x32')]=_[_0xb29c('0x33')](_0x2660b0['query']);_0x484ff2[_0xb29c('0x34')]=_[_0xb29c('0x35')](_0x484ff2[_0xb29c('0x31')],_0x484ff2[_0xb29c('0x32')]);_0x2a06eb[_0xb29c('0x36')]=_[_0xb29c('0x35')](_0x484ff2[_0xb29c('0x31')],qs[_0xb29c('0x37')](_0x2660b0[_0xb29c('0x32')][_0xb29c('0x37')]));_0x2a06eb['attributes']=_0x2a06eb['attributes'][_0xb29c('0x38')]?_0x2a06eb[_0xb29c('0x36')]:_0x484ff2[_0xb29c('0x31')];if(!_0x2660b0[_0xb29c('0x32')]['hasOwnProperty'](_0xb29c('0x39'))){_0x2a06eb[_0xb29c('0x1f')]=qs[_0xb29c('0x1f')](_0x2660b0[_0xb29c('0x32')][_0xb29c('0x1f')]);_0x2a06eb[_0xb29c('0x1d')]=qs[_0xb29c('0x1d')](_0x2660b0[_0xb29c('0x32')][_0xb29c('0x1d')]);}_0x2a06eb[_0xb29c('0x3a')]=qs[_0xb29c('0x3b')](_0x2660b0['query'][_0xb29c('0x3b')]);_0x2a06eb[_0xb29c('0x3c')]=qs[_0xb29c('0x34')](_[_0xb29c('0x3d')](_0x2660b0['query'],_0x484ff2[_0xb29c('0x34')]),_0x99fbe);if(_0x2660b0[_0xb29c('0x32')][_0xb29c('0x3e')]){_0x2a06eb[_0xb29c('0x3c')]=_[_0xb29c('0x3f')](_0x2a06eb[_0xb29c('0x3c')],{'$or':_[_0xb29c('0x2c')](_0x99fbe,function(_0x300a6b){if(_0x300a6b[_0xb29c('0x40')]!==_0xb29c('0x41')){var _0x3a1524={};_0x3a1524[_0x300a6b[_0xb29c('0x29')]]={'$like':'%'+_0x2660b0[_0xb29c('0x32')][_0xb29c('0x3e')]+'%'};return _0x3a1524;}})});}_0x2a06eb=_[_0xb29c('0x3f')]({},_0x2a06eb,_0x2660b0[_0xb29c('0x42')]);var _0x158c81={'where':_0x2a06eb[_0xb29c('0x3c')]};return db['SugarcrmAccount'][_0xb29c('0x20')](_0x158c81)['then'](function(_0xa099cf){_0x217c42[_0xb29c('0x20')]=_0xa099cf;if(_0x2660b0['query']['includeAll']){_0x2a06eb['include']=[{'all':!![]}];}return db[_0xb29c('0x2d')][_0xb29c('0x43')](_0x2a06eb);})[_0xb29c('0x26')](function(_0x45d64a){_0x217c42['rows']=_0x45d64a;return _0x217c42;})[_0xb29c('0x26')](respondWithFilteredResult(_0x3926bf,_0x2a06eb))[_0xb29c('0x44')](handleError(_0x3926bf,null));};exports[_0xb29c('0x45')]=function(_0x5236da,_0xd89bc){var _0x26cef2={'raw':![],'where':{'id':_0x5236da[_0xb29c('0x46')]['id']}},_0x54967b={};_0x54967b[_0xb29c('0x31')]=_[_0xb29c('0x33')](db[_0xb29c('0x2d')]['rawAttributes']);_0x54967b[_0xb29c('0x32')]=_[_0xb29c('0x33')](_0x5236da[_0xb29c('0x32')]);_0x54967b['filters']=_['intersection'](_0x54967b[_0xb29c('0x31')],_0x54967b[_0xb29c('0x32')]);_0x26cef2['attributes']=_[_0xb29c('0x35')](_0x54967b[_0xb29c('0x31')],qs[_0xb29c('0x37')](_0x5236da[_0xb29c('0x32')]['fields']));_0x26cef2[_0xb29c('0x36')]=_0x26cef2[_0xb29c('0x36')]['length']?_0x26cef2['attributes']:_0x54967b[_0xb29c('0x31')];if(_0x5236da['query'][_0xb29c('0x47')]){_0x26cef2[_0xb29c('0x48')]=[{'all':!![]}];}_0x26cef2=_['merge']({},_0x26cef2,_0x5236da[_0xb29c('0x42')]);return db[_0xb29c('0x2d')][_0xb29c('0x49')](_0x26cef2)[_0xb29c('0x26')](handleEntityNotFound(_0xd89bc,null))[_0xb29c('0x26')](respondWithResult(_0xd89bc,null))[_0xb29c('0x44')](handleError(_0xd89bc,null));};exports[_0xb29c('0x4a')]=function(_0x2c0f16,_0x2999a3){return db[_0xb29c('0x2d')][_0xb29c('0x4a')](_0x2c0f16[_0xb29c('0x4b')],{})[_0xb29c('0x26')](respondWithResult(_0x2999a3,0xc9))[_0xb29c('0x44')](handleError(_0x2999a3,null));};exports[_0xb29c('0x25')]=function(_0x23120b,_0x4540c7){if(_0x23120b[_0xb29c('0x4b')]['id']){delete _0x23120b['body']['id'];}return db[_0xb29c('0x2d')]['find']({'where':{'id':_0x23120b[_0xb29c('0x46')]['id']}})[_0xb29c('0x26')](handleEntityNotFound(_0x4540c7,null))[_0xb29c('0x26')](saveUpdates(_0x23120b['body'],null))[_0xb29c('0x26')](respondWithResult(_0x4540c7,null))[_0xb29c('0x44')](handleError(_0x4540c7,null));};exports[_0xb29c('0x4c')]=function(_0x590b60,_0x488d83){return db[_0xb29c('0x2d')]['find']({'where':{'id':_0x590b60[_0xb29c('0x46')]['id']}})[_0xb29c('0x26')](handleEntityNotFound(_0x488d83,null))[_0xb29c('0x26')](removeEntity(_0x488d83,null))[_0xb29c('0x44')](handleError(_0x488d83,null));};exports[_0xb29c('0x4d')]=function(_0xec499e,_0x12ce7a,_0x35bb37){var _0x3d33e2={};var _0x5a74fc={};var _0x497223;var _0x595a18;return db[_0xb29c('0x2d')]['findOne']({'where':{'id':_0xec499e[_0xb29c('0x46')]['id']}})[_0xb29c('0x26')](handleEntityNotFound(_0x12ce7a,null))[_0xb29c('0x26')](function(_0x4b9aef){if(_0x4b9aef){_0x497223=_0x4b9aef;_0x5a74fc[_0xb29c('0x31')]=_[_0xb29c('0x33')](db[_0xb29c('0x4e')][_0xb29c('0x2e')]);_0x5a74fc[_0xb29c('0x32')]=_[_0xb29c('0x33')](_0xec499e[_0xb29c('0x32')]);_0x5a74fc[_0xb29c('0x34')]=_[_0xb29c('0x35')](_0x5a74fc['model'],_0x5a74fc[_0xb29c('0x32')]);_0x3d33e2[_0xb29c('0x36')]=_['intersection'](_0x5a74fc['model'],qs[_0xb29c('0x37')](_0xec499e[_0xb29c('0x32')][_0xb29c('0x37')]));_0x3d33e2['attributes']=_0x3d33e2[_0xb29c('0x36')][_0xb29c('0x38')]?_0x3d33e2[_0xb29c('0x36')]:_0x5a74fc['model'];_0x3d33e2[_0xb29c('0x3a')]=qs[_0xb29c('0x3b')](_0xec499e[_0xb29c('0x32')][_0xb29c('0x3b')]);_0x3d33e2[_0xb29c('0x3c')]=qs['filters'](_[_0xb29c('0x3d')](_0xec499e[_0xb29c('0x32')],_0x5a74fc['filters']));if(_0xec499e['query'][_0xb29c('0x3e')]){_0x3d33e2[_0xb29c('0x3c')]=_[_0xb29c('0x3f')](_0x3d33e2[_0xb29c('0x3c')],{'$or':_[_0xb29c('0x2c')](_0x3d33e2[_0xb29c('0x36')],function(_0x3eb430){var _0x376d16={};_0x376d16[_0x3eb430]={'$like':'%'+_0xec499e[_0xb29c('0x32')]['filter']+'%'};return _0x376d16;})});}_0x3d33e2=_[_0xb29c('0x3f')]({},_0x3d33e2,_0xec499e[_0xb29c('0x42')]);return _0x497223[_0xb29c('0x4d')](_0x3d33e2);}})[_0xb29c('0x26')](function(_0x56403a){if(_0x56403a){_0x595a18=_0x56403a[_0xb29c('0x38')];if(!_0xec499e[_0xb29c('0x32')]['hasOwnProperty'](_0xb29c('0x39'))){_0x3d33e2['limit']=qs[_0xb29c('0x1f')](_0xec499e[_0xb29c('0x32')][_0xb29c('0x1f')]);_0x3d33e2['offset']=qs[_0xb29c('0x1d')](_0xec499e[_0xb29c('0x32')][_0xb29c('0x1d')]);}return _0x497223['getConfigurations'](_0x3d33e2);}})['then'](function(_0x4280a3){if(_0x4280a3){return _0x4280a3?{'count':_0x595a18,'rows':_0x4280a3}:null;}})[_0xb29c('0x26')](respondWithResult(_0x12ce7a,null))[_0xb29c('0x44')](handleError(_0x12ce7a,null));};exports[_0xb29c('0x4f')]=function(_0xc87213,_0x243bbd,_0x4d7af9){if(_0xc87213[_0xb29c('0x4b')]['id']){delete _0xc87213[_0xb29c('0x4b')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0xc87213[_0xb29c('0x46')]['id']}})[_0xb29c('0x26')](handleEntityNotFound(_0x243bbd,null))['then'](function(_0x5551ad){if(_0x5551ad){_0xc87213['body'][_0xb29c('0x50')]=_0x5551ad['id'];_0xc87213['body'][_0xb29c('0x51')]=integrations['getSubjects'](_0xc87213[_0xb29c('0x4b')][_0xb29c('0x52')],_0xc87213[_0xb29c('0x4b')][_0xb29c('0x40')]);_0xc87213[_0xb29c('0x4b')][_0xb29c('0x53')]=integrations[_0xb29c('0x54')](_0xc87213[_0xb29c('0x4b')]['channel'],_0xc87213['body'][_0xb29c('0x40')]);return db[_0xb29c('0x4e')][_0xb29c('0x4a')](_0xc87213[_0xb29c('0x4b')],{'include':[{'model':db[_0xb29c('0x55')],'as':'Subjects'},{'model':db[_0xb29c('0x55')],'as':'Descriptions'}]});}return null;})[_0xb29c('0x26')](respondWithResult(_0x243bbd,null))[_0xb29c('0x44')](handleError(_0x243bbd,null));};exports[_0xb29c('0x56')]=function(_0x94e725,_0x1d94af,_0x3dfd56){var _0x50e907='';var _0xdd47c4=['id','name',_0xb29c('0x57'),_0xb29c('0x58'),'description','date_start',_0xb29c('0x59'),_0xb29c('0x5a'),_0xb29c('0x5b'),_0xb29c('0x5c'),_0xb29c('0x5d'),_0xb29c('0x5e')];return db[_0xb29c('0x2d')][_0xb29c('0x5f')]({'where':{'id':_0x94e725[_0xb29c('0x46')]['id']},'attributes':['id',_0xb29c('0x60'),_0xb29c('0x61'),_0xb29c('0x62')]})['then'](handleEntityNotFound(_0x1d94af,null))[_0xb29c('0x26')](function(_0x334da7){if(_0x334da7){_0x50e907=_0x334da7[_0xb29c('0x62')];var _0x4dede3=_0x50e907['slice'](-0x1);if(_0x4dede3==='/'){_0x50e907=_0x50e907['substring'](0x0,_0x50e907[_0xb29c('0x63')](_0x4dede3));}return rp({'method':_0xb29c('0x64'),'uri':util[_0xb29c('0x65')](_0xb29c('0x66'),_0x50e907,_0xb29c('0x67')),'json':!![],'form':{'method':_0xb29c('0x68'),'input_type':_0xb29c('0x69'),'response_type':_0xb29c('0x69'),'rest_data':JSON[_0xb29c('0x6a')]({'user_auth':{'user_name':_0x334da7['username'],'password':_0x334da7['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0xa45673){if(_0xa45673&&_0xa45673[_0xb29c('0x29')]!==_0xb29c('0x6b')&&_0xa45673[_0xb29c('0x29')]!==_0xb29c('0x6c')){return rp({'method':_0xb29c('0x64'),'uri':util[_0xb29c('0x65')](_0xb29c('0x66'),_0x50e907,_0xb29c('0x67')),'json':!![],'form':{'method':_0xb29c('0x6d'),'input_type':_0xb29c('0x69'),'response_type':_0xb29c('0x69'),'rest_data':JSON[_0xb29c('0x6a')]({'session':_0xa45673['id'],'module_name':'Calls'})}})[_0xb29c('0x26')](function(_0x306fe7){if(_0x306fe7){var _0x57601b=_['values'](_0x306fe7[_0xb29c('0x6e')]);_[_0xb29c('0x6f')](_0x57601b,function(_0x105c8f){return _0xdd47c4[_0xb29c('0x70')](_0x105c8f[_0xb29c('0x29')]);});return{'count':_0x57601b[_0xb29c('0x38')],'rows':_['map'](_0x57601b,function(_0x5d1e6c){return{'id':_0x5d1e6c[_0xb29c('0x29')],'name':_0x5d1e6c[_0xb29c('0x71')],'custom':_[_0xb29c('0x72')](_0x5d1e6c[_0xb29c('0x29')],'_c')?!![]:![],'options':_0x5d1e6c[_0xb29c('0x42')]?_[_0xb29c('0x2c')](_[_0xb29c('0x73')](_0x5d1e6c['options']),function(_0x3c858c){return{'name':_0x3c858c[_0xb29c('0x74')],'value':_0x3c858c[_0xb29c('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x1d94af,null))[_0xb29c('0x44')](function(_0x49ac60){var _0x2212cc=_0x94e725[_0xb29c('0x32')][_0xb29c('0x75')]?0x1f4:_0x49ac60['statusCode']||0x1f4;logger[_0xb29c('0x27')](_0xb29c('0x76'),'getFields',_0x2212cc,JSON[_0xb29c('0x6a')](_0x49ac60));delete _0x49ac60[_0xb29c('0x29')];if(_0x2212cc===0x191){_0x2212cc=0x190;}_0x1d94af['status'](_0x2212cc)[_0xb29c('0x2a')](_0x94e725[_0xb29c('0x32')][_0xb29c('0x75')]?{'message':_0xb29c('0x77'),'statusCode':_0x49ac60[_0xb29c('0x78')]}:_0x49ac60);});}else{var _0x3ace23=0x1f4;_0x1d94af[_0xb29c('0x1a')](_0x3ace23)[_0xb29c('0x2a')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x6092=['apply','save','update','then','error','stack','send','map','SugarcrmAccount','rawAttributes','fieldName','key','model','name','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','type','VIRTUAL','includeAll','include','findAll','filters','merge','find','catch','create','body','params','destroy','getConfigurations','findOne','SugarcrmConfiguration','pick','filter','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','module_fields','includes','label','options','value','test','statusCode','getFields','Wrong\x20credentials','eml-format','zip-dir','moment','path','sox','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','sendStatus','offset','count','limit','status','set','Content-Range','json'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x6092,0xc0));var _0x2609=function(_0x1fd988,_0x31a93c){_0x1fd988=_0x1fd988-0x0;var _0x4bc3cf=_0x6092[_0x1fd988];return _0x4bc3cf;};'use strict';var emlformat=require(_0x2609('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2609('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2609('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2609('0x3'));var sox=require(_0x2609('0x4'));var csv=require(_0x2609('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2609('0x6'));var crypto=require(_0x2609('0x7'));var jsforce=require(_0x2609('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x2609('0x5'));var querystring=require(_0x2609('0x9'));var Papa=require('papaparse');var Redis=require(_0x2609('0xa'));var authService=require(_0x2609('0xb'));var qs=require(_0x2609('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2609('0xd'));var logger=require(_0x2609('0xe'))(_0x2609('0xf'));var utils=require('../../config/utils');var config=require(_0x2609('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2609('0x11'));function respondWithStatusCode(_0x1365c6,_0x3636c3){_0x3636c3=_0x3636c3||0xcc;return function(_0x4f9d23){if(_0x4f9d23){return _0x1365c6[_0x2609('0x12')](_0x3636c3);}return _0x1365c6['status'](_0x3636c3)['end']();};}function respondWithResult(_0x2ec903,_0x5d34ce){_0x5d34ce=_0x5d34ce||0xc8;return function(_0x4c8c37){if(_0x4c8c37){return _0x2ec903['status'](_0x5d34ce)['json'](_0x4c8c37);}};}function respondWithFilteredResult(_0x42e127,_0x4e5035){return function(_0x26a6ae){if(_0x26a6ae){var _0xa6b74c=typeof _0x4e5035[_0x2609('0x13')]==='undefined'&&typeof _0x4e5035['limit']==='undefined';var _0x9de9d=_0x26a6ae[_0x2609('0x14')];var _0x4b7322=_0xa6b74c?0x0:_0x4e5035['offset'];var _0x2ae134=_0xa6b74c?_0x26a6ae[_0x2609('0x14')]:_0x4e5035[_0x2609('0x13')]+_0x4e5035[_0x2609('0x15')];var _0x3c4e88;if(_0x2ae134>=_0x9de9d){_0x2ae134=_0x9de9d;_0x3c4e88=0xc8;}else{_0x3c4e88=0xce;}_0x42e127[_0x2609('0x16')](_0x3c4e88);return _0x42e127[_0x2609('0x17')](_0x2609('0x18'),_0x4b7322+'-'+_0x2ae134+'/'+_0x9de9d)[_0x2609('0x19')](_0x26a6ae);}return null;};}function patchUpdates(_0x4f549f){return function(_0x9f8bb6){try{jsonpatch[_0x2609('0x1a')](_0x9f8bb6,_0x4f549f,!![]);}catch(_0x4d20ea){return BPromise['reject'](_0x4d20ea);}return _0x9f8bb6[_0x2609('0x1b')]();};}function saveUpdates(_0x445e39,_0x141798){return function(_0x13660f){if(_0x13660f){return _0x13660f[_0x2609('0x1c')](_0x445e39)['then'](function(_0x114d2e){return _0x114d2e;});}return null;};}function removeEntity(_0x373786,_0x5e1ac3){return function(_0x4077c8){if(_0x4077c8){return _0x4077c8['destroy']()[_0x2609('0x1d')](function(){_0x373786['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8f48,_0x464ade){return function(_0xbe4c1e){if(!_0xbe4c1e){_0x3c8f48[_0x2609('0x12')](0x194);}return _0xbe4c1e;};}function handleError(_0x1a0a8b,_0x1a0200){_0x1a0200=_0x1a0200||0x1f4;return function(_0x2b87a4){logger[_0x2609('0x1e')](_0x2b87a4[_0x2609('0x1f')]);if(_0x2b87a4['name']){delete _0x2b87a4['name'];}_0x1a0a8b['status'](_0x1a0200)[_0x2609('0x20')](_0x2b87a4);};}exports['index']=function(_0x18ff30,_0x35a0ae){var _0x339fb2={},_0x1b383c={},_0x5320c7={'count':0x0,'rows':[]};var _0x544863=_[_0x2609('0x21')](db[_0x2609('0x22')][_0x2609('0x23')],function(_0x11e2f8){return{'name':_0x11e2f8[_0x2609('0x24')],'type':_0x11e2f8['type'][_0x2609('0x25')]};});_0x1b383c[_0x2609('0x26')]=_[_0x2609('0x21')](_0x544863,_0x2609('0x27'));_0x1b383c['query']=_[_0x2609('0x28')](_0x18ff30['query']);_0x1b383c['filters']=_[_0x2609('0x29')](_0x1b383c[_0x2609('0x26')],_0x1b383c[_0x2609('0x2a')]);_0x339fb2[_0x2609('0x2b')]=_[_0x2609('0x29')](_0x1b383c[_0x2609('0x26')],qs[_0x2609('0x2c')](_0x18ff30['query'][_0x2609('0x2c')]));_0x339fb2[_0x2609('0x2b')]=_0x339fb2[_0x2609('0x2b')][_0x2609('0x2d')]?_0x339fb2[_0x2609('0x2b')]:_0x1b383c[_0x2609('0x26')];if(!_0x18ff30[_0x2609('0x2a')][_0x2609('0x2e')]('nolimit')){_0x339fb2[_0x2609('0x15')]=qs[_0x2609('0x15')](_0x18ff30[_0x2609('0x2a')][_0x2609('0x15')]);_0x339fb2[_0x2609('0x13')]=qs[_0x2609('0x13')](_0x18ff30[_0x2609('0x2a')][_0x2609('0x13')]);}_0x339fb2[_0x2609('0x2f')]=qs['sort'](_0x18ff30['query'][_0x2609('0x30')]);_0x339fb2[_0x2609('0x31')]=qs['filters'](_['pick'](_0x18ff30[_0x2609('0x2a')],_0x1b383c['filters']),_0x544863);if(_0x18ff30['query']['filter']){_0x339fb2[_0x2609('0x31')]=_['merge'](_0x339fb2[_0x2609('0x31')],{'$or':_[_0x2609('0x21')](_0x544863,function(_0x176473){if(_0x176473[_0x2609('0x32')]!==_0x2609('0x33')){var _0x3f4ea3={};_0x3f4ea3[_0x176473[_0x2609('0x27')]]={'$like':'%'+_0x18ff30[_0x2609('0x2a')]['filter']+'%'};return _0x3f4ea3;}})});}_0x339fb2=_['merge']({},_0x339fb2,_0x18ff30['options']);var _0x15252f={'where':_0x339fb2[_0x2609('0x31')]};return db[_0x2609('0x22')][_0x2609('0x14')](_0x15252f)[_0x2609('0x1d')](function(_0xd734f6){_0x5320c7['count']=_0xd734f6;if(_0x18ff30[_0x2609('0x2a')][_0x2609('0x34')]){_0x339fb2[_0x2609('0x35')]=[{'all':!![]}];}return db[_0x2609('0x22')][_0x2609('0x36')](_0x339fb2);})[_0x2609('0x1d')](function(_0x21ed87){_0x5320c7['rows']=_0x21ed87;return _0x5320c7;})[_0x2609('0x1d')](respondWithFilteredResult(_0x35a0ae,_0x339fb2))['catch'](handleError(_0x35a0ae,null));};exports['show']=function(_0x14f131,_0x5856a9){var _0x5b29e8={'raw':![],'where':{'id':_0x14f131['params']['id']}},_0x59541a={};_0x59541a[_0x2609('0x26')]=_[_0x2609('0x28')](db['SugarcrmAccount'][_0x2609('0x23')]);_0x59541a[_0x2609('0x2a')]=_[_0x2609('0x28')](_0x14f131[_0x2609('0x2a')]);_0x59541a[_0x2609('0x37')]=_[_0x2609('0x29')](_0x59541a[_0x2609('0x26')],_0x59541a[_0x2609('0x2a')]);_0x5b29e8[_0x2609('0x2b')]=_[_0x2609('0x29')](_0x59541a['model'],qs[_0x2609('0x2c')](_0x14f131[_0x2609('0x2a')][_0x2609('0x2c')]));_0x5b29e8['attributes']=_0x5b29e8[_0x2609('0x2b')]['length']?_0x5b29e8[_0x2609('0x2b')]:_0x59541a[_0x2609('0x26')];if(_0x14f131[_0x2609('0x2a')][_0x2609('0x34')]){_0x5b29e8[_0x2609('0x35')]=[{'all':!![]}];}_0x5b29e8=_[_0x2609('0x38')]({},_0x5b29e8,_0x14f131['options']);return db[_0x2609('0x22')][_0x2609('0x39')](_0x5b29e8)['then'](handleEntityNotFound(_0x5856a9,null))[_0x2609('0x1d')](respondWithResult(_0x5856a9,null))[_0x2609('0x3a')](handleError(_0x5856a9,null));};exports[_0x2609('0x3b')]=function(_0x303f2a,_0x5623e5){return db[_0x2609('0x22')][_0x2609('0x3b')](_0x303f2a[_0x2609('0x3c')],{})[_0x2609('0x1d')](respondWithResult(_0x5623e5,0xc9))[_0x2609('0x3a')](handleError(_0x5623e5,null));};exports['update']=function(_0x13bc27,_0x3171cb){if(_0x13bc27[_0x2609('0x3c')]['id']){delete _0x13bc27[_0x2609('0x3c')]['id'];}return db[_0x2609('0x22')][_0x2609('0x39')]({'where':{'id':_0x13bc27[_0x2609('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3171cb,null))[_0x2609('0x1d')](saveUpdates(_0x13bc27['body'],null))['then'](respondWithResult(_0x3171cb,null))[_0x2609('0x3a')](handleError(_0x3171cb,null));};exports[_0x2609('0x3e')]=function(_0x3f81ee,_0x166419){return db[_0x2609('0x22')][_0x2609('0x39')]({'where':{'id':_0x3f81ee[_0x2609('0x3d')]['id']}})['then'](handleEntityNotFound(_0x166419,null))[_0x2609('0x1d')](removeEntity(_0x166419,null))[_0x2609('0x3a')](handleError(_0x166419,null));};exports[_0x2609('0x3f')]=function(_0x375337,_0x1a53b1,_0x1a86fd){var _0x43bcce={};var _0x533423={};var _0x49c990;var _0x151ab1;return db[_0x2609('0x22')][_0x2609('0x40')]({'where':{'id':_0x375337[_0x2609('0x3d')]['id']}})[_0x2609('0x1d')](handleEntityNotFound(_0x1a53b1,null))[_0x2609('0x1d')](function(_0x7982ab){if(_0x7982ab){_0x49c990=_0x7982ab;_0x533423[_0x2609('0x26')]=_[_0x2609('0x28')](db[_0x2609('0x41')]['rawAttributes']);_0x533423['query']=_[_0x2609('0x28')](_0x375337['query']);_0x533423[_0x2609('0x37')]=_['intersection'](_0x533423[_0x2609('0x26')],_0x533423[_0x2609('0x2a')]);_0x43bcce[_0x2609('0x2b')]=_['intersection'](_0x533423[_0x2609('0x26')],qs[_0x2609('0x2c')](_0x375337[_0x2609('0x2a')][_0x2609('0x2c')]));_0x43bcce[_0x2609('0x2b')]=_0x43bcce['attributes'][_0x2609('0x2d')]?_0x43bcce['attributes']:_0x533423['model'];_0x43bcce[_0x2609('0x2f')]=qs[_0x2609('0x30')](_0x375337[_0x2609('0x2a')]['sort']);_0x43bcce[_0x2609('0x31')]=qs[_0x2609('0x37')](_[_0x2609('0x42')](_0x375337[_0x2609('0x2a')],_0x533423['filters']));if(_0x375337[_0x2609('0x2a')]['filter']){_0x43bcce['where']=_[_0x2609('0x38')](_0x43bcce[_0x2609('0x31')],{'$or':_['map'](_0x43bcce[_0x2609('0x2b')],function(_0x3eeb93){var _0x2318ad={};_0x2318ad[_0x3eeb93]={'$like':'%'+_0x375337[_0x2609('0x2a')][_0x2609('0x43')]+'%'};return _0x2318ad;})});}_0x43bcce=_[_0x2609('0x38')]({},_0x43bcce,_0x375337['options']);return _0x49c990[_0x2609('0x3f')](_0x43bcce);}})[_0x2609('0x1d')](function(_0x1bed5d){if(_0x1bed5d){_0x151ab1=_0x1bed5d[_0x2609('0x2d')];if(!_0x375337[_0x2609('0x2a')][_0x2609('0x2e')](_0x2609('0x44'))){_0x43bcce[_0x2609('0x15')]=qs['limit'](_0x375337['query'][_0x2609('0x15')]);_0x43bcce[_0x2609('0x13')]=qs[_0x2609('0x13')](_0x375337['query']['offset']);}return _0x49c990['getConfigurations'](_0x43bcce);}})['then'](function(_0x263436){if(_0x263436){return _0x263436?{'count':_0x151ab1,'rows':_0x263436}:null;}})[_0x2609('0x1d')](respondWithResult(_0x1a53b1,null))[_0x2609('0x3a')](handleError(_0x1a53b1,null));};exports[_0x2609('0x45')]=function(_0xba6a45,_0x3e13ff,_0x18d73b){if(_0xba6a45[_0x2609('0x3c')]['id']){delete _0xba6a45['body']['id'];}return db[_0x2609('0x22')]['findOne']({'where':{'id':_0xba6a45[_0x2609('0x3d')]['id']}})[_0x2609('0x1d')](handleEntityNotFound(_0x3e13ff,null))[_0x2609('0x1d')](function(_0x4e9d00){if(_0x4e9d00){_0xba6a45[_0x2609('0x3c')]['AccountId']=_0x4e9d00['id'];_0xba6a45[_0x2609('0x3c')][_0x2609('0x46')]=integrations[_0x2609('0x47')](_0xba6a45[_0x2609('0x3c')][_0x2609('0x48')],_0xba6a45[_0x2609('0x3c')][_0x2609('0x32')]);_0xba6a45[_0x2609('0x3c')][_0x2609('0x49')]=integrations[_0x2609('0x4a')](_0xba6a45['body']['channel'],_0xba6a45['body'][_0x2609('0x32')]);return db['SugarcrmConfiguration'][_0x2609('0x3b')](_0xba6a45[_0x2609('0x3c')],{'include':[{'model':db[_0x2609('0x4b')],'as':'Subjects'},{'model':db[_0x2609('0x4b')],'as':_0x2609('0x49')}]});}return null;})[_0x2609('0x1d')](respondWithResult(_0x3e13ff,null))['catch'](handleError(_0x3e13ff,null));};exports['getFields']=function(_0x473ba8,_0x134bd1,_0x3ec00c){var _0x38f76f='';var _0x48eddb=['id',_0x2609('0x27'),'assigned_user_id',_0x2609('0x4c'),_0x2609('0x4d'),_0x2609('0x4e'),_0x2609('0x4f'),_0x2609('0x50'),_0x2609('0x51'),_0x2609('0x52'),_0x2609('0x53'),_0x2609('0x54')];return db[_0x2609('0x22')]['findOne']({'where':{'id':_0x473ba8[_0x2609('0x3d')]['id']},'attributes':['id',_0x2609('0x55'),_0x2609('0x56'),_0x2609('0x57')]})['then'](handleEntityNotFound(_0x134bd1,null))[_0x2609('0x1d')](function(_0x322b45){if(_0x322b45){_0x38f76f=_0x322b45[_0x2609('0x57')];var _0x2dc8ac=_0x38f76f[_0x2609('0x58')](-0x1);if(_0x2dc8ac==='/'){_0x38f76f=_0x38f76f['substring'](0x0,_0x38f76f[_0x2609('0x59')](_0x2dc8ac));}return rp({'method':_0x2609('0x5a'),'uri':util['format']('%s%s',_0x38f76f,_0x2609('0x5b')),'json':!![],'form':{'method':_0x2609('0x5c'),'input_type':_0x2609('0x5d'),'response_type':_0x2609('0x5d'),'rest_data':JSON[_0x2609('0x5e')]({'user_auth':{'user_name':_0x322b45[_0x2609('0x55')],'password':_0x322b45[_0x2609('0x56')],'encryption':_0x2609('0x5f')},'application':_0x2609('0x60')})}});}})[_0x2609('0x1d')](function(_0x13da8d){if(_0x13da8d&&_0x13da8d[_0x2609('0x27')]!==_0x2609('0x61')&&_0x13da8d['name']!==_0x2609('0x62')){return rp({'method':_0x2609('0x5a'),'uri':util['format']('%s%s',_0x38f76f,_0x2609('0x5b')),'json':!![],'form':{'method':_0x2609('0x63'),'input_type':_0x2609('0x5d'),'response_type':_0x2609('0x5d'),'rest_data':JSON['stringify']({'session':_0x13da8d['id'],'module_name':'Calls'})}})[_0x2609('0x1d')](function(_0x37297c){if(_0x37297c){var _0x442931=_['values'](_0x37297c[_0x2609('0x64')]);_['remove'](_0x442931,function(_0x2e4914){return _0x48eddb[_0x2609('0x65')](_0x2e4914[_0x2609('0x27')]);});return{'count':_0x442931[_0x2609('0x2d')],'rows':_[_0x2609('0x21')](_0x442931,function(_0x346408){return{'id':_0x346408[_0x2609('0x27')],'name':_0x346408[_0x2609('0x66')],'custom':_['endsWith'](_0x346408[_0x2609('0x27')],'_c')?!![]:![],'options':_0x346408[_0x2609('0x67')]?_['map'](_['values'](_0x346408[_0x2609('0x67')]),function(_0x5e226c){return{'name':_0x5e226c[_0x2609('0x68')],'value':_0x5e226c[_0x2609('0x27')]};}):[]};})};}})[_0x2609('0x1d')](respondWithResult(_0x134bd1,null))[_0x2609('0x3a')](function(_0x45868a){var _0x311b69=_0x473ba8[_0x2609('0x2a')][_0x2609('0x69')]?0x1f4:_0x45868a[_0x2609('0x6a')]||0x1f4;logger[_0x2609('0x1e')]('getFields,\x20%s,\x20%s,\x20%s',_0x2609('0x6b'),_0x311b69,JSON[_0x2609('0x5e')](_0x45868a));delete _0x45868a[_0x2609('0x27')];if(_0x311b69===0x191){_0x311b69=0x190;}_0x134bd1[_0x2609('0x16')](_0x311b69)[_0x2609('0x20')](_0x473ba8['query'][_0x2609('0x69')]?{'message':_0x2609('0x6c'),'statusCode':_0x45868a[_0x2609('0x6a')]}:_0x45868a);});}else{var _0x4dccac=0x1f4;_0x134bd1[_0x2609('0x16')](_0x4dccac)['send']({'message':_0x2609('0x6c'),'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 9ec77c1..8a079fa 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 _0xb923=['bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','../../config/logger','api'];(function(_0x4c3d41,_0x2263a1){var _0x3f198e=function(_0x30dcca){while(--_0x30dcca){_0x4c3d41['push'](_0x4c3d41['shift']());}};_0x3f198e(++_0x2263a1);}(_0xb923,0x80));var _0x3b92=function(_0x10f526,_0x2f160b){_0x10f526=_0x10f526-0x0;var _0x274a13=_0xb923[_0x10f526];return _0x274a13;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3b92('0x0'))(_0x3b92('0x1'));var moment=require('moment');var BPromise=require(_0x3b92('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b92('0x3'));var rimraf=require(_0x3b92('0x4'));var config=require(_0x3b92('0x5'));var attributes=require(_0x3b92('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3b92('0x7')]=function(_0x4de09e,_0x11b1d3){return _0x4de09e['define'](_0x3b92('0x8'),attributes,{'tableName':_0x3b92('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf09f=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3e0995,_0x1f0946){var _0x4fe9ea=function(_0x466dc2){while(--_0x466dc2){_0x3e0995['push'](_0x3e0995['shift']());}};_0x4fe9ea(++_0x1f0946);}(_0xf09f,0x1cc));var _0xff09=function(_0x3fcbd9,_0xdbc3b7){_0x3fcbd9=_0x3fcbd9-0x0;var _0x1a4b0a=_0xf09f[_0x3fcbd9];return _0x1a4b0a;};'use strict';var _=require('lodash');var util=require(_0xff09('0x0'));var logger=require(_0xff09('0x1'))(_0xff09('0x2'));var moment=require(_0xff09('0x3'));var BPromise=require(_0xff09('0x4'));var rp=require(_0xff09('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff09('0x6'));var config=require(_0xff09('0x7'));var attributes=require(_0xff09('0x8'));var integrations=require(_0xff09('0x9'));module[_0xff09('0xa')]=function(_0x2da9e6,_0x33ef6e){return _0x2da9e6[_0xff09('0xb')](_0xff09('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','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 6da0cae..12b7f74 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 _0x0ad0=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetSugarcrmAccount','findAll','options','attributes','include','map','model','catch','ShowSugarcrmAccount','find','where','lodash','moment'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x0ad0,0xf6));var _0x00ad=function(_0x46dad5,_0x132bdd){_0x46dad5=_0x46dad5-0x0;var _0x5cfc41=_0x0ad0[_0x46dad5];return _0x5cfc41;};'use strict';var _=require(_0x00ad('0x0'));var util=require('util');var moment=require(_0x00ad('0x1'));var BPromise=require(_0x00ad('0x2'));var rs=require(_0x00ad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x00ad('0x4'))['db'];var utils=require(_0x00ad('0x5'));var logger=require(_0x00ad('0x6'))('rpc');var config=require(_0x00ad('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47116d,_0x10bf55,_0xde29a1){return new BPromise(function(_0x375f47,_0x2e9f41){return client[_0x00ad('0x8')](_0x47116d,_0xde29a1)[_0x00ad('0x9')](function(_0x42d2ab){logger['info'](_0x00ad('0xa'),_0x10bf55,_0x00ad('0xb'));logger[_0x00ad('0xc')](_0x00ad('0xd'),_0x10bf55,_0x00ad('0xb'),JSON[_0x00ad('0xe')](_0x42d2ab));if(_0x42d2ab[_0x00ad('0xf')]){if(_0x42d2ab['error'][_0x00ad('0x10')]===0x1f4){logger[_0x00ad('0xf')](_0x00ad('0xa'),_0x10bf55,_0x42d2ab[_0x00ad('0xf')]['message']);return _0x2e9f41(_0x42d2ab[_0x00ad('0xf')][_0x00ad('0x11')]);}logger[_0x00ad('0xf')](_0x00ad('0xa'),_0x10bf55,_0x42d2ab[_0x00ad('0xf')]['message']);return _0x375f47(_0x42d2ab['error'][_0x00ad('0x11')]);}else{logger[_0x00ad('0x12')](_0x00ad('0xa'),_0x10bf55,'request\x20sent');_0x375f47(_0x42d2ab[_0x00ad('0x13')]['message']);}})['catch'](function(_0x54fc37){logger['error'](_0x00ad('0xa'),_0x10bf55,_0x54fc37);_0x2e9f41(_0x54fc37);});});}exports[_0x00ad('0x14')]=function(_0x140001){var _0x1cc1cd=this;return new Promise(function(_0x378a42,_0x3ddfd9){return db['SugarcrmAccount'][_0x00ad('0x15')]({'raw':_0x140001[_0x00ad('0x16')]?_0x140001[_0x00ad('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x140001[_0x00ad('0x16')]?_0x140001[_0x00ad('0x16')]['where']||null:null,'attributes':_0x140001[_0x00ad('0x16')]?_0x140001['options'][_0x00ad('0x17')]||null:null,'limit':_0x140001['options']?_0x140001[_0x00ad('0x16')]['limit']||null:null,'include':_0x140001[_0x00ad('0x16')]?_0x140001[_0x00ad('0x16')][_0x00ad('0x18')]?_[_0x00ad('0x19')](_0x140001[_0x00ad('0x16')]['include'],function(_0x356544){return{'model':db[_0x356544[_0x00ad('0x1a')]],'as':_0x356544['as'],'attributes':_0x356544[_0x00ad('0x17')],'include':_0x356544[_0x00ad('0x18')]?_[_0x00ad('0x19')](_0x356544[_0x00ad('0x18')],function(_0x3522e4){return{'model':db[_0x3522e4['model']],'as':_0x3522e4['as'],'attributes':_0x3522e4['attributes'],'include':_0x3522e4['include']?_[_0x00ad('0x19')](_0x3522e4[_0x00ad('0x18')],function(_0x8c2a89){return{'model':db[_0x8c2a89[_0x00ad('0x1a')]],'as':_0x8c2a89['as'],'attributes':_0x8c2a89[_0x00ad('0x17')]};}):[]};}):[]};}):[]:[]})[_0x00ad('0x9')](function(_0x26618f){logger['info'](_0x00ad('0x14'),_0x140001);logger[_0x00ad('0xc')]('GetSugarcrmAccount',_0x140001,JSON[_0x00ad('0xe')](_0x26618f));_0x378a42(_0x26618f);})[_0x00ad('0x1b')](function(_0xf38c77){logger['error'](_0x00ad('0x14'),_0xf38c77['message'],_0x140001);_0x3ddfd9(_0x1cc1cd[_0x00ad('0xf')](0x1f4,_0xf38c77[_0x00ad('0x11')]));});});};exports[_0x00ad('0x1c')]=function(_0x5e6e63){var _0x450e4c=this;return new Promise(function(_0x4bb2ac,_0x477192){return db['SugarcrmAccount'][_0x00ad('0x1d')]({'raw':_0x5e6e63[_0x00ad('0x16')]?_0x5e6e63[_0x00ad('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5e6e63[_0x00ad('0x16')]?_0x5e6e63['options'][_0x00ad('0x1e')]||null:null,'attributes':_0x5e6e63['options']?_0x5e6e63[_0x00ad('0x16')][_0x00ad('0x17')]||null:null,'include':_0x5e6e63[_0x00ad('0x16')]?_0x5e6e63['options'][_0x00ad('0x18')]?_['map'](_0x5e6e63['options'][_0x00ad('0x18')],function(_0x3ed257){return{'model':db[_0x3ed257['model']],'as':_0x3ed257['as'],'attributes':_0x3ed257[_0x00ad('0x17')],'include':_0x3ed257['include']?_['map'](_0x3ed257['include'],function(_0x5987c4){return{'model':db[_0x5987c4[_0x00ad('0x1a')]],'as':_0x5987c4['as'],'attributes':_0x5987c4['attributes'],'include':_0x5987c4[_0x00ad('0x18')]?_[_0x00ad('0x19')](_0x5987c4['include'],function(_0x31f4ca){return{'model':db[_0x31f4ca[_0x00ad('0x1a')]],'as':_0x31f4ca['as'],'attributes':_0x31f4ca[_0x00ad('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e838b){logger['info']('ShowSugarcrmAccount',_0x5e6e63);logger['debug'](_0x00ad('0x1c'),_0x5e6e63,JSON[_0x00ad('0xe')](_0x1e838b));_0x4bb2ac(_0x1e838b);})['catch'](function(_0x1f5076){logger[_0x00ad('0xf')]('ShowSugarcrmAccount',_0x1f5076[_0x00ad('0x11')],_0x5e6e63);_0x477192(_0x450e4c['error'](0x1f4,_0x1f5076[_0x00ad('0x11')]));});});}; \ No newline at end of file +var _0xe554=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','catch','ShowSugarcrmAccount','find','lodash'];(function(_0x4dca4f,_0x3d3989){var _0xb1f24e=function(_0x125f21){while(--_0x125f21){_0x4dca4f['push'](_0x4dca4f['shift']());}};_0xb1f24e(++_0x3d3989);}(_0xe554,0x127));var _0x4e55=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe554[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x4e55('0x0'));var util=require('util');var moment=require(_0x4e55('0x1'));var BPromise=require(_0x4e55('0x2'));var rs=require(_0x4e55('0x3'));var fs=require('fs');var Redis=require(_0x4e55('0x4'));var db=require(_0x4e55('0x5'))['db'];var utils=require(_0x4e55('0x6'));var logger=require(_0x4e55('0x7'))(_0x4e55('0x8'));var config=require(_0x4e55('0x9'));var jayson=require(_0x4e55('0xa'));var client=jayson['client'][_0x4e55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25c1cb,_0xa664f6,_0x479e42){return new BPromise(function(_0x270b5e,_0xcf6cc2){return client[_0x4e55('0xc')](_0x25c1cb,_0x479e42)[_0x4e55('0xd')](function(_0x20c227){logger[_0x4e55('0xe')](_0x4e55('0xf'),_0xa664f6,_0x4e55('0x10'));logger[_0x4e55('0x11')](_0x4e55('0x12'),_0xa664f6,'request\x20sent',JSON[_0x4e55('0x13')](_0x20c227));if(_0x20c227[_0x4e55('0x14')]){if(_0x20c227[_0x4e55('0x14')][_0x4e55('0x15')]===0x1f4){logger[_0x4e55('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0xa664f6,_0x20c227[_0x4e55('0x14')][_0x4e55('0x16')]);return _0xcf6cc2(_0x20c227[_0x4e55('0x14')][_0x4e55('0x16')]);}logger[_0x4e55('0x14')](_0x4e55('0xf'),_0xa664f6,_0x20c227[_0x4e55('0x14')][_0x4e55('0x16')]);return _0x270b5e(_0x20c227[_0x4e55('0x14')][_0x4e55('0x16')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0xa664f6,'request\x20sent');_0x270b5e(_0x20c227[_0x4e55('0x17')][_0x4e55('0x16')]);}})['catch'](function(_0xd38b68){logger[_0x4e55('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0xa664f6,_0xd38b68);_0xcf6cc2(_0xd38b68);});});}exports[_0x4e55('0x18')]=function(_0x10424c){var _0xff1f97=this;return new Promise(function(_0x89d491,_0x2f7ab1){return db[_0x4e55('0x19')]['findAll']({'raw':_0x10424c[_0x4e55('0x1a')]?_0x10424c[_0x4e55('0x1a')][_0x4e55('0x1b')]===undefined?!![]:![]:!![],'where':_0x10424c['options']?_0x10424c[_0x4e55('0x1a')][_0x4e55('0x1c')]||null:null,'attributes':_0x10424c['options']?_0x10424c[_0x4e55('0x1a')][_0x4e55('0x1d')]||null:null,'limit':_0x10424c['options']?_0x10424c[_0x4e55('0x1a')][_0x4e55('0x1e')]||null:null,'include':_0x10424c[_0x4e55('0x1a')]?_0x10424c[_0x4e55('0x1a')][_0x4e55('0x1f')]?_['map'](_0x10424c['options'][_0x4e55('0x1f')],function(_0x2f538c){return{'model':db[_0x2f538c['model']],'as':_0x2f538c['as'],'attributes':_0x2f538c[_0x4e55('0x1d')],'include':_0x2f538c['include']?_[_0x4e55('0x20')](_0x2f538c[_0x4e55('0x1f')],function(_0x233d53){return{'model':db[_0x233d53['model']],'as':_0x233d53['as'],'attributes':_0x233d53[_0x4e55('0x1d')],'include':_0x233d53[_0x4e55('0x1f')]?_[_0x4e55('0x20')](_0x233d53[_0x4e55('0x1f')],function(_0x1fbe02){return{'model':db[_0x1fbe02[_0x4e55('0x21')]],'as':_0x1fbe02['as'],'attributes':_0x1fbe02[_0x4e55('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4e55('0xd')](function(_0x9944c1){logger[_0x4e55('0xe')]('GetSugarcrmAccount',_0x10424c);logger[_0x4e55('0x11')](_0x4e55('0x18'),_0x10424c,JSON[_0x4e55('0x13')](_0x9944c1));_0x89d491(_0x9944c1);})[_0x4e55('0x22')](function(_0xbf1232){logger[_0x4e55('0x14')](_0x4e55('0x18'),_0xbf1232['message'],_0x10424c);_0x2f7ab1(_0xff1f97[_0x4e55('0x14')](0x1f4,_0xbf1232[_0x4e55('0x16')]));});});};exports[_0x4e55('0x23')]=function(_0x5a1406){var _0x5be867=this;return new Promise(function(_0x46546c,_0x1a74b2){return db[_0x4e55('0x19')][_0x4e55('0x24')]({'raw':_0x5a1406[_0x4e55('0x1a')]?_0x5a1406[_0x4e55('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5a1406[_0x4e55('0x1a')]?_0x5a1406['options']['where']||null:null,'attributes':_0x5a1406[_0x4e55('0x1a')]?_0x5a1406[_0x4e55('0x1a')]['attributes']||null:null,'include':_0x5a1406[_0x4e55('0x1a')]?_0x5a1406[_0x4e55('0x1a')][_0x4e55('0x1f')]?_[_0x4e55('0x20')](_0x5a1406[_0x4e55('0x1a')][_0x4e55('0x1f')],function(_0x5dddef){return{'model':db[_0x5dddef[_0x4e55('0x21')]],'as':_0x5dddef['as'],'attributes':_0x5dddef[_0x4e55('0x1d')],'include':_0x5dddef[_0x4e55('0x1f')]?_[_0x4e55('0x20')](_0x5dddef[_0x4e55('0x1f')],function(_0x224d96){return{'model':db[_0x224d96[_0x4e55('0x21')]],'as':_0x224d96['as'],'attributes':_0x224d96['attributes'],'include':_0x224d96[_0x4e55('0x1f')]?_[_0x4e55('0x20')](_0x224d96[_0x4e55('0x1f')],function(_0x10a39a){return{'model':db[_0x10a39a[_0x4e55('0x21')]],'as':_0x10a39a['as'],'attributes':_0x10a39a[_0x4e55('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21a4e8){logger[_0x4e55('0xe')](_0x4e55('0x23'),_0x5a1406);logger['debug'](_0x4e55('0x23'),_0x5a1406,JSON['stringify'](_0x21a4e8));_0x46546c(_0x21a4e8);})[_0x4e55('0x22')](function(_0x4bdaf2){logger['error'](_0x4e55('0x23'),_0x4bdaf2['message'],_0x5a1406);_0x1a74b2(_0x5be867[_0x4e55('0x14')](0x1f4,_0x4bdaf2['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 6e90fa9..d47d21a 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 _0x2844=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x238c4a,_0x1b67e){var _0x25a330=function(_0x42cac6){while(--_0x42cac6){_0x238c4a['push'](_0x238c4a['shift']());}};_0x25a330(++_0x1b67e);}(_0x2844,0x1f0));var _0x4284=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2844[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0x4284('0x0'));var util=require(_0x4284('0x1'));var path=require(_0x4284('0x2'));var timeout=require(_0x4284('0x3'));var express=require(_0x4284('0x4'));var router=express[_0x4284('0x5')]();var fs_extra=require(_0x4284('0x6'));var auth=require(_0x4284('0x7'));var interaction=require(_0x4284('0x8'));var config=require(_0x4284('0x9'));var controller=require(_0x4284('0xa'));router[_0x4284('0xb')]('/',auth[_0x4284('0xc')](),controller[_0x4284('0xd')]);router[_0x4284('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4284('0xe')]);router[_0x4284('0xb')](_0x4284('0xf'),auth[_0x4284('0xc')](),controller[_0x4284('0x10')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x4284('0x11')]);router[_0x4284('0xb')](_0x4284('0x12'),auth[_0x4284('0xc')](),controller['getDescriptions']);router[_0x4284('0x13')]('/',auth['isAuthenticated'](),controller[_0x4284('0x14')]);router['put'](_0x4284('0x15'),auth[_0x4284('0xc')](),controller['update']);router[_0x4284('0x16')]('/:id',auth[_0x4284('0xc')](),controller[_0x4284('0x17')]);module[_0x4284('0x18')]=router; \ No newline at end of file +var _0xdec7=['get','isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','getDescriptions','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdec7,0xc0));var _0x7dec=function(_0x834092,_0x429e9c){_0x834092=_0x834092-0x0;var _0x631023=_0xdec7[_0x834092];return _0x631023;};'use strict';var multer=require(_0x7dec('0x0'));var util=require(_0x7dec('0x1'));var path=require(_0x7dec('0x2'));var timeout=require(_0x7dec('0x3'));var express=require(_0x7dec('0x4'));var router=express[_0x7dec('0x5')]();var fs_extra=require(_0x7dec('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7dec('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x7dec('0x8')]('/',auth[_0x7dec('0x9')](),controller[_0x7dec('0xa')]);router['get'](_0x7dec('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7dec('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7dec('0xc')]);router[_0x7dec('0x8')](_0x7dec('0xd'),auth[_0x7dec('0x9')](),controller[_0x7dec('0xe')]);router[_0x7dec('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x7dec('0xf')]);router['post']('/',auth[_0x7dec('0x9')](),controller['create']);router[_0x7dec('0x10')](_0x7dec('0xb'),auth[_0x7dec('0x9')](),controller[_0x7dec('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7dec('0x12')]);module[_0x7dec('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index fb0cd40..17ec2fb 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 _0x1905=['exports','STRING','sequelize'];(function(_0x545cb6,_0x29223f){var _0x4fc186=function(_0x2fe1ce){while(--_0x2fe1ce){_0x545cb6['push'](_0x545cb6['shift']());}};_0x4fc186(++_0x29223f);}(_0x1905,0x1d0));var _0x5190=function(_0x35cf39,_0x5d3960){_0x35cf39=_0x35cf39-0x0;var _0x1eba33=_0x1905[_0x35cf39];return _0x1eba33;};'use strict';var Sequelize=require(_0x5190('0x0'));module[_0x5190('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5190('0x2')]}}; \ No newline at end of file +var _0xab9b=['STRING','sequelize','exports'];(function(_0x1c6e9f,_0x2f9ca7){var _0xfd4a=function(_0x583ecf){while(--_0x583ecf){_0x1c6e9f['push'](_0x1c6e9f['shift']());}};_0xfd4a(++_0x2f9ca7);}(_0xab9b,0x193));var _0xbab9=function(_0x25622f,_0x4fb9f9){_0x25622f=_0x25622f-0x0;var _0x44f990=_0xab9b[_0x25622f];return _0x44f990;};'use strict';var Sequelize=require(_0xbab9('0x0'));module[_0xbab9('0x1')]={'name':{'type':Sequelize[_0xbab9('0x2')]},'description':{'type':Sequelize[_0xbab9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 931f2ab..355deab 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 _0xe6f5=['SugarcrmField','rawAttributes','fields','getFields','findOne','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','map','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','show','params','length','find','create','body'];(function(_0x2bc1de,_0x553e02){var _0x98d4ff=function(_0x10d762){while(--_0x10d762){_0x2bc1de['push'](_0x2bc1de['shift']());}};_0x98d4ff(++_0x553e02);}(_0xe6f5,0x133));var _0x5e6f=function(_0x445267,_0x1ef6a1){_0x445267=_0x445267-0x0;var _0x274c02=_0xe6f5[_0x445267];return _0x274c02;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e6f('0x0'));var jsonpatch=require(_0x5e6f('0x1'));var rp=require(_0x5e6f('0x2'));var moment=require(_0x5e6f('0x3'));var BPromise=require(_0x5e6f('0x4'));var Mustache=require(_0x5e6f('0x5'));var util=require(_0x5e6f('0x6'));var path=require(_0x5e6f('0x7'));var sox=require(_0x5e6f('0x8'));var csv=require(_0x5e6f('0x9'));var ejs=require(_0x5e6f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e6f('0xb'));var squel=require(_0x5e6f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e6f('0x9'));var querystring=require(_0x5e6f('0xd'));var Papa=require('papaparse');var Redis=require(_0x5e6f('0xe'));var authService=require(_0x5e6f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5e6f('0x10'));var hardwareService=require(_0x5e6f('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5e6f('0x12'));var licenseUtil=require(_0x5e6f('0x13'));var db=require(_0x5e6f('0x14'))['db'];function respondWithStatusCode(_0x426d30,_0xb6f8f1){_0xb6f8f1=_0xb6f8f1||0xcc;return function(_0x3e421c){if(_0x3e421c){return _0x426d30[_0x5e6f('0x15')](_0xb6f8f1);}return _0x426d30['status'](_0xb6f8f1)[_0x5e6f('0x16')]();};}function respondWithResult(_0x1279e5,_0x47c7a1){_0x47c7a1=_0x47c7a1||0xc8;return function(_0x5621e2){if(_0x5621e2){return _0x1279e5[_0x5e6f('0x17')](_0x47c7a1)[_0x5e6f('0x18')](_0x5621e2);}};}function respondWithFilteredResult(_0x1a192b,_0x111a9f){return function(_0x24f530){if(_0x24f530){var _0x582ca5=typeof _0x111a9f['offset']===_0x5e6f('0x19')&&typeof _0x111a9f['limit']===_0x5e6f('0x19');var _0x4bde02=_0x24f530[_0x5e6f('0x1a')];var _0x5e85dd=_0x582ca5?0x0:_0x111a9f[_0x5e6f('0x1b')];var _0x4f9fd4=_0x582ca5?_0x24f530[_0x5e6f('0x1a')]:_0x111a9f[_0x5e6f('0x1b')]+_0x111a9f[_0x5e6f('0x1c')];var _0x1b00a6;if(_0x4f9fd4>=_0x4bde02){_0x4f9fd4=_0x4bde02;_0x1b00a6=0xc8;}else{_0x1b00a6=0xce;}_0x1a192b[_0x5e6f('0x17')](_0x1b00a6);return _0x1a192b[_0x5e6f('0x1d')](_0x5e6f('0x1e'),_0x5e85dd+'-'+_0x4f9fd4+'/'+_0x4bde02)[_0x5e6f('0x18')](_0x24f530);}return null;};}function patchUpdates(_0x725776){return function(_0x813128){try{jsonpatch['apply'](_0x813128,_0x725776,!![]);}catch(_0x502734){return BPromise[_0x5e6f('0x1f')](_0x502734);}return _0x813128[_0x5e6f('0x20')]();};}function saveUpdates(_0x24f446,_0x12fa9e){return function(_0x14eeab){if(_0x14eeab){return _0x14eeab['update'](_0x24f446)[_0x5e6f('0x21')](function(_0x5de529){return _0x5de529;});}return null;};}function removeEntity(_0x4eaf97,_0x5df9a7){return function(_0x5794ce){if(_0x5794ce){return _0x5794ce[_0x5e6f('0x22')]()[_0x5e6f('0x21')](function(){_0x4eaf97[_0x5e6f('0x17')](0xcc)[_0x5e6f('0x16')]();});}};}function handleEntityNotFound(_0x4da001,_0x94f6f4){return function(_0x54ea45){if(!_0x54ea45){_0x4da001[_0x5e6f('0x15')](0x194);}return _0x54ea45;};}function handleError(_0x16bd11,_0x3d5631){_0x3d5631=_0x3d5631||0x1f4;return function(_0x313886){logger[_0x5e6f('0x23')](_0x313886[_0x5e6f('0x24')]);if(_0x313886[_0x5e6f('0x25')]){delete _0x313886['name'];}_0x16bd11[_0x5e6f('0x17')](_0x3d5631)['send'](_0x313886);};}exports['index']=function(_0x58a8c5,_0x3898e5){var _0x496edf={},_0x20300c={},_0x10cf45={'count':0x0,'rows':[]};var _0x1a02e5=_[_0x5e6f('0x26')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x2bd270){return{'name':_0x2bd270['fieldName'],'type':_0x2bd270[_0x5e6f('0x27')][_0x5e6f('0x28')]};});_0x20300c[_0x5e6f('0x29')]=_[_0x5e6f('0x26')](_0x1a02e5,_0x5e6f('0x25'));_0x20300c[_0x5e6f('0x2a')]=_[_0x5e6f('0x2b')](_0x58a8c5['query']);_0x20300c['filters']=_[_0x5e6f('0x2c')](_0x20300c[_0x5e6f('0x29')],_0x20300c[_0x5e6f('0x2a')]);_0x496edf[_0x5e6f('0x2d')]=_[_0x5e6f('0x2c')](_0x20300c[_0x5e6f('0x29')],qs['fields'](_0x58a8c5['query']['fields']));_0x496edf['attributes']=_0x496edf[_0x5e6f('0x2d')]['length']?_0x496edf[_0x5e6f('0x2d')]:_0x20300c[_0x5e6f('0x29')];if(!_0x58a8c5[_0x5e6f('0x2a')][_0x5e6f('0x2e')](_0x5e6f('0x2f'))){_0x496edf[_0x5e6f('0x1c')]=qs['limit'](_0x58a8c5['query'][_0x5e6f('0x1c')]);_0x496edf[_0x5e6f('0x1b')]=qs[_0x5e6f('0x1b')](_0x58a8c5[_0x5e6f('0x2a')][_0x5e6f('0x1b')]);}_0x496edf[_0x5e6f('0x30')]=qs[_0x5e6f('0x31')](_0x58a8c5['query'][_0x5e6f('0x31')]);_0x496edf[_0x5e6f('0x32')]=qs[_0x5e6f('0x33')](_[_0x5e6f('0x34')](_0x58a8c5[_0x5e6f('0x2a')],_0x20300c[_0x5e6f('0x33')]),_0x1a02e5);if(_0x58a8c5['query'][_0x5e6f('0x35')]){_0x496edf[_0x5e6f('0x32')]=_['merge'](_0x496edf[_0x5e6f('0x32')],{'$or':_[_0x5e6f('0x26')](_0x1a02e5,function(_0x1a096a){if(_0x1a096a[_0x5e6f('0x27')]!=='VIRTUAL'){var _0x4baaa0={};_0x4baaa0[_0x1a096a[_0x5e6f('0x25')]]={'$like':'%'+_0x58a8c5[_0x5e6f('0x2a')][_0x5e6f('0x35')]+'%'};return _0x4baaa0;}})});}_0x496edf=_[_0x5e6f('0x36')]({},_0x496edf,_0x58a8c5[_0x5e6f('0x37')]);var _0x2ad2f4={'where':_0x496edf[_0x5e6f('0x32')]};return db[_0x5e6f('0x38')][_0x5e6f('0x1a')](_0x2ad2f4)[_0x5e6f('0x21')](function(_0x5b55e8){_0x10cf45[_0x5e6f('0x1a')]=_0x5b55e8;if(_0x58a8c5[_0x5e6f('0x2a')][_0x5e6f('0x39')]){_0x496edf[_0x5e6f('0x3a')]=[{'all':!![]}];}return db[_0x5e6f('0x38')][_0x5e6f('0x3b')](_0x496edf);})['then'](function(_0x3e5463){_0x10cf45[_0x5e6f('0x3c')]=_0x3e5463;return _0x10cf45;})[_0x5e6f('0x21')](respondWithFilteredResult(_0x3898e5,_0x496edf))[_0x5e6f('0x3d')](handleError(_0x3898e5,null));};exports[_0x5e6f('0x3e')]=function(_0x2274fa,_0x1aba8d){var _0x48a2a1={'raw':![],'where':{'id':_0x2274fa[_0x5e6f('0x3f')]['id']}},_0x254758={};_0x254758[_0x5e6f('0x29')]=_[_0x5e6f('0x2b')](db[_0x5e6f('0x38')]['rawAttributes']);_0x254758['query']=_[_0x5e6f('0x2b')](_0x2274fa[_0x5e6f('0x2a')]);_0x254758[_0x5e6f('0x33')]=_[_0x5e6f('0x2c')](_0x254758[_0x5e6f('0x29')],_0x254758['query']);_0x48a2a1['attributes']=_[_0x5e6f('0x2c')](_0x254758[_0x5e6f('0x29')],qs['fields'](_0x2274fa[_0x5e6f('0x2a')]['fields']));_0x48a2a1[_0x5e6f('0x2d')]=_0x48a2a1[_0x5e6f('0x2d')][_0x5e6f('0x40')]?_0x48a2a1[_0x5e6f('0x2d')]:_0x254758['model'];if(_0x2274fa['query'][_0x5e6f('0x39')]){_0x48a2a1[_0x5e6f('0x3a')]=[{'all':!![]}];}_0x48a2a1=_['merge']({},_0x48a2a1,_0x2274fa[_0x5e6f('0x37')]);return db[_0x5e6f('0x38')][_0x5e6f('0x41')](_0x48a2a1)['then'](handleEntityNotFound(_0x1aba8d,null))[_0x5e6f('0x21')](respondWithResult(_0x1aba8d,null))['catch'](handleError(_0x1aba8d,null));};exports['create']=function(_0x221974,_0x57d090){return db['SugarcrmConfiguration'][_0x5e6f('0x42')](_0x221974[_0x5e6f('0x43')],{})['then'](respondWithResult(_0x57d090,0xc9))[_0x5e6f('0x3d')](handleError(_0x57d090,null));};exports['update']=function(_0x110427,_0x19709b){if(_0x110427[_0x5e6f('0x43')]['id']){delete _0x110427['body']['id'];}return db[_0x5e6f('0x38')][_0x5e6f('0x41')]({'where':{'id':_0x110427[_0x5e6f('0x3f')]['id']}})[_0x5e6f('0x21')](handleEntityNotFound(_0x19709b,null))[_0x5e6f('0x21')](saveUpdates(_0x110427[_0x5e6f('0x43')],null))[_0x5e6f('0x21')](respondWithResult(_0x19709b,null))[_0x5e6f('0x3d')](handleError(_0x19709b,null));};exports['destroy']=function(_0x3e48be,_0x308356){return db[_0x5e6f('0x38')][_0x5e6f('0x41')]({'where':{'id':_0x3e48be[_0x5e6f('0x3f')]['id']}})[_0x5e6f('0x21')](handleEntityNotFound(_0x308356,null))[_0x5e6f('0x21')](removeEntity(_0x308356,null))[_0x5e6f('0x3d')](handleError(_0x308356,null));};exports['getFields']=function(_0x33f87e,_0x2e2cf6,_0x1f95e4){var _0x4272eb={};var _0x24c264={};var _0x22bbf6;var _0x1e2213;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x33f87e['params']['id']}})[_0x5e6f('0x21')](handleEntityNotFound(_0x2e2cf6,null))[_0x5e6f('0x21')](function(_0x18015a){if(_0x18015a){_0x22bbf6=_0x18015a;_0x24c264[_0x5e6f('0x29')]=_[_0x5e6f('0x2b')](db[_0x5e6f('0x44')][_0x5e6f('0x45')]);_0x24c264[_0x5e6f('0x2a')]=_[_0x5e6f('0x2b')](_0x33f87e['query']);_0x24c264[_0x5e6f('0x33')]=_['intersection'](_0x24c264[_0x5e6f('0x29')],_0x24c264[_0x5e6f('0x2a')]);_0x4272eb[_0x5e6f('0x2d')]=_['intersection'](_0x24c264[_0x5e6f('0x29')],qs[_0x5e6f('0x46')](_0x33f87e[_0x5e6f('0x2a')][_0x5e6f('0x46')]));_0x4272eb[_0x5e6f('0x2d')]=_0x4272eb['attributes'][_0x5e6f('0x40')]?_0x4272eb['attributes']:_0x24c264['model'];_0x4272eb[_0x5e6f('0x30')]=qs[_0x5e6f('0x31')](_0x33f87e[_0x5e6f('0x2a')][_0x5e6f('0x31')]);_0x4272eb[_0x5e6f('0x32')]=qs[_0x5e6f('0x33')](_[_0x5e6f('0x34')](_0x33f87e[_0x5e6f('0x2a')],_0x24c264['filters']));if(_0x33f87e[_0x5e6f('0x2a')]['filter']){_0x4272eb[_0x5e6f('0x32')]=_['merge'](_0x4272eb[_0x5e6f('0x32')],{'$or':_[_0x5e6f('0x26')](_0x4272eb[_0x5e6f('0x2d')],function(_0x1b6b70){var _0x9bfb80={};_0x9bfb80[_0x1b6b70]={'$like':'%'+_0x33f87e[_0x5e6f('0x2a')][_0x5e6f('0x35')]+'%'};return _0x9bfb80;})});}_0x4272eb=_[_0x5e6f('0x36')]({},_0x4272eb,_0x33f87e[_0x5e6f('0x37')]);return _0x22bbf6[_0x5e6f('0x47')](_0x4272eb);}})['then'](function(_0x22e0b7){if(_0x22e0b7){_0x1e2213=_0x22e0b7[_0x5e6f('0x40')];if(!_0x33f87e[_0x5e6f('0x2a')][_0x5e6f('0x2e')]('nolimit')){_0x4272eb[_0x5e6f('0x1c')]=qs[_0x5e6f('0x1c')](_0x33f87e[_0x5e6f('0x2a')][_0x5e6f('0x1c')]);_0x4272eb[_0x5e6f('0x1b')]=qs['offset'](_0x33f87e[_0x5e6f('0x2a')][_0x5e6f('0x1b')]);}return _0x22bbf6[_0x5e6f('0x47')](_0x4272eb);}})['then'](function(_0x136f73){if(_0x136f73){return _0x136f73?{'count':_0x1e2213,'rows':_0x136f73}:null;}})[_0x5e6f('0x21')](respondWithResult(_0x2e2cf6,null))[_0x5e6f('0x3d')](handleError(_0x2e2cf6,null));};exports['getSubjects']=function(_0x5e7b6e,_0x4974be,_0x2c2121){var _0x8fc36e={};var _0x26ba12={};var _0x306a6b;var _0x118ffa;return db['SugarcrmConfiguration'][_0x5e6f('0x48')]({'where':{'id':_0x5e7b6e[_0x5e6f('0x3f')]['id']}})[_0x5e6f('0x21')](handleEntityNotFound(_0x4974be,null))[_0x5e6f('0x21')](function(_0xbb339f){if(_0xbb339f){_0x306a6b=_0xbb339f;_0x26ba12['model']=_[_0x5e6f('0x2b')](db[_0x5e6f('0x44')]['rawAttributes']);_0x26ba12['query']=_[_0x5e6f('0x2b')](_0x5e7b6e[_0x5e6f('0x2a')]);_0x26ba12[_0x5e6f('0x33')]=_[_0x5e6f('0x2c')](_0x26ba12[_0x5e6f('0x29')],_0x26ba12[_0x5e6f('0x2a')]);_0x8fc36e[_0x5e6f('0x2d')]=_['intersection'](_0x26ba12[_0x5e6f('0x29')],qs['fields'](_0x5e7b6e['query'][_0x5e6f('0x46')]));_0x8fc36e['attributes']=_0x8fc36e['attributes'][_0x5e6f('0x40')]?_0x8fc36e['attributes']:_0x26ba12['model'];_0x8fc36e[_0x5e6f('0x30')]=qs[_0x5e6f('0x31')](_0x5e7b6e[_0x5e6f('0x2a')]['sort']);_0x8fc36e[_0x5e6f('0x32')]=qs['filters'](_[_0x5e6f('0x34')](_0x5e7b6e[_0x5e6f('0x2a')],_0x26ba12['filters']));if(_0x5e7b6e[_0x5e6f('0x2a')][_0x5e6f('0x35')]){_0x8fc36e[_0x5e6f('0x32')]=_[_0x5e6f('0x36')](_0x8fc36e[_0x5e6f('0x32')],{'$or':_['map'](_0x8fc36e[_0x5e6f('0x2d')],function(_0x353615){var _0x10066c={};_0x10066c[_0x353615]={'$like':'%'+_0x5e7b6e[_0x5e6f('0x2a')][_0x5e6f('0x35')]+'%'};return _0x10066c;})});}_0x8fc36e=_['merge']({},_0x8fc36e,_0x5e7b6e['options']);return _0x306a6b[_0x5e6f('0x49')](_0x8fc36e);}})[_0x5e6f('0x21')](function(_0x598ae7){if(_0x598ae7){_0x118ffa=_0x598ae7[_0x5e6f('0x40')];if(!_0x5e7b6e['query']['hasOwnProperty'](_0x5e6f('0x2f'))){_0x8fc36e['limit']=qs[_0x5e6f('0x1c')](_0x5e7b6e[_0x5e6f('0x2a')][_0x5e6f('0x1c')]);_0x8fc36e[_0x5e6f('0x1b')]=qs[_0x5e6f('0x1b')](_0x5e7b6e[_0x5e6f('0x2a')][_0x5e6f('0x1b')]);}return _0x306a6b[_0x5e6f('0x49')](_0x8fc36e);}})['then'](function(_0x4f7fe2){if(_0x4f7fe2){return _0x4f7fe2?{'count':_0x118ffa,'rows':_0x4f7fe2}:null;}})[_0x5e6f('0x21')](respondWithResult(_0x4974be,null))['catch'](handleError(_0x4974be,null));};exports[_0x5e6f('0x4a')]=function(_0xdb2975,_0x1be2af,_0x32f710){var _0x494b91={};var _0x5582f5={};var _0x581485;var _0x47dfdb;return db['SugarcrmConfiguration'][_0x5e6f('0x48')]({'where':{'id':_0xdb2975[_0x5e6f('0x3f')]['id']}})[_0x5e6f('0x21')](handleEntityNotFound(_0x1be2af,null))[_0x5e6f('0x21')](function(_0x29d44d){if(_0x29d44d){_0x581485=_0x29d44d;_0x5582f5['model']=_['keys'](db[_0x5e6f('0x44')][_0x5e6f('0x45')]);_0x5582f5[_0x5e6f('0x2a')]=_['keys'](_0xdb2975[_0x5e6f('0x2a')]);_0x5582f5[_0x5e6f('0x33')]=_['intersection'](_0x5582f5[_0x5e6f('0x29')],_0x5582f5[_0x5e6f('0x2a')]);_0x494b91[_0x5e6f('0x2d')]=_[_0x5e6f('0x2c')](_0x5582f5[_0x5e6f('0x29')],qs[_0x5e6f('0x46')](_0xdb2975['query'][_0x5e6f('0x46')]));_0x494b91[_0x5e6f('0x2d')]=_0x494b91['attributes'][_0x5e6f('0x40')]?_0x494b91[_0x5e6f('0x2d')]:_0x5582f5['model'];_0x494b91['order']=qs[_0x5e6f('0x31')](_0xdb2975[_0x5e6f('0x2a')][_0x5e6f('0x31')]);_0x494b91[_0x5e6f('0x32')]=qs[_0x5e6f('0x33')](_[_0x5e6f('0x34')](_0xdb2975[_0x5e6f('0x2a')],_0x5582f5['filters']));if(_0xdb2975[_0x5e6f('0x2a')][_0x5e6f('0x35')]){_0x494b91[_0x5e6f('0x32')]=_[_0x5e6f('0x36')](_0x494b91[_0x5e6f('0x32')],{'$or':_[_0x5e6f('0x26')](_0x494b91[_0x5e6f('0x2d')],function(_0x149a38){var _0xcbdf1c={};_0xcbdf1c[_0x149a38]={'$like':'%'+_0xdb2975[_0x5e6f('0x2a')][_0x5e6f('0x35')]+'%'};return _0xcbdf1c;})});}_0x494b91=_['merge']({},_0x494b91,_0xdb2975['options']);return _0x581485[_0x5e6f('0x4a')](_0x494b91);}})[_0x5e6f('0x21')](function(_0x1f1ac6){if(_0x1f1ac6){_0x47dfdb=_0x1f1ac6['length'];if(!_0xdb2975[_0x5e6f('0x2a')][_0x5e6f('0x2e')](_0x5e6f('0x2f'))){_0x494b91['limit']=qs[_0x5e6f('0x1c')](_0xdb2975[_0x5e6f('0x2a')][_0x5e6f('0x1c')]);_0x494b91[_0x5e6f('0x1b')]=qs[_0x5e6f('0x1b')](_0xdb2975['query'][_0x5e6f('0x1b')]);}return _0x581485[_0x5e6f('0x4a')](_0x494b91);}})['then'](function(_0x272927){if(_0x272927){return _0x272927?{'count':_0x47dfdb,'rows':_0x272927}:null;}})[_0x5e6f('0x21')](respondWithResult(_0x1be2af,null))[_0x5e6f('0x3d')](handleError(_0x1be2af,null));}; \ No newline at end of file +var _0x8502=['count','set','reject','update','then','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','body','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit'];(function(_0x314d7e,_0x551b40){var _0x483be6=function(_0x42ead2){while(--_0x42ead2){_0x314d7e['push'](_0x314d7e['shift']());}};_0x483be6(++_0x551b40);}(_0x8502,0x7e));var _0x2850=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0x8502[_0x102881];return _0x5c63d0;};'use strict';var emlformat=require(_0x2850('0x0'));var rimraf=require(_0x2850('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2850('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2850('0x3'));var Mustache=require(_0x2850('0x4'));var util=require(_0x2850('0x5'));var path=require(_0x2850('0x6'));var sox=require(_0x2850('0x7'));var csv=require(_0x2850('0x8'));var ejs=require(_0x2850('0x9'));var fs=require('fs');var fs_extra=require(_0x2850('0xa'));var _=require(_0x2850('0xb'));var squel=require(_0x2850('0xc'));var crypto=require(_0x2850('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2850('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2850('0xf'));var Redis=require('ioredis');var authService=require(_0x2850('0x10'));var qs=require(_0x2850('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2850('0x12'));var logger=require(_0x2850('0x13'))(_0x2850('0x14'));var utils=require(_0x2850('0x15'));var config=require(_0x2850('0x16'));var licenseUtil=require(_0x2850('0x17'));var db=require(_0x2850('0x18'))['db'];function respondWithStatusCode(_0x27110c,_0x1785ce){_0x1785ce=_0x1785ce||0xcc;return function(_0x3c129e){if(_0x3c129e){return _0x27110c['sendStatus'](_0x1785ce);}return _0x27110c[_0x2850('0x19')](_0x1785ce)[_0x2850('0x1a')]();};}function respondWithResult(_0x34ff53,_0x3d67a7){_0x3d67a7=_0x3d67a7||0xc8;return function(_0x161a4d){if(_0x161a4d){return _0x34ff53[_0x2850('0x19')](_0x3d67a7)['json'](_0x161a4d);}};}function respondWithFilteredResult(_0x44e230,_0x50ff48){return function(_0x1cb435){if(_0x1cb435){var _0x27a957=typeof _0x50ff48[_0x2850('0x1b')]===_0x2850('0x1c')&&typeof _0x50ff48[_0x2850('0x1d')]===_0x2850('0x1c');var _0x7a8ae4=_0x1cb435['count'];var _0x294c6f=_0x27a957?0x0:_0x50ff48[_0x2850('0x1b')];var _0x2066b2=_0x27a957?_0x1cb435[_0x2850('0x1e')]:_0x50ff48['offset']+_0x50ff48[_0x2850('0x1d')];var _0x4fca86;if(_0x2066b2>=_0x7a8ae4){_0x2066b2=_0x7a8ae4;_0x4fca86=0xc8;}else{_0x4fca86=0xce;}_0x44e230[_0x2850('0x19')](_0x4fca86);return _0x44e230[_0x2850('0x1f')]('Content-Range',_0x294c6f+'-'+_0x2066b2+'/'+_0x7a8ae4)['json'](_0x1cb435);}return null;};}function patchUpdates(_0x586a71){return function(_0x1bde1b){try{jsonpatch['apply'](_0x1bde1b,_0x586a71,!![]);}catch(_0x5e01d9){return BPromise[_0x2850('0x20')](_0x5e01d9);}return _0x1bde1b['save']();};}function saveUpdates(_0x32d9d1,_0x597be5){return function(_0xe4dca1){if(_0xe4dca1){return _0xe4dca1[_0x2850('0x21')](_0x32d9d1)[_0x2850('0x22')](function(_0x449a1d){return _0x449a1d;});}return null;};}function removeEntity(_0x3a0965,_0x53e718){return function(_0x511636){if(_0x511636){return _0x511636['destroy']()[_0x2850('0x22')](function(){_0x3a0965['status'](0xcc)[_0x2850('0x1a')]();});}};}function handleEntityNotFound(_0x4811d3,_0x169289){return function(_0x14683f){if(!_0x14683f){_0x4811d3['sendStatus'](0x194);}return _0x14683f;};}function handleError(_0x29f74a,_0x5a7f19){_0x5a7f19=_0x5a7f19||0x1f4;return function(_0x554127){logger[_0x2850('0x23')](_0x554127[_0x2850('0x24')]);if(_0x554127[_0x2850('0x25')]){delete _0x554127[_0x2850('0x25')];}_0x29f74a[_0x2850('0x19')](_0x5a7f19)[_0x2850('0x26')](_0x554127);};}exports[_0x2850('0x27')]=function(_0x56baa3,_0x182c3c){var _0x39e8e2={},_0x37c187={},_0x4ed74b={'count':0x0,'rows':[]};var _0x28bd27=_[_0x2850('0x28')](db[_0x2850('0x29')][_0x2850('0x2a')],function(_0x27acf9){return{'name':_0x27acf9[_0x2850('0x2b')],'type':_0x27acf9[_0x2850('0x2c')][_0x2850('0x2d')]};});_0x37c187[_0x2850('0x2e')]=_[_0x2850('0x28')](_0x28bd27,_0x2850('0x25'));_0x37c187[_0x2850('0x2f')]=_[_0x2850('0x30')](_0x56baa3[_0x2850('0x2f')]);_0x37c187[_0x2850('0x31')]=_[_0x2850('0x32')](_0x37c187[_0x2850('0x2e')],_0x37c187[_0x2850('0x2f')]);_0x39e8e2[_0x2850('0x33')]=_[_0x2850('0x32')](_0x37c187[_0x2850('0x2e')],qs[_0x2850('0x34')](_0x56baa3['query'][_0x2850('0x34')]));_0x39e8e2[_0x2850('0x33')]=_0x39e8e2[_0x2850('0x33')][_0x2850('0x35')]?_0x39e8e2[_0x2850('0x33')]:_0x37c187[_0x2850('0x2e')];if(!_0x56baa3['query'][_0x2850('0x36')](_0x2850('0x37'))){_0x39e8e2[_0x2850('0x1d')]=qs[_0x2850('0x1d')](_0x56baa3[_0x2850('0x2f')]['limit']);_0x39e8e2[_0x2850('0x1b')]=qs[_0x2850('0x1b')](_0x56baa3[_0x2850('0x2f')][_0x2850('0x1b')]);}_0x39e8e2[_0x2850('0x38')]=qs[_0x2850('0x39')](_0x56baa3[_0x2850('0x2f')]['sort']);_0x39e8e2[_0x2850('0x3a')]=qs[_0x2850('0x31')](_[_0x2850('0x3b')](_0x56baa3['query'],_0x37c187[_0x2850('0x31')]),_0x28bd27);if(_0x56baa3[_0x2850('0x2f')][_0x2850('0x3c')]){_0x39e8e2[_0x2850('0x3a')]=_['merge'](_0x39e8e2['where'],{'$or':_['map'](_0x28bd27,function(_0x58af79){if(_0x58af79['type']!==_0x2850('0x3d')){var _0x432cfe={};_0x432cfe[_0x58af79['name']]={'$like':'%'+_0x56baa3[_0x2850('0x2f')][_0x2850('0x3c')]+'%'};return _0x432cfe;}})});}_0x39e8e2=_[_0x2850('0x3e')]({},_0x39e8e2,_0x56baa3[_0x2850('0x3f')]);var _0x1c40a6={'where':_0x39e8e2[_0x2850('0x3a')]};return db['SugarcrmConfiguration'][_0x2850('0x1e')](_0x1c40a6)[_0x2850('0x22')](function(_0x432a5a){_0x4ed74b['count']=_0x432a5a;if(_0x56baa3[_0x2850('0x2f')]['includeAll']){_0x39e8e2[_0x2850('0x40')]=[{'all':!![]}];}return db[_0x2850('0x29')][_0x2850('0x41')](_0x39e8e2);})[_0x2850('0x22')](function(_0x36b5a2){_0x4ed74b['rows']=_0x36b5a2;return _0x4ed74b;})[_0x2850('0x22')](respondWithFilteredResult(_0x182c3c,_0x39e8e2))[_0x2850('0x42')](handleError(_0x182c3c,null));};exports[_0x2850('0x43')]=function(_0x461433,_0x235d0d){var _0x15f3ec={'raw':![],'where':{'id':_0x461433[_0x2850('0x44')]['id']}},_0x467993={};_0x467993[_0x2850('0x2e')]=_[_0x2850('0x30')](db[_0x2850('0x29')]['rawAttributes']);_0x467993[_0x2850('0x2f')]=_['keys'](_0x461433['query']);_0x467993[_0x2850('0x31')]=_['intersection'](_0x467993['model'],_0x467993['query']);_0x15f3ec[_0x2850('0x33')]=_[_0x2850('0x32')](_0x467993[_0x2850('0x2e')],qs[_0x2850('0x34')](_0x461433[_0x2850('0x2f')][_0x2850('0x34')]));_0x15f3ec[_0x2850('0x33')]=_0x15f3ec[_0x2850('0x33')][_0x2850('0x35')]?_0x15f3ec[_0x2850('0x33')]:_0x467993[_0x2850('0x2e')];if(_0x461433[_0x2850('0x2f')][_0x2850('0x45')]){_0x15f3ec[_0x2850('0x40')]=[{'all':!![]}];}_0x15f3ec=_[_0x2850('0x3e')]({},_0x15f3ec,_0x461433['options']);return db[_0x2850('0x29')][_0x2850('0x46')](_0x15f3ec)[_0x2850('0x22')](handleEntityNotFound(_0x235d0d,null))[_0x2850('0x22')](respondWithResult(_0x235d0d,null))['catch'](handleError(_0x235d0d,null));};exports['create']=function(_0x4242e3,_0x3a905a){return db['SugarcrmConfiguration']['create'](_0x4242e3[_0x2850('0x47')],{})[_0x2850('0x22')](respondWithResult(_0x3a905a,0xc9))['catch'](handleError(_0x3a905a,null));};exports[_0x2850('0x21')]=function(_0x25041f,_0x126279){if(_0x25041f[_0x2850('0x47')]['id']){delete _0x25041f[_0x2850('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x2850('0x46')]({'where':{'id':_0x25041f[_0x2850('0x44')]['id']}})[_0x2850('0x22')](handleEntityNotFound(_0x126279,null))[_0x2850('0x22')](saveUpdates(_0x25041f[_0x2850('0x47')],null))[_0x2850('0x22')](respondWithResult(_0x126279,null))['catch'](handleError(_0x126279,null));};exports[_0x2850('0x48')]=function(_0x2cfe4d,_0x1a3147){return db[_0x2850('0x29')][_0x2850('0x46')]({'where':{'id':_0x2cfe4d[_0x2850('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a3147,null))[_0x2850('0x22')](removeEntity(_0x1a3147,null))[_0x2850('0x42')](handleError(_0x1a3147,null));};exports[_0x2850('0x49')]=function(_0xc67262,_0x523d9b,_0x195007){var _0x1a3fe2={};var _0x1ecc11={};var _0x1f9974;var _0x579954;return db[_0x2850('0x29')][_0x2850('0x4a')]({'where':{'id':_0xc67262[_0x2850('0x44')]['id']}})[_0x2850('0x22')](handleEntityNotFound(_0x523d9b,null))[_0x2850('0x22')](function(_0x4056b8){if(_0x4056b8){_0x1f9974=_0x4056b8;_0x1ecc11['model']=_[_0x2850('0x30')](db[_0x2850('0x4b')][_0x2850('0x2a')]);_0x1ecc11[_0x2850('0x2f')]=_[_0x2850('0x30')](_0xc67262['query']);_0x1ecc11[_0x2850('0x31')]=_[_0x2850('0x32')](_0x1ecc11['model'],_0x1ecc11[_0x2850('0x2f')]);_0x1a3fe2[_0x2850('0x33')]=_[_0x2850('0x32')](_0x1ecc11['model'],qs[_0x2850('0x34')](_0xc67262[_0x2850('0x2f')][_0x2850('0x34')]));_0x1a3fe2[_0x2850('0x33')]=_0x1a3fe2[_0x2850('0x33')][_0x2850('0x35')]?_0x1a3fe2[_0x2850('0x33')]:_0x1ecc11[_0x2850('0x2e')];_0x1a3fe2[_0x2850('0x38')]=qs[_0x2850('0x39')](_0xc67262[_0x2850('0x2f')]['sort']);_0x1a3fe2[_0x2850('0x3a')]=qs[_0x2850('0x31')](_['pick'](_0xc67262['query'],_0x1ecc11[_0x2850('0x31')]));if(_0xc67262[_0x2850('0x2f')]['filter']){_0x1a3fe2[_0x2850('0x3a')]=_['merge'](_0x1a3fe2['where'],{'$or':_[_0x2850('0x28')](_0x1a3fe2['attributes'],function(_0x5ee029){var _0x2bbd4b={};_0x2bbd4b[_0x5ee029]={'$like':'%'+_0xc67262[_0x2850('0x2f')][_0x2850('0x3c')]+'%'};return _0x2bbd4b;})});}_0x1a3fe2=_[_0x2850('0x3e')]({},_0x1a3fe2,_0xc67262[_0x2850('0x3f')]);return _0x1f9974['getFields'](_0x1a3fe2);}})['then'](function(_0x3f63b2){if(_0x3f63b2){_0x579954=_0x3f63b2[_0x2850('0x35')];if(!_0xc67262[_0x2850('0x2f')][_0x2850('0x36')]('nolimit')){_0x1a3fe2[_0x2850('0x1d')]=qs['limit'](_0xc67262[_0x2850('0x2f')][_0x2850('0x1d')]);_0x1a3fe2[_0x2850('0x1b')]=qs[_0x2850('0x1b')](_0xc67262[_0x2850('0x2f')][_0x2850('0x1b')]);}return _0x1f9974[_0x2850('0x49')](_0x1a3fe2);}})[_0x2850('0x22')](function(_0x128a08){if(_0x128a08){return _0x128a08?{'count':_0x579954,'rows':_0x128a08}:null;}})[_0x2850('0x22')](respondWithResult(_0x523d9b,null))[_0x2850('0x42')](handleError(_0x523d9b,null));};exports[_0x2850('0x4c')]=function(_0x428913,_0x33ccbd,_0x5009b5){var _0x502429={};var _0x574bf4={};var _0x21cf4d;var _0x3b991f;return db[_0x2850('0x29')][_0x2850('0x4a')]({'where':{'id':_0x428913[_0x2850('0x44')]['id']}})[_0x2850('0x22')](handleEntityNotFound(_0x33ccbd,null))['then'](function(_0x30e0e5){if(_0x30e0e5){_0x21cf4d=_0x30e0e5;_0x574bf4[_0x2850('0x2e')]=_[_0x2850('0x30')](db[_0x2850('0x4b')][_0x2850('0x2a')]);_0x574bf4[_0x2850('0x2f')]=_[_0x2850('0x30')](_0x428913[_0x2850('0x2f')]);_0x574bf4[_0x2850('0x31')]=_[_0x2850('0x32')](_0x574bf4[_0x2850('0x2e')],_0x574bf4[_0x2850('0x2f')]);_0x502429[_0x2850('0x33')]=_[_0x2850('0x32')](_0x574bf4[_0x2850('0x2e')],qs[_0x2850('0x34')](_0x428913[_0x2850('0x2f')][_0x2850('0x34')]));_0x502429[_0x2850('0x33')]=_0x502429['attributes'][_0x2850('0x35')]?_0x502429[_0x2850('0x33')]:_0x574bf4['model'];_0x502429[_0x2850('0x38')]=qs[_0x2850('0x39')](_0x428913['query']['sort']);_0x502429[_0x2850('0x3a')]=qs[_0x2850('0x31')](_['pick'](_0x428913[_0x2850('0x2f')],_0x574bf4['filters']));if(_0x428913[_0x2850('0x2f')]['filter']){_0x502429['where']=_[_0x2850('0x3e')](_0x502429[_0x2850('0x3a')],{'$or':_[_0x2850('0x28')](_0x502429[_0x2850('0x33')],function(_0x4fba98){var _0x1be9c2={};_0x1be9c2[_0x4fba98]={'$like':'%'+_0x428913[_0x2850('0x2f')][_0x2850('0x3c')]+'%'};return _0x1be9c2;})});}_0x502429=_[_0x2850('0x3e')]({},_0x502429,_0x428913[_0x2850('0x3f')]);return _0x21cf4d[_0x2850('0x4c')](_0x502429);}})[_0x2850('0x22')](function(_0x748cf8){if(_0x748cf8){_0x3b991f=_0x748cf8[_0x2850('0x35')];if(!_0x428913[_0x2850('0x2f')][_0x2850('0x36')](_0x2850('0x37'))){_0x502429[_0x2850('0x1d')]=qs[_0x2850('0x1d')](_0x428913[_0x2850('0x2f')][_0x2850('0x1d')]);_0x502429['offset']=qs[_0x2850('0x1b')](_0x428913[_0x2850('0x2f')][_0x2850('0x1b')]);}return _0x21cf4d[_0x2850('0x4c')](_0x502429);}})[_0x2850('0x22')](function(_0x3c2175){if(_0x3c2175){return _0x3c2175?{'count':_0x3b991f,'rows':_0x3c2175}:null;}})[_0x2850('0x22')](respondWithResult(_0x33ccbd,null))[_0x2850('0x42')](handleError(_0x33ccbd,null));};exports[_0x2850('0x4d')]=function(_0x58c673,_0xd6489a,_0x70fe2b){var _0x5204a4={};var _0x2d8591={};var _0x38a08c;var _0x55a4d3;return db['SugarcrmConfiguration'][_0x2850('0x4a')]({'where':{'id':_0x58c673[_0x2850('0x44')]['id']}})['then'](handleEntityNotFound(_0xd6489a,null))[_0x2850('0x22')](function(_0x500890){if(_0x500890){_0x38a08c=_0x500890;_0x2d8591[_0x2850('0x2e')]=_[_0x2850('0x30')](db[_0x2850('0x4b')][_0x2850('0x2a')]);_0x2d8591[_0x2850('0x2f')]=_[_0x2850('0x30')](_0x58c673[_0x2850('0x2f')]);_0x2d8591['filters']=_[_0x2850('0x32')](_0x2d8591[_0x2850('0x2e')],_0x2d8591[_0x2850('0x2f')]);_0x5204a4[_0x2850('0x33')]=_[_0x2850('0x32')](_0x2d8591[_0x2850('0x2e')],qs[_0x2850('0x34')](_0x58c673['query']['fields']));_0x5204a4[_0x2850('0x33')]=_0x5204a4[_0x2850('0x33')][_0x2850('0x35')]?_0x5204a4[_0x2850('0x33')]:_0x2d8591[_0x2850('0x2e')];_0x5204a4['order']=qs[_0x2850('0x39')](_0x58c673[_0x2850('0x2f')][_0x2850('0x39')]);_0x5204a4['where']=qs[_0x2850('0x31')](_[_0x2850('0x3b')](_0x58c673[_0x2850('0x2f')],_0x2d8591[_0x2850('0x31')]));if(_0x58c673['query'][_0x2850('0x3c')]){_0x5204a4[_0x2850('0x3a')]=_[_0x2850('0x3e')](_0x5204a4[_0x2850('0x3a')],{'$or':_['map'](_0x5204a4[_0x2850('0x33')],function(_0x36db42){var _0x4e6d0d={};_0x4e6d0d[_0x36db42]={'$like':'%'+_0x58c673[_0x2850('0x2f')]['filter']+'%'};return _0x4e6d0d;})});}_0x5204a4=_[_0x2850('0x3e')]({},_0x5204a4,_0x58c673[_0x2850('0x3f')]);return _0x38a08c[_0x2850('0x4d')](_0x5204a4);}})['then'](function(_0x14a423){if(_0x14a423){_0x55a4d3=_0x14a423[_0x2850('0x35')];if(!_0x58c673[_0x2850('0x2f')][_0x2850('0x36')](_0x2850('0x37'))){_0x5204a4['limit']=qs[_0x2850('0x1d')](_0x58c673[_0x2850('0x2f')][_0x2850('0x1d')]);_0x5204a4[_0x2850('0x1b')]=qs['offset'](_0x58c673[_0x2850('0x2f')]['offset']);}return _0x38a08c[_0x2850('0x4d')](_0x5204a4);}})['then'](function(_0x36f945){if(_0x36f945){return _0x36f945?{'count':_0x55a4d3,'rows':_0x36f945}:null;}})[_0x2850('0x22')](respondWithResult(_0xd6489a,null))[_0x2850('0x42')](handleError(_0xd6489a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index a638404..c7e91b5 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 _0x6d70=['util','api','moment','bluebird','path','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x7b1c7c,_0x2b5888){var _0x3c8a8e=function(_0x27549d){while(--_0x27549d){_0x7b1c7c['push'](_0x7b1c7c['shift']());}};_0x3c8a8e(++_0x2b5888);}(_0x6d70,0x18b));var _0x06d7=function(_0x3cfc2a,_0x2b174b){_0x3cfc2a=_0x3cfc2a-0x0;var _0x15d596=_0x6d70[_0x3cfc2a];return _0x15d596;};'use strict';var _=require(_0x06d7('0x0'));var util=require(_0x06d7('0x1'));var logger=require('../../config/logger')(_0x06d7('0x2'));var moment=require(_0x06d7('0x3'));var BPromise=require(_0x06d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x06d7('0x5'));var rimraf=require('rimraf');var config=require(_0x06d7('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x06d7('0x7')]=function(_0x3b8154,_0x2dc6f0){return _0x3b8154[_0x06d7('0x8')](_0x06d7('0x9'),attributes,{'tableName':_0x06d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cfe=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x7cfe,0x123));var _0xe7cf=function(_0x5600d9,_0x563c7b){_0x5600d9=_0x5600d9-0x0;var _0x581db3=_0x7cfe[_0x5600d9];return _0x581db3;};'use strict';var _=require(_0xe7cf('0x0'));var util=require(_0xe7cf('0x1'));var logger=require(_0xe7cf('0x2'))('api');var moment=require(_0xe7cf('0x3'));var BPromise=require('bluebird');var rp=require(_0xe7cf('0x4'));var fs=require('fs');var path=require(_0xe7cf('0x5'));var rimraf=require(_0xe7cf('0x6'));var config=require(_0xe7cf('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xe7cf('0x8')]=function(_0x3fb2d6,_0x374367){return _0x3fb2d6[_0xe7cf('0x9')](_0xe7cf('0xa'),attributes,{'tableName':_0xe7cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 5496975..73dc9eb 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 _0xa495=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug'];(function(_0x30d11c,_0x2cd0d3){var _0x14da41=function(_0x48abe9){while(--_0x48abe9){_0x30d11c['push'](_0x30d11c['shift']());}};_0x14da41(++_0x2cd0d3);}(_0xa495,0x1bb));var _0x5a49=function(_0x4b1c73,_0x1a4207){_0x4b1c73=_0x4b1c73-0x0;var _0xfab919=_0xa495[_0x4b1c73];return _0xfab919;};'use strict';var _=require(_0x5a49('0x0'));var util=require(_0x5a49('0x1'));var moment=require('moment');var BPromise=require(_0x5a49('0x2'));var rs=require(_0x5a49('0x3'));var fs=require('fs');var Redis=require(_0x5a49('0x4'));var db=require(_0x5a49('0x5'))['db'];var utils=require(_0x5a49('0x6'));var logger=require(_0x5a49('0x7'))(_0x5a49('0x8'));var config=require(_0x5a49('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5a49('0xa')][_0x5a49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19895d,_0x361bed,_0x4ab5c7){return new BPromise(function(_0x15f255,_0x1e553a){return client[_0x5a49('0xc')](_0x19895d,_0x4ab5c7)[_0x5a49('0xd')](function(_0x3bd17f){logger[_0x5a49('0xe')](_0x5a49('0xf'),_0x361bed,'request\x20sent');logger[_0x5a49('0x10')](_0x5a49('0x11'),_0x361bed,_0x5a49('0x12'),JSON[_0x5a49('0x13')](_0x3bd17f));if(_0x3bd17f[_0x5a49('0x14')]){if(_0x3bd17f['error']['code']===0x1f4){logger[_0x5a49('0x14')](_0x5a49('0xf'),_0x361bed,_0x3bd17f['error'][_0x5a49('0x15')]);return _0x1e553a(_0x3bd17f[_0x5a49('0x14')][_0x5a49('0x15')]);}logger[_0x5a49('0x14')](_0x5a49('0xf'),_0x361bed,_0x3bd17f[_0x5a49('0x14')][_0x5a49('0x15')]);return _0x15f255(_0x3bd17f[_0x5a49('0x14')][_0x5a49('0x15')]);}else{logger[_0x5a49('0xe')](_0x5a49('0xf'),_0x361bed,_0x5a49('0x12'));_0x15f255(_0x3bd17f[_0x5a49('0x16')]['message']);}})['catch'](function(_0x2493a6){logger[_0x5a49('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x361bed,_0x2493a6);_0x1e553a(_0x2493a6);});});} \ No newline at end of file +var _0x864a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb'];(function(_0x1237b1,_0x19ce6b){var _0x429a0c=function(_0x52144e){while(--_0x52144e){_0x1237b1['push'](_0x1237b1['shift']());}};_0x429a0c(++_0x19ce6b);}(_0x864a,0x1b2));var _0xa864=function(_0x1fa8be,_0xf8dd2){_0x1fa8be=_0x1fa8be-0x0;var _0x83dca7=_0x864a[_0x1fa8be];return _0x83dca7;};'use strict';var _=require('lodash');var util=require(_0xa864('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa864('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa864('0x2'))['db'];var utils=require(_0xa864('0x3'));var logger=require(_0xa864('0x4'))(_0xa864('0x5'));var config=require(_0xa864('0x6'));var jayson=require(_0xa864('0x7'));var client=jayson['client'][_0xa864('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a1135,_0x15d330,_0x4ebecf){return new BPromise(function(_0x2a6063,_0x11fdfe){return client['request'](_0x1a1135,_0x4ebecf)['then'](function(_0x607732){logger[_0xa864('0x9')](_0xa864('0xa'),_0x15d330,_0xa864('0xb'));logger[_0xa864('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x15d330,_0xa864('0xb'),JSON[_0xa864('0xd')](_0x607732));if(_0x607732[_0xa864('0xe')]){if(_0x607732['error'][_0xa864('0xf')]===0x1f4){logger['error'](_0xa864('0xa'),_0x15d330,_0x607732[_0xa864('0xe')]['message']);return _0x11fdfe(_0x607732[_0xa864('0xe')][_0xa864('0x10')]);}logger[_0xa864('0xe')](_0xa864('0xa'),_0x15d330,_0x607732['error']['message']);return _0x2a6063(_0x607732['error']['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x15d330,_0xa864('0xb'));_0x2a6063(_0x607732[_0xa864('0x11')][_0xa864('0x10')]);}})[_0xa864('0x12')](function(_0xe0686){logger[_0xa864('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x15d330,_0xe0686);_0x11fdfe(_0xe0686);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 1334f15..296430b 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 _0xab05=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','path','express'];(function(_0x345070,_0x54c8d0){var _0x627877=function(_0x422b61){while(--_0x422b61){_0x345070['push'](_0x345070['shift']());}};_0x627877(++_0x54c8d0);}(_0xab05,0xb8));var _0x5ab0=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xab05[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x5ab0('0x0'));var util=require('util');var path=require(_0x5ab0('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ab0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ab0('0x3'));var interaction=require(_0x5ab0('0x4'));var config=require(_0x5ab0('0x5'));var controller=require('./intSugarcrmField.controller');router[_0x5ab0('0x6')]('/',auth[_0x5ab0('0x7')](),controller[_0x5ab0('0x8')]);router[_0x5ab0('0x6')](_0x5ab0('0x9'),auth[_0x5ab0('0x7')](),controller[_0x5ab0('0xa')]);router[_0x5ab0('0xb')]('/',auth['isAuthenticated'](),controller[_0x5ab0('0xc')]);router[_0x5ab0('0xd')]('/:id',auth[_0x5ab0('0x7')](),controller[_0x5ab0('0xe')]);router[_0x5ab0('0xf')](_0x5ab0('0x9'),auth[_0x5ab0('0x7')](),controller[_0x5ab0('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2a66=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2a66,0x1dc));var _0x62a6=function(_0x30562d,_0x522b66){_0x30562d=_0x30562d-0x0;var _0x1f6ced=_0x2a66[_0x30562d];return _0x1f6ced;};'use strict';var multer=require(_0x62a6('0x0'));var util=require(_0x62a6('0x1'));var path=require(_0x62a6('0x2'));var timeout=require(_0x62a6('0x3'));var express=require(_0x62a6('0x4'));var router=express[_0x62a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x62a6('0x6'));var interaction=require(_0x62a6('0x7'));var config=require(_0x62a6('0x8'));var controller=require(_0x62a6('0x9'));router[_0x62a6('0xa')]('/',auth[_0x62a6('0xb')](),controller['index']);router[_0x62a6('0xa')](_0x62a6('0xc'),auth[_0x62a6('0xb')](),controller[_0x62a6('0xd')]);router[_0x62a6('0xe')]('/',auth[_0x62a6('0xb')](),controller[_0x62a6('0xf')]);router[_0x62a6('0x10')](_0x62a6('0xc'),auth[_0x62a6('0xb')](),controller[_0x62a6('0x11')]);router[_0x62a6('0x12')](_0x62a6('0xc'),auth[_0x62a6('0xb')](),controller['destroy']);module[_0x62a6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 2b892b4..379a0f9 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 _0x0c02=['exports','ENUM','string','customVariable','picklist','STRING','sequelize'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0x0c02,0xbc));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x20c0('0x0'));module[_0x20c0('0x1')]={'type':{'type':Sequelize[_0x20c0('0x2')](_0x20c0('0x3'),'variable',_0x20c0('0x4'),'keyValue',_0x20c0('0x5')),'defaultValue':_0x20c0('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x20c0('0x2')](_0x20c0('0x3'),'variable',_0x20c0('0x4'))},'keyContent':{'type':Sequelize[_0x20c0('0x6')]},'idField':{'type':Sequelize[_0x20c0('0x6')]},'nameField':{'type':Sequelize[_0x20c0('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x20c0('0x6')]}}; \ No newline at end of file +var _0x6fec=['exports','ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0xfa79a5,_0x256ce5){var _0x41e7b9=function(_0x50aa78){while(--_0x50aa78){_0xfa79a5['push'](_0xfa79a5['shift']());}};_0x41e7b9(++_0x256ce5);}(_0x6fec,0x1a6));var _0xc6fe=function(_0x656f0c,_0x521fa8){_0x656f0c=_0x656f0c-0x0;var _0x502303=_0x6fec[_0x656f0c];return _0x502303;};'use strict';var Sequelize=require(_0xc6fe('0x0'));module[_0xc6fe('0x1')]={'type':{'type':Sequelize[_0xc6fe('0x2')](_0xc6fe('0x3'),'variable',_0xc6fe('0x4'),'keyValue',_0xc6fe('0x5')),'defaultValue':_0xc6fe('0x3')},'content':{'type':Sequelize[_0xc6fe('0x6')]},'key':{'type':Sequelize[_0xc6fe('0x6')]},'keyType':{'type':Sequelize[_0xc6fe('0x2')](_0xc6fe('0x3'),_0xc6fe('0x7'),_0xc6fe('0x4'))},'keyContent':{'type':Sequelize[_0xc6fe('0x6')]},'idField':{'type':Sequelize[_0xc6fe('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc6fe('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6fe('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index aaeed19..0ada768 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 _0x9343=['sort','pick','filter','where','merge','VIRTUAL','options','then','include','SugarcrmField','rows','catch','show','params','includeAll','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x2a0099,_0x4cf712){var _0x2d4237=function(_0x4f46f1){while(--_0x4f46f1){_0x2a0099['push'](_0x2a0099['shift']());}};_0x2d4237(++_0x4cf712);}(_0x9343,0xa2));var _0x3934=function(_0x4777e1,_0x290a8d){_0x4777e1=_0x4777e1-0x0;var _0x1f9147=_0x9343[_0x4777e1];return _0x1f9147;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3934('0x0'));var zipdir=require(_0x3934('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3934('0x2'));var moment=require(_0x3934('0x3'));var BPromise=require(_0x3934('0x4'));var Mustache=require('mustache');var util=require(_0x3934('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3934('0x6'));var ejs=require(_0x3934('0x7'));var fs=require('fs');var fs_extra=require(_0x3934('0x8'));var _=require('lodash');var squel=require(_0x3934('0x9'));var crypto=require(_0x3934('0xa'));var jsforce=require(_0x3934('0xb'));var deskjs=require(_0x3934('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3934('0xd'));var authService=require(_0x3934('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3934('0xf'));var hardwareService=require(_0x3934('0x10'));var logger=require(_0x3934('0x11'))(_0x3934('0x12'));var utils=require(_0x3934('0x13'));var config=require(_0x3934('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3934('0x15'))['db'];function respondWithStatusCode(_0x2f2204,_0x197f7c){_0x197f7c=_0x197f7c||0xcc;return function(_0x3e14a4){if(_0x3e14a4){return _0x2f2204['sendStatus'](_0x197f7c);}return _0x2f2204[_0x3934('0x16')](_0x197f7c)['end']();};}function respondWithResult(_0x21b0b5,_0x5a2c51){_0x5a2c51=_0x5a2c51||0xc8;return function(_0x5e8ab0){if(_0x5e8ab0){return _0x21b0b5[_0x3934('0x16')](_0x5a2c51)[_0x3934('0x17')](_0x5e8ab0);}};}function respondWithFilteredResult(_0x5c6568,_0x1af5ed){return function(_0x3467ab){if(_0x3467ab){var _0x3b22ec=typeof _0x1af5ed['offset']===_0x3934('0x18')&&typeof _0x1af5ed[_0x3934('0x19')]===_0x3934('0x18');var _0x1b3830=_0x3467ab[_0x3934('0x1a')];var _0x596fe5=_0x3b22ec?0x0:_0x1af5ed[_0x3934('0x1b')];var _0x56d7cc=_0x3b22ec?_0x3467ab['count']:_0x1af5ed[_0x3934('0x1b')]+_0x1af5ed[_0x3934('0x19')];var _0x3c1193;if(_0x56d7cc>=_0x1b3830){_0x56d7cc=_0x1b3830;_0x3c1193=0xc8;}else{_0x3c1193=0xce;}_0x5c6568['status'](_0x3c1193);return _0x5c6568['set'](_0x3934('0x1c'),_0x596fe5+'-'+_0x56d7cc+'/'+_0x1b3830)['json'](_0x3467ab);}return null;};}function patchUpdates(_0x4bad8f){return function(_0x369e40){try{jsonpatch['apply'](_0x369e40,_0x4bad8f,!![]);}catch(_0x1a1337){return BPromise[_0x3934('0x1d')](_0x1a1337);}return _0x369e40[_0x3934('0x1e')]();};}function saveUpdates(_0x6df068,_0x30345a){return function(_0x1778b6){if(_0x1778b6){return _0x1778b6[_0x3934('0x1f')](_0x6df068)['then'](function(_0x3f25a4){return _0x3f25a4;});}return null;};}function removeEntity(_0x1794eb,_0x113876){return function(_0x5d2fa2){if(_0x5d2fa2){return _0x5d2fa2[_0x3934('0x20')]()['then'](function(){_0x1794eb['status'](0xcc)[_0x3934('0x21')]();});}};}function handleEntityNotFound(_0x1fc163,_0x20c53f){return function(_0x455f89){if(!_0x455f89){_0x1fc163[_0x3934('0x22')](0x194);}return _0x455f89;};}function handleError(_0x3d41f5,_0x5de2fb){_0x5de2fb=_0x5de2fb||0x1f4;return function(_0x2e1525){logger[_0x3934('0x23')](_0x2e1525[_0x3934('0x24')]);if(_0x2e1525[_0x3934('0x25')]){delete _0x2e1525[_0x3934('0x25')];}_0x3d41f5[_0x3934('0x16')](_0x5de2fb)[_0x3934('0x26')](_0x2e1525);};}exports[_0x3934('0x27')]=function(_0x1d6aa6,_0x1e0d4e){var _0x37f295={},_0x4464ae={},_0x4e8750={'count':0x0,'rows':[]};var _0x359a65=_[_0x3934('0x28')](db['SugarcrmField'][_0x3934('0x29')],function(_0x4ecf69){return{'name':_0x4ecf69['fieldName'],'type':_0x4ecf69[_0x3934('0x2a')][_0x3934('0x2b')]};});_0x4464ae[_0x3934('0x2c')]=_[_0x3934('0x28')](_0x359a65,_0x3934('0x25'));_0x4464ae[_0x3934('0x2d')]=_[_0x3934('0x2e')](_0x1d6aa6[_0x3934('0x2d')]);_0x4464ae[_0x3934('0x2f')]=_['intersection'](_0x4464ae[_0x3934('0x2c')],_0x4464ae[_0x3934('0x2d')]);_0x37f295[_0x3934('0x30')]=_[_0x3934('0x31')](_0x4464ae[_0x3934('0x2c')],qs[_0x3934('0x32')](_0x1d6aa6[_0x3934('0x2d')][_0x3934('0x32')]));_0x37f295[_0x3934('0x30')]=_0x37f295[_0x3934('0x30')][_0x3934('0x33')]?_0x37f295[_0x3934('0x30')]:_0x4464ae[_0x3934('0x2c')];if(!_0x1d6aa6[_0x3934('0x2d')][_0x3934('0x34')](_0x3934('0x35'))){_0x37f295[_0x3934('0x19')]=qs[_0x3934('0x19')](_0x1d6aa6[_0x3934('0x2d')][_0x3934('0x19')]);_0x37f295[_0x3934('0x1b')]=qs[_0x3934('0x1b')](_0x1d6aa6[_0x3934('0x2d')][_0x3934('0x1b')]);}_0x37f295['order']=qs[_0x3934('0x36')](_0x1d6aa6['query'][_0x3934('0x36')]);_0x37f295['where']=qs[_0x3934('0x2f')](_[_0x3934('0x37')](_0x1d6aa6[_0x3934('0x2d')],_0x4464ae[_0x3934('0x2f')]),_0x359a65);if(_0x1d6aa6[_0x3934('0x2d')][_0x3934('0x38')]){_0x37f295[_0x3934('0x39')]=_[_0x3934('0x3a')](_0x37f295[_0x3934('0x39')],{'$or':_['map'](_0x359a65,function(_0x31b82e){if(_0x31b82e[_0x3934('0x2a')]!==_0x3934('0x3b')){var _0x51ed82={};_0x51ed82[_0x31b82e[_0x3934('0x25')]]={'$like':'%'+_0x1d6aa6[_0x3934('0x2d')][_0x3934('0x38')]+'%'};return _0x51ed82;}})});}_0x37f295=_['merge']({},_0x37f295,_0x1d6aa6[_0x3934('0x3c')]);var _0x4dce16={'where':_0x37f295['where']};return db['SugarcrmField'][_0x3934('0x1a')](_0x4dce16)[_0x3934('0x3d')](function(_0x2b73e1){_0x4e8750[_0x3934('0x1a')]=_0x2b73e1;if(_0x1d6aa6[_0x3934('0x2d')]['includeAll']){_0x37f295[_0x3934('0x3e')]=[{'all':!![]}];}return db[_0x3934('0x3f')]['findAll'](_0x37f295);})['then'](function(_0x435d2a){_0x4e8750[_0x3934('0x40')]=_0x435d2a;return _0x4e8750;})[_0x3934('0x3d')](respondWithFilteredResult(_0x1e0d4e,_0x37f295))[_0x3934('0x41')](handleError(_0x1e0d4e,null));};exports[_0x3934('0x42')]=function(_0x3fd89c,_0x426f50){var _0x1c68bc={'raw':!![],'where':{'id':_0x3fd89c[_0x3934('0x43')]['id']}},_0xcf91a1={};_0xcf91a1[_0x3934('0x2c')]=_[_0x3934('0x2e')](db[_0x3934('0x3f')][_0x3934('0x29')]);_0xcf91a1[_0x3934('0x2d')]=_[_0x3934('0x2e')](_0x3fd89c[_0x3934('0x2d')]);_0xcf91a1[_0x3934('0x2f')]=_[_0x3934('0x31')](_0xcf91a1[_0x3934('0x2c')],_0xcf91a1[_0x3934('0x2d')]);_0x1c68bc[_0x3934('0x30')]=_['intersection'](_0xcf91a1['model'],qs[_0x3934('0x32')](_0x3fd89c[_0x3934('0x2d')][_0x3934('0x32')]));_0x1c68bc[_0x3934('0x30')]=_0x1c68bc[_0x3934('0x30')][_0x3934('0x33')]?_0x1c68bc['attributes']:_0xcf91a1[_0x3934('0x2c')];if(_0x3fd89c['query'][_0x3934('0x44')]){_0x1c68bc[_0x3934('0x3e')]=[{'all':!![]}];}_0x1c68bc=_['merge']({},_0x1c68bc,_0x3fd89c[_0x3934('0x3c')]);return db[_0x3934('0x3f')][_0x3934('0x45')](_0x1c68bc)[_0x3934('0x3d')](handleEntityNotFound(_0x426f50,null))['then'](respondWithResult(_0x426f50,null))[_0x3934('0x41')](handleError(_0x426f50,null));};exports[_0x3934('0x46')]=function(_0x227bf3,_0x45a191){return db[_0x3934('0x3f')][_0x3934('0x46')](_0x227bf3[_0x3934('0x47')],{})['then'](respondWithResult(_0x45a191,0xc9))[_0x3934('0x41')](handleError(_0x45a191,null));};exports[_0x3934('0x1f')]=function(_0x1248c3,_0x520967){if(_0x1248c3['body']['id']){delete _0x1248c3[_0x3934('0x47')]['id'];}return db[_0x3934('0x3f')][_0x3934('0x45')]({'where':{'id':_0x1248c3[_0x3934('0x43')]['id']}})[_0x3934('0x3d')](handleEntityNotFound(_0x520967,null))[_0x3934('0x3d')](saveUpdates(_0x1248c3[_0x3934('0x47')],null))[_0x3934('0x3d')](respondWithResult(_0x520967,null))[_0x3934('0x41')](handleError(_0x520967,null));};exports['destroy']=function(_0x4db715,_0x1be224){return db[_0x3934('0x3f')][_0x3934('0x45')]({'where':{'id':_0x4db715[_0x3934('0x43')]['id']}})[_0x3934('0x3d')](handleEntityNotFound(_0x1be224,null))[_0x3934('0x3d')](removeEntity(_0x1be224,null))[_0x3934('0x41')](handleError(_0x1be224,null));}; \ No newline at end of file +var _0x1903=['where','pick','filters','filter','type','VIRTUAL','merge','options','SugarcrmField','includeAll','include','findAll','show','params','intersection','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','json','apply','save','update','then','sendStatus','error','index','map','rawAttributes','fieldName','key','model','name','query','keys','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x7538c5,_0xa5d8ac){var _0x8b56be=function(_0x2036c0){while(--_0x2036c0){_0x7538c5['push'](_0x7538c5['shift']());}};_0x8b56be(++_0xa5d8ac);}(_0x1903,0xa6));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3190('0x0'));var zipdir=require(_0x3190('0x1'));var jsonpatch=require(_0x3190('0x2'));var rp=require(_0x3190('0x3'));var moment=require(_0x3190('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3190('0x5'));var util=require(_0x3190('0x6'));var path=require(_0x3190('0x7'));var sox=require(_0x3190('0x8'));var csv=require('to-csv');var ejs=require(_0x3190('0x9'));var fs=require('fs');var fs_extra=require(_0x3190('0xa'));var _=require(_0x3190('0xb'));var squel=require(_0x3190('0xc'));var crypto=require(_0x3190('0xd'));var jsforce=require(_0x3190('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3190('0xf'));var querystring=require('querystring');var Papa=require(_0x3190('0x10'));var Redis=require('ioredis');var authService=require(_0x3190('0x11'));var qs=require(_0x3190('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3190('0x13'));var logger=require(_0x3190('0x14'))('api');var utils=require(_0x3190('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3190('0x16'));var db=require(_0x3190('0x17'))['db'];function respondWithStatusCode(_0x2388b1,_0x5aabde){_0x5aabde=_0x5aabde||0xcc;return function(_0x5f0951){if(_0x5f0951){return _0x2388b1['sendStatus'](_0x5aabde);}return _0x2388b1[_0x3190('0x18')](_0x5aabde)[_0x3190('0x19')]();};}function respondWithResult(_0x5b9d23,_0xcc06aa){_0xcc06aa=_0xcc06aa||0xc8;return function(_0x1b59c0){if(_0x1b59c0){return _0x5b9d23[_0x3190('0x18')](_0xcc06aa)['json'](_0x1b59c0);}};}function respondWithFilteredResult(_0x52c5fe,_0x723013){return function(_0x3d2815){if(_0x3d2815){var _0xb29a04=typeof _0x723013['offset']===_0x3190('0x1a')&&typeof _0x723013['limit']==='undefined';var _0x400dc4=_0x3d2815['count'];var _0x220955=_0xb29a04?0x0:_0x723013['offset'];var _0x5343fb=_0xb29a04?_0x3d2815[_0x3190('0x1b')]:_0x723013[_0x3190('0x1c')]+_0x723013[_0x3190('0x1d')];var _0x4fb979;if(_0x5343fb>=_0x400dc4){_0x5343fb=_0x400dc4;_0x4fb979=0xc8;}else{_0x4fb979=0xce;}_0x52c5fe[_0x3190('0x18')](_0x4fb979);return _0x52c5fe[_0x3190('0x1e')]('Content-Range',_0x220955+'-'+_0x5343fb+'/'+_0x400dc4)[_0x3190('0x1f')](_0x3d2815);}return null;};}function patchUpdates(_0x5bfa7c){return function(_0x4e5355){try{jsonpatch[_0x3190('0x20')](_0x4e5355,_0x5bfa7c,!![]);}catch(_0x3905cb){return BPromise['reject'](_0x3905cb);}return _0x4e5355[_0x3190('0x21')]();};}function saveUpdates(_0x333e7d,_0x131bbc){return function(_0x2acc1a){if(_0x2acc1a){return _0x2acc1a[_0x3190('0x22')](_0x333e7d)[_0x3190('0x23')](function(_0x36422){return _0x36422;});}return null;};}function removeEntity(_0x360028,_0x515044){return function(_0x1b6178){if(_0x1b6178){return _0x1b6178['destroy']()['then'](function(){_0x360028[_0x3190('0x18')](0xcc)[_0x3190('0x19')]();});}};}function handleEntityNotFound(_0x8f10e8,_0x7eccd3){return function(_0x47e2aa){if(!_0x47e2aa){_0x8f10e8[_0x3190('0x24')](0x194);}return _0x47e2aa;};}function handleError(_0x5e7ec4,_0x536f0f){_0x536f0f=_0x536f0f||0x1f4;return function(_0x263d65){logger[_0x3190('0x25')](_0x263d65['stack']);if(_0x263d65['name']){delete _0x263d65['name'];}_0x5e7ec4[_0x3190('0x18')](_0x536f0f)['send'](_0x263d65);};}exports[_0x3190('0x26')]=function(_0x5929c2,_0x592eab){var _0x1d20c5={},_0x24d54e={},_0x4d7cfd={'count':0x0,'rows':[]};var _0x42469e=_[_0x3190('0x27')](db['SugarcrmField'][_0x3190('0x28')],function(_0x2fa381){return{'name':_0x2fa381[_0x3190('0x29')],'type':_0x2fa381['type'][_0x3190('0x2a')]};});_0x24d54e[_0x3190('0x2b')]=_[_0x3190('0x27')](_0x42469e,_0x3190('0x2c'));_0x24d54e[_0x3190('0x2d')]=_[_0x3190('0x2e')](_0x5929c2['query']);_0x24d54e['filters']=_['intersection'](_0x24d54e[_0x3190('0x2b')],_0x24d54e[_0x3190('0x2d')]);_0x1d20c5[_0x3190('0x2f')]=_['intersection'](_0x24d54e[_0x3190('0x2b')],qs[_0x3190('0x30')](_0x5929c2[_0x3190('0x2d')][_0x3190('0x30')]));_0x1d20c5['attributes']=_0x1d20c5['attributes'][_0x3190('0x31')]?_0x1d20c5[_0x3190('0x2f')]:_0x24d54e[_0x3190('0x2b')];if(!_0x5929c2[_0x3190('0x2d')][_0x3190('0x32')]('nolimit')){_0x1d20c5[_0x3190('0x1d')]=qs[_0x3190('0x1d')](_0x5929c2['query']['limit']);_0x1d20c5['offset']=qs[_0x3190('0x1c')](_0x5929c2[_0x3190('0x2d')][_0x3190('0x1c')]);}_0x1d20c5[_0x3190('0x33')]=qs[_0x3190('0x34')](_0x5929c2['query'][_0x3190('0x34')]);_0x1d20c5[_0x3190('0x35')]=qs['filters'](_[_0x3190('0x36')](_0x5929c2[_0x3190('0x2d')],_0x24d54e[_0x3190('0x37')]),_0x42469e);if(_0x5929c2[_0x3190('0x2d')][_0x3190('0x38')]){_0x1d20c5['where']=_['merge'](_0x1d20c5[_0x3190('0x35')],{'$or':_[_0x3190('0x27')](_0x42469e,function(_0x401072){if(_0x401072[_0x3190('0x39')]!==_0x3190('0x3a')){var _0x25b586={};_0x25b586[_0x401072['name']]={'$like':'%'+_0x5929c2['query']['filter']+'%'};return _0x25b586;}})});}_0x1d20c5=_[_0x3190('0x3b')]({},_0x1d20c5,_0x5929c2[_0x3190('0x3c')]);var _0x8954de={'where':_0x1d20c5[_0x3190('0x35')]};return db[_0x3190('0x3d')]['count'](_0x8954de)[_0x3190('0x23')](function(_0x4cbbd4){_0x4d7cfd[_0x3190('0x1b')]=_0x4cbbd4;if(_0x5929c2['query'][_0x3190('0x3e')]){_0x1d20c5[_0x3190('0x3f')]=[{'all':!![]}];}return db[_0x3190('0x3d')][_0x3190('0x40')](_0x1d20c5);})[_0x3190('0x23')](function(_0x306b1a){_0x4d7cfd['rows']=_0x306b1a;return _0x4d7cfd;})[_0x3190('0x23')](respondWithFilteredResult(_0x592eab,_0x1d20c5))['catch'](handleError(_0x592eab,null));};exports[_0x3190('0x41')]=function(_0x38848b,_0x39c622){var _0x27f6e6={'raw':!![],'where':{'id':_0x38848b[_0x3190('0x42')]['id']}},_0x5324fb={};_0x5324fb[_0x3190('0x2b')]=_[_0x3190('0x2e')](db[_0x3190('0x3d')][_0x3190('0x28')]);_0x5324fb[_0x3190('0x2d')]=_[_0x3190('0x2e')](_0x38848b[_0x3190('0x2d')]);_0x5324fb[_0x3190('0x37')]=_['intersection'](_0x5324fb[_0x3190('0x2b')],_0x5324fb[_0x3190('0x2d')]);_0x27f6e6['attributes']=_[_0x3190('0x43')](_0x5324fb['model'],qs['fields'](_0x38848b['query'][_0x3190('0x30')]));_0x27f6e6[_0x3190('0x2f')]=_0x27f6e6[_0x3190('0x2f')][_0x3190('0x31')]?_0x27f6e6[_0x3190('0x2f')]:_0x5324fb[_0x3190('0x2b')];if(_0x38848b[_0x3190('0x2d')][_0x3190('0x3e')]){_0x27f6e6[_0x3190('0x3f')]=[{'all':!![]}];}_0x27f6e6=_['merge']({},_0x27f6e6,_0x38848b['options']);return db[_0x3190('0x3d')][_0x3190('0x44')](_0x27f6e6)['then'](handleEntityNotFound(_0x39c622,null))[_0x3190('0x23')](respondWithResult(_0x39c622,null))[_0x3190('0x45')](handleError(_0x39c622,null));};exports['create']=function(_0x808c3d,_0x3cefbf){return db[_0x3190('0x3d')][_0x3190('0x46')](_0x808c3d[_0x3190('0x47')],{})[_0x3190('0x23')](respondWithResult(_0x3cefbf,0xc9))[_0x3190('0x45')](handleError(_0x3cefbf,null));};exports['update']=function(_0x576bee,_0x28d89f){if(_0x576bee[_0x3190('0x47')]['id']){delete _0x576bee[_0x3190('0x47')]['id'];}return db[_0x3190('0x3d')][_0x3190('0x44')]({'where':{'id':_0x576bee[_0x3190('0x42')]['id']}})[_0x3190('0x23')](handleEntityNotFound(_0x28d89f,null))['then'](saveUpdates(_0x576bee[_0x3190('0x47')],null))[_0x3190('0x23')](respondWithResult(_0x28d89f,null))[_0x3190('0x45')](handleError(_0x28d89f,null));};exports[_0x3190('0x48')]=function(_0x55eb18,_0x206ee5){return db[_0x3190('0x3d')][_0x3190('0x44')]({'where':{'id':_0x55eb18[_0x3190('0x42')]['id']}})[_0x3190('0x23')](handleEntityNotFound(_0x206ee5,null))[_0x3190('0x23')](removeEntity(_0x206ee5,null))[_0x3190('0x45')](handleError(_0x206ee5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index b4cd719..0c9b13a 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 _0x2318=['int_sugarcrm_fields','idField','FieldId','api','moment','bluebird','path','rimraf','../../config/environment','SugarcrmField'];(function(_0x2d1406,_0x8a575e){var _0x31a9fb=function(_0x35ac19){while(--_0x35ac19){_0x2d1406['push'](_0x2d1406['shift']());}};_0x31a9fb(++_0x8a575e);}(_0x2318,0x16b));var _0x8231=function(_0x3e3446,_0x22ae46){_0x3e3446=_0x3e3446-0x0;var _0x72f2b6=_0x2318[_0x3e3446];return _0x72f2b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8231('0x0'));var moment=require(_0x8231('0x1'));var BPromise=require(_0x8231('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8231('0x3'));var rimraf=require(_0x8231('0x4'));var config=require(_0x8231('0x5'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x1db167,_0xe563b9){return _0x1db167['define'](_0x8231('0x6'),attributes,{'tableName':_0x8231('0x7'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x8231('0x8'),_0x8231('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd8f=['path','./intSugarcrmField.attributes','exports','define','SugarcrmField','idField','lodash','util','../../config/logger','api','request-promise'];(function(_0x26c3ec,_0x3ee627){var _0x196f9a=function(_0x34a7a6){while(--_0x34a7a6){_0x26c3ec['push'](_0x26c3ec['shift']());}};_0x196f9a(++_0x3ee627);}(_0xdd8f,0xb6));var _0xfdd8=function(_0x48e34f,_0x4cbf92){_0x48e34f=_0x48e34f-0x0;var _0x78abb2=_0xdd8f[_0x48e34f];return _0x78abb2;};'use strict';var _=require(_0xfdd8('0x0'));var util=require(_0xfdd8('0x1'));var logger=require(_0xfdd8('0x2'))(_0xfdd8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfdd8('0x4'));var fs=require('fs');var path=require(_0xfdd8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfdd8('0x6'));module[_0xfdd8('0x7')]=function(_0x54fd7b,_0x99e158){return _0x54fd7b[_0xfdd8('0x8')](_0xfdd8('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xfdd8('0xa'),'FieldId'],'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 ae5627e..7a67ca3 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 _0x6959=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6959,0x167));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9695('0x0'));var util=require(_0x9695('0x1'));var moment=require('moment');var BPromise=require(_0x9695('0x2'));var rs=require(_0x9695('0x3'));var fs=require('fs');var Redis=require(_0x9695('0x4'));var db=require(_0x9695('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9695('0x6'));var jayson=require(_0x9695('0x7'));var client=jayson[_0x9695('0x8')][_0x9695('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b5199,_0x34b4db,_0x15c491){return new BPromise(function(_0x5e318a,_0x28d8cc){return client[_0x9695('0xa')](_0x5b5199,_0x15c491)['then'](function(_0x75c148){logger[_0x9695('0xb')](_0x9695('0xc'),_0x34b4db,_0x9695('0xd'));logger['debug'](_0x9695('0xe'),_0x34b4db,_0x9695('0xd'),JSON[_0x9695('0xf')](_0x75c148));if(_0x75c148[_0x9695('0x10')]){if(_0x75c148[_0x9695('0x10')]['code']===0x1f4){logger[_0x9695('0x10')](_0x9695('0xc'),_0x34b4db,_0x75c148['error'][_0x9695('0x11')]);return _0x28d8cc(_0x75c148['error']['message']);}logger['error'](_0x9695('0xc'),_0x34b4db,_0x75c148['error'][_0x9695('0x11')]);return _0x5e318a(_0x75c148[_0x9695('0x10')][_0x9695('0x11')]);}else{logger[_0x9695('0xb')](_0x9695('0xc'),_0x34b4db,_0x9695('0xd'));_0x5e318a(_0x75c148['result'][_0x9695('0x11')]);}})[_0x9695('0x12')](function(_0x4a5d02){logger[_0x9695('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x34b4db,_0x4a5d02);_0x28d8cc(_0x4a5d02);});});} \ No newline at end of file +var _0xfc42=['../../config/logger','rpc','jayson/promise','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xfc42,0x102));var _0x2fc4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfc42[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2fc4('0x0'));var util=require(_0x2fc4('0x1'));var moment=require(_0x2fc4('0x2'));var BPromise=require(_0x2fc4('0x3'));var rs=require(_0x2fc4('0x4'));var fs=require('fs');var Redis=require(_0x2fc4('0x5'));var db=require(_0x2fc4('0x6'))['db'];var utils=require(_0x2fc4('0x7'));var logger=require(_0x2fc4('0x8'))(_0x2fc4('0x9'));var config=require('../../config/environment');var jayson=require(_0x2fc4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11e50c,_0xc9e703,_0x1f669c){return new BPromise(function(_0x31136d,_0x566aaf){return client['request'](_0x11e50c,_0x1f669c)['then'](function(_0xadcb5d){logger['info'](_0x2fc4('0xb'),_0xc9e703,_0x2fc4('0xc'));logger[_0x2fc4('0xd')](_0x2fc4('0xe'),_0xc9e703,_0x2fc4('0xc'),JSON[_0x2fc4('0xf')](_0xadcb5d));if(_0xadcb5d['error']){if(_0xadcb5d[_0x2fc4('0x10')][_0x2fc4('0x11')]===0x1f4){logger[_0x2fc4('0x10')](_0x2fc4('0xb'),_0xc9e703,_0xadcb5d[_0x2fc4('0x10')][_0x2fc4('0x12')]);return _0x566aaf(_0xadcb5d[_0x2fc4('0x10')][_0x2fc4('0x12')]);}logger[_0x2fc4('0x10')](_0x2fc4('0xb'),_0xc9e703,_0xadcb5d['error']['message']);return _0x31136d(_0xadcb5d['error'][_0x2fc4('0x12')]);}else{logger['info'](_0x2fc4('0xb'),_0xc9e703,_0x2fc4('0xc'));_0x31136d(_0xadcb5d['result'][_0x2fc4('0x12')]);}})['catch'](function(_0x7cfc5c){logger[_0x2fc4('0x10')](_0x2fc4('0xb'),_0xc9e703,_0x7cfc5c);_0x566aaf(_0x7cfc5c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 247fedd..3f2359b 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 _0xcf4c=['../../config/environment','./intVtigerAccount.controller','get','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','create','addConfiguration','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x328b5e,_0x3c161c){var _0x3fa97e=function(_0x51fbf0){while(--_0x51fbf0){_0x328b5e['push'](_0x328b5e['shift']());}};_0x3fa97e(++_0x3c161c);}(_0xcf4c,0x19a));var _0xccf4=function(_0x4dc68a,_0x1f734f){_0x4dc68a=_0x4dc68a-0x0;var _0x127384=_0xcf4c[_0x4dc68a];return _0x127384;};'use strict';var multer=require(_0xccf4('0x0'));var util=require(_0xccf4('0x1'));var path=require(_0xccf4('0x2'));var timeout=require('connect-timeout');var express=require(_0xccf4('0x3'));var router=express[_0xccf4('0x4')]();var fs_extra=require(_0xccf4('0x5'));var auth=require(_0xccf4('0x6'));var interaction=require(_0xccf4('0x7'));var config=require(_0xccf4('0x8'));var controller=require(_0xccf4('0x9'));router[_0xccf4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xccf4('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xccf4('0xb')]);router['get'](_0xccf4('0xc'),auth[_0xccf4('0xd')](),controller['getConfigurations']);router[_0xccf4('0xa')](_0xccf4('0xe'),auth[_0xccf4('0xd')](),controller[_0xccf4('0xf')]);router['post']('/',auth[_0xccf4('0xd')](),controller[_0xccf4('0x10')]);router['post'](_0xccf4('0xc'),auth[_0xccf4('0xd')](),controller[_0xccf4('0x11')]);router[_0xccf4('0x12')]('/:id',auth[_0xccf4('0xd')](),controller[_0xccf4('0x13')]);router[_0xccf4('0x14')]('/:id',auth[_0xccf4('0xd')](),controller['destroy']);module[_0xccf4('0x15')]=router; \ No newline at end of file +var _0xc288=['show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated'];(function(_0x5b4c44,_0x2e495e){var _0x58485a=function(_0x13299b){while(--_0x13299b){_0x5b4c44['push'](_0x5b4c44['shift']());}};_0x58485a(++_0x2e495e);}(_0xc288,0x18b));var _0x8c28=function(_0x38fd2a,_0x5469ae){_0x38fd2a=_0x38fd2a-0x0;var _0x45cc51=_0xc288[_0x38fd2a];return _0x45cc51;};'use strict';var multer=require(_0x8c28('0x0'));var util=require('util');var path=require(_0x8c28('0x1'));var timeout=require(_0x8c28('0x2'));var express=require(_0x8c28('0x3'));var router=express[_0x8c28('0x4')]();var fs_extra=require(_0x8c28('0x5'));var auth=require(_0x8c28('0x6'));var interaction=require(_0x8c28('0x7'));var config=require(_0x8c28('0x8'));var controller=require(_0x8c28('0x9'));router[_0x8c28('0xa')]('/',auth['isAuthenticated'](),controller[_0x8c28('0xb')]);router['get']('/:id',auth[_0x8c28('0xc')](),controller[_0x8c28('0xd')]);router[_0x8c28('0xa')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0xf')]);router['get'](_0x8c28('0x10'),auth[_0x8c28('0xc')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x8c28('0x11')]);router[_0x8c28('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8c28('0x13')]);router['put'](_0x8c28('0x14'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x15')]);router['delete'](_0x8c28('0x14'),auth['isAuthenticated'](),controller[_0x8c28('0x16')]);module[_0x8c28('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 7c1f92b..e94f53a 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 _0x7e46=['exports','STRING','sequelize'];(function(_0x443cb9,_0x14f32b){var _0x475e4c=function(_0x30c230){while(--_0x30c230){_0x443cb9['push'](_0x443cb9['shift']());}};_0x475e4c(++_0x14f32b);}(_0x7e46,0x152));var _0x67e4=function(_0x1c6817,_0x244036){_0x1c6817=_0x1c6817-0x0;var _0xc31617=_0x7e46[_0x1c6817];return _0xc31617;};'use strict';var Sequelize=require(_0x67e4('0x0'));module[_0x67e4('0x1')]={'name':{'type':Sequelize[_0x67e4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x67e4('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x67e4('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x67e4('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x67e4('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3032=['exports','STRING','sequelize'];(function(_0x5b58ba,_0x16159f){var _0xc67099=function(_0x1c5b8a){while(--_0x1c5b8a){_0x5b58ba['push'](_0x5b58ba['shift']());}};_0xc67099(++_0x16159f);}(_0x3032,0x13d));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2303('0x0'));module[_0x2303('0x1')]={'name':{'type':Sequelize[_0x2303('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2303('0x2')]},'username':{'type':Sequelize[_0x2303('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2303('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x2303('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2303('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 7b7763b..6af0686 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 _0xd959=['username','description','moduleName','slice','lastIndexOf','%s/webservice.php','GET','POST','login','describe','result','success','autogenerated','reference','owner','remove','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','rimraf','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/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','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','create','VtigerAccount','body','find','destroy','findOne','VtigerConfiguration','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','getFields'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xd959,0x181));var _0x9d95=function(_0x540429,_0x95095e){_0x540429=_0x540429-0x0;var _0x2883b0=_0xd959[_0x540429];return _0x2883b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9d95('0x0'));var zipdir=require(_0x9d95('0x1'));var jsonpatch=require(_0x9d95('0x2'));var rp=require(_0x9d95('0x3'));var moment=require(_0x9d95('0x4'));var BPromise=require(_0x9d95('0x5'));var Mustache=require(_0x9d95('0x6'));var util=require(_0x9d95('0x7'));var path=require(_0x9d95('0x8'));var sox=require(_0x9d95('0x9'));var csv=require(_0x9d95('0xa'));var ejs=require(_0x9d95('0xb'));var fs=require('fs');var fs_extra=require(_0x9d95('0xc'));var _=require(_0x9d95('0xd'));var squel=require(_0x9d95('0xe'));var crypto=require(_0x9d95('0xf'));var jsforce=require(_0x9d95('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9d95('0xa'));var querystring=require('querystring');var Papa=require(_0x9d95('0x11'));var Redis=require(_0x9d95('0x12'));var authService=require(_0x9d95('0x13'));var qs=require(_0x9d95('0x14'));var as=require(_0x9d95('0x15'));var hardwareService=require(_0x9d95('0x16'));var logger=require(_0x9d95('0x17'))(_0x9d95('0x18'));var utils=require(_0x9d95('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9d95('0x1a'));var db=require(_0x9d95('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x521920,_0x6ce112){_0x6ce112=_0x6ce112||0xcc;return function(_0x50b1de){if(_0x50b1de){return _0x521920[_0x9d95('0x1c')](_0x6ce112);}return _0x521920['status'](_0x6ce112)[_0x9d95('0x1d')]();};}function respondWithResult(_0x473a7e,_0x1f0246){_0x1f0246=_0x1f0246||0xc8;return function(_0x6dcca5){if(_0x6dcca5){return _0x473a7e[_0x9d95('0x1e')](_0x1f0246)[_0x9d95('0x1f')](_0x6dcca5);}};}function respondWithFilteredResult(_0x37bef1,_0x1cc7eb){return function(_0x2bd7a2){if(_0x2bd7a2){var _0x32fb7c=typeof _0x1cc7eb[_0x9d95('0x20')]===_0x9d95('0x21')&&typeof _0x1cc7eb[_0x9d95('0x22')]===_0x9d95('0x21');var _0x2c6cdd=_0x2bd7a2['count'];var _0x571b61=_0x32fb7c?0x0:_0x1cc7eb['offset'];var _0x21ad27=_0x32fb7c?_0x2bd7a2[_0x9d95('0x23')]:_0x1cc7eb[_0x9d95('0x20')]+_0x1cc7eb[_0x9d95('0x22')];var _0x4f24da;if(_0x21ad27>=_0x2c6cdd){_0x21ad27=_0x2c6cdd;_0x4f24da=0xc8;}else{_0x4f24da=0xce;}_0x37bef1[_0x9d95('0x1e')](_0x4f24da);return _0x37bef1[_0x9d95('0x24')](_0x9d95('0x25'),_0x571b61+'-'+_0x21ad27+'/'+_0x2c6cdd)[_0x9d95('0x1f')](_0x2bd7a2);}return null;};}function patchUpdates(_0x1acf9a){return function(_0x3caab9){try{jsonpatch[_0x9d95('0x26')](_0x3caab9,_0x1acf9a,!![]);}catch(_0x451671){return BPromise[_0x9d95('0x27')](_0x451671);}return _0x3caab9[_0x9d95('0x28')]();};}function saveUpdates(_0x4142ac,_0x117786){return function(_0x4ae79a){if(_0x4ae79a){return _0x4ae79a[_0x9d95('0x29')](_0x4142ac)[_0x9d95('0x2a')](function(_0x3a3fac){return _0x3a3fac;});}return null;};}function removeEntity(_0xf7b78c,_0x354ca9){return function(_0x15a5f2){if(_0x15a5f2){return _0x15a5f2['destroy']()[_0x9d95('0x2a')](function(){_0xf7b78c[_0x9d95('0x1e')](0xcc)[_0x9d95('0x1d')]();});}};}function handleEntityNotFound(_0x125c0b,_0x542ad4){return function(_0x38e715){if(!_0x38e715){_0x125c0b[_0x9d95('0x1c')](0x194);}return _0x38e715;};}function handleError(_0x31505a,_0xbf5731){_0xbf5731=_0xbf5731||0x1f4;return function(_0x517037){logger[_0x9d95('0x2b')](_0x517037[_0x9d95('0x2c')]);if(_0x517037['name']){delete _0x517037[_0x9d95('0x2d')];}_0x31505a['status'](_0xbf5731)[_0x9d95('0x2e')](_0x517037);};}exports['index']=function(_0x52c906,_0x43e5dd){var _0x227812={},_0x17f50d={},_0x1e0553={'count':0x0,'rows':[]};var _0x210c5c=_[_0x9d95('0x2f')](db['VtigerAccount'][_0x9d95('0x30')],function(_0x1232e6){return{'name':_0x1232e6[_0x9d95('0x31')],'type':_0x1232e6[_0x9d95('0x32')][_0x9d95('0x33')]};});_0x17f50d[_0x9d95('0x34')]=_['map'](_0x210c5c,_0x9d95('0x2d'));_0x17f50d['query']=_[_0x9d95('0x35')](_0x52c906['query']);_0x17f50d[_0x9d95('0x36')]=_[_0x9d95('0x37')](_0x17f50d[_0x9d95('0x34')],_0x17f50d[_0x9d95('0x38')]);_0x227812[_0x9d95('0x39')]=_[_0x9d95('0x37')](_0x17f50d[_0x9d95('0x34')],qs[_0x9d95('0x3a')](_0x52c906[_0x9d95('0x38')][_0x9d95('0x3a')]));_0x227812[_0x9d95('0x39')]=_0x227812['attributes'][_0x9d95('0x3b')]?_0x227812[_0x9d95('0x39')]:_0x17f50d[_0x9d95('0x34')];if(!_0x52c906[_0x9d95('0x38')]['hasOwnProperty'](_0x9d95('0x3c'))){_0x227812['limit']=qs[_0x9d95('0x22')](_0x52c906[_0x9d95('0x38')]['limit']);_0x227812[_0x9d95('0x20')]=qs['offset'](_0x52c906[_0x9d95('0x38')][_0x9d95('0x20')]);}_0x227812[_0x9d95('0x3d')]=qs[_0x9d95('0x3e')](_0x52c906[_0x9d95('0x38')]['sort']);_0x227812[_0x9d95('0x3f')]=qs['filters'](_[_0x9d95('0x40')](_0x52c906['query'],_0x17f50d[_0x9d95('0x36')]),_0x210c5c);if(_0x52c906[_0x9d95('0x38')][_0x9d95('0x41')]){_0x227812['where']=_[_0x9d95('0x42')](_0x227812['where'],{'$or':_[_0x9d95('0x2f')](_0x210c5c,function(_0x2a7556){if(_0x2a7556[_0x9d95('0x32')]!==_0x9d95('0x43')){var _0x32cc67={};_0x32cc67[_0x2a7556['name']]={'$like':'%'+_0x52c906[_0x9d95('0x38')][_0x9d95('0x41')]+'%'};return _0x32cc67;}})});}_0x227812=_[_0x9d95('0x42')]({},_0x227812,_0x52c906[_0x9d95('0x44')]);var _0x50a501={'where':_0x227812[_0x9d95('0x3f')]};return db['VtigerAccount'][_0x9d95('0x23')](_0x50a501)['then'](function(_0x48448b){_0x1e0553[_0x9d95('0x23')]=_0x48448b;if(_0x52c906[_0x9d95('0x38')]['includeAll']){_0x227812[_0x9d95('0x45')]=[{'all':!![]}];}return db['VtigerAccount'][_0x9d95('0x46')](_0x227812);})[_0x9d95('0x2a')](function(_0x322f26){_0x1e0553['rows']=_0x322f26;return _0x1e0553;})[_0x9d95('0x2a')](respondWithFilteredResult(_0x43e5dd,_0x227812))[_0x9d95('0x47')](handleError(_0x43e5dd,null));};exports[_0x9d95('0x48')]=function(_0x27aef1,_0x469944){var _0x26f569={'raw':![],'where':{'id':_0x27aef1[_0x9d95('0x49')]['id']}},_0x16df3f={};_0x16df3f['model']=_[_0x9d95('0x35')](db['VtigerAccount'][_0x9d95('0x30')]);_0x16df3f['query']=_['keys'](_0x27aef1[_0x9d95('0x38')]);_0x16df3f['filters']=_[_0x9d95('0x37')](_0x16df3f[_0x9d95('0x34')],_0x16df3f['query']);_0x26f569['attributes']=_[_0x9d95('0x37')](_0x16df3f[_0x9d95('0x34')],qs['fields'](_0x27aef1[_0x9d95('0x38')][_0x9d95('0x3a')]));_0x26f569[_0x9d95('0x39')]=_0x26f569[_0x9d95('0x39')][_0x9d95('0x3b')]?_0x26f569[_0x9d95('0x39')]:_0x16df3f[_0x9d95('0x34')];if(_0x27aef1[_0x9d95('0x38')]['includeAll']){_0x26f569[_0x9d95('0x45')]=[{'all':!![]}];}_0x26f569=_[_0x9d95('0x42')]({},_0x26f569,_0x27aef1[_0x9d95('0x44')]);return db['VtigerAccount']['find'](_0x26f569)[_0x9d95('0x2a')](handleEntityNotFound(_0x469944,null))['then'](respondWithResult(_0x469944,null))['catch'](handleError(_0x469944,null));};exports[_0x9d95('0x4a')]=function(_0x3645b9,_0x347a72){return db[_0x9d95('0x4b')][_0x9d95('0x4a')](_0x3645b9['body'],{})[_0x9d95('0x2a')](respondWithResult(_0x347a72,0xc9))['catch'](handleError(_0x347a72,null));};exports[_0x9d95('0x29')]=function(_0x38d740,_0x2bd4c2){if(_0x38d740[_0x9d95('0x4c')]['id']){delete _0x38d740[_0x9d95('0x4c')]['id'];}return db[_0x9d95('0x4b')][_0x9d95('0x4d')]({'where':{'id':_0x38d740['params']['id']}})['then'](handleEntityNotFound(_0x2bd4c2,null))['then'](saveUpdates(_0x38d740[_0x9d95('0x4c')],null))[_0x9d95('0x2a')](respondWithResult(_0x2bd4c2,null))[_0x9d95('0x47')](handleError(_0x2bd4c2,null));};exports[_0x9d95('0x4e')]=function(_0xf3c496,_0xfb221c){return db[_0x9d95('0x4b')][_0x9d95('0x4d')]({'where':{'id':_0xf3c496[_0x9d95('0x49')]['id']}})[_0x9d95('0x2a')](handleEntityNotFound(_0xfb221c,null))['then'](removeEntity(_0xfb221c,null))[_0x9d95('0x47')](handleError(_0xfb221c,null));};exports['getConfigurations']=function(_0x937d9f,_0x4a391c,_0x4cc9e4){var _0x21d7b4={};var _0x3ccf9e={};var _0x2d904a;var _0x15855e;return db[_0x9d95('0x4b')][_0x9d95('0x4f')]({'where':{'id':_0x937d9f[_0x9d95('0x49')]['id']}})[_0x9d95('0x2a')](handleEntityNotFound(_0x4a391c,null))['then'](function(_0x549b90){if(_0x549b90){_0x2d904a=_0x549b90;_0x3ccf9e['model']=_[_0x9d95('0x35')](db[_0x9d95('0x50')][_0x9d95('0x30')]);_0x3ccf9e[_0x9d95('0x38')]=_[_0x9d95('0x35')](_0x937d9f[_0x9d95('0x38')]);_0x3ccf9e[_0x9d95('0x36')]=_['intersection'](_0x3ccf9e[_0x9d95('0x34')],_0x3ccf9e[_0x9d95('0x38')]);_0x21d7b4[_0x9d95('0x39')]=_[_0x9d95('0x37')](_0x3ccf9e[_0x9d95('0x34')],qs[_0x9d95('0x3a')](_0x937d9f[_0x9d95('0x38')][_0x9d95('0x3a')]));_0x21d7b4['attributes']=_0x21d7b4['attributes']['length']?_0x21d7b4[_0x9d95('0x39')]:_0x3ccf9e[_0x9d95('0x34')];_0x21d7b4[_0x9d95('0x3d')]=qs[_0x9d95('0x3e')](_0x937d9f[_0x9d95('0x38')][_0x9d95('0x3e')]);_0x21d7b4[_0x9d95('0x3f')]=qs[_0x9d95('0x36')](_[_0x9d95('0x40')](_0x937d9f['query'],_0x3ccf9e[_0x9d95('0x36')]));if(_0x937d9f['query'][_0x9d95('0x41')]){_0x21d7b4[_0x9d95('0x3f')]=_[_0x9d95('0x42')](_0x21d7b4[_0x9d95('0x3f')],{'$or':_[_0x9d95('0x2f')](_0x21d7b4['attributes'],function(_0x236359){var _0x54ec6b={};_0x54ec6b[_0x236359]={'$like':'%'+_0x937d9f[_0x9d95('0x38')][_0x9d95('0x41')]+'%'};return _0x54ec6b;})});}_0x21d7b4=_[_0x9d95('0x42')]({},_0x21d7b4,_0x937d9f[_0x9d95('0x44')]);return _0x2d904a[_0x9d95('0x51')](_0x21d7b4);}})[_0x9d95('0x2a')](function(_0xd561a0){if(_0xd561a0){_0x15855e=_0xd561a0[_0x9d95('0x3b')];if(!_0x937d9f[_0x9d95('0x38')][_0x9d95('0x52')](_0x9d95('0x3c'))){_0x21d7b4[_0x9d95('0x22')]=qs[_0x9d95('0x22')](_0x937d9f[_0x9d95('0x38')][_0x9d95('0x22')]);_0x21d7b4[_0x9d95('0x20')]=qs[_0x9d95('0x20')](_0x937d9f[_0x9d95('0x38')][_0x9d95('0x20')]);}return _0x2d904a[_0x9d95('0x51')](_0x21d7b4);}})[_0x9d95('0x2a')](function(_0x51fc69){if(_0x51fc69){return _0x51fc69?{'count':_0x15855e,'rows':_0x51fc69}:null;}})['then'](respondWithResult(_0x4a391c,null))[_0x9d95('0x47')](handleError(_0x4a391c,null));};exports['addConfiguration']=function(_0x3b8e7b,_0x50c893,_0x4b2ca1){if(_0x3b8e7b[_0x9d95('0x4c')]['id']){delete _0x3b8e7b[_0x9d95('0x4c')]['id'];}return db[_0x9d95('0x4b')][_0x9d95('0x4f')]({'where':{'id':_0x3b8e7b['params']['id']}})['then'](handleEntityNotFound(_0x50c893,null))[_0x9d95('0x2a')](function(_0x3f81d2){if(_0x3f81d2){_0x3b8e7b['body'][_0x9d95('0x53')]=_0x3f81d2['id'];_0x3b8e7b[_0x9d95('0x4c')][_0x9d95('0x54')]=integrations[_0x9d95('0x55')](_0x3b8e7b[_0x9d95('0x4c')][_0x9d95('0x56')],_0x3b8e7b['body'][_0x9d95('0x32')]);_0x3b8e7b['body']['Descriptions']=integrations[_0x9d95('0x57')](_0x3b8e7b[_0x9d95('0x4c')][_0x9d95('0x56')],_0x3b8e7b[_0x9d95('0x4c')][_0x9d95('0x32')]);return db[_0x9d95('0x50')]['create'](_0x3b8e7b[_0x9d95('0x4c')],{'include':[{'model':db[_0x9d95('0x58')],'as':_0x9d95('0x54')},{'model':db[_0x9d95('0x58')],'as':_0x9d95('0x59')}]});}return null;})['then'](respondWithResult(_0x50c893,null))[_0x9d95('0x47')](handleError(_0x50c893,null));};var md5=require('md5');exports[_0x9d95('0x5a')]=function(_0x519d1e,_0x2525a0,_0x166ad9){var _0x5f2685=null;var _0x10c3ef=null;var _0x4b094a=null;var _0x2a84ef=null;var _0x30db3a='';return db[_0x9d95('0x4b')][_0x9d95('0x4f')]({'where':{'id':_0x519d1e[_0x9d95('0x49')]['id']},'attributes':['id','name',_0x9d95('0x5b'),_0x9d95('0x5c'),_0x9d95('0x5d'),'remoteUri','serverUrl','accessKey']})[_0x9d95('0x2a')](handleEntityNotFound(_0x2525a0,null))[_0x9d95('0x2a')](function(_0x4e41ea){if(_0x4e41ea){_0x5f2685=_0x4e41ea[_0x9d95('0x5b')];_0x10c3ef=_0x4e41ea['accessKey'];_0x4b094a=_0x4e41ea['moduleName'];_0x30db3a=_0x4e41ea['remoteUri'];var _0x5286cd=_0x30db3a[_0x9d95('0x5e')](-0x1);if(_0x5286cd==='/'){_0x30db3a=_0x30db3a['substring'](0x0,_0x30db3a[_0x9d95('0x5f')](_0x5286cd));}_0x2a84ef=util['format'](_0x9d95('0x60'),_0x30db3a);var _0xc6d496={'method':_0x9d95('0x61'),'uri':_0x2a84ef,'qs':{'operation':'getchallenge','username':_0x4e41ea['username']},'json':!![]};return rp(_0xc6d496);}})[_0x9d95('0x2a')](function(_0x11ad62){if(_0x11ad62['success']){var _0x4f598e={'method':_0x9d95('0x62'),'uri':_0x2a84ef,'form':{'operation':_0x9d95('0x63'),'username':_0x5f2685,'accessKey':md5(_0x11ad62['result']['token']+_0x10c3ef)},'json':!![]};return rp(_0x4f598e);}})['then'](function(_0x1c1bfc){if(_0x1c1bfc['success']){var _0x4f3b49={'method':_0x9d95('0x61'),'uri':_0x2a84ef,'qs':{'operation':_0x9d95('0x64'),'username':_0x5f2685,'sessionName':_0x1c1bfc[_0x9d95('0x65')]['sessionName'],'elementType':_0x4b094a},'json':!![]};return rp(_0x4f3b49);}})[_0x9d95('0x2a')](function(_0x4f7498){if(_0x4f7498[_0x9d95('0x66')]){var _0x157abe=[_0x9d95('0x67'),_0x9d95('0x68'),_0x9d95('0x69')];_[_0x9d95('0x6a')](_0x4f7498['result'][_0x9d95('0x3a')],function(_0x129395){return _0x157abe['includes'](_0x129395[_0x9d95('0x32')][_0x9d95('0x2d')]);});_[_0x9d95('0x6a')](_0x4f7498['result']['fields'],function(_0x4a640f){return _0x4a640f[_0x9d95('0x6b')]==='false';});return{'count':_0x4f7498['result'][_0x9d95('0x3a')][_0x9d95('0x3b')],'rows':_[_0x9d95('0x2f')](_0x4f7498['result'][_0x9d95('0x3a')],function(_0x64d653){return{'id':_0x64d653[_0x9d95('0x2d')],'name':_0x64d653[_0x9d95('0x6c')],'custom':_['startsWith'](_0x64d653[_0x9d95('0x2d')],_0x9d95('0x6d'))?!![]:![],'options':_0x64d653[_0x9d95('0x32')]['name']===_0x9d95('0x6e')&&_0x64d653['type'][_0x9d95('0x6f')][_0x9d95('0x3b')]>0x0?_['map'](_0x64d653[_0x9d95('0x32')]['picklistValues'],function(_0x2d078e){return{'name':_0x2d078e[_0x9d95('0x6c')],'value':_0x2d078e[_0x9d95('0x70')]};}):[]};})};}})[_0x9d95('0x2a')](respondWithResult(_0x2525a0,null))[_0x9d95('0x47')](function(_0x246d95){console[_0x9d95('0x71')](_0x9d95('0x72')+_0x246d95);var _0x4a7086=_0x519d1e[_0x9d95('0x38')][_0x9d95('0x73')]?0x1f4:_0x246d95[_0x9d95('0x74')]||0x1f4;logger[_0x9d95('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x9d95('0x5a'),_0x4a7086,JSON[_0x9d95('0x75')](_0x246d95));delete _0x246d95[_0x9d95('0x2d')];if(_0x4a7086===0x191){_0x4a7086=0x190;}_0x2525a0[_0x9d95('0x1e')](_0x4a7086)['send'](_0x519d1e[_0x9d95('0x38')][_0x9d95('0x73')]?{'message':_0x9d95('0x76'),'statusCode':_0x246d95[_0x9d95('0x74')]}:_0x246d95);});}; \ No newline at end of file +var _0x52a8=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','destroy','error','name','index','VtigerAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','count','includeAll','include','findAll','then','catch','show','params','merge','find','create','body','getConfigurations','findOne','VtigerConfiguration','sort','options','addConfiguration','AccountId','getSubjects','Descriptions','channel','VtigerField','md5','username','moduleName','remoteUri','accessKey','slice','substring','%s/webservice.php','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','false','startsWith','cf_','picklist','label','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','crypto','desk.js'];(function(_0x5c1295,_0x18c038){var _0x15eb39=function(_0x10914){while(--_0x10914){_0x5c1295['push'](_0x5c1295['shift']());}};_0x15eb39(++_0x18c038);}(_0x52a8,0x1b4));var _0x852a=function(_0x5dd59e,_0xdfe0fc){_0x5dd59e=_0x5dd59e-0x0;var _0x445542=_0x52a8[_0x5dd59e];return _0x445542;};'use strict';var emlformat=require(_0x852a('0x0'));var rimraf=require(_0x852a('0x1'));var zipdir=require(_0x852a('0x2'));var jsonpatch=require(_0x852a('0x3'));var rp=require(_0x852a('0x4'));var moment=require('moment');var BPromise=require(_0x852a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x852a('0x6'));var csv=require(_0x852a('0x7'));var ejs=require(_0x852a('0x8'));var fs=require('fs');var fs_extra=require(_0x852a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x852a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x852a('0xb'));var toCsv=require(_0x852a('0x7'));var querystring=require(_0x852a('0xc'));var Papa=require(_0x852a('0xd'));var Redis=require(_0x852a('0xe'));var authService=require(_0x852a('0xf'));var qs=require(_0x852a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x852a('0x11'));var logger=require('../../config/logger')(_0x852a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x852a('0x13'));var db=require(_0x852a('0x14'))['db'];var integrations=require(_0x852a('0x15'));function respondWithStatusCode(_0x240039,_0x1206f1){_0x1206f1=_0x1206f1||0xcc;return function(_0x3ce447){if(_0x3ce447){return _0x240039[_0x852a('0x16')](_0x1206f1);}return _0x240039[_0x852a('0x17')](_0x1206f1)[_0x852a('0x18')]();};}function respondWithResult(_0x21ea14,_0x69fad0){_0x69fad0=_0x69fad0||0xc8;return function(_0x2d275e){if(_0x2d275e){return _0x21ea14[_0x852a('0x17')](_0x69fad0)[_0x852a('0x19')](_0x2d275e);}};}function respondWithFilteredResult(_0x46a2f4,_0x316a40){return function(_0x2fdc4c){if(_0x2fdc4c){var _0x2f2de1=typeof _0x316a40[_0x852a('0x1a')]===_0x852a('0x1b')&&typeof _0x316a40['limit']===_0x852a('0x1b');var _0x1f337c=_0x2fdc4c['count'];var _0x588ba5=_0x2f2de1?0x0:_0x316a40[_0x852a('0x1a')];var _0x298a91=_0x2f2de1?_0x2fdc4c['count']:_0x316a40[_0x852a('0x1a')]+_0x316a40[_0x852a('0x1c')];var _0x2e567c;if(_0x298a91>=_0x1f337c){_0x298a91=_0x1f337c;_0x2e567c=0xc8;}else{_0x2e567c=0xce;}_0x46a2f4[_0x852a('0x17')](_0x2e567c);return _0x46a2f4['set']('Content-Range',_0x588ba5+'-'+_0x298a91+'/'+_0x1f337c)[_0x852a('0x19')](_0x2fdc4c);}return null;};}function patchUpdates(_0x1a5a89){return function(_0x57d71a){try{jsonpatch[_0x852a('0x1d')](_0x57d71a,_0x1a5a89,!![]);}catch(_0x4834ff){return BPromise[_0x852a('0x1e')](_0x4834ff);}return _0x57d71a[_0x852a('0x1f')]();};}function saveUpdates(_0x27c323,_0x100c48){return function(_0x1c4822){if(_0x1c4822){return _0x1c4822[_0x852a('0x20')](_0x27c323)['then'](function(_0x54aed5){return _0x54aed5;});}return null;};}function removeEntity(_0x17b358,_0x541251){return function(_0x772e61){if(_0x772e61){return _0x772e61[_0x852a('0x21')]()['then'](function(){_0x17b358[_0x852a('0x17')](0xcc)[_0x852a('0x18')]();});}};}function handleEntityNotFound(_0x421f77,_0x2eb5b7){return function(_0x70ec33){if(!_0x70ec33){_0x421f77['sendStatus'](0x194);}return _0x70ec33;};}function handleError(_0x33ce9a,_0x2c8179){_0x2c8179=_0x2c8179||0x1f4;return function(_0x51701){logger[_0x852a('0x22')](_0x51701['stack']);if(_0x51701[_0x852a('0x23')]){delete _0x51701[_0x852a('0x23')];}_0x33ce9a[_0x852a('0x17')](_0x2c8179)['send'](_0x51701);};}exports[_0x852a('0x24')]=function(_0x1fd84c,_0x1a4a2e){var _0x384af2={},_0x54aa83={},_0x3e1cad={'count':0x0,'rows':[]};var _0x500442=_['map'](db[_0x852a('0x25')][_0x852a('0x26')],function(_0x39e4d6){return{'name':_0x39e4d6[_0x852a('0x27')],'type':_0x39e4d6[_0x852a('0x28')]['key']};});_0x54aa83[_0x852a('0x29')]=_[_0x852a('0x2a')](_0x500442,_0x852a('0x23'));_0x54aa83[_0x852a('0x2b')]=_[_0x852a('0x2c')](_0x1fd84c['query']);_0x54aa83[_0x852a('0x2d')]=_[_0x852a('0x2e')](_0x54aa83['model'],_0x54aa83[_0x852a('0x2b')]);_0x384af2[_0x852a('0x2f')]=_['intersection'](_0x54aa83['model'],qs['fields'](_0x1fd84c['query'][_0x852a('0x30')]));_0x384af2['attributes']=_0x384af2['attributes'][_0x852a('0x31')]?_0x384af2['attributes']:_0x54aa83[_0x852a('0x29')];if(!_0x1fd84c[_0x852a('0x2b')][_0x852a('0x32')](_0x852a('0x33'))){_0x384af2[_0x852a('0x1c')]=qs[_0x852a('0x1c')](_0x1fd84c[_0x852a('0x2b')][_0x852a('0x1c')]);_0x384af2[_0x852a('0x1a')]=qs[_0x852a('0x1a')](_0x1fd84c[_0x852a('0x2b')][_0x852a('0x1a')]);}_0x384af2[_0x852a('0x34')]=qs['sort'](_0x1fd84c[_0x852a('0x2b')]['sort']);_0x384af2[_0x852a('0x35')]=qs[_0x852a('0x2d')](_[_0x852a('0x36')](_0x1fd84c[_0x852a('0x2b')],_0x54aa83[_0x852a('0x2d')]),_0x500442);if(_0x1fd84c[_0x852a('0x2b')][_0x852a('0x37')]){_0x384af2['where']=_['merge'](_0x384af2[_0x852a('0x35')],{'$or':_[_0x852a('0x2a')](_0x500442,function(_0x32455a){if(_0x32455a[_0x852a('0x28')]!==_0x852a('0x38')){var _0x8e9618={};_0x8e9618[_0x32455a[_0x852a('0x23')]]={'$like':'%'+_0x1fd84c[_0x852a('0x2b')][_0x852a('0x37')]+'%'};return _0x8e9618;}})});}_0x384af2=_['merge']({},_0x384af2,_0x1fd84c['options']);var _0x166566={'where':_0x384af2[_0x852a('0x35')]};return db[_0x852a('0x25')][_0x852a('0x39')](_0x166566)['then'](function(_0x4f3836){_0x3e1cad[_0x852a('0x39')]=_0x4f3836;if(_0x1fd84c['query'][_0x852a('0x3a')]){_0x384af2[_0x852a('0x3b')]=[{'all':!![]}];}return db[_0x852a('0x25')][_0x852a('0x3c')](_0x384af2);})[_0x852a('0x3d')](function(_0x2dcff9){_0x3e1cad['rows']=_0x2dcff9;return _0x3e1cad;})[_0x852a('0x3d')](respondWithFilteredResult(_0x1a4a2e,_0x384af2))[_0x852a('0x3e')](handleError(_0x1a4a2e,null));};exports[_0x852a('0x3f')]=function(_0x530e46,_0x32da5e){var _0x183d88={'raw':![],'where':{'id':_0x530e46[_0x852a('0x40')]['id']}},_0x2ef7c9={};_0x2ef7c9[_0x852a('0x29')]=_[_0x852a('0x2c')](db['VtigerAccount'][_0x852a('0x26')]);_0x2ef7c9[_0x852a('0x2b')]=_[_0x852a('0x2c')](_0x530e46['query']);_0x2ef7c9[_0x852a('0x2d')]=_[_0x852a('0x2e')](_0x2ef7c9[_0x852a('0x29')],_0x2ef7c9[_0x852a('0x2b')]);_0x183d88[_0x852a('0x2f')]=_[_0x852a('0x2e')](_0x2ef7c9[_0x852a('0x29')],qs[_0x852a('0x30')](_0x530e46[_0x852a('0x2b')][_0x852a('0x30')]));_0x183d88['attributes']=_0x183d88[_0x852a('0x2f')][_0x852a('0x31')]?_0x183d88[_0x852a('0x2f')]:_0x2ef7c9[_0x852a('0x29')];if(_0x530e46['query'][_0x852a('0x3a')]){_0x183d88[_0x852a('0x3b')]=[{'all':!![]}];}_0x183d88=_[_0x852a('0x41')]({},_0x183d88,_0x530e46['options']);return db[_0x852a('0x25')][_0x852a('0x42')](_0x183d88)[_0x852a('0x3d')](handleEntityNotFound(_0x32da5e,null))[_0x852a('0x3d')](respondWithResult(_0x32da5e,null))['catch'](handleError(_0x32da5e,null));};exports[_0x852a('0x43')]=function(_0x21a92b,_0x2b3c82){return db[_0x852a('0x25')][_0x852a('0x43')](_0x21a92b[_0x852a('0x44')],{})['then'](respondWithResult(_0x2b3c82,0xc9))[_0x852a('0x3e')](handleError(_0x2b3c82,null));};exports[_0x852a('0x20')]=function(_0x4f0365,_0x592c6e){if(_0x4f0365[_0x852a('0x44')]['id']){delete _0x4f0365['body']['id'];}return db[_0x852a('0x25')][_0x852a('0x42')]({'where':{'id':_0x4f0365['params']['id']}})[_0x852a('0x3d')](handleEntityNotFound(_0x592c6e,null))['then'](saveUpdates(_0x4f0365['body'],null))[_0x852a('0x3d')](respondWithResult(_0x592c6e,null))[_0x852a('0x3e')](handleError(_0x592c6e,null));};exports['destroy']=function(_0x249a2e,_0x41c001){return db[_0x852a('0x25')]['find']({'where':{'id':_0x249a2e[_0x852a('0x40')]['id']}})[_0x852a('0x3d')](handleEntityNotFound(_0x41c001,null))['then'](removeEntity(_0x41c001,null))['catch'](handleError(_0x41c001,null));};exports[_0x852a('0x45')]=function(_0x252be5,_0x2e9ebd,_0x15e02b){var _0x488c30={};var _0xc38708={};var _0x3bb629;var _0x4ddbcf;return db['VtigerAccount'][_0x852a('0x46')]({'where':{'id':_0x252be5[_0x852a('0x40')]['id']}})[_0x852a('0x3d')](handleEntityNotFound(_0x2e9ebd,null))['then'](function(_0x482163){if(_0x482163){_0x3bb629=_0x482163;_0xc38708[_0x852a('0x29')]=_['keys'](db[_0x852a('0x47')][_0x852a('0x26')]);_0xc38708[_0x852a('0x2b')]=_[_0x852a('0x2c')](_0x252be5[_0x852a('0x2b')]);_0xc38708['filters']=_[_0x852a('0x2e')](_0xc38708['model'],_0xc38708[_0x852a('0x2b')]);_0x488c30[_0x852a('0x2f')]=_['intersection'](_0xc38708['model'],qs['fields'](_0x252be5[_0x852a('0x2b')][_0x852a('0x30')]));_0x488c30[_0x852a('0x2f')]=_0x488c30[_0x852a('0x2f')][_0x852a('0x31')]?_0x488c30[_0x852a('0x2f')]:_0xc38708['model'];_0x488c30[_0x852a('0x34')]=qs[_0x852a('0x48')](_0x252be5['query']['sort']);_0x488c30[_0x852a('0x35')]=qs[_0x852a('0x2d')](_['pick'](_0x252be5[_0x852a('0x2b')],_0xc38708['filters']));if(_0x252be5[_0x852a('0x2b')][_0x852a('0x37')]){_0x488c30['where']=_[_0x852a('0x41')](_0x488c30['where'],{'$or':_['map'](_0x488c30[_0x852a('0x2f')],function(_0x5d847c){var _0x15a20c={};_0x15a20c[_0x5d847c]={'$like':'%'+_0x252be5[_0x852a('0x2b')][_0x852a('0x37')]+'%'};return _0x15a20c;})});}_0x488c30=_['merge']({},_0x488c30,_0x252be5[_0x852a('0x49')]);return _0x3bb629[_0x852a('0x45')](_0x488c30);}})['then'](function(_0x4edda2){if(_0x4edda2){_0x4ddbcf=_0x4edda2['length'];if(!_0x252be5['query']['hasOwnProperty'](_0x852a('0x33'))){_0x488c30[_0x852a('0x1c')]=qs[_0x852a('0x1c')](_0x252be5['query']['limit']);_0x488c30[_0x852a('0x1a')]=qs[_0x852a('0x1a')](_0x252be5[_0x852a('0x2b')][_0x852a('0x1a')]);}return _0x3bb629['getConfigurations'](_0x488c30);}})['then'](function(_0x232df3){if(_0x232df3){return _0x232df3?{'count':_0x4ddbcf,'rows':_0x232df3}:null;}})[_0x852a('0x3d')](respondWithResult(_0x2e9ebd,null))['catch'](handleError(_0x2e9ebd,null));};exports[_0x852a('0x4a')]=function(_0x110bc3,_0x59a970,_0x14b762){if(_0x110bc3['body']['id']){delete _0x110bc3['body']['id'];}return db['VtigerAccount'][_0x852a('0x46')]({'where':{'id':_0x110bc3['params']['id']}})[_0x852a('0x3d')](handleEntityNotFound(_0x59a970,null))[_0x852a('0x3d')](function(_0x2c918f){if(_0x2c918f){_0x110bc3[_0x852a('0x44')][_0x852a('0x4b')]=_0x2c918f['id'];_0x110bc3[_0x852a('0x44')]['Subjects']=integrations[_0x852a('0x4c')](_0x110bc3[_0x852a('0x44')]['channel'],_0x110bc3[_0x852a('0x44')][_0x852a('0x28')]);_0x110bc3[_0x852a('0x44')][_0x852a('0x4d')]=integrations['getDescriptions'](_0x110bc3[_0x852a('0x44')][_0x852a('0x4e')],_0x110bc3['body']['type']);return db[_0x852a('0x47')]['create'](_0x110bc3[_0x852a('0x44')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x852a('0x4f')],'as':_0x852a('0x4d')}]});}return null;})['then'](respondWithResult(_0x59a970,null))[_0x852a('0x3e')](handleError(_0x59a970,null));};var md5=require(_0x852a('0x50'));exports['getFields']=function(_0x57d86b,_0x33a557,_0x3582de){var _0x256111=null;var _0x439cab=null;var _0x29d60e=null;var _0x4a86b4=null;var _0x350d2c='';return db['VtigerAccount'][_0x852a('0x46')]({'where':{'id':_0x57d86b[_0x852a('0x40')]['id']},'attributes':['id',_0x852a('0x23'),_0x852a('0x51'),'description',_0x852a('0x52'),_0x852a('0x53'),'serverUrl',_0x852a('0x54')]})[_0x852a('0x3d')](handleEntityNotFound(_0x33a557,null))[_0x852a('0x3d')](function(_0x20815e){if(_0x20815e){_0x256111=_0x20815e[_0x852a('0x51')];_0x439cab=_0x20815e[_0x852a('0x54')];_0x29d60e=_0x20815e[_0x852a('0x52')];_0x350d2c=_0x20815e[_0x852a('0x53')];var _0x172238=_0x350d2c[_0x852a('0x55')](-0x1);if(_0x172238==='/'){_0x350d2c=_0x350d2c[_0x852a('0x56')](0x0,_0x350d2c['lastIndexOf'](_0x172238));}_0x4a86b4=util['format'](_0x852a('0x57'),_0x350d2c);var _0x4f680d={'method':'GET','uri':_0x4a86b4,'qs':{'operation':_0x852a('0x58'),'username':_0x20815e[_0x852a('0x51')]},'json':!![]};return rp(_0x4f680d);}})[_0x852a('0x3d')](function(_0x53b591){if(_0x53b591[_0x852a('0x59')]){var _0x2e6646={'method':_0x852a('0x5a'),'uri':_0x4a86b4,'form':{'operation':_0x852a('0x5b'),'username':_0x256111,'accessKey':md5(_0x53b591[_0x852a('0x5c')][_0x852a('0x5d')]+_0x439cab)},'json':!![]};return rp(_0x2e6646);}})[_0x852a('0x3d')](function(_0x1c4d07){if(_0x1c4d07[_0x852a('0x59')]){var _0x3a443d={'method':'GET','uri':_0x4a86b4,'qs':{'operation':_0x852a('0x5e'),'username':_0x256111,'sessionName':_0x1c4d07[_0x852a('0x5c')][_0x852a('0x5f')],'elementType':_0x29d60e},'json':!![]};return rp(_0x3a443d);}})[_0x852a('0x3d')](function(_0x3b08bb){if(_0x3b08bb['success']){var _0x1a5f55=[_0x852a('0x60'),_0x852a('0x61'),_0x852a('0x62')];_[_0x852a('0x63')](_0x3b08bb[_0x852a('0x5c')][_0x852a('0x30')],function(_0xad6000){return _0x1a5f55['includes'](_0xad6000[_0x852a('0x28')]['name']);});_[_0x852a('0x63')](_0x3b08bb[_0x852a('0x5c')][_0x852a('0x30')],function(_0x373d44){return _0x373d44['editable']===_0x852a('0x64');});return{'count':_0x3b08bb[_0x852a('0x5c')][_0x852a('0x30')][_0x852a('0x31')],'rows':_[_0x852a('0x2a')](_0x3b08bb['result'][_0x852a('0x30')],function(_0x55356a){return{'id':_0x55356a['name'],'name':_0x55356a['label'],'custom':_[_0x852a('0x65')](_0x55356a[_0x852a('0x23')],_0x852a('0x66'))?!![]:![],'options':_0x55356a[_0x852a('0x28')][_0x852a('0x23')]===_0x852a('0x67')&&_0x55356a[_0x852a('0x28')]['picklistValues']['length']>0x0?_[_0x852a('0x2a')](_0x55356a[_0x852a('0x28')]['picklistValues'],function(_0x159108){return{'name':_0x159108[_0x852a('0x68')],'value':_0x159108['value']};}):[]};})};}})[_0x852a('0x3d')](respondWithResult(_0x33a557,null))[_0x852a('0x3e')](function(_0x15404f){console['log'](_0x852a('0x69')+_0x15404f);var _0x501f33=_0x57d86b[_0x852a('0x2b')][_0x852a('0x6a')]?0x1f4:_0x15404f[_0x852a('0x6b')]||0x1f4;logger[_0x852a('0x22')](_0x852a('0x6c'),_0x852a('0x6d'),_0x501f33,JSON[_0x852a('0x6e')](_0x15404f));delete _0x15404f[_0x852a('0x23')];if(_0x501f33===0x191){_0x501f33=0x190;}_0x33a557[_0x852a('0x17')](_0x501f33)[_0x852a('0x6f')](_0x57d86b[_0x852a('0x2b')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x15404f[_0x852a('0x6b')]}:_0x15404f);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 407e60e..3b6288e 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 _0x7eba=['api','moment','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','../../config/logger'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x7eba,0x1b7));var _0xa7eb=function(_0x447bcb,_0xfc3ae6){_0x447bcb=_0x447bcb-0x0;var _0x3c4783=_0x7eba[_0x447bcb];return _0x3c4783;};'use strict';var _=require(_0xa7eb('0x0'));var util=require(_0xa7eb('0x1'));var logger=require(_0xa7eb('0x2'))(_0xa7eb('0x3'));var moment=require(_0xa7eb('0x4'));var BPromise=require('bluebird');var rp=require(_0xa7eb('0x5'));var fs=require('fs');var path=require(_0xa7eb('0x6'));var rimraf=require('rimraf');var config=require(_0xa7eb('0x7'));var attributes=require(_0xa7eb('0x8'));var integrations=require(_0xa7eb('0x9'));module[_0xa7eb('0xa')]=function(_0x35aa02,_0x2eac0d){return _0x35aa02[_0xa7eb('0xb')](_0xa7eb('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a55=['moment','bluebird','path','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger'];(function(_0x5ccc82,_0x1477a7){var _0x301264=function(_0x15bc01){while(--_0x15bc01){_0x5ccc82['push'](_0x5ccc82['shift']());}};_0x301264(++_0x1477a7);}(_0x9a55,0x82));var _0x59a5=function(_0x5f50cf,_0x49412a){_0x5f50cf=_0x5f50cf-0x0;var _0x2f1cb6=_0x9a55[_0x5f50cf];return _0x2f1cb6;};'use strict';var _=require(_0x59a5('0x0'));var util=require('util');var logger=require(_0x59a5('0x1'))('api');var moment=require(_0x59a5('0x2'));var BPromise=require(_0x59a5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59a5('0x4'));var rimraf=require('rimraf');var config=require(_0x59a5('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x59a5('0x6'));module[_0x59a5('0x7')]=function(_0x11a9bf,_0x291a44){return _0x11a9bf[_0x59a5('0x8')](_0x59a5('0x9'),attributes,{'tableName':_0x59a5('0xa'),'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 6bab18d..7af0b78 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 _0xb688=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','GetVtigerAccount','stringify','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x2e68db,_0x275d04){var _0x12df4c=function(_0x1b6701){while(--_0x1b6701){_0x2e68db['push'](_0x2e68db['shift']());}};_0x12df4c(++_0x275d04);}(_0xb688,0xcf));var _0x8b68=function(_0x84ef9,_0x3e8e22){_0x84ef9=_0x84ef9-0x0;var _0x1431b8=_0xb688[_0x84ef9];return _0x1431b8;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['GetVtigerAccount']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')]({'raw':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1a')]||null:null,'attributes':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'limit':_0xd17693['options']?_0xd17693['options'][_0x8b68('0x1c')]||null:null,'include':_0xd17693['options']?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x173524){return{'model':db[_0x173524['model']],'as':_0x173524['as'],'attributes':_0x173524[_0x8b68('0x1b')],'include':_0x173524[_0x8b68('0x1d')]?_['map'](_0x173524[_0x8b68('0x1d')],function(_0x3cf8d2){return{'model':db[_0x3cf8d2[_0x8b68('0x1f')]],'as':_0x3cf8d2['as'],'attributes':_0x3cf8d2['attributes'],'include':_0x3cf8d2['include']?_['map'](_0x3cf8d2[_0x8b68('0x1d')],function(_0x448e43){return{'model':db[_0x448e43[_0x8b68('0x1f')]],'as':_0x448e43['as'],'attributes':_0x448e43['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x53aaa2){logger['info'](_0x8b68('0x20'),_0xd17693);logger['debug'](_0x8b68('0x20'),_0xd17693,JSON[_0x8b68('0x21')](_0x53aaa2));_0x4a68c7(_0x53aaa2);})['catch'](function(_0x494ce4){logger[_0x8b68('0x12')](_0x8b68('0x20'),_0x494ce4[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x494ce4[_0x8b68('0x14')]));});});};exports[_0x8b68('0x22')]=function(_0x460c37){var _0x5b7ed1=this;return new Promise(function(_0x3b6d1b,_0x50a1e9){return db[_0x8b68('0x17')][_0x8b68('0x23')]({'raw':_0x460c37['options']?_0x460c37[_0x8b68('0x19')][_0x8b68('0x24')]===undefined?!![]:![]:!![],'where':_0x460c37[_0x8b68('0x19')]?_0x460c37['options']['where']||null:null,'attributes':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'include':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x7fe301){return{'model':db[_0x7fe301[_0x8b68('0x1f')]],'as':_0x7fe301['as'],'attributes':_0x7fe301[_0x8b68('0x1b')],'include':_0x7fe301[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x7fe301[_0x8b68('0x1d')],function(_0x151277){return{'model':db[_0x151277[_0x8b68('0x1f')]],'as':_0x151277['as'],'attributes':_0x151277[_0x8b68('0x1b')],'include':_0x151277[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x151277[_0x8b68('0x1d')],function(_0x43b971){return{'model':db[_0x43b971['model']],'as':_0x43b971['as'],'attributes':_0x43b971['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x262d6c){logger[_0x8b68('0xd')](_0x8b68('0x22'),_0x460c37);logger[_0x8b68('0x10')](_0x8b68('0x22'),_0x460c37,JSON[_0x8b68('0x21')](_0x262d6c));_0x3b6d1b(_0x262d6c);})[_0x8b68('0x16')](function(_0x5b628e){logger[_0x8b68('0x12')](_0x8b68('0x22'),_0x5b628e[_0x8b68('0x14')],_0x460c37);_0x50a1e9(_0x5b7ed1[_0x8b68('0x12')](0x1f4,_0x5b628e[_0x8b68('0x14')]));});});}; \ No newline at end of file +var _0x97c1=['error','message','result','catch','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetVtigerAccount','debug','find','where','ShowVtigerAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xc029be,_0xf8d59a){var _0x115cae=function(_0x165ae6){while(--_0x165ae6){_0xc029be['push'](_0xc029be['shift']());}};_0x115cae(++_0xf8d59a);}(_0x97c1,0xdf));var _0x197c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x97c1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['GetVtigerAccount']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')]({'raw':_0x372311[_0x197c('0x15')]?_0x372311['options'][_0x197c('0x16')]===undefined?!![]:![]:!![],'where':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')]['where']||null:null,'attributes':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x17')]||null:null,'limit':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x18')]||null:null,'include':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x19')]?_[_0x197c('0x1a')](_0x372311[_0x197c('0x15')][_0x197c('0x19')],function(_0x174942){return{'model':db[_0x174942[_0x197c('0x1b')]],'as':_0x174942['as'],'attributes':_0x174942[_0x197c('0x17')],'include':_0x174942[_0x197c('0x19')]?_['map'](_0x174942[_0x197c('0x19')],function(_0x2911dd){return{'model':db[_0x2911dd[_0x197c('0x1b')]],'as':_0x2911dd['as'],'attributes':_0x2911dd['attributes'],'include':_0x2911dd[_0x197c('0x19')]?_[_0x197c('0x1a')](_0x2911dd['include'],function(_0x5e7bc9){return{'model':db[_0x5e7bc9[_0x197c('0x1b')]],'as':_0x5e7bc9['as'],'attributes':_0x5e7bc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x197c('0x1c')](function(_0x14b0aa){logger[_0x197c('0xa')](_0x197c('0x1d'),_0x372311);logger[_0x197c('0x1e')](_0x197c('0x1d'),_0x372311,JSON[_0x197c('0xe')](_0x14b0aa));_0x50ac52(_0x14b0aa);})[_0x197c('0x12')](function(_0x4422d1){logger['error']('GetVtigerAccount',_0x4422d1['message'],_0x372311);_0x1725d9(_0x47aaa9['error'](0x1f4,_0x4422d1[_0x197c('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x252cde){var _0x35dbf3=this;return new Promise(function(_0x58bc60,_0x422ac6){return db['VtigerAccount'][_0x197c('0x1f')]({'raw':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')][_0x197c('0x16')]===undefined?!![]:![]:!![],'where':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')][_0x197c('0x20')]||null:null,'attributes':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')]['attributes']||null:null,'include':_0x252cde['options']?_0x252cde[_0x197c('0x15')][_0x197c('0x19')]?_[_0x197c('0x1a')](_0x252cde[_0x197c('0x15')][_0x197c('0x19')],function(_0x1cb7e8){return{'model':db[_0x1cb7e8[_0x197c('0x1b')]],'as':_0x1cb7e8['as'],'attributes':_0x1cb7e8['attributes'],'include':_0x1cb7e8['include']?_[_0x197c('0x1a')](_0x1cb7e8[_0x197c('0x19')],function(_0x4d085b){return{'model':db[_0x4d085b['model']],'as':_0x4d085b['as'],'attributes':_0x4d085b[_0x197c('0x17')],'include':_0x4d085b[_0x197c('0x19')]?_[_0x197c('0x1a')](_0x4d085b[_0x197c('0x19')],function(_0x45095c){return{'model':db[_0x45095c[_0x197c('0x1b')]],'as':_0x45095c['as'],'attributes':_0x45095c[_0x197c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x197c('0x1c')](function(_0x44ce68){logger['info'](_0x197c('0x21'),_0x252cde);logger[_0x197c('0x1e')](_0x197c('0x21'),_0x252cde,JSON[_0x197c('0xe')](_0x44ce68));_0x58bc60(_0x44ce68);})[_0x197c('0x12')](function(_0x151e2f){logger['error'](_0x197c('0x21'),_0x151e2f[_0x197c('0x10')],_0x252cde);_0x422ac6(_0x35dbf3[_0x197c('0xf')](0x1f4,_0x151e2f['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index bd25aaa..78b1475 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 _0x4a22=['../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x53cd3f,_0x5dcce5){var _0x4c7d20=function(_0x330cdd){while(--_0x330cdd){_0x53cd3f['push'](_0x53cd3f['shift']());}};_0x4c7d20(++_0x5dcce5);}(_0x4a22,0xec));var _0x24a2=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x4a22[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x24a2('0x0'));var util=require('util');var path=require(_0x24a2('0x1'));var timeout=require(_0x24a2('0x2'));var express=require(_0x24a2('0x3'));var router=express[_0x24a2('0x4')]();var fs_extra=require(_0x24a2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x24a2('0x6'));var config=require(_0x24a2('0x7'));var controller=require(_0x24a2('0x8'));router[_0x24a2('0x9')]('/',auth[_0x24a2('0xa')](),controller['index']);router[_0x24a2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x24a2('0xb')]);router[_0x24a2('0x9')](_0x24a2('0xc'),auth[_0x24a2('0xa')](),controller[_0x24a2('0xd')]);router[_0x24a2('0x9')](_0x24a2('0xe'),auth[_0x24a2('0xa')](),controller[_0x24a2('0xf')]);router[_0x24a2('0x9')]('/:id/descriptions',auth[_0x24a2('0xa')](),controller[_0x24a2('0x10')]);router[_0x24a2('0x11')]('/',auth[_0x24a2('0xa')](),controller['create']);router[_0x24a2('0x12')](_0x24a2('0x13'),auth[_0x24a2('0xa')](),controller['update']);router[_0x24a2('0x14')](_0x24a2('0x13'),auth[_0x24a2('0xa')](),controller[_0x24a2('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1309=['getDescriptions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x32e0eb,_0x44e1fb){var _0x1b79ab=function(_0x22a23e){while(--_0x22a23e){_0x32e0eb['push'](_0x32e0eb['shift']());}};_0x1b79ab(++_0x44e1fb);}(_0x1309,0xd5));var _0x9130=function(_0x7f8ed2,_0x4760d2){_0x7f8ed2=_0x7f8ed2-0x0;var _0x478213=_0x1309[_0x7f8ed2];return _0x478213;};'use strict';var multer=require(_0x9130('0x0'));var util=require(_0x9130('0x1'));var path=require(_0x9130('0x2'));var timeout=require(_0x9130('0x3'));var express=require(_0x9130('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9130('0x5'));var interaction=require(_0x9130('0x6'));var config=require('../../config/environment');var controller=require(_0x9130('0x7'));router[_0x9130('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9130('0x8')](_0x9130('0x9'),auth[_0x9130('0xa')](),controller[_0x9130('0xb')]);router[_0x9130('0x8')](_0x9130('0xc'),auth[_0x9130('0xa')](),controller[_0x9130('0xd')]);router[_0x9130('0x8')](_0x9130('0xe'),auth[_0x9130('0xa')](),controller[_0x9130('0xf')]);router[_0x9130('0x8')](_0x9130('0x10'),auth[_0x9130('0xa')](),controller[_0x9130('0x11')]);router['post']('/',auth[_0x9130('0xa')](),controller['create']);router[_0x9130('0x12')](_0x9130('0x9'),auth[_0x9130('0xa')](),controller[_0x9130('0x13')]);router[_0x9130('0x14')](_0x9130('0x9'),auth['isAuthenticated'](),controller[_0x9130('0x15')]);module[_0x9130('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 ae9033e..a5dd30a 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 _0x7f54=['STRING','sequelize','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x7f54,0x1c6));var _0x47f5=function(_0x599b95,_0x309373){_0x599b95=_0x599b95-0x0;var _0x36f888=_0x7f54[_0x599b95];return _0x36f888;};'use strict';var Sequelize=require(_0x47f5('0x0'));module[_0x47f5('0x1')]={'name':{'type':Sequelize[_0x47f5('0x2')]},'description':{'type':Sequelize[_0x47f5('0x2')]}}; \ No newline at end of file +var _0x7494=['exports','STRING','sequelize'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x7494,0x197));var _0x4749=function(_0x3fe488,_0x1b1763){_0x3fe488=_0x3fe488-0x0;var _0xff6eeb=_0x7494[_0x3fe488];return _0xff6eeb;};'use strict';var Sequelize=require(_0x4749('0x0'));module[_0x4749('0x1')]={'name':{'type':Sequelize[_0x4749('0x2')]},'description':{'type':Sequelize[_0x4749('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index ca8bfc3..8558a08 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 _0x9d54=['limit','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','stack','name','index','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','merge','VtigerConfiguration','include','rows','show','params','rawAttributes','options','find','create','body','catch','findOne','VtigerField','getFields','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','offset','undefined','count'];(function(_0x99e1a7,_0x1b344f){var _0x567ef6=function(_0x140f62){while(--_0x140f62){_0x99e1a7['push'](_0x99e1a7['shift']());}};_0x567ef6(++_0x1b344f);}(_0x9d54,0x155));var _0x49d5=function(_0x1eb854,_0x412dc5){_0x1eb854=_0x1eb854-0x0;var _0x4fabc6=_0x9d54[_0x1eb854];return _0x4fabc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x49d5('0x0'));var zipdir=require(_0x49d5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x49d5('0x2'));var BPromise=require(_0x49d5('0x3'));var Mustache=require(_0x49d5('0x4'));var util=require(_0x49d5('0x5'));var path=require(_0x49d5('0x6'));var sox=require(_0x49d5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49d5('0x8'));var _=require(_0x49d5('0x9'));var squel=require('squel');var crypto=require(_0x49d5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x49d5('0xb'));var toCsv=require(_0x49d5('0xc'));var querystring=require(_0x49d5('0xd'));var Papa=require('papaparse');var Redis=require(_0x49d5('0xe'));var authService=require(_0x49d5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x49d5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x49d5('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49d5('0x12'));var db=require(_0x49d5('0x13'))['db'];function respondWithStatusCode(_0x1c96fd,_0x3ffc28){_0x3ffc28=_0x3ffc28||0xcc;return function(_0x418552){if(_0x418552){return _0x1c96fd['sendStatus'](_0x3ffc28);}return _0x1c96fd[_0x49d5('0x14')](_0x3ffc28)['end']();};}function respondWithResult(_0x48f802,_0x5f09c0){_0x5f09c0=_0x5f09c0||0xc8;return function(_0x597110){if(_0x597110){return _0x48f802[_0x49d5('0x14')](_0x5f09c0)['json'](_0x597110);}};}function respondWithFilteredResult(_0x4760c4,_0xdf6b41){return function(_0x15ca32){if(_0x15ca32){var _0x8e3f80=typeof _0xdf6b41[_0x49d5('0x15')]===_0x49d5('0x16')&&typeof _0xdf6b41['limit']===_0x49d5('0x16');var _0x21bf37=_0x15ca32[_0x49d5('0x17')];var _0x2abf09=_0x8e3f80?0x0:_0xdf6b41[_0x49d5('0x15')];var _0x48aed1=_0x8e3f80?_0x15ca32[_0x49d5('0x17')]:_0xdf6b41[_0x49d5('0x15')]+_0xdf6b41[_0x49d5('0x18')];var _0x5a6f1d;if(_0x48aed1>=_0x21bf37){_0x48aed1=_0x21bf37;_0x5a6f1d=0xc8;}else{_0x5a6f1d=0xce;}_0x4760c4[_0x49d5('0x14')](_0x5a6f1d);return _0x4760c4['set'](_0x49d5('0x19'),_0x2abf09+'-'+_0x48aed1+'/'+_0x21bf37)[_0x49d5('0x1a')](_0x15ca32);}return null;};}function patchUpdates(_0x47f5c8){return function(_0x340936){try{jsonpatch['apply'](_0x340936,_0x47f5c8,!![]);}catch(_0x420631){return BPromise[_0x49d5('0x1b')](_0x420631);}return _0x340936[_0x49d5('0x1c')]();};}function saveUpdates(_0x4654d5,_0x35de70){return function(_0x204372){if(_0x204372){return _0x204372[_0x49d5('0x1d')](_0x4654d5)[_0x49d5('0x1e')](function(_0x44c0d8){return _0x44c0d8;});}return null;};}function removeEntity(_0x4f0e35,_0x419c2d){return function(_0x5a5b4e){if(_0x5a5b4e){return _0x5a5b4e[_0x49d5('0x1f')]()[_0x49d5('0x1e')](function(){_0x4f0e35[_0x49d5('0x14')](0xcc)[_0x49d5('0x20')]();});}};}function handleEntityNotFound(_0x5afadd,_0x372ef3){return function(_0x437446){if(!_0x437446){_0x5afadd[_0x49d5('0x21')](0x194);}return _0x437446;};}function handleError(_0x15e71d,_0x592ff5){_0x592ff5=_0x592ff5||0x1f4;return function(_0x16ce96){logger['error'](_0x16ce96[_0x49d5('0x22')]);if(_0x16ce96[_0x49d5('0x23')]){delete _0x16ce96[_0x49d5('0x23')];}_0x15e71d[_0x49d5('0x14')](_0x592ff5)['send'](_0x16ce96);};}exports[_0x49d5('0x24')]=function(_0x2b64fc,_0xc59c4b){var _0x5a70ac={},_0x2d5e4f={},_0x2f1399={'count':0x0,'rows':[]};var _0x3390b1=_['map'](db['VtigerConfiguration']['rawAttributes'],function(_0x1aaf7c){return{'name':_0x1aaf7c[_0x49d5('0x25')],'type':_0x1aaf7c['type']['key']};});_0x2d5e4f[_0x49d5('0x26')]=_[_0x49d5('0x27')](_0x3390b1,_0x49d5('0x23'));_0x2d5e4f[_0x49d5('0x28')]=_[_0x49d5('0x29')](_0x2b64fc[_0x49d5('0x28')]);_0x2d5e4f[_0x49d5('0x2a')]=_[_0x49d5('0x2b')](_0x2d5e4f[_0x49d5('0x26')],_0x2d5e4f['query']);_0x5a70ac[_0x49d5('0x2c')]=_[_0x49d5('0x2b')](_0x2d5e4f[_0x49d5('0x26')],qs[_0x49d5('0x2d')](_0x2b64fc[_0x49d5('0x28')][_0x49d5('0x2d')]));_0x5a70ac[_0x49d5('0x2c')]=_0x5a70ac[_0x49d5('0x2c')][_0x49d5('0x2e')]?_0x5a70ac[_0x49d5('0x2c')]:_0x2d5e4f[_0x49d5('0x26')];if(!_0x2b64fc[_0x49d5('0x28')][_0x49d5('0x2f')]('nolimit')){_0x5a70ac['limit']=qs['limit'](_0x2b64fc[_0x49d5('0x28')][_0x49d5('0x18')]);_0x5a70ac['offset']=qs[_0x49d5('0x15')](_0x2b64fc['query']['offset']);}_0x5a70ac[_0x49d5('0x30')]=qs[_0x49d5('0x31')](_0x2b64fc[_0x49d5('0x28')][_0x49d5('0x31')]);_0x5a70ac['where']=qs[_0x49d5('0x2a')](_[_0x49d5('0x32')](_0x2b64fc[_0x49d5('0x28')],_0x2d5e4f[_0x49d5('0x2a')]),_0x3390b1);if(_0x2b64fc[_0x49d5('0x28')][_0x49d5('0x33')]){_0x5a70ac[_0x49d5('0x34')]=_['merge'](_0x5a70ac[_0x49d5('0x34')],{'$or':_[_0x49d5('0x27')](_0x3390b1,function(_0x2ab775){if(_0x2ab775[_0x49d5('0x35')]!==_0x49d5('0x36')){var _0x1711d4={};_0x1711d4[_0x2ab775[_0x49d5('0x23')]]={'$like':'%'+_0x2b64fc['query'][_0x49d5('0x33')]+'%'};return _0x1711d4;}})});}_0x5a70ac=_[_0x49d5('0x37')]({},_0x5a70ac,_0x2b64fc['options']);var _0x31ca3b={'where':_0x5a70ac[_0x49d5('0x34')]};return db[_0x49d5('0x38')][_0x49d5('0x17')](_0x31ca3b)[_0x49d5('0x1e')](function(_0x1d590d){_0x2f1399[_0x49d5('0x17')]=_0x1d590d;if(_0x2b64fc[_0x49d5('0x28')]['includeAll']){_0x5a70ac[_0x49d5('0x39')]=[{'all':!![]}];}return db[_0x49d5('0x38')]['findAll'](_0x5a70ac);})['then'](function(_0x4a51b0){_0x2f1399[_0x49d5('0x3a')]=_0x4a51b0;return _0x2f1399;})[_0x49d5('0x1e')](respondWithFilteredResult(_0xc59c4b,_0x5a70ac))['catch'](handleError(_0xc59c4b,null));};exports[_0x49d5('0x3b')]=function(_0x2278c2,_0x174416){var _0x2641dd={'raw':![],'where':{'id':_0x2278c2[_0x49d5('0x3c')]['id']}},_0x39c79d={};_0x39c79d['model']=_[_0x49d5('0x29')](db[_0x49d5('0x38')][_0x49d5('0x3d')]);_0x39c79d['query']=_[_0x49d5('0x29')](_0x2278c2[_0x49d5('0x28')]);_0x39c79d[_0x49d5('0x2a')]=_[_0x49d5('0x2b')](_0x39c79d[_0x49d5('0x26')],_0x39c79d['query']);_0x2641dd[_0x49d5('0x2c')]=_['intersection'](_0x39c79d[_0x49d5('0x26')],qs[_0x49d5('0x2d')](_0x2278c2[_0x49d5('0x28')]['fields']));_0x2641dd[_0x49d5('0x2c')]=_0x2641dd[_0x49d5('0x2c')]['length']?_0x2641dd[_0x49d5('0x2c')]:_0x39c79d[_0x49d5('0x26')];if(_0x2278c2[_0x49d5('0x28')]['includeAll']){_0x2641dd['include']=[{'all':!![]}];}_0x2641dd=_[_0x49d5('0x37')]({},_0x2641dd,_0x2278c2[_0x49d5('0x3e')]);return db[_0x49d5('0x38')][_0x49d5('0x3f')](_0x2641dd)[_0x49d5('0x1e')](handleEntityNotFound(_0x174416,null))['then'](respondWithResult(_0x174416,null))['catch'](handleError(_0x174416,null));};exports[_0x49d5('0x40')]=function(_0x52eb91,_0x1b00a9){return db[_0x49d5('0x38')][_0x49d5('0x40')](_0x52eb91['body'],{})['then'](respondWithResult(_0x1b00a9,0xc9))['catch'](handleError(_0x1b00a9,null));};exports[_0x49d5('0x1d')]=function(_0x5e6101,_0x4016c2){if(_0x5e6101[_0x49d5('0x41')]['id']){delete _0x5e6101[_0x49d5('0x41')]['id'];}return db[_0x49d5('0x38')]['find']({'where':{'id':_0x5e6101['params']['id']}})[_0x49d5('0x1e')](handleEntityNotFound(_0x4016c2,null))[_0x49d5('0x1e')](saveUpdates(_0x5e6101[_0x49d5('0x41')],null))[_0x49d5('0x1e')](respondWithResult(_0x4016c2,null))[_0x49d5('0x42')](handleError(_0x4016c2,null));};exports['destroy']=function(_0x172513,_0x2a1115){return db[_0x49d5('0x38')][_0x49d5('0x3f')]({'where':{'id':_0x172513['params']['id']}})[_0x49d5('0x1e')](handleEntityNotFound(_0x2a1115,null))[_0x49d5('0x1e')](removeEntity(_0x2a1115,null))[_0x49d5('0x42')](handleError(_0x2a1115,null));};exports['getFields']=function(_0x82e48b,_0x200359,_0x5dc784){var _0x1c4ed9={};var _0x48fbcd={};var _0x1c6ddb;var _0x727c6f;return db[_0x49d5('0x38')][_0x49d5('0x43')]({'where':{'id':_0x82e48b[_0x49d5('0x3c')]['id']}})[_0x49d5('0x1e')](handleEntityNotFound(_0x200359,null))[_0x49d5('0x1e')](function(_0x339a94){if(_0x339a94){_0x1c6ddb=_0x339a94;_0x48fbcd['model']=_[_0x49d5('0x29')](db[_0x49d5('0x44')][_0x49d5('0x3d')]);_0x48fbcd['query']=_[_0x49d5('0x29')](_0x82e48b[_0x49d5('0x28')]);_0x48fbcd['filters']=_[_0x49d5('0x2b')](_0x48fbcd[_0x49d5('0x26')],_0x48fbcd[_0x49d5('0x28')]);_0x1c4ed9['attributes']=_[_0x49d5('0x2b')](_0x48fbcd[_0x49d5('0x26')],qs[_0x49d5('0x2d')](_0x82e48b[_0x49d5('0x28')][_0x49d5('0x2d')]));_0x1c4ed9[_0x49d5('0x2c')]=_0x1c4ed9['attributes']['length']?_0x1c4ed9[_0x49d5('0x2c')]:_0x48fbcd[_0x49d5('0x26')];_0x1c4ed9['order']=qs['sort'](_0x82e48b['query']['sort']);_0x1c4ed9[_0x49d5('0x34')]=qs[_0x49d5('0x2a')](_[_0x49d5('0x32')](_0x82e48b[_0x49d5('0x28')],_0x48fbcd['filters']));if(_0x82e48b[_0x49d5('0x28')][_0x49d5('0x33')]){_0x1c4ed9[_0x49d5('0x34')]=_['merge'](_0x1c4ed9[_0x49d5('0x34')],{'$or':_[_0x49d5('0x27')](_0x1c4ed9[_0x49d5('0x2c')],function(_0x178507){var _0x5e73ac={};_0x5e73ac[_0x178507]={'$like':'%'+_0x82e48b[_0x49d5('0x28')][_0x49d5('0x33')]+'%'};return _0x5e73ac;})});}_0x1c4ed9=_['merge']({},_0x1c4ed9,_0x82e48b['options']);return _0x1c6ddb[_0x49d5('0x45')](_0x1c4ed9);}})[_0x49d5('0x1e')](function(_0xf35700){if(_0xf35700){_0x727c6f=_0xf35700['length'];if(!_0x82e48b[_0x49d5('0x28')][_0x49d5('0x2f')](_0x49d5('0x46'))){_0x1c4ed9[_0x49d5('0x18')]=qs['limit'](_0x82e48b[_0x49d5('0x28')][_0x49d5('0x18')]);_0x1c4ed9[_0x49d5('0x15')]=qs[_0x49d5('0x15')](_0x82e48b[_0x49d5('0x28')]['offset']);}return _0x1c6ddb['getFields'](_0x1c4ed9);}})[_0x49d5('0x1e')](function(_0xc39aad){if(_0xc39aad){return _0xc39aad?{'count':_0x727c6f,'rows':_0xc39aad}:null;}})[_0x49d5('0x1e')](respondWithResult(_0x200359,null))[_0x49d5('0x42')](handleError(_0x200359,null));};exports[_0x49d5('0x47')]=function(_0x51cef8,_0x17b625,_0x59de03){var _0x481b45={};var _0x4c22bc={};var _0x544003;var _0x5ef82f;return db[_0x49d5('0x38')][_0x49d5('0x43')]({'where':{'id':_0x51cef8[_0x49d5('0x3c')]['id']}})[_0x49d5('0x1e')](handleEntityNotFound(_0x17b625,null))[_0x49d5('0x1e')](function(_0x5af1d0){if(_0x5af1d0){_0x544003=_0x5af1d0;_0x4c22bc[_0x49d5('0x26')]=_[_0x49d5('0x29')](db['VtigerField']['rawAttributes']);_0x4c22bc['query']=_[_0x49d5('0x29')](_0x51cef8[_0x49d5('0x28')]);_0x4c22bc['filters']=_[_0x49d5('0x2b')](_0x4c22bc[_0x49d5('0x26')],_0x4c22bc['query']);_0x481b45[_0x49d5('0x2c')]=_[_0x49d5('0x2b')](_0x4c22bc[_0x49d5('0x26')],qs[_0x49d5('0x2d')](_0x51cef8[_0x49d5('0x28')][_0x49d5('0x2d')]));_0x481b45['attributes']=_0x481b45[_0x49d5('0x2c')][_0x49d5('0x2e')]?_0x481b45['attributes']:_0x4c22bc[_0x49d5('0x26')];_0x481b45[_0x49d5('0x30')]=qs[_0x49d5('0x31')](_0x51cef8[_0x49d5('0x28')][_0x49d5('0x31')]);_0x481b45[_0x49d5('0x34')]=qs[_0x49d5('0x2a')](_[_0x49d5('0x32')](_0x51cef8[_0x49d5('0x28')],_0x4c22bc[_0x49d5('0x2a')]));if(_0x51cef8['query'][_0x49d5('0x33')]){_0x481b45[_0x49d5('0x34')]=_[_0x49d5('0x37')](_0x481b45[_0x49d5('0x34')],{'$or':_[_0x49d5('0x27')](_0x481b45[_0x49d5('0x2c')],function(_0x5639e6){var _0x3444c4={};_0x3444c4[_0x5639e6]={'$like':'%'+_0x51cef8[_0x49d5('0x28')][_0x49d5('0x33')]+'%'};return _0x3444c4;})});}_0x481b45=_[_0x49d5('0x37')]({},_0x481b45,_0x51cef8[_0x49d5('0x3e')]);return _0x544003[_0x49d5('0x47')](_0x481b45);}})[_0x49d5('0x1e')](function(_0x331f7e){if(_0x331f7e){_0x5ef82f=_0x331f7e['length'];if(!_0x51cef8[_0x49d5('0x28')][_0x49d5('0x2f')]('nolimit')){_0x481b45['limit']=qs[_0x49d5('0x18')](_0x51cef8[_0x49d5('0x28')][_0x49d5('0x18')]);_0x481b45[_0x49d5('0x15')]=qs[_0x49d5('0x15')](_0x51cef8[_0x49d5('0x28')][_0x49d5('0x15')]);}return _0x544003[_0x49d5('0x47')](_0x481b45);}})[_0x49d5('0x1e')](function(_0x20f976){if(_0x20f976){return _0x20f976?{'count':_0x5ef82f,'rows':_0x20f976}:null;}})[_0x49d5('0x1e')](respondWithResult(_0x17b625,null))['catch'](handleError(_0x17b625,null));};exports[_0x49d5('0x48')]=function(_0x4a3f3a,_0x527092,_0x58d9a7){var _0x7e9a3e={};var _0x32f516={};var _0x4a5a45;var _0x56684b;return db[_0x49d5('0x38')][_0x49d5('0x43')]({'where':{'id':_0x4a3f3a['params']['id']}})[_0x49d5('0x1e')](handleEntityNotFound(_0x527092,null))[_0x49d5('0x1e')](function(_0x23d0f9){if(_0x23d0f9){_0x4a5a45=_0x23d0f9;_0x32f516[_0x49d5('0x26')]=_[_0x49d5('0x29')](db[_0x49d5('0x44')]['rawAttributes']);_0x32f516[_0x49d5('0x28')]=_[_0x49d5('0x29')](_0x4a3f3a['query']);_0x32f516[_0x49d5('0x2a')]=_[_0x49d5('0x2b')](_0x32f516[_0x49d5('0x26')],_0x32f516['query']);_0x7e9a3e['attributes']=_[_0x49d5('0x2b')](_0x32f516[_0x49d5('0x26')],qs[_0x49d5('0x2d')](_0x4a3f3a[_0x49d5('0x28')][_0x49d5('0x2d')]));_0x7e9a3e['attributes']=_0x7e9a3e[_0x49d5('0x2c')][_0x49d5('0x2e')]?_0x7e9a3e[_0x49d5('0x2c')]:_0x32f516[_0x49d5('0x26')];_0x7e9a3e[_0x49d5('0x30')]=qs[_0x49d5('0x31')](_0x4a3f3a[_0x49d5('0x28')][_0x49d5('0x31')]);_0x7e9a3e[_0x49d5('0x34')]=qs[_0x49d5('0x2a')](_['pick'](_0x4a3f3a['query'],_0x32f516[_0x49d5('0x2a')]));if(_0x4a3f3a[_0x49d5('0x28')][_0x49d5('0x33')]){_0x7e9a3e[_0x49d5('0x34')]=_[_0x49d5('0x37')](_0x7e9a3e[_0x49d5('0x34')],{'$or':_[_0x49d5('0x27')](_0x7e9a3e['attributes'],function(_0x107cb0){var _0x35534a={};_0x35534a[_0x107cb0]={'$like':'%'+_0x4a3f3a['query'][_0x49d5('0x33')]+'%'};return _0x35534a;})});}_0x7e9a3e=_['merge']({},_0x7e9a3e,_0x4a3f3a[_0x49d5('0x3e')]);return _0x4a5a45[_0x49d5('0x48')](_0x7e9a3e);}})[_0x49d5('0x1e')](function(_0x5c444e){if(_0x5c444e){_0x56684b=_0x5c444e[_0x49d5('0x2e')];if(!_0x4a3f3a[_0x49d5('0x28')][_0x49d5('0x2f')](_0x49d5('0x46'))){_0x7e9a3e[_0x49d5('0x18')]=qs[_0x49d5('0x18')](_0x4a3f3a[_0x49d5('0x28')][_0x49d5('0x18')]);_0x7e9a3e['offset']=qs[_0x49d5('0x15')](_0x4a3f3a[_0x49d5('0x28')]['offset']);}return _0x4a5a45[_0x49d5('0x48')](_0x7e9a3e);}})['then'](function(_0x57ec26){if(_0x57ec26){return _0x57ec26?{'count':_0x56684b,'rows':_0x57ec26}:null;}})[_0x49d5('0x1e')](respondWithResult(_0x527092,null))[_0x49d5('0x42')](handleError(_0x527092,null));}; \ No newline at end of file +var _0x073c=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x260d7f,_0x2e6a42){var _0x2e30d2=function(_0x3808a7){while(--_0x3808a7){_0x260d7f['push'](_0x260d7f['shift']());}};_0x2e30d2(++_0x2e6a42);}(_0x073c,0x118));var _0xc073=function(_0x131df6,_0x2bf019){_0x131df6=_0x131df6-0x0;var _0x58bf48=_0x073c[_0x131df6];return _0x58bf48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc073('0x0'));var zipdir=require(_0xc073('0x1'));var jsonpatch=require(_0xc073('0x2'));var rp=require(_0xc073('0x3'));var moment=require(_0xc073('0x4'));var BPromise=require(_0xc073('0x5'));var Mustache=require('mustache');var util=require(_0xc073('0x6'));var path=require('path');var sox=require(_0xc073('0x7'));var csv=require(_0xc073('0x8'));var ejs=require(_0xc073('0x9'));var fs=require('fs');var fs_extra=require(_0xc073('0xa'));var _=require(_0xc073('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc073('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc073('0x8'));var querystring=require(_0xc073('0xd'));var Papa=require('papaparse');var Redis=require(_0xc073('0xe'));var authService=require(_0xc073('0xf'));var qs=require(_0xc073('0x10'));var as=require(_0xc073('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc073('0x12'))(_0xc073('0x13'));var utils=require(_0xc073('0x14'));var config=require(_0xc073('0x15'));var licenseUtil=require(_0xc073('0x16'));var db=require(_0xc073('0x17'))['db'];function respondWithStatusCode(_0x1a6a80,_0x575bb5){_0x575bb5=_0x575bb5||0xcc;return function(_0x645a55){if(_0x645a55){return _0x1a6a80[_0xc073('0x18')](_0x575bb5);}return _0x1a6a80[_0xc073('0x19')](_0x575bb5)[_0xc073('0x1a')]();};}function respondWithResult(_0x213193,_0x209771){_0x209771=_0x209771||0xc8;return function(_0x315ffe){if(_0x315ffe){return _0x213193[_0xc073('0x19')](_0x209771)[_0xc073('0x1b')](_0x315ffe);}};}function respondWithFilteredResult(_0xc011bc,_0x54b17f){return function(_0x4f6851){if(_0x4f6851){var _0x4af48a=typeof _0x54b17f[_0xc073('0x1c')]===_0xc073('0x1d')&&typeof _0x54b17f[_0xc073('0x1e')]==='undefined';var _0x3f1bc4=_0x4f6851['count'];var _0x5f12ef=_0x4af48a?0x0:_0x54b17f[_0xc073('0x1c')];var _0x1292e7=_0x4af48a?_0x4f6851[_0xc073('0x1f')]:_0x54b17f[_0xc073('0x1c')]+_0x54b17f[_0xc073('0x1e')];var _0xe413bd;if(_0x1292e7>=_0x3f1bc4){_0x1292e7=_0x3f1bc4;_0xe413bd=0xc8;}else{_0xe413bd=0xce;}_0xc011bc['status'](_0xe413bd);return _0xc011bc[_0xc073('0x20')](_0xc073('0x21'),_0x5f12ef+'-'+_0x1292e7+'/'+_0x3f1bc4)[_0xc073('0x1b')](_0x4f6851);}return null;};}function patchUpdates(_0x2f99a4){return function(_0x307085){try{jsonpatch[_0xc073('0x22')](_0x307085,_0x2f99a4,!![]);}catch(_0x24390f){return BPromise[_0xc073('0x23')](_0x24390f);}return _0x307085[_0xc073('0x24')]();};}function saveUpdates(_0x58c266,_0x56ef10){return function(_0x246eed){if(_0x246eed){return _0x246eed[_0xc073('0x25')](_0x58c266)[_0xc073('0x26')](function(_0x4ecb4a){return _0x4ecb4a;});}return null;};}function removeEntity(_0x4a4565,_0x369856){return function(_0x4eec60){if(_0x4eec60){return _0x4eec60['destroy']()['then'](function(){_0x4a4565[_0xc073('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158596,_0x12600d){return function(_0x41d7ab){if(!_0x41d7ab){_0x158596[_0xc073('0x18')](0x194);}return _0x41d7ab;};}function handleError(_0x20572b,_0xd8679d){_0xd8679d=_0xd8679d||0x1f4;return function(_0x5bc87c){logger['error'](_0x5bc87c[_0xc073('0x27')]);if(_0x5bc87c['name']){delete _0x5bc87c[_0xc073('0x28')];}_0x20572b[_0xc073('0x19')](_0xd8679d)[_0xc073('0x29')](_0x5bc87c);};}exports[_0xc073('0x2a')]=function(_0x28e282,_0x5bcd11){var _0x3a8b8f={},_0x49ce62={},_0x5d9caa={'count':0x0,'rows':[]};var _0x594e66=_[_0xc073('0x2b')](db['VtigerConfiguration'][_0xc073('0x2c')],function(_0x225a46){return{'name':_0x225a46[_0xc073('0x2d')],'type':_0x225a46[_0xc073('0x2e')][_0xc073('0x2f')]};});_0x49ce62[_0xc073('0x30')]=_[_0xc073('0x2b')](_0x594e66,_0xc073('0x28'));_0x49ce62[_0xc073('0x31')]=_[_0xc073('0x32')](_0x28e282[_0xc073('0x31')]);_0x49ce62[_0xc073('0x33')]=_[_0xc073('0x34')](_0x49ce62['model'],_0x49ce62['query']);_0x3a8b8f[_0xc073('0x35')]=_[_0xc073('0x34')](_0x49ce62[_0xc073('0x30')],qs[_0xc073('0x36')](_0x28e282[_0xc073('0x31')][_0xc073('0x36')]));_0x3a8b8f[_0xc073('0x35')]=_0x3a8b8f[_0xc073('0x35')][_0xc073('0x37')]?_0x3a8b8f[_0xc073('0x35')]:_0x49ce62[_0xc073('0x30')];if(!_0x28e282[_0xc073('0x31')][_0xc073('0x38')](_0xc073('0x39'))){_0x3a8b8f['limit']=qs[_0xc073('0x1e')](_0x28e282[_0xc073('0x31')][_0xc073('0x1e')]);_0x3a8b8f['offset']=qs[_0xc073('0x1c')](_0x28e282[_0xc073('0x31')][_0xc073('0x1c')]);}_0x3a8b8f[_0xc073('0x3a')]=qs[_0xc073('0x3b')](_0x28e282[_0xc073('0x31')][_0xc073('0x3b')]);_0x3a8b8f['where']=qs['filters'](_[_0xc073('0x3c')](_0x28e282[_0xc073('0x31')],_0x49ce62['filters']),_0x594e66);if(_0x28e282[_0xc073('0x31')]['filter']){_0x3a8b8f[_0xc073('0x3d')]=_[_0xc073('0x3e')](_0x3a8b8f['where'],{'$or':_[_0xc073('0x2b')](_0x594e66,function(_0x460b1d){if(_0x460b1d[_0xc073('0x2e')]!==_0xc073('0x3f')){var _0x4e8ae8={};_0x4e8ae8[_0x460b1d[_0xc073('0x28')]]={'$like':'%'+_0x28e282['query'][_0xc073('0x40')]+'%'};return _0x4e8ae8;}})});}_0x3a8b8f=_[_0xc073('0x3e')]({},_0x3a8b8f,_0x28e282[_0xc073('0x41')]);var _0x3cbb27={'where':_0x3a8b8f[_0xc073('0x3d')]};return db[_0xc073('0x42')][_0xc073('0x1f')](_0x3cbb27)[_0xc073('0x26')](function(_0x4dbb67){_0x5d9caa[_0xc073('0x1f')]=_0x4dbb67;if(_0x28e282[_0xc073('0x31')][_0xc073('0x43')]){_0x3a8b8f[_0xc073('0x44')]=[{'all':!![]}];}return db[_0xc073('0x42')][_0xc073('0x45')](_0x3a8b8f);})[_0xc073('0x26')](function(_0x3d074e){_0x5d9caa[_0xc073('0x46')]=_0x3d074e;return _0x5d9caa;})[_0xc073('0x26')](respondWithFilteredResult(_0x5bcd11,_0x3a8b8f))[_0xc073('0x47')](handleError(_0x5bcd11,null));};exports[_0xc073('0x48')]=function(_0x163342,_0x416fd6){var _0xec1a3a={'raw':![],'where':{'id':_0x163342[_0xc073('0x49')]['id']}},_0x5d0bd4={};_0x5d0bd4['model']=_[_0xc073('0x32')](db[_0xc073('0x42')]['rawAttributes']);_0x5d0bd4[_0xc073('0x31')]=_[_0xc073('0x32')](_0x163342[_0xc073('0x31')]);_0x5d0bd4['filters']=_[_0xc073('0x34')](_0x5d0bd4['model'],_0x5d0bd4[_0xc073('0x31')]);_0xec1a3a[_0xc073('0x35')]=_['intersection'](_0x5d0bd4['model'],qs[_0xc073('0x36')](_0x163342[_0xc073('0x31')][_0xc073('0x36')]));_0xec1a3a[_0xc073('0x35')]=_0xec1a3a[_0xc073('0x35')][_0xc073('0x37')]?_0xec1a3a[_0xc073('0x35')]:_0x5d0bd4[_0xc073('0x30')];if(_0x163342[_0xc073('0x31')][_0xc073('0x43')]){_0xec1a3a[_0xc073('0x44')]=[{'all':!![]}];}_0xec1a3a=_['merge']({},_0xec1a3a,_0x163342[_0xc073('0x41')]);return db[_0xc073('0x42')][_0xc073('0x4a')](_0xec1a3a)['then'](handleEntityNotFound(_0x416fd6,null))[_0xc073('0x26')](respondWithResult(_0x416fd6,null))[_0xc073('0x47')](handleError(_0x416fd6,null));};exports[_0xc073('0x4b')]=function(_0x3a42b5,_0x4ade88){return db['VtigerConfiguration'][_0xc073('0x4b')](_0x3a42b5['body'],{})[_0xc073('0x26')](respondWithResult(_0x4ade88,0xc9))[_0xc073('0x47')](handleError(_0x4ade88,null));};exports['update']=function(_0x2da26d,_0x1381b7){if(_0x2da26d[_0xc073('0x4c')]['id']){delete _0x2da26d[_0xc073('0x4c')]['id'];}return db[_0xc073('0x42')][_0xc073('0x4a')]({'where':{'id':_0x2da26d[_0xc073('0x49')]['id']}})[_0xc073('0x26')](handleEntityNotFound(_0x1381b7,null))[_0xc073('0x26')](saveUpdates(_0x2da26d['body'],null))['then'](respondWithResult(_0x1381b7,null))[_0xc073('0x47')](handleError(_0x1381b7,null));};exports[_0xc073('0x4d')]=function(_0x2f7e83,_0x2b957f){return db[_0xc073('0x42')][_0xc073('0x4a')]({'where':{'id':_0x2f7e83[_0xc073('0x49')]['id']}})[_0xc073('0x26')](handleEntityNotFound(_0x2b957f,null))[_0xc073('0x26')](removeEntity(_0x2b957f,null))[_0xc073('0x47')](handleError(_0x2b957f,null));};exports[_0xc073('0x4e')]=function(_0x376f15,_0x10b57d,_0x3442d3){var _0x1e9e62={};var _0x32061c={};var _0x5c2d5a;var _0x55ab41;return db[_0xc073('0x42')][_0xc073('0x4f')]({'where':{'id':_0x376f15[_0xc073('0x49')]['id']}})['then'](handleEntityNotFound(_0x10b57d,null))[_0xc073('0x26')](function(_0x7a247a){if(_0x7a247a){_0x5c2d5a=_0x7a247a;_0x32061c['model']=_[_0xc073('0x32')](db[_0xc073('0x50')][_0xc073('0x2c')]);_0x32061c[_0xc073('0x31')]=_[_0xc073('0x32')](_0x376f15['query']);_0x32061c[_0xc073('0x33')]=_[_0xc073('0x34')](_0x32061c['model'],_0x32061c[_0xc073('0x31')]);_0x1e9e62[_0xc073('0x35')]=_[_0xc073('0x34')](_0x32061c['model'],qs[_0xc073('0x36')](_0x376f15[_0xc073('0x31')][_0xc073('0x36')]));_0x1e9e62[_0xc073('0x35')]=_0x1e9e62[_0xc073('0x35')][_0xc073('0x37')]?_0x1e9e62[_0xc073('0x35')]:_0x32061c[_0xc073('0x30')];_0x1e9e62[_0xc073('0x3a')]=qs[_0xc073('0x3b')](_0x376f15[_0xc073('0x31')][_0xc073('0x3b')]);_0x1e9e62[_0xc073('0x3d')]=qs['filters'](_[_0xc073('0x3c')](_0x376f15['query'],_0x32061c[_0xc073('0x33')]));if(_0x376f15[_0xc073('0x31')][_0xc073('0x40')]){_0x1e9e62['where']=_[_0xc073('0x3e')](_0x1e9e62[_0xc073('0x3d')],{'$or':_[_0xc073('0x2b')](_0x1e9e62[_0xc073('0x35')],function(_0x1f5f98){var _0x39e084={};_0x39e084[_0x1f5f98]={'$like':'%'+_0x376f15[_0xc073('0x31')]['filter']+'%'};return _0x39e084;})});}_0x1e9e62=_[_0xc073('0x3e')]({},_0x1e9e62,_0x376f15[_0xc073('0x41')]);return _0x5c2d5a[_0xc073('0x4e')](_0x1e9e62);}})['then'](function(_0x1b3c21){if(_0x1b3c21){_0x55ab41=_0x1b3c21[_0xc073('0x37')];if(!_0x376f15['query'][_0xc073('0x38')](_0xc073('0x39'))){_0x1e9e62[_0xc073('0x1e')]=qs[_0xc073('0x1e')](_0x376f15['query']['limit']);_0x1e9e62[_0xc073('0x1c')]=qs[_0xc073('0x1c')](_0x376f15[_0xc073('0x31')][_0xc073('0x1c')]);}return _0x5c2d5a[_0xc073('0x4e')](_0x1e9e62);}})[_0xc073('0x26')](function(_0x3dd0e1){if(_0x3dd0e1){return _0x3dd0e1?{'count':_0x55ab41,'rows':_0x3dd0e1}:null;}})[_0xc073('0x26')](respondWithResult(_0x10b57d,null))[_0xc073('0x47')](handleError(_0x10b57d,null));};exports['getSubjects']=function(_0x1dde13,_0x357fb7,_0x183022){var _0x14b7e7={};var _0x310278={};var _0x275c47;var _0x55f26e;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x1dde13['params']['id']}})[_0xc073('0x26')](handleEntityNotFound(_0x357fb7,null))[_0xc073('0x26')](function(_0x426117){if(_0x426117){_0x275c47=_0x426117;_0x310278[_0xc073('0x30')]=_[_0xc073('0x32')](db[_0xc073('0x50')][_0xc073('0x2c')]);_0x310278['query']=_[_0xc073('0x32')](_0x1dde13['query']);_0x310278['filters']=_[_0xc073('0x34')](_0x310278[_0xc073('0x30')],_0x310278['query']);_0x14b7e7[_0xc073('0x35')]=_[_0xc073('0x34')](_0x310278['model'],qs[_0xc073('0x36')](_0x1dde13[_0xc073('0x31')]['fields']));_0x14b7e7[_0xc073('0x35')]=_0x14b7e7[_0xc073('0x35')][_0xc073('0x37')]?_0x14b7e7['attributes']:_0x310278[_0xc073('0x30')];_0x14b7e7[_0xc073('0x3a')]=qs['sort'](_0x1dde13['query'][_0xc073('0x3b')]);_0x14b7e7[_0xc073('0x3d')]=qs[_0xc073('0x33')](_[_0xc073('0x3c')](_0x1dde13[_0xc073('0x31')],_0x310278[_0xc073('0x33')]));if(_0x1dde13['query']['filter']){_0x14b7e7[_0xc073('0x3d')]=_[_0xc073('0x3e')](_0x14b7e7[_0xc073('0x3d')],{'$or':_['map'](_0x14b7e7[_0xc073('0x35')],function(_0x27d398){var _0x5bd535={};_0x5bd535[_0x27d398]={'$like':'%'+_0x1dde13['query'][_0xc073('0x40')]+'%'};return _0x5bd535;})});}_0x14b7e7=_['merge']({},_0x14b7e7,_0x1dde13['options']);return _0x275c47['getSubjects'](_0x14b7e7);}})[_0xc073('0x26')](function(_0x18d903){if(_0x18d903){_0x55f26e=_0x18d903[_0xc073('0x37')];if(!_0x1dde13['query'][_0xc073('0x38')](_0xc073('0x39'))){_0x14b7e7[_0xc073('0x1e')]=qs[_0xc073('0x1e')](_0x1dde13[_0xc073('0x31')][_0xc073('0x1e')]);_0x14b7e7[_0xc073('0x1c')]=qs[_0xc073('0x1c')](_0x1dde13[_0xc073('0x31')][_0xc073('0x1c')]);}return _0x275c47[_0xc073('0x51')](_0x14b7e7);}})[_0xc073('0x26')](function(_0x5f2841){if(_0x5f2841){return _0x5f2841?{'count':_0x55f26e,'rows':_0x5f2841}:null;}})[_0xc073('0x26')](respondWithResult(_0x357fb7,null))[_0xc073('0x47')](handleError(_0x357fb7,null));};exports[_0xc073('0x52')]=function(_0x503b9f,_0x1a989a,_0x172868){var _0x1d62db={};var _0x4155d2={};var _0x15e08a;var _0x5de724;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x503b9f[_0xc073('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a989a,null))[_0xc073('0x26')](function(_0x2a9de5){if(_0x2a9de5){_0x15e08a=_0x2a9de5;_0x4155d2[_0xc073('0x30')]=_[_0xc073('0x32')](db[_0xc073('0x50')]['rawAttributes']);_0x4155d2[_0xc073('0x31')]=_[_0xc073('0x32')](_0x503b9f['query']);_0x4155d2[_0xc073('0x33')]=_[_0xc073('0x34')](_0x4155d2['model'],_0x4155d2['query']);_0x1d62db[_0xc073('0x35')]=_[_0xc073('0x34')](_0x4155d2[_0xc073('0x30')],qs[_0xc073('0x36')](_0x503b9f[_0xc073('0x31')]['fields']));_0x1d62db[_0xc073('0x35')]=_0x1d62db[_0xc073('0x35')][_0xc073('0x37')]?_0x1d62db[_0xc073('0x35')]:_0x4155d2['model'];_0x1d62db[_0xc073('0x3a')]=qs[_0xc073('0x3b')](_0x503b9f['query'][_0xc073('0x3b')]);_0x1d62db['where']=qs[_0xc073('0x33')](_['pick'](_0x503b9f[_0xc073('0x31')],_0x4155d2[_0xc073('0x33')]));if(_0x503b9f[_0xc073('0x31')][_0xc073('0x40')]){_0x1d62db[_0xc073('0x3d')]=_[_0xc073('0x3e')](_0x1d62db['where'],{'$or':_[_0xc073('0x2b')](_0x1d62db[_0xc073('0x35')],function(_0xd62a39){var _0x28f7e0={};_0x28f7e0[_0xd62a39]={'$like':'%'+_0x503b9f[_0xc073('0x31')][_0xc073('0x40')]+'%'};return _0x28f7e0;})});}_0x1d62db=_['merge']({},_0x1d62db,_0x503b9f[_0xc073('0x41')]);return _0x15e08a[_0xc073('0x52')](_0x1d62db);}})['then'](function(_0x533265){if(_0x533265){_0x5de724=_0x533265[_0xc073('0x37')];if(!_0x503b9f[_0xc073('0x31')]['hasOwnProperty'](_0xc073('0x39'))){_0x1d62db['limit']=qs['limit'](_0x503b9f[_0xc073('0x31')]['limit']);_0x1d62db['offset']=qs[_0xc073('0x1c')](_0x503b9f['query'][_0xc073('0x1c')]);}return _0x15e08a[_0xc073('0x52')](_0x1d62db);}})['then'](function(_0x466da0){if(_0x466da0){return _0x466da0?{'count':_0x5de724,'rows':_0x466da0}:null;}})[_0xc073('0x26')](respondWithResult(_0x1a989a,null))[_0xc073('0x47')](handleError(_0x1a989a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 7aadefb..1131d1b 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 _0x342d=['util','api','moment','path','rimraf','exports','define','int_vtiger_configurations'];(function(_0x5c6abb,_0x276047){var _0x43c9e8=function(_0x48a724){while(--_0x48a724){_0x5c6abb['push'](_0x5c6abb['shift']());}};_0x43c9e8(++_0x276047);}(_0x342d,0x100));var _0xd342=function(_0x2d592c,_0x100fd9){_0x2d592c=_0x2d592c-0x0;var _0xd550a8=_0x342d[_0x2d592c];return _0xd550a8;};'use strict';var _=require('lodash');var util=require(_0xd342('0x0'));var logger=require('../../config/logger')(_0xd342('0x1'));var moment=require(_0xd342('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd342('0x3'));var rimraf=require(_0xd342('0x4'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0xd342('0x5')]=function(_0x5b3d58,_0x32fffd){return _0x5b3d58[_0xd342('0x6')]('VtigerConfiguration',attributes,{'tableName':_0xd342('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8010=['exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8010,0xfa));var _0x0801=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8010[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0801('0x0'));var util=require(_0x0801('0x1'));var logger=require(_0x0801('0x2'))(_0x0801('0x3'));var moment=require(_0x0801('0x4'));var BPromise=require(_0x0801('0x5'));var rp=require(_0x0801('0x6'));var fs=require('fs');var path=require(_0x0801('0x7'));var rimraf=require(_0x0801('0x8'));var config=require(_0x0801('0x9'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x0801('0xa')]=function(_0x54ad5e,_0x8ef48e){return _0x54ad5e[_0x0801('0xb')]('VtigerConfiguration',attributes,{'tableName':_0x0801('0xc'),'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 4b339ea..be2ba1a 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 _0x7b9c=['request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7b9c,0x1ac));var _0xc7b9=function(_0x2e2586,_0x4ca6be){_0x2e2586=_0x2e2586-0x0;var _0x47c85d=_0x7b9c[_0x2e2586];return _0x47c85d;};'use strict';var _=require(_0xc7b9('0x0'));var util=require(_0xc7b9('0x1'));var moment=require(_0xc7b9('0x2'));var BPromise=require('bluebird');var rs=require(_0xc7b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7b9('0x4'))['db'];var utils=require(_0xc7b9('0x5'));var logger=require('../../config/logger')(_0xc7b9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc7b9('0x7')][_0xc7b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50f7c5,_0x3302aa,_0x2f514c){return new BPromise(function(_0x304204,_0x1ffd7c){return client[_0xc7b9('0x9')](_0x50f7c5,_0x2f514c)['then'](function(_0x279bbd){logger[_0xc7b9('0xa')](_0xc7b9('0xb'),_0x3302aa,_0xc7b9('0xc'));logger['debug'](_0xc7b9('0xd'),_0x3302aa,_0xc7b9('0xc'),JSON[_0xc7b9('0xe')](_0x279bbd));if(_0x279bbd[_0xc7b9('0xf')]){if(_0x279bbd['error']['code']===0x1f4){logger[_0xc7b9('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x3302aa,_0x279bbd['error'][_0xc7b9('0x10')]);return _0x1ffd7c(_0x279bbd[_0xc7b9('0xf')][_0xc7b9('0x10')]);}logger[_0xc7b9('0xf')](_0xc7b9('0xb'),_0x3302aa,_0x279bbd['error'][_0xc7b9('0x10')]);return _0x304204(_0x279bbd[_0xc7b9('0xf')][_0xc7b9('0x10')]);}else{logger[_0xc7b9('0xa')](_0xc7b9('0xb'),_0x3302aa,_0xc7b9('0xc'));_0x304204(_0x279bbd[_0xc7b9('0x11')][_0xc7b9('0x10')]);}})[_0xc7b9('0x12')](function(_0x380796){logger[_0xc7b9('0xf')](_0xc7b9('0xb'),_0x3302aa,_0x380796);_0x1ffd7c(_0x380796);});});} \ No newline at end of file +var _0x5ebf=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x5ebf,0xd0));var _0xf5eb=function(_0x13ca67,_0x4a6835){_0x13ca67=_0x13ca67-0x0;var _0x224b0d=_0x5ebf[_0x13ca67];return _0x224b0d;};'use strict';var _=require(_0xf5eb('0x0'));var util=require(_0xf5eb('0x1'));var moment=require(_0xf5eb('0x2'));var BPromise=require('bluebird');var rs=require(_0xf5eb('0x3'));var fs=require('fs');var Redis=require(_0xf5eb('0x4'));var db=require(_0xf5eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5eb('0x6'))('rpc');var config=require(_0xf5eb('0x7'));var jayson=require(_0xf5eb('0x8'));var client=jayson[_0xf5eb('0x9')][_0xf5eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b03a3,_0x44bd75,_0x373fb5){return new BPromise(function(_0x209cad,_0x12bc36){return client[_0xf5eb('0xb')](_0x2b03a3,_0x373fb5)[_0xf5eb('0xc')](function(_0x2fc903){logger[_0xf5eb('0xd')](_0xf5eb('0xe'),_0x44bd75,_0xf5eb('0xf'));logger[_0xf5eb('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x44bd75,_0xf5eb('0xf'),JSON['stringify'](_0x2fc903));if(_0x2fc903['error']){if(_0x2fc903[_0xf5eb('0x11')][_0xf5eb('0x12')]===0x1f4){logger[_0xf5eb('0x11')](_0xf5eb('0xe'),_0x44bd75,_0x2fc903[_0xf5eb('0x11')]['message']);return _0x12bc36(_0x2fc903[_0xf5eb('0x11')]['message']);}logger[_0xf5eb('0x11')](_0xf5eb('0xe'),_0x44bd75,_0x2fc903[_0xf5eb('0x11')]['message']);return _0x209cad(_0x2fc903['error'][_0xf5eb('0x13')]);}else{logger[_0xf5eb('0xd')](_0xf5eb('0xe'),_0x44bd75,_0xf5eb('0xf'));_0x209cad(_0x2fc903[_0xf5eb('0x14')]['message']);}})[_0xf5eb('0x15')](function(_0x34407f){logger[_0xf5eb('0x11')](_0xf5eb('0xe'),_0x44bd75,_0x34407f);_0x12bc36(_0x34407f);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 6d12467..c912aac 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 _0xbfdc=['put','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x1a32f7,_0xbfbe36){var _0x454625=function(_0x58163c){while(--_0x58163c){_0x1a32f7['push'](_0x1a32f7['shift']());}};_0x454625(++_0xbfbe36);}(_0xbfdc,0x184));var _0xcbfd=function(_0x46c627,_0x356de8){_0x46c627=_0x46c627-0x0;var _0x2a6026=_0xbfdc[_0x46c627];return _0x2a6026;};'use strict';var multer=require('multer');var util=require(_0xcbfd('0x0'));var path=require('path');var timeout=require(_0xcbfd('0x1'));var express=require(_0xcbfd('0x2'));var router=express['Router']();var fs_extra=require(_0xcbfd('0x3'));var auth=require(_0xcbfd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcbfd('0x5'));router[_0xcbfd('0x6')]('/',auth[_0xcbfd('0x7')](),controller['index']);router[_0xcbfd('0x6')](_0xcbfd('0x8'),auth[_0xcbfd('0x7')](),controller[_0xcbfd('0x9')]);router[_0xcbfd('0xa')]('/',auth['isAuthenticated'](),controller[_0xcbfd('0xb')]);router[_0xcbfd('0xc')](_0xcbfd('0x8'),auth[_0xcbfd('0x7')](),controller[_0xcbfd('0xd')]);router['delete'](_0xcbfd('0x8'),auth[_0xcbfd('0x7')](),controller[_0xcbfd('0xe')]);module[_0xcbfd('0xf')]=router; \ No newline at end of file +var _0xd065=['post','create','put','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./intVtigerField.controller','get','/:id','show'];(function(_0x248d78,_0x38b034){var _0x4dec5e=function(_0x46ffb6){while(--_0x46ffb6){_0x248d78['push'](_0x248d78['shift']());}};_0x4dec5e(++_0x38b034);}(_0xd065,0xc2));var _0x5d06=function(_0x28a56e,_0x577693){_0x28a56e=_0x28a56e-0x0;var _0xa6bfa8=_0xd065[_0x28a56e];return _0xa6bfa8;};'use strict';var multer=require(_0x5d06('0x0'));var util=require(_0x5d06('0x1'));var path=require('path');var timeout=require(_0x5d06('0x2'));var express=require('express');var router=express[_0x5d06('0x3')]();var fs_extra=require(_0x5d06('0x4'));var auth=require(_0x5d06('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5d06('0x6'));router[_0x5d06('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5d06('0x8'),auth['isAuthenticated'](),controller[_0x5d06('0x9')]);router[_0x5d06('0xa')]('/',auth['isAuthenticated'](),controller[_0x5d06('0xb')]);router[_0x5d06('0xc')](_0x5d06('0x8'),auth[_0x5d06('0xd')](),controller[_0x5d06('0xe')]);router['delete'](_0x5d06('0x8'),auth['isAuthenticated'](),controller[_0x5d06('0xf')]);module[_0x5d06('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 483a8a9..ceac80a 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 _0x2d1c=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2d1c,0x116));var _0xc2d1=function(_0x101b51,_0x4e33c1){_0x101b51=_0x101b51-0x0;var _0x32dd23=_0x2d1c[_0x101b51];return _0x32dd23;};'use strict';var Sequelize=require(_0xc2d1('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xc2d1('0x1'),_0xc2d1('0x2'),_0xc2d1('0x3'),_0xc2d1('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc2d1('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xc2d1('0x1'),_0xc2d1('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc2d1('0x5')]},'idField':{'type':Sequelize[_0xc2d1('0x5')]},'nameField':{'type':Sequelize[_0xc2d1('0x5')]},'customField':{'type':Sequelize[_0xc2d1('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe267=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x93f2e9,_0x556e86){var _0x2e907c=function(_0x20dd41){while(--_0x20dd41){_0x93f2e9['push'](_0x93f2e9['shift']());}};_0x2e907c(++_0x556e86);}(_0xe267,0xa4));var _0x7e26=function(_0x73b1cd,_0x176535){_0x73b1cd=_0x73b1cd-0x0;var _0x243426=_0xe267[_0x73b1cd];return _0x243426;};'use strict';var Sequelize=require('sequelize');module[_0x7e26('0x0')]={'type':{'type':Sequelize[_0x7e26('0x1')](_0x7e26('0x2'),_0x7e26('0x3'),_0x7e26('0x4'),_0x7e26('0x5'),_0x7e26('0x6')),'defaultValue':_0x7e26('0x2')},'content':{'type':Sequelize[_0x7e26('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7e26('0x1')](_0x7e26('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7e26('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7e26('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7e26('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ddc0197..c4c7b38 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 _0x41e8=['error','stack','name','send','index','map','VtigerField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41e8,0x10a));var _0x841e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x41e8[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x841e('0x0'));var zipdir=require(_0x841e('0x1'));var jsonpatch=require(_0x841e('0x2'));var rp=require(_0x841e('0x3'));var moment=require(_0x841e('0x4'));var BPromise=require(_0x841e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x841e('0x6'));var csv=require('to-csv');var ejs=require(_0x841e('0x7'));var fs=require('fs');var fs_extra=require(_0x841e('0x8'));var _=require(_0x841e('0x9'));var squel=require(_0x841e('0xa'));var crypto=require(_0x841e('0xb'));var jsforce=require(_0x841e('0xc'));var deskjs=require(_0x841e('0xd'));var toCsv=require(_0x841e('0xe'));var querystring=require(_0x841e('0xf'));var Papa=require(_0x841e('0x10'));var Redis=require(_0x841e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x841e('0x12'));var as=require(_0x841e('0x13'));var hardwareService=require(_0x841e('0x14'));var logger=require('../../config/logger')(_0x841e('0x15'));var utils=require(_0x841e('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x841e('0x17'))['db'];function respondWithStatusCode(_0x195f1e,_0x3e5e32){_0x3e5e32=_0x3e5e32||0xcc;return function(_0x3bc546){if(_0x3bc546){return _0x195f1e['sendStatus'](_0x3e5e32);}return _0x195f1e[_0x841e('0x18')](_0x3e5e32)[_0x841e('0x19')]();};}function respondWithResult(_0x48e13e,_0x22964a){_0x22964a=_0x22964a||0xc8;return function(_0x553a3a){if(_0x553a3a){return _0x48e13e['status'](_0x22964a)[_0x841e('0x1a')](_0x553a3a);}};}function respondWithFilteredResult(_0x272cf7,_0x2fee58){return function(_0x58b3f8){if(_0x58b3f8){var _0x2e8205=typeof _0x2fee58[_0x841e('0x1b')]===_0x841e('0x1c')&&typeof _0x2fee58[_0x841e('0x1d')]===_0x841e('0x1c');var _0x43fcca=_0x58b3f8[_0x841e('0x1e')];var _0x1261dd=_0x2e8205?0x0:_0x2fee58[_0x841e('0x1b')];var _0x179977=_0x2e8205?_0x58b3f8[_0x841e('0x1e')]:_0x2fee58[_0x841e('0x1b')]+_0x2fee58[_0x841e('0x1d')];var _0x4a70a5;if(_0x179977>=_0x43fcca){_0x179977=_0x43fcca;_0x4a70a5=0xc8;}else{_0x4a70a5=0xce;}_0x272cf7[_0x841e('0x18')](_0x4a70a5);return _0x272cf7[_0x841e('0x1f')](_0x841e('0x20'),_0x1261dd+'-'+_0x179977+'/'+_0x43fcca)[_0x841e('0x1a')](_0x58b3f8);}return null;};}function patchUpdates(_0x279517){return function(_0x53b607){try{jsonpatch[_0x841e('0x21')](_0x53b607,_0x279517,!![]);}catch(_0x1726ae){return BPromise['reject'](_0x1726ae);}return _0x53b607[_0x841e('0x22')]();};}function saveUpdates(_0xd8154d,_0x274122){return function(_0x2ec2cb){if(_0x2ec2cb){return _0x2ec2cb['update'](_0xd8154d)[_0x841e('0x23')](function(_0x5345ad){return _0x5345ad;});}return null;};}function removeEntity(_0x5d7614,_0x129c9b){return function(_0x219dde){if(_0x219dde){return _0x219dde[_0x841e('0x24')]()['then'](function(){_0x5d7614['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e333,_0x407991){return function(_0x4d6af4){if(!_0x4d6af4){_0x51e333[_0x841e('0x25')](0x194);}return _0x4d6af4;};}function handleError(_0x50aa90,_0x549183){_0x549183=_0x549183||0x1f4;return function(_0x269984){logger[_0x841e('0x26')](_0x269984[_0x841e('0x27')]);if(_0x269984[_0x841e('0x28')]){delete _0x269984[_0x841e('0x28')];}_0x50aa90[_0x841e('0x18')](_0x549183)[_0x841e('0x29')](_0x269984);};}exports[_0x841e('0x2a')]=function(_0x88c0b9,_0x39531b){var _0x445435={},_0x366e68={},_0x493701={'count':0x0,'rows':[]};var _0x315b97=_[_0x841e('0x2b')](db[_0x841e('0x2c')]['rawAttributes'],function(_0x2e45af){return{'name':_0x2e45af[_0x841e('0x2d')],'type':_0x2e45af[_0x841e('0x2e')]['key']};});_0x366e68[_0x841e('0x2f')]=_[_0x841e('0x2b')](_0x315b97,_0x841e('0x28'));_0x366e68[_0x841e('0x30')]=_[_0x841e('0x31')](_0x88c0b9[_0x841e('0x30')]);_0x366e68[_0x841e('0x32')]=_['intersection'](_0x366e68['model'],_0x366e68[_0x841e('0x30')]);_0x445435[_0x841e('0x33')]=_[_0x841e('0x34')](_0x366e68[_0x841e('0x2f')],qs['fields'](_0x88c0b9[_0x841e('0x30')][_0x841e('0x35')]));_0x445435['attributes']=_0x445435[_0x841e('0x33')][_0x841e('0x36')]?_0x445435[_0x841e('0x33')]:_0x366e68[_0x841e('0x2f')];if(!_0x88c0b9[_0x841e('0x30')][_0x841e('0x37')](_0x841e('0x38'))){_0x445435[_0x841e('0x1d')]=qs[_0x841e('0x1d')](_0x88c0b9['query'][_0x841e('0x1d')]);_0x445435[_0x841e('0x1b')]=qs['offset'](_0x88c0b9[_0x841e('0x30')][_0x841e('0x1b')]);}_0x445435[_0x841e('0x39')]=qs['sort'](_0x88c0b9[_0x841e('0x30')][_0x841e('0x3a')]);_0x445435[_0x841e('0x3b')]=qs[_0x841e('0x32')](_[_0x841e('0x3c')](_0x88c0b9[_0x841e('0x30')],_0x366e68[_0x841e('0x32')]),_0x315b97);if(_0x88c0b9[_0x841e('0x30')][_0x841e('0x3d')]){_0x445435[_0x841e('0x3b')]=_[_0x841e('0x3e')](_0x445435[_0x841e('0x3b')],{'$or':_[_0x841e('0x2b')](_0x315b97,function(_0x42275c){if(_0x42275c['type']!==_0x841e('0x3f')){var _0x2ecfcb={};_0x2ecfcb[_0x42275c[_0x841e('0x28')]]={'$like':'%'+_0x88c0b9[_0x841e('0x30')][_0x841e('0x3d')]+'%'};return _0x2ecfcb;}})});}_0x445435=_[_0x841e('0x3e')]({},_0x445435,_0x88c0b9[_0x841e('0x40')]);var _0x13c1df={'where':_0x445435['where']};return db[_0x841e('0x2c')][_0x841e('0x1e')](_0x13c1df)['then'](function(_0x4d5d50){_0x493701[_0x841e('0x1e')]=_0x4d5d50;if(_0x88c0b9[_0x841e('0x30')][_0x841e('0x41')]){_0x445435[_0x841e('0x42')]=[{'all':!![]}];}return db['VtigerField'][_0x841e('0x43')](_0x445435);})[_0x841e('0x23')](function(_0x4056d8){_0x493701[_0x841e('0x44')]=_0x4056d8;return _0x493701;})[_0x841e('0x23')](respondWithFilteredResult(_0x39531b,_0x445435))[_0x841e('0x45')](handleError(_0x39531b,null));};exports['show']=function(_0x4bcb17,_0x128edc){var _0x35856d={'raw':!![],'where':{'id':_0x4bcb17[_0x841e('0x46')]['id']}},_0x339bda={};_0x339bda[_0x841e('0x2f')]=_[_0x841e('0x31')](db[_0x841e('0x2c')][_0x841e('0x47')]);_0x339bda['query']=_[_0x841e('0x31')](_0x4bcb17[_0x841e('0x30')]);_0x339bda['filters']=_[_0x841e('0x34')](_0x339bda[_0x841e('0x2f')],_0x339bda[_0x841e('0x30')]);_0x35856d[_0x841e('0x33')]=_[_0x841e('0x34')](_0x339bda[_0x841e('0x2f')],qs[_0x841e('0x35')](_0x4bcb17[_0x841e('0x30')][_0x841e('0x35')]));_0x35856d[_0x841e('0x33')]=_0x35856d[_0x841e('0x33')][_0x841e('0x36')]?_0x35856d[_0x841e('0x33')]:_0x339bda[_0x841e('0x2f')];if(_0x4bcb17['query'][_0x841e('0x41')]){_0x35856d[_0x841e('0x42')]=[{'all':!![]}];}_0x35856d=_[_0x841e('0x3e')]({},_0x35856d,_0x4bcb17['options']);return db[_0x841e('0x2c')][_0x841e('0x48')](_0x35856d)[_0x841e('0x23')](handleEntityNotFound(_0x128edc,null))[_0x841e('0x23')](respondWithResult(_0x128edc,null))['catch'](handleError(_0x128edc,null));};exports[_0x841e('0x49')]=function(_0x6d9f97,_0x108363){return db[_0x841e('0x2c')][_0x841e('0x49')](_0x6d9f97[_0x841e('0x4a')],{})[_0x841e('0x23')](respondWithResult(_0x108363,0xc9))[_0x841e('0x45')](handleError(_0x108363,null));};exports[_0x841e('0x4b')]=function(_0x191c74,_0x22095c){if(_0x191c74[_0x841e('0x4a')]['id']){delete _0x191c74[_0x841e('0x4a')]['id'];}return db['VtigerField'][_0x841e('0x48')]({'where':{'id':_0x191c74['params']['id']}})[_0x841e('0x23')](handleEntityNotFound(_0x22095c,null))[_0x841e('0x23')](saveUpdates(_0x191c74[_0x841e('0x4a')],null))[_0x841e('0x23')](respondWithResult(_0x22095c,null))[_0x841e('0x45')](handleError(_0x22095c,null));};exports['destroy']=function(_0x4f8a06,_0x110808){return db[_0x841e('0x2c')][_0x841e('0x48')]({'where':{'id':_0x4f8a06[_0x841e('0x46')]['id']}})[_0x841e('0x23')](handleEntityNotFound(_0x110808,null))['then'](removeEntity(_0x110808,null))[_0x841e('0x45')](handleError(_0x110808,null));}; \ No newline at end of file +var _0x579c=['end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','VtigerField','includeAll','include','findAll','catch','show','params','keys','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x579c,0x10a));var _0xc579=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0x579c[_0xb77dfe];return _0x5e4f5d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc579('0x0'));var jsonpatch=require(_0xc579('0x1'));var rp=require(_0xc579('0x2'));var moment=require(_0xc579('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc579('0x4'));var util=require(_0xc579('0x5'));var path=require(_0xc579('0x6'));var sox=require(_0xc579('0x7'));var csv=require(_0xc579('0x8'));var ejs=require(_0xc579('0x9'));var fs=require('fs');var fs_extra=require(_0xc579('0xa'));var _=require(_0xc579('0xb'));var squel=require(_0xc579('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc579('0xd'));var toCsv=require(_0xc579('0x8'));var querystring=require(_0xc579('0xe'));var Papa=require(_0xc579('0xf'));var Redis=require(_0xc579('0x10'));var authService=require(_0xc579('0x11'));var qs=require(_0xc579('0x12'));var as=require(_0xc579('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc579('0x14'))(_0xc579('0x15'));var utils=require(_0xc579('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc579('0x17'))['db'];function respondWithStatusCode(_0x4f1911,_0x303856){_0x303856=_0x303856||0xcc;return function(_0x348ab8){if(_0x348ab8){return _0x4f1911['sendStatus'](_0x303856);}return _0x4f1911[_0xc579('0x18')](_0x303856)['end']();};}function respondWithResult(_0x20e640,_0x459877){_0x459877=_0x459877||0xc8;return function(_0x15a77a){if(_0x15a77a){return _0x20e640[_0xc579('0x18')](_0x459877)[_0xc579('0x19')](_0x15a77a);}};}function respondWithFilteredResult(_0x3e5ce6,_0x5ec89a){return function(_0x3f601b){if(_0x3f601b){var _0x584e9e=typeof _0x5ec89a[_0xc579('0x1a')]===_0xc579('0x1b')&&typeof _0x5ec89a[_0xc579('0x1c')]===_0xc579('0x1b');var _0x206a26=_0x3f601b[_0xc579('0x1d')];var _0x5b25e8=_0x584e9e?0x0:_0x5ec89a[_0xc579('0x1a')];var _0x173e1d=_0x584e9e?_0x3f601b[_0xc579('0x1d')]:_0x5ec89a['offset']+_0x5ec89a[_0xc579('0x1c')];var _0x47506b;if(_0x173e1d>=_0x206a26){_0x173e1d=_0x206a26;_0x47506b=0xc8;}else{_0x47506b=0xce;}_0x3e5ce6[_0xc579('0x18')](_0x47506b);return _0x3e5ce6[_0xc579('0x1e')](_0xc579('0x1f'),_0x5b25e8+'-'+_0x173e1d+'/'+_0x206a26)[_0xc579('0x19')](_0x3f601b);}return null;};}function patchUpdates(_0x2d8372){return function(_0x4a81e4){try{jsonpatch[_0xc579('0x20')](_0x4a81e4,_0x2d8372,!![]);}catch(_0x244d6a){return BPromise[_0xc579('0x21')](_0x244d6a);}return _0x4a81e4[_0xc579('0x22')]();};}function saveUpdates(_0x24202e,_0x270f20){return function(_0x29211e){if(_0x29211e){return _0x29211e[_0xc579('0x23')](_0x24202e)[_0xc579('0x24')](function(_0x5b663f){return _0x5b663f;});}return null;};}function removeEntity(_0x532309,_0x3939f7){return function(_0x3d2dc1){if(_0x3d2dc1){return _0x3d2dc1[_0xc579('0x25')]()[_0xc579('0x24')](function(){_0x532309[_0xc579('0x18')](0xcc)[_0xc579('0x26')]();});}};}function handleEntityNotFound(_0xc01d06,_0x46e9eb){return function(_0xa9ceac){if(!_0xa9ceac){_0xc01d06['sendStatus'](0x194);}return _0xa9ceac;};}function handleError(_0x20a176,_0x502ba6){_0x502ba6=_0x502ba6||0x1f4;return function(_0x1a7e5d){logger[_0xc579('0x27')](_0x1a7e5d[_0xc579('0x28')]);if(_0x1a7e5d[_0xc579('0x29')]){delete _0x1a7e5d[_0xc579('0x29')];}_0x20a176[_0xc579('0x18')](_0x502ba6)[_0xc579('0x2a')](_0x1a7e5d);};}exports[_0xc579('0x2b')]=function(_0x3d394d,_0x3a41b3){var _0x44754b={},_0x4d5813={},_0x4fff53={'count':0x0,'rows':[]};var _0x158b24=_['map'](db['VtigerField'][_0xc579('0x2c')],function(_0x489ed8){return{'name':_0x489ed8[_0xc579('0x2d')],'type':_0x489ed8[_0xc579('0x2e')][_0xc579('0x2f')]};});_0x4d5813[_0xc579('0x30')]=_['map'](_0x158b24,_0xc579('0x29'));_0x4d5813[_0xc579('0x31')]=_['keys'](_0x3d394d[_0xc579('0x31')]);_0x4d5813[_0xc579('0x32')]=_[_0xc579('0x33')](_0x4d5813[_0xc579('0x30')],_0x4d5813['query']);_0x44754b['attributes']=_[_0xc579('0x33')](_0x4d5813['model'],qs[_0xc579('0x34')](_0x3d394d[_0xc579('0x31')][_0xc579('0x34')]));_0x44754b[_0xc579('0x35')]=_0x44754b[_0xc579('0x35')][_0xc579('0x36')]?_0x44754b[_0xc579('0x35')]:_0x4d5813['model'];if(!_0x3d394d[_0xc579('0x31')]['hasOwnProperty'](_0xc579('0x37'))){_0x44754b[_0xc579('0x1c')]=qs['limit'](_0x3d394d[_0xc579('0x31')][_0xc579('0x1c')]);_0x44754b['offset']=qs[_0xc579('0x1a')](_0x3d394d[_0xc579('0x31')][_0xc579('0x1a')]);}_0x44754b[_0xc579('0x38')]=qs['sort'](_0x3d394d['query'][_0xc579('0x39')]);_0x44754b[_0xc579('0x3a')]=qs[_0xc579('0x32')](_[_0xc579('0x3b')](_0x3d394d[_0xc579('0x31')],_0x4d5813[_0xc579('0x32')]),_0x158b24);if(_0x3d394d[_0xc579('0x31')][_0xc579('0x3c')]){_0x44754b[_0xc579('0x3a')]=_[_0xc579('0x3d')](_0x44754b[_0xc579('0x3a')],{'$or':_[_0xc579('0x3e')](_0x158b24,function(_0x52cc0d){if(_0x52cc0d[_0xc579('0x2e')]!==_0xc579('0x3f')){var _0xba4a78={};_0xba4a78[_0x52cc0d[_0xc579('0x29')]]={'$like':'%'+_0x3d394d[_0xc579('0x31')]['filter']+'%'};return _0xba4a78;}})});}_0x44754b=_[_0xc579('0x3d')]({},_0x44754b,_0x3d394d[_0xc579('0x40')]);var _0x4530b7={'where':_0x44754b[_0xc579('0x3a')]};return db[_0xc579('0x41')][_0xc579('0x1d')](_0x4530b7)[_0xc579('0x24')](function(_0x4e99c9){_0x4fff53['count']=_0x4e99c9;if(_0x3d394d[_0xc579('0x31')][_0xc579('0x42')]){_0x44754b[_0xc579('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0xc579('0x44')](_0x44754b);})[_0xc579('0x24')](function(_0x37f2c4){_0x4fff53['rows']=_0x37f2c4;return _0x4fff53;})['then'](respondWithFilteredResult(_0x3a41b3,_0x44754b))[_0xc579('0x45')](handleError(_0x3a41b3,null));};exports[_0xc579('0x46')]=function(_0xef7286,_0x5749f9){var _0x4b030c={'raw':!![],'where':{'id':_0xef7286[_0xc579('0x47')]['id']}},_0x3a9a39={};_0x3a9a39['model']=_[_0xc579('0x48')](db[_0xc579('0x41')][_0xc579('0x2c')]);_0x3a9a39[_0xc579('0x31')]=_[_0xc579('0x48')](_0xef7286[_0xc579('0x31')]);_0x3a9a39[_0xc579('0x32')]=_[_0xc579('0x33')](_0x3a9a39[_0xc579('0x30')],_0x3a9a39[_0xc579('0x31')]);_0x4b030c['attributes']=_[_0xc579('0x33')](_0x3a9a39['model'],qs[_0xc579('0x34')](_0xef7286[_0xc579('0x31')][_0xc579('0x34')]));_0x4b030c['attributes']=_0x4b030c['attributes'][_0xc579('0x36')]?_0x4b030c[_0xc579('0x35')]:_0x3a9a39[_0xc579('0x30')];if(_0xef7286[_0xc579('0x31')][_0xc579('0x42')]){_0x4b030c[_0xc579('0x43')]=[{'all':!![]}];}_0x4b030c=_[_0xc579('0x3d')]({},_0x4b030c,_0xef7286[_0xc579('0x40')]);return db[_0xc579('0x41')][_0xc579('0x49')](_0x4b030c)[_0xc579('0x24')](handleEntityNotFound(_0x5749f9,null))[_0xc579('0x24')](respondWithResult(_0x5749f9,null))[_0xc579('0x45')](handleError(_0x5749f9,null));};exports[_0xc579('0x4a')]=function(_0x2b73bb,_0x25b91f){return db['VtigerField'][_0xc579('0x4a')](_0x2b73bb[_0xc579('0x4b')],{})['then'](respondWithResult(_0x25b91f,0xc9))[_0xc579('0x45')](handleError(_0x25b91f,null));};exports['update']=function(_0x116ffb,_0x4187c4){if(_0x116ffb[_0xc579('0x4b')]['id']){delete _0x116ffb['body']['id'];}return db[_0xc579('0x41')][_0xc579('0x49')]({'where':{'id':_0x116ffb['params']['id']}})['then'](handleEntityNotFound(_0x4187c4,null))['then'](saveUpdates(_0x116ffb['body'],null))['then'](respondWithResult(_0x4187c4,null))[_0xc579('0x45')](handleError(_0x4187c4,null));};exports[_0xc579('0x25')]=function(_0x157ed3,_0x3f76d0){return db[_0xc579('0x41')]['find']({'where':{'id':_0x157ed3[_0xc579('0x47')]['id']}})[_0xc579('0x24')](handleEntityNotFound(_0x3f76d0,null))[_0xc579('0x24')](removeEntity(_0x3f76d0,null))[_0xc579('0x45')](handleError(_0x3f76d0,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d1eb5f9..a67eee0 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 _0x53fb=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','./intVtigerField.attributes','exports','define'];(function(_0x4955da,_0x59ac4e){var _0x11ca45=function(_0x56fd65){while(--_0x56fd65){_0x4955da['push'](_0x4955da['shift']());}};_0x11ca45(++_0x59ac4e);}(_0x53fb,0x123));var _0xb53f=function(_0x21a7a8,_0x43690b){_0x21a7a8=_0x21a7a8-0x0;var _0x37d99e=_0x53fb[_0x21a7a8];return _0x37d99e;};'use strict';var _=require(_0xb53f('0x0'));var util=require(_0xb53f('0x1'));var logger=require(_0xb53f('0x2'))(_0xb53f('0x3'));var moment=require('moment');var BPromise=require(_0xb53f('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(_0xb53f('0x5'));module[_0xb53f('0x6')]=function(_0xdd5e4,_0x4228a0){return _0xdd5e4[_0xb53f('0x7')](_0xb53f('0x8'),attributes,{'tableName':_0xb53f('0x9'),'paranoid':![],'indexes':[{'name':_0xb53f('0xa'),'fields':[_0xb53f('0xb'),_0xb53f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa38c=['path','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','FieldId','lodash','util','../../config/logger','request-promise'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xa38c,0xee));var _0xca38=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0xa38c[_0x283127];return _0x43da5d;};'use strict';var _=require(_0xca38('0x0'));var util=require(_0xca38('0x1'));var logger=require(_0xca38('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca38('0x3'));var fs=require('fs');var path=require(_0xca38('0x4'));var rimraf=require('rimraf');var config=require(_0xca38('0x5'));var attributes=require(_0xca38('0x6'));module[_0xca38('0x7')]=function(_0x523463,_0x52a602){return _0x523463['define'](_0xca38('0x8'),attributes,{'tableName':_0xca38('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xca38('0xa')],'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 86feb44..6337342 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 _0x8f83=['info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8f83,0xd9));var _0x38f8=function(_0x5c9def,_0x2c85a0){_0x5c9def=_0x5c9def-0x0;var _0x3b01ed=_0x8f83[_0x5c9def];return _0x3b01ed;};'use strict';var _=require(_0x38f8('0x0'));var util=require(_0x38f8('0x1'));var moment=require('moment');var BPromise=require(_0x38f8('0x2'));var rs=require(_0x38f8('0x3'));var fs=require('fs');var Redis=require(_0x38f8('0x4'));var db=require(_0x38f8('0x5'))['db'];var utils=require(_0x38f8('0x6'));var logger=require(_0x38f8('0x7'))('rpc');var config=require(_0x38f8('0x8'));var jayson=require(_0x38f8('0x9'));var client=jayson[_0x38f8('0xa')][_0x38f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52df9a,_0x1ad8ae,_0x2b1b41){return new BPromise(function(_0x4bcd14,_0x45b864){return client[_0x38f8('0xc')](_0x52df9a,_0x2b1b41)['then'](function(_0x355af3){logger[_0x38f8('0xd')]('VtigerField,\x20%s,\x20%s',_0x1ad8ae,_0x38f8('0xe'));logger[_0x38f8('0xf')](_0x38f8('0x10'),_0x1ad8ae,_0x38f8('0xe'),JSON['stringify'](_0x355af3));if(_0x355af3[_0x38f8('0x11')]){if(_0x355af3['error'][_0x38f8('0x12')]===0x1f4){logger['error'](_0x38f8('0x13'),_0x1ad8ae,_0x355af3['error']['message']);return _0x45b864(_0x355af3['error'][_0x38f8('0x14')]);}logger['error'](_0x38f8('0x13'),_0x1ad8ae,_0x355af3[_0x38f8('0x11')][_0x38f8('0x14')]);return _0x4bcd14(_0x355af3[_0x38f8('0x11')][_0x38f8('0x14')]);}else{logger[_0x38f8('0xd')]('VtigerField,\x20%s,\x20%s',_0x1ad8ae,_0x38f8('0xe'));_0x4bcd14(_0x355af3[_0x38f8('0x15')][_0x38f8('0x14')]);}})[_0x38f8('0x16')](function(_0x3d9ad8){logger[_0x38f8('0x11')](_0x38f8('0x13'),_0x1ad8ae,_0x3d9ad8);_0x45b864(_0x3d9ad8);});});} \ No newline at end of file +var _0x2300=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x103d24,_0x33168f){var _0x503df4=function(_0x44c670){while(--_0x44c670){_0x103d24['push'](_0x103d24['shift']());}};_0x503df4(++_0x33168f);}(_0x2300,0xb1));var _0x0230=function(_0xbff93a,_0x2b55c7){_0xbff93a=_0xbff93a-0x0;var _0x592faa=_0x2300[_0xbff93a];return _0x592faa;};'use strict';var _=require(_0x0230('0x0'));var util=require(_0x0230('0x1'));var moment=require('moment');var BPromise=require(_0x0230('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0230('0x3'));var db=require(_0x0230('0x4'))['db'];var utils=require(_0x0230('0x5'));var logger=require(_0x0230('0x6'))(_0x0230('0x7'));var config=require(_0x0230('0x8'));var jayson=require(_0x0230('0x9'));var client=jayson[_0x0230('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b1f49,_0x3f6c25,_0x31bad6){return new BPromise(function(_0xa5d5c9,_0x5a6988){return client[_0x0230('0xb')](_0x4b1f49,_0x31bad6)[_0x0230('0xc')](function(_0x205237){logger[_0x0230('0xd')](_0x0230('0xe'),_0x3f6c25,'request\x20sent');logger[_0x0230('0xf')](_0x0230('0x10'),_0x3f6c25,_0x0230('0x11'),JSON['stringify'](_0x205237));if(_0x205237[_0x0230('0x12')]){if(_0x205237[_0x0230('0x12')][_0x0230('0x13')]===0x1f4){logger['error'](_0x0230('0xe'),_0x3f6c25,_0x205237['error'][_0x0230('0x14')]);return _0x5a6988(_0x205237[_0x0230('0x12')][_0x0230('0x14')]);}logger[_0x0230('0x12')](_0x0230('0xe'),_0x3f6c25,_0x205237[_0x0230('0x12')][_0x0230('0x14')]);return _0xa5d5c9(_0x205237['error']['message']);}else{logger[_0x0230('0xd')]('VtigerField,\x20%s,\x20%s',_0x3f6c25,'request\x20sent');_0xa5d5c9(_0x205237[_0x0230('0x15')]['message']);}})['catch'](function(_0x628cec){logger['error'](_0x0230('0xe'),_0x3f6c25,_0x628cec);_0x5a6988(_0x628cec);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 1bb1b0c..b81c514 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 _0x3c71=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3ab9de,_0xeafe0c){var _0x285663=function(_0x191036){while(--_0x191036){_0x3ab9de['push'](_0x3ab9de['shift']());}};_0x285663(++_0xeafe0c);}(_0x3c71,0x1db));var _0x13c7=function(_0x222334,_0x35f35d){_0x222334=_0x222334-0x0;var _0x3afa94=_0x3c71[_0x222334];return _0x3afa94;};'use strict';var multer=require(_0x13c7('0x0'));var util=require(_0x13c7('0x1'));var path=require(_0x13c7('0x2'));var timeout=require(_0x13c7('0x3'));var express=require('express');var router=express[_0x13c7('0x4')]();var fs_extra=require(_0x13c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x13c7('0x6'));var config=require(_0x13c7('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x13c7('0x8')]('/',auth[_0x13c7('0x9')](),controller[_0x13c7('0xa')]);router[_0x13c7('0x8')](_0x13c7('0xb'),auth[_0x13c7('0x9')](),controller[_0x13c7('0xc')]);router['get'](_0x13c7('0xd'),auth['isAuthenticated'](),controller[_0x13c7('0xe')]);router['get'](_0x13c7('0xf'),auth['isAuthenticated'](),controller[_0x13c7('0x10')]);router['post']('/',auth[_0x13c7('0x9')](),controller[_0x13c7('0x11')]);router[_0x13c7('0x12')](_0x13c7('0xd'),auth[_0x13c7('0x9')](),controller[_0x13c7('0x13')]);router[_0x13c7('0x14')](_0x13c7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x13c7('0x15')](_0x13c7('0xb'),auth[_0x13c7('0x9')](),controller['destroy']);module[_0x13c7('0x16')]=router; \ No newline at end of file +var _0xc308=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','put','update','delete','exports'];(function(_0x8e3a27,_0x150a94){var _0x446f44=function(_0x143a3a){while(--_0x143a3a){_0x8e3a27['push'](_0x8e3a27['shift']());}};_0x446f44(++_0x150a94);}(_0xc308,0x1b5));var _0x8c30=function(_0x26abc4,_0x52fbef){_0x26abc4=_0x26abc4-0x0;var _0xbfcce3=_0xc308[_0x26abc4];return _0xbfcce3;};'use strict';var multer=require(_0x8c30('0x0'));var util=require(_0x8c30('0x1'));var path=require(_0x8c30('0x2'));var timeout=require(_0x8c30('0x3'));var express=require(_0x8c30('0x4'));var router=express[_0x8c30('0x5')]();var fs_extra=require(_0x8c30('0x6'));var auth=require(_0x8c30('0x7'));var interaction=require(_0x8c30('0x8'));var config=require('../../config/environment');var controller=require(_0x8c30('0x9'));router[_0x8c30('0xa')]('/',auth[_0x8c30('0xb')](),controller[_0x8c30('0xc')]);router['get'](_0x8c30('0xd'),auth[_0x8c30('0xb')](),controller[_0x8c30('0xe')]);router[_0x8c30('0xa')](_0x8c30('0xf'),auth[_0x8c30('0xb')](),controller['getConfigurations']);router[_0x8c30('0xa')]('/:id/fields',auth[_0x8c30('0xb')](),controller[_0x8c30('0x10')]);router[_0x8c30('0x11')]('/',auth['isAuthenticated'](),controller[_0x8c30('0x12')]);router[_0x8c30('0x11')](_0x8c30('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8c30('0x13')]('/:id',auth[_0x8c30('0xb')](),controller[_0x8c30('0x14')]);router[_0x8c30('0x15')](_0x8c30('0xd'),auth[_0x8c30('0xb')](),controller['destroy']);module[_0x8c30('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 077a5ac..30fe129 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 _0xfdcd=['STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','exports'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdcd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdfdc('0x0')]={'name':{'type':Sequelize[_0xdfdc('0x1')]},'description':{'type':Sequelize[_0xdfdc('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xdfdc('0x2')},'password':{'type':Sequelize[_0xdfdc('0x1')]},'token':{'type':Sequelize[_0xdfdc('0x1')]},'remoteUri':{'type':Sequelize[_0xdfdc('0x1')],'unique':_0xdfdc('0x3')},'authType':{'type':Sequelize[_0xdfdc('0x4')](_0xdfdc('0x5'),_0xdfdc('0x6')),'defaultValue':_0xdfdc('0x5')},'serverUrl':{'type':Sequelize[_0xdfdc('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdc('0x4')](_0xdfdc('0x7'),_0xdfdc('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe0c1=['exports','STRING','username','password','ENUM','integrationTab','newTab','sequelize'];(function(_0x36f0d4,_0x59d034){var _0x4d3c56=function(_0x153bde){while(--_0x153bde){_0x36f0d4['push'](_0x36f0d4['shift']());}};_0x4d3c56(++_0x59d034);}(_0xe0c1,0x10f));var _0x1e0c=function(_0x2e7245,_0x4ba733){_0x2e7245=_0x2e7245-0x0;var _0x5cb48f=_0xe0c1[_0x2e7245];return _0x5cb48f;};'use strict';var Sequelize=require(_0x1e0c('0x0'));module[_0x1e0c('0x1')]={'name':{'type':Sequelize[_0x1e0c('0x2')]},'description':{'type':Sequelize[_0x1e0c('0x2')]},'username':{'type':Sequelize[_0x1e0c('0x2')],'unique':_0x1e0c('0x3')},'password':{'type':Sequelize[_0x1e0c('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':_0x1e0c('0x4')},'serverUrl':{'type':Sequelize[_0x1e0c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1e0c('0x5')](_0x1e0c('0x6'),_0x1e0c('0x7')),'defaultValue':_0x1e0c('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 106a13b..dd3e8b2 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 _0x5eb8=['sort','where','filter','merge','type','options','includeAll','findAll','catch','show','params','keys','length','include','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','title','position','system_field_options','custom_field_options','send','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x26ac27,_0x574b86){_0x26ac27=_0x26ac27-0x0;var _0x44a599=_0x5eb8[_0x26ac27];return _0x44a599;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];var integrations=require(_0x85eb('0x19'));function respondWithStatusCode(_0x2f42ba,_0x259f72){_0x259f72=_0x259f72||0xcc;return function(_0x4db167){if(_0x4db167){return _0x2f42ba['sendStatus'](_0x259f72);}return _0x2f42ba[_0x85eb('0x1a')](_0x259f72)['end']();};}function respondWithResult(_0x18ca53,_0x23a82a){_0x23a82a=_0x23a82a||0xc8;return function(_0x600a7f){if(_0x600a7f){return _0x18ca53[_0x85eb('0x1a')](_0x23a82a)[_0x85eb('0x1b')](_0x600a7f);}};}function respondWithFilteredResult(_0x49efdf,_0x2e5c0a){return function(_0x59237b){if(_0x59237b){var _0x17140b=typeof _0x2e5c0a[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x2e5c0a[_0x85eb('0x1e')]==='undefined';var _0x5c5cbb=_0x59237b['count'];var _0xe198ca=_0x17140b?0x0:_0x2e5c0a[_0x85eb('0x1c')];var _0x10cf2f=_0x17140b?_0x59237b[_0x85eb('0x1f')]:_0x2e5c0a[_0x85eb('0x1c')]+_0x2e5c0a[_0x85eb('0x1e')];var _0x5acd3d;if(_0x10cf2f>=_0x5c5cbb){_0x10cf2f=_0x5c5cbb;_0x5acd3d=0xc8;}else{_0x5acd3d=0xce;}_0x49efdf[_0x85eb('0x1a')](_0x5acd3d);return _0x49efdf[_0x85eb('0x20')](_0x85eb('0x21'),_0xe198ca+'-'+_0x10cf2f+'/'+_0x5c5cbb)['json'](_0x59237b);}return null;};}function patchUpdates(_0x4b4b38){return function(_0x48bd86){try{jsonpatch['apply'](_0x48bd86,_0x4b4b38,!![]);}catch(_0x244667){return BPromise[_0x85eb('0x22')](_0x244667);}return _0x48bd86[_0x85eb('0x23')]();};}function saveUpdates(_0x255ca7,_0x465c74){return function(_0x3fc6da){if(_0x3fc6da){return _0x3fc6da['update'](_0x255ca7)['then'](function(_0x5b48d9){return _0x5b48d9;});}return null;};}function removeEntity(_0x298e84,_0x1426c8){return function(_0x3f7a4d){if(_0x3f7a4d){return _0x3f7a4d[_0x85eb('0x24')]()[_0x85eb('0x25')](function(){_0x298e84[_0x85eb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39d3fe,_0x3453cd){return function(_0x4709ad){if(!_0x4709ad){_0x39d3fe[_0x85eb('0x26')](0x194);}return _0x4709ad;};}function handleError(_0x3e2326,_0x57a03c){_0x57a03c=_0x57a03c||0x1f4;return function(_0x2e5aa3){logger[_0x85eb('0x27')](_0x2e5aa3[_0x85eb('0x28')]);if(_0x2e5aa3[_0x85eb('0x29')]){delete _0x2e5aa3[_0x85eb('0x29')];}_0x3e2326[_0x85eb('0x1a')](_0x57a03c)['send'](_0x2e5aa3);};}exports['index']=function(_0x37515c,_0x585f2a){var _0xa9b14f={},_0x5255eb={},_0x4229e9={'count':0x0,'rows':[]};var _0x3570f7=_[_0x85eb('0x2a')](db[_0x85eb('0x2b')][_0x85eb('0x2c')],function(_0xf4ac13){return{'name':_0xf4ac13[_0x85eb('0x2d')],'type':_0xf4ac13['type'][_0x85eb('0x2e')]};});_0x5255eb[_0x85eb('0x2f')]=_['map'](_0x3570f7,_0x85eb('0x29'));_0x5255eb['query']=_['keys'](_0x37515c[_0x85eb('0x30')]);_0x5255eb[_0x85eb('0x31')]=_[_0x85eb('0x32')](_0x5255eb[_0x85eb('0x2f')],_0x5255eb[_0x85eb('0x30')]);_0xa9b14f[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x5255eb[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x37515c[_0x85eb('0x30')]['fields']));_0xa9b14f[_0x85eb('0x33')]=_0xa9b14f[_0x85eb('0x33')]['length']?_0xa9b14f['attributes']:_0x5255eb[_0x85eb('0x2f')];if(!_0x37515c[_0x85eb('0x30')][_0x85eb('0x35')](_0x85eb('0x36'))){_0xa9b14f[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x37515c[_0x85eb('0x30')][_0x85eb('0x1e')]);_0xa9b14f[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x37515c[_0x85eb('0x30')][_0x85eb('0x1c')]);}_0xa9b14f[_0x85eb('0x37')]=qs[_0x85eb('0x38')](_0x37515c['query'][_0x85eb('0x38')]);_0xa9b14f[_0x85eb('0x39')]=qs['filters'](_['pick'](_0x37515c[_0x85eb('0x30')],_0x5255eb[_0x85eb('0x31')]),_0x3570f7);if(_0x37515c['query'][_0x85eb('0x3a')]){_0xa9b14f['where']=_[_0x85eb('0x3b')](_0xa9b14f['where'],{'$or':_[_0x85eb('0x2a')](_0x3570f7,function(_0x5ce7e4){if(_0x5ce7e4[_0x85eb('0x3c')]!=='VIRTUAL'){var _0x38ab0f={};_0x38ab0f[_0x5ce7e4[_0x85eb('0x29')]]={'$like':'%'+_0x37515c['query'][_0x85eb('0x3a')]+'%'};return _0x38ab0f;}})});}_0xa9b14f=_['merge']({},_0xa9b14f,_0x37515c[_0x85eb('0x3d')]);var _0x331260={'where':_0xa9b14f['where']};return db[_0x85eb('0x2b')]['count'](_0x331260)['then'](function(_0x1b8a71){_0x4229e9['count']=_0x1b8a71;if(_0x37515c[_0x85eb('0x30')][_0x85eb('0x3e')]){_0xa9b14f['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x85eb('0x3f')](_0xa9b14f);})[_0x85eb('0x25')](function(_0x48160e){_0x4229e9['rows']=_0x48160e;return _0x4229e9;})[_0x85eb('0x25')](respondWithFilteredResult(_0x585f2a,_0xa9b14f))[_0x85eb('0x40')](handleError(_0x585f2a,null));};exports[_0x85eb('0x41')]=function(_0x202681,_0x3be961){var _0x5b7411={'raw':![],'where':{'id':_0x202681[_0x85eb('0x42')]['id']}},_0x5ccf8a={};_0x5ccf8a[_0x85eb('0x2f')]=_[_0x85eb('0x43')](db[_0x85eb('0x2b')][_0x85eb('0x2c')]);_0x5ccf8a[_0x85eb('0x30')]=_[_0x85eb('0x43')](_0x202681[_0x85eb('0x30')]);_0x5ccf8a['filters']=_[_0x85eb('0x32')](_0x5ccf8a[_0x85eb('0x2f')],_0x5ccf8a['query']);_0x5b7411[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x5ccf8a[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x202681[_0x85eb('0x30')][_0x85eb('0x34')]));_0x5b7411['attributes']=_0x5b7411[_0x85eb('0x33')][_0x85eb('0x44')]?_0x5b7411[_0x85eb('0x33')]:_0x5ccf8a[_0x85eb('0x2f')];if(_0x202681[_0x85eb('0x30')][_0x85eb('0x3e')]){_0x5b7411[_0x85eb('0x45')]=[{'all':!![]}];}_0x5b7411=_[_0x85eb('0x3b')]({},_0x5b7411,_0x202681['options']);return db[_0x85eb('0x2b')][_0x85eb('0x46')](_0x5b7411)[_0x85eb('0x25')](handleEntityNotFound(_0x3be961,null))[_0x85eb('0x25')](respondWithResult(_0x3be961,null))[_0x85eb('0x40')](handleError(_0x3be961,null));};exports[_0x85eb('0x47')]=function(_0x3c387a,_0x77fdc4){return db[_0x85eb('0x2b')][_0x85eb('0x47')](_0x3c387a[_0x85eb('0x48')],{})[_0x85eb('0x25')](respondWithResult(_0x77fdc4,0xc9))['catch'](handleError(_0x77fdc4,null));};exports[_0x85eb('0x49')]=function(_0x2c951b,_0x22d9d6){if(_0x2c951b['body']['id']){delete _0x2c951b[_0x85eb('0x48')]['id'];}return db[_0x85eb('0x2b')][_0x85eb('0x46')]({'where':{'id':_0x2c951b[_0x85eb('0x42')]['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x22d9d6,null))['then'](saveUpdates(_0x2c951b[_0x85eb('0x48')],null))[_0x85eb('0x25')](respondWithResult(_0x22d9d6,null))[_0x85eb('0x40')](handleError(_0x22d9d6,null));};exports['destroy']=function(_0xc5cb43,_0x4550fd){return db[_0x85eb('0x2b')]['find']({'where':{'id':_0xc5cb43['params']['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x4550fd,null))['then'](removeEntity(_0x4550fd,null))['catch'](handleError(_0x4550fd,null));};exports[_0x85eb('0x4a')]=function(_0x593723,_0x39316d,_0xfb0ac){var _0x4e3d96={};var _0x4abe5e={};var _0x27ce2a;var _0x249511;return db[_0x85eb('0x2b')][_0x85eb('0x4b')]({'where':{'id':_0x593723[_0x85eb('0x42')]['id']}})['then'](handleEntityNotFound(_0x39316d,null))[_0x85eb('0x25')](function(_0x30062e){if(_0x30062e){_0x27ce2a=_0x30062e;_0x4abe5e[_0x85eb('0x2f')]=_[_0x85eb('0x43')](db[_0x85eb('0x4c')]['rawAttributes']);_0x4abe5e[_0x85eb('0x30')]=_['keys'](_0x593723[_0x85eb('0x30')]);_0x4abe5e[_0x85eb('0x31')]=_['intersection'](_0x4abe5e[_0x85eb('0x2f')],_0x4abe5e[_0x85eb('0x30')]);_0x4e3d96[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x4abe5e[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x593723['query'][_0x85eb('0x34')]));_0x4e3d96['attributes']=_0x4e3d96[_0x85eb('0x33')][_0x85eb('0x44')]?_0x4e3d96['attributes']:_0x4abe5e[_0x85eb('0x2f')];_0x4e3d96[_0x85eb('0x37')]=qs['sort'](_0x593723[_0x85eb('0x30')]['sort']);_0x4e3d96[_0x85eb('0x39')]=qs[_0x85eb('0x31')](_[_0x85eb('0x4d')](_0x593723[_0x85eb('0x30')],_0x4abe5e[_0x85eb('0x31')]));if(_0x593723[_0x85eb('0x30')]['filter']){_0x4e3d96[_0x85eb('0x39')]=_[_0x85eb('0x3b')](_0x4e3d96[_0x85eb('0x39')],{'$or':_[_0x85eb('0x2a')](_0x4e3d96[_0x85eb('0x33')],function(_0x1529dd){var _0x2024df={};_0x2024df[_0x1529dd]={'$like':'%'+_0x593723[_0x85eb('0x30')][_0x85eb('0x3a')]+'%'};return _0x2024df;})});}_0x4e3d96=_[_0x85eb('0x3b')]({},_0x4e3d96,_0x593723[_0x85eb('0x3d')]);return _0x27ce2a['getConfigurations'](_0x4e3d96);}})[_0x85eb('0x25')](function(_0x21b873){if(_0x21b873){_0x249511=_0x21b873[_0x85eb('0x44')];if(!_0x593723[_0x85eb('0x30')][_0x85eb('0x35')](_0x85eb('0x36'))){_0x4e3d96['limit']=qs[_0x85eb('0x1e')](_0x593723['query'][_0x85eb('0x1e')]);_0x4e3d96[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x593723[_0x85eb('0x30')][_0x85eb('0x1c')]);}return _0x27ce2a['getConfigurations'](_0x4e3d96);}})[_0x85eb('0x25')](function(_0x143d65){if(_0x143d65){return _0x143d65?{'count':_0x249511,'rows':_0x143d65}:null;}})[_0x85eb('0x25')](respondWithResult(_0x39316d,null))[_0x85eb('0x40')](handleError(_0x39316d,null));};exports[_0x85eb('0x4e')]=function(_0x14cab8,_0x23fcf9,_0x5de716){if(_0x14cab8['body']['id']){delete _0x14cab8[_0x85eb('0x48')]['id'];}return db['ZendeskAccount'][_0x85eb('0x4b')]({'where':{'id':_0x14cab8[_0x85eb('0x42')]['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x23fcf9,null))[_0x85eb('0x25')](function(_0x259ee3){if(_0x259ee3){_0x14cab8['body'][_0x85eb('0x4f')]=_0x259ee3['id'];_0x14cab8[_0x85eb('0x48')][_0x85eb('0x50')]=integrations[_0x85eb('0x51')](_0x14cab8[_0x85eb('0x48')][_0x85eb('0x52')],_0x14cab8['body']['type']);_0x14cab8[_0x85eb('0x48')]['Descriptions']=integrations[_0x85eb('0x53')](_0x14cab8[_0x85eb('0x48')][_0x85eb('0x52')],_0x14cab8[_0x85eb('0x48')][_0x85eb('0x3c')]);return db[_0x85eb('0x4c')]['create'](_0x14cab8[_0x85eb('0x48')],{'include':[{'model':db[_0x85eb('0x54')],'as':_0x85eb('0x50')},{'model':db[_0x85eb('0x54')],'as':'Descriptions'}]});}return null;})[_0x85eb('0x25')](respondWithResult(_0x23fcf9,null))[_0x85eb('0x40')](handleError(_0x23fcf9,null));};exports[_0x85eb('0x55')]=function(_0x14bf0e,_0x5037c7,_0x459317){var _0x2e6734='';return db[_0x85eb('0x2b')][_0x85eb('0x4b')]({'where':{'id':_0x14bf0e[_0x85eb('0x42')]['id']},'attributes':['id',_0x85eb('0x56'),_0x85eb('0x57'),_0x85eb('0x58'),_0x85eb('0x59'),_0x85eb('0x5a')]})[_0x85eb('0x25')](handleEntityNotFound(_0x5037c7,null))[_0x85eb('0x25')](function(_0x1d9d3a){if(_0x1d9d3a){_0x2e6734=_0x1d9d3a[_0x85eb('0x5a')];var _0x2f2464=_0x2e6734[_0x85eb('0x5b')](-0x1);if(_0x2f2464==='/'){_0x2e6734=_0x2e6734[_0x85eb('0x5c')](0x0,_0x2e6734[_0x85eb('0x5d')](_0x2f2464));}var _0x106caa={'method':'GET','uri':util[_0x85eb('0x5e')]('%s/%s',_0x2e6734,_0x85eb('0x5f')),'json':!![]};switch(_0x1d9d3a[_0x85eb('0x59')]){case _0x85eb('0x57'):_0x106caa[_0x85eb('0x60')]={'Authorization':util[_0x85eb('0x5e')](_0x85eb('0x61'),new Buffer(util[_0x85eb('0x5e')](_0x85eb('0x62'),_0x1d9d3a[_0x85eb('0x56')],_0x1d9d3a['password']))[_0x85eb('0x63')](_0x85eb('0x64')))};break;case _0x85eb('0x58'):_0x106caa[_0x85eb('0x60')]={'Authorization':util[_0x85eb('0x5e')]('Basic\x20%s',new Buffer(util[_0x85eb('0x5e')]('%s/token:%s',_0x1d9d3a[_0x85eb('0x56')],_0x1d9d3a[_0x85eb('0x58')]))[_0x85eb('0x63')]('base64'))};break;default:throw new db[(_0x85eb('0x65'))][(_0x85eb('0x66'))](_0x85eb('0x67'));}return rp(_0x106caa);}})['then'](function(_0x588c72){if(_0x588c72){var _0x45a1ef=[_0x85eb('0x68'),_0x85eb('0x69'),_0x85eb('0x6a'),'assignee'];_[_0x85eb('0x6b')](_0x588c72['ticket_fields'],function(_0x11a3bd){return _0x45a1ef[_0x85eb('0x6c')](_0x11a3bd[_0x85eb('0x3c')]);});return{'count':_0x588c72[_0x85eb('0x5f')][_0x85eb('0x44')],'rows':_[_0x85eb('0x2a')](_0x588c72['ticket_fields'],function(_0x9a80a1){return{'id':_0x9a80a1['id'],'name':_0x9a80a1['position']>0x7?_0x9a80a1[_0x85eb('0x6d')]:_0x9a80a1[_0x85eb('0x3c')],'custom':_0x9a80a1[_0x85eb('0x6e')]>0x7?!![]:![],'options':_0x9a80a1[_0x85eb('0x6f')]?_0x9a80a1[_0x85eb('0x6f')]:_0x9a80a1[_0x85eb('0x70')]?_0x9a80a1[_0x85eb('0x70')]:[]};})};}})[_0x85eb('0x25')](respondWithResult(_0x5037c7,null))[_0x85eb('0x40')](function(_0x543146){var _0x3358c8=_0x14bf0e[_0x85eb('0x30')]['test']?0x1f4:_0x543146['statusCode']||0x1f4;logger[_0x85eb('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x85eb('0x55'),_0x3358c8,JSON['stringify'](_0x543146));delete _0x543146[_0x85eb('0x29')];if(_0x3358c8===0x191){_0x3358c8=0x190;}_0x5037c7['status'](_0x3358c8)[_0x85eb('0x71')](_0x14bf0e[_0x85eb('0x30')]['test']?{'message':_0x85eb('0x72'),'statusCode':_0x543146[_0x85eb('0x73')]}:_0x543146);});}; \ No newline at end of file +var _0x6e6c=['name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getConfigurations','ZendeskConfiguration','sort','addConfiguration','AccountId','channel','Descriptions','ZendeskField','Subjects','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','stack'];(function(_0x913c1d,_0x2afb77){var _0x4c15f9=function(_0x2e7cda){while(--_0x2e7cda){_0x913c1d['push'](_0x913c1d['shift']());}};_0x4c15f9(++_0x2afb77);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3a30ce,_0x314d0f){_0x314d0f=_0x314d0f||0xcc;return function(_0x33aea0){if(_0x33aea0){return _0x3a30ce[_0xc6e6('0x17')](_0x314d0f);}return _0x3a30ce['status'](_0x314d0f)[_0xc6e6('0x18')]();};}function respondWithResult(_0x2bfe7d,_0x13be73){_0x13be73=_0x13be73||0xc8;return function(_0x1b6ca9){if(_0x1b6ca9){return _0x2bfe7d[_0xc6e6('0x19')](_0x13be73)['json'](_0x1b6ca9);}};}function respondWithFilteredResult(_0x413cf8,_0x178b34){return function(_0x569474){if(_0x569474){var _0x2f11b0=typeof _0x178b34[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x178b34['limit']==='undefined';var _0x5867bf=_0x569474[_0xc6e6('0x1c')];var _0x554262=_0x2f11b0?0x0:_0x178b34[_0xc6e6('0x1a')];var _0x2069e4=_0x2f11b0?_0x569474[_0xc6e6('0x1c')]:_0x178b34[_0xc6e6('0x1a')]+_0x178b34[_0xc6e6('0x1d')];var _0x3a0d83;if(_0x2069e4>=_0x5867bf){_0x2069e4=_0x5867bf;_0x3a0d83=0xc8;}else{_0x3a0d83=0xce;}_0x413cf8[_0xc6e6('0x19')](_0x3a0d83);return _0x413cf8[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x554262+'-'+_0x2069e4+'/'+_0x5867bf)[_0xc6e6('0x20')](_0x569474);}return null;};}function patchUpdates(_0x4a36b6){return function(_0x428401){try{jsonpatch['apply'](_0x428401,_0x4a36b6,!![]);}catch(_0x1c34cc){return BPromise[_0xc6e6('0x21')](_0x1c34cc);}return _0x428401[_0xc6e6('0x22')]();};}function saveUpdates(_0x2f69f1,_0x4f1d68){return function(_0x35253d){if(_0x35253d){return _0x35253d[_0xc6e6('0x23')](_0x2f69f1)[_0xc6e6('0x24')](function(_0x36ebfa){return _0x36ebfa;});}return null;};}function removeEntity(_0x107561,_0x4c35ae){return function(_0x41fe96){if(_0x41fe96){return _0x41fe96['destroy']()[_0xc6e6('0x24')](function(){_0x107561[_0xc6e6('0x19')](0xcc)[_0xc6e6('0x18')]();});}};}function handleEntityNotFound(_0x64e1dc,_0x53a1bf){return function(_0x3ff8a4){if(!_0x3ff8a4){_0x64e1dc['sendStatus'](0x194);}return _0x3ff8a4;};}function handleError(_0x28577b,_0x534745){_0x534745=_0x534745||0x1f4;return function(_0x267c6a){logger[_0xc6e6('0x25')](_0x267c6a[_0xc6e6('0x26')]);if(_0x267c6a[_0xc6e6('0x27')]){delete _0x267c6a[_0xc6e6('0x27')];}_0x28577b['status'](_0x534745)[_0xc6e6('0x28')](_0x267c6a);};}exports[_0xc6e6('0x29')]=function(_0x166313,_0x1af05c){var _0x4d1284={},_0x34ae96={},_0x50b735={'count':0x0,'rows':[]};var _0x29411c=_[_0xc6e6('0x2a')](db[_0xc6e6('0x2b')][_0xc6e6('0x2c')],function(_0xd3b63){return{'name':_0xd3b63[_0xc6e6('0x2d')],'type':_0xd3b63[_0xc6e6('0x2e')][_0xc6e6('0x2f')]};});_0x34ae96[_0xc6e6('0x30')]=_[_0xc6e6('0x2a')](_0x29411c,_0xc6e6('0x27'));_0x34ae96[_0xc6e6('0x31')]=_[_0xc6e6('0x32')](_0x166313[_0xc6e6('0x31')]);_0x34ae96[_0xc6e6('0x33')]=_[_0xc6e6('0x34')](_0x34ae96[_0xc6e6('0x30')],_0x34ae96['query']);_0x4d1284[_0xc6e6('0x35')]=_[_0xc6e6('0x34')](_0x34ae96['model'],qs['fields'](_0x166313[_0xc6e6('0x31')][_0xc6e6('0x36')]));_0x4d1284[_0xc6e6('0x35')]=_0x4d1284[_0xc6e6('0x35')][_0xc6e6('0x37')]?_0x4d1284[_0xc6e6('0x35')]:_0x34ae96['model'];if(!_0x166313[_0xc6e6('0x31')][_0xc6e6('0x38')](_0xc6e6('0x39'))){_0x4d1284['limit']=qs['limit'](_0x166313[_0xc6e6('0x31')][_0xc6e6('0x1d')]);_0x4d1284[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0x166313['query']['offset']);}_0x4d1284[_0xc6e6('0x3a')]=qs['sort'](_0x166313[_0xc6e6('0x31')]['sort']);_0x4d1284[_0xc6e6('0x3b')]=qs[_0xc6e6('0x33')](_[_0xc6e6('0x3c')](_0x166313[_0xc6e6('0x31')],_0x34ae96['filters']),_0x29411c);if(_0x166313['query'][_0xc6e6('0x3d')]){_0x4d1284[_0xc6e6('0x3b')]=_[_0xc6e6('0x3e')](_0x4d1284[_0xc6e6('0x3b')],{'$or':_['map'](_0x29411c,function(_0x4cbdcf){if(_0x4cbdcf[_0xc6e6('0x2e')]!==_0xc6e6('0x3f')){var _0x3a9104={};_0x3a9104[_0x4cbdcf[_0xc6e6('0x27')]]={'$like':'%'+_0x166313['query'][_0xc6e6('0x3d')]+'%'};return _0x3a9104;}})});}_0x4d1284=_[_0xc6e6('0x3e')]({},_0x4d1284,_0x166313['options']);var _0x500b7e={'where':_0x4d1284[_0xc6e6('0x3b')]};return db['ZendeskAccount'][_0xc6e6('0x1c')](_0x500b7e)[_0xc6e6('0x24')](function(_0x53d313){_0x50b735[_0xc6e6('0x1c')]=_0x53d313;if(_0x166313['query'][_0xc6e6('0x40')]){_0x4d1284['include']=[{'all':!![]}];}return db[_0xc6e6('0x2b')][_0xc6e6('0x41')](_0x4d1284);})[_0xc6e6('0x24')](function(_0x2f7af9){_0x50b735[_0xc6e6('0x42')]=_0x2f7af9;return _0x50b735;})[_0xc6e6('0x24')](respondWithFilteredResult(_0x1af05c,_0x4d1284))[_0xc6e6('0x43')](handleError(_0x1af05c,null));};exports[_0xc6e6('0x44')]=function(_0x5ecf6c,_0x5722db){var _0x3e3da6={'raw':![],'where':{'id':_0x5ecf6c[_0xc6e6('0x45')]['id']}},_0x2b494f={};_0x2b494f[_0xc6e6('0x30')]=_['keys'](db[_0xc6e6('0x2b')][_0xc6e6('0x2c')]);_0x2b494f[_0xc6e6('0x31')]=_[_0xc6e6('0x32')](_0x5ecf6c['query']);_0x2b494f[_0xc6e6('0x33')]=_[_0xc6e6('0x34')](_0x2b494f[_0xc6e6('0x30')],_0x2b494f[_0xc6e6('0x31')]);_0x3e3da6[_0xc6e6('0x35')]=_['intersection'](_0x2b494f[_0xc6e6('0x30')],qs['fields'](_0x5ecf6c[_0xc6e6('0x31')]['fields']));_0x3e3da6[_0xc6e6('0x35')]=_0x3e3da6[_0xc6e6('0x35')][_0xc6e6('0x37')]?_0x3e3da6[_0xc6e6('0x35')]:_0x2b494f[_0xc6e6('0x30')];if(_0x5ecf6c[_0xc6e6('0x31')][_0xc6e6('0x40')]){_0x3e3da6[_0xc6e6('0x46')]=[{'all':!![]}];}_0x3e3da6=_['merge']({},_0x3e3da6,_0x5ecf6c[_0xc6e6('0x47')]);return db[_0xc6e6('0x2b')][_0xc6e6('0x48')](_0x3e3da6)['then'](handleEntityNotFound(_0x5722db,null))[_0xc6e6('0x24')](respondWithResult(_0x5722db,null))[_0xc6e6('0x43')](handleError(_0x5722db,null));};exports[_0xc6e6('0x49')]=function(_0x42ed90,_0x7ba471){return db[_0xc6e6('0x2b')][_0xc6e6('0x49')](_0x42ed90[_0xc6e6('0x4a')],{})[_0xc6e6('0x24')](respondWithResult(_0x7ba471,0xc9))[_0xc6e6('0x43')](handleError(_0x7ba471,null));};exports[_0xc6e6('0x23')]=function(_0x470167,_0x3e0117){if(_0x470167[_0xc6e6('0x4a')]['id']){delete _0x470167['body']['id'];}return db[_0xc6e6('0x2b')]['find']({'where':{'id':_0x470167[_0xc6e6('0x45')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3e0117,null))['then'](saveUpdates(_0x470167['body'],null))['then'](respondWithResult(_0x3e0117,null))['catch'](handleError(_0x3e0117,null));};exports['destroy']=function(_0x3edc16,_0x40bbe9){return db[_0xc6e6('0x2b')][_0xc6e6('0x48')]({'where':{'id':_0x3edc16[_0xc6e6('0x45')]['id']}})['then'](handleEntityNotFound(_0x40bbe9,null))['then'](removeEntity(_0x40bbe9,null))[_0xc6e6('0x43')](handleError(_0x40bbe9,null));};exports[_0xc6e6('0x4b')]=function(_0x1aa872,_0x48ba2e,_0x577840){var _0x120a00={};var _0x467e9b={};var _0x286dc1;var _0x286dcf;return db[_0xc6e6('0x2b')]['findOne']({'where':{'id':_0x1aa872[_0xc6e6('0x45')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x48ba2e,null))[_0xc6e6('0x24')](function(_0x5113e3){if(_0x5113e3){_0x286dc1=_0x5113e3;_0x467e9b[_0xc6e6('0x30')]=_[_0xc6e6('0x32')](db[_0xc6e6('0x4c')][_0xc6e6('0x2c')]);_0x467e9b[_0xc6e6('0x31')]=_['keys'](_0x1aa872[_0xc6e6('0x31')]);_0x467e9b[_0xc6e6('0x33')]=_[_0xc6e6('0x34')](_0x467e9b[_0xc6e6('0x30')],_0x467e9b[_0xc6e6('0x31')]);_0x120a00['attributes']=_['intersection'](_0x467e9b['model'],qs[_0xc6e6('0x36')](_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x36')]));_0x120a00[_0xc6e6('0x35')]=_0x120a00[_0xc6e6('0x35')][_0xc6e6('0x37')]?_0x120a00['attributes']:_0x467e9b[_0xc6e6('0x30')];_0x120a00['order']=qs[_0xc6e6('0x4d')](_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x4d')]);_0x120a00['where']=qs[_0xc6e6('0x33')](_['pick'](_0x1aa872[_0xc6e6('0x31')],_0x467e9b['filters']));if(_0x1aa872['query'][_0xc6e6('0x3d')]){_0x120a00['where']=_['merge'](_0x120a00[_0xc6e6('0x3b')],{'$or':_[_0xc6e6('0x2a')](_0x120a00[_0xc6e6('0x35')],function(_0x20c4cf){var _0x414bc4={};_0x414bc4[_0x20c4cf]={'$like':'%'+_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x3d')]+'%'};return _0x414bc4;})});}_0x120a00=_[_0xc6e6('0x3e')]({},_0x120a00,_0x1aa872['options']);return _0x286dc1[_0xc6e6('0x4b')](_0x120a00);}})[_0xc6e6('0x24')](function(_0x35b43f){if(_0x35b43f){_0x286dcf=_0x35b43f[_0xc6e6('0x37')];if(!_0x1aa872['query'][_0xc6e6('0x38')](_0xc6e6('0x39'))){_0x120a00[_0xc6e6('0x1d')]=qs['limit'](_0x1aa872['query'][_0xc6e6('0x1d')]);_0x120a00['offset']=qs['offset'](_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x1a')]);}return _0x286dc1[_0xc6e6('0x4b')](_0x120a00);}})[_0xc6e6('0x24')](function(_0x269f63){if(_0x269f63){return _0x269f63?{'count':_0x286dcf,'rows':_0x269f63}:null;}})[_0xc6e6('0x24')](respondWithResult(_0x48ba2e,null))[_0xc6e6('0x43')](handleError(_0x48ba2e,null));};exports[_0xc6e6('0x4e')]=function(_0x8bfc70,_0x1956be,_0x15404a){if(_0x8bfc70['body']['id']){delete _0x8bfc70['body']['id'];}return db[_0xc6e6('0x2b')]['findOne']({'where':{'id':_0x8bfc70['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x1956be,null))[_0xc6e6('0x24')](function(_0x27c5f0){if(_0x27c5f0){_0x8bfc70['body'][_0xc6e6('0x4f')]=_0x27c5f0['id'];_0x8bfc70[_0xc6e6('0x4a')]['Subjects']=integrations['getSubjects'](_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x50')],_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x2e')]);_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x51')]=integrations['getDescriptions'](_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x50')],_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x2e')]);return db[_0xc6e6('0x4c')]['create'](_0x8bfc70[_0xc6e6('0x4a')],{'include':[{'model':db[_0xc6e6('0x52')],'as':_0xc6e6('0x53')},{'model':db[_0xc6e6('0x52')],'as':_0xc6e6('0x51')}]});}return null;})[_0xc6e6('0x24')](respondWithResult(_0x1956be,null))['catch'](handleError(_0x1956be,null));};exports[_0xc6e6('0x54')]=function(_0x4c4985,_0x46c3df,_0x5c2cfc){var _0x55cec5='';return db[_0xc6e6('0x2b')]['findOne']({'where':{'id':_0x4c4985[_0xc6e6('0x45')]['id']},'attributes':['id',_0xc6e6('0x55'),_0xc6e6('0x56'),_0xc6e6('0x57'),_0xc6e6('0x58'),'remoteUri']})[_0xc6e6('0x24')](handleEntityNotFound(_0x46c3df,null))['then'](function(_0x4bdac6){if(_0x4bdac6){_0x55cec5=_0x4bdac6[_0xc6e6('0x59')];var _0xc38c57=_0x55cec5[_0xc6e6('0x5a')](-0x1);if(_0xc38c57==='/'){_0x55cec5=_0x55cec5['substring'](0x0,_0x55cec5[_0xc6e6('0x5b')](_0xc38c57));}var _0x4ec143={'method':'GET','uri':util[_0xc6e6('0x5c')]('%s/%s',_0x55cec5,_0xc6e6('0x5d')),'json':!![]};switch(_0x4bdac6[_0xc6e6('0x58')]){case _0xc6e6('0x56'):_0x4ec143[_0xc6e6('0x5e')]={'Authorization':util['format'](_0xc6e6('0x5f'),new Buffer(util[_0xc6e6('0x5c')](_0xc6e6('0x60'),_0x4bdac6[_0xc6e6('0x55')],_0x4bdac6[_0xc6e6('0x56')]))['toString'](_0xc6e6('0x61')))};break;case _0xc6e6('0x57'):_0x4ec143[_0xc6e6('0x5e')]={'Authorization':util[_0xc6e6('0x5c')]('Basic\x20%s',new Buffer(util['format'](_0xc6e6('0x62'),_0x4bdac6[_0xc6e6('0x55')],_0x4bdac6[_0xc6e6('0x57')]))[_0xc6e6('0x63')](_0xc6e6('0x61')))};break;default:throw new db[(_0xc6e6('0x64'))][(_0xc6e6('0x65'))](_0xc6e6('0x66'));}return rp(_0x4ec143);}})[_0xc6e6('0x24')](function(_0x4bbe4c){if(_0x4bbe4c){var _0x506679=[_0xc6e6('0x67'),'description',_0xc6e6('0x68'),_0xc6e6('0x69')];_[_0xc6e6('0x6a')](_0x4bbe4c['ticket_fields'],function(_0x5b0c3b){return _0x506679[_0xc6e6('0x6b')](_0x5b0c3b['type']);});return{'count':_0x4bbe4c[_0xc6e6('0x5d')]['length'],'rows':_[_0xc6e6('0x2a')](_0x4bbe4c[_0xc6e6('0x5d')],function(_0x5d867e){return{'id':_0x5d867e['id'],'name':_0x5d867e[_0xc6e6('0x6c')]>0x7?_0x5d867e[_0xc6e6('0x6d')]:_0x5d867e[_0xc6e6('0x2e')],'custom':_0x5d867e['position']>0x7?!![]:![],'options':_0x5d867e[_0xc6e6('0x6e')]?_0x5d867e[_0xc6e6('0x6e')]:_0x5d867e[_0xc6e6('0x6f')]?_0x5d867e['custom_field_options']:[]};})};}})[_0xc6e6('0x24')](respondWithResult(_0x46c3df,null))[_0xc6e6('0x43')](function(_0x4e7b05){var _0x4e0add=_0x4c4985['query'][_0xc6e6('0x70')]?0x1f4:_0x4e7b05[_0xc6e6('0x71')]||0x1f4;logger[_0xc6e6('0x25')](_0xc6e6('0x72'),_0xc6e6('0x54'),_0x4e0add,JSON[_0xc6e6('0x73')](_0x4e7b05));delete _0x4e7b05['name'];if(_0x4e0add===0x191){_0x4e0add=0x190;}_0x46c3df[_0xc6e6('0x19')](_0x4e0add)['send'](_0x4c4985[_0xc6e6('0x31')][_0xc6e6('0x70')]?{'message':_0xc6e6('0x74'),'statusCode':_0x4e7b05['statusCode']}:_0x4e7b05);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b73e4d7..84cf652 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 _0x03e7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x03e7,0x1d2));var _0x703e=function(_0x26db6f,_0xf74ea9){_0x26db6f=_0x26db6f-0x0;var _0x3e0a51=_0x03e7[_0x26db6f];return _0x3e0a51;};'use strict';var _=require(_0x703e('0x0'));var util=require(_0x703e('0x1'));var logger=require(_0x703e('0x2'))(_0x703e('0x3'));var moment=require(_0x703e('0x4'));var BPromise=require(_0x703e('0x5'));var rp=require(_0x703e('0x6'));var fs=require('fs');var path=require(_0x703e('0x7'));var rimraf=require(_0x703e('0x8'));var config=require(_0x703e('0x9'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xa2d05a,_0x237a6a){return _0xa2d05a[_0x703e('0xa')](_0x703e('0xb'),attributes,{'tableName':_0x703e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x520b=['moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x163aab,_0x4fcccc){var _0xc835b=function(_0x1b8881){while(--_0x1b8881){_0x163aab['push'](_0x163aab['shift']());}};_0xc835b(++_0x4fcccc);}(_0x520b,0x1d0));var _0xb520=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x520b[_0x3e6729];return _0x535bcd;};'use strict';var _=require(_0xb520('0x0'));var util=require(_0xb520('0x1'));var logger=require(_0xb520('0x2'))(_0xb520('0x3'));var moment=require(_0xb520('0x4'));var BPromise=require('bluebird');var rp=require(_0xb520('0x5'));var fs=require('fs');var path=require(_0xb520('0x6'));var rimraf=require(_0xb520('0x7'));var config=require(_0xb520('0x8'));var attributes=require(_0xb520('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xb520('0xa')]=function(_0x132bb9,_0x37542a){return _0x132bb9['define'](_0xb520('0xb'),attributes,{'tableName':_0xb520('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index a6ab6af..d73513a 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 _0x30b6=['../../config/environment','client','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetZendeskAccount','findAll','options','where','attributes','include','map','model','then','ShowZendeskAccount','find','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x36370d,_0x53e095){var _0x5ae8e5=function(_0x4aec84){while(--_0x4aec84){_0x36370d['push'](_0x36370d['shift']());}};_0x5ae8e5(++_0x53e095);}(_0x30b6,0x16f));var _0x630b=function(_0x499099,_0x4139dd){_0x499099=_0x499099-0x0;var _0x2c6bd4=_0x30b6[_0x499099];return _0x2c6bd4;};'use strict';var _=require(_0x630b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x630b('0x1'));var fs=require('fs');var Redis=require(_0x630b('0x2'));var db=require(_0x630b('0x3'))['db'];var utils=require(_0x630b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x630b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x630b('0x6')][_0x630b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x211f37,_0x2212e0,_0x1aa7d4){return new BPromise(function(_0x4bc005,_0x461c32){return client[_0x630b('0x8')](_0x211f37,_0x1aa7d4)['then'](function(_0x59ed2d){logger['info'](_0x630b('0x9'),_0x2212e0,_0x630b('0xa'));logger[_0x630b('0xb')](_0x630b('0xc'),_0x2212e0,'request\x20sent',JSON[_0x630b('0xd')](_0x59ed2d));if(_0x59ed2d[_0x630b('0xe')]){if(_0x59ed2d[_0x630b('0xe')]['code']===0x1f4){logger[_0x630b('0xe')](_0x630b('0x9'),_0x2212e0,_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);return _0x461c32(_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);}logger['error'](_0x630b('0x9'),_0x2212e0,_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);return _0x4bc005(_0x59ed2d[_0x630b('0xe')][_0x630b('0xf')]);}else{logger[_0x630b('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x2212e0,_0x630b('0xa'));_0x4bc005(_0x59ed2d[_0x630b('0x11')]['message']);}})[_0x630b('0x12')](function(_0x557a76){logger[_0x630b('0xe')](_0x630b('0x9'),_0x2212e0,_0x557a76);_0x461c32(_0x557a76);});});}exports[_0x630b('0x13')]=function(_0x4745dc){var _0x3a5fa4=this;return new Promise(function(_0x524525,_0x5480ca){return db['ZendeskAccount'][_0x630b('0x14')]({'raw':_0x4745dc[_0x630b('0x15')]?_0x4745dc['options']['raw']===undefined?!![]:![]:!![],'where':_0x4745dc['options']?_0x4745dc[_0x630b('0x15')][_0x630b('0x16')]||null:null,'attributes':_0x4745dc[_0x630b('0x15')]?_0x4745dc[_0x630b('0x15')][_0x630b('0x17')]||null:null,'limit':_0x4745dc[_0x630b('0x15')]?_0x4745dc[_0x630b('0x15')]['limit']||null:null,'include':_0x4745dc['options']?_0x4745dc[_0x630b('0x15')][_0x630b('0x18')]?_[_0x630b('0x19')](_0x4745dc['options'][_0x630b('0x18')],function(_0x1a8cde){return{'model':db[_0x1a8cde[_0x630b('0x1a')]],'as':_0x1a8cde['as'],'attributes':_0x1a8cde[_0x630b('0x17')],'include':_0x1a8cde[_0x630b('0x18')]?_['map'](_0x1a8cde['include'],function(_0x2f4221){return{'model':db[_0x2f4221[_0x630b('0x1a')]],'as':_0x2f4221['as'],'attributes':_0x2f4221[_0x630b('0x17')],'include':_0x2f4221[_0x630b('0x18')]?_[_0x630b('0x19')](_0x2f4221['include'],function(_0x4530cf){return{'model':db[_0x4530cf[_0x630b('0x1a')]],'as':_0x4530cf['as'],'attributes':_0x4530cf[_0x630b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x630b('0x1b')](function(_0x9c403a){logger['info'](_0x630b('0x13'),_0x4745dc);logger[_0x630b('0xb')]('GetZendeskAccount',_0x4745dc,JSON[_0x630b('0xd')](_0x9c403a));_0x524525(_0x9c403a);})[_0x630b('0x12')](function(_0x3bdbd3){logger[_0x630b('0xe')]('GetZendeskAccount',_0x3bdbd3[_0x630b('0xf')],_0x4745dc);_0x5480ca(_0x3a5fa4[_0x630b('0xe')](0x1f4,_0x3bdbd3[_0x630b('0xf')]));});});};exports[_0x630b('0x1c')]=function(_0x344e90){var _0x579417=this;return new Promise(function(_0x40184d,_0x22756c){return db['ZendeskAccount'][_0x630b('0x1d')]({'raw':_0x344e90[_0x630b('0x15')]?_0x344e90[_0x630b('0x15')][_0x630b('0x1e')]===undefined?!![]:![]:!![],'where':_0x344e90['options']?_0x344e90[_0x630b('0x15')][_0x630b('0x16')]||null:null,'attributes':_0x344e90[_0x630b('0x15')]?_0x344e90[_0x630b('0x15')]['attributes']||null:null,'include':_0x344e90['options']?_0x344e90[_0x630b('0x15')][_0x630b('0x18')]?_[_0x630b('0x19')](_0x344e90[_0x630b('0x15')][_0x630b('0x18')],function(_0x38c39e){return{'model':db[_0x38c39e[_0x630b('0x1a')]],'as':_0x38c39e['as'],'attributes':_0x38c39e[_0x630b('0x17')],'include':_0x38c39e[_0x630b('0x18')]?_[_0x630b('0x19')](_0x38c39e[_0x630b('0x18')],function(_0x555551){return{'model':db[_0x555551[_0x630b('0x1a')]],'as':_0x555551['as'],'attributes':_0x555551[_0x630b('0x17')],'include':_0x555551[_0x630b('0x18')]?_[_0x630b('0x19')](_0x555551['include'],function(_0x4a5f4a){return{'model':db[_0x4a5f4a[_0x630b('0x1a')]],'as':_0x4a5f4a['as'],'attributes':_0x4a5f4a[_0x630b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x630b('0x1b')](function(_0x1afafd){logger['info'](_0x630b('0x1c'),_0x344e90);logger[_0x630b('0xb')](_0x630b('0x1c'),_0x344e90,JSON['stringify'](_0x1afafd));_0x40184d(_0x1afafd);})[_0x630b('0x12')](function(_0x29fef3){logger['error'](_0x630b('0x1c'),_0x29fef3[_0x630b('0xf')],_0x344e90);_0x22756c(_0x579417[_0x630b('0xe')](0x1f4,_0x29fef3['message']));});});}; \ No newline at end of file +var _0xcdfe=['http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ZendeskAccount','find','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xcdfe,0xae));var _0xecdf=function(_0x17d68b,_0x193d44){_0x17d68b=_0x17d68b-0x0;var _0x981397=_0xcdfe[_0x17d68b];return _0x981397;};'use strict';var _=require(_0xecdf('0x0'));var util=require(_0xecdf('0x1'));var moment=require('moment');var BPromise=require(_0xecdf('0x2'));var rs=require(_0xecdf('0x3'));var fs=require('fs');var Redis=require(_0xecdf('0x4'));var db=require(_0xecdf('0x5'))['db'];var utils=require(_0xecdf('0x6'));var logger=require(_0xecdf('0x7'))('rpc');var config=require(_0xecdf('0x8'));var jayson=require(_0xecdf('0x9'));var client=jayson[_0xecdf('0xa')][_0xecdf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2324de,_0x2527aa,_0x34ae9f){return new BPromise(function(_0x17d4c6,_0x32da12){return client[_0xecdf('0xc')](_0x2324de,_0x34ae9f)[_0xecdf('0xd')](function(_0x382f9c){logger[_0xecdf('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x2527aa,_0xecdf('0xf'));logger[_0xecdf('0x10')](_0xecdf('0x11'),_0x2527aa,'request\x20sent',JSON[_0xecdf('0x12')](_0x382f9c));if(_0x382f9c[_0xecdf('0x13')]){if(_0x382f9c[_0xecdf('0x13')][_0xecdf('0x14')]===0x1f4){logger[_0xecdf('0x13')](_0xecdf('0x15'),_0x2527aa,_0x382f9c[_0xecdf('0x13')][_0xecdf('0x16')]);return _0x32da12(_0x382f9c['error']['message']);}logger[_0xecdf('0x13')](_0xecdf('0x15'),_0x2527aa,_0x382f9c[_0xecdf('0x13')][_0xecdf('0x16')]);return _0x17d4c6(_0x382f9c['error'][_0xecdf('0x16')]);}else{logger[_0xecdf('0xe')](_0xecdf('0x15'),_0x2527aa,_0xecdf('0xf'));_0x17d4c6(_0x382f9c['result']['message']);}})['catch'](function(_0xc6605){logger['error'](_0xecdf('0x15'),_0x2527aa,_0xc6605);_0x32da12(_0xc6605);});});}exports[_0xecdf('0x17')]=function(_0x497274){var _0x4c0858=this;return new Promise(function(_0x101ebb,_0x3b10e7){return db['ZendeskAccount'][_0xecdf('0x18')]({'raw':_0x497274[_0xecdf('0x19')]?_0x497274[_0xecdf('0x19')][_0xecdf('0x1a')]===undefined?!![]:![]:!![],'where':_0x497274[_0xecdf('0x19')]?_0x497274[_0xecdf('0x19')][_0xecdf('0x1b')]||null:null,'attributes':_0x497274[_0xecdf('0x19')]?_0x497274['options'][_0xecdf('0x1c')]||null:null,'limit':_0x497274[_0xecdf('0x19')]?_0x497274[_0xecdf('0x19')][_0xecdf('0x1d')]||null:null,'include':_0x497274['options']?_0x497274[_0xecdf('0x19')][_0xecdf('0x1e')]?_[_0xecdf('0x1f')](_0x497274['options'][_0xecdf('0x1e')],function(_0x5ac94b){return{'model':db[_0x5ac94b[_0xecdf('0x20')]],'as':_0x5ac94b['as'],'attributes':_0x5ac94b[_0xecdf('0x1c')],'include':_0x5ac94b['include']?_[_0xecdf('0x1f')](_0x5ac94b['include'],function(_0x31de83){return{'model':db[_0x31de83[_0xecdf('0x20')]],'as':_0x31de83['as'],'attributes':_0x31de83['attributes'],'include':_0x31de83[_0xecdf('0x1e')]?_[_0xecdf('0x1f')](_0x31de83[_0xecdf('0x1e')],function(_0x48a096){return{'model':db[_0x48a096[_0xecdf('0x20')]],'as':_0x48a096['as'],'attributes':_0x48a096[_0xecdf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xecdf('0xd')](function(_0xe88fee){logger[_0xecdf('0xe')](_0xecdf('0x17'),_0x497274);logger[_0xecdf('0x10')](_0xecdf('0x17'),_0x497274,JSON[_0xecdf('0x12')](_0xe88fee));_0x101ebb(_0xe88fee);})[_0xecdf('0x21')](function(_0x213fcf){logger[_0xecdf('0x13')](_0xecdf('0x17'),_0x213fcf['message'],_0x497274);_0x3b10e7(_0x4c0858['error'](0x1f4,_0x213fcf['message']));});});};exports['ShowZendeskAccount']=function(_0x1dfdb2){var _0x1346d9=this;return new Promise(function(_0x14af00,_0x36b3ea){return db[_0xecdf('0x22')][_0xecdf('0x23')]({'raw':_0x1dfdb2[_0xecdf('0x19')]?_0x1dfdb2[_0xecdf('0x19')][_0xecdf('0x1a')]===undefined?!![]:![]:!![],'where':_0x1dfdb2[_0xecdf('0x19')]?_0x1dfdb2[_0xecdf('0x19')][_0xecdf('0x1b')]||null:null,'attributes':_0x1dfdb2[_0xecdf('0x19')]?_0x1dfdb2[_0xecdf('0x19')][_0xecdf('0x1c')]||null:null,'include':_0x1dfdb2[_0xecdf('0x19')]?_0x1dfdb2['options'][_0xecdf('0x1e')]?_[_0xecdf('0x1f')](_0x1dfdb2['options']['include'],function(_0x15fe52){return{'model':db[_0x15fe52[_0xecdf('0x20')]],'as':_0x15fe52['as'],'attributes':_0x15fe52[_0xecdf('0x1c')],'include':_0x15fe52['include']?_[_0xecdf('0x1f')](_0x15fe52['include'],function(_0x2d8c47){return{'model':db[_0x2d8c47[_0xecdf('0x20')]],'as':_0x2d8c47['as'],'attributes':_0x2d8c47[_0xecdf('0x1c')],'include':_0x2d8c47[_0xecdf('0x1e')]?_[_0xecdf('0x1f')](_0x2d8c47[_0xecdf('0x1e')],function(_0x2d0148){return{'model':db[_0x2d0148[_0xecdf('0x20')]],'as':_0x2d0148['as'],'attributes':_0x2d0148[_0xecdf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xecdf('0xd')](function(_0x1ada02){logger['info'](_0xecdf('0x24'),_0x1dfdb2);logger[_0xecdf('0x10')](_0xecdf('0x24'),_0x1dfdb2,JSON[_0xecdf('0x12')](_0x1ada02));_0x14af00(_0x1ada02);})[_0xecdf('0x21')](function(_0x57afb0){logger[_0xecdf('0x13')]('ShowZendeskAccount',_0x57afb0['message'],_0x1dfdb2);_0x36b3ea(_0x1346d9['error'](0x1f4,_0x57afb0[_0xecdf('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index b3375d1..06df0b3 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 _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1cb96c,_0x3a7639){var _0x153ab9=function(_0x206f18){while(--_0x206f18){_0x1cb96c['push'](_0x1cb96c['shift']());}};_0x153ab9(++_0x3a7639);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0xe5b5[_0x5528c3];return _0x47ec1b;};'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('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file +var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x1dd319,_0x362f16){var _0x57fb79=function(_0x3e63a7){while(--_0x3e63a7){_0x1dd319['push'](_0x1dd319['shift']());}};_0x57fb79(++_0x362f16);}(_0xa571,0x107));var _0x1a57=function(_0x540471,_0x40cd73){_0x540471=_0x540471-0x0;var _0x394d2d=_0xa571[_0x540471];return _0x394d2d;};'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('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9d84866..1f189ff 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 _0x7864=['exports','STRING','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7864,0xb6));var _0x4786=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x7864[_0x1cb18a];return _0x22442e;};'use strict';var Sequelize=require(_0x4786('0x0'));module[_0x4786('0x1')]={'name':{'type':Sequelize[_0x4786('0x2')]},'description':{'type':Sequelize[_0x4786('0x2')]}}; \ No newline at end of file +var _0x682e=['sequelize','STRING'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x682e,0xf0));var _0xe682=function(_0x48bab1,_0x4fb5a1){_0x48bab1=_0x48bab1-0x0;var _0x4cc592=_0x682e[_0x48bab1];return _0x4cc592;};'use strict';var Sequelize=require(_0xe682('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe682('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 6d2c1bc..0a6ad4e 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 _0x4e58=['getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','destroy','then','end','stack','name','index','map','ZendeskConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','getFields','findOne','ZendeskField','getSubjects'];(function(_0x12de60,_0x3fe1a6){var _0x173631=function(_0x5d7be8){while(--_0x5d7be8){_0x12de60['push'](_0x12de60['shift']());}};_0x173631(++_0x3fe1a6);}(_0x4e58,0xa2));var _0x84e5=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x4e58[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require(_0x84e5('0x0'));var rimraf=require(_0x84e5('0x1'));var zipdir=require(_0x84e5('0x2'));var jsonpatch=require(_0x84e5('0x3'));var rp=require(_0x84e5('0x4'));var moment=require(_0x84e5('0x5'));var BPromise=require(_0x84e5('0x6'));var Mustache=require(_0x84e5('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x84e5('0x8'));var fs=require('fs');var fs_extra=require(_0x84e5('0x9'));var _=require(_0x84e5('0xa'));var squel=require('squel');var crypto=require(_0x84e5('0xb'));var jsforce=require(_0x84e5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x84e5('0xd'));var Redis=require(_0x84e5('0xe'));var authService=require(_0x84e5('0xf'));var qs=require(_0x84e5('0x10'));var as=require(_0x84e5('0x11'));var hardwareService=require(_0x84e5('0x12'));var logger=require(_0x84e5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x84e5('0x14'));var licenseUtil=require(_0x84e5('0x15'));var db=require(_0x84e5('0x16'))['db'];function respondWithStatusCode(_0x378ac6,_0x48817f){_0x48817f=_0x48817f||0xcc;return function(_0x3d99e9){if(_0x3d99e9){return _0x378ac6[_0x84e5('0x17')](_0x48817f);}return _0x378ac6[_0x84e5('0x18')](_0x48817f)['end']();};}function respondWithResult(_0x5cb232,_0x43bbcd){_0x43bbcd=_0x43bbcd||0xc8;return function(_0xe5a0ae){if(_0xe5a0ae){return _0x5cb232['status'](_0x43bbcd)[_0x84e5('0x19')](_0xe5a0ae);}};}function respondWithFilteredResult(_0x539f37,_0x30f0c6){return function(_0x58058a){if(_0x58058a){var _0x1253b2=typeof _0x30f0c6[_0x84e5('0x1a')]===_0x84e5('0x1b')&&typeof _0x30f0c6[_0x84e5('0x1c')]===_0x84e5('0x1b');var _0x306bc6=_0x58058a[_0x84e5('0x1d')];var _0x350fab=_0x1253b2?0x0:_0x30f0c6[_0x84e5('0x1a')];var _0x5e7fb9=_0x1253b2?_0x58058a[_0x84e5('0x1d')]:_0x30f0c6[_0x84e5('0x1a')]+_0x30f0c6[_0x84e5('0x1c')];var _0x345f87;if(_0x5e7fb9>=_0x306bc6){_0x5e7fb9=_0x306bc6;_0x345f87=0xc8;}else{_0x345f87=0xce;}_0x539f37[_0x84e5('0x18')](_0x345f87);return _0x539f37['set']('Content-Range',_0x350fab+'-'+_0x5e7fb9+'/'+_0x306bc6)[_0x84e5('0x19')](_0x58058a);}return null;};}function patchUpdates(_0x492f2a){return function(_0x384eb1){try{jsonpatch['apply'](_0x384eb1,_0x492f2a,!![]);}catch(_0x4dd9d4){return BPromise[_0x84e5('0x1e')](_0x4dd9d4);}return _0x384eb1[_0x84e5('0x1f')]();};}function saveUpdates(_0x4184c5,_0x22a3c5){return function(_0x4c8cf4){if(_0x4c8cf4){return _0x4c8cf4[_0x84e5('0x20')](_0x4184c5)['then'](function(_0xf115f){return _0xf115f;});}return null;};}function removeEntity(_0x399c66,_0xaf1df){return function(_0x3a5978){if(_0x3a5978){return _0x3a5978[_0x84e5('0x21')]()[_0x84e5('0x22')](function(){_0x399c66[_0x84e5('0x18')](0xcc)[_0x84e5('0x23')]();});}};}function handleEntityNotFound(_0x430196,_0x413900){return function(_0x54d417){if(!_0x54d417){_0x430196[_0x84e5('0x17')](0x194);}return _0x54d417;};}function handleError(_0x3af9e3,_0x148534){_0x148534=_0x148534||0x1f4;return function(_0x185e23){logger['error'](_0x185e23[_0x84e5('0x24')]);if(_0x185e23[_0x84e5('0x25')]){delete _0x185e23['name'];}_0x3af9e3['status'](_0x148534)['send'](_0x185e23);};}exports[_0x84e5('0x26')]=function(_0xb3a333,_0x41bb50){var _0x40329c={},_0x4f0e48={},_0x1aae3c={'count':0x0,'rows':[]};var _0x3820b5=_[_0x84e5('0x27')](db[_0x84e5('0x28')]['rawAttributes'],function(_0x1d7348){return{'name':_0x1d7348['fieldName'],'type':_0x1d7348[_0x84e5('0x29')][_0x84e5('0x2a')]};});_0x4f0e48[_0x84e5('0x2b')]=_[_0x84e5('0x27')](_0x3820b5,_0x84e5('0x25'));_0x4f0e48[_0x84e5('0x2c')]=_[_0x84e5('0x2d')](_0xb3a333[_0x84e5('0x2c')]);_0x4f0e48[_0x84e5('0x2e')]=_[_0x84e5('0x2f')](_0x4f0e48['model'],_0x4f0e48[_0x84e5('0x2c')]);_0x40329c[_0x84e5('0x30')]=_[_0x84e5('0x2f')](_0x4f0e48[_0x84e5('0x2b')],qs[_0x84e5('0x31')](_0xb3a333[_0x84e5('0x2c')]['fields']));_0x40329c[_0x84e5('0x30')]=_0x40329c[_0x84e5('0x30')][_0x84e5('0x32')]?_0x40329c[_0x84e5('0x30')]:_0x4f0e48[_0x84e5('0x2b')];if(!_0xb3a333[_0x84e5('0x2c')][_0x84e5('0x33')](_0x84e5('0x34'))){_0x40329c[_0x84e5('0x1c')]=qs[_0x84e5('0x1c')](_0xb3a333[_0x84e5('0x2c')][_0x84e5('0x1c')]);_0x40329c[_0x84e5('0x1a')]=qs['offset'](_0xb3a333[_0x84e5('0x2c')][_0x84e5('0x1a')]);}_0x40329c[_0x84e5('0x35')]=qs[_0x84e5('0x36')](_0xb3a333[_0x84e5('0x2c')][_0x84e5('0x36')]);_0x40329c[_0x84e5('0x37')]=qs[_0x84e5('0x2e')](_[_0x84e5('0x38')](_0xb3a333['query'],_0x4f0e48[_0x84e5('0x2e')]),_0x3820b5);if(_0xb3a333[_0x84e5('0x2c')][_0x84e5('0x39')]){_0x40329c[_0x84e5('0x37')]=_[_0x84e5('0x3a')](_0x40329c[_0x84e5('0x37')],{'$or':_[_0x84e5('0x27')](_0x3820b5,function(_0x5a48e4){if(_0x5a48e4[_0x84e5('0x29')]!==_0x84e5('0x3b')){var _0x205ad4={};_0x205ad4[_0x5a48e4[_0x84e5('0x25')]]={'$like':'%'+_0xb3a333['query'][_0x84e5('0x39')]+'%'};return _0x205ad4;}})});}_0x40329c=_[_0x84e5('0x3a')]({},_0x40329c,_0xb3a333[_0x84e5('0x3c')]);var _0x3db3e7={'where':_0x40329c['where']};return db['ZendeskConfiguration'][_0x84e5('0x1d')](_0x3db3e7)[_0x84e5('0x22')](function(_0x305aa5){_0x1aae3c['count']=_0x305aa5;if(_0xb3a333[_0x84e5('0x2c')][_0x84e5('0x3d')]){_0x40329c[_0x84e5('0x3e')]=[{'all':!![]}];}return db[_0x84e5('0x28')][_0x84e5('0x3f')](_0x40329c);})[_0x84e5('0x22')](function(_0x2148c4){_0x1aae3c[_0x84e5('0x40')]=_0x2148c4;return _0x1aae3c;})[_0x84e5('0x22')](respondWithFilteredResult(_0x41bb50,_0x40329c))[_0x84e5('0x41')](handleError(_0x41bb50,null));};exports['show']=function(_0x44b056,_0x2246c7){var _0x3c6499={'raw':![],'where':{'id':_0x44b056[_0x84e5('0x42')]['id']}},_0x5c7662={};_0x5c7662['model']=_[_0x84e5('0x2d')](db[_0x84e5('0x28')][_0x84e5('0x43')]);_0x5c7662['query']=_[_0x84e5('0x2d')](_0x44b056[_0x84e5('0x2c')]);_0x5c7662[_0x84e5('0x2e')]=_['intersection'](_0x5c7662[_0x84e5('0x2b')],_0x5c7662[_0x84e5('0x2c')]);_0x3c6499[_0x84e5('0x30')]=_[_0x84e5('0x2f')](_0x5c7662['model'],qs['fields'](_0x44b056[_0x84e5('0x2c')][_0x84e5('0x31')]));_0x3c6499[_0x84e5('0x30')]=_0x3c6499['attributes'][_0x84e5('0x32')]?_0x3c6499['attributes']:_0x5c7662[_0x84e5('0x2b')];if(_0x44b056[_0x84e5('0x2c')][_0x84e5('0x3d')]){_0x3c6499[_0x84e5('0x3e')]=[{'all':!![]}];}_0x3c6499=_[_0x84e5('0x3a')]({},_0x3c6499,_0x44b056[_0x84e5('0x3c')]);return db[_0x84e5('0x28')][_0x84e5('0x44')](_0x3c6499)[_0x84e5('0x22')](handleEntityNotFound(_0x2246c7,null))[_0x84e5('0x22')](respondWithResult(_0x2246c7,null))[_0x84e5('0x41')](handleError(_0x2246c7,null));};exports[_0x84e5('0x45')]=function(_0x5db603,_0x310f42){return db['ZendeskConfiguration'][_0x84e5('0x45')](_0x5db603['body'],{})['then'](respondWithResult(_0x310f42,0xc9))[_0x84e5('0x41')](handleError(_0x310f42,null));};exports[_0x84e5('0x20')]=function(_0x4d0910,_0x380273){if(_0x4d0910[_0x84e5('0x46')]['id']){delete _0x4d0910[_0x84e5('0x46')]['id'];}return db[_0x84e5('0x28')][_0x84e5('0x44')]({'where':{'id':_0x4d0910['params']['id']}})[_0x84e5('0x22')](handleEntityNotFound(_0x380273,null))[_0x84e5('0x22')](saveUpdates(_0x4d0910[_0x84e5('0x46')],null))['then'](respondWithResult(_0x380273,null))[_0x84e5('0x41')](handleError(_0x380273,null));};exports['destroy']=function(_0x5bc284,_0x1e3950){return db[_0x84e5('0x28')]['find']({'where':{'id':_0x5bc284[_0x84e5('0x42')]['id']}})[_0x84e5('0x22')](handleEntityNotFound(_0x1e3950,null))[_0x84e5('0x22')](removeEntity(_0x1e3950,null))[_0x84e5('0x41')](handleError(_0x1e3950,null));};exports[_0x84e5('0x47')]=function(_0x265c8e,_0x3e65cc,_0x5394e0){var _0x18a1b1={};var _0xd5c216={};var _0x15557f;var _0x2f83b4;return db[_0x84e5('0x28')][_0x84e5('0x48')]({'where':{'id':_0x265c8e[_0x84e5('0x42')]['id']}})[_0x84e5('0x22')](handleEntityNotFound(_0x3e65cc,null))[_0x84e5('0x22')](function(_0x1c6ff7){if(_0x1c6ff7){_0x15557f=_0x1c6ff7;_0xd5c216[_0x84e5('0x2b')]=_[_0x84e5('0x2d')](db[_0x84e5('0x49')][_0x84e5('0x43')]);_0xd5c216[_0x84e5('0x2c')]=_[_0x84e5('0x2d')](_0x265c8e[_0x84e5('0x2c')]);_0xd5c216[_0x84e5('0x2e')]=_[_0x84e5('0x2f')](_0xd5c216['model'],_0xd5c216[_0x84e5('0x2c')]);_0x18a1b1[_0x84e5('0x30')]=_['intersection'](_0xd5c216['model'],qs[_0x84e5('0x31')](_0x265c8e[_0x84e5('0x2c')]['fields']));_0x18a1b1['attributes']=_0x18a1b1['attributes'][_0x84e5('0x32')]?_0x18a1b1[_0x84e5('0x30')]:_0xd5c216[_0x84e5('0x2b')];_0x18a1b1[_0x84e5('0x35')]=qs[_0x84e5('0x36')](_0x265c8e['query'][_0x84e5('0x36')]);_0x18a1b1[_0x84e5('0x37')]=qs[_0x84e5('0x2e')](_[_0x84e5('0x38')](_0x265c8e['query'],_0xd5c216['filters']));if(_0x265c8e[_0x84e5('0x2c')]['filter']){_0x18a1b1[_0x84e5('0x37')]=_[_0x84e5('0x3a')](_0x18a1b1['where'],{'$or':_['map'](_0x18a1b1['attributes'],function(_0x488a36){var _0x1750ca={};_0x1750ca[_0x488a36]={'$like':'%'+_0x265c8e[_0x84e5('0x2c')][_0x84e5('0x39')]+'%'};return _0x1750ca;})});}_0x18a1b1=_['merge']({},_0x18a1b1,_0x265c8e[_0x84e5('0x3c')]);return _0x15557f[_0x84e5('0x47')](_0x18a1b1);}})[_0x84e5('0x22')](function(_0x14f7a7){if(_0x14f7a7){_0x2f83b4=_0x14f7a7[_0x84e5('0x32')];if(!_0x265c8e[_0x84e5('0x2c')][_0x84e5('0x33')](_0x84e5('0x34'))){_0x18a1b1[_0x84e5('0x1c')]=qs[_0x84e5('0x1c')](_0x265c8e[_0x84e5('0x2c')][_0x84e5('0x1c')]);_0x18a1b1['offset']=qs[_0x84e5('0x1a')](_0x265c8e[_0x84e5('0x2c')][_0x84e5('0x1a')]);}return _0x15557f[_0x84e5('0x47')](_0x18a1b1);}})[_0x84e5('0x22')](function(_0x4adddf){if(_0x4adddf){return _0x4adddf?{'count':_0x2f83b4,'rows':_0x4adddf}:null;}})[_0x84e5('0x22')](respondWithResult(_0x3e65cc,null))[_0x84e5('0x41')](handleError(_0x3e65cc,null));};exports[_0x84e5('0x4a')]=function(_0x2f8bf6,_0x5d363c,_0x35c2f0){var _0x193a91={};var _0x1a0170={};var _0x362063;var _0xb2d60a;return db['ZendeskConfiguration'][_0x84e5('0x48')]({'where':{'id':_0x2f8bf6[_0x84e5('0x42')]['id']}})[_0x84e5('0x22')](handleEntityNotFound(_0x5d363c,null))[_0x84e5('0x22')](function(_0x58a82f){if(_0x58a82f){_0x362063=_0x58a82f;_0x1a0170[_0x84e5('0x2b')]=_[_0x84e5('0x2d')](db['ZendeskField'][_0x84e5('0x43')]);_0x1a0170['query']=_[_0x84e5('0x2d')](_0x2f8bf6['query']);_0x1a0170[_0x84e5('0x2e')]=_[_0x84e5('0x2f')](_0x1a0170[_0x84e5('0x2b')],_0x1a0170['query']);_0x193a91[_0x84e5('0x30')]=_['intersection'](_0x1a0170[_0x84e5('0x2b')],qs['fields'](_0x2f8bf6[_0x84e5('0x2c')][_0x84e5('0x31')]));_0x193a91[_0x84e5('0x30')]=_0x193a91[_0x84e5('0x30')]['length']?_0x193a91[_0x84e5('0x30')]:_0x1a0170['model'];_0x193a91['order']=qs[_0x84e5('0x36')](_0x2f8bf6[_0x84e5('0x2c')][_0x84e5('0x36')]);_0x193a91[_0x84e5('0x37')]=qs['filters'](_[_0x84e5('0x38')](_0x2f8bf6['query'],_0x1a0170['filters']));if(_0x2f8bf6[_0x84e5('0x2c')][_0x84e5('0x39')]){_0x193a91[_0x84e5('0x37')]=_[_0x84e5('0x3a')](_0x193a91[_0x84e5('0x37')],{'$or':_['map'](_0x193a91[_0x84e5('0x30')],function(_0x19ef2b){var _0x3517fa={};_0x3517fa[_0x19ef2b]={'$like':'%'+_0x2f8bf6['query']['filter']+'%'};return _0x3517fa;})});}_0x193a91=_[_0x84e5('0x3a')]({},_0x193a91,_0x2f8bf6[_0x84e5('0x3c')]);return _0x362063[_0x84e5('0x4a')](_0x193a91);}})['then'](function(_0x26644e){if(_0x26644e){_0xb2d60a=_0x26644e[_0x84e5('0x32')];if(!_0x2f8bf6[_0x84e5('0x2c')][_0x84e5('0x33')]('nolimit')){_0x193a91[_0x84e5('0x1c')]=qs[_0x84e5('0x1c')](_0x2f8bf6['query'][_0x84e5('0x1c')]);_0x193a91[_0x84e5('0x1a')]=qs['offset'](_0x2f8bf6[_0x84e5('0x2c')][_0x84e5('0x1a')]);}return _0x362063[_0x84e5('0x4a')](_0x193a91);}})[_0x84e5('0x22')](function(_0x4a7d95){if(_0x4a7d95){return _0x4a7d95?{'count':_0xb2d60a,'rows':_0x4a7d95}:null;}})[_0x84e5('0x22')](respondWithResult(_0x5d363c,null))['catch'](handleError(_0x5d363c,null));};exports[_0x84e5('0x4b')]=function(_0xeb5d1e,_0x15c8f7,_0x3cd61d){var _0x39c0d4={};var _0x25c322={};var _0x47ebb9;var _0x3cf3a7;return db[_0x84e5('0x28')][_0x84e5('0x48')]({'where':{'id':_0xeb5d1e[_0x84e5('0x42')]['id']}})[_0x84e5('0x22')](handleEntityNotFound(_0x15c8f7,null))[_0x84e5('0x22')](function(_0x384772){if(_0x384772){_0x47ebb9=_0x384772;_0x25c322[_0x84e5('0x2b')]=_['keys'](db['ZendeskField'][_0x84e5('0x43')]);_0x25c322['query']=_[_0x84e5('0x2d')](_0xeb5d1e[_0x84e5('0x2c')]);_0x25c322[_0x84e5('0x2e')]=_[_0x84e5('0x2f')](_0x25c322[_0x84e5('0x2b')],_0x25c322[_0x84e5('0x2c')]);_0x39c0d4[_0x84e5('0x30')]=_['intersection'](_0x25c322['model'],qs['fields'](_0xeb5d1e['query']['fields']));_0x39c0d4[_0x84e5('0x30')]=_0x39c0d4['attributes'][_0x84e5('0x32')]?_0x39c0d4[_0x84e5('0x30')]:_0x25c322['model'];_0x39c0d4['order']=qs['sort'](_0xeb5d1e['query'][_0x84e5('0x36')]);_0x39c0d4[_0x84e5('0x37')]=qs['filters'](_['pick'](_0xeb5d1e[_0x84e5('0x2c')],_0x25c322[_0x84e5('0x2e')]));if(_0xeb5d1e[_0x84e5('0x2c')][_0x84e5('0x39')]){_0x39c0d4[_0x84e5('0x37')]=_[_0x84e5('0x3a')](_0x39c0d4[_0x84e5('0x37')],{'$or':_[_0x84e5('0x27')](_0x39c0d4[_0x84e5('0x30')],function(_0x207358){var _0x3ba88d={};_0x3ba88d[_0x207358]={'$like':'%'+_0xeb5d1e[_0x84e5('0x2c')][_0x84e5('0x39')]+'%'};return _0x3ba88d;})});}_0x39c0d4=_[_0x84e5('0x3a')]({},_0x39c0d4,_0xeb5d1e[_0x84e5('0x3c')]);return _0x47ebb9[_0x84e5('0x4b')](_0x39c0d4);}})[_0x84e5('0x22')](function(_0x459666){if(_0x459666){_0x3cf3a7=_0x459666['length'];if(!_0xeb5d1e['query'][_0x84e5('0x33')](_0x84e5('0x34'))){_0x39c0d4['limit']=qs[_0x84e5('0x1c')](_0xeb5d1e['query'][_0x84e5('0x1c')]);_0x39c0d4['offset']=qs[_0x84e5('0x1a')](_0xeb5d1e[_0x84e5('0x2c')]['offset']);}return _0x47ebb9[_0x84e5('0x4b')](_0x39c0d4);}})[_0x84e5('0x22')](function(_0x2f15e0){if(_0x2f15e0){return _0x2f15e0?{'count':_0x3cf3a7,'rows':_0x2f15e0}:null;}})['then'](respondWithResult(_0x15c8f7,null))[_0x84e5('0x41')](handleError(_0x15c8f7,null));};exports[_0x84e5('0x4c')]=function(_0x3a9fc2,_0x115059,_0x91b634){var _0x4f7da4={};var _0xa7c43d={};var _0x3de58b;var _0x1e2b5f;return db[_0x84e5('0x28')][_0x84e5('0x48')]({'where':{'id':_0x3a9fc2[_0x84e5('0x42')]['id']}})[_0x84e5('0x22')](handleEntityNotFound(_0x115059,null))['then'](function(_0x4193bc){if(_0x4193bc){_0x3de58b=_0x4193bc;_0xa7c43d[_0x84e5('0x2b')]=_[_0x84e5('0x2d')](db[_0x84e5('0x4d')]['rawAttributes']);_0xa7c43d[_0x84e5('0x2c')]=_['keys'](_0x3a9fc2[_0x84e5('0x2c')]);_0xa7c43d[_0x84e5('0x2e')]=_[_0x84e5('0x2f')](_0xa7c43d['model'],_0xa7c43d[_0x84e5('0x2c')]);_0x4f7da4[_0x84e5('0x30')]=_[_0x84e5('0x2f')](_0xa7c43d[_0x84e5('0x2b')],qs['fields'](_0x3a9fc2[_0x84e5('0x2c')][_0x84e5('0x31')]));_0x4f7da4[_0x84e5('0x30')]=_0x4f7da4[_0x84e5('0x30')][_0x84e5('0x32')]?_0x4f7da4[_0x84e5('0x30')]:_0xa7c43d[_0x84e5('0x2b')];_0x4f7da4[_0x84e5('0x35')]=qs['sort'](_0x3a9fc2['query'][_0x84e5('0x36')]);_0x4f7da4[_0x84e5('0x37')]=qs[_0x84e5('0x2e')](_[_0x84e5('0x38')](_0x3a9fc2['query'],_0xa7c43d[_0x84e5('0x2e')]));if(_0x3a9fc2[_0x84e5('0x2c')][_0x84e5('0x39')]){_0x4f7da4[_0x84e5('0x37')]=_[_0x84e5('0x3a')](_0x4f7da4[_0x84e5('0x37')],{'$or':_[_0x84e5('0x27')](_0x4f7da4[_0x84e5('0x30')],function(_0x370f83){var _0x4e6b18={};_0x4e6b18[_0x370f83]={'$like':'%'+_0x3a9fc2[_0x84e5('0x2c')]['filter']+'%'};return _0x4e6b18;})});}_0x4f7da4=_['merge']({},_0x4f7da4,_0x3a9fc2[_0x84e5('0x3c')]);return _0x3de58b[_0x84e5('0x4c')](_0x4f7da4);}})[_0x84e5('0x22')](function(_0x113b2e){if(_0x113b2e){_0x1e2b5f=_0x113b2e[_0x84e5('0x32')];if(!_0x3a9fc2[_0x84e5('0x2c')][_0x84e5('0x33')](_0x84e5('0x34'))){_0x4f7da4[_0x84e5('0x1c')]=qs[_0x84e5('0x1c')](_0x3a9fc2['query']['limit']);_0x4f7da4['offset']=qs[_0x84e5('0x1a')](_0x3a9fc2[_0x84e5('0x2c')][_0x84e5('0x1a')]);}return _0x3de58b[_0x84e5('0x4c')](_0x4f7da4);}})['then'](function(_0x56d0f6){if(_0x56d0f6){return _0x56d0f6?{'count':_0x1e2b5f,'rows':_0x56d0f6}:null;}})[_0x84e5('0x22')](respondWithResult(_0x115059,null))['catch'](handleError(_0x115059,null));};exports[_0x84e5('0x4e')]=function(_0x24de15,_0x5d6a55,_0x6fa5c2){if(_0x24de15[_0x84e5('0x46')]['id']){delete _0x24de15[_0x84e5('0x46')]['id'];}return db[_0x84e5('0x28')][_0x84e5('0x48')]({'where':{'id':_0x24de15['params']['id']}})['then'](handleEntityNotFound(_0x5d6a55,null))[_0x84e5('0x22')](function(_0x2cd4ac){if(_0x2cd4ac){return _0x2cd4ac[_0x84e5('0x4e')](_0x24de15[_0x84e5('0x46')]['ids']||[]);}return null;})[_0x84e5('0x22')](respondWithResult(_0x5d6a55,null))[_0x84e5('0x41')](handleError(_0x5d6a55,null));}; \ No newline at end of file +var _0xee13=['findOne','getFields','getSubjects','ZendeskField','getDescriptions','getTags','setTags','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0xee13,0x1e7));var _0x3ee1=function(_0x22e67b,_0x222f66){_0x22e67b=_0x22e67b-0x0;var _0x1e7afe=_0xee13[_0x22e67b];return _0x1e7afe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3ee1('0x0'));var jsonpatch=require(_0x3ee1('0x1'));var rp=require(_0x3ee1('0x2'));var moment=require(_0x3ee1('0x3'));var BPromise=require(_0x3ee1('0x4'));var Mustache=require(_0x3ee1('0x5'));var util=require('util');var path=require(_0x3ee1('0x6'));var sox=require('sox');var csv=require(_0x3ee1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ee1('0x8'));var _=require(_0x3ee1('0x9'));var squel=require('squel');var crypto=require(_0x3ee1('0xa'));var jsforce=require(_0x3ee1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3ee1('0x7'));var querystring=require(_0x3ee1('0xc'));var Papa=require(_0x3ee1('0xd'));var Redis=require(_0x3ee1('0xe'));var authService=require(_0x3ee1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3ee1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ee1('0x11'))(_0x3ee1('0x12'));var utils=require('../../config/utils');var config=require(_0x3ee1('0x13'));var licenseUtil=require(_0x3ee1('0x14'));var db=require(_0x3ee1('0x15'))['db'];function respondWithStatusCode(_0x40bb91,_0x33bb68){_0x33bb68=_0x33bb68||0xcc;return function(_0x5e02a4){if(_0x5e02a4){return _0x40bb91[_0x3ee1('0x16')](_0x33bb68);}return _0x40bb91[_0x3ee1('0x17')](_0x33bb68)[_0x3ee1('0x18')]();};}function respondWithResult(_0x202d28,_0x5e35df){_0x5e35df=_0x5e35df||0xc8;return function(_0x2132da){if(_0x2132da){return _0x202d28[_0x3ee1('0x17')](_0x5e35df)['json'](_0x2132da);}};}function respondWithFilteredResult(_0x42e086,_0x5b90c4){return function(_0x5c172c){if(_0x5c172c){var _0x55afb6=typeof _0x5b90c4[_0x3ee1('0x19')]==='undefined'&&typeof _0x5b90c4['limit']===_0x3ee1('0x1a');var _0x5d3d95=_0x5c172c[_0x3ee1('0x1b')];var _0x5bad0d=_0x55afb6?0x0:_0x5b90c4['offset'];var _0x95bb51=_0x55afb6?_0x5c172c[_0x3ee1('0x1b')]:_0x5b90c4['offset']+_0x5b90c4[_0x3ee1('0x1c')];var _0x55d05e;if(_0x95bb51>=_0x5d3d95){_0x95bb51=_0x5d3d95;_0x55d05e=0xc8;}else{_0x55d05e=0xce;}_0x42e086[_0x3ee1('0x17')](_0x55d05e);return _0x42e086[_0x3ee1('0x1d')]('Content-Range',_0x5bad0d+'-'+_0x95bb51+'/'+_0x5d3d95)[_0x3ee1('0x1e')](_0x5c172c);}return null;};}function patchUpdates(_0x531641){return function(_0x3eb70b){try{jsonpatch['apply'](_0x3eb70b,_0x531641,!![]);}catch(_0x4d5e39){return BPromise[_0x3ee1('0x1f')](_0x4d5e39);}return _0x3eb70b[_0x3ee1('0x20')]();};}function saveUpdates(_0x88e9de,_0x3f0d26){return function(_0x27fad0){if(_0x27fad0){return _0x27fad0[_0x3ee1('0x21')](_0x88e9de)[_0x3ee1('0x22')](function(_0x2961f3){return _0x2961f3;});}return null;};}function removeEntity(_0x3deb10,_0x37e43c){return function(_0x559d60){if(_0x559d60){return _0x559d60[_0x3ee1('0x23')]()[_0x3ee1('0x22')](function(){_0x3deb10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c246e,_0xa582){return function(_0xfe30f3){if(!_0xfe30f3){_0x3c246e[_0x3ee1('0x16')](0x194);}return _0xfe30f3;};}function handleError(_0x5117e5,_0x4b54e8){_0x4b54e8=_0x4b54e8||0x1f4;return function(_0xee2cb2){logger[_0x3ee1('0x24')](_0xee2cb2['stack']);if(_0xee2cb2['name']){delete _0xee2cb2[_0x3ee1('0x25')];}_0x5117e5[_0x3ee1('0x17')](_0x4b54e8)[_0x3ee1('0x26')](_0xee2cb2);};}exports[_0x3ee1('0x27')]=function(_0x136874,_0x51f9ad){var _0x40e04e={},_0x5c887e={},_0x4d9fab={'count':0x0,'rows':[]};var _0xbed61a=_[_0x3ee1('0x28')](db['ZendeskConfiguration'][_0x3ee1('0x29')],function(_0x19d66e){return{'name':_0x19d66e['fieldName'],'type':_0x19d66e[_0x3ee1('0x2a')][_0x3ee1('0x2b')]};});_0x5c887e[_0x3ee1('0x2c')]=_['map'](_0xbed61a,_0x3ee1('0x25'));_0x5c887e[_0x3ee1('0x2d')]=_['keys'](_0x136874[_0x3ee1('0x2d')]);_0x5c887e[_0x3ee1('0x2e')]=_[_0x3ee1('0x2f')](_0x5c887e[_0x3ee1('0x2c')],_0x5c887e[_0x3ee1('0x2d')]);_0x40e04e[_0x3ee1('0x30')]=_[_0x3ee1('0x2f')](_0x5c887e[_0x3ee1('0x2c')],qs[_0x3ee1('0x31')](_0x136874[_0x3ee1('0x2d')][_0x3ee1('0x31')]));_0x40e04e[_0x3ee1('0x30')]=_0x40e04e['attributes'][_0x3ee1('0x32')]?_0x40e04e[_0x3ee1('0x30')]:_0x5c887e['model'];if(!_0x136874['query'][_0x3ee1('0x33')](_0x3ee1('0x34'))){_0x40e04e['limit']=qs[_0x3ee1('0x1c')](_0x136874['query'][_0x3ee1('0x1c')]);_0x40e04e[_0x3ee1('0x19')]=qs[_0x3ee1('0x19')](_0x136874[_0x3ee1('0x2d')][_0x3ee1('0x19')]);}_0x40e04e[_0x3ee1('0x35')]=qs[_0x3ee1('0x36')](_0x136874[_0x3ee1('0x2d')][_0x3ee1('0x36')]);_0x40e04e[_0x3ee1('0x37')]=qs['filters'](_[_0x3ee1('0x38')](_0x136874[_0x3ee1('0x2d')],_0x5c887e[_0x3ee1('0x2e')]),_0xbed61a);if(_0x136874[_0x3ee1('0x2d')][_0x3ee1('0x39')]){_0x40e04e[_0x3ee1('0x37')]=_[_0x3ee1('0x3a')](_0x40e04e[_0x3ee1('0x37')],{'$or':_['map'](_0xbed61a,function(_0x435e5c){if(_0x435e5c[_0x3ee1('0x2a')]!==_0x3ee1('0x3b')){var _0x2af0f2={};_0x2af0f2[_0x435e5c[_0x3ee1('0x25')]]={'$like':'%'+_0x136874[_0x3ee1('0x2d')][_0x3ee1('0x39')]+'%'};return _0x2af0f2;}})});}_0x40e04e=_[_0x3ee1('0x3a')]({},_0x40e04e,_0x136874[_0x3ee1('0x3c')]);var _0x1b91fd={'where':_0x40e04e[_0x3ee1('0x37')]};return db[_0x3ee1('0x3d')][_0x3ee1('0x1b')](_0x1b91fd)[_0x3ee1('0x22')](function(_0x21ff12){_0x4d9fab[_0x3ee1('0x1b')]=_0x21ff12;if(_0x136874[_0x3ee1('0x2d')][_0x3ee1('0x3e')]){_0x40e04e[_0x3ee1('0x3f')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x3ee1('0x40')](_0x40e04e);})[_0x3ee1('0x22')](function(_0x3360bc){_0x4d9fab[_0x3ee1('0x41')]=_0x3360bc;return _0x4d9fab;})['then'](respondWithFilteredResult(_0x51f9ad,_0x40e04e))[_0x3ee1('0x42')](handleError(_0x51f9ad,null));};exports[_0x3ee1('0x43')]=function(_0x32a333,_0x3c87fb){var _0x42cb34={'raw':![],'where':{'id':_0x32a333['params']['id']}},_0x3ff5c2={};_0x3ff5c2['model']=_[_0x3ee1('0x44')](db[_0x3ee1('0x3d')][_0x3ee1('0x29')]);_0x3ff5c2[_0x3ee1('0x2d')]=_[_0x3ee1('0x44')](_0x32a333[_0x3ee1('0x2d')]);_0x3ff5c2[_0x3ee1('0x2e')]=_['intersection'](_0x3ff5c2[_0x3ee1('0x2c')],_0x3ff5c2[_0x3ee1('0x2d')]);_0x42cb34[_0x3ee1('0x30')]=_[_0x3ee1('0x2f')](_0x3ff5c2[_0x3ee1('0x2c')],qs['fields'](_0x32a333[_0x3ee1('0x2d')]['fields']));_0x42cb34[_0x3ee1('0x30')]=_0x42cb34[_0x3ee1('0x30')][_0x3ee1('0x32')]?_0x42cb34[_0x3ee1('0x30')]:_0x3ff5c2[_0x3ee1('0x2c')];if(_0x32a333[_0x3ee1('0x2d')]['includeAll']){_0x42cb34[_0x3ee1('0x3f')]=[{'all':!![]}];}_0x42cb34=_['merge']({},_0x42cb34,_0x32a333[_0x3ee1('0x3c')]);return db[_0x3ee1('0x3d')][_0x3ee1('0x45')](_0x42cb34)[_0x3ee1('0x22')](handleEntityNotFound(_0x3c87fb,null))['then'](respondWithResult(_0x3c87fb,null))[_0x3ee1('0x42')](handleError(_0x3c87fb,null));};exports[_0x3ee1('0x46')]=function(_0x3c0d29,_0x9fc915){return db['ZendeskConfiguration'][_0x3ee1('0x46')](_0x3c0d29[_0x3ee1('0x47')],{})[_0x3ee1('0x22')](respondWithResult(_0x9fc915,0xc9))['catch'](handleError(_0x9fc915,null));};exports[_0x3ee1('0x21')]=function(_0x3f4685,_0x25918d){if(_0x3f4685['body']['id']){delete _0x3f4685['body']['id'];}return db[_0x3ee1('0x3d')][_0x3ee1('0x45')]({'where':{'id':_0x3f4685[_0x3ee1('0x48')]['id']}})['then'](handleEntityNotFound(_0x25918d,null))['then'](saveUpdates(_0x3f4685['body'],null))[_0x3ee1('0x22')](respondWithResult(_0x25918d,null))['catch'](handleError(_0x25918d,null));};exports[_0x3ee1('0x23')]=function(_0x34ce7d,_0x48ee3b){return db['ZendeskConfiguration']['find']({'where':{'id':_0x34ce7d[_0x3ee1('0x48')]['id']}})['then'](handleEntityNotFound(_0x48ee3b,null))[_0x3ee1('0x22')](removeEntity(_0x48ee3b,null))[_0x3ee1('0x42')](handleError(_0x48ee3b,null));};exports['getFields']=function(_0x4064a9,_0x32260e,_0x2f35b8){var _0x3add9e={};var _0x4621d5={};var _0x428b61;var _0x58d622;return db['ZendeskConfiguration'][_0x3ee1('0x49')]({'where':{'id':_0x4064a9[_0x3ee1('0x48')]['id']}})['then'](handleEntityNotFound(_0x32260e,null))[_0x3ee1('0x22')](function(_0x2e50cc){if(_0x2e50cc){_0x428b61=_0x2e50cc;_0x4621d5[_0x3ee1('0x2c')]=_[_0x3ee1('0x44')](db['ZendeskField'][_0x3ee1('0x29')]);_0x4621d5[_0x3ee1('0x2d')]=_[_0x3ee1('0x44')](_0x4064a9['query']);_0x4621d5[_0x3ee1('0x2e')]=_[_0x3ee1('0x2f')](_0x4621d5[_0x3ee1('0x2c')],_0x4621d5[_0x3ee1('0x2d')]);_0x3add9e[_0x3ee1('0x30')]=_[_0x3ee1('0x2f')](_0x4621d5[_0x3ee1('0x2c')],qs[_0x3ee1('0x31')](_0x4064a9[_0x3ee1('0x2d')]['fields']));_0x3add9e[_0x3ee1('0x30')]=_0x3add9e[_0x3ee1('0x30')][_0x3ee1('0x32')]?_0x3add9e[_0x3ee1('0x30')]:_0x4621d5[_0x3ee1('0x2c')];_0x3add9e[_0x3ee1('0x35')]=qs[_0x3ee1('0x36')](_0x4064a9['query']['sort']);_0x3add9e['where']=qs[_0x3ee1('0x2e')](_[_0x3ee1('0x38')](_0x4064a9[_0x3ee1('0x2d')],_0x4621d5[_0x3ee1('0x2e')]));if(_0x4064a9[_0x3ee1('0x2d')]['filter']){_0x3add9e['where']=_[_0x3ee1('0x3a')](_0x3add9e[_0x3ee1('0x37')],{'$or':_['map'](_0x3add9e[_0x3ee1('0x30')],function(_0x49e59f){var _0x4b09b2={};_0x4b09b2[_0x49e59f]={'$like':'%'+_0x4064a9[_0x3ee1('0x2d')][_0x3ee1('0x39')]+'%'};return _0x4b09b2;})});}_0x3add9e=_[_0x3ee1('0x3a')]({},_0x3add9e,_0x4064a9[_0x3ee1('0x3c')]);return _0x428b61[_0x3ee1('0x4a')](_0x3add9e);}})[_0x3ee1('0x22')](function(_0x11a8dc){if(_0x11a8dc){_0x58d622=_0x11a8dc[_0x3ee1('0x32')];if(!_0x4064a9[_0x3ee1('0x2d')][_0x3ee1('0x33')]('nolimit')){_0x3add9e[_0x3ee1('0x1c')]=qs['limit'](_0x4064a9['query'][_0x3ee1('0x1c')]);_0x3add9e[_0x3ee1('0x19')]=qs[_0x3ee1('0x19')](_0x4064a9['query'][_0x3ee1('0x19')]);}return _0x428b61['getFields'](_0x3add9e);}})[_0x3ee1('0x22')](function(_0x378486){if(_0x378486){return _0x378486?{'count':_0x58d622,'rows':_0x378486}:null;}})[_0x3ee1('0x22')](respondWithResult(_0x32260e,null))['catch'](handleError(_0x32260e,null));};exports[_0x3ee1('0x4b')]=function(_0x232752,_0x1d9956,_0x3efd92){var _0xefd96={};var _0x1ff360={};var _0x5e8147;var _0x545a21;return db['ZendeskConfiguration'][_0x3ee1('0x49')]({'where':{'id':_0x232752[_0x3ee1('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d9956,null))['then'](function(_0x2afa61){if(_0x2afa61){_0x5e8147=_0x2afa61;_0x1ff360[_0x3ee1('0x2c')]=_[_0x3ee1('0x44')](db[_0x3ee1('0x4c')][_0x3ee1('0x29')]);_0x1ff360[_0x3ee1('0x2d')]=_['keys'](_0x232752['query']);_0x1ff360[_0x3ee1('0x2e')]=_[_0x3ee1('0x2f')](_0x1ff360[_0x3ee1('0x2c')],_0x1ff360['query']);_0xefd96[_0x3ee1('0x30')]=_[_0x3ee1('0x2f')](_0x1ff360[_0x3ee1('0x2c')],qs[_0x3ee1('0x31')](_0x232752['query']['fields']));_0xefd96[_0x3ee1('0x30')]=_0xefd96[_0x3ee1('0x30')][_0x3ee1('0x32')]?_0xefd96[_0x3ee1('0x30')]:_0x1ff360[_0x3ee1('0x2c')];_0xefd96[_0x3ee1('0x35')]=qs[_0x3ee1('0x36')](_0x232752['query'][_0x3ee1('0x36')]);_0xefd96[_0x3ee1('0x37')]=qs[_0x3ee1('0x2e')](_[_0x3ee1('0x38')](_0x232752[_0x3ee1('0x2d')],_0x1ff360['filters']));if(_0x232752[_0x3ee1('0x2d')][_0x3ee1('0x39')]){_0xefd96[_0x3ee1('0x37')]=_[_0x3ee1('0x3a')](_0xefd96[_0x3ee1('0x37')],{'$or':_[_0x3ee1('0x28')](_0xefd96[_0x3ee1('0x30')],function(_0x3fdd9f){var _0x317141={};_0x317141[_0x3fdd9f]={'$like':'%'+_0x232752[_0x3ee1('0x2d')]['filter']+'%'};return _0x317141;})});}_0xefd96=_[_0x3ee1('0x3a')]({},_0xefd96,_0x232752[_0x3ee1('0x3c')]);return _0x5e8147[_0x3ee1('0x4b')](_0xefd96);}})[_0x3ee1('0x22')](function(_0x2738db){if(_0x2738db){_0x545a21=_0x2738db['length'];if(!_0x232752['query'][_0x3ee1('0x33')](_0x3ee1('0x34'))){_0xefd96[_0x3ee1('0x1c')]=qs[_0x3ee1('0x1c')](_0x232752[_0x3ee1('0x2d')]['limit']);_0xefd96[_0x3ee1('0x19')]=qs['offset'](_0x232752['query'][_0x3ee1('0x19')]);}return _0x5e8147[_0x3ee1('0x4b')](_0xefd96);}})[_0x3ee1('0x22')](function(_0x47b692){if(_0x47b692){return _0x47b692?{'count':_0x545a21,'rows':_0x47b692}:null;}})[_0x3ee1('0x22')](respondWithResult(_0x1d9956,null))[_0x3ee1('0x42')](handleError(_0x1d9956,null));};exports['getDescriptions']=function(_0x3a6991,_0x581013,_0x52475a){var _0x287e30={};var _0x51a44e={};var _0x4ec046;var _0x4a426d;return db[_0x3ee1('0x3d')][_0x3ee1('0x49')]({'where':{'id':_0x3a6991['params']['id']}})['then'](handleEntityNotFound(_0x581013,null))[_0x3ee1('0x22')](function(_0x5215d6){if(_0x5215d6){_0x4ec046=_0x5215d6;_0x51a44e['model']=_[_0x3ee1('0x44')](db['ZendeskField'][_0x3ee1('0x29')]);_0x51a44e[_0x3ee1('0x2d')]=_[_0x3ee1('0x44')](_0x3a6991['query']);_0x51a44e['filters']=_[_0x3ee1('0x2f')](_0x51a44e[_0x3ee1('0x2c')],_0x51a44e['query']);_0x287e30[_0x3ee1('0x30')]=_[_0x3ee1('0x2f')](_0x51a44e[_0x3ee1('0x2c')],qs[_0x3ee1('0x31')](_0x3a6991[_0x3ee1('0x2d')][_0x3ee1('0x31')]));_0x287e30[_0x3ee1('0x30')]=_0x287e30[_0x3ee1('0x30')][_0x3ee1('0x32')]?_0x287e30['attributes']:_0x51a44e[_0x3ee1('0x2c')];_0x287e30[_0x3ee1('0x35')]=qs[_0x3ee1('0x36')](_0x3a6991[_0x3ee1('0x2d')][_0x3ee1('0x36')]);_0x287e30['where']=qs[_0x3ee1('0x2e')](_[_0x3ee1('0x38')](_0x3a6991['query'],_0x51a44e[_0x3ee1('0x2e')]));if(_0x3a6991[_0x3ee1('0x2d')]['filter']){_0x287e30['where']=_[_0x3ee1('0x3a')](_0x287e30[_0x3ee1('0x37')],{'$or':_[_0x3ee1('0x28')](_0x287e30[_0x3ee1('0x30')],function(_0x16e603){var _0x5f3628={};_0x5f3628[_0x16e603]={'$like':'%'+_0x3a6991[_0x3ee1('0x2d')][_0x3ee1('0x39')]+'%'};return _0x5f3628;})});}_0x287e30=_[_0x3ee1('0x3a')]({},_0x287e30,_0x3a6991[_0x3ee1('0x3c')]);return _0x4ec046['getDescriptions'](_0x287e30);}})['then'](function(_0x461576){if(_0x461576){_0x4a426d=_0x461576[_0x3ee1('0x32')];if(!_0x3a6991[_0x3ee1('0x2d')][_0x3ee1('0x33')](_0x3ee1('0x34'))){_0x287e30[_0x3ee1('0x1c')]=qs[_0x3ee1('0x1c')](_0x3a6991[_0x3ee1('0x2d')]['limit']);_0x287e30['offset']=qs[_0x3ee1('0x19')](_0x3a6991[_0x3ee1('0x2d')]['offset']);}return _0x4ec046[_0x3ee1('0x4d')](_0x287e30);}})['then'](function(_0x5770ca){if(_0x5770ca){return _0x5770ca?{'count':_0x4a426d,'rows':_0x5770ca}:null;}})[_0x3ee1('0x22')](respondWithResult(_0x581013,null))[_0x3ee1('0x42')](handleError(_0x581013,null));};exports[_0x3ee1('0x4e')]=function(_0x2c3d06,_0x4043e3,_0x504db0){var _0x159389={};var _0x4d1bec={};var _0x33ed39;var _0x4c928f;return db[_0x3ee1('0x3d')][_0x3ee1('0x49')]({'where':{'id':_0x2c3d06[_0x3ee1('0x48')]['id']}})[_0x3ee1('0x22')](handleEntityNotFound(_0x4043e3,null))[_0x3ee1('0x22')](function(_0xbe5a04){if(_0xbe5a04){_0x33ed39=_0xbe5a04;_0x4d1bec['model']=_[_0x3ee1('0x44')](db['Tag'][_0x3ee1('0x29')]);_0x4d1bec[_0x3ee1('0x2d')]=_[_0x3ee1('0x44')](_0x2c3d06[_0x3ee1('0x2d')]);_0x4d1bec[_0x3ee1('0x2e')]=_['intersection'](_0x4d1bec[_0x3ee1('0x2c')],_0x4d1bec['query']);_0x159389[_0x3ee1('0x30')]=_['intersection'](_0x4d1bec[_0x3ee1('0x2c')],qs['fields'](_0x2c3d06[_0x3ee1('0x2d')][_0x3ee1('0x31')]));_0x159389[_0x3ee1('0x30')]=_0x159389[_0x3ee1('0x30')][_0x3ee1('0x32')]?_0x159389['attributes']:_0x4d1bec['model'];_0x159389[_0x3ee1('0x35')]=qs[_0x3ee1('0x36')](_0x2c3d06[_0x3ee1('0x2d')][_0x3ee1('0x36')]);_0x159389['where']=qs[_0x3ee1('0x2e')](_[_0x3ee1('0x38')](_0x2c3d06[_0x3ee1('0x2d')],_0x4d1bec[_0x3ee1('0x2e')]));if(_0x2c3d06[_0x3ee1('0x2d')][_0x3ee1('0x39')]){_0x159389[_0x3ee1('0x37')]=_[_0x3ee1('0x3a')](_0x159389['where'],{'$or':_[_0x3ee1('0x28')](_0x159389[_0x3ee1('0x30')],function(_0x4df0c2){var _0x4a293a={};_0x4a293a[_0x4df0c2]={'$like':'%'+_0x2c3d06[_0x3ee1('0x2d')][_0x3ee1('0x39')]+'%'};return _0x4a293a;})});}_0x159389=_[_0x3ee1('0x3a')]({},_0x159389,_0x2c3d06[_0x3ee1('0x3c')]);return _0x33ed39[_0x3ee1('0x4e')](_0x159389);}})[_0x3ee1('0x22')](function(_0x495127){if(_0x495127){_0x4c928f=_0x495127[_0x3ee1('0x32')];if(!_0x2c3d06[_0x3ee1('0x2d')][_0x3ee1('0x33')](_0x3ee1('0x34'))){_0x159389[_0x3ee1('0x1c')]=qs[_0x3ee1('0x1c')](_0x2c3d06['query'][_0x3ee1('0x1c')]);_0x159389[_0x3ee1('0x19')]=qs[_0x3ee1('0x19')](_0x2c3d06['query']['offset']);}return _0x33ed39[_0x3ee1('0x4e')](_0x159389);}})[_0x3ee1('0x22')](function(_0x3eddf1){if(_0x3eddf1){return _0x3eddf1?{'count':_0x4c928f,'rows':_0x3eddf1}:null;}})['then'](respondWithResult(_0x4043e3,null))[_0x3ee1('0x42')](handleError(_0x4043e3,null));};exports[_0x3ee1('0x4f')]=function(_0x278bde,_0x5ebcd7,_0x25377f){if(_0x278bde[_0x3ee1('0x47')]['id']){delete _0x278bde['body']['id'];}return db[_0x3ee1('0x3d')][_0x3ee1('0x49')]({'where':{'id':_0x278bde[_0x3ee1('0x48')]['id']}})[_0x3ee1('0x22')](handleEntityNotFound(_0x5ebcd7,null))[_0x3ee1('0x22')](function(_0x49ba66){if(_0x49ba66){return _0x49ba66[_0x3ee1('0x4f')](_0x278bde['body']['ids']||[]);}return null;})[_0x3ee1('0x22')](respondWithResult(_0x5ebcd7,null))[_0x3ee1('0x42')](handleError(_0x5ebcd7,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index a47cfde..7ce81f9 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 _0x160f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','int_zendesk_configurations'];(function(_0x204169,_0x48cd23){var _0x2fda4e=function(_0x157b30){while(--_0x157b30){_0x204169['push'](_0x204169['shift']());}};_0x2fda4e(++_0x48cd23);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var logger=require(_0xf160('0x2'))(_0xf160('0x3'));var moment=require('moment');var BPromise=require(_0xf160('0x4'));var rp=require(_0xf160('0x5'));var fs=require('fs');var path=require(_0xf160('0x6'));var rimraf=require(_0xf160('0x7'));var config=require(_0xf160('0x8'));var attributes=require(_0xf160('0x9'));module['exports']=function(_0x311d63,_0x11902f){return _0x311d63['define']('ZendeskConfiguration',attributes,{'tableName':_0xf160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1399=['ZendeskConfiguration','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x1d2753,_0xe74185){var _0x2577d8=function(_0x352b6e){while(--_0x352b6e){_0x1d2753['push'](_0x1d2753['shift']());}};_0x2577d8(++_0xe74185);}(_0x1399,0x16c));var _0x9139=function(_0x5210a9,_0x261b1e){_0x5210a9=_0x5210a9-0x0;var _0x4d04fb=_0x1399[_0x5210a9];return _0x4d04fb;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var logger=require('../../config/logger')(_0x9139('0x2'));var moment=require('moment');var BPromise=require(_0x9139('0x3'));var rp=require(_0x9139('0x4'));var fs=require('fs');var path=require(_0x9139('0x5'));var rimraf=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var attributes=require(_0x9139('0x8'));module['exports']=function(_0x54af2d,_0x8f086b){return _0x54af2d[_0x9139('0x9')](_0x9139('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index bf6876e..1e2e629 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 _0xb182=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x53bd05,_0x5795d3){var _0x421177=function(_0x33e279){while(--_0x33e279){_0x53bd05['push'](_0x53bd05['shift']());}};_0x421177(++_0x5795d3);}(_0xb182,0xde));var _0x2b18=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xb182[_0x2becba];return _0x90b5dd;};'use strict';var _=require(_0x2b18('0x0'));var util=require(_0x2b18('0x1'));var moment=require(_0x2b18('0x2'));var BPromise=require(_0x2b18('0x3'));var rs=require(_0x2b18('0x4'));var fs=require('fs');var Redis=require(_0x2b18('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2b18('0x6'))(_0x2b18('0x7'));var config=require(_0x2b18('0x8'));var jayson=require(_0x2b18('0x9'));var client=jayson[_0x2b18('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cff5a,_0x1c9486,_0x3152af){return new BPromise(function(_0xe92b03,_0x3b0d10){return client[_0x2b18('0xb')](_0x4cff5a,_0x3152af)['then'](function(_0x49d977){logger['info'](_0x2b18('0xc'),_0x1c9486,_0x2b18('0xd'));logger[_0x2b18('0xe')](_0x2b18('0xf'),_0x1c9486,'request\x20sent',JSON['stringify'](_0x49d977));if(_0x49d977[_0x2b18('0x10')]){if(_0x49d977['error'][_0x2b18('0x11')]===0x1f4){logger[_0x2b18('0x10')](_0x2b18('0xc'),_0x1c9486,_0x49d977[_0x2b18('0x10')][_0x2b18('0x12')]);return _0x3b0d10(_0x49d977[_0x2b18('0x10')][_0x2b18('0x12')]);}logger[_0x2b18('0x10')](_0x2b18('0xc'),_0x1c9486,_0x49d977[_0x2b18('0x10')][_0x2b18('0x12')]);return _0xe92b03(_0x49d977[_0x2b18('0x10')]['message']);}else{logger[_0x2b18('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1c9486,_0x2b18('0xd'));_0xe92b03(_0x49d977[_0x2b18('0x14')]['message']);}})[_0x2b18('0x15')](function(_0x117271){logger['error'](_0x2b18('0xc'),_0x1c9486,_0x117271);_0x3b0d10(_0x117271);});});} \ No newline at end of file +var _0x6bde=['request\x20sent','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2aefff,_0x26a24b){var _0x4e4534=function(_0x592416){while(--_0x592416){_0x2aefff['push'](_0x2aefff['shift']());}};_0x4e4534(++_0x26a24b);}(_0x6bde,0xf2));var _0xe6bd=function(_0x463299,_0x52753c){_0x463299=_0x463299-0x0;var _0x21f78c=_0x6bde[_0x463299];return _0x21f78c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe6bd('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6bd('0x1'));var db=require(_0xe6bd('0x2'))['db'];var utils=require(_0xe6bd('0x3'));var logger=require(_0xe6bd('0x4'))(_0xe6bd('0x5'));var config=require(_0xe6bd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe6bd('0x7')][_0xe6bd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xca9b59,_0xabb77,_0xfd946c){return new BPromise(function(_0xfc5d24,_0x5eef9d){return client[_0xe6bd('0x9')](_0xca9b59,_0xfd946c)[_0xe6bd('0xa')](function(_0x486c3a){logger['info'](_0xe6bd('0xb'),_0xabb77,'request\x20sent');logger[_0xe6bd('0xc')](_0xe6bd('0xd'),_0xabb77,'request\x20sent',JSON[_0xe6bd('0xe')](_0x486c3a));if(_0x486c3a[_0xe6bd('0xf')]){if(_0x486c3a[_0xe6bd('0xf')][_0xe6bd('0x10')]===0x1f4){logger[_0xe6bd('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0xabb77,_0x486c3a[_0xe6bd('0xf')]['message']);return _0x5eef9d(_0x486c3a[_0xe6bd('0xf')][_0xe6bd('0x11')]);}logger['error'](_0xe6bd('0xb'),_0xabb77,_0x486c3a[_0xe6bd('0xf')][_0xe6bd('0x11')]);return _0xfc5d24(_0x486c3a[_0xe6bd('0xf')][_0xe6bd('0x11')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xabb77,_0xe6bd('0x12'));_0xfc5d24(_0x486c3a['result']['message']);}})[_0xe6bd('0x13')](function(_0x492a37){logger[_0xe6bd('0xf')](_0xe6bd('0xb'),_0xabb77,_0x492a37);_0x5eef9d(_0x492a37);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 24e2359..fdd2164 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 _0xe498=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','put','update','destroy','multer'];(function(_0x2b825a,_0x2f007e){var _0x9bd7b1=function(_0x3ca74d){while(--_0x3ca74d){_0x2b825a['push'](_0x2b825a['shift']());}};_0x9bd7b1(++_0x2f007e);}(_0xe498,0xa1));var _0x8e49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe498[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8e49('0x0'));var util=require(_0x8e49('0x1'));var path=require('path');var timeout=require(_0x8e49('0x2'));var express=require(_0x8e49('0x3'));var router=express[_0x8e49('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8e49('0x5'));var interaction=require(_0x8e49('0x6'));var config=require(_0x8e49('0x7'));var controller=require(_0x8e49('0x8'));router['get']('/',auth[_0x8e49('0x9')](),controller[_0x8e49('0xa')]);router[_0x8e49('0xb')](_0x8e49('0xc'),auth[_0x8e49('0x9')](),controller[_0x8e49('0xd')]);router[_0x8e49('0xe')]('/',auth[_0x8e49('0x9')](),controller['create']);router[_0x8e49('0xf')](_0x8e49('0xc'),auth[_0x8e49('0x9')](),controller[_0x8e49('0x10')]);router['delete']('/:id',auth[_0x8e49('0x9')](),controller[_0x8e49('0x11')]);module['exports']=router; \ No newline at end of file +var _0x847a=['update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post','create'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x847a,0x76));var _0xa847=function(_0x25a646,_0x4b604b){_0x25a646=_0x25a646-0x0;var _0x6a074d=_0x847a[_0x25a646];return _0x6a074d;};'use strict';var multer=require('multer');var util=require(_0xa847('0x0'));var path=require(_0xa847('0x1'));var timeout=require(_0xa847('0x2'));var express=require(_0xa847('0x3'));var router=express[_0xa847('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa847('0x5'));var interaction=require(_0xa847('0x6'));var config=require(_0xa847('0x7'));var controller=require(_0xa847('0x8'));router[_0xa847('0x9')]('/',auth[_0xa847('0xa')](),controller[_0xa847('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa847('0xc')]);router[_0xa847('0xd')]('/',auth[_0xa847('0xa')](),controller[_0xa847('0xe')]);router['put']('/:id',auth[_0xa847('0xa')](),controller[_0xa847('0xf')]);router[_0xa847('0x10')](_0xa847('0x11'),auth[_0xa847('0xa')](),controller['destroy']);module[_0xa847('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b3a6654..f6cde1a 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 _0x00a6=['variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x3fb5f9,_0xa4c2d9){var _0x541745=function(_0x4faa48){while(--_0x4faa48){_0x3fb5f9['push'](_0x3fb5f9['shift']());}};_0x541745(++_0xa4c2d9);}(_0x00a6,0x65));var _0x600a=function(_0x2fb637,_0x359426){_0x2fb637=_0x2fb637-0x0;var _0x1af2ff=_0x00a6[_0x2fb637];return _0x1af2ff;};'use strict';var Sequelize=require('sequelize');module[_0x600a('0x0')]={'type':{'type':Sequelize[_0x600a('0x1')](_0x600a('0x2'),_0x600a('0x3'),_0x600a('0x4'),_0x600a('0x5'),'picklist'),'defaultValue':_0x600a('0x2')},'content':{'type':Sequelize[_0x600a('0x6')]},'key':{'type':Sequelize[_0x600a('0x6')]},'keyType':{'type':Sequelize[_0x600a('0x1')](_0x600a('0x2'),_0x600a('0x3'),_0x600a('0x4'))},'keyContent':{'type':Sequelize[_0x600a('0x6')]},'idField':{'type':Sequelize[_0x600a('0x6')]},'nameField':{'type':Sequelize[_0x600a('0x6')]},'customField':{'type':Sequelize[_0x600a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x600a('0x6')]}}; \ No newline at end of file +var _0xe6a1=['exports','ENUM','variable','customVariable','picklist','string','STRING','sequelize'];(function(_0x229128,_0x273558){var _0x1875b9=function(_0x275e35){while(--_0x275e35){_0x229128['push'](_0x229128['shift']());}};_0x1875b9(++_0x273558);}(_0xe6a1,0xc7));var _0x1e6a=function(_0x4f53a6,_0x582ff5){_0x4f53a6=_0x4f53a6-0x0;var _0x30e4b7=_0xe6a1[_0x4f53a6];return _0x30e4b7;};'use strict';var Sequelize=require(_0x1e6a('0x0'));module[_0x1e6a('0x1')]={'type':{'type':Sequelize[_0x1e6a('0x2')]('string',_0x1e6a('0x3'),_0x1e6a('0x4'),'keyValue',_0x1e6a('0x5')),'defaultValue':_0x1e6a('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1e6a('0x7')]},'keyType':{'type':Sequelize[_0x1e6a('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1e6a('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e6a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index d477cf9..65d8b22 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 _0xc7be=['json','undefined','limit','offset','count','set','apply','reject','then','destroy','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','model','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','ZendeskField','find','create','update','params','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2e3fa2,_0x454330){var _0xf018a3=function(_0x196a04){while(--_0x196a04){_0x2e3fa2['push'](_0x2e3fa2['shift']());}};_0xf018a3(++_0x454330);}(_0xc7be,0x78));var _0xec7b=function(_0x565c17,_0x4427e8){_0x565c17=_0x565c17-0x0;var _0x8e41b5=_0xc7be[_0x565c17];return _0x8e41b5;};'use strict';var emlformat=require(_0xec7b('0x0'));var rimraf=require(_0xec7b('0x1'));var zipdir=require(_0xec7b('0x2'));var jsonpatch=require(_0xec7b('0x3'));var rp=require(_0xec7b('0x4'));var moment=require(_0xec7b('0x5'));var BPromise=require(_0xec7b('0x6'));var Mustache=require(_0xec7b('0x7'));var util=require(_0xec7b('0x8'));var path=require('path');var sox=require(_0xec7b('0x9'));var csv=require(_0xec7b('0xa'));var ejs=require(_0xec7b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xec7b('0xc'));var crypto=require(_0xec7b('0xd'));var jsforce=require(_0xec7b('0xe'));var deskjs=require(_0xec7b('0xf'));var toCsv=require(_0xec7b('0xa'));var querystring=require(_0xec7b('0x10'));var Papa=require(_0xec7b('0x11'));var Redis=require(_0xec7b('0x12'));var authService=require(_0xec7b('0x13'));var qs=require(_0xec7b('0x14'));var as=require(_0xec7b('0x15'));var hardwareService=require(_0xec7b('0x16'));var logger=require(_0xec7b('0x17'))(_0xec7b('0x18'));var utils=require(_0xec7b('0x19'));var config=require(_0xec7b('0x1a'));var licenseUtil=require(_0xec7b('0x1b'));var db=require(_0xec7b('0x1c'))['db'];function respondWithStatusCode(_0x43d7ea,_0x52dfc2){_0x52dfc2=_0x52dfc2||0xcc;return function(_0x5c5739){if(_0x5c5739){return _0x43d7ea[_0xec7b('0x1d')](_0x52dfc2);}return _0x43d7ea[_0xec7b('0x1e')](_0x52dfc2)[_0xec7b('0x1f')]();};}function respondWithResult(_0x5d9599,_0x7f54e0){_0x7f54e0=_0x7f54e0||0xc8;return function(_0x5d821c){if(_0x5d821c){return _0x5d9599[_0xec7b('0x1e')](_0x7f54e0)[_0xec7b('0x20')](_0x5d821c);}};}function respondWithFilteredResult(_0x1a9647,_0x39e7d1){return function(_0x5dee5d){if(_0x5dee5d){var _0x3d0ac8=typeof _0x39e7d1['offset']===_0xec7b('0x21')&&typeof _0x39e7d1[_0xec7b('0x22')]===_0xec7b('0x21');var _0x713d96=_0x5dee5d['count'];var _0xd0dcba=_0x3d0ac8?0x0:_0x39e7d1[_0xec7b('0x23')];var _0x8dd822=_0x3d0ac8?_0x5dee5d[_0xec7b('0x24')]:_0x39e7d1[_0xec7b('0x23')]+_0x39e7d1['limit'];var _0x52e039;if(_0x8dd822>=_0x713d96){_0x8dd822=_0x713d96;_0x52e039=0xc8;}else{_0x52e039=0xce;}_0x1a9647[_0xec7b('0x1e')](_0x52e039);return _0x1a9647[_0xec7b('0x25')]('Content-Range',_0xd0dcba+'-'+_0x8dd822+'/'+_0x713d96)[_0xec7b('0x20')](_0x5dee5d);}return null;};}function patchUpdates(_0x907fb0){return function(_0x171a7c){try{jsonpatch[_0xec7b('0x26')](_0x171a7c,_0x907fb0,!![]);}catch(_0x32f66e){return BPromise[_0xec7b('0x27')](_0x32f66e);}return _0x171a7c['save']();};}function saveUpdates(_0x5679b6,_0x468654){return function(_0x5a9e42){if(_0x5a9e42){return _0x5a9e42['update'](_0x5679b6)[_0xec7b('0x28')](function(_0x2a54b2){return _0x2a54b2;});}return null;};}function removeEntity(_0x16ae2f,_0x24d986){return function(_0xa3be06){if(_0xa3be06){return _0xa3be06[_0xec7b('0x29')]()['then'](function(){_0x16ae2f[_0xec7b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c908,_0x16404b){return function(_0x92b8c1){if(!_0x92b8c1){_0x30c908[_0xec7b('0x1d')](0x194);}return _0x92b8c1;};}function handleError(_0x5a1ae2,_0x2c8e5a){_0x2c8e5a=_0x2c8e5a||0x1f4;return function(_0x502721){logger[_0xec7b('0x2a')](_0x502721[_0xec7b('0x2b')]);if(_0x502721[_0xec7b('0x2c')]){delete _0x502721[_0xec7b('0x2c')];}_0x5a1ae2['status'](_0x2c8e5a)[_0xec7b('0x2d')](_0x502721);};}exports['index']=function(_0x2967be,_0x314e15){var _0x51fe25={},_0x122956={},_0x122a5e={'count':0x0,'rows':[]};var _0x19a30d=_[_0xec7b('0x2e')](db['ZendeskField'][_0xec7b('0x2f')],function(_0x27542d){return{'name':_0x27542d['fieldName'],'type':_0x27542d[_0xec7b('0x30')][_0xec7b('0x31')]};});_0x122956['model']=_[_0xec7b('0x2e')](_0x19a30d,'name');_0x122956[_0xec7b('0x32')]=_[_0xec7b('0x33')](_0x2967be[_0xec7b('0x32')]);_0x122956[_0xec7b('0x34')]=_['intersection'](_0x122956[_0xec7b('0x35')],_0x122956[_0xec7b('0x32')]);_0x51fe25[_0xec7b('0x36')]=_['intersection'](_0x122956['model'],qs[_0xec7b('0x37')](_0x2967be[_0xec7b('0x32')][_0xec7b('0x37')]));_0x51fe25['attributes']=_0x51fe25[_0xec7b('0x36')]['length']?_0x51fe25['attributes']:_0x122956[_0xec7b('0x35')];if(!_0x2967be['query']['hasOwnProperty'](_0xec7b('0x38'))){_0x51fe25[_0xec7b('0x22')]=qs[_0xec7b('0x22')](_0x2967be[_0xec7b('0x32')][_0xec7b('0x22')]);_0x51fe25['offset']=qs['offset'](_0x2967be[_0xec7b('0x32')][_0xec7b('0x23')]);}_0x51fe25['order']=qs['sort'](_0x2967be[_0xec7b('0x32')][_0xec7b('0x39')]);_0x51fe25[_0xec7b('0x3a')]=qs[_0xec7b('0x34')](_['pick'](_0x2967be[_0xec7b('0x32')],_0x122956['filters']),_0x19a30d);if(_0x2967be['query'][_0xec7b('0x3b')]){_0x51fe25[_0xec7b('0x3a')]=_[_0xec7b('0x3c')](_0x51fe25[_0xec7b('0x3a')],{'$or':_[_0xec7b('0x2e')](_0x19a30d,function(_0x1123c0){if(_0x1123c0[_0xec7b('0x30')]!==_0xec7b('0x3d')){var _0x3ca6bf={};_0x3ca6bf[_0x1123c0[_0xec7b('0x2c')]]={'$like':'%'+_0x2967be[_0xec7b('0x32')][_0xec7b('0x3b')]+'%'};return _0x3ca6bf;}})});}_0x51fe25=_['merge']({},_0x51fe25,_0x2967be[_0xec7b('0x3e')]);var _0x50ef27={'where':_0x51fe25['where']};return db['ZendeskField'][_0xec7b('0x24')](_0x50ef27)[_0xec7b('0x28')](function(_0x2600e5){_0x122a5e['count']=_0x2600e5;if(_0x2967be[_0xec7b('0x32')][_0xec7b('0x3f')]){_0x51fe25[_0xec7b('0x40')]=[{'all':!![]}];}return db['ZendeskField'][_0xec7b('0x41')](_0x51fe25);})[_0xec7b('0x28')](function(_0x56a370){_0x122a5e[_0xec7b('0x42')]=_0x56a370;return _0x122a5e;})[_0xec7b('0x28')](respondWithFilteredResult(_0x314e15,_0x51fe25))[_0xec7b('0x43')](handleError(_0x314e15,null));};exports[_0xec7b('0x44')]=function(_0x268c0d,_0x1394f7){var _0x32f9c8={'raw':!![],'where':{'id':_0x268c0d['params']['id']}},_0x215526={};_0x215526[_0xec7b('0x35')]=_['keys'](db['ZendeskField'][_0xec7b('0x2f')]);_0x215526['query']=_[_0xec7b('0x33')](_0x268c0d[_0xec7b('0x32')]);_0x215526[_0xec7b('0x34')]=_[_0xec7b('0x45')](_0x215526[_0xec7b('0x35')],_0x215526[_0xec7b('0x32')]);_0x32f9c8[_0xec7b('0x36')]=_[_0xec7b('0x45')](_0x215526[_0xec7b('0x35')],qs[_0xec7b('0x37')](_0x268c0d['query'][_0xec7b('0x37')]));_0x32f9c8[_0xec7b('0x36')]=_0x32f9c8[_0xec7b('0x36')]['length']?_0x32f9c8['attributes']:_0x215526[_0xec7b('0x35')];if(_0x268c0d[_0xec7b('0x32')][_0xec7b('0x3f')]){_0x32f9c8[_0xec7b('0x40')]=[{'all':!![]}];}_0x32f9c8=_[_0xec7b('0x3c')]({},_0x32f9c8,_0x268c0d['options']);return db[_0xec7b('0x46')][_0xec7b('0x47')](_0x32f9c8)[_0xec7b('0x28')](handleEntityNotFound(_0x1394f7,null))['then'](respondWithResult(_0x1394f7,null))['catch'](handleError(_0x1394f7,null));};exports[_0xec7b('0x48')]=function(_0x5b89f4,_0x447fc4){return db[_0xec7b('0x46')][_0xec7b('0x48')](_0x5b89f4['body'],{})[_0xec7b('0x28')](respondWithResult(_0x447fc4,0xc9))['catch'](handleError(_0x447fc4,null));};exports[_0xec7b('0x49')]=function(_0x5d7dc5,_0x37ac29){if(_0x5d7dc5['body']['id']){delete _0x5d7dc5['body']['id'];}return db[_0xec7b('0x46')][_0xec7b('0x47')]({'where':{'id':_0x5d7dc5[_0xec7b('0x4a')]['id']}})[_0xec7b('0x28')](handleEntityNotFound(_0x37ac29,null))[_0xec7b('0x28')](saveUpdates(_0x5d7dc5[_0xec7b('0x4b')],null))[_0xec7b('0x28')](respondWithResult(_0x37ac29,null))['catch'](handleError(_0x37ac29,null));};exports[_0xec7b('0x29')]=function(_0x386dff,_0x536669){return db[_0xec7b('0x46')][_0xec7b('0x47')]({'where':{'id':_0x386dff[_0xec7b('0x4a')]['id']}})[_0xec7b('0x28')](handleEntityNotFound(_0x536669,null))[_0xec7b('0x28')](removeEntity(_0x536669,null))[_0xec7b('0x43')](handleError(_0x536669,null));}; \ No newline at end of file +var _0x3edd=['end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','fields','options','find','create','body','params','catch','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2ac88e,_0x1a3436){var _0x3ac6e1=function(_0x2fc601){while(--_0x2fc601){_0x2ac88e['push'](_0x2ac88e['shift']());}};_0x3ac6e1(++_0x1a3436);}(_0x3edd,0x79));var _0xd3ed=function(_0x16fbaf,_0x3504c9){_0x16fbaf=_0x16fbaf-0x0;var _0x50d295=_0x3edd[_0x16fbaf];return _0x50d295;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3ed('0x1'));var rp=require(_0xd3ed('0x2'));var moment=require('moment');var BPromise=require(_0xd3ed('0x3'));var Mustache=require(_0xd3ed('0x4'));var util=require('util');var path=require(_0xd3ed('0x5'));var sox=require(_0xd3ed('0x6'));var csv=require(_0xd3ed('0x7'));var ejs=require(_0xd3ed('0x8'));var fs=require('fs');var fs_extra=require(_0xd3ed('0x9'));var _=require(_0xd3ed('0xa'));var squel=require(_0xd3ed('0xb'));var crypto=require('crypto');var jsforce=require(_0xd3ed('0xc'));var deskjs=require(_0xd3ed('0xd'));var toCsv=require(_0xd3ed('0x7'));var querystring=require(_0xd3ed('0xe'));var Papa=require(_0xd3ed('0xf'));var Redis=require(_0xd3ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd3ed('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3ed('0x12'));var logger=require(_0xd3ed('0x13'))(_0xd3ed('0x14'));var utils=require(_0xd3ed('0x15'));var config=require(_0xd3ed('0x16'));var licenseUtil=require(_0xd3ed('0x17'));var db=require(_0xd3ed('0x18'))['db'];function respondWithStatusCode(_0x12744e,_0x3bf4a9){_0x3bf4a9=_0x3bf4a9||0xcc;return function(_0x5e1b88){if(_0x5e1b88){return _0x12744e[_0xd3ed('0x19')](_0x3bf4a9);}return _0x12744e[_0xd3ed('0x1a')](_0x3bf4a9)[_0xd3ed('0x1b')]();};}function respondWithResult(_0x462568,_0x3a753a){_0x3a753a=_0x3a753a||0xc8;return function(_0x5a51ca){if(_0x5a51ca){return _0x462568[_0xd3ed('0x1a')](_0x3a753a)[_0xd3ed('0x1c')](_0x5a51ca);}};}function respondWithFilteredResult(_0x392d7b,_0x23b80c){return function(_0x1467fd){if(_0x1467fd){var _0x191f15=typeof _0x23b80c[_0xd3ed('0x1d')]===_0xd3ed('0x1e')&&typeof _0x23b80c[_0xd3ed('0x1f')]==='undefined';var _0x5190ac=_0x1467fd['count'];var _0x59ea03=_0x191f15?0x0:_0x23b80c[_0xd3ed('0x1d')];var _0x5413a3=_0x191f15?_0x1467fd['count']:_0x23b80c[_0xd3ed('0x1d')]+_0x23b80c['limit'];var _0x27ef54;if(_0x5413a3>=_0x5190ac){_0x5413a3=_0x5190ac;_0x27ef54=0xc8;}else{_0x27ef54=0xce;}_0x392d7b[_0xd3ed('0x1a')](_0x27ef54);return _0x392d7b[_0xd3ed('0x20')]('Content-Range',_0x59ea03+'-'+_0x5413a3+'/'+_0x5190ac)[_0xd3ed('0x1c')](_0x1467fd);}return null;};}function patchUpdates(_0x265136){return function(_0x2417b4){try{jsonpatch[_0xd3ed('0x21')](_0x2417b4,_0x265136,!![]);}catch(_0xb0152c){return BPromise[_0xd3ed('0x22')](_0xb0152c);}return _0x2417b4[_0xd3ed('0x23')]();};}function saveUpdates(_0x3c5b67,_0x59d1f9){return function(_0x4f4a01){if(_0x4f4a01){return _0x4f4a01[_0xd3ed('0x24')](_0x3c5b67)[_0xd3ed('0x25')](function(_0x126143){return _0x126143;});}return null;};}function removeEntity(_0x3cb23d,_0x3ba25f){return function(_0xac7c03){if(_0xac7c03){return _0xac7c03[_0xd3ed('0x26')]()[_0xd3ed('0x25')](function(){_0x3cb23d['status'](0xcc)[_0xd3ed('0x1b')]();});}};}function handleEntityNotFound(_0x18234e,_0x534597){return function(_0x5f3ba3){if(!_0x5f3ba3){_0x18234e['sendStatus'](0x194);}return _0x5f3ba3;};}function handleError(_0x52fe43,_0x5d41fd){_0x5d41fd=_0x5d41fd||0x1f4;return function(_0x51ebd6){logger[_0xd3ed('0x27')](_0x51ebd6['stack']);if(_0x51ebd6['name']){delete _0x51ebd6[_0xd3ed('0x28')];}_0x52fe43['status'](_0x5d41fd)['send'](_0x51ebd6);};}exports[_0xd3ed('0x29')]=function(_0x26c63d,_0x16105c){var _0x3b9a2a={},_0x4d8ff0={},_0x5cc27d={'count':0x0,'rows':[]};var _0x499074=_[_0xd3ed('0x2a')](db[_0xd3ed('0x2b')][_0xd3ed('0x2c')],function(_0x1b3e7f){return{'name':_0x1b3e7f[_0xd3ed('0x2d')],'type':_0x1b3e7f[_0xd3ed('0x2e')][_0xd3ed('0x2f')]};});_0x4d8ff0[_0xd3ed('0x30')]=_[_0xd3ed('0x2a')](_0x499074,_0xd3ed('0x28'));_0x4d8ff0[_0xd3ed('0x31')]=_['keys'](_0x26c63d[_0xd3ed('0x31')]);_0x4d8ff0[_0xd3ed('0x32')]=_[_0xd3ed('0x33')](_0x4d8ff0[_0xd3ed('0x30')],_0x4d8ff0[_0xd3ed('0x31')]);_0x3b9a2a[_0xd3ed('0x34')]=_[_0xd3ed('0x33')](_0x4d8ff0[_0xd3ed('0x30')],qs['fields'](_0x26c63d['query']['fields']));_0x3b9a2a[_0xd3ed('0x34')]=_0x3b9a2a[_0xd3ed('0x34')][_0xd3ed('0x35')]?_0x3b9a2a[_0xd3ed('0x34')]:_0x4d8ff0[_0xd3ed('0x30')];if(!_0x26c63d[_0xd3ed('0x31')][_0xd3ed('0x36')](_0xd3ed('0x37'))){_0x3b9a2a['limit']=qs[_0xd3ed('0x1f')](_0x26c63d[_0xd3ed('0x31')]['limit']);_0x3b9a2a[_0xd3ed('0x1d')]=qs[_0xd3ed('0x1d')](_0x26c63d[_0xd3ed('0x31')][_0xd3ed('0x1d')]);}_0x3b9a2a[_0xd3ed('0x38')]=qs['sort'](_0x26c63d[_0xd3ed('0x31')]['sort']);_0x3b9a2a[_0xd3ed('0x39')]=qs[_0xd3ed('0x32')](_['pick'](_0x26c63d[_0xd3ed('0x31')],_0x4d8ff0['filters']),_0x499074);if(_0x26c63d['query'][_0xd3ed('0x3a')]){_0x3b9a2a['where']=_[_0xd3ed('0x3b')](_0x3b9a2a['where'],{'$or':_[_0xd3ed('0x2a')](_0x499074,function(_0x17d4ea){if(_0x17d4ea[_0xd3ed('0x2e')]!==_0xd3ed('0x3c')){var _0x86e660={};_0x86e660[_0x17d4ea[_0xd3ed('0x28')]]={'$like':'%'+_0x26c63d[_0xd3ed('0x31')][_0xd3ed('0x3a')]+'%'};return _0x86e660;}})});}_0x3b9a2a=_[_0xd3ed('0x3b')]({},_0x3b9a2a,_0x26c63d['options']);var _0x102a68={'where':_0x3b9a2a[_0xd3ed('0x39')]};return db['ZendeskField']['count'](_0x102a68)['then'](function(_0x221a70){_0x5cc27d['count']=_0x221a70;if(_0x26c63d[_0xd3ed('0x31')][_0xd3ed('0x3d')]){_0x3b9a2a[_0xd3ed('0x3e')]=[{'all':!![]}];}return db[_0xd3ed('0x2b')][_0xd3ed('0x3f')](_0x3b9a2a);})[_0xd3ed('0x25')](function(_0x2927e3){_0x5cc27d[_0xd3ed('0x40')]=_0x2927e3;return _0x5cc27d;})['then'](respondWithFilteredResult(_0x16105c,_0x3b9a2a))['catch'](handleError(_0x16105c,null));};exports[_0xd3ed('0x41')]=function(_0x14fd0e,_0x53092c){var _0x3a11d9={'raw':!![],'where':{'id':_0x14fd0e['params']['id']}},_0x174786={};_0x174786['model']=_[_0xd3ed('0x42')](db['ZendeskField'][_0xd3ed('0x2c')]);_0x174786[_0xd3ed('0x31')]=_['keys'](_0x14fd0e['query']);_0x174786[_0xd3ed('0x32')]=_['intersection'](_0x174786[_0xd3ed('0x30')],_0x174786[_0xd3ed('0x31')]);_0x3a11d9[_0xd3ed('0x34')]=_[_0xd3ed('0x33')](_0x174786[_0xd3ed('0x30')],qs[_0xd3ed('0x43')](_0x14fd0e['query'][_0xd3ed('0x43')]));_0x3a11d9[_0xd3ed('0x34')]=_0x3a11d9[_0xd3ed('0x34')]['length']?_0x3a11d9[_0xd3ed('0x34')]:_0x174786['model'];if(_0x14fd0e[_0xd3ed('0x31')][_0xd3ed('0x3d')]){_0x3a11d9[_0xd3ed('0x3e')]=[{'all':!![]}];}_0x3a11d9=_[_0xd3ed('0x3b')]({},_0x3a11d9,_0x14fd0e[_0xd3ed('0x44')]);return db[_0xd3ed('0x2b')][_0xd3ed('0x45')](_0x3a11d9)[_0xd3ed('0x25')](handleEntityNotFound(_0x53092c,null))[_0xd3ed('0x25')](respondWithResult(_0x53092c,null))['catch'](handleError(_0x53092c,null));};exports[_0xd3ed('0x46')]=function(_0x1d56e2,_0x39069b){return db['ZendeskField'][_0xd3ed('0x46')](_0x1d56e2[_0xd3ed('0x47')],{})[_0xd3ed('0x25')](respondWithResult(_0x39069b,0xc9))['catch'](handleError(_0x39069b,null));};exports[_0xd3ed('0x24')]=function(_0x52a2b1,_0x1b1188){if(_0x52a2b1[_0xd3ed('0x47')]['id']){delete _0x52a2b1[_0xd3ed('0x47')]['id'];}return db[_0xd3ed('0x2b')][_0xd3ed('0x45')]({'where':{'id':_0x52a2b1[_0xd3ed('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b1188,null))['then'](saveUpdates(_0x52a2b1['body'],null))[_0xd3ed('0x25')](respondWithResult(_0x1b1188,null))[_0xd3ed('0x49')](handleError(_0x1b1188,null));};exports[_0xd3ed('0x26')]=function(_0x5ba9d7,_0x4b4a4d){return db[_0xd3ed('0x2b')][_0xd3ed('0x45')]({'where':{'id':_0x5ba9d7[_0xd3ed('0x48')]['id']}})[_0xd3ed('0x25')](handleEntityNotFound(_0x4b4a4d,null))['then'](removeEntity(_0x4b4a4d,null))['catch'](handleError(_0x4b4a4d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 90463c9..6798445 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 _0xeab3=['./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x50118b,_0x2a6ba2){var _0x1b9c87=function(_0x2453a8){while(--_0x2453a8){_0x50118b['push'](_0x50118b['shift']());}};_0x1b9c87(++_0x2a6ba2);}(_0xeab3,0x1c6));var _0x3eab=function(_0x14f009,_0x4d3a3c){_0x14f009=_0x14f009-0x0;var _0x3c9312=_0xeab3[_0x14f009];return _0x3c9312;};'use strict';var _=require(_0x3eab('0x0'));var util=require(_0x3eab('0x1'));var logger=require(_0x3eab('0x2'))(_0x3eab('0x3'));var moment=require(_0x3eab('0x4'));var BPromise=require('bluebird');var rp=require(_0x3eab('0x5'));var fs=require('fs');var path=require(_0x3eab('0x6'));var rimraf=require(_0x3eab('0x7'));var config=require('../../config/environment');var attributes=require(_0x3eab('0x8'));module[_0x3eab('0x9')]=function(_0x1c4682,_0x1fc1fb){return _0x1c4682[_0x3eab('0xa')]('ZendeskField',attributes,{'tableName':_0x3eab('0xb'),'paranoid':![],'indexes':[{'name':_0x3eab('0xc'),'fields':[_0x3eab('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae6f=['moment','bluebird','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','FieldId','lodash','../../config/logger'];(function(_0x4043d9,_0x20d5c6){var _0x4dfc69=function(_0x8dc38d){while(--_0x8dc38d){_0x4043d9['push'](_0x4043d9['shift']());}};_0x4dfc69(++_0x20d5c6);}(_0xae6f,0x1ab));var _0xfae6=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xae6f[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xfae6('0x0'));var util=require('util');var logger=require(_0xfae6('0x1'))('api');var moment=require(_0xfae6('0x2'));var BPromise=require(_0xfae6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfae6('0x4'));var rimraf=require(_0xfae6('0x5'));var config=require('../../config/environment');var attributes=require(_0xfae6('0x6'));module[_0xfae6('0x7')]=function(_0x40c7bd,_0x564513){return _0x40c7bd[_0xfae6('0x8')](_0xfae6('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xfae6('0xa')],'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 80006fe..2a0dcb2 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 _0x5afe=['../../mysqldb','../../config/utils','../../config/environment','client','then','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0xe4ac78,_0x91562f){var _0x1d1bbb=function(_0x1d5477){while(--_0x1d5477){_0xe4ac78['push'](_0xe4ac78['shift']());}};_0x1d1bbb(++_0x91562f);}(_0x5afe,0x177));var _0xe5af=function(_0x2803dc,_0x1cdaf1){_0x2803dc=_0x2803dc-0x0;var _0x552ae4=_0x5afe[_0x2803dc];return _0x552ae4;};'use strict';var _=require(_0xe5af('0x0'));var util=require(_0xe5af('0x1'));var moment=require(_0xe5af('0x2'));var BPromise=require('bluebird');var rs=require(_0xe5af('0x3'));var fs=require('fs');var Redis=require(_0xe5af('0x4'));var db=require(_0xe5af('0x5'))['db'];var utils=require(_0xe5af('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe5af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe5af('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b9c4e,_0xf0709d,_0x4cc525){return new BPromise(function(_0x584262,_0x28d2bf){return client['request'](_0x2b9c4e,_0x4cc525)[_0xe5af('0x9')](function(_0x1489d6){logger[_0xe5af('0xa')]('ZendeskField,\x20%s,\x20%s',_0xf0709d,_0xe5af('0xb'));logger['debug'](_0xe5af('0xc'),_0xf0709d,_0xe5af('0xb'),JSON[_0xe5af('0xd')](_0x1489d6));if(_0x1489d6[_0xe5af('0xe')]){if(_0x1489d6[_0xe5af('0xe')][_0xe5af('0xf')]===0x1f4){logger[_0xe5af('0xe')](_0xe5af('0x10'),_0xf0709d,_0x1489d6[_0xe5af('0xe')][_0xe5af('0x11')]);return _0x28d2bf(_0x1489d6[_0xe5af('0xe')][_0xe5af('0x11')]);}logger[_0xe5af('0xe')](_0xe5af('0x10'),_0xf0709d,_0x1489d6['error'][_0xe5af('0x11')]);return _0x584262(_0x1489d6[_0xe5af('0xe')]['message']);}else{logger[_0xe5af('0xa')](_0xe5af('0x10'),_0xf0709d,_0xe5af('0xb'));_0x584262(_0x1489d6[_0xe5af('0x12')]['message']);}})[_0xe5af('0x13')](function(_0x106220){logger[_0xe5af('0xe')](_0xe5af('0x10'),_0xf0709d,_0x106220);_0x28d2bf(_0x106220);});});} \ No newline at end of file +var _0xd618=['jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x247b2c,_0x52354c){var _0x14986e=function(_0xe60b3d){while(--_0xe60b3d){_0x247b2c['push'](_0x247b2c['shift']());}};_0x14986e(++_0x52354c);}(_0xd618,0x1c5));var _0x8d61=function(_0x437edb,_0x5ea790){_0x437edb=_0x437edb-0x0;var _0x3ea54a=_0xd618[_0x437edb];return _0x3ea54a;};'use strict';var _=require('lodash');var util=require(_0x8d61('0x0'));var moment=require(_0x8d61('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d61('0x2'));var fs=require('fs');var Redis=require(_0x8d61('0x3'));var db=require(_0x8d61('0x4'))['db'];var utils=require(_0x8d61('0x5'));var logger=require(_0x8d61('0x6'))(_0x8d61('0x7'));var config=require(_0x8d61('0x8'));var jayson=require(_0x8d61('0x9'));var client=jayson['client'][_0x8d61('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ef20f,_0x54fc22,_0x22b7cf){return new BPromise(function(_0x23c3e3,_0x1bf0d2){return client[_0x8d61('0xb')](_0x2ef20f,_0x22b7cf)[_0x8d61('0xc')](function(_0x478933){logger[_0x8d61('0xd')](_0x8d61('0xe'),_0x54fc22,_0x8d61('0xf'));logger[_0x8d61('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x54fc22,_0x8d61('0xf'),JSON['stringify'](_0x478933));if(_0x478933['error']){if(_0x478933[_0x8d61('0x11')]['code']===0x1f4){logger[_0x8d61('0x11')](_0x8d61('0xe'),_0x54fc22,_0x478933[_0x8d61('0x11')][_0x8d61('0x12')]);return _0x1bf0d2(_0x478933[_0x8d61('0x11')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x54fc22,_0x478933['error']['message']);return _0x23c3e3(_0x478933[_0x8d61('0x11')][_0x8d61('0x12')]);}else{logger[_0x8d61('0xd')]('ZendeskField,\x20%s,\x20%s',_0x54fc22,_0x8d61('0xf'));_0x23c3e3(_0x478933[_0x8d61('0x13')][_0x8d61('0x12')]);}})[_0x8d61('0x14')](function(_0x50b76f){logger[_0x8d61('0x11')](_0x8d61('0xe'),_0x54fc22,_0x50b76f);_0x1bf0d2(_0x50b76f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 3be8a37..07beb20 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 _0x4599=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','/:id','get','getConfigurations','post','/:id/configurations','addConfiguration','update','destroy'];(function(_0x189e83,_0x3028b5){var _0x27e004=function(_0x430bd2){while(--_0x430bd2){_0x189e83['push'](_0x189e83['shift']());}};_0x27e004(++_0x3028b5);}(_0x4599,0x131));var _0x9459=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4599[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9459('0x0'));var util=require(_0x9459('0x1'));var path=require(_0x9459('0x2'));var timeout=require(_0x9459('0x3'));var express=require('express');var router=express[_0x9459('0x4')]();var fs_extra=require(_0x9459('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9459('0x6'));var controller=require(_0x9459('0x7'));router['get']('/',auth[_0x9459('0x8')](),controller[_0x9459('0x9')]);router['get'](_0x9459('0xa'),auth[_0x9459('0x8')](),controller['show']);router[_0x9459('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9459('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x9459('0xd')]('/',auth[_0x9459('0x8')](),controller['create']);router[_0x9459('0xd')](_0x9459('0xe'),auth[_0x9459('0x8')](),controller[_0x9459('0xf')]);router['put'](_0x9459('0xa'),auth[_0x9459('0x8')](),controller[_0x9459('0x10')]);router['delete'](_0x9459('0xa'),auth[_0x9459('0x8')](),controller[_0x9459('0x11')]);module[_0x9459('0x12')]=router; \ No newline at end of file +var _0xf6cc=['post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0xb6da2d,_0x9dbbba){var _0x155572=function(_0x2ebdd3){while(--_0x2ebdd3){_0xb6da2d['push'](_0xb6da2d['shift']());}};_0x155572(++_0x9dbbba);}(_0xf6cc,0x118));var _0xcf6c=function(_0x3bca4f,_0x25085a){_0x3bca4f=_0x3bca4f-0x0;var _0x39ddf5=_0xf6cc[_0x3bca4f];return _0x39ddf5;};'use strict';var multer=require(_0xcf6c('0x0'));var util=require(_0xcf6c('0x1'));var path=require('path');var timeout=require(_0xcf6c('0x2'));var express=require(_0xcf6c('0x3'));var router=express[_0xcf6c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcf6c('0x5'));var config=require(_0xcf6c('0x6'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xcf6c('0x7')](),controller['index']);router[_0xcf6c('0x8')](_0xcf6c('0x9'),auth[_0xcf6c('0x7')](),controller['show']);router[_0xcf6c('0x8')](_0xcf6c('0xa'),auth['isAuthenticated'](),controller[_0xcf6c('0xb')]);router['get'](_0xcf6c('0xc'),auth[_0xcf6c('0x7')](),controller[_0xcf6c('0xd')]);router[_0xcf6c('0xe')]('/',auth[_0xcf6c('0x7')](),controller[_0xcf6c('0xf')]);router[_0xcf6c('0xe')](_0xcf6c('0xa'),auth['isAuthenticated'](),controller[_0xcf6c('0x10')]);router[_0xcf6c('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcf6c('0x12')]('/:id',auth[_0xcf6c('0x7')](),controller[_0xcf6c('0x13')]);module[_0xcf6c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 55b62bb..c7145c4 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 _0x22fb=['STRING'];(function(_0x1562ff,_0x3363a3){var _0x393bd9=function(_0x3106dc){while(--_0x3106dc){_0x1562ff['push'](_0x1562ff['shift']());}};_0x393bd9(++_0x3363a3);}(_0x22fb,0x192));var _0xb22f=function(_0x288fcf,_0x4ad800){_0x288fcf=_0x288fcf-0x0;var _0xc50cc2=_0x22fb[_0x288fcf];return _0xc50cc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file +var _0x2750=['STRING','sequelize'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0x2750,0x13b));var _0x0275=function(_0x2e7eb6,_0xf8636c){_0x2e7eb6=_0x2e7eb6-0x0;var _0x61463c=_0x2750[_0x2e7eb6];return _0x61463c;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'host':{'type':Sequelize[_0x0275('0x1')]},'zone':{'type':Sequelize[_0x0275('0x1')]},'clientId':{'type':Sequelize[_0x0275('0x1')]},'clientSecret':{'type':Sequelize[_0x0275('0x1')]},'serverUrl':{'type':Sequelize[_0x0275('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x0275('0x1')]},'refreshToken':{'type':Sequelize[_0x0275('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 52c1349..e236052 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 _0x8f0e=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','end','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','params','options','find','catch','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','host','clientId','serverUrl','code','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x37abbb,_0x257989){var _0x21abce=function(_0x4d27eb){while(--_0x4d27eb){_0x37abbb['push'](_0x37abbb['shift']());}};_0x21abce(++_0x257989);}(_0x8f0e,0x185));var _0xe8f0=function(_0x4b66ab,_0x4d1140){_0x4b66ab=_0x4b66ab-0x0;var _0x58b2ac=_0x8f0e[_0x4b66ab];return _0x58b2ac;};'use strict';var emlformat=require(_0xe8f0('0x0'));var rimraf=require(_0xe8f0('0x1'));var zipdir=require(_0xe8f0('0x2'));var jsonpatch=require(_0xe8f0('0x3'));var rp=require(_0xe8f0('0x4'));var moment=require(_0xe8f0('0x5'));var BPromise=require(_0xe8f0('0x6'));var Mustache=require(_0xe8f0('0x7'));var util=require(_0xe8f0('0x8'));var path=require(_0xe8f0('0x9'));var sox=require(_0xe8f0('0xa'));var csv=require(_0xe8f0('0xb'));var ejs=require(_0xe8f0('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe8f0('0xd'));var squel=require(_0xe8f0('0xe'));var crypto=require(_0xe8f0('0xf'));var jsforce=require(_0xe8f0('0x10'));var deskjs=require(_0xe8f0('0x11'));var toCsv=require(_0xe8f0('0xb'));var querystring=require(_0xe8f0('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe8f0('0x13'));var qs=require(_0xe8f0('0x14'));var as=require(_0xe8f0('0x15'));var hardwareService=require(_0xe8f0('0x16'));var logger=require(_0xe8f0('0x17'))(_0xe8f0('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe8f0('0x19'))['db'];var integrations=require(_0xe8f0('0x1a'));function respondWithStatusCode(_0x3f2728,_0x68ba22){_0x68ba22=_0x68ba22||0xcc;return function(_0x456764){if(_0x456764){return _0x3f2728[_0xe8f0('0x1b')](_0x68ba22);}return _0x3f2728[_0xe8f0('0x1c')](_0x68ba22)['end']();};}function respondWithResult(_0x5a056b,_0x935230){_0x935230=_0x935230||0xc8;return function(_0x56aefb){if(_0x56aefb){return _0x5a056b['status'](_0x935230)[_0xe8f0('0x1d')](_0x56aefb);}};}function respondWithFilteredResult(_0x1c47ba,_0x575407){return function(_0x48c3b7){if(_0x48c3b7){var _0x3b16cb=typeof _0x575407['offset']===_0xe8f0('0x1e')&&typeof _0x575407[_0xe8f0('0x1f')]==='undefined';var _0x4a7a19=_0x48c3b7[_0xe8f0('0x20')];var _0x4a8faa=_0x3b16cb?0x0:_0x575407[_0xe8f0('0x21')];var _0x116d8a=_0x3b16cb?_0x48c3b7['count']:_0x575407[_0xe8f0('0x21')]+_0x575407['limit'];var _0x29e45d;if(_0x116d8a>=_0x4a7a19){_0x116d8a=_0x4a7a19;_0x29e45d=0xc8;}else{_0x29e45d=0xce;}_0x1c47ba[_0xe8f0('0x1c')](_0x29e45d);return _0x1c47ba['set']('Content-Range',_0x4a8faa+'-'+_0x116d8a+'/'+_0x4a7a19)[_0xe8f0('0x1d')](_0x48c3b7);}return null;};}function patchUpdates(_0x3c075a){return function(_0x1596d5){try{jsonpatch[_0xe8f0('0x22')](_0x1596d5,_0x3c075a,!![]);}catch(_0x506cd8){return BPromise[_0xe8f0('0x23')](_0x506cd8);}return _0x1596d5[_0xe8f0('0x24')]();};}function saveUpdates(_0x49bb17,_0x22f776){return function(_0x4ebf36){if(_0x4ebf36){return _0x4ebf36[_0xe8f0('0x25')](_0x49bb17)[_0xe8f0('0x26')](function(_0x20f3ce){return _0x20f3ce;});}return null;};}function removeEntity(_0x4eab99,_0x4042f4){return function(_0x2b9ec0){if(_0x2b9ec0){return _0x2b9ec0['destroy']()[_0xe8f0('0x26')](function(){_0x4eab99['status'](0xcc)[_0xe8f0('0x27')]();});}};}function handleEntityNotFound(_0x19f689,_0x305e58){return function(_0x24e449){if(!_0x24e449){_0x19f689[_0xe8f0('0x1b')](0x194);}return _0x24e449;};}function handleError(_0x1b1d79,_0x33c4fe){_0x33c4fe=_0x33c4fe||0x1f4;return function(_0x37ac04){logger[_0xe8f0('0x28')](_0x37ac04[_0xe8f0('0x29')]);if(_0x37ac04[_0xe8f0('0x2a')]){delete _0x37ac04[_0xe8f0('0x2a')];}_0x1b1d79[_0xe8f0('0x1c')](_0x33c4fe)['send'](_0x37ac04);};}exports[_0xe8f0('0x2b')]=function(_0x5dce32,_0x519833){var _0x17549a={},_0x425a3d={},_0x3978e8={'count':0x0,'rows':[]};var _0x1df534=_[_0xe8f0('0x2c')](db[_0xe8f0('0x2d')][_0xe8f0('0x2e')],function(_0x1564c4){return{'name':_0x1564c4[_0xe8f0('0x2f')],'type':_0x1564c4['type'][_0xe8f0('0x30')]};});_0x425a3d['model']=_['map'](_0x1df534,'name');_0x425a3d[_0xe8f0('0x31')]=_[_0xe8f0('0x32')](_0x5dce32['query']);_0x425a3d[_0xe8f0('0x33')]=_['intersection'](_0x425a3d[_0xe8f0('0x34')],_0x425a3d[_0xe8f0('0x31')]);_0x17549a[_0xe8f0('0x35')]=_[_0xe8f0('0x36')](_0x425a3d[_0xe8f0('0x34')],qs['fields'](_0x5dce32['query'][_0xe8f0('0x37')]));_0x17549a['attributes']=_0x17549a['attributes'][_0xe8f0('0x38')]?_0x17549a[_0xe8f0('0x35')]:_0x425a3d[_0xe8f0('0x34')];if(!_0x5dce32[_0xe8f0('0x31')][_0xe8f0('0x39')]('nolimit')){_0x17549a[_0xe8f0('0x1f')]=qs['limit'](_0x5dce32['query'][_0xe8f0('0x1f')]);_0x17549a[_0xe8f0('0x21')]=qs[_0xe8f0('0x21')](_0x5dce32[_0xe8f0('0x31')][_0xe8f0('0x21')]);}_0x17549a[_0xe8f0('0x3a')]=qs[_0xe8f0('0x3b')](_0x5dce32[_0xe8f0('0x31')][_0xe8f0('0x3b')]);_0x17549a[_0xe8f0('0x3c')]=qs['filters'](_[_0xe8f0('0x3d')](_0x5dce32[_0xe8f0('0x31')],_0x425a3d[_0xe8f0('0x33')]),_0x1df534);if(_0x5dce32[_0xe8f0('0x31')][_0xe8f0('0x3e')]){_0x17549a[_0xe8f0('0x3c')]=_[_0xe8f0('0x3f')](_0x17549a['where'],{'$or':_[_0xe8f0('0x2c')](_0x1df534,function(_0x360d42){if(_0x360d42['type']!==_0xe8f0('0x40')){var _0x318d28={};_0x318d28[_0x360d42['name']]={'$like':'%'+_0x5dce32['query'][_0xe8f0('0x3e')]+'%'};return _0x318d28;}})});}_0x17549a=_['merge']({},_0x17549a,_0x5dce32['options']);var _0x253109={'where':_0x17549a['where']};return db[_0xe8f0('0x2d')]['count'](_0x253109)[_0xe8f0('0x26')](function(_0x1246d1){_0x3978e8[_0xe8f0('0x20')]=_0x1246d1;if(_0x5dce32[_0xe8f0('0x31')][_0xe8f0('0x41')]){_0x17549a[_0xe8f0('0x42')]=[{'all':!![]}];}return db[_0xe8f0('0x2d')][_0xe8f0('0x43')](_0x17549a);})['then'](function(_0x1c3ea9){_0x3978e8['rows']=_0x1c3ea9;return _0x3978e8;})[_0xe8f0('0x26')](respondWithFilteredResult(_0x519833,_0x17549a))['catch'](handleError(_0x519833,null));};exports['show']=function(_0x484a5b,_0x266009){var _0x5e7af1={'raw':![],'where':{'id':_0x484a5b[_0xe8f0('0x44')]['id']}},_0x394617={};_0x394617[_0xe8f0('0x34')]=_[_0xe8f0('0x32')](db['ZohoAccount'][_0xe8f0('0x2e')]);_0x394617[_0xe8f0('0x31')]=_[_0xe8f0('0x32')](_0x484a5b[_0xe8f0('0x31')]);_0x394617['filters']=_[_0xe8f0('0x36')](_0x394617['model'],_0x394617['query']);_0x5e7af1[_0xe8f0('0x35')]=_[_0xe8f0('0x36')](_0x394617['model'],qs[_0xe8f0('0x37')](_0x484a5b[_0xe8f0('0x31')]['fields']));_0x5e7af1[_0xe8f0('0x35')]=_0x5e7af1[_0xe8f0('0x35')][_0xe8f0('0x38')]?_0x5e7af1[_0xe8f0('0x35')]:_0x394617[_0xe8f0('0x34')];if(_0x484a5b['query'][_0xe8f0('0x41')]){_0x5e7af1[_0xe8f0('0x42')]=[{'all':!![]}];}_0x5e7af1=_[_0xe8f0('0x3f')]({},_0x5e7af1,_0x484a5b[_0xe8f0('0x45')]);return db[_0xe8f0('0x2d')][_0xe8f0('0x46')](_0x5e7af1)[_0xe8f0('0x26')](handleEntityNotFound(_0x266009,null))['then'](respondWithResult(_0x266009,null))[_0xe8f0('0x47')](handleError(_0x266009,null));};exports[_0xe8f0('0x48')]=function(_0x2788fa,_0x371a28){return db[_0xe8f0('0x2d')][_0xe8f0('0x48')](_0x2788fa[_0xe8f0('0x49')],{})['then'](respondWithResult(_0x371a28,0xc9))['catch'](handleError(_0x371a28,null));};exports[_0xe8f0('0x25')]=function(_0x1b65c6,_0x47e405){if(_0x1b65c6['body']['id']){delete _0x1b65c6[_0xe8f0('0x49')]['id'];}return db['ZohoAccount'][_0xe8f0('0x46')]({'where':{'id':_0x1b65c6[_0xe8f0('0x44')]['id']}})['then'](handleEntityNotFound(_0x47e405,null))[_0xe8f0('0x26')](saveUpdates(_0x1b65c6['body'],null))['then'](respondWithResult(_0x47e405,null))['catch'](handleError(_0x47e405,null));};exports[_0xe8f0('0x4a')]=function(_0x1b19f3,_0x31da13){return db[_0xe8f0('0x2d')][_0xe8f0('0x46')]({'where':{'id':_0x1b19f3[_0xe8f0('0x44')]['id']}})[_0xe8f0('0x26')](handleEntityNotFound(_0x31da13,null))[_0xe8f0('0x26')](removeEntity(_0x31da13,null))[_0xe8f0('0x47')](handleError(_0x31da13,null));};exports[_0xe8f0('0x4b')]=function(_0xe49110,_0x181531,_0x1f2ee1){var _0x3f7c8e={};var _0x72e652={};var _0x2b39de;var _0x145865;return db[_0xe8f0('0x2d')][_0xe8f0('0x4c')]({'where':{'id':_0xe49110[_0xe8f0('0x44')]['id']}})['then'](handleEntityNotFound(_0x181531,null))[_0xe8f0('0x26')](function(_0x28b0bf){if(_0x28b0bf){_0x2b39de=_0x28b0bf;_0x72e652['model']=_['keys'](db[_0xe8f0('0x4d')][_0xe8f0('0x2e')]);_0x72e652['query']=_[_0xe8f0('0x32')](_0xe49110['query']);_0x72e652['filters']=_[_0xe8f0('0x36')](_0x72e652['model'],_0x72e652['query']);_0x3f7c8e[_0xe8f0('0x35')]=_[_0xe8f0('0x36')](_0x72e652[_0xe8f0('0x34')],qs[_0xe8f0('0x37')](_0xe49110[_0xe8f0('0x31')][_0xe8f0('0x37')]));_0x3f7c8e['attributes']=_0x3f7c8e[_0xe8f0('0x35')][_0xe8f0('0x38')]?_0x3f7c8e[_0xe8f0('0x35')]:_0x72e652[_0xe8f0('0x34')];_0x3f7c8e[_0xe8f0('0x3a')]=qs[_0xe8f0('0x3b')](_0xe49110[_0xe8f0('0x31')][_0xe8f0('0x3b')]);_0x3f7c8e[_0xe8f0('0x3c')]=qs[_0xe8f0('0x33')](_[_0xe8f0('0x3d')](_0xe49110[_0xe8f0('0x31')],_0x72e652[_0xe8f0('0x33')]));if(_0xe49110['query'][_0xe8f0('0x3e')]){_0x3f7c8e[_0xe8f0('0x3c')]=_[_0xe8f0('0x3f')](_0x3f7c8e[_0xe8f0('0x3c')],{'$or':_[_0xe8f0('0x2c')](_0x3f7c8e['attributes'],function(_0x1cca97){var _0x4d3dba={};_0x4d3dba[_0x1cca97]={'$like':'%'+_0xe49110['query']['filter']+'%'};return _0x4d3dba;})});}_0x3f7c8e=_['merge']({},_0x3f7c8e,_0xe49110['options']);return _0x2b39de[_0xe8f0('0x4b')](_0x3f7c8e);}})[_0xe8f0('0x26')](function(_0x1f3c41){if(_0x1f3c41){_0x145865=_0x1f3c41[_0xe8f0('0x38')];if(!_0xe49110[_0xe8f0('0x31')][_0xe8f0('0x39')](_0xe8f0('0x4e'))){_0x3f7c8e['limit']=qs['limit'](_0xe49110[_0xe8f0('0x31')]['limit']);_0x3f7c8e['offset']=qs[_0xe8f0('0x21')](_0xe49110[_0xe8f0('0x31')][_0xe8f0('0x21')]);}return _0x2b39de[_0xe8f0('0x4b')](_0x3f7c8e);}})['then'](function(_0x1e20cb){if(_0x1e20cb){return _0x1e20cb?{'count':_0x145865,'rows':_0x1e20cb}:null;}})[_0xe8f0('0x26')](respondWithResult(_0x181531,null))[_0xe8f0('0x47')](handleError(_0x181531,null));};exports[_0xe8f0('0x4f')]=function(_0x55c224,_0x4fb7c7,_0x372f61){if(_0x55c224[_0xe8f0('0x49')]['id']){delete _0x55c224[_0xe8f0('0x49')]['id'];}return db[_0xe8f0('0x2d')][_0xe8f0('0x4c')]({'where':{'id':_0x55c224[_0xe8f0('0x44')]['id']}})[_0xe8f0('0x26')](handleEntityNotFound(_0x4fb7c7,null))['then'](function(_0x3381be){if(_0x3381be){_0x55c224['body'][_0xe8f0('0x50')]=_0x3381be['id'];_0x55c224[_0xe8f0('0x49')]['Subjects']=integrations[_0xe8f0('0x51')](_0x55c224[_0xe8f0('0x49')][_0xe8f0('0x52')],_0x55c224[_0xe8f0('0x49')][_0xe8f0('0x53')]);_0x55c224[_0xe8f0('0x49')][_0xe8f0('0x54')]=integrations[_0xe8f0('0x55')](_0x55c224[_0xe8f0('0x49')][_0xe8f0('0x52')],_0x55c224[_0xe8f0('0x49')][_0xe8f0('0x53')]);return db['ZohoConfiguration'][_0xe8f0('0x48')](_0x55c224[_0xe8f0('0x49')],{'include':[{'model':db['ZohoField'],'as':_0xe8f0('0x56')},{'model':db['ZohoField'],'as':_0xe8f0('0x54')}]});}return null;})[_0xe8f0('0x26')](respondWithResult(_0x4fb7c7,null))['catch'](handleError(_0x4fb7c7,null));};function getAccessToken(_0x25a605){return new Promise(function(_0x1ef61b,_0x3587c1){var _0x1483b1;switch(_0x25a605[_0xe8f0('0x57')]){case'US':_0x1483b1=_0xe8f0('0x58');break;case'AU':_0x1483b1=_0xe8f0('0x59');break;case'EU':_0x1483b1='https://accounts.zoho.eu';break;case'IN':_0x1483b1=_0xe8f0('0x5a');break;case'CN':_0x1483b1='https://accounts.zoho.com.cn';break;default:_0x1483b1=_0xe8f0('0x5b');break;}var _0x3e6f2c={'method':_0xe8f0('0x5c'),'uri':_0x1483b1+_0xe8f0('0x5d'),'qs':{'refresh_token':_0x25a605[_0xe8f0('0x5e')],'client_id':_0x25a605['clientId'],'client_secret':_0x25a605[_0xe8f0('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3e6f2c)[_0xe8f0('0x26')](function(_0x254b07){if(_0x254b07[_0xe8f0('0x60')]){_0x1ef61b(_0x254b07[_0xe8f0('0x60')]);}else{_0x3587c1('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xe8f0('0x47')](function(_0x182b0f){_0x3587c1(_0x182b0f);});});}exports['getFields']=function(_0xe936d1,_0x50f00a,_0x3d25da){var _0x331097,_0x5ac191,_0x3de5e7,_0x2cf0fd,_0x34f126;return db[_0xe8f0('0x2d')]['findOne']({'where':{'id':_0xe936d1[_0xe8f0('0x44')]['id']},'attributes':['id',_0xe8f0('0x61'),_0xe8f0('0x57'),_0xe8f0('0x62'),_0xe8f0('0x5f'),_0xe8f0('0x63'),_0xe8f0('0x64'),_0xe8f0('0x5e')]})[_0xe8f0('0x26')](handleEntityNotFound(_0x50f00a,null))['then'](function(_0x1ebb51){_0x34f126=_0x1ebb51;_0x331097=_0x34f126[_0xe8f0('0x61')];_0x5ac191=_0x331097===_0xe8f0('0x65')?'eu':_0xe8f0('0x66');_0x3de5e7=_0x34f126[_0xe8f0('0x63')];var _0x448f8e=_0x3de5e7[_0xe8f0('0x67')](-0x1);if(_0x448f8e==='/'||_0x448f8e==='\x5c'||_0x448f8e===':'){_0x3de5e7=_0x3de5e7[_0xe8f0('0x68')](0x0,_0x3de5e7['lastIndexOf'](_0x448f8e));}if(!_0x34f126[_0xe8f0('0x5e')]){throw new Error(_0xe8f0('0x69'));}return getAccessToken(_0x34f126);})['then'](function(_0x4aba35){if(_0x4aba35){return rp({'method':_0xe8f0('0x6a'),'uri':util[_0xe8f0('0x6b')](_0xe8f0('0x6c'),_0x5ac191),'qs':{'module':'Calls'},'headers':{'Authorization':_0xe8f0('0x6d')+_0x4aba35},'json':!![]});}})['then'](function(_0x2f0a37){if(_0x2f0a37){if(_0x2f0a37[_0xe8f0('0x6e')]&&_0x2f0a37[_0xe8f0('0x6e')]['error']){throw new Error(_0x2f0a37[_0xe8f0('0x6e')][_0xe8f0('0x28')]['message']);}var _0x45cbb2=[];var _0x6443cb=[];var _0x45ec65=[_0xe8f0('0x6f'),_0xe8f0('0x70'),_0xe8f0('0x71'),'WhoId',_0xe8f0('0x72'),_0xe8f0('0x73'),_0xe8f0('0x74'),_0xe8f0('0x75')];_0x6443cb=_['remove'](_0x2f0a37[_0xe8f0('0x37')],function(_0x12f397){return _0x45ec65[_0xe8f0('0x76')](_0x12f397[_0xe8f0('0x77')]);});for(var _0x3d60cb=0x0;_0x3d60cb<_0x6443cb['length'];_0x3d60cb++){if(_0x6443cb[_0x3d60cb][_0xe8f0('0x78')]===![]){_0x45cbb2[_0xe8f0('0x79')]({'id':_0x6443cb[_0x3d60cb]['id'],'name':_0x6443cb[_0x3d60cb]['display_label'],'custom':_0x6443cb[_0x3d60cb][_0xe8f0('0x7a')],'options':_0x6443cb[_0x3d60cb]['data_type']===_0xe8f0('0x7b')&&_0x6443cb[_0x3d60cb][_0xe8f0('0x7c')][_0xe8f0('0x38')]>-0x1?_['map'](_0x6443cb[_0x3d60cb][_0xe8f0('0x7c')],function(_0x4403df){return{'name':_0x4403df,'value':_0x4403df};}):[]});}}return{'count':_0x45cbb2[_0xe8f0('0x38')],'rows':_0x45cbb2};}else{return{'count':0x0,'rows':[]};}})[_0xe8f0('0x26')](respondWithResult(_0x50f00a,null))[_0xe8f0('0x47')](function(_0x3b37e6){var _0x46e231=_0xe936d1[_0xe8f0('0x31')][_0xe8f0('0x7d')]?0x1f4:_0x3b37e6[_0xe8f0('0x7e')]||0x1f4;logger['error'](_0xe8f0('0x7f'),_0xe8f0('0x80'),_0x46e231,JSON[_0xe8f0('0x81')](_0x3b37e6));delete _0x3b37e6[_0xe8f0('0x2a')];if(_0x46e231===0x191){_0x46e231=0x190;}_0x50f00a[_0xe8f0('0x1c')](_0x46e231)['send'](_0xe936d1['query'][_0xe8f0('0x7d')]?{'message':_0xe8f0('0x82'),'statusCode':_0x3b37e6[_0xe8f0('0x7e')]}:_0x3b37e6);});}; \ No newline at end of file +var _0xa6ba=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','ZohoField','Subjects','zone','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','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','offset','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xa6ba,0x1d9));var _0xaa6b=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa6ba[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0xaa6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa6b('0x2'));var moment=require(_0xaa6b('0x3'));var BPromise=require(_0xaa6b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaa6b('0x5'));var sox=require(_0xaa6b('0x6'));var csv=require(_0xaa6b('0x7'));var ejs=require(_0xaa6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa6b('0x9'));var squel=require(_0xaa6b('0xa'));var crypto=require(_0xaa6b('0xb'));var jsforce=require(_0xaa6b('0xc'));var deskjs=require(_0xaa6b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa6b('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa6b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaa6b('0x10'));var as=require(_0xaa6b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa6b('0x12'))(_0xaa6b('0x13'));var utils=require('../../config/utils');var config=require(_0xaa6b('0x14'));var licenseUtil=require(_0xaa6b('0x15'));var db=require(_0xaa6b('0x16'))['db'];var integrations=require(_0xaa6b('0x17'));function respondWithStatusCode(_0x1c8794,_0x20a3e1){_0x20a3e1=_0x20a3e1||0xcc;return function(_0x10e641){if(_0x10e641){return _0x1c8794[_0xaa6b('0x18')](_0x20a3e1);}return _0x1c8794[_0xaa6b('0x19')](_0x20a3e1)['end']();};}function respondWithResult(_0x1dfcc1,_0x55061e){_0x55061e=_0x55061e||0xc8;return function(_0x332382){if(_0x332382){return _0x1dfcc1['status'](_0x55061e)[_0xaa6b('0x1a')](_0x332382);}};}function respondWithFilteredResult(_0x1830d6,_0x3014b8){return function(_0x42883a){if(_0x42883a){var _0x4e78e7=typeof _0x3014b8['offset']===_0xaa6b('0x1b')&&typeof _0x3014b8['limit']===_0xaa6b('0x1b');var _0x3a1172=_0x42883a['count'];var _0x1d42bb=_0x4e78e7?0x0:_0x3014b8[_0xaa6b('0x1c')];var _0x3d4712=_0x4e78e7?_0x42883a[_0xaa6b('0x1d')]:_0x3014b8[_0xaa6b('0x1c')]+_0x3014b8['limit'];var _0x1ac406;if(_0x3d4712>=_0x3a1172){_0x3d4712=_0x3a1172;_0x1ac406=0xc8;}else{_0x1ac406=0xce;}_0x1830d6[_0xaa6b('0x19')](_0x1ac406);return _0x1830d6[_0xaa6b('0x1e')](_0xaa6b('0x1f'),_0x1d42bb+'-'+_0x3d4712+'/'+_0x3a1172)[_0xaa6b('0x1a')](_0x42883a);}return null;};}function patchUpdates(_0x1174a2){return function(_0xa190b3){try{jsonpatch[_0xaa6b('0x20')](_0xa190b3,_0x1174a2,!![]);}catch(_0x53439d){return BPromise['reject'](_0x53439d);}return _0xa190b3[_0xaa6b('0x21')]();};}function saveUpdates(_0x1f1727,_0x48a13c){return function(_0x4ef76f){if(_0x4ef76f){return _0x4ef76f[_0xaa6b('0x22')](_0x1f1727)[_0xaa6b('0x23')](function(_0x2b4810){return _0x2b4810;});}return null;};}function removeEntity(_0x1d9ebb,_0x87c3d8){return function(_0x13bb60){if(_0x13bb60){return _0x13bb60['destroy']()['then'](function(){_0x1d9ebb[_0xaa6b('0x19')](0xcc)[_0xaa6b('0x24')]();});}};}function handleEntityNotFound(_0x22c9a8,_0x359afb){return function(_0x75c3e7){if(!_0x75c3e7){_0x22c9a8[_0xaa6b('0x18')](0x194);}return _0x75c3e7;};}function handleError(_0x35321d,_0x1de475){_0x1de475=_0x1de475||0x1f4;return function(_0x2d53bb){logger[_0xaa6b('0x25')](_0x2d53bb[_0xaa6b('0x26')]);if(_0x2d53bb[_0xaa6b('0x27')]){delete _0x2d53bb[_0xaa6b('0x27')];}_0x35321d[_0xaa6b('0x19')](_0x1de475)[_0xaa6b('0x28')](_0x2d53bb);};}exports[_0xaa6b('0x29')]=function(_0x56e887,_0x135019){var _0x5e4dda={},_0x1c160d={},_0x2e47f5={'count':0x0,'rows':[]};var _0x569375=_['map'](db[_0xaa6b('0x2a')][_0xaa6b('0x2b')],function(_0x42ee66){return{'name':_0x42ee66[_0xaa6b('0x2c')],'type':_0x42ee66[_0xaa6b('0x2d')][_0xaa6b('0x2e')]};});_0x1c160d[_0xaa6b('0x2f')]=_[_0xaa6b('0x30')](_0x569375,'name');_0x1c160d[_0xaa6b('0x31')]=_['keys'](_0x56e887[_0xaa6b('0x31')]);_0x1c160d[_0xaa6b('0x32')]=_[_0xaa6b('0x33')](_0x1c160d['model'],_0x1c160d[_0xaa6b('0x31')]);_0x5e4dda[_0xaa6b('0x34')]=_[_0xaa6b('0x33')](_0x1c160d[_0xaa6b('0x2f')],qs[_0xaa6b('0x35')](_0x56e887['query']['fields']));_0x5e4dda['attributes']=_0x5e4dda[_0xaa6b('0x34')][_0xaa6b('0x36')]?_0x5e4dda[_0xaa6b('0x34')]:_0x1c160d['model'];if(!_0x56e887['query'][_0xaa6b('0x37')](_0xaa6b('0x38'))){_0x5e4dda['limit']=qs[_0xaa6b('0x39')](_0x56e887[_0xaa6b('0x31')]['limit']);_0x5e4dda[_0xaa6b('0x1c')]=qs[_0xaa6b('0x1c')](_0x56e887[_0xaa6b('0x31')][_0xaa6b('0x1c')]);}_0x5e4dda['order']=qs['sort'](_0x56e887[_0xaa6b('0x31')][_0xaa6b('0x3a')]);_0x5e4dda['where']=qs[_0xaa6b('0x32')](_[_0xaa6b('0x3b')](_0x56e887['query'],_0x1c160d['filters']),_0x569375);if(_0x56e887['query'][_0xaa6b('0x3c')]){_0x5e4dda[_0xaa6b('0x3d')]=_[_0xaa6b('0x3e')](_0x5e4dda[_0xaa6b('0x3d')],{'$or':_[_0xaa6b('0x30')](_0x569375,function(_0x391776){if(_0x391776['type']!==_0xaa6b('0x3f')){var _0x1a04d9={};_0x1a04d9[_0x391776[_0xaa6b('0x27')]]={'$like':'%'+_0x56e887[_0xaa6b('0x31')]['filter']+'%'};return _0x1a04d9;}})});}_0x5e4dda=_[_0xaa6b('0x3e')]({},_0x5e4dda,_0x56e887[_0xaa6b('0x40')]);var _0x6f9767={'where':_0x5e4dda[_0xaa6b('0x3d')]};return db['ZohoAccount'][_0xaa6b('0x1d')](_0x6f9767)['then'](function(_0x26ccac){_0x2e47f5['count']=_0x26ccac;if(_0x56e887[_0xaa6b('0x31')][_0xaa6b('0x41')]){_0x5e4dda[_0xaa6b('0x42')]=[{'all':!![]}];}return db[_0xaa6b('0x2a')][_0xaa6b('0x43')](_0x5e4dda);})['then'](function(_0x3a7caf){_0x2e47f5[_0xaa6b('0x44')]=_0x3a7caf;return _0x2e47f5;})['then'](respondWithFilteredResult(_0x135019,_0x5e4dda))[_0xaa6b('0x45')](handleError(_0x135019,null));};exports['show']=function(_0xebc4ec,_0x540546){var _0x479a40={'raw':![],'where':{'id':_0xebc4ec[_0xaa6b('0x46')]['id']}},_0x1af032={};_0x1af032['model']=_[_0xaa6b('0x47')](db[_0xaa6b('0x2a')][_0xaa6b('0x2b')]);_0x1af032[_0xaa6b('0x31')]=_[_0xaa6b('0x47')](_0xebc4ec[_0xaa6b('0x31')]);_0x1af032[_0xaa6b('0x32')]=_[_0xaa6b('0x33')](_0x1af032[_0xaa6b('0x2f')],_0x1af032[_0xaa6b('0x31')]);_0x479a40['attributes']=_[_0xaa6b('0x33')](_0x1af032[_0xaa6b('0x2f')],qs[_0xaa6b('0x35')](_0xebc4ec[_0xaa6b('0x31')][_0xaa6b('0x35')]));_0x479a40[_0xaa6b('0x34')]=_0x479a40[_0xaa6b('0x34')][_0xaa6b('0x36')]?_0x479a40[_0xaa6b('0x34')]:_0x1af032[_0xaa6b('0x2f')];if(_0xebc4ec['query'][_0xaa6b('0x41')]){_0x479a40['include']=[{'all':!![]}];}_0x479a40=_['merge']({},_0x479a40,_0xebc4ec[_0xaa6b('0x40')]);return db[_0xaa6b('0x2a')]['find'](_0x479a40)[_0xaa6b('0x23')](handleEntityNotFound(_0x540546,null))[_0xaa6b('0x23')](respondWithResult(_0x540546,null))[_0xaa6b('0x45')](handleError(_0x540546,null));};exports[_0xaa6b('0x48')]=function(_0x2707a3,_0x4f37a5){return db[_0xaa6b('0x2a')][_0xaa6b('0x48')](_0x2707a3[_0xaa6b('0x49')],{})[_0xaa6b('0x23')](respondWithResult(_0x4f37a5,0xc9))['catch'](handleError(_0x4f37a5,null));};exports[_0xaa6b('0x22')]=function(_0xa3fb93,_0x418abb){if(_0xa3fb93['body']['id']){delete _0xa3fb93[_0xaa6b('0x49')]['id'];}return db['ZohoAccount'][_0xaa6b('0x4a')]({'where':{'id':_0xa3fb93[_0xaa6b('0x46')]['id']}})['then'](handleEntityNotFound(_0x418abb,null))[_0xaa6b('0x23')](saveUpdates(_0xa3fb93[_0xaa6b('0x49')],null))[_0xaa6b('0x23')](respondWithResult(_0x418abb,null))[_0xaa6b('0x45')](handleError(_0x418abb,null));};exports[_0xaa6b('0x4b')]=function(_0x587042,_0x396b62){return db[_0xaa6b('0x2a')][_0xaa6b('0x4a')]({'where':{'id':_0x587042[_0xaa6b('0x46')]['id']}})['then'](handleEntityNotFound(_0x396b62,null))['then'](removeEntity(_0x396b62,null))['catch'](handleError(_0x396b62,null));};exports[_0xaa6b('0x4c')]=function(_0x2485ce,_0x25c303,_0xc6d0da){var _0x16bbe7={};var _0x153044={};var _0x4d76fc;var _0x297a99;return db[_0xaa6b('0x2a')][_0xaa6b('0x4d')]({'where':{'id':_0x2485ce[_0xaa6b('0x46')]['id']}})[_0xaa6b('0x23')](handleEntityNotFound(_0x25c303,null))['then'](function(_0x320a79){if(_0x320a79){_0x4d76fc=_0x320a79;_0x153044[_0xaa6b('0x2f')]=_['keys'](db[_0xaa6b('0x4e')][_0xaa6b('0x2b')]);_0x153044[_0xaa6b('0x31')]=_[_0xaa6b('0x47')](_0x2485ce[_0xaa6b('0x31')]);_0x153044[_0xaa6b('0x32')]=_[_0xaa6b('0x33')](_0x153044['model'],_0x153044[_0xaa6b('0x31')]);_0x16bbe7[_0xaa6b('0x34')]=_[_0xaa6b('0x33')](_0x153044[_0xaa6b('0x2f')],qs[_0xaa6b('0x35')](_0x2485ce[_0xaa6b('0x31')][_0xaa6b('0x35')]));_0x16bbe7[_0xaa6b('0x34')]=_0x16bbe7['attributes'][_0xaa6b('0x36')]?_0x16bbe7['attributes']:_0x153044[_0xaa6b('0x2f')];_0x16bbe7['order']=qs[_0xaa6b('0x3a')](_0x2485ce[_0xaa6b('0x31')]['sort']);_0x16bbe7['where']=qs[_0xaa6b('0x32')](_[_0xaa6b('0x3b')](_0x2485ce[_0xaa6b('0x31')],_0x153044[_0xaa6b('0x32')]));if(_0x2485ce[_0xaa6b('0x31')][_0xaa6b('0x3c')]){_0x16bbe7['where']=_['merge'](_0x16bbe7[_0xaa6b('0x3d')],{'$or':_['map'](_0x16bbe7[_0xaa6b('0x34')],function(_0x18934c){var _0x287824={};_0x287824[_0x18934c]={'$like':'%'+_0x2485ce['query'][_0xaa6b('0x3c')]+'%'};return _0x287824;})});}_0x16bbe7=_[_0xaa6b('0x3e')]({},_0x16bbe7,_0x2485ce[_0xaa6b('0x40')]);return _0x4d76fc[_0xaa6b('0x4c')](_0x16bbe7);}})[_0xaa6b('0x23')](function(_0x1e14a0){if(_0x1e14a0){_0x297a99=_0x1e14a0[_0xaa6b('0x36')];if(!_0x2485ce[_0xaa6b('0x31')][_0xaa6b('0x37')](_0xaa6b('0x38'))){_0x16bbe7[_0xaa6b('0x39')]=qs[_0xaa6b('0x39')](_0x2485ce[_0xaa6b('0x31')]['limit']);_0x16bbe7[_0xaa6b('0x1c')]=qs[_0xaa6b('0x1c')](_0x2485ce[_0xaa6b('0x31')][_0xaa6b('0x1c')]);}return _0x4d76fc[_0xaa6b('0x4c')](_0x16bbe7);}})[_0xaa6b('0x23')](function(_0x5aa94d){if(_0x5aa94d){return _0x5aa94d?{'count':_0x297a99,'rows':_0x5aa94d}:null;}})[_0xaa6b('0x23')](respondWithResult(_0x25c303,null))[_0xaa6b('0x45')](handleError(_0x25c303,null));};exports[_0xaa6b('0x4f')]=function(_0x135c56,_0x13d1ed,_0x25ad26){if(_0x135c56['body']['id']){delete _0x135c56[_0xaa6b('0x49')]['id'];}return db[_0xaa6b('0x2a')][_0xaa6b('0x4d')]({'where':{'id':_0x135c56[_0xaa6b('0x46')]['id']}})[_0xaa6b('0x23')](handleEntityNotFound(_0x13d1ed,null))[_0xaa6b('0x23')](function(_0x53d638){if(_0x53d638){_0x135c56[_0xaa6b('0x49')]['AccountId']=_0x53d638['id'];_0x135c56[_0xaa6b('0x49')]['Subjects']=integrations[_0xaa6b('0x50')](_0x135c56[_0xaa6b('0x49')]['channel'],_0x135c56[_0xaa6b('0x49')]['type']);_0x135c56['body'][_0xaa6b('0x51')]=integrations[_0xaa6b('0x52')](_0x135c56['body'][_0xaa6b('0x53')],_0x135c56[_0xaa6b('0x49')]['type']);return db[_0xaa6b('0x4e')][_0xaa6b('0x48')](_0x135c56[_0xaa6b('0x49')],{'include':[{'model':db[_0xaa6b('0x54')],'as':_0xaa6b('0x55')},{'model':db[_0xaa6b('0x54')],'as':_0xaa6b('0x51')}]});}return null;})[_0xaa6b('0x23')](respondWithResult(_0x13d1ed,null))[_0xaa6b('0x45')](handleError(_0x13d1ed,null));};function getAccessToken(_0x9c26ac){return new Promise(function(_0x478f54,_0x3ec7a0){var _0x1052fa;switch(_0x9c26ac[_0xaa6b('0x56')]){case'US':_0x1052fa=_0xaa6b('0x57');break;case'AU':_0x1052fa='https://accounts.zoho.com.au';break;case'EU':_0x1052fa=_0xaa6b('0x58');break;case'IN':_0x1052fa=_0xaa6b('0x59');break;case'CN':_0x1052fa=_0xaa6b('0x5a');break;default:_0x1052fa='https://accounts.zoho.eu';break;}var _0x51499c={'method':_0xaa6b('0x5b'),'uri':_0x1052fa+_0xaa6b('0x5c'),'qs':{'refresh_token':_0x9c26ac[_0xaa6b('0x5d')],'client_id':_0x9c26ac[_0xaa6b('0x5e')],'client_secret':_0x9c26ac[_0xaa6b('0x5f')],'grant_type':_0xaa6b('0x60')},'json':!![]};return rp(_0x51499c)['then'](function(_0xcb46f5){if(_0xcb46f5[_0xaa6b('0x61')]){_0x478f54(_0xcb46f5[_0xaa6b('0x61')]);}else{_0x3ec7a0(_0xaa6b('0x62'));}})[_0xaa6b('0x45')](function(_0x360a4b){_0x3ec7a0(_0x360a4b);});});}exports[_0xaa6b('0x63')]=function(_0x522bbf,_0x99e4ce,_0x5d4985){var _0x513c9e,_0x897604,_0x1ea329,_0x1df814,_0x378faa;return db[_0xaa6b('0x2a')][_0xaa6b('0x4d')]({'where':{'id':_0x522bbf[_0xaa6b('0x46')]['id']},'attributes':['id','host','zone','clientId',_0xaa6b('0x5f'),_0xaa6b('0x64'),_0xaa6b('0x65'),_0xaa6b('0x5d')]})[_0xaa6b('0x23')](handleEntityNotFound(_0x99e4ce,null))[_0xaa6b('0x23')](function(_0x5c4355){_0x378faa=_0x5c4355;_0x513c9e=_0x378faa[_0xaa6b('0x66')];_0x897604=_0x513c9e===_0xaa6b('0x67')?'eu':_0xaa6b('0x68');_0x1ea329=_0x378faa['serverUrl'];var _0x4e02f6=_0x1ea329[_0xaa6b('0x69')](-0x1);if(_0x4e02f6==='/'||_0x4e02f6==='\x5c'||_0x4e02f6===':'){_0x1ea329=_0x1ea329[_0xaa6b('0x6a')](0x0,_0x1ea329[_0xaa6b('0x6b')](_0x4e02f6));}if(!_0x378faa['refreshToken']){throw new Error(_0xaa6b('0x6c'));}return getAccessToken(_0x378faa);})[_0xaa6b('0x23')](function(_0x4b7b72){if(_0x4b7b72){return rp({'method':'GET','uri':util['format'](_0xaa6b('0x6d'),_0x897604),'qs':{'module':_0xaa6b('0x6e')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4b7b72},'json':!![]});}})['then'](function(_0x269417){if(_0x269417){if(_0x269417['response']&&_0x269417['response'][_0xaa6b('0x25')]){throw new Error(_0x269417['response']['error'][_0xaa6b('0x6f')]);}var _0x5b002c=[];var _0x12bd54=[];var _0x4b1633=[_0xaa6b('0x70'),_0xaa6b('0x71'),_0xaa6b('0x72'),'WhoId',_0xaa6b('0x73'),_0xaa6b('0x74'),_0xaa6b('0x75'),_0xaa6b('0x76')];_0x12bd54=_[_0xaa6b('0x77')](_0x269417['fields'],function(_0x4845eb){return _0x4b1633[_0xaa6b('0x78')](_0x4845eb[_0xaa6b('0x79')]);});for(var _0xfa7d13=0x0;_0xfa7d13<_0x12bd54[_0xaa6b('0x36')];_0xfa7d13++){if(_0x12bd54[_0xfa7d13][_0xaa6b('0x7a')]===![]){_0x5b002c[_0xaa6b('0x7b')]({'id':_0x12bd54[_0xfa7d13]['id'],'name':_0x12bd54[_0xfa7d13][_0xaa6b('0x7c')],'custom':_0x12bd54[_0xfa7d13][_0xaa6b('0x7d')],'options':_0x12bd54[_0xfa7d13][_0xaa6b('0x7e')]===_0xaa6b('0x7f')&&_0x12bd54[_0xfa7d13][_0xaa6b('0x80')][_0xaa6b('0x36')]>-0x1?_[_0xaa6b('0x30')](_0x12bd54[_0xfa7d13][_0xaa6b('0x80')],function(_0x262044){return{'name':_0x262044,'value':_0x262044};}):[]});}}return{'count':_0x5b002c[_0xaa6b('0x36')],'rows':_0x5b002c};}else{return{'count':0x0,'rows':[]};}})[_0xaa6b('0x23')](respondWithResult(_0x99e4ce,null))[_0xaa6b('0x45')](function(_0x32d66d){var _0x4cf36d=_0x522bbf[_0xaa6b('0x31')]['test']?0x1f4:_0x32d66d[_0xaa6b('0x81')]||0x1f4;logger['error'](_0xaa6b('0x82'),_0xaa6b('0x63'),_0x4cf36d,JSON[_0xaa6b('0x83')](_0x32d66d));delete _0x32d66d[_0xaa6b('0x27')];if(_0x4cf36d===0x191){_0x4cf36d=0x190;}_0x99e4ce['status'](_0x4cf36d)['send'](_0x522bbf[_0xaa6b('0x31')]['test']?{'message':_0xaa6b('0x84'),'statusCode':_0x32d66d[_0xaa6b('0x81')]}:_0x32d66d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a90d9ce..5137e64 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 _0x6d9d=['serverUrl','host','substring','authorization_code','inspect','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','clientId','code','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','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','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch'];(function(_0x1bf9b2,_0x139340){var _0x3c5239=function(_0x23304d){while(--_0x23304d){_0x1bf9b2['push'](_0x1bf9b2['shift']());}};_0x3c5239(++_0x139340);}(_0x6d9d,0x10d));var _0xd6d9=function(_0x3ca894,_0x461e39){_0x3ca894=_0x3ca894-0x0;var _0x56ed92=_0x6d9d[_0x3ca894];return _0x56ed92;};'use strict';var _=require(_0xd6d9('0x0'));var util=require(_0xd6d9('0x1'));var logger=require(_0xd6d9('0x2'))(_0xd6d9('0x3'));var moment=require('moment');var BPromise=require(_0xd6d9('0x4'));var rp=require(_0xd6d9('0x5'));var fs=require('fs');var path=require(_0xd6d9('0x6'));var rimraf=require(_0xd6d9('0x7'));var config=require('../../config/environment');var attributes=require(_0xd6d9('0x8'));var integrations=require(_0xd6d9('0x9'));module[_0xd6d9('0xa')]=function(_0x174589,_0x2a6630){return _0x174589[_0xd6d9('0xb')](_0xd6d9('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x23617b,_0x33e274,_0x2857af){if(_0x23617b[_0xd6d9('0xd')](_0xd6d9('0xe'))||_0x23617b[_0xd6d9('0xd')]('serverUrl')||_0x23617b[_0xd6d9('0xd')](_0xd6d9('0xf'))||_0x23617b[_0xd6d9('0xd')]('clientSecret')||_0x23617b[_0xd6d9('0xd')](_0xd6d9('0x10'))||_0x23617b[_0xd6d9('0xd')]('host')){var _0x49c71d,_0x163d67;_0x49c71d=_0x23617b['serverUrl'];var _0x913951=_0x49c71d[_0xd6d9('0x11')](-0x1);if(_0x913951==='/'||_0x913951==='\x5c'||_0x913951===':'){_0x49c71d=_0x49c71d['substring'](0x0,_0x49c71d[_0xd6d9('0x12')](_0x913951));}switch(_0x23617b[_0xd6d9('0xe')]){case'US':_0x163d67=_0xd6d9('0x13');break;case'AU':_0x163d67=_0xd6d9('0x14');break;case'IN':_0x163d67=_0xd6d9('0x15');break;case'CN':_0x163d67=_0xd6d9('0x16');break;default:_0x163d67=_0xd6d9('0x17');break;}var _0x53159b={'method':_0xd6d9('0x18'),'uri':_0x163d67+_0xd6d9('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x23617b[_0xd6d9('0xf')],'client_secret':_0x23617b[_0xd6d9('0x1a')],'redirect_uri':_0x23617b['serverUrl'],'code':_0x23617b['code']},'headers':{'Content-Type':_0xd6d9('0x1b')}};return rp(_0x53159b)[_0xd6d9('0x1c')](function(_0x6ac782){var _0x1fe507=JSON[_0xd6d9('0x1d')](_0x6ac782);if(_0x1fe507[_0xd6d9('0x1e')]){_0x23617b[_0xd6d9('0x1f')]=_0x1fe507[_0xd6d9('0x1e')];logger[_0xd6d9('0x20')](util[_0xd6d9('0x21')](_0xd6d9('0x22'),_0x23617b['name'],_0x23617b['id']));}else{logger[_0xd6d9('0x23')](util['format'](_0xd6d9('0x24'),_0x23617b[_0xd6d9('0x25')],_0x23617b['id']),util['inspect'](_0x1fe507,{'showHidden':![],'depth':null}));}return _0x2857af(null,_0x33e274);})[_0xd6d9('0x26')](function(_0x2fff1f){logger[_0xd6d9('0x23')](util[_0xd6d9('0x21')](_0xd6d9('0x24'),_0x23617b['name'],_0x23617b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2857af(_0x2fff1f);});}else{return _0x2857af(null,_0x33e274);}},'beforeUpdate':function(_0xad8a59,_0x23edc4,_0x2e045c){if(_0xad8a59[_0xd6d9('0xd')](_0xd6d9('0xe'))||_0xad8a59[_0xd6d9('0xd')](_0xd6d9('0x27'))||_0xad8a59[_0xd6d9('0xd')]('clientId')||_0xad8a59[_0xd6d9('0xd')](_0xd6d9('0x1a'))||_0xad8a59[_0xd6d9('0xd')](_0xd6d9('0x10'))||_0xad8a59['changed'](_0xd6d9('0x28'))){var _0xd10a0e,_0x5dd3fa;_0xd10a0e=_0xad8a59['serverUrl'];var _0x3cc016=_0xd10a0e[_0xd6d9('0x11')](-0x1);if(_0x3cc016==='/'||_0x3cc016==='\x5c'||_0x3cc016===':'){_0xd10a0e=_0xd10a0e[_0xd6d9('0x29')](0x0,_0xd10a0e[_0xd6d9('0x12')](_0x3cc016));}switch(_0xad8a59[_0xd6d9('0xe')]){case'US':_0x5dd3fa=_0xd6d9('0x13');break;case'AU':_0x5dd3fa=_0xd6d9('0x14');break;case'IN':_0x5dd3fa=_0xd6d9('0x15');break;case'CN':_0x5dd3fa='https://accounts.zoho.com.cn';break;default:_0x5dd3fa='https://accounts.zoho.eu';break;}var _0x1bbff1={'method':_0xd6d9('0x18'),'uri':_0x5dd3fa+'/oauth/v2/token','form':{'grant_type':_0xd6d9('0x2a'),'client_id':_0xad8a59[_0xd6d9('0xf')],'client_secret':_0xad8a59[_0xd6d9('0x1a')],'redirect_uri':_0xad8a59[_0xd6d9('0x27')],'code':_0xad8a59[_0xd6d9('0x10')]},'headers':{'Content-Type':_0xd6d9('0x1b')}};return rp(_0x1bbff1)[_0xd6d9('0x1c')](function(_0x266e00){var _0x2ea04e=JSON[_0xd6d9('0x1d')](_0x266e00);if(_0x2ea04e[_0xd6d9('0x1e')]){_0xad8a59[_0xd6d9('0x1f')]=_0x2ea04e[_0xd6d9('0x1e')];logger[_0xd6d9('0x20')](util[_0xd6d9('0x21')](_0xd6d9('0x22'),_0xad8a59['name'],_0xad8a59['id']));}else{logger[_0xd6d9('0x23')](util[_0xd6d9('0x21')](_0xd6d9('0x24'),_0xad8a59[_0xd6d9('0x25')],_0xad8a59['id']),util[_0xd6d9('0x2b')](_0x2ea04e,{'showHidden':![],'depth':null}));}return _0x2e045c(null,_0x23edc4);})['catch'](function(_0x114d3c){logger[_0xd6d9('0x23')](util[_0xd6d9('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xad8a59[_0xd6d9('0x25')],_0xad8a59['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2e045c(_0x114d3c);});}else{return _0x2e045c(null,_0x23edc4);}}}});}; \ No newline at end of file +var _0x4e96=['refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','clientId','slice','substring','lastIndexOf','POST','authorization_code','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','changed','zone','serverUrl','clientSecret','code','host','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token'];(function(_0x2d72b7,_0x583095){var _0x9b5296=function(_0x557374){while(--_0x557374){_0x2d72b7['push'](_0x2d72b7['shift']());}};_0x9b5296(++_0x583095);}(_0x4e96,0x1bd));var _0x64e9=function(_0x509e54,_0x1c358c){_0x509e54=_0x509e54-0x0;var _0x4a2400=_0x4e96[_0x509e54];return _0x4a2400;};'use strict';var _=require(_0x64e9('0x0'));var util=require(_0x64e9('0x1'));var logger=require(_0x64e9('0x2'))(_0x64e9('0x3'));var moment=require(_0x64e9('0x4'));var BPromise=require(_0x64e9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64e9('0x6'));var rimraf=require(_0x64e9('0x7'));var config=require(_0x64e9('0x8'));var attributes=require(_0x64e9('0x9'));var integrations=require(_0x64e9('0xa'));module['exports']=function(_0x443d13,_0x569779){return _0x443d13['define'](_0x64e9('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c30b7,_0x3ea8ed,_0x37eb7d){if(_0x2c30b7[_0x64e9('0xc')](_0x64e9('0xd'))||_0x2c30b7[_0x64e9('0xc')](_0x64e9('0xe'))||_0x2c30b7['changed']('clientId')||_0x2c30b7['changed'](_0x64e9('0xf'))||_0x2c30b7['changed'](_0x64e9('0x10'))||_0x2c30b7['changed'](_0x64e9('0x11'))){var _0x4cf533,_0x1c1525;_0x4cf533=_0x2c30b7[_0x64e9('0xe')];var _0x4c88e8=_0x4cf533['slice'](-0x1);if(_0x4c88e8==='/'||_0x4c88e8==='\x5c'||_0x4c88e8===':'){_0x4cf533=_0x4cf533['substring'](0x0,_0x4cf533['lastIndexOf'](_0x4c88e8));}switch(_0x2c30b7[_0x64e9('0xd')]){case'US':_0x1c1525=_0x64e9('0x12');break;case'AU':_0x1c1525=_0x64e9('0x13');break;case'IN':_0x1c1525=_0x64e9('0x14');break;case'CN':_0x1c1525=_0x64e9('0x15');break;default:_0x1c1525=_0x64e9('0x16');break;}var _0x4827a1={'method':'POST','uri':_0x1c1525+_0x64e9('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x2c30b7['clientId'],'client_secret':_0x2c30b7[_0x64e9('0xf')],'redirect_uri':_0x2c30b7[_0x64e9('0xe')],'code':_0x2c30b7['code']},'headers':{'Content-Type':_0x64e9('0x18')}};return rp(_0x4827a1)[_0x64e9('0x19')](function(_0x18d3a8){var _0x5d5286=JSON[_0x64e9('0x1a')](_0x18d3a8);if(_0x5d5286[_0x64e9('0x1b')]){_0x2c30b7[_0x64e9('0x1c')]=_0x5d5286[_0x64e9('0x1b')];logger[_0x64e9('0x1d')](util[_0x64e9('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c30b7[_0x64e9('0x1f')],_0x2c30b7['id']));}else{logger[_0x64e9('0x20')](util[_0x64e9('0x1e')](_0x64e9('0x21'),_0x2c30b7[_0x64e9('0x1f')],_0x2c30b7['id']),util[_0x64e9('0x22')](_0x5d5286,{'showHidden':![],'depth':null}));}return _0x37eb7d(null,_0x3ea8ed);})['catch'](function(_0x436840){logger[_0x64e9('0x20')](util[_0x64e9('0x1e')](_0x64e9('0x21'),_0x2c30b7['name'],_0x2c30b7['id']),util[_0x64e9('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x37eb7d(_0x436840);});}else{return _0x37eb7d(null,_0x3ea8ed);}},'beforeUpdate':function(_0x50ff3e,_0xea1573,_0x2ee644){if(_0x50ff3e[_0x64e9('0xc')](_0x64e9('0xd'))||_0x50ff3e[_0x64e9('0xc')](_0x64e9('0xe'))||_0x50ff3e[_0x64e9('0xc')](_0x64e9('0x23'))||_0x50ff3e[_0x64e9('0xc')](_0x64e9('0xf'))||_0x50ff3e[_0x64e9('0xc')](_0x64e9('0x10'))||_0x50ff3e[_0x64e9('0xc')](_0x64e9('0x11'))){var _0x299e83,_0x41e8cd;_0x299e83=_0x50ff3e[_0x64e9('0xe')];var _0x1b3134=_0x299e83[_0x64e9('0x24')](-0x1);if(_0x1b3134==='/'||_0x1b3134==='\x5c'||_0x1b3134===':'){_0x299e83=_0x299e83[_0x64e9('0x25')](0x0,_0x299e83[_0x64e9('0x26')](_0x1b3134));}switch(_0x50ff3e[_0x64e9('0xd')]){case'US':_0x41e8cd='https://accounts.zoho.com';break;case'AU':_0x41e8cd=_0x64e9('0x13');break;case'IN':_0x41e8cd='https://accounts.zoho.in';break;case'CN':_0x41e8cd=_0x64e9('0x15');break;default:_0x41e8cd=_0x64e9('0x16');break;}var _0x54ae6a={'method':_0x64e9('0x27'),'uri':_0x41e8cd+_0x64e9('0x17'),'form':{'grant_type':_0x64e9('0x28'),'client_id':_0x50ff3e['clientId'],'client_secret':_0x50ff3e[_0x64e9('0xf')],'redirect_uri':_0x50ff3e['serverUrl'],'code':_0x50ff3e[_0x64e9('0x10')]},'headers':{'Content-Type':_0x64e9('0x18')}};return rp(_0x54ae6a)[_0x64e9('0x19')](function(_0x552f1b){var _0x1ec12a=JSON[_0x64e9('0x1a')](_0x552f1b);if(_0x1ec12a['refresh_token']){_0x50ff3e['refreshToken']=_0x1ec12a[_0x64e9('0x1b')];logger[_0x64e9('0x1d')](util['format'](_0x64e9('0x29'),_0x50ff3e[_0x64e9('0x1f')],_0x50ff3e['id']));}else{logger[_0x64e9('0x20')](util[_0x64e9('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x50ff3e[_0x64e9('0x1f')],_0x50ff3e['id']),util[_0x64e9('0x22')](_0x1ec12a,{'showHidden':![],'depth':null}));}return _0x2ee644(null,_0xea1573);})[_0x64e9('0x2a')](function(_0x154c99){logger[_0x64e9('0x20')](util[_0x64e9('0x1e')](_0x64e9('0x21'),_0x50ff3e[_0x64e9('0x1f')],_0x50ff3e['id']),util[_0x64e9('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x2ee644(_0x154c99);});}else{return _0x2ee644(null,_0xea1573);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index d4a4a9c..ef2573b 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 _0xf79e=['message','result','catch','GetZohoAccount','findAll','options','attributes','limit','include','map','model','ShowZohoAccount','ZohoAccount','raw','where','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31adbf,_0x2248a1){var _0x2c96f2=function(_0x2a22f0){while(--_0x2a22f0){_0x31adbf['push'](_0x31adbf['shift']());}};_0x2c96f2(++_0x2248a1);}(_0xf79e,0x185));var _0xef79=function(_0xc79bf3,_0x136205){_0xc79bf3=_0xc79bf3-0x0;var _0x59fe39=_0xf79e[_0xc79bf3];return _0x59fe39;};'use strict';var _=require('lodash');var util=require(_0xef79('0x0'));var moment=require(_0xef79('0x1'));var BPromise=require(_0xef79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef79('0x3'));var db=require(_0xef79('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef79('0x5'));var config=require(_0xef79('0x6'));var jayson=require(_0xef79('0x7'));var client=jayson[_0xef79('0x8')][_0xef79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa668,_0x49d0ea,_0x1e7443){return new BPromise(function(_0x4a8de0,_0x33b384){return client[_0xef79('0xa')](_0x2fa668,_0x1e7443)['then'](function(_0x42dee6){logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));logger[_0xef79('0xe')](_0xef79('0xf'),_0x49d0ea,_0xef79('0xd'),JSON[_0xef79('0x10')](_0x42dee6));if(_0x42dee6['error']){if(_0x42dee6[_0xef79('0x11')][_0xef79('0x12')]===0x1f4){logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);return _0x33b384(_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);}logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6['error']['message']);return _0x4a8de0(_0x42dee6['error']['message']);}else{logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));_0x4a8de0(_0x42dee6[_0xef79('0x14')]['message']);}})[_0xef79('0x15')](function(_0x6a689c){logger['error'](_0xef79('0xc'),_0x49d0ea,_0x6a689c);_0x33b384(_0x6a689c);});});}exports[_0xef79('0x16')]=function(_0x249a8c){var _0x406ca2=this;return new Promise(function(_0x55492c,_0x276b8b){return db['ZohoAccount'][_0xef79('0x17')]({'raw':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['where']||null:null,'attributes':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x19')]||null:null,'limit':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x1a')]||null:null,'include':_0x249a8c[_0xef79('0x18')]?_0x249a8c['options'][_0xef79('0x1b')]?_['map'](_0x249a8c['options'][_0xef79('0x1b')],function(_0x196672){return{'model':db[_0x196672['model']],'as':_0x196672['as'],'attributes':_0x196672[_0xef79('0x19')],'include':_0x196672[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x196672[_0xef79('0x1b')],function(_0x5b4017){return{'model':db[_0x5b4017[_0xef79('0x1d')]],'as':_0x5b4017['as'],'attributes':_0x5b4017[_0xef79('0x19')],'include':_0x5b4017[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x5b4017['include'],function(_0x38ec60){return{'model':db[_0x38ec60['model']],'as':_0x38ec60['as'],'attributes':_0x38ec60[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102d6f){logger[_0xef79('0xb')](_0xef79('0x16'),_0x249a8c);logger[_0xef79('0xe')](_0xef79('0x16'),_0x249a8c,JSON[_0xef79('0x10')](_0x102d6f));_0x55492c(_0x102d6f);})[_0xef79('0x15')](function(_0x2e3bbf){logger['error'](_0xef79('0x16'),_0x2e3bbf['message'],_0x249a8c);_0x276b8b(_0x406ca2[_0xef79('0x11')](0x1f4,_0x2e3bbf[_0xef79('0x13')]));});});};exports[_0xef79('0x1e')]=function(_0x34db2f){var _0x84ad52=this;return new Promise(function(_0x3bb745,_0x2d70ce){return db[_0xef79('0x1f')]['find']({'raw':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x20')]===undefined?!![]:![]:!![],'where':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x21')]||null:null,'attributes':_0x34db2f[_0xef79('0x18')]?_0x34db2f['options'][_0xef79('0x19')]||null:null,'include':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')],function(_0x360b28){return{'model':db[_0x360b28[_0xef79('0x1d')]],'as':_0x360b28['as'],'attributes':_0x360b28[_0xef79('0x19')],'include':_0x360b28[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x360b28[_0xef79('0x1b')],function(_0x41d36b){return{'model':db[_0x41d36b[_0xef79('0x1d')]],'as':_0x41d36b['as'],'attributes':_0x41d36b[_0xef79('0x19')],'include':_0x41d36b[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x41d36b[_0xef79('0x1b')],function(_0x565cf1){return{'model':db[_0x565cf1['model']],'as':_0x565cf1['as'],'attributes':_0x565cf1[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bc12a){logger['info'](_0xef79('0x1e'),_0x34db2f);logger[_0xef79('0xe')]('ShowZohoAccount',_0x34db2f,JSON[_0xef79('0x10')](_0x4bc12a));_0x3bb745(_0x4bc12a);})['catch'](function(_0x529bb4){logger['error'](_0xef79('0x1e'),_0x529bb4[_0xef79('0x13')],_0x34db2f);_0x2d70ce(_0x84ad52[_0xef79('0x11')](0x1f4,_0x529bb4[_0xef79('0x13')]));});});}; \ No newline at end of file +var _0xcae2=['map','model','attributes','include','then','stringify','find','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount','options','raw','where','limit'];(function(_0x5b1abd,_0x78921c){var _0x37a584=function(_0xbfbcbf){while(--_0xbfbcbf){_0x5b1abd['push'](_0x5b1abd['shift']());}};_0x37a584(++_0x78921c);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'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')]('ZohoAccount,\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')]['findAll']({'raw':_0xe6314f['options']?_0xe6314f[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![],'where':_0xe6314f[_0x2cae('0x17')]?_0xe6314f[_0x2cae('0x17')][_0x2cae('0x19')]||null:null,'attributes':_0xe6314f[_0x2cae('0x17')]?_0xe6314f[_0x2cae('0x17')]['attributes']||null:null,'limit':_0xe6314f['options']?_0xe6314f[_0x2cae('0x17')][_0x2cae('0x1a')]||null:null,'include':_0xe6314f['options']?_0xe6314f['options']['include']?_[_0x2cae('0x1b')](_0xe6314f[_0x2cae('0x17')]['include'],function(_0x555914){return{'model':db[_0x555914[_0x2cae('0x1c')]],'as':_0x555914['as'],'attributes':_0x555914[_0x2cae('0x1d')],'include':_0x555914[_0x2cae('0x1e')]?_[_0x2cae('0x1b')](_0x555914[_0x2cae('0x1e')],function(_0x447c72){return{'model':db[_0x447c72[_0x2cae('0x1c')]],'as':_0x447c72['as'],'attributes':_0x447c72[_0x2cae('0x1d')],'include':_0x447c72[_0x2cae('0x1e')]?_[_0x2cae('0x1b')](_0x447c72[_0x2cae('0x1e')],function(_0x2e0005){return{'model':db[_0x2e0005[_0x2cae('0x1c')]],'as':_0x2e0005['as'],'attributes':_0x2e0005[_0x2cae('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2cae('0x1f')](function(_0x2d8e66){logger['info']('GetZohoAccount',_0xe6314f);logger['debug']('GetZohoAccount',_0xe6314f,JSON[_0x2cae('0x20')](_0x2d8e66));_0x164aee(_0x2d8e66);})[_0x2cae('0x14')](function(_0x3a16b6){logger[_0x2cae('0x11')]('GetZohoAccount',_0x3a16b6[_0x2cae('0x13')],_0xe6314f);_0x398290(_0x2813b1[_0x2cae('0x11')](0x1f4,_0x3a16b6[_0x2cae('0x13')]));});});};exports['ShowZohoAccount']=function(_0x2db662){var _0x5cdbac=this;return new Promise(function(_0x3dfde5,_0x594c4f){return db[_0x2cae('0x16')][_0x2cae('0x21')]({'raw':_0x2db662[_0x2cae('0x17')]?_0x2db662['options'][_0x2cae('0x18')]===undefined?!![]:![]:!![],'where':_0x2db662[_0x2cae('0x17')]?_0x2db662[_0x2cae('0x17')][_0x2cae('0x19')]||null:null,'attributes':_0x2db662[_0x2cae('0x17')]?_0x2db662[_0x2cae('0x17')]['attributes']||null:null,'include':_0x2db662['options']?_0x2db662[_0x2cae('0x17')][_0x2cae('0x1e')]?_['map'](_0x2db662['options']['include'],function(_0x374675){return{'model':db[_0x374675[_0x2cae('0x1c')]],'as':_0x374675['as'],'attributes':_0x374675['attributes'],'include':_0x374675['include']?_['map'](_0x374675[_0x2cae('0x1e')],function(_0x222828){return{'model':db[_0x222828[_0x2cae('0x1c')]],'as':_0x222828['as'],'attributes':_0x222828[_0x2cae('0x1d')],'include':_0x222828[_0x2cae('0x1e')]?_['map'](_0x222828[_0x2cae('0x1e')],function(_0xe21a66){return{'model':db[_0xe21a66['model']],'as':_0xe21a66['as'],'attributes':_0xe21a66[_0x2cae('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2cae('0x1f')](function(_0x2516f0){logger[_0x2cae('0xc')](_0x2cae('0x22'),_0x2db662);logger[_0x2cae('0xf')]('ShowZohoAccount',_0x2db662,JSON[_0x2cae('0x20')](_0x2516f0));_0x3dfde5(_0x2516f0);})[_0x2cae('0x14')](function(_0x4c733f){logger[_0x2cae('0x11')](_0x2cae('0x22'),_0x4c733f[_0x2cae('0x13')],_0x2db662);_0x594c4f(_0x5cdbac[_0x2cae('0x11')](0x1f4,_0x4c733f[_0x2cae('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 6d11f88..84c396b 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 _0x7abf=['../../config/environment','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x7abf,0x142));var _0xf7ab=function(_0x5bb551,_0x39495a){_0x5bb551=_0x5bb551-0x0;var _0x312415=_0x7abf[_0x5bb551];return _0x312415;};'use strict';var multer=require(_0xf7ab('0x0'));var util=require(_0xf7ab('0x1'));var path=require(_0xf7ab('0x2'));var timeout=require(_0xf7ab('0x3'));var express=require(_0xf7ab('0x4'));var router=express[_0xf7ab('0x5')]();var fs_extra=require(_0xf7ab('0x6'));var auth=require(_0xf7ab('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf7ab('0x8'));var controller=require('./intZohoConfiguration.controller');router[_0xf7ab('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf7ab('0x9')](_0xf7ab('0xa'),auth[_0xf7ab('0xb')](),controller['show']);router[_0xf7ab('0x9')](_0xf7ab('0xc'),auth[_0xf7ab('0xb')](),controller[_0xf7ab('0xd')]);router[_0xf7ab('0x9')](_0xf7ab('0xe'),auth[_0xf7ab('0xb')](),controller[_0xf7ab('0xf')]);router[_0xf7ab('0x9')](_0xf7ab('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf7ab('0x11')]('/',auth[_0xf7ab('0xb')](),controller[_0xf7ab('0x12')]);router[_0xf7ab('0x13')](_0xf7ab('0xa'),auth[_0xf7ab('0xb')](),controller[_0xf7ab('0x14')]);router['delete'](_0xf7ab('0xa'),auth[_0xf7ab('0xb')](),controller['destroy']);module[_0xf7ab('0x15')]=router; \ No newline at end of file +var _0x52bf=['/:id/descriptions','post','create','put','update','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x4f3888,_0x285689){var _0x2bbc83=function(_0x40302e){while(--_0x40302e){_0x4f3888['push'](_0x4f3888['shift']());}};_0x2bbc83(++_0x285689);}(_0x52bf,0x105));var _0xf52b=function(_0x3855fc,_0x3f44bb){_0x3855fc=_0x3855fc-0x0;var _0x47a15b=_0x52bf[_0x3855fc];return _0x47a15b;};'use strict';var multer=require(_0xf52b('0x0'));var util=require(_0xf52b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf52b('0x2'));var router=express[_0xf52b('0x3')]();var fs_extra=require(_0xf52b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf52b('0x5'));var config=require(_0xf52b('0x6'));var controller=require(_0xf52b('0x7'));router[_0xf52b('0x8')]('/',auth[_0xf52b('0x9')](),controller['index']);router['get']('/:id',auth[_0xf52b('0x9')](),controller[_0xf52b('0xa')]);router[_0xf52b('0x8')](_0xf52b('0xb'),auth[_0xf52b('0x9')](),controller[_0xf52b('0xc')]);router[_0xf52b('0x8')](_0xf52b('0xd'),auth[_0xf52b('0x9')](),controller[_0xf52b('0xe')]);router[_0xf52b('0x8')](_0xf52b('0xf'),auth[_0xf52b('0x9')](),controller['getDescriptions']);router[_0xf52b('0x10')]('/',auth[_0xf52b('0x9')](),controller[_0xf52b('0x11')]);router[_0xf52b('0x12')]('/:id',auth[_0xf52b('0x9')](),controller[_0xf52b('0x13')]);router['delete'](_0xf52b('0x14'),auth[_0xf52b('0x9')](),controller[_0xf52b('0x15')]);module[_0xf52b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 33d54dc..70007c5 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 _0x644d=['contact','sequelize','exports','STRING','ENUM','lead','contact_lead'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x644d,0xf6));var _0xd644=function(_0x255b94,_0x352b45){_0x255b94=_0x255b94-0x0;var _0xc5806b=_0x644d[_0x255b94];return _0xc5806b;};'use strict';var Sequelize=require(_0xd644('0x0'));module[_0xd644('0x1')]={'name':{'type':Sequelize[_0xd644('0x2')]},'moduleCreate':{'type':Sequelize[_0xd644('0x3')](_0xd644('0x4'),'contact','nothing'),'defaultValue':_0xd644('0x4')},'moduleSearch':{'type':Sequelize[_0xd644('0x3')](_0xd644('0x5'),_0xd644('0x6'),_0xd644('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xd644('0x2')]}}; \ No newline at end of file +var _0x6708=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports','STRING'];(function(_0x4e7f0a,_0x501d22){var _0x2e9128=function(_0x39a175){while(--_0x39a175){_0x4e7f0a['push'](_0x4e7f0a['shift']());}};_0x2e9128(++_0x501d22);}(_0x6708,0xc5));var _0x8670=function(_0x5687fe,_0x519bee){_0x5687fe=_0x5687fe-0x0;var _0x31c230=_0x6708[_0x5687fe];return _0x31c230;};'use strict';var Sequelize=require(_0x8670('0x0'));module[_0x8670('0x1')]={'name':{'type':Sequelize[_0x8670('0x2')]},'moduleCreate':{'type':Sequelize[_0x8670('0x3')](_0x8670('0x4'),_0x8670('0x5'),_0x8670('0x6')),'defaultValue':_0x8670('0x4')},'moduleSearch':{'type':Sequelize[_0x8670('0x3')](_0x8670('0x7'),_0x8670('0x5'),_0x8670('0x4')),'defaultValue':_0x8670('0x7')},'description':{'type':Sequelize[_0x8670('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index a4120bf..b12b45b 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 _0xb2e0=['error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','body','params','findOne','ZohoField','options','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy'];(function(_0x54ed58,_0x219610){var _0x1eb065=function(_0x2b9a60){while(--_0x2b9a60){_0x54ed58['push'](_0x54ed58['shift']());}};_0x1eb065(++_0x219610);}(_0xb2e0,0x1cf));var _0x0b2e=function(_0x395aaa,_0x30eed7){_0x395aaa=_0x395aaa-0x0;var _0x2acc00=_0xb2e0[_0x395aaa];return _0x2acc00;};'use strict';var emlformat=require(_0x0b2e('0x0'));var rimraf=require(_0x0b2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b2e('0x2'));var rp=require(_0x0b2e('0x3'));var moment=require(_0x0b2e('0x4'));var BPromise=require(_0x0b2e('0x5'));var Mustache=require(_0x0b2e('0x6'));var util=require(_0x0b2e('0x7'));var path=require(_0x0b2e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0b2e('0x9'));var fs=require('fs');var fs_extra=require(_0x0b2e('0xa'));var _=require(_0x0b2e('0xb'));var squel=require(_0x0b2e('0xc'));var crypto=require(_0x0b2e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0b2e('0xe'));var toCsv=require(_0x0b2e('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0b2e('0x10'));var authService=require(_0x0b2e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0b2e('0x12'));var hardwareService=require(_0x0b2e('0x13'));var logger=require(_0x0b2e('0x14'))(_0x0b2e('0x15'));var utils=require(_0x0b2e('0x16'));var config=require(_0x0b2e('0x17'));var licenseUtil=require(_0x0b2e('0x18'));var db=require(_0x0b2e('0x19'))['db'];function respondWithStatusCode(_0x22247e,_0x62b199){_0x62b199=_0x62b199||0xcc;return function(_0x2f2b62){if(_0x2f2b62){return _0x22247e[_0x0b2e('0x1a')](_0x62b199);}return _0x22247e[_0x0b2e('0x1b')](_0x62b199)[_0x0b2e('0x1c')]();};}function respondWithResult(_0x564a20,_0x5ea08f){_0x5ea08f=_0x5ea08f||0xc8;return function(_0x228a73){if(_0x228a73){return _0x564a20[_0x0b2e('0x1b')](_0x5ea08f)['json'](_0x228a73);}};}function respondWithFilteredResult(_0x567ed8,_0x169998){return function(_0x568a78){if(_0x568a78){var _0x52118f=typeof _0x169998[_0x0b2e('0x1d')]==='undefined'&&typeof _0x169998[_0x0b2e('0x1e')]===_0x0b2e('0x1f');var _0x2c2fb7=_0x568a78[_0x0b2e('0x20')];var _0x4d46a5=_0x52118f?0x0:_0x169998[_0x0b2e('0x1d')];var _0x3da3ed=_0x52118f?_0x568a78[_0x0b2e('0x20')]:_0x169998[_0x0b2e('0x1d')]+_0x169998[_0x0b2e('0x1e')];var _0x169258;if(_0x3da3ed>=_0x2c2fb7){_0x3da3ed=_0x2c2fb7;_0x169258=0xc8;}else{_0x169258=0xce;}_0x567ed8[_0x0b2e('0x1b')](_0x169258);return _0x567ed8[_0x0b2e('0x21')]('Content-Range',_0x4d46a5+'-'+_0x3da3ed+'/'+_0x2c2fb7)[_0x0b2e('0x22')](_0x568a78);}return null;};}function patchUpdates(_0x10c410){return function(_0xa0bea8){try{jsonpatch[_0x0b2e('0x23')](_0xa0bea8,_0x10c410,!![]);}catch(_0x309fa4){return BPromise[_0x0b2e('0x24')](_0x309fa4);}return _0xa0bea8[_0x0b2e('0x25')]();};}function saveUpdates(_0x22cb28,_0x19f2bd){return function(_0x15d8f7){if(_0x15d8f7){return _0x15d8f7[_0x0b2e('0x26')](_0x22cb28)[_0x0b2e('0x27')](function(_0x151252){return _0x151252;});}return null;};}function removeEntity(_0x47f5b7,_0x37b805){return function(_0x4f4bec){if(_0x4f4bec){return _0x4f4bec[_0x0b2e('0x28')]()[_0x0b2e('0x27')](function(){_0x47f5b7[_0x0b2e('0x1b')](0xcc)[_0x0b2e('0x1c')]();});}};}function handleEntityNotFound(_0x35a239,_0x390087){return function(_0x1e4628){if(!_0x1e4628){_0x35a239[_0x0b2e('0x1a')](0x194);}return _0x1e4628;};}function handleError(_0x3b41c2,_0x222f27){_0x222f27=_0x222f27||0x1f4;return function(_0x2c7490){logger[_0x0b2e('0x29')](_0x2c7490[_0x0b2e('0x2a')]);if(_0x2c7490[_0x0b2e('0x2b')]){delete _0x2c7490[_0x0b2e('0x2b')];}_0x3b41c2[_0x0b2e('0x1b')](_0x222f27)[_0x0b2e('0x2c')](_0x2c7490);};}exports[_0x0b2e('0x2d')]=function(_0x589b08,_0x4ce1ba){var _0x5a37ad={},_0x2be53b={},_0x55948e={'count':0x0,'rows':[]};var _0x2aa69a=_[_0x0b2e('0x2e')](db[_0x0b2e('0x2f')][_0x0b2e('0x30')],function(_0x3f776f){return{'name':_0x3f776f[_0x0b2e('0x31')],'type':_0x3f776f[_0x0b2e('0x32')]['key']};});_0x2be53b[_0x0b2e('0x33')]=_['map'](_0x2aa69a,'name');_0x2be53b['query']=_[_0x0b2e('0x34')](_0x589b08[_0x0b2e('0x35')]);_0x2be53b[_0x0b2e('0x36')]=_[_0x0b2e('0x37')](_0x2be53b[_0x0b2e('0x33')],_0x2be53b[_0x0b2e('0x35')]);_0x5a37ad['attributes']=_[_0x0b2e('0x37')](_0x2be53b['model'],qs[_0x0b2e('0x38')](_0x589b08['query'][_0x0b2e('0x38')]));_0x5a37ad[_0x0b2e('0x39')]=_0x5a37ad[_0x0b2e('0x39')][_0x0b2e('0x3a')]?_0x5a37ad['attributes']:_0x2be53b[_0x0b2e('0x33')];if(!_0x589b08[_0x0b2e('0x35')]['hasOwnProperty'](_0x0b2e('0x3b'))){_0x5a37ad[_0x0b2e('0x1e')]=qs[_0x0b2e('0x1e')](_0x589b08['query'][_0x0b2e('0x1e')]);_0x5a37ad[_0x0b2e('0x1d')]=qs[_0x0b2e('0x1d')](_0x589b08[_0x0b2e('0x35')][_0x0b2e('0x1d')]);}_0x5a37ad[_0x0b2e('0x3c')]=qs[_0x0b2e('0x3d')](_0x589b08['query'][_0x0b2e('0x3d')]);_0x5a37ad['where']=qs[_0x0b2e('0x36')](_[_0x0b2e('0x3e')](_0x589b08[_0x0b2e('0x35')],_0x2be53b[_0x0b2e('0x36')]),_0x2aa69a);if(_0x589b08[_0x0b2e('0x35')][_0x0b2e('0x3f')]){_0x5a37ad[_0x0b2e('0x40')]=_[_0x0b2e('0x41')](_0x5a37ad[_0x0b2e('0x40')],{'$or':_[_0x0b2e('0x2e')](_0x2aa69a,function(_0x1027f5){if(_0x1027f5['type']!==_0x0b2e('0x42')){var _0x1a0381={};_0x1a0381[_0x1027f5[_0x0b2e('0x2b')]]={'$like':'%'+_0x589b08[_0x0b2e('0x35')][_0x0b2e('0x3f')]+'%'};return _0x1a0381;}})});}_0x5a37ad=_['merge']({},_0x5a37ad,_0x589b08['options']);var _0x4e1c3b={'where':_0x5a37ad[_0x0b2e('0x40')]};return db[_0x0b2e('0x2f')][_0x0b2e('0x20')](_0x4e1c3b)[_0x0b2e('0x27')](function(_0x5c5f0e){_0x55948e[_0x0b2e('0x20')]=_0x5c5f0e;if(_0x589b08[_0x0b2e('0x35')][_0x0b2e('0x43')]){_0x5a37ad[_0x0b2e('0x44')]=[{'all':!![]}];}return db[_0x0b2e('0x2f')][_0x0b2e('0x45')](_0x5a37ad);})[_0x0b2e('0x27')](function(_0x1c8a5b){_0x55948e[_0x0b2e('0x46')]=_0x1c8a5b;return _0x55948e;})[_0x0b2e('0x27')](respondWithFilteredResult(_0x4ce1ba,_0x5a37ad))[_0x0b2e('0x47')](handleError(_0x4ce1ba,null));};exports[_0x0b2e('0x48')]=function(_0x4b5a70,_0x5496cc){var _0x4681fe={'raw':![],'where':{'id':_0x4b5a70['params']['id']}},_0x56da02={};_0x56da02[_0x0b2e('0x33')]=_['keys'](db['ZohoConfiguration'][_0x0b2e('0x30')]);_0x56da02['query']=_['keys'](_0x4b5a70['query']);_0x56da02[_0x0b2e('0x36')]=_[_0x0b2e('0x37')](_0x56da02['model'],_0x56da02[_0x0b2e('0x35')]);_0x4681fe['attributes']=_[_0x0b2e('0x37')](_0x56da02[_0x0b2e('0x33')],qs['fields'](_0x4b5a70[_0x0b2e('0x35')]['fields']));_0x4681fe['attributes']=_0x4681fe[_0x0b2e('0x39')]['length']?_0x4681fe[_0x0b2e('0x39')]:_0x56da02[_0x0b2e('0x33')];if(_0x4b5a70[_0x0b2e('0x35')][_0x0b2e('0x43')]){_0x4681fe[_0x0b2e('0x44')]=[{'all':!![]}];}_0x4681fe=_['merge']({},_0x4681fe,_0x4b5a70['options']);return db[_0x0b2e('0x2f')][_0x0b2e('0x49')](_0x4681fe)['then'](handleEntityNotFound(_0x5496cc,null))[_0x0b2e('0x27')](respondWithResult(_0x5496cc,null))['catch'](handleError(_0x5496cc,null));};exports['create']=function(_0x25a527,_0x127dae){return db['ZohoConfiguration'][_0x0b2e('0x4a')](_0x25a527[_0x0b2e('0x4b')],{})[_0x0b2e('0x27')](respondWithResult(_0x127dae,0xc9))[_0x0b2e('0x47')](handleError(_0x127dae,null));};exports['update']=function(_0x12b1d1,_0x5ee44){if(_0x12b1d1[_0x0b2e('0x4b')]['id']){delete _0x12b1d1['body']['id'];}return db[_0x0b2e('0x2f')][_0x0b2e('0x49')]({'where':{'id':_0x12b1d1[_0x0b2e('0x4c')]['id']}})[_0x0b2e('0x27')](handleEntityNotFound(_0x5ee44,null))[_0x0b2e('0x27')](saveUpdates(_0x12b1d1[_0x0b2e('0x4b')],null))[_0x0b2e('0x27')](respondWithResult(_0x5ee44,null))[_0x0b2e('0x47')](handleError(_0x5ee44,null));};exports[_0x0b2e('0x28')]=function(_0x3bfff1,_0x5907c5){return db['ZohoConfiguration'][_0x0b2e('0x49')]({'where':{'id':_0x3bfff1[_0x0b2e('0x4c')]['id']}})[_0x0b2e('0x27')](handleEntityNotFound(_0x5907c5,null))['then'](removeEntity(_0x5907c5,null))[_0x0b2e('0x47')](handleError(_0x5907c5,null));};exports['getFields']=function(_0x1c8908,_0x27c0ee,_0xc73d1e){var _0x1de56b={};var _0x4c45dc={};var _0x3d2de7;var _0xc3650b;return db['ZohoConfiguration'][_0x0b2e('0x4d')]({'where':{'id':_0x1c8908[_0x0b2e('0x4c')]['id']}})[_0x0b2e('0x27')](handleEntityNotFound(_0x27c0ee,null))[_0x0b2e('0x27')](function(_0x4cdb37){if(_0x4cdb37){_0x3d2de7=_0x4cdb37;_0x4c45dc['model']=_['keys'](db[_0x0b2e('0x4e')]['rawAttributes']);_0x4c45dc[_0x0b2e('0x35')]=_['keys'](_0x1c8908[_0x0b2e('0x35')]);_0x4c45dc[_0x0b2e('0x36')]=_[_0x0b2e('0x37')](_0x4c45dc['model'],_0x4c45dc['query']);_0x1de56b[_0x0b2e('0x39')]=_[_0x0b2e('0x37')](_0x4c45dc['model'],qs[_0x0b2e('0x38')](_0x1c8908[_0x0b2e('0x35')][_0x0b2e('0x38')]));_0x1de56b['attributes']=_0x1de56b[_0x0b2e('0x39')]['length']?_0x1de56b[_0x0b2e('0x39')]:_0x4c45dc['model'];_0x1de56b[_0x0b2e('0x3c')]=qs[_0x0b2e('0x3d')](_0x1c8908[_0x0b2e('0x35')][_0x0b2e('0x3d')]);_0x1de56b[_0x0b2e('0x40')]=qs[_0x0b2e('0x36')](_[_0x0b2e('0x3e')](_0x1c8908['query'],_0x4c45dc[_0x0b2e('0x36')]));if(_0x1c8908[_0x0b2e('0x35')][_0x0b2e('0x3f')]){_0x1de56b['where']=_[_0x0b2e('0x41')](_0x1de56b['where'],{'$or':_['map'](_0x1de56b[_0x0b2e('0x39')],function(_0x48f485){var _0x5b259b={};_0x5b259b[_0x48f485]={'$like':'%'+_0x1c8908[_0x0b2e('0x35')][_0x0b2e('0x3f')]+'%'};return _0x5b259b;})});}_0x1de56b=_['merge']({},_0x1de56b,_0x1c8908[_0x0b2e('0x4f')]);return _0x3d2de7[_0x0b2e('0x50')](_0x1de56b);}})[_0x0b2e('0x27')](function(_0x14c797){if(_0x14c797){_0xc3650b=_0x14c797[_0x0b2e('0x3a')];if(!_0x1c8908[_0x0b2e('0x35')][_0x0b2e('0x51')](_0x0b2e('0x3b'))){_0x1de56b[_0x0b2e('0x1e')]=qs['limit'](_0x1c8908[_0x0b2e('0x35')][_0x0b2e('0x1e')]);_0x1de56b[_0x0b2e('0x1d')]=qs[_0x0b2e('0x1d')](_0x1c8908[_0x0b2e('0x35')]['offset']);}return _0x3d2de7['getFields'](_0x1de56b);}})[_0x0b2e('0x27')](function(_0x211e08){if(_0x211e08){return _0x211e08?{'count':_0xc3650b,'rows':_0x211e08}:null;}})[_0x0b2e('0x27')](respondWithResult(_0x27c0ee,null))[_0x0b2e('0x47')](handleError(_0x27c0ee,null));};exports[_0x0b2e('0x52')]=function(_0x5b1a2c,_0x4ad087,_0x5e9e95){var _0xc36b43={};var _0x1ba40f={};var _0x7e1987;var _0x319f3c;return db[_0x0b2e('0x2f')][_0x0b2e('0x4d')]({'where':{'id':_0x5b1a2c[_0x0b2e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ad087,null))[_0x0b2e('0x27')](function(_0x38161e){if(_0x38161e){_0x7e1987=_0x38161e;_0x1ba40f[_0x0b2e('0x33')]=_[_0x0b2e('0x34')](db[_0x0b2e('0x4e')]['rawAttributes']);_0x1ba40f[_0x0b2e('0x35')]=_[_0x0b2e('0x34')](_0x5b1a2c[_0x0b2e('0x35')]);_0x1ba40f[_0x0b2e('0x36')]=_[_0x0b2e('0x37')](_0x1ba40f[_0x0b2e('0x33')],_0x1ba40f[_0x0b2e('0x35')]);_0xc36b43[_0x0b2e('0x39')]=_[_0x0b2e('0x37')](_0x1ba40f[_0x0b2e('0x33')],qs[_0x0b2e('0x38')](_0x5b1a2c[_0x0b2e('0x35')]['fields']));_0xc36b43[_0x0b2e('0x39')]=_0xc36b43[_0x0b2e('0x39')][_0x0b2e('0x3a')]?_0xc36b43[_0x0b2e('0x39')]:_0x1ba40f[_0x0b2e('0x33')];_0xc36b43[_0x0b2e('0x3c')]=qs[_0x0b2e('0x3d')](_0x5b1a2c[_0x0b2e('0x35')][_0x0b2e('0x3d')]);_0xc36b43[_0x0b2e('0x40')]=qs[_0x0b2e('0x36')](_['pick'](_0x5b1a2c['query'],_0x1ba40f[_0x0b2e('0x36')]));if(_0x5b1a2c[_0x0b2e('0x35')]['filter']){_0xc36b43[_0x0b2e('0x40')]=_[_0x0b2e('0x41')](_0xc36b43[_0x0b2e('0x40')],{'$or':_['map'](_0xc36b43['attributes'],function(_0x249c45){var _0x46a20b={};_0x46a20b[_0x249c45]={'$like':'%'+_0x5b1a2c[_0x0b2e('0x35')][_0x0b2e('0x3f')]+'%'};return _0x46a20b;})});}_0xc36b43=_[_0x0b2e('0x41')]({},_0xc36b43,_0x5b1a2c[_0x0b2e('0x4f')]);return _0x7e1987[_0x0b2e('0x52')](_0xc36b43);}})[_0x0b2e('0x27')](function(_0x338d91){if(_0x338d91){_0x319f3c=_0x338d91['length'];if(!_0x5b1a2c[_0x0b2e('0x35')]['hasOwnProperty'](_0x0b2e('0x3b'))){_0xc36b43[_0x0b2e('0x1e')]=qs[_0x0b2e('0x1e')](_0x5b1a2c[_0x0b2e('0x35')][_0x0b2e('0x1e')]);_0xc36b43['offset']=qs[_0x0b2e('0x1d')](_0x5b1a2c[_0x0b2e('0x35')][_0x0b2e('0x1d')]);}return _0x7e1987[_0x0b2e('0x52')](_0xc36b43);}})[_0x0b2e('0x27')](function(_0x33780e){if(_0x33780e){return _0x33780e?{'count':_0x319f3c,'rows':_0x33780e}:null;}})[_0x0b2e('0x27')](respondWithResult(_0x4ad087,null))[_0x0b2e('0x47')](handleError(_0x4ad087,null));};exports[_0x0b2e('0x53')]=function(_0x1c3670,_0x30a0eb,_0xc7b3a5){var _0x17a528={};var _0x1330d7={};var _0x49237b;var _0x563e4d;return db[_0x0b2e('0x2f')][_0x0b2e('0x4d')]({'where':{'id':_0x1c3670[_0x0b2e('0x4c')]['id']}})[_0x0b2e('0x27')](handleEntityNotFound(_0x30a0eb,null))[_0x0b2e('0x27')](function(_0x2fec0f){if(_0x2fec0f){_0x49237b=_0x2fec0f;_0x1330d7[_0x0b2e('0x33')]=_[_0x0b2e('0x34')](db[_0x0b2e('0x4e')][_0x0b2e('0x30')]);_0x1330d7['query']=_['keys'](_0x1c3670[_0x0b2e('0x35')]);_0x1330d7[_0x0b2e('0x36')]=_[_0x0b2e('0x37')](_0x1330d7[_0x0b2e('0x33')],_0x1330d7['query']);_0x17a528[_0x0b2e('0x39')]=_[_0x0b2e('0x37')](_0x1330d7[_0x0b2e('0x33')],qs[_0x0b2e('0x38')](_0x1c3670[_0x0b2e('0x35')][_0x0b2e('0x38')]));_0x17a528['attributes']=_0x17a528[_0x0b2e('0x39')]['length']?_0x17a528[_0x0b2e('0x39')]:_0x1330d7[_0x0b2e('0x33')];_0x17a528[_0x0b2e('0x3c')]=qs[_0x0b2e('0x3d')](_0x1c3670[_0x0b2e('0x35')][_0x0b2e('0x3d')]);_0x17a528[_0x0b2e('0x40')]=qs[_0x0b2e('0x36')](_['pick'](_0x1c3670[_0x0b2e('0x35')],_0x1330d7[_0x0b2e('0x36')]));if(_0x1c3670['query'][_0x0b2e('0x3f')]){_0x17a528[_0x0b2e('0x40')]=_['merge'](_0x17a528[_0x0b2e('0x40')],{'$or':_[_0x0b2e('0x2e')](_0x17a528[_0x0b2e('0x39')],function(_0x14b0f5){var _0x5729d9={};_0x5729d9[_0x14b0f5]={'$like':'%'+_0x1c3670[_0x0b2e('0x35')]['filter']+'%'};return _0x5729d9;})});}_0x17a528=_['merge']({},_0x17a528,_0x1c3670[_0x0b2e('0x4f')]);return _0x49237b[_0x0b2e('0x53')](_0x17a528);}})['then'](function(_0x3dcf3b){if(_0x3dcf3b){_0x563e4d=_0x3dcf3b[_0x0b2e('0x3a')];if(!_0x1c3670[_0x0b2e('0x35')][_0x0b2e('0x51')]('nolimit')){_0x17a528['limit']=qs['limit'](_0x1c3670[_0x0b2e('0x35')][_0x0b2e('0x1e')]);_0x17a528[_0x0b2e('0x1d')]=qs[_0x0b2e('0x1d')](_0x1c3670[_0x0b2e('0x35')][_0x0b2e('0x1d')]);}return _0x49237b['getDescriptions'](_0x17a528);}})['then'](function(_0x40b076){if(_0x40b076){return _0x40b076?{'count':_0x563e4d,'rows':_0x40b076}:null;}})['then'](respondWithResult(_0x30a0eb,null))[_0x0b2e('0x47')](handleError(_0x30a0eb,null));}; \ No newline at end of file +var _0xe267=['include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','catch','getFields','findOne','ZohoField','getSubjects','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ZohoConfiguration','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0xc12271,_0xc84412){var _0x224219=function(_0x4e90dc){while(--_0x4e90dc){_0xc12271['push'](_0xc12271['shift']());}};_0x224219(++_0xc84412);}(_0xe267,0x1bf));var _0x7e26=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xe267[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e26('0x0'));var zipdir=require(_0x7e26('0x1'));var jsonpatch=require(_0x7e26('0x2'));var rp=require('request-promise');var moment=require(_0x7e26('0x3'));var BPromise=require(_0x7e26('0x4'));var Mustache=require('mustache');var util=require(_0x7e26('0x5'));var path=require(_0x7e26('0x6'));var sox=require(_0x7e26('0x7'));var csv=require('to-csv');var ejs=require(_0x7e26('0x8'));var fs=require('fs');var fs_extra=require(_0x7e26('0x9'));var _=require(_0x7e26('0xa'));var squel=require(_0x7e26('0xb'));var crypto=require(_0x7e26('0xc'));var jsforce=require(_0x7e26('0xd'));var deskjs=require(_0x7e26('0xe'));var toCsv=require(_0x7e26('0xf'));var querystring=require(_0x7e26('0x10'));var Papa=require(_0x7e26('0x11'));var Redis=require(_0x7e26('0x12'));var authService=require(_0x7e26('0x13'));var qs=require(_0x7e26('0x14'));var as=require(_0x7e26('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e26('0x16'))(_0x7e26('0x17'));var utils=require(_0x7e26('0x18'));var config=require(_0x7e26('0x19'));var licenseUtil=require(_0x7e26('0x1a'));var db=require(_0x7e26('0x1b'))['db'];function respondWithStatusCode(_0x34285a,_0x3d607b){_0x3d607b=_0x3d607b||0xcc;return function(_0x9bebc4){if(_0x9bebc4){return _0x34285a[_0x7e26('0x1c')](_0x3d607b);}return _0x34285a['status'](_0x3d607b)['end']();};}function respondWithResult(_0x6bdcd2,_0xe389a1){_0xe389a1=_0xe389a1||0xc8;return function(_0x5af794){if(_0x5af794){return _0x6bdcd2[_0x7e26('0x1d')](_0xe389a1)[_0x7e26('0x1e')](_0x5af794);}};}function respondWithFilteredResult(_0x4601c9,_0x36af66){return function(_0x50446f){if(_0x50446f){var _0x1ea67a=typeof _0x36af66['offset']===_0x7e26('0x1f')&&typeof _0x36af66[_0x7e26('0x20')]==='undefined';var _0x4b34de=_0x50446f['count'];var _0x209b2c=_0x1ea67a?0x0:_0x36af66[_0x7e26('0x21')];var _0x140846=_0x1ea67a?_0x50446f[_0x7e26('0x22')]:_0x36af66[_0x7e26('0x21')]+_0x36af66[_0x7e26('0x20')];var _0x495c3e;if(_0x140846>=_0x4b34de){_0x140846=_0x4b34de;_0x495c3e=0xc8;}else{_0x495c3e=0xce;}_0x4601c9[_0x7e26('0x1d')](_0x495c3e);return _0x4601c9[_0x7e26('0x23')](_0x7e26('0x24'),_0x209b2c+'-'+_0x140846+'/'+_0x4b34de)[_0x7e26('0x1e')](_0x50446f);}return null;};}function patchUpdates(_0x176515){return function(_0x1880a4){try{jsonpatch[_0x7e26('0x25')](_0x1880a4,_0x176515,!![]);}catch(_0x3f1dcc){return BPromise[_0x7e26('0x26')](_0x3f1dcc);}return _0x1880a4['save']();};}function saveUpdates(_0xb9789a,_0x5b9f6f){return function(_0x16248a){if(_0x16248a){return _0x16248a[_0x7e26('0x27')](_0xb9789a)[_0x7e26('0x28')](function(_0x53897b){return _0x53897b;});}return null;};}function removeEntity(_0xa15cf8,_0x21797c){return function(_0x525c4b){if(_0x525c4b){return _0x525c4b[_0x7e26('0x29')]()[_0x7e26('0x28')](function(){_0xa15cf8[_0x7e26('0x1d')](0xcc)[_0x7e26('0x2a')]();});}};}function handleEntityNotFound(_0x1e3f22,_0x44e43a){return function(_0x2de8b4){if(!_0x2de8b4){_0x1e3f22[_0x7e26('0x1c')](0x194);}return _0x2de8b4;};}function handleError(_0x469ab7,_0x756129){_0x756129=_0x756129||0x1f4;return function(_0x4a8fda){logger[_0x7e26('0x2b')](_0x4a8fda[_0x7e26('0x2c')]);if(_0x4a8fda[_0x7e26('0x2d')]){delete _0x4a8fda[_0x7e26('0x2d')];}_0x469ab7[_0x7e26('0x1d')](_0x756129)[_0x7e26('0x2e')](_0x4a8fda);};}exports[_0x7e26('0x2f')]=function(_0x5992e9,_0x501337){var _0x18680e={},_0x1f679c={},_0x1c8296={'count':0x0,'rows':[]};var _0x5da54f=_[_0x7e26('0x30')](db[_0x7e26('0x31')]['rawAttributes'],function(_0x29193a){return{'name':_0x29193a['fieldName'],'type':_0x29193a[_0x7e26('0x32')][_0x7e26('0x33')]};});_0x1f679c[_0x7e26('0x34')]=_['map'](_0x5da54f,_0x7e26('0x2d'));_0x1f679c[_0x7e26('0x35')]=_[_0x7e26('0x36')](_0x5992e9[_0x7e26('0x35')]);_0x1f679c['filters']=_['intersection'](_0x1f679c[_0x7e26('0x34')],_0x1f679c[_0x7e26('0x35')]);_0x18680e[_0x7e26('0x37')]=_[_0x7e26('0x38')](_0x1f679c[_0x7e26('0x34')],qs[_0x7e26('0x39')](_0x5992e9[_0x7e26('0x35')]['fields']));_0x18680e[_0x7e26('0x37')]=_0x18680e[_0x7e26('0x37')][_0x7e26('0x3a')]?_0x18680e['attributes']:_0x1f679c[_0x7e26('0x34')];if(!_0x5992e9[_0x7e26('0x35')][_0x7e26('0x3b')]('nolimit')){_0x18680e['limit']=qs['limit'](_0x5992e9['query']['limit']);_0x18680e[_0x7e26('0x21')]=qs[_0x7e26('0x21')](_0x5992e9[_0x7e26('0x35')][_0x7e26('0x21')]);}_0x18680e[_0x7e26('0x3c')]=qs[_0x7e26('0x3d')](_0x5992e9[_0x7e26('0x35')][_0x7e26('0x3d')]);_0x18680e[_0x7e26('0x3e')]=qs[_0x7e26('0x3f')](_[_0x7e26('0x40')](_0x5992e9[_0x7e26('0x35')],_0x1f679c[_0x7e26('0x3f')]),_0x5da54f);if(_0x5992e9[_0x7e26('0x35')][_0x7e26('0x41')]){_0x18680e['where']=_[_0x7e26('0x42')](_0x18680e[_0x7e26('0x3e')],{'$or':_['map'](_0x5da54f,function(_0x4e53a0){if(_0x4e53a0['type']!==_0x7e26('0x43')){var _0x46c094={};_0x46c094[_0x4e53a0[_0x7e26('0x2d')]]={'$like':'%'+_0x5992e9['query'][_0x7e26('0x41')]+'%'};return _0x46c094;}})});}_0x18680e=_['merge']({},_0x18680e,_0x5992e9[_0x7e26('0x44')]);var _0x370f03={'where':_0x18680e[_0x7e26('0x3e')]};return db[_0x7e26('0x31')][_0x7e26('0x22')](_0x370f03)[_0x7e26('0x28')](function(_0x1d624a){_0x1c8296[_0x7e26('0x22')]=_0x1d624a;if(_0x5992e9[_0x7e26('0x35')]['includeAll']){_0x18680e[_0x7e26('0x45')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x7e26('0x46')](_0x18680e);})[_0x7e26('0x28')](function(_0x4646ac){_0x1c8296[_0x7e26('0x47')]=_0x4646ac;return _0x1c8296;})[_0x7e26('0x28')](respondWithFilteredResult(_0x501337,_0x18680e))['catch'](handleError(_0x501337,null));};exports[_0x7e26('0x48')]=function(_0x494fb1,_0x3fa47c){var _0x1d322a={'raw':![],'where':{'id':_0x494fb1[_0x7e26('0x49')]['id']}},_0x4ea2c5={};_0x4ea2c5[_0x7e26('0x34')]=_[_0x7e26('0x36')](db[_0x7e26('0x31')][_0x7e26('0x4a')]);_0x4ea2c5[_0x7e26('0x35')]=_[_0x7e26('0x36')](_0x494fb1[_0x7e26('0x35')]);_0x4ea2c5[_0x7e26('0x3f')]=_[_0x7e26('0x38')](_0x4ea2c5['model'],_0x4ea2c5[_0x7e26('0x35')]);_0x1d322a[_0x7e26('0x37')]=_['intersection'](_0x4ea2c5[_0x7e26('0x34')],qs[_0x7e26('0x39')](_0x494fb1[_0x7e26('0x35')][_0x7e26('0x39')]));_0x1d322a[_0x7e26('0x37')]=_0x1d322a[_0x7e26('0x37')]['length']?_0x1d322a[_0x7e26('0x37')]:_0x4ea2c5[_0x7e26('0x34')];if(_0x494fb1[_0x7e26('0x35')][_0x7e26('0x4b')]){_0x1d322a[_0x7e26('0x45')]=[{'all':!![]}];}_0x1d322a=_[_0x7e26('0x42')]({},_0x1d322a,_0x494fb1[_0x7e26('0x44')]);return db[_0x7e26('0x31')][_0x7e26('0x4c')](_0x1d322a)[_0x7e26('0x28')](handleEntityNotFound(_0x3fa47c,null))[_0x7e26('0x28')](respondWithResult(_0x3fa47c,null))['catch'](handleError(_0x3fa47c,null));};exports['create']=function(_0x522a33,_0x2c6d02){return db['ZohoConfiguration'][_0x7e26('0x4d')](_0x522a33['body'],{})[_0x7e26('0x28')](respondWithResult(_0x2c6d02,0xc9))['catch'](handleError(_0x2c6d02,null));};exports[_0x7e26('0x27')]=function(_0x2c7b94,_0x16e047){if(_0x2c7b94[_0x7e26('0x4e')]['id']){delete _0x2c7b94[_0x7e26('0x4e')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x2c7b94[_0x7e26('0x49')]['id']}})[_0x7e26('0x28')](handleEntityNotFound(_0x16e047,null))[_0x7e26('0x28')](saveUpdates(_0x2c7b94[_0x7e26('0x4e')],null))[_0x7e26('0x28')](respondWithResult(_0x16e047,null))[_0x7e26('0x4f')](handleError(_0x16e047,null));};exports[_0x7e26('0x29')]=function(_0x460658,_0xa37b91){return db['ZohoConfiguration'][_0x7e26('0x4c')]({'where':{'id':_0x460658[_0x7e26('0x49')]['id']}})[_0x7e26('0x28')](handleEntityNotFound(_0xa37b91,null))[_0x7e26('0x28')](removeEntity(_0xa37b91,null))[_0x7e26('0x4f')](handleError(_0xa37b91,null));};exports[_0x7e26('0x50')]=function(_0x4cea3c,_0x512359,_0x20dba9){var _0xfc519b={};var _0x450d34={};var _0x382a99;var _0x56660b;return db['ZohoConfiguration'][_0x7e26('0x51')]({'where':{'id':_0x4cea3c['params']['id']}})[_0x7e26('0x28')](handleEntityNotFound(_0x512359,null))[_0x7e26('0x28')](function(_0x27ea21){if(_0x27ea21){_0x382a99=_0x27ea21;_0x450d34[_0x7e26('0x34')]=_[_0x7e26('0x36')](db['ZohoField']['rawAttributes']);_0x450d34[_0x7e26('0x35')]=_[_0x7e26('0x36')](_0x4cea3c['query']);_0x450d34[_0x7e26('0x3f')]=_['intersection'](_0x450d34[_0x7e26('0x34')],_0x450d34[_0x7e26('0x35')]);_0xfc519b[_0x7e26('0x37')]=_['intersection'](_0x450d34['model'],qs[_0x7e26('0x39')](_0x4cea3c['query'][_0x7e26('0x39')]));_0xfc519b['attributes']=_0xfc519b[_0x7e26('0x37')]['length']?_0xfc519b['attributes']:_0x450d34[_0x7e26('0x34')];_0xfc519b[_0x7e26('0x3c')]=qs[_0x7e26('0x3d')](_0x4cea3c['query'][_0x7e26('0x3d')]);_0xfc519b[_0x7e26('0x3e')]=qs['filters'](_[_0x7e26('0x40')](_0x4cea3c[_0x7e26('0x35')],_0x450d34[_0x7e26('0x3f')]));if(_0x4cea3c[_0x7e26('0x35')][_0x7e26('0x41')]){_0xfc519b[_0x7e26('0x3e')]=_[_0x7e26('0x42')](_0xfc519b[_0x7e26('0x3e')],{'$or':_[_0x7e26('0x30')](_0xfc519b['attributes'],function(_0x1981cc){var _0x2fd748={};_0x2fd748[_0x1981cc]={'$like':'%'+_0x4cea3c[_0x7e26('0x35')][_0x7e26('0x41')]+'%'};return _0x2fd748;})});}_0xfc519b=_[_0x7e26('0x42')]({},_0xfc519b,_0x4cea3c[_0x7e26('0x44')]);return _0x382a99[_0x7e26('0x50')](_0xfc519b);}})['then'](function(_0x462201){if(_0x462201){_0x56660b=_0x462201[_0x7e26('0x3a')];if(!_0x4cea3c['query'][_0x7e26('0x3b')]('nolimit')){_0xfc519b[_0x7e26('0x20')]=qs[_0x7e26('0x20')](_0x4cea3c[_0x7e26('0x35')][_0x7e26('0x20')]);_0xfc519b['offset']=qs[_0x7e26('0x21')](_0x4cea3c['query']['offset']);}return _0x382a99[_0x7e26('0x50')](_0xfc519b);}})[_0x7e26('0x28')](function(_0x3b56dc){if(_0x3b56dc){return _0x3b56dc?{'count':_0x56660b,'rows':_0x3b56dc}:null;}})[_0x7e26('0x28')](respondWithResult(_0x512359,null))['catch'](handleError(_0x512359,null));};exports['getSubjects']=function(_0x3ba3b7,_0x4254ae,_0x40adf7){var _0x2f354c={};var _0x414c55={};var _0x3b333f;var _0x3e74b1;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x3ba3b7[_0x7e26('0x49')]['id']}})[_0x7e26('0x28')](handleEntityNotFound(_0x4254ae,null))[_0x7e26('0x28')](function(_0x153490){if(_0x153490){_0x3b333f=_0x153490;_0x414c55[_0x7e26('0x34')]=_['keys'](db[_0x7e26('0x52')]['rawAttributes']);_0x414c55[_0x7e26('0x35')]=_[_0x7e26('0x36')](_0x3ba3b7['query']);_0x414c55[_0x7e26('0x3f')]=_[_0x7e26('0x38')](_0x414c55[_0x7e26('0x34')],_0x414c55[_0x7e26('0x35')]);_0x2f354c[_0x7e26('0x37')]=_[_0x7e26('0x38')](_0x414c55[_0x7e26('0x34')],qs[_0x7e26('0x39')](_0x3ba3b7[_0x7e26('0x35')][_0x7e26('0x39')]));_0x2f354c['attributes']=_0x2f354c['attributes'][_0x7e26('0x3a')]?_0x2f354c['attributes']:_0x414c55['model'];_0x2f354c[_0x7e26('0x3c')]=qs[_0x7e26('0x3d')](_0x3ba3b7[_0x7e26('0x35')][_0x7e26('0x3d')]);_0x2f354c[_0x7e26('0x3e')]=qs[_0x7e26('0x3f')](_[_0x7e26('0x40')](_0x3ba3b7[_0x7e26('0x35')],_0x414c55[_0x7e26('0x3f')]));if(_0x3ba3b7['query'][_0x7e26('0x41')]){_0x2f354c['where']=_['merge'](_0x2f354c[_0x7e26('0x3e')],{'$or':_[_0x7e26('0x30')](_0x2f354c[_0x7e26('0x37')],function(_0x3ca0bc){var _0x71466d={};_0x71466d[_0x3ca0bc]={'$like':'%'+_0x3ba3b7[_0x7e26('0x35')]['filter']+'%'};return _0x71466d;})});}_0x2f354c=_['merge']({},_0x2f354c,_0x3ba3b7['options']);return _0x3b333f[_0x7e26('0x53')](_0x2f354c);}})[_0x7e26('0x28')](function(_0x4e6e6d){if(_0x4e6e6d){_0x3e74b1=_0x4e6e6d['length'];if(!_0x3ba3b7[_0x7e26('0x35')][_0x7e26('0x3b')](_0x7e26('0x54'))){_0x2f354c[_0x7e26('0x20')]=qs[_0x7e26('0x20')](_0x3ba3b7[_0x7e26('0x35')]['limit']);_0x2f354c[_0x7e26('0x21')]=qs['offset'](_0x3ba3b7[_0x7e26('0x35')]['offset']);}return _0x3b333f[_0x7e26('0x53')](_0x2f354c);}})['then'](function(_0x278e5b){if(_0x278e5b){return _0x278e5b?{'count':_0x3e74b1,'rows':_0x278e5b}:null;}})[_0x7e26('0x28')](respondWithResult(_0x4254ae,null))[_0x7e26('0x4f')](handleError(_0x4254ae,null));};exports['getDescriptions']=function(_0x330d4b,_0x19703e,_0x1a41d7){var _0xb3d906={};var _0x3f4dab={};var _0x2d1382;var _0x46e110;return db[_0x7e26('0x31')][_0x7e26('0x51')]({'where':{'id':_0x330d4b['params']['id']}})[_0x7e26('0x28')](handleEntityNotFound(_0x19703e,null))['then'](function(_0x4adb8c){if(_0x4adb8c){_0x2d1382=_0x4adb8c;_0x3f4dab[_0x7e26('0x34')]=_[_0x7e26('0x36')](db['ZohoField']['rawAttributes']);_0x3f4dab[_0x7e26('0x35')]=_[_0x7e26('0x36')](_0x330d4b['query']);_0x3f4dab[_0x7e26('0x3f')]=_[_0x7e26('0x38')](_0x3f4dab[_0x7e26('0x34')],_0x3f4dab[_0x7e26('0x35')]);_0xb3d906[_0x7e26('0x37')]=_[_0x7e26('0x38')](_0x3f4dab['model'],qs[_0x7e26('0x39')](_0x330d4b[_0x7e26('0x35')][_0x7e26('0x39')]));_0xb3d906[_0x7e26('0x37')]=_0xb3d906[_0x7e26('0x37')]['length']?_0xb3d906[_0x7e26('0x37')]:_0x3f4dab[_0x7e26('0x34')];_0xb3d906[_0x7e26('0x3c')]=qs[_0x7e26('0x3d')](_0x330d4b['query'][_0x7e26('0x3d')]);_0xb3d906[_0x7e26('0x3e')]=qs[_0x7e26('0x3f')](_['pick'](_0x330d4b[_0x7e26('0x35')],_0x3f4dab[_0x7e26('0x3f')]));if(_0x330d4b[_0x7e26('0x35')][_0x7e26('0x41')]){_0xb3d906['where']=_[_0x7e26('0x42')](_0xb3d906['where'],{'$or':_['map'](_0xb3d906[_0x7e26('0x37')],function(_0x23e8a8){var _0x52025b={};_0x52025b[_0x23e8a8]={'$like':'%'+_0x330d4b[_0x7e26('0x35')][_0x7e26('0x41')]+'%'};return _0x52025b;})});}_0xb3d906=_[_0x7e26('0x42')]({},_0xb3d906,_0x330d4b[_0x7e26('0x44')]);return _0x2d1382['getDescriptions'](_0xb3d906);}})['then'](function(_0x486ad2){if(_0x486ad2){_0x46e110=_0x486ad2['length'];if(!_0x330d4b['query'][_0x7e26('0x3b')]('nolimit')){_0xb3d906[_0x7e26('0x20')]=qs[_0x7e26('0x20')](_0x330d4b[_0x7e26('0x35')][_0x7e26('0x20')]);_0xb3d906[_0x7e26('0x21')]=qs[_0x7e26('0x21')](_0x330d4b[_0x7e26('0x35')]['offset']);}return _0x2d1382[_0x7e26('0x55')](_0xb3d906);}})[_0x7e26('0x28')](function(_0x55fb2d){if(_0x55fb2d){return _0x55fb2d?{'count':_0x46e110,'rows':_0x55fb2d}:null;}})[_0x7e26('0x28')](respondWithResult(_0x19703e,null))[_0x7e26('0x4f')](handleError(_0x19703e,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c041f04..20f2f7f 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 _0xdd4c=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','api','moment','request-promise'];(function(_0x399472,_0x5e6d6d){var _0x1ad9d1=function(_0x25b2fc){while(--_0x25b2fc){_0x399472['push'](_0x399472['shift']());}};_0x1ad9d1(++_0x5e6d6d);}(_0xdd4c,0x1db));var _0xcdd4=function(_0x322dcf,_0x2c5e95){_0x322dcf=_0x322dcf-0x0;var _0x31859f=_0xdd4c[_0x322dcf];return _0x31859f;};'use strict';var _=require(_0xcdd4('0x0'));var util=require(_0xcdd4('0x1'));var logger=require('../../config/logger')(_0xcdd4('0x2'));var moment=require(_0xcdd4('0x3'));var BPromise=require('bluebird');var rp=require(_0xcdd4('0x4'));var fs=require('fs');var path=require(_0xcdd4('0x5'));var rimraf=require(_0xcdd4('0x6'));var config=require(_0xcdd4('0x7'));var attributes=require(_0xcdd4('0x8'));module[_0xcdd4('0x9')]=function(_0x330ee6,_0x19d83c){return _0x330ee6[_0xcdd4('0xa')](_0xcdd4('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e56=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','moment','bluebird'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x0e56,0x1d5));var _0x60e5=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x0e56[_0x35da42];return _0x370035;};'use strict';var _=require('lodash');var util=require(_0x60e5('0x0'));var logger=require(_0x60e5('0x1'))('api');var moment=require(_0x60e5('0x2'));var BPromise=require(_0x60e5('0x3'));var rp=require(_0x60e5('0x4'));var fs=require('fs');var path=require(_0x60e5('0x5'));var rimraf=require(_0x60e5('0x6'));var config=require(_0x60e5('0x7'));var attributes=require(_0x60e5('0x8'));module['exports']=function(_0x223be4,_0x4bce8e){return _0x223be4['define'](_0x60e5('0x9'),attributes,{'tableName':_0x60e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 1de8d6c..6cd8efb 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 _0x1f86=['info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x1f86,0x1ac));var _0x61f8=function(_0x421cc2,_0x143445){_0x421cc2=_0x421cc2-0x0;var _0x1df677=_0x1f86[_0x421cc2];return _0x1df677;};'use strict';var _=require(_0x61f8('0x0'));var util=require('util');var moment=require(_0x61f8('0x1'));var BPromise=require(_0x61f8('0x2'));var rs=require(_0x61f8('0x3'));var fs=require('fs');var Redis=require(_0x61f8('0x4'));var db=require(_0x61f8('0x5'))['db'];var utils=require(_0x61f8('0x6'));var logger=require(_0x61f8('0x7'))(_0x61f8('0x8'));var config=require(_0x61f8('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31e6a4,_0x3eb0b7,_0x4261db){return new BPromise(function(_0xe3219d,_0x4d67a5){return client[_0x61f8('0xa')](_0x31e6a4,_0x4261db)[_0x61f8('0xb')](function(_0x1a914e){logger[_0x61f8('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3eb0b7,'request\x20sent');logger[_0x61f8('0xd')](_0x61f8('0xe'),_0x3eb0b7,'request\x20sent',JSON[_0x61f8('0xf')](_0x1a914e));if(_0x1a914e[_0x61f8('0x10')]){if(_0x1a914e[_0x61f8('0x10')][_0x61f8('0x11')]===0x1f4){logger[_0x61f8('0x10')](_0x61f8('0x12'),_0x3eb0b7,_0x1a914e[_0x61f8('0x10')][_0x61f8('0x13')]);return _0x4d67a5(_0x1a914e[_0x61f8('0x10')]['message']);}logger[_0x61f8('0x10')](_0x61f8('0x12'),_0x3eb0b7,_0x1a914e[_0x61f8('0x10')][_0x61f8('0x13')]);return _0xe3219d(_0x1a914e[_0x61f8('0x10')][_0x61f8('0x13')]);}else{logger[_0x61f8('0xc')](_0x61f8('0x12'),_0x3eb0b7,'request\x20sent');_0xe3219d(_0x1a914e[_0x61f8('0x14')][_0x61f8('0x13')]);}})[_0x61f8('0x15')](function(_0x121021){logger['error'](_0x61f8('0x12'),_0x3eb0b7,_0x121021);_0x4d67a5(_0x121021);});});} \ No newline at end of file +var _0x8977=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x2286d3,_0x40bb85){var _0x39d1a8=function(_0x185a32){while(--_0x185a32){_0x2286d3['push'](_0x2286d3['shift']());}};_0x39d1a8(++_0x40bb85);}(_0x8977,0xd7));var _0x7897=function(_0x2324c3,_0x127d7a){_0x2324c3=_0x2324c3-0x0;var _0x48fb23=_0x8977[_0x2324c3];return _0x48fb23;};'use strict';var _=require(_0x7897('0x0'));var util=require(_0x7897('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7897('0x2'));var fs=require('fs');var Redis=require(_0x7897('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7897('0x4'));var logger=require(_0x7897('0x5'))(_0x7897('0x6'));var config=require(_0x7897('0x7'));var jayson=require(_0x7897('0x8'));var client=jayson['client'][_0x7897('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a7307,_0x3803ed,_0x569071){return new BPromise(function(_0x5abb71,_0x463765){return client[_0x7897('0xa')](_0x4a7307,_0x569071)[_0x7897('0xb')](function(_0x366d6c){logger[_0x7897('0xc')](_0x7897('0xd'),_0x3803ed,'request\x20sent');logger[_0x7897('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3803ed,_0x7897('0xf'),JSON['stringify'](_0x366d6c));if(_0x366d6c['error']){if(_0x366d6c['error']['code']===0x1f4){logger[_0x7897('0x10')](_0x7897('0xd'),_0x3803ed,_0x366d6c['error'][_0x7897('0x11')]);return _0x463765(_0x366d6c[_0x7897('0x10')][_0x7897('0x11')]);}logger[_0x7897('0x10')](_0x7897('0xd'),_0x3803ed,_0x366d6c['error'][_0x7897('0x11')]);return _0x5abb71(_0x366d6c['error'][_0x7897('0x11')]);}else{logger['info'](_0x7897('0xd'),_0x3803ed,'request\x20sent');_0x5abb71(_0x366d6c[_0x7897('0x12')][_0x7897('0x11')]);}})[_0x7897('0x13')](function(_0x2afdc1){logger[_0x7897('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3803ed,_0x2afdc1);_0x463765(_0x2afdc1);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index abd4983..4f131d5 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 _0x8f1d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','show','post','isAuthenticated','create','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x46ac5a,_0x17baa5){var _0xad0d0b=function(_0x313977){while(--_0x313977){_0x46ac5a['push'](_0x46ac5a['shift']());}};_0xad0d0b(++_0x17baa5);}(_0x8f1d,0x1c7));var _0xd8f1=function(_0x22c50e,_0x4ea131){_0x22c50e=_0x22c50e-0x0;var _0x500f85=_0x8f1d[_0x22c50e];return _0x500f85;};'use strict';var multer=require(_0xd8f1('0x0'));var util=require(_0xd8f1('0x1'));var path=require(_0xd8f1('0x2'));var timeout=require(_0xd8f1('0x3'));var express=require(_0xd8f1('0x4'));var router=express[_0xd8f1('0x5')]();var fs_extra=require(_0xd8f1('0x6'));var auth=require(_0xd8f1('0x7'));var interaction=require(_0xd8f1('0x8'));var config=require(_0xd8f1('0x9'));var controller=require(_0xd8f1('0xa'));router[_0xd8f1('0xb')]('/',auth['isAuthenticated'](),controller[_0xd8f1('0xc')]);router[_0xd8f1('0xb')](_0xd8f1('0xd'),auth['isAuthenticated'](),controller[_0xd8f1('0xe')]);router[_0xd8f1('0xf')]('/',auth[_0xd8f1('0x10')](),controller[_0xd8f1('0x11')]);router['put'](_0xd8f1('0xd'),auth[_0xd8f1('0x10')](),controller[_0xd8f1('0x12')]);router['delete'](_0xd8f1('0xd'),auth[_0xd8f1('0x10')](),controller[_0xd8f1('0x13')]);module['exports']=router; \ No newline at end of file +var _0xdca9=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x592a2c,_0x514b28){var _0x204e27=function(_0x4e4700){while(--_0x4e4700){_0x592a2c['push'](_0x592a2c['shift']());}};_0x204e27(++_0x514b28);}(_0xdca9,0x106));var _0x9dca=function(_0xfb8850,_0xed9164){_0xfb8850=_0xfb8850-0x0;var _0x8cebaf=_0xdca9[_0xfb8850];return _0x8cebaf;};'use strict';var multer=require('multer');var util=require(_0x9dca('0x0'));var path=require('path');var timeout=require(_0x9dca('0x1'));var express=require(_0x9dca('0x2'));var router=express[_0x9dca('0x3')]();var fs_extra=require(_0x9dca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9dca('0x5'));var config=require(_0x9dca('0x6'));var controller=require(_0x9dca('0x7'));router['get']('/',auth[_0x9dca('0x8')](),controller[_0x9dca('0x9')]);router[_0x9dca('0xa')](_0x9dca('0xb'),auth[_0x9dca('0x8')](),controller[_0x9dca('0xc')]);router[_0x9dca('0xd')]('/',auth['isAuthenticated'](),controller[_0x9dca('0xe')]);router[_0x9dca('0xf')](_0x9dca('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9dca('0xb'),auth['isAuthenticated'](),controller[_0x9dca('0x10')]);module[_0x9dca('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index ac7f082..8d0bf80 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 _0xa5e9=['string','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x368532,_0x13139c){var _0x2b111e=function(_0x4113e6){while(--_0x4113e6){_0x368532['push'](_0x368532['shift']());}};_0x2b111e(++_0x13139c);}(_0xa5e9,0xcb));var _0x9a5e=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xa5e9[_0x2dbce7];return _0x3a3ed0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x9a5e('0x0'),'variable',_0x9a5e('0x1'),_0x9a5e('0x2'),_0x9a5e('0x3')),'defaultValue':_0x9a5e('0x0')},'content':{'type':Sequelize[_0x9a5e('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9a5e('0x5')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x9a5e('0x4')]},'idField':{'type':Sequelize[_0x9a5e('0x4')]},'nameField':{'type':Sequelize[_0x9a5e('0x4')]},'customField':{'type':Sequelize[_0x9a5e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a5e('0x4')]}}; \ No newline at end of file +var _0xc428=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x10d3cd,_0x143097){var _0x2dc016=function(_0x299cd9){while(--_0x299cd9){_0x10d3cd['push'](_0x10d3cd['shift']());}};_0x2dc016(++_0x143097);}(_0xc428,0x158));var _0x8c42=function(_0x5d5922,_0x144cfa){_0x5d5922=_0x5d5922-0x0;var _0x2bd17c=_0xc428[_0x5d5922];return _0x2bd17c;};'use strict';var Sequelize=require(_0x8c42('0x0'));module[_0x8c42('0x1')]={'type':{'type':Sequelize[_0x8c42('0x2')](_0x8c42('0x3'),_0x8c42('0x4'),_0x8c42('0x5'),_0x8c42('0x6'),_0x8c42('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8c42('0x2')]('string',_0x8c42('0x4'),_0x8c42('0x5'))},'keyContent':{'type':Sequelize[_0x8c42('0x8')]},'idField':{'type':Sequelize[_0x8c42('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8c42('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c42('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index a3d1290..757332c 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 _0xbba6=['type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZohoField'];(function(_0x5c9865,_0x1a299a){var _0x54c22b=function(_0x538537){while(--_0x538537){_0x5c9865['push'](_0x5c9865['shift']());}};_0x54c22b(++_0x1a299a);}(_0xbba6,0x1a4));var _0x6bba=function(_0x38a411,_0x177138){_0x38a411=_0x38a411-0x0;var _0x540a44=_0xbba6[_0x38a411];return _0x540a44;};'use strict';var emlformat=require(_0x6bba('0x0'));var rimraf=require(_0x6bba('0x1'));var zipdir=require(_0x6bba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bba('0x3'));var moment=require(_0x6bba('0x4'));var BPromise=require(_0x6bba('0x5'));var Mustache=require(_0x6bba('0x6'));var util=require(_0x6bba('0x7'));var path=require(_0x6bba('0x8'));var sox=require(_0x6bba('0x9'));var csv=require(_0x6bba('0xa'));var ejs=require(_0x6bba('0xb'));var fs=require('fs');var fs_extra=require(_0x6bba('0xc'));var _=require(_0x6bba('0xd'));var squel=require('squel');var crypto=require(_0x6bba('0xe'));var jsforce=require(_0x6bba('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6bba('0xa'));var querystring=require(_0x6bba('0x10'));var Papa=require(_0x6bba('0x11'));var Redis=require(_0x6bba('0x12'));var authService=require(_0x6bba('0x13'));var qs=require(_0x6bba('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bba('0x15'))(_0x6bba('0x16'));var utils=require(_0x6bba('0x17'));var config=require(_0x6bba('0x18'));var licenseUtil=require(_0x6bba('0x19'));var db=require(_0x6bba('0x1a'))['db'];function respondWithStatusCode(_0x41be6b,_0x41806a){_0x41806a=_0x41806a||0xcc;return function(_0x49adfe){if(_0x49adfe){return _0x41be6b[_0x6bba('0x1b')](_0x41806a);}return _0x41be6b[_0x6bba('0x1c')](_0x41806a)[_0x6bba('0x1d')]();};}function respondWithResult(_0x2352f1,_0x3fd65e){_0x3fd65e=_0x3fd65e||0xc8;return function(_0x1bf885){if(_0x1bf885){return _0x2352f1[_0x6bba('0x1c')](_0x3fd65e)[_0x6bba('0x1e')](_0x1bf885);}};}function respondWithFilteredResult(_0x4902c7,_0x2af295){return function(_0x22cae5){if(_0x22cae5){var _0x3f0a54=typeof _0x2af295[_0x6bba('0x1f')]===_0x6bba('0x20')&&typeof _0x2af295[_0x6bba('0x21')]===_0x6bba('0x20');var _0x97731c=_0x22cae5[_0x6bba('0x22')];var _0x1f5d57=_0x3f0a54?0x0:_0x2af295[_0x6bba('0x1f')];var _0x5c5796=_0x3f0a54?_0x22cae5[_0x6bba('0x22')]:_0x2af295['offset']+_0x2af295[_0x6bba('0x21')];var _0x3d0cdd;if(_0x5c5796>=_0x97731c){_0x5c5796=_0x97731c;_0x3d0cdd=0xc8;}else{_0x3d0cdd=0xce;}_0x4902c7[_0x6bba('0x1c')](_0x3d0cdd);return _0x4902c7['set'](_0x6bba('0x23'),_0x1f5d57+'-'+_0x5c5796+'/'+_0x97731c)[_0x6bba('0x1e')](_0x22cae5);}return null;};}function patchUpdates(_0x2f6f32){return function(_0x52635b){try{jsonpatch[_0x6bba('0x24')](_0x52635b,_0x2f6f32,!![]);}catch(_0x481c01){return BPromise[_0x6bba('0x25')](_0x481c01);}return _0x52635b['save']();};}function saveUpdates(_0x541d5d,_0x2a7a62){return function(_0x2f4e2a){if(_0x2f4e2a){return _0x2f4e2a[_0x6bba('0x26')](_0x541d5d)[_0x6bba('0x27')](function(_0x257561){return _0x257561;});}return null;};}function removeEntity(_0x216551,_0x27fcef){return function(_0x1d648b){if(_0x1d648b){return _0x1d648b[_0x6bba('0x28')]()[_0x6bba('0x27')](function(){_0x216551[_0x6bba('0x1c')](0xcc)[_0x6bba('0x1d')]();});}};}function handleEntityNotFound(_0x529a4e,_0x352b7f){return function(_0x47264c){if(!_0x47264c){_0x529a4e[_0x6bba('0x1b')](0x194);}return _0x47264c;};}function handleError(_0x9aa4fc,_0x558ac1){_0x558ac1=_0x558ac1||0x1f4;return function(_0x1a7acc){logger[_0x6bba('0x29')](_0x1a7acc[_0x6bba('0x2a')]);if(_0x1a7acc[_0x6bba('0x2b')]){delete _0x1a7acc['name'];}_0x9aa4fc[_0x6bba('0x1c')](_0x558ac1)[_0x6bba('0x2c')](_0x1a7acc);};}exports[_0x6bba('0x2d')]=function(_0x291912,_0x59c0b9){var _0x2e0a74={},_0x316796={},_0x30c090={'count':0x0,'rows':[]};var _0x44308e=_[_0x6bba('0x2e')](db[_0x6bba('0x2f')]['rawAttributes'],function(_0x41a9d4){return{'name':_0x41a9d4['fieldName'],'type':_0x41a9d4[_0x6bba('0x30')][_0x6bba('0x31')]};});_0x316796['model']=_[_0x6bba('0x2e')](_0x44308e,_0x6bba('0x2b'));_0x316796[_0x6bba('0x32')]=_[_0x6bba('0x33')](_0x291912['query']);_0x316796[_0x6bba('0x34')]=_[_0x6bba('0x35')](_0x316796['model'],_0x316796[_0x6bba('0x32')]);_0x2e0a74[_0x6bba('0x36')]=_['intersection'](_0x316796[_0x6bba('0x37')],qs[_0x6bba('0x38')](_0x291912[_0x6bba('0x32')][_0x6bba('0x38')]));_0x2e0a74[_0x6bba('0x36')]=_0x2e0a74[_0x6bba('0x36')][_0x6bba('0x39')]?_0x2e0a74['attributes']:_0x316796[_0x6bba('0x37')];if(!_0x291912[_0x6bba('0x32')][_0x6bba('0x3a')](_0x6bba('0x3b'))){_0x2e0a74[_0x6bba('0x21')]=qs[_0x6bba('0x21')](_0x291912[_0x6bba('0x32')]['limit']);_0x2e0a74[_0x6bba('0x1f')]=qs['offset'](_0x291912[_0x6bba('0x32')][_0x6bba('0x1f')]);}_0x2e0a74[_0x6bba('0x3c')]=qs[_0x6bba('0x3d')](_0x291912[_0x6bba('0x32')][_0x6bba('0x3d')]);_0x2e0a74[_0x6bba('0x3e')]=qs['filters'](_[_0x6bba('0x3f')](_0x291912[_0x6bba('0x32')],_0x316796[_0x6bba('0x34')]),_0x44308e);if(_0x291912[_0x6bba('0x32')][_0x6bba('0x40')]){_0x2e0a74[_0x6bba('0x3e')]=_[_0x6bba('0x41')](_0x2e0a74[_0x6bba('0x3e')],{'$or':_['map'](_0x44308e,function(_0x103562){if(_0x103562[_0x6bba('0x30')]!=='VIRTUAL'){var _0x19b025={};_0x19b025[_0x103562[_0x6bba('0x2b')]]={'$like':'%'+_0x291912['query'][_0x6bba('0x40')]+'%'};return _0x19b025;}})});}_0x2e0a74=_[_0x6bba('0x41')]({},_0x2e0a74,_0x291912[_0x6bba('0x42')]);var _0x4f08de={'where':_0x2e0a74[_0x6bba('0x3e')]};return db[_0x6bba('0x2f')][_0x6bba('0x22')](_0x4f08de)[_0x6bba('0x27')](function(_0x3da4fb){_0x30c090[_0x6bba('0x22')]=_0x3da4fb;if(_0x291912[_0x6bba('0x32')][_0x6bba('0x43')]){_0x2e0a74[_0x6bba('0x44')]=[{'all':!![]}];}return db[_0x6bba('0x2f')][_0x6bba('0x45')](_0x2e0a74);})[_0x6bba('0x27')](function(_0x3b4d97){_0x30c090[_0x6bba('0x46')]=_0x3b4d97;return _0x30c090;})['then'](respondWithFilteredResult(_0x59c0b9,_0x2e0a74))[_0x6bba('0x47')](handleError(_0x59c0b9,null));};exports[_0x6bba('0x48')]=function(_0x28881b,_0x27b2b7){var _0x1fec82={'raw':!![],'where':{'id':_0x28881b[_0x6bba('0x49')]['id']}},_0x1d2424={};_0x1d2424[_0x6bba('0x37')]=_[_0x6bba('0x33')](db[_0x6bba('0x2f')][_0x6bba('0x4a')]);_0x1d2424[_0x6bba('0x32')]=_[_0x6bba('0x33')](_0x28881b[_0x6bba('0x32')]);_0x1d2424[_0x6bba('0x34')]=_[_0x6bba('0x35')](_0x1d2424[_0x6bba('0x37')],_0x1d2424['query']);_0x1fec82['attributes']=_[_0x6bba('0x35')](_0x1d2424[_0x6bba('0x37')],qs[_0x6bba('0x38')](_0x28881b['query'][_0x6bba('0x38')]));_0x1fec82['attributes']=_0x1fec82[_0x6bba('0x36')][_0x6bba('0x39')]?_0x1fec82['attributes']:_0x1d2424[_0x6bba('0x37')];if(_0x28881b[_0x6bba('0x32')][_0x6bba('0x43')]){_0x1fec82[_0x6bba('0x44')]=[{'all':!![]}];}_0x1fec82=_[_0x6bba('0x41')]({},_0x1fec82,_0x28881b[_0x6bba('0x42')]);return db['ZohoField']['find'](_0x1fec82)[_0x6bba('0x27')](handleEntityNotFound(_0x27b2b7,null))[_0x6bba('0x27')](respondWithResult(_0x27b2b7,null))[_0x6bba('0x47')](handleError(_0x27b2b7,null));};exports[_0x6bba('0x4b')]=function(_0x321b70,_0x491791){return db[_0x6bba('0x2f')][_0x6bba('0x4b')](_0x321b70[_0x6bba('0x4c')],{})['then'](respondWithResult(_0x491791,0xc9))[_0x6bba('0x47')](handleError(_0x491791,null));};exports[_0x6bba('0x26')]=function(_0x295ad1,_0xf3ffe2){if(_0x295ad1[_0x6bba('0x4c')]['id']){delete _0x295ad1[_0x6bba('0x4c')]['id'];}return db[_0x6bba('0x2f')][_0x6bba('0x4d')]({'where':{'id':_0x295ad1['params']['id']}})['then'](handleEntityNotFound(_0xf3ffe2,null))[_0x6bba('0x27')](saveUpdates(_0x295ad1[_0x6bba('0x4c')],null))['then'](respondWithResult(_0xf3ffe2,null))['catch'](handleError(_0xf3ffe2,null));};exports[_0x6bba('0x28')]=function(_0xa21dc,_0x25bfa2){return db['ZohoField']['find']({'where':{'id':_0xa21dc[_0x6bba('0x49')]['id']}})[_0x6bba('0x27')](handleEntityNotFound(_0x25bfa2,null))[_0x6bba('0x27')](removeEntity(_0x25bfa2,null))[_0x6bba('0x47')](handleError(_0x25bfa2,null));}; \ No newline at end of file +var _0x7225=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','index','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rawAttributes','find','catch','create','body','params','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x57f1f3,_0x4a8ea3){var _0x1eb665=function(_0x2e9bba){while(--_0x2e9bba){_0x57f1f3['push'](_0x57f1f3['shift']());}};_0x1eb665(++_0x4a8ea3);}(_0x7225,0x109));var _0x5722=function(_0x20d84b,_0x4346fe){_0x20d84b=_0x20d84b-0x0;var _0x162f8d=_0x7225[_0x20d84b];return _0x162f8d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5722('0x0'));var zipdir=require(_0x5722('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5722('0x2'));var Mustache=require(_0x5722('0x3'));var util=require(_0x5722('0x4'));var path=require(_0x5722('0x5'));var sox=require(_0x5722('0x6'));var csv=require(_0x5722('0x7'));var ejs=require(_0x5722('0x8'));var fs=require('fs');var fs_extra=require(_0x5722('0x9'));var _=require(_0x5722('0xa'));var squel=require(_0x5722('0xb'));var crypto=require(_0x5722('0xc'));var jsforce=require(_0x5722('0xd'));var deskjs=require(_0x5722('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5722('0xf'));var Papa=require('papaparse');var Redis=require(_0x5722('0x10'));var authService=require(_0x5722('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5722('0x12'));var logger=require('../../config/logger')(_0x5722('0x13'));var utils=require(_0x5722('0x14'));var config=require(_0x5722('0x15'));var licenseUtil=require(_0x5722('0x16'));var db=require(_0x5722('0x17'))['db'];function respondWithStatusCode(_0x1b344a,_0x2a33aa){_0x2a33aa=_0x2a33aa||0xcc;return function(_0x122034){if(_0x122034){return _0x1b344a[_0x5722('0x18')](_0x2a33aa);}return _0x1b344a[_0x5722('0x19')](_0x2a33aa)['end']();};}function respondWithResult(_0x4337a9,_0x434cb5){_0x434cb5=_0x434cb5||0xc8;return function(_0x58c948){if(_0x58c948){return _0x4337a9[_0x5722('0x19')](_0x434cb5)[_0x5722('0x1a')](_0x58c948);}};}function respondWithFilteredResult(_0x25ac6c,_0x50166c){return function(_0x3e8559){if(_0x3e8559){var _0x4fb3bf=typeof _0x50166c[_0x5722('0x1b')]===_0x5722('0x1c')&&typeof _0x50166c[_0x5722('0x1d')]===_0x5722('0x1c');var _0x111732=_0x3e8559[_0x5722('0x1e')];var _0x259840=_0x4fb3bf?0x0:_0x50166c[_0x5722('0x1b')];var _0x1c350d=_0x4fb3bf?_0x3e8559[_0x5722('0x1e')]:_0x50166c[_0x5722('0x1b')]+_0x50166c['limit'];var _0x20493f;if(_0x1c350d>=_0x111732){_0x1c350d=_0x111732;_0x20493f=0xc8;}else{_0x20493f=0xce;}_0x25ac6c['status'](_0x20493f);return _0x25ac6c[_0x5722('0x1f')](_0x5722('0x20'),_0x259840+'-'+_0x1c350d+'/'+_0x111732)['json'](_0x3e8559);}return null;};}function patchUpdates(_0x17999){return function(_0x15f1ea){try{jsonpatch['apply'](_0x15f1ea,_0x17999,!![]);}catch(_0x2e8966){return BPromise[_0x5722('0x21')](_0x2e8966);}return _0x15f1ea[_0x5722('0x22')]();};}function saveUpdates(_0x3abf21,_0x504cca){return function(_0xf0f1d5){if(_0xf0f1d5){return _0xf0f1d5[_0x5722('0x23')](_0x3abf21)[_0x5722('0x24')](function(_0x394435){return _0x394435;});}return null;};}function removeEntity(_0x4b74a7,_0x43df63){return function(_0xf41114){if(_0xf41114){return _0xf41114[_0x5722('0x25')]()[_0x5722('0x24')](function(){_0x4b74a7['status'](0xcc)[_0x5722('0x26')]();});}};}function handleEntityNotFound(_0x1e34b9,_0x38292c){return function(_0x455e79){if(!_0x455e79){_0x1e34b9[_0x5722('0x18')](0x194);}return _0x455e79;};}function handleError(_0x4952c6,_0x4d5593){_0x4d5593=_0x4d5593||0x1f4;return function(_0x347a2d){logger[_0x5722('0x27')](_0x347a2d['stack']);if(_0x347a2d[_0x5722('0x28')]){delete _0x347a2d[_0x5722('0x28')];}_0x4952c6['status'](_0x4d5593)['send'](_0x347a2d);};}exports[_0x5722('0x29')]=function(_0x22d788,_0x312825){var _0x5bf7cf={},_0x59526a={},_0xf63243={'count':0x0,'rows':[]};var _0x199985=_[_0x5722('0x2a')](db[_0x5722('0x2b')]['rawAttributes'],function(_0x205fd9){return{'name':_0x205fd9[_0x5722('0x2c')],'type':_0x205fd9[_0x5722('0x2d')]['key']};});_0x59526a[_0x5722('0x2e')]=_[_0x5722('0x2a')](_0x199985,_0x5722('0x28'));_0x59526a[_0x5722('0x2f')]=_[_0x5722('0x30')](_0x22d788[_0x5722('0x2f')]);_0x59526a[_0x5722('0x31')]=_[_0x5722('0x32')](_0x59526a[_0x5722('0x2e')],_0x59526a['query']);_0x5bf7cf[_0x5722('0x33')]=_[_0x5722('0x32')](_0x59526a[_0x5722('0x2e')],qs[_0x5722('0x34')](_0x22d788['query'][_0x5722('0x34')]));_0x5bf7cf[_0x5722('0x33')]=_0x5bf7cf[_0x5722('0x33')][_0x5722('0x35')]?_0x5bf7cf[_0x5722('0x33')]:_0x59526a[_0x5722('0x2e')];if(!_0x22d788['query']['hasOwnProperty']('nolimit')){_0x5bf7cf[_0x5722('0x1d')]=qs[_0x5722('0x1d')](_0x22d788['query'][_0x5722('0x1d')]);_0x5bf7cf['offset']=qs[_0x5722('0x1b')](_0x22d788[_0x5722('0x2f')][_0x5722('0x1b')]);}_0x5bf7cf[_0x5722('0x36')]=qs[_0x5722('0x37')](_0x22d788['query'][_0x5722('0x37')]);_0x5bf7cf['where']=qs['filters'](_[_0x5722('0x38')](_0x22d788[_0x5722('0x2f')],_0x59526a[_0x5722('0x31')]),_0x199985);if(_0x22d788[_0x5722('0x2f')][_0x5722('0x39')]){_0x5bf7cf[_0x5722('0x3a')]=_[_0x5722('0x3b')](_0x5bf7cf[_0x5722('0x3a')],{'$or':_[_0x5722('0x2a')](_0x199985,function(_0x37214d){if(_0x37214d[_0x5722('0x2d')]!==_0x5722('0x3c')){var _0x15c256={};_0x15c256[_0x37214d[_0x5722('0x28')]]={'$like':'%'+_0x22d788[_0x5722('0x2f')][_0x5722('0x39')]+'%'};return _0x15c256;}})});}_0x5bf7cf=_[_0x5722('0x3b')]({},_0x5bf7cf,_0x22d788[_0x5722('0x3d')]);var _0x40d90f={'where':_0x5bf7cf['where']};return db[_0x5722('0x2b')]['count'](_0x40d90f)[_0x5722('0x24')](function(_0x76f45a){_0xf63243[_0x5722('0x1e')]=_0x76f45a;if(_0x22d788[_0x5722('0x2f')][_0x5722('0x3e')]){_0x5bf7cf[_0x5722('0x3f')]=[{'all':!![]}];}return db[_0x5722('0x2b')][_0x5722('0x40')](_0x5bf7cf);})['then'](function(_0x3e1817){_0xf63243['rows']=_0x3e1817;return _0xf63243;})[_0x5722('0x24')](respondWithFilteredResult(_0x312825,_0x5bf7cf))['catch'](handleError(_0x312825,null));};exports['show']=function(_0x8a4612,_0x335622){var _0x5bca44={'raw':!![],'where':{'id':_0x8a4612['params']['id']}},_0x7930ae={};_0x7930ae[_0x5722('0x2e')]=_[_0x5722('0x30')](db[_0x5722('0x2b')][_0x5722('0x41')]);_0x7930ae[_0x5722('0x2f')]=_[_0x5722('0x30')](_0x8a4612[_0x5722('0x2f')]);_0x7930ae['filters']=_[_0x5722('0x32')](_0x7930ae['model'],_0x7930ae[_0x5722('0x2f')]);_0x5bca44[_0x5722('0x33')]=_[_0x5722('0x32')](_0x7930ae[_0x5722('0x2e')],qs[_0x5722('0x34')](_0x8a4612[_0x5722('0x2f')]['fields']));_0x5bca44[_0x5722('0x33')]=_0x5bca44[_0x5722('0x33')]['length']?_0x5bca44['attributes']:_0x7930ae[_0x5722('0x2e')];if(_0x8a4612['query'][_0x5722('0x3e')]){_0x5bca44[_0x5722('0x3f')]=[{'all':!![]}];}_0x5bca44=_['merge']({},_0x5bca44,_0x8a4612['options']);return db[_0x5722('0x2b')][_0x5722('0x42')](_0x5bca44)[_0x5722('0x24')](handleEntityNotFound(_0x335622,null))[_0x5722('0x24')](respondWithResult(_0x335622,null))[_0x5722('0x43')](handleError(_0x335622,null));};exports[_0x5722('0x44')]=function(_0x2ae756,_0x5ecbd9){return db['ZohoField'][_0x5722('0x44')](_0x2ae756[_0x5722('0x45')],{})[_0x5722('0x24')](respondWithResult(_0x5ecbd9,0xc9))['catch'](handleError(_0x5ecbd9,null));};exports[_0x5722('0x23')]=function(_0x35323d,_0x464f28){if(_0x35323d[_0x5722('0x45')]['id']){delete _0x35323d[_0x5722('0x45')]['id'];}return db[_0x5722('0x2b')][_0x5722('0x42')]({'where':{'id':_0x35323d[_0x5722('0x46')]['id']}})['then'](handleEntityNotFound(_0x464f28,null))['then'](saveUpdates(_0x35323d['body'],null))[_0x5722('0x24')](respondWithResult(_0x464f28,null))[_0x5722('0x43')](handleError(_0x464f28,null));};exports[_0x5722('0x25')]=function(_0x1c4382,_0x260303){return db['ZohoField'][_0x5722('0x42')]({'where':{'id':_0x1c4382[_0x5722('0x46')]['id']}})[_0x5722('0x24')](handleEntityNotFound(_0x260303,null))['then'](removeEntity(_0x260303,null))['catch'](handleError(_0x260303,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 7798805..7592f1a 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 _0x71ab=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','bluebird','request-promise','path'];(function(_0x27e2c8,_0x5f40a0){var _0x5454d4=function(_0x2cbef9){while(--_0x2cbef9){_0x27e2c8['push'](_0x27e2c8['shift']());}};_0x5454d4(++_0x5f40a0);}(_0x71ab,0x64));var _0xb71a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x71ab[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xd'),_0xb71a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger'];(function(_0x3508a7,_0x63e84d){var _0x23812c=function(_0x4d384a){while(--_0x4d384a){_0x3508a7['push'](_0x3508a7['shift']());}};_0x23812c(++_0x63e84d);}(_0xe3da,0x1cd));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xf'),'FieldId'],'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 bf6ad41..c325b54 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 _0x662d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0x662d,0x19e));var _0xd662=function(_0x7f9a4c,_0x24f326){_0x7f9a4c=_0x7f9a4c-0x0;var _0x9dca04=_0x662d[_0x7f9a4c];return _0x9dca04;};'use strict';var _=require('lodash');var util=require(_0xd662('0x0'));var moment=require(_0xd662('0x1'));var BPromise=require(_0xd662('0x2'));var rs=require(_0xd662('0x3'));var fs=require('fs');var Redis=require(_0xd662('0x4'));var db=require(_0xd662('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd662('0x6'))('rpc');var config=require(_0xd662('0x7'));var jayson=require(_0xd662('0x8'));var client=jayson[_0xd662('0x9')][_0xd662('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44d532,_0x4969ec,_0x3f181a){return new BPromise(function(_0x4fb4e5,_0x494866){return client[_0xd662('0xb')](_0x44d532,_0x3f181a)[_0xd662('0xc')](function(_0x60c53c){logger[_0xd662('0xd')](_0xd662('0xe'),_0x4969ec,_0xd662('0xf'));logger[_0xd662('0x10')](_0xd662('0x11'),_0x4969ec,_0xd662('0xf'),JSON[_0xd662('0x12')](_0x60c53c));if(_0x60c53c[_0xd662('0x13')]){if(_0x60c53c[_0xd662('0x13')]['code']===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x4969ec,_0x60c53c[_0xd662('0x13')][_0xd662('0x14')]);return _0x494866(_0x60c53c[_0xd662('0x13')][_0xd662('0x14')]);}logger[_0xd662('0x13')](_0xd662('0xe'),_0x4969ec,_0x60c53c[_0xd662('0x13')]['message']);return _0x4fb4e5(_0x60c53c[_0xd662('0x13')]['message']);}else{logger[_0xd662('0xd')](_0xd662('0xe'),_0x4969ec,_0xd662('0xf'));_0x4fb4e5(_0x60c53c[_0xd662('0x15')][_0xd662('0x14')]);}})[_0xd662('0x16')](function(_0x451872){logger[_0xd662('0x13')]('ZohoField,\x20%s,\x20%s',_0x4969ec,_0x451872);_0x494866(_0x451872);});});} \ No newline at end of file +var _0x664e=['../../config/environment','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xffb167,_0x4ae56e){var _0x3d5fd3=function(_0x595404){while(--_0x595404){_0xffb167['push'](_0xffb167['shift']());}};_0x3d5fd3(++_0x4ae56e);}(_0x664e,0x1f2));var _0xe664=function(_0x38995a,_0x3565b2){_0x38995a=_0x38995a-0x0;var _0x5da3d2=_0x664e[_0x38995a];return _0x5da3d2;};'use strict';var _=require(_0xe664('0x0'));var util=require(_0xe664('0x1'));var moment=require(_0xe664('0x2'));var BPromise=require(_0xe664('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe664('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe664('0x5'));var logger=require(_0xe664('0x6'))(_0xe664('0x7'));var config=require(_0xe664('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe664('0x9')][_0xe664('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x405484,_0x282e46,_0x2d9d07){return new BPromise(function(_0x34ee2e,_0x2b6bc7){return client['request'](_0x405484,_0x2d9d07)[_0xe664('0xb')](function(_0x577723){logger[_0xe664('0xc')](_0xe664('0xd'),_0x282e46,_0xe664('0xe'));logger[_0xe664('0xf')](_0xe664('0x10'),_0x282e46,_0xe664('0xe'),JSON[_0xe664('0x11')](_0x577723));if(_0x577723[_0xe664('0x12')]){if(_0x577723['error'][_0xe664('0x13')]===0x1f4){logger[_0xe664('0x12')](_0xe664('0xd'),_0x282e46,_0x577723['error'][_0xe664('0x14')]);return _0x2b6bc7(_0x577723[_0xe664('0x12')][_0xe664('0x14')]);}logger[_0xe664('0x12')](_0xe664('0xd'),_0x282e46,_0x577723['error'][_0xe664('0x14')]);return _0x34ee2e(_0x577723[_0xe664('0x12')]['message']);}else{logger[_0xe664('0xc')](_0xe664('0xd'),_0x282e46,_0xe664('0xe'));_0x34ee2e(_0x577723[_0xe664('0x15')][_0xe664('0x14')]);}})[_0xe664('0x16')](function(_0x4ffba6){logger[_0xe664('0x12')]('ZohoField,\x20%s,\x20%s',_0x282e46,_0x4ffba6);_0x2b6bc7(_0x4ffba6);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b30ee82..70b24e9 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2b3954,_0x5b8713){var _0x2b9b40=function(_0xb923b8){while(--_0xb923b8){_0x2b3954['push'](_0x2b3954['shift']());}};_0x2b9b40(++_0x5b8713);}(_0xedd9,0xfc));var _0x9edd=function(_0x329889,_0x15654e){_0x329889=_0x329889-0x0;var _0x50734e=_0xedd9[_0x329889];return _0x50734e;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ac546,_0x476180){var _0x5074c0=function(_0xc061e){while(--_0xc061e){_0x5ac546['push'](_0x5ac546['shift']());}};_0x5074c0(++_0x476180);}(_0xe706,0xa3));var _0x6e70=function(_0x33c98e,_0x4eb3d0){_0x33c98e=_0x33c98e-0x0;var _0x39a756=_0xe706[_0x33c98e];return _0x39a756;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 824eb29..461c0b8 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 _0x1376=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x5b27c7,_0x1a71a4){var _0x3a9565=function(_0x4a2686){while(--_0x4a2686){_0x5b27c7['push'](_0x5b27c7['shift']());}};_0x3a9565(++_0x1a71a4);}(_0x1376,0xc0));var _0x6137=function(_0x209953,_0x2fe955){_0x209953=_0x209953-0x0;var _0x53035f=_0x1376[_0x209953];return _0x53035f;};'use strict';var Sequelize=require(_0x6137('0x0'));module[_0x6137('0x1')]={'name':{'type':Sequelize[_0x6137('0x2')],'allowNull':![],'unique':_0x6137('0x3')},'version':{'type':Sequelize[_0x6137('0x2')],'allowNull':![],'unique':_0x6137('0x3')},'main':{'type':Sequelize[_0x6137('0x2')],'defaultValue':_0x6137('0x4')},'filename':{'type':Sequelize[_0x6137('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6137('0x2')]},'size':{'type':Sequelize[_0x6137('0x5')]},'active':{'type':Sequelize[_0x6137('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x6137('0x2')]},'state':{'type':Sequelize[_0x6137('0x2')],'unique':_0x6137('0x7')},'description':{'type':Sequelize[_0x6137('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6137('0x2')]},'link':{'type':Sequelize[_0x6137('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xc8ce=['INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x13fbc5,_0x349be1){var _0x4f1f71=function(_0x37901f){while(--_0x37901f){_0x13fbc5['push'](_0x13fbc5['shift']());}};_0x4f1f71(++_0x349be1);}(_0xc8ce,0x176));var _0xec8c=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xc8ce[_0x43b06b];return _0x2c555b;};'use strict';var Sequelize=require(_0xec8c('0x0'));module['exports']={'name':{'type':Sequelize[_0xec8c('0x1')],'allowNull':![],'unique':_0xec8c('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xec8c('0x2')},'main':{'type':Sequelize[_0xec8c('0x1')],'defaultValue':_0xec8c('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xec8c('0x1')]},'type':{'type':Sequelize[_0xec8c('0x1')]},'size':{'type':Sequelize[_0xec8c('0x4')]},'active':{'type':Sequelize[_0xec8c('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xec8c('0x1')],'unique':_0xec8c('0x6')},'description':{'type':Sequelize[_0xec8c('0x1')]},'title':{'type':Sequelize[_0xec8c('0x1')]},'remoteUri':{'type':Sequelize[_0xec8c('0x1')]},'link':{'type':Sequelize[_0xec8c('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 97e3940..3974581 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 _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0x5c6951,_0x507abb){var _0x5ee145=function(_0x4f8b75){while(--_0x4f8b75){_0x5c6951['push'](_0x5c6951['shift']());}};_0x5ee145(++_0x507abb);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1ce194,_0x59673c){_0x1ce194=_0x1ce194-0x0;var _0x3bae4e=_0xc6ac[_0x1ce194];return _0x3bae4e;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));}; \ No newline at end of file +var _0x47c5=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','Integration'];(function(_0xa1ca38,_0x12c4a3){var _0xf4e38f=function(_0x2f2643){while(--_0x2f2643){_0xa1ca38['push'](_0xa1ca38['shift']());}};_0xf4e38f(++_0x12c4a3);}(_0x47c5,0x165));var _0x547c=function(_0x3fa1f4,_0x301394){_0x3fa1f4=_0x3fa1f4-0x0;var _0x54f919=_0x47c5[_0x3fa1f4];return _0x54f919;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['Integration'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['Integration']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['Integration'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['Integration'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index fdee920..8fd01f6 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 _0x373f=['bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','moment'];(function(_0xdf8dba,_0xdf82de){var _0x1c504d=function(_0x878d32){while(--_0x878d32){_0xdf8dba['push'](_0xdf8dba['shift']());}};_0x1c504d(++_0xdf82de);}(_0x373f,0x1ae));var _0xf373=function(_0x1a1c1c,_0x36632e){_0x1a1c1c=_0x1a1c1c-0x0;var _0x5f4b8a=_0x373f[_0x1a1c1c];return _0x5f4b8a;};'use strict';var _=require('lodash');var util=require(_0xf373('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf373('0x1'));var BPromise=require(_0xf373('0x2'));var rp=require(_0xf373('0x3'));var fs=require('fs');var path=require(_0xf373('0x4'));var rimraf=require(_0xf373('0x5'));var config=require(_0xf373('0x6'));var attributes=require(_0xf373('0x7'));module[_0xf373('0x8')]=function(_0x203f95,_0x4756e9){return _0x203f95[_0xf373('0x9')](_0xf373('0xa'),attributes,{'tableName':_0xf373('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe342=['path','rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','util','../../config/logger','api','moment','request-promise'];(function(_0x201223,_0x34f736){var _0x593c05=function(_0x27893c){while(--_0x27893c){_0x201223['push'](_0x201223['shift']());}};_0x593c05(++_0x34f736);}(_0xe342,0x1cf));var _0x2e34=function(_0x2bcf5e,_0x5d9059){_0x2bcf5e=_0x2bcf5e-0x0;var _0x94e486=_0xe342[_0x2bcf5e];return _0x94e486;};'use strict';var _=require('lodash');var util=require(_0x2e34('0x0'));var logger=require(_0x2e34('0x1'))(_0x2e34('0x2'));var moment=require(_0x2e34('0x3'));var BPromise=require('bluebird');var rp=require(_0x2e34('0x4'));var fs=require('fs');var path=require(_0x2e34('0x5'));var rimraf=require(_0x2e34('0x6'));var config=require(_0x2e34('0x7'));var attributes=require(_0x2e34('0x8'));module[_0x2e34('0x9')]=function(_0x6e6284,_0xbaed77){return _0x6e6284['define'](_0x2e34('0xa'),attributes,{'tableName':_0x2e34('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 b2917b0..9aeaebe 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0x524e,0x15e));var _0xe524=function(_0x463063,_0x21fdbd){_0x463063=_0x463063-0x0;var _0x506383=_0x524e[_0x463063];return _0x506383;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4cbae0,_0x4fecca){var _0x477e12=function(_0x187e47){while(--_0x187e47){_0x4cbae0['push'](_0x4cbae0['shift']());}};_0x477e12(++_0x4fecca);}(_0x7880,0x1f4));var _0x0788=function(_0x1a87cd,_0x2a244f){_0x1a87cd=_0x1a87cd-0x0;var _0x4af60e=_0x7880[_0x1a87cd];return _0x4af60e;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index da61e4b..9c602fd 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 _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file +var _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x573c9e,_0xd4ab71){var _0x5d0714=function(_0x127a2a){while(--_0x127a2a){_0x573c9e['push'](_0x573c9e['shift']());}};_0x5d0714(++_0xd4ab71);}(_0xba34,0x119));var _0x4ba3=function(_0x36f25a,_0xbf86ef){_0x36f25a=_0x36f25a-0x0;var _0x5438ea=_0xba34[_0x36f25a];return _0x5438ea;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a902e86..cd18dca 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 _0x13ff=['BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x13ff,0x10f));var _0xf13f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x13ff[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xf13f('0x0'));module[_0xf13f('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xf13f('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf13f('0x3')]},'calleridname':{'type':Sequelize[_0xf13f('0x3')]},'queue':{'type':Sequelize[_0xf13f('0x3')]},'interface':{'type':Sequelize[_0xf13f('0x3')]},'membername':{'type':Sequelize[_0xf13f('0x3')]},'agentcalledAt':{'type':Sequelize[_0xf13f('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf13f('0x4')]},'holdtime':{'type':Sequelize[_0xf13f('0x2')]},'agentcomplete':{'type':Sequelize[_0xf13f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xf13f('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf13f('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf13f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf13f('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf13f('0x4')]},'lastevent':{'type':Sequelize[_0xf13f('0x3')]},'channel':{'type':Sequelize[_0xf13f('0x3')]},'channelstate':{'type':Sequelize[_0xf13f('0x2')]},'channelstatedesc':{'type':Sequelize[_0xf13f('0x3')]},'connectedlinenum':{'type':Sequelize[_0xf13f('0x3')]},'connectedlinename':{'type':Sequelize[_0xf13f('0x3')]},'language':{'type':Sequelize[_0xf13f('0x3')]},'accountcode':{'type':Sequelize[_0xf13f('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf13f('0x3')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xf13f('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf13f('0x3')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf13f('0x3')]},'destconnectedlinename':{'type':Sequelize[_0xf13f('0x3')]},'destlanguage':{'type':Sequelize[_0xf13f('0x3')]},'destaccountcode':{'type':Sequelize[_0xf13f('0x3')]},'destcontext':{'type':Sequelize[_0xf13f('0x3')]},'destexten':{'type':Sequelize[_0xf13f('0x3')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xf13f('0x3')]},'inReplyTo':{'type':Sequelize[_0xf13f('0x3')]},'subject':{'type':Sequelize[_0xf13f('0x3')]},'from':{'type':Sequelize[_0xf13f('0x3')]},'to':{'type':Sequelize[_0xf13f('0x3')]},'cc':{'type':Sequelize[_0xf13f('0x3')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xf13f('0x6')]},'text':{'type':Sequelize[_0xf13f('0x6')]},'status':{'type':Sequelize[_0xf13f('0x7')](_0xf13f('0x8'),_0xf13f('0x9'),_0xf13f('0xa'),_0xf13f('0xb'))},'url':{'type':Sequelize[_0xf13f('0x3')]},'app':{'type':Sequelize[_0xf13f('0x3')]},'appdata':{'type':Sequelize[_0xf13f('0x3')]},'projectId':{'type':Sequelize[_0xf13f('0x2')]}}; \ No newline at end of file +var _0xf3fc=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xf3fc,0x1b0));var _0xcf3f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf3fc[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xcf3f('0x0'));module[_0xcf3f('0x1')]={'integration':{'type':Sequelize[_0xcf3f('0x2')]},'eventChannel':{'type':Sequelize[_0xcf3f('0x2')]},'exitStatus':{'type':Sequelize[_0xcf3f('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xcf3f('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcf3f('0x2')]},'calleridnum':{'type':Sequelize[_0xcf3f('0x2')]},'calleridname':{'type':Sequelize[_0xcf3f('0x2')]},'queue':{'type':Sequelize[_0xcf3f('0x2')]},'interface':{'type':Sequelize[_0xcf3f('0x2')]},'membername':{'type':Sequelize[_0xcf3f('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xcf3f('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xcf3f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcf3f('0x4')]},'talktime':{'type':Sequelize[_0xcf3f('0x3')]},'agentacw':{'type':Sequelize[_0xcf3f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcf3f('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xcf3f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcf3f('0x4')]},'lastevent':{'type':Sequelize[_0xcf3f('0x2')]},'channel':{'type':Sequelize[_0xcf3f('0x2')]},'channelstate':{'type':Sequelize[_0xcf3f('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xcf3f('0x2')]},'connectedlinename':{'type':Sequelize[_0xcf3f('0x2')]},'language':{'type':Sequelize[_0xcf3f('0x2')]},'accountcode':{'type':Sequelize[_0xcf3f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xcf3f('0x2')]},'destchannel':{'type':Sequelize[_0xcf3f('0x2')]},'destchannelstate':{'type':Sequelize[_0xcf3f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xcf3f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xcf3f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xcf3f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xcf3f('0x2')]},'destlanguage':{'type':Sequelize[_0xcf3f('0x2')]},'destaccountcode':{'type':Sequelize[_0xcf3f('0x2')]},'destcontext':{'type':Sequelize[_0xcf3f('0x2')]},'destexten':{'type':Sequelize[_0xcf3f('0x2')]},'destpriority':{'type':Sequelize[_0xcf3f('0x2')]},'destuniqueid':{'type':Sequelize[_0xcf3f('0x2')]},'messageId':{'type':Sequelize[_0xcf3f('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xcf3f('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcf3f('0x2')]},'cc':{'type':Sequelize[_0xcf3f('0x2')]},'attachment':{'type':Sequelize[_0xcf3f('0x6')]},'html':{'type':Sequelize[_0xcf3f('0x6')]},'text':{'type':Sequelize[_0xcf3f('0x6')]},'status':{'type':Sequelize['ENUM'](_0xcf3f('0x7'),_0xcf3f('0x8'),_0xcf3f('0x9'),_0xcf3f('0xa'))},'url':{'type':Sequelize[_0xcf3f('0x2')]},'app':{'type':Sequelize[_0xcf3f('0x2')]},'appdata':{'type':Sequelize[_0xcf3f('0x2')]},'projectId':{'type':Sequelize[_0xcf3f('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index ab5c60b..c0b3f9f 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 _0xaf4f=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','end','sendStatus','name','send','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','find','create','body','catch','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x312e54,_0x171e62){var _0x93f77f=function(_0x13c74f){while(--_0x13c74f){_0x312e54['push'](_0x312e54['shift']());}};_0x93f77f(++_0x171e62);}(_0xaf4f,0x101));var _0xfaf4=function(_0x1383af,_0x29d2c3){_0x1383af=_0x1383af-0x0;var _0xbc03df=_0xaf4f[_0x1383af];return _0xbc03df;};'use strict';var emlformat=require(_0xfaf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfaf4('0x1'));var jsonpatch=require(_0xfaf4('0x2'));var rp=require(_0xfaf4('0x3'));var moment=require(_0xfaf4('0x4'));var BPromise=require(_0xfaf4('0x5'));var Mustache=require(_0xfaf4('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfaf4('0x7'));var ejs=require(_0xfaf4('0x8'));var fs=require('fs');var fs_extra=require(_0xfaf4('0x9'));var _=require(_0xfaf4('0xa'));var squel=require(_0xfaf4('0xb'));var crypto=require('crypto');var jsforce=require(_0xfaf4('0xc'));var deskjs=require(_0xfaf4('0xd'));var toCsv=require(_0xfaf4('0x7'));var querystring=require(_0xfaf4('0xe'));var Papa=require(_0xfaf4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfaf4('0x10'));var hardwareService=require(_0xfaf4('0x11'));var logger=require('../../config/logger')(_0xfaf4('0x12'));var utils=require('../../config/utils');var config=require(_0xfaf4('0x13'));var licenseUtil=require(_0xfaf4('0x14'));var db=require(_0xfaf4('0x15'))['db'];function respondWithStatusCode(_0x3c1985,_0xcdaf96){_0xcdaf96=_0xcdaf96||0xcc;return function(_0x1d0c70){if(_0x1d0c70){return _0x3c1985['sendStatus'](_0xcdaf96);}return _0x3c1985[_0xfaf4('0x16')](_0xcdaf96)['end']();};}function respondWithResult(_0x5b476c,_0x5d9849){_0x5d9849=_0x5d9849||0xc8;return function(_0x2faeff){if(_0x2faeff){return _0x5b476c[_0xfaf4('0x16')](_0x5d9849)[_0xfaf4('0x17')](_0x2faeff);}};}function respondWithFilteredResult(_0x8e3a2d,_0x56a009){return function(_0x1d4ba7){if(_0x1d4ba7){var _0x3da6de=typeof _0x56a009[_0xfaf4('0x18')]===_0xfaf4('0x19')&&typeof _0x56a009['limit']===_0xfaf4('0x19');var _0x49c304=_0x1d4ba7[_0xfaf4('0x1a')];var _0x14ce2e=_0x3da6de?0x0:_0x56a009[_0xfaf4('0x18')];var _0x113464=_0x3da6de?_0x1d4ba7['count']:_0x56a009[_0xfaf4('0x18')]+_0x56a009[_0xfaf4('0x1b')];var _0x577b32;if(_0x113464>=_0x49c304){_0x113464=_0x49c304;_0x577b32=0xc8;}else{_0x577b32=0xce;}_0x8e3a2d['status'](_0x577b32);return _0x8e3a2d[_0xfaf4('0x1c')](_0xfaf4('0x1d'),_0x14ce2e+'-'+_0x113464+'/'+_0x49c304)['json'](_0x1d4ba7);}return null;};}function patchUpdates(_0x4b0500){return function(_0x577ee9){try{jsonpatch[_0xfaf4('0x1e')](_0x577ee9,_0x4b0500,!![]);}catch(_0x5bd7ab){return BPromise[_0xfaf4('0x1f')](_0x5bd7ab);}return _0x577ee9['save']();};}function saveUpdates(_0x18fc30,_0xc293a7){return function(_0x5882f){if(_0x5882f){return _0x5882f[_0xfaf4('0x20')](_0x18fc30)[_0xfaf4('0x21')](function(_0x3420e4){return _0x3420e4;});}return null;};}function removeEntity(_0x353c4a,_0x3d0eaa){return function(_0x26634e){if(_0x26634e){return _0x26634e['destroy']()[_0xfaf4('0x21')](function(){_0x353c4a[_0xfaf4('0x16')](0xcc)[_0xfaf4('0x22')]();});}};}function handleEntityNotFound(_0x24fa9,_0x14473c){return function(_0x2bdfed){if(!_0x2bdfed){_0x24fa9[_0xfaf4('0x23')](0x194);}return _0x2bdfed;};}function handleError(_0x63aced,_0x7ff74a){_0x7ff74a=_0x7ff74a||0x1f4;return function(_0x4910d2){logger['error'](_0x4910d2['stack']);if(_0x4910d2['name']){delete _0x4910d2[_0xfaf4('0x24')];}_0x63aced[_0xfaf4('0x16')](_0x7ff74a)[_0xfaf4('0x25')](_0x4910d2);};}exports['index']=function(_0x34a86e,_0x371a45){var _0xa5c71e={},_0xb74ed6={},_0x554bbd={'count':0x0,'rows':[]};var _0x3a06c0=_[_0xfaf4('0x26')](db[_0xfaf4('0x27')][_0xfaf4('0x28')],function(_0x3d7db5){return{'name':_0x3d7db5[_0xfaf4('0x29')],'type':_0x3d7db5[_0xfaf4('0x2a')]['key']};});_0xb74ed6[_0xfaf4('0x2b')]=_[_0xfaf4('0x26')](_0x3a06c0,_0xfaf4('0x24'));_0xb74ed6[_0xfaf4('0x2c')]=_[_0xfaf4('0x2d')](_0x34a86e[_0xfaf4('0x2c')]);_0xb74ed6[_0xfaf4('0x2e')]=_[_0xfaf4('0x2f')](_0xb74ed6[_0xfaf4('0x2b')],_0xb74ed6[_0xfaf4('0x2c')]);_0xa5c71e['attributes']=_[_0xfaf4('0x2f')](_0xb74ed6[_0xfaf4('0x2b')],qs[_0xfaf4('0x30')](_0x34a86e[_0xfaf4('0x2c')][_0xfaf4('0x30')]));_0xa5c71e[_0xfaf4('0x31')]=_0xa5c71e[_0xfaf4('0x31')][_0xfaf4('0x32')]?_0xa5c71e['attributes']:_0xb74ed6[_0xfaf4('0x2b')];if(!_0x34a86e['query'][_0xfaf4('0x33')](_0xfaf4('0x34'))){_0xa5c71e[_0xfaf4('0x1b')]=qs[_0xfaf4('0x1b')](_0x34a86e[_0xfaf4('0x2c')][_0xfaf4('0x1b')]);_0xa5c71e[_0xfaf4('0x18')]=qs['offset'](_0x34a86e['query']['offset']);}_0xa5c71e[_0xfaf4('0x35')]=qs[_0xfaf4('0x36')](_0x34a86e[_0xfaf4('0x2c')]['sort']);_0xa5c71e[_0xfaf4('0x37')]=qs[_0xfaf4('0x2e')](_[_0xfaf4('0x38')](_0x34a86e[_0xfaf4('0x2c')],_0xb74ed6[_0xfaf4('0x2e')]),_0x3a06c0);if(_0x34a86e[_0xfaf4('0x2c')][_0xfaf4('0x39')]){_0xa5c71e['where']=_[_0xfaf4('0x3a')](_0xa5c71e[_0xfaf4('0x37')],{'$or':_[_0xfaf4('0x26')](_0x3a06c0,function(_0x199f96){if(_0x199f96[_0xfaf4('0x2a')]!==_0xfaf4('0x3b')){var _0x7fbb1a={};_0x7fbb1a[_0x199f96['name']]={'$like':'%'+_0x34a86e[_0xfaf4('0x2c')][_0xfaf4('0x39')]+'%'};return _0x7fbb1a;}})});}_0xa5c71e=_[_0xfaf4('0x3a')]({},_0xa5c71e,_0x34a86e[_0xfaf4('0x3c')]);var _0x4f06e1={'where':_0xa5c71e[_0xfaf4('0x37')]};return db[_0xfaf4('0x27')]['count'](_0x4f06e1)['then'](function(_0x2deb7b){_0x554bbd['count']=_0x2deb7b;if(_0x34a86e['query'][_0xfaf4('0x3d')]){_0xa5c71e[_0xfaf4('0x3e')]=[{'all':!![]}];}return db[_0xfaf4('0x27')]['findAll'](_0xa5c71e);})['then'](function(_0xc1c213){_0x554bbd['rows']=_0xc1c213;return _0x554bbd;})[_0xfaf4('0x21')](respondWithFilteredResult(_0x371a45,_0xa5c71e))['catch'](handleError(_0x371a45,null));};exports['show']=function(_0x5ba89a,_0x4f0cb8){var _0x11d361={'raw':![],'where':{'id':_0x5ba89a[_0xfaf4('0x3f')]['id']}},_0x5dc428={};_0x5dc428[_0xfaf4('0x2b')]=_['keys'](db[_0xfaf4('0x27')][_0xfaf4('0x28')]);_0x5dc428['query']=_[_0xfaf4('0x2d')](_0x5ba89a['query']);_0x5dc428[_0xfaf4('0x2e')]=_[_0xfaf4('0x2f')](_0x5dc428[_0xfaf4('0x2b')],_0x5dc428[_0xfaf4('0x2c')]);_0x11d361[_0xfaf4('0x31')]=_['intersection'](_0x5dc428['model'],qs[_0xfaf4('0x30')](_0x5ba89a[_0xfaf4('0x2c')]['fields']));_0x11d361[_0xfaf4('0x31')]=_0x11d361[_0xfaf4('0x31')][_0xfaf4('0x32')]?_0x11d361[_0xfaf4('0x31')]:_0x5dc428[_0xfaf4('0x2b')];if(_0x5ba89a['query'][_0xfaf4('0x3d')]){_0x11d361[_0xfaf4('0x3e')]=[{'all':!![]}];}_0x11d361=_[_0xfaf4('0x3a')]({},_0x11d361,_0x5ba89a[_0xfaf4('0x3c')]);return db[_0xfaf4('0x27')][_0xfaf4('0x40')](_0x11d361)[_0xfaf4('0x21')](handleEntityNotFound(_0x4f0cb8,null))[_0xfaf4('0x21')](respondWithResult(_0x4f0cb8,null))['catch'](handleError(_0x4f0cb8,null));};exports[_0xfaf4('0x41')]=function(_0x3be2b1,_0x9527dd){return db[_0xfaf4('0x27')][_0xfaf4('0x41')](_0x3be2b1[_0xfaf4('0x42')],{})[_0xfaf4('0x21')](respondWithResult(_0x9527dd,0xc9))[_0xfaf4('0x43')](handleError(_0x9527dd,null));};exports[_0xfaf4('0x20')]=function(_0x8c1a99,_0x4a5837){if(_0x8c1a99['body']['id']){delete _0x8c1a99['body']['id'];}return db[_0xfaf4('0x27')][_0xfaf4('0x40')]({'where':{'id':_0x8c1a99[_0xfaf4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a5837,null))[_0xfaf4('0x21')](saveUpdates(_0x8c1a99[_0xfaf4('0x42')],null))[_0xfaf4('0x21')](respondWithResult(_0x4a5837,null))['catch'](handleError(_0x4a5837,null));};exports[_0xfaf4('0x44')]=function(_0x5bdb1a,_0x450ec6){return db[_0xfaf4('0x27')][_0xfaf4('0x40')]({'where':{'id':_0x5bdb1a[_0xfaf4('0x3f')]['id']}})[_0xfaf4('0x21')](handleEntityNotFound(_0x450ec6,null))['then'](removeEntity(_0x450ec6,null))[_0xfaf4('0x43')](handleError(_0x450ec6,null));};exports['describe']=function(_0x465a99,_0x5efa85){return db[_0xfaf4('0x27')][_0xfaf4('0x45')]()[_0xfaf4('0x21')](respondWithResult(_0x5efa85,null))[_0xfaf4('0x43')](handleError(_0x5efa85,null));}; \ No newline at end of file +var _0x9ab1=['nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','merge','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','sendStatus','error','stack','name','send','IntegrationReport','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ab1,0xed));var _0x19ab=function(_0x421ad8,_0x508f49){_0x421ad8=_0x421ad8-0x0;var _0x53f73a=_0x9ab1[_0x421ad8];return _0x53f73a;};'use strict';var emlformat=require(_0x19ab('0x0'));var rimraf=require(_0x19ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x19ab('0x2'));var rp=require('request-promise');var moment=require(_0x19ab('0x3'));var BPromise=require(_0x19ab('0x4'));var Mustache=require('mustache');var util=require(_0x19ab('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x19ab('0x6'));var ejs=require(_0x19ab('0x7'));var fs=require('fs');var fs_extra=require(_0x19ab('0x8'));var _=require(_0x19ab('0x9'));var squel=require('squel');var crypto=require(_0x19ab('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x19ab('0xb'));var toCsv=require(_0x19ab('0x6'));var querystring=require(_0x19ab('0xc'));var Papa=require(_0x19ab('0xd'));var Redis=require(_0x19ab('0xe'));var authService=require(_0x19ab('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x19ab('0x10'));var hardwareService=require(_0x19ab('0x11'));var logger=require('../../config/logger')(_0x19ab('0x12'));var utils=require('../../config/utils');var config=require(_0x19ab('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x19ab('0x14'))['db'];function respondWithStatusCode(_0x49a918,_0x4af3dc){_0x4af3dc=_0x4af3dc||0xcc;return function(_0x2c1a09){if(_0x2c1a09){return _0x49a918['sendStatus'](_0x4af3dc);}return _0x49a918[_0x19ab('0x15')](_0x4af3dc)[_0x19ab('0x16')]();};}function respondWithResult(_0x31c724,_0x344f7a){_0x344f7a=_0x344f7a||0xc8;return function(_0x377cf1){if(_0x377cf1){return _0x31c724[_0x19ab('0x15')](_0x344f7a)[_0x19ab('0x17')](_0x377cf1);}};}function respondWithFilteredResult(_0x444ea8,_0x1ab32b){return function(_0x4b36d2){if(_0x4b36d2){var _0x54269d=typeof _0x1ab32b[_0x19ab('0x18')]==='undefined'&&typeof _0x1ab32b[_0x19ab('0x19')]===_0x19ab('0x1a');var _0x7c30a3=_0x4b36d2[_0x19ab('0x1b')];var _0x444fe1=_0x54269d?0x0:_0x1ab32b['offset'];var _0x5d3e3d=_0x54269d?_0x4b36d2[_0x19ab('0x1b')]:_0x1ab32b[_0x19ab('0x18')]+_0x1ab32b[_0x19ab('0x19')];var _0x33f4f0;if(_0x5d3e3d>=_0x7c30a3){_0x5d3e3d=_0x7c30a3;_0x33f4f0=0xc8;}else{_0x33f4f0=0xce;}_0x444ea8['status'](_0x33f4f0);return _0x444ea8[_0x19ab('0x1c')]('Content-Range',_0x444fe1+'-'+_0x5d3e3d+'/'+_0x7c30a3)['json'](_0x4b36d2);}return null;};}function patchUpdates(_0x37558a){return function(_0x23c762){try{jsonpatch['apply'](_0x23c762,_0x37558a,!![]);}catch(_0xe255ee){return BPromise[_0x19ab('0x1d')](_0xe255ee);}return _0x23c762[_0x19ab('0x1e')]();};}function saveUpdates(_0x1e5757,_0x3c6bec){return function(_0x441063){if(_0x441063){return _0x441063[_0x19ab('0x1f')](_0x1e5757)[_0x19ab('0x20')](function(_0x55df49){return _0x55df49;});}return null;};}function removeEntity(_0x4995f4,_0x4cf897){return function(_0x59703b){if(_0x59703b){return _0x59703b['destroy']()[_0x19ab('0x20')](function(){_0x4995f4[_0x19ab('0x15')](0xcc)[_0x19ab('0x16')]();});}};}function handleEntityNotFound(_0x509441,_0xa2f53b){return function(_0x5d6eb9){if(!_0x5d6eb9){_0x509441[_0x19ab('0x21')](0x194);}return _0x5d6eb9;};}function handleError(_0x2edbaf,_0xecceb6){_0xecceb6=_0xecceb6||0x1f4;return function(_0x242188){logger[_0x19ab('0x22')](_0x242188[_0x19ab('0x23')]);if(_0x242188['name']){delete _0x242188[_0x19ab('0x24')];}_0x2edbaf[_0x19ab('0x15')](_0xecceb6)[_0x19ab('0x25')](_0x242188);};}exports['index']=function(_0x48c0e3,_0x5d2735){var _0x585b19={},_0x208553={},_0x7d8a9={'count':0x0,'rows':[]};var _0x26bec2=_['map'](db[_0x19ab('0x26')][_0x19ab('0x27')],function(_0x5d7cd4){return{'name':_0x5d7cd4[_0x19ab('0x28')],'type':_0x5d7cd4[_0x19ab('0x29')][_0x19ab('0x2a')]};});_0x208553[_0x19ab('0x2b')]=_[_0x19ab('0x2c')](_0x26bec2,_0x19ab('0x24'));_0x208553['query']=_[_0x19ab('0x2d')](_0x48c0e3[_0x19ab('0x2e')]);_0x208553['filters']=_[_0x19ab('0x2f')](_0x208553['model'],_0x208553[_0x19ab('0x2e')]);_0x585b19[_0x19ab('0x30')]=_[_0x19ab('0x2f')](_0x208553[_0x19ab('0x2b')],qs[_0x19ab('0x31')](_0x48c0e3['query']['fields']));_0x585b19[_0x19ab('0x30')]=_0x585b19[_0x19ab('0x30')]['length']?_0x585b19['attributes']:_0x208553[_0x19ab('0x2b')];if(!_0x48c0e3[_0x19ab('0x2e')][_0x19ab('0x32')](_0x19ab('0x33'))){_0x585b19[_0x19ab('0x19')]=qs[_0x19ab('0x19')](_0x48c0e3[_0x19ab('0x2e')]['limit']);_0x585b19['offset']=qs[_0x19ab('0x18')](_0x48c0e3[_0x19ab('0x2e')][_0x19ab('0x18')]);}_0x585b19[_0x19ab('0x34')]=qs[_0x19ab('0x35')](_0x48c0e3['query'][_0x19ab('0x35')]);_0x585b19[_0x19ab('0x36')]=qs[_0x19ab('0x37')](_[_0x19ab('0x38')](_0x48c0e3['query'],_0x208553[_0x19ab('0x37')]),_0x26bec2);if(_0x48c0e3[_0x19ab('0x2e')][_0x19ab('0x39')]){_0x585b19['where']=_['merge'](_0x585b19['where'],{'$or':_['map'](_0x26bec2,function(_0x47dac8){if(_0x47dac8['type']!==_0x19ab('0x3a')){var _0x9191ff={};_0x9191ff[_0x47dac8[_0x19ab('0x24')]]={'$like':'%'+_0x48c0e3[_0x19ab('0x2e')][_0x19ab('0x39')]+'%'};return _0x9191ff;}})});}_0x585b19=_['merge']({},_0x585b19,_0x48c0e3[_0x19ab('0x3b')]);var _0x2990a1={'where':_0x585b19['where']};return db[_0x19ab('0x26')][_0x19ab('0x1b')](_0x2990a1)[_0x19ab('0x20')](function(_0x3b99bc){_0x7d8a9[_0x19ab('0x1b')]=_0x3b99bc;if(_0x48c0e3[_0x19ab('0x2e')][_0x19ab('0x3c')]){_0x585b19[_0x19ab('0x3d')]=[{'all':!![]}];}return db[_0x19ab('0x26')][_0x19ab('0x3e')](_0x585b19);})[_0x19ab('0x20')](function(_0x5e9c02){_0x7d8a9['rows']=_0x5e9c02;return _0x7d8a9;})[_0x19ab('0x20')](respondWithFilteredResult(_0x5d2735,_0x585b19))[_0x19ab('0x3f')](handleError(_0x5d2735,null));};exports[_0x19ab('0x40')]=function(_0x5ae288,_0x2439dc){var _0x51160e={'raw':![],'where':{'id':_0x5ae288[_0x19ab('0x41')]['id']}},_0x59dcbd={};_0x59dcbd['model']=_[_0x19ab('0x2d')](db[_0x19ab('0x26')][_0x19ab('0x27')]);_0x59dcbd[_0x19ab('0x2e')]=_[_0x19ab('0x2d')](_0x5ae288[_0x19ab('0x2e')]);_0x59dcbd['filters']=_[_0x19ab('0x2f')](_0x59dcbd[_0x19ab('0x2b')],_0x59dcbd[_0x19ab('0x2e')]);_0x51160e['attributes']=_[_0x19ab('0x2f')](_0x59dcbd['model'],qs[_0x19ab('0x31')](_0x5ae288[_0x19ab('0x2e')]['fields']));_0x51160e[_0x19ab('0x30')]=_0x51160e['attributes'][_0x19ab('0x42')]?_0x51160e[_0x19ab('0x30')]:_0x59dcbd['model'];if(_0x5ae288[_0x19ab('0x2e')][_0x19ab('0x3c')]){_0x51160e[_0x19ab('0x3d')]=[{'all':!![]}];}_0x51160e=_[_0x19ab('0x43')]({},_0x51160e,_0x5ae288[_0x19ab('0x3b')]);return db['IntegrationReport'][_0x19ab('0x44')](_0x51160e)[_0x19ab('0x20')](handleEntityNotFound(_0x2439dc,null))[_0x19ab('0x20')](respondWithResult(_0x2439dc,null))[_0x19ab('0x3f')](handleError(_0x2439dc,null));};exports['create']=function(_0x523559,_0x51b6ee){return db[_0x19ab('0x26')][_0x19ab('0x45')](_0x523559[_0x19ab('0x46')],{})[_0x19ab('0x20')](respondWithResult(_0x51b6ee,0xc9))[_0x19ab('0x3f')](handleError(_0x51b6ee,null));};exports[_0x19ab('0x1f')]=function(_0x417696,_0x43b142){if(_0x417696[_0x19ab('0x46')]['id']){delete _0x417696[_0x19ab('0x46')]['id'];}return db[_0x19ab('0x26')][_0x19ab('0x44')]({'where':{'id':_0x417696[_0x19ab('0x41')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x43b142,null))[_0x19ab('0x20')](saveUpdates(_0x417696[_0x19ab('0x46')],null))['then'](respondWithResult(_0x43b142,null))[_0x19ab('0x3f')](handleError(_0x43b142,null));};exports['destroy']=function(_0x520d7e,_0x1fea42){return db[_0x19ab('0x26')]['find']({'where':{'id':_0x520d7e[_0x19ab('0x41')]['id']}})['then'](handleEntityNotFound(_0x1fea42,null))[_0x19ab('0x20')](removeEntity(_0x1fea42,null))[_0x19ab('0x3f')](handleError(_0x1fea42,null));};exports[_0x19ab('0x47')]=function(_0x3fc493,_0x598aac){return db['IntegrationReport'][_0x19ab('0x47')]()[_0x19ab('0x20')](respondWithResult(_0x598aac,null))[_0x19ab('0x3f')](handleError(_0x598aac,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index fb25fb6..c164fcc 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 _0xc892=['report_integration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','IntegrationReport'];(function(_0x1fe47f,_0x22c4a8){var _0x5c5cc7=function(_0x4cbee1){while(--_0x4cbee1){_0x1fe47f['push'](_0x1fe47f['shift']());}};_0x5c5cc7(++_0x22c4a8);}(_0xc892,0x79));var _0x2c89=function(_0x1bc9f4,_0xc6fde4){_0x1bc9f4=_0x1bc9f4-0x0;var _0x4b9931=_0xc892[_0x1bc9f4];return _0x4b9931;};'use strict';var _=require('lodash');var util=require(_0x2c89('0x0'));var logger=require(_0x2c89('0x1'))(_0x2c89('0x2'));var moment=require(_0x2c89('0x3'));var BPromise=require(_0x2c89('0x4'));var rp=require(_0x2c89('0x5'));var fs=require('fs');var path=require(_0x2c89('0x6'));var rimraf=require(_0x2c89('0x7'));var config=require('../../config/environment');var attributes=require(_0x2c89('0x8'));module[_0x2c89('0x9')]=function(_0x2b41f3,_0x4563f9){return _0x2b41f3['define'](_0x2c89('0xa'),attributes,{'tableName':_0x2c89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe07d=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','lodash'];(function(_0x358eba,_0x323c44){var _0x3d17a4=function(_0x3e5848){while(--_0x3e5848){_0x358eba['push'](_0x358eba['shift']());}};_0x3d17a4(++_0x323c44);}(_0xe07d,0x78));var _0xde07=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xe07d[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0xde07('0x0'));var util=require(_0xde07('0x1'));var logger=require(_0xde07('0x2'))('api');var moment=require(_0xde07('0x3'));var BPromise=require(_0xde07('0x4'));var rp=require(_0xde07('0x5'));var fs=require('fs');var path=require(_0xde07('0x6'));var rimraf=require('rimraf');var config=require(_0xde07('0x7'));var attributes=require(_0xde07('0x8'));module[_0xde07('0x9')]=function(_0x41728a,_0x2da9c0){return _0x41728a[_0xde07('0xa')]('IntegrationReport',attributes,{'tableName':'report_integration','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 b407b90..85063be 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 _0x0295=['client','http','then','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x77f7ae,_0x2c2bfc){var _0x13e7ee=function(_0x54fc34){while(--_0x54fc34){_0x77f7ae['push'](_0x77f7ae['shift']());}};_0x13e7ee(++_0x2c2bfc);}(_0x0295,0x1f0));var _0x5029=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0x0295[_0x3fcc20];return _0x15d3ce;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('IntegrationReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x306e0a,_0x5a5241){var _0x9799d7=function(_0xd260b9){while(--_0xd260b9){_0x306e0a['push'](_0x306e0a['shift']());}};_0x9799d7(++_0x5a5241);}(_0x2675,0x75));var _0x5267=function(_0xad0635,_0x50cbe9){_0xad0635=_0xad0635-0x0;var _0x4ce073=_0x2675[_0xad0635];return _0x4ce073;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 92ac26c..273b6ac 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 _0xf1c6=['../../config/environment','./interval.controller','get','/:id','isAuthenticated','show','/:id/sub_intervals','post','create','/:id/sub_intervals/create_many','addIntervals','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x66f546,_0x37d307){var _0x240501=function(_0x3bfd9d){while(--_0x3bfd9d){_0x66f546['push'](_0x66f546['shift']());}};_0x240501(++_0x37d307);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x254b96,_0x5a38f4){_0x254b96=_0x254b96-0x0;var _0x22fd0a=_0xf1c6[_0x254b96];return _0x22fd0a;};'use strict';var multer=require(_0x6f1c('0x0'));var util=require(_0x6f1c('0x1'));var path=require(_0x6f1c('0x2'));var timeout=require(_0x6f1c('0x3'));var express=require(_0x6f1c('0x4'));var router=express[_0x6f1c('0x5')]();var fs_extra=require(_0x6f1c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6f1c('0x7'));var config=require(_0x6f1c('0x8'));var controller=require(_0x6f1c('0x9'));router[_0x6f1c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6f1c('0xa')](_0x6f1c('0xb'),auth[_0x6f1c('0xc')](),controller[_0x6f1c('0xd')]);router[_0x6f1c('0xa')](_0x6f1c('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0x6f1c('0xf')]('/',auth[_0x6f1c('0xc')](),controller[_0x6f1c('0x10')]);router[_0x6f1c('0xf')](_0x6f1c('0xe'),auth[_0x6f1c('0xc')](),controller['addInterval']);router[_0x6f1c('0xf')](_0x6f1c('0x11'),auth['isAuthenticated'](),controller[_0x6f1c('0x12')]);router['put']('/:id',auth[_0x6f1c('0xc')](),controller[_0x6f1c('0x13')]);router['delete']('/:id',auth[_0x6f1c('0xc')](),controller['destroy']);module[_0x6f1c('0x14')]=router; \ No newline at end of file +var _0x05f1=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','index','get','isAuthenticated','show','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','delete','exports','multer','util','path'];(function(_0x1b6964,_0x23297e){var _0x49d2af=function(_0x3cd2b4){while(--_0x3cd2b4){_0x1b6964['push'](_0x1b6964['shift']());}};_0x49d2af(++_0x23297e);}(_0x05f1,0xfa));var _0x105f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x05f1[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x105f('0x0'));var util=require(_0x105f('0x1'));var path=require(_0x105f('0x2'));var timeout=require(_0x105f('0x3'));var express=require(_0x105f('0x4'));var router=express[_0x105f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x105f('0x6'));var interaction=require(_0x105f('0x7'));var config=require(_0x105f('0x8'));var controller=require(_0x105f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x105f('0xa')]);router[_0x105f('0xb')]('/:id',auth[_0x105f('0xc')](),controller[_0x105f('0xd')]);router[_0x105f('0xb')]('/:id/sub_intervals',auth[_0x105f('0xc')](),controller['getIntervals']);router[_0x105f('0xe')]('/',auth[_0x105f('0xc')](),controller[_0x105f('0xf')]);router[_0x105f('0xe')](_0x105f('0x10'),auth[_0x105f('0xc')](),controller[_0x105f('0x11')]);router[_0x105f('0xe')](_0x105f('0x12'),auth[_0x105f('0xc')](),controller[_0x105f('0x13')]);router['put'](_0x105f('0x14'),auth[_0x105f('0xc')](),controller['update']);router[_0x105f('0x15')](_0x105f('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x105f('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 7ac149d..3441685 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 _0x45c9=['exports','STRING'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x45c9,0x96));var _0x945c=function(_0xfefa94,_0x3a28f0){_0xfefa94=_0xfefa94-0x0;var _0xf480ee=_0x45c9[_0xfefa94];return _0xf480ee;};'use strict';var Sequelize=require('sequelize');module[_0x945c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x945c('0x1')]},'interval':{'type':Sequelize[_0x945c('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x9e9e=['sequelize','STRING'];(function(_0x349dce,_0x345afe){var _0x44133d=function(_0x1da545){while(--_0x1da545){_0x349dce['push'](_0x349dce['shift']());}};_0x44133d(++_0x345afe);}(_0x9e9e,0x12c));var _0xe9e9=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x9e9e[_0x152aa1];return _0x1bc01a;};'use strict';var Sequelize=require(_0xe9e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xe9e9('0x1')]},'description':{'type':Sequelize[_0xe9e9('0x1')]},'interval':{'type':Sequelize[_0xe9e9('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 8b1c336..8e14f06 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 _0xa2e1=['fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Interval','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','findOne','filter','getIntervals','addIntervals','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','send','map','rawAttributes'];(function(_0x27ad75,_0x1b2294){var _0x1897f1=function(_0x37120d){while(--_0x37120d){_0x27ad75['push'](_0x27ad75['shift']());}};_0x1897f1(++_0x1b2294);}(_0xa2e1,0x1ee));var _0x1a2e=function(_0x3ba6ef,_0x52f56a){_0x3ba6ef=_0x3ba6ef-0x0;var _0xe718c8=_0xa2e1[_0x3ba6ef];return _0xe718c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a2e('0x0'));var zipdir=require(_0x1a2e('0x1'));var jsonpatch=require(_0x1a2e('0x2'));var rp=require(_0x1a2e('0x3'));var moment=require(_0x1a2e('0x4'));var BPromise=require(_0x1a2e('0x5'));var Mustache=require(_0x1a2e('0x6'));var util=require(_0x1a2e('0x7'));var path=require(_0x1a2e('0x8'));var sox=require(_0x1a2e('0x9'));var csv=require(_0x1a2e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a2e('0xb'));var _=require('lodash');var squel=require(_0x1a2e('0xc'));var crypto=require(_0x1a2e('0xd'));var jsforce=require(_0x1a2e('0xe'));var deskjs=require(_0x1a2e('0xf'));var toCsv=require(_0x1a2e('0xa'));var querystring=require(_0x1a2e('0x10'));var Papa=require('papaparse');var Redis=require(_0x1a2e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a2e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a2e('0x13'))(_0x1a2e('0x14'));var utils=require('../../config/utils');var config=require(_0x1a2e('0x15'));var licenseUtil=require(_0x1a2e('0x16'));var db=require(_0x1a2e('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x1ceba8,_0x499c7b){_0x499c7b=_0x499c7b||0xcc;return function(_0xd34df0){if(_0xd34df0){return _0x1ceba8[_0x1a2e('0x18')](_0x499c7b);}return _0x1ceba8['status'](_0x499c7b)[_0x1a2e('0x19')]();};}function respondWithResult(_0x15385d,_0x315e86){_0x315e86=_0x315e86||0xc8;return function(_0x3fc82d){if(_0x3fc82d){return _0x15385d['status'](_0x315e86)[_0x1a2e('0x1a')](_0x3fc82d);}};}function respondWithFilteredResult(_0x3ec9c6,_0x1b8df7){return function(_0xb67bce){if(_0xb67bce){var _0x7ede5f=typeof _0x1b8df7[_0x1a2e('0x1b')]===_0x1a2e('0x1c')&&typeof _0x1b8df7[_0x1a2e('0x1d')]===_0x1a2e('0x1c');var _0x386933=_0xb67bce['count'];var _0x393426=_0x7ede5f?0x0:_0x1b8df7[_0x1a2e('0x1b')];var _0x5c2559=_0x7ede5f?_0xb67bce[_0x1a2e('0x1e')]:_0x1b8df7['offset']+_0x1b8df7['limit'];var _0x10cd9d;if(_0x5c2559>=_0x386933){_0x5c2559=_0x386933;_0x10cd9d=0xc8;}else{_0x10cd9d=0xce;}_0x3ec9c6[_0x1a2e('0x1f')](_0x10cd9d);return _0x3ec9c6['set'](_0x1a2e('0x20'),_0x393426+'-'+_0x5c2559+'/'+_0x386933)[_0x1a2e('0x1a')](_0xb67bce);}return null;};}function patchUpdates(_0x9d40c5){return function(_0x4469d4){try{jsonpatch[_0x1a2e('0x21')](_0x4469d4,_0x9d40c5,!![]);}catch(_0x2766e0){return BPromise['reject'](_0x2766e0);}return _0x4469d4[_0x1a2e('0x22')]();};}function saveUpdates(_0x87f8b8,_0x3056e0){return function(_0x3a2d20){if(_0x3a2d20){return _0x3a2d20[_0x1a2e('0x23')](_0x87f8b8)[_0x1a2e('0x24')](function(_0x4d44e8){return _0x4d44e8;});}return null;};}function removeEntity(_0x5b9d24,_0x4a9763){return function(_0x9b513b){if(_0x9b513b){return _0x9b513b[_0x1a2e('0x25')]()[_0x1a2e('0x24')](function(){var _0x2bb80c=_0x9b513b[_0x1a2e('0x26')]({'plain':!![]});var _0x2dd745=_0x1a2e('0x27');return db[_0x1a2e('0x28')]['destroy']({'where':{'type':_0x2dd745,'resourceId':_0x2bb80c['id']}})['then'](function(){return _0x9b513b;});})[_0x1a2e('0x24')](function(){_0x5b9d24[_0x1a2e('0x1f')](0xcc)[_0x1a2e('0x19')]();});}};}function handleEntityNotFound(_0xd5cf6e,_0x457a07){return function(_0x5471d8){if(!_0x5471d8){_0xd5cf6e[_0x1a2e('0x18')](0x194);}return _0x5471d8;};}function handleError(_0x47cb13,_0x4aef82){_0x4aef82=_0x4aef82||0x1f4;return function(_0x3c4ddd){logger[_0x1a2e('0x29')](_0x3c4ddd[_0x1a2e('0x2a')]);if(_0x3c4ddd['name']){delete _0x3c4ddd['name'];}_0x47cb13[_0x1a2e('0x1f')](_0x4aef82)[_0x1a2e('0x2b')](_0x3c4ddd);};}exports['index']=function(_0x2fcc7a,_0x1f18d5){var _0xaf6c5d={},_0x2fc419={},_0x580252={'count':0x0,'rows':[]};var _0x8f1090=_[_0x1a2e('0x2c')](db['Interval'][_0x1a2e('0x2d')],function(_0x233705){return{'name':_0x233705[_0x1a2e('0x2e')],'type':_0x233705[_0x1a2e('0x2f')]['key']};});_0x2fc419[_0x1a2e('0x30')]=_[_0x1a2e('0x2c')](_0x8f1090,_0x1a2e('0x31'));_0x2fc419['query']=_[_0x1a2e('0x32')](_0x2fcc7a['query']);_0x2fc419[_0x1a2e('0x33')]=_[_0x1a2e('0x34')](_0x2fc419['model'],_0x2fc419[_0x1a2e('0x35')]);_0xaf6c5d[_0x1a2e('0x36')]=_[_0x1a2e('0x34')](_0x2fc419[_0x1a2e('0x30')],qs[_0x1a2e('0x37')](_0x2fcc7a['query'][_0x1a2e('0x37')]));_0xaf6c5d[_0x1a2e('0x36')]=_0xaf6c5d['attributes'][_0x1a2e('0x38')]?_0xaf6c5d[_0x1a2e('0x36')]:_0x2fc419['model'];if(!_0x2fcc7a['query'][_0x1a2e('0x39')](_0x1a2e('0x3a'))){_0xaf6c5d['limit']=qs[_0x1a2e('0x1d')](_0x2fcc7a[_0x1a2e('0x35')][_0x1a2e('0x1d')]);_0xaf6c5d['offset']=qs[_0x1a2e('0x1b')](_0x2fcc7a['query'][_0x1a2e('0x1b')]);}_0xaf6c5d[_0x1a2e('0x3b')]=qs[_0x1a2e('0x3c')](_0x2fcc7a[_0x1a2e('0x35')][_0x1a2e('0x3c')]);_0xaf6c5d[_0x1a2e('0x3d')]=qs[_0x1a2e('0x33')](_[_0x1a2e('0x3e')](_0x2fcc7a[_0x1a2e('0x35')],_0x2fc419[_0x1a2e('0x33')]),_0x8f1090);if(_0x2fcc7a['query']['filter']){_0xaf6c5d[_0x1a2e('0x3d')]=_[_0x1a2e('0x3f')](_0xaf6c5d[_0x1a2e('0x3d')],{'$or':_[_0x1a2e('0x2c')](_0x8f1090,function(_0x335e49){if(_0x335e49[_0x1a2e('0x2f')]!==_0x1a2e('0x40')){var _0x25ca07={};_0x25ca07[_0x335e49['name']]={'$like':'%'+_0x2fcc7a[_0x1a2e('0x35')]['filter']+'%'};return _0x25ca07;}})});}_0xaf6c5d=_[_0x1a2e('0x3f')]({},_0xaf6c5d,_0x2fcc7a[_0x1a2e('0x41')]);var _0x27e6a3={'where':_0xaf6c5d['where']};return db[_0x1a2e('0x42')][_0x1a2e('0x1e')](_0x27e6a3)[_0x1a2e('0x24')](function(_0xb2f2bb){_0x580252['count']=_0xb2f2bb;if(_0x2fcc7a[_0x1a2e('0x35')]['includeAll']){_0xaf6c5d[_0x1a2e('0x43')]=[{'all':!![]}];}return db[_0x1a2e('0x42')][_0x1a2e('0x44')](_0xaf6c5d);})['then'](function(_0x3a8189){_0x580252[_0x1a2e('0x45')]=_0x3a8189;return _0x580252;})[_0x1a2e('0x24')](respondWithFilteredResult(_0x1f18d5,_0xaf6c5d))[_0x1a2e('0x46')](handleError(_0x1f18d5,null));};exports[_0x1a2e('0x47')]=function(_0x2525dc,_0xc7e8a2){var _0xa46647={'raw':!![],'where':{'id':_0x2525dc[_0x1a2e('0x48')]['id']}},_0x2cda85={};_0x2cda85[_0x1a2e('0x30')]=_[_0x1a2e('0x32')](db[_0x1a2e('0x42')]['rawAttributes']);_0x2cda85[_0x1a2e('0x35')]=_['keys'](_0x2525dc[_0x1a2e('0x35')]);_0x2cda85[_0x1a2e('0x33')]=_['intersection'](_0x2cda85['model'],_0x2cda85[_0x1a2e('0x35')]);_0xa46647[_0x1a2e('0x36')]=_[_0x1a2e('0x34')](_0x2cda85[_0x1a2e('0x30')],qs[_0x1a2e('0x37')](_0x2525dc[_0x1a2e('0x35')]['fields']));_0xa46647['attributes']=_0xa46647['attributes'][_0x1a2e('0x38')]?_0xa46647[_0x1a2e('0x36')]:_0x2cda85[_0x1a2e('0x30')];if(_0x2525dc[_0x1a2e('0x35')][_0x1a2e('0x49')]){_0xa46647[_0x1a2e('0x43')]=[{'all':!![]}];}_0xa46647=_['merge']({},_0xa46647,_0x2525dc[_0x1a2e('0x41')]);return db['Interval'][_0x1a2e('0x4a')](_0xa46647)[_0x1a2e('0x24')](handleEntityNotFound(_0xc7e8a2,null))[_0x1a2e('0x24')](respondWithResult(_0xc7e8a2,null))[_0x1a2e('0x46')](handleError(_0xc7e8a2,null));};exports[_0x1a2e('0x4b')]=function(_0x446ae2,_0x3ee55b){return db['Interval'][_0x1a2e('0x4b')](_0x446ae2['body'],{})[_0x1a2e('0x24')](function(_0x27e9bd){var _0x21706a=_0x446ae2[_0x1a2e('0x4c')]['get']({'plain':!![]});if(!_0x21706a)throw new Error(_0x1a2e('0x4d'));if(_0x21706a[_0x1a2e('0x4e')]===_0x1a2e('0x4c')){var _0x5c058e=_0x27e9bd['get']({'plain':!![]});var _0x3c52f4=_0x1a2e('0x27');return db[_0x1a2e('0x4f')][_0x1a2e('0x4a')]({'where':{'name':_0x3c52f4,'userProfileId':_0x21706a['userProfileId']},'raw':!![]})[_0x1a2e('0x24')](function(_0x423014){if(_0x423014&&_0x423014[_0x1a2e('0x50')]===0x0){return db[_0x1a2e('0x28')]['create']({'name':_0x5c058e[_0x1a2e('0x31')],'resourceId':_0x5c058e['id'],'type':_0x423014['name'],'sectionId':_0x423014['id']},{})[_0x1a2e('0x24')](function(){return _0x27e9bd;});}else{return _0x27e9bd;}})[_0x1a2e('0x46')](function(_0x27d122){logger['error'](_0x1a2e('0x51'),_0x27d122);throw _0x27d122;});}return _0x27e9bd;})['then'](respondWithResult(_0x3ee55b,0xc9))[_0x1a2e('0x46')](handleError(_0x3ee55b,null));};exports[_0x1a2e('0x23')]=function(_0x3c7ba4,_0x23e428){if(_0x3c7ba4[_0x1a2e('0x52')]['id']){delete _0x3c7ba4[_0x1a2e('0x52')]['id'];}return db[_0x1a2e('0x42')]['find']({'where':{'id':_0x3c7ba4[_0x1a2e('0x48')]['id']}})[_0x1a2e('0x24')](handleEntityNotFound(_0x23e428,null))[_0x1a2e('0x24')](saveUpdates(_0x3c7ba4['body'],null))['then'](respondWithResult(_0x23e428,null))[_0x1a2e('0x46')](handleError(_0x23e428,null));};exports[_0x1a2e('0x25')]=function(_0x113920,_0xfaf63b){return db[_0x1a2e('0x42')][_0x1a2e('0x4a')]({'where':{'id':_0x113920[_0x1a2e('0x48')]['id']}})['then'](handleEntityNotFound(_0xfaf63b,null))[_0x1a2e('0x24')](removeEntity(_0xfaf63b,null))[_0x1a2e('0x46')](handleError(_0xfaf63b,null));};exports['addInterval']=function(_0x2af652,_0x48edf7,_0x4a0485){if(_0x2af652[_0x1a2e('0x52')]['id']){delete _0x2af652[_0x1a2e('0x52')]['id'];}return db['Interval'][_0x1a2e('0x4a')]({'where':{'id':_0x2af652['params']['id']}})[_0x1a2e('0x24')](handleEntityNotFound(_0x48edf7,null))['then'](function(_0x2c702d){if(_0x2c702d){_0x2af652['body'][_0x1a2e('0x53')]=_0x2c702d['id'];return db[_0x1a2e('0x42')][_0x1a2e('0x4b')](_0x2af652[_0x1a2e('0x52')]);}})[_0x1a2e('0x24')](respondWithResult(_0x48edf7,null))[_0x1a2e('0x46')](handleError(_0x48edf7,null));};exports['getIntervals']=function(_0x3ae3f7,_0x2e71dc,_0x1c519d){var _0x4b1ac1={};var _0x10712f={};var _0x3875e9;var _0x27f13d;return db['Interval'][_0x1a2e('0x54')]({'where':{'id':_0x3ae3f7['params']['id']}})[_0x1a2e('0x24')](handleEntityNotFound(_0x2e71dc,null))[_0x1a2e('0x24')](function(_0x45738b){if(_0x45738b){_0x3875e9=_0x45738b;_0x10712f[_0x1a2e('0x30')]=_[_0x1a2e('0x32')](db[_0x1a2e('0x42')]['rawAttributes']);_0x10712f[_0x1a2e('0x35')]=_['keys'](_0x3ae3f7[_0x1a2e('0x35')]);_0x10712f[_0x1a2e('0x33')]=_[_0x1a2e('0x34')](_0x10712f['model'],_0x10712f[_0x1a2e('0x35')]);_0x4b1ac1['attributes']=_[_0x1a2e('0x34')](_0x10712f[_0x1a2e('0x30')],qs[_0x1a2e('0x37')](_0x3ae3f7['query'][_0x1a2e('0x37')]));_0x4b1ac1[_0x1a2e('0x36')]=_0x4b1ac1[_0x1a2e('0x36')][_0x1a2e('0x38')]?_0x4b1ac1[_0x1a2e('0x36')]:_0x10712f['model'];_0x4b1ac1[_0x1a2e('0x3b')]=qs[_0x1a2e('0x3c')](_0x3ae3f7[_0x1a2e('0x35')][_0x1a2e('0x3c')]);_0x4b1ac1[_0x1a2e('0x3d')]=qs[_0x1a2e('0x33')](_[_0x1a2e('0x3e')](_0x3ae3f7['query'],_0x10712f[_0x1a2e('0x33')]));if(_0x3ae3f7[_0x1a2e('0x35')][_0x1a2e('0x55')]){_0x4b1ac1[_0x1a2e('0x3d')]=_[_0x1a2e('0x3f')](_0x4b1ac1[_0x1a2e('0x3d')],{'$or':_[_0x1a2e('0x2c')](_0x4b1ac1[_0x1a2e('0x36')],function(_0x3c7427){var _0xadff0f={};_0xadff0f[_0x3c7427]={'$like':'%'+_0x3ae3f7['query'][_0x1a2e('0x55')]+'%'};return _0xadff0f;})});}_0x4b1ac1=_[_0x1a2e('0x3f')]({},_0x4b1ac1,_0x3ae3f7[_0x1a2e('0x41')]);return _0x3875e9['getIntervals'](_0x4b1ac1);}})['then'](function(_0x25c73f){if(_0x25c73f){_0x27f13d=_0x25c73f[_0x1a2e('0x38')];if(!_0x3ae3f7[_0x1a2e('0x35')]['hasOwnProperty'](_0x1a2e('0x3a'))){_0x4b1ac1[_0x1a2e('0x1d')]=qs[_0x1a2e('0x1d')](_0x3ae3f7[_0x1a2e('0x35')][_0x1a2e('0x1d')]);_0x4b1ac1[_0x1a2e('0x1b')]=qs['offset'](_0x3ae3f7[_0x1a2e('0x35')][_0x1a2e('0x1b')]);}return _0x3875e9[_0x1a2e('0x56')](_0x4b1ac1);}})[_0x1a2e('0x24')](function(_0x5f3cd8){if(_0x5f3cd8){return _0x5f3cd8?{'count':_0x27f13d,'rows':_0x5f3cd8}:null;}})[_0x1a2e('0x24')](respondWithResult(_0x2e71dc,null))[_0x1a2e('0x46')](handleError(_0x2e71dc,null));};exports[_0x1a2e('0x57')]=function(_0x176d8f,_0x15c823,_0x3a9e47){return db[_0x1a2e('0x42')][_0x1a2e('0x54')]({'where':{'id':_0x176d8f['params']['id']}})[_0x1a2e('0x24')](handleEntityNotFound(_0x15c823,null))[_0x1a2e('0x24')](function(_0x5dcf49){if(_0x5dcf49){return db[_0x1a2e('0x58')][_0x1a2e('0x59')](function(_0x498421){return db[_0x1a2e('0x42')]['destroy']({'where':{'IntervalId':_0x176d8f[_0x1a2e('0x48')]['id']},'transaction':_0x498421})[_0x1a2e('0x24')](function(_0xa889d9){var _0x4ef620=_[_0x1a2e('0x2c')](_0x176d8f['body'],function(_0x492524){delete _0x492524['id'];_0x492524[_0x1a2e('0x53')]=_0x176d8f[_0x1a2e('0x48')]['id'];return _0x492524;});return db['Interval']['bulkCreate'](_0x4ef620,{'transaction':_0x498421});});})[_0x1a2e('0x24')](function(){return db[_0x1a2e('0x42')]['findAll']({'where':{'IntervalId':_0x176d8f[_0x1a2e('0x48')]['id']}});});}})['then'](respondWithResult(_0x15c823,null))[_0x1a2e('0x46')](handleError(_0x15c823,null));}; \ No newline at end of file +var _0xa75f=['map','Interval','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','filter','where','merge','includeAll','rows','catch','show','params','rawAttributes','length','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','findOne','pick','getIntervals','hasOwnProperty','nolimit','addIntervals','transaction','bulkCreate','findAll','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Intervals','name','index'];(function(_0x3f09a9,_0x2a1758){var _0x854a6d=function(_0x3eff89){while(--_0x3eff89){_0x3f09a9['push'](_0x3f09a9['shift']());}};_0x854a6d(++_0x2a1758);}(_0xa75f,0xe3));var _0xfa75=function(_0x5e2672,_0xdd0bae){_0x5e2672=_0x5e2672-0x0;var _0x44ee84=_0xa75f[_0x5e2672];return _0x44ee84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa75('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa75('0x1'));var rp=require('request-promise');var moment=require(_0xfa75('0x2'));var BPromise=require(_0xfa75('0x3'));var Mustache=require(_0xfa75('0x4'));var util=require(_0xfa75('0x5'));var path=require('path');var sox=require(_0xfa75('0x6'));var csv=require(_0xfa75('0x7'));var ejs=require(_0xfa75('0x8'));var fs=require('fs');var fs_extra=require(_0xfa75('0x9'));var _=require(_0xfa75('0xa'));var squel=require(_0xfa75('0xb'));var crypto=require(_0xfa75('0xc'));var jsforce=require(_0xfa75('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfa75('0xe'));var Papa=require(_0xfa75('0xf'));var Redis=require(_0xfa75('0x10'));var authService=require(_0xfa75('0x11'));var qs=require(_0xfa75('0x12'));var as=require(_0xfa75('0x13'));var hardwareService=require(_0xfa75('0x14'));var logger=require(_0xfa75('0x15'))(_0xfa75('0x16'));var utils=require(_0xfa75('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfa75('0x18'));var db=require(_0xfa75('0x19'))['db'];var extensions=require(_0xfa75('0x1a'));function respondWithStatusCode(_0x1fd1d4,_0x416131){_0x416131=_0x416131||0xcc;return function(_0x3e1239){if(_0x3e1239){return _0x1fd1d4[_0xfa75('0x1b')](_0x416131);}return _0x1fd1d4['status'](_0x416131)[_0xfa75('0x1c')]();};}function respondWithResult(_0x12717a,_0x9bfaa9){_0x9bfaa9=_0x9bfaa9||0xc8;return function(_0x75fbe8){if(_0x75fbe8){return _0x12717a[_0xfa75('0x1d')](_0x9bfaa9)[_0xfa75('0x1e')](_0x75fbe8);}};}function respondWithFilteredResult(_0x2462f9,_0x3f68b7){return function(_0x11b2eb){if(_0x11b2eb){var _0xd5f75f=typeof _0x3f68b7[_0xfa75('0x1f')]==='undefined'&&typeof _0x3f68b7[_0xfa75('0x20')]===_0xfa75('0x21');var _0x59aa5d=_0x11b2eb[_0xfa75('0x22')];var _0x15ec22=_0xd5f75f?0x0:_0x3f68b7[_0xfa75('0x1f')];var _0x44ef7d=_0xd5f75f?_0x11b2eb[_0xfa75('0x22')]:_0x3f68b7[_0xfa75('0x1f')]+_0x3f68b7[_0xfa75('0x20')];var _0x42b747;if(_0x44ef7d>=_0x59aa5d){_0x44ef7d=_0x59aa5d;_0x42b747=0xc8;}else{_0x42b747=0xce;}_0x2462f9[_0xfa75('0x1d')](_0x42b747);return _0x2462f9[_0xfa75('0x23')](_0xfa75('0x24'),_0x15ec22+'-'+_0x44ef7d+'/'+_0x59aa5d)[_0xfa75('0x1e')](_0x11b2eb);}return null;};}function patchUpdates(_0x4d64fc){return function(_0x46f82c){try{jsonpatch[_0xfa75('0x25')](_0x46f82c,_0x4d64fc,!![]);}catch(_0x5cf212){return BPromise['reject'](_0x5cf212);}return _0x46f82c[_0xfa75('0x26')]();};}function saveUpdates(_0x1c29c0,_0x22b4a7){return function(_0x3c516e){if(_0x3c516e){return _0x3c516e[_0xfa75('0x27')](_0x1c29c0)[_0xfa75('0x28')](function(_0x5e1b3b){return _0x5e1b3b;});}return null;};}function removeEntity(_0x514dc5,_0x5cc3ec){return function(_0x5f2668){if(_0x5f2668){return _0x5f2668[_0xfa75('0x29')]()[_0xfa75('0x28')](function(){var _0x384c7c=_0x5f2668[_0xfa75('0x2a')]({'plain':!![]});var _0x430b91=_0xfa75('0x2b');return db['UserProfileResource'][_0xfa75('0x29')]({'where':{'type':_0x430b91,'resourceId':_0x384c7c['id']}})[_0xfa75('0x28')](function(){return _0x5f2668;});})[_0xfa75('0x28')](function(){_0x514dc5[_0xfa75('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d062,_0x16ead9){return function(_0x26435d){if(!_0x26435d){_0x46d062[_0xfa75('0x1b')](0x194);}return _0x26435d;};}function handleError(_0x2bee23,_0x485156){_0x485156=_0x485156||0x1f4;return function(_0x2918a1){logger['error'](_0x2918a1['stack']);if(_0x2918a1[_0xfa75('0x2c')]){delete _0x2918a1['name'];}_0x2bee23['status'](_0x485156)['send'](_0x2918a1);};}exports[_0xfa75('0x2d')]=function(_0x5306d4,_0x247660){var _0x14f87b={},_0x5a81f8={},_0x57c216={'count':0x0,'rows':[]};var _0x3fccc3=_[_0xfa75('0x2e')](db[_0xfa75('0x2f')]['rawAttributes'],function(_0xda385c){return{'name':_0xda385c[_0xfa75('0x30')],'type':_0xda385c[_0xfa75('0x31')]['key']};});_0x5a81f8[_0xfa75('0x32')]=_[_0xfa75('0x2e')](_0x3fccc3,_0xfa75('0x2c'));_0x5a81f8[_0xfa75('0x33')]=_[_0xfa75('0x34')](_0x5306d4[_0xfa75('0x33')]);_0x5a81f8[_0xfa75('0x35')]=_[_0xfa75('0x36')](_0x5a81f8['model'],_0x5a81f8['query']);_0x14f87b[_0xfa75('0x37')]=_[_0xfa75('0x36')](_0x5a81f8['model'],qs['fields'](_0x5306d4[_0xfa75('0x33')][_0xfa75('0x38')]));_0x14f87b[_0xfa75('0x37')]=_0x14f87b[_0xfa75('0x37')]['length']?_0x14f87b[_0xfa75('0x37')]:_0x5a81f8[_0xfa75('0x32')];if(!_0x5306d4[_0xfa75('0x33')]['hasOwnProperty']('nolimit')){_0x14f87b[_0xfa75('0x20')]=qs['limit'](_0x5306d4[_0xfa75('0x33')][_0xfa75('0x20')]);_0x14f87b[_0xfa75('0x1f')]=qs[_0xfa75('0x1f')](_0x5306d4[_0xfa75('0x33')]['offset']);}_0x14f87b[_0xfa75('0x39')]=qs[_0xfa75('0x3a')](_0x5306d4[_0xfa75('0x33')][_0xfa75('0x3a')]);_0x14f87b['where']=qs['filters'](_['pick'](_0x5306d4['query'],_0x5a81f8[_0xfa75('0x35')]),_0x3fccc3);if(_0x5306d4[_0xfa75('0x33')][_0xfa75('0x3b')]){_0x14f87b[_0xfa75('0x3c')]=_['merge'](_0x14f87b['where'],{'$or':_[_0xfa75('0x2e')](_0x3fccc3,function(_0x382606){if(_0x382606[_0xfa75('0x31')]!=='VIRTUAL'){var _0x280968={};_0x280968[_0x382606[_0xfa75('0x2c')]]={'$like':'%'+_0x5306d4[_0xfa75('0x33')][_0xfa75('0x3b')]+'%'};return _0x280968;}})});}_0x14f87b=_[_0xfa75('0x3d')]({},_0x14f87b,_0x5306d4['options']);var _0x12af9b={'where':_0x14f87b['where']};return db['Interval'][_0xfa75('0x22')](_0x12af9b)['then'](function(_0x5ac38c){_0x57c216['count']=_0x5ac38c;if(_0x5306d4[_0xfa75('0x33')][_0xfa75('0x3e')]){_0x14f87b['include']=[{'all':!![]}];}return db[_0xfa75('0x2f')]['findAll'](_0x14f87b);})[_0xfa75('0x28')](function(_0x27e522){_0x57c216[_0xfa75('0x3f')]=_0x27e522;return _0x57c216;})[_0xfa75('0x28')](respondWithFilteredResult(_0x247660,_0x14f87b))[_0xfa75('0x40')](handleError(_0x247660,null));};exports[_0xfa75('0x41')]=function(_0x512a74,_0x50dfd0){var _0x369754={'raw':!![],'where':{'id':_0x512a74[_0xfa75('0x42')]['id']}},_0x319531={};_0x319531['model']=_[_0xfa75('0x34')](db[_0xfa75('0x2f')][_0xfa75('0x43')]);_0x319531[_0xfa75('0x33')]=_[_0xfa75('0x34')](_0x512a74[_0xfa75('0x33')]);_0x319531[_0xfa75('0x35')]=_[_0xfa75('0x36')](_0x319531['model'],_0x319531[_0xfa75('0x33')]);_0x369754[_0xfa75('0x37')]=_['intersection'](_0x319531[_0xfa75('0x32')],qs['fields'](_0x512a74[_0xfa75('0x33')]['fields']));_0x369754[_0xfa75('0x37')]=_0x369754[_0xfa75('0x37')][_0xfa75('0x44')]?_0x369754[_0xfa75('0x37')]:_0x319531[_0xfa75('0x32')];if(_0x512a74[_0xfa75('0x33')][_0xfa75('0x3e')]){_0x369754[_0xfa75('0x45')]=[{'all':!![]}];}_0x369754=_[_0xfa75('0x3d')]({},_0x369754,_0x512a74[_0xfa75('0x46')]);return db[_0xfa75('0x2f')]['find'](_0x369754)['then'](handleEntityNotFound(_0x50dfd0,null))[_0xfa75('0x28')](respondWithResult(_0x50dfd0,null))[_0xfa75('0x40')](handleError(_0x50dfd0,null));};exports[_0xfa75('0x47')]=function(_0x4dfcca,_0x5afce0){return db[_0xfa75('0x2f')][_0xfa75('0x47')](_0x4dfcca['body'],{})[_0xfa75('0x28')](function(_0x5a99db){var _0x2593d9=_0x4dfcca[_0xfa75('0x48')][_0xfa75('0x2a')]({'plain':!![]});if(!_0x2593d9)throw new Error(_0xfa75('0x49'));if(_0x2593d9['role']===_0xfa75('0x48')){var _0x450647=_0x5a99db['get']({'plain':!![]});var _0x4e99c4='Intervals';return db[_0xfa75('0x4a')][_0xfa75('0x4b')]({'where':{'name':_0x4e99c4,'userProfileId':_0x2593d9['userProfileId']},'raw':!![]})[_0xfa75('0x28')](function(_0x93322f){if(_0x93322f&&_0x93322f[_0xfa75('0x4c')]===0x0){return db[_0xfa75('0x4d')][_0xfa75('0x47')]({'name':_0x450647[_0xfa75('0x2c')],'resourceId':_0x450647['id'],'type':_0x93322f['name'],'sectionId':_0x93322f['id']},{})[_0xfa75('0x28')](function(){return _0x5a99db;});}else{return _0x5a99db;}})['catch'](function(_0x28f7e4){logger[_0xfa75('0x4e')](_0xfa75('0x4f'),_0x28f7e4);throw _0x28f7e4;});}return _0x5a99db;})['then'](respondWithResult(_0x5afce0,0xc9))[_0xfa75('0x40')](handleError(_0x5afce0,null));};exports['update']=function(_0x1945fc,_0xf4f5dd){if(_0x1945fc['body']['id']){delete _0x1945fc['body']['id'];}return db[_0xfa75('0x2f')][_0xfa75('0x4b')]({'where':{'id':_0x1945fc[_0xfa75('0x42')]['id']}})[_0xfa75('0x28')](handleEntityNotFound(_0xf4f5dd,null))[_0xfa75('0x28')](saveUpdates(_0x1945fc['body'],null))[_0xfa75('0x28')](respondWithResult(_0xf4f5dd,null))[_0xfa75('0x40')](handleError(_0xf4f5dd,null));};exports[_0xfa75('0x29')]=function(_0xc2d311,_0x292321){return db[_0xfa75('0x2f')][_0xfa75('0x4b')]({'where':{'id':_0xc2d311[_0xfa75('0x42')]['id']}})['then'](handleEntityNotFound(_0x292321,null))[_0xfa75('0x28')](removeEntity(_0x292321,null))[_0xfa75('0x40')](handleError(_0x292321,null));};exports['addInterval']=function(_0x58a791,_0x406f71,_0x332911){if(_0x58a791[_0xfa75('0x50')]['id']){delete _0x58a791['body']['id'];}return db[_0xfa75('0x2f')]['find']({'where':{'id':_0x58a791[_0xfa75('0x42')]['id']}})['then'](handleEntityNotFound(_0x406f71,null))[_0xfa75('0x28')](function(_0x151267){if(_0x151267){_0x58a791[_0xfa75('0x50')][_0xfa75('0x51')]=_0x151267['id'];return db['Interval']['create'](_0x58a791[_0xfa75('0x50')]);}})[_0xfa75('0x28')](respondWithResult(_0x406f71,null))[_0xfa75('0x40')](handleError(_0x406f71,null));};exports['getIntervals']=function(_0x4315cf,_0x5e680d,_0x4ca7c8){var _0x1cfd6f={};var _0x5825b4={};var _0x344f0c;var _0x202324;return db[_0xfa75('0x2f')][_0xfa75('0x52')]({'where':{'id':_0x4315cf[_0xfa75('0x42')]['id']}})[_0xfa75('0x28')](handleEntityNotFound(_0x5e680d,null))[_0xfa75('0x28')](function(_0x22dba8){if(_0x22dba8){_0x344f0c=_0x22dba8;_0x5825b4[_0xfa75('0x32')]=_['keys'](db[_0xfa75('0x2f')][_0xfa75('0x43')]);_0x5825b4[_0xfa75('0x33')]=_[_0xfa75('0x34')](_0x4315cf[_0xfa75('0x33')]);_0x5825b4[_0xfa75('0x35')]=_['intersection'](_0x5825b4[_0xfa75('0x32')],_0x5825b4[_0xfa75('0x33')]);_0x1cfd6f[_0xfa75('0x37')]=_[_0xfa75('0x36')](_0x5825b4['model'],qs['fields'](_0x4315cf['query']['fields']));_0x1cfd6f[_0xfa75('0x37')]=_0x1cfd6f['attributes'][_0xfa75('0x44')]?_0x1cfd6f[_0xfa75('0x37')]:_0x5825b4['model'];_0x1cfd6f[_0xfa75('0x39')]=qs[_0xfa75('0x3a')](_0x4315cf['query']['sort']);_0x1cfd6f[_0xfa75('0x3c')]=qs[_0xfa75('0x35')](_[_0xfa75('0x53')](_0x4315cf[_0xfa75('0x33')],_0x5825b4[_0xfa75('0x35')]));if(_0x4315cf[_0xfa75('0x33')]['filter']){_0x1cfd6f[_0xfa75('0x3c')]=_['merge'](_0x1cfd6f[_0xfa75('0x3c')],{'$or':_['map'](_0x1cfd6f[_0xfa75('0x37')],function(_0x38090f){var _0x1904d8={};_0x1904d8[_0x38090f]={'$like':'%'+_0x4315cf[_0xfa75('0x33')][_0xfa75('0x3b')]+'%'};return _0x1904d8;})});}_0x1cfd6f=_[_0xfa75('0x3d')]({},_0x1cfd6f,_0x4315cf[_0xfa75('0x46')]);return _0x344f0c[_0xfa75('0x54')](_0x1cfd6f);}})['then'](function(_0x345215){if(_0x345215){_0x202324=_0x345215[_0xfa75('0x44')];if(!_0x4315cf[_0xfa75('0x33')][_0xfa75('0x55')](_0xfa75('0x56'))){_0x1cfd6f['limit']=qs[_0xfa75('0x20')](_0x4315cf[_0xfa75('0x33')]['limit']);_0x1cfd6f['offset']=qs[_0xfa75('0x1f')](_0x4315cf[_0xfa75('0x33')][_0xfa75('0x1f')]);}return _0x344f0c[_0xfa75('0x54')](_0x1cfd6f);}})[_0xfa75('0x28')](function(_0x1cbd87){if(_0x1cbd87){return _0x1cbd87?{'count':_0x202324,'rows':_0x1cbd87}:null;}})['then'](respondWithResult(_0x5e680d,null))[_0xfa75('0x40')](handleError(_0x5e680d,null));};exports[_0xfa75('0x57')]=function(_0x5a3bc9,_0xced657,_0x1414b0){return db['Interval']['findOne']({'where':{'id':_0x5a3bc9[_0xfa75('0x42')]['id']}})[_0xfa75('0x28')](handleEntityNotFound(_0xced657,null))[_0xfa75('0x28')](function(_0x5d894e){if(_0x5d894e){return db['sequelize'][_0xfa75('0x58')](function(_0x4f1d30){return db['Interval'][_0xfa75('0x29')]({'where':{'IntervalId':_0x5a3bc9[_0xfa75('0x42')]['id']},'transaction':_0x4f1d30})[_0xfa75('0x28')](function(_0x424fb8){var _0x6d2460=_['map'](_0x5a3bc9[_0xfa75('0x50')],function(_0x301f6b){delete _0x301f6b['id'];_0x301f6b[_0xfa75('0x51')]=_0x5a3bc9['params']['id'];return _0x301f6b;});return db[_0xfa75('0x2f')][_0xfa75('0x59')](_0x6d2460,{'transaction':_0x4f1d30});});})[_0xfa75('0x28')](function(){return db[_0xfa75('0x2f')][_0xfa75('0x5a')]({'where':{'IntervalId':_0x5a3bc9[_0xfa75('0x42')]['id']}});});}})[_0xfa75('0x28')](respondWithResult(_0xced657,null))[_0xfa75('0x40')](handleError(_0xced657,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 40bf35b..d9232c4 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 _0x6e67=['api','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util'];(function(_0x54d7bf,_0x3958e7){var _0x3d1d1c=function(_0x3c40e2){while(--_0x3c40e2){_0x54d7bf['push'](_0x54d7bf['shift']());}};_0x3d1d1c(++_0x3958e7);}(_0x6e67,0x136));var _0x76e6=function(_0x13ec2b,_0x40b664){_0x13ec2b=_0x13ec2b-0x0;var _0x1fb3f4=_0x6e67[_0x13ec2b];return _0x1fb3f4;};'use strict';var _=require(_0x76e6('0x0'));var util=require(_0x76e6('0x1'));var logger=require('../../config/logger')(_0x76e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e6('0x3'));var rimraf=require(_0x76e6('0x4'));var config=require('../../config/environment');var attributes=require(_0x76e6('0x5'));var extensions=require(_0x76e6('0x6'));module[_0x76e6('0x7')]=function(_0x4f9761,_0x2ffa7f){return _0x4f9761[_0x76e6('0x8')](_0x76e6('0x9'),attributes,{'tableName':_0x76e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x13e5da,_0x35292a){extensions[_0x76e6('0xb')](_0x4f9761,_0x13e5da);},'afterBulkCreate':function(_0x380cd2,_0x27b208,_0x152bd1){_0x152bd1();extensions[_0x76e6('0xb')](_0x4f9761,_0x380cd2[0x0]);},'afterUpdate':function(_0x26d408,_0x3551ef){extensions[_0x76e6('0xb')](_0x4f9761,_0x26d408);},'afterDestroy':function(_0x5d7568,_0x49c142){extensions['rewrite'](_0x4f9761,_0x5d7568);}}});}; \ No newline at end of file +var _0xee68=['api','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','rewrite','lodash','util','../../config/logger'];(function(_0x842ccf,_0x520934){var _0x337e01=function(_0x55e24f){while(--_0x55e24f){_0x842ccf['push'](_0x842ccf['shift']());}};_0x337e01(++_0x520934);}(_0xee68,0x1aa));var _0x8ee6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xee68[_0x432682];return _0x463d05;};'use strict';var _=require(_0x8ee6('0x0'));var util=require(_0x8ee6('0x1'));var logger=require(_0x8ee6('0x2'))(_0x8ee6('0x3'));var moment=require('moment');var BPromise=require(_0x8ee6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ee6('0x5'));var rimraf=require(_0x8ee6('0x6'));var config=require(_0x8ee6('0x7'));var attributes=require(_0x8ee6('0x8'));var extensions=require(_0x8ee6('0x9'));module['exports']=function(_0x43b4c4,_0x3faf19){return _0x43b4c4[_0x8ee6('0xa')](_0x8ee6('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ecf20,_0x1ff444){extensions[_0x8ee6('0xc')](_0x43b4c4,_0x3ecf20);},'afterBulkCreate':function(_0x4795ae,_0x5c518d,_0x229fcd){_0x229fcd();extensions[_0x8ee6('0xc')](_0x43b4c4,_0x4795ae[0x0]);},'afterUpdate':function(_0x18f159,_0xec4dfe){extensions[_0x8ee6('0xc')](_0x43b4c4,_0x18f159);},'afterDestroy':function(_0x135ea4,_0xe24e1b){extensions[_0x8ee6('0xc')](_0x43b4c4,_0x135ea4);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index ae74e59..42fa2f6 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(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 c7b68a6..6c6257b 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x566a17,_0x8609ba){var _0x3300b6=function(_0x185753){while(--_0x185753){_0x566a17['push'](_0x566a17['shift']());}};_0x3300b6(++_0x8609ba);}(_0x2032,0xd9));var _0x2203=function(_0x1cafed,_0x939a38){_0x1cafed=_0x1cafed-0x0;var _0x4f1d82=_0x2032[_0x1cafed];return _0x4f1d82;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x85dae1,_0x195b80){var _0x675b89=function(_0x5118b9){while(--_0x5118b9){_0x85dae1['push'](_0x85dae1['shift']());}};_0x675b89(++_0x195b80);}(_0x2032,0xd9));var _0x2203=function(_0x5ec5d3,_0x1226c5){_0x5ec5d3=_0x5ec5d3-0x0;var _0x276f7e=_0x2032[_0x5ec5d3];return _0x276f7e;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index c28a49a..ff46a6b 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 _0x0f07=['fields','customfield_11500','email','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','status','api.jira','write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','stringify','Bug'];(function(_0x2742a1,_0x35cb66){var _0x73f864=function(_0x32fae7){while(--_0x32fae7){_0x2742a1['push'](_0x2742a1['shift']());}};_0x73f864(++_0x35cb66);}(_0x0f07,0xab));var _0x70f0=function(_0x403e02,_0x4f25e2){_0x403e02=_0x403e02-0x0;var _0x36919c=_0x0f07[_0x403e02];return _0x36919c;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x70f0('0x0'))(_0x70f0('0x1'));var USERNAME='support';var PASSWORD=_0x70f0('0x2');function openIssue(_0x35c901,_0x39ffc1){var _0x3af016={'fields':{'project':{'key':_0x35c901[_0x70f0('0x3')]||_0x70f0('0x4')},'summary':(_0x35c901[_0x70f0('0x5')]||'Report')+_0x70f0('0x6')+_0x35c901['ip'],'description':_0x35c901['description']||JSON[_0x70f0('0x7')](_0x35c901),'issuetype':{'name':_0x35c901['issuetype']||_0x70f0('0x8')}}};_0x3af016[_0x70f0('0x9')][_0x70f0('0xa')]=_0x35c901[_0x70f0('0xb')];_0x3af016[_0x70f0('0x9')]['customfield_11501']=_0x35c901[_0x70f0('0xc')];_0x3af016['fields'][_0x70f0('0xd')]=_0x35c901[_0x70f0('0xe')];_0x3af016[_0x70f0('0x9')][_0x70f0('0xf')]=_0x35c901[_0x70f0('0x10')];_0x3af016[_0x70f0('0x9')][_0x70f0('0x11')]=_0x35c901[_0x70f0('0x12')];_0x3af016[_0x70f0('0x9')][_0x70f0('0x13')]=_0x35c901['ip'];var _0x2cbddf={'host':_0x70f0('0x14'),'port':0x1bb,'path':_0x70f0('0x15'),'method':_0x70f0('0x16'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x70f0('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x70f0('0x18')](_0x70f0('0x19'))}};var _0x1c47dd=JSON['stringify'](_0x3af016);var _0x452b1d=https[_0x70f0('0x1a')](_0x2cbddf,function(_0x6b04c3){_0x6b04c3[_0x70f0('0x1b')](_0x70f0('0x1c'));var _0x248b8f='';_0x6b04c3['on'](_0x70f0('0x1d'),function(_0x538b02){_0x248b8f+=_0x538b02;});_0x6b04c3['on'](_0x70f0('0x1e'),function(){if(_0x39ffc1){return _0x39ffc1['status'](_0x6b04c3[_0x70f0('0x1f')])[_0x70f0('0x20')](JSON[_0x70f0('0x21')](_0x248b8f));}});});_0x452b1d['on']('error',function(_0x41015b){if(_0x39ffc1){return _0x39ffc1[_0x70f0('0x22')](0x1f4)[_0x70f0('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x70f0('0x23')}]});}});_0x452b1d[_0x70f0('0x24')](_0x1c47dd);_0x452b1d['end']();}exports[_0x70f0('0x25')]=openIssue;exports[_0x70f0('0x26')]=function(_0xf8cc6c,_0x33076c){_0xf8cc6c['body']['ip']=_0xf8cc6c[_0x70f0('0x27')][_0x70f0('0x28')]||_0xf8cc6c[_0x70f0('0x29')][_0x70f0('0x2a')]||_0xf8cc6c['socket'][_0x70f0('0x2a')]||_0xf8cc6c['connection'][_0x70f0('0x2b')][_0x70f0('0x2a')];return openIssue(_0xf8cc6c[_0x70f0('0x2c')],_0x33076c);}; \ No newline at end of file +var _0xdb48=['stringify','setEncoding','utf8','data','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','Bug','fields','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','track.xcallymotion.com','/rest/api/2/issue','toString'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0xdb48,0x1b3));var _0x8db4=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xdb48[_0x266618];return _0x54dbf5;};'use strict';var BPromise=require(_0x8db4('0x0'));var https=require('https');var logger=require(_0x8db4('0x1'))(_0x8db4('0x2'));var USERNAME=_0x8db4('0x3');var PASSWORD=_0x8db4('0x4');function openIssue(_0x376a6f,_0x31eaf8){var _0x279e5b={'fields':{'project':{'key':_0x376a6f[_0x8db4('0x5')]||'MOTGUI'},'summary':(_0x376a6f[_0x8db4('0x6')]||_0x8db4('0x7'))+_0x8db4('0x8')+_0x376a6f['ip'],'description':_0x376a6f[_0x8db4('0x9')]||JSON['stringify'](_0x376a6f),'issuetype':{'name':_0x376a6f['issuetype']||_0x8db4('0xa')}}};_0x279e5b[_0x8db4('0xb')]['customfield_11500']=_0x376a6f['email'];_0x279e5b['fields'][_0x8db4('0xc')]=_0x376a6f['oldToken'];_0x279e5b[_0x8db4('0xb')][_0x8db4('0xd')]=_0x376a6f[_0x8db4('0xe')];_0x279e5b[_0x8db4('0xb')][_0x8db4('0xf')]=_0x376a6f[_0x8db4('0x10')];_0x279e5b[_0x8db4('0xb')][_0x8db4('0x11')]=_0x376a6f['reason'];_0x279e5b['fields']['customfield_10102']=_0x376a6f['ip'];var _0x1345ee={'host':_0x8db4('0x12'),'port':0x1bb,'path':_0x8db4('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x8db4('0x14')]('base64')}};var _0x287b56=JSON[_0x8db4('0x15')](_0x279e5b);var _0x126eca=https['request'](_0x1345ee,function(_0x10a7dd){_0x10a7dd[_0x8db4('0x16')](_0x8db4('0x17'));var _0xf3cd0f='';_0x10a7dd['on'](_0x8db4('0x18'),function(_0x55f918){_0xf3cd0f+=_0x55f918;});_0x10a7dd['on']('end',function(){if(_0x31eaf8){return _0x31eaf8['status'](_0x10a7dd[_0x8db4('0x19')])[_0x8db4('0x1a')](JSON[_0x8db4('0x1b')](_0xf3cd0f));}});});_0x126eca['on'](_0x8db4('0x1c'),function(_0x562655){if(_0x31eaf8){return _0x31eaf8[_0x8db4('0x1d')](0x1f4)[_0x8db4('0x1a')]({'errors':[{'message':_0x8db4('0x1e'),'type':_0x8db4('0x1f')}]});}});_0x126eca['write'](_0x287b56);_0x126eca['end']();}exports[_0x8db4('0x20')]=openIssue;exports['send']=function(_0x507825,_0x146bbd){_0x507825[_0x8db4('0x21')]['ip']=_0x507825['headers'][_0x8db4('0x22')]||_0x507825[_0x8db4('0x23')][_0x8db4('0x24')]||_0x507825[_0x8db4('0x25')][_0x8db4('0x24')]||_0x507825[_0x8db4('0x23')][_0x8db4('0x25')]['remoteAddress'];return openIssue(_0x507825['body'],_0x146bbd);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 16be97b..ebc2f35 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 _0x6f0d=['post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','show'];(function(_0x43cf9d,_0x20a6e0){var _0x21eebf=function(_0xa70213){while(--_0xa70213){_0x43cf9d['push'](_0x43cf9d['shift']());}};_0x21eebf(++_0x20a6e0);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1758d0,_0x3dcb16){_0x1758d0=_0x1758d0-0x0;var _0x3b9152=_0x6f0d[_0x1758d0];return _0x3b9152;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xe')]('/',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);router['put'](_0xd6f0('0x10'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x11')]);router[_0xd6f0('0x12')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x13')]);module[_0xd6f0('0x14')]=router; \ No newline at end of file +var _0xb821=['../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','Router','../../components/interaction/service'];(function(_0xa50693,_0x87d311){var _0x28a0e2=function(_0x6a2ac5){while(--_0x6a2ac5){_0xa50693['push'](_0xa50693['shift']());}};_0x28a0e2(++_0x87d311);}(_0xb821,0xa7));var _0x1b82=function(_0x16ec2a,_0x4e5213){_0x16ec2a=_0x16ec2a-0x0;var _0x27bdd7=_0xb821[_0x16ec2a];return _0x27bdd7;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x6')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xc')]);router['post']('/',auth[_0x1b82('0x9')](),controller[_0x1b82('0xd')]);router[_0x1b82('0xe')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xf')]);router[_0x1b82('0x10')](_0x1b82('0xb'),auth['isAuthenticated'](),controller[_0x1b82('0x11')]);module[_0x1b82('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index d2e53a8..a4e91c9 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x56f5ee,_0x1b2b0b){_0x56f5ee=_0x56f5ee-0x0;var _0x414019=_0x7a54[_0x56f5ee];return _0x414019;};'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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x34a284,_0x582fa0){_0x34a284=_0x34a284-0x0;var _0x3f4319=_0x7a54[_0x34a284];return _0x3f4319;};'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 0a0299e..03ba607 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 _0xfc76=['send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','end','error','stack','name'];(function(_0x543c47,_0x3ffd9c){var _0x20761d=function(_0x3879e3){while(--_0x3879e3){_0x543c47['push'](_0x543c47['shift']());}};_0x20761d(++_0x3ffd9c);}(_0xfc76,0xb5));var _0x6fc7=function(_0x5b77f8,_0x235891){_0x5b77f8=_0x5b77f8-0x0;var _0x230844=_0xfc76[_0x5b77f8];return _0x230844;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fc7('0x0'));var zipdir=require(_0x6fc7('0x1'));var jsonpatch=require(_0x6fc7('0x2'));var rp=require(_0x6fc7('0x3'));var moment=require(_0x6fc7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6fc7('0x5'));var util=require(_0x6fc7('0x6'));var path=require('path');var sox=require(_0x6fc7('0x7'));var csv=require('to-csv');var ejs=require(_0x6fc7('0x8'));var fs=require('fs');var fs_extra=require(_0x6fc7('0x9'));var _=require(_0x6fc7('0xa'));var squel=require('squel');var crypto=require(_0x6fc7('0xb'));var jsforce=require(_0x6fc7('0xc'));var deskjs=require(_0x6fc7('0xd'));var toCsv=require(_0x6fc7('0xe'));var querystring=require(_0x6fc7('0xf'));var Papa=require(_0x6fc7('0x10'));var Redis=require('ioredis');var authService=require(_0x6fc7('0x11'));var qs=require(_0x6fc7('0x12'));var as=require(_0x6fc7('0x13'));var hardwareService=require(_0x6fc7('0x14'));var logger=require(_0x6fc7('0x15'))(_0x6fc7('0x16'));var utils=require('../../config/utils');var config=require(_0x6fc7('0x17'));var licenseUtil=require(_0x6fc7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x433adc,_0x2c32b8){_0x2c32b8=_0x2c32b8||0xcc;return function(_0x5f438d){if(_0x5f438d){return _0x433adc[_0x6fc7('0x19')](_0x2c32b8);}return _0x433adc[_0x6fc7('0x1a')](_0x2c32b8)['end']();};}function respondWithResult(_0x44d8e0,_0x3c107f){_0x3c107f=_0x3c107f||0xc8;return function(_0x10a482){if(_0x10a482){return _0x44d8e0['status'](_0x3c107f)['json'](_0x10a482);}};}function respondWithFilteredResult(_0xbb4a3e,_0x45d585){return function(_0x499bcc){if(_0x499bcc){var _0x2b0122=typeof _0x45d585[_0x6fc7('0x1b')]===_0x6fc7('0x1c')&&typeof _0x45d585[_0x6fc7('0x1d')]==='undefined';var _0x816704=_0x499bcc[_0x6fc7('0x1e')];var _0x280c69=_0x2b0122?0x0:_0x45d585[_0x6fc7('0x1b')];var _0x12be21=_0x2b0122?_0x499bcc[_0x6fc7('0x1e')]:_0x45d585['offset']+_0x45d585[_0x6fc7('0x1d')];var _0x124893;if(_0x12be21>=_0x816704){_0x12be21=_0x816704;_0x124893=0xc8;}else{_0x124893=0xce;}_0xbb4a3e[_0x6fc7('0x1a')](_0x124893);return _0xbb4a3e[_0x6fc7('0x1f')](_0x6fc7('0x20'),_0x280c69+'-'+_0x12be21+'/'+_0x816704)['json'](_0x499bcc);}return null;};}function patchUpdates(_0x277f9e){return function(_0x2427a){try{jsonpatch['apply'](_0x2427a,_0x277f9e,!![]);}catch(_0x17b9e3){return BPromise['reject'](_0x17b9e3);}return _0x2427a[_0x6fc7('0x21')]();};}function saveUpdates(_0x4f583c,_0x11b359){return function(_0xdb5974){if(_0xdb5974){return _0xdb5974[_0x6fc7('0x22')](_0x4f583c)['then'](function(_0x45e53e){return _0x45e53e;});}return null;};}function removeEntity(_0x4a4cdf,_0x2dd21a){return function(_0xdd4827){if(_0xdd4827){return _0xdd4827[_0x6fc7('0x23')]()[_0x6fc7('0x24')](function(){_0x4a4cdf[_0x6fc7('0x1a')](0xcc)[_0x6fc7('0x25')]();});}};}function handleEntityNotFound(_0x190680,_0x817221){return function(_0x2b6b55){if(!_0x2b6b55){_0x190680[_0x6fc7('0x19')](0x194);}return _0x2b6b55;};}function handleError(_0xaa2687,_0x426872){_0x426872=_0x426872||0x1f4;return function(_0x4612d4){logger[_0x6fc7('0x26')](_0x4612d4[_0x6fc7('0x27')]);if(_0x4612d4['name']){delete _0x4612d4[_0x6fc7('0x28')];}_0xaa2687[_0x6fc7('0x1a')](_0x426872)[_0x6fc7('0x29')](_0x4612d4);};}exports[_0x6fc7('0x2a')]=function(_0x5c1fd3,_0xfff989){var _0x30e579={},_0xa93a4f={},_0x2aa91c={'count':0x0,'rows':[]};var _0x34bf7f=_[_0x6fc7('0x2b')](db[_0x6fc7('0x2c')][_0x6fc7('0x2d')],function(_0x59a70e){return{'name':_0x59a70e['fieldName'],'type':_0x59a70e[_0x6fc7('0x2e')][_0x6fc7('0x2f')]};});_0xa93a4f[_0x6fc7('0x30')]=_[_0x6fc7('0x2b')](_0x34bf7f,_0x6fc7('0x28'));_0xa93a4f[_0x6fc7('0x31')]=_['keys'](_0x5c1fd3[_0x6fc7('0x31')]);_0xa93a4f[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](_0xa93a4f[_0x6fc7('0x30')],_0xa93a4f['query']);_0x30e579['attributes']=_['intersection'](_0xa93a4f[_0x6fc7('0x30')],qs[_0x6fc7('0x34')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x34')]));_0x30e579[_0x6fc7('0x35')]=_0x30e579[_0x6fc7('0x35')][_0x6fc7('0x36')]?_0x30e579[_0x6fc7('0x35')]:_0xa93a4f[_0x6fc7('0x30')];if(!_0x5c1fd3['query'][_0x6fc7('0x37')]('nolimit')){_0x30e579[_0x6fc7('0x1d')]=qs[_0x6fc7('0x1d')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x1d')]);_0x30e579['offset']=qs[_0x6fc7('0x1b')](_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x1b')]);}_0x30e579[_0x6fc7('0x38')]=qs['sort'](_0x5c1fd3[_0x6fc7('0x31')]['sort']);_0x30e579[_0x6fc7('0x39')]=qs['filters'](_['pick'](_0x5c1fd3['query'],_0xa93a4f[_0x6fc7('0x32')]),_0x34bf7f);if(_0x5c1fd3['query'][_0x6fc7('0x3a')]){_0x30e579[_0x6fc7('0x39')]=_[_0x6fc7('0x3b')](_0x30e579[_0x6fc7('0x39')],{'$or':_[_0x6fc7('0x2b')](_0x34bf7f,function(_0xc1fbf7){if(_0xc1fbf7[_0x6fc7('0x2e')]!==_0x6fc7('0x3c')){var _0x18e6f7={};_0x18e6f7[_0xc1fbf7[_0x6fc7('0x28')]]={'$like':'%'+_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x3a')]+'%'};return _0x18e6f7;}})});}_0x30e579=_[_0x6fc7('0x3b')]({},_0x30e579,_0x5c1fd3[_0x6fc7('0x3d')]);var _0x3ac76e={'where':_0x30e579[_0x6fc7('0x39')]};return db[_0x6fc7('0x2c')][_0x6fc7('0x1e')](_0x3ac76e)['then'](function(_0x490f2e){_0x2aa91c[_0x6fc7('0x1e')]=_0x490f2e;if(_0x5c1fd3[_0x6fc7('0x31')][_0x6fc7('0x3e')]){_0x30e579[_0x6fc7('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6fc7('0x40')](_0x30e579);})[_0x6fc7('0x24')](function(_0x27f6dc){_0x2aa91c[_0x6fc7('0x41')]=_0x27f6dc;return _0x2aa91c;})[_0x6fc7('0x24')](respondWithFilteredResult(_0xfff989,_0x30e579))[_0x6fc7('0x42')](handleError(_0xfff989,null));};exports[_0x6fc7('0x43')]=function(_0x4754da,_0x1e33cd){var _0x2d8ca4={'raw':!![],'where':{'id':_0x4754da[_0x6fc7('0x44')]['id']}},_0x20bc07={};_0x20bc07['model']=_[_0x6fc7('0x45')](db[_0x6fc7('0x2c')]['rawAttributes']);_0x20bc07[_0x6fc7('0x31')]=_[_0x6fc7('0x45')](_0x4754da[_0x6fc7('0x31')]);_0x20bc07[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](_0x20bc07[_0x6fc7('0x30')],_0x20bc07[_0x6fc7('0x31')]);_0x2d8ca4[_0x6fc7('0x35')]=_[_0x6fc7('0x33')](_0x20bc07[_0x6fc7('0x30')],qs['fields'](_0x4754da[_0x6fc7('0x31')][_0x6fc7('0x34')]));_0x2d8ca4['attributes']=_0x2d8ca4['attributes'][_0x6fc7('0x36')]?_0x2d8ca4[_0x6fc7('0x35')]:_0x20bc07[_0x6fc7('0x30')];if(_0x4754da['query'][_0x6fc7('0x3e')]){_0x2d8ca4[_0x6fc7('0x3f')]=[{'all':!![]}];}_0x2d8ca4=_['merge']({},_0x2d8ca4,_0x4754da[_0x6fc7('0x3d')]);return db[_0x6fc7('0x2c')][_0x6fc7('0x46')](_0x2d8ca4)[_0x6fc7('0x24')](handleEntityNotFound(_0x1e33cd,null))[_0x6fc7('0x24')](respondWithResult(_0x1e33cd,null))[_0x6fc7('0x42')](handleError(_0x1e33cd,null));};exports[_0x6fc7('0x47')]=function(_0xb6cf9b,_0x357d7a){return db[_0x6fc7('0x2c')][_0x6fc7('0x47')](_0xb6cf9b['body'],{})['then'](respondWithResult(_0x357d7a,0xc9))['catch'](handleError(_0x357d7a,null));};exports['update']=function(_0x22a0c5,_0x5d4d40){if(_0x22a0c5[_0x6fc7('0x48')]['id']){delete _0x22a0c5[_0x6fc7('0x48')]['id'];}return db[_0x6fc7('0x2c')][_0x6fc7('0x46')]({'where':{'id':_0x22a0c5[_0x6fc7('0x44')]['id']}})[_0x6fc7('0x24')](handleEntityNotFound(_0x5d4d40,null))['then'](saveUpdates(_0x22a0c5[_0x6fc7('0x48')],null))[_0x6fc7('0x24')](respondWithResult(_0x5d4d40,null))['catch'](handleError(_0x5d4d40,null));};exports[_0x6fc7('0x23')]=function(_0x24bf3e,_0x3b2506){return db[_0x6fc7('0x2c')][_0x6fc7('0x46')]({'where':{'id':_0x24bf3e[_0x6fc7('0x44')]['id']}})[_0x6fc7('0x24')](handleEntityNotFound(_0x3b2506,null))[_0x6fc7('0x24')](removeEntity(_0x3b2506,null))[_0x6fc7('0x42')](handleError(_0x3b2506,null));};exports[_0x6fc7('0x49')]=function(_0x4ced40,_0x4684bd){return db[_0x6fc7('0x2c')][_0x6fc7('0x49')]()['then'](respondWithResult(_0x4684bd,null))[_0x6fc7('0x42')](handleError(_0x4684bd,null));}; \ No newline at end of file +var _0x7fbe=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x4a9dc8,_0x7a4302){var _0x41116c=function(_0x25d0dc){while(--_0x25d0dc){_0x4a9dc8['push'](_0x4a9dc8['shift']());}};_0x41116c(++_0x7a4302);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1c4903,_0x2c8ecd){_0x1c4903=_0x1c4903-0x0;var _0x1f0af5=_0x7fbe[_0x1c4903];return _0x1f0af5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['map'](_0x219554,_0xe7fb('0x32'));_0xd3fffe['query']=_[_0xe7fb('0x33')](_0x4fd290[_0xe7fb('0x34')]);_0xd3fffe[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0xd3fffe['model'],_0xd3fffe[_0xe7fb('0x34')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x36')](_0xd3fffe[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x4fd290['query'][_0xe7fb('0x39')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x38')];if(!_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3b')](_0xe7fb('0x3c'))){_0x251807['limit']=qs[_0xe7fb('0x20')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x20')]);_0x251807['offset']=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3e')]);_0x251807[_0xe7fb('0x3f')]=qs[_0xe7fb('0x35')](_[_0xe7fb('0x40')](_0x4fd290[_0xe7fb('0x34')],_0xd3fffe[_0xe7fb('0x35')]),_0x219554);if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x41')]){_0x251807[_0xe7fb('0x3f')]=_[_0xe7fb('0x42')](_0x251807[_0xe7fb('0x3f')],{'$or':_[_0xe7fb('0x2c')](_0x219554,function(_0x21e35c){if(_0x21e35c['type']!==_0xe7fb('0x43')){var _0x23f9f9={};_0x23f9f9[_0x21e35c[_0xe7fb('0x32')]]={'$like':'%'+_0x4fd290[_0xe7fb('0x34')]['filter']+'%'};return _0x23f9f9;}})});}_0x251807=_[_0xe7fb('0x42')]({},_0x251807,_0x4fd290[_0xe7fb('0x44')]);var _0xd472d={'where':_0x251807[_0xe7fb('0x3f')]};return db['JscriptyAnswerReport'][_0xe7fb('0x21')](_0xd472d)[_0xe7fb('0x26')](function(_0x34265f){_0x5f265f[_0xe7fb('0x21')]=_0x34265f;if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x45')]){_0x251807['include']=[{'all':!![]}];}return db[_0xe7fb('0x2d')][_0xe7fb('0x46')](_0x251807);})[_0xe7fb('0x26')](function(_0x4b263d){_0x5f265f[_0xe7fb('0x47')]=_0x4b263d;return _0x5f265f;})[_0xe7fb('0x26')](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5a01ae,_0x5ed3d4){var _0x5e0153={'raw':!![],'where':{'id':_0x5a01ae[_0xe7fb('0x48')]['id']}},_0x900d67={};_0x900d67[_0xe7fb('0x38')]=_['keys'](db[_0xe7fb('0x2d')]['rawAttributes']);_0x900d67[_0xe7fb('0x34')]=_[_0xe7fb('0x33')](_0x5a01ae['query']);_0x900d67[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],_0x900d67[_0xe7fb('0x34')]);_0x5e0153['attributes']=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x5a01ae['query'][_0xe7fb('0x39')]));_0x5e0153[_0xe7fb('0x37')]=_0x5e0153[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x5e0153[_0xe7fb('0x37')]:_0x900d67['model'];if(_0x5a01ae[_0xe7fb('0x34')]['includeAll']){_0x5e0153[_0xe7fb('0x49')]=[{'all':!![]}];}_0x5e0153=_[_0xe7fb('0x42')]({},_0x5e0153,_0x5a01ae[_0xe7fb('0x44')]);return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')](_0x5e0153)['then'](handleEntityNotFound(_0x5ed3d4,null))[_0xe7fb('0x26')](respondWithResult(_0x5ed3d4,null))['catch'](handleError(_0x5ed3d4,null));};exports['create']=function(_0x12c828,_0x3d740f){return db[_0xe7fb('0x2d')]['create'](_0x12c828[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](respondWithResult(_0x3d740f,0xc9))['catch'](handleError(_0x3d740f,null));};exports['update']=function(_0x284bcb,_0x42270b){if(_0x284bcb[_0xe7fb('0x4b')]['id']){delete _0x284bcb[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')]({'where':{'id':_0x284bcb[_0xe7fb('0x48')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x42270b,null))['then'](saveUpdates(_0x284bcb[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x42270b,null))[_0xe7fb('0x4c')](handleError(_0x42270b,null));};exports[_0xe7fb('0x4d')]=function(_0x5cedfb,_0x25347b){return db['JscriptyAnswerReport'][_0xe7fb('0x4a')]({'where':{'id':_0x5cedfb['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x25347b,null))['then'](removeEntity(_0x25347b,null))[_0xe7fb('0x4c')](handleError(_0x25347b,null));};exports['describe']=function(_0x1fff6c,_0x1b6442){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x1b6442,null))[_0xe7fb('0x4c')](handleError(_0x1b6442,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 28e6e82..46893ce 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 _0x2402=['path','rimraf','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3062da,_0x352b8f){var _0x1c95ba=function(_0x203c3e){while(--_0x203c3e){_0x3062da['push'](_0x3062da['shift']());}};_0x1c95ba(++_0x352b8f);}(_0x2402,0x88));var _0x2240=function(_0x3a1cb5,_0x337c7a){_0x3a1cb5=_0x3a1cb5-0x0;var _0x55f4ae=_0x2402[_0x3a1cb5];return _0x55f4ae;};'use strict';var _=require(_0x2240('0x0'));var util=require(_0x2240('0x1'));var logger=require(_0x2240('0x2'))(_0x2240('0x3'));var moment=require(_0x2240('0x4'));var BPromise=require(_0x2240('0x5'));var rp=require(_0x2240('0x6'));var fs=require('fs');var path=require(_0x2240('0x7'));var rimraf=require(_0x2240('0x8'));var config=require('../../config/environment');var attributes=require(_0x2240('0x9'));module[_0x2240('0xa')]=function(_0x5c9bce,_0x14359f){return _0x5c9bce['define'](_0x2240('0xb'),attributes,{'tableName':_0x2240('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3073=['moment','path','rimraf','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3073,0x1a4));var _0x3307=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x3073[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x3307('0x0'));var util=require(_0x3307('0x1'));var logger=require(_0x3307('0x2'))('api');var moment=require(_0x3307('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3307('0x4'));var rimraf=require(_0x3307('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x3307('0x6')]=function(_0x2dbd19,_0x3341fc){return _0x2dbd19['define'](_0x3307('0x7'),attributes,{'tableName':_0x3307('0x8'),'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 b172eee..c57dd4b 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 _0xe8dd=['stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0xe8dd,0x91));var _0xde8d=function(_0x162fed,_0x57630e){_0x162fed=_0x162fed-0x0;var _0x5df66e=_0xe8dd[_0x162fed];return _0x5df66e;};'use strict';var _=require('lodash');var util=require(_0xde8d('0x0'));var moment=require(_0xde8d('0x1'));var BPromise=require(_0xde8d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde8d('0x3'));var db=require(_0xde8d('0x4'))['db'];var utils=require(_0xde8d('0x5'));var logger=require(_0xde8d('0x6'))(_0xde8d('0x7'));var config=require('../../config/environment');var jayson=require(_0xde8d('0x8'));var client=jayson[_0xde8d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x201fa1,_0x4d1e5,_0x111ccc){return new BPromise(function(_0x19f23d,_0x5bf34e){return client[_0xde8d('0xa')](_0x201fa1,_0x111ccc)[_0xde8d('0xb')](function(_0x512415){logger[_0xde8d('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4d1e5,'request\x20sent');logger[_0xde8d('0xd')](_0xde8d('0xe'),_0x4d1e5,_0xde8d('0xf'),JSON[_0xde8d('0x10')](_0x512415));if(_0x512415['error']){if(_0x512415[_0xde8d('0x11')][_0xde8d('0x12')]===0x1f4){logger[_0xde8d('0x11')](_0xde8d('0x13'),_0x4d1e5,_0x512415[_0xde8d('0x11')][_0xde8d('0x14')]);return _0x5bf34e(_0x512415[_0xde8d('0x11')][_0xde8d('0x14')]);}logger[_0xde8d('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4d1e5,_0x512415['error'][_0xde8d('0x14')]);return _0x19f23d(_0x512415[_0xde8d('0x11')][_0xde8d('0x14')]);}else{logger['info'](_0xde8d('0x13'),_0x4d1e5,_0xde8d('0xf'));_0x19f23d(_0x512415[_0xde8d('0x15')][_0xde8d('0x14')]);}})[_0xde8d('0x16')](function(_0x3233ca){logger[_0xde8d('0x11')](_0xde8d('0x13'),_0x4d1e5,_0x3233ca);_0x5bf34e(_0x3233ca);});});} \ No newline at end of file +var _0xc206=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc206,0x18d));var _0x6c20=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0xc206[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x6c20('0x0'));var util=require(_0x6c20('0x1'));var moment=require(_0x6c20('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c20('0x3'));var db=require(_0x6c20('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6c20('0x5'));var config=require(_0x6c20('0x6'));var jayson=require(_0x6c20('0x7'));var client=jayson[_0x6c20('0x8')][_0x6c20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407ff7,_0x5527d4,_0x797770){return new BPromise(function(_0x483bf2,_0x55bc1e){return client['request'](_0x407ff7,_0x797770)[_0x6c20('0xa')](function(_0x496013){logger[_0x6c20('0xb')](_0x6c20('0xc'),_0x5527d4,_0x6c20('0xd'));logger['debug'](_0x6c20('0xe'),_0x5527d4,_0x6c20('0xd'),JSON['stringify'](_0x496013));if(_0x496013[_0x6c20('0xf')]){if(_0x496013[_0x6c20('0xf')][_0x6c20('0x10')]===0x1f4){logger[_0x6c20('0xf')](_0x6c20('0xc'),_0x5527d4,_0x496013[_0x6c20('0xf')][_0x6c20('0x11')]);return _0x55bc1e(_0x496013[_0x6c20('0xf')]['message']);}logger['error'](_0x6c20('0xc'),_0x5527d4,_0x496013[_0x6c20('0xf')][_0x6c20('0x11')]);return _0x483bf2(_0x496013['error']['message']);}else{logger['info'](_0x6c20('0xc'),_0x5527d4,'request\x20sent');_0x483bf2(_0x496013[_0x6c20('0x12')][_0x6c20('0x11')]);}})[_0x6c20('0x13')](function(_0x1c2815){logger[_0x6c20('0xf')](_0x6c20('0xc'),_0x5527d4,_0x1c2815);_0x55bc1e(_0x1c2815);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 1bde692..cbb4c8f 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 _0x7955=['create','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getSessions','/:id/answers','getAnswers','30s','getSummary'];(function(_0x26ce01,_0x323d0e){var _0x4fcfe0=function(_0xe05701){while(--_0xe05701){_0x26ce01['push'](_0x26ce01['shift']());}};_0x4fcfe0(++_0x323d0e);}(_0x7955,0x1ef));var _0x5795=function(_0x394c2c,_0x44c3fa){_0x394c2c=_0x394c2c-0x0;var _0x1fe17a=_0x7955[_0x394c2c];return _0x1fe17a;};'use strict';var multer=require(_0x5795('0x0'));var util=require(_0x5795('0x1'));var path=require(_0x5795('0x2'));var timeout=require(_0x5795('0x3'));var express=require(_0x5795('0x4'));var router=express[_0x5795('0x5')]();var fs_extra=require(_0x5795('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5795('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x5795('0x8')]('/',auth[_0x5795('0x9')](),controller[_0x5795('0xa')]);router[_0x5795('0x8')](_0x5795('0xb'),auth[_0x5795('0x9')](),controller[_0x5795('0xc')]);router['get']('/:id/sessions',auth[_0x5795('0x9')](),controller[_0x5795('0xd')]);router[_0x5795('0x8')](_0x5795('0xe'),auth[_0x5795('0x9')](),controller[_0x5795('0xf')]);router['get']('/:id/summary',auth[_0x5795('0x9')](),timeout(_0x5795('0x10')),controller[_0x5795('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5795('0x12')]);router[_0x5795('0x13')](_0x5795('0x14'),auth[_0x5795('0x9')](),controller[_0x5795('0x15')]);router[_0x5795('0x16')](_0x5795('0xb'),auth[_0x5795('0x9')](),controller[_0x5795('0x17')]);router[_0x5795('0x18')](_0x5795('0xb'),auth[_0x5795('0x9')](),controller[_0x5795('0x19')]);module[_0x5795('0x1a')]=router; \ No newline at end of file +var _0x96ea=['get','isAuthenticated','index','/:id','/:id/answers','getAnswers','30s','getSummary','create','post','/:id/clone','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller'];(function(_0x270207,_0x39da19){var _0x4eb460=function(_0xc0a566){while(--_0xc0a566){_0x270207['push'](_0x270207['shift']());}};_0x4eb460(++_0x39da19);}(_0x96ea,0x116));var _0xa96e=function(_0x4e9fed,_0x19f4f3){_0x4e9fed=_0x4e9fed-0x0;var _0x5c8cc0=_0x96ea[_0x4e9fed];return _0x5c8cc0;};'use strict';var multer=require(_0xa96e('0x0'));var util=require(_0xa96e('0x1'));var path=require(_0xa96e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa96e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa96e('0x4'));var interaction=require(_0xa96e('0x5'));var config=require(_0xa96e('0x6'));var controller=require(_0xa96e('0x7'));router[_0xa96e('0x8')]('/',auth[_0xa96e('0x9')](),controller[_0xa96e('0xa')]);router[_0xa96e('0x8')](_0xa96e('0xb'),auth[_0xa96e('0x9')](),controller['show']);router[_0xa96e('0x8')]('/:id/sessions',auth[_0xa96e('0x9')](),controller['getSessions']);router[_0xa96e('0x8')](_0xa96e('0xc'),auth[_0xa96e('0x9')](),controller[_0xa96e('0xd')]);router[_0xa96e('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xa96e('0xe')),controller[_0xa96e('0xf')]);router['post']('/',auth[_0xa96e('0x9')](),controller[_0xa96e('0x10')]);router[_0xa96e('0x11')](_0xa96e('0x12'),auth[_0xa96e('0x9')](),controller['clone']);router['put'](_0xa96e('0xb'),auth[_0xa96e('0x9')](),controller[_0xa96e('0x13')]);router['delete'](_0xa96e('0xb'),auth[_0xa96e('0x9')](),controller[_0xa96e('0x14')]);module[_0xa96e('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 5b74f08..92b45d7 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 _0x8c38=['TEXT','long','isObjectLike','setDataValue','formData','isString','format','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c38,0x14a));var _0x88c3=function(_0x1420a1,_0x53384c){_0x1420a1=_0x1420a1-0x0;var _0xfb7cb0=_0x8c38[_0x1420a1];return _0xfb7cb0;};'use strict';var Sequelize=require(_0x88c3('0x0'));var _=require(_0x88c3('0x1'));var util=require(_0x88c3('0x2'));module[_0x88c3('0x3')]={'name':{'type':Sequelize[_0x88c3('0x4')],'unique':_0x88c3('0x5')},'description':{'type':Sequelize[_0x88c3('0x4')]},'formData':{'type':Sequelize[_0x88c3('0x6')](_0x88c3('0x7')),'set':function(_0x49602f){if(_[_0x88c3('0x8')](_0x49602f)){this[_0x88c3('0x9')](_0x88c3('0xa'),JSON['stringify'](_0x49602f));}else if(_[_0x88c3('0xb')](_0x49602f)){this[_0x88c3('0x9')](_0x88c3('0xa'),_0x49602f);}else{this[_0x88c3('0x9')](_0x88c3('0xa'),util[_0x88c3('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x88c3('0x5'))||'',this[_0x88c3('0xd')](_0x88c3('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x88c3('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x88c3('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x9cf5=['exports','STRING','name','long','isObjectLike','stringify','isString','setDataValue','formData','format','getDataValue','description','BOOLEAN','util'];(function(_0x16b334,_0x58bd7f){var _0x54aff2=function(_0x366b0e){while(--_0x366b0e){_0x16b334['push'](_0x16b334['shift']());}};_0x54aff2(++_0x58bd7f);}(_0x9cf5,0x187));var _0x59cf=function(_0x1aba66,_0x53ad08){_0x1aba66=_0x1aba66-0x0;var _0x151d17=_0x9cf5[_0x1aba66];return _0x151d17;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x59cf('0x0'));module[_0x59cf('0x1')]={'name':{'type':Sequelize[_0x59cf('0x2')],'unique':_0x59cf('0x3')},'description':{'type':Sequelize[_0x59cf('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x59cf('0x4')),'set':function(_0x24cc0f){if(_[_0x59cf('0x5')](_0x24cc0f)){this['setDataValue']('formData',JSON[_0x59cf('0x6')](_0x24cc0f));}else if(_[_0x59cf('0x7')](_0x24cc0f)){this[_0x59cf('0x8')](_0x59cf('0x9'),_0x24cc0f);}else{this[_0x59cf('0x8')](_0x59cf('0x9'),util[_0x59cf('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x59cf('0xb')](_0x59cf('0x3'))||'',this[_0x59cf('0xb')](_0x59cf('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x59cf('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 739eb49..f4424ff 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 _0x6606=['lodash','crypto','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','get','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','then','includeAll','findAll','rows','show','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','user','userProfileId','autoAssociation','params','findOne','JscriptySessionReport','pick','ProjectId','include','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra'];(function(_0x3293aa,_0x3be084){var _0x513719=function(_0x2f470e){while(--_0x2f470e){_0x3293aa['push'](_0x3293aa['shift']());}};_0x513719(++_0x3be084);}(_0x6606,0x6a));var _0x6660=function(_0x29be42,_0x361a47){_0x29be42=_0x29be42-0x0;var _0x1233d6=_0x6606[_0x29be42];return _0x1233d6;};'use strict';var emlformat=require(_0x6660('0x0'));var rimraf=require(_0x6660('0x1'));var zipdir=require(_0x6660('0x2'));var jsonpatch=require(_0x6660('0x3'));var rp=require(_0x6660('0x4'));var moment=require(_0x6660('0x5'));var BPromise=require(_0x6660('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6660('0x7'));var sox=require('sox');var csv=require(_0x6660('0x8'));var ejs=require(_0x6660('0x9'));var fs=require('fs');var fs_extra=require(_0x6660('0xa'));var _=require(_0x6660('0xb'));var squel=require('squel');var crypto=require(_0x6660('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6660('0x8'));var querystring=require(_0x6660('0xd'));var Papa=require(_0x6660('0xe'));var Redis=require(_0x6660('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6660('0x10'));var logger=require('../../config/logger')(_0x6660('0x11'));var utils=require(_0x6660('0x12'));var config=require(_0x6660('0x13'));var licenseUtil=require(_0x6660('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x103452,_0x5c3eb8){_0x5c3eb8=_0x5c3eb8||0xcc;return function(_0x466474){if(_0x466474){return _0x103452[_0x6660('0x15')](_0x5c3eb8);}return _0x103452[_0x6660('0x16')](_0x5c3eb8)[_0x6660('0x17')]();};}function respondWithResult(_0x9a6dff,_0x55e3d0){_0x55e3d0=_0x55e3d0||0xc8;return function(_0x436983){if(_0x436983){return _0x9a6dff[_0x6660('0x16')](_0x55e3d0)[_0x6660('0x18')](_0x436983);}};}function respondWithFilteredResult(_0x3614f7,_0x30809d){return function(_0x116a22){if(_0x116a22){var _0x414abc=typeof _0x30809d[_0x6660('0x19')]==='undefined'&&typeof _0x30809d[_0x6660('0x1a')]===_0x6660('0x1b');var _0x85bc01=_0x116a22[_0x6660('0x1c')];var _0x4609ab=_0x414abc?0x0:_0x30809d[_0x6660('0x19')];var _0xc64a7a=_0x414abc?_0x116a22['count']:_0x30809d[_0x6660('0x19')]+_0x30809d[_0x6660('0x1a')];var _0x594443;if(_0xc64a7a>=_0x85bc01){_0xc64a7a=_0x85bc01;_0x594443=0xc8;}else{_0x594443=0xce;}_0x3614f7['status'](_0x594443);return _0x3614f7['set'](_0x6660('0x1d'),_0x4609ab+'-'+_0xc64a7a+'/'+_0x85bc01)['json'](_0x116a22);}return null;};}function patchUpdates(_0x52afae){return function(_0xe96fc7){try{jsonpatch['apply'](_0xe96fc7,_0x52afae,!![]);}catch(_0x539533){return BPromise[_0x6660('0x1e')](_0x539533);}return _0xe96fc7[_0x6660('0x1f')]();};}function saveUpdates(_0x2dada9,_0x3f2827){return function(_0x3693fd){if(_0x3693fd){return _0x3693fd[_0x6660('0x20')](_0x2dada9)['then'](function(_0x16a782){return _0x16a782;});}return null;};}function removeEntity(_0x407150,_0x1f8e5b){return function(_0x40622d){if(_0x40622d){return _0x40622d[_0x6660('0x21')]()['then'](function(){var _0xdc520f=_0x40622d[_0x6660('0x22')]({'plain':!![]});var _0x323a4a='Projects';return db['UserProfileResource']['destroy']({'where':{'type':_0x323a4a,'resourceId':_0xdc520f['id']}})['then'](function(){return _0x40622d;});})['then'](function(){_0x407150[_0x6660('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65ec94,_0x5c8b81){return function(_0x141b6d){if(!_0x141b6d){_0x65ec94[_0x6660('0x15')](0x194);}return _0x141b6d;};}function handleError(_0x55bbc9,_0x2eaa4d){_0x2eaa4d=_0x2eaa4d||0x1f4;return function(_0x25be51){logger['error'](_0x25be51[_0x6660('0x23')]);if(_0x25be51['name']){delete _0x25be51[_0x6660('0x24')];}_0x55bbc9[_0x6660('0x16')](_0x2eaa4d)[_0x6660('0x25')](_0x25be51);};}exports[_0x6660('0x26')]=function(_0x5662ea,_0x116cd6){var _0x34f9d3={},_0x24a9ba={},_0x1c27da={'count':0x0,'rows':[]};var _0x713f08=_[_0x6660('0x27')](db[_0x6660('0x28')][_0x6660('0x29')],function(_0x472134){return{'name':_0x472134[_0x6660('0x2a')],'type':_0x472134[_0x6660('0x2b')][_0x6660('0x2c')]};});_0x24a9ba[_0x6660('0x2d')]=_[_0x6660('0x27')](_0x713f08,_0x6660('0x24'));_0x24a9ba[_0x6660('0x2e')]=_[_0x6660('0x2f')](_0x5662ea[_0x6660('0x2e')]);_0x24a9ba[_0x6660('0x30')]=_[_0x6660('0x31')](_0x24a9ba[_0x6660('0x2d')],_0x24a9ba['query']);_0x34f9d3[_0x6660('0x32')]=_[_0x6660('0x31')](_0x24a9ba[_0x6660('0x2d')],qs[_0x6660('0x33')](_0x5662ea[_0x6660('0x2e')][_0x6660('0x33')]));_0x34f9d3['attributes']=_0x34f9d3['attributes'][_0x6660('0x34')]?_0x34f9d3[_0x6660('0x32')]:_0x24a9ba[_0x6660('0x2d')];if(!_0x5662ea[_0x6660('0x2e')][_0x6660('0x35')](_0x6660('0x36'))){_0x34f9d3[_0x6660('0x1a')]=qs[_0x6660('0x1a')](_0x5662ea[_0x6660('0x2e')]['limit']);_0x34f9d3[_0x6660('0x19')]=qs[_0x6660('0x19')](_0x5662ea[_0x6660('0x2e')][_0x6660('0x19')]);}_0x34f9d3[_0x6660('0x37')]=qs[_0x6660('0x38')](_0x5662ea['query'][_0x6660('0x38')]);_0x34f9d3[_0x6660('0x39')]=qs[_0x6660('0x30')](_['pick'](_0x5662ea[_0x6660('0x2e')],_0x24a9ba[_0x6660('0x30')]),_0x713f08);if(_0x5662ea['query']['filter']){_0x34f9d3[_0x6660('0x39')]=_[_0x6660('0x3a')](_0x34f9d3[_0x6660('0x39')],{'$or':_[_0x6660('0x27')](_0x713f08,function(_0x5a684c){if(_0x5a684c[_0x6660('0x2b')]!==_0x6660('0x3b')){var _0x2cdf8d={};_0x2cdf8d[_0x5a684c[_0x6660('0x24')]]={'$like':'%'+_0x5662ea[_0x6660('0x2e')][_0x6660('0x3c')]+'%'};return _0x2cdf8d;}})});}_0x34f9d3=_[_0x6660('0x3a')]({},_0x34f9d3,_0x5662ea[_0x6660('0x3d')]);var _0x268f2c={'where':_0x34f9d3[_0x6660('0x39')]};return db[_0x6660('0x28')][_0x6660('0x1c')](_0x268f2c)[_0x6660('0x3e')](function(_0x107085){_0x1c27da[_0x6660('0x1c')]=_0x107085;if(_0x5662ea[_0x6660('0x2e')][_0x6660('0x3f')]){_0x34f9d3['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x6660('0x40')](_0x34f9d3);})[_0x6660('0x3e')](function(_0x1da519){_0x1c27da[_0x6660('0x41')]=_0x1da519;return _0x1c27da;})['then'](respondWithFilteredResult(_0x116cd6,_0x34f9d3))['catch'](handleError(_0x116cd6,null));};exports[_0x6660('0x42')]=function(_0x3db4db,_0x115bbb){var _0x2ea27e={'raw':![],'where':{'id':_0x3db4db['params']['id']}},_0x31db3e={};_0x31db3e[_0x6660('0x2d')]=_[_0x6660('0x2f')](db[_0x6660('0x28')]['rawAttributes']);_0x31db3e[_0x6660('0x2e')]=_[_0x6660('0x2f')](_0x3db4db[_0x6660('0x2e')]);_0x31db3e[_0x6660('0x30')]=_[_0x6660('0x31')](_0x31db3e[_0x6660('0x2d')],_0x31db3e[_0x6660('0x2e')]);_0x2ea27e[_0x6660('0x32')]=_[_0x6660('0x31')](_0x31db3e['model'],qs[_0x6660('0x33')](_0x3db4db[_0x6660('0x2e')][_0x6660('0x33')]));_0x2ea27e[_0x6660('0x32')]=_0x2ea27e[_0x6660('0x32')][_0x6660('0x34')]?_0x2ea27e['attributes']:_0x31db3e[_0x6660('0x2d')];if(_0x3db4db[_0x6660('0x2e')][_0x6660('0x3f')]){_0x2ea27e['include']=[{'all':!![]}];}_0x2ea27e=_[_0x6660('0x3a')]({},_0x2ea27e,_0x3db4db[_0x6660('0x3d')]);return db[_0x6660('0x28')][_0x6660('0x43')](_0x2ea27e)[_0x6660('0x3e')](handleEntityNotFound(_0x115bbb,null))['then'](respondWithResult(_0x115bbb,null))[_0x6660('0x44')](handleError(_0x115bbb,null));};exports[_0x6660('0x45')]=function(_0x11a881,_0x3bf1c8){return db[_0x6660('0x28')][_0x6660('0x45')](_0x11a881[_0x6660('0x46')],{})[_0x6660('0x3e')](function(_0x3d2204){var _0x56d132=_0x11a881['user'][_0x6660('0x22')]({'plain':!![]});if(!_0x56d132)throw new Error(_0x6660('0x47'));if(_0x56d132[_0x6660('0x48')]==='user'){var _0x2b1266=_0x3d2204[_0x6660('0x22')]({'plain':!![]});var _0x3c3643=_0x6660('0x49');return db[_0x6660('0x4a')][_0x6660('0x43')]({'where':{'name':_0x3c3643,'userProfileId':_0x56d132['userProfileId']},'raw':!![]})[_0x6660('0x3e')](function(_0xfda200){if(_0xfda200&&_0xfda200['autoAssociation']===0x0){return db[_0x6660('0x4b')][_0x6660('0x45')]({'name':_0x2b1266[_0x6660('0x24')],'resourceId':_0x2b1266['id'],'type':_0xfda200['name'],'sectionId':_0xfda200['id']},{})[_0x6660('0x3e')](function(){return _0x3d2204;});}else{return _0x3d2204;}})['catch'](function(_0x4e5869){logger[_0x6660('0x4c')](_0x6660('0x4d'),_0x4e5869);throw _0x4e5869;});}return _0x3d2204;})[_0x6660('0x3e')](respondWithResult(_0x3bf1c8,0xc9))[_0x6660('0x44')](handleError(_0x3bf1c8,null));};exports[_0x6660('0x4e')]=function(_0x44a71f,_0x5341b1){var _0x579990={'where':{'id':_0x44a71f['params']['id']}},_0x1511fa={};_0x1511fa['model']=_[_0x6660('0x2f')](db[_0x6660('0x28')][_0x6660('0x29')]);_0x579990['attributes']=_['intersection'](_0x1511fa['model'],qs['fields'](_0x44a71f['query'][_0x6660('0x33')]));_0x579990[_0x6660('0x32')]=_0x579990[_0x6660('0x32')][_0x6660('0x34')]?_0x579990[_0x6660('0x32')]:_0x1511fa[_0x6660('0x2d')];if(_0x44a71f[_0x6660('0x2e')][_0x6660('0x3f')]){_0x579990['include']=[{'all':!![]}];}_0x579990=_[_0x6660('0x3a')]({},_0x579990,_0x44a71f[_0x6660('0x3d')]);return db['JscriptyProject']['find'](_0x579990)[_0x6660('0x3e')](handleEntityNotFound(_0x5341b1,null))[_0x6660('0x3e')](function(_0x47021d){if(_0x47021d){var _0x4070b3=_0x47021d[_0x6660('0x22')]({'plain':!![]});_0x4070b3=qs['omit'](_0x4070b3,['id',_0x6660('0x4f'),'updatedAt']);_0x44a71f[_0x6660('0x46')]=_[_0x6660('0x50')](_0x44a71f[_0x6660('0x46')],['id',_0x6660('0x4f'),_0x6660('0x51')]);return db[_0x6660('0x28')][_0x6660('0x45')](_[_0x6660('0x3a')](_0x4070b3,_0x44a71f[_0x6660('0x46')]),{'include':_0x44a71f[_0x6660('0x2e')][_0x6660('0x3f')]?[{'all':!![]}]:undefined})[_0x6660('0x3e')](function(_0x475afb){var _0xa86c06=_0x44a71f[_0x6660('0x52')][_0x6660('0x22')]({'plain':!![]});if(!_0xa86c06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa86c06[_0x6660('0x48')]===_0x6660('0x52')){var _0x27f850=_0x475afb[_0x6660('0x22')]({'plain':!![]});var _0x1a3363='Projects';return db[_0x6660('0x4a')][_0x6660('0x43')]({'where':{'name':_0x1a3363,'userProfileId':_0xa86c06[_0x6660('0x53')]},'raw':!![]})[_0x6660('0x3e')](function(_0x4921a5){if(_0x4921a5&&_0x4921a5[_0x6660('0x54')]===0x0){return db[_0x6660('0x4b')]['create']({'name':_0x27f850[_0x6660('0x24')],'resourceId':_0x27f850['id'],'type':_0x4921a5[_0x6660('0x24')],'sectionId':_0x4921a5['id']},{})['then'](function(){return _0x475afb;});}else{return _0x475afb;}})['catch'](function(_0x5bcdf6){logger[_0x6660('0x4c')](_0x6660('0x4d'),_0x5bcdf6);throw _0x5bcdf6;});}return _0x475afb;});}})['then'](respondWithResult(_0x5341b1,0xc9))[_0x6660('0x44')](handleError(_0x5341b1,null));};exports[_0x6660('0x20')]=function(_0x78811,_0x1f60e1){if(_0x78811[_0x6660('0x46')]['id']){delete _0x78811[_0x6660('0x46')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x78811[_0x6660('0x55')]['id']}})[_0x6660('0x3e')](handleEntityNotFound(_0x1f60e1,null))[_0x6660('0x3e')](saveUpdates(_0x78811[_0x6660('0x46')],null))['then'](respondWithResult(_0x1f60e1,null))[_0x6660('0x44')](handleError(_0x1f60e1,null));};exports[_0x6660('0x21')]=function(_0x4b63f2,_0x296e96){return db['JscriptyProject'][_0x6660('0x43')]({'where':{'id':_0x4b63f2[_0x6660('0x55')]['id']}})[_0x6660('0x3e')](handleEntityNotFound(_0x296e96,null))[_0x6660('0x3e')](removeEntity(_0x296e96,null))[_0x6660('0x44')](handleError(_0x296e96,null));};exports['getSessions']=function(_0x48f575,_0x254990,_0x34f5b7){var _0x3a76a3={'raw':!![],'where':{}};var _0x5d8cea={};var _0x4d7edd={'count':0x0,'rows':[]};return db[_0x6660('0x28')][_0x6660('0x56')]({'where':{'id':_0x48f575['params']['id']}})[_0x6660('0x3e')](handleEntityNotFound(_0x254990,null))[_0x6660('0x3e')](function(_0x424b91){if(_0x424b91){_0x5d8cea[_0x6660('0x2d')]=_[_0x6660('0x2f')](db[_0x6660('0x57')][_0x6660('0x29')]);_0x5d8cea[_0x6660('0x2e')]=_[_0x6660('0x2f')](_0x48f575[_0x6660('0x2e')]);_0x5d8cea['filters']=_[_0x6660('0x31')](_0x5d8cea[_0x6660('0x2d')],_0x5d8cea['query']);_0x3a76a3['attributes']=_['intersection'](_0x5d8cea[_0x6660('0x2d')],qs[_0x6660('0x33')](_0x48f575['query'][_0x6660('0x33')]));_0x3a76a3[_0x6660('0x32')]=_0x3a76a3[_0x6660('0x32')]['length']?_0x3a76a3[_0x6660('0x32')]:_0x5d8cea[_0x6660('0x2d')];if(!_0x48f575[_0x6660('0x2e')][_0x6660('0x35')]('nolimit')){_0x3a76a3[_0x6660('0x1a')]=qs[_0x6660('0x1a')](_0x48f575['query'][_0x6660('0x1a')]);_0x3a76a3['offset']=qs['offset'](_0x48f575[_0x6660('0x2e')][_0x6660('0x19')]);}_0x3a76a3['order']=qs[_0x6660('0x38')](_0x48f575[_0x6660('0x2e')][_0x6660('0x38')]);_0x3a76a3[_0x6660('0x39')]=qs[_0x6660('0x30')](_[_0x6660('0x58')](_0x48f575[_0x6660('0x2e')],_0x5d8cea['filters']));_0x3a76a3[_0x6660('0x39')][_0x6660('0x59')]=_0x424b91['id'];if(_0x48f575[_0x6660('0x2e')][_0x6660('0x3c')]){_0x3a76a3[_0x6660('0x39')]=_['merge'](_0x3a76a3['where'],{'$or':_[_0x6660('0x27')](_0x3a76a3['attributes'],function(_0x5c6020){var _0x486ce0={};_0x486ce0[_0x5c6020]={'$like':'%'+_0x48f575[_0x6660('0x2e')][_0x6660('0x3c')]+'%'};return _0x486ce0;})});}_0x3a76a3=_[_0x6660('0x3a')]({},_0x3a76a3,_0x48f575[_0x6660('0x3d')]);return db[_0x6660('0x57')][_0x6660('0x1c')]({'where':_0x3a76a3[_0x6660('0x39')]})[_0x6660('0x3e')](function(_0x447b48){_0x4d7edd[_0x6660('0x1c')]=_0x447b48;if(_0x48f575[_0x6660('0x2e')]['includeAll']){_0x3a76a3[_0x6660('0x5a')]=[{'all':!![]}];}return db[_0x6660('0x57')]['findAll'](_0x3a76a3);})['then'](function(_0x3b05bc){_0x4d7edd[_0x6660('0x41')]=_0x3b05bc;return _0x4d7edd;});}})[_0x6660('0x3e')](respondWithFilteredResult(_0x254990,_0x3a76a3))[_0x6660('0x44')](handleError(_0x254990,null));};exports['getAnswers']=function(_0x52c8cb,_0x4d7faa,_0x1ede8b){var _0x2b6ee9={'raw':!![],'where':{}};var _0x300992={};var _0x520a07={'count':0x0,'rows':[]};return db[_0x6660('0x28')][_0x6660('0x56')]({'where':{'id':_0x52c8cb['params']['id']}})[_0x6660('0x3e')](handleEntityNotFound(_0x4d7faa,null))[_0x6660('0x3e')](function(_0x2203e4){if(_0x2203e4){_0x300992['model']=_[_0x6660('0x2f')](db['JscriptyAnswerReport'][_0x6660('0x29')]);_0x300992[_0x6660('0x2e')]=_[_0x6660('0x2f')](_0x52c8cb[_0x6660('0x2e')]);_0x300992[_0x6660('0x30')]=_[_0x6660('0x31')](_0x300992[_0x6660('0x2d')],_0x300992['query']);_0x2b6ee9['attributes']=_[_0x6660('0x31')](_0x300992['model'],qs['fields'](_0x52c8cb[_0x6660('0x2e')][_0x6660('0x33')]));_0x2b6ee9[_0x6660('0x32')]=_0x2b6ee9[_0x6660('0x32')][_0x6660('0x34')]?_0x2b6ee9['attributes']:_0x300992[_0x6660('0x2d')];if(!_0x52c8cb[_0x6660('0x2e')][_0x6660('0x35')](_0x6660('0x36'))){_0x2b6ee9['limit']=qs['limit'](_0x52c8cb[_0x6660('0x2e')][_0x6660('0x1a')]);_0x2b6ee9[_0x6660('0x19')]=qs['offset'](_0x52c8cb[_0x6660('0x2e')][_0x6660('0x19')]);}_0x2b6ee9[_0x6660('0x37')]=qs[_0x6660('0x38')](_0x52c8cb[_0x6660('0x2e')][_0x6660('0x38')]);_0x2b6ee9['where']=qs[_0x6660('0x30')](_['pick'](_0x52c8cb[_0x6660('0x2e')],_0x300992[_0x6660('0x30')]));_0x2b6ee9[_0x6660('0x39')]['ProjectId']=_0x2203e4['id'];if(_0x52c8cb[_0x6660('0x2e')]['filter']){_0x2b6ee9[_0x6660('0x39')]=_[_0x6660('0x3a')](_0x2b6ee9['where'],{'$or':_['map'](_0x2b6ee9['attributes'],function(_0x419035){var _0x33993d={};_0x33993d[_0x419035]={'$like':'%'+_0x52c8cb[_0x6660('0x2e')][_0x6660('0x3c')]+'%'};return _0x33993d;})});}_0x2b6ee9=_[_0x6660('0x3a')]({},_0x2b6ee9,_0x52c8cb[_0x6660('0x3d')]);return db[_0x6660('0x5b')][_0x6660('0x1c')]({'where':_0x2b6ee9[_0x6660('0x39')]})[_0x6660('0x3e')](function(_0x3d0ecf){_0x520a07[_0x6660('0x1c')]=_0x3d0ecf;if(_0x52c8cb[_0x6660('0x2e')][_0x6660('0x3f')]){_0x2b6ee9[_0x6660('0x5a')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6660('0x40')](_0x2b6ee9);})[_0x6660('0x3e')](function(_0xced1e0){_0x520a07[_0x6660('0x41')]=_0xced1e0;return _0x520a07;});}})[_0x6660('0x3e')](respondWithFilteredResult(_0x4d7faa,_0x2b6ee9))[_0x6660('0x44')](handleError(_0x4d7faa,null));};function char(_0x13d1b2){return _0x6660('0x5c')===typeof _0x13d1b2?String[_0x6660('0x5d')][_0x6660('0x5e')](null,arguments):_0x13d1b2;}function needsEncapsulation(_0x400c6a){return!!_0x400c6a&&(_0x400c6a[_0x6660('0x5f')]()[_0x6660('0x60')](char(0xd))>=0x0||_0x400c6a[_0x6660('0x5f')]()[_0x6660('0x60')](char(0xa))>=0x0||_0x400c6a['toString']()[_0x6660('0x60')](char(0x2c))>=0x0||_0x400c6a[_0x6660('0x5f')]()[_0x6660('0x60')](char(0x22))>=0x0);}function encapsulate(_0x12b9de){var _0x41092b=char(0x22),_0x5928e8='\x5c'+char(0x22),_0x4a4433=_0x12b9de[_0x6660('0x5f')]()[_0x6660('0x61')](new RegExp(_0x41092b,'g'),_0x5928e8);return _0x41092b+_0x4a4433+_0x41092b;}exports['getSummary']=function(_0x3de7f4,_0x514e3c,_0x57248a){var _0x3bfcc1,_0x5adbcd;var _0x2029c9={'where':{'ProjectId':_0x3de7f4[_0x6660('0x55')]['id']}};if(_0x3de7f4[_0x6660('0x2e')]['startTime']){_0x2029c9[_0x6660('0x39')][_0x6660('0x62')]=JSON[_0x6660('0x63')](_0x3de7f4['query'][_0x6660('0x64')]);}return db[_0x6660('0x57')][_0x6660('0x40')](_0x2029c9)[_0x6660('0x3e')](handleEntityNotFound(_0x514e3c,null))[_0x6660('0x3e')](function(_0x2ab6a6){if(_0x2ab6a6){_0x3bfcc1=_0x2ab6a6;return db[_0x6660('0x65')][_0x6660('0x40')]({'where':{'SessionId':{'$in':_['map'](_0x3bfcc1,'id')},'ProjectId':_0x3de7f4[_0x6660('0x55')]['id']},'order':_0x6660('0x66')});}})[_0x6660('0x3e')](handleEntityNotFound(_0x514e3c,null))['then'](function(_0x4a13cb){if(_0x4a13cb){_0x5adbcd=_0x4a13cb;var _0x3ca20b={};for(var _0x24d5d4=0x0,_0x262743=_0x5adbcd[_0x6660('0x34')];_0x24d5d4<_0x262743;_0x24d5d4++){if(!_0x3ca20b[_0x6660('0x35')](_0x5adbcd[_0x24d5d4][_0x6660('0x67')])){_0x3ca20b[_0x5adbcd[_0x24d5d4][_0x6660('0x67')]]=needsEncapsulation(_0x5adbcd[_0x24d5d4][_0x6660('0x68')])?encapsulate(_0x5adbcd[_0x24d5d4]['question']):_0x5adbcd[_0x24d5d4][_0x6660('0x68')];}}var _0x367b39=[],_0x433844={};for(var _0x4c9a2e=0x0,_0x47c06c=_0x3bfcc1['length'];_0x4c9a2e<_0x47c06c;_0x4c9a2e++){_0x433844={'ProjectId':_0x3de7f4[_0x6660('0x55')]['id'],'SessionId':_0x3bfcc1[_0x4c9a2e]['id'],'StartTime':moment(_0x3bfcc1[_0x4c9a2e][_0x6660('0x62')])[_0x6660('0x69')](_0x6660('0x6a'))};for(var _0x450203=0x0,_0x507bae=_0x5adbcd[_0x6660('0x34')];_0x450203<_0x507bae;_0x450203++){if(_0x5adbcd[_0x450203][_0x6660('0x6b')]==_0x3bfcc1[_0x4c9a2e]['id']&&_0x3ca20b['hasOwnProperty'](_0x5adbcd[_0x450203][_0x6660('0x67')])){_0x433844[_0x3ca20b[_0x5adbcd[_0x450203]['questionId']]]=_0x5adbcd[_0x450203][_0x6660('0x6c')];}}for(var _0xbc3b52 in _0x3ca20b){if(!_0x433844['hasOwnProperty'](_0x3ca20b[_0xbc3b52])){_0x433844[_0x3ca20b[_0xbc3b52]]=null;}}_0x367b39['push'](_0x433844);}return _0x367b39;}})[_0x6660('0x3e')](function(_0x258270){if(!_[_0x6660('0x6d')](_0x258270)){var _0x44b13c=toCsv(_0x258270);var _0x525fe9=Date['now']();fs[_0x6660('0x6e')](util['format'](_0x6660('0x6f'),_0x3de7f4['params']['id'],_0x525fe9),_0x44b13c);_0x514e3c[_0x6660('0x70')](_0x6660('0x71'),_0x6660('0x72')+util['format'](_0x6660('0x73'),_0x3de7f4[_0x6660('0x55')]['id'],_0x525fe9));_0x514e3c[_0x6660('0x70')]('Content-type','text/csv');return _0x514e3c[_0x6660('0x74')](util[_0x6660('0x69')](_0x6660('0x6f'),_0x3de7f4[_0x6660('0x55')]['id'],_0x525fe9));}else{return _0x514e3c['sendStatus'](0xcc);}})[_0x6660('0x44')](handleError(_0x514e3c,null));}; \ No newline at end of file +var _0x6305=['hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','order','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','error','stack','name','send','index','JscriptyProject','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields'];(function(_0x117aa2,_0x1d3b5){var _0x55dd73=function(_0x2126c0){while(--_0x2126c0){_0x117aa2['push'](_0x117aa2['shift']());}};_0x55dd73(++_0x1d3b5);}(_0x6305,0x1ab));var _0x5630=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6305[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5630('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5630('0x1'));var rp=require(_0x5630('0x2'));var moment=require(_0x5630('0x3'));var BPromise=require(_0x5630('0x4'));var Mustache=require(_0x5630('0x5'));var util=require('util');var path=require(_0x5630('0x6'));var sox=require(_0x5630('0x7'));var csv=require(_0x5630('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5630('0x9'));var squel=require(_0x5630('0xa'));var crypto=require(_0x5630('0xb'));var jsforce=require(_0x5630('0xc'));var deskjs=require(_0x5630('0xd'));var toCsv=require(_0x5630('0x8'));var querystring=require(_0x5630('0xe'));var Papa=require(_0x5630('0xf'));var Redis=require(_0x5630('0x10'));var authService=require(_0x5630('0x11'));var qs=require(_0x5630('0x12'));var as=require(_0x5630('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5630('0x14'))(_0x5630('0x15'));var utils=require(_0x5630('0x16'));var config=require(_0x5630('0x17'));var licenseUtil=require(_0x5630('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449e06,_0x20a170){_0x20a170=_0x20a170||0xcc;return function(_0x4f6215){if(_0x4f6215){return _0x449e06[_0x5630('0x19')](_0x20a170);}return _0x449e06[_0x5630('0x1a')](_0x20a170)[_0x5630('0x1b')]();};}function respondWithResult(_0x22fc67,_0x363658){_0x363658=_0x363658||0xc8;return function(_0x11b319){if(_0x11b319){return _0x22fc67['status'](_0x363658)[_0x5630('0x1c')](_0x11b319);}};}function respondWithFilteredResult(_0x46fe48,_0x3c1daa){return function(_0x26877c){if(_0x26877c){var _0x45cc62=typeof _0x3c1daa[_0x5630('0x1d')]===_0x5630('0x1e')&&typeof _0x3c1daa[_0x5630('0x1f')]==='undefined';var _0x548762=_0x26877c[_0x5630('0x20')];var _0x478bfa=_0x45cc62?0x0:_0x3c1daa[_0x5630('0x1d')];var _0x5940cf=_0x45cc62?_0x26877c['count']:_0x3c1daa[_0x5630('0x1d')]+_0x3c1daa[_0x5630('0x1f')];var _0xec3c50;if(_0x5940cf>=_0x548762){_0x5940cf=_0x548762;_0xec3c50=0xc8;}else{_0xec3c50=0xce;}_0x46fe48[_0x5630('0x1a')](_0xec3c50);return _0x46fe48[_0x5630('0x21')]('Content-Range',_0x478bfa+'-'+_0x5940cf+'/'+_0x548762)[_0x5630('0x1c')](_0x26877c);}return null;};}function patchUpdates(_0x567019){return function(_0x582c19){try{jsonpatch[_0x5630('0x22')](_0x582c19,_0x567019,!![]);}catch(_0x57a98b){return BPromise['reject'](_0x57a98b);}return _0x582c19[_0x5630('0x23')]();};}function saveUpdates(_0x118565,_0x24ea00){return function(_0x56c0d5){if(_0x56c0d5){return _0x56c0d5[_0x5630('0x24')](_0x118565)[_0x5630('0x25')](function(_0x26327f){return _0x26327f;});}return null;};}function removeEntity(_0x2e8b7a,_0xa31726){return function(_0x352d8b){if(_0x352d8b){return _0x352d8b[_0x5630('0x26')]()[_0x5630('0x25')](function(){var _0x3fe539=_0x352d8b[_0x5630('0x27')]({'plain':!![]});var _0x42301e='Projects';return db['UserProfileResource'][_0x5630('0x26')]({'where':{'type':_0x42301e,'resourceId':_0x3fe539['id']}})[_0x5630('0x25')](function(){return _0x352d8b;});})[_0x5630('0x25')](function(){_0x2e8b7a[_0x5630('0x1a')](0xcc)[_0x5630('0x1b')]();});}};}function handleEntityNotFound(_0x13c36c,_0x4b33a9){return function(_0x4aee3b){if(!_0x4aee3b){_0x13c36c[_0x5630('0x19')](0x194);}return _0x4aee3b;};}function handleError(_0x571112,_0x40c9ba){_0x40c9ba=_0x40c9ba||0x1f4;return function(_0x11ed26){logger[_0x5630('0x28')](_0x11ed26[_0x5630('0x29')]);if(_0x11ed26['name']){delete _0x11ed26[_0x5630('0x2a')];}_0x571112[_0x5630('0x1a')](_0x40c9ba)[_0x5630('0x2b')](_0x11ed26);};}exports[_0x5630('0x2c')]=function(_0x233d46,_0x48c0eb){var _0x44afe7={},_0xa37924={},_0x5a6788={'count':0x0,'rows':[]};var _0x240165=_['map'](db[_0x5630('0x2d')]['rawAttributes'],function(_0xd8247b){return{'name':_0xd8247b[_0x5630('0x2e')],'type':_0xd8247b[_0x5630('0x2f')][_0x5630('0x30')]};});_0xa37924[_0x5630('0x31')]=_[_0x5630('0x32')](_0x240165,'name');_0xa37924[_0x5630('0x33')]=_[_0x5630('0x34')](_0x233d46['query']);_0xa37924[_0x5630('0x35')]=_['intersection'](_0xa37924[_0x5630('0x31')],_0xa37924[_0x5630('0x33')]);_0x44afe7[_0x5630('0x36')]=_[_0x5630('0x37')](_0xa37924['model'],qs[_0x5630('0x38')](_0x233d46[_0x5630('0x33')][_0x5630('0x38')]));_0x44afe7['attributes']=_0x44afe7['attributes']['length']?_0x44afe7[_0x5630('0x36')]:_0xa37924[_0x5630('0x31')];if(!_0x233d46[_0x5630('0x33')][_0x5630('0x39')](_0x5630('0x3a'))){_0x44afe7['limit']=qs[_0x5630('0x1f')](_0x233d46[_0x5630('0x33')]['limit']);_0x44afe7[_0x5630('0x1d')]=qs[_0x5630('0x1d')](_0x233d46['query']['offset']);}_0x44afe7['order']=qs[_0x5630('0x3b')](_0x233d46[_0x5630('0x33')][_0x5630('0x3b')]);_0x44afe7[_0x5630('0x3c')]=qs[_0x5630('0x35')](_[_0x5630('0x3d')](_0x233d46['query'],_0xa37924['filters']),_0x240165);if(_0x233d46['query'][_0x5630('0x3e')]){_0x44afe7[_0x5630('0x3c')]=_['merge'](_0x44afe7[_0x5630('0x3c')],{'$or':_[_0x5630('0x32')](_0x240165,function(_0x515564){if(_0x515564['type']!==_0x5630('0x3f')){var _0x33c13c={};_0x33c13c[_0x515564[_0x5630('0x2a')]]={'$like':'%'+_0x233d46[_0x5630('0x33')][_0x5630('0x3e')]+'%'};return _0x33c13c;}})});}_0x44afe7=_[_0x5630('0x40')]({},_0x44afe7,_0x233d46[_0x5630('0x41')]);var _0x19694b={'where':_0x44afe7['where']};return db[_0x5630('0x2d')][_0x5630('0x20')](_0x19694b)[_0x5630('0x25')](function(_0x463d04){_0x5a6788[_0x5630('0x20')]=_0x463d04;if(_0x233d46['query'][_0x5630('0x42')]){_0x44afe7['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x5630('0x43')](_0x44afe7);})['then'](function(_0x3a9818){_0x5a6788[_0x5630('0x44')]=_0x3a9818;return _0x5a6788;})[_0x5630('0x25')](respondWithFilteredResult(_0x48c0eb,_0x44afe7))[_0x5630('0x45')](handleError(_0x48c0eb,null));};exports['show']=function(_0x31c02d,_0x14c562){var _0xacebd7={'raw':![],'where':{'id':_0x31c02d[_0x5630('0x46')]['id']}},_0x53c778={};_0x53c778[_0x5630('0x31')]=_[_0x5630('0x34')](db[_0x5630('0x2d')][_0x5630('0x47')]);_0x53c778[_0x5630('0x33')]=_[_0x5630('0x34')](_0x31c02d[_0x5630('0x33')]);_0x53c778[_0x5630('0x35')]=_['intersection'](_0x53c778[_0x5630('0x31')],_0x53c778[_0x5630('0x33')]);_0xacebd7[_0x5630('0x36')]=_[_0x5630('0x37')](_0x53c778[_0x5630('0x31')],qs[_0x5630('0x38')](_0x31c02d['query'][_0x5630('0x38')]));_0xacebd7[_0x5630('0x36')]=_0xacebd7[_0x5630('0x36')][_0x5630('0x48')]?_0xacebd7[_0x5630('0x36')]:_0x53c778[_0x5630('0x31')];if(_0x31c02d['query'][_0x5630('0x42')]){_0xacebd7[_0x5630('0x49')]=[{'all':!![]}];}_0xacebd7=_['merge']({},_0xacebd7,_0x31c02d[_0x5630('0x41')]);return db[_0x5630('0x2d')][_0x5630('0x4a')](_0xacebd7)[_0x5630('0x25')](handleEntityNotFound(_0x14c562,null))[_0x5630('0x25')](respondWithResult(_0x14c562,null))[_0x5630('0x45')](handleError(_0x14c562,null));};exports[_0x5630('0x4b')]=function(_0x562332,_0x2c1985){return db[_0x5630('0x2d')][_0x5630('0x4b')](_0x562332[_0x5630('0x4c')],{})['then'](function(_0x8c5308){var _0x3624db=_0x562332[_0x5630('0x4d')][_0x5630('0x27')]({'plain':!![]});if(!_0x3624db)throw new Error(_0x5630('0x4e'));if(_0x3624db[_0x5630('0x4f')]===_0x5630('0x4d')){var _0x3bd8fa=_0x8c5308[_0x5630('0x27')]({'plain':!![]});var _0x478878=_0x5630('0x50');return db[_0x5630('0x51')][_0x5630('0x4a')]({'where':{'name':_0x478878,'userProfileId':_0x3624db[_0x5630('0x52')]},'raw':!![]})['then'](function(_0x4d6ece){if(_0x4d6ece&&_0x4d6ece['autoAssociation']===0x0){return db[_0x5630('0x53')][_0x5630('0x4b')]({'name':_0x3bd8fa[_0x5630('0x2a')],'resourceId':_0x3bd8fa['id'],'type':_0x4d6ece[_0x5630('0x2a')],'sectionId':_0x4d6ece['id']},{})[_0x5630('0x25')](function(){return _0x8c5308;});}else{return _0x8c5308;}})[_0x5630('0x45')](function(_0x121fdb){logger[_0x5630('0x28')](_0x5630('0x54'),_0x121fdb);throw _0x121fdb;});}return _0x8c5308;})[_0x5630('0x25')](respondWithResult(_0x2c1985,0xc9))[_0x5630('0x45')](handleError(_0x2c1985,null));};exports[_0x5630('0x55')]=function(_0x5976dc,_0x5127c8){var _0x5ec10b={'where':{'id':_0x5976dc['params']['id']}},_0xba37ee={};_0xba37ee[_0x5630('0x31')]=_[_0x5630('0x34')](db[_0x5630('0x2d')][_0x5630('0x47')]);_0x5ec10b[_0x5630('0x36')]=_['intersection'](_0xba37ee['model'],qs[_0x5630('0x38')](_0x5976dc[_0x5630('0x33')][_0x5630('0x38')]));_0x5ec10b[_0x5630('0x36')]=_0x5ec10b['attributes'][_0x5630('0x48')]?_0x5ec10b[_0x5630('0x36')]:_0xba37ee['model'];if(_0x5976dc['query']['includeAll']){_0x5ec10b[_0x5630('0x49')]=[{'all':!![]}];}_0x5ec10b=_[_0x5630('0x40')]({},_0x5ec10b,_0x5976dc[_0x5630('0x41')]);return db[_0x5630('0x2d')]['find'](_0x5ec10b)['then'](handleEntityNotFound(_0x5127c8,null))['then'](function(_0x509f55){if(_0x509f55){var _0x32a900=_0x509f55[_0x5630('0x27')]({'plain':!![]});_0x32a900=qs[_0x5630('0x56')](_0x32a900,['id','createdAt','updatedAt']);_0x5976dc[_0x5630('0x4c')]=_[_0x5630('0x56')](_0x5976dc[_0x5630('0x4c')],['id',_0x5630('0x57'),_0x5630('0x58')]);return db[_0x5630('0x2d')][_0x5630('0x4b')](_[_0x5630('0x40')](_0x32a900,_0x5976dc[_0x5630('0x4c')]),{'include':_0x5976dc[_0x5630('0x33')][_0x5630('0x42')]?[{'all':!![]}]:undefined})[_0x5630('0x25')](function(_0x2559dd){var _0x47e4d0=_0x5976dc[_0x5630('0x4d')][_0x5630('0x27')]({'plain':!![]});if(!_0x47e4d0)throw new Error(_0x5630('0x4e'));if(_0x47e4d0['role']==='user'){var _0x5bc7ad=_0x2559dd[_0x5630('0x27')]({'plain':!![]});var _0x4f4237=_0x5630('0x50');return db[_0x5630('0x51')][_0x5630('0x4a')]({'where':{'name':_0x4f4237,'userProfileId':_0x47e4d0[_0x5630('0x52')]},'raw':!![]})[_0x5630('0x25')](function(_0xe4da26){if(_0xe4da26&&_0xe4da26[_0x5630('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bc7ad[_0x5630('0x2a')],'resourceId':_0x5bc7ad['id'],'type':_0xe4da26[_0x5630('0x2a')],'sectionId':_0xe4da26['id']},{})[_0x5630('0x25')](function(){return _0x2559dd;});}else{return _0x2559dd;}})['catch'](function(_0x5f3016){logger[_0x5630('0x28')](_0x5630('0x54'),_0x5f3016);throw _0x5f3016;});}return _0x2559dd;});}})[_0x5630('0x25')](respondWithResult(_0x5127c8,0xc9))[_0x5630('0x45')](handleError(_0x5127c8,null));};exports['update']=function(_0x34d2a8,_0xcaae0d){if(_0x34d2a8[_0x5630('0x4c')]['id']){delete _0x34d2a8[_0x5630('0x4c')]['id'];}return db[_0x5630('0x2d')]['find']({'where':{'id':_0x34d2a8['params']['id']}})[_0x5630('0x25')](handleEntityNotFound(_0xcaae0d,null))[_0x5630('0x25')](saveUpdates(_0x34d2a8[_0x5630('0x4c')],null))[_0x5630('0x25')](respondWithResult(_0xcaae0d,null))['catch'](handleError(_0xcaae0d,null));};exports[_0x5630('0x26')]=function(_0x414beb,_0x2d1c3f){return db[_0x5630('0x2d')][_0x5630('0x4a')]({'where':{'id':_0x414beb[_0x5630('0x46')]['id']}})[_0x5630('0x25')](handleEntityNotFound(_0x2d1c3f,null))['then'](removeEntity(_0x2d1c3f,null))[_0x5630('0x45')](handleError(_0x2d1c3f,null));};exports[_0x5630('0x5a')]=function(_0x39719b,_0x49b739,_0x45a97d){var _0x356101={'raw':!![],'where':{}};var _0x16e95b={};var _0xec60ec={'count':0x0,'rows':[]};return db[_0x5630('0x2d')][_0x5630('0x5b')]({'where':{'id':_0x39719b[_0x5630('0x46')]['id']}})[_0x5630('0x25')](handleEntityNotFound(_0x49b739,null))['then'](function(_0x5e58d6){if(_0x5e58d6){_0x16e95b[_0x5630('0x31')]=_[_0x5630('0x34')](db[_0x5630('0x5c')][_0x5630('0x47')]);_0x16e95b['query']=_['keys'](_0x39719b[_0x5630('0x33')]);_0x16e95b[_0x5630('0x35')]=_[_0x5630('0x37')](_0x16e95b['model'],_0x16e95b[_0x5630('0x33')]);_0x356101[_0x5630('0x36')]=_[_0x5630('0x37')](_0x16e95b[_0x5630('0x31')],qs[_0x5630('0x38')](_0x39719b[_0x5630('0x33')][_0x5630('0x38')]));_0x356101[_0x5630('0x36')]=_0x356101[_0x5630('0x36')][_0x5630('0x48')]?_0x356101[_0x5630('0x36')]:_0x16e95b[_0x5630('0x31')];if(!_0x39719b[_0x5630('0x33')][_0x5630('0x39')](_0x5630('0x3a'))){_0x356101[_0x5630('0x1f')]=qs[_0x5630('0x1f')](_0x39719b[_0x5630('0x33')]['limit']);_0x356101[_0x5630('0x1d')]=qs[_0x5630('0x1d')](_0x39719b[_0x5630('0x33')][_0x5630('0x1d')]);}_0x356101['order']=qs['sort'](_0x39719b[_0x5630('0x33')][_0x5630('0x3b')]);_0x356101['where']=qs[_0x5630('0x35')](_[_0x5630('0x3d')](_0x39719b['query'],_0x16e95b['filters']));_0x356101[_0x5630('0x3c')][_0x5630('0x5d')]=_0x5e58d6['id'];if(_0x39719b[_0x5630('0x33')][_0x5630('0x3e')]){_0x356101['where']=_[_0x5630('0x40')](_0x356101[_0x5630('0x3c')],{'$or':_[_0x5630('0x32')](_0x356101[_0x5630('0x36')],function(_0x1ef205){var _0x459530={};_0x459530[_0x1ef205]={'$like':'%'+_0x39719b[_0x5630('0x33')][_0x5630('0x3e')]+'%'};return _0x459530;})});}_0x356101=_[_0x5630('0x40')]({},_0x356101,_0x39719b['options']);return db[_0x5630('0x5c')][_0x5630('0x20')]({'where':_0x356101[_0x5630('0x3c')]})[_0x5630('0x25')](function(_0x3ad834){_0xec60ec[_0x5630('0x20')]=_0x3ad834;if(_0x39719b[_0x5630('0x33')]['includeAll']){_0x356101['include']=[{'all':!![]}];}return db[_0x5630('0x5c')]['findAll'](_0x356101);})['then'](function(_0x2fab79){_0xec60ec[_0x5630('0x44')]=_0x2fab79;return _0xec60ec;});}})['then'](respondWithFilteredResult(_0x49b739,_0x356101))[_0x5630('0x45')](handleError(_0x49b739,null));};exports[_0x5630('0x5e')]=function(_0x5bf79d,_0x45c526,_0xebf78e){var _0x138bad={'raw':!![],'where':{}};var _0x9ee6d9={};var _0x4a59b0={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5630('0x5b')]({'where':{'id':_0x5bf79d[_0x5630('0x46')]['id']}})[_0x5630('0x25')](handleEntityNotFound(_0x45c526,null))[_0x5630('0x25')](function(_0xc9f858){if(_0xc9f858){_0x9ee6d9[_0x5630('0x31')]=_[_0x5630('0x34')](db[_0x5630('0x5f')]['rawAttributes']);_0x9ee6d9[_0x5630('0x33')]=_[_0x5630('0x34')](_0x5bf79d['query']);_0x9ee6d9[_0x5630('0x35')]=_[_0x5630('0x37')](_0x9ee6d9['model'],_0x9ee6d9[_0x5630('0x33')]);_0x138bad[_0x5630('0x36')]=_[_0x5630('0x37')](_0x9ee6d9['model'],qs[_0x5630('0x38')](_0x5bf79d['query'][_0x5630('0x38')]));_0x138bad[_0x5630('0x36')]=_0x138bad['attributes'][_0x5630('0x48')]?_0x138bad['attributes']:_0x9ee6d9['model'];if(!_0x5bf79d[_0x5630('0x33')][_0x5630('0x39')](_0x5630('0x3a'))){_0x138bad['limit']=qs[_0x5630('0x1f')](_0x5bf79d[_0x5630('0x33')]['limit']);_0x138bad[_0x5630('0x1d')]=qs['offset'](_0x5bf79d[_0x5630('0x33')][_0x5630('0x1d')]);}_0x138bad[_0x5630('0x60')]=qs['sort'](_0x5bf79d[_0x5630('0x33')][_0x5630('0x3b')]);_0x138bad[_0x5630('0x3c')]=qs[_0x5630('0x35')](_[_0x5630('0x3d')](_0x5bf79d[_0x5630('0x33')],_0x9ee6d9[_0x5630('0x35')]));_0x138bad['where'][_0x5630('0x5d')]=_0xc9f858['id'];if(_0x5bf79d[_0x5630('0x33')][_0x5630('0x3e')]){_0x138bad[_0x5630('0x3c')]=_['merge'](_0x138bad[_0x5630('0x3c')],{'$or':_['map'](_0x138bad[_0x5630('0x36')],function(_0x47de89){var _0x522cca={};_0x522cca[_0x47de89]={'$like':'%'+_0x5bf79d[_0x5630('0x33')][_0x5630('0x3e')]+'%'};return _0x522cca;})});}_0x138bad=_['merge']({},_0x138bad,_0x5bf79d['options']);return db[_0x5630('0x5f')][_0x5630('0x20')]({'where':_0x138bad[_0x5630('0x3c')]})[_0x5630('0x25')](function(_0x640ac){_0x4a59b0[_0x5630('0x20')]=_0x640ac;if(_0x5bf79d['query'][_0x5630('0x42')]){_0x138bad[_0x5630('0x49')]=[{'all':!![]}];}return db[_0x5630('0x5f')][_0x5630('0x43')](_0x138bad);})['then'](function(_0x2603e5){_0x4a59b0[_0x5630('0x44')]=_0x2603e5;return _0x4a59b0;});}})[_0x5630('0x25')](respondWithFilteredResult(_0x45c526,_0x138bad))['catch'](handleError(_0x45c526,null));};function char(_0x40f57d){return _0x5630('0x61')===typeof _0x40f57d?String[_0x5630('0x62')][_0x5630('0x22')](null,arguments):_0x40f57d;}function needsEncapsulation(_0xa3cdd9){return!!_0xa3cdd9&&(_0xa3cdd9['toString']()[_0x5630('0x63')](char(0xd))>=0x0||_0xa3cdd9[_0x5630('0x64')]()['indexOf'](char(0xa))>=0x0||_0xa3cdd9[_0x5630('0x64')]()[_0x5630('0x63')](char(0x2c))>=0x0||_0xa3cdd9[_0x5630('0x64')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x54b985){var _0x40d935=char(0x22),_0x2bb96d='\x5c'+char(0x22),_0x464a7c=_0x54b985[_0x5630('0x64')]()[_0x5630('0x65')](new RegExp(_0x40d935,'g'),_0x2bb96d);return _0x40d935+_0x464a7c+_0x40d935;}exports[_0x5630('0x66')]=function(_0x19aa03,_0x3caa1a,_0x38231a){var _0x11537a,_0x55ff05;var _0x44286a={'where':{'ProjectId':_0x19aa03[_0x5630('0x46')]['id']}};if(_0x19aa03[_0x5630('0x33')][_0x5630('0x67')]){_0x44286a['where'][_0x5630('0x68')]=JSON[_0x5630('0x69')](_0x19aa03[_0x5630('0x33')][_0x5630('0x67')]);}return db[_0x5630('0x5c')][_0x5630('0x43')](_0x44286a)[_0x5630('0x25')](handleEntityNotFound(_0x3caa1a,null))['then'](function(_0x5e014f){if(_0x5e014f){_0x11537a=_0x5e014f;return db[_0x5630('0x6a')][_0x5630('0x43')]({'where':{'SessionId':{'$in':_[_0x5630('0x32')](_0x11537a,'id')},'ProjectId':_0x19aa03[_0x5630('0x46')]['id']},'order':_0x5630('0x6b')});}})[_0x5630('0x25')](handleEntityNotFound(_0x3caa1a,null))[_0x5630('0x25')](function(_0x37de35){if(_0x37de35){_0x55ff05=_0x37de35;var _0x5940a5={};for(var _0xb0ee06=0x0,_0x33576f=_0x55ff05[_0x5630('0x48')];_0xb0ee06<_0x33576f;_0xb0ee06++){if(!_0x5940a5[_0x5630('0x39')](_0x55ff05[_0xb0ee06][_0x5630('0x6c')])){_0x5940a5[_0x55ff05[_0xb0ee06][_0x5630('0x6c')]]=needsEncapsulation(_0x55ff05[_0xb0ee06][_0x5630('0x6d')])?encapsulate(_0x55ff05[_0xb0ee06][_0x5630('0x6d')]):_0x55ff05[_0xb0ee06][_0x5630('0x6d')];}}var _0x1f3b6c=[],_0xaeaf35={};for(var _0x1f746b=0x0,_0x4961f0=_0x11537a['length'];_0x1f746b<_0x4961f0;_0x1f746b++){_0xaeaf35={'ProjectId':_0x19aa03[_0x5630('0x46')]['id'],'SessionId':_0x11537a[_0x1f746b]['id'],'StartTime':moment(_0x11537a[_0x1f746b][_0x5630('0x68')])[_0x5630('0x6e')](_0x5630('0x6f'))};for(var _0x182916=0x0,_0x1083d6=_0x55ff05[_0x5630('0x48')];_0x182916<_0x1083d6;_0x182916++){if(_0x55ff05[_0x182916][_0x5630('0x70')]==_0x11537a[_0x1f746b]['id']&&_0x5940a5[_0x5630('0x39')](_0x55ff05[_0x182916][_0x5630('0x6c')])){_0xaeaf35[_0x5940a5[_0x55ff05[_0x182916][_0x5630('0x6c')]]]=_0x55ff05[_0x182916][_0x5630('0x71')];}}for(var _0x3da675 in _0x5940a5){if(!_0xaeaf35['hasOwnProperty'](_0x5940a5[_0x3da675])){_0xaeaf35[_0x5940a5[_0x3da675]]=null;}}_0x1f3b6c[_0x5630('0x72')](_0xaeaf35);}return _0x1f3b6c;}})[_0x5630('0x25')](function(_0x507450){if(!_[_0x5630('0x73')](_0x507450)){var _0x58b798=toCsv(_0x507450);var _0x5104b8=Date['now']();fs['writeFileSync'](util[_0x5630('0x6e')](_0x5630('0x74'),_0x19aa03['params']['id'],_0x5104b8),_0x58b798);_0x3caa1a['setHeader'](_0x5630('0x75'),_0x5630('0x76')+util[_0x5630('0x6e')]('Jscripty_Project_%d_Summary_%s.csv',_0x19aa03[_0x5630('0x46')]['id'],_0x5104b8));_0x3caa1a[_0x5630('0x77')](_0x5630('0x78'),'text/csv');return _0x3caa1a['download'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x19aa03[_0x5630('0x46')]['id'],_0x5104b8));}else{return _0x3caa1a[_0x5630('0x19')](0xcc);}})[_0x5630('0x45')](handleError(_0x3caa1a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index a1b2e09..39cf227 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 _0x54da=['path','rimraf','../../config/environment','./jscriptyProject.attributes','define','lodash','../../config/logger','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x54da,0x9d));var _0xa54d=function(_0x5459b0,_0x4d2ef8){_0x5459b0=_0x5459b0-0x0;var _0x675a35=_0x54da[_0x5459b0];return _0x675a35;};'use strict';var _=require(_0xa54d('0x0'));var util=require('util');var logger=require(_0xa54d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa54d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa54d('0x3'));var rimraf=require(_0xa54d('0x4'));var config=require(_0xa54d('0x5'));var attributes=require(_0xa54d('0x6'));module['exports']=function(_0x57f10a,_0x63ca18){return _0x57f10a[_0xa54d('0x7')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fda=['lodash','api','moment','bluebird','request-promise','path','exports','define','JscriptyProject','jscripty_projects'];(function(_0x1dfe1f,_0x4d09f7){var _0x7ae2b6=function(_0x21c1de){while(--_0x21c1de){_0x1dfe1f['push'](_0x1dfe1f['shift']());}};_0x7ae2b6(++_0x4d09f7);}(_0x2fda,0x186));var _0xa2fd=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2fda[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xa2fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa2fd('0x1'));var moment=require(_0xa2fd('0x2'));var BPromise=require(_0xa2fd('0x3'));var rp=require(_0xa2fd('0x4'));var fs=require('fs');var path=require(_0xa2fd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xa2fd('0x6')]=function(_0x1bab5a,_0x4c6b0b){return _0x1bab5a[_0xa2fd('0x7')](_0xa2fd('0x8'),attributes,{'tableName':_0xa2fd('0x9'),'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 eef2a6c..a4eb57c 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4823a7,_0x1bfb72){var _0x5eed14=function(_0xf9f521){while(--_0xf9f521){_0x4823a7['push'](_0x4823a7['shift']());}};_0x5eed14(++_0x1bfb72);}(_0x70e0,0x17b));var _0x070e=function(_0x2278c5,_0x342a14){_0x2278c5=_0x2278c5-0x0;var _0x425a4e=_0x70e0[_0x2278c5];return _0x425a4e;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0xda3f,0xec));var _0xfda3=function(_0x31346b,_0x2acc73){_0x31346b=_0x31346b-0x0;var _0x3ce851=_0xda3f[_0x31346b];return _0x3ce851;};'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')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 1df151f..eda053c 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 _0x6a2b=['update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x9f27a3,_0x3716d9){var _0x1e712e=function(_0x5cb75a){while(--_0x5cb75a){_0x9f27a3['push'](_0x9f27a3['shift']());}};_0x1e712e(++_0x3716d9);}(_0x6a2b,0xea));var _0xb6a2=function(_0x2ec40b,_0x59a29c){_0x2ec40b=_0x2ec40b-0x0;var _0x28ba77=_0x6a2b[_0x2ec40b];return _0x28ba77;};'use strict';var multer=require(_0xb6a2('0x0'));var util=require(_0xb6a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6a2('0x2'));var router=express[_0xb6a2('0x3')]();var fs_extra=require(_0xb6a2('0x4'));var auth=require(_0xb6a2('0x5'));var interaction=require(_0xb6a2('0x6'));var config=require(_0xb6a2('0x7'));var controller=require(_0xb6a2('0x8'));router[_0xb6a2('0x9')]('/',auth[_0xb6a2('0xa')](),controller[_0xb6a2('0xb')]);router['get'](_0xb6a2('0xc'),auth[_0xb6a2('0xa')](),controller[_0xb6a2('0xd')]);router['get'](_0xb6a2('0xe'),auth[_0xb6a2('0xa')](),controller[_0xb6a2('0xf')]);router['post']('/',auth[_0xb6a2('0xa')](),controller[_0xb6a2('0x10')]);router[_0xb6a2('0x11')](_0xb6a2('0xe'),auth[_0xb6a2('0xa')](),controller[_0xb6a2('0x12')]);router['delete']('/:id',auth[_0xb6a2('0xa')](),controller[_0xb6a2('0x13')]);module[_0xb6a2('0x14')]=router; \ No newline at end of file +var _0x1315=['../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x50a105,_0x141742){var _0x1875c3=function(_0x39c01b){while(--_0x39c01b){_0x50a105['push'](_0x50a105['shift']());}};_0x1875c3(++_0x141742);}(_0x1315,0x101));var _0x5131=function(_0x3118ef,_0x3ca0f9){_0x3118ef=_0x3118ef-0x0;var _0x5a9c0e=_0x1315[_0x3118ef];return _0x5a9c0e;};'use strict';var multer=require('multer');var util=require(_0x5131('0x0'));var path=require(_0x5131('0x1'));var timeout=require(_0x5131('0x2'));var express=require('express');var router=express[_0x5131('0x3')]();var fs_extra=require(_0x5131('0x4'));var auth=require(_0x5131('0x5'));var interaction=require(_0x5131('0x6'));var config=require(_0x5131('0x7'));var controller=require(_0x5131('0x8'));router['get']('/',auth[_0x5131('0x9')](),controller[_0x5131('0xa')]);router['get'](_0x5131('0xb'),auth['isAuthenticated'](),controller[_0x5131('0xc')]);router[_0x5131('0xd')](_0x5131('0xe'),auth[_0x5131('0x9')](),controller[_0x5131('0xf')]);router[_0x5131('0x10')]('/',auth[_0x5131('0x9')](),controller[_0x5131('0x11')]);router[_0x5131('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5131('0x13')](_0x5131('0xe'),auth[_0x5131('0x9')](),controller[_0x5131('0x14')]);module[_0x5131('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 539ff75..627284c 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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x36b8f1,_0x395c74){_0x36b8f1=_0x36b8f1-0x0;var _0x25bb4c=_0x7a54[_0x36b8f1];return _0x25bb4c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x35f8ca,_0x3d9374){_0x35f8ca=_0x35f8ca-0x0;var _0x3b2c93=_0x7a54[_0x35f8ca];return _0x3b2c93;};'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 526bf61..f7db181 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 _0xf93c=['model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','intersection','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','type','key'];(function(_0x64ea88,_0x32cc78){var _0x190ec0=function(_0x48cda1){while(--_0x48cda1){_0x64ea88['push'](_0x64ea88['shift']());}};_0x190ec0(++_0x32cc78);}(_0xf93c,0x1de));var _0xcf93=function(_0x89fd0f,_0x4c45e2){_0x89fd0f=_0x89fd0f-0x0;var _0x4f9bf6=_0xf93c[_0x89fd0f];return _0x4f9bf6;};'use strict';var emlformat=require(_0xcf93('0x0'));var rimraf=require(_0xcf93('0x1'));var zipdir=require(_0xcf93('0x2'));var jsonpatch=require(_0xcf93('0x3'));var rp=require('request-promise');var moment=require(_0xcf93('0x4'));var BPromise=require(_0xcf93('0x5'));var Mustache=require(_0xcf93('0x6'));var util=require(_0xcf93('0x7'));var path=require(_0xcf93('0x8'));var sox=require(_0xcf93('0x9'));var csv=require(_0xcf93('0xa'));var ejs=require(_0xcf93('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf93('0xc'));var squel=require(_0xcf93('0xd'));var crypto=require('crypto');var jsforce=require(_0xcf93('0xe'));var deskjs=require(_0xcf93('0xf'));var toCsv=require(_0xcf93('0xa'));var querystring=require(_0xcf93('0x10'));var Papa=require(_0xcf93('0x11'));var Redis=require(_0xcf93('0x12'));var authService=require(_0xcf93('0x13'));var qs=require(_0xcf93('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf93('0x15'));var logger=require('../../config/logger')(_0xcf93('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcf93('0x17'))['db'];function respondWithStatusCode(_0x201d6b,_0x14dfd4){_0x14dfd4=_0x14dfd4||0xcc;return function(_0xc73df2){if(_0xc73df2){return _0x201d6b[_0xcf93('0x18')](_0x14dfd4);}return _0x201d6b[_0xcf93('0x19')](_0x14dfd4)[_0xcf93('0x1a')]();};}function respondWithResult(_0x530964,_0x1ba3d0){_0x1ba3d0=_0x1ba3d0||0xc8;return function(_0x455b1b){if(_0x455b1b){return _0x530964[_0xcf93('0x19')](_0x1ba3d0)[_0xcf93('0x1b')](_0x455b1b);}};}function respondWithFilteredResult(_0x4166c3,_0x1e2984){return function(_0x4af590){if(_0x4af590){var _0x20cf4a=typeof _0x1e2984['offset']===_0xcf93('0x1c')&&typeof _0x1e2984[_0xcf93('0x1d')]===_0xcf93('0x1c');var _0x516b07=_0x4af590[_0xcf93('0x1e')];var _0x454c7f=_0x20cf4a?0x0:_0x1e2984[_0xcf93('0x1f')];var _0x5c5569=_0x20cf4a?_0x4af590[_0xcf93('0x1e')]:_0x1e2984[_0xcf93('0x1f')]+_0x1e2984[_0xcf93('0x1d')];var _0x43f999;if(_0x5c5569>=_0x516b07){_0x5c5569=_0x516b07;_0x43f999=0xc8;}else{_0x43f999=0xce;}_0x4166c3[_0xcf93('0x19')](_0x43f999);return _0x4166c3['set'](_0xcf93('0x20'),_0x454c7f+'-'+_0x5c5569+'/'+_0x516b07)[_0xcf93('0x1b')](_0x4af590);}return null;};}function patchUpdates(_0x245260){return function(_0x354f7a){try{jsonpatch[_0xcf93('0x21')](_0x354f7a,_0x245260,!![]);}catch(_0x597196){return BPromise[_0xcf93('0x22')](_0x597196);}return _0x354f7a[_0xcf93('0x23')]();};}function saveUpdates(_0x5a16ab,_0x5212e4){return function(_0x581497){if(_0x581497){return _0x581497[_0xcf93('0x24')](_0x5a16ab)[_0xcf93('0x25')](function(_0x3908c6){return _0x3908c6;});}return null;};}function removeEntity(_0x50ac00,_0x4a003c){return function(_0x462593){if(_0x462593){return _0x462593['destroy']()[_0xcf93('0x25')](function(){_0x50ac00[_0xcf93('0x19')](0xcc)[_0xcf93('0x1a')]();});}};}function handleEntityNotFound(_0x235dbd,_0x82fd52){return function(_0x28f737){if(!_0x28f737){_0x235dbd[_0xcf93('0x18')](0x194);}return _0x28f737;};}function handleError(_0x55e266,_0x18913b){_0x18913b=_0x18913b||0x1f4;return function(_0x2c755f){logger[_0xcf93('0x26')](_0x2c755f[_0xcf93('0x27')]);if(_0x2c755f[_0xcf93('0x28')]){delete _0x2c755f[_0xcf93('0x28')];}_0x55e266[_0xcf93('0x19')](_0x18913b)[_0xcf93('0x29')](_0x2c755f);};}exports[_0xcf93('0x2a')]=function(_0x59dbf2,_0x509bed){var _0x388d76={},_0x5d0a89={},_0x56aff8={'count':0x0,'rows':[]};var _0x2b33f9=_[_0xcf93('0x2b')](db[_0xcf93('0x2c')]['rawAttributes'],function(_0x3ecfd8){return{'name':_0x3ecfd8['fieldName'],'type':_0x3ecfd8[_0xcf93('0x2d')][_0xcf93('0x2e')]};});_0x5d0a89[_0xcf93('0x2f')]=_[_0xcf93('0x2b')](_0x2b33f9,_0xcf93('0x28'));_0x5d0a89[_0xcf93('0x30')]=_[_0xcf93('0x31')](_0x59dbf2['query']);_0x5d0a89[_0xcf93('0x32')]=_['intersection'](_0x5d0a89[_0xcf93('0x2f')],_0x5d0a89[_0xcf93('0x30')]);_0x388d76[_0xcf93('0x33')]=_['intersection'](_0x5d0a89[_0xcf93('0x2f')],qs['fields'](_0x59dbf2['query'][_0xcf93('0x34')]));_0x388d76[_0xcf93('0x33')]=_0x388d76[_0xcf93('0x33')]['length']?_0x388d76[_0xcf93('0x33')]:_0x5d0a89[_0xcf93('0x2f')];if(!_0x59dbf2[_0xcf93('0x30')][_0xcf93('0x35')](_0xcf93('0x36'))){_0x388d76[_0xcf93('0x1d')]=qs[_0xcf93('0x1d')](_0x59dbf2[_0xcf93('0x30')][_0xcf93('0x1d')]);_0x388d76['offset']=qs[_0xcf93('0x1f')](_0x59dbf2[_0xcf93('0x30')][_0xcf93('0x1f')]);}_0x388d76[_0xcf93('0x37')]=qs[_0xcf93('0x38')](_0x59dbf2[_0xcf93('0x30')]['sort']);_0x388d76[_0xcf93('0x39')]=qs[_0xcf93('0x32')](_[_0xcf93('0x3a')](_0x59dbf2['query'],_0x5d0a89[_0xcf93('0x32')]),_0x2b33f9);if(_0x59dbf2[_0xcf93('0x30')][_0xcf93('0x3b')]){_0x388d76['where']=_[_0xcf93('0x3c')](_0x388d76[_0xcf93('0x39')],{'$or':_[_0xcf93('0x2b')](_0x2b33f9,function(_0x444c03){if(_0x444c03[_0xcf93('0x2d')]!==_0xcf93('0x3d')){var _0x3c7ada={};_0x3c7ada[_0x444c03[_0xcf93('0x28')]]={'$like':'%'+_0x59dbf2[_0xcf93('0x30')][_0xcf93('0x3b')]+'%'};return _0x3c7ada;}})});}_0x388d76=_['merge']({},_0x388d76,_0x59dbf2[_0xcf93('0x3e')]);var _0x2fcf08={'where':_0x388d76[_0xcf93('0x39')]};return db[_0xcf93('0x2c')][_0xcf93('0x1e')](_0x2fcf08)[_0xcf93('0x25')](function(_0x4893a2){_0x56aff8['count']=_0x4893a2;if(_0x59dbf2[_0xcf93('0x30')][_0xcf93('0x3f')]){_0x388d76['include']=[{'all':!![]}];}return db[_0xcf93('0x2c')]['findAll'](_0x388d76);})[_0xcf93('0x25')](function(_0x1ae93f){_0x56aff8[_0xcf93('0x40')]=_0x1ae93f;return _0x56aff8;})[_0xcf93('0x25')](respondWithFilteredResult(_0x509bed,_0x388d76))[_0xcf93('0x41')](handleError(_0x509bed,null));};exports['show']=function(_0x4a4ed8,_0x338b58){var _0x119ae9={'raw':!![],'where':{'id':_0x4a4ed8[_0xcf93('0x42')]['id']}},_0x57bce7={};_0x57bce7[_0xcf93('0x2f')]=_[_0xcf93('0x31')](db[_0xcf93('0x2c')][_0xcf93('0x43')]);_0x57bce7[_0xcf93('0x30')]=_[_0xcf93('0x31')](_0x4a4ed8[_0xcf93('0x30')]);_0x57bce7[_0xcf93('0x32')]=_[_0xcf93('0x44')](_0x57bce7['model'],_0x57bce7[_0xcf93('0x30')]);_0x119ae9[_0xcf93('0x33')]=_[_0xcf93('0x44')](_0x57bce7[_0xcf93('0x2f')],qs[_0xcf93('0x34')](_0x4a4ed8[_0xcf93('0x30')][_0xcf93('0x34')]));_0x119ae9[_0xcf93('0x33')]=_0x119ae9[_0xcf93('0x33')]['length']?_0x119ae9[_0xcf93('0x33')]:_0x57bce7[_0xcf93('0x2f')];if(_0x4a4ed8[_0xcf93('0x30')][_0xcf93('0x3f')]){_0x119ae9[_0xcf93('0x45')]=[{'all':!![]}];}_0x119ae9=_[_0xcf93('0x3c')]({},_0x119ae9,_0x4a4ed8[_0xcf93('0x3e')]);return db['JscriptyQuestionReport'][_0xcf93('0x46')](_0x119ae9)[_0xcf93('0x25')](handleEntityNotFound(_0x338b58,null))[_0xcf93('0x25')](respondWithResult(_0x338b58,null))[_0xcf93('0x41')](handleError(_0x338b58,null));};exports[_0xcf93('0x47')]=function(_0xfb0392,_0x3832d9){return db[_0xcf93('0x2c')][_0xcf93('0x47')](_0xfb0392[_0xcf93('0x48')],{})['then'](respondWithResult(_0x3832d9,0xc9))[_0xcf93('0x41')](handleError(_0x3832d9,null));};exports[_0xcf93('0x24')]=function(_0x14093b,_0x182f84){if(_0x14093b[_0xcf93('0x48')]['id']){delete _0x14093b[_0xcf93('0x48')]['id'];}return db[_0xcf93('0x2c')]['find']({'where':{'id':_0x14093b[_0xcf93('0x42')]['id']}})['then'](handleEntityNotFound(_0x182f84,null))[_0xcf93('0x25')](saveUpdates(_0x14093b['body'],null))[_0xcf93('0x25')](respondWithResult(_0x182f84,null))[_0xcf93('0x41')](handleError(_0x182f84,null));};exports[_0xcf93('0x49')]=function(_0x4123c0,_0x1dbc35){return db[_0xcf93('0x2c')][_0xcf93('0x46')]({'where':{'id':_0x4123c0[_0xcf93('0x42')]['id']}})[_0xcf93('0x25')](handleEntityNotFound(_0x1dbc35,null))[_0xcf93('0x25')](removeEntity(_0x1dbc35,null))[_0xcf93('0x41')](handleError(_0x1dbc35,null));};exports[_0xcf93('0x4a')]=function(_0x9e6db6,_0x5be00c){return db[_0xcf93('0x2c')][_0xcf93('0x4a')]()[_0xcf93('0x25')](respondWithResult(_0x5be00c,null))[_0xcf93('0x41')](handleError(_0x5be00c,null));}; \ No newline at end of file +var _0xaef3=['fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes'];(function(_0x434138,_0x74656){var _0x40ebdd=function(_0x2b8c41){while(--_0x2b8c41){_0x434138['push'](_0x434138['shift']());}};_0x40ebdd(++_0x74656);}(_0xaef3,0x1ec));var _0x3aef=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0xaef3[_0x2ff762];return _0x158b02;};'use strict';var emlformat=require(_0x3aef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3aef('0x1'));var jsonpatch=require(_0x3aef('0x2'));var rp=require(_0x3aef('0x3'));var moment=require(_0x3aef('0x4'));var BPromise=require(_0x3aef('0x5'));var Mustache=require(_0x3aef('0x6'));var util=require('util');var path=require(_0x3aef('0x7'));var sox=require(_0x3aef('0x8'));var csv=require(_0x3aef('0x9'));var ejs=require(_0x3aef('0xa'));var fs=require('fs');var fs_extra=require(_0x3aef('0xb'));var _=require(_0x3aef('0xc'));var squel=require(_0x3aef('0xd'));var crypto=require(_0x3aef('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3aef('0xf'));var toCsv=require(_0x3aef('0x9'));var querystring=require(_0x3aef('0x10'));var Papa=require(_0x3aef('0x11'));var Redis=require(_0x3aef('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3aef('0x13'));var logger=require(_0x3aef('0x14'))(_0x3aef('0x15'));var utils=require(_0x3aef('0x16'));var config=require(_0x3aef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3aef('0x18'))['db'];function respondWithStatusCode(_0x2f823b,_0x12d213){_0x12d213=_0x12d213||0xcc;return function(_0x3be9e1){if(_0x3be9e1){return _0x2f823b[_0x3aef('0x19')](_0x12d213);}return _0x2f823b[_0x3aef('0x1a')](_0x12d213)[_0x3aef('0x1b')]();};}function respondWithResult(_0x2734a4,_0x20aee7){_0x20aee7=_0x20aee7||0xc8;return function(_0xf42e92){if(_0xf42e92){return _0x2734a4['status'](_0x20aee7)[_0x3aef('0x1c')](_0xf42e92);}};}function respondWithFilteredResult(_0x325898,_0x321228){return function(_0x1edc91){if(_0x1edc91){var _0x235cb8=typeof _0x321228[_0x3aef('0x1d')]==='undefined'&&typeof _0x321228[_0x3aef('0x1e')]==='undefined';var _0x440747=_0x1edc91['count'];var _0x4f1496=_0x235cb8?0x0:_0x321228[_0x3aef('0x1d')];var _0x11dbeb=_0x235cb8?_0x1edc91[_0x3aef('0x1f')]:_0x321228[_0x3aef('0x1d')]+_0x321228['limit'];var _0x3493ed;if(_0x11dbeb>=_0x440747){_0x11dbeb=_0x440747;_0x3493ed=0xc8;}else{_0x3493ed=0xce;}_0x325898[_0x3aef('0x1a')](_0x3493ed);return _0x325898['set'](_0x3aef('0x20'),_0x4f1496+'-'+_0x11dbeb+'/'+_0x440747)[_0x3aef('0x1c')](_0x1edc91);}return null;};}function patchUpdates(_0x40b9ce){return function(_0x5b7879){try{jsonpatch[_0x3aef('0x21')](_0x5b7879,_0x40b9ce,!![]);}catch(_0x1a8f96){return BPromise[_0x3aef('0x22')](_0x1a8f96);}return _0x5b7879[_0x3aef('0x23')]();};}function saveUpdates(_0x406aa5,_0x2cf7c8){return function(_0x5245a4){if(_0x5245a4){return _0x5245a4[_0x3aef('0x24')](_0x406aa5)[_0x3aef('0x25')](function(_0x5d1ada){return _0x5d1ada;});}return null;};}function removeEntity(_0x863e6c,_0x460bb2){return function(_0x3b28f7){if(_0x3b28f7){return _0x3b28f7[_0x3aef('0x26')]()[_0x3aef('0x25')](function(){_0x863e6c[_0x3aef('0x1a')](0xcc)[_0x3aef('0x1b')]();});}};}function handleEntityNotFound(_0x1a0092,_0x508253){return function(_0x2d51e5){if(!_0x2d51e5){_0x1a0092[_0x3aef('0x19')](0x194);}return _0x2d51e5;};}function handleError(_0x2967a1,_0x12a2d6){_0x12a2d6=_0x12a2d6||0x1f4;return function(_0x489bd4){logger[_0x3aef('0x27')](_0x489bd4[_0x3aef('0x28')]);if(_0x489bd4[_0x3aef('0x29')]){delete _0x489bd4[_0x3aef('0x29')];}_0x2967a1[_0x3aef('0x1a')](_0x12a2d6)[_0x3aef('0x2a')](_0x489bd4);};}exports[_0x3aef('0x2b')]=function(_0x10d919,_0x5101fb){var _0x3a45ec={},_0x496a83={},_0xa17121={'count':0x0,'rows':[]};var _0x2aac82=_[_0x3aef('0x2c')](db[_0x3aef('0x2d')][_0x3aef('0x2e')],function(_0x5c704d){return{'name':_0x5c704d[_0x3aef('0x2f')],'type':_0x5c704d['type'][_0x3aef('0x30')]};});_0x496a83['model']=_['map'](_0x2aac82,_0x3aef('0x29'));_0x496a83[_0x3aef('0x31')]=_['keys'](_0x10d919[_0x3aef('0x31')]);_0x496a83[_0x3aef('0x32')]=_[_0x3aef('0x33')](_0x496a83[_0x3aef('0x34')],_0x496a83['query']);_0x3a45ec[_0x3aef('0x35')]=_['intersection'](_0x496a83[_0x3aef('0x34')],qs[_0x3aef('0x36')](_0x10d919[_0x3aef('0x31')][_0x3aef('0x36')]));_0x3a45ec[_0x3aef('0x35')]=_0x3a45ec[_0x3aef('0x35')][_0x3aef('0x37')]?_0x3a45ec[_0x3aef('0x35')]:_0x496a83['model'];if(!_0x10d919[_0x3aef('0x31')]['hasOwnProperty'](_0x3aef('0x38'))){_0x3a45ec[_0x3aef('0x1e')]=qs[_0x3aef('0x1e')](_0x10d919['query'][_0x3aef('0x1e')]);_0x3a45ec[_0x3aef('0x1d')]=qs[_0x3aef('0x1d')](_0x10d919[_0x3aef('0x31')][_0x3aef('0x1d')]);}_0x3a45ec[_0x3aef('0x39')]=qs[_0x3aef('0x3a')](_0x10d919[_0x3aef('0x31')][_0x3aef('0x3a')]);_0x3a45ec[_0x3aef('0x3b')]=qs[_0x3aef('0x32')](_[_0x3aef('0x3c')](_0x10d919[_0x3aef('0x31')],_0x496a83['filters']),_0x2aac82);if(_0x10d919['query']['filter']){_0x3a45ec[_0x3aef('0x3b')]=_['merge'](_0x3a45ec[_0x3aef('0x3b')],{'$or':_['map'](_0x2aac82,function(_0x4c4203){if(_0x4c4203[_0x3aef('0x3d')]!==_0x3aef('0x3e')){var _0x10cb13={};_0x10cb13[_0x4c4203[_0x3aef('0x29')]]={'$like':'%'+_0x10d919[_0x3aef('0x31')][_0x3aef('0x3f')]+'%'};return _0x10cb13;}})});}_0x3a45ec=_[_0x3aef('0x40')]({},_0x3a45ec,_0x10d919[_0x3aef('0x41')]);var _0x56a65d={'where':_0x3a45ec[_0x3aef('0x3b')]};return db[_0x3aef('0x2d')]['count'](_0x56a65d)[_0x3aef('0x25')](function(_0x117950){_0xa17121[_0x3aef('0x1f')]=_0x117950;if(_0x10d919[_0x3aef('0x31')][_0x3aef('0x42')]){_0x3a45ec[_0x3aef('0x43')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x3aef('0x44')](_0x3a45ec);})[_0x3aef('0x25')](function(_0x3fefd6){_0xa17121[_0x3aef('0x45')]=_0x3fefd6;return _0xa17121;})['then'](respondWithFilteredResult(_0x5101fb,_0x3a45ec))[_0x3aef('0x46')](handleError(_0x5101fb,null));};exports[_0x3aef('0x47')]=function(_0x115ef5,_0x348c6c){var _0x3a212a={'raw':!![],'where':{'id':_0x115ef5[_0x3aef('0x48')]['id']}},_0x4a475e={};_0x4a475e[_0x3aef('0x34')]=_[_0x3aef('0x49')](db[_0x3aef('0x2d')]['rawAttributes']);_0x4a475e['query']=_[_0x3aef('0x49')](_0x115ef5[_0x3aef('0x31')]);_0x4a475e[_0x3aef('0x32')]=_[_0x3aef('0x33')](_0x4a475e[_0x3aef('0x34')],_0x4a475e['query']);_0x3a212a[_0x3aef('0x35')]=_[_0x3aef('0x33')](_0x4a475e[_0x3aef('0x34')],qs[_0x3aef('0x36')](_0x115ef5[_0x3aef('0x31')][_0x3aef('0x36')]));_0x3a212a['attributes']=_0x3a212a['attributes']['length']?_0x3a212a[_0x3aef('0x35')]:_0x4a475e[_0x3aef('0x34')];if(_0x115ef5[_0x3aef('0x31')][_0x3aef('0x42')]){_0x3a212a['include']=[{'all':!![]}];}_0x3a212a=_['merge']({},_0x3a212a,_0x115ef5[_0x3aef('0x41')]);return db[_0x3aef('0x2d')][_0x3aef('0x4a')](_0x3a212a)[_0x3aef('0x25')](handleEntityNotFound(_0x348c6c,null))['then'](respondWithResult(_0x348c6c,null))[_0x3aef('0x46')](handleError(_0x348c6c,null));};exports['create']=function(_0x3b40c1,_0x59518c){return db[_0x3aef('0x2d')][_0x3aef('0x4b')](_0x3b40c1[_0x3aef('0x4c')],{})[_0x3aef('0x25')](respondWithResult(_0x59518c,0xc9))[_0x3aef('0x46')](handleError(_0x59518c,null));};exports[_0x3aef('0x24')]=function(_0x244f2e,_0xafbe2){if(_0x244f2e[_0x3aef('0x4c')]['id']){delete _0x244f2e[_0x3aef('0x4c')]['id'];}return db[_0x3aef('0x2d')][_0x3aef('0x4a')]({'where':{'id':_0x244f2e[_0x3aef('0x48')]['id']}})[_0x3aef('0x25')](handleEntityNotFound(_0xafbe2,null))['then'](saveUpdates(_0x244f2e['body'],null))[_0x3aef('0x25')](respondWithResult(_0xafbe2,null))[_0x3aef('0x46')](handleError(_0xafbe2,null));};exports[_0x3aef('0x26')]=function(_0x2df64f,_0x4ad2e4){return db[_0x3aef('0x2d')]['find']({'where':{'id':_0x2df64f[_0x3aef('0x48')]['id']}})[_0x3aef('0x25')](handleEntityNotFound(_0x4ad2e4,null))['then'](removeEntity(_0x4ad2e4,null))[_0x3aef('0x46')](handleError(_0x4ad2e4,null));};exports[_0x3aef('0x4d')]=function(_0x2f360f,_0x18237e){return db[_0x3aef('0x2d')][_0x3aef('0x4d')]()[_0x3aef('0x25')](respondWithResult(_0x18237e,null))['catch'](handleError(_0x18237e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index d2ef24f..a8143c4 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 _0xda36=['api','moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda36,0x1d1));var _0x6da3=function(_0x46b968,_0xc65e97){_0x46b968=_0x46b968-0x0;var _0x3044d0=_0xda36[_0x46b968];return _0x3044d0;};'use strict';var _=require(_0x6da3('0x0'));var util=require(_0x6da3('0x1'));var logger=require(_0x6da3('0x2'))(_0x6da3('0x3'));var moment=require(_0x6da3('0x4'));var BPromise=require(_0x6da3('0x5'));var rp=require(_0x6da3('0x6'));var fs=require('fs');var path=require(_0x6da3('0x7'));var rimraf=require(_0x6da3('0x8'));var config=require('../../config/environment');var attributes=require(_0x6da3('0x9'));module['exports']=function(_0x4d468d,_0x121ec0){return _0x4d468d[_0x6da3('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x6da3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x426c=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x56f43b,_0x12f74b){var _0x2a81de=function(_0x3e22c4){while(--_0x3e22c4){_0x56f43b['push'](_0x56f43b['shift']());}};_0x2a81de(++_0x12f74b);}(_0x426c,0x160));var _0xc426=function(_0x434010,_0x591dd5){_0x434010=_0x434010-0x0;var _0x37cab1=_0x426c[_0x434010];return _0x37cab1;};'use strict';var _=require(_0xc426('0x0'));var util=require(_0xc426('0x1'));var logger=require('../../config/logger')(_0xc426('0x2'));var moment=require(_0xc426('0x3'));var BPromise=require(_0xc426('0x4'));var rp=require(_0xc426('0x5'));var fs=require('fs');var path=require(_0xc426('0x6'));var rimraf=require(_0xc426('0x7'));var config=require(_0xc426('0x8'));var attributes=require(_0xc426('0x9'));module[_0xc426('0xa')]=function(_0x3939b2,_0x570e4a){return _0x3939b2[_0xc426('0xb')](_0xc426('0xc'),attributes,{'tableName':_0xc426('0xd'),'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 23ecf8a..7727351 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 _0x6ba2=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x413601,_0x59a43a){var _0x24229d=function(_0x17c706){while(--_0x17c706){_0x413601['push'](_0x413601['shift']());}};_0x24229d(++_0x59a43a);}(_0x6ba2,0x1e1));var _0x26ba=function(_0x1bba1a,_0xdb4f8b){_0x1bba1a=_0x1bba1a-0x0;var _0x4ed799=_0x6ba2[_0x1bba1a];return _0x4ed799;};'use strict';var _=require(_0x26ba('0x0'));var util=require(_0x26ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x26ba('0x2'));var fs=require('fs');var Redis=require(_0x26ba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x26ba('0x4'));var logger=require('../../config/logger')(_0x26ba('0x5'));var config=require(_0x26ba('0x6'));var jayson=require(_0x26ba('0x7'));var client=jayson[_0x26ba('0x8')][_0x26ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x286d1c,_0x1e56cf,_0x36107e){return new BPromise(function(_0xfb9c68,_0x393870){return client[_0x26ba('0xa')](_0x286d1c,_0x36107e)['then'](function(_0x3ea009){logger[_0x26ba('0xb')](_0x26ba('0xc'),_0x1e56cf,'request\x20sent');logger[_0x26ba('0xd')](_0x26ba('0xe'),_0x1e56cf,_0x26ba('0xf'),JSON[_0x26ba('0x10')](_0x3ea009));if(_0x3ea009[_0x26ba('0x11')]){if(_0x3ea009[_0x26ba('0x11')][_0x26ba('0x12')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e56cf,_0x3ea009['error'][_0x26ba('0x13')]);return _0x393870(_0x3ea009[_0x26ba('0x11')][_0x26ba('0x13')]);}logger[_0x26ba('0x11')](_0x26ba('0xc'),_0x1e56cf,_0x3ea009[_0x26ba('0x11')][_0x26ba('0x13')]);return _0xfb9c68(_0x3ea009[_0x26ba('0x11')][_0x26ba('0x13')]);}else{logger[_0x26ba('0xb')](_0x26ba('0xc'),_0x1e56cf,_0x26ba('0xf'));_0xfb9c68(_0x3ea009[_0x26ba('0x14')][_0x26ba('0x13')]);}})['catch'](function(_0x8ef5fe){logger[_0x26ba('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e56cf,_0x8ef5fe);_0x393870(_0x8ef5fe);});});} \ No newline at end of file +var _0x113d=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment'];(function(_0xe21e15,_0x603dc6){var _0x29c36a=function(_0x4662fd){while(--_0x4662fd){_0xe21e15['push'](_0xe21e15['shift']());}};_0x29c36a(++_0x603dc6);}(_0x113d,0x131));var _0xd113=function(_0x569377,_0x5db027){_0x569377=_0x569377-0x0;var _0x2052d7=_0x113d[_0x569377];return _0x2052d7;};'use strict';var _=require(_0xd113('0x0'));var util=require(_0xd113('0x1'));var moment=require(_0xd113('0x2'));var BPromise=require(_0xd113('0x3'));var rs=require(_0xd113('0x4'));var fs=require('fs');var Redis=require(_0xd113('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd113('0x6'));var logger=require(_0xd113('0x7'))('rpc');var config=require(_0xd113('0x8'));var jayson=require(_0xd113('0x9'));var client=jayson['client'][_0xd113('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b25b1,_0x28f24b,_0x1e4df6){return new BPromise(function(_0x150c6f,_0xd1cce1){return client[_0xd113('0xb')](_0x2b25b1,_0x1e4df6)[_0xd113('0xc')](function(_0x36655b){logger[_0xd113('0xd')](_0xd113('0xe'),_0x28f24b,_0xd113('0xf'));logger[_0xd113('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x28f24b,_0xd113('0xf'),JSON[_0xd113('0x11')](_0x36655b));if(_0x36655b[_0xd113('0x12')]){if(_0x36655b[_0xd113('0x12')]['code']===0x1f4){logger[_0xd113('0x12')](_0xd113('0xe'),_0x28f24b,_0x36655b['error'][_0xd113('0x13')]);return _0xd1cce1(_0x36655b[_0xd113('0x12')][_0xd113('0x13')]);}logger[_0xd113('0x12')](_0xd113('0xe'),_0x28f24b,_0x36655b['error'][_0xd113('0x13')]);return _0x150c6f(_0x36655b['error']['message']);}else{logger[_0xd113('0xd')](_0xd113('0xe'),_0x28f24b,_0xd113('0xf'));_0x150c6f(_0x36655b[_0xd113('0x14')][_0xd113('0x13')]);}})[_0xd113('0x15')](function(_0x46e2d1){logger['error'](_0xd113('0xe'),_0x28f24b,_0x46e2d1);_0xd1cce1(_0x46e2d1);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2724cbe..0d46b37 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 _0x3753=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','show','/:id/questions','getQuestions','create','put','update','delete','/:id'];(function(_0x32efbc,_0x4ccb56){var _0x55d4ca=function(_0x4c7647){while(--_0x4c7647){_0x32efbc['push'](_0x32efbc['shift']());}};_0x55d4ca(++_0x4ccb56);}(_0x3753,0xa3));var _0x3375=function(_0x25d63b,_0x522f06){_0x25d63b=_0x25d63b-0x0;var _0x44a4c1=_0x3753[_0x25d63b];return _0x44a4c1;};'use strict';var multer=require(_0x3375('0x0'));var util=require(_0x3375('0x1'));var path=require(_0x3375('0x2'));var timeout=require(_0x3375('0x3'));var express=require(_0x3375('0x4'));var router=express[_0x3375('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3375('0x6'));var interaction=require(_0x3375('0x7'));var config=require('../../config/environment');var controller=require(_0x3375('0x8'));router[_0x3375('0x9')]('/',auth[_0x3375('0xa')](),controller[_0x3375('0xb')]);router['get'](_0x3375('0xc'),auth[_0x3375('0xa')](),controller['describe']);router[_0x3375('0x9')]('/:id',auth[_0x3375('0xa')](),controller[_0x3375('0xd')]);router[_0x3375('0x9')](_0x3375('0xe'),auth[_0x3375('0xa')](),controller[_0x3375('0xf')]);router['post']('/',auth[_0x3375('0xa')](),controller[_0x3375('0x10')]);router[_0x3375('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3375('0x12')]);router[_0x3375('0x13')](_0x3375('0x14'),auth[_0x3375('0xa')](),controller[_0x3375('0x15')]);module[_0x3375('0x16')]=router; \ No newline at end of file +var _0x5308=['/:id/questions','post','put','/:id','update','delete','exports','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show'];(function(_0x132f0e,_0x4929dc){var _0x27b175=function(_0xb417d3){while(--_0xb417d3){_0x132f0e['push'](_0x132f0e['shift']());}};_0x27b175(++_0x4929dc);}(_0x5308,0x1c7));var _0x8530=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0x5308[_0x257495];return _0x3849aa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8530('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8530('0x1'));var auth=require(_0x8530('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x8530('0x3')]('/',auth[_0x8530('0x4')](),controller[_0x8530('0x5')]);router[_0x8530('0x3')](_0x8530('0x6'),auth['isAuthenticated'](),controller[_0x8530('0x7')]);router[_0x8530('0x3')]('/:id',auth['isAuthenticated'](),controller[_0x8530('0x8')]);router['get'](_0x8530('0x9'),auth[_0x8530('0x4')](),controller['getQuestions']);router[_0x8530('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8530('0xb')](_0x8530('0xc'),auth[_0x8530('0x4')](),controller[_0x8530('0xd')]);router[_0x8530('0xe')](_0x8530('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x8530('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 278a34e..26e2039 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 _0xf875=['DATE','STRING','moment','sequelize','exports','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x365ed9,_0x13a315){var _0x22674b=function(_0x354bcd){while(--_0x354bcd){_0x365ed9['push'](_0x365ed9['shift']());}};_0x22674b(++_0x13a315);}(_0xf875,0x107));var _0x5f87=function(_0x40b7ec,_0x307707){_0x40b7ec=_0x40b7ec-0x0;var _0x72b976=_0xf875[_0x40b7ec];return _0x72b976;};'use strict';var moment=require(_0x5f87('0x0'));var Sequelize=require(_0x5f87('0x1'));module[_0x5f87('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x43a522){this[_0x5f87('0x3')](_0x5f87('0x4'),_0x43a522);this['setDataValue'](_0x5f87('0x5'),moment()['format'](_0x5f87('0x6')));}},'endtime':{'type':Sequelize[_0x5f87('0x7')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x5f87('0x8')]},'queue':{'type':Sequelize[_0x5f87('0x8')]},'uniqueid':{'type':Sequelize[_0x5f87('0x8')]},'calleridname':{'type':Sequelize[_0x5f87('0x8')]},'calleridnum':{'type':Sequelize[_0x5f87('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2cdc=['setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','DATE'];(function(_0x5dda8f,_0x22de9a){var _0xf1f0e6=function(_0xcc89f){while(--_0xcc89f){_0x5dda8f['push'](_0x5dda8f['shift']());}};_0xf1f0e6(++_0x22de9a);}(_0x2cdc,0xbd));var _0xc2cd=function(_0x1dd239,_0x2b139a){_0x1dd239=_0x1dd239-0x0;var _0x180464=_0x2cdc[_0x1dd239];return _0x180464;};'use strict';var moment=require(_0xc2cd('0x0'));var Sequelize=require(_0xc2cd('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xc2cd('0x2')],'set':function(_0x194f20){this[_0xc2cd('0x3')]('starttime',_0x194f20);this[_0xc2cd('0x3')](_0xc2cd('0x4'),moment()[_0xc2cd('0x5')](_0xc2cd('0x6')));}},'endtime':{'type':Sequelize[_0xc2cd('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc2cd('0x7')]},'uniqueid':{'type':Sequelize[_0xc2cd('0x7')]},'calleridname':{'type':Sequelize[_0xc2cd('0x7')]},'calleridnum':{'type':Sequelize[_0xc2cd('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c734064..e1f402e 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 _0xbb31=['../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','send','index','map','JscriptySessionReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','length','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','includeAll','findAll','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x4a3a74,_0x10f474){var _0x2e8985=function(_0x509e51){while(--_0x509e51){_0x4a3a74['push'](_0x4a3a74['shift']());}};_0x2e8985(++_0x10f474);}(_0xbb31,0x11b));var _0x1bb3=function(_0x1c6ce7,_0x2142c8){_0x1c6ce7=_0x1c6ce7-0x0;var _0x2be6c7=_0xbb31[_0x1c6ce7];return _0x2be6c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bb3('0x0'));var zipdir=require(_0x1bb3('0x1'));var jsonpatch=require(_0x1bb3('0x2'));var rp=require('request-promise');var moment=require(_0x1bb3('0x3'));var BPromise=require(_0x1bb3('0x4'));var Mustache=require(_0x1bb3('0x5'));var util=require(_0x1bb3('0x6'));var path=require(_0x1bb3('0x7'));var sox=require(_0x1bb3('0x8'));var csv=require(_0x1bb3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bb3('0xa'));var squel=require(_0x1bb3('0xb'));var crypto=require(_0x1bb3('0xc'));var jsforce=require(_0x1bb3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1bb3('0x9'));var querystring=require(_0x1bb3('0xe'));var Papa=require('papaparse');var Redis=require(_0x1bb3('0xf'));var authService=require(_0x1bb3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1bb3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bb3('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1bb3('0x13'));var licenseUtil=require(_0x1bb3('0x14'));var db=require(_0x1bb3('0x15'))['db'];function respondWithStatusCode(_0x360b95,_0x40d093){_0x40d093=_0x40d093||0xcc;return function(_0x267298){if(_0x267298){return _0x360b95['sendStatus'](_0x40d093);}return _0x360b95[_0x1bb3('0x16')](_0x40d093)[_0x1bb3('0x17')]();};}function respondWithResult(_0x4e4101,_0x3996fe){_0x3996fe=_0x3996fe||0xc8;return function(_0x506139){if(_0x506139){return _0x4e4101['status'](_0x3996fe)['json'](_0x506139);}};}function respondWithFilteredResult(_0x2b69da,_0xaf20d5){return function(_0xabfe9f){if(_0xabfe9f){var _0x44eb3c=typeof _0xaf20d5[_0x1bb3('0x18')]===_0x1bb3('0x19')&&typeof _0xaf20d5['limit']===_0x1bb3('0x19');var _0x170051=_0xabfe9f[_0x1bb3('0x1a')];var _0x59d448=_0x44eb3c?0x0:_0xaf20d5[_0x1bb3('0x18')];var _0x1d41ef=_0x44eb3c?_0xabfe9f[_0x1bb3('0x1a')]:_0xaf20d5[_0x1bb3('0x18')]+_0xaf20d5[_0x1bb3('0x1b')];var _0x4af67c;if(_0x1d41ef>=_0x170051){_0x1d41ef=_0x170051;_0x4af67c=0xc8;}else{_0x4af67c=0xce;}_0x2b69da[_0x1bb3('0x16')](_0x4af67c);return _0x2b69da[_0x1bb3('0x1c')](_0x1bb3('0x1d'),_0x59d448+'-'+_0x1d41ef+'/'+_0x170051)[_0x1bb3('0x1e')](_0xabfe9f);}return null;};}function patchUpdates(_0x44c293){return function(_0x12afcb){try{jsonpatch[_0x1bb3('0x1f')](_0x12afcb,_0x44c293,!![]);}catch(_0x333fc5){return BPromise[_0x1bb3('0x20')](_0x333fc5);}return _0x12afcb[_0x1bb3('0x21')]();};}function saveUpdates(_0x351d1a,_0xf006e9){return function(_0x5995a0){if(_0x5995a0){return _0x5995a0['update'](_0x351d1a)[_0x1bb3('0x22')](function(_0x467ed9){return _0x467ed9;});}return null;};}function removeEntity(_0x19c417,_0x5b4e39){return function(_0x381768){if(_0x381768){return _0x381768[_0x1bb3('0x23')]()[_0x1bb3('0x22')](function(){_0x19c417[_0x1bb3('0x16')](0xcc)[_0x1bb3('0x17')]();});}};}function handleEntityNotFound(_0x43a56a,_0x4cceae){return function(_0xae58f0){if(!_0xae58f0){_0x43a56a[_0x1bb3('0x24')](0x194);}return _0xae58f0;};}function handleError(_0x3c4729,_0x4647aa){_0x4647aa=_0x4647aa||0x1f4;return function(_0x1924eb){logger[_0x1bb3('0x25')](_0x1924eb[_0x1bb3('0x26')]);if(_0x1924eb['name']){delete _0x1924eb['name'];}_0x3c4729[_0x1bb3('0x16')](_0x4647aa)[_0x1bb3('0x27')](_0x1924eb);};}exports[_0x1bb3('0x28')]=function(_0x43791d,_0x49450d){var _0x2b9b3a={},_0x430e65={},_0x4d537a={'count':0x0,'rows':[]};var _0x1cc163=_[_0x1bb3('0x29')](db[_0x1bb3('0x2a')][_0x1bb3('0x2b')],function(_0x5ecce5){return{'name':_0x5ecce5['fieldName'],'type':_0x5ecce5[_0x1bb3('0x2c')]['key']};});_0x430e65[_0x1bb3('0x2d')]=_['map'](_0x1cc163,'name');_0x430e65[_0x1bb3('0x2e')]=_[_0x1bb3('0x2f')](_0x43791d[_0x1bb3('0x2e')]);_0x430e65[_0x1bb3('0x30')]=_[_0x1bb3('0x31')](_0x430e65[_0x1bb3('0x2d')],_0x430e65[_0x1bb3('0x2e')]);_0x2b9b3a[_0x1bb3('0x32')]=_[_0x1bb3('0x31')](_0x430e65[_0x1bb3('0x2d')],qs[_0x1bb3('0x33')](_0x43791d[_0x1bb3('0x2e')][_0x1bb3('0x33')]));_0x2b9b3a[_0x1bb3('0x32')]=_0x2b9b3a[_0x1bb3('0x32')]['length']?_0x2b9b3a[_0x1bb3('0x32')]:_0x430e65[_0x1bb3('0x2d')];if(!_0x43791d[_0x1bb3('0x2e')][_0x1bb3('0x34')](_0x1bb3('0x35'))){_0x2b9b3a[_0x1bb3('0x1b')]=qs['limit'](_0x43791d[_0x1bb3('0x2e')]['limit']);_0x2b9b3a[_0x1bb3('0x18')]=qs[_0x1bb3('0x18')](_0x43791d[_0x1bb3('0x2e')][_0x1bb3('0x18')]);}_0x2b9b3a['order']=qs[_0x1bb3('0x36')](_0x43791d[_0x1bb3('0x2e')][_0x1bb3('0x36')]);_0x2b9b3a[_0x1bb3('0x37')]=qs[_0x1bb3('0x30')](_[_0x1bb3('0x38')](_0x43791d[_0x1bb3('0x2e')],_0x430e65[_0x1bb3('0x30')]),_0x1cc163);if(_0x43791d[_0x1bb3('0x2e')][_0x1bb3('0x39')]){_0x2b9b3a[_0x1bb3('0x37')]=_['merge'](_0x2b9b3a[_0x1bb3('0x37')],{'$or':_[_0x1bb3('0x29')](_0x1cc163,function(_0xf9291d){if(_0xf9291d['type']!=='VIRTUAL'){var _0x4afd65={};_0x4afd65[_0xf9291d['name']]={'$like':'%'+_0x43791d[_0x1bb3('0x2e')][_0x1bb3('0x39')]+'%'};return _0x4afd65;}})});}_0x2b9b3a=_[_0x1bb3('0x3a')]({},_0x2b9b3a,_0x43791d[_0x1bb3('0x3b')]);var _0x15841f={'where':_0x2b9b3a[_0x1bb3('0x37')]};return db[_0x1bb3('0x2a')]['count'](_0x15841f)[_0x1bb3('0x22')](function(_0x584c06){_0x4d537a[_0x1bb3('0x1a')]=_0x584c06;if(_0x43791d['query']['includeAll']){_0x2b9b3a[_0x1bb3('0x3c')]=[{'all':!![]}];}return db[_0x1bb3('0x2a')]['findAll'](_0x2b9b3a);})['then'](function(_0x2c573d){_0x4d537a[_0x1bb3('0x3d')]=_0x2c573d;return _0x4d537a;})[_0x1bb3('0x22')](respondWithFilteredResult(_0x49450d,_0x2b9b3a))['catch'](handleError(_0x49450d,null));};exports['show']=function(_0x5b3e30,_0x99de27){var _0xbe1545={'raw':!![],'where':{'id':_0x5b3e30['params']['id']}},_0x36385f={};_0x36385f[_0x1bb3('0x2d')]=_[_0x1bb3('0x2f')](db[_0x1bb3('0x2a')][_0x1bb3('0x2b')]);_0x36385f[_0x1bb3('0x2e')]=_[_0x1bb3('0x2f')](_0x5b3e30[_0x1bb3('0x2e')]);_0x36385f['filters']=_['intersection'](_0x36385f[_0x1bb3('0x2d')],_0x36385f[_0x1bb3('0x2e')]);_0xbe1545[_0x1bb3('0x32')]=_[_0x1bb3('0x31')](_0x36385f[_0x1bb3('0x2d')],qs[_0x1bb3('0x33')](_0x5b3e30[_0x1bb3('0x2e')]['fields']));_0xbe1545[_0x1bb3('0x32')]=_0xbe1545[_0x1bb3('0x32')][_0x1bb3('0x3e')]?_0xbe1545[_0x1bb3('0x32')]:_0x36385f[_0x1bb3('0x2d')];if(_0x5b3e30['query']['includeAll']){_0xbe1545[_0x1bb3('0x3c')]=[{'all':!![]}];}_0xbe1545=_[_0x1bb3('0x3a')]({},_0xbe1545,_0x5b3e30[_0x1bb3('0x3b')]);return db['JscriptySessionReport'][_0x1bb3('0x3f')](_0xbe1545)[_0x1bb3('0x22')](handleEntityNotFound(_0x99de27,null))[_0x1bb3('0x22')](respondWithResult(_0x99de27,null))[_0x1bb3('0x40')](handleError(_0x99de27,null));};exports[_0x1bb3('0x41')]=function(_0x514418,_0x29cf98){return db['JscriptySessionReport'][_0x1bb3('0x41')](_0x514418[_0x1bb3('0x42')],{})['then'](respondWithResult(_0x29cf98,0xc9))['catch'](handleError(_0x29cf98,null));};exports['update']=function(_0x2dcaf5,_0x41cd2e){if(_0x2dcaf5[_0x1bb3('0x42')]['id']){delete _0x2dcaf5[_0x1bb3('0x42')]['id'];}return db[_0x1bb3('0x2a')][_0x1bb3('0x3f')]({'where':{'id':_0x2dcaf5[_0x1bb3('0x43')]['id']}})['then'](handleEntityNotFound(_0x41cd2e,null))[_0x1bb3('0x22')](saveUpdates(_0x2dcaf5['body'],null))[_0x1bb3('0x22')](respondWithResult(_0x41cd2e,null))[_0x1bb3('0x40')](handleError(_0x41cd2e,null));};exports[_0x1bb3('0x23')]=function(_0x425b45,_0x33db9a){return db[_0x1bb3('0x2a')][_0x1bb3('0x3f')]({'where':{'id':_0x425b45['params']['id']}})[_0x1bb3('0x22')](handleEntityNotFound(_0x33db9a,null))['then'](removeEntity(_0x33db9a,null))[_0x1bb3('0x40')](handleError(_0x33db9a,null));};exports['describe']=function(_0x335c4b,_0x12f4ab){return db[_0x1bb3('0x2a')][_0x1bb3('0x44')]()[_0x1bb3('0x22')](respondWithResult(_0x12f4ab,null))[_0x1bb3('0x40')](handleError(_0x12f4ab,null));};exports[_0x1bb3('0x45')]=function(_0x312b1a,_0x16f9b8,_0x32f504){var _0x49db05={'raw':!![],'where':{}};var _0x20e11f={};var _0xddc186={'count':0x0,'rows':[]};return db[_0x1bb3('0x2a')][_0x1bb3('0x46')]({'where':{'id':_0x312b1a[_0x1bb3('0x43')]['id']}})['then'](handleEntityNotFound(_0x16f9b8,null))[_0x1bb3('0x22')](function(_0x55cd29){if(_0x55cd29){_0x20e11f[_0x1bb3('0x2d')]=_[_0x1bb3('0x2f')](db[_0x1bb3('0x47')]['rawAttributes']);_0x20e11f[_0x1bb3('0x2e')]=_['keys'](_0x312b1a[_0x1bb3('0x2e')]);_0x20e11f[_0x1bb3('0x30')]=_[_0x1bb3('0x31')](_0x20e11f['model'],_0x20e11f[_0x1bb3('0x2e')]);_0x49db05[_0x1bb3('0x32')]=_['intersection'](_0x20e11f[_0x1bb3('0x2d')],qs[_0x1bb3('0x33')](_0x312b1a[_0x1bb3('0x2e')]['fields']));_0x49db05[_0x1bb3('0x32')]=_0x49db05[_0x1bb3('0x32')]['length']?_0x49db05[_0x1bb3('0x32')]:_0x20e11f[_0x1bb3('0x2d')];if(!_0x312b1a['query'][_0x1bb3('0x34')](_0x1bb3('0x35'))){_0x49db05[_0x1bb3('0x1b')]=qs['limit'](_0x312b1a['query'][_0x1bb3('0x1b')]);_0x49db05[_0x1bb3('0x18')]=qs[_0x1bb3('0x18')](_0x312b1a[_0x1bb3('0x2e')][_0x1bb3('0x18')]);}_0x49db05[_0x1bb3('0x48')]=qs[_0x1bb3('0x36')](_0x312b1a[_0x1bb3('0x2e')]['sort']);_0x49db05[_0x1bb3('0x37')]=qs[_0x1bb3('0x30')](_[_0x1bb3('0x38')](_0x312b1a[_0x1bb3('0x2e')],_0x20e11f[_0x1bb3('0x30')]));_0x49db05[_0x1bb3('0x37')][_0x1bb3('0x49')]=_0x55cd29['id'];if(_0x312b1a['query']['filter']){_0x49db05[_0x1bb3('0x37')]=_['merge'](_0x49db05['where'],{'$or':_[_0x1bb3('0x29')](_0x49db05['attributes'],function(_0x338571){var _0x76e133={};_0x76e133[_0x338571]={'$like':'%'+_0x312b1a[_0x1bb3('0x2e')][_0x1bb3('0x39')]+'%'};return _0x76e133;})});}_0x49db05=_[_0x1bb3('0x3a')]({},_0x49db05,_0x312b1a[_0x1bb3('0x3b')]);return db[_0x1bb3('0x47')][_0x1bb3('0x1a')]({'where':_0x49db05[_0x1bb3('0x37')]})[_0x1bb3('0x22')](function(_0x1c251d){_0xddc186['count']=_0x1c251d;if(_0x312b1a[_0x1bb3('0x2e')][_0x1bb3('0x4a')]){_0x49db05[_0x1bb3('0x3c')]=[{'all':!![]}];}return db[_0x1bb3('0x47')][_0x1bb3('0x4b')](_0x49db05);})[_0x1bb3('0x22')](function(_0x1a88a7){_0xddc186[_0x1bb3('0x3d')]=_0x1a88a7;return _0xddc186;});}})[_0x1bb3('0x22')](respondWithFilteredResult(_0x16f9b8,_0x49db05))['catch'](handleError(_0x16f9b8,null));}; \ No newline at end of file +var _0x9453=['../../config/logger','api','../../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','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','JscriptySessionReport','length','find','body','describe','rawAttributes','SessionId','JscriptyQuestionReport','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x28986e,_0x535f7d){var _0x5eb8ef=function(_0x148354){while(--_0x148354){_0x28986e['push'](_0x28986e['shift']());}};_0x5eb8ef(++_0x535f7d);}(_0x9453,0x136));var _0x3945=function(_0x2bf818,_0x3c77bf){_0x2bf818=_0x2bf818-0x0;var _0x136855=_0x9453[_0x2bf818];return _0x136855;};'use strict';var emlformat=require(_0x3945('0x0'));var rimraf=require(_0x3945('0x1'));var zipdir=require(_0x3945('0x2'));var jsonpatch=require(_0x3945('0x3'));var rp=require(_0x3945('0x4'));var moment=require(_0x3945('0x5'));var BPromise=require(_0x3945('0x6'));var Mustache=require(_0x3945('0x7'));var util=require(_0x3945('0x8'));var path=require(_0x3945('0x9'));var sox=require(_0x3945('0xa'));var csv=require(_0x3945('0xb'));var ejs=require(_0x3945('0xc'));var fs=require('fs');var fs_extra=require(_0x3945('0xd'));var _=require('lodash');var squel=require(_0x3945('0xe'));var crypto=require(_0x3945('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3945('0xb'));var querystring=require(_0x3945('0x10'));var Papa=require(_0x3945('0x11'));var Redis=require(_0x3945('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3945('0x13'));var as=require(_0x3945('0x14'));var hardwareService=require(_0x3945('0x15'));var logger=require(_0x3945('0x16'))(_0x3945('0x17'));var utils=require('../../config/utils');var config=require(_0x3945('0x18'));var licenseUtil=require(_0x3945('0x19'));var db=require(_0x3945('0x1a'))['db'];function respondWithStatusCode(_0x477c0b,_0x5a8961){_0x5a8961=_0x5a8961||0xcc;return function(_0x4d7c0a){if(_0x4d7c0a){return _0x477c0b[_0x3945('0x1b')](_0x5a8961);}return _0x477c0b[_0x3945('0x1c')](_0x5a8961)[_0x3945('0x1d')]();};}function respondWithResult(_0x57311a,_0x269b44){_0x269b44=_0x269b44||0xc8;return function(_0x3c7955){if(_0x3c7955){return _0x57311a['status'](_0x269b44)[_0x3945('0x1e')](_0x3c7955);}};}function respondWithFilteredResult(_0x17fcb9,_0x465434){return function(_0x5be52f){if(_0x5be52f){var _0x58da21=typeof _0x465434[_0x3945('0x1f')]===_0x3945('0x20')&&typeof _0x465434[_0x3945('0x21')]===_0x3945('0x20');var _0x343a9c=_0x5be52f[_0x3945('0x22')];var _0x1552b7=_0x58da21?0x0:_0x465434['offset'];var _0x22ad4d=_0x58da21?_0x5be52f[_0x3945('0x22')]:_0x465434[_0x3945('0x1f')]+_0x465434[_0x3945('0x21')];var _0x4c8ee7;if(_0x22ad4d>=_0x343a9c){_0x22ad4d=_0x343a9c;_0x4c8ee7=0xc8;}else{_0x4c8ee7=0xce;}_0x17fcb9[_0x3945('0x1c')](_0x4c8ee7);return _0x17fcb9[_0x3945('0x23')](_0x3945('0x24'),_0x1552b7+'-'+_0x22ad4d+'/'+_0x343a9c)[_0x3945('0x1e')](_0x5be52f);}return null;};}function patchUpdates(_0x54902f){return function(_0x11acc8){try{jsonpatch['apply'](_0x11acc8,_0x54902f,!![]);}catch(_0x5a8633){return BPromise[_0x3945('0x25')](_0x5a8633);}return _0x11acc8[_0x3945('0x26')]();};}function saveUpdates(_0x395758,_0x590a5d){return function(_0x51fbc2){if(_0x51fbc2){return _0x51fbc2[_0x3945('0x27')](_0x395758)[_0x3945('0x28')](function(_0x591f7e){return _0x591f7e;});}return null;};}function removeEntity(_0x5acbd0,_0x3b00d3){return function(_0x227f72){if(_0x227f72){return _0x227f72[_0x3945('0x29')]()[_0x3945('0x28')](function(){_0x5acbd0[_0x3945('0x1c')](0xcc)[_0x3945('0x1d')]();});}};}function handleEntityNotFound(_0x2521f1,_0x52d4a6){return function(_0x4943c4){if(!_0x4943c4){_0x2521f1[_0x3945('0x1b')](0x194);}return _0x4943c4;};}function handleError(_0x3aa8f4,_0x2469e2){_0x2469e2=_0x2469e2||0x1f4;return function(_0x4148ab){logger[_0x3945('0x2a')](_0x4148ab[_0x3945('0x2b')]);if(_0x4148ab[_0x3945('0x2c')]){delete _0x4148ab[_0x3945('0x2c')];}_0x3aa8f4[_0x3945('0x1c')](_0x2469e2)[_0x3945('0x2d')](_0x4148ab);};}exports[_0x3945('0x2e')]=function(_0x11f39d,_0x373cd5){var _0x3611e1={},_0x4d6268={},_0x515366={'count':0x0,'rows':[]};var _0x1eec77=_[_0x3945('0x2f')](db['JscriptySessionReport']['rawAttributes'],function(_0x19a837){return{'name':_0x19a837[_0x3945('0x30')],'type':_0x19a837[_0x3945('0x31')][_0x3945('0x32')]};});_0x4d6268[_0x3945('0x33')]=_[_0x3945('0x2f')](_0x1eec77,'name');_0x4d6268[_0x3945('0x34')]=_[_0x3945('0x35')](_0x11f39d[_0x3945('0x34')]);_0x4d6268['filters']=_[_0x3945('0x36')](_0x4d6268[_0x3945('0x33')],_0x4d6268[_0x3945('0x34')]);_0x3611e1[_0x3945('0x37')]=_['intersection'](_0x4d6268['model'],qs[_0x3945('0x38')](_0x11f39d[_0x3945('0x34')][_0x3945('0x38')]));_0x3611e1[_0x3945('0x37')]=_0x3611e1[_0x3945('0x37')]['length']?_0x3611e1[_0x3945('0x37')]:_0x4d6268['model'];if(!_0x11f39d[_0x3945('0x34')][_0x3945('0x39')](_0x3945('0x3a'))){_0x3611e1['limit']=qs['limit'](_0x11f39d[_0x3945('0x34')][_0x3945('0x21')]);_0x3611e1[_0x3945('0x1f')]=qs[_0x3945('0x1f')](_0x11f39d[_0x3945('0x34')][_0x3945('0x1f')]);}_0x3611e1[_0x3945('0x3b')]=qs['sort'](_0x11f39d[_0x3945('0x34')][_0x3945('0x3c')]);_0x3611e1[_0x3945('0x3d')]=qs[_0x3945('0x3e')](_[_0x3945('0x3f')](_0x11f39d[_0x3945('0x34')],_0x4d6268[_0x3945('0x3e')]),_0x1eec77);if(_0x11f39d['query'][_0x3945('0x40')]){_0x3611e1[_0x3945('0x3d')]=_[_0x3945('0x41')](_0x3611e1[_0x3945('0x3d')],{'$or':_[_0x3945('0x2f')](_0x1eec77,function(_0x2e1563){if(_0x2e1563['type']!==_0x3945('0x42')){var _0x5b0ca4={};_0x5b0ca4[_0x2e1563[_0x3945('0x2c')]]={'$like':'%'+_0x11f39d[_0x3945('0x34')][_0x3945('0x40')]+'%'};return _0x5b0ca4;}})});}_0x3611e1=_[_0x3945('0x41')]({},_0x3611e1,_0x11f39d[_0x3945('0x43')]);var _0x26daed={'where':_0x3611e1['where']};return db['JscriptySessionReport']['count'](_0x26daed)[_0x3945('0x28')](function(_0x1bd440){_0x515366[_0x3945('0x22')]=_0x1bd440;if(_0x11f39d[_0x3945('0x34')][_0x3945('0x44')]){_0x3611e1[_0x3945('0x45')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x3611e1);})[_0x3945('0x28')](function(_0xa16b55){_0x515366[_0x3945('0x46')]=_0xa16b55;return _0x515366;})[_0x3945('0x28')](respondWithFilteredResult(_0x373cd5,_0x3611e1))[_0x3945('0x47')](handleError(_0x373cd5,null));};exports[_0x3945('0x48')]=function(_0x3805d1,_0x4a087e){var _0x5dfdfa={'raw':!![],'where':{'id':_0x3805d1[_0x3945('0x49')]['id']}},_0x836d2c={};_0x836d2c[_0x3945('0x33')]=_[_0x3945('0x35')](db[_0x3945('0x4a')]['rawAttributes']);_0x836d2c[_0x3945('0x34')]=_[_0x3945('0x35')](_0x3805d1['query']);_0x836d2c[_0x3945('0x3e')]=_[_0x3945('0x36')](_0x836d2c[_0x3945('0x33')],_0x836d2c[_0x3945('0x34')]);_0x5dfdfa[_0x3945('0x37')]=_[_0x3945('0x36')](_0x836d2c[_0x3945('0x33')],qs[_0x3945('0x38')](_0x3805d1[_0x3945('0x34')]['fields']));_0x5dfdfa[_0x3945('0x37')]=_0x5dfdfa['attributes'][_0x3945('0x4b')]?_0x5dfdfa[_0x3945('0x37')]:_0x836d2c['model'];if(_0x3805d1[_0x3945('0x34')][_0x3945('0x44')]){_0x5dfdfa[_0x3945('0x45')]=[{'all':!![]}];}_0x5dfdfa=_[_0x3945('0x41')]({},_0x5dfdfa,_0x3805d1[_0x3945('0x43')]);return db[_0x3945('0x4a')][_0x3945('0x4c')](_0x5dfdfa)['then'](handleEntityNotFound(_0x4a087e,null))[_0x3945('0x28')](respondWithResult(_0x4a087e,null))[_0x3945('0x47')](handleError(_0x4a087e,null));};exports['create']=function(_0x26ce7b,_0x3cd08b){return db['JscriptySessionReport']['create'](_0x26ce7b[_0x3945('0x4d')],{})['then'](respondWithResult(_0x3cd08b,0xc9))[_0x3945('0x47')](handleError(_0x3cd08b,null));};exports[_0x3945('0x27')]=function(_0x5ef464,_0x305ab5){if(_0x5ef464['body']['id']){delete _0x5ef464['body']['id'];}return db[_0x3945('0x4a')][_0x3945('0x4c')]({'where':{'id':_0x5ef464[_0x3945('0x49')]['id']}})[_0x3945('0x28')](handleEntityNotFound(_0x305ab5,null))[_0x3945('0x28')](saveUpdates(_0x5ef464[_0x3945('0x4d')],null))[_0x3945('0x28')](respondWithResult(_0x305ab5,null))['catch'](handleError(_0x305ab5,null));};exports[_0x3945('0x29')]=function(_0x48c5a6,_0x242d62){return db[_0x3945('0x4a')][_0x3945('0x4c')]({'where':{'id':_0x48c5a6[_0x3945('0x49')]['id']}})['then'](handleEntityNotFound(_0x242d62,null))[_0x3945('0x28')](removeEntity(_0x242d62,null))[_0x3945('0x47')](handleError(_0x242d62,null));};exports['describe']=function(_0x3bdf22,_0x8086d6){return db[_0x3945('0x4a')][_0x3945('0x4e')]()['then'](respondWithResult(_0x8086d6,null))[_0x3945('0x47')](handleError(_0x8086d6,null));};exports['getQuestions']=function(_0x42eab6,_0x29a2e3,_0x61d41c){var _0x1f98c1={'raw':!![],'where':{}};var _0x54bf63={};var _0xccf4d9={'count':0x0,'rows':[]};return db[_0x3945('0x4a')]['findOne']({'where':{'id':_0x42eab6['params']['id']}})[_0x3945('0x28')](handleEntityNotFound(_0x29a2e3,null))[_0x3945('0x28')](function(_0x4e9c77){if(_0x4e9c77){_0x54bf63[_0x3945('0x33')]=_[_0x3945('0x35')](db['JscriptyQuestionReport'][_0x3945('0x4f')]);_0x54bf63[_0x3945('0x34')]=_[_0x3945('0x35')](_0x42eab6[_0x3945('0x34')]);_0x54bf63[_0x3945('0x3e')]=_[_0x3945('0x36')](_0x54bf63[_0x3945('0x33')],_0x54bf63[_0x3945('0x34')]);_0x1f98c1[_0x3945('0x37')]=_['intersection'](_0x54bf63[_0x3945('0x33')],qs[_0x3945('0x38')](_0x42eab6['query'][_0x3945('0x38')]));_0x1f98c1['attributes']=_0x1f98c1[_0x3945('0x37')]['length']?_0x1f98c1[_0x3945('0x37')]:_0x54bf63['model'];if(!_0x42eab6[_0x3945('0x34')]['hasOwnProperty'](_0x3945('0x3a'))){_0x1f98c1['limit']=qs[_0x3945('0x21')](_0x42eab6['query']['limit']);_0x1f98c1[_0x3945('0x1f')]=qs['offset'](_0x42eab6['query'][_0x3945('0x1f')]);}_0x1f98c1['order']=qs[_0x3945('0x3c')](_0x42eab6['query']['sort']);_0x1f98c1['where']=qs[_0x3945('0x3e')](_['pick'](_0x42eab6['query'],_0x54bf63['filters']));_0x1f98c1[_0x3945('0x3d')][_0x3945('0x50')]=_0x4e9c77['id'];if(_0x42eab6[_0x3945('0x34')][_0x3945('0x40')]){_0x1f98c1['where']=_[_0x3945('0x41')](_0x1f98c1[_0x3945('0x3d')],{'$or':_[_0x3945('0x2f')](_0x1f98c1[_0x3945('0x37')],function(_0x496c5e){var _0x24b45a={};_0x24b45a[_0x496c5e]={'$like':'%'+_0x42eab6[_0x3945('0x34')][_0x3945('0x40')]+'%'};return _0x24b45a;})});}_0x1f98c1=_[_0x3945('0x41')]({},_0x1f98c1,_0x42eab6[_0x3945('0x43')]);return db[_0x3945('0x51')][_0x3945('0x22')]({'where':_0x1f98c1[_0x3945('0x3d')]})['then'](function(_0x267ea0){_0xccf4d9[_0x3945('0x22')]=_0x267ea0;if(_0x42eab6[_0x3945('0x34')][_0x3945('0x44')]){_0x1f98c1['include']=[{'all':!![]}];}return db[_0x3945('0x51')][_0x3945('0x52')](_0x1f98c1);})['then'](function(_0x47079e){_0xccf4d9['rows']=_0x47079e;return _0xccf4d9;});}})[_0x3945('0x28')](respondWithFilteredResult(_0x29a2e3,_0x1f98c1))[_0x3945('0x47')](handleError(_0x29a2e3,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index da28f09..e485aaa 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 _0xfb65=['moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger'];(function(_0x332b8a,_0x2221b2){var _0x245e08=function(_0x36ca87){while(--_0x36ca87){_0x332b8a['push'](_0x332b8a['shift']());}};_0x245e08(++_0x2221b2);}(_0xfb65,0x82));var _0x5fb6=function(_0x1f8231,_0x4dea5d){_0x1f8231=_0x1f8231-0x0;var _0x454072=_0xfb65[_0x1f8231];return _0x454072;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var logger=require(_0x5fb6('0x1'))('api');var moment=require(_0x5fb6('0x2'));var BPromise=require('bluebird');var rp=require(_0x5fb6('0x3'));var fs=require('fs');var path=require(_0x5fb6('0x4'));var rimraf=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var attributes=require(_0x5fb6('0x7'));module[_0x5fb6('0x8')]=function(_0x4dec8f,_0x50782b){return _0x4dec8f[_0x5fb6('0x9')](_0x5fb6('0xa'),attributes,{'tableName':_0x5fb6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x29ccba,_0x39fe53){var _0x182f3d=function(_0x73236b){while(--_0x73236b){_0x29ccba['push'](_0x29ccba['shift']());}};_0x182f3d(++_0x39fe53);}(_0x5fab,0x177));var _0xb5fa=function(_0x5b6828,_0x4a19d9){_0x5b6828=_0x5b6828-0x0;var _0x2dbd2c=_0x5fab[_0x5b6828];return _0x2dbd2c;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 7456749..64dd914 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 _0x323f=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1ad62d,_0x2ba5ee){var _0x20d03c=function(_0x343ee3){while(--_0x343ee3){_0x1ad62d['push'](_0x1ad62d['shift']());}};_0x20d03c(++_0x2ba5ee);}(_0x323f,0x1ee));var _0xf323=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x323f[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1767c4,_0x214226){var _0x54d2c4=function(_0x398b02){while(--_0x398b02){_0x1767c4['push'](_0x1767c4['shift']());}};_0x54d2c4(++_0x214226);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xc85115,_0x4914c3){_0xc85115=_0xc85115-0x0;var _0x545f97=_0xc6ac[_0xc85115];return _0x545f97;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 775c5b6..17f14ec 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 _0x5a96=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','/:id','isAuthenticated','update','multer','util','connect-timeout','express'];(function(_0x1030f0,_0x30a729){var _0x445ff8=function(_0x49f526){while(--_0x49f526){_0x1030f0['push'](_0x1030f0['shift']());}};_0x445ff8(++_0x30a729);}(_0x5a96,0xbc));var _0x65a9=function(_0x4d2157,_0x201cf1){_0x4d2157=_0x4d2157-0x0;var _0x172f80=_0x5a96[_0x4d2157];return _0x172f80;};'use strict';var multer=require(_0x65a9('0x0'));var util=require(_0x65a9('0x1'));var path=require('path');var timeout=require(_0x65a9('0x2'));var express=require(_0x65a9('0x3'));var router=express[_0x65a9('0x4')]();var fs_extra=require(_0x65a9('0x5'));var auth=require(_0x65a9('0x6'));var interaction=require(_0x65a9('0x7'));var config=require('../../config/environment');var controller=require(_0x65a9('0x8'));router['get']('/',controller['index']);router['put'](_0x65a9('0x9'),auth[_0x65a9('0xa')](),controller[_0x65a9('0xb')]);module['exports']=router; \ No newline at end of file +var _0x406f=['./license.controller','get','index','put','isAuthenticated','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x406f,0xe8));var _0xf406=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x406f[_0x220f3f];return _0x1f170e;};'use strict';var multer=require(_0xf406('0x0'));var util=require('util');var path=require(_0xf406('0x1'));var timeout=require('connect-timeout');var express=require(_0xf406('0x2'));var router=express[_0xf406('0x3')]();var fs_extra=require(_0xf406('0x4'));var auth=require(_0xf406('0x5'));var interaction=require(_0xf406('0x6'));var config=require(_0xf406('0x7'));var controller=require(_0xf406('0x8'));router[_0xf406('0x9')]('/',controller[_0xf406('0xa')]);router[_0xf406('0xb')]('/:id',auth[_0xf406('0xc')](),controller[_0xf406('0xd')]);module[_0xf406('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 475a027..cddf194 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 _0xa87a=['sequelize','TEXT','STRING'];(function(_0x5a21e5,_0x1a5ef7){var _0x11b6c7=function(_0x21c101){while(--_0x21c101){_0x5a21e5['push'](_0x5a21e5['shift']());}};_0x11b6c7(++_0x1a5ef7);}(_0xa87a,0x15c));var _0xaa87=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa87a[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require(_0xaa87('0x0'));module['exports']={'license':{'type':Sequelize[_0xaa87('0x1')]},'data1':{'type':Sequelize[_0xaa87('0x2')]},'data2':{'type':Sequelize[_0xaa87('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x82fa=['sequelize','exports','TEXT','STRING'];(function(_0x573247,_0x4d17c5){var _0x42ddf0=function(_0x460c64){while(--_0x460c64){_0x573247['push'](_0x573247['shift']());}};_0x42ddf0(++_0x4d17c5);}(_0x82fa,0x174));var _0xa82f=function(_0xf84315,_0x4aa94a){_0xf84315=_0xf84315-0x0;var _0x275bac=_0x82fa[_0xf84315];return _0x275bac;};'use strict';var Sequelize=require(_0xa82f('0x0'));module[_0xa82f('0x1')]={'license':{'type':Sequelize[_0xa82f('0x2')]},'data1':{'type':Sequelize[_0xa82f('0x3')]},'data2':{'type':Sequelize[_0xa82f('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 0ba04ef..19e8c22 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 _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xf494,0x1c6));var _0x4f49=function(_0x1ce005,_0x1287a5){_0x1ce005=_0x1ce005-0x0;var _0x5c1555=_0xf494[_0x1ce005];return _0x5c1555;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file +var _0x326f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','checkLicense','key','demo','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x326f,0xd1));var _0xf326=function(_0x4fe966,_0x293db9){_0x4fe966=_0x4fe966-0x0;var _0x2c9109=_0x326f[_0x4fe966];return _0x2c9109;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x6a8e89,_0x1ae23a){var _0x2fa28e={'raw':!![],'where':{'id':0x1}},_0x5dbe63={};_0x5dbe63[_0xf326('0x28')]=_[_0xf326('0x29')](db['License'][_0xf326('0x2a')]);_0x5dbe63[_0xf326('0x2b')]=_[_0xf326('0x29')](_0x6a8e89[_0xf326('0x2b')]);_0x5dbe63[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5dbe63[_0xf326('0x28')],_0x5dbe63[_0xf326('0x2b')]);_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2d')](_0x5dbe63['model'],qs[_0xf326('0x2f')](_0x6a8e89[_0xf326('0x2b')][_0xf326('0x2f')]));_0x2fa28e['attributes']=_0x2fa28e[_0xf326('0x2e')][_0xf326('0x30')]?_0x2fa28e[_0xf326('0x2e')]:_0x5dbe63['model'];_0x2fa28e=_['merge']({},_0x2fa28e,_0x6a8e89[_0xf326('0x31')]);return utilLicense[_0xf326('0x32')](_0x2fa28e)[_0xf326('0x24')](respondWithResult(_0x1ae23a,null))[_0xf326('0x33')](handleError(_0x1ae23a,null));};exports[_0xf326('0x22')]=function(_0x2e8a64,_0x62585a){if(_0x2e8a64[_0xf326('0x34')]['id']){delete _0x2e8a64['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x36')]({'where':{'id':_0x2e8a64['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x62585a,null))['then'](function(_0xce1cbb){var _0x481b64=_0xce1cbb['get']({'plain':!![]});return utilLicense[_0xf326('0x37')](_0x481b64,_0x2e8a64['body'][_0xf326('0x38')]);})['then'](function(_0x310dbb){if(!_0x310dbb[_0xf326('0x39')]){return saveUpdates(_0x2e8a64[_0xf326('0x34')],null);}return _0x310dbb;})['then'](respondWithResult(_0x62585a,null))[_0xf326('0x33')](handleError(_0x62585a,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index bdacd6c..ec8b0c0 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 _0x3a89=['../../config/logger','api','moment','request-promise','path','./license.attributes','exports','define','License','license'];(function(_0x4b4a56,_0x446c84){var _0x2eca13=function(_0x5b055e){while(--_0x5b055e){_0x4b4a56['push'](_0x4b4a56['shift']());}};_0x2eca13(++_0x446c84);}(_0x3a89,0x82));var _0x93a8=function(_0x5741b5,_0x40e53d){_0x5741b5=_0x5741b5-0x0;var _0x584d68=_0x3a89[_0x5741b5];return _0x584d68;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x93a8('0x0'))(_0x93a8('0x1'));var moment=require(_0x93a8('0x2'));var BPromise=require('bluebird');var rp=require(_0x93a8('0x3'));var fs=require('fs');var path=require(_0x93a8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x93a8('0x5'));module[_0x93a8('0x6')]=function(_0x481d7f,_0x3d68a9){return _0x481d7f[_0x93a8('0x7')](_0x93a8('0x8'),attributes,{'tableName':_0x93a8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae79=['bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','lodash','util','../../config/logger','moment'];(function(_0x3c12ae,_0xbbf03d){var _0x328e78=function(_0x436964){while(--_0x436964){_0x3c12ae['push'](_0x3c12ae['shift']());}};_0x328e78(++_0xbbf03d);}(_0xae79,0x14e));var _0x9ae7=function(_0xd560cb,_0x404f5b){_0xd560cb=_0xd560cb-0x0;var _0x18ed96=_0xae79[_0xd560cb];return _0x18ed96;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var logger=require(_0x9ae7('0x2'))('api');var moment=require(_0x9ae7('0x3'));var BPromise=require(_0x9ae7('0x4'));var rp=require(_0x9ae7('0x5'));var fs=require('fs');var path=require(_0x9ae7('0x6'));var rimraf=require(_0x9ae7('0x7'));var config=require(_0x9ae7('0x8'));var attributes=require(_0x9ae7('0x9'));module[_0x9ae7('0xa')]=function(_0x16d645,_0x228839){return _0x16d645[_0x9ae7('0xb')](_0x9ae7('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 0e625a5..6448d73 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 _0x7de5=['lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch'];(function(_0xc6a950,_0x30bb6d){var _0x45feee=function(_0x5f0bcf){while(--_0x5f0bcf){_0xc6a950['push'](_0xc6a950['shift']());}};_0x45feee(++_0x30bb6d);}(_0x7de5,0xcc));var _0x57de=function(_0x56cfbc,_0x322ab5){_0x56cfbc=_0x56cfbc-0x0;var _0x1580e1=_0x7de5[_0x56cfbc];return _0x1580e1;};'use strict';var _=require(_0x57de('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x57de('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57de('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x57de('0x3'))(_0x57de('0x4'));var config=require(_0x57de('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x57de('0x6')][_0x57de('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ed370,_0x29c40d,_0x5d8931){return new BPromise(function(_0x1ee881,_0x225f72){return client[_0x57de('0x8')](_0x3ed370,_0x5d8931)[_0x57de('0x9')](function(_0x30ac52){logger['info'](_0x57de('0xa'),_0x29c40d,'request\x20sent');logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x29c40d,_0x57de('0xb'),JSON[_0x57de('0xc')](_0x30ac52));if(_0x30ac52[_0x57de('0xd')]){if(_0x30ac52[_0x57de('0xd')]['code']===0x1f4){logger[_0x57de('0xd')]('License,\x20%s,\x20%s',_0x29c40d,_0x30ac52[_0x57de('0xd')][_0x57de('0xe')]);return _0x225f72(_0x30ac52['error']['message']);}logger[_0x57de('0xd')](_0x57de('0xa'),_0x29c40d,_0x30ac52[_0x57de('0xd')][_0x57de('0xe')]);return _0x1ee881(_0x30ac52[_0x57de('0xd')][_0x57de('0xe')]);}else{logger[_0x57de('0xf')](_0x57de('0xa'),_0x29c40d,_0x57de('0xb'));_0x1ee881(_0x30ac52['result'][_0x57de('0xe')]);}})[_0x57de('0x10')](function(_0x3fd1b7){logger[_0x57de('0xd')](_0x57de('0xa'),_0x29c40d,_0x3fd1b7);_0x225f72(_0x3fd1b7);});});} \ No newline at end of file +var _0x3fc5=['request','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1e4e58,_0x31e1cf){var _0x163805=function(_0x3ad324){while(--_0x3ad324){_0x1e4e58['push'](_0x1e4e58['shift']());}};_0x163805(++_0x31e1cf);}(_0x3fc5,0x187));var _0x53fc=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3fc5[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x53fc('0x0'));var util=require(_0x53fc('0x1'));var moment=require(_0x53fc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53fc('0x3'));var db=require(_0x53fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x53fc('0x5'))('rpc');var config=require(_0x53fc('0x6'));var jayson=require(_0x53fc('0x7'));var client=jayson[_0x53fc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26ab8f,_0x59cc4f,_0x1a314c){return new BPromise(function(_0x2b8e0a,_0x52d70e){return client[_0x53fc('0x9')](_0x26ab8f,_0x1a314c)[_0x53fc('0xa')](function(_0x14c08a){logger['info'](_0x53fc('0xb'),_0x59cc4f,'request\x20sent');logger[_0x53fc('0xc')](_0x53fc('0xd'),_0x59cc4f,'request\x20sent',JSON[_0x53fc('0xe')](_0x14c08a));if(_0x14c08a[_0x53fc('0xf')]){if(_0x14c08a['error'][_0x53fc('0x10')]===0x1f4){logger['error'](_0x53fc('0xb'),_0x59cc4f,_0x14c08a[_0x53fc('0xf')][_0x53fc('0x11')]);return _0x52d70e(_0x14c08a[_0x53fc('0xf')][_0x53fc('0x11')]);}logger[_0x53fc('0xf')](_0x53fc('0xb'),_0x59cc4f,_0x14c08a[_0x53fc('0xf')]['message']);return _0x2b8e0a(_0x14c08a[_0x53fc('0xf')][_0x53fc('0x11')]);}else{logger[_0x53fc('0x12')](_0x53fc('0xb'),_0x59cc4f,'request\x20sent');_0x2b8e0a(_0x14c08a[_0x53fc('0x13')][_0x53fc('0x11')]);}})['catch'](function(_0x24036c){logger['error'](_0x53fc('0xb'),_0x59cc4f,_0x24036c);_0x52d70e(_0x24036c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 4c5f06a..665eecb 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 _0x1bc4=['getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addInteraction','addApplications','/:id/send','send','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','/:id','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/:id/dispositions','getDispositions'];(function(_0x505986,_0x221e4e){var _0x1abb69=function(_0x179512){while(--_0x179512){_0x505986['push'](_0x505986['shift']());}};_0x1abb69(++_0x221e4e);}(_0x1bc4,0xa6));var _0x41bc=function(_0x5e0d38,_0x5de92d){_0x5e0d38=_0x5e0d38-0x0;var _0x2b9b61=_0x1bc4[_0x5e0d38];return _0x2b9b61;};'use strict';var multer=require('multer');var util=require(_0x41bc('0x0'));var path=require(_0x41bc('0x1'));var timeout=require(_0x41bc('0x2'));var express=require(_0x41bc('0x3'));var router=express[_0x41bc('0x4')]();var fs_extra=require(_0x41bc('0x5'));var auth=require(_0x41bc('0x6'));var interaction=require(_0x41bc('0x7'));var config=require(_0x41bc('0x8'));var controller=require(_0x41bc('0x9'));router[_0x41bc('0xa')]('/',auth[_0x41bc('0xb')](),controller['index']);router[_0x41bc('0xa')]('/describe',auth[_0x41bc('0xb')](),controller['describe']);router[_0x41bc('0xa')]('/:id',auth[_0x41bc('0xb')](),controller['show']);router[_0x41bc('0xa')](_0x41bc('0xc'),auth['isAuthenticated'](),controller[_0x41bc('0xd')]);router[_0x41bc('0xa')]('/:id/canned_answers',auth[_0x41bc('0xb')](),controller[_0x41bc('0xe')]);router['get']('/:id/in_servers',auth[_0x41bc('0xb')](),controller[_0x41bc('0xf')]);router[_0x41bc('0xa')](_0x41bc('0x10'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x11')]);router[_0x41bc('0xa')](_0x41bc('0x12'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x13')]);router[_0x41bc('0xa')](_0x41bc('0x14'),auth['isAuthenticated'](),controller[_0x41bc('0x15')]);router[_0x41bc('0xa')](_0x41bc('0x16'),auth[_0x41bc('0xb')](),controller['getMessages']);router[_0x41bc('0xa')](_0x41bc('0x17'),auth['isAuthenticated'](),controller[_0x41bc('0x18')]);router[_0x41bc('0xa')](_0x41bc('0x19'),auth['isAuthenticated'](),controller[_0x41bc('0x1a')]);router[_0x41bc('0x1b')](_0x41bc('0xc'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x1c')]);router[_0x41bc('0x1b')]('/:id/canned_answers',auth[_0x41bc('0xb')](),controller[_0x41bc('0x1d')]);router[_0x41bc('0x1b')]('/',auth['isAuthenticated'](),controller[_0x41bc('0x1e')]);router[_0x41bc('0x1b')](_0x41bc('0x1f'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x20')]);router[_0x41bc('0x1b')]('/:id/out_servers',auth[_0x41bc('0xb')](),controller['addSmtp']);router[_0x41bc('0x1b')]('/:id/interactions',auth[_0x41bc('0xb')](),controller[_0x41bc('0x21')]);router[_0x41bc('0x1b')](_0x41bc('0x14'),auth['isAuthenticated'](),controller[_0x41bc('0x22')]);router[_0x41bc('0x1b')](_0x41bc('0x23'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x24')]);router[_0x41bc('0x1b')](_0x41bc('0x19'),auth[_0x41bc('0xb')](),controller['addAgents']);router[_0x41bc('0x25')]('/:id',auth[_0x41bc('0xb')](),controller['update']);router[_0x41bc('0x26')](_0x41bc('0xc'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x27')]);router[_0x41bc('0x26')]('/:id/canned_answers',auth[_0x41bc('0xb')](),controller[_0x41bc('0x28')]);router[_0x41bc('0x26')](_0x41bc('0x1f'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x29')]);router[_0x41bc('0x26')](_0x41bc('0x10'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x2a')]);router['delete'](_0x41bc('0x2b'),auth['isAuthenticated'](),controller['destroy']);router[_0x41bc('0x26')](_0x41bc('0x19'),auth[_0x41bc('0xb')](),controller[_0x41bc('0x2c')]);module['exports']=router; \ No newline at end of file +var _0x1eb9=['/:id/send','send','addAgents','update','delete','removeAnswers','removeImap','/:id/out_servers','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','/:id/dispositions','addDisposition','addAnswer','create','post','addImap','/:id/interactions','addApplications'];(function(_0xa90865,_0x3031de){var _0x3a81a3=function(_0x3f17f9){while(--_0x3f17f9){_0xa90865['push'](_0xa90865['shift']());}};_0x3a81a3(++_0x3031de);}(_0x1eb9,0x1cd));var _0x91eb=function(_0x29cd6a,_0x409b11){_0x29cd6a=_0x29cd6a-0x0;var _0x545b22=_0x1eb9[_0x29cd6a];return _0x545b22;};'use strict';var multer=require(_0x91eb('0x0'));var util=require(_0x91eb('0x1'));var path=require(_0x91eb('0x2'));var timeout=require(_0x91eb('0x3'));var express=require(_0x91eb('0x4'));var router=express[_0x91eb('0x5')]();var fs_extra=require(_0x91eb('0x6'));var auth=require(_0x91eb('0x7'));var interaction=require(_0x91eb('0x8'));var config=require(_0x91eb('0x9'));var controller=require(_0x91eb('0xa'));router[_0x91eb('0xb')]('/',auth[_0x91eb('0xc')](),controller[_0x91eb('0xd')]);router[_0x91eb('0xb')](_0x91eb('0xe'),auth[_0x91eb('0xc')](),controller[_0x91eb('0xf')]);router['get'](_0x91eb('0x10'),auth['isAuthenticated'](),controller[_0x91eb('0x11')]);router[_0x91eb('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x91eb('0x12')]);router['get'](_0x91eb('0x13'),auth[_0x91eb('0xc')](),controller['getAnswers']);router[_0x91eb('0xb')](_0x91eb('0x14'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x15')]);router[_0x91eb('0xb')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x91eb('0x16')]);router[_0x91eb('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x91eb('0x17')]);router['get'](_0x91eb('0x18'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x19')]);router[_0x91eb('0xb')](_0x91eb('0x1a'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x1b')]);router[_0x91eb('0xb')](_0x91eb('0x1c'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x1d')]);router['get'](_0x91eb('0x1e'),auth[_0x91eb('0xc')](),controller['getAgents']);router['post'](_0x91eb('0x1f'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x20')]);router['post'](_0x91eb('0x13'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x21')]);router['post']('/',auth[_0x91eb('0xc')](),controller[_0x91eb('0x22')]);router[_0x91eb('0x23')](_0x91eb('0x14'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x24')]);router[_0x91eb('0x23')]('/:id/out_servers',auth[_0x91eb('0xc')](),controller['addSmtp']);router['post'](_0x91eb('0x25'),auth[_0x91eb('0xc')](),controller['addInteraction']);router[_0x91eb('0x23')](_0x91eb('0x18'),auth['isAuthenticated'](),controller[_0x91eb('0x26')]);router[_0x91eb('0x23')](_0x91eb('0x27'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x28')]);router[_0x91eb('0x23')]('/:id/users',auth[_0x91eb('0xc')](),controller[_0x91eb('0x29')]);router['put']('/:id',auth[_0x91eb('0xc')](),controller[_0x91eb('0x2a')]);router[_0x91eb('0x2b')]('/:id/dispositions',auth[_0x91eb('0xc')](),controller['removeDispositions']);router['delete'](_0x91eb('0x13'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x2c')]);router['delete']('/:id/in_servers',auth[_0x91eb('0xc')](),controller[_0x91eb('0x2d')]);router[_0x91eb('0x2b')](_0x91eb('0x2e'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x2f')]);router[_0x91eb('0x2b')](_0x91eb('0x10'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x30')]);router['delete'](_0x91eb('0x1e'),auth[_0x91eb('0xc')](),controller[_0x91eb('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index bf54a6f..225f576 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 _0xfd2f=['sequelize','exports','STRING','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfd2f,0x14a));var _0xffd2=function(_0x13b33c,_0xbe1b4e){_0x13b33c=_0x13b33c-0x0;var _0x2f0532=_0xfd2f[_0x13b33c];return _0x2f0532;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'description':{'type':Sequelize[_0xffd2('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xffd2('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xffd2('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xffd2('0x4')],'defaultValue':function(){return _0xffd2('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xffd2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xffd2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xffd2('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b0d9e){if(!_0x4b0d9e)this['setDataValue'](_0xffd2('0x7'),null);this[_0xffd2('0x8')](_0xffd2('0x9'),_0x4b0d9e);}}}; \ No newline at end of file +var _0xb66c=['mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x1ca3dd,_0x363206){var _0x27aa04=function(_0x17a12a){while(--_0x17a12a){_0x1ca3dd['push'](_0x1ca3dd['shift']());}};_0x27aa04(++_0x363206);}(_0xb66c,0x175));var _0xcb66=function(_0x401a3d,_0x31e727){_0x401a3d=_0x401a3d-0x0;var _0x1617c5=_0xb66c[_0x401a3d];return _0x1617c5;};'use strict';var Sequelize=require(_0xcb66('0x0'));module['exports']={'description':{'type':Sequelize[_0xcb66('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xcb66('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xcb66('0x3')]},'markAsUnread':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xcb66('0x1')],'allowNull':![],'defaultValue':_0xcb66('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xcb66('0x3')],'defaultValue':function(){return _0xcb66('0x5');}},'notificationSound':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcb66('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcb66('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcb66('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcb66('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xcb66('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcb66('0x8'),'set':function(_0x2b32ec){if(!_0x2b32ec)this[_0xcb66('0x9')](_0xcb66('0xa'),null);this['setDataValue'](_0xcb66('0xb'),_0x2b32ec);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 7f6d5f2..3392037 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 _0x7a63=['addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','format','inlineCss','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','removeAgents','userMailAccount:remove','emit','getAgents','rimraf','fast-json-patch','request-promise','bluebird','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','destroy','get','MailAccounts','UserProfileResource','sendStatus','send','index','MailServerIn','Imap','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','MailServerOut','Pause','options','find','body','update','describe','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','cservice','cuser','password','pass','cpassword','authentication','host','port','service','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a63,0xfa));var _0x37a6=function(_0x528d91,_0x36364e){_0x528d91=_0x528d91-0x0;var _0x26bd5a=_0x7a63[_0x528d91];return _0x26bd5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37a6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37a6('0x1'));var rp=require(_0x37a6('0x2'));var moment=require('moment');var BPromise=require(_0x37a6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x37a6('0x4'));var csv=require('to-csv');var ejs=require(_0x37a6('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x37a6('0x6'));var crypto=require(_0x37a6('0x7'));var jsforce=require(_0x37a6('0x8'));var deskjs=require(_0x37a6('0x9'));var toCsv=require(_0x37a6('0xa'));var querystring=require(_0x37a6('0xb'));var Papa=require(_0x37a6('0xc'));var htmlToText=require(_0x37a6('0xd'));var juice=require(_0x37a6('0xe'));var Redis=require(_0x37a6('0xf'));var authService=require(_0x37a6('0x10'));var qs=require(_0x37a6('0x11'));var as=require(_0x37a6('0x12'));var hardwareService=require(_0x37a6('0x13'));var logger=require(_0x37a6('0x14'))(_0x37a6('0x15'));var utils=require(_0x37a6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x37a6('0x17'));var db=require(_0x37a6('0x18'))['db'];config[_0x37a6('0x19')]=_[_0x37a6('0x1a')](config[_0x37a6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x37a6('0x1b'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x37a6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x37a6('0x1d')][_0x37a6('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x28de8a,_0x1c3658,_0xbe66b1,_0x27f684){return new BPromise(function(_0x382a3c,_0x1df5fc){var _0x1f5c44=_0x27f684||client;return _0x1f5c44['request'](_0x28de8a,_0xbe66b1)[_0x37a6('0x1f')](function(_0x57cd50){logger[_0x37a6('0x20')](_0x37a6('0x21'),_0x1c3658,'request\x20sent');logger[_0x37a6('0x22')](_0x37a6('0x23'),_0x1c3658,_0x37a6('0x24'),JSON[_0x37a6('0x25')](_0x57cd50));if(_0x57cd50['error']){if(_0x57cd50[_0x37a6('0x26')][_0x37a6('0x27')]===0x1f4){logger[_0x37a6('0x26')]('MailAccount,\x20%s,\x20%s',_0x1c3658,_0x57cd50[_0x37a6('0x26')][_0x37a6('0x28')]);return _0x1df5fc(_0x57cd50['error'][_0x37a6('0x28')]);}logger['error'](_0x37a6('0x21'),_0x1c3658,_0x57cd50[_0x37a6('0x26')][_0x37a6('0x28')]);return _0x382a3c(_0x57cd50['error'][_0x37a6('0x28')]);}else{logger[_0x37a6('0x20')](_0x37a6('0x21'),_0x1c3658,'request\x20sent');_0x382a3c(_0x57cd50[_0x37a6('0x29')][_0x37a6('0x28')]);}})[_0x37a6('0x2a')](function(_0x43d907){logger[_0x37a6('0x26')](_0x37a6('0x21'),_0x1c3658,_0x43d907);_0x1df5fc(_0x43d907);});});}function respondWithStatusCode(_0x22d256,_0x6680a9){_0x6680a9=_0x6680a9||0xcc;return function(_0x51461b){if(_0x51461b){return _0x22d256['sendStatus'](_0x6680a9);}return _0x22d256[_0x37a6('0x2b')](_0x6680a9)[_0x37a6('0x2c')]();};}function respondWithResult(_0x17b290,_0x2847d7){_0x2847d7=_0x2847d7||0xc8;return function(_0x3957d4){if(_0x3957d4){return _0x17b290[_0x37a6('0x2b')](_0x2847d7)['json'](_0x3957d4);}};}function respondWithFilteredResult(_0x4da7de,_0x8c493b){return function(_0x1051e5){if(_0x1051e5){var _0x10afde=typeof _0x8c493b[_0x37a6('0x2d')]==='undefined'&&typeof _0x8c493b[_0x37a6('0x2e')]===_0x37a6('0x2f');var _0x8aa2d2=_0x1051e5[_0x37a6('0x30')];var _0x1e36fe=_0x10afde?0x0:_0x8c493b['offset'];var _0x37b1e7=_0x10afde?_0x1051e5[_0x37a6('0x30')]:_0x8c493b[_0x37a6('0x2d')]+_0x8c493b[_0x37a6('0x2e')];var _0x4954eb;if(_0x37b1e7>=_0x8aa2d2){_0x37b1e7=_0x8aa2d2;_0x4954eb=0xc8;}else{_0x4954eb=0xce;}_0x4da7de[_0x37a6('0x2b')](_0x4954eb);return _0x4da7de['set'](_0x37a6('0x31'),_0x1e36fe+'-'+_0x37b1e7+'/'+_0x8aa2d2)[_0x37a6('0x32')](_0x1051e5);}return null;};}function patchUpdates(_0x13a074){return function(_0x257c76){try{jsonpatch[_0x37a6('0x33')](_0x257c76,_0x13a074,!![]);}catch(_0x8a3972){return BPromise[_0x37a6('0x34')](_0x8a3972);}return _0x257c76['save']();};}function saveUpdates(_0xbbc5ed,_0x2982d6){return function(_0x424c88){if(_0x424c88){return _0x424c88['update'](_0xbbc5ed)[_0x37a6('0x1f')](function(_0x2044e0){return _0x2044e0;});}return null;};}function removeEntity(_0xcc33ef,_0x3c104a){return function(_0x57b8c2){if(_0x57b8c2){return _0x57b8c2[_0x37a6('0x35')]()[_0x37a6('0x1f')](function(){var _0x729e09=_0x57b8c2[_0x37a6('0x36')]({'plain':!![]});var _0x5b744e=_0x37a6('0x37');return db[_0x37a6('0x38')][_0x37a6('0x35')]({'where':{'type':_0x5b744e,'resourceId':_0x729e09['id']}})['then'](function(){return _0x57b8c2;});})[_0x37a6('0x1f')](function(){_0xcc33ef['status'](0xcc)[_0x37a6('0x2c')]();});}};}function handleEntityNotFound(_0x4a360a,_0x1eee05){return function(_0x18c8f1){if(!_0x18c8f1){_0x4a360a[_0x37a6('0x39')](0x194);}return _0x18c8f1;};}function handleError(_0x48b258,_0x233aae){_0x233aae=_0x233aae||0x1f4;return function(_0x2c4007){logger[_0x37a6('0x26')](_0x2c4007['stack']);if(_0x2c4007['name']){delete _0x2c4007['name'];}_0x48b258['status'](_0x233aae)[_0x37a6('0x3a')](_0x2c4007);};}exports[_0x37a6('0x3b')]=function(_0x27c637,_0x35a0e2){var _0x13c053={'include':[{'model':db[_0x37a6('0x3c')],'as':_0x37a6('0x3d')},{'model':db['MailServerOut'],'as':_0x37a6('0x3e')},{'model':db['Pause'],'as':_0x37a6('0x3f')}]},_0x1f5c59={},_0x3846e9={'count':0x0,'rows':[]};var _0x50d64e=_[_0x37a6('0x40')](db[_0x37a6('0x41')][_0x37a6('0x42')],function(_0xc78096){return{'name':_0xc78096[_0x37a6('0x43')],'type':_0xc78096[_0x37a6('0x44')][_0x37a6('0x45')]};});_0x1f5c59[_0x37a6('0x46')]=_[_0x37a6('0x40')](_0x50d64e,_0x37a6('0x47'));_0x1f5c59[_0x37a6('0x48')]=_[_0x37a6('0x49')](_0x27c637['query']);_0x1f5c59[_0x37a6('0x4a')]=_[_0x37a6('0x4b')](_0x1f5c59[_0x37a6('0x46')],_0x1f5c59[_0x37a6('0x48')]);_0x13c053['attributes']=_[_0x37a6('0x4b')](_0x1f5c59[_0x37a6('0x46')],qs['fields'](_0x27c637[_0x37a6('0x48')][_0x37a6('0x4c')]));_0x13c053['attributes']=_0x13c053[_0x37a6('0x4d')][_0x37a6('0x4e')]?_0x13c053['attributes']:_0x1f5c59[_0x37a6('0x46')];if(!_0x27c637[_0x37a6('0x48')][_0x37a6('0x4f')](_0x37a6('0x50'))){_0x13c053[_0x37a6('0x2e')]=qs[_0x37a6('0x2e')](_0x27c637[_0x37a6('0x48')][_0x37a6('0x2e')]);_0x13c053[_0x37a6('0x2d')]=qs[_0x37a6('0x2d')](_0x27c637[_0x37a6('0x48')][_0x37a6('0x2d')]);}_0x13c053[_0x37a6('0x51')]=qs['sort'](_0x27c637[_0x37a6('0x48')][_0x37a6('0x52')]);_0x13c053[_0x37a6('0x53')]=qs[_0x37a6('0x4a')](_[_0x37a6('0x54')](_0x27c637[_0x37a6('0x48')],_0x1f5c59[_0x37a6('0x4a')]),_0x50d64e);if(_0x27c637['query'][_0x37a6('0x55')]){_0x13c053[_0x37a6('0x53')]=_[_0x37a6('0x56')](_0x13c053[_0x37a6('0x53')],{'$or':_[_0x37a6('0x40')](_0x50d64e,function(_0x40a09a){if(_0x40a09a[_0x37a6('0x44')]!==_0x37a6('0x57')){var _0x40de3e={};_0x40de3e[_0x40a09a[_0x37a6('0x47')]]={'$like':'%'+_0x27c637[_0x37a6('0x48')][_0x37a6('0x55')]+'%'};return _0x40de3e;}})});}_0x13c053=_[_0x37a6('0x56')]({},_0x13c053,_0x27c637['options']);var _0x2a3c40={'where':_0x13c053[_0x37a6('0x53')]};return db['MailAccount']['count'](_0x2a3c40)[_0x37a6('0x1f')](function(_0x56eee4){_0x3846e9[_0x37a6('0x30')]=_0x56eee4;if(_0x27c637[_0x37a6('0x48')][_0x37a6('0x58')]){_0x13c053[_0x37a6('0x59')]=[{'all':!![]}];}return db[_0x37a6('0x41')][_0x37a6('0x5a')](_0x13c053);})[_0x37a6('0x1f')](function(_0x47306b){_0x3846e9[_0x37a6('0x5b')]=_0x47306b;return _0x3846e9;})[_0x37a6('0x1f')](respondWithFilteredResult(_0x35a0e2,_0x13c053))['catch'](handleError(_0x35a0e2,null));};exports['show']=function(_0x3fb74a,_0x27b6e4){var _0x575f9f={'raw':![],'where':{'id':_0x3fb74a[_0x37a6('0x5c')]['id']},'include':[{'model':db[_0x37a6('0x3c')],'as':'Imap'},{'model':db[_0x37a6('0x5d')],'as':_0x37a6('0x3e')},{'model':db[_0x37a6('0x5e')],'as':_0x37a6('0x3f')}]},_0x2608e8={};_0x2608e8[_0x37a6('0x46')]=_['keys'](db[_0x37a6('0x41')][_0x37a6('0x42')]);_0x2608e8[_0x37a6('0x48')]=_[_0x37a6('0x49')](_0x3fb74a[_0x37a6('0x48')]);_0x2608e8[_0x37a6('0x4a')]=_[_0x37a6('0x4b')](_0x2608e8['model'],_0x2608e8[_0x37a6('0x48')]);_0x575f9f[_0x37a6('0x4d')]=_[_0x37a6('0x4b')](_0x2608e8[_0x37a6('0x46')],qs['fields'](_0x3fb74a['query'][_0x37a6('0x4c')]));_0x575f9f[_0x37a6('0x4d')]=_0x575f9f[_0x37a6('0x4d')][_0x37a6('0x4e')]?_0x575f9f['attributes']:_0x2608e8[_0x37a6('0x46')];if(_0x3fb74a[_0x37a6('0x48')][_0x37a6('0x58')]){_0x575f9f[_0x37a6('0x59')]=[{'all':!![]}];}_0x575f9f=_['merge']({},_0x575f9f,_0x3fb74a[_0x37a6('0x5f')]);return db[_0x37a6('0x41')][_0x37a6('0x60')](_0x575f9f)['then'](handleEntityNotFound(_0x27b6e4,null))[_0x37a6('0x1f')](respondWithResult(_0x27b6e4,null))['catch'](handleError(_0x27b6e4,null));};exports['update']=function(_0x5f35b6,_0x92d7cc){if(_0x5f35b6[_0x37a6('0x61')]['id']){delete _0x5f35b6[_0x37a6('0x61')]['id'];}return db['MailAccount'][_0x37a6('0x60')]({'where':{'id':_0x5f35b6[_0x37a6('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x37a6('0x3d')},{'model':db[_0x37a6('0x5d')],'as':_0x37a6('0x3e')},{'model':db[_0x37a6('0x5e')],'as':'mandatoryDispositionPause'}]})[_0x37a6('0x1f')](handleEntityNotFound(_0x92d7cc,null))[_0x37a6('0x1f')](saveUpdates(_0x5f35b6[_0x37a6('0x61')],null))[_0x37a6('0x1f')](function(_0x2e29ed){if(_0x2e29ed&&_0x5f35b6['body'][_0x37a6('0x3d')]){return db[_0x37a6('0x3c')][_0x37a6('0x62')](_0x5f35b6['body'][_0x37a6('0x3d')],{'where':{'MailAccountId':_0x2e29ed['id']}})[_0x37a6('0x1f')](function(){return _0x2e29ed;});}return _0x2e29ed;})[_0x37a6('0x1f')](function(_0x332231){if(_0x332231&&_0x5f35b6[_0x37a6('0x61')][_0x37a6('0x3e')]){return db[_0x37a6('0x5d')]['update'](_0x5f35b6['body'][_0x37a6('0x3e')],{'where':{'MailAccountId':_0x332231['id']}})[_0x37a6('0x1f')](function(){return _0x332231;});}return _0x332231;})[_0x37a6('0x1f')](respondWithResult(_0x92d7cc,null))[_0x37a6('0x2a')](handleError(_0x92d7cc,null));};exports[_0x37a6('0x63')]=function(_0x5f5bfb,_0x5b5251){return db[_0x37a6('0x41')]['describe']()[_0x37a6('0x1f')](respondWithResult(_0x5b5251,null))['catch'](handleError(_0x5b5251,null));};exports['addDisposition']=function(_0x257511,_0x2f1c00,_0x2eede1){if(_0x257511[_0x37a6('0x61')]['id']){delete _0x257511[_0x37a6('0x61')]['id'];}return db[_0x37a6('0x41')][_0x37a6('0x60')]({'where':{'id':_0x257511[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x2f1c00,null))[_0x37a6('0x1f')](function(_0x30f1e1){if(_0x30f1e1){_0x257511[_0x37a6('0x61')][_0x37a6('0x64')]=_0x30f1e1['id'];return db[_0x37a6('0x65')][_0x37a6('0x66')](_0x257511[_0x37a6('0x61')]);}})['then'](respondWithResult(_0x2f1c00,null))[_0x37a6('0x2a')](handleError(_0x2f1c00,null));};exports[_0x37a6('0x67')]=function(_0x469997,_0x4389b8,_0x2e48a6){var _0x3482bb={'raw':![],'where':{}};var _0x1cce9f={};var _0x2d54d3={'count':0x0,'rows':[]};return db[_0x37a6('0x41')][_0x37a6('0x68')]({'where':{'id':_0x469997[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x4389b8,null))[_0x37a6('0x1f')](function(_0x364043){if(_0x364043){_0x1cce9f[_0x37a6('0x46')]=_[_0x37a6('0x49')](db[_0x37a6('0x65')]['rawAttributes']);_0x1cce9f['query']=_[_0x37a6('0x49')](_0x469997[_0x37a6('0x48')]);_0x1cce9f[_0x37a6('0x4a')]=_[_0x37a6('0x4b')](_0x1cce9f['model'],_0x1cce9f['query']);_0x3482bb['attributes']=_[_0x37a6('0x4b')](_0x1cce9f['model'],qs[_0x37a6('0x4c')](_0x469997[_0x37a6('0x48')]['fields']));_0x3482bb['attributes']=_0x3482bb[_0x37a6('0x4d')][_0x37a6('0x4e')]?_0x3482bb['attributes']:_0x1cce9f[_0x37a6('0x46')];if(!_0x469997['query'][_0x37a6('0x4f')](_0x37a6('0x50'))){_0x3482bb[_0x37a6('0x2e')]=qs[_0x37a6('0x2e')](_0x469997['query'][_0x37a6('0x2e')]);_0x3482bb[_0x37a6('0x2d')]=qs['offset'](_0x469997[_0x37a6('0x48')][_0x37a6('0x2d')]);}_0x3482bb['order']=qs[_0x37a6('0x52')](_0x469997[_0x37a6('0x48')]['sort']);_0x3482bb[_0x37a6('0x53')]=qs[_0x37a6('0x4a')](_['pick'](_0x469997[_0x37a6('0x48')],_0x1cce9f['filters']));_0x3482bb[_0x37a6('0x53')][_0x37a6('0x64')]=_0x364043['id'];if(_0x469997[_0x37a6('0x48')]['filter']){_0x3482bb['where']=_[_0x37a6('0x56')](_0x3482bb[_0x37a6('0x53')],{'$or':_[_0x37a6('0x40')](_0x3482bb[_0x37a6('0x4d')],function(_0x584afa){var _0x215703={};_0x215703[_0x584afa]={'$like':'%'+_0x469997[_0x37a6('0x48')][_0x37a6('0x55')]+'%'};return _0x215703;})});}_0x3482bb=_['merge']({},_0x3482bb,_0x469997['options']);return db['Disposition'][_0x37a6('0x30')]({'where':_0x3482bb[_0x37a6('0x53')]})[_0x37a6('0x1f')](function(_0x2f34ea){_0x2d54d3[_0x37a6('0x30')]=_0x2f34ea;if(_0x469997[_0x37a6('0x48')][_0x37a6('0x58')]){_0x3482bb['include']=[{'all':!![]}];}return db[_0x37a6('0x65')][_0x37a6('0x5a')](_0x3482bb);})['then'](function(_0x122350){_0x2d54d3[_0x37a6('0x5b')]=_0x122350;return _0x2d54d3;});}})[_0x37a6('0x1f')](respondWithFilteredResult(_0x4389b8,_0x3482bb))[_0x37a6('0x2a')](handleError(_0x4389b8,null));};exports['removeDispositions']=function(_0x56f506,_0x35f413,_0x581a48){return db[_0x37a6('0x41')][_0x37a6('0x60')]({'where':{'id':_0x56f506[_0x37a6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x35f413,null))['then'](function(_0x363690){if(_0x363690){return _0x363690[_0x37a6('0x69')](_0x56f506[_0x37a6('0x48')][_0x37a6('0x6a')]);}})['then'](respondWithStatusCode(_0x35f413,null))[_0x37a6('0x2a')](handleError(_0x35f413,null));};exports['addAnswer']=function(_0xc7cd6,_0x15cab4,_0x21813d){if(_0xc7cd6[_0x37a6('0x61')]['id']){delete _0xc7cd6[_0x37a6('0x61')]['id'];}return db['MailAccount'][_0x37a6('0x60')]({'where':{'id':_0xc7cd6[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x15cab4,null))[_0x37a6('0x1f')](function(_0x13242c){if(_0x13242c){_0xc7cd6[_0x37a6('0x61')]['MailAccountId']=_0x13242c['id'];return db[_0x37a6('0x6b')]['create'](_0xc7cd6[_0x37a6('0x61')]);}})[_0x37a6('0x1f')](respondWithResult(_0x15cab4,null))[_0x37a6('0x2a')](handleError(_0x15cab4,null));};exports[_0x37a6('0x6c')]=function(_0x4dda66,_0x3e69a3,_0x55e769){var _0x47e05b={'raw':![],'where':{}};var _0x1b765c={};var _0x45ad1a={'count':0x0,'rows':[]};return db[_0x37a6('0x41')][_0x37a6('0x68')]({'where':{'id':_0x4dda66[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x3e69a3,null))[_0x37a6('0x1f')](function(_0x477b4c){if(_0x477b4c){_0x1b765c[_0x37a6('0x46')]=_[_0x37a6('0x49')](db[_0x37a6('0x6b')][_0x37a6('0x42')]);_0x1b765c[_0x37a6('0x48')]=_[_0x37a6('0x49')](_0x4dda66[_0x37a6('0x48')]);_0x1b765c['filters']=_[_0x37a6('0x4b')](_0x1b765c[_0x37a6('0x46')],_0x1b765c[_0x37a6('0x48')]);_0x47e05b[_0x37a6('0x4d')]=_[_0x37a6('0x4b')](_0x1b765c[_0x37a6('0x46')],qs[_0x37a6('0x4c')](_0x4dda66['query'][_0x37a6('0x4c')]));_0x47e05b['attributes']=_0x47e05b['attributes'][_0x37a6('0x4e')]?_0x47e05b[_0x37a6('0x4d')]:_0x1b765c[_0x37a6('0x46')];if(!_0x4dda66[_0x37a6('0x48')][_0x37a6('0x4f')]('nolimit')){_0x47e05b[_0x37a6('0x2e')]=qs['limit'](_0x4dda66['query'][_0x37a6('0x2e')]);_0x47e05b[_0x37a6('0x2d')]=qs[_0x37a6('0x2d')](_0x4dda66[_0x37a6('0x48')][_0x37a6('0x2d')]);}_0x47e05b[_0x37a6('0x51')]=qs[_0x37a6('0x52')](_0x4dda66[_0x37a6('0x48')]['sort']);_0x47e05b[_0x37a6('0x53')]=qs[_0x37a6('0x4a')](_[_0x37a6('0x54')](_0x4dda66['query'],_0x1b765c[_0x37a6('0x4a')]));_0x47e05b[_0x37a6('0x53')]['MailAccountId']=_0x477b4c['id'];if(_0x4dda66[_0x37a6('0x48')][_0x37a6('0x55')]){_0x47e05b['where']=_[_0x37a6('0x56')](_0x47e05b['where'],{'$or':_[_0x37a6('0x40')](_0x47e05b[_0x37a6('0x4d')],function(_0x209b56){var _0x58004b={};_0x58004b[_0x209b56]={'$like':'%'+_0x4dda66[_0x37a6('0x48')][_0x37a6('0x55')]+'%'};return _0x58004b;})});}_0x47e05b=_[_0x37a6('0x56')]({},_0x47e05b,_0x4dda66[_0x37a6('0x5f')]);return db['CannedAnswer'][_0x37a6('0x30')]({'where':_0x47e05b[_0x37a6('0x53')]})[_0x37a6('0x1f')](function(_0x41dadb){_0x45ad1a['count']=_0x41dadb;if(_0x4dda66[_0x37a6('0x48')][_0x37a6('0x58')]){_0x47e05b['include']=[{'all':!![]}];}return db[_0x37a6('0x6b')][_0x37a6('0x5a')](_0x47e05b);})[_0x37a6('0x1f')](function(_0x16bb5e){_0x45ad1a['rows']=_0x16bb5e;return _0x45ad1a;});}})[_0x37a6('0x1f')](respondWithFilteredResult(_0x3e69a3,_0x47e05b))['catch'](handleError(_0x3e69a3,null));};exports[_0x37a6('0x6d')]=function(_0x202361,_0x4d0b28,_0x3367c5){return db[_0x37a6('0x41')][_0x37a6('0x60')]({'where':{'id':_0x202361[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x4d0b28,null))[_0x37a6('0x1f')](function(_0x20c42b){if(_0x20c42b){return _0x20c42b['removeAnswers'](_0x202361[_0x37a6('0x48')]['ids']);}})[_0x37a6('0x1f')](respondWithStatusCode(_0x4d0b28,null))[_0x37a6('0x2a')](handleError(_0x4d0b28,null));};exports[_0x37a6('0x66')]=function(_0x54512b,_0x48844d){var _0x392f1d={'name':_0x54512b['body'][_0x37a6('0x47')],'key':_0x54512b[_0x37a6('0x61')][_0x37a6('0x45')],'email':_0x54512b[_0x37a6('0x61')][_0x37a6('0x6e')],'ListId':_0x54512b['body'][_0x37a6('0x6f')],'active':!_[_0x37a6('0x70')](_0x54512b['body']['active'])?_0x54512b['body'][_0x37a6('0x71')]:!![],'description':_0x54512b[_0x37a6('0x61')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x37a6('0x70')](_0x54512b[_0x37a6('0x61')][_0x37a6('0x72')])){if(_0x54512b[_0x37a6('0x61')]['cauthentication']){_0x392f1d[_0x37a6('0x3d')]['user']=_0x392f1d['Smtp']['user']=_0x54512b[_0x37a6('0x61')][_0x37a6('0x73')];_0x392f1d['Imap'][_0x37a6('0x74')]=_0x392f1d['Smtp'][_0x37a6('0x75')]=_0x54512b[_0x37a6('0x61')][_0x37a6('0x76')];}else{_0x392f1d[_0x37a6('0x3d')][_0x37a6('0x77')]=_0x392f1d['Smtp'][_0x37a6('0x77')]=![];}_0x392f1d[_0x37a6('0x3d')][_0x37a6('0x78')]=_0x54512b['body'][_0x37a6('0x3d')][_0x37a6('0x78')];_0x392f1d['Imap'][_0x37a6('0x79')]=_0x54512b[_0x37a6('0x61')][_0x37a6('0x3d')]['port'];_0x392f1d[_0x37a6('0x3e')][_0x37a6('0x78')]=_0x54512b['body'][_0x37a6('0x3e')][_0x37a6('0x78')];_0x392f1d[_0x37a6('0x3e')][_0x37a6('0x79')]=_0x54512b[_0x37a6('0x61')][_0x37a6('0x3e')]['port'];}else{_0x392f1d[_0x37a6('0x3d')][_0x37a6('0x7a')]=_0x392f1d['Smtp'][_0x37a6('0x7a')]=_0x54512b['body'][_0x37a6('0x72')];_0x392f1d[_0x37a6('0x3d')][_0x37a6('0x7b')]=_0x392f1d[_0x37a6('0x3e')]['user']=_0x54512b[_0x37a6('0x61')][_0x37a6('0x73')];_0x392f1d[_0x37a6('0x3d')][_0x37a6('0x74')]=_0x392f1d[_0x37a6('0x3e')]['pass']=_0x54512b[_0x37a6('0x61')][_0x37a6('0x76')];}return db[_0x37a6('0x41')][_0x37a6('0x66')](_0x392f1d,{'include':[{'model':db[_0x37a6('0x5d')],'as':_0x37a6('0x3e')},{'model':db['MailServerIn'],'as':_0x37a6('0x3d')}]})['then'](function(_0x114fc5){var _0x4ed430=_0x54512b[_0x37a6('0x7b')]['get']({'plain':!![]});if(!_0x4ed430)throw new Error(_0x37a6('0x7c'));if(_0x4ed430[_0x37a6('0x7d')]===_0x37a6('0x7b')){var _0x150ad6=_0x114fc5['get']({'plain':!![]});return db[_0x37a6('0x7e')]['find']({'where':{'name':_0x37a6('0x37'),'userProfileId':_0x4ed430[_0x37a6('0x7f')]},'raw':!![]})[_0x37a6('0x1f')](function(_0x3bdf45){if(_0x3bdf45&&_0x3bdf45[_0x37a6('0x80')]===0x0){return db['UserProfileResource'][_0x37a6('0x66')]({'name':_0x150ad6[_0x37a6('0x47')],'resourceId':_0x150ad6['id'],'type':_0x3bdf45[_0x37a6('0x47')],'sectionId':_0x3bdf45['id']},{})[_0x37a6('0x1f')](function(){return _0x114fc5;});}else{return _0x114fc5;}})[_0x37a6('0x2a')](function(_0x27e47a){logger[_0x37a6('0x26')](_0x37a6('0x81'),_0x27e47a);throw _0x27e47a;});}return _0x114fc5;})['then'](respondWithResult(_0x48844d,0xc9))[_0x37a6('0x2a')](handleError(_0x48844d,null));};exports['getImap']=function(_0x1fe22b,_0x4b272f,_0x212708){return db[_0x37a6('0x41')][_0x37a6('0x68')]({'where':{'id':_0x1fe22b['params']['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x4b272f,null))[_0x37a6('0x1f')](function(_0x55504f){if(_0x55504f){return _0x55504f['getImap']();}return null;})['then'](respondWithResult(_0x4b272f,null))[_0x37a6('0x2a')](handleError(_0x4b272f,null));};exports[_0x37a6('0x82')]=function(_0x34228d,_0x3a7155,_0x30f427){if(_0x34228d[_0x37a6('0x61')]['id']){delete _0x34228d[_0x37a6('0x61')]['id'];}return db[_0x37a6('0x41')][_0x37a6('0x60')]({'where':{'id':_0x34228d['params']['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x3a7155,null))[_0x37a6('0x1f')](function(_0x1c825e){if(_0x1c825e){_0x34228d[_0x37a6('0x61')][_0x37a6('0x64')]=_0x1c825e['id'];return db[_0x37a6('0x3c')]['create'](_0x34228d[_0x37a6('0x61')]);}})[_0x37a6('0x1f')](respondWithResult(_0x3a7155,null))[_0x37a6('0x2a')](handleError(_0x3a7155,null));};exports[_0x37a6('0x83')]=function(_0x2dc9a6,_0x5940bb,_0x1b26a8){return db['MailAccount'][_0x37a6('0x68')]({'where':{'id':_0x2dc9a6[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x5940bb,null))[_0x37a6('0x1f')](function(_0x17a9a6){if(_0x17a9a6){return _0x17a9a6[_0x37a6('0x84')](null);}return null;})[_0x37a6('0x1f')](respondWithStatusCode(_0x5940bb,null))['catch'](handleError(_0x5940bb,null));};exports[_0x37a6('0x85')]=function(_0x40a31a,_0x244f9e,_0x16dedc){return db['MailAccount'][_0x37a6('0x68')]({'where':{'id':_0x40a31a['params']['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x244f9e,null))['then'](function(_0x3456f2){if(_0x3456f2){return _0x3456f2[_0x37a6('0x85')]();}return null;})[_0x37a6('0x1f')](respondWithResult(_0x244f9e,null))[_0x37a6('0x2a')](handleError(_0x244f9e,null));};exports['addSmtp']=function(_0x29c870,_0x1a0ee0,_0x15a2f9){if(_0x29c870[_0x37a6('0x61')]['id']){delete _0x29c870[_0x37a6('0x61')]['id'];}return db[_0x37a6('0x41')]['find']({'where':{'id':_0x29c870['params']['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x1a0ee0,null))[_0x37a6('0x1f')](function(_0x5d39c1){if(_0x5d39c1){_0x29c870[_0x37a6('0x61')][_0x37a6('0x64')]=_0x5d39c1['id'];return db['MailServerOut'][_0x37a6('0x66')](_0x29c870[_0x37a6('0x61')]);}})[_0x37a6('0x1f')](respondWithResult(_0x1a0ee0,null))['catch'](handleError(_0x1a0ee0,null));};exports[_0x37a6('0x86')]=function(_0x2e28ba,_0x4b5a35,_0x582445){return db['MailAccount'][_0x37a6('0x68')]({'where':{'id':_0x2e28ba['params']['id']}})['then'](handleEntityNotFound(_0x4b5a35,null))[_0x37a6('0x1f')](function(_0x21c60f){if(_0x21c60f){return _0x21c60f[_0x37a6('0x87')](null);}return null;})['then'](respondWithStatusCode(_0x4b5a35,null))[_0x37a6('0x2a')](handleError(_0x4b5a35,null));};exports[_0x37a6('0x88')]=function(_0x5ed3bd,_0x4bf281,_0x178b0d){return db['MailInteraction'][_0x37a6('0x60')]({'where':{'id':_0x5ed3bd[_0x37a6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4bf281,null))['then'](function(_0x53ce91){if(_0x53ce91){return _0x53ce91[_0x37a6('0x88')](_0x5ed3bd[_0x37a6('0x61')][_0x37a6('0x6a')],_['omit'](_0x5ed3bd[_0x37a6('0x61')],[_0x37a6('0x6a'),'id'])||{});}})[_0x37a6('0x1f')](respondWithResult(_0x4bf281,null))[_0x37a6('0x2a')](handleError(_0x4bf281,null));};exports[_0x37a6('0x89')]=function(_0x4c2108,_0x27d64e,_0x96c4df){var _0x429852={'raw':![],'where':{}};var _0x4e08af={};var _0x72084a={'count':0x0,'rows':[]};return db[_0x37a6('0x41')][_0x37a6('0x68')]({'where':{'id':_0x4c2108[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x27d64e,null))[_0x37a6('0x1f')](function(_0x2019a5){if(_0x2019a5){_0x4e08af['model']=_[_0x37a6('0x49')](db[_0x37a6('0x8a')][_0x37a6('0x42')]);_0x4e08af[_0x37a6('0x48')]=_['keys'](_0x4c2108[_0x37a6('0x48')]);_0x4e08af[_0x37a6('0x4a')]=_[_0x37a6('0x4b')](_0x4e08af[_0x37a6('0x46')],_0x4e08af[_0x37a6('0x48')]);_0x429852['attributes']=_[_0x37a6('0x4b')](_0x4e08af[_0x37a6('0x46')],qs[_0x37a6('0x4c')](_0x4c2108[_0x37a6('0x48')][_0x37a6('0x4c')]));_0x429852[_0x37a6('0x4d')]=_0x429852['attributes'][_0x37a6('0x4e')]?_0x429852['attributes']:_0x4e08af[_0x37a6('0x46')];if(!_0x4c2108[_0x37a6('0x48')][_0x37a6('0x4f')]('nolimit')){_0x429852['limit']=qs[_0x37a6('0x2e')](_0x4c2108[_0x37a6('0x48')][_0x37a6('0x2e')]);_0x429852[_0x37a6('0x2d')]=qs['offset'](_0x4c2108[_0x37a6('0x48')]['offset']);}_0x429852[_0x37a6('0x51')]=qs[_0x37a6('0x52')](_0x4c2108[_0x37a6('0x48')][_0x37a6('0x52')]);_0x429852[_0x37a6('0x53')]=qs[_0x37a6('0x4a')](_[_0x37a6('0x54')](_0x4c2108[_0x37a6('0x48')],_0x4e08af[_0x37a6('0x4a')]));_0x429852['where'][_0x37a6('0x64')]=_0x2019a5['id'];if(_0x4c2108[_0x37a6('0x48')][_0x37a6('0x55')]){_0x429852[_0x37a6('0x53')]=_[_0x37a6('0x56')](_0x429852['where'],{'$or':_[_0x37a6('0x40')](_0x429852[_0x37a6('0x4d')],function(_0x30474a){var _0x1f39ab={};_0x1f39ab[_0x30474a]={'$like':'%'+_0x4c2108[_0x37a6('0x48')][_0x37a6('0x55')]+'%'};return _0x1f39ab;})});}_0x429852=_[_0x37a6('0x56')]({},_0x429852,_0x4c2108[_0x37a6('0x5f')]);return db['MailInteraction'][_0x37a6('0x30')]({'where':_0x429852[_0x37a6('0x53')]})['then'](function(_0x3ee5cf){_0x72084a[_0x37a6('0x30')]=_0x3ee5cf;if(_0x4c2108[_0x37a6('0x48')]['includeAll']){_0x429852['include']=[{'model':db[_0x37a6('0x8b')],'as':_0x37a6('0x8c'),'required':![]},{'model':db[_0x37a6('0x8d')],'as':'Owner','attributes':['name',_0x37a6('0x8e'),_0x37a6('0x8f')],'required':![]},{'model':db[_0x37a6('0x90')],'as':_0x37a6('0x91'),'attributes':['id','name',_0x37a6('0x92')],'where':_0x4c2108[_0x37a6('0x48')][_0x37a6('0x93')]?{'id':_0x4c2108[_0x37a6('0x48')][_0x37a6('0x93')]}:undefined,'required':_0x4c2108['query'][_0x37a6('0x93')]?!![]:![]}];}return db[_0x37a6('0x8a')][_0x37a6('0x5a')](_0x429852);})[_0x37a6('0x1f')](function(_0xeca6a){_0x72084a[_0x37a6('0x5b')]=_0xeca6a;return _0x72084a;});}})[_0x37a6('0x1f')](respondWithFilteredResult(_0x27d64e,_0x429852))['catch'](handleError(_0x27d64e,null));};exports[_0x37a6('0x94')]=function addApplications(_0x502ffa,_0x4c9012){var _0x1f0de6=_0x502ffa[_0x37a6('0x5c')]['id'];var _0x26c5e1=_0x502ffa[_0x37a6('0x61')];var _0xa7b24a=0xc8;var _0x211055=null;return db[_0x37a6('0x95')][_0x37a6('0x96')]({'isolationLevel':db[_0x37a6('0x95')][_0x37a6('0x97')][_0x37a6('0x98')][_0x37a6('0x99')]},function(_0x1e6ddf){return db[_0x37a6('0x41')]['findOne']({'where':{'id':_0x1f0de6},'transaction':_0x1e6ddf})[_0x37a6('0x1f')](function(_0x400e0a){if(_0x400e0a){return db['MailApplication'][_0x37a6('0x35')]({'where':{'MailAccountId':_0x1f0de6},'transaction':_0x1e6ddf})[_0x37a6('0x1f')](function(){var _0x1759bc=_['map'](_0x26c5e1,function(_0x3d0b8a){_0x3d0b8a['MailAccountId']=_0x1f0de6;return _0x3d0b8a;});return db[_0x37a6('0x9a')][_0x37a6('0x9b')](_0x1759bc,{'transaction':_0x1e6ddf});});}else{_0xa7b24a=0x194;_0x211055=[];}});})['then'](function(){if(_0xa7b24a!==0x194){return db[_0x37a6('0x9a')][_0x37a6('0x9c')]({'where':{'MailAccountId':_0x1f0de6},'order':_0x37a6('0x9d')})[_0x37a6('0x1f')](function(_0x3902dc){_0x211055=_0x3902dc;});}})[_0x37a6('0x2a')](function(_0x22483d){_0xa7b24a=0x1f4;logger[_0x37a6('0x26')](_0x22483d['stack']);if(_0x22483d['name']){delete _0x22483d[_0x37a6('0x47')];}_0x211055=_0x22483d;})[_0x37a6('0x9e')](function(){if(_0x211055===null){_0x4c9012[_0x37a6('0x39')](_0xa7b24a);}else{if(_0xa7b24a===0x1f4){_0x4c9012[_0x37a6('0x2b')](_0xa7b24a)[_0x37a6('0x3a')](_0x211055);}else{_0x4c9012['status'](_0xa7b24a)['json'](_0x211055);}}});};exports[_0x37a6('0x9f')]=function(_0x41bd67,_0x3bf1a0,_0x55d7d6){var _0x44024e={};var _0x4d7132={};var _0x57a196;var _0x288c8c;return db['MailAccount']['findOne']({'where':{'id':_0x41bd67[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x3bf1a0,null))[_0x37a6('0x1f')](function(_0x4b1ebe){if(_0x4b1ebe){_0x57a196=_0x4b1ebe;_0x4d7132[_0x37a6('0x46')]=_['keys'](db[_0x37a6('0x9a')]['rawAttributes']);_0x4d7132[_0x37a6('0x48')]=_[_0x37a6('0x49')](_0x41bd67[_0x37a6('0x48')]);_0x4d7132[_0x37a6('0x4a')]=_[_0x37a6('0x4b')](_0x4d7132['model'],_0x4d7132[_0x37a6('0x48')]);_0x44024e[_0x37a6('0x4d')]=_[_0x37a6('0x4b')](_0x4d7132[_0x37a6('0x46')],qs[_0x37a6('0x4c')](_0x41bd67[_0x37a6('0x48')]['fields']));_0x44024e['attributes']=_0x44024e[_0x37a6('0x4d')][_0x37a6('0x4e')]?_0x44024e[_0x37a6('0x4d')]:_0x4d7132[_0x37a6('0x46')];_0x44024e[_0x37a6('0x51')]=qs[_0x37a6('0x52')](_0x41bd67['query']['sort']);_0x44024e[_0x37a6('0x53')]=qs[_0x37a6('0x4a')](_[_0x37a6('0x54')](_0x41bd67['query'],_0x4d7132[_0x37a6('0x4a')]));if(_0x41bd67['query'][_0x37a6('0x55')]){_0x44024e[_0x37a6('0x53')]=_['merge'](_0x44024e[_0x37a6('0x53')],{'$or':_[_0x37a6('0x40')](_0x44024e['attributes'],function(_0x342a1b){var _0x151949={};_0x151949[_0x342a1b]={'$like':'%'+_0x41bd67[_0x37a6('0x48')][_0x37a6('0x55')]+'%'};return _0x151949;})});}_0x44024e=_[_0x37a6('0x56')]({},_0x44024e,_0x41bd67[_0x37a6('0x5f')]);return _0x57a196[_0x37a6('0x9f')](_0x44024e);}})[_0x37a6('0x1f')](function(_0x32c0a4){if(_0x32c0a4){_0x288c8c=_0x32c0a4[_0x37a6('0x4e')];if(!_0x41bd67[_0x37a6('0x48')]['hasOwnProperty']('nolimit')){_0x44024e['limit']=qs[_0x37a6('0x2e')](_0x41bd67[_0x37a6('0x48')][_0x37a6('0x2e')]);_0x44024e[_0x37a6('0x2d')]=qs[_0x37a6('0x2d')](_0x41bd67[_0x37a6('0x48')][_0x37a6('0x2d')]);}return _0x57a196[_0x37a6('0x9f')](_0x44024e);}})[_0x37a6('0x1f')](function(_0x10180c){if(_0x10180c){return _0x10180c?{'count':_0x288c8c,'rows':_0x10180c}:null;}})[_0x37a6('0x1f')](respondWithResult(_0x3bf1a0,null))['catch'](handleError(_0x3bf1a0,null));};exports['getMessages']=function(_0x38d445,_0x7ce04e,_0x3ede5a){var _0xc795bb={'raw':!![],'where':{}};var _0x22fd87={};var _0x391806={'count':0x0,'rows':[]};return db[_0x37a6('0x41')][_0x37a6('0x68')]({'where':{'id':_0x38d445[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x7ce04e,null))['then'](function(_0x443825){if(_0x443825){_0x22fd87['model']=_[_0x37a6('0x49')](db[_0x37a6('0xa0')][_0x37a6('0x42')]);_0x22fd87[_0x37a6('0x48')]=_[_0x37a6('0x49')](_0x38d445['query']);_0x22fd87[_0x37a6('0x4a')]=_[_0x37a6('0x4b')](_0x22fd87[_0x37a6('0x46')],_0x22fd87[_0x37a6('0x48')]);_0xc795bb[_0x37a6('0x4d')]=_['intersection'](_0x22fd87[_0x37a6('0x46')],qs[_0x37a6('0x4c')](_0x38d445[_0x37a6('0x48')][_0x37a6('0x4c')]));_0xc795bb[_0x37a6('0x4d')]=_0xc795bb[_0x37a6('0x4d')][_0x37a6('0x4e')]?_0xc795bb[_0x37a6('0x4d')]:_0x22fd87[_0x37a6('0x46')];if(!_0x38d445[_0x37a6('0x48')][_0x37a6('0x4f')](_0x37a6('0x50'))){_0xc795bb[_0x37a6('0x2e')]=qs[_0x37a6('0x2e')](_0x38d445[_0x37a6('0x48')][_0x37a6('0x2e')]);_0xc795bb['offset']=qs['offset'](_0x38d445['query'][_0x37a6('0x2d')]);}_0xc795bb[_0x37a6('0x51')]=qs[_0x37a6('0x52')](_0x38d445['query'][_0x37a6('0x52')]);_0xc795bb[_0x37a6('0x53')]=qs[_0x37a6('0x4a')](_[_0x37a6('0x54')](_0x38d445[_0x37a6('0x48')],_0x22fd87[_0x37a6('0x4a')]));_0xc795bb[_0x37a6('0x53')][_0x37a6('0x64')]=_0x443825['id'];if(_0x38d445['query']['filter']){_0xc795bb[_0x37a6('0x53')]=_[_0x37a6('0x56')](_0xc795bb[_0x37a6('0x53')],{'$or':_[_0x37a6('0x40')](_0xc795bb[_0x37a6('0x4d')],function(_0x48fa9f){var _0x18eac7={};_0x18eac7[_0x48fa9f]={'$like':'%'+_0x38d445[_0x37a6('0x48')]['filter']+'%'};return _0x18eac7;})});}if(_0x38d445[_0x37a6('0x48')][_0x37a6('0xa1')]){var _0xf3178c=_0x38d445[_0x37a6('0x48')][_0x37a6('0xa1')][_0x37a6('0xa2')](',');var _0x470122={};_0x470122[_0xf3178c[0x0]]={'$gte':moment(_0xf3178c[0x1])[_0x37a6('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0xc795bb[_0x37a6('0x53')]=_[_0x37a6('0x56')](_0xc795bb[_0x37a6('0x53')],_0x470122);}_0xc795bb=_['merge']({},_0xc795bb,_0x38d445[_0x37a6('0x5f')]);return db[_0x37a6('0xa0')][_0x37a6('0x30')]({'where':_0xc795bb[_0x37a6('0x53')]})[_0x37a6('0x1f')](function(_0x7f405){_0x391806[_0x37a6('0x30')]=_0x7f405;if(_0x38d445[_0x37a6('0x48')][_0x37a6('0x58')]){_0xc795bb[_0x37a6('0x59')]=[{'all':!![]}];}return db[_0x37a6('0xa0')][_0x37a6('0x5a')](_0xc795bb);})[_0x37a6('0x1f')](function(_0xc39a2b){if(_0x38d445[_0x37a6('0x48')][_0x37a6('0xa4')]==='true'){for(var _0x1bb992=0x0;_0x1bb992<_0xc39a2b['length'];_0x1bb992++){_0xc39a2b[_0x1bb992][_0x37a6('0x61')]=juice(_0xc39a2b[_0x1bb992][_0x37a6('0x61')]);}}_0x391806[_0x37a6('0x5b')]=_0xc39a2b;return _0x391806;});}})[_0x37a6('0x1f')](respondWithFilteredResult(_0x7ce04e,_0xc795bb))[_0x37a6('0x2a')](handleError(_0x7ce04e,null));};exports[_0x37a6('0x3a')]=function(_0x23629d,_0x24c0da,_0x1d2156){var _0x2e1954,_0x5e832e={},_0x4a6243;if(_0x23629d[_0x37a6('0x61')]['to']){_0x4a6243=_0x23629d[_0x37a6('0x61')]['to'][_0x37a6('0xa2')](',')[0x0];}return db[_0x37a6('0x41')][_0x37a6('0x60')]({'where':{'id':_0x23629d['params']['id']},'include':[{'model':db[_0x37a6('0xa5')],'as':_0x37a6('0xa6'),'include':[{'model':db[_0x37a6('0x8b')],'as':_0x37a6('0xa7'),'where':{'email':_0x4a6243},'limit':0x1,'order':[[_0x37a6('0xa8'),_0x37a6('0xa9')]]}]},{'model':db[_0x37a6('0x5d')],'as':'Smtp','raw':!![]}]})[_0x37a6('0x1f')](handleEntityNotFound(_0x24c0da,null))[_0x37a6('0x1f')](function(_0x4c446){if(_0x4c446){_0x2e1954=_0x4c446;if(_0x4c446[_0x37a6('0x3e')]){if(_[_0x37a6('0x70')](_0x23629d[_0x37a6('0x61')][_0x37a6('0xaa')])){_0x23629d['body'][_0x37a6('0xaa')]=util['format'](_0x37a6('0xab'),_0x4c446[_0x37a6('0x47')],_0x4c446[_0x37a6('0x6e')]||_0x4c446[_0x37a6('0x3e')][_0x37a6('0x7b')]);}if(_0x23629d[_0x37a6('0x61')][_0x37a6('0xac')]&&_0x23629d[_0x37a6('0x61')][_0x37a6('0xac')][_0x37a6('0x4e')]){for(var _0x576982=0x0;_0x576982<_0x23629d[_0x37a6('0x61')][_0x37a6('0xac')][_0x37a6('0x4e')];_0x576982+=0x1){_0x23629d[_0x37a6('0x61')][_0x37a6('0xac')][_0x576982]={'filename':_0x23629d[_0x37a6('0x61')]['attachments'][_0x576982][_0x37a6('0x47')],'path':path['join'](config[_0x37a6('0xad')],_0x37a6('0xae'),_0x23629d['body'][_0x37a6('0xac')][_0x576982][_0x37a6('0xaf')])};}}var _0x3f5550={'tls':{'rejectUnauthorized':![]}};if(_[_0x37a6('0x70')](_0x4c446['Smtp'][_0x37a6('0x7a')])){if(_0x4c446['Smtp'][_0x37a6('0x77')]){_0x3f5550['auth']={'user':_0x4c446[_0x37a6('0x3e')][_0x37a6('0x7b')],'pass':_0x4c446['Smtp']['pass']};}_0x3f5550[_0x37a6('0x78')]=_0x4c446['Smtp'][_0x37a6('0x78')];_0x3f5550['port']=_0x4c446[_0x37a6('0x3e')][_0x37a6('0x79')];_0x3f5550['secure']=_0x4c446[_0x37a6('0x3e')][_0x37a6('0xb0')];}else{_0x3f5550['service']=_0x4c446[_0x37a6('0x3e')][_0x37a6('0x7a')];_0x3f5550[_0x37a6('0xb1')]={'user':_0x4c446[_0x37a6('0x3e')][_0x37a6('0x7b')],'pass':_0x4c446[_0x37a6('0x3e')][_0x37a6('0x75')]};}return respondWithRpcPromise(_0x37a6('0xb2'),_0x37a6('0xb3'),{'account':_0x3f5550,'message':_0x23629d[_0x37a6('0x61')]});}else{throw new Error(_0x37a6('0xb4'));}}})[_0x37a6('0x1f')](function(_0x2b0055){if(_0x2b0055){_0x5e832e=_0x2b0055;if(_0x2e1954[_0x37a6('0xa6')]){if(_0x2e1954[_0x37a6('0xa6')][_0x37a6('0xa7')]['length']){return _0x2e1954['List']['Contacts'][0x0];}else{return db[_0x37a6('0x8b')][_0x37a6('0x66')](_['defaults'](_0x23629d[_0x37a6('0x61')],{'firstName':_0x23629d['body']['to'],'email':_0x23629d[_0x37a6('0x61')]['to'],'phone':_0x23629d[_0x37a6('0x61')]['to'],'ListId':_0x2e1954[_0x37a6('0x6f')]}));}}else{throw new Error(_0x37a6('0xb4'));}}})['then'](function(_0x283074){if(_0x283074){var _0x4373e2={'UserId':_0x23629d['user']['id'],'ContactId':_0x283074['id'],'MailAccountId':_0x2e1954['id'],'inReplyTo':_0x5e832e[_0x37a6('0xb5')],'to':_0x23629d[_0x37a6('0x61')][_0x37a6('0xaa')],'cc':_0x23629d[_0x37a6('0x61')]['cc'],'subject':_0x23629d['body']['subject'],'attach':_0x23629d['body'][_0x37a6('0xb6')],'firstMsgDirection':_0x37a6('0xb7'),'lastMsgAt':moment()[_0x37a6('0xa3')](_0x37a6('0xb8')),'lastMsgDirection':'out','Messages':[_[_0x37a6('0x56')](_0x23629d[_0x37a6('0x61')],{'messageId':_0x5e832e[_0x37a6('0xb5')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2e1954['id'],'UserId':_0x23629d[_0x37a6('0x7b')]['id'],'ContactId':_0x283074['id']})]};if(_0x23629d['body'][_0x37a6('0xb9')]){_0x4373e2=_[_0x37a6('0x56')](_0x4373e2,_0x23629d[_0x37a6('0x61')]['Interaction']);}return db[_0x37a6('0x8a')]['create'](_0x4373e2,{'include':[{'model':db[_0x37a6('0xa0')],'as':_0x37a6('0xba')}]});}})[_0x37a6('0x1f')](respondWithResult(_0x24c0da,null))[_0x37a6('0x2a')](handleError(_0x24c0da,null));};exports['verifySmtp']=function(_0x29176a,_0xdbb83c,_0x3d2820){return db['MailAccount'][_0x37a6('0x60')]({'where':{'id':_0x29176a[_0x37a6('0x5c')]['id']},'include':[{'model':db[_0x37a6('0x5d')],'as':'Smtp','raw':!![]}]})[_0x37a6('0x1f')](handleEntityNotFound(_0xdbb83c,null))[_0x37a6('0x1f')](function(_0x3fec1a){if(_0x3fec1a&&_0x3fec1a[_0x37a6('0x3e')]){var _0x56c443={'id':_0x3fec1a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3fec1a[_0x37a6('0x3e')]['service']){_0x56c443[_0x37a6('0x7a')]=_0x3fec1a['Smtp']['service'];}else{_0x56c443[_0x37a6('0x78')]=_0x3fec1a[_0x37a6('0x3e')]['host'];_0x56c443[_0x37a6('0x79')]=_0x3fec1a[_0x37a6('0x3e')][_0x37a6('0x79')];_0x56c443['secure']=_0x3fec1a[_0x37a6('0x3e')][_0x37a6('0xb0')];}if(_0x3fec1a[_0x37a6('0x3e')][_0x37a6('0x77')]){_0x56c443[_0x37a6('0xb1')]={'user':_0x3fec1a[_0x37a6('0x3e')][_0x37a6('0x7b')],'pass':_0x3fec1a[_0x37a6('0x3e')]['pass']};}return respondWithRpcPromise(_0x37a6('0xbb'),_0x37a6('0xbc'),{'account':_0x56c443});}})[_0x37a6('0x1f')](respondWithResult(_0xdbb83c,null))[_0x37a6('0x2a')](handleError(_0xdbb83c,null));};exports[_0x37a6('0x35')]=function(_0x4c2824,_0x48cb0e){return db['MailAccount'][_0x37a6('0x60')]({'where':{'id':_0x4c2824[_0x37a6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x48cb0e,null))[_0x37a6('0x1f')](function(_0x4bb545){if(_0x4bb545&&_0x4bb545[_0x37a6('0x7a')]){throw new db[(_0x37a6('0xbd'))][(_0x37a6('0xbe'))](_0x37a6('0xbf'));}return _0x4bb545;})['then'](removeEntity(_0x48cb0e,null))[_0x37a6('0x2a')](handleError(_0x48cb0e,null));};exports[_0x37a6('0xc0')]=function(_0x226062,_0x1ada1e,_0xf8c7ee){return db[_0x37a6('0x41')]['find']({'where':{'id':_0x226062[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x1ada1e,null))[_0x37a6('0x1f')](function(_0x4e8b7f){if(_0x4e8b7f){return _0x4e8b7f[_0x37a6('0xc0')](_0x226062[_0x37a6('0x61')][_0x37a6('0x6a')],_[_0x37a6('0xc1')](_0x226062[_0x37a6('0x61')],[_0x37a6('0x6a'),'id'])||{})[_0x37a6('0xc2')](function(_0x38752e){for(var _0x4ed29b=0x0;_0x4ed29b<_0x226062[_0x37a6('0x61')]['ids']['length'];_0x4ed29b+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x226062[_0x37a6('0x61')][_0x37a6('0x6a')][_0x4ed29b]),'MailAccountId':Number(_0x226062[_0x37a6('0x5c')]['id'])});}return _0x38752e;});}})[_0x37a6('0x1f')](respondWithResult(_0x1ada1e,null))[_0x37a6('0x2a')](handleError(_0x1ada1e,null));};exports[_0x37a6('0xc3')]=function(_0x5d894e,_0x353eb5,_0x1ab69e){return db[_0x37a6('0x41')][_0x37a6('0x60')]({'where':{'id':_0x5d894e[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x353eb5,null))[_0x37a6('0x1f')](function(_0x3b1941){if(_0x3b1941){return _0x3b1941[_0x37a6('0xc3')](_0x5d894e[_0x37a6('0x48')]['ids'])[_0x37a6('0x1f')](function(){if(_['isArray'](_0x5d894e[_0x37a6('0x48')][_0x37a6('0x6a')])){for(var _0x3e428c=0x0;_0x3e428c<_0x5d894e[_0x37a6('0x48')][_0x37a6('0x6a')]['length'];_0x3e428c+=0x1){socket['emit'](_0x37a6('0xc4'),{'UserId':Number(_0x5d894e[_0x37a6('0x48')][_0x37a6('0x6a')][_0x3e428c]),'MailAccountId':Number(_0x5d894e[_0x37a6('0x5c')]['id'])});}}else{socket[_0x37a6('0xc5')](_0x37a6('0xc4'),{'UserId':Number(_0x5d894e[_0x37a6('0x48')]['ids']),'MailAccountId':Number(_0x5d894e[_0x37a6('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x353eb5,null))[_0x37a6('0x2a')](handleError(_0x353eb5,null));};exports[_0x37a6('0xc6')]=function(_0xe30717,_0x11330e,_0x52a519){var _0x481a20={};var _0x551645={};var _0x4836c2;var _0x2b299e;return db[_0x37a6('0x41')][_0x37a6('0x68')]({'where':{'id':_0xe30717[_0x37a6('0x5c')]['id']}})[_0x37a6('0x1f')](handleEntityNotFound(_0x11330e,null))['then'](function(_0x3807b1){if(_0x3807b1){_0x4836c2=_0x3807b1;_0x551645[_0x37a6('0x46')]=_[_0x37a6('0x49')](db[_0x37a6('0x8d')]['rawAttributes']);_0x551645[_0x37a6('0x48')]=_[_0x37a6('0x49')](_0xe30717[_0x37a6('0x48')]);_0x551645[_0x37a6('0x4a')]=_[_0x37a6('0x4b')](_0x551645[_0x37a6('0x46')],_0x551645[_0x37a6('0x48')]);_0x481a20[_0x37a6('0x4d')]=_['intersection'](_0x551645[_0x37a6('0x46')],qs[_0x37a6('0x4c')](_0xe30717[_0x37a6('0x48')][_0x37a6('0x4c')]));_0x481a20[_0x37a6('0x4d')]=_0x481a20[_0x37a6('0x4d')]['length']?_0x481a20[_0x37a6('0x4d')]:_0x551645[_0x37a6('0x46')];_0x481a20[_0x37a6('0x51')]=qs[_0x37a6('0x52')](_0xe30717[_0x37a6('0x48')][_0x37a6('0x52')]);_0x481a20[_0x37a6('0x53')]=qs['filters'](_[_0x37a6('0x54')](_0xe30717[_0x37a6('0x48')],_0x551645[_0x37a6('0x4a')]));if(_0xe30717[_0x37a6('0x48')][_0x37a6('0x55')]){_0x481a20[_0x37a6('0x53')]=_[_0x37a6('0x56')](_0x481a20[_0x37a6('0x53')],{'$or':_['map'](_0x481a20['attributes'],function(_0x5a6196){var _0x545a11={};_0x545a11[_0x5a6196]={'$like':'%'+_0xe30717[_0x37a6('0x48')][_0x37a6('0x55')]+'%'};return _0x545a11;})});}_0x481a20=_['merge']({},_0x481a20,_0xe30717[_0x37a6('0x5f')]);return _0x4836c2[_0x37a6('0xc6')](_0x481a20);}})[_0x37a6('0x1f')](function(_0x1e9e24){if(_0x1e9e24){_0x2b299e=_0x1e9e24['length'];if(!_0xe30717[_0x37a6('0x48')][_0x37a6('0x4f')]('nolimit')){_0x481a20[_0x37a6('0x2e')]=qs['limit'](_0xe30717[_0x37a6('0x48')][_0x37a6('0x2e')]);_0x481a20[_0x37a6('0x2d')]=qs[_0x37a6('0x2d')](_0xe30717[_0x37a6('0x48')][_0x37a6('0x2d')]);}return _0x4836c2[_0x37a6('0xc6')](_0x481a20);}})[_0x37a6('0x1f')](function(_0x1fcd97){if(_0x1fcd97){return _0x1fcd97?{'count':_0x2b299e,'rows':_0x1fcd97}:null;}})[_0x37a6('0x1f')](respondWithResult(_0x11330e,null))['catch'](handleError(_0x11330e,null));}; \ No newline at end of file +var _0x0be4=['keys','find','body','describe','addDisposition','Disposition','create','findOne','length','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','User','Owner','fullname','Tag','color','tag','addApplications','sequelize','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','Contacts','DESC','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List','messageId','subject','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','emit','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','index','Imap','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','MailAccount','includeAll','include','findAll','rows','catch','params','MailServerIn','MailServerOut'];(function(_0x4bfc76,_0x3df214){var _0x4c85bd=function(_0x25e457){while(--_0x25e457){_0x4bfc76['push'](_0x4bfc76['shift']());}};_0x4c85bd(++_0x3df214);}(_0x0be4,0x1ed));var _0x40be=function(_0xefeb04,_0x146132){_0xefeb04=_0xefeb04-0x0;var _0x4fe8c8=_0x0be4[_0xefeb04];return _0x4fe8c8;};'use strict';var emlformat=require(_0x40be('0x0'));var rimraf=require(_0x40be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40be('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x40be('0x3'));var Mustache=require(_0x40be('0x4'));var util=require(_0x40be('0x5'));var path=require(_0x40be('0x6'));var sox=require('sox');var csv=require(_0x40be('0x7'));var ejs=require(_0x40be('0x8'));var fs=require('fs');var fs_extra=require(_0x40be('0x9'));var _=require('lodash');var squel=require(_0x40be('0xa'));var crypto=require(_0x40be('0xb'));var jsforce=require(_0x40be('0xc'));var deskjs=require(_0x40be('0xd'));var toCsv=require('to-csv');var querystring=require(_0x40be('0xe'));var Papa=require(_0x40be('0xf'));var htmlToText=require(_0x40be('0x10'));var juice=require(_0x40be('0x11'));var Redis=require(_0x40be('0x12'));var authService=require(_0x40be('0x13'));var qs=require(_0x40be('0x14'));var as=require(_0x40be('0x15'));var hardwareService=require(_0x40be('0x16'));var logger=require(_0x40be('0x17'))(_0x40be('0x18'));var utils=require(_0x40be('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x40be('0x1a'));var db=require(_0x40be('0x1b'))['db'];config[_0x40be('0x1c')]=_[_0x40be('0x1d')](config[_0x40be('0x1c')],{'host':_0x40be('0x1e'),'port':0x18eb});var socket=require(_0x40be('0x1f'))(new Redis(config[_0x40be('0x1c')]));require('./mailAccount.socket')[_0x40be('0x20')](socket);var jayson=require(_0x40be('0x21'));var client=jayson[_0x40be('0x22')]['http']({'port':0x232b});function respondWithRpcPromise(_0xcec47d,_0x58d9a0,_0x54d795,_0x5ada82){return new BPromise(function(_0x4f059c,_0x548ecb){var _0x5944a4=_0x5ada82||client;return _0x5944a4[_0x40be('0x23')](_0xcec47d,_0x54d795)[_0x40be('0x24')](function(_0x1c023d){logger['info'](_0x40be('0x25'),_0x58d9a0,_0x40be('0x26'));logger[_0x40be('0x27')](_0x40be('0x28'),_0x58d9a0,_0x40be('0x26'),JSON[_0x40be('0x29')](_0x1c023d));if(_0x1c023d[_0x40be('0x2a')]){if(_0x1c023d[_0x40be('0x2a')][_0x40be('0x2b')]===0x1f4){logger[_0x40be('0x2a')](_0x40be('0x25'),_0x58d9a0,_0x1c023d[_0x40be('0x2a')][_0x40be('0x2c')]);return _0x548ecb(_0x1c023d['error']['message']);}logger[_0x40be('0x2a')](_0x40be('0x25'),_0x58d9a0,_0x1c023d[_0x40be('0x2a')][_0x40be('0x2c')]);return _0x4f059c(_0x1c023d['error'][_0x40be('0x2c')]);}else{logger[_0x40be('0x2d')](_0x40be('0x25'),_0x58d9a0,_0x40be('0x26'));_0x4f059c(_0x1c023d[_0x40be('0x2e')][_0x40be('0x2c')]);}})['catch'](function(_0x4e1a97){logger[_0x40be('0x2a')](_0x40be('0x25'),_0x58d9a0,_0x4e1a97);_0x548ecb(_0x4e1a97);});});}function respondWithStatusCode(_0x58aeb2,_0x2d6e57){_0x2d6e57=_0x2d6e57||0xcc;return function(_0x2e600a){if(_0x2e600a){return _0x58aeb2[_0x40be('0x2f')](_0x2d6e57);}return _0x58aeb2[_0x40be('0x30')](_0x2d6e57)['end']();};}function respondWithResult(_0x68dd82,_0x27a7f7){_0x27a7f7=_0x27a7f7||0xc8;return function(_0x4c30cc){if(_0x4c30cc){return _0x68dd82['status'](_0x27a7f7)[_0x40be('0x31')](_0x4c30cc);}};}function respondWithFilteredResult(_0x311996,_0xce4d1c){return function(_0x17ad1f){if(_0x17ad1f){var _0x45df58=typeof _0xce4d1c[_0x40be('0x32')]==='undefined'&&typeof _0xce4d1c[_0x40be('0x33')]===_0x40be('0x34');var _0x155822=_0x17ad1f['count'];var _0x4c6613=_0x45df58?0x0:_0xce4d1c[_0x40be('0x32')];var _0x27f4ae=_0x45df58?_0x17ad1f[_0x40be('0x35')]:_0xce4d1c[_0x40be('0x32')]+_0xce4d1c['limit'];var _0x46d4a7;if(_0x27f4ae>=_0x155822){_0x27f4ae=_0x155822;_0x46d4a7=0xc8;}else{_0x46d4a7=0xce;}_0x311996[_0x40be('0x30')](_0x46d4a7);return _0x311996[_0x40be('0x36')](_0x40be('0x37'),_0x4c6613+'-'+_0x27f4ae+'/'+_0x155822)['json'](_0x17ad1f);}return null;};}function patchUpdates(_0x2520c4){return function(_0x22e95a){try{jsonpatch[_0x40be('0x38')](_0x22e95a,_0x2520c4,!![]);}catch(_0x209e51){return BPromise['reject'](_0x209e51);}return _0x22e95a[_0x40be('0x39')]();};}function saveUpdates(_0x3cd921,_0x116515){return function(_0x52ab93){if(_0x52ab93){return _0x52ab93[_0x40be('0x3a')](_0x3cd921)[_0x40be('0x24')](function(_0x5eb0b9){return _0x5eb0b9;});}return null;};}function removeEntity(_0x2448f4,_0x28a054){return function(_0x2046d9){if(_0x2046d9){return _0x2046d9[_0x40be('0x3b')]()['then'](function(){var _0x27da16=_0x2046d9[_0x40be('0x3c')]({'plain':!![]});var _0x32cafc=_0x40be('0x3d');return db[_0x40be('0x3e')][_0x40be('0x3b')]({'where':{'type':_0x32cafc,'resourceId':_0x27da16['id']}})['then'](function(){return _0x2046d9;});})['then'](function(){_0x2448f4[_0x40be('0x30')](0xcc)[_0x40be('0x3f')]();});}};}function handleEntityNotFound(_0x269399,_0x26cc25){return function(_0x2aa30a){if(!_0x2aa30a){_0x269399[_0x40be('0x2f')](0x194);}return _0x2aa30a;};}function handleError(_0x55230d,_0x811409){_0x811409=_0x811409||0x1f4;return function(_0x5e29d5){logger[_0x40be('0x2a')](_0x5e29d5[_0x40be('0x40')]);if(_0x5e29d5[_0x40be('0x41')]){delete _0x5e29d5['name'];}_0x55230d['status'](_0x811409)[_0x40be('0x42')](_0x5e29d5);};}exports[_0x40be('0x43')]=function(_0x3cbc5e,_0x267422){var _0xdb1419={'include':[{'model':db['MailServerIn'],'as':_0x40be('0x44')},{'model':db['MailServerOut'],'as':_0x40be('0x45')},{'model':db[_0x40be('0x46')],'as':_0x40be('0x47')}]},_0x2b83fa={},_0xbdc6ab={'count':0x0,'rows':[]};var _0x21665e=_[_0x40be('0x48')](db['MailAccount'][_0x40be('0x49')],function(_0x35b414){return{'name':_0x35b414[_0x40be('0x4a')],'type':_0x35b414[_0x40be('0x4b')][_0x40be('0x4c')]};});_0x2b83fa[_0x40be('0x4d')]=_[_0x40be('0x48')](_0x21665e,'name');_0x2b83fa[_0x40be('0x4e')]=_['keys'](_0x3cbc5e[_0x40be('0x4e')]);_0x2b83fa[_0x40be('0x4f')]=_['intersection'](_0x2b83fa['model'],_0x2b83fa[_0x40be('0x4e')]);_0xdb1419[_0x40be('0x50')]=_[_0x40be('0x51')](_0x2b83fa[_0x40be('0x4d')],qs[_0x40be('0x52')](_0x3cbc5e[_0x40be('0x4e')][_0x40be('0x52')]));_0xdb1419[_0x40be('0x50')]=_0xdb1419[_0x40be('0x50')]['length']?_0xdb1419[_0x40be('0x50')]:_0x2b83fa[_0x40be('0x4d')];if(!_0x3cbc5e[_0x40be('0x4e')][_0x40be('0x53')](_0x40be('0x54'))){_0xdb1419['limit']=qs[_0x40be('0x33')](_0x3cbc5e['query'][_0x40be('0x33')]);_0xdb1419['offset']=qs['offset'](_0x3cbc5e['query'][_0x40be('0x32')]);}_0xdb1419[_0x40be('0x55')]=qs[_0x40be('0x56')](_0x3cbc5e['query']['sort']);_0xdb1419[_0x40be('0x57')]=qs['filters'](_[_0x40be('0x58')](_0x3cbc5e['query'],_0x2b83fa[_0x40be('0x4f')]),_0x21665e);if(_0x3cbc5e[_0x40be('0x4e')][_0x40be('0x59')]){_0xdb1419['where']=_['merge'](_0xdb1419[_0x40be('0x57')],{'$or':_[_0x40be('0x48')](_0x21665e,function(_0xa2bef9){if(_0xa2bef9[_0x40be('0x4b')]!=='VIRTUAL'){var _0x3d15cc={};_0x3d15cc[_0xa2bef9['name']]={'$like':'%'+_0x3cbc5e['query'][_0x40be('0x59')]+'%'};return _0x3d15cc;}})});}_0xdb1419=_[_0x40be('0x5a')]({},_0xdb1419,_0x3cbc5e[_0x40be('0x5b')]);var _0x4a5126={'where':_0xdb1419[_0x40be('0x57')]};return db[_0x40be('0x5c')]['count'](_0x4a5126)[_0x40be('0x24')](function(_0x397f74){_0xbdc6ab[_0x40be('0x35')]=_0x397f74;if(_0x3cbc5e[_0x40be('0x4e')][_0x40be('0x5d')]){_0xdb1419[_0x40be('0x5e')]=[{'all':!![]}];}return db[_0x40be('0x5c')][_0x40be('0x5f')](_0xdb1419);})['then'](function(_0x1b67ab){_0xbdc6ab[_0x40be('0x60')]=_0x1b67ab;return _0xbdc6ab;})[_0x40be('0x24')](respondWithFilteredResult(_0x267422,_0xdb1419))[_0x40be('0x61')](handleError(_0x267422,null));};exports['show']=function(_0x3b9b62,_0x1b5bb9){var _0x4dbcf0={'raw':![],'where':{'id':_0x3b9b62[_0x40be('0x62')]['id']},'include':[{'model':db[_0x40be('0x63')],'as':_0x40be('0x44')},{'model':db[_0x40be('0x64')],'as':_0x40be('0x45')},{'model':db[_0x40be('0x46')],'as':'mandatoryDispositionPause'}]},_0x184dcc={};_0x184dcc[_0x40be('0x4d')]=_[_0x40be('0x65')](db['MailAccount'][_0x40be('0x49')]);_0x184dcc['query']=_[_0x40be('0x65')](_0x3b9b62['query']);_0x184dcc[_0x40be('0x4f')]=_['intersection'](_0x184dcc[_0x40be('0x4d')],_0x184dcc[_0x40be('0x4e')]);_0x4dbcf0[_0x40be('0x50')]=_[_0x40be('0x51')](_0x184dcc[_0x40be('0x4d')],qs[_0x40be('0x52')](_0x3b9b62[_0x40be('0x4e')][_0x40be('0x52')]));_0x4dbcf0[_0x40be('0x50')]=_0x4dbcf0['attributes']['length']?_0x4dbcf0[_0x40be('0x50')]:_0x184dcc[_0x40be('0x4d')];if(_0x3b9b62['query'][_0x40be('0x5d')]){_0x4dbcf0[_0x40be('0x5e')]=[{'all':!![]}];}_0x4dbcf0=_[_0x40be('0x5a')]({},_0x4dbcf0,_0x3b9b62[_0x40be('0x5b')]);return db[_0x40be('0x5c')][_0x40be('0x66')](_0x4dbcf0)[_0x40be('0x24')](handleEntityNotFound(_0x1b5bb9,null))[_0x40be('0x24')](respondWithResult(_0x1b5bb9,null))['catch'](handleError(_0x1b5bb9,null));};exports[_0x40be('0x3a')]=function(_0x2094c0,_0x44d3c6){if(_0x2094c0[_0x40be('0x67')]['id']){delete _0x2094c0['body']['id'];}return db[_0x40be('0x5c')]['find']({'where':{'id':_0x2094c0['params']['id']},'include':[{'model':db[_0x40be('0x63')],'as':_0x40be('0x44')},{'model':db[_0x40be('0x64')],'as':_0x40be('0x45')},{'model':db['Pause'],'as':_0x40be('0x47')}]})[_0x40be('0x24')](handleEntityNotFound(_0x44d3c6,null))['then'](saveUpdates(_0x2094c0['body'],null))['then'](function(_0xd0d864){if(_0xd0d864&&_0x2094c0[_0x40be('0x67')][_0x40be('0x44')]){return db[_0x40be('0x63')][_0x40be('0x3a')](_0x2094c0[_0x40be('0x67')][_0x40be('0x44')],{'where':{'MailAccountId':_0xd0d864['id']}})['then'](function(){return _0xd0d864;});}return _0xd0d864;})[_0x40be('0x24')](function(_0x15004e){if(_0x15004e&&_0x2094c0[_0x40be('0x67')][_0x40be('0x45')]){return db[_0x40be('0x64')][_0x40be('0x3a')](_0x2094c0[_0x40be('0x67')][_0x40be('0x45')],{'where':{'MailAccountId':_0x15004e['id']}})[_0x40be('0x24')](function(){return _0x15004e;});}return _0x15004e;})[_0x40be('0x24')](respondWithResult(_0x44d3c6,null))[_0x40be('0x61')](handleError(_0x44d3c6,null));};exports[_0x40be('0x68')]=function(_0x57fdd7,_0x5ac4a6){return db[_0x40be('0x5c')]['describe']()[_0x40be('0x24')](respondWithResult(_0x5ac4a6,null))[_0x40be('0x61')](handleError(_0x5ac4a6,null));};exports[_0x40be('0x69')]=function(_0x3ac1cc,_0x22a130,_0x88a494){if(_0x3ac1cc[_0x40be('0x67')]['id']){delete _0x3ac1cc['body']['id'];}return db[_0x40be('0x5c')][_0x40be('0x66')]({'where':{'id':_0x3ac1cc['params']['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x22a130,null))['then'](function(_0x299e2f){if(_0x299e2f){_0x3ac1cc[_0x40be('0x67')]['MailAccountId']=_0x299e2f['id'];return db[_0x40be('0x6a')][_0x40be('0x6b')](_0x3ac1cc[_0x40be('0x67')]);}})[_0x40be('0x24')](respondWithResult(_0x22a130,null))['catch'](handleError(_0x22a130,null));};exports['getDispositions']=function(_0x1aa7cb,_0x3ba648,_0x5324c6){var _0x3c70a5={'raw':![],'where':{}};var _0x274b00={};var _0xc47ff3={'count':0x0,'rows':[]};return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x1aa7cb['params']['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x3ba648,null))[_0x40be('0x24')](function(_0x37e382){if(_0x37e382){_0x274b00[_0x40be('0x4d')]=_[_0x40be('0x65')](db['Disposition'][_0x40be('0x49')]);_0x274b00[_0x40be('0x4e')]=_['keys'](_0x1aa7cb[_0x40be('0x4e')]);_0x274b00[_0x40be('0x4f')]=_[_0x40be('0x51')](_0x274b00[_0x40be('0x4d')],_0x274b00[_0x40be('0x4e')]);_0x3c70a5[_0x40be('0x50')]=_[_0x40be('0x51')](_0x274b00['model'],qs[_0x40be('0x52')](_0x1aa7cb[_0x40be('0x4e')]['fields']));_0x3c70a5['attributes']=_0x3c70a5[_0x40be('0x50')][_0x40be('0x6d')]?_0x3c70a5[_0x40be('0x50')]:_0x274b00[_0x40be('0x4d')];if(!_0x1aa7cb[_0x40be('0x4e')]['hasOwnProperty']('nolimit')){_0x3c70a5[_0x40be('0x33')]=qs[_0x40be('0x33')](_0x1aa7cb[_0x40be('0x4e')]['limit']);_0x3c70a5['offset']=qs['offset'](_0x1aa7cb[_0x40be('0x4e')]['offset']);}_0x3c70a5[_0x40be('0x55')]=qs[_0x40be('0x56')](_0x1aa7cb['query'][_0x40be('0x56')]);_0x3c70a5[_0x40be('0x57')]=qs[_0x40be('0x4f')](_[_0x40be('0x58')](_0x1aa7cb[_0x40be('0x4e')],_0x274b00['filters']));_0x3c70a5[_0x40be('0x57')][_0x40be('0x6e')]=_0x37e382['id'];if(_0x1aa7cb[_0x40be('0x4e')][_0x40be('0x59')]){_0x3c70a5[_0x40be('0x57')]=_[_0x40be('0x5a')](_0x3c70a5['where'],{'$or':_[_0x40be('0x48')](_0x3c70a5[_0x40be('0x50')],function(_0x6b266d){var _0x1d2108={};_0x1d2108[_0x6b266d]={'$like':'%'+_0x1aa7cb[_0x40be('0x4e')][_0x40be('0x59')]+'%'};return _0x1d2108;})});}_0x3c70a5=_[_0x40be('0x5a')]({},_0x3c70a5,_0x1aa7cb['options']);return db[_0x40be('0x6a')][_0x40be('0x35')]({'where':_0x3c70a5[_0x40be('0x57')]})['then'](function(_0x130018){_0xc47ff3[_0x40be('0x35')]=_0x130018;if(_0x1aa7cb['query'][_0x40be('0x5d')]){_0x3c70a5['include']=[{'all':!![]}];}return db[_0x40be('0x6a')][_0x40be('0x5f')](_0x3c70a5);})[_0x40be('0x24')](function(_0x40ce55){_0xc47ff3['rows']=_0x40ce55;return _0xc47ff3;});}})[_0x40be('0x24')](respondWithFilteredResult(_0x3ba648,_0x3c70a5))['catch'](handleError(_0x3ba648,null));};exports[_0x40be('0x6f')]=function(_0x1b695f,_0x25a948,_0x45f700){return db['MailAccount'][_0x40be('0x66')]({'where':{'id':_0x1b695f[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x25a948,null))[_0x40be('0x24')](function(_0x4c831b){if(_0x4c831b){return _0x4c831b['removeDispositions'](_0x1b695f[_0x40be('0x4e')][_0x40be('0x70')]);}})[_0x40be('0x24')](respondWithStatusCode(_0x25a948,null))[_0x40be('0x61')](handleError(_0x25a948,null));};exports[_0x40be('0x71')]=function(_0x476499,_0x486447,_0x4be405){if(_0x476499[_0x40be('0x67')]['id']){delete _0x476499[_0x40be('0x67')]['id'];}return db[_0x40be('0x5c')][_0x40be('0x66')]({'where':{'id':_0x476499[_0x40be('0x62')]['id']}})['then'](handleEntityNotFound(_0x486447,null))['then'](function(_0xcd7f8f){if(_0xcd7f8f){_0x476499[_0x40be('0x67')][_0x40be('0x6e')]=_0xcd7f8f['id'];return db[_0x40be('0x72')][_0x40be('0x6b')](_0x476499[_0x40be('0x67')]);}})[_0x40be('0x24')](respondWithResult(_0x486447,null))[_0x40be('0x61')](handleError(_0x486447,null));};exports[_0x40be('0x73')]=function(_0x4ba492,_0x2b5072,_0x54e716){var _0x14cab4={'raw':![],'where':{}};var _0x5ea050={};var _0x4bf3fe={'count':0x0,'rows':[]};return db[_0x40be('0x5c')]['findOne']({'where':{'id':_0x4ba492[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x2b5072,null))['then'](function(_0x374b91){if(_0x374b91){_0x5ea050[_0x40be('0x4d')]=_[_0x40be('0x65')](db[_0x40be('0x72')][_0x40be('0x49')]);_0x5ea050[_0x40be('0x4e')]=_[_0x40be('0x65')](_0x4ba492[_0x40be('0x4e')]);_0x5ea050[_0x40be('0x4f')]=_[_0x40be('0x51')](_0x5ea050[_0x40be('0x4d')],_0x5ea050[_0x40be('0x4e')]);_0x14cab4[_0x40be('0x50')]=_[_0x40be('0x51')](_0x5ea050[_0x40be('0x4d')],qs[_0x40be('0x52')](_0x4ba492[_0x40be('0x4e')][_0x40be('0x52')]));_0x14cab4[_0x40be('0x50')]=_0x14cab4[_0x40be('0x50')]['length']?_0x14cab4[_0x40be('0x50')]:_0x5ea050[_0x40be('0x4d')];if(!_0x4ba492['query']['hasOwnProperty'](_0x40be('0x54'))){_0x14cab4[_0x40be('0x33')]=qs['limit'](_0x4ba492[_0x40be('0x4e')][_0x40be('0x33')]);_0x14cab4['offset']=qs[_0x40be('0x32')](_0x4ba492['query'][_0x40be('0x32')]);}_0x14cab4['order']=qs[_0x40be('0x56')](_0x4ba492['query'][_0x40be('0x56')]);_0x14cab4[_0x40be('0x57')]=qs['filters'](_[_0x40be('0x58')](_0x4ba492[_0x40be('0x4e')],_0x5ea050[_0x40be('0x4f')]));_0x14cab4[_0x40be('0x57')][_0x40be('0x6e')]=_0x374b91['id'];if(_0x4ba492[_0x40be('0x4e')]['filter']){_0x14cab4['where']=_[_0x40be('0x5a')](_0x14cab4[_0x40be('0x57')],{'$or':_[_0x40be('0x48')](_0x14cab4[_0x40be('0x50')],function(_0x5a68bc){var _0x3202fc={};_0x3202fc[_0x5a68bc]={'$like':'%'+_0x4ba492[_0x40be('0x4e')][_0x40be('0x59')]+'%'};return _0x3202fc;})});}_0x14cab4=_[_0x40be('0x5a')]({},_0x14cab4,_0x4ba492['options']);return db[_0x40be('0x72')][_0x40be('0x35')]({'where':_0x14cab4[_0x40be('0x57')]})[_0x40be('0x24')](function(_0x239123){_0x4bf3fe[_0x40be('0x35')]=_0x239123;if(_0x4ba492['query'][_0x40be('0x5d')]){_0x14cab4[_0x40be('0x5e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x40be('0x5f')](_0x14cab4);})[_0x40be('0x24')](function(_0x1f7d13){_0x4bf3fe[_0x40be('0x60')]=_0x1f7d13;return _0x4bf3fe;});}})[_0x40be('0x24')](respondWithFilteredResult(_0x2b5072,_0x14cab4))[_0x40be('0x61')](handleError(_0x2b5072,null));};exports['removeAnswers']=function(_0x149aed,_0x455b29,_0x134da9){return db[_0x40be('0x5c')]['find']({'where':{'id':_0x149aed[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x455b29,null))['then'](function(_0x4d5985){if(_0x4d5985){return _0x4d5985[_0x40be('0x74')](_0x149aed[_0x40be('0x4e')][_0x40be('0x70')]);}})['then'](respondWithStatusCode(_0x455b29,null))[_0x40be('0x61')](handleError(_0x455b29,null));};exports['create']=function(_0x28eea2,_0x3ee626){var _0x4fa699={'name':_0x28eea2[_0x40be('0x67')][_0x40be('0x41')],'key':_0x28eea2[_0x40be('0x67')][_0x40be('0x4c')],'email':_0x28eea2['body'][_0x40be('0x75')],'ListId':_0x28eea2[_0x40be('0x67')][_0x40be('0x76')],'active':!_[_0x40be('0x77')](_0x28eea2['body'][_0x40be('0x78')])?_0x28eea2['body'][_0x40be('0x78')]:!![],'description':_0x28eea2[_0x40be('0x67')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x28eea2[_0x40be('0x67')][_0x40be('0x79')])){if(_0x28eea2[_0x40be('0x67')][_0x40be('0x7a')]){_0x4fa699['Imap'][_0x40be('0x7b')]=_0x4fa699['Smtp'][_0x40be('0x7b')]=_0x28eea2[_0x40be('0x67')][_0x40be('0x7c')];_0x4fa699[_0x40be('0x44')][_0x40be('0x7d')]=_0x4fa699['Smtp'][_0x40be('0x7e')]=_0x28eea2['body'][_0x40be('0x7f')];}else{_0x4fa699['Imap']['authentication']=_0x4fa699['Smtp'][_0x40be('0x80')]=![];}_0x4fa699[_0x40be('0x44')]['host']=_0x28eea2[_0x40be('0x67')][_0x40be('0x44')][_0x40be('0x81')];_0x4fa699[_0x40be('0x44')]['port']=_0x28eea2[_0x40be('0x67')][_0x40be('0x44')][_0x40be('0x82')];_0x4fa699['Smtp'][_0x40be('0x81')]=_0x28eea2['body'][_0x40be('0x45')][_0x40be('0x81')];_0x4fa699[_0x40be('0x45')][_0x40be('0x82')]=_0x28eea2['body'][_0x40be('0x45')][_0x40be('0x82')];}else{_0x4fa699[_0x40be('0x44')][_0x40be('0x83')]=_0x4fa699[_0x40be('0x45')]['service']=_0x28eea2[_0x40be('0x67')]['cservice'];_0x4fa699[_0x40be('0x44')][_0x40be('0x7b')]=_0x4fa699[_0x40be('0x45')][_0x40be('0x7b')]=_0x28eea2[_0x40be('0x67')][_0x40be('0x7c')];_0x4fa699[_0x40be('0x44')][_0x40be('0x7d')]=_0x4fa699[_0x40be('0x45')][_0x40be('0x7e')]=_0x28eea2[_0x40be('0x67')][_0x40be('0x7f')];}return db[_0x40be('0x5c')][_0x40be('0x6b')](_0x4fa699,{'include':[{'model':db[_0x40be('0x64')],'as':_0x40be('0x45')},{'model':db[_0x40be('0x63')],'as':_0x40be('0x44')}]})[_0x40be('0x24')](function(_0x1665fe){var _0x3a2117=_0x28eea2[_0x40be('0x7b')][_0x40be('0x3c')]({'plain':!![]});if(!_0x3a2117)throw new Error(_0x40be('0x84'));if(_0x3a2117[_0x40be('0x85')]===_0x40be('0x7b')){var _0x51ffb0=_0x1665fe[_0x40be('0x3c')]({'plain':!![]});return db[_0x40be('0x86')]['find']({'where':{'name':_0x40be('0x3d'),'userProfileId':_0x3a2117[_0x40be('0x87')]},'raw':!![]})[_0x40be('0x24')](function(_0x59ce3f){if(_0x59ce3f&&_0x59ce3f[_0x40be('0x88')]===0x0){return db['UserProfileResource'][_0x40be('0x6b')]({'name':_0x51ffb0[_0x40be('0x41')],'resourceId':_0x51ffb0['id'],'type':_0x59ce3f['name'],'sectionId':_0x59ce3f['id']},{})[_0x40be('0x24')](function(){return _0x1665fe;});}else{return _0x1665fe;}})[_0x40be('0x61')](function(_0x431d07){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x431d07);throw _0x431d07;});}return _0x1665fe;})[_0x40be('0x24')](respondWithResult(_0x3ee626,0xc9))['catch'](handleError(_0x3ee626,null));};exports[_0x40be('0x89')]=function(_0x3dc6a6,_0x351844,_0x1656c6){return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x3dc6a6[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x351844,null))[_0x40be('0x24')](function(_0x91378d){if(_0x91378d){return _0x91378d[_0x40be('0x89')]();}return null;})[_0x40be('0x24')](respondWithResult(_0x351844,null))[_0x40be('0x61')](handleError(_0x351844,null));};exports[_0x40be('0x8a')]=function(_0x3839ac,_0x48f1b2,_0x450e00){if(_0x3839ac[_0x40be('0x67')]['id']){delete _0x3839ac[_0x40be('0x67')]['id'];}return db[_0x40be('0x5c')][_0x40be('0x66')]({'where':{'id':_0x3839ac[_0x40be('0x62')]['id']}})['then'](handleEntityNotFound(_0x48f1b2,null))['then'](function(_0x2edee2){if(_0x2edee2){_0x3839ac['body'][_0x40be('0x6e')]=_0x2edee2['id'];return db[_0x40be('0x63')][_0x40be('0x6b')](_0x3839ac['body']);}})[_0x40be('0x24')](respondWithResult(_0x48f1b2,null))[_0x40be('0x61')](handleError(_0x48f1b2,null));};exports['removeImap']=function(_0x326aea,_0x287dc7,_0xa78958){return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x326aea[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x287dc7,null))[_0x40be('0x24')](function(_0x159dd4){if(_0x159dd4){return _0x159dd4[_0x40be('0x8b')](null);}return null;})[_0x40be('0x24')](respondWithStatusCode(_0x287dc7,null))['catch'](handleError(_0x287dc7,null));};exports[_0x40be('0x8c')]=function(_0x5c248f,_0x37af9c,_0x5b5125){return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x5c248f['params']['id']}})['then'](handleEntityNotFound(_0x37af9c,null))[_0x40be('0x24')](function(_0x193283){if(_0x193283){return _0x193283['getSmtp']();}return null;})[_0x40be('0x24')](respondWithResult(_0x37af9c,null))[_0x40be('0x61')](handleError(_0x37af9c,null));};exports['addSmtp']=function(_0x567b4e,_0x23280f,_0x206c03){if(_0x567b4e[_0x40be('0x67')]['id']){delete _0x567b4e[_0x40be('0x67')]['id'];}return db[_0x40be('0x5c')][_0x40be('0x66')]({'where':{'id':_0x567b4e[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x23280f,null))[_0x40be('0x24')](function(_0x3b2feb){if(_0x3b2feb){_0x567b4e[_0x40be('0x67')][_0x40be('0x6e')]=_0x3b2feb['id'];return db['MailServerOut'][_0x40be('0x6b')](_0x567b4e[_0x40be('0x67')]);}})['then'](respondWithResult(_0x23280f,null))[_0x40be('0x61')](handleError(_0x23280f,null));};exports[_0x40be('0x8d')]=function(_0x23ab4c,_0x46deff,_0xccc6e4){return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x23ab4c[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x46deff,null))['then'](function(_0x4ee497){if(_0x4ee497){return _0x4ee497['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x46deff,null))['catch'](handleError(_0x46deff,null));};exports[_0x40be('0x8e')]=function(_0xcbcb35,_0x1a91de,_0x462969){return db[_0x40be('0x8f')][_0x40be('0x66')]({'where':{'id':_0xcbcb35['params']['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x1a91de,null))['then'](function(_0x344e1d){if(_0x344e1d){return _0x344e1d[_0x40be('0x8e')](_0xcbcb35['body'][_0x40be('0x70')],_[_0x40be('0x90')](_0xcbcb35[_0x40be('0x67')],[_0x40be('0x70'),'id'])||{});}})[_0x40be('0x24')](respondWithResult(_0x1a91de,null))[_0x40be('0x61')](handleError(_0x1a91de,null));};exports['getInteractions']=function(_0x450172,_0x3af376,_0x2adfa6){var _0x3a703a={'raw':![],'where':{}};var _0x3815d9={};var _0x2ca4e3={'count':0x0,'rows':[]};return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x450172[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x3af376,null))[_0x40be('0x24')](function(_0x42bf2e){if(_0x42bf2e){_0x3815d9[_0x40be('0x4d')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x3815d9[_0x40be('0x4e')]=_['keys'](_0x450172[_0x40be('0x4e')]);_0x3815d9[_0x40be('0x4f')]=_[_0x40be('0x51')](_0x3815d9[_0x40be('0x4d')],_0x3815d9['query']);_0x3a703a[_0x40be('0x50')]=_[_0x40be('0x51')](_0x3815d9['model'],qs[_0x40be('0x52')](_0x450172[_0x40be('0x4e')]['fields']));_0x3a703a[_0x40be('0x50')]=_0x3a703a[_0x40be('0x50')][_0x40be('0x6d')]?_0x3a703a[_0x40be('0x50')]:_0x3815d9[_0x40be('0x4d')];if(!_0x450172[_0x40be('0x4e')][_0x40be('0x53')](_0x40be('0x54'))){_0x3a703a[_0x40be('0x33')]=qs[_0x40be('0x33')](_0x450172[_0x40be('0x4e')][_0x40be('0x33')]);_0x3a703a[_0x40be('0x32')]=qs[_0x40be('0x32')](_0x450172[_0x40be('0x4e')][_0x40be('0x32')]);}_0x3a703a['order']=qs['sort'](_0x450172[_0x40be('0x4e')][_0x40be('0x56')]);_0x3a703a[_0x40be('0x57')]=qs[_0x40be('0x4f')](_[_0x40be('0x58')](_0x450172[_0x40be('0x4e')],_0x3815d9[_0x40be('0x4f')]));_0x3a703a[_0x40be('0x57')]['MailAccountId']=_0x42bf2e['id'];if(_0x450172[_0x40be('0x4e')][_0x40be('0x59')]){_0x3a703a[_0x40be('0x57')]=_[_0x40be('0x5a')](_0x3a703a[_0x40be('0x57')],{'$or':_['map'](_0x3a703a[_0x40be('0x50')],function(_0x3f5271){var _0x5cb345={};_0x5cb345[_0x3f5271]={'$like':'%'+_0x450172[_0x40be('0x4e')][_0x40be('0x59')]+'%'};return _0x5cb345;})});}_0x3a703a=_['merge']({},_0x3a703a,_0x450172[_0x40be('0x5b')]);return db['MailInteraction'][_0x40be('0x35')]({'where':_0x3a703a['where']})['then'](function(_0x57776a){_0x2ca4e3[_0x40be('0x35')]=_0x57776a;if(_0x450172[_0x40be('0x4e')][_0x40be('0x5d')]){_0x3a703a[_0x40be('0x5e')]=[{'model':db[_0x40be('0x91')],'as':'Contact','required':![]},{'model':db[_0x40be('0x92')],'as':_0x40be('0x93'),'attributes':[_0x40be('0x41'),_0x40be('0x94'),'internal'],'required':![]},{'model':db[_0x40be('0x95')],'as':'Tags','attributes':['id',_0x40be('0x41'),_0x40be('0x96')],'where':_0x450172['query'][_0x40be('0x97')]?{'id':_0x450172[_0x40be('0x4e')][_0x40be('0x97')]}:undefined,'required':_0x450172[_0x40be('0x4e')][_0x40be('0x97')]?!![]:![]}];}return db[_0x40be('0x8f')][_0x40be('0x5f')](_0x3a703a);})[_0x40be('0x24')](function(_0x2aade0){_0x2ca4e3['rows']=_0x2aade0;return _0x2ca4e3;});}})[_0x40be('0x24')](respondWithFilteredResult(_0x3af376,_0x3a703a))[_0x40be('0x61')](handleError(_0x3af376,null));};exports[_0x40be('0x98')]=function addApplications(_0xd5af32,_0x11b6db){var _0x55573f=_0xd5af32[_0x40be('0x62')]['id'];var _0x245f38=_0xd5af32[_0x40be('0x67')];var _0x2e2e0f=0xc8;var _0x4f81b0=null;return db[_0x40be('0x99')]['transaction']({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x40be('0x9a')]},function(_0x3e2487){return db[_0x40be('0x5c')]['findOne']({'where':{'id':_0x55573f},'transaction':_0x3e2487})['then'](function(_0x247417){if(_0x247417){return db[_0x40be('0x9b')]['destroy']({'where':{'MailAccountId':_0x55573f},'transaction':_0x3e2487})['then'](function(){var _0x23dea3=_['map'](_0x245f38,function(_0x304b1f){_0x304b1f['MailAccountId']=_0x55573f;return _0x304b1f;});return db[_0x40be('0x9b')][_0x40be('0x9c')](_0x23dea3,{'transaction':_0x3e2487});});}else{_0x2e2e0f=0x194;_0x4f81b0=[];}});})[_0x40be('0x24')](function(){if(_0x2e2e0f!==0x194){return db[_0x40be('0x9b')]['findAndCountAll']({'where':{'MailAccountId':_0x55573f},'order':_0x40be('0x9d')})[_0x40be('0x24')](function(_0x6a65be){_0x4f81b0=_0x6a65be;});}})[_0x40be('0x61')](function(_0x4967d8){_0x2e2e0f=0x1f4;logger[_0x40be('0x2a')](_0x4967d8['stack']);if(_0x4967d8[_0x40be('0x41')]){delete _0x4967d8[_0x40be('0x41')];}_0x4f81b0=_0x4967d8;})[_0x40be('0x9e')](function(){if(_0x4f81b0===null){_0x11b6db[_0x40be('0x2f')](_0x2e2e0f);}else{if(_0x2e2e0f===0x1f4){_0x11b6db[_0x40be('0x30')](_0x2e2e0f)[_0x40be('0x42')](_0x4f81b0);}else{_0x11b6db[_0x40be('0x30')](_0x2e2e0f)['json'](_0x4f81b0);}}});};exports['getApplications']=function(_0x3f3a89,_0x926b8c,_0x456280){var _0xccc81={};var _0x581d4d={};var _0x378c25;var _0x463f68;return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x3f3a89[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x926b8c,null))['then'](function(_0x3ad5ff){if(_0x3ad5ff){_0x378c25=_0x3ad5ff;_0x581d4d[_0x40be('0x4d')]=_['keys'](db['MailApplication'][_0x40be('0x49')]);_0x581d4d['query']=_[_0x40be('0x65')](_0x3f3a89[_0x40be('0x4e')]);_0x581d4d[_0x40be('0x4f')]=_['intersection'](_0x581d4d[_0x40be('0x4d')],_0x581d4d[_0x40be('0x4e')]);_0xccc81['attributes']=_['intersection'](_0x581d4d[_0x40be('0x4d')],qs[_0x40be('0x52')](_0x3f3a89[_0x40be('0x4e')][_0x40be('0x52')]));_0xccc81['attributes']=_0xccc81[_0x40be('0x50')][_0x40be('0x6d')]?_0xccc81['attributes']:_0x581d4d[_0x40be('0x4d')];_0xccc81['order']=qs[_0x40be('0x56')](_0x3f3a89[_0x40be('0x4e')][_0x40be('0x56')]);_0xccc81[_0x40be('0x57')]=qs['filters'](_[_0x40be('0x58')](_0x3f3a89[_0x40be('0x4e')],_0x581d4d[_0x40be('0x4f')]));if(_0x3f3a89[_0x40be('0x4e')][_0x40be('0x59')]){_0xccc81[_0x40be('0x57')]=_['merge'](_0xccc81[_0x40be('0x57')],{'$or':_[_0x40be('0x48')](_0xccc81[_0x40be('0x50')],function(_0x44513d){var _0x3d7e1a={};_0x3d7e1a[_0x44513d]={'$like':'%'+_0x3f3a89[_0x40be('0x4e')][_0x40be('0x59')]+'%'};return _0x3d7e1a;})});}_0xccc81=_[_0x40be('0x5a')]({},_0xccc81,_0x3f3a89[_0x40be('0x5b')]);return _0x378c25[_0x40be('0x9f')](_0xccc81);}})[_0x40be('0x24')](function(_0x369d99){if(_0x369d99){_0x463f68=_0x369d99[_0x40be('0x6d')];if(!_0x3f3a89[_0x40be('0x4e')][_0x40be('0x53')]('nolimit')){_0xccc81[_0x40be('0x33')]=qs[_0x40be('0x33')](_0x3f3a89[_0x40be('0x4e')]['limit']);_0xccc81[_0x40be('0x32')]=qs[_0x40be('0x32')](_0x3f3a89[_0x40be('0x4e')][_0x40be('0x32')]);}return _0x378c25['getApplications'](_0xccc81);}})[_0x40be('0x24')](function(_0x118fe2){if(_0x118fe2){return _0x118fe2?{'count':_0x463f68,'rows':_0x118fe2}:null;}})[_0x40be('0x24')](respondWithResult(_0x926b8c,null))[_0x40be('0x61')](handleError(_0x926b8c,null));};exports[_0x40be('0xa0')]=function(_0x2d7079,_0xdc2483,_0x401332){var _0x24123c={'raw':!![],'where':{}};var _0x5306d3={};var _0x546571={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2d7079[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0xdc2483,null))[_0x40be('0x24')](function(_0x230431){if(_0x230431){_0x5306d3[_0x40be('0x4d')]=_[_0x40be('0x65')](db[_0x40be('0xa1')][_0x40be('0x49')]);_0x5306d3[_0x40be('0x4e')]=_[_0x40be('0x65')](_0x2d7079[_0x40be('0x4e')]);_0x5306d3[_0x40be('0x4f')]=_['intersection'](_0x5306d3['model'],_0x5306d3[_0x40be('0x4e')]);_0x24123c['attributes']=_[_0x40be('0x51')](_0x5306d3[_0x40be('0x4d')],qs['fields'](_0x2d7079[_0x40be('0x4e')]['fields']));_0x24123c[_0x40be('0x50')]=_0x24123c[_0x40be('0x50')]['length']?_0x24123c['attributes']:_0x5306d3['model'];if(!_0x2d7079[_0x40be('0x4e')][_0x40be('0x53')](_0x40be('0x54'))){_0x24123c['limit']=qs[_0x40be('0x33')](_0x2d7079[_0x40be('0x4e')][_0x40be('0x33')]);_0x24123c[_0x40be('0x32')]=qs['offset'](_0x2d7079['query']['offset']);}_0x24123c[_0x40be('0x55')]=qs['sort'](_0x2d7079['query'][_0x40be('0x56')]);_0x24123c[_0x40be('0x57')]=qs[_0x40be('0x4f')](_[_0x40be('0x58')](_0x2d7079[_0x40be('0x4e')],_0x5306d3[_0x40be('0x4f')]));_0x24123c[_0x40be('0x57')][_0x40be('0x6e')]=_0x230431['id'];if(_0x2d7079['query'][_0x40be('0x59')]){_0x24123c[_0x40be('0x57')]=_[_0x40be('0x5a')](_0x24123c[_0x40be('0x57')],{'$or':_['map'](_0x24123c[_0x40be('0x50')],function(_0x9d78e0){var _0xcf9baf={};_0xcf9baf[_0x9d78e0]={'$like':'%'+_0x2d7079[_0x40be('0x4e')]['filter']+'%'};return _0xcf9baf;})});}if(_0x2d7079['query']['$gte']){var _0x393d78=_0x2d7079[_0x40be('0x4e')][_0x40be('0xa2')]['split'](',');var _0x343b05={};_0x343b05[_0x393d78[0x0]]={'$gte':moment(_0x393d78[0x1])['format'](_0x40be('0xa3'))};_0x24123c[_0x40be('0x57')]=_['merge'](_0x24123c[_0x40be('0x57')],_0x343b05);}_0x24123c=_['merge']({},_0x24123c,_0x2d7079['options']);return db['MailMessage'][_0x40be('0x35')]({'where':_0x24123c[_0x40be('0x57')]})[_0x40be('0x24')](function(_0xd3618a){_0x546571['count']=_0xd3618a;if(_0x2d7079[_0x40be('0x4e')]['includeAll']){_0x24123c[_0x40be('0x5e')]=[{'all':!![]}];}return db[_0x40be('0xa1')][_0x40be('0x5f')](_0x24123c);})[_0x40be('0x24')](function(_0x5d5e4f){if(_0x2d7079['query'][_0x40be('0xa4')]===_0x40be('0xa5')){for(var _0x3496cc=0x0;_0x3496cc<_0x5d5e4f[_0x40be('0x6d')];_0x3496cc++){_0x5d5e4f[_0x3496cc]['body']=juice(_0x5d5e4f[_0x3496cc][_0x40be('0x67')]);}}_0x546571[_0x40be('0x60')]=_0x5d5e4f;return _0x546571;});}})['then'](respondWithFilteredResult(_0xdc2483,_0x24123c))[_0x40be('0x61')](handleError(_0xdc2483,null));};exports[_0x40be('0x42')]=function(_0x264f12,_0x4b0901,_0x25601a){var _0x59f868,_0x172f80={},_0x684a96;if(_0x264f12[_0x40be('0x67')]['to']){_0x684a96=_0x264f12[_0x40be('0x67')]['to'][_0x40be('0xa6')](',')[0x0];}return db[_0x40be('0x5c')][_0x40be('0x66')]({'where':{'id':_0x264f12[_0x40be('0x62')]['id']},'include':[{'model':db[_0x40be('0xa7')],'as':'List','include':[{'model':db[_0x40be('0x91')],'as':_0x40be('0xa8'),'where':{'email':_0x684a96},'limit':0x1,'order':[['updatedAt',_0x40be('0xa9')]]}]},{'model':db[_0x40be('0x64')],'as':_0x40be('0x45'),'raw':!![]}]})[_0x40be('0x24')](handleEntityNotFound(_0x4b0901,null))[_0x40be('0x24')](function(_0x41e51b){if(_0x41e51b){_0x59f868=_0x41e51b;if(_0x41e51b[_0x40be('0x45')]){if(_[_0x40be('0x77')](_0x264f12[_0x40be('0x67')]['from'])){_0x264f12['body'][_0x40be('0xaa')]=util[_0x40be('0xab')](_0x40be('0xac'),_0x41e51b[_0x40be('0x41')],_0x41e51b[_0x40be('0x75')]||_0x41e51b['Smtp'][_0x40be('0x7b')]);}if(_0x264f12[_0x40be('0x67')][_0x40be('0xad')]&&_0x264f12[_0x40be('0x67')][_0x40be('0xad')]['length']){for(var _0x1f869a=0x0;_0x1f869a<_0x264f12[_0x40be('0x67')][_0x40be('0xad')][_0x40be('0x6d')];_0x1f869a+=0x1){_0x264f12[_0x40be('0x67')][_0x40be('0xad')][_0x1f869a]={'filename':_0x264f12[_0x40be('0x67')][_0x40be('0xad')][_0x1f869a]['name'],'path':path[_0x40be('0xae')](config[_0x40be('0xaf')],_0x40be('0xb0'),_0x264f12[_0x40be('0x67')][_0x40be('0xad')][_0x1f869a][_0x40be('0xb1')])};}}var _0x33964a={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x41e51b[_0x40be('0x45')][_0x40be('0x83')])){if(_0x41e51b[_0x40be('0x45')]['authentication']){_0x33964a[_0x40be('0xb2')]={'user':_0x41e51b['Smtp']['user'],'pass':_0x41e51b['Smtp'][_0x40be('0x7e')]};}_0x33964a[_0x40be('0x81')]=_0x41e51b[_0x40be('0x45')]['host'];_0x33964a['port']=_0x41e51b[_0x40be('0x45')][_0x40be('0x82')];_0x33964a['secure']=_0x41e51b[_0x40be('0x45')][_0x40be('0xb3')];}else{_0x33964a[_0x40be('0x83')]=_0x41e51b['Smtp']['service'];_0x33964a['auth']={'user':_0x41e51b[_0x40be('0x45')]['user'],'pass':_0x41e51b[_0x40be('0x45')][_0x40be('0x7e')]};}return respondWithRpcPromise(_0x40be('0xb4'),_0x40be('0xb5'),{'account':_0x33964a,'message':_0x264f12[_0x40be('0x67')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x4f7a80){if(_0x4f7a80){_0x172f80=_0x4f7a80;if(_0x59f868[_0x40be('0xb6')]){if(_0x59f868[_0x40be('0xb6')][_0x40be('0xa8')]['length']){return _0x59f868[_0x40be('0xb6')][_0x40be('0xa8')][0x0];}else{return db[_0x40be('0x91')][_0x40be('0x6b')](_[_0x40be('0x1d')](_0x264f12[_0x40be('0x67')],{'firstName':_0x264f12['body']['to'],'email':_0x264f12[_0x40be('0x67')]['to'],'phone':_0x264f12['body']['to'],'ListId':_0x59f868[_0x40be('0x76')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x40be('0x24')](function(_0x386d09){if(_0x386d09){var _0x18e458={'UserId':_0x264f12[_0x40be('0x7b')]['id'],'ContactId':_0x386d09['id'],'MailAccountId':_0x59f868['id'],'inReplyTo':_0x172f80[_0x40be('0xb7')],'to':_0x264f12[_0x40be('0x67')][_0x40be('0xaa')],'cc':_0x264f12[_0x40be('0x67')]['cc'],'subject':_0x264f12['body'][_0x40be('0xb8')],'attach':_0x264f12[_0x40be('0x67')]['attach'],'firstMsgDirection':_0x40be('0xb9'),'lastMsgAt':moment()['format'](_0x40be('0xa3')),'lastMsgDirection':_0x40be('0xb9'),'Messages':[_[_0x40be('0x5a')](_0x264f12[_0x40be('0x67')],{'messageId':_0x172f80[_0x40be('0xb7')],'sentAt':moment()[_0x40be('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x59f868['id'],'UserId':_0x264f12[_0x40be('0x7b')]['id'],'ContactId':_0x386d09['id']})]};if(_0x264f12['body'][_0x40be('0xba')]){_0x18e458=_[_0x40be('0x5a')](_0x18e458,_0x264f12[_0x40be('0x67')][_0x40be('0xba')]);}return db['MailInteraction']['create'](_0x18e458,{'include':[{'model':db['MailMessage'],'as':_0x40be('0xbb')}]});}})[_0x40be('0x24')](respondWithResult(_0x4b0901,null))[_0x40be('0x61')](handleError(_0x4b0901,null));};exports[_0x40be('0xbc')]=function(_0x85edb5,_0x23f61e,_0x584c5f){return db[_0x40be('0x5c')][_0x40be('0x66')]({'where':{'id':_0x85edb5[_0x40be('0x62')]['id']},'include':[{'model':db[_0x40be('0x64')],'as':_0x40be('0x45'),'raw':!![]}]})[_0x40be('0x24')](handleEntityNotFound(_0x23f61e,null))[_0x40be('0x24')](function(_0x5b6c21){if(_0x5b6c21&&_0x5b6c21[_0x40be('0x45')]){var _0x1b1e97={'id':_0x5b6c21['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5b6c21[_0x40be('0x45')][_0x40be('0x83')]){_0x1b1e97['service']=_0x5b6c21[_0x40be('0x45')][_0x40be('0x83')];}else{_0x1b1e97['host']=_0x5b6c21[_0x40be('0x45')]['host'];_0x1b1e97[_0x40be('0x82')]=_0x5b6c21[_0x40be('0x45')][_0x40be('0x82')];_0x1b1e97[_0x40be('0xb3')]=_0x5b6c21[_0x40be('0x45')][_0x40be('0xb3')];}if(_0x5b6c21['Smtp'][_0x40be('0x80')]){_0x1b1e97[_0x40be('0xb2')]={'user':_0x5b6c21[_0x40be('0x45')][_0x40be('0x7b')],'pass':_0x5b6c21[_0x40be('0x45')][_0x40be('0x7e')]};}return respondWithRpcPromise('VerifySmtp',_0x40be('0xbc'),{'account':_0x1b1e97});}})['then'](respondWithResult(_0x23f61e,null))[_0x40be('0x61')](handleError(_0x23f61e,null));};exports[_0x40be('0x3b')]=function(_0x5b3a20,_0x554333){return db['MailAccount'][_0x40be('0x66')]({'where':{'id':_0x5b3a20[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x554333,null))[_0x40be('0x24')](function(_0x4960eb){if(_0x4960eb&&_0x4960eb[_0x40be('0x83')]){throw new db[(_0x40be('0xbd'))][(_0x40be('0xbe'))](_0x40be('0xbf'));}return _0x4960eb;})[_0x40be('0x24')](removeEntity(_0x554333,null))[_0x40be('0x61')](handleError(_0x554333,null));};exports[_0x40be('0xc0')]=function(_0x488164,_0x4a080f,_0x2df135){return db['MailAccount']['find']({'where':{'id':_0x488164[_0x40be('0x62')]['id']}})[_0x40be('0x24')](handleEntityNotFound(_0x4a080f,null))[_0x40be('0x24')](function(_0x352026){if(_0x352026){return _0x352026[_0x40be('0xc0')](_0x488164[_0x40be('0x67')]['ids'],_[_0x40be('0x90')](_0x488164[_0x40be('0x67')],[_0x40be('0x70'),'id'])||{})[_0x40be('0xc1')](function(_0x7f8fdb){for(var _0x3d0748=0x0;_0x3d0748<_0x488164[_0x40be('0x67')][_0x40be('0x70')][_0x40be('0x6d')];_0x3d0748+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x488164[_0x40be('0x67')]['ids'][_0x3d0748]),'MailAccountId':Number(_0x488164[_0x40be('0x62')]['id'])});}return _0x7f8fdb;});}})[_0x40be('0x24')](respondWithResult(_0x4a080f,null))[_0x40be('0x61')](handleError(_0x4a080f,null));};exports[_0x40be('0xc2')]=function(_0x10709c,_0xc35d60,_0x2401aa){return db[_0x40be('0x5c')][_0x40be('0x66')]({'where':{'id':_0x10709c['params']['id']}})[_0x40be('0x24')](handleEntityNotFound(_0xc35d60,null))[_0x40be('0x24')](function(_0x3bd116){if(_0x3bd116){return _0x3bd116[_0x40be('0xc2')](_0x10709c[_0x40be('0x4e')][_0x40be('0x70')])['then'](function(){if(_['isArray'](_0x10709c[_0x40be('0x4e')][_0x40be('0x70')])){for(var _0x4cfac8=0x0;_0x4cfac8<_0x10709c[_0x40be('0x4e')][_0x40be('0x70')][_0x40be('0x6d')];_0x4cfac8+=0x1){socket[_0x40be('0xc3')](_0x40be('0xc4'),{'UserId':Number(_0x10709c[_0x40be('0x4e')][_0x40be('0x70')][_0x4cfac8]),'MailAccountId':Number(_0x10709c[_0x40be('0x62')]['id'])});}}else{socket[_0x40be('0xc3')](_0x40be('0xc4'),{'UserId':Number(_0x10709c[_0x40be('0x4e')][_0x40be('0x70')]),'MailAccountId':Number(_0x10709c[_0x40be('0x62')]['id'])});}});}})[_0x40be('0x24')](respondWithStatusCode(_0xc35d60,null))[_0x40be('0x61')](handleError(_0xc35d60,null));};exports[_0x40be('0xc5')]=function(_0x1df2d9,_0x5577f6,_0x1c2dcd){var _0x402a0c={};var _0x21fad2={};var _0x54bed0;var _0x47ba2b;return db[_0x40be('0x5c')][_0x40be('0x6c')]({'where':{'id':_0x1df2d9['params']['id']}})['then'](handleEntityNotFound(_0x5577f6,null))[_0x40be('0x24')](function(_0x34de4d){if(_0x34de4d){_0x54bed0=_0x34de4d;_0x21fad2[_0x40be('0x4d')]=_[_0x40be('0x65')](db[_0x40be('0x92')][_0x40be('0x49')]);_0x21fad2[_0x40be('0x4e')]=_[_0x40be('0x65')](_0x1df2d9[_0x40be('0x4e')]);_0x21fad2[_0x40be('0x4f')]=_[_0x40be('0x51')](_0x21fad2[_0x40be('0x4d')],_0x21fad2[_0x40be('0x4e')]);_0x402a0c[_0x40be('0x50')]=_[_0x40be('0x51')](_0x21fad2[_0x40be('0x4d')],qs[_0x40be('0x52')](_0x1df2d9[_0x40be('0x4e')]['fields']));_0x402a0c[_0x40be('0x50')]=_0x402a0c[_0x40be('0x50')]['length']?_0x402a0c[_0x40be('0x50')]:_0x21fad2[_0x40be('0x4d')];_0x402a0c[_0x40be('0x55')]=qs[_0x40be('0x56')](_0x1df2d9[_0x40be('0x4e')][_0x40be('0x56')]);_0x402a0c[_0x40be('0x57')]=qs['filters'](_[_0x40be('0x58')](_0x1df2d9[_0x40be('0x4e')],_0x21fad2['filters']));if(_0x1df2d9['query'][_0x40be('0x59')]){_0x402a0c['where']=_[_0x40be('0x5a')](_0x402a0c[_0x40be('0x57')],{'$or':_['map'](_0x402a0c['attributes'],function(_0x1619ee){var _0x379abd={};_0x379abd[_0x1619ee]={'$like':'%'+_0x1df2d9[_0x40be('0x4e')][_0x40be('0x59')]+'%'};return _0x379abd;})});}_0x402a0c=_[_0x40be('0x5a')]({},_0x402a0c,_0x1df2d9[_0x40be('0x5b')]);return _0x54bed0[_0x40be('0xc5')](_0x402a0c);}})[_0x40be('0x24')](function(_0x4442e5){if(_0x4442e5){_0x47ba2b=_0x4442e5[_0x40be('0x6d')];if(!_0x1df2d9[_0x40be('0x4e')][_0x40be('0x53')](_0x40be('0x54'))){_0x402a0c['limit']=qs['limit'](_0x1df2d9[_0x40be('0x4e')]['limit']);_0x402a0c[_0x40be('0x32')]=qs[_0x40be('0x32')](_0x1df2d9['query'][_0x40be('0x32')]);}return _0x54bed0[_0x40be('0xc5')](_0x402a0c);}})[_0x40be('0x24')](function(_0x679746){if(_0x679746){return _0x679746?{'count':_0x47ba2b,'rows':_0x679746}:null;}})['then'](respondWithResult(_0x5577f6,null))[_0x40be('0x61')](handleError(_0x5577f6,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c1df4f7..b8848ac 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 _0xc401=['save','update','remove','emit','exports','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x5936af,_0x5afd9c){var _0x26579c=function(_0x57641c){while(--_0x57641c){_0x5936af['push'](_0x5936af['shift']());}};_0x26579c(++_0x5afd9c);}(_0xc401,0x15d));var _0x1c40=function(_0x3d5966,_0x531b26){_0x3d5966=_0x3d5966-0x0;var _0x8a9ab2=_0xc401[_0x3d5966];return _0x8a9ab2;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x1c40('0x0'))['db'][_0x1c40('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1c40('0x2')](0x0);var events={'afterCreate':_0x1c40('0x3'),'afterUpdate':_0x1c40('0x4'),'afterDestroy':_0x1c40('0x5')};function emitEvent(_0x3099da){return function(_0x34853a,_0x12f6f4,_0x4bf15e){MailAccountEvents[_0x1c40('0x6')](_0x3099da+':'+_0x34853a['id'],_0x34853a);MailAccountEvents[_0x1c40('0x6')](_0x3099da,_0x34853a);_0x4bf15e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x1c40('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xd906=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','MailAccount'];(function(_0x2ffbaf,_0x45e3e7){var _0x4f0c1d=function(_0x53281a){while(--_0x53281a){_0x2ffbaf['push'](_0x2ffbaf['shift']());}};_0x4f0c1d(++_0x45e3e7);}(_0xd906,0x6b));var _0x6d90=function(_0x4e4f67,_0x57dc0b){_0x4e4f67=_0x4e4f67-0x0;var _0x193c53=_0xd906[_0x4e4f67];return _0x193c53;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x6d90('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6d90('0x1')](0x0);var events={'afterCreate':_0x6d90('0x2'),'afterUpdate':_0x6d90('0x3'),'afterDestroy':_0x6d90('0x4')};function emitEvent(_0x4d5bbd){return function(_0x2ae140,_0x431c1e,_0x132c67){MailAccountEvents[_0x6d90('0x5')](_0x4d5bbd+':'+_0x2ae140['id'],_0x2ae140);MailAccountEvents['emit'](_0x4d5bbd,_0x2ae140);_0x132c67(null);};}for(var e in events){if(events[_0x6d90('0x6')](e)){var event=events[e];MailAccount[_0x6d90('0x7')](e,emitEvent(event));}}module[_0x6d90('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 1f8f670..4f33b8b 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 _0xc37a=['mail_accounts','lodash','util','api','moment','bluebird','path','../../config/environment','./mailAccount.attributes','exports','define','MailAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc37a,0xfd));var _0xac37=function(_0x2535d2,_0x4caa85){_0x2535d2=_0x2535d2-0x0;var _0x55a9e5=_0xc37a[_0x2535d2];return _0x55a9e5;};'use strict';var _=require(_0xac37('0x0'));var util=require(_0xac37('0x1'));var logger=require('../../config/logger')(_0xac37('0x2'));var moment=require(_0xac37('0x3'));var BPromise=require(_0xac37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac37('0x5'));var rimraf=require('rimraf');var config=require(_0xac37('0x6'));var attributes=require(_0xac37('0x7'));module[_0xac37('0x8')]=function(_0x503bf1,_0x3f4200){return _0x503bf1[_0xac37('0x9')](_0xac37('0xa'),attributes,{'tableName':_0xac37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdab9=['define','MailAccount','mail_accounts','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xdab9,0x1e7));var _0x9dab=function(_0x212563,_0x409a62){_0x212563=_0x212563-0x0;var _0x417f2f=_0xdab9[_0x212563];return _0x417f2f;};'use strict';var _=require(_0x9dab('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9dab('0x1'));var BPromise=require(_0x9dab('0x2'));var rp=require(_0x9dab('0x3'));var fs=require('fs');var path=require(_0x9dab('0x4'));var rimraf=require(_0x9dab('0x5'));var config=require(_0x9dab('0x6'));var attributes=require(_0x9dab('0x7'));module['exports']=function(_0x20a6b2,_0x3e3ac9){return _0x20a6b2[_0x9dab('0x8')](_0x9dab('0x9'),attributes,{'tableName':_0x9dab('0xa'),'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 d26670f..2905632 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 _0x862d=['redis','defaults','socket.io-emitter','./mailAccount.socket','register','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','map','include','model','attributes','find','ShowMailAccount','NotifyMailAccount','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','Applications','MailServerOut','Smtp','get','omit','applications','list','priority','autoclose','push','length','close','*,*,*,*','Contacts','CmContact','create','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','User','name','UserId','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x1ede3e,_0x441c15){var _0x311f28=function(_0x443e85){while(--_0x443e85){_0x1ede3e['push'](_0x1ede3e['shift']());}};_0x311f28(++_0x441c15);}(_0x862d,0xc5));var _0xd862=function(_0x45d9f1,_0x282339){_0x45d9f1=_0x45d9f1-0x0;var _0x421048=_0x862d[_0x45d9f1];return _0x421048;};'use strict';var _=require(_0xd862('0x0'));var util=require(_0xd862('0x1'));var moment=require('moment');var BPromise=require(_0xd862('0x2'));var rs=require(_0xd862('0x3'));var fs=require('fs');var Redis=require(_0xd862('0x4'));var db=require(_0xd862('0x5'))['db'];var utils=require(_0xd862('0x6'));var logger=require(_0xd862('0x7'))('rpc');var config=require(_0xd862('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd862('0x9')][_0xd862('0xa')]({'port':0x232c});config[_0xd862('0xb')]=_[_0xd862('0xc')](config[_0xd862('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd862('0xd'))(new Redis(config[_0xd862('0xb')]));require(_0xd862('0xe'))[_0xd862('0xf')](socket);function respondWithRpcPromise(_0x496dc7,_0x133467,_0x70eb14){return new BPromise(function(_0x3fff98,_0x2f8aca){return client['request'](_0x496dc7,_0x70eb14)[_0xd862('0x10')](function(_0x48172e){logger[_0xd862('0x11')]('MailAccount,\x20%s,\x20%s',_0x133467,_0xd862('0x12'));logger[_0xd862('0x13')](_0xd862('0x14'),_0x133467,_0xd862('0x12'),JSON[_0xd862('0x15')](_0x48172e));if(_0x48172e[_0xd862('0x16')]){if(_0x48172e['error'][_0xd862('0x17')]===0x1f4){logger['error'](_0xd862('0x18'),_0x133467,_0x48172e[_0xd862('0x16')][_0xd862('0x19')]);return _0x2f8aca(_0x48172e['error'][_0xd862('0x19')]);}logger[_0xd862('0x16')]('MailAccount,\x20%s,\x20%s',_0x133467,_0x48172e[_0xd862('0x16')][_0xd862('0x19')]);return _0x3fff98(_0x48172e[_0xd862('0x16')][_0xd862('0x19')]);}else{logger[_0xd862('0x11')](_0xd862('0x18'),_0x133467,'request\x20sent');_0x3fff98(_0x48172e[_0xd862('0x1a')][_0xd862('0x19')]);}})[_0xd862('0x1b')](function(_0x52e581){logger[_0xd862('0x16')]('MailAccount,\x20%s,\x20%s',_0x133467,_0x52e581);_0x2f8aca(_0x52e581);});});}exports[_0xd862('0x1c')]=function(_0x4ae964){var _0x145049=this;return new Promise(function(_0x466ae9,_0x7c1e5c){return db[_0xd862('0x1d')][_0xd862('0x1e')]({'raw':_0x4ae964[_0xd862('0x1f')]?_0x4ae964[_0xd862('0x1f')][_0xd862('0x20')]===undefined?!![]:![]:!![],'where':_0x4ae964[_0xd862('0x1f')]?_0x4ae964[_0xd862('0x1f')][_0xd862('0x21')]||null:null,'attributes':_0x4ae964[_0xd862('0x1f')]?_0x4ae964[_0xd862('0x1f')]['attributes']||null:null,'limit':_0x4ae964[_0xd862('0x1f')]?_0x4ae964[_0xd862('0x1f')]['limit']||null:null,'include':_0x4ae964[_0xd862('0x1f')]?_0x4ae964[_0xd862('0x1f')]['include']?_[_0xd862('0x22')](_0x4ae964[_0xd862('0x1f')][_0xd862('0x23')],function(_0x2c1444){return{'model':db[_0x2c1444[_0xd862('0x24')]],'as':_0x2c1444['as'],'attributes':_0x2c1444[_0xd862('0x25')],'include':_0x2c1444[_0xd862('0x23')]?_['map'](_0x2c1444[_0xd862('0x23')],function(_0x366b0a){return{'model':db[_0x366b0a[_0xd862('0x24')]],'as':_0x366b0a['as'],'attributes':_0x366b0a[_0xd862('0x25')],'include':_0x366b0a[_0xd862('0x23')]?_['map'](_0x366b0a[_0xd862('0x23')],function(_0x234dbb){return{'model':db[_0x234dbb[_0xd862('0x24')]],'as':_0x234dbb['as'],'attributes':_0x234dbb[_0xd862('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x402b5c){logger['info'](_0xd862('0x1c'),_0x4ae964);logger[_0xd862('0x13')]('GetMailAccount',_0x4ae964,JSON['stringify'](_0x402b5c));_0x466ae9(_0x402b5c);})[_0xd862('0x1b')](function(_0x530293){logger[_0xd862('0x16')]('GetMailAccount',_0x530293[_0xd862('0x19')],_0x4ae964);_0x7c1e5c(_0x145049[_0xd862('0x16')](0x1f4,_0x530293[_0xd862('0x19')]));});});};exports['ShowMailAccount']=function(_0x40fb7e){var _0x2013d0=this;return new Promise(function(_0x5aa303,_0x39bb06){return db[_0xd862('0x1d')][_0xd862('0x26')]({'raw':_0x40fb7e[_0xd862('0x1f')]?_0x40fb7e[_0xd862('0x1f')][_0xd862('0x20')]===undefined?!![]:![]:!![],'where':_0x40fb7e[_0xd862('0x1f')]?_0x40fb7e['options'][_0xd862('0x21')]||null:null,'attributes':_0x40fb7e[_0xd862('0x1f')]?_0x40fb7e[_0xd862('0x1f')][_0xd862('0x25')]||null:null,'include':_0x40fb7e[_0xd862('0x1f')]?_0x40fb7e[_0xd862('0x1f')][_0xd862('0x23')]?_[_0xd862('0x22')](_0x40fb7e[_0xd862('0x1f')][_0xd862('0x23')],function(_0x8bd993){return{'model':db[_0x8bd993[_0xd862('0x24')]],'as':_0x8bd993['as'],'attributes':_0x8bd993['attributes'],'include':_0x8bd993[_0xd862('0x23')]?_[_0xd862('0x22')](_0x8bd993['include'],function(_0x4e85cc){return{'model':db[_0x4e85cc[_0xd862('0x24')]],'as':_0x4e85cc['as'],'attributes':_0x4e85cc[_0xd862('0x25')],'include':_0x4e85cc[_0xd862('0x23')]?_[_0xd862('0x22')](_0x4e85cc[_0xd862('0x23')],function(_0x57a557){return{'model':db[_0x57a557[_0xd862('0x24')]],'as':_0x57a557['as'],'attributes':_0x57a557[_0xd862('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd862('0x10')](function(_0x2782c6){logger[_0xd862('0x11')](_0xd862('0x27'),_0x40fb7e);logger['debug'](_0xd862('0x27'),_0x40fb7e,JSON['stringify'](_0x2782c6));_0x5aa303(_0x2782c6);})[_0xd862('0x1b')](function(_0x18c3ad){logger[_0xd862('0x16')](_0xd862('0x27'),_0x18c3ad[_0xd862('0x19')],_0x40fb7e);_0x39bb06(_0x2013d0[_0xd862('0x16')](0x1f4,_0x18c3ad[_0xd862('0x19')]));});});};exports[_0xd862('0x28')]=function(_0x30cdd0){var _0x2fe08c=this;return new Promise(function(_0x87dc8d,_0x33f0b3){var _0x39b9d4={'body':_0x30cdd0['body'],'channel':'mail'};var _0x25ca23=_[_0xd862('0x29')](_[_0xd862('0x2a')](db['CmContact']['rawAttributes']),[_0xd862('0x2b'),_0xd862('0x2c'),_0xd862('0x2d'),_0xd862('0x2e')]);var _0x51af04=![];if(_0x30cdd0['body']['id']){delete _0x30cdd0[_0xd862('0x2f')]['id'];}if(_[_0xd862('0x30')](_0x30cdd0[_0xd862('0x2f')][_0xd862('0x31')])){return _0x33f0b3(_0x2fe08c['error'](0x1f4,_0xd862('0x32')));}if(_['isNil'](_0x30cdd0['body'][_0xd862('0x2f')])||_0x30cdd0['body'][_0xd862('0x2f')]===''){return _0x33f0b3(_0x2fe08c[_0xd862('0x16')](0x1f4,_0xd862('0x33')));}if(_[_0xd862('0x30')](_0x30cdd0['body'][_0xd862('0x34')])){return _0x33f0b3(_0x2fe08c['error'](0x1f4,_0xd862('0x35')+_0x25ca23));}if(!_['includes'](_0x25ca23,_0x30cdd0[_0xd862('0x2f')][_0xd862('0x34')])){return _0x33f0b3(_0x2fe08c['error'](0x1f4,_0xd862('0x36')+_0x25ca23));}var _0x42c095={};_0x42c095[_0x30cdd0[_0xd862('0x2f')][_0xd862('0x34')]]=_0x30cdd0['body']['from'];return db[_0xd862('0x1d')][_0xd862('0x26')]({'where':{'id':_0x30cdd0[_0xd862('0x37')]['id']},'include':[{'model':db[_0xd862('0x38')],'as':_0xd862('0x39'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x42c095,'limit':0x1,'order':[[_0xd862('0x2c'),_0xd862('0x3a')]]}]},{'model':db['MailApplication'],'as':_0xd862('0x3b')},{'model':db[_0xd862('0x3c')],'as':_0xd862('0x3d')}]})[_0xd862('0x10')](function(_0x2c4517){if(_0x2c4517&&_0x2c4517['List']){var _0x582029=_0x2c4517[_0xd862('0x3e')]({'plain':!![]});_0x39b9d4['account']=_[_0xd862('0x3f')](_0x582029,[_0xd862('0x3b'),'List']);_0x39b9d4[_0xd862('0x40')]=_0x582029[_0xd862('0x3b')];_0x39b9d4[_0xd862('0x41')]=_0x582029['List'];_0x39b9d4[_0xd862('0x40')]=_['orderBy'](_0x39b9d4['applications'],[_0xd862('0x42')],['asc']);if(_0x39b9d4[_0xd862('0x37')]&&_0x39b9d4[_0xd862('0x37')][_0xd862('0x43')]){_0x39b9d4[_0xd862('0x40')][_0xd862('0x44')]({'id':0x0,'priority':_0x39b9d4['applications'][_0xd862('0x45')]+0x1,'app':_0xd862('0x46'),'appdata':_0xd862('0x43'),'interval':_0xd862('0x47')});}if(_0x39b9d4[_0xd862('0x37')][_0xd862('0x3b')]){delete _0x39b9d4['account']['Applications'];}if(_0x39b9d4[_0xd862('0x37')][_0xd862('0x39')]){delete _0x39b9d4[_0xd862('0x37')][_0xd862('0x39')];}if(_0x582029[_0xd862('0x39')]['Contacts'][_0xd862('0x45')]){return _0x582029[_0xd862('0x39')][_0xd862('0x48')][0x0];}var _0x3c67d3=_['defaults'](_0x30cdd0[_0xd862('0x2f')],{'firstName':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x31')],'ListId':_0x582029[_0xd862('0x2e')]});_0x3c67d3[_0x30cdd0[_0xd862('0x2f')][_0xd862('0x34')]]=_0x30cdd0[_0xd862('0x2f')][_0xd862('0x31')];return db[_0xd862('0x49')][_0xd862('0x4a')](_0x3c67d3);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x5bbfd6){_0x39b9d4[_0xd862('0x4b')]=_0x5bbfd6;if(_0x5bbfd6){if(!_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x4c')]){_0x30cdd0[_0xd862('0x2f')]['message'][_0xd862('0x4c')]=rs[_0xd862('0x4d')]()+'\x20'+_0x30cdd0['body']['message']['from'];}var _0x1fda6f={'ContactId':_0x5bbfd6['id'],'MailAccountId':_0x30cdd0[_0xd862('0x37')]['id'],'inReplyTo':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x4c')],'to':_0x30cdd0['body'][_0xd862('0x19')]['from'],'cc':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')]['cc'],'subject':_0x30cdd0['body'][_0xd862('0x19')][_0xd862('0x4e')],'attach':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x4f')],'lastMsgAt':moment()[_0xd862('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xd862('0x51')][_0xd862('0x26')]({'where':{'closed':![],'MailAccountId':_0x30cdd0['account']['id']},'include':[{'model':db[_0xd862('0x52')],'as':_0xd862('0x53'),'attributes':['messageId'],'where':{'messageId':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x54')]}}]})['then'](function(_0x82f312){if(_0x82f312){return[_0x82f312,![]];}return db['MailInteraction'][_0xd862('0x4a')](_0x1fda6f)['then'](function(_0x38526e){return[_0x38526e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x459297,_0x2bfeb8){if(_0x459297){_0x51af04=_0x2bfeb8;if(!_0x2bfeb8){return _0x459297[_0xd862('0x55')]({'inReplyTo':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')]['messageId'],'to':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x31')],'cc':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')]['cc'],'subject':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x4e')],'attach':_0x459297[_0xd862('0x4f')]?_0x459297[_0xd862('0x4f')]:_0x30cdd0['body'][_0xd862('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0xd862('0x50')](_0xd862('0x56')),'lastMsgAt':moment()[_0xd862('0x50')](_0xd862('0x56')),'lastMsgDirection':'in'});}else{return _0x459297;}}})[_0xd862('0x10')](function(_0x3e0108){_0x39b9d4[_0xd862('0x57')]=_0x3e0108['get']({'plain':!![]});_0x39b9d4[_0xd862('0x57')][_0xd862('0x58')]=_0x51af04;return db['MailMessage'][_0xd862('0x4a')]({'body':_0x30cdd0['body'][_0xd862('0x2f')],'MailAccountId':_0x30cdd0[_0xd862('0x37')]['id'],'MailInteractionId':_0x3e0108['id'],'direction':'in','ContactId':_0x39b9d4[_0xd862('0x4b')]['id'],'messageId':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')]['messageId'],'from':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')]['from'],'to':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')]['to'],'cc':_0x30cdd0[_0xd862('0x2f')]['message']['cc'],'subject':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')]['subject'],'attach':_0x30cdd0[_0xd862('0x2f')]['message'][_0xd862('0x4f')],'Attachments':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x59')],'originTo':_0x30cdd0[_0xd862('0x2f')]['message']['originTo'],'originCc':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x5a')],'bcc':_0x30cdd0[_0xd862('0x2f')][_0xd862('0x19')][_0xd862('0x5b')],'ChatWebsiteId':_0x30cdd0['body'][_0xd862('0x19')][_0xd862('0x5c')]||null,'originChannel':_0x30cdd0['body']['message'][_0xd862('0x5d')]||_0xd862('0x5e'),'ChatOfflineMessageId':_0x30cdd0[_0xd862('0x2f')]['message'][_0xd862('0x5f')]||null},{'include':[{'model':db[_0xd862('0x60')],'as':'Attachments'}]});})[_0xd862('0x10')](function(_0x5244a9){_0x39b9d4[_0xd862('0x19')]=_0x5244a9;if(_0x39b9d4[_0xd862('0x57')]['UserId']){return db[_0xd862('0x61')]['find']({'attributes':['id',_0xd862('0x62')],'where':{'id':_0x39b9d4[_0xd862('0x57')][_0xd862('0x63')]}})['then'](function(_0x239527){if(_0x239527){_0x39b9d4[_0xd862('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd862('0x64'),'appdata':_0x239527['name']+','+(_0x39b9d4[_0xd862('0x37')][_0xd862('0x65')]||0xa),'interval':_0xd862('0x47')});}return respondWithRpcPromise('Start','startRouting',_0x39b9d4);});}return respondWithRpcPromise(_0xd862('0x66'),_0xd862('0x67'),_0x39b9d4);})[_0xd862('0x10')](function(_0x1402f4){_0x87dc8d(_0x1402f4);})['catch'](function(_0x336426){_0x33f0b3(_0x2fe08c[_0xd862('0x16')](0x1f4,_0x336426['message']));});});}; \ No newline at end of file +var _0x5895=['close','*,*,*,*','length','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','update','format','interaction','get','attachments','originTo','originCc','originChannel','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailAccount,\x20%s,\x20%s','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowMailAccount','find','NotifyMailAccount','body','CmContact','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','List','account','omit','list','applications','orderBy','priority','asc','autoclose'];(function(_0x369507,_0x2c71ff){var _0x2a0eff=function(_0x5155c9){while(--_0x5155c9){_0x369507['push'](_0x369507['shift']());}};_0x2a0eff(++_0x2c71ff);}(_0x5895,0x156));var _0x5589=function(_0x178170,_0x1b67b0){_0x178170=_0x178170-0x0;var _0x1ded75=_0x5895[_0x178170];return _0x1ded75;};'use strict';var _=require(_0x5589('0x0'));var util=require(_0x5589('0x1'));var moment=require(_0x5589('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5589('0x3'));var db=require(_0x5589('0x4'))['db'];var utils=require(_0x5589('0x5'));var logger=require(_0x5589('0x6'))(_0x5589('0x7'));var config=require(_0x5589('0x8'));var jayson=require(_0x5589('0x9'));var client=jayson[_0x5589('0xa')]['http']({'port':0x232c});config['redis']=_[_0x5589('0xb')](config['redis'],{'host':_0x5589('0xc'),'port':0x18eb});var socket=require(_0x5589('0xd'))(new Redis(config['redis']));require(_0x5589('0xe'))[_0x5589('0xf')](socket);function respondWithRpcPromise(_0x10f0e7,_0x3d1283,_0x3a1cb5){return new BPromise(function(_0xc54186,_0x30ed45){return client[_0x5589('0x10')](_0x10f0e7,_0x3a1cb5)[_0x5589('0x11')](function(_0x4ceb3d){logger[_0x5589('0x12')]('MailAccount,\x20%s,\x20%s',_0x3d1283,_0x5589('0x13'));logger[_0x5589('0x14')](_0x5589('0x15'),_0x3d1283,_0x5589('0x13'),JSON[_0x5589('0x16')](_0x4ceb3d));if(_0x4ceb3d['error']){if(_0x4ceb3d['error']['code']===0x1f4){logger[_0x5589('0x17')]('MailAccount,\x20%s,\x20%s',_0x3d1283,_0x4ceb3d[_0x5589('0x17')]['message']);return _0x30ed45(_0x4ceb3d['error'][_0x5589('0x18')]);}logger[_0x5589('0x17')]('MailAccount,\x20%s,\x20%s',_0x3d1283,_0x4ceb3d['error'][_0x5589('0x18')]);return _0xc54186(_0x4ceb3d[_0x5589('0x17')][_0x5589('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x3d1283,_0x5589('0x13'));_0xc54186(_0x4ceb3d[_0x5589('0x19')]['message']);}})[_0x5589('0x1a')](function(_0x4a9ffa){logger[_0x5589('0x17')](_0x5589('0x1b'),_0x3d1283,_0x4a9ffa);_0x30ed45(_0x4a9ffa);});});}exports[_0x5589('0x1c')]=function(_0x520a7d){var _0x570c71=this;return new Promise(function(_0x3640b2,_0x3a5556){return db[_0x5589('0x1d')][_0x5589('0x1e')]({'raw':_0x520a7d[_0x5589('0x1f')]?_0x520a7d[_0x5589('0x1f')][_0x5589('0x20')]===undefined?!![]:![]:!![],'where':_0x520a7d[_0x5589('0x1f')]?_0x520a7d[_0x5589('0x1f')][_0x5589('0x21')]||null:null,'attributes':_0x520a7d[_0x5589('0x1f')]?_0x520a7d['options']['attributes']||null:null,'limit':_0x520a7d[_0x5589('0x1f')]?_0x520a7d[_0x5589('0x1f')][_0x5589('0x22')]||null:null,'include':_0x520a7d[_0x5589('0x1f')]?_0x520a7d[_0x5589('0x1f')][_0x5589('0x23')]?_['map'](_0x520a7d[_0x5589('0x1f')][_0x5589('0x23')],function(_0x193c12){return{'model':db[_0x193c12['model']],'as':_0x193c12['as'],'attributes':_0x193c12['attributes'],'include':_0x193c12['include']?_[_0x5589('0x24')](_0x193c12[_0x5589('0x23')],function(_0x29e3c6){return{'model':db[_0x29e3c6[_0x5589('0x25')]],'as':_0x29e3c6['as'],'attributes':_0x29e3c6['attributes'],'include':_0x29e3c6[_0x5589('0x23')]?_['map'](_0x29e3c6['include'],function(_0x5d2bc4){return{'model':db[_0x5d2bc4[_0x5589('0x25')]],'as':_0x5d2bc4['as'],'attributes':_0x5d2bc4[_0x5589('0x26')]};}):[]};}):[]};}):[]:[]})[_0x5589('0x11')](function(_0x401d7a){logger['info'](_0x5589('0x1c'),_0x520a7d);logger[_0x5589('0x14')](_0x5589('0x1c'),_0x520a7d,JSON[_0x5589('0x16')](_0x401d7a));_0x3640b2(_0x401d7a);})[_0x5589('0x1a')](function(_0x385fcd){logger[_0x5589('0x17')](_0x5589('0x1c'),_0x385fcd['message'],_0x520a7d);_0x3a5556(_0x570c71[_0x5589('0x17')](0x1f4,_0x385fcd[_0x5589('0x18')]));});});};exports[_0x5589('0x27')]=function(_0x14ecdf){var _0x5c818c=this;return new Promise(function(_0x2f438b,_0xeb2a1f){return db[_0x5589('0x1d')][_0x5589('0x28')]({'raw':_0x14ecdf['options']?_0x14ecdf[_0x5589('0x1f')][_0x5589('0x20')]===undefined?!![]:![]:!![],'where':_0x14ecdf[_0x5589('0x1f')]?_0x14ecdf['options'][_0x5589('0x21')]||null:null,'attributes':_0x14ecdf['options']?_0x14ecdf[_0x5589('0x1f')][_0x5589('0x26')]||null:null,'include':_0x14ecdf[_0x5589('0x1f')]?_0x14ecdf[_0x5589('0x1f')]['include']?_['map'](_0x14ecdf['options'][_0x5589('0x23')],function(_0x2225ac){return{'model':db[_0x2225ac[_0x5589('0x25')]],'as':_0x2225ac['as'],'attributes':_0x2225ac[_0x5589('0x26')],'include':_0x2225ac[_0x5589('0x23')]?_[_0x5589('0x24')](_0x2225ac['include'],function(_0x6019ff){return{'model':db[_0x6019ff[_0x5589('0x25')]],'as':_0x6019ff['as'],'attributes':_0x6019ff['attributes'],'include':_0x6019ff['include']?_[_0x5589('0x24')](_0x6019ff[_0x5589('0x23')],function(_0x4a9646){return{'model':db[_0x4a9646[_0x5589('0x25')]],'as':_0x4a9646['as'],'attributes':_0x4a9646[_0x5589('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a47c7){logger[_0x5589('0x12')](_0x5589('0x27'),_0x14ecdf);logger[_0x5589('0x14')](_0x5589('0x27'),_0x14ecdf,JSON[_0x5589('0x16')](_0x4a47c7));_0x2f438b(_0x4a47c7);})[_0x5589('0x1a')](function(_0x57660f){logger[_0x5589('0x17')](_0x5589('0x27'),_0x57660f[_0x5589('0x18')],_0x14ecdf);_0xeb2a1f(_0x5c818c['error'](0x1f4,_0x57660f['message']));});});};exports[_0x5589('0x29')]=function(_0x12feb3){var _0x4f28e1=this;return new Promise(function(_0x59fdbc,_0x56ed63){var _0x3b6781={'body':_0x12feb3[_0x5589('0x2a')],'channel':'mail'};var _0x3de84e=_['difference'](_['keys'](db[_0x5589('0x2b')]['rawAttributes']),[_0x5589('0x2c'),_0x5589('0x2d'),_0x5589('0x2e'),_0x5589('0x2f')]);var _0x22e245=![];if(_0x12feb3[_0x5589('0x2a')]['id']){delete _0x12feb3[_0x5589('0x2a')]['id'];}if(_['isNil'](_0x12feb3[_0x5589('0x2a')][_0x5589('0x30')])){return _0x56ed63(_0x4f28e1['error'](0x1f4,_0x5589('0x31')));}if(_[_0x5589('0x32')](_0x12feb3[_0x5589('0x2a')][_0x5589('0x2a')])||_0x12feb3[_0x5589('0x2a')][_0x5589('0x2a')]===''){return _0x56ed63(_0x4f28e1[_0x5589('0x17')](0x1f4,_0x5589('0x33')));}if(_[_0x5589('0x32')](_0x12feb3[_0x5589('0x2a')][_0x5589('0x34')])){return _0x56ed63(_0x4f28e1[_0x5589('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3de84e));}if(!_[_0x5589('0x35')](_0x3de84e,_0x12feb3[_0x5589('0x2a')]['mapKey'])){return _0x56ed63(_0x4f28e1['error'](0x1f4,_0x5589('0x36')+_0x3de84e));}var _0xedd89={};_0xedd89[_0x12feb3[_0x5589('0x2a')][_0x5589('0x34')]]=_0x12feb3['body'][_0x5589('0x30')];return db['MailAccount'][_0x5589('0x28')]({'where':{'id':_0x12feb3['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x5589('0x2b')],'as':_0x5589('0x37'),'where':_0xedd89,'limit':0x1,'order':[[_0x5589('0x2d'),_0x5589('0x38')]]}]},{'model':db[_0x5589('0x39')],'as':_0x5589('0x3a')},{'model':db[_0x5589('0x3b')],'as':_0x5589('0x3c')}]})['then'](function(_0x5a3eab){if(_0x5a3eab&&_0x5a3eab[_0x5589('0x3d')]){var _0x3045ac=_0x5a3eab['get']({'plain':!![]});_0x3b6781[_0x5589('0x3e')]=_[_0x5589('0x3f')](_0x3045ac,[_0x5589('0x3a'),_0x5589('0x3d')]);_0x3b6781['applications']=_0x3045ac[_0x5589('0x3a')];_0x3b6781[_0x5589('0x40')]=_0x3045ac[_0x5589('0x3d')];_0x3b6781[_0x5589('0x41')]=_[_0x5589('0x42')](_0x3b6781[_0x5589('0x41')],[_0x5589('0x43')],[_0x5589('0x44')]);if(_0x3b6781[_0x5589('0x3e')]&&_0x3b6781[_0x5589('0x3e')][_0x5589('0x45')]){_0x3b6781[_0x5589('0x41')]['push']({'id':0x0,'priority':_0x3b6781[_0x5589('0x41')]['length']+0x1,'app':_0x5589('0x46'),'appdata':_0x5589('0x45'),'interval':_0x5589('0x47')});}if(_0x3b6781['account'][_0x5589('0x3a')]){delete _0x3b6781[_0x5589('0x3e')][_0x5589('0x3a')];}if(_0x3b6781[_0x5589('0x3e')]['List']){delete _0x3b6781[_0x5589('0x3e')][_0x5589('0x3d')];}if(_0x3045ac['List'][_0x5589('0x37')][_0x5589('0x48')]){return _0x3045ac['List'][_0x5589('0x37')][0x0];}var _0x1412dc=_[_0x5589('0xb')](_0x12feb3[_0x5589('0x2a')],{'firstName':_0x12feb3[_0x5589('0x2a')][_0x5589('0x30')],'ListId':_0x3045ac['ListId']});_0x1412dc[_0x12feb3[_0x5589('0x2a')]['mapKey']]=_0x12feb3['body'][_0x5589('0x30')];return db[_0x5589('0x2b')]['create'](_0x1412dc);}else{throw new Error(_0x5589('0x49'));}})['then'](function(_0x343a6a){_0x3b6781[_0x5589('0x4a')]=_0x343a6a;if(_0x343a6a){if(!_0x12feb3['body'][_0x5589('0x18')][_0x5589('0x4b')]){_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x4b')]=rs[_0x5589('0x4c')]()+'\x20'+_0x12feb3['body'][_0x5589('0x18')]['from'];}var _0x2409d1={'ContactId':_0x343a6a['id'],'MailAccountId':_0x12feb3[_0x5589('0x3e')]['id'],'inReplyTo':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')]['messageId'],'to':_0x12feb3['body'][_0x5589('0x18')][_0x5589('0x30')],'cc':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')]['cc'],'subject':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x4d')],'attach':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x4e')],'lastMsgAt':moment()['format'](_0x5589('0x4f')),'lastMsgDirection':'in'};return db[_0x5589('0x50')]['find']({'where':{'closed':![],'MailAccountId':_0x12feb3['account']['id']},'include':[{'model':db[_0x5589('0x51')],'as':_0x5589('0x52'),'attributes':[_0x5589('0x4b')],'where':{'messageId':_0x12feb3['body'][_0x5589('0x18')][_0x5589('0x53')]}}]})['then'](function(_0x1ce7af){if(_0x1ce7af){return[_0x1ce7af,![]];}return db[_0x5589('0x50')][_0x5589('0x54')](_0x2409d1)[_0x5589('0x11')](function(_0x504a30){return[_0x504a30,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x578bb5,_0x2412bd){if(_0x578bb5){_0x22e245=_0x2412bd;if(!_0x2412bd){return _0x578bb5[_0x5589('0x55')]({'inReplyTo':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x4b')],'to':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x30')],'cc':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')]['cc'],'subject':_0x12feb3['body']['message'][_0x5589('0x4d')],'attach':_0x578bb5['attach']?_0x578bb5['attach']:_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0x5589('0x4f')),'lastMsgAt':moment()[_0x5589('0x56')](_0x5589('0x4f')),'lastMsgDirection':'in'});}else{return _0x578bb5;}}})[_0x5589('0x11')](function(_0x3ca212){_0x3b6781[_0x5589('0x57')]=_0x3ca212[_0x5589('0x58')]({'plain':!![]});_0x3b6781['interaction']['created']=_0x22e245;return db[_0x5589('0x51')][_0x5589('0x54')]({'body':_0x12feb3['body'][_0x5589('0x2a')],'MailAccountId':_0x12feb3[_0x5589('0x3e')]['id'],'MailInteractionId':_0x3ca212['id'],'direction':'in','ContactId':_0x3b6781[_0x5589('0x4a')]['id'],'messageId':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x4b')],'from':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x30')],'to':_0x12feb3['body'][_0x5589('0x18')]['to'],'cc':_0x12feb3[_0x5589('0x2a')]['message']['cc'],'subject':_0x12feb3[_0x5589('0x2a')]['message'][_0x5589('0x4d')],'attach':_0x12feb3['body'][_0x5589('0x18')][_0x5589('0x4e')],'Attachments':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x59')],'originTo':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x5a')],'originCc':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x5b')],'bcc':_0x12feb3[_0x5589('0x2a')]['message']['bcc'],'ChatWebsiteId':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')]['ChatWebsiteId']||null,'originChannel':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x5c')]||'Email','ChatOfflineMessageId':_0x12feb3[_0x5589('0x2a')][_0x5589('0x18')][_0x5589('0x5d')]||null},{'include':[{'model':db[_0x5589('0x5e')],'as':_0x5589('0x5f')}]});})[_0x5589('0x11')](function(_0x205f3f){_0x3b6781[_0x5589('0x18')]=_0x205f3f;if(_0x3b6781[_0x5589('0x57')][_0x5589('0x60')]){return db[_0x5589('0x61')]['find']({'attributes':['id',_0x5589('0x62')],'where':{'id':_0x3b6781[_0x5589('0x57')][_0x5589('0x60')]}})[_0x5589('0x11')](function(_0x36bdd8){if(_0x36bdd8){_0x3b6781[_0x5589('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5589('0x63'),'appdata':_0x36bdd8[_0x5589('0x62')]+','+(_0x3b6781['account'][_0x5589('0x64')]||0xa),'interval':_0x5589('0x47')});}return respondWithRpcPromise(_0x5589('0x65'),'startRouting',_0x3b6781);});}return respondWithRpcPromise(_0x5589('0x65'),_0x5589('0x66'),_0x3b6781);})[_0x5589('0x11')](function(_0x6241d6){_0x59fdbc(_0x6241d6);})[_0x5589('0x1a')](function(_0x288fdf){_0x56ed63(_0x4f28e1[_0x5589('0x17')](0x1f4,_0x288fdf[_0x5589('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 42d7db2..88ab440 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 _0x47e3=['save','remove','update','removeListener','register','mailAccount:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47e3,0x17a));var _0x347e=function(_0x4d714e,_0x7afac1){_0x4d714e=_0x4d714e-0x0;var _0x40fa14=_0x47e3[_0x4d714e];return _0x40fa14;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x347e('0x0'),_0x347e('0x1'),_0x347e('0x2')];function createListener(_0x10f230,_0xc5a61f){return function(_0x56dc78){_0xc5a61f['emit'](_0x10f230,_0x56dc78);};}function removeListener(_0x1986cc,_0x59bb61){return function(){MailAccountEvents[_0x347e('0x3')](_0x1986cc,_0x59bb61);};}exports[_0x347e('0x4')]=function(_0x3426fc){for(var _0x21a7b4=0x0,_0x20d54a=events['length'];_0x21a7b4<_0x20d54a;_0x21a7b4++){var _0x104f4e=events[_0x21a7b4];var _0x389440=createListener(_0x347e('0x5')+_0x104f4e,_0x3426fc);MailAccountEvents['on'](_0x104f4e,_0x389440);}}; \ No newline at end of file +var _0xd93a=['mailAccount:','./mailAccount.events','save','update','register','length'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0xd93a,0x91));var _0xad93=function(_0x4360a,_0x102d19){_0x4360a=_0x4360a-0x0;var _0xe856dd=_0xd93a[_0x4360a];return _0xe856dd;};'use strict';var MailAccountEvents=require(_0xad93('0x0'));var events=[_0xad93('0x1'),'remove',_0xad93('0x2')];function createListener(_0x114c1f,_0x18a8dc){return function(_0x361a87){_0x18a8dc['emit'](_0x114c1f,_0x361a87);};}function removeListener(_0x32a835,_0x35dc39){return function(){MailAccountEvents['removeListener'](_0x32a835,_0x35dc39);};}exports[_0xad93('0x3')]=function(_0x820a93){for(var _0x43bd17=0x0,_0x1d788f=events[_0xad93('0x4')];_0x43bd17<_0x1d788f;_0x43bd17++){var _0x4e3cd0=events[_0x43bd17];var _0x35cac6=createListener(_0xad93('0x5')+_0x4e3cd0,_0x820a93);MailAccountEvents['on'](_0x4e3cd0,_0x35cac6);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index a93819b..6ddf9fa 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 _0x9228=['isAuthenticated','show','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id'];(function(_0x1442c4,_0x498333){var _0x14e81f=function(_0x1803d8){while(--_0x1803d8){_0x1442c4['push'](_0x1442c4['shift']());}};_0x14e81f(++_0x498333);}(_0x9228,0x106));var _0x8922=function(_0x29b257,_0x2c9433){_0x29b257=_0x29b257-0x0;var _0x45b8f9=_0x9228[_0x29b257];return _0x45b8f9;};'use strict';var multer=require(_0x8922('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8922('0x1'));var express=require(_0x8922('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8922('0x3'));var interaction=require(_0x8922('0x4'));var config=require('../../config/environment');var controller=require(_0x8922('0x5'));router[_0x8922('0x6')](_0x8922('0x7'),auth[_0x8922('0x8')](),controller[_0x8922('0x9')]);router[_0x8922('0xa')](_0x8922('0x7'),auth['isAuthenticated'](),controller[_0x8922('0xb')]);router[_0x8922('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8922('0xd')]);module[_0x8922('0xe')]=router; \ No newline at end of file +var _0x8c54=['exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy'];(function(_0x1c49b8,_0x2efa7c){var _0x40d072=function(_0x8fb371){while(--_0x8fb371){_0x1c49b8['push'](_0x1c49b8['shift']());}};_0x40d072(++_0x2efa7c);}(_0x8c54,0x169));var _0x48c5=function(_0x279f97,_0x56fba8){_0x279f97=_0x279f97-0x0;var _0x12a583=_0x8c54[_0x279f97];return _0x12a583;};'use strict';var multer=require(_0x48c5('0x0'));var util=require('util');var path=require(_0x48c5('0x1'));var timeout=require('connect-timeout');var express=require(_0x48c5('0x2'));var router=express[_0x48c5('0x3')]();var fs_extra=require(_0x48c5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x48c5('0x5'));var config=require('../../config/environment');var controller=require(_0x48c5('0x6'));router[_0x48c5('0x7')](_0x48c5('0x8'),auth[_0x48c5('0x9')](),controller[_0x48c5('0xa')]);router['put'](_0x48c5('0x8'),auth['isAuthenticated'](),controller[_0x48c5('0xb')]);router[_0x48c5('0xc')](_0x48c5('0x8'),auth[_0x48c5('0x9')](),controller[_0x48c5('0xd')]);module[_0x48c5('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 780a24c..4c5f1ae 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 _0xee27=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x5e9a4c,_0x31191f){var _0x778e9c=function(_0x1578ca){while(--_0x1578ca){_0x5e9a4c['push'](_0x5e9a4c['shift']());}};_0x778e9c(++_0x31191f);}(_0xee27,0xa1));var _0x7ee2=function(_0x2778db,_0x285d96){_0x2778db=_0x2778db-0x0;var _0x26198c=_0xee27[_0x2778db];return _0x26198c;};'use strict';var Sequelize=require(_0x7ee2('0x0'));module[_0x7ee2('0x1')]={'priority':{'type':Sequelize[_0x7ee2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7ee2('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7ee2('0x4')]()},'description':{'type':Sequelize[_0x7ee2('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7ee2('0x5')}}; \ No newline at end of file +var _0xf430=['*,*,*,*','INTEGER','STRING','TEXT'];(function(_0x50061b,_0x3ad703){var _0x38404c=function(_0x472dd5){while(--_0x472dd5){_0x50061b['push'](_0x50061b['shift']());}};_0x38404c(++_0x3ad703);}(_0xf430,0xd5));var _0x0f43=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0xf430[_0xef4cf0];return _0x497ad2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x0f43('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x0f43('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0f43('0x2')]()},'description':{'type':Sequelize[_0x0f43('0x1')]},'interval':{'type':Sequelize[_0x0f43('0x1')],'defaultValue':_0x0f43('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index ff3a28a..74c5543 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 _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x5ee899,_0x28d73b){var _0x38d0a7=function(_0x405f85){while(--_0x405f85){_0x5ee899['push'](_0x5ee899['shift']());}};_0x38d0a7(++_0x28d73b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x98cac7,_0x4f9a9f){_0x98cac7=_0x98cac7-0x0;var _0x401ae4=_0xb43b[_0x98cac7];return _0x401ae4;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x1c1c79,_0x2de09e){var _0x41c034=function(_0x5f5340){while(--_0x5f5340){_0x1c1c79['push'](_0x1c1c79['shift']());}};_0x41c034(++_0x2de09e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 7b8191d..ede1579 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 _0x0f3a=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x0f3a,0xb5));var _0xa0f3=function(_0x37bdc2,_0x248d1e){_0x37bdc2=_0x37bdc2-0x0;var _0x239c3a=_0x0f3a[_0x37bdc2];return _0x239c3a;};'use strict';var _=require(_0xa0f3('0x0'));var util=require(_0xa0f3('0x1'));var logger=require(_0xa0f3('0x2'))(_0xa0f3('0x3'));var moment=require(_0xa0f3('0x4'));var BPromise=require(_0xa0f3('0x5'));var rp=require(_0xa0f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0f3('0x7'));var config=require(_0xa0f3('0x8'));var attributes=require(_0xa0f3('0x9'));module['exports']=function(_0xb33b41,_0x31b671){return _0xb33b41[_0xa0f3('0xa')](_0xa0f3('0xb'),attributes,{'tableName':_0xa0f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa0f3('0xd'),'collate':_0xa0f3('0xe')});}; \ No newline at end of file +var _0xb296=['lodash','api','bluebird','request-promise','path','rimraf','./mailApplication.attributes','define','mail_applications','utf8mb4_unicode_ci'];(function(_0x444c8f,_0x1a6436){var _0xa21ad3=function(_0x15aec6){while(--_0x15aec6){_0x444c8f['push'](_0x444c8f['shift']());}};_0xa21ad3(++_0x1a6436);}(_0xb296,0x122));var _0x6b29=function(_0x10e681,_0x589087){_0x10e681=_0x10e681-0x0;var _0x4f1d5c=_0xb296[_0x10e681];return _0x4f1d5c;};'use strict';var _=require(_0x6b29('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6b29('0x1'));var moment=require('moment');var BPromise=require(_0x6b29('0x2'));var rp=require(_0x6b29('0x3'));var fs=require('fs');var path=require(_0x6b29('0x4'));var rimraf=require(_0x6b29('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b29('0x6'));module['exports']=function(_0x1e6491,_0x3a4d1b){return _0x1e6491[_0x6b29('0x7')]('MailApplication',attributes,{'tableName':_0x6b29('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6b29('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 222ebb0..5a6c41d 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 _0x5acc=['where','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','body','options','raw'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5acc,0xdd));var _0xc5ac=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5acc[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xc5ac('0x0'));var moment=require(_0xc5ac('0x1'));var BPromise=require(_0xc5ac('0x2'));var rs=require(_0xc5ac('0x3'));var fs=require('fs');var Redis=require(_0xc5ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc5ac('0x5'));var config=require(_0xc5ac('0x6'));var jayson=require(_0xc5ac('0x7'));var client=jayson[_0xc5ac('0x8')][_0xc5ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bf46a,_0x4821fd,_0x4ef994){return new BPromise(function(_0x5b3883,_0x1d0e76){return client[_0xc5ac('0xa')](_0x1bf46a,_0x4ef994)['then'](function(_0x292227){logger[_0xc5ac('0xb')](_0xc5ac('0xc'),_0x4821fd,_0xc5ac('0xd'));logger[_0xc5ac('0xe')](_0xc5ac('0xf'),_0x4821fd,_0xc5ac('0xd'),JSON[_0xc5ac('0x10')](_0x292227));if(_0x292227[_0xc5ac('0x11')]){if(_0x292227[_0xc5ac('0x11')][_0xc5ac('0x12')]===0x1f4){logger['error'](_0xc5ac('0xc'),_0x4821fd,_0x292227['error'][_0xc5ac('0x13')]);return _0x1d0e76(_0x292227['error'][_0xc5ac('0x13')]);}logger['error'](_0xc5ac('0xc'),_0x4821fd,_0x292227[_0xc5ac('0x11')][_0xc5ac('0x13')]);return _0x5b3883(_0x292227[_0xc5ac('0x11')][_0xc5ac('0x13')]);}else{logger[_0xc5ac('0xb')](_0xc5ac('0xc'),_0x4821fd,_0xc5ac('0xd'));_0x5b3883(_0x292227[_0xc5ac('0x14')]['message']);}})[_0xc5ac('0x15')](function(_0x4c9d65){logger[_0xc5ac('0x11')](_0xc5ac('0xc'),_0x4821fd,_0x4c9d65);_0x1d0e76(_0x4c9d65);});});}exports[_0xc5ac('0x16')]=function(_0x18cb9a){var _0x531c3a=this;return new Promise(function(_0x59d671,_0x39b868){return db['MailApplication'][_0xc5ac('0x17')](_0x18cb9a[_0xc5ac('0x18')],{'raw':_0x18cb9a[_0xc5ac('0x19')]?_0x18cb9a['options'][_0xc5ac('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18cb9a['options']?_0x18cb9a[_0xc5ac('0x19')][_0xc5ac('0x1b')]||null:null,'attributes':_0x18cb9a[_0xc5ac('0x19')]?_0x18cb9a[_0xc5ac('0x19')][_0xc5ac('0x1c')]||null:null,'limit':_0x18cb9a['options']?_0x18cb9a[_0xc5ac('0x19')][_0xc5ac('0x1d')]||null:null})[_0xc5ac('0x1e')](function(_0x1ca4de){logger[_0xc5ac('0xb')](_0xc5ac('0x16'),_0x18cb9a);logger['debug'](_0xc5ac('0x16'),_0x18cb9a,JSON[_0xc5ac('0x10')](_0x1ca4de));_0x59d671(_0x1ca4de);})[_0xc5ac('0x15')](function(_0x310f51){logger[_0xc5ac('0x11')](_0xc5ac('0x16'),_0x310f51[_0xc5ac('0x13')],_0x18cb9a);_0x39b868(_0x531c3a[_0xc5ac('0x11')](0x1f4,_0x310f51['message']));});});}; \ No newline at end of file +var _0xe835=['request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','MailApplication,\x20%s,\x20%s'];(function(_0x4580fc,_0x1aad17){var _0x7e1c3e=function(_0x27ba20){while(--_0x27ba20){_0x4580fc['push'](_0x4580fc['shift']());}};_0x7e1c3e(++_0x1aad17);}(_0xe835,0x16b));var _0x5e83=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xe835[_0x189305];return _0xea3406;};'use strict';var _=require(_0x5e83('0x0'));var util=require(_0x5e83('0x1'));var moment=require(_0x5e83('0x2'));var BPromise=require('bluebird');var rs=require(_0x5e83('0x3'));var fs=require('fs');var Redis=require(_0x5e83('0x4'));var db=require(_0x5e83('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e83('0x6'))(_0x5e83('0x7'));var config=require(_0x5e83('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5e83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42e407,_0x960b01,_0x4f0823){return new BPromise(function(_0x50b90e,_0x32cbae){return client[_0x5e83('0xa')](_0x42e407,_0x4f0823)[_0x5e83('0xb')](function(_0x4af9dd){logger[_0x5e83('0xc')](_0x5e83('0xd'),_0x960b01,_0x5e83('0xe'));logger[_0x5e83('0xf')](_0x5e83('0x10'),_0x960b01,_0x5e83('0xe'),JSON['stringify'](_0x4af9dd));if(_0x4af9dd[_0x5e83('0x11')]){if(_0x4af9dd['error'][_0x5e83('0x12')]===0x1f4){logger[_0x5e83('0x11')](_0x5e83('0xd'),_0x960b01,_0x4af9dd[_0x5e83('0x11')][_0x5e83('0x13')]);return _0x32cbae(_0x4af9dd[_0x5e83('0x11')]['message']);}logger[_0x5e83('0x11')](_0x5e83('0xd'),_0x960b01,_0x4af9dd[_0x5e83('0x11')][_0x5e83('0x13')]);return _0x50b90e(_0x4af9dd['error'][_0x5e83('0x13')]);}else{logger[_0x5e83('0xc')](_0x5e83('0xd'),_0x960b01,_0x5e83('0xe'));_0x50b90e(_0x4af9dd['result'][_0x5e83('0x13')]);}})[_0x5e83('0x14')](function(_0x13e065){logger[_0x5e83('0x11')](_0x5e83('0xd'),_0x960b01,_0x13e065);_0x32cbae(_0x13e065);});});}exports[_0x5e83('0x15')]=function(_0x5d7978){var _0xc288ed=this;return new Promise(function(_0x236bf4,_0x40b3c7){return db[_0x5e83('0x16')][_0x5e83('0x17')](_0x5d7978['body'],{'raw':_0x5d7978['options']?_0x5d7978[_0x5e83('0x18')][_0x5e83('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7978[_0x5e83('0x18')]?_0x5d7978[_0x5e83('0x18')][_0x5e83('0x1a')]||null:null,'attributes':_0x5d7978[_0x5e83('0x18')]?_0x5d7978[_0x5e83('0x18')][_0x5e83('0x1b')]||null:null,'limit':_0x5d7978[_0x5e83('0x18')]?_0x5d7978[_0x5e83('0x18')]['limit']||null:null})['then'](function(_0x595797){logger['info'](_0x5e83('0x15'),_0x5d7978);logger['debug'](_0x5e83('0x15'),_0x5d7978,JSON[_0x5e83('0x1c')](_0x595797));_0x236bf4(_0x595797);})[_0x5e83('0x14')](function(_0x5659ed){logger[_0x5e83('0x11')]('UpdateMailApplication',_0x5659ed['message'],_0x5d7978);_0x40b3c7(_0xc288ed[_0x5e83('0x11')](0x1f4,_0x5659ed[_0x5e83('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index f7df42c..08b0db1 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 _0x236a=['getMessages','download','post','addMessage','/:id/tags','tracked','mail','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages'];(function(_0x4e7632,_0x33542f){var _0x33d024=function(_0x4da44c){while(--_0x4da44c){_0x4e7632['push'](_0x4e7632['shift']());}};_0x33d024(++_0x33542f);}(_0x236a,0x165));var _0xa236=function(_0x47ad08,_0x28fcd1){_0x47ad08=_0x47ad08-0x0;var _0x302699=_0x236a[_0x47ad08];return _0x302699;};'use strict';var express=require(_0xa236('0x0'));var router=express[_0xa236('0x1')]();var auth=require(_0xa236('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xa236('0x3'));router[_0xa236('0x4')]('/',auth[_0xa236('0x5')](),controller[_0xa236('0x6')]);router['get'](_0xa236('0x7'),auth[_0xa236('0x5')](),controller[_0xa236('0x8')]);router[_0xa236('0x4')](_0xa236('0x9'),auth[_0xa236('0x5')](),controller['show']);router['get'](_0xa236('0xa'),auth['isAuthenticated'](),controller[_0xa236('0xb')]);router[_0xa236('0x4')]('/:id/download',auth['isAuthenticated'](),controller[_0xa236('0xc')]);router[_0xa236('0xd')]('/',auth[_0xa236('0x5')](),controller['create']);router[_0xa236('0xd')]('/:id/messages',auth[_0xa236('0x5')](),controller[_0xa236('0xe')]);router[_0xa236('0xd')](_0xa236('0xf'),auth[_0xa236('0x5')](),interaction[_0xa236('0x10')]('mail','mailinteraction:addtags'),controller['addTags']);router['put'](_0xa236('0x9'),auth[_0xa236('0x5')](),interaction[_0xa236('0x10')](_0xa236('0x11'),'mailinteraction:update'),controller[_0xa236('0x12')]);router['delete'](_0xa236('0x9'),auth['isAuthenticated'](),interaction[_0xa236('0x10')](_0xa236('0x11'),_0xa236('0x13')),controller[_0xa236('0x14')]);router[_0xa236('0x15')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa236('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd394=['/:id/messages','getMessages','download','post','create','addMessage','tracked','mail','addTags','put','/:id','mailinteraction:update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','get','index','/describe','isAuthenticated','describe','show'];(function(_0x5452a7,_0x5ef0b9){var _0x68778d=function(_0x5bd25a){while(--_0x5bd25a){_0x5452a7['push'](_0x5452a7['shift']());}};_0x68778d(++_0x5ef0b9);}(_0xd394,0x1c2));var _0x4d39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd394[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x4d39('0x0'));var router=express[_0x4d39('0x1')]();var auth=require(_0x4d39('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x4d39('0x3')]('/',auth['isAuthenticated'](),controller[_0x4d39('0x4')]);router[_0x4d39('0x3')](_0x4d39('0x5'),auth[_0x4d39('0x6')](),controller[_0x4d39('0x7')]);router[_0x4d39('0x3')]('/:id',auth[_0x4d39('0x6')](),controller[_0x4d39('0x8')]);router[_0x4d39('0x3')](_0x4d39('0x9'),auth['isAuthenticated'](),controller[_0x4d39('0xa')]);router[_0x4d39('0x3')]('/:id/download',auth[_0x4d39('0x6')](),controller[_0x4d39('0xb')]);router[_0x4d39('0xc')]('/',auth[_0x4d39('0x6')](),controller[_0x4d39('0xd')]);router['post'](_0x4d39('0x9'),auth['isAuthenticated'](),controller[_0x4d39('0xe')]);router[_0x4d39('0xc')]('/:id/tags',auth[_0x4d39('0x6')](),interaction[_0x4d39('0xf')](_0x4d39('0x10'),'mailinteraction:addtags'),controller[_0x4d39('0x11')]);router[_0x4d39('0x12')](_0x4d39('0x13'),auth['isAuthenticated'](),interaction[_0x4d39('0xf')]('mail',_0x4d39('0x14')),controller['update']);router[_0x4d39('0x15')](_0x4d39('0x13'),auth[_0x4d39('0x6')](),interaction[_0x4d39('0xf')]('mail',_0x4d39('0x16')),controller[_0x4d39('0x17')]);router[_0x4d39('0x15')](_0x4d39('0x18'),auth[_0x4d39('0x6')](),controller[_0x4d39('0x19')]);module[_0x4d39('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 88180e4..7518445 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 _0x02ad=['long','BOOLEAN','DATE','ENUM','out','iconv','exports','STRING','TEXT'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x02ad,0x68));var _0xd02a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x02ad[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xd02a('0x0'));module[_0xd02a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd02a('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd02a('0x2')]},'note':{'type':Sequelize[_0xd02a('0x2')]},'inReplyTo':{'type':Sequelize[_0xd02a('0x2')](0x1fe)},'to':{'type':Sequelize[_0xd02a('0x2')]},'cc':{'type':Sequelize[_0xd02a('0x3')](_0xd02a('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xd02a('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd02a('0x6')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xd02a('0x6')]},'firstMsgDirection':{'type':Sequelize[_0xd02a('0x7')]('in',_0xd02a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd02a('0x7')]('in',_0xd02a('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd02a('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x45fd=['out','ENUM','iconv','exports','DATE','STRING','TEXT','long','BOOLEAN'];(function(_0x20faac,_0x2d8fc6){var _0x38d59c=function(_0x42ebd4){while(--_0x42ebd4){_0x20faac['push'](_0x20faac['shift']());}};_0x38d59c(++_0x2d8fc6);}(_0x45fd,0xa4));var _0xd45f=function(_0x21d6d4,_0x15851c){_0x21d6d4=_0x21d6d4-0x0;var _0x42eee5=_0x45fd[_0x21d6d4];return _0x42eee5;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xd45f('0x0'));module[_0xd45f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd45f('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd45f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd45f('0x3')]},'inReplyTo':{'type':Sequelize[_0xd45f('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xd45f('0x4')](_0xd45f('0x5'))},'subject':{'type':Sequelize[_0xd45f('0x4')]()},'attach':{'type':Sequelize[_0xd45f('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd45f('0x2')]},'substatus':{'type':Sequelize[_0xd45f('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xd45f('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xd45f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd45f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd45f('0x8')]('in',_0xd45f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index eaca6e6..c4bd35b 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 _0x199c=['root','transcript-%d-%s.zip','attachments','Messages','createdAt','each','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','zip-dir','moment','bluebird','util','path','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','stack','name','send','map','TagIds','forEach','Tags','push','MailMessage','out','plainBody','-id','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.MailInteractionId','left_join','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','compact','isEmpty','MailAccountId','where','concat','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','MailInteraction','a.key','Account.key','a.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.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','all','params','keys','include','options','create','body','describe','addMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','inlineCss','true','rows','addTags','setTags','spread','Tag','mailInteractionTags:save','removeTags','download','unix','join','server','files'];(function(_0x1fc412,_0x409400){var _0x309cc6=function(_0x547d5d){while(--_0x547d5d){_0x1fc412['push'](_0x1fc412['shift']());}};_0x309cc6(++_0x409400);}(_0x199c,0x1d8));var _0xc199=function(_0xb924fc,_0x62b819){_0xb924fc=_0xb924fc-0x0;var _0x19c71a=_0x199c[_0xb924fc];return _0x19c71a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc199('0x0'));var moment=require(_0xc199('0x1'));var BPromise=require(_0xc199('0x2'));var util=require(_0xc199('0x3'));var path=require(_0xc199('0x4'));var fs=require('fs');var _=require(_0xc199('0x5'));var squel=require(_0xc199('0x6'));var juice=require(_0xc199('0x7'));var Redis=require('ioredis');var qs=require(_0xc199('0x8'));var as=require(_0xc199('0x9'));var logger=require('../../config/logger')('api');var config=require(_0xc199('0xa'));var db=require(_0xc199('0xb'))['db'];var htmlEntities=require(_0xc199('0xc'));config[_0xc199('0xd')]=_[_0xc199('0xe')](config[_0xc199('0xd')],{'host':_0xc199('0xf'),'port':0x18eb});var socket=require(_0xc199('0x10'))(new Redis(config['redis']));require(_0xc199('0x11'))[_0xc199('0x12')](socket);function respondWithStatusCode(_0x921e09,_0xe640ab){_0xe640ab=_0xe640ab||0xcc;return function(_0x153d7e){if(_0x153d7e){return _0x921e09[_0xc199('0x13')](_0xe640ab);}return _0x921e09['status'](_0xe640ab)[_0xc199('0x14')]();};}function respondWithResult(_0x13ab06,_0x34fde3){_0x34fde3=_0x34fde3||0xc8;return function(_0x13b4fa){if(_0x13b4fa){return _0x13ab06[_0xc199('0x15')](_0x34fde3)['json'](_0x13b4fa);}};}function respondWithFilteredResult(_0xa5bfc2,_0x445c68){return function(_0x67c1ed){if(_0x67c1ed){var _0x62f34e=typeof _0x445c68[_0xc199('0x16')]==='undefined'&&typeof _0x445c68['limit']===_0xc199('0x17');var _0x5a8e99=_0x67c1ed[_0xc199('0x18')];var _0x3c4736=_0x62f34e?0x0:_0x445c68['offset'];var _0x445c65=_0x62f34e?_0x67c1ed['count']:_0x445c68[_0xc199('0x16')]+_0x445c68[_0xc199('0x19')];var _0x5ee3f8;if(_0x445c65>=_0x5a8e99){_0x445c65=_0x5a8e99;_0x5ee3f8=0xc8;}else{_0x5ee3f8=0xce;}_0xa5bfc2[_0xc199('0x15')](_0x5ee3f8);return _0xa5bfc2[_0xc199('0x1a')](_0xc199('0x1b'),_0x3c4736+'-'+_0x445c65+'/'+_0x5a8e99)[_0xc199('0x1c')](_0x67c1ed);}return null;};}function saveUpdates(_0x1e1540){return function(_0x2c953f){if(_0x2c953f){return _0x2c953f[_0xc199('0x1d')](_0x1e1540)[_0xc199('0x1e')](function(_0x54babd){return _0x54babd;});}return null;};}function removeEntity(_0x17e150){return function(_0x109cf8){if(_0x109cf8){return _0x109cf8[_0xc199('0x1f')]()[_0xc199('0x1e')](function(){_0x17e150['status'](0xcc)[_0xc199('0x14')]();});}};}function handleEntityNotFound(_0x1adf1f){return function(_0x381c94){if(!_0x381c94){_0x1adf1f[_0xc199('0x13')](0x194);}return _0x381c94;};}function handleError(_0x45873f,_0x5c34e8){_0x5c34e8=_0x5c34e8||0x1f4;return function(_0x4dad27){logger['error'](_0x4dad27[_0xc199('0x20')]);if(_0x4dad27['name']){delete _0x4dad27[_0xc199('0x21')];}_0x45873f['status'](_0x5c34e8)[_0xc199('0x22')](_0x4dad27);};}function getInteractionUsers(_0x24045f,_0x4e0306){return new BPromise(function(_0x2d184d,_0x838760){try{if(_0x4e0306[_0x24045f['id']]){_0x24045f['Users']=_[_0xc199('0x23')](_0x4e0306[_0x24045f['id']],function(_0x548fca){return{'id':_0x548fca['id'],'fullname':_0x548fca['fullname']};});}}catch(_0x3ec230){_0x838760(_0x3ec230);}_0x2d184d(_0x24045f);});}function getInteractionTags(_0x4494b5,_0x2f1954){return new BPromise(function(_0x4d795f,_0x2ed565){try{if(_0x4494b5[_0xc199('0x24')]){_0x4494b5['Tags']=[];_0x4494b5[_0xc199('0x24')]['split'](',')[_0xc199('0x25')](function(_0x588e05){_0x4494b5[_0xc199('0x26')][_0xc199('0x27')](_0x2f1954[_0x588e05]);});}delete _0x4494b5[_0xc199('0x24')];}catch(_0x1099a3){_0x2ed565(_0x1099a3);}_0x4d795f(_0x4494b5);});}function getLastMessageText(_0x12b88a){return new BPromise(function(_0x1a3e7c,_0x35aa04){return db[_0xc199('0x28')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x12b88a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xc199('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc199('0x2a')],'order':_0xc199('0x2b'),'raw':!![]})['then'](function(_0x457ebc){if(_0x457ebc&&_0x457ebc['plainBody']){_0x12b88a['lastMsgText']=_[_0xc199('0x2c')](_0x457ebc[_0xc199('0x2a')]);}_0x1a3e7c(_0x12b88a);})['catch'](function(_0x1d98b7){_0x35aa04(_0x1d98b7);});});}function updateMailInteraction(_0x5ae421,_0x4c4b4d,_0x144b6c,_0x586156){return new BPromise(function(_0x1475ed,_0x3b9220){return getInteractionUsers(_0x5ae421,_0x144b6c)[_0xc199('0x1e')](function(_0x778d57){return getInteractionTags(_0x778d57,_0x4c4b4d);})[_0xc199('0x1e')](function(_0x49c90c){return getStateInteraction(_0x49c90c);})['then'](function(_0x4b9ab7){if(_0x586156){_0x1475ed(getLastMessageText(_0x4b9ab7));}else{_0x1475ed(_0x4b9ab7);}})[_0xc199('0x2d')](function(_0x490e0e){_0x3b9220(_0x490e0e);});});}function getStateInteraction(_0x3bf1cf){return new BPromise(function(_0x7f8f7f){_0x3bf1cf[_0xc199('0x2e')]=0x0;_0x3bf1cf[_0xc199('0x2f')]=0x0;_0x3bf1cf[_0xc199('0x30')]=0x0;_0x3bf1cf[_0xc199('0x31')]=0x0;_0x3bf1cf[_0xc199('0x32')]=0x0;if(!_0x3bf1cf[_0xc199('0x33')]&&!_0x3bf1cf[_0xc199('0x34')]){_0x3bf1cf[_0xc199('0x2e')]+=0x1;}if(!_0x3bf1cf['closed']&&_0x3bf1cf['UserId']){_0x3bf1cf[_0xc199('0x2f')]+=0x1;if(_0x3bf1cf[_0xc199('0x2e')]){_0x3bf1cf[_0xc199('0x2e')]-=0x1;}}if(_0x3bf1cf[_0xc199('0x33')]&&_0x3bf1cf[_0xc199('0x34')]){_0x3bf1cf[_0xc199('0x30')]+=0x1;if(_0x3bf1cf[_0xc199('0x2f')]){_0x3bf1cf[_0xc199('0x2f')]-=0x1;}}if(_0x3bf1cf['closed']&&!_0x3bf1cf['UserId']){_0x3bf1cf['unmanaged']+=0x1;if(_0x3bf1cf[_0xc199('0x2e')]){_0x3bf1cf[_0xc199('0x2e')]-=0x1;}}_0x3bf1cf[_0xc199('0x32')]+=0x1;_0x7f8f7f(_0x3bf1cf);});}exports['index']=function(_0x190877,_0x27d5e4){var _0x5f1e2e={},_0x3a66e9={},_0x28346c={'count':0x0,'rows':[]};var _0x316766=_[_0xc199('0x23')](db['MailInteraction'][_0xc199('0x35')],function(_0x558e6){return{'name':_0x558e6[_0xc199('0x36')],'type':_0x558e6[_0xc199('0x37')][_0xc199('0x38')]};});_0x3a66e9[_0xc199('0x39')]=_[_0xc199('0x23')](_0x316766,'name');_0x3a66e9['query']=_['keys'](_0x190877[_0xc199('0x3a')]);_0x3a66e9[_0xc199('0x3b')]=_[_0xc199('0x3c')](_0x3a66e9[_0xc199('0x39')],_0x3a66e9[_0xc199('0x3a')]);_0x5f1e2e['attributes']=_['intersection'](_0x3a66e9[_0xc199('0x39')],qs[_0xc199('0x3d')](_0x190877['query']['fields']));_0x5f1e2e[_0xc199('0x3e')]=_0x5f1e2e[_0xc199('0x3e')]['length']?_0x5f1e2e[_0xc199('0x3e')]:_0x3a66e9[_0xc199('0x39')];if(!_0x190877['query'][_0xc199('0x3f')](_0xc199('0x40'))){_0x5f1e2e[_0xc199('0x19')]=qs['limit'](_0x190877[_0xc199('0x3a')][_0xc199('0x19')]);_0x5f1e2e[_0xc199('0x16')]=qs['offset'](_0x190877[_0xc199('0x3a')][_0xc199('0x16')]);}_0x5f1e2e[_0xc199('0x41')]=qs['sort'](_0x190877[_0xc199('0x3a')][_0xc199('0x42')]);_0x5f1e2e['where']=qs[_0xc199('0x3b')](_[_0xc199('0x43')](_0x190877[_0xc199('0x3a')],_0x3a66e9['filters']),_0x316766);var _0x5cf201=[];var _0x40cd7e=squel[_0xc199('0x44')]()['field']('id')[_0xc199('0x45')](_0xc199('0x21'))['field'](_0xc199('0x46'))[_0xc199('0x47')]('tools_tags');var _0x10f418=squel[_0xc199('0x44')]()[_0xc199('0x45')](_0xc199('0x48'))['field'](_0xc199('0x49'))[_0xc199('0x45')](_0xc199('0x4a'))[_0xc199('0x47')]('user_has_mail_interactions','ui')[_0xc199('0x4b')]('users','u','u.id\x20=\x20ui.UserId');var _0x18f410=squel[_0xc199('0x44')]()[_0xc199('0x47')](_0xc199('0x4c'),'i')[_0xc199('0x4b')](_0xc199('0x4d'),'c',_0xc199('0x4e'))[_0xc199('0x4b')]('users','o','o.id\x20=\x20i.UserId')[_0xc199('0x4b')](_0xc199('0x4f'),'a',_0xc199('0x50'))[_0xc199('0x4b')](_0xc199('0x51'),'me',_0xc199('0x52'))[_0xc199('0x4b')](_0xc199('0x53'),'it',_0xc199('0x54'))[_0xc199('0x4b')](_0xc199('0x55'),'t',_0xc199('0x56'));var _0x3afb25=squel[_0xc199('0x57')]();var _0x3dbef5=[];var _0x4573e2=squel[_0xc199('0x57')]();var _0x3cb4a6;if(_0x190877[_0xc199('0x3a')][_0xc199('0x58')]){_0x3cb4a6=as['parseSearch'](_0x190877[_0xc199('0x3a')]['search']);var _0x2f24e2=_0x3cb4a6[_0xc199('0x59')];for(var _0x4ecd2a=0x0;_0x4ecd2a<_0x3cb4a6[_0xc199('0x5a')][_0xc199('0x5b')];_0x4ecd2a++){var _0x511988=_0x3cb4a6[_0xc199('0x5a')][_0x4ecd2a];var _0x14a94='i';var _0x1442ad=_[_0xc199('0x5c')](_0x316766,['name',_0x511988[_0xc199('0x45')]]);if(!_0x1442ad){switch(_0x511988[_0xc199('0x45')]){case _0xc199('0x5d'):if(_0x511988['value']==0x1){_0x18f410['having']('`'+_0x511988['field']+'`\x20=\x200');}else{_0x18f410[_0xc199('0x5e')]('`'+_0x511988[_0xc199('0x45')]+_0xc199('0x5f'));}break;case _0xc199('0x60'):if(_0x511988['operator']===_0xc199('0x61')){if(_0x511988[_0xc199('0x62')][_0xc199('0x63')]('\x20')[_0xc199('0x5b')]>0x1){_0x3afb25[_0x2f24e2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc199('0x64')](_0x511988[_0xc199('0x62')]),null);}else{var _0x40e510='%'+_0x511988[_0xc199('0x62')]+'%';_0x3afb25[_0x2f24e2](_0xc199('0x65'),_0x40e510,_0x40e510,_0x40e510);}}else{_0x1442ad=_['find'](_0x316766,['name',_0xc199('0x66')]);_0x511988[_0xc199('0x45')]=_0xc199('0x66');_0x360962=as[_0xc199('0x67')](_0x14a94,_0x1442ad[_0xc199('0x37')],_0x511988);_0x3afb25[_0x2f24e2](_0x360962[_0xc199('0x68')],_0x360962[_0xc199('0x62')][_0xc199('0x69')],_0x360962[_0xc199('0x62')][_0xc199('0x14')]);}break;case'Tag':var _0x56ad5c=_0x511988[_0xc199('0x62')]['split'](',')['map'](function(_0x496a7e){return Number(_0x496a7e);});_0x56ad5c[_0xc199('0x25')](function(_0x2d8dd9){_0x4573e2['or'](_0xc199('0x6a'),'%,'+_0x2d8dd9+',%');});_0x3dbef5=_['union'](_0x3dbef5,_0x56ad5c);break;case _0xc199('0x6b'):if(_0x511988[_0xc199('0x6c')]===_0xc199('0x61')){_0x3afb25[_0x2f24e2](_0xc199('0x6d'),'%'+_0x511988[_0xc199('0x62')]+'%',null);}else{_0x1442ad=_['find'](_0x316766,[_0xc199('0x21'),_0xc199('0x34')]);_0x511988[_0xc199('0x45')]=_0xc199('0x34');_0x360962=as[_0xc199('0x67')](_0x14a94,_0x1442ad[_0xc199('0x37')],_0x511988);_0x3afb25[_0x2f24e2](_0x360962['text'],_0x360962['value'][_0xc199('0x69')],_0x360962['value'][_0xc199('0x14')]);}break;case _0xc199('0x2a'):_0x360962=as[_0xc199('0x67')]('me',null,_0x511988);_0x3afb25[_0x2f24e2](_0x360962[_0xc199('0x68')],_0x360962[_0xc199('0x62')][_0xc199('0x69')],_0x360962[_0xc199('0x62')][_0xc199('0x14')]);break;}}else{var _0x360962=as[_0xc199('0x67')](_0x14a94,_0x1442ad['type'],_0x511988);_0x3afb25[_0x2f24e2](_0x360962[_0xc199('0x68')],_0x360962['value'][_0xc199('0x69')],_0x360962[_0xc199('0x62')]['end']);}}}else{var _0x3a9691=_(_0x190877[_0xc199('0x3a')])['keys']()['map'](function(_0x48c5f3){return _['some'](_0x316766,['name',_0x48c5f3])?_0x48c5f3:undefined;})[_0xc199('0x6e')]()[_0xc199('0x62')]();if(!_[_0xc199('0x6f')](_0x3a9691)){_0x3a9691[_0xc199('0x25')](function(_0xd76561){if(_0xd76561===_0xc199('0x70')){_0x18f410[_0xc199('0x71')]('i.MailAccountId\x20IN\x20?',[][_0xc199('0x72')](_0x190877[_0xc199('0x3a')][_0xd76561]));}else if(_0xd76561==='createdAt'){var _0x345b11=JSON[_0xc199('0x73')](_0x190877[_0xc199('0x3a')][_0xd76561])[_0xc199('0x74')];var _0x416d51=JSON['parse'](_0x190877[_0xc199('0x3a')][_0xd76561])['$lte'];_0x18f410[_0xc199('0x71')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x345b11,_0x416d51);}else{if(_0x190877[_0xc199('0x3a')][_0xd76561]===_0xc199('0x75')){_0x18f410['where']('i.'+_0xd76561+_0xc199('0x76'));}else{_0x18f410[_0xc199('0x71')]('i.'+_0xd76561+'\x20=\x20?',_0x190877[_0xc199('0x3a')][_0xd76561]);}}});}if(_0x190877['query'][_0xc199('0x77')]){if(_0x190877['query'][_0xc199('0x77')]==0x1){_0x18f410[_0xc199('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x18f410[_0xc199('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x190877['query'][_0xc199('0x78')]){_0x3dbef5=_[_0xc199('0x79')](_0x190877[_0xc199('0x3a')][_0xc199('0x78')])?_0x190877[_0xc199('0x3a')]['tag']:new Array(_0x190877[_0xc199('0x3a')][_0xc199('0x78')]);_0x3dbef5[_0xc199('0x25')](function(_0x24930b){_0x4573e2['or'](_0xc199('0x6a'),'%,'+_0x24930b+',%');});}if(_0x190877[_0xc199('0x3a')][_0xc199('0x7a')]){var _0x1bb734=_0x190877[_0xc199('0x3a')]['filter'][_0xc199('0x7b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc199('0x7c')](_0x1bb734)){_0x3afb25['or'](_0xc199('0x7d'),_0x1bb734+'%');}else if(qs['isEmail'](_0x1bb734)){_0x3afb25['or']('c.email\x20LIKE\x20?',_0x1bb734+'%');}else{_0x3afb25['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc199('0x64')](_0x1bb734))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc199('0x64')](_0x1bb734));}}}_0x18f410[_0xc199('0x71')](_0x3afb25);_0x18f410[_0xc199('0x7e')](_0xc199('0x7f'));var _0x310c65={'type':db[_0xc199('0x80')]['QueryTypes'][_0xc199('0x81')],'raw':!![]};var _0x1d6742=_0x18f410[_0xc199('0x82')]();_0x1d6742[_0xc199('0x45')](_0xc199('0x7f'));_0x1d6742[_0xc199('0x45')](_0xc199('0x83'),_0xc199('0x5d'));if(_0x5f1e2e[_0xc199('0x41')]){_0x5f1e2e[_0xc199('0x41')]['forEach'](function(_0x3ad2c3){var _0x56c1ec=_0x3ad2c3[0x0]===_0xc199('0x84')?_0x3ad2c3[0x0]:'i.'+_0x3ad2c3[0x0];_0x18f410['order'](_0x56c1ec,_0x3ad2c3[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc199('0x6f')](_0x3dbef5)){_0x18f410['having'](_0x4573e2);_0x1d6742[_0xc199('0x71')]('t.id\x20IN\x20?',_0x3dbef5);}BPromise['resolve']()[_0xc199('0x1e')](function(){if(!_0x3cb4a6){if(_0x190877['query'][_0xc199('0x70')])return;_0x1d6742['where'](_0xc199('0x85'));_0x18f410[_0xc199('0x71')](_0xc199('0x85'));return;}if(_0x190877[_0xc199('0x86')][_0xc199('0x87')]!==_0xc199('0x88'))return;return _0x190877[_0xc199('0x86')][_0xc199('0x89')]({'attributes':['id'],'raw':!![]})[_0xc199('0x1e')](function(_0x1d993e){if(_['isEmpty'](_0x1d993e)){_0x1d6742[_0xc199('0x71')](_0xc199('0x8a'));_0x18f410[_0xc199('0x71')](_0xc199('0x8a'));}else{_0x1d6742[_0xc199('0x71')]('i.MailAccountId\x20IN\x20?',_[_0xc199('0x23')](_0x1d993e,'id'));_0x18f410[_0xc199('0x71')](_0xc199('0x8b'),_[_0xc199('0x23')](_0x1d993e,'id'));}});})['then'](function(){if(_0x190877[_0xc199('0x86')][_0xc199('0x87')]==='agent'&&!_0x3cb4a6&&!_0x190877[_0xc199('0x3a')][_0xc199('0x70')])return[];return db[_0xc199('0x8c')][_0xc199('0x3a')](_0x1d6742[_0xc199('0x8d')](),_0x310c65);})[_0xc199('0x1e')](function(_0x51c682){_0x28346c[_0xc199('0x18')]=_0x51c682[_0xc199('0x5b')];if(_0x28346c['count']===0x0)return[];return db[_0xc199('0x8c')][_0xc199('0x3a')](_0x40cd7e['toString'](),_0x310c65)['then'](function(_0x1201e7){_0x5cf201=_[_0xc199('0x8e')](_0x1201e7,'id');_0x310c65=_[_0xc199('0x8f')](_0x310c65,{'model':db[_0xc199('0x90')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x190877[_0xc199('0x3a')][_0xc199('0x3d')]){_0x5f1e2e[_0xc199('0x3e')][_0xc199('0x25')](function(_0x152faa){_0x18f410[_0xc199('0x45')]('i.'+_0x152faa);});}else{_0x18f410[_0xc199('0x45')](_0xc199('0x83'),_0xc199('0x5d'));_0x18f410[_0xc199('0x45')](_0xc199('0x91'),_0xc199('0x92'));_0x18f410[_0xc199('0x45')](_0xc199('0x93'),'Account.mandatoryDisposition');_0x18f410[_0xc199('0x45')](_0xc199('0x94'),'contactName');_0x18f410['field'](_0xc199('0x7f'));_0x18f410[_0xc199('0x45')](_0xc199('0x95'));_0x18f410[_0xc199('0x45')](_0xc199('0x96'));_0x18f410[_0xc199('0x45')]('i.closed');_0x18f410[_0xc199('0x45')](_0xc199('0x97'));_0x18f410[_0xc199('0x45')](_0xc199('0x98'));_0x18f410['field'](_0xc199('0x99'));_0x18f410[_0xc199('0x45')]('i.lastMsgDirection');_0x18f410[_0xc199('0x45')](_0xc199('0x9a'));_0x18f410[_0xc199('0x45')](_0xc199('0x9b'));_0x18f410['field'](_0xc199('0x9c'));_0x18f410[_0xc199('0x45')]('i.thirdDisposition');_0x18f410['field'](_0xc199('0x9d'));_0x18f410[_0xc199('0x45')](_0xc199('0x9e'));_0x18f410[_0xc199('0x45')](_0xc199('0x9f'));_0x18f410[_0xc199('0x45')](_0xc199('0xa0'));_0x18f410['field'](_0xc199('0xa1'));_0x18f410[_0xc199('0x45')]('c.firstName',_0xc199('0xa2'));_0x18f410[_0xc199('0x45')]('c.lastName',_0xc199('0xa3'));_0x18f410['field'](_0xc199('0xa4'),_0xc199('0xa5'));_0x18f410[_0xc199('0x45')]('c.phone',_0xc199('0xa6'));_0x18f410[_0xc199('0x45')]('c.mobile',_0xc199('0xa7'));_0x18f410['field'](_0xc199('0xa8'),'Contact.fax');_0x18f410[_0xc199('0x45')](_0xc199('0xa9'),_0xc199('0xaa'));_0x18f410['field'](_0xc199('0xab'),_0xc199('0xac'));_0x18f410[_0xc199('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xc199('0x24'));}if(_0x5f1e2e[_0xc199('0x19')])_0x18f410[_0xc199('0x19')](_0x5f1e2e[_0xc199('0x19')]);if(_0x5f1e2e['offset'])_0x18f410[_0xc199('0x16')](_0x5f1e2e['offset']);return db[_0xc199('0x8c')][_0xc199('0x3a')](_0x18f410['toString'](),_0x310c65);})['then'](function(_0x9062df){if(_0x9062df['length']>0x0)_0x10f418['where'](_0xc199('0xad'),_[_0xc199('0x23')](_0x9062df,'id'));return db['sequelize'][_0xc199('0x3a')](_0x10f418[_0xc199('0x8d')](),_0x310c65)[_0xc199('0x1e')](function(_0x2d7790){var _0x291641=_[_0xc199('0xae')](_0x2d7790,_0xc199('0xaf'));var _0x4d4288=[];return db[_0xc199('0xb0')][_0xc199('0xb1')]({'attributes':[_0xc199('0xb2')],'raw':!![]})[_0xc199('0x1e')](function(_0x529a74){var _0x288416=_0x529a74[_0xc199('0xb2')];_0x9062df[_0xc199('0x25')](function(_0x31cfba){_0x4d4288['push'](updateMailInteraction(_0x31cfba,_0x5cf201,_0x291641,_0x288416));});return BPromise[_0xc199('0xb3')](_0x4d4288);});});});})['then'](function(_0x3640db){_0x28346c['rows']=_0x3640db;return _0x28346c;})[_0xc199('0x1e')](respondWithFilteredResult(_0x27d5e4,_0x5f1e2e))[_0xc199('0x2d')](handleError(_0x27d5e4,null));};exports['show']=function(_0x1f3452,_0x2178b1){var _0x500e1f={'raw':![],'where':{'id':_0x1f3452[_0xc199('0xb4')]['id']}},_0x3b8bb0={};_0x3b8bb0[_0xc199('0x39')]=_['keys'](db[_0xc199('0x90')][_0xc199('0x35')]);_0x3b8bb0[_0xc199('0x3a')]=_[_0xc199('0xb5')](_0x1f3452[_0xc199('0x3a')]);_0x3b8bb0['filters']=_[_0xc199('0x3c')](_0x3b8bb0[_0xc199('0x39')],_0x3b8bb0[_0xc199('0x3a')]);_0x500e1f[_0xc199('0x3e')]=_['intersection'](_0x3b8bb0['model'],qs[_0xc199('0x3d')](_0x1f3452[_0xc199('0x3a')]['fields']));_0x500e1f[_0xc199('0x3e')]=_0x500e1f[_0xc199('0x3e')][_0xc199('0x5b')]?_0x500e1f['attributes']:_0x3b8bb0[_0xc199('0x39')];if(_0x1f3452[_0xc199('0x3a')]['includeAll']){_0x500e1f[_0xc199('0xb6')]=[{'all':!![]}];}_0x500e1f=_[_0xc199('0x8f')]({},_0x500e1f,_0x1f3452[_0xc199('0xb7')]);return db['MailInteraction'][_0xc199('0x5c')](_0x500e1f)[_0xc199('0x1e')](handleEntityNotFound(_0x2178b1,null))['then'](respondWithResult(_0x2178b1,null))['catch'](handleError(_0x2178b1,null));};exports[_0xc199('0xb8')]=function(_0x3d421d,_0x15442a){return db[_0xc199('0x90')][_0xc199('0xb8')](_0x3d421d[_0xc199('0xb9')],{})[_0xc199('0x1e')](respondWithResult(_0x15442a,0xc9))['catch'](handleError(_0x15442a,null));};exports[_0xc199('0x1d')]=function(_0x382c83,_0x234008){if(_0x382c83['body']['id']){delete _0x382c83[_0xc199('0xb9')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x382c83[_0xc199('0xb4')]['id']}})[_0xc199('0x1e')](handleEntityNotFound(_0x234008,null))[_0xc199('0x1e')](saveUpdates(_0x382c83[_0xc199('0xb9')],null))['then'](respondWithResult(_0x234008,null))[_0xc199('0x2d')](handleError(_0x234008,null));};exports[_0xc199('0x1f')]=function(_0x18833c,_0x1f8563){return db[_0xc199('0x90')]['find']({'where':{'id':_0x18833c['params']['id']}})[_0xc199('0x1e')](handleEntityNotFound(_0x1f8563,null))[_0xc199('0x1e')](removeEntity(_0x1f8563,null))[_0xc199('0x2d')](handleError(_0x1f8563,null));};exports[_0xc199('0xba')]=function(_0x1aa806,_0x5cc439){return db[_0xc199('0x90')][_0xc199('0xba')]()[_0xc199('0x1e')](respondWithResult(_0x5cc439,null))[_0xc199('0x2d')](handleError(_0x5cc439,null));};exports['addMessage']=function(_0x5092f4,_0x20684a){return db['MailMessage'][_0xc199('0x5c')]({'where':{'id':_0x5092f4[_0xc199('0xb4')]['id']}})[_0xc199('0x1e')](handleEntityNotFound(_0x20684a,null))['then'](function(_0x26ac41){if(_0x26ac41){return _0x26ac41[_0xc199('0xbb')](_0x5092f4[_0xc199('0xb9')][_0xc199('0xbc')],_[_0xc199('0xbd')](_0x5092f4[_0xc199('0xb9')],[_0xc199('0xbc'),'id'])||{});}})[_0xc199('0x1e')](respondWithResult(_0x20684a,null))['catch'](handleError(_0x20684a,null));};exports[_0xc199('0xbe')]=function(_0x1f7673,_0x4e5ff9){var _0x2984c6={'raw':![],'where':{}};var _0x29c3bc={};var _0x55c9e7={'count':0x0,'rows':[]};return db[_0xc199('0x90')][_0xc199('0xb1')]({'where':{'id':_0x1f7673[_0xc199('0xb4')]['id']}})[_0xc199('0x1e')](handleEntityNotFound(_0x4e5ff9,null))[_0xc199('0x1e')](function(_0x23194e){if(_0x23194e){_0x29c3bc[_0xc199('0x39')]=_['keys'](db[_0xc199('0x28')]['rawAttributes']);_0x29c3bc[_0xc199('0x3a')]=_['keys'](_0x1f7673[_0xc199('0x3a')]);_0x29c3bc['filters']=_[_0xc199('0x3c')](_0x29c3bc['model'],_0x29c3bc[_0xc199('0x3a')]);_0x2984c6[_0xc199('0x3e')]=_[_0xc199('0x3c')](_0x29c3bc[_0xc199('0x39')],qs[_0xc199('0x3d')](_0x1f7673[_0xc199('0x3a')][_0xc199('0x3d')]));_0x2984c6[_0xc199('0x3e')]=_0x2984c6[_0xc199('0x3e')][_0xc199('0x5b')]?_0x2984c6[_0xc199('0x3e')]:_0x29c3bc[_0xc199('0x39')];if(!_0x1f7673['query'][_0xc199('0x3f')](_0xc199('0x40'))){_0x2984c6[_0xc199('0x19')]=qs[_0xc199('0x19')](_0x1f7673[_0xc199('0x3a')][_0xc199('0x19')]);_0x2984c6[_0xc199('0x16')]=qs['offset'](_0x1f7673['query'][_0xc199('0x16')]);}_0x2984c6[_0xc199('0x41')]=qs['sort'](_0x1f7673[_0xc199('0x3a')][_0xc199('0x42')]);_0x2984c6[_0xc199('0x71')]=qs[_0xc199('0x3b')](_[_0xc199('0x43')](_0x1f7673['query'],_0x29c3bc[_0xc199('0x3b')]));_0x2984c6[_0xc199('0x71')][_0xc199('0xaf')]=_0x23194e['id'];if(_0x1f7673[_0xc199('0x3a')]['filter']){_0x2984c6[_0xc199('0x71')]=_[_0xc199('0x8f')](_0x2984c6['where'],{'$or':_[_0xc199('0x23')](_0x2984c6[_0xc199('0x3e')],function(_0x514dbb){var _0xbec522={};_0xbec522[_0x514dbb]={'$like':'%'+_0x1f7673[_0xc199('0x3a')][_0xc199('0x7a')]+'%'};return _0xbec522;})});}if(_0x1f7673[_0xc199('0x3a')]['$gte']){var _0x3265eb=_0x1f7673[_0xc199('0x3a')][_0xc199('0x74')][_0xc199('0x63')](',');var _0x2ac2dd={};_0x2ac2dd[_0x3265eb[0x0]]={'$gte':moment(_0x3265eb[0x1])[_0xc199('0xbf')](_0xc199('0xc0'))};_0x2984c6[_0xc199('0x71')]=_[_0xc199('0x8f')](_0x2984c6['where'],_0x2ac2dd);}_0x2984c6=_['merge']({},_0x2984c6,_0x1f7673[_0xc199('0xb7')]);return db[_0xc199('0x28')][_0xc199('0x18')]({'where':_0x2984c6['where']})[_0xc199('0x1e')](function(_0x389d2c){_0x55c9e7[_0xc199('0x18')]=_0x389d2c;if(_0x1f7673['query'][_0xc199('0xc1')]){_0x2984c6[_0xc199('0xb6')]=[{'all':!![]}];}return db[_0xc199('0x28')][_0xc199('0xc2')](_0x2984c6);})[_0xc199('0x1e')](function(_0x3386a9){if(_0x1f7673['query'][_0xc199('0xc3')]===_0xc199('0xc4')){for(var _0x179dc4=0x0;_0x179dc4<_0x3386a9['length'];_0x179dc4++){_0x3386a9[_0x179dc4]['body']=juice(_0x3386a9[_0x179dc4]['body']);}}_0x55c9e7[_0xc199('0xc5')]=_0x3386a9;return _0x55c9e7;});}})['then'](respondWithFilteredResult(_0x4e5ff9,_0x2984c6))[_0xc199('0x2d')](handleError(_0x4e5ff9,null));};exports[_0xc199('0xc6')]=function(_0x2dff6a,_0x44f0b8){return db[_0xc199('0x90')][_0xc199('0x5c')]({'where':{'id':_0x2dff6a[_0xc199('0xb4')]['id']}})[_0xc199('0x1e')](handleEntityNotFound(_0x44f0b8,null))[_0xc199('0x1e')](function(_0x1d969a){if(_0x1d969a){return _0x1d969a[_0xc199('0xc7')](_0x2dff6a[_0xc199('0xb9')][_0xc199('0xbc')],_[_0xc199('0xbd')](_0x2dff6a[_0xc199('0xb9')],[_0xc199('0xbc'),'id'])||{})[_0xc199('0xc8')](function(){return db[_0xc199('0xc9')][_0xc199('0xc2')]({'attributes':['id','name',_0xc199('0x46')],'where':{'id':_0x2dff6a[_0xc199('0xb9')][_0xc199('0xbc')]}});})[_0xc199('0x1e')](function(_0x1bec26){socket['emit'](_0xc199('0xca'),{'id':Number(_0x2dff6a[_0xc199('0xb4')]['id']),'tags':_0x1bec26||[]});return{'id':Number(_0x2dff6a[_0xc199('0xb4')]['id']),'tags':_0x1bec26||[]};});}})['then'](respondWithResult(_0x44f0b8,null))[_0xc199('0x2d')](handleError(_0x44f0b8,null));};exports['removeTags']=function(_0x21010b,_0x30590a){return db[_0xc199('0x90')][_0xc199('0x5c')]({'where':{'id':_0x21010b[_0xc199('0xb4')]['id']}})[_0xc199('0x1e')](handleEntityNotFound(_0x30590a,null))[_0xc199('0x1e')](function(_0x144b9b){if(_0x144b9b){return _0x144b9b[_0xc199('0xcb')](_0x21010b['query'][_0xc199('0xbc')]);}})[_0xc199('0x1e')](respondWithStatusCode(_0x30590a,null))['catch'](handleError(_0x30590a,null));};exports[_0xc199('0xcc')]=function(_0x34d909,_0x3dc828){var _0x14893d=moment()[_0xc199('0xcd')]()[_0xc199('0x8d')]();var _0x1901b2=path[_0xc199('0xce')](config['root'],_0xc199('0xcf'),_0xc199('0xd0'),'tmp');var _0x3adb26=path[_0xc199('0xce')](config[_0xc199('0xd1')],_0xc199('0xcf'),_0xc199('0xd0'),'attachments');var _0x4ed131=path['join'](_0x1901b2,_0x14893d);var _0x3f22c6=util[_0xc199('0xbf')](_0xc199('0xd2'),_0x34d909[_0xc199('0xb4')]['id'],_0x14893d);var _0x4a2653=path[_0xc199('0xce')](_0x1901b2,_0x3f22c6);var _0x5f0a66=[];if(_0x34d909['query'][_0xc199('0xd3')]){_0x5f0a66[_0xc199('0x27')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0xff54f7=[{'model':db[_0xc199('0x28')],'as':_0xc199('0xd4'),'attributes':['id',_0xc199('0xb9'),_0xc199('0x47'),'to','cc','bcc','subject',_0xc199('0xd5')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x5f0a66}];return db[_0xc199('0x90')]['find']({'where':{'id':_0x34d909[_0xc199('0xb4')]['id']},'include':_0xff54f7})['then'](handleEntityNotFound(_0x3dc828,null))['then'](function(_0x2fcf4a){if(_0x2fcf4a&&_0x2fcf4a[_0xc199('0xd4')]){var _0xf1e053=_0x2fcf4a['get']({'plain':!![]});fs['mkdirSync'](_0x4ed131);return BPromise[_0xc199('0xd6')](_0xf1e053[_0xc199('0xd4')],function(_0x660732,_0x4e3b5b){var _0x3d2b2d={'from':_0x660732[_0xc199('0x47')],'to':_0x660732['to'],'subject':_0x660732[_0xc199('0xd7')],'html':htmlEntities['decode'](_0x660732[_0xc199('0xb9')]),'headers':{'Date':moment(_0x660732[_0xc199('0xd5')])['format'](_0xc199('0xd8'))},'attachments':[]};if(_0x660732['cc']){_0x3d2b2d[_0xc199('0xd9')]['Cc']=_0x660732['cc'];}if(_0x660732[_0xc199('0xda')]){_0x3d2b2d[_0xc199('0xd9')][_0xc199('0xdb')]=_0x660732[_0xc199('0xda')];}return new BPromise(function(_0x5698b8,_0x3d80ad){if(_0x660732['Attachments']){for(var _0x4263f1=0x0;_0x4263f1<_0x660732[_0xc199('0xdc')]['length'];_0x4263f1++){var _0x427daf=_0x660732[_0xc199('0xdc')][_0x4263f1];var _0x508815=path[_0xc199('0xce')](_0x3adb26,_0x427daf['basename']);if(fs[_0xc199('0xdd')](_0x508815)){_0x3d2b2d['attachments'][_0xc199('0x27')]({'name':_0x427daf[_0xc199('0x21')],'contentType':_0x427daf[_0xc199('0x37')],'data':fs[_0xc199('0xde')](_0x508815)});}}}emlformat[_0xc199('0xdf')](_0x3d2b2d,function(_0x5ceed4,_0x3c3351){if(_0x5ceed4)return _0x3d80ad(_0x5ceed4);fs[_0xc199('0xe0')](path[_0xc199('0xce')](_0x4ed131,util['format'](_0xc199('0xe1'),_0x4e3b5b)),_0x3c3351);return _0x5698b8(_0x3c3351);});});})[_0xc199('0x1e')](function(){return new BPromise(function(_0x2f7353,_0x44dc59){zipdir(_0x4ed131,{'saveTo':_0x4a2653},function(_0x214d61,_0x4cb00c){if(_0x214d61)return _0x44dc59(_0x214d61);return _0x2f7353(_0x4cb00c);});})[_0xc199('0x1e')](function(){return new BPromise(function(_0x441ba4,_0x559226){rimraf(_0x4ed131,function(_0x54b222){if(_0x54b222)_0x559226(_0x54b222);return _0x441ba4();});});})[_0xc199('0x1e')](function(){return _0x3dc828[_0xc199('0xcc')](_0x4a2653,_0x3f22c6,function(_0x5b4974){if(!_0x5b4974)fs[_0xc199('0xe2')](_0x4a2653);});});});}else{return _0x3dc828['sendStatus'](0xc8);}})[_0xc199('0x2d')](handleError(_0x3dc828,null));}; \ No newline at end of file +var _0xf8af=['search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','buildExpression','type','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\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','SELECT','order','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.subject','i.substatus','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','push','all','rows','show','params','includeAll','include','merge','options','create','body','update','describe','addMessage','ids','omit','pick','MailInteractionId','format','findAll','true','addTags','setTags','Tag','color','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','Attachment','Attachments','Messages','bcc','subject','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','writeFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','util','lodash','squel','juice','ioredis','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','offset','count','set','json','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','MailMessage','findOne','plainBody','-id','lastMsgText','catch','waiting','talking','answered','unmanaged','total','closed','UserId','MailInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','sort','where','field','from','tools_tags','select','u.id','u.fullname','ui.MailInteractionId','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr'];(function(_0x279b01,_0x4ee19c){var _0x306e43=function(_0x208770){while(--_0x208770){_0x279b01['push'](_0x279b01['shift']());}};_0x306e43(++_0x4ee19c);}(_0xf8af,0x8b));var _0xff8a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf8af[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var moment=require(_0xff8a('0x2'));var BPromise=require(_0xff8a('0x3'));var util=require(_0xff8a('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xff8a('0x5'));var squel=require(_0xff8a('0x6'));var juice=require(_0xff8a('0x7'));var Redis=require(_0xff8a('0x8'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xff8a('0x9'))('api');var config=require(_0xff8a('0xa'));var db=require(_0xff8a('0xb'))['db'];var htmlEntities=require(_0xff8a('0xc'));config[_0xff8a('0xd')]=_[_0xff8a('0xe')](config[_0xff8a('0xd')],{'host':_0xff8a('0xf'),'port':0x18eb});var socket=require(_0xff8a('0x10'))(new Redis(config[_0xff8a('0xd')]));require(_0xff8a('0x11'))[_0xff8a('0x12')](socket);function respondWithStatusCode(_0x5a31cb,_0x3d7e93){_0x3d7e93=_0x3d7e93||0xcc;return function(_0x437fc8){if(_0x437fc8){return _0x5a31cb[_0xff8a('0x13')](_0x3d7e93);}return _0x5a31cb['status'](_0x3d7e93)[_0xff8a('0x14')]();};}function respondWithResult(_0x35eca7,_0x252271){_0x252271=_0x252271||0xc8;return function(_0x40bf06){if(_0x40bf06){return _0x35eca7[_0xff8a('0x15')](_0x252271)['json'](_0x40bf06);}};}function respondWithFilteredResult(_0x2e72a7,_0x4236c5){return function(_0xf81533){if(_0xf81533){var _0x1cd47d=typeof _0x4236c5['offset']==='undefined'&&typeof _0x4236c5['limit']==='undefined';var _0x2f83df=_0xf81533['count'];var _0x279441=_0x1cd47d?0x0:_0x4236c5[_0xff8a('0x16')];var _0x4e98b0=_0x1cd47d?_0xf81533[_0xff8a('0x17')]:_0x4236c5['offset']+_0x4236c5['limit'];var _0x392f43;if(_0x4e98b0>=_0x2f83df){_0x4e98b0=_0x2f83df;_0x392f43=0xc8;}else{_0x392f43=0xce;}_0x2e72a7[_0xff8a('0x15')](_0x392f43);return _0x2e72a7[_0xff8a('0x18')]('Content-Range',_0x279441+'-'+_0x4e98b0+'/'+_0x2f83df)[_0xff8a('0x19')](_0xf81533);}return null;};}function saveUpdates(_0x5c4349){return function(_0x1d3767){if(_0x1d3767){return _0x1d3767['update'](_0x5c4349)[_0xff8a('0x1a')](function(_0x1b4272){return _0x1b4272;});}return null;};}function removeEntity(_0x794015){return function(_0xdb1027){if(_0xdb1027){return _0xdb1027[_0xff8a('0x1b')]()[_0xff8a('0x1a')](function(){_0x794015[_0xff8a('0x15')](0xcc)[_0xff8a('0x14')]();});}};}function handleEntityNotFound(_0xead978){return function(_0xe2ed2b){if(!_0xe2ed2b){_0xead978[_0xff8a('0x13')](0x194);}return _0xe2ed2b;};}function handleError(_0x2d0fc2,_0x3bb4ac){_0x3bb4ac=_0x3bb4ac||0x1f4;return function(_0x1d9a9b){logger[_0xff8a('0x1c')](_0x1d9a9b['stack']);if(_0x1d9a9b[_0xff8a('0x1d')]){delete _0x1d9a9b[_0xff8a('0x1d')];}_0x2d0fc2[_0xff8a('0x15')](_0x3bb4ac)[_0xff8a('0x1e')](_0x1d9a9b);};}function getInteractionUsers(_0x518d33,_0x2370f1){return new BPromise(function(_0x49b441,_0x1c9ecc){try{if(_0x2370f1[_0x518d33['id']]){_0x518d33[_0xff8a('0x1f')]=_[_0xff8a('0x20')](_0x2370f1[_0x518d33['id']],function(_0x3fdce3){return{'id':_0x3fdce3['id'],'fullname':_0x3fdce3[_0xff8a('0x21')]};});}}catch(_0x55b267){_0x1c9ecc(_0x55b267);}_0x49b441(_0x518d33);});}function getInteractionTags(_0x2c57c9,_0x178f73){return new BPromise(function(_0x3063b1,_0x5153f6){try{if(_0x2c57c9[_0xff8a('0x22')]){_0x2c57c9[_0xff8a('0x23')]=[];_0x2c57c9[_0xff8a('0x22')][_0xff8a('0x24')](',')[_0xff8a('0x25')](function(_0xba33b6){_0x2c57c9[_0xff8a('0x23')]['push'](_0x178f73[_0xba33b6]);});}delete _0x2c57c9['TagIds'];}catch(_0x1fc2a8){_0x5153f6(_0x1fc2a8);}_0x3063b1(_0x2c57c9);});}function getLastMessageText(_0x3849df){return new BPromise(function(_0x15d5c2,_0x279347){return db[_0xff8a('0x26')][_0xff8a('0x27')]({'where':{'$and':[{'MailInteractionId':_0x3849df['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xff8a('0x28')],'order':_0xff8a('0x29'),'raw':!![]})['then'](function(_0x422410){if(_0x422410&&_0x422410[_0xff8a('0x28')]){_0x3849df[_0xff8a('0x2a')]=_['trimStart'](_0x422410[_0xff8a('0x28')]);}_0x15d5c2(_0x3849df);})[_0xff8a('0x2b')](function(_0x5a1c84){_0x279347(_0x5a1c84);});});}function updateMailInteraction(_0x231d1c,_0x37d035,_0x3ad597,_0x3355db){return new BPromise(function(_0x203546,_0x3b90be){return getInteractionUsers(_0x231d1c,_0x3ad597)[_0xff8a('0x1a')](function(_0x3b894e){return getInteractionTags(_0x3b894e,_0x37d035);})[_0xff8a('0x1a')](function(_0x4dff27){return getStateInteraction(_0x4dff27);})[_0xff8a('0x1a')](function(_0x1330ea){if(_0x3355db){_0x203546(getLastMessageText(_0x1330ea));}else{_0x203546(_0x1330ea);}})['catch'](function(_0x2e3829){_0x3b90be(_0x2e3829);});});}function getStateInteraction(_0x3a82c2){return new BPromise(function(_0xfc4000){_0x3a82c2[_0xff8a('0x2c')]=0x0;_0x3a82c2[_0xff8a('0x2d')]=0x0;_0x3a82c2[_0xff8a('0x2e')]=0x0;_0x3a82c2[_0xff8a('0x2f')]=0x0;_0x3a82c2[_0xff8a('0x30')]=0x0;if(!_0x3a82c2[_0xff8a('0x31')]&&!_0x3a82c2['UserId']){_0x3a82c2['waiting']+=0x1;}if(!_0x3a82c2[_0xff8a('0x31')]&&_0x3a82c2[_0xff8a('0x32')]){_0x3a82c2['talking']+=0x1;if(_0x3a82c2[_0xff8a('0x2c')]){_0x3a82c2[_0xff8a('0x2c')]-=0x1;}}if(_0x3a82c2['closed']&&_0x3a82c2['UserId']){_0x3a82c2['answered']+=0x1;if(_0x3a82c2[_0xff8a('0x2d')]){_0x3a82c2[_0xff8a('0x2d')]-=0x1;}}if(_0x3a82c2['closed']&&!_0x3a82c2[_0xff8a('0x32')]){_0x3a82c2[_0xff8a('0x2f')]+=0x1;if(_0x3a82c2[_0xff8a('0x2c')]){_0x3a82c2['waiting']-=0x1;}}_0x3a82c2[_0xff8a('0x30')]+=0x1;_0xfc4000(_0x3a82c2);});}exports['index']=function(_0x2e7ac7,_0x128936){var _0x5ed49e={},_0x3769b3={},_0x5c1bea={'count':0x0,'rows':[]};var _0x4c263e=_[_0xff8a('0x20')](db[_0xff8a('0x33')][_0xff8a('0x34')],function(_0x4291c3){return{'name':_0x4291c3[_0xff8a('0x35')],'type':_0x4291c3['type'][_0xff8a('0x36')]};});_0x3769b3['model']=_[_0xff8a('0x20')](_0x4c263e,_0xff8a('0x1d'));_0x3769b3[_0xff8a('0x37')]=_[_0xff8a('0x38')](_0x2e7ac7[_0xff8a('0x37')]);_0x3769b3[_0xff8a('0x39')]=_[_0xff8a('0x3a')](_0x3769b3['model'],_0x3769b3[_0xff8a('0x37')]);_0x5ed49e[_0xff8a('0x3b')]=_[_0xff8a('0x3a')](_0x3769b3[_0xff8a('0x3c')],qs[_0xff8a('0x3d')](_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x3d')]));_0x5ed49e[_0xff8a('0x3b')]=_0x5ed49e[_0xff8a('0x3b')]['length']?_0x5ed49e[_0xff8a('0x3b')]:_0x3769b3['model'];if(!_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x3e')](_0xff8a('0x3f'))){_0x5ed49e[_0xff8a('0x40')]=qs[_0xff8a('0x40')](_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x40')]);_0x5ed49e[_0xff8a('0x16')]=qs[_0xff8a('0x16')](_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x16')]);}_0x5ed49e['order']=qs[_0xff8a('0x41')](_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x41')]);_0x5ed49e[_0xff8a('0x42')]=qs[_0xff8a('0x39')](_['pick'](_0x2e7ac7[_0xff8a('0x37')],_0x3769b3[_0xff8a('0x39')]),_0x4c263e);var _0x21ef6d=[];var _0x579664=squel['select']()[_0xff8a('0x43')]('id')[_0xff8a('0x43')](_0xff8a('0x1d'))[_0xff8a('0x43')]('color')[_0xff8a('0x44')](_0xff8a('0x45'));var _0x342873=squel[_0xff8a('0x46')]()[_0xff8a('0x43')](_0xff8a('0x47'))[_0xff8a('0x43')](_0xff8a('0x48'))[_0xff8a('0x43')](_0xff8a('0x49'))[_0xff8a('0x44')]('user_has_mail_interactions','ui')[_0xff8a('0x4a')](_0xff8a('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x1a7973=squel[_0xff8a('0x46')]()['from'](_0xff8a('0x4c'),'i')[_0xff8a('0x4a')](_0xff8a('0x4d'),'c',_0xff8a('0x4e'))[_0xff8a('0x4a')](_0xff8a('0x4b'),'o',_0xff8a('0x4f'))[_0xff8a('0x4a')](_0xff8a('0x50'),'a',_0xff8a('0x51'))[_0xff8a('0x4a')](_0xff8a('0x52'),'me',_0xff8a('0x53'))[_0xff8a('0x4a')]('mail_interaction_has_tags','it',_0xff8a('0x54'))[_0xff8a('0x4a')](_0xff8a('0x45'),'t','t.id\x20=\x20it.TagId');var _0x3b52d0=squel[_0xff8a('0x55')]();var _0x2c274b=[];var _0xb2eea9=squel[_0xff8a('0x55')]();var _0x8cd263;if(_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x56')]){_0x8cd263=as[_0xff8a('0x57')](_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x56')]);var _0x54240e=_0x8cd263[_0xff8a('0x58')];for(var _0xfec238=0x0;_0xfec238<_0x8cd263[_0xff8a('0x59')][_0xff8a('0x5a')];_0xfec238++){var _0x139be3=_0x8cd263[_0xff8a('0x59')][_0xfec238];var _0x1534f1='i';var _0x5b77f8=_[_0xff8a('0x5b')](_0x4c263e,[_0xff8a('0x1d'),_0x139be3['field']]);if(!_0x5b77f8){switch(_0x139be3[_0xff8a('0x43')]){case _0xff8a('0x5c'):if(_0x139be3[_0xff8a('0x5d')]==0x1){_0x1a7973[_0xff8a('0x5e')]('`'+_0x139be3[_0xff8a('0x43')]+_0xff8a('0x5f'));}else{_0x1a7973[_0xff8a('0x5e')]('`'+_0x139be3['field']+_0xff8a('0x60'));}break;case'Contact':if(_0x139be3[_0xff8a('0x61')]===_0xff8a('0x62')){if(_0x139be3[_0xff8a('0x5d')]['split']('\x20')[_0xff8a('0x5a')]>0x1){_0x3b52d0[_0x54240e](_0xff8a('0x63'),qs[_0xff8a('0x64')](_0x139be3[_0xff8a('0x5d')]),null);}else{var _0x2e9675='%'+_0x139be3[_0xff8a('0x5d')]+'%';_0x3b52d0[_0x54240e](_0xff8a('0x65'),_0x2e9675,_0x2e9675,_0x2e9675);}}else{_0x5b77f8=_['find'](_0x4c263e,[_0xff8a('0x1d'),'ContactId']);_0x139be3[_0xff8a('0x43')]=_0xff8a('0x66');_0x143b12=as['buildExpression'](_0x1534f1,_0x5b77f8['type'],_0x139be3);_0x3b52d0[_0x54240e](_0x143b12[_0xff8a('0x67')],_0x143b12[_0xff8a('0x5d')][_0xff8a('0x68')],_0x143b12['value'][_0xff8a('0x14')]);}break;case'Tag':var _0x3fcd5d=_0x139be3[_0xff8a('0x5d')][_0xff8a('0x24')](',')['map'](function(_0x57410a){return Number(_0x57410a);});_0x3fcd5d[_0xff8a('0x25')](function(_0x1aca5e){_0xb2eea9['or'](_0xff8a('0x69'),'%,'+_0x1aca5e+',%');});_0x2c274b=_[_0xff8a('0x6a')](_0x2c274b,_0x3fcd5d);break;case'User':if(_0x139be3[_0xff8a('0x61')]===_0xff8a('0x62')){_0x3b52d0[_0x54240e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x139be3[_0xff8a('0x5d')]+'%',null);}else{_0x5b77f8=_['find'](_0x4c263e,[_0xff8a('0x1d'),_0xff8a('0x32')]);_0x139be3[_0xff8a('0x43')]=_0xff8a('0x32');_0x143b12=as[_0xff8a('0x6b')](_0x1534f1,_0x5b77f8['type'],_0x139be3);_0x3b52d0[_0x54240e](_0x143b12[_0xff8a('0x67')],_0x143b12[_0xff8a('0x5d')]['start'],_0x143b12['value'][_0xff8a('0x14')]);}break;case _0xff8a('0x28'):_0x143b12=as['buildExpression']('me',null,_0x139be3);_0x3b52d0[_0x54240e](_0x143b12['text'],_0x143b12[_0xff8a('0x5d')]['start'],_0x143b12[_0xff8a('0x5d')][_0xff8a('0x14')]);break;}}else{var _0x143b12=as[_0xff8a('0x6b')](_0x1534f1,_0x5b77f8[_0xff8a('0x6c')],_0x139be3);_0x3b52d0[_0x54240e](_0x143b12[_0xff8a('0x67')],_0x143b12[_0xff8a('0x5d')][_0xff8a('0x68')],_0x143b12[_0xff8a('0x5d')][_0xff8a('0x14')]);}}}else{var _0x182026=_(_0x2e7ac7['query'])[_0xff8a('0x38')]()[_0xff8a('0x20')](function(_0x3df16f){return _['some'](_0x4c263e,[_0xff8a('0x1d'),_0x3df16f])?_0x3df16f:undefined;})[_0xff8a('0x6d')]()['value']();if(!_[_0xff8a('0x6e')](_0x182026)){_0x182026['forEach'](function(_0x19d9a0){if(_0x19d9a0===_0xff8a('0x6f')){_0x1a7973[_0xff8a('0x42')](_0xff8a('0x70'),[][_0xff8a('0x71')](_0x2e7ac7[_0xff8a('0x37')][_0x19d9a0]));}else if(_0x19d9a0===_0xff8a('0x72')){var _0x397197=JSON[_0xff8a('0x73')](_0x2e7ac7['query'][_0x19d9a0])[_0xff8a('0x74')];var _0x22caf3=JSON[_0xff8a('0x73')](_0x2e7ac7[_0xff8a('0x37')][_0x19d9a0])['$lte'];_0x1a7973[_0xff8a('0x42')](_0xff8a('0x75'),_0x397197,_0x22caf3);}else{if(_0x2e7ac7[_0xff8a('0x37')][_0x19d9a0]===_0xff8a('0x76')){_0x1a7973[_0xff8a('0x42')]('i.'+_0x19d9a0+_0xff8a('0x77'));}else{_0x1a7973[_0xff8a('0x42')]('i.'+_0x19d9a0+_0xff8a('0x78'),_0x2e7ac7[_0xff8a('0x37')][_0x19d9a0]);}}});}if(_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x79')]){if(_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x79')]==0x1){_0x1a7973[_0xff8a('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x1a7973['having'](_0xff8a('0x7a'));}}if(_0x2e7ac7[_0xff8a('0x37')]['tag']){_0x2c274b=_[_0xff8a('0x7b')](_0x2e7ac7[_0xff8a('0x37')]['tag'])?_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x7c')]:new Array(_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x7c')]);_0x2c274b[_0xff8a('0x25')](function(_0xa7f21c){_0xb2eea9['or'](_0xff8a('0x69'),'%,'+_0xa7f21c+',%');});}if(_0x2e7ac7['query'][_0xff8a('0x7d')]){var _0x43cc0e=_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x7d')][_0xff8a('0x7e')]('\x5c','\x5c\x5c')[_0xff8a('0x7e')](/'/g,'\x27\x27');if(qs[_0xff8a('0x7f')](_0x43cc0e)){_0x3b52d0['or'](_0xff8a('0x80'),_0x43cc0e+'%');}else if(qs['isEmail'](_0x43cc0e)){_0x3b52d0['or']('c.email\x20LIKE\x20?',_0x43cc0e+'%');}else{_0x3b52d0['or'](_0xff8a('0x81'),qs[_0xff8a('0x64')](_0x43cc0e))['or'](_0xff8a('0x82'),qs[_0xff8a('0x64')](_0x43cc0e));}}}_0x1a7973['where'](_0x3b52d0);_0x1a7973[_0xff8a('0x83')](_0xff8a('0x84'));var _0x5667dc={'type':db['Sequelize']['QueryTypes'][_0xff8a('0x85')],'raw':!![]};var _0x4b8abb=_0x1a7973['clone']();_0x4b8abb[_0xff8a('0x43')](_0xff8a('0x84'));_0x4b8abb['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xff8a('0x5c'));if(_0x5ed49e[_0xff8a('0x86')]){_0x5ed49e[_0xff8a('0x86')][_0xff8a('0x25')](function(_0x55caa2){var _0x44d4c7=_0x55caa2[0x0]==='contactName'?_0x55caa2[0x0]:'i.'+_0x55caa2[0x0];_0x1a7973[_0xff8a('0x86')](_0x44d4c7,_0x55caa2[0x1]===_0xff8a('0x87')?![]:!![]);});}if(!_[_0xff8a('0x6e')](_0x2c274b)){_0x1a7973[_0xff8a('0x5e')](_0xb2eea9);_0x4b8abb[_0xff8a('0x42')]('t.id\x20IN\x20?',_0x2c274b);}BPromise[_0xff8a('0x88')]()['then'](function(){if(!_0x8cd263){if(_0x2e7ac7['query'][_0xff8a('0x6f')])return;_0x4b8abb[_0xff8a('0x42')](_0xff8a('0x89'));_0x1a7973[_0xff8a('0x42')](_0xff8a('0x89'));return;}if(_0x2e7ac7[_0xff8a('0x8a')][_0xff8a('0x8b')]!==_0xff8a('0x8c'))return;return _0x2e7ac7[_0xff8a('0x8a')][_0xff8a('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4bbb86){if(_[_0xff8a('0x6e')](_0x4bbb86)){_0x4b8abb[_0xff8a('0x42')](_0xff8a('0x8e'));_0x1a7973[_0xff8a('0x42')](_0xff8a('0x8e'));}else{_0x4b8abb[_0xff8a('0x42')](_0xff8a('0x70'),_[_0xff8a('0x20')](_0x4bbb86,'id'));_0x1a7973[_0xff8a('0x42')]('i.MailAccountId\x20IN\x20?',_[_0xff8a('0x20')](_0x4bbb86,'id'));}});})[_0xff8a('0x1a')](function(){if(_0x2e7ac7[_0xff8a('0x8a')][_0xff8a('0x8b')]==='agent'&&!_0x8cd263&&!_0x2e7ac7['query'][_0xff8a('0x6f')])return[];return db['sequelize'][_0xff8a('0x37')](_0x4b8abb[_0xff8a('0x8f')](),_0x5667dc);})[_0xff8a('0x1a')](function(_0x2510dc){_0x5c1bea['count']=_0x2510dc[_0xff8a('0x5a')];if(_0x5c1bea[_0xff8a('0x17')]===0x0)return[];return db['sequelize']['query'](_0x579664[_0xff8a('0x8f')](),_0x5667dc)[_0xff8a('0x1a')](function(_0x23994e){_0x21ef6d=_[_0xff8a('0x90')](_0x23994e,'id');_0x5667dc=_['merge'](_0x5667dc,{'model':db[_0xff8a('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e7ac7[_0xff8a('0x37')][_0xff8a('0x3d')]){_0x5ed49e[_0xff8a('0x3b')][_0xff8a('0x25')](function(_0x5a3919){_0x1a7973[_0xff8a('0x43')]('i.'+_0x5a3919);});}else{_0x1a7973[_0xff8a('0x43')](_0xff8a('0x91'),'unreadMessages');_0x1a7973[_0xff8a('0x43')](_0xff8a('0x92'),'Account.key');_0x1a7973[_0xff8a('0x43')]('a.mandatoryDisposition',_0xff8a('0x93'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x94'),_0xff8a('0x95'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x84'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x96'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x97'));_0x1a7973[_0xff8a('0x43')]('i.closed');_0x1a7973['field'](_0xff8a('0x98'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x99'));_0x1a7973[_0xff8a('0x43')]('i.lastMsgAt');_0x1a7973[_0xff8a('0x43')]('i.lastMsgDirection');_0x1a7973[_0xff8a('0x43')](_0xff8a('0x9a'));_0x1a7973[_0xff8a('0x43')]('i.disposition');_0x1a7973[_0xff8a('0x43')]('i.secondDisposition');_0x1a7973[_0xff8a('0x43')]('i.thirdDisposition');_0x1a7973[_0xff8a('0x43')](_0xff8a('0x9b'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x9c'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x9d'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0x9e'));_0x1a7973[_0xff8a('0x43')]('i.UserId');_0x1a7973[_0xff8a('0x43')](_0xff8a('0x9f'),'Contact.firstName');_0x1a7973[_0xff8a('0x43')]('c.lastName',_0xff8a('0xa0'));_0x1a7973['field'](_0xff8a('0xa1'),_0xff8a('0xa2'));_0x1a7973['field'](_0xff8a('0xa3'),_0xff8a('0xa4'));_0x1a7973[_0xff8a('0x43')](_0xff8a('0xa5'),'Contact.mobile');_0x1a7973[_0xff8a('0x43')](_0xff8a('0xa6'),'Contact.fax');_0x1a7973[_0xff8a('0x43')](_0xff8a('0xa7'),'Owner.fullname');_0x1a7973[_0xff8a('0x43')](_0xff8a('0xa8'),_0xff8a('0xa9'));_0x1a7973['field'](_0xff8a('0xaa'),'TagIds');}if(_0x5ed49e['limit'])_0x1a7973[_0xff8a('0x40')](_0x5ed49e[_0xff8a('0x40')]);if(_0x5ed49e['offset'])_0x1a7973['offset'](_0x5ed49e['offset']);return db[_0xff8a('0xab')][_0xff8a('0x37')](_0x1a7973[_0xff8a('0x8f')](),_0x5667dc);})[_0xff8a('0x1a')](function(_0xc1d78){if(_0xc1d78[_0xff8a('0x5a')]>0x0)_0x342873[_0xff8a('0x42')](_0xff8a('0xac'),_['map'](_0xc1d78,'id'));return db[_0xff8a('0xab')][_0xff8a('0x37')](_0x342873[_0xff8a('0x8f')](),_0x5667dc)[_0xff8a('0x1a')](function(_0x5ae102){var _0x55a003=_[_0xff8a('0xad')](_0x5ae102,'MailInteractionId');var _0x14f280=[];return db[_0xff8a('0xae')][_0xff8a('0x27')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xff8a('0x1a')](function(_0x27e158){var _0x4cbb77=_0x27e158[_0xff8a('0xaf')];_0xc1d78[_0xff8a('0x25')](function(_0x3aede0){_0x14f280[_0xff8a('0xb0')](updateMailInteraction(_0x3aede0,_0x21ef6d,_0x55a003,_0x4cbb77));});return BPromise[_0xff8a('0xb1')](_0x14f280);});});});})[_0xff8a('0x1a')](function(_0x508189){_0x5c1bea[_0xff8a('0xb2')]=_0x508189;return _0x5c1bea;})[_0xff8a('0x1a')](respondWithFilteredResult(_0x128936,_0x5ed49e))['catch'](handleError(_0x128936,null));};exports[_0xff8a('0xb3')]=function(_0x1e9ffa,_0xd4ec24){var _0x545cb1={'raw':![],'where':{'id':_0x1e9ffa[_0xff8a('0xb4')]['id']}},_0x34efdb={};_0x34efdb[_0xff8a('0x3c')]=_[_0xff8a('0x38')](db[_0xff8a('0x33')]['rawAttributes']);_0x34efdb['query']=_[_0xff8a('0x38')](_0x1e9ffa[_0xff8a('0x37')]);_0x34efdb['filters']=_[_0xff8a('0x3a')](_0x34efdb[_0xff8a('0x3c')],_0x34efdb[_0xff8a('0x37')]);_0x545cb1[_0xff8a('0x3b')]=_[_0xff8a('0x3a')](_0x34efdb['model'],qs['fields'](_0x1e9ffa[_0xff8a('0x37')][_0xff8a('0x3d')]));_0x545cb1[_0xff8a('0x3b')]=_0x545cb1[_0xff8a('0x3b')][_0xff8a('0x5a')]?_0x545cb1['attributes']:_0x34efdb[_0xff8a('0x3c')];if(_0x1e9ffa[_0xff8a('0x37')][_0xff8a('0xb5')]){_0x545cb1[_0xff8a('0xb6')]=[{'all':!![]}];}_0x545cb1=_[_0xff8a('0xb7')]({},_0x545cb1,_0x1e9ffa[_0xff8a('0xb8')]);return db[_0xff8a('0x33')][_0xff8a('0x5b')](_0x545cb1)[_0xff8a('0x1a')](handleEntityNotFound(_0xd4ec24,null))[_0xff8a('0x1a')](respondWithResult(_0xd4ec24,null))[_0xff8a('0x2b')](handleError(_0xd4ec24,null));};exports[_0xff8a('0xb9')]=function(_0x483094,_0x3ed9fd){return db[_0xff8a('0x33')][_0xff8a('0xb9')](_0x483094[_0xff8a('0xba')],{})[_0xff8a('0x1a')](respondWithResult(_0x3ed9fd,0xc9))[_0xff8a('0x2b')](handleError(_0x3ed9fd,null));};exports[_0xff8a('0xbb')]=function(_0x345cfe,_0x40ef95){if(_0x345cfe['body']['id']){delete _0x345cfe[_0xff8a('0xba')]['id'];}return db['MailInteraction'][_0xff8a('0x5b')]({'where':{'id':_0x345cfe[_0xff8a('0xb4')]['id']}})[_0xff8a('0x1a')](handleEntityNotFound(_0x40ef95,null))[_0xff8a('0x1a')](saveUpdates(_0x345cfe['body'],null))['then'](respondWithResult(_0x40ef95,null))[_0xff8a('0x2b')](handleError(_0x40ef95,null));};exports['destroy']=function(_0x2b7830,_0x21973a){return db[_0xff8a('0x33')]['find']({'where':{'id':_0x2b7830[_0xff8a('0xb4')]['id']}})[_0xff8a('0x1a')](handleEntityNotFound(_0x21973a,null))[_0xff8a('0x1a')](removeEntity(_0x21973a,null))[_0xff8a('0x2b')](handleError(_0x21973a,null));};exports[_0xff8a('0xbc')]=function(_0x4b2a18,_0x50c558){return db[_0xff8a('0x33')][_0xff8a('0xbc')]()[_0xff8a('0x1a')](respondWithResult(_0x50c558,null))['catch'](handleError(_0x50c558,null));};exports[_0xff8a('0xbd')]=function(_0x2ffe0b,_0x37c831){return db[_0xff8a('0x26')][_0xff8a('0x5b')]({'where':{'id':_0x2ffe0b[_0xff8a('0xb4')]['id']}})[_0xff8a('0x1a')](handleEntityNotFound(_0x37c831,null))['then'](function(_0x12d71c){if(_0x12d71c){return _0x12d71c['addMessage'](_0x2ffe0b[_0xff8a('0xba')][_0xff8a('0xbe')],_[_0xff8a('0xbf')](_0x2ffe0b[_0xff8a('0xba')],['ids','id'])||{});}})[_0xff8a('0x1a')](respondWithResult(_0x37c831,null))[_0xff8a('0x2b')](handleError(_0x37c831,null));};exports['getMessages']=function(_0x5ed7c0,_0x524069){var _0x380830={'raw':![],'where':{}};var _0x3220f9={};var _0x387d7d={'count':0x0,'rows':[]};return db[_0xff8a('0x33')][_0xff8a('0x27')]({'where':{'id':_0x5ed7c0[_0xff8a('0xb4')]['id']}})['then'](handleEntityNotFound(_0x524069,null))['then'](function(_0x2b48f0){if(_0x2b48f0){_0x3220f9[_0xff8a('0x3c')]=_[_0xff8a('0x38')](db[_0xff8a('0x26')][_0xff8a('0x34')]);_0x3220f9['query']=_[_0xff8a('0x38')](_0x5ed7c0[_0xff8a('0x37')]);_0x3220f9['filters']=_[_0xff8a('0x3a')](_0x3220f9[_0xff8a('0x3c')],_0x3220f9[_0xff8a('0x37')]);_0x380830['attributes']=_[_0xff8a('0x3a')](_0x3220f9['model'],qs[_0xff8a('0x3d')](_0x5ed7c0[_0xff8a('0x37')][_0xff8a('0x3d')]));_0x380830[_0xff8a('0x3b')]=_0x380830[_0xff8a('0x3b')][_0xff8a('0x5a')]?_0x380830[_0xff8a('0x3b')]:_0x3220f9['model'];if(!_0x5ed7c0[_0xff8a('0x37')][_0xff8a('0x3e')](_0xff8a('0x3f'))){_0x380830['limit']=qs['limit'](_0x5ed7c0['query']['limit']);_0x380830[_0xff8a('0x16')]=qs[_0xff8a('0x16')](_0x5ed7c0[_0xff8a('0x37')][_0xff8a('0x16')]);}_0x380830[_0xff8a('0x86')]=qs[_0xff8a('0x41')](_0x5ed7c0['query']['sort']);_0x380830[_0xff8a('0x42')]=qs[_0xff8a('0x39')](_[_0xff8a('0xc0')](_0x5ed7c0[_0xff8a('0x37')],_0x3220f9[_0xff8a('0x39')]));_0x380830[_0xff8a('0x42')][_0xff8a('0xc1')]=_0x2b48f0['id'];if(_0x5ed7c0[_0xff8a('0x37')]['filter']){_0x380830[_0xff8a('0x42')]=_['merge'](_0x380830[_0xff8a('0x42')],{'$or':_[_0xff8a('0x20')](_0x380830[_0xff8a('0x3b')],function(_0x218271){var _0x5729cd={};_0x5729cd[_0x218271]={'$like':'%'+_0x5ed7c0[_0xff8a('0x37')][_0xff8a('0x7d')]+'%'};return _0x5729cd;})});}if(_0x5ed7c0[_0xff8a('0x37')][_0xff8a('0x74')]){var _0x427c55=_0x5ed7c0['query'][_0xff8a('0x74')][_0xff8a('0x24')](',');var _0x178bbe={};_0x178bbe[_0x427c55[0x0]]={'$gte':moment(_0x427c55[0x1])[_0xff8a('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x380830[_0xff8a('0x42')]=_[_0xff8a('0xb7')](_0x380830['where'],_0x178bbe);}_0x380830=_[_0xff8a('0xb7')]({},_0x380830,_0x5ed7c0['options']);return db[_0xff8a('0x26')][_0xff8a('0x17')]({'where':_0x380830[_0xff8a('0x42')]})['then'](function(_0x1c4606){_0x387d7d['count']=_0x1c4606;if(_0x5ed7c0[_0xff8a('0x37')][_0xff8a('0xb5')]){_0x380830[_0xff8a('0xb6')]=[{'all':!![]}];}return db[_0xff8a('0x26')][_0xff8a('0xc3')](_0x380830);})[_0xff8a('0x1a')](function(_0x5c190a){if(_0x5ed7c0[_0xff8a('0x37')]['inlineCss']===_0xff8a('0xc4')){for(var _0x479ef3=0x0;_0x479ef3<_0x5c190a[_0xff8a('0x5a')];_0x479ef3++){_0x5c190a[_0x479ef3]['body']=juice(_0x5c190a[_0x479ef3][_0xff8a('0xba')]);}}_0x387d7d['rows']=_0x5c190a;return _0x387d7d;});}})[_0xff8a('0x1a')](respondWithFilteredResult(_0x524069,_0x380830))['catch'](handleError(_0x524069,null));};exports[_0xff8a('0xc5')]=function(_0x3db9e9,_0x5ccc46){return db[_0xff8a('0x33')]['find']({'where':{'id':_0x3db9e9[_0xff8a('0xb4')]['id']}})['then'](handleEntityNotFound(_0x5ccc46,null))[_0xff8a('0x1a')](function(_0x3934a5){if(_0x3934a5){return _0x3934a5[_0xff8a('0xc6')](_0x3db9e9[_0xff8a('0xba')][_0xff8a('0xbe')],_[_0xff8a('0xbf')](_0x3db9e9['body'],[_0xff8a('0xbe'),'id'])||{})['spread'](function(){return db[_0xff8a('0xc7')][_0xff8a('0xc3')]({'attributes':['id',_0xff8a('0x1d'),_0xff8a('0xc8')],'where':{'id':_0x3db9e9[_0xff8a('0xba')][_0xff8a('0xbe')]}});})[_0xff8a('0x1a')](function(_0x250b60){socket[_0xff8a('0xc9')]('mailInteractionTags:save',{'id':Number(_0x3db9e9[_0xff8a('0xb4')]['id']),'tags':_0x250b60||[]});return{'id':Number(_0x3db9e9[_0xff8a('0xb4')]['id']),'tags':_0x250b60||[]};});}})[_0xff8a('0x1a')](respondWithResult(_0x5ccc46,null))[_0xff8a('0x2b')](handleError(_0x5ccc46,null));};exports[_0xff8a('0xca')]=function(_0x1326a9,_0x7fcde8){return db['MailInteraction']['find']({'where':{'id':_0x1326a9[_0xff8a('0xb4')]['id']}})[_0xff8a('0x1a')](handleEntityNotFound(_0x7fcde8,null))[_0xff8a('0x1a')](function(_0x178eb4){if(_0x178eb4){return _0x178eb4[_0xff8a('0xca')](_0x1326a9[_0xff8a('0x37')]['ids']);}})[_0xff8a('0x1a')](respondWithStatusCode(_0x7fcde8,null))['catch'](handleError(_0x7fcde8,null));};exports[_0xff8a('0xcb')]=function(_0x311d68,_0x404909){var _0x2fdd6e=moment()[_0xff8a('0xcc')]()[_0xff8a('0x8f')]();var _0x45247f=path[_0xff8a('0xcd')](config[_0xff8a('0xce')],_0xff8a('0xcf'),_0xff8a('0xd0'),_0xff8a('0xd1'));var _0x1ba8c3=path[_0xff8a('0xcd')](config[_0xff8a('0xce')],_0xff8a('0xcf'),_0xff8a('0xd0'),'attachments');var _0x236eb2=path[_0xff8a('0xcd')](_0x45247f,_0x2fdd6e);var _0xeb9e6c=util['format']('transcript-%d-%s.zip',_0x311d68[_0xff8a('0xb4')]['id'],_0x2fdd6e);var _0x283e17=path[_0xff8a('0xcd')](_0x45247f,_0xeb9e6c);var _0x2b24ca=[];if(_0x311d68['query'][_0xff8a('0xd2')]){_0x2b24ca[_0xff8a('0xb0')]({'model':db[_0xff8a('0xd3')],'as':_0xff8a('0xd4'),'raw':!![]});}var _0x5c9682=[{'model':db[_0xff8a('0x26')],'as':_0xff8a('0xd5'),'attributes':['id',_0xff8a('0xba'),'from','to','cc',_0xff8a('0xd6'),_0xff8a('0xd7'),'createdAt'],'where':{'secret':![]},'order':qs[_0xff8a('0x41')]('id'),'include':_0x2b24ca}];return db[_0xff8a('0x33')][_0xff8a('0x5b')]({'where':{'id':_0x311d68[_0xff8a('0xb4')]['id']},'include':_0x5c9682})[_0xff8a('0x1a')](handleEntityNotFound(_0x404909,null))[_0xff8a('0x1a')](function(_0x27a29a){if(_0x27a29a&&_0x27a29a[_0xff8a('0xd5')]){var _0x4b8636=_0x27a29a['get']({'plain':!![]});fs[_0xff8a('0xd8')](_0x236eb2);return BPromise[_0xff8a('0xd9')](_0x4b8636[_0xff8a('0xd5')],function(_0x1a1945,_0x504443){var _0x2bdb43={'from':_0x1a1945[_0xff8a('0x44')],'to':_0x1a1945['to'],'subject':_0x1a1945[_0xff8a('0xd7')],'html':htmlEntities[_0xff8a('0xda')](_0x1a1945['body']),'headers':{'Date':moment(_0x1a1945[_0xff8a('0x72')])[_0xff8a('0xc2')](_0xff8a('0xdb'))},'attachments':[]};if(_0x1a1945['cc']){_0x2bdb43[_0xff8a('0xdc')]['Cc']=_0x1a1945['cc'];}if(_0x1a1945[_0xff8a('0xd6')]){_0x2bdb43[_0xff8a('0xdc')][_0xff8a('0xdd')]=_0x1a1945[_0xff8a('0xd6')];}return new BPromise(function(_0x428ed3,_0x30233b){if(_0x1a1945[_0xff8a('0xd4')]){for(var _0x362fca=0x0;_0x362fca<_0x1a1945[_0xff8a('0xd4')][_0xff8a('0x5a')];_0x362fca++){var _0x1a7772=_0x1a1945[_0xff8a('0xd4')][_0x362fca];var _0x1cb1fa=path[_0xff8a('0xcd')](_0x1ba8c3,_0x1a7772['basename']);if(fs['existsSync'](_0x1cb1fa)){_0x2bdb43[_0xff8a('0xd2')][_0xff8a('0xb0')]({'name':_0x1a7772[_0xff8a('0x1d')],'contentType':_0x1a7772[_0xff8a('0x6c')],'data':fs['readFileSync'](_0x1cb1fa)});}}}emlformat['build'](_0x2bdb43,function(_0x456e4a,_0x3ac259){if(_0x456e4a)return _0x30233b(_0x456e4a);fs[_0xff8a('0xde')](path[_0xff8a('0xcd')](_0x236eb2,util['format'](_0xff8a('0xdf'),_0x504443)),_0x3ac259);return _0x428ed3(_0x3ac259);});});})[_0xff8a('0x1a')](function(){return new BPromise(function(_0x30edca,_0x3ce848){zipdir(_0x236eb2,{'saveTo':_0x283e17},function(_0xca22eb,_0x6c0634){if(_0xca22eb)return _0x3ce848(_0xca22eb);return _0x30edca(_0x6c0634);});})[_0xff8a('0x1a')](function(){return new BPromise(function(_0x59734,_0x4657ef){rimraf(_0x236eb2,function(_0x1a9e9e){if(_0x1a9e9e)_0x4657ef(_0x1a9e9e);return _0x59734();});});})['then'](function(){return _0x404909[_0xff8a('0xcb')](_0x283e17,_0xeb9e6c,function(_0x25f412){if(!_0x25f412)fs[_0xff8a('0xe0')](_0x283e17);});});});}else{return _0x404909['sendStatus'](0xc8);}})['catch'](handleError(_0x404909,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a409f0e..ede9c88 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 _0x28d9=['then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','MailInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x28d9,0x14e));var _0x928d=function(_0xa18098,_0x5abdab){_0xa18098=_0xa18098-0x0;var _0x2e0d2a=_0x28d9[_0xa18098];return _0x2e0d2a;};'use strict';var EventEmitter=require(_0x928d('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x928d('0x1')];var MailMessage=require(_0x928d('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x928d('0x3')](0x0);var events={'afterCreate':_0x928d('0x4'),'afterUpdate':_0x928d('0x5'),'afterDestroy':_0x928d('0x6')};function emitEvent(_0x5d6ae6){return function(_0x4ca528,_0x4b6ee6,_0xbd29ef){_0x4ca528[_0x928d('0x7')]({'attributes':['id'],'raw':!![]})[_0x928d('0x8')](function(_0x544ee9){_0x4ca528[_0x928d('0x9')](_0x928d('0xa'),_0x544ee9['map'](function(_0x1d6ccf){return{'id':_0x1d6ccf['id']};}));return MailMessage[_0x928d('0xb')]({'where':{'MailInteractionId':_0x4ca528['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x41bac1){_0x4ca528[_0x928d('0x9')](_0x928d('0xc'),_0x41bac1[_0x928d('0xd')]);MailInteractionEvents['emit'](_0x5d6ae6+':'+_0x4ca528['id'],_0x4ca528);MailInteractionEvents[_0x928d('0xe')](_0x5d6ae6,_0x4ca528);_0xbd29ef(null);})[_0x928d('0xf')](_0xbd29ef(null));};}for(var e in events){if(events[_0x928d('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x928d('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x9136=['MailMessage','save','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0x42d0ed,_0x91a115){var _0x3f63f6=function(_0x2e961b){while(--_0x2e961b){_0x42d0ed['push'](_0x42d0ed['shift']());}};_0x3f63f6(++_0x91a115);}(_0x9136,0x85));var _0x6913=function(_0xf838c7,_0xbd4763){_0xf838c7=_0xf838c7-0x0;var _0xec7a0=_0x9136[_0xf838c7];return _0xec7a0;};'use strict';var EventEmitter=require(_0x6913('0x0'));var MailInteraction=require(_0x6913('0x1'))['db'][_0x6913('0x2')];var MailMessage=require(_0x6913('0x1'))['db'][_0x6913('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6913('0x4'),'afterUpdate':'update','afterDestroy':_0x6913('0x5')};function emitEvent(_0x4ec2e2){return function(_0x5a7fba,_0x988e26,_0x11ccfc){_0x5a7fba[_0x6913('0x6')]({'attributes':['id'],'raw':!![]})[_0x6913('0x7')](function(_0x3ad6d0){_0x5a7fba[_0x6913('0x8')]('Users',_0x3ad6d0[_0x6913('0x9')](function(_0x1468ca){return{'id':_0x1468ca['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x5a7fba['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6913('0x7')](function(_0x56d998){_0x5a7fba[_0x6913('0x8')](_0x6913('0xa'),_0x56d998[_0x6913('0xb')]);MailInteractionEvents['emit'](_0x4ec2e2+':'+_0x5a7fba['id'],_0x5a7fba);MailInteractionEvents[_0x6913('0xc')](_0x4ec2e2,_0x5a7fba);_0x11ccfc(null);})[_0x6913('0xd')](_0x11ccfc(null));};}for(var e in events){if(events[_0x6913('0xe')](e)){var event=events[e];MailInteraction[_0x6913('0xf')](e,emitEvent(event));}}module[_0x6913('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 08d7c11..cb4678d 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 _0x5d78=['closedAt','format','changed','get','closed','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x27531a,_0x2c6cf1){var _0xcff0bb=function(_0xb42756){while(--_0xb42756){_0x27531a['push'](_0x27531a['shift']());}};_0xcff0bb(++_0x2c6cf1);}(_0x5d78,0x14c));var _0x85d7=function(_0x1c80fd,_0x40d1cf){_0x1c80fd=_0x1c80fd-0x0;var _0x47c19c=_0x5d78[_0x1c80fd];return _0x47c19c;};'use strict';var _=require(_0x85d7('0x0'));var util=require('util');var logger=require(_0x85d7('0x1'))(_0x85d7('0x2'));var moment=require(_0x85d7('0x3'));var BPromise=require(_0x85d7('0x4'));var rp=require(_0x85d7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d7('0x6'));var config=require(_0x85d7('0x7'));var attributes=require(_0x85d7('0x8'));module[_0x85d7('0x9')]=function(_0x3f118f,_0x5a0a00){return _0x3f118f[_0x85d7('0xa')](_0x85d7('0xb'),attributes,{'tableName':_0x85d7('0xc'),'paranoid':![],'indexes':[{'name':_0x85d7('0xd'),'fields':['subject','to'],'type':_0x85d7('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c842b,_0x11c863,_0x2d14eb){if(_0x3c842b[_0x85d7('0xf')]){_0x3c842b[_0x85d7('0x10')]=moment()['format'](_0x85d7('0x11'));}if(_0x3c842b['closed']){_0x3c842b[_0x85d7('0x12')]=moment()[_0x85d7('0x13')](_0x85d7('0x11'));}_0x2d14eb(null,_0x11c863);},'beforeUpdate':function(_0x328114,_0x5558f9,_0xc25a90){if(_0x328114['changed'](_0x85d7('0xf'))){_0x328114[_0x85d7('0x10')]=_0x328114[_0x85d7('0xf')]?moment()[_0x85d7('0x13')](_0x85d7('0x11')):null;}if(_0x328114[_0x85d7('0x14')]('closed')){_0x328114['closedAt']=moment()[_0x85d7('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x328114[_0x85d7('0xf')]=null;_0x328114[_0x85d7('0x10')]=null;}_0xc25a90(null,_0x328114);},'afterUpdate':function(_0x2dbb73,_0x59e561,_0x5e2d2d){var _0x37b8d5=_0x3f118f['models'];var _0x591baa=_0x2dbb73[_0x85d7('0x15')]({'plain':!![]});if(_0x591baa[_0x85d7('0x16')]){return _0x37b8d5['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x591baa['id']}})['then'](function(){_0x5e2d2d();})[_0x85d7('0x17')](function(_0x5c0041){_0x5e2d2d(_0x5c0041);});}else{_0x5e2d2d();}}},'charset':'utf8mb4','collate':_0x85d7('0x18')});}; \ No newline at end of file +var _0xae82=['YYYY-MM-DD\x20HH:mm:ss','changed','substatusAt','closedAt','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','format','closed'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xae82,0x166));var _0x2ae8=function(_0x56d7f4,_0x528c7c){_0x56d7f4=_0x56d7f4-0x0;var _0x2a9d78=_0xae82[_0x56d7f4];return _0x2a9d78;};'use strict';var _=require(_0x2ae8('0x0'));var util=require(_0x2ae8('0x1'));var logger=require(_0x2ae8('0x2'))(_0x2ae8('0x3'));var moment=require(_0x2ae8('0x4'));var BPromise=require(_0x2ae8('0x5'));var rp=require(_0x2ae8('0x6'));var fs=require('fs');var path=require(_0x2ae8('0x7'));var rimraf=require('rimraf');var config=require(_0x2ae8('0x8'));var attributes=require(_0x2ae8('0x9'));module[_0x2ae8('0xa')]=function(_0x284981,_0x726a1b){return _0x284981[_0x2ae8('0xb')](_0x2ae8('0xc'),attributes,{'tableName':_0x2ae8('0xd'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x2ae8('0xe'),'to'],'type':_0x2ae8('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2bb963,_0x5dec37,_0x54bc07){if(_0x2bb963[_0x2ae8('0x10')]){_0x2bb963['substatusAt']=moment()[_0x2ae8('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2bb963[_0x2ae8('0x12')]){_0x2bb963['closedAt']=moment()['format'](_0x2ae8('0x13'));}_0x54bc07(null,_0x5dec37);},'beforeUpdate':function(_0x2db80b,_0x494881,_0x2f6f01){if(_0x2db80b[_0x2ae8('0x14')](_0x2ae8('0x10'))){_0x2db80b[_0x2ae8('0x15')]=_0x2db80b[_0x2ae8('0x10')]?moment()['format'](_0x2ae8('0x13')):null;}if(_0x2db80b[_0x2ae8('0x14')](_0x2ae8('0x12'))){_0x2db80b[_0x2ae8('0x16')]=moment()['format'](_0x2ae8('0x13'));_0x2db80b[_0x2ae8('0x10')]=null;_0x2db80b[_0x2ae8('0x15')]=null;}_0x2f6f01(null,_0x2db80b);},'afterUpdate':function(_0x5aef5c,_0x16a6d8,_0x23a749){var _0x1fbc7a=_0x284981['models'];var _0x226a76=_0x5aef5c[_0x2ae8('0x17')]({'plain':!![]});if(_0x226a76[_0x2ae8('0x12')]){return _0x1fbc7a[_0x2ae8('0x18')][_0x2ae8('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x226a76['id']}})[_0x2ae8('0x1a')](function(){_0x23a749();})[_0x2ae8('0x1b')](function(_0xdbebbb){_0x23a749(_0xdbebbb);});}else{_0x23a749();}}},'charset':_0x2ae8('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 0f83d6c..0121fe8 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 _0xfd1b=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','catch','UpdateMailInteraction','MailInteraction','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','body','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xd14aa3,_0x53a483){var _0x37d0da=function(_0x38bbd1){while(--_0x38bbd1){_0xd14aa3['push'](_0xd14aa3['shift']());}};_0x37d0da(++_0x53a483);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x4eefe7,_0x311359){_0x4eefe7=_0x4eefe7-0x0;var _0x25527e=_0xfd1b[_0x4eefe7];return _0x25527e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbfd1('0x0'));var BPromise=require(_0xbfd1('0x1'));var rs=require(_0xbfd1('0x2'));var fs=require('fs');var Redis=require(_0xbfd1('0x3'));var db=require(_0xbfd1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfd1('0x5'))(_0xbfd1('0x6'));var config=require(_0xbfd1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbfd1('0x8')][_0xbfd1('0x9')]({'port':0x232a});config[_0xbfd1('0xa')]=_[_0xbfd1('0xb')](config[_0xbfd1('0xa')],{'host':_0xbfd1('0xc'),'port':0x18eb});var socket=require(_0xbfd1('0xd'))(new Redis(config[_0xbfd1('0xa')]));require('./mailInteraction.socket')[_0xbfd1('0xe')](socket);function respondWithRpcPromise(_0x4f5912,_0x34bc8c,_0x1f680e){return new BPromise(function(_0x416cce,_0x66e22a){return client[_0xbfd1('0xf')](_0x4f5912,_0x1f680e)[_0xbfd1('0x10')](function(_0x400dce){logger[_0xbfd1('0x11')](_0xbfd1('0x12'),_0x34bc8c,_0xbfd1('0x13'));logger[_0xbfd1('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x34bc8c,_0xbfd1('0x13'),JSON[_0xbfd1('0x15')](_0x400dce));if(_0x400dce['error']){if(_0x400dce['error'][_0xbfd1('0x16')]===0x1f4){logger['error'](_0xbfd1('0x12'),_0x34bc8c,_0x400dce['error'][_0xbfd1('0x17')]);return _0x66e22a(_0x400dce[_0xbfd1('0x18')][_0xbfd1('0x17')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x34bc8c,_0x400dce['error'][_0xbfd1('0x17')]);return _0x416cce(_0x400dce[_0xbfd1('0x18')][_0xbfd1('0x17')]);}else{logger[_0xbfd1('0x11')](_0xbfd1('0x12'),_0x34bc8c,_0xbfd1('0x13'));_0x416cce(_0x400dce['result'][_0xbfd1('0x17')]);}})[_0xbfd1('0x19')](function(_0x523101){logger[_0xbfd1('0x18')](_0xbfd1('0x12'),_0x34bc8c,_0x523101);_0x66e22a(_0x523101);});});}exports[_0xbfd1('0x1a')]=function(_0x293940){var _0x517e5e=this;return new Promise(function(_0x1c5c8e,_0x44c3ba){return db[_0xbfd1('0x1b')]['update'](_0x293940['body'],{'raw':_0x293940[_0xbfd1('0x1c')]?_0x293940[_0xbfd1('0x1c')][_0xbfd1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293940[_0xbfd1('0x1c')]?_0x293940[_0xbfd1('0x1c')][_0xbfd1('0x1e')]||null:null,'attributes':_0x293940['options']?_0x293940['options'][_0xbfd1('0x1f')]||null:null,'limit':_0x293940[_0xbfd1('0x1c')]?_0x293940[_0xbfd1('0x1c')][_0xbfd1('0x20')]||null:null})[_0xbfd1('0x10')](function(_0x1ce77d){logger['info'](_0xbfd1('0x1a'),_0x293940);logger[_0xbfd1('0x14')](_0xbfd1('0x1a'),_0x293940,JSON['stringify'](_0x1ce77d));_0x1c5c8e(_0x1ce77d);})[_0xbfd1('0x19')](function(_0x55cdb2){logger[_0xbfd1('0x18')](_0xbfd1('0x1a'),_0x55cdb2[_0xbfd1('0x17')],_0x293940);_0x44c3ba(_0x517e5e[_0xbfd1('0x18')](0x1f4,_0x55cdb2[_0xbfd1('0x17')]));});});};exports[_0xbfd1('0x21')]=function(_0x5b4949){return new Promise(function(_0x44c01c,_0xe6f7b0){return db[_0xbfd1('0x1b')][_0xbfd1('0x22')]({'where':_0x5b4949['options']?_0x5b4949[_0xbfd1('0x1c')]['where']||null:null})[_0xbfd1('0x10')](function(_0x3deded){if(_0x3deded){return _0x3deded[_0xbfd1('0x23')](_0x5b4949['body'][_0xbfd1('0x24')],_[_0xbfd1('0x25')](_0x5b4949[_0xbfd1('0x26')],[_0xbfd1('0x24'),'id'])||{});}})['spread'](function(_0x342cdb){logger['info'](_0xbfd1('0x27'),_0x5b4949);logger[_0xbfd1('0x14')]('AddTags',_0x5b4949,JSON[_0xbfd1('0x15')](_0x342cdb));_0x44c01c(_0x342cdb);})['catch'](function(_0x9b3782){logger[_0xbfd1('0x18')](_0xbfd1('0x27'),_0x9b3782['message'],_0x5b4949);_0xe6f7b0(_this[_0xbfd1('0x18')](0x1f4,_0x9b3782[_0xbfd1('0x17')]));});});}; \ No newline at end of file +var _0x9f9e=['client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','info','request\x20sent','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ab639,_0x16170e){var _0x32cc27=function(_0xab95b1){while(--_0xab95b1){_0x4ab639['push'](_0x4ab639['shift']());}};_0x32cc27(++_0x16170e);}(_0x9f9e,0x183));var _0xe9f9=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x9f9e[_0x211fef];return _0x5447bf;};'use strict';var _=require(_0xe9f9('0x0'));var util=require('util');var moment=require(_0xe9f9('0x1'));var BPromise=require(_0xe9f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9f9('0x3'))['db'];var utils=require(_0xe9f9('0x4'));var logger=require(_0xe9f9('0x5'))(_0xe9f9('0x6'));var config=require(_0xe9f9('0x7'));var jayson=require(_0xe9f9('0x8'));var client=jayson[_0xe9f9('0x9')][_0xe9f9('0xa')]({'port':0x232a});config[_0xe9f9('0xb')]=_[_0xe9f9('0xc')](config['redis'],{'host':_0xe9f9('0xd'),'port':0x18eb});var socket=require(_0xe9f9('0xe'))(new Redis(config[_0xe9f9('0xb')]));require(_0xe9f9('0xf'))[_0xe9f9('0x10')](socket);function respondWithRpcPromise(_0x1970c3,_0x4eab89,_0x2b1937){return new BPromise(function(_0x5c0f96,_0x4b7bc5){return client[_0xe9f9('0x11')](_0x1970c3,_0x2b1937)[_0xe9f9('0x12')](function(_0x2d7a27){logger['info']('MailInteraction,\x20%s,\x20%s',_0x4eab89,'request\x20sent');logger[_0xe9f9('0x13')](_0xe9f9('0x14'),_0x4eab89,'request\x20sent',JSON[_0xe9f9('0x15')](_0x2d7a27));if(_0x2d7a27[_0xe9f9('0x16')]){if(_0x2d7a27[_0xe9f9('0x16')][_0xe9f9('0x17')]===0x1f4){logger['error'](_0xe9f9('0x18'),_0x4eab89,_0x2d7a27[_0xe9f9('0x16')][_0xe9f9('0x19')]);return _0x4b7bc5(_0x2d7a27[_0xe9f9('0x16')]['message']);}logger[_0xe9f9('0x16')](_0xe9f9('0x18'),_0x4eab89,_0x2d7a27[_0xe9f9('0x16')][_0xe9f9('0x19')]);return _0x5c0f96(_0x2d7a27[_0xe9f9('0x16')][_0xe9f9('0x19')]);}else{logger[_0xe9f9('0x1a')](_0xe9f9('0x18'),_0x4eab89,_0xe9f9('0x1b'));_0x5c0f96(_0x2d7a27[_0xe9f9('0x1c')][_0xe9f9('0x19')]);}})[_0xe9f9('0x1d')](function(_0x4df497){logger[_0xe9f9('0x16')](_0xe9f9('0x18'),_0x4eab89,_0x4df497);_0x4b7bc5(_0x4df497);});});}exports[_0xe9f9('0x1e')]=function(_0x42aa6e){var _0x4668e6=this;return new Promise(function(_0x456997,_0x290aca){return db[_0xe9f9('0x1f')]['update'](_0x42aa6e[_0xe9f9('0x20')],{'raw':_0x42aa6e[_0xe9f9('0x21')]?_0x42aa6e['options'][_0xe9f9('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42aa6e['options']?_0x42aa6e['options'][_0xe9f9('0x23')]||null:null,'attributes':_0x42aa6e['options']?_0x42aa6e['options'][_0xe9f9('0x24')]||null:null,'limit':_0x42aa6e[_0xe9f9('0x21')]?_0x42aa6e[_0xe9f9('0x21')]['limit']||null:null})[_0xe9f9('0x12')](function(_0x5ecddf){logger[_0xe9f9('0x1a')](_0xe9f9('0x1e'),_0x42aa6e);logger[_0xe9f9('0x13')](_0xe9f9('0x1e'),_0x42aa6e,JSON[_0xe9f9('0x15')](_0x5ecddf));_0x456997(_0x5ecddf);})[_0xe9f9('0x1d')](function(_0xe5e471){logger[_0xe9f9('0x16')](_0xe9f9('0x1e'),_0xe5e471['message'],_0x42aa6e);_0x290aca(_0x4668e6['error'](0x1f4,_0xe5e471['message']));});});};exports[_0xe9f9('0x25')]=function(_0x4de2a0){return new Promise(function(_0x2b7619,_0x284579){return db[_0xe9f9('0x1f')][_0xe9f9('0x26')]({'where':_0x4de2a0[_0xe9f9('0x21')]?_0x4de2a0[_0xe9f9('0x21')]['where']||null:null})[_0xe9f9('0x12')](function(_0xa8ac2b){if(_0xa8ac2b){return _0xa8ac2b[_0xe9f9('0x27')](_0x4de2a0[_0xe9f9('0x20')][_0xe9f9('0x28')],_[_0xe9f9('0x29')](_0x4de2a0[_0xe9f9('0x20')],[_0xe9f9('0x28'),'id'])||{});}})[_0xe9f9('0x2a')](function(_0x454cd2){logger[_0xe9f9('0x1a')](_0xe9f9('0x2b'),_0x4de2a0);logger[_0xe9f9('0x13')](_0xe9f9('0x2b'),_0x4de2a0,JSON[_0xe9f9('0x15')](_0x454cd2));_0x2b7619(_0x454cd2);})[_0xe9f9('0x1d')](function(_0x55b53e){logger[_0xe9f9('0x16')]('AddTags',_0x55b53e[_0xe9f9('0x19')],_0x4de2a0);_0x284579(_this[_0xe9f9('0x16')](0x1f4,_0x55b53e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 224ebde..c41089b 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 _0x8ddd=['length','./mailInteraction.events','save','remove','update','emit','register'];(function(_0x4b980d,_0x32fc6a){var _0x5c7974=function(_0x3b7af4){while(--_0x3b7af4){_0x4b980d['push'](_0x4b980d['shift']());}};_0x5c7974(++_0x32fc6a);}(_0x8ddd,0x135));var _0xd8dd=function(_0x5e43c2,_0x76af5f){_0x5e43c2=_0x5e43c2-0x0;var _0x51c78a=_0x8ddd[_0x5e43c2];return _0x51c78a;};'use strict';var MailInteractionEvents=require(_0xd8dd('0x0'));var events=[_0xd8dd('0x1'),_0xd8dd('0x2'),_0xd8dd('0x3')];function createListener(_0x590125,_0x1aad1f){return function(_0x324d3d){_0x1aad1f[_0xd8dd('0x4')](_0x590125,_0x324d3d);};}function removeListener(_0x2a9a9c,_0x2ec358){return function(){MailInteractionEvents['removeListener'](_0x2a9a9c,_0x2ec358);};}exports[_0xd8dd('0x5')]=function(_0x1c3d85){for(var _0x58bf59=0x0,_0x33ca36=events[_0xd8dd('0x6')];_0x58bf59<_0x33ca36;_0x58bf59++){var _0x448886=events[_0x58bf59];var _0x13fa00=createListener('mailInteraction:'+_0x448886,_0x1c3d85);MailInteractionEvents['on'](_0x448886,_0x13fa00);}}; \ No newline at end of file +var _0x08df=['mailInteraction:','./mailInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x28a36d,_0x46b463){var _0x1bcce4=function(_0x4b674b){while(--_0x4b674b){_0x28a36d['push'](_0x28a36d['shift']());}};_0x1bcce4(++_0x46b463);}(_0x08df,0x1e1));var _0xf08d=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x08df[_0x5a7d41];return _0x98d8fa;};'use strict';var MailInteractionEvents=require(_0xf08d('0x0'));var events=['save',_0xf08d('0x1'),_0xf08d('0x2')];function createListener(_0x45d811,_0x1f9969){return function(_0x2c97c6){_0x1f9969[_0xf08d('0x3')](_0x45d811,_0x2c97c6);};}function removeListener(_0x333682,_0x25d87d){return function(){MailInteractionEvents[_0xf08d('0x4')](_0x333682,_0x25d87d);};}exports[_0xf08d('0x5')]=function(_0x595e1c){for(var _0x4d939a=0x0,_0x334250=events[_0xf08d('0x6')];_0x4d939a<_0x334250;_0x4d939a++){var _0x15630f=events[_0x4d939a];var _0x10f0d3=createListener(_0xf08d('0x7')+_0x15630f,_0x595e1c);MailInteractionEvents['on'](_0x15630f,_0x10f0d3);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index a6d6b91..b86749a 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 _0xfcc5=['/:id/accept','reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','download','post','tracked','mail','put','update'];(function(_0x12e43e,_0xf7774a){var _0xf79e98=function(_0x553182){while(--_0x553182){_0x12e43e['push'](_0x12e43e['shift']());}};_0xf79e98(++_0xf7774a);}(_0xfcc5,0x14a));var _0x5fcc=function(_0x1623f1,_0x19ca1b){_0x1623f1=_0x1623f1-0x0;var _0x5924fc=_0xfcc5[_0x1623f1];return _0x5924fc;};'use strict';var multer=require('multer');var util=require(_0x5fcc('0x0'));var path=require(_0x5fcc('0x1'));var timeout=require(_0x5fcc('0x2'));var express=require(_0x5fcc('0x3'));var router=express['Router']();var fs_extra=require(_0x5fcc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fcc('0x5'));var controller=require(_0x5fcc('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5fcc('0x7')]);router[_0x5fcc('0x8')](_0x5fcc('0x9'),auth[_0x5fcc('0xa')](),controller[_0x5fcc('0xb')]);router['get'](_0x5fcc('0xc'),auth['isAuthenticated'](),controller[_0x5fcc('0xd')]);router[_0x5fcc('0x8')]('/:id/download',auth[_0x5fcc('0xa')](),controller[_0x5fcc('0xe')]);router[_0x5fcc('0xf')]('/',auth[_0x5fcc('0xa')](),interaction[_0x5fcc('0x10')](_0x5fcc('0x11'),'mailmessage:create'),controller['create']);router[_0x5fcc('0x12')](_0x5fcc('0xc'),auth[_0x5fcc('0xa')](),controller[_0x5fcc('0x13')]);router[_0x5fcc('0x12')](_0x5fcc('0x14'),auth[_0x5fcc('0xa')](),controller['accept']);router[_0x5fcc('0x12')]('/:id/reject',auth[_0x5fcc('0xa')](),controller[_0x5fcc('0x15')]);router[_0x5fcc('0x16')](_0x5fcc('0xc'),auth['isAuthenticated'](),controller[_0x5fcc('0x17')]);module[_0x5fcc('0x18')]=router; \ No newline at end of file +var _0x3360=['../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','Router','../../components/interaction/service'];(function(_0x3e439e,_0x5725e5){var _0x517d4b=function(_0x4832a1){while(--_0x4832a1){_0x3e439e['push'](_0x3e439e['shift']());}};_0x517d4b(++_0x5725e5);}(_0x3360,0x1d7));var _0x0336=function(_0x5b4343,_0x1289ce){_0x5b4343=_0x5b4343-0x0;var _0x25a06b=_0x3360[_0x5b4343];return _0x25a06b;};'use strict';var multer=require(_0x0336('0x0'));var util=require(_0x0336('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0336('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0336('0x3'));var config=require(_0x0336('0x4'));var controller=require(_0x0336('0x5'));router[_0x0336('0x6')]('/',auth[_0x0336('0x7')](),controller['index']);router['get'](_0x0336('0x8'),auth[_0x0336('0x7')](),controller[_0x0336('0x9')]);router[_0x0336('0x6')](_0x0336('0xa'),auth['isAuthenticated'](),controller[_0x0336('0xb')]);router[_0x0336('0x6')](_0x0336('0xc'),auth['isAuthenticated'](),controller[_0x0336('0xd')]);router['post']('/',auth[_0x0336('0x7')](),interaction[_0x0336('0xe')](_0x0336('0xf'),_0x0336('0x10')),controller[_0x0336('0x11')]);router['put'](_0x0336('0xa'),auth[_0x0336('0x7')](),controller[_0x0336('0x12')]);router[_0x0336('0x13')](_0x0336('0x14'),auth['isAuthenticated'](),controller[_0x0336('0x15')]);router[_0x0336('0x13')](_0x0336('0x16'),auth[_0x0336('0x7')](),controller['reject']);router[_0x0336('0x17')]('/:id',auth[_0x0336('0x7')](),controller[_0x0336('0x18')]);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 a49f961..495fd47 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 _0xe4ea=['Email','Chat','sequelize','TEXT','medium','ENUM','out','STRING','long','DATE','BOOLEAN'];(function(_0x1ed2c9,_0x359e8f){var _0x4e0f41=function(_0x2a8885){while(--_0x2a8885){_0x1ed2c9['push'](_0x1ed2c9['shift']());}};_0x4e0f41(++_0x359e8f);}(_0xe4ea,0x18e));var _0xae4e=function(_0x14af1a,_0x482986){_0x14af1a=_0x14af1a-0x0;var _0x1121e1=_0xe4ea[_0x14af1a];return _0x1121e1;};'use strict';var Sequelize=require(_0xae4e('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xae4e('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xae4e('0x2'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xae4e('0x3')]('in',_0xae4e('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xae4e('0x5')](0x1fe)},'from':{'type':Sequelize[_0xae4e('0x5')]},'to':{'type':Sequelize[_0xae4e('0x1')]('long')},'cc':{'type':Sequelize['TEXT'](_0xae4e('0x6'))},'bcc':{'type':Sequelize[_0xae4e('0x1')]('long')},'subject':{'type':Sequelize[_0xae4e('0x1')]},'sentAt':{'type':Sequelize[_0xae4e('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xae4e('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xae4e('0x7')]},'originTo':{'type':Sequelize['TEXT'](_0xae4e('0x6'))},'originCc':{'type':Sequelize[_0xae4e('0x1')]('long')},'originChannel':{'type':Sequelize[_0xae4e('0x3')](_0xae4e('0x9'),_0xae4e('0xa')),'defaultValue':_0xae4e('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0x5538=['STRING','long','INTEGER','DATE','Email','Chat','sequelize','lodash','TEXT','BOOLEAN','ENUM','out'];(function(_0x21a15d,_0x595105){var _0x13c210=function(_0x4387b9){while(--_0x4387b9){_0x21a15d['push'](_0x21a15d['shift']());}};_0x13c210(++_0x595105);}(_0x5538,0x192));var _0x8553=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5538[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x8553('0x0'));var _=require(_0x8553('0x1'));module['exports']={'body':{'type':Sequelize[_0x8553('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8553('0x2')]('medium')},'read':{'type':Sequelize[_0x8553('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8553('0x4')]('in',_0x8553('0x5')),'defaultValue':_0x8553('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8553('0x6')](0x1fe)},'from':{'type':Sequelize[_0x8553('0x6')]},'to':{'type':Sequelize[_0x8553('0x2')]('long')},'cc':{'type':Sequelize[_0x8553('0x2')](_0x8553('0x7'))},'bcc':{'type':Sequelize[_0x8553('0x2')](_0x8553('0x7'))},'subject':{'type':Sequelize[_0x8553('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x8553('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8553('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8553('0x9')]},'originTo':{'type':Sequelize[_0x8553('0x2')](_0x8553('0x7'))},'originCc':{'type':Sequelize[_0x8553('0x2')]('long')},'originChannel':{'type':Sequelize[_0x8553('0x4')](_0x8553('0xa'),_0x8553('0xb')),'defaultValue':_0x8553('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2201c9a..c05bef6 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 _0x40fc=['name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','params','rawAttributes','keys','body','find','describe','create','direction','out','secret','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','host','secure','auth','user','pass','service','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail','read','readAt','agent','UserId','get','MailInteraction','isNil','read1stAt','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','download','toString','server','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','offset','undefined','limit','count','status','set','Content-Range','json','update','then','end','stack','MailMessage','fieldName','type','map'];(function(_0x18e80c,_0x4077f7){var _0x183ba9=function(_0x2f8947){while(--_0x2f8947){_0x18e80c['push'](_0x18e80c['shift']());}};_0x183ba9(++_0x4077f7);}(_0x40fc,0x74));var _0xc40f=function(_0x147d10,_0x5aa133){_0x147d10=_0x147d10-0x0;var _0xd1219b=_0x40fc[_0x147d10];return _0xd1219b;};'use strict';var emlformat=require(_0xc40f('0x0'));var moment=require(_0xc40f('0x1'));var BPromise=require(_0xc40f('0x2'));var util=require(_0xc40f('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xc40f('0x4'));var Redis=require(_0xc40f('0x5'));var htmlToText=require(_0xc40f('0x6'));var qs=require(_0xc40f('0x7'));var logger=require(_0xc40f('0x8'))(_0xc40f('0x9'));var interaction_log=require(_0xc40f('0x8'))(_0xc40f('0xa'));var config=require(_0xc40f('0xb'));var db=require(_0xc40f('0xc'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc40f('0xd')]));var htmlEntities=require(_0xc40f('0xe'));require(_0xc40f('0xf'))[_0xc40f('0x10')](socket);var jayson=require(_0xc40f('0x11'));var client=jayson[_0xc40f('0x12')]['http']({'port':0x232c});var client9003=jayson['client'][_0xc40f('0x13')]({'port':0x232b});var client9002=jayson['client'][_0xc40f('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x46d97f,_0x379b49,_0x399539,_0x5c04f7){return new BPromise(function(_0x42ab38,_0x150fcc){var _0x5d27d1=_0x5c04f7||client;return _0x5d27d1[_0xc40f('0x14')](_0x46d97f,_0x399539)['then'](function(_0x22d86d){logger[_0xc40f('0x15')](_0xc40f('0x16'),_0x379b49,_0xc40f('0x17'));logger[_0xc40f('0x18')](_0xc40f('0x19'),_0x379b49,_0xc40f('0x17'),JSON['stringify'](_0x22d86d));if(_0x22d86d[_0xc40f('0x1a')]){if(_0x22d86d[_0xc40f('0x1a')][_0xc40f('0x1b')]===0x1f4){logger[_0xc40f('0x1a')](_0xc40f('0x16'),_0x379b49,_0x22d86d['error'][_0xc40f('0x1c')]);return _0x150fcc(_0x22d86d[_0xc40f('0x1a')]['message']);}logger[_0xc40f('0x1a')](_0xc40f('0x16'),_0x379b49,_0x22d86d['error'][_0xc40f('0x1c')]);return _0x42ab38(_0x22d86d[_0xc40f('0x1a')][_0xc40f('0x1c')]);}else{logger[_0xc40f('0x15')](_0xc40f('0x16'),_0x379b49,_0xc40f('0x17'));_0x42ab38(_0x22d86d[_0xc40f('0x1d')][_0xc40f('0x1c')]);}})[_0xc40f('0x1e')](function(_0x2b329d){logger['error']('MailMessage,\x20%s,\x20%s',_0x379b49,_0x2b329d);_0x150fcc(_0x2b329d);});});}function respondWithResult(_0x3b2fcb,_0x565893){_0x565893=_0x565893||0xc8;return function(_0x274098){if(_0x274098){return _0x3b2fcb['status'](_0x565893)['json'](_0x274098);}};}function respondWithFilteredResult(_0x501a23,_0x655f8c){return function(_0x582690){if(_0x582690){var _0x49aee6=typeof _0x655f8c[_0xc40f('0x1f')]===_0xc40f('0x20')&&typeof _0x655f8c[_0xc40f('0x21')]===_0xc40f('0x20');var _0x37c82d=_0x582690['count'];var _0x358f58=_0x49aee6?0x0:_0x655f8c['offset'];var _0x110478=_0x49aee6?_0x582690[_0xc40f('0x22')]:_0x655f8c[_0xc40f('0x1f')]+_0x655f8c['limit'];var _0x5991bb;if(_0x110478>=_0x37c82d){_0x110478=_0x37c82d;_0x5991bb=0xc8;}else{_0x5991bb=0xce;}_0x501a23[_0xc40f('0x23')](_0x5991bb);return _0x501a23[_0xc40f('0x24')](_0xc40f('0x25'),_0x358f58+'-'+_0x110478+'/'+_0x37c82d)[_0xc40f('0x26')](_0x582690);}return null;};}function saveUpdates(_0x39394d){return function(_0x4a76b6){if(_0x4a76b6){return _0x4a76b6[_0xc40f('0x27')](_0x39394d)[_0xc40f('0x28')](function(_0x222fa4){return _0x222fa4;});}return null;};}function removeEntity(_0x3f1e4a){return function(_0x23448d){if(_0x23448d){return _0x23448d['destroy']()[_0xc40f('0x28')](function(){_0x3f1e4a[_0xc40f('0x23')](0xcc)[_0xc40f('0x29')]();});}};}function handleEntityNotFound(_0x1b1d7a){return function(_0x11fb18){if(!_0x11fb18){_0x1b1d7a['sendStatus'](0x194);}return _0x11fb18;};}function handleError(_0x1a7fd3,_0x2a4524){_0x2a4524=_0x2a4524||0x1f4;return function(_0x2cfc6e){logger['error'](_0x2cfc6e[_0xc40f('0x2a')]);if(_0x2cfc6e['name']){delete _0x2cfc6e['name'];}_0x1a7fd3[_0xc40f('0x23')](_0x2a4524)['send'](_0x2cfc6e);};}exports['index']=function(_0x2479ce,_0x41b411){var _0x3168c6={},_0x142bda={},_0x65e899={'count':0x0,'rows':[]};var _0x5bdba1=_['map'](db[_0xc40f('0x2b')]['rawAttributes'],function(_0x48f682){return{'name':_0x48f682[_0xc40f('0x2c')],'type':_0x48f682[_0xc40f('0x2d')]['key']};});_0x142bda['model']=_[_0xc40f('0x2e')](_0x5bdba1,_0xc40f('0x2f'));_0x142bda[_0xc40f('0x30')]=_['keys'](_0x2479ce['query']);_0x142bda[_0xc40f('0x31')]=_[_0xc40f('0x32')](_0x142bda[_0xc40f('0x33')],_0x142bda[_0xc40f('0x30')]);_0x3168c6[_0xc40f('0x34')]=_['intersection'](_0x142bda[_0xc40f('0x33')],qs[_0xc40f('0x35')](_0x2479ce[_0xc40f('0x30')]['fields']));_0x3168c6[_0xc40f('0x34')]=_0x3168c6[_0xc40f('0x34')][_0xc40f('0x36')]?_0x3168c6[_0xc40f('0x34')]:_0x142bda[_0xc40f('0x33')];if(!_0x2479ce[_0xc40f('0x30')][_0xc40f('0x37')]('nolimit')){_0x3168c6[_0xc40f('0x21')]=qs[_0xc40f('0x21')](_0x2479ce['query'][_0xc40f('0x21')]);_0x3168c6[_0xc40f('0x1f')]=qs[_0xc40f('0x1f')](_0x2479ce['query'][_0xc40f('0x1f')]);}_0x3168c6[_0xc40f('0x38')]=qs[_0xc40f('0x39')](_0x2479ce[_0xc40f('0x30')][_0xc40f('0x39')]);_0x3168c6[_0xc40f('0x3a')]=qs['filters'](_[_0xc40f('0x3b')](_0x2479ce['query'],_0x142bda[_0xc40f('0x31')]),_0x5bdba1);if(_0x2479ce['query'][_0xc40f('0x3c')]){_0x3168c6[_0xc40f('0x3a')]=_['merge'](_0x3168c6[_0xc40f('0x3a')],{'$or':_[_0xc40f('0x2e')](_0x5bdba1,function(_0x4f22a6){if(_0x4f22a6[_0xc40f('0x2d')]!==_0xc40f('0x3d')){var _0x22dd4b={};_0x22dd4b[_0x4f22a6[_0xc40f('0x2f')]]={'$like':'%'+_0x2479ce[_0xc40f('0x30')][_0xc40f('0x3c')]+'%'};return _0x22dd4b;}})});}_0x3168c6=_[_0xc40f('0x3e')]({},_0x3168c6,_0x2479ce[_0xc40f('0x3f')]);var _0x28f060={'where':_0x3168c6['where']};return db[_0xc40f('0x2b')][_0xc40f('0x22')](_0x28f060)[_0xc40f('0x28')](function(_0x21ae21){_0x65e899[_0xc40f('0x22')]=_0x21ae21;if(_0x2479ce[_0xc40f('0x30')][_0xc40f('0x40')]){_0x3168c6['include']=[{'all':!![]}];}return db[_0xc40f('0x2b')][_0xc40f('0x41')](_0x3168c6);})[_0xc40f('0x28')](function(_0x2816e8){_0x65e899[_0xc40f('0x42')]=_0x2816e8;return _0x65e899;})[_0xc40f('0x28')](respondWithFilteredResult(_0x41b411,_0x3168c6))[_0xc40f('0x1e')](handleError(_0x41b411,null));};exports['show']=function(_0x4f5ff8,_0x10a476){var _0x2a6abe={'raw':!![],'where':{'id':_0x4f5ff8[_0xc40f('0x43')]['id']}},_0x3e7574={};_0x3e7574[_0xc40f('0x33')]=_['keys'](db[_0xc40f('0x2b')][_0xc40f('0x44')]);_0x3e7574[_0xc40f('0x30')]=_[_0xc40f('0x45')](_0x4f5ff8[_0xc40f('0x30')]);_0x3e7574['filters']=_[_0xc40f('0x32')](_0x3e7574[_0xc40f('0x33')],_0x3e7574['query']);_0x2a6abe[_0xc40f('0x34')]=_['intersection'](_0x3e7574['model'],qs[_0xc40f('0x35')](_0x4f5ff8['query'][_0xc40f('0x35')]));_0x2a6abe[_0xc40f('0x34')]=_0x2a6abe['attributes'][_0xc40f('0x36')]?_0x2a6abe['attributes']:_0x3e7574[_0xc40f('0x33')];if(_0x4f5ff8['query']['includeAll']){_0x2a6abe['include']=[{'all':!![]}];}_0x2a6abe=_[_0xc40f('0x3e')]({},_0x2a6abe,_0x4f5ff8[_0xc40f('0x3f')]);return db[_0xc40f('0x2b')]['find'](_0x2a6abe)[_0xc40f('0x28')](handleEntityNotFound(_0x10a476,null))[_0xc40f('0x28')](respondWithResult(_0x10a476,null))[_0xc40f('0x1e')](handleError(_0x10a476,null));};exports[_0xc40f('0x27')]=function(_0x3fecaf,_0xbfc589){if(_0x3fecaf['body']['id']){delete _0x3fecaf[_0xc40f('0x46')]['id'];}return db[_0xc40f('0x2b')][_0xc40f('0x47')]({'where':{'id':_0x3fecaf['params']['id']}})[_0xc40f('0x28')](handleEntityNotFound(_0xbfc589,null))[_0xc40f('0x28')](saveUpdates(_0x3fecaf[_0xc40f('0x46')],null))[_0xc40f('0x28')](respondWithResult(_0xbfc589,null))['catch'](handleError(_0xbfc589,null));};exports['destroy']=function(_0x1514e0,_0x42065b){return db[_0xc40f('0x2b')]['find']({'where':{'id':_0x1514e0[_0xc40f('0x43')]['id']}})[_0xc40f('0x28')](handleEntityNotFound(_0x42065b,null))['then'](removeEntity(_0x42065b,null))[_0xc40f('0x1e')](handleError(_0x42065b,null));};exports[_0xc40f('0x48')]=function(_0x3a3dee,_0x5677e7){return db[_0xc40f('0x2b')][_0xc40f('0x48')]()[_0xc40f('0x28')](respondWithResult(_0x5677e7,null))['catch'](handleError(_0x5677e7,null));};exports[_0xc40f('0x49')]=function(_0x4fc29c,_0x5c5c2b){return db[_0xc40f('0x2b')][_0xc40f('0x49')](_0x4fc29c['body'])[_0xc40f('0x28')](function(_0x31ec04){if(_0x31ec04){if(_0x31ec04[_0xc40f('0x4a')]===_0xc40f('0x4b')&&!_0x31ec04[_0xc40f('0x4c')]){var _0x6431e3,_0x2fb84f,_0x2c5797;if(_0x4fc29c['body']['to']){_0x2fb84f=_0x4fc29c[_0xc40f('0x46')]['to']['split'](',')[0x0];}return db[_0xc40f('0x4d')]['findOne']({'where':{'id':_0x31ec04[_0xc40f('0x4e')]},'include':[{'model':db[_0xc40f('0x4f')],'as':_0xc40f('0x50'),'include':[{'model':db[_0xc40f('0x51')],'as':_0xc40f('0x52'),'where':{'email':_0x2fb84f},'limit':0x1,'order':[[_0xc40f('0x53'),_0xc40f('0x54')]]}]},{'model':db[_0xc40f('0x55')],'as':_0xc40f('0x56'),'raw':!![]}]})[_0xc40f('0x28')](function(_0x456378){_0x6431e3=_0x456378;if(_0x6431e3&&_0x6431e3[_0xc40f('0x56')]){var _0x25f149={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x6431e3['Smtp']['service'])){_0x25f149['host']=_0x6431e3[_0xc40f('0x56')][_0xc40f('0x57')];_0x25f149['port']=_0x6431e3['Smtp']['port'];_0x25f149[_0xc40f('0x58')]=_0x6431e3[_0xc40f('0x56')][_0xc40f('0x58')];if(_0x6431e3[_0xc40f('0x56')]['authentication']){_0x25f149[_0xc40f('0x59')]={'user':_0x6431e3[_0xc40f('0x56')][_0xc40f('0x5a')],'pass':_0x6431e3[_0xc40f('0x56')][_0xc40f('0x5b')]};}}else{_0x25f149['service']=_0x6431e3[_0xc40f('0x56')][_0xc40f('0x5c')];_0x25f149['auth']={'user':_0x6431e3[_0xc40f('0x56')][_0xc40f('0x5a')],'pass':_0x6431e3[_0xc40f('0x56')]['pass']};_0x25f149['secure']=_0x6431e3[_0xc40f('0x56')][_0xc40f('0x58')];}if(_0x4fc29c['body'][_0xc40f('0x5d')]&&_0x4fc29c[_0xc40f('0x46')]['attachments'][_0xc40f('0x36')]){for(var _0x1728e2=0x0;_0x1728e2<_0x4fc29c[_0xc40f('0x46')]['attachments'][_0xc40f('0x36')];_0x1728e2+=0x1){_0x4fc29c['body'][_0xc40f('0x5d')][_0x1728e2]={'filename':_0x4fc29c[_0xc40f('0x46')][_0xc40f('0x5d')][_0x1728e2]['name'],'path':path[_0xc40f('0x5e')](config[_0xc40f('0x5f')],_0xc40f('0x60'),_0x4fc29c[_0xc40f('0x46')][_0xc40f('0x5d')][_0x1728e2][_0xc40f('0x61')])};}}_0x2c5797={'account':_0x25f149,'message':_0x4fc29c[_0xc40f('0x46')]};return;}})[_0xc40f('0x28')](function(){if(_0x6431e3[_0xc40f('0x50')]){if(_0x6431e3[_0xc40f('0x50')][_0xc40f('0x52')][_0xc40f('0x36')]){return _0x6431e3['List']['Contacts'][0x0];}else{return db[_0xc40f('0x51')][_0xc40f('0x49')](_['defaults'](_0x4fc29c[_0xc40f('0x46')],{'firstName':_0x4fc29c['body']['to'],'email':_0x4fc29c[_0xc40f('0x46')]['to'],'phone':_0x4fc29c[_0xc40f('0x46')]['to'],'ListId':_0x6431e3[_0xc40f('0x62')]}));}}else{throw new Error(_0xc40f('0x63'));}})[_0xc40f('0x28')](function(){if(_0x2c5797){return respondWithRpcPromise(_0xc40f('0x64'),_0xc40f('0x65'),_0x2c5797,client9003)[_0xc40f('0x28')](function(_0x2a28d7){return _0x31ec04['update']({'read':!![],'messageId':_0x2a28d7[_0xc40f('0x66')],'sentAt':moment()[_0xc40f('0x67')](_0xc40f('0x68'))});})[_0xc40f('0x1e')](function(_0x1002e1){logger[_0xc40f('0x1a')]('%s',JSON[_0xc40f('0x69')](_0x1002e1));return _0x31ec04;});}return _0x31ec04;});}return _0x31ec04;}})[_0xc40f('0x28')](respondWithResult(_0x5c5c2b,0xc9))[_0xc40f('0x1e')](handleError(_0x5c5c2b,null));};exports['accept']=function(_0x4501a6,_0x54009c){var _0x57af85={'agent':{},'channel':_0xc40f('0x6a')};if(_0x4501a6[_0xc40f('0x46')]['id']){delete _0x4501a6[_0xc40f('0x46')]['id'];}_0x4501a6[_0xc40f('0x46')][_0xc40f('0x6b')]=!![];_0x4501a6[_0xc40f('0x46')][_0xc40f('0x6c')]=moment()[_0xc40f('0x67')](_0xc40f('0x68'));_0x4501a6[_0xc40f('0x46')]['UserId']=_0x4501a6[_0xc40f('0x46')]['UserId']||_0x4501a6[_0xc40f('0x5a')]['id'];_0x57af85[_0xc40f('0x6d')]['id']=_0x4501a6[_0xc40f('0x46')][_0xc40f('0x6e')];return db['MailMessage']['find']({'where':{'id':_0x4501a6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x54009c,null))[_0xc40f('0x28')](saveUpdates(_0x4501a6[_0xc40f('0x46')],null))['then'](function(_0x59c0b0){if(_0x59c0b0){_0x57af85[_0xc40f('0x1c')]=_0x59c0b0[_0xc40f('0x6f')]({'plain':!![]});return db[_0xc40f('0x70')][_0xc40f('0x47')]({'where':{'id':_0x59c0b0['MailInteractionId']}});}return null;})[_0xc40f('0x28')](handleEntityNotFound(_0x54009c,null))[_0xc40f('0x28')](function(_0x3d0812){if(_0x3d0812){return _0x3d0812[_0xc40f('0x27')]({'UserId':_0x4501a6['body'][_0xc40f('0x6e')],'read1stAt':_[_0xc40f('0x71')](_0x3d0812[_0xc40f('0x72')])?moment()['format'](_0xc40f('0x68')):undefined});}return null;})[_0xc40f('0x28')](function(_0x2a097b){if(_0x2a097b){_0x57af85['interaction']=_0x2a097b['get']({'plain':!![]});interaction_log[_0xc40f('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4501a6[_0xc40f('0x5a')]['id'],_0x4501a6[_0xc40f('0x5a')][_0xc40f('0x2f')],_0x4501a6[_0xc40f('0x5a')][_0xc40f('0x73')],_0x57af85[_0xc40f('0x74')]['id'],_0x4501a6[_0xc40f('0x46')]?JSON[_0xc40f('0x69')](_0x4501a6[_0xc40f('0x46')]):_0xc40f('0x75'));return respondWithRpcPromise(_0xc40f('0x76'),_0xc40f('0x77'),_0x57af85);}return null;})[_0xc40f('0x28')](function(_0x4b699d){var _0x3d859d=_0xc40f('0x78')+_0x4b699d[_0xc40f('0x1c')][_0xc40f('0x79')];return db[_0xc40f('0x7a')][_0xc40f('0x30')](_0x3d859d,{'type':db[_0xc40f('0x7b')][_0xc40f('0x7c')]['SELECT'],'raw':!![]})[_0xc40f('0x28')](function(_0x4466d8){return _0x4466d8;});})[_0xc40f('0x28')](function(_0x5f1234){if(_0x5f1234){_0x57af85[_0xc40f('0x1c')][_0xc40f('0x7d')]=_0x5f1234[0x0];if(!_0x4501a6[_0xc40f('0x46')][_0xc40f('0x6e')])return;return db[_0xc40f('0x7e')]['find']({'where':{'id':_0x4501a6['body'][_0xc40f('0x6e')],'role':_0xc40f('0x6d')},'attributes':['id',_0xc40f('0x2f'),_0xc40f('0x7f'),_0xc40f('0x80'),_0xc40f('0x81')],'raw':!![]});}return null;})[_0xc40f('0x28')](function(_0x5b763e){if(!_0x5b763e)return null;_0x57af85['message'][_0xc40f('0x6d')]=_0x5b763e;return _0x57af85;})[_0xc40f('0x28')](function(_0x26b558){if(_0x26b558){if(_0x4501a6[_0xc40f('0x46')][_0xc40f('0x82')]){_0x57af85[_0xc40f('0x1c')][_0xc40f('0x83')]=util[_0xc40f('0x67')](_0xc40f('0x84'),_0x4501a6[_0xc40f('0x5a')][_0xc40f('0x2f')]);_0x57af85[_0xc40f('0x1c')]['channel']=_0x57af85[_0xc40f('0x85')];_0x57af85[_0xc40f('0x1c')][_0xc40f('0x86')]=_0x57af85[_0xc40f('0x85')];_0x57af85[_0xc40f('0x1c')][_0xc40f('0x87')]=_0xc40f('0x88');_0x57af85[_0xc40f('0x1c')][_0xc40f('0x46')]=htmlToText[_0xc40f('0x89')](_0x57af85[_0xc40f('0x1c')][_0xc40f('0x46')]);return respondWithRpcPromise(_0xc40f('0x8a'),'EventManager',{'event':_0xc40f('0x8b'),'message':_0x57af85[_0xc40f('0x1c')]},client9002)[_0xc40f('0x28')](function(){return _0x57af85;});}return _0x57af85;}return null;})[_0xc40f('0x28')](respondWithResult(_0x54009c,null))[_0xc40f('0x1e')](handleError(_0x54009c,null));};exports[_0xc40f('0x8c')]=function(_0x2bc202,_0x3dceef){var _0xf1519b={'agent':{},'channel':_0xc40f('0x6a')};if(_0x2bc202[_0xc40f('0x46')]['id']){delete _0x2bc202[_0xc40f('0x46')]['id'];}_0x2bc202[_0xc40f('0x46')][_0xc40f('0x6e')]=_0x2bc202[_0xc40f('0x46')][_0xc40f('0x6e')]||_0x2bc202['user']['id'];_0xf1519b['agent']['id']=_0x2bc202[_0xc40f('0x46')][_0xc40f('0x6e')];return db[_0xc40f('0x2b')][_0xc40f('0x47')]({'where':{'id':_0x2bc202[_0xc40f('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3dceef,null))['then'](function(_0x419a9c){if(_0x419a9c){_0xf1519b[_0xc40f('0x1c')]=_0x419a9c[_0xc40f('0x6f')]({'plain':!![]});return db[_0xc40f('0x70')][_0xc40f('0x47')]({'where':{'id':_0x419a9c[_0xc40f('0x8d')]}});}return null;})[_0xc40f('0x28')](handleEntityNotFound(_0x3dceef,null))[_0xc40f('0x28')](function(_0x290f22){if(_0x290f22){_0xf1519b['interaction']=_0x290f22[_0xc40f('0x6f')]({'plain':!![]});interaction_log[_0xc40f('0x15')](_0xc40f('0x8e'),_0x2bc202[_0xc40f('0x5a')]['id'],_0x2bc202[_0xc40f('0x5a')]['name'],_0x2bc202['user']['role'],_0xf1519b[_0xc40f('0x74')]['id'],_0x2bc202[_0xc40f('0x46')]?JSON[_0xc40f('0x69')](_0x2bc202['body']):'null');return respondWithRpcPromise(_0xc40f('0x8f'),_0xc40f('0x90'),_0xf1519b);}return null;})['then'](function(_0x52cd7d){var _0x28414b=_0xc40f('0x78')+_0x52cd7d[_0xc40f('0x1c')][_0xc40f('0x79')];return db[_0xc40f('0x7a')][_0xc40f('0x30')](_0x28414b,{'type':db[_0xc40f('0x7b')][_0xc40f('0x7c')]['SELECT'],'raw':!![]})[_0xc40f('0x28')](function(_0x134ad6){return _0x134ad6;});})['then'](function(_0x4637c0){if(_0x4637c0){_0xf1519b[_0xc40f('0x1c')][_0xc40f('0x7d')]=_0x4637c0[0x0];if(!_0x2bc202['body']['UserId'])return;return db['User'][_0xc40f('0x47')]({'where':{'id':_0x2bc202[_0xc40f('0x46')][_0xc40f('0x6e')],'role':_0xc40f('0x6d')},'attributes':['id',_0xc40f('0x2f'),_0xc40f('0x7f'),_0xc40f('0x80'),'internal'],'raw':!![]});}return null;})[_0xc40f('0x28')](function(_0xd6a49f){if(!_0xd6a49f)return null;_0xf1519b[_0xc40f('0x1c')][_0xc40f('0x6d')]=_0xd6a49f;return _0xf1519b;})[_0xc40f('0x28')](function(_0x5c50d1){if(_0x5c50d1){_0x5c50d1['message']['interface']=util[_0xc40f('0x67')]('SIP/%s',_0x2bc202[_0xc40f('0x5a')]['name']);_0x5c50d1[_0xc40f('0x1c')][_0xc40f('0x85')]=_0xf1519b[_0xc40f('0x85')];_0x5c50d1['message'][_0xc40f('0x86')]=_0xf1519b[_0xc40f('0x85')];_0x5c50d1[_0xc40f('0x1c')][_0xc40f('0x87')]=_0xc40f('0x8c');_0x5c50d1[_0xc40f('0x1c')]['body']=htmlToText['fromString'](_0xf1519b[_0xc40f('0x1c')][_0xc40f('0x46')]);respondWithRpcPromise(_0xc40f('0x8a'),_0xc40f('0x8a'),{'event':'rejectmessage','message':_0x5c50d1['message']},client9002);return _0xf1519b;}return null;})[_0xc40f('0x28')](respondWithResult(_0x3dceef,null))['catch'](handleError(_0x3dceef,null));};exports[_0xc40f('0x91')]=function(_0x36f036,_0xa1ba92){var _0xda62c2=moment()['unix']()[_0xc40f('0x92')]();var _0x2ca81a=path[_0xc40f('0x5e')](config['root'],_0xc40f('0x93'),'files',_0xc40f('0x94'));var _0x5c9497=path['join'](config[_0xc40f('0x5f')],'server','files',_0xc40f('0x5d'));var _0x118b93=util['format'](_0xc40f('0x95'),_0xda62c2);return db[_0xc40f('0x2b')][_0xc40f('0x47')]({'where':{'id':_0x36f036[_0xc40f('0x43')]['id']},'attributes':['id','body',_0xc40f('0x96'),'to','cc',_0xc40f('0x97'),_0xc40f('0x98'),_0xc40f('0x99')],'include':_0x36f036['query'][_0xc40f('0x5d')]?[{'model':db[_0xc40f('0x9a')],'as':'Attachments'}]:undefined})[_0xc40f('0x28')](handleEntityNotFound(_0xa1ba92,null))[_0xc40f('0x28')](function(_0x271c02){if(_0x271c02){var _0x26cf72=_0x271c02;var _0x2f08cb={'from':_0x26cf72[_0xc40f('0x96')],'to':_0x26cf72['to'],'subject':_0x26cf72[_0xc40f('0x98')],'html':htmlEntities['decode'](_0x26cf72['body']),'headers':{'Date':moment(_0x26cf72['createdAt'])[_0xc40f('0x67')](_0xc40f('0x9b'))},'attachments':[]};if(_0x271c02['cc']){_0x2f08cb[_0xc40f('0x9c')]['Cc']=_0x271c02['cc'];}if(_0x271c02['bcc']){_0x2f08cb['headers']['Bcc']=_0x271c02[_0xc40f('0x97')];}return new BPromise(function(_0x4bf438,_0x1448c0){if(_0x271c02['Attachments']){for(var _0x49d679=0x0;_0x49d679<_0x271c02['Attachments']['length'];_0x49d679++){var _0x348aab=_0x271c02[_0xc40f('0x9d')][_0x49d679];var _0x44aed7=path['join'](_0x5c9497,_0x348aab[_0xc40f('0x61')]);if(fs[_0xc40f('0x9e')](_0x44aed7)){_0x2f08cb[_0xc40f('0x5d')][_0xc40f('0x9f')]({'name':_0x348aab[_0xc40f('0x2f')],'contentType':_0x348aab[_0xc40f('0x2d')],'data':fs[_0xc40f('0xa0')](_0x44aed7)});}}}emlformat[_0xc40f('0xa1')](_0x2f08cb,function(_0x166ef6,_0x44997e){if(_0x166ef6)return _0x1448c0(_0x166ef6);fs['writeFileSync'](path[_0xc40f('0x5e')](_0x2ca81a,_0x118b93),_0x44997e);return _0x4bf438(_0x44997e);});});}})['then'](function(_0x4c97a9){if(_0x4c97a9){return _0xa1ba92[_0xc40f('0x91')](path[_0xc40f('0x5e')](_0x2ca81a,_0x118b93),_0x118b93,function(_0x336e03){if(!_0x336e03)fs[_0xc40f('0xa2')](path[_0xc40f('0x5e')](_0x2ca81a,_0x118b93));});}})['catch'](handleError(_0xa1ba92,null));}; \ No newline at end of file +var _0x64b1=['result','catch','status','json','limit','undefined','count','offset','set','update','destroy','stack','name','index','map','MailMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','pass','user','attachments','join','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','agent','get','MailInteractionId','read1stAt','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','SIP/%s','motionChannel','channel','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','contact','interface','event','rejectmessage','download','unix','toString','server','tmp','files','message-%s.eml','from','bcc','subject','Attachment','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x40e421,_0x176bf6){var _0x43d5e1=function(_0x435214){while(--_0x435214){_0x40e421['push'](_0x40e421['shift']());}};_0x43d5e1(++_0x176bf6);}(_0x64b1,0x12f));var _0x164b=function(_0x155b4c,_0x1f7872){_0x155b4c=_0x155b4c-0x0;var _0x350cb2=_0x64b1[_0x155b4c];return _0x350cb2;};'use strict';var emlformat=require(_0x164b('0x0'));var moment=require(_0x164b('0x1'));var BPromise=require('bluebird');var util=require(_0x164b('0x2'));var path=require(_0x164b('0x3'));var fs=require('fs');var _=require(_0x164b('0x4'));var Redis=require(_0x164b('0x5'));var htmlToText=require(_0x164b('0x6'));var qs=require(_0x164b('0x7'));var logger=require(_0x164b('0x8'))('api');var interaction_log=require(_0x164b('0x8'))('mail-interactions');var config=require('../../config/environment');var db=require(_0x164b('0x9'))['db'];config[_0x164b('0xa')]=_['defaults'](config[_0x164b('0xa')],{'host':_0x164b('0xb'),'port':0x18eb});var socket=require(_0x164b('0xc'))(new Redis(config[_0x164b('0xa')]));var htmlEntities=require('html-entities');require(_0x164b('0xd'))[_0x164b('0xe')](socket);var jayson=require(_0x164b('0xf'));var client=jayson[_0x164b('0x10')][_0x164b('0x11')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x164b('0x10')][_0x164b('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x57f98b,_0x4ec02,_0x4ee93f,_0x385db7){return new BPromise(function(_0x2763d8,_0x19fbae){var _0x3b3141=_0x385db7||client;return _0x3b3141['request'](_0x57f98b,_0x4ee93f)[_0x164b('0x12')](function(_0x599859){logger[_0x164b('0x13')](_0x164b('0x14'),_0x4ec02,_0x164b('0x15'));logger[_0x164b('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4ec02,_0x164b('0x15'),JSON[_0x164b('0x17')](_0x599859));if(_0x599859[_0x164b('0x18')]){if(_0x599859[_0x164b('0x18')][_0x164b('0x19')]===0x1f4){logger[_0x164b('0x18')](_0x164b('0x14'),_0x4ec02,_0x599859[_0x164b('0x18')][_0x164b('0x1a')]);return _0x19fbae(_0x599859['error'][_0x164b('0x1a')]);}logger[_0x164b('0x18')](_0x164b('0x14'),_0x4ec02,_0x599859[_0x164b('0x18')][_0x164b('0x1a')]);return _0x2763d8(_0x599859[_0x164b('0x18')]['message']);}else{logger[_0x164b('0x13')]('MailMessage,\x20%s,\x20%s',_0x4ec02,_0x164b('0x15'));_0x2763d8(_0x599859[_0x164b('0x1b')][_0x164b('0x1a')]);}})[_0x164b('0x1c')](function(_0x200bc8){logger['error'](_0x164b('0x14'),_0x4ec02,_0x200bc8);_0x19fbae(_0x200bc8);});});}function respondWithResult(_0x23b238,_0x4448a1){_0x4448a1=_0x4448a1||0xc8;return function(_0x4275ab){if(_0x4275ab){return _0x23b238[_0x164b('0x1d')](_0x4448a1)[_0x164b('0x1e')](_0x4275ab);}};}function respondWithFilteredResult(_0x384a0d,_0x40ce1b){return function(_0x1ff078){if(_0x1ff078){var _0xe1fe9e=typeof _0x40ce1b['offset']==='undefined'&&typeof _0x40ce1b[_0x164b('0x1f')]===_0x164b('0x20');var _0x5ef2c1=_0x1ff078[_0x164b('0x21')];var _0xbc7dd5=_0xe1fe9e?0x0:_0x40ce1b[_0x164b('0x22')];var _0x5db705=_0xe1fe9e?_0x1ff078['count']:_0x40ce1b[_0x164b('0x22')]+_0x40ce1b[_0x164b('0x1f')];var _0x532bec;if(_0x5db705>=_0x5ef2c1){_0x5db705=_0x5ef2c1;_0x532bec=0xc8;}else{_0x532bec=0xce;}_0x384a0d['status'](_0x532bec);return _0x384a0d[_0x164b('0x23')]('Content-Range',_0xbc7dd5+'-'+_0x5db705+'/'+_0x5ef2c1)[_0x164b('0x1e')](_0x1ff078);}return null;};}function saveUpdates(_0x55cf03){return function(_0x18f113){if(_0x18f113){return _0x18f113[_0x164b('0x24')](_0x55cf03)[_0x164b('0x12')](function(_0x1d0ed6){return _0x1d0ed6;});}return null;};}function removeEntity(_0xec1980){return function(_0x26e10a){if(_0x26e10a){return _0x26e10a[_0x164b('0x25')]()[_0x164b('0x12')](function(){_0xec1980[_0x164b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e86a5){return function(_0x24eea8){if(!_0x24eea8){_0x1e86a5['sendStatus'](0x194);}return _0x24eea8;};}function handleError(_0x76ab34,_0x5a7d13){_0x5a7d13=_0x5a7d13||0x1f4;return function(_0x21718e){logger[_0x164b('0x18')](_0x21718e[_0x164b('0x26')]);if(_0x21718e[_0x164b('0x27')]){delete _0x21718e[_0x164b('0x27')];}_0x76ab34[_0x164b('0x1d')](_0x5a7d13)['send'](_0x21718e);};}exports[_0x164b('0x28')]=function(_0x5931e0,_0x120170){var _0x5696c7={},_0x4cb947={},_0xadf3={'count':0x0,'rows':[]};var _0x7b7505=_[_0x164b('0x29')](db[_0x164b('0x2a')]['rawAttributes'],function(_0x31a7e8){return{'name':_0x31a7e8['fieldName'],'type':_0x31a7e8[_0x164b('0x2b')][_0x164b('0x2c')]};});_0x4cb947[_0x164b('0x2d')]=_[_0x164b('0x29')](_0x7b7505,_0x164b('0x27'));_0x4cb947[_0x164b('0x2e')]=_[_0x164b('0x2f')](_0x5931e0[_0x164b('0x2e')]);_0x4cb947[_0x164b('0x30')]=_[_0x164b('0x31')](_0x4cb947[_0x164b('0x2d')],_0x4cb947[_0x164b('0x2e')]);_0x5696c7[_0x164b('0x32')]=_[_0x164b('0x31')](_0x4cb947[_0x164b('0x2d')],qs[_0x164b('0x33')](_0x5931e0['query']['fields']));_0x5696c7[_0x164b('0x32')]=_0x5696c7[_0x164b('0x32')][_0x164b('0x34')]?_0x5696c7[_0x164b('0x32')]:_0x4cb947['model'];if(!_0x5931e0[_0x164b('0x2e')][_0x164b('0x35')](_0x164b('0x36'))){_0x5696c7[_0x164b('0x1f')]=qs['limit'](_0x5931e0['query']['limit']);_0x5696c7[_0x164b('0x22')]=qs[_0x164b('0x22')](_0x5931e0[_0x164b('0x2e')][_0x164b('0x22')]);}_0x5696c7['order']=qs[_0x164b('0x37')](_0x5931e0['query'][_0x164b('0x37')]);_0x5696c7[_0x164b('0x38')]=qs[_0x164b('0x30')](_['pick'](_0x5931e0['query'],_0x4cb947[_0x164b('0x30')]),_0x7b7505);if(_0x5931e0[_0x164b('0x2e')][_0x164b('0x39')]){_0x5696c7[_0x164b('0x38')]=_['merge'](_0x5696c7['where'],{'$or':_[_0x164b('0x29')](_0x7b7505,function(_0x419dda){if(_0x419dda[_0x164b('0x2b')]!=='VIRTUAL'){var _0x4d387b={};_0x4d387b[_0x419dda[_0x164b('0x27')]]={'$like':'%'+_0x5931e0[_0x164b('0x2e')][_0x164b('0x39')]+'%'};return _0x4d387b;}})});}_0x5696c7=_[_0x164b('0x3a')]({},_0x5696c7,_0x5931e0[_0x164b('0x3b')]);var _0x3d8246={'where':_0x5696c7[_0x164b('0x38')]};return db['MailMessage'][_0x164b('0x21')](_0x3d8246)[_0x164b('0x12')](function(_0x34a1b7){_0xadf3[_0x164b('0x21')]=_0x34a1b7;if(_0x5931e0[_0x164b('0x2e')][_0x164b('0x3c')]){_0x5696c7[_0x164b('0x3d')]=[{'all':!![]}];}return db[_0x164b('0x2a')][_0x164b('0x3e')](_0x5696c7);})[_0x164b('0x12')](function(_0x38e95d){_0xadf3[_0x164b('0x3f')]=_0x38e95d;return _0xadf3;})[_0x164b('0x12')](respondWithFilteredResult(_0x120170,_0x5696c7))[_0x164b('0x1c')](handleError(_0x120170,null));};exports['show']=function(_0x293f83,_0x160c54){var _0x1e7ffc={'raw':!![],'where':{'id':_0x293f83[_0x164b('0x40')]['id']}},_0x485147={};_0x485147[_0x164b('0x2d')]=_[_0x164b('0x2f')](db[_0x164b('0x2a')][_0x164b('0x41')]);_0x485147[_0x164b('0x2e')]=_[_0x164b('0x2f')](_0x293f83['query']);_0x485147['filters']=_[_0x164b('0x31')](_0x485147[_0x164b('0x2d')],_0x485147[_0x164b('0x2e')]);_0x1e7ffc[_0x164b('0x32')]=_['intersection'](_0x485147[_0x164b('0x2d')],qs[_0x164b('0x33')](_0x293f83[_0x164b('0x2e')][_0x164b('0x33')]));_0x1e7ffc[_0x164b('0x32')]=_0x1e7ffc[_0x164b('0x32')][_0x164b('0x34')]?_0x1e7ffc[_0x164b('0x32')]:_0x485147[_0x164b('0x2d')];if(_0x293f83[_0x164b('0x2e')][_0x164b('0x3c')]){_0x1e7ffc[_0x164b('0x3d')]=[{'all':!![]}];}_0x1e7ffc=_['merge']({},_0x1e7ffc,_0x293f83['options']);return db[_0x164b('0x2a')][_0x164b('0x42')](_0x1e7ffc)[_0x164b('0x12')](handleEntityNotFound(_0x160c54,null))[_0x164b('0x12')](respondWithResult(_0x160c54,null))[_0x164b('0x1c')](handleError(_0x160c54,null));};exports[_0x164b('0x24')]=function(_0x3184e3,_0x5da93b){if(_0x3184e3[_0x164b('0x43')]['id']){delete _0x3184e3[_0x164b('0x43')]['id'];}return db[_0x164b('0x2a')][_0x164b('0x42')]({'where':{'id':_0x3184e3[_0x164b('0x40')]['id']}})[_0x164b('0x12')](handleEntityNotFound(_0x5da93b,null))[_0x164b('0x12')](saveUpdates(_0x3184e3[_0x164b('0x43')],null))[_0x164b('0x12')](respondWithResult(_0x5da93b,null))['catch'](handleError(_0x5da93b,null));};exports[_0x164b('0x25')]=function(_0xdb522d,_0x398b82){return db[_0x164b('0x2a')][_0x164b('0x42')]({'where':{'id':_0xdb522d[_0x164b('0x40')]['id']}})[_0x164b('0x12')](handleEntityNotFound(_0x398b82,null))[_0x164b('0x12')](removeEntity(_0x398b82,null))[_0x164b('0x1c')](handleError(_0x398b82,null));};exports[_0x164b('0x44')]=function(_0x2ec875,_0x175ec0){return db['MailMessage'][_0x164b('0x44')]()[_0x164b('0x12')](respondWithResult(_0x175ec0,null))['catch'](handleError(_0x175ec0,null));};exports[_0x164b('0x45')]=function(_0x4e4df4,_0x2061ac){return db[_0x164b('0x2a')]['create'](_0x4e4df4[_0x164b('0x43')])['then'](function(_0x376033){if(_0x376033){if(_0x376033[_0x164b('0x46')]===_0x164b('0x47')&&!_0x376033[_0x164b('0x48')]){var _0x30b04b,_0x5a36e1,_0x2de4b5;if(_0x4e4df4[_0x164b('0x43')]['to']){_0x5a36e1=_0x4e4df4[_0x164b('0x43')]['to']['split'](',')[0x0];}return db[_0x164b('0x49')][_0x164b('0x4a')]({'where':{'id':_0x376033[_0x164b('0x4b')]},'include':[{'model':db[_0x164b('0x4c')],'as':_0x164b('0x4d'),'include':[{'model':db[_0x164b('0x4e')],'as':_0x164b('0x4f'),'where':{'email':_0x5a36e1},'limit':0x1,'order':[[_0x164b('0x50'),_0x164b('0x51')]]}]},{'model':db[_0x164b('0x52')],'as':_0x164b('0x53'),'raw':!![]}]})[_0x164b('0x12')](function(_0x19959c){_0x30b04b=_0x19959c;if(_0x30b04b&&_0x30b04b[_0x164b('0x53')]){var _0x3ecba2={'tls':{'rejectUnauthorized':![]}};if(_[_0x164b('0x54')](_0x30b04b[_0x164b('0x53')][_0x164b('0x55')])){_0x3ecba2[_0x164b('0x56')]=_0x30b04b[_0x164b('0x53')][_0x164b('0x56')];_0x3ecba2[_0x164b('0x57')]=_0x30b04b['Smtp'][_0x164b('0x57')];_0x3ecba2[_0x164b('0x58')]=_0x30b04b[_0x164b('0x53')][_0x164b('0x58')];if(_0x30b04b[_0x164b('0x53')][_0x164b('0x59')]){_0x3ecba2[_0x164b('0x5a')]={'user':_0x30b04b[_0x164b('0x53')]['user'],'pass':_0x30b04b[_0x164b('0x53')][_0x164b('0x5b')]};}}else{_0x3ecba2[_0x164b('0x55')]=_0x30b04b[_0x164b('0x53')][_0x164b('0x55')];_0x3ecba2[_0x164b('0x5a')]={'user':_0x30b04b[_0x164b('0x53')][_0x164b('0x5c')],'pass':_0x30b04b['Smtp']['pass']};_0x3ecba2[_0x164b('0x58')]=_0x30b04b[_0x164b('0x53')][_0x164b('0x58')];}if(_0x4e4df4['body'][_0x164b('0x5d')]&&_0x4e4df4['body']['attachments'][_0x164b('0x34')]){for(var _0x1c9d27=0x0;_0x1c9d27<_0x4e4df4[_0x164b('0x43')][_0x164b('0x5d')]['length'];_0x1c9d27+=0x1){_0x4e4df4[_0x164b('0x43')][_0x164b('0x5d')][_0x1c9d27]={'filename':_0x4e4df4['body'][_0x164b('0x5d')][_0x1c9d27][_0x164b('0x27')],'path':path[_0x164b('0x5e')](config[_0x164b('0x5f')],_0x164b('0x60'),_0x4e4df4[_0x164b('0x43')][_0x164b('0x5d')][_0x1c9d27][_0x164b('0x61')])};}}_0x2de4b5={'account':_0x3ecba2,'message':_0x4e4df4['body']};return;}})[_0x164b('0x12')](function(){if(_0x30b04b['List']){if(_0x30b04b['List'][_0x164b('0x4f')]['length']){return _0x30b04b[_0x164b('0x4d')][_0x164b('0x4f')][0x0];}else{return db[_0x164b('0x4e')][_0x164b('0x45')](_[_0x164b('0x62')](_0x4e4df4[_0x164b('0x43')],{'firstName':_0x4e4df4['body']['to'],'email':_0x4e4df4[_0x164b('0x43')]['to'],'phone':_0x4e4df4['body']['to'],'ListId':_0x30b04b[_0x164b('0x63')]}));}}else{throw new Error(_0x164b('0x64'));}})[_0x164b('0x12')](function(){if(_0x2de4b5){return respondWithRpcPromise(_0x164b('0x65'),_0x164b('0x66'),_0x2de4b5,client9003)[_0x164b('0x12')](function(_0x5417d9){return _0x376033[_0x164b('0x24')]({'read':!![],'messageId':_0x5417d9['messageId'],'sentAt':moment()[_0x164b('0x67')](_0x164b('0x68'))});})[_0x164b('0x1c')](function(_0x400775){logger[_0x164b('0x18')]('%s',JSON['stringify'](_0x400775));return _0x376033;});}return _0x376033;});}return _0x376033;}})['then'](respondWithResult(_0x2061ac,0xc9))[_0x164b('0x1c')](handleError(_0x2061ac,null));};exports['accept']=function(_0x2415f9,_0x2dbc1e){var _0x4a6986={'agent':{},'channel':_0x164b('0x69')};if(_0x2415f9[_0x164b('0x43')]['id']){delete _0x2415f9[_0x164b('0x43')]['id'];}_0x2415f9['body'][_0x164b('0x6a')]=!![];_0x2415f9[_0x164b('0x43')][_0x164b('0x6b')]=moment()[_0x164b('0x67')](_0x164b('0x68'));_0x2415f9[_0x164b('0x43')][_0x164b('0x6c')]=_0x2415f9[_0x164b('0x43')][_0x164b('0x6c')]||_0x2415f9[_0x164b('0x5c')]['id'];_0x4a6986[_0x164b('0x6d')]['id']=_0x2415f9[_0x164b('0x43')]['UserId'];return db['MailMessage'][_0x164b('0x42')]({'where':{'id':_0x2415f9['params']['id'],'UserId':null}})[_0x164b('0x12')](handleEntityNotFound(_0x2dbc1e,null))[_0x164b('0x12')](saveUpdates(_0x2415f9['body'],null))[_0x164b('0x12')](function(_0x1b1440){if(_0x1b1440){_0x4a6986[_0x164b('0x1a')]=_0x1b1440[_0x164b('0x6e')]({'plain':!![]});return db['MailInteraction'][_0x164b('0x42')]({'where':{'id':_0x1b1440[_0x164b('0x6f')]}});}return null;})[_0x164b('0x12')](handleEntityNotFound(_0x2dbc1e,null))['then'](function(_0x42c744){if(_0x42c744){return _0x42c744['update']({'UserId':_0x2415f9[_0x164b('0x43')]['UserId'],'read1stAt':_[_0x164b('0x54')](_0x42c744[_0x164b('0x70')])?moment()['format'](_0x164b('0x68')):undefined});}return null;})[_0x164b('0x12')](function(_0x41b3ad){if(_0x41b3ad){_0x4a6986['interaction']=_0x41b3ad[_0x164b('0x6e')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2415f9[_0x164b('0x5c')]['id'],_0x2415f9[_0x164b('0x5c')]['name'],_0x2415f9[_0x164b('0x5c')]['role'],_0x4a6986[_0x164b('0x71')]['id'],_0x2415f9[_0x164b('0x43')]?JSON[_0x164b('0x17')](_0x2415f9[_0x164b('0x43')]):'null');return respondWithRpcPromise(_0x164b('0x72'),_0x164b('0x73'),_0x4a6986);}return null;})['then'](function(_0x235cfc){var _0x1975e8=_0x164b('0x74')+_0x235cfc[_0x164b('0x1a')][_0x164b('0x75')];return db[_0x164b('0x76')][_0x164b('0x2e')](_0x1975e8,{'type':db[_0x164b('0x77')][_0x164b('0x78')][_0x164b('0x79')],'raw':!![]})[_0x164b('0x12')](function(_0x7512bb){return _0x7512bb;});})[_0x164b('0x12')](function(_0x508c92){if(_0x508c92){_0x4a6986[_0x164b('0x1a')]['contact']=_0x508c92[0x0];if(!_0x2415f9['body'][_0x164b('0x6c')])return;return db[_0x164b('0x7a')][_0x164b('0x42')]({'where':{'id':_0x2415f9[_0x164b('0x43')]['UserId'],'role':'agent'},'attributes':['id','name',_0x164b('0x7b'),_0x164b('0x7c'),_0x164b('0x7d')],'raw':!![]});}return null;})[_0x164b('0x12')](function(_0x41c554){if(!_0x41c554)return null;_0x4a6986[_0x164b('0x1a')][_0x164b('0x6d')]=_0x41c554;return _0x4a6986;})['then'](function(_0x459a7f){if(_0x459a7f){if(_0x2415f9[_0x164b('0x43')][_0x164b('0x7e')]){_0x4a6986[_0x164b('0x1a')]['interface']=util[_0x164b('0x67')](_0x164b('0x7f'),_0x2415f9[_0x164b('0x5c')][_0x164b('0x27')]);_0x4a6986['message']['channel']=_0x4a6986['channel'];_0x4a6986['message'][_0x164b('0x80')]=_0x4a6986[_0x164b('0x81')];_0x4a6986[_0x164b('0x1a')]['event']=_0x164b('0x82');_0x4a6986[_0x164b('0x1a')][_0x164b('0x43')]=htmlToText[_0x164b('0x83')](_0x4a6986[_0x164b('0x1a')][_0x164b('0x43')]);return respondWithRpcPromise(_0x164b('0x84'),_0x164b('0x84'),{'event':_0x164b('0x85'),'message':_0x4a6986[_0x164b('0x1a')]},client9002)['then'](function(){return _0x4a6986;});}return _0x4a6986;}return null;})[_0x164b('0x12')](respondWithResult(_0x2dbc1e,null))[_0x164b('0x1c')](handleError(_0x2dbc1e,null));};exports[_0x164b('0x86')]=function(_0x2bfbe8,_0x1f1a52){var _0x3d1ee4={'agent':{},'channel':_0x164b('0x69')};if(_0x2bfbe8[_0x164b('0x43')]['id']){delete _0x2bfbe8[_0x164b('0x43')]['id'];}_0x2bfbe8[_0x164b('0x43')][_0x164b('0x6c')]=_0x2bfbe8['body']['UserId']||_0x2bfbe8[_0x164b('0x5c')]['id'];_0x3d1ee4[_0x164b('0x6d')]['id']=_0x2bfbe8[_0x164b('0x43')]['UserId'];return db[_0x164b('0x2a')][_0x164b('0x42')]({'where':{'id':_0x2bfbe8[_0x164b('0x40')]['id'],'UserId':null}})[_0x164b('0x12')](handleEntityNotFound(_0x1f1a52,null))[_0x164b('0x12')](function(_0x15bdf6){if(_0x15bdf6){_0x3d1ee4[_0x164b('0x1a')]=_0x15bdf6[_0x164b('0x6e')]({'plain':!![]});return db['MailInteraction'][_0x164b('0x42')]({'where':{'id':_0x15bdf6[_0x164b('0x6f')]}});}return null;})[_0x164b('0x12')](handleEntityNotFound(_0x1f1a52,null))['then'](function(_0x863518){if(_0x863518){_0x3d1ee4[_0x164b('0x71')]=_0x863518[_0x164b('0x6e')]({'plain':!![]});interaction_log[_0x164b('0x13')](_0x164b('0x87'),_0x2bfbe8[_0x164b('0x5c')]['id'],_0x2bfbe8['user'][_0x164b('0x27')],_0x2bfbe8[_0x164b('0x5c')][_0x164b('0x88')],_0x3d1ee4[_0x164b('0x71')]['id'],_0x2bfbe8[_0x164b('0x43')]?JSON[_0x164b('0x17')](_0x2bfbe8[_0x164b('0x43')]):_0x164b('0x89'));return respondWithRpcPromise(_0x164b('0x8a'),'rejectMessage',_0x3d1ee4);}return null;})['then'](function(_0x2c7b74){var _0x257eeb=_0x164b('0x74')+_0x2c7b74[_0x164b('0x1a')][_0x164b('0x75')];return db[_0x164b('0x76')][_0x164b('0x2e')](_0x257eeb,{'type':db[_0x164b('0x77')][_0x164b('0x78')][_0x164b('0x79')],'raw':!![]})[_0x164b('0x12')](function(_0x41e59c){return _0x41e59c;});})['then'](function(_0x216ba3){if(_0x216ba3){_0x3d1ee4[_0x164b('0x1a')][_0x164b('0x8b')]=_0x216ba3[0x0];if(!_0x2bfbe8[_0x164b('0x43')][_0x164b('0x6c')])return;return db[_0x164b('0x7a')]['find']({'where':{'id':_0x2bfbe8[_0x164b('0x43')][_0x164b('0x6c')],'role':_0x164b('0x6d')},'attributes':['id',_0x164b('0x27'),_0x164b('0x7b'),_0x164b('0x7c'),_0x164b('0x7d')],'raw':!![]});}return null;})[_0x164b('0x12')](function(_0x1a0c8a){if(!_0x1a0c8a)return null;_0x3d1ee4[_0x164b('0x1a')]['agent']=_0x1a0c8a;return _0x3d1ee4;})[_0x164b('0x12')](function(_0x342263){if(_0x342263){_0x342263[_0x164b('0x1a')][_0x164b('0x8c')]=util[_0x164b('0x67')](_0x164b('0x7f'),_0x2bfbe8[_0x164b('0x5c')][_0x164b('0x27')]);_0x342263['message'][_0x164b('0x81')]=_0x3d1ee4[_0x164b('0x81')];_0x342263[_0x164b('0x1a')][_0x164b('0x80')]=_0x3d1ee4['channel'];_0x342263[_0x164b('0x1a')][_0x164b('0x8d')]='reject';_0x342263['message'][_0x164b('0x43')]=htmlToText[_0x164b('0x83')](_0x3d1ee4[_0x164b('0x1a')]['body']);respondWithRpcPromise(_0x164b('0x84'),_0x164b('0x84'),{'event':_0x164b('0x8e'),'message':_0x342263['message']},client9002);return _0x3d1ee4;}return null;})['then'](respondWithResult(_0x1f1a52,null))[_0x164b('0x1c')](handleError(_0x1f1a52,null));};exports[_0x164b('0x8f')]=function(_0x134031,_0xe08009){var _0x2917b0=moment()[_0x164b('0x90')]()[_0x164b('0x91')]();var _0x28bc0d=path[_0x164b('0x5e')](config[_0x164b('0x5f')],_0x164b('0x92'),'files',_0x164b('0x93'));var _0x2fbed7=path['join'](config[_0x164b('0x5f')],_0x164b('0x92'),_0x164b('0x94'),_0x164b('0x5d'));var _0x1e17bd=util[_0x164b('0x67')](_0x164b('0x95'),_0x2917b0);return db[_0x164b('0x2a')]['find']({'where':{'id':_0x134031[_0x164b('0x40')]['id']},'attributes':['id',_0x164b('0x43'),_0x164b('0x96'),'to','cc',_0x164b('0x97'),_0x164b('0x98'),'createdAt'],'include':_0x134031['query'][_0x164b('0x5d')]?[{'model':db[_0x164b('0x99')],'as':'Attachments'}]:undefined})[_0x164b('0x12')](handleEntityNotFound(_0xe08009,null))[_0x164b('0x12')](function(_0x39ccdc){if(_0x39ccdc){var _0x4974d6=_0x39ccdc;var _0x542cc2={'from':_0x4974d6['from'],'to':_0x4974d6['to'],'subject':_0x4974d6['subject'],'html':htmlEntities[_0x164b('0x9a')](_0x4974d6['body']),'headers':{'Date':moment(_0x4974d6[_0x164b('0x9b')])['format'](_0x164b('0x9c'))},'attachments':[]};if(_0x39ccdc['cc']){_0x542cc2[_0x164b('0x9d')]['Cc']=_0x39ccdc['cc'];}if(_0x39ccdc[_0x164b('0x97')]){_0x542cc2[_0x164b('0x9d')][_0x164b('0x9e')]=_0x39ccdc[_0x164b('0x97')];}return new BPromise(function(_0x1b850d,_0x4d43cd){if(_0x39ccdc['Attachments']){for(var _0x10a28c=0x0;_0x10a28c<_0x39ccdc[_0x164b('0x9f')][_0x164b('0x34')];_0x10a28c++){var _0x46d7c2=_0x39ccdc[_0x164b('0x9f')][_0x10a28c];var _0x57bafd=path['join'](_0x2fbed7,_0x46d7c2[_0x164b('0x61')]);if(fs[_0x164b('0xa0')](_0x57bafd)){_0x542cc2[_0x164b('0x5d')][_0x164b('0xa1')]({'name':_0x46d7c2[_0x164b('0x27')],'contentType':_0x46d7c2[_0x164b('0x2b')],'data':fs[_0x164b('0xa2')](_0x57bafd)});}}}emlformat['build'](_0x542cc2,function(_0x670c0e,_0x4822c2){if(_0x670c0e)return _0x4d43cd(_0x670c0e);fs[_0x164b('0xa3')](path[_0x164b('0x5e')](_0x28bc0d,_0x1e17bd),_0x4822c2);return _0x1b850d(_0x4822c2);});});}})[_0x164b('0x12')](function(_0x23ccd1){if(_0x23ccd1){return _0xe08009[_0x164b('0x8f')](path[_0x164b('0x5e')](_0x28bc0d,_0x1e17bd),_0x1e17bd,function(_0x5d4b35){if(!_0x5d4b35)fs[_0x164b('0xa4')](path['join'](_0x28bc0d,_0x1e17bd));});}})[_0x164b('0x1c')](handleError(_0xe08009,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1ded389..470edd5 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 _0xa4f6=['MailMessage','setMaxListeners','save','update','remove','hook','exports','events','../../mysqldb'];(function(_0xcbe787,_0x401e4c){var _0x4c78fa=function(_0x392922){while(--_0x392922){_0xcbe787['push'](_0xcbe787['shift']());}};_0x4c78fa(++_0x401e4c);}(_0xa4f6,0xc4));var _0x6a4f=function(_0x1f6f06,_0xfeb50){_0x1f6f06=_0x1f6f06-0x0;var _0x13c0e5=_0xa4f6[_0x1f6f06];return _0x13c0e5;};'use strict';var EventEmitter=require(_0x6a4f('0x0'));var MailMessage=require(_0x6a4f('0x1'))['db'][_0x6a4f('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6a4f('0x3')](0x0);var events={'afterCreate':_0x6a4f('0x4'),'afterUpdate':_0x6a4f('0x5'),'afterDestroy':_0x6a4f('0x6')};function emitEvent(_0x1e8606){return function(_0x1ac71f,_0xbb0d19,_0x35c2d5){MailMessageEvents['emit'](_0x1e8606+':'+_0x1ac71f['id'],_0x1ac71f);MailMessageEvents['emit'](_0x1e8606,_0x1ac71f);_0x35c2d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x6a4f('0x7')](e,emitEvent(event));}}module[_0x6a4f('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x3725=['emit','hasOwnProperty','hook','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x4a26e9,_0x10632d){var _0x3ed2d5=function(_0x12ec67){while(--_0x12ec67){_0x4a26e9['push'](_0x4a26e9['shift']());}};_0x3ed2d5(++_0x10632d);}(_0x3725,0x192));var _0x5372=function(_0x375f1b,_0x5330f9){_0x375f1b=_0x375f1b-0x0;var _0x7d4067=_0x3725[_0x375f1b];return _0x7d4067;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x5372('0x0'))['db'][_0x5372('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5372('0x2')](0x0);var events={'afterCreate':_0x5372('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xea1086){return function(_0x5a06cb,_0x3615b6,_0x2a082b){MailMessageEvents[_0x5372('0x4')](_0xea1086+':'+_0x5a06cb['id'],_0x5a06cb);MailMessageEvents[_0x5372('0x4')](_0xea1086,_0x5a06cb);_0x2a082b(null);};}for(var e in events){if(events[_0x5372('0x5')](e)){var event=events[e];MailMessage[_0x5372('0x6')](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 4d8a614..b23f65f 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 _0x5d6a=['html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','get','toLowerCase','direction','out','secret','UserId','MailInteractionId','then','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1305f1,_0x49314f){var _0x48f73f=function(_0x222fec){while(--_0x222fec){_0x1305f1['push'](_0x1305f1['shift']());}};_0x48f73f(++_0x49314f);}(_0x5d6a,0x180));var _0xa5d6=function(_0x376a6c,_0xbab840){_0x376a6c=_0x376a6c-0x0;var _0x13fe96=_0x5d6a[_0x376a6c];return _0x13fe96;};'use strict';var _=require(_0xa5d6('0x0'));var util=require(_0xa5d6('0x1'));var logger=require(_0xa5d6('0x2'))(_0xa5d6('0x3'));var moment=require(_0xa5d6('0x4'));var BPromise=require('bluebird');var rp=require(_0xa5d6('0x5'));var htmlToText=require(_0xa5d6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5d6('0x7'));var config=require(_0xa5d6('0x8'));var attributes=require(_0xa5d6('0x9'));module[_0xa5d6('0xa')]=function(_0x4b3b96,_0x11ca45){return _0x4b3b96[_0xa5d6('0xb')](_0xa5d6('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xa5d6('0xd'),'fields':['messageId']},{'name':_0xa5d6('0xe'),'fields':[_0xa5d6('0xf'),'subject'],'type':_0xa5d6('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10fd53,_0x4cc626,_0x1f538a){if(_0x10fd53[_0xa5d6('0x11')]){_0x10fd53[_0xa5d6('0xf')]=htmlToText[_0xa5d6('0x12')](_0x10fd53[_0xa5d6('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1f538a(null,_0x4cc626);},'afterCreate':function(_0x5874e7,_0x35bbaf,_0x26f008){var _0x53b8f1=_0x4b3b96['models'];var _0x5dbb21=_0x5874e7[_0xa5d6('0x13')]({'plain':!![]});if(_0x5dbb21['direction'][_0xa5d6('0x14')]()==='in'||_0x5dbb21[_0xa5d6('0x15')][_0xa5d6('0x14')]()===_0xa5d6('0x16')&&!_0x5dbb21[_0xa5d6('0x17')]&&!_['isNil'](_0x5dbb21[_0xa5d6('0x18')])){_0x53b8f1['MailInteraction']['findOne']({'where':{'id':_0x5dbb21[_0xa5d6('0x19')]}})[_0xa5d6('0x1a')](function(_0x3ba246){if(_0x3ba246){_0x3ba246['update']({'lastMsgAt':_0x5dbb21[_0xa5d6('0x1b')],'lastMsgDirection':_0x5dbb21['direction'][_0xa5d6('0x14')]()});}})['catch'](function(_0x5d6394){console[_0xa5d6('0x1c')](_0x5d6394);});}_0x26f008();}},'charset':_0xa5d6('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x284b=['subject','FULLTEXT','body','plainBody','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages'];(function(_0x432c17,_0x232b30){var _0x246440=function(_0x4a744e){while(--_0x4a744e){_0x432c17['push'](_0x432c17['shift']());}};_0x246440(++_0x232b30);}(_0x284b,0x17c));var _0xb284=function(_0x1e6b9a,_0x4f64b5){_0x1e6b9a=_0x1e6b9a-0x0;var _0x16495a=_0x284b[_0x1e6b9a];return _0x16495a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb284('0x0'))(_0xb284('0x1'));var moment=require(_0xb284('0x2'));var BPromise=require(_0xb284('0x3'));var rp=require(_0xb284('0x4'));var htmlToText=require(_0xb284('0x5'));var fs=require('fs');var path=require(_0xb284('0x6'));var rimraf=require(_0xb284('0x7'));var config=require(_0xb284('0x8'));var attributes=require(_0xb284('0x9'));module[_0xb284('0xa')]=function(_0x34481f,_0x2e715a){return _0x34481f[_0xb284('0xb')](_0xb284('0xc'),attributes,{'tableName':_0xb284('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb284('0xe')]},{'name':_0xb284('0xf'),'fields':['plainBody',_0xb284('0x10')],'type':_0xb284('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40212f,_0x2e6422,_0x5f16f4){if(_0x40212f[_0xb284('0x12')]){_0x40212f[_0xb284('0x13')]=htmlToText[_0xb284('0x14')](_0x40212f[_0xb284('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5f16f4(null,_0x2e6422);},'afterCreate':function(_0xe55bc9,_0x3c5d48,_0x11deeb){var _0x35590f=_0x34481f[_0xb284('0x15')];var _0x6c9fef=_0xe55bc9['get']({'plain':!![]});if(_0x6c9fef[_0xb284('0x16')]['toLowerCase']()==='in'||_0x6c9fef['direction'][_0xb284('0x17')]()===_0xb284('0x18')&&!_0x6c9fef[_0xb284('0x19')]&&!_[_0xb284('0x1a')](_0x6c9fef[_0xb284('0x1b')])){_0x35590f[_0xb284('0x1c')]['findOne']({'where':{'id':_0x6c9fef[_0xb284('0x1d')]}})[_0xb284('0x1e')](function(_0x1836ac){if(_0x1836ac){_0x1836ac[_0xb284('0x1f')]({'lastMsgAt':_0x6c9fef['createdAt'],'lastMsgDirection':_0x6c9fef[_0xb284('0x16')]['toLowerCase']()});}})[_0xb284('0x20')](function(_0x439a22){console[_0xb284('0x21')](_0x439a22);});}_0x11deeb();}},'charset':_0xb284('0x22'),'collate':_0xb284('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 76ade16..663f33d 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 _0x14a0=['code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x19139c,_0x381187){var _0x7824ad=function(_0x5f33f5){while(--_0x5f33f5){_0x19139c['push'](_0x19139c['shift']());}};_0x7824ad(++_0x381187);}(_0x14a0,0x8e));var _0x014a=function(_0x35cf0b,_0x5d4b8e){_0x35cf0b=_0x35cf0b-0x0;var _0x19528a=_0x14a0[_0x35cf0b];return _0x19528a;};'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});config['redis']=_[_0x014a('0xa')](config[_0x014a('0xb')],{'host':_0x014a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x014a('0xd'))['register'](socket);function respondWithRpcPromise(_0x490ea2,_0x5aa52f,_0x4f3539){return new BPromise(function(_0x330469,_0x4c7418){return client[_0x014a('0xe')](_0x490ea2,_0x4f3539)[_0x014a('0xf')](function(_0x543bbf){logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));logger[_0x014a('0x13')](_0x014a('0x14'),_0x5aa52f,_0x014a('0x12'),JSON[_0x014a('0x15')](_0x543bbf));if(_0x543bbf[_0x014a('0x16')]){if(_0x543bbf[_0x014a('0x16')][_0x014a('0x17')]===0x1f4){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x4c7418(_0x543bbf[_0x014a('0x16')]['message']);}logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x330469(_0x543bbf[_0x014a('0x16')][_0x014a('0x18')]);}else{logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));_0x330469(_0x543bbf[_0x014a('0x19')][_0x014a('0x18')]);}})[_0x014a('0x1a')](function(_0x3b9341){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x3b9341);_0x4c7418(_0x3b9341);});});}exports[_0x014a('0x1b')]=function(_0x34e5c3){var _0x5c69c5=this;return new Promise(function(_0x359903,_0x109a9c){return db[_0x014a('0x1c')][_0x014a('0x1d')](_0x34e5c3[_0x014a('0x1e')],{'raw':_0x34e5c3[_0x014a('0x1f')]?_0x34e5c3[_0x014a('0x1f')][_0x014a('0x20')]===undefined?!![]:![]:!![]})[_0x014a('0xf')](function(_0x486e66){logger[_0x014a('0x10')]('CreateMailMessage',_0x34e5c3);logger[_0x014a('0x13')](_0x014a('0x1b'),_0x34e5c3,JSON[_0x014a('0x15')](_0x486e66));_0x359903(_0x486e66);})[_0x014a('0x1a')](function(_0x2b3c10){logger[_0x014a('0x16')](_0x014a('0x1b'),_0x2b3c10[_0x014a('0x18')],_0x34e5c3);_0x109a9c(_0x5c69c5[_0x014a('0x16')](0x1f4,_0x2b3c10['message']));});});}; \ No newline at end of file +var _0x1a37=['debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent'];(function(_0x4a582d,_0x505738){var _0x4c8217=function(_0x2c1788){while(--_0x2c1788){_0x4a582d['push'](_0x4a582d['shift']());}};_0x4c8217(++_0x505738);}(_0x1a37,0xb4));var _0x71a3=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1a37[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});}exports[_0x71a3('0x1b')]=function(_0x1c4ec2){var _0x4a7980=this;return new Promise(function(_0x596328,_0x1ab947){return db[_0x71a3('0x1c')][_0x71a3('0x1d')](_0x1c4ec2[_0x71a3('0x1e')],{'raw':_0x1c4ec2[_0x71a3('0x1f')]?_0x1c4ec2['options'][_0x71a3('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3bf78e){logger[_0x71a3('0x19')](_0x71a3('0x1b'),_0x1c4ec2);logger[_0x71a3('0x12')](_0x71a3('0x1b'),_0x1c4ec2,JSON[_0x71a3('0x14')](_0x3bf78e));_0x596328(_0x3bf78e);})['catch'](function(_0x26e6e7){logger[_0x71a3('0x15')](_0x71a3('0x1b'),_0x26e6e7[_0x71a3('0x18')],_0x1c4ec2);_0x1ab947(_0x4a7980[_0x71a3('0x15')](0x1f4,_0x26e6e7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index ac34755..66d8994 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 _0x12c9=['removeListener','length','./mailMessage.events','save','remove','update','emit'];(function(_0x20bedd,_0x39694b){var _0x3041f3=function(_0x1f53ee){while(--_0x1f53ee){_0x20bedd['push'](_0x20bedd['shift']());}};_0x3041f3(++_0x39694b);}(_0x12c9,0x1c9));var _0x912c=function(_0x31ca80,_0x57eb03){_0x31ca80=_0x31ca80-0x0;var _0x4290f0=_0x12c9[_0x31ca80];return _0x4290f0;};'use strict';var MailMessageEvents=require(_0x912c('0x0'));var events=[_0x912c('0x1'),_0x912c('0x2'),_0x912c('0x3')];function createListener(_0x18e94b,_0x5420d6){return function(_0x10ebce){_0x5420d6[_0x912c('0x4')](_0x18e94b,_0x10ebce);};}function removeListener(_0x2c8059,_0x298dcc){return function(){MailMessageEvents[_0x912c('0x5')](_0x2c8059,_0x298dcc);};}exports['register']=function(_0x584a27){for(var _0xe29019=0x0,_0x3180b0=events[_0x912c('0x6')];_0xe29019<_0x3180b0;_0xe29019++){var _0x3452dc=events[_0xe29019];var _0x312a7f=createListener('mailMessage:'+_0x3452dc,_0x584a27);MailMessageEvents['on'](_0x3452dc,_0x312a7f);}}; \ No newline at end of file +var _0x6f36=['save','remove','update','emit','removeListener','length','mailMessage:'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x6f36,0x149));var _0x66f3=function(_0x13130d,_0x32ea9c){_0x13130d=_0x13130d-0x0;var _0x29c414=_0x6f36[_0x13130d];return _0x29c414;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x66f3('0x0'),_0x66f3('0x1'),_0x66f3('0x2')];function createListener(_0x4642ac,_0x3353b9){return function(_0x1964ec){_0x3353b9[_0x66f3('0x3')](_0x4642ac,_0x1964ec);};}function removeListener(_0x577519,_0xa2a85a){return function(){MailMessageEvents[_0x66f3('0x4')](_0x577519,_0xa2a85a);};}exports['register']=function(_0x2ebb0c){for(var _0x398acc=0x0,_0x4bbc72=events[_0x66f3('0x5')];_0x398acc<_0x4bbc72;_0x398acc++){var _0x46faab=events[_0x398acc];var _0x67a89f=createListener(_0x66f3('0x6')+_0x46faab,_0x2ebb0c);MailMessageEvents['on'](_0x46faab,_0x67a89f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 5d9f094..5fd31c6 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 _0xe9d6=['/:id/teams','getTeams','getAgents','post','create','/:id/users','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers'];(function(_0x13eec6,_0x170127){var _0x585c24=function(_0x3052df){while(--_0x3052df){_0x13eec6['push'](_0x13eec6['shift']());}};_0x585c24(++_0x170127);}(_0xe9d6,0x84));var _0x6e9d=function(_0x333bf8,_0x5e5603){_0x333bf8=_0x333bf8-0x0;var _0x7e0e6=_0xe9d6[_0x333bf8];return _0x7e0e6;};'use strict';var multer=require(_0x6e9d('0x0'));var util=require(_0x6e9d('0x1'));var path=require(_0x6e9d('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e9d('0x3'));var router=express[_0x6e9d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6e9d('0x5'));var interaction=require(_0x6e9d('0x6'));var config=require(_0x6e9d('0x7'));var controller=require(_0x6e9d('0x8'));router[_0x6e9d('0x9')]('/',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0xb')]);router[_0x6e9d('0x9')](_0x6e9d('0xc'),auth['isAuthenticated'](),controller[_0x6e9d('0xd')]);router['get'](_0x6e9d('0xe'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0xf')]);router[_0x6e9d('0x9')](_0x6e9d('0x10'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x11')]);router[_0x6e9d('0x9')](_0x6e9d('0x12'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x13')]);router[_0x6e9d('0x9')]('/:id/users',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x14')]);router[_0x6e9d('0x15')]('/',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x16')]);router['post'](_0x6e9d('0x12'),auth[_0x6e9d('0xa')](),controller['addTeams']);router['post'](_0x6e9d('0x17'),auth[_0x6e9d('0xa')](),controller['addAgents']);router[_0x6e9d('0x18')](_0x6e9d('0xe'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x19')]);router[_0x6e9d('0x1a')](_0x6e9d('0xe'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x1b')]);router[_0x6e9d('0x1a')](_0x6e9d('0x12'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x1c')]);router[_0x6e9d('0x1a')](_0x6e9d('0x17'),auth[_0x6e9d('0xa')](),controller['removeAgents']);module[_0x6e9d('0x1d')]=router; \ No newline at end of file +var _0xb59b=['../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xb59b,0x156));var _0xbb59=function(_0x111327,_0x54ac35){_0x111327=_0x111327-0x0;var _0x28b071=_0xb59b[_0x111327];return _0x28b071;};'use strict';var multer=require(_0xbb59('0x0'));var util=require('util');var path=require(_0xbb59('0x1'));var timeout=require(_0xbb59('0x2'));var express=require('express');var router=express[_0xbb59('0x3')]();var fs_extra=require(_0xbb59('0x4'));var auth=require(_0xbb59('0x5'));var interaction=require(_0xbb59('0x6'));var config=require(_0xbb59('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbb59('0x8')]('/describe',auth[_0xbb59('0x9')](),controller[_0xbb59('0xa')]);router[_0xbb59('0x8')](_0xbb59('0xb'),auth[_0xbb59('0x9')](),controller[_0xbb59('0xc')]);router['get'](_0xbb59('0xd'),auth[_0xbb59('0x9')](),controller[_0xbb59('0xe')]);router[_0xbb59('0x8')](_0xbb59('0xf'),auth[_0xbb59('0x9')](),controller[_0xbb59('0x10')]);router[_0xbb59('0x8')](_0xbb59('0x11'),auth[_0xbb59('0x9')](),controller['getAgents']);router[_0xbb59('0x12')]('/',auth[_0xbb59('0x9')](),controller[_0xbb59('0x13')]);router[_0xbb59('0x12')]('/:id/teams',auth[_0xbb59('0x9')](),controller[_0xbb59('0x14')]);router[_0xbb59('0x12')]('/:id/users',auth[_0xbb59('0x9')](),controller[_0xbb59('0x15')]);router[_0xbb59('0x16')]('/:id',auth[_0xbb59('0x9')](),controller[_0xbb59('0x17')]);router[_0xbb59('0x18')]('/:id',auth[_0xbb59('0x9')](),controller[_0xbb59('0x19')]);router[_0xbb59('0x18')]('/:id/teams',auth[_0xbb59('0x9')](),controller[_0xbb59('0x1a')]);router[_0xbb59('0x18')]('/:id/users',auth[_0xbb59('0x9')](),controller[_0xbb59('0x1b')]);module[_0xbb59('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 8dbc5f2..b082f97 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 _0xcce5=['name','STRING','INTEGER','beepall','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcce5,0x1d8));var _0x5cce=function(_0x324338,_0x3c2c0b){_0x324338=_0x324338-0x0;var _0x3ba432=_0xcce5[_0x324338];return _0x3ba432;};'use strict';var Sequelize=require(_0x5cce('0x0'));module[_0x5cce('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5cce('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5cce('0x3')]},'timeout':{'type':Sequelize[_0x5cce('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x5cce('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x68fd=['STRING','name','INTEGER','ENUM','beepall','exports'];(function(_0xb64719,_0x2a5f01){var _0x17dca7=function(_0x5a40ba){while(--_0x5a40ba){_0xb64719['push'](_0xb64719['shift']());}};_0x17dca7(++_0x2a5f01);}(_0x68fd,0x71));var _0xd68f=function(_0x2f76af,_0x1b3cc5){_0x2f76af=_0x2f76af-0x0;var _0xc432c2=_0x68fd[_0x2f76af];return _0xc432c2;};'use strict';var Sequelize=require('sequelize');module[_0xd68f('0x0')]={'name':{'type':Sequelize[_0xd68f('0x1')],'unique':_0xd68f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd68f('0x1')]},'timeout':{'type':Sequelize[_0xd68f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd68f('0x4')]('rrmemory',_0xd68f('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a5594ce..c23d63f 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 _0x28c8=['TeamId','all','union','value','removeTeams','removeAgents','userMailQueue:remove','omit','spread','userMailQueue:save','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','offset','undefined','limit','Content-Range','reject','save','update','then','get','MailQueues','UserProfileResource','destroy','sendStatus','stack','name','map','MailQueue','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','params','describe','findOne','UserMailQueue','hasOwnProperty','MailQueueId','filter','User','UserId','mailPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','ids','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every'];(function(_0x2cbc3e,_0x4ebc81){var _0x2a8199=function(_0x10a193){while(--_0x10a193){_0x2cbc3e['push'](_0x2cbc3e['shift']());}};_0x2a8199(++_0x4ebc81);}(_0x28c8,0x97));var _0x828c=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x28c8[_0xb725be];return _0x2f2424;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x828c('0x0'));var zipdir=require(_0x828c('0x1'));var jsonpatch=require(_0x828c('0x2'));var rp=require(_0x828c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x828c('0x4'));var util=require('util');var path=require(_0x828c('0x5'));var sox=require(_0x828c('0x6'));var csv=require(_0x828c('0x7'));var ejs=require(_0x828c('0x8'));var fs=require('fs');var fs_extra=require(_0x828c('0x9'));var _=require(_0x828c('0xa'));var squel=require('squel');var crypto=require(_0x828c('0xb'));var jsforce=require(_0x828c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x828c('0x7'));var querystring=require(_0x828c('0xd'));var Papa=require(_0x828c('0xe'));var Redis=require(_0x828c('0xf'));var authService=require(_0x828c('0x10'));var qs=require(_0x828c('0x11'));var as=require(_0x828c('0x12'));var hardwareService=require(_0x828c('0x13'));var logger=require(_0x828c('0x14'))(_0x828c('0x15'));var utils=require(_0x828c('0x16'));var config=require(_0x828c('0x17'));var licenseUtil=require(_0x828c('0x18'));var db=require(_0x828c('0x19'))['db'];config['redis']=_['defaults'](config[_0x828c('0x1a')],{'host':_0x828c('0x1b'),'port':0x18eb});var socket=require(_0x828c('0x1c'))(new Redis(config[_0x828c('0x1a')]));require(_0x828c('0x1d'))[_0x828c('0x1e')](socket);function respondWithStatusCode(_0x27a795,_0x43b9aa){_0x43b9aa=_0x43b9aa||0xcc;return function(_0x41e35a){if(_0x41e35a){return _0x27a795['sendStatus'](_0x43b9aa);}return _0x27a795['status'](_0x43b9aa)['end']();};}function respondWithResult(_0x5a474d,_0x298eb5){_0x298eb5=_0x298eb5||0xc8;return function(_0x204af7){if(_0x204af7){return _0x5a474d[_0x828c('0x1f')](_0x298eb5)[_0x828c('0x20')](_0x204af7);}};}function respondWithFilteredResult(_0x56709f,_0x4fb97c){return function(_0x254cdb){if(_0x254cdb){var _0x2976a7=typeof _0x4fb97c[_0x828c('0x21')]===_0x828c('0x22')&&typeof _0x4fb97c[_0x828c('0x23')]===_0x828c('0x22');var _0x43331a=_0x254cdb['count'];var _0x4c94d0=_0x2976a7?0x0:_0x4fb97c['offset'];var _0x3a2902=_0x2976a7?_0x254cdb['count']:_0x4fb97c['offset']+_0x4fb97c['limit'];var _0x20a9e0;if(_0x3a2902>=_0x43331a){_0x3a2902=_0x43331a;_0x20a9e0=0xc8;}else{_0x20a9e0=0xce;}_0x56709f[_0x828c('0x1f')](_0x20a9e0);return _0x56709f['set'](_0x828c('0x24'),_0x4c94d0+'-'+_0x3a2902+'/'+_0x43331a)['json'](_0x254cdb);}return null;};}function patchUpdates(_0x5f40c0){return function(_0x39805b){try{jsonpatch['apply'](_0x39805b,_0x5f40c0,!![]);}catch(_0x48a8f4){return BPromise[_0x828c('0x25')](_0x48a8f4);}return _0x39805b[_0x828c('0x26')]();};}function saveUpdates(_0x21772d,_0x24f4d1){return function(_0x541969){if(_0x541969){return _0x541969[_0x828c('0x27')](_0x21772d)[_0x828c('0x28')](function(_0xb1cec5){return _0xb1cec5;});}return null;};}function removeEntity(_0x4cf691,_0x291c38){return function(_0x38e5a0){if(_0x38e5a0){return _0x38e5a0['destroy']()[_0x828c('0x28')](function(){var _0x1807c6=_0x38e5a0[_0x828c('0x29')]({'plain':!![]});var _0x4d0f20=_0x828c('0x2a');return db[_0x828c('0x2b')][_0x828c('0x2c')]({'where':{'type':_0x4d0f20,'resourceId':_0x1807c6['id']}})[_0x828c('0x28')](function(){return _0x38e5a0;});})[_0x828c('0x28')](function(){_0x4cf691[_0x828c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a4864,_0x4fe55b){return function(_0x4dd4ed){if(!_0x4dd4ed){_0x3a4864[_0x828c('0x2d')](0x194);}return _0x4dd4ed;};}function handleError(_0x2bbf97,_0x45ecdc){_0x45ecdc=_0x45ecdc||0x1f4;return function(_0x294daf){logger['error'](_0x294daf[_0x828c('0x2e')]);if(_0x294daf[_0x828c('0x2f')]){delete _0x294daf[_0x828c('0x2f')];}_0x2bbf97['status'](_0x45ecdc)['send'](_0x294daf);};}exports['index']=function(_0x246b22,_0x3f716d){var _0x4dbfa6={},_0x1c911a={},_0x6d3015={'count':0x0,'rows':[]};var _0x391765=_[_0x828c('0x30')](db[_0x828c('0x31')][_0x828c('0x32')],function(_0x2cb2ae){return{'name':_0x2cb2ae['fieldName'],'type':_0x2cb2ae[_0x828c('0x33')][_0x828c('0x34')]};});_0x1c911a[_0x828c('0x35')]=_[_0x828c('0x30')](_0x391765,_0x828c('0x2f'));_0x1c911a['query']=_[_0x828c('0x36')](_0x246b22['query']);_0x1c911a[_0x828c('0x37')]=_[_0x828c('0x38')](_0x1c911a[_0x828c('0x35')],_0x1c911a[_0x828c('0x39')]);_0x4dbfa6[_0x828c('0x3a')]=_[_0x828c('0x38')](_0x1c911a[_0x828c('0x35')],qs[_0x828c('0x3b')](_0x246b22[_0x828c('0x39')][_0x828c('0x3b')]));_0x4dbfa6[_0x828c('0x3a')]=_0x4dbfa6['attributes'][_0x828c('0x3c')]?_0x4dbfa6[_0x828c('0x3a')]:_0x1c911a[_0x828c('0x35')];if(!_0x246b22[_0x828c('0x39')]['hasOwnProperty'](_0x828c('0x3d'))){_0x4dbfa6[_0x828c('0x23')]=qs[_0x828c('0x23')](_0x246b22[_0x828c('0x39')][_0x828c('0x23')]);_0x4dbfa6[_0x828c('0x21')]=qs[_0x828c('0x21')](_0x246b22[_0x828c('0x39')]['offset']);}_0x4dbfa6[_0x828c('0x3e')]=qs[_0x828c('0x3f')](_0x246b22[_0x828c('0x39')][_0x828c('0x3f')]);_0x4dbfa6[_0x828c('0x40')]=qs[_0x828c('0x37')](_[_0x828c('0x41')](_0x246b22[_0x828c('0x39')],_0x1c911a[_0x828c('0x37')]),_0x391765);if(_0x246b22[_0x828c('0x39')]['filter']){_0x4dbfa6[_0x828c('0x40')]=_['merge'](_0x4dbfa6[_0x828c('0x40')],{'$or':_[_0x828c('0x30')](_0x391765,function(_0x492743){if(_0x492743[_0x828c('0x33')]!=='VIRTUAL'){var _0x435094={};_0x435094[_0x492743['name']]={'$like':'%'+_0x246b22['query']['filter']+'%'};return _0x435094;}})});}_0x4dbfa6=_[_0x828c('0x42')]({},_0x4dbfa6,_0x246b22[_0x828c('0x43')]);var _0x298d1b={'where':_0x4dbfa6[_0x828c('0x40')]};return db[_0x828c('0x31')][_0x828c('0x44')](_0x298d1b)[_0x828c('0x28')](function(_0x4325bf){_0x6d3015[_0x828c('0x44')]=_0x4325bf;if(_0x246b22[_0x828c('0x39')][_0x828c('0x45')]){_0x4dbfa6['include']=[{'all':!![]}];}return db['MailQueue'][_0x828c('0x46')](_0x4dbfa6);})[_0x828c('0x28')](function(_0x58e89f){_0x6d3015[_0x828c('0x47')]=_0x58e89f;return _0x6d3015;})[_0x828c('0x28')](respondWithFilteredResult(_0x3f716d,_0x4dbfa6))[_0x828c('0x48')](handleError(_0x3f716d,null));};exports[_0x828c('0x49')]=function(_0x4acb9c,_0x3d708f){var _0x4bc374={'raw':!![],'where':{'id':_0x4acb9c['params']['id']}},_0x18374d={};_0x18374d[_0x828c('0x35')]=_['keys'](db['MailQueue'][_0x828c('0x32')]);_0x18374d[_0x828c('0x39')]=_[_0x828c('0x36')](_0x4acb9c[_0x828c('0x39')]);_0x18374d[_0x828c('0x37')]=_[_0x828c('0x38')](_0x18374d[_0x828c('0x35')],_0x18374d[_0x828c('0x39')]);_0x4bc374['attributes']=_[_0x828c('0x38')](_0x18374d[_0x828c('0x35')],qs['fields'](_0x4acb9c[_0x828c('0x39')][_0x828c('0x3b')]));_0x4bc374['attributes']=_0x4bc374['attributes'][_0x828c('0x3c')]?_0x4bc374[_0x828c('0x3a')]:_0x18374d[_0x828c('0x35')];if(_0x4acb9c['query'][_0x828c('0x45')]){_0x4bc374[_0x828c('0x4a')]=[{'all':!![]}];}_0x4bc374=_['merge']({},_0x4bc374,_0x4acb9c['options']);return db['MailQueue'][_0x828c('0x4b')](_0x4bc374)['then'](handleEntityNotFound(_0x3d708f,null))[_0x828c('0x28')](respondWithResult(_0x3d708f,null))[_0x828c('0x48')](handleError(_0x3d708f,null));};exports['create']=function(_0x5a716c,_0x430438){return db[_0x828c('0x31')][_0x828c('0x4c')](_0x5a716c[_0x828c('0x4d')],{})['then'](function(_0x407411){var _0x203bfa=_0x5a716c[_0x828c('0x4e')]['get']({'plain':!![]});if(!_0x203bfa)throw new Error(_0x828c('0x4f'));if(_0x203bfa[_0x828c('0x50')]===_0x828c('0x4e')){var _0x55cc37=_0x407411[_0x828c('0x29')]({'plain':!![]});var _0x11bd49=_0x828c('0x2a');return db[_0x828c('0x51')][_0x828c('0x4b')]({'where':{'name':_0x11bd49,'userProfileId':_0x203bfa[_0x828c('0x52')]},'raw':!![]})[_0x828c('0x28')](function(_0x1e3545){if(_0x1e3545&&_0x1e3545[_0x828c('0x53')]===0x0){return db[_0x828c('0x2b')][_0x828c('0x4c')]({'name':_0x55cc37['name'],'resourceId':_0x55cc37['id'],'type':_0x1e3545[_0x828c('0x2f')],'sectionId':_0x1e3545['id']},{})['then'](function(){return _0x407411;});}else{return _0x407411;}})[_0x828c('0x48')](function(_0xd8915a){logger[_0x828c('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd8915a);throw _0xd8915a;});}return _0x407411;})[_0x828c('0x28')](respondWithResult(_0x430438,0xc9))[_0x828c('0x48')](handleError(_0x430438,null));};exports['update']=function(_0xf9400e,_0x56b038){if(_0xf9400e['body']['id']){delete _0xf9400e[_0x828c('0x4d')]['id'];}return db[_0x828c('0x31')][_0x828c('0x4b')]({'where':{'id':_0xf9400e[_0x828c('0x55')]['id']}})[_0x828c('0x28')](handleEntityNotFound(_0x56b038,null))[_0x828c('0x28')](saveUpdates(_0xf9400e['body'],null))['then'](respondWithResult(_0x56b038,null))[_0x828c('0x48')](handleError(_0x56b038,null));};exports['destroy']=function(_0x587c2f,_0x5dc2c4){return db[_0x828c('0x31')][_0x828c('0x4b')]({'where':{'id':_0x587c2f[_0x828c('0x55')]['id']}})[_0x828c('0x28')](handleEntityNotFound(_0x5dc2c4,null))[_0x828c('0x28')](removeEntity(_0x5dc2c4,null))[_0x828c('0x48')](handleError(_0x5dc2c4,null));};exports[_0x828c('0x56')]=function(_0x2b2268,_0x2d12f4){return db[_0x828c('0x31')]['describe']()[_0x828c('0x28')](respondWithResult(_0x2d12f4,null))['catch'](handleError(_0x2d12f4,null));};exports['getMembers']=function(_0x5a7af2,_0x1eda90,_0x1178d8){var _0x1f226b={'raw':!![],'where':{}},_0xf41c04={},_0x598f2e;return db[_0x828c('0x31')][_0x828c('0x57')]({'where':{'id':_0x5a7af2['params']['id']}})[_0x828c('0x28')](handleEntityNotFound(_0x1eda90,null))[_0x828c('0x28')](function(_0x37e77e){if(_0x37e77e){_0x598f2e=_0x37e77e['get']({'plain':!![]});_0xf41c04[_0x828c('0x35')]=_[_0x828c('0x36')](db[_0x828c('0x58')]['rawAttributes']);_0xf41c04[_0x828c('0x39')]=_[_0x828c('0x36')](_0x5a7af2[_0x828c('0x39')]);_0xf41c04[_0x828c('0x37')]=_[_0x828c('0x38')](_0xf41c04['model'],_0xf41c04[_0x828c('0x39')]);_0x1f226b[_0x828c('0x3a')]=_['intersection'](_0xf41c04[_0x828c('0x35')],qs[_0x828c('0x3b')](_0x5a7af2[_0x828c('0x39')][_0x828c('0x3b')]));_0x1f226b[_0x828c('0x3a')]=_0x1f226b[_0x828c('0x3a')][_0x828c('0x3c')]?_0x1f226b[_0x828c('0x3a')]:_0xf41c04[_0x828c('0x35')];if(!_0x5a7af2[_0x828c('0x39')][_0x828c('0x59')](_0x828c('0x3d'))){_0x1f226b[_0x828c('0x23')]=qs[_0x828c('0x23')](_0x5a7af2[_0x828c('0x39')][_0x828c('0x23')]);_0x1f226b[_0x828c('0x21')]=qs['offset'](_0x5a7af2[_0x828c('0x39')][_0x828c('0x21')]);}_0x1f226b[_0x828c('0x3e')]=qs['sort'](_0x5a7af2[_0x828c('0x39')][_0x828c('0x3f')]);_0x1f226b[_0x828c('0x40')]=qs[_0x828c('0x37')](_[_0x828c('0x41')](_0x5a7af2[_0x828c('0x39')],_0xf41c04[_0x828c('0x37')]));_0x1f226b[_0x828c('0x40')][_0x828c('0x5a')]=_0x37e77e['id'];if(_0x5a7af2[_0x828c('0x39')][_0x828c('0x5b')]){_0x1f226b[_0x828c('0x40')]=_[_0x828c('0x42')](_0x1f226b[_0x828c('0x40')],{'$or':_[_0x828c('0x30')](_0x1f226b[_0x828c('0x3a')],function(_0x35af92){var _0x292362={};_0x292362[_0x35af92]={'$like':'%'+_0x5a7af2['query'][_0x828c('0x5b')]+'%'};return _0x292362;})});}_0x1f226b=_[_0x828c('0x42')]({},_0x1f226b,_0x5a7af2[_0x828c('0x43')]);return db[_0x828c('0x58')][_0x828c('0x46')](_0x1f226b);}})[_0x828c('0x28')](function(_0x2a979c){if(_0x2a979c){return db[_0x828c('0x5c')]['findAndCountAll']({'where':{'id':_[_0x828c('0x30')](_0x2a979c,_0x828c('0x5d')),'role':'agent'},'attributes':['id',_0x828c('0x2f'),_0x828c('0x5e'),_0x828c('0x5f'),'createdAt']});}})['then'](function(_0x1a997d){if(_0x1a997d){return{'count':_0x1a997d[_0x828c('0x44')],'rows':_[_0x828c('0x30')](_0x1a997d['rows'],function(_0x1cf2da){return{'membername':_0x1cf2da[_0x828c('0x2f')],'UserId':_0x1cf2da['id'],'queue_name':_0x598f2e['name'],'MailQueueId':_0x598f2e['id'],'interface':util[_0x828c('0x60')](_0x828c('0x61'),_0x828c('0x62'),_0x1cf2da[_0x828c('0x2f')]),'penalty':0x0,'paused':_0x1cf2da[_0x828c('0x5e')],'createdAt':_0x1cf2da[_0x828c('0x63')],'updatedAt':_0x1cf2da['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x828c('0x28')](respondWithFilteredResult(_0x1eda90,_0x1f226b))['catch'](handleError(_0x1eda90,null));};exports['getTeams']=function(_0x5c0714,_0x528abe,_0x318f4d){var _0x4e10e4={};var _0x22ce6f={};var _0x4d6c7d;var _0x58dd83;return db[_0x828c('0x31')]['findOne']({'where':{'id':_0x5c0714['params']['id']}})[_0x828c('0x28')](handleEntityNotFound(_0x528abe,null))[_0x828c('0x28')](function(_0x5212cb){if(_0x5212cb){_0x4d6c7d=_0x5212cb;_0x22ce6f[_0x828c('0x35')]=_[_0x828c('0x36')](db[_0x828c('0x64')][_0x828c('0x32')]);_0x22ce6f[_0x828c('0x39')]=_[_0x828c('0x36')](_0x5c0714[_0x828c('0x39')]);_0x22ce6f[_0x828c('0x37')]=_['intersection'](_0x22ce6f[_0x828c('0x35')],_0x22ce6f['query']);_0x4e10e4[_0x828c('0x3a')]=_[_0x828c('0x38')](_0x22ce6f[_0x828c('0x35')],qs['fields'](_0x5c0714['query'][_0x828c('0x3b')]));_0x4e10e4[_0x828c('0x3a')]=_0x4e10e4[_0x828c('0x3a')][_0x828c('0x3c')]?_0x4e10e4[_0x828c('0x3a')]:_0x22ce6f[_0x828c('0x35')];_0x4e10e4[_0x828c('0x3e')]=qs['sort'](_0x5c0714[_0x828c('0x39')][_0x828c('0x3f')]);_0x4e10e4[_0x828c('0x40')]=qs[_0x828c('0x37')](_[_0x828c('0x41')](_0x5c0714['query'],_0x22ce6f[_0x828c('0x37')]));if(_0x5c0714['query'][_0x828c('0x5b')]){_0x4e10e4[_0x828c('0x40')]=_[_0x828c('0x42')](_0x4e10e4['where'],{'$or':_['map'](_0x4e10e4[_0x828c('0x3a')],function(_0x4f748b){var _0x3e1a41={};_0x3e1a41[_0x4f748b]={'$like':'%'+_0x5c0714[_0x828c('0x39')][_0x828c('0x5b')]+'%'};return _0x3e1a41;})});}_0x4e10e4=_[_0x828c('0x42')]({},_0x4e10e4,_0x5c0714[_0x828c('0x43')]);return _0x4d6c7d[_0x828c('0x65')](_0x4e10e4);}})[_0x828c('0x28')](function(_0x869c10){if(_0x869c10){_0x58dd83=_0x869c10['length'];if(!_0x5c0714[_0x828c('0x39')]['hasOwnProperty'](_0x828c('0x3d'))){_0x4e10e4[_0x828c('0x23')]=qs[_0x828c('0x23')](_0x5c0714[_0x828c('0x39')][_0x828c('0x23')]);_0x4e10e4['offset']=qs[_0x828c('0x21')](_0x5c0714[_0x828c('0x39')][_0x828c('0x21')]);}return _0x4d6c7d['getTeams'](_0x4e10e4);}})[_0x828c('0x28')](function(_0x570105){if(_0x570105){return _0x570105?{'count':_0x58dd83,'rows':_0x570105}:null;}})[_0x828c('0x28')](respondWithResult(_0x528abe,null))['catch'](handleError(_0x528abe,null));};exports[_0x828c('0x66')]=function(_0x51aa4d,_0x1d8ec0,_0x4bd7d1){var _0x2037bf=_0x51aa4d[_0x828c('0x4d')]['ids'];return db['Team'][_0x828c('0x46')]({'where':{'id':_0x2037bf},'attributes':['id'],'include':[{'model':db[_0x828c('0x5c')],'as':_0x828c('0x67'),'attributes':['id',_0x828c('0x2f'),_0x828c('0x68'),_0x828c('0x69'),_0x828c('0x6a')],'raw':!![]}]})[_0x828c('0x28')](function(_0x56703e){if(_0x56703e){var _0x24ee68=_[_0x828c('0x6b')](_0x56703e,function(_0x3b517a){var _0x5bf153=_0x3b517a[_0x828c('0x29')]({'plain':!![]});return _0x5bf153[_0x828c('0x67')];});return db[_0x828c('0x31')][_0x828c('0x4b')]({'where':{'id':_0x51aa4d[_0x828c('0x55')]['id']}})[_0x828c('0x28')](function(_0x4e2c55){return db[_0x828c('0x6c')][_0x828c('0x6d')](function(_0x74a378){return _0x4e2c55[_0x828c('0x66')](_0x2037bf,{'transaction':_0x74a378})[_0x828c('0x28')](function(){return BPromise[_0x828c('0x6e')](_0x24ee68,function(_0x3b4383){return db[_0x828c('0x58')][_0x828c('0x6f')]({'where':{'UserId':_0x3b4383['id'],'MailQueueId':_0x51aa4d[_0x828c('0x55')]['id']},'transaction':_0x74a378});});})[_0x828c('0x28')](function(){_0x24ee68[_0x828c('0x70')](function(_0xe2dd9b){socket[_0x828c('0x71')]('userMailQueue:save',{'UserId':_0xe2dd9b['id'],'MailQueueId':_0x4e2c55['id']});});});});});}})['then'](respondWithStatusCode(_0x1d8ec0,null))[_0x828c('0x48')](handleError(_0x1d8ec0,null));};exports['removeTeams']=function(_0x323038,_0x4dafc5,_0x4d9a12){return db[_0x828c('0x64')]['findAll']({'where':{'id':_0x323038[_0x828c('0x39')][_0x828c('0x72')]},'attributes':['id'],'include':[{'model':db[_0x828c('0x5c')],'as':_0x828c('0x67'),'attributes':['id'],'raw':!![]}]})[_0x828c('0x28')](handleEntityNotFound(_0x4dafc5,null))[_0x828c('0x28')](function(_0x207b92){var _0x2938ae=_[_0x828c('0x30')](_0x207b92,'id');var _0x5aac85=[];var _0x1e9714=[];var _0x54587d=squel['select']();_0x54587d[_0x828c('0x73')](_0x828c('0x74'))[_0x828c('0x75')](_0x828c('0x76'),'tq')[_0x828c('0x77')](_0x828c('0x78'),'ut',_0x828c('0x79'))[_0x828c('0x40')]('MailQueueId\x20=\x20?',_0x323038[_0x828c('0x55')]['id']);for(var _0x4fcaf3=0x0;_0x4fcaf3<_0x207b92['length'];_0x4fcaf3+=0x1){let _0x4248ab=_0x207b92[_0x4fcaf3];for(var _0x5bc1b5=0x0;_0x5bc1b5<_0x4248ab[_0x828c('0x67')][_0x828c('0x3c')];_0x5bc1b5+=0x1){let _0x3d1343=_0x4248ab['Agents'][_0x5bc1b5];var _0x40604c=_0x54587d[_0x828c('0x7a')]();_0x40604c['where'](_0x828c('0x7b'),_0x3d1343['id']);_0x1e9714[_0x828c('0x7c')](db[_0x828c('0x6c')][_0x828c('0x39')](_0x40604c[_0x828c('0x7d')](),{'type':db[_0x828c('0x6c')][_0x828c('0x7e')][_0x828c('0x7f')]})[_0x828c('0x28')](function(_0x334881){if(_0x334881['length']===0x1){return _0x3d1343['id'];}else{var _0x370ee8=_[_0x828c('0x80')](_['map'](_0x334881,_0x828c('0x81')),function(_0x3e8687){return _['includes'](_0x2938ae,_0x3e8687);});if(_0x370ee8){return _0x3d1343['id'];}}}));}}return BPromise[_0x828c('0x82')](_0x1e9714)['then'](function(_0x2b42d1){_0x5aac85=_(_0x5aac85)[_0x828c('0x83')](_0x2b42d1)['compact']()[_0x828c('0x84')]();return db[_0x828c('0x31')]['find']({'where':{'id':_0x323038['params']['id']}})[_0x828c('0x28')](function(_0x5dafed){return db[_0x828c('0x6c')][_0x828c('0x6d')](function(_0x167e89){return _0x5dafed[_0x828c('0x85')](_0x323038[_0x828c('0x39')][_0x828c('0x72')],{'transaction':_0x167e89})[_0x828c('0x28')](function(){if(!_['isEmpty'](_0x5aac85)){return _0x5dafed[_0x828c('0x86')](_0x5aac85,{'transaction':_0x167e89});}})[_0x828c('0x28')](function(){_0x5aac85['forEach'](function(_0xdd79c6){socket[_0x828c('0x71')](_0x828c('0x87'),{'UserId':_0xdd79c6,'MailQueueId':_0x5dafed['id']});});});});});});})[_0x828c('0x28')](respondWithStatusCode(_0x4dafc5,null))['catch'](handleError(_0x4dafc5,null));};exports['addAgents']=function(_0x3924ad,_0x213ade,_0x2831c2){return db[_0x828c('0x31')][_0x828c('0x4b')]({'where':{'id':_0x3924ad['params']['id']}})['then'](handleEntityNotFound(_0x213ade,null))['then'](function(_0x2cb276){if(_0x2cb276){return _0x2cb276['addAgents'](_0x3924ad[_0x828c('0x4d')][_0x828c('0x72')],_[_0x828c('0x88')](_0x3924ad['body'],[_0x828c('0x72'),'id'])||{})[_0x828c('0x89')](function(_0x507057){for(var _0x6ffe1e=0x0;_0x6ffe1e<_0x3924ad[_0x828c('0x4d')]['ids']['length'];_0x6ffe1e+=0x1){socket[_0x828c('0x71')](_0x828c('0x8a'),{'UserId':Number(_0x3924ad[_0x828c('0x4d')][_0x828c('0x72')][_0x6ffe1e]),'MailQueueId':Number(_0x3924ad[_0x828c('0x55')]['id'])});}return _0x507057;});}})[_0x828c('0x28')](respondWithResult(_0x213ade,null))[_0x828c('0x48')](handleError(_0x213ade,null));};exports[_0x828c('0x86')]=function(_0x290688,_0x2cc2cf,_0x41ed3d){return db['MailQueue'][_0x828c('0x4b')]({'where':{'id':_0x290688[_0x828c('0x55')]['id']}})[_0x828c('0x28')](handleEntityNotFound(_0x2cc2cf,null))[_0x828c('0x28')](function(_0x3ecdec){if(_0x3ecdec){return _0x3ecdec[_0x828c('0x86')](_0x290688['query'][_0x828c('0x72')])[_0x828c('0x28')](function(){if(_['isArray'](_0x290688[_0x828c('0x39')][_0x828c('0x72')])){for(var _0x5c2329=0x0;_0x5c2329<_0x290688[_0x828c('0x39')][_0x828c('0x72')][_0x828c('0x3c')];_0x5c2329+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x290688[_0x828c('0x39')][_0x828c('0x72')][_0x5c2329]),'MailQueueId':Number(_0x290688[_0x828c('0x55')]['id'])});}}else{socket[_0x828c('0x71')](_0x828c('0x87'),{'UserId':Number(_0x290688[_0x828c('0x39')]['ids']),'MailQueueId':Number(_0x290688[_0x828c('0x55')]['id'])});}});}})[_0x828c('0x28')](respondWithStatusCode(_0x2cc2cf,null))[_0x828c('0x48')](handleError(_0x2cc2cf,null));};exports[_0x828c('0x8b')]=function(_0x1d4898,_0x24ef74,_0x6dd1e5){var _0x58e094={};var _0x2c68e3={};var _0x7e6c25;var _0xa52a0b;return db[_0x828c('0x31')][_0x828c('0x57')]({'where':{'id':_0x1d4898[_0x828c('0x55')]['id']}})[_0x828c('0x28')](handleEntityNotFound(_0x24ef74,null))[_0x828c('0x28')](function(_0x3119b9){if(_0x3119b9){_0x7e6c25=_0x3119b9;_0x2c68e3[_0x828c('0x35')]=_[_0x828c('0x36')](db['User'][_0x828c('0x32')]);_0x2c68e3[_0x828c('0x39')]=_[_0x828c('0x36')](_0x1d4898[_0x828c('0x39')]);_0x2c68e3[_0x828c('0x37')]=_['intersection'](_0x2c68e3['model'],_0x2c68e3['query']);_0x58e094[_0x828c('0x3a')]=_[_0x828c('0x38')](_0x2c68e3[_0x828c('0x35')],qs['fields'](_0x1d4898['query'][_0x828c('0x3b')]));_0x58e094['attributes']=_0x58e094['attributes'][_0x828c('0x3c')]?_0x58e094['attributes']:_0x2c68e3[_0x828c('0x35')];_0x58e094[_0x828c('0x3e')]=qs['sort'](_0x1d4898['query']['sort']);_0x58e094[_0x828c('0x40')]=qs['filters'](_[_0x828c('0x41')](_0x1d4898[_0x828c('0x39')],_0x2c68e3[_0x828c('0x37')]));if(_0x1d4898[_0x828c('0x39')][_0x828c('0x5b')]){_0x58e094[_0x828c('0x40')]=_['merge'](_0x58e094[_0x828c('0x40')],{'$or':_[_0x828c('0x30')](_0x58e094[_0x828c('0x3a')],function(_0x57d3ea){var _0x19910a={};_0x19910a[_0x57d3ea]={'$like':'%'+_0x1d4898['query'][_0x828c('0x5b')]+'%'};return _0x19910a;})});}_0x58e094=_[_0x828c('0x42')]({},_0x58e094,_0x1d4898[_0x828c('0x43')]);return _0x7e6c25['getAgents'](_0x58e094);}})[_0x828c('0x28')](function(_0x46cdbe){if(_0x46cdbe){_0xa52a0b=_0x46cdbe[_0x828c('0x3c')];if(!_0x1d4898[_0x828c('0x39')][_0x828c('0x59')](_0x828c('0x3d'))){_0x58e094[_0x828c('0x23')]=qs[_0x828c('0x23')](_0x1d4898['query'][_0x828c('0x23')]);_0x58e094[_0x828c('0x21')]=qs[_0x828c('0x21')](_0x1d4898[_0x828c('0x39')]['offset']);}return _0x7e6c25[_0x828c('0x8b')](_0x58e094);}})[_0x828c('0x28')](function(_0x5bc4f3){if(_0x5bc4f3){return _0x5bc4f3?{'count':_0xa52a0b,'rows':_0x5bc4f3}:null;}})[_0x828c('0x28')](respondWithResult(_0x24ef74,null))[_0x828c('0x48')](handleError(_0x24ef74,null));}; \ No newline at end of file +var _0xa8a8=['count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','MailQueue','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','SIP','getTeams','ids','Team','Agents','online','transaction','addTeams','each','UserMailQueue','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','getAgents','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x3aa101,_0x4fe20a){var _0x26000b=function(_0x158461){while(--_0x158461){_0x3aa101['push'](_0x3aa101['shift']());}};_0x26000b(++_0x4fe20a);}(_0xa8a8,0xec));var _0x8a8a=function(_0x1639ee,_0x4d0c9f){_0x1639ee=_0x1639ee-0x0;var _0x19c128=_0xa8a8[_0x1639ee];return _0x19c128;};'use strict';var emlformat=require(_0x8a8a('0x0'));var rimraf=require(_0x8a8a('0x1'));var zipdir=require(_0x8a8a('0x2'));var jsonpatch=require(_0x8a8a('0x3'));var rp=require('request-promise');var moment=require(_0x8a8a('0x4'));var BPromise=require(_0x8a8a('0x5'));var Mustache=require(_0x8a8a('0x6'));var util=require(_0x8a8a('0x7'));var path=require(_0x8a8a('0x8'));var sox=require(_0x8a8a('0x9'));var csv=require(_0x8a8a('0xa'));var ejs=require(_0x8a8a('0xb'));var fs=require('fs');var fs_extra=require(_0x8a8a('0xc'));var _=require(_0x8a8a('0xd'));var squel=require(_0x8a8a('0xe'));var crypto=require(_0x8a8a('0xf'));var jsforce=require(_0x8a8a('0x10'));var deskjs=require(_0x8a8a('0x11'));var toCsv=require(_0x8a8a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a8a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8a8a('0x13'));var as=require(_0x8a8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a8a('0x15'))(_0x8a8a('0x16'));var utils=require(_0x8a8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8a8a('0x18'));var db=require(_0x8a8a('0x19'))['db'];config[_0x8a8a('0x1a')]=_[_0x8a8a('0x1b')](config['redis'],{'host':_0x8a8a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a8a('0x1a')]));require(_0x8a8a('0x1d'))[_0x8a8a('0x1e')](socket);function respondWithStatusCode(_0x2f6e33,_0x2ac893){_0x2ac893=_0x2ac893||0xcc;return function(_0x78b0f0){if(_0x78b0f0){return _0x2f6e33[_0x8a8a('0x1f')](_0x2ac893);}return _0x2f6e33['status'](_0x2ac893)[_0x8a8a('0x20')]();};}function respondWithResult(_0x568b83,_0x1f36b6){_0x1f36b6=_0x1f36b6||0xc8;return function(_0x3046ae){if(_0x3046ae){return _0x568b83[_0x8a8a('0x21')](_0x1f36b6)[_0x8a8a('0x22')](_0x3046ae);}};}function respondWithFilteredResult(_0x42e8b6,_0x5dd616){return function(_0x9d55f9){if(_0x9d55f9){var _0x3d165c=typeof _0x5dd616[_0x8a8a('0x23')]===_0x8a8a('0x24')&&typeof _0x5dd616[_0x8a8a('0x25')]===_0x8a8a('0x24');var _0x4d7a45=_0x9d55f9['count'];var _0x5181b2=_0x3d165c?0x0:_0x5dd616['offset'];var _0x4a6601=_0x3d165c?_0x9d55f9[_0x8a8a('0x26')]:_0x5dd616[_0x8a8a('0x23')]+_0x5dd616[_0x8a8a('0x25')];var _0x44719e;if(_0x4a6601>=_0x4d7a45){_0x4a6601=_0x4d7a45;_0x44719e=0xc8;}else{_0x44719e=0xce;}_0x42e8b6[_0x8a8a('0x21')](_0x44719e);return _0x42e8b6[_0x8a8a('0x27')](_0x8a8a('0x28'),_0x5181b2+'-'+_0x4a6601+'/'+_0x4d7a45)[_0x8a8a('0x22')](_0x9d55f9);}return null;};}function patchUpdates(_0x25d5d4){return function(_0x2deecb){try{jsonpatch[_0x8a8a('0x29')](_0x2deecb,_0x25d5d4,!![]);}catch(_0x3aa2bb){return BPromise[_0x8a8a('0x2a')](_0x3aa2bb);}return _0x2deecb[_0x8a8a('0x2b')]();};}function saveUpdates(_0x442c00,_0x545a38){return function(_0x3c096f){if(_0x3c096f){return _0x3c096f[_0x8a8a('0x2c')](_0x442c00)[_0x8a8a('0x2d')](function(_0x7662e){return _0x7662e;});}return null;};}function removeEntity(_0x36e6d4,_0x251315){return function(_0x3aa46d){if(_0x3aa46d){return _0x3aa46d['destroy']()[_0x8a8a('0x2d')](function(){var _0x38c1e0=_0x3aa46d[_0x8a8a('0x2e')]({'plain':!![]});var _0x54ff7e='MailQueues';return db[_0x8a8a('0x2f')][_0x8a8a('0x30')]({'where':{'type':_0x54ff7e,'resourceId':_0x38c1e0['id']}})['then'](function(){return _0x3aa46d;});})['then'](function(){_0x36e6d4['status'](0xcc)[_0x8a8a('0x20')]();});}};}function handleEntityNotFound(_0x5c7e58,_0x10b916){return function(_0xdd6221){if(!_0xdd6221){_0x5c7e58['sendStatus'](0x194);}return _0xdd6221;};}function handleError(_0x36c7f8,_0x2c8f27){_0x2c8f27=_0x2c8f27||0x1f4;return function(_0x250852){logger[_0x8a8a('0x31')](_0x250852[_0x8a8a('0x32')]);if(_0x250852[_0x8a8a('0x33')]){delete _0x250852[_0x8a8a('0x33')];}_0x36c7f8[_0x8a8a('0x21')](_0x2c8f27)['send'](_0x250852);};}exports['index']=function(_0x56e79e,_0x2a00a7){var _0x3bf77d={},_0x5f301e={},_0x2b5dc9={'count':0x0,'rows':[]};var _0x304e83=_['map'](db[_0x8a8a('0x34')][_0x8a8a('0x35')],function(_0x63b9be){return{'name':_0x63b9be['fieldName'],'type':_0x63b9be['type'][_0x8a8a('0x36')]};});_0x5f301e['model']=_[_0x8a8a('0x37')](_0x304e83,_0x8a8a('0x33'));_0x5f301e[_0x8a8a('0x38')]=_[_0x8a8a('0x39')](_0x56e79e[_0x8a8a('0x38')]);_0x5f301e[_0x8a8a('0x3a')]=_[_0x8a8a('0x3b')](_0x5f301e[_0x8a8a('0x3c')],_0x5f301e[_0x8a8a('0x38')]);_0x3bf77d[_0x8a8a('0x3d')]=_[_0x8a8a('0x3b')](_0x5f301e[_0x8a8a('0x3c')],qs[_0x8a8a('0x3e')](_0x56e79e[_0x8a8a('0x38')][_0x8a8a('0x3e')]));_0x3bf77d[_0x8a8a('0x3d')]=_0x3bf77d[_0x8a8a('0x3d')][_0x8a8a('0x3f')]?_0x3bf77d['attributes']:_0x5f301e['model'];if(!_0x56e79e['query'][_0x8a8a('0x40')](_0x8a8a('0x41'))){_0x3bf77d[_0x8a8a('0x25')]=qs[_0x8a8a('0x25')](_0x56e79e[_0x8a8a('0x38')]['limit']);_0x3bf77d['offset']=qs[_0x8a8a('0x23')](_0x56e79e['query'][_0x8a8a('0x23')]);}_0x3bf77d['order']=qs['sort'](_0x56e79e[_0x8a8a('0x38')][_0x8a8a('0x42')]);_0x3bf77d[_0x8a8a('0x43')]=qs[_0x8a8a('0x3a')](_[_0x8a8a('0x44')](_0x56e79e[_0x8a8a('0x38')],_0x5f301e[_0x8a8a('0x3a')]),_0x304e83);if(_0x56e79e['query'][_0x8a8a('0x45')]){_0x3bf77d[_0x8a8a('0x43')]=_[_0x8a8a('0x46')](_0x3bf77d['where'],{'$or':_[_0x8a8a('0x37')](_0x304e83,function(_0x323f89){if(_0x323f89[_0x8a8a('0x47')]!=='VIRTUAL'){var _0x3fda48={};_0x3fda48[_0x323f89[_0x8a8a('0x33')]]={'$like':'%'+_0x56e79e[_0x8a8a('0x38')][_0x8a8a('0x45')]+'%'};return _0x3fda48;}})});}_0x3bf77d=_[_0x8a8a('0x46')]({},_0x3bf77d,_0x56e79e[_0x8a8a('0x48')]);var _0x4ffdd9={'where':_0x3bf77d['where']};return db[_0x8a8a('0x34')]['count'](_0x4ffdd9)[_0x8a8a('0x2d')](function(_0x1aa8b5){_0x2b5dc9['count']=_0x1aa8b5;if(_0x56e79e['query'][_0x8a8a('0x49')]){_0x3bf77d[_0x8a8a('0x4a')]=[{'all':!![]}];}return db[_0x8a8a('0x34')][_0x8a8a('0x4b')](_0x3bf77d);})['then'](function(_0x103223){_0x2b5dc9['rows']=_0x103223;return _0x2b5dc9;})[_0x8a8a('0x2d')](respondWithFilteredResult(_0x2a00a7,_0x3bf77d))[_0x8a8a('0x4c')](handleError(_0x2a00a7,null));};exports['show']=function(_0x3b5f93,_0x10cbd6){var _0x2836de={'raw':!![],'where':{'id':_0x3b5f93[_0x8a8a('0x4d')]['id']}},_0x4ec510={};_0x4ec510[_0x8a8a('0x3c')]=_[_0x8a8a('0x39')](db['MailQueue']['rawAttributes']);_0x4ec510[_0x8a8a('0x38')]=_[_0x8a8a('0x39')](_0x3b5f93[_0x8a8a('0x38')]);_0x4ec510['filters']=_[_0x8a8a('0x3b')](_0x4ec510[_0x8a8a('0x3c')],_0x4ec510[_0x8a8a('0x38')]);_0x2836de[_0x8a8a('0x3d')]=_[_0x8a8a('0x3b')](_0x4ec510[_0x8a8a('0x3c')],qs[_0x8a8a('0x3e')](_0x3b5f93[_0x8a8a('0x38')][_0x8a8a('0x3e')]));_0x2836de[_0x8a8a('0x3d')]=_0x2836de[_0x8a8a('0x3d')]['length']?_0x2836de[_0x8a8a('0x3d')]:_0x4ec510[_0x8a8a('0x3c')];if(_0x3b5f93[_0x8a8a('0x38')][_0x8a8a('0x49')]){_0x2836de[_0x8a8a('0x4a')]=[{'all':!![]}];}_0x2836de=_[_0x8a8a('0x46')]({},_0x2836de,_0x3b5f93['options']);return db[_0x8a8a('0x34')][_0x8a8a('0x4e')](_0x2836de)[_0x8a8a('0x2d')](handleEntityNotFound(_0x10cbd6,null))[_0x8a8a('0x2d')](respondWithResult(_0x10cbd6,null))['catch'](handleError(_0x10cbd6,null));};exports[_0x8a8a('0x4f')]=function(_0x3333ff,_0x44e00c){return db['MailQueue']['create'](_0x3333ff[_0x8a8a('0x50')],{})[_0x8a8a('0x2d')](function(_0xf4b6ee){var _0x51d2e=_0x3333ff[_0x8a8a('0x51')][_0x8a8a('0x2e')]({'plain':!![]});if(!_0x51d2e)throw new Error(_0x8a8a('0x52'));if(_0x51d2e[_0x8a8a('0x53')]===_0x8a8a('0x51')){var _0x4ab312=_0xf4b6ee['get']({'plain':!![]});var _0x17ffeb=_0x8a8a('0x54');return db['UserProfileSection']['find']({'where':{'name':_0x17ffeb,'userProfileId':_0x51d2e[_0x8a8a('0x55')]},'raw':!![]})['then'](function(_0x3faa28){if(_0x3faa28&&_0x3faa28['autoAssociation']===0x0){return db[_0x8a8a('0x2f')][_0x8a8a('0x4f')]({'name':_0x4ab312[_0x8a8a('0x33')],'resourceId':_0x4ab312['id'],'type':_0x3faa28[_0x8a8a('0x33')],'sectionId':_0x3faa28['id']},{})[_0x8a8a('0x2d')](function(){return _0xf4b6ee;});}else{return _0xf4b6ee;}})[_0x8a8a('0x4c')](function(_0x2b718b){logger[_0x8a8a('0x31')](_0x8a8a('0x56'),_0x2b718b);throw _0x2b718b;});}return _0xf4b6ee;})[_0x8a8a('0x2d')](respondWithResult(_0x44e00c,0xc9))['catch'](handleError(_0x44e00c,null));};exports[_0x8a8a('0x2c')]=function(_0x133bae,_0x32a4ed){if(_0x133bae[_0x8a8a('0x50')]['id']){delete _0x133bae[_0x8a8a('0x50')]['id'];}return db['MailQueue'][_0x8a8a('0x4e')]({'where':{'id':_0x133bae[_0x8a8a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32a4ed,null))['then'](saveUpdates(_0x133bae[_0x8a8a('0x50')],null))[_0x8a8a('0x2d')](respondWithResult(_0x32a4ed,null))[_0x8a8a('0x4c')](handleError(_0x32a4ed,null));};exports[_0x8a8a('0x30')]=function(_0x265e98,_0x2dc4e8){return db['MailQueue']['find']({'where':{'id':_0x265e98['params']['id']}})[_0x8a8a('0x2d')](handleEntityNotFound(_0x2dc4e8,null))['then'](removeEntity(_0x2dc4e8,null))[_0x8a8a('0x4c')](handleError(_0x2dc4e8,null));};exports[_0x8a8a('0x57')]=function(_0x4e1ca8,_0x225801){return db[_0x8a8a('0x34')][_0x8a8a('0x57')]()[_0x8a8a('0x2d')](respondWithResult(_0x225801,null))['catch'](handleError(_0x225801,null));};exports[_0x8a8a('0x58')]=function(_0x5d335e,_0x33db85,_0x829117){var _0x57a8b2={'raw':!![],'where':{}},_0x254e4c={},_0x101543;return db[_0x8a8a('0x34')][_0x8a8a('0x59')]({'where':{'id':_0x5d335e['params']['id']}})[_0x8a8a('0x2d')](handleEntityNotFound(_0x33db85,null))[_0x8a8a('0x2d')](function(_0x46c03d){if(_0x46c03d){_0x101543=_0x46c03d['get']({'plain':!![]});_0x254e4c['model']=_[_0x8a8a('0x39')](db['UserMailQueue']['rawAttributes']);_0x254e4c['query']=_[_0x8a8a('0x39')](_0x5d335e[_0x8a8a('0x38')]);_0x254e4c['filters']=_[_0x8a8a('0x3b')](_0x254e4c['model'],_0x254e4c['query']);_0x57a8b2[_0x8a8a('0x3d')]=_[_0x8a8a('0x3b')](_0x254e4c['model'],qs[_0x8a8a('0x3e')](_0x5d335e[_0x8a8a('0x38')][_0x8a8a('0x3e')]));_0x57a8b2[_0x8a8a('0x3d')]=_0x57a8b2[_0x8a8a('0x3d')][_0x8a8a('0x3f')]?_0x57a8b2['attributes']:_0x254e4c[_0x8a8a('0x3c')];if(!_0x5d335e[_0x8a8a('0x38')]['hasOwnProperty'](_0x8a8a('0x41'))){_0x57a8b2[_0x8a8a('0x25')]=qs[_0x8a8a('0x25')](_0x5d335e[_0x8a8a('0x38')][_0x8a8a('0x25')]);_0x57a8b2[_0x8a8a('0x23')]=qs[_0x8a8a('0x23')](_0x5d335e[_0x8a8a('0x38')][_0x8a8a('0x23')]);}_0x57a8b2[_0x8a8a('0x5a')]=qs['sort'](_0x5d335e[_0x8a8a('0x38')][_0x8a8a('0x42')]);_0x57a8b2['where']=qs[_0x8a8a('0x3a')](_[_0x8a8a('0x44')](_0x5d335e[_0x8a8a('0x38')],_0x254e4c[_0x8a8a('0x3a')]));_0x57a8b2[_0x8a8a('0x43')]['MailQueueId']=_0x46c03d['id'];if(_0x5d335e[_0x8a8a('0x38')][_0x8a8a('0x45')]){_0x57a8b2[_0x8a8a('0x43')]=_[_0x8a8a('0x46')](_0x57a8b2[_0x8a8a('0x43')],{'$or':_[_0x8a8a('0x37')](_0x57a8b2[_0x8a8a('0x3d')],function(_0x4fc5c8){var _0x2a221b={};_0x2a221b[_0x4fc5c8]={'$like':'%'+_0x5d335e[_0x8a8a('0x38')][_0x8a8a('0x45')]+'%'};return _0x2a221b;})});}_0x57a8b2=_['merge']({},_0x57a8b2,_0x5d335e[_0x8a8a('0x48')]);return db['UserMailQueue'][_0x8a8a('0x4b')](_0x57a8b2);}})[_0x8a8a('0x2d')](function(_0x571d8b){if(_0x571d8b){return db[_0x8a8a('0x5b')][_0x8a8a('0x5c')]({'where':{'id':_[_0x8a8a('0x37')](_0x571d8b,_0x8a8a('0x5d')),'role':_0x8a8a('0x5e')},'attributes':['id',_0x8a8a('0x33'),_0x8a8a('0x5f'),_0x8a8a('0x60'),_0x8a8a('0x61')]});}})[_0x8a8a('0x2d')](function(_0x3ddf82){if(_0x3ddf82){return{'count':_0x3ddf82[_0x8a8a('0x26')],'rows':_[_0x8a8a('0x37')](_0x3ddf82[_0x8a8a('0x62')],function(_0x8a0a49){return{'membername':_0x8a0a49[_0x8a8a('0x33')],'UserId':_0x8a0a49['id'],'queue_name':_0x101543[_0x8a8a('0x33')],'MailQueueId':_0x101543['id'],'interface':util[_0x8a8a('0x63')]('%s/%s',_0x8a8a('0x64'),_0x8a0a49['name']),'penalty':0x0,'paused':_0x8a0a49[_0x8a8a('0x5f')],'createdAt':_0x8a0a49[_0x8a8a('0x61')],'updatedAt':_0x8a0a49[_0x8a8a('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x33db85,_0x57a8b2))['catch'](handleError(_0x33db85,null));};exports[_0x8a8a('0x65')]=function(_0x428b99,_0x37d886,_0x4b3db2){var _0x4ab5ef={};var _0x2b4ac1={};var _0x17514e;var _0x46a556;return db[_0x8a8a('0x34')][_0x8a8a('0x59')]({'where':{'id':_0x428b99[_0x8a8a('0x4d')]['id']}})[_0x8a8a('0x2d')](handleEntityNotFound(_0x37d886,null))[_0x8a8a('0x2d')](function(_0x492682){if(_0x492682){_0x17514e=_0x492682;_0x2b4ac1[_0x8a8a('0x3c')]=_[_0x8a8a('0x39')](db['Team'][_0x8a8a('0x35')]);_0x2b4ac1[_0x8a8a('0x38')]=_[_0x8a8a('0x39')](_0x428b99[_0x8a8a('0x38')]);_0x2b4ac1[_0x8a8a('0x3a')]=_[_0x8a8a('0x3b')](_0x2b4ac1['model'],_0x2b4ac1[_0x8a8a('0x38')]);_0x4ab5ef[_0x8a8a('0x3d')]=_[_0x8a8a('0x3b')](_0x2b4ac1[_0x8a8a('0x3c')],qs[_0x8a8a('0x3e')](_0x428b99['query'][_0x8a8a('0x3e')]));_0x4ab5ef[_0x8a8a('0x3d')]=_0x4ab5ef[_0x8a8a('0x3d')][_0x8a8a('0x3f')]?_0x4ab5ef[_0x8a8a('0x3d')]:_0x2b4ac1[_0x8a8a('0x3c')];_0x4ab5ef[_0x8a8a('0x5a')]=qs[_0x8a8a('0x42')](_0x428b99[_0x8a8a('0x38')][_0x8a8a('0x42')]);_0x4ab5ef['where']=qs[_0x8a8a('0x3a')](_[_0x8a8a('0x44')](_0x428b99[_0x8a8a('0x38')],_0x2b4ac1[_0x8a8a('0x3a')]));if(_0x428b99[_0x8a8a('0x38')]['filter']){_0x4ab5ef['where']=_[_0x8a8a('0x46')](_0x4ab5ef[_0x8a8a('0x43')],{'$or':_[_0x8a8a('0x37')](_0x4ab5ef['attributes'],function(_0x16869b){var _0x312350={};_0x312350[_0x16869b]={'$like':'%'+_0x428b99[_0x8a8a('0x38')][_0x8a8a('0x45')]+'%'};return _0x312350;})});}_0x4ab5ef=_['merge']({},_0x4ab5ef,_0x428b99[_0x8a8a('0x48')]);return _0x17514e[_0x8a8a('0x65')](_0x4ab5ef);}})[_0x8a8a('0x2d')](function(_0x5cee89){if(_0x5cee89){_0x46a556=_0x5cee89['length'];if(!_0x428b99['query'][_0x8a8a('0x40')]('nolimit')){_0x4ab5ef[_0x8a8a('0x25')]=qs['limit'](_0x428b99['query'][_0x8a8a('0x25')]);_0x4ab5ef['offset']=qs['offset'](_0x428b99['query'][_0x8a8a('0x23')]);}return _0x17514e['getTeams'](_0x4ab5ef);}})['then'](function(_0x1d4823){if(_0x1d4823){return _0x1d4823?{'count':_0x46a556,'rows':_0x1d4823}:null;}})['then'](respondWithResult(_0x37d886,null))[_0x8a8a('0x4c')](handleError(_0x37d886,null));};exports['addTeams']=function(_0x21b662,_0x27c4ba,_0x353f0d){var _0x238565=_0x21b662['body'][_0x8a8a('0x66')];return db[_0x8a8a('0x67')]['findAll']({'where':{'id':_0x238565},'attributes':['id'],'include':[{'model':db[_0x8a8a('0x5b')],'as':_0x8a8a('0x68'),'attributes':['id',_0x8a8a('0x33'),_0x8a8a('0x69'),'voicePause','interface'],'raw':!![]}]})[_0x8a8a('0x2d')](function(_0x1ee082){if(_0x1ee082){var _0x9ee234=_['flatMap'](_0x1ee082,function(_0x2fbd6b){var _0x3bc3b5=_0x2fbd6b[_0x8a8a('0x2e')]({'plain':!![]});return _0x3bc3b5['Agents'];});return db[_0x8a8a('0x34')][_0x8a8a('0x4e')]({'where':{'id':_0x21b662[_0x8a8a('0x4d')]['id']}})[_0x8a8a('0x2d')](function(_0x277bd6){return db['sequelize'][_0x8a8a('0x6a')](function(_0x11e128){return _0x277bd6[_0x8a8a('0x6b')](_0x238565,{'transaction':_0x11e128})[_0x8a8a('0x2d')](function(){return BPromise[_0x8a8a('0x6c')](_0x9ee234,function(_0x208c11){return db[_0x8a8a('0x6d')]['findOrCreate']({'where':{'UserId':_0x208c11['id'],'MailQueueId':_0x21b662['params']['id']},'transaction':_0x11e128});});})[_0x8a8a('0x2d')](function(){_0x9ee234[_0x8a8a('0x6e')](function(_0x14f808){socket['emit'](_0x8a8a('0x6f'),{'UserId':_0x14f808['id'],'MailQueueId':_0x277bd6['id']});});});});});}})[_0x8a8a('0x2d')](respondWithStatusCode(_0x27c4ba,null))[_0x8a8a('0x4c')](handleError(_0x27c4ba,null));};exports[_0x8a8a('0x70')]=function(_0x3f9669,_0xbcc471,_0x3a0e27){return db[_0x8a8a('0x67')][_0x8a8a('0x4b')]({'where':{'id':_0x3f9669[_0x8a8a('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8a8a('0x5b')],'as':_0x8a8a('0x68'),'attributes':['id'],'raw':!![]}]})[_0x8a8a('0x2d')](handleEntityNotFound(_0xbcc471,null))['then'](function(_0x3994db){var _0x45097a=_[_0x8a8a('0x37')](_0x3994db,'id');var _0x50bfce=[];var _0x5a8538=[];var _0x1f409b=squel[_0x8a8a('0x71')]();_0x1f409b[_0x8a8a('0x72')](_0x8a8a('0x73'))['from'](_0x8a8a('0x74'),'tq')[_0x8a8a('0x75')](_0x8a8a('0x76'),'ut',_0x8a8a('0x77'))['where']('MailQueueId\x20=\x20?',_0x3f9669[_0x8a8a('0x4d')]['id']);for(var _0x300948=0x0;_0x300948<_0x3994db[_0x8a8a('0x3f')];_0x300948+=0x1){let _0x4ac1da=_0x3994db[_0x300948];for(var _0x4b53c3=0x0;_0x4b53c3<_0x4ac1da[_0x8a8a('0x68')][_0x8a8a('0x3f')];_0x4b53c3+=0x1){let _0x198083=_0x4ac1da[_0x8a8a('0x68')][_0x4b53c3];var _0x5ac7b7=_0x1f409b[_0x8a8a('0x78')]();_0x5ac7b7['where'](_0x8a8a('0x79'),_0x198083['id']);_0x5a8538[_0x8a8a('0x7a')](db[_0x8a8a('0x7b')][_0x8a8a('0x38')](_0x5ac7b7[_0x8a8a('0x7c')](),{'type':db[_0x8a8a('0x7b')]['QueryTypes'][_0x8a8a('0x7d')]})[_0x8a8a('0x2d')](function(_0x4c2010){if(_0x4c2010['length']===0x1){return _0x198083['id'];}else{var _0x1c22b9=_[_0x8a8a('0x7e')](_['map'](_0x4c2010,_0x8a8a('0x7f')),function(_0x5c4e71){return _['includes'](_0x45097a,_0x5c4e71);});if(_0x1c22b9){return _0x198083['id'];}}}));}}return BPromise[_0x8a8a('0x80')](_0x5a8538)[_0x8a8a('0x2d')](function(_0xdf0d3b){_0x50bfce=_(_0x50bfce)['union'](_0xdf0d3b)[_0x8a8a('0x81')]()[_0x8a8a('0x82')]();return db[_0x8a8a('0x34')][_0x8a8a('0x4e')]({'where':{'id':_0x3f9669[_0x8a8a('0x4d')]['id']}})[_0x8a8a('0x2d')](function(_0x5e0c7e){return db['sequelize']['transaction'](function(_0x24798d){return _0x5e0c7e[_0x8a8a('0x70')](_0x3f9669[_0x8a8a('0x38')][_0x8a8a('0x66')],{'transaction':_0x24798d})[_0x8a8a('0x2d')](function(){if(!_[_0x8a8a('0x83')](_0x50bfce)){return _0x5e0c7e[_0x8a8a('0x84')](_0x50bfce,{'transaction':_0x24798d});}})[_0x8a8a('0x2d')](function(){_0x50bfce[_0x8a8a('0x6e')](function(_0x509a92){socket[_0x8a8a('0x85')](_0x8a8a('0x86'),{'UserId':_0x509a92,'MailQueueId':_0x5e0c7e['id']});});});});});});})[_0x8a8a('0x2d')](respondWithStatusCode(_0xbcc471,null))[_0x8a8a('0x4c')](handleError(_0xbcc471,null));};exports[_0x8a8a('0x87')]=function(_0xce1136,_0x514522,_0x563e90){return db['MailQueue'][_0x8a8a('0x4e')]({'where':{'id':_0xce1136['params']['id']}})[_0x8a8a('0x2d')](handleEntityNotFound(_0x514522,null))['then'](function(_0x227dde){if(_0x227dde){return _0x227dde['addAgents'](_0xce1136[_0x8a8a('0x50')][_0x8a8a('0x66')],_['omit'](_0xce1136[_0x8a8a('0x50')],['ids','id'])||{})['spread'](function(_0xf071aa){for(var _0x4a1658=0x0;_0x4a1658<_0xce1136[_0x8a8a('0x50')]['ids'][_0x8a8a('0x3f')];_0x4a1658+=0x1){socket['emit'](_0x8a8a('0x6f'),{'UserId':Number(_0xce1136[_0x8a8a('0x50')][_0x8a8a('0x66')][_0x4a1658]),'MailQueueId':Number(_0xce1136[_0x8a8a('0x4d')]['id'])});}return _0xf071aa;});}})['then'](respondWithResult(_0x514522,null))[_0x8a8a('0x4c')](handleError(_0x514522,null));};exports[_0x8a8a('0x84')]=function(_0x3a78d0,_0x33ac80,_0x515328){return db[_0x8a8a('0x34')][_0x8a8a('0x4e')]({'where':{'id':_0x3a78d0[_0x8a8a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x33ac80,null))[_0x8a8a('0x2d')](function(_0x1118a7){if(_0x1118a7){return _0x1118a7[_0x8a8a('0x84')](_0x3a78d0[_0x8a8a('0x38')][_0x8a8a('0x66')])['then'](function(){if(_['isArray'](_0x3a78d0[_0x8a8a('0x38')][_0x8a8a('0x66')])){for(var _0x372891=0x0;_0x372891<_0x3a78d0['query'][_0x8a8a('0x66')][_0x8a8a('0x3f')];_0x372891+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x3a78d0[_0x8a8a('0x38')][_0x8a8a('0x66')][_0x372891]),'MailQueueId':Number(_0x3a78d0[_0x8a8a('0x4d')]['id'])});}}else{socket['emit'](_0x8a8a('0x86'),{'UserId':Number(_0x3a78d0[_0x8a8a('0x38')]['ids']),'MailQueueId':Number(_0x3a78d0[_0x8a8a('0x4d')]['id'])});}});}})[_0x8a8a('0x2d')](respondWithStatusCode(_0x33ac80,null))['catch'](handleError(_0x33ac80,null));};exports[_0x8a8a('0x88')]=function(_0x523fb5,_0x1e35ac,_0x16a4a8){var _0x575f64={};var _0x2a0d12={};var _0x35cf74;var _0x49958d;return db[_0x8a8a('0x34')]['findOne']({'where':{'id':_0x523fb5[_0x8a8a('0x4d')]['id']}})[_0x8a8a('0x2d')](handleEntityNotFound(_0x1e35ac,null))['then'](function(_0x157102){if(_0x157102){_0x35cf74=_0x157102;_0x2a0d12[_0x8a8a('0x3c')]=_[_0x8a8a('0x39')](db['User'][_0x8a8a('0x35')]);_0x2a0d12['query']=_[_0x8a8a('0x39')](_0x523fb5[_0x8a8a('0x38')]);_0x2a0d12[_0x8a8a('0x3a')]=_[_0x8a8a('0x3b')](_0x2a0d12[_0x8a8a('0x3c')],_0x2a0d12['query']);_0x575f64[_0x8a8a('0x3d')]=_[_0x8a8a('0x3b')](_0x2a0d12['model'],qs[_0x8a8a('0x3e')](_0x523fb5[_0x8a8a('0x38')][_0x8a8a('0x3e')]));_0x575f64['attributes']=_0x575f64['attributes'][_0x8a8a('0x3f')]?_0x575f64[_0x8a8a('0x3d')]:_0x2a0d12[_0x8a8a('0x3c')];_0x575f64[_0x8a8a('0x5a')]=qs[_0x8a8a('0x42')](_0x523fb5[_0x8a8a('0x38')][_0x8a8a('0x42')]);_0x575f64['where']=qs['filters'](_['pick'](_0x523fb5[_0x8a8a('0x38')],_0x2a0d12[_0x8a8a('0x3a')]));if(_0x523fb5[_0x8a8a('0x38')]['filter']){_0x575f64[_0x8a8a('0x43')]=_[_0x8a8a('0x46')](_0x575f64[_0x8a8a('0x43')],{'$or':_[_0x8a8a('0x37')](_0x575f64[_0x8a8a('0x3d')],function(_0x545699){var _0x14bcab={};_0x14bcab[_0x545699]={'$like':'%'+_0x523fb5[_0x8a8a('0x38')][_0x8a8a('0x45')]+'%'};return _0x14bcab;})});}_0x575f64=_['merge']({},_0x575f64,_0x523fb5[_0x8a8a('0x48')]);return _0x35cf74[_0x8a8a('0x88')](_0x575f64);}})[_0x8a8a('0x2d')](function(_0x541c4b){if(_0x541c4b){_0x49958d=_0x541c4b['length'];if(!_0x523fb5[_0x8a8a('0x38')][_0x8a8a('0x40')](_0x8a8a('0x41'))){_0x575f64['limit']=qs[_0x8a8a('0x25')](_0x523fb5[_0x8a8a('0x38')]['limit']);_0x575f64[_0x8a8a('0x23')]=qs[_0x8a8a('0x23')](_0x523fb5['query'][_0x8a8a('0x23')]);}return _0x35cf74['getAgents'](_0x575f64);}})['then'](function(_0x2a8210){if(_0x2a8210){return _0x2a8210?{'count':_0x49958d,'rows':_0x2a8210}:null;}})[_0x8a8a('0x2d')](respondWithResult(_0x1e35ac,null))['catch'](handleError(_0x1e35ac,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 54b28fd..9f3b129 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 _0x406b=['exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x406b,0x114));var _0xb406=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x406b[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require(_0xb406('0x0'));var MailQueue=require(_0xb406('0x1'))['db'][_0xb406('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb406('0x3')](0x0);var events={'afterCreate':_0xb406('0x4'),'afterUpdate':_0xb406('0x5'),'afterDestroy':_0xb406('0x6')};function emitEvent(_0x380a6e){return function(_0x1c7317,_0x260380,_0x2b468c){MailQueueEvents[_0xb406('0x7')](_0x380a6e+':'+_0x1c7317['id'],_0x1c7317);MailQueueEvents['emit'](_0x380a6e,_0x1c7317);_0x2b468c(null);};}for(var e in events){if(events[_0xb406('0x8')](e)){var event=events[e];MailQueue[_0xb406('0x9')](e,emitEvent(event));}}module[_0xb406('0xa')]=MailQueueEvents; \ No newline at end of file +var _0x9407=['events','../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0xce50ab,_0x4c503b){var _0x9432bb=function(_0x4827e7){while(--_0x4827e7){_0xce50ab['push'](_0xce50ab['shift']());}};_0x9432bb(++_0x4c503b);}(_0x9407,0x87));var _0x7940=function(_0x54e122,_0x3ae2d0){_0x54e122=_0x54e122-0x0;var _0x200775=_0x9407[_0x54e122];return _0x200775;};'use strict';var EventEmitter=require(_0x7940('0x0'));var MailQueue=require(_0x7940('0x1'))['db'][_0x7940('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7940('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7940('0x4'),'afterDestroy':_0x7940('0x5')};function emitEvent(_0x456f76){return function(_0x24bc37,_0x4a8ea8,_0x2a1eb1){MailQueueEvents[_0x7940('0x6')](_0x456f76+':'+_0x24bc37['id'],_0x24bc37);MailQueueEvents['emit'](_0x456f76,_0x24bc37);_0x2a1eb1(null);};}for(var e in events){if(events[_0x7940('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x7940('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 78bd569..7e70c60 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 _0x5057=['MailQueue','mail_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x5057,0x1e2));var _0x7505=function(_0x3c1916,_0x3b2d5b){_0x3c1916=_0x3c1916-0x0;var _0x505f9d=_0x5057[_0x3c1916];return _0x505f9d;};'use strict';var _=require(_0x7505('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7505('0x1'));var moment=require(_0x7505('0x2'));var BPromise=require(_0x7505('0x3'));var rp=require(_0x7505('0x4'));var fs=require('fs');var path=require(_0x7505('0x5'));var rimraf=require(_0x7505('0x6'));var config=require(_0x7505('0x7'));var attributes=require('./mailQueue.attributes');module[_0x7505('0x8')]=function(_0x2b77c3,_0x5b275d){return _0x2b77c3[_0x7505('0x9')](_0x7505('0xa'),attributes,{'tableName':_0x7505('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1494=['mail_queues','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x1494,0x1d5));var _0x4149=function(_0x45cde9,_0x27f69f){_0x45cde9=_0x45cde9-0x0;var _0x180774=_0x1494[_0x45cde9];return _0x180774;};'use strict';var _=require('lodash');var util=require(_0x4149('0x0'));var logger=require(_0x4149('0x1'))('api');var moment=require(_0x4149('0x2'));var BPromise=require(_0x4149('0x3'));var rp=require(_0x4149('0x4'));var fs=require('fs');var path=require(_0x4149('0x5'));var rimraf=require(_0x4149('0x6'));var config=require(_0x4149('0x7'));var attributes=require(_0x4149('0x8'));module[_0x4149('0x9')]=function(_0x3a461c,_0x1ff826){return _0x3a461c[_0x4149('0xa')](_0x4149('0xb'),attributes,{'tableName':_0x4149('0xc'),'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 ece4a46..ba9a488 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 _0x78a8=['include','model','then','debug','ShowMailQueue','find','raw','where','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','map'];(function(_0x3ab575,_0x499cb0){var _0x187d23=function(_0x17769b){while(--_0x17769b){_0x3ab575['push'](_0x3ab575['shift']());}};_0x187d23(++_0x499cb0);}(_0x78a8,0xda));var _0x878a=function(_0x2a02f0,_0x5e129f){_0x2a02f0=_0x2a02f0-0x0;var _0x53b12b=_0x78a8[_0x2a02f0];return _0x53b12b;};'use strict';var _=require(_0x878a('0x0'));var util=require(_0x878a('0x1'));var moment=require(_0x878a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x878a('0x3'));var db=require(_0x878a('0x4'))['db'];var utils=require(_0x878a('0x5'));var logger=require(_0x878a('0x6'))(_0x878a('0x7'));var config=require(_0x878a('0x8'));var jayson=require(_0x878a('0x9'));var client=jayson[_0x878a('0xa')][_0x878a('0xb')]({'port':0x232a});config[_0x878a('0xc')]=_[_0x878a('0xd')](config['redis'],{'host':_0x878a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x878a('0xc')]));require(_0x878a('0xf'))[_0x878a('0x10')](socket);function respondWithRpcPromise(_0xa69e5a,_0x5328d5,_0x3ebceb){return new BPromise(function(_0x1a6acf,_0x5bf92a){return client[_0x878a('0x11')](_0xa69e5a,_0x3ebceb)['then'](function(_0x52e250){logger[_0x878a('0x12')](_0x878a('0x13'),_0x5328d5,_0x878a('0x14'));logger['debug'](_0x878a('0x15'),_0x5328d5,_0x878a('0x14'),JSON[_0x878a('0x16')](_0x52e250));if(_0x52e250['error']){if(_0x52e250[_0x878a('0x17')][_0x878a('0x18')]===0x1f4){logger['error'](_0x878a('0x13'),_0x5328d5,_0x52e250[_0x878a('0x17')][_0x878a('0x19')]);return _0x5bf92a(_0x52e250[_0x878a('0x17')]['message']);}logger[_0x878a('0x17')](_0x878a('0x13'),_0x5328d5,_0x52e250[_0x878a('0x17')][_0x878a('0x19')]);return _0x1a6acf(_0x52e250[_0x878a('0x17')]['message']);}else{logger['info'](_0x878a('0x13'),_0x5328d5,_0x878a('0x14'));_0x1a6acf(_0x52e250['result'][_0x878a('0x19')]);}})[_0x878a('0x1a')](function(_0x1334c2){logger[_0x878a('0x17')](_0x878a('0x13'),_0x5328d5,_0x1334c2);_0x5bf92a(_0x1334c2);});});}exports[_0x878a('0x1b')]=function(_0x4fe335){var _0x424333=this;return new Promise(function(_0x41fe5b,_0x449db8){return db[_0x878a('0x1c')][_0x878a('0x1d')]({'raw':_0x4fe335['options']?_0x4fe335[_0x878a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4fe335[_0x878a('0x1e')]?_0x4fe335[_0x878a('0x1e')]['where']||null:null,'attributes':_0x4fe335[_0x878a('0x1e')]?_0x4fe335[_0x878a('0x1e')][_0x878a('0x1f')]||null:null,'limit':_0x4fe335[_0x878a('0x1e')]?_0x4fe335['options'][_0x878a('0x20')]||null:null,'include':_0x4fe335[_0x878a('0x1e')]?_0x4fe335[_0x878a('0x1e')]['include']?_[_0x878a('0x21')](_0x4fe335[_0x878a('0x1e')][_0x878a('0x22')],function(_0x31e437){return{'model':db[_0x31e437[_0x878a('0x23')]],'as':_0x31e437['as'],'attributes':_0x31e437[_0x878a('0x1f')],'include':_0x31e437[_0x878a('0x22')]?_[_0x878a('0x21')](_0x31e437['include'],function(_0x50b116){return{'model':db[_0x50b116[_0x878a('0x23')]],'as':_0x50b116['as'],'attributes':_0x50b116[_0x878a('0x1f')],'include':_0x50b116[_0x878a('0x22')]?_[_0x878a('0x21')](_0x50b116[_0x878a('0x22')],function(_0x427223){return{'model':db[_0x427223[_0x878a('0x23')]],'as':_0x427223['as'],'attributes':_0x427223['attributes']};}):[]};}):[]};}):[]:[]})[_0x878a('0x24')](function(_0x3442ff){logger[_0x878a('0x12')](_0x878a('0x1b'),_0x4fe335);logger[_0x878a('0x25')](_0x878a('0x1b'),_0x4fe335,JSON[_0x878a('0x16')](_0x3442ff));_0x41fe5b(_0x3442ff);})[_0x878a('0x1a')](function(_0x377fb7){logger['error'](_0x878a('0x1b'),_0x377fb7[_0x878a('0x19')],_0x4fe335);_0x449db8(_0x424333[_0x878a('0x17')](0x1f4,_0x377fb7[_0x878a('0x19')]));});});};exports[_0x878a('0x26')]=function(_0x5396dd){var _0x120480=this;return new Promise(function(_0x1b5fed,_0x3fd589){return db[_0x878a('0x1c')][_0x878a('0x27')]({'raw':_0x5396dd[_0x878a('0x1e')]?_0x5396dd[_0x878a('0x1e')][_0x878a('0x28')]===undefined?!![]:![]:!![],'where':_0x5396dd[_0x878a('0x1e')]?_0x5396dd[_0x878a('0x1e')][_0x878a('0x29')]||null:null,'attributes':_0x5396dd[_0x878a('0x1e')]?_0x5396dd['options'][_0x878a('0x1f')]||null:null,'include':_0x5396dd[_0x878a('0x1e')]?_0x5396dd['options']['include']?_[_0x878a('0x21')](_0x5396dd[_0x878a('0x1e')][_0x878a('0x22')],function(_0xf9090){return{'model':db[_0xf9090['model']],'as':_0xf9090['as'],'attributes':_0xf9090['attributes'],'include':_0xf9090['include']?_[_0x878a('0x21')](_0xf9090[_0x878a('0x22')],function(_0x19ff17){return{'model':db[_0x19ff17[_0x878a('0x23')]],'as':_0x19ff17['as'],'attributes':_0x19ff17[_0x878a('0x1f')],'include':_0x19ff17[_0x878a('0x22')]?_[_0x878a('0x21')](_0x19ff17['include'],function(_0x23bd00){return{'model':db[_0x23bd00[_0x878a('0x23')]],'as':_0x23bd00['as'],'attributes':_0x23bd00[_0x878a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x878a('0x24')](function(_0x223a23){logger[_0x878a('0x12')](_0x878a('0x26'),_0x5396dd);logger[_0x878a('0x25')](_0x878a('0x26'),_0x5396dd,JSON['stringify'](_0x223a23));_0x1b5fed(_0x223a23);})[_0x878a('0x1a')](function(_0x4b56c8){logger[_0x878a('0x17')](_0x878a('0x26'),_0x4b56c8[_0x878a('0x19')],_0x5396dd);_0x3fd589(_0x120480['error'](0x1f4,_0x4b56c8[_0x878a('0x19')]));});});}; \ No newline at end of file +var _0x541c=['request\x20sent','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','options','raw','where','attributes','limit','map','include','model','stringify','ShowMailQueue','MailQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','debug'];(function(_0x5b893a,_0x181a26){var _0x17d001=function(_0x380ca6){while(--_0x380ca6){_0x5b893a['push'](_0x5b893a['shift']());}};_0x17d001(++_0x181a26);}(_0x541c,0x14b));var _0xc541=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0x541c[_0x5cc8];return _0x450661;};'use strict';var _=require('lodash');var util=require(_0xc541('0x0'));var moment=require(_0xc541('0x1'));var BPromise=require(_0xc541('0x2'));var rs=require(_0xc541('0x3'));var fs=require('fs');var Redis=require(_0xc541('0x4'));var db=require(_0xc541('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc541('0x6'))('rpc');var config=require(_0xc541('0x7'));var jayson=require(_0xc541('0x8'));var client=jayson['client'][_0xc541('0x9')]({'port':0x232a});config['redis']=_[_0xc541('0xa')](config[_0xc541('0xb')],{'host':_0xc541('0xc'),'port':0x18eb});var socket=require(_0xc541('0xd'))(new Redis(config[_0xc541('0xb')]));require(_0xc541('0xe'))[_0xc541('0xf')](socket);function respondWithRpcPromise(_0x281c95,_0x1e9814,_0x30cafd){return new BPromise(function(_0x1e35e9,_0x485015){return client[_0xc541('0x10')](_0x281c95,_0x30cafd)[_0xc541('0x11')](function(_0x47a1e3){logger[_0xc541('0x12')]('MailQueue,\x20%s,\x20%s',_0x1e9814,'request\x20sent');logger[_0xc541('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x1e9814,_0xc541('0x14'),JSON['stringify'](_0x47a1e3));if(_0x47a1e3['error']){if(_0x47a1e3[_0xc541('0x15')][_0xc541('0x16')]===0x1f4){logger[_0xc541('0x15')](_0xc541('0x17'),_0x1e9814,_0x47a1e3['error'][_0xc541('0x18')]);return _0x485015(_0x47a1e3[_0xc541('0x15')][_0xc541('0x18')]);}logger['error'](_0xc541('0x17'),_0x1e9814,_0x47a1e3[_0xc541('0x15')]['message']);return _0x1e35e9(_0x47a1e3[_0xc541('0x15')][_0xc541('0x18')]);}else{logger['info'](_0xc541('0x17'),_0x1e9814,_0xc541('0x14'));_0x1e35e9(_0x47a1e3[_0xc541('0x19')][_0xc541('0x18')]);}})[_0xc541('0x1a')](function(_0x5bf76d){logger['error'](_0xc541('0x17'),_0x1e9814,_0x5bf76d);_0x485015(_0x5bf76d);});});}exports[_0xc541('0x1b')]=function(_0x19099c){var _0xef7460=this;return new Promise(function(_0xb03c20,_0x512caa){return db['MailQueue']['findAll']({'raw':_0x19099c['options']?_0x19099c[_0xc541('0x1c')][_0xc541('0x1d')]===undefined?!![]:![]:!![],'where':_0x19099c[_0xc541('0x1c')]?_0x19099c[_0xc541('0x1c')][_0xc541('0x1e')]||null:null,'attributes':_0x19099c[_0xc541('0x1c')]?_0x19099c[_0xc541('0x1c')][_0xc541('0x1f')]||null:null,'limit':_0x19099c[_0xc541('0x1c')]?_0x19099c[_0xc541('0x1c')][_0xc541('0x20')]||null:null,'include':_0x19099c['options']?_0x19099c[_0xc541('0x1c')]['include']?_[_0xc541('0x21')](_0x19099c['options'][_0xc541('0x22')],function(_0x332aab){return{'model':db[_0x332aab[_0xc541('0x23')]],'as':_0x332aab['as'],'attributes':_0x332aab['attributes'],'include':_0x332aab[_0xc541('0x22')]?_[_0xc541('0x21')](_0x332aab[_0xc541('0x22')],function(_0x5d66ff){return{'model':db[_0x5d66ff['model']],'as':_0x5d66ff['as'],'attributes':_0x5d66ff[_0xc541('0x1f')],'include':_0x5d66ff[_0xc541('0x22')]?_['map'](_0x5d66ff[_0xc541('0x22')],function(_0x446158){return{'model':db[_0x446158['model']],'as':_0x446158['as'],'attributes':_0x446158[_0xc541('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2506b6){logger[_0xc541('0x12')](_0xc541('0x1b'),_0x19099c);logger['debug'](_0xc541('0x1b'),_0x19099c,JSON[_0xc541('0x24')](_0x2506b6));_0xb03c20(_0x2506b6);})[_0xc541('0x1a')](function(_0x4f0d4f){logger[_0xc541('0x15')]('GetMailQueue',_0x4f0d4f[_0xc541('0x18')],_0x19099c);_0x512caa(_0xef7460[_0xc541('0x15')](0x1f4,_0x4f0d4f[_0xc541('0x18')]));});});};exports[_0xc541('0x25')]=function(_0x4a8c38){var _0x4ae285=this;return new Promise(function(_0x56fce5,_0x5b1067){return db[_0xc541('0x26')]['find']({'raw':_0x4a8c38[_0xc541('0x1c')]?_0x4a8c38[_0xc541('0x1c')][_0xc541('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a8c38[_0xc541('0x1c')]?_0x4a8c38['options'][_0xc541('0x1e')]||null:null,'attributes':_0x4a8c38[_0xc541('0x1c')]?_0x4a8c38[_0xc541('0x1c')][_0xc541('0x1f')]||null:null,'include':_0x4a8c38[_0xc541('0x1c')]?_0x4a8c38['options'][_0xc541('0x22')]?_[_0xc541('0x21')](_0x4a8c38[_0xc541('0x1c')][_0xc541('0x22')],function(_0x56b25c){return{'model':db[_0x56b25c['model']],'as':_0x56b25c['as'],'attributes':_0x56b25c[_0xc541('0x1f')],'include':_0x56b25c['include']?_[_0xc541('0x21')](_0x56b25c['include'],function(_0x4d2bf0){return{'model':db[_0x4d2bf0[_0xc541('0x23')]],'as':_0x4d2bf0['as'],'attributes':_0x4d2bf0['attributes'],'include':_0x4d2bf0[_0xc541('0x22')]?_[_0xc541('0x21')](_0x4d2bf0[_0xc541('0x22')],function(_0x2a7ec6){return{'model':db[_0x2a7ec6['model']],'as':_0x2a7ec6['as'],'attributes':_0x2a7ec6['attributes']};}):[]};}):[]};}):[]:[]})[_0xc541('0x11')](function(_0x37a06c){logger['info'](_0xc541('0x25'),_0x4a8c38);logger[_0xc541('0x13')](_0xc541('0x25'),_0x4a8c38,JSON[_0xc541('0x24')](_0x37a06c));_0x56fce5(_0x37a06c);})[_0xc541('0x1a')](function(_0x5ce9b4){logger[_0xc541('0x15')](_0xc541('0x25'),_0x5ce9b4[_0xc541('0x18')],_0x4a8c38);_0x5b1067(_0x4ae285['error'](0x1f4,_0x5ce9b4[_0xc541('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 22b84ef..ea37bea 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 _0xf263=['emit','removeListener','mailQueue:','./mailQueue.events','remove','update'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xf263,0x141));var _0x3f26=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0xf263[_0x3eb630];return _0x1b840d;};'use strict';var MailQueueEvents=require(_0x3f26('0x0'));var events=['save',_0x3f26('0x1'),_0x3f26('0x2')];function createListener(_0x3d5fc5,_0xbfe52e){return function(_0x5bdc34){_0xbfe52e[_0x3f26('0x3')](_0x3d5fc5,_0x5bdc34);};}function removeListener(_0x339e00,_0x1f71b1){return function(){MailQueueEvents[_0x3f26('0x4')](_0x339e00,_0x1f71b1);};}exports['register']=function(_0x1c4702){for(var _0xede9da=0x0,_0xee877a=events['length'];_0xede9da<_0xee877a;_0xede9da++){var _0x19eb2e=events[_0xede9da];var _0x204c72=createListener(_0x3f26('0x5')+_0x19eb2e,_0x1c4702);MailQueueEvents['on'](_0x19eb2e,_0x204c72);}}; \ No newline at end of file +var _0xcade=['register','length','mailQueue:','save','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcade,0xab));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xecad('0x0'),'remove',_0xecad('0x1')];function createListener(_0x4924d3,_0x519e7e){return function(_0x3ce54f){_0x519e7e[_0xecad('0x2')](_0x4924d3,_0x3ce54f);};}function removeListener(_0x5994a1,_0xedf3ba){return function(){MailQueueEvents[_0xecad('0x3')](_0x5994a1,_0xedf3ba);};}exports[_0xecad('0x4')]=function(_0x190577){for(var _0x11fc85=0x0,_0x4ea175=events[_0xecad('0x5')];_0x11fc85<_0x4ea175;_0x11fc85++){var _0x11c219=events[_0x11fc85];var _0x30a5c7=createListener(_0xecad('0x6')+_0x11c219,_0x190577);MailQueueEvents['on'](_0x11c219,_0x30a5c7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 223fa0c..3a2faa0 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 _0x31b1=['destroy','exports','multer','util','express','Router','fs-extra','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x31b1,0xc8));var _0x131b=function(_0x2439a9,_0x3f9061){_0x2439a9=_0x2439a9-0x0;var _0x3bd0f6=_0x31b1[_0x2439a9];return _0x3bd0f6;};'use strict';var multer=require(_0x131b('0x0'));var util=require(_0x131b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x131b('0x2'));var router=express[_0x131b('0x3')]();var fs_extra=require(_0x131b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x131b('0x5'));var controller=require(_0x131b('0x6'));router[_0x131b('0x7')]('/',auth[_0x131b('0x8')](),controller[_0x131b('0x9')]);router['get'](_0x131b('0xa'),auth[_0x131b('0x8')](),controller[_0x131b('0xb')]);router[_0x131b('0x7')](_0x131b('0xc'),auth[_0x131b('0x8')](),controller['show']);router[_0x131b('0xd')]('/',auth[_0x131b('0x8')](),controller['create']);router[_0x131b('0xe')](_0x131b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x131b('0xf')](_0x131b('0xc'),auth['isAuthenticated'](),controller[_0x131b('0x10')]);module[_0x131b('0x11')]=router; \ No newline at end of file +var _0x89ff=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x5a2624,_0x2613d3){var _0x5aedf1=function(_0x4273eb){while(--_0x4273eb){_0x5a2624['push'](_0x5a2624['shift']());}};_0x5aedf1(++_0x2613d3);}(_0x89ff,0x1eb));var _0xf89f=function(_0x3b204d,_0x2868c6){_0x3b204d=_0x3b204d-0x0;var _0x31c4dd=_0x89ff[_0x3b204d];return _0x31c4dd;};'use strict';var multer=require(_0xf89f('0x0'));var util=require(_0xf89f('0x1'));var path=require(_0xf89f('0x2'));var timeout=require(_0xf89f('0x3'));var express=require(_0xf89f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf89f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf89f('0x6'));router['get']('/',auth[_0xf89f('0x7')](),controller[_0xf89f('0x8')]);router[_0xf89f('0x9')](_0xf89f('0xa'),auth[_0xf89f('0x7')](),controller[_0xf89f('0xb')]);router[_0xf89f('0x9')](_0xf89f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf89f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf89f('0xe')](_0xf89f('0xc'),auth['isAuthenticated'](),controller[_0xf89f('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf89f('0x10')]);module[_0xf89f('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ceb3475..9ea3935 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 _0x3663=['exports','STRING','DATE','moment','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3663,0x1cf));var _0x3366=function(_0x8956eb,_0x3ee779){_0x8956eb=_0x8956eb-0x0;var _0x14fbee=_0x3663[_0x8956eb];return _0x14fbee;};'use strict';var moment=require(_0x3366('0x0'));var Sequelize=require(_0x3366('0x1'));module[_0x3366('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3366('0x3')]},'joinAt':{'type':Sequelize[_0x3366('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3366('0x4')]},'exitAt':{'type':Sequelize[_0x3366('0x4')]},'reason':{'type':Sequelize[_0x3366('0x3')]}}; \ No newline at end of file +var _0xda3f=['moment','STRING','DATE'];(function(_0x48c9aa,_0x283585){var _0x2c7111=function(_0xfd8e20){while(--_0xfd8e20){_0x48c9aa['push'](_0x48c9aa['shift']());}};_0x2c7111(++_0x283585);}(_0xda3f,0x120));var _0xfda3=function(_0x205a9e,_0x4e0afd){_0x205a9e=_0x205a9e-0x0;var _0x6ab85d=_0xda3f[_0x205a9e];return _0x6ab85d;};'use strict';var moment=require(_0xfda3('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xfda3('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xfda3('0x1')]},'joinAt':{'type':Sequelize[_0xfda3('0x2')]},'leaveAt':{'type':Sequelize[_0xfda3('0x2')]},'acceptAt':{'type':Sequelize[_0xfda3('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfda3('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 68cd1af..1745fb4 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 _0x14a0=['mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x14a0,0x8e));var _0x014a=function(_0x210cd8,_0x12799e){_0x210cd8=_0x210cd8-0x0;var _0x1af9e4=_0x14a0[_0x210cd8];return _0x1af9e4;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];function respondWithStatusCode(_0x43bfeb,_0x1bcd1){_0x1bcd1=_0x1bcd1||0xcc;return function(_0x20cb56){if(_0x20cb56){return _0x43bfeb[_0x014a('0x14')](_0x1bcd1);}return _0x43bfeb[_0x014a('0x15')](_0x1bcd1)[_0x014a('0x16')]();};}function respondWithResult(_0x71535d,_0x45cd80){_0x45cd80=_0x45cd80||0xc8;return function(_0x3c54c8){if(_0x3c54c8){return _0x71535d['status'](_0x45cd80)[_0x014a('0x17')](_0x3c54c8);}};}function respondWithFilteredResult(_0x3cf92f,_0x59f207){return function(_0x3a836f){if(_0x3a836f){var _0x128c46=typeof _0x59f207['offset']===_0x014a('0x18')&&typeof _0x59f207[_0x014a('0x19')]===_0x014a('0x18');var _0x12da95=_0x3a836f[_0x014a('0x1a')];var _0x12d339=_0x128c46?0x0:_0x59f207[_0x014a('0x1b')];var _0x263b07=_0x128c46?_0x3a836f[_0x014a('0x1a')]:_0x59f207[_0x014a('0x1b')]+_0x59f207[_0x014a('0x19')];var _0x89e132;if(_0x263b07>=_0x12da95){_0x263b07=_0x12da95;_0x89e132=0xc8;}else{_0x89e132=0xce;}_0x3cf92f[_0x014a('0x15')](_0x89e132);return _0x3cf92f[_0x014a('0x1c')]('Content-Range',_0x12d339+'-'+_0x263b07+'/'+_0x12da95)[_0x014a('0x17')](_0x3a836f);}return null;};}function patchUpdates(_0x109a9c){return function(_0x11065f){try{jsonpatch[_0x014a('0x1d')](_0x11065f,_0x109a9c,!![]);}catch(_0xc9a563){return BPromise[_0x014a('0x1e')](_0xc9a563);}return _0x11065f[_0x014a('0x1f')]();};}function saveUpdates(_0x3dd2d0,_0x290b86){return function(_0x486e66){if(_0x486e66){return _0x486e66[_0x014a('0x20')](_0x3dd2d0)['then'](function(_0x1a1318){return _0x1a1318;});}return null;};}function removeEntity(_0x26718b,_0x44d921){return function(_0x36d52b){if(_0x36d52b){return _0x36d52b[_0x014a('0x21')]()[_0x014a('0x22')](function(){_0x26718b[_0x014a('0x15')](0xcc)[_0x014a('0x16')]();});}};}function handleEntityNotFound(_0x165a42,_0x4c2627){return function(_0x3b4b92){if(!_0x3b4b92){_0x165a42['sendStatus'](0x194);}return _0x3b4b92;};}function handleError(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0x1f4;return function(_0x4f1c44){logger['error'](_0x4f1c44[_0x014a('0x23')]);if(_0x4f1c44[_0x014a('0x24')]){delete _0x4f1c44[_0x014a('0x24')];}_0x39a432['status'](_0x28701e)[_0x014a('0x25')](_0x4f1c44);};}exports[_0x014a('0x26')]=function(_0x598179,_0x31dc95){var _0x2560a6={},_0x496040={},_0x4f9c1c={'count':0x0,'rows':[]};var _0x397850=_[_0x014a('0x27')](db[_0x014a('0x28')][_0x014a('0x29')],function(_0x4ea00c){return{'name':_0x4ea00c[_0x014a('0x2a')],'type':_0x4ea00c[_0x014a('0x2b')][_0x014a('0x2c')]};});_0x496040[_0x014a('0x2d')]=_[_0x014a('0x27')](_0x397850,_0x014a('0x24'));_0x496040[_0x014a('0x2e')]=_[_0x014a('0x2f')](_0x598179[_0x014a('0x2e')]);_0x496040[_0x014a('0x30')]=_[_0x014a('0x31')](_0x496040['model'],_0x496040[_0x014a('0x2e')]);_0x2560a6[_0x014a('0x32')]=_[_0x014a('0x31')](_0x496040[_0x014a('0x2d')],qs[_0x014a('0x33')](_0x598179[_0x014a('0x2e')][_0x014a('0x33')]));_0x2560a6['attributes']=_0x2560a6[_0x014a('0x32')][_0x014a('0x34')]?_0x2560a6['attributes']:_0x496040[_0x014a('0x2d')];if(!_0x598179[_0x014a('0x2e')][_0x014a('0x35')](_0x014a('0x36'))){_0x2560a6[_0x014a('0x19')]=qs[_0x014a('0x19')](_0x598179[_0x014a('0x2e')][_0x014a('0x19')]);_0x2560a6['offset']=qs[_0x014a('0x1b')](_0x598179[_0x014a('0x2e')][_0x014a('0x1b')]);}_0x2560a6[_0x014a('0x37')]=qs['sort'](_0x598179[_0x014a('0x2e')][_0x014a('0x38')]);_0x2560a6[_0x014a('0x39')]=qs[_0x014a('0x30')](_[_0x014a('0x3a')](_0x598179[_0x014a('0x2e')],_0x496040[_0x014a('0x30')]),_0x397850);if(_0x598179[_0x014a('0x2e')][_0x014a('0x3b')]){_0x2560a6['where']=_[_0x014a('0x3c')](_0x2560a6['where'],{'$or':_[_0x014a('0x27')](_0x397850,function(_0xc11492){if(_0xc11492[_0x014a('0x2b')]!==_0x014a('0x3d')){var _0x43376c={};_0x43376c[_0xc11492['name']]={'$like':'%'+_0x598179[_0x014a('0x2e')][_0x014a('0x3b')]+'%'};return _0x43376c;}})});}_0x2560a6=_['merge']({},_0x2560a6,_0x598179[_0x014a('0x3e')]);var _0x2990df={'where':_0x2560a6[_0x014a('0x39')]};return db[_0x014a('0x28')][_0x014a('0x1a')](_0x2990df)[_0x014a('0x22')](function(_0x17b1b6){_0x4f9c1c[_0x014a('0x1a')]=_0x17b1b6;if(_0x598179[_0x014a('0x2e')]['includeAll']){_0x2560a6[_0x014a('0x3f')]=[{'all':!![]}];}return db[_0x014a('0x28')][_0x014a('0x40')](_0x2560a6);})[_0x014a('0x22')](function(_0x5f1a91){_0x4f9c1c[_0x014a('0x41')]=_0x5f1a91;return _0x4f9c1c;})[_0x014a('0x22')](respondWithFilteredResult(_0x31dc95,_0x2560a6))[_0x014a('0x42')](handleError(_0x31dc95,null));};exports[_0x014a('0x43')]=function(_0x1dc647,_0x430a56){var _0x5f2969={'raw':!![],'where':{'id':_0x1dc647[_0x014a('0x44')]['id']}},_0x361866={};_0x361866['model']=_[_0x014a('0x2f')](db[_0x014a('0x28')][_0x014a('0x29')]);_0x361866['query']=_[_0x014a('0x2f')](_0x1dc647['query']);_0x361866['filters']=_[_0x014a('0x31')](_0x361866[_0x014a('0x2d')],_0x361866['query']);_0x5f2969[_0x014a('0x32')]=_[_0x014a('0x31')](_0x361866[_0x014a('0x2d')],qs[_0x014a('0x33')](_0x1dc647[_0x014a('0x2e')][_0x014a('0x33')]));_0x5f2969['attributes']=_0x5f2969[_0x014a('0x32')][_0x014a('0x34')]?_0x5f2969[_0x014a('0x32')]:_0x361866['model'];if(_0x1dc647['query'][_0x014a('0x45')]){_0x5f2969['include']=[{'all':!![]}];}_0x5f2969=_['merge']({},_0x5f2969,_0x1dc647[_0x014a('0x3e')]);return db['MailQueueReport'][_0x014a('0x46')](_0x5f2969)[_0x014a('0x22')](handleEntityNotFound(_0x430a56,null))[_0x014a('0x22')](respondWithResult(_0x430a56,null))['catch'](handleError(_0x430a56,null));};exports[_0x014a('0x47')]=function(_0x23be18,_0x12cd9b){return db[_0x014a('0x28')][_0x014a('0x47')](_0x23be18[_0x014a('0x48')],{})['then'](respondWithResult(_0x12cd9b,0xc9))[_0x014a('0x42')](handleError(_0x12cd9b,null));};exports[_0x014a('0x20')]=function(_0x5a861c,_0x1a4df9){if(_0x5a861c[_0x014a('0x48')]['id']){delete _0x5a861c[_0x014a('0x48')]['id'];}return db[_0x014a('0x28')][_0x014a('0x46')]({'where':{'id':_0x5a861c[_0x014a('0x44')]['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x1a4df9,null))[_0x014a('0x22')](saveUpdates(_0x5a861c['body'],null))[_0x014a('0x22')](respondWithResult(_0x1a4df9,null))[_0x014a('0x42')](handleError(_0x1a4df9,null));};exports[_0x014a('0x21')]=function(_0x135e7e,_0x312c7a){return db['MailQueueReport'][_0x014a('0x46')]({'where':{'id':_0x135e7e['params']['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x312c7a,null))[_0x014a('0x22')](removeEntity(_0x312c7a,null))[_0x014a('0x42')](handleError(_0x312c7a,null));};exports[_0x014a('0x49')]=function(_0x3caa6e,_0x4f8547){return db['MailQueueReport']['describe']()['then'](respondWithResult(_0x4f8547,null))[_0x014a('0x42')](handleError(_0x4f8547,null));}; \ No newline at end of file +var _0xaebd=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','send','index','map','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','params','MailQueueReport','options','create','body','find','describe','eml-format'];(function(_0x1c291d,_0x1e9835){var _0x3b6d0c=function(_0x286f92){while(--_0x286f92){_0x1c291d['push'](_0x1c291d['shift']());}};_0x3b6d0c(++_0x1e9835);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x76757a,_0x2dd2d3){_0x76757a=_0x76757a-0x0;var _0x4f18b0=_0xaebd[_0x76757a];return _0x4f18b0;};'use strict';var emlformat=require(_0xdaeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdaeb('0x1'));var jsonpatch=require(_0xdaeb('0x2'));var rp=require(_0xdaeb('0x3'));var moment=require(_0xdaeb('0x4'));var BPromise=require(_0xdaeb('0x5'));var Mustache=require('mustache');var util=require(_0xdaeb('0x6'));var path=require(_0xdaeb('0x7'));var sox=require(_0xdaeb('0x8'));var csv=require(_0xdaeb('0x9'));var ejs=require(_0xdaeb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdaeb('0xb'));var squel=require(_0xdaeb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdaeb('0xd'));var toCsv=require(_0xdaeb('0x9'));var querystring=require(_0xdaeb('0xe'));var Papa=require('papaparse');var Redis=require(_0xdaeb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdaeb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdaeb('0x11'));var logger=require('../../config/logger')(_0xdaeb('0x12'));var utils=require(_0xdaeb('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdaeb('0x14'))['db'];function respondWithStatusCode(_0x5aedaa,_0x4ee3cc){_0x4ee3cc=_0x4ee3cc||0xcc;return function(_0x2673db){if(_0x2673db){return _0x5aedaa[_0xdaeb('0x15')](_0x4ee3cc);}return _0x5aedaa[_0xdaeb('0x16')](_0x4ee3cc)[_0xdaeb('0x17')]();};}function respondWithResult(_0x1f31be,_0xc6c611){_0xc6c611=_0xc6c611||0xc8;return function(_0x49ba9a){if(_0x49ba9a){return _0x1f31be['status'](_0xc6c611)[_0xdaeb('0x18')](_0x49ba9a);}};}function respondWithFilteredResult(_0x306bdb,_0x34b2fe){return function(_0x18ec4e){if(_0x18ec4e){var _0x538a25=typeof _0x34b2fe['offset']===_0xdaeb('0x19')&&typeof _0x34b2fe['limit']==='undefined';var _0x42e509=_0x18ec4e[_0xdaeb('0x1a')];var _0x1b5243=_0x538a25?0x0:_0x34b2fe[_0xdaeb('0x1b')];var _0x2d8f11=_0x538a25?_0x18ec4e[_0xdaeb('0x1a')]:_0x34b2fe['offset']+_0x34b2fe[_0xdaeb('0x1c')];var _0x5ccf66;if(_0x2d8f11>=_0x42e509){_0x2d8f11=_0x42e509;_0x5ccf66=0xc8;}else{_0x5ccf66=0xce;}_0x306bdb[_0xdaeb('0x16')](_0x5ccf66);return _0x306bdb[_0xdaeb('0x1d')](_0xdaeb('0x1e'),_0x1b5243+'-'+_0x2d8f11+'/'+_0x42e509)['json'](_0x18ec4e);}return null;};}function patchUpdates(_0x4e97e0){return function(_0x13563c){try{jsonpatch[_0xdaeb('0x1f')](_0x13563c,_0x4e97e0,!![]);}catch(_0x23fccb){return BPromise[_0xdaeb('0x20')](_0x23fccb);}return _0x13563c[_0xdaeb('0x21')]();};}function saveUpdates(_0x536aae,_0x597bb7){return function(_0x2c969d){if(_0x2c969d){return _0x2c969d[_0xdaeb('0x22')](_0x536aae)[_0xdaeb('0x23')](function(_0x1d919a){return _0x1d919a;});}return null;};}function removeEntity(_0x39dfae,_0x55c825){return function(_0x254c3b){if(_0x254c3b){return _0x254c3b['destroy']()[_0xdaeb('0x23')](function(){_0x39dfae[_0xdaeb('0x16')](0xcc)[_0xdaeb('0x17')]();});}};}function handleEntityNotFound(_0x3b0770,_0x32c2c1){return function(_0x4fc3e2){if(!_0x4fc3e2){_0x3b0770[_0xdaeb('0x15')](0x194);}return _0x4fc3e2;};}function handleError(_0x34fa21,_0x338687){_0x338687=_0x338687||0x1f4;return function(_0x4eb719){logger['error'](_0x4eb719[_0xdaeb('0x24')]);if(_0x4eb719['name']){delete _0x4eb719['name'];}_0x34fa21[_0xdaeb('0x16')](_0x338687)[_0xdaeb('0x25')](_0x4eb719);};}exports[_0xdaeb('0x26')]=function(_0x5eb7b5,_0x5e6f97){var _0x32966f={},_0x440022={},_0x37f468={'count':0x0,'rows':[]};var _0x596c19=_[_0xdaeb('0x27')](db['MailQueueReport']['rawAttributes'],function(_0x28812c){return{'name':_0x28812c[_0xdaeb('0x28')],'type':_0x28812c[_0xdaeb('0x29')][_0xdaeb('0x2a')]};});_0x440022[_0xdaeb('0x2b')]=_[_0xdaeb('0x27')](_0x596c19,_0xdaeb('0x2c'));_0x440022['query']=_[_0xdaeb('0x2d')](_0x5eb7b5[_0xdaeb('0x2e')]);_0x440022[_0xdaeb('0x2f')]=_[_0xdaeb('0x30')](_0x440022[_0xdaeb('0x2b')],_0x440022['query']);_0x32966f[_0xdaeb('0x31')]=_[_0xdaeb('0x30')](_0x440022['model'],qs[_0xdaeb('0x32')](_0x5eb7b5[_0xdaeb('0x2e')][_0xdaeb('0x32')]));_0x32966f[_0xdaeb('0x31')]=_0x32966f[_0xdaeb('0x31')][_0xdaeb('0x33')]?_0x32966f[_0xdaeb('0x31')]:_0x440022[_0xdaeb('0x2b')];if(!_0x5eb7b5[_0xdaeb('0x2e')][_0xdaeb('0x34')]('nolimit')){_0x32966f['limit']=qs[_0xdaeb('0x1c')](_0x5eb7b5['query'][_0xdaeb('0x1c')]);_0x32966f[_0xdaeb('0x1b')]=qs[_0xdaeb('0x1b')](_0x5eb7b5[_0xdaeb('0x2e')][_0xdaeb('0x1b')]);}_0x32966f[_0xdaeb('0x35')]=qs['sort'](_0x5eb7b5[_0xdaeb('0x2e')][_0xdaeb('0x36')]);_0x32966f[_0xdaeb('0x37')]=qs['filters'](_[_0xdaeb('0x38')](_0x5eb7b5[_0xdaeb('0x2e')],_0x440022[_0xdaeb('0x2f')]),_0x596c19);if(_0x5eb7b5[_0xdaeb('0x2e')][_0xdaeb('0x39')]){_0x32966f[_0xdaeb('0x37')]=_[_0xdaeb('0x3a')](_0x32966f['where'],{'$or':_[_0xdaeb('0x27')](_0x596c19,function(_0x170009){if(_0x170009['type']!=='VIRTUAL'){var _0x2ef310={};_0x2ef310[_0x170009[_0xdaeb('0x2c')]]={'$like':'%'+_0x5eb7b5['query'][_0xdaeb('0x39')]+'%'};return _0x2ef310;}})});}_0x32966f=_[_0xdaeb('0x3a')]({},_0x32966f,_0x5eb7b5['options']);var _0x151cc4={'where':_0x32966f[_0xdaeb('0x37')]};return db['MailQueueReport']['count'](_0x151cc4)[_0xdaeb('0x23')](function(_0x11dce7){_0x37f468[_0xdaeb('0x1a')]=_0x11dce7;if(_0x5eb7b5[_0xdaeb('0x2e')][_0xdaeb('0x3b')]){_0x32966f[_0xdaeb('0x3c')]=[{'all':!![]}];}return db['MailQueueReport'][_0xdaeb('0x3d')](_0x32966f);})['then'](function(_0x46aa44){_0x37f468['rows']=_0x46aa44;return _0x37f468;})['then'](respondWithFilteredResult(_0x5e6f97,_0x32966f))[_0xdaeb('0x3e')](handleError(_0x5e6f97,null));};exports['show']=function(_0x5a42a6,_0x4efd96){var _0x45c3fc={'raw':!![],'where':{'id':_0x5a42a6[_0xdaeb('0x3f')]['id']}},_0x244369={};_0x244369[_0xdaeb('0x2b')]=_['keys'](db[_0xdaeb('0x40')]['rawAttributes']);_0x244369[_0xdaeb('0x2e')]=_[_0xdaeb('0x2d')](_0x5a42a6[_0xdaeb('0x2e')]);_0x244369['filters']=_[_0xdaeb('0x30')](_0x244369[_0xdaeb('0x2b')],_0x244369[_0xdaeb('0x2e')]);_0x45c3fc[_0xdaeb('0x31')]=_[_0xdaeb('0x30')](_0x244369[_0xdaeb('0x2b')],qs[_0xdaeb('0x32')](_0x5a42a6[_0xdaeb('0x2e')][_0xdaeb('0x32')]));_0x45c3fc[_0xdaeb('0x31')]=_0x45c3fc[_0xdaeb('0x31')][_0xdaeb('0x33')]?_0x45c3fc['attributes']:_0x244369[_0xdaeb('0x2b')];if(_0x5a42a6[_0xdaeb('0x2e')]['includeAll']){_0x45c3fc['include']=[{'all':!![]}];}_0x45c3fc=_[_0xdaeb('0x3a')]({},_0x45c3fc,_0x5a42a6[_0xdaeb('0x41')]);return db[_0xdaeb('0x40')]['find'](_0x45c3fc)[_0xdaeb('0x23')](handleEntityNotFound(_0x4efd96,null))[_0xdaeb('0x23')](respondWithResult(_0x4efd96,null))[_0xdaeb('0x3e')](handleError(_0x4efd96,null));};exports[_0xdaeb('0x42')]=function(_0x266d6b,_0x45344b){return db[_0xdaeb('0x40')][_0xdaeb('0x42')](_0x266d6b['body'],{})[_0xdaeb('0x23')](respondWithResult(_0x45344b,0xc9))[_0xdaeb('0x3e')](handleError(_0x45344b,null));};exports['update']=function(_0x38d2ee,_0x4dd70c){if(_0x38d2ee[_0xdaeb('0x43')]['id']){delete _0x38d2ee[_0xdaeb('0x43')]['id'];}return db[_0xdaeb('0x40')][_0xdaeb('0x44')]({'where':{'id':_0x38d2ee[_0xdaeb('0x3f')]['id']}})[_0xdaeb('0x23')](handleEntityNotFound(_0x4dd70c,null))[_0xdaeb('0x23')](saveUpdates(_0x38d2ee[_0xdaeb('0x43')],null))[_0xdaeb('0x23')](respondWithResult(_0x4dd70c,null))['catch'](handleError(_0x4dd70c,null));};exports['destroy']=function(_0x1403c8,_0x3112d2){return db[_0xdaeb('0x40')][_0xdaeb('0x44')]({'where':{'id':_0x1403c8[_0xdaeb('0x3f')]['id']}})[_0xdaeb('0x23')](handleEntityNotFound(_0x3112d2,null))['then'](removeEntity(_0x3112d2,null))[_0xdaeb('0x3e')](handleError(_0x3112d2,null));};exports[_0xdaeb('0x45')]=function(_0x3f6a88,_0x589442){return db[_0xdaeb('0x40')]['describe']()[_0xdaeb('0x23')](respondWithResult(_0x589442,null))[_0xdaeb('0x3e')](handleError(_0x589442,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1d15509..515b358 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 _0xf4d2=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x54f63f,_0x1d67b1){var _0x19ba9a=function(_0xeb081d){while(--_0xeb081d){_0x54f63f['push'](_0x54f63f['shift']());}};_0x19ba9a(++_0x1d67b1);}(_0xf4d2,0x130));var _0x2f4d=function(_0x5dc043,_0x25e5ca){_0x5dc043=_0x5dc043-0x0;var _0x256baf=_0xf4d2[_0x5dc043];return _0x256baf;};'use strict';var _=require(_0x2f4d('0x0'));var util=require(_0x2f4d('0x1'));var logger=require(_0x2f4d('0x2'))('api');var moment=require(_0x2f4d('0x3'));var BPromise=require(_0x2f4d('0x4'));var rp=require(_0x2f4d('0x5'));var fs=require('fs');var path=require(_0x2f4d('0x6'));var rimraf=require(_0x2f4d('0x7'));var config=require(_0x2f4d('0x8'));var attributes=require(_0x2f4d('0x9'));module['exports']=function(_0x1a96ae,_0x224413){return _0x1a96ae['define']('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x2f4d('0xa'),'fields':[_0x2f4d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b16=['rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','api','bluebird','request-promise'];(function(_0x48d122,_0x4bcd20){var _0x36e303=function(_0x2b7a2e){while(--_0x2b7a2e){_0x48d122['push'](_0x48d122['shift']());}};_0x36e303(++_0x4bcd20);}(_0x0b16,0x80));var _0x60b1=function(_0x4c4888,_0x5a24b5){_0x4c4888=_0x4c4888-0x0;var _0xd7fb8b=_0x0b16[_0x4c4888];return _0xd7fb8b;};'use strict';var _=require(_0x60b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x60b1('0x1'));var moment=require('moment');var BPromise=require(_0x60b1('0x2'));var rp=require(_0x60b1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60b1('0x4'));var config=require('../../config/environment');var attributes=require(_0x60b1('0x5'));module[_0x60b1('0x6')]=function(_0x5a8b78,_0x295153){return _0x5a8b78[_0x60b1('0x7')](_0x60b1('0x8'),attributes,{'tableName':_0x60b1('0x9'),'paranoid':![],'indexes':[{'name':_0x60b1('0xa'),'fields':[_0x60b1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index dfba39f..5ab8014 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 _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x3f62ac,_0x49b1af){var _0x3bfef3=function(_0x5c42cb){while(--_0x5c42cb){_0x3f62ac['push'](_0x3f62ac['shift']());}};_0x3bfef3(++_0x49b1af);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2ebf9d,_0x5d8e7c){_0x2ebf9d=_0x2ebf9d-0x0;var _0x2ee4de=_0x5f2f[_0x2ebf9d];return _0x2ee4de;};'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')]('MailQueueReport,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4ca345,_0x172bc0){var _0x46f6de=function(_0x9cc23f){while(--_0x9cc23f){_0x4ca345['push'](_0x4ca345['shift']());}};_0x46f6de(++_0x172bc0);}(_0x1261,0x144));var _0x1126=function(_0x298064,_0x1d2bfb){_0x298064=_0x298064-0x0;var _0x2512ea=_0x1261[_0x298064];return _0x2512ea;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index fa2fb88..91e716f 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4e0662,_0x20703f){var _0x1f54d4=function(_0x21edd8){while(--_0x21edd8){_0x4e0662['push'](_0x4e0662['shift']());}};_0x1f54d4(++_0x20703f);}(_0x70e0,0x17b));var _0x070e=function(_0x1dc4ce,_0x18ad83){_0x1dc4ce=_0x1dc4ce-0x0;var _0x23a105=_0x70e0[_0x1dc4ce];return _0x23a105;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x178700,_0x306ad0){var _0x431a02=function(_0x1ebe39){while(--_0x1ebe39){_0x178700['push'](_0x178700['shift']());}};_0x431a02(++_0x306ad0);}(_0xedd9,0xfc));var _0x9edd=function(_0x24eb38,_0x2ab42c){_0x24eb38=_0x24eb38-0x0;var _0x547437=_0xedd9[_0x24eb38];return _0x547437;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 8cd4596..86c4cbe 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 _0xbaf0=['BOOLEAN','INBOX','INTEGER','exports','STRING'];(function(_0x1ab97b,_0x2b658c){var _0x5f5436=function(_0x4632cc){while(--_0x4632cc){_0x1ab97b['push'](_0x1ab97b['shift']());}};_0x5f5436(++_0x2b658c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'description':{'type':Sequelize[_0x0baf('0x1')]},'host':{'type':Sequelize[_0x0baf('0x1')]},'authentication':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0baf('0x1')]},'password':{'type':Sequelize[_0x0baf('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x3')},'connTimeout':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xfc03=['BOOLEAN','INBOX','sequelize','STRING','INTEGER'];(function(_0x1e62b8,_0x5eed4c){var _0x2ab271=function(_0x20f14e){while(--_0x20f14e){_0x1e62b8['push'](_0x1e62b8['shift']());}};_0x2ab271(++_0x5eed4c);}(_0xfc03,0x16f));var _0x3fc0=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xfc03[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0x3fc0('0x0'));module['exports']={'description':{'type':Sequelize[_0x3fc0('0x1')]},'host':{'type':Sequelize[_0x3fc0('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x3fc0('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3fc0('0x2')]},'tls':{'type':Sequelize[_0x3fc0('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3fc0('0x1')],'defaultValue':_0x3fc0('0x4')},'connTimeout':{'type':Sequelize[_0x3fc0('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3fc0('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3fc0('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 60e50ae..05ef3c3 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 _0x3868=['moment','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3868,0x1c6));var _0x8386=function(_0x5a4e8f,_0x53ae82){_0x5a4e8f=_0x5a4e8f-0x0;var _0x52f02a=_0x3868[_0x5a4e8f];return _0x52f02a;};'use strict';var _=require(_0x8386('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8386('0x1'));var moment=require(_0x8386('0x2'));var BPromise=require(_0x8386('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8386('0x4'));var rimraf=require(_0x8386('0x5'));var config=require(_0x8386('0x6'));var attributes=require(_0x8386('0x7'));module[_0x8386('0x8')]=function(_0x43643f,_0x39fbbc){return _0x43643f[_0x8386('0x9')](_0x8386('0xa'),attributes,{'tableName':_0x8386('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a32=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x49284d,_0x3b63e5){var _0x510772=function(_0x1a13ec){while(--_0x1a13ec){_0x49284d['push'](_0x49284d['shift']());}};_0x510772(++_0x3b63e5);}(_0x5a32,0xcc));var _0x25a3=function(_0x3602fc,_0x230e9c){_0x3602fc=_0x3602fc-0x0;var _0x260630=_0x5a32[_0x3602fc];return _0x260630;};'use strict';var _=require(_0x25a3('0x0'));var util=require(_0x25a3('0x1'));var logger=require(_0x25a3('0x2'))(_0x25a3('0x3'));var moment=require(_0x25a3('0x4'));var BPromise=require(_0x25a3('0x5'));var rp=require(_0x25a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25a3('0x7'));var config=require(_0x25a3('0x8'));var attributes=require('./mailServerIn.attributes');module[_0x25a3('0x9')]=function(_0x2477d1,_0xf811c3){return _0x2477d1[_0x25a3('0xa')](_0x25a3('0xb'),attributes,{'tableName':_0x25a3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 6f182e9..6a60e5d 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 _0x5825=['then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s','GetMailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xce8bce,_0x5bc5e8){var _0x135d09=function(_0x2f3fe4){while(--_0x2f3fe4){_0xce8bce['push'](_0xce8bce['shift']());}};_0x135d09(++_0x5bc5e8);}(_0x5825,0x78));var _0x5582=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5825[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5582('0x0'));var util=require(_0x5582('0x1'));var moment=require(_0x5582('0x2'));var BPromise=require(_0x5582('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5582('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5582('0x5'));var logger=require(_0x5582('0x6'))(_0x5582('0x7'));var config=require(_0x5582('0x8'));var jayson=require(_0x5582('0x9'));var client=jayson[_0x5582('0xa')][_0x5582('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d618a,_0x17ade9,_0x588f5f){return new BPromise(function(_0x39b66,_0x5fa603){return client['request'](_0x5d618a,_0x588f5f)[_0x5582('0xc')](function(_0x3aa455){logger[_0x5582('0xd')]('MailServerIn,\x20%s,\x20%s',_0x17ade9,_0x5582('0xe'));logger[_0x5582('0xf')](_0x5582('0x10'),_0x17ade9,'request\x20sent',JSON[_0x5582('0x11')](_0x3aa455));if(_0x3aa455[_0x5582('0x12')]){if(_0x3aa455['error'][_0x5582('0x13')]===0x1f4){logger[_0x5582('0x12')]('MailServerIn,\x20%s,\x20%s',_0x17ade9,_0x3aa455['error'][_0x5582('0x14')]);return _0x5fa603(_0x3aa455['error']['message']);}logger[_0x5582('0x12')](_0x5582('0x15'),_0x17ade9,_0x3aa455['error'][_0x5582('0x14')]);return _0x39b66(_0x3aa455[_0x5582('0x12')]['message']);}else{logger[_0x5582('0xd')](_0x5582('0x15'),_0x17ade9,'request\x20sent');_0x39b66(_0x3aa455['result'][_0x5582('0x14')]);}})['catch'](function(_0x378fa8){logger[_0x5582('0x12')](_0x5582('0x15'),_0x17ade9,_0x378fa8);_0x5fa603(_0x378fa8);});});}exports[_0x5582('0x16')]=function(_0x1b021a){var _0x13810e=this;return new Promise(function(_0x31a3de,_0x154fda){return db['MailServerIn'][_0x5582('0x17')]({'raw':_0x1b021a[_0x5582('0x18')]?_0x1b021a[_0x5582('0x18')][_0x5582('0x19')]===undefined?!![]:![]:!![],'where':_0x1b021a['options']?_0x1b021a[_0x5582('0x18')][_0x5582('0x1a')]||null:null,'attributes':_0x1b021a[_0x5582('0x18')]?_0x1b021a[_0x5582('0x18')][_0x5582('0x1b')]||null:null,'limit':_0x1b021a[_0x5582('0x18')]?_0x1b021a[_0x5582('0x18')][_0x5582('0x1c')]||null:null,'include':_0x1b021a[_0x5582('0x18')]?_0x1b021a['options'][_0x5582('0x1d')]?_['map'](_0x1b021a[_0x5582('0x18')]['include'],function(_0x1184d3){return{'model':db[_0x1184d3['model']],'as':_0x1184d3['as'],'attributes':_0x1184d3['attributes'],'include':_0x1184d3[_0x5582('0x1d')]?_[_0x5582('0x1e')](_0x1184d3[_0x5582('0x1d')],function(_0x4b178f){return{'model':db[_0x4b178f[_0x5582('0x1f')]],'as':_0x4b178f['as'],'attributes':_0x4b178f[_0x5582('0x1b')],'include':_0x4b178f['include']?_[_0x5582('0x1e')](_0x4b178f['include'],function(_0x1d8476){return{'model':db[_0x1d8476[_0x5582('0x1f')]],'as':_0x1d8476['as'],'attributes':_0x1d8476['attributes']};}):[]};}):[]};}):[]:[]})[_0x5582('0xc')](function(_0x5de26b){logger[_0x5582('0xd')](_0x5582('0x16'),_0x1b021a);logger[_0x5582('0xf')](_0x5582('0x16'),_0x1b021a,JSON[_0x5582('0x11')](_0x5de26b));_0x31a3de(_0x5de26b);})[_0x5582('0x20')](function(_0x134d00){logger[_0x5582('0x12')](_0x5582('0x16'),_0x134d00['message'],_0x1b021a);_0x154fda(_0x13810e[_0x5582('0x12')](0x1f4,_0x134d00[_0x5582('0x14')]));});});}; \ No newline at end of file +var _0x5d40=['result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3be455,_0x2c4438){var _0x3c8fa2=function(_0x2560a3){while(--_0x2560a3){_0x3be455['push'](_0x3be455['shift']());}};_0x3c8fa2(++_0x2c4438);}(_0x5d40,0x1a2));var _0x05d4=function(_0x5540ff,_0x555616){_0x5540ff=_0x5540ff-0x0;var _0x385fcb=_0x5d40[_0x5540ff];return _0x385fcb;};'use strict';var _=require(_0x05d4('0x0'));var util=require(_0x05d4('0x1'));var moment=require('moment');var BPromise=require(_0x05d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05d4('0x3'));var db=require(_0x05d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x05d4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x05d4('0x6'));var client=jayson['client'][_0x05d4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x49cf8c,_0x49a004,_0x173215){return new BPromise(function(_0xf99394,_0x1d5165){return client[_0x05d4('0x8')](_0x49cf8c,_0x173215)['then'](function(_0x354b73){logger[_0x05d4('0x9')](_0x05d4('0xa'),_0x49a004,_0x05d4('0xb'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x49a004,'request\x20sent',JSON[_0x05d4('0xc')](_0x354b73));if(_0x354b73['error']){if(_0x354b73[_0x05d4('0xd')][_0x05d4('0xe')]===0x1f4){logger[_0x05d4('0xd')](_0x05d4('0xa'),_0x49a004,_0x354b73[_0x05d4('0xd')]['message']);return _0x1d5165(_0x354b73[_0x05d4('0xd')][_0x05d4('0xf')]);}logger['error'](_0x05d4('0xa'),_0x49a004,_0x354b73[_0x05d4('0xd')][_0x05d4('0xf')]);return _0xf99394(_0x354b73[_0x05d4('0xd')][_0x05d4('0xf')]);}else{logger[_0x05d4('0x9')]('MailServerIn,\x20%s,\x20%s',_0x49a004,_0x05d4('0xb'));_0xf99394(_0x354b73[_0x05d4('0x10')]['message']);}})[_0x05d4('0x11')](function(_0x10131d){logger[_0x05d4('0xd')]('MailServerIn,\x20%s,\x20%s',_0x49a004,_0x10131d);_0x1d5165(_0x10131d);});});}exports[_0x05d4('0x12')]=function(_0x367f09){var _0x445a2c=this;return new Promise(function(_0x1e77c2,_0x229bc5){return db[_0x05d4('0x13')][_0x05d4('0x14')]({'raw':_0x367f09[_0x05d4('0x15')]?_0x367f09[_0x05d4('0x15')][_0x05d4('0x16')]===undefined?!![]:![]:!![],'where':_0x367f09[_0x05d4('0x15')]?_0x367f09[_0x05d4('0x15')][_0x05d4('0x17')]||null:null,'attributes':_0x367f09[_0x05d4('0x15')]?_0x367f09[_0x05d4('0x15')][_0x05d4('0x18')]||null:null,'limit':_0x367f09[_0x05d4('0x15')]?_0x367f09[_0x05d4('0x15')][_0x05d4('0x19')]||null:null,'include':_0x367f09[_0x05d4('0x15')]?_0x367f09[_0x05d4('0x15')][_0x05d4('0x1a')]?_[_0x05d4('0x1b')](_0x367f09[_0x05d4('0x15')][_0x05d4('0x1a')],function(_0x99c2d6){return{'model':db[_0x99c2d6[_0x05d4('0x1c')]],'as':_0x99c2d6['as'],'attributes':_0x99c2d6['attributes'],'include':_0x99c2d6[_0x05d4('0x1a')]?_[_0x05d4('0x1b')](_0x99c2d6['include'],function(_0x5f3420){return{'model':db[_0x5f3420[_0x05d4('0x1c')]],'as':_0x5f3420['as'],'attributes':_0x5f3420[_0x05d4('0x18')],'include':_0x5f3420[_0x05d4('0x1a')]?_[_0x05d4('0x1b')](_0x5f3420[_0x05d4('0x1a')],function(_0xbfa554){return{'model':db[_0xbfa554[_0x05d4('0x1c')]],'as':_0xbfa554['as'],'attributes':_0xbfa554[_0x05d4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x05d4('0x1d')](function(_0x9146b6){logger[_0x05d4('0x9')](_0x05d4('0x12'),_0x367f09);logger[_0x05d4('0x1e')](_0x05d4('0x12'),_0x367f09,JSON[_0x05d4('0xc')](_0x9146b6));_0x1e77c2(_0x9146b6);})[_0x05d4('0x11')](function(_0x3742af){logger['error']('GetMailServerIn',_0x3742af[_0x05d4('0xf')],_0x367f09);_0x229bc5(_0x445a2c[_0x05d4('0xd')](0x1f4,_0x3742af[_0x05d4('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e008b2c..3d574b2 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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7a54,0x106));var _0x47a5=function(_0x1dfc0c,_0x3306ed){_0x1dfc0c=_0x1dfc0c-0x0;var _0x1aa999=_0x7a54[_0x1dfc0c];return _0x1aa999;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 b68d181..c3d87f8 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 _0xc22b=['INTEGER','BOOLEAN','STRING'];(function(_0x513789,_0x3d7067){var _0xbdc2f3=function(_0x4610ac){while(--_0x4610ac){_0x513789['push'](_0x513789['shift']());}};_0xbdc2f3(++_0x3d7067);}(_0xc22b,0x1c4));var _0xbc22=function(_0x56fb82,_0x4795ae){_0x56fb82=_0x56fb82-0x0;var _0x332ab9=_0xc22b[_0x56fb82];return _0x332ab9;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xbc22('0x0')]},'host':{'type':Sequelize[_0xbc22('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xbc22('0x0')]},'port':{'type':Sequelize[_0xbc22('0x1')]},'secure':{'type':Sequelize[_0xbc22('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xbc22('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa7cb=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x3c189e,_0x402cd9){var _0x578410=function(_0x3162a2){while(--_0x3162a2){_0x3c189e['push'](_0x3c189e['shift']());}};_0x578410(++_0x402cd9);}(_0xa7cb,0x1a7));var _0xba7c=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0xa7cb[_0x4e6eb2];return _0x4e0c1c;};'use strict';var Sequelize=require(_0xba7c('0x0'));module['exports']={'description':{'type':Sequelize[_0xba7c('0x1')]},'host':{'type':Sequelize[_0xba7c('0x1')]},'user':{'type':Sequelize[_0xba7c('0x1')]},'pass':{'type':Sequelize[_0xba7c('0x1')]},'port':{'type':Sequelize[_0xba7c('0x2')]},'secure':{'type':Sequelize[_0xba7c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xba7c('0x1')]},'authentication':{'type':Sequelize[_0xba7c('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 21a78f9..5562f28 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 _0x0416=['name','send','index','map','MailServerOut','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','include','rows','catch','show','params','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error'];(function(_0x4d1e50,_0x33b39d){var _0x532260=function(_0x43d23b){while(--_0x43d23b){_0x4d1e50['push'](_0x4d1e50['shift']());}};_0x532260(++_0x33b39d);}(_0x0416,0x14d));var _0x6041=function(_0x1888e4,_0x407cb1){_0x1888e4=_0x1888e4-0x0;var _0x2999cf=_0x0416[_0x1888e4];return _0x2999cf;};'use strict';var emlformat=require(_0x6041('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6041('0x1'));var jsonpatch=require(_0x6041('0x2'));var rp=require(_0x6041('0x3'));var moment=require(_0x6041('0x4'));var BPromise=require(_0x6041('0x5'));var Mustache=require(_0x6041('0x6'));var util=require(_0x6041('0x7'));var path=require(_0x6041('0x8'));var sox=require(_0x6041('0x9'));var csv=require(_0x6041('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6041('0xb'));var _=require('lodash');var squel=require(_0x6041('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6041('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6041('0xe'));var Papa=require(_0x6041('0xf'));var Redis=require(_0x6041('0x10'));var authService=require(_0x6041('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6041('0x12'));var hardwareService=require(_0x6041('0x13'));var logger=require(_0x6041('0x14'))('api');var utils=require(_0x6041('0x15'));var config=require(_0x6041('0x16'));var licenseUtil=require(_0x6041('0x17'));var db=require(_0x6041('0x18'))['db'];function respondWithStatusCode(_0x467f2a,_0x4406c0){_0x4406c0=_0x4406c0||0xcc;return function(_0x448446){if(_0x448446){return _0x467f2a[_0x6041('0x19')](_0x4406c0);}return _0x467f2a[_0x6041('0x1a')](_0x4406c0)[_0x6041('0x1b')]();};}function respondWithResult(_0x5450f8,_0x11294f){_0x11294f=_0x11294f||0xc8;return function(_0x510d92){if(_0x510d92){return _0x5450f8[_0x6041('0x1a')](_0x11294f)[_0x6041('0x1c')](_0x510d92);}};}function respondWithFilteredResult(_0x35b5e2,_0x2d94cd){return function(_0x48c41c){if(_0x48c41c){var _0x51d481=typeof _0x2d94cd[_0x6041('0x1d')]==='undefined'&&typeof _0x2d94cd[_0x6041('0x1e')]===_0x6041('0x1f');var _0x56766a=_0x48c41c[_0x6041('0x20')];var _0x3e5f79=_0x51d481?0x0:_0x2d94cd[_0x6041('0x1d')];var _0x54375a=_0x51d481?_0x48c41c[_0x6041('0x20')]:_0x2d94cd[_0x6041('0x1d')]+_0x2d94cd[_0x6041('0x1e')];var _0x25c49f;if(_0x54375a>=_0x56766a){_0x54375a=_0x56766a;_0x25c49f=0xc8;}else{_0x25c49f=0xce;}_0x35b5e2[_0x6041('0x1a')](_0x25c49f);return _0x35b5e2[_0x6041('0x21')](_0x6041('0x22'),_0x3e5f79+'-'+_0x54375a+'/'+_0x56766a)[_0x6041('0x1c')](_0x48c41c);}return null;};}function patchUpdates(_0x3bcb12){return function(_0x457dde){try{jsonpatch[_0x6041('0x23')](_0x457dde,_0x3bcb12,!![]);}catch(_0x7fa884){return BPromise[_0x6041('0x24')](_0x7fa884);}return _0x457dde[_0x6041('0x25')]();};}function saveUpdates(_0x393879,_0x5d2cdd){return function(_0x4e353f){if(_0x4e353f){return _0x4e353f[_0x6041('0x26')](_0x393879)['then'](function(_0x882821){return _0x882821;});}return null;};}function removeEntity(_0x1a8003,_0x2a57d2){return function(_0x36fbde){if(_0x36fbde){return _0x36fbde[_0x6041('0x27')]()[_0x6041('0x28')](function(){_0x1a8003['status'](0xcc)[_0x6041('0x1b')]();});}};}function handleEntityNotFound(_0x3dd818,_0x4b2919){return function(_0x336fc7){if(!_0x336fc7){_0x3dd818['sendStatus'](0x194);}return _0x336fc7;};}function handleError(_0x691a1b,_0x432339){_0x432339=_0x432339||0x1f4;return function(_0x34f4ad){logger[_0x6041('0x29')](_0x34f4ad['stack']);if(_0x34f4ad['name']){delete _0x34f4ad[_0x6041('0x2a')];}_0x691a1b[_0x6041('0x1a')](_0x432339)[_0x6041('0x2b')](_0x34f4ad);};}exports[_0x6041('0x2c')]=function(_0x599581,_0x3219b2){var _0x1c9341={},_0x33bcb8={},_0x3d80c9={'count':0x0,'rows':[]};var _0x4e698c=_[_0x6041('0x2d')](db[_0x6041('0x2e')][_0x6041('0x2f')],function(_0x4acf58){return{'name':_0x4acf58['fieldName'],'type':_0x4acf58[_0x6041('0x30')][_0x6041('0x31')]};});_0x33bcb8[_0x6041('0x32')]=_['map'](_0x4e698c,_0x6041('0x2a'));_0x33bcb8[_0x6041('0x33')]=_[_0x6041('0x34')](_0x599581[_0x6041('0x33')]);_0x33bcb8['filters']=_[_0x6041('0x35')](_0x33bcb8[_0x6041('0x32')],_0x33bcb8[_0x6041('0x33')]);_0x1c9341[_0x6041('0x36')]=_[_0x6041('0x35')](_0x33bcb8[_0x6041('0x32')],qs['fields'](_0x599581[_0x6041('0x33')][_0x6041('0x37')]));_0x1c9341['attributes']=_0x1c9341[_0x6041('0x36')][_0x6041('0x38')]?_0x1c9341[_0x6041('0x36')]:_0x33bcb8[_0x6041('0x32')];if(!_0x599581[_0x6041('0x33')][_0x6041('0x39')](_0x6041('0x3a'))){_0x1c9341[_0x6041('0x1e')]=qs['limit'](_0x599581[_0x6041('0x33')][_0x6041('0x1e')]);_0x1c9341[_0x6041('0x1d')]=qs[_0x6041('0x1d')](_0x599581[_0x6041('0x33')][_0x6041('0x1d')]);}_0x1c9341[_0x6041('0x3b')]=qs[_0x6041('0x3c')](_0x599581[_0x6041('0x33')][_0x6041('0x3c')]);_0x1c9341[_0x6041('0x3d')]=qs[_0x6041('0x3e')](_['pick'](_0x599581[_0x6041('0x33')],_0x33bcb8[_0x6041('0x3e')]),_0x4e698c);if(_0x599581[_0x6041('0x33')]['filter']){_0x1c9341[_0x6041('0x3d')]=_[_0x6041('0x3f')](_0x1c9341['where'],{'$or':_[_0x6041('0x2d')](_0x4e698c,function(_0xd63df5){if(_0xd63df5[_0x6041('0x30')]!=='VIRTUAL'){var _0x5cfbeb={};_0x5cfbeb[_0xd63df5[_0x6041('0x2a')]]={'$like':'%'+_0x599581[_0x6041('0x33')][_0x6041('0x40')]+'%'};return _0x5cfbeb;}})});}_0x1c9341=_['merge']({},_0x1c9341,_0x599581[_0x6041('0x41')]);var _0x5b2f76={'where':_0x1c9341[_0x6041('0x3d')]};return db[_0x6041('0x2e')][_0x6041('0x20')](_0x5b2f76)[_0x6041('0x28')](function(_0x3eb4fa){_0x3d80c9[_0x6041('0x20')]=_0x3eb4fa;if(_0x599581[_0x6041('0x33')]['includeAll']){_0x1c9341[_0x6041('0x42')]=[{'all':!![]}];}return db[_0x6041('0x2e')]['findAll'](_0x1c9341);})[_0x6041('0x28')](function(_0x282cc6){_0x3d80c9[_0x6041('0x43')]=_0x282cc6;return _0x3d80c9;})[_0x6041('0x28')](respondWithFilteredResult(_0x3219b2,_0x1c9341))[_0x6041('0x44')](handleError(_0x3219b2,null));};exports[_0x6041('0x45')]=function(_0x5ae92f,_0x48c6fe){var _0x16c137={'raw':!![],'where':{'id':_0x5ae92f[_0x6041('0x46')]['id']}},_0x2a94d5={};_0x2a94d5[_0x6041('0x32')]=_[_0x6041('0x34')](db[_0x6041('0x2e')][_0x6041('0x2f')]);_0x2a94d5[_0x6041('0x33')]=_[_0x6041('0x34')](_0x5ae92f[_0x6041('0x33')]);_0x2a94d5['filters']=_['intersection'](_0x2a94d5[_0x6041('0x32')],_0x2a94d5['query']);_0x16c137[_0x6041('0x36')]=_[_0x6041('0x35')](_0x2a94d5['model'],qs['fields'](_0x5ae92f[_0x6041('0x33')][_0x6041('0x37')]));_0x16c137[_0x6041('0x36')]=_0x16c137[_0x6041('0x36')][_0x6041('0x38')]?_0x16c137['attributes']:_0x2a94d5[_0x6041('0x32')];if(_0x5ae92f[_0x6041('0x33')][_0x6041('0x47')]){_0x16c137['include']=[{'all':!![]}];}_0x16c137=_[_0x6041('0x3f')]({},_0x16c137,_0x5ae92f[_0x6041('0x41')]);return db[_0x6041('0x2e')][_0x6041('0x48')](_0x16c137)[_0x6041('0x28')](handleEntityNotFound(_0x48c6fe,null))[_0x6041('0x28')](respondWithResult(_0x48c6fe,null))[_0x6041('0x44')](handleError(_0x48c6fe,null));};exports['create']=function(_0x1b1a12,_0x1c34bd){return db[_0x6041('0x2e')][_0x6041('0x49')](_0x1b1a12[_0x6041('0x4a')],{})['then'](respondWithResult(_0x1c34bd,0xc9))['catch'](handleError(_0x1c34bd,null));};exports[_0x6041('0x26')]=function(_0x43101c,_0x546a22){if(_0x43101c[_0x6041('0x4a')]['id']){delete _0x43101c[_0x6041('0x4a')]['id'];}return db['MailServerOut'][_0x6041('0x48')]({'where':{'id':_0x43101c[_0x6041('0x46')]['id']}})[_0x6041('0x28')](handleEntityNotFound(_0x546a22,null))[_0x6041('0x28')](saveUpdates(_0x43101c['body'],null))[_0x6041('0x28')](respondWithResult(_0x546a22,null))[_0x6041('0x44')](handleError(_0x546a22,null));};exports[_0x6041('0x27')]=function(_0x2ee01a,_0x1b2282){return db['MailServerOut'][_0x6041('0x48')]({'where':{'id':_0x2ee01a[_0x6041('0x46')]['id']}})[_0x6041('0x28')](handleEntityNotFound(_0x1b2282,null))[_0x6041('0x28')](removeEntity(_0x1b2282,null))['catch'](handleError(_0x1b2282,null));}; \ No newline at end of file +var _0xba30=['send','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name'];(function(_0x81a26e,_0x4a6f01){var _0x343910=function(_0xb4c242){while(--_0xb4c242){_0x81a26e['push'](_0x81a26e['shift']());}};_0x343910(++_0x4a6f01);}(_0xba30,0x18c));var _0x0ba3=function(_0x4eb517,_0x385479){_0x4eb517=_0x4eb517-0x0;var _0x30e9ed=_0xba30[_0x4eb517];return _0x30e9ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ba3('0x0'));var zipdir=require(_0x0ba3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ba3('0x2'));var BPromise=require(_0x0ba3('0x3'));var Mustache=require(_0x0ba3('0x4'));var util=require('util');var path=require(_0x0ba3('0x5'));var sox=require(_0x0ba3('0x6'));var csv=require(_0x0ba3('0x7'));var ejs=require(_0x0ba3('0x8'));var fs=require('fs');var fs_extra=require(_0x0ba3('0x9'));var _=require(_0x0ba3('0xa'));var squel=require(_0x0ba3('0xb'));var crypto=require(_0x0ba3('0xc'));var jsforce=require(_0x0ba3('0xd'));var deskjs=require(_0x0ba3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ba3('0xf'));var Papa=require(_0x0ba3('0x10'));var Redis=require('ioredis');var authService=require(_0x0ba3('0x11'));var qs=require(_0x0ba3('0x12'));var as=require(_0x0ba3('0x13'));var hardwareService=require(_0x0ba3('0x14'));var logger=require(_0x0ba3('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0ba3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ba3('0x17'))['db'];function respondWithStatusCode(_0x3ba276,_0x136fe8){_0x136fe8=_0x136fe8||0xcc;return function(_0x3f3c10){if(_0x3f3c10){return _0x3ba276[_0x0ba3('0x18')](_0x136fe8);}return _0x3ba276[_0x0ba3('0x19')](_0x136fe8)[_0x0ba3('0x1a')]();};}function respondWithResult(_0x307ac4,_0x3dd16c){_0x3dd16c=_0x3dd16c||0xc8;return function(_0x5c6955){if(_0x5c6955){return _0x307ac4[_0x0ba3('0x19')](_0x3dd16c)['json'](_0x5c6955);}};}function respondWithFilteredResult(_0x3ed776,_0x36fe12){return function(_0x843b13){if(_0x843b13){var _0xeb148e=typeof _0x36fe12['offset']===_0x0ba3('0x1b')&&typeof _0x36fe12[_0x0ba3('0x1c')]==='undefined';var _0x4beb78=_0x843b13[_0x0ba3('0x1d')];var _0xc83ff5=_0xeb148e?0x0:_0x36fe12['offset'];var _0x4873f1=_0xeb148e?_0x843b13[_0x0ba3('0x1d')]:_0x36fe12[_0x0ba3('0x1e')]+_0x36fe12['limit'];var _0x4ee414;if(_0x4873f1>=_0x4beb78){_0x4873f1=_0x4beb78;_0x4ee414=0xc8;}else{_0x4ee414=0xce;}_0x3ed776[_0x0ba3('0x19')](_0x4ee414);return _0x3ed776[_0x0ba3('0x1f')](_0x0ba3('0x20'),_0xc83ff5+'-'+_0x4873f1+'/'+_0x4beb78)[_0x0ba3('0x21')](_0x843b13);}return null;};}function patchUpdates(_0xa38a34){return function(_0x5d7275){try{jsonpatch[_0x0ba3('0x22')](_0x5d7275,_0xa38a34,!![]);}catch(_0x254eed){return BPromise[_0x0ba3('0x23')](_0x254eed);}return _0x5d7275[_0x0ba3('0x24')]();};}function saveUpdates(_0x4a0f96,_0x4e8352){return function(_0x4d6e27){if(_0x4d6e27){return _0x4d6e27[_0x0ba3('0x25')](_0x4a0f96)[_0x0ba3('0x26')](function(_0x569e6d){return _0x569e6d;});}return null;};}function removeEntity(_0x386a91,_0x3364aa){return function(_0x435bef){if(_0x435bef){return _0x435bef[_0x0ba3('0x27')]()['then'](function(){_0x386a91[_0x0ba3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e091,_0x46b805){return function(_0x5bf831){if(!_0x5bf831){_0x24e091[_0x0ba3('0x18')](0x194);}return _0x5bf831;};}function handleError(_0x352a49,_0x2a3161){_0x2a3161=_0x2a3161||0x1f4;return function(_0xab6228){logger[_0x0ba3('0x28')](_0xab6228['stack']);if(_0xab6228[_0x0ba3('0x29')]){delete _0xab6228[_0x0ba3('0x29')];}_0x352a49[_0x0ba3('0x19')](_0x2a3161)[_0x0ba3('0x2a')](_0xab6228);};}exports['index']=function(_0x427a38,_0x46b468){var _0x3f9de3={},_0x33f642={},_0xa83894={'count':0x0,'rows':[]};var _0xfa190e=_[_0x0ba3('0x2b')](db[_0x0ba3('0x2c')][_0x0ba3('0x2d')],function(_0x4ec447){return{'name':_0x4ec447[_0x0ba3('0x2e')],'type':_0x4ec447[_0x0ba3('0x2f')][_0x0ba3('0x30')]};});_0x33f642[_0x0ba3('0x31')]=_[_0x0ba3('0x2b')](_0xfa190e,_0x0ba3('0x29'));_0x33f642[_0x0ba3('0x32')]=_[_0x0ba3('0x33')](_0x427a38[_0x0ba3('0x32')]);_0x33f642['filters']=_[_0x0ba3('0x34')](_0x33f642[_0x0ba3('0x31')],_0x33f642[_0x0ba3('0x32')]);_0x3f9de3['attributes']=_[_0x0ba3('0x34')](_0x33f642[_0x0ba3('0x31')],qs[_0x0ba3('0x35')](_0x427a38[_0x0ba3('0x32')][_0x0ba3('0x35')]));_0x3f9de3['attributes']=_0x3f9de3[_0x0ba3('0x36')][_0x0ba3('0x37')]?_0x3f9de3[_0x0ba3('0x36')]:_0x33f642[_0x0ba3('0x31')];if(!_0x427a38[_0x0ba3('0x32')][_0x0ba3('0x38')]('nolimit')){_0x3f9de3[_0x0ba3('0x1c')]=qs['limit'](_0x427a38[_0x0ba3('0x32')]['limit']);_0x3f9de3[_0x0ba3('0x1e')]=qs[_0x0ba3('0x1e')](_0x427a38[_0x0ba3('0x32')][_0x0ba3('0x1e')]);}_0x3f9de3[_0x0ba3('0x39')]=qs['sort'](_0x427a38['query']['sort']);_0x3f9de3[_0x0ba3('0x3a')]=qs['filters'](_['pick'](_0x427a38['query'],_0x33f642[_0x0ba3('0x3b')]),_0xfa190e);if(_0x427a38[_0x0ba3('0x32')][_0x0ba3('0x3c')]){_0x3f9de3[_0x0ba3('0x3a')]=_[_0x0ba3('0x3d')](_0x3f9de3[_0x0ba3('0x3a')],{'$or':_['map'](_0xfa190e,function(_0x2e7607){if(_0x2e7607[_0x0ba3('0x2f')]!==_0x0ba3('0x3e')){var _0x36b679={};_0x36b679[_0x2e7607[_0x0ba3('0x29')]]={'$like':'%'+_0x427a38[_0x0ba3('0x32')]['filter']+'%'};return _0x36b679;}})});}_0x3f9de3=_[_0x0ba3('0x3d')]({},_0x3f9de3,_0x427a38[_0x0ba3('0x3f')]);var _0x3c44b6={'where':_0x3f9de3[_0x0ba3('0x3a')]};return db[_0x0ba3('0x2c')][_0x0ba3('0x1d')](_0x3c44b6)[_0x0ba3('0x26')](function(_0x1d0534){_0xa83894['count']=_0x1d0534;if(_0x427a38[_0x0ba3('0x32')][_0x0ba3('0x40')]){_0x3f9de3[_0x0ba3('0x41')]=[{'all':!![]}];}return db[_0x0ba3('0x2c')][_0x0ba3('0x42')](_0x3f9de3);})['then'](function(_0x591f9a){_0xa83894['rows']=_0x591f9a;return _0xa83894;})[_0x0ba3('0x26')](respondWithFilteredResult(_0x46b468,_0x3f9de3))[_0x0ba3('0x43')](handleError(_0x46b468,null));};exports[_0x0ba3('0x44')]=function(_0x3959ed,_0x1c98be){var _0x17b33a={'raw':!![],'where':{'id':_0x3959ed['params']['id']}},_0x9e5268={};_0x9e5268['model']=_[_0x0ba3('0x33')](db[_0x0ba3('0x2c')][_0x0ba3('0x2d')]);_0x9e5268['query']=_[_0x0ba3('0x33')](_0x3959ed[_0x0ba3('0x32')]);_0x9e5268[_0x0ba3('0x3b')]=_['intersection'](_0x9e5268[_0x0ba3('0x31')],_0x9e5268['query']);_0x17b33a['attributes']=_['intersection'](_0x9e5268['model'],qs['fields'](_0x3959ed['query'][_0x0ba3('0x35')]));_0x17b33a[_0x0ba3('0x36')]=_0x17b33a[_0x0ba3('0x36')][_0x0ba3('0x37')]?_0x17b33a['attributes']:_0x9e5268['model'];if(_0x3959ed['query']['includeAll']){_0x17b33a[_0x0ba3('0x41')]=[{'all':!![]}];}_0x17b33a=_[_0x0ba3('0x3d')]({},_0x17b33a,_0x3959ed[_0x0ba3('0x3f')]);return db['MailServerOut'][_0x0ba3('0x45')](_0x17b33a)[_0x0ba3('0x26')](handleEntityNotFound(_0x1c98be,null))[_0x0ba3('0x26')](respondWithResult(_0x1c98be,null))[_0x0ba3('0x43')](handleError(_0x1c98be,null));};exports[_0x0ba3('0x46')]=function(_0x5d6eb9,_0x1a447f){return db[_0x0ba3('0x2c')][_0x0ba3('0x46')](_0x5d6eb9['body'],{})[_0x0ba3('0x26')](respondWithResult(_0x1a447f,0xc9))[_0x0ba3('0x43')](handleError(_0x1a447f,null));};exports[_0x0ba3('0x25')]=function(_0x306f28,_0x451ede){if(_0x306f28[_0x0ba3('0x47')]['id']){delete _0x306f28['body']['id'];}return db[_0x0ba3('0x2c')]['find']({'where':{'id':_0x306f28[_0x0ba3('0x48')]['id']}})[_0x0ba3('0x26')](handleEntityNotFound(_0x451ede,null))[_0x0ba3('0x26')](saveUpdates(_0x306f28[_0x0ba3('0x47')],null))[_0x0ba3('0x26')](respondWithResult(_0x451ede,null))[_0x0ba3('0x43')](handleError(_0x451ede,null));};exports[_0x0ba3('0x27')]=function(_0x44f49a,_0x53f01f){return db[_0x0ba3('0x2c')][_0x0ba3('0x45')]({'where':{'id':_0x44f49a[_0x0ba3('0x48')]['id']}})[_0x0ba3('0x26')](handleEntityNotFound(_0x53f01f,null))['then'](removeEntity(_0x53f01f,null))['catch'](handleError(_0x53f01f,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6990c34..63240c4 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 _0x8481=['path','rimraf','./mailServerOut.attributes','exports','MailServerOut','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x521f40,_0x424f32){var _0x14644d=function(_0x4dae4e){while(--_0x4dae4e){_0x521f40['push'](_0x521f40['shift']());}};_0x14644d(++_0x424f32);}(_0x8481,0x109));var _0x1848=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x8481[_0x56740a];return _0x257144;};'use strict';var _=require(_0x1848('0x0'));var util=require('util');var logger=require(_0x1848('0x1'))(_0x1848('0x2'));var moment=require('moment');var BPromise=require(_0x1848('0x3'));var rp=require(_0x1848('0x4'));var fs=require('fs');var path=require(_0x1848('0x5'));var rimraf=require(_0x1848('0x6'));var config=require('../../config/environment');var attributes=require(_0x1848('0x7'));module[_0x1848('0x8')]=function(_0x4e9e55,_0xca0251){return _0x4e9e55['define'](_0x1848('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x012d=['exports','define','MailServerOut','mail_servers_out','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x5e823e,_0x155485){var _0x2098f9=function(_0x11444f){while(--_0x11444f){_0x5e823e['push'](_0x5e823e['shift']());}};_0x2098f9(++_0x155485);}(_0x012d,0xe0));var _0xd012=function(_0x5a103e,_0x2f3d20){_0x5a103e=_0x5a103e-0x0;var _0x57700a=_0x012d[_0x5a103e];return _0x57700a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd012('0x0'));var BPromise=require(_0xd012('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd012('0x2'));var rimraf=require(_0xd012('0x3'));var config=require(_0xd012('0x4'));var attributes=require(_0xd012('0x5'));module[_0xd012('0x6')]=function(_0x5821f5,_0x4e70d6){return _0x5821f5[_0xd012('0x7')](_0xd012('0x8'),attributes,{'tableName':_0xd012('0x9'),'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 3340b66..6bc97b6 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x59b81e,_0xe32272){var _0x3278bc=function(_0x120052){while(--_0x120052){_0x59b81e['push'](_0x59b81e['shift']());}};_0x3278bc(++_0xe32272);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _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(_0x2b5f14,_0xc898e5){var _0xddc6dd=function(_0xf29576){while(--_0xf29576){_0x2b5f14['push'](_0x2b5f14['shift']());}};_0xddc6dd(++_0xc898e5);}(_0xdb28,0x106));var _0x8db2=function(_0x490c21,_0x67632c){_0x490c21=_0x490c21-0x0;var _0x30fedb=_0xdb28[_0x490c21];return _0x30fedb;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 4c16b2c..8d4a0ff 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 _0x4a14=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x4a14,0x1e8));var _0x44a1=function(_0x27040a,_0x3ef728){_0x27040a=_0x27040a-0x0;var _0x3d00d2=_0x4a14[_0x27040a];return _0x3d00d2;};'use strict';var multer=require(_0x44a1('0x0'));var util=require(_0x44a1('0x1'));var path=require(_0x44a1('0x2'));var timeout=require(_0x44a1('0x3'));var express=require(_0x44a1('0x4'));var router=express['Router']();var fs_extra=require(_0x44a1('0x5'));var auth=require(_0x44a1('0x6'));var interaction=require(_0x44a1('0x7'));var config=require(_0x44a1('0x8'));var controller=require(_0x44a1('0x9'));router[_0x44a1('0xa')]('/',auth[_0x44a1('0xb')](),controller[_0x44a1('0xc')]);router[_0x44a1('0xa')](_0x44a1('0xd'),auth[_0x44a1('0xb')](),controller[_0x44a1('0xe')]);router['get'](_0x44a1('0xf'),auth[_0x44a1('0xb')](),controller[_0x44a1('0x10')]);router[_0x44a1('0x11')]('/',auth[_0x44a1('0xb')](),controller[_0x44a1('0x12')]);router[_0x44a1('0x13')](_0x44a1('0xf'),auth[_0x44a1('0xb')](),controller['update']);router[_0x44a1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x44a1('0x15')]);module[_0x44a1('0x16')]=router; \ No newline at end of file +var _0x803d=['util','path','Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','exports','multer'];(function(_0x193381,_0x367201){var _0x3617eb=function(_0x3a913c){while(--_0x3a913c){_0x193381['push'](_0x193381['shift']());}};_0x3617eb(++_0x367201);}(_0x803d,0x1da));var _0xd803=function(_0x2579f8,_0xc7f1fb){_0x2579f8=_0x2579f8-0x0;var _0x1651e0=_0x803d[_0x2579f8];return _0x1651e0;};'use strict';var multer=require(_0xd803('0x0'));var util=require(_0xd803('0x1'));var path=require(_0xd803('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd803('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd803('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd803('0x5'));var controller=require(_0xd803('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd803('0x7')]);router[_0xd803('0x8')](_0xd803('0x9'),auth[_0xd803('0xa')](),controller[_0xd803('0xb')]);router[_0xd803('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd803('0xc')]('/',auth[_0xd803('0xa')](),controller[_0xd803('0xd')]);router[_0xd803('0xe')](_0xd803('0xf'),auth[_0xd803('0xa')](),controller[_0xd803('0x10')]);router[_0xd803('0x11')]('/:id',auth[_0xd803('0xa')](),controller['destroy']);module[_0xd803('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 2e0f093..5603880 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 _0xfcf0=['sequelize','exports','name','STRING'];(function(_0x430e5e,_0x3ea443){var _0x127a0c=function(_0x3dff06){while(--_0x3dff06){_0x430e5e['push'](_0x430e5e['shift']());}};_0x127a0c(++_0x3ea443);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0xfcf0[_0x4706a6];return _0x1bb705;};'use strict';var Sequelize=require(_0x0fcf('0x0'));module[_0x0fcf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0fcf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0fcf('0x3')]}}; \ No newline at end of file +var _0xda19=['STRING','exports'];(function(_0x3cd959,_0x55ccac){var _0x3b56aa=function(_0x11d9b5){while(--_0x11d9b5){_0x3cd959['push'](_0x3cd959['shift']());}};_0x3b56aa(++_0x55ccac);}(_0xda19,0xd5));var _0x9da1=function(_0x53ae30,_0x194de8){_0x53ae30=_0x53ae30-0x0;var _0x3de7cd=_0xda19[_0x53ae30];return _0x3de7cd;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9da1('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 98d6f90..fbfb910 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 _0xd34b=['Content-Range','apply','reject','destroy','sendStatus','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','merge','VIRTUAL','then','includeAll','include','findAll','catch','show','params','model','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set'];(function(_0x549842,_0x522d7a){var _0x24864c=function(_0x58c5b1){while(--_0x58c5b1){_0x549842['push'](_0x549842['shift']());}};_0x24864c(++_0x522d7a);}(_0xd34b,0x1dd));var _0xbd34=function(_0x14f49a,_0x1f8a11){_0x14f49a=_0x14f49a-0x0;var _0x37e5dd=_0xd34b[_0x14f49a];return _0x37e5dd;};'use strict';var emlformat=require(_0xbd34('0x0'));var rimraf=require(_0xbd34('0x1'));var zipdir=require(_0xbd34('0x2'));var jsonpatch=require(_0xbd34('0x3'));var rp=require(_0xbd34('0x4'));var moment=require(_0xbd34('0x5'));var BPromise=require(_0xbd34('0x6'));var Mustache=require(_0xbd34('0x7'));var util=require('util');var path=require(_0xbd34('0x8'));var sox=require(_0xbd34('0x9'));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(_0xbd34('0xa'));var crypto=require('crypto');var jsforce=require(_0xbd34('0xb'));var deskjs=require(_0xbd34('0xc'));var toCsv=require(_0xbd34('0xd'));var querystring=require(_0xbd34('0xe'));var Papa=require(_0xbd34('0xf'));var Redis=require(_0xbd34('0x10'));var authService=require(_0xbd34('0x11'));var qs=require(_0xbd34('0x12'));var as=require(_0xbd34('0x13'));var hardwareService=require(_0xbd34('0x14'));var logger=require('../../config/logger')(_0xbd34('0x15'));var utils=require(_0xbd34('0x16'));var config=require(_0xbd34('0x17'));var licenseUtil=require(_0xbd34('0x18'));var db=require(_0xbd34('0x19'))['db'];function respondWithStatusCode(_0x10b318,_0x2dbaa0){_0x2dbaa0=_0x2dbaa0||0xcc;return function(_0x233bbf){if(_0x233bbf){return _0x10b318['sendStatus'](_0x2dbaa0);}return _0x10b318[_0xbd34('0x1a')](_0x2dbaa0)[_0xbd34('0x1b')]();};}function respondWithResult(_0x408f90,_0x1222a7){_0x1222a7=_0x1222a7||0xc8;return function(_0x55ff83){if(_0x55ff83){return _0x408f90[_0xbd34('0x1a')](_0x1222a7)[_0xbd34('0x1c')](_0x55ff83);}};}function respondWithFilteredResult(_0x44cd15,_0x22a17c){return function(_0x22f820){if(_0x22f820){var _0x55e193=typeof _0x22a17c[_0xbd34('0x1d')]===_0xbd34('0x1e')&&typeof _0x22a17c['limit']===_0xbd34('0x1e');var _0x43d99b=_0x22f820[_0xbd34('0x1f')];var _0x25fc34=_0x55e193?0x0:_0x22a17c[_0xbd34('0x1d')];var _0x4e299e=_0x55e193?_0x22f820[_0xbd34('0x1f')]:_0x22a17c[_0xbd34('0x1d')]+_0x22a17c[_0xbd34('0x20')];var _0x2dc84e;if(_0x4e299e>=_0x43d99b){_0x4e299e=_0x43d99b;_0x2dc84e=0xc8;}else{_0x2dc84e=0xce;}_0x44cd15[_0xbd34('0x1a')](_0x2dc84e);return _0x44cd15[_0xbd34('0x21')](_0xbd34('0x22'),_0x25fc34+'-'+_0x4e299e+'/'+_0x43d99b)[_0xbd34('0x1c')](_0x22f820);}return null;};}function patchUpdates(_0x2f07e8){return function(_0x300ab5){try{jsonpatch[_0xbd34('0x23')](_0x300ab5,_0x2f07e8,!![]);}catch(_0x2354ec){return BPromise[_0xbd34('0x24')](_0x2354ec);}return _0x300ab5['save']();};}function saveUpdates(_0x17f33f,_0x1cc1ba){return function(_0x290a65){if(_0x290a65){return _0x290a65['update'](_0x17f33f)['then'](function(_0xa96e9f){return _0xa96e9f;});}return null;};}function removeEntity(_0x54cc87,_0x1df2e3){return function(_0x414347){if(_0x414347){return _0x414347[_0xbd34('0x25')]()['then'](function(){_0x54cc87[_0xbd34('0x1a')](0xcc)[_0xbd34('0x1b')]();});}};}function handleEntityNotFound(_0x35c1cc,_0xa9499){return function(_0x5b078b){if(!_0x5b078b){_0x35c1cc[_0xbd34('0x26')](0x194);}return _0x5b078b;};}function handleError(_0x524985,_0x54c055){_0x54c055=_0x54c055||0x1f4;return function(_0x36ee3b){logger['error'](_0x36ee3b[_0xbd34('0x27')]);if(_0x36ee3b[_0xbd34('0x28')]){delete _0x36ee3b[_0xbd34('0x28')];}_0x524985[_0xbd34('0x1a')](_0x54c055)[_0xbd34('0x29')](_0x36ee3b);};}exports[_0xbd34('0x2a')]=function(_0x267662,_0x11a042){var _0x5e449b={},_0xdd2539={},_0x370516={'count':0x0,'rows':[]};var _0x3d32f8=_[_0xbd34('0x2b')](db[_0xbd34('0x2c')][_0xbd34('0x2d')],function(_0x3403bc){return{'name':_0x3403bc[_0xbd34('0x2e')],'type':_0x3403bc[_0xbd34('0x2f')]['key']};});_0xdd2539['model']=_[_0xbd34('0x2b')](_0x3d32f8,_0xbd34('0x28'));_0xdd2539[_0xbd34('0x30')]=_[_0xbd34('0x31')](_0x267662[_0xbd34('0x30')]);_0xdd2539[_0xbd34('0x32')]=_[_0xbd34('0x33')](_0xdd2539['model'],_0xdd2539[_0xbd34('0x30')]);_0x5e449b['attributes']=_[_0xbd34('0x33')](_0xdd2539['model'],qs['fields'](_0x267662[_0xbd34('0x30')][_0xbd34('0x34')]));_0x5e449b[_0xbd34('0x35')]=_0x5e449b[_0xbd34('0x35')][_0xbd34('0x36')]?_0x5e449b[_0xbd34('0x35')]:_0xdd2539['model'];if(!_0x267662[_0xbd34('0x30')]['hasOwnProperty']('nolimit')){_0x5e449b[_0xbd34('0x20')]=qs[_0xbd34('0x20')](_0x267662['query'][_0xbd34('0x20')]);_0x5e449b[_0xbd34('0x1d')]=qs['offset'](_0x267662[_0xbd34('0x30')][_0xbd34('0x1d')]);}_0x5e449b['order']=qs[_0xbd34('0x37')](_0x267662[_0xbd34('0x30')][_0xbd34('0x37')]);_0x5e449b[_0xbd34('0x38')]=qs['filters'](_[_0xbd34('0x39')](_0x267662['query'],_0xdd2539[_0xbd34('0x32')]),_0x3d32f8);if(_0x267662[_0xbd34('0x30')]['filter']){_0x5e449b['where']=_[_0xbd34('0x3a')](_0x5e449b['where'],{'$or':_[_0xbd34('0x2b')](_0x3d32f8,function(_0x3c608c){if(_0x3c608c['type']!==_0xbd34('0x3b')){var _0x386300={};_0x386300[_0x3c608c[_0xbd34('0x28')]]={'$like':'%'+_0x267662[_0xbd34('0x30')]['filter']+'%'};return _0x386300;}})});}_0x5e449b=_[_0xbd34('0x3a')]({},_0x5e449b,_0x267662['options']);var _0x18e826={'where':_0x5e449b[_0xbd34('0x38')]};return db[_0xbd34('0x2c')][_0xbd34('0x1f')](_0x18e826)[_0xbd34('0x3c')](function(_0x2c995a){_0x370516[_0xbd34('0x1f')]=_0x2c995a;if(_0x267662[_0xbd34('0x30')][_0xbd34('0x3d')]){_0x5e449b[_0xbd34('0x3e')]=[{'all':!![]}];}return db[_0xbd34('0x2c')][_0xbd34('0x3f')](_0x5e449b);})[_0xbd34('0x3c')](function(_0x2a7439){_0x370516['rows']=_0x2a7439;return _0x370516;})[_0xbd34('0x3c')](respondWithFilteredResult(_0x11a042,_0x5e449b))[_0xbd34('0x40')](handleError(_0x11a042,null));};exports[_0xbd34('0x41')]=function(_0x39a1a4,_0x36c00f){var _0x42a46c={'raw':!![],'where':{'id':_0x39a1a4[_0xbd34('0x42')]['id']}},_0x5a89a5={};_0x5a89a5[_0xbd34('0x43')]=_[_0xbd34('0x31')](db['MailSubstatus']['rawAttributes']);_0x5a89a5[_0xbd34('0x30')]=_[_0xbd34('0x31')](_0x39a1a4['query']);_0x5a89a5['filters']=_[_0xbd34('0x33')](_0x5a89a5[_0xbd34('0x43')],_0x5a89a5[_0xbd34('0x30')]);_0x42a46c[_0xbd34('0x35')]=_[_0xbd34('0x33')](_0x5a89a5[_0xbd34('0x43')],qs['fields'](_0x39a1a4['query'][_0xbd34('0x34')]));_0x42a46c[_0xbd34('0x35')]=_0x42a46c['attributes']['length']?_0x42a46c[_0xbd34('0x35')]:_0x5a89a5[_0xbd34('0x43')];if(_0x39a1a4['query'][_0xbd34('0x3d')]){_0x42a46c[_0xbd34('0x3e')]=[{'all':!![]}];}_0x42a46c=_[_0xbd34('0x3a')]({},_0x42a46c,_0x39a1a4['options']);return db[_0xbd34('0x2c')]['find'](_0x42a46c)['then'](handleEntityNotFound(_0x36c00f,null))[_0xbd34('0x3c')](respondWithResult(_0x36c00f,null))['catch'](handleError(_0x36c00f,null));};exports[_0xbd34('0x44')]=function(_0x3c72e5,_0x37b453){return db['MailSubstatus']['create'](_0x3c72e5[_0xbd34('0x45')],{})['then'](respondWithResult(_0x37b453,0xc9))[_0xbd34('0x40')](handleError(_0x37b453,null));};exports[_0xbd34('0x46')]=function(_0x37cdf9,_0x5abc6f){if(_0x37cdf9[_0xbd34('0x45')]['id']){delete _0x37cdf9[_0xbd34('0x45')]['id'];}return db[_0xbd34('0x2c')][_0xbd34('0x47')]({'where':{'id':_0x37cdf9[_0xbd34('0x42')]['id']}})['then'](handleEntityNotFound(_0x5abc6f,null))['then'](saveUpdates(_0x37cdf9[_0xbd34('0x45')],null))[_0xbd34('0x3c')](respondWithResult(_0x5abc6f,null))['catch'](handleError(_0x5abc6f,null));};exports['destroy']=function(_0x5abfca,_0x4d2cc4){return db[_0xbd34('0x2c')]['find']({'where':{'id':_0x5abfca[_0xbd34('0x42')]['id']}})[_0xbd34('0x3c')](handleEntityNotFound(_0x4d2cc4,null))['then'](removeEntity(_0x4d2cc4,null))[_0xbd34('0x40')](handleError(_0x4d2cc4,null));};exports[_0xbd34('0x48')]=function(_0x23bc4d,_0x4cfa31){return db[_0xbd34('0x2c')][_0xbd34('0x48')]()[_0xbd34('0x3c')](respondWithResult(_0x4cfa31,null))[_0xbd34('0x40')](handleError(_0x4cfa31,null));}; \ No newline at end of file +var _0xf9b5=['show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','name','send','index','map','MailSubstatus','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','includeAll','include','rows','catch'];(function(_0x39a0d2,_0xdeceba){var _0x14fc84=function(_0x4d9a94){while(--_0x4d9a94){_0x39a0d2['push'](_0x39a0d2['shift']());}};_0x14fc84(++_0xdeceba);}(_0xf9b5,0x10f));var _0x5f9b=function(_0x32be7d,_0x1e1fd6){_0x32be7d=_0x32be7d-0x0;var _0x3ddf=_0xf9b5[_0x32be7d];return _0x3ddf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f9b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f9b('0x2'));var Mustache=require(_0x5f9b('0x3'));var util=require(_0x5f9b('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x5f9b('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f9b('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f9b('0x7'));var jsforce=require(_0x5f9b('0x8'));var deskjs=require(_0x5f9b('0x9'));var toCsv=require('to-csv');var querystring=require(_0x5f9b('0xa'));var Papa=require(_0x5f9b('0xb'));var Redis=require(_0x5f9b('0xc'));var authService=require(_0x5f9b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f9b('0xe'))(_0x5f9b('0xf'));var utils=require(_0x5f9b('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5f9b('0x11'))['db'];function respondWithStatusCode(_0x2a8d97,_0x322015){_0x322015=_0x322015||0xcc;return function(_0x560d34){if(_0x560d34){return _0x2a8d97[_0x5f9b('0x12')](_0x322015);}return _0x2a8d97[_0x5f9b('0x13')](_0x322015)['end']();};}function respondWithResult(_0x25d662,_0x47bbea){_0x47bbea=_0x47bbea||0xc8;return function(_0x19af81){if(_0x19af81){return _0x25d662[_0x5f9b('0x13')](_0x47bbea)[_0x5f9b('0x14')](_0x19af81);}};}function respondWithFilteredResult(_0x3899f8,_0x364a4c){return function(_0x33e50a){if(_0x33e50a){var _0x31e61f=typeof _0x364a4c[_0x5f9b('0x15')]==='undefined'&&typeof _0x364a4c[_0x5f9b('0x16')]==='undefined';var _0x106aa2=_0x33e50a['count'];var _0xa88875=_0x31e61f?0x0:_0x364a4c[_0x5f9b('0x15')];var _0x1ec898=_0x31e61f?_0x33e50a[_0x5f9b('0x17')]:_0x364a4c[_0x5f9b('0x15')]+_0x364a4c[_0x5f9b('0x16')];var _0x3b6b76;if(_0x1ec898>=_0x106aa2){_0x1ec898=_0x106aa2;_0x3b6b76=0xc8;}else{_0x3b6b76=0xce;}_0x3899f8[_0x5f9b('0x13')](_0x3b6b76);return _0x3899f8[_0x5f9b('0x18')]('Content-Range',_0xa88875+'-'+_0x1ec898+'/'+_0x106aa2)['json'](_0x33e50a);}return null;};}function patchUpdates(_0x3509cf){return function(_0x34870e){try{jsonpatch[_0x5f9b('0x19')](_0x34870e,_0x3509cf,!![]);}catch(_0x3cf5ee){return BPromise[_0x5f9b('0x1a')](_0x3cf5ee);}return _0x34870e[_0x5f9b('0x1b')]();};}function saveUpdates(_0xc7d859,_0x148f30){return function(_0x5d8808){if(_0x5d8808){return _0x5d8808[_0x5f9b('0x1c')](_0xc7d859)['then'](function(_0x2217d7){return _0x2217d7;});}return null;};}function removeEntity(_0x46b196,_0x4316dd){return function(_0x3ffabb){if(_0x3ffabb){return _0x3ffabb[_0x5f9b('0x1d')]()[_0x5f9b('0x1e')](function(){_0x46b196['status'](0xcc)[_0x5f9b('0x1f')]();});}};}function handleEntityNotFound(_0x3b3ea5,_0x3ae89c){return function(_0x807094){if(!_0x807094){_0x3b3ea5['sendStatus'](0x194);}return _0x807094;};}function handleError(_0x1a251f,_0x4f9b54){_0x4f9b54=_0x4f9b54||0x1f4;return function(_0x5a50ab){logger['error'](_0x5a50ab['stack']);if(_0x5a50ab[_0x5f9b('0x20')]){delete _0x5a50ab[_0x5f9b('0x20')];}_0x1a251f[_0x5f9b('0x13')](_0x4f9b54)[_0x5f9b('0x21')](_0x5a50ab);};}exports[_0x5f9b('0x22')]=function(_0x2ffd80,_0x1e6142){var _0x4e691f={},_0x5c23d1={},_0x4113b8={'count':0x0,'rows':[]};var _0x51825b=_[_0x5f9b('0x23')](db[_0x5f9b('0x24')]['rawAttributes'],function(_0x53d928){return{'name':_0x53d928[_0x5f9b('0x25')],'type':_0x53d928['type'][_0x5f9b('0x26')]};});_0x5c23d1[_0x5f9b('0x27')]=_[_0x5f9b('0x23')](_0x51825b,_0x5f9b('0x20'));_0x5c23d1['query']=_['keys'](_0x2ffd80[_0x5f9b('0x28')]);_0x5c23d1[_0x5f9b('0x29')]=_[_0x5f9b('0x2a')](_0x5c23d1[_0x5f9b('0x27')],_0x5c23d1[_0x5f9b('0x28')]);_0x4e691f['attributes']=_[_0x5f9b('0x2a')](_0x5c23d1['model'],qs[_0x5f9b('0x2b')](_0x2ffd80['query'][_0x5f9b('0x2b')]));_0x4e691f[_0x5f9b('0x2c')]=_0x4e691f['attributes'][_0x5f9b('0x2d')]?_0x4e691f[_0x5f9b('0x2c')]:_0x5c23d1[_0x5f9b('0x27')];if(!_0x2ffd80[_0x5f9b('0x28')][_0x5f9b('0x2e')](_0x5f9b('0x2f'))){_0x4e691f[_0x5f9b('0x16')]=qs[_0x5f9b('0x16')](_0x2ffd80[_0x5f9b('0x28')][_0x5f9b('0x16')]);_0x4e691f[_0x5f9b('0x15')]=qs[_0x5f9b('0x15')](_0x2ffd80[_0x5f9b('0x28')][_0x5f9b('0x15')]);}_0x4e691f[_0x5f9b('0x30')]=qs['sort'](_0x2ffd80[_0x5f9b('0x28')][_0x5f9b('0x31')]);_0x4e691f[_0x5f9b('0x32')]=qs[_0x5f9b('0x29')](_[_0x5f9b('0x33')](_0x2ffd80[_0x5f9b('0x28')],_0x5c23d1[_0x5f9b('0x29')]),_0x51825b);if(_0x2ffd80[_0x5f9b('0x28')]['filter']){_0x4e691f[_0x5f9b('0x32')]=_['merge'](_0x4e691f[_0x5f9b('0x32')],{'$or':_[_0x5f9b('0x23')](_0x51825b,function(_0x1b8444){if(_0x1b8444[_0x5f9b('0x34')]!=='VIRTUAL'){var _0x5893a4={};_0x5893a4[_0x1b8444['name']]={'$like':'%'+_0x2ffd80[_0x5f9b('0x28')][_0x5f9b('0x35')]+'%'};return _0x5893a4;}})});}_0x4e691f=_['merge']({},_0x4e691f,_0x2ffd80[_0x5f9b('0x36')]);var _0xcb4626={'where':_0x4e691f[_0x5f9b('0x32')]};return db[_0x5f9b('0x24')][_0x5f9b('0x17')](_0xcb4626)[_0x5f9b('0x1e')](function(_0x21486b){_0x4113b8[_0x5f9b('0x17')]=_0x21486b;if(_0x2ffd80['query'][_0x5f9b('0x37')]){_0x4e691f[_0x5f9b('0x38')]=[{'all':!![]}];}return db[_0x5f9b('0x24')]['findAll'](_0x4e691f);})[_0x5f9b('0x1e')](function(_0x155a2a){_0x4113b8[_0x5f9b('0x39')]=_0x155a2a;return _0x4113b8;})[_0x5f9b('0x1e')](respondWithFilteredResult(_0x1e6142,_0x4e691f))[_0x5f9b('0x3a')](handleError(_0x1e6142,null));};exports[_0x5f9b('0x3b')]=function(_0x446716,_0x249bfa){var _0x23c049={'raw':!![],'where':{'id':_0x446716[_0x5f9b('0x3c')]['id']}},_0x1e0a85={};_0x1e0a85[_0x5f9b('0x27')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0x1e0a85[_0x5f9b('0x28')]=_[_0x5f9b('0x3d')](_0x446716[_0x5f9b('0x28')]);_0x1e0a85[_0x5f9b('0x29')]=_[_0x5f9b('0x2a')](_0x1e0a85[_0x5f9b('0x27')],_0x1e0a85[_0x5f9b('0x28')]);_0x23c049['attributes']=_[_0x5f9b('0x2a')](_0x1e0a85[_0x5f9b('0x27')],qs[_0x5f9b('0x2b')](_0x446716[_0x5f9b('0x28')]['fields']));_0x23c049[_0x5f9b('0x2c')]=_0x23c049[_0x5f9b('0x2c')][_0x5f9b('0x2d')]?_0x23c049[_0x5f9b('0x2c')]:_0x1e0a85[_0x5f9b('0x27')];if(_0x446716[_0x5f9b('0x28')][_0x5f9b('0x37')]){_0x23c049[_0x5f9b('0x38')]=[{'all':!![]}];}_0x23c049=_['merge']({},_0x23c049,_0x446716[_0x5f9b('0x36')]);return db[_0x5f9b('0x24')][_0x5f9b('0x3e')](_0x23c049)[_0x5f9b('0x1e')](handleEntityNotFound(_0x249bfa,null))[_0x5f9b('0x1e')](respondWithResult(_0x249bfa,null))[_0x5f9b('0x3a')](handleError(_0x249bfa,null));};exports['create']=function(_0x3f81f7,_0x25e5ab){return db[_0x5f9b('0x24')][_0x5f9b('0x3f')](_0x3f81f7[_0x5f9b('0x40')],{})[_0x5f9b('0x1e')](respondWithResult(_0x25e5ab,0xc9))[_0x5f9b('0x3a')](handleError(_0x25e5ab,null));};exports['update']=function(_0x3d4873,_0x2ac9ad){if(_0x3d4873[_0x5f9b('0x40')]['id']){delete _0x3d4873[_0x5f9b('0x40')]['id'];}return db[_0x5f9b('0x24')][_0x5f9b('0x3e')]({'where':{'id':_0x3d4873[_0x5f9b('0x3c')]['id']}})[_0x5f9b('0x1e')](handleEntityNotFound(_0x2ac9ad,null))[_0x5f9b('0x1e')](saveUpdates(_0x3d4873['body'],null))['then'](respondWithResult(_0x2ac9ad,null))['catch'](handleError(_0x2ac9ad,null));};exports[_0x5f9b('0x1d')]=function(_0x3b061e,_0x1ad3ff){return db['MailSubstatus'][_0x5f9b('0x3e')]({'where':{'id':_0x3b061e['params']['id']}})[_0x5f9b('0x1e')](handleEntityNotFound(_0x1ad3ff,null))[_0x5f9b('0x1e')](removeEntity(_0x1ad3ff,null))[_0x5f9b('0x3a')](handleError(_0x1ad3ff,null));};exports[_0x5f9b('0x41')]=function(_0x1de8d4,_0x3b30e3){return db[_0x5f9b('0x24')][_0x5f9b('0x41')]()[_0x5f9b('0x1e')](respondWithResult(_0x3b30e3,null))[_0x5f9b('0x3a')](handleError(_0x3b30e3,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index e8bcec8..c1d3855 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf61=['setMaxListeners','update','emit','hasOwnProperty','events'];(function(_0x25487d,_0x2235a4){var _0x581ee4=function(_0x7025c1){while(--_0x7025c1){_0x25487d['push'](_0x25487d['shift']());}};_0x581ee4(++_0x2235a4);}(_0xcf61,0x86));var _0x1cf6=function(_0x8b98a6,_0x4082c5){_0x8b98a6=_0x8b98a6-0x0;var _0x38c37a=_0xcf61[_0x8b98a6];return _0x38c37a;};'use strict';var EventEmitter=require(_0x1cf6('0x0'));var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x1cf6('0x1')](0x0);var events={'afterUpdate':_0x1cf6('0x2')};function emitEvent(_0x3d9b32){return function(_0x4546e8,_0x23c880,_0x340b8b){MailSubstatusEvents[_0x1cf6('0x3')](_0x3d9b32+':'+_0x4546e8['id'],_0x4546e8);MailSubstatusEvents[_0x1cf6('0x3')](_0x3d9b32,_0x4546e8);_0x340b8b(null);};}for(var e in events){if(events[_0x1cf6('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x1dbe=['hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1dbe,0xfe));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe1db('0x0'));var MailSubstatus=require(_0xe1db('0x1'))['db'][_0xe1db('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe1db('0x3')](0x0);var events={'afterUpdate':_0xe1db('0x4')};function emitEvent(_0x308e7d){return function(_0x593ed7,_0xb993fc,_0x38ddad){MailSubstatusEvents['emit'](_0x308e7d+':'+_0x593ed7['id'],_0x593ed7);MailSubstatusEvents[_0xe1db('0x5')](_0x308e7d,_0x593ed7);_0x38ddad(null);};}for(var e in events){if(events[_0xe1db('0x6')](e)){var event=events[e];MailSubstatus[_0xe1db('0x7')](e,emitEvent(event));}}module[_0xe1db('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 2660ff8..28a9033 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 _0x4f2f=['MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','define'];(function(_0x19b462,_0x349d98){var _0x5b3fb5=function(_0x4c5d0e){while(--_0x4c5d0e){_0x19b462['push'](_0x19b462['shift']());}};_0x5b3fb5(++_0x349d98);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x4f2f[_0x42f009];return _0x22a1e0;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x21c4bf){var _0x143b21=_0x21c4bf['models'];return _0x21c4bf[_0xf4f2('0x0')](_0xf4f2('0x1'),attributes,{'tableName':_0xf4f2('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x8d1bfd,_0x1fcbd0,_0x39b3d6){return _0x143b21[_0xf4f2('0x3')][_0xf4f2('0x4')]({'value':_0x8d1bfd[_0xf4f2('0x5')]},{'where':{'field':_0xf4f2('0x6'),'value':_0x8d1bfd[_0xf4f2('0x7')]['name']}})[_0xf4f2('0x8')](function(){_0x39b3d6();})[_0xf4f2('0x9')](function(_0x5922d4){_0x39b3d6(_0x5922d4);});}}});}; \ No newline at end of file +var _0xede6=['then','catch','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name'];(function(_0x331bae,_0xcbbf1b){var _0x344339=function(_0x3aa78a){while(--_0x3aa78a){_0x331bae['push'](_0x331bae['shift']());}};_0x344339(++_0xcbbf1b);}(_0xede6,0x10a));var _0x6ede=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xede6[_0x1b5aea];return _0x15cfc6;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x6ede('0x0')]=function(_0x1054af){var _0xe76307=_0x1054af[_0x6ede('0x1')];return _0x1054af[_0x6ede('0x2')](_0x6ede('0x3'),attributes,{'tableName':_0x6ede('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x226cef,_0x306b56,_0x22c6cd){return _0xe76307[_0x6ede('0x5')][_0x6ede('0x6')]({'value':_0x226cef['name']},{'where':{'field':_0x6ede('0x7'),'value':_0x226cef[_0x6ede('0x8')][_0x6ede('0x9')]}})[_0x6ede('0xa')](function(){_0x22c6cd();})[_0x6ede('0xb')](function(_0x27bb82){_0x22c6cd(_0x27bb82);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1045114..d9f2ec5 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 _0xca9e=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x43d31b,_0x670376){var _0x5541c8=function(_0x1bca5d){while(--_0x1bca5d){_0x43d31b['push'](_0x43d31b['shift']());}};_0x5541c8(++_0x670376);}(_0xca9e,0x127));var _0xeca9=function(_0x58dd9f,_0x502122){_0x58dd9f=_0x58dd9f-0x0;var _0x53f6e6=_0xca9e[_0x58dd9f];return _0x53f6e6;};'use strict';var _=require(_0xeca9('0x0'));var util=require('util');var moment=require(_0xeca9('0x1'));var BPromise=require(_0xeca9('0x2'));var rs=require(_0xeca9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeca9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeca9('0x5'))('rpc');var config=require(_0xeca9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeca9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcc0317,_0x2bcf5b,_0x1238e4){return new BPromise(function(_0x4c2f03,_0x4850f6){return client[_0xeca9('0x8')](_0xcc0317,_0x1238e4)[_0xeca9('0x9')](function(_0xc337ca){logger[_0xeca9('0xa')](_0xeca9('0xb'),_0x2bcf5b,_0xeca9('0xc'));logger[_0xeca9('0xd')](_0xeca9('0xe'),_0x2bcf5b,'request\x20sent',JSON[_0xeca9('0xf')](_0xc337ca));if(_0xc337ca[_0xeca9('0x10')]){if(_0xc337ca['error'][_0xeca9('0x11')]===0x1f4){logger[_0xeca9('0x10')](_0xeca9('0xb'),_0x2bcf5b,_0xc337ca[_0xeca9('0x10')][_0xeca9('0x12')]);return _0x4850f6(_0xc337ca[_0xeca9('0x10')][_0xeca9('0x12')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2bcf5b,_0xc337ca[_0xeca9('0x10')]['message']);return _0x4c2f03(_0xc337ca[_0xeca9('0x10')][_0xeca9('0x12')]);}else{logger['info'](_0xeca9('0xb'),_0x2bcf5b,_0xeca9('0xc'));_0x4c2f03(_0xc337ca[_0xeca9('0x13')]['message']);}})[_0xeca9('0x14')](function(_0x302d18){logger['error'](_0xeca9('0xb'),_0x2bcf5b,_0x302d18);_0x4850f6(_0x302d18);});});} \ No newline at end of file +var _0x5ed3=['error','MailSubstatus,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','stringify'];(function(_0x2fb209,_0x22f77d){var _0x4489da=function(_0x28c695){while(--_0x28c695){_0x2fb209['push'](_0x2fb209['shift']());}};_0x4489da(++_0x22f77d);}(_0x5ed3,0x1f3));var _0x35ed=function(_0x2ef587,_0x26d8ff){_0x2ef587=_0x2ef587-0x0;var _0x433a47=_0x5ed3[_0x2ef587];return _0x433a47;};'use strict';var _=require(_0x35ed('0x0'));var util=require('util');var moment=require(_0x35ed('0x1'));var BPromise=require(_0x35ed('0x2'));var rs=require(_0x35ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x35ed('0x4'));var logger=require(_0x35ed('0x5'))(_0x35ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x35ed('0x7'));var client=jayson[_0x35ed('0x8')][_0x35ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ec85e,_0x54cd5e,_0x1d0924){return new BPromise(function(_0x401858,_0x274ce2){return client[_0x35ed('0xa')](_0x3ec85e,_0x1d0924)[_0x35ed('0xb')](function(_0x226097){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x54cd5e,_0x35ed('0xc'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x54cd5e,_0x35ed('0xc'),JSON[_0x35ed('0xd')](_0x226097));if(_0x226097[_0x35ed('0xe')]){if(_0x226097[_0x35ed('0xe')]['code']===0x1f4){logger[_0x35ed('0xe')](_0x35ed('0xf'),_0x54cd5e,_0x226097[_0x35ed('0xe')][_0x35ed('0x10')]);return _0x274ce2(_0x226097[_0x35ed('0xe')][_0x35ed('0x10')]);}logger[_0x35ed('0xe')](_0x35ed('0xf'),_0x54cd5e,_0x226097[_0x35ed('0xe')][_0x35ed('0x10')]);return _0x401858(_0x226097[_0x35ed('0xe')][_0x35ed('0x10')]);}else{logger[_0x35ed('0x11')](_0x35ed('0xf'),_0x54cd5e,'request\x20sent');_0x401858(_0x226097['result'][_0x35ed('0x10')]);}})[_0x35ed('0x12')](function(_0x539cfc){logger[_0x35ed('0xe')](_0x35ed('0xf'),_0x54cd5e,_0x539cfc);_0x274ce2(_0x539cfc);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d90f788..d2e153b 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 _0xfdc2=['get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xfdc2,0x6f));var _0x2fdc=function(_0x574430,_0x4fbfd1){_0x574430=_0x574430-0x0;var _0x41862c=_0xfdc2[_0x574430];return _0x41862c;};'use strict';var multer=require('multer');var util=require(_0x2fdc('0x0'));var path=require(_0x2fdc('0x1'));var timeout=require(_0x2fdc('0x2'));var express=require(_0x2fdc('0x3'));var router=express[_0x2fdc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fdc('0x5'));var interaction=require(_0x2fdc('0x6'));var config=require(_0x2fdc('0x7'));var controller=require(_0x2fdc('0x8'));router[_0x2fdc('0x9')]('/',auth[_0x2fdc('0xa')](),controller[_0x2fdc('0xb')]);router[_0x2fdc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2fdc('0xc')]);router[_0x2fdc('0x9')](_0x2fdc('0xd'),auth['isAuthenticated'](),controller[_0x2fdc('0xe')]);router[_0x2fdc('0xf')]('/',auth[_0x2fdc('0xa')](),controller['create']);router[_0x2fdc('0x10')](_0x2fdc('0xd'),auth[_0x2fdc('0xa')](),controller[_0x2fdc('0x11')]);router[_0x2fdc('0x12')](_0x2fdc('0xd'),auth[_0x2fdc('0xa')](),controller[_0x2fdc('0x13')]);module['exports']=router; \ No newline at end of file +var _0x18de=['isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','describe','/:id'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x18de,0x12d));var _0xe18d=function(_0x2ba0aa,_0x1c345f){_0x2ba0aa=_0x2ba0aa-0x0;var _0xc17721=_0x18de[_0x2ba0aa];return _0xc17721;};'use strict';var multer=require(_0xe18d('0x0'));var util=require(_0xe18d('0x1'));var path=require(_0xe18d('0x2'));var timeout=require(_0xe18d('0x3'));var express=require(_0xe18d('0x4'));var router=express['Router']();var fs_extra=require(_0xe18d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe18d('0x6'));var config=require(_0xe18d('0x7'));var controller=require(_0xe18d('0x8'));router[_0xe18d('0x9')]('/',auth['isAuthenticated'](),controller[_0xe18d('0xa')]);router[_0xe18d('0x9')](_0xe18d('0xb'),auth['isAuthenticated'](),controller[_0xe18d('0xc')]);router[_0xe18d('0x9')](_0xe18d('0xd'),auth[_0xe18d('0xe')](),controller[_0xe18d('0xf')]);router[_0xe18d('0x10')]('/',auth[_0xe18d('0xe')](),controller[_0xe18d('0x11')]);router['put'](_0xe18d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe18d('0x12')](_0xe18d('0xd'),auth[_0xe18d('0xe')](),controller[_0xe18d('0x13')]);module[_0xe18d('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index c198458..fe689c7 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x39f02e,_0x1aea7d){_0x39f02e=_0x39f02e-0x0;var _0x41f22f=_0xb43b[_0x39f02e];return _0x41f22f;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x31ed12,_0x2a38f9){var _0x1afd40=function(_0x23a8ca){while(--_0x23a8ca){_0x31ed12['push'](_0x31ed12['shift']());}};_0x1afd40(++_0x2a38f9);}(_0x34e8,0x12c));var _0x834e=function(_0x576c91,_0x3bef97){_0x576c91=_0x576c91-0x0;var _0x31e9b1=_0x34e8[_0x576c91];return _0x31e9b1;};'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 f87742f..2e4dc1c 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 _0xb97a=['includeAll','include','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','MailTransferReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','merge','options'];(function(_0x37f602,_0x53a79d){var _0x12bddb=function(_0x88042){while(--_0x88042){_0x37f602['push'](_0x37f602['shift']());}};_0x12bddb(++_0x53a79d);}(_0xb97a,0xe0));var _0xab97=function(_0x284b6f,_0x59a5cd){_0x284b6f=_0x284b6f-0x0;var _0x497eb1=_0xb97a[_0x284b6f];return _0x497eb1;};'use strict';var emlformat=require(_0xab97('0x0'));var rimraf=require(_0xab97('0x1'));var zipdir=require(_0xab97('0x2'));var jsonpatch=require(_0xab97('0x3'));var rp=require(_0xab97('0x4'));var moment=require(_0xab97('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab97('0x6'));var path=require(_0xab97('0x7'));var sox=require(_0xab97('0x8'));var csv=require('to-csv');var ejs=require(_0xab97('0x9'));var fs=require('fs');var fs_extra=require(_0xab97('0xa'));var _=require(_0xab97('0xb'));var squel=require(_0xab97('0xc'));var crypto=require(_0xab97('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab97('0xe'));var toCsv=require(_0xab97('0xf'));var querystring=require(_0xab97('0x10'));var Papa=require(_0xab97('0x11'));var Redis=require(_0xab97('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xab97('0x13'));var hardwareService=require(_0xab97('0x14'));var logger=require('../../config/logger')(_0xab97('0x15'));var utils=require(_0xab97('0x16'));var config=require(_0xab97('0x17'));var licenseUtil=require(_0xab97('0x18'));var db=require(_0xab97('0x19'))['db'];function respondWithStatusCode(_0x2157f5,_0x559986){_0x559986=_0x559986||0xcc;return function(_0x3ad06c){if(_0x3ad06c){return _0x2157f5['sendStatus'](_0x559986);}return _0x2157f5[_0xab97('0x1a')](_0x559986)[_0xab97('0x1b')]();};}function respondWithResult(_0x5e60f4,_0x25fb1f){_0x25fb1f=_0x25fb1f||0xc8;return function(_0x2456bb){if(_0x2456bb){return _0x5e60f4['status'](_0x25fb1f)[_0xab97('0x1c')](_0x2456bb);}};}function respondWithFilteredResult(_0x44274e,_0x180984){return function(_0x297426){if(_0x297426){var _0x1268e9=typeof _0x180984[_0xab97('0x1d')]===_0xab97('0x1e')&&typeof _0x180984[_0xab97('0x1f')]===_0xab97('0x1e');var _0xd1ea44=_0x297426[_0xab97('0x20')];var _0x3a443e=_0x1268e9?0x0:_0x180984[_0xab97('0x1d')];var _0x40cd40=_0x1268e9?_0x297426[_0xab97('0x20')]:_0x180984[_0xab97('0x1d')]+_0x180984['limit'];var _0xbcd9fe;if(_0x40cd40>=_0xd1ea44){_0x40cd40=_0xd1ea44;_0xbcd9fe=0xc8;}else{_0xbcd9fe=0xce;}_0x44274e[_0xab97('0x1a')](_0xbcd9fe);return _0x44274e[_0xab97('0x21')]('Content-Range',_0x3a443e+'-'+_0x40cd40+'/'+_0xd1ea44)['json'](_0x297426);}return null;};}function patchUpdates(_0x1111db){return function(_0x1bf900){try{jsonpatch[_0xab97('0x22')](_0x1bf900,_0x1111db,!![]);}catch(_0x237671){return BPromise[_0xab97('0x23')](_0x237671);}return _0x1bf900['save']();};}function saveUpdates(_0x476ccd,_0x3ad985){return function(_0x1f500d){if(_0x1f500d){return _0x1f500d[_0xab97('0x24')](_0x476ccd)['then'](function(_0x3ec770){return _0x3ec770;});}return null;};}function removeEntity(_0x2d10d3,_0x27215a){return function(_0x480a1b){if(_0x480a1b){return _0x480a1b[_0xab97('0x25')]()[_0xab97('0x26')](function(){_0x2d10d3[_0xab97('0x1a')](0xcc)[_0xab97('0x1b')]();});}};}function handleEntityNotFound(_0x1ca0a6,_0x4ccc72){return function(_0x458e34){if(!_0x458e34){_0x1ca0a6[_0xab97('0x27')](0x194);}return _0x458e34;};}function handleError(_0x1c86bd,_0x34d0b7){_0x34d0b7=_0x34d0b7||0x1f4;return function(_0x20d7cb){logger[_0xab97('0x28')](_0x20d7cb[_0xab97('0x29')]);if(_0x20d7cb[_0xab97('0x2a')]){delete _0x20d7cb[_0xab97('0x2a')];}_0x1c86bd[_0xab97('0x1a')](_0x34d0b7)[_0xab97('0x2b')](_0x20d7cb);};}exports[_0xab97('0x2c')]=function(_0xc348c8,_0x525b9d){var _0x54553d={},_0x1a2c07={},_0x2d568a={'count':0x0,'rows':[]};var _0x32e87d=_['map'](db[_0xab97('0x2d')][_0xab97('0x2e')],function(_0x246b53){return{'name':_0x246b53['fieldName'],'type':_0x246b53[_0xab97('0x2f')][_0xab97('0x30')]};});_0x1a2c07[_0xab97('0x31')]=_[_0xab97('0x32')](_0x32e87d,_0xab97('0x2a'));_0x1a2c07[_0xab97('0x33')]=_[_0xab97('0x34')](_0xc348c8[_0xab97('0x33')]);_0x1a2c07[_0xab97('0x35')]=_[_0xab97('0x36')](_0x1a2c07['model'],_0x1a2c07[_0xab97('0x33')]);_0x54553d['attributes']=_[_0xab97('0x36')](_0x1a2c07[_0xab97('0x31')],qs['fields'](_0xc348c8['query'][_0xab97('0x37')]));_0x54553d[_0xab97('0x38')]=_0x54553d[_0xab97('0x38')][_0xab97('0x39')]?_0x54553d[_0xab97('0x38')]:_0x1a2c07[_0xab97('0x31')];if(!_0xc348c8['query'][_0xab97('0x3a')](_0xab97('0x3b'))){_0x54553d[_0xab97('0x1f')]=qs[_0xab97('0x1f')](_0xc348c8[_0xab97('0x33')]['limit']);_0x54553d[_0xab97('0x1d')]=qs[_0xab97('0x1d')](_0xc348c8[_0xab97('0x33')][_0xab97('0x1d')]);}_0x54553d['order']=qs[_0xab97('0x3c')](_0xc348c8[_0xab97('0x33')][_0xab97('0x3c')]);_0x54553d['where']=qs['filters'](_['pick'](_0xc348c8['query'],_0x1a2c07[_0xab97('0x35')]),_0x32e87d);if(_0xc348c8[_0xab97('0x33')][_0xab97('0x3d')]){_0x54553d['where']=_[_0xab97('0x3e')](_0x54553d['where'],{'$or':_[_0xab97('0x32')](_0x32e87d,function(_0x38156e){if(_0x38156e[_0xab97('0x2f')]!=='VIRTUAL'){var _0x345477={};_0x345477[_0x38156e['name']]={'$like':'%'+_0xc348c8[_0xab97('0x33')][_0xab97('0x3d')]+'%'};return _0x345477;}})});}_0x54553d=_[_0xab97('0x3e')]({},_0x54553d,_0xc348c8[_0xab97('0x3f')]);var _0x573234={'where':_0x54553d['where']};return db[_0xab97('0x2d')][_0xab97('0x20')](_0x573234)[_0xab97('0x26')](function(_0x50bd8f){_0x2d568a[_0xab97('0x20')]=_0x50bd8f;if(_0xc348c8[_0xab97('0x33')][_0xab97('0x40')]){_0x54553d[_0xab97('0x41')]=[{'all':!![]}];}return db[_0xab97('0x2d')]['findAll'](_0x54553d);})['then'](function(_0x41a0a9){_0x2d568a['rows']=_0x41a0a9;return _0x2d568a;})['then'](respondWithFilteredResult(_0x525b9d,_0x54553d))[_0xab97('0x42')](handleError(_0x525b9d,null));};exports['show']=function(_0x205a30,_0x5553d6){var _0x50d42b={'raw':!![],'where':{'id':_0x205a30[_0xab97('0x43')]['id']}},_0x1e38f6={};_0x1e38f6[_0xab97('0x31')]=_[_0xab97('0x34')](db[_0xab97('0x2d')][_0xab97('0x2e')]);_0x1e38f6[_0xab97('0x33')]=_[_0xab97('0x34')](_0x205a30[_0xab97('0x33')]);_0x1e38f6['filters']=_['intersection'](_0x1e38f6['model'],_0x1e38f6[_0xab97('0x33')]);_0x50d42b[_0xab97('0x38')]=_[_0xab97('0x36')](_0x1e38f6[_0xab97('0x31')],qs[_0xab97('0x37')](_0x205a30[_0xab97('0x33')][_0xab97('0x37')]));_0x50d42b[_0xab97('0x38')]=_0x50d42b[_0xab97('0x38')]['length']?_0x50d42b[_0xab97('0x38')]:_0x1e38f6[_0xab97('0x31')];if(_0x205a30['query'][_0xab97('0x40')]){_0x50d42b[_0xab97('0x41')]=[{'all':!![]}];}_0x50d42b=_[_0xab97('0x3e')]({},_0x50d42b,_0x205a30['options']);return db['MailTransferReport'][_0xab97('0x44')](_0x50d42b)[_0xab97('0x26')](handleEntityNotFound(_0x5553d6,null))['then'](respondWithResult(_0x5553d6,null))['catch'](handleError(_0x5553d6,null));};exports[_0xab97('0x45')]=function(_0xebfb70,_0x1ca51c){return db[_0xab97('0x2d')][_0xab97('0x45')](_0xebfb70['body'],{})[_0xab97('0x26')](respondWithResult(_0x1ca51c,0xc9))['catch'](handleError(_0x1ca51c,null));};exports[_0xab97('0x24')]=function(_0x3d6b49,_0x51880c){if(_0x3d6b49['body']['id']){delete _0x3d6b49[_0xab97('0x46')]['id'];}return db[_0xab97('0x2d')]['find']({'where':{'id':_0x3d6b49[_0xab97('0x43')]['id']}})[_0xab97('0x26')](handleEntityNotFound(_0x51880c,null))['then'](saveUpdates(_0x3d6b49['body'],null))[_0xab97('0x26')](respondWithResult(_0x51880c,null))[_0xab97('0x42')](handleError(_0x51880c,null));};exports['destroy']=function(_0x27b6b4,_0x4c9638){return db[_0xab97('0x2d')][_0xab97('0x44')]({'where':{'id':_0x27b6b4[_0xab97('0x43')]['id']}})[_0xab97('0x26')](handleEntityNotFound(_0x4c9638,null))['then'](removeEntity(_0x4c9638,null))[_0xab97('0x42')](handleError(_0x4c9638,null));};exports[_0xab97('0x47')]=function(_0x94db8a,_0x4e8e4a){return db[_0xab97('0x2d')]['describe']()['then'](respondWithResult(_0x4e8e4a,null))[_0xab97('0x42')](handleError(_0x4e8e4a,null));}; \ No newline at end of file +var _0x781b=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','map','MailTransferReport','rawAttributes','fieldName','type','key','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','catch','params','keys','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x1e8982,_0x37bfc7){var _0x115066=function(_0x202cb1){while(--_0x202cb1){_0x1e8982['push'](_0x1e8982['shift']());}};_0x115066(++_0x37bfc7);}(_0x781b,0x16e));var _0xb781=function(_0x20a278,_0x50c587){_0x20a278=_0x20a278-0x0;var _0x457db=_0x781b[_0x20a278];return _0x457db;};'use strict';var emlformat=require(_0xb781('0x0'));var rimraf=require(_0xb781('0x1'));var zipdir=require(_0xb781('0x2'));var jsonpatch=require(_0xb781('0x3'));var rp=require(_0xb781('0x4'));var moment=require(_0xb781('0x5'));var BPromise=require(_0xb781('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb781('0x7'));var sox=require(_0xb781('0x8'));var csv=require(_0xb781('0x9'));var ejs=require(_0xb781('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb781('0xb'));var squel=require(_0xb781('0xc'));var crypto=require(_0xb781('0xd'));var jsforce=require(_0xb781('0xe'));var deskjs=require(_0xb781('0xf'));var toCsv=require(_0xb781('0x9'));var querystring=require(_0xb781('0x10'));var Papa=require(_0xb781('0x11'));var Redis=require(_0xb781('0x12'));var authService=require(_0xb781('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb781('0x14'));var hardwareService=require(_0xb781('0x15'));var logger=require('../../config/logger')(_0xb781('0x16'));var utils=require('../../config/utils');var config=require(_0xb781('0x17'));var licenseUtil=require(_0xb781('0x18'));var db=require(_0xb781('0x19'))['db'];function respondWithStatusCode(_0x47d5bc,_0x334c61){_0x334c61=_0x334c61||0xcc;return function(_0x540a34){if(_0x540a34){return _0x47d5bc[_0xb781('0x1a')](_0x334c61);}return _0x47d5bc[_0xb781('0x1b')](_0x334c61)['end']();};}function respondWithResult(_0x5e5069,_0x2e059f){_0x2e059f=_0x2e059f||0xc8;return function(_0x51d81e){if(_0x51d81e){return _0x5e5069[_0xb781('0x1b')](_0x2e059f)[_0xb781('0x1c')](_0x51d81e);}};}function respondWithFilteredResult(_0x136709,_0x5edfaf){return function(_0x2b0d24){if(_0x2b0d24){var _0x5a5f5a=typeof _0x5edfaf[_0xb781('0x1d')]===_0xb781('0x1e')&&typeof _0x5edfaf[_0xb781('0x1f')]===_0xb781('0x1e');var _0x26e90b=_0x2b0d24['count'];var _0x594c80=_0x5a5f5a?0x0:_0x5edfaf[_0xb781('0x1d')];var _0x3b7d73=_0x5a5f5a?_0x2b0d24['count']:_0x5edfaf[_0xb781('0x1d')]+_0x5edfaf[_0xb781('0x1f')];var _0x1b3dff;if(_0x3b7d73>=_0x26e90b){_0x3b7d73=_0x26e90b;_0x1b3dff=0xc8;}else{_0x1b3dff=0xce;}_0x136709[_0xb781('0x1b')](_0x1b3dff);return _0x136709[_0xb781('0x20')](_0xb781('0x21'),_0x594c80+'-'+_0x3b7d73+'/'+_0x26e90b)[_0xb781('0x1c')](_0x2b0d24);}return null;};}function patchUpdates(_0x982ad5){return function(_0x4ade05){try{jsonpatch[_0xb781('0x22')](_0x4ade05,_0x982ad5,!![]);}catch(_0x1ac3be){return BPromise[_0xb781('0x23')](_0x1ac3be);}return _0x4ade05[_0xb781('0x24')]();};}function saveUpdates(_0x9b2128,_0x345df4){return function(_0x32b996){if(_0x32b996){return _0x32b996[_0xb781('0x25')](_0x9b2128)[_0xb781('0x26')](function(_0x55386e){return _0x55386e;});}return null;};}function removeEntity(_0xdf7667,_0x1d7ddd){return function(_0x20ad64){if(_0x20ad64){return _0x20ad64[_0xb781('0x27')]()['then'](function(){_0xdf7667['status'](0xcc)[_0xb781('0x28')]();});}};}function handleEntityNotFound(_0x3e5a05,_0x44e380){return function(_0x344ab8){if(!_0x344ab8){_0x3e5a05['sendStatus'](0x194);}return _0x344ab8;};}function handleError(_0x121f8c,_0xcf52f4){_0xcf52f4=_0xcf52f4||0x1f4;return function(_0x566cfc){logger['error'](_0x566cfc[_0xb781('0x29')]);if(_0x566cfc[_0xb781('0x2a')]){delete _0x566cfc[_0xb781('0x2a')];}_0x121f8c['status'](_0xcf52f4)['send'](_0x566cfc);};}exports['index']=function(_0x88b2a9,_0x26dcd6){var _0x5ecb84={},_0x1524cb={},_0x43ec76={'count':0x0,'rows':[]};var _0x5a7f6e=_[_0xb781('0x2b')](db[_0xb781('0x2c')][_0xb781('0x2d')],function(_0x1a868f){return{'name':_0x1a868f[_0xb781('0x2e')],'type':_0x1a868f[_0xb781('0x2f')][_0xb781('0x30')]};});_0x1524cb['model']=_[_0xb781('0x2b')](_0x5a7f6e,_0xb781('0x2a'));_0x1524cb['query']=_['keys'](_0x88b2a9['query']);_0x1524cb['filters']=_[_0xb781('0x31')](_0x1524cb[_0xb781('0x32')],_0x1524cb[_0xb781('0x33')]);_0x5ecb84[_0xb781('0x34')]=_[_0xb781('0x31')](_0x1524cb[_0xb781('0x32')],qs['fields'](_0x88b2a9[_0xb781('0x33')][_0xb781('0x35')]));_0x5ecb84[_0xb781('0x34')]=_0x5ecb84[_0xb781('0x34')]['length']?_0x5ecb84['attributes']:_0x1524cb['model'];if(!_0x88b2a9[_0xb781('0x33')][_0xb781('0x36')](_0xb781('0x37'))){_0x5ecb84[_0xb781('0x1f')]=qs[_0xb781('0x1f')](_0x88b2a9[_0xb781('0x33')][_0xb781('0x1f')]);_0x5ecb84['offset']=qs['offset'](_0x88b2a9[_0xb781('0x33')][_0xb781('0x1d')]);}_0x5ecb84['order']=qs[_0xb781('0x38')](_0x88b2a9[_0xb781('0x33')][_0xb781('0x38')]);_0x5ecb84[_0xb781('0x39')]=qs[_0xb781('0x3a')](_[_0xb781('0x3b')](_0x88b2a9[_0xb781('0x33')],_0x1524cb[_0xb781('0x3a')]),_0x5a7f6e);if(_0x88b2a9[_0xb781('0x33')][_0xb781('0x3c')]){_0x5ecb84[_0xb781('0x39')]=_['merge'](_0x5ecb84[_0xb781('0x39')],{'$or':_[_0xb781('0x2b')](_0x5a7f6e,function(_0x5d68c2){if(_0x5d68c2[_0xb781('0x2f')]!==_0xb781('0x3d')){var _0x54a827={};_0x54a827[_0x5d68c2[_0xb781('0x2a')]]={'$like':'%'+_0x88b2a9[_0xb781('0x33')][_0xb781('0x3c')]+'%'};return _0x54a827;}})});}_0x5ecb84=_[_0xb781('0x3e')]({},_0x5ecb84,_0x88b2a9[_0xb781('0x3f')]);var _0x32a4af={'where':_0x5ecb84[_0xb781('0x39')]};return db['MailTransferReport'][_0xb781('0x40')](_0x32a4af)[_0xb781('0x26')](function(_0x47604d){_0x43ec76['count']=_0x47604d;if(_0x88b2a9['query'][_0xb781('0x41')]){_0x5ecb84['include']=[{'all':!![]}];}return db[_0xb781('0x2c')][_0xb781('0x42')](_0x5ecb84);})[_0xb781('0x26')](function(_0x44feda){_0x43ec76['rows']=_0x44feda;return _0x43ec76;})[_0xb781('0x26')](respondWithFilteredResult(_0x26dcd6,_0x5ecb84))[_0xb781('0x43')](handleError(_0x26dcd6,null));};exports['show']=function(_0x1c7443,_0x5bf141){var _0x10f2ca={'raw':!![],'where':{'id':_0x1c7443[_0xb781('0x44')]['id']}},_0xfaceb9={};_0xfaceb9[_0xb781('0x32')]=_[_0xb781('0x45')](db[_0xb781('0x2c')]['rawAttributes']);_0xfaceb9[_0xb781('0x33')]=_[_0xb781('0x45')](_0x1c7443['query']);_0xfaceb9['filters']=_[_0xb781('0x31')](_0xfaceb9['model'],_0xfaceb9['query']);_0x10f2ca[_0xb781('0x34')]=_['intersection'](_0xfaceb9['model'],qs[_0xb781('0x35')](_0x1c7443[_0xb781('0x33')][_0xb781('0x35')]));_0x10f2ca['attributes']=_0x10f2ca['attributes'][_0xb781('0x46')]?_0x10f2ca[_0xb781('0x34')]:_0xfaceb9['model'];if(_0x1c7443[_0xb781('0x33')][_0xb781('0x41')]){_0x10f2ca[_0xb781('0x47')]=[{'all':!![]}];}_0x10f2ca=_[_0xb781('0x3e')]({},_0x10f2ca,_0x1c7443[_0xb781('0x3f')]);return db[_0xb781('0x2c')][_0xb781('0x48')](_0x10f2ca)[_0xb781('0x26')](handleEntityNotFound(_0x5bf141,null))['then'](respondWithResult(_0x5bf141,null))[_0xb781('0x43')](handleError(_0x5bf141,null));};exports[_0xb781('0x49')]=function(_0x157be0,_0x191074){return db[_0xb781('0x2c')][_0xb781('0x49')](_0x157be0[_0xb781('0x4a')],{})[_0xb781('0x26')](respondWithResult(_0x191074,0xc9))[_0xb781('0x43')](handleError(_0x191074,null));};exports[_0xb781('0x25')]=function(_0x59abbd,_0x3af6e2){if(_0x59abbd[_0xb781('0x4a')]['id']){delete _0x59abbd[_0xb781('0x4a')]['id'];}return db[_0xb781('0x2c')][_0xb781('0x48')]({'where':{'id':_0x59abbd[_0xb781('0x44')]['id']}})['then'](handleEntityNotFound(_0x3af6e2,null))[_0xb781('0x26')](saveUpdates(_0x59abbd[_0xb781('0x4a')],null))[_0xb781('0x26')](respondWithResult(_0x3af6e2,null))[_0xb781('0x43')](handleError(_0x3af6e2,null));};exports[_0xb781('0x27')]=function(_0xdcae08,_0x4bf9ae){return db[_0xb781('0x2c')][_0xb781('0x48')]({'where':{'id':_0xdcae08[_0xb781('0x44')]['id']}})['then'](handleEntityNotFound(_0x4bf9ae,null))[_0xb781('0x26')](removeEntity(_0x4bf9ae,null))['catch'](handleError(_0x4bf9ae,null));};exports['describe']=function(_0x471072,_0x38669d){return db[_0xb781('0x2c')][_0xb781('0x4b')]()[_0xb781('0x26')](respondWithResult(_0x38669d,null))[_0xb781('0x43')](handleError(_0x38669d,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 29be8e2..6e38145 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 _0x548b=['moment','bluebird','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x548b,0x14f));var _0xb548=function(_0x4fa583,_0xadde7a){_0x4fa583=_0x4fa583-0x0;var _0x6e8300=_0x548b[_0x4fa583];return _0x6e8300;};'use strict';var _=require(_0xb548('0x0'));var util=require('util');var logger=require(_0xb548('0x1'))(_0xb548('0x2'));var moment=require(_0xb548('0x3'));var BPromise=require(_0xb548('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb548('0x5'));var config=require(_0xb548('0x6'));var attributes=require(_0xb548('0x7'));module[_0xb548('0x8')]=function(_0x20a495,_0x1dc4f8){return _0x20a495[_0xb548('0x9')](_0xb548('0xa'),attributes,{'tableName':_0xb548('0xb'),'paranoid':![],'indexes':[{'name':_0xb548('0xc'),'fields':[_0xb548('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x006d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x23e17b,_0x36836d){var _0x564bb8=function(_0x78ea18){while(--_0x78ea18){_0x23e17b['push'](_0x23e17b['shift']());}};_0x564bb8(++_0x36836d);}(_0x006d,0xea));var _0xd006=function(_0x2d3943,_0x1e84a0){_0x2d3943=_0x2d3943-0x0;var _0x99d9ac=_0x006d[_0x2d3943];return _0x99d9ac;};'use strict';var _=require(_0xd006('0x0'));var util=require(_0xd006('0x1'));var logger=require(_0xd006('0x2'))(_0xd006('0x3'));var moment=require(_0xd006('0x4'));var BPromise=require(_0xd006('0x5'));var rp=require(_0xd006('0x6'));var fs=require('fs');var path=require(_0xd006('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd006('0x8'));module[_0xd006('0x9')]=function(_0x4d16cb,_0xd874b1){return _0x4d16cb['define'](_0xd006('0xa'),attributes,{'tableName':_0xd006('0xb'),'paranoid':![],'indexes':[{'name':_0xd006('0xc'),'fields':[_0xd006('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 8e68e57..1c4010d 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 _0xb7db=['http','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x31c2e5,_0x1cfe95){var _0x59edcc=function(_0x27d305){while(--_0x27d305){_0x31c2e5['push'](_0x31c2e5['shift']());}};_0x59edcc(++_0x1cfe95);}(_0xb7db,0x19a));var _0xbb7d=function(_0x5669f5,_0x5e835c){_0x5669f5=_0x5669f5-0x0;var _0x37df31=_0xb7db[_0x5669f5];return _0x37df31;};'use strict';var _=require(_0xbb7d('0x0'));var util=require(_0xbb7d('0x1'));var moment=require(_0xbb7d('0x2'));var BPromise=require(_0xbb7d('0x3'));var rs=require(_0xbb7d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb7d('0x5'))['db'];var utils=require(_0xbb7d('0x6'));var logger=require('../../config/logger')(_0xbb7d('0x7'));var config=require(_0xbb7d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbb7d('0x9')][_0xbb7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9bfe18,_0x5e70f7,_0x2d32e4){return new BPromise(function(_0x4c7f90,_0x11c92f){return client['request'](_0x9bfe18,_0x2d32e4)['then'](function(_0x203bde){logger[_0xbb7d('0xb')](_0xbb7d('0xc'),_0x5e70f7,_0xbb7d('0xd'));logger['debug'](_0xbb7d('0xe'),_0x5e70f7,_0xbb7d('0xd'),JSON[_0xbb7d('0xf')](_0x203bde));if(_0x203bde[_0xbb7d('0x10')]){if(_0x203bde['error'][_0xbb7d('0x11')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x5e70f7,_0x203bde[_0xbb7d('0x10')][_0xbb7d('0x12')]);return _0x11c92f(_0x203bde[_0xbb7d('0x10')][_0xbb7d('0x12')]);}logger['error'](_0xbb7d('0xc'),_0x5e70f7,_0x203bde['error'][_0xbb7d('0x12')]);return _0x4c7f90(_0x203bde[_0xbb7d('0x10')]['message']);}else{logger[_0xbb7d('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x5e70f7,'request\x20sent');_0x4c7f90(_0x203bde[_0xbb7d('0x13')]['message']);}})[_0xbb7d('0x14')](function(_0x5fd8c0){logger[_0xbb7d('0x10')](_0xbb7d('0xc'),_0x5e70f7,_0x5fd8c0);_0x11c92f(_0x5fd8c0);});});} \ No newline at end of file +var _0x2fe5=['stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3841f6,_0x45de43){var _0x6d18d1=function(_0x306195){while(--_0x306195){_0x3841f6['push'](_0x3841f6['shift']());}};_0x6d18d1(++_0x45de43);}(_0x2fe5,0x1bd));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var moment=require(_0x52fe('0x2'));var BPromise=require(_0x52fe('0x3'));var rs=require(_0x52fe('0x4'));var fs=require('fs');var Redis=require(_0x52fe('0x5'));var db=require(_0x52fe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x52fe('0x7'))('rpc');var config=require(_0x52fe('0x8'));var jayson=require(_0x52fe('0x9'));var client=jayson[_0x52fe('0xa')][_0x52fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d10f5,_0x3f8556,_0x125fa7){return new BPromise(function(_0x5d0495,_0x3861dd){return client['request'](_0x2d10f5,_0x125fa7)[_0x52fe('0xc')](function(_0x1a0477){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x3f8556,_0x52fe('0xd'));logger['debug'](_0x52fe('0xe'),_0x3f8556,_0x52fe('0xd'),JSON[_0x52fe('0xf')](_0x1a0477));if(_0x1a0477[_0x52fe('0x10')]){if(_0x1a0477['error'][_0x52fe('0x11')]===0x1f4){logger[_0x52fe('0x10')](_0x52fe('0x12'),_0x3f8556,_0x1a0477[_0x52fe('0x10')][_0x52fe('0x13')]);return _0x3861dd(_0x1a0477['error']['message']);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x3f8556,_0x1a0477['error']['message']);return _0x5d0495(_0x1a0477[_0x52fe('0x10')][_0x52fe('0x13')]);}else{logger[_0x52fe('0x14')](_0x52fe('0x12'),_0x3f8556,_0x52fe('0xd'));_0x5d0495(_0x1a0477[_0x52fe('0x15')]['message']);}})[_0x52fe('0x16')](function(_0x1ae1dc){logger[_0x52fe('0x10')](_0x52fe('0x12'),_0x3f8556,_0x1ae1dc);_0x3861dd(_0x1ae1dc);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a9528ee..739d8ca 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 _0x956f=['../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x47b3b0,_0x4c4ad6){var _0x316687=function(_0x255d1d){while(--_0x255d1d){_0x47b3b0['push'](_0x47b3b0['shift']());}};_0x316687(++_0x4c4ad6);}(_0x956f,0xc2));var _0xf956=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x956f[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0xf956('0x0'));var path=require(_0xf956('0x1'));var timeout=require('connect-timeout');var express=require(_0xf956('0x2'));var router=express[_0xf956('0x3')]();var fs_extra=require(_0xf956('0x4'));var auth=require(_0xf956('0x5'));var interaction=require(_0xf956('0x6'));var config=require(_0xf956('0x7'));var controller=require(_0xf956('0x8'));router[_0xf956('0x9')]('/',auth[_0xf956('0xa')](),controller[_0xf956('0xb')]);router[_0xf956('0x9')]('/describe',auth[_0xf956('0xa')](),controller[_0xf956('0xc')]);router['get'](_0xf956('0xd'),auth['isAuthenticated'](),controller[_0xf956('0xe')]);router[_0xf956('0xf')]('/',auth[_0xf956('0xa')](),controller[_0xf956('0x10')]);router[_0xf956('0x11')](_0xf956('0xd'),auth[_0xf956('0xa')](),controller[_0xf956('0x12')]);router['delete'](_0xf956('0xd'),auth[_0xf956('0xa')](),controller['destroy']);module[_0xf956('0x13')]=router; \ No newline at end of file +var _0x4c44=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5527b5,_0x3fe5c6){var _0x2f6346=function(_0x25c93d){while(--_0x25c93d){_0x5527b5['push'](_0x5527b5['shift']());}};_0x2f6346(++_0x3fe5c6);}(_0x4c44,0x132));var _0x44c4=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0x4c44[_0x249d99];return _0x5bfb05;};'use strict';var multer=require(_0x44c4('0x0'));var util=require(_0x44c4('0x1'));var path=require(_0x44c4('0x2'));var timeout=require(_0x44c4('0x3'));var express=require(_0x44c4('0x4'));var router=express[_0x44c4('0x5')]();var fs_extra=require(_0x44c4('0x6'));var auth=require(_0x44c4('0x7'));var interaction=require(_0x44c4('0x8'));var config=require(_0x44c4('0x9'));var controller=require(_0x44c4('0xa'));router[_0x44c4('0xb')]('/',auth['isAuthenticated'](),controller[_0x44c4('0xc')]);router[_0x44c4('0xb')](_0x44c4('0xd'),auth[_0x44c4('0xe')](),controller['describe']);router[_0x44c4('0xb')](_0x44c4('0xf'),auth[_0x44c4('0xe')](),controller[_0x44c4('0x10')]);router[_0x44c4('0x11')]('/',auth['isAuthenticated'](),controller[_0x44c4('0x12')]);router[_0x44c4('0x13')](_0x44c4('0xf'),auth['isAuthenticated'](),controller[_0x44c4('0x14')]);router[_0x44c4('0x15')]('/:id',auth[_0x44c4('0xe')](),controller[_0x44c4('0x16')]);module[_0x44c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index bd20d14..37cc1ca 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 _0xc108=['STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','sequelize'];(function(_0x190489,_0x5e11c5){var _0x435b15=function(_0x4d4713){while(--_0x4d4713){_0x190489['push'](_0x190489['shift']());}};_0x435b15(++_0x5e11c5);}(_0xc108,0xcf));var _0x8c10=function(_0x2202e2,_0x384799){_0x2202e2=_0x2202e2-0x0;var _0x211f25=_0xc108[_0x2202e2];return _0x211f25;};'use strict';var Sequelize=require(_0x8c10('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x8c10('0x1')]},'membername':{'type':Sequelize[_0x8c10('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8c10('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x8c10('0x2')},'duration':{'type':Sequelize[_0x8c10('0x3')]},'enterAt':{'type':Sequelize[_0x8c10('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x36f183){var _0x2babba=moment(_0x36f183);var _0x2d52e4=moment(this['getDataValue'](_0x8c10('0x5')));var _0x3b4e2e=_0x2babba[_0x8c10('0x6')](_0x2d52e4,_0x8c10('0x7'));this[_0x8c10('0x8')](_0x8c10('0x9'),_0x36f183);this[_0x8c10('0x8')]('duration',_0x3b4e2e>=0x0?_0x3b4e2e:null);}},'data1':{'type':Sequelize[_0x8c10('0x1')],'comment':_0x8c10('0xa')},'data2':{'type':Sequelize[_0x8c10('0x1')],'comment':_0x8c10('0xb')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x8c10('0xc')},'data5':{'type':Sequelize[_0x8c10('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x8c10('0x1')]}}; \ No newline at end of file +var _0x9aee=['sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0xf1aacc,_0x3d9492){var _0x34342d=function(_0x35af84){while(--_0x35af84){_0xf1aacc['push'](_0xf1aacc['shift']());}};_0x34342d(++_0x3d9492);}(_0x9aee,0xbe));var _0xe9ae=function(_0x561e7b,_0x4bcd2e){_0x561e7b=_0x561e7b-0x0;var _0x5851ed=_0x9aee[_0x561e7b];return _0x5851ed;};'use strict';var Sequelize=require(_0xe9ae('0x0'));var moment=require(_0xe9ae('0x1'));module[_0xe9ae('0x2')]={'channel':{'type':Sequelize[_0xe9ae('0x3')]},'membername':{'type':Sequelize[_0xe9ae('0x3')]},'interface':{'type':Sequelize[_0xe9ae('0x3')]},'type':{'type':Sequelize[_0xe9ae('0x3')],'defaultValue':_0xe9ae('0x4'),'comment':_0xe9ae('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xe9ae('0x6')]},'exitAt':{'type':Sequelize[_0xe9ae('0x6')],'set':function(_0x43dbd8){var _0x41c3ea=moment(_0x43dbd8);var _0x24d0ea=moment(this[_0xe9ae('0x7')](_0xe9ae('0x8')));var _0x7059b3=_0x41c3ea[_0xe9ae('0x9')](_0x24d0ea,_0xe9ae('0xa'));this[_0xe9ae('0xb')](_0xe9ae('0xc'),_0x43dbd8);this[_0xe9ae('0xb')](_0xe9ae('0xd'),_0x7059b3>=0x0?_0x7059b3:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xe9ae('0xe')},'data2':{'type':Sequelize[_0xe9ae('0x3')],'comment':_0xe9ae('0xf')},'data3':{'type':Sequelize[_0xe9ae('0x3')],'comment':_0xe9ae('0x10')},'data4':{'type':Sequelize[_0xe9ae('0x3')],'comment':_0xe9ae('0x11')},'data5':{'type':Sequelize[_0xe9ae('0x3')],'comment':_0xe9ae('0x12')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xe9ae('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index ef6a271..f739152 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x334815,_0x46bf53){var _0x49e9ae=function(_0x5688d4){while(--_0x5688d4){_0x334815['push'](_0x334815['shift']());}};_0x49e9ae(++_0x46bf53);}(_0x008c,0x188));var _0xc008=function(_0x56a061,_0x53fb1b){_0x56a061=_0x56a061-0x0;var _0x105fa0=_0x008c[_0x56a061];return _0x105fa0;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x34e8,0x12c));var _0x834e=function(_0x58947c,_0xccdb01){_0x58947c=_0x58947c-0x0;var _0x3edd85=_0x34e8[_0x58947c];return _0x3edd85;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e497ec4..37090e5 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 _0x0404=['./memberReport.attributes','define','MemberReport','report_member','membername','interface','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d0d4f,_0x179618){var _0x2b08f1=function(_0x3c769f){while(--_0x3c769f){_0x5d0d4f['push'](_0x5d0d4f['shift']());}};_0x2b08f1(++_0x179618);}(_0x0404,0x123));var _0x4040=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x0404[_0x7b173];return _0x1c598c;};'use strict';var _=require('lodash');var util=require(_0x4040('0x0'));var logger=require(_0x4040('0x1'))(_0x4040('0x2'));var moment=require(_0x4040('0x3'));var BPromise=require(_0x4040('0x4'));var rp=require(_0x4040('0x5'));var fs=require('fs');var path=require(_0x4040('0x6'));var rimraf=require(_0x4040('0x7'));var config=require(_0x4040('0x8'));var attributes=require(_0x4040('0x9'));module['exports']=function(_0x200c95,_0x955b18){return _0x200c95[_0x4040('0xa')](_0x4040('0xb'),attributes,{'tableName':_0x4040('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x4040('0xd'),_0x4040('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4fd=['MemberReport','report_member','membername_interface','membername','../../config/logger','moment','bluebird','rimraf','exports','define'];(function(_0x251067,_0x8267c){var _0x386a77=function(_0x14d55c){while(--_0x14d55c){_0x251067['push'](_0x251067['shift']());}};_0x386a77(++_0x8267c);}(_0xb4fd,0x130));var _0xdb4f=function(_0x13a399,_0x82f9e0){_0x13a399=_0x13a399-0x0;var _0x5f46b1=_0xb4fd[_0x13a399];return _0x5f46b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb4f('0x0'))('api');var moment=require(_0xdb4f('0x1'));var BPromise=require(_0xdb4f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdb4f('0x3'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0xdb4f('0x4')]=function(_0x36dc26,_0x2b4692){return _0x36dc26[_0xdb4f('0x5')](_0xdb4f('0x6'),attributes,{'tableName':_0xdb4f('0x7'),'paranoid':![],'indexes':[{'name':_0xdb4f('0x8'),'fields':[_0xdb4f('0x9'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 3a7e9cc..1262d4a 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 _0x8403=['limit','include','map','model','GetMemberReport','CreateMemberReport','MemberReport','create','body','update','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','options','raw','where','attributes'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x8403,0x1a5));var _0x3840=function(_0x2413e3,_0x3bd3b5){_0x2413e3=_0x2413e3-0x0;var _0x2d46b3=_0x8403[_0x2413e3];return _0x2d46b3;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var moment=require(_0x3840('0x2'));var BPromise=require(_0x3840('0x3'));var rs=require(_0x3840('0x4'));var fs=require('fs');var Redis=require(_0x3840('0x5'));var db=require(_0x3840('0x6'))['db'];var utils=require(_0x3840('0x7'));var logger=require(_0x3840('0x8'))('rpc');var config=require(_0x3840('0x9'));var jayson=require(_0x3840('0xa'));var client=jayson[_0x3840('0xb')][_0x3840('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1fcfd8,_0x45d17c,_0x59923c){return new BPromise(function(_0x5aa2c4,_0x339366){return client[_0x3840('0xd')](_0x1fcfd8,_0x59923c)[_0x3840('0xe')](function(_0x5351e8){logger['info'](_0x3840('0xf'),_0x45d17c,_0x3840('0x10'));logger[_0x3840('0x11')](_0x3840('0x12'),_0x45d17c,_0x3840('0x10'),JSON[_0x3840('0x13')](_0x5351e8));if(_0x5351e8[_0x3840('0x14')]){if(_0x5351e8[_0x3840('0x14')][_0x3840('0x15')]===0x1f4){logger[_0x3840('0x14')]('MemberReport,\x20%s,\x20%s',_0x45d17c,_0x5351e8[_0x3840('0x14')][_0x3840('0x16')]);return _0x339366(_0x5351e8[_0x3840('0x14')]['message']);}logger[_0x3840('0x14')](_0x3840('0xf'),_0x45d17c,_0x5351e8['error'][_0x3840('0x16')]);return _0x5aa2c4(_0x5351e8[_0x3840('0x14')][_0x3840('0x16')]);}else{logger[_0x3840('0x17')](_0x3840('0xf'),_0x45d17c,_0x3840('0x10'));_0x5aa2c4(_0x5351e8[_0x3840('0x18')][_0x3840('0x16')]);}})[_0x3840('0x19')](function(_0x741d23){logger[_0x3840('0x14')]('MemberReport,\x20%s,\x20%s',_0x45d17c,_0x741d23);_0x339366(_0x741d23);});});}exports['GetMemberReport']=function(_0x3bc1be){var _0x5b4c20=this;return new Promise(function(_0x1f1df5,_0x1b1edc){return db['MemberReport']['findAll']({'raw':_0x3bc1be[_0x3840('0x1a')]?_0x3bc1be[_0x3840('0x1a')][_0x3840('0x1b')]===undefined?!![]:![]:!![],'where':_0x3bc1be['options']?_0x3bc1be[_0x3840('0x1a')][_0x3840('0x1c')]||null:null,'attributes':_0x3bc1be[_0x3840('0x1a')]?_0x3bc1be[_0x3840('0x1a')][_0x3840('0x1d')]||null:null,'limit':_0x3bc1be['options']?_0x3bc1be[_0x3840('0x1a')][_0x3840('0x1e')]||null:null,'include':_0x3bc1be['options']?_0x3bc1be[_0x3840('0x1a')][_0x3840('0x1f')]?_[_0x3840('0x20')](_0x3bc1be[_0x3840('0x1a')][_0x3840('0x1f')],function(_0x3bf539){return{'model':db[_0x3bf539[_0x3840('0x21')]],'as':_0x3bf539['as'],'attributes':_0x3bf539['attributes'],'include':_0x3bf539[_0x3840('0x1f')]?_[_0x3840('0x20')](_0x3bf539[_0x3840('0x1f')],function(_0x29abcb){return{'model':db[_0x29abcb['model']],'as':_0x29abcb['as'],'attributes':_0x29abcb['attributes'],'include':_0x29abcb['include']?_[_0x3840('0x20')](_0x29abcb['include'],function(_0x5eb7b1){return{'model':db[_0x5eb7b1[_0x3840('0x21')]],'as':_0x5eb7b1['as'],'attributes':_0x5eb7b1[_0x3840('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3840('0xe')](function(_0x55f427){logger[_0x3840('0x17')](_0x3840('0x22'),_0x3bc1be);logger[_0x3840('0x11')](_0x3840('0x22'),_0x3bc1be,JSON[_0x3840('0x13')](_0x55f427));_0x1f1df5(_0x55f427);})[_0x3840('0x19')](function(_0x250a95){logger[_0x3840('0x14')](_0x3840('0x22'),_0x250a95['message'],_0x3bc1be);_0x1b1edc(_0x5b4c20[_0x3840('0x14')](0x1f4,_0x250a95[_0x3840('0x16')]));});});};exports[_0x3840('0x23')]=function(_0x9ea431){var _0x4ef1da=this;return new Promise(function(_0x4f5118,_0x1d6a0c){return db[_0x3840('0x24')][_0x3840('0x25')](_0x9ea431[_0x3840('0x26')],{'raw':_0x9ea431['options']?_0x9ea431[_0x3840('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x3840('0xe')](function(_0x5acbf0){logger[_0x3840('0x17')](_0x3840('0x23'),_0x9ea431);logger[_0x3840('0x11')](_0x3840('0x23'),_0x9ea431,JSON['stringify'](_0x5acbf0));_0x4f5118(_0x5acbf0);})[_0x3840('0x19')](function(_0x2ec0d9){logger[_0x3840('0x14')]('CreateMemberReport',_0x2ec0d9[_0x3840('0x16')],_0x9ea431);_0x1d6a0c(_0x4ef1da[_0x3840('0x14')](0x1f4,_0x2ec0d9['message']));});});};exports['UpdateMemberReport']=function(_0x23768d){var _0x117ce7=this;return new Promise(function(_0x403ca3,_0x4ceb68){return db['MemberReport'][_0x3840('0x27')](_0x23768d[_0x3840('0x26')],{'raw':_0x23768d[_0x3840('0x1a')]?_0x23768d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23768d[_0x3840('0x1a')]?_0x23768d[_0x3840('0x1a')][_0x3840('0x1c')]||null:null,'attributes':_0x23768d['options']?_0x23768d[_0x3840('0x1a')][_0x3840('0x1d')]||null:null,'limit':_0x23768d[_0x3840('0x1a')]?_0x23768d[_0x3840('0x1a')][_0x3840('0x1e')]||null:null})[_0x3840('0xe')](function(_0x276a04){logger[_0x3840('0x17')](_0x3840('0x28'),_0x23768d);logger['debug']('UpdateMemberReport',_0x23768d,JSON[_0x3840('0x13')](_0x276a04));_0x403ca3(_0x276a04);})[_0x3840('0x19')](function(_0x5a1537){logger[_0x3840('0x14')](_0x3840('0x28'),_0x5a1537[_0x3840('0x16')],_0x23768d);_0x4ceb68(_0x117ce7[_0x3840('0x14')](0x1f4,_0x5a1537[_0x3840('0x16')]));});});}; \ No newline at end of file +var _0x236d=['info','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','model','map','CreateMemberReport','create','update','body','UpdateMemberReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2c0de0,_0x1898e3){var _0x1facee=function(_0x565bbc){while(--_0x565bbc){_0x2c0de0['push'](_0x2c0de0['shift']());}};_0x1facee(++_0x1898e3);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var moment=require('moment');var BPromise=require(_0xd236('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd236('0x3'));var db=require(_0xd236('0x4'))['db'];var utils=require(_0xd236('0x5'));var logger=require(_0xd236('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd236('0x7'));var client=jayson[_0xd236('0x8')][_0xd236('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aedc6,_0x58c59e,_0x54ac9c){return new BPromise(function(_0x2d9025,_0x18d969){return client['request'](_0x1aedc6,_0x54ac9c)[_0xd236('0xa')](function(_0x110545){logger['info'](_0xd236('0xb'),_0x58c59e,_0xd236('0xc'));logger[_0xd236('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x58c59e,_0xd236('0xc'),JSON[_0xd236('0xe')](_0x110545));if(_0x110545[_0xd236('0xf')]){if(_0x110545['error'][_0xd236('0x10')]===0x1f4){logger[_0xd236('0xf')](_0xd236('0xb'),_0x58c59e,_0x110545[_0xd236('0xf')][_0xd236('0x11')]);return _0x18d969(_0x110545[_0xd236('0xf')][_0xd236('0x11')]);}logger[_0xd236('0xf')](_0xd236('0xb'),_0x58c59e,_0x110545[_0xd236('0xf')][_0xd236('0x11')]);return _0x2d9025(_0x110545[_0xd236('0xf')][_0xd236('0x11')]);}else{logger[_0xd236('0x12')](_0xd236('0xb'),_0x58c59e,_0xd236('0xc'));_0x2d9025(_0x110545[_0xd236('0x13')][_0xd236('0x11')]);}})[_0xd236('0x14')](function(_0x1956a4){logger['error']('MemberReport,\x20%s,\x20%s',_0x58c59e,_0x1956a4);_0x18d969(_0x1956a4);});});}exports[_0xd236('0x15')]=function(_0x1b02a5){var _0x5346f1=this;return new Promise(function(_0x11c6ec,_0x3484fb){return db[_0xd236('0x16')]['findAll']({'raw':_0x1b02a5[_0xd236('0x17')]?_0x1b02a5[_0xd236('0x17')][_0xd236('0x18')]===undefined?!![]:![]:!![],'where':_0x1b02a5['options']?_0x1b02a5[_0xd236('0x17')][_0xd236('0x19')]||null:null,'attributes':_0x1b02a5[_0xd236('0x17')]?_0x1b02a5[_0xd236('0x17')][_0xd236('0x1a')]||null:null,'limit':_0x1b02a5['options']?_0x1b02a5[_0xd236('0x17')][_0xd236('0x1b')]||null:null,'include':_0x1b02a5[_0xd236('0x17')]?_0x1b02a5[_0xd236('0x17')][_0xd236('0x1c')]?_['map'](_0x1b02a5['options'][_0xd236('0x1c')],function(_0x4be5ac){return{'model':db[_0x4be5ac[_0xd236('0x1d')]],'as':_0x4be5ac['as'],'attributes':_0x4be5ac['attributes'],'include':_0x4be5ac[_0xd236('0x1c')]?_[_0xd236('0x1e')](_0x4be5ac[_0xd236('0x1c')],function(_0x49d822){return{'model':db[_0x49d822[_0xd236('0x1d')]],'as':_0x49d822['as'],'attributes':_0x49d822[_0xd236('0x1a')],'include':_0x49d822[_0xd236('0x1c')]?_[_0xd236('0x1e')](_0x49d822[_0xd236('0x1c')],function(_0x17f927){return{'model':db[_0x17f927[_0xd236('0x1d')]],'as':_0x17f927['as'],'attributes':_0x17f927[_0xd236('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd236('0xa')](function(_0x2be500){logger[_0xd236('0x12')](_0xd236('0x15'),_0x1b02a5);logger[_0xd236('0xd')](_0xd236('0x15'),_0x1b02a5,JSON[_0xd236('0xe')](_0x2be500));_0x11c6ec(_0x2be500);})[_0xd236('0x14')](function(_0x436a19){logger[_0xd236('0xf')](_0xd236('0x15'),_0x436a19[_0xd236('0x11')],_0x1b02a5);_0x3484fb(_0x5346f1[_0xd236('0xf')](0x1f4,_0x436a19[_0xd236('0x11')]));});});};exports[_0xd236('0x1f')]=function(_0x36f8d4){var _0xdd34a4=this;return new Promise(function(_0x1c50ae,_0xed1acb){return db[_0xd236('0x16')][_0xd236('0x20')](_0x36f8d4['body'],{'raw':_0x36f8d4[_0xd236('0x17')]?_0x36f8d4['options'][_0xd236('0x18')]===undefined?!![]:![]:!![]})[_0xd236('0xa')](function(_0x73a2fb){logger['info'](_0xd236('0x1f'),_0x36f8d4);logger[_0xd236('0xd')](_0xd236('0x1f'),_0x36f8d4,JSON[_0xd236('0xe')](_0x73a2fb));_0x1c50ae(_0x73a2fb);})[_0xd236('0x14')](function(_0x4457f2){logger[_0xd236('0xf')]('CreateMemberReport',_0x4457f2[_0xd236('0x11')],_0x36f8d4);_0xed1acb(_0xdd34a4['error'](0x1f4,_0x4457f2[_0xd236('0x11')]));});});};exports['UpdateMemberReport']=function(_0x1fd01b){var _0xb75faa=this;return new Promise(function(_0x366128,_0x208914){return db[_0xd236('0x16')][_0xd236('0x21')](_0x1fd01b[_0xd236('0x22')],{'raw':_0x1fd01b[_0xd236('0x17')]?_0x1fd01b[_0xd236('0x17')][_0xd236('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd01b[_0xd236('0x17')]?_0x1fd01b[_0xd236('0x17')][_0xd236('0x19')]||null:null,'attributes':_0x1fd01b['options']?_0x1fd01b[_0xd236('0x17')][_0xd236('0x1a')]||null:null,'limit':_0x1fd01b[_0xd236('0x17')]?_0x1fd01b['options'][_0xd236('0x1b')]||null:null})[_0xd236('0xa')](function(_0x10e3de){logger[_0xd236('0x12')](_0xd236('0x23'),_0x1fd01b);logger[_0xd236('0xd')]('UpdateMemberReport',_0x1fd01b,JSON[_0xd236('0xe')](_0x10e3de));_0x366128(_0x10e3de);})[_0xd236('0x14')](function(_0x21da6b){logger[_0xd236('0xf')](_0xd236('0x23'),_0x21da6b[_0xd236('0x11')],_0x1fd01b);_0x208914(_0xb75faa['error'](0x1f4,_0x21da6b[_0xd236('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2063f71..e19dc4a 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 _0x0967=['./migration.controller','get','index','multer','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x1bf89a,_0x2a2949){var _0x198910=function(_0x171142){while(--_0x171142){_0x1bf89a['push'](_0x1bf89a['shift']());}};_0x198910(++_0x2a2949);}(_0x0967,0x173));var _0x7096=function(_0x19bd20,_0x306751){_0x19bd20=_0x19bd20-0x0;var _0x47d3fb=_0x0967[_0x19bd20];return _0x47d3fb;};'use strict';var multer=require(_0x7096('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7096('0x1'));var express=require(_0x7096('0x2'));var router=express['Router']();var fs_extra=require(_0x7096('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7096('0x4'));var controller=require(_0x7096('0x5'));router[_0x7096('0x6')]('/',controller[_0x7096('0x7')]);module['exports']=router; \ No newline at end of file +var _0xd338=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','multer','path','Router','fs-extra'];(function(_0x553734,_0x1683a4){var _0x17c370=function(_0x5bb1f9){while(--_0x5bb1f9){_0x553734['push'](_0x553734['shift']());}};_0x17c370(++_0x1683a4);}(_0xd338,0x1f4));var _0x8d33=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0xd338[_0x22cc16];return _0x399b70;};'use strict';var multer=require(_0x8d33('0x0'));var util=require('util');var path=require(_0x8d33('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d33('0x2')]();var fs_extra=require(_0x8d33('0x3'));var auth=require(_0x8d33('0x4'));var interaction=require(_0x8d33('0x5'));var config=require(_0x8d33('0x6'));var controller=require('./migration.controller');router['get']('/',controller[_0x8d33('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index a98e23b..a031bce 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 _0xce9e=['sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce9e,0x1db));var _0xece9=function(_0x335bb1,_0x5aa97e){_0x335bb1=_0x335bb1-0x0;var _0x4c2fc7=_0xce9e[_0x335bb1];return _0x4c2fc7;};'use strict';var Sequelize=require(_0xece9('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0x6729=['version','exports','STRING'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x6729,0x178));var _0x9672=function(_0x4bbcaf,_0x16e9da){_0x4bbcaf=_0x4bbcaf-0x0;var _0x4a891e=_0x6729[_0x4bbcaf];return _0x4a891e;};'use strict';var Sequelize=require('sequelize');module[_0x9672('0x0')]={'version':{'type':Sequelize[_0x9672('0x1')],'unique':_0x9672('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 34c6af4..8e18d11 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 _0x59bc=['model','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','end','stack','send','index','map','Migration','fieldName','type','name','query','keys','intersection'];(function(_0x3d6046,_0x43ee54){var _0x24720a=function(_0x1a880d){while(--_0x1a880d){_0x3d6046['push'](_0x3d6046['shift']());}};_0x24720a(++_0x43ee54);}(_0x59bc,0x15a));var _0xc59b=function(_0x23d4b4,_0x3514a3){_0x23d4b4=_0x23d4b4-0x0;var _0x11c51a=_0x59bc[_0x23d4b4];return _0x11c51a;};'use strict';var emlformat=require(_0xc59b('0x0'));var rimraf=require(_0xc59b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc59b('0x2'));var rp=require(_0xc59b('0x3'));var moment=require(_0xc59b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc59b('0x5'));var util=require('util');var path=require(_0xc59b('0x6'));var sox=require(_0xc59b('0x7'));var csv=require('to-csv');var ejs=require(_0xc59b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc59b('0x9'));var squel=require(_0xc59b('0xa'));var crypto=require('crypto');var jsforce=require(_0xc59b('0xb'));var deskjs=require(_0xc59b('0xc'));var toCsv=require(_0xc59b('0xd'));var querystring=require(_0xc59b('0xe'));var Papa=require(_0xc59b('0xf'));var Redis=require('ioredis');var authService=require(_0xc59b('0x10'));var qs=require(_0xc59b('0x11'));var as=require(_0xc59b('0x12'));var hardwareService=require(_0xc59b('0x13'));var logger=require(_0xc59b('0x14'))(_0xc59b('0x15'));var utils=require(_0xc59b('0x16'));var config=require(_0xc59b('0x17'));var licenseUtil=require(_0xc59b('0x18'));var db=require(_0xc59b('0x19'))['db'];function respondWithStatusCode(_0x38aa10,_0xd45ee3){_0xd45ee3=_0xd45ee3||0xcc;return function(_0x3a28a4){if(_0x3a28a4){return _0x38aa10['sendStatus'](_0xd45ee3);}return _0x38aa10['status'](_0xd45ee3)['end']();};}function respondWithResult(_0x15f758,_0x25c53f){_0x25c53f=_0x25c53f||0xc8;return function(_0x1da842){if(_0x1da842){return _0x15f758[_0xc59b('0x1a')](_0x25c53f)[_0xc59b('0x1b')](_0x1da842);}};}function respondWithFilteredResult(_0x400c3d,_0xc7fd3d){return function(_0x46511d){if(_0x46511d){var _0x5518b2=typeof _0xc7fd3d['offset']===_0xc59b('0x1c')&&typeof _0xc7fd3d['limit']===_0xc59b('0x1c');var _0x1ffb2b=_0x46511d[_0xc59b('0x1d')];var _0x493f09=_0x5518b2?0x0:_0xc7fd3d[_0xc59b('0x1e')];var _0x4ba1f1=_0x5518b2?_0x46511d['count']:_0xc7fd3d[_0xc59b('0x1e')]+_0xc7fd3d[_0xc59b('0x1f')];var _0x3ca068;if(_0x4ba1f1>=_0x1ffb2b){_0x4ba1f1=_0x1ffb2b;_0x3ca068=0xc8;}else{_0x3ca068=0xce;}_0x400c3d[_0xc59b('0x1a')](_0x3ca068);return _0x400c3d['set'](_0xc59b('0x20'),_0x493f09+'-'+_0x4ba1f1+'/'+_0x1ffb2b)[_0xc59b('0x1b')](_0x46511d);}return null;};}function patchUpdates(_0x13291f){return function(_0x4877e5){try{jsonpatch[_0xc59b('0x21')](_0x4877e5,_0x13291f,!![]);}catch(_0x16bd80){return BPromise[_0xc59b('0x22')](_0x16bd80);}return _0x4877e5[_0xc59b('0x23')]();};}function saveUpdates(_0x347329,_0x141ecc){return function(_0x449ad3){if(_0x449ad3){return _0x449ad3[_0xc59b('0x24')](_0x347329)[_0xc59b('0x25')](function(_0x370263){return _0x370263;});}return null;};}function removeEntity(_0x1e71f0,_0x1aee97){return function(_0x470ec1){if(_0x470ec1){return _0x470ec1['destroy']()[_0xc59b('0x25')](function(){_0x1e71f0[_0xc59b('0x1a')](0xcc)[_0xc59b('0x26')]();});}};}function handleEntityNotFound(_0x9e6c57,_0x36f49a){return function(_0x5c6359){if(!_0x5c6359){_0x9e6c57['sendStatus'](0x194);}return _0x5c6359;};}function handleError(_0x5cfd47,_0x4bcf28){_0x4bcf28=_0x4bcf28||0x1f4;return function(_0x2805a4){logger['error'](_0x2805a4[_0xc59b('0x27')]);if(_0x2805a4['name']){delete _0x2805a4['name'];}_0x5cfd47[_0xc59b('0x1a')](_0x4bcf28)[_0xc59b('0x28')](_0x2805a4);};}exports[_0xc59b('0x29')]=function(_0x39e31c,_0x35daa5){var _0x4e9e14={},_0x4bf02c={},_0x4ec57e={'count':0x0,'rows':[]};var _0x340864=_[_0xc59b('0x2a')](db[_0xc59b('0x2b')]['rawAttributes'],function(_0x4c27f0){return{'name':_0x4c27f0[_0xc59b('0x2c')],'type':_0x4c27f0[_0xc59b('0x2d')]['key']};});_0x4bf02c['model']=_['map'](_0x340864,_0xc59b('0x2e'));_0x4bf02c[_0xc59b('0x2f')]=_[_0xc59b('0x30')](_0x39e31c[_0xc59b('0x2f')]);_0x4bf02c['filters']=_[_0xc59b('0x31')](_0x4bf02c[_0xc59b('0x32')],_0x4bf02c[_0xc59b('0x2f')]);_0x4e9e14[_0xc59b('0x33')]=_[_0xc59b('0x31')](_0x4bf02c[_0xc59b('0x32')],qs['fields'](_0x39e31c[_0xc59b('0x2f')][_0xc59b('0x34')]));_0x4e9e14[_0xc59b('0x33')]=_0x4e9e14[_0xc59b('0x33')][_0xc59b('0x35')]?_0x4e9e14['attributes']:_0x4bf02c[_0xc59b('0x32')];if(!_0x39e31c[_0xc59b('0x2f')][_0xc59b('0x36')]('nolimit')){_0x4e9e14[_0xc59b('0x1f')]=qs[_0xc59b('0x1f')](_0x39e31c['query'][_0xc59b('0x1f')]);_0x4e9e14[_0xc59b('0x1e')]=qs[_0xc59b('0x1e')](_0x39e31c['query'][_0xc59b('0x1e')]);}_0x4e9e14['order']=qs[_0xc59b('0x37')](_0x39e31c['query']['sort']);_0x4e9e14[_0xc59b('0x38')]=qs[_0xc59b('0x39')](_['pick'](_0x39e31c[_0xc59b('0x2f')],_0x4bf02c[_0xc59b('0x39')]),_0x340864);if(_0x39e31c[_0xc59b('0x2f')][_0xc59b('0x3a')]){_0x4e9e14['where']=_[_0xc59b('0x3b')](_0x4e9e14[_0xc59b('0x38')],{'$or':_[_0xc59b('0x2a')](_0x340864,function(_0x525857){if(_0x525857[_0xc59b('0x2d')]!==_0xc59b('0x3c')){var _0x4773db={};_0x4773db[_0x525857[_0xc59b('0x2e')]]={'$like':'%'+_0x39e31c[_0xc59b('0x2f')][_0xc59b('0x3a')]+'%'};return _0x4773db;}})});}_0x4e9e14=_[_0xc59b('0x3b')]({},_0x4e9e14,_0x39e31c[_0xc59b('0x3d')]);var _0x3e2a4d={'where':_0x4e9e14['where']};return db[_0xc59b('0x2b')][_0xc59b('0x1d')](_0x3e2a4d)[_0xc59b('0x25')](function(_0x50a0ce){_0x4ec57e[_0xc59b('0x1d')]=_0x50a0ce;if(_0x39e31c[_0xc59b('0x2f')][_0xc59b('0x3e')]){_0x4e9e14[_0xc59b('0x3f')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x4e9e14);})[_0xc59b('0x25')](function(_0x585ac9){_0x4ec57e[_0xc59b('0x40')]=_0x585ac9;return _0x4ec57e;})['then'](respondWithFilteredResult(_0x35daa5,_0x4e9e14))[_0xc59b('0x41')](handleError(_0x35daa5,null));}; \ No newline at end of file +var _0x143c=['save','update','then','error','stack','name','send','index','map','Migration','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x4bff6f,_0x4f57fc){var _0x1e0e32=function(_0x284908){while(--_0x284908){_0x4bff6f['push'](_0x4bff6f['shift']());}};_0x1e0e32(++_0x4f57fc);}(_0x143c,0xe9));var _0xc143=function(_0x412572,_0x37e9e2){_0x412572=_0x412572-0x0;var _0x20881f=_0x143c[_0x412572];return _0x20881f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc143('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc143('0x1'));var rp=require(_0xc143('0x2'));var moment=require(_0xc143('0x3'));var BPromise=require(_0xc143('0x4'));var Mustache=require(_0xc143('0x5'));var util=require('util');var path=require(_0xc143('0x6'));var sox=require(_0xc143('0x7'));var csv=require(_0xc143('0x8'));var ejs=require(_0xc143('0x9'));var fs=require('fs');var fs_extra=require(_0xc143('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc143('0xb'));var jsforce=require(_0xc143('0xc'));var deskjs=require(_0xc143('0xd'));var toCsv=require(_0xc143('0x8'));var querystring=require(_0xc143('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc143('0xf'));var qs=require(_0xc143('0x10'));var as=require(_0xc143('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc143('0x12'))(_0xc143('0x13'));var utils=require(_0xc143('0x14'));var config=require(_0xc143('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc143('0x16'))['db'];function respondWithStatusCode(_0x21b63b,_0x12d6c9){_0x12d6c9=_0x12d6c9||0xcc;return function(_0x2d23e3){if(_0x2d23e3){return _0x21b63b[_0xc143('0x17')](_0x12d6c9);}return _0x21b63b[_0xc143('0x18')](_0x12d6c9)[_0xc143('0x19')]();};}function respondWithResult(_0x4482ab,_0x3ca50d){_0x3ca50d=_0x3ca50d||0xc8;return function(_0x295a0b){if(_0x295a0b){return _0x4482ab[_0xc143('0x18')](_0x3ca50d)[_0xc143('0x1a')](_0x295a0b);}};}function respondWithFilteredResult(_0x1398a3,_0x11cdc4){return function(_0x40a2e0){if(_0x40a2e0){var _0x731e9e=typeof _0x11cdc4[_0xc143('0x1b')]==='undefined'&&typeof _0x11cdc4[_0xc143('0x1c')]===_0xc143('0x1d');var _0x3d2cdd=_0x40a2e0[_0xc143('0x1e')];var _0x4eb9fe=_0x731e9e?0x0:_0x11cdc4[_0xc143('0x1b')];var _0x2357c1=_0x731e9e?_0x40a2e0['count']:_0x11cdc4['offset']+_0x11cdc4[_0xc143('0x1c')];var _0x350ee3;if(_0x2357c1>=_0x3d2cdd){_0x2357c1=_0x3d2cdd;_0x350ee3=0xc8;}else{_0x350ee3=0xce;}_0x1398a3[_0xc143('0x18')](_0x350ee3);return _0x1398a3[_0xc143('0x1f')](_0xc143('0x20'),_0x4eb9fe+'-'+_0x2357c1+'/'+_0x3d2cdd)['json'](_0x40a2e0);}return null;};}function patchUpdates(_0x2eb7f1){return function(_0x4fec76){try{jsonpatch[_0xc143('0x21')](_0x4fec76,_0x2eb7f1,!![]);}catch(_0x2fc8d7){return BPromise[_0xc143('0x22')](_0x2fc8d7);}return _0x4fec76[_0xc143('0x23')]();};}function saveUpdates(_0x3cd350,_0x5f1395){return function(_0x110fd7){if(_0x110fd7){return _0x110fd7[_0xc143('0x24')](_0x3cd350)['then'](function(_0x453ca7){return _0x453ca7;});}return null;};}function removeEntity(_0x36ec86,_0x5e41ea){return function(_0x2f1388){if(_0x2f1388){return _0x2f1388['destroy']()[_0xc143('0x25')](function(){_0x36ec86['status'](0xcc)[_0xc143('0x19')]();});}};}function handleEntityNotFound(_0x1668b1,_0x9a0ef){return function(_0x1d1c36){if(!_0x1d1c36){_0x1668b1[_0xc143('0x17')](0x194);}return _0x1d1c36;};}function handleError(_0x1c3a49,_0x428807){_0x428807=_0x428807||0x1f4;return function(_0x524ffa){logger[_0xc143('0x26')](_0x524ffa[_0xc143('0x27')]);if(_0x524ffa[_0xc143('0x28')]){delete _0x524ffa['name'];}_0x1c3a49['status'](_0x428807)[_0xc143('0x29')](_0x524ffa);};}exports[_0xc143('0x2a')]=function(_0x3ae231,_0x639244){var _0xc0f4ed={},_0x5c8ec9={},_0x22d45d={'count':0x0,'rows':[]};var _0x288a93=_[_0xc143('0x2b')](db[_0xc143('0x2c')][_0xc143('0x2d')],function(_0x1e1659){return{'name':_0x1e1659['fieldName'],'type':_0x1e1659[_0xc143('0x2e')][_0xc143('0x2f')]};});_0x5c8ec9[_0xc143('0x30')]=_[_0xc143('0x2b')](_0x288a93,_0xc143('0x28'));_0x5c8ec9[_0xc143('0x31')]=_['keys'](_0x3ae231[_0xc143('0x31')]);_0x5c8ec9['filters']=_[_0xc143('0x32')](_0x5c8ec9[_0xc143('0x30')],_0x5c8ec9[_0xc143('0x31')]);_0xc0f4ed['attributes']=_[_0xc143('0x32')](_0x5c8ec9[_0xc143('0x30')],qs[_0xc143('0x33')](_0x3ae231['query']['fields']));_0xc0f4ed[_0xc143('0x34')]=_0xc0f4ed[_0xc143('0x34')][_0xc143('0x35')]?_0xc0f4ed[_0xc143('0x34')]:_0x5c8ec9['model'];if(!_0x3ae231[_0xc143('0x31')][_0xc143('0x36')](_0xc143('0x37'))){_0xc0f4ed[_0xc143('0x1c')]=qs[_0xc143('0x1c')](_0x3ae231['query'][_0xc143('0x1c')]);_0xc0f4ed['offset']=qs['offset'](_0x3ae231[_0xc143('0x31')]['offset']);}_0xc0f4ed['order']=qs[_0xc143('0x38')](_0x3ae231[_0xc143('0x31')][_0xc143('0x38')]);_0xc0f4ed[_0xc143('0x39')]=qs[_0xc143('0x3a')](_[_0xc143('0x3b')](_0x3ae231['query'],_0x5c8ec9[_0xc143('0x3a')]),_0x288a93);if(_0x3ae231[_0xc143('0x31')][_0xc143('0x3c')]){_0xc0f4ed[_0xc143('0x39')]=_[_0xc143('0x3d')](_0xc0f4ed[_0xc143('0x39')],{'$or':_[_0xc143('0x2b')](_0x288a93,function(_0x49fb0a){if(_0x49fb0a[_0xc143('0x2e')]!==_0xc143('0x3e')){var _0x27cc93={};_0x27cc93[_0x49fb0a[_0xc143('0x28')]]={'$like':'%'+_0x3ae231['query'][_0xc143('0x3c')]+'%'};return _0x27cc93;}})});}_0xc0f4ed=_[_0xc143('0x3d')]({},_0xc0f4ed,_0x3ae231[_0xc143('0x3f')]);var _0x92933f={'where':_0xc0f4ed[_0xc143('0x39')]};return db['Migration'][_0xc143('0x1e')](_0x92933f)[_0xc143('0x25')](function(_0x4c5ff6){_0x22d45d[_0xc143('0x1e')]=_0x4c5ff6;if(_0x3ae231['query'][_0xc143('0x40')]){_0xc0f4ed['include']=[{'all':!![]}];}return db[_0xc143('0x2c')]['findAll'](_0xc0f4ed);})[_0xc143('0x25')](function(_0x52e4b5){_0x22d45d[_0xc143('0x41')]=_0x52e4b5;return _0x22d45d;})[_0xc143('0x25')](respondWithFilteredResult(_0x639244,_0xc0f4ed))[_0xc143('0x42')](handleError(_0x639244,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b2501f3..7d1cc0a 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 _0xfe7c=['Migration','migrations','lodash','util','../../config/logger','moment','request-promise','path','./migration.attributes','exports'];(function(_0x65e3dc,_0x10fd05){var _0x5d475b=function(_0x415b54){while(--_0x415b54){_0x65e3dc['push'](_0x65e3dc['shift']());}};_0x5d475b(++_0x10fd05);}(_0xfe7c,0x1ba));var _0xcfe7=function(_0x272ee0,_0x48adc5){_0x272ee0=_0x272ee0-0x0;var _0x1111cc=_0xfe7c[_0x272ee0];return _0x1111cc;};'use strict';var _=require(_0xcfe7('0x0'));var util=require(_0xcfe7('0x1'));var logger=require(_0xcfe7('0x2'))('api');var moment=require(_0xcfe7('0x3'));var BPromise=require('bluebird');var rp=require(_0xcfe7('0x4'));var fs=require('fs');var path=require(_0xcfe7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcfe7('0x6'));module[_0xcfe7('0x7')]=function(_0x127792,_0x4aa4bd){return _0x127792['define'](_0xcfe7('0x8'),attributes,{'tableName':_0xcfe7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcd8=['path','rimraf','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','request-promise'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0xbcd8,0x19d));var _0x8bcd=function(_0x327dbd,_0x2bd34d){_0x327dbd=_0x327dbd-0x0;var _0x58775e=_0xbcd8[_0x327dbd];return _0x58775e;};'use strict';var _=require(_0x8bcd('0x0'));var util=require(_0x8bcd('0x1'));var logger=require(_0x8bcd('0x2'))(_0x8bcd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8bcd('0x4'));var fs=require('fs');var path=require(_0x8bcd('0x5'));var rimraf=require(_0x8bcd('0x6'));var config=require('../../config/environment');var attributes=require(_0x8bcd('0x7'));module[_0x8bcd('0x8')]=function(_0x31e10f,_0x50a91b){return _0x31e10f[_0x8bcd('0x9')]('Migration',attributes,{'tableName':_0x8bcd('0xa'),'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 5b51238..9bd2c7a 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 _0xa74d=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0xa74d,0x1cf));var _0xda74=function(_0x38f50f,_0x15c382){_0x38f50f=_0x38f50f-0x0;var _0x4d06a5=_0xa74d[_0x38f50f];return _0x4d06a5;};'use strict';var _=require('lodash');var util=require(_0xda74('0x0'));var moment=require(_0xda74('0x1'));var BPromise=require(_0xda74('0x2'));var rs=require(_0xda74('0x3'));var fs=require('fs');var Redis=require(_0xda74('0x4'));var db=require(_0xda74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda74('0x6'))(_0xda74('0x7'));var config=require(_0xda74('0x8'));var jayson=require(_0xda74('0x9'));var client=jayson[_0xda74('0xa')][_0xda74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2113f2,_0x3fa4e7,_0x5da443){return new BPromise(function(_0x23d5f5,_0x517251){return client['request'](_0x2113f2,_0x5da443)[_0xda74('0xc')](function(_0x411790){logger['info'](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));logger[_0xda74('0xf')](_0xda74('0x10'),_0x3fa4e7,_0xda74('0xe'),JSON[_0xda74('0x11')](_0x411790));if(_0x411790[_0xda74('0x12')]){if(_0x411790[_0xda74('0x12')]['code']===0x1f4){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')]['message']);return _0x517251(_0x411790[_0xda74('0x12')][_0xda74('0x13')]);}logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')][_0xda74('0x13')]);return _0x23d5f5(_0x411790[_0xda74('0x12')]['message']);}else{logger[_0xda74('0x14')](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));_0x23d5f5(_0x411790[_0xda74('0x15')][_0xda74('0x13')]);}})['catch'](function(_0x1535d3){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x1535d3);_0x517251(_0x1535d3);});});} \ No newline at end of file +var _0x7d13=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7d13,0x6c));var _0x37d1=function(_0xe23de1,_0x2cd4b9){_0xe23de1=_0xe23de1-0x0;var _0x59d143=_0x7d13[_0xe23de1];return _0x59d143;};'use strict';var _=require('lodash');var util=require(_0x37d1('0x0'));var moment=require('moment');var BPromise=require(_0x37d1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d1('0x2'));var db=require(_0x37d1('0x3'))['db'];var utils=require(_0x37d1('0x4'));var logger=require(_0x37d1('0x5'))(_0x37d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x37d1('0x7'));var client=jayson[_0x37d1('0x8')][_0x37d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27ac1d,_0x5146e3,_0x9302bd){return new BPromise(function(_0x41dfaa,_0x115eca){return client[_0x37d1('0xa')](_0x27ac1d,_0x9302bd)[_0x37d1('0xb')](function(_0x636359){logger[_0x37d1('0xc')]('Migration,\x20%s,\x20%s',_0x5146e3,'request\x20sent');logger[_0x37d1('0xd')](_0x37d1('0xe'),_0x5146e3,'request\x20sent',JSON[_0x37d1('0xf')](_0x636359));if(_0x636359[_0x37d1('0x10')]){if(_0x636359[_0x37d1('0x10')][_0x37d1('0x11')]===0x1f4){logger[_0x37d1('0x10')](_0x37d1('0x12'),_0x5146e3,_0x636359[_0x37d1('0x10')][_0x37d1('0x13')]);return _0x115eca(_0x636359['error'][_0x37d1('0x13')]);}logger[_0x37d1('0x10')]('Migration,\x20%s,\x20%s',_0x5146e3,_0x636359[_0x37d1('0x10')][_0x37d1('0x13')]);return _0x41dfaa(_0x636359['error'][_0x37d1('0x13')]);}else{logger[_0x37d1('0xc')]('Migration,\x20%s,\x20%s',_0x5146e3,'request\x20sent');_0x41dfaa(_0x636359[_0x37d1('0x14')][_0x37d1('0x13')]);}})[_0x37d1('0x15')](function(_0x5ded71){logger[_0x37d1('0x10')](_0x37d1('0x12'),_0x5146e3,_0x5ded71);_0x115eca(_0x5ded71);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 87cb839..441c570 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 _0x276d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x49e5d3,_0x24ae8b){var _0x474c9e=function(_0x208a97){while(--_0x208a97){_0x49e5d3['push'](_0x49e5d3['shift']());}};_0x474c9e(++_0x24ae8b);}(_0x276d,0xe3));var _0xd276=function(_0x58c06b,_0x1d4d91){_0x58c06b=_0x58c06b-0x0;var _0x57df11=_0x276d[_0x58c06b];return _0x57df11;};'use strict';var multer=require(_0xd276('0x0'));var util=require(_0xd276('0x1'));var path=require('path');var timeout=require(_0xd276('0x2'));var express=require(_0xd276('0x3'));var router=express[_0xd276('0x4')]();var fs_extra=require(_0xd276('0x5'));var auth=require(_0xd276('0x6'));var interaction=require(_0xd276('0x7'));var config=require('../../config/environment');var controller=require(_0xd276('0x8'));router[_0xd276('0x9')]('/',auth[_0xd276('0xa')](),controller[_0xd276('0xb')]);router[_0xd276('0x9')](_0xd276('0xc'),auth[_0xd276('0xa')](),controller[_0xd276('0xd')]);router[_0xd276('0xe')]('/',auth[_0xd276('0xa')](),controller[_0xd276('0xf')]);router[_0xd276('0x10')](_0xd276('0xc'),auth[_0xd276('0xa')](),controller[_0xd276('0x11')]);router[_0xd276('0x12')](_0xd276('0xc'),auth['isAuthenticated'](),controller[_0xd276('0x13')]);module[_0xd276('0x14')]=router; \ No newline at end of file +var _0x11f3=['put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','post','create'];(function(_0xa27b97,_0x3ecca5){var _0x5d02b7=function(_0x310378){while(--_0x310378){_0xa27b97['push'](_0xa27b97['shift']());}};_0x5d02b7(++_0x3ecca5);}(_0x11f3,0x149));var _0x311f=function(_0x41e78f,_0x4bb10e){_0x41e78f=_0x41e78f-0x0;var _0xed9006=_0x11f3[_0x41e78f];return _0xed9006;};'use strict';var multer=require(_0x311f('0x0'));var util=require(_0x311f('0x1'));var path=require(_0x311f('0x2'));var timeout=require('connect-timeout');var express=require(_0x311f('0x3'));var router=express['Router']();var fs_extra=require(_0x311f('0x4'));var auth=require(_0x311f('0x5'));var interaction=require(_0x311f('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x311f('0x7')]('/',auth['isAuthenticated'](),controller[_0x311f('0x8')]);router[_0x311f('0x7')](_0x311f('0x9'),auth[_0x311f('0xa')](),controller['show']);router[_0x311f('0xb')]('/',auth[_0x311f('0xa')](),controller[_0x311f('0xc')]);router[_0x311f('0xd')](_0x311f('0x9'),auth['isAuthenticated'](),controller[_0x311f('0xe')]);router[_0x311f('0xf')](_0x311f('0x9'),auth[_0x311f('0xa')](),controller[_0x311f('0x10')]);module[_0x311f('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 31ead9f..53a53c8 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 _0xf042=['stun','turn','STRING','ENUM','localnet','externip'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf042,0x123));var _0x2f04=function(_0x5c1b7e,_0x570ba8){_0x5c1b7e=_0x5c1b7e-0x0;var _0x1b3971=_0xf042[_0x5c1b7e];return _0x1b3971;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2f04('0x0')](_0x2f04('0x1'),_0x2f04('0x2'),_0x2f04('0x3'),_0x2f04('0x4'))},'value':{'type':Sequelize[_0x2f04('0x5')]},'username':{'type':Sequelize[_0x2f04('0x5')]},'password':{'type':Sequelize[_0x2f04('0x5')]}}; \ No newline at end of file +var _0x9664=['localnet','externip','stun','STRING','sequelize','exports'];(function(_0x9077ce,_0x4b8df3){var _0xa1a2ff=function(_0x2b128f){while(--_0x2b128f){_0x9077ce['push'](_0x9077ce['shift']());}};_0xa1a2ff(++_0x4b8df3);}(_0x9664,0x1e4));var _0x4966=function(_0x37f617,_0xdc3616){_0x37f617=_0x37f617-0x0;var _0x13a931=_0x9664[_0x37f617];return _0x13a931;};'use strict';var Sequelize=require(_0x4966('0x0'));module[_0x4966('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4966('0x2'),_0x4966('0x3'),_0x4966('0x4'),'turn')},'value':{'type':Sequelize[_0x4966('0x5')]},'username':{'type':Sequelize[_0x4966('0x5')]},'password':{'type':Sequelize[_0x4966('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index a7908d9..f6915fb 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 _0x0896=['sort','where','filter','merge','type','VIRTUAL','options','includeAll','Network','findAll','rows','show','params','include','find','create','sequelize','transaction','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','utf8','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','server/files/templates/network.ejs','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','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','json','offset','count','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','order'];(function(_0x5b2e9a,_0x50489e){var _0x247923=function(_0x211315){while(--_0x211315){_0x5b2e9a['push'](_0x5b2e9a['shift']());}};_0x247923(++_0x50489e);}(_0x0896,0xfb));var _0x6089=function(_0x2db29e,_0x124a12){_0x2db29e=_0x2db29e-0x0;var _0x30afda=_0x0896[_0x2db29e];return _0x30afda;};'use strict';var emlformat=require(_0x6089('0x0'));var rimraf=require(_0x6089('0x1'));var zipdir=require(_0x6089('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6089('0x3'));var moment=require(_0x6089('0x4'));var BPromise=require(_0x6089('0x5'));var Mustache=require(_0x6089('0x6'));var util=require(_0x6089('0x7'));var path=require(_0x6089('0x8'));var sox=require('sox');var csv=require(_0x6089('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6089('0xa'));var squel=require(_0x6089('0xb'));var crypto=require(_0x6089('0xc'));var jsforce=require(_0x6089('0xd'));var deskjs=require(_0x6089('0xe'));var toCsv=require(_0x6089('0x9'));var querystring=require(_0x6089('0xf'));var Papa=require('papaparse');var Redis=require(_0x6089('0x10'));var authService=require(_0x6089('0x11'));var qs=require(_0x6089('0x12'));var as=require(_0x6089('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6089('0x14'))(_0x6089('0x15'));var utils=require('../../config/utils');var config=require(_0x6089('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6089('0x17'))['db'];var jayson=require(_0x6089('0x18'));var client=jayson['client'][_0x6089('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x17b6d8,_0x4195c9,_0x1db414,_0x3f5623){return new BPromise(function(_0x4cd2d8,_0x1b59dc){var _0x1e121e=_0x3f5623||client;return _0x1e121e[_0x6089('0x1a')](_0x17b6d8,_0x1db414)[_0x6089('0x1b')](function(_0x9e2d98){logger[_0x6089('0x1c')](_0x6089('0x1d'),_0x4195c9,'request\x20sent');logger[_0x6089('0x1e')](_0x6089('0x1f'),_0x4195c9,_0x6089('0x20'),JSON[_0x6089('0x21')](_0x9e2d98));if(_0x9e2d98['error']){if(_0x9e2d98[_0x6089('0x22')][_0x6089('0x23')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x4195c9,_0x9e2d98[_0x6089('0x22')][_0x6089('0x24')]);return _0x1b59dc(_0x9e2d98['error']['message']);}logger[_0x6089('0x22')](_0x6089('0x1d'),_0x4195c9,_0x9e2d98[_0x6089('0x22')][_0x6089('0x24')]);return _0x4cd2d8(_0x9e2d98['error'][_0x6089('0x24')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x4195c9,_0x6089('0x20'));_0x4cd2d8(_0x9e2d98['result'][_0x6089('0x24')]);}})[_0x6089('0x25')](function(_0x33d9e4){logger['error'](_0x6089('0x1d'),_0x4195c9,_0x33d9e4);_0x1b59dc(_0x33d9e4);});});}function respondWithStatusCode(_0x4ca694,_0x271b2c){_0x271b2c=_0x271b2c||0xcc;return function(_0x1fe862){if(_0x1fe862){return _0x4ca694[_0x6089('0x26')](_0x271b2c);}return _0x4ca694[_0x6089('0x27')](_0x271b2c)['end']();};}function respondWithResult(_0x3c9e4a,_0x4bd663){_0x4bd663=_0x4bd663||0xc8;return function(_0x5206c3){if(_0x5206c3){return _0x3c9e4a[_0x6089('0x27')](_0x4bd663)[_0x6089('0x28')](_0x5206c3);}};}function respondWithFilteredResult(_0x545867,_0x5becbe){return function(_0x312269){if(_0x312269){var _0x273b28=typeof _0x5becbe[_0x6089('0x29')]==='undefined'&&typeof _0x5becbe['limit']==='undefined';var _0x495010=_0x312269[_0x6089('0x2a')];var _0x234223=_0x273b28?0x0:_0x5becbe[_0x6089('0x29')];var _0x3672b1=_0x273b28?_0x312269[_0x6089('0x2a')]:_0x5becbe[_0x6089('0x29')]+_0x5becbe[_0x6089('0x2b')];var _0x3dd771;if(_0x3672b1>=_0x495010){_0x3672b1=_0x495010;_0x3dd771=0xc8;}else{_0x3dd771=0xce;}_0x545867[_0x6089('0x27')](_0x3dd771);return _0x545867['set'](_0x6089('0x2c'),_0x234223+'-'+_0x3672b1+'/'+_0x495010)[_0x6089('0x28')](_0x312269);}return null;};}function patchUpdates(_0x16a053){return function(_0x57e2ec){try{jsonpatch[_0x6089('0x2d')](_0x57e2ec,_0x16a053,!![]);}catch(_0x35581a){return BPromise[_0x6089('0x2e')](_0x35581a);}return _0x57e2ec[_0x6089('0x2f')]();};}function saveUpdates(_0x2470fa,_0x14a1f0){return function(_0x689dd9){if(_0x689dd9){return _0x689dd9[_0x6089('0x30')](_0x2470fa)[_0x6089('0x1b')](function(_0x30d2f1){return _0x30d2f1;});}return null;};}function removeEntity(_0x58ffe7,_0x4992dc){return function(_0x502a3f){if(_0x502a3f){return _0x502a3f[_0x6089('0x31')]()['then'](function(){_0x58ffe7[_0x6089('0x27')](0xcc)[_0x6089('0x32')]();});}};}function handleEntityNotFound(_0x562d7a,_0x3abc7a){return function(_0x37de58){if(!_0x37de58){_0x562d7a[_0x6089('0x26')](0x194);}return _0x37de58;};}function handleError(_0x31b268,_0x3a7341){_0x3a7341=_0x3a7341||0x1f4;return function(_0x475383){logger['error'](_0x475383[_0x6089('0x33')]);if(_0x475383[_0x6089('0x34')]){delete _0x475383['name'];}_0x31b268[_0x6089('0x27')](_0x3a7341)['send'](_0x475383);};}exports[_0x6089('0x35')]=function(_0x14b917,_0x1f4d82){var _0xb4120={},_0x153b4d={},_0x109e45={'count':0x0,'rows':[]};var _0x4c71ff=_[_0x6089('0x36')](db['Network'][_0x6089('0x37')],function(_0x37f15d){return{'name':_0x37f15d[_0x6089('0x38')],'type':_0x37f15d['type'][_0x6089('0x39')]};});_0x153b4d['model']=_[_0x6089('0x36')](_0x4c71ff,_0x6089('0x34'));_0x153b4d[_0x6089('0x3a')]=_[_0x6089('0x3b')](_0x14b917[_0x6089('0x3a')]);_0x153b4d[_0x6089('0x3c')]=_[_0x6089('0x3d')](_0x153b4d[_0x6089('0x3e')],_0x153b4d[_0x6089('0x3a')]);_0xb4120[_0x6089('0x3f')]=_[_0x6089('0x3d')](_0x153b4d[_0x6089('0x3e')],qs[_0x6089('0x40')](_0x14b917[_0x6089('0x3a')][_0x6089('0x40')]));_0xb4120[_0x6089('0x3f')]=_0xb4120[_0x6089('0x3f')][_0x6089('0x41')]?_0xb4120[_0x6089('0x3f')]:_0x153b4d[_0x6089('0x3e')];if(!_0x14b917[_0x6089('0x3a')]['hasOwnProperty']('nolimit')){_0xb4120[_0x6089('0x2b')]=qs[_0x6089('0x2b')](_0x14b917[_0x6089('0x3a')][_0x6089('0x2b')]);_0xb4120[_0x6089('0x29')]=qs['offset'](_0x14b917[_0x6089('0x3a')][_0x6089('0x29')]);}_0xb4120[_0x6089('0x42')]=qs[_0x6089('0x43')](_0x14b917[_0x6089('0x3a')][_0x6089('0x43')]);_0xb4120[_0x6089('0x44')]=qs[_0x6089('0x3c')](_['pick'](_0x14b917[_0x6089('0x3a')],_0x153b4d[_0x6089('0x3c')]),_0x4c71ff);if(_0x14b917[_0x6089('0x3a')][_0x6089('0x45')]){_0xb4120[_0x6089('0x44')]=_[_0x6089('0x46')](_0xb4120['where'],{'$or':_[_0x6089('0x36')](_0x4c71ff,function(_0x3c9e72){if(_0x3c9e72[_0x6089('0x47')]!==_0x6089('0x48')){var _0x1fe738={};_0x1fe738[_0x3c9e72[_0x6089('0x34')]]={'$like':'%'+_0x14b917['query']['filter']+'%'};return _0x1fe738;}})});}_0xb4120=_[_0x6089('0x46')]({},_0xb4120,_0x14b917[_0x6089('0x49')]);var _0x209af2={'where':_0xb4120[_0x6089('0x44')]};return db['Network'][_0x6089('0x2a')](_0x209af2)[_0x6089('0x1b')](function(_0x45623f){_0x109e45['count']=_0x45623f;if(_0x14b917[_0x6089('0x3a')][_0x6089('0x4a')]){_0xb4120['include']=[{'all':!![]}];}return db[_0x6089('0x4b')][_0x6089('0x4c')](_0xb4120);})[_0x6089('0x1b')](function(_0x1c4710){_0x109e45[_0x6089('0x4d')]=_0x1c4710;return _0x109e45;})[_0x6089('0x1b')](respondWithFilteredResult(_0x1f4d82,_0xb4120))[_0x6089('0x25')](handleError(_0x1f4d82,null));};exports[_0x6089('0x4e')]=function(_0x2b80b8,_0x33d529){var _0x973631={'raw':!![],'where':{'id':_0x2b80b8[_0x6089('0x4f')]['id']}},_0x9cdd4={};_0x9cdd4[_0x6089('0x3e')]=_['keys'](db[_0x6089('0x4b')]['rawAttributes']);_0x9cdd4['query']=_[_0x6089('0x3b')](_0x2b80b8['query']);_0x9cdd4['filters']=_[_0x6089('0x3d')](_0x9cdd4[_0x6089('0x3e')],_0x9cdd4[_0x6089('0x3a')]);_0x973631['attributes']=_[_0x6089('0x3d')](_0x9cdd4[_0x6089('0x3e')],qs[_0x6089('0x40')](_0x2b80b8[_0x6089('0x3a')]['fields']));_0x973631[_0x6089('0x3f')]=_0x973631[_0x6089('0x3f')]['length']?_0x973631['attributes']:_0x9cdd4[_0x6089('0x3e')];if(_0x2b80b8[_0x6089('0x3a')][_0x6089('0x4a')]){_0x973631[_0x6089('0x50')]=[{'all':!![]}];}_0x973631=_[_0x6089('0x46')]({},_0x973631,_0x2b80b8['options']);return db[_0x6089('0x4b')][_0x6089('0x51')](_0x973631)[_0x6089('0x1b')](handleEntityNotFound(_0x33d529,null))['then'](respondWithResult(_0x33d529,null))[_0x6089('0x25')](handleError(_0x33d529,null));};exports[_0x6089('0x52')]=function(_0x596de6,_0x59845a,_0x502d66){var _0x415502;return db[_0x6089('0x53')][_0x6089('0x54')](function(_0x5ee1ad){return db[_0x6089('0x4b')][_0x6089('0x52')](_0x596de6[_0x6089('0x55')],{'raw':!![]})[_0x6089('0x1b')](function(_0x53a974){_0x415502=_0x53a974;return db[_0x6089('0x4b')]['findAll']({'where':{'type':_0x596de6[_0x6089('0x55')][_0x6089('0x47')]},'raw':!![]});})[_0x6089('0x1b')](function(_0x4295af){if(_0x415502[_0x6089('0x47')][_0x6089('0x56')]()==_0x6089('0x57')){var _0x287d05=fs['readFileSync'](path[_0x6089('0x58')](config[_0x6089('0x59')],_0x6089('0x5a')),'utf8');var _0x1f8f56=ejs[_0x6089('0x5b')](_0x287d05,{'networks':_0x4295af||[]});fs['writeFileSync'](_0x6089('0x5c'),_0x1f8f56);return respondWithRpcPromise(_0x6089('0x5d'),_0x6089('0x52'),{'module':_0x6089('0x5e')});}else if(_0x415502['type']['toUpperCase']()==_0x6089('0x5f')){var _0x2985d0=fs[_0x6089('0x60')](path[_0x6089('0x58')](config[_0x6089('0x59')],_0x6089('0x61')),'utf8');var _0x492bc6=ejs[_0x6089('0x5b')](_0x2985d0,{'networks':_0x4295af||[]});fs[_0x6089('0x62')](_0x6089('0x63'),_0x492bc6);return respondWithRpcPromise(_0x6089('0x5d'),_0x6089('0x52'),{'module':'res_stun_monitor.so'});}else{var _0x5e4fad=fs['readFileSync'](path[_0x6089('0x58')](config[_0x6089('0x59')],'server/files/templates/network.ejs'),_0x6089('0x64'));var _0x2b7ec1=ejs[_0x6089('0x5b')](_0x5e4fad,{'networks':_0x4295af||[]});fs[_0x6089('0x62')](util[_0x6089('0x65')](_0x6089('0x66'),_0x596de6[_0x6089('0x55')][_0x6089('0x47')]['toLowerCase']()),_0x2b7ec1);return respondWithRpcPromise(_0x6089('0x5d'),_0x6089('0x52'),{'module':_0x6089('0x67')});}return null;})[_0x6089('0x1b')](function(){return _0x415502;});})['then'](respondWithResult(_0x59845a,0xc9))[_0x6089('0x25')](handleError(_0x59845a,null));};exports[_0x6089('0x30')]=function(_0x52f6f9,_0x145be7,_0x744512){var _0x2520f8;return db[_0x6089('0x53')][_0x6089('0x54')](function(_0x38d6eb){return db['Network']['find']({'where':{'id':_0x52f6f9[_0x6089('0x4f')]['id']}})['then'](handleEntityNotFound(_0x145be7,null))[_0x6089('0x1b')](saveUpdates(_0x52f6f9['body'],null))[_0x6089('0x1b')](function(_0x4e5477){if(_0x4e5477){_0x2520f8=_0x4e5477;return db['Network']['findAll']({'where':{'type':_0x2520f8[_0x6089('0x47')]},'raw':!![]});}return null;})[_0x6089('0x1b')](function(_0xd08f98){if(_0x2520f8['type']['toUpperCase']()==_0x6089('0x57')){var _0x57f530=fs[_0x6089('0x60')](path[_0x6089('0x58')](config[_0x6089('0x59')],_0x6089('0x5a')),_0x6089('0x64'));var _0x41ea79=ejs[_0x6089('0x5b')](_0x57f530,{'networks':_0xd08f98||[]});fs[_0x6089('0x62')](_0x6089('0x5c'),_0x41ea79);return respondWithRpcPromise(_0x6089('0x5d'),_0x6089('0x30'),{'module':_0x6089('0x5e')});}else if(_0x2520f8['type'][_0x6089('0x56')]()==_0x6089('0x5f')){var _0x178f98=fs[_0x6089('0x60')](path['join'](config[_0x6089('0x59')],_0x6089('0x61')),_0x6089('0x64'));var _0x5b6da0=ejs['render'](_0x178f98,{'networks':_0xd08f98||[]});fs[_0x6089('0x62')](_0x6089('0x63'),_0x5b6da0);return respondWithRpcPromise(_0x6089('0x5d'),'update',{'module':_0x6089('0x5e')});}else{var _0xf0106a=fs['readFileSync'](path[_0x6089('0x58')](config[_0x6089('0x59')],_0x6089('0x68')),'utf8');var _0x43d706=ejs[_0x6089('0x5b')](_0xf0106a,{'networks':_0xd08f98||[]});fs['writeFileSync'](util[_0x6089('0x65')](_0x6089('0x66'),_0x52f6f9[_0x6089('0x55')]['type'][_0x6089('0x69')]()),_0x43d706);return respondWithRpcPromise('Reload',_0x6089('0x30'),{'module':'chan_sip.so'});}return null;})[_0x6089('0x1b')](function(_0x4ee222){if(_0x4ee222){return _0x2520f8;}return null;});})[_0x6089('0x1b')](respondWithResult(_0x145be7,null))[_0x6089('0x25')](handleError(_0x145be7,null));};exports[_0x6089('0x31')]=function(_0x3b9104,_0x3187d6,_0x4fd3bd){var _0x50f9ab;return db['Network']['find']({'where':{'id':_0x3b9104[_0x6089('0x4f')]['id']}})['then'](function(_0x2d03f7){_0x50f9ab=_0x2d03f7;return _0x2d03f7;})['then'](handleEntityNotFound(_0x3187d6,null))[_0x6089('0x1b')](removeEntity(_0x3187d6,null))[_0x6089('0x1b')](function(){if(_0x50f9ab){return db[_0x6089('0x4b')][_0x6089('0x4c')]({'where':{'type':_0x50f9ab[_0x6089('0x47')]},'raw':!![]});}})['then'](function(_0x165070){if(_0x50f9ab['type'][_0x6089('0x56')]()==_0x6089('0x57')){var _0x21e79f=fs['readFileSync'](path['join'](config[_0x6089('0x59')],_0x6089('0x5a')),_0x6089('0x64'));var _0x38137b=ejs['render'](_0x21e79f,{'networks':_0x165070||[]});fs['writeFileSync'](_0x6089('0x5c'),_0x38137b);return respondWithRpcPromise('Reload',_0x6089('0x31'),{'module':_0x6089('0x5e')});}else if(_0x50f9ab[_0x6089('0x47')][_0x6089('0x56')]()==_0x6089('0x5f')){var _0x48df68=fs[_0x6089('0x60')](path[_0x6089('0x58')](config['root'],_0x6089('0x61')),_0x6089('0x64'));var _0x1006e4=ejs[_0x6089('0x5b')](_0x48df68,{'networks':_0x165070||[]});fs[_0x6089('0x62')](_0x6089('0x63'),_0x1006e4);return respondWithRpcPromise('Reload','destroy',{'module':_0x6089('0x5e')});}else{var _0x22e434=fs['readFileSync'](path[_0x6089('0x58')](config['root'],_0x6089('0x68')),_0x6089('0x64'));var _0x127e8e=ejs[_0x6089('0x5b')](_0x22e434,{'networks':_0x165070||[]});fs['writeFileSync'](util[_0x6089('0x65')](_0x6089('0x66'),_0x3b9104[_0x6089('0x55')]['type'][_0x6089('0x69')]()),_0x127e8e);return respondWithRpcPromise(_0x6089('0x5d'),_0x6089('0x31'),{'module':_0x6089('0x67')});}return null;})[_0x6089('0x25')](handleError(_0x3187d6,null));}; \ No newline at end of file +var _0x901c=['reject','update','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','sequelize','transaction','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','find','server/files/templates/network.ejs','toLowerCase','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply'];(function(_0x4dcc7b,_0x2e2cea){var _0x4023b6=function(_0x15da99){while(--_0x15da99){_0x4dcc7b['push'](_0x4dcc7b['shift']());}};_0x4023b6(++_0x2e2cea);}(_0x901c,0x119));var _0xc901=function(_0x3a626f,_0x38a708){_0x3a626f=_0x3a626f-0x0;var _0x4d9fe8=_0x901c[_0x3a626f];return _0x4d9fe8;};'use strict';var emlformat=require(_0xc901('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc901('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc901('0x2'));var moment=require(_0xc901('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc901('0x4'));var util=require(_0xc901('0x5'));var path=require('path');var sox=require(_0xc901('0x6'));var csv=require(_0xc901('0x7'));var ejs=require(_0xc901('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc901('0x9'));var squel=require(_0xc901('0xa'));var crypto=require(_0xc901('0xb'));var jsforce=require(_0xc901('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc901('0x7'));var querystring=require(_0xc901('0xd'));var Papa=require(_0xc901('0xe'));var Redis=require(_0xc901('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc901('0x10'));var as=require(_0xc901('0x11'));var hardwareService=require(_0xc901('0x12'));var logger=require(_0xc901('0x13'))(_0xc901('0x14'));var utils=require(_0xc901('0x15'));var config=require(_0xc901('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc901('0x17'))['db'];var jayson=require(_0xc901('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4107e0,_0x1433d1,_0x1321cc,_0x3da5d6){return new BPromise(function(_0x41811c,_0x491266){var _0x1d6e3=_0x3da5d6||client;return _0x1d6e3[_0xc901('0x19')](_0x4107e0,_0x1321cc)[_0xc901('0x1a')](function(_0x23311){logger['info'](_0xc901('0x1b'),_0x1433d1,_0xc901('0x1c'));logger[_0xc901('0x1d')](_0xc901('0x1e'),_0x1433d1,_0xc901('0x1c'),JSON['stringify'](_0x23311));if(_0x23311[_0xc901('0x1f')]){if(_0x23311[_0xc901('0x1f')][_0xc901('0x20')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x1433d1,_0x23311[_0xc901('0x1f')][_0xc901('0x21')]);return _0x491266(_0x23311[_0xc901('0x1f')][_0xc901('0x21')]);}logger[_0xc901('0x1f')]('Network,\x20%s,\x20%s',_0x1433d1,_0x23311[_0xc901('0x1f')]['message']);return _0x41811c(_0x23311[_0xc901('0x1f')][_0xc901('0x21')]);}else{logger['info'](_0xc901('0x1b'),_0x1433d1,_0xc901('0x1c'));_0x41811c(_0x23311[_0xc901('0x22')][_0xc901('0x21')]);}})['catch'](function(_0x45e105){logger[_0xc901('0x1f')](_0xc901('0x1b'),_0x1433d1,_0x45e105);_0x491266(_0x45e105);});});}function respondWithStatusCode(_0x39b377,_0xbdd510){_0xbdd510=_0xbdd510||0xcc;return function(_0x370a79){if(_0x370a79){return _0x39b377[_0xc901('0x23')](_0xbdd510);}return _0x39b377['status'](_0xbdd510)[_0xc901('0x24')]();};}function respondWithResult(_0xf0891b,_0x22baa0){_0x22baa0=_0x22baa0||0xc8;return function(_0x2023d1){if(_0x2023d1){return _0xf0891b['status'](_0x22baa0)[_0xc901('0x25')](_0x2023d1);}};}function respondWithFilteredResult(_0x3a1062,_0x53b622){return function(_0x4e3d61){if(_0x4e3d61){var _0x40df93=typeof _0x53b622[_0xc901('0x26')]===_0xc901('0x27')&&typeof _0x53b622[_0xc901('0x28')]===_0xc901('0x27');var _0x240b8a=_0x4e3d61[_0xc901('0x29')];var _0x54cb5a=_0x40df93?0x0:_0x53b622[_0xc901('0x26')];var _0x88343f=_0x40df93?_0x4e3d61['count']:_0x53b622[_0xc901('0x26')]+_0x53b622['limit'];var _0x14ead1;if(_0x88343f>=_0x240b8a){_0x88343f=_0x240b8a;_0x14ead1=0xc8;}else{_0x14ead1=0xce;}_0x3a1062[_0xc901('0x2a')](_0x14ead1);return _0x3a1062[_0xc901('0x2b')](_0xc901('0x2c'),_0x54cb5a+'-'+_0x88343f+'/'+_0x240b8a)['json'](_0x4e3d61);}return null;};}function patchUpdates(_0x2228fc){return function(_0x51492e){try{jsonpatch[_0xc901('0x2d')](_0x51492e,_0x2228fc,!![]);}catch(_0x4282eb){return BPromise[_0xc901('0x2e')](_0x4282eb);}return _0x51492e['save']();};}function saveUpdates(_0x29af5d,_0x2bc928){return function(_0x5a53d2){if(_0x5a53d2){return _0x5a53d2[_0xc901('0x2f')](_0x29af5d)['then'](function(_0x5873c3){return _0x5873c3;});}return null;};}function removeEntity(_0x45cb31,_0x181ab5){return function(_0x594201){if(_0x594201){return _0x594201[_0xc901('0x30')]()[_0xc901('0x1a')](function(){_0x45cb31[_0xc901('0x2a')](0xcc)[_0xc901('0x24')]();});}};}function handleEntityNotFound(_0x53af8f,_0x4ae033){return function(_0xbcf3f3){if(!_0xbcf3f3){_0x53af8f[_0xc901('0x23')](0x194);}return _0xbcf3f3;};}function handleError(_0x34e8a0,_0x31a4ac){_0x31a4ac=_0x31a4ac||0x1f4;return function(_0x374346){logger[_0xc901('0x1f')](_0x374346[_0xc901('0x31')]);if(_0x374346[_0xc901('0x32')]){delete _0x374346['name'];}_0x34e8a0[_0xc901('0x2a')](_0x31a4ac)[_0xc901('0x33')](_0x374346);};}exports[_0xc901('0x34')]=function(_0x1547ae,_0x2ec6ec){var _0x3eecfa={},_0x5c4c91={},_0x4476ed={'count':0x0,'rows':[]};var _0x2f4d7f=_[_0xc901('0x35')](db[_0xc901('0x36')][_0xc901('0x37')],function(_0x38a779){return{'name':_0x38a779[_0xc901('0x38')],'type':_0x38a779[_0xc901('0x39')][_0xc901('0x3a')]};});_0x5c4c91['model']=_[_0xc901('0x35')](_0x2f4d7f,_0xc901('0x32'));_0x5c4c91['query']=_[_0xc901('0x3b')](_0x1547ae['query']);_0x5c4c91[_0xc901('0x3c')]=_['intersection'](_0x5c4c91[_0xc901('0x3d')],_0x5c4c91[_0xc901('0x3e')]);_0x3eecfa[_0xc901('0x3f')]=_[_0xc901('0x40')](_0x5c4c91[_0xc901('0x3d')],qs[_0xc901('0x41')](_0x1547ae[_0xc901('0x3e')][_0xc901('0x41')]));_0x3eecfa[_0xc901('0x3f')]=_0x3eecfa[_0xc901('0x3f')][_0xc901('0x42')]?_0x3eecfa[_0xc901('0x3f')]:_0x5c4c91['model'];if(!_0x1547ae[_0xc901('0x3e')][_0xc901('0x43')](_0xc901('0x44'))){_0x3eecfa[_0xc901('0x28')]=qs[_0xc901('0x28')](_0x1547ae['query'][_0xc901('0x28')]);_0x3eecfa[_0xc901('0x26')]=qs[_0xc901('0x26')](_0x1547ae[_0xc901('0x3e')][_0xc901('0x26')]);}_0x3eecfa[_0xc901('0x45')]=qs[_0xc901('0x46')](_0x1547ae[_0xc901('0x3e')][_0xc901('0x46')]);_0x3eecfa[_0xc901('0x47')]=qs[_0xc901('0x3c')](_[_0xc901('0x48')](_0x1547ae[_0xc901('0x3e')],_0x5c4c91[_0xc901('0x3c')]),_0x2f4d7f);if(_0x1547ae[_0xc901('0x3e')][_0xc901('0x49')]){_0x3eecfa[_0xc901('0x47')]=_[_0xc901('0x4a')](_0x3eecfa[_0xc901('0x47')],{'$or':_[_0xc901('0x35')](_0x2f4d7f,function(_0x5f4838){if(_0x5f4838[_0xc901('0x39')]!==_0xc901('0x4b')){var _0x95176d={};_0x95176d[_0x5f4838[_0xc901('0x32')]]={'$like':'%'+_0x1547ae[_0xc901('0x3e')][_0xc901('0x49')]+'%'};return _0x95176d;}})});}_0x3eecfa=_[_0xc901('0x4a')]({},_0x3eecfa,_0x1547ae[_0xc901('0x4c')]);var _0x2c468a={'where':_0x3eecfa['where']};return db[_0xc901('0x36')][_0xc901('0x29')](_0x2c468a)[_0xc901('0x1a')](function(_0x38957e){_0x4476ed[_0xc901('0x29')]=_0x38957e;if(_0x1547ae[_0xc901('0x3e')][_0xc901('0x4d')]){_0x3eecfa[_0xc901('0x4e')]=[{'all':!![]}];}return db[_0xc901('0x36')][_0xc901('0x4f')](_0x3eecfa);})[_0xc901('0x1a')](function(_0x226457){_0x4476ed[_0xc901('0x50')]=_0x226457;return _0x4476ed;})[_0xc901('0x1a')](respondWithFilteredResult(_0x2ec6ec,_0x3eecfa))[_0xc901('0x51')](handleError(_0x2ec6ec,null));};exports[_0xc901('0x52')]=function(_0xbcb8fe,_0x3332bd){var _0x82f159={'raw':!![],'where':{'id':_0xbcb8fe[_0xc901('0x53')]['id']}},_0x5e42ed={};_0x5e42ed[_0xc901('0x3d')]=_[_0xc901('0x3b')](db[_0xc901('0x36')][_0xc901('0x37')]);_0x5e42ed['query']=_[_0xc901('0x3b')](_0xbcb8fe[_0xc901('0x3e')]);_0x5e42ed[_0xc901('0x3c')]=_[_0xc901('0x40')](_0x5e42ed['model'],_0x5e42ed[_0xc901('0x3e')]);_0x82f159[_0xc901('0x3f')]=_[_0xc901('0x40')](_0x5e42ed[_0xc901('0x3d')],qs['fields'](_0xbcb8fe[_0xc901('0x3e')][_0xc901('0x41')]));_0x82f159[_0xc901('0x3f')]=_0x82f159['attributes'][_0xc901('0x42')]?_0x82f159[_0xc901('0x3f')]:_0x5e42ed[_0xc901('0x3d')];if(_0xbcb8fe[_0xc901('0x3e')][_0xc901('0x4d')]){_0x82f159['include']=[{'all':!![]}];}_0x82f159=_[_0xc901('0x4a')]({},_0x82f159,_0xbcb8fe[_0xc901('0x4c')]);return db[_0xc901('0x36')]['find'](_0x82f159)[_0xc901('0x1a')](handleEntityNotFound(_0x3332bd,null))[_0xc901('0x1a')](respondWithResult(_0x3332bd,null))['catch'](handleError(_0x3332bd,null));};exports['create']=function(_0x3517bc,_0xec6e6d,_0x54182d){var _0x1008d6;return db[_0xc901('0x54')][_0xc901('0x55')](function(_0x330e0d){return db[_0xc901('0x36')][_0xc901('0x56')](_0x3517bc['body'],{'raw':!![]})['then'](function(_0x1c1856){_0x1008d6=_0x1c1856;return db[_0xc901('0x36')]['findAll']({'where':{'type':_0x3517bc[_0xc901('0x57')][_0xc901('0x39')]},'raw':!![]});})[_0xc901('0x1a')](function(_0x5eb237){if(_0x1008d6['type'][_0xc901('0x58')]()==_0xc901('0x59')){var _0x4158b4=fs[_0xc901('0x5a')](path[_0xc901('0x5b')](config[_0xc901('0x5c')],_0xc901('0x5d')),_0xc901('0x5e'));var _0xaab37a=ejs[_0xc901('0x5f')](_0x4158b4,{'networks':_0x5eb237||[]});fs['writeFileSync'](_0xc901('0x60'),_0xaab37a);return respondWithRpcPromise(_0xc901('0x61'),'create',{'module':'res_stun_monitor.so'});}else if(_0x1008d6[_0xc901('0x39')][_0xc901('0x58')]()==_0xc901('0x62')){var _0x154526=fs[_0xc901('0x5a')](path[_0xc901('0x5b')](config[_0xc901('0x5c')],_0xc901('0x63')),_0xc901('0x5e'));var _0x229278=ejs[_0xc901('0x5f')](_0x154526,{'networks':_0x5eb237||[]});fs[_0xc901('0x64')](_0xc901('0x65'),_0x229278);return respondWithRpcPromise(_0xc901('0x61'),_0xc901('0x56'),{'module':_0xc901('0x66')});}else{var _0x4b3d3e=fs[_0xc901('0x5a')](path[_0xc901('0x5b')](config[_0xc901('0x5c')],'server/files/templates/network.ejs'),_0xc901('0x5e'));var _0x380c26=ejs[_0xc901('0x5f')](_0x4b3d3e,{'networks':_0x5eb237||[]});fs[_0xc901('0x64')](util[_0xc901('0x67')](_0xc901('0x68'),_0x3517bc[_0xc901('0x57')][_0xc901('0x39')]['toLowerCase']()),_0x380c26);return respondWithRpcPromise(_0xc901('0x61'),_0xc901('0x56'),{'module':_0xc901('0x69')});}return null;})[_0xc901('0x1a')](function(){return _0x1008d6;});})[_0xc901('0x1a')](respondWithResult(_0xec6e6d,0xc9))['catch'](handleError(_0xec6e6d,null));};exports[_0xc901('0x2f')]=function(_0x342d18,_0x5b9ae3,_0x4e43d0){var _0x1b8302;return db[_0xc901('0x54')]['transaction'](function(_0x3bd8d9){return db['Network'][_0xc901('0x6a')]({'where':{'id':_0x342d18['params']['id']}})['then'](handleEntityNotFound(_0x5b9ae3,null))['then'](saveUpdates(_0x342d18[_0xc901('0x57')],null))[_0xc901('0x1a')](function(_0x4d2ecf){if(_0x4d2ecf){_0x1b8302=_0x4d2ecf;return db['Network'][_0xc901('0x4f')]({'where':{'type':_0x1b8302[_0xc901('0x39')]},'raw':!![]});}return null;})[_0xc901('0x1a')](function(_0x4938dc){if(_0x1b8302[_0xc901('0x39')]['toUpperCase']()==_0xc901('0x59')){var _0x467e6c=fs['readFileSync'](path[_0xc901('0x5b')](config[_0xc901('0x5c')],_0xc901('0x5d')),_0xc901('0x5e'));var _0x2b549b=ejs['render'](_0x467e6c,{'networks':_0x4938dc||[]});fs[_0xc901('0x64')]('/etc/asterisk/stun_xcally.conf',_0x2b549b);return respondWithRpcPromise(_0xc901('0x61'),_0xc901('0x2f'),{'module':_0xc901('0x66')});}else if(_0x1b8302[_0xc901('0x39')][_0xc901('0x58')]()==_0xc901('0x62')){var _0x1b9d4b=fs[_0xc901('0x5a')](path[_0xc901('0x5b')](config['root'],_0xc901('0x63')),'utf8');var _0x3a33ec=ejs[_0xc901('0x5f')](_0x1b9d4b,{'networks':_0x4938dc||[]});fs[_0xc901('0x64')](_0xc901('0x65'),_0x3a33ec);return respondWithRpcPromise(_0xc901('0x61'),_0xc901('0x2f'),{'module':_0xc901('0x66')});}else{var _0x1f1566=fs[_0xc901('0x5a')](path[_0xc901('0x5b')](config[_0xc901('0x5c')],_0xc901('0x6b')),_0xc901('0x5e'));var _0xfba55e=ejs[_0xc901('0x5f')](_0x1f1566,{'networks':_0x4938dc||[]});fs[_0xc901('0x64')](util['format'](_0xc901('0x68'),_0x342d18[_0xc901('0x57')][_0xc901('0x39')][_0xc901('0x6c')]()),_0xfba55e);return respondWithRpcPromise(_0xc901('0x61'),_0xc901('0x2f'),{'module':_0xc901('0x69')});}return null;})[_0xc901('0x1a')](function(_0xb20d34){if(_0xb20d34){return _0x1b8302;}return null;});})[_0xc901('0x1a')](respondWithResult(_0x5b9ae3,null))[_0xc901('0x51')](handleError(_0x5b9ae3,null));};exports[_0xc901('0x30')]=function(_0x32c290,_0x5440a7,_0x1d8a12){var _0x1dcd75;return db[_0xc901('0x36')][_0xc901('0x6a')]({'where':{'id':_0x32c290[_0xc901('0x53')]['id']}})[_0xc901('0x1a')](function(_0x50143c){_0x1dcd75=_0x50143c;return _0x50143c;})[_0xc901('0x1a')](handleEntityNotFound(_0x5440a7,null))[_0xc901('0x1a')](removeEntity(_0x5440a7,null))['then'](function(){if(_0x1dcd75){return db[_0xc901('0x36')][_0xc901('0x4f')]({'where':{'type':_0x1dcd75[_0xc901('0x39')]},'raw':!![]});}})['then'](function(_0x5b54c7){if(_0x1dcd75[_0xc901('0x39')]['toUpperCase']()=='STUN'){var _0x53119c=fs[_0xc901('0x5a')](path['join'](config[_0xc901('0x5c')],'server/files/templates/stun_multiple.ejs'),_0xc901('0x5e'));var _0x5af3a2=ejs['render'](_0x53119c,{'networks':_0x5b54c7||[]});fs[_0xc901('0x64')](_0xc901('0x60'),_0x5af3a2);return respondWithRpcPromise('Reload',_0xc901('0x30'),{'module':_0xc901('0x66')});}else if(_0x1dcd75[_0xc901('0x39')][_0xc901('0x58')]()==_0xc901('0x62')){var _0x331079=fs[_0xc901('0x5a')](path['join'](config[_0xc901('0x5c')],_0xc901('0x63')),_0xc901('0x5e'));var _0x175c94=ejs[_0xc901('0x5f')](_0x331079,{'networks':_0x5b54c7||[]});fs['writeFileSync'](_0xc901('0x65'),_0x175c94);return respondWithRpcPromise(_0xc901('0x61'),_0xc901('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x42b5ee=fs[_0xc901('0x5a')](path[_0xc901('0x5b')](config['root'],_0xc901('0x6b')),_0xc901('0x5e'));var _0x2207b7=ejs[_0xc901('0x5f')](_0x42b5ee,{'networks':_0x5b54c7||[]});fs[_0xc901('0x64')](util['format'](_0xc901('0x68'),_0x32c290[_0xc901('0x57')][_0xc901('0x39')]['toLowerCase']()),_0x2207b7);return respondWithRpcPromise(_0xc901('0x61'),_0xc901('0x30'),{'module':_0xc901('0x69')});}return null;})[_0xc901('0x51')](handleError(_0x5440a7,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f146d3f..11fc694 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 _0x222f=['define','network','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3acf13,_0x101871){var _0x4f5fa8=function(_0x5636dd){while(--_0x5636dd){_0x3acf13['push'](_0x3acf13['shift']());}};_0x4f5fa8(++_0x101871);}(_0x222f,0x1a4));var _0xf222=function(_0x19fec1,_0x1cc62f){_0x19fec1=_0x19fec1-0x0;var _0x29cd35=_0x222f[_0x19fec1];return _0x29cd35;};'use strict';var _=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf222('0x4'));var fs=require('fs');var path=require(_0xf222('0x5'));var rimraf=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var attributes=require('./network.attributes');module[_0xf222('0x8')]=function(_0x54a758,_0x112e6d){return _0x54a758[_0xf222('0x9')]('Network',attributes,{'tableName':_0xf222('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe28e=['rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x45d75b,_0x523780){var _0x73e563=function(_0x1c9ccd){while(--_0x1c9ccd){_0x45d75b['push'](_0x45d75b['shift']());}};_0x73e563(++_0x523780);}(_0xe28e,0x1ba));var _0xee28=function(_0x55e0dd,_0x366910){_0x55e0dd=_0x55e0dd-0x0;var _0x2b1616=_0xe28e[_0x55e0dd];return _0x2b1616;};'use strict';var _=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var logger=require(_0xee28('0x2'))(_0xee28('0x3'));var moment=require(_0xee28('0x4'));var BPromise=require(_0xee28('0x5'));var rp=require(_0xee28('0x6'));var fs=require('fs');var path=require(_0xee28('0x7'));var rimraf=require(_0xee28('0x8'));var config=require(_0xee28('0x9'));var attributes=require(_0xee28('0xa'));module[_0xee28('0xb')]=function(_0x162d3f,_0x48e72f){return _0x162d3f[_0xee28('0xc')](_0xee28('0xd'),attributes,{'tableName':_0xee28('0xe'),'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 5549c20..2286efb 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1dd63a,_0x3e205a){_0x1dd63a=_0x1dd63a-0x0;var _0x394d15=_0x7a54[_0x1dd63a];return _0x394d15;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x1c7ce2,_0x3d299e){_0x1c7ce2=_0x1c7ce2-0x0;var _0x377cc7=_0x7a54[_0x1c7ce2];return _0x377cc7;};'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 4f28167..c5be3ca 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 _0xb5b3=['isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','getApplications','/:id/interactions','getInteractions','/:id/users','addDisposition','post','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','send','put','delete','destroy','removeDispositions','removeAgents','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x34a089,_0x3585c4){var _0x12784e=function(_0x3a5fd0){while(--_0x3a5fd0){_0x34a089['push'](_0x34a089['shift']());}};_0x12784e(++_0x3585c4);}(_0xb5b3,0xec));var _0x3b5b=function(_0x36c6e8,_0x3874da){_0x36c6e8=_0x36c6e8-0x0;var _0x18031=_0xb5b3[_0x36c6e8];return _0x18031;};'use strict';var multer=require(_0x3b5b('0x0'));var util=require('util');var path=require(_0x3b5b('0x1'));var timeout=require('connect-timeout');var express=require(_0x3b5b('0x2'));var router=express['Router']();var fs_extra=require(_0x3b5b('0x3'));var auth=require(_0x3b5b('0x4'));var interaction=require(_0x3b5b('0x5'));var config=require(_0x3b5b('0x6'));var controller=require(_0x3b5b('0x7'));router[_0x3b5b('0x8')]('/',auth[_0x3b5b('0x9')](),controller[_0x3b5b('0xa')]);router[_0x3b5b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x3b5b('0xb')]);router[_0x3b5b('0x8')](_0x3b5b('0xc'),auth['isAuthenticated'](),controller[_0x3b5b('0xd')]);router[_0x3b5b('0x8')](_0x3b5b('0xe'),auth[_0x3b5b('0x9')](),controller[_0x3b5b('0xf')]);router[_0x3b5b('0x8')]('/:id/canned_answers',auth[_0x3b5b('0x9')](),controller['getAnswers']);router[_0x3b5b('0x8')]('/:id/applications',auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x10')]);router[_0x3b5b('0x8')](_0x3b5b('0x11'),auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x12')]);router['get'](_0x3b5b('0x13'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x3b5b('0x9')](),controller['create']);router['post'](_0x3b5b('0xe'),auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x14')]);router[_0x3b5b('0x15')](_0x3b5b('0x16'),auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x17')]);router['post'](_0x3b5b('0x18'),controller[_0x3b5b('0x19')]);router['post'](_0x3b5b('0x1a'),auth['isAuthenticated'](),controller[_0x3b5b('0x1b')]);router['post'](_0x3b5b('0x13'),auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x1c')]);router['post']('/:id/send',auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x1d')]);router[_0x3b5b('0x1e')]('/:id',auth[_0x3b5b('0x9')](),controller['update']);router[_0x3b5b('0x1f')]('/:id',auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x20')]);router[_0x3b5b('0x1f')](_0x3b5b('0xe'),auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x21')]);router[_0x3b5b('0x1f')](_0x3b5b('0x16'),auth[_0x3b5b('0x9')](),controller['removeAnswers']);router[_0x3b5b('0x1f')]('/:id/users',auth[_0x3b5b('0x9')](),controller[_0x3b5b('0x22')]);module['exports']=router; \ No newline at end of file +var _0xf0f9=['exports','multer','util','path','express','fs-extra','../../components/auth/service','./openchannelAccount.controller','get','index','/describe','isAuthenticated','/:id','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeAnswers'];(function(_0x3277e2,_0x48673f){var _0x59054d=function(_0x1ab863){while(--_0x1ab863){_0x3277e2['push'](_0x3277e2['shift']());}};_0x59054d(++_0x48673f);}(_0xf0f9,0x1a5));var _0x9f0f=function(_0x5a8d86,_0x4409aa){_0x5a8d86=_0x5a8d86-0x0;var _0x3820ec=_0xf0f9[_0x5a8d86];return _0x3820ec;};'use strict';var multer=require(_0x9f0f('0x0'));var util=require(_0x9f0f('0x1'));var path=require(_0x9f0f('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f0f('0x3'));var router=express['Router']();var fs_extra=require(_0x9f0f('0x4'));var auth=require(_0x9f0f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f0f('0x6'));router[_0x9f0f('0x7')]('/',auth['isAuthenticated'](),controller[_0x9f0f('0x8')]);router[_0x9f0f('0x7')](_0x9f0f('0x9'),auth[_0x9f0f('0xa')](),controller['describe']);router[_0x9f0f('0x7')](_0x9f0f('0xb'),auth[_0x9f0f('0xa')](),controller['show']);router[_0x9f0f('0x7')]('/:id/dispositions',auth[_0x9f0f('0xa')](),controller[_0x9f0f('0xc')]);router[_0x9f0f('0x7')](_0x9f0f('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x9f0f('0xe'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0xf')]);router['get'](_0x9f0f('0x10'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x11')]);router[_0x9f0f('0x7')](_0x9f0f('0x12'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x13')]);router[_0x9f0f('0x14')]('/',auth['isAuthenticated'](),controller[_0x9f0f('0x15')]);router[_0x9f0f('0x14')](_0x9f0f('0x16'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x17')]);router[_0x9f0f('0x14')]('/:id/canned_answers',auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x18')]);router[_0x9f0f('0x14')]('/:id/notify',controller[_0x9f0f('0x19')]);router[_0x9f0f('0x14')](_0x9f0f('0xe'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x1a')]);router['post'](_0x9f0f('0x12'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x1b')]);router[_0x9f0f('0x14')](_0x9f0f('0x1c'),auth[_0x9f0f('0xa')](),controller['send']);router[_0x9f0f('0x1d')](_0x9f0f('0xb'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x1e')]);router[_0x9f0f('0x1f')](_0x9f0f('0xb'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x20')]);router[_0x9f0f('0x1f')](_0x9f0f('0x16'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x9f0f('0x1f')](_0x9f0f('0xd'),auth[_0x9f0f('0xa')](),controller[_0x9f0f('0x21')]);router['delete'](_0x9f0f('0x12'),auth[_0x9f0f('0xa')](),controller['removeAgents']);module[_0x9f0f('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 332ff7c..60cc812 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 _0x7f0b=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x7f0b,0x1f2));var _0xb7f0=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x7f0b[_0x291f8b];return _0x275171;};'use strict';var Sequelize=require(_0xb7f0('0x0'));var rs=require('randomstring');module[_0xb7f0('0x1')]={'name':{'type':Sequelize[_0xb7f0('0x2')],'unique':_0xb7f0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb7f0('0x2')]},'token':{'type':Sequelize[_0xb7f0('0x2')],'defaultValue':function(){return rs[_0xb7f0('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb7f0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb7f0('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb7f0('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb7f0('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb7f0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb7f0('0x2')]},'queueTransfer':{'type':Sequelize[_0xb7f0('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb7f0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb7f0('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb7f0('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x199638){if(!_0x199638)this[_0xb7f0('0x8')](_0xb7f0('0x9'),null);this[_0xb7f0('0x8')](_0xb7f0('0xa'),_0x199638);}}}; \ No newline at end of file +var _0xbe21=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name'];(function(_0x42677f,_0x4427fa){var _0x413089=function(_0x33b5ca){while(--_0x33b5ca){_0x42677f['push'](_0x42677f['shift']());}};_0x413089(++_0x4427fa);}(_0xbe21,0x1d0));var _0x1be2=function(_0x380b8f,_0x32271d){_0x380b8f=_0x380b8f-0x0;var _0x646c69=_0xbe21[_0x380b8f];return _0x646c69;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1be2('0x0'));module[_0x1be2('0x1')]={'name':{'type':Sequelize[_0x1be2('0x2')],'unique':_0x1be2('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1be2('0x2')],'defaultValue':function(){return rs[_0x1be2('0x4')]();}},'replyUri':{'type':Sequelize[_0x1be2('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1be2('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1be2('0x5')],'defaultValue':function(){return _0x1be2('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1be2('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1be2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1be2('0x2')]},'queueTransfer':{'type':Sequelize[_0x1be2('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1be2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1be2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1be2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1be2('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x1be2('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x1be2('0x7')],'defaultValue':![],'comment':_0x1be2('0xa'),'set':function(_0x3de2e3){if(!_0x3de2e3)this[_0x1be2('0xb')]('mandatoryDispositionPauseId',null);this[_0x1be2('0xb')](_0x1be2('0xc'),_0x3de2e3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 97e2f16..70c7980 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 _0x8edf=['list','orderBy','priority','asc','account','Contacts','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','Tag','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','ListId','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','OpenchannelAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','findOne','pick','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','OpenchannelApplication','List','applications','Applications'];(function(_0x50f275,_0x2d4803){var _0x263ddd=function(_0x134dbb){while(--_0x134dbb){_0x50f275['push'](_0x50f275['shift']());}};_0x263ddd(++_0x2d4803);}(_0x8edf,0x1b5));var _0xf8ed=function(_0x197d72,_0x19b07b){_0x197d72=_0x197d72-0x0;var _0x1e3507=_0x8edf[_0x197d72];return _0x1e3507;};'use strict';var emlformat=require(_0xf8ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8ed('0x1'));var jsonpatch=require(_0xf8ed('0x2'));var rp=require(_0xf8ed('0x3'));var moment=require(_0xf8ed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf8ed('0x5'));var util=require(_0xf8ed('0x6'));var path=require(_0xf8ed('0x7'));var sox=require(_0xf8ed('0x8'));var csv=require('to-csv');var ejs=require(_0xf8ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf8ed('0xa'));var jsforce=require(_0xf8ed('0xb'));var deskjs=require(_0xf8ed('0xc'));var toCsv=require(_0xf8ed('0xd'));var querystring=require(_0xf8ed('0xe'));var Papa=require(_0xf8ed('0xf'));var Redis=require(_0xf8ed('0x10'));var authService=require(_0xf8ed('0x11'));var qs=require(_0xf8ed('0x12'));var as=require(_0xf8ed('0x13'));var hardwareService=require(_0xf8ed('0x14'));var logger=require('../../config/logger')(_0xf8ed('0x15'));var utils=require(_0xf8ed('0x16'));var config=require(_0xf8ed('0x17'));var licenseUtil=require(_0xf8ed('0x18'));var db=require('../../mysqldb')['db'];config[_0xf8ed('0x19')]=_['defaults'](config['redis'],{'host':_0xf8ed('0x1a'),'port':0x18eb});var socket=require(_0xf8ed('0x1b'))(new Redis(config[_0xf8ed('0x19')]));require(_0xf8ed('0x1c'))['register'](socket);var jayson=require(_0xf8ed('0x1d'));var client=jayson[_0xf8ed('0x1e')][_0xf8ed('0x1f')]({'port':0x232c});var client9002=jayson[_0xf8ed('0x1e')][_0xf8ed('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xac890c,_0x35d5d8,_0x508f14,_0x4e9d70){return new BPromise(function(_0x20294d,_0x10c0fe){var _0x3dd792=_0x4e9d70||client;return _0x3dd792[_0xf8ed('0x20')](_0xac890c,_0x508f14)[_0xf8ed('0x21')](function(_0x22a1fd){logger[_0xf8ed('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x35d5d8,_0xf8ed('0x23'));logger[_0xf8ed('0x24')](_0xf8ed('0x25'),_0x35d5d8,_0xf8ed('0x23'),JSON['stringify'](_0x22a1fd));if(_0x22a1fd[_0xf8ed('0x26')]){if(_0x22a1fd[_0xf8ed('0x26')]['code']===0x1f4){logger[_0xf8ed('0x26')](_0xf8ed('0x27'),_0x35d5d8,_0x22a1fd[_0xf8ed('0x26')][_0xf8ed('0x28')]);return _0x10c0fe(_0x22a1fd[_0xf8ed('0x26')][_0xf8ed('0x28')]);}logger[_0xf8ed('0x26')](_0xf8ed('0x27'),_0x35d5d8,_0x22a1fd[_0xf8ed('0x26')][_0xf8ed('0x28')]);return _0x20294d(_0x22a1fd[_0xf8ed('0x26')][_0xf8ed('0x28')]);}else{logger[_0xf8ed('0x22')](_0xf8ed('0x27'),_0x35d5d8,_0xf8ed('0x23'));_0x20294d(_0x22a1fd['result'][_0xf8ed('0x28')]);}})['catch'](function(_0x31ff22){logger[_0xf8ed('0x26')](_0xf8ed('0x27'),_0x35d5d8,_0x31ff22);_0x10c0fe(_0x31ff22);});});}function respondWithStatusCode(_0x3208d0,_0x4bbd43){_0x4bbd43=_0x4bbd43||0xcc;return function(_0xd0cfa2){if(_0xd0cfa2){return _0x3208d0[_0xf8ed('0x29')](_0x4bbd43);}return _0x3208d0[_0xf8ed('0x2a')](_0x4bbd43)[_0xf8ed('0x2b')]();};}function respondWithResult(_0x563aee,_0xb3a7cc){_0xb3a7cc=_0xb3a7cc||0xc8;return function(_0x4ec452){if(_0x4ec452){return _0x563aee['status'](_0xb3a7cc)[_0xf8ed('0x2c')](_0x4ec452);}};}function respondWithFilteredResult(_0x17898c,_0x574281){return function(_0x14356d){if(_0x14356d){var _0x5002d3=typeof _0x574281[_0xf8ed('0x2d')]==='undefined'&&typeof _0x574281['limit']===_0xf8ed('0x2e');var _0x4a9da5=_0x14356d['count'];var _0x50e638=_0x5002d3?0x0:_0x574281[_0xf8ed('0x2d')];var _0x2aac6b=_0x5002d3?_0x14356d[_0xf8ed('0x2f')]:_0x574281[_0xf8ed('0x2d')]+_0x574281[_0xf8ed('0x30')];var _0x18dd84;if(_0x2aac6b>=_0x4a9da5){_0x2aac6b=_0x4a9da5;_0x18dd84=0xc8;}else{_0x18dd84=0xce;}_0x17898c[_0xf8ed('0x2a')](_0x18dd84);return _0x17898c[_0xf8ed('0x31')](_0xf8ed('0x32'),_0x50e638+'-'+_0x2aac6b+'/'+_0x4a9da5)[_0xf8ed('0x2c')](_0x14356d);}return null;};}function patchUpdates(_0x5e8740){return function(_0x36e863){try{jsonpatch[_0xf8ed('0x33')](_0x36e863,_0x5e8740,!![]);}catch(_0x513f79){return BPromise[_0xf8ed('0x34')](_0x513f79);}return _0x36e863[_0xf8ed('0x35')]();};}function saveUpdates(_0x4b6894,_0x1875be){return function(_0x45d39e){if(_0x45d39e){return _0x45d39e[_0xf8ed('0x36')](_0x4b6894)[_0xf8ed('0x21')](function(_0xf01c82){return _0xf01c82;});}return null;};}function removeEntity(_0x55d63b,_0x108196){return function(_0x3bbdeb){if(_0x3bbdeb){return _0x3bbdeb[_0xf8ed('0x37')]()[_0xf8ed('0x21')](function(){var _0xead295=_0x3bbdeb[_0xf8ed('0x38')]({'plain':!![]});var _0x448130=_0xf8ed('0x39');return db[_0xf8ed('0x3a')]['destroy']({'where':{'type':_0x448130,'resourceId':_0xead295['id']}})[_0xf8ed('0x21')](function(){return _0x3bbdeb;});})[_0xf8ed('0x21')](function(){_0x55d63b[_0xf8ed('0x2a')](0xcc)[_0xf8ed('0x2b')]();});}};}function handleEntityNotFound(_0x47e48d,_0x13652a){return function(_0x4a5587){if(!_0x4a5587){_0x47e48d[_0xf8ed('0x29')](0x194);}return _0x4a5587;};}function handleError(_0x324c61,_0x4afead){_0x4afead=_0x4afead||0x1f4;return function(_0x2b0c70){logger['error'](_0x2b0c70[_0xf8ed('0x3b')]);if(_0x2b0c70[_0xf8ed('0x3c')]){delete _0x2b0c70[_0xf8ed('0x3c')];}_0x324c61[_0xf8ed('0x2a')](_0x4afead)[_0xf8ed('0x3d')](_0x2b0c70);};}exports[_0xf8ed('0x3e')]=function(_0x40a2bd,_0x565b4b){var _0x3edc0c={'include':[{'model':db[_0xf8ed('0x3f')],'as':_0xf8ed('0x40')}]},_0x4c9cc3={},_0x2c5dc4={'count':0x0,'rows':[]};var _0x401c20=_['map'](db[_0xf8ed('0x41')][_0xf8ed('0x42')],function(_0x49c04c){return{'name':_0x49c04c['fieldName'],'type':_0x49c04c[_0xf8ed('0x43')][_0xf8ed('0x44')]};});_0x4c9cc3['model']=_['map'](_0x401c20,_0xf8ed('0x3c'));_0x4c9cc3[_0xf8ed('0x45')]=_[_0xf8ed('0x46')](_0x40a2bd[_0xf8ed('0x45')]);_0x4c9cc3[_0xf8ed('0x47')]=_['intersection'](_0x4c9cc3[_0xf8ed('0x48')],_0x4c9cc3[_0xf8ed('0x45')]);_0x3edc0c['attributes']=_[_0xf8ed('0x49')](_0x4c9cc3[_0xf8ed('0x48')],qs[_0xf8ed('0x4a')](_0x40a2bd[_0xf8ed('0x45')][_0xf8ed('0x4a')]));_0x3edc0c[_0xf8ed('0x4b')]=_0x3edc0c[_0xf8ed('0x4b')]['length']?_0x3edc0c[_0xf8ed('0x4b')]:_0x4c9cc3['model'];if(!_0x40a2bd[_0xf8ed('0x45')][_0xf8ed('0x4c')](_0xf8ed('0x4d'))){_0x3edc0c[_0xf8ed('0x30')]=qs[_0xf8ed('0x30')](_0x40a2bd[_0xf8ed('0x45')]['limit']);_0x3edc0c['offset']=qs[_0xf8ed('0x2d')](_0x40a2bd[_0xf8ed('0x45')][_0xf8ed('0x2d')]);}_0x3edc0c[_0xf8ed('0x4e')]=qs['sort'](_0x40a2bd[_0xf8ed('0x45')][_0xf8ed('0x4f')]);_0x3edc0c[_0xf8ed('0x50')]=qs['filters'](_['pick'](_0x40a2bd[_0xf8ed('0x45')],_0x4c9cc3[_0xf8ed('0x47')]),_0x401c20);if(_0x40a2bd[_0xf8ed('0x45')][_0xf8ed('0x51')]){_0x3edc0c[_0xf8ed('0x50')]=_[_0xf8ed('0x52')](_0x3edc0c[_0xf8ed('0x50')],{'$or':_[_0xf8ed('0x53')](_0x401c20,function(_0x204fcb){if(_0x204fcb[_0xf8ed('0x43')]!==_0xf8ed('0x54')){var _0x88b41b={};_0x88b41b[_0x204fcb['name']]={'$like':'%'+_0x40a2bd['query'][_0xf8ed('0x51')]+'%'};return _0x88b41b;}})});}_0x3edc0c=_[_0xf8ed('0x52')]({},_0x3edc0c,_0x40a2bd[_0xf8ed('0x55')]);var _0x45c474={'where':_0x3edc0c[_0xf8ed('0x50')]};return db[_0xf8ed('0x41')][_0xf8ed('0x2f')](_0x45c474)[_0xf8ed('0x21')](function(_0x51840f){_0x2c5dc4[_0xf8ed('0x2f')]=_0x51840f;if(_0x40a2bd[_0xf8ed('0x45')][_0xf8ed('0x56')]){_0x3edc0c[_0xf8ed('0x57')]=[{'all':!![]}];}return db[_0xf8ed('0x41')][_0xf8ed('0x58')](_0x3edc0c);})[_0xf8ed('0x21')](function(_0x40fdf5){_0x2c5dc4['rows']=_0x40fdf5;return _0x2c5dc4;})[_0xf8ed('0x21')](respondWithFilteredResult(_0x565b4b,_0x3edc0c))[_0xf8ed('0x59')](handleError(_0x565b4b,null));};exports['show']=function(_0x5f1d57,_0x58ca84){var _0x1bacbb={'raw':![],'where':{'id':_0x5f1d57['params']['id']},'include':[{'model':db['Pause'],'as':_0xf8ed('0x40')}]},_0x2d3cb8={};_0x2d3cb8[_0xf8ed('0x48')]=_[_0xf8ed('0x46')](db[_0xf8ed('0x41')][_0xf8ed('0x42')]);_0x2d3cb8[_0xf8ed('0x45')]=_[_0xf8ed('0x46')](_0x5f1d57['query']);_0x2d3cb8[_0xf8ed('0x47')]=_[_0xf8ed('0x49')](_0x2d3cb8[_0xf8ed('0x48')],_0x2d3cb8[_0xf8ed('0x45')]);_0x1bacbb['attributes']=_['intersection'](_0x2d3cb8[_0xf8ed('0x48')],qs[_0xf8ed('0x4a')](_0x5f1d57[_0xf8ed('0x45')][_0xf8ed('0x4a')]));_0x1bacbb[_0xf8ed('0x4b')]=_0x1bacbb[_0xf8ed('0x4b')][_0xf8ed('0x5a')]?_0x1bacbb[_0xf8ed('0x4b')]:_0x2d3cb8['model'];if(_0x5f1d57[_0xf8ed('0x45')][_0xf8ed('0x56')]){_0x1bacbb[_0xf8ed('0x57')]=[{'all':!![]}];}_0x1bacbb=_['merge']({},_0x1bacbb,_0x5f1d57['options']);return db[_0xf8ed('0x41')][_0xf8ed('0x5b')](_0x1bacbb)['then'](handleEntityNotFound(_0x58ca84,null))[_0xf8ed('0x21')](respondWithResult(_0x58ca84,null))['catch'](handleError(_0x58ca84,null));};exports[_0xf8ed('0x5c')]=function(_0x2bbf80,_0x15cdc7){return db[_0xf8ed('0x41')][_0xf8ed('0x5c')](_0x2bbf80[_0xf8ed('0x5d')],{})[_0xf8ed('0x21')](function(_0x3e1e1d){var _0x12fbb6=_0x2bbf80['user']['get']({'plain':!![]});if(!_0x12fbb6)throw new Error(_0xf8ed('0x5e'));if(_0x12fbb6['role']===_0xf8ed('0x5f')){var _0xdec1e6=_0x3e1e1d['get']({'plain':!![]});var _0x2fcf61=_0xf8ed('0x39');return db[_0xf8ed('0x60')][_0xf8ed('0x5b')]({'where':{'name':_0x2fcf61,'userProfileId':_0x12fbb6['userProfileId']},'raw':!![]})[_0xf8ed('0x21')](function(_0x4f6ee3){if(_0x4f6ee3&&_0x4f6ee3['autoAssociation']===0x0){return db[_0xf8ed('0x3a')][_0xf8ed('0x5c')]({'name':_0xdec1e6[_0xf8ed('0x3c')],'resourceId':_0xdec1e6['id'],'type':_0x4f6ee3['name'],'sectionId':_0x4f6ee3['id']},{})[_0xf8ed('0x21')](function(){return _0x3e1e1d;});}else{return _0x3e1e1d;}})['catch'](function(_0x39e149){logger['error'](_0xf8ed('0x61'),_0x39e149);throw _0x39e149;});}return _0x3e1e1d;})[_0xf8ed('0x21')](respondWithResult(_0x15cdc7,0xc9))['catch'](handleError(_0x15cdc7,null));};exports[_0xf8ed('0x36')]=function(_0x47e0a8,_0x5b076e){if(_0x47e0a8[_0xf8ed('0x5d')]['id']){delete _0x47e0a8[_0xf8ed('0x5d')]['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x5b')]({'where':{'id':_0x47e0a8[_0xf8ed('0x62')]['id']},'include':[{'model':db[_0xf8ed('0x3f')],'as':_0xf8ed('0x40')}]})[_0xf8ed('0x21')](handleEntityNotFound(_0x5b076e,null))[_0xf8ed('0x21')](saveUpdates(_0x47e0a8['body'],null))['then'](respondWithResult(_0x5b076e,null))[_0xf8ed('0x59')](handleError(_0x5b076e,null));};exports[_0xf8ed('0x37')]=function(_0x5e2c00,_0x3e965a){return db['OpenchannelAccount'][_0xf8ed('0x5b')]({'where':{'id':_0x5e2c00[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x3e965a,null))[_0xf8ed('0x21')](removeEntity(_0x3e965a,null))[_0xf8ed('0x59')](handleError(_0x3e965a,null));};exports[_0xf8ed('0x63')]=function(_0x58ad1b,_0x3dd8f0){return db[_0xf8ed('0x41')]['describe']()[_0xf8ed('0x21')](respondWithResult(_0x3dd8f0,null))['catch'](handleError(_0x3dd8f0,null));};exports[_0xf8ed('0x64')]=function(_0x3a0025,_0xa058a2,_0x2e1da1){if(_0x3a0025['body']['id']){delete _0x3a0025[_0xf8ed('0x5d')]['id'];}return db[_0xf8ed('0x41')]['find']({'where':{'id':_0x3a0025[_0xf8ed('0x62')]['id']}})['then'](handleEntityNotFound(_0xa058a2,null))[_0xf8ed('0x21')](function(_0x13cc62){if(_0x13cc62){_0x3a0025[_0xf8ed('0x5d')]['OpenchannelAccountId']=_0x13cc62['id'];return db[_0xf8ed('0x65')]['create'](_0x3a0025[_0xf8ed('0x5d')]);}})['then'](respondWithResult(_0xa058a2,null))[_0xf8ed('0x59')](handleError(_0xa058a2,null));};exports['getDispositions']=function(_0x4fdfb0,_0x2f1b5e,_0x25744d){var _0x635973={'raw':![],'where':{}};var _0x4aafd8={};var _0x347b00={'count':0x0,'rows':[]};return db[_0xf8ed('0x41')][_0xf8ed('0x66')]({'where':{'id':_0x4fdfb0['params']['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x2f1b5e,null))[_0xf8ed('0x21')](function(_0x980141){if(_0x980141){_0x4aafd8[_0xf8ed('0x48')]=_['keys'](db['Disposition']['rawAttributes']);_0x4aafd8[_0xf8ed('0x45')]=_[_0xf8ed('0x46')](_0x4fdfb0[_0xf8ed('0x45')]);_0x4aafd8[_0xf8ed('0x47')]=_[_0xf8ed('0x49')](_0x4aafd8[_0xf8ed('0x48')],_0x4aafd8['query']);_0x635973['attributes']=_[_0xf8ed('0x49')](_0x4aafd8[_0xf8ed('0x48')],qs[_0xf8ed('0x4a')](_0x4fdfb0[_0xf8ed('0x45')][_0xf8ed('0x4a')]));_0x635973[_0xf8ed('0x4b')]=_0x635973[_0xf8ed('0x4b')][_0xf8ed('0x5a')]?_0x635973[_0xf8ed('0x4b')]:_0x4aafd8[_0xf8ed('0x48')];if(!_0x4fdfb0[_0xf8ed('0x45')]['hasOwnProperty'](_0xf8ed('0x4d'))){_0x635973[_0xf8ed('0x30')]=qs['limit'](_0x4fdfb0[_0xf8ed('0x45')][_0xf8ed('0x30')]);_0x635973[_0xf8ed('0x2d')]=qs[_0xf8ed('0x2d')](_0x4fdfb0[_0xf8ed('0x45')][_0xf8ed('0x2d')]);}_0x635973[_0xf8ed('0x4e')]=qs[_0xf8ed('0x4f')](_0x4fdfb0['query'][_0xf8ed('0x4f')]);_0x635973[_0xf8ed('0x50')]=qs['filters'](_[_0xf8ed('0x67')](_0x4fdfb0['query'],_0x4aafd8['filters']));_0x635973[_0xf8ed('0x50')][_0xf8ed('0x68')]=_0x980141['id'];if(_0x4fdfb0[_0xf8ed('0x45')][_0xf8ed('0x51')]){_0x635973[_0xf8ed('0x50')]=_[_0xf8ed('0x52')](_0x635973[_0xf8ed('0x50')],{'$or':_[_0xf8ed('0x53')](_0x635973['attributes'],function(_0x140ce6){var _0x184d2b={};_0x184d2b[_0x140ce6]={'$like':'%'+_0x4fdfb0[_0xf8ed('0x45')][_0xf8ed('0x51')]+'%'};return _0x184d2b;})});}_0x635973=_[_0xf8ed('0x52')]({},_0x635973,_0x4fdfb0[_0xf8ed('0x55')]);return db[_0xf8ed('0x65')][_0xf8ed('0x2f')]({'where':_0x635973[_0xf8ed('0x50')]})[_0xf8ed('0x21')](function(_0x184e02){_0x347b00['count']=_0x184e02;if(_0x4fdfb0[_0xf8ed('0x45')][_0xf8ed('0x56')]){_0x635973[_0xf8ed('0x57')]=[{'all':!![]}];}return db[_0xf8ed('0x65')]['findAll'](_0x635973);})[_0xf8ed('0x21')](function(_0x42c994){_0x347b00[_0xf8ed('0x69')]=_0x42c994;return _0x347b00;});}})[_0xf8ed('0x21')](respondWithFilteredResult(_0x2f1b5e,_0x635973))['catch'](handleError(_0x2f1b5e,null));};exports['removeDispositions']=function(_0x35841f,_0x17f34a,_0x1c17eb){return db['OpenchannelAccount'][_0xf8ed('0x5b')]({'where':{'id':_0x35841f[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x17f34a,null))[_0xf8ed('0x21')](function(_0x13823e){if(_0x13823e){return _0x13823e[_0xf8ed('0x6a')](_0x35841f[_0xf8ed('0x45')][_0xf8ed('0x6b')]);}})[_0xf8ed('0x21')](respondWithStatusCode(_0x17f34a,null))[_0xf8ed('0x59')](handleError(_0x17f34a,null));};exports[_0xf8ed('0x6c')]=function(_0x829d3d,_0x359c65,_0x379582){if(_0x829d3d[_0xf8ed('0x5d')]['id']){delete _0x829d3d[_0xf8ed('0x5d')]['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x5b')]({'where':{'id':_0x829d3d[_0xf8ed('0x62')]['id']}})['then'](handleEntityNotFound(_0x359c65,null))[_0xf8ed('0x21')](function(_0x55b020){if(_0x55b020){_0x829d3d[_0xf8ed('0x5d')]['OpenchannelAccountId']=_0x55b020['id'];return db[_0xf8ed('0x6d')][_0xf8ed('0x5c')](_0x829d3d[_0xf8ed('0x5d')]);}})['then'](respondWithResult(_0x359c65,null))[_0xf8ed('0x59')](handleError(_0x359c65,null));};exports[_0xf8ed('0x6e')]=function(_0x1a452b,_0x175e33,_0x6a0ebb){var _0x2c3c63={'raw':![],'where':{}};var _0x4abae7={};var _0x48939d={'count':0x0,'rows':[]};return db[_0xf8ed('0x41')]['findOne']({'where':{'id':_0x1a452b[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x175e33,null))['then'](function(_0x18683e){if(_0x18683e){_0x4abae7[_0xf8ed('0x48')]=_['keys'](db[_0xf8ed('0x6d')][_0xf8ed('0x42')]);_0x4abae7['query']=_['keys'](_0x1a452b['query']);_0x4abae7[_0xf8ed('0x47')]=_[_0xf8ed('0x49')](_0x4abae7['model'],_0x4abae7['query']);_0x2c3c63[_0xf8ed('0x4b')]=_[_0xf8ed('0x49')](_0x4abae7[_0xf8ed('0x48')],qs[_0xf8ed('0x4a')](_0x1a452b[_0xf8ed('0x45')][_0xf8ed('0x4a')]));_0x2c3c63[_0xf8ed('0x4b')]=_0x2c3c63[_0xf8ed('0x4b')][_0xf8ed('0x5a')]?_0x2c3c63[_0xf8ed('0x4b')]:_0x4abae7[_0xf8ed('0x48')];if(!_0x1a452b['query'][_0xf8ed('0x4c')](_0xf8ed('0x4d'))){_0x2c3c63[_0xf8ed('0x30')]=qs['limit'](_0x1a452b[_0xf8ed('0x45')][_0xf8ed('0x30')]);_0x2c3c63[_0xf8ed('0x2d')]=qs[_0xf8ed('0x2d')](_0x1a452b[_0xf8ed('0x45')][_0xf8ed('0x2d')]);}_0x2c3c63['order']=qs[_0xf8ed('0x4f')](_0x1a452b[_0xf8ed('0x45')][_0xf8ed('0x4f')]);_0x2c3c63[_0xf8ed('0x50')]=qs[_0xf8ed('0x47')](_[_0xf8ed('0x67')](_0x1a452b[_0xf8ed('0x45')],_0x4abae7[_0xf8ed('0x47')]));_0x2c3c63[_0xf8ed('0x50')][_0xf8ed('0x68')]=_0x18683e['id'];if(_0x1a452b[_0xf8ed('0x45')][_0xf8ed('0x51')]){_0x2c3c63['where']=_[_0xf8ed('0x52')](_0x2c3c63[_0xf8ed('0x50')],{'$or':_['map'](_0x2c3c63[_0xf8ed('0x4b')],function(_0x2160b0){var _0x424443={};_0x424443[_0x2160b0]={'$like':'%'+_0x1a452b[_0xf8ed('0x45')]['filter']+'%'};return _0x424443;})});}_0x2c3c63=_[_0xf8ed('0x52')]({},_0x2c3c63,_0x1a452b['options']);return db[_0xf8ed('0x6d')][_0xf8ed('0x2f')]({'where':_0x2c3c63[_0xf8ed('0x50')]})[_0xf8ed('0x21')](function(_0x177e9e){_0x48939d[_0xf8ed('0x2f')]=_0x177e9e;if(_0x1a452b[_0xf8ed('0x45')][_0xf8ed('0x56')]){_0x2c3c63['include']=[{'all':!![]}];}return db[_0xf8ed('0x6d')][_0xf8ed('0x58')](_0x2c3c63);})[_0xf8ed('0x21')](function(_0x1c8243){_0x48939d[_0xf8ed('0x69')]=_0x1c8243;return _0x48939d;});}})[_0xf8ed('0x21')](respondWithFilteredResult(_0x175e33,_0x2c3c63))['catch'](handleError(_0x175e33,null));};exports['removeAnswers']=function(_0x3fe342,_0xf0914f,_0x3ac80e){return db[_0xf8ed('0x41')][_0xf8ed('0x5b')]({'where':{'id':_0x3fe342[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0xf0914f,null))[_0xf8ed('0x21')](function(_0x558dfd){if(_0x558dfd){return _0x558dfd[_0xf8ed('0x6f')](_0x3fe342[_0xf8ed('0x45')]['ids']);}})['then'](respondWithStatusCode(_0xf0914f,null))[_0xf8ed('0x59')](handleError(_0xf0914f,null));};exports[_0xf8ed('0x70')]=function(_0x33ddea,_0x172409,_0x1a1c3f){var _0xe3268={'body':_0x33ddea[_0xf8ed('0x5d')],'channel':_0xf8ed('0x71')};var _0x45cabb=[];var _0x985f1e=[];var _0x2b1235={};var _0x4ccd87=![];return db[_0xf8ed('0x72')]['describe']()[_0xf8ed('0x21')](function(_0x10b076){if(!_0x10b076){throw new db[(_0xf8ed('0x73'))][(_0xf8ed('0x74'))]('no\x20available\x20attributes');}_0x45cabb=_['difference'](_[_0xf8ed('0x46')](_0x10b076),['createdAt',_0xf8ed('0x75')]);_0x985f1e=_[_0xf8ed('0x76')](_[_0xf8ed('0x46')](_0x10b076),[_0xf8ed('0x77'),_0xf8ed('0x75'),_0xf8ed('0x78'),'ListId']);if(_0x33ddea[_0xf8ed('0x5d')]['id']){delete _0x33ddea[_0xf8ed('0x5d')]['id'];}if(_[_0xf8ed('0x79')](_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x7a')])){throw new db[(_0xf8ed('0x73'))][(_0xf8ed('0x74'))](_0xf8ed('0x7b'));}if(_[_0xf8ed('0x79')](_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x5d')])||_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x5d')]===''){throw new db[(_0xf8ed('0x73'))][(_0xf8ed('0x74'))](_0xf8ed('0x7c'));}if(_[_0xf8ed('0x79')](_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x7d')])){throw new db[(_0xf8ed('0x73'))][(_0xf8ed('0x74'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x985f1e);}if(!_['includes'](_0x985f1e,_0x33ddea[_0xf8ed('0x5d')]['mapKey'])){throw new db[(_0xf8ed('0x73'))]['ValidationError'](_0xf8ed('0x7e')+_0x985f1e);}_0x2b1235[_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x7d')]]=_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x7a')];})['then'](function(){return db[_0xf8ed('0x41')][_0xf8ed('0x5b')]({'where':{'id':_0x33ddea[_0xf8ed('0x62')]['id']},'include':[{'model':db[_0xf8ed('0x7f')],'as':'List','include':[{'model':db[_0xf8ed('0x72')],'as':'Contacts','where':_0x2b1235,'limit':0x1,'order':[[_0xf8ed('0x75'),_0xf8ed('0x80')]]}]},{'model':db[_0xf8ed('0x81')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x172409,null))[_0xf8ed('0x21')](function(_0x32e74d){if(_0x32e74d&&_0x32e74d[_0xf8ed('0x82')]){_0xe3268['account']=_0x32e74d;_0xe3268[_0xf8ed('0x83')]=_0x32e74d[_0xf8ed('0x84')];_0xe3268[_0xf8ed('0x85')]=_0x32e74d[_0xf8ed('0x82')];_0xe3268[_0xf8ed('0x83')]=_[_0xf8ed('0x86')](_0xe3268[_0xf8ed('0x83')],[_0xf8ed('0x87')],[_0xf8ed('0x88')]);if(_0xe3268['account'][_0xf8ed('0x84')]){delete _0xe3268[_0xf8ed('0x89')]['Applications'];}if(_0xe3268[_0xf8ed('0x89')][_0xf8ed('0x82')]&&_0xe3268[_0xf8ed('0x89')][_0xf8ed('0x82')][_0xf8ed('0x8a')][_0xf8ed('0x5a')]){return _0xe3268[_0xf8ed('0x89')][_0xf8ed('0x82')][_0xf8ed('0x8a')][0x0];}var _0x53e322=_[_0xf8ed('0x8b')](_0x33ddea[_0xf8ed('0x5d')],{'firstName':_0x33ddea['body'][_0xf8ed('0x7a')],'ListId':_0x32e74d['ListId']});_0x53e322[_0x33ddea['body'][_0xf8ed('0x7d')]]=_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x7a')];return db[_0xf8ed('0x72')]['create'](_0x53e322,{'fields':_0x45cabb,'raw':!![]});}})['then'](handleEntityNotFound(_0x172409,null))['then'](function(_0x449565){_0xe3268[_0xf8ed('0x8c')]=_0x449565;if(_0x449565){var _0x1066fc={'ContactId':_0x449565['id'],'OpenchannelAccountId':_0x33ddea[_0xf8ed('0x62')]['id'],'from':(_0x449565[_0xf8ed('0x8d')]||'')+'\x20'+(_0x449565[_0xf8ed('0x8e')]||'')};var _0x546765={'OpenchannelAccountId':_0x33ddea['params']['id'],'closed':![]};if(_0x33ddea[_0xf8ed('0x5d')]['threadId']){_0x546765['threadId']=_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x8f')];return db[_0xf8ed('0x90')][_0xf8ed('0x5b')]({'where':_0x546765})[_0xf8ed('0x21')](function(_0x5e1584){if(_0x5e1584){return[_0x5e1584,![]];}_0x1066fc[_0xf8ed('0x8f')]=_0x33ddea['body'][_0xf8ed('0x8f')];_0x1066fc[_0xf8ed('0x91')]=_0x33ddea['body'][_0xf8ed('0x91')];return db[_0xf8ed('0x90')]['create'](_0x1066fc)[_0xf8ed('0x21')](function(_0x379b53){return[_0x379b53,!![]];});});}else{_0x546765['threadId']=null;}_0x546765[_0xf8ed('0x92')]=_0x449565['id'];return db[_0xf8ed('0x90')][_0xf8ed('0x5b')]({'where':_0x546765})[_0xf8ed('0x21')](function(_0x553d45){if(_0x553d45){return[_0x553d45,![]];}return db['OpenchannelInteraction'][_0xf8ed('0x5c')](_0x1066fc)[_0xf8ed('0x21')](function(_0x4fb54d){return[_0x4fb54d,!![]];});});}})[_0xf8ed('0x93')](function(_0x585183,_0x24f7f6){if(_0x585183){_0x4ccd87=_0x24f7f6;if(!_0x24f7f6){var _0x1274c9={'from':(_0xe3268[_0xf8ed('0x8c')][_0xf8ed('0x8d')]||'')+'\x20'+(_0xe3268['contact'][_0xf8ed('0x8e')]||'')};if(_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x8f')]&&_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x94')]&&_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x8f')]!=_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x94')]){_0x1274c9[_0xf8ed('0x8f')]=_0x33ddea[_0xf8ed('0x5d')]['messageId'];}return _0x585183['update'](_0x1274c9);}else{return _0x585183;}}})['then'](function(_0x163287){_0xe3268[_0xf8ed('0x95')]=_0x163287['get']({'plain':!![]});_0xe3268['interaction']['created']=_0x4ccd87;if(_0xe3268[_0xf8ed('0x95')][_0xf8ed('0x96')]){if(_0xe3268['account'][_0xf8ed('0x97')]){_0xe3268[_0xf8ed('0x83')][_0xf8ed('0x98')]({'id':0x0,'priority':_0xe3268[_0xf8ed('0x83')]['length']+0x1,'app':_0xf8ed('0x99'),'appdata':_0xf8ed('0x9a'),'interval':_0xf8ed('0x9b')});}}return db[_0xf8ed('0x9c')]['create']({'body':_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x5d')],'OpenchannelAccountId':_0x33ddea[_0xf8ed('0x62')]['id'],'OpenchannelInteractionId':_0x163287['id'],'direction':'in','ContactId':_0xe3268[_0xf8ed('0x8c')]['id'],'AttachmentId':_0x33ddea[_0xf8ed('0x5d')][_0xf8ed('0x9d')]});})[_0xf8ed('0x21')](function(_0x36bfeb){_0xe3268['message']=_0x36bfeb;if(_0xe3268[_0xf8ed('0x95')]['UserId']){return db[_0xf8ed('0x9e')]['find']({'attributes':['id',_0xf8ed('0x3c')],'where':{'id':_0xe3268[_0xf8ed('0x95')][_0xf8ed('0x9f')]}})[_0xf8ed('0x21')](function(_0x346b84){if(_0x346b84){_0xe3268[_0xf8ed('0x83')][_0xf8ed('0xa0')]({'id':0x0,'priority':0x0,'app':_0xf8ed('0xa1'),'appdata':_0x346b84[_0xf8ed('0x3c')]+','+(_0xe3268[_0xf8ed('0x89')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xe3268['forcedOwnership']=![];}return respondWithRpcPromise(_0xf8ed('0xa2'),_0xf8ed('0xa3'),_0xe3268);});}return respondWithRpcPromise(_0xf8ed('0xa2'),_0xf8ed('0xa3'),_0xe3268);})[_0xf8ed('0x21')](function(_0x2b0559){respondWithRpcPromise('EventManager',_0xf8ed('0xa4'),{'event':_0xf8ed('0x70'),'message':_0x2b0559},client9002);return _0x2b0559;})[_0xf8ed('0x21')](respondWithResult(_0x172409,null))[_0xf8ed('0x59')](handleError(_0x172409,null));};exports[_0xf8ed('0xa5')]=function(_0x310308,_0xb8d822){var _0x424b5f=_0x310308[_0xf8ed('0x62')]['id'];var _0x211b01=_0x310308[_0xf8ed('0x5d')];var _0x1a3189=0xc8;var _0x37ee36=null;return db[_0xf8ed('0xa6')][_0xf8ed('0xa7')]({'isolationLevel':db[_0xf8ed('0xa6')][_0xf8ed('0xa8')][_0xf8ed('0xa9')]['READ_COMMITTED']},function(_0x6c7ad7){return db[_0xf8ed('0x41')]['findOne']({'where':{'id':_0x424b5f},'transaction':_0x6c7ad7})[_0xf8ed('0x21')](function(_0x98fd24){if(_0x98fd24){return db[_0xf8ed('0x81')][_0xf8ed('0x37')]({'where':{'OpenchannelAccountId':_0x424b5f},'transaction':_0x6c7ad7})[_0xf8ed('0x21')](function(){var _0x2f3d28=_[_0xf8ed('0x53')](_0x211b01,function(_0x216da0){_0x216da0[_0xf8ed('0x68')]=_0x424b5f;return _0x216da0;});return db['OpenchannelApplication'][_0xf8ed('0xaa')](_0x2f3d28,{'transaction':_0x6c7ad7});});}else{_0x1a3189=0x194;_0x37ee36=[];}});})[_0xf8ed('0x21')](function(){if(_0x1a3189!==0x194){return db[_0xf8ed('0x81')][_0xf8ed('0xab')]({'where':{'OpenchannelAccountId':_0x424b5f},'order':_0xf8ed('0x87')})[_0xf8ed('0x21')](function(_0x263ca8){_0x37ee36=_0x263ca8;});}})[_0xf8ed('0x59')](function(_0x34fe25){_0x1a3189=0x1f4;logger[_0xf8ed('0x26')](_0x34fe25[_0xf8ed('0x3b')]);if(_0x34fe25[_0xf8ed('0x3c')]){delete _0x34fe25[_0xf8ed('0x3c')];}_0x37ee36=_0x34fe25;})['finally'](function(){if(_0x37ee36===null){_0xb8d822[_0xf8ed('0x29')](_0x1a3189);}else{if(_0x1a3189===0x1f4){_0xb8d822[_0xf8ed('0x2a')](_0x1a3189)['send'](_0x37ee36);}else{_0xb8d822['status'](_0x1a3189)[_0xf8ed('0x2c')](_0x37ee36);}}});};exports[_0xf8ed('0xac')]=function(_0x52cb95,_0x478dca,_0x1a4e45){var _0x115b92={};var _0x358239={};var _0x23138b;var _0x3a8b59;return db['OpenchannelAccount'][_0xf8ed('0x66')]({'where':{'id':_0x52cb95[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x478dca,null))[_0xf8ed('0x21')](function(_0xeeffab){if(_0xeeffab){_0x23138b=_0xeeffab;_0x358239[_0xf8ed('0x48')]=_[_0xf8ed('0x46')](db[_0xf8ed('0x81')][_0xf8ed('0x42')]);_0x358239[_0xf8ed('0x45')]=_[_0xf8ed('0x46')](_0x52cb95[_0xf8ed('0x45')]);_0x358239['filters']=_['intersection'](_0x358239[_0xf8ed('0x48')],_0x358239[_0xf8ed('0x45')]);_0x115b92[_0xf8ed('0x4b')]=_[_0xf8ed('0x49')](_0x358239[_0xf8ed('0x48')],qs[_0xf8ed('0x4a')](_0x52cb95[_0xf8ed('0x45')][_0xf8ed('0x4a')]));_0x115b92[_0xf8ed('0x4b')]=_0x115b92[_0xf8ed('0x4b')][_0xf8ed('0x5a')]?_0x115b92['attributes']:_0x358239[_0xf8ed('0x48')];_0x115b92[_0xf8ed('0x4e')]=qs['sort'](_0x52cb95[_0xf8ed('0x45')][_0xf8ed('0x4f')]);_0x115b92[_0xf8ed('0x50')]=qs[_0xf8ed('0x47')](_['pick'](_0x52cb95['query'],_0x358239[_0xf8ed('0x47')]));if(_0x52cb95['query'][_0xf8ed('0x51')]){_0x115b92['where']=_[_0xf8ed('0x52')](_0x115b92['where'],{'$or':_[_0xf8ed('0x53')](_0x115b92[_0xf8ed('0x4b')],function(_0x58fab3){var _0x12536b={};_0x12536b[_0x58fab3]={'$like':'%'+_0x52cb95['query']['filter']+'%'};return _0x12536b;})});}_0x115b92=_['merge']({},_0x115b92,_0x52cb95[_0xf8ed('0x55')]);return _0x23138b[_0xf8ed('0xac')](_0x115b92);}})[_0xf8ed('0x21')](function(_0x249ed4){if(_0x249ed4){_0x3a8b59=_0x249ed4['length'];if(!_0x52cb95['query'][_0xf8ed('0x4c')](_0xf8ed('0x4d'))){_0x115b92[_0xf8ed('0x30')]=qs[_0xf8ed('0x30')](_0x52cb95[_0xf8ed('0x45')][_0xf8ed('0x30')]);_0x115b92[_0xf8ed('0x2d')]=qs[_0xf8ed('0x2d')](_0x52cb95[_0xf8ed('0x45')][_0xf8ed('0x2d')]);}return _0x23138b['getApplications'](_0x115b92);}})[_0xf8ed('0x21')](function(_0x964c71){if(_0x964c71){return _0x964c71?{'count':_0x3a8b59,'rows':_0x964c71}:null;}})[_0xf8ed('0x21')](respondWithResult(_0x478dca,null))[_0xf8ed('0x59')](handleError(_0x478dca,null));};exports[_0xf8ed('0xad')]=function(_0x29ad7c,_0x256b30,_0x729574){var _0x5f11a7={'raw':![],'where':{}};var _0x4b9ba0={};var _0x211e21={'count':0x0,'rows':[]};return db[_0xf8ed('0x41')]['findOne']({'where':{'id':_0x29ad7c[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x256b30,null))[_0xf8ed('0x21')](function(_0x475dd1){if(_0x475dd1){_0x4b9ba0[_0xf8ed('0x48')]=_[_0xf8ed('0x46')](db['OpenchannelInteraction'][_0xf8ed('0x42')]);_0x4b9ba0['query']=_[_0xf8ed('0x46')](_0x29ad7c['query']);_0x4b9ba0['filters']=_[_0xf8ed('0x49')](_0x4b9ba0[_0xf8ed('0x48')],_0x4b9ba0[_0xf8ed('0x45')]);_0x5f11a7[_0xf8ed('0x4b')]=_[_0xf8ed('0x49')](_0x4b9ba0[_0xf8ed('0x48')],qs[_0xf8ed('0x4a')](_0x29ad7c[_0xf8ed('0x45')]['fields']));_0x5f11a7[_0xf8ed('0x4b')]=_0x5f11a7[_0xf8ed('0x4b')][_0xf8ed('0x5a')]?_0x5f11a7[_0xf8ed('0x4b')]:_0x4b9ba0[_0xf8ed('0x48')];if(!_0x29ad7c[_0xf8ed('0x45')]['hasOwnProperty'](_0xf8ed('0x4d'))){_0x5f11a7[_0xf8ed('0x30')]=qs['limit'](_0x29ad7c['query']['limit']);_0x5f11a7[_0xf8ed('0x2d')]=qs[_0xf8ed('0x2d')](_0x29ad7c[_0xf8ed('0x45')]['offset']);}_0x5f11a7[_0xf8ed('0x4e')]=qs[_0xf8ed('0x4f')](_0x29ad7c[_0xf8ed('0x45')][_0xf8ed('0x4f')]);_0x5f11a7[_0xf8ed('0x50')]=qs[_0xf8ed('0x47')](_['pick'](_0x29ad7c[_0xf8ed('0x45')],_0x4b9ba0[_0xf8ed('0x47')]));_0x5f11a7[_0xf8ed('0x50')][_0xf8ed('0x68')]=_0x475dd1['id'];if(_0x29ad7c[_0xf8ed('0x45')][_0xf8ed('0x51')]){_0x5f11a7[_0xf8ed('0x50')]=_[_0xf8ed('0x52')](_0x5f11a7[_0xf8ed('0x50')],{'$or':_[_0xf8ed('0x53')](_0x5f11a7['attributes'],function(_0x4ee35e){var _0x4775c2={};_0x4775c2[_0x4ee35e]={'$like':'%'+_0x29ad7c[_0xf8ed('0x45')]['filter']+'%'};return _0x4775c2;})});}_0x5f11a7=_[_0xf8ed('0x52')]({},_0x5f11a7,_0x29ad7c[_0xf8ed('0x55')]);return db[_0xf8ed('0x90')][_0xf8ed('0x2f')]({'where':_0x5f11a7['where']})[_0xf8ed('0x21')](function(_0x457ae3){_0x211e21[_0xf8ed('0x2f')]=_0x457ae3;if(_0x29ad7c[_0xf8ed('0x45')][_0xf8ed('0x56')]){_0x5f11a7['include']=[{'model':db[_0xf8ed('0x72')],'as':_0xf8ed('0xae'),'required':![]},{'model':db[_0xf8ed('0x9e')],'as':_0xf8ed('0xaf'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xf8ed('0xb0')],'as':'Tags','attributes':['id','name',_0xf8ed('0xb1')],'where':_0x29ad7c[_0xf8ed('0x45')][_0xf8ed('0xb2')]?{'id':_0x29ad7c[_0xf8ed('0x45')]['tag']}:undefined,'required':_0x29ad7c[_0xf8ed('0x45')][_0xf8ed('0xb2')]?!![]:![]}];}return db[_0xf8ed('0x90')][_0xf8ed('0x58')](_0x5f11a7);})[_0xf8ed('0x21')](function(_0x2d5d31){_0x211e21['rows']=_0x2d5d31;return _0x211e21;});}})['then'](respondWithFilteredResult(_0x256b30,_0x5f11a7))[_0xf8ed('0x59')](handleError(_0x256b30,null));};exports[_0xf8ed('0xb3')]=function(_0xfbaf91,_0x246a05,_0x32ce5f){return db[_0xf8ed('0x41')]['find']({'where':{'id':_0xfbaf91['params']['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x246a05,null))[_0xf8ed('0x21')](function(_0x531ad3){if(_0x531ad3){return _0x531ad3[_0xf8ed('0xb3')](_0xfbaf91[_0xf8ed('0x5d')][_0xf8ed('0x6b')],_['omit'](_0xfbaf91[_0xf8ed('0x5d')],[_0xf8ed('0x6b'),'id'])||{})[_0xf8ed('0x93')](function(_0x174cc6){for(var _0x345c2f=0x0;_0x345c2f<_0xfbaf91[_0xf8ed('0x5d')][_0xf8ed('0x6b')]['length'];_0x345c2f+=0x1){socket[_0xf8ed('0xb4')](_0xf8ed('0xb5'),{'UserId':Number(_0xfbaf91[_0xf8ed('0x5d')][_0xf8ed('0x6b')][_0x345c2f]),'OpenchannelAccountId':Number(_0xfbaf91[_0xf8ed('0x62')]['id'])});}return _0x174cc6;});}})[_0xf8ed('0x21')](respondWithResult(_0x246a05,null))[_0xf8ed('0x59')](handleError(_0x246a05,null));};exports[_0xf8ed('0xb6')]=function(_0x441f4b,_0x338f48,_0x717d9b){return db[_0xf8ed('0x41')][_0xf8ed('0x5b')]({'where':{'id':_0x441f4b[_0xf8ed('0x62')]['id']}})['then'](handleEntityNotFound(_0x338f48,null))[_0xf8ed('0x21')](function(_0x133ba7){if(_0x133ba7){return _0x133ba7['removeAgents'](_0x441f4b[_0xf8ed('0x45')][_0xf8ed('0x6b')])['then'](function(){if(_[_0xf8ed('0xb7')](_0x441f4b[_0xf8ed('0x45')]['ids'])){for(var _0x33f006=0x0;_0x33f006<_0x441f4b[_0xf8ed('0x45')][_0xf8ed('0x6b')]['length'];_0x33f006+=0x1){socket[_0xf8ed('0xb4')](_0xf8ed('0xb8'),{'UserId':Number(_0x441f4b[_0xf8ed('0x45')][_0xf8ed('0x6b')][_0x33f006]),'OpenchannelAccountId':Number(_0x441f4b['params']['id'])});}}else{socket[_0xf8ed('0xb4')](_0xf8ed('0xb8'),{'UserId':Number(_0x441f4b[_0xf8ed('0x45')][_0xf8ed('0x6b')]),'OpenchannelAccountId':Number(_0x441f4b[_0xf8ed('0x62')]['id'])});}});}})[_0xf8ed('0x21')](respondWithStatusCode(_0x338f48,null))['catch'](handleError(_0x338f48,null));};exports['getAgents']=function(_0x112759,_0x5ab4ca,_0x5631b9){var _0x561a64={};var _0x13e392={};var _0x509659;var _0x3ce2b9;return db[_0xf8ed('0x41')][_0xf8ed('0x66')]({'where':{'id':_0x112759[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0x5ab4ca,null))[_0xf8ed('0x21')](function(_0x2a4317){if(_0x2a4317){_0x509659=_0x2a4317;_0x13e392['model']=_[_0xf8ed('0x46')](db[_0xf8ed('0x9e')]['rawAttributes']);_0x13e392[_0xf8ed('0x45')]=_[_0xf8ed('0x46')](_0x112759[_0xf8ed('0x45')]);_0x13e392['filters']=_['intersection'](_0x13e392[_0xf8ed('0x48')],_0x13e392[_0xf8ed('0x45')]);_0x561a64[_0xf8ed('0x4b')]=_[_0xf8ed('0x49')](_0x13e392[_0xf8ed('0x48')],qs[_0xf8ed('0x4a')](_0x112759[_0xf8ed('0x45')][_0xf8ed('0x4a')]));_0x561a64[_0xf8ed('0x4b')]=_0x561a64[_0xf8ed('0x4b')]['length']?_0x561a64[_0xf8ed('0x4b')]:_0x13e392[_0xf8ed('0x48')];_0x561a64[_0xf8ed('0x4e')]=qs['sort'](_0x112759['query']['sort']);_0x561a64[_0xf8ed('0x50')]=qs['filters'](_[_0xf8ed('0x67')](_0x112759[_0xf8ed('0x45')],_0x13e392[_0xf8ed('0x47')]));if(_0x112759['query'][_0xf8ed('0x51')]){_0x561a64[_0xf8ed('0x50')]=_['merge'](_0x561a64[_0xf8ed('0x50')],{'$or':_[_0xf8ed('0x53')](_0x561a64[_0xf8ed('0x4b')],function(_0x111cbd){var _0x1d7139={};_0x1d7139[_0x111cbd]={'$like':'%'+_0x112759[_0xf8ed('0x45')][_0xf8ed('0x51')]+'%'};return _0x1d7139;})});}_0x561a64=_['merge']({},_0x561a64,_0x112759['options']);return _0x509659[_0xf8ed('0xb9')](_0x561a64);}})['then'](function(_0x40298a){if(_0x40298a){_0x3ce2b9=_0x40298a['length'];if(!_0x112759['query']['hasOwnProperty']('nolimit')){_0x561a64[_0xf8ed('0x30')]=qs[_0xf8ed('0x30')](_0x112759[_0xf8ed('0x45')][_0xf8ed('0x30')]);_0x561a64[_0xf8ed('0x2d')]=qs[_0xf8ed('0x2d')](_0x112759[_0xf8ed('0x45')]['offset']);}return _0x509659[_0xf8ed('0xb9')](_0x561a64);}})[_0xf8ed('0x21')](function(_0x766294){if(_0x766294){return _0x766294?{'count':_0x3ce2b9,'rows':_0x766294}:null;}})[_0xf8ed('0x21')](respondWithResult(_0x5ab4ca,null))['catch'](handleError(_0x5ab4ca,null));};exports[_0xf8ed('0x3d')]=function(_0x124593,_0xe60a3c,_0x14d990){var _0x4f56b9,_0x1e3150,_0x559baa;if(_[_0xf8ed('0x79')](_0x124593[_0xf8ed('0x5d')][_0xf8ed('0x5d')])||_0x124593['body'][_0xf8ed('0x5d')]===''){throw new db[(_0xf8ed('0x73'))][(_0xf8ed('0x74'))](_0xf8ed('0x7c'));}if(_[_0xf8ed('0x79')](_0x124593['body']['to'])){}_0x4f56b9=_0x124593[_0xf8ed('0x5d')]['to'];return db[_0xf8ed('0x41')][_0xf8ed('0x66')]({'where':{'id':_0x124593[_0xf8ed('0x62')]['id']}})[_0xf8ed('0x21')](handleEntityNotFound(_0xe60a3c,null))[_0xf8ed('0x21')](function(_0x20061f){if(_0x20061f){return db[_0xf8ed('0x41')][_0xf8ed('0x5b')]({'where':{'id':_0x20061f['id']},'include':[{'model':db[_0xf8ed('0x7f')],'as':_0xf8ed('0x82'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x20061f[_0xf8ed('0x7d')]]:_0x4f56b9},'limit':0x1,'order':[[_0xf8ed('0x75'),_0xf8ed('0x80')]]}]}]})[_0xf8ed('0x21')](handleEntityNotFound(_0xe60a3c,null))[_0xf8ed('0x21')](function(_0x57272d){if(_0x57272d&&_0x57272d[_0xf8ed('0x82')]){_0x1e3150=_0x57272d['get']({'plain':!![]});if(_0x1e3150[_0xf8ed('0x82')]&&_0x1e3150[_0xf8ed('0x82')][_0xf8ed('0x8a')]['length']){return _0x1e3150[_0xf8ed('0x82')]['Contacts'][0x0];}return db['CmContact'][_0xf8ed('0x5c')](_[_0xf8ed('0x8b')](_0x124593[_0xf8ed('0x5d')],{'firstName':_0x4f56b9,[_0x57272d[_0xf8ed('0x7d')]]:_0x4f56b9,'phone':_0x4f56b9,'ListId':_0x1e3150[_0xf8ed('0xba')]}));}})[_0xf8ed('0x21')](handleEntityNotFound(_0xe60a3c,null))[_0xf8ed('0x21')](function(_0x444be0){if(_0x444be0){_0x559baa=_0x444be0;return db['OpenchannelInteraction'][_0xf8ed('0x5b')]({'where':{'ContactId':_0x559baa['id'],'closed':![],'OpenchannelAccountId':_0x1e3150['id']}})[_0xf8ed('0x21')](function(_0x36a360){if(_0x36a360){return[_0x36a360,![]];}return db[_0xf8ed('0x90')][_0xf8ed('0x5c')]({'UserId':_0x124593[_0xf8ed('0x5f')]['id'],'ContactId':_0x559baa['id'],'OpenchannelAccountId':_0x1e3150['id'],'lastMsgDirection':_0xf8ed('0xbb'),'Messages':[_[_0xf8ed('0x52')](_0x124593[_0xf8ed('0x5d')],{'read':![],'body':_0x124593[_0xf8ed('0x5d')][_0xf8ed('0x5d')],'OpenchannelAccountId':_0x1e3150['id'],'UserId':_0x124593['user']['id'],'ContactId':_0x559baa['id']})]},{'include':[{'model':db[_0xf8ed('0x9c')],'as':_0xf8ed('0xbc')}]})[_0xf8ed('0x21')](function(_0x32be40){return[_0x32be40,!![]];});});}})['spread'](function(_0x5766f3,_0x23676d){if(_0x23676d){return _0x5766f3;}return db['OpenchannelMessage']['create'](_[_0xf8ed('0x52')](_0x124593[_0xf8ed('0x5d')],{'read':![],'body':_0x124593[_0xf8ed('0x5d')][_0xf8ed('0x5d')],'OpenchannelAccountId':_0x1e3150['id'],'OpenchannelInteractionId':_0x5766f3['id'],'UserId':_0x124593[_0xf8ed('0x5f')]['id'],'ContactId':_0x559baa['id']}))[_0xf8ed('0x21')](function(_0x388f3b){_0x5766f3['dataValues'][_0xf8ed('0xbc')]=[];_0x5766f3[_0xf8ed('0xbd')]['Messages'][_0xf8ed('0x98')](_0x388f3b['dataValues']);return _0x5766f3;});});}})['then'](respondWithResult(_0xe60a3c,null))[_0xf8ed('0x59')](handleError(_0xe60a3c,null));}; \ No newline at end of file +var _0x039e=['unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','user','role','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','Sequelize','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','List','DESC','OpenchannelApplication','applications','list','orderBy','priority','asc','account','Applications','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User'];(function(_0x351b4c,_0x5d78f5){var _0x4de136=function(_0x2b8565){while(--_0x2b8565){_0x351b4c['push'](_0x351b4c['shift']());}};_0x4de136(++_0x5d78f5);}(_0x039e,0xe2));var _0xe039=function(_0xcaa7c4,_0x5afa88){_0xcaa7c4=_0xcaa7c4-0x0;var _0x231c9a=_0x039e[_0xcaa7c4];return _0x231c9a;};'use strict';var emlformat=require(_0xe039('0x0'));var rimraf=require(_0xe039('0x1'));var zipdir=require(_0xe039('0x2'));var jsonpatch=require(_0xe039('0x3'));var rp=require('request-promise');var moment=require(_0xe039('0x4'));var BPromise=require(_0xe039('0x5'));var Mustache=require(_0xe039('0x6'));var util=require('util');var path=require(_0xe039('0x7'));var sox=require(_0xe039('0x8'));var csv=require('to-csv');var ejs=require(_0xe039('0x9'));var fs=require('fs');var fs_extra=require(_0xe039('0xa'));var _=require(_0xe039('0xb'));var squel=require(_0xe039('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe039('0xd'));var toCsv=require(_0xe039('0xe'));var querystring=require(_0xe039('0xf'));var Papa=require(_0xe039('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe039('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe039('0x12'))('api');var utils=require(_0xe039('0x13'));var config=require(_0xe039('0x14'));var licenseUtil=require(_0xe039('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe039('0x16')](config[_0xe039('0x17')],{'host':_0xe039('0x18'),'port':0x18eb});var socket=require(_0xe039('0x19'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xe039('0x1a'));var client=jayson[_0xe039('0x1b')][_0xe039('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xe039('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1ebc17,_0x233709,_0x43e92b,_0x38c5f2){return new BPromise(function(_0x1d34e6,_0x26d9eb){var _0x9aed81=_0x38c5f2||client;return _0x9aed81[_0xe039('0x1d')](_0x1ebc17,_0x43e92b)[_0xe039('0x1e')](function(_0x541c56){logger['info'](_0xe039('0x1f'),_0x233709,'request\x20sent');logger[_0xe039('0x20')](_0xe039('0x21'),_0x233709,_0xe039('0x22'),JSON[_0xe039('0x23')](_0x541c56));if(_0x541c56[_0xe039('0x24')]){if(_0x541c56[_0xe039('0x24')][_0xe039('0x25')]===0x1f4){logger['error'](_0xe039('0x1f'),_0x233709,_0x541c56['error'][_0xe039('0x26')]);return _0x26d9eb(_0x541c56[_0xe039('0x24')][_0xe039('0x26')]);}logger[_0xe039('0x24')](_0xe039('0x1f'),_0x233709,_0x541c56[_0xe039('0x24')]['message']);return _0x1d34e6(_0x541c56[_0xe039('0x24')]['message']);}else{logger[_0xe039('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x233709,'request\x20sent');_0x1d34e6(_0x541c56[_0xe039('0x28')][_0xe039('0x26')]);}})[_0xe039('0x29')](function(_0x458242){logger[_0xe039('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x233709,_0x458242);_0x26d9eb(_0x458242);});});}function respondWithStatusCode(_0x4b9c2b,_0xfb4def){_0xfb4def=_0xfb4def||0xcc;return function(_0x3d127d){if(_0x3d127d){return _0x4b9c2b['sendStatus'](_0xfb4def);}return _0x4b9c2b[_0xe039('0x2a')](_0xfb4def)[_0xe039('0x2b')]();};}function respondWithResult(_0x2abbeb,_0x181cdf){_0x181cdf=_0x181cdf||0xc8;return function(_0x498d85){if(_0x498d85){return _0x2abbeb[_0xe039('0x2a')](_0x181cdf)[_0xe039('0x2c')](_0x498d85);}};}function respondWithFilteredResult(_0x22f248,_0x439c72){return function(_0x5e729f){if(_0x5e729f){var _0x462af4=typeof _0x439c72[_0xe039('0x2d')]===_0xe039('0x2e')&&typeof _0x439c72[_0xe039('0x2f')]===_0xe039('0x2e');var _0x1cb471=_0x5e729f[_0xe039('0x30')];var _0x34e160=_0x462af4?0x0:_0x439c72['offset'];var _0x359e86=_0x462af4?_0x5e729f[_0xe039('0x30')]:_0x439c72[_0xe039('0x2d')]+_0x439c72['limit'];var _0x5a1c5d;if(_0x359e86>=_0x1cb471){_0x359e86=_0x1cb471;_0x5a1c5d=0xc8;}else{_0x5a1c5d=0xce;}_0x22f248[_0xe039('0x2a')](_0x5a1c5d);return _0x22f248[_0xe039('0x31')](_0xe039('0x32'),_0x34e160+'-'+_0x359e86+'/'+_0x1cb471)[_0xe039('0x2c')](_0x5e729f);}return null;};}function patchUpdates(_0x4bbd7e){return function(_0x158839){try{jsonpatch[_0xe039('0x33')](_0x158839,_0x4bbd7e,!![]);}catch(_0x20b8c1){return BPromise[_0xe039('0x34')](_0x20b8c1);}return _0x158839[_0xe039('0x35')]();};}function saveUpdates(_0x1c005b,_0x2a5a0d){return function(_0x1b1826){if(_0x1b1826){return _0x1b1826['update'](_0x1c005b)[_0xe039('0x1e')](function(_0x3676db){return _0x3676db;});}return null;};}function removeEntity(_0x2859be,_0xb0526b){return function(_0x16819c){if(_0x16819c){return _0x16819c[_0xe039('0x36')]()[_0xe039('0x1e')](function(){var _0x4d5a03=_0x16819c[_0xe039('0x37')]({'plain':!![]});var _0xf70b5=_0xe039('0x38');return db[_0xe039('0x39')][_0xe039('0x36')]({'where':{'type':_0xf70b5,'resourceId':_0x4d5a03['id']}})[_0xe039('0x1e')](function(){return _0x16819c;});})[_0xe039('0x1e')](function(){_0x2859be[_0xe039('0x2a')](0xcc)[_0xe039('0x2b')]();});}};}function handleEntityNotFound(_0x131440,_0x13f34d){return function(_0x58a35f){if(!_0x58a35f){_0x131440[_0xe039('0x3a')](0x194);}return _0x58a35f;};}function handleError(_0x4412ad,_0xb56ffd){_0xb56ffd=_0xb56ffd||0x1f4;return function(_0x303007){logger['error'](_0x303007[_0xe039('0x3b')]);if(_0x303007['name']){delete _0x303007['name'];}_0x4412ad[_0xe039('0x2a')](_0xb56ffd)[_0xe039('0x3c')](_0x303007);};}exports[_0xe039('0x3d')]=function(_0x54a16f,_0x4d973e){var _0x38c8a5={'include':[{'model':db[_0xe039('0x3e')],'as':_0xe039('0x3f')}]},_0x5db174={},_0x3bc93c={'count':0x0,'rows':[]};var _0x3d6483=_['map'](db[_0xe039('0x40')][_0xe039('0x41')],function(_0x42f55a){return{'name':_0x42f55a[_0xe039('0x42')],'type':_0x42f55a[_0xe039('0x43')]['key']};});_0x5db174[_0xe039('0x44')]=_['map'](_0x3d6483,'name');_0x5db174[_0xe039('0x45')]=_[_0xe039('0x46')](_0x54a16f[_0xe039('0x45')]);_0x5db174[_0xe039('0x47')]=_['intersection'](_0x5db174[_0xe039('0x44')],_0x5db174['query']);_0x38c8a5['attributes']=_[_0xe039('0x48')](_0x5db174[_0xe039('0x44')],qs[_0xe039('0x49')](_0x54a16f[_0xe039('0x45')]['fields']));_0x38c8a5[_0xe039('0x4a')]=_0x38c8a5['attributes'][_0xe039('0x4b')]?_0x38c8a5['attributes']:_0x5db174[_0xe039('0x44')];if(!_0x54a16f['query'][_0xe039('0x4c')](_0xe039('0x4d'))){_0x38c8a5[_0xe039('0x2f')]=qs[_0xe039('0x2f')](_0x54a16f['query'][_0xe039('0x2f')]);_0x38c8a5[_0xe039('0x2d')]=qs[_0xe039('0x2d')](_0x54a16f['query']['offset']);}_0x38c8a5[_0xe039('0x4e')]=qs[_0xe039('0x4f')](_0x54a16f[_0xe039('0x45')][_0xe039('0x4f')]);_0x38c8a5[_0xe039('0x50')]=qs[_0xe039('0x47')](_[_0xe039('0x51')](_0x54a16f['query'],_0x5db174['filters']),_0x3d6483);if(_0x54a16f[_0xe039('0x45')][_0xe039('0x52')]){_0x38c8a5[_0xe039('0x50')]=_[_0xe039('0x53')](_0x38c8a5[_0xe039('0x50')],{'$or':_[_0xe039('0x54')](_0x3d6483,function(_0x5a321b){if(_0x5a321b[_0xe039('0x43')]!==_0xe039('0x55')){var _0x3ba502={};_0x3ba502[_0x5a321b['name']]={'$like':'%'+_0x54a16f[_0xe039('0x45')]['filter']+'%'};return _0x3ba502;}})});}_0x38c8a5=_['merge']({},_0x38c8a5,_0x54a16f['options']);var _0x234b30={'where':_0x38c8a5[_0xe039('0x50')]};return db[_0xe039('0x40')][_0xe039('0x30')](_0x234b30)[_0xe039('0x1e')](function(_0xbc6ab0){_0x3bc93c[_0xe039('0x30')]=_0xbc6ab0;if(_0x54a16f[_0xe039('0x45')][_0xe039('0x56')]){_0x38c8a5[_0xe039('0x57')]=[{'all':!![]}];}return db[_0xe039('0x40')][_0xe039('0x58')](_0x38c8a5);})[_0xe039('0x1e')](function(_0x2df16d){_0x3bc93c[_0xe039('0x59')]=_0x2df16d;return _0x3bc93c;})[_0xe039('0x1e')](respondWithFilteredResult(_0x4d973e,_0x38c8a5))[_0xe039('0x29')](handleError(_0x4d973e,null));};exports[_0xe039('0x5a')]=function(_0x25cb33,_0x280763){var _0x464831={'raw':![],'where':{'id':_0x25cb33[_0xe039('0x5b')]['id']},'include':[{'model':db[_0xe039('0x3e')],'as':_0xe039('0x3f')}]},_0x3604d7={};_0x3604d7[_0xe039('0x44')]=_[_0xe039('0x46')](db[_0xe039('0x40')]['rawAttributes']);_0x3604d7['query']=_[_0xe039('0x46')](_0x25cb33[_0xe039('0x45')]);_0x3604d7[_0xe039('0x47')]=_[_0xe039('0x48')](_0x3604d7[_0xe039('0x44')],_0x3604d7[_0xe039('0x45')]);_0x464831['attributes']=_[_0xe039('0x48')](_0x3604d7[_0xe039('0x44')],qs[_0xe039('0x49')](_0x25cb33[_0xe039('0x45')][_0xe039('0x49')]));_0x464831[_0xe039('0x4a')]=_0x464831['attributes']['length']?_0x464831[_0xe039('0x4a')]:_0x3604d7[_0xe039('0x44')];if(_0x25cb33[_0xe039('0x45')][_0xe039('0x56')]){_0x464831[_0xe039('0x57')]=[{'all':!![]}];}_0x464831=_[_0xe039('0x53')]({},_0x464831,_0x25cb33[_0xe039('0x5c')]);return db[_0xe039('0x40')][_0xe039('0x5d')](_0x464831)[_0xe039('0x1e')](handleEntityNotFound(_0x280763,null))['then'](respondWithResult(_0x280763,null))[_0xe039('0x29')](handleError(_0x280763,null));};exports[_0xe039('0x5e')]=function(_0x42fae8,_0xbf7c1d){return db['OpenchannelAccount'][_0xe039('0x5e')](_0x42fae8['body'],{})[_0xe039('0x1e')](function(_0x160cfc){var _0xf7fa02=_0x42fae8[_0xe039('0x5f')][_0xe039('0x37')]({'plain':!![]});if(!_0xf7fa02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf7fa02[_0xe039('0x60')]==='user'){var _0x5ddb4e=_0x160cfc['get']({'plain':!![]});var _0x5e1f71='OpenchannelAccounts';return db[_0xe039('0x61')][_0xe039('0x5d')]({'where':{'name':_0x5e1f71,'userProfileId':_0xf7fa02['userProfileId']},'raw':!![]})[_0xe039('0x1e')](function(_0x116c2a){if(_0x116c2a&&_0x116c2a[_0xe039('0x62')]===0x0){return db[_0xe039('0x39')][_0xe039('0x5e')]({'name':_0x5ddb4e[_0xe039('0x63')],'resourceId':_0x5ddb4e['id'],'type':_0x116c2a[_0xe039('0x63')],'sectionId':_0x116c2a['id']},{})['then'](function(){return _0x160cfc;});}else{return _0x160cfc;}})[_0xe039('0x29')](function(_0x5acd63){logger['error'](_0xe039('0x64'),_0x5acd63);throw _0x5acd63;});}return _0x160cfc;})[_0xe039('0x1e')](respondWithResult(_0xbf7c1d,0xc9))[_0xe039('0x29')](handleError(_0xbf7c1d,null));};exports[_0xe039('0x65')]=function(_0x6e5485,_0x3488b2){if(_0x6e5485[_0xe039('0x66')]['id']){delete _0x6e5485[_0xe039('0x66')]['id'];}return db[_0xe039('0x40')][_0xe039('0x5d')]({'where':{'id':_0x6e5485[_0xe039('0x5b')]['id']},'include':[{'model':db[_0xe039('0x3e')],'as':_0xe039('0x3f')}]})['then'](handleEntityNotFound(_0x3488b2,null))[_0xe039('0x1e')](saveUpdates(_0x6e5485[_0xe039('0x66')],null))[_0xe039('0x1e')](respondWithResult(_0x3488b2,null))[_0xe039('0x29')](handleError(_0x3488b2,null));};exports[_0xe039('0x36')]=function(_0x5691e8,_0xdd3834){return db[_0xe039('0x40')][_0xe039('0x5d')]({'where':{'id':_0x5691e8[_0xe039('0x5b')]['id']}})['then'](handleEntityNotFound(_0xdd3834,null))[_0xe039('0x1e')](removeEntity(_0xdd3834,null))['catch'](handleError(_0xdd3834,null));};exports[_0xe039('0x67')]=function(_0x2e1444,_0x287603){return db[_0xe039('0x40')][_0xe039('0x67')]()[_0xe039('0x1e')](respondWithResult(_0x287603,null))[_0xe039('0x29')](handleError(_0x287603,null));};exports[_0xe039('0x68')]=function(_0x10ef0e,_0x309dfd,_0x449a75){if(_0x10ef0e[_0xe039('0x66')]['id']){delete _0x10ef0e[_0xe039('0x66')]['id'];}return db[_0xe039('0x40')]['find']({'where':{'id':_0x10ef0e[_0xe039('0x5b')]['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x309dfd,null))['then'](function(_0x55361e){if(_0x55361e){_0x10ef0e[_0xe039('0x66')][_0xe039('0x69')]=_0x55361e['id'];return db['Disposition']['create'](_0x10ef0e[_0xe039('0x66')]);}})['then'](respondWithResult(_0x309dfd,null))['catch'](handleError(_0x309dfd,null));};exports[_0xe039('0x6a')]=function(_0x240f52,_0x57fbd0,_0x4d2236){var _0x3ea4f7={'raw':![],'where':{}};var _0x433711={};var _0x283b30={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe039('0x6b')]({'where':{'id':_0x240f52[_0xe039('0x5b')]['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x57fbd0,null))[_0xe039('0x1e')](function(_0x465cd3){if(_0x465cd3){_0x433711['model']=_[_0xe039('0x46')](db['Disposition']['rawAttributes']);_0x433711[_0xe039('0x45')]=_[_0xe039('0x46')](_0x240f52[_0xe039('0x45')]);_0x433711[_0xe039('0x47')]=_[_0xe039('0x48')](_0x433711[_0xe039('0x44')],_0x433711[_0xe039('0x45')]);_0x3ea4f7['attributes']=_[_0xe039('0x48')](_0x433711[_0xe039('0x44')],qs[_0xe039('0x49')](_0x240f52[_0xe039('0x45')][_0xe039('0x49')]));_0x3ea4f7[_0xe039('0x4a')]=_0x3ea4f7[_0xe039('0x4a')][_0xe039('0x4b')]?_0x3ea4f7[_0xe039('0x4a')]:_0x433711[_0xe039('0x44')];if(!_0x240f52[_0xe039('0x45')][_0xe039('0x4c')](_0xe039('0x4d'))){_0x3ea4f7['limit']=qs[_0xe039('0x2f')](_0x240f52[_0xe039('0x45')][_0xe039('0x2f')]);_0x3ea4f7[_0xe039('0x2d')]=qs[_0xe039('0x2d')](_0x240f52[_0xe039('0x45')][_0xe039('0x2d')]);}_0x3ea4f7['order']=qs[_0xe039('0x4f')](_0x240f52['query'][_0xe039('0x4f')]);_0x3ea4f7[_0xe039('0x50')]=qs[_0xe039('0x47')](_['pick'](_0x240f52['query'],_0x433711[_0xe039('0x47')]));_0x3ea4f7[_0xe039('0x50')]['OpenchannelAccountId']=_0x465cd3['id'];if(_0x240f52[_0xe039('0x45')][_0xe039('0x52')]){_0x3ea4f7['where']=_[_0xe039('0x53')](_0x3ea4f7[_0xe039('0x50')],{'$or':_[_0xe039('0x54')](_0x3ea4f7['attributes'],function(_0x47128a){var _0x29113b={};_0x29113b[_0x47128a]={'$like':'%'+_0x240f52['query']['filter']+'%'};return _0x29113b;})});}_0x3ea4f7=_[_0xe039('0x53')]({},_0x3ea4f7,_0x240f52[_0xe039('0x5c')]);return db[_0xe039('0x6c')]['count']({'where':_0x3ea4f7[_0xe039('0x50')]})[_0xe039('0x1e')](function(_0x2b3014){_0x283b30['count']=_0x2b3014;if(_0x240f52[_0xe039('0x45')][_0xe039('0x56')]){_0x3ea4f7[_0xe039('0x57')]=[{'all':!![]}];}return db[_0xe039('0x6c')][_0xe039('0x58')](_0x3ea4f7);})[_0xe039('0x1e')](function(_0x543735){_0x283b30[_0xe039('0x59')]=_0x543735;return _0x283b30;});}})[_0xe039('0x1e')](respondWithFilteredResult(_0x57fbd0,_0x3ea4f7))[_0xe039('0x29')](handleError(_0x57fbd0,null));};exports[_0xe039('0x6d')]=function(_0x1e9b55,_0x43f477,_0x4bddc8){return db[_0xe039('0x40')][_0xe039('0x5d')]({'where':{'id':_0x1e9b55[_0xe039('0x5b')]['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x43f477,null))[_0xe039('0x1e')](function(_0xf040f6){if(_0xf040f6){return _0xf040f6['removeDispositions'](_0x1e9b55[_0xe039('0x45')][_0xe039('0x6e')]);}})[_0xe039('0x1e')](respondWithStatusCode(_0x43f477,null))[_0xe039('0x29')](handleError(_0x43f477,null));};exports[_0xe039('0x6f')]=function(_0x398f11,_0x160988,_0x46834c){if(_0x398f11['body']['id']){delete _0x398f11['body']['id'];}return db[_0xe039('0x40')]['find']({'where':{'id':_0x398f11[_0xe039('0x5b')]['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x160988,null))[_0xe039('0x1e')](function(_0x39b46a){if(_0x39b46a){_0x398f11['body']['OpenchannelAccountId']=_0x39b46a['id'];return db[_0xe039('0x70')]['create'](_0x398f11[_0xe039('0x66')]);}})[_0xe039('0x1e')](respondWithResult(_0x160988,null))[_0xe039('0x29')](handleError(_0x160988,null));};exports[_0xe039('0x71')]=function(_0x392228,_0x4309dd,_0x3543a0){var _0x9e7a7c={'raw':![],'where':{}};var _0x2869a2={};var _0x4c5228={'count':0x0,'rows':[]};return db[_0xe039('0x40')][_0xe039('0x6b')]({'where':{'id':_0x392228['params']['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x4309dd,null))['then'](function(_0x1ed0d3){if(_0x1ed0d3){_0x2869a2[_0xe039('0x44')]=_[_0xe039('0x46')](db[_0xe039('0x70')]['rawAttributes']);_0x2869a2[_0xe039('0x45')]=_[_0xe039('0x46')](_0x392228[_0xe039('0x45')]);_0x2869a2[_0xe039('0x47')]=_[_0xe039('0x48')](_0x2869a2[_0xe039('0x44')],_0x2869a2[_0xe039('0x45')]);_0x9e7a7c[_0xe039('0x4a')]=_[_0xe039('0x48')](_0x2869a2[_0xe039('0x44')],qs[_0xe039('0x49')](_0x392228['query'][_0xe039('0x49')]));_0x9e7a7c[_0xe039('0x4a')]=_0x9e7a7c[_0xe039('0x4a')][_0xe039('0x4b')]?_0x9e7a7c[_0xe039('0x4a')]:_0x2869a2[_0xe039('0x44')];if(!_0x392228[_0xe039('0x45')]['hasOwnProperty']('nolimit')){_0x9e7a7c[_0xe039('0x2f')]=qs[_0xe039('0x2f')](_0x392228[_0xe039('0x45')][_0xe039('0x2f')]);_0x9e7a7c['offset']=qs[_0xe039('0x2d')](_0x392228[_0xe039('0x45')]['offset']);}_0x9e7a7c[_0xe039('0x4e')]=qs[_0xe039('0x4f')](_0x392228[_0xe039('0x45')][_0xe039('0x4f')]);_0x9e7a7c[_0xe039('0x50')]=qs[_0xe039('0x47')](_['pick'](_0x392228['query'],_0x2869a2['filters']));_0x9e7a7c[_0xe039('0x50')][_0xe039('0x69')]=_0x1ed0d3['id'];if(_0x392228[_0xe039('0x45')][_0xe039('0x52')]){_0x9e7a7c['where']=_[_0xe039('0x53')](_0x9e7a7c[_0xe039('0x50')],{'$or':_[_0xe039('0x54')](_0x9e7a7c[_0xe039('0x4a')],function(_0x3db355){var _0xc678dc={};_0xc678dc[_0x3db355]={'$like':'%'+_0x392228[_0xe039('0x45')][_0xe039('0x52')]+'%'};return _0xc678dc;})});}_0x9e7a7c=_[_0xe039('0x53')]({},_0x9e7a7c,_0x392228[_0xe039('0x5c')]);return db['CannedAnswer'][_0xe039('0x30')]({'where':_0x9e7a7c['where']})['then'](function(_0x61bf02){_0x4c5228[_0xe039('0x30')]=_0x61bf02;if(_0x392228[_0xe039('0x45')][_0xe039('0x56')]){_0x9e7a7c[_0xe039('0x57')]=[{'all':!![]}];}return db[_0xe039('0x70')][_0xe039('0x58')](_0x9e7a7c);})['then'](function(_0x4ec87a){_0x4c5228[_0xe039('0x59')]=_0x4ec87a;return _0x4c5228;});}})[_0xe039('0x1e')](respondWithFilteredResult(_0x4309dd,_0x9e7a7c))['catch'](handleError(_0x4309dd,null));};exports[_0xe039('0x72')]=function(_0x52cb62,_0x542a6b,_0x524be5){return db[_0xe039('0x40')]['find']({'where':{'id':_0x52cb62[_0xe039('0x5b')]['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x542a6b,null))[_0xe039('0x1e')](function(_0x2e894c){if(_0x2e894c){return _0x2e894c[_0xe039('0x72')](_0x52cb62[_0xe039('0x45')][_0xe039('0x6e')]);}})['then'](respondWithStatusCode(_0x542a6b,null))[_0xe039('0x29')](handleError(_0x542a6b,null));};exports[_0xe039('0x73')]=function(_0x33b4fe,_0x2d351c,_0x26840f){var _0x5f308c={'body':_0x33b4fe[_0xe039('0x66')],'channel':_0xe039('0x74')};var _0x25a43d=[];var _0x1ff025=[];var _0x1cb454={};var _0x38bb96=![];return db[_0xe039('0x75')][_0xe039('0x67')]()[_0xe039('0x1e')](function(_0x2d80fc){if(!_0x2d80fc){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x25a43d=_[_0xe039('0x76')](_['keys'](_0x2d80fc),['createdAt',_0xe039('0x77')]);_0x1ff025=_[_0xe039('0x76')](_['keys'](_0x2d80fc),[_0xe039('0x78'),_0xe039('0x77'),_0xe039('0x79'),_0xe039('0x7a')]);if(_0x33b4fe[_0xe039('0x66')]['id']){delete _0x33b4fe[_0xe039('0x66')]['id'];}if(_[_0xe039('0x7b')](_0x33b4fe[_0xe039('0x66')][_0xe039('0x7c')])){throw new db['Sequelize'][(_0xe039('0x7d'))](_0xe039('0x7e'));}if(_['isNil'](_0x33b4fe[_0xe039('0x66')][_0xe039('0x66')])||_0x33b4fe[_0xe039('0x66')][_0xe039('0x66')]===''){throw new db[(_0xe039('0x7f'))][(_0xe039('0x7d'))](_0xe039('0x80'));}if(_[_0xe039('0x7b')](_0x33b4fe['body'][_0xe039('0x81')])){throw new db[(_0xe039('0x7f'))]['ValidationError'](_0xe039('0x82')+_0x1ff025);}if(!_[_0xe039('0x83')](_0x1ff025,_0x33b4fe[_0xe039('0x66')][_0xe039('0x81')])){throw new db[(_0xe039('0x7f'))]['ValidationError'](_0xe039('0x84')+_0x1ff025);}_0x1cb454[_0x33b4fe['body']['mapKey']]=_0x33b4fe[_0xe039('0x66')][_0xe039('0x7c')];})[_0xe039('0x1e')](function(){return db['OpenchannelAccount'][_0xe039('0x5d')]({'where':{'id':_0x33b4fe['params']['id']},'include':[{'model':db['CmList'],'as':_0xe039('0x85'),'include':[{'model':db[_0xe039('0x75')],'as':'Contacts','where':_0x1cb454,'limit':0x1,'order':[[_0xe039('0x77'),_0xe039('0x86')]]}]},{'model':db[_0xe039('0x87')],'as':'Applications'}]});})[_0xe039('0x1e')](handleEntityNotFound(_0x2d351c,null))[_0xe039('0x1e')](function(_0x1ff18a){if(_0x1ff18a&&_0x1ff18a[_0xe039('0x85')]){_0x5f308c['account']=_0x1ff18a;_0x5f308c[_0xe039('0x88')]=_0x1ff18a['Applications'];_0x5f308c[_0xe039('0x89')]=_0x1ff18a[_0xe039('0x85')];_0x5f308c[_0xe039('0x88')]=_[_0xe039('0x8a')](_0x5f308c[_0xe039('0x88')],[_0xe039('0x8b')],[_0xe039('0x8c')]);if(_0x5f308c[_0xe039('0x8d')][_0xe039('0x8e')]){delete _0x5f308c[_0xe039('0x8d')][_0xe039('0x8e')];}if(_0x5f308c[_0xe039('0x8d')][_0xe039('0x85')]&&_0x5f308c[_0xe039('0x8d')][_0xe039('0x85')][_0xe039('0x8f')][_0xe039('0x4b')]){return _0x5f308c[_0xe039('0x8d')][_0xe039('0x85')][_0xe039('0x8f')][0x0];}var _0x5b19eb=_[_0xe039('0x16')](_0x33b4fe['body'],{'firstName':_0x33b4fe[_0xe039('0x66')]['from'],'ListId':_0x1ff18a[_0xe039('0x7a')]});_0x5b19eb[_0x33b4fe[_0xe039('0x66')][_0xe039('0x81')]]=_0x33b4fe[_0xe039('0x66')][_0xe039('0x7c')];return db[_0xe039('0x75')][_0xe039('0x5e')](_0x5b19eb,{'fields':_0x25a43d,'raw':!![]});}})['then'](handleEntityNotFound(_0x2d351c,null))[_0xe039('0x1e')](function(_0x3b75d4){_0x5f308c[_0xe039('0x90')]=_0x3b75d4;if(_0x3b75d4){var _0x20dcf0={'ContactId':_0x3b75d4['id'],'OpenchannelAccountId':_0x33b4fe[_0xe039('0x5b')]['id'],'from':(_0x3b75d4[_0xe039('0x91')]||'')+'\x20'+(_0x3b75d4[_0xe039('0x92')]||'')};var _0x459515={'OpenchannelAccountId':_0x33b4fe[_0xe039('0x5b')]['id'],'closed':![]};if(_0x33b4fe[_0xe039('0x66')][_0xe039('0x93')]){_0x459515[_0xe039('0x93')]=_0x33b4fe['body'][_0xe039('0x93')];return db[_0xe039('0x94')][_0xe039('0x5d')]({'where':_0x459515})[_0xe039('0x1e')](function(_0x4880e1){if(_0x4880e1){return[_0x4880e1,![]];}_0x20dcf0[_0xe039('0x93')]=_0x33b4fe[_0xe039('0x66')][_0xe039('0x93')];_0x20dcf0['externalUrl']=_0x33b4fe[_0xe039('0x66')][_0xe039('0x95')];return db['OpenchannelInteraction'][_0xe039('0x5e')](_0x20dcf0)['then'](function(_0x3838df){return[_0x3838df,!![]];});});}else{_0x459515['threadId']=null;}_0x459515[_0xe039('0x96')]=_0x3b75d4['id'];return db[_0xe039('0x94')][_0xe039('0x5d')]({'where':_0x459515})[_0xe039('0x1e')](function(_0xc31830){if(_0xc31830){return[_0xc31830,![]];}return db[_0xe039('0x94')][_0xe039('0x5e')](_0x20dcf0)[_0xe039('0x1e')](function(_0x32fe14){return[_0x32fe14,!![]];});});}})[_0xe039('0x97')](function(_0x1ee4b2,_0x123e6f){if(_0x1ee4b2){_0x38bb96=_0x123e6f;if(!_0x123e6f){var _0x45ae92={'from':(_0x5f308c['contact'][_0xe039('0x91')]||'')+'\x20'+(_0x5f308c[_0xe039('0x90')]['lastName']||'')};if(_0x33b4fe[_0xe039('0x66')][_0xe039('0x93')]&&_0x33b4fe[_0xe039('0x66')][_0xe039('0x98')]&&_0x33b4fe['body'][_0xe039('0x93')]!=_0x33b4fe['body']['messageId']){_0x45ae92['threadId']=_0x33b4fe[_0xe039('0x66')][_0xe039('0x98')];}return _0x1ee4b2['update'](_0x45ae92);}else{return _0x1ee4b2;}}})[_0xe039('0x1e')](function(_0x17cb90){_0x5f308c[_0xe039('0x99')]=_0x17cb90[_0xe039('0x37')]({'plain':!![]});_0x5f308c[_0xe039('0x99')][_0xe039('0x9a')]=_0x38bb96;if(_0x5f308c['interaction']['created']){if(_0x5f308c[_0xe039('0x8d')][_0xe039('0x9b')]){_0x5f308c['applications'][_0xe039('0x9c')]({'id':0x0,'priority':_0x5f308c[_0xe039('0x88')][_0xe039('0x4b')]+0x1,'app':_0xe039('0x9d'),'appdata':_0xe039('0x9e'),'interval':_0xe039('0x9f')});}}return db[_0xe039('0xa0')][_0xe039('0x5e')]({'body':_0x33b4fe[_0xe039('0x66')][_0xe039('0x66')],'OpenchannelAccountId':_0x33b4fe[_0xe039('0x5b')]['id'],'OpenchannelInteractionId':_0x17cb90['id'],'direction':'in','ContactId':_0x5f308c[_0xe039('0x90')]['id'],'AttachmentId':_0x33b4fe[_0xe039('0x66')][_0xe039('0xa1')]});})[_0xe039('0x1e')](function(_0xe2a89a){_0x5f308c[_0xe039('0x26')]=_0xe2a89a;if(_0x5f308c[_0xe039('0x99')][_0xe039('0xa2')]){return db[_0xe039('0xa3')][_0xe039('0x5d')]({'attributes':['id',_0xe039('0x63')],'where':{'id':_0x5f308c['interaction'][_0xe039('0xa2')]}})[_0xe039('0x1e')](function(_0x328e07){if(_0x328e07){_0x5f308c[_0xe039('0x88')][_0xe039('0xa4')]({'id':0x0,'priority':0x0,'app':_0xe039('0xa5'),'appdata':_0x328e07['name']+','+(_0x5f308c['account'][_0xe039('0xa6')]||0xa),'interval':'*,*,*,*'});_0x5f308c[_0xe039('0xa7')]=![];}return respondWithRpcPromise('Start',_0xe039('0xa8'),_0x5f308c);});}return respondWithRpcPromise('Start',_0xe039('0xa8'),_0x5f308c);})[_0xe039('0x1e')](function(_0x11a518){respondWithRpcPromise(_0xe039('0xa9'),'EventManager',{'event':_0xe039('0x73'),'message':_0x11a518},client9002);return _0x11a518;})[_0xe039('0x1e')](respondWithResult(_0x2d351c,null))[_0xe039('0x29')](handleError(_0x2d351c,null));};exports[_0xe039('0xaa')]=function(_0xe407fb,_0x3be120){var _0x29bd88=_0xe407fb[_0xe039('0x5b')]['id'];var _0x2d1466=_0xe407fb[_0xe039('0x66')];var _0x451e69=0xc8;var _0x54a0a9=null;return db[_0xe039('0xab')]['transaction']({'isolationLevel':db[_0xe039('0xab')][_0xe039('0xac')]['ISOLATION_LEVELS'][_0xe039('0xad')]},function(_0x5161bb){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x29bd88},'transaction':_0x5161bb})[_0xe039('0x1e')](function(_0x25eab1){if(_0x25eab1){return db[_0xe039('0x87')]['destroy']({'where':{'OpenchannelAccountId':_0x29bd88},'transaction':_0x5161bb})[_0xe039('0x1e')](function(){var _0x16d2e9=_['map'](_0x2d1466,function(_0x51d31e){_0x51d31e[_0xe039('0x69')]=_0x29bd88;return _0x51d31e;});return db['OpenchannelApplication'][_0xe039('0xae')](_0x16d2e9,{'transaction':_0x5161bb});});}else{_0x451e69=0x194;_0x54a0a9=[];}});})[_0xe039('0x1e')](function(){if(_0x451e69!==0x194){return db['OpenchannelApplication'][_0xe039('0xaf')]({'where':{'OpenchannelAccountId':_0x29bd88},'order':_0xe039('0x8b')})['then'](function(_0x1b3085){_0x54a0a9=_0x1b3085;});}})[_0xe039('0x29')](function(_0x2a6ba2){_0x451e69=0x1f4;logger[_0xe039('0x24')](_0x2a6ba2[_0xe039('0x3b')]);if(_0x2a6ba2['name']){delete _0x2a6ba2[_0xe039('0x63')];}_0x54a0a9=_0x2a6ba2;})['finally'](function(){if(_0x54a0a9===null){_0x3be120['sendStatus'](_0x451e69);}else{if(_0x451e69===0x1f4){_0x3be120[_0xe039('0x2a')](_0x451e69)[_0xe039('0x3c')](_0x54a0a9);}else{_0x3be120['status'](_0x451e69)[_0xe039('0x2c')](_0x54a0a9);}}});};exports[_0xe039('0xb0')]=function(_0x3c7421,_0x4b924b,_0x19edb9){var _0x36cfbf={};var _0x4d4371={};var _0x5189d9;var _0x2fa9cc;return db['OpenchannelAccount'][_0xe039('0x6b')]({'where':{'id':_0x3c7421[_0xe039('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4b924b,null))['then'](function(_0x3d8f93){if(_0x3d8f93){_0x5189d9=_0x3d8f93;_0x4d4371[_0xe039('0x44')]=_[_0xe039('0x46')](db['OpenchannelApplication']['rawAttributes']);_0x4d4371['query']=_['keys'](_0x3c7421[_0xe039('0x45')]);_0x4d4371['filters']=_[_0xe039('0x48')](_0x4d4371['model'],_0x4d4371[_0xe039('0x45')]);_0x36cfbf[_0xe039('0x4a')]=_['intersection'](_0x4d4371['model'],qs[_0xe039('0x49')](_0x3c7421[_0xe039('0x45')][_0xe039('0x49')]));_0x36cfbf[_0xe039('0x4a')]=_0x36cfbf[_0xe039('0x4a')][_0xe039('0x4b')]?_0x36cfbf['attributes']:_0x4d4371[_0xe039('0x44')];_0x36cfbf[_0xe039('0x4e')]=qs[_0xe039('0x4f')](_0x3c7421['query'][_0xe039('0x4f')]);_0x36cfbf[_0xe039('0x50')]=qs[_0xe039('0x47')](_[_0xe039('0x51')](_0x3c7421[_0xe039('0x45')],_0x4d4371['filters']));if(_0x3c7421[_0xe039('0x45')][_0xe039('0x52')]){_0x36cfbf[_0xe039('0x50')]=_[_0xe039('0x53')](_0x36cfbf['where'],{'$or':_[_0xe039('0x54')](_0x36cfbf[_0xe039('0x4a')],function(_0x5858ec){var _0x404353={};_0x404353[_0x5858ec]={'$like':'%'+_0x3c7421['query'][_0xe039('0x52')]+'%'};return _0x404353;})});}_0x36cfbf=_['merge']({},_0x36cfbf,_0x3c7421[_0xe039('0x5c')]);return _0x5189d9[_0xe039('0xb0')](_0x36cfbf);}})['then'](function(_0x50ca2f){if(_0x50ca2f){_0x2fa9cc=_0x50ca2f[_0xe039('0x4b')];if(!_0x3c7421['query']['hasOwnProperty']('nolimit')){_0x36cfbf[_0xe039('0x2f')]=qs[_0xe039('0x2f')](_0x3c7421['query'][_0xe039('0x2f')]);_0x36cfbf[_0xe039('0x2d')]=qs[_0xe039('0x2d')](_0x3c7421[_0xe039('0x45')]['offset']);}return _0x5189d9[_0xe039('0xb0')](_0x36cfbf);}})[_0xe039('0x1e')](function(_0x415352){if(_0x415352){return _0x415352?{'count':_0x2fa9cc,'rows':_0x415352}:null;}})[_0xe039('0x1e')](respondWithResult(_0x4b924b,null))['catch'](handleError(_0x4b924b,null));};exports[_0xe039('0xb1')]=function(_0x7c338b,_0x4a3177,_0x448f64){var _0x102534={'raw':![],'where':{}};var _0x272149={};var _0x4ac2b6={'count':0x0,'rows':[]};return db[_0xe039('0x40')][_0xe039('0x6b')]({'where':{'id':_0x7c338b[_0xe039('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4a3177,null))[_0xe039('0x1e')](function(_0x5e8691){if(_0x5e8691){_0x272149['model']=_[_0xe039('0x46')](db[_0xe039('0x94')]['rawAttributes']);_0x272149[_0xe039('0x45')]=_['keys'](_0x7c338b[_0xe039('0x45')]);_0x272149['filters']=_[_0xe039('0x48')](_0x272149[_0xe039('0x44')],_0x272149[_0xe039('0x45')]);_0x102534[_0xe039('0x4a')]=_[_0xe039('0x48')](_0x272149[_0xe039('0x44')],qs[_0xe039('0x49')](_0x7c338b[_0xe039('0x45')][_0xe039('0x49')]));_0x102534[_0xe039('0x4a')]=_0x102534[_0xe039('0x4a')]['length']?_0x102534[_0xe039('0x4a')]:_0x272149[_0xe039('0x44')];if(!_0x7c338b[_0xe039('0x45')][_0xe039('0x4c')](_0xe039('0x4d'))){_0x102534['limit']=qs['limit'](_0x7c338b[_0xe039('0x45')][_0xe039('0x2f')]);_0x102534[_0xe039('0x2d')]=qs[_0xe039('0x2d')](_0x7c338b[_0xe039('0x45')][_0xe039('0x2d')]);}_0x102534[_0xe039('0x4e')]=qs[_0xe039('0x4f')](_0x7c338b['query'][_0xe039('0x4f')]);_0x102534[_0xe039('0x50')]=qs['filters'](_[_0xe039('0x51')](_0x7c338b['query'],_0x272149[_0xe039('0x47')]));_0x102534[_0xe039('0x50')][_0xe039('0x69')]=_0x5e8691['id'];if(_0x7c338b[_0xe039('0x45')][_0xe039('0x52')]){_0x102534['where']=_['merge'](_0x102534[_0xe039('0x50')],{'$or':_[_0xe039('0x54')](_0x102534[_0xe039('0x4a')],function(_0x473711){var _0xf7bdb8={};_0xf7bdb8[_0x473711]={'$like':'%'+_0x7c338b['query']['filter']+'%'};return _0xf7bdb8;})});}_0x102534=_[_0xe039('0x53')]({},_0x102534,_0x7c338b['options']);return db[_0xe039('0x94')]['count']({'where':_0x102534['where']})['then'](function(_0x4dd3a7){_0x4ac2b6[_0xe039('0x30')]=_0x4dd3a7;if(_0x7c338b['query'][_0xe039('0x56')]){_0x102534[_0xe039('0x57')]=[{'model':db['CmContact'],'as':_0xe039('0xb2'),'required':![]},{'model':db[_0xe039('0xa3')],'as':'Owner','attributes':[_0xe039('0x63'),_0xe039('0xb3'),_0xe039('0xb4')],'required':![]},{'model':db[_0xe039('0xb5')],'as':_0xe039('0xb6'),'attributes':['id',_0xe039('0x63'),'color'],'where':_0x7c338b[_0xe039('0x45')]['tag']?{'id':_0x7c338b[_0xe039('0x45')][_0xe039('0xb7')]}:undefined,'required':_0x7c338b[_0xe039('0x45')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xe039('0x58')](_0x102534);})[_0xe039('0x1e')](function(_0x5e11ec){_0x4ac2b6[_0xe039('0x59')]=_0x5e11ec;return _0x4ac2b6;});}})['then'](respondWithFilteredResult(_0x4a3177,_0x102534))[_0xe039('0x29')](handleError(_0x4a3177,null));};exports[_0xe039('0xb8')]=function(_0x79deb9,_0x3e1676,_0x134dde){return db[_0xe039('0x40')][_0xe039('0x5d')]({'where':{'id':_0x79deb9[_0xe039('0x5b')]['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x3e1676,null))[_0xe039('0x1e')](function(_0x9a066){if(_0x9a066){return _0x9a066[_0xe039('0xb8')](_0x79deb9[_0xe039('0x66')]['ids'],_[_0xe039('0xb9')](_0x79deb9[_0xe039('0x66')],['ids','id'])||{})[_0xe039('0x97')](function(_0x49ae13){for(var _0x3b5cc2=0x0;_0x3b5cc2<_0x79deb9[_0xe039('0x66')][_0xe039('0x6e')]['length'];_0x3b5cc2+=0x1){socket[_0xe039('0xba')](_0xe039('0xbb'),{'UserId':Number(_0x79deb9[_0xe039('0x66')][_0xe039('0x6e')][_0x3b5cc2]),'OpenchannelAccountId':Number(_0x79deb9[_0xe039('0x5b')]['id'])});}return _0x49ae13;});}})[_0xe039('0x1e')](respondWithResult(_0x3e1676,null))[_0xe039('0x29')](handleError(_0x3e1676,null));};exports[_0xe039('0xbc')]=function(_0x17ee2d,_0x44c9c5,_0x5df595){return db[_0xe039('0x40')]['find']({'where':{'id':_0x17ee2d[_0xe039('0x5b')]['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x44c9c5,null))[_0xe039('0x1e')](function(_0x132700){if(_0x132700){return _0x132700['removeAgents'](_0x17ee2d[_0xe039('0x45')][_0xe039('0x6e')])[_0xe039('0x1e')](function(){if(_[_0xe039('0xbd')](_0x17ee2d[_0xe039('0x45')][_0xe039('0x6e')])){for(var _0x33dc53=0x0;_0x33dc53<_0x17ee2d['query'][_0xe039('0x6e')]['length'];_0x33dc53+=0x1){socket[_0xe039('0xba')](_0xe039('0xbe'),{'UserId':Number(_0x17ee2d[_0xe039('0x45')][_0xe039('0x6e')][_0x33dc53]),'OpenchannelAccountId':Number(_0x17ee2d[_0xe039('0x5b')]['id'])});}}else{socket['emit'](_0xe039('0xbe'),{'UserId':Number(_0x17ee2d['query'][_0xe039('0x6e')]),'OpenchannelAccountId':Number(_0x17ee2d[_0xe039('0x5b')]['id'])});}});}})[_0xe039('0x1e')](respondWithStatusCode(_0x44c9c5,null))[_0xe039('0x29')](handleError(_0x44c9c5,null));};exports[_0xe039('0xbf')]=function(_0x1227eb,_0x554770,_0x4ea426){var _0x1d4ae3={};var _0x3d1dbc={};var _0x246cdc;var _0x5a8337;return db[_0xe039('0x40')][_0xe039('0x6b')]({'where':{'id':_0x1227eb[_0xe039('0x5b')]['id']}})['then'](handleEntityNotFound(_0x554770,null))[_0xe039('0x1e')](function(_0x1314ee){if(_0x1314ee){_0x246cdc=_0x1314ee;_0x3d1dbc[_0xe039('0x44')]=_[_0xe039('0x46')](db[_0xe039('0xa3')][_0xe039('0x41')]);_0x3d1dbc[_0xe039('0x45')]=_['keys'](_0x1227eb[_0xe039('0x45')]);_0x3d1dbc[_0xe039('0x47')]=_[_0xe039('0x48')](_0x3d1dbc[_0xe039('0x44')],_0x3d1dbc[_0xe039('0x45')]);_0x1d4ae3['attributes']=_['intersection'](_0x3d1dbc[_0xe039('0x44')],qs['fields'](_0x1227eb[_0xe039('0x45')][_0xe039('0x49')]));_0x1d4ae3['attributes']=_0x1d4ae3[_0xe039('0x4a')]['length']?_0x1d4ae3[_0xe039('0x4a')]:_0x3d1dbc[_0xe039('0x44')];_0x1d4ae3[_0xe039('0x4e')]=qs[_0xe039('0x4f')](_0x1227eb[_0xe039('0x45')]['sort']);_0x1d4ae3[_0xe039('0x50')]=qs[_0xe039('0x47')](_[_0xe039('0x51')](_0x1227eb['query'],_0x3d1dbc['filters']));if(_0x1227eb['query'][_0xe039('0x52')]){_0x1d4ae3[_0xe039('0x50')]=_[_0xe039('0x53')](_0x1d4ae3[_0xe039('0x50')],{'$or':_['map'](_0x1d4ae3[_0xe039('0x4a')],function(_0x63f1b3){var _0x6a9e72={};_0x6a9e72[_0x63f1b3]={'$like':'%'+_0x1227eb[_0xe039('0x45')][_0xe039('0x52')]+'%'};return _0x6a9e72;})});}_0x1d4ae3=_[_0xe039('0x53')]({},_0x1d4ae3,_0x1227eb[_0xe039('0x5c')]);return _0x246cdc[_0xe039('0xbf')](_0x1d4ae3);}})[_0xe039('0x1e')](function(_0x31db8c){if(_0x31db8c){_0x5a8337=_0x31db8c['length'];if(!_0x1227eb[_0xe039('0x45')][_0xe039('0x4c')](_0xe039('0x4d'))){_0x1d4ae3[_0xe039('0x2f')]=qs[_0xe039('0x2f')](_0x1227eb['query'][_0xe039('0x2f')]);_0x1d4ae3['offset']=qs[_0xe039('0x2d')](_0x1227eb[_0xe039('0x45')][_0xe039('0x2d')]);}return _0x246cdc['getAgents'](_0x1d4ae3);}})[_0xe039('0x1e')](function(_0x38cf8f){if(_0x38cf8f){return _0x38cf8f?{'count':_0x5a8337,'rows':_0x38cf8f}:null;}})[_0xe039('0x1e')](respondWithResult(_0x554770,null))[_0xe039('0x29')](handleError(_0x554770,null));};exports[_0xe039('0x3c')]=function(_0x210b85,_0x3385af,_0x1b09b0){var _0x192a05,_0x41dbf0,_0x5ada04;if(_['isNil'](_0x210b85[_0xe039('0x66')]['body'])||_0x210b85[_0xe039('0x66')]['body']===''){throw new db[(_0xe039('0x7f'))]['ValidationError'](_0xe039('0x80'));}if(_[_0xe039('0x7b')](_0x210b85['body']['to'])){}_0x192a05=_0x210b85['body']['to'];return db[_0xe039('0x40')][_0xe039('0x6b')]({'where':{'id':_0x210b85['params']['id']}})[_0xe039('0x1e')](handleEntityNotFound(_0x3385af,null))[_0xe039('0x1e')](function(_0x52b691){if(_0x52b691){return db[_0xe039('0x40')][_0xe039('0x5d')]({'where':{'id':_0x52b691['id']},'include':[{'model':db[_0xe039('0xc0')],'as':_0xe039('0x85'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x52b691[_0xe039('0x81')]]:_0x192a05},'limit':0x1,'order':[['updatedAt',_0xe039('0x86')]]}]}]})[_0xe039('0x1e')](handleEntityNotFound(_0x3385af,null))[_0xe039('0x1e')](function(_0x1552e0){if(_0x1552e0&&_0x1552e0['List']){_0x41dbf0=_0x1552e0['get']({'plain':!![]});if(_0x41dbf0[_0xe039('0x85')]&&_0x41dbf0[_0xe039('0x85')]['Contacts']['length']){return _0x41dbf0[_0xe039('0x85')][_0xe039('0x8f')][0x0];}return db[_0xe039('0x75')][_0xe039('0x5e')](_[_0xe039('0x16')](_0x210b85[_0xe039('0x66')],{'firstName':_0x192a05,[_0x1552e0[_0xe039('0x81')]]:_0x192a05,'phone':_0x192a05,'ListId':_0x41dbf0[_0xe039('0x7a')]}));}})[_0xe039('0x1e')](handleEntityNotFound(_0x3385af,null))[_0xe039('0x1e')](function(_0x23e225){if(_0x23e225){_0x5ada04=_0x23e225;return db[_0xe039('0x94')][_0xe039('0x5d')]({'where':{'ContactId':_0x5ada04['id'],'closed':![],'OpenchannelAccountId':_0x41dbf0['id']}})[_0xe039('0x1e')](function(_0x5e6d66){if(_0x5e6d66){return[_0x5e6d66,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x210b85[_0xe039('0x5f')]['id'],'ContactId':_0x5ada04['id'],'OpenchannelAccountId':_0x41dbf0['id'],'lastMsgDirection':'out','Messages':[_[_0xe039('0x53')](_0x210b85[_0xe039('0x66')],{'read':![],'body':_0x210b85[_0xe039('0x66')][_0xe039('0x66')],'OpenchannelAccountId':_0x41dbf0['id'],'UserId':_0x210b85[_0xe039('0x5f')]['id'],'ContactId':_0x5ada04['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xe039('0xc1')}]})['then'](function(_0x50c9a7){return[_0x50c9a7,!![]];});});}})['spread'](function(_0x1f85e4,_0x36b0a9){if(_0x36b0a9){return _0x1f85e4;}return db[_0xe039('0xa0')][_0xe039('0x5e')](_['merge'](_0x210b85[_0xe039('0x66')],{'read':![],'body':_0x210b85[_0xe039('0x66')]['body'],'OpenchannelAccountId':_0x41dbf0['id'],'OpenchannelInteractionId':_0x1f85e4['id'],'UserId':_0x210b85[_0xe039('0x5f')]['id'],'ContactId':_0x5ada04['id']}))[_0xe039('0x1e')](function(_0x39ecf5){_0x1f85e4[_0xe039('0xc2')]['Messages']=[];_0x1f85e4['dataValues'][_0xe039('0xc1')][_0xe039('0x9c')](_0x39ecf5[_0xe039('0xc2')]);return _0x1f85e4;});});}})[_0xe039('0x1e')](respondWithResult(_0x3385af,null))[_0xe039('0x29')](handleError(_0x3385af,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 74ef9a2..d5fa56f 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 _0x9348=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x34bbe3,_0x28d122){var _0x4301aa=function(_0x3a7d0d){while(--_0x3a7d0d){_0x34bbe3['push'](_0x34bbe3['shift']());}};_0x4301aa(++_0x28d122);}(_0x9348,0x10d));var _0x8934=function(_0x68035a,_0x350f4e){_0x68035a=_0x68035a-0x0;var _0x47c80d=_0x9348[_0x68035a];return _0x47c80d;};'use strict';var EventEmitter=require(_0x8934('0x0'));var OpenchannelAccount=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];OpenchannelAccount[_0x8934('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x5ff3=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','update','remove'];(function(_0x17f8ad,_0x440e11){var _0x506c68=function(_0x4fa0dc){while(--_0x4fa0dc){_0x17f8ad['push'](_0x17f8ad['shift']());}};_0x506c68(++_0x440e11);}(_0x5ff3,0x17d));var _0x35ff=function(_0x318cba,_0x1fa99d){_0x318cba=_0x318cba-0x0;var _0x1f640f=_0x5ff3[_0x318cba];return _0x1f640f;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x35ff('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x35ff('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x35ff('0x2'),'afterDestroy':_0x35ff('0x3')};function emitEvent(_0x3bd66a){return function(_0xd0846d,_0x551514,_0x2fcb74){OpenchannelAccountEvents[_0x35ff('0x4')](_0x3bd66a+':'+_0xd0846d['id'],_0xd0846d);OpenchannelAccountEvents[_0x35ff('0x4')](_0x3bd66a,_0xd0846d);_0x2fcb74(null);};}for(var e in events){if(events[_0x35ff('0x5')](e)){var event=events[e];OpenchannelAccount[_0x35ff('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index a9e55f4..83ae64e 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(_0x2c02f3,_0x1454a7){var _0xce5dac=function(_0x5270ea){while(--_0x5270ea){_0x2c02f3['push'](_0x2c02f3['shift']());}};_0xce5dac(++_0x1454a7);}(_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 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(_0x501930,_0x3c2395){var _0x53a6a4=function(_0x59aaa1){while(--_0x59aaa1){_0x501930['push'](_0x501930['shift']());}};_0x53a6a4(++_0x3c2395);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 b088900..c41a452 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 _0xeb74=['request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./openchannelAccount.socket','register'];(function(_0x2d1322,_0x4f2786){var _0x33c165=function(_0x3fe7e7){while(--_0x3fe7e7){_0x2d1322['push'](_0x2d1322['shift']());}};_0x33c165(++_0x4f2786);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4bd94f,_0x57795e){_0x4bd94f=_0x4bd94f-0x0;var _0x1ff65c=_0xeb74[_0x4bd94f];return _0x1ff65c;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});config[_0x4eb7('0xc')]=_['defaults'](config[_0x4eb7('0xc')],{'host':_0x4eb7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4eb7('0xe'))[_0x4eb7('0xf')](socket);function respondWithRpcPromise(_0x4b3add,_0xa72e98,_0x4ff98e){return new BPromise(function(_0x3326cd,_0x462392){return client[_0x4eb7('0x10')](_0x4b3add,_0x4ff98e)['then'](function(_0x2b32be){logger[_0x4eb7('0x11')](_0x4eb7('0x12'),_0xa72e98,_0x4eb7('0x13'));logger[_0x4eb7('0x14')](_0x4eb7('0x15'),_0xa72e98,_0x4eb7('0x13'),JSON['stringify'](_0x2b32be));if(_0x2b32be['error']){if(_0x2b32be['error'][_0x4eb7('0x16')]===0x1f4){logger['error'](_0x4eb7('0x12'),_0xa72e98,_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);return _0x462392(_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);}logger[_0x4eb7('0x17')](_0x4eb7('0x12'),_0xa72e98,_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);return _0x3326cd(_0x2b32be[_0x4eb7('0x17')]['message']);}else{logger[_0x4eb7('0x11')](_0x4eb7('0x12'),_0xa72e98,_0x4eb7('0x13'));_0x3326cd(_0x2b32be[_0x4eb7('0x19')][_0x4eb7('0x18')]);}})[_0x4eb7('0x1a')](function(_0x2d0ea7){logger[_0x4eb7('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0xa72e98,_0x2d0ea7);_0x462392(_0x2d0ea7);});});} \ No newline at end of file +var _0x0490=['result','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5c3f64,_0x5df0b5){var _0x3d6fa9=function(_0x267b95){while(--_0x267b95){_0x5c3f64['push'](_0x5c3f64['shift']());}};_0x3d6fa9(++_0x5df0b5);}(_0x0490,0x147));var _0x0049=function(_0x2c1b2c,_0x18094e){_0x2c1b2c=_0x2c1b2c-0x0;var _0x131495=_0x0490[_0x2c1b2c];return _0x131495;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0049('0x1'))['db'];var utils=require(_0x0049('0x2'));var logger=require(_0x0049('0x3'))(_0x0049('0x4'));var config=require(_0x0049('0x5'));var jayson=require(_0x0049('0x6'));var client=jayson[_0x0049('0x7')][_0x0049('0x8')]({'port':0x232a});config[_0x0049('0x9')]=_['defaults'](config[_0x0049('0x9')],{'host':_0x0049('0xa'),'port':0x18eb});var socket=require(_0x0049('0xb'))(new Redis(config['redis']));require(_0x0049('0xc'))[_0x0049('0xd')](socket);function respondWithRpcPromise(_0x4165c2,_0x41c511,_0x266001){return new BPromise(function(_0x3409c6,_0xf3c508){return client[_0x0049('0xe')](_0x4165c2,_0x266001)[_0x0049('0xf')](function(_0x52f313){logger[_0x0049('0x10')](_0x0049('0x11'),_0x41c511,_0x0049('0x12'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x41c511,_0x0049('0x12'),JSON[_0x0049('0x13')](_0x52f313));if(_0x52f313[_0x0049('0x14')]){if(_0x52f313[_0x0049('0x14')][_0x0049('0x15')]===0x1f4){logger['error'](_0x0049('0x11'),_0x41c511,_0x52f313[_0x0049('0x14')]['message']);return _0xf3c508(_0x52f313[_0x0049('0x14')][_0x0049('0x16')]);}logger[_0x0049('0x14')](_0x0049('0x11'),_0x41c511,_0x52f313['error']['message']);return _0x3409c6(_0x52f313[_0x0049('0x14')][_0x0049('0x16')]);}else{logger[_0x0049('0x10')](_0x0049('0x11'),_0x41c511,_0x0049('0x12'));_0x3409c6(_0x52f313[_0x0049('0x17')][_0x0049('0x16')]);}})[_0x0049('0x18')](function(_0x6df63c){logger[_0x0049('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x41c511,_0x6df63c);_0xf3c508(_0x6df63c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index efd987b..1ede0fc 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 _0x3df4=['emit','register','openchannelAccount:','remove','update'];(function(_0xb25c38,_0x3ca4f9){var _0x4dfa8e=function(_0xad9cab){while(--_0xad9cab){_0xb25c38['push'](_0xb25c38['shift']());}};_0x4dfa8e(++_0x3ca4f9);}(_0x3df4,0x102));var _0x43df=function(_0x213f8d,_0x25750e){_0x213f8d=_0x213f8d-0x0;var _0x1ce570=_0x3df4[_0x213f8d];return _0x1ce570;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x43df('0x0'),_0x43df('0x1')];function createListener(_0x40bf18,_0x206707){return function(_0x38a050){_0x206707[_0x43df('0x2')](_0x40bf18,_0x38a050);};}function removeListener(_0x4297f4,_0x5affd4){return function(){OpenchannelAccountEvents['removeListener'](_0x4297f4,_0x5affd4);};}exports[_0x43df('0x3')]=function(_0x3111bf){for(var _0x3af1ec=0x0,_0x43fd8c=events['length'];_0x3af1ec<_0x43fd8c;_0x3af1ec++){var _0x5863be=events[_0x3af1ec];var _0x2492a9=createListener(_0x43df('0x4')+_0x5863be,_0x3111bf);OpenchannelAccountEvents['on'](_0x5863be,_0x2492a9);}}; \ No newline at end of file +var _0x6931=['./openchannelAccount.events','save','removeListener','length','openchannelAccount:'];(function(_0x3e2f32,_0x3d08aa){var _0x8e167a=function(_0x209eff){while(--_0x209eff){_0x3e2f32['push'](_0x3e2f32['shift']());}};_0x8e167a(++_0x3d08aa);}(_0x6931,0xa5));var _0x1693=function(_0x4641e6,_0x4a7742){_0x4641e6=_0x4641e6-0x0;var _0x355ef4=_0x6931[_0x4641e6];return _0x355ef4;};'use strict';var OpenchannelAccountEvents=require(_0x1693('0x0'));var events=[_0x1693('0x1'),'remove','update'];function createListener(_0x7828b9,_0x190052){return function(_0x37c53b){_0x190052['emit'](_0x7828b9,_0x37c53b);};}function removeListener(_0x1c8ac6,_0x3ea966){return function(){OpenchannelAccountEvents[_0x1693('0x2')](_0x1c8ac6,_0x3ea966);};}exports['register']=function(_0x361381){for(var _0x4bd166=0x0,_0x3594e0=events[_0x1693('0x3')];_0x4bd166<_0x3594e0;_0x4bd166++){var _0x328cfc=events[_0x4bd166];var _0x2ab0a0=createListener(_0x1693('0x4')+_0x328cfc,_0x361381);OpenchannelAccountEvents['on'](_0x328cfc,_0x2ab0a0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 93468a9..7c9ccce 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 _0x5b92=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x413221,_0x348dee){var _0x22db25=function(_0x483dbf){while(--_0x483dbf){_0x413221['push'](_0x413221['shift']());}};_0x22db25(++_0x348dee);}(_0x5b92,0xe7));var _0x25b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b92[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x25b9('0x0'));var util=require('util');var path=require(_0x25b9('0x1'));var timeout=require(_0x25b9('0x2'));var express=require(_0x25b9('0x3'));var router=express[_0x25b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x25b9('0x5'));var interaction=require(_0x25b9('0x6'));var config=require(_0x25b9('0x7'));var controller=require(_0x25b9('0x8'));router['get']('/',auth[_0x25b9('0x9')](),controller[_0x25b9('0xa')]);router[_0x25b9('0xb')](_0x25b9('0xc'),auth[_0x25b9('0x9')](),controller[_0x25b9('0xd')]);router[_0x25b9('0xe')]('/',auth[_0x25b9('0x9')](),controller[_0x25b9('0xf')]);router[_0x25b9('0x10')]('/:id',auth[_0x25b9('0x9')](),controller[_0x25b9('0x11')]);router[_0x25b9('0x12')](_0x25b9('0xc'),auth['isAuthenticated'](),controller[_0x25b9('0x13')]);module[_0x25b9('0x14')]=router; \ No newline at end of file +var _0x1c92=['index','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated'];(function(_0x492c32,_0xee507c){var _0x4e8db7=function(_0x759d20){while(--_0x759d20){_0x492c32['push'](_0x492c32['shift']());}};_0x4e8db7(++_0xee507c);}(_0x1c92,0xbd));var _0x21c9=function(_0x236eee,_0x32421f){_0x236eee=_0x236eee-0x0;var _0x1dd280=_0x1c92[_0x236eee];return _0x1dd280;};'use strict';var multer=require(_0x21c9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x21c9('0x1'));var express=require(_0x21c9('0x2'));var router=express[_0x21c9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x21c9('0x4'));var interaction=require(_0x21c9('0x5'));var config=require('../../config/environment');var controller=require(_0x21c9('0x6'));router[_0x21c9('0x7')]('/',auth[_0x21c9('0x8')](),controller[_0x21c9('0x9')]);router['get'](_0x21c9('0xa'),auth[_0x21c9('0x8')](),controller[_0x21c9('0xb')]);router['post']('/',auth[_0x21c9('0x8')](),controller[_0x21c9('0xc')]);router[_0x21c9('0xd')](_0x21c9('0xa'),auth[_0x21c9('0x8')](),controller[_0x21c9('0xe')]);router[_0x21c9('0xf')](_0x21c9('0xa'),auth['isAuthenticated'](),controller[_0x21c9('0x10')]);module[_0x21c9('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 5fe3a8c..9bcd2a7 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 _0xddd1=['exports','INTEGER','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xddd1,0x15b));var _0x1ddd=function(_0x116958,_0x2271ce){_0x116958=_0x116958-0x0;var _0x5904dc=_0xddd1[_0x116958];return _0x5904dc;};'use strict';var Sequelize=require(_0x1ddd('0x0'));module[_0x1ddd('0x1')]={'priority':{'type':Sequelize[_0x1ddd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1ddd('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1ddd('0x3')]},'interval':{'type':Sequelize[_0x1ddd('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xdf2e=['*,*,*,*','sequelize','INTEGER','TEXT','STRING'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0xdf2e,0x146));var _0xedf2=function(_0x2ceba7,_0x451ce4){_0x2ceba7=_0x2ceba7-0x0;var _0x5348eb=_0xdf2e[_0x2ceba7];return _0x5348eb;};'use strict';var Sequelize=require(_0xedf2('0x0'));module['exports']={'priority':{'type':Sequelize[_0xedf2('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xedf2('0x2')]()},'description':{'type':Sequelize[_0xedf2('0x3')]},'interval':{'type':Sequelize[_0xedf2('0x3')],'defaultValue':_0xedf2('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 156ace7..1bb8e9f 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 _0xe97e=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','OpenchannelApplication','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache'];(function(_0x323ed2,_0x2f8dd6){var _0x1cbbb5=function(_0x6c916e){while(--_0x6c916e){_0x323ed2['push'](_0x323ed2['shift']());}};_0x1cbbb5(++_0x2f8dd6);}(_0xe97e,0xdb));var _0xee97=function(_0x568ff4,_0x57fc05){_0x568ff4=_0x568ff4-0x0;var _0x3235da=_0xe97e[_0x568ff4];return _0x3235da;};'use strict';var emlformat=require(_0xee97('0x0'));var rimraf=require(_0xee97('0x1'));var zipdir=require(_0xee97('0x2'));var jsonpatch=require(_0xee97('0x3'));var rp=require(_0xee97('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee97('0x5'));var util=require(_0xee97('0x6'));var path=require('path');var sox=require(_0xee97('0x7'));var csv=require(_0xee97('0x8'));var ejs=require(_0xee97('0x9'));var fs=require('fs');var fs_extra=require(_0xee97('0xa'));var _=require(_0xee97('0xb'));var squel=require(_0xee97('0xc'));var crypto=require(_0xee97('0xd'));var jsforce=require(_0xee97('0xe'));var deskjs=require(_0xee97('0xf'));var toCsv=require(_0xee97('0x8'));var querystring=require(_0xee97('0x10'));var Papa=require('papaparse');var Redis=require(_0xee97('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xee97('0x12'));var as=require(_0xee97('0x13'));var hardwareService=require(_0xee97('0x14'));var logger=require(_0xee97('0x15'))(_0xee97('0x16'));var utils=require(_0xee97('0x17'));var config=require(_0xee97('0x18'));var licenseUtil=require(_0xee97('0x19'));var db=require(_0xee97('0x1a'))['db'];function respondWithStatusCode(_0x571ed3,_0xb0e7a4){_0xb0e7a4=_0xb0e7a4||0xcc;return function(_0x3fa405){if(_0x3fa405){return _0x571ed3[_0xee97('0x1b')](_0xb0e7a4);}return _0x571ed3[_0xee97('0x1c')](_0xb0e7a4)[_0xee97('0x1d')]();};}function respondWithResult(_0x5b0ac,_0x205ddd){_0x205ddd=_0x205ddd||0xc8;return function(_0xcec99c){if(_0xcec99c){return _0x5b0ac[_0xee97('0x1c')](_0x205ddd)['json'](_0xcec99c);}};}function respondWithFilteredResult(_0x3d9742,_0x31fea5){return function(_0x198f67){if(_0x198f67){var _0x2ccd58=typeof _0x31fea5[_0xee97('0x1e')]===_0xee97('0x1f')&&typeof _0x31fea5['limit']===_0xee97('0x1f');var _0x508d97=_0x198f67['count'];var _0xaed55f=_0x2ccd58?0x0:_0x31fea5[_0xee97('0x1e')];var _0x90f2ec=_0x2ccd58?_0x198f67['count']:_0x31fea5[_0xee97('0x1e')]+_0x31fea5[_0xee97('0x20')];var _0x2a39d4;if(_0x90f2ec>=_0x508d97){_0x90f2ec=_0x508d97;_0x2a39d4=0xc8;}else{_0x2a39d4=0xce;}_0x3d9742[_0xee97('0x1c')](_0x2a39d4);return _0x3d9742[_0xee97('0x21')](_0xee97('0x22'),_0xaed55f+'-'+_0x90f2ec+'/'+_0x508d97)[_0xee97('0x23')](_0x198f67);}return null;};}function patchUpdates(_0x1131c2){return function(_0x3f2d0c){try{jsonpatch[_0xee97('0x24')](_0x3f2d0c,_0x1131c2,!![]);}catch(_0x4653b8){return BPromise[_0xee97('0x25')](_0x4653b8);}return _0x3f2d0c['save']();};}function saveUpdates(_0x1c1e82,_0x59be25){return function(_0x4c9e4f){if(_0x4c9e4f){return _0x4c9e4f[_0xee97('0x26')](_0x1c1e82)[_0xee97('0x27')](function(_0x28ac56){return _0x28ac56;});}return null;};}function removeEntity(_0x20fb30,_0x15fb46){return function(_0x2e644b){if(_0x2e644b){return _0x2e644b[_0xee97('0x28')]()[_0xee97('0x27')](function(){_0x20fb30[_0xee97('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a6c88,_0x17be22){return function(_0x5b3c98){if(!_0x5b3c98){_0x5a6c88['sendStatus'](0x194);}return _0x5b3c98;};}function handleError(_0x5275dd,_0x393d23){_0x393d23=_0x393d23||0x1f4;return function(_0x5b9b15){logger['error'](_0x5b9b15['stack']);if(_0x5b9b15[_0xee97('0x29')]){delete _0x5b9b15[_0xee97('0x29')];}_0x5275dd['status'](_0x393d23)[_0xee97('0x2a')](_0x5b9b15);};}exports[_0xee97('0x2b')]=function(_0x3c8cac,_0x7e365a){var _0x2dc9af={},_0x452369={},_0x46ebae={'count':0x0,'rows':[]};var _0x1fd370=_[_0xee97('0x2c')](db['OpenchannelApplication'][_0xee97('0x2d')],function(_0xa381b8){return{'name':_0xa381b8[_0xee97('0x2e')],'type':_0xa381b8[_0xee97('0x2f')][_0xee97('0x30')]};});_0x452369[_0xee97('0x31')]=_[_0xee97('0x2c')](_0x1fd370,'name');_0x452369[_0xee97('0x32')]=_[_0xee97('0x33')](_0x3c8cac[_0xee97('0x32')]);_0x452369[_0xee97('0x34')]=_[_0xee97('0x35')](_0x452369[_0xee97('0x31')],_0x452369[_0xee97('0x32')]);_0x2dc9af[_0xee97('0x36')]=_[_0xee97('0x35')](_0x452369[_0xee97('0x31')],qs[_0xee97('0x37')](_0x3c8cac[_0xee97('0x32')][_0xee97('0x37')]));_0x2dc9af['attributes']=_0x2dc9af[_0xee97('0x36')][_0xee97('0x38')]?_0x2dc9af['attributes']:_0x452369[_0xee97('0x31')];if(!_0x3c8cac[_0xee97('0x32')]['hasOwnProperty'](_0xee97('0x39'))){_0x2dc9af[_0xee97('0x20')]=qs[_0xee97('0x20')](_0x3c8cac['query'][_0xee97('0x20')]);_0x2dc9af[_0xee97('0x1e')]=qs[_0xee97('0x1e')](_0x3c8cac[_0xee97('0x32')][_0xee97('0x1e')]);}_0x2dc9af[_0xee97('0x3a')]=qs[_0xee97('0x3b')](_0x3c8cac[_0xee97('0x32')]['sort']);_0x2dc9af[_0xee97('0x3c')]=qs[_0xee97('0x34')](_[_0xee97('0x3d')](_0x3c8cac['query'],_0x452369[_0xee97('0x34')]),_0x1fd370);if(_0x3c8cac['query']['filter']){_0x2dc9af[_0xee97('0x3c')]=_[_0xee97('0x3e')](_0x2dc9af[_0xee97('0x3c')],{'$or':_[_0xee97('0x2c')](_0x1fd370,function(_0x2463de){if(_0x2463de[_0xee97('0x2f')]!=='VIRTUAL'){var _0x491455={};_0x491455[_0x2463de[_0xee97('0x29')]]={'$like':'%'+_0x3c8cac[_0xee97('0x32')][_0xee97('0x3f')]+'%'};return _0x491455;}})});}_0x2dc9af=_[_0xee97('0x3e')]({},_0x2dc9af,_0x3c8cac[_0xee97('0x40')]);var _0x109341={'where':_0x2dc9af['where']};return db['OpenchannelApplication']['count'](_0x109341)['then'](function(_0xc8d977){_0x46ebae['count']=_0xc8d977;if(_0x3c8cac[_0xee97('0x32')][_0xee97('0x41')]){_0x2dc9af[_0xee97('0x42')]=[{'all':!![]}];}return db[_0xee97('0x43')]['findAll'](_0x2dc9af);})[_0xee97('0x27')](function(_0x3ba7b1){_0x46ebae[_0xee97('0x44')]=_0x3ba7b1;return _0x46ebae;})['then'](respondWithFilteredResult(_0x7e365a,_0x2dc9af))[_0xee97('0x45')](handleError(_0x7e365a,null));};exports[_0xee97('0x46')]=function(_0x1349de,_0x30f450){var _0x5bb5bd={'raw':!![],'where':{'id':_0x1349de[_0xee97('0x47')]['id']}},_0x2fbc30={};_0x2fbc30[_0xee97('0x31')]=_[_0xee97('0x33')](db[_0xee97('0x43')][_0xee97('0x2d')]);_0x2fbc30[_0xee97('0x32')]=_[_0xee97('0x33')](_0x1349de['query']);_0x2fbc30[_0xee97('0x34')]=_[_0xee97('0x35')](_0x2fbc30['model'],_0x2fbc30['query']);_0x5bb5bd[_0xee97('0x36')]=_[_0xee97('0x35')](_0x2fbc30[_0xee97('0x31')],qs['fields'](_0x1349de['query'][_0xee97('0x37')]));_0x5bb5bd[_0xee97('0x36')]=_0x5bb5bd['attributes'][_0xee97('0x38')]?_0x5bb5bd['attributes']:_0x2fbc30['model'];if(_0x1349de[_0xee97('0x32')][_0xee97('0x41')]){_0x5bb5bd['include']=[{'all':!![]}];}_0x5bb5bd=_[_0xee97('0x3e')]({},_0x5bb5bd,_0x1349de['options']);return db[_0xee97('0x43')]['find'](_0x5bb5bd)['then'](handleEntityNotFound(_0x30f450,null))[_0xee97('0x27')](respondWithResult(_0x30f450,null))[_0xee97('0x45')](handleError(_0x30f450,null));};exports[_0xee97('0x48')]=function(_0x199795,_0x37135b){return db[_0xee97('0x43')][_0xee97('0x48')](_0x199795[_0xee97('0x49')],{})[_0xee97('0x27')](respondWithResult(_0x37135b,0xc9))[_0xee97('0x45')](handleError(_0x37135b,null));};exports['update']=function(_0x54b503,_0x65558d){if(_0x54b503[_0xee97('0x49')]['id']){delete _0x54b503[_0xee97('0x49')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x54b503[_0xee97('0x47')]['id']}})[_0xee97('0x27')](handleEntityNotFound(_0x65558d,null))[_0xee97('0x27')](saveUpdates(_0x54b503[_0xee97('0x49')],null))[_0xee97('0x27')](respondWithResult(_0x65558d,null))[_0xee97('0x45')](handleError(_0x65558d,null));};exports[_0xee97('0x28')]=function(_0xf096b9,_0x1de452){return db[_0xee97('0x43')][_0xee97('0x4a')]({'where':{'id':_0xf096b9['params']['id']}})[_0xee97('0x27')](handleEntityNotFound(_0x1de452,null))[_0xee97('0x27')](removeEntity(_0x1de452,null))['catch'](handleError(_0x1de452,null));}; \ No newline at end of file +var _0xd493=['save','update','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','create','body','find','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x2fa29d,_0x131334){var _0x806e7d=function(_0x40df9a){while(--_0x40df9a){_0x2fa29d['push'](_0x2fa29d['shift']());}};_0x806e7d(++_0x131334);}(_0xd493,0x190));var _0x3d49=function(_0x1e8d3b,_0x24aa9b){_0x1e8d3b=_0x1e8d3b-0x0;var _0xb4258e=_0xd493[_0x1e8d3b];return _0xb4258e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d49('0x0'));var jsonpatch=require(_0x3d49('0x1'));var rp=require(_0x3d49('0x2'));var moment=require(_0x3d49('0x3'));var BPromise=require(_0x3d49('0x4'));var Mustache=require(_0x3d49('0x5'));var util=require('util');var path=require(_0x3d49('0x6'));var sox=require('sox');var csv=require(_0x3d49('0x7'));var ejs=require(_0x3d49('0x8'));var fs=require('fs');var fs_extra=require(_0x3d49('0x9'));var _=require(_0x3d49('0xa'));var squel=require(_0x3d49('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3d49('0xc'));var toCsv=require(_0x3d49('0x7'));var querystring=require(_0x3d49('0xd'));var Papa=require(_0x3d49('0xe'));var Redis=require(_0x3d49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3d49('0x10'));var as=require(_0x3d49('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d49('0x12'))('api');var utils=require(_0x3d49('0x13'));var config=require(_0x3d49('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x62a8b5,_0x5d481a){_0x5d481a=_0x5d481a||0xcc;return function(_0x502b2a){if(_0x502b2a){return _0x62a8b5[_0x3d49('0x15')](_0x5d481a);}return _0x62a8b5['status'](_0x5d481a)[_0x3d49('0x16')]();};}function respondWithResult(_0x3689ec,_0x398098){_0x398098=_0x398098||0xc8;return function(_0x44d357){if(_0x44d357){return _0x3689ec[_0x3d49('0x17')](_0x398098)[_0x3d49('0x18')](_0x44d357);}};}function respondWithFilteredResult(_0x40215a,_0x4c1663){return function(_0x186866){if(_0x186866){var _0x1fa388=typeof _0x4c1663[_0x3d49('0x19')]===_0x3d49('0x1a')&&typeof _0x4c1663[_0x3d49('0x1b')]===_0x3d49('0x1a');var _0x2d69ef=_0x186866[_0x3d49('0x1c')];var _0xe41ad6=_0x1fa388?0x0:_0x4c1663[_0x3d49('0x19')];var _0x3c891c=_0x1fa388?_0x186866['count']:_0x4c1663['offset']+_0x4c1663[_0x3d49('0x1b')];var _0x47641a;if(_0x3c891c>=_0x2d69ef){_0x3c891c=_0x2d69ef;_0x47641a=0xc8;}else{_0x47641a=0xce;}_0x40215a[_0x3d49('0x17')](_0x47641a);return _0x40215a['set'](_0x3d49('0x1d'),_0xe41ad6+'-'+_0x3c891c+'/'+_0x2d69ef)[_0x3d49('0x18')](_0x186866);}return null;};}function patchUpdates(_0x4a4662){return function(_0x361a66){try{jsonpatch[_0x3d49('0x1e')](_0x361a66,_0x4a4662,!![]);}catch(_0x48d3d9){return BPromise[_0x3d49('0x1f')](_0x48d3d9);}return _0x361a66[_0x3d49('0x20')]();};}function saveUpdates(_0x3b5419,_0x5f2ea5){return function(_0x533e5a){if(_0x533e5a){return _0x533e5a[_0x3d49('0x21')](_0x3b5419)[_0x3d49('0x22')](function(_0x40f7b4){return _0x40f7b4;});}return null;};}function removeEntity(_0xda823f,_0x129471){return function(_0x46a8e3){if(_0x46a8e3){return _0x46a8e3['destroy']()['then'](function(){_0xda823f['status'](0xcc)[_0x3d49('0x16')]();});}};}function handleEntityNotFound(_0x167918,_0x850914){return function(_0x526e96){if(!_0x526e96){_0x167918[_0x3d49('0x15')](0x194);}return _0x526e96;};}function handleError(_0xcaf759,_0x4bf5b2){_0x4bf5b2=_0x4bf5b2||0x1f4;return function(_0x3680e4){logger[_0x3d49('0x23')](_0x3680e4[_0x3d49('0x24')]);if(_0x3680e4[_0x3d49('0x25')]){delete _0x3680e4[_0x3d49('0x25')];}_0xcaf759['status'](_0x4bf5b2)[_0x3d49('0x26')](_0x3680e4);};}exports[_0x3d49('0x27')]=function(_0x37acb3,_0x540f46){var _0x16e9b4={},_0x381e4f={},_0x34de3e={'count':0x0,'rows':[]};var _0x4997ac=_[_0x3d49('0x28')](db[_0x3d49('0x29')][_0x3d49('0x2a')],function(_0x316e79){return{'name':_0x316e79[_0x3d49('0x2b')],'type':_0x316e79[_0x3d49('0x2c')][_0x3d49('0x2d')]};});_0x381e4f[_0x3d49('0x2e')]=_[_0x3d49('0x28')](_0x4997ac,_0x3d49('0x25'));_0x381e4f[_0x3d49('0x2f')]=_['keys'](_0x37acb3[_0x3d49('0x2f')]);_0x381e4f[_0x3d49('0x30')]=_[_0x3d49('0x31')](_0x381e4f[_0x3d49('0x2e')],_0x381e4f[_0x3d49('0x2f')]);_0x16e9b4['attributes']=_['intersection'](_0x381e4f[_0x3d49('0x2e')],qs[_0x3d49('0x32')](_0x37acb3['query']['fields']));_0x16e9b4[_0x3d49('0x33')]=_0x16e9b4[_0x3d49('0x33')][_0x3d49('0x34')]?_0x16e9b4[_0x3d49('0x33')]:_0x381e4f[_0x3d49('0x2e')];if(!_0x37acb3[_0x3d49('0x2f')][_0x3d49('0x35')](_0x3d49('0x36'))){_0x16e9b4[_0x3d49('0x1b')]=qs[_0x3d49('0x1b')](_0x37acb3[_0x3d49('0x2f')][_0x3d49('0x1b')]);_0x16e9b4[_0x3d49('0x19')]=qs[_0x3d49('0x19')](_0x37acb3[_0x3d49('0x2f')][_0x3d49('0x19')]);}_0x16e9b4[_0x3d49('0x37')]=qs[_0x3d49('0x38')](_0x37acb3['query']['sort']);_0x16e9b4[_0x3d49('0x39')]=qs['filters'](_['pick'](_0x37acb3[_0x3d49('0x2f')],_0x381e4f[_0x3d49('0x30')]),_0x4997ac);if(_0x37acb3[_0x3d49('0x2f')][_0x3d49('0x3a')]){_0x16e9b4[_0x3d49('0x39')]=_[_0x3d49('0x3b')](_0x16e9b4[_0x3d49('0x39')],{'$or':_[_0x3d49('0x28')](_0x4997ac,function(_0x5ea1a4){if(_0x5ea1a4[_0x3d49('0x2c')]!==_0x3d49('0x3c')){var _0x3d2ace={};_0x3d2ace[_0x5ea1a4[_0x3d49('0x25')]]={'$like':'%'+_0x37acb3[_0x3d49('0x2f')][_0x3d49('0x3a')]+'%'};return _0x3d2ace;}})});}_0x16e9b4=_[_0x3d49('0x3b')]({},_0x16e9b4,_0x37acb3[_0x3d49('0x3d')]);var _0x4e3857={'where':_0x16e9b4[_0x3d49('0x39')]};return db['OpenchannelApplication']['count'](_0x4e3857)['then'](function(_0x47b668){_0x34de3e[_0x3d49('0x1c')]=_0x47b668;if(_0x37acb3['query'][_0x3d49('0x3e')]){_0x16e9b4[_0x3d49('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x3d49('0x40')](_0x16e9b4);})['then'](function(_0x4f1cbe){_0x34de3e['rows']=_0x4f1cbe;return _0x34de3e;})[_0x3d49('0x22')](respondWithFilteredResult(_0x540f46,_0x16e9b4))[_0x3d49('0x41')](handleError(_0x540f46,null));};exports[_0x3d49('0x42')]=function(_0x9fcf2d,_0x34fd80){var _0x35deb1={'raw':!![],'where':{'id':_0x9fcf2d['params']['id']}},_0x595c55={};_0x595c55[_0x3d49('0x2e')]=_[_0x3d49('0x43')](db[_0x3d49('0x29')][_0x3d49('0x2a')]);_0x595c55[_0x3d49('0x2f')]=_[_0x3d49('0x43')](_0x9fcf2d[_0x3d49('0x2f')]);_0x595c55[_0x3d49('0x30')]=_[_0x3d49('0x31')](_0x595c55[_0x3d49('0x2e')],_0x595c55[_0x3d49('0x2f')]);_0x35deb1[_0x3d49('0x33')]=_[_0x3d49('0x31')](_0x595c55[_0x3d49('0x2e')],qs['fields'](_0x9fcf2d[_0x3d49('0x2f')][_0x3d49('0x32')]));_0x35deb1[_0x3d49('0x33')]=_0x35deb1[_0x3d49('0x33')][_0x3d49('0x34')]?_0x35deb1[_0x3d49('0x33')]:_0x595c55[_0x3d49('0x2e')];if(_0x9fcf2d[_0x3d49('0x2f')][_0x3d49('0x3e')]){_0x35deb1['include']=[{'all':!![]}];}_0x35deb1=_['merge']({},_0x35deb1,_0x9fcf2d[_0x3d49('0x3d')]);return db[_0x3d49('0x29')]['find'](_0x35deb1)[_0x3d49('0x22')](handleEntityNotFound(_0x34fd80,null))['then'](respondWithResult(_0x34fd80,null))[_0x3d49('0x41')](handleError(_0x34fd80,null));};exports['create']=function(_0x4c95b2,_0x2c729e){return db['OpenchannelApplication'][_0x3d49('0x44')](_0x4c95b2['body'],{})[_0x3d49('0x22')](respondWithResult(_0x2c729e,0xc9))[_0x3d49('0x41')](handleError(_0x2c729e,null));};exports[_0x3d49('0x21')]=function(_0x30c85b,_0x1804f6){if(_0x30c85b[_0x3d49('0x45')]['id']){delete _0x30c85b[_0x3d49('0x45')]['id'];}return db[_0x3d49('0x29')][_0x3d49('0x46')]({'where':{'id':_0x30c85b[_0x3d49('0x47')]['id']}})['then'](handleEntityNotFound(_0x1804f6,null))[_0x3d49('0x22')](saveUpdates(_0x30c85b[_0x3d49('0x45')],null))['then'](respondWithResult(_0x1804f6,null))[_0x3d49('0x41')](handleError(_0x1804f6,null));};exports['destroy']=function(_0x110b4e,_0x4adeeb){return db[_0x3d49('0x29')][_0x3d49('0x46')]({'where':{'id':_0x110b4e[_0x3d49('0x47')]['id']}})[_0x3d49('0x22')](handleEntityNotFound(_0x4adeeb,null))[_0x3d49('0x22')](removeEntity(_0x4adeeb,null))[_0x3d49('0x41')](handleError(_0x4adeeb,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 0f9cad3..78b2a56 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 _0x336d=['api','moment','path','rimraf','./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x392773,_0x4ee791){var _0x51d614=function(_0x4201aa){while(--_0x4201aa){_0x392773['push'](_0x392773['shift']());}};_0x51d614(++_0x4ee791);}(_0x336d,0x6c));var _0xd336=function(_0x27809d,_0x28f904){_0x27809d=_0x27809d-0x0;var _0x2e5a85=_0x336d[_0x27809d];return _0x2e5a85;};'use strict';var _=require(_0xd336('0x0'));var util=require('util');var logger=require(_0xd336('0x1'))(_0xd336('0x2'));var moment=require(_0xd336('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd336('0x4'));var rimraf=require(_0xd336('0x5'));var config=require('../../config/environment');var attributes=require(_0xd336('0x6'));module['exports']=function(_0x30d17e,_0x36edb5){return _0x30d17e['define'](_0xd336('0x7'),attributes,{'tableName':_0xd336('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd336('0x9')});}; \ No newline at end of file +var _0xdcfb=['util','api','bluebird','request-promise','path','rimraf','OpenchannelApplication','openchannel_applications','utf8mb4','lodash'];(function(_0x560db5,_0x271df3){var _0x33ba22=function(_0x58c588){while(--_0x58c588){_0x560db5['push'](_0x560db5['shift']());}};_0x33ba22(++_0x271df3);}(_0xdcfb,0x103));var _0xbdcf=function(_0x1e9dd1,_0x2e180a){_0x1e9dd1=_0x1e9dd1-0x0;var _0x1752dc=_0xdcfb[_0x1e9dd1];return _0x1752dc;};'use strict';var _=require(_0xbdcf('0x0'));var util=require(_0xbdcf('0x1'));var logger=require('../../config/logger')(_0xbdcf('0x2'));var moment=require('moment');var BPromise=require(_0xbdcf('0x3'));var rp=require(_0xbdcf('0x4'));var fs=require('fs');var path=require(_0xbdcf('0x5'));var rimraf=require(_0xbdcf('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x1915d8,_0x4054b5){return _0x1915d8['define'](_0xbdcf('0x7'),attributes,{'tableName':_0xbdcf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbdcf('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 3510f4d..9c8d384 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 _0xe492=['info','UpdateOpenchannelApplication','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','OpenchannelApplication','update','body','options','raw','where','attributes'];(function(_0x187309,_0x2cb520){var _0x1d3711=function(_0x5ab037){while(--_0x5ab037){_0x187309['push'](_0x187309['shift']());}};_0x1d3711(++_0x2cb520);}(_0xe492,0x1c2));var _0x2e49=function(_0x43ee82,_0x2f7a6f){_0x43ee82=_0x43ee82-0x0;var _0x1bb41c=_0xe492[_0x43ee82];return _0x1bb41c;};'use strict';var _=require(_0x2e49('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e49('0x1'));var fs=require('fs');var Redis=require(_0x2e49('0x2'));var db=require(_0x2e49('0x3'))['db'];var utils=require(_0x2e49('0x4'));var logger=require(_0x2e49('0x5'))(_0x2e49('0x6'));var config=require(_0x2e49('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2e49('0x8')][_0x2e49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d95be,_0x22aaf6,_0x28004d){return new BPromise(function(_0x1f19fc,_0x15b812){return client['request'](_0x1d95be,_0x28004d)[_0x2e49('0xa')](function(_0x17657e){logger['info'](_0x2e49('0xb'),_0x22aaf6,'request\x20sent');logger[_0x2e49('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x22aaf6,_0x2e49('0xd'),JSON[_0x2e49('0xe')](_0x17657e));if(_0x17657e['error']){if(_0x17657e[_0x2e49('0xf')][_0x2e49('0x10')]===0x1f4){logger[_0x2e49('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x22aaf6,_0x17657e[_0x2e49('0xf')][_0x2e49('0x11')]);return _0x15b812(_0x17657e[_0x2e49('0xf')][_0x2e49('0x11')]);}logger[_0x2e49('0xf')](_0x2e49('0xb'),_0x22aaf6,_0x17657e[_0x2e49('0xf')]['message']);return _0x1f19fc(_0x17657e[_0x2e49('0xf')][_0x2e49('0x11')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x22aaf6,'request\x20sent');_0x1f19fc(_0x17657e[_0x2e49('0x12')][_0x2e49('0x11')]);}})['catch'](function(_0x38b7ea){logger[_0x2e49('0xf')](_0x2e49('0xb'),_0x22aaf6,_0x38b7ea);_0x15b812(_0x38b7ea);});});}exports['UpdateOpenchannelApplication']=function(_0x2f324c){var _0x29fc3e=this;return new Promise(function(_0x587c28,_0xa955a5){return db[_0x2e49('0x13')][_0x2e49('0x14')](_0x2f324c[_0x2e49('0x15')],{'raw':_0x2f324c[_0x2e49('0x16')]?_0x2f324c[_0x2e49('0x16')][_0x2e49('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f324c[_0x2e49('0x16')]?_0x2f324c[_0x2e49('0x16')][_0x2e49('0x18')]||null:null,'attributes':_0x2f324c[_0x2e49('0x16')]?_0x2f324c[_0x2e49('0x16')][_0x2e49('0x19')]||null:null,'limit':_0x2f324c['options']?_0x2f324c[_0x2e49('0x16')]['limit']||null:null})[_0x2e49('0xa')](function(_0x35ffba){logger[_0x2e49('0x1a')](_0x2e49('0x1b'),_0x2f324c);logger['debug'](_0x2e49('0x1b'),_0x2f324c,JSON[_0x2e49('0xe')](_0x35ffba));_0x587c28(_0x35ffba);})['catch'](function(_0x1b2625){logger[_0x2e49('0xf')](_0x2e49('0x1b'),_0x1b2625[_0x2e49('0x11')],_0x2f324c);_0xa955a5(_0x29fc3e[_0x2e49('0xf')](0x1f4,_0x1b2625[_0x2e49('0x11')]));});});}; \ No newline at end of file +var _0xdae8=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','update','body','options','where','attributes','limit','then','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','debug'];(function(_0x2e6132,_0x24edab){var _0x2f9ac3=function(_0x44c1ac){while(--_0x44c1ac){_0x2e6132['push'](_0x2e6132['shift']());}};_0x2f9ac3(++_0x24edab);}(_0xdae8,0x1f0));var _0x8dae=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0xdae8[_0x4d2263];return _0x24aba0;};'use strict';var _=require(_0x8dae('0x0'));var util=require(_0x8dae('0x1'));var moment=require(_0x8dae('0x2'));var BPromise=require(_0x8dae('0x3'));var rs=require(_0x8dae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8dae('0x5'));var logger=require('../../config/logger')(_0x8dae('0x6'));var config=require(_0x8dae('0x7'));var jayson=require(_0x8dae('0x8'));var client=jayson[_0x8dae('0x9')][_0x8dae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ec233,_0x4ac8eb,_0x14e644){return new BPromise(function(_0x16e573,_0x71dcd){return client[_0x8dae('0xb')](_0x1ec233,_0x14e644)['then'](function(_0x4c534b){logger['info'](_0x8dae('0xc'),_0x4ac8eb,'request\x20sent');logger[_0x8dae('0xd')](_0x8dae('0xe'),_0x4ac8eb,'request\x20sent',JSON[_0x8dae('0xf')](_0x4c534b));if(_0x4c534b['error']){if(_0x4c534b['error']['code']===0x1f4){logger[_0x8dae('0x10')](_0x8dae('0xc'),_0x4ac8eb,_0x4c534b['error']['message']);return _0x71dcd(_0x4c534b[_0x8dae('0x10')]['message']);}logger['error'](_0x8dae('0xc'),_0x4ac8eb,_0x4c534b['error'][_0x8dae('0x11')]);return _0x16e573(_0x4c534b[_0x8dae('0x10')][_0x8dae('0x11')]);}else{logger[_0x8dae('0x12')](_0x8dae('0xc'),_0x4ac8eb,_0x8dae('0x13'));_0x16e573(_0x4c534b[_0x8dae('0x14')]['message']);}})[_0x8dae('0x15')](function(_0xa60f50){logger['error'](_0x8dae('0xc'),_0x4ac8eb,_0xa60f50);_0x71dcd(_0xa60f50);});});}exports['UpdateOpenchannelApplication']=function(_0x50e129){var _0x3aca85=this;return new Promise(function(_0x156279,_0x51c215){return db['OpenchannelApplication'][_0x8dae('0x16')](_0x50e129[_0x8dae('0x17')],{'raw':_0x50e129[_0x8dae('0x18')]?_0x50e129[_0x8dae('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50e129[_0x8dae('0x18')]?_0x50e129['options'][_0x8dae('0x19')]||null:null,'attributes':_0x50e129[_0x8dae('0x18')]?_0x50e129['options'][_0x8dae('0x1a')]||null:null,'limit':_0x50e129[_0x8dae('0x18')]?_0x50e129[_0x8dae('0x18')][_0x8dae('0x1b')]||null:null})[_0x8dae('0x1c')](function(_0x301bab){logger[_0x8dae('0x12')](_0x8dae('0x1d'),_0x50e129);logger[_0x8dae('0xd')](_0x8dae('0x1d'),_0x50e129,JSON[_0x8dae('0xf')](_0x301bab));_0x156279(_0x301bab);})[_0x8dae('0x15')](function(_0x4423a3){logger[_0x8dae('0x10')](_0x8dae('0x1d'),_0x4423a3[_0x8dae('0x11')],_0x50e129);_0x51c215(_0x3aca85[_0x8dae('0x10')](0x1f4,_0x4423a3[_0x8dae('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 9c80ba5..27cc381 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 _0xd598=['show','getMessages','get','/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','openchannel','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','/describe','/:id'];(function(_0xdfcbf9,_0x535d6d){var _0x5ce2c1=function(_0x31e0e8){while(--_0x31e0e8){_0xdfcbf9['push'](_0xdfcbf9['shift']());}};_0x5ce2c1(++_0x535d6d);}(_0xd598,0x17a));var _0x8d59=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd598[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x8d59('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8d59('0x1'));var express=require('express');var router=express[_0x8d59('0x2')]();var fs_extra=require(_0x8d59('0x3'));var auth=require(_0x8d59('0x4'));var interaction=require(_0x8d59('0x5'));var config=require(_0x8d59('0x6'));var controller=require(_0x8d59('0x7'));router['get']('/',auth[_0x8d59('0x8')](),controller[_0x8d59('0x9')]);router['get'](_0x8d59('0xa'),auth[_0x8d59('0x8')](),controller['describe']);router['get'](_0x8d59('0xb'),auth[_0x8d59('0x8')](),controller[_0x8d59('0xc')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x8d59('0xd')]);router[_0x8d59('0xe')](_0x8d59('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x8d59('0x10')]('/',auth[_0x8d59('0x8')](),controller[_0x8d59('0x11')]);router[_0x8d59('0x10')](_0x8d59('0x12'),auth[_0x8d59('0x8')](),controller[_0x8d59('0x13')]);router[_0x8d59('0x10')](_0x8d59('0x14'),auth[_0x8d59('0x8')](),interaction[_0x8d59('0x15')]('openchannel',_0x8d59('0x16')),controller[_0x8d59('0x17')]);router[_0x8d59('0x18')](_0x8d59('0xb'),auth[_0x8d59('0x8')](),interaction['tracked']('openchannel',_0x8d59('0x19')),controller['update']);router[_0x8d59('0x1a')](_0x8d59('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x8d59('0x1b'),'openchannelinteraction:destroy'),controller[_0x8d59('0x1c')]);router[_0x8d59('0x1a')](_0x8d59('0x14'),auth[_0x8d59('0x8')](),controller['removeTags']);module[_0x8d59('0x1d')]=router; \ No newline at end of file +var _0xaa3b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','getMessages','/:id/download','post','create','/:id/messages','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','update','delete','openchannelinteraction:destroy','/:id/tags','exports','multer','util','connect-timeout','express','Router'];(function(_0x5db800,_0xdbfdc3){var _0x2a363d=function(_0x1068c3){while(--_0x1068c3){_0x5db800['push'](_0x5db800['shift']());}};_0x2a363d(++_0xdbfdc3);}(_0xaa3b,0x112));var _0xbaa3=function(_0x4132d1,_0x41fbbd){_0x4132d1=_0x4132d1-0x0;var _0x27d9cb=_0xaa3b[_0x4132d1];return _0x27d9cb;};'use strict';var multer=require(_0xbaa3('0x0'));var util=require(_0xbaa3('0x1'));var path=require('path');var timeout=require(_0xbaa3('0x2'));var express=require(_0xbaa3('0x3'));var router=express[_0xbaa3('0x4')]();var fs_extra=require(_0xbaa3('0x5'));var auth=require(_0xbaa3('0x6'));var interaction=require(_0xbaa3('0x7'));var config=require(_0xbaa3('0x8'));var controller=require(_0xbaa3('0x9'));router['get']('/',auth[_0xbaa3('0xa')](),controller[_0xbaa3('0xb')]);router[_0xbaa3('0xc')](_0xbaa3('0xd'),auth[_0xbaa3('0xa')](),controller['describe']);router[_0xbaa3('0xc')]('/:id',auth[_0xbaa3('0xa')](),controller['show']);router[_0xbaa3('0xc')]('/:id/messages',auth[_0xbaa3('0xa')](),controller[_0xbaa3('0xe')]);router[_0xbaa3('0xc')](_0xbaa3('0xf'),auth[_0xbaa3('0xa')](),controller['download']);router[_0xbaa3('0x10')]('/',auth['isAuthenticated'](),controller[_0xbaa3('0x11')]);router['post'](_0xbaa3('0x12'),auth[_0xbaa3('0xa')](),controller[_0xbaa3('0x13')]);router[_0xbaa3('0x10')]('/:id/tags',auth[_0xbaa3('0xa')](),interaction[_0xbaa3('0x14')](_0xbaa3('0x15'),_0xbaa3('0x16')),controller[_0xbaa3('0x17')]);router[_0xbaa3('0x18')](_0xbaa3('0x19'),auth[_0xbaa3('0xa')](),interaction['tracked']('openchannel','openchannelinteraction:update'),controller[_0xbaa3('0x1a')]);router[_0xbaa3('0x1b')](_0xbaa3('0x19'),auth[_0xbaa3('0xa')](),interaction[_0xbaa3('0x14')]('openchannel',_0xbaa3('0x1c')),controller['destroy']);router[_0xbaa3('0x1b')](_0xbaa3('0x1d'),auth['isAuthenticated'](),controller['removeTags']);module[_0xbaa3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 38976e3..c82201c 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 _0xef8b=['STRING','out','exports','BOOLEAN','DATE'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xef8b,0x192));var _0xbef8=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xef8b[_0x3d4876];return _0x58ca9d;};'use strict';var Sequelize=require('sequelize');module[_0xbef8('0x0')]={'closed':{'type':Sequelize[_0xbef8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbef8('0x2')]},'disposition':{'type':Sequelize[_0xbef8('0x3')]},'secondDisposition':{'type':Sequelize[_0xbef8('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbef8('0x3')]},'note':{'type':Sequelize[_0xbef8('0x3')]},'read1stAt':{'type':Sequelize[_0xbef8('0x2')]},'threadId':{'type':Sequelize[_0xbef8('0x3')]},'externalUrl':{'type':Sequelize[_0xbef8('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbef8('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbef8('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbef8('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xbef8('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xb73c=['STRING','sequelize','BOOLEAN','DATE'];(function(_0x4f3d0c,_0x2d2fcc){var _0x4943a3=function(_0x466494){while(--_0x466494){_0x4f3d0c['push'](_0x4f3d0c['shift']());}};_0x4943a3(++_0x2d2fcc);}(_0xb73c,0x1cd));var _0xcb73=function(_0x250890,_0x166585){_0x250890=_0x250890-0x0;var _0x1a64f8=_0xb73c[_0x250890];return _0x1a64f8;};'use strict';var Sequelize=require(_0xcb73('0x0'));module['exports']={'closed':{'type':Sequelize[_0xcb73('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcb73('0x2')]},'disposition':{'type':Sequelize[_0xcb73('0x3')]},'secondDisposition':{'type':Sequelize[_0xcb73('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcb73('0x3')]},'note':{'type':Sequelize[_0xcb73('0x3')]},'read1stAt':{'type':Sequelize[_0xcb73('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xcb73('0x3')]},'lastMsgAt':{'type':Sequelize[_0xcb73('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xcb73('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 c986db9..d594c4c 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 _0x7a6d=['ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','name','Users','map','fullname','TagIds','Tags','split','forEach','catch','waiting','answered','unmanaged','total','UserId','closed','talking','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','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','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','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','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','OpenchannelAccountId','where','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','push','all','rows','show','params','includeAll','create','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','nolimit','sort','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','root','files','tmp','join','server','attachments','CmContact','lastName','Attachment','secret','read','Account','get','mkdirSync','Openchannel','Owner','N.A.','closedAt','disposition','threadId','Public','Messages','basename','direction','System','firstName','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a6d,0xee));var _0xd7a6=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7a6d[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0xd7a6('0x0'));var rimraf=require(_0xd7a6('0x1'));var zipdir=require(_0xd7a6('0x2'));var jsonpatch=require(_0xd7a6('0x3'));var rp=require(_0xd7a6('0x4'));var moment=require(_0xd7a6('0x5'));var BPromise=require(_0xd7a6('0x6'));var Mustache=require(_0xd7a6('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd7a6('0x8'));var csv=require('to-csv');var ejs=require(_0xd7a6('0x9'));var fs=require('fs');var fs_extra=require(_0xd7a6('0xa'));var _=require('lodash');var squel=require(_0xd7a6('0xb'));var crypto=require(_0xd7a6('0xc'));var jsforce=require(_0xd7a6('0xd'));var deskjs=require(_0xd7a6('0xe'));var toCsv=require(_0xd7a6('0xf'));var querystring=require(_0xd7a6('0x10'));var Papa=require('papaparse');var Redis=require(_0xd7a6('0x11'));var authService=require(_0xd7a6('0x12'));var qs=require(_0xd7a6('0x13'));var as=require(_0xd7a6('0x14'));var pdf=require(_0xd7a6('0x15'));var hardwareService=require(_0xd7a6('0x16'));var logger=require(_0xd7a6('0x17'))('api');var utils=require(_0xd7a6('0x18'));var config=require(_0xd7a6('0x19'));var licenseUtil=require(_0xd7a6('0x1a'));var db=require(_0xd7a6('0x1b'))['db'];config[_0xd7a6('0x1c')]=_['defaults'](config[_0xd7a6('0x1c')],{'host':_0xd7a6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7a6('0x1c')]));require(_0xd7a6('0x1e'))[_0xd7a6('0x1f')](socket);function respondWithStatusCode(_0x548d61,_0x335695){_0x335695=_0x335695||0xcc;return function(_0x2dcac1){if(_0x2dcac1){return _0x548d61[_0xd7a6('0x20')](_0x335695);}return _0x548d61[_0xd7a6('0x21')](_0x335695)[_0xd7a6('0x22')]();};}function respondWithResult(_0x3d8cc4,_0x2a7e4d){_0x2a7e4d=_0x2a7e4d||0xc8;return function(_0x58abe4){if(_0x58abe4){return _0x3d8cc4[_0xd7a6('0x21')](_0x2a7e4d)[_0xd7a6('0x23')](_0x58abe4);}};}function respondWithFilteredResult(_0x18cba2,_0x4b704e){return function(_0x2647b6){if(_0x2647b6){var _0x494ef8=typeof _0x4b704e[_0xd7a6('0x24')]==='undefined'&&typeof _0x4b704e['limit']===_0xd7a6('0x25');var _0x54db01=_0x2647b6[_0xd7a6('0x26')];var _0x126492=_0x494ef8?0x0:_0x4b704e['offset'];var _0x5430b6=_0x494ef8?_0x2647b6[_0xd7a6('0x26')]:_0x4b704e['offset']+_0x4b704e[_0xd7a6('0x27')];var _0x420320;if(_0x5430b6>=_0x54db01){_0x5430b6=_0x54db01;_0x420320=0xc8;}else{_0x420320=0xce;}_0x18cba2[_0xd7a6('0x21')](_0x420320);return _0x18cba2[_0xd7a6('0x28')]('Content-Range',_0x126492+'-'+_0x5430b6+'/'+_0x54db01)[_0xd7a6('0x23')](_0x2647b6);}return null;};}function patchUpdates(_0x5c1b91){return function(_0x5eabdf){try{jsonpatch['apply'](_0x5eabdf,_0x5c1b91,!![]);}catch(_0x23a794){return BPromise[_0xd7a6('0x29')](_0x23a794);}return _0x5eabdf[_0xd7a6('0x2a')]();};}function saveUpdates(_0x1a272f,_0x33cf9a){return function(_0x87a147){if(_0x87a147){return _0x87a147[_0xd7a6('0x2b')](_0x1a272f)[_0xd7a6('0x2c')](function(_0x106de6){return _0x106de6;});}return null;};}function removeEntity(_0x436f55,_0xe3269f){return function(_0x1aea69){if(_0x1aea69){return _0x1aea69[_0xd7a6('0x2d')]()[_0xd7a6('0x2c')](function(){_0x436f55['status'](0xcc)[_0xd7a6('0x22')]();});}};}function handleEntityNotFound(_0x3a2475,_0xd8197c){return function(_0x371c16){if(!_0x371c16){_0x3a2475['sendStatus'](0x194);}return _0x371c16;};}function handleError(_0x37fc19,_0x59a669){_0x59a669=_0x59a669||0x1f4;return function(_0xa9023f){logger[_0xd7a6('0x2e')](_0xa9023f['stack']);if(_0xa9023f[_0xd7a6('0x2f')]){delete _0xa9023f[_0xd7a6('0x2f')];}_0x37fc19['status'](_0x59a669)['send'](_0xa9023f);};}function getInteractionUsers(_0x7964a9,_0x4d3396){return new BPromise(function(_0x57f567,_0x22eb67){try{if(_0x4d3396[_0x7964a9['id']]){_0x7964a9[_0xd7a6('0x30')]=_[_0xd7a6('0x31')](_0x4d3396[_0x7964a9['id']],function(_0x1d4b07){return{'id':_0x1d4b07['id'],'fullname':_0x1d4b07[_0xd7a6('0x32')]};});}}catch(_0x4fab6b){_0x22eb67(_0x4fab6b);}_0x57f567(_0x7964a9);});}function getInteractionTags(_0x3aeab8,_0x10c43d){return new BPromise(function(_0x27a03d,_0x465e2f){try{if(_0x3aeab8[_0xd7a6('0x33')]){_0x3aeab8[_0xd7a6('0x34')]=[];_0x3aeab8[_0xd7a6('0x33')][_0xd7a6('0x35')](',')[_0xd7a6('0x36')](function(_0x2dddb0){_0x3aeab8[_0xd7a6('0x34')]['push'](_0x10c43d[_0x2dddb0]);});}delete _0x3aeab8[_0xd7a6('0x33')];}catch(_0x356206){_0x465e2f(_0x356206);}_0x27a03d(_0x3aeab8);});}function updateOpenchannelInteraction(_0x1e9089,_0xc18fb7,_0x597e3a){return new BPromise(function(_0x41bac7,_0x3ffbf9){return getInteractionUsers(_0x1e9089,_0x597e3a)[_0xd7a6('0x2c')](function(_0x43e175){return getInteractionTags(_0x43e175,_0xc18fb7);})[_0xd7a6('0x2c')](function(_0x401d52){return getStateInteraction(_0x401d52);})['then'](function(_0x340ad5){_0x41bac7(_0x340ad5);})[_0xd7a6('0x37')](function(_0x3ef0b0){_0x3ffbf9(_0x3ef0b0);});});}function getStateInteraction(_0x53c237){return new BPromise(function(_0x1b4cec){_0x53c237[_0xd7a6('0x38')]=0x0;_0x53c237['talking']=0x0;_0x53c237[_0xd7a6('0x39')]=0x0;_0x53c237[_0xd7a6('0x3a')]=0x0;_0x53c237[_0xd7a6('0x3b')]=0x0;if(!_0x53c237['closed']&&!_0x53c237[_0xd7a6('0x3c')]){_0x53c237[_0xd7a6('0x38')]+=0x1;}if(!_0x53c237[_0xd7a6('0x3d')]&&_0x53c237[_0xd7a6('0x3c')]){_0x53c237['talking']+=0x1;if(_0x53c237['waiting']){_0x53c237[_0xd7a6('0x38')]-=0x1;}}if(_0x53c237['closed']&&_0x53c237[_0xd7a6('0x3c')]){_0x53c237[_0xd7a6('0x39')]+=0x1;if(_0x53c237[_0xd7a6('0x3e')]){_0x53c237[_0xd7a6('0x3e')]-=0x1;}}if(_0x53c237[_0xd7a6('0x3d')]&&!_0x53c237[_0xd7a6('0x3c')]){_0x53c237[_0xd7a6('0x3a')]+=0x1;if(_0x53c237['waiting']){_0x53c237[_0xd7a6('0x38')]-=0x1;}}_0x53c237[_0xd7a6('0x3b')]+=0x1;_0x1b4cec(_0x53c237);});}exports[_0xd7a6('0x3f')]=function(_0x38ec3c,_0xe77a3b){var _0x490248={},_0x3a1043={},_0x372691={'count':0x0,'rows':[]};var _0x2a0d52=_[_0xd7a6('0x31')](db[_0xd7a6('0x40')][_0xd7a6('0x41')],function(_0x49a19b){return{'name':_0x49a19b[_0xd7a6('0x42')],'type':_0x49a19b[_0xd7a6('0x43')][_0xd7a6('0x44')]};});_0x3a1043[_0xd7a6('0x45')]=_[_0xd7a6('0x31')](_0x2a0d52,'name');_0x3a1043[_0xd7a6('0x46')]=_[_0xd7a6('0x47')](_0x38ec3c[_0xd7a6('0x46')]);_0x3a1043[_0xd7a6('0x48')]=_[_0xd7a6('0x49')](_0x3a1043['model'],_0x3a1043[_0xd7a6('0x46')]);_0x490248[_0xd7a6('0x4a')]=_[_0xd7a6('0x49')](_0x3a1043[_0xd7a6('0x45')],qs[_0xd7a6('0x4b')](_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x4b')]));_0x490248['attributes']=_0x490248['attributes']['length']?_0x490248[_0xd7a6('0x4a')]:_0x3a1043['model'];if(!_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x4c')]('nolimit')){_0x490248[_0xd7a6('0x27')]=qs['limit'](_0x38ec3c['query'][_0xd7a6('0x27')]);_0x490248[_0xd7a6('0x24')]=qs[_0xd7a6('0x24')](_0x38ec3c[_0xd7a6('0x46')]['offset']);}_0x490248[_0xd7a6('0x4d')]=qs['sort'](_0x38ec3c['query']['sort']);_0x490248['where']=qs[_0xd7a6('0x48')](_[_0xd7a6('0x4e')](_0x38ec3c['query'],_0x3a1043[_0xd7a6('0x48')]),_0x2a0d52);var _0x2f9b04=[];var _0x4a61e8=squel[_0xd7a6('0x4f')]()[_0xd7a6('0x50')]('id')[_0xd7a6('0x50')](_0xd7a6('0x2f'))[_0xd7a6('0x50')]('color')[_0xd7a6('0x51')](_0xd7a6('0x52'));var _0x1aaed3=squel[_0xd7a6('0x4f')]()['field'](_0xd7a6('0x53'))['field'](_0xd7a6('0x54'))[_0xd7a6('0x50')](_0xd7a6('0x55'))[_0xd7a6('0x51')]('user_has_openchannel_interactions','ui')[_0xd7a6('0x56')](_0xd7a6('0x57'),'u',_0xd7a6('0x58'));var _0x6f1a=squel[_0xd7a6('0x4f')]()['from']('openchannel_interactions','i')[_0xd7a6('0x56')]('cm_contacts','c',_0xd7a6('0x59'))['left_join'](_0xd7a6('0x57'),'o',_0xd7a6('0x5a'))[_0xd7a6('0x56')](_0xd7a6('0x5b'),'a',_0xd7a6('0x5c'))[_0xd7a6('0x56')](_0xd7a6('0x5d'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xd7a6('0x56')](_0xd7a6('0x5e'),'it',_0xd7a6('0x5f'))['left_join']('tools_tags','t',_0xd7a6('0x60'));var _0xe52b4a=squel[_0xd7a6('0x61')]();var _0x30bbec=[];var _0x488dbe=squel[_0xd7a6('0x61')]();var _0x442cd9;if(_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x62')]){_0x442cd9=as[_0xd7a6('0x63')](_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x62')]);var _0x3adfd0=_0x442cd9[_0xd7a6('0x64')];for(var _0x2eecc8=0x0;_0x2eecc8<_0x442cd9[_0xd7a6('0x65')][_0xd7a6('0x66')];_0x2eecc8++){var _0x3b6b32=_0x442cd9[_0xd7a6('0x65')][_0x2eecc8];var _0x1c4ab4='i';var _0x17c8f7=_[_0xd7a6('0x67')](_0x2a0d52,[_0xd7a6('0x2f'),_0x3b6b32[_0xd7a6('0x50')]]);if(!_0x17c8f7){switch(_0x3b6b32[_0xd7a6('0x50')]){case _0xd7a6('0x68'):if(_0x3b6b32[_0xd7a6('0x69')]==0x1){_0x6f1a[_0xd7a6('0x6a')]('`'+_0x3b6b32['field']+_0xd7a6('0x6b'));}else{_0x6f1a['having']('`'+_0x3b6b32['field']+_0xd7a6('0x6c'));}break;case _0xd7a6('0x6d'):if(_0x3b6b32[_0xd7a6('0x6e')]===_0xd7a6('0x6f')){if(_0x3b6b32[_0xd7a6('0x69')][_0xd7a6('0x35')]('\x20')[_0xd7a6('0x66')]>0x1){_0xe52b4a[_0x3adfd0](_0xd7a6('0x70'),qs[_0xd7a6('0x71')](_0x3b6b32[_0xd7a6('0x69')]),null);}else{var _0x3ddcbf='%'+_0x3b6b32[_0xd7a6('0x69')]+'%';_0xe52b4a[_0x3adfd0](_0xd7a6('0x72'),_0x3ddcbf,_0x3ddcbf,_0x3ddcbf);}}else{_0x17c8f7=_[_0xd7a6('0x67')](_0x2a0d52,[_0xd7a6('0x2f'),_0xd7a6('0x73')]);_0x3b6b32[_0xd7a6('0x50')]=_0xd7a6('0x73');_0x2923ca=as[_0xd7a6('0x74')](_0x1c4ab4,_0x17c8f7['type'],_0x3b6b32);_0xe52b4a[_0x3adfd0](_0x2923ca[_0xd7a6('0x75')],_0x2923ca['value'][_0xd7a6('0x76')],_0x2923ca[_0xd7a6('0x69')][_0xd7a6('0x22')]);}break;case _0xd7a6('0x77'):var _0x52c128=_0x3b6b32[_0xd7a6('0x69')][_0xd7a6('0x35')](',')[_0xd7a6('0x31')](function(_0xdc4ca9){return Number(_0xdc4ca9);});_0x52c128['forEach'](function(_0x556c3c){_0x488dbe['or'](_0xd7a6('0x78'),'%,'+_0x556c3c+',%');});_0x30bbec=_['union'](_0x30bbec,_0x52c128);break;case _0xd7a6('0x79'):if(_0x3b6b32[_0xd7a6('0x6e')]===_0xd7a6('0x6f')){_0xe52b4a[_0x3adfd0](_0xd7a6('0x7a'),'%'+_0x3b6b32['value']+'%',null);}else{_0x17c8f7=_[_0xd7a6('0x67')](_0x2a0d52,[_0xd7a6('0x2f'),_0xd7a6('0x3c')]);_0x3b6b32[_0xd7a6('0x50')]=_0xd7a6('0x3c');_0x2923ca=as['buildExpression'](_0x1c4ab4,_0x17c8f7[_0xd7a6('0x43')],_0x3b6b32);_0xe52b4a[_0x3adfd0](_0x2923ca[_0xd7a6('0x75')],_0x2923ca[_0xd7a6('0x69')][_0xd7a6('0x76')],_0x2923ca[_0xd7a6('0x69')][_0xd7a6('0x22')]);}break;case _0xd7a6('0x7b'):_0x2923ca=as['buildExpression']('me',null,_0x3b6b32);_0xe52b4a[_0x3adfd0](_0x2923ca[_0xd7a6('0x75')],_0x2923ca[_0xd7a6('0x69')][_0xd7a6('0x76')],_0x2923ca['value'][_0xd7a6('0x22')]);break;}}else{var _0x2923ca=as['buildExpression'](_0x1c4ab4,_0x17c8f7[_0xd7a6('0x43')],_0x3b6b32);_0xe52b4a[_0x3adfd0](_0x2923ca[_0xd7a6('0x75')],_0x2923ca['value'][_0xd7a6('0x76')],_0x2923ca['value'][_0xd7a6('0x22')]);}}}else{var _0x2b9453=_(_0x38ec3c[_0xd7a6('0x46')])[_0xd7a6('0x47')]()[_0xd7a6('0x31')](function(_0x497c0d){return _['some'](_0x2a0d52,[_0xd7a6('0x2f'),_0x497c0d])?_0x497c0d:undefined;})[_0xd7a6('0x7c')]()[_0xd7a6('0x69')]();if(!_[_0xd7a6('0x7d')](_0x2b9453)){_0x2b9453[_0xd7a6('0x36')](function(_0x481a8b){if(_0x481a8b===_0xd7a6('0x7e')){_0x6f1a[_0xd7a6('0x7f')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xd7a6('0x80')](_0x38ec3c[_0xd7a6('0x46')][_0x481a8b]));}else if(_0x481a8b===_0xd7a6('0x81')){var _0xe97483=JSON[_0xd7a6('0x82')](_0x38ec3c['query'][_0x481a8b])[_0xd7a6('0x83')];var _0x53b292=JSON[_0xd7a6('0x82')](_0x38ec3c[_0xd7a6('0x46')][_0x481a8b])['$lte'];_0x6f1a[_0xd7a6('0x7f')](_0xd7a6('0x84'),_0xe97483,_0x53b292);}else{if(_0x38ec3c[_0xd7a6('0x46')][_0x481a8b]===_0xd7a6('0x85')){_0x6f1a[_0xd7a6('0x7f')]('i.'+_0x481a8b+_0xd7a6('0x86'));}else{_0x6f1a['where']('i.'+_0x481a8b+_0xd7a6('0x87'),_0x38ec3c[_0xd7a6('0x46')][_0x481a8b]);}}});}if(_0x38ec3c[_0xd7a6('0x46')]['read']){if(_0x38ec3c[_0xd7a6('0x46')]['read']==0x1){_0x6f1a[_0xd7a6('0x6a')](_0xd7a6('0x88'));}else{_0x6f1a['having'](_0xd7a6('0x89'));}}if(_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x8a')]){_0x30bbec=_[_0xd7a6('0x8b')](_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x8a')])?_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x8a')]:new Array(_0x38ec3c['query'][_0xd7a6('0x8a')]);_0x30bbec[_0xd7a6('0x36')](function(_0x504a68){_0x488dbe['or'](_0xd7a6('0x78'),'%,'+_0x504a68+',%');});}if(_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x8c')]){var _0x28a173=_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x8c')][_0xd7a6('0x8d')]('\x5c','\x5c\x5c')[_0xd7a6('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x28a173)){_0xe52b4a['or'](_0xd7a6('0x8e'),_0x28a173+'%');}else{_0xe52b4a['or'](_0xd7a6('0x8f'),qs[_0xd7a6('0x71')](_0x28a173))['or']('i.from\x20LIKE\x20?',_0x28a173+'%')['or'](_0xd7a6('0x90'),_0x28a173+'%');}}}_0x6f1a[_0xd7a6('0x7f')](_0xe52b4a);_0x6f1a[_0xd7a6('0x91')](_0xd7a6('0x92'));var _0x11b3f6={'type':db[_0xd7a6('0x93')]['QueryTypes'][_0xd7a6('0x94')],'raw':!![]};var _0x159eef=_0x6f1a[_0xd7a6('0x95')]();_0x159eef['field'](_0xd7a6('0x92'));_0x159eef[_0xd7a6('0x50')](_0xd7a6('0x96'),_0xd7a6('0x68'));if(_0x490248['order']){_0x490248[_0xd7a6('0x4d')][_0xd7a6('0x36')](function(_0x389d42){var _0x4c5b1f=_0x389d42[0x0]===_0xd7a6('0x97')?_0x389d42[0x0]:'i.'+_0x389d42[0x0];_0x6f1a[_0xd7a6('0x4d')](_0x4c5b1f,_0x389d42[0x1]===_0xd7a6('0x98')?![]:!![]);});}if(!_[_0xd7a6('0x7d')](_0x30bbec)){_0x6f1a['having'](_0x488dbe);_0x159eef[_0xd7a6('0x7f')](_0xd7a6('0x99'),_0x30bbec);}BPromise['resolve']()[_0xd7a6('0x2c')](function(){if(!_0x442cd9){if(_0x38ec3c['query']['OpenchannelAccountId'])return;_0x159eef[_0xd7a6('0x7f')](_0xd7a6('0x9a'));_0x6f1a[_0xd7a6('0x7f')](_0xd7a6('0x9a'));return;}if(_0x38ec3c['user'][_0xd7a6('0x9b')]!==_0xd7a6('0x9c'))return;return _0x38ec3c[_0xd7a6('0x9d')][_0xd7a6('0x9e')]({'attributes':['id'],'raw':!![]})[_0xd7a6('0x2c')](function(_0x4a0e23){if(_[_0xd7a6('0x7d')](_0x4a0e23)){_0x159eef[_0xd7a6('0x7f')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x6f1a[_0xd7a6('0x7f')](_0xd7a6('0x9f'));}else{_0x159eef[_0xd7a6('0x7f')](_0xd7a6('0xa0'),_[_0xd7a6('0x31')](_0x4a0e23,'id'));_0x6f1a[_0xd7a6('0x7f')](_0xd7a6('0xa0'),_[_0xd7a6('0x31')](_0x4a0e23,'id'));}});})[_0xd7a6('0x2c')](function(){if(_0x38ec3c[_0xd7a6('0x9d')]['role']==='agent'&&!_0x442cd9&&!_0x38ec3c[_0xd7a6('0x46')][_0xd7a6('0x7e')])return[];return db[_0xd7a6('0xa1')][_0xd7a6('0x46')](_0x159eef[_0xd7a6('0xa2')](),_0x11b3f6);})[_0xd7a6('0x2c')](function(_0x4698da){_0x372691[_0xd7a6('0x26')]=_0x4698da[_0xd7a6('0x66')];if(_0x372691[_0xd7a6('0x26')]===0x0)return[];return db['sequelize'][_0xd7a6('0x46')](_0x4a61e8[_0xd7a6('0xa2')](),_0x11b3f6)[_0xd7a6('0x2c')](function(_0x2d9c30){_0x2f9b04=_[_0xd7a6('0xa3')](_0x2d9c30,'id');_0x11b3f6=_[_0xd7a6('0xa4')](_0x11b3f6,{'model':db[_0xd7a6('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38ec3c[_0xd7a6('0x46')]['fields']){_0x490248['attributes'][_0xd7a6('0x36')](function(_0x5cd2d8){_0x6f1a[_0xd7a6('0x50')]('i.'+_0x5cd2d8);});}else{_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0x96'),_0xd7a6('0x68'));_0x6f1a['field'](_0xd7a6('0xa5'),_0xd7a6('0xa6'));_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xa7'),_0xd7a6('0xa8'));_0x6f1a['field'](_0xd7a6('0xa9'),_0xd7a6('0x97'));_0x6f1a['field'](_0xd7a6('0xaa'));_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xab'),'Contact.firstName');_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xac'),_0xd7a6('0xad'));_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xae'),'Contact.email');_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xaf'),_0xd7a6('0xb0'));_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xb1'),_0xd7a6('0xb2'));_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xb3'),'Contact.fax');_0x6f1a[_0xd7a6('0x50')](_0xd7a6('0xb4'),'Owner.fullname');_0x6f1a[_0xd7a6('0x50')]('o.internal',_0xd7a6('0xb5'));_0x6f1a['field'](_0xd7a6('0xb6'),'TagIds');}if(_0x490248['limit'])_0x6f1a[_0xd7a6('0x27')](_0x490248[_0xd7a6('0x27')]);if(_0x490248[_0xd7a6('0x24')])_0x6f1a[_0xd7a6('0x24')](_0x490248[_0xd7a6('0x24')]);return db[_0xd7a6('0xa1')]['query'](_0x6f1a[_0xd7a6('0xa2')](),_0x11b3f6);})['then'](function(_0x8119b2){if(_0x8119b2['length']>0x0)_0x1aaed3[_0xd7a6('0x7f')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xd7a6('0x31')](_0x8119b2,'id'));return db[_0xd7a6('0xa1')][_0xd7a6('0x46')](_0x1aaed3[_0xd7a6('0xa2')](),_0x11b3f6)[_0xd7a6('0x2c')](function(_0x1975f3){var _0x1e63e4=_[_0xd7a6('0xb7')](_0x1975f3,_0xd7a6('0xb8'));var _0x820f19=[];_0x8119b2['forEach'](function(_0x558a8d){_0x820f19[_0xd7a6('0xb9')](updateOpenchannelInteraction(_0x558a8d,_0x2f9b04,_0x1e63e4));});return BPromise[_0xd7a6('0xba')](_0x820f19);});});})[_0xd7a6('0x2c')](function(_0x2d9fc9){_0x372691[_0xd7a6('0xbb')]=_0x2d9fc9;return _0x372691;})[_0xd7a6('0x2c')](respondWithFilteredResult(_0xe77a3b,_0x490248))[_0xd7a6('0x37')](handleError(_0xe77a3b,null));};exports[_0xd7a6('0xbc')]=function(_0x36ce0e,_0x4a536c){var _0x59e227={};if(_0x36ce0e[_0xd7a6('0x46')]['type']&&_0x36ce0e['query'][_0xd7a6('0x43')]===_0xd7a6('0x51')){_0x59e227['from']=_0x36ce0e[_0xd7a6('0xbd')]['id'];}else{_0x59e227['id']=_0x36ce0e['params']['id'];}var _0xc6ce55={'raw':![],'where':_0x59e227},_0x360b48={};_0x360b48['model']=_[_0xd7a6('0x47')](db[_0xd7a6('0x40')][_0xd7a6('0x41')]);_0x360b48[_0xd7a6('0x46')]=_[_0xd7a6('0x47')](_0x36ce0e['query']);_0x360b48[_0xd7a6('0x48')]=_['intersection'](_0x360b48['model'],_0x360b48[_0xd7a6('0x46')]);_0xc6ce55[_0xd7a6('0x4a')]=_['intersection'](_0x360b48[_0xd7a6('0x45')],qs[_0xd7a6('0x4b')](_0x36ce0e[_0xd7a6('0x46')][_0xd7a6('0x4b')]));_0xc6ce55[_0xd7a6('0x4a')]=_0xc6ce55[_0xd7a6('0x4a')]['length']?_0xc6ce55['attributes']:_0x360b48['model'];if(_0x36ce0e[_0xd7a6('0x46')][_0xd7a6('0xbe')]){_0xc6ce55['include']=[{'all':!![]}];}_0xc6ce55=_[_0xd7a6('0xa4')]({},_0xc6ce55,_0x36ce0e['options']);return db['OpenchannelInteraction'][_0xd7a6('0x67')](_0xc6ce55)['then'](handleEntityNotFound(_0x4a536c,null))[_0xd7a6('0x2c')](respondWithResult(_0x4a536c,null))[_0xd7a6('0x37')](handleError(_0x4a536c,null));};exports[_0xd7a6('0xbf')]=function(_0x9517d8,_0x3b225e){return db[_0xd7a6('0x40')]['create'](_0x9517d8[_0xd7a6('0x7b')],{})[_0xd7a6('0x2c')](respondWithResult(_0x3b225e,0xc9))[_0xd7a6('0x37')](handleError(_0x3b225e,null));};exports[_0xd7a6('0x2b')]=function(_0x55bf91,_0x164507){if(_0x55bf91[_0xd7a6('0x7b')]['id']){delete _0x55bf91[_0xd7a6('0x7b')]['id'];}return db[_0xd7a6('0x40')][_0xd7a6('0x67')]({'where':{'id':_0x55bf91[_0xd7a6('0xbd')]['id']}})[_0xd7a6('0x2c')](handleEntityNotFound(_0x164507,null))[_0xd7a6('0x2c')](saveUpdates(_0x55bf91[_0xd7a6('0x7b')],null))[_0xd7a6('0x2c')](respondWithResult(_0x164507,null))['catch'](handleError(_0x164507,null));};exports['destroy']=function(_0x12f776,_0x486323){return db['OpenchannelInteraction'][_0xd7a6('0x67')]({'where':{'id':_0x12f776['params']['id']}})[_0xd7a6('0x2c')](handleEntityNotFound(_0x486323,null))[_0xd7a6('0x2c')](removeEntity(_0x486323,null))[_0xd7a6('0x37')](handleError(_0x486323,null));};exports['describe']=function(_0x4924e1,_0x200228){return db[_0xd7a6('0x40')][_0xd7a6('0xc0')]()['then'](respondWithResult(_0x200228,null))['catch'](handleError(_0x200228,null));};exports[_0xd7a6('0xc1')]=function(_0x1d0159,_0x1d0ae2,_0x58764e){return db['OpenchannelMessage'][_0xd7a6('0x67')]({'where':{'id':_0x1d0159['params']['id']}})[_0xd7a6('0x2c')](handleEntityNotFound(_0x1d0ae2,null))[_0xd7a6('0x2c')](function(_0x5195){if(_0x5195){return _0x5195[_0xd7a6('0xc1')](_0x1d0159[_0xd7a6('0x7b')][_0xd7a6('0xc2')],_['omit'](_0x1d0159['body'],[_0xd7a6('0xc2'),'id'])||{});}})[_0xd7a6('0x2c')](respondWithResult(_0x1d0ae2,null))[_0xd7a6('0x37')](handleError(_0x1d0ae2,null));};exports[_0xd7a6('0xc3')]=function(_0x5a9cc9,_0x1de6f3,_0x238b31){var _0x44185f={'raw':![],'where':{}};var _0x5b16ea={};var _0x1b8204={'count':0x0,'rows':[]};return db[_0xd7a6('0x40')][_0xd7a6('0xc4')]({'where':{'id':_0x5a9cc9['params']['id']}})[_0xd7a6('0x2c')](handleEntityNotFound(_0x1de6f3,null))['then'](function(_0x2a96aa){if(_0x2a96aa){_0x5b16ea[_0xd7a6('0x45')]=_[_0xd7a6('0x47')](db[_0xd7a6('0xc5')][_0xd7a6('0x41')]);_0x5b16ea[_0xd7a6('0x46')]=_[_0xd7a6('0x47')](_0x5a9cc9['query']);_0x5b16ea[_0xd7a6('0x48')]=_['intersection'](_0x5b16ea[_0xd7a6('0x45')],_0x5b16ea[_0xd7a6('0x46')]);_0x44185f[_0xd7a6('0x4a')]=_[_0xd7a6('0x49')](_0x5b16ea[_0xd7a6('0x45')],qs[_0xd7a6('0x4b')](_0x5a9cc9[_0xd7a6('0x46')][_0xd7a6('0x4b')]));_0x44185f[_0xd7a6('0x4a')]=_0x44185f[_0xd7a6('0x4a')][_0xd7a6('0x66')]?_0x44185f[_0xd7a6('0x4a')]:_0x5b16ea[_0xd7a6('0x45')];if(!_0x5a9cc9[_0xd7a6('0x46')][_0xd7a6('0x4c')](_0xd7a6('0xc6'))){_0x44185f[_0xd7a6('0x27')]=qs['limit'](_0x5a9cc9[_0xd7a6('0x46')][_0xd7a6('0x27')]);_0x44185f[_0xd7a6('0x24')]=qs[_0xd7a6('0x24')](_0x5a9cc9[_0xd7a6('0x46')]['offset']);}_0x44185f[_0xd7a6('0x4d')]=qs[_0xd7a6('0xc7')](_0x5a9cc9['query'][_0xd7a6('0xc7')]);_0x44185f[_0xd7a6('0x7f')]=qs[_0xd7a6('0x48')](_['pick'](_0x5a9cc9[_0xd7a6('0x46')],_0x5b16ea[_0xd7a6('0x48')]));_0x44185f[_0xd7a6('0x7f')][_0xd7a6('0xb8')]=_0x2a96aa['id'];if(_0x5a9cc9[_0xd7a6('0x46')][_0xd7a6('0x8c')]){_0x44185f[_0xd7a6('0x7f')]=_[_0xd7a6('0xa4')](_0x44185f[_0xd7a6('0x7f')],{'$or':_[_0xd7a6('0x31')](_0x44185f['attributes'],function(_0x2a96cb){var _0x18e669={};_0x18e669[_0x2a96cb]={'$like':'%'+_0x5a9cc9[_0xd7a6('0x46')][_0xd7a6('0x8c')]+'%'};return _0x18e669;})});}if(_0x5a9cc9[_0xd7a6('0x46')]['$gte']){var _0x46f898=_0x5a9cc9[_0xd7a6('0x46')][_0xd7a6('0x83')][_0xd7a6('0x35')](',');var _0x4e7be8={};_0x4e7be8[_0x46f898[0x0]]={'$gte':moment(_0x46f898[0x1])[_0xd7a6('0xc8')](_0xd7a6('0xc9'))};_0x44185f[_0xd7a6('0x7f')]=_[_0xd7a6('0xa4')](_0x44185f[_0xd7a6('0x7f')],_0x4e7be8);}_0x44185f=_[_0xd7a6('0xa4')]({},_0x44185f,_0x5a9cc9['options']);return db[_0xd7a6('0xc5')][_0xd7a6('0x26')]({'where':_0x44185f[_0xd7a6('0x7f')]})[_0xd7a6('0x2c')](function(_0x9c1d34){_0x1b8204[_0xd7a6('0x26')]=_0x9c1d34;if(_0x5a9cc9[_0xd7a6('0x46')][_0xd7a6('0xbe')]){_0x44185f['include']=[{'all':!![]}];}return db[_0xd7a6('0xc5')][_0xd7a6('0xca')](_0x44185f);})[_0xd7a6('0x2c')](function(_0x2b9af9){_0x1b8204[_0xd7a6('0xbb')]=_0x2b9af9;return _0x1b8204;});}})['then'](respondWithFilteredResult(_0x1de6f3,_0x44185f))[_0xd7a6('0x37')](handleError(_0x1de6f3,null));};exports[_0xd7a6('0xcb')]=function(_0x14d8f4,_0x4ccdaf,_0x4a8d84){return db[_0xd7a6('0x40')][_0xd7a6('0x67')]({'where':{'id':_0x14d8f4['params']['id']}})[_0xd7a6('0x2c')](handleEntityNotFound(_0x4ccdaf,null))[_0xd7a6('0x2c')](function(_0x19ec7d){if(_0x19ec7d){return _0x19ec7d[_0xd7a6('0xcc')](_0x14d8f4['body'][_0xd7a6('0xc2')],_[_0xd7a6('0xcd')](_0x14d8f4[_0xd7a6('0x7b')],[_0xd7a6('0xc2'),'id'])||{})[_0xd7a6('0xce')](function(){return db[_0xd7a6('0x77')][_0xd7a6('0xca')]({'attributes':['id','name',_0xd7a6('0xcf')],'where':{'id':_0x14d8f4['body'][_0xd7a6('0xc2')]}});})[_0xd7a6('0x2c')](function(_0x39ebe2){socket[_0xd7a6('0xd0')](_0xd7a6('0xd1'),{'id':Number(_0x14d8f4[_0xd7a6('0xbd')]['id']),'tags':_0x39ebe2||[]});return{'id':Number(_0x14d8f4[_0xd7a6('0xbd')]['id']),'tags':_0x39ebe2||[]};});}})[_0xd7a6('0x2c')](respondWithResult(_0x4ccdaf,null))[_0xd7a6('0x37')](handleError(_0x4ccdaf,null));};exports[_0xd7a6('0xd2')]=function(_0x27a139,_0x34d7f9,_0x1f9a56){return db[_0xd7a6('0x40')][_0xd7a6('0x67')]({'where':{'id':_0x27a139[_0xd7a6('0xbd')]['id']}})[_0xd7a6('0x2c')](handleEntityNotFound(_0x34d7f9,null))[_0xd7a6('0x2c')](function(_0x5da095){if(_0x5da095){return _0x5da095[_0xd7a6('0xd2')](_0x27a139[_0xd7a6('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x34d7f9,null))[_0xd7a6('0x37')](handleError(_0x34d7f9,null));};exports['download']=function(_0x3280aa,_0x93bccc){var _0x1111cd=moment()[_0xd7a6('0xd3')]()[_0xd7a6('0xa2')]();var _0x58cf82=path['join'](config[_0xd7a6('0xd4')],'server',_0xd7a6('0xd5'),_0xd7a6('0xd6'));var _0x1e63c6=path[_0xd7a6('0xd7')](config[_0xd7a6('0xd4')],_0xd7a6('0xd8'),_0xd7a6('0xd5'),_0xd7a6('0xd9'));var _0x58e7be=path[_0xd7a6('0xd7')](_0x58cf82,_0x1111cd);var _0x57ff90=util[_0xd7a6('0xc8')]('transcript-%d-%s.zip',_0x3280aa[_0xd7a6('0xbd')]['id'],_0x1111cd);var _0x49bb23=path[_0xd7a6('0xd7')](_0x58cf82,_0x57ff90);var _0x11cd06=[];_0x11cd06['push']({'model':db['User'],'as':_0xd7a6('0x79'),'attributes':['id',_0xd7a6('0x32')],'raw':!![]});_0x11cd06[_0xd7a6('0xb9')]({'model':db[_0xd7a6('0xda')],'as':_0xd7a6('0x6d'),'attributes':['id','firstName',_0xd7a6('0xdb')],'raw':!![]});if(_0x3280aa[_0xd7a6('0x46')]['attachments']){_0x11cd06['push']({'model':db[_0xd7a6('0xdc')],'as':_0xd7a6('0xdc'),'raw':!![]});}var _0xe57dce=[{'model':db[_0xd7a6('0xc5')],'as':'Messages','attributes':['id','body','createdAt','direction',_0xd7a6('0xdd'),_0xd7a6('0xde')],'include':_0x11cd06}];_0xe57dce[_0xd7a6('0xb9')]({'model':db['OpenchannelAccount'],'as':_0xd7a6('0xdf'),'attributes':['id',_0xd7a6('0x2f')]});_0xe57dce[_0xd7a6('0xb9')]({'model':db[_0xd7a6('0x79')],'as':'Owner','attributes':['id',_0xd7a6('0x32')]});return db[_0xd7a6('0x40')][_0xd7a6('0x67')]({'where':{'id':_0x3280aa[_0xd7a6('0xbd')]['id']},'include':_0xe57dce})[_0xd7a6('0x2c')](handleEntityNotFound(_0x93bccc,null))[_0xd7a6('0x2c')](function(_0x5c174d){if(_0x5c174d){var _0x147cd2=_0x5c174d[_0xd7a6('0xe0')]({'plain':!![]});fs[_0xd7a6('0xe1')](_0x58e7be);var _0x3e606a={'channel':_0xd7a6('0xe2'),'account':_0x147cd2[_0xd7a6('0xdf')][_0xd7a6('0x2f')],'agent':_0x147cd2['Owner']?_0x147cd2[_0xd7a6('0xe3')]['fullname']:_0xd7a6('0xe4'),'createdAt':moment(_0x147cd2['createdAt'])[_0xd7a6('0xc8')](_0xd7a6('0xc9'))['toString'](),'closedAt':_0x147cd2[_0xd7a6('0x3d')]?moment(_0x147cd2[_0xd7a6('0xe5')])[_0xd7a6('0xc8')](_0xd7a6('0xc9'))[_0xd7a6('0xa2')]():'','disposition':_0x147cd2[_0xd7a6('0xe6')],'visibility':_0x147cd2[_0xd7a6('0xe7')]?_0xd7a6('0xe8'):'Private','messages':_(_0x147cd2[_0xd7a6('0xe9')])[_0xd7a6('0x8c')]({'secret':![]})[_0xd7a6('0x31')](function(_0x1087d6){if(_0x1087d6[_0xd7a6('0xdc')]){var _0x2d23bb=path[_0xd7a6('0xd7')](_0x1e63c6,_0x1087d6[_0xd7a6('0xdc')][_0xd7a6('0xea')]);if(fs['existsSync'](_0x2d23bb)){fs['createReadStream'](_0x2d23bb)['pipe'](fs['createWriteStream'](path['join'](_0x58e7be,_0x1087d6[_0xd7a6('0xdc')][_0xd7a6('0xea')])));}}return{'date':moment(_0x1087d6[_0xd7a6('0x81')])[_0xd7a6('0xc8')](_0xd7a6('0xc9'))[_0xd7a6('0xa2')](),'sender':_0x1087d6[_0xd7a6('0xeb')]==='out'?_0x1087d6[_0xd7a6('0x79')]?_0x1087d6[_0xd7a6('0x79')]['fullname']:_0xd7a6('0xec'):_0x1087d6['Contact'][_0xd7a6('0xed')]+(_0x1087d6[_0xd7a6('0x6d')][_0xd7a6('0xdb')]?'\x20'+_0x1087d6[_0xd7a6('0x6d')]['lastName']:''),'body':_0x1087d6[_0xd7a6('0xdc')]?_0x1087d6[_0xd7a6('0xdc')][_0xd7a6('0xea')]:_0x1087d6[_0xd7a6('0x7b')],'direction':_0x1087d6[_0xd7a6('0xeb')]===_0xd7a6('0xee')?'A':'C','secret':_0x1087d6[_0xd7a6('0xdd')],'read':_0x1087d6[_0xd7a6('0xde')],'attachment':_0x1087d6[_0xd7a6('0xdc')]};})[_0xd7a6('0x69')]()};return ejs[_0xd7a6('0xef')](path[_0xd7a6('0xd7')](config[_0xd7a6('0xd4')],_0xd7a6('0xd8'),_0xd7a6('0xf0'),_0xd7a6('0xf1')),{'interaction':_0x3e606a})[_0xd7a6('0x2c')](function(_0x2fe45e){var _0xe9353e=path[_0xd7a6('0xd7')](_0x58e7be,_0xd7a6('0xf2')+_0x147cd2['id']+'-'+_0x1111cd+_0xd7a6('0xf3'));var _0x3a96fb={'path':_0xe9353e,'channel':_0xd7a6('0xe2'),'interactionId':_0x147cd2['id']};return pdf['createPdfFromHTML'](_0x2fe45e,_0x3a96fb);})['then'](function(){return new BPromise(function(_0x4eb336,_0x493025){zipdir(_0x58e7be,{'saveTo':_0x49bb23},function(_0x34c173,_0x163609){if(_0x34c173)return _0x493025(_0x34c173);return _0x4eb336(_0x163609);});})[_0xd7a6('0x2c')](function(){return new BPromise(function(_0x1e6a9b,_0x2d3ccb){rimraf(_0x58e7be,function(_0x588845){if(_0x588845)_0x2d3ccb(_0x588845);return _0x1e6a9b();});});})[_0xd7a6('0x2c')](function(){return _0x93bccc[_0xd7a6('0xf4')](_0x49bb23,_0x57ff90,function(_0x4628eb){if(_0x4628eb){console[_0xd7a6('0xf5')]('err',_0x4628eb);}else{fs[_0xd7a6('0xf6')](_0x49bb23);}});});});}else{return _0x93bccc['sendStatus'](0xc8);}})[_0xd7a6('0x37')](handleError(_0x93bccc,null));}; \ No newline at end of file +var _0x5891=['downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','catch','waiting','answered','unmanaged','closed','UserId','talking','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','field','color','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','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','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','body','keys','some','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','OpenchannelAccountId','sequelize','toString','count','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','push','all','show','from','include','merge','create','params','describe','addMessage','OpenchannelMessage','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','ids','omit','spread','Tag','emit','removeTags','join','root','tmp','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','secret','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','System','renderFile','views'];(function(_0x50a463,_0x517a1a){var _0x2971df=function(_0x1f9cf1){while(--_0x1f9cf1){_0x50a463['push'](_0x50a463['shift']());}};_0x2971df(++_0x517a1a);}(_0x5891,0xfd));var _0x1589=function(_0x4e6e53,_0x31f7c8){_0x4e6e53=_0x4e6e53-0x0;var _0x5338af=_0x5891[_0x4e6e53];return _0x5338af;};'use strict';var emlformat=require(_0x1589('0x0'));var rimraf=require(_0x1589('0x1'));var zipdir=require(_0x1589('0x2'));var jsonpatch=require(_0x1589('0x3'));var rp=require('request-promise');var moment=require(_0x1589('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1589('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1589('0x6'));var csv=require(_0x1589('0x7'));var ejs=require(_0x1589('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1589('0x9'));var crypto=require(_0x1589('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1589('0xb'));var toCsv=require(_0x1589('0x7'));var querystring=require(_0x1589('0xc'));var Papa=require(_0x1589('0xd'));var Redis=require(_0x1589('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1589('0xf'));var as=require(_0x1589('0x10'));var pdf=require(_0x1589('0x11'));var hardwareService=require(_0x1589('0x12'));var logger=require(_0x1589('0x13'))(_0x1589('0x14'));var utils=require(_0x1589('0x15'));var config=require(_0x1589('0x16'));var licenseUtil=require(_0x1589('0x17'));var db=require(_0x1589('0x18'))['db'];config[_0x1589('0x19')]=_[_0x1589('0x1a')](config['redis'],{'host':_0x1589('0x1b'),'port':0x18eb});var socket=require(_0x1589('0x1c'))(new Redis(config[_0x1589('0x19')]));require(_0x1589('0x1d'))['register'](socket);function respondWithStatusCode(_0x4c8b03,_0x23b4dd){_0x23b4dd=_0x23b4dd||0xcc;return function(_0x8b863a){if(_0x8b863a){return _0x4c8b03[_0x1589('0x1e')](_0x23b4dd);}return _0x4c8b03[_0x1589('0x1f')](_0x23b4dd)[_0x1589('0x20')]();};}function respondWithResult(_0x5ec0c7,_0x484a57){_0x484a57=_0x484a57||0xc8;return function(_0x2ba787){if(_0x2ba787){return _0x5ec0c7[_0x1589('0x1f')](_0x484a57)[_0x1589('0x21')](_0x2ba787);}};}function respondWithFilteredResult(_0xf896d1,_0x33b48d){return function(_0x5b0ca4){if(_0x5b0ca4){var _0xd9acfa=typeof _0x33b48d[_0x1589('0x22')]===_0x1589('0x23')&&typeof _0x33b48d[_0x1589('0x24')]===_0x1589('0x23');var _0x36edd9=_0x5b0ca4['count'];var _0x244d4e=_0xd9acfa?0x0:_0x33b48d[_0x1589('0x22')];var _0x23ab53=_0xd9acfa?_0x5b0ca4['count']:_0x33b48d['offset']+_0x33b48d[_0x1589('0x24')];var _0x5b1e4b;if(_0x23ab53>=_0x36edd9){_0x23ab53=_0x36edd9;_0x5b1e4b=0xc8;}else{_0x5b1e4b=0xce;}_0xf896d1[_0x1589('0x1f')](_0x5b1e4b);return _0xf896d1[_0x1589('0x25')](_0x1589('0x26'),_0x244d4e+'-'+_0x23ab53+'/'+_0x36edd9)[_0x1589('0x21')](_0x5b0ca4);}return null;};}function patchUpdates(_0x516a16){return function(_0x325af2){try{jsonpatch[_0x1589('0x27')](_0x325af2,_0x516a16,!![]);}catch(_0x561408){return BPromise['reject'](_0x561408);}return _0x325af2[_0x1589('0x28')]();};}function saveUpdates(_0x37408a,_0x3a8a9a){return function(_0x519fb4){if(_0x519fb4){return _0x519fb4[_0x1589('0x29')](_0x37408a)['then'](function(_0x530a6c){return _0x530a6c;});}return null;};}function removeEntity(_0x3aa77e,_0x19ede0){return function(_0x74b967){if(_0x74b967){return _0x74b967[_0x1589('0x2a')]()[_0x1589('0x2b')](function(){_0x3aa77e[_0x1589('0x1f')](0xcc)[_0x1589('0x20')]();});}};}function handleEntityNotFound(_0x43e742,_0x236603){return function(_0x5d894a){if(!_0x5d894a){_0x43e742[_0x1589('0x1e')](0x194);}return _0x5d894a;};}function handleError(_0x48f975,_0x3c015e){_0x3c015e=_0x3c015e||0x1f4;return function(_0x18128c){logger[_0x1589('0x2c')](_0x18128c[_0x1589('0x2d')]);if(_0x18128c['name']){delete _0x18128c[_0x1589('0x2e')];}_0x48f975[_0x1589('0x1f')](_0x3c015e)[_0x1589('0x2f')](_0x18128c);};}function getInteractionUsers(_0x13b1ff,_0x289efc){return new BPromise(function(_0x17c287,_0x23a7ac){try{if(_0x289efc[_0x13b1ff['id']]){_0x13b1ff['Users']=_['map'](_0x289efc[_0x13b1ff['id']],function(_0x58f078){return{'id':_0x58f078['id'],'fullname':_0x58f078[_0x1589('0x30')]};});}}catch(_0xfcb421){_0x23a7ac(_0xfcb421);}_0x17c287(_0x13b1ff);});}function getInteractionTags(_0x84917f,_0x2e9369){return new BPromise(function(_0x20f4dd,_0x532e22){try{if(_0x84917f[_0x1589('0x31')]){_0x84917f[_0x1589('0x32')]=[];_0x84917f[_0x1589('0x31')][_0x1589('0x33')](',')[_0x1589('0x34')](function(_0x1a3449){_0x84917f[_0x1589('0x32')]['push'](_0x2e9369[_0x1a3449]);});}delete _0x84917f['TagIds'];}catch(_0x8b0146){_0x532e22(_0x8b0146);}_0x20f4dd(_0x84917f);});}function updateOpenchannelInteraction(_0x5d61eb,_0xebd2ff,_0x2ee158){return new BPromise(function(_0x461d3c,_0x3c131f){return getInteractionUsers(_0x5d61eb,_0x2ee158)[_0x1589('0x2b')](function(_0x2b2884){return getInteractionTags(_0x2b2884,_0xebd2ff);})[_0x1589('0x2b')](function(_0x374f4d){return getStateInteraction(_0x374f4d);})[_0x1589('0x2b')](function(_0x165c9d){_0x461d3c(_0x165c9d);})[_0x1589('0x35')](function(_0x379729){_0x3c131f(_0x379729);});});}function getStateInteraction(_0x246a90){return new BPromise(function(_0x3f7e09){_0x246a90[_0x1589('0x36')]=0x0;_0x246a90['talking']=0x0;_0x246a90[_0x1589('0x37')]=0x0;_0x246a90[_0x1589('0x38')]=0x0;_0x246a90['total']=0x0;if(!_0x246a90[_0x1589('0x39')]&&!_0x246a90[_0x1589('0x3a')]){_0x246a90[_0x1589('0x36')]+=0x1;}if(!_0x246a90[_0x1589('0x39')]&&_0x246a90[_0x1589('0x3a')]){_0x246a90[_0x1589('0x3b')]+=0x1;if(_0x246a90[_0x1589('0x36')]){_0x246a90['waiting']-=0x1;}}if(_0x246a90[_0x1589('0x39')]&&_0x246a90['UserId']){_0x246a90[_0x1589('0x37')]+=0x1;if(_0x246a90[_0x1589('0x3b')]){_0x246a90[_0x1589('0x3b')]-=0x1;}}if(_0x246a90[_0x1589('0x39')]&&!_0x246a90['UserId']){_0x246a90[_0x1589('0x38')]+=0x1;if(_0x246a90[_0x1589('0x36')]){_0x246a90[_0x1589('0x36')]-=0x1;}}_0x246a90['total']+=0x1;_0x3f7e09(_0x246a90);});}exports[_0x1589('0x3c')]=function(_0x155f95,_0x1d5765){var _0xf36ae6={},_0x48f8a2={},_0x91cb45={'count':0x0,'rows':[]};var _0x2e4290=_['map'](db[_0x1589('0x3d')][_0x1589('0x3e')],function(_0x10d10f){return{'name':_0x10d10f[_0x1589('0x3f')],'type':_0x10d10f[_0x1589('0x40')][_0x1589('0x41')]};});_0x48f8a2[_0x1589('0x42')]=_[_0x1589('0x43')](_0x2e4290,_0x1589('0x2e'));_0x48f8a2[_0x1589('0x44')]=_['keys'](_0x155f95[_0x1589('0x44')]);_0x48f8a2['filters']=_['intersection'](_0x48f8a2['model'],_0x48f8a2['query']);_0xf36ae6[_0x1589('0x45')]=_[_0x1589('0x46')](_0x48f8a2[_0x1589('0x42')],qs[_0x1589('0x47')](_0x155f95[_0x1589('0x44')][_0x1589('0x47')]));_0xf36ae6[_0x1589('0x45')]=_0xf36ae6[_0x1589('0x45')][_0x1589('0x48')]?_0xf36ae6[_0x1589('0x45')]:_0x48f8a2[_0x1589('0x42')];if(!_0x155f95[_0x1589('0x44')][_0x1589('0x49')](_0x1589('0x4a'))){_0xf36ae6[_0x1589('0x24')]=qs[_0x1589('0x24')](_0x155f95[_0x1589('0x44')][_0x1589('0x24')]);_0xf36ae6[_0x1589('0x22')]=qs[_0x1589('0x22')](_0x155f95[_0x1589('0x44')]['offset']);}_0xf36ae6[_0x1589('0x4b')]=qs[_0x1589('0x4c')](_0x155f95[_0x1589('0x44')][_0x1589('0x4c')]);_0xf36ae6[_0x1589('0x4d')]=qs['filters'](_['pick'](_0x155f95[_0x1589('0x44')],_0x48f8a2[_0x1589('0x4e')]),_0x2e4290);var _0x513d4f=[];var _0x491071=squel['select']()[_0x1589('0x4f')]('id')[_0x1589('0x4f')]('name')[_0x1589('0x4f')](_0x1589('0x50'))['from'](_0x1589('0x51'));var _0xfea96d=squel[_0x1589('0x52')]()[_0x1589('0x4f')](_0x1589('0x53'))[_0x1589('0x4f')](_0x1589('0x54'))[_0x1589('0x4f')](_0x1589('0x55'))['from'](_0x1589('0x56'),'ui')[_0x1589('0x57')]('users','u','u.id\x20=\x20ui.UserId');var _0x3b4452=squel[_0x1589('0x52')]()['from']('openchannel_interactions','i')['left_join'](_0x1589('0x58'),'c',_0x1589('0x59'))[_0x1589('0x57')](_0x1589('0x5a'),'o','o.id\x20=\x20i.UserId')[_0x1589('0x57')](_0x1589('0x5b'),'a',_0x1589('0x5c'))['left_join'](_0x1589('0x5d'),'me',_0x1589('0x5e'))[_0x1589('0x57')]('openchannel_interaction_has_tags','it',_0x1589('0x5f'))[_0x1589('0x57')](_0x1589('0x51'),'t',_0x1589('0x60'));var _0x5e2a54=squel[_0x1589('0x61')]();var _0x47be79=[];var _0x56db3e=squel[_0x1589('0x61')]();var _0x4ed21e;if(_0x155f95['query'][_0x1589('0x62')]){_0x4ed21e=as['parseSearch'](_0x155f95['query'][_0x1589('0x62')]);var _0x58dc71=_0x4ed21e['sqlOperator'];for(var _0x4b7de9=0x0;_0x4b7de9<_0x4ed21e[_0x1589('0x63')][_0x1589('0x48')];_0x4b7de9++){var _0x5813d2=_0x4ed21e[_0x1589('0x63')][_0x4b7de9];var _0xb296c4='i';var _0x327667=_['find'](_0x2e4290,[_0x1589('0x2e'),_0x5813d2[_0x1589('0x4f')]]);if(!_0x327667){switch(_0x5813d2['field']){case _0x1589('0x64'):if(_0x5813d2[_0x1589('0x65')]==0x1){_0x3b4452[_0x1589('0x66')]('`'+_0x5813d2[_0x1589('0x4f')]+_0x1589('0x67'));}else{_0x3b4452[_0x1589('0x66')]('`'+_0x5813d2[_0x1589('0x4f')]+_0x1589('0x68'));}break;case _0x1589('0x69'):if(_0x5813d2[_0x1589('0x6a')]==='$substring'){if(_0x5813d2[_0x1589('0x65')][_0x1589('0x33')]('\x20')[_0x1589('0x48')]>0x1){_0x5e2a54[_0x58dc71](_0x1589('0x6b'),qs[_0x1589('0x6c')](_0x5813d2[_0x1589('0x65')]),null);}else{var _0x5e593f='%'+_0x5813d2[_0x1589('0x65')]+'%';_0x5e2a54[_0x58dc71]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5e593f,_0x5e593f,_0x5e593f);}}else{_0x327667=_[_0x1589('0x6d')](_0x2e4290,[_0x1589('0x2e'),_0x1589('0x6e')]);_0x5813d2[_0x1589('0x4f')]=_0x1589('0x6e');_0x2b3395=as[_0x1589('0x6f')](_0xb296c4,_0x327667['type'],_0x5813d2);_0x5e2a54[_0x58dc71](_0x2b3395[_0x1589('0x70')],_0x2b3395[_0x1589('0x65')][_0x1589('0x71')],_0x2b3395[_0x1589('0x65')][_0x1589('0x20')]);}break;case'Tag':var _0x587aa4=_0x5813d2[_0x1589('0x65')]['split'](',')[_0x1589('0x43')](function(_0x2fecf4){return Number(_0x2fecf4);});_0x587aa4[_0x1589('0x34')](function(_0x18da14){_0x56db3e['or'](_0x1589('0x72'),'%,'+_0x18da14+',%');});_0x47be79=_[_0x1589('0x73')](_0x47be79,_0x587aa4);break;case _0x1589('0x74'):if(_0x5813d2[_0x1589('0x6a')]==='$substring'){_0x5e2a54[_0x58dc71]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5813d2[_0x1589('0x65')]+'%',null);}else{_0x327667=_[_0x1589('0x6d')](_0x2e4290,['name',_0x1589('0x3a')]);_0x5813d2[_0x1589('0x4f')]='UserId';_0x2b3395=as['buildExpression'](_0xb296c4,_0x327667[_0x1589('0x40')],_0x5813d2);_0x5e2a54[_0x58dc71](_0x2b3395[_0x1589('0x70')],_0x2b3395[_0x1589('0x65')][_0x1589('0x71')],_0x2b3395['value'][_0x1589('0x20')]);}break;case _0x1589('0x75'):_0x2b3395=as['buildExpression']('me',null,_0x5813d2);_0x5e2a54[_0x58dc71](_0x2b3395['text'],_0x2b3395[_0x1589('0x65')]['start'],_0x2b3395[_0x1589('0x65')][_0x1589('0x20')]);break;}}else{var _0x2b3395=as[_0x1589('0x6f')](_0xb296c4,_0x327667['type'],_0x5813d2);_0x5e2a54[_0x58dc71](_0x2b3395[_0x1589('0x70')],_0x2b3395[_0x1589('0x65')][_0x1589('0x71')],_0x2b3395[_0x1589('0x65')]['end']);}}}else{var _0xebb117=_(_0x155f95[_0x1589('0x44')])[_0x1589('0x76')]()[_0x1589('0x43')](function(_0x13d7bb){return _[_0x1589('0x77')](_0x2e4290,[_0x1589('0x2e'),_0x13d7bb])?_0x13d7bb:undefined;})['compact']()[_0x1589('0x65')]();if(!_[_0x1589('0x78')](_0xebb117)){_0xebb117['forEach'](function(_0x27fba9){if(_0x27fba9==='OpenchannelAccountId'){_0x3b4452[_0x1589('0x4d')](_0x1589('0x79'),[][_0x1589('0x7a')](_0x155f95[_0x1589('0x44')][_0x27fba9]));}else if(_0x27fba9===_0x1589('0x7b')){var _0x1a1148=JSON[_0x1589('0x7c')](_0x155f95[_0x1589('0x44')][_0x27fba9])[_0x1589('0x7d')];var _0x36778c=JSON[_0x1589('0x7c')](_0x155f95[_0x1589('0x44')][_0x27fba9])[_0x1589('0x7e')];_0x3b4452['where'](_0x1589('0x7f'),_0x1a1148,_0x36778c);}else{if(_0x155f95['query'][_0x27fba9]===_0x1589('0x80')){_0x3b4452[_0x1589('0x4d')]('i.'+_0x27fba9+_0x1589('0x81'));}else{_0x3b4452[_0x1589('0x4d')]('i.'+_0x27fba9+'\x20=\x20?',_0x155f95[_0x1589('0x44')][_0x27fba9]);}}});}if(_0x155f95['query'][_0x1589('0x82')]){if(_0x155f95[_0x1589('0x44')][_0x1589('0x82')]==0x1){_0x3b4452['having']('`unreadMessages`\x20=\x200');}else{_0x3b4452['having'](_0x1589('0x83'));}}if(_0x155f95[_0x1589('0x44')][_0x1589('0x84')]){_0x47be79=_[_0x1589('0x85')](_0x155f95['query'][_0x1589('0x84')])?_0x155f95[_0x1589('0x44')][_0x1589('0x84')]:new Array(_0x155f95[_0x1589('0x44')]['tag']);_0x47be79[_0x1589('0x34')](function(_0x34500e){_0x56db3e['or'](_0x1589('0x72'),'%,'+_0x34500e+',%');});}if(_0x155f95[_0x1589('0x44')]['filter']){var _0x464958=_0x155f95[_0x1589('0x44')][_0x1589('0x86')]['replace']('\x5c','\x5c\x5c')[_0x1589('0x87')](/'/g,'\x27\x27');if(qs[_0x1589('0x88')](_0x464958)){_0x5e2a54['or'](_0x1589('0x89'),_0x464958+'%');}else{_0x5e2a54['or'](_0x1589('0x8a'),qs[_0x1589('0x6c')](_0x464958))['or'](_0x1589('0x8b'),_0x464958+'%')['or'](_0x1589('0x8c'),_0x464958+'%');}}}_0x3b4452[_0x1589('0x4d')](_0x5e2a54);_0x3b4452[_0x1589('0x8d')](_0x1589('0x8e'));var _0xc155c5={'type':db['Sequelize'][_0x1589('0x8f')][_0x1589('0x90')],'raw':!![]};var _0x5a4783=_0x3b4452[_0x1589('0x91')]();_0x5a4783[_0x1589('0x4f')](_0x1589('0x8e'));_0x5a4783['field'](_0x1589('0x92'),_0x1589('0x64'));if(_0xf36ae6[_0x1589('0x4b')]){_0xf36ae6[_0x1589('0x4b')]['forEach'](function(_0x4a6acb){var _0x266281=_0x4a6acb[0x0]===_0x1589('0x93')?_0x4a6acb[0x0]:'i.'+_0x4a6acb[0x0];_0x3b4452[_0x1589('0x4b')](_0x266281,_0x4a6acb[0x1]===_0x1589('0x94')?![]:!![]);});}if(!_[_0x1589('0x78')](_0x47be79)){_0x3b4452['having'](_0x56db3e);_0x5a4783[_0x1589('0x4d')](_0x1589('0x95'),_0x47be79);}BPromise[_0x1589('0x96')]()[_0x1589('0x2b')](function(){if(!_0x4ed21e){if(_0x155f95[_0x1589('0x44')]['OpenchannelAccountId'])return;_0x5a4783[_0x1589('0x4d')](_0x1589('0x97'));_0x3b4452['where'](_0x1589('0x97'));return;}if(_0x155f95[_0x1589('0x98')][_0x1589('0x99')]!==_0x1589('0x9a'))return;return _0x155f95[_0x1589('0x98')][_0x1589('0x9b')]({'attributes':['id'],'raw':!![]})[_0x1589('0x2b')](function(_0x3bee7f){if(_['isEmpty'](_0x3bee7f)){_0x5a4783[_0x1589('0x4d')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x3b4452[_0x1589('0x4d')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5a4783[_0x1589('0x4d')](_0x1589('0x79'),_[_0x1589('0x43')](_0x3bee7f,'id'));_0x3b4452[_0x1589('0x4d')](_0x1589('0x79'),_[_0x1589('0x43')](_0x3bee7f,'id'));}});})[_0x1589('0x2b')](function(){if(_0x155f95['user'][_0x1589('0x99')]==='agent'&&!_0x4ed21e&&!_0x155f95[_0x1589('0x44')][_0x1589('0x9c')])return[];return db[_0x1589('0x9d')][_0x1589('0x44')](_0x5a4783[_0x1589('0x9e')](),_0xc155c5);})[_0x1589('0x2b')](function(_0x32509b){_0x91cb45['count']=_0x32509b[_0x1589('0x48')];if(_0x91cb45[_0x1589('0x9f')]===0x0)return[];return db[_0x1589('0x9d')][_0x1589('0x44')](_0x491071['toString'](),_0xc155c5)[_0x1589('0x2b')](function(_0xa8f8f1){_0x513d4f=_['keyBy'](_0xa8f8f1,'id');_0xc155c5=_['merge'](_0xc155c5,{'model':db[_0x1589('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x155f95[_0x1589('0x44')][_0x1589('0x47')]){_0xf36ae6['attributes'][_0x1589('0x34')](function(_0x53a936){_0x3b4452[_0x1589('0x4f')]('i.'+_0x53a936);});}else{_0x3b4452[_0x1589('0x4f')](_0x1589('0x92'),_0x1589('0x64'));_0x3b4452[_0x1589('0x4f')]('a.key',_0x1589('0xa0'));_0x3b4452[_0x1589('0x4f')](_0x1589('0xa1'),_0x1589('0xa2'));_0x3b4452[_0x1589('0x4f')](_0x1589('0xa3'),_0x1589('0x93'));_0x3b4452['field'](_0x1589('0xa4'));_0x3b4452[_0x1589('0x4f')](_0x1589('0xa5'),_0x1589('0xa6'));_0x3b4452[_0x1589('0x4f')]('c.lastName',_0x1589('0xa7'));_0x3b4452['field'](_0x1589('0xa8'),'Contact.email');_0x3b4452[_0x1589('0x4f')]('c.phone','Contact.phone');_0x3b4452['field'](_0x1589('0xa9'),_0x1589('0xaa'));_0x3b4452[_0x1589('0x4f')](_0x1589('0xab'),_0x1589('0xac'));_0x3b4452['field'](_0x1589('0xad'),'Owner.fullname');_0x3b4452[_0x1589('0x4f')]('o.internal',_0x1589('0xae'));_0x3b4452[_0x1589('0x4f')](_0x1589('0xaf'),'TagIds');}if(_0xf36ae6[_0x1589('0x24')])_0x3b4452['limit'](_0xf36ae6['limit']);if(_0xf36ae6['offset'])_0x3b4452['offset'](_0xf36ae6[_0x1589('0x22')]);return db['sequelize'][_0x1589('0x44')](_0x3b4452[_0x1589('0x9e')](),_0xc155c5);})[_0x1589('0x2b')](function(_0x28185d){if(_0x28185d[_0x1589('0x48')]>0x0)_0xfea96d[_0x1589('0x4d')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x28185d,'id'));return db[_0x1589('0x9d')][_0x1589('0x44')](_0xfea96d['toString'](),_0xc155c5)[_0x1589('0x2b')](function(_0xcbe858){var _0x33b875=_[_0x1589('0xb0')](_0xcbe858,_0x1589('0xb1'));var _0x5b30d8=[];_0x28185d[_0x1589('0x34')](function(_0x874272){_0x5b30d8[_0x1589('0xb2')](updateOpenchannelInteraction(_0x874272,_0x513d4f,_0x33b875));});return BPromise[_0x1589('0xb3')](_0x5b30d8);});});})[_0x1589('0x2b')](function(_0x36d5d8){_0x91cb45['rows']=_0x36d5d8;return _0x91cb45;})[_0x1589('0x2b')](respondWithFilteredResult(_0x1d5765,_0xf36ae6))[_0x1589('0x35')](handleError(_0x1d5765,null));};exports[_0x1589('0xb4')]=function(_0x13f2d1,_0x3c91f0){var _0x379117={};if(_0x13f2d1[_0x1589('0x44')]['type']&&_0x13f2d1[_0x1589('0x44')]['type']===_0x1589('0xb5')){_0x379117[_0x1589('0xb5')]=_0x13f2d1['params']['id'];}else{_0x379117['id']=_0x13f2d1['params']['id'];}var _0xe708e3={'raw':![],'where':_0x379117},_0x1455ca={};_0x1455ca['model']=_['keys'](db[_0x1589('0x3d')][_0x1589('0x3e')]);_0x1455ca[_0x1589('0x44')]=_[_0x1589('0x76')](_0x13f2d1[_0x1589('0x44')]);_0x1455ca[_0x1589('0x4e')]=_[_0x1589('0x46')](_0x1455ca[_0x1589('0x42')],_0x1455ca[_0x1589('0x44')]);_0xe708e3[_0x1589('0x45')]=_['intersection'](_0x1455ca[_0x1589('0x42')],qs[_0x1589('0x47')](_0x13f2d1[_0x1589('0x44')]['fields']));_0xe708e3['attributes']=_0xe708e3[_0x1589('0x45')][_0x1589('0x48')]?_0xe708e3[_0x1589('0x45')]:_0x1455ca[_0x1589('0x42')];if(_0x13f2d1[_0x1589('0x44')]['includeAll']){_0xe708e3[_0x1589('0xb6')]=[{'all':!![]}];}_0xe708e3=_[_0x1589('0xb7')]({},_0xe708e3,_0x13f2d1['options']);return db['OpenchannelInteraction'][_0x1589('0x6d')](_0xe708e3)[_0x1589('0x2b')](handleEntityNotFound(_0x3c91f0,null))[_0x1589('0x2b')](respondWithResult(_0x3c91f0,null))['catch'](handleError(_0x3c91f0,null));};exports['create']=function(_0x376c12,_0xe2a840){return db['OpenchannelInteraction'][_0x1589('0xb8')](_0x376c12[_0x1589('0x75')],{})['then'](respondWithResult(_0xe2a840,0xc9))[_0x1589('0x35')](handleError(_0xe2a840,null));};exports[_0x1589('0x29')]=function(_0x5b0a11,_0x4e6e80){if(_0x5b0a11[_0x1589('0x75')]['id']){delete _0x5b0a11[_0x1589('0x75')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x5b0a11[_0x1589('0xb9')]['id']}})['then'](handleEntityNotFound(_0x4e6e80,null))['then'](saveUpdates(_0x5b0a11[_0x1589('0x75')],null))['then'](respondWithResult(_0x4e6e80,null))[_0x1589('0x35')](handleError(_0x4e6e80,null));};exports['destroy']=function(_0x3541e8,_0x5dda6a){return db[_0x1589('0x3d')][_0x1589('0x6d')]({'where':{'id':_0x3541e8['params']['id']}})['then'](handleEntityNotFound(_0x5dda6a,null))['then'](removeEntity(_0x5dda6a,null))[_0x1589('0x35')](handleError(_0x5dda6a,null));};exports[_0x1589('0xba')]=function(_0x49ee68,_0x59d1f2){return db[_0x1589('0x3d')][_0x1589('0xba')]()[_0x1589('0x2b')](respondWithResult(_0x59d1f2,null))[_0x1589('0x35')](handleError(_0x59d1f2,null));};exports[_0x1589('0xbb')]=function(_0x4f1ea0,_0x5ac621,_0x23455c){return db[_0x1589('0xbc')][_0x1589('0x6d')]({'where':{'id':_0x4f1ea0[_0x1589('0xb9')]['id']}})['then'](handleEntityNotFound(_0x5ac621,null))[_0x1589('0x2b')](function(_0xadb553){if(_0xadb553){return _0xadb553['addMessage'](_0x4f1ea0['body']['ids'],_['omit'](_0x4f1ea0[_0x1589('0x75')],['ids','id'])||{});}})[_0x1589('0x2b')](respondWithResult(_0x5ac621,null))[_0x1589('0x35')](handleError(_0x5ac621,null));};exports[_0x1589('0xbd')]=function(_0xe14d9d,_0x1e0113,_0x37cd2e){var _0x50b5db={'raw':![],'where':{}};var _0x5b5e04={};var _0x2f8bf5={'count':0x0,'rows':[]};return db[_0x1589('0x3d')][_0x1589('0xbe')]({'where':{'id':_0xe14d9d[_0x1589('0xb9')]['id']}})[_0x1589('0x2b')](handleEntityNotFound(_0x1e0113,null))['then'](function(_0xa05927){if(_0xa05927){_0x5b5e04['model']=_['keys'](db[_0x1589('0xbc')]['rawAttributes']);_0x5b5e04['query']=_[_0x1589('0x76')](_0xe14d9d[_0x1589('0x44')]);_0x5b5e04[_0x1589('0x4e')]=_[_0x1589('0x46')](_0x5b5e04['model'],_0x5b5e04[_0x1589('0x44')]);_0x50b5db[_0x1589('0x45')]=_['intersection'](_0x5b5e04[_0x1589('0x42')],qs[_0x1589('0x47')](_0xe14d9d[_0x1589('0x44')][_0x1589('0x47')]));_0x50b5db[_0x1589('0x45')]=_0x50b5db[_0x1589('0x45')][_0x1589('0x48')]?_0x50b5db['attributes']:_0x5b5e04[_0x1589('0x42')];if(!_0xe14d9d[_0x1589('0x44')][_0x1589('0x49')](_0x1589('0x4a'))){_0x50b5db['limit']=qs[_0x1589('0x24')](_0xe14d9d['query']['limit']);_0x50b5db['offset']=qs[_0x1589('0x22')](_0xe14d9d[_0x1589('0x44')][_0x1589('0x22')]);}_0x50b5db[_0x1589('0x4b')]=qs[_0x1589('0x4c')](_0xe14d9d[_0x1589('0x44')]['sort']);_0x50b5db[_0x1589('0x4d')]=qs[_0x1589('0x4e')](_['pick'](_0xe14d9d[_0x1589('0x44')],_0x5b5e04['filters']));_0x50b5db[_0x1589('0x4d')]['OpenchannelInteractionId']=_0xa05927['id'];if(_0xe14d9d[_0x1589('0x44')][_0x1589('0x86')]){_0x50b5db['where']=_[_0x1589('0xb7')](_0x50b5db[_0x1589('0x4d')],{'$or':_['map'](_0x50b5db['attributes'],function(_0x5eee23){var _0xe0e18e={};_0xe0e18e[_0x5eee23]={'$like':'%'+_0xe14d9d[_0x1589('0x44')][_0x1589('0x86')]+'%'};return _0xe0e18e;})});}if(_0xe14d9d[_0x1589('0x44')][_0x1589('0x7d')]){var _0x13ca73=_0xe14d9d['query'][_0x1589('0x7d')]['split'](',');var _0x3262f3={};_0x3262f3[_0x13ca73[0x0]]={'$gte':moment(_0x13ca73[0x1])[_0x1589('0xbf')](_0x1589('0xc0'))};_0x50b5db[_0x1589('0x4d')]=_[_0x1589('0xb7')](_0x50b5db[_0x1589('0x4d')],_0x3262f3);}_0x50b5db=_[_0x1589('0xb7')]({},_0x50b5db,_0xe14d9d[_0x1589('0xc1')]);return db['OpenchannelMessage']['count']({'where':_0x50b5db[_0x1589('0x4d')]})[_0x1589('0x2b')](function(_0x2627be){_0x2f8bf5[_0x1589('0x9f')]=_0x2627be;if(_0xe14d9d[_0x1589('0x44')][_0x1589('0xc2')]){_0x50b5db['include']=[{'all':!![]}];}return db[_0x1589('0xbc')][_0x1589('0xc3')](_0x50b5db);})['then'](function(_0x33ddf2){_0x2f8bf5['rows']=_0x33ddf2;return _0x2f8bf5;});}})[_0x1589('0x2b')](respondWithFilteredResult(_0x1e0113,_0x50b5db))[_0x1589('0x35')](handleError(_0x1e0113,null));};exports[_0x1589('0xc4')]=function(_0x157f90,_0x1fe647,_0x114ccb){return db[_0x1589('0x3d')]['find']({'where':{'id':_0x157f90[_0x1589('0xb9')]['id']}})[_0x1589('0x2b')](handleEntityNotFound(_0x1fe647,null))[_0x1589('0x2b')](function(_0x599234){if(_0x599234){return _0x599234[_0x1589('0xc5')](_0x157f90['body'][_0x1589('0xc6')],_[_0x1589('0xc7')](_0x157f90[_0x1589('0x75')],[_0x1589('0xc6'),'id'])||{})[_0x1589('0xc8')](function(){return db[_0x1589('0xc9')][_0x1589('0xc3')]({'attributes':['id',_0x1589('0x2e'),_0x1589('0x50')],'where':{'id':_0x157f90[_0x1589('0x75')]['ids']}});})[_0x1589('0x2b')](function(_0x1b1460){socket[_0x1589('0xca')]('openchannelInteractionTags:save',{'id':Number(_0x157f90['params']['id']),'tags':_0x1b1460||[]});return{'id':Number(_0x157f90[_0x1589('0xb9')]['id']),'tags':_0x1b1460||[]};});}})[_0x1589('0x2b')](respondWithResult(_0x1fe647,null))[_0x1589('0x35')](handleError(_0x1fe647,null));};exports[_0x1589('0xcb')]=function(_0x4dca23,_0x2a4647,_0x35ba43){return db[_0x1589('0x3d')]['find']({'where':{'id':_0x4dca23[_0x1589('0xb9')]['id']}})['then'](handleEntityNotFound(_0x2a4647,null))[_0x1589('0x2b')](function(_0x4d5b62){if(_0x4d5b62){return _0x4d5b62['removeTags'](_0x4dca23[_0x1589('0x44')][_0x1589('0xc6')]);}})[_0x1589('0x2b')](respondWithStatusCode(_0x2a4647,null))[_0x1589('0x35')](handleError(_0x2a4647,null));};exports['download']=function(_0x5d920b,_0x1ac937){var _0x266584=moment()['unix']()[_0x1589('0x9e')]();var _0x222984=path[_0x1589('0xcc')](config[_0x1589('0xcd')],'server','files',_0x1589('0xce'));var _0x298c45=path[_0x1589('0xcc')](config[_0x1589('0xcd')],_0x1589('0xcf'),'files',_0x1589('0xd0'));var _0x1c1469=path[_0x1589('0xcc')](_0x222984,_0x266584);var _0x18a40f=util[_0x1589('0xbf')](_0x1589('0xd1'),_0x5d920b[_0x1589('0xb9')]['id'],_0x266584);var _0x15ce23=path[_0x1589('0xcc')](_0x222984,_0x18a40f);var _0x2da50d=[];_0x2da50d['push']({'model':db[_0x1589('0x74')],'as':_0x1589('0x74'),'attributes':['id',_0x1589('0x30')],'raw':!![]});_0x2da50d[_0x1589('0xb2')]({'model':db[_0x1589('0xd2')],'as':_0x1589('0x69'),'attributes':['id',_0x1589('0xd3'),_0x1589('0xd4')],'raw':!![]});if(_0x5d920b[_0x1589('0x44')][_0x1589('0xd0')]){_0x2da50d[_0x1589('0xb2')]({'model':db[_0x1589('0xd5')],'as':_0x1589('0xd5'),'raw':!![]});}var _0x1d9c71=[{'model':db[_0x1589('0xbc')],'as':_0x1589('0xd6'),'attributes':['id','body','createdAt','direction',_0x1589('0xd7'),_0x1589('0x82')],'include':_0x2da50d}];_0x1d9c71[_0x1589('0xb2')]({'model':db['OpenchannelAccount'],'as':_0x1589('0xd8'),'attributes':['id',_0x1589('0x2e')]});_0x1d9c71[_0x1589('0xb2')]({'model':db[_0x1589('0x74')],'as':_0x1589('0xd9'),'attributes':['id',_0x1589('0x30')]});return db['OpenchannelInteraction'][_0x1589('0x6d')]({'where':{'id':_0x5d920b[_0x1589('0xb9')]['id']},'include':_0x1d9c71})[_0x1589('0x2b')](handleEntityNotFound(_0x1ac937,null))[_0x1589('0x2b')](function(_0x4908e6){if(_0x4908e6){var _0x11d47b=_0x4908e6[_0x1589('0xda')]({'plain':!![]});fs[_0x1589('0xdb')](_0x1c1469);var _0x3c6c8a={'channel':_0x1589('0xdc'),'account':_0x11d47b[_0x1589('0xd8')][_0x1589('0x2e')],'agent':_0x11d47b[_0x1589('0xd9')]?_0x11d47b['Owner']['fullname']:_0x1589('0xdd'),'createdAt':moment(_0x11d47b['createdAt'])[_0x1589('0xbf')](_0x1589('0xc0'))[_0x1589('0x9e')](),'closedAt':_0x11d47b[_0x1589('0x39')]?moment(_0x11d47b[_0x1589('0xde')])[_0x1589('0xbf')](_0x1589('0xc0'))['toString']():'','disposition':_0x11d47b[_0x1589('0xdf')],'visibility':_0x11d47b[_0x1589('0xe0')]?_0x1589('0xe1'):_0x1589('0xe2'),'messages':_(_0x11d47b[_0x1589('0xd6')])['filter']({'secret':![]})['map'](function(_0xd6b2ef){if(_0xd6b2ef[_0x1589('0xd5')]){var _0x11ae73=path[_0x1589('0xcc')](_0x298c45,_0xd6b2ef[_0x1589('0xd5')]['basename']);if(fs[_0x1589('0xe3')](_0x11ae73)){fs[_0x1589('0xe4')](_0x11ae73)[_0x1589('0xe5')](fs[_0x1589('0xe6')](path['join'](_0x1c1469,_0xd6b2ef['Attachment'][_0x1589('0xe7')])));}}return{'date':moment(_0xd6b2ef[_0x1589('0x7b')])[_0x1589('0xbf')](_0x1589('0xc0'))[_0x1589('0x9e')](),'sender':_0xd6b2ef[_0x1589('0xe8')]===_0x1589('0xe9')?_0xd6b2ef['User']?_0xd6b2ef[_0x1589('0x74')][_0x1589('0x30')]:_0x1589('0xea'):_0xd6b2ef[_0x1589('0x69')]['firstName']+(_0xd6b2ef[_0x1589('0x69')][_0x1589('0xd4')]?'\x20'+_0xd6b2ef[_0x1589('0x69')][_0x1589('0xd4')]:''),'body':_0xd6b2ef[_0x1589('0xd5')]?_0xd6b2ef[_0x1589('0xd5')]['basename']:_0xd6b2ef[_0x1589('0x75')],'direction':_0xd6b2ef['direction']===_0x1589('0xe9')?'A':'C','secret':_0xd6b2ef[_0x1589('0xd7')],'read':_0xd6b2ef['read'],'attachment':_0xd6b2ef[_0x1589('0xd5')]};})[_0x1589('0x65')]()};return ejs[_0x1589('0xeb')](path['join'](config['root'],_0x1589('0xcf'),_0x1589('0xec'),_0x1589('0xed')),{'interaction':_0x3c6c8a})[_0x1589('0x2b')](function(_0x187265){var _0x2186ea=path['join'](_0x1c1469,_0x1589('0xee')+_0x11d47b['id']+'-'+_0x266584+_0x1589('0xef'));var _0x480940={'path':_0x2186ea,'channel':'Openchannel','interactionId':_0x11d47b['id']};return pdf[_0x1589('0xf0')](_0x187265,_0x480940);})[_0x1589('0x2b')](function(){return new BPromise(function(_0x46cff1,_0x302f04){zipdir(_0x1c1469,{'saveTo':_0x15ce23},function(_0x49035d,_0x1acdd0){if(_0x49035d)return _0x302f04(_0x49035d);return _0x46cff1(_0x1acdd0);});})['then'](function(){return new BPromise(function(_0x23e762,_0x21541a){rimraf(_0x1c1469,function(_0x524d8d){if(_0x524d8d)_0x21541a(_0x524d8d);return _0x23e762();});});})['then'](function(){return _0x1ac937[_0x1589('0xf1')](_0x15ce23,_0x18a40f,function(_0x5d254c){if(_0x5d254c){console[_0x1589('0xf2')](_0x1589('0xf3'),_0x5d254c);}else{fs[_0x1589('0xf4')](_0x15ce23);}});});});}else{return _0x1ac937[_0x1589('0x1e')](0xc8);}})[_0x1589('0x35')](handleError(_0x1ac937,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index ca32a8a..bafd828 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 _0x1bea=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','remove','getUsers','setDataValue','Users','map','then','unreadMessages','length','emit'];(function(_0xbee1,_0x567edc){var _0x4dd1c2=function(_0x22ffef){while(--_0x22ffef){_0xbee1['push'](_0xbee1['shift']());}};_0x4dd1c2(++_0x567edc);}(_0x1bea,0x160));var _0xa1be=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x1bea[_0x4d35f3];return _0x382fea;};'use strict';var EventEmitter=require(_0xa1be('0x0'));var OpenchannelInteraction=require(_0xa1be('0x1'))['db'][_0xa1be('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa1be('0x3')};function emitEvent(_0x1dcf31){return function(_0x553c7b,_0x5b74be,_0x1a5924){_0x553c7b[_0xa1be('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22cfb2){_0x553c7b[_0xa1be('0x5')](_0xa1be('0x6'),_0x22cfb2[_0xa1be('0x7')](function(_0x3f7631){return{'id':_0x3f7631['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x553c7b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1be('0x8')](function(_0x8f562){_0x553c7b['setDataValue'](_0xa1be('0x9'),_0x8f562[_0xa1be('0xa')]);OpenchannelInteractionEvents[_0xa1be('0xb')](_0x1dcf31+':'+_0x553c7b['id'],_0x553c7b);OpenchannelInteractionEvents['emit'](_0x1dcf31,_0x553c7b);_0x1a5924(null);})['catch'](_0x1a5924(null));};}for(var e in events){if(events[_0xa1be('0xc')](e)){var event=events[e];OpenchannelInteraction[_0xa1be('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xb40c=['update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save'];(function(_0x4a9fd8,_0x13b5cb){var _0x1900fa=function(_0x2cee0d){while(--_0x2cee0d){_0x4a9fd8['push'](_0x4a9fd8['shift']());}};_0x1900fa(++_0x13b5cb);}(_0xb40c,0xc7));var _0xcb40=function(_0x3227c4,_0x29f196){_0x3227c4=_0x3227c4-0x0;var _0x13dedb=_0xb40c[_0x3227c4];return _0x13dedb;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xcb40('0x0'))['db'][_0xcb40('0x1')];var OpenchannelMessage=require(_0xcb40('0x0'))['db'][_0xcb40('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcb40('0x3')](0x0);var events={'afterCreate':_0xcb40('0x4'),'afterUpdate':_0xcb40('0x5'),'afterDestroy':_0xcb40('0x6')};function emitEvent(_0x49cb42){return function(_0x110ff9,_0x7d584f,_0x317488){_0x110ff9[_0xcb40('0x7')]({'attributes':['id'],'raw':!![]})[_0xcb40('0x8')](function(_0xe53f2d){_0x110ff9['setDataValue'](_0xcb40('0x9'),_0xe53f2d[_0xcb40('0xa')](function(_0x4cce2a){return{'id':_0x4cce2a['id']};}));return OpenchannelMessage[_0xcb40('0xb')]({'where':{'OpenchannelInteractionId':_0x110ff9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcb40('0x8')](function(_0x522c38){_0x110ff9[_0xcb40('0xc')](_0xcb40('0xd'),_0x522c38[_0xcb40('0xe')]);OpenchannelInteractionEvents[_0xcb40('0xf')](_0x49cb42+':'+_0x110ff9['id'],_0x110ff9);OpenchannelInteractionEvents[_0xcb40('0xf')](_0x49cb42,_0x110ff9);_0x317488(null);})['catch'](_0x317488(null));};}for(var e in events){if(events[_0xcb40('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f97cad7..7435d43 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 _0x9fa0=['rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','bluebird','request-promise'];(function(_0x892934,_0x1b5750){var _0x3fe3ff=function(_0x8cd796){while(--_0x8cd796){_0x892934['push'](_0x892934['shift']());}};_0x3fe3ff(++_0x1b5750);}(_0x9fa0,0x6c));var _0x09fa=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x9fa0[_0x1d558c];return _0x15767d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x09fa('0x0'));var moment=require(_0x09fa('0x1'));var BPromise=require(_0x09fa('0x2'));var rp=require(_0x09fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09fa('0x4'));var config=require(_0x09fa('0x5'));var attributes=require(_0x09fa('0x6'));module['exports']=function(_0xe2e03d,_0x5c10d2){return _0xe2e03d[_0x09fa('0x7')](_0x09fa('0x8'),attributes,{'tableName':_0x09fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x09fa('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x182728,_0x4b0012,_0x1ad335){if(_0x182728['changed'](_0x09fa('0xb'))){_0x182728['closedAt']=moment()[_0x09fa('0xc')](_0x09fa('0xd'));}_0x1ad335(null,_0x182728);}}});}; \ No newline at end of file +var _0x85b3=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x95b2c8,_0x5e1544){var _0x53480c=function(_0x1a719f){while(--_0x1a719f){_0x95b2c8['push'](_0x95b2c8['shift']());}};_0x53480c(++_0x5e1544);}(_0x85b3,0x90));var _0x385b=function(_0x430998,_0x34852a){_0x430998=_0x430998-0x0;var _0xc562fa=_0x85b3[_0x430998];return _0xc562fa;};'use strict';var _=require(_0x385b('0x0'));var util=require('util');var logger=require(_0x385b('0x1'))('api');var moment=require(_0x385b('0x2'));var BPromise=require(_0x385b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x385b('0x4'));var rimraf=require('rimraf');var config=require(_0x385b('0x5'));var attributes=require(_0x385b('0x6'));module[_0x385b('0x7')]=function(_0x43059a,_0x859ecd){return _0x43059a[_0x385b('0x8')](_0x385b('0x9'),attributes,{'tableName':_0x385b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x385b('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x184df9,_0x3db300,_0x14e7bb){if(_0x184df9['changed'](_0x385b('0xc'))){_0x184df9[_0x385b('0xd')]=moment()['format'](_0x385b('0xe'));}_0x14e7bb(null,_0x184df9);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 09d5178..df0f733 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 _0x3409=['./openchannelInteraction.socket','request','info','request\x20sent','debug','error','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','stringify','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x1d56fd,_0x36c2d4){var _0x1f9f71=function(_0x29a699){while(--_0x29a699){_0x1d56fd['push'](_0x1d56fd['shift']());}};_0x1f9f71(++_0x36c2d4);}(_0x3409,0x19e));var _0x9340=function(_0x504c5f,_0x2803bb){_0x504c5f=_0x504c5f-0x0;var _0xcbbcaa=_0x3409[_0x504c5f];return _0xcbbcaa;};'use strict';var _=require(_0x9340('0x0'));var util=require(_0x9340('0x1'));var moment=require(_0x9340('0x2'));var BPromise=require('bluebird');var rs=require(_0x9340('0x3'));var fs=require('fs');var Redis=require(_0x9340('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9340('0x5'));var logger=require(_0x9340('0x6'))(_0x9340('0x7'));var config=require(_0x9340('0x8'));var jayson=require(_0x9340('0x9'));var client=jayson[_0x9340('0xa')]['http']({'port':0x232a});config['redis']=_[_0x9340('0xb')](config[_0x9340('0xc')],{'host':_0x9340('0xd'),'port':0x18eb});var socket=require(_0x9340('0xe'))(new Redis(config[_0x9340('0xc')]));require(_0x9340('0xf'))['register'](socket);function respondWithRpcPromise(_0xf50960,_0x16cf78,_0x16a043){return new BPromise(function(_0x4e87a0,_0x137563){return client[_0x9340('0x10')](_0xf50960,_0x16a043)['then'](function(_0x614eb9){logger[_0x9340('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x16cf78,_0x9340('0x12'));logger[_0x9340('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x16cf78,_0x9340('0x12'),JSON['stringify'](_0x614eb9));if(_0x614eb9[_0x9340('0x14')]){if(_0x614eb9[_0x9340('0x14')]['code']===0x1f4){logger['error'](_0x9340('0x15'),_0x16cf78,_0x614eb9['error'][_0x9340('0x16')]);return _0x137563(_0x614eb9[_0x9340('0x14')][_0x9340('0x16')]);}logger[_0x9340('0x14')](_0x9340('0x15'),_0x16cf78,_0x614eb9['error'][_0x9340('0x16')]);return _0x4e87a0(_0x614eb9[_0x9340('0x14')]['message']);}else{logger[_0x9340('0x11')](_0x9340('0x15'),_0x16cf78,_0x9340('0x12'));_0x4e87a0(_0x614eb9['result'][_0x9340('0x16')]);}})[_0x9340('0x17')](function(_0x4eee0d){logger[_0x9340('0x14')](_0x9340('0x15'),_0x16cf78,_0x4eee0d);_0x137563(_0x4eee0d);});});}exports[_0x9340('0x18')]=function(_0x9d1d3d){var _0x36857b=this;return new Promise(function(_0x11e771,_0x433b61){return db[_0x9340('0x19')][_0x9340('0x1a')](_0x9d1d3d[_0x9340('0x1b')],{'raw':_0x9d1d3d[_0x9340('0x1c')]?_0x9d1d3d[_0x9340('0x1c')][_0x9340('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9d1d3d[_0x9340('0x1c')]?_0x9d1d3d['options'][_0x9340('0x1e')]||null:null,'attributes':_0x9d1d3d['options']?_0x9d1d3d[_0x9340('0x1c')][_0x9340('0x1f')]||null:null,'limit':_0x9d1d3d['options']?_0x9d1d3d[_0x9340('0x1c')][_0x9340('0x20')]||null:null})[_0x9340('0x21')](function(_0x49dc97){logger[_0x9340('0x11')](_0x9340('0x18'),_0x9d1d3d);logger[_0x9340('0x13')](_0x9340('0x18'),_0x9d1d3d,JSON[_0x9340('0x22')](_0x49dc97));_0x11e771(_0x49dc97);})[_0x9340('0x17')](function(_0x3c81e2){logger[_0x9340('0x14')](_0x9340('0x18'),_0x3c81e2[_0x9340('0x16')],_0x9d1d3d);_0x433b61(_0x36857b['error'](0x1f4,_0x3c81e2[_0x9340('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x47198d){return new Promise(function(_0x28c277,_0x27983b){return db[_0x9340('0x19')]['find']({'where':_0x47198d[_0x9340('0x1c')]?_0x47198d['options']['where']||null:null})[_0x9340('0x21')](function(_0x3af8db){if(_0x3af8db){return _0x3af8db[_0x9340('0x23')](_0x47198d['body'][_0x9340('0x24')],_['omit'](_0x47198d[_0x9340('0x1b')],[_0x9340('0x24'),'id'])||{});}})[_0x9340('0x25')](function(_0x47c005){logger[_0x9340('0x11')](_0x9340('0x26'),_0x47198d);logger['debug']('AddTags',_0x47198d,JSON[_0x9340('0x22')](_0x47c005));_0x28c277(_0x47c005);})[_0x9340('0x17')](function(_0x540b41){logger[_0x9340('0x14')](_0x9340('0x26'),_0x540b41[_0x9340('0x16')],_0x47198d);_0x27983b(_this[_0x9340('0x14')](0x1f4,_0x540b41['message']));});});}; \ No newline at end of file +var _0xb67b=['where','attributes','AddTagsToOpenchannelInteraction','find','then','addTags','omit','ids','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw'];(function(_0x4415fc,_0x2f5b40){var _0x3050e1=function(_0x5d0077){while(--_0x5d0077){_0x4415fc['push'](_0x4415fc['shift']());}};_0x3050e1(++_0x2f5b40);}(_0xb67b,0x84));var _0xbb67=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0xb67b[_0x1fd9e7];return _0x1781f2;};'use strict';var _=require(_0xbb67('0x0'));var util=require('util');var moment=require(_0xbb67('0x1'));var BPromise=require(_0xbb67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb67('0x3'));var db=require(_0xbb67('0x4'))['db'];var utils=require(_0xbb67('0x5'));var logger=require('../../config/logger')(_0xbb67('0x6'));var config=require(_0xbb67('0x7'));var jayson=require(_0xbb67('0x8'));var client=jayson['client'][_0xbb67('0x9')]({'port':0x232a});config[_0xbb67('0xa')]=_[_0xbb67('0xb')](config[_0xbb67('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb67('0xc'))(new Redis(config[_0xbb67('0xa')]));require(_0xbb67('0xd'))['register'](socket);function respondWithRpcPromise(_0x5c18da,_0x4a1a65,_0x23b7b7){return new BPromise(function(_0x1fdafc,_0x38f3a9){return client[_0xbb67('0xe')](_0x5c18da,_0x23b7b7)['then'](function(_0xffe791){logger[_0xbb67('0xf')](_0xbb67('0x10'),_0x4a1a65,_0xbb67('0x11'));logger[_0xbb67('0x12')](_0xbb67('0x13'),_0x4a1a65,_0xbb67('0x11'),JSON[_0xbb67('0x14')](_0xffe791));if(_0xffe791[_0xbb67('0x15')]){if(_0xffe791[_0xbb67('0x15')][_0xbb67('0x16')]===0x1f4){logger['error'](_0xbb67('0x10'),_0x4a1a65,_0xffe791[_0xbb67('0x15')][_0xbb67('0x17')]);return _0x38f3a9(_0xffe791[_0xbb67('0x15')][_0xbb67('0x17')]);}logger[_0xbb67('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4a1a65,_0xffe791['error'][_0xbb67('0x17')]);return _0x1fdafc(_0xffe791[_0xbb67('0x15')][_0xbb67('0x17')]);}else{logger[_0xbb67('0xf')](_0xbb67('0x10'),_0x4a1a65,_0xbb67('0x11'));_0x1fdafc(_0xffe791[_0xbb67('0x18')]['message']);}})[_0xbb67('0x19')](function(_0x595438){logger[_0xbb67('0x15')](_0xbb67('0x10'),_0x4a1a65,_0x595438);_0x38f3a9(_0x595438);});});}exports[_0xbb67('0x1a')]=function(_0xb82b81){var _0x15c7ea=this;return new Promise(function(_0xe029fb,_0x4f5015){return db[_0xbb67('0x1b')][_0xbb67('0x1c')](_0xb82b81[_0xbb67('0x1d')],{'raw':_0xb82b81['options']?_0xb82b81[_0xbb67('0x1e')][_0xbb67('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb82b81['options']?_0xb82b81[_0xbb67('0x1e')][_0xbb67('0x20')]||null:null,'attributes':_0xb82b81['options']?_0xb82b81[_0xbb67('0x1e')][_0xbb67('0x21')]||null:null,'limit':_0xb82b81[_0xbb67('0x1e')]?_0xb82b81[_0xbb67('0x1e')]['limit']||null:null})['then'](function(_0x7cef41){logger[_0xbb67('0xf')](_0xbb67('0x1a'),_0xb82b81);logger[_0xbb67('0x12')]('UpdateOpenchannelInteraction',_0xb82b81,JSON['stringify'](_0x7cef41));_0xe029fb(_0x7cef41);})['catch'](function(_0x2bdb48){logger['error'](_0xbb67('0x1a'),_0x2bdb48[_0xbb67('0x17')],_0xb82b81);_0x4f5015(_0x15c7ea[_0xbb67('0x15')](0x1f4,_0x2bdb48['message']));});});};exports[_0xbb67('0x22')]=function(_0x3bae60){return new Promise(function(_0x172217,_0x1efbf1){return db[_0xbb67('0x1b')][_0xbb67('0x23')]({'where':_0x3bae60[_0xbb67('0x1e')]?_0x3bae60[_0xbb67('0x1e')]['where']||null:null})[_0xbb67('0x24')](function(_0x62f0b1){if(_0x62f0b1){return _0x62f0b1[_0xbb67('0x25')](_0x3bae60['body']['ids'],_[_0xbb67('0x26')](_0x3bae60['body'],[_0xbb67('0x27'),'id'])||{});}})['spread'](function(_0x574573){logger[_0xbb67('0xf')](_0xbb67('0x28'),_0x3bae60);logger[_0xbb67('0x12')]('AddTags',_0x3bae60,JSON[_0xbb67('0x14')](_0x574573));_0x172217(_0x574573);})[_0xbb67('0x19')](function(_0x25de9c){logger[_0xbb67('0x15')](_0xbb67('0x28'),_0x25de9c[_0xbb67('0x17')],_0x3bae60);_0x1efbf1(_this[_0xbb67('0x15')](0x1f4,_0x25de9c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 855d7a6..9e9f0c0 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 _0xa31e=['./openchannelInteraction.events','remove','update','emit','register','openchannelInteraction:'];(function(_0x3c41ac,_0x308ca4){var _0x1adedf=function(_0x365638){while(--_0x365638){_0x3c41ac['push'](_0x3c41ac['shift']());}};_0x1adedf(++_0x308ca4);}(_0xa31e,0x132));var _0xea31=function(_0x3bb21a,_0x353b56){_0x3bb21a=_0x3bb21a-0x0;var _0x5f3983=_0xa31e[_0x3bb21a];return _0x5f3983;};'use strict';var OpenchannelInteractionEvents=require(_0xea31('0x0'));var events=['save',_0xea31('0x1'),_0xea31('0x2')];function createListener(_0x2d42be,_0x37a2fa){return function(_0x509734){_0x37a2fa[_0xea31('0x3')](_0x2d42be,_0x509734);};}function removeListener(_0x44f837,_0x22471){return function(){OpenchannelInteractionEvents['removeListener'](_0x44f837,_0x22471);};}exports[_0xea31('0x4')]=function(_0x4ae91a){for(var _0x3e4551=0x0,_0xfa89f4=events['length'];_0x3e4551<_0xfa89f4;_0x3e4551++){var _0x17324b=events[_0x3e4551];var _0x1b0931=createListener(_0xea31('0x5')+_0x17324b,_0x4ae91a);OpenchannelInteractionEvents['on'](_0x17324b,_0x1b0931);}}; \ No newline at end of file +var _0x2e16=['removeListener','length','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x364483,_0x3a090e){var _0x28d61e=function(_0x1edf14){while(--_0x1edf14){_0x364483['push'](_0x364483['shift']());}};_0x28d61e(++_0x3a090e);}(_0x2e16,0x72));var _0x62e1=function(_0xf41d45,_0x54be4d){_0xf41d45=_0xf41d45-0x0;var _0x2bda98=_0x2e16[_0xf41d45];return _0x2bda98;};'use strict';var OpenchannelInteractionEvents=require(_0x62e1('0x0'));var events=[_0x62e1('0x1'),_0x62e1('0x2'),_0x62e1('0x3')];function createListener(_0x100998,_0x28066a){return function(_0xc8aebe){_0x28066a[_0x62e1('0x4')](_0x100998,_0xc8aebe);};}function removeListener(_0x1928a7,_0x2cdc19){return function(){OpenchannelInteractionEvents[_0x62e1('0x5')](_0x1928a7,_0x2cdc19);};}exports['register']=function(_0x2126ce){for(var _0x18e540=0x0,_0x5d5c8b=events[_0x62e1('0x6')];_0x18e540<_0x5d5c8b;_0x18e540++){var _0x49385c=events[_0x18e540];var _0x51d091=createListener('openchannelInteraction:'+_0x49385c,_0x2126ce);OpenchannelInteractionEvents['on'](_0x49385c,_0x51d091);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e705efc..8b34c83 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x17cb36,_0x3cfc3e){var _0x3ae236=function(_0x47530f){while(--_0x47530f){_0x17cb36['push'](_0x17cb36['shift']());}};_0x3ae236(++_0x3cfc3e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _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(_0x90afeb,_0x40759f){var _0x4655c3=function(_0x2130a9){while(--_0x2130a9){_0x90afeb['push'](_0x90afeb['shift']());}};_0x4655c3(++_0x40759f);}(_0xe706,0xa3));var _0x6e70=function(_0x4fe56b,_0x53d094){_0x4fe56b=_0x4fe56b-0x0;var _0x238f05=_0xe706[_0x4fe56b];return _0x238f05;};'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 7d3f68b..ef3d30d 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 _0x6901=['medium','ENUM','out','STRING','sequelize','TEXT'];(function(_0x5aa125,_0x58bf46){var _0x205e85=function(_0x4fc5c4){while(--_0x4fc5c4){_0x5aa125['push'](_0x5aa125['shift']());}};_0x205e85(++_0x58bf46);}(_0x6901,0x100));var _0x1690=function(_0x1ae77d,_0x5710e4){_0x1ae77d=_0x1ae77d-0x0;var _0x48532b=_0x6901[_0x1ae77d];return _0x48532b;};'use strict';var Sequelize=require(_0x1690('0x0'));module['exports']={'body':{'type':Sequelize[_0x1690('0x1')](_0x1690('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1690('0x3')]('in',_0x1690('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x1690('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7269=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x7269,0x76));var _0x9726=function(_0x22d2b7,_0x55647e){_0x22d2b7=_0x22d2b7-0x0;var _0x4644c2=_0x7269[_0x22d2b7];return _0x4644c2;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'body':{'type':Sequelize[_0x9726('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9726('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9726('0x4')]('in','out'),'defaultValue':_0x9726('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9726('0x6')]},'providerName':{'type':Sequelize[_0x9726('0x7')]},'providerResponse':{'type':Sequelize[_0x9726('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 381c185..4492b82 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 _0x99a0=['null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','fullname','email','internal','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','contact','User','rejectmessage','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','destroy','end','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','body','find','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0x17fd88,_0x13ee8c){var _0x34007f=function(_0x2aa6b3){while(--_0x2aa6b3){_0x17fd88['push'](_0x17fd88['shift']());}};_0x34007f(++_0x13ee8c);}(_0x99a0,0x121));var _0x099a=function(_0x191335,_0x2ff78d){_0x191335=_0x191335-0x0;var _0x50882c=_0x99a0[_0x191335];return _0x50882c;};'use strict';var emlformat=require(_0x099a('0x0'));var rimraf=require(_0x099a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x099a('0x2'));var Mustache=require(_0x099a('0x3'));var util=require('util');var path=require(_0x099a('0x4'));var sox=require(_0x099a('0x5'));var csv=require(_0x099a('0x6'));var ejs=require(_0x099a('0x7'));var fs=require('fs');var fs_extra=require(_0x099a('0x8'));var _=require(_0x099a('0x9'));var squel=require('squel');var crypto=require(_0x099a('0xa'));var jsforce=require(_0x099a('0xb'));var deskjs=require(_0x099a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x099a('0xd'));var Papa=require(_0x099a('0xe'));var Redis=require(_0x099a('0xf'));var authService=require(_0x099a('0x10'));var qs=require(_0x099a('0x11'));var as=require(_0x099a('0x12'));var hardwareService=require(_0x099a('0x13'));var logger=require(_0x099a('0x14'))(_0x099a('0x15'));var utils=require(_0x099a('0x16'));var config=require(_0x099a('0x17'));var licenseUtil=require(_0x099a('0x18'));var db=require(_0x099a('0x19'))['db'];config[_0x099a('0x1a')]=_[_0x099a('0x1b')](config['redis'],{'host':_0x099a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x099a('0x1a')]));require('./openchannelMessage.socket')[_0x099a('0x1d')](socket);var jayson=require(_0x099a('0x1e'));var client=jayson[_0x099a('0x1f')][_0x099a('0x20')]({'port':0x232c});var client9002=jayson[_0x099a('0x1f')][_0x099a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5086d8,_0x443eea,_0x88c471,_0x452a34){return new BPromise(function(_0x371af7,_0x5d7b21){var _0x2831a2=_0x452a34||client;return _0x2831a2['request'](_0x5086d8,_0x88c471)[_0x099a('0x21')](function(_0x26bf41){logger[_0x099a('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x443eea,_0x099a('0x23'));logger[_0x099a('0x24')](_0x099a('0x25'),_0x443eea,_0x099a('0x23'),JSON[_0x099a('0x26')](_0x26bf41));if(_0x26bf41['error']){if(_0x26bf41['error'][_0x099a('0x27')]===0x1f4){logger[_0x099a('0x28')](_0x099a('0x29'),_0x443eea,_0x26bf41[_0x099a('0x28')][_0x099a('0x2a')]);return _0x5d7b21(_0x26bf41[_0x099a('0x28')][_0x099a('0x2a')]);}logger[_0x099a('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x443eea,_0x26bf41['error'][_0x099a('0x2a')]);return _0x371af7(_0x26bf41[_0x099a('0x28')][_0x099a('0x2a')]);}else{logger[_0x099a('0x22')](_0x099a('0x29'),_0x443eea,_0x099a('0x23'));_0x371af7(_0x26bf41[_0x099a('0x2b')][_0x099a('0x2a')]);}})[_0x099a('0x2c')](function(_0x42ee18){logger[_0x099a('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x443eea,_0x42ee18);_0x5d7b21(_0x42ee18);});});}function respondWithStatusCode(_0x422c3c,_0x5e316b){_0x5e316b=_0x5e316b||0xcc;return function(_0x2a5417){if(_0x2a5417){return _0x422c3c[_0x099a('0x2d')](_0x5e316b);}return _0x422c3c[_0x099a('0x2e')](_0x5e316b)['end']();};}function respondWithResult(_0x320d29,_0x1101aa){_0x1101aa=_0x1101aa||0xc8;return function(_0x1a51ec){if(_0x1a51ec){return _0x320d29['status'](_0x1101aa)['json'](_0x1a51ec);}};}function respondWithFilteredResult(_0x560fdb,_0x2b1597){return function(_0x1938d0){if(_0x1938d0){var _0x4a1663=typeof _0x2b1597[_0x099a('0x2f')]===_0x099a('0x30')&&typeof _0x2b1597[_0x099a('0x31')]===_0x099a('0x30');var _0x462c0d=_0x1938d0[_0x099a('0x32')];var _0x57d1f3=_0x4a1663?0x0:_0x2b1597[_0x099a('0x2f')];var _0x406232=_0x4a1663?_0x1938d0[_0x099a('0x32')]:_0x2b1597[_0x099a('0x2f')]+_0x2b1597[_0x099a('0x31')];var _0x160b38;if(_0x406232>=_0x462c0d){_0x406232=_0x462c0d;_0x160b38=0xc8;}else{_0x160b38=0xce;}_0x560fdb[_0x099a('0x2e')](_0x160b38);return _0x560fdb[_0x099a('0x33')]('Content-Range',_0x57d1f3+'-'+_0x406232+'/'+_0x462c0d)[_0x099a('0x34')](_0x1938d0);}return null;};}function patchUpdates(_0x33f8a5){return function(_0x151548){try{jsonpatch[_0x099a('0x35')](_0x151548,_0x33f8a5,!![]);}catch(_0x23564a){return BPromise[_0x099a('0x36')](_0x23564a);}return _0x151548['save']();};}function saveUpdates(_0x448a72,_0x47ce62){return function(_0x1751da){if(_0x1751da){return _0x1751da[_0x099a('0x37')](_0x448a72)['then'](function(_0x7a5837){return _0x7a5837;});}return null;};}function removeEntity(_0x122e96,_0x447181){return function(_0x2668de){if(_0x2668de){return _0x2668de[_0x099a('0x38')]()['then'](function(){_0x122e96[_0x099a('0x2e')](0xcc)[_0x099a('0x39')]();});}};}function handleEntityNotFound(_0x4a2fae,_0x2190f3){return function(_0x405b07){if(!_0x405b07){_0x4a2fae[_0x099a('0x2d')](0x194);}return _0x405b07;};}function handleError(_0x58cb69,_0x2bc07d){_0x2bc07d=_0x2bc07d||0x1f4;return function(_0x2f4cca){logger[_0x099a('0x28')](_0x2f4cca[_0x099a('0x3a')]);if(_0x2f4cca[_0x099a('0x3b')]){delete _0x2f4cca[_0x099a('0x3b')];}_0x58cb69['status'](_0x2bc07d)[_0x099a('0x3c')](_0x2f4cca);};}exports['index']=function(_0x2dd733,_0x51931b){var _0x541173={},_0x22c66d={},_0x4375a8={'count':0x0,'rows':[]};var _0x2c420f=_[_0x099a('0x3d')](db[_0x099a('0x3e')][_0x099a('0x3f')],function(_0x1386cb){return{'name':_0x1386cb[_0x099a('0x40')],'type':_0x1386cb[_0x099a('0x41')]['key']};});_0x22c66d[_0x099a('0x42')]=_[_0x099a('0x3d')](_0x2c420f,_0x099a('0x3b'));_0x22c66d[_0x099a('0x43')]=_[_0x099a('0x44')](_0x2dd733[_0x099a('0x43')]);_0x22c66d['filters']=_['intersection'](_0x22c66d[_0x099a('0x42')],_0x22c66d[_0x099a('0x43')]);_0x541173['attributes']=_[_0x099a('0x45')](_0x22c66d['model'],qs[_0x099a('0x46')](_0x2dd733[_0x099a('0x43')][_0x099a('0x46')]));_0x541173[_0x099a('0x47')]=_0x541173[_0x099a('0x47')][_0x099a('0x48')]?_0x541173[_0x099a('0x47')]:_0x22c66d[_0x099a('0x42')];if(!_0x2dd733['query'][_0x099a('0x49')]('nolimit')){_0x541173[_0x099a('0x31')]=qs['limit'](_0x2dd733[_0x099a('0x43')][_0x099a('0x31')]);_0x541173[_0x099a('0x2f')]=qs[_0x099a('0x2f')](_0x2dd733['query'][_0x099a('0x2f')]);}_0x541173[_0x099a('0x4a')]=qs['sort'](_0x2dd733[_0x099a('0x43')]['sort']);_0x541173[_0x099a('0x4b')]=qs[_0x099a('0x4c')](_[_0x099a('0x4d')](_0x2dd733[_0x099a('0x43')],_0x22c66d[_0x099a('0x4c')]),_0x2c420f);if(_0x2dd733[_0x099a('0x43')][_0x099a('0x4e')]){_0x541173[_0x099a('0x4b')]=_['merge'](_0x541173[_0x099a('0x4b')],{'$or':_['map'](_0x2c420f,function(_0x25a545){if(_0x25a545[_0x099a('0x41')]!==_0x099a('0x4f')){var _0x43c76d={};_0x43c76d[_0x25a545[_0x099a('0x3b')]]={'$like':'%'+_0x2dd733[_0x099a('0x43')][_0x099a('0x4e')]+'%'};return _0x43c76d;}})});}_0x541173=_['merge']({},_0x541173,_0x2dd733[_0x099a('0x50')]);var _0x38dcff={'where':_0x541173['where']};return db[_0x099a('0x3e')][_0x099a('0x32')](_0x38dcff)[_0x099a('0x21')](function(_0x47dafb){_0x4375a8[_0x099a('0x32')]=_0x47dafb;if(_0x2dd733[_0x099a('0x43')][_0x099a('0x51')]){_0x541173[_0x099a('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x099a('0x53')](_0x541173);})['then'](function(_0x20dcc8){_0x4375a8[_0x099a('0x54')]=_0x20dcc8;return _0x4375a8;})['then'](respondWithFilteredResult(_0x51931b,_0x541173))['catch'](handleError(_0x51931b,null));};exports[_0x099a('0x55')]=function(_0x248e03,_0x4245b2){var _0x5d2b03={'raw':!![],'where':{'id':_0x248e03[_0x099a('0x56')]['id']}},_0x3888a9={};_0x3888a9[_0x099a('0x42')]=_['keys'](db[_0x099a('0x3e')]['rawAttributes']);_0x3888a9['query']=_[_0x099a('0x44')](_0x248e03['query']);_0x3888a9['filters']=_[_0x099a('0x45')](_0x3888a9[_0x099a('0x42')],_0x3888a9['query']);_0x5d2b03[_0x099a('0x47')]=_[_0x099a('0x45')](_0x3888a9[_0x099a('0x42')],qs['fields'](_0x248e03[_0x099a('0x43')][_0x099a('0x46')]));_0x5d2b03[_0x099a('0x47')]=_0x5d2b03['attributes'][_0x099a('0x48')]?_0x5d2b03[_0x099a('0x47')]:_0x3888a9[_0x099a('0x42')];if(_0x248e03[_0x099a('0x43')][_0x099a('0x51')]){_0x5d2b03[_0x099a('0x52')]=[{'all':!![]}];}_0x5d2b03=_[_0x099a('0x57')]({},_0x5d2b03,_0x248e03[_0x099a('0x50')]);return db[_0x099a('0x3e')]['find'](_0x5d2b03)[_0x099a('0x21')](handleEntityNotFound(_0x4245b2,null))[_0x099a('0x21')](respondWithResult(_0x4245b2,null))[_0x099a('0x2c')](handleError(_0x4245b2,null));};exports['create']=function(_0x34eaa8,_0x53ca57){return db[_0x099a('0x3e')]['create'](_0x34eaa8[_0x099a('0x58')],{})['then'](respondWithResult(_0x53ca57,0xc9))[_0x099a('0x2c')](handleError(_0x53ca57,null));};exports['update']=function(_0x17a8f2,_0x1a762f){if(_0x17a8f2[_0x099a('0x58')]['id']){delete _0x17a8f2[_0x099a('0x58')]['id'];}return db[_0x099a('0x3e')][_0x099a('0x59')]({'where':{'id':_0x17a8f2[_0x099a('0x56')]['id']}})[_0x099a('0x21')](handleEntityNotFound(_0x1a762f,null))['then'](saveUpdates(_0x17a8f2[_0x099a('0x58')],null))[_0x099a('0x21')](respondWithResult(_0x1a762f,null))[_0x099a('0x2c')](handleError(_0x1a762f,null));};exports[_0x099a('0x38')]=function(_0x1d91a8,_0x127b58){return db[_0x099a('0x3e')][_0x099a('0x59')]({'where':{'id':_0x1d91a8[_0x099a('0x56')]['id']}})['then'](handleEntityNotFound(_0x127b58,null))[_0x099a('0x21')](removeEntity(_0x127b58,null))[_0x099a('0x2c')](handleError(_0x127b58,null));};exports[_0x099a('0x5a')]=function(_0x58fa48,_0x4a3d11){return db['OpenchannelMessage'][_0x099a('0x5a')]()[_0x099a('0x21')](respondWithResult(_0x4a3d11,null))['catch'](handleError(_0x4a3d11,null));};var interaction_log=require('../../config/logger')(_0x099a('0x5b'));exports['accept']=function(_0x222173,_0x5e34af,_0x1caa4f){var _0x14fbff={'agent':{},'channel':_0x099a('0x5c')};if(_0x222173[_0x099a('0x58')]['id']){delete _0x222173['body']['id'];}_0x222173[_0x099a('0x58')][_0x099a('0x5d')]=!![];_0x222173[_0x099a('0x58')][_0x099a('0x5e')]=moment()[_0x099a('0x5f')](_0x099a('0x60'));_0x222173['body']['UserId']=_0x222173[_0x099a('0x58')][_0x099a('0x61')]||_0x222173[_0x099a('0x62')]['id'];_0x14fbff[_0x099a('0x63')]['id']=_0x222173['body'][_0x099a('0x61')];return db[_0x099a('0x3e')]['find']({'where':{'id':_0x222173[_0x099a('0x56')]['id'],'UserId':null}})[_0x099a('0x21')](handleEntityNotFound(_0x5e34af,null))[_0x099a('0x21')](saveUpdates(_0x222173[_0x099a('0x58')],null))[_0x099a('0x21')](function(_0x570c82){if(_0x570c82){_0x14fbff[_0x099a('0x2a')]=_0x570c82[_0x099a('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x099a('0x59')]({'where':{'id':_0x570c82[_0x099a('0x65')]}});}return null;})[_0x099a('0x21')](handleEntityNotFound(_0x5e34af,null))[_0x099a('0x21')](function(_0x336e3f){if(_0x336e3f){return _0x336e3f[_0x099a('0x37')]({'UserId':_0x222173[_0x099a('0x58')]['UserId'],'read1stAt':_[_0x099a('0x66')](_0x336e3f[_0x099a('0x67')])?moment()[_0x099a('0x5f')](_0x099a('0x60')):undefined});}return null;})[_0x099a('0x21')](function(_0x3c8380){if(_0x3c8380){_0x14fbff[_0x099a('0x68')]=_0x3c8380[_0x099a('0x64')]({'plain':!![]});interaction_log[_0x099a('0x22')](_0x099a('0x69'),_0x222173[_0x099a('0x62')]['id'],_0x222173[_0x099a('0x62')][_0x099a('0x3b')],_0x222173['user'][_0x099a('0x6a')],_0x14fbff[_0x099a('0x68')]['id'],_0x222173['body']?JSON['stringify'](_0x222173[_0x099a('0x58')]):_0x099a('0x6b'));return respondWithRpcPromise(_0x099a('0x6c'),_0x099a('0x6d'),_0x14fbff);}return null;})[_0x099a('0x21')](function(_0xd91e49){var _0x1c9546='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd91e49[_0x099a('0x2a')][_0x099a('0x6e')];return db[_0x099a('0x6f')][_0x099a('0x43')](_0x1c9546,{'type':db[_0x099a('0x70')]['QueryTypes'][_0x099a('0x71')],'raw':!![]})[_0x099a('0x21')](function(_0x158892){return _0x158892;});})[_0x099a('0x21')](function(_0x669d19){if(_0x669d19){_0x14fbff[_0x099a('0x2a')]['contact']=_0x669d19[0x0];if(!_0x222173[_0x099a('0x58')][_0x099a('0x61')])return;return db['User'][_0x099a('0x59')]({'where':{'id':_0x222173['body']['UserId'],'role':_0x099a('0x63')},'attributes':['id',_0x099a('0x3b'),_0x099a('0x72'),_0x099a('0x73'),_0x099a('0x74')],'raw':!![]});}return null;})[_0x099a('0x21')](function(_0x13324b){if(!_0x13324b)return null;_0x14fbff['message'][_0x099a('0x63')]=_0x13324b;return _0x14fbff;})[_0x099a('0x21')](function(_0xc81637){if(_0xc81637){if(_0x222173[_0x099a('0x58')]['manual']){_0x14fbff[_0x099a('0x2a')][_0x099a('0x75')]=util[_0x099a('0x5f')](_0x099a('0x76'),_0x222173['user'][_0x099a('0x3b')]);_0x14fbff[_0x099a('0x2a')][_0x099a('0x77')]=_0x14fbff['channel'];_0x14fbff[_0x099a('0x2a')]['motionChannel']=_0x14fbff[_0x099a('0x77')];_0x14fbff['message'][_0x099a('0x78')]=_0x099a('0x79');return respondWithRpcPromise(_0x099a('0x7a'),_0x099a('0x7a'),{'event':_0x099a('0x7b'),'message':_0x14fbff[_0x099a('0x2a')]},client9002)[_0x099a('0x21')](function(){return _0x14fbff;});}return _0x14fbff;}return null;})[_0x099a('0x21')](respondWithResult(_0x5e34af,null))[_0x099a('0x2c')](handleError(_0x5e34af,null));};var interaction_log=require(_0x099a('0x14'))('openchannel-interactions');exports[_0x099a('0x36')]=function(_0x7ab658,_0x3f8085,_0x36aeb0){var _0x50b126={'agent':{},'channel':'openchannel'};if(_0x7ab658[_0x099a('0x58')]['id']){delete _0x7ab658[_0x099a('0x58')]['id'];}_0x7ab658['body']['UserId']=_0x7ab658[_0x099a('0x58')]['UserId']||_0x7ab658[_0x099a('0x62')]['id'];_0x50b126[_0x099a('0x63')]['id']=_0x7ab658[_0x099a('0x58')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x7ab658[_0x099a('0x56')]['id'],'UserId':null}})[_0x099a('0x21')](handleEntityNotFound(_0x3f8085,null))['then'](function(_0x393cff){if(_0x393cff){_0x50b126[_0x099a('0x2a')]=_0x393cff['get']({'plain':!![]});return db[_0x099a('0x7c')][_0x099a('0x59')]({'where':{'id':_0x393cff[_0x099a('0x65')]}});}return null;})[_0x099a('0x21')](handleEntityNotFound(_0x3f8085,null))[_0x099a('0x21')](function(_0x36fe30){if(_0x36fe30){_0x50b126[_0x099a('0x68')]=_0x36fe30[_0x099a('0x64')]({'plain':!![]});interaction_log['info'](_0x099a('0x7d'),_0x7ab658['user']['id'],_0x7ab658['user'][_0x099a('0x3b')],_0x7ab658['user'][_0x099a('0x6a')],_0x50b126['interaction']['id'],_0x7ab658[_0x099a('0x58')]?JSON[_0x099a('0x26')](_0x7ab658[_0x099a('0x58')]):_0x099a('0x6b'));return respondWithRpcPromise(_0x099a('0x7e'),_0x099a('0x7f'),_0x50b126);}return null;})[_0x099a('0x21')](function(_0x579bb3){var _0x61e2a7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x579bb3[_0x099a('0x2a')][_0x099a('0x6e')];return db[_0x099a('0x6f')]['query'](_0x61e2a7,{'type':db[_0x099a('0x70')][_0x099a('0x80')][_0x099a('0x71')],'raw':!![]})[_0x099a('0x21')](function(_0x46e7ce){return _0x46e7ce;});})[_0x099a('0x21')](function(_0x3a832f){if(_0x3a832f){_0x50b126[_0x099a('0x2a')][_0x099a('0x81')]=_0x3a832f[0x0];if(!_0x7ab658[_0x099a('0x58')][_0x099a('0x61')])return;return db[_0x099a('0x82')][_0x099a('0x59')]({'where':{'id':_0x7ab658[_0x099a('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x099a('0x3b'),_0x099a('0x72'),_0x099a('0x73'),_0x099a('0x74')],'raw':!![]});}return null;})['then'](function(_0x5d83e2){if(!_0x5d83e2)return null;_0x50b126[_0x099a('0x2a')][_0x099a('0x63')]=_0x5d83e2;return _0x50b126;})[_0x099a('0x21')](function(_0x5bb868){if(_0x5bb868){_0x5bb868[_0x099a('0x2a')][_0x099a('0x75')]=util[_0x099a('0x5f')](_0x099a('0x76'),_0x7ab658[_0x099a('0x62')][_0x099a('0x3b')]);_0x5bb868[_0x099a('0x2a')][_0x099a('0x77')]=_0x50b126[_0x099a('0x77')];_0x5bb868[_0x099a('0x2a')]['motionChannel']=_0x50b126['channel'];_0x5bb868[_0x099a('0x2a')][_0x099a('0x78')]=_0x099a('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0x099a('0x83'),'message':_0x5bb868[_0x099a('0x2a')]},client9002);return _0x50b126;}return null;})[_0x099a('0x21')](respondWithResult(_0x3f8085,null))[_0x099a('0x2c')](handleError(_0x3f8085,null));}; \ No newline at end of file +var _0xef9e=['jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','offset','limit','count','set','reject','save','then','sendStatus','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','email','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','fullname','internal','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xef9e,0x1ef));var _0xeef9=function(_0x40644d,_0x4ed061){_0x40644d=_0x40644d-0x0;var _0x5630aa=_0xef9e[_0x40644d];return _0x5630aa;};'use strict';var emlformat=require(_0xeef9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeef9('0x1'));var jsonpatch=require(_0xeef9('0x2'));var rp=require(_0xeef9('0x3'));var moment=require(_0xeef9('0x4'));var BPromise=require(_0xeef9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeef9('0x6'));var sox=require(_0xeef9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeef9('0x8'));var _=require(_0xeef9('0x9'));var squel=require(_0xeef9('0xa'));var crypto=require('crypto');var jsforce=require(_0xeef9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeef9('0xc'));var querystring=require(_0xeef9('0xd'));var Papa=require(_0xeef9('0xe'));var Redis=require(_0xeef9('0xf'));var authService=require(_0xeef9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeef9('0x11'));var hardwareService=require(_0xeef9('0x12'));var logger=require(_0xeef9('0x13'))(_0xeef9('0x14'));var utils=require(_0xeef9('0x15'));var config=require(_0xeef9('0x16'));var licenseUtil=require(_0xeef9('0x17'));var db=require(_0xeef9('0x18'))['db'];config[_0xeef9('0x19')]=_['defaults'](config[_0xeef9('0x19')],{'host':_0xeef9('0x1a'),'port':0x18eb});var socket=require(_0xeef9('0x1b'))(new Redis(config[_0xeef9('0x19')]));require('./openchannelMessage.socket')[_0xeef9('0x1c')](socket);var jayson=require(_0xeef9('0x1d'));var client=jayson[_0xeef9('0x1e')][_0xeef9('0x1f')]({'port':0x232c});var client9002=jayson[_0xeef9('0x1e')][_0xeef9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5492f5,_0x112657,_0x3b8b21,_0x14cb2a){return new BPromise(function(_0xe2d73,_0x55e855){var _0x40458b=_0x14cb2a||client;return _0x40458b[_0xeef9('0x20')](_0x5492f5,_0x3b8b21)['then'](function(_0x5668b7){logger[_0xeef9('0x21')](_0xeef9('0x22'),_0x112657,_0xeef9('0x23'));logger['debug'](_0xeef9('0x24'),_0x112657,'request\x20sent',JSON[_0xeef9('0x25')](_0x5668b7));if(_0x5668b7[_0xeef9('0x26')]){if(_0x5668b7[_0xeef9('0x26')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x112657,_0x5668b7['error']['message']);return _0x55e855(_0x5668b7[_0xeef9('0x26')][_0xeef9('0x27')]);}logger[_0xeef9('0x26')](_0xeef9('0x22'),_0x112657,_0x5668b7['error'][_0xeef9('0x27')]);return _0xe2d73(_0x5668b7[_0xeef9('0x26')][_0xeef9('0x27')]);}else{logger[_0xeef9('0x21')](_0xeef9('0x22'),_0x112657,_0xeef9('0x23'));_0xe2d73(_0x5668b7[_0xeef9('0x28')]['message']);}})['catch'](function(_0x59cbc0){logger[_0xeef9('0x26')](_0xeef9('0x22'),_0x112657,_0x59cbc0);_0x55e855(_0x59cbc0);});});}function respondWithStatusCode(_0x3ccf90,_0x10be35){_0x10be35=_0x10be35||0xcc;return function(_0x30c876){if(_0x30c876){return _0x3ccf90['sendStatus'](_0x10be35);}return _0x3ccf90[_0xeef9('0x29')](_0x10be35)[_0xeef9('0x2a')]();};}function respondWithResult(_0x186286,_0x3d164c){_0x3d164c=_0x3d164c||0xc8;return function(_0x24422c){if(_0x24422c){return _0x186286['status'](_0x3d164c)[_0xeef9('0x2b')](_0x24422c);}};}function respondWithFilteredResult(_0x31f504,_0x427d3e){return function(_0x44501f){if(_0x44501f){var _0x4b4e61=typeof _0x427d3e[_0xeef9('0x2c')]==='undefined'&&typeof _0x427d3e[_0xeef9('0x2d')]==='undefined';var _0x1d76f8=_0x44501f[_0xeef9('0x2e')];var _0x3a4666=_0x4b4e61?0x0:_0x427d3e[_0xeef9('0x2c')];var _0x176671=_0x4b4e61?_0x44501f[_0xeef9('0x2e')]:_0x427d3e[_0xeef9('0x2c')]+_0x427d3e['limit'];var _0x1306ab;if(_0x176671>=_0x1d76f8){_0x176671=_0x1d76f8;_0x1306ab=0xc8;}else{_0x1306ab=0xce;}_0x31f504[_0xeef9('0x29')](_0x1306ab);return _0x31f504[_0xeef9('0x2f')]('Content-Range',_0x3a4666+'-'+_0x176671+'/'+_0x1d76f8)[_0xeef9('0x2b')](_0x44501f);}return null;};}function patchUpdates(_0x3011db){return function(_0x826c26){try{jsonpatch['apply'](_0x826c26,_0x3011db,!![]);}catch(_0x5e8fff){return BPromise[_0xeef9('0x30')](_0x5e8fff);}return _0x826c26[_0xeef9('0x31')]();};}function saveUpdates(_0x29295c,_0x1611cf){return function(_0x2fcfe9){if(_0x2fcfe9){return _0x2fcfe9['update'](_0x29295c)[_0xeef9('0x32')](function(_0x5b43cb){return _0x5b43cb;});}return null;};}function removeEntity(_0x4a6f08,_0x5e0512){return function(_0x4a3556){if(_0x4a3556){return _0x4a3556['destroy']()[_0xeef9('0x32')](function(){_0x4a6f08[_0xeef9('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51b426,_0x10b5cd){return function(_0x491754){if(!_0x491754){_0x51b426[_0xeef9('0x33')](0x194);}return _0x491754;};}function handleError(_0x2cc463,_0x5d9539){_0x5d9539=_0x5d9539||0x1f4;return function(_0x1325a9){logger[_0xeef9('0x26')](_0x1325a9[_0xeef9('0x34')]);if(_0x1325a9[_0xeef9('0x35')]){delete _0x1325a9[_0xeef9('0x35')];}_0x2cc463[_0xeef9('0x29')](_0x5d9539)[_0xeef9('0x36')](_0x1325a9);};}exports['index']=function(_0x217670,_0x406ad3){var _0x904bbc={},_0x1917a2={},_0x8bb09b={'count':0x0,'rows':[]};var _0x4e3a56=_[_0xeef9('0x37')](db[_0xeef9('0x38')][_0xeef9('0x39')],function(_0x188c40){return{'name':_0x188c40[_0xeef9('0x3a')],'type':_0x188c40[_0xeef9('0x3b')][_0xeef9('0x3c')]};});_0x1917a2[_0xeef9('0x3d')]=_[_0xeef9('0x37')](_0x4e3a56,'name');_0x1917a2[_0xeef9('0x3e')]=_[_0xeef9('0x3f')](_0x217670[_0xeef9('0x3e')]);_0x1917a2[_0xeef9('0x40')]=_[_0xeef9('0x41')](_0x1917a2[_0xeef9('0x3d')],_0x1917a2[_0xeef9('0x3e')]);_0x904bbc[_0xeef9('0x42')]=_[_0xeef9('0x41')](_0x1917a2['model'],qs[_0xeef9('0x43')](_0x217670['query']['fields']));_0x904bbc[_0xeef9('0x42')]=_0x904bbc[_0xeef9('0x42')][_0xeef9('0x44')]?_0x904bbc[_0xeef9('0x42')]:_0x1917a2['model'];if(!_0x217670['query'][_0xeef9('0x45')](_0xeef9('0x46'))){_0x904bbc[_0xeef9('0x2d')]=qs[_0xeef9('0x2d')](_0x217670['query'][_0xeef9('0x2d')]);_0x904bbc[_0xeef9('0x2c')]=qs['offset'](_0x217670[_0xeef9('0x3e')]['offset']);}_0x904bbc[_0xeef9('0x47')]=qs['sort'](_0x217670['query'][_0xeef9('0x48')]);_0x904bbc[_0xeef9('0x49')]=qs[_0xeef9('0x40')](_[_0xeef9('0x4a')](_0x217670[_0xeef9('0x3e')],_0x1917a2[_0xeef9('0x40')]),_0x4e3a56);if(_0x217670[_0xeef9('0x3e')]['filter']){_0x904bbc[_0xeef9('0x49')]=_[_0xeef9('0x4b')](_0x904bbc['where'],{'$or':_[_0xeef9('0x37')](_0x4e3a56,function(_0x1bd409){if(_0x1bd409['type']!=='VIRTUAL'){var _0x25f682={};_0x25f682[_0x1bd409[_0xeef9('0x35')]]={'$like':'%'+_0x217670[_0xeef9('0x3e')][_0xeef9('0x4c')]+'%'};return _0x25f682;}})});}_0x904bbc=_[_0xeef9('0x4b')]({},_0x904bbc,_0x217670[_0xeef9('0x4d')]);var _0x19d57c={'where':_0x904bbc['where']};return db[_0xeef9('0x38')][_0xeef9('0x2e')](_0x19d57c)[_0xeef9('0x32')](function(_0xc750c3){_0x8bb09b[_0xeef9('0x2e')]=_0xc750c3;if(_0x217670[_0xeef9('0x3e')][_0xeef9('0x4e')]){_0x904bbc[_0xeef9('0x4f')]=[{'all':!![]}];}return db[_0xeef9('0x38')][_0xeef9('0x50')](_0x904bbc);})['then'](function(_0x12dbff){_0x8bb09b[_0xeef9('0x51')]=_0x12dbff;return _0x8bb09b;})['then'](respondWithFilteredResult(_0x406ad3,_0x904bbc))[_0xeef9('0x52')](handleError(_0x406ad3,null));};exports[_0xeef9('0x53')]=function(_0x68da17,_0x3294a5){var _0x4321cf={'raw':!![],'where':{'id':_0x68da17[_0xeef9('0x54')]['id']}},_0x23448f={};_0x23448f['model']=_[_0xeef9('0x3f')](db['OpenchannelMessage'][_0xeef9('0x39')]);_0x23448f[_0xeef9('0x3e')]=_[_0xeef9('0x3f')](_0x68da17[_0xeef9('0x3e')]);_0x23448f[_0xeef9('0x40')]=_['intersection'](_0x23448f['model'],_0x23448f['query']);_0x4321cf[_0xeef9('0x42')]=_[_0xeef9('0x41')](_0x23448f[_0xeef9('0x3d')],qs[_0xeef9('0x43')](_0x68da17[_0xeef9('0x3e')][_0xeef9('0x43')]));_0x4321cf['attributes']=_0x4321cf[_0xeef9('0x42')][_0xeef9('0x44')]?_0x4321cf[_0xeef9('0x42')]:_0x23448f[_0xeef9('0x3d')];if(_0x68da17[_0xeef9('0x3e')][_0xeef9('0x4e')]){_0x4321cf[_0xeef9('0x4f')]=[{'all':!![]}];}_0x4321cf=_[_0xeef9('0x4b')]({},_0x4321cf,_0x68da17[_0xeef9('0x4d')]);return db[_0xeef9('0x38')][_0xeef9('0x55')](_0x4321cf)[_0xeef9('0x32')](handleEntityNotFound(_0x3294a5,null))[_0xeef9('0x32')](respondWithResult(_0x3294a5,null))['catch'](handleError(_0x3294a5,null));};exports[_0xeef9('0x56')]=function(_0x3e6ad5,_0x146fba){return db[_0xeef9('0x38')][_0xeef9('0x56')](_0x3e6ad5[_0xeef9('0x57')],{})[_0xeef9('0x32')](respondWithResult(_0x146fba,0xc9))[_0xeef9('0x52')](handleError(_0x146fba,null));};exports[_0xeef9('0x58')]=function(_0x3340c1,_0x5a101c){if(_0x3340c1[_0xeef9('0x57')]['id']){delete _0x3340c1[_0xeef9('0x57')]['id'];}return db[_0xeef9('0x38')][_0xeef9('0x55')]({'where':{'id':_0x3340c1[_0xeef9('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a101c,null))[_0xeef9('0x32')](saveUpdates(_0x3340c1[_0xeef9('0x57')],null))['then'](respondWithResult(_0x5a101c,null))[_0xeef9('0x52')](handleError(_0x5a101c,null));};exports['destroy']=function(_0x3da558,_0x33d7a9){return db[_0xeef9('0x38')]['find']({'where':{'id':_0x3da558[_0xeef9('0x54')]['id']}})[_0xeef9('0x32')](handleEntityNotFound(_0x33d7a9,null))['then'](removeEntity(_0x33d7a9,null))['catch'](handleError(_0x33d7a9,null));};exports['describe']=function(_0x12f3c9,_0xeec2de){return db[_0xeef9('0x38')][_0xeef9('0x59')]()[_0xeef9('0x32')](respondWithResult(_0xeec2de,null))[_0xeef9('0x52')](handleError(_0xeec2de,null));};var interaction_log=require(_0xeef9('0x13'))('openchannel-interactions');exports[_0xeef9('0x5a')]=function(_0x473cb1,_0x43e377,_0x4b3230){var _0x25b823={'agent':{},'channel':'openchannel'};if(_0x473cb1['body']['id']){delete _0x473cb1[_0xeef9('0x57')]['id'];}_0x473cb1[_0xeef9('0x57')][_0xeef9('0x5b')]=!![];_0x473cb1[_0xeef9('0x57')][_0xeef9('0x5c')]=moment()['format'](_0xeef9('0x5d'));_0x473cb1[_0xeef9('0x57')]['UserId']=_0x473cb1[_0xeef9('0x57')][_0xeef9('0x5e')]||_0x473cb1[_0xeef9('0x5f')]['id'];_0x25b823[_0xeef9('0x60')]['id']=_0x473cb1[_0xeef9('0x57')][_0xeef9('0x5e')];return db[_0xeef9('0x38')]['find']({'where':{'id':_0x473cb1[_0xeef9('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x43e377,null))[_0xeef9('0x32')](saveUpdates(_0x473cb1[_0xeef9('0x57')],null))[_0xeef9('0x32')](function(_0x2e5a91){if(_0x2e5a91){_0x25b823[_0xeef9('0x27')]=_0x2e5a91[_0xeef9('0x61')]({'plain':!![]});return db[_0xeef9('0x62')][_0xeef9('0x55')]({'where':{'id':_0x2e5a91[_0xeef9('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x43e377,null))['then'](function(_0x31b03a){if(_0x31b03a){return _0x31b03a[_0xeef9('0x58')]({'UserId':_0x473cb1[_0xeef9('0x57')][_0xeef9('0x5e')],'read1stAt':_['isNil'](_0x31b03a[_0xeef9('0x64')])?moment()['format'](_0xeef9('0x5d')):undefined});}return null;})[_0xeef9('0x32')](function(_0x3ca6cc){if(_0x3ca6cc){_0x25b823[_0xeef9('0x65')]=_0x3ca6cc[_0xeef9('0x61')]({'plain':!![]});interaction_log['info'](_0xeef9('0x66'),_0x473cb1['user']['id'],_0x473cb1[_0xeef9('0x5f')][_0xeef9('0x35')],_0x473cb1['user'][_0xeef9('0x67')],_0x25b823[_0xeef9('0x65')]['id'],_0x473cb1['body']?JSON[_0xeef9('0x25')](_0x473cb1[_0xeef9('0x57')]):_0xeef9('0x68'));return respondWithRpcPromise(_0xeef9('0x69'),_0xeef9('0x6a'),_0x25b823);}return null;})['then'](function(_0x5c24f2){var _0x320452='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c24f2[_0xeef9('0x27')][_0xeef9('0x6b')];return db[_0xeef9('0x6c')][_0xeef9('0x3e')](_0x320452,{'type':db[_0xeef9('0x6d')][_0xeef9('0x6e')][_0xeef9('0x6f')],'raw':!![]})['then'](function(_0xfb422){return _0xfb422;});})['then'](function(_0x31bbb7){if(_0x31bbb7){_0x25b823['message']['contact']=_0x31bbb7[0x0];if(!_0x473cb1[_0xeef9('0x57')]['UserId'])return;return db['User'][_0xeef9('0x55')]({'where':{'id':_0x473cb1[_0xeef9('0x57')][_0xeef9('0x5e')],'role':'agent'},'attributes':['id',_0xeef9('0x35'),'fullname',_0xeef9('0x70'),'internal'],'raw':!![]});}return null;})[_0xeef9('0x32')](function(_0x152b71){if(!_0x152b71)return null;_0x25b823[_0xeef9('0x27')]['agent']=_0x152b71;return _0x25b823;})['then'](function(_0xaa0315){if(_0xaa0315){if(_0x473cb1[_0xeef9('0x57')][_0xeef9('0x71')]){_0x25b823[_0xeef9('0x27')][_0xeef9('0x72')]=util[_0xeef9('0x73')](_0xeef9('0x74'),_0x473cb1[_0xeef9('0x5f')][_0xeef9('0x35')]);_0x25b823[_0xeef9('0x27')][_0xeef9('0x75')]=_0x25b823['channel'];_0x25b823[_0xeef9('0x27')][_0xeef9('0x76')]=_0x25b823[_0xeef9('0x75')];_0x25b823['message'][_0xeef9('0x77')]=_0xeef9('0x5a');return respondWithRpcPromise('EventManager',_0xeef9('0x78'),{'event':_0xeef9('0x79'),'message':_0x25b823[_0xeef9('0x27')]},client9002)[_0xeef9('0x32')](function(){return _0x25b823;});}return _0x25b823;}return null;})[_0xeef9('0x32')](respondWithResult(_0x43e377,null))[_0xeef9('0x52')](handleError(_0x43e377,null));};var interaction_log=require('../../config/logger')(_0xeef9('0x7a'));exports['reject']=function(_0x15404f,_0x5bc42e,_0x266ee7){var _0x25ab0f={'agent':{},'channel':_0xeef9('0x7b')};if(_0x15404f[_0xeef9('0x57')]['id']){delete _0x15404f[_0xeef9('0x57')]['id'];}_0x15404f[_0xeef9('0x57')][_0xeef9('0x5e')]=_0x15404f['body']['UserId']||_0x15404f[_0xeef9('0x5f')]['id'];_0x25ab0f['agent']['id']=_0x15404f['body'][_0xeef9('0x5e')];return db[_0xeef9('0x38')][_0xeef9('0x55')]({'where':{'id':_0x15404f[_0xeef9('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5bc42e,null))[_0xeef9('0x32')](function(_0x20b438){if(_0x20b438){_0x25ab0f['message']=_0x20b438[_0xeef9('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0xeef9('0x55')]({'where':{'id':_0x20b438['OpenchannelInteractionId']}});}return null;})[_0xeef9('0x32')](handleEntityNotFound(_0x5bc42e,null))[_0xeef9('0x32')](function(_0x3b056a){if(_0x3b056a){_0x25ab0f[_0xeef9('0x65')]=_0x3b056a[_0xeef9('0x61')]({'plain':!![]});interaction_log[_0xeef9('0x21')](_0xeef9('0x7c'),_0x15404f[_0xeef9('0x5f')]['id'],_0x15404f[_0xeef9('0x5f')][_0xeef9('0x35')],_0x15404f[_0xeef9('0x5f')][_0xeef9('0x67')],_0x25ab0f[_0xeef9('0x65')]['id'],_0x15404f[_0xeef9('0x57')]?JSON[_0xeef9('0x25')](_0x15404f['body']):'null');return respondWithRpcPromise(_0xeef9('0x7d'),_0xeef9('0x7e'),_0x25ab0f);}return null;})[_0xeef9('0x32')](function(_0xdb2803){var _0x15befb=_0xeef9('0x7f')+_0xdb2803[_0xeef9('0x27')][_0xeef9('0x6b')];return db[_0xeef9('0x6c')]['query'](_0x15befb,{'type':db[_0xeef9('0x6d')]['QueryTypes'][_0xeef9('0x6f')],'raw':!![]})[_0xeef9('0x32')](function(_0x384202){return _0x384202;});})[_0xeef9('0x32')](function(_0x336156){if(_0x336156){_0x25ab0f[_0xeef9('0x27')]['contact']=_0x336156[0x0];if(!_0x15404f[_0xeef9('0x57')]['UserId'])return;return db[_0xeef9('0x80')][_0xeef9('0x55')]({'where':{'id':_0x15404f[_0xeef9('0x57')][_0xeef9('0x5e')],'role':_0xeef9('0x60')},'attributes':['id',_0xeef9('0x35'),_0xeef9('0x81'),_0xeef9('0x70'),_0xeef9('0x82')],'raw':!![]});}return null;})[_0xeef9('0x32')](function(_0x34602a){if(!_0x34602a)return null;_0x25ab0f['message'][_0xeef9('0x60')]=_0x34602a;return _0x25ab0f;})[_0xeef9('0x32')](function(_0x43e253){if(_0x43e253){_0x43e253[_0xeef9('0x27')][_0xeef9('0x72')]=util['format'](_0xeef9('0x74'),_0x15404f[_0xeef9('0x5f')]['name']);_0x43e253[_0xeef9('0x27')][_0xeef9('0x75')]=_0x25ab0f[_0xeef9('0x75')];_0x43e253['message']['motionChannel']=_0x25ab0f['channel'];_0x43e253[_0xeef9('0x27')][_0xeef9('0x77')]=_0xeef9('0x30');respondWithRpcPromise('EventManager',_0xeef9('0x78'),{'event':'rejectmessage','message':_0x43e253[_0xeef9('0x27')]},client9002);return _0x25ab0f;}return null;})[_0xeef9('0x32')](respondWithResult(_0x5bc42e,null))[_0xeef9('0x52')](handleError(_0x5bc42e,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 84b5642..3898db0 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 _0xa7d1=['hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','hasOwnProperty'];(function(_0x2edbea,_0xed922c){var _0x40a98b=function(_0x59bd80){while(--_0x59bd80){_0x2edbea['push'](_0x2edbea['shift']());}};_0x40a98b(++_0xed922c);}(_0xa7d1,0x1d6));var _0x1a7d=function(_0x3b9570,_0x4ead31){_0x3b9570=_0x3b9570-0x0;var _0x28acdd=_0xa7d1[_0x3b9570];return _0x28acdd;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x1a7d('0x0'))['db'][_0x1a7d('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1a7d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xfffee6){return function(_0x55e7a2,_0x513cc5,_0x457238){OpenchannelMessageEvents['emit'](_0xfffee6+':'+_0x55e7a2['id'],_0x55e7a2);OpenchannelMessageEvents['emit'](_0xfffee6,_0x55e7a2);_0x457238(null);};}for(var e in events){if(events[_0x1a7d('0x3')](e)){var event=events[e];OpenchannelMessage[_0x1a7d('0x4')](e,emitEvent(event));}}module[_0x1a7d('0x5')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x4ef6=['save','update','emit','events','OpenchannelMessage','setMaxListeners'];(function(_0xdb663c,_0x2a32c1){var _0x10afec=function(_0x8099ce){while(--_0x8099ce){_0xdb663c['push'](_0xdb663c['shift']());}};_0x10afec(++_0x2a32c1);}(_0x4ef6,0x75));var _0x64ef=function(_0x3d61c6,_0x4571e6){_0x3d61c6=_0x3d61c6-0x0;var _0x47e0df=_0x4ef6[_0x3d61c6];return _0x47e0df;};'use strict';var EventEmitter=require(_0x64ef('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x64ef('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x64ef('0x2')](0x0);var events={'afterCreate':_0x64ef('0x3'),'afterUpdate':_0x64ef('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd3b23c){return function(_0x58645d,_0x468d82,_0x5b1964){OpenchannelMessageEvents[_0x64ef('0x5')](_0xd3b23c+':'+_0x58645d['id'],_0x58645d);OpenchannelMessageEvents['emit'](_0xd3b23c,_0x58645d);_0x5b1964(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index cf79054..3b2d0bb 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 _0xb62e=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','update','catch','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','Interactions','GET','POST','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect'];(function(_0x284bc6,_0x342301){var _0x9cf08e=function(_0x46160c){while(--_0x46160c){_0x284bc6['push'](_0x284bc6['shift']());}};_0x9cf08e(++_0x342301);}(_0xb62e,0x1de));var _0xeb62=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb62e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('OpenchannelMessage',attributes,{'tableName':_0xeb62('0xb'),'paranoid':![],'indexes':[{'name':_0xeb62('0xc'),'fields':[_0xeb62('0xd')],'type':_0xeb62('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4967c0,_0x5cdef3,_0x4693c9){var _0x40584b=_0x3ec879[_0xeb62('0xf')];var _0xf93c21=_0x4967c0[_0xeb62('0x10')]({'plain':!![]});if(_0xf93c21[_0xeb62('0x11')][_0xeb62('0x12')]()==='in'||_0xf93c21[_0xeb62('0x11')][_0xeb62('0x12')]()===_0xeb62('0x13')&&!_0xf93c21['secret']&&!_[_0xeb62('0x14')](_0xf93c21[_0xeb62('0x15')])){_0x40584b[_0xeb62('0x16')][_0xeb62('0x17')]({'where':{'id':_0xf93c21['OpenchannelInteractionId']}})[_0xeb62('0x18')](function(_0x2fbad2){if(_0x2fbad2){_0x2fbad2[_0xeb62('0x19')]({'lastMsgAt':_0xf93c21['createdAt'],'lastMsgDirection':_0xf93c21[_0xeb62('0x11')][_0xeb62('0x12')]()});}})[_0xeb62('0x1a')](function(_0x4ce9fa){console[_0xeb62('0x1b')](_0x4ce9fa);});}if(_0xf93c21[_0xeb62('0x11')]===_0xeb62('0x13')&&!_0xf93c21[_0xeb62('0x1c')]){var _0x3fb280;_0x40584b[_0xeb62('0x1d')][_0xeb62('0x1e')]()[_0xeb62('0x18')](function(_0x39b138){return _0x40584b[_0xeb62('0x1f')][_0xeb62('0x20')]({'where':{'id':_0xf93c21[_0xeb62('0x21')]},'include':[{'model':_0x40584b[_0xeb62('0x16')],'as':'Interactions','where':{'id':_0xf93c21[_0xeb62('0x22')]},'limit':0x1,'include':[{'model':_0x40584b[_0xeb62('0x1d')],'as':_0xeb62('0x23'),'attributes':_[_0xeb62('0x24')](_0x39b138)}]}]});})[_0xeb62('0x18')](function(_0x24cbf3){_0x3fb280=_0x24cbf3[_0xeb62('0x10')]({'plain':!![]});if(_0x3fb280&&_0x3fb280['replyUri']){logger['info'](_0xeb62('0x25'),_0xeb62('0x26'),util[_0xeb62('0x27')](_0xeb62('0x28'),_0xf93c21['id'],_0x3fb280[_0xeb62('0x29')]));if(_0x3fb280['Interactions']&&_0x3fb280['Interactions'][_0xeb62('0x2a')]){_0xf93c21[_0xeb62('0x2b')]=_[_0xeb62('0x2c')](_0x3fb280[_0xeb62('0x2d')][0x0],'Contact');_0xf93c21['Contact']=_0x3fb280[_0xeb62('0x2d')][0x0]['Contact'];}var _0x5cdef3={'method':'POST','uri':encodeURI(_0x3fb280[_0xeb62('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5cdef3['method']){case _0xeb62('0x2e'):_0x5cdef3['qs']=_0xf93c21;break;case _0xeb62('0x2f'):_0x5cdef3[_0xeb62('0xd')]=_0xf93c21;break;}return rp(_0x5cdef3)['then'](function(_0x3ef784){logger[_0xeb62('0x30')](_0xeb62('0x25'),_0xeb62('0x26'),util[_0xeb62('0x27')](_0xeb62('0x31'),_0xf93c21['id'],_0x3fb280['replyUri']));if(_0x3ef784[_0xeb62('0xd')][_0xeb62('0x32')]&&_0x3ef784['body'][_0xeb62('0x32')]!=_0xf93c21[_0xeb62('0x2b')][_0xeb62('0x32')]){return _0x40584b[_0xeb62('0x16')][_0xeb62('0x19')]({'threadId':_0x3ef784['body']['threadId']},{'logging':!![],'where':{'id':_0xf93c21[_0xeb62('0x2b')]['id']}});}else{return;}})[_0xeb62('0x18')](function(){return _0x4967c0[_0xeb62('0x19')]({'read':!![]});})[_0xeb62('0x1a')](function(_0x42b197){logger[_0xeb62('0x1b')](_0xeb62('0x25'),'afterCreate',util[_0xeb62('0x33')](_0x42b197,{'showHidden':![],'depth':null}));_0x4693c9();});}else{_0x4693c9();}})['finally'](function(){_0x4693c9();});}else{_0x4693c9();}}},'charset':'utf8mb4','collate':_0xeb62('0x34')});}; \ No newline at end of file +var _0x896e=['OpenchannelAccountId','Interactions','Contact','keys','get','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','replyUri','method','body','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','CmContact','then','OpenchannelAccount'];(function(_0x4408f3,_0x5aab75){var _0x42de61=function(_0x4b8b55){while(--_0x4b8b55){_0x4408f3['push'](_0x4408f3['shift']());}};_0x42de61(++_0x5aab75);}(_0x896e,0x1e9));var _0xe896=function(_0x73060e,_0x4c0617){_0x73060e=_0x73060e-0x0;var _0x4c7836=_0x896e[_0x73060e];return _0x4c7836;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[{'name':_0xe896('0xf'),'fields':['body'],'type':_0xe896('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14b7e4,_0x37a90d,_0x4afd3f){var _0x305616=_0x52ac80['models'];var _0x45b15b=_0x14b7e4['get']({'plain':!![]});if(_0x45b15b[_0xe896('0x11')][_0xe896('0x12')]()==='in'||_0x45b15b[_0xe896('0x11')]['toLowerCase']()===_0xe896('0x13')&&!_0x45b15b[_0xe896('0x14')]&&!_[_0xe896('0x15')](_0x45b15b['UserId'])){_0x305616[_0xe896('0x16')][_0xe896('0x17')]({'where':{'id':_0x45b15b[_0xe896('0x18')]}})['then'](function(_0x2d0e46){if(_0x2d0e46){_0x2d0e46[_0xe896('0x19')]({'lastMsgAt':_0x45b15b[_0xe896('0x1a')],'lastMsgDirection':_0x45b15b['direction']['toLowerCase']()});}})[_0xe896('0x1b')](function(_0x25606b){console['error'](_0x25606b);});}if(_0x45b15b['direction']===_0xe896('0x13')&&!_0x45b15b[_0xe896('0x14')]){var _0x57f04b;_0x305616[_0xe896('0x1c')]['describe']()[_0xe896('0x1d')](function(_0x32f86d){return _0x305616[_0xe896('0x1e')]['find']({'where':{'id':_0x45b15b[_0xe896('0x1f')]},'include':[{'model':_0x305616[_0xe896('0x16')],'as':_0xe896('0x20'),'where':{'id':_0x45b15b[_0xe896('0x18')]},'limit':0x1,'include':[{'model':_0x305616[_0xe896('0x1c')],'as':_0xe896('0x21'),'attributes':_[_0xe896('0x22')](_0x32f86d)}]}]});})[_0xe896('0x1d')](function(_0x49547b){_0x57f04b=_0x49547b[_0xe896('0x23')]({'plain':!![]});if(_0x57f04b&&_0x57f04b['replyUri']){logger['info'](_0xe896('0x24'),_0xe896('0x25'),util[_0xe896('0x26')](_0xe896('0x27'),_0x45b15b['id'],_0x57f04b['replyUri']));if(_0x57f04b[_0xe896('0x20')]&&_0x57f04b['Interactions']['length']){_0x45b15b[_0xe896('0x28')]=_[_0xe896('0x29')](_0x57f04b[_0xe896('0x20')][0x0],_0xe896('0x21'));_0x45b15b[_0xe896('0x21')]=_0x57f04b[_0xe896('0x20')][0x0][_0xe896('0x21')];}var _0x37a90d={'method':_0xe896('0x2a'),'uri':encodeURI(_0x57f04b[_0xe896('0x2b')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x37a90d[_0xe896('0x2c')]){case'GET':_0x37a90d['qs']=_0x45b15b;break;case _0xe896('0x2a'):_0x37a90d[_0xe896('0x2d')]=_0x45b15b;break;}return rp(_0x37a90d)[_0xe896('0x1d')](function(_0xe93aa0){logger[_0xe896('0x2e')](_0xe896('0x24'),'afterCreate',util[_0xe896('0x26')](_0xe896('0x2f'),_0x45b15b['id'],_0x57f04b[_0xe896('0x2b')]));if(_0xe93aa0[_0xe896('0x2d')][_0xe896('0x30')]&&_0xe93aa0['body']['threadId']!=_0x45b15b['Interaction']['threadId']){return _0x305616['OpenchannelInteraction'][_0xe896('0x19')]({'threadId':_0xe93aa0[_0xe896('0x2d')][_0xe896('0x30')]},{'logging':!![],'where':{'id':_0x45b15b[_0xe896('0x28')]['id']}});}else{return;}})[_0xe896('0x1d')](function(){return _0x14b7e4[_0xe896('0x19')]({'read':!![]});})[_0xe896('0x1b')](function(_0x45c6d3){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xe896('0x25'),util[_0xe896('0x31')](_0x45c6d3,{'showHidden':![],'depth':null}));_0x4afd3f();});}else{_0x4afd3f();}})[_0xe896('0x32')](function(){_0x4afd3f();});}else{_0x4afd3f();}}},'charset':_0xe896('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index fb35dd5..75c2c18 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0xb2a291,_0x20d317){var _0x47106d=function(_0x2a6493){while(--_0x2a6493){_0xb2a291['push'](_0xb2a291['shift']());}};_0x47106d(++_0x20d317);}(_0x0b0e,0x187));var _0xe0b0=function(_0xafdec6,_0x3d94df){_0xafdec6=_0xafdec6-0x0;var _0x372bdb=_0x0b0e[_0xafdec6];return _0x372bdb;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _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(_0x3fb23f,_0x411378){var _0x523ce4=function(_0x25a412){while(--_0x25a412){_0x3fb23f['push'](_0x3fb23f['shift']());}};_0x523ce4(++_0x411378);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'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 3aee8e5..e7a62da 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 _0x5ad6=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x4a7c15,_0x274db9){var _0x8f9d14=function(_0x4c9d65){while(--_0x4c9d65){_0x4a7c15['push'](_0x4a7c15['shift']());}};_0x8f9d14(++_0x274db9);}(_0x5ad6,0xba));var _0x65ad=function(_0x3cf1b1,_0x445a0a){_0x3cf1b1=_0x3cf1b1-0x0;var _0x347602=_0x5ad6[_0x3cf1b1];return _0x347602;};'use strict';var OpenchannelMessageEvents=require(_0x65ad('0x0'));var events=[_0x65ad('0x1'),_0x65ad('0x2'),_0x65ad('0x3')];function createListener(_0x55f59e,_0x20280f){return function(_0x35152e){_0x20280f[_0x65ad('0x4')](_0x55f59e,_0x35152e);};}function removeListener(_0x3b6786,_0x5608ef){return function(){OpenchannelMessageEvents[_0x65ad('0x5')](_0x3b6786,_0x5608ef);};}exports['register']=function(_0x12cef8){for(var _0x4b3308=0x0,_0x24028c=events[_0x65ad('0x6')];_0x4b3308<_0x24028c;_0x4b3308++){var _0x1a3477=events[_0x4b3308];var _0x567d2e=createListener(_0x65ad('0x7')+_0x1a3477,_0x12cef8);OpenchannelMessageEvents['on'](_0x1a3477,_0x567d2e);}}; \ No newline at end of file +var _0x5a99=['openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener','register','length'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x5a99,0xc9));var _0x95a9=function(_0x4a5993,_0x144796){_0x4a5993=_0x4a5993-0x0;var _0x1a39e9=_0x5a99[_0x4a5993];return _0x1a39e9;};'use strict';var OpenchannelMessageEvents=require(_0x95a9('0x0'));var events=[_0x95a9('0x1'),_0x95a9('0x2'),'update'];function createListener(_0xa50e8e,_0x285b0a){return function(_0x2bc3ed){_0x285b0a[_0x95a9('0x3')](_0xa50e8e,_0x2bc3ed);};}function removeListener(_0x4b30e2,_0x2c8e52){return function(){OpenchannelMessageEvents[_0x95a9('0x4')](_0x4b30e2,_0x2c8e52);};}exports[_0x95a9('0x5')]=function(_0x5195cd){for(var _0x4aecd8=0x0,_0x438069=events[_0x95a9('0x6')];_0x4aecd8<_0x438069;_0x4aecd8++){var _0x108eb6=events[_0x4aecd8];var _0x4b2d58=createListener(_0x95a9('0x7')+_0x108eb6,_0x5195cd);OpenchannelMessageEvents['on'](_0x108eb6,_0x4b2d58);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 85bf486..7ab5260 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 _0x91f7=['index','/describe','describe','/:id','/:id/members','/:id/teams','/:id/users','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x3f2da0,_0x236387){var _0xf2b237=function(_0x1f0818){while(--_0x1f0818){_0x3f2da0['push'](_0x3f2da0['shift']());}};_0xf2b237(++_0x236387);}(_0x91f7,0xe9));var _0x791f=function(_0x3e8117,_0x206d42){_0x3e8117=_0x3e8117-0x0;var _0x591604=_0x91f7[_0x3e8117];return _0x591604;};'use strict';var multer=require('multer');var util=require(_0x791f('0x0'));var path=require(_0x791f('0x1'));var timeout=require('connect-timeout');var express=require(_0x791f('0x2'));var router=express[_0x791f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791f('0x4'));var interaction=require(_0x791f('0x5'));var config=require(_0x791f('0x6'));var controller=require(_0x791f('0x7'));router[_0x791f('0x8')]('/',auth[_0x791f('0x9')](),controller[_0x791f('0xa')]);router[_0x791f('0x8')](_0x791f('0xb'),auth[_0x791f('0x9')](),controller[_0x791f('0xc')]);router[_0x791f('0x8')](_0x791f('0xd'),auth[_0x791f('0x9')](),controller['show']);router[_0x791f('0x8')](_0x791f('0xe'),auth[_0x791f('0x9')](),controller['getMembers']);router[_0x791f('0x8')](_0x791f('0xf'),auth[_0x791f('0x9')](),controller['getTeams']);router[_0x791f('0x8')](_0x791f('0x10'),auth[_0x791f('0x9')](),controller['getAgents']);router[_0x791f('0x11')]('/',auth['isAuthenticated'](),controller[_0x791f('0x12')]);router['post'](_0x791f('0xf'),auth['isAuthenticated'](),controller[_0x791f('0x13')]);router[_0x791f('0x11')](_0x791f('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0x791f('0x14')](_0x791f('0xd'),auth[_0x791f('0x9')](),controller[_0x791f('0x15')]);router['delete'](_0x791f('0xd'),auth[_0x791f('0x9')](),controller[_0x791f('0x16')]);router[_0x791f('0x17')]('/:id/teams',auth[_0x791f('0x9')](),controller[_0x791f('0x18')]);router[_0x791f('0x17')](_0x791f('0x10'),auth[_0x791f('0x9')](),controller[_0x791f('0x19')]);module[_0x791f('0x1a')]=router; \ No newline at end of file +var _0x7c7f=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','index','get','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete'];(function(_0x4eaac8,_0x162b04){var _0x567ff6=function(_0x1939b7){while(--_0x1939b7){_0x4eaac8['push'](_0x4eaac8['shift']());}};_0x567ff6(++_0x162b04);}(_0x7c7f,0x1d4));var _0xf7c7=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x7c7f[_0x46d0c9];return _0x174506;};'use strict';var multer=require(_0xf7c7('0x0'));var util=require(_0xf7c7('0x1'));var path=require(_0xf7c7('0x2'));var timeout=require(_0xf7c7('0x3'));var express=require(_0xf7c7('0x4'));var router=express[_0xf7c7('0x5')]();var fs_extra=require(_0xf7c7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf7c7('0x7'));var config=require('../../config/environment');var controller=require(_0xf7c7('0x8'));router['get']('/',auth[_0xf7c7('0x9')](),controller[_0xf7c7('0xa')]);router[_0xf7c7('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf7c7('0xc')]);router['get'](_0xf7c7('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf7c7('0xb')](_0xf7c7('0xe'),auth['isAuthenticated'](),controller[_0xf7c7('0xf')]);router[_0xf7c7('0xb')](_0xf7c7('0x10'),auth['isAuthenticated'](),controller[_0xf7c7('0x11')]);router[_0xf7c7('0xb')](_0xf7c7('0x12'),auth['isAuthenticated'](),controller[_0xf7c7('0x13')]);router[_0xf7c7('0x14')]('/',auth[_0xf7c7('0x9')](),controller[_0xf7c7('0x15')]);router[_0xf7c7('0x14')](_0xf7c7('0x10'),auth[_0xf7c7('0x9')](),controller[_0xf7c7('0x16')]);router['post'](_0xf7c7('0x12'),auth[_0xf7c7('0x9')](),controller[_0xf7c7('0x17')]);router[_0xf7c7('0x18')](_0xf7c7('0xd'),auth[_0xf7c7('0x9')](),controller[_0xf7c7('0x19')]);router['delete'](_0xf7c7('0xd'),auth[_0xf7c7('0x9')](),controller[_0xf7c7('0x1a')]);router[_0xf7c7('0x1b')](_0xf7c7('0x10'),auth[_0xf7c7('0x9')](),controller[_0xf7c7('0x1c')]);router['delete'](_0xf7c7('0x12'),auth[_0xf7c7('0x9')](),controller[_0xf7c7('0x1d')]);module[_0xf7c7('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c798fa1..95440a9 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 _0xddb5=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x17bfb2,_0x467b28){var _0x1941dc=function(_0x36175a){while(--_0x36175a){_0x17bfb2['push'](_0x17bfb2['shift']());}};_0x1941dc(++_0x467b28);}(_0xddb5,0x152));var _0x5ddb=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xddb5[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x5ddb('0x0'));module[_0x5ddb('0x1')]={'name':{'type':Sequelize[_0x5ddb('0x2')],'unique':_0x5ddb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5ddb('0x2')]},'timeout':{'type':Sequelize[_0x5ddb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5ddb('0x5')](_0x5ddb('0x6'),_0x5ddb('0x7'),_0x5ddb('0x8'))}}; \ No newline at end of file +var _0xec91=['sequelize','exports','name','ENUM','beepall'];(function(_0x4ef251,_0x2f2669){var _0x3577b1=function(_0x16bc12){while(--_0x16bc12){_0x4ef251['push'](_0x4ef251['shift']());}};_0x3577b1(++_0x2f2669);}(_0xec91,0x1cc));var _0x1ec9=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xec91[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require(_0x1ec9('0x0'));module[_0x1ec9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1ec9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ec9('0x3')]('rrmemory',_0x1ec9('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c19d9a1..fcdec5c 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 _0xee78=['push','toString','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','OpenchannelQueue','includeAll','include','findAll','params','keys','catch','create','user','role','OpenchannelQueues','find','userProfileId','update','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','updatedAt','rows','format','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?'];(function(_0x179dba,_0x54aba8){var _0x165f1b=function(_0x48c999){while(--_0x48c999){_0x179dba['push'](_0x179dba['shift']());}};_0x165f1b(++_0x54aba8);}(_0xee78,0x19f));var _0x8ee7=function(_0x3f239d,_0x1e4675){_0x3f239d=_0x3f239d-0x0;var _0x46f035=_0xee78[_0x3f239d];return _0x46f035;};'use strict';var emlformat=require(_0x8ee7('0x0'));var rimraf=require(_0x8ee7('0x1'));var zipdir=require(_0x8ee7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ee7('0x3'));var moment=require(_0x8ee7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8ee7('0x5'));var util=require('util');var path=require(_0x8ee7('0x6'));var sox=require(_0x8ee7('0x7'));var csv=require(_0x8ee7('0x8'));var ejs=require(_0x8ee7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ee7('0xa'));var squel=require('squel');var crypto=require(_0x8ee7('0xb'));var jsforce=require(_0x8ee7('0xc'));var deskjs=require(_0x8ee7('0xd'));var toCsv=require(_0x8ee7('0x8'));var querystring=require('querystring');var Papa=require(_0x8ee7('0xe'));var Redis=require(_0x8ee7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8ee7('0x10'));var hardwareService=require(_0x8ee7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8ee7('0x12'));var config=require(_0x8ee7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ee7('0x14'))['db'];config[_0x8ee7('0x15')]=_[_0x8ee7('0x16')](config['redis'],{'host':_0x8ee7('0x17'),'port':0x18eb});var socket=require(_0x8ee7('0x18'))(new Redis(config[_0x8ee7('0x15')]));require(_0x8ee7('0x19'))[_0x8ee7('0x1a')](socket);function respondWithStatusCode(_0x3cccd2,_0x2771a4){_0x2771a4=_0x2771a4||0xcc;return function(_0x1f6936){if(_0x1f6936){return _0x3cccd2[_0x8ee7('0x1b')](_0x2771a4);}return _0x3cccd2[_0x8ee7('0x1c')](_0x2771a4)[_0x8ee7('0x1d')]();};}function respondWithResult(_0x242f76,_0x4ccafd){_0x4ccafd=_0x4ccafd||0xc8;return function(_0x83b882){if(_0x83b882){return _0x242f76[_0x8ee7('0x1c')](_0x4ccafd)[_0x8ee7('0x1e')](_0x83b882);}};}function respondWithFilteredResult(_0x5ca99b,_0x1e92ab){return function(_0x44e703){if(_0x44e703){var _0x1eaea5=typeof _0x1e92ab[_0x8ee7('0x1f')]===_0x8ee7('0x20')&&typeof _0x1e92ab[_0x8ee7('0x21')]==='undefined';var _0x487d38=_0x44e703[_0x8ee7('0x22')];var _0x2af807=_0x1eaea5?0x0:_0x1e92ab[_0x8ee7('0x1f')];var _0x210ecf=_0x1eaea5?_0x44e703[_0x8ee7('0x22')]:_0x1e92ab[_0x8ee7('0x1f')]+_0x1e92ab[_0x8ee7('0x21')];var _0x5e0c0a;if(_0x210ecf>=_0x487d38){_0x210ecf=_0x487d38;_0x5e0c0a=0xc8;}else{_0x5e0c0a=0xce;}_0x5ca99b[_0x8ee7('0x1c')](_0x5e0c0a);return _0x5ca99b[_0x8ee7('0x23')](_0x8ee7('0x24'),_0x2af807+'-'+_0x210ecf+'/'+_0x487d38)[_0x8ee7('0x1e')](_0x44e703);}return null;};}function patchUpdates(_0x203212){return function(_0x19f1ad){try{jsonpatch[_0x8ee7('0x25')](_0x19f1ad,_0x203212,!![]);}catch(_0xd962b8){return BPromise[_0x8ee7('0x26')](_0xd962b8);}return _0x19f1ad[_0x8ee7('0x27')]();};}function saveUpdates(_0x522d11,_0x1046b2){return function(_0x10a0c1){if(_0x10a0c1){return _0x10a0c1['update'](_0x522d11)[_0x8ee7('0x28')](function(_0x4d4bb5){return _0x4d4bb5;});}return null;};}function removeEntity(_0x1c9efc,_0x2c5b12){return function(_0x4a014b){if(_0x4a014b){return _0x4a014b[_0x8ee7('0x29')]()['then'](function(){var _0x6823e2=_0x4a014b[_0x8ee7('0x2a')]({'plain':!![]});var _0x2df677='OpenchannelQueues';return db[_0x8ee7('0x2b')][_0x8ee7('0x29')]({'where':{'type':_0x2df677,'resourceId':_0x6823e2['id']}})[_0x8ee7('0x28')](function(){return _0x4a014b;});})['then'](function(){_0x1c9efc[_0x8ee7('0x1c')](0xcc)[_0x8ee7('0x1d')]();});}};}function handleEntityNotFound(_0x1f9ef9,_0x5db14c){return function(_0x832fe6){if(!_0x832fe6){_0x1f9ef9['sendStatus'](0x194);}return _0x832fe6;};}function handleError(_0xf45f47,_0x1db7fe){_0x1db7fe=_0x1db7fe||0x1f4;return function(_0x33d415){logger[_0x8ee7('0x2c')](_0x33d415[_0x8ee7('0x2d')]);if(_0x33d415[_0x8ee7('0x2e')]){delete _0x33d415['name'];}_0xf45f47[_0x8ee7('0x1c')](_0x1db7fe)['send'](_0x33d415);};}exports[_0x8ee7('0x2f')]=function(_0x508843,_0x4934f7){var _0x1b2b25={},_0x389e5e={},_0x235b0e={'count':0x0,'rows':[]};var _0x399e6a=_[_0x8ee7('0x30')](db['OpenchannelQueue'][_0x8ee7('0x31')],function(_0x5a4274){return{'name':_0x5a4274[_0x8ee7('0x32')],'type':_0x5a4274[_0x8ee7('0x33')][_0x8ee7('0x34')]};});_0x389e5e[_0x8ee7('0x35')]=_['map'](_0x399e6a,_0x8ee7('0x2e'));_0x389e5e[_0x8ee7('0x36')]=_['keys'](_0x508843[_0x8ee7('0x36')]);_0x389e5e[_0x8ee7('0x37')]=_[_0x8ee7('0x38')](_0x389e5e[_0x8ee7('0x35')],_0x389e5e[_0x8ee7('0x36')]);_0x1b2b25[_0x8ee7('0x39')]=_['intersection'](_0x389e5e[_0x8ee7('0x35')],qs['fields'](_0x508843[_0x8ee7('0x36')][_0x8ee7('0x3a')]));_0x1b2b25['attributes']=_0x1b2b25[_0x8ee7('0x39')][_0x8ee7('0x3b')]?_0x1b2b25[_0x8ee7('0x39')]:_0x389e5e[_0x8ee7('0x35')];if(!_0x508843['query'][_0x8ee7('0x3c')](_0x8ee7('0x3d'))){_0x1b2b25[_0x8ee7('0x21')]=qs[_0x8ee7('0x21')](_0x508843[_0x8ee7('0x36')][_0x8ee7('0x21')]);_0x1b2b25[_0x8ee7('0x1f')]=qs[_0x8ee7('0x1f')](_0x508843[_0x8ee7('0x36')][_0x8ee7('0x1f')]);}_0x1b2b25[_0x8ee7('0x3e')]=qs['sort'](_0x508843[_0x8ee7('0x36')][_0x8ee7('0x3f')]);_0x1b2b25[_0x8ee7('0x40')]=qs[_0x8ee7('0x37')](_[_0x8ee7('0x41')](_0x508843[_0x8ee7('0x36')],_0x389e5e[_0x8ee7('0x37')]),_0x399e6a);if(_0x508843[_0x8ee7('0x36')]['filter']){_0x1b2b25[_0x8ee7('0x40')]=_[_0x8ee7('0x42')](_0x1b2b25[_0x8ee7('0x40')],{'$or':_[_0x8ee7('0x30')](_0x399e6a,function(_0xa8033f){if(_0xa8033f[_0x8ee7('0x33')]!=='VIRTUAL'){var _0x267d88={};_0x267d88[_0xa8033f[_0x8ee7('0x2e')]]={'$like':'%'+_0x508843[_0x8ee7('0x36')][_0x8ee7('0x43')]+'%'};return _0x267d88;}})});}_0x1b2b25=_['merge']({},_0x1b2b25,_0x508843[_0x8ee7('0x44')]);var _0xbd177={'where':_0x1b2b25[_0x8ee7('0x40')]};return db[_0x8ee7('0x45')]['count'](_0xbd177)[_0x8ee7('0x28')](function(_0x310140){_0x235b0e[_0x8ee7('0x22')]=_0x310140;if(_0x508843[_0x8ee7('0x36')][_0x8ee7('0x46')]){_0x1b2b25[_0x8ee7('0x47')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x8ee7('0x48')](_0x1b2b25);})[_0x8ee7('0x28')](function(_0x323157){_0x235b0e['rows']=_0x323157;return _0x235b0e;})['then'](respondWithFilteredResult(_0x4934f7,_0x1b2b25))['catch'](handleError(_0x4934f7,null));};exports['show']=function(_0x2de952,_0x596df0){var _0x287a48={'raw':!![],'where':{'id':_0x2de952[_0x8ee7('0x49')]['id']}},_0x28384c={};_0x28384c[_0x8ee7('0x35')]=_['keys'](db[_0x8ee7('0x45')]['rawAttributes']);_0x28384c[_0x8ee7('0x36')]=_[_0x8ee7('0x4a')](_0x2de952[_0x8ee7('0x36')]);_0x28384c[_0x8ee7('0x37')]=_[_0x8ee7('0x38')](_0x28384c[_0x8ee7('0x35')],_0x28384c['query']);_0x287a48[_0x8ee7('0x39')]=_[_0x8ee7('0x38')](_0x28384c['model'],qs[_0x8ee7('0x3a')](_0x2de952[_0x8ee7('0x36')][_0x8ee7('0x3a')]));_0x287a48[_0x8ee7('0x39')]=_0x287a48['attributes'][_0x8ee7('0x3b')]?_0x287a48['attributes']:_0x28384c['model'];if(_0x2de952['query'][_0x8ee7('0x46')]){_0x287a48[_0x8ee7('0x47')]=[{'all':!![]}];}_0x287a48=_[_0x8ee7('0x42')]({},_0x287a48,_0x2de952[_0x8ee7('0x44')]);return db[_0x8ee7('0x45')]['find'](_0x287a48)['then'](handleEntityNotFound(_0x596df0,null))['then'](respondWithResult(_0x596df0,null))[_0x8ee7('0x4b')](handleError(_0x596df0,null));};exports[_0x8ee7('0x4c')]=function(_0x267b60,_0x1c0ca8){return db['OpenchannelQueue'][_0x8ee7('0x4c')](_0x267b60['body'],{})[_0x8ee7('0x28')](function(_0x119b40){var _0x40b40d=_0x267b60[_0x8ee7('0x4d')][_0x8ee7('0x2a')]({'plain':!![]});if(!_0x40b40d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40b40d[_0x8ee7('0x4e')]==='user'){var _0x29585d=_0x119b40['get']({'plain':!![]});var _0x12d0d2=_0x8ee7('0x4f');return db['UserProfileSection'][_0x8ee7('0x50')]({'where':{'name':_0x12d0d2,'userProfileId':_0x40b40d[_0x8ee7('0x51')]},'raw':!![]})[_0x8ee7('0x28')](function(_0x277df6){if(_0x277df6&&_0x277df6['autoAssociation']===0x0){return db['UserProfileResource'][_0x8ee7('0x4c')]({'name':_0x29585d[_0x8ee7('0x2e')],'resourceId':_0x29585d['id'],'type':_0x277df6[_0x8ee7('0x2e')],'sectionId':_0x277df6['id']},{})[_0x8ee7('0x28')](function(){return _0x119b40;});}else{return _0x119b40;}})[_0x8ee7('0x4b')](function(_0x27312e){logger[_0x8ee7('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27312e);throw _0x27312e;});}return _0x119b40;})[_0x8ee7('0x28')](respondWithResult(_0x1c0ca8,0xc9))[_0x8ee7('0x4b')](handleError(_0x1c0ca8,null));};exports[_0x8ee7('0x52')]=function(_0x4a2e0f,_0x100920){if(_0x4a2e0f[_0x8ee7('0x53')]['id']){delete _0x4a2e0f['body']['id'];}return db[_0x8ee7('0x45')][_0x8ee7('0x50')]({'where':{'id':_0x4a2e0f[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](handleEntityNotFound(_0x100920,null))[_0x8ee7('0x28')](saveUpdates(_0x4a2e0f[_0x8ee7('0x53')],null))['then'](respondWithResult(_0x100920,null))[_0x8ee7('0x4b')](handleError(_0x100920,null));};exports['destroy']=function(_0xd0af57,_0x4d3b5d){return db[_0x8ee7('0x45')][_0x8ee7('0x50')]({'where':{'id':_0xd0af57[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](handleEntityNotFound(_0x4d3b5d,null))[_0x8ee7('0x28')](removeEntity(_0x4d3b5d,null))[_0x8ee7('0x4b')](handleError(_0x4d3b5d,null));};exports[_0x8ee7('0x54')]=function(_0x2d1c6e,_0x22d7a8){return db['OpenchannelQueue'][_0x8ee7('0x54')]()[_0x8ee7('0x28')](respondWithResult(_0x22d7a8,null))[_0x8ee7('0x4b')](handleError(_0x22d7a8,null));};exports[_0x8ee7('0x55')]=function(_0x3b6155,_0x2c58c8,_0x197eca){var _0x306037={'raw':!![],'where':{}},_0x303a6f={},_0x36e5ec;return db[_0x8ee7('0x45')][_0x8ee7('0x56')]({'where':{'id':_0x3b6155[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](handleEntityNotFound(_0x2c58c8,null))[_0x8ee7('0x28')](function(_0x4da287){if(_0x4da287){_0x36e5ec=_0x4da287[_0x8ee7('0x2a')]({'plain':!![]});_0x303a6f[_0x8ee7('0x35')]=_[_0x8ee7('0x4a')](db[_0x8ee7('0x57')][_0x8ee7('0x31')]);_0x303a6f[_0x8ee7('0x36')]=_['keys'](_0x3b6155['query']);_0x303a6f[_0x8ee7('0x37')]=_[_0x8ee7('0x38')](_0x303a6f[_0x8ee7('0x35')],_0x303a6f[_0x8ee7('0x36')]);_0x306037[_0x8ee7('0x39')]=_['intersection'](_0x303a6f[_0x8ee7('0x35')],qs[_0x8ee7('0x3a')](_0x3b6155['query'][_0x8ee7('0x3a')]));_0x306037[_0x8ee7('0x39')]=_0x306037[_0x8ee7('0x39')]['length']?_0x306037['attributes']:_0x303a6f['model'];if(!_0x3b6155['query'][_0x8ee7('0x3c')](_0x8ee7('0x3d'))){_0x306037[_0x8ee7('0x21')]=qs[_0x8ee7('0x21')](_0x3b6155[_0x8ee7('0x36')][_0x8ee7('0x21')]);_0x306037['offset']=qs[_0x8ee7('0x1f')](_0x3b6155[_0x8ee7('0x36')]['offset']);}_0x306037[_0x8ee7('0x3e')]=qs[_0x8ee7('0x3f')](_0x3b6155[_0x8ee7('0x36')][_0x8ee7('0x3f')]);_0x306037[_0x8ee7('0x40')]=qs[_0x8ee7('0x37')](_[_0x8ee7('0x41')](_0x3b6155[_0x8ee7('0x36')],_0x303a6f[_0x8ee7('0x37')]));_0x306037[_0x8ee7('0x40')][_0x8ee7('0x58')]=_0x4da287['id'];if(_0x3b6155['query'][_0x8ee7('0x43')]){_0x306037['where']=_[_0x8ee7('0x42')](_0x306037['where'],{'$or':_[_0x8ee7('0x30')](_0x306037['attributes'],function(_0x55a6ce){var _0xef12ab={};_0xef12ab[_0x55a6ce]={'$like':'%'+_0x3b6155[_0x8ee7('0x36')][_0x8ee7('0x43')]+'%'};return _0xef12ab;})});}_0x306037=_[_0x8ee7('0x42')]({},_0x306037,_0x3b6155[_0x8ee7('0x44')]);return db[_0x8ee7('0x57')][_0x8ee7('0x48')](_0x306037);}})[_0x8ee7('0x28')](function(_0x13eb1c){if(_0x13eb1c){return db[_0x8ee7('0x59')][_0x8ee7('0x5a')]({'where':{'id':_['map'](_0x13eb1c,_0x8ee7('0x5b')),'role':_0x8ee7('0x5c')},'attributes':['id','name','openchannelPause',_0x8ee7('0x5d'),'createdAt']});}})['then'](function(_0x29b0bd){if(_0x29b0bd){return{'count':_0x29b0bd['count'],'rows':_[_0x8ee7('0x30')](_0x29b0bd[_0x8ee7('0x5e')],function(_0x5babc1){return{'membername':_0x5babc1[_0x8ee7('0x2e')],'UserId':_0x5babc1['id'],'queue_name':_0x36e5ec['name'],'OpenchannelQueueId':_0x36e5ec['id'],'interface':util[_0x8ee7('0x5f')]('%s/%s',_0x8ee7('0x60'),_0x5babc1[_0x8ee7('0x2e')]),'penalty':0x0,'paused':_0x5babc1['openchannelPause'],'createdAt':_0x5babc1['createdAt'],'updatedAt':_0x5babc1[_0x8ee7('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8ee7('0x28')](respondWithFilteredResult(_0x2c58c8,_0x306037))[_0x8ee7('0x4b')](handleError(_0x2c58c8,null));};exports[_0x8ee7('0x61')]=function(_0x43ab7d,_0x20f487,_0x24e9c5){var _0x431fcd={};var _0x2cb7d3={};var _0xa7f038;var _0xa7614;return db['OpenchannelQueue'][_0x8ee7('0x56')]({'where':{'id':_0x43ab7d[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](handleEntityNotFound(_0x20f487,null))['then'](function(_0x50bbc6){if(_0x50bbc6){_0xa7f038=_0x50bbc6;_0x2cb7d3[_0x8ee7('0x35')]=_[_0x8ee7('0x4a')](db[_0x8ee7('0x62')]['rawAttributes']);_0x2cb7d3[_0x8ee7('0x36')]=_[_0x8ee7('0x4a')](_0x43ab7d[_0x8ee7('0x36')]);_0x2cb7d3['filters']=_[_0x8ee7('0x38')](_0x2cb7d3[_0x8ee7('0x35')],_0x2cb7d3[_0x8ee7('0x36')]);_0x431fcd[_0x8ee7('0x39')]=_['intersection'](_0x2cb7d3[_0x8ee7('0x35')],qs[_0x8ee7('0x3a')](_0x43ab7d['query'][_0x8ee7('0x3a')]));_0x431fcd['attributes']=_0x431fcd[_0x8ee7('0x39')][_0x8ee7('0x3b')]?_0x431fcd[_0x8ee7('0x39')]:_0x2cb7d3[_0x8ee7('0x35')];_0x431fcd[_0x8ee7('0x3e')]=qs[_0x8ee7('0x3f')](_0x43ab7d[_0x8ee7('0x36')][_0x8ee7('0x3f')]);_0x431fcd[_0x8ee7('0x40')]=qs[_0x8ee7('0x37')](_['pick'](_0x43ab7d[_0x8ee7('0x36')],_0x2cb7d3[_0x8ee7('0x37')]));if(_0x43ab7d[_0x8ee7('0x36')]['filter']){_0x431fcd[_0x8ee7('0x40')]=_[_0x8ee7('0x42')](_0x431fcd['where'],{'$or':_[_0x8ee7('0x30')](_0x431fcd[_0x8ee7('0x39')],function(_0x2892a3){var _0x37e911={};_0x37e911[_0x2892a3]={'$like':'%'+_0x43ab7d[_0x8ee7('0x36')][_0x8ee7('0x43')]+'%'};return _0x37e911;})});}_0x431fcd=_[_0x8ee7('0x42')]({},_0x431fcd,_0x43ab7d[_0x8ee7('0x44')]);return _0xa7f038[_0x8ee7('0x61')](_0x431fcd);}})['then'](function(_0x53a3cc){if(_0x53a3cc){_0xa7614=_0x53a3cc[_0x8ee7('0x3b')];if(!_0x43ab7d[_0x8ee7('0x36')][_0x8ee7('0x3c')]('nolimit')){_0x431fcd[_0x8ee7('0x21')]=qs['limit'](_0x43ab7d[_0x8ee7('0x36')][_0x8ee7('0x21')]);_0x431fcd[_0x8ee7('0x1f')]=qs[_0x8ee7('0x1f')](_0x43ab7d[_0x8ee7('0x36')]['offset']);}return _0xa7f038['getTeams'](_0x431fcd);}})[_0x8ee7('0x28')](function(_0x405136){if(_0x405136){return _0x405136?{'count':_0xa7614,'rows':_0x405136}:null;}})[_0x8ee7('0x28')](respondWithResult(_0x20f487,null))[_0x8ee7('0x4b')](handleError(_0x20f487,null));};exports[_0x8ee7('0x63')]=function(_0x13f275,_0x39b845,_0x4722d2){var _0x27d1db=_0x13f275[_0x8ee7('0x53')][_0x8ee7('0x64')];return db[_0x8ee7('0x62')][_0x8ee7('0x48')]({'where':{'id':_0x27d1db},'attributes':['id'],'include':[{'model':db[_0x8ee7('0x59')],'as':_0x8ee7('0x65'),'attributes':['id','name',_0x8ee7('0x66'),'voicePause',_0x8ee7('0x67')],'raw':!![]}]})[_0x8ee7('0x28')](function(_0x1c70b7){if(_0x1c70b7){var _0x6fe065=_[_0x8ee7('0x68')](_0x1c70b7,function(_0x283e8e){var _0x306f50=_0x283e8e['get']({'plain':!![]});return _0x306f50[_0x8ee7('0x65')];});return db[_0x8ee7('0x45')][_0x8ee7('0x50')]({'where':{'id':_0x13f275[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](function(_0x9bf367){return db[_0x8ee7('0x69')][_0x8ee7('0x6a')](function(_0x203088){return _0x9bf367[_0x8ee7('0x63')](_0x27d1db,{'transaction':_0x203088})[_0x8ee7('0x28')](function(){return BPromise['each'](_0x6fe065,function(_0x10cd50){return db['UserOpenchannelQueue'][_0x8ee7('0x6b')]({'where':{'UserId':_0x10cd50['id'],'OpenchannelQueueId':_0x13f275['params']['id']},'transaction':_0x203088});});})[_0x8ee7('0x28')](function(){_0x6fe065[_0x8ee7('0x6c')](function(_0x28e3d0){socket[_0x8ee7('0x6d')](_0x8ee7('0x6e'),{'UserId':_0x28e3d0['id'],'OpenchannelQueueId':_0x9bf367['id']});});});});});}})[_0x8ee7('0x28')](respondWithStatusCode(_0x39b845,null))['catch'](handleError(_0x39b845,null));};exports['removeTeams']=function(_0x223833,_0x167332,_0x56512b){return db[_0x8ee7('0x62')][_0x8ee7('0x48')]({'where':{'id':_0x223833[_0x8ee7('0x36')][_0x8ee7('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8ee7('0x28')](handleEntityNotFound(_0x167332,null))[_0x8ee7('0x28')](function(_0x445a5c){var _0x33e641=_[_0x8ee7('0x30')](_0x445a5c,'id');var _0x47c353=[];var _0x365454=[];var _0x3b0664=squel[_0x8ee7('0x6f')]();_0x3b0664[_0x8ee7('0x70')]('tq.TeamId')['from'](_0x8ee7('0x71'),'tq')[_0x8ee7('0x72')]('user_has_teams','ut',_0x8ee7('0x73'))[_0x8ee7('0x40')]('OpenchannelQueueId\x20=\x20?',_0x223833[_0x8ee7('0x49')]['id']);for(var _0x37fe16=0x0;_0x37fe16<_0x445a5c[_0x8ee7('0x3b')];_0x37fe16+=0x1){let _0x1c29cb=_0x445a5c[_0x37fe16];for(var _0x5ed260=0x0;_0x5ed260<_0x1c29cb[_0x8ee7('0x65')]['length'];_0x5ed260+=0x1){let _0x5e418a=_0x1c29cb[_0x8ee7('0x65')][_0x5ed260];var _0x2ef7f5=_0x3b0664['clone']();_0x2ef7f5[_0x8ee7('0x40')](_0x8ee7('0x74'),_0x5e418a['id']);_0x365454[_0x8ee7('0x75')](db[_0x8ee7('0x69')][_0x8ee7('0x36')](_0x2ef7f5[_0x8ee7('0x76')](),{'type':db[_0x8ee7('0x69')]['QueryTypes']['SELECT']})[_0x8ee7('0x28')](function(_0x133854){if(_0x133854['length']===0x1){return _0x5e418a['id'];}else{var _0x39c7de=_[_0x8ee7('0x77')](_['map'](_0x133854,_0x8ee7('0x78')),function(_0x4ddf33){return _[_0x8ee7('0x79')](_0x33e641,_0x4ddf33);});if(_0x39c7de){return _0x5e418a['id'];}}}));}}return BPromise['all'](_0x365454)[_0x8ee7('0x28')](function(_0x282daf){_0x47c353=_(_0x47c353)[_0x8ee7('0x7a')](_0x282daf)[_0x8ee7('0x7b')]()[_0x8ee7('0x7c')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x223833[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](function(_0x525a44){return db['sequelize']['transaction'](function(_0x2986f4){return _0x525a44[_0x8ee7('0x7d')](_0x223833['query'][_0x8ee7('0x64')],{'transaction':_0x2986f4})[_0x8ee7('0x28')](function(){if(!_[_0x8ee7('0x7e')](_0x47c353)){return _0x525a44['removeAgents'](_0x47c353,{'transaction':_0x2986f4});}})[_0x8ee7('0x28')](function(){_0x47c353[_0x8ee7('0x6c')](function(_0x1b8d68){socket[_0x8ee7('0x6d')](_0x8ee7('0x7f'),{'UserId':_0x1b8d68,'OpenchannelQueueId':_0x525a44['id']});});});});});});})[_0x8ee7('0x28')](respondWithStatusCode(_0x167332,null))['catch'](handleError(_0x167332,null));};exports['addAgents']=function(_0x2d4fc7,_0xf357d9,_0x232c04){return db['OpenchannelQueue'][_0x8ee7('0x50')]({'where':{'id':_0x2d4fc7[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](handleEntityNotFound(_0xf357d9,null))[_0x8ee7('0x28')](function(_0x27f47b){if(_0x27f47b){return _0x27f47b[_0x8ee7('0x80')](_0x2d4fc7[_0x8ee7('0x53')][_0x8ee7('0x64')],_['omit'](_0x2d4fc7['body'],[_0x8ee7('0x64'),'id'])||{})[_0x8ee7('0x81')](function(_0x4d7bc4){for(var _0x4df515=0x0;_0x4df515<_0x2d4fc7[_0x8ee7('0x53')][_0x8ee7('0x64')]['length'];_0x4df515+=0x1){socket['emit'](_0x8ee7('0x6e'),{'UserId':Number(_0x2d4fc7['body'][_0x8ee7('0x64')][_0x4df515]),'OpenchannelQueueId':Number(_0x2d4fc7[_0x8ee7('0x49')]['id'])});}return _0x4d7bc4;});}})[_0x8ee7('0x28')](respondWithResult(_0xf357d9,null))[_0x8ee7('0x4b')](handleError(_0xf357d9,null));};exports[_0x8ee7('0x82')]=function(_0x201e5c,_0x1164f6,_0x108719){return db[_0x8ee7('0x45')][_0x8ee7('0x50')]({'where':{'id':_0x201e5c[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](handleEntityNotFound(_0x1164f6,null))[_0x8ee7('0x28')](function(_0x5f6b71){if(_0x5f6b71){return _0x5f6b71['removeAgents'](_0x201e5c[_0x8ee7('0x36')]['ids'])[_0x8ee7('0x28')](function(){if(_[_0x8ee7('0x83')](_0x201e5c['query'][_0x8ee7('0x64')])){for(var _0x52f3d0=0x0;_0x52f3d0<_0x201e5c[_0x8ee7('0x36')]['ids'][_0x8ee7('0x3b')];_0x52f3d0+=0x1){socket[_0x8ee7('0x6d')](_0x8ee7('0x7f'),{'UserId':Number(_0x201e5c[_0x8ee7('0x36')][_0x8ee7('0x64')][_0x52f3d0]),'OpenchannelQueueId':Number(_0x201e5c[_0x8ee7('0x49')]['id'])});}}else{socket[_0x8ee7('0x6d')](_0x8ee7('0x7f'),{'UserId':Number(_0x201e5c[_0x8ee7('0x36')]['ids']),'OpenchannelQueueId':Number(_0x201e5c[_0x8ee7('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x1164f6,null))[_0x8ee7('0x4b')](handleError(_0x1164f6,null));};exports[_0x8ee7('0x84')]=function(_0x425da8,_0x516e8a,_0x658f2f){var _0x98361e={};var _0x524264={};var _0x577bef;var _0x2b7099;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x425da8[_0x8ee7('0x49')]['id']}})[_0x8ee7('0x28')](handleEntityNotFound(_0x516e8a,null))['then'](function(_0xc262d5){if(_0xc262d5){_0x577bef=_0xc262d5;_0x524264['model']=_['keys'](db['User'][_0x8ee7('0x31')]);_0x524264[_0x8ee7('0x36')]=_[_0x8ee7('0x4a')](_0x425da8['query']);_0x524264[_0x8ee7('0x37')]=_[_0x8ee7('0x38')](_0x524264['model'],_0x524264[_0x8ee7('0x36')]);_0x98361e[_0x8ee7('0x39')]=_[_0x8ee7('0x38')](_0x524264['model'],qs['fields'](_0x425da8[_0x8ee7('0x36')][_0x8ee7('0x3a')]));_0x98361e[_0x8ee7('0x39')]=_0x98361e['attributes'][_0x8ee7('0x3b')]?_0x98361e[_0x8ee7('0x39')]:_0x524264['model'];_0x98361e[_0x8ee7('0x3e')]=qs['sort'](_0x425da8[_0x8ee7('0x36')]['sort']);_0x98361e[_0x8ee7('0x40')]=qs[_0x8ee7('0x37')](_[_0x8ee7('0x41')](_0x425da8[_0x8ee7('0x36')],_0x524264['filters']));if(_0x425da8[_0x8ee7('0x36')][_0x8ee7('0x43')]){_0x98361e[_0x8ee7('0x40')]=_['merge'](_0x98361e[_0x8ee7('0x40')],{'$or':_[_0x8ee7('0x30')](_0x98361e[_0x8ee7('0x39')],function(_0x2ba674){var _0x2d55ef={};_0x2d55ef[_0x2ba674]={'$like':'%'+_0x425da8[_0x8ee7('0x36')]['filter']+'%'};return _0x2d55ef;})});}_0x98361e=_[_0x8ee7('0x42')]({},_0x98361e,_0x425da8['options']);return _0x577bef[_0x8ee7('0x84')](_0x98361e);}})['then'](function(_0x4c4298){if(_0x4c4298){_0x2b7099=_0x4c4298[_0x8ee7('0x3b')];if(!_0x425da8[_0x8ee7('0x36')]['hasOwnProperty'](_0x8ee7('0x3d'))){_0x98361e[_0x8ee7('0x21')]=qs[_0x8ee7('0x21')](_0x425da8['query']['limit']);_0x98361e['offset']=qs[_0x8ee7('0x1f')](_0x425da8[_0x8ee7('0x36')][_0x8ee7('0x1f')]);}return _0x577bef[_0x8ee7('0x84')](_0x98361e);}})['then'](function(_0xe44d07){if(_0xe44d07){return _0xe44d07?{'count':_0x2b7099,'rows':_0xe44d07}:null;}})[_0x8ee7('0x28')](respondWithResult(_0x516e8a,null))[_0x8ee7('0x4b')](handleError(_0x516e8a,null));}; \ No newline at end of file +var _0x13f2=['params','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','OpenchannelQueue','include','findAll','rows','catch','show'];(function(_0x39d531,_0x2ddae0){var _0x170534=function(_0x263b1d){while(--_0x263b1d){_0x39d531['push'](_0x39d531['shift']());}};_0x170534(++_0x2ddae0);}(_0x13f2,0x1f4));var _0x213f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13f2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x213f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x213f('0x1'));var jsonpatch=require(_0x213f('0x2'));var rp=require(_0x213f('0x3'));var moment=require(_0x213f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x213f('0x5'));var path=require(_0x213f('0x6'));var sox=require('sox');var csv=require(_0x213f('0x7'));var ejs=require(_0x213f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x213f('0x9'));var squel=require(_0x213f('0xa'));var crypto=require('crypto');var jsforce=require(_0x213f('0xb'));var deskjs=require(_0x213f('0xc'));var toCsv=require(_0x213f('0x7'));var querystring=require(_0x213f('0xd'));var Papa=require(_0x213f('0xe'));var Redis=require(_0x213f('0xf'));var authService=require(_0x213f('0x10'));var qs=require(_0x213f('0x11'));var as=require(_0x213f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x213f('0x13'))(_0x213f('0x14'));var utils=require(_0x213f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x213f('0x16'));var db=require(_0x213f('0x17'))['db'];config[_0x213f('0x18')]=_['defaults'](config['redis'],{'host':_0x213f('0x19'),'port':0x18eb});var socket=require(_0x213f('0x1a'))(new Redis(config['redis']));require(_0x213f('0x1b'))[_0x213f('0x1c')](socket);function respondWithStatusCode(_0x4c2dd0,_0x4d7294){_0x4d7294=_0x4d7294||0xcc;return function(_0x3c5287){if(_0x3c5287){return _0x4c2dd0[_0x213f('0x1d')](_0x4d7294);}return _0x4c2dd0[_0x213f('0x1e')](_0x4d7294)[_0x213f('0x1f')]();};}function respondWithResult(_0x2788ad,_0x281dd4){_0x281dd4=_0x281dd4||0xc8;return function(_0x3e63c0){if(_0x3e63c0){return _0x2788ad[_0x213f('0x1e')](_0x281dd4)['json'](_0x3e63c0);}};}function respondWithFilteredResult(_0x2b17ca,_0xa5cc3){return function(_0x5da228){if(_0x5da228){var _0x1cf539=typeof _0xa5cc3['offset']==='undefined'&&typeof _0xa5cc3[_0x213f('0x20')]===_0x213f('0x21');var _0x510240=_0x5da228[_0x213f('0x22')];var _0x1e2d57=_0x1cf539?0x0:_0xa5cc3[_0x213f('0x23')];var _0x655d88=_0x1cf539?_0x5da228[_0x213f('0x22')]:_0xa5cc3[_0x213f('0x23')]+_0xa5cc3[_0x213f('0x20')];var _0x1eb4d6;if(_0x655d88>=_0x510240){_0x655d88=_0x510240;_0x1eb4d6=0xc8;}else{_0x1eb4d6=0xce;}_0x2b17ca[_0x213f('0x1e')](_0x1eb4d6);return _0x2b17ca[_0x213f('0x24')](_0x213f('0x25'),_0x1e2d57+'-'+_0x655d88+'/'+_0x510240)[_0x213f('0x26')](_0x5da228);}return null;};}function patchUpdates(_0x239b41){return function(_0x373458){try{jsonpatch[_0x213f('0x27')](_0x373458,_0x239b41,!![]);}catch(_0x123c2d){return BPromise[_0x213f('0x28')](_0x123c2d);}return _0x373458[_0x213f('0x29')]();};}function saveUpdates(_0x40d244,_0x13fce9){return function(_0x4c99f5){if(_0x4c99f5){return _0x4c99f5['update'](_0x40d244)[_0x213f('0x2a')](function(_0x28e688){return _0x28e688;});}return null;};}function removeEntity(_0x28bbe6,_0x4bc0d8){return function(_0x1396ff){if(_0x1396ff){return _0x1396ff['destroy']()[_0x213f('0x2a')](function(){var _0x51b4fa=_0x1396ff['get']({'plain':!![]});var _0x8634f6=_0x213f('0x2b');return db[_0x213f('0x2c')][_0x213f('0x2d')]({'where':{'type':_0x8634f6,'resourceId':_0x51b4fa['id']}})[_0x213f('0x2a')](function(){return _0x1396ff;});})['then'](function(){_0x28bbe6['status'](0xcc)[_0x213f('0x1f')]();});}};}function handleEntityNotFound(_0x3b9da5,_0x446331){return function(_0x5c0589){if(!_0x5c0589){_0x3b9da5['sendStatus'](0x194);}return _0x5c0589;};}function handleError(_0x5959a1,_0x14f076){_0x14f076=_0x14f076||0x1f4;return function(_0x175b50){logger[_0x213f('0x2e')](_0x175b50[_0x213f('0x2f')]);if(_0x175b50['name']){delete _0x175b50[_0x213f('0x30')];}_0x5959a1[_0x213f('0x1e')](_0x14f076)[_0x213f('0x31')](_0x175b50);};}exports[_0x213f('0x32')]=function(_0x162beb,_0x3cde20){var _0x334cf5={},_0x5de849={},_0x3aa1f3={'count':0x0,'rows':[]};var _0x57007e=_[_0x213f('0x33')](db['OpenchannelQueue'][_0x213f('0x34')],function(_0x58f84a){return{'name':_0x58f84a['fieldName'],'type':_0x58f84a[_0x213f('0x35')]['key']};});_0x5de849[_0x213f('0x36')]=_[_0x213f('0x33')](_0x57007e,'name');_0x5de849['query']=_[_0x213f('0x37')](_0x162beb[_0x213f('0x38')]);_0x5de849[_0x213f('0x39')]=_['intersection'](_0x5de849[_0x213f('0x36')],_0x5de849[_0x213f('0x38')]);_0x334cf5['attributes']=_[_0x213f('0x3a')](_0x5de849[_0x213f('0x36')],qs['fields'](_0x162beb[_0x213f('0x38')][_0x213f('0x3b')]));_0x334cf5[_0x213f('0x3c')]=_0x334cf5['attributes'][_0x213f('0x3d')]?_0x334cf5[_0x213f('0x3c')]:_0x5de849[_0x213f('0x36')];if(!_0x162beb[_0x213f('0x38')][_0x213f('0x3e')](_0x213f('0x3f'))){_0x334cf5['limit']=qs[_0x213f('0x20')](_0x162beb[_0x213f('0x38')][_0x213f('0x20')]);_0x334cf5[_0x213f('0x23')]=qs['offset'](_0x162beb[_0x213f('0x38')][_0x213f('0x23')]);}_0x334cf5[_0x213f('0x40')]=qs[_0x213f('0x41')](_0x162beb[_0x213f('0x38')][_0x213f('0x41')]);_0x334cf5[_0x213f('0x42')]=qs[_0x213f('0x39')](_[_0x213f('0x43')](_0x162beb[_0x213f('0x38')],_0x5de849['filters']),_0x57007e);if(_0x162beb[_0x213f('0x38')][_0x213f('0x44')]){_0x334cf5[_0x213f('0x42')]=_[_0x213f('0x45')](_0x334cf5['where'],{'$or':_[_0x213f('0x33')](_0x57007e,function(_0x3a78dd){if(_0x3a78dd[_0x213f('0x35')]!=='VIRTUAL'){var _0x590440={};_0x590440[_0x3a78dd[_0x213f('0x30')]]={'$like':'%'+_0x162beb['query'][_0x213f('0x44')]+'%'};return _0x590440;}})});}_0x334cf5=_['merge']({},_0x334cf5,_0x162beb['options']);var _0x4ec291={'where':_0x334cf5[_0x213f('0x42')]};return db[_0x213f('0x46')][_0x213f('0x22')](_0x4ec291)[_0x213f('0x2a')](function(_0x51f27e){_0x3aa1f3[_0x213f('0x22')]=_0x51f27e;if(_0x162beb['query']['includeAll']){_0x334cf5[_0x213f('0x47')]=[{'all':!![]}];}return db[_0x213f('0x46')][_0x213f('0x48')](_0x334cf5);})[_0x213f('0x2a')](function(_0xcc4420){_0x3aa1f3[_0x213f('0x49')]=_0xcc4420;return _0x3aa1f3;})[_0x213f('0x2a')](respondWithFilteredResult(_0x3cde20,_0x334cf5))[_0x213f('0x4a')](handleError(_0x3cde20,null));};exports[_0x213f('0x4b')]=function(_0xd4eec4,_0x56ff8d){var _0x4cc351={'raw':!![],'where':{'id':_0xd4eec4[_0x213f('0x4c')]['id']}},_0x541577={};_0x541577[_0x213f('0x36')]=_[_0x213f('0x37')](db[_0x213f('0x46')][_0x213f('0x34')]);_0x541577[_0x213f('0x38')]=_[_0x213f('0x37')](_0xd4eec4['query']);_0x541577[_0x213f('0x39')]=_[_0x213f('0x3a')](_0x541577[_0x213f('0x36')],_0x541577[_0x213f('0x38')]);_0x4cc351['attributes']=_[_0x213f('0x3a')](_0x541577[_0x213f('0x36')],qs['fields'](_0xd4eec4['query']['fields']));_0x4cc351[_0x213f('0x3c')]=_0x4cc351[_0x213f('0x3c')][_0x213f('0x3d')]?_0x4cc351['attributes']:_0x541577[_0x213f('0x36')];if(_0xd4eec4[_0x213f('0x38')][_0x213f('0x4d')]){_0x4cc351[_0x213f('0x47')]=[{'all':!![]}];}_0x4cc351=_[_0x213f('0x45')]({},_0x4cc351,_0xd4eec4[_0x213f('0x4e')]);return db['OpenchannelQueue'][_0x213f('0x4f')](_0x4cc351)[_0x213f('0x2a')](handleEntityNotFound(_0x56ff8d,null))[_0x213f('0x2a')](respondWithResult(_0x56ff8d,null))[_0x213f('0x4a')](handleError(_0x56ff8d,null));};exports[_0x213f('0x50')]=function(_0x51da1a,_0x3ff5b1){return db[_0x213f('0x46')][_0x213f('0x50')](_0x51da1a['body'],{})['then'](function(_0x4b713a){var _0x289f9c=_0x51da1a[_0x213f('0x51')][_0x213f('0x52')]({'plain':!![]});if(!_0x289f9c)throw new Error(_0x213f('0x53'));if(_0x289f9c[_0x213f('0x54')]===_0x213f('0x51')){var _0x129cb8=_0x4b713a[_0x213f('0x52')]({'plain':!![]});var _0x2da621=_0x213f('0x2b');return db[_0x213f('0x55')][_0x213f('0x4f')]({'where':{'name':_0x2da621,'userProfileId':_0x289f9c[_0x213f('0x56')]},'raw':!![]})[_0x213f('0x2a')](function(_0x44600c){if(_0x44600c&&_0x44600c[_0x213f('0x57')]===0x0){return db[_0x213f('0x2c')][_0x213f('0x50')]({'name':_0x129cb8[_0x213f('0x30')],'resourceId':_0x129cb8['id'],'type':_0x44600c['name'],'sectionId':_0x44600c['id']},{})['then'](function(){return _0x4b713a;});}else{return _0x4b713a;}})[_0x213f('0x4a')](function(_0x5070db){logger[_0x213f('0x2e')](_0x213f('0x58'),_0x5070db);throw _0x5070db;});}return _0x4b713a;})[_0x213f('0x2a')](respondWithResult(_0x3ff5b1,0xc9))[_0x213f('0x4a')](handleError(_0x3ff5b1,null));};exports[_0x213f('0x59')]=function(_0x37c5f1,_0x454be6){if(_0x37c5f1[_0x213f('0x5a')]['id']){delete _0x37c5f1[_0x213f('0x5a')]['id'];}return db[_0x213f('0x46')][_0x213f('0x4f')]({'where':{'id':_0x37c5f1[_0x213f('0x4c')]['id']}})[_0x213f('0x2a')](handleEntityNotFound(_0x454be6,null))[_0x213f('0x2a')](saveUpdates(_0x37c5f1[_0x213f('0x5a')],null))[_0x213f('0x2a')](respondWithResult(_0x454be6,null))['catch'](handleError(_0x454be6,null));};exports[_0x213f('0x2d')]=function(_0x48a858,_0x2753fb){return db['OpenchannelQueue'][_0x213f('0x4f')]({'where':{'id':_0x48a858[_0x213f('0x4c')]['id']}})[_0x213f('0x2a')](handleEntityNotFound(_0x2753fb,null))[_0x213f('0x2a')](removeEntity(_0x2753fb,null))['catch'](handleError(_0x2753fb,null));};exports[_0x213f('0x5b')]=function(_0x3c0a4b,_0x1969b7){return db[_0x213f('0x46')][_0x213f('0x5b')]()[_0x213f('0x2a')](respondWithResult(_0x1969b7,null))['catch'](handleError(_0x1969b7,null));};exports[_0x213f('0x5c')]=function(_0x3d0a91,_0x456d21,_0x21f415){var _0x3bd941={'raw':!![],'where':{}},_0xd1b22d={},_0x460b89;return db['OpenchannelQueue'][_0x213f('0x5d')]({'where':{'id':_0x3d0a91[_0x213f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x456d21,null))[_0x213f('0x2a')](function(_0x48de25){if(_0x48de25){_0x460b89=_0x48de25[_0x213f('0x52')]({'plain':!![]});_0xd1b22d['model']=_[_0x213f('0x37')](db[_0x213f('0x5e')][_0x213f('0x34')]);_0xd1b22d[_0x213f('0x38')]=_['keys'](_0x3d0a91['query']);_0xd1b22d['filters']=_[_0x213f('0x3a')](_0xd1b22d[_0x213f('0x36')],_0xd1b22d[_0x213f('0x38')]);_0x3bd941[_0x213f('0x3c')]=_['intersection'](_0xd1b22d[_0x213f('0x36')],qs[_0x213f('0x3b')](_0x3d0a91[_0x213f('0x38')][_0x213f('0x3b')]));_0x3bd941[_0x213f('0x3c')]=_0x3bd941[_0x213f('0x3c')]['length']?_0x3bd941[_0x213f('0x3c')]:_0xd1b22d[_0x213f('0x36')];if(!_0x3d0a91[_0x213f('0x38')]['hasOwnProperty']('nolimit')){_0x3bd941[_0x213f('0x20')]=qs['limit'](_0x3d0a91[_0x213f('0x38')][_0x213f('0x20')]);_0x3bd941[_0x213f('0x23')]=qs[_0x213f('0x23')](_0x3d0a91[_0x213f('0x38')]['offset']);}_0x3bd941[_0x213f('0x40')]=qs[_0x213f('0x41')](_0x3d0a91[_0x213f('0x38')][_0x213f('0x41')]);_0x3bd941['where']=qs[_0x213f('0x39')](_[_0x213f('0x43')](_0x3d0a91[_0x213f('0x38')],_0xd1b22d[_0x213f('0x39')]));_0x3bd941[_0x213f('0x42')][_0x213f('0x5f')]=_0x48de25['id'];if(_0x3d0a91['query']['filter']){_0x3bd941[_0x213f('0x42')]=_['merge'](_0x3bd941[_0x213f('0x42')],{'$or':_[_0x213f('0x33')](_0x3bd941[_0x213f('0x3c')],function(_0x7f5452){var _0x44a703={};_0x44a703[_0x7f5452]={'$like':'%'+_0x3d0a91[_0x213f('0x38')][_0x213f('0x44')]+'%'};return _0x44a703;})});}_0x3bd941=_[_0x213f('0x45')]({},_0x3bd941,_0x3d0a91['options']);return db[_0x213f('0x5e')][_0x213f('0x48')](_0x3bd941);}})[_0x213f('0x2a')](function(_0x2c147c){if(_0x2c147c){return db[_0x213f('0x60')][_0x213f('0x61')]({'where':{'id':_['map'](_0x2c147c,'UserId'),'role':_0x213f('0x62')},'attributes':['id','name',_0x213f('0x63'),_0x213f('0x64'),_0x213f('0x65')]});}})['then'](function(_0x23d0a1){if(_0x23d0a1){return{'count':_0x23d0a1['count'],'rows':_[_0x213f('0x33')](_0x23d0a1['rows'],function(_0x1b25ee){return{'membername':_0x1b25ee['name'],'UserId':_0x1b25ee['id'],'queue_name':_0x460b89[_0x213f('0x30')],'OpenchannelQueueId':_0x460b89['id'],'interface':util['format'](_0x213f('0x66'),_0x213f('0x67'),_0x1b25ee[_0x213f('0x30')]),'penalty':0x0,'paused':_0x1b25ee[_0x213f('0x63')],'createdAt':_0x1b25ee[_0x213f('0x65')],'updatedAt':_0x1b25ee[_0x213f('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x213f('0x2a')](respondWithFilteredResult(_0x456d21,_0x3bd941))[_0x213f('0x4a')](handleError(_0x456d21,null));};exports[_0x213f('0x68')]=function(_0x26c72e,_0x2b64b6,_0x433b10){var _0x4e0103={};var _0x16656e={};var _0x493266;var _0x59e93e;return db[_0x213f('0x46')][_0x213f('0x5d')]({'where':{'id':_0x26c72e[_0x213f('0x4c')]['id']}})[_0x213f('0x2a')](handleEntityNotFound(_0x2b64b6,null))[_0x213f('0x2a')](function(_0x17a5aa){if(_0x17a5aa){_0x493266=_0x17a5aa;_0x16656e['model']=_[_0x213f('0x37')](db[_0x213f('0x69')][_0x213f('0x34')]);_0x16656e[_0x213f('0x38')]=_[_0x213f('0x37')](_0x26c72e[_0x213f('0x38')]);_0x16656e[_0x213f('0x39')]=_[_0x213f('0x3a')](_0x16656e[_0x213f('0x36')],_0x16656e[_0x213f('0x38')]);_0x4e0103[_0x213f('0x3c')]=_[_0x213f('0x3a')](_0x16656e[_0x213f('0x36')],qs['fields'](_0x26c72e[_0x213f('0x38')]['fields']));_0x4e0103[_0x213f('0x3c')]=_0x4e0103[_0x213f('0x3c')][_0x213f('0x3d')]?_0x4e0103[_0x213f('0x3c')]:_0x16656e['model'];_0x4e0103[_0x213f('0x40')]=qs[_0x213f('0x41')](_0x26c72e[_0x213f('0x38')]['sort']);_0x4e0103['where']=qs[_0x213f('0x39')](_[_0x213f('0x43')](_0x26c72e['query'],_0x16656e['filters']));if(_0x26c72e[_0x213f('0x38')][_0x213f('0x44')]){_0x4e0103[_0x213f('0x42')]=_[_0x213f('0x45')](_0x4e0103[_0x213f('0x42')],{'$or':_[_0x213f('0x33')](_0x4e0103[_0x213f('0x3c')],function(_0x30f5c6){var _0x16c312={};_0x16c312[_0x30f5c6]={'$like':'%'+_0x26c72e[_0x213f('0x38')][_0x213f('0x44')]+'%'};return _0x16c312;})});}_0x4e0103=_[_0x213f('0x45')]({},_0x4e0103,_0x26c72e['options']);return _0x493266[_0x213f('0x68')](_0x4e0103);}})[_0x213f('0x2a')](function(_0x411858){if(_0x411858){_0x59e93e=_0x411858[_0x213f('0x3d')];if(!_0x26c72e['query'][_0x213f('0x3e')]('nolimit')){_0x4e0103[_0x213f('0x20')]=qs[_0x213f('0x20')](_0x26c72e['query'][_0x213f('0x20')]);_0x4e0103[_0x213f('0x23')]=qs[_0x213f('0x23')](_0x26c72e[_0x213f('0x38')][_0x213f('0x23')]);}return _0x493266[_0x213f('0x68')](_0x4e0103);}})[_0x213f('0x2a')](function(_0x5d7c74){if(_0x5d7c74){return _0x5d7c74?{'count':_0x59e93e,'rows':_0x5d7c74}:null;}})[_0x213f('0x2a')](respondWithResult(_0x2b64b6,null))[_0x213f('0x4a')](handleError(_0x2b64b6,null));};exports[_0x213f('0x6a')]=function(_0x28b495,_0x49a994,_0x208928){var _0x4cb562=_0x28b495['body'][_0x213f('0x6b')];return db[_0x213f('0x69')]['findAll']({'where':{'id':_0x4cb562},'attributes':['id'],'include':[{'model':db[_0x213f('0x60')],'as':_0x213f('0x6c'),'attributes':['id',_0x213f('0x30'),'online',_0x213f('0x6d'),'interface'],'raw':!![]}]})[_0x213f('0x2a')](function(_0x1d2789){if(_0x1d2789){var _0x2355c0=_[_0x213f('0x6e')](_0x1d2789,function(_0x2bac9f){var _0x26434e=_0x2bac9f['get']({'plain':!![]});return _0x26434e[_0x213f('0x6c')];});return db[_0x213f('0x46')][_0x213f('0x4f')]({'where':{'id':_0x28b495[_0x213f('0x4c')]['id']}})[_0x213f('0x2a')](function(_0x402cf5){return db[_0x213f('0x6f')][_0x213f('0x70')](function(_0xc0f0cb){return _0x402cf5[_0x213f('0x6a')](_0x4cb562,{'transaction':_0xc0f0cb})[_0x213f('0x2a')](function(){return BPromise[_0x213f('0x71')](_0x2355c0,function(_0x4d4123){return db['UserOpenchannelQueue'][_0x213f('0x72')]({'where':{'UserId':_0x4d4123['id'],'OpenchannelQueueId':_0x28b495['params']['id']},'transaction':_0xc0f0cb});});})[_0x213f('0x2a')](function(){_0x2355c0[_0x213f('0x73')](function(_0x47be44){socket[_0x213f('0x74')](_0x213f('0x75'),{'UserId':_0x47be44['id'],'OpenchannelQueueId':_0x402cf5['id']});});});});});}})[_0x213f('0x2a')](respondWithStatusCode(_0x49a994,null))[_0x213f('0x4a')](handleError(_0x49a994,null));};exports[_0x213f('0x76')]=function(_0x5dc902,_0x150cd2,_0x288272){return db[_0x213f('0x69')][_0x213f('0x48')]({'where':{'id':_0x5dc902[_0x213f('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x213f('0x60')],'as':_0x213f('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x150cd2,null))[_0x213f('0x2a')](function(_0x118166){var _0xd79c8d=_[_0x213f('0x33')](_0x118166,'id');var _0x4e79c6=[];var _0x58f0ee=[];var _0x1bec96=squel[_0x213f('0x77')]();_0x1bec96[_0x213f('0x78')]('tq.TeamId')[_0x213f('0x79')](_0x213f('0x7a'),'tq')[_0x213f('0x7b')]('user_has_teams','ut',_0x213f('0x7c'))['where'](_0x213f('0x7d'),_0x5dc902[_0x213f('0x4c')]['id']);for(var _0x425b4e=0x0;_0x425b4e<_0x118166['length'];_0x425b4e+=0x1){let _0x133e07=_0x118166[_0x425b4e];for(var _0x829363=0x0;_0x829363<_0x133e07[_0x213f('0x6c')][_0x213f('0x3d')];_0x829363+=0x1){let _0x321092=_0x133e07[_0x213f('0x6c')][_0x829363];var _0x3d6f6a=_0x1bec96['clone']();_0x3d6f6a[_0x213f('0x42')](_0x213f('0x7e'),_0x321092['id']);_0x58f0ee[_0x213f('0x7f')](db[_0x213f('0x6f')][_0x213f('0x38')](_0x3d6f6a[_0x213f('0x80')](),{'type':db[_0x213f('0x6f')][_0x213f('0x81')][_0x213f('0x82')]})['then'](function(_0xd007b6){if(_0xd007b6['length']===0x1){return _0x321092['id'];}else{var _0x589f9a=_[_0x213f('0x83')](_[_0x213f('0x33')](_0xd007b6,'TeamId'),function(_0x504a8f){return _[_0x213f('0x84')](_0xd79c8d,_0x504a8f);});if(_0x589f9a){return _0x321092['id'];}}}));}}return BPromise[_0x213f('0x85')](_0x58f0ee)[_0x213f('0x2a')](function(_0x2319fa){_0x4e79c6=_(_0x4e79c6)[_0x213f('0x86')](_0x2319fa)[_0x213f('0x87')]()[_0x213f('0x88')]();return db[_0x213f('0x46')][_0x213f('0x4f')]({'where':{'id':_0x5dc902[_0x213f('0x4c')]['id']}})['then'](function(_0x2b9016){return db[_0x213f('0x6f')][_0x213f('0x70')](function(_0x2d0832){return _0x2b9016['removeTeams'](_0x5dc902[_0x213f('0x38')][_0x213f('0x6b')],{'transaction':_0x2d0832})[_0x213f('0x2a')](function(){if(!_[_0x213f('0x89')](_0x4e79c6)){return _0x2b9016['removeAgents'](_0x4e79c6,{'transaction':_0x2d0832});}})[_0x213f('0x2a')](function(){_0x4e79c6[_0x213f('0x73')](function(_0xe15ebb){socket[_0x213f('0x74')](_0x213f('0x8a'),{'UserId':_0xe15ebb,'OpenchannelQueueId':_0x2b9016['id']});});});});});});})[_0x213f('0x2a')](respondWithStatusCode(_0x150cd2,null))[_0x213f('0x4a')](handleError(_0x150cd2,null));};exports[_0x213f('0x8b')]=function(_0x28f1ed,_0xeb7a88,_0x25d1ef){return db[_0x213f('0x46')]['find']({'where':{'id':_0x28f1ed[_0x213f('0x4c')]['id']}})[_0x213f('0x2a')](handleEntityNotFound(_0xeb7a88,null))[_0x213f('0x2a')](function(_0x44c440){if(_0x44c440){return _0x44c440[_0x213f('0x8b')](_0x28f1ed[_0x213f('0x5a')][_0x213f('0x6b')],_[_0x213f('0x8c')](_0x28f1ed[_0x213f('0x5a')],[_0x213f('0x6b'),'id'])||{})['spread'](function(_0x2aa15b){for(var _0x57e835=0x0;_0x57e835<_0x28f1ed[_0x213f('0x5a')]['ids']['length'];_0x57e835+=0x1){socket['emit'](_0x213f('0x75'),{'UserId':Number(_0x28f1ed[_0x213f('0x5a')]['ids'][_0x57e835]),'OpenchannelQueueId':Number(_0x28f1ed['params']['id'])});}return _0x2aa15b;});}})[_0x213f('0x2a')](respondWithResult(_0xeb7a88,null))[_0x213f('0x4a')](handleError(_0xeb7a88,null));};exports['removeAgents']=function(_0x37aba,_0x5eea4a,_0x34a16c){return db[_0x213f('0x46')]['find']({'where':{'id':_0x37aba[_0x213f('0x4c')]['id']}})[_0x213f('0x2a')](handleEntityNotFound(_0x5eea4a,null))['then'](function(_0x496b8d){if(_0x496b8d){return _0x496b8d[_0x213f('0x8d')](_0x37aba[_0x213f('0x38')][_0x213f('0x6b')])[_0x213f('0x2a')](function(){if(_[_0x213f('0x8e')](_0x37aba[_0x213f('0x38')][_0x213f('0x6b')])){for(var _0x51ce4b=0x0;_0x51ce4b<_0x37aba[_0x213f('0x38')][_0x213f('0x6b')]['length'];_0x51ce4b+=0x1){socket[_0x213f('0x74')](_0x213f('0x8a'),{'UserId':Number(_0x37aba[_0x213f('0x38')]['ids'][_0x51ce4b]),'OpenchannelQueueId':Number(_0x37aba['params']['id'])});}}else{socket[_0x213f('0x74')](_0x213f('0x8a'),{'UserId':Number(_0x37aba[_0x213f('0x38')][_0x213f('0x6b')]),'OpenchannelQueueId':Number(_0x37aba[_0x213f('0x4c')]['id'])});}});}})[_0x213f('0x2a')](respondWithStatusCode(_0x5eea4a,null))[_0x213f('0x4a')](handleError(_0x5eea4a,null));};exports[_0x213f('0x8f')]=function(_0x42841c,_0x43fd1c,_0x5eb628){var _0xa5cf0d={};var _0x4d9dd8={};var _0x13b13c;var _0x3787ba;return db[_0x213f('0x46')][_0x213f('0x5d')]({'where':{'id':_0x42841c[_0x213f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43fd1c,null))[_0x213f('0x2a')](function(_0x23902c){if(_0x23902c){_0x13b13c=_0x23902c;_0x4d9dd8[_0x213f('0x36')]=_[_0x213f('0x37')](db[_0x213f('0x60')][_0x213f('0x34')]);_0x4d9dd8[_0x213f('0x38')]=_[_0x213f('0x37')](_0x42841c[_0x213f('0x38')]);_0x4d9dd8['filters']=_[_0x213f('0x3a')](_0x4d9dd8['model'],_0x4d9dd8['query']);_0xa5cf0d['attributes']=_[_0x213f('0x3a')](_0x4d9dd8[_0x213f('0x36')],qs[_0x213f('0x3b')](_0x42841c[_0x213f('0x38')]['fields']));_0xa5cf0d[_0x213f('0x3c')]=_0xa5cf0d['attributes']['length']?_0xa5cf0d[_0x213f('0x3c')]:_0x4d9dd8[_0x213f('0x36')];_0xa5cf0d[_0x213f('0x40')]=qs['sort'](_0x42841c[_0x213f('0x38')][_0x213f('0x41')]);_0xa5cf0d[_0x213f('0x42')]=qs['filters'](_[_0x213f('0x43')](_0x42841c['query'],_0x4d9dd8['filters']));if(_0x42841c[_0x213f('0x38')][_0x213f('0x44')]){_0xa5cf0d[_0x213f('0x42')]=_[_0x213f('0x45')](_0xa5cf0d[_0x213f('0x42')],{'$or':_[_0x213f('0x33')](_0xa5cf0d[_0x213f('0x3c')],function(_0x5a78d7){var _0x45ec5c={};_0x45ec5c[_0x5a78d7]={'$like':'%'+_0x42841c[_0x213f('0x38')][_0x213f('0x44')]+'%'};return _0x45ec5c;})});}_0xa5cf0d=_[_0x213f('0x45')]({},_0xa5cf0d,_0x42841c[_0x213f('0x4e')]);return _0x13b13c['getAgents'](_0xa5cf0d);}})['then'](function(_0x135f63){if(_0x135f63){_0x3787ba=_0x135f63[_0x213f('0x3d')];if(!_0x42841c['query'][_0x213f('0x3e')](_0x213f('0x3f'))){_0xa5cf0d[_0x213f('0x20')]=qs['limit'](_0x42841c[_0x213f('0x38')][_0x213f('0x20')]);_0xa5cf0d['offset']=qs['offset'](_0x42841c[_0x213f('0x38')][_0x213f('0x23')]);}return _0x13b13c[_0x213f('0x8f')](_0xa5cf0d);}})['then'](function(_0x1129d9){if(_0x1129d9){return _0x1129d9?{'count':_0x3787ba,'rows':_0x1129d9}:null;}})[_0x213f('0x2a')](respondWithResult(_0x43fd1c,null))[_0x213f('0x4a')](handleError(_0x43fd1c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1e6e51e..95eed1f 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 _0x8ffb=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x27b7e2,_0x5a5962){var _0x569227=function(_0x3e1a27){while(--_0x3e1a27){_0x27b7e2['push'](_0x27b7e2['shift']());}};_0x569227(++_0x5a5962);}(_0x8ffb,0x80));var _0xb8ff=function(_0x414949,_0x30373e){_0x414949=_0x414949-0x0;var _0x464232=_0x8ffb[_0x414949];return _0x464232;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xb8ff('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb8ff('0x1')](0x0);var events={'afterCreate':_0xb8ff('0x2'),'afterUpdate':'update','afterDestroy':_0xb8ff('0x3')};function emitEvent(_0x2b622c){return function(_0x273384,_0x4035b5,_0x3ce259){OpenchannelQueueEvents[_0xb8ff('0x4')](_0x2b622c+':'+_0x273384['id'],_0x273384);OpenchannelQueueEvents[_0xb8ff('0x4')](_0x2b622c,_0x273384);_0x3ce259(null);};}for(var e in events){if(events[_0xb8ff('0x5')](e)){var event=events[e];OpenchannelQueue[_0xb8ff('0x6')](e,emitEvent(event));}}module[_0xb8ff('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x4790=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x5bd0f1,_0x567887){var _0x17838c=function(_0xc89a6a){while(--_0xc89a6a){_0x5bd0f1['push'](_0x5bd0f1['shift']());}};_0x17838c(++_0x567887);}(_0x4790,0xe6));var _0x0479=function(_0x59bd64,_0x237f2b){_0x59bd64=_0x59bd64-0x0;var _0x378c0e=_0x4790[_0x59bd64];return _0x378c0e;};'use strict';var EventEmitter=require(_0x0479('0x0'));var OpenchannelQueue=require(_0x0479('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0479('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0479('0x3'),'afterDestroy':_0x0479('0x4')};function emitEvent(_0x1fc780){return function(_0x30b826,_0x389e38,_0x2d961b){OpenchannelQueueEvents[_0x0479('0x5')](_0x1fc780+':'+_0x30b826['id'],_0x30b826);OpenchannelQueueEvents[_0x0479('0x5')](_0x1fc780,_0x30b826);_0x2d961b(null);};}for(var e in events){if(events[_0x0479('0x6')](e)){var event=events[e];OpenchannelQueue[_0x0479('0x7')](e,emitEvent(event));}}module[_0x0479('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 731eee0..36ef98d 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 _0x83a7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','lodash','moment'];(function(_0x348f2f,_0x424682){var _0x1cce85=function(_0x21cacd){while(--_0x21cacd){_0x348f2f['push'](_0x348f2f['shift']());}};_0x1cce85(++_0x424682);}(_0x83a7,0x1e8));var _0x783a=function(_0x5ca604,_0x6a1229){_0x5ca604=_0x5ca604-0x0;var _0xdf7534=_0x83a7[_0x5ca604];return _0xdf7534;};'use strict';var _=require(_0x783a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x783a('0x1'));var BPromise=require(_0x783a('0x2'));var rp=require(_0x783a('0x3'));var fs=require('fs');var path=require(_0x783a('0x4'));var rimraf=require(_0x783a('0x5'));var config=require(_0x783a('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x783a('0x7')]=function(_0x46f667,_0x5fb506){return _0x46f667[_0x783a('0x8')](_0x783a('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5947=['./openchannelQueue.attributes','exports','OpenchannelQueue','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d2a0e,_0x20417a){var _0x505af3=function(_0x499169){while(--_0x499169){_0x4d2a0e['push'](_0x4d2a0e['shift']());}};_0x505af3(++_0x20417a);}(_0x5947,0x116));var _0x7594=function(_0x2c4bd0,_0x4a109f){_0x2c4bd0=_0x2c4bd0-0x0;var _0x24d436=_0x5947[_0x2c4bd0];return _0x24d436;};'use strict';var _=require(_0x7594('0x0'));var util=require(_0x7594('0x1'));var logger=require('../../config/logger')(_0x7594('0x2'));var moment=require('moment');var BPromise=require(_0x7594('0x3'));var rp=require(_0x7594('0x4'));var fs=require('fs');var path=require(_0x7594('0x5'));var rimraf=require(_0x7594('0x6'));var config=require(_0x7594('0x7'));var attributes=require(_0x7594('0x8'));module[_0x7594('0x9')]=function(_0x338641,_0x45baf1){return _0x338641['define'](_0x7594('0xa'),attributes,{'tableName':'openchannel_queues','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 0120f8e..71373e8 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 _0x32d8=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','options','raw','attributes','map','include','model','debug','ShowOpenchannelQueue','OpenchannelQueue','find','where','util','moment'];(function(_0xfca0bf,_0x8ac9f9){var _0xc72568=function(_0x4b4a90){while(--_0x4b4a90){_0xfca0bf['push'](_0xfca0bf['shift']());}};_0xc72568(++_0x8ac9f9);}(_0x32d8,0x70));var _0x832d=function(_0x3891de,_0x55cfe5){_0x3891de=_0x3891de-0x0;var _0x521696=_0x32d8[_0x3891de];return _0x521696;};'use strict';var _=require('lodash');var util=require(_0x832d('0x0'));var moment=require(_0x832d('0x1'));var BPromise=require(_0x832d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x832d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x832d('0x4'));var logger=require(_0x832d('0x5'))(_0x832d('0x6'));var config=require(_0x832d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x832d('0x8')][_0x832d('0x9')]({'port':0x232a});config[_0x832d('0xa')]=_[_0x832d('0xb')](config[_0x832d('0xa')],{'host':_0x832d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x832d('0xd'))['register'](socket);function respondWithRpcPromise(_0x3abc96,_0x4ccaa7,_0x5833e4){return new BPromise(function(_0x4ed276,_0x42d253){return client[_0x832d('0xe')](_0x3abc96,_0x5833e4)[_0x832d('0xf')](function(_0x2040db){logger[_0x832d('0x10')](_0x832d('0x11'),_0x4ccaa7,_0x832d('0x12'));logger['debug'](_0x832d('0x13'),_0x4ccaa7,'request\x20sent',JSON[_0x832d('0x14')](_0x2040db));if(_0x2040db[_0x832d('0x15')]){if(_0x2040db['error'][_0x832d('0x16')]===0x1f4){logger[_0x832d('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x4ccaa7,_0x2040db[_0x832d('0x15')]['message']);return _0x42d253(_0x2040db[_0x832d('0x15')][_0x832d('0x17')]);}logger[_0x832d('0x15')](_0x832d('0x11'),_0x4ccaa7,_0x2040db[_0x832d('0x15')][_0x832d('0x17')]);return _0x4ed276(_0x2040db[_0x832d('0x15')][_0x832d('0x17')]);}else{logger['info'](_0x832d('0x11'),_0x4ccaa7,_0x832d('0x12'));_0x4ed276(_0x2040db[_0x832d('0x18')]['message']);}})[_0x832d('0x19')](function(_0x44f98d){logger['error'](_0x832d('0x11'),_0x4ccaa7,_0x44f98d);_0x42d253(_0x44f98d);});});}exports[_0x832d('0x1a')]=function(_0x57aca6){var _0x4d0b4a=this;return new Promise(function(_0xe9e4de,_0x3800ef){return db['OpenchannelQueue']['findAll']({'raw':_0x57aca6[_0x832d('0x1b')]?_0x57aca6['options'][_0x832d('0x1c')]===undefined?!![]:![]:!![],'where':_0x57aca6['options']?_0x57aca6[_0x832d('0x1b')]['where']||null:null,'attributes':_0x57aca6[_0x832d('0x1b')]?_0x57aca6[_0x832d('0x1b')][_0x832d('0x1d')]||null:null,'limit':_0x57aca6[_0x832d('0x1b')]?_0x57aca6[_0x832d('0x1b')]['limit']||null:null,'include':_0x57aca6['options']?_0x57aca6['options']['include']?_[_0x832d('0x1e')](_0x57aca6[_0x832d('0x1b')][_0x832d('0x1f')],function(_0x10c5cf){return{'model':db[_0x10c5cf[_0x832d('0x20')]],'as':_0x10c5cf['as'],'attributes':_0x10c5cf['attributes'],'include':_0x10c5cf[_0x832d('0x1f')]?_['map'](_0x10c5cf[_0x832d('0x1f')],function(_0x585ee9){return{'model':db[_0x585ee9[_0x832d('0x20')]],'as':_0x585ee9['as'],'attributes':_0x585ee9['attributes'],'include':_0x585ee9[_0x832d('0x1f')]?_['map'](_0x585ee9['include'],function(_0x528492){return{'model':db[_0x528492[_0x832d('0x20')]],'as':_0x528492['as'],'attributes':_0x528492[_0x832d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c1d70){logger[_0x832d('0x10')](_0x832d('0x1a'),_0x57aca6);logger[_0x832d('0x21')](_0x832d('0x1a'),_0x57aca6,JSON[_0x832d('0x14')](_0x1c1d70));_0xe9e4de(_0x1c1d70);})['catch'](function(_0x580216){logger['error'](_0x832d('0x1a'),_0x580216[_0x832d('0x17')],_0x57aca6);_0x3800ef(_0x4d0b4a[_0x832d('0x15')](0x1f4,_0x580216['message']));});});};exports[_0x832d('0x22')]=function(_0x28f4ca){var _0x415021=this;return new Promise(function(_0x381efe,_0x5edc1b){return db[_0x832d('0x23')][_0x832d('0x24')]({'raw':_0x28f4ca[_0x832d('0x1b')]?_0x28f4ca[_0x832d('0x1b')][_0x832d('0x1c')]===undefined?!![]:![]:!![],'where':_0x28f4ca['options']?_0x28f4ca[_0x832d('0x1b')][_0x832d('0x25')]||null:null,'attributes':_0x28f4ca[_0x832d('0x1b')]?_0x28f4ca[_0x832d('0x1b')][_0x832d('0x1d')]||null:null,'include':_0x28f4ca['options']?_0x28f4ca[_0x832d('0x1b')][_0x832d('0x1f')]?_[_0x832d('0x1e')](_0x28f4ca[_0x832d('0x1b')][_0x832d('0x1f')],function(_0x5ce396){return{'model':db[_0x5ce396['model']],'as':_0x5ce396['as'],'attributes':_0x5ce396[_0x832d('0x1d')],'include':_0x5ce396['include']?_[_0x832d('0x1e')](_0x5ce396[_0x832d('0x1f')],function(_0x10e2b1){return{'model':db[_0x10e2b1[_0x832d('0x20')]],'as':_0x10e2b1['as'],'attributes':_0x10e2b1[_0x832d('0x1d')],'include':_0x10e2b1[_0x832d('0x1f')]?_[_0x832d('0x1e')](_0x10e2b1['include'],function(_0x2d6277){return{'model':db[_0x2d6277[_0x832d('0x20')]],'as':_0x2d6277['as'],'attributes':_0x2d6277['attributes']};}):[]};}):[]};}):[]:[]})[_0x832d('0xf')](function(_0x4c1fcf){logger[_0x832d('0x10')]('ShowOpenchannelQueue',_0x28f4ca);logger[_0x832d('0x21')](_0x832d('0x22'),_0x28f4ca,JSON[_0x832d('0x14')](_0x4c1fcf));_0x381efe(_0x4c1fcf);})[_0x832d('0x19')](function(_0x5e9c31){logger['error'](_0x832d('0x22'),_0x5e9c31[_0x832d('0x17')],_0x28f4ca);_0x5edc1b(_0x415021[_0x832d('0x15')](0x1f4,_0x5e9c31[_0x832d('0x17')]));});});}; \ No newline at end of file +var _0x60bd=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./openchannelQueue.socket','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','OpenchannelQueue','options','where','limit','include','map','model','attributes','GetOpenchannelQueue','find','ShowOpenchannelQueue','debug'];(function(_0x70ec7b,_0x48911a){var _0x29a226=function(_0x572978){while(--_0x572978){_0x70ec7b['push'](_0x70ec7b['shift']());}};_0x29a226(++_0x48911a);}(_0x60bd,0x197));var _0xd60b=function(_0x4fb13a,_0x7d53c){_0x4fb13a=_0x4fb13a-0x0;var _0x2a15e4=_0x60bd[_0x4fb13a];return _0x2a15e4;};'use strict';var _=require(_0xd60b('0x0'));var util=require('util');var moment=require(_0xd60b('0x1'));var BPromise=require(_0xd60b('0x2'));var rs=require(_0xd60b('0x3'));var fs=require('fs');var Redis=require(_0xd60b('0x4'));var db=require(_0xd60b('0x5'))['db'];var utils=require(_0xd60b('0x6'));var logger=require(_0xd60b('0x7'))(_0xd60b('0x8'));var config=require(_0xd60b('0x9'));var jayson=require(_0xd60b('0xa'));var client=jayson['client'][_0xd60b('0xb')]({'port':0x232a});config[_0xd60b('0xc')]=_['defaults'](config[_0xd60b('0xc')],{'host':_0xd60b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd60b('0xc')]));require(_0xd60b('0xe'))['register'](socket);function respondWithRpcPromise(_0x19eeb0,_0x26054a,_0x2952a7){return new BPromise(function(_0x527189,_0x58ea3a){return client['request'](_0x19eeb0,_0x2952a7)[_0xd60b('0xf')](function(_0x1e4b1d){logger[_0xd60b('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x26054a,_0xd60b('0x11'));logger['debug'](_0xd60b('0x12'),_0x26054a,'request\x20sent',JSON[_0xd60b('0x13')](_0x1e4b1d));if(_0x1e4b1d[_0xd60b('0x14')]){if(_0x1e4b1d['error'][_0xd60b('0x15')]===0x1f4){logger[_0xd60b('0x14')](_0xd60b('0x16'),_0x26054a,_0x1e4b1d['error']['message']);return _0x58ea3a(_0x1e4b1d[_0xd60b('0x14')][_0xd60b('0x17')]);}logger[_0xd60b('0x14')](_0xd60b('0x16'),_0x26054a,_0x1e4b1d[_0xd60b('0x14')]['message']);return _0x527189(_0x1e4b1d[_0xd60b('0x14')][_0xd60b('0x17')]);}else{logger[_0xd60b('0x10')](_0xd60b('0x16'),_0x26054a,_0xd60b('0x11'));_0x527189(_0x1e4b1d['result']['message']);}})[_0xd60b('0x18')](function(_0x575209){logger[_0xd60b('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x26054a,_0x575209);_0x58ea3a(_0x575209);});});}exports['GetOpenchannelQueue']=function(_0x56985c){var _0x5b1868=this;return new Promise(function(_0x5878ed,_0x466fa6){return db[_0xd60b('0x19')]['findAll']({'raw':_0x56985c['options']?_0x56985c[_0xd60b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x56985c[_0xd60b('0x1a')]?_0x56985c[_0xd60b('0x1a')][_0xd60b('0x1b')]||null:null,'attributes':_0x56985c['options']?_0x56985c['options']['attributes']||null:null,'limit':_0x56985c[_0xd60b('0x1a')]?_0x56985c[_0xd60b('0x1a')][_0xd60b('0x1c')]||null:null,'include':_0x56985c['options']?_0x56985c['options'][_0xd60b('0x1d')]?_[_0xd60b('0x1e')](_0x56985c[_0xd60b('0x1a')][_0xd60b('0x1d')],function(_0x212953){return{'model':db[_0x212953[_0xd60b('0x1f')]],'as':_0x212953['as'],'attributes':_0x212953['attributes'],'include':_0x212953[_0xd60b('0x1d')]?_[_0xd60b('0x1e')](_0x212953['include'],function(_0x456d7a){return{'model':db[_0x456d7a[_0xd60b('0x1f')]],'as':_0x456d7a['as'],'attributes':_0x456d7a[_0xd60b('0x20')],'include':_0x456d7a[_0xd60b('0x1d')]?_[_0xd60b('0x1e')](_0x456d7a['include'],function(_0x4097d2){return{'model':db[_0x4097d2[_0xd60b('0x1f')]],'as':_0x4097d2['as'],'attributes':_0x4097d2['attributes']};}):[]};}):[]};}):[]:[]})[_0xd60b('0xf')](function(_0xc9f58a){logger[_0xd60b('0x10')](_0xd60b('0x21'),_0x56985c);logger['debug'](_0xd60b('0x21'),_0x56985c,JSON[_0xd60b('0x13')](_0xc9f58a));_0x5878ed(_0xc9f58a);})[_0xd60b('0x18')](function(_0x1ce766){logger[_0xd60b('0x14')](_0xd60b('0x21'),_0x1ce766[_0xd60b('0x17')],_0x56985c);_0x466fa6(_0x5b1868[_0xd60b('0x14')](0x1f4,_0x1ce766[_0xd60b('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x4a8919){var _0x191ed8=this;return new Promise(function(_0x3a1b74,_0x535955){return db[_0xd60b('0x19')][_0xd60b('0x22')]({'raw':_0x4a8919[_0xd60b('0x1a')]?_0x4a8919['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a8919[_0xd60b('0x1a')]?_0x4a8919[_0xd60b('0x1a')][_0xd60b('0x1b')]||null:null,'attributes':_0x4a8919[_0xd60b('0x1a')]?_0x4a8919['options'][_0xd60b('0x20')]||null:null,'include':_0x4a8919['options']?_0x4a8919[_0xd60b('0x1a')][_0xd60b('0x1d')]?_[_0xd60b('0x1e')](_0x4a8919[_0xd60b('0x1a')]['include'],function(_0x1fdbad){return{'model':db[_0x1fdbad[_0xd60b('0x1f')]],'as':_0x1fdbad['as'],'attributes':_0x1fdbad['attributes'],'include':_0x1fdbad[_0xd60b('0x1d')]?_[_0xd60b('0x1e')](_0x1fdbad[_0xd60b('0x1d')],function(_0x9a1cd5){return{'model':db[_0x9a1cd5[_0xd60b('0x1f')]],'as':_0x9a1cd5['as'],'attributes':_0x9a1cd5['attributes'],'include':_0x9a1cd5[_0xd60b('0x1d')]?_[_0xd60b('0x1e')](_0x9a1cd5[_0xd60b('0x1d')],function(_0x1193b2){return{'model':db[_0x1193b2['model']],'as':_0x1193b2['as'],'attributes':_0x1193b2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cf75f){logger[_0xd60b('0x10')](_0xd60b('0x23'),_0x4a8919);logger[_0xd60b('0x24')](_0xd60b('0x23'),_0x4a8919,JSON[_0xd60b('0x13')](_0x1cf75f));_0x3a1b74(_0x1cf75f);})['catch'](function(_0x18c8a9){logger['error'](_0xd60b('0x23'),_0x18c8a9[_0xd60b('0x17')],_0x4a8919);_0x535955(_0x191ed8[_0xd60b('0x14')](0x1f4,_0x18c8a9[_0xd60b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 839f961..9d5f2c3 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 _0x74ca=['length','./openchannelQueue.events','save','update','emit','removeListener','register'];(function(_0x494f9d,_0x3aa2cd){var _0x14a8e7=function(_0x57b6d8){while(--_0x57b6d8){_0x494f9d['push'](_0x494f9d['shift']());}};_0x14a8e7(++_0x3aa2cd);}(_0x74ca,0x86));var _0xa74c=function(_0x3584a7,_0x4cbc14){_0x3584a7=_0x3584a7-0x0;var _0x57b717=_0x74ca[_0x3584a7];return _0x57b717;};'use strict';var OpenchannelQueueEvents=require(_0xa74c('0x0'));var events=[_0xa74c('0x1'),'remove',_0xa74c('0x2')];function createListener(_0x1ea800,_0x1e5be7){return function(_0x3810dd){_0x1e5be7[_0xa74c('0x3')](_0x1ea800,_0x3810dd);};}function removeListener(_0x1377ca,_0x46c083){return function(){OpenchannelQueueEvents[_0xa74c('0x4')](_0x1377ca,_0x46c083);};}exports[_0xa74c('0x5')]=function(_0x51cc63){for(var _0xf19cb1=0x0,_0x4e9f5b=events[_0xa74c('0x6')];_0xf19cb1<_0x4e9f5b;_0xf19cb1++){var _0x30bc1c=events[_0xf19cb1];var _0x13a7ed=createListener('openchannelQueue:'+_0x30bc1c,_0x51cc63);OpenchannelQueueEvents['on'](_0x30bc1c,_0x13a7ed);}}; \ No newline at end of file +var _0xb045=['save','remove','update','emit','openchannelQueue:','./openchannelQueue.events'];(function(_0x11280c,_0x4e8f92){var _0x5999ac=function(_0x3fe60e){while(--_0x3fe60e){_0x11280c['push'](_0x11280c['shift']());}};_0x5999ac(++_0x4e8f92);}(_0xb045,0x1cd));var _0x5b04=function(_0x34a6e9,_0x25cabe){_0x34a6e9=_0x34a6e9-0x0;var _0x11015c=_0xb045[_0x34a6e9];return _0x11015c;};'use strict';var OpenchannelQueueEvents=require(_0x5b04('0x0'));var events=[_0x5b04('0x1'),_0x5b04('0x2'),_0x5b04('0x3')];function createListener(_0x2dddd8,_0x1c9123){return function(_0x41a7c0){_0x1c9123[_0x5b04('0x4')](_0x2dddd8,_0x41a7c0);};}function removeListener(_0x1ddf14,_0x868f84){return function(){OpenchannelQueueEvents['removeListener'](_0x1ddf14,_0x868f84);};}exports['register']=function(_0xbd94af){for(var _0x38a2ff=0x0,_0x12d697=events['length'];_0x38a2ff<_0x12d697;_0x38a2ff++){var _0x367687=events[_0x38a2ff];var _0x1d1f31=createListener(_0x5b04('0x5')+_0x367687,_0xbd94af);OpenchannelQueueEvents['on'](_0x367687,_0x1d1f31);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a96e7dc..b7b5f09 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 _0x2a1d=['describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2a1d,0x105));var _0xd2a1=function(_0x4d5ea5,_0x4b3420){_0x4d5ea5=_0x4d5ea5-0x0;var _0x245041=_0x2a1d[_0x4d5ea5];return _0x245041;};'use strict';var multer=require(_0xd2a1('0x0'));var util=require(_0xd2a1('0x1'));var path=require(_0xd2a1('0x2'));var timeout=require(_0xd2a1('0x3'));var express=require(_0xd2a1('0x4'));var router=express[_0xd2a1('0x5')]();var fs_extra=require(_0xd2a1('0x6'));var auth=require(_0xd2a1('0x7'));var interaction=require(_0xd2a1('0x8'));var config=require(_0xd2a1('0x9'));var controller=require(_0xd2a1('0xa'));router[_0xd2a1('0xb')]('/',auth['isAuthenticated'](),controller[_0xd2a1('0xc')]);router[_0xd2a1('0xb')](_0xd2a1('0xd'),auth[_0xd2a1('0xe')](),controller[_0xd2a1('0xf')]);router[_0xd2a1('0xb')](_0xd2a1('0x10'),auth[_0xd2a1('0xe')](),controller[_0xd2a1('0x11')]);router['post']('/',auth[_0xd2a1('0xe')](),controller[_0xd2a1('0x12')]);router[_0xd2a1('0x13')](_0xd2a1('0x10'),auth[_0xd2a1('0xe')](),controller[_0xd2a1('0x14')]);router['delete'](_0xd2a1('0x10'),auth[_0xd2a1('0xe')](),controller[_0xd2a1('0x15')]);module[_0xd2a1('0x16')]=router; \ No newline at end of file +var _0x3fbb=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','path'];(function(_0x86e4b2,_0x44d577){var _0x573e92=function(_0x33e7fd){while(--_0x33e7fd){_0x86e4b2['push'](_0x86e4b2['shift']());}};_0x573e92(++_0x44d577);}(_0x3fbb,0x12e));var _0xb3fb=function(_0x209f51,_0xb0a7a5){_0x209f51=_0x209f51-0x0;var _0x59dc5c=_0x3fbb[_0x209f51];return _0x59dc5c;};'use strict';var multer=require('multer');var util=require(_0xb3fb('0x0'));var path=require(_0xb3fb('0x1'));var timeout=require(_0xb3fb('0x2'));var express=require(_0xb3fb('0x3'));var router=express['Router']();var fs_extra=require(_0xb3fb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb3fb('0x5'));var config=require(_0xb3fb('0x6'));var controller=require(_0xb3fb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb3fb('0x8')]);router[_0xb3fb('0x9')]('/describe',auth[_0xb3fb('0xa')](),controller['describe']);router['get'](_0xb3fb('0xb'),auth[_0xb3fb('0xa')](),controller[_0xb3fb('0xc')]);router[_0xb3fb('0xd')]('/',auth[_0xb3fb('0xa')](),controller[_0xb3fb('0xe')]);router[_0xb3fb('0xf')](_0xb3fb('0xb'),auth['isAuthenticated'](),controller[_0xb3fb('0x10')]);router[_0xb3fb('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb3fb('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index d12dda5..0ea2e0f 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 _0xfa74=['exports','STRING','DATE'];(function(_0x537ba7,_0x57383f){var _0x273c3c=function(_0x2525af){while(--_0x2525af){_0x537ba7['push'](_0x537ba7['shift']());}};_0x273c3c(++_0x57383f);}(_0xfa74,0x1b0));var _0x4fa7=function(_0x1b6280,_0x4a51dd){_0x1b6280=_0x1b6280-0x0;var _0x3b634b=_0xfa74[_0x1b6280];return _0x3b634b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4fa7('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4fa7('0x1')]},'joinAt':{'type':Sequelize[_0x4fa7('0x2')]},'leaveAt':{'type':Sequelize[_0x4fa7('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4fa7('0x2')]},'reason':{'type':Sequelize[_0x4fa7('0x1')]}}; \ No newline at end of file +var _0x8781=['moment','sequelize','STRING','DATE'];(function(_0x4256b7,_0x376fa3){var _0x318d45=function(_0xa694ca){while(--_0xa694ca){_0x4256b7['push'](_0x4256b7['shift']());}};_0x318d45(++_0x376fa3);}(_0x8781,0x118));var _0x1878=function(_0x5f2b16,_0x3bfdf7){_0x5f2b16=_0x5f2b16-0x0;var _0x2c6fc6=_0x8781[_0x5f2b16];return _0x2c6fc6;};'use strict';var moment=require(_0x1878('0x0'));var Sequelize=require(_0x1878('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1878('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1878('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1878('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1878('0x3')]},'reason':{'type':Sequelize[_0x1878('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index d432bce..f187155 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 _0x73ee=['OpenchannelQueueReport','rawAttributes','type','map','name','keys','filters','intersection','model','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','length','include','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','error','send'];(function(_0xbaea7b,_0x24265c){var _0x52d24a=function(_0x14e2f2){while(--_0x14e2f2){_0xbaea7b['push'](_0xbaea7b['shift']());}};_0x52d24a(++_0x24265c);}(_0x73ee,0x139));var _0xe73e=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x73ee[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0xe73e('0x0'));var rimraf=require(_0xe73e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe73e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe73e('0x3'));var Mustache=require(_0xe73e('0x4'));var util=require('util');var path=require(_0xe73e('0x5'));var sox=require(_0xe73e('0x6'));var csv=require('to-csv');var ejs=require(_0xe73e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe73e('0x8'));var squel=require(_0xe73e('0x9'));var crypto=require(_0xe73e('0xa'));var jsforce=require(_0xe73e('0xb'));var deskjs=require(_0xe73e('0xc'));var toCsv=require(_0xe73e('0xd'));var querystring=require('querystring');var Papa=require(_0xe73e('0xe'));var Redis=require('ioredis');var authService=require(_0xe73e('0xf'));var qs=require(_0xe73e('0x10'));var as=require(_0xe73e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe73e('0x12'))(_0xe73e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe73e('0x14'));var db=require(_0xe73e('0x15'))['db'];function respondWithStatusCode(_0x656b12,_0xa72ec5){_0xa72ec5=_0xa72ec5||0xcc;return function(_0x1fd328){if(_0x1fd328){return _0x656b12[_0xe73e('0x16')](_0xa72ec5);}return _0x656b12[_0xe73e('0x17')](_0xa72ec5)[_0xe73e('0x18')]();};}function respondWithResult(_0x5f40d0,_0x112143){_0x112143=_0x112143||0xc8;return function(_0x5f2266){if(_0x5f2266){return _0x5f40d0[_0xe73e('0x17')](_0x112143)['json'](_0x5f2266);}};}function respondWithFilteredResult(_0x597cbe,_0x3d8a2a){return function(_0x10f644){if(_0x10f644){var _0x5735da=typeof _0x3d8a2a[_0xe73e('0x19')]===_0xe73e('0x1a')&&typeof _0x3d8a2a[_0xe73e('0x1b')]===_0xe73e('0x1a');var _0x203291=_0x10f644[_0xe73e('0x1c')];var _0x1136b4=_0x5735da?0x0:_0x3d8a2a[_0xe73e('0x19')];var _0x181072=_0x5735da?_0x10f644[_0xe73e('0x1c')]:_0x3d8a2a[_0xe73e('0x19')]+_0x3d8a2a['limit'];var _0x5a4420;if(_0x181072>=_0x203291){_0x181072=_0x203291;_0x5a4420=0xc8;}else{_0x5a4420=0xce;}_0x597cbe['status'](_0x5a4420);return _0x597cbe[_0xe73e('0x1d')]('Content-Range',_0x1136b4+'-'+_0x181072+'/'+_0x203291)['json'](_0x10f644);}return null;};}function patchUpdates(_0x309d83){return function(_0x273bbd){try{jsonpatch[_0xe73e('0x1e')](_0x273bbd,_0x309d83,!![]);}catch(_0x5ec8b4){return BPromise[_0xe73e('0x1f')](_0x5ec8b4);}return _0x273bbd[_0xe73e('0x20')]();};}function saveUpdates(_0x5322ac,_0x1275a3){return function(_0x54ea8e){if(_0x54ea8e){return _0x54ea8e[_0xe73e('0x21')](_0x5322ac)[_0xe73e('0x22')](function(_0x5706e2){return _0x5706e2;});}return null;};}function removeEntity(_0x3d43c2,_0x59ef6a){return function(_0x2c0198){if(_0x2c0198){return _0x2c0198['destroy']()[_0xe73e('0x22')](function(){_0x3d43c2[_0xe73e('0x17')](0xcc)[_0xe73e('0x18')]();});}};}function handleEntityNotFound(_0x471db4,_0x109886){return function(_0x1ab711){if(!_0x1ab711){_0x471db4[_0xe73e('0x16')](0x194);}return _0x1ab711;};}function handleError(_0x468def,_0x1c928e){_0x1c928e=_0x1c928e||0x1f4;return function(_0x4639d9){logger[_0xe73e('0x23')](_0x4639d9['stack']);if(_0x4639d9['name']){delete _0x4639d9['name'];}_0x468def[_0xe73e('0x17')](_0x1c928e)[_0xe73e('0x24')](_0x4639d9);};}exports['index']=function(_0x193c84,_0x55a87d){var _0x5c96ae={},_0x11d4b3={},_0x556365={'count':0x0,'rows':[]};var _0xf55475=_['map'](db[_0xe73e('0x25')][_0xe73e('0x26')],function(_0x378b4b){return{'name':_0x378b4b['fieldName'],'type':_0x378b4b[_0xe73e('0x27')]['key']};});_0x11d4b3['model']=_[_0xe73e('0x28')](_0xf55475,_0xe73e('0x29'));_0x11d4b3['query']=_[_0xe73e('0x2a')](_0x193c84['query']);_0x11d4b3[_0xe73e('0x2b')]=_[_0xe73e('0x2c')](_0x11d4b3[_0xe73e('0x2d')],_0x11d4b3['query']);_0x5c96ae[_0xe73e('0x2e')]=_['intersection'](_0x11d4b3[_0xe73e('0x2d')],qs['fields'](_0x193c84['query'][_0xe73e('0x2f')]));_0x5c96ae[_0xe73e('0x2e')]=_0x5c96ae[_0xe73e('0x2e')]['length']?_0x5c96ae[_0xe73e('0x2e')]:_0x11d4b3[_0xe73e('0x2d')];if(!_0x193c84[_0xe73e('0x30')][_0xe73e('0x31')](_0xe73e('0x32'))){_0x5c96ae[_0xe73e('0x1b')]=qs[_0xe73e('0x1b')](_0x193c84[_0xe73e('0x30')][_0xe73e('0x1b')]);_0x5c96ae[_0xe73e('0x19')]=qs[_0xe73e('0x19')](_0x193c84[_0xe73e('0x30')][_0xe73e('0x19')]);}_0x5c96ae[_0xe73e('0x33')]=qs['sort'](_0x193c84[_0xe73e('0x30')][_0xe73e('0x34')]);_0x5c96ae[_0xe73e('0x35')]=qs[_0xe73e('0x2b')](_[_0xe73e('0x36')](_0x193c84[_0xe73e('0x30')],_0x11d4b3[_0xe73e('0x2b')]),_0xf55475);if(_0x193c84[_0xe73e('0x30')][_0xe73e('0x37')]){_0x5c96ae[_0xe73e('0x35')]=_[_0xe73e('0x38')](_0x5c96ae[_0xe73e('0x35')],{'$or':_[_0xe73e('0x28')](_0xf55475,function(_0x229328){if(_0x229328[_0xe73e('0x27')]!=='VIRTUAL'){var _0x146458={};_0x146458[_0x229328[_0xe73e('0x29')]]={'$like':'%'+_0x193c84['query'][_0xe73e('0x37')]+'%'};return _0x146458;}})});}_0x5c96ae=_['merge']({},_0x5c96ae,_0x193c84[_0xe73e('0x39')]);var _0x2507a3={'where':_0x5c96ae[_0xe73e('0x35')]};return db[_0xe73e('0x25')][_0xe73e('0x1c')](_0x2507a3)[_0xe73e('0x22')](function(_0x4c5f38){_0x556365[_0xe73e('0x1c')]=_0x4c5f38;if(_0x193c84[_0xe73e('0x30')][_0xe73e('0x3a')]){_0x5c96ae['include']=[{'all':!![]}];}return db[_0xe73e('0x25')]['findAll'](_0x5c96ae);})[_0xe73e('0x22')](function(_0x33be46){_0x556365[_0xe73e('0x3b')]=_0x33be46;return _0x556365;})[_0xe73e('0x22')](respondWithFilteredResult(_0x55a87d,_0x5c96ae))[_0xe73e('0x3c')](handleError(_0x55a87d,null));};exports[_0xe73e('0x3d')]=function(_0x1771bc,_0x1518ea){var _0x3d38d4={'raw':!![],'where':{'id':_0x1771bc[_0xe73e('0x3e')]['id']}},_0x3bbf85={};_0x3bbf85['model']=_[_0xe73e('0x2a')](db[_0xe73e('0x25')][_0xe73e('0x26')]);_0x3bbf85[_0xe73e('0x30')]=_['keys'](_0x1771bc['query']);_0x3bbf85['filters']=_[_0xe73e('0x2c')](_0x3bbf85[_0xe73e('0x2d')],_0x3bbf85[_0xe73e('0x30')]);_0x3d38d4[_0xe73e('0x2e')]=_[_0xe73e('0x2c')](_0x3bbf85[_0xe73e('0x2d')],qs[_0xe73e('0x2f')](_0x1771bc[_0xe73e('0x30')][_0xe73e('0x2f')]));_0x3d38d4[_0xe73e('0x2e')]=_0x3d38d4[_0xe73e('0x2e')][_0xe73e('0x3f')]?_0x3d38d4[_0xe73e('0x2e')]:_0x3bbf85['model'];if(_0x1771bc['query'][_0xe73e('0x3a')]){_0x3d38d4[_0xe73e('0x40')]=[{'all':!![]}];}_0x3d38d4=_[_0xe73e('0x38')]({},_0x3d38d4,_0x1771bc['options']);return db[_0xe73e('0x25')]['find'](_0x3d38d4)[_0xe73e('0x22')](handleEntityNotFound(_0x1518ea,null))['then'](respondWithResult(_0x1518ea,null))['catch'](handleError(_0x1518ea,null));};exports[_0xe73e('0x41')]=function(_0x37cf4e,_0x5a10f8){return db[_0xe73e('0x25')][_0xe73e('0x41')](_0x37cf4e['body'],{})[_0xe73e('0x22')](respondWithResult(_0x5a10f8,0xc9))[_0xe73e('0x3c')](handleError(_0x5a10f8,null));};exports['update']=function(_0x25bdb4,_0x230a0f){if(_0x25bdb4[_0xe73e('0x42')]['id']){delete _0x25bdb4['body']['id'];}return db[_0xe73e('0x25')][_0xe73e('0x43')]({'where':{'id':_0x25bdb4['params']['id']}})['then'](handleEntityNotFound(_0x230a0f,null))[_0xe73e('0x22')](saveUpdates(_0x25bdb4[_0xe73e('0x42')],null))[_0xe73e('0x22')](respondWithResult(_0x230a0f,null))[_0xe73e('0x3c')](handleError(_0x230a0f,null));};exports[_0xe73e('0x44')]=function(_0x329e96,_0x46b2a8){return db[_0xe73e('0x25')][_0xe73e('0x43')]({'where':{'id':_0x329e96['params']['id']}})[_0xe73e('0x22')](handleEntityNotFound(_0x46b2a8,null))[_0xe73e('0x22')](removeEntity(_0x46b2a8,null))['catch'](handleError(_0x46b2a8,null));};exports['describe']=function(_0x5250f0,_0x5dc6a3){return db[_0xe73e('0x25')][_0xe73e('0x45')]()[_0xe73e('0x22')](respondWithResult(_0x5dc6a3,null))[_0xe73e('0x3c')](handleError(_0x5dc6a3,null));}; \ No newline at end of file +var _0xd751=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','send','index','map','OpenchannelQueueReport','fieldName','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','find','create','body','catch','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x2077c2,_0x5f57a3){var _0x34bb69=function(_0xaa8099){while(--_0xaa8099){_0x2077c2['push'](_0x2077c2['shift']());}};_0x34bb69(++_0x5f57a3);}(_0xd751,0x1ca));var _0x1d75=function(_0x335c52,_0x35cf47){_0x335c52=_0x335c52-0x0;var _0xcb9409=_0xd751[_0x335c52];return _0xcb9409;};'use strict';var emlformat=require(_0x1d75('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d75('0x1'));var jsonpatch=require(_0x1d75('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1d75('0x3'));var Mustache=require(_0x1d75('0x4'));var util=require(_0x1d75('0x5'));var path=require(_0x1d75('0x6'));var sox=require('sox');var csv=require(_0x1d75('0x7'));var ejs=require(_0x1d75('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d75('0x9'));var squel=require(_0x1d75('0xa'));var crypto=require(_0x1d75('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1d75('0xc'));var toCsv=require(_0x1d75('0x7'));var querystring=require(_0x1d75('0xd'));var Papa=require(_0x1d75('0xe'));var Redis=require(_0x1d75('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1d75('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d75('0x11'));var logger=require(_0x1d75('0x12'))(_0x1d75('0x13'));var utils=require(_0x1d75('0x14'));var config=require(_0x1d75('0x15'));var licenseUtil=require(_0x1d75('0x16'));var db=require(_0x1d75('0x17'))['db'];function respondWithStatusCode(_0x3b11e1,_0x3a09a2){_0x3a09a2=_0x3a09a2||0xcc;return function(_0x9b1911){if(_0x9b1911){return _0x3b11e1['sendStatus'](_0x3a09a2);}return _0x3b11e1[_0x1d75('0x18')](_0x3a09a2)['end']();};}function respondWithResult(_0x3c80f1,_0x23926a){_0x23926a=_0x23926a||0xc8;return function(_0x590d79){if(_0x590d79){return _0x3c80f1[_0x1d75('0x18')](_0x23926a)[_0x1d75('0x19')](_0x590d79);}};}function respondWithFilteredResult(_0x4f482b,_0x15b55d){return function(_0x5bed9a){if(_0x5bed9a){var _0x165f03=typeof _0x15b55d[_0x1d75('0x1a')]==='undefined'&&typeof _0x15b55d[_0x1d75('0x1b')]===_0x1d75('0x1c');var _0x35d73d=_0x5bed9a[_0x1d75('0x1d')];var _0x235241=_0x165f03?0x0:_0x15b55d['offset'];var _0x2a797f=_0x165f03?_0x5bed9a['count']:_0x15b55d[_0x1d75('0x1a')]+_0x15b55d[_0x1d75('0x1b')];var _0x32a4a7;if(_0x2a797f>=_0x35d73d){_0x2a797f=_0x35d73d;_0x32a4a7=0xc8;}else{_0x32a4a7=0xce;}_0x4f482b[_0x1d75('0x18')](_0x32a4a7);return _0x4f482b[_0x1d75('0x1e')](_0x1d75('0x1f'),_0x235241+'-'+_0x2a797f+'/'+_0x35d73d)[_0x1d75('0x19')](_0x5bed9a);}return null;};}function patchUpdates(_0x2f1221){return function(_0x2e5044){try{jsonpatch[_0x1d75('0x20')](_0x2e5044,_0x2f1221,!![]);}catch(_0x3fee64){return BPromise[_0x1d75('0x21')](_0x3fee64);}return _0x2e5044[_0x1d75('0x22')]();};}function saveUpdates(_0x5c6fe8,_0x135493){return function(_0x4aa12e){if(_0x4aa12e){return _0x4aa12e[_0x1d75('0x23')](_0x5c6fe8)['then'](function(_0x1a3b03){return _0x1a3b03;});}return null;};}function removeEntity(_0x55193f,_0x40c965){return function(_0x476d48){if(_0x476d48){return _0x476d48['destroy']()[_0x1d75('0x24')](function(){_0x55193f[_0x1d75('0x18')](0xcc)[_0x1d75('0x25')]();});}};}function handleEntityNotFound(_0x568d61,_0x574fe6){return function(_0x91cce6){if(!_0x91cce6){_0x568d61[_0x1d75('0x26')](0x194);}return _0x91cce6;};}function handleError(_0xcbd9fb,_0x59f96c){_0x59f96c=_0x59f96c||0x1f4;return function(_0x3cea68){logger[_0x1d75('0x27')](_0x3cea68['stack']);if(_0x3cea68[_0x1d75('0x28')]){delete _0x3cea68[_0x1d75('0x28')];}_0xcbd9fb['status'](_0x59f96c)[_0x1d75('0x29')](_0x3cea68);};}exports[_0x1d75('0x2a')]=function(_0x5709f6,_0x12e5ff){var _0x5a58a0={},_0x219b92={},_0x27807d={'count':0x0,'rows':[]};var _0x5685ac=_[_0x1d75('0x2b')](db[_0x1d75('0x2c')]['rawAttributes'],function(_0x337ad1){return{'name':_0x337ad1[_0x1d75('0x2d')],'type':_0x337ad1['type'][_0x1d75('0x2e')]};});_0x219b92['model']=_[_0x1d75('0x2b')](_0x5685ac,_0x1d75('0x28'));_0x219b92[_0x1d75('0x2f')]=_['keys'](_0x5709f6[_0x1d75('0x2f')]);_0x219b92[_0x1d75('0x30')]=_[_0x1d75('0x31')](_0x219b92['model'],_0x219b92[_0x1d75('0x2f')]);_0x5a58a0[_0x1d75('0x32')]=_[_0x1d75('0x31')](_0x219b92[_0x1d75('0x33')],qs[_0x1d75('0x34')](_0x5709f6['query'][_0x1d75('0x34')]));_0x5a58a0[_0x1d75('0x32')]=_0x5a58a0[_0x1d75('0x32')]['length']?_0x5a58a0[_0x1d75('0x32')]:_0x219b92[_0x1d75('0x33')];if(!_0x5709f6[_0x1d75('0x2f')][_0x1d75('0x35')](_0x1d75('0x36'))){_0x5a58a0[_0x1d75('0x1b')]=qs['limit'](_0x5709f6[_0x1d75('0x2f')][_0x1d75('0x1b')]);_0x5a58a0['offset']=qs['offset'](_0x5709f6[_0x1d75('0x2f')][_0x1d75('0x1a')]);}_0x5a58a0[_0x1d75('0x37')]=qs[_0x1d75('0x38')](_0x5709f6['query'][_0x1d75('0x38')]);_0x5a58a0[_0x1d75('0x39')]=qs[_0x1d75('0x30')](_[_0x1d75('0x3a')](_0x5709f6[_0x1d75('0x2f')],_0x219b92['filters']),_0x5685ac);if(_0x5709f6['query'][_0x1d75('0x3b')]){_0x5a58a0[_0x1d75('0x39')]=_[_0x1d75('0x3c')](_0x5a58a0[_0x1d75('0x39')],{'$or':_[_0x1d75('0x2b')](_0x5685ac,function(_0x1312e1){if(_0x1312e1[_0x1d75('0x3d')]!==_0x1d75('0x3e')){var _0x14761b={};_0x14761b[_0x1312e1[_0x1d75('0x28')]]={'$like':'%'+_0x5709f6[_0x1d75('0x2f')][_0x1d75('0x3b')]+'%'};return _0x14761b;}})});}_0x5a58a0=_['merge']({},_0x5a58a0,_0x5709f6[_0x1d75('0x3f')]);var _0x42c4a2={'where':_0x5a58a0[_0x1d75('0x39')]};return db[_0x1d75('0x2c')][_0x1d75('0x1d')](_0x42c4a2)[_0x1d75('0x24')](function(_0x123f08){_0x27807d[_0x1d75('0x1d')]=_0x123f08;if(_0x5709f6['query'][_0x1d75('0x40')]){_0x5a58a0[_0x1d75('0x41')]=[{'all':!![]}];}return db[_0x1d75('0x2c')][_0x1d75('0x42')](_0x5a58a0);})[_0x1d75('0x24')](function(_0xa8062a){_0x27807d[_0x1d75('0x43')]=_0xa8062a;return _0x27807d;})[_0x1d75('0x24')](respondWithFilteredResult(_0x12e5ff,_0x5a58a0))['catch'](handleError(_0x12e5ff,null));};exports[_0x1d75('0x44')]=function(_0x9670c5,_0x4a9c83){var _0x50d4f9={'raw':!![],'where':{'id':_0x9670c5[_0x1d75('0x45')]['id']}},_0x1fe90b={};_0x1fe90b[_0x1d75('0x33')]=_[_0x1d75('0x46')](db[_0x1d75('0x2c')][_0x1d75('0x47')]);_0x1fe90b[_0x1d75('0x2f')]=_[_0x1d75('0x46')](_0x9670c5[_0x1d75('0x2f')]);_0x1fe90b['filters']=_[_0x1d75('0x31')](_0x1fe90b[_0x1d75('0x33')],_0x1fe90b[_0x1d75('0x2f')]);_0x50d4f9['attributes']=_[_0x1d75('0x31')](_0x1fe90b[_0x1d75('0x33')],qs[_0x1d75('0x34')](_0x9670c5[_0x1d75('0x2f')][_0x1d75('0x34')]));_0x50d4f9[_0x1d75('0x32')]=_0x50d4f9[_0x1d75('0x32')][_0x1d75('0x48')]?_0x50d4f9[_0x1d75('0x32')]:_0x1fe90b['model'];if(_0x9670c5[_0x1d75('0x2f')][_0x1d75('0x40')]){_0x50d4f9[_0x1d75('0x41')]=[{'all':!![]}];}_0x50d4f9=_[_0x1d75('0x3c')]({},_0x50d4f9,_0x9670c5[_0x1d75('0x3f')]);return db[_0x1d75('0x2c')][_0x1d75('0x49')](_0x50d4f9)[_0x1d75('0x24')](handleEntityNotFound(_0x4a9c83,null))[_0x1d75('0x24')](respondWithResult(_0x4a9c83,null))['catch'](handleError(_0x4a9c83,null));};exports[_0x1d75('0x4a')]=function(_0x1c8674,_0x98152c){return db[_0x1d75('0x2c')]['create'](_0x1c8674[_0x1d75('0x4b')],{})[_0x1d75('0x24')](respondWithResult(_0x98152c,0xc9))[_0x1d75('0x4c')](handleError(_0x98152c,null));};exports['update']=function(_0x1979e8,_0x126bed){if(_0x1979e8[_0x1d75('0x4b')]['id']){delete _0x1979e8['body']['id'];}return db[_0x1d75('0x2c')][_0x1d75('0x49')]({'where':{'id':_0x1979e8[_0x1d75('0x45')]['id']}})['then'](handleEntityNotFound(_0x126bed,null))[_0x1d75('0x24')](saveUpdates(_0x1979e8[_0x1d75('0x4b')],null))[_0x1d75('0x24')](respondWithResult(_0x126bed,null))[_0x1d75('0x4c')](handleError(_0x126bed,null));};exports[_0x1d75('0x4d')]=function(_0x37b9f7,_0x4c9e74){return db[_0x1d75('0x2c')][_0x1d75('0x49')]({'where':{'id':_0x37b9f7[_0x1d75('0x45')]['id']}})[_0x1d75('0x24')](handleEntityNotFound(_0x4c9e74,null))['then'](removeEntity(_0x4c9e74,null))[_0x1d75('0x4c')](handleError(_0x4c9e74,null));};exports['describe']=function(_0x3561ef,_0x368b2c){return db[_0x1d75('0x2c')][_0x1d75('0x4e')]()['then'](respondWithResult(_0x368b2c,null))[_0x1d75('0x4c')](handleError(_0x368b2c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 66ce9b1..3bc4ebc 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x5c09a9,_0x59adbe){var _0x37934d=function(_0x5d18cf){while(--_0x5d18cf){_0x5c09a9['push'](_0x5c09a9['shift']());}};_0x37934d(++_0x59adbe);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d8aaa,_0x259e64){_0x4d8aaa=_0x4d8aaa-0x0;var _0x469abd=_0x2ef3[_0x4d8aaa];return _0x469abd;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0xbf84f7,_0x26643b){var _0x55ef36=function(_0x4a2338){while(--_0x4a2338){_0xbf84f7['push'](_0xbf84f7['shift']());}};_0x55ef36(++_0x26643b);}(_0x2ef3,0xba));var _0x32ef=function(_0xe2fac7,_0x4d96b0){_0xe2fac7=_0xe2fac7-0x0;var _0x3b0320=_0x2ef3[_0xe2fac7];return _0x3b0320;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('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 f4d44e4..fca43b3 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 _0x1c3d=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x3c3d15,_0x120d77){var _0x2145fa=function(_0x1a8336){while(--_0x1a8336){_0x3c3d15['push'](_0x3c3d15['shift']());}};_0x2145fa(++_0x120d77);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x1d3ece,_0x556172){_0x1d3ece=_0x1d3ece-0x0;var _0x2feba1=_0x1c3d[_0x1d3ece];return _0x2feba1;};'use strict';var _=require('lodash');var util=require(_0xd1c3('0x0'));var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1c3('0x5'))(_0xd1c3('0x6'));var config=require(_0xd1c3('0x7'));var jayson=require(_0xd1c3('0x8'));var client=jayson[_0xd1c3('0x9')][_0xd1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5adcb7,_0x398766,_0x420ab0){return new BPromise(function(_0x5db2f0,_0x1afc71){return client[_0xd1c3('0xb')](_0x5adcb7,_0x420ab0)[_0xd1c3('0xc')](function(_0x18556c){logger[_0xd1c3('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x398766,'request\x20sent');logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x398766,_0xd1c3('0x10'),JSON[_0xd1c3('0x11')](_0x18556c));if(_0x18556c[_0xd1c3('0x12')]){if(_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x18556c['error'][_0xd1c3('0x15')]);return _0x1afc71(_0x18556c['error']['message']);}logger[_0xd1c3('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x398766,_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x15')]);return _0x5db2f0(_0x18556c[_0xd1c3('0x12')]['message']);}else{logger[_0xd1c3('0xd')](_0xd1c3('0x14'),_0x398766,_0xd1c3('0x10'));_0x5db2f0(_0x18556c[_0xd1c3('0x16')][_0xd1c3('0x15')]);}})[_0xd1c3('0x17')](function(_0x586fa7){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x586fa7);_0x1afc71(_0x586fa7);});});}exports[_0xd1c3('0x18')]=function(_0x5d26c2){var _0x53a5e1=this;return new Promise(function(_0x14f6cb,_0x3a1a74){return db[_0xd1c3('0x19')][_0xd1c3('0x1a')](_0x5d26c2[_0xd1c3('0x1b')],{'raw':_0x5d26c2['options']?_0x5d26c2[_0xd1c3('0x1c')][_0xd1c3('0x1d')]===undefined?!![]:![]:!![]})[_0xd1c3('0xc')](function(_0x588f4e){logger['info'](_0xd1c3('0x18'),_0x5d26c2);logger[_0xd1c3('0xe')]('CreateOpenchannelQueueReport',_0x5d26c2,JSON['stringify'](_0x588f4e));_0x14f6cb(_0x588f4e);})[_0xd1c3('0x17')](function(_0xc45d5d){logger[_0xd1c3('0x12')](_0xd1c3('0x18'),_0xc45d5d[_0xd1c3('0x15')],_0x5d26c2);_0x3a1a74(_0x53a5e1[_0xd1c3('0x12')](0x1f4,_0xc45d5d[_0xd1c3('0x15')]));});});};exports[_0xd1c3('0x1e')]=function(_0x33c380){var _0x218ef1=this;return new Promise(function(_0x5a9d5d,_0x56091a){return db[_0xd1c3('0x19')][_0xd1c3('0x1f')](_0x33c380[_0xd1c3('0x1b')],{'raw':_0x33c380[_0xd1c3('0x1c')]?_0x33c380['options'][_0xd1c3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33c380[_0xd1c3('0x1c')]?_0x33c380['options'][_0xd1c3('0x20')]||null:null,'attributes':_0x33c380[_0xd1c3('0x1c')]?_0x33c380[_0xd1c3('0x1c')][_0xd1c3('0x21')]||null:null,'limit':_0x33c380[_0xd1c3('0x1c')]?_0x33c380[_0xd1c3('0x1c')][_0xd1c3('0x22')]||null:null})['then'](function(_0x57309e){logger[_0xd1c3('0xd')](_0xd1c3('0x1e'),_0x33c380);logger[_0xd1c3('0xe')](_0xd1c3('0x1e'),_0x33c380,JSON[_0xd1c3('0x11')](_0x57309e));_0x5a9d5d(_0x57309e);})['catch'](function(_0x331bad){logger[_0xd1c3('0x12')]('UpdateOpenchannelQueueReport',_0x331bad[_0xd1c3('0x15')],_0x33c380);_0x56091a(_0x218ef1['error'](0x1f4,_0x331bad[_0xd1c3('0x15')]));});});}; \ No newline at end of file +var _0x4fad=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','update','attributes','limit','then','UpdateOpenchannelQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x123cc3,_0x361fd8){var _0x134ee0=function(_0xdccd6d){while(--_0xdccd6d){_0x123cc3['push'](_0x123cc3['shift']());}};_0x134ee0(++_0x361fd8);}(_0x4fad,0xcb));var _0xd4fa=function(_0x5f0dce,_0x2edddc){_0x5f0dce=_0x5f0dce-0x0;var _0x3699e7=_0x4fad[_0x5f0dce];return _0x3699e7;};'use strict';var _=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var moment=require(_0xd4fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4fa('0x3'));var fs=require('fs');var Redis=require(_0xd4fa('0x4'));var db=require(_0xd4fa('0x5'))['db'];var utils=require(_0xd4fa('0x6'));var logger=require(_0xd4fa('0x7'))(_0xd4fa('0x8'));var config=require(_0xd4fa('0x9'));var jayson=require(_0xd4fa('0xa'));var client=jayson['client'][_0xd4fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b426,_0x2b9f6a,_0x19a910){return new BPromise(function(_0x155c09,_0x3fff99){return client[_0xd4fa('0xc')](_0x52b426,_0x19a910)['then'](function(_0x26a894){logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,'request\x20sent');logger[_0xd4fa('0xf')](_0xd4fa('0x10'),_0x2b9f6a,_0xd4fa('0x11'),JSON[_0xd4fa('0x12')](_0x26a894));if(_0x26a894['error']){if(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x14')]===0x1f4){logger[_0xd4fa('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b9f6a,_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);return _0x3fff99(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}logger[_0xd4fa('0x13')](_0xd4fa('0xe'),_0x2b9f6a,_0x26a894['error'][_0xd4fa('0x15')]);return _0x155c09(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}else{logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,_0xd4fa('0x11'));_0x155c09(_0x26a894[_0xd4fa('0x16')]['message']);}})[_0xd4fa('0x17')](function(_0x3a3b8c){logger[_0xd4fa('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b9f6a,_0x3a3b8c);_0x3fff99(_0x3a3b8c);});});}exports['CreateOpenchannelQueueReport']=function(_0x1faa0b){var _0x5601d6=this;return new Promise(function(_0x5df190,_0x1f9be1){return db[_0xd4fa('0x18')][_0xd4fa('0x19')](_0x1faa0b[_0xd4fa('0x1a')],{'raw':_0x1faa0b['options']?_0x1faa0b[_0xd4fa('0x1b')][_0xd4fa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xbf7dcf){logger['info']('CreateOpenchannelQueueReport',_0x1faa0b);logger[_0xd4fa('0xf')](_0xd4fa('0x1d'),_0x1faa0b,JSON[_0xd4fa('0x12')](_0xbf7dcf));_0x5df190(_0xbf7dcf);})[_0xd4fa('0x17')](function(_0x586af0){logger[_0xd4fa('0x13')](_0xd4fa('0x1d'),_0x586af0[_0xd4fa('0x15')],_0x1faa0b);_0x1f9be1(_0x5601d6[_0xd4fa('0x13')](0x1f4,_0x586af0[_0xd4fa('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2a9d07){var _0x14ea6e=this;return new Promise(function(_0x4c5836,_0x162459){return db[_0xd4fa('0x18')][_0xd4fa('0x1e')](_0x2a9d07[_0xd4fa('0x1a')],{'raw':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07[_0xd4fa('0x1b')][_0xd4fa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07[_0xd4fa('0x1b')]['where']||null:null,'attributes':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07['options'][_0xd4fa('0x1f')]||null:null,'limit':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07['options'][_0xd4fa('0x20')]||null:null})[_0xd4fa('0x21')](function(_0x1b16ba){logger['info'](_0xd4fa('0x22'),_0x2a9d07);logger[_0xd4fa('0xf')]('UpdateOpenchannelQueueReport',_0x2a9d07,JSON[_0xd4fa('0x12')](_0x1b16ba));_0x4c5836(_0x1b16ba);})[_0xd4fa('0x17')](function(_0x5455a2){logger[_0xd4fa('0x13')](_0xd4fa('0x22'),_0x5455a2[_0xd4fa('0x15')],_0x2a9d07);_0x162459(_0x14ea6e[_0xd4fa('0x13')](0x1f4,_0x5455a2[_0xd4fa('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index edc7f92..ea8445d 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 _0xbf68=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','path'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xbf68,0x1e4));var _0x8bf6=function(_0x36258e,_0x3c60ab){_0x36258e=_0x36258e-0x0;var _0x476be9=_0xbf68[_0x36258e];return _0x476be9;};'use strict';var multer=require(_0x8bf6('0x0'));var util=require('util');var path=require(_0x8bf6('0x1'));var timeout=require(_0x8bf6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8bf6('0x3'));var auth=require(_0x8bf6('0x4'));var interaction=require(_0x8bf6('0x5'));var config=require(_0x8bf6('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x8bf6('0x7')]('/',auth['isAuthenticated'](),controller[_0x8bf6('0x8')]);router[_0x8bf6('0x7')]('/describe',auth[_0x8bf6('0x9')](),controller['describe']);router[_0x8bf6('0x7')](_0x8bf6('0xa'),auth[_0x8bf6('0x9')](),controller[_0x8bf6('0xb')]);router[_0x8bf6('0xc')]('/',auth[_0x8bf6('0x9')](),controller[_0x8bf6('0xd')]);router[_0x8bf6('0xe')](_0x8bf6('0xa'),auth['isAuthenticated'](),controller[_0x8bf6('0xf')]);router[_0x8bf6('0x10')](_0x8bf6('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x8bf6('0x11')]=router; \ No newline at end of file +var _0x7114=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x342c91,_0x58384d){var _0x407d51=function(_0x43a09c){while(--_0x43a09c){_0x342c91['push'](_0x342c91['shift']());}};_0x407d51(++_0x58384d);}(_0x7114,0xe0));var _0x4711=function(_0x4402ea,_0x3e874b){_0x4402ea=_0x4402ea-0x0;var _0x52d733=_0x7114[_0x4402ea];return _0x52d733;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4711('0x0'));var express=require(_0x4711('0x1'));var router=express['Router']();var fs_extra=require(_0x4711('0x2'));var auth=require(_0x4711('0x3'));var interaction=require(_0x4711('0x4'));var config=require(_0x4711('0x5'));var controller=require(_0x4711('0x6'));router[_0x4711('0x7')]('/',auth['isAuthenticated'](),controller[_0x4711('0x8')]);router[_0x4711('0x7')](_0x4711('0x9'),auth[_0x4711('0xa')](),controller[_0x4711('0xb')]);router[_0x4711('0x7')](_0x4711('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4711('0xd')]('/',auth[_0x4711('0xa')](),controller[_0x4711('0xe')]);router[_0x4711('0xf')]('/:id',auth[_0x4711('0xa')](),controller[_0x4711('0x10')]);router[_0x4711('0x11')](_0x4711('0xc'),auth[_0x4711('0xa')](),controller[_0x4711('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index fb69bde..dc2dd56 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3c9a89,_0x378778){var _0x1eb47b=function(_0x57998a){while(--_0x57998a){_0x3c9a89['push'](_0x3c9a89['shift']());}};_0x1eb47b(++_0x378778);}(_0x54ef,0x112));var _0xf54e=function(_0x109b5b,_0x488569){_0x109b5b=_0x109b5b-0x0;var _0x49fe6b=_0x54ef[_0x109b5b];return _0x49fe6b;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x5f1d5a,_0x1c85a7){var _0x449071=function(_0x50549c){while(--_0x50549c){_0x5f1d5a['push'](_0x5f1d5a['shift']());}};_0x449071(++_0x1c85a7);}(_0x54ef,0x112));var _0xf54e=function(_0x3a0511,_0x359bad){_0x3a0511=_0x3a0511-0x0;var _0x3056a0=_0x54ef[_0x3a0511];return _0x3056a0;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 96de59a..2b56d57 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 _0x5735=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','destroy','eml-format','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra'];(function(_0x209ad7,_0x187560){var _0x15e024=function(_0x59ac61){while(--_0x59ac61){_0x209ad7['push'](_0x209ad7['shift']());}};_0x15e024(++_0x187560);}(_0x5735,0x16a));var _0x5573=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5735[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x5573('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5573('0x1'));var rp=require(_0x5573('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5573('0x3'));var path=require(_0x5573('0x4'));var sox=require(_0x5573('0x5'));var csv=require(_0x5573('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5573('0x7'));var _=require(_0x5573('0x8'));var squel=require(_0x5573('0x9'));var crypto=require(_0x5573('0xa'));var jsforce=require(_0x5573('0xb'));var deskjs=require(_0x5573('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5573('0xd'));var Redis=require(_0x5573('0xe'));var authService=require(_0x5573('0xf'));var qs=require(_0x5573('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5573('0x11'))('api');var utils=require(_0x5573('0x12'));var config=require(_0x5573('0x13'));var licenseUtil=require(_0x5573('0x14'));var db=require(_0x5573('0x15'))['db'];function respondWithStatusCode(_0x332bb8,_0x4ee1e1){_0x4ee1e1=_0x4ee1e1||0xcc;return function(_0x463c4b){if(_0x463c4b){return _0x332bb8[_0x5573('0x16')](_0x4ee1e1);}return _0x332bb8[_0x5573('0x17')](_0x4ee1e1)[_0x5573('0x18')]();};}function respondWithResult(_0x58f9b6,_0x28da76){_0x28da76=_0x28da76||0xc8;return function(_0x42251f){if(_0x42251f){return _0x58f9b6['status'](_0x28da76)[_0x5573('0x19')](_0x42251f);}};}function respondWithFilteredResult(_0x8ca2a,_0x660f4d){return function(_0x57596a){if(_0x57596a){var _0xd36213=typeof _0x660f4d['offset']===_0x5573('0x1a')&&typeof _0x660f4d[_0x5573('0x1b')]===_0x5573('0x1a');var _0x2b3f43=_0x57596a[_0x5573('0x1c')];var _0x2e036b=_0xd36213?0x0:_0x660f4d[_0x5573('0x1d')];var _0x241030=_0xd36213?_0x57596a[_0x5573('0x1c')]:_0x660f4d[_0x5573('0x1d')]+_0x660f4d['limit'];var _0x399557;if(_0x241030>=_0x2b3f43){_0x241030=_0x2b3f43;_0x399557=0xc8;}else{_0x399557=0xce;}_0x8ca2a[_0x5573('0x17')](_0x399557);return _0x8ca2a[_0x5573('0x1e')](_0x5573('0x1f'),_0x2e036b+'-'+_0x241030+'/'+_0x2b3f43)[_0x5573('0x19')](_0x57596a);}return null;};}function patchUpdates(_0x24c398){return function(_0x5692d5){try{jsonpatch['apply'](_0x5692d5,_0x24c398,!![]);}catch(_0x2d92c0){return BPromise[_0x5573('0x20')](_0x2d92c0);}return _0x5692d5[_0x5573('0x21')]();};}function saveUpdates(_0x1a63fd,_0x46deb0){return function(_0x4afc6b){if(_0x4afc6b){return _0x4afc6b[_0x5573('0x22')](_0x1a63fd)['then'](function(_0xe24402){return _0xe24402;});}return null;};}function removeEntity(_0x387da0,_0x549f8e){return function(_0x2c6869){if(_0x2c6869){return _0x2c6869['destroy']()[_0x5573('0x23')](function(){_0x387da0[_0x5573('0x17')](0xcc)[_0x5573('0x18')]();});}};}function handleEntityNotFound(_0x2ecd6c,_0x44eaec){return function(_0x168da5){if(!_0x168da5){_0x2ecd6c['sendStatus'](0x194);}return _0x168da5;};}function handleError(_0x539fbb,_0xc4cb7){_0xc4cb7=_0xc4cb7||0x1f4;return function(_0x2e9bfd){logger[_0x5573('0x24')](_0x2e9bfd['stack']);if(_0x2e9bfd[_0x5573('0x25')]){delete _0x2e9bfd[_0x5573('0x25')];}_0x539fbb[_0x5573('0x17')](_0xc4cb7)['send'](_0x2e9bfd);};}exports[_0x5573('0x26')]=function(_0x26c298,_0x34f90d){var _0x2ddab2={},_0x4dcc0f={},_0x3bef38={'count':0x0,'rows':[]};var _0x52afd4=_[_0x5573('0x27')](db[_0x5573('0x28')][_0x5573('0x29')],function(_0x4ae585){return{'name':_0x4ae585[_0x5573('0x2a')],'type':_0x4ae585[_0x5573('0x2b')][_0x5573('0x2c')]};});_0x4dcc0f[_0x5573('0x2d')]=_[_0x5573('0x27')](_0x52afd4,_0x5573('0x25'));_0x4dcc0f['query']=_[_0x5573('0x2e')](_0x26c298[_0x5573('0x2f')]);_0x4dcc0f[_0x5573('0x30')]=_[_0x5573('0x31')](_0x4dcc0f[_0x5573('0x2d')],_0x4dcc0f[_0x5573('0x2f')]);_0x2ddab2[_0x5573('0x32')]=_[_0x5573('0x31')](_0x4dcc0f[_0x5573('0x2d')],qs[_0x5573('0x33')](_0x26c298[_0x5573('0x2f')][_0x5573('0x33')]));_0x2ddab2[_0x5573('0x32')]=_0x2ddab2[_0x5573('0x32')]['length']?_0x2ddab2['attributes']:_0x4dcc0f[_0x5573('0x2d')];if(!_0x26c298[_0x5573('0x2f')][_0x5573('0x34')](_0x5573('0x35'))){_0x2ddab2[_0x5573('0x1b')]=qs['limit'](_0x26c298[_0x5573('0x2f')][_0x5573('0x1b')]);_0x2ddab2['offset']=qs['offset'](_0x26c298['query'][_0x5573('0x1d')]);}_0x2ddab2[_0x5573('0x36')]=qs[_0x5573('0x37')](_0x26c298['query'][_0x5573('0x37')]);_0x2ddab2[_0x5573('0x38')]=qs[_0x5573('0x30')](_[_0x5573('0x39')](_0x26c298['query'],_0x4dcc0f[_0x5573('0x30')]),_0x52afd4);if(_0x26c298[_0x5573('0x2f')][_0x5573('0x3a')]){_0x2ddab2['where']=_[_0x5573('0x3b')](_0x2ddab2['where'],{'$or':_['map'](_0x52afd4,function(_0x53e77b){if(_0x53e77b[_0x5573('0x2b')]!==_0x5573('0x3c')){var _0x4a2617={};_0x4a2617[_0x53e77b['name']]={'$like':'%'+_0x26c298[_0x5573('0x2f')][_0x5573('0x3a')]+'%'};return _0x4a2617;}})});}_0x2ddab2=_[_0x5573('0x3b')]({},_0x2ddab2,_0x26c298[_0x5573('0x3d')]);var _0x4e753e={'where':_0x2ddab2[_0x5573('0x38')]};return db[_0x5573('0x28')][_0x5573('0x1c')](_0x4e753e)[_0x5573('0x23')](function(_0x3b6b94){_0x3bef38[_0x5573('0x1c')]=_0x3b6b94;if(_0x26c298['query'][_0x5573('0x3e')]){_0x2ddab2[_0x5573('0x3f')]=[{'all':!![]}];}return db[_0x5573('0x28')][_0x5573('0x40')](_0x2ddab2);})[_0x5573('0x23')](function(_0x3e5dc1){_0x3bef38[_0x5573('0x41')]=_0x3e5dc1;return _0x3bef38;})[_0x5573('0x23')](respondWithFilteredResult(_0x34f90d,_0x2ddab2))['catch'](handleError(_0x34f90d,null));};exports[_0x5573('0x42')]=function(_0x16116e,_0x484212){var _0x3fc651={'raw':!![],'where':{'id':_0x16116e[_0x5573('0x43')]['id']}},_0x2a4468={};_0x2a4468[_0x5573('0x2d')]=_['keys'](db['OpenchannelTransferReport'][_0x5573('0x29')]);_0x2a4468['query']=_[_0x5573('0x2e')](_0x16116e[_0x5573('0x2f')]);_0x2a4468[_0x5573('0x30')]=_[_0x5573('0x31')](_0x2a4468[_0x5573('0x2d')],_0x2a4468[_0x5573('0x2f')]);_0x3fc651[_0x5573('0x32')]=_['intersection'](_0x2a4468[_0x5573('0x2d')],qs['fields'](_0x16116e[_0x5573('0x2f')]['fields']));_0x3fc651[_0x5573('0x32')]=_0x3fc651[_0x5573('0x32')][_0x5573('0x44')]?_0x3fc651['attributes']:_0x2a4468[_0x5573('0x2d')];if(_0x16116e[_0x5573('0x2f')][_0x5573('0x3e')]){_0x3fc651['include']=[{'all':!![]}];}_0x3fc651=_[_0x5573('0x3b')]({},_0x3fc651,_0x16116e[_0x5573('0x3d')]);return db['OpenchannelTransferReport'][_0x5573('0x45')](_0x3fc651)[_0x5573('0x23')](handleEntityNotFound(_0x484212,null))['then'](respondWithResult(_0x484212,null))[_0x5573('0x46')](handleError(_0x484212,null));};exports['create']=function(_0x7fe9d2,_0x957a5c){return db['OpenchannelTransferReport'][_0x5573('0x47')](_0x7fe9d2[_0x5573('0x48')],{})[_0x5573('0x23')](respondWithResult(_0x957a5c,0xc9))[_0x5573('0x46')](handleError(_0x957a5c,null));};exports[_0x5573('0x22')]=function(_0xbd8f2e,_0x5ecba1){if(_0xbd8f2e['body']['id']){delete _0xbd8f2e[_0x5573('0x48')]['id'];}return db[_0x5573('0x28')][_0x5573('0x45')]({'where':{'id':_0xbd8f2e[_0x5573('0x43')]['id']}})[_0x5573('0x23')](handleEntityNotFound(_0x5ecba1,null))[_0x5573('0x23')](saveUpdates(_0xbd8f2e[_0x5573('0x48')],null))[_0x5573('0x23')](respondWithResult(_0x5ecba1,null))[_0x5573('0x46')](handleError(_0x5ecba1,null));};exports[_0x5573('0x49')]=function(_0x14b944,_0x325376){return db[_0x5573('0x28')][_0x5573('0x45')]({'where':{'id':_0x14b944[_0x5573('0x43')]['id']}})[_0x5573('0x23')](handleEntityNotFound(_0x325376,null))[_0x5573('0x23')](removeEntity(_0x325376,null))['catch'](handleError(_0x325376,null));};exports['describe']=function(_0x55e1a6,_0x4354e2){return db['OpenchannelTransferReport']['describe']()[_0x5573('0x23')](respondWithResult(_0x4354e2,null))[_0x5573('0x46')](handleError(_0x4354e2,null));}; \ No newline at end of file +var _0x7994=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','show','filters','create','body','find','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','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'];(function(_0x2160fb,_0x316fab){var _0x148f24=function(_0x97d796){while(--_0x97d796){_0x2160fb['push'](_0x2160fb['shift']());}};_0x148f24(++_0x316fab);}(_0x7994,0xce));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4799('0x0'));var zipdir=require(_0x4799('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4799('0x2'));var moment=require(_0x4799('0x3'));var BPromise=require(_0x4799('0x4'));var Mustache=require(_0x4799('0x5'));var util=require('util');var path=require(_0x4799('0x6'));var sox=require(_0x4799('0x7'));var csv=require('to-csv');var ejs=require(_0x4799('0x8'));var fs=require('fs');var fs_extra=require(_0x4799('0x9'));var _=require(_0x4799('0xa'));var squel=require(_0x4799('0xb'));var crypto=require(_0x4799('0xc'));var jsforce=require(_0x4799('0xd'));var deskjs=require(_0x4799('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4799('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4799('0x10'));var qs=require(_0x4799('0x11'));var as=require(_0x4799('0x12'));var hardwareService=require(_0x4799('0x13'));var logger=require(_0x4799('0x14'))(_0x4799('0x15'));var utils=require('../../config/utils');var config=require(_0x4799('0x16'));var licenseUtil=require(_0x4799('0x17'));var db=require(_0x4799('0x18'))['db'];function respondWithStatusCode(_0x3f808f,_0x5c5dde){_0x5c5dde=_0x5c5dde||0xcc;return function(_0x4a456c){if(_0x4a456c){return _0x3f808f[_0x4799('0x19')](_0x5c5dde);}return _0x3f808f[_0x4799('0x1a')](_0x5c5dde)[_0x4799('0x1b')]();};}function respondWithResult(_0x340be6,_0x2ae7e3){_0x2ae7e3=_0x2ae7e3||0xc8;return function(_0x146411){if(_0x146411){return _0x340be6['status'](_0x2ae7e3)[_0x4799('0x1c')](_0x146411);}};}function respondWithFilteredResult(_0x326c49,_0x416a58){return function(_0x12646f){if(_0x12646f){var _0x440e3c=typeof _0x416a58[_0x4799('0x1d')]===_0x4799('0x1e')&&typeof _0x416a58[_0x4799('0x1f')]===_0x4799('0x1e');var _0x47a145=_0x12646f[_0x4799('0x20')];var _0x3db3e8=_0x440e3c?0x0:_0x416a58[_0x4799('0x1d')];var _0x3bf6fb=_0x440e3c?_0x12646f[_0x4799('0x20')]:_0x416a58['offset']+_0x416a58[_0x4799('0x1f')];var _0x55157b;if(_0x3bf6fb>=_0x47a145){_0x3bf6fb=_0x47a145;_0x55157b=0xc8;}else{_0x55157b=0xce;}_0x326c49[_0x4799('0x1a')](_0x55157b);return _0x326c49[_0x4799('0x21')](_0x4799('0x22'),_0x3db3e8+'-'+_0x3bf6fb+'/'+_0x47a145)['json'](_0x12646f);}return null;};}function patchUpdates(_0xc1a402){return function(_0x40b554){try{jsonpatch[_0x4799('0x23')](_0x40b554,_0xc1a402,!![]);}catch(_0x188d19){return BPromise[_0x4799('0x24')](_0x188d19);}return _0x40b554[_0x4799('0x25')]();};}function saveUpdates(_0x1601d6,_0x246bf2){return function(_0x3b3c0b){if(_0x3b3c0b){return _0x3b3c0b[_0x4799('0x26')](_0x1601d6)[_0x4799('0x27')](function(_0x1df780){return _0x1df780;});}return null;};}function removeEntity(_0x4380ff,_0x108e0f){return function(_0x4e79cd){if(_0x4e79cd){return _0x4e79cd[_0x4799('0x28')]()[_0x4799('0x27')](function(){_0x4380ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1552f4,_0x59fa22){return function(_0x1abb2a){if(!_0x1abb2a){_0x1552f4['sendStatus'](0x194);}return _0x1abb2a;};}function handleError(_0x5776cc,_0x1a5ba2){_0x1a5ba2=_0x1a5ba2||0x1f4;return function(_0x32ebe6){logger[_0x4799('0x29')](_0x32ebe6[_0x4799('0x2a')]);if(_0x32ebe6[_0x4799('0x2b')]){delete _0x32ebe6[_0x4799('0x2b')];}_0x5776cc[_0x4799('0x1a')](_0x1a5ba2)[_0x4799('0x2c')](_0x32ebe6);};}exports[_0x4799('0x2d')]=function(_0x51abe7,_0x414928){var _0x273f88={},_0x497cdc={},_0x362af2={'count':0x0,'rows':[]};var _0xe92277=_['map'](db[_0x4799('0x2e')][_0x4799('0x2f')],function(_0x21493c){return{'name':_0x21493c[_0x4799('0x30')],'type':_0x21493c['type'][_0x4799('0x31')]};});_0x497cdc[_0x4799('0x32')]=_['map'](_0xe92277,'name');_0x497cdc[_0x4799('0x33')]=_[_0x4799('0x34')](_0x51abe7['query']);_0x497cdc['filters']=_[_0x4799('0x35')](_0x497cdc[_0x4799('0x32')],_0x497cdc[_0x4799('0x33')]);_0x273f88[_0x4799('0x36')]=_['intersection'](_0x497cdc['model'],qs[_0x4799('0x37')](_0x51abe7[_0x4799('0x33')][_0x4799('0x37')]));_0x273f88[_0x4799('0x36')]=_0x273f88[_0x4799('0x36')][_0x4799('0x38')]?_0x273f88[_0x4799('0x36')]:_0x497cdc[_0x4799('0x32')];if(!_0x51abe7[_0x4799('0x33')]['hasOwnProperty'](_0x4799('0x39'))){_0x273f88[_0x4799('0x1f')]=qs[_0x4799('0x1f')](_0x51abe7[_0x4799('0x33')][_0x4799('0x1f')]);_0x273f88[_0x4799('0x1d')]=qs['offset'](_0x51abe7['query']['offset']);}_0x273f88[_0x4799('0x3a')]=qs[_0x4799('0x3b')](_0x51abe7['query'][_0x4799('0x3b')]);_0x273f88[_0x4799('0x3c')]=qs['filters'](_[_0x4799('0x3d')](_0x51abe7[_0x4799('0x33')],_0x497cdc['filters']),_0xe92277);if(_0x51abe7[_0x4799('0x33')][_0x4799('0x3e')]){_0x273f88[_0x4799('0x3c')]=_[_0x4799('0x3f')](_0x273f88[_0x4799('0x3c')],{'$or':_[_0x4799('0x40')](_0xe92277,function(_0x2b4ab3){if(_0x2b4ab3['type']!==_0x4799('0x41')){var _0x1ddc3f={};_0x1ddc3f[_0x2b4ab3['name']]={'$like':'%'+_0x51abe7['query']['filter']+'%'};return _0x1ddc3f;}})});}_0x273f88=_[_0x4799('0x3f')]({},_0x273f88,_0x51abe7[_0x4799('0x42')]);var _0x543f8e={'where':_0x273f88[_0x4799('0x3c')]};return db['OpenchannelTransferReport'][_0x4799('0x20')](_0x543f8e)[_0x4799('0x27')](function(_0x5dcd26){_0x362af2['count']=_0x5dcd26;if(_0x51abe7[_0x4799('0x33')][_0x4799('0x43')]){_0x273f88[_0x4799('0x44')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x273f88);})[_0x4799('0x27')](function(_0x24ba32){_0x362af2['rows']=_0x24ba32;return _0x362af2;})[_0x4799('0x27')](respondWithFilteredResult(_0x414928,_0x273f88))[_0x4799('0x45')](handleError(_0x414928,null));};exports[_0x4799('0x46')]=function(_0x32a2e8,_0x4b802f){var _0x5b7ff0={'raw':!![],'where':{'id':_0x32a2e8['params']['id']}},_0x46b9f1={};_0x46b9f1[_0x4799('0x32')]=_[_0x4799('0x34')](db[_0x4799('0x2e')][_0x4799('0x2f')]);_0x46b9f1[_0x4799('0x33')]=_[_0x4799('0x34')](_0x32a2e8[_0x4799('0x33')]);_0x46b9f1[_0x4799('0x47')]=_[_0x4799('0x35')](_0x46b9f1[_0x4799('0x32')],_0x46b9f1[_0x4799('0x33')]);_0x5b7ff0[_0x4799('0x36')]=_[_0x4799('0x35')](_0x46b9f1[_0x4799('0x32')],qs[_0x4799('0x37')](_0x32a2e8['query']['fields']));_0x5b7ff0['attributes']=_0x5b7ff0[_0x4799('0x36')][_0x4799('0x38')]?_0x5b7ff0[_0x4799('0x36')]:_0x46b9f1[_0x4799('0x32')];if(_0x32a2e8[_0x4799('0x33')][_0x4799('0x43')]){_0x5b7ff0[_0x4799('0x44')]=[{'all':!![]}];}_0x5b7ff0=_[_0x4799('0x3f')]({},_0x5b7ff0,_0x32a2e8[_0x4799('0x42')]);return db['OpenchannelTransferReport']['find'](_0x5b7ff0)[_0x4799('0x27')](handleEntityNotFound(_0x4b802f,null))[_0x4799('0x27')](respondWithResult(_0x4b802f,null))[_0x4799('0x45')](handleError(_0x4b802f,null));};exports[_0x4799('0x48')]=function(_0x4af573,_0x3b08be){return db[_0x4799('0x2e')][_0x4799('0x48')](_0x4af573[_0x4799('0x49')],{})[_0x4799('0x27')](respondWithResult(_0x3b08be,0xc9))[_0x4799('0x45')](handleError(_0x3b08be,null));};exports[_0x4799('0x26')]=function(_0x407913,_0x2e9f7e){if(_0x407913[_0x4799('0x49')]['id']){delete _0x407913[_0x4799('0x49')]['id'];}return db[_0x4799('0x2e')][_0x4799('0x4a')]({'where':{'id':_0x407913[_0x4799('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e9f7e,null))[_0x4799('0x27')](saveUpdates(_0x407913[_0x4799('0x49')],null))[_0x4799('0x27')](respondWithResult(_0x2e9f7e,null))[_0x4799('0x45')](handleError(_0x2e9f7e,null));};exports[_0x4799('0x28')]=function(_0x22a6bf,_0x2ed65d){return db['OpenchannelTransferReport'][_0x4799('0x4a')]({'where':{'id':_0x22a6bf[_0x4799('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ed65d,null))[_0x4799('0x27')](removeEntity(_0x2ed65d,null))[_0x4799('0x45')](handleError(_0x2ed65d,null));};exports['describe']=function(_0x1c5169,_0x4b99d8){return db[_0x4799('0x2e')][_0x4799('0x4c')]()['then'](respondWithResult(_0x4b99d8,null))['catch'](handleError(_0x4b99d8,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a197186..6ee03c4 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 _0xac2e=['report_openchannel_transfer','uniqueid','lodash','util','api','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x1e0d64,_0x130b92){var _0x3dab88=function(_0x161dd1){while(--_0x161dd1){_0x1e0d64['push'](_0x1e0d64['shift']());}};_0x3dab88(++_0x130b92);}(_0xac2e,0x65));var _0xeac2=function(_0x3512c3,_0x346843){_0x3512c3=_0x3512c3-0x0;var _0x3b2842=_0xac2e[_0x3512c3];return _0x3b2842;};'use strict';var _=require(_0xeac2('0x0'));var util=require(_0xeac2('0x1'));var logger=require('../../config/logger')(_0xeac2('0x2'));var moment=require(_0xeac2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac2('0x4'));var rimraf=require(_0xeac2('0x5'));var config=require(_0xeac2('0x6'));var attributes=require(_0xeac2('0x7'));module[_0xeac2('0x8')]=function(_0x1c95c5,_0x5b610c){return _0x1c95c5['define']('OpenchannelTransferReport',attributes,{'tableName':_0xeac2('0x9'),'paranoid':![],'indexes':[{'name':_0xeac2('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe0cc=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x154512,_0x50386d){var _0x1384d2=function(_0x3fb147){while(--_0x3fb147){_0x154512['push'](_0x154512['shift']());}};_0x1384d2(++_0x50386d);}(_0xe0cc,0xd3));var _0xce0c=function(_0x596acb,_0x50cda9){_0x596acb=_0x596acb-0x0;var _0x2c1dbc=_0xe0cc[_0x596acb];return _0x2c1dbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xce0c('0x0'))(_0xce0c('0x1'));var moment=require(_0xce0c('0x2'));var BPromise=require(_0xce0c('0x3'));var rp=require(_0xce0c('0x4'));var fs=require('fs');var path=require(_0xce0c('0x5'));var rimraf=require(_0xce0c('0x6'));var config=require(_0xce0c('0x7'));var attributes=require(_0xce0c('0x8'));module['exports']=function(_0x411875,_0x35e883){return _0x411875['define'](_0xce0c('0x9'),attributes,{'tableName':_0xce0c('0xa'),'paranoid':![],'indexes':[{'name':_0xce0c('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index f0b6ff2..a2e773e 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 _0xc949=['request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xb9cc87,_0x4e440e){var _0x33d33e=function(_0x36fca7){while(--_0x36fca7){_0xb9cc87['push'](_0xb9cc87['shift']());}};_0x33d33e(++_0x4e440e);}(_0xc949,0x181));var _0x9c94=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xc949[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0x9c94('0x0'));var util=require('util');var moment=require(_0x9c94('0x1'));var BPromise=require(_0x9c94('0x2'));var rs=require(_0x9c94('0x3'));var fs=require('fs');var Redis=require(_0x9c94('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c94('0x5'));var logger=require(_0x9c94('0x6'))('rpc');var config=require(_0x9c94('0x7'));var jayson=require(_0x9c94('0x8'));var client=jayson[_0x9c94('0x9')][_0x9c94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57fcd7,_0xf373e,_0x360e7b){return new BPromise(function(_0x25ecd0,_0x43aa51){return client[_0x9c94('0xb')](_0x57fcd7,_0x360e7b)[_0x9c94('0xc')](function(_0x174a53){logger[_0x9c94('0xd')](_0x9c94('0xe'),_0xf373e,_0x9c94('0xf'));logger['debug'](_0x9c94('0x10'),_0xf373e,_0x9c94('0xf'),JSON[_0x9c94('0x11')](_0x174a53));if(_0x174a53[_0x9c94('0x12')]){if(_0x174a53[_0x9c94('0x12')][_0x9c94('0x13')]===0x1f4){logger[_0x9c94('0x12')](_0x9c94('0xe'),_0xf373e,_0x174a53[_0x9c94('0x12')][_0x9c94('0x14')]);return _0x43aa51(_0x174a53[_0x9c94('0x12')][_0x9c94('0x14')]);}logger[_0x9c94('0x12')](_0x9c94('0xe'),_0xf373e,_0x174a53['error'][_0x9c94('0x14')]);return _0x25ecd0(_0x174a53['error'][_0x9c94('0x14')]);}else{logger[_0x9c94('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xf373e,_0x9c94('0xf'));_0x25ecd0(_0x174a53['result']['message']);}})[_0x9c94('0x15')](function(_0x48d121){logger[_0x9c94('0x12')](_0x9c94('0xe'),_0xf373e,_0x48d121);_0x43aa51(_0x48d121);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x1cb9,0x14e));var _0x91cb=function(_0x210f11,_0x5d0ea2){_0x210f11=_0x210f11-0x0;var _0x11f136=_0x1cb9[_0x210f11];return _0x11f136;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index db4695f..aa5ae85 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 _0x2e2c=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x391ac4,_0x1f3b25){var _0x3509d7=function(_0x5bcb2b){while(--_0x5bcb2b){_0x391ac4['push'](_0x391ac4['shift']());}};_0x3509d7(++_0x1f3b25);}(_0x2e2c,0x9a));var _0xc2e2=function(_0x55291a,_0x814018){_0x55291a=_0x55291a-0x0;var _0x3c870c=_0x2e2c[_0x55291a];return _0x3c870c;};'use strict';var multer=require('multer');var util=require(_0xc2e2('0x0'));var path=require(_0xc2e2('0x1'));var timeout=require(_0xc2e2('0x2'));var express=require(_0xc2e2('0x3'));var router=express[_0xc2e2('0x4')]();var fs_extra=require(_0xc2e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc2e2('0x6'));var config=require(_0xc2e2('0x7'));var controller=require('./pause.controller');router[_0xc2e2('0x8')]('/',auth[_0xc2e2('0x9')](),controller[_0xc2e2('0xa')]);router[_0xc2e2('0x8')](_0xc2e2('0xb'),auth[_0xc2e2('0x9')](),controller[_0xc2e2('0xc')]);router[_0xc2e2('0xd')]('/',auth[_0xc2e2('0x9')](),controller['create']);router[_0xc2e2('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc2e2('0xf')]);router[_0xc2e2('0x10')](_0xc2e2('0xb'),auth['isAuthenticated'](),controller[_0xc2e2('0x11')]);module[_0xc2e2('0x12')]=router; \ No newline at end of file +var _0x6eb8=['delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6eb8,0xeb));var _0x86eb=function(_0x470487,_0x100b7a){_0x470487=_0x470487-0x0;var _0xa54074=_0x6eb8[_0x470487];return _0xa54074;};'use strict';var multer=require(_0x86eb('0x0'));var util=require(_0x86eb('0x1'));var path=require('path');var timeout=require(_0x86eb('0x2'));var express=require(_0x86eb('0x3'));var router=express['Router']();var fs_extra=require(_0x86eb('0x4'));var auth=require(_0x86eb('0x5'));var interaction=require(_0x86eb('0x6'));var config=require('../../config/environment');var controller=require(_0x86eb('0x7'));router[_0x86eb('0x8')]('/',auth[_0x86eb('0x9')](),controller[_0x86eb('0xa')]);router[_0x86eb('0x8')](_0x86eb('0xb'),auth[_0x86eb('0x9')](),controller[_0x86eb('0xc')]);router[_0x86eb('0xd')]('/',auth[_0x86eb('0x9')](),controller[_0x86eb('0xe')]);router[_0x86eb('0xf')](_0x86eb('0xb'),auth[_0x86eb('0x9')](),controller[_0x86eb('0x10')]);router[_0x86eb('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 51c767f..859b902 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 _0x3134=['sequelize','exports','STRING'];(function(_0x462ba7,_0x27aa87){var _0x53373a=function(_0x32969d){while(--_0x32969d){_0x462ba7['push'](_0x462ba7['shift']());}};_0x53373a(++_0x27aa87);}(_0x3134,0x1f2));var _0x4313=function(_0x2d1b25,_0x1d7fc4){_0x2d1b25=_0x2d1b25-0x0;var _0xb14504=_0x3134[_0x2d1b25];return _0xb14504;};'use strict';var Sequelize=require(_0x4313('0x0'));module[_0x4313('0x1')]={'name':{'type':Sequelize[_0x4313('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4313('0x2')]}}; \ No newline at end of file +var _0x9c7e=['name','sequelize','exports','STRING'];(function(_0xe8d4f6,_0x5c1ddc){var _0x439031=function(_0x5edd99){while(--_0x5edd99){_0xe8d4f6['push'](_0xe8d4f6['shift']());}};_0x439031(++_0x5c1ddc);}(_0x9c7e,0x6d));var _0xe9c7=function(_0x1ba517,_0x257117){_0x1ba517=_0x1ba517-0x0;var _0x202687=_0x9c7e[_0x1ba517];return _0x202687;};'use strict';var Sequelize=require(_0xe9c7('0x0'));module[_0xe9c7('0x1')]={'name':{'type':Sequelize[_0xe9c7('0x2')],'unique':_0xe9c7('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 4dd3df3..dc3f8c5 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 _0xfc6c=['hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','findAll','catch','show','params','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','UserProfileResource','stack','name','send','map','Pause','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc6c,0x1b4));var _0xcfc6=function(_0x30a896,_0x45f502){_0x30a896=_0x30a896-0x0;var _0x5309a3=_0xfc6c[_0x30a896];return _0x5309a3;};'use strict';var emlformat=require(_0xcfc6('0x0'));var rimraf=require(_0xcfc6('0x1'));var zipdir=require(_0xcfc6('0x2'));var jsonpatch=require(_0xcfc6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfc6('0x4'));var Mustache=require(_0xcfc6('0x5'));var util=require(_0xcfc6('0x6'));var path=require(_0xcfc6('0x7'));var sox=require(_0xcfc6('0x8'));var csv=require(_0xcfc6('0x9'));var ejs=require(_0xcfc6('0xa'));var fs=require('fs');var fs_extra=require(_0xcfc6('0xb'));var _=require(_0xcfc6('0xc'));var squel=require(_0xcfc6('0xd'));var crypto=require(_0xcfc6('0xe'));var jsforce=require(_0xcfc6('0xf'));var deskjs=require(_0xcfc6('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcfc6('0x11'));var Redis=require(_0xcfc6('0x12'));var authService=require(_0xcfc6('0x13'));var qs=require(_0xcfc6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfc6('0x15'))(_0xcfc6('0x16'));var utils=require(_0xcfc6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcfc6('0x18'));var db=require(_0xcfc6('0x19'))['db'];function respondWithStatusCode(_0x6fc58a,_0x3830ac){_0x3830ac=_0x3830ac||0xcc;return function(_0xd02356){if(_0xd02356){return _0x6fc58a[_0xcfc6('0x1a')](_0x3830ac);}return _0x6fc58a[_0xcfc6('0x1b')](_0x3830ac)[_0xcfc6('0x1c')]();};}function respondWithResult(_0x2554d,_0x4ea842){_0x4ea842=_0x4ea842||0xc8;return function(_0x1b7393){if(_0x1b7393){return _0x2554d[_0xcfc6('0x1b')](_0x4ea842)[_0xcfc6('0x1d')](_0x1b7393);}};}function respondWithFilteredResult(_0x5de4ea,_0x5b610d){return function(_0x5efe52){if(_0x5efe52){var _0xcb7937=typeof _0x5b610d[_0xcfc6('0x1e')]==='undefined'&&typeof _0x5b610d[_0xcfc6('0x1f')]===_0xcfc6('0x20');var _0x1bc312=_0x5efe52['count'];var _0x979078=_0xcb7937?0x0:_0x5b610d[_0xcfc6('0x1e')];var _0x3698cf=_0xcb7937?_0x5efe52[_0xcfc6('0x21')]:_0x5b610d[_0xcfc6('0x1e')]+_0x5b610d[_0xcfc6('0x1f')];var _0x281c69;if(_0x3698cf>=_0x1bc312){_0x3698cf=_0x1bc312;_0x281c69=0xc8;}else{_0x281c69=0xce;}_0x5de4ea[_0xcfc6('0x1b')](_0x281c69);return _0x5de4ea[_0xcfc6('0x22')]('Content-Range',_0x979078+'-'+_0x3698cf+'/'+_0x1bc312)[_0xcfc6('0x1d')](_0x5efe52);}return null;};}function patchUpdates(_0x1c7591){return function(_0x1400af){try{jsonpatch['apply'](_0x1400af,_0x1c7591,!![]);}catch(_0x2ab521){return BPromise[_0xcfc6('0x23')](_0x2ab521);}return _0x1400af[_0xcfc6('0x24')]();};}function saveUpdates(_0x18ba5a,_0x243966){return function(_0x23db2e){if(_0x23db2e){return _0x23db2e[_0xcfc6('0x25')](_0x18ba5a)[_0xcfc6('0x26')](function(_0x22b2c3){return _0x22b2c3;});}return null;};}function removeEntity(_0xa87c6c,_0x2f68d6){return function(_0x5295b1){if(_0x5295b1){return _0x5295b1[_0xcfc6('0x27')]()['then'](function(){var _0xb45536=_0x5295b1['get']({'plain':!![]});var _0x43891a='Pauses';return db[_0xcfc6('0x28')][_0xcfc6('0x27')]({'where':{'type':_0x43891a,'resourceId':_0xb45536['id']}})[_0xcfc6('0x26')](function(){return _0x5295b1;});})[_0xcfc6('0x26')](function(){_0xa87c6c[_0xcfc6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20124d,_0x3b6ed3){return function(_0x1946ea){if(!_0x1946ea){_0x20124d['sendStatus'](0x194);}return _0x1946ea;};}function handleError(_0x183648,_0x262e9e){_0x262e9e=_0x262e9e||0x1f4;return function(_0x2d378a){logger['error'](_0x2d378a[_0xcfc6('0x29')]);if(_0x2d378a[_0xcfc6('0x2a')]){delete _0x2d378a[_0xcfc6('0x2a')];}_0x183648['status'](_0x262e9e)[_0xcfc6('0x2b')](_0x2d378a);};}exports['index']=function(_0x5eeecf,_0x45ef05){var _0x42f98d={},_0x351107={},_0x114ff8={'count':0x0,'rows':[]};var _0x31932e=_[_0xcfc6('0x2c')](db[_0xcfc6('0x2d')][_0xcfc6('0x2e')],function(_0xbaedc5){return{'name':_0xbaedc5[_0xcfc6('0x2f')],'type':_0xbaedc5[_0xcfc6('0x30')]['key']};});_0x351107[_0xcfc6('0x31')]=_[_0xcfc6('0x2c')](_0x31932e,_0xcfc6('0x2a'));_0x351107[_0xcfc6('0x32')]=_[_0xcfc6('0x33')](_0x5eeecf[_0xcfc6('0x32')]);_0x351107['filters']=_[_0xcfc6('0x34')](_0x351107[_0xcfc6('0x31')],_0x351107['query']);_0x42f98d[_0xcfc6('0x35')]=_[_0xcfc6('0x34')](_0x351107['model'],qs[_0xcfc6('0x36')](_0x5eeecf['query'][_0xcfc6('0x36')]));_0x42f98d['attributes']=_0x42f98d[_0xcfc6('0x35')][_0xcfc6('0x37')]?_0x42f98d['attributes']:_0x351107[_0xcfc6('0x31')];if(!_0x5eeecf['query'][_0xcfc6('0x38')](_0xcfc6('0x39'))){_0x42f98d[_0xcfc6('0x1f')]=qs['limit'](_0x5eeecf[_0xcfc6('0x32')][_0xcfc6('0x1f')]);_0x42f98d['offset']=qs[_0xcfc6('0x1e')](_0x5eeecf[_0xcfc6('0x32')][_0xcfc6('0x1e')]);}_0x42f98d[_0xcfc6('0x3a')]=qs[_0xcfc6('0x3b')](_0x5eeecf['query'][_0xcfc6('0x3b')]);_0x42f98d[_0xcfc6('0x3c')]=qs['filters'](_['pick'](_0x5eeecf[_0xcfc6('0x32')],_0x351107[_0xcfc6('0x3d')]),_0x31932e);if(_0x5eeecf[_0xcfc6('0x32')]['filter']){_0x42f98d['where']=_[_0xcfc6('0x3e')](_0x42f98d[_0xcfc6('0x3c')],{'$or':_['map'](_0x31932e,function(_0x2a5a80){if(_0x2a5a80['type']!==_0xcfc6('0x3f')){var _0x4e201c={};_0x4e201c[_0x2a5a80[_0xcfc6('0x2a')]]={'$like':'%'+_0x5eeecf[_0xcfc6('0x32')][_0xcfc6('0x40')]+'%'};return _0x4e201c;}})});}_0x42f98d=_[_0xcfc6('0x3e')]({},_0x42f98d,_0x5eeecf['options']);var _0x3cf386={'where':_0x42f98d[_0xcfc6('0x3c')]};return db[_0xcfc6('0x2d')][_0xcfc6('0x21')](_0x3cf386)['then'](function(_0x557c8a){_0x114ff8[_0xcfc6('0x21')]=_0x557c8a;if(_0x5eeecf[_0xcfc6('0x32')]['includeAll']){_0x42f98d['include']=[{'all':!![]}];}return db[_0xcfc6('0x2d')][_0xcfc6('0x41')](_0x42f98d);})['then'](function(_0x56b6c9){_0x114ff8['rows']=_0x56b6c9;return _0x114ff8;})[_0xcfc6('0x26')](respondWithFilteredResult(_0x45ef05,_0x42f98d))[_0xcfc6('0x42')](handleError(_0x45ef05,null));};exports[_0xcfc6('0x43')]=function(_0x14fac8,_0x2d7164){var _0x14c206={'raw':!![],'where':{'id':_0x14fac8[_0xcfc6('0x44')]['id']}},_0x47b925={};_0x47b925[_0xcfc6('0x31')]=_['keys'](db['Pause'][_0xcfc6('0x2e')]);_0x47b925[_0xcfc6('0x32')]=_[_0xcfc6('0x33')](_0x14fac8['query']);_0x47b925[_0xcfc6('0x3d')]=_['intersection'](_0x47b925[_0xcfc6('0x31')],_0x47b925[_0xcfc6('0x32')]);_0x14c206[_0xcfc6('0x35')]=_[_0xcfc6('0x34')](_0x47b925['model'],qs[_0xcfc6('0x36')](_0x14fac8[_0xcfc6('0x32')][_0xcfc6('0x36')]));_0x14c206[_0xcfc6('0x35')]=_0x14c206[_0xcfc6('0x35')]['length']?_0x14c206['attributes']:_0x47b925[_0xcfc6('0x31')];if(_0x14fac8[_0xcfc6('0x32')][_0xcfc6('0x45')]){_0x14c206[_0xcfc6('0x46')]=[{'all':!![]}];}_0x14c206=_['merge']({},_0x14c206,_0x14fac8['options']);return db[_0xcfc6('0x2d')][_0xcfc6('0x47')](_0x14c206)[_0xcfc6('0x26')](handleEntityNotFound(_0x2d7164,null))['then'](respondWithResult(_0x2d7164,null))['catch'](handleError(_0x2d7164,null));};exports['create']=function(_0x457127,_0x3db205){return db['Pause'][_0xcfc6('0x48')](_0x457127[_0xcfc6('0x49')],{})['then'](function(_0x264daf){var _0x44d279=_0x457127[_0xcfc6('0x4a')][_0xcfc6('0x4b')]({'plain':!![]});if(!_0x44d279)throw new Error(_0xcfc6('0x4c'));if(_0x44d279['role']===_0xcfc6('0x4a')){var _0x3b8128=_0x264daf[_0xcfc6('0x4b')]({'plain':!![]});var _0x6b5010=_0xcfc6('0x4d');return db[_0xcfc6('0x4e')][_0xcfc6('0x47')]({'where':{'name':_0x6b5010,'userProfileId':_0x44d279[_0xcfc6('0x4f')]},'raw':!![]})[_0xcfc6('0x26')](function(_0x6df6d5){if(_0x6df6d5&&_0x6df6d5[_0xcfc6('0x50')]===0x0){return db[_0xcfc6('0x28')][_0xcfc6('0x48')]({'name':_0x3b8128[_0xcfc6('0x2a')],'resourceId':_0x3b8128['id'],'type':_0x6df6d5[_0xcfc6('0x2a')],'sectionId':_0x6df6d5['id']},{})[_0xcfc6('0x26')](function(){return _0x264daf;});}else{return _0x264daf;}})[_0xcfc6('0x42')](function(_0x285311){logger['error'](_0xcfc6('0x51'),_0x285311);throw _0x285311;});}return _0x264daf;})['then'](respondWithResult(_0x3db205,0xc9))[_0xcfc6('0x42')](handleError(_0x3db205,null));};exports[_0xcfc6('0x25')]=function(_0x38c455,_0x178e24){if(_0x38c455[_0xcfc6('0x49')]['id']){delete _0x38c455['body']['id'];}return db[_0xcfc6('0x2d')][_0xcfc6('0x47')]({'where':{'id':_0x38c455[_0xcfc6('0x44')]['id']}})['then'](handleEntityNotFound(_0x178e24,null))[_0xcfc6('0x26')](saveUpdates(_0x38c455['body'],null))[_0xcfc6('0x26')](respondWithResult(_0x178e24,null))[_0xcfc6('0x42')](handleError(_0x178e24,null));};exports[_0xcfc6('0x27')]=function(_0x3f5c05,_0x1f4c3e){return db[_0xcfc6('0x2d')][_0xcfc6('0x47')]({'where':{'id':_0x3f5c05[_0xcfc6('0x44')]['id']}})[_0xcfc6('0x26')](handleEntityNotFound(_0x1f4c3e,null))[_0xcfc6('0x26')](removeEntity(_0x1f4c3e,null))[_0xcfc6('0x42')](handleError(_0x1f4c3e,null));}; \ No newline at end of file +var _0x070e=['undefined','count','reject','save','update','then','destroy','Pauses','UserProfileResource','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','Pause','includeAll','include','findAll','rows','show','params','rawAttributes','attributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x121783,_0x4ffc7c){var _0x24c762=function(_0x3c2f46){while(--_0x3c2f46){_0x121783['push'](_0x121783['shift']());}};_0x24c762(++_0x4ffc7c);}(_0x070e,0x1d8));var _0xe070=function(_0x5c4540,_0x32ed5c){_0x5c4540=_0x5c4540-0x0;var _0x120688=_0x070e[_0x5c4540];return _0x120688;};'use strict';var emlformat=require(_0xe070('0x0'));var rimraf=require(_0xe070('0x1'));var zipdir=require(_0xe070('0x2'));var jsonpatch=require(_0xe070('0x3'));var rp=require(_0xe070('0x4'));var moment=require('moment');var BPromise=require(_0xe070('0x5'));var Mustache=require(_0xe070('0x6'));var util=require(_0xe070('0x7'));var path=require('path');var sox=require(_0xe070('0x8'));var csv=require(_0xe070('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe070('0xa'));var squel=require('squel');var crypto=require(_0xe070('0xb'));var jsforce=require(_0xe070('0xc'));var deskjs=require(_0xe070('0xd'));var toCsv=require(_0xe070('0x9'));var querystring=require(_0xe070('0xe'));var Papa=require(_0xe070('0xf'));var Redis=require(_0xe070('0x10'));var authService=require(_0xe070('0x11'));var qs=require(_0xe070('0x12'));var as=require(_0xe070('0x13'));var hardwareService=require(_0xe070('0x14'));var logger=require(_0xe070('0x15'))(_0xe070('0x16'));var utils=require(_0xe070('0x17'));var config=require(_0xe070('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe070('0x19'))['db'];function respondWithStatusCode(_0x237a65,_0x321f60){_0x321f60=_0x321f60||0xcc;return function(_0x4b1a00){if(_0x4b1a00){return _0x237a65[_0xe070('0x1a')](_0x321f60);}return _0x237a65[_0xe070('0x1b')](_0x321f60)[_0xe070('0x1c')]();};}function respondWithResult(_0x567fb1,_0x22ba70){_0x22ba70=_0x22ba70||0xc8;return function(_0x38ebc3){if(_0x38ebc3){return _0x567fb1['status'](_0x22ba70)[_0xe070('0x1d')](_0x38ebc3);}};}function respondWithFilteredResult(_0x56081f,_0x45861c){return function(_0x151db5){if(_0x151db5){var _0x55c25f=typeof _0x45861c[_0xe070('0x1e')]==='undefined'&&typeof _0x45861c[_0xe070('0x1f')]===_0xe070('0x20');var _0x307ec5=_0x151db5[_0xe070('0x21')];var _0x404c32=_0x55c25f?0x0:_0x45861c['offset'];var _0x440ae4=_0x55c25f?_0x151db5['count']:_0x45861c['offset']+_0x45861c[_0xe070('0x1f')];var _0x5e3d6b;if(_0x440ae4>=_0x307ec5){_0x440ae4=_0x307ec5;_0x5e3d6b=0xc8;}else{_0x5e3d6b=0xce;}_0x56081f[_0xe070('0x1b')](_0x5e3d6b);return _0x56081f['set']('Content-Range',_0x404c32+'-'+_0x440ae4+'/'+_0x307ec5)[_0xe070('0x1d')](_0x151db5);}return null;};}function patchUpdates(_0x4b562f){return function(_0x26044d){try{jsonpatch['apply'](_0x26044d,_0x4b562f,!![]);}catch(_0xdce967){return BPromise[_0xe070('0x22')](_0xdce967);}return _0x26044d[_0xe070('0x23')]();};}function saveUpdates(_0x5cd0cf,_0x442467){return function(_0x1301be){if(_0x1301be){return _0x1301be[_0xe070('0x24')](_0x5cd0cf)[_0xe070('0x25')](function(_0x1f0865){return _0x1f0865;});}return null;};}function removeEntity(_0x3bb7de,_0x44199f){return function(_0x511289){if(_0x511289){return _0x511289[_0xe070('0x26')]()['then'](function(){var _0x457eed=_0x511289['get']({'plain':!![]});var _0x55d69d=_0xe070('0x27');return db[_0xe070('0x28')]['destroy']({'where':{'type':_0x55d69d,'resourceId':_0x457eed['id']}})[_0xe070('0x25')](function(){return _0x511289;});})[_0xe070('0x25')](function(){_0x3bb7de['status'](0xcc)[_0xe070('0x1c')]();});}};}function handleEntityNotFound(_0x24230a,_0x2f56de){return function(_0x55a7ed){if(!_0x55a7ed){_0x24230a[_0xe070('0x1a')](0x194);}return _0x55a7ed;};}function handleError(_0x36ad78,_0x3c56c2){_0x3c56c2=_0x3c56c2||0x1f4;return function(_0x56fc9a){logger['error'](_0x56fc9a[_0xe070('0x29')]);if(_0x56fc9a['name']){delete _0x56fc9a[_0xe070('0x2a')];}_0x36ad78['status'](_0x3c56c2)[_0xe070('0x2b')](_0x56fc9a);};}exports[_0xe070('0x2c')]=function(_0x4b2eb0,_0x3a7219){var _0x201833={},_0x1f1dc3={},_0x4ab9ca={'count':0x0,'rows':[]};var _0x455bfa=_['map'](db['Pause']['rawAttributes'],function(_0x160586){return{'name':_0x160586['fieldName'],'type':_0x160586[_0xe070('0x2d')][_0xe070('0x2e')]};});_0x1f1dc3[_0xe070('0x2f')]=_[_0xe070('0x30')](_0x455bfa,_0xe070('0x2a'));_0x1f1dc3[_0xe070('0x31')]=_[_0xe070('0x32')](_0x4b2eb0[_0xe070('0x31')]);_0x1f1dc3[_0xe070('0x33')]=_['intersection'](_0x1f1dc3['model'],_0x1f1dc3[_0xe070('0x31')]);_0x201833['attributes']=_[_0xe070('0x34')](_0x1f1dc3[_0xe070('0x2f')],qs['fields'](_0x4b2eb0[_0xe070('0x31')][_0xe070('0x35')]));_0x201833['attributes']=_0x201833['attributes'][_0xe070('0x36')]?_0x201833['attributes']:_0x1f1dc3['model'];if(!_0x4b2eb0[_0xe070('0x31')][_0xe070('0x37')](_0xe070('0x38'))){_0x201833[_0xe070('0x1f')]=qs[_0xe070('0x1f')](_0x4b2eb0[_0xe070('0x31')][_0xe070('0x1f')]);_0x201833[_0xe070('0x1e')]=qs[_0xe070('0x1e')](_0x4b2eb0[_0xe070('0x31')][_0xe070('0x1e')]);}_0x201833[_0xe070('0x39')]=qs[_0xe070('0x3a')](_0x4b2eb0[_0xe070('0x31')]['sort']);_0x201833['where']=qs['filters'](_['pick'](_0x4b2eb0[_0xe070('0x31')],_0x1f1dc3[_0xe070('0x33')]),_0x455bfa);if(_0x4b2eb0[_0xe070('0x31')][_0xe070('0x3b')]){_0x201833['where']=_[_0xe070('0x3c')](_0x201833[_0xe070('0x3d')],{'$or':_[_0xe070('0x30')](_0x455bfa,function(_0x3ed3f0){if(_0x3ed3f0[_0xe070('0x2d')]!==_0xe070('0x3e')){var _0x5496b7={};_0x5496b7[_0x3ed3f0[_0xe070('0x2a')]]={'$like':'%'+_0x4b2eb0[_0xe070('0x31')][_0xe070('0x3b')]+'%'};return _0x5496b7;}})});}_0x201833=_[_0xe070('0x3c')]({},_0x201833,_0x4b2eb0['options']);var _0x20e705={'where':_0x201833[_0xe070('0x3d')]};return db[_0xe070('0x3f')][_0xe070('0x21')](_0x20e705)[_0xe070('0x25')](function(_0x3de793){_0x4ab9ca['count']=_0x3de793;if(_0x4b2eb0[_0xe070('0x31')][_0xe070('0x40')]){_0x201833[_0xe070('0x41')]=[{'all':!![]}];}return db['Pause'][_0xe070('0x42')](_0x201833);})[_0xe070('0x25')](function(_0x294818){_0x4ab9ca[_0xe070('0x43')]=_0x294818;return _0x4ab9ca;})[_0xe070('0x25')](respondWithFilteredResult(_0x3a7219,_0x201833))['catch'](handleError(_0x3a7219,null));};exports[_0xe070('0x44')]=function(_0x210747,_0x1fefc7){var _0x30d995={'raw':!![],'where':{'id':_0x210747[_0xe070('0x45')]['id']}},_0xac1f84={};_0xac1f84['model']=_[_0xe070('0x32')](db[_0xe070('0x3f')][_0xe070('0x46')]);_0xac1f84[_0xe070('0x31')]=_[_0xe070('0x32')](_0x210747[_0xe070('0x31')]);_0xac1f84[_0xe070('0x33')]=_['intersection'](_0xac1f84[_0xe070('0x2f')],_0xac1f84[_0xe070('0x31')]);_0x30d995['attributes']=_[_0xe070('0x34')](_0xac1f84['model'],qs[_0xe070('0x35')](_0x210747[_0xe070('0x31')][_0xe070('0x35')]));_0x30d995['attributes']=_0x30d995[_0xe070('0x47')][_0xe070('0x36')]?_0x30d995[_0xe070('0x47')]:_0xac1f84[_0xe070('0x2f')];if(_0x210747[_0xe070('0x31')]['includeAll']){_0x30d995['include']=[{'all':!![]}];}_0x30d995=_[_0xe070('0x3c')]({},_0x30d995,_0x210747['options']);return db[_0xe070('0x3f')][_0xe070('0x48')](_0x30d995)[_0xe070('0x25')](handleEntityNotFound(_0x1fefc7,null))[_0xe070('0x25')](respondWithResult(_0x1fefc7,null))['catch'](handleError(_0x1fefc7,null));};exports[_0xe070('0x49')]=function(_0x31102b,_0x34b1ce){return db[_0xe070('0x3f')]['create'](_0x31102b[_0xe070('0x4a')],{})['then'](function(_0x19492b){var _0x404303=_0x31102b[_0xe070('0x4b')][_0xe070('0x4c')]({'plain':!![]});if(!_0x404303)throw new Error(_0xe070('0x4d'));if(_0x404303[_0xe070('0x4e')]===_0xe070('0x4b')){var _0x4e6c11=_0x19492b[_0xe070('0x4c')]({'plain':!![]});var _0x540ef2='Pauses';return db[_0xe070('0x4f')][_0xe070('0x48')]({'where':{'name':_0x540ef2,'userProfileId':_0x404303[_0xe070('0x50')]},'raw':!![]})[_0xe070('0x25')](function(_0x928837){if(_0x928837&&_0x928837[_0xe070('0x51')]===0x0){return db[_0xe070('0x28')]['create']({'name':_0x4e6c11[_0xe070('0x2a')],'resourceId':_0x4e6c11['id'],'type':_0x928837['name'],'sectionId':_0x928837['id']},{})['then'](function(){return _0x19492b;});}else{return _0x19492b;}})[_0xe070('0x52')](function(_0x2ebe2f){logger['error'](_0xe070('0x53'),_0x2ebe2f);throw _0x2ebe2f;});}return _0x19492b;})[_0xe070('0x25')](respondWithResult(_0x34b1ce,0xc9))[_0xe070('0x52')](handleError(_0x34b1ce,null));};exports[_0xe070('0x24')]=function(_0x10093e,_0x2827cf){if(_0x10093e[_0xe070('0x4a')]['id']){delete _0x10093e['body']['id'];}return db[_0xe070('0x3f')]['find']({'where':{'id':_0x10093e[_0xe070('0x45')]['id']}})[_0xe070('0x25')](handleEntityNotFound(_0x2827cf,null))['then'](saveUpdates(_0x10093e[_0xe070('0x4a')],null))[_0xe070('0x25')](respondWithResult(_0x2827cf,null))[_0xe070('0x52')](handleError(_0x2827cf,null));};exports['destroy']=function(_0x2b8c3a,_0x4698ae){return db['Pause'][_0xe070('0x48')]({'where':{'id':_0x2b8c3a[_0xe070('0x45')]['id']}})[_0xe070('0x25')](handleEntityNotFound(_0x4698ae,null))['then'](removeEntity(_0x4698ae,null))[_0xe070('0x52')](handleError(_0x4698ae,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 7686647..ca28ec5 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x45a230,_0x4823ad){var _0x41779d=function(_0x370489){while(--_0x370489){_0x45a230['push'](_0x45a230['shift']());}};_0x41779d(++_0x4823ad);}(_0xabce,0x103));var _0xeabc=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xabce[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x2550cd,_0x54be91){var _0x51c5af=function(_0x36cc7c){while(--_0x36cc7c){_0x2550cd['push'](_0x2550cd['shift']());}};_0x51c5af(++_0x54be91);}(_0x5fc3,0xa8));var _0x35fc=function(_0x411e71,_0xf9652){_0x411e71=_0x411e71-0x0;var _0x226ae3=_0x5fc3[_0x411e71];return _0x226ae3;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'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 438fec6..8ca95c4 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x349df7,_0x538d84){var _0x4a83fe=function(_0x2645a7){while(--_0x2645a7){_0x349df7['push'](_0x349df7['shift']());}};_0x4a83fe(++_0x538d84);}(_0x7a54,0x106));var _0x47a5=function(_0x98c953,_0x1903bd){_0x98c953=_0x98c953-0x0;var _0x5f0468=_0x7a54[_0x98c953];return _0x5f0468;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1b392d,_0x52f398){var _0x523e93=function(_0x23d15b){while(--_0x23d15b){_0x1b392d['push'](_0x1b392d['shift']());}};_0x523e93(++_0x52f398);}(_0x7a54,0x106));var _0x47a5=function(_0x2b2869,_0x45a40a){_0x2b2869=_0x2b2869-0x0;var _0x43b588=_0x7a54[_0x2b2869];return _0x43b588;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 93e7917..680bcba 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2123=['join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','isAuthenticated','show','/:id/download','diskStorage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2123,0x190));var _0x3212=function(_0x5c7aa8,_0xa36f10){_0x5c7aa8=_0x5c7aa8-0x0;var _0x5318ed=_0x2123[_0x5c7aa8];return _0x5318ed;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),controller['webhookGet']);router[_0x3212('0xb')]('/:id',auth[_0x3212('0xe')](),controller[_0x3212('0xf')]);router[_0x3212('0xb')](_0x3212('0x10'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x3212('0x11')]({'destination':function(_0xf166c2,_0x1a3b2f,_0x23f7e3){_0x23f7e3(null,path[_0x3212('0x12')](config[_0x3212('0x13')],_0x3212('0x14')));},'filename':function(_0x359cef,_0x26c1c8,_0x2d5fce){_0x26c1c8[_0x3212('0x15')]=_0x26c1c8[_0x3212('0x15')][_0x3212('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d5fce(null,util[_0x3212('0x17')](_0x3212('0x18'),path[_0x3212('0x19')](_0x26c1c8[_0x3212('0x15')],path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])),Date[_0x3212('0x1b')](),path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])));}})});router['post']('/',upload[_0x3212('0x1c')](_0x3212('0x1d')),controller[_0x3212('0x1e')]);router[_0x3212('0x1f')](_0x3212('0xd'),controller[_0x3212('0x20')]);router[_0x3212('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x3212('0x22')]);router['delete'](_0x3212('0x23'),auth[_0x3212('0xe')](),controller[_0x3212('0x24')]);module[_0x3212('0x25')]=router; \ No newline at end of file +var _0x0faf=['extname','now','post','single','file','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','basename'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x0faf,0x132));var _0xf0fa=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0x0faf[_0x37c8ef];return _0x5eaee9;};'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'),controller[_0xf0fa('0xe')]);router['get'](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller['show']);router['get'](_0xf0fa('0x10'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x11')]);var upload=multer({'storage':multer[_0xf0fa('0x12')]({'destination':function(_0x2bd807,_0x1151ea,_0x379ff6){_0x379ff6(null,path[_0xf0fa('0x13')](config['root'],_0xf0fa('0x14')));},'filename':function(_0x5b38fa,_0x2f46ff,_0x521034){_0x2f46ff[_0xf0fa('0x15')]=_0x2f46ff[_0xf0fa('0x15')][_0xf0fa('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x521034(null,util['format']('%s-%s%s',path[_0xf0fa('0x17')](_0x2f46ff['originalname'],path[_0xf0fa('0x18')](_0x2f46ff[_0xf0fa('0x15')])),Date[_0xf0fa('0x19')](),path[_0xf0fa('0x18')](_0x2f46ff[_0xf0fa('0x15')])));}})});router[_0xf0fa('0x1a')]('/',upload[_0xf0fa('0x1b')](_0xf0fa('0x1c')),controller['upload']);router[_0xf0fa('0x1a')](_0xf0fa('0xd'),controller[_0xf0fa('0x1d')]);router[_0xf0fa('0x1e')](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller['update']);router['delete'](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x1f')]);module[_0xf0fa('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index cb8ea29..ad07311 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 _0x1504=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html'];(function(_0x26dea2,_0x3ca3e6){var _0x286bdc=function(_0x221aac){while(--_0x221aac){_0x26dea2['push'](_0x26dea2['shift']());}};_0x286bdc(++_0x3ca3e6);}(_0x1504,0xc2));var _0x4150=function(_0x530a37,_0x524809){_0x530a37=_0x530a37-0x0;var _0x1b19f8=_0x1504[_0x530a37];return _0x1b19f8;};'use strict';var Sequelize=require(_0x4150('0x0'));module[_0x4150('0x1')]={'name':{'type':Sequelize[_0x4150('0x2')]},'type':{'type':Sequelize['ENUM'](_0x4150('0x3'),_0x4150('0x4'))},'description':{'type':Sequelize[_0x4150('0x5')]},'version':{'type':Sequelize[_0x4150('0x5')]},'path':{'type':Sequelize[_0x4150('0x2')],'comment':_0x4150('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4150('0x7')},'sidebar':{'type':Sequelize[_0x4150('0x8')](_0x4150('0x9'),'agentOnly','always','never'),'defaultValue':'always','comment':_0x4150('0xa')},'icon':{'type':Sequelize[_0x4150('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x4150('0x2')]},'scriptPath':{'type':Sequelize[_0x4150('0x2')]}}; \ No newline at end of file +var _0x0b77=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x0b77,0x124));var _0x70b7=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0x0b77[_0x228a4a];return _0x3d3937;};'use strict';var Sequelize=require(_0x70b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x70b7('0x1')]},'type':{'type':Sequelize[_0x70b7('0x2')](_0x70b7('0x3'),_0x70b7('0x4'))},'description':{'type':Sequelize[_0x70b7('0x5')]},'version':{'type':Sequelize[_0x70b7('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x70b7('0x6')},'active':{'type':Sequelize[_0x70b7('0x7')],'defaultValue':0x0,'comment':_0x70b7('0x8')},'sidebar':{'type':Sequelize[_0x70b7('0x2')](_0x70b7('0x9'),_0x70b7('0xa'),_0x70b7('0xb'),_0x70b7('0xc')),'defaultValue':'always','comment':_0x70b7('0xd')},'icon':{'type':Sequelize[_0x70b7('0x1')]},'adminUrl':{'type':Sequelize[_0x70b7('0x1')]},'agentUrl':{'type':Sequelize[_0x70b7('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x70b7('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5d6c761..c2b4370 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 _0x194f=['bluebird','util','path','sox','lodash','desk.js','to-csv','querystring','papaparse','extract-zip','rimraf','archiver','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','update','destroy','then','Plugins','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','count','includeAll','include','findAll','rows','catch','show','params','length','find','download','root','server/files/plugins','%s.zip','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','basename','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','info','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','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','Invalid\x20manifest:\x20views\x20missing','views','admin','parameters','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','plugins','agent','test','script','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Extracted\x20folder\x20removed','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','fast-json-patch','request-promise','moment'];(function(_0x1f80b4,_0x108d00){var _0x24e296=function(_0x49217){while(--_0x49217){_0x1f80b4['push'](_0x1f80b4['shift']());}};_0x24e296(++_0x108d00);}(_0x194f,0x9e));var _0xf194=function(_0x176ded,_0x58f209){_0x176ded=_0x176ded-0x0;var _0x4952a9=_0x194f[_0x176ded];return _0x4952a9;};'use strict';var emlformat=require(_0xf194('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf194('0x1'));var rp=require(_0xf194('0x2'));var moment=require(_0xf194('0x3'));var BPromise=require(_0xf194('0x4'));var Mustache=require('mustache');var util=require(_0xf194('0x5'));var path=require(_0xf194('0x6'));var sox=require(_0xf194('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf194('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf194('0x9'));var toCsv=require(_0xf194('0xa'));var querystring=require(_0xf194('0xb'));var Papa=require(_0xf194('0xc'));var extract=require(_0xf194('0xd'));var rimraf=require(_0xf194('0xe'));var archiver=require(_0xf194('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf194('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf194('0x11'));var logger=require(_0xf194('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf194('0x13'));var db=require(_0xf194('0x14'))['db'];config['redis']=_[_0xf194('0x15')](config[_0xf194('0x16')],{'host':_0xf194('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf194('0x18'))[_0xf194('0x19')](socket);function respondWithStatusCode(_0x3478f8,_0x256461){_0x256461=_0x256461||0xcc;return function(_0x523b5d){if(_0x523b5d){return _0x3478f8[_0xf194('0x1a')](_0x256461);}return _0x3478f8[_0xf194('0x1b')](_0x256461)['end']();};}function respondWithResult(_0x351af2,_0x3ad2e3){_0x3ad2e3=_0x3ad2e3||0xc8;return function(_0x5763dc){if(_0x5763dc){return _0x351af2[_0xf194('0x1b')](_0x3ad2e3)[_0xf194('0x1c')](_0x5763dc);}};}function respondWithFilteredResult(_0x1f7bc8,_0x52a074){return function(_0x4b0ce3){if(_0x4b0ce3){var _0x774f64=typeof _0x52a074[_0xf194('0x1d')]===_0xf194('0x1e')&&typeof _0x52a074[_0xf194('0x1f')]===_0xf194('0x1e');var _0x59c920=_0x4b0ce3['count'];var _0x3d4082=_0x774f64?0x0:_0x52a074[_0xf194('0x1d')];var _0x18ce87=_0x774f64?_0x4b0ce3['count']:_0x52a074[_0xf194('0x1d')]+_0x52a074['limit'];var _0x2c249e;if(_0x18ce87>=_0x59c920){_0x18ce87=_0x59c920;_0x2c249e=0xc8;}else{_0x2c249e=0xce;}_0x1f7bc8[_0xf194('0x1b')](_0x2c249e);return _0x1f7bc8[_0xf194('0x20')](_0xf194('0x21'),_0x3d4082+'-'+_0x18ce87+'/'+_0x59c920)[_0xf194('0x1c')](_0x4b0ce3);}return null;};}function patchUpdates(_0x2c17e7){return function(_0x172a5a){try{jsonpatch[_0xf194('0x22')](_0x172a5a,_0x2c17e7,!![]);}catch(_0x5561bb){return BPromise['reject'](_0x5561bb);}return _0x172a5a['save']();};}function saveUpdates(_0x2a2432,_0xc7426b){return function(_0x4e9c53){if(_0x4e9c53){return _0x4e9c53[_0xf194('0x23')](_0x2a2432)['then'](function(_0x2924af){return _0x2924af;});}return null;};}function removeEntity(_0x14b8e8,_0x5f241c){return function(_0x1e4bd0){if(_0x1e4bd0){return _0x1e4bd0[_0xf194('0x24')]()[_0xf194('0x25')](function(){var _0x4c8fc5=_0x1e4bd0['get']({'plain':!![]});var _0x29f45b=_0xf194('0x26');return db[_0xf194('0x27')][_0xf194('0x24')]({'where':{'type':_0x29f45b,'resourceId':_0x4c8fc5['id']}})[_0xf194('0x25')](function(){return _0x1e4bd0;});})[_0xf194('0x25')](function(){_0x14b8e8[_0xf194('0x1b')](0xcc)[_0xf194('0x28')]();});}};}function handleEntityNotFound(_0x5e54ce,_0x15207a){return function(_0x5650de){if(!_0x5650de){_0x5e54ce['sendStatus'](0x194);}return _0x5650de;};}function handleError(_0x4ab82e,_0x426f4b){_0x426f4b=_0x426f4b||0x1f4;return function(_0x816bd4){logger[_0xf194('0x29')](_0x816bd4[_0xf194('0x2a')]);if(_0x816bd4[_0xf194('0x2b')]){delete _0x816bd4['name'];}_0x4ab82e[_0xf194('0x1b')](_0x426f4b)[_0xf194('0x2c')](_0x816bd4);};}exports[_0xf194('0x2d')]=function(_0x1680c3,_0x14603c){var _0x39ee35={},_0x445b24={},_0x1adbd3={'count':0x0,'rows':[]};var _0x2667f0=_[_0xf194('0x2e')](db['Plugin'][_0xf194('0x2f')],function(_0x4ba8d5){return{'name':_0x4ba8d5[_0xf194('0x30')],'type':_0x4ba8d5[_0xf194('0x31')]['key']};});_0x445b24[_0xf194('0x32')]=_[_0xf194('0x2e')](_0x2667f0,_0xf194('0x2b'));_0x445b24[_0xf194('0x33')]=_[_0xf194('0x34')](_0x1680c3[_0xf194('0x33')]);_0x445b24[_0xf194('0x35')]=_['intersection'](_0x445b24[_0xf194('0x32')],_0x445b24['query']);_0x39ee35[_0xf194('0x36')]=_[_0xf194('0x37')](_0x445b24[_0xf194('0x32')],qs[_0xf194('0x38')](_0x1680c3[_0xf194('0x33')][_0xf194('0x38')]));_0x39ee35[_0xf194('0x36')]=_0x39ee35[_0xf194('0x36')]['length']?_0x39ee35[_0xf194('0x36')]:_0x445b24[_0xf194('0x32')];if(!_0x1680c3['query'][_0xf194('0x39')](_0xf194('0x3a'))){_0x39ee35['limit']=qs['limit'](_0x1680c3[_0xf194('0x33')][_0xf194('0x1f')]);_0x39ee35[_0xf194('0x1d')]=qs[_0xf194('0x1d')](_0x1680c3[_0xf194('0x33')][_0xf194('0x1d')]);}_0x39ee35[_0xf194('0x3b')]=qs[_0xf194('0x3c')](_0x1680c3[_0xf194('0x33')]['sort']);_0x39ee35[_0xf194('0x3d')]=qs['filters'](_[_0xf194('0x3e')](_0x1680c3['query'],_0x445b24[_0xf194('0x35')]),_0x2667f0);if(_0x1680c3[_0xf194('0x33')][_0xf194('0x3f')]){_0x39ee35[_0xf194('0x3d')]=_[_0xf194('0x40')](_0x39ee35[_0xf194('0x3d')],{'$or':_[_0xf194('0x2e')](_0x2667f0,function(_0x18a599){if(_0x18a599[_0xf194('0x31')]!==_0xf194('0x41')){var _0x307928={};_0x307928[_0x18a599[_0xf194('0x2b')]]={'$like':'%'+_0x1680c3[_0xf194('0x33')][_0xf194('0x3f')]+'%'};return _0x307928;}})});}_0x39ee35=_[_0xf194('0x40')]({},_0x39ee35,_0x1680c3[_0xf194('0x42')]);var _0x135032={'where':_0x39ee35[_0xf194('0x3d')]};return db[_0xf194('0x43')][_0xf194('0x44')](_0x135032)[_0xf194('0x25')](function(_0x4c55dc){_0x1adbd3[_0xf194('0x44')]=_0x4c55dc;if(_0x1680c3[_0xf194('0x33')][_0xf194('0x45')]){_0x39ee35[_0xf194('0x46')]=[{'all':!![]}];}return db['Plugin'][_0xf194('0x47')](_0x39ee35);})[_0xf194('0x25')](function(_0x580b5a){_0x1adbd3[_0xf194('0x48')]=_0x580b5a;return _0x1adbd3;})[_0xf194('0x25')](respondWithFilteredResult(_0x14603c,_0x39ee35))[_0xf194('0x49')](handleError(_0x14603c,null));};exports[_0xf194('0x4a')]=function(_0x504288,_0x56aa72){var _0x26fe03={'raw':!![],'where':{'id':_0x504288[_0xf194('0x4b')]['id']}},_0x149b0c={};_0x149b0c[_0xf194('0x32')]=_[_0xf194('0x34')](db[_0xf194('0x43')]['rawAttributes']);_0x149b0c[_0xf194('0x33')]=_[_0xf194('0x34')](_0x504288[_0xf194('0x33')]);_0x149b0c[_0xf194('0x35')]=_[_0xf194('0x37')](_0x149b0c['model'],_0x149b0c[_0xf194('0x33')]);_0x26fe03[_0xf194('0x36')]=_['intersection'](_0x149b0c[_0xf194('0x32')],qs[_0xf194('0x38')](_0x504288[_0xf194('0x33')][_0xf194('0x38')]));_0x26fe03[_0xf194('0x36')]=_0x26fe03['attributes'][_0xf194('0x4c')]?_0x26fe03[_0xf194('0x36')]:_0x149b0c['model'];if(_0x504288[_0xf194('0x33')]['includeAll']){_0x26fe03[_0xf194('0x46')]=[{'all':!![]}];}_0x26fe03=_[_0xf194('0x40')]({},_0x26fe03,_0x504288[_0xf194('0x42')]);return db[_0xf194('0x43')][_0xf194('0x4d')](_0x26fe03)['then'](handleEntityNotFound(_0x56aa72,null))['then'](respondWithResult(_0x56aa72,null))[_0xf194('0x49')](handleError(_0x56aa72,null));};exports[_0xf194('0x4e')]=function(_0x5a3bb3,_0x28c3d6,_0x97851b){return db['Plugin']['find']({'where':{'id':_0x5a3bb3[_0xf194('0x4b')]['id']},'attributes':[_0xf194('0x2b'),_0xf194('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x28c3d6,null))[_0xf194('0x25')](function(_0x3280b1){if(_0x3280b1){var _0x26b5a0=path['join'](config[_0xf194('0x4f')],_0xf194('0x50'),util['format'](_0xf194('0x51'),path['basename'](_0x3280b1[_0xf194('0x6')])));var _0x64788d=fs['createWriteStream'](_0x26b5a0);var _0x1ee603=archiver(_0xf194('0x52'),{'zlib':{'level':0x9}});_0x1ee603['on'](_0xf194('0x53'),function(_0x25ec4f){if(_0x25ec4f[_0xf194('0x54')]===_0xf194('0x55')){logger[_0xf194('0x29')](_0x25ec4f);}else{throw new db[(_0xf194('0x56'))][(_0xf194('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1ee603['on']('error',function(_0x3de769){throw new db[(_0xf194('0x56'))]['Error'](_0xf194('0x58'));});_0x1ee603['pipe'](_0x64788d);_0x1ee603[_0xf194('0x59')](_0xf194('0x5a'),{'cwd':path[_0xf194('0x5b')](config[_0xf194('0x4f')],_0xf194('0x50'),path['dirname'](_0x3280b1[_0xf194('0x6')])),'ignore':[path[_0xf194('0x5b')](path[_0xf194('0x5c')](_0x3280b1[_0xf194('0x6')]),'node_modules/**/*'),path[_0xf194('0x5b')](path[_0xf194('0x5c')](_0x3280b1[_0xf194('0x6')]),_0xf194('0x5d'))],'nodir':!![]})[_0xf194('0x5e')]();_0x64788d['on']('close',function(){if(!fs[_0xf194('0x5f')](_0x26b5a0)){throw new db[(_0xf194('0x56'))][(_0xf194('0x57'))](_0xf194('0x60'));}return _0x28c3d6[_0xf194('0x4e')](_0x26b5a0,util[_0xf194('0x61')](_0xf194('0x51'),path['basename'](_0x3280b1[_0xf194('0x6')])),function(_0xed978){if(_0xed978){throw new db['Sequelize'][(_0xf194('0x57'))](_0xf194('0x62'));}fs['unlinkSync'](_0x26b5a0);logger[_0xf194('0x63')]('Download\x20completed');logger['info'](_0xf194('0x64'));});});}return null;})['catch'](handleError(_0x28c3d6,null));};exports[_0xf194('0x65')]=function(_0x12aa6b,_0x442d8f,_0x52b368){var _0x323014=path[_0xf194('0x5c')](_0x12aa6b[_0xf194('0x66')][_0xf194('0x67')],path[_0xf194('0x68')](_0x12aa6b['file']['filename']));var _0x4cc6b7=path['join'](config[_0xf194('0x4f')],_0xf194('0x50'),_0x12aa6b[_0xf194('0x66')][_0xf194('0x67')]);var _0x5baf28=path[_0xf194('0x5b')](config[_0xf194('0x4f')],_0xf194('0x50'),_0x323014);logger[_0xf194('0x63')](_0xf194('0x69'),_0x4cc6b7);logger[_0xf194('0x63')](_0xf194('0x6a'),_0x5baf28);try{fs['chmodSync'](_0x4cc6b7,parseInt(_0xf194('0x6b'),0x8));extract(_0x4cc6b7,{'dir':_0x5baf28},function(_0x2b3275){if(_0x2b3275){logger['error'](_0x2b3275);handleError(_0x2b3275,!![]);};var _0x5bcfc0=fs[_0xf194('0x6c')](_0x5baf28);if(_0x5bcfc0[_0xf194('0x4c')]>0x1){removeReferences(_0x4cc6b7,_0x5baf28);logger[_0xf194('0x29')](_0xf194('0x6d'));return _0x52b368(new Error(_0xf194('0x6d')));}var _0x30f8fd=fs[_0xf194('0x6e')](path[_0xf194('0x5b')](_0x5baf28,_0x5bcfc0[0x0]));if(_0x30f8fd[_0xf194('0x6f')]()){removeReferences(_0x4cc6b7,_0x5baf28);logger['error']('Invalid\x20plugin\x20structure');return _0x52b368(new Error('Invalid\x20plugin\x20structure'));}if(_0x30f8fd[_0xf194('0x70')]()){var _0x475d97=fs[_0xf194('0x6c')](path['join'](_0x5baf28,_0x5bcfc0[0x0]));if(_0x475d97[_0xf194('0x4c')]===0x0){removeReferences(_0x4cc6b7,_0x5baf28);logger[_0xf194('0x29')](_0xf194('0x6d'));return _0x52b368(new Error(_0xf194('0x6d')));}var _0x1b4d50=_0x475d97['some'](function(_0x321ad7){return _0x321ad7===_0xf194('0x71');});if(!_0x1b4d50){return _0x52b368(new Error(_0xf194('0x72')));}var _0x23a616=fs[_0xf194('0x73')](path[_0xf194('0x5b')](_0x5baf28,_0x5bcfc0[0x0],_0xf194('0x71')));var _0x2c688f=JSON[_0xf194('0x74')](_0x23a616);if(_0xf194('0x1e')==typeof _0x2c688f['name']){return _0x52b368(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x2c688f[_0xf194('0x31')]){return _0x52b368(new Error(_0xf194('0x75')));}if('undefined'==typeof _0x2c688f[_0xf194('0x76')]){return _0x52b368(new Error(_0xf194('0x77')));}if('undefined'==typeof _0x2c688f['parameters']){return _0x52b368(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x2c688f['type']===_0xf194('0x78')){if(_0xf194('0x1e')==typeof _0x2c688f['parameters']['views']){return _0x52b368(new Error(_0xf194('0x79')));}if(_0xf194('0x1e')==typeof _0x2c688f['parameters'][_0xf194('0x7a')][_0xf194('0x7b')]&&_0xf194('0x1e')==typeof _0x2c688f[_0xf194('0x7c')][_0xf194('0x7a')]['agent']){return _0x52b368(new Error(_0xf194('0x7d')));}}else if(_0x2c688f[_0xf194('0x31')]==='script'){if(_0xf194('0x1e')==typeof _0x2c688f[_0xf194('0x7c')][_0xf194('0x7e')]){return _0x52b368(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xf194('0x1e')==typeof _0x2c688f[_0xf194('0x7c')]['scriptPath']){return _0x52b368(new Error(_0xf194('0x7f')));}}else{return _0x52b368(new Error(_0xf194('0x80')));}var _0x74e7e8=_0x2c688f[_0xf194('0x2b')];var _0x1dddac=_0x2c688f[_0xf194('0x81')];var _0x47d70f=_0x2c688f[_0xf194('0x31')];var _0x8d3adf=_0x2c688f[_0xf194('0x82')]?_0x2c688f[_0xf194('0x82')]:_0xf194('0x83');var _0x2eac46=_0x2c688f[_0xf194('0x84')]?_0x2c688f[_0xf194('0x84')]:'icon-apps';var _0x2a9031='';var _0x211729='';var _0x3f98d6='';var _0x4c7ff5='';var _0x317306=_0x2c688f['version'];if(_0x47d70f===_0xf194('0x78')){if(_0xf194('0x1e')!=typeof _0x2c688f[_0xf194('0x7c')][_0xf194('0x7a')][_0xf194('0x7b')]){var _0x4e0c7e=_0x2c688f[_0xf194('0x7c')]['views'][_0xf194('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4e0c7e)){_0x2a9031=path[_0xf194('0x5b')](_0xf194('0x85'),_0x323014,_0x5bcfc0[0x0],_0x4e0c7e);}else{_0x2a9031=_0x4e0c7e;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xf194('0x1e')!=typeof _0x2c688f['parameters'][_0xf194('0x7a')][_0xf194('0x86')]){var _0x10a8ee=_0x2c688f['parameters'][_0xf194('0x7a')][_0xf194('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xf194('0x87')](_0x10a8ee)){_0x211729=path[_0xf194('0x5b')](_0xf194('0x85'),_0x323014,_0x5bcfc0[0x0],_0x10a8ee);}else{_0x211729=_0x10a8ee;}}else{logger[_0xf194('0x63')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x47d70f===_0xf194('0x88')){_0x3f98d6=_0x2c688f[_0xf194('0x7c')][_0xf194('0x7e')];_0x4c7ff5=_0x2c688f['parameters'][_0xf194('0x89')];if('undefined'!=typeof _0x2c688f['parameters'][_0xf194('0x7a')]){if('undefined'!=typeof _0x2c688f['parameters'][_0xf194('0x7a')]['admin']){var _0x4e0c7e=_0x2c688f[_0xf194('0x7c')][_0xf194('0x7a')][_0xf194('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xf194('0x87')](_0x4e0c7e)){_0x2a9031=path[_0xf194('0x5b')](_0xf194('0x85'),_0x323014,_0x5bcfc0[0x0],_0x4e0c7e);}else{_0x2a9031=_0x4e0c7e;}}if(_0xf194('0x1e')!=typeof _0x2c688f[_0xf194('0x7c')][_0xf194('0x7a')][_0xf194('0x86')]){var _0x10a8ee=_0x2c688f[_0xf194('0x7c')][_0xf194('0x7a')][_0xf194('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xf194('0x87')](_0x10a8ee)){_0x211729=path[_0xf194('0x5b')]('plugins',_0x323014,_0x5bcfc0[0x0],_0x10a8ee);}else{_0x211729=_0x10a8ee;}}}}var _0x59431b={'name':_0x74e7e8,'description':_0x1dddac,'path':path['join'](_0x323014,_0x5bcfc0[0x0]),'type':_0x47d70f,'sidebar':_0x8d3adf,'icon':_0x2eac46,'adminUrl':_0x2a9031,'agentUrl':_0x211729,'scriptName':_0x3f98d6,'scriptPath':_0x4c7ff5,'version':_0x317306};removeReferences(_0x4cc6b7,null);return db[_0xf194('0x43')][_0xf194('0x8a')](_0x59431b)['then'](function(_0x3d57b4){var _0x1dc81e={'role':_0x12aa6b[_0xf194('0x8b')][_0xf194('0x8c')],'userProfileId':_0x12aa6b[_0xf194('0x8b')][_0xf194('0x8d')]};if(!_0x1dc81e)throw new Error(_0xf194('0x8e'));if(_0x1dc81e['role']==='user'){var _0x1f36ba=_0x3d57b4[_0xf194('0x8f')]({'plain':!![]});return db[_0xf194('0x90')]['find']({'where':{'name':_0xf194('0x26'),'userProfileId':_0x1dc81e[_0xf194('0x8d')]},'raw':!![]})[_0xf194('0x25')](function(_0x612f26){if(_0x612f26&&_0x612f26[_0xf194('0x91')]===0x0){return db[_0xf194('0x27')][_0xf194('0x8a')]({'name':_0x1f36ba[_0xf194('0x2b')],'resourceId':_0x1f36ba['id'],'type':_0x612f26[_0xf194('0x2b')],'sectionId':_0x612f26['id']},{})['then'](function(){return _0x3d57b4;});}else{return _0x3d57b4;}})['catch'](function(_0x1bd53f){logger[_0xf194('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bd53f);throw _0x1bd53f;});}return _0x3d57b4;})[_0xf194('0x25')](respondWithResult(_0x442d8f,null))[_0xf194('0x49')](handleError(_0x442d8f,null));}});}catch(_0x3bc2c5){_0x442d8f['status'](0x1f4)[_0xf194('0x2c')](_0x3bc2c5);}};function removeReferences(_0x58f130,_0x1a5396){try{if(_0x58f130){fs['unlinkSync'](_0x58f130);logger[_0xf194('0x63')]('Zip\x20archive\x20removed');}if(_0x1a5396){rimraf(_0x1a5396,function(){});logger['info'](_0xf194('0x92'));}}catch(_0x58afc3){logger['error'](_0x58afc3);}}exports[_0xf194('0x23')]=function(_0x34123c,_0x216d13,_0x12d982){return db[_0xf194('0x43')]['find']({'where':{'id':_0x34123c[_0xf194('0x4b')]['id']}})['then'](handleEntityNotFound(_0x216d13,null))[_0xf194('0x25')](saveUpdates(_0x34123c[_0xf194('0x8b')],null))[_0xf194('0x25')](respondWithResult(_0x216d13,null))[_0xf194('0x49')](handleError(_0x216d13,null));};exports['delete']=function(_0x1b7c44,_0x40076b,_0x5130e5){return db[_0xf194('0x43')][_0xf194('0x4d')]({'where':{'id':_0x1b7c44[_0xf194('0x4b')]['id']}})['then'](function(_0xe798a1){if(_0xe798a1){return _0xe798a1['destroy']();}})['then'](function(_0x4ba373){rimraf(path[_0xf194('0x5b')](config[_0xf194('0x4f')],_0xf194('0x50'),path['dirname'](_0x4ba373[_0xf194('0x6')])),function(){});return _0x4ba373;})[_0xf194('0x25')](handleEntityNotFound(_0x40076b,null))[_0xf194('0x25')](respondWithStatusCode(_0x40076b,null))['catch'](handleError(_0x40076b,null));};exports[_0xf194('0x93')]=function(_0x358584,_0x1adffa,_0x4d465f){return BPromise['resolve']()[_0xf194('0x25')](function(){if(!_0x358584[_0xf194('0x33')][_0xf194('0x6')]){throw new Error(_0xf194('0x94'));}if(!_0x358584[_0xf194('0x33')][_0xf194('0x95')]){throw new Error(_0xf194('0x96'));}var _0x5c209b=_0x358584[_0xf194('0x33')][_0xf194('0x97')]?_0x358584[_0xf194('0x33')][_0xf194('0x97')]+':'+_0x358584[_0xf194('0x33')][_0xf194('0x95')]:_0xf194('0x98')+_0x358584['query']['port'];var _0x13a1e7=_0x358584[_0xf194('0x33')][_0xf194('0x1c')]?_0x358584[_0xf194('0x33')][_0xf194('0x1c')]:!![];var _0x307735=_0x358584[_0xf194('0x33')][_0xf194('0x99')]?_0x358584['query'][_0xf194('0x99')]:null;var _0x3bef78={'method':_0x358584[_0xf194('0x9a')],'uri':util[_0xf194('0x61')](_0xf194('0x9b'),_0x5c209b,_0x358584[_0xf194('0x33')][_0xf194('0x6')]),'json':_0x13a1e7,'resolveWithFullResponse':!![],'encoding':_0x307735,'qs':_0x358584[_0xf194('0x33')]};if(_0x358584[_0xf194('0x9c')]){_0x3bef78[_0xf194('0x9c')]=_0x358584[_0xf194('0x9c')];if(_0x3bef78[_0xf194('0x9c')][_0xf194('0x9d')]){delete _0x3bef78[_0xf194('0x9c')][_0xf194('0x9d')];}}if(_0x3bef78['headers'][_0xf194('0x9e')]){delete _0x3bef78[_0xf194('0x9c')][_0xf194('0x9e')];}return rp(_0x3bef78);})[_0xf194('0x25')](function(_0x42429d){if(_0x42429d){_0x1adffa[_0xf194('0x20')](_0x42429d['headers']);logger[_0xf194('0x63')](_0x42429d[_0xf194('0x8b')]);if(_[_0xf194('0x9f')](_0x358584[_0xf194('0x33')][_0xf194('0x6')],_0xf194('0x4e'))&&_0x42429d[_0xf194('0xa0')]==0x1f4){return _0x1adffa['sendStatus'](_0x42429d[_0xf194('0xa0')]);}else{return _0x1adffa[_0xf194('0x1b')](_0x42429d[_0xf194('0xa0')])[_0xf194('0x2c')](_0x42429d[_0xf194('0x8b')]);}}else{return _0x1adffa[_0xf194('0x1a')](0xc8);}})[_0xf194('0x49')](handleError(_0x1adffa,null));};exports[_0xf194('0xa1')]=function(_0x288d10,_0x1ccdf1,_0x1ad87f){return BPromise['resolve']()['then'](function(){if(!_0x288d10['query'][_0xf194('0x6')]){throw new Error(_0xf194('0x94'));}if(!_0x288d10[_0xf194('0x33')][_0xf194('0x95')]){throw new Error(_0xf194('0x96'));}var _0x7d168e=_0x288d10[_0xf194('0x33')][_0xf194('0x97')]?_0x288d10['query'][_0xf194('0x97')]+':'+_0x288d10[_0xf194('0x33')][_0xf194('0x95')]:_0xf194('0x98')+_0x288d10['query'][_0xf194('0x95')];var _0x526ac7=_0x288d10[_0xf194('0x33')][_0xf194('0x1c')]?_0x288d10[_0xf194('0x33')][_0xf194('0x1c')]:!![];var _0x196840=_0x288d10['query']['encoding']?_0x288d10['query']['encoding']:null;var _0x5cf037={'method':_0x288d10[_0xf194('0x9a')],'uri':util[_0xf194('0x61')](_0xf194('0x9b'),_0x7d168e,_0x288d10[_0xf194('0x33')][_0xf194('0x6')]),'json':_0x526ac7,'resolveWithFullResponse':!![],'encoding':_0x196840,'body':_0x288d10[_0xf194('0x8b')]};if(_0x288d10[_0xf194('0x9c')]){_0x5cf037[_0xf194('0x9c')]=_0x288d10[_0xf194('0x9c')];if(_0x5cf037[_0xf194('0x9c')][_0xf194('0x9d')]){delete _0x5cf037[_0xf194('0x9c')][_0xf194('0x9d')];}}if(_0x5cf037[_0xf194('0x9c')][_0xf194('0x9e')]){delete _0x5cf037[_0xf194('0x9c')]['content-type'];}return rp(_0x5cf037);})['then'](function(_0xf52a5f){if(_0xf52a5f){_0x1ccdf1[_0xf194('0x20')](_0xf52a5f['headers']);logger[_0xf194('0x63')](_0xf52a5f[_0xf194('0x8b')]);return _0x1ccdf1[_0xf194('0x1b')](_0xf52a5f[_0xf194('0xa0')])[_0xf194('0x2c')](_0xf52a5f['body']);}else{return _0x1ccdf1[_0xf194('0x1a')](0xc8);}})[_0xf194('0x49')](handleError(_0x1ccdf1,null));}; \ No newline at end of file +var _0x9d52=['readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','admin','views','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','html','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','port','send','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','reject','update','destroy','then','get','UserProfileResource','name','index','map','Plugin','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','download','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','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json'];(function(_0x196729,_0x43fd10){var _0x54deb7=function(_0x5e56f1){while(--_0x5e56f1){_0x196729['push'](_0x196729['shift']());}};_0x54deb7(++_0x43fd10);}(_0x9d52,0x188));var _0x29d5=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x9d52[_0x2bddf9];return _0x3f3ae9;};'use strict';var emlformat=require(_0x29d5('0x0'));var rimraf=require(_0x29d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x29d5('0x2'));var BPromise=require(_0x29d5('0x3'));var Mustache=require(_0x29d5('0x4'));var util=require(_0x29d5('0x5'));var path=require(_0x29d5('0x6'));var sox=require(_0x29d5('0x7'));var csv=require(_0x29d5('0x8'));var ejs=require(_0x29d5('0x9'));var fs=require('fs');var fs_extra=require(_0x29d5('0xa'));var _=require(_0x29d5('0xb'));var squel=require(_0x29d5('0xc'));var crypto=require(_0x29d5('0xd'));var jsforce=require(_0x29d5('0xe'));var deskjs=require(_0x29d5('0xf'));var toCsv=require(_0x29d5('0x8'));var querystring=require(_0x29d5('0x10'));var Papa=require('papaparse');var extract=require(_0x29d5('0x11'));var rimraf=require(_0x29d5('0x1'));var archiver=require(_0x29d5('0x12'));var Redis=require(_0x29d5('0x13'));var authService=require(_0x29d5('0x14'));var qs=require(_0x29d5('0x15'));var as=require(_0x29d5('0x16'));var hardwareService=require(_0x29d5('0x17'));var logger=require('../../config/logger')(_0x29d5('0x18'));var utils=require('../../config/utils');var config=require(_0x29d5('0x19'));var licenseUtil=require(_0x29d5('0x1a'));var db=require(_0x29d5('0x1b'))['db'];config[_0x29d5('0x1c')]=_[_0x29d5('0x1d')](config[_0x29d5('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x29d5('0x1e'))(new Redis(config['redis']));require('./plugin.socket')[_0x29d5('0x1f')](socket);function respondWithStatusCode(_0x12b99d,_0x545d3e){_0x545d3e=_0x545d3e||0xcc;return function(_0x36c32d){if(_0x36c32d){return _0x12b99d[_0x29d5('0x20')](_0x545d3e);}return _0x12b99d['status'](_0x545d3e)[_0x29d5('0x21')]();};}function respondWithResult(_0x98d6ba,_0x3aa518){_0x3aa518=_0x3aa518||0xc8;return function(_0x56b737){if(_0x56b737){return _0x98d6ba[_0x29d5('0x22')](_0x3aa518)[_0x29d5('0x23')](_0x56b737);}};}function respondWithFilteredResult(_0x3f9d05,_0x862cc1){return function(_0x2e32a5){if(_0x2e32a5){var _0x3f90ed=typeof _0x862cc1['offset']===_0x29d5('0x24')&&typeof _0x862cc1['limit']==='undefined';var _0x184b4e=_0x2e32a5[_0x29d5('0x25')];var _0x446b64=_0x3f90ed?0x0:_0x862cc1[_0x29d5('0x26')];var _0x1ee2ab=_0x3f90ed?_0x2e32a5['count']:_0x862cc1[_0x29d5('0x26')]+_0x862cc1[_0x29d5('0x27')];var _0xa10227;if(_0x1ee2ab>=_0x184b4e){_0x1ee2ab=_0x184b4e;_0xa10227=0xc8;}else{_0xa10227=0xce;}_0x3f9d05[_0x29d5('0x22')](_0xa10227);return _0x3f9d05[_0x29d5('0x28')]('Content-Range',_0x446b64+'-'+_0x1ee2ab+'/'+_0x184b4e)['json'](_0x2e32a5);}return null;};}function patchUpdates(_0x373180){return function(_0x1be8ae){try{jsonpatch[_0x29d5('0x29')](_0x1be8ae,_0x373180,!![]);}catch(_0x71a894){return BPromise[_0x29d5('0x2a')](_0x71a894);}return _0x1be8ae['save']();};}function saveUpdates(_0xd39bf7,_0x831d1e){return function(_0x4cf060){if(_0x4cf060){return _0x4cf060[_0x29d5('0x2b')](_0xd39bf7)['then'](function(_0x4467c4){return _0x4467c4;});}return null;};}function removeEntity(_0x2f44cf,_0x3336a3){return function(_0x3a2fa5){if(_0x3a2fa5){return _0x3a2fa5[_0x29d5('0x2c')]()[_0x29d5('0x2d')](function(){var _0x75a030=_0x3a2fa5[_0x29d5('0x2e')]({'plain':!![]});var _0x386edd='Plugins';return db[_0x29d5('0x2f')][_0x29d5('0x2c')]({'where':{'type':_0x386edd,'resourceId':_0x75a030['id']}})[_0x29d5('0x2d')](function(){return _0x3a2fa5;});})[_0x29d5('0x2d')](function(){_0x2f44cf[_0x29d5('0x22')](0xcc)[_0x29d5('0x21')]();});}};}function handleEntityNotFound(_0x6b6c34,_0x5f2f0c){return function(_0x1fc594){if(!_0x1fc594){_0x6b6c34[_0x29d5('0x20')](0x194);}return _0x1fc594;};}function handleError(_0x4159e4,_0x3820de){_0x3820de=_0x3820de||0x1f4;return function(_0x1b6218){logger['error'](_0x1b6218['stack']);if(_0x1b6218[_0x29d5('0x30')]){delete _0x1b6218['name'];}_0x4159e4[_0x29d5('0x22')](_0x3820de)['send'](_0x1b6218);};}exports[_0x29d5('0x31')]=function(_0x22063e,_0x2f67bd){var _0x21a13f={},_0x5cc4a6={},_0x516875={'count':0x0,'rows':[]};var _0x51a5cc=_[_0x29d5('0x32')](db[_0x29d5('0x33')][_0x29d5('0x34')],function(_0xffcc0f){return{'name':_0xffcc0f['fieldName'],'type':_0xffcc0f[_0x29d5('0x35')][_0x29d5('0x36')]};});_0x5cc4a6[_0x29d5('0x37')]=_[_0x29d5('0x32')](_0x51a5cc,_0x29d5('0x30'));_0x5cc4a6['query']=_[_0x29d5('0x38')](_0x22063e['query']);_0x5cc4a6[_0x29d5('0x39')]=_[_0x29d5('0x3a')](_0x5cc4a6['model'],_0x5cc4a6[_0x29d5('0x3b')]);_0x21a13f[_0x29d5('0x3c')]=_[_0x29d5('0x3a')](_0x5cc4a6[_0x29d5('0x37')],qs['fields'](_0x22063e[_0x29d5('0x3b')][_0x29d5('0x3d')]));_0x21a13f[_0x29d5('0x3c')]=_0x21a13f['attributes'][_0x29d5('0x3e')]?_0x21a13f[_0x29d5('0x3c')]:_0x5cc4a6[_0x29d5('0x37')];if(!_0x22063e[_0x29d5('0x3b')][_0x29d5('0x3f')]('nolimit')){_0x21a13f['limit']=qs[_0x29d5('0x27')](_0x22063e[_0x29d5('0x3b')][_0x29d5('0x27')]);_0x21a13f[_0x29d5('0x26')]=qs['offset'](_0x22063e['query'][_0x29d5('0x26')]);}_0x21a13f[_0x29d5('0x40')]=qs[_0x29d5('0x41')](_0x22063e[_0x29d5('0x3b')][_0x29d5('0x41')]);_0x21a13f[_0x29d5('0x42')]=qs[_0x29d5('0x39')](_[_0x29d5('0x43')](_0x22063e[_0x29d5('0x3b')],_0x5cc4a6['filters']),_0x51a5cc);if(_0x22063e[_0x29d5('0x3b')][_0x29d5('0x44')]){_0x21a13f[_0x29d5('0x42')]=_[_0x29d5('0x45')](_0x21a13f[_0x29d5('0x42')],{'$or':_[_0x29d5('0x32')](_0x51a5cc,function(_0x36658c){if(_0x36658c['type']!==_0x29d5('0x46')){var _0x2eb934={};_0x2eb934[_0x36658c['name']]={'$like':'%'+_0x22063e[_0x29d5('0x3b')]['filter']+'%'};return _0x2eb934;}})});}_0x21a13f=_[_0x29d5('0x45')]({},_0x21a13f,_0x22063e[_0x29d5('0x47')]);var _0x910f61={'where':_0x21a13f[_0x29d5('0x42')]};return db[_0x29d5('0x33')][_0x29d5('0x25')](_0x910f61)[_0x29d5('0x2d')](function(_0x182f41){_0x516875[_0x29d5('0x25')]=_0x182f41;if(_0x22063e[_0x29d5('0x3b')][_0x29d5('0x48')]){_0x21a13f['include']=[{'all':!![]}];}return db[_0x29d5('0x33')][_0x29d5('0x49')](_0x21a13f);})['then'](function(_0x4f697a){_0x516875['rows']=_0x4f697a;return _0x516875;})[_0x29d5('0x2d')](respondWithFilteredResult(_0x2f67bd,_0x21a13f))[_0x29d5('0x4a')](handleError(_0x2f67bd,null));};exports[_0x29d5('0x4b')]=function(_0x4a68d1,_0x51b46c){var _0x2be847={'raw':!![],'where':{'id':_0x4a68d1[_0x29d5('0x4c')]['id']}},_0x297264={};_0x297264[_0x29d5('0x37')]=_[_0x29d5('0x38')](db[_0x29d5('0x33')]['rawAttributes']);_0x297264[_0x29d5('0x3b')]=_[_0x29d5('0x38')](_0x4a68d1['query']);_0x297264[_0x29d5('0x39')]=_['intersection'](_0x297264[_0x29d5('0x37')],_0x297264['query']);_0x2be847[_0x29d5('0x3c')]=_[_0x29d5('0x3a')](_0x297264[_0x29d5('0x37')],qs['fields'](_0x4a68d1[_0x29d5('0x3b')][_0x29d5('0x3d')]));_0x2be847['attributes']=_0x2be847[_0x29d5('0x3c')][_0x29d5('0x3e')]?_0x2be847[_0x29d5('0x3c')]:_0x297264[_0x29d5('0x37')];if(_0x4a68d1['query'][_0x29d5('0x48')]){_0x2be847[_0x29d5('0x4d')]=[{'all':!![]}];}_0x2be847=_[_0x29d5('0x45')]({},_0x2be847,_0x4a68d1[_0x29d5('0x47')]);return db[_0x29d5('0x33')][_0x29d5('0x4e')](_0x2be847)[_0x29d5('0x2d')](handleEntityNotFound(_0x51b46c,null))['then'](respondWithResult(_0x51b46c,null))[_0x29d5('0x4a')](handleError(_0x51b46c,null));};exports[_0x29d5('0x4f')]=function(_0x27a0c4,_0x23c53f,_0xab47dd){return db[_0x29d5('0x33')][_0x29d5('0x4e')]({'where':{'id':_0x27a0c4[_0x29d5('0x4c')]['id']},'attributes':[_0x29d5('0x30'),_0x29d5('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x23c53f,null))[_0x29d5('0x2d')](function(_0x27db38){if(_0x27db38){var _0x35c9db=path['join'](config[_0x29d5('0x50')],_0x29d5('0x51'),util[_0x29d5('0x52')](_0x29d5('0x53'),path[_0x29d5('0x54')](_0x27db38[_0x29d5('0x6')])));var _0x41c036=fs[_0x29d5('0x55')](_0x35c9db);var _0xf72ab2=archiver(_0x29d5('0x56'),{'zlib':{'level':0x9}});_0xf72ab2['on'](_0x29d5('0x57'),function(_0xbf9191){if(_0xbf9191[_0x29d5('0x58')]===_0x29d5('0x59')){logger[_0x29d5('0x5a')](_0xbf9191);}else{throw new db[(_0x29d5('0x5b'))][(_0x29d5('0x5c'))](_0x29d5('0x5d'));}});_0xf72ab2['on'](_0x29d5('0x5a'),function(_0x57a248){throw new db[(_0x29d5('0x5b'))]['Error'](_0x29d5('0x5d'));});_0xf72ab2[_0x29d5('0x5e')](_0x41c036);_0xf72ab2[_0x29d5('0x5f')]('**/*',{'cwd':path[_0x29d5('0x60')](config[_0x29d5('0x50')],_0x29d5('0x51'),path[_0x29d5('0x61')](_0x27db38[_0x29d5('0x6')])),'ignore':[path[_0x29d5('0x60')](path[_0x29d5('0x54')](_0x27db38[_0x29d5('0x6')]),_0x29d5('0x62')),path[_0x29d5('0x60')](path[_0x29d5('0x54')](_0x27db38[_0x29d5('0x6')]),_0x29d5('0x63'))],'nodir':!![]})[_0x29d5('0x64')]();_0x41c036['on']('close',function(){if(!fs[_0x29d5('0x65')](_0x35c9db)){throw new db[(_0x29d5('0x5b'))][(_0x29d5('0x5c'))](_0x29d5('0x66'));}return _0x23c53f['download'](_0x35c9db,util[_0x29d5('0x52')](_0x29d5('0x53'),path[_0x29d5('0x54')](_0x27db38[_0x29d5('0x6')])),function(_0x27fe51){if(_0x27fe51){throw new db[(_0x29d5('0x5b'))][(_0x29d5('0x5c'))](_0x29d5('0x67'));}fs[_0x29d5('0x68')](_0x35c9db);logger['info']('Download\x20completed');logger[_0x29d5('0x69')](_0x29d5('0x6a'));});});}return null;})[_0x29d5('0x4a')](handleError(_0x23c53f,null));};exports[_0x29d5('0x6b')]=function(_0x178393,_0x35d239,_0x1e12c3){var _0x5507c3=path['basename'](_0x178393[_0x29d5('0x6c')][_0x29d5('0x6d')],path[_0x29d5('0x6e')](_0x178393[_0x29d5('0x6c')]['filename']));var _0x4989a5=path[_0x29d5('0x60')](config[_0x29d5('0x50')],'server/files/plugins',_0x178393[_0x29d5('0x6c')][_0x29d5('0x6d')]);var _0x429ee6=path[_0x29d5('0x60')](config[_0x29d5('0x50')],_0x29d5('0x51'),_0x5507c3);logger[_0x29d5('0x69')](_0x29d5('0x6f'),_0x4989a5);logger['info'](_0x29d5('0x70'),_0x429ee6);try{fs[_0x29d5('0x71')](_0x4989a5,parseInt(_0x29d5('0x72'),0x8));extract(_0x4989a5,{'dir':_0x429ee6},function(_0x464cca){if(_0x464cca){logger['error'](_0x464cca);handleError(_0x464cca,!![]);};var _0x21d3ec=fs[_0x29d5('0x73')](_0x429ee6);if(_0x21d3ec['length']>0x1){removeReferences(_0x4989a5,_0x429ee6);logger[_0x29d5('0x5a')](_0x29d5('0x74'));return _0x1e12c3(new Error('Invalid\x20plugin\x20structure'));}var _0x51a5de=fs[_0x29d5('0x75')](path['join'](_0x429ee6,_0x21d3ec[0x0]));if(_0x51a5de['isFile']()){removeReferences(_0x4989a5,_0x429ee6);logger[_0x29d5('0x5a')](_0x29d5('0x74'));return _0x1e12c3(new Error(_0x29d5('0x74')));}if(_0x51a5de[_0x29d5('0x76')]()){var _0xa4cced=fs[_0x29d5('0x73')](path[_0x29d5('0x60')](_0x429ee6,_0x21d3ec[0x0]));if(_0xa4cced[_0x29d5('0x3e')]===0x0){removeReferences(_0x4989a5,_0x429ee6);logger['error']('Invalid\x20plugin\x20structure');return _0x1e12c3(new Error(_0x29d5('0x74')));}var _0x5d76d3=_0xa4cced[_0x29d5('0x77')](function(_0x28566e){return _0x28566e===_0x29d5('0x78');});if(!_0x5d76d3){return _0x1e12c3(new Error('Plugin\x20manifest\x20missing'));}var _0x20b356=fs[_0x29d5('0x79')](path[_0x29d5('0x60')](_0x429ee6,_0x21d3ec[0x0],_0x29d5('0x78')));var _0x4a9145=JSON[_0x29d5('0x7a')](_0x20b356);if(_0x29d5('0x24')==typeof _0x4a9145[_0x29d5('0x30')]){return _0x1e12c3(new Error(_0x29d5('0x7b')));}if(_0x29d5('0x24')==typeof _0x4a9145['type']){return _0x1e12c3(new Error(_0x29d5('0x7c')));}if(_0x29d5('0x24')==typeof _0x4a9145[_0x29d5('0x7d')]){return _0x1e12c3(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x29d5('0x24')==typeof _0x4a9145[_0x29d5('0x7e')]){return _0x1e12c3(new Error(_0x29d5('0x7f')));}if(_0x4a9145['type']==='html'){if(_0x29d5('0x24')==typeof _0x4a9145[_0x29d5('0x7e')]['views']){return _0x1e12c3(new Error(_0x29d5('0x80')));}if(_0x29d5('0x24')==typeof _0x4a9145[_0x29d5('0x7e')]['views'][_0x29d5('0x81')]&&'undefined'==typeof _0x4a9145['parameters'][_0x29d5('0x82')]['agent']){return _0x1e12c3(new Error(_0x29d5('0x83')));}}else if(_0x4a9145[_0x29d5('0x35')]==='script'){if(_0x29d5('0x24')==typeof _0x4a9145[_0x29d5('0x7e')][_0x29d5('0x84')]){return _0x1e12c3(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x29d5('0x24')==typeof _0x4a9145[_0x29d5('0x7e')][_0x29d5('0x85')]){return _0x1e12c3(new Error(_0x29d5('0x86')));}}else{return _0x1e12c3(new Error(_0x29d5('0x87')));}var _0x3ff4cd=_0x4a9145[_0x29d5('0x30')];var _0x585bb8=_0x4a9145['description'];var _0x1559a6=_0x4a9145[_0x29d5('0x35')];var _0x77fd27=_0x4a9145[_0x29d5('0x88')]?_0x4a9145['sidebar']:_0x29d5('0x89');var _0x40e97c=_0x4a9145[_0x29d5('0x8a')]?_0x4a9145['icon']:'icon-apps';var _0x3fdd67='';var _0x22e219='';var _0x56e650='';var _0x5bf829='';var _0x2d2d22=_0x4a9145[_0x29d5('0x7d')];if(_0x1559a6===_0x29d5('0x8b')){if(_0x29d5('0x24')!=typeof _0x4a9145[_0x29d5('0x7e')][_0x29d5('0x82')]['admin']){var _0x1de977=_0x4a9145[_0x29d5('0x7e')][_0x29d5('0x82')][_0x29d5('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x29d5('0x8c')](_0x1de977)){_0x3fdd67=path[_0x29d5('0x60')](_0x29d5('0x8d'),_0x5507c3,_0x21d3ec[0x0],_0x1de977);}else{_0x3fdd67=_0x1de977;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x4a9145[_0x29d5('0x7e')][_0x29d5('0x82')][_0x29d5('0x8e')]){var _0x33ba3f=_0x4a9145['parameters'][_0x29d5('0x82')][_0x29d5('0x8e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x33ba3f)){_0x22e219=path[_0x29d5('0x60')](_0x29d5('0x8d'),_0x5507c3,_0x21d3ec[0x0],_0x33ba3f);}else{_0x22e219=_0x33ba3f;}}else{logger[_0x29d5('0x69')](_0x29d5('0x8f'));}}else if(_0x1559a6===_0x29d5('0x90')){_0x56e650=_0x4a9145[_0x29d5('0x7e')][_0x29d5('0x84')];_0x5bf829=_0x4a9145[_0x29d5('0x7e')][_0x29d5('0x85')];if(_0x29d5('0x24')!=typeof _0x4a9145[_0x29d5('0x7e')]['views']){if(_0x29d5('0x24')!=typeof _0x4a9145[_0x29d5('0x7e')][_0x29d5('0x82')][_0x29d5('0x81')]){var _0x1de977=_0x4a9145['parameters']['views'][_0x29d5('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1de977)){_0x3fdd67=path[_0x29d5('0x60')]('plugins',_0x5507c3,_0x21d3ec[0x0],_0x1de977);}else{_0x3fdd67=_0x1de977;}}if(_0x29d5('0x24')!=typeof _0x4a9145['parameters'][_0x29d5('0x82')][_0x29d5('0x8e')]){var _0x33ba3f=_0x4a9145['parameters'][_0x29d5('0x82')][_0x29d5('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x29d5('0x8c')](_0x33ba3f)){_0x22e219=path['join']('plugins',_0x5507c3,_0x21d3ec[0x0],_0x33ba3f);}else{_0x22e219=_0x33ba3f;}}}}var _0x29760a={'name':_0x3ff4cd,'description':_0x585bb8,'path':path[_0x29d5('0x60')](_0x5507c3,_0x21d3ec[0x0]),'type':_0x1559a6,'sidebar':_0x77fd27,'icon':_0x40e97c,'adminUrl':_0x3fdd67,'agentUrl':_0x22e219,'scriptName':_0x56e650,'scriptPath':_0x5bf829,'version':_0x2d2d22};removeReferences(_0x4989a5,null);return db[_0x29d5('0x33')][_0x29d5('0x91')](_0x29760a)[_0x29d5('0x2d')](function(_0x195ef6){var _0x3da169={'role':_0x178393['body']['role'],'userProfileId':_0x178393[_0x29d5('0x92')][_0x29d5('0x93')]};if(!_0x3da169)throw new Error(_0x29d5('0x94'));if(_0x3da169['role']===_0x29d5('0x95')){var _0xe219b4=_0x195ef6[_0x29d5('0x2e')]({'plain':!![]});return db[_0x29d5('0x96')]['find']({'where':{'name':_0x29d5('0x97'),'userProfileId':_0x3da169[_0x29d5('0x93')]},'raw':!![]})[_0x29d5('0x2d')](function(_0x18ab77){if(_0x18ab77&&_0x18ab77[_0x29d5('0x98')]===0x0){return db[_0x29d5('0x2f')][_0x29d5('0x91')]({'name':_0xe219b4['name'],'resourceId':_0xe219b4['id'],'type':_0x18ab77[_0x29d5('0x30')],'sectionId':_0x18ab77['id']},{})[_0x29d5('0x2d')](function(){return _0x195ef6;});}else{return _0x195ef6;}})['catch'](function(_0x199884){logger[_0x29d5('0x5a')](_0x29d5('0x99'),_0x199884);throw _0x199884;});}return _0x195ef6;})[_0x29d5('0x2d')](respondWithResult(_0x35d239,null))['catch'](handleError(_0x35d239,null));}});}catch(_0xe62f30){_0x35d239[_0x29d5('0x22')](0x1f4)['send'](_0xe62f30);}};function removeReferences(_0x7ed2f5,_0xf6f100){try{if(_0x7ed2f5){fs[_0x29d5('0x68')](_0x7ed2f5);logger[_0x29d5('0x69')](_0x29d5('0x9a'));}if(_0xf6f100){rimraf(_0xf6f100,function(){});logger['info'](_0x29d5('0x9b'));}}catch(_0x162784){logger[_0x29d5('0x5a')](_0x162784);}}exports[_0x29d5('0x2b')]=function(_0x2d1ef6,_0x35ee94,_0x8f4fd3){return db[_0x29d5('0x33')][_0x29d5('0x4e')]({'where':{'id':_0x2d1ef6['params']['id']}})['then'](handleEntityNotFound(_0x35ee94,null))[_0x29d5('0x2d')](saveUpdates(_0x2d1ef6[_0x29d5('0x92')],null))[_0x29d5('0x2d')](respondWithResult(_0x35ee94,null))[_0x29d5('0x4a')](handleError(_0x35ee94,null));};exports['delete']=function(_0x14ecd4,_0xb9d443,_0x12c58f){return db[_0x29d5('0x33')][_0x29d5('0x4e')]({'where':{'id':_0x14ecd4[_0x29d5('0x4c')]['id']}})['then'](function(_0x97eb1d){if(_0x97eb1d){return _0x97eb1d[_0x29d5('0x2c')]();}})[_0x29d5('0x2d')](function(_0x127d80){rimraf(path[_0x29d5('0x60')](config[_0x29d5('0x50')],_0x29d5('0x51'),path['dirname'](_0x127d80[_0x29d5('0x6')])),function(){});return _0x127d80;})[_0x29d5('0x2d')](handleEntityNotFound(_0xb9d443,null))['then'](respondWithStatusCode(_0xb9d443,null))['catch'](handleError(_0xb9d443,null));};exports['webhookGet']=function(_0x5c9e26,_0x11c683,_0x51a613){return BPromise[_0x29d5('0x9c')]()['then'](function(){if(!_0x5c9e26['query'][_0x29d5('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5c9e26['query']['port']){throw new Error(_0x29d5('0x9d'));}var _0x5914aa=_0x5c9e26[_0x29d5('0x3b')][_0x29d5('0x9e')]?_0x5c9e26[_0x29d5('0x3b')]['hostname']+':'+_0x5c9e26['query']['port']:_0x29d5('0x9f')+_0x5c9e26[_0x29d5('0x3b')]['port'];var _0x1980c2=_0x5c9e26[_0x29d5('0x3b')]['json']?_0x5c9e26[_0x29d5('0x3b')][_0x29d5('0x23')]:!![];var _0x1e69ad=_0x5c9e26[_0x29d5('0x3b')]['encoding']?_0x5c9e26[_0x29d5('0x3b')][_0x29d5('0xa0')]:null;var _0x2a5abd={'method':_0x5c9e26[_0x29d5('0xa1')],'uri':util[_0x29d5('0x52')]('%s%s',_0x5914aa,_0x5c9e26[_0x29d5('0x3b')][_0x29d5('0x6')]),'json':_0x1980c2,'resolveWithFullResponse':!![],'encoding':_0x1e69ad,'qs':_0x5c9e26[_0x29d5('0x3b')]};if(_0x5c9e26['headers']){_0x2a5abd[_0x29d5('0xa2')]=_0x5c9e26['headers'];if(_0x2a5abd['headers'][_0x29d5('0xa3')]){delete _0x2a5abd[_0x29d5('0xa2')][_0x29d5('0xa3')];}}if(_0x2a5abd[_0x29d5('0xa2')]['content-type']){delete _0x2a5abd[_0x29d5('0xa2')][_0x29d5('0xa4')];}return rp(_0x2a5abd);})[_0x29d5('0x2d')](function(_0x24df3a){if(_0x24df3a){_0x11c683[_0x29d5('0x28')](_0x24df3a[_0x29d5('0xa2')]);logger[_0x29d5('0x69')](_0x24df3a[_0x29d5('0x92')]);if(_[_0x29d5('0xa5')](_0x5c9e26[_0x29d5('0x3b')]['path'],_0x29d5('0x4f'))&&_0x24df3a['statusCode']==0x1f4){return _0x11c683[_0x29d5('0x20')](_0x24df3a[_0x29d5('0xa6')]);}else{return _0x11c683[_0x29d5('0x22')](_0x24df3a['statusCode'])['send'](_0x24df3a[_0x29d5('0x92')]);}}else{return _0x11c683[_0x29d5('0x20')](0xc8);}})[_0x29d5('0x4a')](handleError(_0x11c683,null));};exports[_0x29d5('0xa7')]=function(_0x22938a,_0x34f0fa,_0x268868){return BPromise[_0x29d5('0x9c')]()[_0x29d5('0x2d')](function(){if(!_0x22938a['query'][_0x29d5('0x6')]){throw new Error(_0x29d5('0xa8'));}if(!_0x22938a['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x315f6d=_0x22938a[_0x29d5('0x3b')]['hostname']?_0x22938a[_0x29d5('0x3b')][_0x29d5('0x9e')]+':'+_0x22938a[_0x29d5('0x3b')][_0x29d5('0xa9')]:_0x29d5('0x9f')+_0x22938a[_0x29d5('0x3b')][_0x29d5('0xa9')];var _0x5402e6=_0x22938a[_0x29d5('0x3b')][_0x29d5('0x23')]?_0x22938a[_0x29d5('0x3b')][_0x29d5('0x23')]:!![];var _0x20aa61=_0x22938a[_0x29d5('0x3b')]['encoding']?_0x22938a[_0x29d5('0x3b')]['encoding']:null;var _0xb8834e={'method':_0x22938a[_0x29d5('0xa1')],'uri':util['format']('%s%s',_0x315f6d,_0x22938a['query'][_0x29d5('0x6')]),'json':_0x5402e6,'resolveWithFullResponse':!![],'encoding':_0x20aa61,'body':_0x22938a['body']};if(_0x22938a[_0x29d5('0xa2')]){_0xb8834e[_0x29d5('0xa2')]=_0x22938a[_0x29d5('0xa2')];if(_0xb8834e[_0x29d5('0xa2')]['content-length']){delete _0xb8834e[_0x29d5('0xa2')][_0x29d5('0xa3')];}}if(_0xb8834e[_0x29d5('0xa2')][_0x29d5('0xa4')]){delete _0xb8834e[_0x29d5('0xa2')][_0x29d5('0xa4')];}return rp(_0xb8834e);})[_0x29d5('0x2d')](function(_0x571041){if(_0x571041){_0x34f0fa[_0x29d5('0x28')](_0x571041[_0x29d5('0xa2')]);logger['info'](_0x571041[_0x29d5('0x92')]);return _0x34f0fa[_0x29d5('0x22')](_0x571041['statusCode'])[_0x29d5('0xaa')](_0x571041[_0x29d5('0x92')]);}else{return _0x34f0fa[_0x29d5('0x20')](0xc8);}})['catch'](handleError(_0x34f0fa,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index db44da2..9cffafe 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 _0xe6e9=['../../mysqldb','Plugin','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0xe6e9,0x182));var _0x9e6e=function(_0x4e19fd,_0x3e7150){_0x4e19fd=_0x4e19fd-0x0;var _0x4b8376=_0xe6e9[_0x4e19fd];return _0x4b8376;};'use strict';var EventEmitter=require(_0x9e6e('0x0'));var Plugin=require(_0x9e6e('0x1'))['db'][_0x9e6e('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e6e('0x3'),'afterUpdate':_0x9e6e('0x4'),'afterDestroy':_0x9e6e('0x5')};function emitEvent(_0x3313dc){return function(_0x1f6d79,_0x5f4c0b,_0x1f64e8){PluginEvents[_0x9e6e('0x6')](_0x3313dc+':'+_0x1f6d79['id'],_0x1f6d79);PluginEvents[_0x9e6e('0x6')](_0x3313dc,_0x1f6d79);_0x1f64e8(null);};}for(var e in events){if(events[_0x9e6e('0x7')](e)){var event=events[e];Plugin[_0x9e6e('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x6347=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6347,0x1c9));var _0x7634=function(_0x26f00c,_0x48c518){_0x26f00c=_0x26f00c-0x0;var _0x1a8b19=_0x6347[_0x26f00c];return _0x1a8b19;};'use strict';var EventEmitter=require(_0x7634('0x0'));var Plugin=require(_0x7634('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x7634('0x2')](0x0);var events={'afterCreate':_0x7634('0x3'),'afterUpdate':_0x7634('0x4'),'afterDestroy':_0x7634('0x5')};function emitEvent(_0x5000ac){return function(_0x57701b,_0x575540,_0x1dc7af){PluginEvents[_0x7634('0x6')](_0x5000ac+':'+_0x57701b['id'],_0x57701b);PluginEvents['emit'](_0x5000ac,_0x57701b);_0x1dc7af(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x7634('0x7')](e,emitEvent(event));}}module[_0x7634('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 5595123..ae818e3 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 _0x5dcd=['request-promise','path','../../config/environment','./plugin.attributes','define','plugins','lodash','util','../../config/logger','moment','bluebird'];(function(_0x20e352,_0x2a3b60){var _0x386c27=function(_0x38f70c){while(--_0x38f70c){_0x20e352['push'](_0x20e352['shift']());}};_0x386c27(++_0x2a3b60);}(_0x5dcd,0xf8));var _0xd5dc=function(_0x3e11f8,_0x12f59c){_0x3e11f8=_0x3e11f8-0x0;var _0x410e1a=_0x5dcd[_0x3e11f8];return _0x410e1a;};'use strict';var _=require(_0xd5dc('0x0'));var util=require(_0xd5dc('0x1'));var logger=require(_0xd5dc('0x2'))('api');var moment=require(_0xd5dc('0x3'));var BPromise=require(_0xd5dc('0x4'));var rp=require(_0xd5dc('0x5'));var fs=require('fs');var path=require(_0xd5dc('0x6'));var rimraf=require('rimraf');var config=require(_0xd5dc('0x7'));var attributes=require(_0xd5dc('0x8'));module['exports']=function(_0x61115c,_0x28e34f){return _0x61115c[_0xd5dc('0x9')]('Plugin',attributes,{'tableName':_0xd5dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa12b=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./plugin.attributes','define','plugins'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xa12b,0xf0));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba12('0x0'));var util=require('util');var logger=require(_0xba12('0x1'))(_0xba12('0x2'));var moment=require(_0xba12('0x3'));var BPromise=require('bluebird');var rp=require(_0xba12('0x4'));var fs=require('fs');var path=require(_0xba12('0x5'));var rimraf=require('rimraf');var config=require(_0xba12('0x6'));var attributes=require(_0xba12('0x7'));module['exports']=function(_0x13c13c,_0x1970dd){return _0x13c13c[_0xba12('0x8')]('Plugin',attributes,{'tableName':_0xba12('0x9'),'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 b44a087..4e728e6 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 _0x30a6=['catch','CreatePlugin','Plugin','create','body','raw','stringify','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30a6,0x1ab));var _0x630a=function(_0x44b134,_0x360778){_0x44b134=_0x44b134-0x0;var _0x140bee=_0x30a6[_0x44b134];return _0x140bee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x630a('0x0'));var BPromise=require(_0x630a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630a('0x2'));var db=require(_0x630a('0x3'))['db'];var utils=require(_0x630a('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x630a('0x5'));var client=jayson[_0x630a('0x6')][_0x630a('0x7')]({'port':0x232a});config[_0x630a('0x8')]=_[_0x630a('0x9')](config['redis'],{'host':_0x630a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x630a('0x8')]));require(_0x630a('0xb'))[_0x630a('0xc')](socket);function respondWithRpcPromise(_0x343fc7,_0x6fa003,_0x123506){return new BPromise(function(_0x33f4c2,_0x5525a7){return client[_0x630a('0xd')](_0x343fc7,_0x123506)[_0x630a('0xe')](function(_0x3209bc){logger[_0x630a('0xf')](_0x630a('0x10'),_0x6fa003,_0x630a('0x11'));logger[_0x630a('0x12')](_0x630a('0x13'),_0x6fa003,_0x630a('0x11'),JSON['stringify'](_0x3209bc));if(_0x3209bc[_0x630a('0x14')]){if(_0x3209bc[_0x630a('0x14')][_0x630a('0x15')]===0x1f4){logger['error'](_0x630a('0x10'),_0x6fa003,_0x3209bc[_0x630a('0x14')][_0x630a('0x16')]);return _0x5525a7(_0x3209bc[_0x630a('0x14')][_0x630a('0x16')]);}logger[_0x630a('0x14')](_0x630a('0x10'),_0x6fa003,_0x3209bc[_0x630a('0x14')][_0x630a('0x16')]);return _0x33f4c2(_0x3209bc[_0x630a('0x14')][_0x630a('0x16')]);}else{logger[_0x630a('0xf')](_0x630a('0x10'),_0x6fa003,'request\x20sent');_0x33f4c2(_0x3209bc['result'][_0x630a('0x16')]);}})[_0x630a('0x17')](function(_0x46dfe2){logger[_0x630a('0x14')](_0x630a('0x10'),_0x6fa003,_0x46dfe2);_0x5525a7(_0x46dfe2);});});}exports[_0x630a('0x18')]=function(_0x55e433){var _0x5d5614=this;return new Promise(function(_0x5a8071,_0x2ed83f){return db[_0x630a('0x19')][_0x630a('0x1a')](_0x55e433[_0x630a('0x1b')],{'raw':_0x55e433['options']?_0x55e433['options'][_0x630a('0x1c')]===undefined?!![]:![]:!![]})[_0x630a('0xe')](function(_0x355c5d){logger[_0x630a('0xf')](_0x630a('0x18'),_0x55e433);logger[_0x630a('0x12')](_0x630a('0x18'),_0x55e433,JSON[_0x630a('0x1d')](_0x355c5d));_0x5a8071(_0x355c5d);})[_0x630a('0x17')](function(_0x27853c){logger['error'](_0x630a('0x18'),_0x27853c['message'],_0x55e433);_0x2ed83f(_0x5d5614[_0x630a('0x14')](0x1f4,_0x27853c[_0x630a('0x16')]));});});}; \ No newline at end of file +var _0xde53=['create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin'];(function(_0x9a2097,_0x3550fd){var _0x1be5eb=function(_0x5c52db){while(--_0x5c52db){_0x9a2097['push'](_0x9a2097['shift']());}};_0x1be5eb(++_0x3550fd);}(_0xde53,0x163));var _0x3de5=function(_0x22b471,_0x3fe469){_0x22b471=_0x22b471-0x0;var _0x1bb618=_0xde53[_0x22b471];return _0x1bb618;};'use strict';var _=require(_0x3de5('0x0'));var util=require(_0x3de5('0x1'));var moment=require(_0x3de5('0x2'));var BPromise=require(_0x3de5('0x3'));var rs=require(_0x3de5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3de5('0x5'))['db'];var utils=require(_0x3de5('0x6'));var logger=require(_0x3de5('0x7'))(_0x3de5('0x8'));var config=require(_0x3de5('0x9'));var jayson=require(_0x3de5('0xa'));var client=jayson['client'][_0x3de5('0xb')]({'port':0x232a});config[_0x3de5('0xc')]=_[_0x3de5('0xd')](config[_0x3de5('0xc')],{'host':_0x3de5('0xe'),'port':0x18eb});var socket=require(_0x3de5('0xf'))(new Redis(config[_0x3de5('0xc')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x1a7f32,_0x1b89c2,_0x6baafd){return new BPromise(function(_0x5394be,_0x311e8a){return client[_0x3de5('0x10')](_0x1a7f32,_0x6baafd)[_0x3de5('0x11')](function(_0x2a7293){logger[_0x3de5('0x12')]('Plugin,\x20%s,\x20%s',_0x1b89c2,_0x3de5('0x13'));logger['debug'](_0x3de5('0x14'),_0x1b89c2,_0x3de5('0x13'),JSON[_0x3de5('0x15')](_0x2a7293));if(_0x2a7293[_0x3de5('0x16')]){if(_0x2a7293[_0x3de5('0x16')][_0x3de5('0x17')]===0x1f4){logger[_0x3de5('0x16')](_0x3de5('0x18'),_0x1b89c2,_0x2a7293[_0x3de5('0x16')][_0x3de5('0x19')]);return _0x311e8a(_0x2a7293[_0x3de5('0x16')][_0x3de5('0x19')]);}logger[_0x3de5('0x16')](_0x3de5('0x18'),_0x1b89c2,_0x2a7293[_0x3de5('0x16')]['message']);return _0x5394be(_0x2a7293[_0x3de5('0x16')][_0x3de5('0x19')]);}else{logger['info'](_0x3de5('0x18'),_0x1b89c2,_0x3de5('0x13'));_0x5394be(_0x2a7293[_0x3de5('0x1a')][_0x3de5('0x19')]);}})[_0x3de5('0x1b')](function(_0x79ad2e){logger['error'](_0x3de5('0x18'),_0x1b89c2,_0x79ad2e);_0x311e8a(_0x79ad2e);});});}exports[_0x3de5('0x1c')]=function(_0x569177){var _0xcd06b9=this;return new Promise(function(_0x4c845e,_0x112aed){return db[_0x3de5('0x1d')][_0x3de5('0x1e')](_0x569177[_0x3de5('0x1f')],{'raw':_0x569177[_0x3de5('0x20')]?_0x569177[_0x3de5('0x20')][_0x3de5('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x58208f){logger[_0x3de5('0x12')](_0x3de5('0x1c'),_0x569177);logger[_0x3de5('0x22')](_0x3de5('0x1c'),_0x569177,JSON[_0x3de5('0x15')](_0x58208f));_0x4c845e(_0x58208f);})[_0x3de5('0x1b')](function(_0x31f1d8){logger[_0x3de5('0x16')]('CreatePlugin',_0x31f1d8['message'],_0x569177);_0x112aed(_0xcd06b9[_0x3de5('0x16')](0x1f4,_0x31f1d8['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index cbdc50a..757afd6 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 _0x0b42=['removeListener','register','length','plugin:','remove','update'];(function(_0x516baa,_0xe4862f){var _0x1df0ca=function(_0x1dd2e5){while(--_0x1dd2e5){_0x516baa['push'](_0x516baa['shift']());}};_0x1df0ca(++_0xe4862f);}(_0x0b42,0x76));var _0x20b4=function(_0x3c68df,_0x33115b){_0x3c68df=_0x3c68df-0x0;var _0x3b6180=_0x0b42[_0x3c68df];return _0x3b6180;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x20b4('0x0'),_0x20b4('0x1')];function createListener(_0x2c8178,_0xbb96a1){return function(_0x376d35){_0xbb96a1['emit'](_0x2c8178,_0x376d35);};}function removeListener(_0x595792,_0x2604d1){return function(){PluginEvents[_0x20b4('0x2')](_0x595792,_0x2604d1);};}exports[_0x20b4('0x3')]=function(_0x3c2cfd){for(var _0x523a54=0x0,_0x2428c9=events[_0x20b4('0x4')];_0x523a54<_0x2428c9;_0x523a54++){var _0x174df2=events[_0x523a54];var _0x7ef686=createListener(_0x20b4('0x5')+_0x174df2,_0x3c2cfd);PluginEvents['on'](_0x174df2,_0x7ef686);}}; \ No newline at end of file +var _0xd86d=['emit','removeListener','register','length','./plugin.events','save','remove','update'];(function(_0x9a38b3,_0x1a4222){var _0x54c0db=function(_0x1b8fa7){while(--_0x1b8fa7){_0x9a38b3['push'](_0x9a38b3['shift']());}};_0x54c0db(++_0x1a4222);}(_0xd86d,0x1d4));var _0xdd86=function(_0x3d65ca,_0x467198){_0x3d65ca=_0x3d65ca-0x0;var _0x2a5828=_0xd86d[_0x3d65ca];return _0x2a5828;};'use strict';var PluginEvents=require(_0xdd86('0x0'));var events=[_0xdd86('0x1'),_0xdd86('0x2'),_0xdd86('0x3')];function createListener(_0x2669ca,_0x2eb74d){return function(_0x4e97ea){_0x2eb74d[_0xdd86('0x4')](_0x2669ca,_0x4e97ea);};}function removeListener(_0x2df94d,_0x21c257){return function(){PluginEvents[_0xdd86('0x5')](_0x2df94d,_0x21c257);};}exports[_0xdd86('0x6')]=function(_0x2629bf){for(var _0x15e1a6=0x0,_0x8616f6=events[_0xdd86('0x7')];_0x15e1a6<_0x8616f6;_0x15e1a6++){var _0x298847=events[_0x15e1a6];var _0x19bc69=createListener('plugin:'+_0x298847,_0x2629bf);PluginEvents['on'](_0x298847,_0x19bc69);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f6b6563..ff6b8f7 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(_0x5e1bbe,_0x357d56){var _0x1e2a4b=function(_0x27d369){while(--_0x27d369){_0x5e1bbe['push'](_0x5e1bbe['shift']());}};_0x1e2a4b(++_0x357d56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x16c098,_0x1b3b0a){var _0x30943d=function(_0x94ac69){while(--_0x94ac69){_0x16c098['push'](_0x16c098['shift']());}};_0x30943d(++_0x1b3b0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 9913066..3f0b954 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 _0x44a3=['hasOwnProperty','params','Unknown\x20status','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','send','info','index','list','then','reject','express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop'];(function(_0x21fa37,_0x46fff2){var _0x2eb59e=function(_0x2d2283){while(--_0x2d2283){_0x21fa37['push'](_0x21fa37['shift']());}};_0x2eb59e(++_0x46fff2);}(_0x44a3,0x1a9));var _0x344a=function(_0x74c1ee,_0x533e4f){_0x74c1ee=_0x74c1ee-0x0;var _0x43f6dc=_0x44a3[_0x74c1ee];return _0x43f6dc;};'use strict';var _=require(_0x344a('0x0'));var pm2=require(_0x344a('0x1'));var logger=require(_0x344a('0x2'))(_0x344a('0x3'));var path=require(_0x344a('0x4'));var exec=require(_0x344a('0x5'))[_0x344a('0x6')];var BPromise=require(_0x344a('0x7'));function handleEntityNotFound(_0x528a13,_0x23004c){return function(_0x1bc716){if(!_0x1bc716){_0x528a13[_0x344a('0x8')](0x194);;}return _0x1bc716;};}function respondWithResult(_0x28b51e,_0x39984a){_0x39984a=_0x39984a||0xc8;return function(_0x504bd1){if(_0x504bd1){return _0x28b51e['status'](_0x39984a)['json'](_0x504bd1);}return null;};}function handleError(_0x484661,_0x475dab){_0x475dab=_0x475dab||0x1f4;return function(_0x2f9486){logger[_0x344a('0x9')](_0x2f9486[_0x344a('0xa')]);if(_0x2f9486[_0x344a('0xb')]){delete _0x2f9486['name'];}_0x484661[_0x344a('0xc')](_0x475dab)[_0x344a('0xd')](_0x2f9486);};}function execChildProcess(){return new BPromise(function(_0x559406,_0x2734ec){exec('npm\x20install',function(_0x397476,_0x5e6c98,_0xd53a4f){logger[_0x344a('0xe')](_0x5e6c98);logger['info'](_0xd53a4f);if(_0x397476){logger['error'](_0x397476);return _0x2734ec(_0x397476);}return _0x559406(_0x5e6c98);});});}exports[_0x344a('0xf')]=function(_0x2ad7eb,_0x3a974e){return pm2[_0x344a('0x10')]()[_0x344a('0x11')](function(_0x133ad4){if(_0x133ad4){var _0x4ee562=_[_0x344a('0x12')](_0x133ad4,function(_0x2360e9){return _0x2360e9[_0x344a('0xb')]===_0x344a('0x13')||_0x2360e9['name']==='motion2';});return{'rows':_0x4ee562,'count':_0x4ee562[_0x344a('0x14')]};}return null;})[_0x344a('0x11')](respondWithResult(_0x3a974e,null))[_0x344a('0x15')](handleError(_0x3a974e,null));};exports[_0x344a('0x16')]=function(_0x48b3ab,_0x397de6){return pm2[_0x344a('0x17')](_0x48b3ab['params']['id'])[_0x344a('0x11')](respondWithResult(_0x397de6,null))[_0x344a('0x11')](handleEntityNotFound(_0x397de6,null))[_0x344a('0x15')](handleError(_0x397de6,null));};exports[_0x344a('0x18')]=function(_0x13b382,_0x43fa0f){if(_0x13b382[_0x344a('0x19')][_0x344a('0xb')]&&_0x13b382[_0x344a('0x19')][_0x344a('0x1a')]){var _0x4b3552=path[_0x344a('0x1b')](__dirname,_0x344a('0x1c'),_0x13b382[_0x344a('0x19')][_0x344a('0x1a')]);var _0x240be3=process[_0x344a('0x1d')]();process[_0x344a('0x1e')](path[_0x344a('0x1f')](_0x4b3552));return execChildProcess()[_0x344a('0x11')](function(_0x27f527){process[_0x344a('0x1e')](_0x240be3);return pm2[_0x344a('0x20')]({'name':_0x13b382[_0x344a('0x19')][_0x344a('0xb')],'script':_0x4b3552});})['then'](function(_0x6ccfba){pm2['dump']();return _0x6ccfba[0x0];})[_0x344a('0x11')](respondWithResult(_0x43fa0f,0xc9))['catch'](handleError(_0x43fa0f,null));}else{return _0x43fa0f[_0x344a('0xc')](0x1f4)[_0x344a('0xd')]({'message':_0x344a('0x21')});}};exports[_0x344a('0x22')]=function(_0x26f059,_0x28749b){if(_0x26f059[_0x344a('0x19')]['id']){delete _0x26f059[_0x344a('0x19')]['id'];}var _0x4f2499={'online':_0x344a('0x23'),'stopped':_0x344a('0x24')};if(_0x4f2499[_0x344a('0x25')](_0x26f059[_0x344a('0x19')][_0x344a('0xc')])){return pm2[_0x4f2499[_0x26f059[_0x344a('0x19')]['status']]](_0x26f059[_0x344a('0x26')]['id'])['then'](respondWithResult(_0x28749b,0xc8))['catch'](handleError(_0x28749b,null));}else{return _0x28749b[_0x344a('0xc')](0x1f4)[_0x344a('0xd')]({'message':_0x344a('0x27')});}};exports['destroy']=function(_0x5cd9c6,_0x5cafd2){if(_0x5cd9c6[_0x344a('0x19')]['id']){delete _0x5cd9c6[_0x344a('0x19')]['id'];}if(_0x5cd9c6[_0x344a('0x26')]['id']){return pm2['delete'](_0x5cd9c6[_0x344a('0x26')]['id'])[_0x344a('0x11')](function(_0x71f3ec){pm2[_0x344a('0x28')]();return _0x71f3ec[0x0];})[_0x344a('0x11')](respondWithResult(_0x5cafd2,null))[_0x344a('0x15')](handleError(_0x5cafd2,null));}else{return _0x5cafd2[_0x344a('0xc')](0x1f4)['send']({'message':_0x344a('0x29')});}}; \ No newline at end of file +var _0xb43b=['stack','name','send','npm\x20install','info','index','list','express','then','describe','catch','create','body','script','join','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','bluebird','status','json'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb43b,0x1b2));var _0xbb43=function(_0x60446c,_0x406498){_0x60446c=_0x60446c-0x0;var _0x335726=_0xb43b[_0x60446c];return _0x335726;};'use strict';var _=require(_0xbb43('0x0'));var pm2=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var path=require(_0xbb43('0x3'));var exec=require(_0xbb43('0x4'))['exec'];var BPromise=require(_0xbb43('0x5'));function handleEntityNotFound(_0x41aff6,_0x351254){return function(_0x16432a){if(!_0x16432a){_0x41aff6['sendStatus'](0x194);;}return _0x16432a;};}function respondWithResult(_0x491fb9,_0x378df5){_0x378df5=_0x378df5||0xc8;return function(_0x553520){if(_0x553520){return _0x491fb9[_0xbb43('0x6')](_0x378df5)[_0xbb43('0x7')](_0x553520);}return null;};}function handleError(_0x2a2f11,_0x29ae1a){_0x29ae1a=_0x29ae1a||0x1f4;return function(_0x364718){logger['error'](_0x364718[_0xbb43('0x8')]);if(_0x364718[_0xbb43('0x9')]){delete _0x364718['name'];}_0x2a2f11[_0xbb43('0x6')](_0x29ae1a)[_0xbb43('0xa')](_0x364718);};}function execChildProcess(){return new BPromise(function(_0xd37cdf,_0x5e3611){exec(_0xbb43('0xb'),function(_0x2bef86,_0x480cc2,_0x36a473){logger[_0xbb43('0xc')](_0x480cc2);logger['info'](_0x36a473);if(_0x2bef86){logger['error'](_0x2bef86);return _0x5e3611(_0x2bef86);}return _0xd37cdf(_0x480cc2);});});}exports[_0xbb43('0xd')]=function(_0x4a3714,_0x593d0b){return pm2[_0xbb43('0xe')]()['then'](function(_0x68d45d){if(_0x68d45d){var _0x43021d=_['reject'](_0x68d45d,function(_0x4a6e18){return _0x4a6e18['name']===_0xbb43('0xf')||_0x4a6e18[_0xbb43('0x9')]==='motion2';});return{'rows':_0x43021d,'count':_0x43021d['length']};}return null;})[_0xbb43('0x10')](respondWithResult(_0x593d0b,null))['catch'](handleError(_0x593d0b,null));};exports['show']=function(_0x2b0797,_0x8242ab){return pm2[_0xbb43('0x11')](_0x2b0797['params']['id'])[_0xbb43('0x10')](respondWithResult(_0x8242ab,null))['then'](handleEntityNotFound(_0x8242ab,null))[_0xbb43('0x12')](handleError(_0x8242ab,null));};exports[_0xbb43('0x13')]=function(_0x4dfc54,_0x5d765b){if(_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')]&&_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x15')]){var _0x5bcce7=path[_0xbb43('0x16')](__dirname,'../../files/plugins',_0x4dfc54[_0xbb43('0x14')]['script']);var _0x2f5e31=process['cwd']();process[_0xbb43('0x17')](path[_0xbb43('0x18')](_0x5bcce7));return execChildProcess()['then'](function(_0x1d0768){process['chdir'](_0x2f5e31);return pm2[_0xbb43('0x19')]({'name':_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')],'script':_0x5bcce7});})['then'](function(_0x53f0d5){pm2['dump']();return _0x53f0d5[0x0];})[_0xbb43('0x10')](respondWithResult(_0x5d765b,0xc9))[_0xbb43('0x12')](handleError(_0x5d765b,null));}else{return _0x5d765b['status'](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x1a')});}};exports[_0xbb43('0x1b')]=function(_0x3874fb,_0x4ed43f){if(_0x3874fb['body']['id']){delete _0x3874fb[_0xbb43('0x14')]['id'];}var _0x42800f={'online':_0xbb43('0x1c'),'stopped':_0xbb43('0x1d')};if(_0x42800f[_0xbb43('0x1e')](_0x3874fb[_0xbb43('0x14')][_0xbb43('0x6')])){return pm2[_0x42800f[_0x3874fb[_0xbb43('0x14')]['status']]](_0x3874fb[_0xbb43('0x1f')]['id'])['then'](respondWithResult(_0x4ed43f,0xc8))[_0xbb43('0x12')](handleError(_0x4ed43f,null));}else{return _0x4ed43f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x20')});}};exports['destroy']=function(_0x157d62,_0x547a6f){if(_0x157d62['body']['id']){delete _0x157d62['body']['id'];}if(_0x157d62[_0xbb43('0x1f')]['id']){return pm2['delete'](_0x157d62[_0xbb43('0x1f')]['id'])[_0xbb43('0x10')](function(_0xc577ac){pm2['dump']();return _0xc577ac[0x0];})[_0xbb43('0x10')](respondWithResult(_0x547a6f,null))[_0xbb43('0x12')](handleError(_0x547a6f,null));}else{return _0x547a6f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x21')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index b84d717..370fd7d 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 _0xbf3f=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getQueues','exports','express','Router'];(function(_0x2606d9,_0x49939b){var _0x293d4b=function(_0x35e3c1){while(--_0x35e3c1){_0x2606d9['push'](_0x2606d9['shift']());}};_0x293d4b(++_0x49939b);}(_0xbf3f,0x139));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xfbf3('0x0'));var router=express[_0xfbf3('0x1')]();var auth=require(_0xfbf3('0x2'));var controller=require(_0xfbf3('0x3'));router[_0xfbf3('0x4')](_0xfbf3('0x5'),auth[_0xfbf3('0x6')](),controller['getAgents']);router[_0xfbf3('0x4')]('/queues',auth[_0xfbf3('0x6')](),controller[_0xfbf3('0x7')]);module[_0xfbf3('0x8')]=router; \ No newline at end of file +var _0xd141=['./realtime.controller','/agents','isAuthenticated','getAgents','get','getQueues','exports','express','../../components/auth/service'];(function(_0x36e5c6,_0x220dba){var _0x2eaaa4=function(_0xca7ebb){while(--_0xca7ebb){_0x36e5c6['push'](_0x36e5c6['shift']());}};_0x2eaaa4(++_0x220dba);}(_0xd141,0xcd));var _0x1d14=function(_0x5c7306,_0x1079ec){_0x5c7306=_0x5c7306-0x0;var _0x8b07ee=_0xd141[_0x5c7306];return _0x8b07ee;};'use strict';var express=require(_0x1d14('0x0'));var router=express['Router']();var auth=require(_0x1d14('0x1'));var controller=require(_0x1d14('0x2'));router['get'](_0x1d14('0x3'),auth[_0x1d14('0x4')](),controller[_0x1d14('0x5')]);router[_0x1d14('0x6')]('/queues',auth[_0x1d14('0x4')](),controller[_0x1d14('0x7')]);module[_0x1d14('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 18b9105..72ac362 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 _0x9eca=['Pause','startCase','QueueId','idle','unknown','ringing','isNil','chatPause','mailPause','smsPause','voicePause','whatsappPause','every','chatStatus','openchannelStatus','pause','*pause','getAgents','lastLoginAt','pauseType','lastPauseAt','address','smsCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','smsStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','openchannelPause','resolve','User','rawAttributes','fieldName','type','key','agent','query','user','role','nolimit','sort','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','mail','chat','sms','openchannel','includes','channel','toLowerCase','getOptions','userProfileId','UserProfile','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','offset','limit','count','set','Content-Range','json','error','name','status','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','outbound','push','pTalking','originated','Trunk','startPredictive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','busy','find','pick','filter','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','paused','voiceStatus','online','loggedInDb','Queue'];(function(_0x464b39,_0x19d526){var _0x1fc015=function(_0x461291){while(--_0x461291){_0x464b39['push'](_0x464b39['shift']());}};_0x1fc015(++_0x19d526);}(_0x9eca,0xd2));var _0xa9ec=function(_0x248a43,_0x59e52a){_0x248a43=_0x248a43-0x0;var _0x451379=_0x9eca[_0x248a43];return _0x451379;};'use strict';var util=require(_0xa9ec('0x0'));var _=require('lodash');var jayson=require(_0xa9ec('0x1'));var qs=require(_0xa9ec('0x2'));var logger=require(_0xa9ec('0x3'))(_0xa9ec('0x4'));var db=require(_0xa9ec('0x5'))['db'];var amiClient=jayson['client'][_0xa9ec('0x6')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x1ab2a0,_0x4f4638){return function(_0x50bea8){if(_0x50bea8){var _0xfc1912=typeof _0x4f4638[_0xa9ec('0x7')]==='undefined'&&typeof _0x4f4638[_0xa9ec('0x8')]==='undefined';var _0x1b8b21=_0x50bea8['count'];var _0x2a5dc2=_0xfc1912?0x0:_0x4f4638['offset'];var _0x4f4975=_0xfc1912?_0x50bea8[_0xa9ec('0x9')]:_0x4f4638['offset']+_0x4f4638[_0xa9ec('0x8')];var _0x201729;if(_0x4f4975>=_0x1b8b21){_0x4f4975=_0x1b8b21;_0x201729=0xc8;}else{_0x201729=0xce;}_0x1ab2a0['status'](_0x201729);return _0x1ab2a0[_0xa9ec('0xa')](_0xa9ec('0xb'),_0x2a5dc2+'-'+_0x4f4975+'/'+_0x1b8b21)[_0xa9ec('0xc')](_0x50bea8);}return null;};}function handleError(_0x29cb80,_0x3aa332){_0x3aa332=_0x3aa332||0x1f4;return function(_0x306734){logger[_0xa9ec('0xd')](_0x306734['stack']);if(_0x306734['name']){delete _0x306734[_0xa9ec('0xe')];}_0x29cb80[_0xa9ec('0xf')](_0x3aa332)['send'](_0x306734);};}function getRealtimeAgents(){return new Promise(function(_0xa99833,_0x5ef4d1){return amiClient[_0xa9ec('0x10')](_0xa9ec('0x11'),{})[_0xa9ec('0x12')](function(_0x14fabf){if(_0x14fabf[_0xa9ec('0xd')])throw new Error(_0xa9ec('0x13'));var _0x263677=_0x14fabf['result'];return routingClient['request']('Agents',{})[_0xa9ec('0x12')](function(_0x514262){if(_0x514262[_0xa9ec('0xd')])throw new Error(_0xa9ec('0x14'));var _0x39b272=_0x514262[_0xa9ec('0x15')];return _0xa99833(_[_0xa9ec('0x16')]({},_0x263677,_0x39b272));});})[_0xa9ec('0x17')](function(_0x4c203d){_0x5ef4d1(_0x4c203d);});});}function getRealtimeQueues(_0x628956,_0x2858b6){return new Promise(function(_0x4f92f7,_0x570e46){var _0x161da4=_0x2858b6===_0xa9ec('0x18')?amiClient:routingClient;return _0x161da4[_0xa9ec('0x10')](_['startCase'](_0x2858b6)+_0xa9ec('0x19'),_0x628956)[_0xa9ec('0x12')](function(_0x2892f0){if(_0x2892f0[_0xa9ec('0xd')])throw new Error(util[_0xa9ec('0x1a')](_0xa9ec('0x1b'),_0x2858b6));return _0x4f92f7(_0x2892f0[_0xa9ec('0x15')]);})[_0xa9ec('0x17')](function(_0x41c043){_0x570e46(_0x41c043);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3f01c4,_0x25bd5a){return amiClient['request'](_0xa9ec('0x1c'),{})[_0xa9ec('0x12')](function(_0xb21a94){if(_0xb21a94[_0xa9ec('0xd')])throw new Error(_0xa9ec('0x1d'));return _0x3f01c4(_0xb21a94[_0xa9ec('0x15')]);})[_0xa9ec('0x17')](function(_0x7f6a1a){_0x25bd5a(_0x7f6a1a);});});}function initializeQueues(_0x4ab3a0,_0x4a7ea7,_0x3b586a,_0x2fdf07){var _0x245e76=[_0xa9ec('0x1e'),_0xa9ec('0x1f'),_0xa9ec('0x20'),_0xa9ec('0x21'),'paused'];if(_0x3b586a==='voice'&&_0x2fdf07===_0xa9ec('0x22')){_0x245e76[_0xa9ec('0x23')](_0xa9ec('0x24'),_0xa9ec('0x25'),'message','dialActive','dialMethod',_0xa9ec('0x26'),_0xa9ec('0x27'),'startProgressive',_0xa9ec('0x28'),'erlangCallToSecond',_0xa9ec('0x29'),'erlangBusyFactor',_0xa9ec('0x2a'),_0xa9ec('0x2b'),_0xa9ec('0x2c'),_0xa9ec('0x2d'),_0xa9ec('0x2e'),'predictiveIntervalAnsweredCalls',_0xa9ec('0x2f'),_0xa9ec('0x30'),_0xa9ec('0x31'),_0xa9ec('0x32'));}return _0x4ab3a0[_0xa9ec('0x33')](function(_0x33ca2b){var _0x3f12b5=_0x33ca2b[_0xa9ec('0x34')]({'plain':!![]});_0x3f12b5[_0xa9ec('0x35')]=[];_0x3f12b5['paused']=0x0;_0x3f12b5['loggedInDb']=0x0;_0x3f12b5[_0xa9ec('0x1e')]=0x0;_0x3f12b5[_0xa9ec('0x1f')]=0x0;_0x3f12b5['waiting']=0x0;if(_0x3b586a===_0xa9ec('0x18')){_0x3f12b5['talking']=0x0;_0x3f12b5[_0xa9ec('0x36')]=0x0;if(_0x2fdf07===_0xa9ec('0x22')){_0x3f12b5['pTalking']=0x0;_0x3f12b5[_0xa9ec('0x25')]=0x0;}}var _0x238b20=_[_0xa9ec('0x37')](_0x4a7ea7,['id',_0x3f12b5['id']]);if(_0x238b20)_[_0xa9ec('0x16')](_0x3f12b5,_[_0xa9ec('0x38')](_0x238b20,_0x245e76));return _0x3f12b5;});}function updateAgentVoiceStatus(_0x1a98b0,_0x4a28d4,_0x1e1cf5){var _0x262280=_[_0xa9ec('0x39')](_0x1e1cf5,[_0xa9ec('0x3a'),_0x4a28d4['name']]);if(_0x262280[_0xa9ec('0x3b')]===0x0)return _0x1a98b0[_0xa9ec('0x36')]=!![];if(_[_0xa9ec('0x3c')](_0x262280,[_0xa9ec('0x3d'),_0x1a98b0[_0xa9ec('0x3e')][_0xa9ec('0x3f')]()]))return _0x1a98b0[_0xa9ec('0x21')]=!![];if(!_0x1a98b0[_0xa9ec('0x21')])return _0x1a98b0[_0xa9ec('0x36')]=!![];}function getVoiceQueueAgents(_0x3c1644,_0x4e9bf7,_0x1c226d,_0x4986de){var _0x47e1b6=_[_0xa9ec('0x37')](_0x4e9bf7,['id',_0x3c1644['id']]);if(!_0x47e1b6)return _0x3c1644;return _0x47e1b6[_0xa9ec('0x40')]({'raw':!![]})[_0xa9ec('0x12')](function(_0x40d193){for(var _0x780713=0x0;_0x780713<_0x40d193[_0xa9ec('0x3b')];_0x780713++){var _0x32c2e2=_[_0xa9ec('0x37')](_0x1c226d,['id',_0x40d193[_0x780713][_0xa9ec('0x41')]]);if(!_0x32c2e2){_0x32c2e2={'id':_0x40d193[_0x780713][_0xa9ec('0x41')],'name':_0x40d193[_0x780713][_0xa9ec('0x41')],'accountcode':'','online':![]};}var _0x16b7db={'id':_0x32c2e2['id'],'name':_0x32c2e2[_0xa9ec('0xe')],'internal':_0x32c2e2[_0xa9ec('0x42')],'online':Boolean(_0x32c2e2['online']),'paused':Boolean(_0x40d193[_0x780713][_0xa9ec('0x43')])};if(_0x32c2e2[_0xa9ec('0x44')]===_0xa9ec('0x21'))updateAgentVoiceStatus(_0x16b7db,_0x3c1644,_0x4986de);if(_0x16b7db[_0xa9ec('0x45')])_0x3c1644[_0xa9ec('0x46')]++;if(_0x16b7db[_0xa9ec('0x36')])_0x3c1644[_0xa9ec('0x36')]++;if(_0x16b7db[_0xa9ec('0x43')]&&!_0x16b7db['busy']&&!_0x16b7db[_0xa9ec('0x21')])_0x3c1644[_0xa9ec('0x43')]++;_0x3c1644[_0xa9ec('0x35')]['push'](_0x16b7db);}return _0x3c1644;});}function getQueueAgents(_0x5aa52d,_0x14572e,_0x4735db){var _0xe72ead='User'+_['startCase'](_0x4735db)+_0xa9ec('0x47');var _0x58c3e2=_0x4735db+_0xa9ec('0x48');return db[_0xe72ead]['findAll']({'where':{[_[_0xa9ec('0x49')](_0x4735db)+_0xa9ec('0x4a')]:_0x5aa52d['id']},'raw':!![]})['then'](function(_0x54a512){for(var _0xd447fd=0x0;_0xd447fd<_0x54a512[_0xa9ec('0x3b')];_0xd447fd++){var _0x11beed=_['find'](_0x14572e,['id',_0x54a512[_0xd447fd][_0xa9ec('0x41')]]);if(!_0x11beed){_0x11beed={'id':_0x54a512[_0xd447fd][_0xa9ec('0x41')],'name':_0x54a512[_0xd447fd]['UserId'],'online':![],['pauseField']:![]};}var _0x1ec3be={'id':_0x11beed['id'],'name':_0x11beed[_0xa9ec('0xe')],'online':Boolean(_0x11beed[_0xa9ec('0x45')]),'paused':Boolean(_0x11beed[_0x58c3e2])};if(_0x1ec3be[_0xa9ec('0x45')])_0x5aa52d[_0xa9ec('0x46')]++;_0x5aa52d[_0xa9ec('0x35')][_0xa9ec('0x23')](_0x1ec3be);}return _0x5aa52d;});}function isIdle(_0x145e5f){return _0x145e5f===_0xa9ec('0x4b')||_0x145e5f===_0xa9ec('0x4c')||_0x145e5f==='unavailable'||_0x145e5f===_0xa9ec('0x4d')||_[_0xa9ec('0x4e')](_0x145e5f);}function isAgentPaused(_0x1cd391,_0x12b829){var _0x576164=[_0x1cd391[_0xa9ec('0x4f')],_0x1cd391['faxPause'],_0x1cd391[_0xa9ec('0x50')],_0x1cd391['openchannelPause'],_0x1cd391[_0xa9ec('0x51')],_0x1cd391[_0xa9ec('0x52')],_0x1cd391[_0xa9ec('0x53')]];if(!_0x12b829)return _[_0xa9ec('0x54')](_0x576164);var _0x117d9e=_['filter'](_0x576164);return _0x117d9e[_0xa9ec('0x3b')]>0x0&&_0x117d9e[_0xa9ec('0x3b')]<_0x576164[_0xa9ec('0x3b')]?!![]:![];}function isAgentIdle(_0x38c95f){if(_0x38c95f['voiceStatus']!=='idle'&&_0x38c95f[_0xa9ec('0x52')]){_0x38c95f['voiceStatus']='pause';return![];}return _['every']([_0x38c95f[_0xa9ec('0x55')],_0x38c95f['faxStatus'],_0x38c95f['mailStatus'],_0x38c95f[_0xa9ec('0x56')],_0x38c95f['smsStatus'],_0x38c95f[_0xa9ec('0x44')],_0x38c95f['whatsappStatus']],isIdle);}function getAgentStatus(_0x49415d){var _0x2896a2=_0xa9ec('0x4c');if(isAgentPaused(_0x49415d))_0x2896a2=_0xa9ec('0x57');else if(isAgentPaused(_0x49415d,!![]))_0x2896a2=_0xa9ec('0x58');else if(isAgentIdle(_0x49415d))_0x2896a2='idle';else _0x2896a2=_0xa9ec('0x36');return _0x2896a2;}exports[_0xa9ec('0x59')]=function(_0x46aa3a,_0x4e1732){var _0x432d39={'count':0x0,'rows':[]},_0x34f91f={},_0x4d45a0,_0x3215ca,_0x36a8c4=['userpic',_0xa9ec('0x45'),_0xa9ec('0x5a'),'lastPauseAt',_0xa9ec('0x5b'),_0xa9ec('0x5c'),'internal',_0xa9ec('0x5d'),_0xa9ec('0x4f'),'openchannelPause',_0xa9ec('0x50'),_0xa9ec('0x51'),_0xa9ec('0x53'),'faxPause','voicePause','chatCapacity','openchannelCapacity','mailCapacity',_0xa9ec('0x5e'),'whatsappCapacity',_0xa9ec('0x5f'),'chatCurrentCapacity',_0xa9ec('0x60'),_0xa9ec('0x61'),'smsCurrentCapacity',_0xa9ec('0x62'),_0xa9ec('0x63'),'chatStatus',_0xa9ec('0x56'),_0xa9ec('0x64'),_0xa9ec('0x65'),_0xa9ec('0x66'),'faxStatus',_0xa9ec('0x44'),_0xa9ec('0x67'),_0xa9ec('0x68'),_0xa9ec('0x69'),_0xa9ec('0x6a'),'whatsappStatusTime',_0xa9ec('0x6b'),_0xa9ec('0x6c'),_0xa9ec('0x3a'),_0xa9ec('0x6d'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0xa9ec('0x6e'),'routealias'],_0x4c3c3b=[_0xa9ec('0x4f'),_0xa9ec('0x6f'),_0xa9ec('0x50'),'smsPause',_0xa9ec('0x53'),'faxPause',_0xa9ec('0x52'),_0xa9ec('0x45')];Promise[_0xa9ec('0x70')]()[_0xa9ec('0x12')](function(){var _0x4fe985=_[_0xa9ec('0x33')](db[_0xa9ec('0x71')][_0xa9ec('0x72')],function(_0x483729){return{'name':_0x483729[_0xa9ec('0x73')],'type':_0x483729[_0xa9ec('0x74')][_0xa9ec('0x75')]};});_0x46aa3a['query']['role']=_0xa9ec('0x76');_0x46aa3a[_0xa9ec('0x77')][_0xa9ec('0x45')]=!![];_0x34f91f=qs['getOptions'](_0x4fe985,_0x46aa3a);_0x34f91f['raw']=!![];if(_0x46aa3a[_0xa9ec('0x78')][_0xa9ec('0x79')]===_0xa9ec('0x78')){var _0x20078d={'params':{'id':_0x46aa3a['user']['userProfileId']},'query':{'section':_0xa9ec('0x11'),'role':_0xa9ec('0x76'),'online':!![],'nolimit':_0x46aa3a['query'][_0xa9ec('0x7a')],'sort':_0x46aa3a['query'][_0xa9ec('0x7b')],'filter':_0x46aa3a[_0xa9ec('0x77')][_0xa9ec('0x39')]},'raw':!![]};return db['UserProfile'][_0xa9ec('0x7c')](_0x20078d);}return db['User'][_0xa9ec('0x7d')](_0x34f91f);})[_0xa9ec('0x12')](function(_0x2759f1){_0x432d39[_0xa9ec('0x9')]=_0x2759f1[_0xa9ec('0x9')];_0x4d45a0=_0x2759f1[_0xa9ec('0x7e')];return getRealtimeAgents();})[_0xa9ec('0x12')](function(_0x39cdd7){_0x3215ca=_0x39cdd7[_0xa9ec('0x7e')];return _0x4d45a0[_0xa9ec('0x33')](function(_0x20318d){var _0x3bbad1=_[_0xa9ec('0x37')](_0x3215ca,['id',_0x20318d['id']]);if(_0x3bbad1)_['merge'](_0x20318d,_[_0xa9ec('0x38')](_[_0xa9ec('0x7f')](_0x3bbad1,_0x4c3c3b),_0x36a8c4));_0x20318d[_0xa9ec('0x80')]=getAgentStatus(_0x20318d);return _0x20318d;});})[_0xa9ec('0x12')](function(_0x45c08d){if(_0x46aa3a[_0xa9ec('0x77')][_0xa9ec('0x81')]){var _0xfc7998=_[_0xa9ec('0x39')](_0x45c08d,['globalStatus',_0x46aa3a[_0xa9ec('0x77')][_0xa9ec('0x81')]]);if(_0x46aa3a[_0xa9ec('0x77')]['pauseTypeFilter']){_0xfc7998=_[_0xa9ec('0x39')](_0xfc7998,[_0xa9ec('0x5b'),_0x46aa3a[_0xa9ec('0x77')]['pauseTypeFilter']]);}}_0x432d39[_0xa9ec('0x7e')]=_0xfc7998||_0x45c08d;return _0x432d39;})[_0xa9ec('0x12')](respondWithFilteredResult(_0x4e1732,_0x34f91f))[_0xa9ec('0x17')](handleError(_0x4e1732,null));};exports['getQueues']=function(_0x122dd6,_0x582eec){var _0x487249=[_0xa9ec('0x82'),_0xa9ec('0x83'),_0xa9ec('0x84'),_0xa9ec('0x85'),'fax','whatsapp',_0xa9ec('0x18')];var _0x412da3={'count':0x0,'rows':[]},_0x2ba98d={},_0x1fcd4d,_0x5d8e8c,_0x422ff6,_0x380bda,_0xecc0c4;Promise['resolve']()['then'](function(){if(_0x122dd6['query']['channel']){if(!_[_0xa9ec('0x86')](_0x487249,_0x122dd6[_0xa9ec('0x77')]['channel']['toLowerCase']()))throw new Error('Invalid\x20channel');_0x1fcd4d=_0x122dd6[_0xa9ec('0x77')][_0xa9ec('0x87')][_0xa9ec('0x88')]();}var _0x3a8423=_[_0xa9ec('0x49')](_0x1fcd4d)+_0xa9ec('0x47');var _0x1a666e=_[_0xa9ec('0x33')](db[_0x3a8423][_0xa9ec('0x72')],function(_0x34b901){return{'name':_0x34b901[_0xa9ec('0x73')],'type':_0x34b901[_0xa9ec('0x74')][_0xa9ec('0x75')]};});_0x2ba98d=qs[_0xa9ec('0x89')](_0x1a666e,_0x122dd6);if(_0x122dd6[_0xa9ec('0x78')][_0xa9ec('0x79')]==='user'){var _0x4247e1={'params':{'id':_0x122dd6['user'][_0xa9ec('0x8a')]},'query':{'section':_0x1fcd4d==='voice'&&_0x122dd6[_0xa9ec('0x77')][_0xa9ec('0x74')]==='outbound'?'QueueCampaigns':_[_0xa9ec('0x49')](_0x1fcd4d)+_0xa9ec('0x19'),'type':_0x122dd6[_0xa9ec('0x77')][_0xa9ec('0x74')],'nolimit':!![],'sort':_0xa9ec('0xe'),'filter':_0x122dd6[_0xa9ec('0x77')][_0xa9ec('0x39')]}};return db[_0xa9ec('0x8b')][_0xa9ec('0x7c')](_0x4247e1);}return db[_0x3a8423]['findAndCountAll'](_0x2ba98d);})[_0xa9ec('0x12')](function(_0x2c566b){_0x412da3[_0xa9ec('0x9')]=_0x2c566b[_0xa9ec('0x9')];_0x5d8e8c=_0x2c566b[_0xa9ec('0x7e')];return getRealtimeQueues(_0x122dd6,_0x1fcd4d);})[_0xa9ec('0x12')](function(_0x2d9180){_0x380bda=_0x2d9180[_0xa9ec('0x7e')];return getRealtimeAgents();})[_0xa9ec('0x12')](function(_0x430aed){_0x422ff6=_0x430aed[_0xa9ec('0x7e')];if(_0x1fcd4d!=_0xa9ec('0x18'))return;return getRealtimeVoiceQueueChannels();})[_0xa9ec('0x12')](function(_0x36e2ed){_0xecc0c4=_0x36e2ed?_0x36e2ed[_0xa9ec('0x7e')]:[];return initializeQueues(_0x5d8e8c,_0x380bda,_0x1fcd4d,_0x122dd6['query']['type']);})[_0xa9ec('0x12')](function(_0x15412d){var _0x1ff86d=_0x15412d['map'](function(_0x4f4b16){if(_0x1fcd4d===_0xa9ec('0x18'))return getVoiceQueueAgents(_0x4f4b16,_0x5d8e8c,_0x422ff6,_0xecc0c4);else return getQueueAgents(_0x4f4b16,_0x422ff6,_0x1fcd4d);});return Promise[_0xa9ec('0x8c')](_0x1ff86d);})[_0xa9ec('0x12')](function(_0x3e31c0){_0x412da3['rows']=_0x3e31c0;return _0x412da3;})['then'](respondWithFilteredResult(_0x582eec,_0x2ba98d))['catch'](handleError(_0x582eec,null));}; \ No newline at end of file +var _0x02a7=['catch','voice','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','outbound','push','originated','message','dialActive','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','map','get','agents','loggedInDb','loggedIn','busy','pTalking','find','filter','queue','length','some','connectedlinenum','internal','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','findAll','QueueId','unavailable','ringing','isNil','openchannelPause','smsPause','voicePause','every','idle','pause','faxStatus','mailStatus','unknown','getAgents','userpic','lastLoginAt','pauseType','lastPauseAt','chatPause','mailPause','whatsappPause','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','openchannelStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','rawAttributes','fieldName','type','key','query','role','agent','getOptions','raw','user','userProfileId','nolimit','UserProfile','findAndCountAll','rows','pick','globalStatus','pauseTypeFilter','mail','chat','sms','openchannel','resolve','channel','includes','Invalid\x20channel','QueueCampaigns','getResources','all','util','jayson/promise','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','stack','name','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge'];(function(_0x2945bf,_0x3c0e2c){var _0x53cd00=function(_0x38d134){while(--_0x38d134){_0x2945bf['push'](_0x2945bf['shift']());}};_0x53cd00(++_0x3c0e2c);}(_0x02a7,0x1a4));var _0x702a=function(_0x2cedcd,_0x1d069a){_0x2cedcd=_0x2cedcd-0x0;var _0x222040=_0x02a7[_0x2cedcd];return _0x222040;};'use strict';var util=require(_0x702a('0x0'));var _=require('lodash');var jayson=require(_0x702a('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x702a('0x2'))(_0x702a('0x3'));var db=require(_0x702a('0x4'))['db'];var amiClient=jayson[_0x702a('0x5')][_0x702a('0x6')]({'port':0x232a});var routingClient=jayson[_0x702a('0x5')]['http']({'port':0x232c});function respondWithFilteredResult(_0x3369da,_0x3c6baa){return function(_0x47bc6d){if(_0x47bc6d){var _0x5c12ec=typeof _0x3c6baa[_0x702a('0x7')]===_0x702a('0x8')&&typeof _0x3c6baa[_0x702a('0x9')]==='undefined';var _0x3217d3=_0x47bc6d[_0x702a('0xa')];var _0x571276=_0x5c12ec?0x0:_0x3c6baa[_0x702a('0x7')];var _0x749945=_0x5c12ec?_0x47bc6d[_0x702a('0xa')]:_0x3c6baa[_0x702a('0x7')]+_0x3c6baa[_0x702a('0x9')];var _0x3a86f4;if(_0x749945>=_0x3217d3){_0x749945=_0x3217d3;_0x3a86f4=0xc8;}else{_0x3a86f4=0xce;}_0x3369da[_0x702a('0xb')](_0x3a86f4);return _0x3369da[_0x702a('0xc')](_0x702a('0xd'),_0x571276+'-'+_0x749945+'/'+_0x3217d3)[_0x702a('0xe')](_0x47bc6d);}return null;};}function handleError(_0x4be880,_0x447a03){_0x447a03=_0x447a03||0x1f4;return function(_0x1a4695){logger['error'](_0x1a4695[_0x702a('0xf')]);if(_0x1a4695[_0x702a('0x10')]){delete _0x1a4695[_0x702a('0x10')];}_0x4be880[_0x702a('0xb')](_0x447a03)['send'](_0x1a4695);};}function getRealtimeAgents(){return new Promise(function(_0x274772,_0x15d24d){return amiClient[_0x702a('0x11')](_0x702a('0x12'),{})[_0x702a('0x13')](function(_0x3eab81){if(_0x3eab81[_0x702a('0x14')])throw new Error(_0x702a('0x15'));var _0x15b996=_0x3eab81['result'];return routingClient[_0x702a('0x11')](_0x702a('0x12'),{})['then'](function(_0x411620){if(_0x411620[_0x702a('0x14')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x1336c1=_0x411620[_0x702a('0x16')];return _0x274772(_[_0x702a('0x17')]({},_0x15b996,_0x1336c1));});})[_0x702a('0x18')](function(_0xc3bacc){_0x15d24d(_0xc3bacc);});});}function getRealtimeQueues(_0x377942,_0x40f5af){return new Promise(function(_0x3741d6,_0x1c7662){var _0x323b58=_0x40f5af===_0x702a('0x19')?amiClient:routingClient;return _0x323b58[_0x702a('0x11')](_[_0x702a('0x1a')](_0x40f5af)+_0x702a('0x1b'),_0x377942)['then'](function(_0x54fa4a){if(_0x54fa4a[_0x702a('0x14')])throw new Error(util['format'](_0x702a('0x1c'),_0x40f5af));return _0x3741d6(_0x54fa4a[_0x702a('0x16')]);})[_0x702a('0x18')](function(_0x1bf391){_0x1c7662(_0x1bf391);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x32092e,_0x115e69){return amiClient[_0x702a('0x11')](_0x702a('0x1d'),{})['then'](function(_0xe73e8d){if(_0xe73e8d[_0x702a('0x14')])throw new Error(_0x702a('0x1e'));return _0x32092e(_0xe73e8d[_0x702a('0x16')]);})[_0x702a('0x18')](function(_0x2b505f){_0x115e69(_0x2b505f);});});}function initializeQueues(_0x2e64be,_0x389140,_0x5d4633,_0x4c6726){var _0x3e4481=['loggedIn',_0x702a('0x1f'),_0x702a('0x20'),_0x702a('0x21'),_0x702a('0x22')];if(_0x5d4633===_0x702a('0x19')&&_0x4c6726===_0x702a('0x23')){_0x3e4481[_0x702a('0x24')]('pTalking',_0x702a('0x25'),_0x702a('0x26'),_0x702a('0x27'),'dialMethod',_0x702a('0x28'),'startPredictive',_0x702a('0x29'),_0x702a('0x2a'),_0x702a('0x2b'),_0x702a('0x2c'),'erlangBusyFactor',_0x702a('0x2d'),_0x702a('0x2e'),'dialPredictiveIntervalMinThreshold',_0x702a('0x2f'),_0x702a('0x30'),_0x702a('0x31'),_0x702a('0x32'),_0x702a('0x33'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}return _0x2e64be[_0x702a('0x34')](function(_0x5b6d17){var _0x1a2208=_0x5b6d17[_0x702a('0x35')]({'plain':!![]});_0x1a2208[_0x702a('0x36')]=[];_0x1a2208[_0x702a('0x22')]=0x0;_0x1a2208[_0x702a('0x37')]=0x0;_0x1a2208[_0x702a('0x38')]=0x0;_0x1a2208[_0x702a('0x1f')]=0x0;_0x1a2208[_0x702a('0x20')]=0x0;if(_0x5d4633==='voice'){_0x1a2208[_0x702a('0x21')]=0x0;_0x1a2208[_0x702a('0x39')]=0x0;if(_0x4c6726===_0x702a('0x23')){_0x1a2208[_0x702a('0x3a')]=0x0;_0x1a2208[_0x702a('0x25')]=0x0;}}var _0x57c77f=_[_0x702a('0x3b')](_0x389140,['id',_0x1a2208['id']]);if(_0x57c77f)_[_0x702a('0x17')](_0x1a2208,_['pick'](_0x57c77f,_0x3e4481));return _0x1a2208;});}function updateAgentVoiceStatus(_0x2ab9a5,_0x41fc39,_0x1fb4ab){var _0x4cb3a1=_[_0x702a('0x3c')](_0x1fb4ab,[_0x702a('0x3d'),_0x41fc39[_0x702a('0x10')]]);if(_0x4cb3a1[_0x702a('0x3e')]===0x0)return _0x2ab9a5[_0x702a('0x39')]=!![];if(_[_0x702a('0x3f')](_0x4cb3a1,[_0x702a('0x40'),_0x2ab9a5[_0x702a('0x41')]['toString']()]))return _0x2ab9a5[_0x702a('0x21')]=!![];if(!_0x2ab9a5['talking'])return _0x2ab9a5['busy']=!![];}function getVoiceQueueAgents(_0x450b9a,_0x57e998,_0x3de1bb,_0x5aec6f){var _0x14376b=_[_0x702a('0x3b')](_0x57e998,['id',_0x450b9a['id']]);if(!_0x14376b)return _0x450b9a;return _0x14376b[_0x702a('0x42')]({'raw':!![]})[_0x702a('0x13')](function(_0x1143b8){for(var _0x5abd46=0x0;_0x5abd46<_0x1143b8[_0x702a('0x3e')];_0x5abd46++){var _0x2992c2=_[_0x702a('0x3b')](_0x3de1bb,['id',_0x1143b8[_0x5abd46][_0x702a('0x43')]]);if(!_0x2992c2){_0x2992c2={'id':_0x1143b8[_0x5abd46][_0x702a('0x43')],'name':_0x1143b8[_0x5abd46][_0x702a('0x43')],'accountcode':'','online':![]};}var _0x5dbdf9={'id':_0x2992c2['id'],'name':_0x2992c2[_0x702a('0x10')],'internal':_0x2992c2[_0x702a('0x44')],'online':Boolean(_0x2992c2[_0x702a('0x45')]),'paused':Boolean(_0x1143b8[_0x5abd46][_0x702a('0x22')])};if(_0x2992c2[_0x702a('0x46')]===_0x702a('0x21'))updateAgentVoiceStatus(_0x5dbdf9,_0x450b9a,_0x5aec6f);if(_0x5dbdf9[_0x702a('0x45')])_0x450b9a['loggedInDb']++;if(_0x5dbdf9[_0x702a('0x39')])_0x450b9a['busy']++;if(_0x5dbdf9[_0x702a('0x22')]&&!_0x5dbdf9['busy']&&!_0x5dbdf9[_0x702a('0x21')])_0x450b9a[_0x702a('0x22')]++;_0x450b9a[_0x702a('0x36')][_0x702a('0x24')](_0x5dbdf9);}return _0x450b9a;});}function getQueueAgents(_0x511244,_0x1ff406,_0x64c0d7){var _0x2f9da7=_0x702a('0x47')+_[_0x702a('0x1a')](_0x64c0d7)+_0x702a('0x48');var _0x40d38b=_0x64c0d7+'Pause';return db[_0x2f9da7][_0x702a('0x49')]({'where':{[_[_0x702a('0x1a')](_0x64c0d7)+_0x702a('0x4a')]:_0x511244['id']},'raw':!![]})[_0x702a('0x13')](function(_0x5e79dc){for(var _0x40d579=0x0;_0x40d579<_0x5e79dc['length'];_0x40d579++){var _0x506e69=_[_0x702a('0x3b')](_0x1ff406,['id',_0x5e79dc[_0x40d579][_0x702a('0x43')]]);if(!_0x506e69){_0x506e69={'id':_0x5e79dc[_0x40d579]['UserId'],'name':_0x5e79dc[_0x40d579][_0x702a('0x43')],'online':![],['pauseField']:![]};}var _0x2a1acf={'id':_0x506e69['id'],'name':_0x506e69[_0x702a('0x10')],'online':Boolean(_0x506e69[_0x702a('0x45')]),'paused':Boolean(_0x506e69[_0x40d38b])};if(_0x2a1acf['online'])_0x511244['loggedInDb']++;_0x511244[_0x702a('0x36')][_0x702a('0x24')](_0x2a1acf);}return _0x511244;});}function isIdle(_0x368855){return _0x368855==='idle'||_0x368855==='unknown'||_0x368855===_0x702a('0x4b')||_0x368855===_0x702a('0x4c')||_[_0x702a('0x4d')](_0x368855);}function isAgentPaused(_0x22e8a9,_0x573e37){var _0x1fa4ae=[_0x22e8a9['chatPause'],_0x22e8a9['faxPause'],_0x22e8a9['mailPause'],_0x22e8a9[_0x702a('0x4e')],_0x22e8a9[_0x702a('0x4f')],_0x22e8a9[_0x702a('0x50')],_0x22e8a9['whatsappPause']];if(!_0x573e37)return _[_0x702a('0x51')](_0x1fa4ae);var _0x11bbe5=_[_0x702a('0x3c')](_0x1fa4ae);return _0x11bbe5['length']>0x0&&_0x11bbe5[_0x702a('0x3e')]<_0x1fa4ae[_0x702a('0x3e')]?!![]:![];}function isAgentIdle(_0x2e9eae){if(_0x2e9eae[_0x702a('0x46')]!==_0x702a('0x52')&&_0x2e9eae['voicePause']){_0x2e9eae[_0x702a('0x46')]=_0x702a('0x53');return![];}return _[_0x702a('0x51')]([_0x2e9eae['chatStatus'],_0x2e9eae[_0x702a('0x54')],_0x2e9eae[_0x702a('0x55')],_0x2e9eae['openchannelStatus'],_0x2e9eae['smsStatus'],_0x2e9eae['voiceStatus'],_0x2e9eae['whatsappStatus']],isIdle);}function getAgentStatus(_0x4b7537){var _0x369145=_0x702a('0x56');if(isAgentPaused(_0x4b7537))_0x369145=_0x702a('0x53');else if(isAgentPaused(_0x4b7537,!![]))_0x369145='*pause';else if(isAgentIdle(_0x4b7537))_0x369145=_0x702a('0x52');else _0x369145=_0x702a('0x39');return _0x369145;}exports[_0x702a('0x57')]=function(_0x4c6cc0,_0x424f2c){var _0x262059={'count':0x0,'rows':[]},_0x5179b6={},_0x3dc515,_0x35f4d3,_0x3728fe=[_0x702a('0x58'),_0x702a('0x45'),_0x702a('0x59'),'lastPauseAt',_0x702a('0x5a'),_0x702a('0x5b'),'internal','address',_0x702a('0x5c'),_0x702a('0x4e'),_0x702a('0x5d'),_0x702a('0x4f'),_0x702a('0x5e'),_0x702a('0x5f'),'voicePause',_0x702a('0x60'),_0x702a('0x61'),_0x702a('0x62'),_0x702a('0x63'),_0x702a('0x64'),_0x702a('0x65'),_0x702a('0x66'),_0x702a('0x67'),'mailCurrentCapacity','smsCurrentCapacity',_0x702a('0x68'),_0x702a('0x69'),_0x702a('0x6a'),_0x702a('0x6b'),_0x702a('0x55'),'smsStatus',_0x702a('0x6c'),_0x702a('0x54'),_0x702a('0x46'),_0x702a('0x6d'),_0x702a('0x6e'),'mailStatusTime',_0x702a('0x6f'),_0x702a('0x70'),_0x702a('0x71'),_0x702a('0x72'),_0x702a('0x3d'),_0x702a('0x73'),_0x702a('0x74'),_0x702a('0x75'),'phoneBarEnableAutomaticScreenRecording',_0x702a('0x76')],_0x18f397=[_0x702a('0x5c'),_0x702a('0x4e'),_0x702a('0x5d'),_0x702a('0x4f'),_0x702a('0x5e'),_0x702a('0x5f'),_0x702a('0x50'),_0x702a('0x45')];Promise['resolve']()['then'](function(){var _0x312cfe=_[_0x702a('0x34')](db[_0x702a('0x47')][_0x702a('0x77')],function(_0x19939b){return{'name':_0x19939b[_0x702a('0x78')],'type':_0x19939b[_0x702a('0x79')][_0x702a('0x7a')]};});_0x4c6cc0[_0x702a('0x7b')][_0x702a('0x7c')]=_0x702a('0x7d');_0x4c6cc0[_0x702a('0x7b')][_0x702a('0x45')]=!![];_0x5179b6=qs[_0x702a('0x7e')](_0x312cfe,_0x4c6cc0);_0x5179b6[_0x702a('0x7f')]=!![];if(_0x4c6cc0[_0x702a('0x80')][_0x702a('0x7c')]===_0x702a('0x80')){var _0x5a0960={'params':{'id':_0x4c6cc0[_0x702a('0x80')][_0x702a('0x81')]},'query':{'section':_0x702a('0x12'),'role':'agent','online':!![],'nolimit':_0x4c6cc0['query'][_0x702a('0x82')],'sort':_0x4c6cc0['query']['sort'],'filter':_0x4c6cc0[_0x702a('0x7b')][_0x702a('0x3c')]},'raw':!![]};return db[_0x702a('0x83')]['getResources'](_0x5a0960);}return db[_0x702a('0x47')][_0x702a('0x84')](_0x5179b6);})[_0x702a('0x13')](function(_0x542ade){_0x262059['count']=_0x542ade[_0x702a('0xa')];_0x3dc515=_0x542ade[_0x702a('0x85')];return getRealtimeAgents();})[_0x702a('0x13')](function(_0xa8c822){_0x35f4d3=_0xa8c822[_0x702a('0x85')];return _0x3dc515[_0x702a('0x34')](function(_0x5790e6){var _0x1bd766=_[_0x702a('0x3b')](_0x35f4d3,['id',_0x5790e6['id']]);if(_0x1bd766)_['merge'](_0x5790e6,_[_0x702a('0x86')](_['omit'](_0x1bd766,_0x18f397),_0x3728fe));_0x5790e6[_0x702a('0x87')]=getAgentStatus(_0x5790e6);return _0x5790e6;});})[_0x702a('0x13')](function(_0x34a6df){if(_0x4c6cc0[_0x702a('0x7b')]['globalStatusFilter']){var _0x24d156=_[_0x702a('0x3c')](_0x34a6df,[_0x702a('0x87'),_0x4c6cc0[_0x702a('0x7b')]['globalStatusFilter']]);if(_0x4c6cc0[_0x702a('0x7b')][_0x702a('0x88')]){_0x24d156=_[_0x702a('0x3c')](_0x24d156,[_0x702a('0x5a'),_0x4c6cc0[_0x702a('0x7b')][_0x702a('0x88')]]);}}_0x262059[_0x702a('0x85')]=_0x24d156||_0x34a6df;return _0x262059;})[_0x702a('0x13')](respondWithFilteredResult(_0x424f2c,_0x5179b6))[_0x702a('0x18')](handleError(_0x424f2c,null));};exports['getQueues']=function(_0xc98ac8,_0x1d79a2){var _0x219831=[_0x702a('0x89'),_0x702a('0x8a'),_0x702a('0x8b'),_0x702a('0x8c'),'fax','whatsapp','voice'];var _0x23ae7e={'count':0x0,'rows':[]},_0x5a1561={},_0x560f59,_0x22c955,_0x48b95b,_0xe3216f,_0x5ee949;Promise[_0x702a('0x8d')]()[_0x702a('0x13')](function(){if(_0xc98ac8[_0x702a('0x7b')][_0x702a('0x8e')]){if(!_[_0x702a('0x8f')](_0x219831,_0xc98ac8[_0x702a('0x7b')][_0x702a('0x8e')]['toLowerCase']()))throw new Error(_0x702a('0x90'));_0x560f59=_0xc98ac8['query']['channel']['toLowerCase']();}var _0x22d42a=_['startCase'](_0x560f59)+'Queue';var _0x21fe6f=_[_0x702a('0x34')](db[_0x22d42a][_0x702a('0x77')],function(_0x43b6da){return{'name':_0x43b6da['fieldName'],'type':_0x43b6da[_0x702a('0x79')][_0x702a('0x7a')]};});_0x5a1561=qs[_0x702a('0x7e')](_0x21fe6f,_0xc98ac8);if(_0xc98ac8[_0x702a('0x80')]['role']==='user'){var _0x4d23c1={'params':{'id':_0xc98ac8[_0x702a('0x80')]['userProfileId']},'query':{'section':_0x560f59===_0x702a('0x19')&&_0xc98ac8[_0x702a('0x7b')][_0x702a('0x79')]==='outbound'?_0x702a('0x91'):_[_0x702a('0x1a')](_0x560f59)+_0x702a('0x1b'),'type':_0xc98ac8[_0x702a('0x7b')][_0x702a('0x79')],'nolimit':!![],'sort':_0x702a('0x10'),'filter':_0xc98ac8[_0x702a('0x7b')]['filter']}};return db['UserProfile'][_0x702a('0x92')](_0x4d23c1);}return db[_0x22d42a]['findAndCountAll'](_0x5a1561);})[_0x702a('0x13')](function(_0x110e62){_0x23ae7e['count']=_0x110e62[_0x702a('0xa')];_0x22c955=_0x110e62['rows'];return getRealtimeQueues(_0xc98ac8,_0x560f59);})[_0x702a('0x13')](function(_0x4b43d3){_0xe3216f=_0x4b43d3[_0x702a('0x85')];return getRealtimeAgents();})[_0x702a('0x13')](function(_0x285a27){_0x48b95b=_0x285a27[_0x702a('0x85')];if(_0x560f59!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x702a('0x13')](function(_0x23bb2a){_0x5ee949=_0x23bb2a?_0x23bb2a[_0x702a('0x85')]:[];return initializeQueues(_0x22c955,_0xe3216f,_0x560f59,_0xc98ac8[_0x702a('0x7b')][_0x702a('0x79')]);})[_0x702a('0x13')](function(_0x5df02b){var _0x1d7b2f=_0x5df02b[_0x702a('0x34')](function(_0x378d6c){if(_0x560f59===_0x702a('0x19'))return getVoiceQueueAgents(_0x378d6c,_0x22c955,_0x48b95b,_0x5ee949);else return getQueueAgents(_0x378d6c,_0x48b95b,_0x560f59);});return Promise[_0x702a('0x93')](_0x1d7b2f);})[_0x702a('0x13')](function(_0x273ca9){_0x23ae7e['rows']=_0x273ca9;return _0x23ae7e;})[_0x702a('0x13')](respondWithFilteredResult(_0x1d79a2,_0x5a1561))['catch'](handleError(_0x1d79a2,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 1f10518..60d84a6 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x599648,_0x47dd38){var _0x5cb893=function(_0x5e107d){while(--_0x5e107d){_0x599648['push'](_0x599648['shift']());}};_0x5cb893(++_0x47dd38);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xdb0859,_0x56800c){var _0x20895d=function(_0x310287){while(--_0x310287){_0xdb0859['push'](_0xdb0859['shift']());}};_0x20895d(++_0x56800c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xcb91[_0x5ce3c8];return _0xa76867;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 8a12af3..370baac 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 _0x9865=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0xf8bd98,_0x722df){var _0x34e8af=function(_0x55b652){while(--_0x55b652){_0xf8bd98['push'](_0xf8bd98['shift']());}};_0x34e8af(++_0x722df);}(_0x9865,0x1ba));var _0x5986=function(_0x50afa9,_0x10d742){_0x50afa9=_0x50afa9-0x0;var _0x421e47=_0x9865[_0x50afa9];return _0x421e47;};'use strict';var Sequelize=require(_0x5986('0x0'));module[_0x5986('0x1')]={'state':{'type':Sequelize[_0x5986('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5986('0x3')]},'scheduledat':{'type':Sequelize[_0x5986('0x4')]},'uniqueid':{'type':Sequelize[_0x5986('0x3')]},'starttime':{'type':Sequelize[_0x5986('0x4')]},'responsetime':{'type':Sequelize[_0x5986('0x4')]},'ringtime':{'type':Sequelize[_0x5986('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5986('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5986('0x3')]}}; \ No newline at end of file +var _0x6363=['STRING','DATE','sequelize','INTEGER'];(function(_0x310fde,_0x1782cb){var _0x4b93e7=function(_0x4a6919){while(--_0x4a6919){_0x310fde['push'](_0x310fde['shift']());}};_0x4b93e7(++_0x1782cb);}(_0x6363,0x13a));var _0x3636=function(_0x444218,_0x2b6cd3){_0x444218=_0x444218-0x0;var _0x3815fa=_0x6363[_0x444218];return _0x3815fa;};'use strict';var Sequelize=require(_0x3636('0x0'));module['exports']={'state':{'type':Sequelize[_0x3636('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3636('0x2')]},'scheduledat':{'type':Sequelize[_0x3636('0x3')]},'uniqueid':{'type':Sequelize[_0x3636('0x2')]},'starttime':{'type':Sequelize[_0x3636('0x3')]},'responsetime':{'type':Sequelize[_0x3636('0x3')]},'ringtime':{'type':Sequelize[_0x3636('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3636('0x2')]},'campaigntype':{'type':Sequelize[_0x3636('0x2')]},'membername':{'type':Sequelize[_0x3636('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index cfd6509..e2be5dc 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 _0xea54=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','util'];(function(_0xc6c590,_0x1aacc6){var _0x4ef244=function(_0x512cbf){while(--_0x512cbf){_0xc6c590['push'](_0xc6c590['shift']());}};_0x4ef244(++_0x1aacc6);}(_0xea54,0xaf));var _0x4ea5=function(_0x54586a,_0x49ac46){_0x54586a=_0x54586a-0x0;var _0x5630fd=_0xea54[_0x54586a];return _0x5630fd;};'use strict';var _=require('lodash');var util=require(_0x4ea5('0x0'));var logger=require(_0x4ea5('0x1'))(_0x4ea5('0x2'));var moment=require('moment');var BPromise=require(_0x4ea5('0x3'));var rp=require(_0x4ea5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ea5('0x5'));var config=require(_0x4ea5('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x4ea5('0x7')]=function(_0x3b83e1,_0x26a6dd){return _0x3b83e1[_0x4ea5('0x8')](_0x4ea5('0x9'),attributes,{'tableName':_0x4ea5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24fd=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x24fd,0x13b));var _0xd24f=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x24fd[_0xac151d];return _0x111dba;};'use strict';var _=require('lodash');var util=require(_0xd24f('0x0'));var logger=require(_0xd24f('0x1'))(_0xd24f('0x2'));var moment=require(_0xd24f('0x3'));var BPromise=require(_0xd24f('0x4'));var rp=require(_0xd24f('0x5'));var fs=require('fs');var path=require(_0xd24f('0x6'));var rimraf=require(_0xd24f('0x7'));var config=require(_0xd24f('0x8'));var attributes=require(_0xd24f('0x9'));module[_0xd24f('0xa')]=function(_0x171462,_0x4c6a98){return _0x171462[_0xd24f('0xb')](_0xd24f('0xc'),attributes,{'tableName':_0xd24f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index feb7779..fb590a1 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 _0xfb84=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment'];(function(_0x5ddf87,_0x1371e4){var _0x1405cd=function(_0x29c5da){while(--_0x29c5da){_0x5ddf87['push'](_0x5ddf87['shift']());}};_0x1405cd(++_0x1371e4);}(_0xfb84,0x159));var _0x4fb8=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xfb84[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require(_0x4fb8('0x0'));var util=require(_0x4fb8('0x1'));var moment=require(_0x4fb8('0x2'));var BPromise=require(_0x4fb8('0x3'));var rs=require(_0x4fb8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fb8('0x5'))['db'];var utils=require(_0x4fb8('0x6'));var logger=require(_0x4fb8('0x7'))('rpc');var config=require(_0x4fb8('0x8'));var jayson=require(_0x4fb8('0x9'));var client=jayson[_0x4fb8('0xa')][_0x4fb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52253b,_0x2e99bd,_0x4ba6c4){return new BPromise(function(_0x437e16,_0x2f52dc){return client['request'](_0x52253b,_0x4ba6c4)[_0x4fb8('0xc')](function(_0x1bb0ee){logger[_0x4fb8('0xd')](_0x4fb8('0xe'),_0x2e99bd,'request\x20sent');logger[_0x4fb8('0xf')](_0x4fb8('0x10'),_0x2e99bd,_0x4fb8('0x11'),JSON[_0x4fb8('0x12')](_0x1bb0ee));if(_0x1bb0ee[_0x4fb8('0x13')]){if(_0x1bb0ee[_0x4fb8('0x13')]['code']===0x1f4){logger[_0x4fb8('0x13')](_0x4fb8('0xe'),_0x2e99bd,_0x1bb0ee[_0x4fb8('0x13')][_0x4fb8('0x14')]);return _0x2f52dc(_0x1bb0ee['error'][_0x4fb8('0x14')]);}logger[_0x4fb8('0x13')](_0x4fb8('0xe'),_0x2e99bd,_0x1bb0ee['error']['message']);return _0x437e16(_0x1bb0ee['error']['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x2e99bd,_0x4fb8('0x11'));_0x437e16(_0x1bb0ee[_0x4fb8('0x15')][_0x4fb8('0x14')]);}})[_0x4fb8('0x16')](function(_0x58ec75){logger[_0x4fb8('0x13')](_0x4fb8('0xe'),_0x2e99bd,_0x58ec75);_0x2f52dc(_0x58ec75);});});}exports[_0x4fb8('0x17')]=function(_0x2f1ab3){var _0x255ca5=this;return new Promise(function(_0x21ffed,_0x51721c){return db[_0x4fb8('0x18')][_0x4fb8('0x19')](_0x2f1ab3[_0x4fb8('0x1a')],{'raw':_0x2f1ab3[_0x4fb8('0x1b')]?_0x2f1ab3[_0x4fb8('0x1b')][_0x4fb8('0x1c')]===undefined?!![]:![]:!![]})[_0x4fb8('0xc')](function(_0x40a211){logger['info'](_0x4fb8('0x17'),_0x2f1ab3);logger['debug'](_0x4fb8('0x17'),_0x2f1ab3,JSON[_0x4fb8('0x12')](_0x40a211));_0x21ffed(_0x40a211);})['catch'](function(_0x355491){logger['error']('CreateReportAgentPreview',_0x355491[_0x4fb8('0x14')],_0x2f1ab3);_0x51721c(_0x255ca5['error'](0x1f4,_0x355491[_0x4fb8('0x14')]));});});}; \ No newline at end of file +var _0x1505=['raw','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options'];(function(_0x56569a,_0x30477d){var _0x28df6b=function(_0x580277){while(--_0x580277){_0x56569a['push'](_0x56569a['shift']());}};_0x28df6b(++_0x30477d);}(_0x1505,0x1c5));var _0x5150=function(_0x5a353b,_0x4ed340){_0x5a353b=_0x5a353b-0x0;var _0x54da88=_0x1505[_0x5a353b];return _0x54da88;};'use strict';var _=require(_0x5150('0x0'));var util=require(_0x5150('0x1'));var moment=require('moment');var BPromise=require(_0x5150('0x2'));var rs=require(_0x5150('0x3'));var fs=require('fs');var Redis=require(_0x5150('0x4'));var db=require(_0x5150('0x5'))['db'];var utils=require(_0x5150('0x6'));var logger=require(_0x5150('0x7'))(_0x5150('0x8'));var config=require(_0x5150('0x9'));var jayson=require(_0x5150('0xa'));var client=jayson[_0x5150('0xb')][_0x5150('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55a962,_0x1cc340,_0x2b33bd){return new BPromise(function(_0x3a02ab,_0x514b00){return client[_0x5150('0xd')](_0x55a962,_0x2b33bd)[_0x5150('0xe')](function(_0x1f6908){logger['info'](_0x5150('0xf'),_0x1cc340,'request\x20sent');logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x1cc340,_0x5150('0x10'),JSON[_0x5150('0x11')](_0x1f6908));if(_0x1f6908[_0x5150('0x12')]){if(_0x1f6908[_0x5150('0x12')]['code']===0x1f4){logger[_0x5150('0x12')](_0x5150('0xf'),_0x1cc340,_0x1f6908[_0x5150('0x12')][_0x5150('0x13')]);return _0x514b00(_0x1f6908[_0x5150('0x12')]['message']);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1cc340,_0x1f6908['error'][_0x5150('0x13')]);return _0x3a02ab(_0x1f6908[_0x5150('0x12')][_0x5150('0x13')]);}else{logger[_0x5150('0x14')](_0x5150('0xf'),_0x1cc340,_0x5150('0x10'));_0x3a02ab(_0x1f6908[_0x5150('0x15')][_0x5150('0x13')]);}})['catch'](function(_0x17f6df){logger[_0x5150('0x12')](_0x5150('0xf'),_0x1cc340,_0x17f6df);_0x514b00(_0x17f6df);});});}exports[_0x5150('0x16')]=function(_0x8c284f){var _0x3ca244=this;return new Promise(function(_0x1a7ad0,_0x33d885){return db[_0x5150('0x17')][_0x5150('0x18')](_0x8c284f[_0x5150('0x19')],{'raw':_0x8c284f[_0x5150('0x1a')]?_0x8c284f[_0x5150('0x1a')][_0x5150('0x1b')]===undefined?!![]:![]:!![]})[_0x5150('0xe')](function(_0x18e25b){logger['info'](_0x5150('0x16'),_0x8c284f);logger[_0x5150('0x1c')](_0x5150('0x16'),_0x8c284f,JSON[_0x5150('0x11')](_0x18e25b));_0x1a7ad0(_0x18e25b);})[_0x5150('0x1d')](function(_0x47e98d){logger[_0x5150('0x12')](_0x5150('0x16'),_0x47e98d[_0x5150('0x13')],_0x8c284f);_0x33d885(_0x3ca244[_0x5150('0x12')](0x1f4,_0x47e98d[_0x5150('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 87c01ab..8528b33 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 _0xb73d=['/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','Router','../../components/auth/service','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xb73d,0x65));var _0xdb73=function(_0x4d7df6,_0x3f6139){_0x4d7df6=_0x4d7df6-0x0;var _0x4c0d29=_0xb73d[_0x4d7df6];return _0x4c0d29;};'use strict';var multer=require(_0xdb73('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0xdb73('0x1')]();var auth=require(_0xdb73('0x2'));var controller=require('./rpc.controller');router['get'](_0xdb73('0x3'),auth[_0xdb73('0x4')](),controller['voiceChannels']);router[_0xdb73('0x5')](_0xdb73('0x6'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x7')]);router[_0xdb73('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xdb73('0x4')](),controller[_0xdb73('0x8')]);router[_0xdb73('0x5')](_0xdb73('0x9'),auth[_0xdb73('0x4')](),controller['voiceQueues']);router[_0xdb73('0x5')](_0xdb73('0xa'),auth['isAuthenticated'](),controller[_0xdb73('0xb')]);router[_0xdb73('0x5')](_0xdb73('0xc'),auth['isAuthenticated'](),controller[_0xdb73('0xd')]);router[_0xdb73('0x5')](_0xdb73('0xe'),auth['isAuthenticated'](),controller[_0xdb73('0xf')]);router[_0xdb73('0x5')](_0xdb73('0x10'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x11')]);router[_0xdb73('0x5')](_0xdb73('0x12'),auth[_0xdb73('0x4')](),controller['smsQueues']);router[_0xdb73('0x5')](_0xdb73('0x13'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x14')]);router[_0xdb73('0x5')](_0xdb73('0x15'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x16')]);router['get']('/voice/queues/preview/:id',auth[_0xdb73('0x4')](),controller[_0xdb73('0x17')]);router['get']('/voice/queues/channels',auth[_0xdb73('0x4')](),controller[_0xdb73('0x18')]);router[_0xdb73('0x5')]('/voice/queues/channels/:uniqueid',auth[_0xdb73('0x4')](),controller['voiceQueuesChannel']);router[_0xdb73('0x5')](_0xdb73('0x19'),auth[_0xdb73('0x4')](),controller['voiceQueuesChannelHangup']);router[_0xdb73('0x5')](_0xdb73('0x1a'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x1b')]);router['get'](_0xdb73('0x1c'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x1d')]);router[_0xdb73('0x1e')](_0xdb73('0x1c'),auth[_0xdb73('0x4')](),controller['updateVoiceQueue']);router[_0xdb73('0x5')](_0xdb73('0x1f'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x20')]);router[_0xdb73('0x5')](_0xdb73('0x21'),auth[_0xdb73('0x4')](),controller['outboundChannels']);router[_0xdb73('0x5')](_0xdb73('0x22'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x23')]);router[_0xdb73('0x1e')](_0xdb73('0x24'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x25')]);router[_0xdb73('0x5')]('/telephones',auth[_0xdb73('0x4')](),controller[_0xdb73('0x26')]);router[_0xdb73('0x5')](_0xdb73('0x27'),auth['isAuthenticated'](),controller[_0xdb73('0x28')]);router[_0xdb73('0x5')](_0xdb73('0x29'),auth['isAuthenticated'](),controller[_0xdb73('0x2a')]);router['get'](_0xdb73('0x2b'),auth['isAuthenticated'](),controller[_0xdb73('0x2c')]);router[_0xdb73('0x5')](_0xdb73('0x2d'),auth[_0xdb73('0x4')](),controller['chatQueuesWaitingInteractions']);router[_0xdb73('0x5')](_0xdb73('0x2e'),auth['isAuthenticated'](),controller[_0xdb73('0x2f')]);router[_0xdb73('0x5')](_0xdb73('0x30'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x31')]);router[_0xdb73('0x5')](_0xdb73('0x32'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x33')]);router[_0xdb73('0x5')](_0xdb73('0x34'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x35')]);router[_0xdb73('0x5')](_0xdb73('0x36'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x37')]);router[_0xdb73('0x5')]('/fax/queues/waitinginteractions',auth[_0xdb73('0x4')](),controller['faxQueuesWaitingInteractions']);router[_0xdb73('0x38')](_0xdb73('0x39'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x3a')]('mail'));router['get'](_0xdb73('0x3b'),auth['isAuthenticated'](),controller[_0xdb73('0x3c')]);router[_0xdb73('0x38')](_0xdb73('0x3d'),auth[_0xdb73('0x4')](),controller['queueNotify'](_0xdb73('0x3e')));router[_0xdb73('0x5')](_0xdb73('0x3f'),auth['isAuthenticated'](),controller[_0xdb73('0x40')]);router[_0xdb73('0x38')](_0xdb73('0x41'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x3a')]('fax'));router[_0xdb73('0x5')](_0xdb73('0x42'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x43')]);router[_0xdb73('0x38')](_0xdb73('0x44'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x3a')](_0xdb73('0x45')));router[_0xdb73('0x5')](_0xdb73('0x46'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x47')]);router[_0xdb73('0x38')](_0xdb73('0x48'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x3a')](_0xdb73('0x49')));router['post'](_0xdb73('0x4a'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x3a')](_0xdb73('0x4b')));router[_0xdb73('0x5')](_0xdb73('0x4c'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x4d')]);router[_0xdb73('0x5')](_0xdb73('0x4e'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x4f')]);router[_0xdb73('0x38')](_0xdb73('0x50'),auth[_0xdb73('0x4')](),controller[_0xdb73('0x51')]);module[_0xdb73('0x52')]=router; \ No newline at end of file +var _0x5c02=['voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','chat','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showWhatsappQueues','agentNotify','util','path','express','Router','./rpc.controller','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup'];(function(_0x1537dc,_0x2a6c1c){var _0x331ebb=function(_0x17f1bc){while(--_0x17f1bc){_0x1537dc['push'](_0x1537dc['shift']());}};_0x331ebb(++_0x2a6c1c);}(_0x5c02,0x10e));var _0x25c0=function(_0x8e485e,_0x51e645){_0x8e485e=_0x8e485e-0x0;var _0x5de0e0=_0x5c02[_0x8e485e];return _0x5de0e0;};'use strict';var multer=require('multer');var util=require(_0x25c0('0x0'));var path=require(_0x25c0('0x1'));var express=require(_0x25c0('0x2'));var router=express[_0x25c0('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x25c0('0x4'));router['get'](_0x25c0('0x5'),auth['isAuthenticated'](),controller[_0x25c0('0x6')]);router['get'](_0x25c0('0x7'),auth[_0x25c0('0x8')](),controller['voiceChannelMixMonitor']);router[_0x25c0('0x9')](_0x25c0('0xa'),auth[_0x25c0('0x8')](),controller[_0x25c0('0xb')]);router[_0x25c0('0x9')](_0x25c0('0xc'),auth[_0x25c0('0x8')](),controller['voiceQueues']);router[_0x25c0('0x9')]('/chat/queues',auth[_0x25c0('0x8')](),controller[_0x25c0('0xd')]);router[_0x25c0('0x9')]('/mail/queues',auth[_0x25c0('0x8')](),controller[_0x25c0('0xe')]);router[_0x25c0('0x9')](_0x25c0('0xf'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x10')]);router[_0x25c0('0x9')](_0x25c0('0x11'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x12')]);router[_0x25c0('0x9')](_0x25c0('0x13'),auth['isAuthenticated'](),controller['smsQueues']);router[_0x25c0('0x9')]('/whatsapp/queues',auth[_0x25c0('0x8')](),controller[_0x25c0('0x14')]);router['get'](_0x25c0('0x15'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x16')]);router['get']('/voice/queues/preview/:id',auth[_0x25c0('0x8')](),controller['voiceQueuesPreview']);router[_0x25c0('0x9')]('/voice/queues/channels',auth[_0x25c0('0x8')](),controller['voiceQueuesChannels']);router[_0x25c0('0x9')](_0x25c0('0x17'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x18')]);router['get'](_0x25c0('0x19'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x1a')]);router[_0x25c0('0x9')](_0x25c0('0x1b'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x1c')]);router[_0x25c0('0x9')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x25c0('0x1d')]);router['put'](_0x25c0('0x1e'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x1f')]);router['get'](_0x25c0('0x20'),auth[_0x25c0('0x8')](),controller['outbound']);router[_0x25c0('0x9')](_0x25c0('0x21'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x22')]);router['get'](_0x25c0('0x23'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x24')]);router[_0x25c0('0x25')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x25c0('0x26')]);router[_0x25c0('0x9')](_0x25c0('0x27'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x28')]);router[_0x25c0('0x9')](_0x25c0('0x29'),auth['isAuthenticated'](),controller[_0x25c0('0x2a')]);router['get'](_0x25c0('0x2b'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x2c')]);router[_0x25c0('0x9')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x25c0('0x2d')]);router['get']('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x25c0('0x2e')]);router[_0x25c0('0x9')](_0x25c0('0x2f'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x30')]);router[_0x25c0('0x9')]('/openchannel/queues/waitinginteractions',auth[_0x25c0('0x8')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x25c0('0x31'),auth['isAuthenticated'](),controller[_0x25c0('0x32')]);router[_0x25c0('0x9')](_0x25c0('0x33'),auth[_0x25c0('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x25c0('0x9')]('/whatsapp/queues/waitinginteractions',auth[_0x25c0('0x8')](),controller[_0x25c0('0x34')]);router[_0x25c0('0x9')]('/fax/queues/waitinginteractions',auth[_0x25c0('0x8')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x25c0('0x35'),auth['isAuthenticated'](),controller[_0x25c0('0x36')](_0x25c0('0x37')));router[_0x25c0('0x9')](_0x25c0('0x38'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x39')]);router[_0x25c0('0x3a')]('/chat/queues/:id/notify',auth[_0x25c0('0x8')](),controller[_0x25c0('0x36')](_0x25c0('0x3b')));router['get']('/chat/queues/:id',auth[_0x25c0('0x8')](),controller[_0x25c0('0x3c')]);router[_0x25c0('0x3a')](_0x25c0('0x3d'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x36')](_0x25c0('0x3e')));router[_0x25c0('0x9')]('/fax/queues/:id',auth[_0x25c0('0x8')](),controller[_0x25c0('0x3f')]);router[_0x25c0('0x3a')](_0x25c0('0x40'),auth['isAuthenticated'](),controller[_0x25c0('0x36')]('openchannel'));router['get'](_0x25c0('0x41'),auth['isAuthenticated'](),controller[_0x25c0('0x42')]);router['post'](_0x25c0('0x43'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x36')](_0x25c0('0x44')));router[_0x25c0('0x3a')](_0x25c0('0x45'),auth[_0x25c0('0x8')](),controller[_0x25c0('0x36')](_0x25c0('0x46')));router[_0x25c0('0x9')](_0x25c0('0x47'),auth[_0x25c0('0x8')](),controller['showSmsQueues']);router[_0x25c0('0x9')]('/whatsapp/queues/:id',auth[_0x25c0('0x8')](),controller[_0x25c0('0x48')]);router['post']('/agents/:id/notify',auth[_0x25c0('0x8')](),controller[_0x25c0('0x49')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6a70717..3cfef38 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 _0xe14b=['MessageId','InteractionId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Website','User','agent','Agent\x20not\x20found','Message','update','From','bluebird','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found'];(function(_0x571310,_0x3c0d3c){var _0xe9283=function(_0x22ddc6){while(--_0x22ddc6){_0x571310['push'](_0x571310['shift']());}};_0xe9283(++_0x3c0d3c);}(_0xe14b,0x93));var _0xbe14=function(_0x43dae5,_0x50c494){_0x43dae5=_0x43dae5-0x0;var _0x2ecd45=_0xe14b[_0x43dae5];return _0x2ecd45;};'use strict';var BPromise=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var _=require('lodash');var util=require('util');var db=require(_0xbe14('0x2'))['db'];var logger=require(_0xbe14('0x3'))('api');var jayson=require(_0xbe14('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232b});var routingClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){var _0x496063=_0x196fca?_0x196fca:amiClient;return _0x496063[_0xbe14('0x7')](_0x1d9ade,_0x39387e)[_0xbe14('0x8')](function(_0xd68cd7){if(_0xd68cd7[_0xbe14('0x9')]){if(_0xd68cd7['error']['code']===0x1f4){return _0x50f909(_0xd68cd7[_0xbe14('0x9')][_0xbe14('0xa')]);}return _0x566ae7(_0xd68cd7['error'][_0xbe14('0xa')]);}else{_0x566ae7(_0xd68cd7[_0xbe14('0xb')]);}})[_0xbe14('0xc')](function(_0x3d38c2){_0x50f909(_0x3d38c2);});});}function respondWithResult(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xc8;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0xd')](_0x3b898d)[_0xbe14('0xe')](_0x23a730);}return _0x27792f[_0xbe14('0xf')](0x194);};}function handleError(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0x1f4;return function(_0x813399){logger['error'](_0x813399['stack']);if(_0x813399[_0xbe14('0x10')]){delete _0x813399[_0xbe14('0x10')];}_0x1e4826[_0xbe14('0xd')](_0x33fd54)[_0xbe14('0x11')](_0x813399);};}function findById(_0x4e8f34){return function(_0x21c789){if(!_[_0xbe14('0x12')](_0x4e8f34)&&!_[_0xbe14('0x12')](_0x21c789)&&!_[_0xbe14('0x12')](_0x21c789[_0xbe14('0x13')])){return _[_0xbe14('0x14')](_0x21c789[_0xbe14('0x13')],function(_0x5ea1f8){return _0x5ea1f8['id']==_0x4e8f34;});}return null;};}exports[_0xbe14('0x15')]=function(_0x456ca8,_0x329588){return respondWithRpcPromise(_0xbe14('0x16'),_0x456ca8[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x329588,null))['catch'](handleError(_0x329588,null));};exports[_0xbe14('0x18')]=function(_0x4a1bbd,_0x417c8d){return respondWithRpcPromise(_0xbe14('0x19'),_[_0xbe14('0x1a')](_0x4a1bbd['query'],_0x4a1bbd[_0xbe14('0x1b')]))['then'](respondWithResult(_0x417c8d,null))[_0xbe14('0xc')](handleError(_0x417c8d,null));};exports['voiceChannelStopMixMonitor']=function(_0x32e8eb,_0x4a25fa){return respondWithRpcPromise(_0xbe14('0x1c'),_[_0xbe14('0x1a')](_0x32e8eb['query'],_0x32e8eb[_0xbe14('0x1b')]))['then'](respondWithResult(_0x4a25fa,null))[_0xbe14('0xc')](handleError(_0x4a25fa,null));};exports['voiceQueues']=function(_0x36a21e,_0x5fa043){return respondWithRpcPromise(_0xbe14('0x1d'),_0x36a21e[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x5fa043,null))[_0xbe14('0xc')](handleError(_0x5fa043,null));};exports['showVoiceQueues']=function(_0x1822e0,_0x1ba46a){return respondWithRpcPromise(_0xbe14('0x1d'),_0x1822e0[_0xbe14('0x17')])['then'](findById(_0x1822e0[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x1ba46a,null))['catch'](handleError(_0x1ba46a,null));};exports[_0xbe14('0x1e')]=function(_0x3b3e84,_0x1c7cc7){return respondWithRpcPromise(_0xbe14('0x1f'),_[_0xbe14('0x1a')](_0x3b3e84[_0xbe14('0x20')],_0x3b3e84[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x1c7cc7,null))[_0xbe14('0xc')](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x21')]=function(_0x40538f,_0x3bf43c){return respondWithRpcPromise(_0xbe14('0x22'),_[_0xbe14('0x1a')](_0x40538f[_0xbe14('0x17')],_0x40538f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x3bf43c,null))[_0xbe14('0xc')](handleError(_0x3bf43c,null));};exports[_0xbe14('0x23')]=function(_0x14e7c4,_0x581e86){return respondWithRpcPromise(_0xbe14('0x24'),_0x14e7c4['query'])['then'](respondWithResult(_0x581e86,null))[_0xbe14('0xc')](handleError(_0x581e86,null));};exports['voiceQueuesChannel']=function(_0x243524,_0x345b0){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x243524['query'],_0x243524[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x345b0,null))['catch'](handleError(_0x345b0,null));};exports[_0xbe14('0x25')]=function(_0x1faf3e,_0x452635){return respondWithRpcPromise(_0xbe14('0x26'),_[_0xbe14('0x1a')](_0x1faf3e['query'],_0x1faf3e['params']))[_0xbe14('0x8')](respondWithResult(_0x452635,null))['catch'](handleError(_0x452635,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c5e9f,_0x163ef7){return respondWithRpcPromise(_0xbe14('0x27'),_[_0xbe14('0x1a')](_0x5c5e9f[_0xbe14('0x17')],_0x5c5e9f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x163ef7,null))[_0xbe14('0xc')](handleError(_0x163ef7,null));};exports[_0xbe14('0x28')]=function(_0x2d9c12,_0x2dfd5a){return respondWithRpcPromise(_0xbe14('0x29'),_0x2d9c12[_0xbe14('0x17')])['then'](respondWithResult(_0x2dfd5a,null))['catch'](handleError(_0x2dfd5a,null));};exports[_0xbe14('0x2a')]=function(_0x2951e1,_0x13bfcf){return respondWithRpcPromise('OutboundChannels',_0x2951e1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x13bfcf,null))[_0xbe14('0xc')](handleError(_0x13bfcf,null));};exports[_0xbe14('0x2b')]=function(_0x3bd454,_0x25ee1f){var _0x19fa30;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')])['then'](function(_0xe51424){_0x19fa30=_0xe51424;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')],routingClient);})[_0xbe14('0x8')](function(_0x3287b9){return _[_0xbe14('0x1a')]({},_0x3287b9,_0x19fa30);})['then'](respondWithResult(_0x25ee1f,null))[_0xbe14('0xc')](handleError(_0x25ee1f,null));};exports[_0xbe14('0x2d')]=function(_0x1220c9,_0x36263c){if(_0x1220c9['body']&&_0x1220c9['body'][_0xbe14('0x2e')]&&_0x1220c9[_0xbe14('0x2f')]&&_0x1220c9[_0xbe14('0x2f')]['name']){for(var _0x5d5318 in _0x1220c9[_0xbe14('0x20')]['interaction']){if(_0x1220c9['body'][_0xbe14('0x2e')][_0xbe14('0x30')](_0x5d5318)){db[_0xbe14('0x31')]['findAll']({'where':{'channel':_0x5d5318,'membername':_0x1220c9['user']['name'],'type':_0xbe14('0x32'),'exitAt':null,'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]&&_0x1220c9['body'][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')]?{'$notIn':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]}:{'$ne':null}}})['then'](function(_0x4a1a4b){var _0x3e2fd3=moment()[_0xbe14('0x34')](_0xbe14('0x35'));for(var _0xb2b285=0x0,_0x2550dc=_0x4a1a4b['length'];_0xb2b285<_0x2550dc;_0xb2b285+=0x1){_0x4a1a4b[_0xb2b285]['updateAttributes']({'exitAt':_0x3e2fd3});}});for(var _0x46af81=0x0;_0x46af81<_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')];_0x46af81+=0x1){db['MemberReport'][_0xbe14('0x36')]({'where':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'type':_0xbe14('0x32'),'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81],'exitAt':null},'defaults':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'interface':_['isNil'](_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')])?util['format']('SIP/%s',_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x10')]):_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')],'type':_0xbe14('0x32'),'enterAt':moment()[_0xbe14('0x34')](_0xbe14('0x35')),'role':'agent','internal':_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x38')],'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81]}});}}}}return respondWithRpcPromise(_0xbe14('0x39'),{'id':_0x1220c9['params']['id'],'capacity':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x3a')]},routingClient)[_0xbe14('0x8')](respondWithResult(_0x36263c,null))[_0xbe14('0xc')](handleError(_0x36263c,null));};exports[_0xbe14('0x3b')]=function(_0x2dbeb1,_0x505829){return respondWithRpcPromise('Telephones',_0x2dbeb1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x505829,null))[_0xbe14('0xc')](handleError(_0x505829,null));};exports['trunks']=function(_0x497b00,_0x44fe0d){return respondWithRpcPromise(_0xbe14('0x3c'),_0x497b00['query'])[_0xbe14('0x8')](respondWithResult(_0x44fe0d,null))[_0xbe14('0xc')](handleError(_0x44fe0d,null));};exports['campaigns']=function(_0x28f995,_0x4a40d2){return respondWithRpcPromise(_0xbe14('0x3d'),_0x28f995[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x4a40d2,null))['catch'](handleError(_0x4a40d2,null));};exports[_0xbe14('0x3e')]=function(_0x404212,_0x5dc78a){return respondWithRpcPromise(_0xbe14('0x3f'),_0x404212[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x5dc78a,null))[_0xbe14('0xc')](handleError(_0x5dc78a,null));};exports[_0xbe14('0x40')]=function(_0x4f06a3,_0x42a346){return respondWithRpcPromise(_0xbe14('0x3f'),_0x4f06a3[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x4f06a3[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x42a346,null))[_0xbe14('0xc')](handleError(_0x42a346,null));};exports['mailQueues']=function(_0x72c875,_0x1b47a4){return respondWithRpcPromise(_0xbe14('0x41'),_0x72c875[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1b47a4,null))[_0xbe14('0xc')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x42')]=function(_0x32df3c,_0x285b6e){return respondWithRpcPromise(_0xbe14('0x41'),_0x32df3c[_0xbe14('0x17')],routingClient)['then'](findById(_0x32df3c['params']['id']))['then'](respondWithResult(_0x285b6e,null))[_0xbe14('0xc')](handleError(_0x285b6e,null));};exports[_0xbe14('0x43')]=function(_0x2f4e52,_0xf79b21){return respondWithRpcPromise(_0xbe14('0x44'),_0x2f4e52[_0xbe14('0x17')],mailClient)[_0xbe14('0x8')](respondWithResult(_0xf79b21,null))[_0xbe14('0xc')](handleError(_0xf79b21,null));};exports[_0xbe14('0x45')]=function(_0x451b0b,_0x603816){return respondWithRpcPromise(_0xbe14('0x46'),_0x451b0b[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x603816,null))[_0xbe14('0xc')](handleError(_0x603816,null));};exports[_0xbe14('0x47')]=function(_0x179077,_0x2225d9){return respondWithRpcPromise(_0xbe14('0x46'),_0x179077[_0xbe14('0x17')],routingClient)['then'](findById(_0x179077[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x2225d9,null))[_0xbe14('0xc')](handleError(_0x2225d9,null));};exports[_0xbe14('0x48')]=function(_0x3ee6b7,_0x222944){return respondWithRpcPromise(_0xbe14('0x49'),_0x3ee6b7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x222944,null))[_0xbe14('0xc')](handleError(_0x222944,null));};exports['showSmsQueues']=function(_0x18be56,_0x442ec4){return respondWithRpcPromise(_0xbe14('0x49'),_0x18be56[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x18be56['params']['id']))[_0xbe14('0x8')](respondWithResult(_0x442ec4,null))[_0xbe14('0xc')](handleError(_0x442ec4,null));};exports[_0xbe14('0x4a')]=function(_0xd4e1c7,_0x46ac9c){return respondWithRpcPromise('WhatsappQueues',_0xd4e1c7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x46ac9c,null))[_0xbe14('0xc')](handleError(_0x46ac9c,null));};exports[_0xbe14('0x4b')]=function(_0xaebce8,_0x289c4d){return respondWithRpcPromise(_0xbe14('0x4c'),_0xaebce8[_0xbe14('0x17')],routingClient)['then'](findById(_0xaebce8[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x289c4d,null))[_0xbe14('0xc')](handleError(_0x289c4d,null));};exports[_0xbe14('0x4d')]=function(_0x5982b7,_0xa4b2a3){return respondWithRpcPromise(_0xbe14('0x4e'),_0x5982b7['query'],routingClient)['then'](respondWithResult(_0xa4b2a3,null))[_0xbe14('0xc')](handleError(_0xa4b2a3,null));};exports[_0xbe14('0x4f')]=function(_0x2d2643,_0x2510a0){return respondWithRpcPromise(_0xbe14('0x4e'),_0x2d2643[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x2d2643[_0xbe14('0x1b')]['id']))['then'](respondWithResult(_0x2510a0,null))['catch'](handleError(_0x2510a0,null));};exports[_0xbe14('0x50')]=function(_0x1c18b6,_0x29aa52){return respondWithRpcPromise('FaxAccounts',_0x1c18b6[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x29aa52,null))[_0xbe14('0xc')](handleError(_0x29aa52,null));};exports[_0xbe14('0x51')]=function(_0x468e9f,_0x1ef09b){return respondWithRpcPromise(_0xbe14('0x52'),_0x468e9f['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1ef09b,null))[_0xbe14('0xc')](handleError(_0x1ef09b,null));};exports[_0xbe14('0x53')]=function(_0x3afc5a,_0x469555){return respondWithRpcPromise(_0xbe14('0x54'),_0x3afc5a[_0xbe14('0x17')],routingClient)['then'](respondWithResult(_0x469555,null))[_0xbe14('0xc')](handleError(_0x469555,null));};exports[_0xbe14('0x55')]=function(_0x3cd17e,_0x1c0932){return respondWithRpcPromise(_0xbe14('0x56'),_0x3cd17e[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1c0932,null))[_0xbe14('0xc')](handleError(_0x1c0932,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x1e5ce1,_0x401968){return respondWithRpcPromise(_0xbe14('0x56'),_0x1e5ce1[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](function(_0x17576b){if(_0x1e5ce1['query'][_0xbe14('0x57')]!==undefined){var _0x175213=_(_0x17576b[_0xbe14('0x13')])[_0xbe14('0x58')]([_0x1e5ce1['query'][_0xbe14('0x57')],_0x1e5ce1[_0xbe14('0x1b')]['id']])[_0xbe14('0x59')](_0xbe14('0x5a'))[_0xbe14('0x5b')]()[_0xbe14('0x5c')]();return _0x17576b[_0xbe14('0x13')]['filter'](function(_0x70ed08){return _0x175213['indexOf'](_0x70ed08[_0xbe14('0x5a')])>-0x1;});}else{return _0x17576b['rows'][_0xbe14('0x58')](function(_0x21837c){return _0x21837c[_0xbe14('0x5a')]===parseInt(_0x1e5ce1['params']['id']);});}})[_0xbe14('0x8')](respondWithResult(_0x401968,null))[_0xbe14('0xc')](handleError(_0x401968,null));};exports[_0xbe14('0x5d')]=function(_0x546f22,_0x41a896){return respondWithRpcPromise(_0xbe14('0x5e'),_0x546f22[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x41a896,null))['catch'](handleError(_0x41a896,null));};exports[_0xbe14('0x5f')]=function(_0x39bc54,_0x34f90b){return respondWithRpcPromise(_0xbe14('0x60'),_0x39bc54[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x34f90b,null))[_0xbe14('0xc')](handleError(_0x34f90b,null));};exports['faxQueuesWaitingInteractions']=function(_0x2ff94c,_0x123f4f){return respondWithRpcPromise(_0xbe14('0x61'),_0x2ff94c['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x123f4f,null))[_0xbe14('0xc')](handleError(_0x123f4f,null));};exports[_0xbe14('0x62')]=function(_0x5bc52b){return function(_0xa53262,_0x1205d1){var _0x47d7bb,_0x2be969;var _0x49990b=_[_0xbe14('0x63')](_0x5bc52b);var _0x337073=_0x5bc52b==='chat'?'Website':_0xbe14('0x64');return db[_0x49990b+_0xbe14('0x65')][_0xbe14('0x66')]({'raw':!![],'where':{'id':_0xa53262['params']['id']}})[_0xbe14('0x8')](function(_0x30c03b){if(_[_0xbe14('0x12')](_0x30c03b)){throw new Error(_0x49990b+_0xbe14('0x67'));}_0x47d7bb=_0x30c03b;return db[_0x49990b+'Message']['findOne']({'where':{'id':_0xa53262[_0xbe14('0x20')][_0xbe14('0x68')]},'include':[{'model':db[_0x49990b+_0xbe14('0x69')],'as':_0xbe14('0x69')},{'model':db[_0x49990b+_0x337073],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x139aab){if(_['isNil'](_0x139aab)){throw new Error(_0x49990b+_0xbe14('0x6a'));}_0x2be969=_0x139aab;return _0x139aab['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x3a01bb={'uniqueid':_0x5bc52b+'.'+_0x2be969['id']+'.'+_0x2be969[_0xbe14('0x69')]['id'],'FromUserId':_0xa53262[_0xbe14('0x2f')]['id'],'type':'queue'};_0x3a01bb[_0x49990b+_0xbe14('0x6b')]=_0x2be969['id'];_0x3a01bb[_0x49990b+_0xbe14('0x6c')]=_0x2be969[_0xbe14('0x69')]['id'];_0x3a01bb['From'+_0x49990b+_0x337073+'Id']=_0x2be969[_0xbe14('0x64')]['id'];_0x3a01bb['To'+_0x49990b+_0xbe14('0x6d')]=_0x47d7bb['id'];return db[_0x49990b+_0xbe14('0x6e')][_0xbe14('0x6f')](_0x3a01bb);})[_0xbe14('0x8')](function(){return respondWithRpcPromise(_0xbe14('0x70'),{'channel':_0x5bc52b,'interaction':_0x2be969[_0xbe14('0x69')],'message':_0x2be969,'account':_0x2be969[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbe14('0x71'),'appdata':_0x47d7bb[_0xbe14('0x10')]+','+(_0x2be969[_0xbe14('0x64')][_0xbe14('0x72')]||0x12c),'interval':_0xbe14('0x73')}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x1205d1,null))[_0xbe14('0xc')](handleError(_0x1205d1,null));};};exports[_0xbe14('0x74')]=function(_0x1de70d,_0x30be9e){var _0x1679bd,_0x2ca6e6;if(_['isNil'](_0x1de70d[_0xbe14('0x20')]['channel'])){throw new Error(_0xbe14('0x75'));}var _0x1b8733=_0x1de70d[_0xbe14('0x20')][_0xbe14('0x76')];var _0x1d7b08=_['capitalize'](_0x1b8733);var _0x5868d7=_0x1b8733===_0xbe14('0x77')?_0xbe14('0x78'):_0xbe14('0x64');return db[_0xbe14('0x79')]['findOne']({'raw':!![],'where':{'id':_0x1de70d[_0xbe14('0x1b')]['id'],'role':_0xbe14('0x7a')}})['then'](function(_0x186225){if(_[_0xbe14('0x12')](_0x186225)){throw new Error(_0xbe14('0x7b'));}_0x1679bd=_0x186225;return db[_0x1d7b08+_0xbe14('0x7c')]['findOne']({'where':{'id':_0x1de70d[_0xbe14('0x20')]['messageId']},'include':[{'model':db[_0x1d7b08+'Interaction'],'as':_0xbe14('0x69')},{'model':db[_0x1d7b08+_0x5868d7],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x3d890b){if(_[_0xbe14('0x12')](_0x3d890b)){throw new Error(_0x1d7b08+'\x20Message\x20not\x20found');}_0x2ca6e6=_0x3d890b;return _0x3d890b[_0xbe14('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x5dc793={'uniqueid':_0x1b8733+'.'+_0x2ca6e6['id']+'.'+_0x2ca6e6['Interaction']['id'],'FromUserId':_0x1de70d[_0xbe14('0x2f')]['id'],'type':_0xbe14('0x71'),'ToUserId':_0x1679bd['id']};_0x5dc793[_0x1d7b08+'MessageId']=_0x2ca6e6['id'];_0x5dc793[_0x1d7b08+_0xbe14('0x6c')]=_0x2ca6e6['Interaction']['id'];_0x5dc793[_0xbe14('0x7e')+_0x1d7b08+_0x5868d7+'Id']=_0x2ca6e6['Account']['id'];return db[_0x1d7b08+_0xbe14('0x6e')]['create'](_0x5dc793);})[_0xbe14('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1b8733,'interaction':_0x2ca6e6[_0xbe14('0x69')],'message':_0x2ca6e6,'account':_0x2ca6e6[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1679bd['name']+','+(_0x2ca6e6[_0xbe14('0x64')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x30be9e,null))[_0xbe14('0xc')](handleError(_0x30be9e,null));}; \ No newline at end of file +var _0xac9d=['SIP/%s','INTERACTION','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','find','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','findOrCreate','interface','format'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xac9d,0x14d));var _0xdac9=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0xac9d[_0x54defc];return _0x1955d3;};'use strict';var BPromise=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var _=require(_0xdac9('0x2'));var util=require(_0xdac9('0x3'));var db=require(_0xdac9('0x4'))['db'];var logger=require(_0xdac9('0x5'))(_0xdac9('0x6'));var jayson=require(_0xdac9('0x7'));var amiClient=jayson['client'][_0xdac9('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xdac9('0x8')]({'port':0x232b});var routingClient=jayson[_0xdac9('0x9')][_0xdac9('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){var _0x47d9fd=_0x39f560?_0x39f560:amiClient;return _0x47d9fd[_0xdac9('0xa')](_0x776b6c,_0x1c78c5)[_0xdac9('0xb')](function(_0x39c92c){if(_0x39c92c[_0xdac9('0xc')]){if(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xd')]===0x1f4){return _0x2b1d6f(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xe')]);}return _0x5531af(_0x39c92c[_0xdac9('0xc')]['message']);}else{_0x5531af(_0x39c92c[_0xdac9('0xf')]);}})[_0xdac9('0x10')](function(_0x5a9bde){_0x2b1d6f(_0x5a9bde);});});}function respondWithResult(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xc8;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['status'](_0xeddbc1)[_0xdac9('0x11')](_0xbfe6d8);}return _0x3d8e97[_0xdac9('0x12')](0x194);};}function handleError(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0x1f4;return function(_0x5dd536){logger[_0xdac9('0xc')](_0x5dd536[_0xdac9('0x13')]);if(_0x5dd536['name']){delete _0x5dd536[_0xdac9('0x14')];}_0x9e1bf6[_0xdac9('0x15')](_0x5f0bbd)[_0xdac9('0x16')](_0x5dd536);};}function findById(_0x5b2f1b){return function(_0x2221f8){if(!_[_0xdac9('0x17')](_0x5b2f1b)&&!_[_0xdac9('0x17')](_0x2221f8)&&!_[_0xdac9('0x17')](_0x2221f8['rows'])){return _[_0xdac9('0x18')](_0x2221f8[_0xdac9('0x19')],function(_0x571e07){return _0x571e07['id']==_0x5b2f1b;});}return null;};}exports[_0xdac9('0x1a')]=function(_0xa57f2d,_0x171df1){return respondWithRpcPromise(_0xdac9('0x1b'),_0xa57f2d['query'])['then'](respondWithResult(_0x171df1,null))[_0xdac9('0x10')](handleError(_0x171df1,null));};exports[_0xdac9('0x1c')]=function(_0x2b9d91,_0x395ec7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xdac9('0x1d')](_0x2b9d91[_0xdac9('0x1e')],_0x2b9d91[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x395ec7,null))[_0xdac9('0x10')](handleError(_0x395ec7,null));};exports[_0xdac9('0x20')]=function(_0x41335a,_0xa1f726){return respondWithRpcPromise(_0xdac9('0x21'),_[_0xdac9('0x1d')](_0x41335a['query'],_0x41335a[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0xa1f726,null))[_0xdac9('0x10')](handleError(_0xa1f726,null));};exports[_0xdac9('0x22')]=function(_0x5ca076,_0x1e631a){return respondWithRpcPromise('VoiceQueues',_0x5ca076[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x1e631a,null))['catch'](handleError(_0x1e631a,null));};exports[_0xdac9('0x23')]=function(_0x5105f1,_0x450f91){return respondWithRpcPromise(_0xdac9('0x24'),_0x5105f1[_0xdac9('0x1e')])[_0xdac9('0xb')](findById(_0x5105f1['params']['id']))['then'](respondWithResult(_0x450f91,null))[_0xdac9('0x10')](handleError(_0x450f91,null));};exports[_0xdac9('0x25')]=function(_0x4fe3bd,_0x4c4e21){return respondWithRpcPromise(_0xdac9('0x26'),_[_0xdac9('0x1d')](_0x4fe3bd[_0xdac9('0x27')],_0x4fe3bd[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x4c4e21,null))[_0xdac9('0x10')](handleError(_0x4c4e21,null));};exports[_0xdac9('0x28')]=function(_0x2cda4d,_0x406ed0){return respondWithRpcPromise(_0xdac9('0x29'),_[_0xdac9('0x1d')](_0x2cda4d[_0xdac9('0x1e')],_0x2cda4d[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x406ed0,null))[_0xdac9('0x10')](handleError(_0x406ed0,null));};exports[_0xdac9('0x2a')]=function(_0x372f02,_0x44eff2){return respondWithRpcPromise(_0xdac9('0x2b'),_0x372f02[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x44eff2,null))['catch'](handleError(_0x44eff2,null));};exports['voiceQueuesChannel']=function(_0x1e6832,_0x416501){return respondWithRpcPromise(_0xdac9('0x2c'),_[_0xdac9('0x1d')](_0x1e6832[_0xdac9('0x1e')],_0x1e6832['params']))[_0xdac9('0xb')](respondWithResult(_0x416501,null))['catch'](handleError(_0x416501,null));};exports[_0xdac9('0x2d')]=function(_0x2a611e,_0x5cfebf){return respondWithRpcPromise(_0xdac9('0x2e'),_['merge'](_0x2a611e['query'],_0x2a611e[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x5cfebf,null))[_0xdac9('0x10')](handleError(_0x5cfebf,null));};exports[_0xdac9('0x2f')]=function(_0x3bab10,_0x363d93){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xdac9('0x1d')](_0x3bab10[_0xdac9('0x1e')],_0x3bab10['params']))[_0xdac9('0xb')](respondWithResult(_0x363d93,null))[_0xdac9('0x10')](handleError(_0x363d93,null));};exports[_0xdac9('0x30')]=function(_0x27bdfb,_0x35aa58){return respondWithRpcPromise(_0xdac9('0x31'),_0x27bdfb[_0xdac9('0x1e')])['then'](respondWithResult(_0x35aa58,null))[_0xdac9('0x10')](handleError(_0x35aa58,null));};exports[_0xdac9('0x32')]=function(_0x238769,_0x4b6b09){return respondWithRpcPromise(_0xdac9('0x33'),_0x238769[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4b6b09,null))[_0xdac9('0x10')](handleError(_0x4b6b09,null));};exports['agents']=function(_0x58fd14,_0x1d0243){var _0xe47a3c;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14[_0xdac9('0x1e')])[_0xdac9('0xb')](function(_0x579581){_0xe47a3c=_0x579581;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14['query'],routingClient);})[_0xdac9('0xb')](function(_0xaca43c){return _[_0xdac9('0x1d')]({},_0xaca43c,_0xe47a3c);})[_0xdac9('0xb')](respondWithResult(_0x1d0243,null))[_0xdac9('0x10')](handleError(_0x1d0243,null));};exports[_0xdac9('0x35')]=function(_0x413fb1,_0xb176e0){if(_0x413fb1[_0xdac9('0x27')]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]&&_0x413fb1[_0xdac9('0x37')]&&_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]){for(var _0x5335ae in _0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]){if(_0x413fb1['body'][_0xdac9('0x36')][_0xdac9('0x38')](_0x5335ae)){db[_0xdac9('0x39')][_0xdac9('0x3a')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')]?{'$notIn':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]}:{'$ne':null}}})['then'](function(_0x585f08){var _0xcb7b82=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4159fd=0x0,_0x15c332=_0x585f08['length'];_0x4159fd<_0x15c332;_0x4159fd+=0x1){_0x585f08[_0x4159fd]['updateAttributes']({'exitAt':_0xcb7b82});}});for(var _0x1666c5=0x0;_0x1666c5<_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')];_0x1666c5+=0x1){db[_0xdac9('0x39')][_0xdac9('0x3c')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','uniqueid':_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0x1666c5],'exitAt':null},'defaults':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'interface':_[_0xdac9('0x17')](_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')])?util[_0xdac9('0x3e')](_0xdac9('0x3f'),_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]):_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')],'type':_0xdac9('0x40'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x41')],'uniqueid':_0x413fb1['body'][_0xdac9('0x36')][_0x5335ae][_0x1666c5]}});}}}}return respondWithRpcPromise(_0xdac9('0x42'),{'id':_0x413fb1[_0xdac9('0x1f')]['id'],'capacity':_0x413fb1['body'][_0xdac9('0x43')]},routingClient)[_0xdac9('0xb')](respondWithResult(_0xb176e0,null))['catch'](handleError(_0xb176e0,null));};exports['telephones']=function(_0x46f1c0,_0x4469d8){return respondWithRpcPromise(_0xdac9('0x44'),_0x46f1c0[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4469d8,null))[_0xdac9('0x10')](handleError(_0x4469d8,null));};exports[_0xdac9('0x45')]=function(_0x3a77e3,_0x298c72){return respondWithRpcPromise(_0xdac9('0x46'),_0x3a77e3[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x298c72,null))[_0xdac9('0x10')](handleError(_0x298c72,null));};exports[_0xdac9('0x47')]=function(_0x35a378,_0x5d0b43){return respondWithRpcPromise(_0xdac9('0x48'),_0x35a378[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x5d0b43,null))[_0xdac9('0x10')](handleError(_0x5d0b43,null));};exports[_0xdac9('0x49')]=function(_0x3a391a,_0x4b118e){return respondWithRpcPromise(_0xdac9('0x4a'),_0x3a391a[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x4b118e,null))[_0xdac9('0x10')](handleError(_0x4b118e,null));};exports[_0xdac9('0x4b')]=function(_0x2a5bf9,_0x1eec39){return respondWithRpcPromise(_0xdac9('0x4a'),_0x2a5bf9[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2a5bf9[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x1eec39,null))[_0xdac9('0x10')](handleError(_0x1eec39,null));};exports[_0xdac9('0x4c')]=function(_0x2ca15d,_0x21ab3d){return respondWithRpcPromise('MailQueues',_0x2ca15d['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x21ab3d,null))[_0xdac9('0x10')](handleError(_0x21ab3d,null));};exports[_0xdac9('0x4d')]=function(_0x46017d,_0x1c1f5f){return respondWithRpcPromise(_0xdac9('0x4e'),_0x46017d['query'],routingClient)['then'](findById(_0x46017d['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x1c1f5f,null))[_0xdac9('0x10')](handleError(_0x1c1f5f,null));};exports[_0xdac9('0x4f')]=function(_0x2f581b,_0x52ad7b){return respondWithRpcPromise(_0xdac9('0x50'),_0x2f581b[_0xdac9('0x1e')],mailClient)[_0xdac9('0xb')](respondWithResult(_0x52ad7b,null))[_0xdac9('0x10')](handleError(_0x52ad7b,null));};exports[_0xdac9('0x51')]=function(_0x496d9c,_0x19a46e){return respondWithRpcPromise('OpenchannelQueues',_0x496d9c[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x19a46e,null))[_0xdac9('0x10')](handleError(_0x19a46e,null));};exports[_0xdac9('0x52')]=function(_0x2fd7c8,_0x360499){return respondWithRpcPromise(_0xdac9('0x53'),_0x2fd7c8[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x2fd7c8['params']['id']))['then'](respondWithResult(_0x360499,null))['catch'](handleError(_0x360499,null));};exports[_0xdac9('0x54')]=function(_0x42ba53,_0x830d54){return respondWithRpcPromise(_0xdac9('0x55'),_0x42ba53[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x830d54,null))[_0xdac9('0x10')](handleError(_0x830d54,null));};exports['showSmsQueues']=function(_0x2d81fc,_0x5b63d8){return respondWithRpcPromise('SmsQueues',_0x2d81fc[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2d81fc['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x5b63d8,null))[_0xdac9('0x10')](handleError(_0x5b63d8,null));};exports[_0xdac9('0x56')]=function(_0x55ce14,_0x552cac){return respondWithRpcPromise(_0xdac9('0x57'),_0x55ce14[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x552cac,null))[_0xdac9('0x10')](handleError(_0x552cac,null));};exports[_0xdac9('0x58')]=function(_0x26b9b5,_0x272f14){return respondWithRpcPromise(_0xdac9('0x57'),_0x26b9b5[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x26b9b5[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x272f14,null))[_0xdac9('0x10')](handleError(_0x272f14,null));};exports[_0xdac9('0x59')]=function(_0x1e2e7b,_0x5401e6){return respondWithRpcPromise(_0xdac9('0x5a'),_0x1e2e7b['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x5401e6,null))[_0xdac9('0x10')](handleError(_0x5401e6,null));};exports['showFaxQueues']=function(_0x3a6c78,_0x3bee81){return respondWithRpcPromise(_0xdac9('0x5a'),_0x3a6c78[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x3a6c78[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x3bee81,null))[_0xdac9('0x10')](handleError(_0x3bee81,null));};exports[_0xdac9('0x5b')]=function(_0x45f183,_0x263b84){return respondWithRpcPromise(_0xdac9('0x5c'),_0x45f183[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x263b84,null))[_0xdac9('0x10')](handleError(_0x263b84,null));};exports[_0xdac9('0x5d')]=function(_0x4c4a7b,_0x3a457b){return respondWithRpcPromise(_0xdac9('0x5e'),_0x4c4a7b[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x3a457b,null))['catch'](handleError(_0x3a457b,null));};exports[_0xdac9('0x5f')]=function(_0x31f56e,_0x1b6a68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x31f56e[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x1b6a68,null))['catch'](handleError(_0x1b6a68,null));};exports[_0xdac9('0x60')]=function(_0x1b8ad9,_0x2a4d12){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1b8ad9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x2a4d12,null))[_0xdac9('0x10')](handleError(_0x2a4d12,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5c39e9,_0x108e03){return respondWithRpcPromise(_0xdac9('0x61'),_0x5c39e9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](function(_0x4110da){if(_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')]!==undefined){var _0x2de535=_(_0x4110da[_0xdac9('0x19')])[_0xdac9('0x63')]([_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')],_0x5c39e9[_0xdac9('0x1f')]['id']])['map']('queue_id')[_0xdac9('0x64')]()['value']();return _0x4110da['rows'][_0xdac9('0x63')](function(_0x199518){return _0x2de535[_0xdac9('0x65')](_0x199518[_0xdac9('0x66')])>-0x1;});}else{return _0x4110da['rows'][_0xdac9('0x63')](function(_0xff5be){return _0xff5be[_0xdac9('0x66')]===parseInt(_0x5c39e9['params']['id']);});}})[_0xdac9('0xb')](respondWithResult(_0x108e03,null))[_0xdac9('0x10')](handleError(_0x108e03,null));};exports['smsQueuesWaitingInteractions']=function(_0x3cc0f9,_0x59b5b2){return respondWithRpcPromise(_0xdac9('0x67'),_0x3cc0f9['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x59b5b2,null))[_0xdac9('0x10')](handleError(_0x59b5b2,null));};exports[_0xdac9('0x68')]=function(_0x251011,_0x9981f){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x251011[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x9981f,null))[_0xdac9('0x10')](handleError(_0x9981f,null));};exports[_0xdac9('0x69')]=function(_0x13be64,_0x227857){return respondWithRpcPromise(_0xdac9('0x6a'),_0x13be64[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x227857,null))['catch'](handleError(_0x227857,null));};exports[_0xdac9('0x6b')]=function(_0x300738){return function(_0x12c15b,_0x4f7f63){var _0x571130,_0x5650d1;var _0x5adc83=_['capitalize'](_0x300738);var _0x325407=_0x300738===_0xdac9('0x6c')?_0xdac9('0x6d'):_0xdac9('0x6e');return db[_0x5adc83+'Queue'][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x12c15b['params']['id']}})[_0xdac9('0xb')](function(_0x750de7){if(_[_0xdac9('0x17')](_0x750de7)){throw new Error(_0x5adc83+_0xdac9('0x70'));}_0x571130=_0x750de7;return db[_0x5adc83+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x12c15b[_0xdac9('0x27')][_0xdac9('0x71')]},'include':[{'model':db[_0x5adc83+_0xdac9('0x72')],'as':'Interaction'},{'model':db[_0x5adc83+_0x325407],'as':'Account'}]});})[_0xdac9('0xb')](function(_0x414f8a){if(_[_0xdac9('0x17')](_0x414f8a)){throw new Error(_0x5adc83+'\x20Message\x20not\x20found');}_0x5650d1=_0x414f8a;return _0x414f8a['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x111bff={'uniqueid':_0x300738+'.'+_0x5650d1['id']+'.'+_0x5650d1[_0xdac9('0x72')]['id'],'FromUserId':_0x12c15b[_0xdac9('0x37')]['id'],'type':_0xdac9('0x73')};_0x111bff[_0x5adc83+_0xdac9('0x74')]=_0x5650d1['id'];_0x111bff[_0x5adc83+_0xdac9('0x75')]=_0x5650d1[_0xdac9('0x72')]['id'];_0x111bff[_0xdac9('0x76')+_0x5adc83+_0x325407+'Id']=_0x5650d1[_0xdac9('0x6e')]['id'];_0x111bff['To'+_0x5adc83+_0xdac9('0x77')]=_0x571130['id'];return db[_0x5adc83+_0xdac9('0x78')][_0xdac9('0x79')](_0x111bff);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x300738,'interaction':_0x5650d1[_0xdac9('0x72')],'message':_0x5650d1,'account':_0x5650d1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xdac9('0x73'),'appdata':_0x571130['name']+','+(_0x5650d1[_0xdac9('0x6e')][_0xdac9('0x7b')]||0x12c),'interval':_0xdac9('0x7c')}]},routingClient);})[_0xdac9('0xb')](respondWithResult(_0x4f7f63,null))[_0xdac9('0x10')](handleError(_0x4f7f63,null));};};exports[_0xdac9('0x7d')]=function(_0x232876,_0x4463ca){var _0x171d38,_0x328fa2;if(_[_0xdac9('0x17')](_0x232876['body'][_0xdac9('0x7e')])){throw new Error(_0xdac9('0x7f'));}var _0x284247=_0x232876[_0xdac9('0x27')][_0xdac9('0x7e')];var _0x4d7208=_['capitalize'](_0x284247);var _0x363541=_0x284247==='chat'?'Website':_0xdac9('0x6e');return db[_0xdac9('0x80')][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x232876[_0xdac9('0x1f')]['id'],'role':'agent'}})[_0xdac9('0xb')](function(_0x8f37df){if(_[_0xdac9('0x17')](_0x8f37df)){throw new Error('Agent\x20not\x20found');}_0x171d38=_0x8f37df;return db[_0x4d7208+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x232876[_0xdac9('0x27')]['messageId']},'include':[{'model':db[_0x4d7208+'Interaction'],'as':'Interaction'},{'model':db[_0x4d7208+_0x363541],'as':_0xdac9('0x6e')}]});})[_0xdac9('0xb')](function(_0x131c78){if(_['isNil'](_0x131c78)){throw new Error(_0x4d7208+_0xdac9('0x81'));}_0x328fa2=_0x131c78;return _0x131c78[_0xdac9('0x82')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x2ab89f={'uniqueid':_0x284247+'.'+_0x328fa2['id']+'.'+_0x328fa2[_0xdac9('0x72')]['id'],'FromUserId':_0x232876['user']['id'],'type':_0xdac9('0x73'),'ToUserId':_0x171d38['id']};_0x2ab89f[_0x4d7208+_0xdac9('0x74')]=_0x328fa2['id'];_0x2ab89f[_0x4d7208+'InteractionId']=_0x328fa2[_0xdac9('0x72')]['id'];_0x2ab89f[_0xdac9('0x76')+_0x4d7208+_0x363541+'Id']=_0x328fa2[_0xdac9('0x6e')]['id'];return db[_0x4d7208+_0xdac9('0x78')]['create'](_0x2ab89f);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x284247,'interaction':_0x328fa2[_0xdac9('0x72')],'message':_0x328fa2,'account':_0x328fa2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x171d38[_0xdac9('0x14')]+','+(_0x328fa2['Account'][_0xdac9('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x4463ca,null))[_0xdac9('0x10')](handleError(_0x4463ca,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b08eb97..4ea44e2 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 _0x87e8=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./schedule.controller','isAuthenticated','index','/:id','show','get','/:id/run','run','post','put','update'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x87e8,0x7a));var _0x887e=function(_0x33ce9a,_0x3f4120){_0x33ce9a=_0x33ce9a-0x0;var _0x5a64d9=_0x87e8[_0x33ce9a];return _0x5a64d9;};'use strict';var multer=require(_0x887e('0x0'));var util=require(_0x887e('0x1'));var path=require(_0x887e('0x2'));var timeout=require(_0x887e('0x3'));var express=require(_0x887e('0x4'));var router=express['Router']();var fs_extra=require(_0x887e('0x5'));var auth=require(_0x887e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x887e('0x7'));router['get']('/',auth[_0x887e('0x8')](),controller[_0x887e('0x9')]);router['get'](_0x887e('0xa'),auth['isAuthenticated'](),controller[_0x887e('0xb')]);router[_0x887e('0xc')](_0x887e('0xd'),auth['isAuthenticated'](),controller[_0x887e('0xe')]);router[_0x887e('0xf')]('/',auth[_0x887e('0x8')](),controller['create']);router[_0x887e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x887e('0x11')]);router['delete']('/:id',auth[_0x887e('0x8')](),controller[_0x887e('0x12')]);module[_0x887e('0x13')]=router; \ No newline at end of file +var _0x50aa=['update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','/:id/run','run','put'];(function(_0x2b6242,_0x33f4ca){var _0x1df427=function(_0x1c32ce){while(--_0x1c32ce){_0x2b6242['push'](_0x2b6242['shift']());}};_0x1df427(++_0x33f4ca);}(_0x50aa,0xad));var _0xa50a=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x50aa[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require(_0xa50a('0x0'));var util=require(_0xa50a('0x1'));var path=require('path');var timeout=require(_0xa50a('0x2'));var express=require(_0xa50a('0x3'));var router=express['Router']();var fs_extra=require(_0xa50a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa50a('0x5'));var controller=require(_0xa50a('0x6'));router[_0xa50a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa50a('0x7')](_0xa50a('0x8'),auth[_0xa50a('0x9')](),controller[_0xa50a('0xa')]);router[_0xa50a('0x7')](_0xa50a('0xb'),auth[_0xa50a('0x9')](),controller[_0xa50a('0xc')]);router['post']('/',auth[_0xa50a('0x9')](),controller['create']);router[_0xa50a('0xd')]('/:id',auth[_0xa50a('0x9')](),controller[_0xa50a('0xe')]);router['delete'](_0xa50a('0x8'),auth[_0xa50a('0x9')](),controller[_0xa50a('0xf')]);module[_0xa50a('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 7cd8b29..c87b03b 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 _0x6579=['months','weeks','days','hours','csv','xlsx','default','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters'];(function(_0x528370,_0x6702fa){var _0x1bd4f3=function(_0x19b604){while(--_0x19b604){_0x528370['push'](_0x528370['shift']());}};_0x1bd4f3(++_0x6702fa);}(_0x6579,0x14c));var _0x9657=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6579[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9657('0x0')]={'name':{'type':Sequelize[_0x9657('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9657('0x1')]},'active':{'type':Sequelize[_0x9657('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9657('0x1')],'allowNull':![],'defaultValue':_0x9657('0x3')},'startAt':{'type':Sequelize[_0x9657('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9657('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9657('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9657('0x6')]('years',_0x9657('0x7'),_0x9657('0x8'),_0x9657('0x9'),_0x9657('0xa'),_0x9657('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x9657('0xa')},'output':{'type':Sequelize[_0x9657('0x6')](_0x9657('0xc'),'pdf',_0x9657('0xd')),'allowNull':![],'defaultValue':_0x9657('0xc')},'type':{'type':Sequelize['ENUM']('custom',_0x9657('0xe')),'allowNull':![],'defaultValue':_0x9657('0xf')},'sendMail':{'type':Sequelize[_0x9657('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x9657('0x1')]},'cc':{'type':Sequelize[_0x9657('0x10')]},'bcc':{'type':Sequelize[_0x9657('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x9657('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4ed0=['months','weeks','days','hours','minutes','csv','pdf','xlsx','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ed0,0x6e));var _0x04ed=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4ed0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x04ed('0x0'));module[_0x04ed('0x1')]={'name':{'type':Sequelize[_0x04ed('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x04ed('0x2')]},'active':{'type':Sequelize[_0x04ed('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x04ed('0x2')],'allowNull':![],'defaultValue':_0x04ed('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x04ed('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x04ed('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x04ed('0x7')](_0x04ed('0x8'),_0x04ed('0x9'),_0x04ed('0xa'),_0x04ed('0xb'),_0x04ed('0xc'),_0x04ed('0xd'),_0x04ed('0xe')),'allowNull':![],'defaultValue':_0x04ed('0xc')},'output':{'type':Sequelize[_0x04ed('0x7')](_0x04ed('0xf'),_0x04ed('0x10'),_0x04ed('0x11')),'allowNull':![],'defaultValue':_0x04ed('0xf')},'type':{'type':Sequelize['ENUM']('custom',_0x04ed('0x12')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x04ed('0x2')]},'cc':{'type':Sequelize[_0x04ed('0x13')]},'bcc':{'type':Sequelize[_0x04ed('0x13')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 9dc58e8..f9b63bd 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 _0xb260=['status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','Schedule','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus'];(function(_0x1f66c8,_0x47f1f9){var _0x2d5183=function(_0x324108){while(--_0x324108){_0x1f66c8['push'](_0x1f66c8['shift']());}};_0x2d5183(++_0x47f1f9);}(_0xb260,0x1e2));var _0x0b26=function(_0x41249d,_0x42bf39){_0x41249d=_0x41249d-0x0;var _0x50d59e=_0xb260[_0x41249d];return _0x50d59e;};'use strict';var emlformat=require(_0x0b26('0x0'));var rimraf=require(_0x0b26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b26('0x2'));var rp=require(_0x0b26('0x3'));var moment=require(_0x0b26('0x4'));var BPromise=require(_0x0b26('0x5'));var Mustache=require(_0x0b26('0x6'));var util=require(_0x0b26('0x7'));var path=require('path');var sox=require(_0x0b26('0x8'));var csv=require('to-csv');var ejs=require(_0x0b26('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b26('0xa'));var squel=require(_0x0b26('0xb'));var crypto=require(_0x0b26('0xc'));var jsforce=require(_0x0b26('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0b26('0xe'));var Papa=require(_0x0b26('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0b26('0x10'));var as=require(_0x0b26('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b26('0x12'))('api');var utils=require(_0x0b26('0x13'));var config=require(_0x0b26('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x176751,_0x4e816c){_0x4e816c=_0x4e816c||0xcc;return function(_0x2ebe8f){if(_0x2ebe8f){return _0x176751[_0x0b26('0x15')](_0x4e816c);}return _0x176751[_0x0b26('0x16')](_0x4e816c)[_0x0b26('0x17')]();};}function respondWithResult(_0x6435e9,_0xdc0de4){_0xdc0de4=_0xdc0de4||0xc8;return function(_0x2700db){if(_0x2700db){return _0x6435e9[_0x0b26('0x16')](_0xdc0de4)[_0x0b26('0x18')](_0x2700db);}};}function respondWithFilteredResult(_0x4612ce,_0x14843a){return function(_0x3a083b){if(_0x3a083b){var _0x5d76a0=typeof _0x14843a['offset']===_0x0b26('0x19')&&typeof _0x14843a[_0x0b26('0x1a')]===_0x0b26('0x19');var _0x3cd67e=_0x3a083b['count'];var _0x3e82df=_0x5d76a0?0x0:_0x14843a[_0x0b26('0x1b')];var _0x181edc=_0x5d76a0?_0x3a083b[_0x0b26('0x1c')]:_0x14843a[_0x0b26('0x1b')]+_0x14843a[_0x0b26('0x1a')];var _0xf296ff;if(_0x181edc>=_0x3cd67e){_0x181edc=_0x3cd67e;_0xf296ff=0xc8;}else{_0xf296ff=0xce;}_0x4612ce[_0x0b26('0x16')](_0xf296ff);return _0x4612ce[_0x0b26('0x1d')](_0x0b26('0x1e'),_0x3e82df+'-'+_0x181edc+'/'+_0x3cd67e)[_0x0b26('0x18')](_0x3a083b);}return null;};}function patchUpdates(_0x331a44){return function(_0xfbb3ae){try{jsonpatch[_0x0b26('0x1f')](_0xfbb3ae,_0x331a44,!![]);}catch(_0x230322){return BPromise[_0x0b26('0x20')](_0x230322);}return _0xfbb3ae[_0x0b26('0x21')]();};}function saveUpdates(_0x111d25,_0x176525){return function(_0x255c8a){if(_0x255c8a){return _0x255c8a[_0x0b26('0x22')](_0x111d25)['then'](function(_0x1f57aa){return _0x1f57aa;});}return null;};}function removeEntity(_0x2f4b3f,_0x313047){return function(_0x35ce3e){if(_0x35ce3e){return _0x35ce3e['destroy']()[_0x0b26('0x23')](function(){var _0x520c3d=_0x35ce3e[_0x0b26('0x24')]({'plain':!![]});var _0x979b29=_0x0b26('0x25');return db[_0x0b26('0x26')][_0x0b26('0x27')]({'where':{'type':_0x979b29,'resourceId':_0x520c3d['id']}})[_0x0b26('0x23')](function(){return _0x35ce3e;});})[_0x0b26('0x23')](function(){_0x2f4b3f[_0x0b26('0x16')](0xcc)[_0x0b26('0x17')]();});}};}function handleEntityNotFound(_0x2c4001,_0xeebf20){return function(_0x408ad7){if(!_0x408ad7){_0x2c4001[_0x0b26('0x15')](0x194);}return _0x408ad7;};}function handleError(_0x43a8bc,_0x291620){_0x291620=_0x291620||0x1f4;return function(_0x9de1fd){logger[_0x0b26('0x28')](_0x9de1fd[_0x0b26('0x29')]);if(_0x9de1fd[_0x0b26('0x2a')]){delete _0x9de1fd[_0x0b26('0x2a')];}_0x43a8bc[_0x0b26('0x16')](_0x291620)[_0x0b26('0x2b')](_0x9de1fd);};}exports[_0x0b26('0x2c')]=function(_0xab2906,_0x462ce1){var _0x2fab10={},_0x3f0091={},_0x28d4d4={'count':0x0,'rows':[]};var _0x26dac2=_['map'](db[_0x0b26('0x2d')]['rawAttributes'],function(_0x3a3d4c){return{'name':_0x3a3d4c[_0x0b26('0x2e')],'type':_0x3a3d4c[_0x0b26('0x2f')][_0x0b26('0x30')]};});_0x3f0091[_0x0b26('0x31')]=_[_0x0b26('0x32')](_0x26dac2,_0x0b26('0x2a'));_0x3f0091[_0x0b26('0x33')]=_[_0x0b26('0x34')](_0xab2906[_0x0b26('0x33')]);_0x3f0091[_0x0b26('0x35')]=_[_0x0b26('0x36')](_0x3f0091[_0x0b26('0x31')],_0x3f0091[_0x0b26('0x33')]);_0x2fab10[_0x0b26('0x37')]=_[_0x0b26('0x36')](_0x3f0091['model'],qs[_0x0b26('0x38')](_0xab2906[_0x0b26('0x33')][_0x0b26('0x38')]));_0x2fab10[_0x0b26('0x37')]=_0x2fab10[_0x0b26('0x37')]['length']?_0x2fab10[_0x0b26('0x37')]:_0x3f0091[_0x0b26('0x31')];if(!_0xab2906[_0x0b26('0x33')]['hasOwnProperty'](_0x0b26('0x39'))){_0x2fab10['limit']=qs[_0x0b26('0x1a')](_0xab2906['query'][_0x0b26('0x1a')]);_0x2fab10[_0x0b26('0x1b')]=qs['offset'](_0xab2906[_0x0b26('0x33')]['offset']);}_0x2fab10[_0x0b26('0x3a')]=qs[_0x0b26('0x3b')](_0xab2906[_0x0b26('0x33')]['sort']);_0x2fab10[_0x0b26('0x3c')]=qs[_0x0b26('0x35')](_['pick'](_0xab2906[_0x0b26('0x33')],_0x3f0091[_0x0b26('0x35')]),_0x26dac2);if(_0xab2906['query'][_0x0b26('0x3d')]){_0x2fab10[_0x0b26('0x3c')]=_[_0x0b26('0x3e')](_0x2fab10[_0x0b26('0x3c')],{'$or':_[_0x0b26('0x32')](_0x26dac2,function(_0x598bbd){if(_0x598bbd['type']!=='VIRTUAL'){var _0x18abfd={};_0x18abfd[_0x598bbd[_0x0b26('0x2a')]]={'$like':'%'+_0xab2906['query']['filter']+'%'};return _0x18abfd;}})});}_0x2fab10=_['merge']({},_0x2fab10,_0xab2906[_0x0b26('0x3f')]);var _0xc0b674={'where':_0x2fab10['where']};return db[_0x0b26('0x2d')][_0x0b26('0x1c')](_0xc0b674)[_0x0b26('0x23')](function(_0x405ab8){_0x28d4d4[_0x0b26('0x1c')]=_0x405ab8;if(_0xab2906['query'][_0x0b26('0x40')]){_0x2fab10['include']=[{'all':!![]}];}return db['Schedule'][_0x0b26('0x41')](_0x2fab10);})[_0x0b26('0x23')](function(_0x1742e9){_0x28d4d4[_0x0b26('0x42')]=_0x1742e9;return _0x28d4d4;})[_0x0b26('0x23')](respondWithFilteredResult(_0x462ce1,_0x2fab10))[_0x0b26('0x43')](handleError(_0x462ce1,null));};exports[_0x0b26('0x44')]=function(_0x1ad163,_0x459ef7){var _0x487087={'raw':![],'where':{'id':_0x1ad163[_0x0b26('0x45')]['id']}},_0x365e25={};_0x365e25[_0x0b26('0x31')]=_[_0x0b26('0x34')](db[_0x0b26('0x2d')][_0x0b26('0x46')]);_0x365e25['query']=_[_0x0b26('0x34')](_0x1ad163[_0x0b26('0x33')]);_0x365e25[_0x0b26('0x35')]=_[_0x0b26('0x36')](_0x365e25[_0x0b26('0x31')],_0x365e25[_0x0b26('0x33')]);_0x487087[_0x0b26('0x37')]=_[_0x0b26('0x36')](_0x365e25[_0x0b26('0x31')],qs[_0x0b26('0x38')](_0x1ad163['query']['fields']));_0x487087['attributes']=_0x487087[_0x0b26('0x37')][_0x0b26('0x47')]?_0x487087[_0x0b26('0x37')]:_0x365e25[_0x0b26('0x31')];if(_0x1ad163[_0x0b26('0x33')]['includeAll']){_0x487087[_0x0b26('0x48')]=[{'all':!![]}];}_0x487087=_[_0x0b26('0x3e')]({},_0x487087,_0x1ad163[_0x0b26('0x3f')]);return db[_0x0b26('0x2d')]['find'](_0x487087)[_0x0b26('0x23')](handleEntityNotFound(_0x459ef7,null))[_0x0b26('0x23')](respondWithResult(_0x459ef7,null))[_0x0b26('0x43')](handleError(_0x459ef7,null));};exports['create']=function(_0x7e5fca,_0x35d377){return db[_0x0b26('0x2d')][_0x0b26('0x49')](_0x7e5fca[_0x0b26('0x4a')],{})[_0x0b26('0x23')](function(_0x51298d){var _0x21e657=_0x7e5fca[_0x0b26('0x4b')][_0x0b26('0x24')]({'plain':!![]});if(!_0x21e657)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21e657[_0x0b26('0x4c')]===_0x0b26('0x4b')){var _0x20c277=_0x51298d[_0x0b26('0x24')]({'plain':!![]});var _0x2ac67c='Scheduler';return db[_0x0b26('0x4d')]['find']({'where':{'name':_0x2ac67c,'userProfileId':_0x21e657[_0x0b26('0x4e')]},'raw':!![]})[_0x0b26('0x23')](function(_0x5cf334){if(_0x5cf334&&_0x5cf334[_0x0b26('0x4f')]===0x0){return db[_0x0b26('0x26')][_0x0b26('0x49')]({'name':_0x20c277[_0x0b26('0x2a')],'resourceId':_0x20c277['id'],'type':_0x5cf334[_0x0b26('0x2a')],'sectionId':_0x5cf334['id']},{})[_0x0b26('0x23')](function(){return _0x51298d;});}else{return _0x51298d;}})[_0x0b26('0x43')](function(_0x2d809f){logger[_0x0b26('0x28')](_0x0b26('0x50'),_0x2d809f);throw _0x2d809f;});}return _0x51298d;})['then'](respondWithResult(_0x35d377,0xc9))[_0x0b26('0x43')](handleError(_0x35d377,null));};exports[_0x0b26('0x22')]=function(_0x4ef9aa,_0x3c541e){if(_0x4ef9aa['body']['id']){delete _0x4ef9aa[_0x0b26('0x4a')]['id'];}return db[_0x0b26('0x2d')][_0x0b26('0x51')]({'where':{'id':_0x4ef9aa['params']['id']}})[_0x0b26('0x23')](handleEntityNotFound(_0x3c541e,null))[_0x0b26('0x23')](saveUpdates(_0x4ef9aa[_0x0b26('0x4a')],null))[_0x0b26('0x23')](respondWithResult(_0x3c541e,null))[_0x0b26('0x43')](handleError(_0x3c541e,null));};exports[_0x0b26('0x27')]=function(_0x10af82,_0xfbb08a){return db['Schedule'][_0x0b26('0x51')]({'where':{'id':_0x10af82['params']['id']}})[_0x0b26('0x23')](handleEntityNotFound(_0xfbb08a,null))[_0x0b26('0x23')](removeEntity(_0xfbb08a,null))['catch'](handleError(_0xfbb08a,null));};exports[_0x0b26('0x52')]=function(_0x318d77,_0x4d6d54,_0x48596f){var _0x2b9758=require(_0x0b26('0x53'));return db[_0x0b26('0x2d')][_0x0b26('0x51')]({'where':{'id':_0x318d77[_0x0b26('0x45')]['id']},'raw':!![]})[_0x0b26('0x23')](handleEntityNotFound(_0x4d6d54,null))[_0x0b26('0x23')](function(){_0x2b9758[_0x0b26('0x52')](_0x318d77['params']['id']);})[_0x0b26('0x23')](respondWithStatusCode(_0x4d6d54,null))[_0x0b26('0x43')](handleError(_0x4d6d54,null));}; \ No newline at end of file +var _0x9040=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','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','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','save','update','destroy','then','get','Scheduler','name','send','Schedule','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter'];(function(_0x43a882,_0x1212b0){var _0x5b3ca5=function(_0x58b6ed){while(--_0x58b6ed){_0x43a882['push'](_0x43a882['shift']());}};_0x5b3ca5(++_0x1212b0);}(_0x9040,0x111));var _0x0904=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x9040[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0904('0x0'));var zipdir=require(_0x0904('0x1'));var jsonpatch=require(_0x0904('0x2'));var rp=require(_0x0904('0x3'));var moment=require(_0x0904('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0904('0x5'));var util=require('util');var path=require(_0x0904('0x6'));var sox=require(_0x0904('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0904('0x8'));var _=require(_0x0904('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0904('0xa'));var toCsv=require(_0x0904('0xb'));var querystring=require(_0x0904('0xc'));var Papa=require(_0x0904('0xd'));var Redis=require('ioredis');var authService=require(_0x0904('0xe'));var qs=require(_0x0904('0xf'));var as=require(_0x0904('0x10'));var hardwareService=require(_0x0904('0x11'));var logger=require(_0x0904('0x12'))(_0x0904('0x13'));var utils=require(_0x0904('0x14'));var config=require(_0x0904('0x15'));var licenseUtil=require(_0x0904('0x16'));var db=require(_0x0904('0x17'))['db'];function respondWithStatusCode(_0x708f84,_0x5439fd){_0x5439fd=_0x5439fd||0xcc;return function(_0x3b650d){if(_0x3b650d){return _0x708f84[_0x0904('0x18')](_0x5439fd);}return _0x708f84[_0x0904('0x19')](_0x5439fd)[_0x0904('0x1a')]();};}function respondWithResult(_0x53883f,_0x27485f){_0x27485f=_0x27485f||0xc8;return function(_0x3f1e17){if(_0x3f1e17){return _0x53883f[_0x0904('0x19')](_0x27485f)[_0x0904('0x1b')](_0x3f1e17);}};}function respondWithFilteredResult(_0x393e76,_0x1e15dc){return function(_0x586052){if(_0x586052){var _0x2d4ef4=typeof _0x1e15dc['offset']==='undefined'&&typeof _0x1e15dc[_0x0904('0x1c')]===_0x0904('0x1d');var _0x9f1e58=_0x586052[_0x0904('0x1e')];var _0x497ace=_0x2d4ef4?0x0:_0x1e15dc[_0x0904('0x1f')];var _0x3d6fef=_0x2d4ef4?_0x586052[_0x0904('0x1e')]:_0x1e15dc[_0x0904('0x1f')]+_0x1e15dc[_0x0904('0x1c')];var _0xa19f5b;if(_0x3d6fef>=_0x9f1e58){_0x3d6fef=_0x9f1e58;_0xa19f5b=0xc8;}else{_0xa19f5b=0xce;}_0x393e76['status'](_0xa19f5b);return _0x393e76['set']('Content-Range',_0x497ace+'-'+_0x3d6fef+'/'+_0x9f1e58)['json'](_0x586052);}return null;};}function patchUpdates(_0x4d3104){return function(_0x25dbc0){try{jsonpatch[_0x0904('0x20')](_0x25dbc0,_0x4d3104,!![]);}catch(_0x41c29f){return BPromise[_0x0904('0x21')](_0x41c29f);}return _0x25dbc0[_0x0904('0x22')]();};}function saveUpdates(_0x56339d,_0x460dbb){return function(_0x37cb82){if(_0x37cb82){return _0x37cb82[_0x0904('0x23')](_0x56339d)['then'](function(_0x1c367e){return _0x1c367e;});}return null;};}function removeEntity(_0x52acb5,_0x3fdbb0){return function(_0x5f08b9){if(_0x5f08b9){return _0x5f08b9[_0x0904('0x24')]()[_0x0904('0x25')](function(){var _0x2b0803=_0x5f08b9[_0x0904('0x26')]({'plain':!![]});var _0x4f806b=_0x0904('0x27');return db['UserProfileResource'][_0x0904('0x24')]({'where':{'type':_0x4f806b,'resourceId':_0x2b0803['id']}})[_0x0904('0x25')](function(){return _0x5f08b9;});})[_0x0904('0x25')](function(){_0x52acb5[_0x0904('0x19')](0xcc)[_0x0904('0x1a')]();});}};}function handleEntityNotFound(_0x34b21d,_0x3e5496){return function(_0x3ca075){if(!_0x3ca075){_0x34b21d[_0x0904('0x18')](0x194);}return _0x3ca075;};}function handleError(_0x33c7fb,_0x1d8826){_0x1d8826=_0x1d8826||0x1f4;return function(_0x4523e2){logger['error'](_0x4523e2['stack']);if(_0x4523e2[_0x0904('0x28')]){delete _0x4523e2[_0x0904('0x28')];}_0x33c7fb['status'](_0x1d8826)[_0x0904('0x29')](_0x4523e2);};}exports['index']=function(_0x21ea09,_0x295a1c){var _0x529bd2={},_0x38edb8={},_0x4a1efc={'count':0x0,'rows':[]};var _0x29acb4=_['map'](db[_0x0904('0x2a')][_0x0904('0x2b')],function(_0xe2665a){return{'name':_0xe2665a[_0x0904('0x2c')],'type':_0xe2665a['type'][_0x0904('0x2d')]};});_0x38edb8[_0x0904('0x2e')]=_[_0x0904('0x2f')](_0x29acb4,_0x0904('0x28'));_0x38edb8[_0x0904('0x30')]=_['keys'](_0x21ea09[_0x0904('0x30')]);_0x38edb8[_0x0904('0x31')]=_[_0x0904('0x32')](_0x38edb8[_0x0904('0x2e')],_0x38edb8[_0x0904('0x30')]);_0x529bd2[_0x0904('0x33')]=_['intersection'](_0x38edb8[_0x0904('0x2e')],qs[_0x0904('0x34')](_0x21ea09[_0x0904('0x30')]['fields']));_0x529bd2[_0x0904('0x33')]=_0x529bd2['attributes'][_0x0904('0x35')]?_0x529bd2[_0x0904('0x33')]:_0x38edb8[_0x0904('0x2e')];if(!_0x21ea09[_0x0904('0x30')][_0x0904('0x36')](_0x0904('0x37'))){_0x529bd2['limit']=qs[_0x0904('0x1c')](_0x21ea09[_0x0904('0x30')]['limit']);_0x529bd2[_0x0904('0x1f')]=qs[_0x0904('0x1f')](_0x21ea09[_0x0904('0x30')]['offset']);}_0x529bd2['order']=qs['sort'](_0x21ea09['query'][_0x0904('0x38')]);_0x529bd2[_0x0904('0x39')]=qs['filters'](_['pick'](_0x21ea09[_0x0904('0x30')],_0x38edb8[_0x0904('0x31')]),_0x29acb4);if(_0x21ea09[_0x0904('0x30')][_0x0904('0x3a')]){_0x529bd2[_0x0904('0x39')]=_[_0x0904('0x3b')](_0x529bd2[_0x0904('0x39')],{'$or':_[_0x0904('0x2f')](_0x29acb4,function(_0x180176){if(_0x180176[_0x0904('0x3c')]!==_0x0904('0x3d')){var _0x43d8b2={};_0x43d8b2[_0x180176[_0x0904('0x28')]]={'$like':'%'+_0x21ea09[_0x0904('0x30')][_0x0904('0x3a')]+'%'};return _0x43d8b2;}})});}_0x529bd2=_[_0x0904('0x3b')]({},_0x529bd2,_0x21ea09[_0x0904('0x3e')]);var _0x482f8b={'where':_0x529bd2['where']};return db[_0x0904('0x2a')][_0x0904('0x1e')](_0x482f8b)[_0x0904('0x25')](function(_0x438a64){_0x4a1efc[_0x0904('0x1e')]=_0x438a64;if(_0x21ea09[_0x0904('0x30')][_0x0904('0x3f')]){_0x529bd2[_0x0904('0x40')]=[{'all':!![]}];}return db[_0x0904('0x2a')][_0x0904('0x41')](_0x529bd2);})['then'](function(_0x535ca7){_0x4a1efc[_0x0904('0x42')]=_0x535ca7;return _0x4a1efc;})['then'](respondWithFilteredResult(_0x295a1c,_0x529bd2))[_0x0904('0x43')](handleError(_0x295a1c,null));};exports[_0x0904('0x44')]=function(_0x107360,_0x368203){var _0xea628e={'raw':![],'where':{'id':_0x107360[_0x0904('0x45')]['id']}},_0x31cdf5={};_0x31cdf5[_0x0904('0x2e')]=_[_0x0904('0x46')](db[_0x0904('0x2a')]['rawAttributes']);_0x31cdf5[_0x0904('0x30')]=_['keys'](_0x107360['query']);_0x31cdf5[_0x0904('0x31')]=_['intersection'](_0x31cdf5[_0x0904('0x2e')],_0x31cdf5[_0x0904('0x30')]);_0xea628e['attributes']=_[_0x0904('0x32')](_0x31cdf5['model'],qs[_0x0904('0x34')](_0x107360[_0x0904('0x30')][_0x0904('0x34')]));_0xea628e[_0x0904('0x33')]=_0xea628e['attributes'][_0x0904('0x35')]?_0xea628e['attributes']:_0x31cdf5['model'];if(_0x107360[_0x0904('0x30')][_0x0904('0x3f')]){_0xea628e[_0x0904('0x40')]=[{'all':!![]}];}_0xea628e=_[_0x0904('0x3b')]({},_0xea628e,_0x107360[_0x0904('0x3e')]);return db[_0x0904('0x2a')]['find'](_0xea628e)[_0x0904('0x25')](handleEntityNotFound(_0x368203,null))[_0x0904('0x25')](respondWithResult(_0x368203,null))[_0x0904('0x43')](handleError(_0x368203,null));};exports[_0x0904('0x47')]=function(_0x20ddd6,_0xd78064){return db['Schedule']['create'](_0x20ddd6[_0x0904('0x48')],{})[_0x0904('0x25')](function(_0x122b76){var _0x115a6b=_0x20ddd6[_0x0904('0x49')][_0x0904('0x26')]({'plain':!![]});if(!_0x115a6b)throw new Error(_0x0904('0x4a'));if(_0x115a6b[_0x0904('0x4b')]==='user'){var _0x381814=_0x122b76[_0x0904('0x26')]({'plain':!![]});var _0x245fa9='Scheduler';return db[_0x0904('0x4c')][_0x0904('0x4d')]({'where':{'name':_0x245fa9,'userProfileId':_0x115a6b[_0x0904('0x4e')]},'raw':!![]})[_0x0904('0x25')](function(_0x29c537){if(_0x29c537&&_0x29c537[_0x0904('0x4f')]===0x0){return db[_0x0904('0x50')][_0x0904('0x47')]({'name':_0x381814[_0x0904('0x28')],'resourceId':_0x381814['id'],'type':_0x29c537[_0x0904('0x28')],'sectionId':_0x29c537['id']},{})[_0x0904('0x25')](function(){return _0x122b76;});}else{return _0x122b76;}})['catch'](function(_0x1661b2){logger['error'](_0x0904('0x51'),_0x1661b2);throw _0x1661b2;});}return _0x122b76;})[_0x0904('0x25')](respondWithResult(_0xd78064,0xc9))[_0x0904('0x43')](handleError(_0xd78064,null));};exports[_0x0904('0x23')]=function(_0x5c9b6c,_0x11ee97){if(_0x5c9b6c[_0x0904('0x48')]['id']){delete _0x5c9b6c['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x5c9b6c['params']['id']}})[_0x0904('0x25')](handleEntityNotFound(_0x11ee97,null))['then'](saveUpdates(_0x5c9b6c[_0x0904('0x48')],null))[_0x0904('0x25')](respondWithResult(_0x11ee97,null))['catch'](handleError(_0x11ee97,null));};exports[_0x0904('0x24')]=function(_0x384649,_0x564568){return db[_0x0904('0x2a')]['find']({'where':{'id':_0x384649['params']['id']}})[_0x0904('0x25')](handleEntityNotFound(_0x564568,null))['then'](removeEntity(_0x564568,null))[_0x0904('0x43')](handleError(_0x564568,null));};exports[_0x0904('0x52')]=function(_0x5e64db,_0x59d45a,_0x109d35){var _0x5ad914=require('../../config/schedule');return db['Schedule'][_0x0904('0x4d')]({'where':{'id':_0x5e64db['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x59d45a,null))[_0x0904('0x25')](function(){_0x5ad914[_0x0904('0x52')](_0x5e64db['params']['id']);})[_0x0904('0x25')](respondWithStatusCode(_0x59d45a,null))['catch'](handleError(_0x59d45a,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 00b347d..43e33ce 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 _0x6353=['api','moment','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','../../config/logger'];(function(_0x4167ea,_0x3512d3){var _0x18d1cd=function(_0x465c2f){while(--_0x465c2f){_0x4167ea['push'](_0x4167ea['shift']());}};_0x18d1cd(++_0x3512d3);}(_0x6353,0x1ca));var _0x3635=function(_0x348d2e,_0x2b7b9b){_0x348d2e=_0x348d2e-0x0;var _0x143ca5=_0x6353[_0x348d2e];return _0x143ca5;};'use strict';var _=require(_0x3635('0x0'));var util=require('util');var logger=require(_0x3635('0x1'))(_0x3635('0x2'));var moment=require(_0x3635('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3635('0x4'));var config=require(_0x3635('0x5'));var attributes=require(_0x3635('0x6'));module[_0x3635('0x7')]=function(_0x5aa691,_0x4ce553){return _0x5aa691[_0x3635('0x8')](_0x3635('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x546a=['Schedule','tools_schedules','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0x455476,_0x86a60a){var _0x1a4e83=function(_0x400b4a){while(--_0x400b4a){_0x455476['push'](_0x455476['shift']());}};_0x1a4e83(++_0x86a60a);}(_0x546a,0x1c5));var _0xa546=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x546a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa546('0x0'));var util=require('util');var logger=require(_0xa546('0x1'))(_0xa546('0x2'));var moment=require('moment');var BPromise=require(_0xa546('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa546('0x4'));var rimraf=require(_0xa546('0x5'));var config=require(_0xa546('0x6'));var attributes=require(_0xa546('0x7'));module[_0xa546('0x8')]=function(_0x1150cb,_0x497af5){return _0x1150cb['define'](_0xa546('0x9'),attributes,{'tableName':_0xa546('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8b78a57..a4d834e 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 _0x6a1b=['rpc','../../config/environment','jayson/promise','then','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x5ee7a2,_0x1c67fd){var _0x21c6f4=function(_0x466f53){while(--_0x466f53){_0x5ee7a2['push'](_0x5ee7a2['shift']());}};_0x21c6f4(++_0x1c67fd);}(_0x6a1b,0x8b));var _0xb6a1=function(_0x28929b,_0x3d9263){_0x28929b=_0x28929b-0x0;var _0x52bbc3=_0x6a1b[_0x28929b];return _0x52bbc3;};'use strict';var _=require('lodash');var util=require(_0xb6a1('0x0'));var moment=require(_0xb6a1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6a1('0x2'));var db=require(_0xb6a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6a1('0x4'))(_0xb6a1('0x5'));var config=require(_0xb6a1('0x6'));var jayson=require(_0xb6a1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x153193,_0x5f4094,_0x3d7c38){return new BPromise(function(_0x56922f,_0x148971){return client['request'](_0x153193,_0x3d7c38)[_0xb6a1('0x8')](function(_0x133ae5){logger[_0xb6a1('0x9')](_0xb6a1('0xa'),_0x5f4094,'request\x20sent');logger['debug'](_0xb6a1('0xb'),_0x5f4094,_0xb6a1('0xc'),JSON['stringify'](_0x133ae5));if(_0x133ae5[_0xb6a1('0xd')]){if(_0x133ae5[_0xb6a1('0xd')][_0xb6a1('0xe')]===0x1f4){logger[_0xb6a1('0xd')]('Schedule,\x20%s,\x20%s',_0x5f4094,_0x133ae5['error'][_0xb6a1('0xf')]);return _0x148971(_0x133ae5[_0xb6a1('0xd')]['message']);}logger[_0xb6a1('0xd')](_0xb6a1('0xa'),_0x5f4094,_0x133ae5[_0xb6a1('0xd')][_0xb6a1('0xf')]);return _0x56922f(_0x133ae5[_0xb6a1('0xd')][_0xb6a1('0xf')]);}else{logger['info'](_0xb6a1('0xa'),_0x5f4094,'request\x20sent');_0x56922f(_0x133ae5[_0xb6a1('0x10')][_0xb6a1('0xf')]);}})[_0xb6a1('0x11')](function(_0x15e532){logger[_0xb6a1('0xd')](_0xb6a1('0xa'),_0x5f4094,_0x15e532);_0x148971(_0x15e532);});});} \ No newline at end of file +var _0xa7ff=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3779b5,_0x43880e){var _0x37e14a=function(_0x5c8a02){while(--_0x5c8a02){_0x3779b5['push'](_0x3779b5['shift']());}};_0x37e14a(++_0x43880e);}(_0xa7ff,0xdc));var _0xfa7f=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xa7ff[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require('lodash');var util=require(_0xfa7f('0x0'));var moment=require(_0xfa7f('0x1'));var BPromise=require(_0xfa7f('0x2'));var rs=require(_0xfa7f('0x3'));var fs=require('fs');var Redis=require(_0xfa7f('0x4'));var db=require(_0xfa7f('0x5'))['db'];var utils=require(_0xfa7f('0x6'));var logger=require(_0xfa7f('0x7'))(_0xfa7f('0x8'));var config=require(_0xfa7f('0x9'));var jayson=require(_0xfa7f('0xa'));var client=jayson[_0xfa7f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47ce17,_0x451071,_0x58456c){return new BPromise(function(_0x4fc98d,_0x50ef43){return client[_0xfa7f('0xc')](_0x47ce17,_0x58456c)['then'](function(_0x40e7d6){logger[_0xfa7f('0xd')](_0xfa7f('0xe'),_0x451071,_0xfa7f('0xf'));logger[_0xfa7f('0x10')](_0xfa7f('0x11'),_0x451071,'request\x20sent',JSON[_0xfa7f('0x12')](_0x40e7d6));if(_0x40e7d6['error']){if(_0x40e7d6[_0xfa7f('0x13')][_0xfa7f('0x14')]===0x1f4){logger[_0xfa7f('0x13')]('Schedule,\x20%s,\x20%s',_0x451071,_0x40e7d6[_0xfa7f('0x13')][_0xfa7f('0x15')]);return _0x50ef43(_0x40e7d6[_0xfa7f('0x13')][_0xfa7f('0x15')]);}logger[_0xfa7f('0x13')](_0xfa7f('0xe'),_0x451071,_0x40e7d6[_0xfa7f('0x13')]['message']);return _0x4fc98d(_0x40e7d6['error'][_0xfa7f('0x15')]);}else{logger[_0xfa7f('0xd')](_0xfa7f('0xe'),_0x451071,'request\x20sent');_0x4fc98d(_0x40e7d6[_0xfa7f('0x16')]['message']);}})[_0xfa7f('0x17')](function(_0x1bd4de){logger['error'](_0xfa7f('0xe'),_0x451071,_0x1bd4de);_0x50ef43(_0x1bd4de);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 5916479..07eff8c 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 _0x4157=['get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller'];(function(_0x23f5df,_0x374360){var _0xe2c833=function(_0x26a4ca){while(--_0x26a4ca){_0x23f5df['push'](_0x23f5df['shift']());}};_0xe2c833(++_0x374360);}(_0x4157,0xf3));var _0x7415=function(_0x18fc1d,_0xd08cdb){_0x18fc1d=_0x18fc1d-0x0;var _0x2a3cd1=_0x4157[_0x18fc1d];return _0x2a3cd1;};'use strict';var multer=require(_0x7415('0x0'));var util=require(_0x7415('0x1'));var path=require(_0x7415('0x2'));var timeout=require(_0x7415('0x3'));var express=require(_0x7415('0x4'));var router=express['Router']();var fs_extra=require(_0x7415('0x5'));var auth=require(_0x7415('0x6'));var interaction=require(_0x7415('0x7'));var config=require(_0x7415('0x8'));var controller=require(_0x7415('0x9'));router[_0x7415('0xa')]('/',auth[_0x7415('0xb')](),controller[_0x7415('0xc')]);router[_0x7415('0xa')]('/describe',auth[_0x7415('0xb')](),controller['describe']);router[_0x7415('0xa')]('/:id',auth[_0x7415('0xb')](),controller[_0x7415('0xd')]);router[_0x7415('0xa')](_0x7415('0xe'),auth[_0x7415('0xb')](),controller[_0x7415('0xf')]);router[_0x7415('0x10')]('/',auth['isAuthenticated'](),controller[_0x7415('0x11')]);router[_0x7415('0x12')](_0x7415('0x13'),auth[_0x7415('0xb')](),controller[_0x7415('0x14')]);router['delete'](_0x7415('0x13'),auth[_0x7415('0xb')](),controller[_0x7415('0x15')]);module[_0x7415('0x16')]=router; \ No newline at end of file +var _0x61a3=['index','/describe','describe','get','/:id/download','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x61a3,0x1ef));var _0x361a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x61a3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x361a('0x0'));var util=require(_0x361a('0x1'));var path=require(_0x361a('0x2'));var timeout=require('connect-timeout');var express=require(_0x361a('0x3'));var router=express[_0x361a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x361a('0x5'));var interaction=require(_0x361a('0x6'));var config=require(_0x361a('0x7'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x361a('0x8')](),controller[_0x361a('0x9')]);router['get'](_0x361a('0xa'),auth[_0x361a('0x8')](),controller[_0x361a('0xb')]);router[_0x361a('0xc')]('/:id',auth[_0x361a('0x8')](),controller['show']);router['get'](_0x361a('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x361a('0xe')]('/',auth[_0x361a('0x8')](),controller[_0x361a('0xf')]);router[_0x361a('0x10')](_0x361a('0x11'),auth[_0x361a('0x8')](),controller['update']);router[_0x361a('0x12')](_0x361a('0x11'),auth[_0x361a('0x8')](),controller[_0x361a('0x13')]);module[_0x361a('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index cb303a4..3453927 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 _0x3d04=['sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','closedAt','toString','createdAt'];(function(_0x252552,_0xb9b027){var _0x49eedc=function(_0x5830fe){while(--_0x5830fe){_0x252552['push'](_0x252552['shift']());}};_0x49eedc(++_0xb9b027);}(_0x3d04,0xbe));var _0x43d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d04[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x43d0('0x0'));var moment=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var config=require(_0x43d0('0x3'));module[_0x43d0('0x4')]={'format':{'type':Sequelize[_0x43d0('0x5')],'get':function(){return this[_0x43d0('0x6')](_0x43d0('0x7'))?path['extname'](this[_0x43d0('0x6')](_0x43d0('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x43d0('0x8')]},'channel':{'type':Sequelize[_0x43d0('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x484271){var _0x50919e=_0x484271['replace'](/\\/g,'/');this[_0x43d0('0x9')](_0x43d0('0x7'),_0x50919e);}},'rating':{'type':Sequelize[_0x43d0('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x43d0('0xa')],'set':function(_0x44a763){this['setDataValue']('startedAt',moment()[_0x43d0('0xb')](_0x44a763,'ms'));this['setDataValue']('closedAt',moment());this[_0x43d0('0x9')](_0x43d0('0xc'),_0x44a763);}},'startedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this[_0x43d0('0x6')]('startedAt'))[_0x43d0('0xe')](_0x43d0('0xf'))['toString']();}},'closedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this[_0x43d0('0x6')](_0x43d0('0x10')))['format'](_0x43d0('0xf'))[_0x43d0('0x11')]();}},'createdAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this['getDataValue'](_0x43d0('0x12')))[_0x43d0('0xe')](_0x43d0('0xf'))[_0x43d0('0x11')]();}},'updatedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x43d0('0xe')](_0x43d0('0xf'))[_0x43d0('0x11')]();}}}; \ No newline at end of file +var _0x1a37=['STRING','replace','setDataValue','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname'];(function(_0x344a65,_0x3c5ffe){var _0x27660d=function(_0x1a1908){while(--_0x1a1908){_0x344a65['push'](_0x344a65['shift']());}};_0x27660d(++_0x3c5ffe);}(_0x1a37,0xb4));var _0x71a3=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x1a37[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require(_0x71a3('0x0'));var moment=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var config=require(_0x71a3('0x3'));module[_0x71a3('0x4')]={'format':{'type':Sequelize[_0x71a3('0x5')],'get':function(){return this[_0x71a3('0x6')](_0x71a3('0x7'))?path[_0x71a3('0x8')](this[_0x71a3('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x71a3('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x71a3('0x9')],'set':function(_0x45050a){var _0x231ea7=_0x45050a[_0x71a3('0xa')](/\\/g,'/');this['setDataValue']('value',_0x231ea7);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x89da86){this[_0x71a3('0xb')](_0x71a3('0xc'),moment()[_0x71a3('0xd')](_0x89da86,'ms'));this[_0x71a3('0xb')](_0x71a3('0xe'),moment());this[_0x71a3('0xb')](_0x71a3('0xf'),_0x89da86);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}},'closedAt':{'type':Sequelize[_0x71a3('0x13')],'get':function(){return moment(this[_0x71a3('0x6')](_0x71a3('0xe')))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}},'createdAt':{'type':Sequelize[_0x71a3('0x13')],'get':function(){return moment(this[_0x71a3('0x6')]('createdAt'))[_0x71a3('0x10')](_0x71a3('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x71a3('0x6')](_0x71a3('0x14')))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 7590978..8a459da 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 _0xa630=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','intersection','fields','attributes','length','order','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','createdAt','value','describe','../../components/encryptor','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','ScreenRecording\x20not\x20found','filename','extname','download','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa630,0xbe));var _0x0a63=function(_0xbefc0,_0x20e1c7){_0xbefc0=_0xbefc0-0x0;var _0x788fb5=_0xa630[_0xbefc0];return _0x788fb5;};'use strict';var emlformat=require(_0x0a63('0x0'));var rimraf=require(_0x0a63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a63('0x2'));var moment=require('moment');var BPromise=require(_0x0a63('0x3'));var Mustache=require('mustache');var util=require(_0x0a63('0x4'));var path=require(_0x0a63('0x5'));var sox=require(_0x0a63('0x6'));var csv=require(_0x0a63('0x7'));var ejs=require(_0x0a63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x7'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var Redis=require(_0x0a63('0xf'));var authService=require(_0x0a63('0x10'));var qs=require(_0x0a63('0x11'));var as=require(_0x0a63('0x12'));var hardwareService=require(_0x0a63('0x13'));var logger=require(_0x0a63('0x14'))(_0x0a63('0x15'));var utils=require(_0x0a63('0x16'));var config=require(_0x0a63('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a63('0x18'))['db'];function respondWithStatusCode(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xcc;return function(_0x3d6323){if(_0x3d6323){return _0x420043['sendStatus'](_0x2fce86);}return _0x420043[_0x0a63('0x19')](_0x2fce86)['end']();};}function respondWithResult(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0xc8;return function(_0x26b2bc){if(_0x26b2bc){return _0x331e99[_0x0a63('0x19')](_0x19e922)[_0x0a63('0x1a')](_0x26b2bc);}};}function respondWithFilteredResult(_0x23b49d,_0x552b1f){return function(_0x1e3251){if(_0x1e3251){var _0x524a98=typeof _0x552b1f[_0x0a63('0x1b')]==='undefined'&&typeof _0x552b1f[_0x0a63('0x1c')]===_0x0a63('0x1d');var _0x36a9e8=_0x1e3251[_0x0a63('0x1e')];var _0x1f7481=_0x524a98?0x0:_0x552b1f[_0x0a63('0x1b')];var _0x30f292=_0x524a98?_0x1e3251[_0x0a63('0x1e')]:_0x552b1f[_0x0a63('0x1b')]+_0x552b1f[_0x0a63('0x1c')];var _0x2ad167;if(_0x30f292>=_0x36a9e8){_0x30f292=_0x36a9e8;_0x2ad167=0xc8;}else{_0x2ad167=0xce;}_0x23b49d['status'](_0x2ad167);return _0x23b49d['set'](_0x0a63('0x1f'),_0x1f7481+'-'+_0x30f292+'/'+_0x36a9e8)['json'](_0x1e3251);}return null;};}function patchUpdates(_0x2fc87c){return function(_0x5937df){try{jsonpatch[_0x0a63('0x20')](_0x5937df,_0x2fc87c,!![]);}catch(_0x41d6b8){return BPromise[_0x0a63('0x21')](_0x41d6b8);}return _0x5937df[_0x0a63('0x22')]();};}function saveUpdates(_0x5da46b,_0x398a16){return function(_0x4c225a){if(_0x4c225a){return _0x4c225a[_0x0a63('0x23')](_0x5da46b)[_0x0a63('0x24')](function(_0x1bf64a){return _0x1bf64a;});}return null;};}function removeEntity(_0x20c114,_0x343273){return function(_0x1f929f){if(_0x1f929f){return _0x1f929f[_0x0a63('0x25')]()[_0x0a63('0x24')](function(){_0x20c114['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fb70,_0x4c8637){return function(_0xeacfc9){if(!_0xeacfc9){_0x55fb70['sendStatus'](0x194);}return _0xeacfc9;};}function handleError(_0x496c93,_0x2133cf){_0x2133cf=_0x2133cf||0x1f4;return function(_0x1d5448){logger[_0x0a63('0x26')](_0x1d5448[_0x0a63('0x27')]);if(_0x1d5448['name']){delete _0x1d5448[_0x0a63('0x28')];}_0x496c93[_0x0a63('0x19')](_0x2133cf)[_0x0a63('0x29')](_0x1d5448);};}exports['index']=function(_0x34239b,_0xcf409){var _0x1b7bdb={},_0x145090={},_0x32a52b={'count':0x0,'rows':[]};var _0x4577b6=_[_0x0a63('0x2a')](db[_0x0a63('0x2b')]['rawAttributes'],function(_0x58cc71){return{'name':_0x58cc71['fieldName'],'type':_0x58cc71[_0x0a63('0x2c')][_0x0a63('0x2d')]};});_0x145090[_0x0a63('0x2e')]=_[_0x0a63('0x2f')](_[_0x0a63('0x2a')](_0x4577b6,'name'),[_0x0a63('0x30')]);_0x145090[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x34239b[_0x0a63('0x31')]);_0x145090['filters']=_[_0x0a63('0x33')](_0x145090[_0x0a63('0x2e')],_0x145090['query']);_0x1b7bdb['attributes']=_[_0x0a63('0x33')](_0x145090['model'],qs['fields'](_0x34239b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x1b7bdb['attributes']=_0x1b7bdb[_0x0a63('0x35')][_0x0a63('0x36')]?_0x1b7bdb[_0x0a63('0x35')]:_0x145090[_0x0a63('0x2e')];if(!_0x34239b[_0x0a63('0x31')]['hasOwnProperty']('nolimit')){_0x1b7bdb[_0x0a63('0x1c')]=qs[_0x0a63('0x1c')](_0x34239b[_0x0a63('0x31')][_0x0a63('0x1c')]);_0x1b7bdb[_0x0a63('0x1b')]=qs[_0x0a63('0x1b')](_0x34239b['query'][_0x0a63('0x1b')]);}_0x1b7bdb[_0x0a63('0x37')]=qs['sort'](_0x34239b[_0x0a63('0x31')]['sort']);_0x1b7bdb['where']=qs[_0x0a63('0x38')](_[_0x0a63('0x39')](_0x34239b[_0x0a63('0x31')],_0x145090['filters']),_0x4577b6);if(_0x34239b[_0x0a63('0x31')][_0x0a63('0x3a')]){_0x1b7bdb[_0x0a63('0x3b')]=_[_0x0a63('0x3c')](_0x1b7bdb[_0x0a63('0x3b')],{'$or':_[_0x0a63('0x2a')](_0x4577b6,function(_0x604a45){if(_0x604a45['type']!==_0x0a63('0x3d')){var _0x1c7e67={};_0x1c7e67[_0x604a45[_0x0a63('0x28')]]={'$like':'%'+_0x34239b['query']['filter']+'%'};return _0x1c7e67;}})});}_0x1b7bdb=_[_0x0a63('0x3c')]({},_0x1b7bdb,_0x34239b['options']);var _0x1a01f4={'where':_0x1b7bdb[_0x0a63('0x3b')]};return db[_0x0a63('0x2b')]['count'](_0x1a01f4)[_0x0a63('0x24')](function(_0x14c737){_0x32a52b[_0x0a63('0x1e')]=_0x14c737;if(_0x34239b[_0x0a63('0x31')]['includeAll']){_0x1b7bdb[_0x0a63('0x3e')]=[{'all':!![]}];}return db[_0x0a63('0x2b')][_0x0a63('0x3f')](_0x1b7bdb);})[_0x0a63('0x24')](function(_0xf18ace){_0x32a52b[_0x0a63('0x40')]=_0xf18ace;return _0x32a52b;})['then'](respondWithFilteredResult(_0xcf409,_0x1b7bdb))[_0x0a63('0x41')](handleError(_0xcf409,null));};exports[_0x0a63('0x42')]=function(_0x347a0b,_0x793502){var _0x20fa0d={'raw':![],'where':{'id':_0x347a0b[_0x0a63('0x43')]['id']}},_0x2482ca={};_0x2482ca[_0x0a63('0x2e')]=_[_0x0a63('0x32')](db[_0x0a63('0x2b')][_0x0a63('0x44')]);_0x2482ca[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x347a0b[_0x0a63('0x31')]);_0x2482ca[_0x0a63('0x38')]=_[_0x0a63('0x33')](_0x2482ca[_0x0a63('0x2e')],_0x2482ca[_0x0a63('0x31')]);_0x20fa0d['attributes']=_[_0x0a63('0x33')](_0x2482ca['model'],qs['fields'](_0x347a0b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x20fa0d[_0x0a63('0x35')]=_0x20fa0d[_0x0a63('0x35')][_0x0a63('0x36')]?_0x20fa0d[_0x0a63('0x35')]:_0x2482ca[_0x0a63('0x2e')];if(_0x347a0b[_0x0a63('0x31')][_0x0a63('0x45')]){_0x20fa0d[_0x0a63('0x3e')]=[{'all':!![]}];}_0x20fa0d=_[_0x0a63('0x3c')]({},_0x20fa0d,_0x347a0b[_0x0a63('0x46')]);return db[_0x0a63('0x2b')][_0x0a63('0x47')](_0x20fa0d)[_0x0a63('0x24')](handleEntityNotFound(_0x793502,null))[_0x0a63('0x24')](respondWithResult(_0x793502,null))[_0x0a63('0x41')](handleError(_0x793502,null));};exports[_0x0a63('0x48')]=function(_0x366887,_0x148e0a){return db['ScreenRecording'][_0x0a63('0x48')](_0x366887[_0x0a63('0x49')],{})['then'](respondWithResult(_0x148e0a,0xc9))['catch'](handleError(_0x148e0a,null));};exports['update']=function(_0x485f20,_0x36d066){if(_0x485f20[_0x0a63('0x49')]['id']){delete _0x485f20['body']['id'];}delete _0x485f20[_0x0a63('0x49')]['duration'];delete _0x485f20[_0x0a63('0x49')][_0x0a63('0x4a')];delete _0x485f20['body']['closedAt'];delete _0x485f20['body'][_0x0a63('0x4b')];return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':{'id':_0x485f20[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](handleEntityNotFound(_0x36d066,null))['then'](saveUpdates(_0x485f20[_0x0a63('0x49')],null))[_0x0a63('0x24')](respondWithResult(_0x36d066,null))[_0x0a63('0x41')](handleError(_0x36d066,null));};exports[_0x0a63('0x4c')]=function(_0x3575ae,_0x4a5b6e){return db[_0x0a63('0x2b')][_0x0a63('0x4c')]()[_0x0a63('0x24')](respondWithResult(_0x4a5b6e,null))[_0x0a63('0x41')](handleError(_0x4a5b6e,null));};exports['download']=function(_0x35b688,_0x3bd10c,_0x337bef){var _0x330550=require(_0x0a63('0x4d'));var _0x258ed3=![];var _0x4d4e20={};if(_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]&&_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]==='uniqueid'){_0x4d4e20['uniqueid']=_0x35b688[_0x0a63('0x43')]['id'];}else{_0x4d4e20['id']=_0x35b688[_0x0a63('0x43')]['id'];}return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':_0x4d4e20,'attributes':['id',_0x0a63('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3bd10c,null))['then'](function(_0x58b3a8){if(_0x58b3a8){var _0x42c1bb=path['join'](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x58b3a8[_0x0a63('0x4b')]);var _0x5d77e3=util['format'](_0x0a63('0x50'),_0x42c1bb);if(fs[_0x0a63('0x51')](_0x5d77e3)){_0x258ed3=!![];return _0x330550[_0x0a63('0x52')](_0x5d77e3,_0x42c1bb,config[_0x0a63('0x53')][_0x0a63('0x54')])[_0x0a63('0x24')](function(){return _0x58b3a8;});}return _0x58b3a8;}})[_0x0a63('0x24')](function(_0xc3415c){if(_0xc3415c){var _0xe454ef=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0xc3415c[_0x0a63('0x4b')]);if(!fs[_0x0a63('0x51')](_0xe454ef)){throw new db['Sequelize']['ValidationError'](_0x0a63('0x56'));}if(_0xc3415c[_0x0a63('0x57')]){return _0x3bd10c['download'](_0xe454ef,_0xc3415c[_0x0a63('0x57')]+path[_0x0a63('0x58')](_0xe454ef),function(){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}else{return _0x3bd10c[_0x0a63('0x59')](_0xe454ef,function(_0x3053e4){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}}})['catch'](function(_0x3b395a){if(_0x3b395a[_0x0a63('0x5a')]===_0x0a63('0x56')){_0x3bd10c['status'](0x194)[_0x0a63('0x29')](_0x0a63('0x5b'));}else{return handleError(_0x3bd10c,null);}});};exports[_0x0a63('0x25')]=function(_0x284dca,_0x15fc2e){return db['ScreenRecording'][_0x0a63('0x47')]({'where':{'id':_0x284dca[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](function(_0x1fa9cd){if(_[_0x0a63('0x5c')](_0x1fa9cd)){throw new ReferenceError(_0x0a63('0x5d'));}return _0x1fa9cd;})[_0x0a63('0x24')](function(_0x57313b){var _0x4571e7=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x57313b[_0x0a63('0x4b')]);logger[_0x0a63('0x5e')](_0x0a63('0x5f'),_0x4571e7);if(!_[_0x0a63('0x5c')](_0x57313b['value'])&&fs['existsSync'](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}_0x4571e7=_0x4571e7+_0x0a63('0x63');if(!_['isNil'](_0x57313b[_0x0a63('0x4b')])&&fs[_0x0a63('0x51')](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}return _0x57313b;})[_0x0a63('0x24')](function(_0xe52dfd){if(!_0xe52dfd)throw new InternalError();return _0xe52dfd[_0x0a63('0x25')]();})[_0x0a63('0x24')](function(){_0x15fc2e[_0x0a63('0x19')](0xcc)['end']();})[_0x0a63('0x41')](handleError(_0x15fc2e,null));}; \ No newline at end of file +var _0x46ed=['intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','params','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','filters'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x46ed,0x168));var _0xd46e=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x46ed[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){_0x33c2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371054,_0x2a5271){return function(_0x21135f){if(!_0x21135f){_0x371054[_0xd46e('0x1a')](0x194);}return _0x21135f;};}function handleError(_0x247b9f,_0x180851){_0x180851=_0x180851||0x1f4;return function(_0x1740d1){logger['error'](_0x1740d1[_0xd46e('0x26')]);if(_0x1740d1[_0xd46e('0x27')]){delete _0x1740d1[_0xd46e('0x27')];}_0x247b9f[_0xd46e('0x1b')](_0x180851)[_0xd46e('0x28')](_0x1740d1);};}exports[_0xd46e('0x29')]=function(_0x58aeef,_0x465d54){var _0x3a1ced={},_0x2d1afe={},_0xa716ce={'count':0x0,'rows':[]};var _0x106edc=_[_0xd46e('0x2a')](db[_0xd46e('0x2b')][_0xd46e('0x2c')],function(_0x18f060){return{'name':_0x18f060[_0xd46e('0x2d')],'type':_0x18f060[_0xd46e('0x2e')][_0xd46e('0x2f')]};});_0x2d1afe[_0xd46e('0x30')]=_['differenceBy'](_[_0xd46e('0x2a')](_0x106edc,_0xd46e('0x27')),[_0xd46e('0x31')]);_0x2d1afe[_0xd46e('0x32')]=_['keys'](_0x58aeef[_0xd46e('0x32')]);_0x2d1afe[_0xd46e('0x33')]=_['intersection'](_0x2d1afe[_0xd46e('0x30')],_0x2d1afe[_0xd46e('0x32')]);_0x3a1ced['attributes']=_[_0xd46e('0x34')](_0x2d1afe[_0xd46e('0x30')],qs[_0xd46e('0x35')](_0x58aeef['query']['fields']));_0x3a1ced[_0xd46e('0x36')]=_0x3a1ced[_0xd46e('0x36')][_0xd46e('0x37')]?_0x3a1ced[_0xd46e('0x36')]:_0x2d1afe[_0xd46e('0x30')];if(!_0x58aeef[_0xd46e('0x32')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x3a1ced['limit']=qs[_0xd46e('0x1d')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1d')]);_0x3a1ced[_0xd46e('0x1c')]=qs[_0xd46e('0x1c')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1c')]);}_0x3a1ced['order']=qs[_0xd46e('0x3a')](_0x58aeef[_0xd46e('0x32')]['sort']);_0x3a1ced[_0xd46e('0x3b')]=qs[_0xd46e('0x33')](_[_0xd46e('0x3c')](_0x58aeef[_0xd46e('0x32')],_0x2d1afe['filters']),_0x106edc);if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]){_0x3a1ced[_0xd46e('0x3b')]=_[_0xd46e('0x3e')](_0x3a1ced[_0xd46e('0x3b')],{'$or':_[_0xd46e('0x2a')](_0x106edc,function(_0x220c57){if(_0x220c57[_0xd46e('0x2e')]!=='VIRTUAL'){var _0x232e6f={};_0x232e6f[_0x220c57[_0xd46e('0x27')]]={'$like':'%'+_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]+'%'};return _0x232e6f;}})});}_0x3a1ced=_[_0xd46e('0x3e')]({},_0x3a1ced,_0x58aeef['options']);var _0x964c66={'where':_0x3a1ced['where']};return db['ScreenRecording']['count'](_0x964c66)['then'](function(_0x17c3d9){_0xa716ce['count']=_0x17c3d9;if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x3a1ced['include']=[{'all':!![]}];}return db[_0xd46e('0x2b')][_0xd46e('0x40')](_0x3a1ced);})[_0xd46e('0x25')](function(_0x31ba12){_0xa716ce[_0xd46e('0x41')]=_0x31ba12;return _0xa716ce;})[_0xd46e('0x25')](respondWithFilteredResult(_0x465d54,_0x3a1ced))[_0xd46e('0x42')](handleError(_0x465d54,null));};exports[_0xd46e('0x43')]=function(_0x3a98e4,_0xec367d){var _0x259e2={'raw':![],'where':{'id':_0x3a98e4['params']['id']}},_0x5ea048={};_0x5ea048['model']=_[_0xd46e('0x44')](db['ScreenRecording'][_0xd46e('0x2c')]);_0x5ea048[_0xd46e('0x32')]=_[_0xd46e('0x44')](_0x3a98e4[_0xd46e('0x32')]);_0x5ea048[_0xd46e('0x33')]=_[_0xd46e('0x34')](_0x5ea048[_0xd46e('0x30')],_0x5ea048[_0xd46e('0x32')]);_0x259e2['attributes']=_[_0xd46e('0x34')](_0x5ea048['model'],qs[_0xd46e('0x35')](_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x35')]));_0x259e2[_0xd46e('0x36')]=_0x259e2[_0xd46e('0x36')]['length']?_0x259e2[_0xd46e('0x36')]:_0x5ea048[_0xd46e('0x30')];if(_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x259e2[_0xd46e('0x45')]=[{'all':!![]}];}_0x259e2=_['merge']({},_0x259e2,_0x3a98e4[_0xd46e('0x46')]);return db[_0xd46e('0x2b')][_0xd46e('0x47')](_0x259e2)[_0xd46e('0x25')](handleEntityNotFound(_0xec367d,null))[_0xd46e('0x25')](respondWithResult(_0xec367d,null))['catch'](handleError(_0xec367d,null));};exports[_0xd46e('0x48')]=function(_0x3ea9e6,_0x45baf1){return db[_0xd46e('0x2b')][_0xd46e('0x48')](_0x3ea9e6[_0xd46e('0x49')],{})[_0xd46e('0x25')](respondWithResult(_0x45baf1,0xc9))[_0xd46e('0x42')](handleError(_0x45baf1,null));};exports['update']=function(_0xf9dab,_0x71a8dc){if(_0xf9dab[_0xd46e('0x49')]['id']){delete _0xf9dab[_0xd46e('0x49')]['id'];}delete _0xf9dab[_0xd46e('0x49')]['duration'];delete _0xf9dab['body'][_0xd46e('0x4a')];delete _0xf9dab[_0xd46e('0x49')][_0xd46e('0x4b')];delete _0xf9dab['body']['value'];return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0xf9dab['params']['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x71a8dc,null))[_0xd46e('0x25')](saveUpdates(_0xf9dab[_0xd46e('0x49')],null))[_0xd46e('0x25')](respondWithResult(_0x71a8dc,null))[_0xd46e('0x42')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x4c')]=function(_0x80ed51,_0x16ca0e){return db['ScreenRecording'][_0xd46e('0x4c')]()[_0xd46e('0x25')](respondWithResult(_0x16ca0e,null))[_0xd46e('0x42')](handleError(_0x16ca0e,null));};exports[_0xd46e('0x4d')]=function(_0x4ec295,_0x56dd9a,_0xced102){var _0x5a4a44=require(_0xd46e('0x4e'));var _0x2af20b=![];var _0x393cb9={};if(_0x4ec295[_0xd46e('0x32')][_0xd46e('0x2e')]&&_0x4ec295[_0xd46e('0x32')]['type']===_0xd46e('0x4f')){_0x393cb9[_0xd46e('0x4f')]=_0x4ec295[_0xd46e('0x50')]['id'];}else{_0x393cb9['id']=_0x4ec295['params']['id'];}return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':_0x393cb9,'attributes':['id',_0xd46e('0x51')],'raw':!![]})[_0xd46e('0x25')](handleEntityNotFound(_0x56dd9a,null))[_0xd46e('0x25')](function(_0x2cc676){if(_0x2cc676){var _0x2760ef=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x2cc676[_0xd46e('0x51')]);var _0x411b19=util[_0xd46e('0x31')](_0xd46e('0x55'),_0x2760ef);if(fs['existsSync'](_0x411b19)){_0x2af20b=!![];return _0x5a4a44[_0xd46e('0x56')](_0x411b19,_0x2760ef,config[_0xd46e('0x57')][_0xd46e('0x58')])[_0xd46e('0x25')](function(){return _0x2cc676;});}return _0x2cc676;}})['then'](function(_0x636f15){if(_0x636f15){var _0x36e18a=path[_0xd46e('0x52')](config[_0xd46e('0x53')],'server/files/screen_recordings',_0x636f15[_0xd46e('0x51')]);if(!fs[_0xd46e('0x59')](_0x36e18a)){throw new db['Sequelize']['ValidationError'](_0xd46e('0x5a'));}if(_0x636f15[_0xd46e('0x5b')]){return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,_0x636f15['filename']+path['extname'](_0x36e18a),function(){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}else{return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,function(_0x1f310d){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}}})[_0xd46e('0x42')](function(_0x2f9fcb){if(_0x2f9fcb[_0xd46e('0x5d')]===_0xd46e('0x5a')){_0x56dd9a[_0xd46e('0x1b')](0x194)[_0xd46e('0x28')](_0xd46e('0x5e'));}else{return handleError(_0x56dd9a,null);}});};exports[_0xd46e('0x5f')]=function(_0x272514,_0x329204){return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0x272514['params']['id']}})[_0xd46e('0x25')](function(_0x1a3771){if(_[_0xd46e('0x60')](_0x1a3771)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1a3771;})[_0xd46e('0x25')](function(_0x313c7e){var _0x4dec29=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x313c7e['value']);logger[_0xd46e('0x61')](_0xd46e('0x62'),_0x4dec29);if(!_[_0xd46e('0x60')](_0x313c7e['value'])&&fs[_0xd46e('0x59')](_0x4dec29)){logger['info'](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}_0x4dec29=_0x4dec29+'.cypher';if(!_[_0xd46e('0x60')](_0x313c7e[_0xd46e('0x51')])&&fs[_0xd46e('0x59')](_0x4dec29)){logger[_0xd46e('0x61')](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}return _0x313c7e;})[_0xd46e('0x25')](function(_0x300ee9){if(!_0x300ee9)throw new InternalError();return _0x300ee9[_0xd46e('0x5f')]();})[_0xd46e('0x25')](function(){_0x329204[_0xd46e('0x1b')](0xcc)[_0xd46e('0x66')]();})[_0xd46e('0x42')](handleError(_0x329204,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index d192ad9..51096b6 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 _0xc84a=['define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','request-promise','path','../../config/environment','./screenRecording.attributes','exports'];(function(_0x717b8c,_0xf08d2c){var _0x672b94=function(_0x210f82){while(--_0x210f82){_0x717b8c['push'](_0x717b8c['shift']());}};_0x672b94(++_0xf08d2c);}(_0xc84a,0x93));var _0xac84=function(_0x5ef742,_0x4c1913){_0x5ef742=_0x5ef742-0x0;var _0x1f9754=_0xc84a[_0x5ef742];return _0x1f9754;};'use strict';var _=require(_0xac84('0x0'));var util=require(_0xac84('0x1'));var logger=require('../../config/logger')(_0xac84('0x2'));var moment=require(_0xac84('0x3'));var BPromise=require('bluebird');var rp=require(_0xac84('0x4'));var fs=require('fs');var path=require(_0xac84('0x5'));var rimraf=require('rimraf');var config=require(_0xac84('0x6'));var attributes=require(_0xac84('0x7'));module[_0xac84('0x8')]=function(_0x4b33c0,_0x275e32){return _0x4b33c0[_0xac84('0x9')](_0xac84('0xa'),attributes,{'tableName':_0xac84('0xb'),'paranoid':![],'indexes':[{'name':_0xac84('0xc'),'fields':[_0xac84('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88af=['exports','define','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x5da91a,_0x43c1d6){var _0x4c8228=function(_0x5ef49a){while(--_0x5ef49a){_0x5da91a['push'](_0x5da91a['shift']());}};_0x4c8228(++_0x43c1d6);}(_0x88af,0x1ee));var _0xf88a=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x88af[_0x2d61ac];return _0x3f7d3c;};'use strict';var _=require(_0xf88a('0x0'));var util=require(_0xf88a('0x1'));var logger=require(_0xf88a('0x2'))(_0xf88a('0x3'));var moment=require(_0xf88a('0x4'));var BPromise=require(_0xf88a('0x5'));var rp=require(_0xf88a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf88a('0x7'));var config=require(_0xf88a('0x8'));var attributes=require(_0xf88a('0x9'));module[_0xf88a('0xa')]=function(_0x432751,_0x3165f1){return _0x432751[_0xf88a('0xb')]('ScreenRecording',attributes,{'tableName':_0xf88a('0xc'),'paranoid':![],'indexes':[{'name':_0xf88a('0xd'),'fields':[_0xf88a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 132c292..5468251 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 _0xb08c=['../../config/logger','rpc','jayson/promise','http','request','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x48a2ca,_0x108524){var _0x18f879=function(_0x34fbbf){while(--_0x34fbbf){_0x48a2ca['push'](_0x48a2ca['shift']());}};_0x18f879(++_0x108524);}(_0xb08c,0x1c2));var _0xcb08=function(_0x281f28,_0x2c290b){_0x281f28=_0x281f28-0x0;var _0x29fb1e=_0xb08c[_0x281f28];return _0x29fb1e;};'use strict';var _=require(_0xcb08('0x0'));var util=require(_0xcb08('0x1'));var moment=require(_0xcb08('0x2'));var BPromise=require(_0xcb08('0x3'));var rs=require(_0xcb08('0x4'));var fs=require('fs');var Redis=require(_0xcb08('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb08('0x6'))(_0xcb08('0x7'));var config=require('../../config/environment');var jayson=require(_0xcb08('0x8'));var client=jayson['client'][_0xcb08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ab338,_0x5415a7,_0x6da76e){return new BPromise(function(_0x35f0d8,_0x43d63b){return client[_0xcb08('0xa')](_0x1ab338,_0x6da76e)['then'](function(_0x367d12){logger['info'](_0xcb08('0xb'),_0x5415a7,'request\x20sent');logger[_0xcb08('0xc')](_0xcb08('0xd'),_0x5415a7,_0xcb08('0xe'),JSON['stringify'](_0x367d12));if(_0x367d12[_0xcb08('0xf')]){if(_0x367d12[_0xcb08('0xf')]['code']===0x1f4){logger[_0xcb08('0xf')](_0xcb08('0xb'),_0x5415a7,_0x367d12[_0xcb08('0xf')][_0xcb08('0x10')]);return _0x43d63b(_0x367d12[_0xcb08('0xf')][_0xcb08('0x10')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x5415a7,_0x367d12['error'][_0xcb08('0x10')]);return _0x35f0d8(_0x367d12[_0xcb08('0xf')][_0xcb08('0x10')]);}else{logger[_0xcb08('0x11')](_0xcb08('0xb'),_0x5415a7,_0xcb08('0xe'));_0x35f0d8(_0x367d12[_0xcb08('0x12')]['message']);}})['catch'](function(_0x242d23){logger[_0xcb08('0xf')](_0xcb08('0xb'),_0x5415a7,_0x242d23);_0x43d63b(_0x242d23);});});} \ No newline at end of file +var _0x5b55=['then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5733d,_0x4d4297){var _0x2e3fe2=function(_0x1732c9){while(--_0x1732c9){_0x5733d['push'](_0x5733d['shift']());}};_0x2e3fe2(++_0x4d4297);}(_0x5b55,0x128));var _0x55b5=function(_0x15cf93,_0x5b1029){_0x15cf93=_0x15cf93-0x0;var _0x2afb0a=_0x5b55[_0x15cf93];return _0x2afb0a;};'use strict';var _=require(_0x55b5('0x0'));var util=require(_0x55b5('0x1'));var moment=require(_0x55b5('0x2'));var BPromise=require(_0x55b5('0x3'));var rs=require(_0x55b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x55b5('0x6'))(_0x55b5('0x7'));var config=require(_0x55b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x55b5('0x9')][_0x55b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c9d41,_0x4a4fb2,_0xe3197d){return new BPromise(function(_0x250268,_0x3c8aa5){return client[_0x55b5('0xb')](_0x4c9d41,_0xe3197d)[_0x55b5('0xc')](function(_0x17f52e){logger[_0x55b5('0xd')](_0x55b5('0xe'),_0x4a4fb2,_0x55b5('0xf'));logger[_0x55b5('0x10')](_0x55b5('0x11'),_0x4a4fb2,'request\x20sent',JSON['stringify'](_0x17f52e));if(_0x17f52e['error']){if(_0x17f52e[_0x55b5('0x12')]['code']===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4a4fb2,_0x17f52e[_0x55b5('0x12')][_0x55b5('0x13')]);return _0x3c8aa5(_0x17f52e[_0x55b5('0x12')][_0x55b5('0x13')]);}logger[_0x55b5('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x4a4fb2,_0x17f52e[_0x55b5('0x12')]['message']);return _0x250268(_0x17f52e[_0x55b5('0x12')][_0x55b5('0x13')]);}else{logger[_0x55b5('0xd')](_0x55b5('0xe'),_0x4a4fb2,_0x55b5('0xf'));_0x250268(_0x17f52e[_0x55b5('0x14')][_0x55b5('0x13')]);}})[_0x55b5('0x15')](function(_0x1f248e){logger['error'](_0x55b5('0xe'),_0x4a4fb2,_0x1f248e);_0x3c8aa5(_0x1f248e);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index f59666b..3b81845 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 _0x1cb1=['getFavicon','join','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','root','file','diskStorage','format','preferred','addPreferred','favicon','put','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x1cb1,0x90));var _0x11cb=function(_0x5d1c0d,_0x2cec25){_0x5d1c0d=_0x5d1c0d-0x0;var _0x43a664=_0x1cb1[_0x5d1c0d];return _0x43a664;};'use strict';var multer=require(_0x11cb('0x0'));var util=require(_0x11cb('0x1'));var path=require(_0x11cb('0x2'));var timeout=require('connect-timeout');var express=require(_0x11cb('0x3'));var router=express[_0x11cb('0x4')]();var fs_extra=require(_0x11cb('0x5'));var auth=require(_0x11cb('0x6'));var interaction=require(_0x11cb('0x7'));var config=require(_0x11cb('0x8'));var controller=require(_0x11cb('0x9'));router[_0x11cb('0xa')]('/',auth['isAuthenticated'](),controller[_0x11cb('0xb')]);router[_0x11cb('0xa')](_0x11cb('0xc'),controller[_0x11cb('0xd')]);router[_0x11cb('0xa')]('/:id',controller[_0x11cb('0xe')]);router[_0x11cb('0xa')](_0x11cb('0xf'),controller[_0x11cb('0x10')]);router['get'](_0x11cb('0x11'),controller[_0x11cb('0x12')]);router['get'](_0x11cb('0x13'),controller[_0x11cb('0x14')]);router['get'](_0x11cb('0x15'),controller[_0x11cb('0x16')]);router['get'](_0x11cb('0x17'),controller[_0x11cb('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f6698,_0x4832ec,_0x5644c5){_0x5644c5(null,path[_0x11cb('0x19')](config['root'],_0x11cb('0x1a')));},'filename':function(_0x10012e,_0x370479,_0x2b0eff){_0x2b0eff(null,util['format'](_0x11cb('0x1b'),_0x11cb('0x1c'),path[_0x11cb('0x1d')](_0x370479[_0x11cb('0x1e')])));}})});router[_0x11cb('0x1f')](_0x11cb('0xf'),upload[_0x11cb('0x20')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c02cf,_0x38ef0e,_0x1ce8ae){_0x1ce8ae(null,path['join'](config[_0x11cb('0x21')],_0x11cb('0x1a')));},'filename':function(_0x5da156,_0x39a151,_0x4cbf88){_0x4cbf88(null,util['format']('%s%s','logologin',path[_0x11cb('0x1d')](_0x39a151['originalname'])));}})});router[_0x11cb('0x1f')](_0x11cb('0x11'),upload[_0x11cb('0x20')](_0x11cb('0x22')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x11cb('0x23')]({'destination':function(_0x4411eb,_0x3b44b7,_0x39dcc6){_0x39dcc6(null,path[_0x11cb('0x19')](config[_0x11cb('0x21')],_0x11cb('0x1a')));},'filename':function(_0x8fd713,_0x91e471,_0x20ef79){_0x20ef79(null,util[_0x11cb('0x24')](_0x11cb('0x1b'),_0x11cb('0x25'),path['extname'](_0x91e471['originalname'])));}})});router[_0x11cb('0x1f')](_0x11cb('0x15'),upload['single']('file'),controller[_0x11cb('0x26')]);var upload=multer({'storage':multer[_0x11cb('0x23')]({'destination':function(_0x4a0ae8,_0x971a35,_0x48f093){_0x48f093(null,path[_0x11cb('0x19')](config['root'],_0x11cb('0x1a')));},'filename':function(_0x47e910,_0x425376,_0x13be24){_0x13be24(null,util['format']('%s%s',_0x11cb('0x27'),path['extname'](_0x425376[_0x11cb('0x1e')])));}})});router['post']('/:id/favicon',upload[_0x11cb('0x20')](_0x11cb('0x22')),controller['addFavicon']);router[_0x11cb('0x28')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x11cb('0x29')]=router; \ No newline at end of file +var _0x1958=['gdpr','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','extname','single','file','addLogo','%s%s','logologin','originalname','post','/:id/logo_login','addLogoLogin','root','format','preferred','addPreferred','favicon','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/now','/:id','/:id/logo','getLogo','getLogoLogin','/:id/gdpr'];(function(_0x1e7aff,_0x1c843b){var _0x2a16bf=function(_0x2eceee){while(--_0x2eceee){_0x1e7aff['push'](_0x1e7aff['shift']());}};_0x2a16bf(++_0x1c843b);}(_0x1958,0x1c4));var _0x8195=function(_0x1dcf37,_0x150062){_0x1dcf37=_0x1dcf37-0x0;var _0x4323ea=_0x1958[_0x1dcf37];return _0x4323ea;};'use strict';var multer=require(_0x8195('0x0'));var util=require(_0x8195('0x1'));var path=require(_0x8195('0x2'));var timeout=require(_0x8195('0x3'));var express=require('express');var router=express[_0x8195('0x4')]();var fs_extra=require(_0x8195('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8195('0x6'));var config=require(_0x8195('0x7'));var controller=require('./setting.controller');router[_0x8195('0x8')]('/',auth[_0x8195('0x9')](),controller['index']);router[_0x8195('0x8')](_0x8195('0xa'),controller['getDate']);router['get'](_0x8195('0xb'),controller['show']);router['get'](_0x8195('0xc'),controller[_0x8195('0xd')]);router['get']('/:id/logo_login',controller[_0x8195('0xe')]);router[_0x8195('0x8')](_0x8195('0xf'),controller[_0x8195('0x10')]);router[_0x8195('0x8')]('/:id/preferred',controller['getPreferred']);router[_0x8195('0x8')](_0x8195('0x11'),controller[_0x8195('0x12')]);var upload=multer({'storage':multer[_0x8195('0x13')]({'destination':function(_0xa0e08a,_0x387383,_0x20284b){_0x20284b(null,path[_0x8195('0x14')](config['root'],_0x8195('0x15')));},'filename':function(_0x28ef0f,_0x11f174,_0x531b27){_0x531b27(null,util['format']('%s%s','logo',path[_0x8195('0x16')](_0x11f174['originalname'])));}})});router['post']('/:id/logo',upload[_0x8195('0x17')](_0x8195('0x18')),controller[_0x8195('0x19')]);var upload=multer({'storage':multer[_0x8195('0x13')]({'destination':function(_0xf0a71b,_0x1a3496,_0x2aa3c9){_0x2aa3c9(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0xae4432,_0xcf66b4,_0x307709){_0x307709(null,util['format'](_0x8195('0x1a'),_0x8195('0x1b'),path[_0x8195('0x16')](_0xcf66b4[_0x8195('0x1c')])));}})});router[_0x8195('0x1d')](_0x8195('0x1e'),upload[_0x8195('0x17')](_0x8195('0x18')),controller[_0x8195('0x1f')]);var upload=multer({'storage':multer[_0x8195('0x13')]({'destination':function(_0x5a2c5c,_0x1f5678,_0x224f53){_0x224f53(null,path[_0x8195('0x14')](config[_0x8195('0x20')],'server/files/images/logos/'));},'filename':function(_0x5a2b25,_0xb859ba,_0x359050){_0x359050(null,util[_0x8195('0x21')](_0x8195('0x1a'),_0x8195('0x22'),path['extname'](_0xb859ba[_0x8195('0x1c')])));}})});router[_0x8195('0x1d')]('/:id/preferred',upload[_0x8195('0x17')](_0x8195('0x18')),controller[_0x8195('0x23')]);var upload=multer({'storage':multer[_0x8195('0x13')]({'destination':function(_0x2c6c33,_0x543e3d,_0x1301fc){_0x1301fc(null,path[_0x8195('0x14')](config[_0x8195('0x20')],_0x8195('0x15')));},'filename':function(_0x4f3ae8,_0x1c76d1,_0x4eb74c){_0x4eb74c(null,util[_0x8195('0x21')](_0x8195('0x1a'),_0x8195('0x24'),path[_0x8195('0x16')](_0x1c76d1[_0x8195('0x1c')])));}})});router[_0x8195('0x1d')](_0x8195('0x11'),upload[_0x8195('0x17')](_0x8195('0x18')),controller['addFavicon']);router['put'](_0x8195('0xb'),auth[_0x8195('0x9')](),controller[_0x8195('0x25')]);module[_0x8195('0x26')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9c6033e..2cad6cf 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x27431c,_0x5d28a1){var _0x4bd29b=function(_0x3c1685){while(--_0x3c1685){_0x27431c['push'](_0x27431c['shift']());}};_0x4bd29b(++_0x5d28a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index ebf0b3d..8907d65 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 _0x775d=['Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','securePassword','addPreferred','getPreferred','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','Setting','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','filter','includeAll','include','findAll','params','options','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom'];(function(_0xe18939,_0x121095){var _0x2a9979=function(_0x1fdda4){while(--_0x1fdda4){_0xe18939['push'](_0xe18939['shift']());}};_0x2a9979(++_0x121095);}(_0x775d,0x188));var _0xd775=function(_0x10a894,_0x30bf4c){_0x10a894=_0x10a894-0x0;var _0xaf71a5=_0x775d[_0x10a894];return _0xaf71a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd775('0x0'));var zipdir=require(_0xd775('0x1'));var jsonpatch=require(_0xd775('0x2'));var rp=require(_0xd775('0x3'));var moment=require(_0xd775('0x4'));var BPromise=require(_0xd775('0x5'));var Mustache=require(_0xd775('0x6'));var util=require(_0xd775('0x7'));var path=require(_0xd775('0x8'));var sox=require(_0xd775('0x9'));var csv=require(_0xd775('0xa'));var ejs=require(_0xd775('0xb'));var fs=require('fs');var fs_extra=require(_0xd775('0xc'));var _=require('lodash');var squel=require(_0xd775('0xd'));var crypto=require(_0xd775('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd775('0xf'));var toCsv=require(_0xd775('0xa'));var querystring=require('querystring');var Papa=require(_0xd775('0x10'));var Redis=require(_0xd775('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd775('0x12'));var as=require(_0xd775('0x13'));var hardwareService=require(_0xd775('0x14'));var logger=require(_0xd775('0x15'))('api');var utils=require(_0xd775('0x16'));var config=require(_0xd775('0x17'));var licenseUtil=require(_0xd775('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd775('0x19'));var client=jayson[_0xd775('0x1a')][_0xd775('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x222a83,_0x47d175,_0x43b2da,_0x242130){return new BPromise(function(_0xd17d18,_0x29826a){var _0x22c962=_0x242130||client;return _0x22c962['request'](_0x222a83,_0x43b2da)[_0xd775('0x1c')](function(_0x499451){logger[_0xd775('0x1d')](_0xd775('0x1e'),_0x47d175,_0xd775('0x1f'));logger[_0xd775('0x20')](_0xd775('0x21'),_0x47d175,'request\x20sent',JSON['stringify'](_0x499451));if(_0x499451[_0xd775('0x22')]){if(_0x499451[_0xd775('0x22')][_0xd775('0x23')]===0x1f4){logger[_0xd775('0x22')](_0xd775('0x1e'),_0x47d175,_0x499451[_0xd775('0x22')]['message']);return _0x29826a(_0x499451[_0xd775('0x22')][_0xd775('0x24')]);}logger[_0xd775('0x22')]('Setting,\x20%s,\x20%s',_0x47d175,_0x499451['error'][_0xd775('0x24')]);return _0xd17d18(_0x499451[_0xd775('0x22')]['message']);}else{logger[_0xd775('0x1d')]('Setting,\x20%s,\x20%s',_0x47d175,'request\x20sent');_0xd17d18(_0x499451['result'][_0xd775('0x24')]);}})[_0xd775('0x25')](function(_0x53e51c){logger[_0xd775('0x22')](_0xd775('0x1e'),_0x47d175,_0x53e51c);_0x29826a(_0x53e51c);});});}function respondWithStatusCode(_0x482fff,_0x1697d3){_0x1697d3=_0x1697d3||0xcc;return function(_0x1f300e){if(_0x1f300e){return _0x482fff['sendStatus'](_0x1697d3);}return _0x482fff[_0xd775('0x26')](_0x1697d3)['end']();};}function respondWithResult(_0x1b9219,_0x1c8511){_0x1c8511=_0x1c8511||0xc8;return function(_0x338333){if(_0x338333){return _0x1b9219[_0xd775('0x26')](_0x1c8511)[_0xd775('0x27')](_0x338333);}};}function respondWithFilteredResult(_0x187e8f,_0x352618){return function(_0xe0b690){if(_0xe0b690){var _0x3fdfc9=typeof _0x352618[_0xd775('0x28')]==='undefined'&&typeof _0x352618['limit']===_0xd775('0x29');var _0x28af0e=_0xe0b690[_0xd775('0x2a')];var _0x3cde7c=_0x3fdfc9?0x0:_0x352618[_0xd775('0x28')];var _0x9f062b=_0x3fdfc9?_0xe0b690[_0xd775('0x2a')]:_0x352618[_0xd775('0x28')]+_0x352618[_0xd775('0x2b')];var _0x3fa479;if(_0x9f062b>=_0x28af0e){_0x9f062b=_0x28af0e;_0x3fa479=0xc8;}else{_0x3fa479=0xce;}_0x187e8f[_0xd775('0x26')](_0x3fa479);return _0x187e8f[_0xd775('0x2c')](_0xd775('0x2d'),_0x3cde7c+'-'+_0x9f062b+'/'+_0x28af0e)[_0xd775('0x27')](_0xe0b690);}return null;};}function patchUpdates(_0x42ef11){return function(_0x4667b9){try{jsonpatch[_0xd775('0x2e')](_0x4667b9,_0x42ef11,!![]);}catch(_0x2b2b6a){return BPromise[_0xd775('0x2f')](_0x2b2b6a);}return _0x4667b9[_0xd775('0x30')]();};}function saveUpdates(_0x268198,_0x485c4e){return function(_0x2f814d){if(_0x2f814d){return _0x2f814d[_0xd775('0x31')](_0x268198)[_0xd775('0x1c')](function(_0xbce85e){return _0xbce85e;});}return null;};}function removeEntity(_0x5a2794,_0x5e287e){return function(_0x4fe731){if(_0x4fe731){return _0x4fe731[_0xd775('0x32')]()[_0xd775('0x1c')](function(){_0x5a2794['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff02e,_0x252434){return function(_0x17acfc){if(!_0x17acfc){_0x3ff02e[_0xd775('0x33')](0x194);}return _0x17acfc;};}function handleError(_0x3e7baf,_0x1bdf03){_0x1bdf03=_0x1bdf03||0x1f4;return function(_0x30ac35){logger[_0xd775('0x22')](_0x30ac35[_0xd775('0x34')]);if(_0x30ac35[_0xd775('0x35')]){delete _0x30ac35[_0xd775('0x35')];}_0x3e7baf[_0xd775('0x26')](_0x1bdf03)['send'](_0x30ac35);};}exports[_0xd775('0x36')]=function(_0x51b3b2,_0x2930d5){var _0xf40c4b={},_0xc875c5={},_0x2396fd={'count':0x0,'rows':[]};var _0x3f490f=_['map'](db[_0xd775('0x37')][_0xd775('0x38')],function(_0x3aa674){return{'name':_0x3aa674[_0xd775('0x39')],'type':_0x3aa674[_0xd775('0x3a')][_0xd775('0x3b')]};});_0xc875c5[_0xd775('0x3c')]=_[_0xd775('0x3d')](_0x3f490f,_0xd775('0x35'));_0xc875c5[_0xd775('0x3e')]=_[_0xd775('0x3f')](_0x51b3b2[_0xd775('0x3e')]);_0xc875c5[_0xd775('0x40')]=_[_0xd775('0x41')](_0xc875c5[_0xd775('0x3c')],_0xc875c5[_0xd775('0x3e')]);_0xf40c4b['attributes']=_[_0xd775('0x41')](_0xc875c5[_0xd775('0x3c')],qs[_0xd775('0x42')](_0x51b3b2[_0xd775('0x3e')]['fields']));_0xf40c4b['attributes']=_0xf40c4b[_0xd775('0x43')]['length']?_0xf40c4b['attributes']:_0xc875c5[_0xd775('0x3c')];if(!_0x51b3b2[_0xd775('0x3e')][_0xd775('0x44')](_0xd775('0x45'))){_0xf40c4b['limit']=qs[_0xd775('0x2b')](_0x51b3b2[_0xd775('0x3e')][_0xd775('0x2b')]);_0xf40c4b['offset']=qs[_0xd775('0x28')](_0x51b3b2['query'][_0xd775('0x28')]);}_0xf40c4b[_0xd775('0x46')]=qs['sort'](_0x51b3b2['query']['sort']);_0xf40c4b[_0xd775('0x47')]=qs[_0xd775('0x40')](_[_0xd775('0x48')](_0x51b3b2[_0xd775('0x3e')],_0xc875c5[_0xd775('0x40')]),_0x3f490f);if(_0x51b3b2[_0xd775('0x3e')]['filter']){_0xf40c4b['where']=_[_0xd775('0x49')](_0xf40c4b[_0xd775('0x47')],{'$or':_[_0xd775('0x3d')](_0x3f490f,function(_0x1b54bf){if(_0x1b54bf[_0xd775('0x3a')]!=='VIRTUAL'){var _0x4a4333={};_0x4a4333[_0x1b54bf[_0xd775('0x35')]]={'$like':'%'+_0x51b3b2[_0xd775('0x3e')][_0xd775('0x4a')]+'%'};return _0x4a4333;}})});}_0xf40c4b=_[_0xd775('0x49')]({},_0xf40c4b,_0x51b3b2['options']);var _0x43c6d8={'where':_0xf40c4b[_0xd775('0x47')]};return db[_0xd775('0x37')][_0xd775('0x2a')](_0x43c6d8)[_0xd775('0x1c')](function(_0x9e25a0){_0x2396fd[_0xd775('0x2a')]=_0x9e25a0;if(_0x51b3b2[_0xd775('0x3e')][_0xd775('0x4b')]){_0xf40c4b[_0xd775('0x4c')]=[{'all':!![]}];}return db['Setting'][_0xd775('0x4d')](_0xf40c4b);})[_0xd775('0x1c')](function(_0x55913a){_0x2396fd['rows']=_0x55913a;return _0x2396fd;})[_0xd775('0x1c')](respondWithFilteredResult(_0x2930d5,_0xf40c4b))[_0xd775('0x25')](handleError(_0x2930d5,null));};exports['show']=function(_0x41d97f,_0x17286d){var _0x476e8d={'raw':![],'where':{'id':_0x41d97f[_0xd775('0x4e')]['id']}},_0x1380c0={};_0x1380c0[_0xd775('0x3c')]=_[_0xd775('0x3f')](db[_0xd775('0x37')][_0xd775('0x38')]);_0x1380c0[_0xd775('0x3e')]=_[_0xd775('0x3f')](_0x41d97f[_0xd775('0x3e')]);_0x1380c0[_0xd775('0x40')]=_['intersection'](_0x1380c0[_0xd775('0x3c')],_0x1380c0[_0xd775('0x3e')]);_0x476e8d[_0xd775('0x43')]=_[_0xd775('0x41')](_0x1380c0['model'],qs[_0xd775('0x42')](_0x41d97f['query'][_0xd775('0x42')]));_0x476e8d['attributes']=_0x476e8d[_0xd775('0x43')]['length']?_0x476e8d[_0xd775('0x43')]:_0x1380c0[_0xd775('0x3c')];if(_0x41d97f['query'][_0xd775('0x4b')]){_0x476e8d[_0xd775('0x4c')]=[{'all':!![]}];}_0x476e8d=_[_0xd775('0x49')]({},_0x476e8d,_0x41d97f[_0xd775('0x4f')]);return db[_0xd775('0x37')][_0xd775('0x50')](_0x476e8d)['then'](handleEntityNotFound(_0x17286d,null))['then'](respondWithResult(_0x17286d,null))[_0xd775('0x25')](handleError(_0x17286d,null));};exports[_0xd775('0x31')]=function(_0x2adf5b,_0x441d91){if(_0x2adf5b[_0xd775('0x51')]['id']){delete _0x2adf5b[_0xd775('0x51')]['id'];}return db[_0xd775('0x37')][_0xd775('0x50')]({'where':{'id':_0x2adf5b[_0xd775('0x4e')]['id']}})[_0xd775('0x1c')](handleEntityNotFound(_0x441d91,null))[_0xd775('0x1c')](saveUpdates(_0x2adf5b[_0xd775('0x51')],null))['then'](respondWithResult(_0x441d91,null))[_0xd775('0x25')](handleError(_0x441d91,null));};exports[_0xd775('0x52')]=function(_0x2f8202,_0x43db4f,_0x4d0da9){if(_0x2f8202[_0xd775('0x53')]&&_0x2f8202[_0xd775('0x53')][_0xd775('0x54')]){_0x2f8202[_0xd775('0x51')][_0xd775('0x55')]=_0x2f8202['file'][_0xd775('0x54')];}return db[_0xd775('0x37')][_0xd775('0x50')]({'where':{'id':_0x2f8202[_0xd775('0x4e')]['id']}})['then'](handleEntityNotFound(_0x43db4f,null))[_0xd775('0x1c')](saveUpdates(_0x2f8202['body'],null))[_0xd775('0x1c')](respondWithResult(_0x43db4f,null))[_0xd775('0x25')](handleError(_0x43db4f,null));};exports[_0xd775('0x56')]=function(_0x147da8,_0x55ea6c,_0x298c76){if(_0x147da8[_0xd775('0x53')]&&_0x147da8['file'][_0xd775('0x54')]){_0x147da8[_0xd775('0x51')][_0xd775('0x57')]=_0x147da8[_0xd775('0x53')][_0xd775('0x54')];}return db[_0xd775('0x37')][_0xd775('0x50')]({'where':{'id':_0x147da8[_0xd775('0x4e')]['id']}})[_0xd775('0x1c')](handleEntityNotFound(_0x55ea6c,null))[_0xd775('0x1c')](saveUpdates(_0x147da8[_0xd775('0x51')],null))[_0xd775('0x1c')](respondWithResult(_0x55ea6c,null))[_0xd775('0x25')](handleError(_0x55ea6c,null));};var utilLicense=require(_0xd775('0x18'));exports[_0xd775('0x58')]=function(_0xf5ab79,_0x46adae,_0x35a222){var _0x528670=_0xd775('0x59');var _0x56cbca={'custom':![]};return utilLicense[_0xd775('0x5a')]()[_0xd775('0x1c')](function(_0x59fe55){if(_0x59fe55){_0x56cbca=_0x59fe55;}return db[_0xd775('0x37')][_0xd775('0x50')]({'where':{'id':_0xf5ab79[_0xd775('0x4e')]['id']},'attributes':[_0xd775('0x55'),_0xd775('0x57'),_0xd775('0x5b'),'favicon',_0xd775('0x5c'),_0xd775('0x5d'),_0xd775('0x5e'),_0xd775('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x46adae,null))['then'](function(_0xad0694){if(_0xad0694){var _0x47bb2c=_0xad0694[_0xd775('0x55')]&&fs[_0xd775('0x60')](path[_0xd775('0x61')](config[_0xd775('0x62')],_0x528670,_['toLower'](_0xad0694[_0xd775('0x55')])))?path[_0xd775('0x61')](config[_0xd775('0x62')],_0x528670,_['toLower'](_0xad0694[_0xd775('0x55')])):path[_0xd775('0x61')](config[_0xd775('0x62')],_0x528670,_[_0xd775('0x63')](_0xd775('0x64')));var _0x1c37b6=_0xd775('0x65')+_[_0xd775('0x66')](_0xd775('0x55'));if(_0xad0694[_0x1c37b6]||!_0x56cbca[_0xd775('0x67')]){_0x47bb2c=path[_0xd775('0x61')](config[_0xd775('0x62')],_0x528670,_[_0xd775('0x63')](_0xd775('0x64')));}if(!fs[_0xd775('0x60')](_0x47bb2c)){throw new db[(_0xd775('0x68'))][(_0xd775('0x69'))](_[_0xd775('0x66')](_0xd775('0x55'))+_0xd775('0x6a'));}return _0x46adae[_0xd775('0x6b')](_0x47bb2c);}})[_0xd775('0x25')](handleError(_0x46adae,null));};var utilLicense=require(_0xd775('0x18'));exports[_0xd775('0x6c')]=function(_0x7affcb,_0x525d3d,_0x3cca3f){var _0x8ba303=_0xd775('0x59');var _0x5f17dd={'custom':![]};return utilLicense[_0xd775('0x5a')]()['then'](function(_0x447ef8){if(_0x447ef8){_0x5f17dd=_0x447ef8;}return db[_0xd775('0x37')][_0xd775('0x50')]({'where':{'id':_0x7affcb[_0xd775('0x4e')]['id']},'attributes':['logo',_0xd775('0x57'),_0xd775('0x5b'),'favicon','defaultLogo',_0xd775('0x5d'),_0xd775('0x5e'),_0xd775('0x5f')],'raw':!![]});})[_0xd775('0x1c')](handleEntityNotFound(_0x525d3d,null))[_0xd775('0x1c')](function(_0x15ea52){if(_0x15ea52){var _0x39f416=_0x15ea52[_0xd775('0x57')]&&fs[_0xd775('0x60')](path[_0xd775('0x61')](config[_0xd775('0x62')],_0x8ba303,_[_0xd775('0x63')](_0x15ea52[_0xd775('0x57')])))?path['join'](config['root'],_0x8ba303,_[_0xd775('0x63')](_0x15ea52['loginLogo'])):path['join'](config[_0xd775('0x62')],_0x8ba303,_[_0xd775('0x63')](_0xd775('0x6d')));var _0x5cabd6=_0xd775('0x65')+_[_0xd775('0x66')](_0xd775('0x57'));if(_0x15ea52[_0x5cabd6]||!_0x5f17dd[_0xd775('0x67')]){_0x39f416=path[_0xd775('0x61')](config[_0xd775('0x62')],_0x8ba303,_[_0xd775('0x63')](_0xd775('0x6d')));}if(!fs[_0xd775('0x60')](_0x39f416)){throw new db['Sequelize'][(_0xd775('0x69'))](_[_0xd775('0x66')]('loginLogo')+_0xd775('0x6a'));}return _0x525d3d[_0xd775('0x6b')](_0x39f416);}})['catch'](handleError(_0x525d3d,null));};exports['gdpr']=function(_0x1ef52a,_0x193514){return db[_0xd775('0x37')]['find']({'where':{'id':_0x1ef52a[_0xd775('0x4e')]['id']},'attributes':[_0xd775('0x6e')]})[_0xd775('0x1c')](respondWithResult(_0x193514,null))[_0xd775('0x25')](handleError(_0x193514,null));};exports[_0xd775('0x6f')]=function(_0x3e0538,_0x20d0b3,_0x26e1c3){if(_0x3e0538[_0xd775('0x53')]&&_0x3e0538[_0xd775('0x53')][_0xd775('0x54')]){_0x3e0538[_0xd775('0x51')][_0xd775('0x5b')]=_0x3e0538[_0xd775('0x53')]['filename'];}return db[_0xd775('0x37')][_0xd775('0x50')]({'where':{'id':_0x3e0538['params']['id']}})['then'](handleEntityNotFound(_0x20d0b3,null))['then'](saveUpdates(_0x3e0538[_0xd775('0x51')],null))[_0xd775('0x1c')](respondWithResult(_0x20d0b3,null))[_0xd775('0x25')](handleError(_0x20d0b3,null));};var utilLicense=require(_0xd775('0x18'));exports[_0xd775('0x70')]=function(_0x36e9be,_0x1edd8a,_0x157bd7){var _0x88e7ff='server/files/images/logos';var _0x2ef6c2={'custom':![]};return utilLicense[_0xd775('0x5a')]()[_0xd775('0x1c')](function(_0x16b251){if(_0x16b251){_0x2ef6c2=_0x16b251;}return db[_0xd775('0x37')]['find']({'where':{'id':_0x36e9be[_0xd775('0x4e')]['id']},'attributes':['logo','loginLogo',_0xd775('0x5b'),_0xd775('0x71'),_0xd775('0x5c'),_0xd775('0x5d'),_0xd775('0x5e'),_0xd775('0x5f')],'raw':!![]});})[_0xd775('0x1c')](handleEntityNotFound(_0x1edd8a,null))['then'](function(_0x4f93d9){if(_0x4f93d9){var _0x26c6d4=_0x4f93d9[_0xd775('0x5b')]&&fs[_0xd775('0x60')](path[_0xd775('0x61')](config[_0xd775('0x62')],_0x88e7ff,_[_0xd775('0x63')](_0x4f93d9['preferred'])))?path['join'](config[_0xd775('0x62')],_0x88e7ff,_[_0xd775('0x63')](_0x4f93d9['preferred'])):path[_0xd775('0x61')](config[_0xd775('0x62')],_0x88e7ff,_[_0xd775('0x63')](_0xd775('0x72')));var _0x388db5=_0xd775('0x65')+_[_0xd775('0x66')]('preferred');if(_0x4f93d9[_0x388db5]||!_0x2ef6c2[_0xd775('0x67')]||!_0x2ef6c2['preferred']){_0x26c6d4=path[_0xd775('0x61')](config[_0xd775('0x62')],_0x88e7ff,_[_0xd775('0x63')](_0xd775('0x72')));}if(!fs[_0xd775('0x60')](_0x26c6d4)){throw new db[(_0xd775('0x68'))][(_0xd775('0x69'))](_[_0xd775('0x66')]('preferred')+_0xd775('0x6a'));}return _0x1edd8a[_0xd775('0x6b')](_0x26c6d4);}})[_0xd775('0x25')](handleError(_0x1edd8a,null));};exports[_0xd775('0x73')]=function(_0x1a21e3,_0x38af38,_0x2fa96a){if(_0x1a21e3[_0xd775('0x53')]&&_0x1a21e3[_0xd775('0x53')]['filename']){_0x1a21e3[_0xd775('0x51')]['favicon']=_0x1a21e3['file'][_0xd775('0x54')];}return db[_0xd775('0x37')][_0xd775('0x50')]({'where':{'id':_0x1a21e3[_0xd775('0x4e')]['id']}})['then'](handleEntityNotFound(_0x38af38,null))[_0xd775('0x1c')](saveUpdates(_0x1a21e3[_0xd775('0x51')],null))[_0xd775('0x1c')](respondWithResult(_0x38af38,null))[_0xd775('0x25')](handleError(_0x38af38,null));};var utilLicense=require(_0xd775('0x18'));exports[_0xd775('0x74')]=function(_0x505d83,_0x3fad08,_0x4bf8a4){var _0x4e03a8=_0xd775('0x59');var _0x202f19={'custom':![]};return utilLicense[_0xd775('0x5a')]()[_0xd775('0x1c')](function(_0x5ba59d){if(_0x5ba59d){_0x202f19=_0x5ba59d;}return db['Setting'][_0xd775('0x50')]({'where':{'id':_0x505d83[_0xd775('0x4e')]['id']},'attributes':['logo','loginLogo',_0xd775('0x5b'),_0xd775('0x71'),_0xd775('0x5c'),_0xd775('0x5d'),_0xd775('0x5e'),_0xd775('0x5f')],'raw':!![]});})[_0xd775('0x1c')](handleEntityNotFound(_0x3fad08,null))[_0xd775('0x1c')](function(_0x41a13f){if(_0x41a13f){var _0x582499=_0x41a13f[_0xd775('0x71')]&&fs[_0xd775('0x60')](path['join'](config[_0xd775('0x62')],_0x4e03a8,_[_0xd775('0x63')](_0x41a13f[_0xd775('0x71')])))?path[_0xd775('0x61')](config['root'],_0x4e03a8,_[_0xd775('0x63')](_0x41a13f[_0xd775('0x71')])):path[_0xd775('0x61')](config[_0xd775('0x62')],_0x4e03a8,_[_0xd775('0x63')](_0xd775('0x75')));var _0x1249d7=_0xd775('0x65')+_['upperFirst'](_0xd775('0x71'));if(_0x41a13f[_0x1249d7]||!_0x202f19['custom']){_0x582499=path[_0xd775('0x61')](config[_0xd775('0x62')],_0x4e03a8,_['toLower'](_0xd775('0x75')));}if(!fs['existsSync'](_0x582499)){throw new db[(_0xd775('0x68'))]['ValidationError'](_['upperFirst'](_0xd775('0x71'))+_0xd775('0x6a'));}return _0x3fad08['download'](_0x582499);}})['catch'](handleError(_0x3fad08,null));};exports[_0xd775('0x76')]=function(_0x1417c0,_0x34b13b){var _0x60cb33={'offset':moment()[_0xd775('0x77')]()};_0x60cb33[_0xd775('0x78')]=moment()[_0xd775('0x77')](_0x60cb33[_0xd775('0x28')])[_0xd775('0x79')](_0xd775('0x7a'));return _0x34b13b[_0xd775('0x26')](0xc8)[_0xd775('0x7b')](_0x60cb33);}; \ No newline at end of file +var _0x919d=['Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','name','send','index','map','Setting','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','fields','update','body','find','addLogo','file','filename','logo','addLogoLogin','getLogo','getLicense','loginLogo','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','preferred','defaultPreferred','default_loginLogo.svg','upperFirst','securePassword','addPreferred','getPreferred','server/files/images/logos','default_preferred.png','getFavicon','defaultLogo','default_favicon.ico','getDate','utcOffset','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','client','request','then'];(function(_0xa17cb6,_0x57c168){var _0x5e1163=function(_0x3294f4){while(--_0x3294f4){_0xa17cb6['push'](_0xa17cb6['shift']());}};_0x5e1163(++_0x57c168);}(_0x919d,0x1c0));var _0xd919=function(_0x4a87a7,_0x4273d0){_0x4a87a7=_0x4a87a7-0x0;var _0x5e55c8=_0x919d[_0x4a87a7];return _0x5e55c8;};'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('request-promise');var moment=require(_0xd919('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd919('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd919('0x6'));var csv=require(_0xd919('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd919('0x8'));var squel=require(_0xd919('0x9'));var crypto=require(_0xd919('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd919('0xb'));var toCsv=require(_0xd919('0x7'));var querystring=require(_0xd919('0xc'));var Papa=require(_0xd919('0xd'));var Redis=require(_0xd919('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd919('0xf'));var as=require(_0xd919('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd919('0x11'));var utils=require(_0xd919('0x12'));var config=require(_0xd919('0x13'));var licenseUtil=require(_0xd919('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xd919('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a4c68,_0x2aa278,_0x42a2ce,_0xdcf446){return new BPromise(function(_0x36be2f,_0x1bbb6d){var _0x2bcad8=_0xdcf446||client;return _0x2bcad8[_0xd919('0x16')](_0x2a4c68,_0x42a2ce)[_0xd919('0x17')](function(_0x57e145){logger['info'](_0xd919('0x18'),_0x2aa278,_0xd919('0x19'));logger['debug'](_0xd919('0x1a'),_0x2aa278,_0xd919('0x19'),JSON['stringify'](_0x57e145));if(_0x57e145[_0xd919('0x1b')]){if(_0x57e145[_0xd919('0x1b')]['code']===0x1f4){logger['error'](_0xd919('0x18'),_0x2aa278,_0x57e145['error'][_0xd919('0x1c')]);return _0x1bbb6d(_0x57e145[_0xd919('0x1b')][_0xd919('0x1c')]);}logger[_0xd919('0x1b')](_0xd919('0x18'),_0x2aa278,_0x57e145[_0xd919('0x1b')][_0xd919('0x1c')]);return _0x36be2f(_0x57e145[_0xd919('0x1b')][_0xd919('0x1c')]);}else{logger[_0xd919('0x1d')]('Setting,\x20%s,\x20%s',_0x2aa278,_0xd919('0x19'));_0x36be2f(_0x57e145[_0xd919('0x1e')]['message']);}})[_0xd919('0x1f')](function(_0x21ba69){logger[_0xd919('0x1b')](_0xd919('0x18'),_0x2aa278,_0x21ba69);_0x1bbb6d(_0x21ba69);});});}function respondWithStatusCode(_0x355eb9,_0x57c99e){_0x57c99e=_0x57c99e||0xcc;return function(_0x333f95){if(_0x333f95){return _0x355eb9[_0xd919('0x20')](_0x57c99e);}return _0x355eb9[_0xd919('0x21')](_0x57c99e)['end']();};}function respondWithResult(_0x527ebf,_0x426f59){_0x426f59=_0x426f59||0xc8;return function(_0x1a2672){if(_0x1a2672){return _0x527ebf[_0xd919('0x21')](_0x426f59)[_0xd919('0x22')](_0x1a2672);}};}function respondWithFilteredResult(_0x23530d,_0x223027){return function(_0x39d3eb){if(_0x39d3eb){var _0xb9e6a1=typeof _0x223027[_0xd919('0x23')]===_0xd919('0x24')&&typeof _0x223027[_0xd919('0x25')]===_0xd919('0x24');var _0x3955a8=_0x39d3eb[_0xd919('0x26')];var _0x250c01=_0xb9e6a1?0x0:_0x223027[_0xd919('0x23')];var _0x41a296=_0xb9e6a1?_0x39d3eb[_0xd919('0x26')]:_0x223027[_0xd919('0x23')]+_0x223027[_0xd919('0x25')];var _0x3d0162;if(_0x41a296>=_0x3955a8){_0x41a296=_0x3955a8;_0x3d0162=0xc8;}else{_0x3d0162=0xce;}_0x23530d[_0xd919('0x21')](_0x3d0162);return _0x23530d[_0xd919('0x27')](_0xd919('0x28'),_0x250c01+'-'+_0x41a296+'/'+_0x3955a8)['json'](_0x39d3eb);}return null;};}function patchUpdates(_0x5abe4f){return function(_0x445862){try{jsonpatch[_0xd919('0x29')](_0x445862,_0x5abe4f,!![]);}catch(_0x3b6ffe){return BPromise[_0xd919('0x2a')](_0x3b6ffe);}return _0x445862[_0xd919('0x2b')]();};}function saveUpdates(_0x2c16c2,_0x1ba6cc){return function(_0x5c154d){if(_0x5c154d){return _0x5c154d['update'](_0x2c16c2)[_0xd919('0x17')](function(_0x60a4c7){return _0x60a4c7;});}return null;};}function removeEntity(_0x19cff5,_0x2ae0b9){return function(_0x5115fe){if(_0x5115fe){return _0x5115fe[_0xd919('0x2c')]()['then'](function(){_0x19cff5[_0xd919('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530b0b,_0x51e5ae){return function(_0x21586a){if(!_0x21586a){_0x530b0b[_0xd919('0x20')](0x194);}return _0x21586a;};}function handleError(_0x41940e,_0xc4438d){_0xc4438d=_0xc4438d||0x1f4;return function(_0xa2afac){logger[_0xd919('0x1b')](_0xa2afac['stack']);if(_0xa2afac['name']){delete _0xa2afac[_0xd919('0x2d')];}_0x41940e[_0xd919('0x21')](_0xc4438d)[_0xd919('0x2e')](_0xa2afac);};}exports[_0xd919('0x2f')]=function(_0x777d8a,_0x312f5a){var _0x2101af={},_0x53c89a={},_0x22f95c={'count':0x0,'rows':[]};var _0x5572f6=_[_0xd919('0x30')](db[_0xd919('0x31')][_0xd919('0x32')],function(_0x39d495){return{'name':_0x39d495[_0xd919('0x33')],'type':_0x39d495[_0xd919('0x34')][_0xd919('0x35')]};});_0x53c89a['model']=_[_0xd919('0x30')](_0x5572f6,_0xd919('0x2d'));_0x53c89a[_0xd919('0x36')]=_[_0xd919('0x37')](_0x777d8a['query']);_0x53c89a[_0xd919('0x38')]=_[_0xd919('0x39')](_0x53c89a[_0xd919('0x3a')],_0x53c89a[_0xd919('0x36')]);_0x2101af['attributes']=_['intersection'](_0x53c89a[_0xd919('0x3a')],qs['fields'](_0x777d8a[_0xd919('0x36')]['fields']));_0x2101af['attributes']=_0x2101af[_0xd919('0x3b')][_0xd919('0x3c')]?_0x2101af[_0xd919('0x3b')]:_0x53c89a[_0xd919('0x3a')];if(!_0x777d8a[_0xd919('0x36')][_0xd919('0x3d')](_0xd919('0x3e'))){_0x2101af[_0xd919('0x25')]=qs[_0xd919('0x25')](_0x777d8a['query'][_0xd919('0x25')]);_0x2101af['offset']=qs[_0xd919('0x23')](_0x777d8a[_0xd919('0x36')][_0xd919('0x23')]);}_0x2101af[_0xd919('0x3f')]=qs[_0xd919('0x40')](_0x777d8a[_0xd919('0x36')]['sort']);_0x2101af['where']=qs[_0xd919('0x38')](_[_0xd919('0x41')](_0x777d8a[_0xd919('0x36')],_0x53c89a['filters']),_0x5572f6);if(_0x777d8a[_0xd919('0x36')][_0xd919('0x42')]){_0x2101af[_0xd919('0x43')]=_['merge'](_0x2101af[_0xd919('0x43')],{'$or':_[_0xd919('0x30')](_0x5572f6,function(_0x5eb3cb){if(_0x5eb3cb[_0xd919('0x34')]!=='VIRTUAL'){var _0x350efc={};_0x350efc[_0x5eb3cb[_0xd919('0x2d')]]={'$like':'%'+_0x777d8a[_0xd919('0x36')][_0xd919('0x42')]+'%'};return _0x350efc;}})});}_0x2101af=_[_0xd919('0x44')]({},_0x2101af,_0x777d8a[_0xd919('0x45')]);var _0x14efc3={'where':_0x2101af['where']};return db['Setting'][_0xd919('0x26')](_0x14efc3)['then'](function(_0xaaf982){_0x22f95c['count']=_0xaaf982;if(_0x777d8a['query'][_0xd919('0x46')]){_0x2101af[_0xd919('0x47')]=[{'all':!![]}];}return db['Setting'][_0xd919('0x48')](_0x2101af);})[_0xd919('0x17')](function(_0x41652e){_0x22f95c[_0xd919('0x49')]=_0x41652e;return _0x22f95c;})['then'](respondWithFilteredResult(_0x312f5a,_0x2101af))[_0xd919('0x1f')](handleError(_0x312f5a,null));};exports[_0xd919('0x4a')]=function(_0x1426b3,_0x17a883){var _0x3c4cfa={'raw':![],'where':{'id':_0x1426b3[_0xd919('0x4b')]['id']}},_0x450640={};_0x450640[_0xd919('0x3a')]=_[_0xd919('0x37')](db['Setting'][_0xd919('0x32')]);_0x450640[_0xd919('0x36')]=_['keys'](_0x1426b3['query']);_0x450640[_0xd919('0x38')]=_[_0xd919('0x39')](_0x450640[_0xd919('0x3a')],_0x450640[_0xd919('0x36')]);_0x3c4cfa[_0xd919('0x3b')]=_['intersection'](_0x450640[_0xd919('0x3a')],qs['fields'](_0x1426b3['query'][_0xd919('0x4c')]));_0x3c4cfa[_0xd919('0x3b')]=_0x3c4cfa[_0xd919('0x3b')][_0xd919('0x3c')]?_0x3c4cfa['attributes']:_0x450640[_0xd919('0x3a')];if(_0x1426b3[_0xd919('0x36')][_0xd919('0x46')]){_0x3c4cfa['include']=[{'all':!![]}];}_0x3c4cfa=_['merge']({},_0x3c4cfa,_0x1426b3[_0xd919('0x45')]);return db[_0xd919('0x31')]['find'](_0x3c4cfa)[_0xd919('0x17')](handleEntityNotFound(_0x17a883,null))[_0xd919('0x17')](respondWithResult(_0x17a883,null))[_0xd919('0x1f')](handleError(_0x17a883,null));};exports[_0xd919('0x4d')]=function(_0x3d7e18,_0x5ae6e5){if(_0x3d7e18[_0xd919('0x4e')]['id']){delete _0x3d7e18['body']['id'];}return db[_0xd919('0x31')][_0xd919('0x4f')]({'where':{'id':_0x3d7e18['params']['id']}})[_0xd919('0x17')](handleEntityNotFound(_0x5ae6e5,null))['then'](saveUpdates(_0x3d7e18[_0xd919('0x4e')],null))[_0xd919('0x17')](respondWithResult(_0x5ae6e5,null))[_0xd919('0x1f')](handleError(_0x5ae6e5,null));};exports[_0xd919('0x50')]=function(_0x284999,_0x234e77,_0x2a654f){if(_0x284999['file']&&_0x284999[_0xd919('0x51')][_0xd919('0x52')]){_0x284999[_0xd919('0x4e')][_0xd919('0x53')]=_0x284999[_0xd919('0x51')]['filename'];}return db[_0xd919('0x31')][_0xd919('0x4f')]({'where':{'id':_0x284999[_0xd919('0x4b')]['id']}})[_0xd919('0x17')](handleEntityNotFound(_0x234e77,null))[_0xd919('0x17')](saveUpdates(_0x284999['body'],null))[_0xd919('0x17')](respondWithResult(_0x234e77,null))[_0xd919('0x1f')](handleError(_0x234e77,null));};exports[_0xd919('0x54')]=function(_0x2f72cc,_0x4eb0a0,_0x589568){if(_0x2f72cc[_0xd919('0x51')]&&_0x2f72cc[_0xd919('0x51')]['filename']){_0x2f72cc['body']['loginLogo']=_0x2f72cc['file'][_0xd919('0x52')];}return db[_0xd919('0x31')][_0xd919('0x4f')]({'where':{'id':_0x2f72cc[_0xd919('0x4b')]['id']}})[_0xd919('0x17')](handleEntityNotFound(_0x4eb0a0,null))[_0xd919('0x17')](saveUpdates(_0x2f72cc[_0xd919('0x4e')],null))['then'](respondWithResult(_0x4eb0a0,null))[_0xd919('0x1f')](handleError(_0x4eb0a0,null));};var utilLicense=require(_0xd919('0x14'));exports[_0xd919('0x55')]=function(_0x56b04e,_0x1eea6c,_0x2d8a23){var _0x493e42='server/files/images/logos';var _0x3b52a1={'custom':![]};return utilLicense[_0xd919('0x56')]()['then'](function(_0x3a78bf){if(_0x3a78bf){_0x3b52a1=_0x3a78bf;}return db[_0xd919('0x31')][_0xd919('0x4f')]({'where':{'id':_0x56b04e[_0xd919('0x4b')]['id']},'attributes':[_0xd919('0x53'),_0xd919('0x57'),'preferred',_0xd919('0x58'),'defaultLogo',_0xd919('0x59'),'defaultPreferred',_0xd919('0x5a')],'raw':!![]});})[_0xd919('0x17')](handleEntityNotFound(_0x1eea6c,null))[_0xd919('0x17')](function(_0x234f70){if(_0x234f70){var _0x531270=_0x234f70[_0xd919('0x53')]&&fs[_0xd919('0x5b')](path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x493e42,_['toLower'](_0x234f70[_0xd919('0x53')])))?path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x493e42,_['toLower'](_0x234f70[_0xd919('0x53')])):path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x493e42,_[_0xd919('0x5e')](_0xd919('0x5f')));var _0x5ee805=_0xd919('0x60')+_['upperFirst'](_0xd919('0x53'));if(_0x234f70[_0x5ee805]||!_0x3b52a1[_0xd919('0x61')]){_0x531270=path['join'](config[_0xd919('0x5d')],_0x493e42,_[_0xd919('0x5e')](_0xd919('0x5f')));}if(!fs[_0xd919('0x5b')](_0x531270)){throw new db[(_0xd919('0x62'))][(_0xd919('0x63'))](_['upperFirst'](_0xd919('0x53'))+_0xd919('0x64'));}return _0x1eea6c[_0xd919('0x65')](_0x531270);}})[_0xd919('0x1f')](handleError(_0x1eea6c,null));};var utilLicense=require('../../config/license/util');exports[_0xd919('0x66')]=function(_0x2ed445,_0x370407,_0x4a20eb){var _0x1f8ed2='server/files/images/logos';var _0x596180={'custom':![]};return utilLicense[_0xd919('0x56')]()[_0xd919('0x17')](function(_0x20aa05){if(_0x20aa05){_0x596180=_0x20aa05;}return db[_0xd919('0x31')][_0xd919('0x4f')]({'where':{'id':_0x2ed445[_0xd919('0x4b')]['id']},'attributes':[_0xd919('0x53'),_0xd919('0x57'),_0xd919('0x67'),_0xd919('0x58'),'defaultLogo',_0xd919('0x59'),_0xd919('0x68'),_0xd919('0x5a')],'raw':!![]});})[_0xd919('0x17')](handleEntityNotFound(_0x370407,null))['then'](function(_0x5b54eb){if(_0x5b54eb){var _0x5324f8=_0x5b54eb[_0xd919('0x57')]&&fs[_0xd919('0x5b')](path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x1f8ed2,_[_0xd919('0x5e')](_0x5b54eb[_0xd919('0x57')])))?path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x1f8ed2,_[_0xd919('0x5e')](_0x5b54eb['loginLogo'])):path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x1f8ed2,_[_0xd919('0x5e')](_0xd919('0x69')));var _0x22c4d5=_0xd919('0x60')+_[_0xd919('0x6a')]('loginLogo');if(_0x5b54eb[_0x22c4d5]||!_0x596180[_0xd919('0x61')]){_0x5324f8=path['join'](config[_0xd919('0x5d')],_0x1f8ed2,_[_0xd919('0x5e')](_0xd919('0x69')));}if(!fs[_0xd919('0x5b')](_0x5324f8)){throw new db[(_0xd919('0x62'))][(_0xd919('0x63'))](_[_0xd919('0x6a')](_0xd919('0x57'))+'\x20not\x20found');}return _0x370407['download'](_0x5324f8);}})['catch'](handleError(_0x370407,null));};exports['gdpr']=function(_0x5cb43c,_0x56d7d6){return db[_0xd919('0x31')][_0xd919('0x4f')]({'where':{'id':_0x5cb43c['params']['id']},'attributes':[_0xd919('0x6b')]})['then'](respondWithResult(_0x56d7d6,null))[_0xd919('0x1f')](handleError(_0x56d7d6,null));};exports[_0xd919('0x6c')]=function(_0x4e0618,_0x135283,_0x5b2c8b){if(_0x4e0618[_0xd919('0x51')]&&_0x4e0618[_0xd919('0x51')][_0xd919('0x52')]){_0x4e0618['body'][_0xd919('0x67')]=_0x4e0618[_0xd919('0x51')]['filename'];}return db[_0xd919('0x31')][_0xd919('0x4f')]({'where':{'id':_0x4e0618[_0xd919('0x4b')]['id']}})[_0xd919('0x17')](handleEntityNotFound(_0x135283,null))[_0xd919('0x17')](saveUpdates(_0x4e0618[_0xd919('0x4e')],null))[_0xd919('0x17')](respondWithResult(_0x135283,null))[_0xd919('0x1f')](handleError(_0x135283,null));};var utilLicense=require(_0xd919('0x14'));exports[_0xd919('0x6d')]=function(_0x347868,_0x4fddfb,_0x521623){var _0x293fe3=_0xd919('0x6e');var _0x318ca8={'custom':![]};return utilLicense[_0xd919('0x56')]()[_0xd919('0x17')](function(_0x1df7e5){if(_0x1df7e5){_0x318ca8=_0x1df7e5;}return db[_0xd919('0x31')]['find']({'where':{'id':_0x347868[_0xd919('0x4b')]['id']},'attributes':[_0xd919('0x53'),_0xd919('0x57'),_0xd919('0x67'),_0xd919('0x58'),'defaultLogo','defaultLoginLogo',_0xd919('0x68'),_0xd919('0x5a')],'raw':!![]});})[_0xd919('0x17')](handleEntityNotFound(_0x4fddfb,null))[_0xd919('0x17')](function(_0x44600a){if(_0x44600a){var _0x42f6ee=_0x44600a[_0xd919('0x67')]&&fs[_0xd919('0x5b')](path['join'](config[_0xd919('0x5d')],_0x293fe3,_[_0xd919('0x5e')](_0x44600a[_0xd919('0x67')])))?path['join'](config['root'],_0x293fe3,_[_0xd919('0x5e')](_0x44600a[_0xd919('0x67')])):path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x293fe3,_[_0xd919('0x5e')](_0xd919('0x6f')));var _0x224faf=_0xd919('0x60')+_[_0xd919('0x6a')](_0xd919('0x67'));if(_0x44600a[_0x224faf]||!_0x318ca8[_0xd919('0x61')]||!_0x318ca8['preferred']){_0x42f6ee=path['join'](config[_0xd919('0x5d')],_0x293fe3,_[_0xd919('0x5e')](_0xd919('0x6f')));}if(!fs[_0xd919('0x5b')](_0x42f6ee)){throw new db['Sequelize'][(_0xd919('0x63'))](_[_0xd919('0x6a')](_0xd919('0x67'))+_0xd919('0x64'));}return _0x4fddfb[_0xd919('0x65')](_0x42f6ee);}})[_0xd919('0x1f')](handleError(_0x4fddfb,null));};exports['addFavicon']=function(_0x37a65f,_0x2ca26f,_0x33fa70){if(_0x37a65f[_0xd919('0x51')]&&_0x37a65f['file'][_0xd919('0x52')]){_0x37a65f['body']['favicon']=_0x37a65f['file']['filename'];}return db[_0xd919('0x31')]['find']({'where':{'id':_0x37a65f[_0xd919('0x4b')]['id']}})[_0xd919('0x17')](handleEntityNotFound(_0x2ca26f,null))[_0xd919('0x17')](saveUpdates(_0x37a65f[_0xd919('0x4e')],null))[_0xd919('0x17')](respondWithResult(_0x2ca26f,null))[_0xd919('0x1f')](handleError(_0x2ca26f,null));};var utilLicense=require('../../config/license/util');exports[_0xd919('0x70')]=function(_0x2d73e9,_0x17a6e4,_0x54d090){var _0x4de295=_0xd919('0x6e');var _0x51eed0={'custom':![]};return utilLicense[_0xd919('0x56')]()[_0xd919('0x17')](function(_0x2a0d14){if(_0x2a0d14){_0x51eed0=_0x2a0d14;}return db[_0xd919('0x31')]['find']({'where':{'id':_0x2d73e9[_0xd919('0x4b')]['id']},'attributes':[_0xd919('0x53'),_0xd919('0x57'),_0xd919('0x67'),_0xd919('0x58'),_0xd919('0x71'),_0xd919('0x59'),'defaultPreferred',_0xd919('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x17a6e4,null))['then'](function(_0x2d38fd){if(_0x2d38fd){var _0x181b94=_0x2d38fd['favicon']&&fs[_0xd919('0x5b')](path['join'](config[_0xd919('0x5d')],_0x4de295,_[_0xd919('0x5e')](_0x2d38fd[_0xd919('0x58')])))?path[_0xd919('0x5c')](config['root'],_0x4de295,_['toLower'](_0x2d38fd['favicon'])):path[_0xd919('0x5c')](config['root'],_0x4de295,_['toLower'](_0xd919('0x72')));var _0xa808e2=_0xd919('0x60')+_[_0xd919('0x6a')](_0xd919('0x58'));if(_0x2d38fd[_0xa808e2]||!_0x51eed0[_0xd919('0x61')]){_0x181b94=path[_0xd919('0x5c')](config[_0xd919('0x5d')],_0x4de295,_['toLower'](_0xd919('0x72')));}if(!fs[_0xd919('0x5b')](_0x181b94)){throw new db[(_0xd919('0x62'))]['ValidationError'](_[_0xd919('0x6a')]('favicon')+_0xd919('0x64'));}return _0x17a6e4[_0xd919('0x65')](_0x181b94);}})[_0xd919('0x1f')](handleError(_0x17a6e4,null));};exports[_0xd919('0x73')]=function(_0x1cddf9,_0x3214bf){var _0x9dacaf={'offset':moment()[_0xd919('0x74')]()};_0x9dacaf['now']=moment()['utcOffset'](_0x9dacaf[_0xd919('0x23')])[_0xd919('0x75')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x3214bf[_0xd919('0x21')](0xc8)['send'](_0x9dacaf);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 6188400..f54cf38 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x44f4c5,_0x60cd8b){var _0x35cf6a=function(_0x43a904){while(--_0x43a904){_0x44f4c5['push'](_0x44f4c5['shift']());}};_0x35cf6a(++_0x60cd8b);}(_0x008c,0x188));var _0xc008=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x008c[_0xa6cb09];return _0x12b437;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x55ca,0x126));var _0xa55c=function(_0x21f3c3,_0x42e32c){_0x21f3c3=_0x21f3c3-0x0;var _0x15957=_0x55ca[_0x21f3c3];return _0x15957;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 9de24f9..ce32557 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 _0xc067=['Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','ShowSetting','Setting','find','options','raw','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Setting,\x20%s,\x20%s'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xc067,0xac));var _0x7c06=function(_0x190c49,_0x103457){_0x190c49=_0x190c49-0x0;var _0x475b9a=_0xc067[_0x190c49];return _0x475b9a;};'use strict';var _=require(_0x7c06('0x0'));var util=require(_0x7c06('0x1'));var moment=require(_0x7c06('0x2'));var BPromise=require(_0x7c06('0x3'));var rs=require(_0x7c06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c06('0x5'))['db'];var utils=require(_0x7c06('0x6'));var logger=require('../../config/logger')(_0x7c06('0x7'));var config=require(_0x7c06('0x8'));var jayson=require(_0x7c06('0x9'));var client=jayson['client'][_0x7c06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11502f,_0xd9bc77,_0xe1964c){return new BPromise(function(_0x549c5e,_0x4fa46a){return client[_0x7c06('0xb')](_0x11502f,_0xe1964c)[_0x7c06('0xc')](function(_0x46f8c0){logger['info'](_0x7c06('0xd'),_0xd9bc77,'request\x20sent');logger['debug'](_0x7c06('0xe'),_0xd9bc77,_0x7c06('0xf'),JSON[_0x7c06('0x10')](_0x46f8c0));if(_0x46f8c0['error']){if(_0x46f8c0[_0x7c06('0x11')]['code']===0x1f4){logger[_0x7c06('0x11')](_0x7c06('0xd'),_0xd9bc77,_0x46f8c0[_0x7c06('0x11')][_0x7c06('0x12')]);return _0x4fa46a(_0x46f8c0[_0x7c06('0x11')][_0x7c06('0x12')]);}logger[_0x7c06('0x11')](_0x7c06('0xd'),_0xd9bc77,_0x46f8c0[_0x7c06('0x11')][_0x7c06('0x12')]);return _0x549c5e(_0x46f8c0[_0x7c06('0x11')][_0x7c06('0x12')]);}else{logger[_0x7c06('0x13')](_0x7c06('0xd'),_0xd9bc77,'request\x20sent');_0x549c5e(_0x46f8c0[_0x7c06('0x14')][_0x7c06('0x12')]);}})['catch'](function(_0x34ea57){logger[_0x7c06('0x11')](_0x7c06('0xd'),_0xd9bc77,_0x34ea57);_0x4fa46a(_0x34ea57);});});}exports[_0x7c06('0x15')]=function(_0x35eeb4){var _0x23cbeb=this;return new Promise(function(_0x31b849,_0x18368d){return db[_0x7c06('0x16')][_0x7c06('0x17')]({'raw':_0x35eeb4[_0x7c06('0x18')]?_0x35eeb4['options'][_0x7c06('0x19')]===undefined?!![]:![]:!![],'where':_0x35eeb4['options']?_0x35eeb4['options']['where']||null:null,'attributes':_0x35eeb4[_0x7c06('0x18')]?_0x35eeb4[_0x7c06('0x18')][_0x7c06('0x1a')]||null:null,'include':_0x35eeb4[_0x7c06('0x18')]?_0x35eeb4['options'][_0x7c06('0x1b')]?_['map'](_0x35eeb4[_0x7c06('0x18')]['include'],function(_0x1445b2){return{'model':db[_0x1445b2[_0x7c06('0x1c')]],'as':_0x1445b2['as'],'attributes':_0x1445b2[_0x7c06('0x1a')],'include':_0x1445b2[_0x7c06('0x1b')]?_[_0x7c06('0x1d')](_0x1445b2[_0x7c06('0x1b')],function(_0x51f308){return{'model':db[_0x51f308['model']],'as':_0x51f308['as'],'attributes':_0x51f308['attributes'],'include':_0x51f308[_0x7c06('0x1b')]?_[_0x7c06('0x1d')](_0x51f308[_0x7c06('0x1b')],function(_0x523509){return{'model':db[_0x523509[_0x7c06('0x1c')]],'as':_0x523509['as'],'attributes':_0x523509[_0x7c06('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7c06('0xc')](function(_0x135201){logger[_0x7c06('0x13')](_0x7c06('0x15'),_0x35eeb4);logger[_0x7c06('0x1e')](_0x7c06('0x15'),_0x35eeb4,JSON[_0x7c06('0x10')](_0x135201));_0x31b849(_0x135201);})['catch'](function(_0x31f077){logger['error'](_0x7c06('0x15'),_0x31f077[_0x7c06('0x12')],_0x35eeb4);_0x18368d(_0x23cbeb[_0x7c06('0x11')](0x1f4,_0x31f077[_0x7c06('0x12')]));});});}; \ No newline at end of file +var _0xbd39=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','options','attributes','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Setting,\x20%s,\x20%s'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0xbd39,0x184));var _0x9bd3=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbd39[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x9bd3('0x0'));var moment=require(_0x9bd3('0x1'));var BPromise=require(_0x9bd3('0x2'));var rs=require(_0x9bd3('0x3'));var fs=require('fs');var Redis=require(_0x9bd3('0x4'));var db=require(_0x9bd3('0x5'))['db'];var utils=require(_0x9bd3('0x6'));var logger=require(_0x9bd3('0x7'))(_0x9bd3('0x8'));var config=require(_0x9bd3('0x9'));var jayson=require(_0x9bd3('0xa'));var client=jayson[_0x9bd3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50f387,_0x318397,_0x186577){return new BPromise(function(_0x39fcef,_0x3091bc){return client[_0x9bd3('0xc')](_0x50f387,_0x186577)['then'](function(_0x1a996e){logger[_0x9bd3('0xd')](_0x9bd3('0xe'),_0x318397,_0x9bd3('0xf'));logger[_0x9bd3('0x10')](_0x9bd3('0x11'),_0x318397,'request\x20sent',JSON[_0x9bd3('0x12')](_0x1a996e));if(_0x1a996e[_0x9bd3('0x13')]){if(_0x1a996e[_0x9bd3('0x13')][_0x9bd3('0x14')]===0x1f4){logger['error'](_0x9bd3('0xe'),_0x318397,_0x1a996e[_0x9bd3('0x13')]['message']);return _0x3091bc(_0x1a996e['error'][_0x9bd3('0x15')]);}logger[_0x9bd3('0x13')](_0x9bd3('0xe'),_0x318397,_0x1a996e[_0x9bd3('0x13')]['message']);return _0x39fcef(_0x1a996e[_0x9bd3('0x13')][_0x9bd3('0x15')]);}else{logger[_0x9bd3('0xd')](_0x9bd3('0xe'),_0x318397,'request\x20sent');_0x39fcef(_0x1a996e['result'][_0x9bd3('0x15')]);}})[_0x9bd3('0x16')](function(_0x5cc174){logger[_0x9bd3('0x13')](_0x9bd3('0xe'),_0x318397,_0x5cc174);_0x3091bc(_0x5cc174);});});}exports[_0x9bd3('0x17')]=function(_0x244e47){var _0x43259c=this;return new Promise(function(_0x8f3d66,_0x36325f){return db[_0x9bd3('0x18')]['find']({'raw':_0x244e47[_0x9bd3('0x19')]?_0x244e47['options']['raw']===undefined?!![]:![]:!![],'where':_0x244e47['options']?_0x244e47['options']['where']||null:null,'attributes':_0x244e47['options']?_0x244e47[_0x9bd3('0x19')][_0x9bd3('0x1a')]||null:null,'include':_0x244e47['options']?_0x244e47[_0x9bd3('0x19')]['include']?_[_0x9bd3('0x1b')](_0x244e47['options'][_0x9bd3('0x1c')],function(_0x540a25){return{'model':db[_0x540a25[_0x9bd3('0x1d')]],'as':_0x540a25['as'],'attributes':_0x540a25[_0x9bd3('0x1a')],'include':_0x540a25[_0x9bd3('0x1c')]?_['map'](_0x540a25['include'],function(_0x3a0ad3){return{'model':db[_0x3a0ad3[_0x9bd3('0x1d')]],'as':_0x3a0ad3['as'],'attributes':_0x3a0ad3[_0x9bd3('0x1a')],'include':_0x3a0ad3[_0x9bd3('0x1c')]?_[_0x9bd3('0x1b')](_0x3a0ad3[_0x9bd3('0x1c')],function(_0xe6b46c){return{'model':db[_0xe6b46c[_0x9bd3('0x1d')]],'as':_0xe6b46c['as'],'attributes':_0xe6b46c[_0x9bd3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9bd3('0x1e')](function(_0x57df33){logger[_0x9bd3('0xd')]('ShowSetting',_0x244e47);logger['debug'](_0x9bd3('0x17'),_0x244e47,JSON[_0x9bd3('0x12')](_0x57df33));_0x8f3d66(_0x57df33);})[_0x9bd3('0x16')](function(_0x5be8fd){logger[_0x9bd3('0x13')](_0x9bd3('0x17'),_0x5be8fd['message'],_0x244e47);_0x36325f(_0x43259c[_0x9bd3('0x13')](0x1f4,_0x5be8fd['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8c25893..dc21460 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 _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x50e603,_0x59c385){var _0x53b214=function(_0x317371){while(--_0x317371){_0x50e603['push'](_0x50e603['shift']());}};_0x53b214(++_0x59c385);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file +var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0xad5abd,_0x47722e){var _0x4a2680=function(_0x2b92f7){while(--_0x2b92f7){_0xad5abd['push'](_0xad5abd['shift']());}};_0x4a2680(++_0x47722e);}(_0x53ec,0x192));var _0xc53e=function(_0x5980e4,_0x44ec9c){_0x5980e4=_0x5980e4-0x0;var _0x429716=_0x53ec[_0x5980e4];return _0x429716;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 83bdba7..00440df 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 _0x69c3=['BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x69c3,0x18f));var _0x369c=function(_0x40dc12,_0x33e71e){_0x40dc12=_0x40dc12-0x0;var _0xddf339=_0x69c3[_0x40dc12];return _0xddf339;};'use strict';var Sequelize=require(_0x369c('0x0'));var rs=require(_0x369c('0x1'));module[_0x369c('0x2')]={'name':{'type':Sequelize[_0x369c('0x3')],'unique':_0x369c('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x369c('0x5')]();}},'phone':{'type':Sequelize[_0x369c('0x3')]},'type':{'type':Sequelize[_0x369c('0x6')](_0x369c('0x7'),_0x369c('0x8'),_0x369c('0x9'),_0x369c('0xa'),_0x369c('0xb'),_0x369c('0xc'),_0x369c('0xd'),_0x369c('0xe'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x369c('0x3')]},'authId':{'type':Sequelize[_0x369c('0x3')]},'authToken':{'type':Sequelize[_0x369c('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x369c('0x3')]},'password':{'type':Sequelize[_0x369c('0x3')]},'apiKey':{'type':Sequelize[_0x369c('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x369c('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x369c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x369c('0x10')],'defaultValue':function(){return _0x369c('0x11');}},'notificationSound':{'type':Sequelize[_0x369c('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x369c('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x369c('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x369c('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x369c('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x369c('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x369c('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x369c('0x12')],'comment':_0x369c('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x369c('0x14'),'set':function(_0x491f46){if(!_0x491f46)this[_0x369c('0x15')](_0x369c('0x16'),null);this[_0x369c('0x15')]('mandatoryDisposition',_0x491f46);}}}; \ No newline at end of file +var _0x0c64=['plivo','clickatell','bandwidth','csc','infobip','intelepeer','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','clicksend'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x0c64,0x142));var _0x40c6=function(_0x22db36,_0x443d53){_0x22db36=_0x22db36-0x0;var _0x267a08=_0x0c64[_0x22db36];return _0x267a08;};'use strict';var Sequelize=require(_0x40c6('0x0'));var rs=require('randomstring');module[_0x40c6('0x1')]={'name':{'type':Sequelize[_0x40c6('0x2')],'unique':_0x40c6('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x40c6('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x40c6('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x40c6('0x2')],'defaultValue':function(){return rs[_0x40c6('0x4')]();}},'phone':{'type':Sequelize[_0x40c6('0x2')]},'type':{'type':Sequelize[_0x40c6('0x5')](_0x40c6('0x6'),'skebby','connectel',_0x40c6('0x7'),_0x40c6('0x8'),_0x40c6('0x9'),_0x40c6('0xa'),_0x40c6('0xb'),_0x40c6('0xc'),_0x40c6('0xd'))},'accountSid':{'type':Sequelize[_0x40c6('0x2')]},'authId':{'type':Sequelize[_0x40c6('0x2')]},'authToken':{'type':Sequelize[_0x40c6('0x2')]},'smsMethod':{'type':Sequelize[_0x40c6('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x40c6('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x40c6('0x2')]},'applicationId':{'type':Sequelize[_0x40c6('0x2')]},'accountId':{'type':Sequelize[_0x40c6('0x2')]},'senderString':{'type':Sequelize[_0x40c6('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x40c6('0xe');}},'notificationSound':{'type':Sequelize[_0x40c6('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x40c6('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x40c6('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x40c6('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x40c6('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x40c6('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x40c6('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x40c6('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x40c6('0xf')],'defaultValue':![],'comment':_0x40c6('0x12'),'set':function(_0x4a0ab4){if(!_0x4a0ab4)this[_0x40c6('0x13')](_0x40c6('0x14'),null);this[_0x40c6('0x13')](_0x40c6('0x15'),_0x4a0ab4);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index bddbfd7..3d784ed 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 _0x2ede=['transaction','Transaction','ISOLATION_LEVELS','finally','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','inspect','skebby','skebby_dispatch_id','statusInt','status_code','groupName','bandwidth','redif','DELIVERED','update','connectel','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','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','Pause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','params','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','sender','text','clicksend','message_id','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','entity\x20found','stringify','Content-Type','text/xml','addApplications','sequelize'];(function(_0x98362a,_0x56065d){var _0x239cd0=function(_0x51d882){while(--_0x51d882){_0x98362a['push'](_0x98362a['shift']());}};_0x239cd0(++_0x56065d);}(_0x2ede,0x10d));var _0xe2ed=function(_0x28f5ff,_0x4cec42){_0x28f5ff=_0x28f5ff-0x0;var _0x166f0e=_0x2ede[_0x28f5ff];return _0x166f0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2ed('0x0'));var zipdir=require(_0xe2ed('0x1'));var jsonpatch=require(_0xe2ed('0x2'));var rp=require(_0xe2ed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe2ed('0x4'));var util=require('util');var path=require(_0xe2ed('0x5'));var sox=require(_0xe2ed('0x6'));var csv=require('to-csv');var ejs=require(_0xe2ed('0x7'));var fs=require('fs');var fs_extra=require(_0xe2ed('0x8'));var _=require(_0xe2ed('0x9'));var squel=require('squel');var crypto=require(_0xe2ed('0xa'));var jsforce=require(_0xe2ed('0xb'));var deskjs=require(_0xe2ed('0xc'));var toCsv=require(_0xe2ed('0xd'));var querystring=require(_0xe2ed('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2ed('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2ed('0x10'));var logger=require(_0xe2ed('0x11'))(_0xe2ed('0x12'));var utils=require(_0xe2ed('0x13'));var config=require(_0xe2ed('0x14'));var licenseUtil=require(_0xe2ed('0x15'));var db=require(_0xe2ed('0x16'))['db'];config[_0xe2ed('0x17')]=_['defaults'](config[_0xe2ed('0x17')],{'host':_0xe2ed('0x18'),'port':0x18eb});var socket=require(_0xe2ed('0x19'))(new Redis(config[_0xe2ed('0x17')]));require('./smsAccount.socket')[_0xe2ed('0x1a')](socket);var jayson=require(_0xe2ed('0x1b'));var client=jayson[_0xe2ed('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3ea4d5,_0x15a7ea,_0x4b30cb,_0x2ba834){return new BPromise(function(_0x32feed,_0x3e4e3f){var _0x453cad=_0x2ba834||client;return _0x453cad[_0xe2ed('0x1d')](_0x3ea4d5,_0x4b30cb)[_0xe2ed('0x1e')](function(_0x1c8136){logger[_0xe2ed('0x1f')](_0xe2ed('0x20'),_0x15a7ea,_0xe2ed('0x21'));logger[_0xe2ed('0x22')](_0xe2ed('0x23'),_0x15a7ea,_0xe2ed('0x21'),JSON['stringify'](_0x1c8136));if(_0x1c8136[_0xe2ed('0x24')]){if(_0x1c8136['error'][_0xe2ed('0x25')]===0x1f4){logger[_0xe2ed('0x24')]('SmsAccount,\x20%s,\x20%s',_0x15a7ea,_0x1c8136['error'][_0xe2ed('0x26')]);return _0x3e4e3f(_0x1c8136[_0xe2ed('0x24')]['message']);}logger[_0xe2ed('0x24')](_0xe2ed('0x20'),_0x15a7ea,_0x1c8136[_0xe2ed('0x24')][_0xe2ed('0x26')]);return _0x32feed(_0x1c8136[_0xe2ed('0x24')][_0xe2ed('0x26')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x15a7ea,'request\x20sent');_0x32feed(_0x1c8136[_0xe2ed('0x27')][_0xe2ed('0x26')]);}})['catch'](function(_0x33ee9e){logger[_0xe2ed('0x24')]('SmsAccount,\x20%s,\x20%s',_0x15a7ea,_0x33ee9e);_0x3e4e3f(_0x33ee9e);});});}function respondWithStatusCode(_0x3ac9d8,_0x1bc938){_0x1bc938=_0x1bc938||0xcc;return function(_0x43a0e4){if(_0x43a0e4){return _0x3ac9d8[_0xe2ed('0x28')](_0x1bc938);}return _0x3ac9d8[_0xe2ed('0x29')](_0x1bc938)['end']();};}function respondWithResult(_0x507a8a,_0x5048b5){_0x5048b5=_0x5048b5||0xc8;return function(_0x59fd31){if(_0x59fd31){return _0x507a8a[_0xe2ed('0x29')](_0x5048b5)[_0xe2ed('0x2a')](_0x59fd31);}};}function respondWithFilteredResult(_0x5b042d,_0x33d76c){return function(_0x288273){if(_0x288273){var _0x2b9c18=typeof _0x33d76c[_0xe2ed('0x2b')]==='undefined'&&typeof _0x33d76c[_0xe2ed('0x2c')]==='undefined';var _0x279d3c=_0x288273['count'];var _0x359ec3=_0x2b9c18?0x0:_0x33d76c[_0xe2ed('0x2b')];var _0x2f8ada=_0x2b9c18?_0x288273[_0xe2ed('0x2d')]:_0x33d76c[_0xe2ed('0x2b')]+_0x33d76c[_0xe2ed('0x2c')];var _0x17cf91;if(_0x2f8ada>=_0x279d3c){_0x2f8ada=_0x279d3c;_0x17cf91=0xc8;}else{_0x17cf91=0xce;}_0x5b042d['status'](_0x17cf91);return _0x5b042d[_0xe2ed('0x2e')](_0xe2ed('0x2f'),_0x359ec3+'-'+_0x2f8ada+'/'+_0x279d3c)[_0xe2ed('0x2a')](_0x288273);}return null;};}function patchUpdates(_0x20914d){return function(_0x366d33){try{jsonpatch[_0xe2ed('0x30')](_0x366d33,_0x20914d,!![]);}catch(_0x5dd7ae){return BPromise[_0xe2ed('0x31')](_0x5dd7ae);}return _0x366d33[_0xe2ed('0x32')]();};}function saveUpdates(_0x3fb855,_0x3cac4b){return function(_0x6ba8f){if(_0x6ba8f){return _0x6ba8f['update'](_0x3fb855)['then'](function(_0x304a5d){return _0x304a5d;});}return null;};}function removeEntity(_0x10e0bc,_0xcd9136){return function(_0x3fae67){if(_0x3fae67){return _0x3fae67[_0xe2ed('0x33')]()[_0xe2ed('0x1e')](function(){var _0xf6d937=_0x3fae67[_0xe2ed('0x34')]({'plain':!![]});var _0xc9a7c4=_0xe2ed('0x35');return db[_0xe2ed('0x36')][_0xe2ed('0x33')]({'where':{'type':_0xc9a7c4,'resourceId':_0xf6d937['id']}})['then'](function(){return _0x3fae67;});})[_0xe2ed('0x1e')](function(){_0x10e0bc[_0xe2ed('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c2d1a,_0x45d1ae){return function(_0x27e56d){if(!_0x27e56d){_0x1c2d1a[_0xe2ed('0x28')](0x194);}return _0x27e56d;};}function handleError(_0x58dadc,_0x57e459){_0x57e459=_0x57e459||0x1f4;return function(_0xbd558b){logger['error'](_0xbd558b[_0xe2ed('0x37')]);if(_0xbd558b[_0xe2ed('0x38')]){delete _0xbd558b[_0xe2ed('0x38')];}_0x58dadc[_0xe2ed('0x29')](_0x57e459)[_0xe2ed('0x39')](_0xbd558b);};}exports[_0xe2ed('0x3a')]=function(_0x5d96a4,_0x458261){var _0x209795={'include':[{'model':db['Pause'],'as':_0xe2ed('0x3b')}]},_0x5ecdb9={},_0x510262={'count':0x0,'rows':[]};var _0x9de89f=_[_0xe2ed('0x3c')](db[_0xe2ed('0x3d')]['rawAttributes'],function(_0x4a90d0){return{'name':_0x4a90d0['fieldName'],'type':_0x4a90d0[_0xe2ed('0x3e')][_0xe2ed('0x3f')]};});_0x5ecdb9[_0xe2ed('0x40')]=_[_0xe2ed('0x3c')](_0x9de89f,_0xe2ed('0x38'));_0x5ecdb9['query']=_[_0xe2ed('0x41')](_0x5d96a4['query']);_0x5ecdb9['filters']=_['intersection'](_0x5ecdb9[_0xe2ed('0x40')],_0x5ecdb9[_0xe2ed('0x42')]);_0x209795[_0xe2ed('0x43')]=_[_0xe2ed('0x44')](_0x5ecdb9['model'],qs[_0xe2ed('0x45')](_0x5d96a4['query'][_0xe2ed('0x45')]));_0x209795[_0xe2ed('0x43')]=_0x209795[_0xe2ed('0x43')][_0xe2ed('0x46')]?_0x209795[_0xe2ed('0x43')]:_0x5ecdb9[_0xe2ed('0x40')];if(!_0x5d96a4['query'][_0xe2ed('0x47')](_0xe2ed('0x48'))){_0x209795[_0xe2ed('0x2c')]=qs[_0xe2ed('0x2c')](_0x5d96a4[_0xe2ed('0x42')][_0xe2ed('0x2c')]);_0x209795[_0xe2ed('0x2b')]=qs[_0xe2ed('0x2b')](_0x5d96a4[_0xe2ed('0x42')][_0xe2ed('0x2b')]);}_0x209795[_0xe2ed('0x49')]=qs[_0xe2ed('0x4a')](_0x5d96a4[_0xe2ed('0x42')]['sort']);_0x209795[_0xe2ed('0x4b')]=qs[_0xe2ed('0x4c')](_[_0xe2ed('0x4d')](_0x5d96a4[_0xe2ed('0x42')],_0x5ecdb9['filters']),_0x9de89f);if(_0x5d96a4[_0xe2ed('0x42')]['filter']){_0x209795[_0xe2ed('0x4b')]=_['merge'](_0x209795[_0xe2ed('0x4b')],{'$or':_[_0xe2ed('0x3c')](_0x9de89f,function(_0x59fa0d){if(_0x59fa0d[_0xe2ed('0x3e')]!==_0xe2ed('0x4e')){var _0x4fabbd={};_0x4fabbd[_0x59fa0d[_0xe2ed('0x38')]]={'$like':'%'+_0x5d96a4[_0xe2ed('0x42')][_0xe2ed('0x4f')]+'%'};return _0x4fabbd;}})});}_0x209795=_[_0xe2ed('0x50')]({},_0x209795,_0x5d96a4[_0xe2ed('0x51')]);var _0x4da2ca={'where':_0x209795[_0xe2ed('0x4b')]};return db['SmsAccount'][_0xe2ed('0x2d')](_0x4da2ca)['then'](function(_0x3d74b4){_0x510262[_0xe2ed('0x2d')]=_0x3d74b4;if(_0x5d96a4[_0xe2ed('0x42')][_0xe2ed('0x52')]){_0x209795[_0xe2ed('0x53')]=[{'all':!![]}];}return db[_0xe2ed('0x3d')][_0xe2ed('0x54')](_0x209795);})[_0xe2ed('0x1e')](function(_0x493d93){_0x510262[_0xe2ed('0x55')]=_0x493d93;return _0x510262;})['then'](respondWithFilteredResult(_0x458261,_0x209795))[_0xe2ed('0x56')](handleError(_0x458261,null));};exports[_0xe2ed('0x57')]=function(_0x3bb90b,_0x5499e4){var _0x588d0b={'raw':![],'where':{'id':_0x3bb90b['params']['id']},'include':[{'model':db['Pause'],'as':_0xe2ed('0x3b')}]},_0x5636d8={};_0x5636d8['model']=_[_0xe2ed('0x41')](db['SmsAccount'][_0xe2ed('0x58')]);_0x5636d8['query']=_[_0xe2ed('0x41')](_0x3bb90b[_0xe2ed('0x42')]);_0x5636d8['filters']=_[_0xe2ed('0x44')](_0x5636d8[_0xe2ed('0x40')],_0x5636d8['query']);_0x588d0b[_0xe2ed('0x43')]=_[_0xe2ed('0x44')](_0x5636d8[_0xe2ed('0x40')],qs[_0xe2ed('0x45')](_0x3bb90b[_0xe2ed('0x42')][_0xe2ed('0x45')]));_0x588d0b['attributes']=_0x588d0b['attributes'][_0xe2ed('0x46')]?_0x588d0b[_0xe2ed('0x43')]:_0x5636d8[_0xe2ed('0x40')];if(_0x3bb90b['query'][_0xe2ed('0x52')]){_0x588d0b[_0xe2ed('0x53')]=[{'all':!![]}];}_0x588d0b=_['merge']({},_0x588d0b,_0x3bb90b[_0xe2ed('0x51')]);return db[_0xe2ed('0x3d')][_0xe2ed('0x59')](_0x588d0b)[_0xe2ed('0x1e')](handleEntityNotFound(_0x5499e4,null))['then'](respondWithResult(_0x5499e4,null))[_0xe2ed('0x56')](handleError(_0x5499e4,null));};exports[_0xe2ed('0x5a')]=function(_0x520350,_0x12e565){return db['SmsAccount'][_0xe2ed('0x5a')](_0x520350[_0xe2ed('0x5b')],{})[_0xe2ed('0x1e')](function(_0x10fa6b){var _0x39238a=_0x520350[_0xe2ed('0x5c')][_0xe2ed('0x34')]({'plain':!![]});if(!_0x39238a)throw new Error(_0xe2ed('0x5d'));if(_0x39238a[_0xe2ed('0x5e')]===_0xe2ed('0x5c')){var _0x4c6272=_0x10fa6b[_0xe2ed('0x34')]({'plain':!![]});var _0x2585d3='SmsAccounts';return db[_0xe2ed('0x5f')]['find']({'where':{'name':_0x2585d3,'userProfileId':_0x39238a[_0xe2ed('0x60')]},'raw':!![]})['then'](function(_0x19dd64){if(_0x19dd64&&_0x19dd64[_0xe2ed('0x61')]===0x0){return db[_0xe2ed('0x36')][_0xe2ed('0x5a')]({'name':_0x4c6272[_0xe2ed('0x38')],'resourceId':_0x4c6272['id'],'type':_0x19dd64['name'],'sectionId':_0x19dd64['id']},{})['then'](function(){return _0x10fa6b;});}else{return _0x10fa6b;}})[_0xe2ed('0x56')](function(_0x2a1171){logger['error'](_0xe2ed('0x62'),_0x2a1171);throw _0x2a1171;});}return _0x10fa6b;})[_0xe2ed('0x1e')](respondWithResult(_0x12e565,0xc9))[_0xe2ed('0x56')](handleError(_0x12e565,null));};exports['update']=function(_0x31ad7d,_0x416166){if(_0x31ad7d['body']['id']){delete _0x31ad7d[_0xe2ed('0x5b')]['id'];}return db[_0xe2ed('0x3d')][_0xe2ed('0x59')]({'where':{'id':_0x31ad7d['params']['id']},'include':[{'model':db[_0xe2ed('0x63')],'as':_0xe2ed('0x3b')}]})[_0xe2ed('0x1e')](handleEntityNotFound(_0x416166,null))[_0xe2ed('0x1e')](saveUpdates(_0x31ad7d['body'],null))[_0xe2ed('0x1e')](respondWithResult(_0x416166,null))[_0xe2ed('0x56')](handleError(_0x416166,null));};exports[_0xe2ed('0x33')]=function(_0x334110,_0x268c80){return db[_0xe2ed('0x3d')]['find']({'where':{'id':_0x334110['params']['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x268c80,null))[_0xe2ed('0x1e')](removeEntity(_0x268c80,null))[_0xe2ed('0x56')](handleError(_0x268c80,null));};exports[_0xe2ed('0x64')]=function(_0x54bf15,_0x1a569e){return db['SmsAccount'][_0xe2ed('0x64')]()[_0xe2ed('0x1e')](respondWithResult(_0x1a569e,null))[_0xe2ed('0x56')](handleError(_0x1a569e,null));};exports[_0xe2ed('0x65')]=function(_0x595a06,_0x10845f,_0x43f266){if(_0x595a06[_0xe2ed('0x5b')]['id']){delete _0x595a06['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x595a06['params']['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x10845f,null))['then'](function(_0x430291){if(_0x430291){_0x595a06[_0xe2ed('0x5b')][_0xe2ed('0x66')]=_0x430291['id'];return db[_0xe2ed('0x67')]['create'](_0x595a06[_0xe2ed('0x5b')]);}})[_0xe2ed('0x1e')](respondWithResult(_0x10845f,null))['catch'](handleError(_0x10845f,null));};exports[_0xe2ed('0x68')]=function(_0x46d34f,_0xdb210,_0xeecf22){var _0x35a16b={'raw':![],'where':{}};var _0x4b5328={};var _0x5b54e7={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x46d34f[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0xdb210,null))['then'](function(_0x376911){if(_0x376911){_0x4b5328[_0xe2ed('0x40')]=_[_0xe2ed('0x41')](db['Disposition']['rawAttributes']);_0x4b5328[_0xe2ed('0x42')]=_[_0xe2ed('0x41')](_0x46d34f[_0xe2ed('0x42')]);_0x4b5328[_0xe2ed('0x4c')]=_[_0xe2ed('0x44')](_0x4b5328[_0xe2ed('0x40')],_0x4b5328[_0xe2ed('0x42')]);_0x35a16b[_0xe2ed('0x43')]=_[_0xe2ed('0x44')](_0x4b5328[_0xe2ed('0x40')],qs['fields'](_0x46d34f['query'][_0xe2ed('0x45')]));_0x35a16b[_0xe2ed('0x43')]=_0x35a16b[_0xe2ed('0x43')][_0xe2ed('0x46')]?_0x35a16b[_0xe2ed('0x43')]:_0x4b5328[_0xe2ed('0x40')];if(!_0x46d34f['query'][_0xe2ed('0x47')]('nolimit')){_0x35a16b['limit']=qs[_0xe2ed('0x2c')](_0x46d34f[_0xe2ed('0x42')][_0xe2ed('0x2c')]);_0x35a16b['offset']=qs['offset'](_0x46d34f[_0xe2ed('0x42')]['offset']);}_0x35a16b[_0xe2ed('0x49')]=qs[_0xe2ed('0x4a')](_0x46d34f[_0xe2ed('0x42')][_0xe2ed('0x4a')]);_0x35a16b[_0xe2ed('0x4b')]=qs[_0xe2ed('0x4c')](_['pick'](_0x46d34f['query'],_0x4b5328[_0xe2ed('0x4c')]));_0x35a16b[_0xe2ed('0x4b')]['SmsAccountId']=_0x376911['id'];if(_0x46d34f[_0xe2ed('0x42')]['filter']){_0x35a16b[_0xe2ed('0x4b')]=_['merge'](_0x35a16b[_0xe2ed('0x4b')],{'$or':_['map'](_0x35a16b[_0xe2ed('0x43')],function(_0x32de71){var _0x3fd0b5={};_0x3fd0b5[_0x32de71]={'$like':'%'+_0x46d34f['query']['filter']+'%'};return _0x3fd0b5;})});}_0x35a16b=_[_0xe2ed('0x50')]({},_0x35a16b,_0x46d34f[_0xe2ed('0x51')]);return db['Disposition'][_0xe2ed('0x2d')]({'where':_0x35a16b[_0xe2ed('0x4b')]})[_0xe2ed('0x1e')](function(_0x37deaf){_0x5b54e7['count']=_0x37deaf;if(_0x46d34f['query'][_0xe2ed('0x52')]){_0x35a16b[_0xe2ed('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xe2ed('0x54')](_0x35a16b);})['then'](function(_0x3fef44){_0x5b54e7[_0xe2ed('0x55')]=_0x3fef44;return _0x5b54e7;});}})['then'](respondWithFilteredResult(_0xdb210,_0x35a16b))['catch'](handleError(_0xdb210,null));};exports[_0xe2ed('0x6a')]=function(_0x44dc05,_0x43c755,_0x23231a){return db[_0xe2ed('0x3d')][_0xe2ed('0x59')]({'where':{'id':_0x44dc05[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x43c755,null))[_0xe2ed('0x1e')](function(_0x440b50){if(_0x440b50){return _0x440b50['removeDispositions'](_0x44dc05[_0xe2ed('0x42')][_0xe2ed('0x6b')]);}})['then'](respondWithStatusCode(_0x43c755,null))[_0xe2ed('0x56')](handleError(_0x43c755,null));};exports[_0xe2ed('0x6c')]=function(_0x4f1d4b,_0x55a4b5,_0x2a007f){if(_0x4f1d4b[_0xe2ed('0x5b')]['id']){delete _0x4f1d4b[_0xe2ed('0x5b')]['id'];}return db[_0xe2ed('0x3d')]['find']({'where':{'id':_0x4f1d4b[_0xe2ed('0x69')]['id']}})['then'](handleEntityNotFound(_0x55a4b5,null))[_0xe2ed('0x1e')](function(_0x212c7a){if(_0x212c7a){_0x4f1d4b[_0xe2ed('0x5b')][_0xe2ed('0x66')]=_0x212c7a['id'];return db[_0xe2ed('0x6d')][_0xe2ed('0x5a')](_0x4f1d4b[_0xe2ed('0x5b')]);}})[_0xe2ed('0x1e')](respondWithResult(_0x55a4b5,null))['catch'](handleError(_0x55a4b5,null));};exports[_0xe2ed('0x6e')]=function(_0x5e1d37,_0x3e816a,_0x5ac837){var _0x3bec8c={'raw':![],'where':{}};var _0x1c6814={};var _0x3cc0ff={'count':0x0,'rows':[]};return db[_0xe2ed('0x3d')][_0xe2ed('0x6f')]({'where':{'id':_0x5e1d37['params']['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x3e816a,null))[_0xe2ed('0x1e')](function(_0x3dadba){if(_0x3dadba){_0x1c6814[_0xe2ed('0x40')]=_['keys'](db[_0xe2ed('0x6d')][_0xe2ed('0x58')]);_0x1c6814[_0xe2ed('0x42')]=_['keys'](_0x5e1d37[_0xe2ed('0x42')]);_0x1c6814[_0xe2ed('0x4c')]=_[_0xe2ed('0x44')](_0x1c6814[_0xe2ed('0x40')],_0x1c6814['query']);_0x3bec8c[_0xe2ed('0x43')]=_['intersection'](_0x1c6814[_0xe2ed('0x40')],qs[_0xe2ed('0x45')](_0x5e1d37['query']['fields']));_0x3bec8c['attributes']=_0x3bec8c[_0xe2ed('0x43')]['length']?_0x3bec8c[_0xe2ed('0x43')]:_0x1c6814[_0xe2ed('0x40')];if(!_0x5e1d37[_0xe2ed('0x42')][_0xe2ed('0x47')](_0xe2ed('0x48'))){_0x3bec8c[_0xe2ed('0x2c')]=qs[_0xe2ed('0x2c')](_0x5e1d37[_0xe2ed('0x42')][_0xe2ed('0x2c')]);_0x3bec8c[_0xe2ed('0x2b')]=qs[_0xe2ed('0x2b')](_0x5e1d37[_0xe2ed('0x42')][_0xe2ed('0x2b')]);}_0x3bec8c[_0xe2ed('0x49')]=qs['sort'](_0x5e1d37[_0xe2ed('0x42')]['sort']);_0x3bec8c[_0xe2ed('0x4b')]=qs[_0xe2ed('0x4c')](_['pick'](_0x5e1d37[_0xe2ed('0x42')],_0x1c6814[_0xe2ed('0x4c')]));_0x3bec8c[_0xe2ed('0x4b')][_0xe2ed('0x66')]=_0x3dadba['id'];if(_0x5e1d37['query'][_0xe2ed('0x4f')]){_0x3bec8c[_0xe2ed('0x4b')]=_[_0xe2ed('0x50')](_0x3bec8c[_0xe2ed('0x4b')],{'$or':_[_0xe2ed('0x3c')](_0x3bec8c[_0xe2ed('0x43')],function(_0x457c10){var _0x167a95={};_0x167a95[_0x457c10]={'$like':'%'+_0x5e1d37[_0xe2ed('0x42')][_0xe2ed('0x4f')]+'%'};return _0x167a95;})});}_0x3bec8c=_['merge']({},_0x3bec8c,_0x5e1d37[_0xe2ed('0x51')]);return db[_0xe2ed('0x6d')][_0xe2ed('0x2d')]({'where':_0x3bec8c['where']})[_0xe2ed('0x1e')](function(_0x3455a0){_0x3cc0ff[_0xe2ed('0x2d')]=_0x3455a0;if(_0x5e1d37[_0xe2ed('0x42')]['includeAll']){_0x3bec8c[_0xe2ed('0x53')]=[{'all':!![]}];}return db[_0xe2ed('0x6d')]['findAll'](_0x3bec8c);})['then'](function(_0x140578){_0x3cc0ff['rows']=_0x140578;return _0x3cc0ff;});}})[_0xe2ed('0x1e')](respondWithFilteredResult(_0x3e816a,_0x3bec8c))[_0xe2ed('0x56')](handleError(_0x3e816a,null));};exports['removeAnswers']=function(_0x5b5a80,_0x36ef34,_0x4f6f76){return db['SmsAccount']['find']({'where':{'id':_0x5b5a80[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x36ef34,null))[_0xe2ed('0x1e')](function(_0x22ded9){if(_0x22ded9){return _0x22ded9[_0xe2ed('0x70')](_0x5b5a80[_0xe2ed('0x42')][_0xe2ed('0x6b')]);}})[_0xe2ed('0x1e')](respondWithStatusCode(_0x36ef34,null))[_0xe2ed('0x56')](handleError(_0x36ef34,null));};exports[_0xe2ed('0x71')]=function(_0x26cd6f,_0x495e43,_0xffa793){var _0x260777={'channel':_0xe2ed('0x72')};var _0x2cf5b8=[];var _0x2caed6=[];var _0x139a5e={};return db['SmsAccount']['find']({'where':{'id':_0x26cd6f['params']['id']},'include':[{'model':db[_0xe2ed('0x73')],'as':_0xe2ed('0x74')}]})[_0xe2ed('0x1e')](handleEntityNotFound(_0x495e43,null))[_0xe2ed('0x1e')](function(_0x2557fc){_0x260777[_0xe2ed('0x75')]=_0x2557fc;_0x260777[_0xe2ed('0x76')]=_['orderBy'](_0x2557fc[_0xe2ed('0x74')],[_0xe2ed('0x77')],[_0xe2ed('0x78')]);if(_0x260777[_0xe2ed('0x75')][_0xe2ed('0x74')]){delete _0x260777['account'][_0xe2ed('0x74')];}return db[_0xe2ed('0x79')][_0xe2ed('0x64')]();})[_0xe2ed('0x1e')](function(_0x5a238c){if(!_0x5a238c){throw new db['Sequelize'][(_0xe2ed('0x7a'))](_0xe2ed('0x7b'));}_0x2cf5b8=_[_0xe2ed('0x7c')](_[_0xe2ed('0x41')](_0x5a238c),[_0xe2ed('0x7d'),'updatedAt']);_0x2caed6=_['difference'](_[_0xe2ed('0x41')](_0x5a238c),[_0xe2ed('0x7d'),_0xe2ed('0x7e'),_0xe2ed('0x7f'),_0xe2ed('0x80')]);_0x260777[_0xe2ed('0x5b')]={'mapKey':_0xe2ed('0x81')};if(_0x260777[_0xe2ed('0x75')][_0xe2ed('0x3e')]){switch(_0x260777[_0xe2ed('0x75')][_0xe2ed('0x3e')]){case _0xe2ed('0x82'):_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')]=_0x26cd6f[_0xe2ed('0x5b')]['From'];_0x260777['body']['body']=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x84')];_0x260777['body'][_0xe2ed('0x85')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x86')];break;case'skebby':_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')]='+'+_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x87')];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x5b')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x88')];break;case'connectel':_0x260777['body'][_0xe2ed('0x83')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x83')];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x5b')]=_0x26cd6f['body'][_0xe2ed('0x26')];break;case _0xe2ed('0x89'):_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')]=_0x26cd6f[_0xe2ed('0x5b')]['from'];_0x260777['body'][_0xe2ed('0x5b')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x5b')];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x85')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x8a')];break;case'plivo':_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')]=_0x26cd6f['body'][_0xe2ed('0x8b')];_0x260777[_0xe2ed('0x5b')]['body']=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x8c')];_0x260777['body'][_0xe2ed('0x85')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x8d')];break;case _0xe2ed('0x8e'):_0x260777[_0xe2ed('0x5b')]['from']='+'+_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x8f')][0x0][_0xe2ed('0x83')];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x5b')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x8f')][0x0][_0xe2ed('0x88')];_0x260777[_0xe2ed('0x5b')]['messageId']=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x8f')][0x0][_0xe2ed('0x85')];break;case _0xe2ed('0x90'):_0x260777['body'][_0xe2ed('0x83')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x91')];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x5b')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x92')][_0xe2ed('0x26')];break;case _0xe2ed('0x93'):_0x260777['body'][_0xe2ed('0x83')]=_0x26cd6f['body']['fromNumber'];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x5b')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x88')];_0x260777['body']['messageId']=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x94')];break;case'bandwidth':_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x85')]=_0x26cd6f[_0xe2ed('0x5b')][0x0][_0xe2ed('0x26')]['id'];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')]=_0x26cd6f[_0xe2ed('0x5b')][0x0][_0xe2ed('0x26')][_0xe2ed('0x83')];_0x260777['body'][_0xe2ed('0x5b')]=_0x26cd6f[_0xe2ed('0x5b')][0x0][_0xe2ed('0x26')]['text'];break;case _0xe2ed('0x95'):_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')]=_0x26cd6f[_0xe2ed('0x5b')][_0xe2ed('0x83')];_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x5b')]=_0x26cd6f['body'][_0xe2ed('0x26')];_0x260777['body']['messageId']=_0x26cd6f['body'][_0xe2ed('0x96')];break;}}if(_0x260777[_0xe2ed('0x5b')]['id']){delete _0x260777[_0xe2ed('0x5b')]['id'];}if(_[_0xe2ed('0x97')](_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')])){throw new db[(_0xe2ed('0x98'))][(_0xe2ed('0x7a'))](_0xe2ed('0x99'));}if(_[_0xe2ed('0x97')](_0x260777['body']['body'])||_0x260777[_0xe2ed('0x5b')]['body']===''){throw new db[(_0xe2ed('0x98'))][(_0xe2ed('0x7a'))](_0xe2ed('0x9a'));}if(_[_0xe2ed('0x97')](_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x9b')])){throw new db[(_0xe2ed('0x98'))][(_0xe2ed('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2caed6);}if(!_['includes'](_0x2caed6,_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x9b')])){throw new db['Sequelize']['ValidationError'](_0xe2ed('0x9c')+_0x2caed6);}_0x139a5e[_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x9b')]]=_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')];return db['CmList'][_0xe2ed('0x59')]({'where':{'id':_0x260777[_0xe2ed('0x75')][_0xe2ed('0x80')]},'include':[{'model':db['CmContact'],'as':_0xe2ed('0x9d'),'where':_0x139a5e,'limit':0x1,'order':[[_0xe2ed('0x7e'),_0xe2ed('0x9e')]]}]});})[_0xe2ed('0x1e')](handleEntityNotFound(_0x495e43,null))['then'](function(_0x25e750){if(_0x25e750){_0x260777[_0xe2ed('0x9f')]=_['omit'](_0x25e750,[_0xe2ed('0x9d')]);if(_0x25e750[_0xe2ed('0x9d')]['length']){return _0x25e750[_0xe2ed('0x9d')][0x0];}var _0x4fcf8b=_[_0xe2ed('0xa0')](_0x260777['body'],{'firstName':_0x260777[_0xe2ed('0x5b')]['from'],'ListId':_0x25e750['id']});_0x4fcf8b[_0x260777['body'][_0xe2ed('0x9b')]]=_0x260777['body'][_0xe2ed('0x83')];return db[_0xe2ed('0x79')]['create'](_0x4fcf8b,{'fields':_0x2cf5b8,'raw':!![]});}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x495e43,null))['then'](function(_0x5e60f7){if(_0x5e60f7){_0x260777[_0xe2ed('0xa1')]=_0x5e60f7;var _0x113818={'ContactId':_0x5e60f7['id'],'phone':_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x83')],'SmsAccountId':_0x26cd6f['params']['id']};var _0x15e0a5={'ContactId':_0x5e60f7['id'],'SmsAccountId':_0x26cd6f[_0xe2ed('0x69')]['id'],'closed':![]};return db[_0xe2ed('0xa2')][_0xe2ed('0x59')]({'where':_0x15e0a5})[_0xe2ed('0x1e')](function(_0x5cd424){if(_0x5cd424){return[_0x5cd424,![]];}return db[_0xe2ed('0xa2')][_0xe2ed('0x5a')](_0x113818)[_0xe2ed('0x1e')](function(_0x11bc06){return[_0x11bc06,!![]];});});}})[_0xe2ed('0xa3')](function(_0x247cb1,_0x4a24e6){_0x260777['interaction']=_0x247cb1['get']({'plain':!![]});_0x260777[_0xe2ed('0xa4')][_0xe2ed('0xa5')]=![];if(_0x4a24e6){if(_0x260777[_0xe2ed('0x75')][_0xe2ed('0xa6')]){_0x260777['applications'][_0xe2ed('0xa7')]({'id':0x0,'priority':_0x260777[_0xe2ed('0x76')][_0xe2ed('0x46')]+0x1,'app':_0xe2ed('0xa8'),'appdata':_0xe2ed('0xa9'),'interval':_0xe2ed('0xaa')});}_0x260777['interaction'][_0xe2ed('0xa5')]=!![];}return db[_0xe2ed('0xab')]['create']({'phone':_0x260777[_0xe2ed('0x5b')]['from'],'messageId':_0x260777['body'][_0xe2ed('0x85')],'body':_0x260777[_0xe2ed('0x5b')][_0xe2ed('0x5b')],'SmsAccountId':_0x26cd6f[_0xe2ed('0x69')]['id'],'SmsInteractionId':_0x247cb1['id'],'direction':'in','ContactId':_0x247cb1[_0xe2ed('0xac')],'AttachmentId':_0x260777[_0xe2ed('0x5b')][_0xe2ed('0xad')]});})[_0xe2ed('0x1e')](function(_0x488b57){_0x260777[_0xe2ed('0x26')]=_0x488b57;if(_0x260777[_0xe2ed('0xa4')][_0xe2ed('0xae')]){return db[_0xe2ed('0xaf')][_0xe2ed('0x59')]({'attributes':['id','name'],'where':{'id':_0x260777[_0xe2ed('0xa4')][_0xe2ed('0xae')]}})[_0xe2ed('0x1e')](function(_0x5bf331){if(_0x5bf331){_0x260777[_0xe2ed('0x76')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe2ed('0xb0'),'appdata':_0x5bf331[_0xe2ed('0x38')]+','+(_0x260777[_0xe2ed('0x75')][_0xe2ed('0xb1')]||0xa),'interval':_0xe2ed('0xaa')});}return respondWithRpcPromise('Start',_0xe2ed('0xb2'),_0x260777);});}return respondWithRpcPromise('Start','startRouting',_0x260777);})['then'](function(_0x5081e1){if(_0x5081e1){var _0x5c7041=0xc8;var _0x28c760='receiveMessage';logger[_0xe2ed('0x1f')](_0xe2ed('0x23'),_0x28c760,_0x5c7041,_0xe2ed('0xb3'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x28c760,_0x5c7041,_0xe2ed('0xb3'),JSON[_0xe2ed('0xb4')](_0x5081e1));if(_0x260777[_0xe2ed('0x75')][_0xe2ed('0x3e')]==='twilio'){return _0x495e43[_0xe2ed('0x29')](_0x5c7041)[_0xe2ed('0x2e')](_0xe2ed('0xb5'),_0xe2ed('0xb6'))['send']('\x0a');}else{return _0x495e43[_0xe2ed('0x29')](_0x5c7041)[_0xe2ed('0x2a')](_0x5081e1);}}})['catch'](handleError(_0x495e43,null));};exports[_0xe2ed('0xb7')]=function(_0x4974dc,_0x34845d){var _0x47b932=_0x4974dc[_0xe2ed('0x69')]['id'];var _0x34d579=_0x4974dc[_0xe2ed('0x5b')];var _0x5ce017=0xc8;var _0x1fdc99=null;return db[_0xe2ed('0xb8')][_0xe2ed('0xb9')]({'isolationLevel':db[_0xe2ed('0xb8')][_0xe2ed('0xba')][_0xe2ed('0xbb')]['READ_COMMITTED']},function(_0x586204){return db[_0xe2ed('0x3d')][_0xe2ed('0x6f')]({'where':{'id':_0x47b932},'transaction':_0x586204})['then'](function(_0x58b929){if(_0x58b929){return db[_0xe2ed('0x73')][_0xe2ed('0x33')]({'where':{'SmsAccountId':_0x47b932},'transaction':_0x586204})[_0xe2ed('0x1e')](function(){var _0x43a68e=_['map'](_0x34d579,function(_0x1cc957){_0x1cc957[_0xe2ed('0x66')]=_0x47b932;return _0x1cc957;});return db[_0xe2ed('0x73')]['bulkCreate'](_0x43a68e,{'transaction':_0x586204});});}else{_0x5ce017=0x194;_0x1fdc99=[];}});})[_0xe2ed('0x1e')](function(){if(_0x5ce017!==0x194){return db[_0xe2ed('0x73')]['findAndCountAll']({'where':{'SmsAccountId':_0x47b932},'order':_0xe2ed('0x77')})[_0xe2ed('0x1e')](function(_0x48ce99){_0x1fdc99=_0x48ce99;});}})[_0xe2ed('0x56')](function(_0x36e451){_0x5ce017=0x1f4;logger[_0xe2ed('0x24')](_0x36e451[_0xe2ed('0x37')]);if(_0x36e451[_0xe2ed('0x38')]){delete _0x36e451[_0xe2ed('0x38')];}_0x1fdc99=_0x36e451;})[_0xe2ed('0xbc')](function(){if(_0x1fdc99===null){_0x34845d['sendStatus'](_0x5ce017);}else{if(_0x5ce017===0x1f4){_0x34845d[_0xe2ed('0x29')](_0x5ce017)[_0xe2ed('0x39')](_0x1fdc99);}else{_0x34845d['status'](_0x5ce017)[_0xe2ed('0x2a')](_0x1fdc99);}}});};exports[_0xe2ed('0xbd')]=function(_0x563e34,_0x27c877,_0x2edaf7){var _0x425706={};var _0x41c361={};var _0x474363;var _0x244762;return db[_0xe2ed('0x3d')]['findOne']({'where':{'id':_0x563e34[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x27c877,null))['then'](function(_0x233dca){if(_0x233dca){_0x474363=_0x233dca;_0x41c361[_0xe2ed('0x40')]=_[_0xe2ed('0x41')](db[_0xe2ed('0x73')][_0xe2ed('0x58')]);_0x41c361[_0xe2ed('0x42')]=_[_0xe2ed('0x41')](_0x563e34[_0xe2ed('0x42')]);_0x41c361[_0xe2ed('0x4c')]=_[_0xe2ed('0x44')](_0x41c361[_0xe2ed('0x40')],_0x41c361['query']);_0x425706[_0xe2ed('0x43')]=_[_0xe2ed('0x44')](_0x41c361[_0xe2ed('0x40')],qs[_0xe2ed('0x45')](_0x563e34[_0xe2ed('0x42')][_0xe2ed('0x45')]));_0x425706[_0xe2ed('0x43')]=_0x425706[_0xe2ed('0x43')][_0xe2ed('0x46')]?_0x425706[_0xe2ed('0x43')]:_0x41c361[_0xe2ed('0x40')];_0x425706[_0xe2ed('0x49')]=qs[_0xe2ed('0x4a')](_0x563e34[_0xe2ed('0x42')][_0xe2ed('0x4a')]);_0x425706[_0xe2ed('0x4b')]=qs[_0xe2ed('0x4c')](_[_0xe2ed('0x4d')](_0x563e34[_0xe2ed('0x42')],_0x41c361[_0xe2ed('0x4c')]));if(_0x563e34[_0xe2ed('0x42')][_0xe2ed('0x4f')]){_0x425706[_0xe2ed('0x4b')]=_['merge'](_0x425706['where'],{'$or':_[_0xe2ed('0x3c')](_0x425706[_0xe2ed('0x43')],function(_0x2d0df3){var _0x48e31d={};_0x48e31d[_0x2d0df3]={'$like':'%'+_0x563e34['query'][_0xe2ed('0x4f')]+'%'};return _0x48e31d;})});}_0x425706=_['merge']({},_0x425706,_0x563e34['options']);return _0x474363['getApplications'](_0x425706);}})[_0xe2ed('0x1e')](function(_0x562b8f){if(_0x562b8f){_0x244762=_0x562b8f[_0xe2ed('0x46')];if(!_0x563e34[_0xe2ed('0x42')]['hasOwnProperty']('nolimit')){_0x425706[_0xe2ed('0x2c')]=qs[_0xe2ed('0x2c')](_0x563e34[_0xe2ed('0x42')][_0xe2ed('0x2c')]);_0x425706[_0xe2ed('0x2b')]=qs[_0xe2ed('0x2b')](_0x563e34[_0xe2ed('0x42')]['offset']);}return _0x474363[_0xe2ed('0xbd')](_0x425706);}})[_0xe2ed('0x1e')](function(_0x29348f){if(_0x29348f){return _0x29348f?{'count':_0x244762,'rows':_0x29348f}:null;}})[_0xe2ed('0x1e')](respondWithResult(_0x27c877,null))['catch'](handleError(_0x27c877,null));};exports['getInteractions']=function(_0x17da24,_0x458521,_0x3feea6){var _0xd03c8a={'raw':![],'where':{}};var _0x30c957={};var _0x3a88e4={'count':0x0,'rows':[]};return db[_0xe2ed('0x3d')][_0xe2ed('0x6f')]({'where':{'id':_0x17da24[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x458521,null))['then'](function(_0x2f8d90){if(_0x2f8d90){_0x30c957[_0xe2ed('0x40')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x30c957[_0xe2ed('0x42')]=_[_0xe2ed('0x41')](_0x17da24[_0xe2ed('0x42')]);_0x30c957['filters']=_[_0xe2ed('0x44')](_0x30c957[_0xe2ed('0x40')],_0x30c957[_0xe2ed('0x42')]);_0xd03c8a[_0xe2ed('0x43')]=_[_0xe2ed('0x44')](_0x30c957[_0xe2ed('0x40')],qs[_0xe2ed('0x45')](_0x17da24['query'][_0xe2ed('0x45')]));_0xd03c8a[_0xe2ed('0x43')]=_0xd03c8a[_0xe2ed('0x43')][_0xe2ed('0x46')]?_0xd03c8a[_0xe2ed('0x43')]:_0x30c957[_0xe2ed('0x40')];if(!_0x17da24[_0xe2ed('0x42')][_0xe2ed('0x47')]('nolimit')){_0xd03c8a[_0xe2ed('0x2c')]=qs[_0xe2ed('0x2c')](_0x17da24[_0xe2ed('0x42')][_0xe2ed('0x2c')]);_0xd03c8a[_0xe2ed('0x2b')]=qs[_0xe2ed('0x2b')](_0x17da24[_0xe2ed('0x42')][_0xe2ed('0x2b')]);}_0xd03c8a['order']=qs['sort'](_0x17da24[_0xe2ed('0x42')]['sort']);_0xd03c8a[_0xe2ed('0x4b')]=qs['filters'](_[_0xe2ed('0x4d')](_0x17da24['query'],_0x30c957['filters']));_0xd03c8a[_0xe2ed('0x4b')][_0xe2ed('0x66')]=_0x2f8d90['id'];if(_0x17da24[_0xe2ed('0x42')]['filter']){_0xd03c8a['where']=_[_0xe2ed('0x50')](_0xd03c8a['where'],{'$or':_[_0xe2ed('0x3c')](_0xd03c8a['attributes'],function(_0x1b7b4e){var _0x5bca55={};_0x5bca55[_0x1b7b4e]={'$like':'%'+_0x17da24[_0xe2ed('0x42')]['filter']+'%'};return _0x5bca55;})});}_0xd03c8a=_[_0xe2ed('0x50')]({},_0xd03c8a,_0x17da24['options']);return db['SmsInteraction'][_0xe2ed('0x2d')]({'where':_0xd03c8a['where']})[_0xe2ed('0x1e')](function(_0x2c4221){_0x3a88e4[_0xe2ed('0x2d')]=_0x2c4221;if(_0x17da24[_0xe2ed('0x42')][_0xe2ed('0x52')]){_0xd03c8a[_0xe2ed('0x53')]=[{'model':db[_0xe2ed('0x79')],'as':_0xe2ed('0xbe'),'required':![]},{'model':db[_0xe2ed('0xaf')],'as':_0xe2ed('0xbf'),'attributes':[_0xe2ed('0x38'),_0xe2ed('0xc0'),'internal'],'required':![]},{'model':db[_0xe2ed('0xc1')],'as':_0xe2ed('0xc2'),'attributes':['id',_0xe2ed('0x38'),_0xe2ed('0xc3')],'where':_0x17da24[_0xe2ed('0x42')][_0xe2ed('0xc4')]?{'id':_0x17da24[_0xe2ed('0x42')][_0xe2ed('0xc4')]}:undefined,'required':_0x17da24[_0xe2ed('0x42')]['tag']?!![]:![]}];}return db[_0xe2ed('0xa2')][_0xe2ed('0x54')](_0xd03c8a);})[_0xe2ed('0x1e')](function(_0xdbc3c5){_0x3a88e4[_0xe2ed('0x55')]=_0xdbc3c5;return _0x3a88e4;});}})[_0xe2ed('0x1e')](respondWithFilteredResult(_0x458521,_0xd03c8a))['catch'](handleError(_0x458521,null));};exports['send']=function(_0x9013e4,_0x17bb1b,_0x5e4a4d){var _0x1944a7,_0x57b40c,_0x13738d;if(_[_0xe2ed('0x97')](_0x9013e4[_0xe2ed('0x5b')][_0xe2ed('0x5b')])||_0x9013e4[_0xe2ed('0x5b')][_0xe2ed('0x5b')]===''){throw new db['Sequelize'][(_0xe2ed('0x7a'))](_0xe2ed('0x9a'));}if(_['isNil'](_0x9013e4['body']['to'])){throw new db[(_0xe2ed('0x98'))][(_0xe2ed('0x7a'))](_0xe2ed('0xc5'));}_0x1944a7=_0x9013e4[_0xe2ed('0x5b')]['to'];return db[_0xe2ed('0x3d')][_0xe2ed('0x59')]({'where':{'id':_0x9013e4[_0xe2ed('0x69')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xe2ed('0x79')],'as':_0xe2ed('0x9d'),'where':{'mobile':_0x1944a7},'limit':0x1,'order':[[_0xe2ed('0x7e'),_0xe2ed('0x9e')]]}]}]})[_0xe2ed('0x1e')](handleEntityNotFound(_0x17bb1b,null))['then'](function(_0x22a27e){if(_0x22a27e&&_0x22a27e[_0xe2ed('0xc6')]){_0x57b40c=_0x22a27e[_0xe2ed('0x34')]({'plain':!![]});if(_0x57b40c['List']&&_0x57b40c[_0xe2ed('0xc6')][_0xe2ed('0x9d')][_0xe2ed('0x46')]){return _0x57b40c[_0xe2ed('0xc6')][_0xe2ed('0x9d')][0x0];}return db[_0xe2ed('0x79')][_0xe2ed('0x5a')](_[_0xe2ed('0xa0')](_0x9013e4[_0xe2ed('0x5b')],{'firstName':_0x1944a7,'mobile':_0x1944a7,'phone':_0x1944a7,'ListId':_0x57b40c['ListId']}));}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x17bb1b,null))[_0xe2ed('0x1e')](function(_0x29687d){if(_0x29687d){_0x13738d=_0x29687d;return db[_0xe2ed('0xa2')]['find']({'where':{'ContactId':_0x13738d['id'],'closed':![],'SmsAccountId':_0x57b40c['id']}})[_0xe2ed('0x1e')](function(_0x1db18a){if(_0x1db18a){return[_0x1db18a,![]];}return db['SmsInteraction'][_0xe2ed('0x5a')]({'UserId':_0x9013e4[_0xe2ed('0x5c')]['id'],'ContactId':_0x13738d['id'],'SmsAccountId':_0x57b40c['id'],'phone':_0x1944a7,'firstMsgDirection':'out','Messages':[_[_0xe2ed('0x50')](_0x9013e4[_0xe2ed('0x5b')],{'read':![],'body':_0x9013e4['body'][_0xe2ed('0x5b')],'phone':_0x1944a7,'SmsAccountId':_0x57b40c['id'],'UserId':_0x9013e4['user']['id'],'ContactId':_0x13738d['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xe2ed('0xc7')}]})[_0xe2ed('0x1e')](function(_0x39b248){return[_0x39b248,!![]];});});}})[_0xe2ed('0xa3')](function(_0x26bd2e,_0x16eade){if(_0x16eade){return _0x26bd2e;}return db[_0xe2ed('0xab')][_0xe2ed('0x5a')](_['merge'](_0x9013e4[_0xe2ed('0x5b')],{'read':![],'body':_0x9013e4['body'][_0xe2ed('0x5b')],'phone':_0x1944a7,'SmsAccountId':_0x57b40c['id'],'SmsInteractionId':_0x26bd2e['id'],'UserId':_0x9013e4[_0xe2ed('0x5c')]['id'],'ContactId':_0x13738d['id']}))[_0xe2ed('0x1e')](function(_0x8f19ce){_0x26bd2e['dataValues'][_0xe2ed('0xc7')]=[];_0x26bd2e['dataValues']['Messages'][_0xe2ed('0xa7')](_0x8f19ce[_0xe2ed('0xc8')]);return _0x26bd2e;});})[_0xe2ed('0x1e')](respondWithResult(_0x17bb1b,null))[_0xe2ed('0x56')](handleError(_0x17bb1b,null));};exports[_0xe2ed('0x29')]=function(_0xbc334b,_0x5188a0,_0x41a230){if(_0xbc334b[_0xe2ed('0x5b')]['id']){delete _0xbc334b[_0xe2ed('0x5b')]['id'];}var _0x3f8f9f,_0x3423cd,_0x323b8f;return db[_0xe2ed('0x3d')]['find']({'where':{'id':_0xbc334b[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x5188a0,null))[_0xe2ed('0x1e')](function(_0x10feb6){if(_0x10feb6){_0x323b8f=_0x10feb6;logger[_0xe2ed('0x22')](_0xe2ed('0x23'),_0xe2ed('0x29'),'received\x20delivery\x20report\x20from',_0x10feb6[_0xe2ed('0x3e')],util[_0xe2ed('0xc9')](_0xbc334b['body'],{'showHidden':![],'depth':null}));switch(_0x10feb6[_0xe2ed('0x3e')]){case _0xe2ed('0xca'):if(_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0xcb')]&&_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x29')]){_0x3423cd=_0xbc334b['body'][_0xe2ed('0x29')];return db[_0xe2ed('0xab')]['find']({'where':{'messageId':_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0xcb')]}});}break;case'connectel':if(_0xbc334b[_0xe2ed('0x5b')]['requestid']&&_0xbc334b['body'][_0xe2ed('0xcc')]){_0x3423cd=_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0xcc')];return db[_0xe2ed('0xab')][_0xe2ed('0x59')]({'where':{'messageId':_0xbc334b[_0xe2ed('0x5b')]['requestid']}});}break;case _0xe2ed('0x89'):if(_0xbc334b[_0xe2ed('0x5b')]['message_id']&&_0xbc334b[_0xe2ed('0x5b')]['status_code']){_0x3423cd=_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0xcd')];return db['SmsMessage'][_0xe2ed('0x59')]({'where':{'messageId':_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x8a')]}});}break;case _0xe2ed('0x8e'):var _0x3a3a56=_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x8f')][0x0];if(_0x3a3a56['messageId']&&_0x3a3a56['status'][_0xe2ed('0xce')]==='DELIVERED'){_0x3423cd=_0x3a3a56[_0xe2ed('0x29')][_0xe2ed('0xce')];return db['SmsMessage'][_0xe2ed('0x59')]({'where':{'messageId':_0x3a3a56[_0xe2ed('0x85')]}});}break;case'clickatell':if(_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x85')]&&_0xbc334b['body'][_0xe2ed('0x29')]){_0x3423cd=_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x29')];return db[_0xe2ed('0xab')][_0xe2ed('0x59')]({'where':{'messageId':_0xbc334b[_0xe2ed('0x5b')]['messageId']}});}break;case _0xe2ed('0xcf'):if(_0xbc334b[_0xe2ed('0x5b')][0x0][_0xe2ed('0x26')]['id']){_0x3423cd=_0xbc334b[_0xe2ed('0x5b')][0x0][_0xe2ed('0x3e')];return db[_0xe2ed('0xab')]['find']({'where':{'messageId':_0xbc334b[_0xe2ed('0x5b')][0x0]['message']['id']}});}break;case _0xe2ed('0x95'):if(_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0xd0')]&&_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x29')]){_0x3423cd=_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x29')];return db[_0xe2ed('0xab')][_0xe2ed('0x59')]({'where':{'messageId':_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x5188a0,null))[_0xe2ed('0x1e')](function(_0x31993b){if(_0x31993b){_0x3f8f9f=_0x31993b;switch(_0x323b8f[_0xe2ed('0x3e')]){case _0xe2ed('0xca'):if(_0x3423cd===_0xe2ed('0xd1')){return _0x3f8f9f[_0xe2ed('0xd2')]({'read':!![]});}else{logger[_0xe2ed('0x24')](_0xe2ed('0x23'),_0xe2ed('0x29'),_0xe2ed('0xca'),util[_0xe2ed('0xc9')](_0xbc334b['body'],{'showHidden':![],'depth':null}));}break;case _0xe2ed('0xd3'):if(_0x3423cd==='1'){return _0x3f8f9f['update']({'read':!![]});}else{logger['error'](_0xe2ed('0x23'),_0xe2ed('0x29'),_0xe2ed('0xca'),util['inspect'](_0xbc334b['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xbc334b[_0xe2ed('0x5b')]['error_code']&&_0x3423cd>=0xc8&&_0x3423cd<=0xce){return _0x3f8f9f[_0xe2ed('0xd2')]({'read':!![]});}else{logger[_0xe2ed('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe2ed('0x89'),util['inspect'](_0xbc334b[_0xe2ed('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xe2ed('0x8e'):var _0x1903f=_0xbc334b[_0xe2ed('0x5b')][_0xe2ed('0x8f')][0x0];if(_0x1903f[_0xe2ed('0x29')][_0xe2ed('0xce')]===_0xe2ed('0xd1')){return _0x3f8f9f[_0xe2ed('0xd2')]({'read':!![]});}else{logger[_0xe2ed('0x24')](_0xe2ed('0x23'),_0xe2ed('0x29'),_0xe2ed('0x8e'),util[_0xe2ed('0xc9')](_0xbc334b[_0xe2ed('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xe2ed('0x93'):if(_0x3423cd==_0xe2ed('0xd4')||_0x3423cd=='RECEIVED_BY_RECIPIENT'){return _0x3f8f9f['update']({'read':!![]});}else{logger[_0xe2ed('0x24')](_0xe2ed('0x23'),'status','clickatell',util[_0xe2ed('0xc9')](_0xbc334b[_0xe2ed('0x5b')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3423cd==_0xe2ed('0xd5')){return _0x3f8f9f[_0xe2ed('0xd2')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe2ed('0x29'),'bandwidth',util[_0xe2ed('0xc9')](_0xbc334b[_0xe2ed('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xe2ed('0x95'):if(_0x3423cd===_0xe2ed('0xd6')||_0x3423cd===_0xe2ed('0xd7')){return _0x3f8f9f[_0xe2ed('0xd2')]({'read':!![]});}else{logger[_0xe2ed('0x24')](_0xe2ed('0x23'),_0xe2ed('0x29'),_0xe2ed('0x95'),util[_0xe2ed('0xc9')](_0xbc334b[_0xe2ed('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x3f8f9f;}})[_0xe2ed('0x1e')](respondWithResult(_0x5188a0,null))[_0xe2ed('0x56')](handleError(_0x5188a0,null));};exports[_0xe2ed('0xd8')]=function(_0xd81967,_0x300ccc,_0x5a0923){var _0x37304a,_0x1b110f,_0x27d039;return db[_0xe2ed('0x3d')][_0xe2ed('0x59')]({'where':{'id':_0xd81967['params']['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x300ccc,null))[_0xe2ed('0x1e')](function(_0x38d9bb){if(_0x38d9bb){_0x27d039=_0x38d9bb;logger[_0xe2ed('0x22')](_0xe2ed('0x23'),_0xe2ed('0x29'),_0xe2ed('0xd9'),_0x38d9bb[_0xe2ed('0x3e')],util[_0xe2ed('0xc9')](_0xd81967[_0xe2ed('0x42')],{'showHidden':![],'depth':null}));switch(_0x38d9bb[_0xe2ed('0x3e')]){case'csc':if(_0xd81967[_0xe2ed('0x42')][_0xe2ed('0xda')]&&_0xd81967[_0xe2ed('0x42')][_0xe2ed('0xdb')]){_0x1b110f=_0xd81967[_0xe2ed('0x42')][_0xe2ed('0xdb')];return db[_0xe2ed('0xab')][_0xe2ed('0x59')]({'where':{'messageId':_0xd81967['query'][_0xe2ed('0xda')]}});}break;}}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x300ccc,null))[_0xe2ed('0x1e')](function(_0x43b096){if(_0x43b096){_0x37304a=_0x43b096;switch(_0x27d039[_0xe2ed('0x3e')]){case _0xe2ed('0x90'):if(_0x1b110f==='2'||_0x1b110f==='6'){return _0x37304a['update']({'read':!![]});}else{logger[_0xe2ed('0x24')](_0xe2ed('0x23'),_0xe2ed('0x29'),_0xe2ed('0x90'),util['inspect'](_0xd81967[_0xe2ed('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x37304a;}})[_0xe2ed('0x1e')](respondWithResult(_0x300ccc,null))[_0xe2ed('0x56')](handleError(_0x300ccc,null));};exports['addAgents']=function(_0x40a832,_0x13f791,_0xf92bab){return db[_0xe2ed('0x3d')][_0xe2ed('0x59')]({'where':{'id':_0x40a832[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x13f791,null))[_0xe2ed('0x1e')](function(_0xdc9d41){if(_0xdc9d41){return _0xdc9d41[_0xe2ed('0xdc')](_0x40a832['body'][_0xe2ed('0x6b')],_[_0xe2ed('0xdd')](_0x40a832[_0xe2ed('0x5b')],[_0xe2ed('0x6b'),'id'])||{})['spread'](function(_0x1e4b89){for(var _0x46ff3c=0x0;_0x46ff3c<_0x40a832['body'][_0xe2ed('0x6b')][_0xe2ed('0x46')];_0x46ff3c+=0x1){socket[_0xe2ed('0xde')](_0xe2ed('0xdf'),{'UserId':Number(_0x40a832[_0xe2ed('0x5b')][_0xe2ed('0x6b')][_0x46ff3c]),'SmsAccountId':Number(_0x40a832[_0xe2ed('0x69')]['id'])});}return _0x1e4b89;});}})[_0xe2ed('0x1e')](respondWithResult(_0x13f791,null))[_0xe2ed('0x56')](handleError(_0x13f791,null));};exports['removeAgents']=function(_0x5ba61f,_0x4d3b75,_0x455d98){return db[_0xe2ed('0x3d')]['find']({'where':{'id':_0x5ba61f['params']['id']}})['then'](handleEntityNotFound(_0x4d3b75,null))[_0xe2ed('0x1e')](function(_0x1f811d){if(_0x1f811d){return _0x1f811d[_0xe2ed('0xe0')](_0x5ba61f[_0xe2ed('0x42')][_0xe2ed('0x6b')])['then'](function(){if(_['isArray'](_0x5ba61f['query']['ids'])){for(var _0x295600=0x0;_0x295600<_0x5ba61f[_0xe2ed('0x42')][_0xe2ed('0x6b')]['length'];_0x295600+=0x1){socket[_0xe2ed('0xde')](_0xe2ed('0xe1'),{'UserId':Number(_0x5ba61f['query'][_0xe2ed('0x6b')][_0x295600]),'SmsAccountId':Number(_0x5ba61f['params']['id'])});}}else{socket[_0xe2ed('0xde')]('userSmsAccount:remove',{'UserId':Number(_0x5ba61f[_0xe2ed('0x42')][_0xe2ed('0x6b')]),'SmsAccountId':Number(_0x5ba61f['params']['id'])});}});}})[_0xe2ed('0x1e')](respondWithStatusCode(_0x4d3b75,null))[_0xe2ed('0x56')](handleError(_0x4d3b75,null));};exports[_0xe2ed('0xe2')]=function(_0x5555f2,_0x321634,_0x4fda4a){var _0x5e0503={};var _0x221218={};var _0xc22d87;var _0x51c426;return db['SmsAccount'][_0xe2ed('0x6f')]({'where':{'id':_0x5555f2[_0xe2ed('0x69')]['id']}})[_0xe2ed('0x1e')](handleEntityNotFound(_0x321634,null))[_0xe2ed('0x1e')](function(_0x299423){if(_0x299423){_0xc22d87=_0x299423;_0x221218['model']=_[_0xe2ed('0x41')](db[_0xe2ed('0xaf')][_0xe2ed('0x58')]);_0x221218[_0xe2ed('0x42')]=_[_0xe2ed('0x41')](_0x5555f2[_0xe2ed('0x42')]);_0x221218[_0xe2ed('0x4c')]=_[_0xe2ed('0x44')](_0x221218[_0xe2ed('0x40')],_0x221218[_0xe2ed('0x42')]);_0x5e0503[_0xe2ed('0x43')]=_[_0xe2ed('0x44')](_0x221218[_0xe2ed('0x40')],qs[_0xe2ed('0x45')](_0x5555f2[_0xe2ed('0x42')][_0xe2ed('0x45')]));_0x5e0503[_0xe2ed('0x43')]=_0x5e0503[_0xe2ed('0x43')][_0xe2ed('0x46')]?_0x5e0503[_0xe2ed('0x43')]:_0x221218['model'];_0x5e0503[_0xe2ed('0x49')]=qs[_0xe2ed('0x4a')](_0x5555f2['query'][_0xe2ed('0x4a')]);_0x5e0503[_0xe2ed('0x4b')]=qs[_0xe2ed('0x4c')](_[_0xe2ed('0x4d')](_0x5555f2[_0xe2ed('0x42')],_0x221218['filters']));if(_0x5555f2['query'][_0xe2ed('0x4f')]){_0x5e0503[_0xe2ed('0x4b')]=_[_0xe2ed('0x50')](_0x5e0503[_0xe2ed('0x4b')],{'$or':_[_0xe2ed('0x3c')](_0x5e0503[_0xe2ed('0x43')],function(_0x1f1272){var _0x275450={};_0x275450[_0x1f1272]={'$like':'%'+_0x5555f2[_0xe2ed('0x42')]['filter']+'%'};return _0x275450;})});}_0x5e0503=_[_0xe2ed('0x50')]({},_0x5e0503,_0x5555f2[_0xe2ed('0x51')]);return _0xc22d87[_0xe2ed('0xe2')](_0x5e0503);}})[_0xe2ed('0x1e')](function(_0x491d2c){if(_0x491d2c){_0x51c426=_0x491d2c[_0xe2ed('0x46')];if(!_0x5555f2[_0xe2ed('0x42')][_0xe2ed('0x47')](_0xe2ed('0x48'))){_0x5e0503['limit']=qs[_0xe2ed('0x2c')](_0x5555f2[_0xe2ed('0x42')][_0xe2ed('0x2c')]);_0x5e0503['offset']=qs[_0xe2ed('0x2b')](_0x5555f2[_0xe2ed('0x42')]['offset']);}return _0xc22d87[_0xe2ed('0xe2')](_0x5e0503);}})[_0xe2ed('0x1e')](function(_0x2556a9){if(_0x2556a9){return _0x2556a9?{'count':_0x51c426,'rows':_0x2556a9}:null;}})[_0xe2ed('0x1e')](respondWithResult(_0x321634,null))[_0xe2ed('0x56')](handleError(_0x321634,null));}; \ No newline at end of file +var _0x785a=['omit','contact','SmsInteraction','spread','interaction','autoclose','applications','push','close','*,*,*,*','created','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','\x0a','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','getApplications','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','groupName','DELIVERED','clickatell','redif','error_code','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','index','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','name','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','Pause','model','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','account','orderBy','asc','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','twilio','from','Body','MessageSid','skebby','sender','text','clicksend','messageId','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0x785a,0x12a));var _0xa785=function(_0x1cd2b3,_0x35dd91){_0x1cd2b3=_0x1cd2b3-0x0;var _0x1af911=_0x785a[_0x1cd2b3];return _0x1af911;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa785('0x0'));var zipdir=require(_0xa785('0x1'));var jsonpatch=require(_0xa785('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa785('0x3'));var Mustache=require(_0xa785('0x4'));var util=require('util');var path=require(_0xa785('0x5'));var sox=require('sox');var csv=require(_0xa785('0x6'));var ejs=require(_0xa785('0x7'));var fs=require('fs');var fs_extra=require(_0xa785('0x8'));var _=require(_0xa785('0x9'));var squel=require(_0xa785('0xa'));var crypto=require(_0xa785('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa785('0x6'));var querystring=require(_0xa785('0xc'));var Papa=require(_0xa785('0xd'));var Redis=require('ioredis');var authService=require(_0xa785('0xe'));var qs=require(_0xa785('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa785('0x10'));var logger=require(_0xa785('0x11'))(_0xa785('0x12'));var utils=require('../../config/utils');var config=require(_0xa785('0x13'));var licenseUtil=require(_0xa785('0x14'));var db=require(_0xa785('0x15'))['db'];config[_0xa785('0x16')]=_[_0xa785('0x17')](config[_0xa785('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa785('0x16')]));require(_0xa785('0x18'))[_0xa785('0x19')](socket);var jayson=require(_0xa785('0x1a'));var client=jayson[_0xa785('0x1b')][_0xa785('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0xb052ca,_0x3bf018,_0x37e769,_0xdd0daf){return new BPromise(function(_0x52ef5c,_0x16ea2e){var _0xf47396=_0xdd0daf||client;return _0xf47396['request'](_0xb052ca,_0x37e769)[_0xa785('0x1d')](function(_0x17490c){logger[_0xa785('0x1e')](_0xa785('0x1f'),_0x3bf018,_0xa785('0x20'));logger[_0xa785('0x21')](_0xa785('0x22'),_0x3bf018,_0xa785('0x20'),JSON[_0xa785('0x23')](_0x17490c));if(_0x17490c[_0xa785('0x24')]){if(_0x17490c[_0xa785('0x24')][_0xa785('0x25')]===0x1f4){logger[_0xa785('0x24')](_0xa785('0x1f'),_0x3bf018,_0x17490c[_0xa785('0x24')][_0xa785('0x26')]);return _0x16ea2e(_0x17490c[_0xa785('0x24')][_0xa785('0x26')]);}logger['error'](_0xa785('0x1f'),_0x3bf018,_0x17490c[_0xa785('0x24')]['message']);return _0x52ef5c(_0x17490c['error'][_0xa785('0x26')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x3bf018,_0xa785('0x20'));_0x52ef5c(_0x17490c[_0xa785('0x27')]['message']);}})['catch'](function(_0x1a5c65){logger[_0xa785('0x24')](_0xa785('0x1f'),_0x3bf018,_0x1a5c65);_0x16ea2e(_0x1a5c65);});});}function respondWithStatusCode(_0x2437b2,_0x5ac6ce){_0x5ac6ce=_0x5ac6ce||0xcc;return function(_0x439c54){if(_0x439c54){return _0x2437b2['sendStatus'](_0x5ac6ce);}return _0x2437b2[_0xa785('0x28')](_0x5ac6ce)[_0xa785('0x29')]();};}function respondWithResult(_0x1268f7,_0x4a68d4){_0x4a68d4=_0x4a68d4||0xc8;return function(_0x99b409){if(_0x99b409){return _0x1268f7[_0xa785('0x28')](_0x4a68d4)[_0xa785('0x2a')](_0x99b409);}};}function respondWithFilteredResult(_0x4e32c8,_0x3fc06d){return function(_0x4285ef){if(_0x4285ef){var _0x2aff2a=typeof _0x3fc06d[_0xa785('0x2b')]===_0xa785('0x2c')&&typeof _0x3fc06d[_0xa785('0x2d')]===_0xa785('0x2c');var _0x27f1c1=_0x4285ef[_0xa785('0x2e')];var _0x36ebad=_0x2aff2a?0x0:_0x3fc06d[_0xa785('0x2b')];var _0x10576c=_0x2aff2a?_0x4285ef[_0xa785('0x2e')]:_0x3fc06d['offset']+_0x3fc06d[_0xa785('0x2d')];var _0x353710;if(_0x10576c>=_0x27f1c1){_0x10576c=_0x27f1c1;_0x353710=0xc8;}else{_0x353710=0xce;}_0x4e32c8[_0xa785('0x28')](_0x353710);return _0x4e32c8[_0xa785('0x2f')](_0xa785('0x30'),_0x36ebad+'-'+_0x10576c+'/'+_0x27f1c1)['json'](_0x4285ef);}return null;};}function patchUpdates(_0x140884){return function(_0x3ebac8){try{jsonpatch[_0xa785('0x31')](_0x3ebac8,_0x140884,!![]);}catch(_0x841a4){return BPromise[_0xa785('0x32')](_0x841a4);}return _0x3ebac8[_0xa785('0x33')]();};}function saveUpdates(_0x6e6199,_0x1ed413){return function(_0x37d626){if(_0x37d626){return _0x37d626[_0xa785('0x34')](_0x6e6199)[_0xa785('0x1d')](function(_0x2747cf){return _0x2747cf;});}return null;};}function removeEntity(_0xec9d1b,_0x5b5a96){return function(_0x146fca){if(_0x146fca){return _0x146fca[_0xa785('0x35')]()[_0xa785('0x1d')](function(){var _0x44af0d=_0x146fca[_0xa785('0x36')]({'plain':!![]});var _0x3077d4='SmsAccounts';return db[_0xa785('0x37')][_0xa785('0x35')]({'where':{'type':_0x3077d4,'resourceId':_0x44af0d['id']}})[_0xa785('0x1d')](function(){return _0x146fca;});})[_0xa785('0x1d')](function(){_0xec9d1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f82e,_0xabfc75){return function(_0x34f7e0){if(!_0x34f7e0){_0x26f82e[_0xa785('0x38')](0x194);}return _0x34f7e0;};}function handleError(_0x5b1df2,_0x1da25c){_0x1da25c=_0x1da25c||0x1f4;return function(_0x4a6180){logger[_0xa785('0x24')](_0x4a6180[_0xa785('0x39')]);if(_0x4a6180['name']){delete _0x4a6180['name'];}_0x5b1df2[_0xa785('0x28')](_0x1da25c)['send'](_0x4a6180);};}exports[_0xa785('0x3a')]=function(_0x4a4400,_0x213208){var _0x42b469={'include':[{'model':db['Pause'],'as':_0xa785('0x3b')}]},_0x456359={},_0x3b322={'count':0x0,'rows':[]};var _0x1cba1e=_[_0xa785('0x3c')](db[_0xa785('0x3d')]['rawAttributes'],function(_0x40ca68){return{'name':_0x40ca68[_0xa785('0x3e')],'type':_0x40ca68[_0xa785('0x3f')][_0xa785('0x40')]};});_0x456359['model']=_[_0xa785('0x3c')](_0x1cba1e,_0xa785('0x41'));_0x456359['query']=_[_0xa785('0x42')](_0x4a4400['query']);_0x456359[_0xa785('0x43')]=_[_0xa785('0x44')](_0x456359['model'],_0x456359[_0xa785('0x45')]);_0x42b469[_0xa785('0x46')]=_[_0xa785('0x44')](_0x456359['model'],qs[_0xa785('0x47')](_0x4a4400['query'][_0xa785('0x47')]));_0x42b469[_0xa785('0x46')]=_0x42b469[_0xa785('0x46')][_0xa785('0x48')]?_0x42b469[_0xa785('0x46')]:_0x456359['model'];if(!_0x4a4400[_0xa785('0x45')]['hasOwnProperty'](_0xa785('0x49'))){_0x42b469[_0xa785('0x2d')]=qs['limit'](_0x4a4400['query'][_0xa785('0x2d')]);_0x42b469[_0xa785('0x2b')]=qs[_0xa785('0x2b')](_0x4a4400[_0xa785('0x45')]['offset']);}_0x42b469[_0xa785('0x4a')]=qs[_0xa785('0x4b')](_0x4a4400[_0xa785('0x45')][_0xa785('0x4b')]);_0x42b469[_0xa785('0x4c')]=qs[_0xa785('0x43')](_[_0xa785('0x4d')](_0x4a4400['query'],_0x456359[_0xa785('0x43')]),_0x1cba1e);if(_0x4a4400[_0xa785('0x45')][_0xa785('0x4e')]){_0x42b469[_0xa785('0x4c')]=_['merge'](_0x42b469[_0xa785('0x4c')],{'$or':_['map'](_0x1cba1e,function(_0x4a3d55){if(_0x4a3d55[_0xa785('0x3f')]!==_0xa785('0x4f')){var _0x2bb963={};_0x2bb963[_0x4a3d55[_0xa785('0x41')]]={'$like':'%'+_0x4a4400[_0xa785('0x45')][_0xa785('0x4e')]+'%'};return _0x2bb963;}})});}_0x42b469=_[_0xa785('0x50')]({},_0x42b469,_0x4a4400[_0xa785('0x51')]);var _0x44eb4a={'where':_0x42b469['where']};return db[_0xa785('0x3d')][_0xa785('0x2e')](_0x44eb4a)['then'](function(_0x5948f3){_0x3b322[_0xa785('0x2e')]=_0x5948f3;if(_0x4a4400[_0xa785('0x45')][_0xa785('0x52')]){_0x42b469[_0xa785('0x53')]=[{'all':!![]}];}return db[_0xa785('0x3d')][_0xa785('0x54')](_0x42b469);})[_0xa785('0x1d')](function(_0x33ad34){_0x3b322[_0xa785('0x55')]=_0x33ad34;return _0x3b322;})[_0xa785('0x1d')](respondWithFilteredResult(_0x213208,_0x42b469))[_0xa785('0x56')](handleError(_0x213208,null));};exports[_0xa785('0x57')]=function(_0x11cc8c,_0x5672a9){var _0xb616f0={'raw':![],'where':{'id':_0x11cc8c[_0xa785('0x58')]['id']},'include':[{'model':db[_0xa785('0x59')],'as':'mandatoryDispositionPause'}]},_0x4d8a4e={};_0x4d8a4e[_0xa785('0x5a')]=_[_0xa785('0x42')](db[_0xa785('0x3d')][_0xa785('0x5b')]);_0x4d8a4e['query']=_[_0xa785('0x42')](_0x11cc8c[_0xa785('0x45')]);_0x4d8a4e[_0xa785('0x43')]=_[_0xa785('0x44')](_0x4d8a4e[_0xa785('0x5a')],_0x4d8a4e[_0xa785('0x45')]);_0xb616f0['attributes']=_[_0xa785('0x44')](_0x4d8a4e[_0xa785('0x5a')],qs['fields'](_0x11cc8c['query'][_0xa785('0x47')]));_0xb616f0[_0xa785('0x46')]=_0xb616f0[_0xa785('0x46')][_0xa785('0x48')]?_0xb616f0['attributes']:_0x4d8a4e[_0xa785('0x5a')];if(_0x11cc8c[_0xa785('0x45')][_0xa785('0x52')]){_0xb616f0[_0xa785('0x53')]=[{'all':!![]}];}_0xb616f0=_[_0xa785('0x50')]({},_0xb616f0,_0x11cc8c[_0xa785('0x51')]);return db[_0xa785('0x3d')][_0xa785('0x5c')](_0xb616f0)[_0xa785('0x1d')](handleEntityNotFound(_0x5672a9,null))[_0xa785('0x1d')](respondWithResult(_0x5672a9,null))['catch'](handleError(_0x5672a9,null));};exports[_0xa785('0x5d')]=function(_0x2efbde,_0x11583d){return db[_0xa785('0x3d')][_0xa785('0x5d')](_0x2efbde['body'],{})['then'](function(_0x4e787f){var _0x5245c3=_0x2efbde[_0xa785('0x5e')]['get']({'plain':!![]});if(!_0x5245c3)throw new Error(_0xa785('0x5f'));if(_0x5245c3[_0xa785('0x60')]===_0xa785('0x5e')){var _0x12d7e3=_0x4e787f[_0xa785('0x36')]({'plain':!![]});var _0x49de79=_0xa785('0x61');return db[_0xa785('0x62')][_0xa785('0x5c')]({'where':{'name':_0x49de79,'userProfileId':_0x5245c3['userProfileId']},'raw':!![]})[_0xa785('0x1d')](function(_0x12d56f){if(_0x12d56f&&_0x12d56f[_0xa785('0x63')]===0x0){return db[_0xa785('0x37')][_0xa785('0x5d')]({'name':_0x12d7e3['name'],'resourceId':_0x12d7e3['id'],'type':_0x12d56f['name'],'sectionId':_0x12d56f['id']},{})['then'](function(){return _0x4e787f;});}else{return _0x4e787f;}})[_0xa785('0x56')](function(_0x35f446){logger[_0xa785('0x24')](_0xa785('0x64'),_0x35f446);throw _0x35f446;});}return _0x4e787f;})[_0xa785('0x1d')](respondWithResult(_0x11583d,0xc9))[_0xa785('0x56')](handleError(_0x11583d,null));};exports[_0xa785('0x34')]=function(_0x4de780,_0x467f24){if(_0x4de780[_0xa785('0x65')]['id']){delete _0x4de780[_0xa785('0x65')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x4de780['params']['id']},'include':[{'model':db[_0xa785('0x59')],'as':'mandatoryDispositionPause'}]})[_0xa785('0x1d')](handleEntityNotFound(_0x467f24,null))['then'](saveUpdates(_0x4de780[_0xa785('0x65')],null))[_0xa785('0x1d')](respondWithResult(_0x467f24,null))[_0xa785('0x56')](handleError(_0x467f24,null));};exports[_0xa785('0x35')]=function(_0x24d36b,_0x4fa21b){return db['SmsAccount'][_0xa785('0x5c')]({'where':{'id':_0x24d36b[_0xa785('0x58')]['id']}})['then'](handleEntityNotFound(_0x4fa21b,null))['then'](removeEntity(_0x4fa21b,null))[_0xa785('0x56')](handleError(_0x4fa21b,null));};exports[_0xa785('0x66')]=function(_0x54a5ba,_0x3c8029){return db[_0xa785('0x3d')][_0xa785('0x66')]()[_0xa785('0x1d')](respondWithResult(_0x3c8029,null))[_0xa785('0x56')](handleError(_0x3c8029,null));};exports[_0xa785('0x67')]=function(_0x4d597b,_0x374a9b,_0x177b8a){if(_0x4d597b[_0xa785('0x65')]['id']){delete _0x4d597b['body']['id'];}return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0x4d597b['params']['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x374a9b,null))[_0xa785('0x1d')](function(_0x2f96f0){if(_0x2f96f0){_0x4d597b[_0xa785('0x65')][_0xa785('0x68')]=_0x2f96f0['id'];return db[_0xa785('0x69')]['create'](_0x4d597b[_0xa785('0x65')]);}})['then'](respondWithResult(_0x374a9b,null))['catch'](handleError(_0x374a9b,null));};exports['getDispositions']=function(_0x2dc1f6,_0x38b4a6,_0x26e609){var _0x48541d={'raw':![],'where':{}};var _0x485c46={};var _0x2e1f55={'count':0x0,'rows':[]};return db[_0xa785('0x3d')][_0xa785('0x6a')]({'where':{'id':_0x2dc1f6['params']['id']}})['then'](handleEntityNotFound(_0x38b4a6,null))[_0xa785('0x1d')](function(_0x222312){if(_0x222312){_0x485c46['model']=_[_0xa785('0x42')](db[_0xa785('0x69')][_0xa785('0x5b')]);_0x485c46[_0xa785('0x45')]=_['keys'](_0x2dc1f6[_0xa785('0x45')]);_0x485c46[_0xa785('0x43')]=_[_0xa785('0x44')](_0x485c46[_0xa785('0x5a')],_0x485c46[_0xa785('0x45')]);_0x48541d[_0xa785('0x46')]=_[_0xa785('0x44')](_0x485c46[_0xa785('0x5a')],qs['fields'](_0x2dc1f6[_0xa785('0x45')][_0xa785('0x47')]));_0x48541d[_0xa785('0x46')]=_0x48541d[_0xa785('0x46')][_0xa785('0x48')]?_0x48541d['attributes']:_0x485c46[_0xa785('0x5a')];if(!_0x2dc1f6[_0xa785('0x45')][_0xa785('0x6b')](_0xa785('0x49'))){_0x48541d[_0xa785('0x2d')]=qs['limit'](_0x2dc1f6[_0xa785('0x45')][_0xa785('0x2d')]);_0x48541d[_0xa785('0x2b')]=qs[_0xa785('0x2b')](_0x2dc1f6['query']['offset']);}_0x48541d[_0xa785('0x4a')]=qs[_0xa785('0x4b')](_0x2dc1f6[_0xa785('0x45')][_0xa785('0x4b')]);_0x48541d['where']=qs[_0xa785('0x43')](_[_0xa785('0x4d')](_0x2dc1f6[_0xa785('0x45')],_0x485c46[_0xa785('0x43')]));_0x48541d[_0xa785('0x4c')][_0xa785('0x68')]=_0x222312['id'];if(_0x2dc1f6[_0xa785('0x45')][_0xa785('0x4e')]){_0x48541d['where']=_[_0xa785('0x50')](_0x48541d[_0xa785('0x4c')],{'$or':_[_0xa785('0x3c')](_0x48541d[_0xa785('0x46')],function(_0x916ba7){var _0x1a1163={};_0x1a1163[_0x916ba7]={'$like':'%'+_0x2dc1f6['query'][_0xa785('0x4e')]+'%'};return _0x1a1163;})});}_0x48541d=_[_0xa785('0x50')]({},_0x48541d,_0x2dc1f6[_0xa785('0x51')]);return db[_0xa785('0x69')][_0xa785('0x2e')]({'where':_0x48541d[_0xa785('0x4c')]})[_0xa785('0x1d')](function(_0x18db55){_0x2e1f55['count']=_0x18db55;if(_0x2dc1f6[_0xa785('0x45')][_0xa785('0x52')]){_0x48541d['include']=[{'all':!![]}];}return db[_0xa785('0x69')][_0xa785('0x54')](_0x48541d);})[_0xa785('0x1d')](function(_0xbe66b6){_0x2e1f55[_0xa785('0x55')]=_0xbe66b6;return _0x2e1f55;});}})[_0xa785('0x1d')](respondWithFilteredResult(_0x38b4a6,_0x48541d))[_0xa785('0x56')](handleError(_0x38b4a6,null));};exports[_0xa785('0x6c')]=function(_0x5cec62,_0x3c5635,_0x5e2703){return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0x5cec62[_0xa785('0x58')]['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x3c5635,null))[_0xa785('0x1d')](function(_0x5db52c){if(_0x5db52c){return _0x5db52c[_0xa785('0x6c')](_0x5cec62['query'][_0xa785('0x6d')]);}})[_0xa785('0x1d')](respondWithStatusCode(_0x3c5635,null))[_0xa785('0x56')](handleError(_0x3c5635,null));};exports[_0xa785('0x6e')]=function(_0xb7c2f2,_0x376f75,_0x2b6104){if(_0xb7c2f2[_0xa785('0x65')]['id']){delete _0xb7c2f2[_0xa785('0x65')]['id'];}return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0xb7c2f2[_0xa785('0x58')]['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x376f75,null))[_0xa785('0x1d')](function(_0x332894){if(_0x332894){_0xb7c2f2['body']['SmsAccountId']=_0x332894['id'];return db['CannedAnswer']['create'](_0xb7c2f2[_0xa785('0x65')]);}})['then'](respondWithResult(_0x376f75,null))['catch'](handleError(_0x376f75,null));};exports[_0xa785('0x6f')]=function(_0x548326,_0x4a9d04,_0x26390e){var _0x609aae={'raw':![],'where':{}};var _0x220067={};var _0x18b420={'count':0x0,'rows':[]};return db[_0xa785('0x3d')][_0xa785('0x6a')]({'where':{'id':_0x548326[_0xa785('0x58')]['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x4a9d04,null))[_0xa785('0x1d')](function(_0x3829a6){if(_0x3829a6){_0x220067['model']=_[_0xa785('0x42')](db['CannedAnswer']['rawAttributes']);_0x220067['query']=_[_0xa785('0x42')](_0x548326[_0xa785('0x45')]);_0x220067[_0xa785('0x43')]=_[_0xa785('0x44')](_0x220067[_0xa785('0x5a')],_0x220067[_0xa785('0x45')]);_0x609aae['attributes']=_[_0xa785('0x44')](_0x220067['model'],qs[_0xa785('0x47')](_0x548326[_0xa785('0x45')]['fields']));_0x609aae['attributes']=_0x609aae[_0xa785('0x46')][_0xa785('0x48')]?_0x609aae[_0xa785('0x46')]:_0x220067['model'];if(!_0x548326[_0xa785('0x45')][_0xa785('0x6b')]('nolimit')){_0x609aae[_0xa785('0x2d')]=qs[_0xa785('0x2d')](_0x548326['query'][_0xa785('0x2d')]);_0x609aae['offset']=qs['offset'](_0x548326[_0xa785('0x45')][_0xa785('0x2b')]);}_0x609aae[_0xa785('0x4a')]=qs[_0xa785('0x4b')](_0x548326[_0xa785('0x45')]['sort']);_0x609aae[_0xa785('0x4c')]=qs[_0xa785('0x43')](_['pick'](_0x548326['query'],_0x220067[_0xa785('0x43')]));_0x609aae['where']['SmsAccountId']=_0x3829a6['id'];if(_0x548326[_0xa785('0x45')][_0xa785('0x4e')]){_0x609aae[_0xa785('0x4c')]=_[_0xa785('0x50')](_0x609aae[_0xa785('0x4c')],{'$or':_[_0xa785('0x3c')](_0x609aae[_0xa785('0x46')],function(_0x3904fa){var _0x4e2684={};_0x4e2684[_0x3904fa]={'$like':'%'+_0x548326['query'][_0xa785('0x4e')]+'%'};return _0x4e2684;})});}_0x609aae=_['merge']({},_0x609aae,_0x548326[_0xa785('0x51')]);return db['CannedAnswer']['count']({'where':_0x609aae[_0xa785('0x4c')]})[_0xa785('0x1d')](function(_0x20de43){_0x18b420[_0xa785('0x2e')]=_0x20de43;if(_0x548326['query'][_0xa785('0x52')]){_0x609aae['include']=[{'all':!![]}];}return db[_0xa785('0x70')][_0xa785('0x54')](_0x609aae);})[_0xa785('0x1d')](function(_0xc9330a){_0x18b420[_0xa785('0x55')]=_0xc9330a;return _0x18b420;});}})[_0xa785('0x1d')](respondWithFilteredResult(_0x4a9d04,_0x609aae))[_0xa785('0x56')](handleError(_0x4a9d04,null));};exports[_0xa785('0x71')]=function(_0x52d19c,_0x516186,_0x1ce914){return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0x52d19c[_0xa785('0x58')]['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x516186,null))['then'](function(_0x376ec8){if(_0x376ec8){return _0x376ec8[_0xa785('0x71')](_0x52d19c[_0xa785('0x45')][_0xa785('0x6d')]);}})[_0xa785('0x1d')](respondWithStatusCode(_0x516186,null))['catch'](handleError(_0x516186,null));};exports['notify']=function(_0x5d534e,_0x53aaca,_0x40afa3){var _0x8e362d={'channel':_0xa785('0x72')};var _0x45138e=[];var _0x231038=[];var _0x91ca42={};return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0x5d534e[_0xa785('0x58')]['id']},'include':[{'model':db[_0xa785('0x73')],'as':_0xa785('0x74')}]})[_0xa785('0x1d')](handleEntityNotFound(_0x53aaca,null))[_0xa785('0x1d')](function(_0x33da56){_0x8e362d[_0xa785('0x75')]=_0x33da56;_0x8e362d['applications']=_[_0xa785('0x76')](_0x33da56[_0xa785('0x74')],['priority'],[_0xa785('0x77')]);if(_0x8e362d['account'][_0xa785('0x74')]){delete _0x8e362d[_0xa785('0x75')][_0xa785('0x74')];}return db['CmContact'][_0xa785('0x66')]();})['then'](function(_0x53cd2d){if(!_0x53cd2d){throw new db['Sequelize'][(_0xa785('0x78'))](_0xa785('0x79'));}_0x45138e=_[_0xa785('0x7a')](_[_0xa785('0x42')](_0x53cd2d),['createdAt',_0xa785('0x7b')]);_0x231038=_[_0xa785('0x7a')](_[_0xa785('0x42')](_0x53cd2d),[_0xa785('0x7c'),'updatedAt','CompanyId',_0xa785('0x7d')]);_0x8e362d[_0xa785('0x65')]={'mapKey':_0xa785('0x7e')};if(_0x8e362d[_0xa785('0x75')][_0xa785('0x3f')]){switch(_0x8e362d[_0xa785('0x75')]['type']){case _0xa785('0x7f'):_0x8e362d[_0xa785('0x65')][_0xa785('0x80')]=_0x5d534e[_0xa785('0x65')]['From'];_0x8e362d[_0xa785('0x65')][_0xa785('0x65')]=_0x5d534e['body'][_0xa785('0x81')];_0x8e362d[_0xa785('0x65')]['messageId']=_0x5d534e[_0xa785('0x65')][_0xa785('0x82')];break;case _0xa785('0x83'):_0x8e362d[_0xa785('0x65')][_0xa785('0x80')]='+'+_0x5d534e[_0xa785('0x65')][_0xa785('0x84')];_0x8e362d[_0xa785('0x65')][_0xa785('0x65')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x85')];break;case'connectel':_0x8e362d['body'][_0xa785('0x80')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x80')];_0x8e362d[_0xa785('0x65')][_0xa785('0x65')]=_0x5d534e['body'][_0xa785('0x26')];break;case _0xa785('0x86'):_0x8e362d['body'][_0xa785('0x80')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x80')];_0x8e362d[_0xa785('0x65')][_0xa785('0x65')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x65')];_0x8e362d[_0xa785('0x65')][_0xa785('0x87')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x88')];break;case'plivo':_0x8e362d[_0xa785('0x65')][_0xa785('0x80')]=_0x5d534e[_0xa785('0x65')]['From'];_0x8e362d[_0xa785('0x65')]['body']=_0x5d534e[_0xa785('0x65')][_0xa785('0x89')];_0x8e362d[_0xa785('0x65')][_0xa785('0x87')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x8a')];break;case _0xa785('0x8b'):_0x8e362d['body'][_0xa785('0x80')]='+'+_0x5d534e[_0xa785('0x65')]['results'][0x0][_0xa785('0x80')];_0x8e362d[_0xa785('0x65')][_0xa785('0x65')]=_0x5d534e['body'][_0xa785('0x8c')][0x0][_0xa785('0x85')];_0x8e362d[_0xa785('0x65')][_0xa785('0x87')]=_0x5d534e['body'][_0xa785('0x8c')][0x0][_0xa785('0x87')];break;case _0xa785('0x8d'):_0x8e362d[_0xa785('0x65')][_0xa785('0x80')]=_0x5d534e['body'][_0xa785('0x8e')];_0x8e362d['body']['body']=_0x5d534e[_0xa785('0x65')][_0xa785('0x8f')][_0xa785('0x26')];break;case'clickatell':_0x8e362d[_0xa785('0x65')][_0xa785('0x80')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x90')];_0x8e362d[_0xa785('0x65')][_0xa785('0x65')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x85')];_0x8e362d[_0xa785('0x65')][_0xa785('0x87')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x91')];break;case _0xa785('0x92'):_0x8e362d[_0xa785('0x65')]['messageId']=_0x5d534e[_0xa785('0x65')][0x0][_0xa785('0x26')]['id'];_0x8e362d[_0xa785('0x65')][_0xa785('0x80')]=_0x5d534e[_0xa785('0x65')][0x0]['message'][_0xa785('0x80')];_0x8e362d[_0xa785('0x65')][_0xa785('0x65')]=_0x5d534e[_0xa785('0x65')][0x0][_0xa785('0x26')][_0xa785('0x85')];break;case _0xa785('0x93'):_0x8e362d['body'][_0xa785('0x80')]=_0x5d534e[_0xa785('0x65')][_0xa785('0x80')];_0x8e362d[_0xa785('0x65')]['body']=_0x5d534e[_0xa785('0x65')][_0xa785('0x26')];_0x8e362d['body'][_0xa785('0x87')]=_0x5d534e[_0xa785('0x65')]['refid'];break;}}if(_0x8e362d['body']['id']){delete _0x8e362d['body']['id'];}if(_['isNil'](_0x8e362d['body'][_0xa785('0x80')])){throw new db[(_0xa785('0x94'))][(_0xa785('0x78'))](_0xa785('0x95'));}if(_[_0xa785('0x96')](_0x8e362d['body'][_0xa785('0x65')])||_0x8e362d['body']['body']===''){throw new db[(_0xa785('0x94'))][(_0xa785('0x78'))](_0xa785('0x97'));}if(_[_0xa785('0x96')](_0x8e362d[_0xa785('0x65')][_0xa785('0x98')])){throw new db[(_0xa785('0x94'))][(_0xa785('0x78'))](_0xa785('0x99')+_0x231038);}if(!_['includes'](_0x231038,_0x8e362d['body'][_0xa785('0x98')])){throw new db[(_0xa785('0x94'))][(_0xa785('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x231038);}_0x91ca42[_0x8e362d[_0xa785('0x65')][_0xa785('0x98')]]=_0x8e362d[_0xa785('0x65')]['from'];return db[_0xa785('0x9a')][_0xa785('0x5c')]({'where':{'id':_0x8e362d[_0xa785('0x75')][_0xa785('0x7d')]},'include':[{'model':db[_0xa785('0x9b')],'as':_0xa785('0x9c'),'where':_0x91ca42,'limit':0x1,'order':[[_0xa785('0x7b'),_0xa785('0x9d')]]}]});})[_0xa785('0x1d')](handleEntityNotFound(_0x53aaca,null))[_0xa785('0x1d')](function(_0x44a57e){if(_0x44a57e){_0x8e362d['list']=_[_0xa785('0x9e')](_0x44a57e,['Contacts']);if(_0x44a57e['Contacts'][_0xa785('0x48')]){return _0x44a57e[_0xa785('0x9c')][0x0];}var _0x125fb3=_['defaults'](_0x8e362d[_0xa785('0x65')],{'firstName':_0x8e362d[_0xa785('0x65')][_0xa785('0x80')],'ListId':_0x44a57e['id']});_0x125fb3[_0x8e362d[_0xa785('0x65')][_0xa785('0x98')]]=_0x8e362d[_0xa785('0x65')][_0xa785('0x80')];return db[_0xa785('0x9b')][_0xa785('0x5d')](_0x125fb3,{'fields':_0x45138e,'raw':!![]});}})[_0xa785('0x1d')](handleEntityNotFound(_0x53aaca,null))[_0xa785('0x1d')](function(_0x3462ab){if(_0x3462ab){_0x8e362d[_0xa785('0x9f')]=_0x3462ab;var _0x5b4d75={'ContactId':_0x3462ab['id'],'phone':_0x8e362d['body'][_0xa785('0x80')],'SmsAccountId':_0x5d534e[_0xa785('0x58')]['id']};var _0xe483af={'ContactId':_0x3462ab['id'],'SmsAccountId':_0x5d534e[_0xa785('0x58')]['id'],'closed':![]};return db[_0xa785('0xa0')][_0xa785('0x5c')]({'where':_0xe483af})['then'](function(_0x5d89fb){if(_0x5d89fb){return[_0x5d89fb,![]];}return db[_0xa785('0xa0')][_0xa785('0x5d')](_0x5b4d75)['then'](function(_0xe2b040){return[_0xe2b040,!![]];});});}})[_0xa785('0xa1')](function(_0x415231,_0x3b6144){_0x8e362d['interaction']=_0x415231[_0xa785('0x36')]({'plain':!![]});_0x8e362d[_0xa785('0xa2')]['created']=![];if(_0x3b6144){if(_0x8e362d[_0xa785('0x75')][_0xa785('0xa3')]){_0x8e362d[_0xa785('0xa4')][_0xa785('0xa5')]({'id':0x0,'priority':_0x8e362d[_0xa785('0xa4')][_0xa785('0x48')]+0x1,'app':_0xa785('0xa6'),'appdata':'unmanaged','interval':_0xa785('0xa7')});}_0x8e362d[_0xa785('0xa2')][_0xa785('0xa8')]=!![];}return db['SmsMessage'][_0xa785('0x5d')]({'phone':_0x8e362d[_0xa785('0x65')][_0xa785('0x80')],'messageId':_0x8e362d[_0xa785('0x65')][_0xa785('0x87')],'body':_0x8e362d[_0xa785('0x65')][_0xa785('0x65')],'SmsAccountId':_0x5d534e[_0xa785('0x58')]['id'],'SmsInteractionId':_0x415231['id'],'direction':'in','ContactId':_0x415231[_0xa785('0xa9')],'AttachmentId':_0x8e362d[_0xa785('0x65')][_0xa785('0xaa')]});})[_0xa785('0x1d')](function(_0x509a2f){_0x8e362d[_0xa785('0x26')]=_0x509a2f;if(_0x8e362d[_0xa785('0xa2')][_0xa785('0xab')]){return db[_0xa785('0xac')][_0xa785('0x5c')]({'attributes':['id',_0xa785('0x41')],'where':{'id':_0x8e362d['interaction']['UserId']}})[_0xa785('0x1d')](function(_0x383c8a){if(_0x383c8a){_0x8e362d['applications'][_0xa785('0xad')]({'id':0x0,'priority':0x0,'app':_0xa785('0xae'),'appdata':_0x383c8a[_0xa785('0x41')]+','+(_0x8e362d[_0xa785('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0xa785('0xa7')});}return respondWithRpcPromise(_0xa785('0xaf'),_0xa785('0xb0'),_0x8e362d);});}return respondWithRpcPromise('Start',_0xa785('0xb0'),_0x8e362d);})[_0xa785('0x1d')](function(_0x1dec29){if(_0x1dec29){var _0x15d9c3=0xc8;var _0x54b21f=_0xa785('0xb1');logger[_0xa785('0x1e')](_0xa785('0x22'),_0x54b21f,_0x15d9c3,_0xa785('0xb2'));logger[_0xa785('0x21')](_0xa785('0xb3'),_0x54b21f,_0x15d9c3,_0xa785('0xb2'),JSON[_0xa785('0x23')](_0x1dec29));if(_0x8e362d['account'][_0xa785('0x3f')]==='twilio'){return _0x53aaca[_0xa785('0x28')](_0x15d9c3)[_0xa785('0x2f')]('Content-Type',_0xa785('0xb4'))[_0xa785('0xb5')](_0xa785('0xb6'));}else{return _0x53aaca[_0xa785('0x28')](_0x15d9c3)[_0xa785('0x2a')](_0x1dec29);}}})['catch'](handleError(_0x53aaca,null));};exports['addApplications']=function(_0x566c49,_0x211c05){var _0x330f1f=_0x566c49['params']['id'];var _0x16583d=_0x566c49['body'];var _0x1b9648=0xc8;var _0x1f9929=null;return db[_0xa785('0xb7')][_0xa785('0xb8')]({'isolationLevel':db['sequelize'][_0xa785('0xb9')]['ISOLATION_LEVELS'][_0xa785('0xba')]},function(_0x5a265b){return db[_0xa785('0x3d')][_0xa785('0x6a')]({'where':{'id':_0x330f1f},'transaction':_0x5a265b})[_0xa785('0x1d')](function(_0x22a11b){if(_0x22a11b){return db[_0xa785('0x73')][_0xa785('0x35')]({'where':{'SmsAccountId':_0x330f1f},'transaction':_0x5a265b})[_0xa785('0x1d')](function(){var _0x221ed5=_[_0xa785('0x3c')](_0x16583d,function(_0x2fcb79){_0x2fcb79[_0xa785('0x68')]=_0x330f1f;return _0x2fcb79;});return db[_0xa785('0x73')][_0xa785('0xbb')](_0x221ed5,{'transaction':_0x5a265b});});}else{_0x1b9648=0x194;_0x1f9929=[];}});})[_0xa785('0x1d')](function(){if(_0x1b9648!==0x194){return db[_0xa785('0x73')][_0xa785('0xbc')]({'where':{'SmsAccountId':_0x330f1f},'order':_0xa785('0xbd')})[_0xa785('0x1d')](function(_0x425a72){_0x1f9929=_0x425a72;});}})[_0xa785('0x56')](function(_0x3aaf29){_0x1b9648=0x1f4;logger['error'](_0x3aaf29[_0xa785('0x39')]);if(_0x3aaf29['name']){delete _0x3aaf29[_0xa785('0x41')];}_0x1f9929=_0x3aaf29;})['finally'](function(){if(_0x1f9929===null){_0x211c05[_0xa785('0x38')](_0x1b9648);}else{if(_0x1b9648===0x1f4){_0x211c05[_0xa785('0x28')](_0x1b9648)[_0xa785('0xb5')](_0x1f9929);}else{_0x211c05[_0xa785('0x28')](_0x1b9648)['json'](_0x1f9929);}}});};exports[_0xa785('0xbe')]=function(_0x45cab0,_0x560362,_0x296cc8){var _0x5b3e19={};var _0xdeabb3={};var _0x1cd0d5;var _0x514cfd;return db[_0xa785('0x3d')][_0xa785('0x6a')]({'where':{'id':_0x45cab0[_0xa785('0x58')]['id']}})['then'](handleEntityNotFound(_0x560362,null))[_0xa785('0x1d')](function(_0x381e36){if(_0x381e36){_0x1cd0d5=_0x381e36;_0xdeabb3[_0xa785('0x5a')]=_[_0xa785('0x42')](db[_0xa785('0x73')]['rawAttributes']);_0xdeabb3['query']=_[_0xa785('0x42')](_0x45cab0[_0xa785('0x45')]);_0xdeabb3[_0xa785('0x43')]=_[_0xa785('0x44')](_0xdeabb3[_0xa785('0x5a')],_0xdeabb3[_0xa785('0x45')]);_0x5b3e19[_0xa785('0x46')]=_[_0xa785('0x44')](_0xdeabb3[_0xa785('0x5a')],qs[_0xa785('0x47')](_0x45cab0['query'][_0xa785('0x47')]));_0x5b3e19[_0xa785('0x46')]=_0x5b3e19[_0xa785('0x46')]['length']?_0x5b3e19[_0xa785('0x46')]:_0xdeabb3[_0xa785('0x5a')];_0x5b3e19[_0xa785('0x4a')]=qs[_0xa785('0x4b')](_0x45cab0[_0xa785('0x45')][_0xa785('0x4b')]);_0x5b3e19[_0xa785('0x4c')]=qs[_0xa785('0x43')](_[_0xa785('0x4d')](_0x45cab0[_0xa785('0x45')],_0xdeabb3[_0xa785('0x43')]));if(_0x45cab0[_0xa785('0x45')]['filter']){_0x5b3e19['where']=_[_0xa785('0x50')](_0x5b3e19[_0xa785('0x4c')],{'$or':_[_0xa785('0x3c')](_0x5b3e19['attributes'],function(_0x467fe1){var _0x23cbaf={};_0x23cbaf[_0x467fe1]={'$like':'%'+_0x45cab0[_0xa785('0x45')][_0xa785('0x4e')]+'%'};return _0x23cbaf;})});}_0x5b3e19=_[_0xa785('0x50')]({},_0x5b3e19,_0x45cab0[_0xa785('0x51')]);return _0x1cd0d5[_0xa785('0xbe')](_0x5b3e19);}})['then'](function(_0xa89994){if(_0xa89994){_0x514cfd=_0xa89994[_0xa785('0x48')];if(!_0x45cab0[_0xa785('0x45')][_0xa785('0x6b')](_0xa785('0x49'))){_0x5b3e19[_0xa785('0x2d')]=qs[_0xa785('0x2d')](_0x45cab0[_0xa785('0x45')][_0xa785('0x2d')]);_0x5b3e19[_0xa785('0x2b')]=qs[_0xa785('0x2b')](_0x45cab0[_0xa785('0x45')]['offset']);}return _0x1cd0d5[_0xa785('0xbe')](_0x5b3e19);}})[_0xa785('0x1d')](function(_0x4e61ac){if(_0x4e61ac){return _0x4e61ac?{'count':_0x514cfd,'rows':_0x4e61ac}:null;}})[_0xa785('0x1d')](respondWithResult(_0x560362,null))['catch'](handleError(_0x560362,null));};exports['getInteractions']=function(_0x25b28e,_0x12d426,_0x4ea22b){var _0x173d7b={'raw':![],'where':{}};var _0x521ce0={};var _0x257dcc={'count':0x0,'rows':[]};return db[_0xa785('0x3d')][_0xa785('0x6a')]({'where':{'id':_0x25b28e[_0xa785('0x58')]['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x12d426,null))['then'](function(_0x54e387){if(_0x54e387){_0x521ce0[_0xa785('0x5a')]=_[_0xa785('0x42')](db['SmsInteraction'][_0xa785('0x5b')]);_0x521ce0['query']=_[_0xa785('0x42')](_0x25b28e['query']);_0x521ce0[_0xa785('0x43')]=_[_0xa785('0x44')](_0x521ce0[_0xa785('0x5a')],_0x521ce0[_0xa785('0x45')]);_0x173d7b['attributes']=_[_0xa785('0x44')](_0x521ce0[_0xa785('0x5a')],qs[_0xa785('0x47')](_0x25b28e['query'][_0xa785('0x47')]));_0x173d7b[_0xa785('0x46')]=_0x173d7b[_0xa785('0x46')]['length']?_0x173d7b[_0xa785('0x46')]:_0x521ce0[_0xa785('0x5a')];if(!_0x25b28e[_0xa785('0x45')][_0xa785('0x6b')]('nolimit')){_0x173d7b[_0xa785('0x2d')]=qs[_0xa785('0x2d')](_0x25b28e['query']['limit']);_0x173d7b[_0xa785('0x2b')]=qs['offset'](_0x25b28e[_0xa785('0x45')][_0xa785('0x2b')]);}_0x173d7b['order']=qs['sort'](_0x25b28e['query'][_0xa785('0x4b')]);_0x173d7b['where']=qs[_0xa785('0x43')](_[_0xa785('0x4d')](_0x25b28e[_0xa785('0x45')],_0x521ce0[_0xa785('0x43')]));_0x173d7b[_0xa785('0x4c')][_0xa785('0x68')]=_0x54e387['id'];if(_0x25b28e[_0xa785('0x45')]['filter']){_0x173d7b[_0xa785('0x4c')]=_[_0xa785('0x50')](_0x173d7b[_0xa785('0x4c')],{'$or':_[_0xa785('0x3c')](_0x173d7b[_0xa785('0x46')],function(_0xa40d6c){var _0x11bb70={};_0x11bb70[_0xa40d6c]={'$like':'%'+_0x25b28e[_0xa785('0x45')][_0xa785('0x4e')]+'%'};return _0x11bb70;})});}_0x173d7b=_[_0xa785('0x50')]({},_0x173d7b,_0x25b28e[_0xa785('0x51')]);return db['SmsInteraction'][_0xa785('0x2e')]({'where':_0x173d7b['where']})[_0xa785('0x1d')](function(_0x3fd43c){_0x257dcc[_0xa785('0x2e')]=_0x3fd43c;if(_0x25b28e['query'][_0xa785('0x52')]){_0x173d7b['include']=[{'model':db[_0xa785('0x9b')],'as':'Contact','required':![]},{'model':db[_0xa785('0xac')],'as':_0xa785('0xbf'),'attributes':['name',_0xa785('0xc0'),_0xa785('0xc1')],'required':![]},{'model':db[_0xa785('0xc2')],'as':_0xa785('0xc3'),'attributes':['id',_0xa785('0x41'),_0xa785('0xc4')],'where':_0x25b28e[_0xa785('0x45')]['tag']?{'id':_0x25b28e['query'][_0xa785('0xc5')]}:undefined,'required':_0x25b28e[_0xa785('0x45')]['tag']?!![]:![]}];}return db[_0xa785('0xa0')][_0xa785('0x54')](_0x173d7b);})['then'](function(_0x185f21){_0x257dcc[_0xa785('0x55')]=_0x185f21;return _0x257dcc;});}})[_0xa785('0x1d')](respondWithFilteredResult(_0x12d426,_0x173d7b))[_0xa785('0x56')](handleError(_0x12d426,null));};exports[_0xa785('0xb5')]=function(_0x2dc31a,_0x1079ef,_0x2a78f3){var _0x5633dd,_0x119f6d,_0x11091e;if(_[_0xa785('0x96')](_0x2dc31a[_0xa785('0x65')][_0xa785('0x65')])||_0x2dc31a[_0xa785('0x65')][_0xa785('0x65')]===''){throw new db[(_0xa785('0x94'))][(_0xa785('0x78'))](_0xa785('0x97'));}if(_[_0xa785('0x96')](_0x2dc31a[_0xa785('0x65')]['to'])){throw new db[(_0xa785('0x94'))]['ValidationError'](_0xa785('0xc6'));}_0x5633dd=_0x2dc31a[_0xa785('0x65')]['to'];return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0x2dc31a[_0xa785('0x58')]['id']},'include':[{'model':db[_0xa785('0x9a')],'as':_0xa785('0xc7'),'include':[{'model':db[_0xa785('0x9b')],'as':_0xa785('0x9c'),'where':{'mobile':_0x5633dd},'limit':0x1,'order':[[_0xa785('0x7b'),'DESC']]}]}]})[_0xa785('0x1d')](handleEntityNotFound(_0x1079ef,null))[_0xa785('0x1d')](function(_0x37f129){if(_0x37f129&&_0x37f129[_0xa785('0xc7')]){_0x119f6d=_0x37f129[_0xa785('0x36')]({'plain':!![]});if(_0x119f6d[_0xa785('0xc7')]&&_0x119f6d[_0xa785('0xc7')]['Contacts'][_0xa785('0x48')]){return _0x119f6d[_0xa785('0xc7')]['Contacts'][0x0];}return db[_0xa785('0x9b')][_0xa785('0x5d')](_[_0xa785('0x17')](_0x2dc31a[_0xa785('0x65')],{'firstName':_0x5633dd,'mobile':_0x5633dd,'phone':_0x5633dd,'ListId':_0x119f6d[_0xa785('0x7d')]}));}})['then'](handleEntityNotFound(_0x1079ef,null))[_0xa785('0x1d')](function(_0x39e52b){if(_0x39e52b){_0x11091e=_0x39e52b;return db[_0xa785('0xa0')][_0xa785('0x5c')]({'where':{'ContactId':_0x11091e['id'],'closed':![],'SmsAccountId':_0x119f6d['id']}})['then'](function(_0x3ae67a){if(_0x3ae67a){return[_0x3ae67a,![]];}return db[_0xa785('0xa0')][_0xa785('0x5d')]({'UserId':_0x2dc31a[_0xa785('0x5e')]['id'],'ContactId':_0x11091e['id'],'SmsAccountId':_0x119f6d['id'],'phone':_0x5633dd,'firstMsgDirection':_0xa785('0xc8'),'Messages':[_[_0xa785('0x50')](_0x2dc31a[_0xa785('0x65')],{'read':![],'body':_0x2dc31a[_0xa785('0x65')][_0xa785('0x65')],'phone':_0x5633dd,'SmsAccountId':_0x119f6d['id'],'UserId':_0x2dc31a[_0xa785('0x5e')]['id'],'ContactId':_0x11091e['id']})]},{'include':[{'model':db[_0xa785('0xc9')],'as':'Messages'}]})[_0xa785('0x1d')](function(_0x444e03){return[_0x444e03,!![]];});});}})['spread'](function(_0x431839,_0x54fc4c){if(_0x54fc4c){return _0x431839;}return db[_0xa785('0xc9')][_0xa785('0x5d')](_[_0xa785('0x50')](_0x2dc31a[_0xa785('0x65')],{'read':![],'body':_0x2dc31a['body'][_0xa785('0x65')],'phone':_0x5633dd,'SmsAccountId':_0x119f6d['id'],'SmsInteractionId':_0x431839['id'],'UserId':_0x2dc31a[_0xa785('0x5e')]['id'],'ContactId':_0x11091e['id']}))[_0xa785('0x1d')](function(_0x59ee96){_0x431839[_0xa785('0xca')]['Messages']=[];_0x431839[_0xa785('0xca')][_0xa785('0xcb')][_0xa785('0xa5')](_0x59ee96[_0xa785('0xca')]);return _0x431839;});})[_0xa785('0x1d')](respondWithResult(_0x1079ef,null))[_0xa785('0x56')](handleError(_0x1079ef,null));};exports[_0xa785('0x28')]=function(_0x40a7a3,_0x286aa1,_0x35682d){if(_0x40a7a3[_0xa785('0x65')]['id']){delete _0x40a7a3[_0xa785('0x65')]['id'];}var _0x1e50fb,_0xc47a86,_0x2e7a85;return db['SmsAccount'][_0xa785('0x5c')]({'where':{'id':_0x40a7a3[_0xa785('0x58')]['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x286aa1,null))[_0xa785('0x1d')](function(_0x49463b){if(_0x49463b){_0x2e7a85=_0x49463b;logger[_0xa785('0x21')](_0xa785('0x22'),_0xa785('0x28'),_0xa785('0xcc'),_0x49463b['type'],util['inspect'](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));switch(_0x49463b['type']){case _0xa785('0x83'):if(_0x40a7a3[_0xa785('0x65')][_0xa785('0xcd')]&&_0x40a7a3[_0xa785('0x65')][_0xa785('0x28')]){_0xc47a86=_0x40a7a3[_0xa785('0x65')][_0xa785('0x28')];return db[_0xa785('0xc9')][_0xa785('0x5c')]({'where':{'messageId':_0x40a7a3[_0xa785('0x65')][_0xa785('0xcd')]}});}break;case _0xa785('0xce'):if(_0x40a7a3[_0xa785('0x65')][_0xa785('0xcf')]&&_0x40a7a3[_0xa785('0x65')]['statusInt']){_0xc47a86=_0x40a7a3[_0xa785('0x65')][_0xa785('0xd0')];return db['SmsMessage'][_0xa785('0x5c')]({'where':{'messageId':_0x40a7a3['body'][_0xa785('0xcf')]}});}break;case _0xa785('0x86'):if(_0x40a7a3[_0xa785('0x65')][_0xa785('0x88')]&&_0x40a7a3[_0xa785('0x65')]['status_code']){_0xc47a86=_0x40a7a3[_0xa785('0x65')]['status_code'];return db[_0xa785('0xc9')]['find']({'where':{'messageId':_0x40a7a3[_0xa785('0x65')][_0xa785('0x88')]}});}break;case _0xa785('0x8b'):var _0x233055=_0x40a7a3['body']['results'][0x0];if(_0x233055[_0xa785('0x87')]&&_0x233055[_0xa785('0x28')][_0xa785('0xd1')]===_0xa785('0xd2')){_0xc47a86=_0x233055['status'][_0xa785('0xd1')];return db[_0xa785('0xc9')][_0xa785('0x5c')]({'where':{'messageId':_0x233055['messageId']}});}break;case _0xa785('0xd3'):if(_0x40a7a3[_0xa785('0x65')]['messageId']&&_0x40a7a3[_0xa785('0x65')][_0xa785('0x28')]){_0xc47a86=_0x40a7a3[_0xa785('0x65')][_0xa785('0x28')];return db[_0xa785('0xc9')][_0xa785('0x5c')]({'where':{'messageId':_0x40a7a3[_0xa785('0x65')][_0xa785('0x87')]}});}break;case _0xa785('0x92'):if(_0x40a7a3[_0xa785('0x65')][0x0][_0xa785('0x26')]['id']){_0xc47a86=_0x40a7a3[_0xa785('0x65')][0x0][_0xa785('0x3f')];return db[_0xa785('0xc9')][_0xa785('0x5c')]({'where':{'messageId':_0x40a7a3[_0xa785('0x65')][0x0][_0xa785('0x26')]['id']}});}break;case _0xa785('0x93'):if(_0x40a7a3[_0xa785('0x65')]['redif']&&_0x40a7a3[_0xa785('0x65')][_0xa785('0x28')]){_0xc47a86=_0x40a7a3[_0xa785('0x65')][_0xa785('0x28')];return db[_0xa785('0xc9')][_0xa785('0x5c')]({'where':{'messageId':_0x40a7a3[_0xa785('0x65')][_0xa785('0xd4')]}});}break;}}})[_0xa785('0x1d')](handleEntityNotFound(_0x286aa1,null))[_0xa785('0x1d')](function(_0x1008b8){if(_0x1008b8){_0x1e50fb=_0x1008b8;switch(_0x2e7a85[_0xa785('0x3f')]){case _0xa785('0x83'):if(_0xc47a86===_0xa785('0xd2')){return _0x1e50fb[_0xa785('0x34')]({'read':!![]});}else{logger['error'](_0xa785('0x22'),'status',_0xa785('0x83'),util['inspect'](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa785('0xce'):if(_0xc47a86==='1'){return _0x1e50fb[_0xa785('0x34')]({'read':!![]});}else{logger[_0xa785('0x24')](_0xa785('0x22'),_0xa785('0x28'),_0xa785('0x83'),util['inspect'](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa785('0x86'):if(!_0x40a7a3[_0xa785('0x65')][_0xa785('0xd5')]&&_0xc47a86>=0xc8&&_0xc47a86<=0xce){return _0x1e50fb[_0xa785('0x34')]({'read':!![]});}else{logger['error'](_0xa785('0x22'),_0xa785('0x28'),_0xa785('0x86'),util['inspect'](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa785('0x8b'):var _0x4de097=_0x40a7a3[_0xa785('0x65')]['results'][0x0];if(_0x4de097['status'][_0xa785('0xd1')]==='DELIVERED'){return _0x1e50fb[_0xa785('0x34')]({'read':!![]});}else{logger[_0xa785('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa785('0x28'),'infobip',util[_0xa785('0xd6')](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0xc47a86==_0xa785('0xd7')||_0xc47a86==_0xa785('0xd8')){return _0x1e50fb[_0xa785('0x34')]({'read':!![]});}else{logger[_0xa785('0x24')](_0xa785('0x22'),_0xa785('0x28'),_0xa785('0xd3'),util[_0xa785('0xd6')](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa785('0x92'):if(_0xc47a86==_0xa785('0xd9')){return _0x1e50fb[_0xa785('0x34')]({'read':!![]});}else{logger[_0xa785('0x24')](_0xa785('0x22'),_0xa785('0x28'),'bandwidth',util[_0xa785('0xd6')](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa785('0x93'):if(_0xc47a86===_0xa785('0xda')||_0xc47a86==='ACCEPTD'){return _0x1e50fb[_0xa785('0x34')]({'read':!![]});}else{logger['error'](_0xa785('0x22'),_0xa785('0x28'),'intelepeer',util[_0xa785('0xd6')](_0x40a7a3[_0xa785('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x1e50fb;}})[_0xa785('0x1d')](respondWithResult(_0x286aa1,null))[_0xa785('0x56')](handleError(_0x286aa1,null));};exports['statusGet']=function(_0xfa4fe0,_0x587d16,_0x486783){var _0x28281f,_0x14bde4,_0x8817d9;return db['SmsAccount'][_0xa785('0x5c')]({'where':{'id':_0xfa4fe0[_0xa785('0x58')]['id']}})['then'](handleEntityNotFound(_0x587d16,null))[_0xa785('0x1d')](function(_0x3029fb){if(_0x3029fb){_0x8817d9=_0x3029fb;logger[_0xa785('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa785('0x28'),_0xa785('0xcc'),_0x3029fb[_0xa785('0x3f')],util[_0xa785('0xd6')](_0xfa4fe0[_0xa785('0x45')],{'showHidden':![],'depth':null}));switch(_0x3029fb['type']){case _0xa785('0x8d'):if(_0xfa4fe0['query'][_0xa785('0xdb')]&&_0xfa4fe0[_0xa785('0x45')][_0xa785('0xdc')]){_0x14bde4=_0xfa4fe0[_0xa785('0x45')][_0xa785('0xdc')];return db[_0xa785('0xc9')][_0xa785('0x5c')]({'where':{'messageId':_0xfa4fe0[_0xa785('0x45')][_0xa785('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x587d16,null))['then'](function(_0x4e3eb9){if(_0x4e3eb9){_0x28281f=_0x4e3eb9;switch(_0x8817d9['type']){case _0xa785('0x8d'):if(_0x14bde4==='2'||_0x14bde4==='6'){return _0x28281f[_0xa785('0x34')]({'read':!![]});}else{logger[_0xa785('0x24')](_0xa785('0x22'),_0xa785('0x28'),_0xa785('0x8d'),util[_0xa785('0xd6')](_0xfa4fe0[_0xa785('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x28281f;}})[_0xa785('0x1d')](respondWithResult(_0x587d16,null))[_0xa785('0x56')](handleError(_0x587d16,null));};exports[_0xa785('0xdd')]=function(_0x9e09a1,_0x2408ca,_0x6d949c){return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0x9e09a1[_0xa785('0x58')]['id']}})['then'](handleEntityNotFound(_0x2408ca,null))[_0xa785('0x1d')](function(_0x5db7f1){if(_0x5db7f1){return _0x5db7f1[_0xa785('0xdd')](_0x9e09a1[_0xa785('0x65')][_0xa785('0x6d')],_[_0xa785('0x9e')](_0x9e09a1[_0xa785('0x65')],[_0xa785('0x6d'),'id'])||{})[_0xa785('0xa1')](function(_0x1f3f92){for(var _0x256641=0x0;_0x256641<_0x9e09a1[_0xa785('0x65')]['ids'][_0xa785('0x48')];_0x256641+=0x1){socket[_0xa785('0xde')](_0xa785('0xdf'),{'UserId':Number(_0x9e09a1[_0xa785('0x65')][_0xa785('0x6d')][_0x256641]),'SmsAccountId':Number(_0x9e09a1['params']['id'])});}return _0x1f3f92;});}})[_0xa785('0x1d')](respondWithResult(_0x2408ca,null))['catch'](handleError(_0x2408ca,null));};exports[_0xa785('0xe0')]=function(_0x3eb2d4,_0x3c5934,_0x4f2a5a){return db[_0xa785('0x3d')][_0xa785('0x5c')]({'where':{'id':_0x3eb2d4[_0xa785('0x58')]['id']}})[_0xa785('0x1d')](handleEntityNotFound(_0x3c5934,null))[_0xa785('0x1d')](function(_0x5eca70){if(_0x5eca70){return _0x5eca70['removeAgents'](_0x3eb2d4[_0xa785('0x45')][_0xa785('0x6d')])[_0xa785('0x1d')](function(){if(_[_0xa785('0xe1')](_0x3eb2d4['query'][_0xa785('0x6d')])){for(var _0x156b40=0x0;_0x156b40<_0x3eb2d4['query'][_0xa785('0x6d')][_0xa785('0x48')];_0x156b40+=0x1){socket['emit'](_0xa785('0xe2'),{'UserId':Number(_0x3eb2d4[_0xa785('0x45')][_0xa785('0x6d')][_0x156b40]),'SmsAccountId':Number(_0x3eb2d4[_0xa785('0x58')]['id'])});}}else{socket[_0xa785('0xde')](_0xa785('0xe2'),{'UserId':Number(_0x3eb2d4[_0xa785('0x45')][_0xa785('0x6d')]),'SmsAccountId':Number(_0x3eb2d4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3c5934,null))[_0xa785('0x56')](handleError(_0x3c5934,null));};exports[_0xa785('0xe3')]=function(_0x25c6f9,_0x50f79c,_0x39832a){var _0x4f49b4={};var _0x3fdb4e={};var _0x392f86;var _0xb4236b;return db['SmsAccount'][_0xa785('0x6a')]({'where':{'id':_0x25c6f9[_0xa785('0x58')]['id']}})['then'](handleEntityNotFound(_0x50f79c,null))[_0xa785('0x1d')](function(_0x4c896e){if(_0x4c896e){_0x392f86=_0x4c896e;_0x3fdb4e[_0xa785('0x5a')]=_[_0xa785('0x42')](db['User'][_0xa785('0x5b')]);_0x3fdb4e['query']=_[_0xa785('0x42')](_0x25c6f9['query']);_0x3fdb4e['filters']=_[_0xa785('0x44')](_0x3fdb4e[_0xa785('0x5a')],_0x3fdb4e[_0xa785('0x45')]);_0x4f49b4[_0xa785('0x46')]=_[_0xa785('0x44')](_0x3fdb4e['model'],qs[_0xa785('0x47')](_0x25c6f9[_0xa785('0x45')]['fields']));_0x4f49b4[_0xa785('0x46')]=_0x4f49b4[_0xa785('0x46')][_0xa785('0x48')]?_0x4f49b4[_0xa785('0x46')]:_0x3fdb4e[_0xa785('0x5a')];_0x4f49b4[_0xa785('0x4a')]=qs['sort'](_0x25c6f9[_0xa785('0x45')]['sort']);_0x4f49b4[_0xa785('0x4c')]=qs['filters'](_[_0xa785('0x4d')](_0x25c6f9[_0xa785('0x45')],_0x3fdb4e[_0xa785('0x43')]));if(_0x25c6f9[_0xa785('0x45')][_0xa785('0x4e')]){_0x4f49b4[_0xa785('0x4c')]=_[_0xa785('0x50')](_0x4f49b4[_0xa785('0x4c')],{'$or':_[_0xa785('0x3c')](_0x4f49b4[_0xa785('0x46')],function(_0x17335d){var _0xdf8e91={};_0xdf8e91[_0x17335d]={'$like':'%'+_0x25c6f9[_0xa785('0x45')][_0xa785('0x4e')]+'%'};return _0xdf8e91;})});}_0x4f49b4=_[_0xa785('0x50')]({},_0x4f49b4,_0x25c6f9[_0xa785('0x51')]);return _0x392f86[_0xa785('0xe3')](_0x4f49b4);}})[_0xa785('0x1d')](function(_0x3b0bb2){if(_0x3b0bb2){_0xb4236b=_0x3b0bb2[_0xa785('0x48')];if(!_0x25c6f9[_0xa785('0x45')][_0xa785('0x6b')](_0xa785('0x49'))){_0x4f49b4[_0xa785('0x2d')]=qs[_0xa785('0x2d')](_0x25c6f9[_0xa785('0x45')][_0xa785('0x2d')]);_0x4f49b4['offset']=qs[_0xa785('0x2b')](_0x25c6f9[_0xa785('0x45')][_0xa785('0x2b')]);}return _0x392f86[_0xa785('0xe3')](_0x4f49b4);}})['then'](function(_0x323803){if(_0x323803){return _0x323803?{'count':_0xb4236b,'rows':_0x323803}:null;}})['then'](respondWithResult(_0x50f79c,null))[_0xa785('0x56')](handleError(_0x50f79c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index cfefd76..68a86ec 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 _0x3aa2=['SmsAccount','setMaxListeners','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1c5992,_0xaef8f1){var _0x357d15=function(_0x2e1b27){while(--_0x2e1b27){_0x1c5992['push'](_0x1c5992['shift']());}};_0x357d15(++_0xaef8f1);}(_0x3aa2,0x142));var _0x23aa=function(_0x451402,_0x561cb8){_0x451402=_0x451402-0x0;var _0x4ffb7f=_0x3aa2[_0x451402];return _0x4ffb7f;};'use strict';var EventEmitter=require(_0x23aa('0x0'));var SmsAccount=require(_0x23aa('0x1'))['db'][_0x23aa('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x23aa('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x23aa('0x4'),'afterDestroy':_0x23aa('0x5')};function emitEvent(_0x5dd29e){return function(_0x26abf3,_0x9c66aa,_0x2a9577){SmsAccountEvents['emit'](_0x5dd29e+':'+_0x26abf3['id'],_0x26abf3);SmsAccountEvents['emit'](_0x5dd29e,_0x26abf3);_0x2a9577(null);};}for(var e in events){if(events[_0x23aa('0x6')](e)){var event=events[e];SmsAccount[_0x23aa('0x7')](e,emitEvent(event));}}module[_0x23aa('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x622e=['hook','exports','events','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x167fe5,_0x380299){var _0x473e28=function(_0x3e64c3){while(--_0x3e64c3){_0x167fe5['push'](_0x167fe5['shift']());}};_0x473e28(++_0x380299);}(_0x622e,0x1a9));var _0xe622=function(_0xaadc70,_0x2c050d){_0xaadc70=_0xaadc70-0x0;var _0x3ac647=_0x622e[_0xaadc70];return _0x3ac647;};'use strict';var EventEmitter=require(_0xe622('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xe622('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe622('0x2')](0x0);var events={'afterCreate':_0xe622('0x3'),'afterUpdate':_0xe622('0x4'),'afterDestroy':_0xe622('0x5')};function emitEvent(_0x5e7e69){return function(_0x2f8e26,_0x49f7d5,_0x514423){SmsAccountEvents[_0xe622('0x6')](_0x5e7e69+':'+_0x2f8e26['id'],_0x2f8e26);SmsAccountEvents[_0xe622('0x6')](_0x5e7e69,_0x2f8e26);_0x514423(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe622('0x7')](e,emitEvent(event));}}module[_0xe622('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 926fcdf..0b43bb3 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 _0xd304=['sms_accounts','lodash','util','api','moment','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd304,0xb1));var _0x4d30=function(_0xed703a,_0x16621a){_0xed703a=_0xed703a-0x0;var _0x146e63=_0xd304[_0xed703a];return _0x146e63;};'use strict';var _=require(_0x4d30('0x0'));var util=require(_0x4d30('0x1'));var logger=require('../../config/logger')(_0x4d30('0x2'));var moment=require(_0x4d30('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d30('0x4'));var rimraf=require(_0x4d30('0x5'));var config=require(_0x4d30('0x6'));var attributes=require(_0x4d30('0x7'));module[_0x4d30('0x8')]=function(_0x266bc5,_0x52ae63){return _0x266bc5[_0x4d30('0x9')]('SmsAccount',attributes,{'tableName':_0x4d30('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce75=['sms_accounts','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount'];(function(_0x344f66,_0x4bbf22){var _0x17a74e=function(_0x1a896e){while(--_0x1a896e){_0x344f66['push'](_0x344f66['shift']());}};_0x17a74e(++_0x4bbf22);}(_0xce75,0x1af));var _0x5ce7=function(_0x2d4ce0,_0x4c8ab0){_0x2d4ce0=_0x2d4ce0-0x0;var _0x49545b=_0xce75[_0x2d4ce0];return _0x49545b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5ce7('0x0'));var BPromise=require(_0x5ce7('0x1'));var rp=require(_0x5ce7('0x2'));var fs=require('fs');var path=require(_0x5ce7('0x3'));var rimraf=require(_0x5ce7('0x4'));var config=require(_0x5ce7('0x5'));var attributes=require(_0x5ce7('0x6'));module[_0x5ce7('0x7')]=function(_0x5d8245,_0x9d93c7){return _0x5d8245['define'](_0x5ce7('0x8'),attributes,{'tableName':_0x5ce7('0x9'),'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 7df0ae5..b2698bf 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 _0xc0e6=['model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','include','map'];(function(_0x583907,_0xd2e4b4){var _0x247526=function(_0x5bac09){while(--_0x5bac09){_0x583907['push'](_0x583907['shift']());}};_0x247526(++_0xd2e4b4);}(_0xc0e6,0x79));var _0x6c0e=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xc0e6[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0x6c0e('0x0'));var util=require(_0x6c0e('0x1'));var moment=require(_0x6c0e('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c0e('0x3'));var fs=require('fs');var Redis=require(_0x6c0e('0x4'));var db=require(_0x6c0e('0x5'))['db'];var utils=require(_0x6c0e('0x6'));var logger=require(_0x6c0e('0x7'))(_0x6c0e('0x8'));var config=require(_0x6c0e('0x9'));var jayson=require(_0x6c0e('0xa'));var client=jayson[_0x6c0e('0xb')][_0x6c0e('0xc')]({'port':0x232a});config[_0x6c0e('0xd')]=_[_0x6c0e('0xe')](config[_0x6c0e('0xd')],{'host':_0x6c0e('0xf'),'port':0x18eb});var socket=require(_0x6c0e('0x10'))(new Redis(config[_0x6c0e('0xd')]));require(_0x6c0e('0x11'))[_0x6c0e('0x12')](socket);function respondWithRpcPromise(_0x12618d,_0x511835,_0x29b653){return new BPromise(function(_0x193673,_0x299000){return client[_0x6c0e('0x13')](_0x12618d,_0x29b653)[_0x6c0e('0x14')](function(_0x230afc){logger[_0x6c0e('0x15')](_0x6c0e('0x16'),_0x511835,'request\x20sent');logger[_0x6c0e('0x17')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x511835,_0x6c0e('0x18'),JSON[_0x6c0e('0x19')](_0x230afc));if(_0x230afc[_0x6c0e('0x1a')]){if(_0x230afc['error'][_0x6c0e('0x1b')]===0x1f4){logger[_0x6c0e('0x1a')](_0x6c0e('0x16'),_0x511835,_0x230afc['error'][_0x6c0e('0x1c')]);return _0x299000(_0x230afc[_0x6c0e('0x1a')][_0x6c0e('0x1c')]);}logger[_0x6c0e('0x1a')](_0x6c0e('0x16'),_0x511835,_0x230afc[_0x6c0e('0x1a')]['message']);return _0x193673(_0x230afc[_0x6c0e('0x1a')][_0x6c0e('0x1c')]);}else{logger[_0x6c0e('0x15')](_0x6c0e('0x16'),_0x511835,_0x6c0e('0x18'));_0x193673(_0x230afc['result'][_0x6c0e('0x1c')]);}})[_0x6c0e('0x1d')](function(_0x2d08f2){logger[_0x6c0e('0x1a')](_0x6c0e('0x16'),_0x511835,_0x2d08f2);_0x299000(_0x2d08f2);});});}exports[_0x6c0e('0x1e')]=function(_0xf1d492){var _0x134326=this;return new Promise(function(_0x32477d,_0x94f24f){return db[_0x6c0e('0x1f')][_0x6c0e('0x20')]({'raw':_0xf1d492['options']?_0xf1d492['options'][_0x6c0e('0x21')]===undefined?!![]:![]:!![],'where':_0xf1d492['options']?_0xf1d492[_0x6c0e('0x22')][_0x6c0e('0x23')]||null:null,'attributes':_0xf1d492[_0x6c0e('0x22')]?_0xf1d492[_0x6c0e('0x22')][_0x6c0e('0x24')]||null:null,'include':_0xf1d492[_0x6c0e('0x22')]?_0xf1d492[_0x6c0e('0x22')][_0x6c0e('0x25')]?_[_0x6c0e('0x26')](_0xf1d492[_0x6c0e('0x22')][_0x6c0e('0x25')],function(_0x4c5ff6){return{'model':db[_0x4c5ff6[_0x6c0e('0x27')]],'as':_0x4c5ff6['as'],'attributes':_0x4c5ff6[_0x6c0e('0x24')],'include':_0x4c5ff6[_0x6c0e('0x25')]?_[_0x6c0e('0x26')](_0x4c5ff6[_0x6c0e('0x25')],function(_0x46a3f4){return{'model':db[_0x46a3f4['model']],'as':_0x46a3f4['as'],'attributes':_0x46a3f4['attributes'],'include':_0x46a3f4[_0x6c0e('0x25')]?_[_0x6c0e('0x26')](_0x46a3f4['include'],function(_0x5cccf5){return{'model':db[_0x5cccf5[_0x6c0e('0x27')]],'as':_0x5cccf5['as'],'attributes':_0x5cccf5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48b9c8){logger[_0x6c0e('0x15')](_0x6c0e('0x1e'),_0xf1d492);logger['debug']('ShowSmsAccount',_0xf1d492,JSON[_0x6c0e('0x19')](_0x48b9c8));_0x32477d(_0x48b9c8);})[_0x6c0e('0x1d')](function(_0x8140cc){logger[_0x6c0e('0x1a')]('ShowSmsAccount',_0x8140cc[_0x6c0e('0x1c')],_0xf1d492);_0x94f24f(_0x134326[_0x6c0e('0x1a')](0x1f4,_0x8140cc[_0x6c0e('0x1c')]));});});}; \ No newline at end of file +var _0xe77f=['SmsAccount','find','options','raw','where','include','map','model','attributes','then','info','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSmsAccount'];(function(_0x288516,_0x54bc0f){var _0x549493=function(_0x106486){while(--_0x106486){_0x288516['push'](_0x288516['shift']());}};_0x549493(++_0x54bc0f);}(_0xe77f,0x11b));var _0xfe77=function(_0x40d7ba,_0x17a963){_0x40d7ba=_0x40d7ba-0x0;var _0x274ac7=_0xe77f[_0x40d7ba];return _0x274ac7;};'use strict';var _=require(_0xfe77('0x0'));var util=require('util');var moment=require(_0xfe77('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe77('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe77('0x3'));var logger=require(_0xfe77('0x4'))(_0xfe77('0x5'));var config=require(_0xfe77('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xfe77('0x7')]=_[_0xfe77('0x8')](config[_0xfe77('0x7')],{'host':_0xfe77('0x9'),'port':0x18eb});var socket=require(_0xfe77('0xa'))(new Redis(config['redis']));require(_0xfe77('0xb'))[_0xfe77('0xc')](socket);function respondWithRpcPromise(_0x2943b8,_0x413731,_0x573a56){return new BPromise(function(_0x4f3b60,_0x44c038){return client['request'](_0x2943b8,_0x573a56)['then'](function(_0x41f0bd){logger['info'](_0xfe77('0xd'),_0x413731,_0xfe77('0xe'));logger[_0xfe77('0xf')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x413731,_0xfe77('0xe'),JSON[_0xfe77('0x10')](_0x41f0bd));if(_0x41f0bd[_0xfe77('0x11')]){if(_0x41f0bd[_0xfe77('0x11')][_0xfe77('0x12')]===0x1f4){logger[_0xfe77('0x11')](_0xfe77('0xd'),_0x413731,_0x41f0bd[_0xfe77('0x11')][_0xfe77('0x13')]);return _0x44c038(_0x41f0bd[_0xfe77('0x11')][_0xfe77('0x13')]);}logger[_0xfe77('0x11')](_0xfe77('0xd'),_0x413731,_0x41f0bd[_0xfe77('0x11')][_0xfe77('0x13')]);return _0x4f3b60(_0x41f0bd[_0xfe77('0x11')][_0xfe77('0x13')]);}else{logger['info'](_0xfe77('0xd'),_0x413731,_0xfe77('0xe'));_0x4f3b60(_0x41f0bd[_0xfe77('0x14')][_0xfe77('0x13')]);}})[_0xfe77('0x15')](function(_0x1d9f36){logger[_0xfe77('0x11')](_0xfe77('0xd'),_0x413731,_0x1d9f36);_0x44c038(_0x1d9f36);});});}exports[_0xfe77('0x16')]=function(_0x375c7e){var _0x21b94e=this;return new Promise(function(_0xa8e39c,_0x54b8ad){return db[_0xfe77('0x17')][_0xfe77('0x18')]({'raw':_0x375c7e[_0xfe77('0x19')]?_0x375c7e[_0xfe77('0x19')][_0xfe77('0x1a')]===undefined?!![]:![]:!![],'where':_0x375c7e['options']?_0x375c7e['options'][_0xfe77('0x1b')]||null:null,'attributes':_0x375c7e[_0xfe77('0x19')]?_0x375c7e['options']['attributes']||null:null,'include':_0x375c7e[_0xfe77('0x19')]?_0x375c7e[_0xfe77('0x19')][_0xfe77('0x1c')]?_[_0xfe77('0x1d')](_0x375c7e[_0xfe77('0x19')][_0xfe77('0x1c')],function(_0x105690){return{'model':db[_0x105690['model']],'as':_0x105690['as'],'attributes':_0x105690['attributes'],'include':_0x105690[_0xfe77('0x1c')]?_[_0xfe77('0x1d')](_0x105690[_0xfe77('0x1c')],function(_0x5c680a){return{'model':db[_0x5c680a[_0xfe77('0x1e')]],'as':_0x5c680a['as'],'attributes':_0x5c680a[_0xfe77('0x1f')],'include':_0x5c680a[_0xfe77('0x1c')]?_[_0xfe77('0x1d')](_0x5c680a[_0xfe77('0x1c')],function(_0x5a8fbe){return{'model':db[_0x5a8fbe[_0xfe77('0x1e')]],'as':_0x5a8fbe['as'],'attributes':_0x5a8fbe[_0xfe77('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfe77('0x20')](function(_0x1802e3){logger[_0xfe77('0x21')]('ShowSmsAccount',_0x375c7e);logger[_0xfe77('0xf')](_0xfe77('0x16'),_0x375c7e,JSON[_0xfe77('0x10')](_0x1802e3));_0xa8e39c(_0x1802e3);})[_0xfe77('0x15')](function(_0x3f9472){logger[_0xfe77('0x11')](_0xfe77('0x16'),_0x3f9472[_0xfe77('0x13')],_0x375c7e);_0x54b8ad(_0x21b94e[_0xfe77('0x11')](0x1f4,_0x3f9472[_0xfe77('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 470153a..85a91d1 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 1433b9e..cad31a3 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_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 +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x4ff73a,_0x19af5c){var _0x292157=function(_0x24a897){while(--_0x24a897){_0x4ff73a['push'](_0x4ff73a['shift']());}};_0x292157(++_0x19af5c);}(_0x008c,0x188));var _0xc008=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x008c[_0x431ff8];return _0x84ccd4;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 6853321..44be11a 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 _0x5dc7=['STRING','noop','TEXT','INTEGER'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0x5dc7,0x123));var _0x75dc=function(_0x295d9d,_0x36d6ca){_0x295d9d=_0x295d9d-0x0;var _0x24f4e8=_0x5dc7[_0x295d9d];return _0x24f4e8;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x75dc('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x75dc('0x1')],'allowNull':![],'defaultValue':_0x75dc('0x2')},'appdata':{'type':Sequelize[_0x75dc('0x3')]()},'description':{'type':Sequelize[_0x75dc('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x2f26=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0xbb9a66,_0x1f044a){var _0x246ea4=function(_0x491d0e){while(--_0x491d0e){_0xbb9a66['push'](_0xbb9a66['shift']());}};_0x246ea4(++_0x1f044a);}(_0x2f26,0x12c));var _0x62f2=function(_0x3d6822,_0x206858){_0x3d6822=_0x3d6822-0x0;var _0x2235fe=_0x2f26[_0x3d6822];return _0x2235fe;};'use strict';var Sequelize=require(_0x62f2('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x62f2('0x1')],'allowNull':![],'defaultValue':_0x62f2('0x2')},'appdata':{'type':Sequelize[_0x62f2('0x3')]()},'description':{'type':Sequelize[_0x62f2('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x62f2('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a3b9c05..1577a83 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 _0x16e8=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','index','rawAttributes','fieldName','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','SmsApplication','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format'];(function(_0x20ea13,_0x167ee0){var _0xc498c3=function(_0x10f6c0){while(--_0x10f6c0){_0x20ea13['push'](_0x20ea13['shift']());}};_0xc498c3(++_0x167ee0);}(_0x16e8,0x1c1));var _0x816e=function(_0x69cfb2,_0x3fdb01){_0x69cfb2=_0x69cfb2-0x0;var _0x534a28=_0x16e8[_0x69cfb2];return _0x534a28;};'use strict';var emlformat=require(_0x816e('0x0'));var rimraf=require(_0x816e('0x1'));var zipdir=require(_0x816e('0x2'));var jsonpatch=require(_0x816e('0x3'));var rp=require(_0x816e('0x4'));var moment=require('moment');var BPromise=require(_0x816e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x816e('0x6'));var csv=require(_0x816e('0x7'));var ejs=require(_0x816e('0x8'));var fs=require('fs');var fs_extra=require(_0x816e('0x9'));var _=require(_0x816e('0xa'));var squel=require(_0x816e('0xb'));var crypto=require(_0x816e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x816e('0xd'));var toCsv=require(_0x816e('0x7'));var querystring=require('querystring');var Papa=require(_0x816e('0xe'));var Redis=require(_0x816e('0xf'));var authService=require(_0x816e('0x10'));var qs=require(_0x816e('0x11'));var as=require(_0x816e('0x12'));var hardwareService=require(_0x816e('0x13'));var logger=require('../../config/logger')(_0x816e('0x14'));var utils=require(_0x816e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x816e('0x16'));var db=require(_0x816e('0x17'))['db'];function respondWithStatusCode(_0x547ac4,_0x10c4cd){_0x10c4cd=_0x10c4cd||0xcc;return function(_0x5b5326){if(_0x5b5326){return _0x547ac4[_0x816e('0x18')](_0x10c4cd);}return _0x547ac4[_0x816e('0x19')](_0x10c4cd)[_0x816e('0x1a')]();};}function respondWithResult(_0x51216d,_0x1fac5a){_0x1fac5a=_0x1fac5a||0xc8;return function(_0x27dcd0){if(_0x27dcd0){return _0x51216d[_0x816e('0x19')](_0x1fac5a)[_0x816e('0x1b')](_0x27dcd0);}};}function respondWithFilteredResult(_0x4427f0,_0x3fbbe3){return function(_0x1eb7b7){if(_0x1eb7b7){var _0x2b3e0f=typeof _0x3fbbe3[_0x816e('0x1c')]===_0x816e('0x1d')&&typeof _0x3fbbe3[_0x816e('0x1e')]===_0x816e('0x1d');var _0x288768=_0x1eb7b7[_0x816e('0x1f')];var _0x3071fd=_0x2b3e0f?0x0:_0x3fbbe3[_0x816e('0x1c')];var _0x2bf540=_0x2b3e0f?_0x1eb7b7['count']:_0x3fbbe3['offset']+_0x3fbbe3['limit'];var _0x60d133;if(_0x2bf540>=_0x288768){_0x2bf540=_0x288768;_0x60d133=0xc8;}else{_0x60d133=0xce;}_0x4427f0[_0x816e('0x19')](_0x60d133);return _0x4427f0[_0x816e('0x20')](_0x816e('0x21'),_0x3071fd+'-'+_0x2bf540+'/'+_0x288768)[_0x816e('0x1b')](_0x1eb7b7);}return null;};}function patchUpdates(_0x58a8bd){return function(_0x550d86){try{jsonpatch[_0x816e('0x22')](_0x550d86,_0x58a8bd,!![]);}catch(_0x2f4799){return BPromise['reject'](_0x2f4799);}return _0x550d86[_0x816e('0x23')]();};}function saveUpdates(_0x5857fe,_0x5b37b0){return function(_0x21bd8e){if(_0x21bd8e){return _0x21bd8e[_0x816e('0x24')](_0x5857fe)['then'](function(_0x54ceec){return _0x54ceec;});}return null;};}function removeEntity(_0x24fbd4,_0x61d52b){return function(_0x1f15e5){if(_0x1f15e5){return _0x1f15e5[_0x816e('0x25')]()[_0x816e('0x26')](function(){_0x24fbd4[_0x816e('0x19')](0xcc)[_0x816e('0x1a')]();});}};}function handleEntityNotFound(_0x12bcf7,_0x4c30bc){return function(_0x131f70){if(!_0x131f70){_0x12bcf7[_0x816e('0x18')](0x194);}return _0x131f70;};}function handleError(_0x4717e2,_0x221753){_0x221753=_0x221753||0x1f4;return function(_0x46d451){logger['error'](_0x46d451[_0x816e('0x27')]);if(_0x46d451[_0x816e('0x28')]){delete _0x46d451[_0x816e('0x28')];}_0x4717e2[_0x816e('0x19')](_0x221753)['send'](_0x46d451);};}exports[_0x816e('0x29')]=function(_0x5ae7e,_0x42ed92){var _0x3f78c6={},_0x46cc13={},_0x420edf={'count':0x0,'rows':[]};var _0x5c6602=_['map'](db['SmsApplication'][_0x816e('0x2a')],function(_0x16e24d){return{'name':_0x16e24d[_0x816e('0x2b')],'type':_0x16e24d['type'][_0x816e('0x2c')]};});_0x46cc13[_0x816e('0x2d')]=_[_0x816e('0x2e')](_0x5c6602,_0x816e('0x28'));_0x46cc13['query']=_[_0x816e('0x2f')](_0x5ae7e['query']);_0x46cc13[_0x816e('0x30')]=_['intersection'](_0x46cc13[_0x816e('0x2d')],_0x46cc13[_0x816e('0x31')]);_0x3f78c6[_0x816e('0x32')]=_[_0x816e('0x33')](_0x46cc13[_0x816e('0x2d')],qs[_0x816e('0x34')](_0x5ae7e['query'][_0x816e('0x34')]));_0x3f78c6[_0x816e('0x32')]=_0x3f78c6['attributes'][_0x816e('0x35')]?_0x3f78c6['attributes']:_0x46cc13['model'];if(!_0x5ae7e[_0x816e('0x31')][_0x816e('0x36')](_0x816e('0x37'))){_0x3f78c6[_0x816e('0x1e')]=qs['limit'](_0x5ae7e[_0x816e('0x31')][_0x816e('0x1e')]);_0x3f78c6[_0x816e('0x1c')]=qs['offset'](_0x5ae7e[_0x816e('0x31')][_0x816e('0x1c')]);}_0x3f78c6[_0x816e('0x38')]=qs['sort'](_0x5ae7e[_0x816e('0x31')][_0x816e('0x39')]);_0x3f78c6[_0x816e('0x3a')]=qs['filters'](_['pick'](_0x5ae7e['query'],_0x46cc13[_0x816e('0x30')]),_0x5c6602);if(_0x5ae7e[_0x816e('0x31')][_0x816e('0x3b')]){_0x3f78c6[_0x816e('0x3a')]=_[_0x816e('0x3c')](_0x3f78c6[_0x816e('0x3a')],{'$or':_[_0x816e('0x2e')](_0x5c6602,function(_0x543752){if(_0x543752[_0x816e('0x3d')]!==_0x816e('0x3e')){var _0xdfbfbf={};_0xdfbfbf[_0x543752[_0x816e('0x28')]]={'$like':'%'+_0x5ae7e['query']['filter']+'%'};return _0xdfbfbf;}})});}_0x3f78c6=_['merge']({},_0x3f78c6,_0x5ae7e[_0x816e('0x3f')]);var _0xeedbf8={'where':_0x3f78c6[_0x816e('0x3a')]};return db[_0x816e('0x40')][_0x816e('0x1f')](_0xeedbf8)[_0x816e('0x26')](function(_0x2982ab){_0x420edf[_0x816e('0x1f')]=_0x2982ab;if(_0x5ae7e['query'][_0x816e('0x41')]){_0x3f78c6[_0x816e('0x42')]=[{'all':!![]}];}return db[_0x816e('0x40')][_0x816e('0x43')](_0x3f78c6);})[_0x816e('0x26')](function(_0x19aeef){_0x420edf[_0x816e('0x44')]=_0x19aeef;return _0x420edf;})[_0x816e('0x26')](respondWithFilteredResult(_0x42ed92,_0x3f78c6))[_0x816e('0x45')](handleError(_0x42ed92,null));};exports[_0x816e('0x46')]=function(_0x2a73e2,_0x596c92){var _0x5e92d9={'raw':!![],'where':{'id':_0x2a73e2['params']['id']}},_0x4b7ea0={};_0x4b7ea0[_0x816e('0x2d')]=_[_0x816e('0x2f')](db['SmsApplication'][_0x816e('0x2a')]);_0x4b7ea0[_0x816e('0x31')]=_[_0x816e('0x2f')](_0x2a73e2[_0x816e('0x31')]);_0x4b7ea0[_0x816e('0x30')]=_[_0x816e('0x33')](_0x4b7ea0[_0x816e('0x2d')],_0x4b7ea0[_0x816e('0x31')]);_0x5e92d9[_0x816e('0x32')]=_['intersection'](_0x4b7ea0['model'],qs[_0x816e('0x34')](_0x2a73e2['query'][_0x816e('0x34')]));_0x5e92d9[_0x816e('0x32')]=_0x5e92d9[_0x816e('0x32')][_0x816e('0x35')]?_0x5e92d9[_0x816e('0x32')]:_0x4b7ea0['model'];if(_0x2a73e2['query'][_0x816e('0x41')]){_0x5e92d9[_0x816e('0x42')]=[{'all':!![]}];}_0x5e92d9=_['merge']({},_0x5e92d9,_0x2a73e2[_0x816e('0x3f')]);return db[_0x816e('0x40')][_0x816e('0x47')](_0x5e92d9)[_0x816e('0x26')](handleEntityNotFound(_0x596c92,null))['then'](respondWithResult(_0x596c92,null))[_0x816e('0x45')](handleError(_0x596c92,null));};exports[_0x816e('0x48')]=function(_0x312ca7,_0x196032){return db[_0x816e('0x40')]['create'](_0x312ca7[_0x816e('0x49')],{})['then'](respondWithResult(_0x196032,0xc9))[_0x816e('0x45')](handleError(_0x196032,null));};exports[_0x816e('0x24')]=function(_0x458c03,_0x102daa){if(_0x458c03[_0x816e('0x49')]['id']){delete _0x458c03[_0x816e('0x49')]['id'];}return db[_0x816e('0x40')]['find']({'where':{'id':_0x458c03[_0x816e('0x4a')]['id']}})[_0x816e('0x26')](handleEntityNotFound(_0x102daa,null))[_0x816e('0x26')](saveUpdates(_0x458c03[_0x816e('0x49')],null))[_0x816e('0x26')](respondWithResult(_0x102daa,null))[_0x816e('0x45')](handleError(_0x102daa,null));};exports[_0x816e('0x25')]=function(_0x3d9c40,_0x4287f3){return db[_0x816e('0x40')][_0x816e('0x47')]({'where':{'id':_0x3d9c40[_0x816e('0x4a')]['id']}})[_0x816e('0x26')](handleEntityNotFound(_0x4287f3,null))[_0x816e('0x26')](removeEntity(_0x4287f3,null))[_0x816e('0x45')](handleError(_0x4287f3,null));}; \ No newline at end of file +var _0xc720=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','stack','name','send','index','SmsApplication','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse'];(function(_0xb1d3a6,_0x1300f2){var _0x169463=function(_0x57755f){while(--_0x57755f){_0xb1d3a6['push'](_0xb1d3a6['shift']());}};_0x169463(++_0x1300f2);}(_0xc720,0xce));var _0x0c72=function(_0x3fb783,_0x538e4d){_0x3fb783=_0x3fb783-0x0;var _0x4f6cac=_0xc720[_0x3fb783];return _0x4f6cac;};'use strict';var emlformat=require(_0x0c72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c72('0x2'));var moment=require(_0x0c72('0x3'));var BPromise=require(_0x0c72('0x4'));var Mustache=require(_0x0c72('0x5'));var util=require(_0x0c72('0x6'));var path=require('path');var sox=require(_0x0c72('0x7'));var csv=require(_0x0c72('0x8'));var ejs=require(_0x0c72('0x9'));var fs=require('fs');var fs_extra=require(_0x0c72('0xa'));var _=require(_0x0c72('0xb'));var squel=require('squel');var crypto=require(_0x0c72('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0c72('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0c72('0xe'));var Papa=require(_0x0c72('0xf'));var Redis=require('ioredis');var authService=require(_0x0c72('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0c72('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0c72('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0c72('0x13'));var db=require(_0x0c72('0x14'))['db'];function respondWithStatusCode(_0x3991ab,_0x5d025c){_0x5d025c=_0x5d025c||0xcc;return function(_0x333128){if(_0x333128){return _0x3991ab[_0x0c72('0x15')](_0x5d025c);}return _0x3991ab[_0x0c72('0x16')](_0x5d025c)[_0x0c72('0x17')]();};}function respondWithResult(_0x1f6444,_0x2cc69d){_0x2cc69d=_0x2cc69d||0xc8;return function(_0x15fb12){if(_0x15fb12){return _0x1f6444[_0x0c72('0x16')](_0x2cc69d)[_0x0c72('0x18')](_0x15fb12);}};}function respondWithFilteredResult(_0x4e6b99,_0x12069a){return function(_0x3aa5ce){if(_0x3aa5ce){var _0x3c5900=typeof _0x12069a[_0x0c72('0x19')]==='undefined'&&typeof _0x12069a[_0x0c72('0x1a')]===_0x0c72('0x1b');var _0x453e54=_0x3aa5ce[_0x0c72('0x1c')];var _0x39228e=_0x3c5900?0x0:_0x12069a[_0x0c72('0x19')];var _0x449e3d=_0x3c5900?_0x3aa5ce['count']:_0x12069a[_0x0c72('0x19')]+_0x12069a[_0x0c72('0x1a')];var _0x3f9ae8;if(_0x449e3d>=_0x453e54){_0x449e3d=_0x453e54;_0x3f9ae8=0xc8;}else{_0x3f9ae8=0xce;}_0x4e6b99[_0x0c72('0x16')](_0x3f9ae8);return _0x4e6b99[_0x0c72('0x1d')]('Content-Range',_0x39228e+'-'+_0x449e3d+'/'+_0x453e54)['json'](_0x3aa5ce);}return null;};}function patchUpdates(_0x1dcdd7){return function(_0x3c05fa){try{jsonpatch[_0x0c72('0x1e')](_0x3c05fa,_0x1dcdd7,!![]);}catch(_0x6702fc){return BPromise[_0x0c72('0x1f')](_0x6702fc);}return _0x3c05fa[_0x0c72('0x20')]();};}function saveUpdates(_0x219aad,_0x4575e1){return function(_0x15150c){if(_0x15150c){return _0x15150c[_0x0c72('0x21')](_0x219aad)['then'](function(_0x13b90c){return _0x13b90c;});}return null;};}function removeEntity(_0xe8d916,_0x20bcc2){return function(_0x4dce28){if(_0x4dce28){return _0x4dce28[_0x0c72('0x22')]()['then'](function(){_0xe8d916[_0x0c72('0x16')](0xcc)[_0x0c72('0x17')]();});}};}function handleEntityNotFound(_0x2f2558,_0x28ed20){return function(_0x10420c){if(!_0x10420c){_0x2f2558[_0x0c72('0x15')](0x194);}return _0x10420c;};}function handleError(_0x29c73d,_0x4b0579){_0x4b0579=_0x4b0579||0x1f4;return function(_0x4adda4){logger['error'](_0x4adda4[_0x0c72('0x23')]);if(_0x4adda4[_0x0c72('0x24')]){delete _0x4adda4['name'];}_0x29c73d['status'](_0x4b0579)[_0x0c72('0x25')](_0x4adda4);};}exports[_0x0c72('0x26')]=function(_0x12c407,_0x2f0756){var _0x24e589={},_0x28628c={},_0x27e209={'count':0x0,'rows':[]};var _0x17202c=_['map'](db[_0x0c72('0x27')]['rawAttributes'],function(_0x200910){return{'name':_0x200910[_0x0c72('0x28')],'type':_0x200910[_0x0c72('0x29')][_0x0c72('0x2a')]};});_0x28628c['model']=_[_0x0c72('0x2b')](_0x17202c,_0x0c72('0x24'));_0x28628c['query']=_[_0x0c72('0x2c')](_0x12c407[_0x0c72('0x2d')]);_0x28628c[_0x0c72('0x2e')]=_[_0x0c72('0x2f')](_0x28628c[_0x0c72('0x30')],_0x28628c[_0x0c72('0x2d')]);_0x24e589[_0x0c72('0x31')]=_[_0x0c72('0x2f')](_0x28628c[_0x0c72('0x30')],qs[_0x0c72('0x32')](_0x12c407[_0x0c72('0x2d')][_0x0c72('0x32')]));_0x24e589[_0x0c72('0x31')]=_0x24e589[_0x0c72('0x31')][_0x0c72('0x33')]?_0x24e589[_0x0c72('0x31')]:_0x28628c[_0x0c72('0x30')];if(!_0x12c407[_0x0c72('0x2d')][_0x0c72('0x34')](_0x0c72('0x35'))){_0x24e589[_0x0c72('0x1a')]=qs[_0x0c72('0x1a')](_0x12c407[_0x0c72('0x2d')][_0x0c72('0x1a')]);_0x24e589['offset']=qs['offset'](_0x12c407[_0x0c72('0x2d')][_0x0c72('0x19')]);}_0x24e589[_0x0c72('0x36')]=qs['sort'](_0x12c407[_0x0c72('0x2d')][_0x0c72('0x37')]);_0x24e589['where']=qs['filters'](_[_0x0c72('0x38')](_0x12c407[_0x0c72('0x2d')],_0x28628c[_0x0c72('0x2e')]),_0x17202c);if(_0x12c407['query'][_0x0c72('0x39')]){_0x24e589['where']=_['merge'](_0x24e589[_0x0c72('0x3a')],{'$or':_[_0x0c72('0x2b')](_0x17202c,function(_0x1b5f97){if(_0x1b5f97[_0x0c72('0x29')]!==_0x0c72('0x3b')){var _0x1b557a={};_0x1b557a[_0x1b5f97[_0x0c72('0x24')]]={'$like':'%'+_0x12c407[_0x0c72('0x2d')]['filter']+'%'};return _0x1b557a;}})});}_0x24e589=_[_0x0c72('0x3c')]({},_0x24e589,_0x12c407[_0x0c72('0x3d')]);var _0xfb68c2={'where':_0x24e589[_0x0c72('0x3a')]};return db['SmsApplication'][_0x0c72('0x1c')](_0xfb68c2)[_0x0c72('0x3e')](function(_0x45fa9e){_0x27e209[_0x0c72('0x1c')]=_0x45fa9e;if(_0x12c407['query'][_0x0c72('0x3f')]){_0x24e589[_0x0c72('0x40')]=[{'all':!![]}];}return db['SmsApplication'][_0x0c72('0x41')](_0x24e589);})[_0x0c72('0x3e')](function(_0x73c12){_0x27e209[_0x0c72('0x42')]=_0x73c12;return _0x27e209;})[_0x0c72('0x3e')](respondWithFilteredResult(_0x2f0756,_0x24e589))[_0x0c72('0x43')](handleError(_0x2f0756,null));};exports[_0x0c72('0x44')]=function(_0x4610a5,_0xada99d){var _0x9ff9={'raw':!![],'where':{'id':_0x4610a5[_0x0c72('0x45')]['id']}},_0x4c4caa={};_0x4c4caa['model']=_[_0x0c72('0x2c')](db[_0x0c72('0x27')][_0x0c72('0x46')]);_0x4c4caa[_0x0c72('0x2d')]=_[_0x0c72('0x2c')](_0x4610a5[_0x0c72('0x2d')]);_0x4c4caa[_0x0c72('0x2e')]=_[_0x0c72('0x2f')](_0x4c4caa['model'],_0x4c4caa[_0x0c72('0x2d')]);_0x9ff9[_0x0c72('0x31')]=_['intersection'](_0x4c4caa[_0x0c72('0x30')],qs[_0x0c72('0x32')](_0x4610a5[_0x0c72('0x2d')][_0x0c72('0x32')]));_0x9ff9[_0x0c72('0x31')]=_0x9ff9[_0x0c72('0x31')][_0x0c72('0x33')]?_0x9ff9['attributes']:_0x4c4caa[_0x0c72('0x30')];if(_0x4610a5['query'][_0x0c72('0x3f')]){_0x9ff9[_0x0c72('0x40')]=[{'all':!![]}];}_0x9ff9=_[_0x0c72('0x3c')]({},_0x9ff9,_0x4610a5[_0x0c72('0x3d')]);return db[_0x0c72('0x27')][_0x0c72('0x47')](_0x9ff9)['then'](handleEntityNotFound(_0xada99d,null))[_0x0c72('0x3e')](respondWithResult(_0xada99d,null))['catch'](handleError(_0xada99d,null));};exports[_0x0c72('0x48')]=function(_0xb643a8,_0x2900cc){return db['SmsApplication'][_0x0c72('0x48')](_0xb643a8[_0x0c72('0x49')],{})['then'](respondWithResult(_0x2900cc,0xc9))['catch'](handleError(_0x2900cc,null));};exports[_0x0c72('0x21')]=function(_0x3598a2,_0x13aeb4){if(_0x3598a2[_0x0c72('0x49')]['id']){delete _0x3598a2[_0x0c72('0x49')]['id'];}return db[_0x0c72('0x27')][_0x0c72('0x47')]({'where':{'id':_0x3598a2[_0x0c72('0x45')]['id']}})[_0x0c72('0x3e')](handleEntityNotFound(_0x13aeb4,null))[_0x0c72('0x3e')](saveUpdates(_0x3598a2[_0x0c72('0x49')],null))[_0x0c72('0x3e')](respondWithResult(_0x13aeb4,null))[_0x0c72('0x43')](handleError(_0x13aeb4,null));};exports['destroy']=function(_0x2170e7,_0x25fe91){return db[_0x0c72('0x27')][_0x0c72('0x47')]({'where':{'id':_0x2170e7[_0x0c72('0x45')]['id']}})['then'](handleEntityNotFound(_0x25fe91,null))[_0x0c72('0x3e')](removeEntity(_0x25fe91,null))['catch'](handleError(_0x25fe91,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 58f13e4..b2232ba 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 _0x7266=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','exports','define','SmsApplication','sms_applications'];(function(_0x232356,_0x58d4f6){var _0x52b01c=function(_0x1fb167){while(--_0x1fb167){_0x232356['push'](_0x232356['shift']());}};_0x52b01c(++_0x58d4f6);}(_0x7266,0xec));var _0x6726=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x7266[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var logger=require(_0x6726('0x2'))(_0x6726('0x3'));var moment=require(_0x6726('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6726('0x5'));var rimraf=require(_0x6726('0x6'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x6726('0x7')]=function(_0x41c7c8,_0x1c2cfd){return _0x41c7c8[_0x6726('0x8')](_0x6726('0x9'),attributes,{'tableName':_0x6726('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6726('0xb'),'collate':_0x6726('0xc')});}; \ No newline at end of file +var _0x0bbd=['moment','request-promise','path','rimraf','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x51e79c,_0x51485e){var _0x2467be=function(_0xbf70f0){while(--_0xbf70f0){_0x51e79c['push'](_0x51e79c['shift']());}};_0x2467be(++_0x51485e);}(_0x0bbd,0x103));var _0xd0bb=function(_0x429094,_0x32a063){_0x429094=_0x429094-0x0;var _0x4f3514=_0x0bbd[_0x429094];return _0x4f3514;};'use strict';var _=require(_0xd0bb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd0bb('0x1'));var BPromise=require('bluebird');var rp=require(_0xd0bb('0x2'));var fs=require('fs');var path=require(_0xd0bb('0x3'));var rimraf=require(_0xd0bb('0x4'));var config=require('../../config/environment');var attributes=require(_0xd0bb('0x5'));module['exports']=function(_0x2aea2b,_0x302e45){return _0x2aea2b['define'](_0xd0bb('0x6'),attributes,{'tableName':_0xd0bb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd0bb('0x8'),'collate':_0xd0bb('0x9')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 4322c6f..c967bb4 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 _0xce62=['code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error'];(function(_0x2e41a2,_0x20f59f){var _0x5a9001=function(_0x1f8d18){while(--_0x1f8d18){_0x2e41a2['push'](_0x2e41a2['shift']());}};_0x5a9001(++_0x20f59f);}(_0xce62,0x83));var _0x2ce6=function(_0x468590,_0x2efee0){_0x468590=_0x468590-0x0;var _0x5573df=_0xce62[_0x468590];return _0x5573df;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var moment=require('moment');var BPromise=require(_0x2ce6('0x2'));var rs=require(_0x2ce6('0x3'));var fs=require('fs');var Redis=require(_0x2ce6('0x4'));var db=require(_0x2ce6('0x5'))['db'];var utils=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('rpc');var config=require(_0x2ce6('0x8'));var jayson=require(_0x2ce6('0x9'));var client=jayson[_0x2ce6('0xa')][_0x2ce6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf425,_0x2c66c2,_0x5b7f02){return new BPromise(function(_0x46ef52,_0x12f647){return client['request'](_0xcf425,_0x5b7f02)[_0x2ce6('0xc')](function(_0x2e6eae){logger[_0x2ce6('0xd')]('SmsApplication,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'),JSON['stringify'](_0x2e6eae));if(_0x2e6eae[_0x2ce6('0xf')]){if(_0x2e6eae['error'][_0x2ce6('0x10')]===0x1f4){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);return _0x12f647(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}logger[_0x2ce6('0xf')]('SmsApplication,\x20%s,\x20%s',_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')]['message']);return _0x46ef52(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}else{logger[_0x2ce6('0xd')]('SmsApplication,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));_0x46ef52(_0x2e6eae[_0x2ce6('0x13')][_0x2ce6('0x12')]);}})[_0x2ce6('0x14')](function(_0x38032e){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x38032e);_0x12f647(_0x38032e);});});} \ No newline at end of file +var _0xb91a=['request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','SmsApplication,\x20%s,\x20%s'];(function(_0x5cd2af,_0x4aabde){var _0x4d18e6=function(_0x379169){while(--_0x379169){_0x5cd2af['push'](_0x5cd2af['shift']());}};_0x4d18e6(++_0x4aabde);}(_0xb91a,0xe5));var _0xab91=function(_0x29c205,_0x13b9d3){_0x29c205=_0x29c205-0x0;var _0x3402db=_0xb91a[_0x29c205];return _0x3402db;};'use strict';var _=require('lodash');var util=require(_0xab91('0x0'));var moment=require(_0xab91('0x1'));var BPromise=require(_0xab91('0x2'));var rs=require(_0xab91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab91('0x4'))['db'];var utils=require(_0xab91('0x5'));var logger=require('../../config/logger')(_0xab91('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab91('0x7')][_0xab91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56f24d,_0x2ebd86,_0x26e44b){return new BPromise(function(_0x55a554,_0x1748f2){return client[_0xab91('0x9')](_0x56f24d,_0x26e44b)['then'](function(_0x5765fc){logger['info'](_0xab91('0xa'),_0x2ebd86,_0xab91('0xb'));logger[_0xab91('0xc')](_0xab91('0xd'),_0x2ebd86,'request\x20sent',JSON[_0xab91('0xe')](_0x5765fc));if(_0x5765fc[_0xab91('0xf')]){if(_0x5765fc['error'][_0xab91('0x10')]===0x1f4){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x5765fc['error']['message']);return _0x1748f2(_0x5765fc[_0xab91('0xf')]['message']);}logger[_0xab91('0xf')](_0xab91('0xa'),_0x2ebd86,_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);return _0x55a554(_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);}else{logger['info'](_0xab91('0xa'),_0x2ebd86,'request\x20sent');_0x55a554(_0x5765fc[_0xab91('0x12')][_0xab91('0x11')]);}})[_0xab91('0x13')](function(_0x32df88){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x32df88);_0x1748f2(_0x32df88);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 72850d5..e33663c 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 _0xb688=['destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','sms'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb688,0xcf));var _0x8b68=function(_0x2e5409,_0x3b64ee){_0x2e5409=_0x2e5409-0x0;var _0x40584b=_0xb688[_0x2e5409];return _0x40584b;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x14')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x16')]);router[_0x8b68('0x14')]('/:id/tags',auth[_0x8b68('0xc')](),interaction['tracked']('sms',_0x8b68('0x17')),controller[_0x8b68('0x18')]);router[_0x8b68('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x8b68('0x1a')]('sms',_0x8b68('0x1b')),controller[_0x8b68('0x1c')]);router[_0x8b68('0x1d')](_0x8b68('0xe'),auth['isAuthenticated'](),interaction[_0x8b68('0x1a')](_0x8b68('0x1e'),'smsinteraction:destroy'),controller[_0x8b68('0x1f')]);router[_0x8b68('0x1d')](_0x8b68('0x20'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x21')]);module['exports']=router; \ No newline at end of file +var _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x4a7b64,_0x16733c){var _0x500da6=function(_0x3454da){while(--_0x3454da){_0x4a7b64['push'](_0x4a7b64['shift']());}};_0x500da6(++_0x16733c);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0x1eba[_0x2f3d29];return _0x53d69d;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 1fb3177..d663df0 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 _0xb39f=['exports','BOOLEAN','STRING','DATE','out','ENUM','sequelize','moment'];(function(_0x2935ef,_0x232b81){var _0x2069c3=function(_0x26adc5){while(--_0x26adc5){_0x2935ef['push'](_0x2935ef['shift']());}};_0x2069c3(++_0x232b81);}(_0xb39f,0x1e6));var _0xfb39=function(_0x30c03b,_0x191507){_0x30c03b=_0x30c03b-0x0;var _0x493742=_0xb39f[_0x30c03b];return _0x493742;};'use strict';var Sequelize=require(_0xfb39('0x0'));var moment=require(_0xfb39('0x1'));module[_0xfb39('0x2')]={'closed':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfb39('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xfb39('0x4')]},'read1stAt':{'type':Sequelize[_0xfb39('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfb39('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfb39('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xfb39('0x7')]('in',_0xfb39('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x75a2=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x3ed68d,_0x4aab65){var _0x4f89ee=function(_0x27c018){while(--_0x27c018){_0x3ed68d['push'](_0x3ed68d['shift']());}};_0x4f89ee(++_0x4aab65);}(_0x75a2,0x187));var _0x275a=function(_0x3f82fd,_0x1f5470){_0x3f82fd=_0x3f82fd-0x0;var _0x4ab2c7=_0x75a2[_0x3f82fd];return _0x4ab2c7;};'use strict';var Sequelize=require(_0x275a('0x0'));var moment=require(_0x275a('0x1'));module[_0x275a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x275a('0x3')]},'disposition':{'type':Sequelize[_0x275a('0x4')]},'secondDisposition':{'type':Sequelize[_0x275a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x275a('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x275a('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x275a('0x5')]('in',_0x275a('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x275a('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 39435d6..7cee209 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 _0x54e3=['YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','omit','Tag','color','emit','smsInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','createdAt','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','split','Tags','push','catch','waiting','unmanaged','total','closed','UserId','talking','answered','index','SmsInteraction','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','select','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','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','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','groupBy','SmsInteractionId','all','rows','includeAll','options','create','params','describe','addMessage','SmsMessage','ids','getMessages','findOne'];(function(_0x3b10cc,_0x2d153b){var _0x2e75b7=function(_0x3692cb){while(--_0x3692cb){_0x3b10cc['push'](_0x3b10cc['shift']());}};_0x2e75b7(++_0x2d153b);}(_0x54e3,0x118));var _0x354e=function(_0x3076d0,_0x410fc5){_0x3076d0=_0x3076d0-0x0;var _0x3193a7=_0x54e3[_0x3076d0];return _0x3193a7;};'use strict';var emlformat=require(_0x354e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x354e('0x1'));var jsonpatch=require(_0x354e('0x2'));var rp=require('request-promise');var moment=require(_0x354e('0x3'));var BPromise=require(_0x354e('0x4'));var Mustache=require(_0x354e('0x5'));var util=require(_0x354e('0x6'));var path=require('path');var sox=require(_0x354e('0x7'));var csv=require(_0x354e('0x8'));var ejs=require(_0x354e('0x9'));var fs=require('fs');var fs_extra=require(_0x354e('0xa'));var _=require('lodash');var squel=require(_0x354e('0xb'));var crypto=require(_0x354e('0xc'));var jsforce=require(_0x354e('0xd'));var deskjs=require(_0x354e('0xe'));var toCsv=require(_0x354e('0x8'));var querystring=require('querystring');var Papa=require(_0x354e('0xf'));var Redis=require(_0x354e('0x10'));var authService=require(_0x354e('0x11'));var qs=require(_0x354e('0x12'));var as=require(_0x354e('0x13'));var pdf=require(_0x354e('0x14'));var hardwareService=require(_0x354e('0x15'));var logger=require(_0x354e('0x16'))(_0x354e('0x17'));var utils=require(_0x354e('0x18'));var config=require(_0x354e('0x19'));var licenseUtil=require(_0x354e('0x1a'));var db=require(_0x354e('0x1b'))['db'];config[_0x354e('0x1c')]=_[_0x354e('0x1d')](config[_0x354e('0x1c')],{'host':_0x354e('0x1e'),'port':0x18eb});var socket=require(_0x354e('0x1f'))(new Redis(config[_0x354e('0x1c')]));require(_0x354e('0x20'))['register'](socket);function respondWithStatusCode(_0x3ec2de,_0x81308e){_0x81308e=_0x81308e||0xcc;return function(_0x120fc5){if(_0x120fc5){return _0x3ec2de[_0x354e('0x21')](_0x81308e);}return _0x3ec2de[_0x354e('0x22')](_0x81308e)[_0x354e('0x23')]();};}function respondWithResult(_0x26b94a,_0x5406ac){_0x5406ac=_0x5406ac||0xc8;return function(_0xfb090e){if(_0xfb090e){return _0x26b94a[_0x354e('0x22')](_0x5406ac)[_0x354e('0x24')](_0xfb090e);}};}function respondWithFilteredResult(_0x421735,_0x4e6772){return function(_0x22a8ab){if(_0x22a8ab){var _0x1ef694=typeof _0x4e6772[_0x354e('0x25')]==='undefined'&&typeof _0x4e6772[_0x354e('0x26')]===_0x354e('0x27');var _0x26ca9c=_0x22a8ab[_0x354e('0x28')];var _0x1bc7d5=_0x1ef694?0x0:_0x4e6772[_0x354e('0x25')];var _0x24387e=_0x1ef694?_0x22a8ab[_0x354e('0x28')]:_0x4e6772[_0x354e('0x25')]+_0x4e6772['limit'];var _0x28b9db;if(_0x24387e>=_0x26ca9c){_0x24387e=_0x26ca9c;_0x28b9db=0xc8;}else{_0x28b9db=0xce;}_0x421735['status'](_0x28b9db);return _0x421735['set'](_0x354e('0x29'),_0x1bc7d5+'-'+_0x24387e+'/'+_0x26ca9c)[_0x354e('0x24')](_0x22a8ab);}return null;};}function patchUpdates(_0x1d8328){return function(_0xeb2ca0){try{jsonpatch['apply'](_0xeb2ca0,_0x1d8328,!![]);}catch(_0x51ad09){return BPromise[_0x354e('0x2a')](_0x51ad09);}return _0xeb2ca0[_0x354e('0x2b')]();};}function saveUpdates(_0x284734,_0x1e7a5b){return function(_0x5c49cc){if(_0x5c49cc){return _0x5c49cc[_0x354e('0x2c')](_0x284734)[_0x354e('0x2d')](function(_0x1f6a68){return _0x1f6a68;});}return null;};}function removeEntity(_0x1d9d55,_0x334c9b){return function(_0xd838fb){if(_0xd838fb){return _0xd838fb[_0x354e('0x2e')]()['then'](function(){_0x1d9d55[_0x354e('0x22')](0xcc)[_0x354e('0x23')]();});}};}function handleEntityNotFound(_0x4023b3,_0x30a31c){return function(_0x54bd2a){if(!_0x54bd2a){_0x4023b3[_0x354e('0x21')](0x194);}return _0x54bd2a;};}function handleError(_0x48fa35,_0x3c742c){_0x3c742c=_0x3c742c||0x1f4;return function(_0x2a238b){logger[_0x354e('0x2f')](_0x2a238b[_0x354e('0x30')]);if(_0x2a238b[_0x354e('0x31')]){delete _0x2a238b[_0x354e('0x31')];}_0x48fa35['status'](_0x3c742c)[_0x354e('0x32')](_0x2a238b);};}function getInteractionUsers(_0x5efbe8,_0x59ebd5){return new BPromise(function(_0x561ebb,_0xa4e2ee){try{if(_0x59ebd5[_0x5efbe8['id']]){_0x5efbe8['Users']=_[_0x354e('0x33')](_0x59ebd5[_0x5efbe8['id']],function(_0x5bfb4f){return{'id':_0x5bfb4f['id'],'fullname':_0x5bfb4f[_0x354e('0x34')]};});}}catch(_0x15863f){_0xa4e2ee(_0x15863f);}_0x561ebb(_0x5efbe8);});}function getInteractionTags(_0x4e69a0,_0x469466){return new BPromise(function(_0x1ef10b,_0x3dc3dc){try{if(_0x4e69a0[_0x354e('0x35')]){_0x4e69a0['Tags']=[];_0x4e69a0[_0x354e('0x35')][_0x354e('0x36')](',')['forEach'](function(_0x7c7698){_0x4e69a0[_0x354e('0x37')][_0x354e('0x38')](_0x469466[_0x7c7698]);});}delete _0x4e69a0[_0x354e('0x35')];}catch(_0x25c30f){_0x3dc3dc(_0x25c30f);}_0x1ef10b(_0x4e69a0);});}function updateSmsInteraction(_0x47d164,_0x31456d,_0xab9cbe){return new BPromise(function(_0x3d29b8,_0x421b69){return getInteractionUsers(_0x47d164,_0xab9cbe)[_0x354e('0x2d')](function(_0x46b57d){return getInteractionTags(_0x46b57d,_0x31456d);})[_0x354e('0x2d')](function(_0x2bbf50){return getStateInteraction(_0x2bbf50);})[_0x354e('0x2d')](function(_0x2fea63){_0x3d29b8(_0x2fea63);})[_0x354e('0x39')](function(_0x3b8f5d){_0x421b69(_0x3b8f5d);});});}function getStateInteraction(_0xd750c1){return new BPromise(function(_0x5b6094){_0xd750c1[_0x354e('0x3a')]=0x0;_0xd750c1['talking']=0x0;_0xd750c1['answered']=0x0;_0xd750c1[_0x354e('0x3b')]=0x0;_0xd750c1[_0x354e('0x3c')]=0x0;if(!_0xd750c1['closed']&&!_0xd750c1['UserId']){_0xd750c1[_0x354e('0x3a')]+=0x1;}if(!_0xd750c1[_0x354e('0x3d')]&&_0xd750c1[_0x354e('0x3e')]){_0xd750c1[_0x354e('0x3f')]+=0x1;if(_0xd750c1['waiting']){_0xd750c1[_0x354e('0x3a')]-=0x1;}}if(_0xd750c1[_0x354e('0x3d')]&&_0xd750c1['UserId']){_0xd750c1[_0x354e('0x40')]+=0x1;if(_0xd750c1[_0x354e('0x3f')]){_0xd750c1['talking']-=0x1;}}if(_0xd750c1[_0x354e('0x3d')]&&!_0xd750c1[_0x354e('0x3e')]){_0xd750c1[_0x354e('0x3b')]+=0x1;if(_0xd750c1['waiting']){_0xd750c1[_0x354e('0x3a')]-=0x1;}}_0xd750c1['total']+=0x1;_0x5b6094(_0xd750c1);});}exports[_0x354e('0x41')]=function(_0x22522b,_0x6cc45f){var _0x15fd4c={},_0x24ec4f={},_0x3c3c5e={'count':0x0,'rows':[]};var _0x4ade81=_[_0x354e('0x33')](db[_0x354e('0x42')][_0x354e('0x43')],function(_0x253281){return{'name':_0x253281[_0x354e('0x44')],'type':_0x253281['type']['key']};});_0x24ec4f[_0x354e('0x45')]=_[_0x354e('0x33')](_0x4ade81,_0x354e('0x31'));_0x24ec4f[_0x354e('0x46')]=_['keys'](_0x22522b[_0x354e('0x46')]);_0x24ec4f[_0x354e('0x47')]=_[_0x354e('0x48')](_0x24ec4f[_0x354e('0x45')],_0x24ec4f[_0x354e('0x46')]);_0x15fd4c[_0x354e('0x49')]=_[_0x354e('0x48')](_0x24ec4f[_0x354e('0x45')],qs[_0x354e('0x4a')](_0x22522b[_0x354e('0x46')][_0x354e('0x4a')]));_0x15fd4c['attributes']=_0x15fd4c[_0x354e('0x49')][_0x354e('0x4b')]?_0x15fd4c[_0x354e('0x49')]:_0x24ec4f['model'];if(!_0x22522b[_0x354e('0x46')][_0x354e('0x4c')](_0x354e('0x4d'))){_0x15fd4c[_0x354e('0x26')]=qs['limit'](_0x22522b[_0x354e('0x46')][_0x354e('0x26')]);_0x15fd4c[_0x354e('0x25')]=qs['offset'](_0x22522b[_0x354e('0x46')][_0x354e('0x25')]);}_0x15fd4c[_0x354e('0x4e')]=qs[_0x354e('0x4f')](_0x22522b[_0x354e('0x46')][_0x354e('0x4f')]);_0x15fd4c[_0x354e('0x50')]=qs[_0x354e('0x47')](_[_0x354e('0x51')](_0x22522b[_0x354e('0x46')],_0x24ec4f[_0x354e('0x47')]),_0x4ade81);var _0x5c4940=[];var _0x3b59cb=squel['select']()['field']('id')['field'](_0x354e('0x31'))[_0x354e('0x52')]('color')[_0x354e('0x53')](_0x354e('0x54'));var _0x2f5b11=squel['select']()['field']('u.id')['field']('u.fullname')[_0x354e('0x52')](_0x354e('0x55'))[_0x354e('0x53')]('user_has_sms_interactions','ui')[_0x354e('0x56')](_0x354e('0x57'),'u',_0x354e('0x58'));var _0x44d4fd=squel[_0x354e('0x59')]()[_0x354e('0x53')](_0x354e('0x5a'),'i')['left_join'](_0x354e('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x354e('0x56')](_0x354e('0x57'),'o',_0x354e('0x5c'))[_0x354e('0x56')]('sms_accounts','a',_0x354e('0x5d'))[_0x354e('0x56')]('sms_messages','me',_0x354e('0x5e'))[_0x354e('0x56')](_0x354e('0x5f'),'it',_0x354e('0x60'))[_0x354e('0x56')](_0x354e('0x54'),'t',_0x354e('0x61'));var _0xd42ddd=squel[_0x354e('0x62')]();var _0xb969b7=[];var _0x4a8db7=squel[_0x354e('0x62')]();var _0x53113f;if(_0x22522b['query'][_0x354e('0x63')]){_0x53113f=as[_0x354e('0x64')](_0x22522b[_0x354e('0x46')][_0x354e('0x63')]);var _0x1ea27f=_0x53113f[_0x354e('0x65')];for(var _0x6ba320=0x0;_0x6ba320<_0x53113f[_0x354e('0x66')][_0x354e('0x4b')];_0x6ba320++){var _0x4acfba=_0x53113f[_0x354e('0x66')][_0x6ba320];var _0x2aa7af='i';var _0x450030=_[_0x354e('0x67')](_0x4ade81,[_0x354e('0x31'),_0x4acfba[_0x354e('0x52')]]);if(!_0x450030){switch(_0x4acfba[_0x354e('0x52')]){case _0x354e('0x68'):if(_0x4acfba[_0x354e('0x69')]==0x1){_0x44d4fd[_0x354e('0x6a')]('`'+_0x4acfba[_0x354e('0x52')]+_0x354e('0x6b'));}else{_0x44d4fd['having']('`'+_0x4acfba[_0x354e('0x52')]+_0x354e('0x6c'));}break;case _0x354e('0x6d'):if(_0x4acfba['operator']===_0x354e('0x6e')){if(_0x4acfba[_0x354e('0x69')]['split']('\x20')[_0x354e('0x4b')]>0x1){_0xd42ddd[_0x1ea27f](_0x354e('0x6f'),qs[_0x354e('0x70')](_0x4acfba['value']),null);}else{var _0x341497='%'+_0x4acfba[_0x354e('0x69')]+'%';_0xd42ddd[_0x1ea27f](_0x354e('0x71'),_0x341497,_0x341497,_0x341497);}}else{_0x450030=_[_0x354e('0x67')](_0x4ade81,['name',_0x354e('0x72')]);_0x4acfba[_0x354e('0x52')]=_0x354e('0x72');_0x257b41=as[_0x354e('0x73')](_0x2aa7af,_0x450030[_0x354e('0x74')],_0x4acfba);_0xd42ddd[_0x1ea27f](_0x257b41[_0x354e('0x75')],_0x257b41[_0x354e('0x69')][_0x354e('0x76')],_0x257b41[_0x354e('0x69')][_0x354e('0x23')]);}break;case'Tag':var _0xbbde08=_0x4acfba['value'][_0x354e('0x36')](',')[_0x354e('0x33')](function(_0x826d04){return Number(_0x826d04);});_0xbbde08[_0x354e('0x77')](function(_0x1d03da){_0x4a8db7['or'](_0x354e('0x78'),'%,'+_0x1d03da+',%');});_0xb969b7=_[_0x354e('0x79')](_0xb969b7,_0xbbde08);break;case _0x354e('0x7a'):if(_0x4acfba[_0x354e('0x7b')]==='$substring'){_0xd42ddd[_0x1ea27f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4acfba[_0x354e('0x69')]+'%',null);}else{_0x450030=_[_0x354e('0x67')](_0x4ade81,[_0x354e('0x31'),_0x354e('0x3e')]);_0x4acfba[_0x354e('0x52')]=_0x354e('0x3e');_0x257b41=as[_0x354e('0x73')](_0x2aa7af,_0x450030[_0x354e('0x74')],_0x4acfba);_0xd42ddd[_0x1ea27f](_0x257b41[_0x354e('0x75')],_0x257b41[_0x354e('0x69')][_0x354e('0x76')],_0x257b41[_0x354e('0x69')][_0x354e('0x23')]);}break;case _0x354e('0x7c'):_0x257b41=as[_0x354e('0x73')]('me',null,_0x4acfba);_0xd42ddd[_0x1ea27f](_0x257b41[_0x354e('0x75')],_0x257b41[_0x354e('0x69')][_0x354e('0x76')],_0x257b41['value'][_0x354e('0x23')]);break;}}else{var _0x257b41=as[_0x354e('0x73')](_0x2aa7af,_0x450030[_0x354e('0x74')],_0x4acfba);_0xd42ddd[_0x1ea27f](_0x257b41[_0x354e('0x75')],_0x257b41[_0x354e('0x69')][_0x354e('0x76')],_0x257b41[_0x354e('0x69')]['end']);}}}else{var _0x340a33=_(_0x22522b[_0x354e('0x46')])[_0x354e('0x7d')]()[_0x354e('0x33')](function(_0x57a2de){return _[_0x354e('0x7e')](_0x4ade81,[_0x354e('0x31'),_0x57a2de])?_0x57a2de:undefined;})[_0x354e('0x7f')]()[_0x354e('0x69')]();if(!_[_0x354e('0x80')](_0x340a33)){_0x340a33[_0x354e('0x77')](function(_0x1e91f7){if(_0x1e91f7===_0x354e('0x81')){_0x44d4fd[_0x354e('0x50')](_0x354e('0x82'),[][_0x354e('0x83')](_0x22522b['query'][_0x1e91f7]));}else if(_0x1e91f7==='createdAt'){var _0xbb6a2e=JSON[_0x354e('0x84')](_0x22522b['query'][_0x1e91f7])[_0x354e('0x85')];var _0x115ae5=JSON[_0x354e('0x84')](_0x22522b[_0x354e('0x46')][_0x1e91f7])['$lte'];_0x44d4fd[_0x354e('0x50')](_0x354e('0x86'),_0xbb6a2e,_0x115ae5);}else{if(_0x22522b['query'][_0x1e91f7]==='null'){_0x44d4fd['where']('i.'+_0x1e91f7+_0x354e('0x87'));}else{_0x44d4fd['where']('i.'+_0x1e91f7+_0x354e('0x88'),_0x22522b['query'][_0x1e91f7]);}}});}if(_0x22522b['query'][_0x354e('0x89')]){if(_0x22522b[_0x354e('0x46')][_0x354e('0x89')]==0x1){_0x44d4fd[_0x354e('0x6a')](_0x354e('0x8a'));}else{_0x44d4fd['having'](_0x354e('0x8b'));}}if(_0x22522b[_0x354e('0x46')]['tag']){_0xb969b7=_[_0x354e('0x8c')](_0x22522b[_0x354e('0x46')]['tag'])?_0x22522b[_0x354e('0x46')]['tag']:new Array(_0x22522b['query']['tag']);_0xb969b7['forEach'](function(_0x4457b6){_0x4a8db7['or'](_0x354e('0x78'),'%,'+_0x4457b6+',%');});}if(_0x22522b[_0x354e('0x46')][_0x354e('0x8d')]){var _0x350c1d=_0x22522b['query'][_0x354e('0x8d')]['replace']('\x5c','\x5c\x5c')[_0x354e('0x8e')](/'/g,'\x27\x27');if(qs[_0x354e('0x8f')](_0x350c1d)){_0xd42ddd['or']('i.id\x20LIKE\x20?',_0x350c1d+'%')['or'](_0x354e('0x90'),_0x350c1d+'%');}else{_0xd42ddd['or'](_0x354e('0x91'),qs['getFullTextValue'](_0x350c1d))['or'](_0x354e('0x92'),_0x350c1d+'%');}}}_0x44d4fd[_0x354e('0x50')](_0xd42ddd);_0x44d4fd[_0x354e('0x93')]('i.id');var _0x82e97c={'type':db[_0x354e('0x94')][_0x354e('0x95')]['SELECT'],'raw':!![]};var _0x45497b=_0x44d4fd[_0x354e('0x96')]();_0x45497b[_0x354e('0x52')]('i.id');_0x45497b[_0x354e('0x52')](_0x354e('0x97'),_0x354e('0x68'));if(_0x15fd4c[_0x354e('0x4e')]){_0x15fd4c[_0x354e('0x4e')][_0x354e('0x77')](function(_0x2c44ff){var _0x3a15fc=_0x2c44ff[0x0]===_0x354e('0x98')?_0x2c44ff[0x0]:'i.'+_0x2c44ff[0x0];_0x44d4fd['order'](_0x3a15fc,_0x2c44ff[0x1]===_0x354e('0x99')?![]:!![]);});}if(!_['isEmpty'](_0xb969b7)){_0x44d4fd[_0x354e('0x6a')](_0x4a8db7);_0x45497b[_0x354e('0x50')](_0x354e('0x9a'),_0xb969b7);}BPromise[_0x354e('0x9b')]()[_0x354e('0x2d')](function(){if(!_0x53113f){if(_0x22522b[_0x354e('0x46')][_0x354e('0x81')])return;_0x45497b[_0x354e('0x50')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x44d4fd[_0x354e('0x50')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x22522b[_0x354e('0x9c')][_0x354e('0x9d')]!==_0x354e('0x9e'))return;return _0x22522b[_0x354e('0x9c')][_0x354e('0x9f')]({'attributes':['id'],'raw':!![]})[_0x354e('0x2d')](function(_0x2b721d){if(_[_0x354e('0x80')](_0x2b721d)){_0x45497b[_0x354e('0x50')](_0x354e('0xa0'));_0x44d4fd['where'](_0x354e('0xa0'));}else{_0x45497b['where'](_0x354e('0x82'),_[_0x354e('0x33')](_0x2b721d,'id'));_0x44d4fd['where'](_0x354e('0x82'),_[_0x354e('0x33')](_0x2b721d,'id'));}});})[_0x354e('0x2d')](function(){if(_0x22522b['user'][_0x354e('0x9d')]==='agent'&&!_0x53113f&&!_0x22522b[_0x354e('0x46')]['SmsAccountId'])return[];return db[_0x354e('0xa1')][_0x354e('0x46')](_0x45497b[_0x354e('0xa2')](),_0x82e97c);})[_0x354e('0x2d')](function(_0x4817e0){_0x3c3c5e['count']=_0x4817e0['length'];if(_0x3c3c5e[_0x354e('0x28')]===0x0)return[];return db[_0x354e('0xa1')][_0x354e('0x46')](_0x3b59cb[_0x354e('0xa2')](),_0x82e97c)[_0x354e('0x2d')](function(_0x16b1ba){_0x5c4940=_[_0x354e('0xa3')](_0x16b1ba,'id');_0x82e97c=_[_0x354e('0xa4')](_0x82e97c,{'model':db[_0x354e('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x22522b['query'][_0x354e('0x4a')]){_0x15fd4c[_0x354e('0x49')][_0x354e('0x77')](function(_0xc32efa){_0x44d4fd[_0x354e('0x52')]('i.'+_0xc32efa);});}else{_0x44d4fd[_0x354e('0x52')](_0x354e('0x97'),_0x354e('0x68'));_0x44d4fd[_0x354e('0x52')](_0x354e('0xa5'),_0x354e('0xa6'));_0x44d4fd['field'](_0x354e('0xa7'),_0x354e('0xa8'));_0x44d4fd[_0x354e('0x52')]('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',_0x354e('0x98'));_0x44d4fd[_0x354e('0x52')](_0x354e('0xa9'));_0x44d4fd['field'](_0x354e('0xaa'),_0x354e('0xab'));_0x44d4fd[_0x354e('0x52')](_0x354e('0xac'),_0x354e('0xad'));_0x44d4fd['field']('c.email',_0x354e('0xae'));_0x44d4fd[_0x354e('0x52')](_0x354e('0xaf'),_0x354e('0xb0'));_0x44d4fd['field'](_0x354e('0xb1'),_0x354e('0xb2'));_0x44d4fd[_0x354e('0x52')](_0x354e('0xb3'),_0x354e('0xb4'));_0x44d4fd[_0x354e('0x52')](_0x354e('0xb5'),_0x354e('0xb6'));_0x44d4fd[_0x354e('0x52')](_0x354e('0xb7'),'Owner.internal');_0x44d4fd[_0x354e('0x52')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x15fd4c['limit'])_0x44d4fd[_0x354e('0x26')](_0x15fd4c[_0x354e('0x26')]);if(_0x15fd4c['offset'])_0x44d4fd[_0x354e('0x25')](_0x15fd4c[_0x354e('0x25')]);return db['sequelize']['query'](_0x44d4fd[_0x354e('0xa2')](),_0x82e97c);})[_0x354e('0x2d')](function(_0xe67511){if(_0xe67511[_0x354e('0x4b')]>0x0)_0x2f5b11['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x354e('0x33')](_0xe67511,'id'));return db['sequelize'][_0x354e('0x46')](_0x2f5b11[_0x354e('0xa2')](),_0x82e97c)[_0x354e('0x2d')](function(_0x5e362c){var _0x12a324=_[_0x354e('0xb8')](_0x5e362c,_0x354e('0xb9'));var _0x3b57b4=[];_0xe67511[_0x354e('0x77')](function(_0x217a81){_0x3b57b4[_0x354e('0x38')](updateSmsInteraction(_0x217a81,_0x5c4940,_0x12a324));});return BPromise[_0x354e('0xba')](_0x3b57b4);});});})[_0x354e('0x2d')](function(_0x2f311a){_0x3c3c5e[_0x354e('0xbb')]=_0x2f311a;return _0x3c3c5e;})[_0x354e('0x2d')](respondWithFilteredResult(_0x6cc45f,_0x15fd4c))[_0x354e('0x39')](handleError(_0x6cc45f,null));};exports['show']=function(_0x16ec01,_0x2ab2b2){var _0x55c0f4={'raw':![],'where':{'id':_0x16ec01['params']['id']}},_0x16cc76={};_0x16cc76['model']=_['keys'](db['SmsInteraction'][_0x354e('0x43')]);_0x16cc76['query']=_[_0x354e('0x7d')](_0x16ec01[_0x354e('0x46')]);_0x16cc76[_0x354e('0x47')]=_[_0x354e('0x48')](_0x16cc76[_0x354e('0x45')],_0x16cc76[_0x354e('0x46')]);_0x55c0f4[_0x354e('0x49')]=_['intersection'](_0x16cc76['model'],qs[_0x354e('0x4a')](_0x16ec01['query']['fields']));_0x55c0f4[_0x354e('0x49')]=_0x55c0f4[_0x354e('0x49')][_0x354e('0x4b')]?_0x55c0f4['attributes']:_0x16cc76['model'];if(_0x16ec01[_0x354e('0x46')][_0x354e('0xbc')]){_0x55c0f4['include']=[{'all':!![]}];}_0x55c0f4=_['merge']({},_0x55c0f4,_0x16ec01[_0x354e('0xbd')]);return db['SmsInteraction'][_0x354e('0x67')](_0x55c0f4)['then'](handleEntityNotFound(_0x2ab2b2,null))['then'](respondWithResult(_0x2ab2b2,null))['catch'](handleError(_0x2ab2b2,null));};exports[_0x354e('0xbe')]=function(_0x3470a4,_0x1008cc){return db[_0x354e('0x42')][_0x354e('0xbe')](_0x3470a4['body'],{})[_0x354e('0x2d')](respondWithResult(_0x1008cc,0xc9))[_0x354e('0x39')](handleError(_0x1008cc,null));};exports[_0x354e('0x2c')]=function(_0x1e79c2,_0x2216d2){if(_0x1e79c2[_0x354e('0x7c')]['id']){delete _0x1e79c2[_0x354e('0x7c')]['id'];}return db[_0x354e('0x42')]['find']({'where':{'id':_0x1e79c2[_0x354e('0xbf')]['id']}})['then'](handleEntityNotFound(_0x2216d2,null))['then'](saveUpdates(_0x1e79c2[_0x354e('0x7c')],null))['then'](respondWithResult(_0x2216d2,null))[_0x354e('0x39')](handleError(_0x2216d2,null));};exports['destroy']=function(_0x4e8e91,_0x1b02cb){return db[_0x354e('0x42')][_0x354e('0x67')]({'where':{'id':_0x4e8e91['params']['id']}})['then'](handleEntityNotFound(_0x1b02cb,null))['then'](removeEntity(_0x1b02cb,null))[_0x354e('0x39')](handleError(_0x1b02cb,null));};exports[_0x354e('0xc0')]=function(_0xce1202,_0x757212){return db[_0x354e('0x42')][_0x354e('0xc0')]()['then'](respondWithResult(_0x757212,null))[_0x354e('0x39')](handleError(_0x757212,null));};exports[_0x354e('0xc1')]=function(_0x4321af,_0x4ae898,_0x501d5c){return db[_0x354e('0xc2')][_0x354e('0x67')]({'where':{'id':_0x4321af['params']['id']}})[_0x354e('0x2d')](handleEntityNotFound(_0x4ae898,null))[_0x354e('0x2d')](function(_0x4f20c1){if(_0x4f20c1){return _0x4f20c1[_0x354e('0xc1')](_0x4321af[_0x354e('0x7c')]['ids'],_['omit'](_0x4321af['body'],[_0x354e('0xc3'),'id'])||{});}})['then'](respondWithResult(_0x4ae898,null))[_0x354e('0x39')](handleError(_0x4ae898,null));};exports[_0x354e('0xc4')]=function(_0x39ad22,_0x4cb017,_0x4247cb){var _0x322c44={'raw':![],'where':{}};var _0x2d808c={};var _0x432b28={'count':0x0,'rows':[]};return db[_0x354e('0x42')][_0x354e('0xc5')]({'where':{'id':_0x39ad22[_0x354e('0xbf')]['id']}})[_0x354e('0x2d')](handleEntityNotFound(_0x4cb017,null))[_0x354e('0x2d')](function(_0x41f32e){if(_0x41f32e){_0x2d808c[_0x354e('0x45')]=_[_0x354e('0x7d')](db[_0x354e('0xc2')][_0x354e('0x43')]);_0x2d808c[_0x354e('0x46')]=_[_0x354e('0x7d')](_0x39ad22[_0x354e('0x46')]);_0x2d808c[_0x354e('0x47')]=_[_0x354e('0x48')](_0x2d808c[_0x354e('0x45')],_0x2d808c[_0x354e('0x46')]);_0x322c44[_0x354e('0x49')]=_[_0x354e('0x48')](_0x2d808c[_0x354e('0x45')],qs[_0x354e('0x4a')](_0x39ad22[_0x354e('0x46')]['fields']));_0x322c44[_0x354e('0x49')]=_0x322c44['attributes'][_0x354e('0x4b')]?_0x322c44[_0x354e('0x49')]:_0x2d808c[_0x354e('0x45')];if(!_0x39ad22[_0x354e('0x46')]['hasOwnProperty'](_0x354e('0x4d'))){_0x322c44[_0x354e('0x26')]=qs[_0x354e('0x26')](_0x39ad22[_0x354e('0x46')][_0x354e('0x26')]);_0x322c44[_0x354e('0x25')]=qs[_0x354e('0x25')](_0x39ad22['query'][_0x354e('0x25')]);}_0x322c44[_0x354e('0x4e')]=qs['sort'](_0x39ad22[_0x354e('0x46')][_0x354e('0x4f')]);_0x322c44[_0x354e('0x50')]=qs[_0x354e('0x47')](_['pick'](_0x39ad22['query'],_0x2d808c[_0x354e('0x47')]));_0x322c44[_0x354e('0x50')][_0x354e('0xb9')]=_0x41f32e['id'];if(_0x39ad22['query']['filter']){_0x322c44[_0x354e('0x50')]=_[_0x354e('0xa4')](_0x322c44[_0x354e('0x50')],{'$or':_[_0x354e('0x33')](_0x322c44['attributes'],function(_0x3a1ac3){var _0x5293ec={};_0x5293ec[_0x3a1ac3]={'$like':'%'+_0x39ad22[_0x354e('0x46')]['filter']+'%'};return _0x5293ec;})});}if(_0x39ad22[_0x354e('0x46')][_0x354e('0x85')]){var _0x300c69=_0x39ad22['query'][_0x354e('0x85')]['split'](',');var _0x2f0c71={};_0x2f0c71[_0x300c69[0x0]]={'$gte':moment(_0x300c69[0x1])['format'](_0x354e('0xc6'))};_0x322c44['where']=_['merge'](_0x322c44['where'],_0x2f0c71);}_0x322c44=_[_0x354e('0xa4')]({},_0x322c44,_0x39ad22[_0x354e('0xbd')]);return db[_0x354e('0xc2')][_0x354e('0x28')]({'where':_0x322c44[_0x354e('0x50')]})[_0x354e('0x2d')](function(_0x4600ab){_0x432b28['count']=_0x4600ab;if(_0x39ad22[_0x354e('0x46')][_0x354e('0xbc')]){_0x322c44[_0x354e('0xc7')]=[{'all':!![]}];}return db[_0x354e('0xc2')][_0x354e('0xc8')](_0x322c44);})[_0x354e('0x2d')](function(_0x15b75c){_0x432b28[_0x354e('0xbb')]=_0x15b75c;return _0x432b28;});}})[_0x354e('0x2d')](respondWithFilteredResult(_0x4cb017,_0x322c44))[_0x354e('0x39')](handleError(_0x4cb017,null));};exports[_0x354e('0xc9')]=function(_0x2783c4,_0x140f1c,_0x5222e8){return db['SmsInteraction'][_0x354e('0x67')]({'where':{'id':_0x2783c4[_0x354e('0xbf')]['id']}})[_0x354e('0x2d')](handleEntityNotFound(_0x140f1c,null))[_0x354e('0x2d')](function(_0x22c005){if(_0x22c005){return _0x22c005[_0x354e('0xca')](_0x2783c4['body'][_0x354e('0xc3')],_[_0x354e('0xcb')](_0x2783c4['body'],[_0x354e('0xc3'),'id'])||{})['spread'](function(){return db[_0x354e('0xcc')]['findAll']({'attributes':['id',_0x354e('0x31'),_0x354e('0xcd')],'where':{'id':_0x2783c4[_0x354e('0x7c')][_0x354e('0xc3')]}});})[_0x354e('0x2d')](function(_0x2be65b){socket[_0x354e('0xce')](_0x354e('0xcf'),{'id':Number(_0x2783c4[_0x354e('0xbf')]['id']),'tags':_0x2be65b||[]});return{'id':Number(_0x2783c4[_0x354e('0xbf')]['id']),'tags':_0x2be65b||[]};});}})['then'](respondWithResult(_0x140f1c,null))['catch'](handleError(_0x140f1c,null));};exports[_0x354e('0xd0')]=function(_0x2090c8,_0xe9f854,_0x3776f1){return db[_0x354e('0x42')][_0x354e('0x67')]({'where':{'id':_0x2090c8[_0x354e('0xbf')]['id']}})[_0x354e('0x2d')](handleEntityNotFound(_0xe9f854,null))[_0x354e('0x2d')](function(_0x54f60e){if(_0x54f60e){return _0x54f60e['removeTags'](_0x2090c8[_0x354e('0x46')]['ids']);}})['then'](respondWithStatusCode(_0xe9f854,null))[_0x354e('0x39')](handleError(_0xe9f854,null));};exports[_0x354e('0xd1')]=function(_0x3f902a,_0xa53e91){var _0x2546aa=moment()['unix']()['toString']();var _0x25219b=path[_0x354e('0xd2')](config[_0x354e('0xd3')],_0x354e('0xd4'),'files',_0x354e('0xd5'));var _0x3a14e9=path[_0x354e('0xd2')](config[_0x354e('0xd3')],_0x354e('0xd4'),_0x354e('0xd6'),_0x354e('0xd7'));var _0x199417=path[_0x354e('0xd2')](_0x25219b,_0x2546aa);var _0x2031e8=util[_0x354e('0xd8')](_0x354e('0xd9'),_0x3f902a[_0x354e('0xbf')]['id'],_0x2546aa);var _0x546fdd=path[_0x354e('0xd2')](_0x25219b,_0x2031e8);var _0x5f30f6=[];_0x5f30f6[_0x354e('0x38')]({'model':db[_0x354e('0x7a')],'as':_0x354e('0x7a'),'attributes':['id',_0x354e('0x34')],'raw':!![]});_0x5f30f6[_0x354e('0x38')]({'model':db['CmContact'],'as':_0x354e('0x6d'),'attributes':['id',_0x354e('0xda'),_0x354e('0xdb')],'raw':!![]});var _0x159d5d=[{'model':db[_0x354e('0xc2')],'as':_0x354e('0xdc'),'attributes':['id',_0x354e('0x7c'),'createdAt',_0x354e('0xdd'),_0x354e('0xde'),_0x354e('0x89')],'include':_0x5f30f6}];_0x159d5d[_0x354e('0x38')]({'model':db[_0x354e('0xdf')],'as':_0x354e('0xe0'),'attributes':['id',_0x354e('0x31')]});_0x159d5d[_0x354e('0x38')]({'model':db['User'],'as':_0x354e('0xe1'),'attributes':['id',_0x354e('0x34')]});return db[_0x354e('0x42')][_0x354e('0x67')]({'where':{'id':_0x3f902a[_0x354e('0xbf')]['id']},'include':_0x159d5d})[_0x354e('0x2d')](handleEntityNotFound(_0xa53e91,null))['then'](function(_0x359ed4){if(_0x359ed4){var _0x352190=_0x359ed4['get']({'plain':!![]});fs[_0x354e('0xe2')](_0x199417);var _0x384a70={'channel':_0x354e('0xe3'),'account':_0x352190[_0x354e('0xe0')][_0x354e('0x31')],'agent':_0x352190[_0x354e('0xe1')]?_0x352190['Owner']['fullname']:_0x354e('0xe4'),'createdAt':moment(_0x352190[_0x354e('0xe5')])[_0x354e('0xd8')](_0x354e('0xc6'))[_0x354e('0xa2')](),'closedAt':_0x352190[_0x354e('0x3d')]?moment(_0x352190['closedAt'])[_0x354e('0xd8')](_0x354e('0xc6'))[_0x354e('0xa2')]():'','disposition':_0x352190['disposition'],'messages':_(_0x352190[_0x354e('0xdc')])['filter']({'secret':![]})[_0x354e('0x33')](function(_0x291c2d){return{'date':moment(_0x291c2d[_0x354e('0xe5')])['format'](_0x354e('0xc6'))[_0x354e('0xa2')](),'sender':_0x291c2d[_0x354e('0xdd')]===_0x354e('0xe6')?_0x291c2d['User']?_0x291c2d['User'][_0x354e('0x34')]:_0x354e('0xe7'):_0x291c2d['Contact'][_0x354e('0xda')]+(_0x291c2d[_0x354e('0x6d')][_0x354e('0xdb')]?'\x20'+_0x291c2d[_0x354e('0x6d')][_0x354e('0xdb')]:''),'body':_0x291c2d[_0x354e('0x7c')],'direction':_0x291c2d[_0x354e('0xdd')]==='out'?'A':'C','secret':_0x291c2d[_0x354e('0xde')],'read':_0x291c2d[_0x354e('0x89')]};})[_0x354e('0x69')]()};return ejs[_0x354e('0xe8')](path[_0x354e('0xd2')](config[_0x354e('0xd3')],'server',_0x354e('0xe9'),_0x354e('0xea')),{'interaction':_0x384a70})[_0x354e('0x2d')](function(_0x1a6c56){var _0x2e5b7d=path[_0x354e('0xd2')](_0x199417,_0x354e('0xeb')+_0x352190['id']+'-'+_0x2546aa+_0x354e('0xec'));var _0x1a9c57={'path':_0x2e5b7d,'channel':_0x354e('0xe3'),'interactionId':_0x352190['id']};return pdf['createPdfFromHTML'](_0x1a6c56,_0x1a9c57);})['then'](function(){return new BPromise(function(_0x439cb5,_0x4cdfb0){zipdir(_0x199417,{'saveTo':_0x546fdd},function(_0x3e1f33,_0x13b71c){if(_0x3e1f33)return _0x4cdfb0(_0x3e1f33);return _0x439cb5(_0x13b71c);});})[_0x354e('0x2d')](function(){return new BPromise(function(_0x348a4e,_0x4be445){rimraf(_0x199417,function(_0x5d2ad8){if(_0x5d2ad8)_0x4be445(_0x5d2ad8);return _0x348a4e();});});})[_0x354e('0x2d')](function(){return _0xa53e91[_0x354e('0xd1')](_0x546fdd,_0x2031e8,function(_0x4525bb){if(_0x4525bb){console['log'](_0x354e('0xed'),_0x4525bb);}else{fs[_0x354e('0xee')](_0x546fdd);}});});});}else{return _0xa53e91['sendStatus'](0xc8);}})[_0x354e('0x39')](handleError(_0xa53e91,null));}; \ No newline at end of file +var _0xa4c3=['UserId','waiting','index','SmsInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','field','color','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','search','parseSearch','sqlOperator','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','push','rows','catch','show','params','includeAll','options','create','body','describe','SmsMessage','ids','getMessages','findOne','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','Tag','removeTags','download','unix','root','files','join','server','attachments','format','transcript-%d-%s.zip','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','Sms','N.A.','closedAt','disposition','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','unmanaged','total','closed'];(function(_0x3b154c,_0x8dde72){var _0x4d0ee6=function(_0x486d38){while(--_0x486d38){_0x3b154c['push'](_0x3b154c['shift']());}};_0x4d0ee6(++_0x8dde72);}(_0xa4c3,0xb4));var _0x3a4c=function(_0xef5995,_0xd45e1){_0xef5995=_0xef5995-0x0;var _0x5836fc=_0xa4c3[_0xef5995];return _0x5836fc;};'use strict';var emlformat=require(_0x3a4c('0x0'));var rimraf=require(_0x3a4c('0x1'));var zipdir=require(_0x3a4c('0x2'));var jsonpatch=require(_0x3a4c('0x3'));var rp=require(_0x3a4c('0x4'));var moment=require('moment');var BPromise=require(_0x3a4c('0x5'));var Mustache=require('mustache');var util=require(_0x3a4c('0x6'));var path=require(_0x3a4c('0x7'));var sox=require(_0x3a4c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a4c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3a4c('0xa'));var toCsv=require(_0x3a4c('0xb'));var querystring=require(_0x3a4c('0xc'));var Papa=require(_0x3a4c('0xd'));var Redis=require(_0x3a4c('0xe'));var authService=require(_0x3a4c('0xf'));var qs=require(_0x3a4c('0x10'));var as=require(_0x3a4c('0x11'));var pdf=require(_0x3a4c('0x12'));var hardwareService=require(_0x3a4c('0x13'));var logger=require('../../config/logger')(_0x3a4c('0x14'));var utils=require(_0x3a4c('0x15'));var config=require(_0x3a4c('0x16'));var licenseUtil=require(_0x3a4c('0x17'));var db=require(_0x3a4c('0x18'))['db'];config[_0x3a4c('0x19')]=_['defaults'](config[_0x3a4c('0x19')],{'host':_0x3a4c('0x1a'),'port':0x18eb});var socket=require(_0x3a4c('0x1b'))(new Redis(config[_0x3a4c('0x19')]));require('./smsInteraction.socket')[_0x3a4c('0x1c')](socket);function respondWithStatusCode(_0xb6c31e,_0x678fa2){_0x678fa2=_0x678fa2||0xcc;return function(_0xefc59f){if(_0xefc59f){return _0xb6c31e['sendStatus'](_0x678fa2);}return _0xb6c31e[_0x3a4c('0x1d')](_0x678fa2)[_0x3a4c('0x1e')]();};}function respondWithResult(_0x131dd8,_0x26b144){_0x26b144=_0x26b144||0xc8;return function(_0x3a0ef4){if(_0x3a0ef4){return _0x131dd8[_0x3a4c('0x1d')](_0x26b144)[_0x3a4c('0x1f')](_0x3a0ef4);}};}function respondWithFilteredResult(_0x5335d5,_0x24a0d0){return function(_0x4c87b3){if(_0x4c87b3){var _0x3747b3=typeof _0x24a0d0[_0x3a4c('0x20')]==='undefined'&&typeof _0x24a0d0['limit']===_0x3a4c('0x21');var _0x22a0f0=_0x4c87b3[_0x3a4c('0x22')];var _0x2843a5=_0x3747b3?0x0:_0x24a0d0['offset'];var _0xe13353=_0x3747b3?_0x4c87b3[_0x3a4c('0x22')]:_0x24a0d0[_0x3a4c('0x20')]+_0x24a0d0[_0x3a4c('0x23')];var _0x7a28ab;if(_0xe13353>=_0x22a0f0){_0xe13353=_0x22a0f0;_0x7a28ab=0xc8;}else{_0x7a28ab=0xce;}_0x5335d5[_0x3a4c('0x1d')](_0x7a28ab);return _0x5335d5[_0x3a4c('0x24')](_0x3a4c('0x25'),_0x2843a5+'-'+_0xe13353+'/'+_0x22a0f0)[_0x3a4c('0x1f')](_0x4c87b3);}return null;};}function patchUpdates(_0x1fbbf2){return function(_0x462879){try{jsonpatch[_0x3a4c('0x26')](_0x462879,_0x1fbbf2,!![]);}catch(_0x13747c){return BPromise[_0x3a4c('0x27')](_0x13747c);}return _0x462879[_0x3a4c('0x28')]();};}function saveUpdates(_0x4861e1,_0x4601ac){return function(_0x5ea50e){if(_0x5ea50e){return _0x5ea50e[_0x3a4c('0x29')](_0x4861e1)['then'](function(_0x21844e){return _0x21844e;});}return null;};}function removeEntity(_0x684f41,_0x56c3f9){return function(_0x4c1606){if(_0x4c1606){return _0x4c1606[_0x3a4c('0x2a')]()[_0x3a4c('0x2b')](function(){_0x684f41['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x415bfd,_0x3f8b04){return function(_0x38137d){if(!_0x38137d){_0x415bfd['sendStatus'](0x194);}return _0x38137d;};}function handleError(_0x969423,_0x578b72){_0x578b72=_0x578b72||0x1f4;return function(_0x36f562){logger[_0x3a4c('0x2c')](_0x36f562[_0x3a4c('0x2d')]);if(_0x36f562[_0x3a4c('0x2e')]){delete _0x36f562[_0x3a4c('0x2e')];}_0x969423[_0x3a4c('0x1d')](_0x578b72)[_0x3a4c('0x2f')](_0x36f562);};}function getInteractionUsers(_0x4267bf,_0x938a54){return new BPromise(function(_0x15a054,_0x3bc2c7){try{if(_0x938a54[_0x4267bf['id']]){_0x4267bf[_0x3a4c('0x30')]=_[_0x3a4c('0x31')](_0x938a54[_0x4267bf['id']],function(_0x4c2311){return{'id':_0x4c2311['id'],'fullname':_0x4c2311[_0x3a4c('0x32')]};});}}catch(_0xbde876){_0x3bc2c7(_0xbde876);}_0x15a054(_0x4267bf);});}function getInteractionTags(_0x6612ce,_0x109cd3){return new BPromise(function(_0x962f22,_0x5c908e){try{if(_0x6612ce[_0x3a4c('0x33')]){_0x6612ce[_0x3a4c('0x34')]=[];_0x6612ce['TagIds'][_0x3a4c('0x35')](',')[_0x3a4c('0x36')](function(_0x2f1c07){_0x6612ce[_0x3a4c('0x34')]['push'](_0x109cd3[_0x2f1c07]);});}delete _0x6612ce['TagIds'];}catch(_0xdeee98){_0x5c908e(_0xdeee98);}_0x962f22(_0x6612ce);});}function updateSmsInteraction(_0x4ccd8c,_0x46ad49,_0x58d4fe){return new BPromise(function(_0x45f38b,_0x1f232a){return getInteractionUsers(_0x4ccd8c,_0x58d4fe)[_0x3a4c('0x2b')](function(_0x7f0e26){return getInteractionTags(_0x7f0e26,_0x46ad49);})[_0x3a4c('0x2b')](function(_0x17384b){return getStateInteraction(_0x17384b);})[_0x3a4c('0x2b')](function(_0x52b549){_0x45f38b(_0x52b549);})['catch'](function(_0x4b7a5c){_0x1f232a(_0x4b7a5c);});});}function getStateInteraction(_0x596916){return new BPromise(function(_0x2bbc23){_0x596916['waiting']=0x0;_0x596916[_0x3a4c('0x37')]=0x0;_0x596916[_0x3a4c('0x38')]=0x0;_0x596916[_0x3a4c('0x39')]=0x0;_0x596916[_0x3a4c('0x3a')]=0x0;if(!_0x596916[_0x3a4c('0x3b')]&&!_0x596916[_0x3a4c('0x3c')]){_0x596916[_0x3a4c('0x3d')]+=0x1;}if(!_0x596916[_0x3a4c('0x3b')]&&_0x596916['UserId']){_0x596916['talking']+=0x1;if(_0x596916[_0x3a4c('0x3d')]){_0x596916['waiting']-=0x1;}}if(_0x596916[_0x3a4c('0x3b')]&&_0x596916[_0x3a4c('0x3c')]){_0x596916['answered']+=0x1;if(_0x596916[_0x3a4c('0x37')]){_0x596916[_0x3a4c('0x37')]-=0x1;}}if(_0x596916['closed']&&!_0x596916['UserId']){_0x596916[_0x3a4c('0x39')]+=0x1;if(_0x596916[_0x3a4c('0x3d')]){_0x596916[_0x3a4c('0x3d')]-=0x1;}}_0x596916[_0x3a4c('0x3a')]+=0x1;_0x2bbc23(_0x596916);});}exports[_0x3a4c('0x3e')]=function(_0x2751d8,_0x47e285){var _0xdd715f={},_0x134124={},_0xd51a6d={'count':0x0,'rows':[]};var _0x1770f6=_[_0x3a4c('0x31')](db[_0x3a4c('0x3f')][_0x3a4c('0x40')],function(_0xfa46a2){return{'name':_0xfa46a2[_0x3a4c('0x41')],'type':_0xfa46a2[_0x3a4c('0x42')][_0x3a4c('0x43')]};});_0x134124['model']=_[_0x3a4c('0x31')](_0x1770f6,_0x3a4c('0x2e'));_0x134124[_0x3a4c('0x44')]=_[_0x3a4c('0x45')](_0x2751d8[_0x3a4c('0x44')]);_0x134124[_0x3a4c('0x46')]=_[_0x3a4c('0x47')](_0x134124['model'],_0x134124[_0x3a4c('0x44')]);_0xdd715f['attributes']=_[_0x3a4c('0x47')](_0x134124[_0x3a4c('0x48')],qs['fields'](_0x2751d8['query'][_0x3a4c('0x49')]));_0xdd715f[_0x3a4c('0x4a')]=_0xdd715f[_0x3a4c('0x4a')]['length']?_0xdd715f[_0x3a4c('0x4a')]:_0x134124[_0x3a4c('0x48')];if(!_0x2751d8['query'][_0x3a4c('0x4b')]('nolimit')){_0xdd715f[_0x3a4c('0x23')]=qs[_0x3a4c('0x23')](_0x2751d8[_0x3a4c('0x44')][_0x3a4c('0x23')]);_0xdd715f[_0x3a4c('0x20')]=qs['offset'](_0x2751d8[_0x3a4c('0x44')][_0x3a4c('0x20')]);}_0xdd715f[_0x3a4c('0x4c')]=qs['sort'](_0x2751d8[_0x3a4c('0x44')][_0x3a4c('0x4d')]);_0xdd715f[_0x3a4c('0x4e')]=qs[_0x3a4c('0x46')](_[_0x3a4c('0x4f')](_0x2751d8[_0x3a4c('0x44')],_0x134124[_0x3a4c('0x46')]),_0x1770f6);var _0x553b0d=[];var _0x11f9b2=squel['select']()['field']('id')[_0x3a4c('0x50')](_0x3a4c('0x2e'))[_0x3a4c('0x50')](_0x3a4c('0x51'))['from'](_0x3a4c('0x52'));var _0x57312b=squel[_0x3a4c('0x53')]()['field'](_0x3a4c('0x54'))[_0x3a4c('0x50')](_0x3a4c('0x55'))['field'](_0x3a4c('0x56'))['from'](_0x3a4c('0x57'),'ui')[_0x3a4c('0x58')](_0x3a4c('0x59'),'u',_0x3a4c('0x5a'));var _0x224596=squel[_0x3a4c('0x53')]()['from'](_0x3a4c('0x5b'),'i')[_0x3a4c('0x58')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3a4c('0x58')](_0x3a4c('0x59'),'o',_0x3a4c('0x5c'))[_0x3a4c('0x58')](_0x3a4c('0x5d'),'a',_0x3a4c('0x5e'))[_0x3a4c('0x58')](_0x3a4c('0x5f'),'me',_0x3a4c('0x60'))['left_join'](_0x3a4c('0x61'),'it','it.SmsInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x46d396=squel['expr']();var _0x37d883=[];var _0x30dbcf=squel[_0x3a4c('0x62')]();var _0x32fcb5;if(_0x2751d8['query'][_0x3a4c('0x63')]){_0x32fcb5=as[_0x3a4c('0x64')](_0x2751d8[_0x3a4c('0x44')]['search']);var _0x1318bc=_0x32fcb5[_0x3a4c('0x65')];for(var _0x547598=0x0;_0x547598<_0x32fcb5['conditions']['length'];_0x547598++){var _0x2f6109=_0x32fcb5['conditions'][_0x547598];var _0x3f69a5='i';var _0x1159e1=_['find'](_0x1770f6,[_0x3a4c('0x2e'),_0x2f6109[_0x3a4c('0x50')]]);if(!_0x1159e1){switch(_0x2f6109[_0x3a4c('0x50')]){case _0x3a4c('0x66'):if(_0x2f6109[_0x3a4c('0x67')]==0x1){_0x224596['having']('`'+_0x2f6109[_0x3a4c('0x50')]+_0x3a4c('0x68'));}else{_0x224596[_0x3a4c('0x69')]('`'+_0x2f6109[_0x3a4c('0x50')]+_0x3a4c('0x6a'));}break;case'Contact':if(_0x2f6109[_0x3a4c('0x6b')]===_0x3a4c('0x6c')){if(_0x2f6109['value'][_0x3a4c('0x35')]('\x20')[_0x3a4c('0x6d')]>0x1){_0x46d396[_0x1318bc](_0x3a4c('0x6e'),qs[_0x3a4c('0x6f')](_0x2f6109['value']),null);}else{var _0x5cae19='%'+_0x2f6109[_0x3a4c('0x67')]+'%';_0x46d396[_0x1318bc](_0x3a4c('0x70'),_0x5cae19,_0x5cae19,_0x5cae19);}}else{_0x1159e1=_[_0x3a4c('0x71')](_0x1770f6,['name','ContactId']);_0x2f6109['field']=_0x3a4c('0x72');_0xcd41f9=as[_0x3a4c('0x73')](_0x3f69a5,_0x1159e1[_0x3a4c('0x42')],_0x2f6109);_0x46d396[_0x1318bc](_0xcd41f9[_0x3a4c('0x74')],_0xcd41f9[_0x3a4c('0x67')][_0x3a4c('0x75')],_0xcd41f9[_0x3a4c('0x67')][_0x3a4c('0x1e')]);}break;case'Tag':var _0x5c8e92=_0x2f6109['value'][_0x3a4c('0x35')](',')['map'](function(_0x17f225){return Number(_0x17f225);});_0x5c8e92[_0x3a4c('0x36')](function(_0x318963){_0x30dbcf['or'](_0x3a4c('0x76'),'%,'+_0x318963+',%');});_0x37d883=_[_0x3a4c('0x77')](_0x37d883,_0x5c8e92);break;case _0x3a4c('0x78'):if(_0x2f6109[_0x3a4c('0x6b')]===_0x3a4c('0x6c')){_0x46d396[_0x1318bc](_0x3a4c('0x79'),'%'+_0x2f6109['value']+'%',null);}else{_0x1159e1=_[_0x3a4c('0x71')](_0x1770f6,[_0x3a4c('0x2e'),_0x3a4c('0x3c')]);_0x2f6109[_0x3a4c('0x50')]=_0x3a4c('0x3c');_0xcd41f9=as['buildExpression'](_0x3f69a5,_0x1159e1[_0x3a4c('0x42')],_0x2f6109);_0x46d396[_0x1318bc](_0xcd41f9[_0x3a4c('0x74')],_0xcd41f9[_0x3a4c('0x67')]['start'],_0xcd41f9[_0x3a4c('0x67')][_0x3a4c('0x1e')]);}break;case'body':_0xcd41f9=as['buildExpression']('me',null,_0x2f6109);_0x46d396[_0x1318bc](_0xcd41f9[_0x3a4c('0x74')],_0xcd41f9['value'][_0x3a4c('0x75')],_0xcd41f9[_0x3a4c('0x67')][_0x3a4c('0x1e')]);break;}}else{var _0xcd41f9=as[_0x3a4c('0x73')](_0x3f69a5,_0x1159e1['type'],_0x2f6109);_0x46d396[_0x1318bc](_0xcd41f9[_0x3a4c('0x74')],_0xcd41f9['value'][_0x3a4c('0x75')],_0xcd41f9[_0x3a4c('0x67')][_0x3a4c('0x1e')]);}}}else{var _0x2e5cbf=_(_0x2751d8['query'])['keys']()[_0x3a4c('0x31')](function(_0x1e6421){return _[_0x3a4c('0x7a')](_0x1770f6,[_0x3a4c('0x2e'),_0x1e6421])?_0x1e6421:undefined;})['compact']()[_0x3a4c('0x67')]();if(!_['isEmpty'](_0x2e5cbf)){_0x2e5cbf[_0x3a4c('0x36')](function(_0x172d67){if(_0x172d67===_0x3a4c('0x7b')){_0x224596[_0x3a4c('0x4e')](_0x3a4c('0x7c'),[][_0x3a4c('0x7d')](_0x2751d8[_0x3a4c('0x44')][_0x172d67]));}else if(_0x172d67===_0x3a4c('0x7e')){var _0x4b2b56=JSON[_0x3a4c('0x7f')](_0x2751d8['query'][_0x172d67])[_0x3a4c('0x80')];var _0x410e3e=JSON[_0x3a4c('0x7f')](_0x2751d8[_0x3a4c('0x44')][_0x172d67])[_0x3a4c('0x81')];_0x224596[_0x3a4c('0x4e')](_0x3a4c('0x82'),_0x4b2b56,_0x410e3e);}else{if(_0x2751d8[_0x3a4c('0x44')][_0x172d67]===_0x3a4c('0x83')){_0x224596[_0x3a4c('0x4e')]('i.'+_0x172d67+_0x3a4c('0x84'));}else{_0x224596['where']('i.'+_0x172d67+'\x20=\x20?',_0x2751d8[_0x3a4c('0x44')][_0x172d67]);}}});}if(_0x2751d8[_0x3a4c('0x44')]['read']){if(_0x2751d8[_0x3a4c('0x44')][_0x3a4c('0x85')]==0x1){_0x224596[_0x3a4c('0x69')](_0x3a4c('0x86'));}else{_0x224596[_0x3a4c('0x69')](_0x3a4c('0x87'));}}if(_0x2751d8[_0x3a4c('0x44')]['tag']){_0x37d883=_[_0x3a4c('0x88')](_0x2751d8[_0x3a4c('0x44')]['tag'])?_0x2751d8['query'][_0x3a4c('0x89')]:new Array(_0x2751d8[_0x3a4c('0x44')]['tag']);_0x37d883[_0x3a4c('0x36')](function(_0x1231a6){_0x30dbcf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1231a6+',%');});}if(_0x2751d8['query']['filter']){var _0x15ffec=_0x2751d8[_0x3a4c('0x44')][_0x3a4c('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x3a4c('0x8b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x15ffec)){_0x46d396['or'](_0x3a4c('0x8c'),_0x15ffec+'%')['or'](_0x3a4c('0x8d'),_0x15ffec+'%');}else{_0x46d396['or'](_0x3a4c('0x8e'),qs[_0x3a4c('0x6f')](_0x15ffec))['or'](_0x3a4c('0x8f'),_0x15ffec+'%');}}}_0x224596[_0x3a4c('0x4e')](_0x46d396);_0x224596[_0x3a4c('0x90')]('i.id');var _0xe9a54f={'type':db[_0x3a4c('0x91')][_0x3a4c('0x92')][_0x3a4c('0x93')],'raw':!![]};var _0x236ccc=_0x224596[_0x3a4c('0x94')]();_0x236ccc['field'](_0x3a4c('0x95'));_0x236ccc['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3a4c('0x66'));if(_0xdd715f[_0x3a4c('0x4c')]){_0xdd715f[_0x3a4c('0x4c')][_0x3a4c('0x36')](function(_0x1e495a){var _0x5616db=_0x1e495a[0x0]===_0x3a4c('0x96')?_0x1e495a[0x0]:'i.'+_0x1e495a[0x0];_0x224596['order'](_0x5616db,_0x1e495a[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3a4c('0x97')](_0x37d883)){_0x224596['having'](_0x30dbcf);_0x236ccc[_0x3a4c('0x4e')](_0x3a4c('0x98'),_0x37d883);}BPromise[_0x3a4c('0x99')]()[_0x3a4c('0x2b')](function(){if(!_0x32fcb5){if(_0x2751d8[_0x3a4c('0x44')][_0x3a4c('0x7b')])return;_0x236ccc[_0x3a4c('0x4e')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x224596[_0x3a4c('0x4e')](_0x3a4c('0x9a'));return;}if(_0x2751d8[_0x3a4c('0x9b')][_0x3a4c('0x9c')]!==_0x3a4c('0x9d'))return;return _0x2751d8['user'][_0x3a4c('0x9e')]({'attributes':['id'],'raw':!![]})[_0x3a4c('0x2b')](function(_0x22bc35){if(_[_0x3a4c('0x97')](_0x22bc35)){_0x236ccc[_0x3a4c('0x4e')](_0x3a4c('0x9f'));_0x224596[_0x3a4c('0x4e')](_0x3a4c('0x9f'));}else{_0x236ccc['where'](_0x3a4c('0x7c'),_[_0x3a4c('0x31')](_0x22bc35,'id'));_0x224596[_0x3a4c('0x4e')](_0x3a4c('0x7c'),_[_0x3a4c('0x31')](_0x22bc35,'id'));}});})[_0x3a4c('0x2b')](function(){if(_0x2751d8['user']['role']===_0x3a4c('0x9d')&&!_0x32fcb5&&!_0x2751d8[_0x3a4c('0x44')][_0x3a4c('0x7b')])return[];return db[_0x3a4c('0xa0')][_0x3a4c('0x44')](_0x236ccc[_0x3a4c('0xa1')](),_0xe9a54f);})[_0x3a4c('0x2b')](function(_0x225c0e){_0xd51a6d['count']=_0x225c0e[_0x3a4c('0x6d')];if(_0xd51a6d['count']===0x0)return[];return db[_0x3a4c('0xa0')][_0x3a4c('0x44')](_0x11f9b2['toString'](),_0xe9a54f)[_0x3a4c('0x2b')](function(_0x2be545){_0x553b0d=_['keyBy'](_0x2be545,'id');_0xe9a54f=_[_0x3a4c('0xa2')](_0xe9a54f,{'model':db[_0x3a4c('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2751d8['query'][_0x3a4c('0x49')]){_0xdd715f[_0x3a4c('0x4a')]['forEach'](function(_0x4d650d){_0x224596[_0x3a4c('0x50')]('i.'+_0x4d650d);});}else{_0x224596['field'](_0x3a4c('0xa3'),_0x3a4c('0x66'));_0x224596[_0x3a4c('0x50')]('a.key',_0x3a4c('0xa4'));_0x224596['field'](_0x3a4c('0xa5'),_0x3a4c('0xa6'));_0x224596['field'](_0x3a4c('0xa7'),_0x3a4c('0x96'));_0x224596[_0x3a4c('0x50')](_0x3a4c('0xa8'));_0x224596[_0x3a4c('0x50')]('c.firstName',_0x3a4c('0xa9'));_0x224596[_0x3a4c('0x50')]('c.lastName',_0x3a4c('0xaa'));_0x224596[_0x3a4c('0x50')](_0x3a4c('0xab'),_0x3a4c('0xac'));_0x224596[_0x3a4c('0x50')](_0x3a4c('0xad'),_0x3a4c('0xae'));_0x224596[_0x3a4c('0x50')](_0x3a4c('0xaf'),'Contact.mobile');_0x224596[_0x3a4c('0x50')](_0x3a4c('0xb0'),_0x3a4c('0xb1'));_0x224596[_0x3a4c('0x50')](_0x3a4c('0xb2'),_0x3a4c('0xb3'));_0x224596['field'](_0x3a4c('0xb4'),_0x3a4c('0xb5'));_0x224596['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xdd715f[_0x3a4c('0x23')])_0x224596[_0x3a4c('0x23')](_0xdd715f['limit']);if(_0xdd715f[_0x3a4c('0x20')])_0x224596[_0x3a4c('0x20')](_0xdd715f[_0x3a4c('0x20')]);return db[_0x3a4c('0xa0')][_0x3a4c('0x44')](_0x224596[_0x3a4c('0xa1')](),_0xe9a54f);})[_0x3a4c('0x2b')](function(_0x4c7aee){if(_0x4c7aee[_0x3a4c('0x6d')]>0x0)_0x57312b[_0x3a4c('0x4e')](_0x3a4c('0xb6'),_['map'](_0x4c7aee,'id'));return db[_0x3a4c('0xa0')][_0x3a4c('0x44')](_0x57312b[_0x3a4c('0xa1')](),_0xe9a54f)[_0x3a4c('0x2b')](function(_0x4b56d9){var _0x36270a=_['groupBy'](_0x4b56d9,_0x3a4c('0xb7'));var _0x4e1585=[];_0x4c7aee[_0x3a4c('0x36')](function(_0x25701b){_0x4e1585[_0x3a4c('0xb8')](updateSmsInteraction(_0x25701b,_0x553b0d,_0x36270a));});return BPromise['all'](_0x4e1585);});});})['then'](function(_0x331df7){_0xd51a6d[_0x3a4c('0xb9')]=_0x331df7;return _0xd51a6d;})['then'](respondWithFilteredResult(_0x47e285,_0xdd715f))[_0x3a4c('0xba')](handleError(_0x47e285,null));};exports[_0x3a4c('0xbb')]=function(_0x5bc469,_0x2813a4){var _0x514fc6={'raw':![],'where':{'id':_0x5bc469[_0x3a4c('0xbc')]['id']}},_0x7e68b1={};_0x7e68b1[_0x3a4c('0x48')]=_[_0x3a4c('0x45')](db[_0x3a4c('0x3f')][_0x3a4c('0x40')]);_0x7e68b1['query']=_['keys'](_0x5bc469['query']);_0x7e68b1[_0x3a4c('0x46')]=_['intersection'](_0x7e68b1[_0x3a4c('0x48')],_0x7e68b1[_0x3a4c('0x44')]);_0x514fc6[_0x3a4c('0x4a')]=_[_0x3a4c('0x47')](_0x7e68b1[_0x3a4c('0x48')],qs[_0x3a4c('0x49')](_0x5bc469[_0x3a4c('0x44')][_0x3a4c('0x49')]));_0x514fc6[_0x3a4c('0x4a')]=_0x514fc6[_0x3a4c('0x4a')][_0x3a4c('0x6d')]?_0x514fc6[_0x3a4c('0x4a')]:_0x7e68b1['model'];if(_0x5bc469[_0x3a4c('0x44')][_0x3a4c('0xbd')]){_0x514fc6['include']=[{'all':!![]}];}_0x514fc6=_['merge']({},_0x514fc6,_0x5bc469[_0x3a4c('0xbe')]);return db[_0x3a4c('0x3f')][_0x3a4c('0x71')](_0x514fc6)[_0x3a4c('0x2b')](handleEntityNotFound(_0x2813a4,null))[_0x3a4c('0x2b')](respondWithResult(_0x2813a4,null))[_0x3a4c('0xba')](handleError(_0x2813a4,null));};exports[_0x3a4c('0xbf')]=function(_0x2216d5,_0x6503ef){return db[_0x3a4c('0x3f')][_0x3a4c('0xbf')](_0x2216d5['body'],{})[_0x3a4c('0x2b')](respondWithResult(_0x6503ef,0xc9))['catch'](handleError(_0x6503ef,null));};exports['update']=function(_0x45a998,_0x2275de){if(_0x45a998[_0x3a4c('0xc0')]['id']){delete _0x45a998[_0x3a4c('0xc0')]['id'];}return db[_0x3a4c('0x3f')]['find']({'where':{'id':_0x45a998['params']['id']}})[_0x3a4c('0x2b')](handleEntityNotFound(_0x2275de,null))[_0x3a4c('0x2b')](saveUpdates(_0x45a998[_0x3a4c('0xc0')],null))[_0x3a4c('0x2b')](respondWithResult(_0x2275de,null))[_0x3a4c('0xba')](handleError(_0x2275de,null));};exports[_0x3a4c('0x2a')]=function(_0x5b9151,_0x16bedf){return db[_0x3a4c('0x3f')][_0x3a4c('0x71')]({'where':{'id':_0x5b9151[_0x3a4c('0xbc')]['id']}})[_0x3a4c('0x2b')](handleEntityNotFound(_0x16bedf,null))[_0x3a4c('0x2b')](removeEntity(_0x16bedf,null))[_0x3a4c('0xba')](handleError(_0x16bedf,null));};exports[_0x3a4c('0xc1')]=function(_0xeb4e29,_0x16deef){return db[_0x3a4c('0x3f')]['describe']()['then'](respondWithResult(_0x16deef,null))['catch'](handleError(_0x16deef,null));};exports['addMessage']=function(_0x40afba,_0x2b0e52,_0x5e2cc6){return db[_0x3a4c('0xc2')]['find']({'where':{'id':_0x40afba[_0x3a4c('0xbc')]['id']}})['then'](handleEntityNotFound(_0x2b0e52,null))[_0x3a4c('0x2b')](function(_0xc55de1){if(_0xc55de1){return _0xc55de1['addMessage'](_0x40afba[_0x3a4c('0xc0')][_0x3a4c('0xc3')],_['omit'](_0x40afba[_0x3a4c('0xc0')],[_0x3a4c('0xc3'),'id'])||{});}})['then'](respondWithResult(_0x2b0e52,null))['catch'](handleError(_0x2b0e52,null));};exports[_0x3a4c('0xc4')]=function(_0x599eaa,_0x3aa953,_0x4b1585){var _0x2505f2={'raw':![],'where':{}};var _0x5ca5c3={};var _0x231285={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x3a4c('0xc5')]({'where':{'id':_0x599eaa[_0x3a4c('0xbc')]['id']}})['then'](handleEntityNotFound(_0x3aa953,null))[_0x3a4c('0x2b')](function(_0x59c09c){if(_0x59c09c){_0x5ca5c3[_0x3a4c('0x48')]=_[_0x3a4c('0x45')](db[_0x3a4c('0xc2')][_0x3a4c('0x40')]);_0x5ca5c3['query']=_['keys'](_0x599eaa[_0x3a4c('0x44')]);_0x5ca5c3[_0x3a4c('0x46')]=_[_0x3a4c('0x47')](_0x5ca5c3[_0x3a4c('0x48')],_0x5ca5c3[_0x3a4c('0x44')]);_0x2505f2[_0x3a4c('0x4a')]=_[_0x3a4c('0x47')](_0x5ca5c3['model'],qs[_0x3a4c('0x49')](_0x599eaa['query']['fields']));_0x2505f2[_0x3a4c('0x4a')]=_0x2505f2[_0x3a4c('0x4a')][_0x3a4c('0x6d')]?_0x2505f2['attributes']:_0x5ca5c3[_0x3a4c('0x48')];if(!_0x599eaa['query'][_0x3a4c('0x4b')](_0x3a4c('0xc6'))){_0x2505f2[_0x3a4c('0x23')]=qs[_0x3a4c('0x23')](_0x599eaa[_0x3a4c('0x44')][_0x3a4c('0x23')]);_0x2505f2['offset']=qs['offset'](_0x599eaa[_0x3a4c('0x44')][_0x3a4c('0x20')]);}_0x2505f2[_0x3a4c('0x4c')]=qs[_0x3a4c('0x4d')](_0x599eaa[_0x3a4c('0x44')][_0x3a4c('0x4d')]);_0x2505f2[_0x3a4c('0x4e')]=qs[_0x3a4c('0x46')](_['pick'](_0x599eaa[_0x3a4c('0x44')],_0x5ca5c3[_0x3a4c('0x46')]));_0x2505f2[_0x3a4c('0x4e')][_0x3a4c('0xb7')]=_0x59c09c['id'];if(_0x599eaa[_0x3a4c('0x44')]['filter']){_0x2505f2[_0x3a4c('0x4e')]=_[_0x3a4c('0xa2')](_0x2505f2[_0x3a4c('0x4e')],{'$or':_[_0x3a4c('0x31')](_0x2505f2[_0x3a4c('0x4a')],function(_0x4793d4){var _0x3aa569={};_0x3aa569[_0x4793d4]={'$like':'%'+_0x599eaa[_0x3a4c('0x44')][_0x3a4c('0x8a')]+'%'};return _0x3aa569;})});}if(_0x599eaa['query'][_0x3a4c('0x80')]){var _0x24c645=_0x599eaa['query'][_0x3a4c('0x80')]['split'](',');var _0x548e18={};_0x548e18[_0x24c645[0x0]]={'$gte':moment(_0x24c645[0x1])['format'](_0x3a4c('0xc7'))};_0x2505f2[_0x3a4c('0x4e')]=_[_0x3a4c('0xa2')](_0x2505f2[_0x3a4c('0x4e')],_0x548e18);}_0x2505f2=_[_0x3a4c('0xa2')]({},_0x2505f2,_0x599eaa[_0x3a4c('0xbe')]);return db[_0x3a4c('0xc2')]['count']({'where':_0x2505f2[_0x3a4c('0x4e')]})[_0x3a4c('0x2b')](function(_0x2eaf2b){_0x231285[_0x3a4c('0x22')]=_0x2eaf2b;if(_0x599eaa[_0x3a4c('0x44')][_0x3a4c('0xbd')]){_0x2505f2['include']=[{'all':!![]}];}return db[_0x3a4c('0xc2')][_0x3a4c('0xc8')](_0x2505f2);})[_0x3a4c('0x2b')](function(_0x2c645c){_0x231285['rows']=_0x2c645c;return _0x231285;});}})['then'](respondWithFilteredResult(_0x3aa953,_0x2505f2))[_0x3a4c('0xba')](handleError(_0x3aa953,null));};exports[_0x3a4c('0xc9')]=function(_0xe89227,_0x14c9ab,_0x2968c4){return db[_0x3a4c('0x3f')]['find']({'where':{'id':_0xe89227['params']['id']}})['then'](handleEntityNotFound(_0x14c9ab,null))['then'](function(_0x737d03){if(_0x737d03){return _0x737d03[_0x3a4c('0xca')](_0xe89227[_0x3a4c('0xc0')][_0x3a4c('0xc3')],_[_0x3a4c('0xcb')](_0xe89227['body'],[_0x3a4c('0xc3'),'id'])||{})['spread'](function(){return db[_0x3a4c('0xcc')][_0x3a4c('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0xe89227[_0x3a4c('0xc0')][_0x3a4c('0xc3')]}});})[_0x3a4c('0x2b')](function(_0xf158ec){socket['emit']('smsInteractionTags:save',{'id':Number(_0xe89227['params']['id']),'tags':_0xf158ec||[]});return{'id':Number(_0xe89227[_0x3a4c('0xbc')]['id']),'tags':_0xf158ec||[]};});}})[_0x3a4c('0x2b')](respondWithResult(_0x14c9ab,null))['catch'](handleError(_0x14c9ab,null));};exports[_0x3a4c('0xcd')]=function(_0x4266e8,_0x290e49,_0x915419){return db[_0x3a4c('0x3f')][_0x3a4c('0x71')]({'where':{'id':_0x4266e8[_0x3a4c('0xbc')]['id']}})[_0x3a4c('0x2b')](handleEntityNotFound(_0x290e49,null))[_0x3a4c('0x2b')](function(_0x428c66){if(_0x428c66){return _0x428c66['removeTags'](_0x4266e8[_0x3a4c('0x44')][_0x3a4c('0xc3')]);}})[_0x3a4c('0x2b')](respondWithStatusCode(_0x290e49,null))['catch'](handleError(_0x290e49,null));};exports[_0x3a4c('0xce')]=function(_0x3a1147,_0x51be36){var _0x4f613f=moment()[_0x3a4c('0xcf')]()[_0x3a4c('0xa1')]();var _0x241e0e=path['join'](config[_0x3a4c('0xd0')],'server',_0x3a4c('0xd1'),'tmp');var _0x4e0e59=path[_0x3a4c('0xd2')](config['root'],_0x3a4c('0xd3'),'files',_0x3a4c('0xd4'));var _0x48eb60=path[_0x3a4c('0xd2')](_0x241e0e,_0x4f613f);var _0x51c34d=util[_0x3a4c('0xd5')](_0x3a4c('0xd6'),_0x3a1147['params']['id'],_0x4f613f);var _0x27308a=path[_0x3a4c('0xd2')](_0x241e0e,_0x51c34d);var _0x1cb475=[];_0x1cb475[_0x3a4c('0xb8')]({'model':db[_0x3a4c('0x78')],'as':_0x3a4c('0x78'),'attributes':['id',_0x3a4c('0x32')],'raw':!![]});_0x1cb475['push']({'model':db['CmContact'],'as':_0x3a4c('0xd7'),'attributes':['id',_0x3a4c('0xd8'),_0x3a4c('0xd9')],'raw':!![]});var _0x245d4e=[{'model':db[_0x3a4c('0xc2')],'as':_0x3a4c('0xda'),'attributes':['id','body',_0x3a4c('0x7e'),_0x3a4c('0xdb'),_0x3a4c('0xdc'),_0x3a4c('0x85')],'include':_0x1cb475}];_0x245d4e['push']({'model':db[_0x3a4c('0xdd')],'as':_0x3a4c('0xde'),'attributes':['id','name']});_0x245d4e[_0x3a4c('0xb8')]({'model':db[_0x3a4c('0x78')],'as':_0x3a4c('0xdf'),'attributes':['id',_0x3a4c('0x32')]});return db[_0x3a4c('0x3f')][_0x3a4c('0x71')]({'where':{'id':_0x3a1147['params']['id']},'include':_0x245d4e})['then'](handleEntityNotFound(_0x51be36,null))[_0x3a4c('0x2b')](function(_0x1d37c0){if(_0x1d37c0){var _0x16c4e1=_0x1d37c0[_0x3a4c('0xe0')]({'plain':!![]});fs['mkdirSync'](_0x48eb60);var _0x5db9b5={'channel':_0x3a4c('0xe1'),'account':_0x16c4e1['Account']['name'],'agent':_0x16c4e1[_0x3a4c('0xdf')]?_0x16c4e1['Owner'][_0x3a4c('0x32')]:_0x3a4c('0xe2'),'createdAt':moment(_0x16c4e1['createdAt'])[_0x3a4c('0xd5')](_0x3a4c('0xc7'))['toString'](),'closedAt':_0x16c4e1[_0x3a4c('0x3b')]?moment(_0x16c4e1[_0x3a4c('0xe3')])[_0x3a4c('0xd5')](_0x3a4c('0xc7'))[_0x3a4c('0xa1')]():'','disposition':_0x16c4e1[_0x3a4c('0xe4')],'messages':_(_0x16c4e1[_0x3a4c('0xda')])[_0x3a4c('0x8a')]({'secret':![]})[_0x3a4c('0x31')](function(_0x4e269d){return{'date':moment(_0x4e269d['createdAt'])[_0x3a4c('0xd5')](_0x3a4c('0xc7'))['toString'](),'sender':_0x4e269d[_0x3a4c('0xdb')]===_0x3a4c('0xe5')?_0x4e269d[_0x3a4c('0x78')]?_0x4e269d[_0x3a4c('0x78')]['fullname']:_0x3a4c('0xe6'):_0x4e269d[_0x3a4c('0xd7')][_0x3a4c('0xd8')]+(_0x4e269d[_0x3a4c('0xd7')][_0x3a4c('0xd9')]?'\x20'+_0x4e269d[_0x3a4c('0xd7')][_0x3a4c('0xd9')]:''),'body':_0x4e269d[_0x3a4c('0xc0')],'direction':_0x4e269d[_0x3a4c('0xdb')]===_0x3a4c('0xe5')?'A':'C','secret':_0x4e269d['secret'],'read':_0x4e269d['read']};})[_0x3a4c('0x67')]()};return ejs[_0x3a4c('0xe7')](path[_0x3a4c('0xd2')](config['root'],'server',_0x3a4c('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x5db9b5})[_0x3a4c('0x2b')](function(_0x5cc5d1){var _0x542fa5=path[_0x3a4c('0xd2')](_0x48eb60,_0x3a4c('0xe9')+_0x16c4e1['id']+'-'+_0x4f613f+_0x3a4c('0xea'));var _0xf423f0={'path':_0x542fa5,'channel':_0x3a4c('0xe1'),'interactionId':_0x16c4e1['id']};return pdf[_0x3a4c('0xeb')](_0x5cc5d1,_0xf423f0);})[_0x3a4c('0x2b')](function(){return new BPromise(function(_0x3d2eea,_0x54d15b){zipdir(_0x48eb60,{'saveTo':_0x27308a},function(_0x308e49,_0x3b6612){if(_0x308e49)return _0x54d15b(_0x308e49);return _0x3d2eea(_0x3b6612);});})[_0x3a4c('0x2b')](function(){return new BPromise(function(_0x4ba71d,_0x4c7297){rimraf(_0x48eb60,function(_0x42f864){if(_0x42f864)_0x4c7297(_0x42f864);return _0x4ba71d();});});})[_0x3a4c('0x2b')](function(){return _0x51be36[_0x3a4c('0xce')](_0x27308a,_0x51c34d,function(_0x33e360){if(_0x33e360){console[_0x3a4c('0xec')](_0x3a4c('0xed'),_0x33e360);}else{fs[_0x3a4c('0xee')](_0x27308a);}});});});}else{return _0x51be36[_0x3a4c('0xef')](0xc8);}})['catch'](handleError(_0x51be36,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 297041e..0d15199 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x410680,_0x450b2d){var _0x49dc01=function(_0x34cd93){while(--_0x34cd93){_0x410680['push'](_0x410680['shift']());}};_0x49dc01(++_0x450b2d);}(_0xdb28,0x106));var _0x8db2=function(_0x5a0898,_0x5e1eb5){_0x5a0898=_0x5a0898-0x0;var _0x379d60=_0xdb28[_0x5a0898];return _0x379d60;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x056b=['hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x172e68,_0x53c9a5){var _0x293e62=function(_0x39d5c7){while(--_0x39d5c7){_0x172e68['push'](_0x172e68['shift']());}};_0x293e62(++_0x53c9a5);}(_0x056b,0xb6));var _0xb056=function(_0x3791a5,_0x3e9d44){_0x3791a5=_0x3791a5-0x0;var _0x495f05=_0x056b[_0x3791a5];return _0x495f05;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xb056('0x0'))['db'][_0xb056('0x1')];var SmsMessage=require(_0xb056('0x0'))['db'][_0xb056('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xb056('0x3')](0x0);var events={'afterCreate':_0xb056('0x4'),'afterUpdate':_0xb056('0x5'),'afterDestroy':_0xb056('0x6')};function emitEvent(_0x343d88){return function(_0x2ff09d,_0x15a545,_0x515612){_0x2ff09d[_0xb056('0x7')]({'attributes':['id'],'raw':!![]})[_0xb056('0x8')](function(_0x3eae69){_0x2ff09d[_0xb056('0x9')](_0xb056('0xa'),_0x3eae69[_0xb056('0xb')](function(_0x539126){return{'id':_0x539126['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x2ff09d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb056('0x8')](function(_0x160c2a){_0x2ff09d[_0xb056('0x9')](_0xb056('0xc'),_0x160c2a['length']);SmsInteractionEvents[_0xb056('0xd')](_0x343d88+':'+_0x2ff09d['id'],_0x2ff09d);SmsInteractionEvents['emit'](_0x343d88,_0x2ff09d);_0x515612(null);})[_0xb056('0xe')](_0x515612(null));};}for(var e in events){if(events[_0xb056('0xf')](e)){var event=events[e];SmsInteraction[_0xb056('0x10')](e,emitEvent(event));}}module[_0xb056('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 7b295ba..374d8ca 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 _0x90a3=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','SmsInteraction','sms_interactions'];(function(_0x25ab8a,_0x3b9774){var _0x103f2c=function(_0x19426b){while(--_0x19426b){_0x25ab8a['push'](_0x25ab8a['shift']());}};_0x103f2c(++_0x3b9774);}(_0x90a3,0x135));var _0x390a=function(_0x47e036,_0x2cd6da){_0x47e036=_0x47e036-0x0;var _0xfc6cf1=_0x90a3[_0x47e036];return _0xfc6cf1;};'use strict';var _=require('lodash');var util=require(_0x390a('0x0'));var logger=require(_0x390a('0x1'))(_0x390a('0x2'));var moment=require(_0x390a('0x3'));var BPromise=require(_0x390a('0x4'));var rp=require(_0x390a('0x5'));var fs=require('fs');var path=require(_0x390a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x390a('0x7')]=function(_0x446888,_0x3b9137){return _0x446888[_0x390a('0x8')](_0x390a('0x9'),attributes,{'tableName':_0x390a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46e4c6,_0x193626,_0x36b6f9){if(_0x46e4c6[_0x390a('0xb')](_0x390a('0xc'))){_0x46e4c6[_0x390a('0xd')]=moment()[_0x390a('0xe')](_0x390a('0xf'));}_0x36b6f9(null,_0x46e4c6);}}});}; \ No newline at end of file +var _0x8915=['lodash','util','../../config/logger','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2e9023,_0x65546f){var _0x596ca8=function(_0x176c1b){while(--_0x176c1b){_0x2e9023['push'](_0x2e9023['shift']());}};_0x596ca8(++_0x65546f);}(_0x8915,0x8f));var _0x5891=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x8915[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0x5891('0x0'));var util=require(_0x5891('0x1'));var logger=require(_0x5891('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5891('0x3'));var fs=require('fs');var path=require(_0x5891('0x4'));var rimraf=require('rimraf');var config=require(_0x5891('0x5'));var attributes=require(_0x5891('0x6'));module[_0x5891('0x7')]=function(_0x5ae23b,_0x46a44c){return _0x5ae23b[_0x5891('0x8')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa2852,_0x40b993,_0x402f8b){if(_0xa2852[_0x5891('0x9')]('closed')){_0xa2852[_0x5891('0xa')]=moment()[_0x5891('0xb')](_0x5891('0xc'));}_0x402f8b(null,_0xa2852);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 7c076ba..6330e28 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 _0x3a87=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','body','options','limit','AddTagsToSmsInteraction','SmsInteraction','find','where','addTags','ids','omit','spread','AddTags'];(function(_0x437b10,_0x38d59f){var _0xcf739d=function(_0x2bab5a){while(--_0x2bab5a){_0x437b10['push'](_0x437b10['shift']());}};_0xcf739d(++_0x38d59f);}(_0x3a87,0x7e));var _0x73a8=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x3a87[_0x5d8631];return _0x34c15e;};'use strict';var _=require(_0x73a8('0x0'));var util=require(_0x73a8('0x1'));var moment=require(_0x73a8('0x2'));var BPromise=require(_0x73a8('0x3'));var rs=require(_0x73a8('0x4'));var fs=require('fs');var Redis=require(_0x73a8('0x5'));var db=require(_0x73a8('0x6'))['db'];var utils=require(_0x73a8('0x7'));var logger=require(_0x73a8('0x8'))(_0x73a8('0x9'));var config=require(_0x73a8('0xa'));var jayson=require(_0x73a8('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x73a8('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73a8('0xd')]));require(_0x73a8('0xe'))[_0x73a8('0xf')](socket);function respondWithRpcPromise(_0x5a2509,_0x4bdc74,_0x4cb9d0){return new BPromise(function(_0x283b99,_0x4cdf3a){return client[_0x73a8('0x10')](_0x5a2509,_0x4cb9d0)[_0x73a8('0x11')](function(_0x3bcdbc){logger[_0x73a8('0x12')](_0x73a8('0x13'),_0x4bdc74,_0x73a8('0x14'));logger[_0x73a8('0x15')](_0x73a8('0x16'),_0x4bdc74,_0x73a8('0x14'),JSON[_0x73a8('0x17')](_0x3bcdbc));if(_0x3bcdbc[_0x73a8('0x18')]){if(_0x3bcdbc['error'][_0x73a8('0x19')]===0x1f4){logger[_0x73a8('0x18')](_0x73a8('0x13'),_0x4bdc74,_0x3bcdbc[_0x73a8('0x18')][_0x73a8('0x1a')]);return _0x4cdf3a(_0x3bcdbc[_0x73a8('0x18')][_0x73a8('0x1a')]);}logger[_0x73a8('0x18')](_0x73a8('0x13'),_0x4bdc74,_0x3bcdbc['error'][_0x73a8('0x1a')]);return _0x283b99(_0x3bcdbc[_0x73a8('0x18')]['message']);}else{logger[_0x73a8('0x12')](_0x73a8('0x13'),_0x4bdc74,_0x73a8('0x14'));_0x283b99(_0x3bcdbc[_0x73a8('0x1b')][_0x73a8('0x1a')]);}})[_0x73a8('0x1c')](function(_0x568784){logger[_0x73a8('0x18')](_0x73a8('0x13'),_0x4bdc74,_0x568784);_0x4cdf3a(_0x568784);});});}exports[_0x73a8('0x1d')]=function(_0x1a2fe9){var _0x59caa9=this;return new Promise(function(_0x106d34,_0x1fd26f){return db['SmsInteraction']['update'](_0x1a2fe9[_0x73a8('0x1e')],{'raw':_0x1a2fe9['options']?_0x1a2fe9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a2fe9[_0x73a8('0x1f')]?_0x1a2fe9[_0x73a8('0x1f')]['where']||null:null,'attributes':_0x1a2fe9[_0x73a8('0x1f')]?_0x1a2fe9['options']['attributes']||null:null,'limit':_0x1a2fe9[_0x73a8('0x1f')]?_0x1a2fe9[_0x73a8('0x1f')][_0x73a8('0x20')]||null:null})[_0x73a8('0x11')](function(_0x3fa2b0){logger[_0x73a8('0x12')]('UpdateSmsInteraction',_0x1a2fe9);logger[_0x73a8('0x15')](_0x73a8('0x1d'),_0x1a2fe9,JSON['stringify'](_0x3fa2b0));_0x106d34(_0x3fa2b0);})[_0x73a8('0x1c')](function(_0x19de85){logger[_0x73a8('0x18')](_0x73a8('0x1d'),_0x19de85['message'],_0x1a2fe9);_0x1fd26f(_0x59caa9[_0x73a8('0x18')](0x1f4,_0x19de85[_0x73a8('0x1a')]));});});};exports[_0x73a8('0x21')]=function(_0x229f03){return new Promise(function(_0x2065d6,_0x23f19e){return db[_0x73a8('0x22')][_0x73a8('0x23')]({'where':_0x229f03['options']?_0x229f03[_0x73a8('0x1f')][_0x73a8('0x24')]||null:null})[_0x73a8('0x11')](function(_0xfdb1be){if(_0xfdb1be){return _0xfdb1be[_0x73a8('0x25')](_0x229f03[_0x73a8('0x1e')][_0x73a8('0x26')],_[_0x73a8('0x27')](_0x229f03[_0x73a8('0x1e')],['ids','id'])||{});}})[_0x73a8('0x28')](function(_0x18ab8a){logger[_0x73a8('0x12')]('AddTags',_0x229f03);logger['debug']('AddTags',_0x229f03,JSON['stringify'](_0x18ab8a));_0x2065d6(_0x18ab8a);})[_0x73a8('0x1c')](function(_0x2e7939){logger[_0x73a8('0x18')](_0x73a8('0x29'),_0x2e7939[_0x73a8('0x1a')],_0x229f03);_0x23f19e(_this[_0x73a8('0x18')](0x1f4,_0x2e7939[_0x73a8('0x1a')]));});});}; \ No newline at end of file +var _0xfc07=['SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','limit','debug','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x16e1d5,_0x26b53b){var _0x534f2c=function(_0x324736){while(--_0x324736){_0x16e1d5['push'](_0x16e1d5['shift']());}};_0x534f2c(++_0x26b53b);}(_0xfc07,0x10d));var _0x7fc0=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xfc07[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0x7fc0('0x0'));var util=require(_0x7fc0('0x1'));var moment=require(_0x7fc0('0x2'));var BPromise=require(_0x7fc0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fc0('0x4'));var db=require(_0x7fc0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fc0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7fc0('0x7'));var client=jayson[_0x7fc0('0x8')][_0x7fc0('0x9')]({'port':0x232a});config['redis']=_[_0x7fc0('0xa')](config[_0x7fc0('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fc0('0xb')]));require(_0x7fc0('0xc'))[_0x7fc0('0xd')](socket);function respondWithRpcPromise(_0x587f37,_0xfe70d5,_0x173549){return new BPromise(function(_0x5b0c23,_0x2bb453){return client[_0x7fc0('0xe')](_0x587f37,_0x173549)[_0x7fc0('0xf')](function(_0x55f1b7){logger['info'](_0x7fc0('0x10'),_0xfe70d5,_0x7fc0('0x11'));logger['debug'](_0x7fc0('0x12'),_0xfe70d5,_0x7fc0('0x11'),JSON[_0x7fc0('0x13')](_0x55f1b7));if(_0x55f1b7[_0x7fc0('0x14')]){if(_0x55f1b7[_0x7fc0('0x14')][_0x7fc0('0x15')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0xfe70d5,_0x55f1b7['error'][_0x7fc0('0x16')]);return _0x2bb453(_0x55f1b7[_0x7fc0('0x14')]['message']);}logger[_0x7fc0('0x14')](_0x7fc0('0x10'),_0xfe70d5,_0x55f1b7[_0x7fc0('0x14')][_0x7fc0('0x16')]);return _0x5b0c23(_0x55f1b7[_0x7fc0('0x14')][_0x7fc0('0x16')]);}else{logger[_0x7fc0('0x17')]('SmsInteraction,\x20%s,\x20%s',_0xfe70d5,_0x7fc0('0x11'));_0x5b0c23(_0x55f1b7[_0x7fc0('0x18')][_0x7fc0('0x16')]);}})[_0x7fc0('0x19')](function(_0x3b7d28){logger['error'](_0x7fc0('0x10'),_0xfe70d5,_0x3b7d28);_0x2bb453(_0x3b7d28);});});}exports[_0x7fc0('0x1a')]=function(_0x151e1a){var _0x14db57=this;return new Promise(function(_0x460980,_0x51ac74){return db[_0x7fc0('0x1b')]['update'](_0x151e1a[_0x7fc0('0x1c')],{'raw':_0x151e1a[_0x7fc0('0x1d')]?_0x151e1a['options'][_0x7fc0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x151e1a[_0x7fc0('0x1d')]?_0x151e1a[_0x7fc0('0x1d')][_0x7fc0('0x1f')]||null:null,'attributes':_0x151e1a['options']?_0x151e1a[_0x7fc0('0x1d')]['attributes']||null:null,'limit':_0x151e1a['options']?_0x151e1a['options'][_0x7fc0('0x20')]||null:null})[_0x7fc0('0xf')](function(_0x3dfdc2){logger['info'](_0x7fc0('0x1a'),_0x151e1a);logger[_0x7fc0('0x21')](_0x7fc0('0x1a'),_0x151e1a,JSON[_0x7fc0('0x13')](_0x3dfdc2));_0x460980(_0x3dfdc2);})[_0x7fc0('0x19')](function(_0x153fb3){logger[_0x7fc0('0x14')](_0x7fc0('0x1a'),_0x153fb3[_0x7fc0('0x16')],_0x151e1a);_0x51ac74(_0x14db57['error'](0x1f4,_0x153fb3[_0x7fc0('0x16')]));});});};exports[_0x7fc0('0x22')]=function(_0x371af8){return new Promise(function(_0x1aceea,_0x260cf4){return db[_0x7fc0('0x1b')][_0x7fc0('0x23')]({'where':_0x371af8[_0x7fc0('0x1d')]?_0x371af8[_0x7fc0('0x1d')]['where']||null:null})[_0x7fc0('0xf')](function(_0x55e13c){if(_0x55e13c){return _0x55e13c[_0x7fc0('0x24')](_0x371af8[_0x7fc0('0x1c')][_0x7fc0('0x25')],_[_0x7fc0('0x26')](_0x371af8[_0x7fc0('0x1c')],['ids','id'])||{});}})[_0x7fc0('0x27')](function(_0x41dd32){logger[_0x7fc0('0x17')](_0x7fc0('0x28'),_0x371af8);logger[_0x7fc0('0x21')](_0x7fc0('0x28'),_0x371af8,JSON[_0x7fc0('0x13')](_0x41dd32));_0x1aceea(_0x41dd32);})[_0x7fc0('0x19')](function(_0x1b3614){logger['error'](_0x7fc0('0x28'),_0x1b3614[_0x7fc0('0x16')],_0x371af8);_0x260cf4(_this[_0x7fc0('0x14')](0x1f4,_0x1b3614[_0x7fc0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 4a1a788..6c83e41 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 _0xbce9=['update','emit','removeListener','length','./smsInteraction.events','save','remove'];(function(_0x26181a,_0x17282a){var _0x1c9754=function(_0x2135c6){while(--_0x2135c6){_0x26181a['push'](_0x26181a['shift']());}};_0x1c9754(++_0x17282a);}(_0xbce9,0xe4));var _0x9bce=function(_0x188341,_0x54ba0f){_0x188341=_0x188341-0x0;var _0x2e86cf=_0xbce9[_0x188341];return _0x2e86cf;};'use strict';var SmsInteractionEvents=require(_0x9bce('0x0'));var events=[_0x9bce('0x1'),_0x9bce('0x2'),_0x9bce('0x3')];function createListener(_0x4f0a47,_0x3a2451){return function(_0x4581cf){_0x3a2451[_0x9bce('0x4')](_0x4f0a47,_0x4581cf);};}function removeListener(_0x148dcb,_0x1df872){return function(){SmsInteractionEvents[_0x9bce('0x5')](_0x148dcb,_0x1df872);};}exports['register']=function(_0x52cc2d){for(var _0x2bd15e=0x0,_0x26ffa9=events[_0x9bce('0x6')];_0x2bd15e<_0x26ffa9;_0x2bd15e++){var _0x410113=events[_0x2bd15e];var _0x3ef2c8=createListener('smsInteraction:'+_0x410113,_0x52cc2d);SmsInteractionEvents['on'](_0x410113,_0x3ef2c8);}}; \ No newline at end of file +var _0xba18=['length','smsInteraction:','./smsInteraction.events','save','remove','update','register'];(function(_0x5adb50,_0x2b97b0){var _0x2daeaa=function(_0x440fcb){while(--_0x440fcb){_0x5adb50['push'](_0x5adb50['shift']());}};_0x2daeaa(++_0x2b97b0);}(_0xba18,0x121));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var SmsInteractionEvents=require(_0x8ba1('0x0'));var events=[_0x8ba1('0x1'),_0x8ba1('0x2'),_0x8ba1('0x3')];function createListener(_0x57efd3,_0x4de2b7){return function(_0x21e83f){_0x4de2b7['emit'](_0x57efd3,_0x21e83f);};}function removeListener(_0x3c51d8,_0x3edac6){return function(){SmsInteractionEvents['removeListener'](_0x3c51d8,_0x3edac6);};}exports[_0x8ba1('0x4')]=function(_0x43af24){for(var _0x481219=0x0,_0x2e2646=events[_0x8ba1('0x5')];_0x481219<_0x2e2646;_0x481219++){var _0x5c6b24=events[_0x481219];var _0x23edfa=createListener(_0x8ba1('0x6')+_0x5c6b24,_0x43af24);SmsInteractionEvents['on'](_0x5c6b24,_0x23edfa);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 2d4186c..4d9a2ed 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 _0x2f75=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','/:id','show','tracked','sms','smsmessage:create','post','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x2f75,0x179));var _0x52f7=function(_0x3f14ce,_0x3a9129){_0x3f14ce=_0x3f14ce-0x0;var _0x754c42=_0x2f75[_0x3f14ce];return _0x754c42;};'use strict';var multer=require(_0x52f7('0x0'));var util=require(_0x52f7('0x1'));var path=require(_0x52f7('0x2'));var timeout=require(_0x52f7('0x3'));var express=require(_0x52f7('0x4'));var router=express[_0x52f7('0x5')]();var fs_extra=require(_0x52f7('0x6'));var auth=require(_0x52f7('0x7'));var interaction=require(_0x52f7('0x8'));var config=require(_0x52f7('0x9'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x52f7('0xa')](),controller['index']);router['get'](_0x52f7('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x52f7('0xc'),auth[_0x52f7('0xa')](),controller[_0x52f7('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x52f7('0xe')](_0x52f7('0xf'),_0x52f7('0x10')),controller['create']);router[_0x52f7('0x11')]('/:id/status',controller[_0x52f7('0x12')]);router[_0x52f7('0x13')](_0x52f7('0xc'),auth[_0x52f7('0xa')](),controller[_0x52f7('0x14')]);router[_0x52f7('0x13')](_0x52f7('0x15'),auth[_0x52f7('0xa')](),controller[_0x52f7('0x16')]);router['put']('/:id/reject',auth[_0x52f7('0xa')](),controller[_0x52f7('0x17')]);router[_0x52f7('0x18')](_0x52f7('0xc'),auth[_0x52f7('0xa')](),controller[_0x52f7('0x19')]);module[_0x52f7('0x1a')]=router; \ No newline at end of file +var _0x8e18=['smsmessage:create','create','/:id','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','show','post','tracked','sms'];(function(_0x16c37b,_0x5dbd79){var _0x41322d=function(_0x1f602b){while(--_0x1f602b){_0x16c37b['push'](_0x16c37b['shift']());}};_0x41322d(++_0x5dbd79);}(_0x8e18,0x1ae));var _0x88e1=function(_0x126cc5,_0x1533f9){_0x126cc5=_0x126cc5-0x0;var _0x1c7871=_0x8e18[_0x126cc5];return _0x1c7871;};'use strict';var multer=require(_0x88e1('0x0'));var util=require(_0x88e1('0x1'));var path=require(_0x88e1('0x2'));var timeout=require(_0x88e1('0x3'));var express=require(_0x88e1('0x4'));var router=express['Router']();var fs_extra=require(_0x88e1('0x5'));var auth=require(_0x88e1('0x6'));var interaction=require(_0x88e1('0x7'));var config=require(_0x88e1('0x8'));var controller=require(_0x88e1('0x9'));router[_0x88e1('0xa')]('/',auth['isAuthenticated'](),controller[_0x88e1('0xb')]);router['get'](_0x88e1('0xc'),auth[_0x88e1('0xd')](),controller['describe']);router[_0x88e1('0xa')]('/:id',auth[_0x88e1('0xd')](),controller[_0x88e1('0xe')]);router[_0x88e1('0xf')]('/',auth[_0x88e1('0xd')](),interaction[_0x88e1('0x10')](_0x88e1('0x11'),_0x88e1('0x12')),controller[_0x88e1('0x13')]);router[_0x88e1('0xf')]('/:id/status',controller['status']);router['put'](_0x88e1('0x14'),auth[_0x88e1('0xd')](),controller['update']);router[_0x88e1('0x15')](_0x88e1('0x16'),auth[_0x88e1('0xd')](),controller[_0x88e1('0x17')]);router[_0x88e1('0x15')](_0x88e1('0x18'),auth[_0x88e1('0xd')](),controller[_0x88e1('0x19')]);router[_0x88e1('0x1a')](_0x88e1('0x14'),auth[_0x88e1('0xd')](),controller[_0x88e1('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a1f612b..18d2b3f 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 _0x4e13=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x90f6c2,_0x16cc38){var _0x1bc297=function(_0x3b6497){while(--_0x3b6497){_0x90f6c2['push'](_0x90f6c2['shift']());}};_0x1bc297(++_0x16cc38);}(_0x4e13,0xdf));var _0x34e1=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x4e13[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0x34e1('0x0'));module[_0x34e1('0x1')]={'body':{'type':Sequelize[_0x34e1('0x2')](_0x34e1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x34e1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x34e1('0x5')]('in',_0x34e1('0x6')),'defaultValue':_0x34e1('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x34e1('0x7')](0xbe)},'phone':{'type':Sequelize[_0x34e1('0x7')]},'readAt':{'type':Sequelize[_0x34e1('0x8')]},'secret':{'type':Sequelize[_0x34e1('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x34e1('0x2')]}}; \ No newline at end of file +var _0x8d59=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x8d59,0xb9));var _0x98d5=function(_0x24aa87,_0x30ae7f){_0x24aa87=_0x24aa87-0x0;var _0x10c1e9=_0x8d59[_0x24aa87];return _0x10c1e9;};'use strict';var Sequelize=require(_0x98d5('0x0'));module[_0x98d5('0x1')]={'body':{'type':Sequelize[_0x98d5('0x2')](_0x98d5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x98d5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x98d5('0x5')),'defaultValue':_0x98d5('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x98d5('0x6')]},'readAt':{'type':Sequelize[_0x98d5('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x98d5('0x6')]},'providerResponse':{'type':Sequelize[_0x98d5('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index e08bdcf..2dc6d11 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 _0x6cf5=['DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','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','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','create','update','body','find','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','contact','UserId','User','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','role','rejectMessage','sequelize','Sequelize','QueryTypes','fullname','internal','rejectmessage','SmsAccount','SmsAccountId','debug','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','plivio','infobip','groupName'];(function(_0x4f223b,_0x5891fa){var _0x3ef214=function(_0x188272){while(--_0x188272){_0x4f223b['push'](_0x4f223b['shift']());}};_0x3ef214(++_0x5891fa);}(_0x6cf5,0x1cf));var _0x56cf=function(_0x31d370,_0x8aa847){_0x31d370=_0x31d370-0x0;var _0x2c6e73=_0x6cf5[_0x31d370];return _0x2c6e73;};'use strict';var emlformat=require(_0x56cf('0x0'));var rimraf=require(_0x56cf('0x1'));var zipdir=require(_0x56cf('0x2'));var jsonpatch=require(_0x56cf('0x3'));var rp=require('request-promise');var moment=require(_0x56cf('0x4'));var BPromise=require(_0x56cf('0x5'));var Mustache=require(_0x56cf('0x6'));var util=require(_0x56cf('0x7'));var path=require('path');var sox=require(_0x56cf('0x8'));var csv=require('to-csv');var ejs=require(_0x56cf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56cf('0xa'));var squel=require(_0x56cf('0xb'));var crypto=require('crypto');var jsforce=require(_0x56cf('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x56cf('0xd'));var authService=require(_0x56cf('0xe'));var qs=require(_0x56cf('0xf'));var as=require(_0x56cf('0x10'));var hardwareService=require(_0x56cf('0x11'));var logger=require(_0x56cf('0x12'))('api');var utils=require(_0x56cf('0x13'));var config=require(_0x56cf('0x14'));var licenseUtil=require(_0x56cf('0x15'));var db=require(_0x56cf('0x16'))['db'];config[_0x56cf('0x17')]=_[_0x56cf('0x18')](config[_0x56cf('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x56cf('0x19'))(new Redis(config[_0x56cf('0x17')]));require(_0x56cf('0x1a'))[_0x56cf('0x1b')](socket);var jayson=require(_0x56cf('0x1c'));var client=jayson[_0x56cf('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x56cf('0x1d')][_0x56cf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1b4cb4,_0x2ad2cb,_0x17d979,_0x519e1b){return new BPromise(function(_0x1f4747,_0x3b4951){var _0x123d02=_0x519e1b||client;return _0x123d02[_0x56cf('0x1f')](_0x1b4cb4,_0x17d979)[_0x56cf('0x20')](function(_0x3da10f){logger[_0x56cf('0x21')](_0x56cf('0x22'),_0x2ad2cb,_0x56cf('0x23'));logger['debug'](_0x56cf('0x24'),_0x2ad2cb,_0x56cf('0x23'),JSON[_0x56cf('0x25')](_0x3da10f));if(_0x3da10f[_0x56cf('0x26')]){if(_0x3da10f[_0x56cf('0x26')][_0x56cf('0x27')]===0x1f4){logger[_0x56cf('0x26')](_0x56cf('0x22'),_0x2ad2cb,_0x3da10f[_0x56cf('0x26')][_0x56cf('0x28')]);return _0x3b4951(_0x3da10f[_0x56cf('0x26')][_0x56cf('0x28')]);}logger[_0x56cf('0x26')](_0x56cf('0x22'),_0x2ad2cb,_0x3da10f[_0x56cf('0x26')][_0x56cf('0x28')]);return _0x1f4747(_0x3da10f[_0x56cf('0x26')][_0x56cf('0x28')]);}else{logger[_0x56cf('0x21')](_0x56cf('0x22'),_0x2ad2cb,_0x56cf('0x23'));_0x1f4747(_0x3da10f[_0x56cf('0x29')]['message']);}})[_0x56cf('0x2a')](function(_0x3f3a3b){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2ad2cb,_0x3f3a3b);_0x3b4951(_0x3f3a3b);});});}function respondWithStatusCode(_0x3ca1b3,_0x48d916){_0x48d916=_0x48d916||0xcc;return function(_0x2c2b8a){if(_0x2c2b8a){return _0x3ca1b3[_0x56cf('0x2b')](_0x48d916);}return _0x3ca1b3[_0x56cf('0x2c')](_0x48d916)[_0x56cf('0x2d')]();};}function respondWithResult(_0xaf5fc1,_0xe2c4b7){_0xe2c4b7=_0xe2c4b7||0xc8;return function(_0x586517){if(_0x586517){return _0xaf5fc1['status'](_0xe2c4b7)[_0x56cf('0x2e')](_0x586517);}};}function respondWithFilteredResult(_0x43bd89,_0x464d4c){return function(_0x273811){if(_0x273811){var _0x321f1e=typeof _0x464d4c[_0x56cf('0x2f')]===_0x56cf('0x30')&&typeof _0x464d4c[_0x56cf('0x31')]===_0x56cf('0x30');var _0x48dc4d=_0x273811[_0x56cf('0x32')];var _0x2dc619=_0x321f1e?0x0:_0x464d4c[_0x56cf('0x2f')];var _0xa4ea65=_0x321f1e?_0x273811[_0x56cf('0x32')]:_0x464d4c[_0x56cf('0x2f')]+_0x464d4c[_0x56cf('0x31')];var _0x583bca;if(_0xa4ea65>=_0x48dc4d){_0xa4ea65=_0x48dc4d;_0x583bca=0xc8;}else{_0x583bca=0xce;}_0x43bd89[_0x56cf('0x2c')](_0x583bca);return _0x43bd89[_0x56cf('0x33')](_0x56cf('0x34'),_0x2dc619+'-'+_0xa4ea65+'/'+_0x48dc4d)[_0x56cf('0x2e')](_0x273811);}return null;};}function patchUpdates(_0xab4817){return function(_0x582613){try{jsonpatch[_0x56cf('0x35')](_0x582613,_0xab4817,!![]);}catch(_0x27f1bf){return BPromise[_0x56cf('0x36')](_0x27f1bf);}return _0x582613[_0x56cf('0x37')]();};}function saveUpdates(_0x2aba2b,_0x1e1c0a){return function(_0x24f929){if(_0x24f929){return _0x24f929['update'](_0x2aba2b)[_0x56cf('0x20')](function(_0x857199){return _0x857199;});}return null;};}function removeEntity(_0x10be9d,_0xc515aa){return function(_0x57d628){if(_0x57d628){return _0x57d628[_0x56cf('0x38')]()[_0x56cf('0x20')](function(){_0x10be9d[_0x56cf('0x2c')](0xcc)[_0x56cf('0x2d')]();});}};}function handleEntityNotFound(_0x5dad4f,_0x32287f){return function(_0x44ac62){if(!_0x44ac62){_0x5dad4f['sendStatus'](0x194);}return _0x44ac62;};}function handleError(_0x3c44f7,_0x1383d6){_0x1383d6=_0x1383d6||0x1f4;return function(_0x2e118e){logger[_0x56cf('0x26')](_0x2e118e[_0x56cf('0x39')]);if(_0x2e118e[_0x56cf('0x3a')]){delete _0x2e118e[_0x56cf('0x3a')];}_0x3c44f7[_0x56cf('0x2c')](_0x1383d6)[_0x56cf('0x3b')](_0x2e118e);};}exports[_0x56cf('0x3c')]=function(_0x390193,_0x1a2a96){var _0x5e98b6={},_0x46ebc5={},_0x984697={'count':0x0,'rows':[]};var _0x267e37=_[_0x56cf('0x3d')](db[_0x56cf('0x3e')][_0x56cf('0x3f')],function(_0xd16c7f){return{'name':_0xd16c7f[_0x56cf('0x40')],'type':_0xd16c7f[_0x56cf('0x41')][_0x56cf('0x42')]};});_0x46ebc5[_0x56cf('0x43')]=_['map'](_0x267e37,_0x56cf('0x3a'));_0x46ebc5[_0x56cf('0x44')]=_[_0x56cf('0x45')](_0x390193[_0x56cf('0x44')]);_0x46ebc5[_0x56cf('0x46')]=_[_0x56cf('0x47')](_0x46ebc5[_0x56cf('0x43')],_0x46ebc5[_0x56cf('0x44')]);_0x5e98b6[_0x56cf('0x48')]=_[_0x56cf('0x47')](_0x46ebc5[_0x56cf('0x43')],qs[_0x56cf('0x49')](_0x390193['query'][_0x56cf('0x49')]));_0x5e98b6['attributes']=_0x5e98b6[_0x56cf('0x48')][_0x56cf('0x4a')]?_0x5e98b6[_0x56cf('0x48')]:_0x46ebc5[_0x56cf('0x43')];if(!_0x390193[_0x56cf('0x44')][_0x56cf('0x4b')](_0x56cf('0x4c'))){_0x5e98b6[_0x56cf('0x31')]=qs[_0x56cf('0x31')](_0x390193['query']['limit']);_0x5e98b6[_0x56cf('0x2f')]=qs['offset'](_0x390193[_0x56cf('0x44')][_0x56cf('0x2f')]);}_0x5e98b6[_0x56cf('0x4d')]=qs[_0x56cf('0x4e')](_0x390193[_0x56cf('0x44')][_0x56cf('0x4e')]);_0x5e98b6['where']=qs[_0x56cf('0x46')](_[_0x56cf('0x4f')](_0x390193[_0x56cf('0x44')],_0x46ebc5[_0x56cf('0x46')]),_0x267e37);if(_0x390193[_0x56cf('0x44')][_0x56cf('0x50')]){_0x5e98b6[_0x56cf('0x51')]=_[_0x56cf('0x52')](_0x5e98b6[_0x56cf('0x51')],{'$or':_[_0x56cf('0x3d')](_0x267e37,function(_0x3673f9){if(_0x3673f9[_0x56cf('0x41')]!==_0x56cf('0x53')){var _0x3d7e54={};_0x3d7e54[_0x3673f9[_0x56cf('0x3a')]]={'$like':'%'+_0x390193[_0x56cf('0x44')]['filter']+'%'};return _0x3d7e54;}})});}_0x5e98b6=_[_0x56cf('0x52')]({},_0x5e98b6,_0x390193[_0x56cf('0x54')]);var _0x3f8fb3={'where':_0x5e98b6[_0x56cf('0x51')]};return db['SmsMessage'][_0x56cf('0x32')](_0x3f8fb3)[_0x56cf('0x20')](function(_0x27a6c0){_0x984697[_0x56cf('0x32')]=_0x27a6c0;if(_0x390193['query'][_0x56cf('0x55')]){_0x5e98b6['include']=[{'all':!![]}];}return db[_0x56cf('0x3e')][_0x56cf('0x56')](_0x5e98b6);})[_0x56cf('0x20')](function(_0x5db14f){_0x984697[_0x56cf('0x57')]=_0x5db14f;return _0x984697;})[_0x56cf('0x20')](respondWithFilteredResult(_0x1a2a96,_0x5e98b6))[_0x56cf('0x2a')](handleError(_0x1a2a96,null));};exports[_0x56cf('0x58')]=function(_0x116900,_0x3522be){var _0x308d7a={'raw':!![],'where':{'id':_0x116900['params']['id']}},_0x55dfee={};_0x55dfee[_0x56cf('0x43')]=_[_0x56cf('0x45')](db[_0x56cf('0x3e')][_0x56cf('0x3f')]);_0x55dfee[_0x56cf('0x44')]=_[_0x56cf('0x45')](_0x116900['query']);_0x55dfee['filters']=_['intersection'](_0x55dfee['model'],_0x55dfee[_0x56cf('0x44')]);_0x308d7a[_0x56cf('0x48')]=_['intersection'](_0x55dfee[_0x56cf('0x43')],qs[_0x56cf('0x49')](_0x116900['query']['fields']));_0x308d7a[_0x56cf('0x48')]=_0x308d7a[_0x56cf('0x48')]['length']?_0x308d7a[_0x56cf('0x48')]:_0x55dfee[_0x56cf('0x43')];if(_0x116900[_0x56cf('0x44')]['includeAll']){_0x308d7a['include']=[{'all':!![]}];}_0x308d7a=_[_0x56cf('0x52')]({},_0x308d7a,_0x116900[_0x56cf('0x54')]);return db[_0x56cf('0x3e')]['find'](_0x308d7a)['then'](handleEntityNotFound(_0x3522be,null))[_0x56cf('0x20')](respondWithResult(_0x3522be,null))[_0x56cf('0x2a')](handleError(_0x3522be,null));};exports[_0x56cf('0x59')]=function(_0x24b754,_0x147662){return db[_0x56cf('0x3e')][_0x56cf('0x59')](_0x24b754['body'],{})['then'](respondWithResult(_0x147662,0xc9))['catch'](handleError(_0x147662,null));};exports[_0x56cf('0x5a')]=function(_0x5d0048,_0x2d518e){if(_0x5d0048[_0x56cf('0x5b')]['id']){delete _0x5d0048['body']['id'];}return db[_0x56cf('0x3e')][_0x56cf('0x5c')]({'where':{'id':_0x5d0048[_0x56cf('0x5d')]['id']}})[_0x56cf('0x20')](handleEntityNotFound(_0x2d518e,null))[_0x56cf('0x20')](saveUpdates(_0x5d0048[_0x56cf('0x5b')],null))[_0x56cf('0x20')](respondWithResult(_0x2d518e,null))[_0x56cf('0x2a')](handleError(_0x2d518e,null));};exports[_0x56cf('0x38')]=function(_0x318418,_0x3e0bc3){return db[_0x56cf('0x3e')][_0x56cf('0x5c')]({'where':{'id':_0x318418[_0x56cf('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3e0bc3,null))[_0x56cf('0x20')](removeEntity(_0x3e0bc3,null))[_0x56cf('0x2a')](handleError(_0x3e0bc3,null));};exports['describe']=function(_0x34c5d3,_0x337316){return db[_0x56cf('0x3e')][_0x56cf('0x5e')]()[_0x56cf('0x20')](respondWithResult(_0x337316,null))[_0x56cf('0x2a')](handleError(_0x337316,null));};var interaction_log=require(_0x56cf('0x12'))(_0x56cf('0x5f'));exports[_0x56cf('0x60')]=function(_0x283549,_0x3d9836,_0x8ddb43){var _0x5c328d={'agent':{},'channel':_0x56cf('0x61')};if(_0x283549[_0x56cf('0x5b')]['id']){delete _0x283549[_0x56cf('0x5b')]['id'];}_0x283549[_0x56cf('0x5b')][_0x56cf('0x62')]=!![];_0x283549['body'][_0x56cf('0x63')]=moment()[_0x56cf('0x64')](_0x56cf('0x65'));_0x283549[_0x56cf('0x5b')]['UserId']=_0x283549[_0x56cf('0x5b')]['UserId']||_0x283549[_0x56cf('0x66')]['id'];_0x5c328d[_0x56cf('0x67')]['id']=_0x283549['body']['UserId'];return db[_0x56cf('0x3e')][_0x56cf('0x5c')]({'where':{'id':_0x283549[_0x56cf('0x5d')]['id'],'UserId':null}})[_0x56cf('0x20')](handleEntityNotFound(_0x3d9836,null))[_0x56cf('0x20')](saveUpdates(_0x283549[_0x56cf('0x5b')],null))[_0x56cf('0x20')](function(_0x466a0d){if(_0x466a0d){_0x5c328d['message']=_0x466a0d[_0x56cf('0x68')]({'plain':!![]});return db[_0x56cf('0x69')][_0x56cf('0x5c')]({'where':{'id':_0x466a0d[_0x56cf('0x6a')]}});}return null;})[_0x56cf('0x20')](handleEntityNotFound(_0x3d9836,null))[_0x56cf('0x20')](function(_0x54f115){if(_0x54f115){return _0x54f115[_0x56cf('0x5a')]({'UserId':_0x283549[_0x56cf('0x5b')]['UserId'],'read1stAt':_[_0x56cf('0x6b')](_0x54f115[_0x56cf('0x6c')])?moment()[_0x56cf('0x64')](_0x56cf('0x65')):undefined});}return null;})[_0x56cf('0x20')](function(_0x199a1c){if(_0x199a1c){_0x5c328d[_0x56cf('0x6d')]=_0x199a1c[_0x56cf('0x68')]({'plain':!![]});interaction_log[_0x56cf('0x21')](_0x56cf('0x6e'),_0x283549[_0x56cf('0x66')]['id'],_0x283549[_0x56cf('0x66')][_0x56cf('0x3a')],_0x283549[_0x56cf('0x66')]['role'],_0x5c328d[_0x56cf('0x6d')]['id'],_0x283549[_0x56cf('0x5b')]?JSON[_0x56cf('0x25')](_0x283549[_0x56cf('0x5b')]):_0x56cf('0x6f'));return respondWithRpcPromise(_0x56cf('0x70'),_0x56cf('0x71'),_0x5c328d);}return null;})[_0x56cf('0x20')](function(_0x8c6897){var _0x3a1a36=_0x56cf('0x72')+_0x8c6897[_0x56cf('0x28')][_0x56cf('0x73')];return db['sequelize'][_0x56cf('0x44')](_0x3a1a36,{'type':db['Sequelize']['QueryTypes'][_0x56cf('0x74')],'raw':!![]})['then'](function(_0x76fb3b){return _0x76fb3b;});})[_0x56cf('0x20')](function(_0xce3baf){if(_0xce3baf){_0x5c328d[_0x56cf('0x28')][_0x56cf('0x75')]=_0xce3baf[0x0];if(!_0x283549['body'][_0x56cf('0x76')])return;return db[_0x56cf('0x77')][_0x56cf('0x5c')]({'where':{'id':_0x283549['body'][_0x56cf('0x76')],'role':_0x56cf('0x67')},'attributes':['id','name','fullname',_0x56cf('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x13cd83){if(!_0x13cd83)return null;_0x5c328d[_0x56cf('0x28')]['agent']=_0x13cd83;return _0x5c328d;})[_0x56cf('0x20')](function(_0x13c48b){if(_0x13c48b){if(_0x283549['body'][_0x56cf('0x79')]){_0x5c328d[_0x56cf('0x28')][_0x56cf('0x7a')]=util[_0x56cf('0x64')](_0x56cf('0x7b'),_0x283549['user'][_0x56cf('0x3a')]);_0x5c328d[_0x56cf('0x28')]['channel']=_0x5c328d[_0x56cf('0x7c')];_0x5c328d['message'][_0x56cf('0x7d')]=_0x5c328d[_0x56cf('0x7c')];_0x5c328d['message'][_0x56cf('0x7e')]=_0x56cf('0x60');return respondWithRpcPromise('EventManager',_0x56cf('0x7f'),{'event':_0x56cf('0x80'),'message':_0x5c328d[_0x56cf('0x28')]},client9002)[_0x56cf('0x20')](function(){return _0x5c328d;});}return _0x5c328d;}return null;})[_0x56cf('0x20')](respondWithResult(_0x3d9836,null))[_0x56cf('0x2a')](handleError(_0x3d9836,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x56cf('0x36')]=function(_0x2128ca,_0x316d39,_0x5281fa){var _0x344551={'agent':{},'channel':_0x56cf('0x61')};if(_0x2128ca['body']['id']){delete _0x2128ca[_0x56cf('0x5b')]['id'];}_0x2128ca[_0x56cf('0x5b')][_0x56cf('0x76')]=_0x2128ca['body'][_0x56cf('0x76')]||_0x2128ca[_0x56cf('0x66')]['id'];_0x344551[_0x56cf('0x67')]['id']=_0x2128ca[_0x56cf('0x5b')][_0x56cf('0x76')];return db['SmsMessage'][_0x56cf('0x5c')]({'where':{'id':_0x2128ca[_0x56cf('0x5d')]['id'],'UserId':null}})[_0x56cf('0x20')](handleEntityNotFound(_0x316d39,null))[_0x56cf('0x20')](function(_0x950fee){if(_0x950fee){_0x344551[_0x56cf('0x28')]=_0x950fee[_0x56cf('0x68')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x950fee[_0x56cf('0x6a')]}});}return null;})[_0x56cf('0x20')](handleEntityNotFound(_0x316d39,null))[_0x56cf('0x20')](function(_0x2d8697){if(_0x2d8697){_0x344551[_0x56cf('0x6d')]=_0x2d8697['get']({'plain':!![]});interaction_log[_0x56cf('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2128ca[_0x56cf('0x66')]['id'],_0x2128ca['user'][_0x56cf('0x3a')],_0x2128ca[_0x56cf('0x66')][_0x56cf('0x81')],_0x344551[_0x56cf('0x6d')]['id'],_0x2128ca[_0x56cf('0x5b')]?JSON[_0x56cf('0x25')](_0x2128ca[_0x56cf('0x5b')]):_0x56cf('0x6f'));return respondWithRpcPromise('RejectMessage',_0x56cf('0x82'),_0x344551);}return null;})[_0x56cf('0x20')](function(_0x54356f){var _0xe94d76='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54356f[_0x56cf('0x28')][_0x56cf('0x73')];return db[_0x56cf('0x83')][_0x56cf('0x44')](_0xe94d76,{'type':db[_0x56cf('0x84')][_0x56cf('0x85')]['SELECT'],'raw':!![]})[_0x56cf('0x20')](function(_0x410deb){return _0x410deb;});})[_0x56cf('0x20')](function(_0x56da55){if(_0x56da55){_0x344551['message'][_0x56cf('0x75')]=_0x56da55[0x0];if(!_0x2128ca[_0x56cf('0x5b')][_0x56cf('0x76')])return;return db['User'][_0x56cf('0x5c')]({'where':{'id':_0x2128ca[_0x56cf('0x5b')][_0x56cf('0x76')],'role':'agent'},'attributes':['id',_0x56cf('0x3a'),_0x56cf('0x86'),_0x56cf('0x78'),_0x56cf('0x87')],'raw':!![]});}return null;})[_0x56cf('0x20')](function(_0x38556f){if(!_0x38556f)return null;_0x344551[_0x56cf('0x28')][_0x56cf('0x67')]=_0x38556f;return _0x344551;})['then'](function(_0x546461){if(_0x546461){_0x546461[_0x56cf('0x28')]['interface']=util[_0x56cf('0x64')](_0x56cf('0x7b'),_0x2128ca[_0x56cf('0x66')][_0x56cf('0x3a')]);_0x546461[_0x56cf('0x28')][_0x56cf('0x7c')]=_0x344551[_0x56cf('0x7c')];_0x546461[_0x56cf('0x28')][_0x56cf('0x7d')]=_0x344551['channel'];_0x546461[_0x56cf('0x28')][_0x56cf('0x7e')]='reject';respondWithRpcPromise('EventManager',_0x56cf('0x7f'),{'event':_0x56cf('0x88'),'message':_0x546461[_0x56cf('0x28')]},client9002);return _0x344551;}return null;})[_0x56cf('0x20')](respondWithResult(_0x316d39,null))['catch'](handleError(_0x316d39,null));};exports[_0x56cf('0x2c')]=function(_0xa7783b,_0xe213c6,_0x4fd1bc){if(_0xa7783b[_0x56cf('0x5b')]['id']){delete _0xa7783b['body']['id'];}var _0x31ad4b;return db[_0x56cf('0x3e')][_0x56cf('0x5c')]({'where':{'id':_0xa7783b[_0x56cf('0x5d')]['id']}})['then'](handleEntityNotFound(_0xe213c6,null))[_0x56cf('0x20')](function(_0x3f5786){if(_0x3f5786){_0x31ad4b=_0x3f5786;return db[_0x56cf('0x89')]['find']({'where':{'id':_0x3f5786[_0x56cf('0x8a')]}});}})[_0x56cf('0x20')](handleEntityNotFound(_0xe213c6,null))['then'](function(_0x1a8e4d){if(_0x1a8e4d){logger[_0x56cf('0x8b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x56cf('0x2c'),'received\x20delivery\x20report\x20from',_0x1a8e4d['type'],util[_0x56cf('0x8c')](_0xa7783b[_0x56cf('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1a8e4d[_0x56cf('0x41')]){case _0x56cf('0x8d'):if(_0xa7783b[_0x56cf('0x5b')][_0x56cf('0x8e')]&&_0xa7783b[_0x56cf('0x5b')][_0x56cf('0x8e')]===_0x31ad4b[_0x56cf('0x8f')]){return _0x31ad4b[_0x56cf('0x5a')]({'read':!![]});}else{logger[_0x56cf('0x26')](_0x56cf('0x90'),_0x56cf('0x2c'),_0x56cf('0x8d'),util['inspect'](_0xa7783b['body'],{'showHidden':![],'depth':null}));}break;case _0x56cf('0x91'):if(_0xa7783b['body'][_0x56cf('0x92')]&&_0xa7783b[_0x56cf('0x5b')][_0x56cf('0x92')]===_0x31ad4b[_0x56cf('0x8f')]&&_['indexOf']([_0x56cf('0x93'),_0x56cf('0x94')],_0xa7783b[_0x56cf('0x5b')][_0x56cf('0x95')])>=0x0){return _0x31ad4b[_0x56cf('0x5a')]({'read':!![]});}else{logger['error'](_0x56cf('0x90'),_0x56cf('0x2c'),_0x56cf('0x96'),util[_0x56cf('0x8c')](_0xa7783b[_0x56cf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x56cf('0x97'):var _0x12705a=_0xa7783b[_0x56cf('0x5b')]['results'][0x0];if(_0x12705a[_0x56cf('0x2c')][_0x56cf('0x98')]===_0x56cf('0x99')){return _0x31ad4b['update']({'read':!![]});}else{logger[_0x56cf('0x26')](_0x56cf('0x90'),'status',_0x56cf('0x97'),util['inspect'](_0xa7783b[_0x56cf('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x31ad4b;}})['then'](respondWithResult(_0xe213c6,null))[_0x56cf('0x2a')](handleError(_0xe213c6,null));}; \ No newline at end of file +var _0x30cb=['readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteractionId','isNil','interaction','get','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','agent','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','then','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsMessage','count','include','findAll','rows','find','create','body','update','destroy','params','describe','accept','sms','read'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x30cb,0x1f1));var _0xb30c=function(_0x3ad98b,_0x488fc6){_0x3ad98b=_0x3ad98b-0x0;var _0xc5f7a1=_0x30cb[_0x3ad98b];return _0xc5f7a1;};'use strict';var emlformat=require(_0xb30c('0x0'));var rimraf=require(_0xb30c('0x1'));var zipdir=require(_0xb30c('0x2'));var jsonpatch=require(_0xb30c('0x3'));var rp=require(_0xb30c('0x4'));var moment=require('moment');var BPromise=require(_0xb30c('0x5'));var Mustache=require(_0xb30c('0x6'));var util=require(_0xb30c('0x7'));var path=require('path');var sox=require(_0xb30c('0x8'));var csv=require(_0xb30c('0x9'));var ejs=require(_0xb30c('0xa'));var fs=require('fs');var fs_extra=require(_0xb30c('0xb'));var _=require(_0xb30c('0xc'));var squel=require(_0xb30c('0xd'));var crypto=require(_0xb30c('0xe'));var jsforce=require(_0xb30c('0xf'));var deskjs=require(_0xb30c('0x10'));var toCsv=require(_0xb30c('0x9'));var querystring=require(_0xb30c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb30c('0x12'));var hardwareService=require(_0xb30c('0x13'));var logger=require(_0xb30c('0x14'))(_0xb30c('0x15'));var utils=require(_0xb30c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb30c('0x17'));var db=require(_0xb30c('0x18'))['db'];config['redis']=_['defaults'](config[_0xb30c('0x19')],{'host':_0xb30c('0x1a'),'port':0x18eb});var socket=require(_0xb30c('0x1b'))(new Redis(config[_0xb30c('0x19')]));require(_0xb30c('0x1c'))[_0xb30c('0x1d')](socket);var jayson=require(_0xb30c('0x1e'));var client=jayson[_0xb30c('0x1f')][_0xb30c('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36d52d,_0x2f7175,_0x20f14e,_0x4ebac2){return new BPromise(function(_0x39ec68,_0x4a4169){var _0x548d25=_0x4ebac2||client;return _0x548d25[_0xb30c('0x21')](_0x36d52d,_0x20f14e)['then'](function(_0xfb88f5){logger[_0xb30c('0x22')]('SmsMessage,\x20%s,\x20%s',_0x2f7175,_0xb30c('0x23'));logger[_0xb30c('0x24')](_0xb30c('0x25'),_0x2f7175,_0xb30c('0x23'),JSON[_0xb30c('0x26')](_0xfb88f5));if(_0xfb88f5[_0xb30c('0x27')]){if(_0xfb88f5[_0xb30c('0x27')]['code']===0x1f4){logger[_0xb30c('0x27')](_0xb30c('0x28'),_0x2f7175,_0xfb88f5[_0xb30c('0x27')][_0xb30c('0x29')]);return _0x4a4169(_0xfb88f5[_0xb30c('0x27')][_0xb30c('0x29')]);}logger[_0xb30c('0x27')]('SmsMessage,\x20%s,\x20%s',_0x2f7175,_0xfb88f5[_0xb30c('0x27')]['message']);return _0x39ec68(_0xfb88f5[_0xb30c('0x27')]['message']);}else{logger[_0xb30c('0x22')]('SmsMessage,\x20%s,\x20%s',_0x2f7175,_0xb30c('0x23'));_0x39ec68(_0xfb88f5[_0xb30c('0x2a')]['message']);}})[_0xb30c('0x2b')](function(_0x307187){logger[_0xb30c('0x27')]('SmsMessage,\x20%s,\x20%s',_0x2f7175,_0x307187);_0x4a4169(_0x307187);});});}function respondWithStatusCode(_0xc73a61,_0x2a14af){_0x2a14af=_0x2a14af||0xcc;return function(_0x4c9d0b){if(_0x4c9d0b){return _0xc73a61[_0xb30c('0x2c')](_0x2a14af);}return _0xc73a61['status'](_0x2a14af)[_0xb30c('0x2d')]();};}function respondWithResult(_0x404e01,_0x3cfeab){_0x3cfeab=_0x3cfeab||0xc8;return function(_0x306c89){if(_0x306c89){return _0x404e01['status'](_0x3cfeab)[_0xb30c('0x2e')](_0x306c89);}};}function respondWithFilteredResult(_0x464667,_0xcb1e7b){return function(_0x588d94){if(_0x588d94){var _0x475407=typeof _0xcb1e7b[_0xb30c('0x2f')]==='undefined'&&typeof _0xcb1e7b['limit']==='undefined';var _0x179389=_0x588d94['count'];var _0x5b9fad=_0x475407?0x0:_0xcb1e7b[_0xb30c('0x2f')];var _0x23f6bc=_0x475407?_0x588d94['count']:_0xcb1e7b['offset']+_0xcb1e7b[_0xb30c('0x30')];var _0x27140b;if(_0x23f6bc>=_0x179389){_0x23f6bc=_0x179389;_0x27140b=0xc8;}else{_0x27140b=0xce;}_0x464667[_0xb30c('0x31')](_0x27140b);return _0x464667[_0xb30c('0x32')](_0xb30c('0x33'),_0x5b9fad+'-'+_0x23f6bc+'/'+_0x179389)[_0xb30c('0x2e')](_0x588d94);}return null;};}function patchUpdates(_0x3545ff){return function(_0x72ef37){try{jsonpatch[_0xb30c('0x34')](_0x72ef37,_0x3545ff,!![]);}catch(_0x3c92f4){return BPromise[_0xb30c('0x35')](_0x3c92f4);}return _0x72ef37['save']();};}function saveUpdates(_0x7ff49f,_0x4591be){return function(_0x460760){if(_0x460760){return _0x460760['update'](_0x7ff49f)[_0xb30c('0x36')](function(_0x183512){return _0x183512;});}return null;};}function removeEntity(_0x4518f2,_0x4981fe){return function(_0x564569){if(_0x564569){return _0x564569['destroy']()[_0xb30c('0x36')](function(){_0x4518f2['status'](0xcc)[_0xb30c('0x2d')]();});}};}function handleEntityNotFound(_0x5a6f3f,_0x35abee){return function(_0x1e6f24){if(!_0x1e6f24){_0x5a6f3f['sendStatus'](0x194);}return _0x1e6f24;};}function handleError(_0x1abd2e,_0x1b402d){_0x1b402d=_0x1b402d||0x1f4;return function(_0x2f4fc8){logger['error'](_0x2f4fc8[_0xb30c('0x37')]);if(_0x2f4fc8[_0xb30c('0x38')]){delete _0x2f4fc8[_0xb30c('0x38')];}_0x1abd2e['status'](_0x1b402d)['send'](_0x2f4fc8);};}exports[_0xb30c('0x39')]=function(_0x35e366,_0x40ebea){var _0x232241={},_0x3e9e85={},_0x4e0f78={'count':0x0,'rows':[]};var _0x243780=_[_0xb30c('0x3a')](db['SmsMessage'][_0xb30c('0x3b')],function(_0x5b31bc){return{'name':_0x5b31bc[_0xb30c('0x3c')],'type':_0x5b31bc['type'][_0xb30c('0x3d')]};});_0x3e9e85[_0xb30c('0x3e')]=_[_0xb30c('0x3a')](_0x243780,'name');_0x3e9e85[_0xb30c('0x3f')]=_[_0xb30c('0x40')](_0x35e366[_0xb30c('0x3f')]);_0x3e9e85[_0xb30c('0x41')]=_[_0xb30c('0x42')](_0x3e9e85[_0xb30c('0x3e')],_0x3e9e85[_0xb30c('0x3f')]);_0x232241[_0xb30c('0x43')]=_[_0xb30c('0x42')](_0x3e9e85[_0xb30c('0x3e')],qs['fields'](_0x35e366[_0xb30c('0x3f')][_0xb30c('0x44')]));_0x232241['attributes']=_0x232241[_0xb30c('0x43')][_0xb30c('0x45')]?_0x232241[_0xb30c('0x43')]:_0x3e9e85[_0xb30c('0x3e')];if(!_0x35e366[_0xb30c('0x3f')][_0xb30c('0x46')]('nolimit')){_0x232241[_0xb30c('0x30')]=qs['limit'](_0x35e366[_0xb30c('0x3f')][_0xb30c('0x30')]);_0x232241[_0xb30c('0x2f')]=qs['offset'](_0x35e366['query']['offset']);}_0x232241[_0xb30c('0x47')]=qs['sort'](_0x35e366[_0xb30c('0x3f')][_0xb30c('0x48')]);_0x232241[_0xb30c('0x49')]=qs['filters'](_[_0xb30c('0x4a')](_0x35e366[_0xb30c('0x3f')],_0x3e9e85['filters']),_0x243780);if(_0x35e366[_0xb30c('0x3f')][_0xb30c('0x4b')]){_0x232241[_0xb30c('0x49')]=_[_0xb30c('0x4c')](_0x232241[_0xb30c('0x49')],{'$or':_['map'](_0x243780,function(_0x16b611){if(_0x16b611[_0xb30c('0x4d')]!==_0xb30c('0x4e')){var _0x201bf5={};_0x201bf5[_0x16b611[_0xb30c('0x38')]]={'$like':'%'+_0x35e366[_0xb30c('0x3f')][_0xb30c('0x4b')]+'%'};return _0x201bf5;}})});}_0x232241=_[_0xb30c('0x4c')]({},_0x232241,_0x35e366[_0xb30c('0x4f')]);var _0x101bd5={'where':_0x232241[_0xb30c('0x49')]};return db[_0xb30c('0x50')][_0xb30c('0x51')](_0x101bd5)[_0xb30c('0x36')](function(_0x38f5a){_0x4e0f78['count']=_0x38f5a;if(_0x35e366[_0xb30c('0x3f')]['includeAll']){_0x232241[_0xb30c('0x52')]=[{'all':!![]}];}return db[_0xb30c('0x50')][_0xb30c('0x53')](_0x232241);})['then'](function(_0x3e27ba){_0x4e0f78[_0xb30c('0x54')]=_0x3e27ba;return _0x4e0f78;})[_0xb30c('0x36')](respondWithFilteredResult(_0x40ebea,_0x232241))['catch'](handleError(_0x40ebea,null));};exports['show']=function(_0x3f16ef,_0x3bfbfc){var _0x3153c2={'raw':!![],'where':{'id':_0x3f16ef['params']['id']}},_0x4b7eed={};_0x4b7eed['model']=_['keys'](db[_0xb30c('0x50')]['rawAttributes']);_0x4b7eed['query']=_['keys'](_0x3f16ef['query']);_0x4b7eed[_0xb30c('0x41')]=_[_0xb30c('0x42')](_0x4b7eed['model'],_0x4b7eed[_0xb30c('0x3f')]);_0x3153c2[_0xb30c('0x43')]=_[_0xb30c('0x42')](_0x4b7eed[_0xb30c('0x3e')],qs[_0xb30c('0x44')](_0x3f16ef[_0xb30c('0x3f')][_0xb30c('0x44')]));_0x3153c2[_0xb30c('0x43')]=_0x3153c2[_0xb30c('0x43')]['length']?_0x3153c2[_0xb30c('0x43')]:_0x4b7eed[_0xb30c('0x3e')];if(_0x3f16ef['query']['includeAll']){_0x3153c2[_0xb30c('0x52')]=[{'all':!![]}];}_0x3153c2=_[_0xb30c('0x4c')]({},_0x3153c2,_0x3f16ef['options']);return db['SmsMessage'][_0xb30c('0x55')](_0x3153c2)[_0xb30c('0x36')](handleEntityNotFound(_0x3bfbfc,null))['then'](respondWithResult(_0x3bfbfc,null))[_0xb30c('0x2b')](handleError(_0x3bfbfc,null));};exports['create']=function(_0xefaccc,_0x2c2f40){return db['SmsMessage'][_0xb30c('0x56')](_0xefaccc[_0xb30c('0x57')],{})['then'](respondWithResult(_0x2c2f40,0xc9))[_0xb30c('0x2b')](handleError(_0x2c2f40,null));};exports[_0xb30c('0x58')]=function(_0x341ae0,_0x47bd37){if(_0x341ae0[_0xb30c('0x57')]['id']){delete _0x341ae0[_0xb30c('0x57')]['id'];}return db[_0xb30c('0x50')][_0xb30c('0x55')]({'where':{'id':_0x341ae0['params']['id']}})[_0xb30c('0x36')](handleEntityNotFound(_0x47bd37,null))[_0xb30c('0x36')](saveUpdates(_0x341ae0['body'],null))[_0xb30c('0x36')](respondWithResult(_0x47bd37,null))['catch'](handleError(_0x47bd37,null));};exports[_0xb30c('0x59')]=function(_0x87eb59,_0x2d042e){return db[_0xb30c('0x50')][_0xb30c('0x55')]({'where':{'id':_0x87eb59[_0xb30c('0x5a')]['id']}})[_0xb30c('0x36')](handleEntityNotFound(_0x2d042e,null))[_0xb30c('0x36')](removeEntity(_0x2d042e,null))[_0xb30c('0x2b')](handleError(_0x2d042e,null));};exports[_0xb30c('0x5b')]=function(_0x2393a6,_0x4a0f2a){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x4a0f2a,null))[_0xb30c('0x2b')](handleError(_0x4a0f2a,null));};var interaction_log=require(_0xb30c('0x14'))('sms-interactions');exports[_0xb30c('0x5c')]=function(_0x7e8e40,_0x588f3e,_0x48470d){var _0x317083={'agent':{},'channel':_0xb30c('0x5d')};if(_0x7e8e40[_0xb30c('0x57')]['id']){delete _0x7e8e40[_0xb30c('0x57')]['id'];}_0x7e8e40['body'][_0xb30c('0x5e')]=!![];_0x7e8e40[_0xb30c('0x57')][_0xb30c('0x5f')]=moment()[_0xb30c('0x60')](_0xb30c('0x61'));_0x7e8e40[_0xb30c('0x57')][_0xb30c('0x62')]=_0x7e8e40[_0xb30c('0x57')]['UserId']||_0x7e8e40['user']['id'];_0x317083['agent']['id']=_0x7e8e40['body'][_0xb30c('0x62')];return db[_0xb30c('0x50')][_0xb30c('0x55')]({'where':{'id':_0x7e8e40[_0xb30c('0x5a')]['id'],'UserId':null}})[_0xb30c('0x36')](handleEntityNotFound(_0x588f3e,null))['then'](saveUpdates(_0x7e8e40[_0xb30c('0x57')],null))['then'](function(_0x1aa667){if(_0x1aa667){_0x317083[_0xb30c('0x29')]=_0x1aa667['get']({'plain':!![]});return db['SmsInteraction'][_0xb30c('0x55')]({'where':{'id':_0x1aa667[_0xb30c('0x63')]}});}return null;})[_0xb30c('0x36')](handleEntityNotFound(_0x588f3e,null))['then'](function(_0x38bd3c){if(_0x38bd3c){return _0x38bd3c[_0xb30c('0x58')]({'UserId':_0x7e8e40[_0xb30c('0x57')][_0xb30c('0x62')],'read1stAt':_[_0xb30c('0x64')](_0x38bd3c['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb30c('0x36')](function(_0x1d23b0){if(_0x1d23b0){_0x317083[_0xb30c('0x65')]=_0x1d23b0[_0xb30c('0x66')]({'plain':!![]});interaction_log[_0xb30c('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x7e8e40[_0xb30c('0x67')]['id'],_0x7e8e40[_0xb30c('0x67')][_0xb30c('0x38')],_0x7e8e40[_0xb30c('0x67')][_0xb30c('0x68')],_0x317083[_0xb30c('0x65')]['id'],_0x7e8e40['body']?JSON[_0xb30c('0x26')](_0x7e8e40[_0xb30c('0x57')]):_0xb30c('0x69'));return respondWithRpcPromise(_0xb30c('0x6a'),_0xb30c('0x6b'),_0x317083);}return null;})['then'](function(_0x422ff9){var _0x4dc27f=_0xb30c('0x6c')+_0x422ff9[_0xb30c('0x29')][_0xb30c('0x6d')];return db[_0xb30c('0x6e')]['query'](_0x4dc27f,{'type':db[_0xb30c('0x6f')][_0xb30c('0x70')][_0xb30c('0x71')],'raw':!![]})['then'](function(_0xf3989){return _0xf3989;});})['then'](function(_0x2dab1e){if(_0x2dab1e){_0x317083[_0xb30c('0x29')][_0xb30c('0x72')]=_0x2dab1e[0x0];if(!_0x7e8e40['body'][_0xb30c('0x62')])return;return db[_0xb30c('0x73')][_0xb30c('0x55')]({'where':{'id':_0x7e8e40[_0xb30c('0x57')][_0xb30c('0x62')],'role':'agent'},'attributes':['id',_0xb30c('0x38'),'fullname',_0xb30c('0x74'),_0xb30c('0x75')],'raw':!![]});}return null;})[_0xb30c('0x36')](function(_0x2ebb05){if(!_0x2ebb05)return null;_0x317083[_0xb30c('0x29')][_0xb30c('0x76')]=_0x2ebb05;return _0x317083;})[_0xb30c('0x36')](function(_0x357e40){if(_0x357e40){if(_0x7e8e40[_0xb30c('0x57')]['manual']){_0x317083[_0xb30c('0x29')][_0xb30c('0x77')]=util[_0xb30c('0x60')](_0xb30c('0x78'),_0x7e8e40[_0xb30c('0x67')]['name']);_0x317083[_0xb30c('0x29')][_0xb30c('0x79')]=_0x317083[_0xb30c('0x79')];_0x317083[_0xb30c('0x29')][_0xb30c('0x7a')]=_0x317083[_0xb30c('0x79')];_0x317083['message'][_0xb30c('0x7b')]=_0xb30c('0x5c');return respondWithRpcPromise('EventManager',_0xb30c('0x7c'),{'event':_0xb30c('0x7d'),'message':_0x317083[_0xb30c('0x29')]},client9002)['then'](function(){return _0x317083;});}return _0x317083;}return null;})[_0xb30c('0x36')](respondWithResult(_0x588f3e,null))[_0xb30c('0x2b')](handleError(_0x588f3e,null));};var interaction_log=require('../../config/logger')(_0xb30c('0x7e'));exports['reject']=function(_0x44c7c2,_0x31e9ed,_0x3bcc19){var _0x2a881e={'agent':{},'channel':_0xb30c('0x5d')};if(_0x44c7c2['body']['id']){delete _0x44c7c2[_0xb30c('0x57')]['id'];}_0x44c7c2[_0xb30c('0x57')][_0xb30c('0x62')]=_0x44c7c2[_0xb30c('0x57')][_0xb30c('0x62')]||_0x44c7c2[_0xb30c('0x67')]['id'];_0x2a881e[_0xb30c('0x76')]['id']=_0x44c7c2['body'][_0xb30c('0x62')];return db[_0xb30c('0x50')]['find']({'where':{'id':_0x44c7c2[_0xb30c('0x5a')]['id'],'UserId':null}})[_0xb30c('0x36')](handleEntityNotFound(_0x31e9ed,null))[_0xb30c('0x36')](function(_0x243d88){if(_0x243d88){_0x2a881e['message']=_0x243d88[_0xb30c('0x66')]({'plain':!![]});return db['SmsInteraction'][_0xb30c('0x55')]({'where':{'id':_0x243d88[_0xb30c('0x63')]}});}return null;})[_0xb30c('0x36')](handleEntityNotFound(_0x31e9ed,null))[_0xb30c('0x36')](function(_0x1b5472){if(_0x1b5472){_0x2a881e[_0xb30c('0x65')]=_0x1b5472['get']({'plain':!![]});interaction_log[_0xb30c('0x22')](_0xb30c('0x7f'),_0x44c7c2['user']['id'],_0x44c7c2[_0xb30c('0x67')][_0xb30c('0x38')],_0x44c7c2[_0xb30c('0x67')][_0xb30c('0x68')],_0x2a881e[_0xb30c('0x65')]['id'],_0x44c7c2[_0xb30c('0x57')]?JSON['stringify'](_0x44c7c2[_0xb30c('0x57')]):_0xb30c('0x69'));return respondWithRpcPromise('RejectMessage',_0xb30c('0x80'),_0x2a881e);}return null;})['then'](function(_0x20a10c){var _0x12399c=_0xb30c('0x6c')+_0x20a10c[_0xb30c('0x29')][_0xb30c('0x6d')];return db[_0xb30c('0x6e')][_0xb30c('0x3f')](_0x12399c,{'type':db[_0xb30c('0x6f')][_0xb30c('0x70')][_0xb30c('0x71')],'raw':!![]})[_0xb30c('0x36')](function(_0x3bb275){return _0x3bb275;});})[_0xb30c('0x36')](function(_0x3d52d0){if(_0x3d52d0){_0x2a881e[_0xb30c('0x29')][_0xb30c('0x72')]=_0x3d52d0[0x0];if(!_0x44c7c2[_0xb30c('0x57')][_0xb30c('0x62')])return;return db[_0xb30c('0x73')][_0xb30c('0x55')]({'where':{'id':_0x44c7c2[_0xb30c('0x57')]['UserId'],'role':_0xb30c('0x76')},'attributes':['id','name',_0xb30c('0x81'),_0xb30c('0x74'),_0xb30c('0x75')],'raw':!![]});}return null;})[_0xb30c('0x36')](function(_0x22af2a){if(!_0x22af2a)return null;_0x2a881e[_0xb30c('0x29')]['agent']=_0x22af2a;return _0x2a881e;})[_0xb30c('0x36')](function(_0x1ead9c){if(_0x1ead9c){_0x1ead9c[_0xb30c('0x29')][_0xb30c('0x77')]=util[_0xb30c('0x60')](_0xb30c('0x78'),_0x44c7c2[_0xb30c('0x67')]['name']);_0x1ead9c['message'][_0xb30c('0x79')]=_0x2a881e['channel'];_0x1ead9c['message'][_0xb30c('0x7a')]=_0x2a881e[_0xb30c('0x79')];_0x1ead9c[_0xb30c('0x29')][_0xb30c('0x7b')]='reject';respondWithRpcPromise(_0xb30c('0x7c'),_0xb30c('0x7c'),{'event':_0xb30c('0x82'),'message':_0x1ead9c[_0xb30c('0x29')]},client9002);return _0x2a881e;}return null;})['then'](respondWithResult(_0x31e9ed,null))[_0xb30c('0x2b')](handleError(_0x31e9ed,null));};exports[_0xb30c('0x31')]=function(_0x1cacfc,_0x487e57,_0x378cf9){if(_0x1cacfc[_0xb30c('0x57')]['id']){delete _0x1cacfc['body']['id'];}var _0x5733b9;return db[_0xb30c('0x50')]['find']({'where':{'id':_0x1cacfc['params']['id']}})[_0xb30c('0x36')](handleEntityNotFound(_0x487e57,null))[_0xb30c('0x36')](function(_0x3e16bd){if(_0x3e16bd){_0x5733b9=_0x3e16bd;return db[_0xb30c('0x83')][_0xb30c('0x55')]({'where':{'id':_0x3e16bd[_0xb30c('0x84')]}});}})[_0xb30c('0x36')](handleEntityNotFound(_0x487e57,null))[_0xb30c('0x36')](function(_0x2ae0ea){if(_0x2ae0ea){logger[_0xb30c('0x24')](_0xb30c('0x25'),_0xb30c('0x31'),_0xb30c('0x85'),_0x2ae0ea[_0xb30c('0x4d')],util['inspect'](_0x1cacfc['body'],{'showHidden':![],'depth':null}));switch(_0x2ae0ea[_0xb30c('0x4d')]){case _0xb30c('0x86'):if(_0x1cacfc[_0xb30c('0x57')][_0xb30c('0x87')]&&_0x1cacfc[_0xb30c('0x57')][_0xb30c('0x87')]===_0x5733b9[_0xb30c('0x88')]){return _0x5733b9['update']({'read':!![]});}else{logger['error'](_0xb30c('0x89'),'status',_0xb30c('0x86'),util[_0xb30c('0x8a')](_0x1cacfc[_0xb30c('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1cacfc['body'][_0xb30c('0x8b')]&&_0x1cacfc[_0xb30c('0x57')][_0xb30c('0x8b')]===_0x5733b9['messageId']&&_[_0xb30c('0x8c')]([_0xb30c('0x8d'),_0xb30c('0x8e')],_0x1cacfc[_0xb30c('0x57')][_0xb30c('0x8f')])>=0x0){return _0x5733b9[_0xb30c('0x58')]({'read':!![]});}else{logger[_0xb30c('0x27')](_0xb30c('0x89'),_0xb30c('0x31'),_0xb30c('0x90'),util[_0xb30c('0x8a')](_0x1cacfc['body'],{'showHidden':![],'depth':null}));}break;case _0xb30c('0x91'):var _0x478365=_0x1cacfc[_0xb30c('0x57')][_0xb30c('0x92')][0x0];if(_0x478365['status']['groupName']===_0xb30c('0x93')){return _0x5733b9[_0xb30c('0x58')]({'read':!![]});}else{logger[_0xb30c('0x27')](_0xb30c('0x89'),_0xb30c('0x31'),_0xb30c('0x91'),util[_0xb30c('0x8a')](_0x1cacfc['body'],{'showHidden':![],'depth':null}));}break;}return _0x5733b9;}})[_0xb30c('0x36')](respondWithResult(_0x487e57,null))['catch'](handleError(_0x487e57,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index df50e32..107507e 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 _0xff90=['../../mysqldb','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0xb92b66,_0x1a121b){var _0x4d3b74=function(_0x983fb1){while(--_0x983fb1){_0xb92b66['push'](_0xb92b66['shift']());}};_0x4d3b74(++_0x1a121b);}(_0xff90,0x77));var _0x0ff9=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0xff90[_0x4c80d7];return _0x3c5095;};'use strict';var EventEmitter=require(_0x0ff9('0x0'));var SmsMessage=require(_0x0ff9('0x1'))['db'][_0x0ff9('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0ff9('0x3')](0x0);var events={'afterCreate':_0x0ff9('0x4'),'afterUpdate':_0x0ff9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2f5fdd){return function(_0x3c1c27,_0x48afd9,_0x41f2ad){SmsMessageEvents[_0x0ff9('0x6')](_0x2f5fdd+':'+_0x3c1c27['id'],_0x3c1c27);SmsMessageEvents[_0x0ff9('0x6')](_0x2f5fdd,_0x3c1c27);_0x41f2ad(null);};}for(var e in events){if(events[_0x0ff9('0x7')](e)){var event=events[e];SmsMessage[_0x0ff9('0x8')](e,emitEvent(event));}}module[_0x0ff9('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x8664=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x3a8322,_0x248b39){var _0x532fa9=function(_0x211574){while(--_0x211574){_0x3a8322['push'](_0x3a8322['shift']());}};_0x532fa9(++_0x248b39);}(_0x8664,0xc1));var _0x4866=function(_0x19f99a,_0x171d11){_0x19f99a=_0x19f99a-0x0;var _0x29688a=_0x8664[_0x19f99a];return _0x29688a;};'use strict';var EventEmitter=require(_0x4866('0x0'));var SmsMessage=require(_0x4866('0x1'))['db'][_0x4866('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4866('0x3')](0x0);var events={'afterCreate':_0x4866('0x4'),'afterUpdate':_0x4866('0x5'),'afterDestroy':_0x4866('0x6')};function emitEvent(_0x1baaf5){return function(_0x571374,_0x4fc130,_0x57022d){SmsMessageEvents[_0x4866('0x7')](_0x1baaf5+':'+_0x571374['id'],_0x571374);SmsMessageEvents[_0x4866('0x7')](_0x1baaf5,_0x571374);_0x57022d(null);};}for(var e in events){if(events[_0x4866('0x8')](e)){var event=events[e];SmsMessage[_0x4866('0x9')](e,emitEvent(event));}}module[_0x4866('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 4da4d7e..2e34e92 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 _0x5984=['clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','text','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','SmsMessage','sms_messages','messageId','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','then','update','createdAt','error','find','SmsAccountId','type','twilio','phone','accountSid','authToken','messages','body','remote','/api/sms/messages/','/status?token=','token','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','password','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','Missing\x20parameters:\x20authToken'];(function(_0x3caa66,_0x5c2ab7){var _0x279b83=function(_0x342133){while(--_0x342133){_0x3caa66['push'](_0x3caa66['shift']());}};_0x279b83(++_0x5c2ab7);}(_0x5984,0x1a0));var _0x4598=function(_0x365897,_0x4c425a){_0x365897=_0x365897-0x0;var _0x158754=_0x5984[_0x365897];return _0x158754;};'use strict';var _=require(_0x4598('0x0'));var util=require(_0x4598('0x1'));var logger=require(_0x4598('0x2'))(_0x4598('0x3'));var moment=require(_0x4598('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4598('0x5'));var rimraf=require(_0x4598('0x6'));var config=require(_0x4598('0x7'));var attributes=require('./smsMessage.attributes');module[_0x4598('0x8')]=function(_0xe4924e,_0x8f6847){return _0xe4924e['define'](_0x4598('0x9'),attributes,{'tableName':_0x4598('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4598('0xb')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x4598('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x508a16,_0x552fb1,_0x490cb2){var _0x29b610=_0xe4924e[_0x4598('0xd')];var _0x130967=_0x508a16['get']({'plain':!![]});if(_0x130967[_0x4598('0xe')][_0x4598('0xf')]()==='in'||_0x130967['direction'][_0x4598('0xf')]()===_0x4598('0x10')&&!_0x130967[_0x4598('0x11')]&&!_['isNil'](_0x130967[_0x4598('0x12')])&&!_[_0x4598('0x13')](_0x130967[_0x4598('0x14')])){_0x29b610[_0x4598('0x15')]['findOne']({'where':{'id':_0x130967['SmsInteractionId']}})[_0x4598('0x16')](function(_0x570ec5){if(_0x570ec5){_0x570ec5[_0x4598('0x17')]({'lastMsgAt':_0x130967[_0x4598('0x18')],'lastMsgDirection':_0x130967[_0x4598('0xe')][_0x4598('0xf')]()});}})['catch'](function(_0x57fe16){console[_0x4598('0x19')](_0x57fe16);});}if(_0x130967[_0x4598('0xe')]==='out'&&!_0x130967[_0x4598('0x11')]){var _0x22a787;_0x29b610['SmsAccount'][_0x4598('0x1a')]({'where':{'id':_0x130967[_0x4598('0x1b')]},'raw':!![]})['then'](function(_0x14cacf){_0x22a787=_0x14cacf;if(_0x22a787&&_0x22a787[_0x4598('0x1c')]){switch(_0x22a787[_0x4598('0x1c')]){case _0x4598('0x1d'):var _0x59b654=require(_0x4598('0x1d'));if(_0x22a787['accountSid']&&_0x22a787['authToken']&&_0x22a787[_0x4598('0x1e')]){var _0xc77fe3=new _0x59b654(_0x22a787[_0x4598('0x1f')],_0x22a787[_0x4598('0x20')]);_0xc77fe3[_0x4598('0x21')]['create']({'body':_0x130967[_0x4598('0x22')],'to':_0x130967['phone'],'from':_0x22a787[_0x4598('0x1e')],'statusCallback':_0x22a787[_0x4598('0x23')]+_0x4598('0x24')+_0x130967['id']+_0x4598('0x25')+_0x22a787[_0x4598('0x26')]})['then'](function(_0x2f72d1){if(_0x2f72d1[_0x4598('0x27')]){return _0x508a16['update']({'messageId':_0x2f72d1[_0x4598('0x27')]});}})[_0x4598('0x28')](function(_0x3b7b5b){logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4598('0x29'),_0x4598('0x1d'),util[_0x4598('0x2a')](_0x3b7b5b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x4598('0x2c'):var _0x3fb1dd='https://api.skebby.it/API/v1.0/REST/';if(_0x22a787['username']&&_0x22a787[_0x4598('0x2d')]){var _0x29fc87={'recipient':[_0x130967['phone']],'message':_0x130967[_0x4598('0x22')],'message_type':_0x22a787[_0x4598('0x2e')]};if(_0x22a787['smsMethod']&&_0x22a787['smsMethod']!=='SI'){_0x29fc87[_0x4598('0x2f')]=_0x22a787[_0x4598('0x1e')];}var _0x4a4b29={'url':_0x3fb1dd+_0x4598('0x30')+_0x22a787[_0x4598('0x31')]+_0x4598('0x32')+_0x22a787['password'],'method':_0x4598('0x33')};rp(_0x4a4b29)[_0x4598('0x16')](function(_0x59badd){var _0x5dd63c=_0x59badd[_0x4598('0x34')](';');var _0x282120={'user_key':_0x5dd63c[0x0],'session_key':_0x5dd63c[0x1]};_0x4a4b29={'url':_0x3fb1dd+_0x4598('0x35'),'method':_0x4598('0x36'),'headers':{'user_key':_0x282120['user_key'],'Session_key':_0x282120[_0x4598('0x37')]},'json':!![],'body':_0x29fc87};return rp(_0x4a4b29);})[_0x4598('0x16')](function(_0xffb002){if(_0xffb002[_0x4598('0x38')]>=0x1){var _0x225be0={'messageId':_0xffb002[_0x4598('0x39')]};if(_0x22a787['smsMethod']!=='GP'||!_0x22a787[_0x4598('0x3a')]){_0x225be0[_0x4598('0x3b')]=!![];}return _0x508a16[_0x4598('0x17')](_0x225be0);}else{return logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4598('0x29'),'skebby',util[_0x4598('0x2a')](_0xffb002,{'showHidden':![],'depth':null}));}})['catch'](function(_0x158a64){return logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',util['inspect'](_0x158a64,{'showHidden':![],'depth':null}));});}else{logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4598('0x29'),_0x4598('0x2c'),_0x4598('0x3c'));}break;case _0x4598('0x3d'):if(_0x22a787[_0x4598('0x20')]){var _0x4a989a={'recipient':_0x130967[_0x4598('0x1e')],'message':_0x130967[_0x4598('0x22')],'sender':_0x22a787[_0x4598('0x3e')]||_0x22a787[_0x4598('0x1e')],'authorization':_0x22a787['authToken']};var _0x552fb1={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x4a989a,'json':!![]};rp(_0x552fb1)[_0x4598('0x16')](function(_0x3eeaee){var _0x212ef3={'messageId':_0x3eeaee['requestid']};if(!_0x22a787[_0x4598('0x3a')]){_0x212ef3[_0x4598('0x3b')]=!![];}return _0x508a16['update'](_0x212ef3);})['catch'](function(_0x27d288){logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),'connectel',util['inspect'](_0x27d288,{'showHidden':![],'depth':null}));});}else{logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4598('0x29'),_0x4598('0x3d'),_0x4598('0x3f'));}break;case _0x4598('0x40'):if(_0x22a787['username']&&_0x22a787[_0x4598('0x2d')]){var _0x4a989a={'messages':[{'source':'xCALLY\x20Motion','to':_0x130967[_0x4598('0x1e')],'body':_0x130967['body'],'from':_0x22a787[_0x4598('0x3e')]||_0x22a787[_0x4598('0x1e')]}]};var _0x56720d=util[_0x4598('0x41')](_0x4598('0x42'),_0x22a787[_0x4598('0x31')],_0x22a787[_0x4598('0x2d')]);var _0x552fb1={'method':_0x4598('0x36'),'uri':_0x4598('0x43'),'body':_0x4a989a,'headers':{'Authorization':util[_0x4598('0x41')](_0x4598('0x44'),new Buffer(_0x56720d)['toString'](_0x4598('0x45')))},'json':!![]};rp(_0x552fb1)['then'](function(_0x5b4ca6){if(_0x5b4ca6[_0x4598('0x46')]>=0xc8&&_0x5b4ca6[_0x4598('0x46')]<=0xce){if(_0x5b4ca6[_0x4598('0x47')]&&_0x5b4ca6['data'][_0x4598('0x48')]>0x0){var _0x3afb87=_[_0x4598('0x49')](_0x5b4ca6[_0x4598('0x47')][_0x4598('0x21')]);var _0x7e1ba2={'messageId':_0x3afb87[_0x4598('0x4a')]};if(!_0x22a787['deliveryReport']){_0x7e1ba2[_0x4598('0x3b')]=!![];}return _0x508a16[_0x4598('0x17')](_0x7e1ba2);}else{logger['error'](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x4b'),util[_0x4598('0x2a')](_0x5b4ca6,{'showHidden':![],'depth':null}));}}else{logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x4b'),util[_0x4598('0x2a')](_0x5b4ca6,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1859ec){logger[_0x4598('0x19')](_0x4598('0x2b'),'afterCreate',_0x4598('0x4b'),util[_0x4598('0x2a')](_0x1859ec,{'showHidden':![],'depth':null}));});}else{logger[_0x4598('0x19')](_0x4598('0x2b'),'afterCreate',_0x4598('0x4b'),_0x4598('0x3c'));}break;case _0x4598('0x4c'):if(_0x22a787[_0x4598('0x4d')]&&_0x22a787[_0x4598('0x20')]){var _0x4a989a={'dst':_0x130967['phone'],'text':_0x130967[_0x4598('0x22')],'src':_0x22a787[_0x4598('0x3e')]||_0x22a787[_0x4598('0x1e')],'url':_0x22a787[_0x4598('0x23')]+_0x4598('0x24')+_0x130967['id']+'/status?token='+_0x22a787['token']};var _0x56720d=util[_0x4598('0x41')]('%s:%s',_0x22a787[_0x4598('0x4d')],_0x22a787['authToken']);var _0x552fb1={'method':_0x4598('0x36'),'uri':util[_0x4598('0x41')](_0x4598('0x4e'),_0x22a787[_0x4598('0x4d')]),'body':_0x4a989a,'headers':{'Authorization':util[_0x4598('0x41')](_0x4598('0x44'),new Buffer(_0x56720d)[_0x4598('0x4f')](_0x4598('0x45')))},'json':!![]};rp(_0x552fb1)['then'](function(_0x8dab3d){var _0x12e6d6={'messageId':_0x8dab3d[_0x4598('0x50')][0x0]};return _0x508a16['update'](_0x12e6d6);})[_0x4598('0x28')](function(_0x44dc7d){logger[_0x4598('0x19')](_0x4598('0x2b'),'afterCreate',_0x4598('0x4c'),util[_0x4598('0x2a')](_0x44dc7d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x4c'),_0x4598('0x51'));}break;case'infobip':if(_0x22a787['username']&&_0x22a787[_0x4598('0x2d')]){if(_0x22a787[_0x4598('0x52')]){var _0x3332f5={'method':'POST','uri':_0x22a787[_0x4598('0x52')]+_0x4598('0x53'),'body':{'username':_0x22a787[_0x4598('0x31')],'password':_0x22a787[_0x4598('0x2d')]},'json':!![]};return rp(_0x3332f5)[_0x4598('0x16')](function(_0x49efa3){var _0x5048e8={'method':_0x4598('0x36'),'uri':_0x22a787[_0x4598('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x22a787[_0x4598('0x1e')],'destinations':[{'to':_0x130967[_0x4598('0x1e')]}],'text':_0x130967['body'],'notifyUrl':_0x22a787[_0x4598('0x23')]+_0x4598('0x24')+_0x130967['id']+_0x4598('0x25')+_0x22a787[_0x4598('0x26')],'notifyContentType':_0x4598('0x54'),'callbackData':_0x22a787[_0x4598('0x1e')]+';'+_0x130967[_0x4598('0x22')]}]},'headers':{'Authorization':_0x4598('0x55')+_0x49efa3[_0x4598('0x26')]},'json':!![]};return rp(_0x5048e8)['then'](function(_0x4fcbb6){if(_0x4fcbb6['messages']){var _0x32d48e={'messageId':_0x4fcbb6[_0x4598('0x21')][0x0]['messageId']};if(!_0x22a787[_0x4598('0x3a')]){_0x32d48e[_0x4598('0x3b')]=!![];}return _0x508a16[_0x4598('0x17')](_0x32d48e);}else{return logger['error'](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x56'),util[_0x4598('0x2a')](_0x4fcbb6,{'showHidden':![],'depth':null}));}});})[_0x4598('0x28')](function(_0x169083){return logger[_0x4598('0x19')](_0x4598('0x2b'),'afterCreate',_0x4598('0x56'),util[_0x4598('0x2a')](_0x169083,{'showHidden':![],'depth':null}));});}else{logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x56'),_0x4598('0x57'));}}else{logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),'infobip',_0x4598('0x3c'));}break;case'csc':var _0xab2e5b=require(_0x4598('0x58'));if(_0x22a787[_0x4598('0x59')]){var _0x3dd9d0={};_0x3dd9d0['login']=_0x22a787[_0x4598('0x31')];_0x3dd9d0[_0x4598('0x1e')]=_0x130967['phone'];_0x3dd9d0[_0x4598('0x2f')]=_0x22a787[_0x4598('0x1e')];_0x3dd9d0[_0x4598('0x5a')]=_0x130967[_0x4598('0x22')];_0x3dd9d0['timestamp']=+new Date();var _0x41fa36='';var _0x22e26a='';var _0x2e2d02=Object[_0x4598('0x5b')](_0x3dd9d0);_0x2e2d02['sort']();for(var _0x2c0cc5=0x0;_0x2c0cc5<_0x2e2d02[_0x4598('0x5c')];_0x2c0cc5++){if(_0x41fa36!=''){_0x41fa36+='&';}_0x41fa36+=_0x2e2d02[_0x2c0cc5]+'='+encodeURIComponent(_0x3dd9d0[_0x2e2d02[_0x2c0cc5]]);_0x22e26a+=_0x3dd9d0[_0x2e2d02[_0x2c0cc5]];}_0x22e26a+=_0x22a787[_0x4598('0x59')];_0x22e26a=_0xab2e5b[_0x4598('0x5d')](_0x4598('0x5e'))[_0x4598('0x17')](_0x22e26a)[_0x4598('0x5f')](_0x4598('0x60'));if(_0x41fa36!==''){_0x41fa36+='&';}_0x41fa36+=_0x4598('0x61')+_0x22e26a;var _0x4a4b29={'method':'GET','uri':_0x22a787[_0x4598('0x52')]+_0x4598('0x62')+_0x41fa36,'json':!![]};return rp(_0x4a4b29)[_0x4598('0x16')](function(_0x3f0b4e){var _0x4445dc=Object[_0x4598('0x5b')](_0x3f0b4e);if(_0x3f0b4e[_0x4445dc[0x0]][_0x4598('0x19')]&&parseInt(_0x3f0b4e[_0x4445dc[0x0]][_0x4598('0x19')])===0x0){var _0x424e5b={'messageId':_0x3f0b4e[_0x4445dc[0x0]]['id_sms']};if(!_0x22a787['deliveryReport']){_0x424e5b[_0x4598('0x3b')]=!![];}return _0x508a16['update'](_0x424e5b);}else{return logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4598('0x63'),util[_0x4598('0x2a')](_0x3f0b4e[_0x4598('0x19')],{'showHidden':![],'depth':null}));}})[_0x4598('0x28')](function(_0x4337a3){return logger['error'](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x63'),util['inspect'](_0x4337a3,{'showHidden':![],'depth':null}));});}else{logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x63'),_0x4598('0x64'));}break;case _0x4598('0x65'):if(_0x22a787[_0x4598('0x59')]){var _0x2b6bb9={'method':_0x4598('0x36'),'uri':_0x4598('0x66'),'headers':{'Authorization':_0x22a787[_0x4598('0x59')]},'body':{'content':_0x130967[_0x4598('0x22')],'to':[_0x130967[_0x4598('0x1e')]],'from':_0x22a787[_0x4598('0x1e')],'binary':![],'clientMessageId':_0x4598('0x67'),'charset':_0x4598('0x68')},'json':!![]};rp(_0x2b6bb9)[_0x4598('0x16')](function(_0x510b53){if(!_0x510b53[_0x4598('0x19')]){var _0x2dfa28={'messageId':_0x510b53[_0x4598('0x21')][0x0][_0x4598('0x69')]};if(!_0x22a787[_0x4598('0x3a')]){_0x2dfa28[_0x4598('0x3b')]=!![];}return _0x508a16[_0x4598('0x17')](_0x2dfa28);}else{return logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x65'),util[_0x4598('0x2a')](_0x510b53['error'],{'showHidden':![],'depth':null}));}})[_0x4598('0x28')](function(_0x5eca8c){return logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4598('0x65'),util[_0x4598('0x2a')](_0x5eca8c,{'showHidden':![],'depth':null}));});}else{logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4598('0x29'),_0x4598('0x65'),_0x4598('0x64'));}break;case _0x4598('0x6a'):if(_0x22a787['username']&&_0x22a787[_0x4598('0x2d')]){var _0x56720d=util[_0x4598('0x41')](_0x4598('0x42'),_0x22a787[_0x4598('0x31')],_0x22a787[_0x4598('0x2d')]);var _0x552fb1={'method':_0x4598('0x36'),'uri':_0x4598('0x6b')+_0x22a787[_0x4598('0x6c')]+_0x4598('0x6d'),'body':{'to':[_0x130967['phone']],'text':_0x130967[_0x4598('0x22')],'from':_0x22a787['phone'],'applicationId':_0x22a787['applicationId']},'headers':{'Authorization':util['format'](_0x4598('0x44'),new Buffer(_0x56720d)[_0x4598('0x4f')](_0x4598('0x45')))},'json':!![]};rp(_0x552fb1)[_0x4598('0x16')](function(_0x3c0eba){if(_0x3c0eba['id']){var _0x3c81fe={'messageId':_0x3c0eba['id']};return _0x508a16[_0x4598('0x17')](_0x3c81fe);}else{logger[_0x4598('0x19')](_0x4598('0x2b'),'afterCreate',_0x4598('0x6a'),util[_0x4598('0x2a')](_0x3c0eba,{'showHidden':![],'depth':null}));}})[_0x4598('0x28')](function(_0x33961f){logger[_0x4598('0x19')](_0x4598('0x2b'),'afterCreate',_0x4598('0x6a'),util[_0x4598('0x2a')](_0x33961f,{'showHidden':![],'depth':null}));});}else{logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x6a'),_0x4598('0x3c'));}break;case'intelepeer':if(_0x22a787[_0x4598('0x59')]){var _0x360cf6={};var _0x4a4b29={'method':_0x4598('0x36'),'uri':_0x4598('0x6e'),'headers':{'Authorization':_0x4598('0x6f')+_0x22a787['apiKey'],'Content-Type':_0x4598('0x54')},'body':{'from':_0x22a787[_0x4598('0x1e')],'to':_0x130967['phone'],'text':_0x130967[_0x4598('0x22')]},'json':!![]};return rp(_0x4a4b29)['then'](function(_0x5afeec){if(_0x5afeec[_0x4598('0x70')]==0xca){_0x360cf6[_0x4598('0x71')]=_0x5afeec;var _0xffe87f={'method':_0x4598('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x4598('0x6f')+_0x22a787['apiKey'],'Content-Type':_0x4598('0x54')},'body':{'refid':_0x360cf6[_0x4598('0x71')][_0x4598('0x72')]},'json':!![]};return rp(_0xffe87f)['then'](function(_0x5db481){_0x360cf6[_0x4598('0x73')]=_0x5db481;var _0x28df1a={'messageId':_0x360cf6[_0x4598('0x71')]['refid'],'read':!![]};return _0x508a16['update'](_0x28df1a);});}else{return logger['error'](_0x4598('0x2b'),_0x4598('0x29'),_0x4598('0x74'),util[_0x4598('0x2a')](_0x5afeec,{'showHidden':![],'depth':null}));}})[_0x4598('0x28')](function(_0x51cff7){return logger[_0x4598('0x19')](_0x4598('0x2b'),_0x4598('0x29'),'intelepeer',util[_0x4598('0x2a')](_0x51cff7,{'showHidden':![],'depth':null}));});}else{return logger[_0x4598('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4598('0x29'),_0x4598('0x74'),_0x4598('0x75'));}break;}}})[_0x4598('0x76')](function(){_0x490cb2();});}else{_0x490cb2();}}},'charset':'utf8mb4','collate':_0x4598('0x77')});}; \ No newline at end of file +var _0x87d3=['message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','models','get','direction','toLowerCase','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','then','createdAt','error','out','SmsAccount','find','type','accountSid','authToken','phone','messages','create','body','/api/sms/messages/','/status?token=','token','sid','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','split','sms','POST','user_key','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','plivo','format','https://api.plivo.com/v1/Account/%s/Message/','authId','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','remote','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','md5','hex','signature=','/external/get/send.php?','id_sms','clickatell','https://messaging.bandwidth.com/api/v2/users/','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20'];(function(_0x41b2c6,_0x2f9baa){var _0x3d4757=function(_0x4eb6ca){while(--_0x4eb6ca){_0x41b2c6['push'](_0x41b2c6['shift']());}};_0x3d4757(++_0x2f9baa);}(_0x87d3,0x1df));var _0x387d=function(_0x503254,_0x29e551){_0x503254=_0x503254-0x0;var _0x383dcc=_0x87d3[_0x503254];return _0x383dcc;};'use strict';var _=require(_0x387d('0x0'));var util=require('util');var logger=require(_0x387d('0x1'))(_0x387d('0x2'));var moment=require(_0x387d('0x3'));var BPromise=require(_0x387d('0x4'));var rp=require(_0x387d('0x5'));var fs=require('fs');var path=require(_0x387d('0x6'));var rimraf=require('rimraf');var config=require(_0x387d('0x7'));var attributes=require(_0x387d('0x8'));module[_0x387d('0x9')]=function(_0x16f5e9,_0x521bc4){return _0x16f5e9[_0x387d('0xa')](_0x387d('0xb'),attributes,{'tableName':_0x387d('0xc'),'paranoid':![],'indexes':[{'name':_0x387d('0xd'),'fields':[_0x387d('0xd')]},{'name':'fti_sms_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x288990,_0x42a956,_0x53c4a1){var _0x4207ad=_0x16f5e9[_0x387d('0xe')];var _0x40dbde=_0x288990[_0x387d('0xf')]({'plain':!![]});if(_0x40dbde[_0x387d('0x10')]['toLowerCase']()==='in'||_0x40dbde['direction'][_0x387d('0x11')]()==='out'&&!_0x40dbde[_0x387d('0x12')]&&!_['isNil'](_0x40dbde[_0x387d('0x13')])&&!_[_0x387d('0x14')](_0x40dbde[_0x387d('0x15')])){_0x4207ad[_0x387d('0x16')][_0x387d('0x17')]({'where':{'id':_0x40dbde[_0x387d('0x15')]}})[_0x387d('0x18')](function(_0x38aaea){if(_0x38aaea){_0x38aaea['update']({'lastMsgAt':_0x40dbde[_0x387d('0x19')],'lastMsgDirection':_0x40dbde['direction'][_0x387d('0x11')]()});}})['catch'](function(_0x4cd1d6){console[_0x387d('0x1a')](_0x4cd1d6);});}if(_0x40dbde[_0x387d('0x10')]===_0x387d('0x1b')&&!_0x40dbde['secret']){var _0xefe8d3;_0x4207ad[_0x387d('0x1c')][_0x387d('0x1d')]({'where':{'id':_0x40dbde['SmsAccountId']},'raw':!![]})[_0x387d('0x18')](function(_0x2d1d93){_0xefe8d3=_0x2d1d93;if(_0xefe8d3&&_0xefe8d3[_0x387d('0x1e')]){switch(_0xefe8d3[_0x387d('0x1e')]){case'twilio':var _0x2cd07e=require('twilio');if(_0xefe8d3[_0x387d('0x1f')]&&_0xefe8d3[_0x387d('0x20')]&&_0xefe8d3[_0x387d('0x21')]){var _0x1dae83=new _0x2cd07e(_0xefe8d3['accountSid'],_0xefe8d3[_0x387d('0x20')]);_0x1dae83[_0x387d('0x22')][_0x387d('0x23')]({'body':_0x40dbde[_0x387d('0x24')],'to':_0x40dbde[_0x387d('0x21')],'from':_0xefe8d3['phone'],'statusCallback':_0xefe8d3['remote']+_0x387d('0x25')+_0x40dbde['id']+_0x387d('0x26')+_0xefe8d3[_0x387d('0x27')]})[_0x387d('0x18')](function(_0x3b2b0f){if(_0x3b2b0f[_0x387d('0x28')]){return _0x288990[_0x387d('0x29')]({'messageId':_0x3b2b0f[_0x387d('0x28')]});}})[_0x387d('0x2a')](function(_0x26e643){logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x2d'),util[_0x387d('0x2e')](_0x26e643,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x387d('0x2c'),'twilio',_0x387d('0x2f'));}break;case _0x387d('0x30'):var _0x1e66a4=_0x387d('0x31');if(_0xefe8d3[_0x387d('0x32')]&&_0xefe8d3['password']){var _0x9e7d4={'recipient':[_0x40dbde[_0x387d('0x21')]],'message':_0x40dbde[_0x387d('0x24')],'message_type':_0xefe8d3['smsMethod']};if(_0xefe8d3[_0x387d('0x33')]&&_0xefe8d3['smsMethod']!=='SI'){_0x9e7d4[_0x387d('0x34')]=_0xefe8d3[_0x387d('0x21')];}var _0x122442={'url':_0x1e66a4+_0x387d('0x35')+_0xefe8d3[_0x387d('0x32')]+'&password='+_0xefe8d3[_0x387d('0x36')],'method':'GET'};rp(_0x122442)['then'](function(_0x560f1f){var _0x2e6386=_0x560f1f[_0x387d('0x37')](';');var _0x468e3a={'user_key':_0x2e6386[0x0],'session_key':_0x2e6386[0x1]};_0x122442={'url':_0x1e66a4+_0x387d('0x38'),'method':_0x387d('0x39'),'headers':{'user_key':_0x468e3a[_0x387d('0x3a')],'Session_key':_0x468e3a['session_key']},'json':!![],'body':_0x9e7d4};return rp(_0x122442);})[_0x387d('0x18')](function(_0x1e612c){if(_0x1e612c['total_sent']>=0x1){var _0x2777b6={'messageId':_0x1e612c[_0x387d('0x3b')]};if(_0xefe8d3[_0x387d('0x33')]!=='GP'||!_0xefe8d3[_0x387d('0x3c')]){_0x2777b6['read']=!![];}return _0x288990[_0x387d('0x29')](_0x2777b6);}else{return logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x30'),util[_0x387d('0x2e')](_0x1e612c,{'showHidden':![],'depth':null}));}})[_0x387d('0x2a')](function(_0x3f923d){return logger['error'](_0x387d('0x2b'),'afterCreate',_0x387d('0x30'),util[_0x387d('0x2e')](_0x3f923d,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x30'),_0x387d('0x3d'));}break;case _0x387d('0x3e'):if(_0xefe8d3[_0x387d('0x20')]){var _0x2ab29a={'recipient':_0x40dbde[_0x387d('0x21')],'message':_0x40dbde[_0x387d('0x24')],'sender':_0xefe8d3[_0x387d('0x3f')]||_0xefe8d3['phone'],'authorization':_0xefe8d3[_0x387d('0x20')]};var _0x42a956={'method':_0x387d('0x39'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2ab29a,'json':!![]};rp(_0x42a956)[_0x387d('0x18')](function(_0x4d67f4){var _0x20c04c={'messageId':_0x4d67f4[_0x387d('0x40')]};if(!_0xefe8d3[_0x387d('0x3c')]){_0x20c04c[_0x387d('0x41')]=!![];}return _0x288990[_0x387d('0x29')](_0x20c04c);})[_0x387d('0x2a')](function(_0x50be14){logger['error'](_0x387d('0x2b'),'afterCreate','connectel',util[_0x387d('0x2e')](_0x50be14,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')](_0x387d('0x2b'),'afterCreate',_0x387d('0x3e'),_0x387d('0x42'));}break;case'clicksend':if(_0xefe8d3['username']&&_0xefe8d3[_0x387d('0x36')]){var _0x2ab29a={'messages':[{'source':_0x387d('0x43'),'to':_0x40dbde[_0x387d('0x21')],'body':_0x40dbde[_0x387d('0x24')],'from':_0xefe8d3['senderString']||_0xefe8d3[_0x387d('0x21')]}]};var _0x15a415=util['format'](_0x387d('0x44'),_0xefe8d3[_0x387d('0x32')],_0xefe8d3[_0x387d('0x36')]);var _0x42a956={'method':_0x387d('0x39'),'uri':_0x387d('0x45'),'body':_0x2ab29a,'headers':{'Authorization':util['format'](_0x387d('0x46'),new Buffer(_0x15a415)['toString'](_0x387d('0x47')))},'json':!![]};rp(_0x42a956)['then'](function(_0x41a628){if(_0x41a628[_0x387d('0x48')]>=0xc8&&_0x41a628[_0x387d('0x48')]<=0xce){if(_0x41a628[_0x387d('0x49')]&&_0x41a628[_0x387d('0x49')]['queued_count']>0x0){var _0xdd90fc=_[_0x387d('0x4a')](_0x41a628['data'][_0x387d('0x22')]);var _0x396add={'messageId':_0xdd90fc[_0x387d('0x4b')]};if(!_0xefe8d3['deliveryReport']){_0x396add[_0x387d('0x41')]=!![];}return _0x288990[_0x387d('0x29')](_0x396add);}else{logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x387d('0x2c'),_0x387d('0x4c'),util[_0x387d('0x2e')](_0x41a628,{'showHidden':![],'depth':null}));}}else{logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x4c'),util[_0x387d('0x2e')](_0x41a628,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1d22e6){logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),'clickSend',util['inspect'](_0x1d22e6,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x387d('0x4c'),_0x387d('0x3d'));}break;case _0x387d('0x4d'):if(_0xefe8d3['authId']&&_0xefe8d3[_0x387d('0x20')]){var _0x2ab29a={'dst':_0x40dbde[_0x387d('0x21')],'text':_0x40dbde['body'],'src':_0xefe8d3[_0x387d('0x3f')]||_0xefe8d3['phone'],'url':_0xefe8d3['remote']+'/api/sms/messages/'+_0x40dbde['id']+_0x387d('0x26')+_0xefe8d3[_0x387d('0x27')]};var _0x15a415=util[_0x387d('0x4e')]('%s:%s',_0xefe8d3['authId'],_0xefe8d3[_0x387d('0x20')]);var _0x42a956={'method':_0x387d('0x39'),'uri':util[_0x387d('0x4e')](_0x387d('0x4f'),_0xefe8d3[_0x387d('0x50')]),'body':_0x2ab29a,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x15a415)[_0x387d('0x51')](_0x387d('0x47')))},'json':!![]};rp(_0x42a956)[_0x387d('0x18')](function(_0x53292c){var _0x1bb35a={'messageId':_0x53292c[_0x387d('0x52')][0x0]};return _0x288990['update'](_0x1bb35a);})['catch'](function(_0x50212c){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x387d('0x2c'),_0x387d('0x4d'),util[_0x387d('0x2e')](_0x50212c,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x387d('0x2c'),_0x387d('0x4d'),_0x387d('0x53'));}break;case _0x387d('0x54'):if(_0xefe8d3[_0x387d('0x32')]&&_0xefe8d3[_0x387d('0x36')]){if(_0xefe8d3['baseUrl']){var _0xe70509={'method':_0x387d('0x39'),'uri':_0xefe8d3[_0x387d('0x55')]+'/auth/1/session','body':{'username':_0xefe8d3[_0x387d('0x32')],'password':_0xefe8d3[_0x387d('0x36')]},'json':!![]};return rp(_0xe70509)[_0x387d('0x18')](function(_0x457fc2){var _0x32369a={'method':'POST','uri':_0xefe8d3[_0x387d('0x55')]+_0x387d('0x56'),'body':{'messages':[{'from':_0xefe8d3[_0x387d('0x21')],'destinations':[{'to':_0x40dbde[_0x387d('0x21')]}],'text':_0x40dbde[_0x387d('0x24')],'notifyUrl':_0xefe8d3[_0x387d('0x57')]+_0x387d('0x25')+_0x40dbde['id']+_0x387d('0x26')+_0xefe8d3['token'],'notifyContentType':_0x387d('0x58'),'callbackData':_0xefe8d3[_0x387d('0x21')]+';'+_0x40dbde['body']}]},'headers':{'Authorization':_0x387d('0x59')+_0x457fc2[_0x387d('0x27')]},'json':!![]};return rp(_0x32369a)['then'](function(_0x1cc7e3){if(_0x1cc7e3[_0x387d('0x22')]){var _0x4c0a82={'messageId':_0x1cc7e3[_0x387d('0x22')][0x0][_0x387d('0xd')]};if(!_0xefe8d3[_0x387d('0x3c')]){_0x4c0a82[_0x387d('0x41')]=!![];}return _0x288990[_0x387d('0x29')](_0x4c0a82);}else{return logger[_0x387d('0x1a')](_0x387d('0x2b'),'afterCreate',_0x387d('0x54'),util['inspect'](_0x1cc7e3,{'showHidden':![],'depth':null}));}});})[_0x387d('0x2a')](function(_0x4f3b10){return logger['error'](_0x387d('0x2b'),'afterCreate',_0x387d('0x54'),util[_0x387d('0x2e')](_0x4f3b10,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x54'),_0x387d('0x5a'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x387d('0x54'),_0x387d('0x3d'));}break;case _0x387d('0x5b'):var _0x2f4bdb=require(_0x387d('0x5c'));if(_0xefe8d3[_0x387d('0x5d')]){var _0x1e6489={};_0x1e6489[_0x387d('0x5e')]=_0xefe8d3[_0x387d('0x32')];_0x1e6489[_0x387d('0x21')]=_0x40dbde[_0x387d('0x21')];_0x1e6489[_0x387d('0x34')]=_0xefe8d3['phone'];_0x1e6489[_0x387d('0x5f')]=_0x40dbde[_0x387d('0x24')];_0x1e6489[_0x387d('0x60')]=+new Date();var _0x318c02='';var _0xb20ad2='';var _0x10259a=Object[_0x387d('0x61')](_0x1e6489);_0x10259a['sort']();for(var _0x20e7ec=0x0;_0x20e7ec<_0x10259a[_0x387d('0x62')];_0x20e7ec++){if(_0x318c02!=''){_0x318c02+='&';}_0x318c02+=_0x10259a[_0x20e7ec]+'='+encodeURIComponent(_0x1e6489[_0x10259a[_0x20e7ec]]);_0xb20ad2+=_0x1e6489[_0x10259a[_0x20e7ec]];}_0xb20ad2+=_0xefe8d3[_0x387d('0x5d')];_0xb20ad2=_0x2f4bdb['createHash'](_0x387d('0x63'))['update'](_0xb20ad2)['digest'](_0x387d('0x64'));if(_0x318c02!==''){_0x318c02+='&';}_0x318c02+=_0x387d('0x65')+_0xb20ad2;var _0x122442={'method':'GET','uri':_0xefe8d3['baseUrl']+_0x387d('0x66')+_0x318c02,'json':!![]};return rp(_0x122442)['then'](function(_0x444ab2){var _0x5909d2=Object[_0x387d('0x61')](_0x444ab2);if(_0x444ab2[_0x5909d2[0x0]]['error']&&parseInt(_0x444ab2[_0x5909d2[0x0]][_0x387d('0x1a')])===0x0){var _0x5705ed={'messageId':_0x444ab2[_0x5909d2[0x0]][_0x387d('0x67')]};if(!_0xefe8d3['deliveryReport']){_0x5705ed[_0x387d('0x41')]=!![];}return _0x288990[_0x387d('0x29')](_0x5705ed);}else{return logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x387d('0x5b'),util[_0x387d('0x2e')](_0x444ab2[_0x387d('0x1a')],{'showHidden':![],'depth':null}));}})[_0x387d('0x2a')](function(_0xf395ca){return logger['error'](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x5b'),util[_0x387d('0x2e')](_0xf395ca,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x387d('0x2c'),'csc','Missing\x20parameters:\x20apiKey');}break;case _0x387d('0x68'):if(_0xefe8d3[_0x387d('0x5d')]){var _0xca283d={'method':_0x387d('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xefe8d3[_0x387d('0x5d')]},'body':{'content':_0x40dbde[_0x387d('0x24')],'to':[_0x40dbde['phone']],'from':_0xefe8d3['phone'],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0xca283d)[_0x387d('0x18')](function(_0x1e8c9b){if(!_0x1e8c9b[_0x387d('0x1a')]){var _0x20d1f0={'messageId':_0x1e8c9b[_0x387d('0x22')][0x0]['apiMessageId']};if(!_0xefe8d3[_0x387d('0x3c')]){_0x20d1f0['read']=!![];}return _0x288990[_0x387d('0x29')](_0x20d1f0);}else{return logger[_0x387d('0x1a')](_0x387d('0x2b'),'afterCreate',_0x387d('0x68'),util[_0x387d('0x2e')](_0x1e8c9b[_0x387d('0x1a')],{'showHidden':![],'depth':null}));}})[_0x387d('0x2a')](function(_0x29fd13){return logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x68'),util[_0x387d('0x2e')](_0x29fd13,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0xefe8d3[_0x387d('0x32')]&&_0xefe8d3[_0x387d('0x36')]){var _0x15a415=util[_0x387d('0x4e')](_0x387d('0x44'),_0xefe8d3[_0x387d('0x32')],_0xefe8d3['password']);var _0x42a956={'method':_0x387d('0x39'),'uri':_0x387d('0x69')+_0xefe8d3['accountId']+'/messages','body':{'to':[_0x40dbde['phone']],'text':_0x40dbde['body'],'from':_0xefe8d3[_0x387d('0x21')],'applicationId':_0xefe8d3[_0x387d('0x6a')]},'headers':{'Authorization':util[_0x387d('0x4e')](_0x387d('0x46'),new Buffer(_0x15a415)[_0x387d('0x51')]('base64'))},'json':!![]};rp(_0x42a956)[_0x387d('0x18')](function(_0x3ee3aa){if(_0x3ee3aa['id']){var _0x55b6fa={'messageId':_0x3ee3aa['id']};return _0x288990['update'](_0x55b6fa);}else{logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0x387d('0x2e')](_0x3ee3aa,{'showHidden':![],'depth':null}));}})[_0x387d('0x2a')](function(_0x183f21){logger[_0x387d('0x1a')](_0x387d('0x2b'),'afterCreate',_0x387d('0x6b'),util['inspect'](_0x183f21,{'showHidden':![],'depth':null}));});}else{logger[_0x387d('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x387d('0x2c'),_0x387d('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x387d('0x6c'):if(_0xefe8d3[_0x387d('0x5d')]){var _0x520df3={};var _0x122442={'method':'POST','uri':_0x387d('0x6d'),'headers':{'Authorization':_0x387d('0x6e')+_0xefe8d3[_0x387d('0x5d')],'Content-Type':_0x387d('0x58')},'body':{'from':_0xefe8d3[_0x387d('0x21')],'to':_0x40dbde['phone'],'text':_0x40dbde[_0x387d('0x24')]},'json':!![]};return rp(_0x122442)[_0x387d('0x18')](function(_0x197458){if(_0x197458['code']==0xca){_0x520df3[_0x387d('0x6f')]=_0x197458;var _0xfb6ddc={'method':_0x387d('0x39'),'uri':_0x387d('0x70'),'headers':{'Authorization':'Bearer\x20'+_0xefe8d3[_0x387d('0x5d')],'Content-Type':'application/json'},'body':{'refid':_0x520df3[_0x387d('0x6f')][_0x387d('0x71')]},'json':!![]};return rp(_0xfb6ddc)['then'](function(_0x4ccec9){_0x520df3[_0x387d('0x72')]=_0x4ccec9;var _0x35a37a={'messageId':_0x520df3[_0x387d('0x6f')][_0x387d('0x71')],'read':!![]};return _0x288990[_0x387d('0x29')](_0x35a37a);});}else{return logger['error'](_0x387d('0x2b'),_0x387d('0x2c'),'intelepeer',util[_0x387d('0x2e')](_0x197458,{'showHidden':![],'depth':null}));}})[_0x387d('0x2a')](function(_0x2a6eb8){return logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x6c'),util[_0x387d('0x2e')](_0x2a6eb8,{'showHidden':![],'depth':null}));});}else{return logger[_0x387d('0x1a')](_0x387d('0x2b'),_0x387d('0x2c'),_0x387d('0x6c'),_0x387d('0x73'));}break;}}})['finally'](function(){_0x53c4a1();});}else{_0x53c4a1();}}},'charset':_0x387d('0x74'),'collate':_0x387d('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3093e39..dbf32ad 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 _0x86a7=['localhost','socket.io-emitter','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsMessage','create','body','options','CreateSmsMessage','debug','util','bluebird','../../config/utils','../../config/environment','jayson/promise','client','redis'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x86a7,0xe3));var _0x786a=function(_0x35ccde,_0xbe027){_0x35ccde=_0x35ccde-0x0;var _0xbd6110=_0x86a7[_0x35ccde];return _0xbd6110;};'use strict';var _=require('lodash');var util=require(_0x786a('0x0'));var moment=require('moment');var BPromise=require(_0x786a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x786a('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x786a('0x3'));var jayson=require(_0x786a('0x4'));var client=jayson[_0x786a('0x5')]['http']({'port':0x232a});config[_0x786a('0x6')]=_['defaults'](config[_0x786a('0x6')],{'host':_0x786a('0x7'),'port':0x18eb});var socket=require(_0x786a('0x8'))(new Redis(config['redis']));require(_0x786a('0x9'))['register'](socket);function respondWithRpcPromise(_0x2992a6,_0x58eed5,_0x19ef37){return new BPromise(function(_0xaf2d1a,_0x459bf3){return client['request'](_0x2992a6,_0x19ef37)[_0x786a('0xa')](function(_0x359168){logger[_0x786a('0xb')](_0x786a('0xc'),_0x58eed5,_0x786a('0xd'));logger['debug'](_0x786a('0xe'),_0x58eed5,'request\x20sent',JSON[_0x786a('0xf')](_0x359168));if(_0x359168[_0x786a('0x10')]){if(_0x359168[_0x786a('0x10')]['code']===0x1f4){logger[_0x786a('0x10')](_0x786a('0xc'),_0x58eed5,_0x359168[_0x786a('0x10')][_0x786a('0x11')]);return _0x459bf3(_0x359168[_0x786a('0x10')][_0x786a('0x11')]);}logger[_0x786a('0x10')](_0x786a('0xc'),_0x58eed5,_0x359168['error'][_0x786a('0x11')]);return _0xaf2d1a(_0x359168[_0x786a('0x10')][_0x786a('0x11')]);}else{logger[_0x786a('0xb')]('SmsMessage,\x20%s,\x20%s',_0x58eed5,'request\x20sent');_0xaf2d1a(_0x359168[_0x786a('0x12')][_0x786a('0x11')]);}})[_0x786a('0x13')](function(_0x4fcf0f){logger[_0x786a('0x10')](_0x786a('0xc'),_0x58eed5,_0x4fcf0f);_0x459bf3(_0x4fcf0f);});});}exports['CreateSmsMessage']=function(_0xdfb6d4){var _0x5722cf=this;return new Promise(function(_0x5608e0,_0x1092cd){return db[_0x786a('0x14')][_0x786a('0x15')](_0xdfb6d4[_0x786a('0x16')],{'raw':_0xdfb6d4[_0x786a('0x17')]?_0xdfb6d4[_0x786a('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x354f4b){logger['info'](_0x786a('0x18'),_0xdfb6d4);logger[_0x786a('0x19')](_0x786a('0x18'),_0xdfb6d4,JSON[_0x786a('0xf')](_0x354f4b));_0x5608e0(_0x354f4b);})[_0x786a('0x13')](function(_0x2f5ae7){logger[_0x786a('0x10')](_0x786a('0x18'),_0x2f5ae7[_0x786a('0x11')],_0xdfb6d4);_0x1092cd(_0x5722cf[_0x786a('0x10')](0x1f4,_0x2f5ae7['message']));});});}; \ No newline at end of file +var _0x6634=['result','CreateSmsMessage','SmsMessage','create','body','options','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0x6634,0xa7));var _0x4663=function(_0x124728,_0x463dca){_0x124728=_0x124728-0x0;var _0x8eb20f=_0x6634[_0x124728];return _0x8eb20f;};'use strict';var _=require(_0x4663('0x0'));var util=require(_0x4663('0x1'));var moment=require('moment');var BPromise=require(_0x4663('0x2'));var rs=require(_0x4663('0x3'));var fs=require('fs');var Redis=require(_0x4663('0x4'));var db=require(_0x4663('0x5'))['db'];var utils=require(_0x4663('0x6'));var logger=require(_0x4663('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4663('0x8'));var client=jayson[_0x4663('0x9')]['http']({'port':0x232a});config[_0x4663('0xa')]=_[_0x4663('0xb')](config['redis'],{'host':_0x4663('0xc'),'port':0x18eb});var socket=require(_0x4663('0xd'))(new Redis(config[_0x4663('0xa')]));require('./smsMessage.socket')[_0x4663('0xe')](socket);function respondWithRpcPromise(_0x56730f,_0xb9afd2,_0x23faad){return new BPromise(function(_0x706748,_0x39f071){return client['request'](_0x56730f,_0x23faad)[_0x4663('0xf')](function(_0x46180a){logger['info']('SmsMessage,\x20%s,\x20%s',_0xb9afd2,_0x4663('0x10'));logger[_0x4663('0x11')](_0x4663('0x12'),_0xb9afd2,_0x4663('0x10'),JSON[_0x4663('0x13')](_0x46180a));if(_0x46180a[_0x4663('0x14')]){if(_0x46180a[_0x4663('0x14')][_0x4663('0x15')]===0x1f4){logger[_0x4663('0x14')](_0x4663('0x16'),_0xb9afd2,_0x46180a[_0x4663('0x14')][_0x4663('0x17')]);return _0x39f071(_0x46180a['error'][_0x4663('0x17')]);}logger[_0x4663('0x14')](_0x4663('0x16'),_0xb9afd2,_0x46180a[_0x4663('0x14')][_0x4663('0x17')]);return _0x706748(_0x46180a[_0x4663('0x14')][_0x4663('0x17')]);}else{logger[_0x4663('0x18')]('SmsMessage,\x20%s,\x20%s',_0xb9afd2,'request\x20sent');_0x706748(_0x46180a[_0x4663('0x19')][_0x4663('0x17')]);}})['catch'](function(_0x40ee50){logger['error'](_0x4663('0x16'),_0xb9afd2,_0x40ee50);_0x39f071(_0x40ee50);});});}exports[_0x4663('0x1a')]=function(_0x3a0185){var _0x10cd65=this;return new Promise(function(_0x36366c,_0x1fb6f0){return db[_0x4663('0x1b')][_0x4663('0x1c')](_0x3a0185[_0x4663('0x1d')],{'raw':_0x3a0185[_0x4663('0x1e')]?_0x3a0185[_0x4663('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x4663('0xf')](function(_0x2886e6){logger[_0x4663('0x18')](_0x4663('0x1a'),_0x3a0185);logger['debug'](_0x4663('0x1a'),_0x3a0185,JSON[_0x4663('0x13')](_0x2886e6));_0x36366c(_0x2886e6);})[_0x4663('0x1f')](function(_0x4a836a){logger['error'](_0x4663('0x1a'),_0x4a836a[_0x4663('0x17')],_0x3a0185);_0x1fb6f0(_0x10cd65[_0x4663('0x14')](0x1f4,_0x4a836a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 0cab2b2..140c7c1 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 _0x0a72=['./smsMessage.events','save','remove','emit','removeListener','register','length','smsMessage:'];(function(_0x43d31b,_0x670376){var _0x5541c8=function(_0x1bca5d){while(--_0x1bca5d){_0x43d31b['push'](_0x43d31b['shift']());}};_0x5541c8(++_0x670376);}(_0x0a72,0x188));var _0x20a7=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x0a72[_0x3b5250];return _0xc844a1;};'use strict';var SmsMessageEvents=require(_0x20a7('0x0'));var events=[_0x20a7('0x1'),_0x20a7('0x2'),'update'];function createListener(_0x206be0,_0x43b28f){return function(_0xff08f5){_0x43b28f[_0x20a7('0x3')](_0x206be0,_0xff08f5);};}function removeListener(_0x2cb319,_0x143446){return function(){SmsMessageEvents[_0x20a7('0x4')](_0x2cb319,_0x143446);};}exports[_0x20a7('0x5')]=function(_0x3412a2){for(var _0x2b83c8=0x0,_0x3b5a27=events[_0x20a7('0x6')];_0x2b83c8<_0x3b5a27;_0x2b83c8++){var _0x18f2f6=events[_0x2b83c8];var _0x76c773=createListener(_0x20a7('0x7')+_0x18f2f6,_0x3412a2);SmsMessageEvents['on'](_0x18f2f6,_0x76c773);}}; \ No newline at end of file +var _0x939d=['smsMessage:','save','remove','update','emit','removeListener','length'];(function(_0x5ea9e6,_0x313a3c){var _0x253f39=function(_0x4f19d0){while(--_0x4f19d0){_0x5ea9e6['push'](_0x5ea9e6['shift']());}};_0x253f39(++_0x313a3c);}(_0x939d,0xe1));var _0xd939=function(_0xe4aac0,_0xf9f835){_0xe4aac0=_0xe4aac0-0x0;var _0x8e6a09=_0x939d[_0xe4aac0];return _0x8e6a09;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xd939('0x0'),_0xd939('0x1'),_0xd939('0x2')];function createListener(_0x36e29d,_0x5d0654){return function(_0x1489d8){_0x5d0654[_0xd939('0x3')](_0x36e29d,_0x1489d8);};}function removeListener(_0x383fc3,_0x28f3a2){return function(){SmsMessageEvents[_0xd939('0x4')](_0x383fc3,_0x28f3a2);};}exports['register']=function(_0x8e1047){for(var _0x1cf05d=0x0,_0x11c62b=events[_0xd939('0x5')];_0x1cf05d<_0x11c62b;_0x1cf05d++){var _0x5a9a21=events[_0x1cf05d];var _0x7a6377=createListener(_0xd939('0x6')+_0x5a9a21,_0x8e1047);SmsMessageEvents['on'](_0x5a9a21,_0x7a6377);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9711520..cabc77e 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 _0x7062=['isAuthenticated','index','/describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./smsQueue.controller','get'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x7062,0xbc));var _0x2706=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7062[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2706('0x0'));var util=require(_0x2706('0x1'));var path=require(_0x2706('0x2'));var timeout=require(_0x2706('0x3'));var express=require(_0x2706('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2706('0x5'));var config=require('../../config/environment');var controller=require(_0x2706('0x6'));router[_0x2706('0x7')]('/',auth[_0x2706('0x8')](),controller[_0x2706('0x9')]);router[_0x2706('0x7')](_0x2706('0xa'),auth[_0x2706('0x8')](),controller['describe']);router[_0x2706('0x7')]('/:id',auth[_0x2706('0x8')](),controller[_0x2706('0xb')]);router['get']('/:id/members',auth[_0x2706('0x8')](),controller[_0x2706('0xc')]);router[_0x2706('0x7')](_0x2706('0xd'),auth[_0x2706('0x8')](),controller[_0x2706('0xe')]);router[_0x2706('0x7')](_0x2706('0xf'),auth[_0x2706('0x8')](),controller[_0x2706('0x10')]);router[_0x2706('0x11')]('/',auth[_0x2706('0x8')](),controller['create']);router['post'](_0x2706('0xd'),auth[_0x2706('0x8')](),controller[_0x2706('0x12')]);router['post'](_0x2706('0xf'),auth[_0x2706('0x8')](),controller[_0x2706('0x13')]);router[_0x2706('0x14')](_0x2706('0x15'),auth[_0x2706('0x8')](),controller[_0x2706('0x16')]);router['delete'](_0x2706('0x15'),auth[_0x2706('0x8')](),controller[_0x2706('0x17')]);router[_0x2706('0x18')](_0x2706('0xd'),auth['isAuthenticated'](),controller[_0x2706('0x19')]);router['delete'](_0x2706('0xf'),auth['isAuthenticated'](),controller[_0x2706('0x1a')]);module[_0x2706('0x1b')]=router; \ No newline at end of file +var _0x1f23=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','put','destroy','delete','removeTeams','exports','util'];(function(_0xe91e1b,_0x1aaa97){var _0x1b81f8=function(_0x5473df){while(--_0x5473df){_0xe91e1b['push'](_0xe91e1b['shift']());}};_0x1b81f8(++_0x1aaa97);}(_0x1f23,0x179));var _0x31f2=function(_0x5b0b6d,_0x20e089){_0x5b0b6d=_0x5b0b6d-0x0;var _0x38a893=_0x1f23[_0x5b0b6d];return _0x38a893;};'use strict';var multer=require('multer');var util=require(_0x31f2('0x0'));var path=require(_0x31f2('0x1'));var timeout=require(_0x31f2('0x2'));var express=require(_0x31f2('0x3'));var router=express[_0x31f2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x31f2('0x5'));var config=require(_0x31f2('0x6'));var controller=require(_0x31f2('0x7'));router[_0x31f2('0x8')]('/',auth['isAuthenticated'](),controller[_0x31f2('0x9')]);router['get'](_0x31f2('0xa'),auth['isAuthenticated'](),controller[_0x31f2('0xb')]);router['get'](_0x31f2('0xc'),auth[_0x31f2('0xd')](),controller['show']);router[_0x31f2('0x8')](_0x31f2('0xe'),auth[_0x31f2('0xd')](),controller[_0x31f2('0xf')]);router[_0x31f2('0x8')](_0x31f2('0x10'),auth[_0x31f2('0xd')](),controller[_0x31f2('0x11')]);router[_0x31f2('0x8')](_0x31f2('0x12'),auth[_0x31f2('0xd')](),controller['getAgents']);router['post']('/',auth[_0x31f2('0xd')](),controller[_0x31f2('0x13')]);router[_0x31f2('0x14')]('/:id/teams',auth[_0x31f2('0xd')](),controller[_0x31f2('0x15')]);router[_0x31f2('0x14')]('/:id/users',auth[_0x31f2('0xd')](),controller['addAgents']);router[_0x31f2('0x16')]('/:id',auth[_0x31f2('0xd')](),controller['update']);router['delete'](_0x31f2('0xc'),auth[_0x31f2('0xd')](),controller[_0x31f2('0x17')]);router[_0x31f2('0x18')](_0x31f2('0x10'),auth[_0x31f2('0xd')](),controller[_0x31f2('0x19')]);router[_0x31f2('0x18')](_0x31f2('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x31f2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 7113285..b31fa9a 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 _0xfb0c=['exports','INTEGER','ENUM','beepall','roundrobin'];(function(_0x29f227,_0x1f4086){var _0x5e58bd=function(_0x96e696){while(--_0x96e696){_0x29f227['push'](_0x29f227['shift']());}};_0x5e58bd(++_0x1f4086);}(_0xfb0c,0xfa));var _0xcfb0=function(_0x58f68f,_0x439bf0){_0x58f68f=_0x58f68f-0x0;var _0x18a39b=_0xfb0c[_0x58f68f];return _0x18a39b;};'use strict';var Sequelize=require('sequelize');module[_0xcfb0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xcfb0('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcfb0('0x2')]('rrmemory',_0xcfb0('0x3'),_0xcfb0('0x4'))}}; \ No newline at end of file +var _0x3da1=['name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x2bba48,_0x2d6269){var _0x3e3552=function(_0x59a41f){while(--_0x59a41f){_0x2bba48['push'](_0x2bba48['shift']());}};_0x3e3552(++_0x2d6269);}(_0x3da1,0x14b));var _0x13da=function(_0x7ec790,_0x45113d){_0x7ec790=_0x7ec790-0x0;var _0x50e134=_0x3da1[_0x7ec790];return _0x50e134;};'use strict';var Sequelize=require(_0x13da('0x0'));module[_0x13da('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x13da('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x13da('0x3')]},'timeout':{'type':Sequelize[_0x13da('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x13da('0x5')](_0x13da('0x6'),_0x13da('0x7'),_0x13da('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 6f62d4f..049a86f 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 _0x342e=['removeAgents','userSmsQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','SmsQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','count','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','%s/%s','SIP','createdAt','Team','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','field','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','all','compact','value','ids'];(function(_0x42e878,_0x1a7e67){var _0x126fca=function(_0x3b4b0b){while(--_0x3b4b0b){_0x42e878['push'](_0x42e878['shift']());}};_0x126fca(++_0x1a7e67);}(_0x342e,0x19e));var _0xe342=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0x342e[_0x27031e];return _0xfd46b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe342('0x0'));var zipdir=require(_0xe342('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe342('0x2'));var moment=require(_0xe342('0x3'));var BPromise=require(_0xe342('0x4'));var Mustache=require(_0xe342('0x5'));var util=require(_0xe342('0x6'));var path=require(_0xe342('0x7'));var sox=require(_0xe342('0x8'));var csv=require(_0xe342('0x9'));var ejs=require(_0xe342('0xa'));var fs=require('fs');var fs_extra=require(_0xe342('0xb'));var _=require(_0xe342('0xc'));var squel=require(_0xe342('0xd'));var crypto=require(_0xe342('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe342('0xf'));var Papa=require(_0xe342('0x10'));var Redis=require(_0xe342('0x11'));var authService=require(_0xe342('0x12'));var qs=require(_0xe342('0x13'));var as=require(_0xe342('0x14'));var hardwareService=require(_0xe342('0x15'));var logger=require('../../config/logger')(_0xe342('0x16'));var utils=require('../../config/utils');var config=require(_0xe342('0x17'));var licenseUtil=require(_0xe342('0x18'));var db=require(_0xe342('0x19'))['db'];config['redis']=_[_0xe342('0x1a')](config[_0xe342('0x1b')],{'host':_0xe342('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe342('0x1b')]));require('./smsQueue.socket')[_0xe342('0x1d')](socket);function respondWithStatusCode(_0x2a7e45,_0x1dfc13){_0x1dfc13=_0x1dfc13||0xcc;return function(_0x2805f9){if(_0x2805f9){return _0x2a7e45[_0xe342('0x1e')](_0x1dfc13);}return _0x2a7e45[_0xe342('0x1f')](_0x1dfc13)['end']();};}function respondWithResult(_0x243164,_0x2acd85){_0x2acd85=_0x2acd85||0xc8;return function(_0xc33ee5){if(_0xc33ee5){return _0x243164['status'](_0x2acd85)['json'](_0xc33ee5);}};}function respondWithFilteredResult(_0x598930,_0x7b75d4){return function(_0x20c3da){if(_0x20c3da){var _0x33e5e1=typeof _0x7b75d4[_0xe342('0x20')]===_0xe342('0x21')&&typeof _0x7b75d4[_0xe342('0x22')]===_0xe342('0x21');var _0x4ec583=_0x20c3da['count'];var _0x51a3d1=_0x33e5e1?0x0:_0x7b75d4[_0xe342('0x20')];var _0x270de1=_0x33e5e1?_0x20c3da['count']:_0x7b75d4['offset']+_0x7b75d4[_0xe342('0x22')];var _0x3f60bb;if(_0x270de1>=_0x4ec583){_0x270de1=_0x4ec583;_0x3f60bb=0xc8;}else{_0x3f60bb=0xce;}_0x598930[_0xe342('0x1f')](_0x3f60bb);return _0x598930[_0xe342('0x23')](_0xe342('0x24'),_0x51a3d1+'-'+_0x270de1+'/'+_0x4ec583)['json'](_0x20c3da);}return null;};}function patchUpdates(_0x5b501f){return function(_0x1d74d9){try{jsonpatch[_0xe342('0x25')](_0x1d74d9,_0x5b501f,!![]);}catch(_0x50763a){return BPromise['reject'](_0x50763a);}return _0x1d74d9[_0xe342('0x26')]();};}function saveUpdates(_0x527916,_0x6192c1){return function(_0x3e08b7){if(_0x3e08b7){return _0x3e08b7[_0xe342('0x27')](_0x527916)[_0xe342('0x28')](function(_0x102478){return _0x102478;});}return null;};}function removeEntity(_0x1b9d8e,_0x2716be){return function(_0x21ddd7){if(_0x21ddd7){return _0x21ddd7[_0xe342('0x29')]()['then'](function(){var _0x1471e4=_0x21ddd7[_0xe342('0x2a')]({'plain':!![]});var _0x18e958='SmsQueues';return db[_0xe342('0x2b')][_0xe342('0x29')]({'where':{'type':_0x18e958,'resourceId':_0x1471e4['id']}})[_0xe342('0x28')](function(){return _0x21ddd7;});})['then'](function(){_0x1b9d8e[_0xe342('0x1f')](0xcc)[_0xe342('0x2c')]();});}};}function handleEntityNotFound(_0x49713a,_0x261099){return function(_0xeb98f1){if(!_0xeb98f1){_0x49713a['sendStatus'](0x194);}return _0xeb98f1;};}function handleError(_0x1e0d7d,_0x24d4f7){_0x24d4f7=_0x24d4f7||0x1f4;return function(_0x41d3b1){logger[_0xe342('0x2d')](_0x41d3b1[_0xe342('0x2e')]);if(_0x41d3b1['name']){delete _0x41d3b1[_0xe342('0x2f')];}_0x1e0d7d[_0xe342('0x1f')](_0x24d4f7)[_0xe342('0x30')](_0x41d3b1);};}exports['index']=function(_0x3b33fa,_0x436df6){var _0x216184={},_0x1320ec={},_0x29eaee={'count':0x0,'rows':[]};var _0x52d723=_[_0xe342('0x31')](db[_0xe342('0x32')][_0xe342('0x33')],function(_0x350da5){return{'name':_0x350da5['fieldName'],'type':_0x350da5[_0xe342('0x34')][_0xe342('0x35')]};});_0x1320ec[_0xe342('0x36')]=_[_0xe342('0x31')](_0x52d723,'name');_0x1320ec[_0xe342('0x37')]=_[_0xe342('0x38')](_0x3b33fa['query']);_0x1320ec[_0xe342('0x39')]=_[_0xe342('0x3a')](_0x1320ec['model'],_0x1320ec['query']);_0x216184[_0xe342('0x3b')]=_[_0xe342('0x3a')](_0x1320ec['model'],qs[_0xe342('0x3c')](_0x3b33fa[_0xe342('0x37')][_0xe342('0x3c')]));_0x216184['attributes']=_0x216184[_0xe342('0x3b')]['length']?_0x216184[_0xe342('0x3b')]:_0x1320ec['model'];if(!_0x3b33fa['query'][_0xe342('0x3d')](_0xe342('0x3e'))){_0x216184[_0xe342('0x22')]=qs[_0xe342('0x22')](_0x3b33fa[_0xe342('0x37')]['limit']);_0x216184[_0xe342('0x20')]=qs[_0xe342('0x20')](_0x3b33fa[_0xe342('0x37')]['offset']);}_0x216184['order']=qs[_0xe342('0x3f')](_0x3b33fa[_0xe342('0x37')]['sort']);_0x216184[_0xe342('0x40')]=qs[_0xe342('0x39')](_[_0xe342('0x41')](_0x3b33fa[_0xe342('0x37')],_0x1320ec['filters']),_0x52d723);if(_0x3b33fa[_0xe342('0x37')]['filter']){_0x216184[_0xe342('0x40')]=_[_0xe342('0x42')](_0x216184[_0xe342('0x40')],{'$or':_[_0xe342('0x31')](_0x52d723,function(_0x34e9f4){if(_0x34e9f4['type']!=='VIRTUAL'){var _0x487176={};_0x487176[_0x34e9f4[_0xe342('0x2f')]]={'$like':'%'+_0x3b33fa['query'][_0xe342('0x43')]+'%'};return _0x487176;}})});}_0x216184=_[_0xe342('0x42')]({},_0x216184,_0x3b33fa[_0xe342('0x44')]);var _0x3fb272={'where':_0x216184['where']};return db['SmsQueue']['count'](_0x3fb272)[_0xe342('0x28')](function(_0x22b3ba){_0x29eaee[_0xe342('0x45')]=_0x22b3ba;if(_0x3b33fa[_0xe342('0x37')][_0xe342('0x46')]){_0x216184[_0xe342('0x47')]=[{'all':!![]}];}return db[_0xe342('0x32')][_0xe342('0x48')](_0x216184);})['then'](function(_0x3df02c){_0x29eaee['rows']=_0x3df02c;return _0x29eaee;})[_0xe342('0x28')](respondWithFilteredResult(_0x436df6,_0x216184))[_0xe342('0x49')](handleError(_0x436df6,null));};exports[_0xe342('0x4a')]=function(_0x9228c2,_0x30e66a){var _0x42966f={'raw':!![],'where':{'id':_0x9228c2[_0xe342('0x4b')]['id']}},_0x43d480={};_0x43d480[_0xe342('0x36')]=_['keys'](db['SmsQueue'][_0xe342('0x33')]);_0x43d480[_0xe342('0x37')]=_[_0xe342('0x38')](_0x9228c2['query']);_0x43d480[_0xe342('0x39')]=_[_0xe342('0x3a')](_0x43d480[_0xe342('0x36')],_0x43d480[_0xe342('0x37')]);_0x42966f[_0xe342('0x3b')]=_[_0xe342('0x3a')](_0x43d480[_0xe342('0x36')],qs[_0xe342('0x3c')](_0x9228c2['query'][_0xe342('0x3c')]));_0x42966f[_0xe342('0x3b')]=_0x42966f['attributes'][_0xe342('0x4c')]?_0x42966f[_0xe342('0x3b')]:_0x43d480[_0xe342('0x36')];if(_0x9228c2['query'][_0xe342('0x46')]){_0x42966f[_0xe342('0x47')]=[{'all':!![]}];}_0x42966f=_['merge']({},_0x42966f,_0x9228c2[_0xe342('0x44')]);return db[_0xe342('0x32')][_0xe342('0x4d')](_0x42966f)[_0xe342('0x28')](handleEntityNotFound(_0x30e66a,null))[_0xe342('0x28')](respondWithResult(_0x30e66a,null))['catch'](handleError(_0x30e66a,null));};exports['create']=function(_0x1217f4,_0x2fa6cc){return db[_0xe342('0x32')][_0xe342('0x4e')](_0x1217f4[_0xe342('0x4f')],{})[_0xe342('0x28')](function(_0x54117c){var _0x53beb2=_0x1217f4[_0xe342('0x50')][_0xe342('0x2a')]({'plain':!![]});if(!_0x53beb2)throw new Error(_0xe342('0x51'));if(_0x53beb2['role']===_0xe342('0x50')){var _0x476225=_0x54117c[_0xe342('0x2a')]({'plain':!![]});var _0x3a21b6='SmsQueues';return db[_0xe342('0x52')][_0xe342('0x4d')]({'where':{'name':_0x3a21b6,'userProfileId':_0x53beb2['userProfileId']},'raw':!![]})[_0xe342('0x28')](function(_0x4d2d97){if(_0x4d2d97&&_0x4d2d97[_0xe342('0x53')]===0x0){return db['UserProfileResource'][_0xe342('0x4e')]({'name':_0x476225[_0xe342('0x2f')],'resourceId':_0x476225['id'],'type':_0x4d2d97[_0xe342('0x2f')],'sectionId':_0x4d2d97['id']},{})[_0xe342('0x28')](function(){return _0x54117c;});}else{return _0x54117c;}})['catch'](function(_0xe2f6cb){logger[_0xe342('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe2f6cb);throw _0xe2f6cb;});}return _0x54117c;})[_0xe342('0x28')](respondWithResult(_0x2fa6cc,0xc9))[_0xe342('0x49')](handleError(_0x2fa6cc,null));};exports[_0xe342('0x27')]=function(_0x3fc23a,_0x1f86b9){if(_0x3fc23a[_0xe342('0x4f')]['id']){delete _0x3fc23a[_0xe342('0x4f')]['id'];}return db[_0xe342('0x32')][_0xe342('0x4d')]({'where':{'id':_0x3fc23a[_0xe342('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1f86b9,null))[_0xe342('0x28')](saveUpdates(_0x3fc23a[_0xe342('0x4f')],null))[_0xe342('0x28')](respondWithResult(_0x1f86b9,null))[_0xe342('0x49')](handleError(_0x1f86b9,null));};exports[_0xe342('0x29')]=function(_0x21cc08,_0x190f35){return db[_0xe342('0x32')][_0xe342('0x4d')]({'where':{'id':_0x21cc08[_0xe342('0x4b')]['id']}})[_0xe342('0x28')](handleEntityNotFound(_0x190f35,null))[_0xe342('0x28')](removeEntity(_0x190f35,null))[_0xe342('0x49')](handleError(_0x190f35,null));};exports[_0xe342('0x54')]=function(_0x1ea47e,_0x33375a){return db['SmsQueue'][_0xe342('0x54')]()[_0xe342('0x28')](respondWithResult(_0x33375a,null))['catch'](handleError(_0x33375a,null));};exports[_0xe342('0x55')]=function(_0x14b08f,_0x2d7f89,_0x3249b2){var _0x25f905={'raw':!![],'where':{}},_0x381e02={},_0xb364ff;return db[_0xe342('0x32')][_0xe342('0x56')]({'where':{'id':_0x14b08f[_0xe342('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d7f89,null))[_0xe342('0x28')](function(_0x182d2a){if(_0x182d2a){_0xb364ff=_0x182d2a[_0xe342('0x2a')]({'plain':!![]});_0x381e02['model']=_['keys'](db[_0xe342('0x57')][_0xe342('0x33')]);_0x381e02[_0xe342('0x37')]=_[_0xe342('0x38')](_0x14b08f['query']);_0x381e02[_0xe342('0x39')]=_[_0xe342('0x3a')](_0x381e02[_0xe342('0x36')],_0x381e02[_0xe342('0x37')]);_0x25f905[_0xe342('0x3b')]=_[_0xe342('0x3a')](_0x381e02[_0xe342('0x36')],qs[_0xe342('0x3c')](_0x14b08f[_0xe342('0x37')]['fields']));_0x25f905[_0xe342('0x3b')]=_0x25f905['attributes'][_0xe342('0x4c')]?_0x25f905[_0xe342('0x3b')]:_0x381e02[_0xe342('0x36')];if(!_0x14b08f[_0xe342('0x37')][_0xe342('0x3d')](_0xe342('0x3e'))){_0x25f905[_0xe342('0x22')]=qs[_0xe342('0x22')](_0x14b08f[_0xe342('0x37')][_0xe342('0x22')]);_0x25f905[_0xe342('0x20')]=qs[_0xe342('0x20')](_0x14b08f[_0xe342('0x37')]['offset']);}_0x25f905[_0xe342('0x58')]=qs[_0xe342('0x3f')](_0x14b08f[_0xe342('0x37')][_0xe342('0x3f')]);_0x25f905[_0xe342('0x40')]=qs[_0xe342('0x39')](_['pick'](_0x14b08f[_0xe342('0x37')],_0x381e02['filters']));_0x25f905[_0xe342('0x40')][_0xe342('0x59')]=_0x182d2a['id'];if(_0x14b08f[_0xe342('0x37')]['filter']){_0x25f905[_0xe342('0x40')]=_[_0xe342('0x42')](_0x25f905[_0xe342('0x40')],{'$or':_['map'](_0x25f905[_0xe342('0x3b')],function(_0x23e791){var _0x4971a2={};_0x4971a2[_0x23e791]={'$like':'%'+_0x14b08f[_0xe342('0x37')][_0xe342('0x43')]+'%'};return _0x4971a2;})});}_0x25f905=_[_0xe342('0x42')]({},_0x25f905,_0x14b08f['options']);return db[_0xe342('0x57')]['findAll'](_0x25f905);}})[_0xe342('0x28')](function(_0x11d8d7){if(_0x11d8d7){return db['User'][_0xe342('0x5a')]({'where':{'id':_[_0xe342('0x31')](_0x11d8d7,_0xe342('0x5b')),'role':_0xe342('0x5c')},'attributes':['id',_0xe342('0x2f'),_0xe342('0x5d'),_0xe342('0x5e'),'createdAt']});}})[_0xe342('0x28')](function(_0x51957b){if(_0x51957b){return{'count':_0x51957b['count'],'rows':_[_0xe342('0x31')](_0x51957b['rows'],function(_0x574921){return{'membername':_0x574921[_0xe342('0x2f')],'UserId':_0x574921['id'],'queue_name':_0xb364ff[_0xe342('0x2f')],'SmsQueueId':_0xb364ff['id'],'interface':util['format'](_0xe342('0x5f'),_0xe342('0x60'),_0x574921['name']),'penalty':0x0,'paused':_0x574921[_0xe342('0x5d')],'createdAt':_0x574921[_0xe342('0x61')],'updatedAt':_0x574921[_0xe342('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe342('0x28')](respondWithFilteredResult(_0x2d7f89,_0x25f905))[_0xe342('0x49')](handleError(_0x2d7f89,null));};exports['getTeams']=function(_0x5618a8,_0x546028,_0x45b0dd){var _0x4c77b5={};var _0x5db72b={};var _0x1fdca2;var _0x4dfab5;return db[_0xe342('0x32')][_0xe342('0x56')]({'where':{'id':_0x5618a8['params']['id']}})[_0xe342('0x28')](handleEntityNotFound(_0x546028,null))[_0xe342('0x28')](function(_0x579d32){if(_0x579d32){_0x1fdca2=_0x579d32;_0x5db72b[_0xe342('0x36')]=_[_0xe342('0x38')](db[_0xe342('0x62')][_0xe342('0x33')]);_0x5db72b[_0xe342('0x37')]=_[_0xe342('0x38')](_0x5618a8[_0xe342('0x37')]);_0x5db72b['filters']=_['intersection'](_0x5db72b[_0xe342('0x36')],_0x5db72b[_0xe342('0x37')]);_0x4c77b5['attributes']=_[_0xe342('0x3a')](_0x5db72b[_0xe342('0x36')],qs[_0xe342('0x3c')](_0x5618a8[_0xe342('0x37')]['fields']));_0x4c77b5[_0xe342('0x3b')]=_0x4c77b5[_0xe342('0x3b')][_0xe342('0x4c')]?_0x4c77b5[_0xe342('0x3b')]:_0x5db72b[_0xe342('0x36')];_0x4c77b5[_0xe342('0x58')]=qs[_0xe342('0x3f')](_0x5618a8[_0xe342('0x37')][_0xe342('0x3f')]);_0x4c77b5[_0xe342('0x40')]=qs['filters'](_['pick'](_0x5618a8['query'],_0x5db72b['filters']));if(_0x5618a8[_0xe342('0x37')][_0xe342('0x43')]){_0x4c77b5[_0xe342('0x40')]=_['merge'](_0x4c77b5[_0xe342('0x40')],{'$or':_['map'](_0x4c77b5['attributes'],function(_0x8c3c1a){var _0x38380e={};_0x38380e[_0x8c3c1a]={'$like':'%'+_0x5618a8['query'][_0xe342('0x43')]+'%'};return _0x38380e;})});}_0x4c77b5=_['merge']({},_0x4c77b5,_0x5618a8[_0xe342('0x44')]);return _0x1fdca2[_0xe342('0x63')](_0x4c77b5);}})[_0xe342('0x28')](function(_0x5296d5){if(_0x5296d5){_0x4dfab5=_0x5296d5[_0xe342('0x4c')];if(!_0x5618a8['query'][_0xe342('0x3d')](_0xe342('0x3e'))){_0x4c77b5[_0xe342('0x22')]=qs[_0xe342('0x22')](_0x5618a8[_0xe342('0x37')]['limit']);_0x4c77b5[_0xe342('0x20')]=qs[_0xe342('0x20')](_0x5618a8[_0xe342('0x37')]['offset']);}return _0x1fdca2['getTeams'](_0x4c77b5);}})[_0xe342('0x28')](function(_0x4c5d37){if(_0x4c5d37){return _0x4c5d37?{'count':_0x4dfab5,'rows':_0x4c5d37}:null;}})[_0xe342('0x28')](respondWithResult(_0x546028,null))[_0xe342('0x49')](handleError(_0x546028,null));};exports[_0xe342('0x64')]=function(_0x3dba96,_0x13861b,_0x3db306){var _0x3e3865=_0x3dba96[_0xe342('0x4f')]['ids'];return db[_0xe342('0x62')][_0xe342('0x48')]({'where':{'id':_0x3e3865},'attributes':['id'],'include':[{'model':db[_0xe342('0x65')],'as':_0xe342('0x66'),'attributes':['id',_0xe342('0x2f'),_0xe342('0x67'),_0xe342('0x68'),_0xe342('0x69')],'raw':!![]}]})['then'](function(_0x5a330f){if(_0x5a330f){var _0x5e01b8=_[_0xe342('0x6a')](_0x5a330f,function(_0x49376a){var _0x432fe5=_0x49376a[_0xe342('0x2a')]({'plain':!![]});return _0x432fe5[_0xe342('0x66')];});return db[_0xe342('0x32')][_0xe342('0x4d')]({'where':{'id':_0x3dba96['params']['id']}})[_0xe342('0x28')](function(_0x1ef6e2){return db['sequelize'][_0xe342('0x6b')](function(_0x14df33){return _0x1ef6e2['addTeams'](_0x3e3865,{'transaction':_0x14df33})[_0xe342('0x28')](function(){return BPromise[_0xe342('0x6c')](_0x5e01b8,function(_0x59f359){return db[_0xe342('0x57')]['findOrCreate']({'where':{'UserId':_0x59f359['id'],'SmsQueueId':_0x3dba96['params']['id']},'transaction':_0x14df33});});})[_0xe342('0x28')](function(){_0x5e01b8[_0xe342('0x6d')](function(_0xb50731){socket[_0xe342('0x6e')](_0xe342('0x6f'),{'UserId':_0xb50731['id'],'SmsQueueId':_0x1ef6e2['id']});});});});});}})[_0xe342('0x28')](respondWithStatusCode(_0x13861b,null))[_0xe342('0x49')](handleError(_0x13861b,null));};exports[_0xe342('0x70')]=function(_0x36abf8,_0xcad985,_0x36e27d){return db[_0xe342('0x62')][_0xe342('0x48')]({'where':{'id':_0x36abf8['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe342('0x65')],'as':_0xe342('0x66'),'attributes':['id'],'raw':!![]}]})[_0xe342('0x28')](handleEntityNotFound(_0xcad985,null))['then'](function(_0x569db7){var _0x365ef1=_[_0xe342('0x31')](_0x569db7,'id');var _0x1f8b46=[];var _0x5c8446=[];var _0x865cbb=squel['select']();_0x865cbb[_0xe342('0x71')]('tq.TeamId')['from'](_0xe342('0x72'),'tq')[_0xe342('0x73')](_0xe342('0x74'),'ut',_0xe342('0x75'))[_0xe342('0x40')](_0xe342('0x76'),_0x36abf8[_0xe342('0x4b')]['id']);for(var _0x56b508=0x0;_0x56b508<_0x569db7[_0xe342('0x4c')];_0x56b508+=0x1){let _0x345e92=_0x569db7[_0x56b508];for(var _0x488e29=0x0;_0x488e29<_0x345e92[_0xe342('0x66')][_0xe342('0x4c')];_0x488e29+=0x1){let _0x4a4725=_0x345e92[_0xe342('0x66')][_0x488e29];var _0x1c8b20=_0x865cbb[_0xe342('0x77')]();_0x1c8b20[_0xe342('0x40')](_0xe342('0x78'),_0x4a4725['id']);_0x5c8446[_0xe342('0x79')](db[_0xe342('0x7a')][_0xe342('0x37')](_0x1c8b20['toString'](),{'type':db[_0xe342('0x7a')]['QueryTypes'][_0xe342('0x7b')]})[_0xe342('0x28')](function(_0x2cd5aa){if(_0x2cd5aa[_0xe342('0x4c')]===0x1){return _0x4a4725['id'];}else{var _0x5b3057=_[_0xe342('0x7c')](_[_0xe342('0x31')](_0x2cd5aa,_0xe342('0x7d')),function(_0x25aa4f){return _['includes'](_0x365ef1,_0x25aa4f);});if(_0x5b3057){return _0x4a4725['id'];}}}));}}return BPromise[_0xe342('0x7e')](_0x5c8446)[_0xe342('0x28')](function(_0x4e1970){_0x1f8b46=_(_0x1f8b46)['union'](_0x4e1970)[_0xe342('0x7f')]()[_0xe342('0x80')]();return db[_0xe342('0x32')][_0xe342('0x4d')]({'where':{'id':_0x36abf8['params']['id']}})[_0xe342('0x28')](function(_0x2f2cc1){return db[_0xe342('0x7a')][_0xe342('0x6b')](function(_0x3229f0){return _0x2f2cc1[_0xe342('0x70')](_0x36abf8['query'][_0xe342('0x81')],{'transaction':_0x3229f0})[_0xe342('0x28')](function(){if(!_['isEmpty'](_0x1f8b46)){return _0x2f2cc1[_0xe342('0x82')](_0x1f8b46,{'transaction':_0x3229f0});}})[_0xe342('0x28')](function(){_0x1f8b46[_0xe342('0x6d')](function(_0x1efac1){socket[_0xe342('0x6e')](_0xe342('0x83'),{'UserId':_0x1efac1,'SmsQueueId':_0x2f2cc1['id']});});});});});});})[_0xe342('0x28')](respondWithStatusCode(_0xcad985,null))['catch'](handleError(_0xcad985,null));};exports[_0xe342('0x84')]=function(_0x4d37b6,_0x2d5edc,_0x4ca3ac){return db[_0xe342('0x32')][_0xe342('0x4d')]({'where':{'id':_0x4d37b6[_0xe342('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d5edc,null))[_0xe342('0x28')](function(_0x5de170){if(_0x5de170){return _0x5de170['addAgents'](_0x4d37b6[_0xe342('0x4f')]['ids'],_['omit'](_0x4d37b6[_0xe342('0x4f')],[_0xe342('0x81'),'id'])||{})[_0xe342('0x85')](function(_0x4ac9f2){for(var _0xad0f18=0x0;_0xad0f18<_0x4d37b6['body'][_0xe342('0x81')][_0xe342('0x4c')];_0xad0f18+=0x1){socket[_0xe342('0x6e')]('userSmsQueue:save',{'UserId':Number(_0x4d37b6[_0xe342('0x4f')][_0xe342('0x81')][_0xad0f18]),'SmsQueueId':Number(_0x4d37b6[_0xe342('0x4b')]['id'])});}return _0x4ac9f2;});}})['then'](respondWithResult(_0x2d5edc,null))[_0xe342('0x49')](handleError(_0x2d5edc,null));};exports[_0xe342('0x82')]=function(_0x5ffbcf,_0x453f9e,_0x105741){return db[_0xe342('0x32')]['find']({'where':{'id':_0x5ffbcf[_0xe342('0x4b')]['id']}})[_0xe342('0x28')](handleEntityNotFound(_0x453f9e,null))['then'](function(_0x57a6a5){if(_0x57a6a5){return _0x57a6a5['removeAgents'](_0x5ffbcf['query'][_0xe342('0x81')])[_0xe342('0x28')](function(){if(_[_0xe342('0x86')](_0x5ffbcf[_0xe342('0x37')][_0xe342('0x81')])){for(var _0x4649bb=0x0;_0x4649bb<_0x5ffbcf[_0xe342('0x37')]['ids'][_0xe342('0x4c')];_0x4649bb+=0x1){socket[_0xe342('0x6e')](_0xe342('0x83'),{'UserId':Number(_0x5ffbcf[_0xe342('0x37')][_0xe342('0x81')][_0x4649bb]),'SmsQueueId':Number(_0x5ffbcf[_0xe342('0x4b')]['id'])});}}else{socket[_0xe342('0x6e')](_0xe342('0x83'),{'UserId':Number(_0x5ffbcf['query']['ids']),'SmsQueueId':Number(_0x5ffbcf[_0xe342('0x4b')]['id'])});}});}})[_0xe342('0x28')](respondWithStatusCode(_0x453f9e,null))[_0xe342('0x49')](handleError(_0x453f9e,null));};exports[_0xe342('0x87')]=function(_0xfd1d37,_0x330f83,_0x5731e7){var _0x4c3ded={};var _0x3b98f6={};var _0x50fefd;var _0x3fa067;return db[_0xe342('0x32')][_0xe342('0x56')]({'where':{'id':_0xfd1d37['params']['id']}})[_0xe342('0x28')](handleEntityNotFound(_0x330f83,null))['then'](function(_0x56d765){if(_0x56d765){_0x50fefd=_0x56d765;_0x3b98f6[_0xe342('0x36')]=_[_0xe342('0x38')](db['User'][_0xe342('0x33')]);_0x3b98f6[_0xe342('0x37')]=_[_0xe342('0x38')](_0xfd1d37['query']);_0x3b98f6['filters']=_['intersection'](_0x3b98f6['model'],_0x3b98f6[_0xe342('0x37')]);_0x4c3ded['attributes']=_[_0xe342('0x3a')](_0x3b98f6[_0xe342('0x36')],qs[_0xe342('0x3c')](_0xfd1d37[_0xe342('0x37')][_0xe342('0x3c')]));_0x4c3ded[_0xe342('0x3b')]=_0x4c3ded[_0xe342('0x3b')][_0xe342('0x4c')]?_0x4c3ded[_0xe342('0x3b')]:_0x3b98f6[_0xe342('0x36')];_0x4c3ded[_0xe342('0x58')]=qs[_0xe342('0x3f')](_0xfd1d37['query'][_0xe342('0x3f')]);_0x4c3ded[_0xe342('0x40')]=qs[_0xe342('0x39')](_[_0xe342('0x41')](_0xfd1d37[_0xe342('0x37')],_0x3b98f6['filters']));if(_0xfd1d37[_0xe342('0x37')][_0xe342('0x43')]){_0x4c3ded[_0xe342('0x40')]=_[_0xe342('0x42')](_0x4c3ded[_0xe342('0x40')],{'$or':_[_0xe342('0x31')](_0x4c3ded[_0xe342('0x3b')],function(_0x54a2f5){var _0x40f785={};_0x40f785[_0x54a2f5]={'$like':'%'+_0xfd1d37['query'][_0xe342('0x43')]+'%'};return _0x40f785;})});}_0x4c3ded=_['merge']({},_0x4c3ded,_0xfd1d37[_0xe342('0x44')]);return _0x50fefd[_0xe342('0x87')](_0x4c3ded);}})[_0xe342('0x28')](function(_0x473871){if(_0x473871){_0x3fa067=_0x473871[_0xe342('0x4c')];if(!_0xfd1d37[_0xe342('0x37')][_0xe342('0x3d')](_0xe342('0x3e'))){_0x4c3ded['limit']=qs[_0xe342('0x22')](_0xfd1d37[_0xe342('0x37')]['limit']);_0x4c3ded[_0xe342('0x20')]=qs[_0xe342('0x20')](_0xfd1d37[_0xe342('0x37')][_0xe342('0x20')]);}return _0x50fefd[_0xe342('0x87')](_0x4c3ded);}})[_0xe342('0x28')](function(_0x4134ab){if(_0x4134ab){return _0x4134ab?{'count':_0x3fa067,'rows':_0x4134ab}:null;}})[_0xe342('0x28')](respondWithResult(_0x330f83,null))[_0xe342('0x49')](handleError(_0x330f83,null));}; \ No newline at end of file +var _0x41cb=['compact','value','ids','addAgents','omit','spread','removeAgents','isArray','userSmsQueue:remove','getAgents','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','save','update','then','SmsQueues','UserProfileResource','destroy','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','SIP','updatedAt','getTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union'];(function(_0x42567f,_0x1c9f88){var _0x269bb0=function(_0x1f5a56){while(--_0x1f5a56){_0x42567f['push'](_0x42567f['shift']());}};_0x269bb0(++_0x1c9f88);}(_0x41cb,0x124));var _0xb41c=function(_0x1a97ba,_0x3f6c5b){_0x1a97ba=_0x1a97ba-0x0;var _0x1e19e7=_0x41cb[_0x1a97ba];return _0x1e19e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb41c('0x0'));var jsonpatch=require(_0xb41c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb41c('0x2'));var Mustache=require(_0xb41c('0x3'));var util=require(_0xb41c('0x4'));var path=require(_0xb41c('0x5'));var sox=require(_0xb41c('0x6'));var csv=require(_0xb41c('0x7'));var ejs=require(_0xb41c('0x8'));var fs=require('fs');var fs_extra=require(_0xb41c('0x9'));var _=require('lodash');var squel=require(_0xb41c('0xa'));var crypto=require(_0xb41c('0xb'));var jsforce=require(_0xb41c('0xc'));var deskjs=require(_0xb41c('0xd'));var toCsv=require(_0xb41c('0x7'));var querystring=require(_0xb41c('0xe'));var Papa=require(_0xb41c('0xf'));var Redis=require(_0xb41c('0x10'));var authService=require(_0xb41c('0x11'));var qs=require(_0xb41c('0x12'));var as=require(_0xb41c('0x13'));var hardwareService=require(_0xb41c('0x14'));var logger=require('../../config/logger')(_0xb41c('0x15'));var utils=require(_0xb41c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb41c('0x17'))['db'];config['redis']=_[_0xb41c('0x18')](config[_0xb41c('0x19')],{'host':_0xb41c('0x1a'),'port':0x18eb});var socket=require(_0xb41c('0x1b'))(new Redis(config[_0xb41c('0x19')]));require('./smsQueue.socket')[_0xb41c('0x1c')](socket);function respondWithStatusCode(_0x17480c,_0x42ddf1){_0x42ddf1=_0x42ddf1||0xcc;return function(_0x323691){if(_0x323691){return _0x17480c[_0xb41c('0x1d')](_0x42ddf1);}return _0x17480c[_0xb41c('0x1e')](_0x42ddf1)[_0xb41c('0x1f')]();};}function respondWithResult(_0x3fb8a4,_0x5c590c){_0x5c590c=_0x5c590c||0xc8;return function(_0x3e3ccf){if(_0x3e3ccf){return _0x3fb8a4[_0xb41c('0x1e')](_0x5c590c)['json'](_0x3e3ccf);}};}function respondWithFilteredResult(_0x2813e0,_0x13fa83){return function(_0x5981e9){if(_0x5981e9){var _0x4204c9=typeof _0x13fa83['offset']==='undefined'&&typeof _0x13fa83[_0xb41c('0x20')]===_0xb41c('0x21');var _0x44f5ae=_0x5981e9[_0xb41c('0x22')];var _0x10d6bb=_0x4204c9?0x0:_0x13fa83[_0xb41c('0x23')];var _0x5b2975=_0x4204c9?_0x5981e9[_0xb41c('0x22')]:_0x13fa83['offset']+_0x13fa83[_0xb41c('0x20')];var _0x2fc39c;if(_0x5b2975>=_0x44f5ae){_0x5b2975=_0x44f5ae;_0x2fc39c=0xc8;}else{_0x2fc39c=0xce;}_0x2813e0[_0xb41c('0x1e')](_0x2fc39c);return _0x2813e0[_0xb41c('0x24')](_0xb41c('0x25'),_0x10d6bb+'-'+_0x5b2975+'/'+_0x44f5ae)[_0xb41c('0x26')](_0x5981e9);}return null;};}function patchUpdates(_0x378bce){return function(_0x4f2973){try{jsonpatch['apply'](_0x4f2973,_0x378bce,!![]);}catch(_0x18d91f){return BPromise['reject'](_0x18d91f);}return _0x4f2973[_0xb41c('0x27')]();};}function saveUpdates(_0x561711,_0x2f1169){return function(_0x14b446){if(_0x14b446){return _0x14b446[_0xb41c('0x28')](_0x561711)[_0xb41c('0x29')](function(_0x4fb778){return _0x4fb778;});}return null;};}function removeEntity(_0x4ff3ef,_0x509f4a){return function(_0x14bd24){if(_0x14bd24){return _0x14bd24['destroy']()['then'](function(){var _0x2e391a=_0x14bd24['get']({'plain':!![]});var _0x2a8709=_0xb41c('0x2a');return db[_0xb41c('0x2b')][_0xb41c('0x2c')]({'where':{'type':_0x2a8709,'resourceId':_0x2e391a['id']}})[_0xb41c('0x29')](function(){return _0x14bd24;});})[_0xb41c('0x29')](function(){_0x4ff3ef[_0xb41c('0x1e')](0xcc)[_0xb41c('0x1f')]();});}};}function handleEntityNotFound(_0x311c26,_0x43c139){return function(_0x9a9a7d){if(!_0x9a9a7d){_0x311c26['sendStatus'](0x194);}return _0x9a9a7d;};}function handleError(_0x328631,_0x3da10e){_0x3da10e=_0x3da10e||0x1f4;return function(_0x5c2dfb){logger['error'](_0x5c2dfb[_0xb41c('0x2d')]);if(_0x5c2dfb[_0xb41c('0x2e')]){delete _0x5c2dfb[_0xb41c('0x2e')];}_0x328631[_0xb41c('0x1e')](_0x3da10e)[_0xb41c('0x2f')](_0x5c2dfb);};}exports[_0xb41c('0x30')]=function(_0x2469b6,_0x553908){var _0x5f47a4={},_0x1f1934={},_0x295e04={'count':0x0,'rows':[]};var _0x1de362=_[_0xb41c('0x31')](db[_0xb41c('0x32')][_0xb41c('0x33')],function(_0x5e5c10){return{'name':_0x5e5c10[_0xb41c('0x34')],'type':_0x5e5c10[_0xb41c('0x35')][_0xb41c('0x36')]};});_0x1f1934[_0xb41c('0x37')]=_[_0xb41c('0x31')](_0x1de362,'name');_0x1f1934['query']=_[_0xb41c('0x38')](_0x2469b6[_0xb41c('0x39')]);_0x1f1934[_0xb41c('0x3a')]=_[_0xb41c('0x3b')](_0x1f1934['model'],_0x1f1934['query']);_0x5f47a4[_0xb41c('0x3c')]=_[_0xb41c('0x3b')](_0x1f1934[_0xb41c('0x37')],qs[_0xb41c('0x3d')](_0x2469b6['query'][_0xb41c('0x3d')]));_0x5f47a4[_0xb41c('0x3c')]=_0x5f47a4[_0xb41c('0x3c')][_0xb41c('0x3e')]?_0x5f47a4[_0xb41c('0x3c')]:_0x1f1934[_0xb41c('0x37')];if(!_0x2469b6[_0xb41c('0x39')][_0xb41c('0x3f')](_0xb41c('0x40'))){_0x5f47a4[_0xb41c('0x20')]=qs[_0xb41c('0x20')](_0x2469b6[_0xb41c('0x39')][_0xb41c('0x20')]);_0x5f47a4[_0xb41c('0x23')]=qs['offset'](_0x2469b6['query'][_0xb41c('0x23')]);}_0x5f47a4['order']=qs[_0xb41c('0x41')](_0x2469b6[_0xb41c('0x39')][_0xb41c('0x41')]);_0x5f47a4[_0xb41c('0x42')]=qs['filters'](_[_0xb41c('0x43')](_0x2469b6[_0xb41c('0x39')],_0x1f1934[_0xb41c('0x3a')]),_0x1de362);if(_0x2469b6[_0xb41c('0x39')]['filter']){_0x5f47a4[_0xb41c('0x42')]=_[_0xb41c('0x44')](_0x5f47a4['where'],{'$or':_[_0xb41c('0x31')](_0x1de362,function(_0x296c21){if(_0x296c21['type']!==_0xb41c('0x45')){var _0x3b2cab={};_0x3b2cab[_0x296c21[_0xb41c('0x2e')]]={'$like':'%'+_0x2469b6[_0xb41c('0x39')][_0xb41c('0x46')]+'%'};return _0x3b2cab;}})});}_0x5f47a4=_[_0xb41c('0x44')]({},_0x5f47a4,_0x2469b6[_0xb41c('0x47')]);var _0x610365={'where':_0x5f47a4[_0xb41c('0x42')]};return db[_0xb41c('0x32')][_0xb41c('0x22')](_0x610365)[_0xb41c('0x29')](function(_0x492152){_0x295e04[_0xb41c('0x22')]=_0x492152;if(_0x2469b6[_0xb41c('0x39')]['includeAll']){_0x5f47a4['include']=[{'all':!![]}];}return db[_0xb41c('0x32')][_0xb41c('0x48')](_0x5f47a4);})[_0xb41c('0x29')](function(_0x50a1b3){_0x295e04[_0xb41c('0x49')]=_0x50a1b3;return _0x295e04;})['then'](respondWithFilteredResult(_0x553908,_0x5f47a4))['catch'](handleError(_0x553908,null));};exports[_0xb41c('0x4a')]=function(_0x1fad1c,_0x1c7018){var _0x21b6f2={'raw':!![],'where':{'id':_0x1fad1c[_0xb41c('0x4b')]['id']}},_0x528b16={};_0x528b16[_0xb41c('0x37')]=_[_0xb41c('0x38')](db[_0xb41c('0x32')][_0xb41c('0x33')]);_0x528b16[_0xb41c('0x39')]=_[_0xb41c('0x38')](_0x1fad1c['query']);_0x528b16[_0xb41c('0x3a')]=_[_0xb41c('0x3b')](_0x528b16[_0xb41c('0x37')],_0x528b16['query']);_0x21b6f2['attributes']=_[_0xb41c('0x3b')](_0x528b16[_0xb41c('0x37')],qs['fields'](_0x1fad1c['query'][_0xb41c('0x3d')]));_0x21b6f2[_0xb41c('0x3c')]=_0x21b6f2[_0xb41c('0x3c')][_0xb41c('0x3e')]?_0x21b6f2[_0xb41c('0x3c')]:_0x528b16[_0xb41c('0x37')];if(_0x1fad1c['query']['includeAll']){_0x21b6f2[_0xb41c('0x4c')]=[{'all':!![]}];}_0x21b6f2=_[_0xb41c('0x44')]({},_0x21b6f2,_0x1fad1c[_0xb41c('0x47')]);return db[_0xb41c('0x32')][_0xb41c('0x4d')](_0x21b6f2)[_0xb41c('0x29')](handleEntityNotFound(_0x1c7018,null))['then'](respondWithResult(_0x1c7018,null))['catch'](handleError(_0x1c7018,null));};exports[_0xb41c('0x4e')]=function(_0x15d087,_0x29c971){return db[_0xb41c('0x32')]['create'](_0x15d087[_0xb41c('0x4f')],{})[_0xb41c('0x29')](function(_0x3933e2){var _0x1cec05=_0x15d087['user'][_0xb41c('0x50')]({'plain':!![]});if(!_0x1cec05)throw new Error(_0xb41c('0x51'));if(_0x1cec05['role']===_0xb41c('0x52')){var _0x5c5e99=_0x3933e2[_0xb41c('0x50')]({'plain':!![]});var _0x174ae5='SmsQueues';return db[_0xb41c('0x53')]['find']({'where':{'name':_0x174ae5,'userProfileId':_0x1cec05[_0xb41c('0x54')]},'raw':!![]})[_0xb41c('0x29')](function(_0x5b0a3e){if(_0x5b0a3e&&_0x5b0a3e[_0xb41c('0x55')]===0x0){return db[_0xb41c('0x2b')][_0xb41c('0x4e')]({'name':_0x5c5e99[_0xb41c('0x2e')],'resourceId':_0x5c5e99['id'],'type':_0x5b0a3e[_0xb41c('0x2e')],'sectionId':_0x5b0a3e['id']},{})[_0xb41c('0x29')](function(){return _0x3933e2;});}else{return _0x3933e2;}})[_0xb41c('0x56')](function(_0x564cf1){logger[_0xb41c('0x57')](_0xb41c('0x58'),_0x564cf1);throw _0x564cf1;});}return _0x3933e2;})[_0xb41c('0x29')](respondWithResult(_0x29c971,0xc9))[_0xb41c('0x56')](handleError(_0x29c971,null));};exports['update']=function(_0x2899c3,_0x5203b0){if(_0x2899c3[_0xb41c('0x4f')]['id']){delete _0x2899c3['body']['id'];}return db[_0xb41c('0x32')][_0xb41c('0x4d')]({'where':{'id':_0x2899c3['params']['id']}})[_0xb41c('0x29')](handleEntityNotFound(_0x5203b0,null))[_0xb41c('0x29')](saveUpdates(_0x2899c3['body'],null))[_0xb41c('0x29')](respondWithResult(_0x5203b0,null))[_0xb41c('0x56')](handleError(_0x5203b0,null));};exports['destroy']=function(_0x4a1ff2,_0x94197d){return db[_0xb41c('0x32')][_0xb41c('0x4d')]({'where':{'id':_0x4a1ff2[_0xb41c('0x4b')]['id']}})[_0xb41c('0x29')](handleEntityNotFound(_0x94197d,null))[_0xb41c('0x29')](removeEntity(_0x94197d,null))[_0xb41c('0x56')](handleError(_0x94197d,null));};exports[_0xb41c('0x59')]=function(_0x12b1c7,_0x6ac493){return db[_0xb41c('0x32')][_0xb41c('0x59')]()[_0xb41c('0x29')](respondWithResult(_0x6ac493,null))[_0xb41c('0x56')](handleError(_0x6ac493,null));};exports[_0xb41c('0x5a')]=function(_0x50cb17,_0x41e789,_0x185f23){var _0x8cec73={'raw':!![],'where':{}},_0x42e111={},_0x2b4fec;return db[_0xb41c('0x32')][_0xb41c('0x5b')]({'where':{'id':_0x50cb17[_0xb41c('0x4b')]['id']}})[_0xb41c('0x29')](handleEntityNotFound(_0x41e789,null))['then'](function(_0x2031f8){if(_0x2031f8){_0x2b4fec=_0x2031f8['get']({'plain':!![]});_0x42e111[_0xb41c('0x37')]=_[_0xb41c('0x38')](db['UserSmsQueue'][_0xb41c('0x33')]);_0x42e111['query']=_[_0xb41c('0x38')](_0x50cb17[_0xb41c('0x39')]);_0x42e111[_0xb41c('0x3a')]=_['intersection'](_0x42e111['model'],_0x42e111[_0xb41c('0x39')]);_0x8cec73[_0xb41c('0x3c')]=_[_0xb41c('0x3b')](_0x42e111[_0xb41c('0x37')],qs['fields'](_0x50cb17[_0xb41c('0x39')][_0xb41c('0x3d')]));_0x8cec73[_0xb41c('0x3c')]=_0x8cec73['attributes']['length']?_0x8cec73[_0xb41c('0x3c')]:_0x42e111[_0xb41c('0x37')];if(!_0x50cb17[_0xb41c('0x39')][_0xb41c('0x3f')](_0xb41c('0x40'))){_0x8cec73[_0xb41c('0x20')]=qs[_0xb41c('0x20')](_0x50cb17[_0xb41c('0x39')][_0xb41c('0x20')]);_0x8cec73[_0xb41c('0x23')]=qs[_0xb41c('0x23')](_0x50cb17['query'][_0xb41c('0x23')]);}_0x8cec73[_0xb41c('0x5c')]=qs[_0xb41c('0x41')](_0x50cb17['query']['sort']);_0x8cec73['where']=qs[_0xb41c('0x3a')](_[_0xb41c('0x43')](_0x50cb17[_0xb41c('0x39')],_0x42e111[_0xb41c('0x3a')]));_0x8cec73[_0xb41c('0x42')][_0xb41c('0x5d')]=_0x2031f8['id'];if(_0x50cb17[_0xb41c('0x39')][_0xb41c('0x46')]){_0x8cec73['where']=_[_0xb41c('0x44')](_0x8cec73[_0xb41c('0x42')],{'$or':_[_0xb41c('0x31')](_0x8cec73[_0xb41c('0x3c')],function(_0x2b3c53){var _0x586e08={};_0x586e08[_0x2b3c53]={'$like':'%'+_0x50cb17[_0xb41c('0x39')]['filter']+'%'};return _0x586e08;})});}_0x8cec73=_[_0xb41c('0x44')]({},_0x8cec73,_0x50cb17[_0xb41c('0x47')]);return db[_0xb41c('0x5e')][_0xb41c('0x48')](_0x8cec73);}})[_0xb41c('0x29')](function(_0x2e5686){if(_0x2e5686){return db[_0xb41c('0x5f')][_0xb41c('0x60')]({'where':{'id':_['map'](_0x2e5686,_0xb41c('0x61')),'role':_0xb41c('0x62')},'attributes':['id',_0xb41c('0x2e'),_0xb41c('0x63'),'updatedAt',_0xb41c('0x64')]});}})[_0xb41c('0x29')](function(_0x1324bc){if(_0x1324bc){return{'count':_0x1324bc[_0xb41c('0x22')],'rows':_[_0xb41c('0x31')](_0x1324bc['rows'],function(_0xbc2184){return{'membername':_0xbc2184[_0xb41c('0x2e')],'UserId':_0xbc2184['id'],'queue_name':_0x2b4fec[_0xb41c('0x2e')],'SmsQueueId':_0x2b4fec['id'],'interface':util[_0xb41c('0x65')]('%s/%s',_0xb41c('0x66'),_0xbc2184['name']),'penalty':0x0,'paused':_0xbc2184[_0xb41c('0x63')],'createdAt':_0xbc2184[_0xb41c('0x64')],'updatedAt':_0xbc2184[_0xb41c('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x41e789,_0x8cec73))[_0xb41c('0x56')](handleError(_0x41e789,null));};exports['getTeams']=function(_0x195eca,_0x89dbf,_0x4c01f3){var _0x422c45={};var _0x443816={};var _0x3b03d7;var _0x294b6c;return db[_0xb41c('0x32')][_0xb41c('0x5b')]({'where':{'id':_0x195eca[_0xb41c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x89dbf,null))[_0xb41c('0x29')](function(_0x5a0a1e){if(_0x5a0a1e){_0x3b03d7=_0x5a0a1e;_0x443816[_0xb41c('0x37')]=_[_0xb41c('0x38')](db['Team']['rawAttributes']);_0x443816[_0xb41c('0x39')]=_[_0xb41c('0x38')](_0x195eca['query']);_0x443816[_0xb41c('0x3a')]=_[_0xb41c('0x3b')](_0x443816['model'],_0x443816[_0xb41c('0x39')]);_0x422c45[_0xb41c('0x3c')]=_['intersection'](_0x443816[_0xb41c('0x37')],qs[_0xb41c('0x3d')](_0x195eca[_0xb41c('0x39')][_0xb41c('0x3d')]));_0x422c45[_0xb41c('0x3c')]=_0x422c45[_0xb41c('0x3c')][_0xb41c('0x3e')]?_0x422c45[_0xb41c('0x3c')]:_0x443816[_0xb41c('0x37')];_0x422c45[_0xb41c('0x5c')]=qs['sort'](_0x195eca[_0xb41c('0x39')][_0xb41c('0x41')]);_0x422c45['where']=qs[_0xb41c('0x3a')](_[_0xb41c('0x43')](_0x195eca[_0xb41c('0x39')],_0x443816[_0xb41c('0x3a')]));if(_0x195eca[_0xb41c('0x39')][_0xb41c('0x46')]){_0x422c45[_0xb41c('0x42')]=_['merge'](_0x422c45[_0xb41c('0x42')],{'$or':_[_0xb41c('0x31')](_0x422c45[_0xb41c('0x3c')],function(_0x2f736a){var _0x5747b6={};_0x5747b6[_0x2f736a]={'$like':'%'+_0x195eca[_0xb41c('0x39')][_0xb41c('0x46')]+'%'};return _0x5747b6;})});}_0x422c45=_[_0xb41c('0x44')]({},_0x422c45,_0x195eca[_0xb41c('0x47')]);return _0x3b03d7['getTeams'](_0x422c45);}})['then'](function(_0x50616d){if(_0x50616d){_0x294b6c=_0x50616d['length'];if(!_0x195eca[_0xb41c('0x39')]['hasOwnProperty'](_0xb41c('0x40'))){_0x422c45[_0xb41c('0x20')]=qs['limit'](_0x195eca['query'][_0xb41c('0x20')]);_0x422c45[_0xb41c('0x23')]=qs[_0xb41c('0x23')](_0x195eca['query'][_0xb41c('0x23')]);}return _0x3b03d7[_0xb41c('0x68')](_0x422c45);}})['then'](function(_0x569afe){if(_0x569afe){return _0x569afe?{'count':_0x294b6c,'rows':_0x569afe}:null;}})[_0xb41c('0x29')](respondWithResult(_0x89dbf,null))['catch'](handleError(_0x89dbf,null));};exports['addTeams']=function(_0x33dd44,_0x107cf0,_0x4e9e85){var _0x38319c=_0x33dd44[_0xb41c('0x4f')]['ids'];return db[_0xb41c('0x69')][_0xb41c('0x48')]({'where':{'id':_0x38319c},'attributes':['id'],'include':[{'model':db[_0xb41c('0x5f')],'as':_0xb41c('0x6a'),'attributes':['id',_0xb41c('0x2e'),_0xb41c('0x6b'),'voicePause',_0xb41c('0x6c')],'raw':!![]}]})[_0xb41c('0x29')](function(_0x5113b5){if(_0x5113b5){var _0x2b7745=_[_0xb41c('0x6d')](_0x5113b5,function(_0x46c7a2){var _0x53f8b0=_0x46c7a2[_0xb41c('0x50')]({'plain':!![]});return _0x53f8b0[_0xb41c('0x6a')];});return db[_0xb41c('0x32')][_0xb41c('0x4d')]({'where':{'id':_0x33dd44['params']['id']}})[_0xb41c('0x29')](function(_0x4dbba2){return db[_0xb41c('0x6e')][_0xb41c('0x6f')](function(_0xd32f18){return _0x4dbba2[_0xb41c('0x70')](_0x38319c,{'transaction':_0xd32f18})[_0xb41c('0x29')](function(){return BPromise['each'](_0x2b7745,function(_0x4f5a8b){return db[_0xb41c('0x5e')][_0xb41c('0x71')]({'where':{'UserId':_0x4f5a8b['id'],'SmsQueueId':_0x33dd44[_0xb41c('0x4b')]['id']},'transaction':_0xd32f18});});})[_0xb41c('0x29')](function(){_0x2b7745[_0xb41c('0x72')](function(_0x4f91b8){socket[_0xb41c('0x73')](_0xb41c('0x74'),{'UserId':_0x4f91b8['id'],'SmsQueueId':_0x4dbba2['id']});});});});});}})[_0xb41c('0x29')](respondWithStatusCode(_0x107cf0,null))[_0xb41c('0x56')](handleError(_0x107cf0,null));};exports[_0xb41c('0x75')]=function(_0x176742,_0x169520,_0x4a1b63){return db['Team']['findAll']({'where':{'id':_0x176742[_0xb41c('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb41c('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x169520,null))[_0xb41c('0x29')](function(_0x39aa36){var _0x4fcec9=_[_0xb41c('0x31')](_0x39aa36,'id');var _0x454a55=[];var _0x2f0749=[];var _0x2a1970=squel[_0xb41c('0x76')]();_0x2a1970['field']('tq.TeamId')[_0xb41c('0x77')](_0xb41c('0x78'),'tq')['join'](_0xb41c('0x79'),'ut',_0xb41c('0x7a'))['where'](_0xb41c('0x7b'),_0x176742['params']['id']);for(var _0x5e691a=0x0;_0x5e691a<_0x39aa36[_0xb41c('0x3e')];_0x5e691a+=0x1){let _0x5852c4=_0x39aa36[_0x5e691a];for(var _0x4c0ef7=0x0;_0x4c0ef7<_0x5852c4['Agents'][_0xb41c('0x3e')];_0x4c0ef7+=0x1){let _0x2464aa=_0x5852c4['Agents'][_0x4c0ef7];var _0x804823=_0x2a1970['clone']();_0x804823[_0xb41c('0x42')](_0xb41c('0x7c'),_0x2464aa['id']);_0x2f0749['push'](db[_0xb41c('0x6e')][_0xb41c('0x39')](_0x804823[_0xb41c('0x7d')](),{'type':db[_0xb41c('0x6e')][_0xb41c('0x7e')][_0xb41c('0x7f')]})[_0xb41c('0x29')](function(_0x2d1739){if(_0x2d1739[_0xb41c('0x3e')]===0x1){return _0x2464aa['id'];}else{var _0x4cbbf5=_['every'](_['map'](_0x2d1739,_0xb41c('0x80')),function(_0x2b04a9){return _[_0xb41c('0x81')](_0x4fcec9,_0x2b04a9);});if(_0x4cbbf5){return _0x2464aa['id'];}}}));}}return BPromise['all'](_0x2f0749)['then'](function(_0x2309b9){_0x454a55=_(_0x454a55)[_0xb41c('0x82')](_0x2309b9)[_0xb41c('0x83')]()[_0xb41c('0x84')]();return db[_0xb41c('0x32')]['find']({'where':{'id':_0x176742[_0xb41c('0x4b')]['id']}})['then'](function(_0x3e9c4c){return db['sequelize']['transaction'](function(_0x310e66){return _0x3e9c4c[_0xb41c('0x75')](_0x176742['query'][_0xb41c('0x85')],{'transaction':_0x310e66})['then'](function(){if(!_['isEmpty'](_0x454a55)){return _0x3e9c4c['removeAgents'](_0x454a55,{'transaction':_0x310e66});}})[_0xb41c('0x29')](function(){_0x454a55[_0xb41c('0x72')](function(_0x5b8008){socket['emit']('userSmsQueue:remove',{'UserId':_0x5b8008,'SmsQueueId':_0x3e9c4c['id']});});});});});});})[_0xb41c('0x29')](respondWithStatusCode(_0x169520,null))[_0xb41c('0x56')](handleError(_0x169520,null));};exports[_0xb41c('0x86')]=function(_0x2b4472,_0x3cf3f1,_0x498c52){return db['SmsQueue']['find']({'where':{'id':_0x2b4472['params']['id']}})['then'](handleEntityNotFound(_0x3cf3f1,null))[_0xb41c('0x29')](function(_0x497d49){if(_0x497d49){return _0x497d49['addAgents'](_0x2b4472[_0xb41c('0x4f')][_0xb41c('0x85')],_[_0xb41c('0x87')](_0x2b4472[_0xb41c('0x4f')],['ids','id'])||{})[_0xb41c('0x88')](function(_0x5090ed){for(var _0x356f1a=0x0;_0x356f1a<_0x2b4472['body'][_0xb41c('0x85')][_0xb41c('0x3e')];_0x356f1a+=0x1){socket[_0xb41c('0x73')]('userSmsQueue:save',{'UserId':Number(_0x2b4472[_0xb41c('0x4f')]['ids'][_0x356f1a]),'SmsQueueId':Number(_0x2b4472['params']['id'])});}return _0x5090ed;});}})[_0xb41c('0x29')](respondWithResult(_0x3cf3f1,null))[_0xb41c('0x56')](handleError(_0x3cf3f1,null));};exports['removeAgents']=function(_0x9f9bbc,_0x2343f0,_0x21f85f){return db[_0xb41c('0x32')][_0xb41c('0x4d')]({'where':{'id':_0x9f9bbc[_0xb41c('0x4b')]['id']}})[_0xb41c('0x29')](handleEntityNotFound(_0x2343f0,null))[_0xb41c('0x29')](function(_0x52ebae){if(_0x52ebae){return _0x52ebae[_0xb41c('0x89')](_0x9f9bbc[_0xb41c('0x39')][_0xb41c('0x85')])[_0xb41c('0x29')](function(){if(_[_0xb41c('0x8a')](_0x9f9bbc[_0xb41c('0x39')][_0xb41c('0x85')])){for(var _0x55416a=0x0;_0x55416a<_0x9f9bbc[_0xb41c('0x39')][_0xb41c('0x85')][_0xb41c('0x3e')];_0x55416a+=0x1){socket[_0xb41c('0x73')](_0xb41c('0x8b'),{'UserId':Number(_0x9f9bbc[_0xb41c('0x39')]['ids'][_0x55416a]),'SmsQueueId':Number(_0x9f9bbc['params']['id'])});}}else{socket[_0xb41c('0x73')](_0xb41c('0x8b'),{'UserId':Number(_0x9f9bbc[_0xb41c('0x39')]['ids']),'SmsQueueId':Number(_0x9f9bbc[_0xb41c('0x4b')]['id'])});}});}})[_0xb41c('0x29')](respondWithStatusCode(_0x2343f0,null))['catch'](handleError(_0x2343f0,null));};exports[_0xb41c('0x8c')]=function(_0x54416e,_0x51f850,_0x23a0cb){var _0x19bda0={};var _0x53bdb9={};var _0x187717;var _0x59c890;return db[_0xb41c('0x32')]['findOne']({'where':{'id':_0x54416e[_0xb41c('0x4b')]['id']}})[_0xb41c('0x29')](handleEntityNotFound(_0x51f850,null))[_0xb41c('0x29')](function(_0x3d9c2c){if(_0x3d9c2c){_0x187717=_0x3d9c2c;_0x53bdb9[_0xb41c('0x37')]=_[_0xb41c('0x38')](db[_0xb41c('0x5f')][_0xb41c('0x33')]);_0x53bdb9['query']=_['keys'](_0x54416e[_0xb41c('0x39')]);_0x53bdb9[_0xb41c('0x3a')]=_[_0xb41c('0x3b')](_0x53bdb9[_0xb41c('0x37')],_0x53bdb9[_0xb41c('0x39')]);_0x19bda0[_0xb41c('0x3c')]=_[_0xb41c('0x3b')](_0x53bdb9[_0xb41c('0x37')],qs['fields'](_0x54416e[_0xb41c('0x39')]['fields']));_0x19bda0['attributes']=_0x19bda0['attributes'][_0xb41c('0x3e')]?_0x19bda0[_0xb41c('0x3c')]:_0x53bdb9[_0xb41c('0x37')];_0x19bda0[_0xb41c('0x5c')]=qs[_0xb41c('0x41')](_0x54416e[_0xb41c('0x39')][_0xb41c('0x41')]);_0x19bda0['where']=qs[_0xb41c('0x3a')](_[_0xb41c('0x43')](_0x54416e[_0xb41c('0x39')],_0x53bdb9[_0xb41c('0x3a')]));if(_0x54416e[_0xb41c('0x39')][_0xb41c('0x46')]){_0x19bda0[_0xb41c('0x42')]=_[_0xb41c('0x44')](_0x19bda0['where'],{'$or':_[_0xb41c('0x31')](_0x19bda0[_0xb41c('0x3c')],function(_0xe716e1){var _0x22dd00={};_0x22dd00[_0xe716e1]={'$like':'%'+_0x54416e[_0xb41c('0x39')][_0xb41c('0x46')]+'%'};return _0x22dd00;})});}_0x19bda0=_[_0xb41c('0x44')]({},_0x19bda0,_0x54416e['options']);return _0x187717['getAgents'](_0x19bda0);}})[_0xb41c('0x29')](function(_0x429cff){if(_0x429cff){_0x59c890=_0x429cff[_0xb41c('0x3e')];if(!_0x54416e[_0xb41c('0x39')][_0xb41c('0x3f')](_0xb41c('0x40'))){_0x19bda0[_0xb41c('0x20')]=qs[_0xb41c('0x20')](_0x54416e[_0xb41c('0x39')]['limit']);_0x19bda0[_0xb41c('0x23')]=qs[_0xb41c('0x23')](_0x54416e[_0xb41c('0x39')][_0xb41c('0x23')]);}return _0x187717[_0xb41c('0x8c')](_0x19bda0);}})[_0xb41c('0x29')](function(_0xfa8e80){if(_0xfa8e80){return _0xfa8e80?{'count':_0x59c890,'rows':_0xfa8e80}:null;}})[_0xb41c('0x29')](respondWithResult(_0x51f850,null))[_0xb41c('0x56')](handleError(_0x51f850,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index c2a1d93..433d6bb 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 _0xb9fd=['../../mysqldb','SmsQueue','save','update','emit','hasOwnProperty','events'];(function(_0x3785c4,_0x250244){var _0x399520=function(_0x5921d7){while(--_0x5921d7){_0x3785c4['push'](_0x3785c4['shift']());}};_0x399520(++_0x250244);}(_0xb9fd,0xb5));var _0xdb9f=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0xb9fd[_0x26b622];return _0x58a028;};'use strict';var EventEmitter=require(_0xdb9f('0x0'));var SmsQueue=require(_0xdb9f('0x1'))['db'][_0xdb9f('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb9f('0x3'),'afterUpdate':_0xdb9f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x39fc13){return function(_0x35643c,_0x2b9051,_0xc3d358){SmsQueueEvents[_0xdb9f('0x5')](_0x39fc13+':'+_0x35643c['id'],_0x35643c);SmsQueueEvents['emit'](_0x39fc13,_0x35643c);_0xc3d358(null);};}for(var e in events){if(events[_0xdb9f('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xc1d7=['exports','SmsQueue','setMaxListeners','save','hasOwnProperty','hook'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xc1d7,0x1ed));var _0x7c1d=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0xc1d7[_0x466af7];return _0x348c96;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x7c1d('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7c1d('0x1')](0x0);var events={'afterCreate':_0x7c1d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50ead0){return function(_0x18a2ee,_0x4318da,_0x3b9261){SmsQueueEvents['emit'](_0x50ead0+':'+_0x18a2ee['id'],_0x18a2ee);SmsQueueEvents['emit'](_0x50ead0,_0x18a2ee);_0x3b9261(null);};}for(var e in events){if(events[_0x7c1d('0x3')](e)){var event=events[e];SmsQueue[_0x7c1d('0x4')](e,emitEvent(event));}}module[_0x7c1d('0x5')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 559f66e..40a1d5b 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 _0x2b89=['rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x56a12c,_0x52d69e){var _0x1f3543=function(_0x23ca81){while(--_0x23ca81){_0x56a12c['push'](_0x56a12c['shift']());}};_0x1f3543(++_0x52d69e);}(_0x2b89,0x158));var _0x92b8=function(_0x56b62,_0x416ac7){_0x56b62=_0x56b62-0x0;var _0x15c559=_0x2b89[_0x56b62];return _0x15c559;};'use strict';var _=require(_0x92b8('0x0'));var util=require(_0x92b8('0x1'));var logger=require(_0x92b8('0x2'))('api');var moment=require(_0x92b8('0x3'));var BPromise=require(_0x92b8('0x4'));var rp=require(_0x92b8('0x5'));var fs=require('fs');var path=require(_0x92b8('0x6'));var rimraf=require(_0x92b8('0x7'));var config=require(_0x92b8('0x8'));var attributes=require(_0x92b8('0x9'));module['exports']=function(_0x208086,_0x2b9a93){return _0x208086[_0x92b8('0xa')](_0x92b8('0xb'),attributes,{'tableName':_0x92b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d4d=['define','SmsQueue','sms_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x4d4d,0x196));var _0xd4d4=function(_0x313467,_0x4551e3){_0x313467=_0x313467-0x0;var _0x2ea5e6=_0x4d4d[_0x313467];return _0x2ea5e6;};'use strict';var _=require(_0xd4d4('0x0'));var util=require('util');var logger=require(_0xd4d4('0x1'))(_0xd4d4('0x2'));var moment=require(_0xd4d4('0x3'));var BPromise=require(_0xd4d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4d4('0x5'));var rimraf=require(_0xd4d4('0x6'));var config=require(_0xd4d4('0x7'));var attributes=require(_0xd4d4('0x8'));module[_0xd4d4('0x9')]=function(_0x471d25,_0x830da3){return _0x471d25[_0xd4d4('0xa')](_0xd4d4('0xb'),attributes,{'tableName':_0xd4d4('0xc'),'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 437d739..33ebf34 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 _0x23b3=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','model','include','map','ShowSmsQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x30570d,_0x27742d){var _0x4ac326=function(_0x28231e){while(--_0x28231e){_0x30570d['push'](_0x30570d['shift']());}};_0x4ac326(++_0x27742d);}(_0x23b3,0x1b2));var _0x323b=function(_0x4283c0,_0xc694d5){_0x4283c0=_0x4283c0-0x0;var _0x6b47ab=_0x23b3[_0x4283c0];return _0x6b47ab;};'use strict';var _=require('lodash');var util=require(_0x323b('0x0'));var moment=require(_0x323b('0x1'));var BPromise=require(_0x323b('0x2'));var rs=require(_0x323b('0x3'));var fs=require('fs');var Redis=require(_0x323b('0x4'));var db=require(_0x323b('0x5'))['db'];var utils=require(_0x323b('0x6'));var logger=require(_0x323b('0x7'))('rpc');var config=require(_0x323b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x323b('0x9')][_0x323b('0xa')]({'port':0x232a});config[_0x323b('0xb')]=_[_0x323b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x323b('0xd'))(new Redis(config[_0x323b('0xb')]));require('./smsQueue.socket')[_0x323b('0xe')](socket);function respondWithRpcPromise(_0x4cfc3d,_0x294447,_0x46263a){return new BPromise(function(_0x53c739,_0x4ba43f){return client[_0x323b('0xf')](_0x4cfc3d,_0x46263a)[_0x323b('0x10')](function(_0x14dbc2){logger[_0x323b('0x11')](_0x323b('0x12'),_0x294447,_0x323b('0x13'));logger[_0x323b('0x14')](_0x323b('0x15'),_0x294447,_0x323b('0x13'),JSON[_0x323b('0x16')](_0x14dbc2));if(_0x14dbc2[_0x323b('0x17')]){if(_0x14dbc2['error'][_0x323b('0x18')]===0x1f4){logger[_0x323b('0x17')](_0x323b('0x12'),_0x294447,_0x14dbc2[_0x323b('0x17')][_0x323b('0x19')]);return _0x4ba43f(_0x14dbc2[_0x323b('0x17')][_0x323b('0x19')]);}logger[_0x323b('0x17')](_0x323b('0x12'),_0x294447,_0x14dbc2[_0x323b('0x17')][_0x323b('0x19')]);return _0x53c739(_0x14dbc2['error'][_0x323b('0x19')]);}else{logger[_0x323b('0x11')](_0x323b('0x12'),_0x294447,_0x323b('0x13'));_0x53c739(_0x14dbc2['result'][_0x323b('0x19')]);}})[_0x323b('0x1a')](function(_0x1ffa2b){logger[_0x323b('0x17')](_0x323b('0x12'),_0x294447,_0x1ffa2b);_0x4ba43f(_0x1ffa2b);});});}exports[_0x323b('0x1b')]=function(_0x4ffb5d){var _0x57a904=this;return new Promise(function(_0x18cf66,_0x5a3536){return db[_0x323b('0x1c')][_0x323b('0x1d')]({'raw':_0x4ffb5d[_0x323b('0x1e')]?_0x4ffb5d['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ffb5d[_0x323b('0x1e')]?_0x4ffb5d[_0x323b('0x1e')][_0x323b('0x1f')]||null:null,'attributes':_0x4ffb5d['options']?_0x4ffb5d[_0x323b('0x1e')][_0x323b('0x20')]||null:null,'limit':_0x4ffb5d[_0x323b('0x1e')]?_0x4ffb5d[_0x323b('0x1e')][_0x323b('0x21')]||null:null,'include':_0x4ffb5d[_0x323b('0x1e')]?_0x4ffb5d[_0x323b('0x1e')]['include']?_['map'](_0x4ffb5d[_0x323b('0x1e')]['include'],function(_0x1dcf8b){return{'model':db[_0x1dcf8b[_0x323b('0x22')]],'as':_0x1dcf8b['as'],'attributes':_0x1dcf8b[_0x323b('0x20')],'include':_0x1dcf8b[_0x323b('0x23')]?_[_0x323b('0x24')](_0x1dcf8b[_0x323b('0x23')],function(_0x142e0a){return{'model':db[_0x142e0a['model']],'as':_0x142e0a['as'],'attributes':_0x142e0a['attributes'],'include':_0x142e0a[_0x323b('0x23')]?_[_0x323b('0x24')](_0x142e0a['include'],function(_0x3c09d3){return{'model':db[_0x3c09d3[_0x323b('0x22')]],'as':_0x3c09d3['as'],'attributes':_0x3c09d3[_0x323b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x507f12){logger[_0x323b('0x11')](_0x323b('0x1b'),_0x4ffb5d);logger[_0x323b('0x14')](_0x323b('0x1b'),_0x4ffb5d,JSON[_0x323b('0x16')](_0x507f12));_0x18cf66(_0x507f12);})[_0x323b('0x1a')](function(_0x43aee5){logger[_0x323b('0x17')](_0x323b('0x1b'),_0x43aee5['message'],_0x4ffb5d);_0x5a3536(_0x57a904['error'](0x1f4,_0x43aee5[_0x323b('0x19')]));});});};exports[_0x323b('0x25')]=function(_0x305470){var _0x4bd582=this;return new Promise(function(_0x352839,_0x57852f){return db[_0x323b('0x1c')][_0x323b('0x26')]({'raw':_0x305470['options']?_0x305470['options'][_0x323b('0x27')]===undefined?!![]:![]:!![],'where':_0x305470[_0x323b('0x1e')]?_0x305470[_0x323b('0x1e')]['where']||null:null,'attributes':_0x305470[_0x323b('0x1e')]?_0x305470['options'][_0x323b('0x20')]||null:null,'include':_0x305470[_0x323b('0x1e')]?_0x305470[_0x323b('0x1e')][_0x323b('0x23')]?_[_0x323b('0x24')](_0x305470[_0x323b('0x1e')][_0x323b('0x23')],function(_0x105402){return{'model':db[_0x105402['model']],'as':_0x105402['as'],'attributes':_0x105402['attributes'],'include':_0x105402['include']?_[_0x323b('0x24')](_0x105402[_0x323b('0x23')],function(_0x248f2a){return{'model':db[_0x248f2a[_0x323b('0x22')]],'as':_0x248f2a['as'],'attributes':_0x248f2a[_0x323b('0x20')],'include':_0x248f2a[_0x323b('0x23')]?_[_0x323b('0x24')](_0x248f2a[_0x323b('0x23')],function(_0x5b5692){return{'model':db[_0x5b5692[_0x323b('0x22')]],'as':_0x5b5692['as'],'attributes':_0x5b5692[_0x323b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cf850){logger[_0x323b('0x11')](_0x323b('0x25'),_0x305470);logger[_0x323b('0x14')](_0x323b('0x25'),_0x305470,JSON['stringify'](_0x4cf850));_0x352839(_0x4cf850);})[_0x323b('0x1a')](function(_0x4873d9){logger[_0x323b('0x17')](_0x323b('0x25'),_0x4873d9['message'],_0x305470);_0x57852f(_0x4bd582[_0x323b('0x17')](0x1f4,_0x4873d9[_0x323b('0x19')]));});});}; \ No newline at end of file +var _0x24f1=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','then','debug','ShowSmsQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14723d,_0x4e09de){var _0x53227d=function(_0x28aea4){while(--_0x28aea4){_0x14723d['push'](_0x14723d['shift']());}};_0x53227d(++_0x4e09de);}(_0x24f1,0xcd));var _0x124f=function(_0x312f56,_0x54120a){_0x312f56=_0x312f56-0x0;var _0xc0373e=_0x24f1[_0x312f56];return _0xc0373e;};'use strict';var _=require(_0x124f('0x0'));var util=require('util');var moment=require(_0x124f('0x1'));var BPromise=require(_0x124f('0x2'));var rs=require(_0x124f('0x3'));var fs=require('fs');var Redis=require(_0x124f('0x4'));var db=require(_0x124f('0x5'))['db'];var utils=require(_0x124f('0x6'));var logger=require(_0x124f('0x7'))(_0x124f('0x8'));var config=require(_0x124f('0x9'));var jayson=require(_0x124f('0xa'));var client=jayson[_0x124f('0xb')][_0x124f('0xc')]({'port':0x232a});config[_0x124f('0xd')]=_[_0x124f('0xe')](config['redis'],{'host':_0x124f('0xf'),'port':0x18eb});var socket=require(_0x124f('0x10'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x124f('0x11')](socket);function respondWithRpcPromise(_0x4af045,_0x43b1d9,_0x78d80c){return new BPromise(function(_0x2c9c6e,_0x5bd61a){return client[_0x124f('0x12')](_0x4af045,_0x78d80c)['then'](function(_0x176534){logger[_0x124f('0x13')](_0x124f('0x14'),_0x43b1d9,'request\x20sent');logger['debug'](_0x124f('0x15'),_0x43b1d9,_0x124f('0x16'),JSON[_0x124f('0x17')](_0x176534));if(_0x176534[_0x124f('0x18')]){if(_0x176534[_0x124f('0x18')]['code']===0x1f4){logger[_0x124f('0x18')]('SmsQueue,\x20%s,\x20%s',_0x43b1d9,_0x176534[_0x124f('0x18')]['message']);return _0x5bd61a(_0x176534[_0x124f('0x18')][_0x124f('0x19')]);}logger[_0x124f('0x18')]('SmsQueue,\x20%s,\x20%s',_0x43b1d9,_0x176534[_0x124f('0x18')][_0x124f('0x19')]);return _0x2c9c6e(_0x176534[_0x124f('0x18')][_0x124f('0x19')]);}else{logger[_0x124f('0x13')]('SmsQueue,\x20%s,\x20%s',_0x43b1d9,_0x124f('0x16'));_0x2c9c6e(_0x176534[_0x124f('0x1a')][_0x124f('0x19')]);}})[_0x124f('0x1b')](function(_0x3d2bad){logger[_0x124f('0x18')](_0x124f('0x14'),_0x43b1d9,_0x3d2bad);_0x5bd61a(_0x3d2bad);});});}exports[_0x124f('0x1c')]=function(_0x79b6db){var _0x27688e=this;return new Promise(function(_0x254cf9,_0x24c84c){return db[_0x124f('0x1d')][_0x124f('0x1e')]({'raw':_0x79b6db[_0x124f('0x1f')]?_0x79b6db[_0x124f('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x79b6db[_0x124f('0x1f')]?_0x79b6db['options'][_0x124f('0x20')]||null:null,'attributes':_0x79b6db[_0x124f('0x1f')]?_0x79b6db[_0x124f('0x1f')][_0x124f('0x21')]||null:null,'limit':_0x79b6db[_0x124f('0x1f')]?_0x79b6db[_0x124f('0x1f')][_0x124f('0x22')]||null:null,'include':_0x79b6db[_0x124f('0x1f')]?_0x79b6db[_0x124f('0x1f')][_0x124f('0x23')]?_[_0x124f('0x24')](_0x79b6db[_0x124f('0x1f')][_0x124f('0x23')],function(_0x2dc2c7){return{'model':db[_0x2dc2c7[_0x124f('0x25')]],'as':_0x2dc2c7['as'],'attributes':_0x2dc2c7[_0x124f('0x21')],'include':_0x2dc2c7['include']?_[_0x124f('0x24')](_0x2dc2c7[_0x124f('0x23')],function(_0x497134){return{'model':db[_0x497134[_0x124f('0x25')]],'as':_0x497134['as'],'attributes':_0x497134[_0x124f('0x21')],'include':_0x497134[_0x124f('0x23')]?_[_0x124f('0x24')](_0x497134['include'],function(_0x4b505d){return{'model':db[_0x4b505d[_0x124f('0x25')]],'as':_0x4b505d['as'],'attributes':_0x4b505d['attributes']};}):[]};}):[]};}):[]:[]})[_0x124f('0x26')](function(_0x43fd4a){logger[_0x124f('0x13')](_0x124f('0x1c'),_0x79b6db);logger[_0x124f('0x27')](_0x124f('0x1c'),_0x79b6db,JSON[_0x124f('0x17')](_0x43fd4a));_0x254cf9(_0x43fd4a);})[_0x124f('0x1b')](function(_0x27e779){logger['error'](_0x124f('0x1c'),_0x27e779[_0x124f('0x19')],_0x79b6db);_0x24c84c(_0x27688e['error'](0x1f4,_0x27e779['message']));});});};exports[_0x124f('0x28')]=function(_0x2d9b0f){var _0x1ef00d=this;return new Promise(function(_0x26a935,_0x492003){return db[_0x124f('0x1d')][_0x124f('0x29')]({'raw':_0x2d9b0f[_0x124f('0x1f')]?_0x2d9b0f['options'][_0x124f('0x2a')]===undefined?!![]:![]:!![],'where':_0x2d9b0f['options']?_0x2d9b0f[_0x124f('0x1f')][_0x124f('0x20')]||null:null,'attributes':_0x2d9b0f['options']?_0x2d9b0f[_0x124f('0x1f')][_0x124f('0x21')]||null:null,'include':_0x2d9b0f[_0x124f('0x1f')]?_0x2d9b0f[_0x124f('0x1f')][_0x124f('0x23')]?_[_0x124f('0x24')](_0x2d9b0f[_0x124f('0x1f')][_0x124f('0x23')],function(_0x3f780c){return{'model':db[_0x3f780c[_0x124f('0x25')]],'as':_0x3f780c['as'],'attributes':_0x3f780c[_0x124f('0x21')],'include':_0x3f780c[_0x124f('0x23')]?_[_0x124f('0x24')](_0x3f780c['include'],function(_0x15c86a){return{'model':db[_0x15c86a[_0x124f('0x25')]],'as':_0x15c86a['as'],'attributes':_0x15c86a[_0x124f('0x21')],'include':_0x15c86a[_0x124f('0x23')]?_['map'](_0x15c86a[_0x124f('0x23')],function(_0x304bad){return{'model':db[_0x304bad['model']],'as':_0x304bad['as'],'attributes':_0x304bad[_0x124f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x124f('0x26')](function(_0x9dee7e){logger[_0x124f('0x13')]('ShowSmsQueue',_0x2d9b0f);logger[_0x124f('0x27')](_0x124f('0x28'),_0x2d9b0f,JSON['stringify'](_0x9dee7e));_0x26a935(_0x9dee7e);})[_0x124f('0x1b')](function(_0x3eb311){logger[_0x124f('0x18')]('ShowSmsQueue',_0x3eb311['message'],_0x2d9b0f);_0x492003(_0x1ef00d[_0x124f('0x18')](0x1f4,_0x3eb311[_0x124f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index c40d1a2..f68cf84 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 _0x3756=['emit','register','smsQueue:','save'];(function(_0x86105b,_0x3bbad5){var _0x4ea7bc=function(_0x4a5980){while(--_0x4a5980){_0x86105b['push'](_0x86105b['shift']());}};_0x4ea7bc(++_0x3bbad5);}(_0x3756,0x107));var _0x6375=function(_0x16296b,_0x3e10aa){_0x16296b=_0x16296b-0x0;var _0x3c1391=_0x3756[_0x16296b];return _0x3c1391;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x6375('0x0'),'remove','update'];function createListener(_0x3f6f27,_0x27246e){return function(_0x2f0455){_0x27246e[_0x6375('0x1')](_0x3f6f27,_0x2f0455);};}function removeListener(_0x5a14b0,_0x2d8500){return function(){SmsQueueEvents['removeListener'](_0x5a14b0,_0x2d8500);};}exports[_0x6375('0x2')]=function(_0x4b7fc4){for(var _0x31c912=0x0,_0x48438d=events['length'];_0x31c912<_0x48438d;_0x31c912++){var _0x33a7b7=events[_0x31c912];var _0xeda5ba=createListener(_0x6375('0x3')+_0x33a7b7,_0x4b7fc4);SmsQueueEvents['on'](_0x33a7b7,_0xeda5ba);}}; \ No newline at end of file +var _0x6e0a=['register','length','smsQueue:','save','remove','update','emit','removeListener'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6e0a,0xcb));var _0xa6e0=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x6e0a[_0x1f5a63];return _0x30bb7a;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xa6e0('0x0'),_0xa6e0('0x1'),_0xa6e0('0x2')];function createListener(_0x35e87e,_0xda3c5){return function(_0x2bd35b){_0xda3c5[_0xa6e0('0x3')](_0x35e87e,_0x2bd35b);};}function removeListener(_0x1e1824,_0x456076){return function(){SmsQueueEvents[_0xa6e0('0x4')](_0x1e1824,_0x456076);};}exports[_0xa6e0('0x5')]=function(_0x54e986){for(var _0x5e6acd=0x0,_0x53b752=events[_0xa6e0('0x6')];_0x5e6acd<_0x53b752;_0x5e6acd++){var _0x297572=events[_0x5e6acd];var _0x2d88d7=createListener(_0xa6e0('0x7')+_0x297572,_0x54e986);SmsQueueEvents['on'](_0x297572,_0x2d88d7);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f48dd05..ebbd7d3 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 _0xe8cb=['destroy','exports','multer','util','path','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x3edf59,_0x59be3b){var _0x155831=function(_0x55c721){while(--_0x55c721){_0x3edf59['push'](_0x3edf59['shift']());}};_0x155831(++_0x59be3b);}(_0xe8cb,0x11a));var _0xbe8c=function(_0x1cc7c5,_0x371f21){_0x1cc7c5=_0x1cc7c5-0x0;var _0x5ab89d=_0xe8cb[_0x1cc7c5];return _0x5ab89d;};'use strict';var multer=require(_0xbe8c('0x0'));var util=require(_0xbe8c('0x1'));var path=require(_0xbe8c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbe8c('0x3')]();var fs_extra=require(_0xbe8c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbe8c('0x5'));var controller=require(_0xbe8c('0x6'));router[_0xbe8c('0x7')]('/',auth[_0xbe8c('0x8')](),controller[_0xbe8c('0x9')]);router['get'](_0xbe8c('0xa'),auth[_0xbe8c('0x8')](),controller[_0xbe8c('0xb')]);router[_0xbe8c('0x7')](_0xbe8c('0xc'),auth[_0xbe8c('0x8')](),controller['show']);router[_0xbe8c('0xd')]('/',auth[_0xbe8c('0x8')](),controller[_0xbe8c('0xe')]);router[_0xbe8c('0xf')](_0xbe8c('0xc'),auth[_0xbe8c('0x8')](),controller[_0xbe8c('0x10')]);router[_0xbe8c('0x11')](_0xbe8c('0xc'),auth[_0xbe8c('0x8')](),controller[_0xbe8c('0x12')]);module[_0xbe8c('0x13')]=router; \ No newline at end of file +var _0x4c9c=['index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x2a9018,_0x1a6624){var _0x5e1b7c=function(_0x224678){while(--_0x224678){_0x2a9018['push'](_0x2a9018['shift']());}};_0x5e1b7c(++_0x1a6624);}(_0x4c9c,0x1ac));var _0xc4c9=function(_0x547fcb,_0x8fda67){_0x547fcb=_0x547fcb-0x0;var _0x275d17=_0x4c9c[_0x547fcb];return _0x275d17;};'use strict';var multer=require(_0xc4c9('0x0'));var util=require(_0xc4c9('0x1'));var path=require('path');var timeout=require(_0xc4c9('0x2'));var express=require(_0xc4c9('0x3'));var router=express[_0xc4c9('0x4')]();var fs_extra=require(_0xc4c9('0x5'));var auth=require(_0xc4c9('0x6'));var interaction=require(_0xc4c9('0x7'));var config=require(_0xc4c9('0x8'));var controller=require(_0xc4c9('0x9'));router[_0xc4c9('0xa')]('/',auth[_0xc4c9('0xb')](),controller[_0xc4c9('0xc')]);router[_0xc4c9('0xa')](_0xc4c9('0xd'),auth[_0xc4c9('0xb')](),controller[_0xc4c9('0xe')]);router[_0xc4c9('0xa')](_0xc4c9('0xf'),auth[_0xc4c9('0xb')](),controller[_0xc4c9('0x10')]);router['post']('/',auth[_0xc4c9('0xb')](),controller[_0xc4c9('0x11')]);router['put'](_0xc4c9('0xf'),auth['isAuthenticated'](),controller[_0xc4c9('0x12')]);router[_0xc4c9('0x13')](_0xc4c9('0xf'),auth[_0xc4c9('0xb')](),controller[_0xc4c9('0x14')]);module[_0xc4c9('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index dd16b1d..25ecae8 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 _0xacf9=['DATE','sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xacf9,0x13d));var _0x9acf=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xacf9[_0x3b0731];return _0x4204d7;};'use strict';var moment=require('moment');var Sequelize=require(_0x9acf('0x0'));module[_0x9acf('0x1')]={'uniqueid':{'type':Sequelize[_0x9acf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9acf('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9acf('0x3')]},'acceptAt':{'type':Sequelize[_0x9acf('0x3')]},'exitAt':{'type':Sequelize[_0x9acf('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1cac=['exports','STRING','DATE','moment','sequelize'];(function(_0x4e9dda,_0x273cd3){var _0x38f3d6=function(_0x2b4180){while(--_0x2b4180){_0x4e9dda['push'](_0x4e9dda['shift']());}};_0x38f3d6(++_0x273cd3);}(_0x1cac,0x1a7));var _0xc1ca=function(_0x515cd0,_0x51c016){_0x515cd0=_0x515cd0-0x0;var _0x4de499=_0x1cac[_0x515cd0];return _0x4de499;};'use strict';var moment=require(_0xc1ca('0x0'));var Sequelize=require(_0xc1ca('0x1'));module[_0xc1ca('0x2')]={'uniqueid':{'type':Sequelize[_0xc1ca('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc1ca('0x4')]},'leaveAt':{'type':Sequelize[_0xc1ca('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc1ca('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 550a474..441f140 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 _0x8a60=['rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','index','map','SmsQueueReport'];(function(_0x2cc8a5,_0x39ad7e){var _0x4183f9=function(_0x58d684){while(--_0x58d684){_0x2cc8a5['push'](_0x2cc8a5['shift']());}};_0x4183f9(++_0x39ad7e);}(_0x8a60,0xb9));var _0x08a6=function(_0x1cbcb2,_0x1237a3){_0x1cbcb2=_0x1cbcb2-0x0;var _0x41ac9f=_0x8a60[_0x1cbcb2];return _0x41ac9f;};'use strict';var emlformat=require(_0x08a6('0x0'));var rimraf=require(_0x08a6('0x1'));var zipdir=require(_0x08a6('0x2'));var jsonpatch=require(_0x08a6('0x3'));var rp=require('request-promise');var moment=require(_0x08a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x08a6('0x5'));var util=require(_0x08a6('0x6'));var path=require(_0x08a6('0x7'));var sox=require(_0x08a6('0x8'));var csv=require(_0x08a6('0x9'));var ejs=require(_0x08a6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08a6('0xb'));var squel=require('squel');var crypto=require(_0x08a6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x08a6('0x9'));var querystring=require(_0x08a6('0xd'));var Papa=require(_0x08a6('0xe'));var Redis=require('ioredis');var authService=require(_0x08a6('0xf'));var qs=require(_0x08a6('0x10'));var as=require(_0x08a6('0x11'));var hardwareService=require(_0x08a6('0x12'));var logger=require(_0x08a6('0x13'))(_0x08a6('0x14'));var utils=require(_0x08a6('0x15'));var config=require(_0x08a6('0x16'));var licenseUtil=require(_0x08a6('0x17'));var db=require(_0x08a6('0x18'))['db'];function respondWithStatusCode(_0x5b351b,_0x484d63){_0x484d63=_0x484d63||0xcc;return function(_0x397c46){if(_0x397c46){return _0x5b351b[_0x08a6('0x19')](_0x484d63);}return _0x5b351b['status'](_0x484d63)[_0x08a6('0x1a')]();};}function respondWithResult(_0x31cdba,_0x1cdff7){_0x1cdff7=_0x1cdff7||0xc8;return function(_0x5a420a){if(_0x5a420a){return _0x31cdba[_0x08a6('0x1b')](_0x1cdff7)['json'](_0x5a420a);}};}function respondWithFilteredResult(_0x1b7835,_0x360a92){return function(_0x1383c7){if(_0x1383c7){var _0x112e9c=typeof _0x360a92[_0x08a6('0x1c')]==='undefined'&&typeof _0x360a92[_0x08a6('0x1d')]===_0x08a6('0x1e');var _0x541931=_0x1383c7[_0x08a6('0x1f')];var _0x12e447=_0x112e9c?0x0:_0x360a92[_0x08a6('0x1c')];var _0x2dc2bd=_0x112e9c?_0x1383c7[_0x08a6('0x1f')]:_0x360a92[_0x08a6('0x1c')]+_0x360a92[_0x08a6('0x1d')];var _0x1744bc;if(_0x2dc2bd>=_0x541931){_0x2dc2bd=_0x541931;_0x1744bc=0xc8;}else{_0x1744bc=0xce;}_0x1b7835[_0x08a6('0x1b')](_0x1744bc);return _0x1b7835[_0x08a6('0x20')](_0x08a6('0x21'),_0x12e447+'-'+_0x2dc2bd+'/'+_0x541931)[_0x08a6('0x22')](_0x1383c7);}return null;};}function patchUpdates(_0x205d88){return function(_0x3b3bb0){try{jsonpatch[_0x08a6('0x23')](_0x3b3bb0,_0x205d88,!![]);}catch(_0x4cb91c){return BPromise[_0x08a6('0x24')](_0x4cb91c);}return _0x3b3bb0[_0x08a6('0x25')]();};}function saveUpdates(_0x31e68e,_0x4637fb){return function(_0x27c3f0){if(_0x27c3f0){return _0x27c3f0[_0x08a6('0x26')](_0x31e68e)['then'](function(_0x110f4b){return _0x110f4b;});}return null;};}function removeEntity(_0xe5b3cf,_0x18615b){return function(_0x40163b){if(_0x40163b){return _0x40163b[_0x08a6('0x27')]()[_0x08a6('0x28')](function(){_0xe5b3cf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2faa88,_0xf6c6ea){return function(_0x5a87c3){if(!_0x5a87c3){_0x2faa88[_0x08a6('0x19')](0x194);}return _0x5a87c3;};}function handleError(_0x407242,_0x468ebb){_0x468ebb=_0x468ebb||0x1f4;return function(_0x420813){logger['error'](_0x420813[_0x08a6('0x29')]);if(_0x420813[_0x08a6('0x2a')]){delete _0x420813[_0x08a6('0x2a')];}_0x407242[_0x08a6('0x1b')](_0x468ebb)['send'](_0x420813);};}exports[_0x08a6('0x2b')]=function(_0x3acb52,_0x2116fd){var _0x44be53={},_0x2ab877={},_0x5a693b={'count':0x0,'rows':[]};var _0x208fd5=_[_0x08a6('0x2c')](db[_0x08a6('0x2d')][_0x08a6('0x2e')],function(_0x4fa3ae){return{'name':_0x4fa3ae['fieldName'],'type':_0x4fa3ae['type']['key']};});_0x2ab877['model']=_[_0x08a6('0x2c')](_0x208fd5,_0x08a6('0x2a'));_0x2ab877['query']=_['keys'](_0x3acb52[_0x08a6('0x2f')]);_0x2ab877['filters']=_[_0x08a6('0x30')](_0x2ab877[_0x08a6('0x31')],_0x2ab877[_0x08a6('0x2f')]);_0x44be53[_0x08a6('0x32')]=_[_0x08a6('0x30')](_0x2ab877[_0x08a6('0x31')],qs[_0x08a6('0x33')](_0x3acb52[_0x08a6('0x2f')][_0x08a6('0x33')]));_0x44be53[_0x08a6('0x32')]=_0x44be53[_0x08a6('0x32')][_0x08a6('0x34')]?_0x44be53[_0x08a6('0x32')]:_0x2ab877[_0x08a6('0x31')];if(!_0x3acb52[_0x08a6('0x2f')][_0x08a6('0x35')](_0x08a6('0x36'))){_0x44be53[_0x08a6('0x1d')]=qs['limit'](_0x3acb52['query'][_0x08a6('0x1d')]);_0x44be53[_0x08a6('0x1c')]=qs[_0x08a6('0x1c')](_0x3acb52[_0x08a6('0x2f')]['offset']);}_0x44be53[_0x08a6('0x37')]=qs[_0x08a6('0x38')](_0x3acb52[_0x08a6('0x2f')][_0x08a6('0x38')]);_0x44be53[_0x08a6('0x39')]=qs['filters'](_[_0x08a6('0x3a')](_0x3acb52[_0x08a6('0x2f')],_0x2ab877[_0x08a6('0x3b')]),_0x208fd5);if(_0x3acb52[_0x08a6('0x2f')][_0x08a6('0x3c')]){_0x44be53[_0x08a6('0x39')]=_[_0x08a6('0x3d')](_0x44be53[_0x08a6('0x39')],{'$or':_[_0x08a6('0x2c')](_0x208fd5,function(_0x20c59e){if(_0x20c59e[_0x08a6('0x3e')]!==_0x08a6('0x3f')){var _0x461dec={};_0x461dec[_0x20c59e[_0x08a6('0x2a')]]={'$like':'%'+_0x3acb52['query']['filter']+'%'};return _0x461dec;}})});}_0x44be53=_[_0x08a6('0x3d')]({},_0x44be53,_0x3acb52[_0x08a6('0x40')]);var _0x314c66={'where':_0x44be53['where']};return db['SmsQueueReport'][_0x08a6('0x1f')](_0x314c66)[_0x08a6('0x28')](function(_0x3639a2){_0x5a693b[_0x08a6('0x1f')]=_0x3639a2;if(_0x3acb52['query']['includeAll']){_0x44be53[_0x08a6('0x41')]=[{'all':!![]}];}return db[_0x08a6('0x2d')][_0x08a6('0x42')](_0x44be53);})['then'](function(_0x14e2a2){_0x5a693b[_0x08a6('0x43')]=_0x14e2a2;return _0x5a693b;})[_0x08a6('0x28')](respondWithFilteredResult(_0x2116fd,_0x44be53))[_0x08a6('0x44')](handleError(_0x2116fd,null));};exports[_0x08a6('0x45')]=function(_0x151255,_0x25c015){var _0x3d4f3a={'raw':!![],'where':{'id':_0x151255[_0x08a6('0x46')]['id']}},_0xacc3cd={};_0xacc3cd[_0x08a6('0x31')]=_[_0x08a6('0x47')](db[_0x08a6('0x2d')][_0x08a6('0x2e')]);_0xacc3cd[_0x08a6('0x2f')]=_['keys'](_0x151255[_0x08a6('0x2f')]);_0xacc3cd[_0x08a6('0x3b')]=_['intersection'](_0xacc3cd[_0x08a6('0x31')],_0xacc3cd['query']);_0x3d4f3a[_0x08a6('0x32')]=_[_0x08a6('0x30')](_0xacc3cd['model'],qs[_0x08a6('0x33')](_0x151255[_0x08a6('0x2f')][_0x08a6('0x33')]));_0x3d4f3a['attributes']=_0x3d4f3a[_0x08a6('0x32')][_0x08a6('0x34')]?_0x3d4f3a['attributes']:_0xacc3cd[_0x08a6('0x31')];if(_0x151255[_0x08a6('0x2f')][_0x08a6('0x48')]){_0x3d4f3a[_0x08a6('0x41')]=[{'all':!![]}];}_0x3d4f3a=_[_0x08a6('0x3d')]({},_0x3d4f3a,_0x151255['options']);return db[_0x08a6('0x2d')][_0x08a6('0x49')](_0x3d4f3a)[_0x08a6('0x28')](handleEntityNotFound(_0x25c015,null))[_0x08a6('0x28')](respondWithResult(_0x25c015,null))[_0x08a6('0x44')](handleError(_0x25c015,null));};exports[_0x08a6('0x4a')]=function(_0x5a0228,_0x4032d1){return db[_0x08a6('0x2d')]['create'](_0x5a0228[_0x08a6('0x4b')],{})[_0x08a6('0x28')](respondWithResult(_0x4032d1,0xc9))['catch'](handleError(_0x4032d1,null));};exports[_0x08a6('0x26')]=function(_0x1cac1f,_0x54a169){if(_0x1cac1f[_0x08a6('0x4b')]['id']){delete _0x1cac1f[_0x08a6('0x4b')]['id'];}return db['SmsQueueReport'][_0x08a6('0x49')]({'where':{'id':_0x1cac1f[_0x08a6('0x46')]['id']}})[_0x08a6('0x28')](handleEntityNotFound(_0x54a169,null))['then'](saveUpdates(_0x1cac1f[_0x08a6('0x4b')],null))[_0x08a6('0x28')](respondWithResult(_0x54a169,null))[_0x08a6('0x44')](handleError(_0x54a169,null));};exports['destroy']=function(_0xb6ea6f,_0x1d4e35){return db[_0x08a6('0x2d')][_0x08a6('0x49')]({'where':{'id':_0xb6ea6f[_0x08a6('0x46')]['id']}})[_0x08a6('0x28')](handleEntityNotFound(_0x1d4e35,null))[_0x08a6('0x28')](removeEntity(_0x1d4e35,null))[_0x08a6('0x44')](handleError(_0x1d4e35,null));};exports['describe']=function(_0xf0ceca,_0x281d00){return db[_0x08a6('0x2d')][_0x08a6('0x4c')]()['then'](respondWithResult(_0x281d00,null))[_0x08a6('0x44')](handleError(_0x281d00,null));}; \ No newline at end of file +var _0x3e3b=['sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','create','body','destroy','describe','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order'];(function(_0x581eb9,_0x3f7bd9){var _0x4d1665=function(_0x2587bf){while(--_0x2587bf){_0x581eb9['push'](_0x581eb9['shift']());}};_0x4d1665(++_0x3f7bd9);}(_0x3e3b,0xfb));var _0xb3e3=function(_0x118339,_0x2f5de5){_0x118339=_0x118339-0x0;var _0xca6fa5=_0x3e3b[_0x118339];return _0xca6fa5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3e3('0x0'));var zipdir=require(_0xb3e3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb3e3('0x2'));var Mustache=require(_0xb3e3('0x3'));var util=require(_0xb3e3('0x4'));var path=require(_0xb3e3('0x5'));var sox=require(_0xb3e3('0x6'));var csv=require(_0xb3e3('0x7'));var ejs=require(_0xb3e3('0x8'));var fs=require('fs');var fs_extra=require(_0xb3e3('0x9'));var _=require(_0xb3e3('0xa'));var squel=require('squel');var crypto=require(_0xb3e3('0xb'));var jsforce=require(_0xb3e3('0xc'));var deskjs=require(_0xb3e3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb3e3('0xe'));var Papa=require(_0xb3e3('0xf'));var Redis=require(_0xb3e3('0x10'));var authService=require(_0xb3e3('0x11'));var qs=require(_0xb3e3('0x12'));var as=require(_0xb3e3('0x13'));var hardwareService=require(_0xb3e3('0x14'));var logger=require(_0xb3e3('0x15'))(_0xb3e3('0x16'));var utils=require(_0xb3e3('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb3e3('0x18'))['db'];function respondWithStatusCode(_0x4e26a4,_0x2c15c2){_0x2c15c2=_0x2c15c2||0xcc;return function(_0x2184c0){if(_0x2184c0){return _0x4e26a4[_0xb3e3('0x19')](_0x2c15c2);}return _0x4e26a4[_0xb3e3('0x1a')](_0x2c15c2)[_0xb3e3('0x1b')]();};}function respondWithResult(_0x4ee150,_0x523c76){_0x523c76=_0x523c76||0xc8;return function(_0x14338a){if(_0x14338a){return _0x4ee150[_0xb3e3('0x1a')](_0x523c76)[_0xb3e3('0x1c')](_0x14338a);}};}function respondWithFilteredResult(_0xa5a494,_0x54c9f1){return function(_0x4f68ce){if(_0x4f68ce){var _0x2bf729=typeof _0x54c9f1['offset']===_0xb3e3('0x1d')&&typeof _0x54c9f1[_0xb3e3('0x1e')]==='undefined';var _0x23f8a0=_0x4f68ce[_0xb3e3('0x1f')];var _0x15689a=_0x2bf729?0x0:_0x54c9f1[_0xb3e3('0x20')];var _0x3f55f6=_0x2bf729?_0x4f68ce[_0xb3e3('0x1f')]:_0x54c9f1[_0xb3e3('0x20')]+_0x54c9f1[_0xb3e3('0x1e')];var _0xa7d42a;if(_0x3f55f6>=_0x23f8a0){_0x3f55f6=_0x23f8a0;_0xa7d42a=0xc8;}else{_0xa7d42a=0xce;}_0xa5a494[_0xb3e3('0x1a')](_0xa7d42a);return _0xa5a494[_0xb3e3('0x21')](_0xb3e3('0x22'),_0x15689a+'-'+_0x3f55f6+'/'+_0x23f8a0)[_0xb3e3('0x1c')](_0x4f68ce);}return null;};}function patchUpdates(_0x327386){return function(_0x166844){try{jsonpatch[_0xb3e3('0x23')](_0x166844,_0x327386,!![]);}catch(_0xa4ba36){return BPromise[_0xb3e3('0x24')](_0xa4ba36);}return _0x166844[_0xb3e3('0x25')]();};}function saveUpdates(_0xa6e4b0,_0x12c306){return function(_0x10864d){if(_0x10864d){return _0x10864d[_0xb3e3('0x26')](_0xa6e4b0)[_0xb3e3('0x27')](function(_0x2ed340){return _0x2ed340;});}return null;};}function removeEntity(_0x2792ba,_0xadbc95){return function(_0x354dbd){if(_0x354dbd){return _0x354dbd['destroy']()[_0xb3e3('0x27')](function(){_0x2792ba[_0xb3e3('0x1a')](0xcc)[_0xb3e3('0x1b')]();});}};}function handleEntityNotFound(_0x34ced3,_0x3cca63){return function(_0x10e821){if(!_0x10e821){_0x34ced3[_0xb3e3('0x19')](0x194);}return _0x10e821;};}function handleError(_0x41839c,_0x2d5bd6){_0x2d5bd6=_0x2d5bd6||0x1f4;return function(_0x41d0c3){logger[_0xb3e3('0x28')](_0x41d0c3[_0xb3e3('0x29')]);if(_0x41d0c3[_0xb3e3('0x2a')]){delete _0x41d0c3['name'];}_0x41839c[_0xb3e3('0x1a')](_0x2d5bd6)[_0xb3e3('0x2b')](_0x41d0c3);};}exports[_0xb3e3('0x2c')]=function(_0x6413af,_0x1f031c){var _0x1f5899={},_0x45b628={},_0x5d033e={'count':0x0,'rows':[]};var _0xe4131f=_[_0xb3e3('0x2d')](db[_0xb3e3('0x2e')][_0xb3e3('0x2f')],function(_0x502eb0){return{'name':_0x502eb0[_0xb3e3('0x30')],'type':_0x502eb0[_0xb3e3('0x31')][_0xb3e3('0x32')]};});_0x45b628[_0xb3e3('0x33')]=_[_0xb3e3('0x2d')](_0xe4131f,_0xb3e3('0x2a'));_0x45b628['query']=_[_0xb3e3('0x34')](_0x6413af[_0xb3e3('0x35')]);_0x45b628[_0xb3e3('0x36')]=_['intersection'](_0x45b628['model'],_0x45b628[_0xb3e3('0x35')]);_0x1f5899[_0xb3e3('0x37')]=_[_0xb3e3('0x38')](_0x45b628[_0xb3e3('0x33')],qs[_0xb3e3('0x39')](_0x6413af[_0xb3e3('0x35')]['fields']));_0x1f5899[_0xb3e3('0x37')]=_0x1f5899[_0xb3e3('0x37')][_0xb3e3('0x3a')]?_0x1f5899[_0xb3e3('0x37')]:_0x45b628[_0xb3e3('0x33')];if(!_0x6413af[_0xb3e3('0x35')][_0xb3e3('0x3b')]('nolimit')){_0x1f5899[_0xb3e3('0x1e')]=qs[_0xb3e3('0x1e')](_0x6413af[_0xb3e3('0x35')]['limit']);_0x1f5899[_0xb3e3('0x20')]=qs[_0xb3e3('0x20')](_0x6413af[_0xb3e3('0x35')][_0xb3e3('0x20')]);}_0x1f5899[_0xb3e3('0x3c')]=qs[_0xb3e3('0x3d')](_0x6413af[_0xb3e3('0x35')][_0xb3e3('0x3d')]);_0x1f5899[_0xb3e3('0x3e')]=qs[_0xb3e3('0x36')](_[_0xb3e3('0x3f')](_0x6413af[_0xb3e3('0x35')],_0x45b628[_0xb3e3('0x36')]),_0xe4131f);if(_0x6413af[_0xb3e3('0x35')]['filter']){_0x1f5899[_0xb3e3('0x3e')]=_[_0xb3e3('0x40')](_0x1f5899[_0xb3e3('0x3e')],{'$or':_[_0xb3e3('0x2d')](_0xe4131f,function(_0x20b9b1){if(_0x20b9b1[_0xb3e3('0x31')]!==_0xb3e3('0x41')){var _0x299395={};_0x299395[_0x20b9b1['name']]={'$like':'%'+_0x6413af['query'][_0xb3e3('0x42')]+'%'};return _0x299395;}})});}_0x1f5899=_[_0xb3e3('0x40')]({},_0x1f5899,_0x6413af[_0xb3e3('0x43')]);var _0xcece04={'where':_0x1f5899['where']};return db['SmsQueueReport'][_0xb3e3('0x1f')](_0xcece04)[_0xb3e3('0x27')](function(_0x4ee9cb){_0x5d033e[_0xb3e3('0x1f')]=_0x4ee9cb;if(_0x6413af[_0xb3e3('0x35')][_0xb3e3('0x44')]){_0x1f5899['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xb3e3('0x45')](_0x1f5899);})[_0xb3e3('0x27')](function(_0x28f9c5){_0x5d033e[_0xb3e3('0x46')]=_0x28f9c5;return _0x5d033e;})[_0xb3e3('0x27')](respondWithFilteredResult(_0x1f031c,_0x1f5899))[_0xb3e3('0x47')](handleError(_0x1f031c,null));};exports[_0xb3e3('0x48')]=function(_0x172d85,_0x3f8774){var _0x44dfd6={'raw':!![],'where':{'id':_0x172d85[_0xb3e3('0x49')]['id']}},_0x111976={};_0x111976['model']=_[_0xb3e3('0x34')](db[_0xb3e3('0x2e')][_0xb3e3('0x2f')]);_0x111976[_0xb3e3('0x35')]=_[_0xb3e3('0x34')](_0x172d85[_0xb3e3('0x35')]);_0x111976['filters']=_['intersection'](_0x111976[_0xb3e3('0x33')],_0x111976[_0xb3e3('0x35')]);_0x44dfd6[_0xb3e3('0x37')]=_[_0xb3e3('0x38')](_0x111976[_0xb3e3('0x33')],qs[_0xb3e3('0x39')](_0x172d85[_0xb3e3('0x35')][_0xb3e3('0x39')]));_0x44dfd6[_0xb3e3('0x37')]=_0x44dfd6[_0xb3e3('0x37')][_0xb3e3('0x3a')]?_0x44dfd6[_0xb3e3('0x37')]:_0x111976[_0xb3e3('0x33')];if(_0x172d85[_0xb3e3('0x35')][_0xb3e3('0x44')]){_0x44dfd6['include']=[{'all':!![]}];}_0x44dfd6=_[_0xb3e3('0x40')]({},_0x44dfd6,_0x172d85[_0xb3e3('0x43')]);return db[_0xb3e3('0x2e')]['find'](_0x44dfd6)[_0xb3e3('0x27')](handleEntityNotFound(_0x3f8774,null))[_0xb3e3('0x27')](respondWithResult(_0x3f8774,null))[_0xb3e3('0x47')](handleError(_0x3f8774,null));};exports['create']=function(_0x111539,_0x54bfd2){return db[_0xb3e3('0x2e')][_0xb3e3('0x4a')](_0x111539['body'],{})[_0xb3e3('0x27')](respondWithResult(_0x54bfd2,0xc9))['catch'](handleError(_0x54bfd2,null));};exports[_0xb3e3('0x26')]=function(_0x2a5a6b,_0x5398a1){if(_0x2a5a6b[_0xb3e3('0x4b')]['id']){delete _0x2a5a6b['body']['id'];}return db[_0xb3e3('0x2e')]['find']({'where':{'id':_0x2a5a6b[_0xb3e3('0x49')]['id']}})[_0xb3e3('0x27')](handleEntityNotFound(_0x5398a1,null))[_0xb3e3('0x27')](saveUpdates(_0x2a5a6b['body'],null))[_0xb3e3('0x27')](respondWithResult(_0x5398a1,null))[_0xb3e3('0x47')](handleError(_0x5398a1,null));};exports[_0xb3e3('0x4c')]=function(_0x47eac2,_0x34192b){return db[_0xb3e3('0x2e')]['find']({'where':{'id':_0x47eac2[_0xb3e3('0x49')]['id']}})[_0xb3e3('0x27')](handleEntityNotFound(_0x34192b,null))['then'](removeEntity(_0x34192b,null))[_0xb3e3('0x47')](handleError(_0x34192b,null));};exports['describe']=function(_0x3c0a40,_0x42270b){return db[_0xb3e3('0x2e')][_0xb3e3('0x4d')]()[_0xb3e3('0x27')](respondWithResult(_0x42270b,null))['catch'](handleError(_0x42270b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index eb1a5a0..82e0be3 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2343c9,_0x12b258){var _0x52bb56=function(_0x15294b){while(--_0x15294b){_0x2343c9['push'](_0x2343c9['shift']());}};_0x52bb56(++_0x12b258);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xcb91[_0x4d35f3];return _0x382fea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x48e50d,_0x3754f3){var _0x27f78b=function(_0x39613a){while(--_0x39613a){_0x48e50d['push'](_0x48e50d['shift']());}};_0x27f78b(++_0x3754f3);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 8df3740..108091b 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 _0xf250=['SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SmsQueueReport','body','options','raw','CreateSmsQueueReport','debug','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s'];(function(_0x21cf80,_0x1fb0a1){var _0x5c6bed=function(_0x3492c3){while(--_0x3492c3){_0x21cf80['push'](_0x21cf80['shift']());}};_0x5c6bed(++_0x1fb0a1);}(_0xf250,0x122));var _0x0f25=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xf250[_0x21cb7f];return _0x5a079a;};'use strict';var _=require(_0x0f25('0x0'));var util=require(_0x0f25('0x1'));var moment=require(_0x0f25('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f25('0x4'))['db'];var utils=require(_0x0f25('0x5'));var logger=require(_0x0f25('0x6'))(_0x0f25('0x7'));var config=require(_0x0f25('0x8'));var jayson=require(_0x0f25('0x9'));var client=jayson[_0x0f25('0xa')][_0x0f25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e7ce4,_0x4304fa,_0x5e7a41){return new BPromise(function(_0xbdc11,_0xd1bb76){return client[_0x0f25('0xc')](_0x5e7ce4,_0x5e7a41)[_0x0f25('0xd')](function(_0x176e7a){logger[_0x0f25('0xe')](_0x0f25('0xf'),_0x4304fa,'request\x20sent');logger['debug'](_0x0f25('0x10'),_0x4304fa,_0x0f25('0x11'),JSON[_0x0f25('0x12')](_0x176e7a));if(_0x176e7a[_0x0f25('0x13')]){if(_0x176e7a[_0x0f25('0x13')]['code']===0x1f4){logger[_0x0f25('0x13')](_0x0f25('0xf'),_0x4304fa,_0x176e7a['error'][_0x0f25('0x14')]);return _0xd1bb76(_0x176e7a[_0x0f25('0x13')][_0x0f25('0x14')]);}logger[_0x0f25('0x13')](_0x0f25('0xf'),_0x4304fa,_0x176e7a[_0x0f25('0x13')][_0x0f25('0x14')]);return _0xbdc11(_0x176e7a[_0x0f25('0x13')]['message']);}else{logger[_0x0f25('0xe')](_0x0f25('0xf'),_0x4304fa,_0x0f25('0x11'));_0xbdc11(_0x176e7a[_0x0f25('0x15')][_0x0f25('0x14')]);}})[_0x0f25('0x16')](function(_0x26924f){logger[_0x0f25('0x13')](_0x0f25('0xf'),_0x4304fa,_0x26924f);_0xd1bb76(_0x26924f);});});}exports['CreateSmsQueueReport']=function(_0x35478f){var _0x2ac85e=this;return new Promise(function(_0x105bfa,_0x12c8e8){return db[_0x0f25('0x17')]['create'](_0x35478f[_0x0f25('0x18')],{'raw':_0x35478f[_0x0f25('0x19')]?_0x35478f['options'][_0x0f25('0x1a')]===undefined?!![]:![]:!![]})[_0x0f25('0xd')](function(_0x31fed4){logger[_0x0f25('0xe')](_0x0f25('0x1b'),_0x35478f);logger[_0x0f25('0x1c')](_0x0f25('0x1b'),_0x35478f,JSON[_0x0f25('0x12')](_0x31fed4));_0x105bfa(_0x31fed4);})[_0x0f25('0x16')](function(_0x14eadc){logger[_0x0f25('0x13')](_0x0f25('0x1b'),_0x14eadc[_0x0f25('0x14')],_0x35478f);_0x12c8e8(_0x2ac85e[_0x0f25('0x13')](0x1f4,_0x14eadc[_0x0f25('0x14')]));});});};exports[_0x0f25('0x1d')]=function(_0x58a538){var _0x2062a2=this;return new Promise(function(_0x395fc3,_0x3696ad){return db['SmsQueueReport'][_0x0f25('0x1e')](_0x58a538[_0x0f25('0x18')],{'raw':_0x58a538[_0x0f25('0x19')]?_0x58a538[_0x0f25('0x19')][_0x0f25('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58a538[_0x0f25('0x19')]?_0x58a538[_0x0f25('0x19')][_0x0f25('0x1f')]||null:null,'attributes':_0x58a538[_0x0f25('0x19')]?_0x58a538[_0x0f25('0x19')][_0x0f25('0x20')]||null:null,'limit':_0x58a538[_0x0f25('0x19')]?_0x58a538['options'][_0x0f25('0x21')]||null:null})['then'](function(_0x543876){logger[_0x0f25('0xe')]('UpdateSmsQueueReport',_0x58a538);logger['debug'](_0x0f25('0x1d'),_0x58a538,JSON['stringify'](_0x543876));_0x395fc3(_0x543876);})[_0x0f25('0x16')](function(_0x158eac){logger[_0x0f25('0x13')](_0x0f25('0x1d'),_0x158eac[_0x0f25('0x14')],_0x58a538);_0x3696ad(_0x2062a2[_0x0f25('0x13')](0x1f4,_0x158eac[_0x0f25('0x14')]));});});}; \ No newline at end of file +var _0x5415=['SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','stringify','UpdateSmsQueueReport','update','body','attributes','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x57ba2f,_0x4ad62f){var _0x410bf8=function(_0x5fbdef){while(--_0x5fbdef){_0x57ba2f['push'](_0x57ba2f['shift']());}};_0x410bf8(++_0x4ad62f);}(_0x5415,0x7f));var _0x5541=function(_0x18e5e3,_0x41100b){_0x18e5e3=_0x18e5e3-0x0;var _0x375fed=_0x5415[_0x18e5e3];return _0x375fed;};'use strict';var _=require('lodash');var util=require(_0x5541('0x0'));var moment=require('moment');var BPromise=require(_0x5541('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5541('0x2'));var db=require(_0x5541('0x3'))['db'];var utils=require(_0x5541('0x4'));var logger=require(_0x5541('0x5'))(_0x5541('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x163fcf,_0x10fe46,_0x51a0ed){return new BPromise(function(_0x5eb5b1,_0x34d37e){return client['request'](_0x163fcf,_0x51a0ed)[_0x5541('0x7')](function(_0x4ad0af){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x10fe46,_0x5541('0x8'));logger[_0x5541('0x9')](_0x5541('0xa'),_0x10fe46,_0x5541('0x8'),JSON['stringify'](_0x4ad0af));if(_0x4ad0af[_0x5541('0xb')]){if(_0x4ad0af[_0x5541('0xb')][_0x5541('0xc')]===0x1f4){logger['error'](_0x5541('0xd'),_0x10fe46,_0x4ad0af[_0x5541('0xb')]['message']);return _0x34d37e(_0x4ad0af[_0x5541('0xb')]['message']);}logger[_0x5541('0xb')](_0x5541('0xd'),_0x10fe46,_0x4ad0af[_0x5541('0xb')][_0x5541('0xe')]);return _0x5eb5b1(_0x4ad0af[_0x5541('0xb')][_0x5541('0xe')]);}else{logger[_0x5541('0xf')](_0x5541('0xd'),_0x10fe46,_0x5541('0x8'));_0x5eb5b1(_0x4ad0af[_0x5541('0x10')][_0x5541('0xe')]);}})[_0x5541('0x11')](function(_0x37ba85){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x10fe46,_0x37ba85);_0x34d37e(_0x37ba85);});});}exports[_0x5541('0x12')]=function(_0x53bb42){var _0x43643b=this;return new Promise(function(_0x2d88a8,_0xf1ea56){return db[_0x5541('0x13')][_0x5541('0x14')](_0x53bb42['body'],{'raw':_0x53bb42['options']?_0x53bb42[_0x5541('0x15')][_0x5541('0x16')]===undefined?!![]:![]:!![]})[_0x5541('0x7')](function(_0x26544c){logger[_0x5541('0xf')](_0x5541('0x12'),_0x53bb42);logger[_0x5541('0x9')](_0x5541('0x12'),_0x53bb42,JSON[_0x5541('0x17')](_0x26544c));_0x2d88a8(_0x26544c);})['catch'](function(_0x39bede){logger[_0x5541('0xb')](_0x5541('0x12'),_0x39bede[_0x5541('0xe')],_0x53bb42);_0xf1ea56(_0x43643b[_0x5541('0xb')](0x1f4,_0x39bede[_0x5541('0xe')]));});});};exports[_0x5541('0x18')]=function(_0x3fa63d){var _0x56fc19=this;return new Promise(function(_0x8b0b96,_0x1d2111){return db[_0x5541('0x13')][_0x5541('0x19')](_0x3fa63d[_0x5541('0x1a')],{'raw':_0x3fa63d[_0x5541('0x15')]?_0x3fa63d['options'][_0x5541('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fa63d['options']?_0x3fa63d['options']['where']||null:null,'attributes':_0x3fa63d[_0x5541('0x15')]?_0x3fa63d[_0x5541('0x15')][_0x5541('0x1b')]||null:null,'limit':_0x3fa63d[_0x5541('0x15')]?_0x3fa63d[_0x5541('0x15')]['limit']||null:null})[_0x5541('0x7')](function(_0x52d432){logger[_0x5541('0xf')](_0x5541('0x18'),_0x3fa63d);logger[_0x5541('0x9')](_0x5541('0x18'),_0x3fa63d,JSON[_0x5541('0x17')](_0x52d432));_0x8b0b96(_0x52d432);})['catch'](function(_0x35611d){logger['error'](_0x5541('0x18'),_0x35611d[_0x5541('0xe')],_0x3fa63d);_0x1d2111(_0x56fc19[_0x5541('0xb')](0x1f4,_0x35611d[_0x5541('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 593caf7..fa4b2b8 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 _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x49bfc4,_0x5cb663){var _0x253115=function(_0x24e620){while(--_0x24e620){_0x49bfc4['push'](_0x49bfc4['shift']());}};_0x253115(++_0x5cb663);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0xfd0f=['index','/describe','describe','/:id','show','post','put','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated'];(function(_0x1142e8,_0x103816){var _0x55b991=function(_0x13f248){while(--_0x13f248){_0x1142e8['push'](_0x1142e8['shift']());}};_0x55b991(++_0x103816);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x20db55,_0xb2ad23){_0x20db55=_0x20db55-0x0;var _0x2a07ba=_0xfd0f[_0x20db55];return _0x2a07ba;};'use strict';var multer=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var path=require('path');var timeout=require(_0xffd0('0x2'));var express=require(_0xffd0('0x3'));var router=express[_0xffd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffd0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffd0('0x6'));var controller=require(_0xffd0('0x7'));router[_0xffd0('0x8')]('/',auth[_0xffd0('0x9')](),controller[_0xffd0('0xa')]);router[_0xffd0('0x8')](_0xffd0('0xb'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xc')]);router['get'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xe')]);router[_0xffd0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xffd0('0x10')](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller['update']);router['delete'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller['destroy']);module[_0xffd0('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index ae9cebe..d6c2e18 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xda501a,_0x159d6a){var _0x44be3a=function(_0x5c1c5f){while(--_0x5c1c5f){_0xda501a['push'](_0xda501a['shift']());}};_0x44be3a(++_0x159d6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x31337d,_0x58ffe4){var _0x39ed39=function(_0x4b3ea1){while(--_0x4b3ea1){_0x31337d['push'](_0x31337d['shift']());}};_0x39ed39(++_0x58ffe4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x56de0b,_0x1c39c1){_0x56de0b=_0x56de0b-0x0;var _0x1c05f0=_0xf3cd[_0x56de0b];return _0x1c05f0;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9bc9df5..fda9052 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 _0xda1b=['end','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','SmsTransferReport','findAll','rows','catch','includeAll','include','find','create','body','update','destroy','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','then'];(function(_0x3bbd2d,_0xf8ba3c){var _0x241bd4=function(_0x4f02fb){while(--_0x4f02fb){_0x3bbd2d['push'](_0x3bbd2d['shift']());}};_0x241bd4(++_0xf8ba3c);}(_0xda1b,0xb5));var _0xbda1=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xda1b[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0xbda1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbda1('0x1'));var jsonpatch=require(_0xbda1('0x2'));var rp=require(_0xbda1('0x3'));var moment=require(_0xbda1('0x4'));var BPromise=require(_0xbda1('0x5'));var Mustache=require(_0xbda1('0x6'));var util=require('util');var path=require(_0xbda1('0x7'));var sox=require(_0xbda1('0x8'));var csv=require(_0xbda1('0x9'));var ejs=require(_0xbda1('0xa'));var fs=require('fs');var fs_extra=require(_0xbda1('0xb'));var _=require('lodash');var squel=require(_0xbda1('0xc'));var crypto=require(_0xbda1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbda1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbda1('0xe'));var qs=require(_0xbda1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbda1('0x10'))('api');var utils=require(_0xbda1('0x11'));var config=require(_0xbda1('0x12'));var licenseUtil=require(_0xbda1('0x13'));var db=require(_0xbda1('0x14'))['db'];function respondWithStatusCode(_0x3ff1de,_0x1dbe72){_0x1dbe72=_0x1dbe72||0xcc;return function(_0x51fd39){if(_0x51fd39){return _0x3ff1de[_0xbda1('0x15')](_0x1dbe72);}return _0x3ff1de[_0xbda1('0x16')](_0x1dbe72)['end']();};}function respondWithResult(_0x59746b,_0x42e44d){_0x42e44d=_0x42e44d||0xc8;return function(_0x13a0de){if(_0x13a0de){return _0x59746b[_0xbda1('0x16')](_0x42e44d)[_0xbda1('0x17')](_0x13a0de);}};}function respondWithFilteredResult(_0x294804,_0x12048a){return function(_0x13f654){if(_0x13f654){var _0x18619d=typeof _0x12048a[_0xbda1('0x18')]==='undefined'&&typeof _0x12048a[_0xbda1('0x19')]==='undefined';var _0x4972a1=_0x13f654[_0xbda1('0x1a')];var _0xde7a6=_0x18619d?0x0:_0x12048a[_0xbda1('0x18')];var _0xd89f9c=_0x18619d?_0x13f654[_0xbda1('0x1a')]:_0x12048a[_0xbda1('0x18')]+_0x12048a[_0xbda1('0x19')];var _0x2de0d2;if(_0xd89f9c>=_0x4972a1){_0xd89f9c=_0x4972a1;_0x2de0d2=0xc8;}else{_0x2de0d2=0xce;}_0x294804[_0xbda1('0x16')](_0x2de0d2);return _0x294804[_0xbda1('0x1b')](_0xbda1('0x1c'),_0xde7a6+'-'+_0xd89f9c+'/'+_0x4972a1)['json'](_0x13f654);}return null;};}function patchUpdates(_0x16afdb){return function(_0x193969){try{jsonpatch[_0xbda1('0x1d')](_0x193969,_0x16afdb,!![]);}catch(_0x145992){return BPromise[_0xbda1('0x1e')](_0x145992);}return _0x193969['save']();};}function saveUpdates(_0x282edc,_0x5b2db8){return function(_0x50f2ac){if(_0x50f2ac){return _0x50f2ac['update'](_0x282edc)[_0xbda1('0x1f')](function(_0xab0827){return _0xab0827;});}return null;};}function removeEntity(_0x34f058,_0x1444a7){return function(_0x26f459){if(_0x26f459){return _0x26f459['destroy']()[_0xbda1('0x1f')](function(){_0x34f058[_0xbda1('0x16')](0xcc)[_0xbda1('0x20')]();});}};}function handleEntityNotFound(_0x47aa71,_0x283a55){return function(_0x1f8216){if(!_0x1f8216){_0x47aa71[_0xbda1('0x15')](0x194);}return _0x1f8216;};}function handleError(_0x52c87c,_0x53f318){_0x53f318=_0x53f318||0x1f4;return function(_0x3e1968){logger[_0xbda1('0x21')](_0x3e1968[_0xbda1('0x22')]);if(_0x3e1968['name']){delete _0x3e1968[_0xbda1('0x23')];}_0x52c87c['status'](_0x53f318)[_0xbda1('0x24')](_0x3e1968);};}exports['index']=function(_0x5b2c93,_0x512c97){var _0x14f8db={},_0x36a460={},_0x33bfe9={'count':0x0,'rows':[]};var _0x839ca6=_[_0xbda1('0x25')](db['SmsTransferReport'][_0xbda1('0x26')],function(_0x28087b){return{'name':_0x28087b['fieldName'],'type':_0x28087b[_0xbda1('0x27')][_0xbda1('0x28')]};});_0x36a460[_0xbda1('0x29')]=_[_0xbda1('0x25')](_0x839ca6,_0xbda1('0x23'));_0x36a460[_0xbda1('0x2a')]=_[_0xbda1('0x2b')](_0x5b2c93['query']);_0x36a460[_0xbda1('0x2c')]=_[_0xbda1('0x2d')](_0x36a460[_0xbda1('0x29')],_0x36a460[_0xbda1('0x2a')]);_0x14f8db['attributes']=_[_0xbda1('0x2d')](_0x36a460[_0xbda1('0x29')],qs['fields'](_0x5b2c93[_0xbda1('0x2a')][_0xbda1('0x2e')]));_0x14f8db[_0xbda1('0x2f')]=_0x14f8db['attributes'][_0xbda1('0x30')]?_0x14f8db[_0xbda1('0x2f')]:_0x36a460['model'];if(!_0x5b2c93[_0xbda1('0x2a')][_0xbda1('0x31')](_0xbda1('0x32'))){_0x14f8db['limit']=qs[_0xbda1('0x19')](_0x5b2c93[_0xbda1('0x2a')][_0xbda1('0x19')]);_0x14f8db['offset']=qs[_0xbda1('0x18')](_0x5b2c93['query']['offset']);}_0x14f8db['order']=qs[_0xbda1('0x33')](_0x5b2c93['query'][_0xbda1('0x33')]);_0x14f8db['where']=qs['filters'](_[_0xbda1('0x34')](_0x5b2c93[_0xbda1('0x2a')],_0x36a460[_0xbda1('0x2c')]),_0x839ca6);if(_0x5b2c93['query']['filter']){_0x14f8db['where']=_[_0xbda1('0x35')](_0x14f8db[_0xbda1('0x36')],{'$or':_[_0xbda1('0x25')](_0x839ca6,function(_0x346ded){if(_0x346ded['type']!==_0xbda1('0x37')){var _0x3c3b41={};_0x3c3b41[_0x346ded[_0xbda1('0x23')]]={'$like':'%'+_0x5b2c93['query'][_0xbda1('0x38')]+'%'};return _0x3c3b41;}})});}_0x14f8db=_[_0xbda1('0x35')]({},_0x14f8db,_0x5b2c93[_0xbda1('0x39')]);var _0x2ead0b={'where':_0x14f8db['where']};return db[_0xbda1('0x3a')]['count'](_0x2ead0b)['then'](function(_0x125c15){_0x33bfe9['count']=_0x125c15;if(_0x5b2c93[_0xbda1('0x2a')]['includeAll']){_0x14f8db['include']=[{'all':!![]}];}return db[_0xbda1('0x3a')][_0xbda1('0x3b')](_0x14f8db);})[_0xbda1('0x1f')](function(_0x1d709f){_0x33bfe9[_0xbda1('0x3c')]=_0x1d709f;return _0x33bfe9;})[_0xbda1('0x1f')](respondWithFilteredResult(_0x512c97,_0x14f8db))[_0xbda1('0x3d')](handleError(_0x512c97,null));};exports['show']=function(_0x5769c4,_0x18dcf8){var _0xd8ed5a={'raw':!![],'where':{'id':_0x5769c4['params']['id']}},_0x10daa3={};_0x10daa3['model']=_['keys'](db['SmsTransferReport'][_0xbda1('0x26')]);_0x10daa3['query']=_['keys'](_0x5769c4[_0xbda1('0x2a')]);_0x10daa3[_0xbda1('0x2c')]=_[_0xbda1('0x2d')](_0x10daa3[_0xbda1('0x29')],_0x10daa3[_0xbda1('0x2a')]);_0xd8ed5a['attributes']=_[_0xbda1('0x2d')](_0x10daa3[_0xbda1('0x29')],qs[_0xbda1('0x2e')](_0x5769c4[_0xbda1('0x2a')][_0xbda1('0x2e')]));_0xd8ed5a[_0xbda1('0x2f')]=_0xd8ed5a['attributes'][_0xbda1('0x30')]?_0xd8ed5a[_0xbda1('0x2f')]:_0x10daa3[_0xbda1('0x29')];if(_0x5769c4['query'][_0xbda1('0x3e')]){_0xd8ed5a[_0xbda1('0x3f')]=[{'all':!![]}];}_0xd8ed5a=_[_0xbda1('0x35')]({},_0xd8ed5a,_0x5769c4[_0xbda1('0x39')]);return db['SmsTransferReport'][_0xbda1('0x40')](_0xd8ed5a)[_0xbda1('0x1f')](handleEntityNotFound(_0x18dcf8,null))[_0xbda1('0x1f')](respondWithResult(_0x18dcf8,null))['catch'](handleError(_0x18dcf8,null));};exports['create']=function(_0xf895ed,_0x6923a4){return db[_0xbda1('0x3a')][_0xbda1('0x41')](_0xf895ed[_0xbda1('0x42')],{})['then'](respondWithResult(_0x6923a4,0xc9))[_0xbda1('0x3d')](handleError(_0x6923a4,null));};exports[_0xbda1('0x43')]=function(_0x1d8f15,_0x490635){if(_0x1d8f15['body']['id']){delete _0x1d8f15[_0xbda1('0x42')]['id'];}return db[_0xbda1('0x3a')][_0xbda1('0x40')]({'where':{'id':_0x1d8f15['params']['id']}})[_0xbda1('0x1f')](handleEntityNotFound(_0x490635,null))[_0xbda1('0x1f')](saveUpdates(_0x1d8f15['body'],null))[_0xbda1('0x1f')](respondWithResult(_0x490635,null))[_0xbda1('0x3d')](handleError(_0x490635,null));};exports[_0xbda1('0x44')]=function(_0x265033,_0x72b15b){return db[_0xbda1('0x3a')]['find']({'where':{'id':_0x265033[_0xbda1('0x45')]['id']}})['then'](handleEntityNotFound(_0x72b15b,null))['then'](removeEntity(_0x72b15b,null))[_0xbda1('0x3d')](handleError(_0x72b15b,null));};exports[_0xbda1('0x46')]=function(_0x3b2e1f,_0x586e0d){return db[_0xbda1('0x3a')][_0xbda1('0x46')]()[_0xbda1('0x1f')](respondWithResult(_0x586e0d,null))[_0xbda1('0x3d')](handleError(_0x586e0d,null));}; \ No newline at end of file +var _0x789b=['set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','then','include','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x56953c,_0x408e39){var _0xceed1b=function(_0x1b5686){while(--_0x1b5686){_0x56953c['push'](_0x56953c['shift']());}};_0xceed1b(++_0x408e39);}(_0x789b,0xc1));var _0xb789=function(_0x5b2f51,_0x1d477d){_0x5b2f51=_0x5b2f51-0x0;var _0x113a6a=_0x789b[_0x5b2f51];return _0x113a6a;};'use strict';var emlformat=require(_0xb789('0x0'));var rimraf=require(_0xb789('0x1'));var zipdir=require(_0xb789('0x2'));var jsonpatch=require(_0xb789('0x3'));var rp=require(_0xb789('0x4'));var moment=require(_0xb789('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb789('0x6'));var util=require(_0xb789('0x7'));var path=require(_0xb789('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb789('0x9'));var fs=require('fs');var fs_extra=require(_0xb789('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb789('0xb'));var jsforce=require(_0xb789('0xc'));var deskjs=require(_0xb789('0xd'));var toCsv=require(_0xb789('0xe'));var querystring=require(_0xb789('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb789('0x10'));var qs=require(_0xb789('0x11'));var as=require(_0xb789('0x12'));var hardwareService=require(_0xb789('0x13'));var logger=require('../../config/logger')(_0xb789('0x14'));var utils=require('../../config/utils');var config=require(_0xb789('0x15'));var licenseUtil=require(_0xb789('0x16'));var db=require(_0xb789('0x17'))['db'];function respondWithStatusCode(_0x4fefa4,_0x300252){_0x300252=_0x300252||0xcc;return function(_0x3106a1){if(_0x3106a1){return _0x4fefa4[_0xb789('0x18')](_0x300252);}return _0x4fefa4[_0xb789('0x19')](_0x300252)[_0xb789('0x1a')]();};}function respondWithResult(_0x32cf01,_0xaecf3b){_0xaecf3b=_0xaecf3b||0xc8;return function(_0x4af1a1){if(_0x4af1a1){return _0x32cf01[_0xb789('0x19')](_0xaecf3b)[_0xb789('0x1b')](_0x4af1a1);}};}function respondWithFilteredResult(_0x487955,_0x363dec){return function(_0x2817e1){if(_0x2817e1){var _0x3b9459=typeof _0x363dec[_0xb789('0x1c')]===_0xb789('0x1d')&&typeof _0x363dec[_0xb789('0x1e')]==='undefined';var _0x31dfcb=_0x2817e1[_0xb789('0x1f')];var _0x51c691=_0x3b9459?0x0:_0x363dec['offset'];var _0x1c06d6=_0x3b9459?_0x2817e1[_0xb789('0x1f')]:_0x363dec[_0xb789('0x1c')]+_0x363dec[_0xb789('0x1e')];var _0x3fa3d3;if(_0x1c06d6>=_0x31dfcb){_0x1c06d6=_0x31dfcb;_0x3fa3d3=0xc8;}else{_0x3fa3d3=0xce;}_0x487955['status'](_0x3fa3d3);return _0x487955[_0xb789('0x20')](_0xb789('0x21'),_0x51c691+'-'+_0x1c06d6+'/'+_0x31dfcb)['json'](_0x2817e1);}return null;};}function patchUpdates(_0x1c398){return function(_0x5cf3b3){try{jsonpatch[_0xb789('0x22')](_0x5cf3b3,_0x1c398,!![]);}catch(_0x1c22c6){return BPromise['reject'](_0x1c22c6);}return _0x5cf3b3[_0xb789('0x23')]();};}function saveUpdates(_0xf58af3,_0x40910d){return function(_0x282880){if(_0x282880){return _0x282880[_0xb789('0x24')](_0xf58af3)['then'](function(_0x585b26){return _0x585b26;});}return null;};}function removeEntity(_0x4d3ca8,_0x1179e3){return function(_0x2a73a7){if(_0x2a73a7){return _0x2a73a7[_0xb789('0x25')]()['then'](function(){_0x4d3ca8[_0xb789('0x19')](0xcc)[_0xb789('0x1a')]();});}};}function handleEntityNotFound(_0x164afe,_0x398a11){return function(_0x30b5fc){if(!_0x30b5fc){_0x164afe[_0xb789('0x18')](0x194);}return _0x30b5fc;};}function handleError(_0x11534f,_0x442922){_0x442922=_0x442922||0x1f4;return function(_0x4d0753){logger[_0xb789('0x26')](_0x4d0753[_0xb789('0x27')]);if(_0x4d0753[_0xb789('0x28')]){delete _0x4d0753[_0xb789('0x28')];}_0x11534f[_0xb789('0x19')](_0x442922)[_0xb789('0x29')](_0x4d0753);};}exports[_0xb789('0x2a')]=function(_0x5684c5,_0x151905){var _0x4a5d69={},_0x2e08d2={},_0x30df28={'count':0x0,'rows':[]};var _0x297c9e=_[_0xb789('0x2b')](db[_0xb789('0x2c')][_0xb789('0x2d')],function(_0x1e5236){return{'name':_0x1e5236[_0xb789('0x2e')],'type':_0x1e5236[_0xb789('0x2f')][_0xb789('0x30')]};});_0x2e08d2[_0xb789('0x31')]=_[_0xb789('0x2b')](_0x297c9e,_0xb789('0x28'));_0x2e08d2['query']=_[_0xb789('0x32')](_0x5684c5['query']);_0x2e08d2[_0xb789('0x33')]=_[_0xb789('0x34')](_0x2e08d2['model'],_0x2e08d2[_0xb789('0x35')]);_0x4a5d69[_0xb789('0x36')]=_['intersection'](_0x2e08d2[_0xb789('0x31')],qs[_0xb789('0x37')](_0x5684c5[_0xb789('0x35')][_0xb789('0x37')]));_0x4a5d69['attributes']=_0x4a5d69['attributes'][_0xb789('0x38')]?_0x4a5d69[_0xb789('0x36')]:_0x2e08d2[_0xb789('0x31')];if(!_0x5684c5[_0xb789('0x35')][_0xb789('0x39')]('nolimit')){_0x4a5d69[_0xb789('0x1e')]=qs[_0xb789('0x1e')](_0x5684c5[_0xb789('0x35')][_0xb789('0x1e')]);_0x4a5d69[_0xb789('0x1c')]=qs[_0xb789('0x1c')](_0x5684c5[_0xb789('0x35')][_0xb789('0x1c')]);}_0x4a5d69['order']=qs[_0xb789('0x3a')](_0x5684c5['query']['sort']);_0x4a5d69['where']=qs['filters'](_[_0xb789('0x3b')](_0x5684c5[_0xb789('0x35')],_0x2e08d2[_0xb789('0x33')]),_0x297c9e);if(_0x5684c5[_0xb789('0x35')][_0xb789('0x3c')]){_0x4a5d69[_0xb789('0x3d')]=_[_0xb789('0x3e')](_0x4a5d69[_0xb789('0x3d')],{'$or':_['map'](_0x297c9e,function(_0x419c9f){if(_0x419c9f[_0xb789('0x2f')]!==_0xb789('0x3f')){var _0x46d245={};_0x46d245[_0x419c9f['name']]={'$like':'%'+_0x5684c5[_0xb789('0x35')][_0xb789('0x3c')]+'%'};return _0x46d245;}})});}_0x4a5d69=_['merge']({},_0x4a5d69,_0x5684c5[_0xb789('0x40')]);var _0x1102a2={'where':_0x4a5d69['where']};return db[_0xb789('0x2c')]['count'](_0x1102a2)[_0xb789('0x41')](function(_0x37ffea){_0x30df28[_0xb789('0x1f')]=_0x37ffea;if(_0x5684c5[_0xb789('0x35')]['includeAll']){_0x4a5d69[_0xb789('0x42')]=[{'all':!![]}];}return db[_0xb789('0x2c')]['findAll'](_0x4a5d69);})[_0xb789('0x41')](function(_0x5da517){_0x30df28['rows']=_0x5da517;return _0x30df28;})[_0xb789('0x41')](respondWithFilteredResult(_0x151905,_0x4a5d69))[_0xb789('0x43')](handleError(_0x151905,null));};exports[_0xb789('0x44')]=function(_0x3a1200,_0x534ff6){var _0x39fcb0={'raw':!![],'where':{'id':_0x3a1200[_0xb789('0x45')]['id']}},_0x50116e={};_0x50116e[_0xb789('0x31')]=_['keys'](db[_0xb789('0x2c')][_0xb789('0x2d')]);_0x50116e[_0xb789('0x35')]=_['keys'](_0x3a1200['query']);_0x50116e['filters']=_[_0xb789('0x34')](_0x50116e[_0xb789('0x31')],_0x50116e['query']);_0x39fcb0[_0xb789('0x36')]=_[_0xb789('0x34')](_0x50116e[_0xb789('0x31')],qs[_0xb789('0x37')](_0x3a1200['query'][_0xb789('0x37')]));_0x39fcb0['attributes']=_0x39fcb0[_0xb789('0x36')][_0xb789('0x38')]?_0x39fcb0[_0xb789('0x36')]:_0x50116e[_0xb789('0x31')];if(_0x3a1200[_0xb789('0x35')][_0xb789('0x46')]){_0x39fcb0['include']=[{'all':!![]}];}_0x39fcb0=_[_0xb789('0x3e')]({},_0x39fcb0,_0x3a1200[_0xb789('0x40')]);return db['SmsTransferReport'][_0xb789('0x47')](_0x39fcb0)[_0xb789('0x41')](handleEntityNotFound(_0x534ff6,null))[_0xb789('0x41')](respondWithResult(_0x534ff6,null))[_0xb789('0x43')](handleError(_0x534ff6,null));};exports[_0xb789('0x48')]=function(_0x3c4dc8,_0x2e90e2){return db[_0xb789('0x2c')][_0xb789('0x48')](_0x3c4dc8['body'],{})[_0xb789('0x41')](respondWithResult(_0x2e90e2,0xc9))[_0xb789('0x43')](handleError(_0x2e90e2,null));};exports[_0xb789('0x24')]=function(_0x3b91c,_0x16a031){if(_0x3b91c[_0xb789('0x49')]['id']){delete _0x3b91c['body']['id'];}return db[_0xb789('0x2c')][_0xb789('0x47')]({'where':{'id':_0x3b91c[_0xb789('0x45')]['id']}})[_0xb789('0x41')](handleEntityNotFound(_0x16a031,null))['then'](saveUpdates(_0x3b91c['body'],null))[_0xb789('0x41')](respondWithResult(_0x16a031,null))[_0xb789('0x43')](handleError(_0x16a031,null));};exports['destroy']=function(_0x41a6da,_0x4a9860){return db[_0xb789('0x2c')][_0xb789('0x47')]({'where':{'id':_0x41a6da[_0xb789('0x45')]['id']}})[_0xb789('0x41')](handleEntityNotFound(_0x4a9860,null))[_0xb789('0x41')](removeEntity(_0x4a9860,null))[_0xb789('0x43')](handleError(_0x4a9860,null));};exports['describe']=function(_0x463af7,_0x17d6ce){return db[_0xb789('0x2c')][_0xb789('0x4a')]()[_0xb789('0x41')](respondWithResult(_0x17d6ce,null))[_0xb789('0x43')](handleError(_0x17d6ce,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 4e90afd..42f5bb2 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 _0x1c22=['util','api','moment','bluebird','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x1c22,0x197));var _0x21c2=function(_0x9cf6fd,_0x2b707a){_0x9cf6fd=_0x9cf6fd-0x0;var _0x231dfb=_0x1c22[_0x9cf6fd];return _0x231dfb;};'use strict';var _=require('lodash');var util=require(_0x21c2('0x0'));var logger=require('../../config/logger')(_0x21c2('0x1'));var moment=require(_0x21c2('0x2'));var BPromise=require(_0x21c2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x21c2('0x4'));var config=require('../../config/environment');var attributes=require(_0x21c2('0x5'));module[_0x21c2('0x6')]=function(_0x18aeba,_0x234329){return _0x18aeba[_0x21c2('0x7')](_0x21c2('0x8'),attributes,{'tableName':_0x21c2('0x9'),'paranoid':![],'indexes':[{'name':_0x21c2('0xa'),'fields':[_0x21c2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55db=['exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3b811e,_0x13e060){var _0x3dae1c=function(_0x5a74b8){while(--_0x5a74b8){_0x3b811e['push'](_0x3b811e['shift']());}};_0x3dae1c(++_0x13e060);}(_0x55db,0x1b5));var _0xb55d=function(_0x352de7,_0x42d665){_0x352de7=_0x352de7-0x0;var _0x76cff2=_0x55db[_0x352de7];return _0x76cff2;};'use strict';var _=require('lodash');var util=require(_0xb55d('0x0'));var logger=require(_0xb55d('0x1'))('api');var moment=require(_0xb55d('0x2'));var BPromise=require(_0xb55d('0x3'));var rp=require(_0xb55d('0x4'));var fs=require('fs');var path=require(_0xb55d('0x5'));var rimraf=require('rimraf');var config=require(_0xb55d('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xb55d('0x7')]=function(_0x1a5e6d,_0x179d03){return _0x1a5e6d[_0xb55d('0x8')](_0xb55d('0x9'),attributes,{'tableName':_0xb55d('0xa'),'paranoid':![],'indexes':[{'name':_0xb55d('0xb'),'fields':[_0xb55d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 82d37a5..9b00866 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 _0x0f3c=['rpc','../../config/environment','jayson/promise','client','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21e2d0,_0x21ff52){var _0x2f8eed=function(_0x146dab){while(--_0x146dab){_0x21e2d0['push'](_0x21e2d0['shift']());}};_0x2f8eed(++_0x21ff52);}(_0x0f3c,0x189));var _0xc0f3=function(_0x396739,_0x4d2f0b){_0x396739=_0x396739-0x0;var _0x6a61bf=_0x0f3c[_0x396739];return _0x6a61bf;};'use strict';var _=require(_0xc0f3('0x0'));var util=require(_0xc0f3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0f3('0x2'));var db=require(_0xc0f3('0x3'))['db'];var utils=require(_0xc0f3('0x4'));var logger=require(_0xc0f3('0x5'))(_0xc0f3('0x6'));var config=require(_0xc0f3('0x7'));var jayson=require(_0xc0f3('0x8'));var client=jayson[_0xc0f3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37d939,_0x2c517e,_0x48fc5d){return new BPromise(function(_0x435864,_0x399c29){return client['request'](_0x37d939,_0x48fc5d)[_0xc0f3('0xa')](function(_0x31ddbe){logger[_0xc0f3('0xb')](_0xc0f3('0xc'),_0x2c517e,_0xc0f3('0xd'));logger[_0xc0f3('0xe')](_0xc0f3('0xf'),_0x2c517e,'request\x20sent',JSON[_0xc0f3('0x10')](_0x31ddbe));if(_0x31ddbe[_0xc0f3('0x11')]){if(_0x31ddbe[_0xc0f3('0x11')]['code']===0x1f4){logger[_0xc0f3('0x11')](_0xc0f3('0xc'),_0x2c517e,_0x31ddbe[_0xc0f3('0x11')][_0xc0f3('0x12')]);return _0x399c29(_0x31ddbe['error'][_0xc0f3('0x12')]);}logger[_0xc0f3('0x11')](_0xc0f3('0xc'),_0x2c517e,_0x31ddbe[_0xc0f3('0x11')][_0xc0f3('0x12')]);return _0x435864(_0x31ddbe[_0xc0f3('0x11')][_0xc0f3('0x12')]);}else{logger[_0xc0f3('0xb')](_0xc0f3('0xc'),_0x2c517e,_0xc0f3('0xd'));_0x435864(_0x31ddbe[_0xc0f3('0x13')][_0xc0f3('0x12')]);}})[_0xc0f3('0x14')](function(_0x5b2d71){logger[_0xc0f3('0x11')](_0xc0f3('0xc'),_0x2c517e,_0x5b2d71);_0x399c29(_0x5b2d71);});});} \ No newline at end of file +var _0x5ad3=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x2b7f07,_0x556f6b){var _0x24b8a9=function(_0x171f0e){while(--_0x171f0e){_0x2b7f07['push'](_0x2b7f07['shift']());}};_0x24b8a9(++_0x556f6b);}(_0x5ad3,0x1e2));var _0x35ad=function(_0xff659d,_0x2283a1){_0xff659d=_0xff659d-0x0;var _0x19c170=_0x5ad3[_0xff659d];return _0x19c170;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var moment=require(_0x35ad('0x2'));var BPromise=require(_0x35ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ad('0x4'));var db=require(_0x35ad('0x5'))['db'];var utils=require(_0x35ad('0x6'));var logger=require(_0x35ad('0x7'))(_0x35ad('0x8'));var config=require(_0x35ad('0x9'));var jayson=require(_0x35ad('0xa'));var client=jayson[_0x35ad('0xb')][_0x35ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31cc6a,_0x4edc59,_0x292521){return new BPromise(function(_0x3cec3e,_0x3f1f55){return client['request'](_0x31cc6a,_0x292521)[_0x35ad('0xd')](function(_0x487107){logger['info'](_0x35ad('0xe'),_0x4edc59,_0x35ad('0xf'));logger['debug'](_0x35ad('0x10'),_0x4edc59,_0x35ad('0xf'),JSON['stringify'](_0x487107));if(_0x487107['error']){if(_0x487107[_0x35ad('0x11')][_0x35ad('0x12')]===0x1f4){logger['error'](_0x35ad('0xe'),_0x4edc59,_0x487107[_0x35ad('0x11')]['message']);return _0x3f1f55(_0x487107['error'][_0x35ad('0x13')]);}logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x487107['error'][_0x35ad('0x13')]);return _0x3cec3e(_0x487107[_0x35ad('0x11')]['message']);}else{logger[_0x35ad('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x4edc59,'request\x20sent');_0x3cec3e(_0x487107[_0x35ad('0x15')][_0x35ad('0x13')]);}})[_0x35ad('0x16')](function(_0x56cb8e){logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x56cb8e);_0x3f1f55(_0x56cb8e);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 86c1f4a..85959d3 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 _0xf6d1=['../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x34ab8c,_0x5afc2f){var _0x28d221=function(_0x343a6c){while(--_0x343a6c){_0x34ab8c['push'](_0x34ab8c['shift']());}};_0x28d221(++_0x5afc2f);}(_0xf6d1,0x99));var _0x1f6d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf6d1[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x1f6d('0x0'));var util=require(_0x1f6d('0x1'));var path=require(_0x1f6d('0x2'));var timeout=require(_0x1f6d('0x3'));var express=require(_0x1f6d('0x4'));var router=express[_0x1f6d('0x5')]();var fs_extra=require(_0x1f6d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6d('0x7'));var config=require('../../config/environment');var controller=require(_0x1f6d('0x8'));router[_0x1f6d('0x9')]('/',auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xb')]);router[_0x1f6d('0x9')](_0x1f6d('0xc'),auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xd')]);router[_0x1f6d('0x9')](_0x1f6d('0xe'),auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25ec55,_0x4f33bd,_0x456882){_0x456882(null,path['join'](config[_0x1f6d('0x10')],_0x1f6d('0x11')));},'filename':function(_0x3d813c,_0x412696,_0x505fb1){_0x412696['originalname']=_0x412696[_0x1f6d('0x12')][_0x1f6d('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x505fb1(null,util[_0x1f6d('0x14')](_0x1f6d('0x15'),path[_0x1f6d('0x16')](_0x412696[_0x1f6d('0x12')],path[_0x1f6d('0x17')](_0x412696[_0x1f6d('0x12')])),Date[_0x1f6d('0x18')](),path[_0x1f6d('0x17')](_0x412696['originalname'])));}})});router[_0x1f6d('0x19')]('/',upload[_0x1f6d('0x1a')](_0x1f6d('0x1b')),controller['create']);router[_0x1f6d('0x1c')](_0x1f6d('0xc'),auth['isAuthenticated'](),controller[_0x1f6d('0x1d')]);router[_0x1f6d('0x1e')](_0x1f6d('0xc'),auth[_0x1f6d('0xa')](),controller[_0x1f6d('0x1e')]);module[_0x1f6d('0x1f')]=router; \ No newline at end of file +var _0x3749=['show','download','diskStorage','join','root','originalname','basename','extname','now','post','single','file','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0x3749,0x143));var _0x9374=function(_0x415264,_0x4e71cc){_0x415264=_0x415264-0x0;var _0x305b9e=_0x3749[_0x415264];return _0x305b9e;};'use strict';var multer=require(_0x9374('0x0'));var util=require('util');var path=require(_0x9374('0x1'));var timeout=require(_0x9374('0x2'));var express=require(_0x9374('0x3'));var router=express[_0x9374('0x4')]();var fs_extra=require(_0x9374('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9374('0x6'));var config=require(_0x9374('0x7'));var controller=require(_0x9374('0x8'));router[_0x9374('0x9')]('/',auth[_0x9374('0xa')](),controller[_0x9374('0xb')]);router[_0x9374('0x9')](_0x9374('0xc'),auth[_0x9374('0xa')](),controller[_0x9374('0xd')]);router[_0x9374('0x9')]('/:id/download',auth[_0x9374('0xa')](),controller[_0x9374('0xe')]);var upload=multer({'storage':multer[_0x9374('0xf')]({'destination':function(_0x446254,_0x490d4d,_0x501899){_0x501899(null,path[_0x9374('0x10')](config[_0x9374('0x11')],'server/files/sounds/original/'));},'filename':function(_0x4763fd,_0x1af05a,_0x20cabe){_0x1af05a[_0x9374('0x12')]=_0x1af05a[_0x9374('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20cabe(null,util['format']('%s-%s%s',path[_0x9374('0x13')](_0x1af05a[_0x9374('0x12')],path[_0x9374('0x14')](_0x1af05a[_0x9374('0x12')])),Date[_0x9374('0x15')](),path[_0x9374('0x14')](_0x1af05a[_0x9374('0x12')])));}})});router[_0x9374('0x16')]('/',upload[_0x9374('0x17')](_0x9374('0x18')),controller['create']);router['put'](_0x9374('0xc'),auth[_0x9374('0xa')](),controller[_0x9374('0x19')]);router[_0x9374('0x1a')](_0x9374('0xc'),auth[_0x9374('0xa')](),controller[_0x9374('0x1a')]);module[_0x9374('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 8607fb5..65cb1f2 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 _0x874b=['name','STRING','INTEGER','BIGINT'];(function(_0x4e3347,_0x11d64e){var _0x3b8eec=function(_0x715751){while(--_0x715751){_0x4e3347['push'](_0x4e3347['shift']());}};_0x3b8eec(++_0x11d64e);}(_0x874b,0xf4));var _0xb874=function(_0x305b12,_0x5ecd09){_0x305b12=_0x305b12-0x0;var _0x4141de=_0x874b[_0x305b12];return _0x4141de;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb874('0x0'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xb874('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xb874('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xb874('0x2')]},'converted_format':{'type':Sequelize[_0xb874('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xb874('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xb874('0x2')]}}; \ No newline at end of file +var _0x5584=['BIGINT','INTEGER','sequelize','exports','STRING','FLOAT'];(function(_0x7b5cef,_0x2226de){var _0x9624cf=function(_0x550eb3){while(--_0x550eb3){_0x7b5cef['push'](_0x7b5cef['shift']());}};_0x9624cf(++_0x2226de);}(_0x5584,0x1ee));var _0x4558=function(_0x55f23c,_0x132b0d){_0x55f23c=_0x55f23c-0x0;var _0x159c1c=_0x5584[_0x55f23c];return _0x159c1c;};'use strict';var Sequelize=require(_0x4558('0x0'));module[_0x4558('0x1')]={'name':{'type':Sequelize[_0x4558('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x4558('0x2')]},'display_name':{'type':Sequelize[_0x4558('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x4558('0x2')]},'original_duration':{'type':Sequelize[_0x4558('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4558('0x4')]},'original_channelCount':{'type':Sequelize[_0x4558('0x5')]},'original_bitRate':{'type':Sequelize[_0x4558('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4558('0x5')]},'converted_format':{'type':Sequelize[_0x4558('0x2')]},'converted_duration':{'type':Sequelize[_0x4558('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x4558('0x4')]},'converted_channelCount':{'type':Sequelize[_0x4558('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x4558('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 66a296f..ade3d92 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 _0xefb1=['set','Content-Range','apply','save','update','then','destroy','get','Sounds','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','options','Sound','includeAll','findAll','rows','catch','show','params','fields','length','include','find','download','save_name','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','converted_format','basename','originalname','extname','filename','file','substring','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','start','delete','server/files/sounds/original','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xefb1,0x1b4));var _0x1efb=function(_0x2cb5ab,_0x58caa7){_0x2cb5ab=_0x2cb5ab-0x0;var _0xccca19=_0xefb1[_0x2cb5ab];return _0xccca19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1efb('0x0'));var zipdir=require(_0x1efb('0x1'));var jsonpatch=require(_0x1efb('0x2'));var rp=require(_0x1efb('0x3'));var moment=require(_0x1efb('0x4'));var BPromise=require(_0x1efb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1efb('0x6'));var ejs=require(_0x1efb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1efb('0x8'));var squel=require(_0x1efb('0x9'));var crypto=require(_0x1efb('0xa'));var jsforce=require(_0x1efb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1efb('0x6'));var querystring=require(_0x1efb('0xc'));var Papa=require(_0x1efb('0xd'));var Redis=require('ioredis');var authService=require(_0x1efb('0xe'));var qs=require(_0x1efb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1efb('0x10'))('api');var utils=require(_0x1efb('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1efb('0x12'));var db=require(_0x1efb('0x13'))['db'];function respondWithStatusCode(_0x8947fc,_0x5966e4){_0x5966e4=_0x5966e4||0xcc;return function(_0x43d978){if(_0x43d978){return _0x8947fc[_0x1efb('0x14')](_0x5966e4);}return _0x8947fc[_0x1efb('0x15')](_0x5966e4)[_0x1efb('0x16')]();};}function respondWithResult(_0xa36174,_0x55cfae){_0x55cfae=_0x55cfae||0xc8;return function(_0x28e225){if(_0x28e225){return _0xa36174['status'](_0x55cfae)[_0x1efb('0x17')](_0x28e225);}};}function respondWithFilteredResult(_0x592440,_0x1771ef){return function(_0x2c67b5){if(_0x2c67b5){var _0x13211a=typeof _0x1771ef[_0x1efb('0x18')]==='undefined'&&typeof _0x1771ef['limit']===_0x1efb('0x19');var _0x3caa43=_0x2c67b5[_0x1efb('0x1a')];var _0x2f59f5=_0x13211a?0x0:_0x1771ef[_0x1efb('0x18')];var _0x1b8967=_0x13211a?_0x2c67b5[_0x1efb('0x1a')]:_0x1771ef[_0x1efb('0x18')]+_0x1771ef[_0x1efb('0x1b')];var _0x402e5e;if(_0x1b8967>=_0x3caa43){_0x1b8967=_0x3caa43;_0x402e5e=0xc8;}else{_0x402e5e=0xce;}_0x592440['status'](_0x402e5e);return _0x592440[_0x1efb('0x1c')](_0x1efb('0x1d'),_0x2f59f5+'-'+_0x1b8967+'/'+_0x3caa43)['json'](_0x2c67b5);}return null;};}function patchUpdates(_0x218d63){return function(_0x52cdfd){try{jsonpatch[_0x1efb('0x1e')](_0x52cdfd,_0x218d63,!![]);}catch(_0x2aa592){return BPromise['reject'](_0x2aa592);}return _0x52cdfd[_0x1efb('0x1f')]();};}function saveUpdates(_0x11cdf6,_0x586763){return function(_0x1a0a18){if(_0x1a0a18){return _0x1a0a18[_0x1efb('0x20')](_0x11cdf6)[_0x1efb('0x21')](function(_0x4ee9f1){return _0x4ee9f1;});}return null;};}function removeEntity(_0x24d3ef,_0x2905f3){return function(_0x1ec92d){if(_0x1ec92d){return _0x1ec92d[_0x1efb('0x22')]()[_0x1efb('0x21')](function(){var _0x5605c0=_0x1ec92d[_0x1efb('0x23')]({'plain':!![]});var _0x1c8039=_0x1efb('0x24');return db['UserProfileResource'][_0x1efb('0x22')]({'where':{'type':_0x1c8039,'resourceId':_0x5605c0['id']}})[_0x1efb('0x21')](function(){return _0x1ec92d;});})['then'](function(){_0x24d3ef[_0x1efb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26ff29,_0x11807e){return function(_0x8f440a){if(!_0x8f440a){_0x26ff29[_0x1efb('0x14')](0x194);}return _0x8f440a;};}function handleError(_0xaf2350,_0x3517ca){_0x3517ca=_0x3517ca||0x1f4;return function(_0x4e89e4){logger[_0x1efb('0x25')](_0x4e89e4[_0x1efb('0x26')]);if(_0x4e89e4[_0x1efb('0x27')]){delete _0x4e89e4[_0x1efb('0x27')];}_0xaf2350[_0x1efb('0x15')](_0x3517ca)[_0x1efb('0x28')](_0x4e89e4);};}exports[_0x1efb('0x29')]=function(_0x43eb19,_0x7523a1){var _0x25d854={},_0x1e7cf1={},_0x19c7df={'count':0x0,'rows':[]};var _0x2377e4=_[_0x1efb('0x2a')](db['Sound'][_0x1efb('0x2b')],function(_0x3ba667){return{'name':_0x3ba667['fieldName'],'type':_0x3ba667[_0x1efb('0x2c')]['key']};});_0x1e7cf1[_0x1efb('0x2d')]=_[_0x1efb('0x2a')](_0x2377e4,'name');_0x1e7cf1[_0x1efb('0x2e')]=_[_0x1efb('0x2f')](_0x43eb19['query']);_0x1e7cf1[_0x1efb('0x30')]=_[_0x1efb('0x31')](_0x1e7cf1[_0x1efb('0x2d')],_0x1e7cf1[_0x1efb('0x2e')]);_0x25d854[_0x1efb('0x32')]=_['intersection'](_0x1e7cf1[_0x1efb('0x2d')],qs['fields'](_0x43eb19[_0x1efb('0x2e')]['fields']));_0x25d854[_0x1efb('0x32')]=_0x25d854[_0x1efb('0x32')]['length']?_0x25d854[_0x1efb('0x32')]:_0x1e7cf1[_0x1efb('0x2d')];if(!_0x43eb19[_0x1efb('0x2e')]['hasOwnProperty'](_0x1efb('0x33'))){_0x25d854['limit']=qs[_0x1efb('0x1b')](_0x43eb19[_0x1efb('0x2e')]['limit']);_0x25d854['offset']=qs[_0x1efb('0x18')](_0x43eb19[_0x1efb('0x2e')][_0x1efb('0x18')]);}_0x25d854[_0x1efb('0x34')]=qs[_0x1efb('0x35')](_0x43eb19['query'][_0x1efb('0x35')]);_0x25d854[_0x1efb('0x36')]=qs['filters'](_[_0x1efb('0x37')](_0x43eb19['query'],_0x1e7cf1[_0x1efb('0x30')]),_0x2377e4);if(_0x43eb19[_0x1efb('0x2e')][_0x1efb('0x38')]){_0x25d854[_0x1efb('0x36')]=_[_0x1efb('0x39')](_0x25d854[_0x1efb('0x36')],{'$or':_[_0x1efb('0x2a')](_0x2377e4,function(_0xf69b6d){if(_0xf69b6d[_0x1efb('0x2c')]!=='VIRTUAL'){var _0x220036={};_0x220036[_0xf69b6d[_0x1efb('0x27')]]={'$like':'%'+_0x43eb19[_0x1efb('0x2e')]['filter']+'%'};return _0x220036;}})});}_0x25d854=_[_0x1efb('0x39')]({},_0x25d854,_0x43eb19[_0x1efb('0x3a')]);var _0x26b31c={'where':_0x25d854[_0x1efb('0x36')]};return db[_0x1efb('0x3b')][_0x1efb('0x1a')](_0x26b31c)[_0x1efb('0x21')](function(_0x4e6d8c){_0x19c7df[_0x1efb('0x1a')]=_0x4e6d8c;if(_0x43eb19[_0x1efb('0x2e')][_0x1efb('0x3c')]){_0x25d854['include']=[{'all':!![]}];}return db[_0x1efb('0x3b')][_0x1efb('0x3d')](_0x25d854);})[_0x1efb('0x21')](function(_0x43c444){_0x19c7df[_0x1efb('0x3e')]=_0x43c444;return _0x19c7df;})[_0x1efb('0x21')](respondWithFilteredResult(_0x7523a1,_0x25d854))[_0x1efb('0x3f')](handleError(_0x7523a1,null));};exports[_0x1efb('0x40')]=function(_0x564536,_0x1cb137){var _0x23a120={'raw':!![],'where':{'id':_0x564536[_0x1efb('0x41')]['id']}},_0x165514={};_0x165514[_0x1efb('0x2d')]=_['keys'](db[_0x1efb('0x3b')][_0x1efb('0x2b')]);_0x165514[_0x1efb('0x2e')]=_[_0x1efb('0x2f')](_0x564536[_0x1efb('0x2e')]);_0x165514[_0x1efb('0x30')]=_[_0x1efb('0x31')](_0x165514[_0x1efb('0x2d')],_0x165514['query']);_0x23a120[_0x1efb('0x32')]=_[_0x1efb('0x31')](_0x165514[_0x1efb('0x2d')],qs[_0x1efb('0x42')](_0x564536['query'][_0x1efb('0x42')]));_0x23a120[_0x1efb('0x32')]=_0x23a120['attributes'][_0x1efb('0x43')]?_0x23a120[_0x1efb('0x32')]:_0x165514[_0x1efb('0x2d')];if(_0x564536[_0x1efb('0x2e')]['includeAll']){_0x23a120[_0x1efb('0x44')]=[{'all':!![]}];}_0x23a120=_[_0x1efb('0x39')]({},_0x23a120,_0x564536['options']);return db[_0x1efb('0x3b')][_0x1efb('0x45')](_0x23a120)['then'](handleEntityNotFound(_0x1cb137,null))['then'](respondWithResult(_0x1cb137,null))[_0x1efb('0x3f')](handleError(_0x1cb137,null));};exports[_0x1efb('0x46')]=function(_0x3c6b61,_0x22dac6,_0x37bde5){return db[_0x1efb('0x3b')][_0x1efb('0x45')]({'where':{'id':_0x3c6b61[_0x1efb('0x41')]['id']},'attributes':['name',_0x1efb('0x47'),'converted_format'],'raw':!![]})[_0x1efb('0x21')](handleEntityNotFound(_0x22dac6,null))[_0x1efb('0x21')](function(_0x2285c8){if(_0x2285c8){if(!fs[_0x1efb('0x48')](path[_0x1efb('0x49')](config['root'],_0x1efb('0x4a'),_0x2285c8[_0x1efb('0x47')]+'.'+_0x2285c8['converted_format']))){throw new db[(_0x1efb('0x4b'))][(_0x1efb('0x4c'))](_0x1efb('0x4d'));}return _0x22dac6[_0x1efb('0x46')](path[_0x1efb('0x49')](config[_0x1efb('0x4e')],'server/files/sounds/converted',util[_0x1efb('0x4f')](_0x1efb('0x50'),_0x2285c8['save_name'],_0x2285c8[_0x1efb('0x51')])),util[_0x1efb('0x4f')](_0x1efb('0x50'),_0x2285c8[_0x1efb('0x27')],_0x2285c8['converted_format']));}return null;})[_0x1efb('0x3f')](handleError(_0x22dac6,null));};exports['create']=function(_0x3a85b3,_0x3b7a07,_0x3c8189){var _0x39eb14={'name':path[_0x1efb('0x52')](_0x3a85b3['file'][_0x1efb('0x53')],path[_0x1efb('0x54')](_0x3a85b3['file'][_0x1efb('0x53')])),'save_name':path['basename'](_0x3a85b3['file']['filename'],path['extname'](_0x3a85b3['file'][_0x1efb('0x55')])),'original_format':path[_0x1efb('0x54')](_0x3a85b3[_0x1efb('0x56')][_0x1efb('0x53')])[_0x1efb('0x57')](0x1),'converted_format':'wav'};var _0x2f0db1=path['join'](config[_0x1efb('0x4e')],'server/files/sounds/original',_0x3a85b3[_0x1efb('0x56')][_0x1efb('0x55')]);var _0x4adf50=path[_0x1efb('0x49')](config[_0x1efb('0x4e')],'server/files/sounds/converted',util[_0x1efb('0x4f')]('%s.%s',path['basename'](_0x3a85b3['file'][_0x1efb('0x55')],path[_0x1efb('0x54')](_0x3a85b3[_0x1efb('0x56')][_0x1efb('0x55')])),_0x39eb14[_0x1efb('0x51')]));logger[_0x1efb('0x58')](_0x1efb('0x59'),_0x2f0db1);logger[_0x1efb('0x58')]('Sound\x20upload\x20destination:\x20%s',_0x4adf50);try{fs[_0x1efb('0x5a')](_0x2f0db1,parseInt(_0x1efb('0x5b'),0x8));var _0x861483=sox['transcode'](_0x2f0db1,_0x4adf50,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x861483['on'](_0x1efb('0x25'),function(_0x10b97f){fs[_0x1efb('0x5c')](_0x2f0db1);_0x3b7a07[_0x1efb('0x15')](0x1f4)['send'](_0x10b97f);});_0x861483['on'](_0x1efb('0x5d'),function(_0x4d7880){_0x39eb14[_0x1efb('0x5e')]=isNaN(_0x4d7880[_0x1efb('0x5f')])?null:_0x4d7880['duration']*0x3e8;_0x39eb14['original_sampleCount']=isNaN(_0x4d7880[_0x1efb('0x60')])?null:_0x4d7880[_0x1efb('0x60')];_0x39eb14[_0x1efb('0x61')]=isNaN(_0x4d7880[_0x1efb('0x62')])?null:_0x4d7880[_0x1efb('0x62')];_0x39eb14['original_bitRate']=isNaN(_0x4d7880['bitRate'])?null:_0x4d7880[_0x1efb('0x63')];_0x39eb14[_0x1efb('0x64')]=isNaN(_0x4d7880[_0x1efb('0x65')])?null:_0x4d7880[_0x1efb('0x65')];});_0x861483['on'](_0x1efb('0x66'),function(_0x472a29){_0x39eb14[_0x1efb('0x67')]=isNaN(_0x472a29[_0x1efb('0x5f')])?null:_0x472a29[_0x1efb('0x5f')]*0x3e8;_0x39eb14['converted_sampleCount']=isNaN(_0x472a29[_0x1efb('0x60')])?null:_0x472a29[_0x1efb('0x60')];_0x39eb14[_0x1efb('0x68')]=isNaN(_0x472a29[_0x1efb('0x62')])?null:_0x472a29[_0x1efb('0x62')];_0x39eb14['converted_bitRate']=isNaN(_0x472a29[_0x1efb('0x63')])?null:_0x472a29[_0x1efb('0x63')];_0x39eb14['converted_sampleRate']=isNaN(_0x472a29[_0x1efb('0x65')])?null:_0x472a29[_0x1efb('0x65')];});_0x861483['on'](_0x1efb('0x16'),function(){fs['chmodSync'](_0x4adf50,parseInt(_0x1efb('0x5b'),0x8));return db['Sound'][_0x1efb('0x69')](_0x39eb14)[_0x1efb('0x21')](function(_0x269907){var _0x2ffac5={'role':_0x3a85b3['body'][_0x1efb('0x6a')],'userProfileId':_0x3a85b3[_0x1efb('0x6b')][_0x1efb('0x6c')]};if(!_0x2ffac5)throw new Error(_0x1efb('0x6d'));if(_0x2ffac5[_0x1efb('0x6a')]===_0x1efb('0x6e')){var _0x465b80=_0x269907[_0x1efb('0x23')]({'plain':!![]});return db[_0x1efb('0x6f')][_0x1efb('0x45')]({'where':{'name':_0x1efb('0x24'),'userProfileId':_0x2ffac5['userProfileId']},'raw':!![]})[_0x1efb('0x21')](function(_0x42ceb2){if(_0x42ceb2&&_0x42ceb2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x465b80['name'],'resourceId':_0x465b80['id'],'type':_0x42ceb2['name'],'sectionId':_0x42ceb2['id']},{})[_0x1efb('0x21')](function(){return _0x269907;});}else{return _0x269907;}})['catch'](function(_0x24d1bf){logger[_0x1efb('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24d1bf);throw _0x24d1bf;});}return _0x269907;})[_0x1efb('0x21')](respondWithResult(_0x3b7a07,null))['catch'](handleError(_0x3b7a07,null));});_0x861483[_0x1efb('0x70')]();}catch(_0x4193e5){_0x3b7a07[_0x1efb('0x15')](0x1f4)['send'](_0x4193e5);}};exports[_0x1efb('0x20')]=function(_0x5d3270,_0x27baa2,_0x17f95c){return db[_0x1efb('0x3b')][_0x1efb('0x45')]({'where':{'id':_0x5d3270[_0x1efb('0x41')]['id']}})['then'](handleEntityNotFound(_0x27baa2,null))[_0x1efb('0x21')](saveUpdates(_['pick'](_0x5d3270[_0x1efb('0x6b')],[_0x1efb('0x27'),'description']),null))[_0x1efb('0x21')](respondWithResult(_0x27baa2,null))['catch'](handleError(_0x27baa2,null));};exports[_0x1efb('0x71')]=function(_0x18f93b,_0x2de0d5,_0xd91724){return db[_0x1efb('0x3b')][_0x1efb('0x45')]({'where':{'id':_0x18f93b[_0x1efb('0x41')]['id']}})[_0x1efb('0x21')](function(_0x505b87){if(_0x505b87){return _0x505b87['destroy']();}})['then'](function(_0x5f3249){var _0x1bc151=path[_0x1efb('0x49')](config[_0x1efb('0x4e')],_0x1efb('0x72'),util[_0x1efb('0x4f')]('%s.%s',_0x5f3249[_0x1efb('0x47')],_0x5f3249[_0x1efb('0x73')]));var _0x441da2=path[_0x1efb('0x49')](config[_0x1efb('0x4e')],_0x1efb('0x4a'),util[_0x1efb('0x4f')](_0x1efb('0x50'),_0x5f3249[_0x1efb('0x47')],_0x5f3249[_0x1efb('0x51')]));fs[_0x1efb('0x5c')](_0x1bc151);fs[_0x1efb('0x5c')](_0x441da2);return _0x5f3249;})[_0x1efb('0x21')](function(_0x20e5a5){if(_0x20e5a5){return _0x2de0d5['status'](0xcc)[_0x1efb('0x16')]();}})[_0x1efb('0x21')](handleEntityNotFound(_0x2de0d5,null))[_0x1efb('0x3f')](handleError(_0x2de0d5,null));}; \ No newline at end of file +var _0x28c8=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','Sound','include','rows','catch','show','params','length','includeAll','find','download','save_name','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','converted_format','%s.%s','create','basename','file','extname','filename','originalname','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','wav','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','pick','delete','original_format','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','Sounds','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes'];(function(_0x5dfca4,_0x180b26){var _0x58b621=function(_0x545052){while(--_0x545052){_0x5dfca4['push'](_0x5dfca4['shift']());}};_0x58b621(++_0x180b26);}(_0x28c8,0x151));var _0x828c=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x28c8[_0x5af59e];return _0x4240df;};'use strict';var emlformat=require(_0x828c('0x0'));var rimraf=require(_0x828c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x828c('0x2'));var moment=require('moment');var BPromise=require(_0x828c('0x3'));var Mustache=require(_0x828c('0x4'));var util=require('util');var path=require(_0x828c('0x5'));var sox=require(_0x828c('0x6'));var csv=require(_0x828c('0x7'));var ejs=require(_0x828c('0x8'));var fs=require('fs');var fs_extra=require(_0x828c('0x9'));var _=require('lodash');var squel=require(_0x828c('0xa'));var crypto=require(_0x828c('0xb'));var jsforce=require(_0x828c('0xc'));var deskjs=require(_0x828c('0xd'));var toCsv=require(_0x828c('0x7'));var querystring=require(_0x828c('0xe'));var Papa=require(_0x828c('0xf'));var Redis=require(_0x828c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x828c('0x11'));var hardwareService=require(_0x828c('0x12'));var logger=require(_0x828c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x828c('0x14'));var licenseUtil=require(_0x828c('0x15'));var db=require(_0x828c('0x16'))['db'];function respondWithStatusCode(_0x5c059e,_0x3a969a){_0x3a969a=_0x3a969a||0xcc;return function(_0x1fe441){if(_0x1fe441){return _0x5c059e[_0x828c('0x17')](_0x3a969a);}return _0x5c059e[_0x828c('0x18')](_0x3a969a)[_0x828c('0x19')]();};}function respondWithResult(_0x291a75,_0x245e09){_0x245e09=_0x245e09||0xc8;return function(_0x33ccf4){if(_0x33ccf4){return _0x291a75[_0x828c('0x18')](_0x245e09)[_0x828c('0x1a')](_0x33ccf4);}};}function respondWithFilteredResult(_0x3e76de,_0x11bd63){return function(_0x833a83){if(_0x833a83){var _0x545e33=typeof _0x11bd63['offset']===_0x828c('0x1b')&&typeof _0x11bd63[_0x828c('0x1c')]===_0x828c('0x1b');var _0x15f062=_0x833a83[_0x828c('0x1d')];var _0x528a1e=_0x545e33?0x0:_0x11bd63[_0x828c('0x1e')];var _0x2b547b=_0x545e33?_0x833a83[_0x828c('0x1d')]:_0x11bd63['offset']+_0x11bd63[_0x828c('0x1c')];var _0x220817;if(_0x2b547b>=_0x15f062){_0x2b547b=_0x15f062;_0x220817=0xc8;}else{_0x220817=0xce;}_0x3e76de[_0x828c('0x18')](_0x220817);return _0x3e76de[_0x828c('0x1f')]('Content-Range',_0x528a1e+'-'+_0x2b547b+'/'+_0x15f062)[_0x828c('0x1a')](_0x833a83);}return null;};}function patchUpdates(_0x113c63){return function(_0x3c7da5){try{jsonpatch[_0x828c('0x20')](_0x3c7da5,_0x113c63,!![]);}catch(_0x1be1ec){return BPromise[_0x828c('0x21')](_0x1be1ec);}return _0x3c7da5[_0x828c('0x22')]();};}function saveUpdates(_0x251530,_0x37eba0){return function(_0x15ba9b){if(_0x15ba9b){return _0x15ba9b[_0x828c('0x23')](_0x251530)[_0x828c('0x24')](function(_0x34f708){return _0x34f708;});}return null;};}function removeEntity(_0x59f2b9,_0x4a99d5){return function(_0xeea01){if(_0xeea01){return _0xeea01['destroy']()[_0x828c('0x24')](function(){var _0x138126=_0xeea01[_0x828c('0x25')]({'plain':!![]});var _0x3b6133=_0x828c('0x26');return db[_0x828c('0x27')][_0x828c('0x28')]({'where':{'type':_0x3b6133,'resourceId':_0x138126['id']}})['then'](function(){return _0xeea01;});})[_0x828c('0x24')](function(){_0x59f2b9[_0x828c('0x18')](0xcc)[_0x828c('0x19')]();});}};}function handleEntityNotFound(_0x1d1c17,_0x1a8b6a){return function(_0x2f5c5e){if(!_0x2f5c5e){_0x1d1c17[_0x828c('0x17')](0x194);}return _0x2f5c5e;};}function handleError(_0x4b80f1,_0x598677){_0x598677=_0x598677||0x1f4;return function(_0x4b6f55){logger[_0x828c('0x29')](_0x4b6f55[_0x828c('0x2a')]);if(_0x4b6f55[_0x828c('0x2b')]){delete _0x4b6f55['name'];}_0x4b80f1[_0x828c('0x18')](_0x598677)['send'](_0x4b6f55);};}exports[_0x828c('0x2c')]=function(_0x20c256,_0x3c28ce){var _0x5dbaca={},_0x5519ee={},_0x36be54={'count':0x0,'rows':[]};var _0x4a3262=_[_0x828c('0x2d')](db['Sound'][_0x828c('0x2e')],function(_0x3bc424){return{'name':_0x3bc424[_0x828c('0x2f')],'type':_0x3bc424[_0x828c('0x30')][_0x828c('0x31')]};});_0x5519ee[_0x828c('0x32')]=_['map'](_0x4a3262,'name');_0x5519ee[_0x828c('0x33')]=_[_0x828c('0x34')](_0x20c256[_0x828c('0x33')]);_0x5519ee[_0x828c('0x35')]=_[_0x828c('0x36')](_0x5519ee[_0x828c('0x32')],_0x5519ee[_0x828c('0x33')]);_0x5dbaca[_0x828c('0x37')]=_[_0x828c('0x36')](_0x5519ee[_0x828c('0x32')],qs['fields'](_0x20c256[_0x828c('0x33')][_0x828c('0x38')]));_0x5dbaca['attributes']=_0x5dbaca[_0x828c('0x37')]['length']?_0x5dbaca[_0x828c('0x37')]:_0x5519ee[_0x828c('0x32')];if(!_0x20c256[_0x828c('0x33')][_0x828c('0x39')](_0x828c('0x3a'))){_0x5dbaca[_0x828c('0x1c')]=qs['limit'](_0x20c256[_0x828c('0x33')]['limit']);_0x5dbaca[_0x828c('0x1e')]=qs['offset'](_0x20c256[_0x828c('0x33')][_0x828c('0x1e')]);}_0x5dbaca[_0x828c('0x3b')]=qs[_0x828c('0x3c')](_0x20c256[_0x828c('0x33')][_0x828c('0x3c')]);_0x5dbaca['where']=qs[_0x828c('0x35')](_['pick'](_0x20c256[_0x828c('0x33')],_0x5519ee[_0x828c('0x35')]),_0x4a3262);if(_0x20c256[_0x828c('0x33')][_0x828c('0x3d')]){_0x5dbaca[_0x828c('0x3e')]=_['merge'](_0x5dbaca[_0x828c('0x3e')],{'$or':_[_0x828c('0x2d')](_0x4a3262,function(_0x525af0){if(_0x525af0[_0x828c('0x30')]!==_0x828c('0x3f')){var _0x2710c8={};_0x2710c8[_0x525af0[_0x828c('0x2b')]]={'$like':'%'+_0x20c256['query'][_0x828c('0x3d')]+'%'};return _0x2710c8;}})});}_0x5dbaca=_[_0x828c('0x40')]({},_0x5dbaca,_0x20c256[_0x828c('0x41')]);var _0x3692bb={'where':_0x5dbaca[_0x828c('0x3e')]};return db[_0x828c('0x42')][_0x828c('0x1d')](_0x3692bb)['then'](function(_0x5ff7e3){_0x36be54[_0x828c('0x1d')]=_0x5ff7e3;if(_0x20c256[_0x828c('0x33')]['includeAll']){_0x5dbaca[_0x828c('0x43')]=[{'all':!![]}];}return db[_0x828c('0x42')]['findAll'](_0x5dbaca);})[_0x828c('0x24')](function(_0xf1bbc5){_0x36be54[_0x828c('0x44')]=_0xf1bbc5;return _0x36be54;})['then'](respondWithFilteredResult(_0x3c28ce,_0x5dbaca))[_0x828c('0x45')](handleError(_0x3c28ce,null));};exports[_0x828c('0x46')]=function(_0xea5278,_0x100bc4){var _0x4ee32a={'raw':!![],'where':{'id':_0xea5278[_0x828c('0x47')]['id']}},_0x5c889d={};_0x5c889d[_0x828c('0x32')]=_[_0x828c('0x34')](db['Sound'][_0x828c('0x2e')]);_0x5c889d['query']=_[_0x828c('0x34')](_0xea5278[_0x828c('0x33')]);_0x5c889d[_0x828c('0x35')]=_[_0x828c('0x36')](_0x5c889d[_0x828c('0x32')],_0x5c889d[_0x828c('0x33')]);_0x4ee32a[_0x828c('0x37')]=_[_0x828c('0x36')](_0x5c889d[_0x828c('0x32')],qs[_0x828c('0x38')](_0xea5278[_0x828c('0x33')][_0x828c('0x38')]));_0x4ee32a[_0x828c('0x37')]=_0x4ee32a['attributes'][_0x828c('0x48')]?_0x4ee32a[_0x828c('0x37')]:_0x5c889d[_0x828c('0x32')];if(_0xea5278[_0x828c('0x33')][_0x828c('0x49')]){_0x4ee32a[_0x828c('0x43')]=[{'all':!![]}];}_0x4ee32a=_['merge']({},_0x4ee32a,_0xea5278[_0x828c('0x41')]);return db['Sound'][_0x828c('0x4a')](_0x4ee32a)[_0x828c('0x24')](handleEntityNotFound(_0x100bc4,null))['then'](respondWithResult(_0x100bc4,null))[_0x828c('0x45')](handleError(_0x100bc4,null));};exports[_0x828c('0x4b')]=function(_0x23c6a7,_0x224d8d,_0x6ee449){return db[_0x828c('0x42')]['find']({'where':{'id':_0x23c6a7[_0x828c('0x47')]['id']},'attributes':[_0x828c('0x2b'),_0x828c('0x4c'),'converted_format'],'raw':!![]})[_0x828c('0x24')](handleEntityNotFound(_0x224d8d,null))['then'](function(_0x163248){if(_0x163248){if(!fs[_0x828c('0x4d')](path[_0x828c('0x4e')](config[_0x828c('0x4f')],_0x828c('0x50'),_0x163248[_0x828c('0x4c')]+'.'+_0x163248['converted_format']))){throw new db[(_0x828c('0x51'))][(_0x828c('0x52'))]('Sound\x20not\x20found');}return _0x224d8d[_0x828c('0x4b')](path[_0x828c('0x4e')](config[_0x828c('0x4f')],_0x828c('0x50'),util[_0x828c('0x53')]('%s.%s',_0x163248[_0x828c('0x4c')],_0x163248[_0x828c('0x54')])),util['format'](_0x828c('0x55'),_0x163248[_0x828c('0x2b')],_0x163248[_0x828c('0x54')]));}return null;})[_0x828c('0x45')](handleError(_0x224d8d,null));};exports[_0x828c('0x56')]=function(_0x2fdaa2,_0x417ae3,_0x2be07c){var _0x4b2f71={'name':path[_0x828c('0x57')](_0x2fdaa2[_0x828c('0x58')]['originalname'],path[_0x828c('0x59')](_0x2fdaa2[_0x828c('0x58')]['originalname'])),'save_name':path[_0x828c('0x57')](_0x2fdaa2['file'][_0x828c('0x5a')],path[_0x828c('0x59')](_0x2fdaa2[_0x828c('0x58')][_0x828c('0x5a')])),'original_format':path['extname'](_0x2fdaa2[_0x828c('0x58')][_0x828c('0x5b')])['substring'](0x1),'converted_format':'wav'};var _0x358209=path[_0x828c('0x4e')](config['root'],_0x828c('0x5c'),_0x2fdaa2[_0x828c('0x58')][_0x828c('0x5a')]);var _0x5012fc=path[_0x828c('0x4e')](config['root'],_0x828c('0x50'),util['format'](_0x828c('0x55'),path[_0x828c('0x57')](_0x2fdaa2['file'][_0x828c('0x5a')],path['extname'](_0x2fdaa2[_0x828c('0x58')][_0x828c('0x5a')])),_0x4b2f71[_0x828c('0x54')]));logger[_0x828c('0x5d')](_0x828c('0x5e'),_0x358209);logger[_0x828c('0x5d')]('Sound\x20upload\x20destination:\x20%s',_0x5012fc);try{fs[_0x828c('0x5f')](_0x358209,parseInt(_0x828c('0x60'),0x8));var _0x11c6fb=sox[_0x828c('0x61')](_0x358209,_0x5012fc,{'sampleRate':0x1f40,'format':_0x828c('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x11c6fb['on'](_0x828c('0x29'),function(_0x4ae74b){fs['unlinkSync'](_0x358209);_0x417ae3[_0x828c('0x18')](0x1f4)['send'](_0x4ae74b);});_0x11c6fb['on'](_0x828c('0x63'),function(_0x52f639){_0x4b2f71[_0x828c('0x64')]=isNaN(_0x52f639[_0x828c('0x65')])?null:_0x52f639[_0x828c('0x65')]*0x3e8;_0x4b2f71[_0x828c('0x66')]=isNaN(_0x52f639[_0x828c('0x67')])?null:_0x52f639[_0x828c('0x67')];_0x4b2f71[_0x828c('0x68')]=isNaN(_0x52f639[_0x828c('0x69')])?null:_0x52f639[_0x828c('0x69')];_0x4b2f71[_0x828c('0x6a')]=isNaN(_0x52f639['bitRate'])?null:_0x52f639[_0x828c('0x6b')];_0x4b2f71[_0x828c('0x6c')]=isNaN(_0x52f639[_0x828c('0x6d')])?null:_0x52f639[_0x828c('0x6d')];});_0x11c6fb['on'](_0x828c('0x6e'),function(_0x1be879){_0x4b2f71[_0x828c('0x6f')]=isNaN(_0x1be879[_0x828c('0x65')])?null:_0x1be879[_0x828c('0x65')]*0x3e8;_0x4b2f71['converted_sampleCount']=isNaN(_0x1be879[_0x828c('0x67')])?null:_0x1be879[_0x828c('0x67')];_0x4b2f71[_0x828c('0x70')]=isNaN(_0x1be879[_0x828c('0x69')])?null:_0x1be879[_0x828c('0x69')];_0x4b2f71[_0x828c('0x71')]=isNaN(_0x1be879['bitRate'])?null:_0x1be879['bitRate'];_0x4b2f71[_0x828c('0x72')]=isNaN(_0x1be879['sampleRate'])?null:_0x1be879[_0x828c('0x6d')];});_0x11c6fb['on'](_0x828c('0x19'),function(){fs[_0x828c('0x5f')](_0x5012fc,parseInt('0777',0x8));return db[_0x828c('0x42')][_0x828c('0x56')](_0x4b2f71)['then'](function(_0x206ec9){var _0x19ebb6={'role':_0x2fdaa2[_0x828c('0x73')][_0x828c('0x74')],'userProfileId':_0x2fdaa2[_0x828c('0x73')][_0x828c('0x75')]};if(!_0x19ebb6)throw new Error(_0x828c('0x76'));if(_0x19ebb6[_0x828c('0x74')]==='user'){var _0x3e53b1=_0x206ec9[_0x828c('0x25')]({'plain':!![]});return db[_0x828c('0x77')][_0x828c('0x4a')]({'where':{'name':_0x828c('0x26'),'userProfileId':_0x19ebb6[_0x828c('0x75')]},'raw':!![]})[_0x828c('0x24')](function(_0x501a24){if(_0x501a24&&_0x501a24[_0x828c('0x78')]===0x0){return db[_0x828c('0x27')][_0x828c('0x56')]({'name':_0x3e53b1['name'],'resourceId':_0x3e53b1['id'],'type':_0x501a24[_0x828c('0x2b')],'sectionId':_0x501a24['id']},{})[_0x828c('0x24')](function(){return _0x206ec9;});}else{return _0x206ec9;}})['catch'](function(_0x58a0ff){logger[_0x828c('0x29')](_0x828c('0x79'),_0x58a0ff);throw _0x58a0ff;});}return _0x206ec9;})[_0x828c('0x24')](respondWithResult(_0x417ae3,null))[_0x828c('0x45')](handleError(_0x417ae3,null));});_0x11c6fb[_0x828c('0x7a')]();}catch(_0x4f5feb){_0x417ae3[_0x828c('0x18')](0x1f4)[_0x828c('0x7b')](_0x4f5feb);}};exports[_0x828c('0x23')]=function(_0x2984c5,_0x50a83f,_0x1780a2){return db[_0x828c('0x42')]['find']({'where':{'id':_0x2984c5[_0x828c('0x47')]['id']}})[_0x828c('0x24')](handleEntityNotFound(_0x50a83f,null))[_0x828c('0x24')](saveUpdates(_[_0x828c('0x7c')](_0x2984c5[_0x828c('0x73')],[_0x828c('0x2b'),'description']),null))['then'](respondWithResult(_0x50a83f,null))[_0x828c('0x45')](handleError(_0x50a83f,null));};exports[_0x828c('0x7d')]=function(_0x442ad8,_0x18a75c,_0x2336f5){return db['Sound']['find']({'where':{'id':_0x442ad8[_0x828c('0x47')]['id']}})[_0x828c('0x24')](function(_0x2f787c){if(_0x2f787c){return _0x2f787c[_0x828c('0x28')]();}})[_0x828c('0x24')](function(_0x399777){var _0xf42f67=path[_0x828c('0x4e')](config[_0x828c('0x4f')],'server/files/sounds/original',util[_0x828c('0x53')]('%s.%s',_0x399777[_0x828c('0x4c')],_0x399777[_0x828c('0x7e')]));var _0x59fca5=path[_0x828c('0x4e')](config['root'],_0x828c('0x50'),util['format'](_0x828c('0x55'),_0x399777[_0x828c('0x4c')],_0x399777['converted_format']));fs[_0x828c('0x7f')](_0xf42f67);fs[_0x828c('0x7f')](_0x59fca5);return _0x399777;})[_0x828c('0x24')](function(_0x4f0c9c){if(_0x4f0c9c){return _0x18a75c[_0x828c('0x18')](0xcc)[_0x828c('0x19')]();}})[_0x828c('0x24')](handleEntityNotFound(_0x18a75c,null))[_0x828c('0x45')](handleError(_0x18a75c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a75831e..b411ef0 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 _0xb083=['./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ecfda,_0x29dae8){var _0x498c13=function(_0x43b725){while(--_0x43b725){_0x3ecfda['push'](_0x3ecfda['shift']());}};_0x498c13(++_0x29dae8);}(_0xb083,0x1f3));var _0x3b08=function(_0x4193fd,_0x240d67){_0x4193fd=_0x4193fd-0x0;var _0x1dd0de=_0xb083[_0x4193fd];return _0x1dd0de;};'use strict';var _=require(_0x3b08('0x0'));var util=require('util');var logger=require(_0x3b08('0x1'))(_0x3b08('0x2'));var moment=require(_0x3b08('0x3'));var BPromise=require(_0x3b08('0x4'));var rp=require(_0x3b08('0x5'));var fs=require('fs');var path=require(_0x3b08('0x6'));var rimraf=require(_0x3b08('0x7'));var config=require('../../config/environment');var attributes=require(_0x3b08('0x8'));module[_0x3b08('0x9')]=function(_0x535276,_0x2b6840){return _0x535276[_0x3b08('0xa')](_0x3b08('0xb'),attributes,{'tableName':_0x3b08('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x210a=['define','Sound','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x210a,0xaa));var _0xa210=function(_0x1513c0,_0x4ef440){_0x1513c0=_0x1513c0-0x0;var _0x22c605=_0x210a[_0x1513c0];return _0x22c605;};'use strict';var _=require(_0xa210('0x0'));var util=require('util');var logger=require(_0xa210('0x1'))(_0xa210('0x2'));var moment=require(_0xa210('0x3'));var BPromise=require('bluebird');var rp=require(_0xa210('0x4'));var fs=require('fs');var path=require(_0xa210('0x5'));var rimraf=require(_0xa210('0x6'));var config=require(_0xa210('0x7'));var attributes=require(_0xa210('0x8'));module[_0xa210('0x9')]=function(_0x1633a8,_0x17726b){return _0x1633a8[_0xa210('0xa')](_0xa210('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 779c886..89fe45c 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 _0xedac=['ShowSound','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0x21d613,_0x258919){var _0x1d281b=function(_0x277a29){while(--_0x277a29){_0x21d613['push'](_0x21d613['shift']());}};_0x1d281b(++_0x258919);}(_0xedac,0xe2));var _0xceda=function(_0x35733,_0x919feb){_0x35733=_0x35733-0x0;var _0xa53580=_0xedac[_0x35733];return _0xa53580;};'use strict';var _=require(_0xceda('0x0'));var util=require(_0xceda('0x1'));var moment=require(_0xceda('0x2'));var BPromise=require(_0xceda('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xceda('0x4'));var logger=require(_0xceda('0x5'))(_0xceda('0x6'));var config=require(_0xceda('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xceda('0x8')][_0xceda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x178fc0,_0x274af0,_0x3c5c7c){return new BPromise(function(_0x50b2a3,_0x231d11){return client[_0xceda('0xa')](_0x178fc0,_0x3c5c7c)[_0xceda('0xb')](function(_0x3a1587){logger['info'](_0xceda('0xc'),_0x274af0,_0xceda('0xd'));logger[_0xceda('0xe')](_0xceda('0xf'),_0x274af0,'request\x20sent',JSON['stringify'](_0x3a1587));if(_0x3a1587[_0xceda('0x10')]){if(_0x3a1587[_0xceda('0x10')][_0xceda('0x11')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x274af0,_0x3a1587[_0xceda('0x10')][_0xceda('0x12')]);return _0x231d11(_0x3a1587[_0xceda('0x10')]['message']);}logger[_0xceda('0x10')](_0xceda('0xc'),_0x274af0,_0x3a1587[_0xceda('0x10')][_0xceda('0x12')]);return _0x50b2a3(_0x3a1587['error'][_0xceda('0x12')]);}else{logger[_0xceda('0x13')](_0xceda('0xc'),_0x274af0,_0xceda('0xd'));_0x50b2a3(_0x3a1587['result'][_0xceda('0x12')]);}})[_0xceda('0x14')](function(_0x150d30){logger[_0xceda('0x10')](_0xceda('0xc'),_0x274af0,_0x150d30);_0x231d11(_0x150d30);});});}exports['ShowSound']=function(_0x5bf362){var _0x14b91a=this;return new Promise(function(_0x1253cf,_0x114d00){return db[_0xceda('0x15')][_0xceda('0x16')]({'raw':_0x5bf362[_0xceda('0x17')]?_0x5bf362[_0xceda('0x17')][_0xceda('0x18')]===undefined?!![]:![]:!![],'where':_0x5bf362['options']?_0x5bf362[_0xceda('0x17')][_0xceda('0x19')]||null:null,'attributes':_0x5bf362[_0xceda('0x17')]?_0x5bf362[_0xceda('0x17')][_0xceda('0x1a')]||null:null,'include':_0x5bf362[_0xceda('0x17')]?_0x5bf362[_0xceda('0x17')][_0xceda('0x1b')]?_['map'](_0x5bf362['options'][_0xceda('0x1b')],function(_0x389408){return{'model':db[_0x389408[_0xceda('0x1c')]],'as':_0x389408['as'],'attributes':_0x389408[_0xceda('0x1a')],'include':_0x389408[_0xceda('0x1b')]?_[_0xceda('0x1d')](_0x389408[_0xceda('0x1b')],function(_0x2fae6a){return{'model':db[_0x2fae6a[_0xceda('0x1c')]],'as':_0x2fae6a['as'],'attributes':_0x2fae6a['attributes'],'include':_0x2fae6a[_0xceda('0x1b')]?_['map'](_0x2fae6a[_0xceda('0x1b')],function(_0x579b73){return{'model':db[_0x579b73['model']],'as':_0x579b73['as'],'attributes':_0x579b73[_0xceda('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xceda('0xb')](function(_0x4e2799){logger['info'](_0xceda('0x1e'),_0x5bf362);logger[_0xceda('0xe')]('ShowSound',_0x5bf362,JSON[_0xceda('0x1f')](_0x4e2799));_0x1253cf(_0x4e2799);})[_0xceda('0x14')](function(_0x1117fa){logger[_0xceda('0x10')](_0xceda('0x1e'),_0x1117fa['message'],_0x5bf362);_0x114d00(_0x14b91a[_0xceda('0x10')](0x1f4,_0x1117fa['message']));});});}; \ No newline at end of file +var _0xd16a=['request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','ShowSound','find','options','raw','where','attributes','map','include','model','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b6867,_0xad2fe6){var _0x4d02ec=function(_0x23d81e){while(--_0x23d81e){_0x2b6867['push'](_0x2b6867['shift']());}};_0x4d02ec(++_0xad2fe6);}(_0xd16a,0xee));var _0xad16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd16a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xad16('0x0'));var moment=require('moment');var BPromise=require(_0xad16('0x1'));var rs=require(_0xad16('0x2'));var fs=require('fs');var Redis=require(_0xad16('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xad16('0x4'))(_0xad16('0x5'));var config=require(_0xad16('0x6'));var jayson=require(_0xad16('0x7'));var client=jayson[_0xad16('0x8')][_0xad16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f056b,_0x24bc50,_0xf8ff24){return new BPromise(function(_0xeb408,_0x208c65){return client[_0xad16('0xa')](_0x1f056b,_0xf8ff24)[_0xad16('0xb')](function(_0x290d22){logger[_0xad16('0xc')]('Sound,\x20%s,\x20%s',_0x24bc50,_0xad16('0xd'));logger[_0xad16('0xe')](_0xad16('0xf'),_0x24bc50,_0xad16('0xd'),JSON[_0xad16('0x10')](_0x290d22));if(_0x290d22[_0xad16('0x11')]){if(_0x290d22['error'][_0xad16('0x12')]===0x1f4){logger['error'](_0xad16('0x13'),_0x24bc50,_0x290d22[_0xad16('0x11')]['message']);return _0x208c65(_0x290d22[_0xad16('0x11')][_0xad16('0x14')]);}logger['error'](_0xad16('0x13'),_0x24bc50,_0x290d22[_0xad16('0x11')][_0xad16('0x14')]);return _0xeb408(_0x290d22[_0xad16('0x11')][_0xad16('0x14')]);}else{logger['info'](_0xad16('0x13'),_0x24bc50,_0xad16('0xd'));_0xeb408(_0x290d22['result']['message']);}})['catch'](function(_0x203a6b){logger[_0xad16('0x11')]('Sound,\x20%s,\x20%s',_0x24bc50,_0x203a6b);_0x208c65(_0x203a6b);});});}exports[_0xad16('0x15')]=function(_0x286f1e){var _0x57e602=this;return new Promise(function(_0xeb01f7,_0x233f93){return db['Sound'][_0xad16('0x16')]({'raw':_0x286f1e[_0xad16('0x17')]?_0x286f1e['options'][_0xad16('0x18')]===undefined?!![]:![]:!![],'where':_0x286f1e[_0xad16('0x17')]?_0x286f1e[_0xad16('0x17')][_0xad16('0x19')]||null:null,'attributes':_0x286f1e[_0xad16('0x17')]?_0x286f1e[_0xad16('0x17')][_0xad16('0x1a')]||null:null,'include':_0x286f1e[_0xad16('0x17')]?_0x286f1e[_0xad16('0x17')]['include']?_[_0xad16('0x1b')](_0x286f1e[_0xad16('0x17')][_0xad16('0x1c')],function(_0x1b6b0a){return{'model':db[_0x1b6b0a['model']],'as':_0x1b6b0a['as'],'attributes':_0x1b6b0a['attributes'],'include':_0x1b6b0a[_0xad16('0x1c')]?_['map'](_0x1b6b0a[_0xad16('0x1c')],function(_0x9effb0){return{'model':db[_0x9effb0[_0xad16('0x1d')]],'as':_0x9effb0['as'],'attributes':_0x9effb0[_0xad16('0x1a')],'include':_0x9effb0[_0xad16('0x1c')]?_[_0xad16('0x1b')](_0x9effb0['include'],function(_0x464bf5){return{'model':db[_0x464bf5[_0xad16('0x1d')]],'as':_0x464bf5['as'],'attributes':_0x464bf5['attributes']};}):[]};}):[]};}):[]:[]})[_0xad16('0xb')](function(_0x129782){logger[_0xad16('0xc')](_0xad16('0x15'),_0x286f1e);logger[_0xad16('0xe')](_0xad16('0x15'),_0x286f1e,JSON[_0xad16('0x10')](_0x129782));_0xeb01f7(_0x129782);})[_0xad16('0x1e')](function(_0x52011e){logger[_0xad16('0x11')](_0xad16('0x15'),_0x52011e[_0xad16('0x14')],_0x286f1e);_0x233f93(_0x57e602['error'](0x1f4,_0x52011e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e60e54f..854e6cd 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 _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1d24ab,_0x32ca77){var _0x3f0693=function(_0x46616d){while(--_0x46616d){_0x1d24ab['push'](_0x1d24ab['shift']());}};_0x3f0693(++_0x32ca77);}(_0xac4a,0x13f));var _0xaac4=function(_0x15e230,_0x2b102c){_0x15e230=_0x15e230-0x0;var _0x513d3b=_0xac4a[_0x15e230];return _0x513d3b;};'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 +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x5ef35e,_0x329db7){var _0x4cdc0c=function(_0x20bda0){while(--_0x20bda0){_0x5ef35e['push'](_0x5ef35e['shift']());}};_0x4cdc0c(++_0x329db7);}(_0xda3f,0xec));var _0xfda3=function(_0x419720,_0x45ad2d){_0x419720=_0x419720-0x0;var _0x5c16e2=_0xda3f[_0x419720];return _0x5c16e2;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f2e1c03..ffdf705 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 _0x18d4=['out','sequelize','STRING','TEXT'];(function(_0xac6c59,_0x2f440b){var _0x197629=function(_0x66a5e5){while(--_0x66a5e5){_0xac6c59['push'](_0xac6c59['shift']());}};_0x197629(++_0x2f440b);}(_0x18d4,0x75));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x418d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x418d('0x1')]},'body':{'type':Sequelize[_0x418d('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x418d('0x3'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x418d('0x2')]}}; \ No newline at end of file +var _0xddea=['medium','ENUM','out','TEXT','sequelize','exports','STRING'];(function(_0x2e14f7,_0x4210e4){var _0x415088=function(_0x276555){while(--_0x276555){_0x2e14f7['push'](_0x2e14f7['shift']());}};_0x415088(++_0x4210e4);}(_0xddea,0x1a1));var _0xadde=function(_0x540da8,_0x5c3e0c){_0x540da8=_0x540da8-0x0;var _0x4d4864=_0xddea[_0x540da8];return _0x4d4864;};'use strict';var Sequelize=require(_0xadde('0x0'));module[_0xadde('0x1')]={'uniqueid':{'type':Sequelize[_0xadde('0x2')]},'body':{'type':Sequelize['TEXT'](_0xadde('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xadde('0x4')]('in',_0xadde('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xadde('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 64f1c72..7682472 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 _0x3080=['where','type','VIRTUAL','filter','merge','options','SquareMessage','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick'];(function(_0x163312,_0x1614e1){var _0x3ff4b8=function(_0x22bd7b){while(--_0x22bd7b){_0x163312['push'](_0x163312['shift']());}};_0x3ff4b8(++_0x1614e1);}(_0x3080,0x1e6));var _0x0308=function(_0x2724d8,_0x13ecde){_0x2724d8=_0x2724d8-0x0;var _0x4e7151=_0x3080[_0x2724d8];return _0x4e7151;};'use strict';var emlformat=require(_0x0308('0x0'));var rimraf=require(_0x0308('0x1'));var zipdir=require(_0x0308('0x2'));var jsonpatch=require(_0x0308('0x3'));var rp=require('request-promise');var moment=require(_0x0308('0x4'));var BPromise=require(_0x0308('0x5'));var Mustache=require(_0x0308('0x6'));var util=require(_0x0308('0x7'));var path=require(_0x0308('0x8'));var sox=require(_0x0308('0x9'));var csv=require('to-csv');var ejs=require(_0x0308('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0308('0xb'));var squel=require(_0x0308('0xc'));var crypto=require(_0x0308('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0308('0xe'));var toCsv=require(_0x0308('0xf'));var querystring=require(_0x0308('0x10'));var Papa=require(_0x0308('0x11'));var Redis=require(_0x0308('0x12'));var authService=require(_0x0308('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0308('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0308('0x15'))(_0x0308('0x16'));var utils=require(_0x0308('0x17'));var config=require(_0x0308('0x18'));var licenseUtil=require(_0x0308('0x19'));var db=require(_0x0308('0x1a'))['db'];function respondWithStatusCode(_0x590d38,_0x52c884){_0x52c884=_0x52c884||0xcc;return function(_0x43d48f){if(_0x43d48f){return _0x590d38[_0x0308('0x1b')](_0x52c884);}return _0x590d38['status'](_0x52c884)['end']();};}function respondWithResult(_0x2cff66,_0x5da96e){_0x5da96e=_0x5da96e||0xc8;return function(_0xbc9ce4){if(_0xbc9ce4){return _0x2cff66[_0x0308('0x1c')](_0x5da96e)[_0x0308('0x1d')](_0xbc9ce4);}};}function respondWithFilteredResult(_0x34f0ec,_0x4460e9){return function(_0x4f50be){if(_0x4f50be){var _0x534526=typeof _0x4460e9['offset']==='undefined'&&typeof _0x4460e9[_0x0308('0x1e')]==='undefined';var _0xacc60=_0x4f50be['count'];var _0x367d93=_0x534526?0x0:_0x4460e9[_0x0308('0x1f')];var _0xc2ae04=_0x534526?_0x4f50be[_0x0308('0x20')]:_0x4460e9['offset']+_0x4460e9['limit'];var _0x4de58e;if(_0xc2ae04>=_0xacc60){_0xc2ae04=_0xacc60;_0x4de58e=0xc8;}else{_0x4de58e=0xce;}_0x34f0ec[_0x0308('0x1c')](_0x4de58e);return _0x34f0ec[_0x0308('0x21')](_0x0308('0x22'),_0x367d93+'-'+_0xc2ae04+'/'+_0xacc60)[_0x0308('0x1d')](_0x4f50be);}return null;};}function patchUpdates(_0xa6c0c2){return function(_0x28e04f){try{jsonpatch[_0x0308('0x23')](_0x28e04f,_0xa6c0c2,!![]);}catch(_0xc0ad8c){return BPromise[_0x0308('0x24')](_0xc0ad8c);}return _0x28e04f['save']();};}function saveUpdates(_0x54b20d,_0x16f736){return function(_0x2810d3){if(_0x2810d3){return _0x2810d3['update'](_0x54b20d)[_0x0308('0x25')](function(_0x48ee8c){return _0x48ee8c;});}return null;};}function removeEntity(_0x1d7eaf,_0x21f2f3){return function(_0x1791ff){if(_0x1791ff){return _0x1791ff[_0x0308('0x26')]()[_0x0308('0x25')](function(){_0x1d7eaf[_0x0308('0x1c')](0xcc)[_0x0308('0x27')]();});}};}function handleEntityNotFound(_0x5e92dd,_0x47a0b9){return function(_0x952583){if(!_0x952583){_0x5e92dd[_0x0308('0x1b')](0x194);}return _0x952583;};}function handleError(_0xcb0e54,_0x1ab5a2){_0x1ab5a2=_0x1ab5a2||0x1f4;return function(_0xfa8f13){logger[_0x0308('0x28')](_0xfa8f13[_0x0308('0x29')]);if(_0xfa8f13[_0x0308('0x2a')]){delete _0xfa8f13[_0x0308('0x2a')];}_0xcb0e54[_0x0308('0x1c')](_0x1ab5a2)[_0x0308('0x2b')](_0xfa8f13);};}exports[_0x0308('0x2c')]=function(_0x48d5d6,_0x28d0f3){var _0x5dd24d={},_0x1160a8={},_0x2f261d={'count':0x0,'rows':[]};var _0x50ee95=_['map'](db['SquareMessage'][_0x0308('0x2d')],function(_0x365018){return{'name':_0x365018['fieldName'],'type':_0x365018['type'][_0x0308('0x2e')]};});_0x1160a8[_0x0308('0x2f')]=_[_0x0308('0x30')](_0x50ee95,'name');_0x1160a8[_0x0308('0x31')]=_[_0x0308('0x32')](_0x48d5d6[_0x0308('0x31')]);_0x1160a8[_0x0308('0x33')]=_['intersection'](_0x1160a8[_0x0308('0x2f')],_0x1160a8['query']);_0x5dd24d[_0x0308('0x34')]=_[_0x0308('0x35')](_0x1160a8[_0x0308('0x2f')],qs[_0x0308('0x36')](_0x48d5d6['query']['fields']));_0x5dd24d[_0x0308('0x34')]=_0x5dd24d['attributes'][_0x0308('0x37')]?_0x5dd24d['attributes']:_0x1160a8[_0x0308('0x2f')];if(!_0x48d5d6[_0x0308('0x31')]['hasOwnProperty'](_0x0308('0x38'))){_0x5dd24d[_0x0308('0x1e')]=qs[_0x0308('0x1e')](_0x48d5d6[_0x0308('0x31')][_0x0308('0x1e')]);_0x5dd24d[_0x0308('0x1f')]=qs[_0x0308('0x1f')](_0x48d5d6[_0x0308('0x31')][_0x0308('0x1f')]);}_0x5dd24d[_0x0308('0x39')]=qs[_0x0308('0x3a')](_0x48d5d6[_0x0308('0x31')][_0x0308('0x3a')]);_0x5dd24d['where']=qs[_0x0308('0x33')](_[_0x0308('0x3b')](_0x48d5d6[_0x0308('0x31')],_0x1160a8['filters']),_0x50ee95);if(_0x48d5d6[_0x0308('0x31')]['filter']){_0x5dd24d[_0x0308('0x3c')]=_['merge'](_0x5dd24d[_0x0308('0x3c')],{'$or':_[_0x0308('0x30')](_0x50ee95,function(_0x3f852c){if(_0x3f852c[_0x0308('0x3d')]!==_0x0308('0x3e')){var _0x534eb8={};_0x534eb8[_0x3f852c[_0x0308('0x2a')]]={'$like':'%'+_0x48d5d6['query'][_0x0308('0x3f')]+'%'};return _0x534eb8;}})});}_0x5dd24d=_[_0x0308('0x40')]({},_0x5dd24d,_0x48d5d6[_0x0308('0x41')]);var _0x1cc6bb={'where':_0x5dd24d[_0x0308('0x3c')]};return db[_0x0308('0x42')][_0x0308('0x20')](_0x1cc6bb)[_0x0308('0x25')](function(_0x19e744){_0x2f261d[_0x0308('0x20')]=_0x19e744;if(_0x48d5d6['query'][_0x0308('0x43')]){_0x5dd24d[_0x0308('0x44')]=[{'all':!![]}];}return db[_0x0308('0x42')][_0x0308('0x45')](_0x5dd24d);})['then'](function(_0x2536fd){_0x2f261d[_0x0308('0x46')]=_0x2536fd;return _0x2f261d;})[_0x0308('0x25')](respondWithFilteredResult(_0x28d0f3,_0x5dd24d))[_0x0308('0x47')](handleError(_0x28d0f3,null));};exports[_0x0308('0x48')]=function(_0x455781,_0x328ce4){var _0x54971f={'raw':!![],'where':{'id':_0x455781['params']['id']}},_0x49ccab={};_0x49ccab[_0x0308('0x2f')]=_['keys'](db[_0x0308('0x42')]['rawAttributes']);_0x49ccab['query']=_['keys'](_0x455781[_0x0308('0x31')]);_0x49ccab[_0x0308('0x33')]=_[_0x0308('0x35')](_0x49ccab[_0x0308('0x2f')],_0x49ccab['query']);_0x54971f[_0x0308('0x34')]=_['intersection'](_0x49ccab[_0x0308('0x2f')],qs['fields'](_0x455781['query'][_0x0308('0x36')]));_0x54971f[_0x0308('0x34')]=_0x54971f[_0x0308('0x34')]['length']?_0x54971f['attributes']:_0x49ccab[_0x0308('0x2f')];if(_0x455781[_0x0308('0x31')][_0x0308('0x43')]){_0x54971f['include']=[{'all':!![]}];}_0x54971f=_[_0x0308('0x40')]({},_0x54971f,_0x455781[_0x0308('0x41')]);return db[_0x0308('0x42')]['find'](_0x54971f)[_0x0308('0x25')](handleEntityNotFound(_0x328ce4,null))[_0x0308('0x25')](respondWithResult(_0x328ce4,null))[_0x0308('0x47')](handleError(_0x328ce4,null));};exports['create']=function(_0x252393,_0x33c712){return db[_0x0308('0x42')][_0x0308('0x49')](_0x252393[_0x0308('0x4a')],{})['then'](respondWithResult(_0x33c712,0xc9))['catch'](handleError(_0x33c712,null));};exports[_0x0308('0x4b')]=function(_0x370e3b,_0x160285){if(_0x370e3b['body']['id']){delete _0x370e3b[_0x0308('0x4a')]['id'];}return db[_0x0308('0x42')][_0x0308('0x4c')]({'where':{'id':_0x370e3b[_0x0308('0x4d')]['id']}})[_0x0308('0x25')](handleEntityNotFound(_0x160285,null))[_0x0308('0x25')](saveUpdates(_0x370e3b[_0x0308('0x4a')],null))[_0x0308('0x25')](respondWithResult(_0x160285,null))[_0x0308('0x47')](handleError(_0x160285,null));};exports[_0x0308('0x26')]=function(_0x2d5868,_0x47c11d){return db[_0x0308('0x42')]['find']({'where':{'id':_0x2d5868[_0x0308('0x4d')]['id']}})[_0x0308('0x25')](handleEntityNotFound(_0x47c11d,null))[_0x0308('0x25')](removeEntity(_0x47c11d,null))['catch'](handleError(_0x47c11d,null));}; \ No newline at end of file +var _0x2015=['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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareMessage','includeAll','include','findAll','rows','show','create','catch','body','find','params','eml-format','rimraf'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x2015,0x193));var _0x5201=function(_0x222504,_0xe276ea){_0x222504=_0x222504-0x0;var _0x41de9a=_0x2015[_0x222504];return _0x41de9a;};'use strict';var emlformat=require(_0x5201('0x0'));var rimraf=require(_0x5201('0x1'));var zipdir=require(_0x5201('0x2'));var jsonpatch=require(_0x5201('0x3'));var rp=require(_0x5201('0x4'));var moment=require(_0x5201('0x5'));var BPromise=require(_0x5201('0x6'));var Mustache=require(_0x5201('0x7'));var util=require('util');var path=require(_0x5201('0x8'));var sox=require(_0x5201('0x9'));var csv=require(_0x5201('0xa'));var ejs=require(_0x5201('0xb'));var fs=require('fs');var fs_extra=require(_0x5201('0xc'));var _=require(_0x5201('0xd'));var squel=require(_0x5201('0xe'));var crypto=require(_0x5201('0xf'));var jsforce=require(_0x5201('0x10'));var deskjs=require(_0x5201('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5201('0x12'));var Papa=require(_0x5201('0x13'));var Redis=require('ioredis');var authService=require(_0x5201('0x14'));var qs=require(_0x5201('0x15'));var as=require(_0x5201('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5201('0x17'))(_0x5201('0x18'));var utils=require(_0x5201('0x19'));var config=require(_0x5201('0x1a'));var licenseUtil=require(_0x5201('0x1b'));var db=require(_0x5201('0x1c'))['db'];function respondWithStatusCode(_0x2038a9,_0x677cd5){_0x677cd5=_0x677cd5||0xcc;return function(_0x2aa01f){if(_0x2aa01f){return _0x2038a9[_0x5201('0x1d')](_0x677cd5);}return _0x2038a9[_0x5201('0x1e')](_0x677cd5)[_0x5201('0x1f')]();};}function respondWithResult(_0x491252,_0x377838){_0x377838=_0x377838||0xc8;return function(_0x30a34e){if(_0x30a34e){return _0x491252['status'](_0x377838)['json'](_0x30a34e);}};}function respondWithFilteredResult(_0x395a97,_0x364fb7){return function(_0x224f98){if(_0x224f98){var _0x5b3184=typeof _0x364fb7['offset']===_0x5201('0x20')&&typeof _0x364fb7['limit']===_0x5201('0x20');var _0x54810d=_0x224f98[_0x5201('0x21')];var _0x4d44d8=_0x5b3184?0x0:_0x364fb7[_0x5201('0x22')];var _0x1a17ac=_0x5b3184?_0x224f98[_0x5201('0x21')]:_0x364fb7[_0x5201('0x22')]+_0x364fb7['limit'];var _0x510942;if(_0x1a17ac>=_0x54810d){_0x1a17ac=_0x54810d;_0x510942=0xc8;}else{_0x510942=0xce;}_0x395a97[_0x5201('0x1e')](_0x510942);return _0x395a97[_0x5201('0x23')](_0x5201('0x24'),_0x4d44d8+'-'+_0x1a17ac+'/'+_0x54810d)['json'](_0x224f98);}return null;};}function patchUpdates(_0xd028ab){return function(_0x433884){try{jsonpatch[_0x5201('0x25')](_0x433884,_0xd028ab,!![]);}catch(_0x446bee){return BPromise[_0x5201('0x26')](_0x446bee);}return _0x433884['save']();};}function saveUpdates(_0x15fade,_0x32aa89){return function(_0x33c2bb){if(_0x33c2bb){return _0x33c2bb[_0x5201('0x27')](_0x15fade)[_0x5201('0x28')](function(_0x6d5e04){return _0x6d5e04;});}return null;};}function removeEntity(_0x10e9c2,_0x4d4142){return function(_0x4a3040){if(_0x4a3040){return _0x4a3040[_0x5201('0x29')]()[_0x5201('0x28')](function(){_0x10e9c2[_0x5201('0x1e')](0xcc)[_0x5201('0x1f')]();});}};}function handleEntityNotFound(_0x1258a7,_0x219e8){return function(_0x43ca02){if(!_0x43ca02){_0x1258a7[_0x5201('0x1d')](0x194);}return _0x43ca02;};}function handleError(_0x2c7a2c,_0x49aed2){_0x49aed2=_0x49aed2||0x1f4;return function(_0xff15b7){logger[_0x5201('0x2a')](_0xff15b7['stack']);if(_0xff15b7[_0x5201('0x2b')]){delete _0xff15b7['name'];}_0x2c7a2c['status'](_0x49aed2)[_0x5201('0x2c')](_0xff15b7);};}exports[_0x5201('0x2d')]=function(_0x33eecd,_0x58f914){var _0x5838ea={},_0x3b3d53={},_0x3597a0={'count':0x0,'rows':[]};var _0x453c7b=_[_0x5201('0x2e')](db['SquareMessage'][_0x5201('0x2f')],function(_0x153720){return{'name':_0x153720[_0x5201('0x30')],'type':_0x153720[_0x5201('0x31')][_0x5201('0x32')]};});_0x3b3d53['model']=_['map'](_0x453c7b,_0x5201('0x2b'));_0x3b3d53[_0x5201('0x33')]=_[_0x5201('0x34')](_0x33eecd[_0x5201('0x33')]);_0x3b3d53[_0x5201('0x35')]=_[_0x5201('0x36')](_0x3b3d53[_0x5201('0x37')],_0x3b3d53['query']);_0x5838ea[_0x5201('0x38')]=_[_0x5201('0x36')](_0x3b3d53[_0x5201('0x37')],qs['fields'](_0x33eecd[_0x5201('0x33')][_0x5201('0x39')]));_0x5838ea[_0x5201('0x38')]=_0x5838ea[_0x5201('0x38')][_0x5201('0x3a')]?_0x5838ea[_0x5201('0x38')]:_0x3b3d53[_0x5201('0x37')];if(!_0x33eecd[_0x5201('0x33')][_0x5201('0x3b')](_0x5201('0x3c'))){_0x5838ea[_0x5201('0x3d')]=qs[_0x5201('0x3d')](_0x33eecd['query']['limit']);_0x5838ea[_0x5201('0x22')]=qs[_0x5201('0x22')](_0x33eecd[_0x5201('0x33')][_0x5201('0x22')]);}_0x5838ea[_0x5201('0x3e')]=qs[_0x5201('0x3f')](_0x33eecd[_0x5201('0x33')]['sort']);_0x5838ea[_0x5201('0x40')]=qs[_0x5201('0x35')](_[_0x5201('0x41')](_0x33eecd['query'],_0x3b3d53[_0x5201('0x35')]),_0x453c7b);if(_0x33eecd[_0x5201('0x33')][_0x5201('0x42')]){_0x5838ea['where']=_[_0x5201('0x43')](_0x5838ea[_0x5201('0x40')],{'$or':_['map'](_0x453c7b,function(_0x5786c2){if(_0x5786c2[_0x5201('0x31')]!==_0x5201('0x44')){var _0xd8901b={};_0xd8901b[_0x5786c2[_0x5201('0x2b')]]={'$like':'%'+_0x33eecd[_0x5201('0x33')][_0x5201('0x42')]+'%'};return _0xd8901b;}})});}_0x5838ea=_['merge']({},_0x5838ea,_0x33eecd[_0x5201('0x45')]);var _0x5989bc={'where':_0x5838ea['where']};return db[_0x5201('0x46')][_0x5201('0x21')](_0x5989bc)[_0x5201('0x28')](function(_0x3e673f){_0x3597a0[_0x5201('0x21')]=_0x3e673f;if(_0x33eecd['query'][_0x5201('0x47')]){_0x5838ea[_0x5201('0x48')]=[{'all':!![]}];}return db[_0x5201('0x46')][_0x5201('0x49')](_0x5838ea);})[_0x5201('0x28')](function(_0x62a2a4){_0x3597a0[_0x5201('0x4a')]=_0x62a2a4;return _0x3597a0;})['then'](respondWithFilteredResult(_0x58f914,_0x5838ea))['catch'](handleError(_0x58f914,null));};exports[_0x5201('0x4b')]=function(_0x470a0d,_0x17ad51){var _0x105959={'raw':!![],'where':{'id':_0x470a0d['params']['id']}},_0x3bf92c={};_0x3bf92c['model']=_[_0x5201('0x34')](db[_0x5201('0x46')][_0x5201('0x2f')]);_0x3bf92c[_0x5201('0x33')]=_[_0x5201('0x34')](_0x470a0d[_0x5201('0x33')]);_0x3bf92c[_0x5201('0x35')]=_[_0x5201('0x36')](_0x3bf92c[_0x5201('0x37')],_0x3bf92c[_0x5201('0x33')]);_0x105959[_0x5201('0x38')]=_['intersection'](_0x3bf92c['model'],qs[_0x5201('0x39')](_0x470a0d[_0x5201('0x33')][_0x5201('0x39')]));_0x105959[_0x5201('0x38')]=_0x105959[_0x5201('0x38')]['length']?_0x105959['attributes']:_0x3bf92c[_0x5201('0x37')];if(_0x470a0d[_0x5201('0x33')][_0x5201('0x47')]){_0x105959[_0x5201('0x48')]=[{'all':!![]}];}_0x105959=_[_0x5201('0x43')]({},_0x105959,_0x470a0d[_0x5201('0x45')]);return db['SquareMessage']['find'](_0x105959)['then'](handleEntityNotFound(_0x17ad51,null))[_0x5201('0x28')](respondWithResult(_0x17ad51,null))['catch'](handleError(_0x17ad51,null));};exports[_0x5201('0x4c')]=function(_0xecbe7b,_0x3dea26){return db[_0x5201('0x46')][_0x5201('0x4c')](_0xecbe7b['body'],{})[_0x5201('0x28')](respondWithResult(_0x3dea26,0xc9))[_0x5201('0x4d')](handleError(_0x3dea26,null));};exports[_0x5201('0x27')]=function(_0x14e692,_0x3eeea1){if(_0x14e692[_0x5201('0x4e')]['id']){delete _0x14e692[_0x5201('0x4e')]['id'];}return db[_0x5201('0x46')][_0x5201('0x4f')]({'where':{'id':_0x14e692[_0x5201('0x50')]['id']}})['then'](handleEntityNotFound(_0x3eeea1,null))[_0x5201('0x28')](saveUpdates(_0x14e692['body'],null))[_0x5201('0x28')](respondWithResult(_0x3eeea1,null))[_0x5201('0x4d')](handleError(_0x3eeea1,null));};exports['destroy']=function(_0x14a142,_0xfa16c2){return db['SquareMessage'][_0x5201('0x4f')]({'where':{'id':_0x14a142['params']['id']}})[_0x5201('0x28')](handleEntityNotFound(_0xfa16c2,null))[_0x5201('0x28')](removeEntity(_0xfa16c2,null))[_0x5201('0x4d')](handleError(_0xfa16c2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4b4a6b9..33473ad 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 _0xa34e=['../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x1f3bfb,_0x2db1b1){var _0xb87807=function(_0x408d65){while(--_0x408d65){_0x1f3bfb['push'](_0x1f3bfb['shift']());}};_0xb87807(++_0x2db1b1);}(_0xa34e,0xe1));var _0xea34=function(_0x5e82ae,_0x1bf62f){_0x5e82ae=_0x5e82ae-0x0;var _0x2e3d18=_0xa34e[_0x5e82ae];return _0x2e3d18;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea34('0x0'))('api');var moment=require(_0xea34('0x1'));var BPromise=require('bluebird');var rp=require(_0xea34('0x2'));var fs=require('fs');var path=require(_0xea34('0x3'));var rimraf=require(_0xea34('0x4'));var config=require(_0xea34('0x5'));var attributes=require(_0xea34('0x6'));module[_0xea34('0x7')]=function(_0x302d96,_0x58baf3){return _0x302d96['define'](_0xea34('0x8'),attributes,{'tableName':_0xea34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe66b=['./squareMessage.attributes','exports','define','square_messages','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x25093f,_0x4d3ebd){var _0x1274e3=function(_0x22bc0a){while(--_0x22bc0a){_0x25093f['push'](_0x25093f['shift']());}};_0x1274e3(++_0x4d3ebd);}(_0xe66b,0x160));var _0xbe66=function(_0x3bb50b,_0xe7e034){_0x3bb50b=_0x3bb50b-0x0;var _0x2eea60=_0xe66b[_0x3bb50b];return _0x2eea60;};'use strict';var _=require(_0xbe66('0x0'));var util=require(_0xbe66('0x1'));var logger=require(_0xbe66('0x2'))(_0xbe66('0x3'));var moment=require(_0xbe66('0x4'));var BPromise=require(_0xbe66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe66('0x6'));var rimraf=require('rimraf');var config=require(_0xbe66('0x7'));var attributes=require(_0xbe66('0x8'));module[_0xbe66('0x9')]=function(_0x3bb56c,_0x59f820){return _0x3bb56c[_0xbe66('0xa')]('SquareMessage',attributes,{'tableName':_0xbe66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index fd3f7b4..f41b421 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 _0x28b3=['../../mysqldb','../../config/logger','jayson/promise','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareMessage,\x20%s,\x20%s','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','util','moment','ioredis'];(function(_0x51590a,_0x50087f){var _0x1af5d4=function(_0xf4498f){while(--_0xf4498f){_0x51590a['push'](_0x51590a['shift']());}};_0x1af5d4(++_0x50087f);}(_0x28b3,0x98));var _0x328b=function(_0x5d87c0,_0xd6c910){_0x5d87c0=_0x5d87c0-0x0;var _0xbd529e=_0x28b3[_0x5d87c0];return _0xbd529e;};'use strict';var _=require(_0x328b('0x0'));var util=require(_0x328b('0x1'));var moment=require(_0x328b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x328b('0x3'));var db=require(_0x328b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x328b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x328b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d4ce7,_0x4da3f1,_0x51f306){return new BPromise(function(_0x52af2a,_0x346106){return client[_0x328b('0x7')](_0x1d4ce7,_0x51f306)[_0x328b('0x8')](function(_0xf5e6f9){logger[_0x328b('0x9')]('SquareMessage,\x20%s,\x20%s',_0x4da3f1,_0x328b('0xa'));logger[_0x328b('0xb')](_0x328b('0xc'),_0x4da3f1,_0x328b('0xa'),JSON['stringify'](_0xf5e6f9));if(_0xf5e6f9[_0x328b('0xd')]){if(_0xf5e6f9['error'][_0x328b('0xe')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x4da3f1,_0xf5e6f9[_0x328b('0xd')][_0x328b('0xf')]);return _0x346106(_0xf5e6f9[_0x328b('0xd')][_0x328b('0xf')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x4da3f1,_0xf5e6f9[_0x328b('0xd')][_0x328b('0xf')]);return _0x52af2a(_0xf5e6f9[_0x328b('0xd')]['message']);}else{logger[_0x328b('0x9')]('SquareMessage,\x20%s,\x20%s',_0x4da3f1,_0x328b('0xa'));_0x52af2a(_0xf5e6f9[_0x328b('0x10')]['message']);}})[_0x328b('0x11')](function(_0x37eda4){logger[_0x328b('0xd')](_0x328b('0x12'),_0x4da3f1,_0x37eda4);_0x346106(_0x37eda4);});});}exports[_0x328b('0x13')]=function(_0x1947af){var _0x2b89b3=this;return new Promise(function(_0xf91da4,_0x1b3fd6){return db[_0x328b('0x14')][_0x328b('0x15')](_0x1947af[_0x328b('0x16')],{'raw':_0x1947af[_0x328b('0x17')]?_0x1947af[_0x328b('0x17')][_0x328b('0x18')]===undefined?!![]:![]:!![]})[_0x328b('0x8')](function(_0x1636fa){logger['info'](_0x328b('0x13'),_0x1947af);logger[_0x328b('0xb')](_0x328b('0x13'),_0x1947af,JSON[_0x328b('0x19')](_0x1636fa));_0xf91da4(_0x1636fa);})[_0x328b('0x11')](function(_0x2d686c){logger['error']('CreateSquareMessage',_0x2d686c[_0x328b('0xf')],_0x1947af);_0x1b3fd6(_0x2b89b3[_0x328b('0xd')](0x1f4,_0x2d686c[_0x328b('0xf')]));});});}; \ No newline at end of file +var _0xbb47=['then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xef50fa,_0x5563cf){var _0x19bf63=function(_0x4a94ac){while(--_0x4a94ac){_0xef50fa['push'](_0xef50fa['shift']());}};_0x19bf63(++_0x5563cf);}(_0xbb47,0x9b));var _0x7bb4=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xbb47[_0x49c057];return _0xd8f0e6;};'use strict';var _=require(_0x7bb4('0x0'));var util=require(_0x7bb4('0x1'));var moment=require(_0x7bb4('0x2'));var BPromise=require('bluebird');var rs=require(_0x7bb4('0x3'));var fs=require('fs');var Redis=require(_0x7bb4('0x4'));var db=require(_0x7bb4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bb4('0x6'))(_0x7bb4('0x7'));var config=require(_0x7bb4('0x8'));var jayson=require(_0x7bb4('0x9'));var client=jayson[_0x7bb4('0xa')][_0x7bb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1710ab,_0x11d258,_0x49429d){return new BPromise(function(_0x633900,_0xcb1156){return client[_0x7bb4('0xc')](_0x1710ab,_0x49429d)[_0x7bb4('0xd')](function(_0xfa5217){logger[_0x7bb4('0xe')](_0x7bb4('0xf'),_0x11d258,_0x7bb4('0x10'));logger[_0x7bb4('0x11')](_0x7bb4('0x12'),_0x11d258,_0x7bb4('0x10'),JSON[_0x7bb4('0x13')](_0xfa5217));if(_0xfa5217['error']){if(_0xfa5217[_0x7bb4('0x14')]['code']===0x1f4){logger['error'](_0x7bb4('0xf'),_0x11d258,_0xfa5217[_0x7bb4('0x14')]['message']);return _0xcb1156(_0xfa5217['error']['message']);}logger[_0x7bb4('0x14')](_0x7bb4('0xf'),_0x11d258,_0xfa5217[_0x7bb4('0x14')][_0x7bb4('0x15')]);return _0x633900(_0xfa5217['error'][_0x7bb4('0x15')]);}else{logger[_0x7bb4('0xe')](_0x7bb4('0xf'),_0x11d258,_0x7bb4('0x10'));_0x633900(_0xfa5217[_0x7bb4('0x16')][_0x7bb4('0x15')]);}})[_0x7bb4('0x17')](function(_0x398d9e){logger[_0x7bb4('0x14')]('SquareMessage,\x20%s,\x20%s',_0x11d258,_0x398d9e);_0xcb1156(_0x398d9e);});});}exports[_0x7bb4('0x18')]=function(_0x2627ca){var _0x2de124=this;return new Promise(function(_0x4675d1,_0x32b5c9){return db[_0x7bb4('0x19')]['create'](_0x2627ca[_0x7bb4('0x1a')],{'raw':_0x2627ca['options']?_0x2627ca[_0x7bb4('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x7bb4('0xd')](function(_0x540215){logger['info'](_0x7bb4('0x18'),_0x2627ca);logger[_0x7bb4('0x11')](_0x7bb4('0x18'),_0x2627ca,JSON[_0x7bb4('0x13')](_0x540215));_0x4675d1(_0x540215);})[_0x7bb4('0x17')](function(_0x3403d7){logger[_0x7bb4('0x14')](_0x7bb4('0x18'),_0x3403d7[_0x7bb4('0x15')],_0x2627ca);_0x32b5c9(_0x2de124['error'](0x1f4,_0x3403d7['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a442fd7..d1429d4 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 _0x18db=['fs-extra','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','15s','test','post','put','update','destroy','multer','path','connect-timeout','express','Router'];(function(_0x3d44ef,_0x18e299){var _0x57f85d=function(_0x285712){while(--_0x285712){_0x3d44ef['push'](_0x3d44ef['shift']());}};_0x57f85d(++_0x18e299);}(_0x18db,0xc3));var _0xb18d=function(_0x21384d,_0xca16){_0x21384d=_0x21384d-0x0;var _0x118772=_0x18db[_0x21384d];return _0x118772;};'use strict';var multer=require(_0xb18d('0x0'));var util=require('util');var path=require(_0xb18d('0x1'));var timeout=require(_0xb18d('0x2'));var express=require(_0xb18d('0x3'));var router=express[_0xb18d('0x4')]();var fs_extra=require(_0xb18d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb18d('0x6'));var controller=require(_0xb18d('0x7'));router[_0xb18d('0x8')]('/',auth['isAuthenticated'](),controller[_0xb18d('0x9')]);router[_0xb18d('0x8')](_0xb18d('0xa'),auth[_0xb18d('0xb')](),controller[_0xb18d('0xc')]);router[_0xb18d('0x8')](_0xb18d('0xd'),auth['isAuthenticated'](),timeout(_0xb18d('0xe')),controller[_0xb18d('0xf')]);router[_0xb18d('0x10')]('/',auth[_0xb18d('0xb')](),controller['create']);router[_0xb18d('0x11')](_0xb18d('0xa'),auth['isAuthenticated'](),controller[_0xb18d('0x12')]);router['delete'](_0xb18d('0xa'),auth[_0xb18d('0xb')](),controller[_0xb18d('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf92d=['/:id','isAuthenticated','show','/:id/test','15s','test','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x283962,_0x4194a9){var _0x5d4a53=function(_0x529c9b){while(--_0x529c9b){_0x283962['push'](_0x283962['shift']());}};_0x5d4a53(++_0x4194a9);}(_0xf92d,0xfe));var _0xdf92=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf92d[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xdf92('0x0'));var util=require(_0xdf92('0x1'));var path=require('path');var timeout=require(_0xdf92('0x2'));var express=require('express');var router=express[_0xdf92('0x3')]();var fs_extra=require(_0xdf92('0x4'));var auth=require(_0xdf92('0x5'));var interaction=require(_0xdf92('0x6'));var config=require(_0xdf92('0x7'));var controller=require('./squareOdbc.controller');router[_0xdf92('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf92('0x9')]);router[_0xdf92('0x8')](_0xdf92('0xa'),auth[_0xdf92('0xb')](),controller[_0xdf92('0xc')]);router[_0xdf92('0x8')](_0xdf92('0xd'),auth['isAuthenticated'](),timeout(_0xdf92('0xe')),controller[_0xdf92('0xf')]);router[_0xdf92('0x10')]('/',auth['isAuthenticated'](),controller[_0xdf92('0x11')]);router['put'](_0xdf92('0xa'),auth['isAuthenticated'](),controller[_0xdf92('0x12')]);router[_0xdf92('0x13')](_0xdf92('0xa'),auth[_0xdf92('0xb')](),controller[_0xdf92('0x14')]);module[_0xdf92('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 4261b09..429b832 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 _0xa8bb=['STRING','name','sequelize','exports'];(function(_0x423c77,_0x468893){var _0x709302=function(_0x5972fc){while(--_0x5972fc){_0x423c77['push'](_0x423c77['shift']());}};_0x709302(++_0x468893);}(_0xa8bb,0x116));var _0xba8b=function(_0x1bc95b,_0x537850){_0x1bc95b=_0x1bc95b-0x0;var _0x59555b=_0xa8bb[_0x1bc95b];return _0x59555b;};'use strict';var Sequelize=require(_0xba8b('0x0'));module[_0xba8b('0x1')]={'name':{'type':Sequelize[_0xba8b('0x2')],'unique':_0xba8b('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xba8b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3d90=['STRING','name','sequelize','exports'];(function(_0x4b6f5c,_0x56f7ce){var _0x55548b=function(_0x125619){while(--_0x125619){_0x4b6f5c['push'](_0x4b6f5c['shift']());}};_0x55548b(++_0x56f7ce);}(_0x3d90,0x72));var _0x03d9=function(_0x3797b6,_0x5f23ce){_0x3797b6=_0x3797b6-0x0;var _0x3a54c7=_0x3d90[_0x3797b6];return _0x3a54c7;};'use strict';var Sequelize=require(_0x03d9('0x0'));module[_0x03d9('0x1')]={'name':{'type':Sequelize[_0x03d9('0x2')],'unique':_0x03d9('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x03d9('0x2')]},'description':{'type':Sequelize[_0x03d9('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 85c8ad4..a4039a9 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 _0xd0fa=['stack','name','send','map','SquareOdbc','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','findAll','rows','catch','show','params','length','includeAll','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','test','odbc','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','get','ODBC','UserProfileResource','error'];(function(_0x5d77f0,_0x2f7aec){var _0x36cbc1=function(_0x4dfdef){while(--_0x4dfdef){_0x5d77f0['push'](_0x5d77f0['shift']());}};_0x36cbc1(++_0x2f7aec);}(_0xd0fa,0x196));var _0xad0f=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xd0fa[_0x82129b];return _0x2ae5dc;};'use strict';var emlformat=require(_0xad0f('0x0'));var rimraf=require(_0xad0f('0x1'));var zipdir=require(_0xad0f('0x2'));var jsonpatch=require(_0xad0f('0x3'));var rp=require(_0xad0f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad0f('0x5'));var util=require(_0xad0f('0x6'));var path=require(_0xad0f('0x7'));var sox=require(_0xad0f('0x8'));var csv=require(_0xad0f('0x9'));var ejs=require(_0xad0f('0xa'));var fs=require('fs');var fs_extra=require(_0xad0f('0xb'));var _=require(_0xad0f('0xc'));var squel=require(_0xad0f('0xd'));var crypto=require(_0xad0f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad0f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad0f('0x10'));var Redis=require(_0xad0f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xad0f('0x12'));var as=require(_0xad0f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad0f('0x14'))(_0xad0f('0x15'));var utils=require(_0xad0f('0x16'));var config=require(_0xad0f('0x17'));var licenseUtil=require(_0xad0f('0x18'));var db=require(_0xad0f('0x19'))['db'];function respondWithStatusCode(_0x2173c1,_0xc217ea){_0xc217ea=_0xc217ea||0xcc;return function(_0x1d8e8f){if(_0x1d8e8f){return _0x2173c1[_0xad0f('0x1a')](_0xc217ea);}return _0x2173c1[_0xad0f('0x1b')](_0xc217ea)[_0xad0f('0x1c')]();};}function respondWithResult(_0x1bdadd,_0xad3546){_0xad3546=_0xad3546||0xc8;return function(_0x32ad18){if(_0x32ad18){return _0x1bdadd[_0xad0f('0x1b')](_0xad3546)['json'](_0x32ad18);}};}function respondWithFilteredResult(_0x478e9f,_0x3610b2){return function(_0xe8e1ea){if(_0xe8e1ea){var _0x4f5bea=typeof _0x3610b2[_0xad0f('0x1d')]===_0xad0f('0x1e')&&typeof _0x3610b2[_0xad0f('0x1f')]==='undefined';var _0x1a6815=_0xe8e1ea[_0xad0f('0x20')];var _0x860b11=_0x4f5bea?0x0:_0x3610b2[_0xad0f('0x1d')];var _0x320acb=_0x4f5bea?_0xe8e1ea[_0xad0f('0x20')]:_0x3610b2[_0xad0f('0x1d')]+_0x3610b2[_0xad0f('0x1f')];var _0x3b183c;if(_0x320acb>=_0x1a6815){_0x320acb=_0x1a6815;_0x3b183c=0xc8;}else{_0x3b183c=0xce;}_0x478e9f[_0xad0f('0x1b')](_0x3b183c);return _0x478e9f[_0xad0f('0x21')](_0xad0f('0x22'),_0x860b11+'-'+_0x320acb+'/'+_0x1a6815)[_0xad0f('0x23')](_0xe8e1ea);}return null;};}function patchUpdates(_0x4d05a6){return function(_0x139496){try{jsonpatch['apply'](_0x139496,_0x4d05a6,!![]);}catch(_0x4ab146){return BPromise['reject'](_0x4ab146);}return _0x139496[_0xad0f('0x24')]();};}function saveUpdates(_0x5490b8,_0x578b33){return function(_0x20c3d2){if(_0x20c3d2){return _0x20c3d2[_0xad0f('0x25')](_0x5490b8)[_0xad0f('0x26')](function(_0xc6fa39){return _0xc6fa39;});}return null;};}function removeEntity(_0x152e52,_0x6f6b4c){return function(_0x2cc181){if(_0x2cc181){return _0x2cc181[_0xad0f('0x27')]()['then'](function(){var _0x2e0ecd=_0x2cc181[_0xad0f('0x28')]({'plain':!![]});var _0x58f5c5=_0xad0f('0x29');return db[_0xad0f('0x2a')]['destroy']({'where':{'type':_0x58f5c5,'resourceId':_0x2e0ecd['id']}})[_0xad0f('0x26')](function(){return _0x2cc181;});})['then'](function(){_0x152e52[_0xad0f('0x1b')](0xcc)[_0xad0f('0x1c')]();});}};}function handleEntityNotFound(_0x457ea8,_0xff399a){return function(_0x378e2b){if(!_0x378e2b){_0x457ea8['sendStatus'](0x194);}return _0x378e2b;};}function handleError(_0x5c786e,_0x2d8df9){_0x2d8df9=_0x2d8df9||0x1f4;return function(_0x371c74){logger[_0xad0f('0x2b')](_0x371c74[_0xad0f('0x2c')]);if(_0x371c74[_0xad0f('0x2d')]){delete _0x371c74['name'];}_0x5c786e[_0xad0f('0x1b')](_0x2d8df9)[_0xad0f('0x2e')](_0x371c74);};}exports['index']=function(_0x5382c8,_0x400da0){var _0x573a6e={},_0x4cacdb={},_0xf6acc={'count':0x0,'rows':[]};var _0x335d81=_[_0xad0f('0x2f')](db[_0xad0f('0x30')][_0xad0f('0x31')],function(_0xb26bfb){return{'name':_0xb26bfb[_0xad0f('0x32')],'type':_0xb26bfb['type'][_0xad0f('0x33')]};});_0x4cacdb[_0xad0f('0x34')]=_[_0xad0f('0x2f')](_0x335d81,_0xad0f('0x2d'));_0x4cacdb['query']=_[_0xad0f('0x35')](_0x5382c8[_0xad0f('0x36')]);_0x4cacdb[_0xad0f('0x37')]=_[_0xad0f('0x38')](_0x4cacdb['model'],_0x4cacdb[_0xad0f('0x36')]);_0x573a6e[_0xad0f('0x39')]=_[_0xad0f('0x38')](_0x4cacdb['model'],qs['fields'](_0x5382c8['query'][_0xad0f('0x3a')]));_0x573a6e[_0xad0f('0x39')]=_0x573a6e[_0xad0f('0x39')]['length']?_0x573a6e['attributes']:_0x4cacdb[_0xad0f('0x34')];if(!_0x5382c8[_0xad0f('0x36')][_0xad0f('0x3b')](_0xad0f('0x3c'))){_0x573a6e['limit']=qs[_0xad0f('0x1f')](_0x5382c8[_0xad0f('0x36')]['limit']);_0x573a6e[_0xad0f('0x1d')]=qs[_0xad0f('0x1d')](_0x5382c8[_0xad0f('0x36')][_0xad0f('0x1d')]);}_0x573a6e[_0xad0f('0x3d')]=qs[_0xad0f('0x3e')](_0x5382c8[_0xad0f('0x36')]['sort']);_0x573a6e[_0xad0f('0x3f')]=qs['filters'](_[_0xad0f('0x40')](_0x5382c8[_0xad0f('0x36')],_0x4cacdb['filters']),_0x335d81);if(_0x5382c8[_0xad0f('0x36')]['filter']){_0x573a6e[_0xad0f('0x3f')]=_[_0xad0f('0x41')](_0x573a6e[_0xad0f('0x3f')],{'$or':_[_0xad0f('0x2f')](_0x335d81,function(_0x424932){if(_0x424932[_0xad0f('0x42')]!==_0xad0f('0x43')){var _0x493c4c={};_0x493c4c[_0x424932[_0xad0f('0x2d')]]={'$like':'%'+_0x5382c8['query'][_0xad0f('0x44')]+'%'};return _0x493c4c;}})});}_0x573a6e=_[_0xad0f('0x41')]({},_0x573a6e,_0x5382c8[_0xad0f('0x45')]);var _0x1b77de={'where':_0x573a6e['where']};return db[_0xad0f('0x30')][_0xad0f('0x20')](_0x1b77de)['then'](function(_0x4053e2){_0xf6acc[_0xad0f('0x20')]=_0x4053e2;if(_0x5382c8[_0xad0f('0x36')]['includeAll']){_0x573a6e['include']=[{'all':!![]}];}return db[_0xad0f('0x30')][_0xad0f('0x46')](_0x573a6e);})[_0xad0f('0x26')](function(_0x1d88c7){_0xf6acc[_0xad0f('0x47')]=_0x1d88c7;return _0xf6acc;})[_0xad0f('0x26')](respondWithFilteredResult(_0x400da0,_0x573a6e))[_0xad0f('0x48')](handleError(_0x400da0,null));};exports[_0xad0f('0x49')]=function(_0x3a50ec,_0x34a465){var _0x361741={'raw':!![],'where':{'id':_0x3a50ec[_0xad0f('0x4a')]['id']}},_0x59b1d0={};_0x59b1d0[_0xad0f('0x34')]=_[_0xad0f('0x35')](db['SquareOdbc'][_0xad0f('0x31')]);_0x59b1d0['query']=_[_0xad0f('0x35')](_0x3a50ec[_0xad0f('0x36')]);_0x59b1d0[_0xad0f('0x37')]=_[_0xad0f('0x38')](_0x59b1d0[_0xad0f('0x34')],_0x59b1d0[_0xad0f('0x36')]);_0x361741[_0xad0f('0x39')]=_[_0xad0f('0x38')](_0x59b1d0[_0xad0f('0x34')],qs[_0xad0f('0x3a')](_0x3a50ec[_0xad0f('0x36')][_0xad0f('0x3a')]));_0x361741[_0xad0f('0x39')]=_0x361741[_0xad0f('0x39')][_0xad0f('0x4b')]?_0x361741['attributes']:_0x59b1d0[_0xad0f('0x34')];if(_0x3a50ec[_0xad0f('0x36')][_0xad0f('0x4c')]){_0x361741[_0xad0f('0x4d')]=[{'all':!![]}];}_0x361741=_['merge']({},_0x361741,_0x3a50ec[_0xad0f('0x45')]);return db[_0xad0f('0x30')]['find'](_0x361741)[_0xad0f('0x26')](handleEntityNotFound(_0x34a465,null))[_0xad0f('0x26')](respondWithResult(_0x34a465,null))[_0xad0f('0x48')](handleError(_0x34a465,null));};exports['create']=function(_0x575cfc,_0x3f74e6){return db[_0xad0f('0x30')]['create'](_0x575cfc[_0xad0f('0x4e')],{})[_0xad0f('0x26')](function(_0x107ff2){var _0x1237b0=_0x575cfc[_0xad0f('0x4f')][_0xad0f('0x28')]({'plain':!![]});if(!_0x1237b0)throw new Error(_0xad0f('0x50'));if(_0x1237b0[_0xad0f('0x51')]===_0xad0f('0x4f')){var _0x1de325=_0x107ff2[_0xad0f('0x28')]({'plain':!![]});var _0x3d77b0=_0xad0f('0x29');return db[_0xad0f('0x52')]['find']({'where':{'name':_0x3d77b0,'userProfileId':_0x1237b0['userProfileId']},'raw':!![]})[_0xad0f('0x26')](function(_0x16087c){if(_0x16087c&&_0x16087c['autoAssociation']===0x0){return db[_0xad0f('0x2a')][_0xad0f('0x53')]({'name':_0x1de325[_0xad0f('0x2d')],'resourceId':_0x1de325['id'],'type':_0x16087c[_0xad0f('0x2d')],'sectionId':_0x16087c['id']},{})[_0xad0f('0x26')](function(){return _0x107ff2;});}else{return _0x107ff2;}})['catch'](function(_0x14f76a){logger[_0xad0f('0x2b')](_0xad0f('0x54'),_0x14f76a);throw _0x14f76a;});}return _0x107ff2;})[_0xad0f('0x26')](respondWithResult(_0x3f74e6,0xc9))['catch'](handleError(_0x3f74e6,null));};exports[_0xad0f('0x25')]=function(_0x7cecc3,_0x1dcd00){if(_0x7cecc3[_0xad0f('0x4e')]['id']){delete _0x7cecc3[_0xad0f('0x4e')]['id'];}return db[_0xad0f('0x30')][_0xad0f('0x55')]({'where':{'id':_0x7cecc3['params']['id']}})['then'](handleEntityNotFound(_0x1dcd00,null))[_0xad0f('0x26')](saveUpdates(_0x7cecc3[_0xad0f('0x4e')],null))['then'](respondWithResult(_0x1dcd00,null))[_0xad0f('0x48')](handleError(_0x1dcd00,null));};exports[_0xad0f('0x27')]=function(_0x463755,_0x4513e5){return db['SquareOdbc'][_0xad0f('0x55')]({'where':{'id':_0x463755[_0xad0f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4513e5,null))[_0xad0f('0x26')](removeEntity(_0x4513e5,null))[_0xad0f('0x48')](handleError(_0x4513e5,null));};exports[_0xad0f('0x56')]=function(_0x3194cc,_0x141322,_0x17507d){var _0x200551;return db[_0xad0f('0x30')][_0xad0f('0x55')]({'where':{'id':_0x3194cc['params']['id']},'attributes':['id','dsn']})[_0xad0f('0x26')](handleEntityNotFound(_0x141322,null))['then'](function(_0x2e89c1){if(_0x2e89c1){var _0x2be64b=require(_0xad0f('0x57'))();_0x2be64b['openSync'](_0x2e89c1[_0xad0f('0x58')]);_0x2be64b[_0xad0f('0x59')]();return _0x2e89c1;}})[_0xad0f('0x26')](respondWithResult(_0x141322,null))[_0xad0f('0x48')](handleError(_0x141322,null));}; \ No newline at end of file +var _0x505d=['filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','openSync','dsn','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL'];(function(_0x398ef7,_0xdbaf9e){var _0x5a1ea6=function(_0x371abd){while(--_0x371abd){_0x398ef7['push'](_0x398ef7['shift']());}};_0x5a1ea6(++_0xdbaf9e);}(_0x505d,0x167));var _0xd505=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x505d[_0x511bd1];return _0x4c48ec;};'use strict';var emlformat=require(_0xd505('0x0'));var rimraf=require(_0xd505('0x1'));var zipdir=require(_0xd505('0x2'));var jsonpatch=require(_0xd505('0x3'));var rp=require('request-promise');var moment=require(_0xd505('0x4'));var BPromise=require(_0xd505('0x5'));var Mustache=require(_0xd505('0x6'));var util=require(_0xd505('0x7'));var path=require(_0xd505('0x8'));var sox=require(_0xd505('0x9'));var csv=require(_0xd505('0xa'));var ejs=require(_0xd505('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd505('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd505('0xa'));var querystring=require(_0xd505('0xd'));var Papa=require(_0xd505('0xe'));var Redis=require(_0xd505('0xf'));var authService=require(_0xd505('0x10'));var qs=require(_0xd505('0x11'));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(_0xd505('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd505('0x13'))['db'];function respondWithStatusCode(_0x52f3d6,_0x32f527){_0x32f527=_0x32f527||0xcc;return function(_0xc143c2){if(_0xc143c2){return _0x52f3d6[_0xd505('0x14')](_0x32f527);}return _0x52f3d6[_0xd505('0x15')](_0x32f527)[_0xd505('0x16')]();};}function respondWithResult(_0x41ecfb,_0x21a0f6){_0x21a0f6=_0x21a0f6||0xc8;return function(_0xbd3132){if(_0xbd3132){return _0x41ecfb[_0xd505('0x15')](_0x21a0f6)['json'](_0xbd3132);}};}function respondWithFilteredResult(_0x3103e6,_0x26da62){return function(_0x12e611){if(_0x12e611){var _0x5692be=typeof _0x26da62[_0xd505('0x17')]===_0xd505('0x18')&&typeof _0x26da62[_0xd505('0x19')]==='undefined';var _0x44a5b9=_0x12e611[_0xd505('0x1a')];var _0x4c9783=_0x5692be?0x0:_0x26da62[_0xd505('0x17')];var _0x5d21b2=_0x5692be?_0x12e611['count']:_0x26da62[_0xd505('0x17')]+_0x26da62[_0xd505('0x19')];var _0x476b91;if(_0x5d21b2>=_0x44a5b9){_0x5d21b2=_0x44a5b9;_0x476b91=0xc8;}else{_0x476b91=0xce;}_0x3103e6[_0xd505('0x15')](_0x476b91);return _0x3103e6[_0xd505('0x1b')](_0xd505('0x1c'),_0x4c9783+'-'+_0x5d21b2+'/'+_0x44a5b9)[_0xd505('0x1d')](_0x12e611);}return null;};}function patchUpdates(_0x49e9d7){return function(_0x4c0ad7){try{jsonpatch[_0xd505('0x1e')](_0x4c0ad7,_0x49e9d7,!![]);}catch(_0x539be4){return BPromise[_0xd505('0x1f')](_0x539be4);}return _0x4c0ad7[_0xd505('0x20')]();};}function saveUpdates(_0x15461c,_0x222a9c){return function(_0x442a4b){if(_0x442a4b){return _0x442a4b[_0xd505('0x21')](_0x15461c)[_0xd505('0x22')](function(_0x2c7300){return _0x2c7300;});}return null;};}function removeEntity(_0x4cfb87,_0x58e59c){return function(_0x151c4e){if(_0x151c4e){return _0x151c4e[_0xd505('0x23')]()[_0xd505('0x22')](function(){var _0x3e0a5e=_0x151c4e[_0xd505('0x24')]({'plain':!![]});var _0x1634f3=_0xd505('0x25');return db[_0xd505('0x26')]['destroy']({'where':{'type':_0x1634f3,'resourceId':_0x3e0a5e['id']}})['then'](function(){return _0x151c4e;});})[_0xd505('0x22')](function(){_0x4cfb87[_0xd505('0x15')](0xcc)[_0xd505('0x16')]();});}};}function handleEntityNotFound(_0x1e1ea3,_0x1223e5){return function(_0x5834f9){if(!_0x5834f9){_0x1e1ea3[_0xd505('0x14')](0x194);}return _0x5834f9;};}function handleError(_0x5adc11,_0x2fbecd){_0x2fbecd=_0x2fbecd||0x1f4;return function(_0xa7c7ac){logger[_0xd505('0x27')](_0xa7c7ac[_0xd505('0x28')]);if(_0xa7c7ac[_0xd505('0x29')]){delete _0xa7c7ac['name'];}_0x5adc11[_0xd505('0x15')](_0x2fbecd)[_0xd505('0x2a')](_0xa7c7ac);};}exports[_0xd505('0x2b')]=function(_0x4e832f,_0x5371b8){var _0xbd5f82={},_0x4157aa={},_0x2f4a5a={'count':0x0,'rows':[]};var _0x243532=_[_0xd505('0x2c')](db[_0xd505('0x2d')][_0xd505('0x2e')],function(_0x3f908d){return{'name':_0x3f908d['fieldName'],'type':_0x3f908d[_0xd505('0x2f')]['key']};});_0x4157aa[_0xd505('0x30')]=_[_0xd505('0x2c')](_0x243532,_0xd505('0x29'));_0x4157aa[_0xd505('0x31')]=_['keys'](_0x4e832f['query']);_0x4157aa[_0xd505('0x32')]=_[_0xd505('0x33')](_0x4157aa['model'],_0x4157aa[_0xd505('0x31')]);_0xbd5f82[_0xd505('0x34')]=_[_0xd505('0x33')](_0x4157aa[_0xd505('0x30')],qs[_0xd505('0x35')](_0x4e832f[_0xd505('0x31')]['fields']));_0xbd5f82[_0xd505('0x34')]=_0xbd5f82[_0xd505('0x34')][_0xd505('0x36')]?_0xbd5f82[_0xd505('0x34')]:_0x4157aa['model'];if(!_0x4e832f[_0xd505('0x31')][_0xd505('0x37')]('nolimit')){_0xbd5f82[_0xd505('0x19')]=qs[_0xd505('0x19')](_0x4e832f['query'][_0xd505('0x19')]);_0xbd5f82[_0xd505('0x17')]=qs[_0xd505('0x17')](_0x4e832f[_0xd505('0x31')][_0xd505('0x17')]);}_0xbd5f82[_0xd505('0x38')]=qs[_0xd505('0x39')](_0x4e832f['query']['sort']);_0xbd5f82['where']=qs['filters'](_[_0xd505('0x3a')](_0x4e832f[_0xd505('0x31')],_0x4157aa[_0xd505('0x32')]),_0x243532);if(_0x4e832f['query']['filter']){_0xbd5f82[_0xd505('0x3b')]=_['merge'](_0xbd5f82[_0xd505('0x3b')],{'$or':_[_0xd505('0x2c')](_0x243532,function(_0x32a6e9){if(_0x32a6e9['type']!==_0xd505('0x3c')){var _0x2a766f={};_0x2a766f[_0x32a6e9[_0xd505('0x29')]]={'$like':'%'+_0x4e832f[_0xd505('0x31')][_0xd505('0x3d')]+'%'};return _0x2a766f;}})});}_0xbd5f82=_[_0xd505('0x3e')]({},_0xbd5f82,_0x4e832f[_0xd505('0x3f')]);var _0x1a7aea={'where':_0xbd5f82[_0xd505('0x3b')]};return db[_0xd505('0x2d')][_0xd505('0x1a')](_0x1a7aea)[_0xd505('0x22')](function(_0x2e8a50){_0x2f4a5a[_0xd505('0x1a')]=_0x2e8a50;if(_0x4e832f[_0xd505('0x31')][_0xd505('0x40')]){_0xbd5f82[_0xd505('0x41')]=[{'all':!![]}];}return db[_0xd505('0x2d')][_0xd505('0x42')](_0xbd5f82);})[_0xd505('0x22')](function(_0x3a2eb0){_0x2f4a5a[_0xd505('0x43')]=_0x3a2eb0;return _0x2f4a5a;})[_0xd505('0x22')](respondWithFilteredResult(_0x5371b8,_0xbd5f82))[_0xd505('0x44')](handleError(_0x5371b8,null));};exports[_0xd505('0x45')]=function(_0x5dc54c,_0x5d3a42){var _0x5d5cd3={'raw':!![],'where':{'id':_0x5dc54c[_0xd505('0x46')]['id']}},_0x46322e={};_0x46322e[_0xd505('0x30')]=_[_0xd505('0x47')](db[_0xd505('0x2d')]['rawAttributes']);_0x46322e[_0xd505('0x31')]=_['keys'](_0x5dc54c[_0xd505('0x31')]);_0x46322e[_0xd505('0x32')]=_[_0xd505('0x33')](_0x46322e[_0xd505('0x30')],_0x46322e[_0xd505('0x31')]);_0x5d5cd3[_0xd505('0x34')]=_['intersection'](_0x46322e[_0xd505('0x30')],qs['fields'](_0x5dc54c[_0xd505('0x31')]['fields']));_0x5d5cd3[_0xd505('0x34')]=_0x5d5cd3[_0xd505('0x34')][_0xd505('0x36')]?_0x5d5cd3[_0xd505('0x34')]:_0x46322e[_0xd505('0x30')];if(_0x5dc54c[_0xd505('0x31')][_0xd505('0x40')]){_0x5d5cd3[_0xd505('0x41')]=[{'all':!![]}];}_0x5d5cd3=_['merge']({},_0x5d5cd3,_0x5dc54c['options']);return db[_0xd505('0x2d')][_0xd505('0x48')](_0x5d5cd3)[_0xd505('0x22')](handleEntityNotFound(_0x5d3a42,null))[_0xd505('0x22')](respondWithResult(_0x5d3a42,null))[_0xd505('0x44')](handleError(_0x5d3a42,null));};exports[_0xd505('0x49')]=function(_0x1df295,_0x42336d){return db[_0xd505('0x2d')][_0xd505('0x49')](_0x1df295[_0xd505('0x4a')],{})[_0xd505('0x22')](function(_0x5f1a82){var _0x57b711=_0x1df295[_0xd505('0x4b')]['get']({'plain':!![]});if(!_0x57b711)throw new Error(_0xd505('0x4c'));if(_0x57b711[_0xd505('0x4d')]===_0xd505('0x4b')){var _0x2b5445=_0x5f1a82[_0xd505('0x24')]({'plain':!![]});var _0x112e83=_0xd505('0x25');return db['UserProfileSection'][_0xd505('0x48')]({'where':{'name':_0x112e83,'userProfileId':_0x57b711[_0xd505('0x4e')]},'raw':!![]})[_0xd505('0x22')](function(_0x35ee56){if(_0x35ee56&&_0x35ee56[_0xd505('0x4f')]===0x0){return db[_0xd505('0x26')][_0xd505('0x49')]({'name':_0x2b5445[_0xd505('0x29')],'resourceId':_0x2b5445['id'],'type':_0x35ee56[_0xd505('0x29')],'sectionId':_0x35ee56['id']},{})[_0xd505('0x22')](function(){return _0x5f1a82;});}else{return _0x5f1a82;}})[_0xd505('0x44')](function(_0x3dc48b){logger['error'](_0xd505('0x50'),_0x3dc48b);throw _0x3dc48b;});}return _0x5f1a82;})['then'](respondWithResult(_0x42336d,0xc9))['catch'](handleError(_0x42336d,null));};exports[_0xd505('0x21')]=function(_0xa00c7a,_0x6c7a85){if(_0xa00c7a[_0xd505('0x4a')]['id']){delete _0xa00c7a[_0xd505('0x4a')]['id'];}return db['SquareOdbc'][_0xd505('0x48')]({'where':{'id':_0xa00c7a[_0xd505('0x46')]['id']}})[_0xd505('0x22')](handleEntityNotFound(_0x6c7a85,null))[_0xd505('0x22')](saveUpdates(_0xa00c7a[_0xd505('0x4a')],null))[_0xd505('0x22')](respondWithResult(_0x6c7a85,null))[_0xd505('0x44')](handleError(_0x6c7a85,null));};exports['destroy']=function(_0x4ecd2e,_0x5cbb7a){return db[_0xd505('0x2d')][_0xd505('0x48')]({'where':{'id':_0x4ecd2e[_0xd505('0x46')]['id']}})[_0xd505('0x22')](handleEntityNotFound(_0x5cbb7a,null))[_0xd505('0x22')](removeEntity(_0x5cbb7a,null))[_0xd505('0x44')](handleError(_0x5cbb7a,null));};exports[_0xd505('0x51')]=function(_0x66c824,_0x448480,_0x491a46){var _0x331270;return db[_0xd505('0x2d')][_0xd505('0x48')]({'where':{'id':_0x66c824[_0xd505('0x46')]['id']},'attributes':['id','dsn']})[_0xd505('0x22')](handleEntityNotFound(_0x448480,null))['then'](function(_0x48ff86){if(_0x48ff86){var _0x539bb1=require('odbc')();_0x539bb1[_0xd505('0x52')](_0x48ff86[_0xd505('0x53')]);_0x539bb1['closeSync']();return _0x48ff86;}})['then'](respondWithResult(_0x448480,null))[_0xd505('0x44')](handleError(_0x448480,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9dc7539..82bbdb3 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 _0x7a8d=['api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x562d53,_0x50efcf){var _0x4c320a=function(_0x155331){while(--_0x155331){_0x562d53['push'](_0x562d53['shift']());}};_0x4c320a(++_0x50efcf);}(_0x7a8d,0x8d));var _0xd7a8=function(_0x3bb5bd,_0x5069c8){_0x3bb5bd=_0x3bb5bd-0x0;var _0x32b59c=_0x7a8d[_0x3bb5bd];return _0x32b59c;};'use strict';var _=require(_0xd7a8('0x0'));var util=require(_0xd7a8('0x1'));var logger=require('../../config/logger')(_0xd7a8('0x2'));var moment=require(_0xd7a8('0x3'));var BPromise=require(_0xd7a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7a8('0x5'));var rimraf=require(_0xd7a8('0x6'));var config=require(_0xd7a8('0x7'));var attributes=require(_0xd7a8('0x8'));module[_0xd7a8('0x9')]=function(_0x46c820,_0x1fa0ce){return _0x46c820[_0xd7a8('0xa')](_0xd7a8('0xb'),attributes,{'tableName':_0xd7a8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2627=['define','SquareOdbc','square_odbc','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x47008f,_0x1faf31){var _0x5d5ce4=function(_0x8408b){while(--_0x8408b){_0x47008f['push'](_0x47008f['shift']());}};_0x5d5ce4(++_0x1faf31);}(_0x2627,0xea));var _0x7262=function(_0x28e700,_0x29bde8){_0x28e700=_0x28e700-0x0;var _0x209fc0=_0x2627[_0x28e700];return _0x209fc0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7262('0x0'))(_0x7262('0x1'));var moment=require(_0x7262('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7262('0x3'));var rimraf=require(_0x7262('0x4'));var config=require(_0x7262('0x5'));var attributes=require(_0x7262('0x6'));module[_0x7262('0x7')]=function(_0x4fed4c,_0x2c85be){return _0x4fed4c[_0x7262('0x8')](_0x7262('0x9'),attributes,{'tableName':_0x7262('0xa'),'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 0b8d43d..57a15ac 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 _0x0b2f=['model','debug','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','SquareOdbc','find','where','attributes','options','include','map'];(function(_0x23844d,_0x3aaea6){var _0x4ebace=function(_0x51ce2e){while(--_0x51ce2e){_0x23844d['push'](_0x23844d['shift']());}};_0x4ebace(++_0x3aaea6);}(_0x0b2f,0x111));var _0xf0b2=function(_0x8dac3d,_0x327faf){_0x8dac3d=_0x8dac3d-0x0;var _0x155aec=_0x0b2f[_0x8dac3d];return _0x155aec;};'use strict';var _=require(_0xf0b2('0x0'));var util=require('util');var moment=require(_0xf0b2('0x1'));var BPromise=require('bluebird');var rs=require(_0xf0b2('0x2'));var fs=require('fs');var Redis=require(_0xf0b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0b2('0x4'))(_0xf0b2('0x5'));var config=require('../../config/environment');var jayson=require(_0xf0b2('0x6'));var client=jayson[_0xf0b2('0x7')][_0xf0b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x207815,_0xf15620,_0x33234f){return new BPromise(function(_0x4c718a,_0x10983e){return client[_0xf0b2('0x9')](_0x207815,_0x33234f)[_0xf0b2('0xa')](function(_0x3fa4f2){logger[_0xf0b2('0xb')]('SquareOdbc,\x20%s,\x20%s',_0xf15620,_0xf0b2('0xc'));logger['debug'](_0xf0b2('0xd'),_0xf15620,_0xf0b2('0xc'),JSON[_0xf0b2('0xe')](_0x3fa4f2));if(_0x3fa4f2['error']){if(_0x3fa4f2['error']['code']===0x1f4){logger[_0xf0b2('0xf')](_0xf0b2('0x10'),_0xf15620,_0x3fa4f2[_0xf0b2('0xf')][_0xf0b2('0x11')]);return _0x10983e(_0x3fa4f2['error'][_0xf0b2('0x11')]);}logger['error'](_0xf0b2('0x10'),_0xf15620,_0x3fa4f2[_0xf0b2('0xf')][_0xf0b2('0x11')]);return _0x4c718a(_0x3fa4f2[_0xf0b2('0xf')][_0xf0b2('0x11')]);}else{logger[_0xf0b2('0xb')](_0xf0b2('0x10'),_0xf15620,_0xf0b2('0xc'));_0x4c718a(_0x3fa4f2[_0xf0b2('0x12')][_0xf0b2('0x11')]);}})['catch'](function(_0x36549f){logger[_0xf0b2('0xf')]('SquareOdbc,\x20%s,\x20%s',_0xf15620,_0x36549f);_0x10983e(_0x36549f);});});}exports[_0xf0b2('0x13')]=function(_0x282c37){var _0x574acc=this;return new Promise(function(_0x2dcef7,_0x5ae038){return db[_0xf0b2('0x14')][_0xf0b2('0x15')]({'raw':_0x282c37['options']?_0x282c37['options']['raw']===undefined?!![]:![]:!![],'where':_0x282c37['options']?_0x282c37['options'][_0xf0b2('0x16')]||null:null,'attributes':_0x282c37['options']?_0x282c37['options'][_0xf0b2('0x17')]||null:null,'include':_0x282c37[_0xf0b2('0x18')]?_0x282c37[_0xf0b2('0x18')][_0xf0b2('0x19')]?_[_0xf0b2('0x1a')](_0x282c37[_0xf0b2('0x18')][_0xf0b2('0x19')],function(_0xf8887d){return{'model':db[_0xf8887d[_0xf0b2('0x1b')]],'as':_0xf8887d['as'],'attributes':_0xf8887d['attributes'],'include':_0xf8887d[_0xf0b2('0x19')]?_['map'](_0xf8887d['include'],function(_0x28bce2){return{'model':db[_0x28bce2[_0xf0b2('0x1b')]],'as':_0x28bce2['as'],'attributes':_0x28bce2[_0xf0b2('0x17')],'include':_0x28bce2[_0xf0b2('0x19')]?_[_0xf0b2('0x1a')](_0x28bce2[_0xf0b2('0x19')],function(_0x170f51){return{'model':db[_0x170f51['model']],'as':_0x170f51['as'],'attributes':_0x170f51[_0xf0b2('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf0b2('0xa')](function(_0x4b77d4){logger['info'](_0xf0b2('0x13'),_0x282c37);logger[_0xf0b2('0x1c')](_0xf0b2('0x13'),_0x282c37,JSON[_0xf0b2('0xe')](_0x4b77d4));_0x2dcef7(_0x4b77d4);})[_0xf0b2('0x1d')](function(_0x413f11){logger[_0xf0b2('0xf')](_0xf0b2('0x13'),_0x413f11[_0xf0b2('0x11')],_0x282c37);_0x5ae038(_0x574acc['error'](0x1f4,_0x413f11[_0xf0b2('0x11')]));});});}; \ No newline at end of file +var _0x84bb=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareOdbc','SquareOdbc','options','where','attributes','map','include','model'];(function(_0x109747,_0x1903c1){var _0x2ec262=function(_0x4bef90){while(--_0x4bef90){_0x109747['push'](_0x109747['shift']());}};_0x2ec262(++_0x1903c1);}(_0x84bb,0x137));var _0xb84b=function(_0x47dd05,_0x4aa69a){_0x47dd05=_0x47dd05-0x0;var _0x1ac7c7=_0x84bb[_0x47dd05];return _0x1ac7c7;};'use strict';var _=require(_0xb84b('0x0'));var util=require(_0xb84b('0x1'));var moment=require(_0xb84b('0x2'));var BPromise=require(_0xb84b('0x3'));var rs=require(_0xb84b('0x4'));var fs=require('fs');var Redis=require(_0xb84b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb84b('0x6'))(_0xb84b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb84b('0x8'));var client=jayson[_0xb84b('0x9')][_0xb84b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11793c,_0x53c855,_0x248a2e){return new BPromise(function(_0x1e7706,_0x785e1c){return client[_0xb84b('0xb')](_0x11793c,_0x248a2e)[_0xb84b('0xc')](function(_0x4c65d6){logger[_0xb84b('0xd')](_0xb84b('0xe'),_0x53c855,_0xb84b('0xf'));logger['debug'](_0xb84b('0x10'),_0x53c855,_0xb84b('0xf'),JSON[_0xb84b('0x11')](_0x4c65d6));if(_0x4c65d6[_0xb84b('0x12')]){if(_0x4c65d6[_0xb84b('0x12')]['code']===0x1f4){logger[_0xb84b('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x53c855,_0x4c65d6[_0xb84b('0x12')][_0xb84b('0x13')]);return _0x785e1c(_0x4c65d6[_0xb84b('0x12')][_0xb84b('0x13')]);}logger[_0xb84b('0x12')](_0xb84b('0xe'),_0x53c855,_0x4c65d6[_0xb84b('0x12')][_0xb84b('0x13')]);return _0x1e7706(_0x4c65d6['error'][_0xb84b('0x13')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x53c855,_0xb84b('0xf'));_0x1e7706(_0x4c65d6[_0xb84b('0x14')][_0xb84b('0x13')]);}})[_0xb84b('0x15')](function(_0x5b3a1f){logger[_0xb84b('0x12')](_0xb84b('0xe'),_0x53c855,_0x5b3a1f);_0x785e1c(_0x5b3a1f);});});}exports[_0xb84b('0x16')]=function(_0x266187){var _0x58b58d=this;return new Promise(function(_0x1f31a4,_0x572abf){return db[_0xb84b('0x17')]['find']({'raw':_0x266187[_0xb84b('0x18')]?_0x266187['options']['raw']===undefined?!![]:![]:!![],'where':_0x266187[_0xb84b('0x18')]?_0x266187[_0xb84b('0x18')][_0xb84b('0x19')]||null:null,'attributes':_0x266187[_0xb84b('0x18')]?_0x266187['options'][_0xb84b('0x1a')]||null:null,'include':_0x266187[_0xb84b('0x18')]?_0x266187[_0xb84b('0x18')]['include']?_[_0xb84b('0x1b')](_0x266187[_0xb84b('0x18')][_0xb84b('0x1c')],function(_0x5038e8){return{'model':db[_0x5038e8[_0xb84b('0x1d')]],'as':_0x5038e8['as'],'attributes':_0x5038e8[_0xb84b('0x1a')],'include':_0x5038e8[_0xb84b('0x1c')]?_['map'](_0x5038e8[_0xb84b('0x1c')],function(_0x10e4f8){return{'model':db[_0x10e4f8[_0xb84b('0x1d')]],'as':_0x10e4f8['as'],'attributes':_0x10e4f8[_0xb84b('0x1a')],'include':_0x10e4f8[_0xb84b('0x1c')]?_[_0xb84b('0x1b')](_0x10e4f8['include'],function(_0x56e42b){return{'model':db[_0x56e42b[_0xb84b('0x1d')]],'as':_0x56e42b['as'],'attributes':_0x56e42b[_0xb84b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb84b('0xc')](function(_0x31120a){logger[_0xb84b('0xd')](_0xb84b('0x16'),_0x266187);logger[_0xb84b('0x1e')](_0xb84b('0x16'),_0x266187,JSON[_0xb84b('0x11')](_0x31120a));_0x1f31a4(_0x31120a);})[_0xb84b('0x15')](function(_0x1aac25){logger[_0xb84b('0x12')](_0xb84b('0x16'),_0x1aac25[_0xb84b('0x13')],_0x266187);_0x572abf(_0x58b58d[_0xb84b('0x12')](0x1f4,_0x1aac25[_0xb84b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index a8b202e..dc39b25 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 _0x76d0=['create','addUsers','put','update','delete','removeUsers','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/users','getUsers','post'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x76d0,0x132));var _0x076d=function(_0x35b695,_0x487914){_0x35b695=_0x35b695-0x0;var _0x3d90f7=_0x76d0[_0x35b695];return _0x3d90f7;};'use strict';var multer=require(_0x076d('0x0'));var util=require(_0x076d('0x1'));var path=require(_0x076d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x076d('0x3')]();var fs_extra=require(_0x076d('0x4'));var auth=require(_0x076d('0x5'));var interaction=require(_0x076d('0x6'));var config=require(_0x076d('0x7'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x076d('0x8')](),controller[_0x076d('0x9')]);router[_0x076d('0xa')](_0x076d('0xb'),auth[_0x076d('0x8')](),controller[_0x076d('0xc')]);router[_0x076d('0xa')](_0x076d('0xd'),auth[_0x076d('0x8')](),controller[_0x076d('0xe')]);router[_0x076d('0xf')]('/',auth[_0x076d('0x8')](),controller[_0x076d('0x10')]);router['post'](_0x076d('0xd'),auth[_0x076d('0x8')](),controller[_0x076d('0x11')]);router[_0x076d('0x12')]('/:id',auth[_0x076d('0x8')](),controller[_0x076d('0x13')]);router[_0x076d('0x14')](_0x076d('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x076d('0x14')](_0x076d('0xd'),auth[_0x076d('0x8')](),controller[_0x076d('0x15')]);module[_0x076d('0x16')]=router; \ No newline at end of file +var _0x2884=['express','fs-extra','../../components/auth/service','./squareProject.controller','get','isAuthenticated','/:id','show','getUsers','post','/:id/users','addUsers','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1a077b,_0x55743a){var _0x11115f=function(_0x1702d5){while(--_0x1702d5){_0x1a077b['push'](_0x1a077b['shift']());}};_0x11115f(++_0x55743a);}(_0x2884,0x1eb));var _0x4288=function(_0x4e27c3,_0x4f890f){_0x4e27c3=_0x4e27c3-0x0;var _0x12d23d=_0x2884[_0x4e27c3];return _0x12d23d;};'use strict';var multer=require(_0x4288('0x0'));var util=require('util');var path=require(_0x4288('0x1'));var timeout=require(_0x4288('0x2'));var express=require(_0x4288('0x3'));var router=express['Router']();var fs_extra=require(_0x4288('0x4'));var auth=require(_0x4288('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4288('0x6'));router[_0x4288('0x7')]('/',auth[_0x4288('0x8')](),controller['index']);router['get'](_0x4288('0x9'),auth['isAuthenticated'](),controller[_0x4288('0xa')]);router[_0x4288('0x7')]('/:id/users',auth[_0x4288('0x8')](),controller[_0x4288('0xb')]);router[_0x4288('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4288('0xc')](_0x4288('0xd'),auth[_0x4288('0x8')](),controller[_0x4288('0xe')]);router[_0x4288('0xf')](_0x4288('0x9'),auth[_0x4288('0x8')](),controller['update']);router[_0x4288('0x10')](_0x4288('0x9'),auth[_0x4288('0x8')](),controller[_0x4288('0x11')]);router['delete'](_0x4288('0xd'),auth[_0x4288('0x8')](),controller['removeUsers']);module[_0x4288('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index cfd15a4..38c0723 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 _0x04f2=['STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize'];(function(_0xe19049,_0xaa2ce){var _0x1bcc1f=function(_0x4e8e2c){while(--_0x4e8e2c){_0xe19049['push'](_0xe19049['shift']());}};_0x1bcc1f(++_0xaa2ce);}(_0x04f2,0x8f));var _0x204f=function(_0x1b1417,_0x2b175d){_0x1b1417=_0x1b1417-0x0;var _0x951201=_0x04f2[_0x1b1417];return _0x951201;};'use strict';var Sequelize=require(_0x204f('0x0'));module['exports']={'name':{'type':Sequelize[_0x204f('0x1')],'unique':_0x204f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x204f('0x1')]},'notes':{'type':Sequelize[_0x204f('0x3')]},'preproduction':{'type':Sequelize[_0x204f('0x4')]('long'),'get':function(){if(this[_0x204f('0x5')](_0x204f('0x6'))){return this[_0x204f('0x5')]('preproduction')[_0x204f('0x7')](_0x204f('0x8'));}}},'production':{'type':Sequelize[_0x204f('0x4')](_0x204f('0x9')),'get':function(){if(this[_0x204f('0x5')](_0x204f('0xa'))){return this[_0x204f('0x5')]('production')[_0x204f('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x204f('0xb')]},'publishedAt':{'type':Sequelize[_0x204f('0xb')]}}; \ No newline at end of file +var _0xeb93=['DATE','sequelize','exports','name','STRING','TEXT','long','getDataValue','preproduction','toString','production'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xeb93,0x18d));var _0x3eb9=function(_0x1f3681,_0x43cf48){_0x1f3681=_0x1f3681-0x0;var _0x4911fd=_0xeb93[_0x1f3681];return _0x4911fd;};'use strict';var Sequelize=require(_0x3eb9('0x0'));module[_0x3eb9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3eb9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3eb9('0x3')]},'notes':{'type':Sequelize[_0x3eb9('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x3eb9('0x5')),'get':function(){if(this[_0x3eb9('0x6')](_0x3eb9('0x7'))){return this[_0x3eb9('0x6')]('preproduction')[_0x3eb9('0x8')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x3eb9('0x5')),'get':function(){if(this[_0x3eb9('0x6')](_0x3eb9('0x9'))){return this[_0x3eb9('0x6')]('production')[_0x3eb9('0x8')]('utf8');}}},'savedAt':{'type':Sequelize[_0x3eb9('0xa')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 2ef55c6..91703ac 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 _0xc2b9=['redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','SquareProjects','UserProfileResource','stack','name','send','index','map','SquareProject','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0xc2b9,0x172));var _0x9c2b=function(_0x5b1627,_0x55872b){_0x5b1627=_0x5b1627-0x0;var _0x57a479=_0xc2b9[_0x5b1627];return _0x57a479;};'use strict';var emlformat=require(_0x9c2b('0x0'));var rimraf=require(_0x9c2b('0x1'));var zipdir=require(_0x9c2b('0x2'));var jsonpatch=require(_0x9c2b('0x3'));var rp=require(_0x9c2b('0x4'));var moment=require(_0x9c2b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c2b('0x6'));var util=require(_0x9c2b('0x7'));var path=require(_0x9c2b('0x8'));var sox=require(_0x9c2b('0x9'));var csv=require(_0x9c2b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c2b('0xb'));var _=require('lodash');var squel=require(_0x9c2b('0xc'));var crypto=require(_0x9c2b('0xd'));var jsforce=require(_0x9c2b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c2b('0xa'));var querystring=require(_0x9c2b('0xf'));var Papa=require(_0x9c2b('0x10'));var Redis=require(_0x9c2b('0x11'));var authService=require(_0x9c2b('0x12'));var qs=require(_0x9c2b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c2b('0x14'));var logger=require(_0x9c2b('0x15'))(_0x9c2b('0x16'));var utils=require(_0x9c2b('0x17'));var config=require(_0x9c2b('0x18'));var licenseUtil=require(_0x9c2b('0x19'));var db=require('../../mysqldb')['db'];config[_0x9c2b('0x1a')]=_['defaults'](config[_0x9c2b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c2b('0x1b'))(new Redis(config[_0x9c2b('0x1a')]));require(_0x9c2b('0x1c'))[_0x9c2b('0x1d')](socket);function respondWithStatusCode(_0x12d0b4,_0x29ddd4){_0x29ddd4=_0x29ddd4||0xcc;return function(_0x5dd0f4){if(_0x5dd0f4){return _0x12d0b4[_0x9c2b('0x1e')](_0x29ddd4);}return _0x12d0b4[_0x9c2b('0x1f')](_0x29ddd4)[_0x9c2b('0x20')]();};}function respondWithResult(_0xbbf714,_0x2c2080){_0x2c2080=_0x2c2080||0xc8;return function(_0x42e321){if(_0x42e321){return _0xbbf714['status'](_0x2c2080)[_0x9c2b('0x21')](_0x42e321);}};}function respondWithFilteredResult(_0x6958ef,_0x152af5){return function(_0x7a4aef){if(_0x7a4aef){var _0x210bde=typeof _0x152af5[_0x9c2b('0x22')]===_0x9c2b('0x23')&&typeof _0x152af5['limit']==='undefined';var _0x2f850c=_0x7a4aef[_0x9c2b('0x24')];var _0x37e1ed=_0x210bde?0x0:_0x152af5['offset'];var _0x932e2c=_0x210bde?_0x7a4aef['count']:_0x152af5[_0x9c2b('0x22')]+_0x152af5[_0x9c2b('0x25')];var _0x46688c;if(_0x932e2c>=_0x2f850c){_0x932e2c=_0x2f850c;_0x46688c=0xc8;}else{_0x46688c=0xce;}_0x6958ef[_0x9c2b('0x1f')](_0x46688c);return _0x6958ef[_0x9c2b('0x26')](_0x9c2b('0x27'),_0x37e1ed+'-'+_0x932e2c+'/'+_0x2f850c)['json'](_0x7a4aef);}return null;};}function patchUpdates(_0x17acc5){return function(_0x5d7619){try{jsonpatch[_0x9c2b('0x28')](_0x5d7619,_0x17acc5,!![]);}catch(_0x4178e8){return BPromise['reject'](_0x4178e8);}return _0x5d7619[_0x9c2b('0x29')]();};}function saveUpdates(_0x322964,_0x10d89f){return function(_0x440fde){if(_0x440fde){return _0x440fde[_0x9c2b('0x2a')](_0x322964)[_0x9c2b('0x2b')](function(_0x5cf66a){return _0x5cf66a;});}return null;};}function removeEntity(_0x4ea118,_0x374562){return function(_0x69efb2){if(_0x69efb2){return _0x69efb2[_0x9c2b('0x2c')]()[_0x9c2b('0x2b')](function(){var _0x2b0120=_0x69efb2[_0x9c2b('0x2d')]({'plain':!![]});var _0x3d1d01=_0x9c2b('0x2e');return db[_0x9c2b('0x2f')][_0x9c2b('0x2c')]({'where':{'type':_0x3d1d01,'resourceId':_0x2b0120['id']}})['then'](function(){return _0x69efb2;});})[_0x9c2b('0x2b')](function(){_0x4ea118[_0x9c2b('0x1f')](0xcc)[_0x9c2b('0x20')]();});}};}function handleEntityNotFound(_0x345cb2,_0x3e5af6){return function(_0x2032b9){if(!_0x2032b9){_0x345cb2[_0x9c2b('0x1e')](0x194);}return _0x2032b9;};}function handleError(_0x131070,_0x15b5bb){_0x15b5bb=_0x15b5bb||0x1f4;return function(_0x37036c){logger['error'](_0x37036c[_0x9c2b('0x30')]);if(_0x37036c[_0x9c2b('0x31')]){delete _0x37036c['name'];}_0x131070[_0x9c2b('0x1f')](_0x15b5bb)[_0x9c2b('0x32')](_0x37036c);};}exports[_0x9c2b('0x33')]=function(_0x1cf0a8,_0x1a6598){var _0x1d1f7b={},_0x88df1f={},_0x5766b7={'count':0x0,'rows':[]};var _0x29ca6b=_[_0x9c2b('0x34')](db[_0x9c2b('0x35')][_0x9c2b('0x36')],function(_0x1ca426){return{'name':_0x1ca426['fieldName'],'type':_0x1ca426['type'][_0x9c2b('0x37')]};});_0x88df1f[_0x9c2b('0x38')]=_[_0x9c2b('0x34')](_0x29ca6b,_0x9c2b('0x31'));_0x88df1f[_0x9c2b('0x39')]=_[_0x9c2b('0x3a')](_0x1cf0a8[_0x9c2b('0x39')]);_0x88df1f[_0x9c2b('0x3b')]=_[_0x9c2b('0x3c')](_0x88df1f[_0x9c2b('0x38')],_0x88df1f['query']);_0x1d1f7b[_0x9c2b('0x3d')]=_['intersection'](_0x88df1f['model'],qs[_0x9c2b('0x3e')](_0x1cf0a8[_0x9c2b('0x39')]['fields']));_0x1d1f7b['attributes']=_0x1d1f7b[_0x9c2b('0x3d')][_0x9c2b('0x3f')]?_0x1d1f7b[_0x9c2b('0x3d')]:_0x88df1f[_0x9c2b('0x38')];if(!_0x1cf0a8[_0x9c2b('0x39')][_0x9c2b('0x40')](_0x9c2b('0x41'))){_0x1d1f7b['limit']=qs[_0x9c2b('0x25')](_0x1cf0a8['query'][_0x9c2b('0x25')]);_0x1d1f7b[_0x9c2b('0x22')]=qs['offset'](_0x1cf0a8[_0x9c2b('0x39')][_0x9c2b('0x22')]);}_0x1d1f7b['order']=qs[_0x9c2b('0x42')](_0x1cf0a8['query'][_0x9c2b('0x42')]);_0x1d1f7b[_0x9c2b('0x43')]=qs['filters'](_[_0x9c2b('0x44')](_0x1cf0a8[_0x9c2b('0x39')],_0x88df1f[_0x9c2b('0x3b')]),_0x29ca6b);if(_0x1cf0a8[_0x9c2b('0x39')][_0x9c2b('0x45')]){_0x1d1f7b[_0x9c2b('0x43')]=_['merge'](_0x1d1f7b[_0x9c2b('0x43')],{'$or':_[_0x9c2b('0x34')](_0x29ca6b,function(_0x2322af){if(_0x2322af[_0x9c2b('0x46')]!==_0x9c2b('0x47')){var _0x4fd244={};_0x4fd244[_0x2322af[_0x9c2b('0x31')]]={'$like':'%'+_0x1cf0a8[_0x9c2b('0x39')][_0x9c2b('0x45')]+'%'};return _0x4fd244;}})});}_0x1d1f7b=_[_0x9c2b('0x48')]({},_0x1d1f7b,_0x1cf0a8[_0x9c2b('0x49')]);var _0x4b4fdb={'where':_0x1d1f7b[_0x9c2b('0x43')]};return db[_0x9c2b('0x35')][_0x9c2b('0x24')](_0x4b4fdb)['then'](function(_0x7691f2){_0x5766b7[_0x9c2b('0x24')]=_0x7691f2;if(_0x1cf0a8[_0x9c2b('0x39')][_0x9c2b('0x4a')]){_0x1d1f7b['include']=[{'all':!![]}];}return db[_0x9c2b('0x35')][_0x9c2b('0x4b')](_0x1d1f7b);})[_0x9c2b('0x2b')](function(_0x139e36){_0x5766b7[_0x9c2b('0x4c')]=_0x139e36;return _0x5766b7;})[_0x9c2b('0x2b')](respondWithFilteredResult(_0x1a6598,_0x1d1f7b))[_0x9c2b('0x4d')](handleError(_0x1a6598,null));};exports['show']=function(_0x3581d5,_0x37f390){var _0x38dfa4={'raw':![],'where':{'id':_0x3581d5[_0x9c2b('0x4e')]['id']}},_0xc708df={};_0xc708df[_0x9c2b('0x38')]=_[_0x9c2b('0x3a')](db[_0x9c2b('0x35')][_0x9c2b('0x36')]);_0xc708df[_0x9c2b('0x39')]=_[_0x9c2b('0x3a')](_0x3581d5['query']);_0xc708df[_0x9c2b('0x3b')]=_[_0x9c2b('0x3c')](_0xc708df['model'],_0xc708df['query']);_0x38dfa4[_0x9c2b('0x3d')]=_[_0x9c2b('0x3c')](_0xc708df[_0x9c2b('0x38')],qs[_0x9c2b('0x3e')](_0x3581d5[_0x9c2b('0x39')][_0x9c2b('0x3e')]));_0x38dfa4[_0x9c2b('0x3d')]=_0x38dfa4['attributes'][_0x9c2b('0x3f')]?_0x38dfa4[_0x9c2b('0x3d')]:_0xc708df[_0x9c2b('0x38')];if(_0x3581d5[_0x9c2b('0x39')][_0x9c2b('0x4a')]){_0x38dfa4[_0x9c2b('0x4f')]=[{'all':!![]}];}_0x38dfa4=_[_0x9c2b('0x48')]({},_0x38dfa4,_0x3581d5[_0x9c2b('0x49')]);return db[_0x9c2b('0x35')]['find'](_0x38dfa4)[_0x9c2b('0x2b')](handleEntityNotFound(_0x37f390,null))[_0x9c2b('0x2b')](respondWithResult(_0x37f390,null))[_0x9c2b('0x4d')](handleError(_0x37f390,null));};exports[_0x9c2b('0x50')]=function(_0x38368c,_0x18dc48){return db[_0x9c2b('0x35')]['create'](_0x38368c[_0x9c2b('0x51')],{})['then'](function(_0x24bb13){var _0x110782=_0x38368c['user'][_0x9c2b('0x2d')]({'plain':!![]});if(!_0x110782)throw new Error(_0x9c2b('0x52'));if(_0x110782[_0x9c2b('0x53')]==='user'){var _0x38f1a4=_0x24bb13['get']({'plain':!![]});var _0xdf4cc0='SquareProjects';return db[_0x9c2b('0x54')][_0x9c2b('0x55')]({'where':{'name':_0xdf4cc0,'userProfileId':_0x110782[_0x9c2b('0x56')]},'raw':!![]})[_0x9c2b('0x2b')](function(_0x1c4cff){if(_0x1c4cff&&_0x1c4cff[_0x9c2b('0x57')]===0x0){return db[_0x9c2b('0x2f')]['create']({'name':_0x38f1a4[_0x9c2b('0x31')],'resourceId':_0x38f1a4['id'],'type':_0x1c4cff[_0x9c2b('0x31')],'sectionId':_0x1c4cff['id']},{})[_0x9c2b('0x2b')](function(){return _0x24bb13;});}else{return _0x24bb13;}})[_0x9c2b('0x4d')](function(_0x15ffde){logger['error'](_0x9c2b('0x58'),_0x15ffde);throw _0x15ffde;});}return _0x24bb13;})[_0x9c2b('0x2b')](respondWithResult(_0x18dc48,0xc9))['catch'](handleError(_0x18dc48,null));};exports[_0x9c2b('0x2a')]=function(_0x11d0b5,_0x49f37b){if(_0x11d0b5[_0x9c2b('0x51')]['id']){delete _0x11d0b5['body']['id'];}return db['SquareProject'][_0x9c2b('0x55')]({'where':{'id':_0x11d0b5[_0x9c2b('0x4e')]['id']}})[_0x9c2b('0x2b')](handleEntityNotFound(_0x49f37b,null))[_0x9c2b('0x2b')](saveUpdates(_0x11d0b5[_0x9c2b('0x51')],null))[_0x9c2b('0x2b')](respondWithResult(_0x49f37b,null))['catch'](handleError(_0x49f37b,null));};exports['destroy']=function(_0xae274b,_0x53a2bc){return db[_0x9c2b('0x35')][_0x9c2b('0x55')]({'where':{'id':_0xae274b['params']['id']}})[_0x9c2b('0x2b')](handleEntityNotFound(_0x53a2bc,null))[_0x9c2b('0x2b')](removeEntity(_0x53a2bc,null))['catch'](handleError(_0x53a2bc,null));};exports[_0x9c2b('0x59')]=function(_0x22dbb1,_0x5355c2,_0x1e5e98){return db[_0x9c2b('0x35')][_0x9c2b('0x55')]({'where':{'id':_0x22dbb1[_0x9c2b('0x4e')]['id']}})[_0x9c2b('0x2b')](handleEntityNotFound(_0x5355c2,null))[_0x9c2b('0x2b')](function(_0x1fad28){if(_0x1fad28){return _0x1fad28[_0x9c2b('0x59')](_0x22dbb1[_0x9c2b('0x51')][_0x9c2b('0x5a')],_['omit'](_0x22dbb1[_0x9c2b('0x51')],[_0x9c2b('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x5355c2,null))[_0x9c2b('0x4d')](handleError(_0x5355c2,null));};exports[_0x9c2b('0x5b')]=function(_0x335e6d,_0x189631,_0x12fcf1){return db['SquareProject'][_0x9c2b('0x55')]({'where':{'id':_0x335e6d[_0x9c2b('0x4e')]['id']}})[_0x9c2b('0x2b')](handleEntityNotFound(_0x189631,null))[_0x9c2b('0x2b')](function(_0x1515f7){if(_0x1515f7){return _0x1515f7[_0x9c2b('0x5b')](_0x335e6d[_0x9c2b('0x39')][_0x9c2b('0x5a')])[_0x9c2b('0x2b')](function(){if(_[_0x9c2b('0x5c')](_0x335e6d['query'][_0x9c2b('0x5a')])){for(var _0x16e1fa=0x0;_0x16e1fa<_0x335e6d[_0x9c2b('0x39')][_0x9c2b('0x5a')]['length'];_0x16e1fa+=0x1){socket[_0x9c2b('0x5d')](_0x9c2b('0x5e'),{'UserId':Number(_0x335e6d['query'][_0x9c2b('0x5a')][_0x16e1fa]),'SquareProjectId':Number(_0x335e6d[_0x9c2b('0x4e')]['id'])});}}else{socket[_0x9c2b('0x5d')](_0x9c2b('0x5e'),{'UserId':Number(_0x335e6d[_0x9c2b('0x39')][_0x9c2b('0x5a')]),'SquareProjectId':Number(_0x335e6d[_0x9c2b('0x4e')]['id'])});}});}})[_0x9c2b('0x2b')](respondWithStatusCode(_0x189631,null))[_0x9c2b('0x4d')](handleError(_0x189631,null));};exports[_0x9c2b('0x5f')]=function(_0x598e23,_0x31ec5c,_0x12fb65){var _0x5ba5bc={};var _0x93190e={};var _0x54ab7d;var _0x341f2a;return db['SquareProject'][_0x9c2b('0x60')]({'where':{'id':_0x598e23[_0x9c2b('0x4e')]['id']}})[_0x9c2b('0x2b')](handleEntityNotFound(_0x31ec5c,null))[_0x9c2b('0x2b')](function(_0x1ea990){if(_0x1ea990){_0x54ab7d=_0x1ea990;_0x93190e[_0x9c2b('0x38')]=_[_0x9c2b('0x3a')](db[_0x9c2b('0x61')]['rawAttributes']);_0x93190e[_0x9c2b('0x39')]=_[_0x9c2b('0x3a')](_0x598e23[_0x9c2b('0x39')]);_0x93190e[_0x9c2b('0x3b')]=_[_0x9c2b('0x3c')](_0x93190e['model'],_0x93190e[_0x9c2b('0x39')]);_0x5ba5bc[_0x9c2b('0x3d')]=_['intersection'](_0x93190e[_0x9c2b('0x38')],qs['fields'](_0x598e23[_0x9c2b('0x39')][_0x9c2b('0x3e')]));_0x5ba5bc[_0x9c2b('0x3d')]=_0x5ba5bc[_0x9c2b('0x3d')][_0x9c2b('0x3f')]?_0x5ba5bc['attributes']:_0x93190e['model'];_0x5ba5bc[_0x9c2b('0x62')]=qs[_0x9c2b('0x42')](_0x598e23['query'][_0x9c2b('0x42')]);_0x5ba5bc[_0x9c2b('0x43')]=qs['filters'](_[_0x9c2b('0x44')](_0x598e23[_0x9c2b('0x39')],_0x93190e[_0x9c2b('0x3b')]));if(_0x598e23['query'][_0x9c2b('0x45')]){_0x5ba5bc[_0x9c2b('0x43')]=_[_0x9c2b('0x48')](_0x5ba5bc[_0x9c2b('0x43')],{'$or':_['map'](_0x5ba5bc[_0x9c2b('0x3d')],function(_0x5b40f8){var _0x324331={};_0x324331[_0x5b40f8]={'$like':'%'+_0x598e23[_0x9c2b('0x39')]['filter']+'%'};return _0x324331;})});}_0x5ba5bc=_[_0x9c2b('0x48')]({},_0x5ba5bc,_0x598e23[_0x9c2b('0x49')]);return _0x54ab7d['getUsers'](_0x5ba5bc);}})[_0x9c2b('0x2b')](function(_0x5944a1){if(_0x5944a1){_0x341f2a=_0x5944a1[_0x9c2b('0x3f')];if(!_0x598e23[_0x9c2b('0x39')]['hasOwnProperty'](_0x9c2b('0x41'))){_0x5ba5bc[_0x9c2b('0x25')]=qs[_0x9c2b('0x25')](_0x598e23['query']['limit']);_0x5ba5bc[_0x9c2b('0x22')]=qs[_0x9c2b('0x22')](_0x598e23[_0x9c2b('0x39')][_0x9c2b('0x22')]);}return _0x54ab7d['getUsers'](_0x5ba5bc);}})[_0x9c2b('0x2b')](function(_0x7cce71){if(_0x7cce71){return _0x7cce71?{'count':_0x341f2a,'rows':_0x7cce71}:null;}})[_0x9c2b('0x2b')](respondWithResult(_0x31ec5c,null))[_0x9c2b('0x4d')](handleError(_0x31ec5c,null));}; \ No newline at end of file +var _0x5f86=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','SquareProjects','destroy','end','error','name','send','index','map','SquareProject','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','includeAll','include','catch','show','params','options','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x5f86,0x1e0));var _0x65f8=function(_0x249154,_0x242056){_0x249154=_0x249154-0x0;var _0x26458e=_0x5f86[_0x249154];return _0x26458e;};'use strict';var emlformat=require(_0x65f8('0x0'));var rimraf=require(_0x65f8('0x1'));var zipdir=require(_0x65f8('0x2'));var jsonpatch=require(_0x65f8('0x3'));var rp=require('request-promise');var moment=require(_0x65f8('0x4'));var BPromise=require(_0x65f8('0x5'));var Mustache=require(_0x65f8('0x6'));var util=require(_0x65f8('0x7'));var path=require(_0x65f8('0x8'));var sox=require(_0x65f8('0x9'));var csv=require(_0x65f8('0xa'));var ejs=require(_0x65f8('0xb'));var fs=require('fs');var fs_extra=require(_0x65f8('0xc'));var _=require(_0x65f8('0xd'));var squel=require(_0x65f8('0xe'));var crypto=require(_0x65f8('0xf'));var jsforce=require(_0x65f8('0x10'));var deskjs=require(_0x65f8('0x11'));var toCsv=require(_0x65f8('0xa'));var querystring=require('querystring');var Papa=require(_0x65f8('0x12'));var Redis=require(_0x65f8('0x13'));var authService=require(_0x65f8('0x14'));var qs=require(_0x65f8('0x15'));var as=require(_0x65f8('0x16'));var hardwareService=require(_0x65f8('0x17'));var logger=require(_0x65f8('0x18'))(_0x65f8('0x19'));var utils=require(_0x65f8('0x1a'));var config=require(_0x65f8('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x65f8('0x1c'))['db'];config[_0x65f8('0x1d')]=_['defaults'](config[_0x65f8('0x1d')],{'host':_0x65f8('0x1e'),'port':0x18eb});var socket=require(_0x65f8('0x1f'))(new Redis(config[_0x65f8('0x1d')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x29be56,_0x64b5ee){_0x64b5ee=_0x64b5ee||0xcc;return function(_0x1de77b){if(_0x1de77b){return _0x29be56[_0x65f8('0x20')](_0x64b5ee);}return _0x29be56['status'](_0x64b5ee)['end']();};}function respondWithResult(_0x37ca6a,_0x33242d){_0x33242d=_0x33242d||0xc8;return function(_0x3657f8){if(_0x3657f8){return _0x37ca6a[_0x65f8('0x21')](_0x33242d)['json'](_0x3657f8);}};}function respondWithFilteredResult(_0xd94591,_0x182407){return function(_0x3b2efd){if(_0x3b2efd){var _0x9bc245=typeof _0x182407[_0x65f8('0x22')]===_0x65f8('0x23')&&typeof _0x182407[_0x65f8('0x24')]===_0x65f8('0x23');var _0x2340e2=_0x3b2efd[_0x65f8('0x25')];var _0x3baf1d=_0x9bc245?0x0:_0x182407[_0x65f8('0x22')];var _0x394f5e=_0x9bc245?_0x3b2efd['count']:_0x182407['offset']+_0x182407[_0x65f8('0x24')];var _0x10aebb;if(_0x394f5e>=_0x2340e2){_0x394f5e=_0x2340e2;_0x10aebb=0xc8;}else{_0x10aebb=0xce;}_0xd94591[_0x65f8('0x21')](_0x10aebb);return _0xd94591['set'](_0x65f8('0x26'),_0x3baf1d+'-'+_0x394f5e+'/'+_0x2340e2)[_0x65f8('0x27')](_0x3b2efd);}return null;};}function patchUpdates(_0x2c9936){return function(_0x25de48){try{jsonpatch[_0x65f8('0x28')](_0x25de48,_0x2c9936,!![]);}catch(_0x6afcef){return BPromise[_0x65f8('0x29')](_0x6afcef);}return _0x25de48[_0x65f8('0x2a')]();};}function saveUpdates(_0x1e2821,_0x244494){return function(_0x4745d5){if(_0x4745d5){return _0x4745d5[_0x65f8('0x2b')](_0x1e2821)[_0x65f8('0x2c')](function(_0x354f15){return _0x354f15;});}return null;};}function removeEntity(_0x13cb97,_0xdb5c49){return function(_0x386bc0){if(_0x386bc0){return _0x386bc0['destroy']()[_0x65f8('0x2c')](function(){var _0x479486=_0x386bc0[_0x65f8('0x2d')]({'plain':!![]});var _0x1618ba=_0x65f8('0x2e');return db['UserProfileResource'][_0x65f8('0x2f')]({'where':{'type':_0x1618ba,'resourceId':_0x479486['id']}})[_0x65f8('0x2c')](function(){return _0x386bc0;});})['then'](function(){_0x13cb97[_0x65f8('0x21')](0xcc)[_0x65f8('0x30')]();});}};}function handleEntityNotFound(_0x63c35a,_0x3c0879){return function(_0x39b101){if(!_0x39b101){_0x63c35a[_0x65f8('0x20')](0x194);}return _0x39b101;};}function handleError(_0x374311,_0x3aeecd){_0x3aeecd=_0x3aeecd||0x1f4;return function(_0x2fbcb3){logger[_0x65f8('0x31')](_0x2fbcb3['stack']);if(_0x2fbcb3[_0x65f8('0x32')]){delete _0x2fbcb3[_0x65f8('0x32')];}_0x374311[_0x65f8('0x21')](_0x3aeecd)[_0x65f8('0x33')](_0x2fbcb3);};}exports[_0x65f8('0x34')]=function(_0x561957,_0x25c544){var _0x4b0270={},_0x1c8f4a={},_0x2823f3={'count':0x0,'rows':[]};var _0x358464=_[_0x65f8('0x35')](db[_0x65f8('0x36')][_0x65f8('0x37')],function(_0x7c28f){return{'name':_0x7c28f[_0x65f8('0x38')],'type':_0x7c28f['type']['key']};});_0x1c8f4a['model']=_[_0x65f8('0x35')](_0x358464,_0x65f8('0x32'));_0x1c8f4a[_0x65f8('0x39')]=_[_0x65f8('0x3a')](_0x561957[_0x65f8('0x39')]);_0x1c8f4a[_0x65f8('0x3b')]=_[_0x65f8('0x3c')](_0x1c8f4a[_0x65f8('0x3d')],_0x1c8f4a['query']);_0x4b0270[_0x65f8('0x3e')]=_[_0x65f8('0x3c')](_0x1c8f4a[_0x65f8('0x3d')],qs[_0x65f8('0x3f')](_0x561957['query'][_0x65f8('0x3f')]));_0x4b0270['attributes']=_0x4b0270[_0x65f8('0x3e')][_0x65f8('0x40')]?_0x4b0270[_0x65f8('0x3e')]:_0x1c8f4a[_0x65f8('0x3d')];if(!_0x561957[_0x65f8('0x39')][_0x65f8('0x41')](_0x65f8('0x42'))){_0x4b0270[_0x65f8('0x24')]=qs['limit'](_0x561957['query']['limit']);_0x4b0270[_0x65f8('0x22')]=qs[_0x65f8('0x22')](_0x561957[_0x65f8('0x39')][_0x65f8('0x22')]);}_0x4b0270[_0x65f8('0x43')]=qs['sort'](_0x561957[_0x65f8('0x39')][_0x65f8('0x44')]);_0x4b0270[_0x65f8('0x45')]=qs[_0x65f8('0x3b')](_[_0x65f8('0x46')](_0x561957[_0x65f8('0x39')],_0x1c8f4a[_0x65f8('0x3b')]),_0x358464);if(_0x561957[_0x65f8('0x39')][_0x65f8('0x47')]){_0x4b0270[_0x65f8('0x45')]=_['merge'](_0x4b0270['where'],{'$or':_['map'](_0x358464,function(_0x384cb2){if(_0x384cb2[_0x65f8('0x48')]!=='VIRTUAL'){var _0x13840a={};_0x13840a[_0x384cb2[_0x65f8('0x32')]]={'$like':'%'+_0x561957[_0x65f8('0x39')][_0x65f8('0x47')]+'%'};return _0x13840a;}})});}_0x4b0270=_[_0x65f8('0x49')]({},_0x4b0270,_0x561957['options']);var _0x142c3f={'where':_0x4b0270['where']};return db[_0x65f8('0x36')][_0x65f8('0x25')](_0x142c3f)['then'](function(_0x5a4fe1){_0x2823f3[_0x65f8('0x25')]=_0x5a4fe1;if(_0x561957['query'][_0x65f8('0x4a')]){_0x4b0270[_0x65f8('0x4b')]=[{'all':!![]}];}return db[_0x65f8('0x36')]['findAll'](_0x4b0270);})[_0x65f8('0x2c')](function(_0x360692){_0x2823f3['rows']=_0x360692;return _0x2823f3;})[_0x65f8('0x2c')](respondWithFilteredResult(_0x25c544,_0x4b0270))[_0x65f8('0x4c')](handleError(_0x25c544,null));};exports[_0x65f8('0x4d')]=function(_0x40871a,_0x511d5f){var _0x30fe93={'raw':![],'where':{'id':_0x40871a[_0x65f8('0x4e')]['id']}},_0x404cc6={};_0x404cc6[_0x65f8('0x3d')]=_[_0x65f8('0x3a')](db[_0x65f8('0x36')][_0x65f8('0x37')]);_0x404cc6[_0x65f8('0x39')]=_[_0x65f8('0x3a')](_0x40871a[_0x65f8('0x39')]);_0x404cc6[_0x65f8('0x3b')]=_[_0x65f8('0x3c')](_0x404cc6['model'],_0x404cc6['query']);_0x30fe93[_0x65f8('0x3e')]=_[_0x65f8('0x3c')](_0x404cc6[_0x65f8('0x3d')],qs['fields'](_0x40871a[_0x65f8('0x39')][_0x65f8('0x3f')]));_0x30fe93[_0x65f8('0x3e')]=_0x30fe93[_0x65f8('0x3e')][_0x65f8('0x40')]?_0x30fe93[_0x65f8('0x3e')]:_0x404cc6[_0x65f8('0x3d')];if(_0x40871a[_0x65f8('0x39')][_0x65f8('0x4a')]){_0x30fe93['include']=[{'all':!![]}];}_0x30fe93=_['merge']({},_0x30fe93,_0x40871a[_0x65f8('0x4f')]);return db[_0x65f8('0x36')][_0x65f8('0x50')](_0x30fe93)[_0x65f8('0x2c')](handleEntityNotFound(_0x511d5f,null))[_0x65f8('0x2c')](respondWithResult(_0x511d5f,null))[_0x65f8('0x4c')](handleError(_0x511d5f,null));};exports['create']=function(_0x463f64,_0x3499b9){return db[_0x65f8('0x36')][_0x65f8('0x51')](_0x463f64['body'],{})[_0x65f8('0x2c')](function(_0x7e350e){var _0xb16aa6=_0x463f64['user'][_0x65f8('0x2d')]({'plain':!![]});if(!_0xb16aa6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb16aa6[_0x65f8('0x52')]===_0x65f8('0x53')){var _0x31990b=_0x7e350e[_0x65f8('0x2d')]({'plain':!![]});var _0x521a76='SquareProjects';return db[_0x65f8('0x54')][_0x65f8('0x50')]({'where':{'name':_0x521a76,'userProfileId':_0xb16aa6[_0x65f8('0x55')]},'raw':!![]})['then'](function(_0x41695b){if(_0x41695b&&_0x41695b[_0x65f8('0x56')]===0x0){return db[_0x65f8('0x57')][_0x65f8('0x51')]({'name':_0x31990b['name'],'resourceId':_0x31990b['id'],'type':_0x41695b[_0x65f8('0x32')],'sectionId':_0x41695b['id']},{})['then'](function(){return _0x7e350e;});}else{return _0x7e350e;}})[_0x65f8('0x4c')](function(_0x45626a){logger[_0x65f8('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45626a);throw _0x45626a;});}return _0x7e350e;})['then'](respondWithResult(_0x3499b9,0xc9))['catch'](handleError(_0x3499b9,null));};exports['update']=function(_0x2e27b6,_0x196b26){if(_0x2e27b6[_0x65f8('0x58')]['id']){delete _0x2e27b6['body']['id'];}return db[_0x65f8('0x36')]['find']({'where':{'id':_0x2e27b6['params']['id']}})[_0x65f8('0x2c')](handleEntityNotFound(_0x196b26,null))[_0x65f8('0x2c')](saveUpdates(_0x2e27b6[_0x65f8('0x58')],null))[_0x65f8('0x2c')](respondWithResult(_0x196b26,null))[_0x65f8('0x4c')](handleError(_0x196b26,null));};exports[_0x65f8('0x2f')]=function(_0x39b12f,_0x4f35ef){return db[_0x65f8('0x36')][_0x65f8('0x50')]({'where':{'id':_0x39b12f['params']['id']}})[_0x65f8('0x2c')](handleEntityNotFound(_0x4f35ef,null))[_0x65f8('0x2c')](removeEntity(_0x4f35ef,null))[_0x65f8('0x4c')](handleError(_0x4f35ef,null));};exports[_0x65f8('0x59')]=function(_0x12b35b,_0x5eff52,_0x4be6f8){return db[_0x65f8('0x36')][_0x65f8('0x50')]({'where':{'id':_0x12b35b[_0x65f8('0x4e')]['id']}})[_0x65f8('0x2c')](handleEntityNotFound(_0x5eff52,null))[_0x65f8('0x2c')](function(_0x1fd6b2){if(_0x1fd6b2){return _0x1fd6b2[_0x65f8('0x59')](_0x12b35b[_0x65f8('0x58')]['ids'],_[_0x65f8('0x5a')](_0x12b35b[_0x65f8('0x58')],[_0x65f8('0x5b'),'id'])||{});}})[_0x65f8('0x2c')](respondWithResult(_0x5eff52,null))[_0x65f8('0x4c')](handleError(_0x5eff52,null));};exports[_0x65f8('0x5c')]=function(_0x5b6d72,_0x312097,_0x89bc2d){return db[_0x65f8('0x36')][_0x65f8('0x50')]({'where':{'id':_0x5b6d72[_0x65f8('0x4e')]['id']}})[_0x65f8('0x2c')](handleEntityNotFound(_0x312097,null))['then'](function(_0x4760d8){if(_0x4760d8){return _0x4760d8['removeUsers'](_0x5b6d72[_0x65f8('0x39')][_0x65f8('0x5b')])['then'](function(){if(_[_0x65f8('0x5d')](_0x5b6d72[_0x65f8('0x39')][_0x65f8('0x5b')])){for(var _0x23a066=0x0;_0x23a066<_0x5b6d72[_0x65f8('0x39')][_0x65f8('0x5b')][_0x65f8('0x40')];_0x23a066+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x5b6d72[_0x65f8('0x39')]['ids'][_0x23a066]),'SquareProjectId':Number(_0x5b6d72[_0x65f8('0x4e')]['id'])});}}else{socket[_0x65f8('0x5e')](_0x65f8('0x5f'),{'UserId':Number(_0x5b6d72[_0x65f8('0x39')][_0x65f8('0x5b')]),'SquareProjectId':Number(_0x5b6d72[_0x65f8('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x312097,null))[_0x65f8('0x4c')](handleError(_0x312097,null));};exports[_0x65f8('0x60')]=function(_0x3a6744,_0x30e1fd,_0x2b23eb){var _0x28f7b4={};var _0x417655={};var _0x5b94b7;var _0x204b53;return db[_0x65f8('0x36')][_0x65f8('0x61')]({'where':{'id':_0x3a6744[_0x65f8('0x4e')]['id']}})[_0x65f8('0x2c')](handleEntityNotFound(_0x30e1fd,null))[_0x65f8('0x2c')](function(_0x240c80){if(_0x240c80){_0x5b94b7=_0x240c80;_0x417655[_0x65f8('0x3d')]=_[_0x65f8('0x3a')](db['User']['rawAttributes']);_0x417655['query']=_[_0x65f8('0x3a')](_0x3a6744[_0x65f8('0x39')]);_0x417655[_0x65f8('0x3b')]=_[_0x65f8('0x3c')](_0x417655[_0x65f8('0x3d')],_0x417655[_0x65f8('0x39')]);_0x28f7b4[_0x65f8('0x3e')]=_[_0x65f8('0x3c')](_0x417655[_0x65f8('0x3d')],qs[_0x65f8('0x3f')](_0x3a6744[_0x65f8('0x39')][_0x65f8('0x3f')]));_0x28f7b4['attributes']=_0x28f7b4[_0x65f8('0x3e')][_0x65f8('0x40')]?_0x28f7b4[_0x65f8('0x3e')]:_0x417655['model'];_0x28f7b4['order']=qs[_0x65f8('0x44')](_0x3a6744[_0x65f8('0x39')][_0x65f8('0x44')]);_0x28f7b4['where']=qs[_0x65f8('0x3b')](_['pick'](_0x3a6744['query'],_0x417655['filters']));if(_0x3a6744['query'][_0x65f8('0x47')]){_0x28f7b4[_0x65f8('0x45')]=_[_0x65f8('0x49')](_0x28f7b4['where'],{'$or':_[_0x65f8('0x35')](_0x28f7b4[_0x65f8('0x3e')],function(_0x1e103b){var _0x2ea454={};_0x2ea454[_0x1e103b]={'$like':'%'+_0x3a6744[_0x65f8('0x39')][_0x65f8('0x47')]+'%'};return _0x2ea454;})});}_0x28f7b4=_[_0x65f8('0x49')]({},_0x28f7b4,_0x3a6744[_0x65f8('0x4f')]);return _0x5b94b7['getUsers'](_0x28f7b4);}})[_0x65f8('0x2c')](function(_0x3688e5){if(_0x3688e5){_0x204b53=_0x3688e5[_0x65f8('0x40')];if(!_0x3a6744[_0x65f8('0x39')]['hasOwnProperty']('nolimit')){_0x28f7b4[_0x65f8('0x24')]=qs[_0x65f8('0x24')](_0x3a6744[_0x65f8('0x39')][_0x65f8('0x24')]);_0x28f7b4[_0x65f8('0x22')]=qs[_0x65f8('0x22')](_0x3a6744[_0x65f8('0x39')]['offset']);}return _0x5b94b7['getUsers'](_0x28f7b4);}})[_0x65f8('0x2c')](function(_0x13810d){if(_0x13810d){return _0x13810d?{'count':_0x204b53,'rows':_0x13810d}:null;}})['then'](respondWithResult(_0x30e1fd,null))[_0x65f8('0x4c')](handleError(_0x30e1fd,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index b7d7f86..eecb160 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 _0x3c43=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0x3c43,0x167));var _0x33c4=function(_0x50ccc2,_0x381e10){_0x50ccc2=_0x50ccc2-0x0;var _0x4a62f4=_0x3c43[_0x50ccc2];return _0x4a62f4;};'use strict';var EventEmitter=require(_0x33c4('0x0'));var SquareProject=require(_0x33c4('0x1'))['db'][_0x33c4('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x33c4('0x3')](0x0);var events={'afterCreate':_0x33c4('0x4'),'afterUpdate':_0x33c4('0x5'),'afterDestroy':_0x33c4('0x6')};function emitEvent(_0x43f6cd){return function(_0x1a812d,_0x18fa54,_0x4a8253){SquareProjectEvents[_0x33c4('0x7')](_0x43f6cd+':'+_0x1a812d['id'],_0x1a812d);SquareProjectEvents[_0x33c4('0x7')](_0x43f6cd,_0x1a812d);_0x4a8253(null);};}for(var e in events){if(events[_0x33c4('0x8')](e)){var event=events[e];SquareProject[_0x33c4('0x9')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x1be6=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x5a1d4a,_0x429bdc){var _0x34d8ab=function(_0x2245d2){while(--_0x2245d2){_0x5a1d4a['push'](_0x5a1d4a['shift']());}};_0x34d8ab(++_0x429bdc);}(_0x1be6,0xd5));var _0x61be=function(_0x9ce749,_0x38b8cf){_0x9ce749=_0x9ce749-0x0;var _0x3d2c62=_0x1be6[_0x9ce749];return _0x3d2c62;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x61be('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x61be('0x1')](0x0);var events={'afterCreate':_0x61be('0x2'),'afterUpdate':_0x61be('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44169b){return function(_0x5e28cc,_0x5e41f8,_0x2a8856){SquareProjectEvents[_0x61be('0x4')](_0x44169b+':'+_0x5e28cc['id'],_0x5e28cc);SquareProjectEvents[_0x61be('0x4')](_0x44169b,_0x5e28cc);_0x2a8856(null);};}for(var e in events){if(events[_0x61be('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x61be('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 6972c00..62f9845 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 _0xe9b1=['production','publishedAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0xe9b1,0x191));var _0x1e9b=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0xe9b1[_0x12d6c2];return _0x1c9825;};'use strict';var _=require(_0x1e9b('0x0'));var util=require(_0x1e9b('0x1'));var logger=require('../../config/logger')(_0x1e9b('0x2'));var moment=require(_0x1e9b('0x3'));var BPromise=require(_0x1e9b('0x4'));var rp=require(_0x1e9b('0x5'));var fs=require('fs');var path=require(_0x1e9b('0x6'));var rimraf=require(_0x1e9b('0x7'));var config=require(_0x1e9b('0x8'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x49c486,_0x40eaf5){return _0x49c486[_0x1e9b('0x9')](_0x1e9b('0xa'),attributes,{'tableName':_0x1e9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9561ee,_0x47607d,_0x330a53){if(_0x9561ee[_0x1e9b('0xc')](_0x1e9b('0xd'))){_0x9561ee[_0x1e9b('0xe')]=moment()[_0x1e9b('0xf')](_0x1e9b('0x10'));}if(_0x9561ee[_0x1e9b('0xc')](_0x1e9b('0x11'))){_0x9561ee[_0x1e9b('0x12')]=moment()[_0x1e9b('0xf')](_0x1e9b('0x10'));}_0x330a53(null,_0x9561ee);}}});}; \ No newline at end of file +var _0x5a99=['../../config/logger','api','moment','bluebird','request-promise','path','./squareProject.attributes','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','format','lodash'];(function(_0x403e08,_0x475d8b){var _0x26cb04=function(_0x5e4ed8){while(--_0x5e4ed8){_0x403e08['push'](_0x403e08['shift']());}};_0x26cb04(++_0x475d8b);}(_0x5a99,0x14f));var _0x95a9=function(_0x5c65a7,_0x25575c){_0x5c65a7=_0x5c65a7-0x0;var _0x3bccee=_0x5a99[_0x5c65a7];return _0x3bccee;};'use strict';var _=require(_0x95a9('0x0'));var util=require('util');var logger=require(_0x95a9('0x1'))(_0x95a9('0x2'));var moment=require(_0x95a9('0x3'));var BPromise=require(_0x95a9('0x4'));var rp=require(_0x95a9('0x5'));var fs=require('fs');var path=require(_0x95a9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95a9('0x7'));module['exports']=function(_0x56a8a8,_0x1f2df0){return _0x56a8a8['define'](_0x95a9('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x110091,_0x5d21c9,_0x20ebc1){if(_0x110091[_0x95a9('0x9')](_0x95a9('0xa'))){_0x110091[_0x95a9('0xb')]=moment()['format'](_0x95a9('0xc'));}if(_0x110091['changed']('production')){_0x110091['publishedAt']=moment()[_0x95a9('0xd')](_0x95a9('0xc'));}_0x20ebc1(null,_0x110091);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0267cde..02c6882 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 _0xe340=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','info','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','SquareProject','options','raw','where','map','attributes','include','model','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe340,0xde));var _0x0e34=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe340[_0x550d12];return _0x12103d;};'use strict';var _=require(_0x0e34('0x0'));var util=require(_0x0e34('0x1'));var moment=require(_0x0e34('0x2'));var BPromise=require(_0x0e34('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e34('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e34('0x5'));var logger=require(_0x0e34('0x6'))(_0x0e34('0x7'));var config=require(_0x0e34('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0e34('0x9')]['http']({'port':0x232a});config[_0x0e34('0xa')]=_[_0x0e34('0xb')](config[_0x0e34('0xa')],{'host':_0x0e34('0xc'),'port':0x18eb});var socket=require(_0x0e34('0xd'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0e34('0xe')](socket);function respondWithRpcPromise(_0x1478ed,_0x103110,_0x39c8de){return new BPromise(function(_0x3bacbc,_0x2a40cb){return client[_0x0e34('0xf')](_0x1478ed,_0x39c8de)['then'](function(_0x33cc37){logger[_0x0e34('0x10')]('SquareProject,\x20%s,\x20%s',_0x103110,'request\x20sent');logger[_0x0e34('0x11')](_0x0e34('0x12'),_0x103110,_0x0e34('0x13'),JSON[_0x0e34('0x14')](_0x33cc37));if(_0x33cc37[_0x0e34('0x15')]){if(_0x33cc37[_0x0e34('0x15')][_0x0e34('0x16')]===0x1f4){logger[_0x0e34('0x15')]('SquareProject,\x20%s,\x20%s',_0x103110,_0x33cc37[_0x0e34('0x15')][_0x0e34('0x17')]);return _0x2a40cb(_0x33cc37[_0x0e34('0x15')]['message']);}logger[_0x0e34('0x15')]('SquareProject,\x20%s,\x20%s',_0x103110,_0x33cc37[_0x0e34('0x15')]['message']);return _0x3bacbc(_0x33cc37[_0x0e34('0x15')][_0x0e34('0x17')]);}else{logger[_0x0e34('0x10')](_0x0e34('0x18'),_0x103110,_0x0e34('0x13'));_0x3bacbc(_0x33cc37[_0x0e34('0x19')][_0x0e34('0x17')]);}})[_0x0e34('0x1a')](function(_0x4d44e3){logger[_0x0e34('0x15')](_0x0e34('0x18'),_0x103110,_0x4d44e3);_0x2a40cb(_0x4d44e3);});});}exports[_0x0e34('0x1b')]=function(_0x5916d9){var _0x702d76=this;return new Promise(function(_0xc94ac0,_0x532545){return db[_0x0e34('0x1c')]['find']({'raw':_0x5916d9[_0x0e34('0x1d')]?_0x5916d9['options'][_0x0e34('0x1e')]===undefined?!![]:![]:!![],'where':_0x5916d9[_0x0e34('0x1d')]?_0x5916d9[_0x0e34('0x1d')][_0x0e34('0x1f')]||null:null,'attributes':_0x5916d9[_0x0e34('0x1d')]?_0x5916d9['options']['attributes']||null:null,'include':_0x5916d9[_0x0e34('0x1d')]?_0x5916d9[_0x0e34('0x1d')]['include']?_[_0x0e34('0x20')](_0x5916d9[_0x0e34('0x1d')]['include'],function(_0x2372fd){return{'model':db[_0x2372fd['model']],'as':_0x2372fd['as'],'attributes':_0x2372fd[_0x0e34('0x21')],'include':_0x2372fd[_0x0e34('0x22')]?_[_0x0e34('0x20')](_0x2372fd['include'],function(_0x539054){return{'model':db[_0x539054[_0x0e34('0x23')]],'as':_0x539054['as'],'attributes':_0x539054[_0x0e34('0x21')],'include':_0x539054['include']?_[_0x0e34('0x20')](_0x539054[_0x0e34('0x22')],function(_0x38ecf5){return{'model':db[_0x38ecf5[_0x0e34('0x23')]],'as':_0x38ecf5['as'],'attributes':_0x38ecf5[_0x0e34('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0e34('0x24')](function(_0x3acde0){logger[_0x0e34('0x10')](_0x0e34('0x1b'),_0x5916d9);logger[_0x0e34('0x11')](_0x0e34('0x1b'),_0x5916d9,JSON[_0x0e34('0x14')](_0x3acde0));_0xc94ac0(_0x3acde0);})[_0x0e34('0x1a')](function(_0xd2fc56){logger[_0x0e34('0x15')](_0x0e34('0x1b'),_0xd2fc56[_0x0e34('0x17')],_0x5916d9);_0x532545(_0x702d76[_0x0e34('0x15')](0x1f4,_0xd2fc56[_0x0e34('0x17')]));});});}; \ No newline at end of file +var _0xf821=['SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareProject,\x20%s,\x20%s','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent'];(function(_0x3a1de8,_0x492290){var _0x3e4975=function(_0x2da33d){while(--_0x2da33d){_0x3a1de8['push'](_0x3a1de8['shift']());}};_0x3e4975(++_0x492290);}(_0xf821,0x18c));var _0x1f82=function(_0xf3a03d,_0x5c3170){_0xf3a03d=_0xf3a03d-0x0;var _0x24b6e3=_0xf821[_0xf3a03d];return _0x24b6e3;};'use strict';var _=require(_0x1f82('0x0'));var util=require(_0x1f82('0x1'));var moment=require('moment');var BPromise=require(_0x1f82('0x2'));var rs=require(_0x1f82('0x3'));var fs=require('fs');var Redis=require(_0x1f82('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f82('0x5'));var logger=require(_0x1f82('0x6'))(_0x1f82('0x7'));var config=require(_0x1f82('0x8'));var jayson=require(_0x1f82('0x9'));var client=jayson[_0x1f82('0xa')][_0x1f82('0xb')]({'port':0x232a});config[_0x1f82('0xc')]=_[_0x1f82('0xd')](config[_0x1f82('0xc')],{'host':_0x1f82('0xe'),'port':0x18eb});var socket=require(_0x1f82('0xf'))(new Redis(config[_0x1f82('0xc')]));require(_0x1f82('0x10'))[_0x1f82('0x11')](socket);function respondWithRpcPromise(_0x4b14fe,_0x258d23,_0x298d58){return new BPromise(function(_0x374db8,_0x25c059){return client[_0x1f82('0x12')](_0x4b14fe,_0x298d58)[_0x1f82('0x13')](function(_0x12412b){logger[_0x1f82('0x14')]('SquareProject,\x20%s,\x20%s',_0x258d23,_0x1f82('0x15'));logger['debug'](_0x1f82('0x16'),_0x258d23,_0x1f82('0x15'),JSON[_0x1f82('0x17')](_0x12412b));if(_0x12412b[_0x1f82('0x18')]){if(_0x12412b[_0x1f82('0x18')]['code']===0x1f4){logger[_0x1f82('0x18')]('SquareProject,\x20%s,\x20%s',_0x258d23,_0x12412b[_0x1f82('0x18')][_0x1f82('0x19')]);return _0x25c059(_0x12412b['error'][_0x1f82('0x19')]);}logger[_0x1f82('0x18')](_0x1f82('0x1a'),_0x258d23,_0x12412b[_0x1f82('0x18')][_0x1f82('0x19')]);return _0x374db8(_0x12412b[_0x1f82('0x18')]['message']);}else{logger[_0x1f82('0x14')](_0x1f82('0x1a'),_0x258d23,_0x1f82('0x15'));_0x374db8(_0x12412b['result'][_0x1f82('0x19')]);}})[_0x1f82('0x1b')](function(_0x122cd0){logger[_0x1f82('0x18')]('SquareProject,\x20%s,\x20%s',_0x258d23,_0x122cd0);_0x25c059(_0x122cd0);});});}exports[_0x1f82('0x1c')]=function(_0x344e58){var _0x50717d=this;return new Promise(function(_0x229333,_0x35245c){return db[_0x1f82('0x1d')][_0x1f82('0x1e')]({'raw':_0x344e58[_0x1f82('0x1f')]?_0x344e58['options'][_0x1f82('0x20')]===undefined?!![]:![]:!![],'where':_0x344e58[_0x1f82('0x1f')]?_0x344e58[_0x1f82('0x1f')][_0x1f82('0x21')]||null:null,'attributes':_0x344e58[_0x1f82('0x1f')]?_0x344e58['options'][_0x1f82('0x22')]||null:null,'include':_0x344e58['options']?_0x344e58[_0x1f82('0x1f')][_0x1f82('0x23')]?_[_0x1f82('0x24')](_0x344e58[_0x1f82('0x1f')][_0x1f82('0x23')],function(_0x32aaa0){return{'model':db[_0x32aaa0[_0x1f82('0x25')]],'as':_0x32aaa0['as'],'attributes':_0x32aaa0[_0x1f82('0x22')],'include':_0x32aaa0[_0x1f82('0x23')]?_[_0x1f82('0x24')](_0x32aaa0[_0x1f82('0x23')],function(_0x48cb47){return{'model':db[_0x48cb47[_0x1f82('0x25')]],'as':_0x48cb47['as'],'attributes':_0x48cb47[_0x1f82('0x22')],'include':_0x48cb47[_0x1f82('0x23')]?_[_0x1f82('0x24')](_0x48cb47['include'],function(_0x452b2){return{'model':db[_0x452b2[_0x1f82('0x25')]],'as':_0x452b2['as'],'attributes':_0x452b2[_0x1f82('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d6ccd){logger['info'](_0x1f82('0x1c'),_0x344e58);logger['debug'](_0x1f82('0x1c'),_0x344e58,JSON['stringify'](_0x5d6ccd));_0x229333(_0x5d6ccd);})[_0x1f82('0x1b')](function(_0xd66e13){logger['error'](_0x1f82('0x1c'),_0xd66e13[_0x1f82('0x19')],_0x344e58);_0x35245c(_0x50717d[_0x1f82('0x18')](0x1f4,_0xd66e13[_0x1f82('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 90d71ff..16266f2 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 _0x4965=['./squareProject.events','save','emit','removeListener','register'];(function(_0x3111ff,_0x23c7aa){var _0x121764=function(_0x575fb4){while(--_0x575fb4){_0x3111ff['push'](_0x3111ff['shift']());}};_0x121764(++_0x23c7aa);}(_0x4965,0x14a));var _0x5496=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x4965[_0xfbdff6];return _0x4cb9be;};'use strict';var SquareProjectEvents=require(_0x5496('0x0'));var events=[_0x5496('0x1'),'remove','update'];function createListener(_0x553675,_0x2a8255){return function(_0x618dc9){_0x2a8255[_0x5496('0x2')](_0x553675,_0x618dc9);};}function removeListener(_0x3d75c6,_0x14b2f4){return function(){SquareProjectEvents[_0x5496('0x3')](_0x3d75c6,_0x14b2f4);};}exports[_0x5496('0x4')]=function(_0x5e0b55){for(var _0x47a41e=0x0,_0xa7e313=events['length'];_0x47a41e<_0xa7e313;_0x47a41e++){var _0x5d8f74=events[_0x47a41e];var _0xa94cfa=createListener('squareProject:'+_0x5d8f74,_0x5e0b55);SquareProjectEvents['on'](_0x5d8f74,_0xa94cfa);}}; \ No newline at end of file +var _0x8825=['length','squareProject:','./squareProject.events','save','remove','removeListener','register'];(function(_0x457dca,_0x2ddbd0){var _0x464883=function(_0x566504){while(--_0x566504){_0x457dca['push'](_0x457dca['shift']());}};_0x464883(++_0x2ddbd0);}(_0x8825,0xdb));var _0x5882=function(_0x5c0a60,_0x1c0a71){_0x5c0a60=_0x5c0a60-0x0;var _0x1b6c78=_0x8825[_0x5c0a60];return _0x1b6c78;};'use strict';var SquareProjectEvents=require(_0x5882('0x0'));var events=[_0x5882('0x1'),_0x5882('0x2'),'update'];function createListener(_0x14840c,_0xb804a){return function(_0x1be1dd){_0xb804a['emit'](_0x14840c,_0x1be1dd);};}function removeListener(_0x44a9e9,_0x15765d){return function(){SquareProjectEvents[_0x5882('0x3')](_0x44a9e9,_0x15765d);};}exports[_0x5882('0x4')]=function(_0x4918ca){for(var _0x4daf42=0x0,_0x26da11=events[_0x5882('0x5')];_0x4daf42<_0x26da11;_0x4daf42++){var _0x2fc079=events[_0x4daf42];var _0x561ccc=createListener(_0x5882('0x6')+_0x2fc079,_0x4918ca);SquareProjectEvents['on'](_0x2fc079,_0x561ccc);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index fe882ba..087d3fe 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x28a5c8,_0x25f0a0){var _0x165498=function(_0x567722){while(--_0x567722){_0x28a5c8['push'](_0x28a5c8['shift']());}};_0x165498(++_0x25f0a0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _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(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x0295,0x1f0));var _0x5029=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x0295[_0x1a72b8];return _0x39f72d;};'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 8f5a0a0..cfbc7cb 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 _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x3b2bb5,_0x315f28){var _0x5a7973=function(_0x51c96a){while(--_0x51c96a){_0x3b2bb5['push'](_0x3b2bb5['shift']());}};_0x5a7973(++_0x315f28);}(_0xac31,0xca));var _0x1ac3=function(_0x2f7286,_0x58d29){_0x2f7286=_0x2f7286-0x0;var _0x67cf12=_0xac31[_0x2f7286];return _0x67cf12;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x1ac3('0x2')]},'callerid':{'type':Sequelize[_0x1ac3('0x2')]},'calleridname':{'type':Sequelize[_0x1ac3('0x2')]},'context':{'type':Sequelize[_0x1ac3('0x2')]},'extension':{'type':Sequelize[_0x1ac3('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1ac3('0x2')]},'dnid':{'type':Sequelize[_0x1ac3('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1ac3('0x2')]},'savePath':{'type':Sequelize[_0x1ac3('0x2')]},'format':{'type':Sequelize[_0x1ac3('0x3')],'get':function(){var _0x1be223='';var _0x157604=this['getDataValue'](_0x1ac3('0x4'));if(_0x157604){_0x1be223=_0x157604['substring'](_0x157604[_0x1ac3('0x5')]('.'));}return _0x1be223;}}}; \ No newline at end of file +var _0x8d0e=['exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize'];(function(_0x37dcd0,_0x51a9d0){var _0x5fccab=function(_0x3f7fd5){while(--_0x3f7fd5){_0x37dcd0['push'](_0x37dcd0['shift']());}};_0x5fccab(++_0x51a9d0);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4a111c,_0x15e1d2){_0x4a111c=_0x4a111c-0x0;var _0x5851e4=_0x8d0e[_0x4a111c];return _0x5851e4;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'callerid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'extension':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xe8d0('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xe8d0('0x2')]},'format':{'type':Sequelize[_0xe8d0('0x3')],'get':function(){var _0x469d37='';var _0xcc03d0=this[_0xe8d0('0x4')](_0xe8d0('0x5'));if(_0xcc03d0){_0x469d37=_0xcc03d0[_0xe8d0('0x6')](_0xcc03d0[_0xe8d0('0x7')]('.'));}return _0x469d37;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index d77fad4..66dad13 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 _0xc88f=['isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','File:\x20\x22','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','reject','update','then','destroy','error','stack','name','send','SquareRecording','rawAttributes','type','map','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','find','create','body','params','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','download','Not\x20found'];(function(_0x1d01d7,_0x3ae26f){var _0x518ff7=function(_0x1b29f0){while(--_0x1b29f0){_0x1d01d7['push'](_0x1d01d7['shift']());}};_0x518ff7(++_0x3ae26f);}(_0xc88f,0x1ce));var _0xfc88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc88f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc88('0x0'));var rimraf=require(_0xfc88('0x1'));var zipdir=require(_0xfc88('0x2'));var jsonpatch=require(_0xfc88('0x3'));var rp=require('request-promise');var moment=require(_0xfc88('0x4'));var BPromise=require(_0xfc88('0x5'));var Mustache=require(_0xfc88('0x6'));var util=require(_0xfc88('0x7'));var path=require(_0xfc88('0x8'));var sox=require(_0xfc88('0x9'));var csv=require(_0xfc88('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc88('0xb'));var _=require(_0xfc88('0xc'));var squel=require('squel');var crypto=require(_0xfc88('0xd'));var jsforce=require(_0xfc88('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfc88('0xa'));var querystring=require(_0xfc88('0xf'));var Papa=require(_0xfc88('0x10'));var Redis=require(_0xfc88('0x11'));var authService=require(_0xfc88('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfc88('0x13'));var hardwareService=require(_0xfc88('0x14'));var logger=require(_0xfc88('0x15'))(_0xfc88('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc88('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a5126,_0x3e38d0){_0x3e38d0=_0x3e38d0||0xcc;return function(_0x174582){if(_0x174582){return _0x4a5126[_0xfc88('0x18')](_0x3e38d0);}return _0x4a5126[_0xfc88('0x19')](_0x3e38d0)[_0xfc88('0x1a')]();};}function respondWithResult(_0x44d31f,_0x512711){_0x512711=_0x512711||0xc8;return function(_0x5c53f5){if(_0x5c53f5){return _0x44d31f[_0xfc88('0x19')](_0x512711)[_0xfc88('0x1b')](_0x5c53f5);}};}function respondWithFilteredResult(_0x3578df,_0x56a484){return function(_0x5b8907){if(_0x5b8907){var _0x5b7705=typeof _0x56a484[_0xfc88('0x1c')]===_0xfc88('0x1d')&&typeof _0x56a484[_0xfc88('0x1e')]===_0xfc88('0x1d');var _0x4f8ae4=_0x5b8907['count'];var _0x2e417f=_0x5b7705?0x0:_0x56a484['offset'];var _0x3f9bbb=_0x5b7705?_0x5b8907['count']:_0x56a484[_0xfc88('0x1c')]+_0x56a484[_0xfc88('0x1e')];var _0x42f475;if(_0x3f9bbb>=_0x4f8ae4){_0x3f9bbb=_0x4f8ae4;_0x42f475=0xc8;}else{_0x42f475=0xce;}_0x3578df[_0xfc88('0x19')](_0x42f475);return _0x3578df[_0xfc88('0x1f')]('Content-Range',_0x2e417f+'-'+_0x3f9bbb+'/'+_0x4f8ae4)[_0xfc88('0x1b')](_0x5b8907);}return null;};}function patchUpdates(_0x2d3d70){return function(_0x192625){try{jsonpatch['apply'](_0x192625,_0x2d3d70,!![]);}catch(_0x4c5cdc){return BPromise[_0xfc88('0x20')](_0x4c5cdc);}return _0x192625['save']();};}function saveUpdates(_0x2e287d,_0x5e39cf){return function(_0x127ce0){if(_0x127ce0){return _0x127ce0[_0xfc88('0x21')](_0x2e287d)[_0xfc88('0x22')](function(_0x3bd40e){return _0x3bd40e;});}return null;};}function removeEntity(_0x44605d,_0x6287d2){return function(_0x568a67){if(_0x568a67){return _0x568a67[_0xfc88('0x23')]()[_0xfc88('0x22')](function(){_0x44605d['status'](0xcc)[_0xfc88('0x1a')]();});}};}function handleEntityNotFound(_0x5b15b4,_0x39e9ca){return function(_0x21a4d1){if(!_0x21a4d1){_0x5b15b4['sendStatus'](0x194);}return _0x21a4d1;};}function handleError(_0x5e2dc7,_0x108133){_0x108133=_0x108133||0x1f4;return function(_0x3727e6){logger[_0xfc88('0x24')](_0x3727e6[_0xfc88('0x25')]);if(_0x3727e6[_0xfc88('0x26')]){delete _0x3727e6[_0xfc88('0x26')];}_0x5e2dc7[_0xfc88('0x19')](_0x108133)[_0xfc88('0x27')](_0x3727e6);};}exports['index']=function(_0x421c23,_0x4b85ab){var _0x57aaea={},_0x17ff41={},_0x10312f={'count':0x0,'rows':[]};var _0x44b96b=_['map'](db[_0xfc88('0x28')][_0xfc88('0x29')],function(_0x44f23d){return{'name':_0x44f23d['fieldName'],'type':_0x44f23d[_0xfc88('0x2a')]['key']};});_0x17ff41['model']=_[_0xfc88('0x2b')](_0x44b96b,_0xfc88('0x26'));_0x17ff41[_0xfc88('0x2c')]=_[_0xfc88('0x2d')](_0x421c23[_0xfc88('0x2c')]);_0x17ff41[_0xfc88('0x2e')]=_[_0xfc88('0x2f')](_0x17ff41['model'],_0x17ff41[_0xfc88('0x2c')]);_0x57aaea['attributes']=_[_0xfc88('0x2f')](_0x17ff41['model'],qs[_0xfc88('0x30')](_0x421c23['query']['fields']));_0x57aaea[_0xfc88('0x31')]=_0x57aaea['attributes'][_0xfc88('0x32')]?_0x57aaea['attributes']:_0x17ff41[_0xfc88('0x33')];if(!_0x421c23['query'][_0xfc88('0x34')](_0xfc88('0x35'))){_0x57aaea[_0xfc88('0x1e')]=qs['limit'](_0x421c23[_0xfc88('0x2c')][_0xfc88('0x1e')]);_0x57aaea[_0xfc88('0x1c')]=qs[_0xfc88('0x1c')](_0x421c23[_0xfc88('0x2c')]['offset']);}_0x57aaea['order']=qs[_0xfc88('0x36')](_0x421c23[_0xfc88('0x2c')][_0xfc88('0x36')]);_0x57aaea[_0xfc88('0x37')]=qs['filters'](_[_0xfc88('0x38')](_0x421c23[_0xfc88('0x2c')],_0x17ff41[_0xfc88('0x2e')]),_0x44b96b);if(_0x421c23[_0xfc88('0x2c')][_0xfc88('0x39')]){_0x57aaea['where']=_['merge'](_0x57aaea[_0xfc88('0x37')],{'$or':_[_0xfc88('0x2b')](_0x44b96b,function(_0x3d13f8){if(_0x3d13f8['type']!==_0xfc88('0x3a')){var _0x20becf={};_0x20becf[_0x3d13f8[_0xfc88('0x26')]]={'$like':'%'+_0x421c23[_0xfc88('0x2c')][_0xfc88('0x39')]+'%'};return _0x20becf;}})});}_0x57aaea=_[_0xfc88('0x3b')]({},_0x57aaea,_0x421c23['options']);var _0x35cac5={'where':_0x57aaea[_0xfc88('0x37')]};return db[_0xfc88('0x28')][_0xfc88('0x3c')](_0x35cac5)['then'](function(_0x553a63){_0x10312f[_0xfc88('0x3c')]=_0x553a63;if(_0x421c23[_0xfc88('0x2c')][_0xfc88('0x3d')]){_0x57aaea[_0xfc88('0x3e')]=[{'all':!![]}];}return db[_0xfc88('0x28')][_0xfc88('0x3f')](_0x57aaea);})['then'](function(_0x4d522b){_0x10312f[_0xfc88('0x40')]=_0x4d522b;return _0x10312f;})[_0xfc88('0x22')](respondWithFilteredResult(_0x4b85ab,_0x57aaea))[_0xfc88('0x41')](handleError(_0x4b85ab,null));};exports['show']=function(_0x2c3c57,_0x5780ec){var _0x4ebebd={'raw':!![],'where':{'id':_0x2c3c57['params']['id']}},_0x260c9={};_0x260c9[_0xfc88('0x33')]=_['keys'](db['SquareRecording'][_0xfc88('0x29')]);_0x260c9[_0xfc88('0x2c')]=_[_0xfc88('0x2d')](_0x2c3c57[_0xfc88('0x2c')]);_0x260c9['filters']=_[_0xfc88('0x2f')](_0x260c9['model'],_0x260c9[_0xfc88('0x2c')]);_0x4ebebd[_0xfc88('0x31')]=_[_0xfc88('0x2f')](_0x260c9['model'],qs[_0xfc88('0x30')](_0x2c3c57[_0xfc88('0x2c')][_0xfc88('0x30')]));_0x4ebebd[_0xfc88('0x31')]=_0x4ebebd['attributes']['length']?_0x4ebebd[_0xfc88('0x31')]:_0x260c9[_0xfc88('0x33')];if(_0x2c3c57[_0xfc88('0x2c')]['includeAll']){_0x4ebebd[_0xfc88('0x3e')]=[{'all':!![]}];}_0x4ebebd=_[_0xfc88('0x3b')]({},_0x4ebebd,_0x2c3c57['options']);return db[_0xfc88('0x28')][_0xfc88('0x42')](_0x4ebebd)['then'](handleEntityNotFound(_0x5780ec,null))[_0xfc88('0x22')](respondWithResult(_0x5780ec,null))[_0xfc88('0x41')](handleError(_0x5780ec,null));};exports[_0xfc88('0x43')]=function(_0x360d60,_0x469ec3){return db[_0xfc88('0x28')][_0xfc88('0x43')](_0x360d60['body'],{})['then'](respondWithResult(_0x469ec3,0xc9))[_0xfc88('0x41')](handleError(_0x469ec3,null));};exports['update']=function(_0x474f3c,_0x1466e0){if(_0x474f3c[_0xfc88('0x44')]['id']){delete _0x474f3c['body']['id'];}return db[_0xfc88('0x28')][_0xfc88('0x42')]({'where':{'id':_0x474f3c[_0xfc88('0x45')]['id']}})['then'](handleEntityNotFound(_0x1466e0,null))[_0xfc88('0x22')](saveUpdates(_0x474f3c[_0xfc88('0x44')],null))[_0xfc88('0x22')](respondWithResult(_0x1466e0,null))['catch'](handleError(_0x1466e0,null));};exports['download']=function(_0x114c0f,_0x18b31a,_0x538e10){var _0x3a58cb=require(_0xfc88('0x46'));var _0x174057=![];var _0x3b47b1={};if(_0x114c0f[_0xfc88('0x2c')][_0xfc88('0x2a')]&&_0x114c0f[_0xfc88('0x2c')][_0xfc88('0x2a')]===_0xfc88('0x47')){_0x3b47b1[_0xfc88('0x47')]=_0x114c0f[_0xfc88('0x45')]['id'];}else{_0x3b47b1['id']=_0x114c0f['params']['id'];}return db[_0xfc88('0x28')][_0xfc88('0x42')]({'where':_0x3b47b1,'attributes':['id',_0xfc88('0x48'),_0xfc88('0x49')],'raw':!![]})[_0xfc88('0x22')](handleEntityNotFound(_0x18b31a,null))['then'](function(_0x1f46c3){if(_0x1f46c3){var _0x581218=_0x1f46c3[_0xfc88('0x48')];var _0x3d6d1a=util[_0xfc88('0x4a')](_0xfc88('0x4b'),_0x581218);if(fs[_0xfc88('0x4c')](_0x3d6d1a)){_0x174057=!![];return _0x3a58cb['decryptFile'](_0x3d6d1a,_0x581218,config[_0xfc88('0x4d')]['recording'])[_0xfc88('0x22')](function(){return _0x1f46c3;});}return _0x1f46c3;}})['then'](function(_0x2d81a6){if(_0x2d81a6){var _0x48d265=_0x2d81a6[_0xfc88('0x48')];if(!fs[_0xfc88('0x4c')](_0x48d265)){throw new db[(_0xfc88('0x4e'))][(_0xfc88('0x4f'))](_0xfc88('0x50'));}if(_0x2d81a6['filename']){return _0x18b31a['download'](_0x48d265,_0x2d81a6[_0xfc88('0x49')]+path[_0xfc88('0x51')](_0x48d265),function(){if(_0x174057){fs['unlink'](_0x48d265);}});}else{return _0x18b31a[_0xfc88('0x52')](_0x48d265,function(_0x4a2c16){if(_0x174057){fs['unlink'](_0x48d265);}});}}})[_0xfc88('0x41')](function(_0x572aab){if(_0x572aab['message']===_0xfc88('0x50')){_0x18b31a[_0xfc88('0x19')](0x194)[_0xfc88('0x27')](_0xfc88('0x53'));}else{return handleError(_0x18b31a,null);}});};exports[_0xfc88('0x23')]=function(_0x4ec8e2,_0x141b47){return db[_0xfc88('0x28')][_0xfc88('0x42')]({'where':{'id':_0x4ec8e2[_0xfc88('0x45')]['id']}})[_0xfc88('0x22')](function(_0x2c06c7){if(_[_0xfc88('0x54')](_0x2c06c7)){throw new ReferenceError(_0xfc88('0x55'));}return _0x2c06c7;})[_0xfc88('0x22')](function(_0x325fa3){var _0x10b26b=_0x325fa3['savePath'];logger[_0xfc88('0x56')](_0xfc88('0x57'),_0x10b26b);if(!_[_0xfc88('0x54')](_0x325fa3[_0xfc88('0x48')])&&fs[_0xfc88('0x4c')](_0x10b26b)){logger['info']('File:\x20\x22'+_0x10b26b+_0xfc88('0x58'));fs['unlinkSync'](_0x10b26b);}_0x10b26b=_0x10b26b+'.cypher';if(!_[_0xfc88('0x54')](_0x325fa3[_0xfc88('0x48')])&&fs[_0xfc88('0x4c')](_0x10b26b)){logger[_0xfc88('0x56')](_0xfc88('0x59')+_0x10b26b+_0xfc88('0x58'));fs[_0xfc88('0x5a')](_0x10b26b);}return _0x325fa3;})[_0xfc88('0x22')](function(_0x46e154){if(!_0x46e154)throw new InternalError();return _0x46e154['destroy']();})[_0xfc88('0x22')](function(){_0x141b47['status'](0xcc)['end']();})['catch'](handleError(_0x141b47,null));}; \ No newline at end of file +var _0x18bb=['then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SquareRecording','findAll','show','keys','length','includeAll','catch','create','body','find','params','../../components/encryptor','type','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update'];(function(_0x5a77fb,_0x2d2d59){var _0x6ca4fb=function(_0x428777){while(--_0x428777){_0x5a77fb['push'](_0x5a77fb['shift']());}};_0x6ca4fb(++_0x2d2d59);}(_0x18bb,0x1a3));var _0xb18b=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0x18bb[_0x36da00];return _0x4b72c5;};'use strict';var emlformat=require(_0xb18b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb18b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb18b('0x2'));var moment=require('moment');var BPromise=require(_0xb18b('0x3'));var Mustache=require(_0xb18b('0x4'));var util=require('util');var path=require(_0xb18b('0x5'));var sox=require(_0xb18b('0x6'));var csv=require('to-csv');var ejs=require(_0xb18b('0x7'));var fs=require('fs');var fs_extra=require(_0xb18b('0x8'));var _=require('lodash');var squel=require(_0xb18b('0x9'));var crypto=require(_0xb18b('0xa'));var jsforce=require(_0xb18b('0xb'));var deskjs=require(_0xb18b('0xc'));var toCsv=require(_0xb18b('0xd'));var querystring=require('querystring');var Papa=require(_0xb18b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb18b('0xf'));var as=require(_0xb18b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb18b('0x11'));var utils=require(_0xb18b('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb18b('0x13'))['db'];function respondWithStatusCode(_0x1ba10b,_0x454739){_0x454739=_0x454739||0xcc;return function(_0x495001){if(_0x495001){return _0x1ba10b[_0xb18b('0x14')](_0x454739);}return _0x1ba10b[_0xb18b('0x15')](_0x454739)[_0xb18b('0x16')]();};}function respondWithResult(_0x4fe46d,_0x1967f7){_0x1967f7=_0x1967f7||0xc8;return function(_0x1be848){if(_0x1be848){return _0x4fe46d[_0xb18b('0x15')](_0x1967f7)[_0xb18b('0x17')](_0x1be848);}};}function respondWithFilteredResult(_0x8b62ce,_0x50e7cb){return function(_0x52e518){if(_0x52e518){var _0x43910d=typeof _0x50e7cb[_0xb18b('0x18')]===_0xb18b('0x19')&&typeof _0x50e7cb[_0xb18b('0x1a')]===_0xb18b('0x19');var _0x4fc817=_0x52e518[_0xb18b('0x1b')];var _0x442cbd=_0x43910d?0x0:_0x50e7cb[_0xb18b('0x18')];var _0x5068d8=_0x43910d?_0x52e518[_0xb18b('0x1b')]:_0x50e7cb[_0xb18b('0x18')]+_0x50e7cb[_0xb18b('0x1a')];var _0x456cfd;if(_0x5068d8>=_0x4fc817){_0x5068d8=_0x4fc817;_0x456cfd=0xc8;}else{_0x456cfd=0xce;}_0x8b62ce[_0xb18b('0x15')](_0x456cfd);return _0x8b62ce['set'](_0xb18b('0x1c'),_0x442cbd+'-'+_0x5068d8+'/'+_0x4fc817)['json'](_0x52e518);}return null;};}function patchUpdates(_0x22b69b){return function(_0x48b4a0){try{jsonpatch['apply'](_0x48b4a0,_0x22b69b,!![]);}catch(_0x5d2649){return BPromise[_0xb18b('0x1d')](_0x5d2649);}return _0x48b4a0['save']();};}function saveUpdates(_0x4386c9,_0x3cc2ad){return function(_0x53af1e){if(_0x53af1e){return _0x53af1e[_0xb18b('0x1e')](_0x4386c9)[_0xb18b('0x1f')](function(_0x32dae9){return _0x32dae9;});}return null;};}function removeEntity(_0x5009e8,_0x4bb0e6){return function(_0x5982cb){if(_0x5982cb){return _0x5982cb[_0xb18b('0x20')]()[_0xb18b('0x1f')](function(){_0x5009e8[_0xb18b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce033,_0x125c91){return function(_0x7a04b6){if(!_0x7a04b6){_0x2ce033[_0xb18b('0x14')](0x194);}return _0x7a04b6;};}function handleError(_0x1fa91c,_0x31b8ba){_0x31b8ba=_0x31b8ba||0x1f4;return function(_0xf266b2){logger['error'](_0xf266b2[_0xb18b('0x21')]);if(_0xf266b2[_0xb18b('0x22')]){delete _0xf266b2[_0xb18b('0x22')];}_0x1fa91c[_0xb18b('0x15')](_0x31b8ba)[_0xb18b('0x23')](_0xf266b2);};}exports[_0xb18b('0x24')]=function(_0x239618,_0x26f0bf){var _0x203ca9={},_0x30a890={},_0x55fe3a={'count':0x0,'rows':[]};var _0x1c49a7=_[_0xb18b('0x25')](db['SquareRecording'][_0xb18b('0x26')],function(_0x374284){return{'name':_0x374284[_0xb18b('0x27')],'type':_0x374284['type'][_0xb18b('0x28')]};});_0x30a890[_0xb18b('0x29')]=_[_0xb18b('0x25')](_0x1c49a7,'name');_0x30a890[_0xb18b('0x2a')]=_['keys'](_0x239618[_0xb18b('0x2a')]);_0x30a890['filters']=_[_0xb18b('0x2b')](_0x30a890['model'],_0x30a890[_0xb18b('0x2a')]);_0x203ca9[_0xb18b('0x2c')]=_[_0xb18b('0x2b')](_0x30a890[_0xb18b('0x29')],qs['fields'](_0x239618[_0xb18b('0x2a')][_0xb18b('0x2d')]));_0x203ca9[_0xb18b('0x2c')]=_0x203ca9[_0xb18b('0x2c')]['length']?_0x203ca9['attributes']:_0x30a890[_0xb18b('0x29')];if(!_0x239618[_0xb18b('0x2a')]['hasOwnProperty'](_0xb18b('0x2e'))){_0x203ca9[_0xb18b('0x1a')]=qs[_0xb18b('0x1a')](_0x239618[_0xb18b('0x2a')][_0xb18b('0x1a')]);_0x203ca9[_0xb18b('0x18')]=qs[_0xb18b('0x18')](_0x239618['query'][_0xb18b('0x18')]);}_0x203ca9[_0xb18b('0x2f')]=qs[_0xb18b('0x30')](_0x239618['query'][_0xb18b('0x30')]);_0x203ca9[_0xb18b('0x31')]=qs[_0xb18b('0x32')](_[_0xb18b('0x33')](_0x239618['query'],_0x30a890[_0xb18b('0x32')]),_0x1c49a7);if(_0x239618['query'][_0xb18b('0x34')]){_0x203ca9['where']=_['merge'](_0x203ca9[_0xb18b('0x31')],{'$or':_['map'](_0x1c49a7,function(_0x25bae5){if(_0x25bae5['type']!==_0xb18b('0x35')){var _0x23ef1b={};_0x23ef1b[_0x25bae5[_0xb18b('0x22')]]={'$like':'%'+_0x239618[_0xb18b('0x2a')]['filter']+'%'};return _0x23ef1b;}})});}_0x203ca9=_[_0xb18b('0x36')]({},_0x203ca9,_0x239618[_0xb18b('0x37')]);var _0x5d69b2={'where':_0x203ca9[_0xb18b('0x31')]};return db[_0xb18b('0x38')]['count'](_0x5d69b2)[_0xb18b('0x1f')](function(_0x37dadf){_0x55fe3a['count']=_0x37dadf;if(_0x239618['query']['includeAll']){_0x203ca9['include']=[{'all':!![]}];}return db[_0xb18b('0x38')][_0xb18b('0x39')](_0x203ca9);})[_0xb18b('0x1f')](function(_0xb9ea0c){_0x55fe3a['rows']=_0xb9ea0c;return _0x55fe3a;})[_0xb18b('0x1f')](respondWithFilteredResult(_0x26f0bf,_0x203ca9))['catch'](handleError(_0x26f0bf,null));};exports[_0xb18b('0x3a')]=function(_0x12bbb3,_0x47fba2){var _0x5815ca={'raw':!![],'where':{'id':_0x12bbb3['params']['id']}},_0xa63d06={};_0xa63d06[_0xb18b('0x29')]=_[_0xb18b('0x3b')](db[_0xb18b('0x38')][_0xb18b('0x26')]);_0xa63d06[_0xb18b('0x2a')]=_[_0xb18b('0x3b')](_0x12bbb3['query']);_0xa63d06[_0xb18b('0x32')]=_[_0xb18b('0x2b')](_0xa63d06['model'],_0xa63d06[_0xb18b('0x2a')]);_0x5815ca[_0xb18b('0x2c')]=_[_0xb18b('0x2b')](_0xa63d06['model'],qs[_0xb18b('0x2d')](_0x12bbb3[_0xb18b('0x2a')]['fields']));_0x5815ca['attributes']=_0x5815ca[_0xb18b('0x2c')][_0xb18b('0x3c')]?_0x5815ca['attributes']:_0xa63d06[_0xb18b('0x29')];if(_0x12bbb3[_0xb18b('0x2a')][_0xb18b('0x3d')]){_0x5815ca['include']=[{'all':!![]}];}_0x5815ca=_['merge']({},_0x5815ca,_0x12bbb3[_0xb18b('0x37')]);return db['SquareRecording']['find'](_0x5815ca)[_0xb18b('0x1f')](handleEntityNotFound(_0x47fba2,null))[_0xb18b('0x1f')](respondWithResult(_0x47fba2,null))[_0xb18b('0x3e')](handleError(_0x47fba2,null));};exports['create']=function(_0x2a8115,_0x4971d7){return db['SquareRecording'][_0xb18b('0x3f')](_0x2a8115[_0xb18b('0x40')],{})[_0xb18b('0x1f')](respondWithResult(_0x4971d7,0xc9))[_0xb18b('0x3e')](handleError(_0x4971d7,null));};exports['update']=function(_0x11e795,_0x2c3251){if(_0x11e795[_0xb18b('0x40')]['id']){delete _0x11e795[_0xb18b('0x40')]['id'];}return db[_0xb18b('0x38')][_0xb18b('0x41')]({'where':{'id':_0x11e795[_0xb18b('0x42')]['id']}})[_0xb18b('0x1f')](handleEntityNotFound(_0x2c3251,null))[_0xb18b('0x1f')](saveUpdates(_0x11e795[_0xb18b('0x40')],null))['then'](respondWithResult(_0x2c3251,null))[_0xb18b('0x3e')](handleError(_0x2c3251,null));};exports['download']=function(_0x16d275,_0x550ecf,_0x791c1){var _0x24a091=require(_0xb18b('0x43'));var _0x119794=![];var _0x2d01b9={};if(_0x16d275[_0xb18b('0x2a')][_0xb18b('0x44')]&&_0x16d275[_0xb18b('0x2a')]['type']===_0xb18b('0x45')){_0x2d01b9[_0xb18b('0x45')]=_0x16d275[_0xb18b('0x42')]['id'];}else{_0x2d01b9['id']=_0x16d275[_0xb18b('0x42')]['id'];}return db[_0xb18b('0x38')][_0xb18b('0x41')]({'where':_0x2d01b9,'attributes':['id',_0xb18b('0x46'),_0xb18b('0x47')],'raw':!![]})[_0xb18b('0x1f')](handleEntityNotFound(_0x550ecf,null))['then'](function(_0x2f8ebc){if(_0x2f8ebc){var _0x1efee2=_0x2f8ebc[_0xb18b('0x46')];var _0x5899a2=util['format'](_0xb18b('0x48'),_0x1efee2);if(fs[_0xb18b('0x49')](_0x5899a2)){_0x119794=!![];return _0x24a091[_0xb18b('0x4a')](_0x5899a2,_0x1efee2,config[_0xb18b('0x4b')][_0xb18b('0x4c')])[_0xb18b('0x1f')](function(){return _0x2f8ebc;});}return _0x2f8ebc;}})['then'](function(_0x3c0164){if(_0x3c0164){var _0x3d6598=_0x3c0164[_0xb18b('0x46')];if(!fs[_0xb18b('0x49')](_0x3d6598)){throw new db[(_0xb18b('0x4d'))][(_0xb18b('0x4e'))](_0xb18b('0x4f'));}if(_0x3c0164[_0xb18b('0x47')]){return _0x550ecf[_0xb18b('0x50')](_0x3d6598,_0x3c0164[_0xb18b('0x47')]+path['extname'](_0x3d6598),function(){if(_0x119794){fs['unlink'](_0x3d6598);}});}else{return _0x550ecf[_0xb18b('0x50')](_0x3d6598,function(_0xbeac21){if(_0x119794){fs['unlink'](_0x3d6598);}});}}})[_0xb18b('0x3e')](function(_0x30660e){if(_0x30660e['message']===_0xb18b('0x4f')){_0x550ecf[_0xb18b('0x15')](0x194)[_0xb18b('0x23')](_0xb18b('0x51'));}else{return handleError(_0x550ecf,null);}});};exports['destroy']=function(_0x3e3f78,_0x15dfd5){return db[_0xb18b('0x38')][_0xb18b('0x41')]({'where':{'id':_0x3e3f78[_0xb18b('0x42')]['id']}})['then'](function(_0xb8af47){if(_['isNil'](_0xb8af47)){throw new ReferenceError(_0xb18b('0x52'));}return _0xb8af47;})[_0xb18b('0x1f')](function(_0x3bc5d4){var _0x392dc0=_0x3bc5d4[_0xb18b('0x46')];logger['info'](_0xb18b('0x53'),_0x392dc0);if(!_[_0xb18b('0x54')](_0x3bc5d4[_0xb18b('0x46')])&&fs[_0xb18b('0x49')](_0x392dc0)){logger[_0xb18b('0x55')]('File:\x20\x22'+_0x392dc0+_0xb18b('0x56'));fs[_0xb18b('0x57')](_0x392dc0);}_0x392dc0=_0x392dc0+_0xb18b('0x58');if(!_['isNil'](_0x3bc5d4[_0xb18b('0x46')])&&fs[_0xb18b('0x49')](_0x392dc0)){logger[_0xb18b('0x55')](_0xb18b('0x59')+_0x392dc0+_0xb18b('0x56'));fs[_0xb18b('0x57')](_0x392dc0);}return _0x3bc5d4;})['then'](function(_0x27de9b){if(!_0x27de9b)throw new InternalError();return _0x27de9b[_0xb18b('0x20')]();})['then'](function(){_0x15dfd5['status'](0xcc)[_0xb18b('0x16')]();})[_0xb18b('0x3e')](handleError(_0x15dfd5,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 603b61a..4e7e118 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 _0x41d0=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','lodash','util'];(function(_0x14a187,_0x18d4ac){var _0x4dfbad=function(_0x7b3bd3){while(--_0x7b3bd3){_0x14a187['push'](_0x14a187['shift']());}};_0x4dfbad(++_0x18d4ac);}(_0x41d0,0x1c6));var _0x041d=function(_0x5b013d,_0xc7691c){_0x5b013d=_0x5b013d-0x0;var _0x2b6eef=_0x41d0[_0x5b013d];return _0x2b6eef;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var logger=require(_0x041d('0x2'))(_0x041d('0x3'));var moment=require('moment');var BPromise=require(_0x041d('0x4'));var rp=require(_0x041d('0x5'));var fs=require('fs');var path=require(_0x041d('0x6'));var rimraf=require(_0x041d('0x7'));var config=require(_0x041d('0x8'));var attributes=require(_0x041d('0x9'));module[_0x041d('0xa')]=function(_0x14907f,_0x196419){return _0x14907f['define'](_0x041d('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5aa=['bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util','api','moment'];(function(_0x901253,_0x2c944d){var _0x5e8687=function(_0x1d1773){while(--_0x1d1773){_0x901253['push'](_0x901253['shift']());}};_0x5e8687(++_0x2c944d);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x219638,_0x136b76){_0x219638=_0x219638-0x0;var _0x1e2afc=_0xa5aa[_0x219638];return _0x1e2afc;};'use strict';var _=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var logger=require('../../config/logger')(_0xaa5a('0x2'));var moment=require(_0xaa5a('0x3'));var BPromise=require(_0xaa5a('0x4'));var rp=require(_0xaa5a('0x5'));var fs=require('fs');var path=require(_0xaa5a('0x6'));var rimraf=require(_0xaa5a('0x7'));var config=require('../../config/environment');var attributes=require(_0xaa5a('0x8'));module[_0xaa5a('0x9')]=function(_0x46c8cc,_0x561d19){return _0x46c8cc['define'](_0xaa5a('0xa'),attributes,{'tableName':_0xaa5a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 5d3bba7..894ae23 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 _0x38c1=['http','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x38c1,0x199));var _0x138c=function(_0x2ccf59,_0x196b84){_0x2ccf59=_0x2ccf59-0x0;var _0x3c4cb2=_0x38c1[_0x2ccf59];return _0x3c4cb2;};'use strict';var _=require(_0x138c('0x0'));var util=require(_0x138c('0x1'));var moment=require(_0x138c('0x2'));var BPromise=require(_0x138c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x138c('0x4'));var db=require(_0x138c('0x5'))['db'];var utils=require(_0x138c('0x6'));var logger=require('../../config/logger')(_0x138c('0x7'));var config=require(_0x138c('0x8'));var jayson=require(_0x138c('0x9'));var client=jayson[_0x138c('0xa')][_0x138c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32e3e8,_0x3e8c11,_0xa42611){return new BPromise(function(_0x5cf20d,_0x327581){return client['request'](_0x32e3e8,_0xa42611)[_0x138c('0xc')](function(_0x35f413){logger['info'](_0x138c('0xd'),_0x3e8c11,_0x138c('0xe'));logger[_0x138c('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x3e8c11,_0x138c('0xe'),JSON['stringify'](_0x35f413));if(_0x35f413['error']){if(_0x35f413['error'][_0x138c('0x10')]===0x1f4){logger['error'](_0x138c('0xd'),_0x3e8c11,_0x35f413[_0x138c('0x11')][_0x138c('0x12')]);return _0x327581(_0x35f413[_0x138c('0x11')]['message']);}logger[_0x138c('0x11')](_0x138c('0xd'),_0x3e8c11,_0x35f413[_0x138c('0x11')]['message']);return _0x5cf20d(_0x35f413['error']['message']);}else{logger[_0x138c('0x13')](_0x138c('0xd'),_0x3e8c11,_0x138c('0xe'));_0x5cf20d(_0x35f413['result'][_0x138c('0x12')]);}})[_0x138c('0x14')](function(_0x3e6f27){logger['error'](_0x138c('0xd'),_0x3e8c11,_0x3e6f27);_0x327581(_0x3e6f27);});});}exports['CreateSquareRecording']=function(_0x61a61){var _0x5e018e=this;return new Promise(function(_0x415cfc,_0x41af59){return db[_0x138c('0x15')][_0x138c('0x16')](_0x61a61[_0x138c('0x17')],{'raw':_0x61a61[_0x138c('0x18')]?_0x61a61['options'][_0x138c('0x19')]===undefined?!![]:![]:!![]})[_0x138c('0xc')](function(_0x20dcd5){logger['info'](_0x138c('0x1a'),_0x61a61);logger[_0x138c('0xf')]('CreateSquareRecording',_0x61a61,JSON[_0x138c('0x1b')](_0x20dcd5));_0x415cfc(_0x20dcd5);})[_0x138c('0x14')](function(_0x4dfcc){logger[_0x138c('0x11')](_0x138c('0x1a'),_0x4dfcc['message'],_0x61a61);_0x41af59(_0x5e018e[_0x138c('0x11')](0x1f4,_0x4dfcc['message']));});});}; \ No newline at end of file +var _0x26a1=['jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','message','SquareRecording,\x20%s,\x20%s','catch','SquareRecording','body','options','raw','CreateSquareRecording','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xd64be4,_0x385e83){var _0x2de4a2=function(_0x495f5e){while(--_0x495f5e){_0xd64be4['push'](_0xd64be4['shift']());}};_0x2de4a2(++_0x385e83);}(_0x26a1,0x1ec));var _0x126a=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x26a1[_0x28d18d];return _0x470640;};'use strict';var _=require(_0x126a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x126a('0x1'));var rs=require(_0x126a('0x2'));var fs=require('fs');var Redis=require(_0x126a('0x3'));var db=require(_0x126a('0x4'))['db'];var utils=require(_0x126a('0x5'));var logger=require(_0x126a('0x6'))(_0x126a('0x7'));var config=require('../../config/environment');var jayson=require(_0x126a('0x8'));var client=jayson[_0x126a('0x9')][_0x126a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4821,_0x58dbdd,_0x6b3253){return new BPromise(function(_0x1922ad,_0x4c8668){return client['request'](_0x3c4821,_0x6b3253)[_0x126a('0xb')](function(_0xfbd007){logger[_0x126a('0xc')]('SquareRecording,\x20%s,\x20%s',_0x58dbdd,_0x126a('0xd'));logger[_0x126a('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x58dbdd,_0x126a('0xd'),JSON[_0x126a('0xf')](_0xfbd007));if(_0xfbd007[_0x126a('0x10')]){if(_0xfbd007[_0x126a('0x10')]['code']===0x1f4){logger[_0x126a('0x10')]('SquareRecording,\x20%s,\x20%s',_0x58dbdd,_0xfbd007[_0x126a('0x10')][_0x126a('0x11')]);return _0x4c8668(_0xfbd007[_0x126a('0x10')]['message']);}logger[_0x126a('0x10')](_0x126a('0x12'),_0x58dbdd,_0xfbd007[_0x126a('0x10')][_0x126a('0x11')]);return _0x1922ad(_0xfbd007[_0x126a('0x10')][_0x126a('0x11')]);}else{logger['info'](_0x126a('0x12'),_0x58dbdd,_0x126a('0xd'));_0x1922ad(_0xfbd007['result'][_0x126a('0x11')]);}})[_0x126a('0x13')](function(_0x2d0319){logger[_0x126a('0x10')](_0x126a('0x12'),_0x58dbdd,_0x2d0319);_0x4c8668(_0x2d0319);});});}exports['CreateSquareRecording']=function(_0x7c6cd7){var _0x52575a=this;return new Promise(function(_0x41631c,_0x2b2d66){return db[_0x126a('0x14')]['create'](_0x7c6cd7[_0x126a('0x15')],{'raw':_0x7c6cd7[_0x126a('0x16')]?_0x7c6cd7[_0x126a('0x16')][_0x126a('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x1deba4){logger[_0x126a('0xc')](_0x126a('0x18'),_0x7c6cd7);logger[_0x126a('0xe')](_0x126a('0x18'),_0x7c6cd7,JSON[_0x126a('0xf')](_0x1deba4));_0x41631c(_0x1deba4);})['catch'](function(_0x575d8f){logger[_0x126a('0x10')]('CreateSquareRecording',_0x575d8f['message'],_0x7c6cd7);_0x2b2d66(_0x52575a['error'](0x1f4,_0x575d8f['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 122c5c5..2d6c865 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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x10d9a5,_0x53d233){var _0x37d338=function(_0x4529b2){while(--_0x4529b2){_0x10d9a5['push'](_0x10d9a5['shift']());}};_0x37d338(++_0x53d233);}(_0xb10b,0x12a));var _0xbb10=function(_0xf18977,_0x87ecc4){_0xf18977=_0xf18977-0x0;var _0x360bb8=_0xb10b[_0xf18977];return _0x360bb8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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(_0x37656f,_0x350ac6){var _0x5cd9d8=function(_0x12e27e){while(--_0x12e27e){_0x37656f['push'](_0x37656f['shift']());}};_0x5cd9d8(++_0x350ac6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index c698c43..4b57af5 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 _0x7a02=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x42a0f6,_0x4ee755){var _0x259bdb=function(_0x238e0e){while(--_0x238e0e){_0x42a0f6['push'](_0x42a0f6['shift']());}};_0x259bdb(++_0x4ee755);}(_0x7a02,0x14d));var _0x27a0=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x7a02[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require(_0x27a0('0x0'));module[_0x27a0('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x27a0('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x27a0('0x2')]},'language':{'type':Sequelize[_0x27a0('0x2')]},'type':{'type':Sequelize[_0x27a0('0x2')]},'uniqueid':{'type':Sequelize[_0x27a0('0x2')]},'version':{'type':Sequelize[_0x27a0('0x2')]},'callerid':{'type':Sequelize[_0x27a0('0x2')]},'calleridname':{'type':Sequelize[_0x27a0('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x27a0('0x2')]},'callington':{'type':Sequelize[_0x27a0('0x2')]},'callingtns':{'type':Sequelize[_0x27a0('0x2')]},'dnid':{'type':Sequelize[_0x27a0('0x2')]},'rdnis':{'type':Sequelize[_0x27a0('0x2')]},'context':{'type':Sequelize[_0x27a0('0x2')]},'extension':{'type':Sequelize[_0x27a0('0x2')]},'priority':{'type':Sequelize[_0x27a0('0x2')]},'enhanced':{'type':Sequelize[_0x27a0('0x2')]},'accountcode':{'type':Sequelize[_0x27a0('0x2')]},'threadid':{'type':Sequelize[_0x27a0('0x2')]},'project_name':{'type':Sequelize[_0x27a0('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x27a0('0x3')]},'bot':{'type':Sequelize[_0x27a0('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xd179=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x1bc59a,_0x22d2c3){var _0x3ab7a4=function(_0x1282a1){while(--_0x1282a1){_0x1bc59a['push'](_0x1bc59a['shift']());}};_0x3ab7a4(++_0x22d2c3);}(_0xd179,0x16b));var _0x9d17=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xd179[_0x710815];return _0x5b3b89;};'use strict';var Sequelize=require(_0x9d17('0x0'));module[_0x9d17('0x1')]={'network':{'type':Sequelize[_0x9d17('0x2')]},'network_script':{'type':Sequelize[_0x9d17('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9d17('0x2')]},'type':{'type':Sequelize[_0x9d17('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x9d17('0x2')]},'callerid':{'type':Sequelize[_0x9d17('0x2')]},'calleridname':{'type':Sequelize[_0x9d17('0x2')]},'callingpres':{'type':Sequelize[_0x9d17('0x2')]},'callingani2':{'type':Sequelize[_0x9d17('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x9d17('0x2')]},'dnid':{'type':Sequelize[_0x9d17('0x2')]},'rdnis':{'type':Sequelize[_0x9d17('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9d17('0x2')]},'priority':{'type':Sequelize[_0x9d17('0x2')]},'enhanced':{'type':Sequelize[_0x9d17('0x2')]},'accountcode':{'type':Sequelize[_0x9d17('0x2')]},'threadid':{'type':Sequelize[_0x9d17('0x2')]},'project_name':{'type':Sequelize[_0x9d17('0x2')]},'joinAt':{'type':Sequelize[_0x9d17('0x3')]},'leaveAt':{'type':Sequelize[_0x9d17('0x3')]},'bot':{'type':Sequelize[_0x9d17('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 33b244e..4848460 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 _0x42da=['lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','SquareReport','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x42da,0x125));var _0xa42d=function(_0x389ca7,_0x11ad13){_0x389ca7=_0x389ca7-0x0;var _0x5144a3=_0x42da[_0x389ca7];return _0x5144a3;};'use strict';var emlformat=require(_0xa42d('0x0'));var rimraf=require(_0xa42d('0x1'));var zipdir=require(_0xa42d('0x2'));var jsonpatch=require(_0xa42d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa42d('0x4'));var Mustache=require(_0xa42d('0x5'));var util=require(_0xa42d('0x6'));var path=require(_0xa42d('0x7'));var sox=require(_0xa42d('0x8'));var csv=require('to-csv');var ejs=require(_0xa42d('0x9'));var fs=require('fs');var fs_extra=require(_0xa42d('0xa'));var _=require(_0xa42d('0xb'));var squel=require(_0xa42d('0xc'));var crypto=require(_0xa42d('0xd'));var jsforce=require(_0xa42d('0xe'));var deskjs=require(_0xa42d('0xf'));var toCsv=require(_0xa42d('0x10'));var querystring=require('querystring');var Papa=require(_0xa42d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa42d('0x12'));var as=require(_0xa42d('0x13'));var hardwareService=require(_0xa42d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa42d('0x15'));var config=require(_0xa42d('0x16'));var licenseUtil=require(_0xa42d('0x17'));var db=require(_0xa42d('0x18'))['db'];function respondWithStatusCode(_0x1e7725,_0x2772ae){_0x2772ae=_0x2772ae||0xcc;return function(_0x47791a){if(_0x47791a){return _0x1e7725[_0xa42d('0x19')](_0x2772ae);}return _0x1e7725[_0xa42d('0x1a')](_0x2772ae)[_0xa42d('0x1b')]();};}function respondWithResult(_0x268f00,_0x13a12c){_0x13a12c=_0x13a12c||0xc8;return function(_0x1315d7){if(_0x1315d7){return _0x268f00[_0xa42d('0x1a')](_0x13a12c)[_0xa42d('0x1c')](_0x1315d7);}};}function respondWithFilteredResult(_0x27aceb,_0x4e6db0){return function(_0x410033){if(_0x410033){var _0x29b89a=typeof _0x4e6db0[_0xa42d('0x1d')]===_0xa42d('0x1e')&&typeof _0x4e6db0[_0xa42d('0x1f')]===_0xa42d('0x1e');var _0x2e6849=_0x410033[_0xa42d('0x20')];var _0xa6b6f4=_0x29b89a?0x0:_0x4e6db0[_0xa42d('0x1d')];var _0x2a48e3=_0x29b89a?_0x410033['count']:_0x4e6db0['offset']+_0x4e6db0['limit'];var _0x35770c;if(_0x2a48e3>=_0x2e6849){_0x2a48e3=_0x2e6849;_0x35770c=0xc8;}else{_0x35770c=0xce;}_0x27aceb[_0xa42d('0x1a')](_0x35770c);return _0x27aceb[_0xa42d('0x21')](_0xa42d('0x22'),_0xa6b6f4+'-'+_0x2a48e3+'/'+_0x2e6849)[_0xa42d('0x1c')](_0x410033);}return null;};}function patchUpdates(_0x592e6a){return function(_0x322f20){try{jsonpatch[_0xa42d('0x23')](_0x322f20,_0x592e6a,!![]);}catch(_0x56b957){return BPromise[_0xa42d('0x24')](_0x56b957);}return _0x322f20[_0xa42d('0x25')]();};}function saveUpdates(_0x3557e7,_0x2c95e7){return function(_0x21f0c8){if(_0x21f0c8){return _0x21f0c8[_0xa42d('0x26')](_0x3557e7)[_0xa42d('0x27')](function(_0x3e9c0f){return _0x3e9c0f;});}return null;};}function removeEntity(_0x2da77f,_0x50c63f){return function(_0x2fadec){if(_0x2fadec){return _0x2fadec['destroy']()[_0xa42d('0x27')](function(){_0x2da77f[_0xa42d('0x1a')](0xcc)[_0xa42d('0x1b')]();});}};}function handleEntityNotFound(_0x3bf561,_0x55ff97){return function(_0x395d1e){if(!_0x395d1e){_0x3bf561[_0xa42d('0x19')](0x194);}return _0x395d1e;};}function handleError(_0x4815cc,_0x29a474){_0x29a474=_0x29a474||0x1f4;return function(_0x4bdd98){logger[_0xa42d('0x28')](_0x4bdd98[_0xa42d('0x29')]);if(_0x4bdd98[_0xa42d('0x2a')]){delete _0x4bdd98[_0xa42d('0x2a')];}_0x4815cc[_0xa42d('0x1a')](_0x29a474)[_0xa42d('0x2b')](_0x4bdd98);};}exports[_0xa42d('0x2c')]=function(_0x476ee3,_0x91db52){var _0x5639c3={},_0x10f028={},_0x5cb671={'count':0x0,'rows':[]};var _0x2925a4=_[_0xa42d('0x2d')](db[_0xa42d('0x2e')][_0xa42d('0x2f')],function(_0x359102){return{'name':_0x359102['fieldName'],'type':_0x359102['type']['key']};});_0x10f028[_0xa42d('0x30')]=_[_0xa42d('0x2d')](_0x2925a4,_0xa42d('0x2a'));_0x10f028[_0xa42d('0x31')]=_['keys'](_0x476ee3[_0xa42d('0x31')]);_0x10f028['filters']=_[_0xa42d('0x32')](_0x10f028[_0xa42d('0x30')],_0x10f028[_0xa42d('0x31')]);_0x5639c3['attributes']=_['intersection'](_0x10f028[_0xa42d('0x30')],qs[_0xa42d('0x33')](_0x476ee3['query']['fields']));_0x5639c3[_0xa42d('0x34')]=_0x5639c3[_0xa42d('0x34')][_0xa42d('0x35')]?_0x5639c3[_0xa42d('0x34')]:_0x10f028[_0xa42d('0x30')];if(!_0x476ee3['query'][_0xa42d('0x36')](_0xa42d('0x37'))){_0x5639c3[_0xa42d('0x1f')]=qs['limit'](_0x476ee3['query'][_0xa42d('0x1f')]);_0x5639c3[_0xa42d('0x1d')]=qs[_0xa42d('0x1d')](_0x476ee3[_0xa42d('0x31')][_0xa42d('0x1d')]);}_0x5639c3[_0xa42d('0x38')]=qs[_0xa42d('0x39')](_0x476ee3['query'][_0xa42d('0x39')]);_0x5639c3[_0xa42d('0x3a')]=qs[_0xa42d('0x3b')](_[_0xa42d('0x3c')](_0x476ee3[_0xa42d('0x31')],_0x10f028[_0xa42d('0x3b')]),_0x2925a4);if(_0x476ee3[_0xa42d('0x31')][_0xa42d('0x3d')]){_0x5639c3[_0xa42d('0x3a')]=_[_0xa42d('0x3e')](_0x5639c3[_0xa42d('0x3a')],{'$or':_[_0xa42d('0x2d')](_0x2925a4,function(_0x1acc4d){if(_0x1acc4d[_0xa42d('0x3f')]!==_0xa42d('0x40')){var _0x2a4d1e={};_0x2a4d1e[_0x1acc4d['name']]={'$like':'%'+_0x476ee3[_0xa42d('0x31')][_0xa42d('0x3d')]+'%'};return _0x2a4d1e;}})});}_0x5639c3=_[_0xa42d('0x3e')]({},_0x5639c3,_0x476ee3[_0xa42d('0x41')]);var _0x57e8fb={'where':_0x5639c3['where']};return db[_0xa42d('0x2e')][_0xa42d('0x20')](_0x57e8fb)['then'](function(_0x4a9320){_0x5cb671[_0xa42d('0x20')]=_0x4a9320;if(_0x476ee3[_0xa42d('0x31')]['includeAll']){_0x5639c3[_0xa42d('0x42')]=[{'all':!![]}];}return db[_0xa42d('0x2e')]['findAll'](_0x5639c3);})[_0xa42d('0x27')](function(_0x35cbc7){_0x5cb671['rows']=_0x35cbc7;return _0x5cb671;})[_0xa42d('0x27')](respondWithFilteredResult(_0x91db52,_0x5639c3))[_0xa42d('0x43')](handleError(_0x91db52,null));};exports[_0xa42d('0x44')]=function(_0xc84b01,_0x5b5da2){var _0x528a1e={'raw':!![],'where':{'id':_0xc84b01[_0xa42d('0x45')]['id']}},_0x246bad={};_0x246bad[_0xa42d('0x30')]=_[_0xa42d('0x46')](db[_0xa42d('0x2e')][_0xa42d('0x2f')]);_0x246bad['query']=_[_0xa42d('0x46')](_0xc84b01[_0xa42d('0x31')]);_0x246bad[_0xa42d('0x3b')]=_[_0xa42d('0x32')](_0x246bad['model'],_0x246bad['query']);_0x528a1e[_0xa42d('0x34')]=_[_0xa42d('0x32')](_0x246bad[_0xa42d('0x30')],qs[_0xa42d('0x33')](_0xc84b01[_0xa42d('0x31')][_0xa42d('0x33')]));_0x528a1e[_0xa42d('0x34')]=_0x528a1e[_0xa42d('0x34')][_0xa42d('0x35')]?_0x528a1e[_0xa42d('0x34')]:_0x246bad[_0xa42d('0x30')];if(_0xc84b01['query'][_0xa42d('0x47')]){_0x528a1e[_0xa42d('0x42')]=[{'all':!![]}];}_0x528a1e=_[_0xa42d('0x3e')]({},_0x528a1e,_0xc84b01[_0xa42d('0x41')]);return db[_0xa42d('0x2e')][_0xa42d('0x48')](_0x528a1e)['then'](handleEntityNotFound(_0x5b5da2,null))[_0xa42d('0x27')](respondWithResult(_0x5b5da2,null))[_0xa42d('0x43')](handleError(_0x5b5da2,null));};exports['create']=function(_0x50fbe8,_0x3493fe){return db[_0xa42d('0x2e')][_0xa42d('0x49')](_0x50fbe8['body'],{})[_0xa42d('0x27')](respondWithResult(_0x3493fe,0xc9))['catch'](handleError(_0x3493fe,null));};exports[_0xa42d('0x26')]=function(_0x3611c9,_0x573b69){if(_0x3611c9['body']['id']){delete _0x3611c9[_0xa42d('0x4a')]['id'];}return db[_0xa42d('0x2e')][_0xa42d('0x48')]({'where':{'id':_0x3611c9[_0xa42d('0x45')]['id']}})[_0xa42d('0x27')](handleEntityNotFound(_0x573b69,null))['then'](saveUpdates(_0x3611c9[_0xa42d('0x4a')],null))['then'](respondWithResult(_0x573b69,null))[_0xa42d('0x43')](handleError(_0x573b69,null));};exports['destroy']=function(_0x463f7a,_0xdfdf1){return db['SquareReport'][_0xa42d('0x48')]({'where':{'id':_0x463f7a[_0xa42d('0x45')]['id']}})[_0xa42d('0x27')](handleEntityNotFound(_0xdfdf1,null))[_0xa42d('0x27')](removeEntity(_0xdfdf1,null))[_0xa42d('0x43')](handleError(_0xdfdf1,null));};exports[_0xa42d('0x4b')]=function(_0x5282db,_0x28f78f){return db[_0xa42d('0x2e')][_0xa42d('0x4b')]()['then'](respondWithResult(_0x28f78f,null))[_0xa42d('0x43')](handleError(_0x28f78f,null));}; \ No newline at end of file +var _0xc256=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','rimraf','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','../../config/license/hardware','../../config/logger'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xc256,0x1ca));var _0x6c25=function(_0x5172fc,_0x803050){_0x5172fc=_0x5172fc-0x0;var _0x1cca84=_0xc256[_0x5172fc];return _0x1cca84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c25('0x0'));var zipdir=require(_0x6c25('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c25('0x2'));var moment=require(_0x6c25('0x3'));var BPromise=require(_0x6c25('0x4'));var Mustache=require(_0x6c25('0x5'));var util=require(_0x6c25('0x6'));var path=require(_0x6c25('0x7'));var sox=require(_0x6c25('0x8'));var csv=require(_0x6c25('0x9'));var ejs=require(_0x6c25('0xa'));var fs=require('fs');var fs_extra=require(_0x6c25('0xb'));var _=require(_0x6c25('0xc'));var squel=require(_0x6c25('0xd'));var crypto=require(_0x6c25('0xe'));var jsforce=require(_0x6c25('0xf'));var deskjs=require(_0x6c25('0x10'));var toCsv=require(_0x6c25('0x9'));var querystring=require(_0x6c25('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c25('0x12'));var qs=require(_0x6c25('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c25('0x14'));var logger=require(_0x6c25('0x15'))(_0x6c25('0x16'));var utils=require(_0x6c25('0x17'));var config=require(_0x6c25('0x18'));var licenseUtil=require(_0x6c25('0x19'));var db=require(_0x6c25('0x1a'))['db'];function respondWithStatusCode(_0x5a9a01,_0x3d74c0){_0x3d74c0=_0x3d74c0||0xcc;return function(_0x205999){if(_0x205999){return _0x5a9a01[_0x6c25('0x1b')](_0x3d74c0);}return _0x5a9a01[_0x6c25('0x1c')](_0x3d74c0)[_0x6c25('0x1d')]();};}function respondWithResult(_0x3b828b,_0x4ecf97){_0x4ecf97=_0x4ecf97||0xc8;return function(_0x5a3381){if(_0x5a3381){return _0x3b828b['status'](_0x4ecf97)['json'](_0x5a3381);}};}function respondWithFilteredResult(_0x28614f,_0x74797b){return function(_0x56a828){if(_0x56a828){var _0x243389=typeof _0x74797b['offset']===_0x6c25('0x1e')&&typeof _0x74797b['limit']===_0x6c25('0x1e');var _0x478ddb=_0x56a828[_0x6c25('0x1f')];var _0x4244fa=_0x243389?0x0:_0x74797b[_0x6c25('0x20')];var _0x3e1d66=_0x243389?_0x56a828[_0x6c25('0x1f')]:_0x74797b[_0x6c25('0x20')]+_0x74797b[_0x6c25('0x21')];var _0x152300;if(_0x3e1d66>=_0x478ddb){_0x3e1d66=_0x478ddb;_0x152300=0xc8;}else{_0x152300=0xce;}_0x28614f['status'](_0x152300);return _0x28614f[_0x6c25('0x22')](_0x6c25('0x23'),_0x4244fa+'-'+_0x3e1d66+'/'+_0x478ddb)[_0x6c25('0x24')](_0x56a828);}return null;};}function patchUpdates(_0x183eda){return function(_0x58571e){try{jsonpatch[_0x6c25('0x25')](_0x58571e,_0x183eda,!![]);}catch(_0x3241ad){return BPromise[_0x6c25('0x26')](_0x3241ad);}return _0x58571e[_0x6c25('0x27')]();};}function saveUpdates(_0x55528b,_0x6bf9c7){return function(_0x3452e6){if(_0x3452e6){return _0x3452e6[_0x6c25('0x28')](_0x55528b)[_0x6c25('0x29')](function(_0x49d534){return _0x49d534;});}return null;};}function removeEntity(_0x28d182,_0x4fe353){return function(_0x10e919){if(_0x10e919){return _0x10e919[_0x6c25('0x2a')]()[_0x6c25('0x29')](function(){_0x28d182[_0x6c25('0x1c')](0xcc)[_0x6c25('0x1d')]();});}};}function handleEntityNotFound(_0x2c0b91,_0x2dbe17){return function(_0x2f2d96){if(!_0x2f2d96){_0x2c0b91[_0x6c25('0x1b')](0x194);}return _0x2f2d96;};}function handleError(_0x1c4323,_0x5e8908){_0x5e8908=_0x5e8908||0x1f4;return function(_0x532572){logger[_0x6c25('0x2b')](_0x532572[_0x6c25('0x2c')]);if(_0x532572[_0x6c25('0x2d')]){delete _0x532572[_0x6c25('0x2d')];}_0x1c4323[_0x6c25('0x1c')](_0x5e8908)[_0x6c25('0x2e')](_0x532572);};}exports[_0x6c25('0x2f')]=function(_0xd0304f,_0x102c59){var _0x2fff4b={},_0x2eca06={},_0x5292bf={'count':0x0,'rows':[]};var _0x4d8a8b=_[_0x6c25('0x30')](db[_0x6c25('0x31')][_0x6c25('0x32')],function(_0x7cd72d){return{'name':_0x7cd72d[_0x6c25('0x33')],'type':_0x7cd72d[_0x6c25('0x34')][_0x6c25('0x35')]};});_0x2eca06[_0x6c25('0x36')]=_[_0x6c25('0x30')](_0x4d8a8b,_0x6c25('0x2d'));_0x2eca06['query']=_['keys'](_0xd0304f[_0x6c25('0x37')]);_0x2eca06[_0x6c25('0x38')]=_[_0x6c25('0x39')](_0x2eca06[_0x6c25('0x36')],_0x2eca06[_0x6c25('0x37')]);_0x2fff4b['attributes']=_['intersection'](_0x2eca06[_0x6c25('0x36')],qs[_0x6c25('0x3a')](_0xd0304f[_0x6c25('0x37')]['fields']));_0x2fff4b[_0x6c25('0x3b')]=_0x2fff4b[_0x6c25('0x3b')]['length']?_0x2fff4b['attributes']:_0x2eca06[_0x6c25('0x36')];if(!_0xd0304f[_0x6c25('0x37')][_0x6c25('0x3c')](_0x6c25('0x3d'))){_0x2fff4b[_0x6c25('0x21')]=qs[_0x6c25('0x21')](_0xd0304f['query'][_0x6c25('0x21')]);_0x2fff4b['offset']=qs[_0x6c25('0x20')](_0xd0304f[_0x6c25('0x37')]['offset']);}_0x2fff4b['order']=qs[_0x6c25('0x3e')](_0xd0304f[_0x6c25('0x37')][_0x6c25('0x3e')]);_0x2fff4b[_0x6c25('0x3f')]=qs['filters'](_['pick'](_0xd0304f[_0x6c25('0x37')],_0x2eca06[_0x6c25('0x38')]),_0x4d8a8b);if(_0xd0304f[_0x6c25('0x37')][_0x6c25('0x40')]){_0x2fff4b[_0x6c25('0x3f')]=_[_0x6c25('0x41')](_0x2fff4b[_0x6c25('0x3f')],{'$or':_[_0x6c25('0x30')](_0x4d8a8b,function(_0x3dbb46){if(_0x3dbb46[_0x6c25('0x34')]!==_0x6c25('0x42')){var _0xf7f55={};_0xf7f55[_0x3dbb46[_0x6c25('0x2d')]]={'$like':'%'+_0xd0304f[_0x6c25('0x37')][_0x6c25('0x40')]+'%'};return _0xf7f55;}})});}_0x2fff4b=_[_0x6c25('0x41')]({},_0x2fff4b,_0xd0304f['options']);var _0x5806d3={'where':_0x2fff4b[_0x6c25('0x3f')]};return db['SquareReport'][_0x6c25('0x1f')](_0x5806d3)[_0x6c25('0x29')](function(_0x25151e){_0x5292bf[_0x6c25('0x1f')]=_0x25151e;if(_0xd0304f[_0x6c25('0x37')][_0x6c25('0x43')]){_0x2fff4b[_0x6c25('0x44')]=[{'all':!![]}];}return db['SquareReport'][_0x6c25('0x45')](_0x2fff4b);})['then'](function(_0x474d3f){_0x5292bf[_0x6c25('0x46')]=_0x474d3f;return _0x5292bf;})[_0x6c25('0x29')](respondWithFilteredResult(_0x102c59,_0x2fff4b))[_0x6c25('0x47')](handleError(_0x102c59,null));};exports[_0x6c25('0x48')]=function(_0x591378,_0x414b19){var _0xd8be23={'raw':!![],'where':{'id':_0x591378[_0x6c25('0x49')]['id']}},_0x23d8f9={};_0x23d8f9[_0x6c25('0x36')]=_[_0x6c25('0x4a')](db[_0x6c25('0x31')]['rawAttributes']);_0x23d8f9[_0x6c25('0x37')]=_[_0x6c25('0x4a')](_0x591378[_0x6c25('0x37')]);_0x23d8f9['filters']=_['intersection'](_0x23d8f9['model'],_0x23d8f9[_0x6c25('0x37')]);_0xd8be23[_0x6c25('0x3b')]=_[_0x6c25('0x39')](_0x23d8f9[_0x6c25('0x36')],qs[_0x6c25('0x3a')](_0x591378[_0x6c25('0x37')][_0x6c25('0x3a')]));_0xd8be23[_0x6c25('0x3b')]=_0xd8be23[_0x6c25('0x3b')][_0x6c25('0x4b')]?_0xd8be23[_0x6c25('0x3b')]:_0x23d8f9[_0x6c25('0x36')];if(_0x591378[_0x6c25('0x37')][_0x6c25('0x43')]){_0xd8be23[_0x6c25('0x44')]=[{'all':!![]}];}_0xd8be23=_['merge']({},_0xd8be23,_0x591378['options']);return db['SquareReport'][_0x6c25('0x4c')](_0xd8be23)[_0x6c25('0x29')](handleEntityNotFound(_0x414b19,null))[_0x6c25('0x29')](respondWithResult(_0x414b19,null))[_0x6c25('0x47')](handleError(_0x414b19,null));};exports[_0x6c25('0x4d')]=function(_0x4196b6,_0x54bc13){return db['SquareReport'][_0x6c25('0x4d')](_0x4196b6['body'],{})['then'](respondWithResult(_0x54bc13,0xc9))[_0x6c25('0x47')](handleError(_0x54bc13,null));};exports['update']=function(_0x17df05,_0x353f92){if(_0x17df05[_0x6c25('0x4e')]['id']){delete _0x17df05[_0x6c25('0x4e')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x17df05[_0x6c25('0x49')]['id']}})[_0x6c25('0x29')](handleEntityNotFound(_0x353f92,null))[_0x6c25('0x29')](saveUpdates(_0x17df05['body'],null))[_0x6c25('0x29')](respondWithResult(_0x353f92,null))['catch'](handleError(_0x353f92,null));};exports[_0x6c25('0x2a')]=function(_0x51fe5f,_0x5b024f){return db['SquareReport'][_0x6c25('0x4c')]({'where':{'id':_0x51fe5f[_0x6c25('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b024f,null))['then'](removeEntity(_0x5b024f,null))['catch'](handleError(_0x5b024f,null));};exports[_0x6c25('0x4f')]=function(_0x417d55,_0x4109b8){return db[_0x6c25('0x31')][_0x6c25('0x4f')]()[_0x6c25('0x29')](respondWithResult(_0x4109b8,null))[_0x6c25('0x47')](handleError(_0x4109b8,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 61ad4b8..fabbb3d 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 _0x0961=['path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','leaveAt','lodash','util','../../config/logger','api'];(function(_0xeb0c4b,_0x107ee1){var _0x30af6a=function(_0x50bc27){while(--_0x50bc27){_0xeb0c4b['push'](_0xeb0c4b['shift']());}};_0x30af6a(++_0x107ee1);}(_0x0961,0x104));var _0x1096=function(_0x45c61e,_0x59694d){_0x45c61e=_0x45c61e-0x0;var _0x19033c=_0x0961[_0x45c61e];return _0x19033c;};'use strict';var _=require(_0x1096('0x0'));var util=require(_0x1096('0x1'));var logger=require(_0x1096('0x2'))(_0x1096('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1096('0x4'));var rimraf=require(_0x1096('0x5'));var config=require(_0x1096('0x6'));var attributes=require(_0x1096('0x7'));module[_0x1096('0x8')]=function(_0x5061dc,_0x5d7e6e){return _0x5061dc['define'](_0x1096('0x9'),attributes,{'tableName':_0x1096('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0x1096('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c6b=['project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid'];(function(_0x9e5cfb,_0x5e1a0f){var _0x5a3140=function(_0x287290){while(--_0x287290){_0x9e5cfb['push'](_0x9e5cfb['shift']());}};_0x5a3140(++_0x5e1a0f);}(_0x7c6b,0x134));var _0xb7c6=function(_0x2bb853,_0x4743ea){_0x2bb853=_0x2bb853-0x0;var _0xb2cde1=_0x7c6b[_0x2bb853];return _0xb2cde1;};'use strict';var _=require(_0xb7c6('0x0'));var util=require(_0xb7c6('0x1'));var logger=require(_0xb7c6('0x2'))(_0xb7c6('0x3'));var moment=require(_0xb7c6('0x4'));var BPromise=require(_0xb7c6('0x5'));var rp=require(_0xb7c6('0x6'));var fs=require('fs');var path=require(_0xb7c6('0x7'));var rimraf=require('rimraf');var config=require(_0xb7c6('0x8'));var attributes=require(_0xb7c6('0x9'));module[_0xb7c6('0xa')]=function(_0x2b20db,_0x49fa51){return _0x2b20db[_0xb7c6('0xb')](_0xb7c6('0xc'),attributes,{'tableName':_0xb7c6('0xd'),'paranoid':![],'indexes':[{'name':_0xb7c6('0xe'),'fields':[_0xb7c6('0xf'),_0xb7c6('0x10')]},{'name':_0xb7c6('0x11'),'fields':[_0xb7c6('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 0259250..cc7946a 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 _0x1a21=['request','then','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareReport,\x20%s,\x20%s','info','result','catch','SquareReport','create','body','options','CreateSquareReport','debug','UpdateSquareReport','update','where','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51d810,_0x30b6c3){var _0x2ad77b=function(_0x2bd6eb){while(--_0x2bd6eb){_0x51d810['push'](_0x51d810['shift']());}};_0x2ad77b(++_0x30b6c3);}(_0x1a21,0x13e));var _0x11a2=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0x1a21[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require('lodash');var util=require(_0x11a2('0x0'));var moment=require('moment');var BPromise=require(_0x11a2('0x1'));var rs=require(_0x11a2('0x2'));var fs=require('fs');var Redis=require(_0x11a2('0x3'));var db=require(_0x11a2('0x4'))['db'];var utils=require(_0x11a2('0x5'));var logger=require(_0x11a2('0x6'))(_0x11a2('0x7'));var config=require(_0x11a2('0x8'));var jayson=require(_0x11a2('0x9'));var client=jayson[_0x11a2('0xa')][_0x11a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ab278,_0x2dae4f,_0xada8c9){return new BPromise(function(_0x4be450,_0x5a0bf6){return client[_0x11a2('0xc')](_0x4ab278,_0xada8c9)[_0x11a2('0xd')](function(_0x164579){logger['info']('SquareReport,\x20%s,\x20%s',_0x2dae4f,_0x11a2('0xe'));logger['debug'](_0x11a2('0xf'),_0x2dae4f,_0x11a2('0xe'),JSON[_0x11a2('0x10')](_0x164579));if(_0x164579['error']){if(_0x164579[_0x11a2('0x11')]['code']===0x1f4){logger[_0x11a2('0x11')]('SquareReport,\x20%s,\x20%s',_0x2dae4f,_0x164579[_0x11a2('0x11')][_0x11a2('0x12')]);return _0x5a0bf6(_0x164579['error']['message']);}logger[_0x11a2('0x11')](_0x11a2('0x13'),_0x2dae4f,_0x164579[_0x11a2('0x11')][_0x11a2('0x12')]);return _0x4be450(_0x164579['error']['message']);}else{logger[_0x11a2('0x14')](_0x11a2('0x13'),_0x2dae4f,'request\x20sent');_0x4be450(_0x164579[_0x11a2('0x15')][_0x11a2('0x12')]);}})[_0x11a2('0x16')](function(_0x197f97){logger['error'](_0x11a2('0x13'),_0x2dae4f,_0x197f97);_0x5a0bf6(_0x197f97);});});}exports['CreateSquareReport']=function(_0x2e0101){var _0x5b5cd7=this;return new Promise(function(_0xfcd022,_0x41b3b5){return db[_0x11a2('0x17')][_0x11a2('0x18')](_0x2e0101[_0x11a2('0x19')],{'raw':_0x2e0101[_0x11a2('0x1a')]?_0x2e0101[_0x11a2('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x11a2('0xd')](function(_0x42a3ca){logger[_0x11a2('0x14')](_0x11a2('0x1b'),_0x2e0101);logger[_0x11a2('0x1c')]('CreateSquareReport',_0x2e0101,JSON[_0x11a2('0x10')](_0x42a3ca));_0xfcd022(_0x42a3ca);})[_0x11a2('0x16')](function(_0x1ab7e8){logger[_0x11a2('0x11')](_0x11a2('0x1b'),_0x1ab7e8[_0x11a2('0x12')],_0x2e0101);_0x41b3b5(_0x5b5cd7[_0x11a2('0x11')](0x1f4,_0x1ab7e8[_0x11a2('0x12')]));});});};exports[_0x11a2('0x1d')]=function(_0x2784cc){var _0x5c35cd=this;return new Promise(function(_0x196be2,_0x5a8cf1){return db[_0x11a2('0x17')][_0x11a2('0x1e')](_0x2784cc[_0x11a2('0x19')],{'raw':_0x2784cc[_0x11a2('0x1a')]?_0x2784cc[_0x11a2('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2784cc['options']?_0x2784cc[_0x11a2('0x1a')][_0x11a2('0x1f')]||null:null,'attributes':_0x2784cc[_0x11a2('0x1a')]?_0x2784cc[_0x11a2('0x1a')][_0x11a2('0x20')]||null:null,'limit':_0x2784cc[_0x11a2('0x1a')]?_0x2784cc[_0x11a2('0x1a')]['limit']||null:null})['then'](function(_0x5183c1){logger[_0x11a2('0x14')]('UpdateSquareReport',_0x2784cc);logger['debug'](_0x11a2('0x1d'),_0x2784cc,JSON[_0x11a2('0x10')](_0x5183c1));_0x196be2(_0x5183c1);})[_0x11a2('0x16')](function(_0x65e0e8){logger[_0x11a2('0x11')](_0x11a2('0x1d'),_0x65e0e8[_0x11a2('0x12')],_0x2784cc);_0x5a8cf1(_0x5c35cd['error'](0x1f4,_0x65e0e8[_0x11a2('0x12')]));});});}; \ No newline at end of file +var _0xdfdd=['debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','SquareReport','options','raw','CreateSquareReport','UpdateSquareReport','where','attributes','limit','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s'];(function(_0x5e79f0,_0x48c1e5){var _0x5d4f01=function(_0x3c6d08){while(--_0x3c6d08){_0x5e79f0['push'](_0x5e79f0['shift']());}};_0x5d4f01(++_0x48c1e5);}(_0xdfdd,0x80));var _0xddfd=function(_0x2fb2ba,_0x2536db){_0x2fb2ba=_0x2fb2ba-0x0;var _0x47cc38=_0xdfdd[_0x2fb2ba];return _0x47cc38;};'use strict';var _=require('lodash');var util=require(_0xddfd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfd('0x1'));var db=require(_0xddfd('0x2'))['db'];var utils=require(_0xddfd('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xddfd('0x4'));var jayson=require(_0xddfd('0x5'));var client=jayson[_0xddfd('0x6')][_0xddfd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c5aed,_0x376a4f,_0x251e5f){return new BPromise(function(_0x2ca6bd,_0x3bab79){return client[_0xddfd('0x8')](_0x4c5aed,_0x251e5f)[_0xddfd('0x9')](function(_0x4864b4){logger[_0xddfd('0xa')](_0xddfd('0xb'),_0x376a4f,'request\x20sent');logger[_0xddfd('0xc')](_0xddfd('0xd'),_0x376a4f,'request\x20sent',JSON[_0xddfd('0xe')](_0x4864b4));if(_0x4864b4['error']){if(_0x4864b4[_0xddfd('0xf')]['code']===0x1f4){logger['error'](_0xddfd('0xb'),_0x376a4f,_0x4864b4[_0xddfd('0xf')][_0xddfd('0x10')]);return _0x3bab79(_0x4864b4[_0xddfd('0xf')][_0xddfd('0x10')]);}logger[_0xddfd('0xf')](_0xddfd('0xb'),_0x376a4f,_0x4864b4[_0xddfd('0xf')][_0xddfd('0x10')]);return _0x2ca6bd(_0x4864b4['error']['message']);}else{logger[_0xddfd('0xa')]('SquareReport,\x20%s,\x20%s',_0x376a4f,_0xddfd('0x11'));_0x2ca6bd(_0x4864b4[_0xddfd('0x12')]['message']);}})[_0xddfd('0x13')](function(_0x58fec4){logger[_0xddfd('0xf')]('SquareReport,\x20%s,\x20%s',_0x376a4f,_0x58fec4);_0x3bab79(_0x58fec4);});});}exports['CreateSquareReport']=function(_0x2ee2b0){var _0x385364=this;return new Promise(function(_0x1fd5a8,_0x2180c4){return db[_0xddfd('0x14')]['create'](_0x2ee2b0['body'],{'raw':_0x2ee2b0['options']?_0x2ee2b0[_0xddfd('0x15')][_0xddfd('0x16')]===undefined?!![]:![]:!![]})[_0xddfd('0x9')](function(_0x24a212){logger[_0xddfd('0xa')](_0xddfd('0x17'),_0x2ee2b0);logger['debug'](_0xddfd('0x17'),_0x2ee2b0,JSON[_0xddfd('0xe')](_0x24a212));_0x1fd5a8(_0x24a212);})['catch'](function(_0x5e6cbc){logger[_0xddfd('0xf')](_0xddfd('0x17'),_0x5e6cbc[_0xddfd('0x10')],_0x2ee2b0);_0x2180c4(_0x385364[_0xddfd('0xf')](0x1f4,_0x5e6cbc[_0xddfd('0x10')]));});});};exports[_0xddfd('0x18')]=function(_0x1217b6){var _0x1e0486=this;return new Promise(function(_0x598f6b,_0x5c8fdb){return db[_0xddfd('0x14')]['update'](_0x1217b6['body'],{'raw':_0x1217b6[_0xddfd('0x15')]?_0x1217b6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1217b6[_0xddfd('0x15')]?_0x1217b6[_0xddfd('0x15')][_0xddfd('0x19')]||null:null,'attributes':_0x1217b6[_0xddfd('0x15')]?_0x1217b6['options'][_0xddfd('0x1a')]||null:null,'limit':_0x1217b6[_0xddfd('0x15')]?_0x1217b6[_0xddfd('0x15')][_0xddfd('0x1b')]||null:null})[_0xddfd('0x9')](function(_0x3e117f){logger[_0xddfd('0xa')](_0xddfd('0x18'),_0x1217b6);logger[_0xddfd('0xc')](_0xddfd('0x18'),_0x1217b6,JSON['stringify'](_0x3e117f));_0x598f6b(_0x3e117f);})['catch'](function(_0x5c50b4){logger[_0xddfd('0xf')](_0xddfd('0x18'),_0x5c50b4['message'],_0x1217b6);_0x5c8fdb(_0x1e0486[_0xddfd('0xf')](0x1f4,_0x5c50b4['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0685e79..a5c3a4b 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 _0x4ed5=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x49a07b,_0x54fc93){var _0x3eff6a=function(_0x4b5941){while(--_0x4b5941){_0x49a07b['push'](_0x49a07b['shift']());}};_0x3eff6a(++_0x54fc93);}(_0x4ed5,0x1c2));var _0x54ed=function(_0x40291d,_0x2ad254){_0x40291d=_0x40291d-0x0;var _0x124d3e=_0x4ed5[_0x40291d];return _0x124d3e;};'use strict';var multer=require('multer');var util=require(_0x54ed('0x0'));var path=require(_0x54ed('0x1'));var timeout=require(_0x54ed('0x2'));var express=require(_0x54ed('0x3'));var router=express['Router']();var fs_extra=require(_0x54ed('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x54ed('0x5'));var config=require(_0x54ed('0x6'));var controller=require(_0x54ed('0x7'));router[_0x54ed('0x8')]('/',auth[_0x54ed('0x9')](),controller[_0x54ed('0xa')]);router[_0x54ed('0x8')]('/describe',auth[_0x54ed('0x9')](),controller[_0x54ed('0xb')]);router[_0x54ed('0x8')](_0x54ed('0xc'),auth[_0x54ed('0x9')](),controller[_0x54ed('0xd')]);router['post']('/',auth[_0x54ed('0x9')](),controller['create']);router[_0x54ed('0xe')](_0x54ed('0xc'),auth[_0x54ed('0x9')](),controller[_0x54ed('0xf')]);router[_0x54ed('0x10')](_0x54ed('0xc'),auth[_0x54ed('0x9')](),controller[_0x54ed('0x11')]);module[_0x54ed('0x12')]=router; \ No newline at end of file +var _0xb4f7=['/describe','isAuthenticated','describe','post','put','/:id','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','get'];(function(_0x49e6e1,_0x378034){var _0x4fe5bc=function(_0x585ad3){while(--_0x585ad3){_0x49e6e1['push'](_0x49e6e1['shift']());}};_0x4fe5bc(++_0x378034);}(_0xb4f7,0x1c1));var _0x7b4f=function(_0x8a570b,_0x73059){_0x8a570b=_0x8a570b-0x0;var _0x45f680=_0xb4f7[_0x8a570b];return _0x45f680;};'use strict';var multer=require(_0x7b4f('0x0'));var util=require(_0x7b4f('0x1'));var path=require(_0x7b4f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b4f('0x3')]();var fs_extra=require(_0x7b4f('0x4'));var auth=require(_0x7b4f('0x5'));var interaction=require(_0x7b4f('0x6'));var config=require(_0x7b4f('0x7'));var controller=require(_0x7b4f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b4f('0x9')]);router[_0x7b4f('0xa')](_0x7b4f('0xb'),auth[_0x7b4f('0xc')](),controller[_0x7b4f('0xd')]);router[_0x7b4f('0xa')]('/:id',auth[_0x7b4f('0xc')](),controller['show']);router[_0x7b4f('0xe')]('/',auth[_0x7b4f('0xc')](),controller['create']);router[_0x7b4f('0xf')](_0x7b4f('0x10'),auth[_0x7b4f('0xc')](),controller[_0x7b4f('0x11')]);router['delete']('/:id',auth[_0x7b4f('0xc')](),controller[_0x7b4f('0x12')]);module[_0x7b4f('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index b10dccd..182f26d 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 _0x2aea=['STRING','TEXT'];(function(_0x39a07f,_0x5a5988){var _0x231c9e=function(_0x2cbeea){while(--_0x2cbeea){_0x39a07f['push'](_0x39a07f['shift']());}};_0x231c9e(++_0x5a5988);}(_0x2aea,0x180));var _0xa2ae=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0x2aea[_0x383627];return _0x2c16a0;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa2ae('0x0')]},'node':{'type':Sequelize[_0xa2ae('0x0')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa2ae('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa2ae('0x0')]}}; \ No newline at end of file +var _0x8bcf=['STRING','exports'];(function(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0x8bcf,0xc7));var _0xf8bc=function(_0x4e1509,_0x1186b1){_0x4e1509=_0x4e1509-0x0;var _0x1f37b2=_0x8bcf[_0x4e1509];return _0x1f37b2;};'use strict';var Sequelize=require('sequelize');module[_0xf8bc('0x0')]={'uniqueid':{'type':Sequelize[_0xf8bc('0x1')]},'node':{'type':Sequelize[_0xf8bc('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf8bc('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b49b4fd..d0446b0 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 _0x8ba2=['order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','nolimit'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x8ba2,0x13f));var _0x28ba=function(_0x19d7e6,_0x4ce5f1){_0x19d7e6=_0x19d7e6-0x0;var _0xf0abec=_0x8ba2[_0x19d7e6];return _0xf0abec;};'use strict';var emlformat=require(_0x28ba('0x0'));var rimraf=require(_0x28ba('0x1'));var zipdir=require(_0x28ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ba('0x3'));var moment=require(_0x28ba('0x4'));var BPromise=require(_0x28ba('0x5'));var Mustache=require('mustache');var util=require(_0x28ba('0x6'));var path=require(_0x28ba('0x7'));var sox=require(_0x28ba('0x8'));var csv=require(_0x28ba('0x9'));var ejs=require(_0x28ba('0xa'));var fs=require('fs');var fs_extra=require(_0x28ba('0xb'));var _=require('lodash');var squel=require(_0x28ba('0xc'));var crypto=require(_0x28ba('0xd'));var jsforce=require(_0x28ba('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x28ba('0x9'));var querystring=require(_0x28ba('0xf'));var Papa=require(_0x28ba('0x10'));var Redis=require(_0x28ba('0x11'));var authService=require(_0x28ba('0x12'));var qs=require(_0x28ba('0x13'));var as=require(_0x28ba('0x14'));var hardwareService=require(_0x28ba('0x15'));var logger=require(_0x28ba('0x16'))(_0x28ba('0x17'));var utils=require('../../config/utils');var config=require(_0x28ba('0x18'));var licenseUtil=require(_0x28ba('0x19'));var db=require(_0x28ba('0x1a'))['db'];function respondWithStatusCode(_0x299f63,_0x1204af){_0x1204af=_0x1204af||0xcc;return function(_0x3a9644){if(_0x3a9644){return _0x299f63[_0x28ba('0x1b')](_0x1204af);}return _0x299f63['status'](_0x1204af)[_0x28ba('0x1c')]();};}function respondWithResult(_0x3cf923,_0x4ebcd6){_0x4ebcd6=_0x4ebcd6||0xc8;return function(_0x29cd51){if(_0x29cd51){return _0x3cf923[_0x28ba('0x1d')](_0x4ebcd6)[_0x28ba('0x1e')](_0x29cd51);}};}function respondWithFilteredResult(_0x1c5998,_0x563797){return function(_0x24b3f3){if(_0x24b3f3){var _0x38df4f=typeof _0x563797[_0x28ba('0x1f')]===_0x28ba('0x20')&&typeof _0x563797[_0x28ba('0x21')]==='undefined';var _0x571c92=_0x24b3f3[_0x28ba('0x22')];var _0x182824=_0x38df4f?0x0:_0x563797[_0x28ba('0x1f')];var _0x2cf1cf=_0x38df4f?_0x24b3f3[_0x28ba('0x22')]:_0x563797[_0x28ba('0x1f')]+_0x563797[_0x28ba('0x21')];var _0x31a45b;if(_0x2cf1cf>=_0x571c92){_0x2cf1cf=_0x571c92;_0x31a45b=0xc8;}else{_0x31a45b=0xce;}_0x1c5998[_0x28ba('0x1d')](_0x31a45b);return _0x1c5998['set']('Content-Range',_0x182824+'-'+_0x2cf1cf+'/'+_0x571c92)[_0x28ba('0x1e')](_0x24b3f3);}return null;};}function patchUpdates(_0x4352a4){return function(_0x5d3d33){try{jsonpatch['apply'](_0x5d3d33,_0x4352a4,!![]);}catch(_0xf9e0f4){return BPromise[_0x28ba('0x23')](_0xf9e0f4);}return _0x5d3d33[_0x28ba('0x24')]();};}function saveUpdates(_0x17b1f4,_0x425732){return function(_0x4ff05c){if(_0x4ff05c){return _0x4ff05c[_0x28ba('0x25')](_0x17b1f4)[_0x28ba('0x26')](function(_0x1684af){return _0x1684af;});}return null;};}function removeEntity(_0x3eec5d,_0x27a579){return function(_0x256892){if(_0x256892){return _0x256892['destroy']()[_0x28ba('0x26')](function(){_0x3eec5d[_0x28ba('0x1d')](0xcc)[_0x28ba('0x1c')]();});}};}function handleEntityNotFound(_0x1d3fd1,_0x43e6c1){return function(_0x35ed28){if(!_0x35ed28){_0x1d3fd1['sendStatus'](0x194);}return _0x35ed28;};}function handleError(_0x3a06ae,_0x362254){_0x362254=_0x362254||0x1f4;return function(_0x599b88){logger['error'](_0x599b88[_0x28ba('0x27')]);if(_0x599b88[_0x28ba('0x28')]){delete _0x599b88['name'];}_0x3a06ae['status'](_0x362254)[_0x28ba('0x29')](_0x599b88);};}exports[_0x28ba('0x2a')]=function(_0x39cd83,_0x30afd){var _0x3b3d3c={},_0x1176a7={},_0x21612d={'count':0x0,'rows':[]};var _0x2adf88=_[_0x28ba('0x2b')](db[_0x28ba('0x2c')][_0x28ba('0x2d')],function(_0x32ab4b){return{'name':_0x32ab4b[_0x28ba('0x2e')],'type':_0x32ab4b[_0x28ba('0x2f')]['key']};});_0x1176a7[_0x28ba('0x30')]=_[_0x28ba('0x2b')](_0x2adf88,_0x28ba('0x28'));_0x1176a7['query']=_[_0x28ba('0x31')](_0x39cd83[_0x28ba('0x32')]);_0x1176a7[_0x28ba('0x33')]=_['intersection'](_0x1176a7[_0x28ba('0x30')],_0x1176a7[_0x28ba('0x32')]);_0x3b3d3c[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x1176a7[_0x28ba('0x30')],qs[_0x28ba('0x36')](_0x39cd83[_0x28ba('0x32')][_0x28ba('0x36')]));_0x3b3d3c[_0x28ba('0x34')]=_0x3b3d3c[_0x28ba('0x34')]['length']?_0x3b3d3c[_0x28ba('0x34')]:_0x1176a7[_0x28ba('0x30')];if(!_0x39cd83[_0x28ba('0x32')]['hasOwnProperty'](_0x28ba('0x37'))){_0x3b3d3c[_0x28ba('0x21')]=qs[_0x28ba('0x21')](_0x39cd83[_0x28ba('0x32')][_0x28ba('0x21')]);_0x3b3d3c[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x39cd83[_0x28ba('0x32')][_0x28ba('0x1f')]);}_0x3b3d3c[_0x28ba('0x38')]=qs[_0x28ba('0x39')](_0x39cd83[_0x28ba('0x32')]['sort']);_0x3b3d3c['where']=qs['filters'](_[_0x28ba('0x3a')](_0x39cd83[_0x28ba('0x32')],_0x1176a7['filters']),_0x2adf88);if(_0x39cd83[_0x28ba('0x32')][_0x28ba('0x3b')]){_0x3b3d3c['where']=_['merge'](_0x3b3d3c[_0x28ba('0x3c')],{'$or':_[_0x28ba('0x2b')](_0x2adf88,function(_0x5349ae){if(_0x5349ae['type']!==_0x28ba('0x3d')){var _0x12a109={};_0x12a109[_0x5349ae[_0x28ba('0x28')]]={'$like':'%'+_0x39cd83[_0x28ba('0x32')][_0x28ba('0x3b')]+'%'};return _0x12a109;}})});}_0x3b3d3c=_[_0x28ba('0x3e')]({},_0x3b3d3c,_0x39cd83[_0x28ba('0x3f')]);var _0x31263f={'where':_0x3b3d3c[_0x28ba('0x3c')]};return db['SquareDetailsReport']['count'](_0x31263f)['then'](function(_0x3cb083){_0x21612d[_0x28ba('0x22')]=_0x3cb083;if(_0x39cd83[_0x28ba('0x32')][_0x28ba('0x40')]){_0x3b3d3c[_0x28ba('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x3b3d3c);})['then'](function(_0x424f73){_0x21612d[_0x28ba('0x42')]=_0x424f73;return _0x21612d;})[_0x28ba('0x26')](respondWithFilteredResult(_0x30afd,_0x3b3d3c))[_0x28ba('0x43')](handleError(_0x30afd,null));};exports[_0x28ba('0x44')]=function(_0x4bb3c5,_0x19b943){var _0x43a438={'raw':!![],'where':{'id':_0x4bb3c5[_0x28ba('0x45')]['id']}},_0x364b7a={};_0x364b7a[_0x28ba('0x30')]=_[_0x28ba('0x31')](db[_0x28ba('0x2c')][_0x28ba('0x2d')]);_0x364b7a[_0x28ba('0x32')]=_['keys'](_0x4bb3c5['query']);_0x364b7a[_0x28ba('0x33')]=_[_0x28ba('0x35')](_0x364b7a[_0x28ba('0x30')],_0x364b7a[_0x28ba('0x32')]);_0x43a438[_0x28ba('0x34')]=_['intersection'](_0x364b7a['model'],qs['fields'](_0x4bb3c5['query'][_0x28ba('0x36')]));_0x43a438[_0x28ba('0x34')]=_0x43a438[_0x28ba('0x34')][_0x28ba('0x46')]?_0x43a438[_0x28ba('0x34')]:_0x364b7a[_0x28ba('0x30')];if(_0x4bb3c5['query'][_0x28ba('0x40')]){_0x43a438[_0x28ba('0x41')]=[{'all':!![]}];}_0x43a438=_['merge']({},_0x43a438,_0x4bb3c5['options']);return db[_0x28ba('0x2c')]['find'](_0x43a438)[_0x28ba('0x26')](handleEntityNotFound(_0x19b943,null))[_0x28ba('0x26')](respondWithResult(_0x19b943,null))['catch'](handleError(_0x19b943,null));};exports[_0x28ba('0x47')]=function(_0x5105bf,_0x52b4ed){return db['SquareDetailsReport'][_0x28ba('0x47')](_0x5105bf[_0x28ba('0x48')],{})[_0x28ba('0x26')](respondWithResult(_0x52b4ed,0xc9))[_0x28ba('0x43')](handleError(_0x52b4ed,null));};exports[_0x28ba('0x25')]=function(_0x4047c1,_0x5ccfab){if(_0x4047c1[_0x28ba('0x48')]['id']){delete _0x4047c1['body']['id'];}return db['SquareDetailsReport'][_0x28ba('0x49')]({'where':{'id':_0x4047c1[_0x28ba('0x45')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x5ccfab,null))[_0x28ba('0x26')](saveUpdates(_0x4047c1['body'],null))[_0x28ba('0x26')](respondWithResult(_0x5ccfab,null))['catch'](handleError(_0x5ccfab,null));};exports['destroy']=function(_0x38bf5b,_0x397f81){return db[_0x28ba('0x2c')][_0x28ba('0x49')]({'where':{'id':_0x38bf5b[_0x28ba('0x45')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x397f81,null))[_0x28ba('0x26')](removeEntity(_0x397f81,null))[_0x28ba('0x43')](handleError(_0x397f81,null));};exports['describe']=function(_0x198073,_0x3773bc){return db[_0x28ba('0x2c')][_0x28ba('0x4a')]()[_0x28ba('0x26')](respondWithResult(_0x3773bc,null))['catch'](handleError(_0x3773bc,null));}; \ No newline at end of file +var _0x33c2=['end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','error','stack','name','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','create','body','update','find','describe','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x33c2,0xc2));var _0x233c=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x33c2[_0x38c652];return _0x218a37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x233c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x233c('0x1'));var rp=require(_0x233c('0x2'));var moment=require(_0x233c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x233c('0x4'));var csv=require(_0x233c('0x5'));var ejs=require(_0x233c('0x6'));var fs=require('fs');var fs_extra=require(_0x233c('0x7'));var _=require('lodash');var squel=require(_0x233c('0x8'));var crypto=require(_0x233c('0x9'));var jsforce=require(_0x233c('0xa'));var deskjs=require(_0x233c('0xb'));var toCsv=require(_0x233c('0x5'));var querystring=require('querystring');var Papa=require(_0x233c('0xc'));var Redis=require('ioredis');var authService=require(_0x233c('0xd'));var qs=require(_0x233c('0xe'));var as=require(_0x233c('0xf'));var hardwareService=require(_0x233c('0x10'));var logger=require(_0x233c('0x11'))(_0x233c('0x12'));var utils=require(_0x233c('0x13'));var config=require(_0x233c('0x14'));var licenseUtil=require(_0x233c('0x15'));var db=require(_0x233c('0x16'))['db'];function respondWithStatusCode(_0x2dff5b,_0xd84af9){_0xd84af9=_0xd84af9||0xcc;return function(_0x19ce3e){if(_0x19ce3e){return _0x2dff5b[_0x233c('0x17')](_0xd84af9);}return _0x2dff5b[_0x233c('0x18')](_0xd84af9)[_0x233c('0x19')]();};}function respondWithResult(_0x42910d,_0x494437){_0x494437=_0x494437||0xc8;return function(_0x16db04){if(_0x16db04){return _0x42910d[_0x233c('0x18')](_0x494437)[_0x233c('0x1a')](_0x16db04);}};}function respondWithFilteredResult(_0xb5f646,_0x540621){return function(_0x5e1926){if(_0x5e1926){var _0x2dbccf=typeof _0x540621[_0x233c('0x1b')]===_0x233c('0x1c')&&typeof _0x540621['limit']===_0x233c('0x1c');var _0x3cbbe5=_0x5e1926[_0x233c('0x1d')];var _0x3f1b17=_0x2dbccf?0x0:_0x540621[_0x233c('0x1b')];var _0x4cbd32=_0x2dbccf?_0x5e1926[_0x233c('0x1d')]:_0x540621[_0x233c('0x1b')]+_0x540621[_0x233c('0x1e')];var _0x2542c1;if(_0x4cbd32>=_0x3cbbe5){_0x4cbd32=_0x3cbbe5;_0x2542c1=0xc8;}else{_0x2542c1=0xce;}_0xb5f646['status'](_0x2542c1);return _0xb5f646['set'](_0x233c('0x1f'),_0x3f1b17+'-'+_0x4cbd32+'/'+_0x3cbbe5)[_0x233c('0x1a')](_0x5e1926);}return null;};}function patchUpdates(_0x25f838){return function(_0x5cd5d2){try{jsonpatch['apply'](_0x5cd5d2,_0x25f838,!![]);}catch(_0x3c3d3b){return BPromise[_0x233c('0x20')](_0x3c3d3b);}return _0x5cd5d2[_0x233c('0x21')]();};}function saveUpdates(_0x317b0c,_0x3e4348){return function(_0x38dda1){if(_0x38dda1){return _0x38dda1['update'](_0x317b0c)[_0x233c('0x22')](function(_0x3592ff){return _0x3592ff;});}return null;};}function removeEntity(_0x55cf8f,_0x444fc0){return function(_0x1eb3a2){if(_0x1eb3a2){return _0x1eb3a2[_0x233c('0x23')]()[_0x233c('0x22')](function(){_0x55cf8f[_0x233c('0x18')](0xcc)[_0x233c('0x19')]();});}};}function handleEntityNotFound(_0x862da5,_0x3bf160){return function(_0x46daf0){if(!_0x46daf0){_0x862da5['sendStatus'](0x194);}return _0x46daf0;};}function handleError(_0x30bea0,_0x156812){_0x156812=_0x156812||0x1f4;return function(_0x241829){logger[_0x233c('0x24')](_0x241829[_0x233c('0x25')]);if(_0x241829[_0x233c('0x26')]){delete _0x241829[_0x233c('0x26')];}_0x30bea0[_0x233c('0x18')](_0x156812)['send'](_0x241829);};}exports['index']=function(_0x58c74c,_0x35a651){var _0x5447bc={},_0x5de062={},_0x24edd4={'count':0x0,'rows':[]};var _0x539158=_[_0x233c('0x27')](db[_0x233c('0x28')][_0x233c('0x29')],function(_0x23df9e){return{'name':_0x23df9e[_0x233c('0x2a')],'type':_0x23df9e[_0x233c('0x2b')][_0x233c('0x2c')]};});_0x5de062['model']=_['map'](_0x539158,'name');_0x5de062[_0x233c('0x2d')]=_[_0x233c('0x2e')](_0x58c74c[_0x233c('0x2d')]);_0x5de062[_0x233c('0x2f')]=_['intersection'](_0x5de062[_0x233c('0x30')],_0x5de062['query']);_0x5447bc[_0x233c('0x31')]=_[_0x233c('0x32')](_0x5de062[_0x233c('0x30')],qs[_0x233c('0x33')](_0x58c74c[_0x233c('0x2d')][_0x233c('0x33')]));_0x5447bc[_0x233c('0x31')]=_0x5447bc[_0x233c('0x31')][_0x233c('0x34')]?_0x5447bc['attributes']:_0x5de062[_0x233c('0x30')];if(!_0x58c74c[_0x233c('0x2d')][_0x233c('0x35')](_0x233c('0x36'))){_0x5447bc[_0x233c('0x1e')]=qs[_0x233c('0x1e')](_0x58c74c[_0x233c('0x2d')][_0x233c('0x1e')]);_0x5447bc[_0x233c('0x1b')]=qs[_0x233c('0x1b')](_0x58c74c[_0x233c('0x2d')][_0x233c('0x1b')]);}_0x5447bc[_0x233c('0x37')]=qs['sort'](_0x58c74c[_0x233c('0x2d')][_0x233c('0x38')]);_0x5447bc['where']=qs[_0x233c('0x2f')](_[_0x233c('0x39')](_0x58c74c[_0x233c('0x2d')],_0x5de062['filters']),_0x539158);if(_0x58c74c['query'][_0x233c('0x3a')]){_0x5447bc[_0x233c('0x3b')]=_['merge'](_0x5447bc[_0x233c('0x3b')],{'$or':_[_0x233c('0x27')](_0x539158,function(_0x50a437){if(_0x50a437[_0x233c('0x2b')]!==_0x233c('0x3c')){var _0x220802={};_0x220802[_0x50a437[_0x233c('0x26')]]={'$like':'%'+_0x58c74c[_0x233c('0x2d')][_0x233c('0x3a')]+'%'};return _0x220802;}})});}_0x5447bc=_[_0x233c('0x3d')]({},_0x5447bc,_0x58c74c['options']);var _0x4d4139={'where':_0x5447bc[_0x233c('0x3b')]};return db['SquareDetailsReport'][_0x233c('0x1d')](_0x4d4139)['then'](function(_0xb1ee8f){_0x24edd4[_0x233c('0x1d')]=_0xb1ee8f;if(_0x58c74c[_0x233c('0x2d')][_0x233c('0x3e')]){_0x5447bc[_0x233c('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x233c('0x40')](_0x5447bc);})[_0x233c('0x22')](function(_0x33c639){_0x24edd4['rows']=_0x33c639;return _0x24edd4;})[_0x233c('0x22')](respondWithFilteredResult(_0x35a651,_0x5447bc))[_0x233c('0x41')](handleError(_0x35a651,null));};exports[_0x233c('0x42')]=function(_0x439ad5,_0x3c53e1){var _0x44f13b={'raw':!![],'where':{'id':_0x439ad5[_0x233c('0x43')]['id']}},_0x456647={};_0x456647[_0x233c('0x30')]=_[_0x233c('0x2e')](db[_0x233c('0x28')]['rawAttributes']);_0x456647[_0x233c('0x2d')]=_[_0x233c('0x2e')](_0x439ad5['query']);_0x456647['filters']=_[_0x233c('0x32')](_0x456647['model'],_0x456647['query']);_0x44f13b['attributes']=_[_0x233c('0x32')](_0x456647[_0x233c('0x30')],qs[_0x233c('0x33')](_0x439ad5[_0x233c('0x2d')][_0x233c('0x33')]));_0x44f13b[_0x233c('0x31')]=_0x44f13b['attributes'][_0x233c('0x34')]?_0x44f13b[_0x233c('0x31')]:_0x456647[_0x233c('0x30')];if(_0x439ad5['query'][_0x233c('0x3e')]){_0x44f13b[_0x233c('0x3f')]=[{'all':!![]}];}_0x44f13b=_[_0x233c('0x3d')]({},_0x44f13b,_0x439ad5['options']);return db[_0x233c('0x28')]['find'](_0x44f13b)[_0x233c('0x22')](handleEntityNotFound(_0x3c53e1,null))[_0x233c('0x22')](respondWithResult(_0x3c53e1,null))['catch'](handleError(_0x3c53e1,null));};exports[_0x233c('0x44')]=function(_0x46a0c4,_0x5455ed){return db['SquareDetailsReport'][_0x233c('0x44')](_0x46a0c4[_0x233c('0x45')],{})[_0x233c('0x22')](respondWithResult(_0x5455ed,0xc9))[_0x233c('0x41')](handleError(_0x5455ed,null));};exports[_0x233c('0x46')]=function(_0x2858ea,_0x4999c3){if(_0x2858ea[_0x233c('0x45')]['id']){delete _0x2858ea[_0x233c('0x45')]['id'];}return db['SquareDetailsReport'][_0x233c('0x47')]({'where':{'id':_0x2858ea[_0x233c('0x43')]['id']}})[_0x233c('0x22')](handleEntityNotFound(_0x4999c3,null))[_0x233c('0x22')](saveUpdates(_0x2858ea['body'],null))[_0x233c('0x22')](respondWithResult(_0x4999c3,null))['catch'](handleError(_0x4999c3,null));};exports['destroy']=function(_0x27ee6b,_0x533c1a){return db[_0x233c('0x28')][_0x233c('0x47')]({'where':{'id':_0x27ee6b[_0x233c('0x43')]['id']}})[_0x233c('0x22')](handleEntityNotFound(_0x533c1a,null))['then'](removeEntity(_0x533c1a,null))[_0x233c('0x41')](handleError(_0x533c1a,null));};exports[_0x233c('0x48')]=function(_0x403067,_0x3b1519){return db[_0x233c('0x28')][_0x233c('0x48')]()[_0x233c('0x22')](respondWithResult(_0x3b1519,null))[_0x233c('0x41')](handleError(_0x3b1519,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 25b531f..5919d1e 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 _0xaebf=['lodash','util','moment','bluebird','request-promise','path','rimraf','exports','define','SquareDetailsReport','report_square_details'];(function(_0x1152fb,_0x2da18a){var _0x26dc9f=function(_0x223ff1){while(--_0x223ff1){_0x1152fb['push'](_0x1152fb['shift']());}};_0x26dc9f(++_0x2da18a);}(_0xaebf,0x16b));var _0xfaeb=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xaebf[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xfaeb('0x0'));var util=require(_0xfaeb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfaeb('0x2'));var BPromise=require(_0xfaeb('0x3'));var rp=require(_0xfaeb('0x4'));var fs=require('fs');var path=require(_0xfaeb('0x5'));var rimraf=require(_0xfaeb('0x6'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xfaeb('0x7')]=function(_0x1400ef,_0x3347ba){return _0x1400ef[_0xfaeb('0x8')](_0xfaeb('0x9'),attributes,{'tableName':_0xfaeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b32=['report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b32,0xde));var _0x20b3=function(_0x3d729f,_0x5c1897){_0x3d729f=_0x3d729f-0x0;var _0x4ac2fb=_0x0b32[_0x3d729f];return _0x4ac2fb;};'use strict';var _=require(_0x20b3('0x0'));var util=require('util');var logger=require(_0x20b3('0x1'))(_0x20b3('0x2'));var moment=require(_0x20b3('0x3'));var BPromise=require(_0x20b3('0x4'));var rp=require(_0x20b3('0x5'));var fs=require('fs');var path=require(_0x20b3('0x6'));var rimraf=require(_0x20b3('0x7'));var config=require(_0x20b3('0x8'));var attributes=require(_0x20b3('0x9'));module[_0x20b3('0xa')]=function(_0x3edca5,_0xdd6fc8){return _0x3edca5[_0x20b3('0xb')]('SquareDetailsReport',attributes,{'tableName':_0x20b3('0xc'),'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 4166826..5f0db71 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 _0x6a95=['message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa33bd9,_0x1462ba){var _0x357148=function(_0x364b4d){while(--_0x364b4d){_0xa33bd9['push'](_0xa33bd9['shift']());}};_0x357148(++_0x1462ba);}(_0x6a95,0x1db));var _0x56a9=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6a95[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var BPromise=require(_0x56a9('0x3'));var rs=require(_0x56a9('0x4'));var fs=require('fs');var Redis=require(_0x56a9('0x5'));var db=require(_0x56a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56a9('0x7'));var config=require(_0x56a9('0x8'));var jayson=require(_0x56a9('0x9'));var client=jayson[_0x56a9('0xa')][_0x56a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x365093,_0xd8aa7c,_0x5d3e80){return new BPromise(function(_0x5f0dcb,_0x3ac626){return client[_0x56a9('0xc')](_0x365093,_0x5d3e80)['then'](function(_0xe4b98c){logger[_0x56a9('0xd')](_0x56a9('0xe'),_0xd8aa7c,_0x56a9('0xf'));logger[_0x56a9('0x10')](_0x56a9('0x11'),_0xd8aa7c,_0x56a9('0xf'),JSON[_0x56a9('0x12')](_0xe4b98c));if(_0xe4b98c[_0x56a9('0x13')]){if(_0xe4b98c['error'][_0x56a9('0x14')]===0x1f4){logger['error'](_0x56a9('0xe'),_0xd8aa7c,_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x3ac626(_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);}logger[_0x56a9('0x13')](_0x56a9('0xe'),_0xd8aa7c,_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x5f0dcb(_0xe4b98c['error']['message']);}else{logger[_0x56a9('0xd')](_0x56a9('0xe'),_0xd8aa7c,_0x56a9('0xf'));_0x5f0dcb(_0xe4b98c[_0x56a9('0x16')]['message']);}})[_0x56a9('0x17')](function(_0x4853a3){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xd8aa7c,_0x4853a3);_0x3ac626(_0x4853a3);});});}exports[_0x56a9('0x18')]=function(_0x576bdf){var _0x59c0ec=this;return new Promise(function(_0x105fe5,_0x459a87){return db[_0x56a9('0x19')][_0x56a9('0x1a')](_0x576bdf[_0x56a9('0x1b')],{'raw':_0x576bdf[_0x56a9('0x1c')]?_0x576bdf[_0x56a9('0x1c')][_0x56a9('0x1d')]===undefined?!![]:![]:!![]})[_0x56a9('0x1e')](function(_0x5f145f){logger['info'](_0x56a9('0x18'),_0x576bdf);logger[_0x56a9('0x10')](_0x56a9('0x18'),_0x576bdf,JSON[_0x56a9('0x12')](_0x5f145f));_0x105fe5(_0x5f145f);})['catch'](function(_0x6100fe){logger[_0x56a9('0x13')](_0x56a9('0x18'),_0x6100fe[_0x56a9('0x15')],_0x576bdf);_0x459a87(_0x59c0ec['error'](0x1f4,_0x6100fe[_0x56a9('0x15')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw'];(function(_0x2459d2,_0x3048e2){var _0x406e5b=function(_0x3ae951){while(--_0x3ae951){_0x2459d2['push'](_0x2459d2['shift']());}};_0x406e5b(++_0x3048e2);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d58e6,_0x55cb14){_0x2d58e6=_0x2d58e6-0x0;var _0x5bcd81=_0xb10b[_0x2d58e6];return _0x5bcd81;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateSquareDetailsReport',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 8d8f77a..be6babe 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 _0xa945=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports'];(function(_0x2f922f,_0x34a14f){var _0x4a63d4=function(_0x251b57){while(--_0x251b57){_0x2f922f['push'](_0x2f922f['shift']());}};_0x4a63d4(++_0x34a14f);}(_0xa945,0x1b0));var _0x5a94=function(_0x4a7273,_0x19c9ca){_0x4a7273=_0x4a7273-0x0;var _0x135ca9=_0xa945[_0x4a7273];return _0x135ca9;};'use strict';var express=require('express');var router=express[_0x5a94('0x0')]();var auth=require(_0x5a94('0x1'));var controller=require(_0x5a94('0x2'));router[_0x5a94('0x3')]('/',auth[_0x5a94('0x4')](),controller['index']);router[_0x5a94('0x3')](_0x5a94('0x5'),auth[_0x5a94('0x4')](),controller[_0x5a94('0x6')]);module[_0x5a94('0x7')]=router; \ No newline at end of file +var _0xd385=['exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess'];(function(_0x4ef933,_0x2e2edc){var _0x36ee88=function(_0x21da9d){while(--_0x21da9d){_0x4ef933['push'](_0x4ef933['shift']());}};_0x36ee88(++_0x2e2edc);}(_0xd385,0x19b));var _0x5d38=function(_0x864cdf,_0x37682b){_0x864cdf=_0x864cdf-0x0;var _0x196fb6=_0xd385[_0x864cdf];return _0x196fb6;};'use strict';var express=require(_0x5d38('0x0'));var router=express[_0x5d38('0x1')]();var auth=require(_0x5d38('0x2'));var controller=require(_0x5d38('0x3'));router[_0x5d38('0x4')]('/',auth[_0x5d38('0x5')](),controller[_0x5d38('0x6')]);router[_0x5d38('0x4')](_0x5d38('0x7'),auth['isAuthenticated'](),controller[_0x5d38('0x8')]);module[_0x5d38('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 14b445e..ec39f23 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 _0xf3eb=['child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','index','getAllData','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','format','pid','kill','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation'];(function(_0x1bd230,_0x1da01e){var _0x19a3e3=function(_0x3cb9fa){while(--_0x3cb9fa){_0x1bd230['push'](_0x1bd230['shift']());}};_0x19a3e3(++_0x1da01e);}(_0xf3eb,0x1af));var _0xbf3e=function(_0x8ba30e,_0x1cfc68){_0x8ba30e=_0x8ba30e-0x0;var _0x44ed04=_0xf3eb[_0x8ba30e];return _0x44ed04;};'use strict';var info=require(_0xbf3e('0x0'));var exec=require(_0xbf3e('0x1'))[_0xbf3e('0x2')];var logger=require(_0xbf3e('0x3'))(_0xbf3e('0x4'));var util=require(_0xbf3e('0x5'));var BPromise=require(_0xbf3e('0x6'));var _=require(_0xbf3e('0x7'));function handleError(_0x26f321,_0x4f95e7,_0x595d65){_0x4f95e7=_0x4f95e7||0x1f4;return function(_0x3f7956){logger['error'](_0xbf3e('0x8'),_0x595d65,_0x4f95e7,util['inspect'](_0x3f7956,{'showHidden':![],'depth':null}));delete _0x3f7956[_0xbf3e('0x9')];_0x26f321[_0xbf3e('0xa')](_0x4f95e7)['send'](_0x3f7956);};}exports[_0xbf3e('0xb')]=function(_0x7bce65,_0x23ebdf){return info[_0xbf3e('0xc')]()['then'](function(_0x479064){return _0x23ebdf[_0xbf3e('0xa')](0xc8)['json'](_0x479064);})[_0xbf3e('0xd')](function(_0x1fc294){return _0x23ebdf[_0xbf3e('0xa')](0x1f4)['json'](_0x1fc294);});};exports['killProcess']=function(_0x250f00,_0x122d07){var _0x58152a=[_0xbf3e('0xe')];return new BPromise(function(_0x2b2493,_0x36be53){return exec(util['format'](_0xbf3e('0xf'),_0x250f00[_0xbf3e('0x10')]['pid']),function(_0xedbd44,_0x4580cf,_0xdfdc99){if(_0xedbd44){return _0x36be53(_0xedbd44);}return _0x2b2493(_0x4580cf);});})['then'](function(_0x51fe4a){var _0x48f34f=![];var _0x22edd0=_0x51fe4a[_0xbf3e('0x11')](/\n/);for(var _0x719de8=0x0,_0x35bd44=_0x58152a[_0xbf3e('0x12')];_0x719de8<_0x35bd44,_0x48f34f===![];_0x719de8+=0x1){if(_0x51fe4a[_0xbf3e('0x13')](_0x58152a[_0x719de8])>=0x0){_0x48f34f=!![];}}if(!_0x48f34f){throw new Error(util[_0xbf3e('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x250f00['params'][_0xbf3e('0x15')]));}process[_0xbf3e('0x16')](_0x250f00[_0xbf3e('0x10')][_0xbf3e('0x15')],_0xbf3e('0x17'));return _0x122d07[_0xbf3e('0xa')](0xc8)[_0xbf3e('0x18')]({'message':util['format'](_0xbf3e('0x19'),_0x250f00[_0xbf3e('0x10')][_0xbf3e('0x15')])});})[_0xbf3e('0xd')](handleError(_0x122d07,null,_0xbf3e('0x1a')));}; \ No newline at end of file +var _0xc185=['send','status','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','indexOf','SIGINT','catch','systeminformation','child_process','exec','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name'];(function(_0xeeabcb,_0x474df2){var _0x4d2f88=function(_0xda8cc0){while(--_0xda8cc0){_0xeeabcb['push'](_0xeeabcb['shift']());}};_0x4d2f88(++_0x474df2);}(_0xc185,0x97));var _0x5c18=function(_0x48403f,_0x14d353){_0x48403f=_0x48403f-0x0;var _0x12c0de=_0xc185[_0x48403f];return _0x12c0de;};'use strict';var info=require(_0x5c18('0x0'));var exec=require(_0x5c18('0x1'))[_0x5c18('0x2')];var logger=require('../../config/logger')('api');var util=require(_0x5c18('0x3'));var BPromise=require(_0x5c18('0x4'));var _=require(_0x5c18('0x5'));function handleError(_0x3ec675,_0x1b94e1,_0x141cd8){_0x1b94e1=_0x1b94e1||0x1f4;return function(_0x4840ff){logger[_0x5c18('0x6')](_0x5c18('0x7'),_0x141cd8,_0x1b94e1,util[_0x5c18('0x8')](_0x4840ff,{'showHidden':![],'depth':null}));delete _0x4840ff[_0x5c18('0x9')];_0x3ec675['status'](_0x1b94e1)[_0x5c18('0xa')](_0x4840ff);};}exports['index']=function(_0x192fd4,_0x1090f3){return info['getAllData']()['then'](function(_0x12116d){return _0x1090f3[_0x5c18('0xb')](0xc8)[_0x5c18('0xc')](_0x12116d);})['catch'](function(_0x57bfc3){return _0x1090f3[_0x5c18('0xb')](0x1f4)[_0x5c18('0xc')](_0x57bfc3);});};exports[_0x5c18('0xd')]=function(_0x2ef73c,_0x3094a4){var _0x3e303d=['components/import/cm'];return new BPromise(function(_0x1abb42,_0x4615aa){return exec(util[_0x5c18('0xe')](_0x5c18('0xf'),_0x2ef73c[_0x5c18('0x10')][_0x5c18('0x11')]),function(_0x337276,_0x4ec5a3,_0x325970){if(_0x337276){return _0x4615aa(_0x337276);}return _0x1abb42(_0x4ec5a3);});})[_0x5c18('0x12')](function(_0x12286e){var _0x376e14=![];var _0x12a4e5=_0x12286e[_0x5c18('0x13')](/\n/);for(var _0x2813c2=0x0,_0x4aeeab=_0x3e303d['length'];_0x2813c2<_0x4aeeab,_0x376e14===![];_0x2813c2+=0x1){if(_0x12286e[_0x5c18('0x14')](_0x3e303d[_0x2813c2])>=0x0){_0x376e14=!![];}}if(!_0x376e14){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2ef73c[_0x5c18('0x10')][_0x5c18('0x11')]));}process['kill'](_0x2ef73c[_0x5c18('0x10')]['pid'],_0x5c18('0x15'));return _0x3094a4[_0x5c18('0xb')](0xc8)[_0x5c18('0xc')]({'message':util[_0x5c18('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x2ef73c[_0x5c18('0x10')][_0x5c18('0x11')])});})[_0x5c18('0x16')](handleError(_0x3094a4,null,_0x5c18('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 741657f..b45a946 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 _0xec0c=['../../components/interaction/service','isAuthenticated','get','show','post','/:id','delete','exports','multer','util','path','express','fs-extra'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0xec0c,0xa4));var _0xcec0=function(_0x124a63,_0x1d0e59){_0x124a63=_0x124a63-0x0;var _0x2e27bd=_0xec0c[_0x124a63];return _0x2e27bd;};'use strict';var multer=require(_0xcec0('0x0'));var util=require(_0xcec0('0x1'));var path=require(_0xcec0('0x2'));var timeout=require('connect-timeout');var express=require(_0xcec0('0x3'));var router=express['Router']();var fs_extra=require(_0xcec0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcec0('0x5'));var config=require('../../config/environment');var controller=require('./tag.controller');router['get']('/',auth[_0xcec0('0x6')](),controller['index']);router[_0xcec0('0x7')]('/:id',auth[_0xcec0('0x6')](),controller[_0xcec0('0x8')]);router[_0xcec0('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xcec0('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xcec0('0xb')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xcec0('0xc')]=router; \ No newline at end of file +var _0x3f2b=['create','put','update','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3f2b,0x1be));var _0xb3f2=function(_0x53b11a,_0x1811c7){_0x53b11a=_0x53b11a-0x0;var _0x45218b=_0x3f2b[_0x53b11a];return _0x45218b;};'use strict';var multer=require(_0xb3f2('0x0'));var util=require(_0xb3f2('0x1'));var path=require(_0xb3f2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb3f2('0x3')]();var fs_extra=require(_0xb3f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb3f2('0x5'));var config=require('../../config/environment');var controller=require(_0xb3f2('0x6'));router[_0xb3f2('0x7')]('/',auth[_0xb3f2('0x8')](),controller[_0xb3f2('0x9')]);router[_0xb3f2('0x7')](_0xb3f2('0xa'),auth[_0xb3f2('0x8')](),controller[_0xb3f2('0xb')]);router[_0xb3f2('0xc')]('/',auth[_0xb3f2('0x8')](),controller[_0xb3f2('0xd')]);router[_0xb3f2('0xe')](_0xb3f2('0xa'),auth['isAuthenticated'](),controller[_0xb3f2('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb3f2('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index f35ae3d..324fd84 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 _0xbfcc=['#0091EA','sequelize','name','STRING'];(function(_0x1e6840,_0x1ff4ee){var _0x3cc932=function(_0x14408e){while(--_0x14408e){_0x1e6840['push'](_0x1e6840['shift']());}};_0x3cc932(++_0x1ff4ee);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0xbfcc[_0x36bfe3];return _0x9b0436;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcbfc('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xcbfc('0x2')],'defaultValue':_0xcbfc('0x3')},'description':{'type':Sequelize[_0xcbfc('0x2')]}}; \ No newline at end of file +var _0x9656=['name','#0091EA','sequelize','STRING'];(function(_0x58b04f,_0xd5ea5a){var _0x134b29=function(_0x49bfb3){while(--_0x49bfb3){_0x58b04f['push'](_0x58b04f['shift']());}};_0x134b29(++_0xd5ea5a);}(_0x9656,0x15e));var _0x6965=function(_0x201ab2,_0x26e8bb){_0x201ab2=_0x201ab2-0x0;var _0x504b42=_0x9656[_0x201ab2];return _0x504b42;};'use strict';var Sequelize=require(_0x6965('0x0'));module['exports']={'name':{'type':Sequelize[_0x6965('0x1')],'unique':_0x6965('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x6965('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 9a1ad0c..e2f6755 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 _0x7980=['Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','user'];(function(_0x180af9,_0x3e8efb){var _0x2266ac=function(_0x5a20d4){while(--_0x5a20d4){_0x180af9['push'](_0x180af9['shift']());}};_0x2266ac(++_0x3e8efb);}(_0x7980,0xab));var _0x0798=function(_0x1d0851,_0x198d88){_0x1d0851=_0x1d0851-0x0;var _0x2e0427=_0x7980[_0x1d0851];return _0x2e0427;};'use strict';var emlformat=require(_0x0798('0x0'));var rimraf=require(_0x0798('0x1'));var zipdir=require(_0x0798('0x2'));var jsonpatch=require(_0x0798('0x3'));var rp=require(_0x0798('0x4'));var moment=require('moment');var BPromise=require(_0x0798('0x5'));var Mustache=require(_0x0798('0x6'));var util=require(_0x0798('0x7'));var path=require(_0x0798('0x8'));var sox=require(_0x0798('0x9'));var csv=require('to-csv');var ejs=require(_0x0798('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0798('0xb'));var squel=require(_0x0798('0xc'));var crypto=require(_0x0798('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0798('0xe'));var querystring=require(_0x0798('0xf'));var Papa=require(_0x0798('0x10'));var Redis=require(_0x0798('0x11'));var authService=require(_0x0798('0x12'));var qs=require(_0x0798('0x13'));var as=require(_0x0798('0x14'));var hardwareService=require(_0x0798('0x15'));var logger=require(_0x0798('0x16'))(_0x0798('0x17'));var utils=require('../../config/utils');var config=require(_0x0798('0x18'));var licenseUtil=require(_0x0798('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5323e5,_0x588f9d){_0x588f9d=_0x588f9d||0xcc;return function(_0x376a60){if(_0x376a60){return _0x5323e5[_0x0798('0x1a')](_0x588f9d);}return _0x5323e5[_0x0798('0x1b')](_0x588f9d)[_0x0798('0x1c')]();};}function respondWithResult(_0x39bacd,_0xfd88af){_0xfd88af=_0xfd88af||0xc8;return function(_0x5f1640){if(_0x5f1640){return _0x39bacd['status'](_0xfd88af)[_0x0798('0x1d')](_0x5f1640);}};}function respondWithFilteredResult(_0x112362,_0x47be56){return function(_0x555c45){if(_0x555c45){var _0x21c30b=typeof _0x47be56[_0x0798('0x1e')]===_0x0798('0x1f')&&typeof _0x47be56['limit']==='undefined';var _0x1c6d6f=_0x555c45['count'];var _0x41e217=_0x21c30b?0x0:_0x47be56[_0x0798('0x1e')];var _0x288f41=_0x21c30b?_0x555c45[_0x0798('0x20')]:_0x47be56['offset']+_0x47be56[_0x0798('0x21')];var _0x3039d6;if(_0x288f41>=_0x1c6d6f){_0x288f41=_0x1c6d6f;_0x3039d6=0xc8;}else{_0x3039d6=0xce;}_0x112362['status'](_0x3039d6);return _0x112362[_0x0798('0x22')](_0x0798('0x23'),_0x41e217+'-'+_0x288f41+'/'+_0x1c6d6f)[_0x0798('0x1d')](_0x555c45);}return null;};}function patchUpdates(_0x44ac33){return function(_0xfbb4a5){try{jsonpatch[_0x0798('0x24')](_0xfbb4a5,_0x44ac33,!![]);}catch(_0x3a7f8b){return BPromise[_0x0798('0x25')](_0x3a7f8b);}return _0xfbb4a5[_0x0798('0x26')]();};}function saveUpdates(_0x4a86d5,_0x2aaabf){return function(_0x35c141){if(_0x35c141){return _0x35c141[_0x0798('0x27')](_0x4a86d5)[_0x0798('0x28')](function(_0x20654b){return _0x20654b;});}return null;};}function removeEntity(_0x23f283,_0x52037c){return function(_0x3f66e2){if(_0x3f66e2){return _0x3f66e2[_0x0798('0x29')]()[_0x0798('0x28')](function(){var _0xd5e027=_0x3f66e2[_0x0798('0x2a')]({'plain':!![]});var _0x23d59c='Tags';return db[_0x0798('0x2b')][_0x0798('0x29')]({'where':{'type':_0x23d59c,'resourceId':_0xd5e027['id']}})[_0x0798('0x28')](function(){return _0x3f66e2;});})['then'](function(){_0x23f283[_0x0798('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53a3d7,_0x406030){return function(_0x2dfbff){if(!_0x2dfbff){_0x53a3d7[_0x0798('0x1a')](0x194);}return _0x2dfbff;};}function handleError(_0xaa949b,_0x11b7f4){_0x11b7f4=_0x11b7f4||0x1f4;return function(_0x161244){logger[_0x0798('0x2c')](_0x161244[_0x0798('0x2d')]);if(_0x161244['name']){delete _0x161244[_0x0798('0x2e')];}_0xaa949b['status'](_0x11b7f4)['send'](_0x161244);};}exports[_0x0798('0x2f')]=function(_0x4a7eeb,_0x1dabd5){var _0x4a5fb1={},_0x93c004={},_0xb8d33e={'count':0x0,'rows':[]};var _0x201e4c=_[_0x0798('0x30')](db[_0x0798('0x31')][_0x0798('0x32')],function(_0xa1376e){return{'name':_0xa1376e[_0x0798('0x33')],'type':_0xa1376e[_0x0798('0x34')][_0x0798('0x35')]};});_0x93c004[_0x0798('0x36')]=_[_0x0798('0x30')](_0x201e4c,'name');_0x93c004[_0x0798('0x37')]=_['keys'](_0x4a7eeb['query']);_0x93c004[_0x0798('0x38')]=_[_0x0798('0x39')](_0x93c004['model'],_0x93c004['query']);_0x4a5fb1[_0x0798('0x3a')]=_[_0x0798('0x39')](_0x93c004[_0x0798('0x36')],qs[_0x0798('0x3b')](_0x4a7eeb[_0x0798('0x37')][_0x0798('0x3b')]));_0x4a5fb1['attributes']=_0x4a5fb1['attributes'][_0x0798('0x3c')]?_0x4a5fb1[_0x0798('0x3a')]:_0x93c004[_0x0798('0x36')];if(!_0x4a7eeb['query']['hasOwnProperty']('nolimit')){_0x4a5fb1[_0x0798('0x21')]=qs[_0x0798('0x21')](_0x4a7eeb[_0x0798('0x37')][_0x0798('0x21')]);_0x4a5fb1[_0x0798('0x1e')]=qs[_0x0798('0x1e')](_0x4a7eeb[_0x0798('0x37')][_0x0798('0x1e')]);}_0x4a5fb1['order']=qs[_0x0798('0x3d')](_0x4a7eeb['query'][_0x0798('0x3d')]);_0x4a5fb1[_0x0798('0x3e')]=qs[_0x0798('0x38')](_['pick'](_0x4a7eeb[_0x0798('0x37')],_0x93c004['filters']),_0x201e4c);if(_0x4a7eeb[_0x0798('0x37')][_0x0798('0x3f')]){_0x4a5fb1[_0x0798('0x3e')]=_['merge'](_0x4a5fb1[_0x0798('0x3e')],{'$or':_[_0x0798('0x30')](_0x201e4c,function(_0x4edb16){if(_0x4edb16[_0x0798('0x34')]!=='VIRTUAL'){var _0x4e9d94={};_0x4e9d94[_0x4edb16[_0x0798('0x2e')]]={'$like':'%'+_0x4a7eeb[_0x0798('0x37')]['filter']+'%'};return _0x4e9d94;}})});}_0x4a5fb1=_['merge']({},_0x4a5fb1,_0x4a7eeb[_0x0798('0x40')]);var _0x331218={'where':_0x4a5fb1[_0x0798('0x3e')]};return db[_0x0798('0x31')][_0x0798('0x20')](_0x331218)[_0x0798('0x28')](function(_0x27a671){_0xb8d33e['count']=_0x27a671;if(_0x4a7eeb[_0x0798('0x37')][_0x0798('0x41')]){_0x4a5fb1[_0x0798('0x42')]=[{'all':!![]}];}return db[_0x0798('0x31')][_0x0798('0x43')](_0x4a5fb1);})[_0x0798('0x28')](function(_0x4c2d8a){_0xb8d33e[_0x0798('0x44')]=_0x4c2d8a;return _0xb8d33e;})[_0x0798('0x28')](respondWithFilteredResult(_0x1dabd5,_0x4a5fb1))[_0x0798('0x45')](handleError(_0x1dabd5,null));};exports[_0x0798('0x46')]=function(_0x387450,_0xecc618){var _0x3be652={'raw':!![],'where':{'id':_0x387450[_0x0798('0x47')]['id']}},_0x10a50a={};_0x10a50a[_0x0798('0x36')]=_[_0x0798('0x48')](db[_0x0798('0x31')]['rawAttributes']);_0x10a50a[_0x0798('0x37')]=_[_0x0798('0x48')](_0x387450[_0x0798('0x37')]);_0x10a50a[_0x0798('0x38')]=_['intersection'](_0x10a50a['model'],_0x10a50a[_0x0798('0x37')]);_0x3be652[_0x0798('0x3a')]=_[_0x0798('0x39')](_0x10a50a[_0x0798('0x36')],qs['fields'](_0x387450[_0x0798('0x37')]['fields']));_0x3be652['attributes']=_0x3be652[_0x0798('0x3a')][_0x0798('0x3c')]?_0x3be652[_0x0798('0x3a')]:_0x10a50a[_0x0798('0x36')];if(_0x387450[_0x0798('0x37')][_0x0798('0x41')]){_0x3be652[_0x0798('0x42')]=[{'all':!![]}];}_0x3be652=_[_0x0798('0x49')]({},_0x3be652,_0x387450[_0x0798('0x40')]);return db['Tag'][_0x0798('0x4a')](_0x3be652)['then'](handleEntityNotFound(_0xecc618,null))[_0x0798('0x28')](respondWithResult(_0xecc618,null))[_0x0798('0x45')](handleError(_0xecc618,null));};exports[_0x0798('0x4b')]=function(_0x54634d,_0x9dea1f){return db[_0x0798('0x31')][_0x0798('0x4b')](_0x54634d[_0x0798('0x4c')],{})['then'](function(_0x2695d5){var _0x9e6db6=_0x54634d[_0x0798('0x4d')][_0x0798('0x2a')]({'plain':!![]});if(!_0x9e6db6)throw new Error(_0x0798('0x4e'));if(_0x9e6db6['role']===_0x0798('0x4d')){var _0x3e1c15=_0x2695d5[_0x0798('0x2a')]({'plain':!![]});var _0x10173d=_0x0798('0x4f');return db[_0x0798('0x50')][_0x0798('0x4a')]({'where':{'name':_0x10173d,'userProfileId':_0x9e6db6[_0x0798('0x51')]},'raw':!![]})[_0x0798('0x28')](function(_0x48dc0d){if(_0x48dc0d&&_0x48dc0d['autoAssociation']===0x0){return db[_0x0798('0x2b')][_0x0798('0x4b')]({'name':_0x3e1c15[_0x0798('0x2e')],'resourceId':_0x3e1c15['id'],'type':_0x48dc0d[_0x0798('0x2e')],'sectionId':_0x48dc0d['id']},{})[_0x0798('0x28')](function(){return _0x2695d5;});}else{return _0x2695d5;}})[_0x0798('0x45')](function(_0x3fa571){logger['error'](_0x0798('0x52'),_0x3fa571);throw _0x3fa571;});}return _0x2695d5;})['then'](respondWithResult(_0x9dea1f,0xc9))[_0x0798('0x45')](handleError(_0x9dea1f,null));};exports[_0x0798('0x27')]=function(_0x3a3cc7,_0x48a072){if(_0x3a3cc7['body']['id']){delete _0x3a3cc7['body']['id'];}return db[_0x0798('0x31')]['find']({'where':{'id':_0x3a3cc7['params']['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x48a072,null))[_0x0798('0x28')](saveUpdates(_0x3a3cc7[_0x0798('0x4c')],null))['then'](respondWithResult(_0x48a072,null))[_0x0798('0x45')](handleError(_0x48a072,null));};exports[_0x0798('0x29')]=function(_0x359a4d,_0x743d26){return db['Tag']['find']({'where':{'id':_0x359a4d[_0x0798('0x47')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x743d26,null))[_0x0798('0x28')](removeEntity(_0x743d26,null))['catch'](handleError(_0x743d26,null));}; \ No newline at end of file +var _0xcb91=['json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xcb91[_0x57474e];return _0xfaae8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){var _0x10a419=_0x55b232[_0x1cb9('0x24')]({'plain':!![]});var _0x69b4c8=_0x1cb9('0x25');return db[_0x1cb9('0x26')]['destroy']({'where':{'type':_0x69b4c8,'resourceId':_0x10a419['id']}})[_0x1cb9('0x22')](function(){return _0x55b232;});})[_0x1cb9('0x22')](function(){_0x27db16['status'](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x21effa,_0x41a9a0){return function(_0x1804fd){if(!_0x1804fd){_0x21effa[_0x1cb9('0x16')](0x194);}return _0x1804fd;};}function handleError(_0x21d6f5,_0x2e28fe){_0x2e28fe=_0x2e28fe||0x1f4;return function(_0xb644b3){logger[_0x1cb9('0x27')](_0xb644b3[_0x1cb9('0x28')]);if(_0xb644b3['name']){delete _0xb644b3[_0x1cb9('0x29')];}_0x21d6f5['status'](_0x2e28fe)[_0x1cb9('0x2a')](_0xb644b3);};}exports['index']=function(_0x278327,_0x41011c){var _0x3cd7f5={},_0x2038aa={},_0x561d89={'count':0x0,'rows':[]};var _0x1c701f=_['map'](db[_0x1cb9('0x2b')][_0x1cb9('0x2c')],function(_0x4220d7){return{'name':_0x4220d7['fieldName'],'type':_0x4220d7[_0x1cb9('0x2d')]['key']};});_0x2038aa[_0x1cb9('0x2e')]=_['map'](_0x1c701f,_0x1cb9('0x29'));_0x2038aa[_0x1cb9('0x2f')]=_[_0x1cb9('0x30')](_0x278327[_0x1cb9('0x2f')]);_0x2038aa['filters']=_[_0x1cb9('0x31')](_0x2038aa[_0x1cb9('0x2e')],_0x2038aa[_0x1cb9('0x2f')]);_0x3cd7f5[_0x1cb9('0x32')]=_[_0x1cb9('0x31')](_0x2038aa[_0x1cb9('0x2e')],qs[_0x1cb9('0x33')](_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x3cd7f5[_0x1cb9('0x32')]=_0x3cd7f5[_0x1cb9('0x32')][_0x1cb9('0x34')]?_0x3cd7f5[_0x1cb9('0x32')]:_0x2038aa['model'];if(!_0x278327['query'][_0x1cb9('0x35')](_0x1cb9('0x36'))){_0x3cd7f5[_0x1cb9('0x1c')]=qs[_0x1cb9('0x1c')](_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x1c')]);_0x3cd7f5[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0x278327['query'][_0x1cb9('0x1a')]);}_0x3cd7f5[_0x1cb9('0x37')]=qs[_0x1cb9('0x38')](_0x278327['query'][_0x1cb9('0x38')]);_0x3cd7f5['where']=qs[_0x1cb9('0x39')](_['pick'](_0x278327[_0x1cb9('0x2f')],_0x2038aa[_0x1cb9('0x39')]),_0x1c701f);if(_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3a')]){_0x3cd7f5[_0x1cb9('0x3b')]=_[_0x1cb9('0x3c')](_0x3cd7f5[_0x1cb9('0x3b')],{'$or':_['map'](_0x1c701f,function(_0x4ca19e){if(_0x4ca19e[_0x1cb9('0x2d')]!==_0x1cb9('0x3d')){var _0x7a0d8b={};_0x7a0d8b[_0x4ca19e[_0x1cb9('0x29')]]={'$like':'%'+_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3a')]+'%'};return _0x7a0d8b;}})});}_0x3cd7f5=_[_0x1cb9('0x3c')]({},_0x3cd7f5,_0x278327['options']);var _0xbcaa32={'where':_0x3cd7f5['where']};return db['Tag']['count'](_0xbcaa32)[_0x1cb9('0x22')](function(_0x397ff9){_0x561d89[_0x1cb9('0x1d')]=_0x397ff9;if(_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3e')]){_0x3cd7f5['include']=[{'all':!![]}];}return db[_0x1cb9('0x2b')]['findAll'](_0x3cd7f5);})[_0x1cb9('0x22')](function(_0x71db9d){_0x561d89[_0x1cb9('0x3f')]=_0x71db9d;return _0x561d89;})['then'](respondWithFilteredResult(_0x41011c,_0x3cd7f5))[_0x1cb9('0x40')](handleError(_0x41011c,null));};exports['show']=function(_0xda1a44,_0xbc36fc){var _0x51a898={'raw':!![],'where':{'id':_0xda1a44[_0x1cb9('0x41')]['id']}},_0x5839aa={};_0x5839aa[_0x1cb9('0x2e')]=_[_0x1cb9('0x30')](db[_0x1cb9('0x2b')][_0x1cb9('0x2c')]);_0x5839aa['query']=_[_0x1cb9('0x30')](_0xda1a44['query']);_0x5839aa['filters']=_['intersection'](_0x5839aa[_0x1cb9('0x2e')],_0x5839aa[_0x1cb9('0x2f')]);_0x51a898[_0x1cb9('0x32')]=_[_0x1cb9('0x31')](_0x5839aa[_0x1cb9('0x2e')],qs[_0x1cb9('0x33')](_0xda1a44[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x51a898[_0x1cb9('0x32')]=_0x51a898[_0x1cb9('0x32')][_0x1cb9('0x34')]?_0x51a898['attributes']:_0x5839aa[_0x1cb9('0x2e')];if(_0xda1a44[_0x1cb9('0x2f')][_0x1cb9('0x3e')]){_0x51a898['include']=[{'all':!![]}];}_0x51a898=_[_0x1cb9('0x3c')]({},_0x51a898,_0xda1a44[_0x1cb9('0x42')]);return db[_0x1cb9('0x2b')][_0x1cb9('0x43')](_0x51a898)[_0x1cb9('0x22')](handleEntityNotFound(_0xbc36fc,null))['then'](respondWithResult(_0xbc36fc,null))[_0x1cb9('0x40')](handleError(_0xbc36fc,null));};exports['create']=function(_0x2eaa11,_0x4ac483){return db[_0x1cb9('0x2b')][_0x1cb9('0x44')](_0x2eaa11[_0x1cb9('0x45')],{})[_0x1cb9('0x22')](function(_0x56d0c5){var _0x298475=_0x2eaa11[_0x1cb9('0x46')][_0x1cb9('0x24')]({'plain':!![]});if(!_0x298475)throw new Error(_0x1cb9('0x47'));if(_0x298475[_0x1cb9('0x48')]===_0x1cb9('0x46')){var _0x17b92a=_0x56d0c5[_0x1cb9('0x24')]({'plain':!![]});var _0xbb500e=_0x1cb9('0x25');return db['UserProfileSection']['find']({'where':{'name':_0xbb500e,'userProfileId':_0x298475[_0x1cb9('0x49')]},'raw':!![]})[_0x1cb9('0x22')](function(_0x19e83a){if(_0x19e83a&&_0x19e83a[_0x1cb9('0x4a')]===0x0){return db[_0x1cb9('0x26')][_0x1cb9('0x44')]({'name':_0x17b92a[_0x1cb9('0x29')],'resourceId':_0x17b92a['id'],'type':_0x19e83a[_0x1cb9('0x29')],'sectionId':_0x19e83a['id']},{})[_0x1cb9('0x22')](function(){return _0x56d0c5;});}else{return _0x56d0c5;}})[_0x1cb9('0x40')](function(_0x4a4b87){logger[_0x1cb9('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a4b87);throw _0x4a4b87;});}return _0x56d0c5;})[_0x1cb9('0x22')](respondWithResult(_0x4ac483,0xc9))['catch'](handleError(_0x4ac483,null));};exports[_0x1cb9('0x21')]=function(_0x53c002,_0x5e5174){if(_0x53c002[_0x1cb9('0x45')]['id']){delete _0x53c002[_0x1cb9('0x45')]['id'];}return db[_0x1cb9('0x2b')]['find']({'where':{'id':_0x53c002[_0x1cb9('0x41')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x5e5174,null))['then'](saveUpdates(_0x53c002['body'],null))[_0x1cb9('0x22')](respondWithResult(_0x5e5174,null))[_0x1cb9('0x40')](handleError(_0x5e5174,null));};exports[_0x1cb9('0x23')]=function(_0x2b3f2a,_0x3de325){return db[_0x1cb9('0x2b')][_0x1cb9('0x43')]({'where':{'id':_0x2b3f2a['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x3de325,null))[_0x1cb9('0x22')](removeEntity(_0x3de325,null))[_0x1cb9('0x40')](handleError(_0x3de325,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 962341c..b8ea007 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 _0x1ec8=['../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1b8f9c,_0x278fdb){var _0xed84ea=function(_0x1e81ed){while(--_0x1e81ed){_0x1b8f9c['push'](_0x1b8f9c['shift']());}};_0xed84ea(++_0x278fdb);}(_0x1ec8,0xc9));var _0x81ec=function(_0x474eae,_0x154071){_0x474eae=_0x474eae-0x0;var _0x283957=_0x1ec8[_0x474eae];return _0x283957;};'use strict';var _=require(_0x81ec('0x0'));var util=require(_0x81ec('0x1'));var logger=require(_0x81ec('0x2'))('api');var moment=require(_0x81ec('0x3'));var BPromise=require(_0x81ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81ec('0x5'));var rimraf=require(_0x81ec('0x6'));var config=require(_0x81ec('0x7'));var attributes=require(_0x81ec('0x8'));module[_0x81ec('0x9')]=function(_0x270f85,_0x274da1){return _0x270f85[_0x81ec('0xa')](_0x81ec('0xb'),attributes,{'tableName':_0x81ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2236=['lodash','util','../../config/logger','api','request-promise','../../config/environment','./tag.attributes','define','Tag','tools_tags'];(function(_0x5cd148,_0x124df1){var _0xd9f73e=function(_0x58961b){while(--_0x58961b){_0x5cd148['push'](_0x5cd148['shift']());}};_0xd9f73e(++_0x124df1);}(_0x2236,0x1d6));var _0x6223=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x2236[_0x2b9e8a];return _0x520e67;};'use strict';var _=require(_0x6223('0x0'));var util=require(_0x6223('0x1'));var logger=require(_0x6223('0x2'))(_0x6223('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6223('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6223('0x5'));var attributes=require(_0x6223('0x6'));module['exports']=function(_0x1f68cc,_0x4f5a9b){return _0x1f68cc[_0x6223('0x7')](_0x6223('0x8'),attributes,{'tableName':_0x6223('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 6c0da15..07413e9 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 _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','Tag,\x20%s,\x20%s','message','catch','util'];(function(_0x246223,_0x314a73){var _0x101352=function(_0x3f9138){while(--_0x3f9138){_0x246223['push'](_0x246223['shift']());}};_0x101352(++_0x314a73);}(_0xedd9,0xfc));var _0x9edd=function(_0x366cbf,_0x1d399d){_0x366cbf=_0x366cbf-0x0;var _0x214bee=_0xedd9[_0x366cbf];return _0x214bee;};'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')]('Tag,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('Tag,\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 _0x9221=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x6f2d34,_0x2cfb4f){var _0x3bb96d=function(_0x1c1fce){while(--_0x1c1fce){_0x6f2d34['push'](_0x6f2d34['shift']());}};_0x3bb96d(++_0x2cfb4f);}(_0x9221,0x64));var _0x1922=function(_0x2c1144,_0x5264a8){_0x2c1144=_0x2c1144-0x0;var _0x147bd2=_0x9221[_0x2c1144];return _0x147bd2;};'use strict';var _=require('lodash');var util=require(_0x1922('0x0'));var moment=require(_0x1922('0x1'));var BPromise=require('bluebird');var rs=require(_0x1922('0x2'));var fs=require('fs');var Redis=require(_0x1922('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1922('0x4'));var logger=require(_0x1922('0x5'))(_0x1922('0x6'));var config=require(_0x1922('0x7'));var jayson=require(_0x1922('0x8'));var client=jayson[_0x1922('0x9')][_0x1922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa05c,_0x116227,_0x3cfd98){return new BPromise(function(_0x195fa4,_0x47c225){return client[_0x1922('0xb')](_0x5aa05c,_0x3cfd98)['then'](function(_0x2b6c51){logger[_0x1922('0xc')](_0x1922('0xd'),_0x116227,'request\x20sent');logger[_0x1922('0xe')](_0x1922('0xf'),_0x116227,'request\x20sent',JSON[_0x1922('0x10')](_0x2b6c51));if(_0x2b6c51['error']){if(_0x2b6c51[_0x1922('0x11')]['code']===0x1f4){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')]['message']);return _0x47c225(_0x2b6c51['error'][_0x1922('0x12')]);}logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')][_0x1922('0x12')]);return _0x195fa4(_0x2b6c51['error'][_0x1922('0x12')]);}else{logger['info'](_0x1922('0xd'),_0x116227,_0x1922('0x13'));_0x195fa4(_0x2b6c51[_0x1922('0x14')][_0x1922('0x12')]);}})['catch'](function(_0x459511){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x459511);_0x47c225(_0x459511);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index a705503..22feeb4 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 cc31e94..96ac5d6 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 _0xb7e7=['STRING','sequelize'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xb7e7[_0x5f0089];return _0x193892;};'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 +var _0x0713=['STRING','name'];(function(_0x3f5594,_0x53503e){var _0x153c29=function(_0x24d35c){while(--_0x24d35c){_0x3f5594['push'](_0x3f5594['shift']());}};_0x153c29(++_0x53503e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 0a01eff..2044674 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 _0x2dea=['type','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','findAll','rows','catch','params','keys','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','UserVoicePrefix','getQueues','channel','Unknown\x20channel','options','toLowerCase','Queues','addQueues','findOne','isValidChannel','ValidationError','add','ids','removeQueues','capitalize','addAgents','isArray','Chat','Mail','Sms','Fax','Openchannel','transaction','Voice','through','penalty','User','findOrCreate','emit','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','TeamVoiceQueue','all','TeamVoicePrefix','spread','Whatsapp','removeAgents','VoicePrefixId','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','defaults','register','status','end','undefined','limit','count','offset','set','Content-Range','json','save','sendStatus','error','stack','name','send','index','map','Team','rawAttributes'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2dea,0x66));var _0xa2de=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0x2dea[_0x2adfb1];return _0xa52d45;};'use strict';var emlformat=require(_0xa2de('0x0'));var rimraf=require(_0xa2de('0x1'));var zipdir=require(_0xa2de('0x2'));var jsonpatch=require(_0xa2de('0x3'));var rp=require(_0xa2de('0x4'));var moment=require(_0xa2de('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa2de('0x6'));var util=require(_0xa2de('0x7'));var path=require('path');var sox=require(_0xa2de('0x8'));var csv=require(_0xa2de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2de('0xa'));var squel=require(_0xa2de('0xb'));var crypto=require(_0xa2de('0xc'));var jsforce=require(_0xa2de('0xd'));var deskjs=require(_0xa2de('0xe'));var toCsv=require(_0xa2de('0x9'));var querystring=require('querystring');var Papa=require(_0xa2de('0xf'));var Redis=require(_0xa2de('0x10'));var authService=require(_0xa2de('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa2de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa2de('0x13'));var utils=require('../../config/utils');var config=require(_0xa2de('0x14'));var licenseUtil=require(_0xa2de('0x15'));var db=require('../../mysqldb')['db'];config[_0xa2de('0x16')]=_[_0xa2de('0x17')](config[_0xa2de('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa2de('0x16')]));require('./team.socket')[_0xa2de('0x18')](socket);function respondWithStatusCode(_0x49bf97,_0x4282c0){_0x4282c0=_0x4282c0||0xcc;return function(_0x5761c2){if(_0x5761c2){return _0x49bf97['sendStatus'](_0x4282c0);}return _0x49bf97[_0xa2de('0x19')](_0x4282c0)[_0xa2de('0x1a')]();};}function respondWithResult(_0x522226,_0x4eef46){_0x4eef46=_0x4eef46||0xc8;return function(_0x401f8b){if(_0x401f8b){return _0x522226['status'](_0x4eef46)['json'](_0x401f8b);}};}function respondWithFilteredResult(_0x32a482,_0x3e4895){return function(_0x33dcae){if(_0x33dcae){var _0x351f16=typeof _0x3e4895['offset']===_0xa2de('0x1b')&&typeof _0x3e4895[_0xa2de('0x1c')]===_0xa2de('0x1b');var _0x582032=_0x33dcae[_0xa2de('0x1d')];var _0xb4511e=_0x351f16?0x0:_0x3e4895[_0xa2de('0x1e')];var _0x307b3f=_0x351f16?_0x33dcae[_0xa2de('0x1d')]:_0x3e4895['offset']+_0x3e4895['limit'];var _0x416c0f;if(_0x307b3f>=_0x582032){_0x307b3f=_0x582032;_0x416c0f=0xc8;}else{_0x416c0f=0xce;}_0x32a482['status'](_0x416c0f);return _0x32a482[_0xa2de('0x1f')](_0xa2de('0x20'),_0xb4511e+'-'+_0x307b3f+'/'+_0x582032)[_0xa2de('0x21')](_0x33dcae);}return null;};}function patchUpdates(_0x49fd9d){return function(_0x53f7a4){try{jsonpatch['apply'](_0x53f7a4,_0x49fd9d,!![]);}catch(_0x21441d){return BPromise['reject'](_0x21441d);}return _0x53f7a4[_0xa2de('0x22')]();};}function saveUpdates(_0x29e3e9,_0x2542cc){return function(_0x175eb3){if(_0x175eb3){return _0x175eb3['update'](_0x29e3e9)['then'](function(_0x2d5d0c){return _0x2d5d0c;});}return null;};}function handleEntityNotFound(_0x59980f,_0x5c8892){return function(_0x3ab97f){if(!_0x3ab97f){_0x59980f[_0xa2de('0x23')](0x194);}return _0x3ab97f;};}function handleError(_0x3f92c1,_0x3477c9){_0x3477c9=_0x3477c9||0x1f4;return function(_0x453d53){logger[_0xa2de('0x24')](_0x453d53[_0xa2de('0x25')]);if(_0x453d53[_0xa2de('0x26')]){delete _0x453d53[_0xa2de('0x26')];}_0x3f92c1[_0xa2de('0x19')](_0x3477c9)[_0xa2de('0x27')](_0x453d53);};}exports[_0xa2de('0x28')]=function(_0x490c38,_0x560332){var _0x3f9f28={},_0x1e4907={},_0x5b3b0b={'count':0x0,'rows':[]};var _0x2b242a=_[_0xa2de('0x29')](db[_0xa2de('0x2a')][_0xa2de('0x2b')],function(_0x35416a){return{'name':_0x35416a['fieldName'],'type':_0x35416a[_0xa2de('0x2c')][_0xa2de('0x2d')]};});_0x1e4907[_0xa2de('0x2e')]=_[_0xa2de('0x29')](_0x2b242a,_0xa2de('0x26'));_0x1e4907[_0xa2de('0x2f')]=_['keys'](_0x490c38[_0xa2de('0x2f')]);_0x1e4907['filters']=_[_0xa2de('0x30')](_0x1e4907[_0xa2de('0x2e')],_0x1e4907['query']);_0x3f9f28[_0xa2de('0x31')]=_[_0xa2de('0x30')](_0x1e4907[_0xa2de('0x2e')],qs[_0xa2de('0x32')](_0x490c38[_0xa2de('0x2f')][_0xa2de('0x32')]));_0x3f9f28[_0xa2de('0x31')]=_0x3f9f28[_0xa2de('0x31')]['length']?_0x3f9f28[_0xa2de('0x31')]:_0x1e4907[_0xa2de('0x2e')];if(!_0x490c38[_0xa2de('0x2f')][_0xa2de('0x33')]('nolimit')){_0x3f9f28[_0xa2de('0x1c')]=qs[_0xa2de('0x1c')](_0x490c38[_0xa2de('0x2f')]['limit']);_0x3f9f28[_0xa2de('0x1e')]=qs['offset'](_0x490c38[_0xa2de('0x2f')][_0xa2de('0x1e')]);}_0x3f9f28[_0xa2de('0x34')]=qs[_0xa2de('0x35')](_0x490c38[_0xa2de('0x2f')][_0xa2de('0x35')]);_0x3f9f28[_0xa2de('0x36')]=qs[_0xa2de('0x37')](_[_0xa2de('0x38')](_0x490c38[_0xa2de('0x2f')],_0x1e4907[_0xa2de('0x37')]),_0x2b242a);if(_0x490c38[_0xa2de('0x2f')][_0xa2de('0x39')]){_0x3f9f28['where']=_[_0xa2de('0x3a')](_0x3f9f28[_0xa2de('0x36')],{'$or':_['map'](_0x2b242a,function(_0x65ca69){if(_0x65ca69[_0xa2de('0x2c')]!==_0xa2de('0x3b')){var _0x58d26a={};_0x58d26a[_0x65ca69['name']]={'$like':'%'+_0x490c38[_0xa2de('0x2f')][_0xa2de('0x39')]+'%'};return _0x58d26a;}})});}_0x3f9f28=_[_0xa2de('0x3a')]({},_0x3f9f28,_0x490c38['options']);var _0x3e1706={'where':_0x3f9f28[_0xa2de('0x36')]};return db['Team']['count'](_0x3e1706)[_0xa2de('0x3c')](function(_0x198a57){_0x5b3b0b[_0xa2de('0x1d')]=_0x198a57;if(_0x490c38['query'][_0xa2de('0x3d')]){_0x3f9f28['include']=[{'all':!![]}];}return db[_0xa2de('0x2a')][_0xa2de('0x3e')](_0x3f9f28);})[_0xa2de('0x3c')](function(_0x2c6676){_0x5b3b0b[_0xa2de('0x3f')]=_0x2c6676;return _0x5b3b0b;})[_0xa2de('0x3c')](respondWithFilteredResult(_0x560332,_0x3f9f28))[_0xa2de('0x40')](handleError(_0x560332,null));};exports['show']=function(_0x487572,_0x1e06b4){var _0x399b43={'raw':![],'where':{'id':_0x487572[_0xa2de('0x41')]['id']}},_0x20b144={};_0x20b144[_0xa2de('0x2e')]=_[_0xa2de('0x42')](db[_0xa2de('0x2a')][_0xa2de('0x2b')]);_0x20b144[_0xa2de('0x2f')]=_[_0xa2de('0x42')](_0x487572[_0xa2de('0x2f')]);_0x20b144['filters']=_[_0xa2de('0x30')](_0x20b144[_0xa2de('0x2e')],_0x20b144[_0xa2de('0x2f')]);_0x399b43['attributes']=_[_0xa2de('0x30')](_0x20b144['model'],qs[_0xa2de('0x32')](_0x487572[_0xa2de('0x2f')][_0xa2de('0x32')]));_0x399b43[_0xa2de('0x31')]=_0x399b43[_0xa2de('0x31')][_0xa2de('0x43')]?_0x399b43[_0xa2de('0x31')]:_0x20b144[_0xa2de('0x2e')];if(_0x487572[_0xa2de('0x2f')][_0xa2de('0x3d')]){_0x399b43['include']=[{'all':!![]}];}_0x399b43=_[_0xa2de('0x3a')]({},_0x399b43,_0x487572['options']);return db[_0xa2de('0x2a')][_0xa2de('0x44')](_0x399b43)[_0xa2de('0x3c')](handleEntityNotFound(_0x1e06b4,null))[_0xa2de('0x3c')](respondWithResult(_0x1e06b4,null))[_0xa2de('0x40')](handleError(_0x1e06b4,null));};exports[_0xa2de('0x45')]=function(_0x441151,_0x1ffdaa){return db[_0xa2de('0x2a')][_0xa2de('0x45')](_0x441151[_0xa2de('0x46')],{})[_0xa2de('0x3c')](function(_0x1b76b4){var _0x18b87=_0x441151['user'][_0xa2de('0x47')]({'plain':!![]});if(!_0x18b87)throw new Error(_0xa2de('0x48'));if(_0x18b87[_0xa2de('0x49')]===_0xa2de('0x4a')){var _0x106ca2=_0x1b76b4['get']({'plain':!![]});var _0x4dd396=_0xa2de('0x4b');return db[_0xa2de('0x4c')][_0xa2de('0x44')]({'where':{'name':_0x4dd396,'userProfileId':_0x18b87['userProfileId']},'raw':!![]})['then'](function(_0x250ca5){if(_0x250ca5&&_0x250ca5['autoAssociation']===0x0){return db[_0xa2de('0x4d')]['create']({'name':_0x106ca2[_0xa2de('0x26')],'resourceId':_0x106ca2['id'],'type':_0x250ca5[_0xa2de('0x26')],'sectionId':_0x250ca5['id']},{})['then'](function(){return _0x1b76b4;});}else{return _0x1b76b4;}})['catch'](function(_0x3970a5){logger[_0xa2de('0x24')](_0xa2de('0x4e'),_0x3970a5);throw _0x3970a5;});}return _0x1b76b4;})[_0xa2de('0x3c')](respondWithResult(_0x1ffdaa,0xc9))['catch'](handleError(_0x1ffdaa,null));};exports[_0xa2de('0x4f')]=function(_0x5c90c2,_0x2c3cf1){if(_0x5c90c2['body']['id']){delete _0x5c90c2['body']['id'];}return db[_0xa2de('0x2a')][_0xa2de('0x44')]({'where':{'id':_0x5c90c2[_0xa2de('0x41')]['id']}})[_0xa2de('0x3c')](handleEntityNotFound(_0x2c3cf1,null))[_0xa2de('0x3c')](saveUpdates(_0x5c90c2['body'],null))[_0xa2de('0x3c')](respondWithResult(_0x2c3cf1,null))['catch'](handleError(_0x2c3cf1,null));};exports[_0xa2de('0x50')]=function(_0x33e107,_0x3910b0){var _0x5d55d1=_0x33e107[_0xa2de('0x41')]['id'];var _0x26b1b1=[];return db[_0xa2de('0x51')]['transaction'](function(_0x4c6d80){var _0x452b51=_0xa2de('0x52')+_0x5d55d1;return db[_0xa2de('0x51')][_0xa2de('0x2f')](_0x452b51,{'type':db['Sequelize'][_0xa2de('0x53')][_0xa2de('0x54')],'raw':!![],'transaction':_0x4c6d80})[_0xa2de('0x3c')](function(_0x3a7b9b){_0x26b1b1=_[_0xa2de('0x29')](_0x3a7b9b,function(_0x139a2d){return Number(_0x139a2d['UserId']);});})[_0xa2de('0x3c')](function(){var _0xe73b22='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5d55d1;return db[_0xa2de('0x51')][_0xa2de('0x2f')](_0xe73b22,{'type':db['Sequelize'][_0xa2de('0x53')]['SELECT'],'raw':!![],'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(_0x4595b1){var _0x23f26c=_['map'](_0x4595b1,function(_0x5aa23f){return Number(_0x5aa23f['VoiceQueueId']);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x26b1b1},'VoiceQueueId':{'$in':_0x23f26c}},'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(){var _0x55b3d1=_0xa2de('0x55')+_0x5d55d1;return db[_0xa2de('0x51')][_0xa2de('0x2f')](_0x55b3d1,{'type':db[_0xa2de('0x56')][_0xa2de('0x53')][_0xa2de('0x54')],'raw':!![],'transaction':_0x4c6d80});})['then'](function(_0x58290a){var _0x559501=_['map'](_0x58290a,function(_0x5a484e){return Number(_0x5a484e['MailQueueId']);});return db[_0xa2de('0x57')]['destroy']({'where':{'UserId':{'$in':_0x26b1b1},'MailQueueId':{'$in':_0x559501}},'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(){var _0x375797=_0xa2de('0x58')+_0x5d55d1;return db[_0xa2de('0x51')][_0xa2de('0x2f')](_0x375797,{'type':db['Sequelize']['QueryTypes'][_0xa2de('0x54')],'raw':!![],'transaction':_0x4c6d80});})['then'](function(_0x25279e){var _0xe744bd=_[_0xa2de('0x29')](_0x25279e,function(_0x5ae82b){return Number(_0x5ae82b[_0xa2de('0x59')]);});return db[_0xa2de('0x5a')][_0xa2de('0x50')]({'where':{'UserId':{'$in':_0x26b1b1},'SmsQueueId':{'$in':_0xe744bd}},'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(){var _0x210c69=_0xa2de('0x5b')+_0x5d55d1;return db[_0xa2de('0x51')]['query'](_0x210c69,{'type':db[_0xa2de('0x56')][_0xa2de('0x53')][_0xa2de('0x54')],'raw':!![],'transaction':_0x4c6d80});})['then'](function(_0x1a6134){var _0x122a7b=_['map'](_0x1a6134,function(_0x53318d){return Number(_0x53318d[_0xa2de('0x5c')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x26b1b1},'ChatQueueId':{'$in':_0x122a7b}},'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(){var _0x2c81c6=_0xa2de('0x5d')+_0x5d55d1;return db[_0xa2de('0x51')]['query'](_0x2c81c6,{'type':db['Sequelize']['QueryTypes'][_0xa2de('0x54')],'raw':!![],'transaction':_0x4c6d80});})['then'](function(_0x10f639){var _0x466c66=_[_0xa2de('0x29')](_0x10f639,function(_0x2cdf6f){return Number(_0x2cdf6f[_0xa2de('0x5e')]);});return db['UserFaxQueue'][_0xa2de('0x50')]({'where':{'UserId':{'$in':_0x26b1b1},'FaxQueueId':{'$in':_0x466c66}},'transaction':_0x4c6d80});})['then'](function(){var _0x4d0ef3=_0xa2de('0x5f')+_0x5d55d1;return db['sequelize'][_0xa2de('0x2f')](_0x4d0ef3,{'type':db[_0xa2de('0x56')][_0xa2de('0x53')][_0xa2de('0x54')],'raw':!![],'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(_0x5339cd){var _0x26f1bd=_[_0xa2de('0x29')](_0x5339cd,function(_0x144a1d){return Number(_0x144a1d[_0xa2de('0x60')]);});return db[_0xa2de('0x61')]['destroy']({'where':{'UserId':{'$in':_0x26b1b1},'OpenchannelQueueId':{'$in':_0x26f1bd}},'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(){var _0x5463b0=_0xa2de('0x62')+_0x5d55d1;return db['sequelize'][_0xa2de('0x2f')](_0x5463b0,{'type':db[_0xa2de('0x56')][_0xa2de('0x53')]['SELECT'],'raw':!![],'transaction':_0x4c6d80});})['then'](function(_0x14c196){var _0x24b3e1=_[_0xa2de('0x29')](_0x14c196,function(_0x3a3b7e){return Number(_0x3a3b7e['WhatsappQueueId']);});return db[_0xa2de('0x63')][_0xa2de('0x50')]({'where':{'UserId':{'$in':_0x26b1b1},'WhatsappQueueId':{'$in':_0x24b3e1}},'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(){return db['TeamVoicePrefix'][_0xa2de('0x44')]({'where':{'TeamId':_0x5d55d1}});})[_0xa2de('0x3c')](function(_0x5e68e7){if(_0x5e68e7===null){return;}return db[_0xa2de('0x64')][_0xa2de('0x50')]({'where':{'UserId':{'$in':_0x26b1b1},'VoicePrefixId':_0x5e68e7['VoicePrefixId']},'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(){return db[_0xa2de('0x2a')][_0xa2de('0x50')]({'where':{'id':_0x5d55d1},'cascade':!![],'transaction':_0x4c6d80});})[_0xa2de('0x3c')](function(_0x3fcd2d){if(_0x3fcd2d===0x0){_0x3910b0[_0xa2de('0x23')](0x194);}else{return db[_0xa2de('0x4d')][_0xa2de('0x50')]({'where':{'type':_0xa2de('0x4b'),'resourceId':_0x5d55d1},'cascade':!![],'transaction':_0x4c6d80})[_0xa2de('0x3c')](function(){_0x3910b0['status'](0xcc)[_0xa2de('0x1a')]();});}})['catch'](function(_0x51b455){_0x3910b0[_0xa2de('0x19')](0x1f4)[_0xa2de('0x27')](_0x51b455);});});};exports[_0xa2de('0x65')]=function(_0x416fd2,_0x28ac75,_0x3b801f){return db[_0xa2de('0x2a')]['findOne']({'where':{'id':_0x416fd2[_0xa2de('0x41')]['id']}})[_0xa2de('0x3c')](handleEntityNotFound(_0x28ac75,null))[_0xa2de('0x3c')](function(_0x21ecd7){if(!_0x416fd2['query']['channel']||!utils['isValidChannel'](_0x416fd2[_0xa2de('0x2f')][_0xa2de('0x66')])){throw new db[(_0xa2de('0x56'))]['ValidationError'](_0xa2de('0x67'));}var _0x1c0099={};var _0x42f8d9={};_0x42f8d9[_0xa2de('0x2e')]=_[_0xa2de('0x42')](db[_['capitalize'](_0x416fd2[_0xa2de('0x2f')][_0xa2de('0x66')]['toLowerCase']())+'Queue'][_0xa2de('0x2b')]);_0x42f8d9['query']=_[_0xa2de('0x42')](_0x416fd2['query']);_0x42f8d9[_0xa2de('0x37')]=_[_0xa2de('0x30')](_0x42f8d9[_0xa2de('0x2e')],_0x42f8d9['query']);_0x1c0099['attributes']=_[_0xa2de('0x30')](_0x42f8d9[_0xa2de('0x2e')],qs[_0xa2de('0x32')](_0x416fd2[_0xa2de('0x2f')][_0xa2de('0x32')]));_0x1c0099[_0xa2de('0x31')]=_0x1c0099['attributes'][_0xa2de('0x43')]?_0x1c0099['attributes']:_0x42f8d9[_0xa2de('0x2e')];_0x1c0099['limit']=qs['limit'](_0x416fd2['query'][_0xa2de('0x1c')]);_0x1c0099['offset']=qs[_0xa2de('0x1e')](_0x416fd2['query'][_0xa2de('0x1e')]);_0x1c0099[_0xa2de('0x34')]=qs[_0xa2de('0x35')](_0x416fd2[_0xa2de('0x2f')]['sort']);_0x1c0099[_0xa2de('0x36')]=qs['filters'](_[_0xa2de('0x38')](_0x416fd2[_0xa2de('0x2f')],_0x42f8d9[_0xa2de('0x37')]));_0x1c0099=_[_0xa2de('0x3a')]({},_0x1c0099,_0x416fd2[_0xa2de('0x68')]);return _0x21ecd7[_0xa2de('0x47')+_['capitalize'](_0x416fd2[_0xa2de('0x2f')][_0xa2de('0x66')][_0xa2de('0x69')]())+_0xa2de('0x6a')](_0x1c0099);})['then'](respondWithResult(_0x28ac75,null))[_0xa2de('0x40')](handleError(_0x28ac75,null));};exports[_0xa2de('0x6b')]=function(_0x1ec08c,_0x5d2c55,_0x345493){return db[_0xa2de('0x2a')][_0xa2de('0x6c')]({'where':{'id':_0x1ec08c[_0xa2de('0x41')]['id']}})[_0xa2de('0x3c')](function(_0x542651){if(_0x542651){if(!_0x1ec08c[_0xa2de('0x46')]['channel']||!utils[_0xa2de('0x6d')](_0x1ec08c[_0xa2de('0x46')][_0xa2de('0x66')])){throw new db[(_0xa2de('0x56'))][(_0xa2de('0x6e'))](_0xa2de('0x67'));}return _0x542651[_0xa2de('0x6f')+_['capitalize'](_0x1ec08c['body'][_0xa2de('0x66')]['toLowerCase']())+'Queues'](_0x1ec08c[_0xa2de('0x46')][_0xa2de('0x70')]);}return null;})[_0xa2de('0x3c')](handleEntityNotFound(_0x5d2c55,null))['then'](respondWithStatusCode(_0x5d2c55,null))[_0xa2de('0x40')](handleError(_0x5d2c55,null));};exports[_0xa2de('0x71')]=function(_0x391ab9,_0x33a231,_0x545d72){return db[_0xa2de('0x2a')][_0xa2de('0x6c')]({'where':{'id':_0x391ab9[_0xa2de('0x41')]['id']}})[_0xa2de('0x3c')](function(_0x3b4d91){if(_0x3b4d91){if(!_0x391ab9[_0xa2de('0x2f')]['channel']||!utils[_0xa2de('0x6d')](_0x391ab9['query'][_0xa2de('0x66')])){throw new db[(_0xa2de('0x56'))][(_0xa2de('0x6e'))]('Unknown\x20channel');}return _0x3b4d91['remove'+_[_0xa2de('0x72')](_0x391ab9[_0xa2de('0x2f')][_0xa2de('0x66')]['toLowerCase']())+_0xa2de('0x6a')](_0x391ab9[_0xa2de('0x2f')][_0xa2de('0x70')]);}return null;})['then'](handleEntityNotFound(_0x33a231,null))[_0xa2de('0x3c')](respondWithStatusCode(_0x33a231,null))['catch'](handleError(_0x33a231,null));};exports[_0xa2de('0x73')]=function(_0x4d68e3,_0x335f6c){var _0x3bb86d=_[_0xa2de('0x74')](_0x4d68e3[_0xa2de('0x46')][_0xa2de('0x70')])?_0x4d68e3[_0xa2de('0x46')]['ids']:[_0x4d68e3[_0xa2de('0x46')]['ids']];var _0x7b7eb=_0x4d68e3[_0xa2de('0x41')]['id'];return db['Team']['find']({'where':{'id':_0x7b7eb}})[_0xa2de('0x3c')](handleEntityNotFound(_0x335f6c,null))[_0xa2de('0x3c')](function(_0x56475c){if(_0x56475c){var _0x220617=['Voice',_0xa2de('0x75'),_0xa2de('0x76'),_0xa2de('0x77'),_0xa2de('0x78'),_0xa2de('0x79'),'Whatsapp'];return db['sequelize'][_0xa2de('0x7a')](function(_0x2961a5){var _0x515ec8=_['map'](_0x220617,function(_0x1b6052){var _0x138c76={'attributes':['id',_0xa2de('0x26')]};if(_0x1b6052===_0xa2de('0x7b')){_0x138c76[_0xa2de('0x7c')]={'attributes':['penalty']};}return _0x56475c['get'+_0x1b6052+_0xa2de('0x6a')](_0x138c76)[_0xa2de('0x3c')](function(_0xaaf619){var _0x30f2d7=_[_0xa2de('0x29')](_0xaaf619,function(_0x3d66a0){var _0x346135=_['map'](_0x3bb86d,function(_0x11dca6){var _0x5e1b4b={'where':{'UserId':_0x11dca6,[_0x1b6052+'QueueId']:_0x3d66a0['id']},'transaction':_0x2961a5};if(_0x1b6052===_0xa2de('0x7b')){_0x5e1b4b[_0xa2de('0x17')]={'penalty':_0x3d66a0['TeamVoiceQueue'][_0xa2de('0x7d')]};}return db[_0xa2de('0x7e')+_0x1b6052+'Queue'][_0xa2de('0x7f')](_0x5e1b4b)[_0xa2de('0x3c')](function(){socket[_0xa2de('0x80')](_0xa2de('0x4a')+_0x1b6052+_0xa2de('0x81'),{'UserId':_0x11dca6,[_0x1b6052+_0xa2de('0x82')]:_0x3d66a0['id']});if(_0x1b6052!==_0xa2de('0x7b')){return;}return db[_0xa2de('0x7e')][_0xa2de('0x3e')]({'where':{'id':_0x3bb86d,'online':0x1},'attributes':['id',_0xa2de('0x26'),_0xa2de('0x83'),_0xa2de('0x84'),_0xa2de('0x85')],'raw':!![]})[_0xa2de('0x3c')](function(_0x3fef11){var _0x407d38=_[_0xa2de('0x29')](_0x3fef11,function(_0x51ecbc){return db[_0xa2de('0x86')][_0xa2de('0x87')]({'membername':_0x51ecbc[_0xa2de('0x26')],'UserId':_0x51ecbc['id'],'queue_name':_0x3d66a0[_0xa2de('0x26')],'VoiceQueueId':_0x3d66a0['id'],'interface':_[_0xa2de('0x88')](_0x51ecbc['interface'])?util['format']('SIP/%s',_0x51ecbc[_0xa2de('0x26')]):_0x51ecbc[_0xa2de('0x85')],'paused':_0x51ecbc['voicePause']||![],'penalty':_0x3d66a0[_0xa2de('0x89')]['penalty']},{'transaction':_0x2961a5});});return Promise[_0xa2de('0x8a')](_0x407d38);});});});return Promise[_0xa2de('0x8a')](_0x346135);});return Promise[_0xa2de('0x8a')](_0x30f2d7);})[_0xa2de('0x3c')](function(){return db[_0xa2de('0x8b')]['findOne']({'where':{'teamId':_0x7b7eb}})[_0xa2de('0x3c')](function(_0x4bf056){if(_0x4bf056){var _0x19d0d9=_[_0xa2de('0x29')](_0x3bb86d,function(_0x30ba07){db[_0xa2de('0x64')][_0xa2de('0x87')]({'UserId':_0x30ba07,'VoicePrefixId':_0x4bf056['VoicePrefixId']});});return Promise[_0xa2de('0x8a')](_0x19d0d9);}});});});return Promise[_0xa2de('0x8a')](_0x515ec8)[_0xa2de('0x3c')](function(){return _0x56475c[_0xa2de('0x73')](_0x3bb86d,{'transaction':_0x2961a5})[_0xa2de('0x8c')](function(_0x14ceee){return _0x14ceee;});});});}})[_0xa2de('0x3c')](respondWithResult(_0x335f6c,null))[_0xa2de('0x40')](handleError(_0x335f6c,null));};exports['removeAgents']=function(_0x298508,_0x364b2f){var _0x332f79=_[_0xa2de('0x74')](_0x298508['query'][_0xa2de('0x70')])?_0x298508['query'][_0xa2de('0x70')]:[_0x298508['query'][_0xa2de('0x70')]];var _0x2c2644=_0x298508['params']['id'];return db['Team'][_0xa2de('0x44')]({'where':{'id':_0x2c2644}})[_0xa2de('0x3c')](handleEntityNotFound(_0x364b2f,null))[_0xa2de('0x3c')](function(_0x3a5442){if(_0x3a5442){var _0x5722f0=[_0xa2de('0x7b'),_0xa2de('0x75'),_0xa2de('0x76'),_0xa2de('0x77'),_0xa2de('0x78'),_0xa2de('0x79'),_0xa2de('0x8d')];return db[_0xa2de('0x51')][_0xa2de('0x7a')](function(_0x17f9dc){var _0x53a1b4=_[_0xa2de('0x29')](_0x5722f0,function(_0x59409d){var _0xbed1a5={'attributes':['id','name']};return _0x3a5442[_0xa2de('0x47')+_0x59409d+_0xa2de('0x6a')](_0xbed1a5)['then'](function(_0x31007e){var _0x3a611e=_[_0xa2de('0x29')](_0x31007e,function(_0x1015a6){return _0x1015a6[_0xa2de('0x8e')](_0x332f79,{'transaction':_0x17f9dc})[_0xa2de('0x3c')](function(){var _0x15bb2a=_[_0xa2de('0x29')](_0x332f79,function(_0x3d30a1){socket[_0xa2de('0x80')](_0xa2de('0x4a')+_0x59409d+'Queue:remove',{'UserId':Number(_0x3d30a1),[_0x59409d+_0xa2de('0x82')]:_0x1015a6['id']});if(_0x59409d!=='Voice'){return;}return db[_0xa2de('0x86')][_0xa2de('0x50')]({'where':{'VoiceQueueId':_0x1015a6['id'],'UserId':_0x3d30a1},'transaction':_0x17f9dc});});return Promise[_0xa2de('0x8a')](_0x15bb2a);});});return Promise['all'](_0x3a611e);});});return Promise[_0xa2de('0x8a')](_0x53a1b4)[_0xa2de('0x3c')](function(){return _0x3a5442[_0xa2de('0x8e')](_0x332f79,{'transaction':_0x17f9dc});})[_0xa2de('0x3c')](function(){return db[_0xa2de('0x8b')][_0xa2de('0x6c')]({'where':{'teamId':_0x2c2644}})[_0xa2de('0x3c')](function(_0x77f659){if(_0x77f659){var _0x25a00d=_[_0xa2de('0x29')](_0x332f79,function(_0x486a00){db[_0xa2de('0x64')][_0xa2de('0x50')]({'where':{'UserId':_0x486a00,'VoicePrefixId':_0x77f659[_0xa2de('0x8f')]}});});return Promise['all'](_0x25a00d);}});});});}})['then'](respondWithStatusCode(_0x364b2f,null))['catch'](handleError(_0x364b2f,null));};exports[_0xa2de('0x90')]=function(_0x5bb6e6,_0x256206,_0x499667){var _0x353386={};var _0x199931={};var _0x59cb4f;var _0x181d6d;return db[_0xa2de('0x2a')]['findOne']({'where':{'id':_0x5bb6e6[_0xa2de('0x41')]['id']}})[_0xa2de('0x3c')](handleEntityNotFound(_0x256206,null))[_0xa2de('0x3c')](function(_0x2e8110){if(_0x2e8110){_0x59cb4f=_0x2e8110;_0x199931['model']=_[_0xa2de('0x42')](db['User'][_0xa2de('0x2b')]);_0x199931[_0xa2de('0x2f')]=_[_0xa2de('0x42')](_0x5bb6e6[_0xa2de('0x2f')]);_0x199931['filters']=_[_0xa2de('0x30')](_0x199931[_0xa2de('0x2e')],_0x199931[_0xa2de('0x2f')]);_0x353386[_0xa2de('0x31')]=_['intersection'](_0x199931[_0xa2de('0x2e')],qs['fields'](_0x5bb6e6['query'][_0xa2de('0x32')]));_0x353386[_0xa2de('0x31')]=_0x353386[_0xa2de('0x31')][_0xa2de('0x43')]?_0x353386['attributes']:_0x199931[_0xa2de('0x2e')];_0x353386['order']=qs[_0xa2de('0x35')](_0x5bb6e6[_0xa2de('0x2f')][_0xa2de('0x35')]);_0x353386['where']=qs['filters'](_['pick'](_0x5bb6e6[_0xa2de('0x2f')],_0x199931[_0xa2de('0x37')]));if(_0x5bb6e6[_0xa2de('0x2f')]['filter']){_0x353386[_0xa2de('0x36')]=_[_0xa2de('0x3a')](_0x353386[_0xa2de('0x36')],{'$or':_[_0xa2de('0x29')](_0x353386[_0xa2de('0x31')],function(_0x3a88fd){var _0x50adab={};_0x50adab[_0x3a88fd]={'$like':'%'+_0x5bb6e6[_0xa2de('0x2f')][_0xa2de('0x39')]+'%'};return _0x50adab;})});}_0x353386=_[_0xa2de('0x3a')]({},_0x353386,_0x5bb6e6[_0xa2de('0x68')]);return _0x59cb4f[_0xa2de('0x90')](_0x353386);}})['then'](function(_0x1b5971){if(_0x1b5971){_0x181d6d=_0x1b5971[_0xa2de('0x43')];if(!_0x5bb6e6[_0xa2de('0x2f')]['hasOwnProperty'](_0xa2de('0x91'))){_0x353386[_0xa2de('0x1c')]=qs[_0xa2de('0x1c')](_0x5bb6e6[_0xa2de('0x2f')]['limit']);_0x353386['offset']=qs[_0xa2de('0x1e')](_0x5bb6e6[_0xa2de('0x2f')]['offset']);}return _0x59cb4f[_0xa2de('0x90')](_0x353386);}})[_0xa2de('0x3c')](function(_0x2f7353){if(_0x2f7353){return _0x2f7353?{'count':_0x181d6d,'rows':_0x2f7353}:null;}})[_0xa2de('0x3c')](respondWithResult(_0x256206,null))[_0xa2de('0x40')](handleError(_0x256206,null));}; \ No newline at end of file +var _0xc58a=['set','apply','reject','save','update','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','rows','show','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT','Sequelize','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','ValidationError','capitalize','toLowerCase','length','order','addQueues','isValidChannel','removeQueues','Unknown\x20channel','remove','ids','Voice','Chat','Sms','Openchannel','through','Queues','QueueId','defaults','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','findAll','online','interface','UserVoiceQueueRt','SIP/%s','voicePause','penalty','all','upsert','spread','removeAgents','isArray','Mail','Whatsapp','Queue:remove','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','undefined','count','offset','limit'];(function(_0x576745,_0x543cdd){var _0x5b3e19=function(_0x14e4c4){while(--_0x14e4c4){_0x576745['push'](_0x576745['shift']());}};_0x5b3e19(++_0x543cdd);}(_0xc58a,0x114));var _0xac58=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xc58a[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac58('0x0'));var zipdir=require(_0xac58('0x1'));var jsonpatch=require(_0xac58('0x2'));var rp=require(_0xac58('0x3'));var moment=require(_0xac58('0x4'));var BPromise=require(_0xac58('0x5'));var Mustache=require(_0xac58('0x6'));var util=require(_0xac58('0x7'));var path=require('path');var sox=require(_0xac58('0x8'));var csv=require(_0xac58('0x9'));var ejs=require(_0xac58('0xa'));var fs=require('fs');var fs_extra=require(_0xac58('0xb'));var _=require(_0xac58('0xc'));var squel=require(_0xac58('0xd'));var crypto=require('crypto');var jsforce=require(_0xac58('0xe'));var deskjs=require(_0xac58('0xf'));var toCsv=require(_0xac58('0x9'));var querystring=require(_0xac58('0x10'));var Papa=require('papaparse');var Redis=require(_0xac58('0x11'));var authService=require(_0xac58('0x12'));var qs=require(_0xac58('0x13'));var as=require(_0xac58('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac58('0x15'))(_0xac58('0x16'));var utils=require(_0xac58('0x17'));var config=require(_0xac58('0x18'));var licenseUtil=require(_0xac58('0x19'));var db=require(_0xac58('0x1a'))['db'];config[_0xac58('0x1b')]=_['defaults'](config['redis'],{'host':_0xac58('0x1c'),'port':0x18eb});var socket=require(_0xac58('0x1d'))(new Redis(config[_0xac58('0x1b')]));require(_0xac58('0x1e'))[_0xac58('0x1f')](socket);function respondWithStatusCode(_0x3a1b50,_0x4bcbae){_0x4bcbae=_0x4bcbae||0xcc;return function(_0x5945c0){if(_0x5945c0){return _0x3a1b50[_0xac58('0x20')](_0x4bcbae);}return _0x3a1b50['status'](_0x4bcbae)[_0xac58('0x21')]();};}function respondWithResult(_0x2c7375,_0x4f3d0f){_0x4f3d0f=_0x4f3d0f||0xc8;return function(_0x18d678){if(_0x18d678){return _0x2c7375[_0xac58('0x22')](_0x4f3d0f)[_0xac58('0x23')](_0x18d678);}};}function respondWithFilteredResult(_0x124684,_0x834481){return function(_0x55ad05){if(_0x55ad05){var _0x42dcec=typeof _0x834481['offset']==='undefined'&&typeof _0x834481['limit']===_0xac58('0x24');var _0x3eece5=_0x55ad05[_0xac58('0x25')];var _0x3ef262=_0x42dcec?0x0:_0x834481['offset'];var _0x5d440d=_0x42dcec?_0x55ad05[_0xac58('0x25')]:_0x834481[_0xac58('0x26')]+_0x834481[_0xac58('0x27')];var _0x58efc2;if(_0x5d440d>=_0x3eece5){_0x5d440d=_0x3eece5;_0x58efc2=0xc8;}else{_0x58efc2=0xce;}_0x124684['status'](_0x58efc2);return _0x124684[_0xac58('0x28')]('Content-Range',_0x3ef262+'-'+_0x5d440d+'/'+_0x3eece5)[_0xac58('0x23')](_0x55ad05);}return null;};}function patchUpdates(_0xe8763f){return function(_0x2ea258){try{jsonpatch[_0xac58('0x29')](_0x2ea258,_0xe8763f,!![]);}catch(_0x4d77c0){return BPromise[_0xac58('0x2a')](_0x4d77c0);}return _0x2ea258[_0xac58('0x2b')]();};}function saveUpdates(_0x4b4885,_0x2199d1){return function(_0x1ff3cd){if(_0x1ff3cd){return _0x1ff3cd[_0xac58('0x2c')](_0x4b4885)['then'](function(_0x426a40){return _0x426a40;});}return null;};}function handleEntityNotFound(_0x302b21,_0xbe7a52){return function(_0xecc41e){if(!_0xecc41e){_0x302b21[_0xac58('0x20')](0x194);}return _0xecc41e;};}function handleError(_0x4f8b7e,_0x143f3c){_0x143f3c=_0x143f3c||0x1f4;return function(_0x476b13){logger['error'](_0x476b13[_0xac58('0x2d')]);if(_0x476b13[_0xac58('0x2e')]){delete _0x476b13[_0xac58('0x2e')];}_0x4f8b7e[_0xac58('0x22')](_0x143f3c)[_0xac58('0x2f')](_0x476b13);};}exports[_0xac58('0x30')]=function(_0x1112c9,_0x2be183){var _0x1ebafa={},_0x5dc38f={},_0x362e7b={'count':0x0,'rows':[]};var _0x4b76d4=_[_0xac58('0x31')](db[_0xac58('0x32')][_0xac58('0x33')],function(_0xc36aef){return{'name':_0xc36aef[_0xac58('0x34')],'type':_0xc36aef['type'][_0xac58('0x35')]};});_0x5dc38f[_0xac58('0x36')]=_['map'](_0x4b76d4,_0xac58('0x2e'));_0x5dc38f['query']=_[_0xac58('0x37')](_0x1112c9[_0xac58('0x38')]);_0x5dc38f[_0xac58('0x39')]=_[_0xac58('0x3a')](_0x5dc38f['model'],_0x5dc38f[_0xac58('0x38')]);_0x1ebafa[_0xac58('0x3b')]=_[_0xac58('0x3a')](_0x5dc38f[_0xac58('0x36')],qs['fields'](_0x1112c9['query'][_0xac58('0x3c')]));_0x1ebafa[_0xac58('0x3b')]=_0x1ebafa['attributes']['length']?_0x1ebafa['attributes']:_0x5dc38f[_0xac58('0x36')];if(!_0x1112c9[_0xac58('0x38')]['hasOwnProperty'](_0xac58('0x3d'))){_0x1ebafa['limit']=qs[_0xac58('0x27')](_0x1112c9[_0xac58('0x38')]['limit']);_0x1ebafa['offset']=qs[_0xac58('0x26')](_0x1112c9[_0xac58('0x38')]['offset']);}_0x1ebafa['order']=qs[_0xac58('0x3e')](_0x1112c9[_0xac58('0x38')]['sort']);_0x1ebafa[_0xac58('0x3f')]=qs[_0xac58('0x39')](_[_0xac58('0x40')](_0x1112c9[_0xac58('0x38')],_0x5dc38f[_0xac58('0x39')]),_0x4b76d4);if(_0x1112c9[_0xac58('0x38')][_0xac58('0x41')]){_0x1ebafa['where']=_[_0xac58('0x42')](_0x1ebafa[_0xac58('0x3f')],{'$or':_[_0xac58('0x31')](_0x4b76d4,function(_0x4542a1){if(_0x4542a1[_0xac58('0x43')]!==_0xac58('0x44')){var _0x110994={};_0x110994[_0x4542a1['name']]={'$like':'%'+_0x1112c9['query'][_0xac58('0x41')]+'%'};return _0x110994;}})});}_0x1ebafa=_[_0xac58('0x42')]({},_0x1ebafa,_0x1112c9[_0xac58('0x45')]);var _0x28a0b5={'where':_0x1ebafa[_0xac58('0x3f')]};return db[_0xac58('0x32')][_0xac58('0x25')](_0x28a0b5)[_0xac58('0x46')](function(_0x49e705){_0x362e7b[_0xac58('0x25')]=_0x49e705;if(_0x1112c9[_0xac58('0x38')][_0xac58('0x47')]){_0x1ebafa['include']=[{'all':!![]}];}return db[_0xac58('0x32')]['findAll'](_0x1ebafa);})[_0xac58('0x46')](function(_0x3862e1){_0x362e7b[_0xac58('0x48')]=_0x3862e1;return _0x362e7b;})[_0xac58('0x46')](respondWithFilteredResult(_0x2be183,_0x1ebafa))['catch'](handleError(_0x2be183,null));};exports[_0xac58('0x49')]=function(_0x4bfcda,_0x2e3c95){var _0x4a4b92={'raw':![],'where':{'id':_0x4bfcda[_0xac58('0x4a')]['id']}},_0x257aaf={};_0x257aaf[_0xac58('0x36')]=_[_0xac58('0x37')](db[_0xac58('0x32')][_0xac58('0x33')]);_0x257aaf[_0xac58('0x38')]=_[_0xac58('0x37')](_0x4bfcda[_0xac58('0x38')]);_0x257aaf['filters']=_['intersection'](_0x257aaf[_0xac58('0x36')],_0x257aaf[_0xac58('0x38')]);_0x4a4b92[_0xac58('0x3b')]=_[_0xac58('0x3a')](_0x257aaf[_0xac58('0x36')],qs[_0xac58('0x3c')](_0x4bfcda[_0xac58('0x38')][_0xac58('0x3c')]));_0x4a4b92[_0xac58('0x3b')]=_0x4a4b92['attributes']['length']?_0x4a4b92['attributes']:_0x257aaf[_0xac58('0x36')];if(_0x4bfcda['query'][_0xac58('0x47')]){_0x4a4b92[_0xac58('0x4b')]=[{'all':!![]}];}_0x4a4b92=_[_0xac58('0x42')]({},_0x4a4b92,_0x4bfcda['options']);return db[_0xac58('0x32')][_0xac58('0x4c')](_0x4a4b92)[_0xac58('0x46')](handleEntityNotFound(_0x2e3c95,null))[_0xac58('0x46')](respondWithResult(_0x2e3c95,null))['catch'](handleError(_0x2e3c95,null));};exports[_0xac58('0x4d')]=function(_0x2fa867,_0x14712e){return db[_0xac58('0x32')][_0xac58('0x4d')](_0x2fa867['body'],{})[_0xac58('0x46')](function(_0x18f789){var _0x3165bc=_0x2fa867[_0xac58('0x4e')][_0xac58('0x4f')]({'plain':!![]});if(!_0x3165bc)throw new Error(_0xac58('0x50'));if(_0x3165bc[_0xac58('0x51')]===_0xac58('0x4e')){var _0x3c11e3=_0x18f789['get']({'plain':!![]});var _0x3a1222=_0xac58('0x52');return db[_0xac58('0x53')][_0xac58('0x4c')]({'where':{'name':_0x3a1222,'userProfileId':_0x3165bc['userProfileId']},'raw':!![]})[_0xac58('0x46')](function(_0x4413ba){if(_0x4413ba&&_0x4413ba[_0xac58('0x54')]===0x0){return db[_0xac58('0x55')][_0xac58('0x4d')]({'name':_0x3c11e3[_0xac58('0x2e')],'resourceId':_0x3c11e3['id'],'type':_0x4413ba['name'],'sectionId':_0x4413ba['id']},{})['then'](function(){return _0x18f789;});}else{return _0x18f789;}})[_0xac58('0x56')](function(_0x36cb6c){logger[_0xac58('0x57')](_0xac58('0x58'),_0x36cb6c);throw _0x36cb6c;});}return _0x18f789;})['then'](respondWithResult(_0x14712e,0xc9))[_0xac58('0x56')](handleError(_0x14712e,null));};exports['update']=function(_0x4af816,_0x3b9884){if(_0x4af816[_0xac58('0x59')]['id']){delete _0x4af816[_0xac58('0x59')]['id'];}return db[_0xac58('0x32')][_0xac58('0x4c')]({'where':{'id':_0x4af816[_0xac58('0x4a')]['id']}})[_0xac58('0x46')](handleEntityNotFound(_0x3b9884,null))[_0xac58('0x46')](saveUpdates(_0x4af816[_0xac58('0x59')],null))[_0xac58('0x46')](respondWithResult(_0x3b9884,null))[_0xac58('0x56')](handleError(_0x3b9884,null));};exports[_0xac58('0x5a')]=function(_0x279b17,_0x3e0fa1){var _0x2a84ba=_0x279b17[_0xac58('0x4a')]['id'];var _0x11dd3b=[];return db[_0xac58('0x5b')][_0xac58('0x5c')](function(_0x331ccf){var _0x3cd7e9='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x2a84ba;return db[_0xac58('0x5b')][_0xac58('0x38')](_0x3cd7e9,{'type':db['Sequelize']['QueryTypes'][_0xac58('0x5d')],'raw':!![],'transaction':_0x331ccf})['then'](function(_0x2f4c0e){_0x11dd3b=_[_0xac58('0x31')](_0x2f4c0e,function(_0x304f39){return Number(_0x304f39['UserId']);});})[_0xac58('0x46')](function(){var _0x5cd331='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a84ba;return db[_0xac58('0x5b')]['query'](_0x5cd331,{'type':db[_0xac58('0x5e')]['QueryTypes'][_0xac58('0x5d')],'raw':!![],'transaction':_0x331ccf});})['then'](function(_0x4234a4){var _0xcfff8f=_['map'](_0x4234a4,function(_0x2bea81){return Number(_0x2bea81['VoiceQueueId']);});return db['UserVoiceQueue'][_0xac58('0x5a')]({'where':{'UserId':{'$in':_0x11dd3b},'VoiceQueueId':{'$in':_0xcfff8f}},'transaction':_0x331ccf});})[_0xac58('0x46')](function(){var _0x57790e=_0xac58('0x5f')+_0x2a84ba;return db[_0xac58('0x5b')][_0xac58('0x38')](_0x57790e,{'type':db[_0xac58('0x5e')]['QueryTypes'][_0xac58('0x5d')],'raw':!![],'transaction':_0x331ccf});})[_0xac58('0x46')](function(_0x46c0f6){var _0x17875c=_['map'](_0x46c0f6,function(_0x46ae5d){return Number(_0x46ae5d[_0xac58('0x60')]);});return db[_0xac58('0x61')][_0xac58('0x5a')]({'where':{'UserId':{'$in':_0x11dd3b},'MailQueueId':{'$in':_0x17875c}},'transaction':_0x331ccf});})[_0xac58('0x46')](function(){var _0x528e2e=_0xac58('0x62')+_0x2a84ba;return db[_0xac58('0x5b')][_0xac58('0x38')](_0x528e2e,{'type':db[_0xac58('0x5e')]['QueryTypes'][_0xac58('0x5d')],'raw':!![],'transaction':_0x331ccf});})['then'](function(_0x141257){var _0x48a0b2=_[_0xac58('0x31')](_0x141257,function(_0xee6c64){return Number(_0xee6c64[_0xac58('0x63')]);});return db[_0xac58('0x64')]['destroy']({'where':{'UserId':{'$in':_0x11dd3b},'SmsQueueId':{'$in':_0x48a0b2}},'transaction':_0x331ccf});})[_0xac58('0x46')](function(){var _0x278ce1=_0xac58('0x65')+_0x2a84ba;return db[_0xac58('0x5b')][_0xac58('0x38')](_0x278ce1,{'type':db[_0xac58('0x5e')][_0xac58('0x66')]['SELECT'],'raw':!![],'transaction':_0x331ccf});})[_0xac58('0x46')](function(_0x2574a5){var _0x11956d=_[_0xac58('0x31')](_0x2574a5,function(_0x44bf3b){return Number(_0x44bf3b['ChatQueueId']);});return db[_0xac58('0x67')][_0xac58('0x5a')]({'where':{'UserId':{'$in':_0x11dd3b},'ChatQueueId':{'$in':_0x11956d}},'transaction':_0x331ccf});})[_0xac58('0x46')](function(){var _0x58d708='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a84ba;return db[_0xac58('0x5b')][_0xac58('0x38')](_0x58d708,{'type':db['Sequelize']['QueryTypes'][_0xac58('0x5d')],'raw':!![],'transaction':_0x331ccf});})[_0xac58('0x46')](function(_0x37f2d3){var _0x435f1c=_[_0xac58('0x31')](_0x37f2d3,function(_0x2e0d94){return Number(_0x2e0d94[_0xac58('0x68')]);});return db[_0xac58('0x69')][_0xac58('0x5a')]({'where':{'UserId':{'$in':_0x11dd3b},'FaxQueueId':{'$in':_0x435f1c}},'transaction':_0x331ccf});})[_0xac58('0x46')](function(){var _0x7268a6=_0xac58('0x6a')+_0x2a84ba;return db[_0xac58('0x5b')][_0xac58('0x38')](_0x7268a6,{'type':db[_0xac58('0x5e')][_0xac58('0x66')][_0xac58('0x5d')],'raw':!![],'transaction':_0x331ccf});})[_0xac58('0x46')](function(_0x261d97){var _0x71d34=_['map'](_0x261d97,function(_0x41daf9){return Number(_0x41daf9[_0xac58('0x6b')]);});return db['UserOpenchannelQueue'][_0xac58('0x5a')]({'where':{'UserId':{'$in':_0x11dd3b},'OpenchannelQueueId':{'$in':_0x71d34}},'transaction':_0x331ccf});})['then'](function(){var _0x3470d6=_0xac58('0x6c')+_0x2a84ba;return db[_0xac58('0x5b')][_0xac58('0x38')](_0x3470d6,{'type':db[_0xac58('0x5e')][_0xac58('0x66')][_0xac58('0x5d')],'raw':!![],'transaction':_0x331ccf});})[_0xac58('0x46')](function(_0x51ea86){var _0x4fa6a0=_[_0xac58('0x31')](_0x51ea86,function(_0x2e327a){return Number(_0x2e327a[_0xac58('0x6d')]);});return db['UserWhatsappQueue'][_0xac58('0x5a')]({'where':{'UserId':{'$in':_0x11dd3b},'WhatsappQueueId':{'$in':_0x4fa6a0}},'transaction':_0x331ccf});})[_0xac58('0x46')](function(){return db[_0xac58('0x6e')]['find']({'where':{'TeamId':_0x2a84ba}});})[_0xac58('0x46')](function(_0x516ea5){if(_0x516ea5===null){return;}return db[_0xac58('0x6f')][_0xac58('0x5a')]({'where':{'UserId':{'$in':_0x11dd3b},'VoicePrefixId':_0x516ea5[_0xac58('0x70')]},'transaction':_0x331ccf});})[_0xac58('0x46')](function(){return db[_0xac58('0x32')][_0xac58('0x5a')]({'where':{'id':_0x2a84ba},'cascade':!![],'transaction':_0x331ccf});})['then'](function(_0x112e86){if(_0x112e86===0x0){_0x3e0fa1['sendStatus'](0x194);}else{return db[_0xac58('0x55')][_0xac58('0x5a')]({'where':{'type':'Teams','resourceId':_0x2a84ba},'cascade':!![],'transaction':_0x331ccf})[_0xac58('0x46')](function(){_0x3e0fa1[_0xac58('0x22')](0xcc)[_0xac58('0x21')]();});}})['catch'](function(_0x135e2d){_0x3e0fa1[_0xac58('0x22')](0x1f4)[_0xac58('0x2f')](_0x135e2d);});});};exports[_0xac58('0x71')]=function(_0x4988a2,_0x3fd80b,_0x11544b){return db[_0xac58('0x32')][_0xac58('0x72')]({'where':{'id':_0x4988a2[_0xac58('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fd80b,null))[_0xac58('0x46')](function(_0x33cf43){if(!_0x4988a2['query'][_0xac58('0x73')]||!utils['isValidChannel'](_0x4988a2[_0xac58('0x38')][_0xac58('0x73')])){throw new db[(_0xac58('0x5e'))][(_0xac58('0x74'))]('Unknown\x20channel');}var _0x73eda1={};var _0x3aa644={};_0x3aa644[_0xac58('0x36')]=_['keys'](db[_[_0xac58('0x75')](_0x4988a2[_0xac58('0x38')]['channel'][_0xac58('0x76')]())+'Queue']['rawAttributes']);_0x3aa644[_0xac58('0x38')]=_[_0xac58('0x37')](_0x4988a2['query']);_0x3aa644['filters']=_[_0xac58('0x3a')](_0x3aa644[_0xac58('0x36')],_0x3aa644[_0xac58('0x38')]);_0x73eda1['attributes']=_[_0xac58('0x3a')](_0x3aa644[_0xac58('0x36')],qs['fields'](_0x4988a2[_0xac58('0x38')]['fields']));_0x73eda1[_0xac58('0x3b')]=_0x73eda1[_0xac58('0x3b')][_0xac58('0x77')]?_0x73eda1[_0xac58('0x3b')]:_0x3aa644[_0xac58('0x36')];_0x73eda1[_0xac58('0x27')]=qs['limit'](_0x4988a2[_0xac58('0x38')][_0xac58('0x27')]);_0x73eda1[_0xac58('0x26')]=qs[_0xac58('0x26')](_0x4988a2['query'][_0xac58('0x26')]);_0x73eda1[_0xac58('0x78')]=qs['sort'](_0x4988a2[_0xac58('0x38')][_0xac58('0x3e')]);_0x73eda1['where']=qs[_0xac58('0x39')](_[_0xac58('0x40')](_0x4988a2[_0xac58('0x38')],_0x3aa644[_0xac58('0x39')]));_0x73eda1=_['merge']({},_0x73eda1,_0x4988a2[_0xac58('0x45')]);return _0x33cf43['get'+_[_0xac58('0x75')](_0x4988a2['query'][_0xac58('0x73')][_0xac58('0x76')]())+'Queues'](_0x73eda1);})['then'](respondWithResult(_0x3fd80b,null))[_0xac58('0x56')](handleError(_0x3fd80b,null));};exports[_0xac58('0x79')]=function(_0x251e13,_0x46c9ff,_0x4e07b5){return db[_0xac58('0x32')][_0xac58('0x72')]({'where':{'id':_0x251e13['params']['id']}})[_0xac58('0x46')](function(_0xb64c83){if(_0xb64c83){if(!_0x251e13[_0xac58('0x59')]['channel']||!utils[_0xac58('0x7a')](_0x251e13[_0xac58('0x59')]['channel'])){throw new db[(_0xac58('0x5e'))]['ValidationError']('Unknown\x20channel');}return _0xb64c83['add'+_[_0xac58('0x75')](_0x251e13['body']['channel'][_0xac58('0x76')]())+'Queues'](_0x251e13[_0xac58('0x59')]['ids']);}return null;})[_0xac58('0x46')](handleEntityNotFound(_0x46c9ff,null))[_0xac58('0x46')](respondWithStatusCode(_0x46c9ff,null))[_0xac58('0x56')](handleError(_0x46c9ff,null));};exports[_0xac58('0x7b')]=function(_0xef4c4f,_0x1ea5d1,_0x114d0a){return db[_0xac58('0x32')][_0xac58('0x72')]({'where':{'id':_0xef4c4f[_0xac58('0x4a')]['id']}})[_0xac58('0x46')](function(_0x2e727f){if(_0x2e727f){if(!_0xef4c4f[_0xac58('0x38')][_0xac58('0x73')]||!utils[_0xac58('0x7a')](_0xef4c4f[_0xac58('0x38')][_0xac58('0x73')])){throw new db['Sequelize'][(_0xac58('0x74'))](_0xac58('0x7c'));}return _0x2e727f[_0xac58('0x7d')+_[_0xac58('0x75')](_0xef4c4f['query'][_0xac58('0x73')][_0xac58('0x76')]())+'Queues'](_0xef4c4f[_0xac58('0x38')][_0xac58('0x7e')]);}return null;})[_0xac58('0x46')](handleEntityNotFound(_0x1ea5d1,null))[_0xac58('0x46')](respondWithStatusCode(_0x1ea5d1,null))[_0xac58('0x56')](handleError(_0x1ea5d1,null));};exports['addAgents']=function(_0x25aee9,_0x506910){var _0x34e69c=_['isArray'](_0x25aee9[_0xac58('0x59')][_0xac58('0x7e')])?_0x25aee9[_0xac58('0x59')][_0xac58('0x7e')]:[_0x25aee9[_0xac58('0x59')][_0xac58('0x7e')]];var _0x17c751=_0x25aee9[_0xac58('0x4a')]['id'];return db['Team'][_0xac58('0x4c')]({'where':{'id':_0x17c751}})[_0xac58('0x46')](handleEntityNotFound(_0x506910,null))[_0xac58('0x46')](function(_0x587f0c){if(_0x587f0c){var _0xe14c12=[_0xac58('0x7f'),_0xac58('0x80'),'Mail',_0xac58('0x81'),'Fax',_0xac58('0x82'),'Whatsapp'];return db[_0xac58('0x5b')][_0xac58('0x5c')](function(_0x1153dd){var _0x5ce196=_[_0xac58('0x31')](_0xe14c12,function(_0x44b6ae){var _0x553040={'attributes':['id',_0xac58('0x2e')]};if(_0x44b6ae==='Voice'){_0x553040[_0xac58('0x83')]={'attributes':['penalty']};}return _0x587f0c['get'+_0x44b6ae+_0xac58('0x84')](_0x553040)[_0xac58('0x46')](function(_0x340b84){var _0x22aed6=_[_0xac58('0x31')](_0x340b84,function(_0x103c6e){var _0xef6a37=_[_0xac58('0x31')](_0x34e69c,function(_0x1df944){var _0x4f7a2a={'where':{'UserId':_0x1df944,[_0x44b6ae+_0xac58('0x85')]:_0x103c6e['id']},'transaction':_0x1153dd};if(_0x44b6ae===_0xac58('0x7f')){_0x4f7a2a[_0xac58('0x86')]={'penalty':_0x103c6e[_0xac58('0x87')]['penalty']};}return db[_0xac58('0x88')+_0x44b6ae+_0xac58('0x89')][_0xac58('0x8a')](_0x4f7a2a)[_0xac58('0x46')](function(){socket[_0xac58('0x8b')](_0xac58('0x4e')+_0x44b6ae+_0xac58('0x8c'),{'UserId':_0x1df944,[_0x44b6ae+'QueueId']:_0x103c6e['id']});if(_0x44b6ae!==_0xac58('0x7f')){return;}return db[_0xac58('0x88')][_0xac58('0x8d')]({'where':{'id':_0x34e69c,'online':0x1},'attributes':['id','name',_0xac58('0x8e'),'voicePause',_0xac58('0x8f')],'raw':!![]})[_0xac58('0x46')](function(_0x29f60a){var _0x4712cb=_[_0xac58('0x31')](_0x29f60a,function(_0x14d42b){return db[_0xac58('0x90')]['upsert']({'membername':_0x14d42b['name'],'UserId':_0x14d42b['id'],'queue_name':_0x103c6e[_0xac58('0x2e')],'VoiceQueueId':_0x103c6e['id'],'interface':_['isNil'](_0x14d42b[_0xac58('0x8f')])?util['format'](_0xac58('0x91'),_0x14d42b[_0xac58('0x2e')]):_0x14d42b[_0xac58('0x8f')],'paused':_0x14d42b[_0xac58('0x92')]||![],'penalty':_0x103c6e[_0xac58('0x87')][_0xac58('0x93')]},{'transaction':_0x1153dd});});return Promise[_0xac58('0x94')](_0x4712cb);});});});return Promise[_0xac58('0x94')](_0xef6a37);});return Promise[_0xac58('0x94')](_0x22aed6);})[_0xac58('0x46')](function(){return db[_0xac58('0x6e')][_0xac58('0x72')]({'where':{'teamId':_0x17c751}})[_0xac58('0x46')](function(_0x1f2515){if(_0x1f2515){var _0x1fe8a1=_[_0xac58('0x31')](_0x34e69c,function(_0x126e7c){db['UserVoicePrefix'][_0xac58('0x95')]({'UserId':_0x126e7c,'VoicePrefixId':_0x1f2515[_0xac58('0x70')]});});return Promise['all'](_0x1fe8a1);}});});});return Promise[_0xac58('0x94')](_0x5ce196)['then'](function(){return _0x587f0c['addAgents'](_0x34e69c,{'transaction':_0x1153dd})[_0xac58('0x96')](function(_0x4d886a){return _0x4d886a;});});});}})['then'](respondWithResult(_0x506910,null))[_0xac58('0x56')](handleError(_0x506910,null));};exports[_0xac58('0x97')]=function(_0x2e57ac,_0x2148e6){var _0x55859b=_[_0xac58('0x98')](_0x2e57ac[_0xac58('0x38')]['ids'])?_0x2e57ac['query'][_0xac58('0x7e')]:[_0x2e57ac['query']['ids']];var _0x393440=_0x2e57ac['params']['id'];return db[_0xac58('0x32')]['find']({'where':{'id':_0x393440}})['then'](handleEntityNotFound(_0x2148e6,null))[_0xac58('0x46')](function(_0x42fc5f){if(_0x42fc5f){var _0x3b0880=[_0xac58('0x7f'),'Chat',_0xac58('0x99'),_0xac58('0x81'),'Fax',_0xac58('0x82'),_0xac58('0x9a')];return db[_0xac58('0x5b')][_0xac58('0x5c')](function(_0x31843c){var _0x4e17a2=_[_0xac58('0x31')](_0x3b0880,function(_0x1f23fe){var _0xe0eff6={'attributes':['id',_0xac58('0x2e')]};return _0x42fc5f[_0xac58('0x4f')+_0x1f23fe+_0xac58('0x84')](_0xe0eff6)['then'](function(_0x14e5fb){var _0x1a048f=_['map'](_0x14e5fb,function(_0x5882a5){return _0x5882a5[_0xac58('0x97')](_0x55859b,{'transaction':_0x31843c})[_0xac58('0x46')](function(){var _0x5533f4=_['map'](_0x55859b,function(_0x33aebf){socket['emit'](_0xac58('0x4e')+_0x1f23fe+_0xac58('0x9b'),{'UserId':Number(_0x33aebf),[_0x1f23fe+_0xac58('0x85')]:_0x5882a5['id']});if(_0x1f23fe!==_0xac58('0x7f')){return;}return db[_0xac58('0x90')]['destroy']({'where':{'VoiceQueueId':_0x5882a5['id'],'UserId':_0x33aebf},'transaction':_0x31843c});});return Promise[_0xac58('0x94')](_0x5533f4);});});return Promise[_0xac58('0x94')](_0x1a048f);});});return Promise[_0xac58('0x94')](_0x4e17a2)[_0xac58('0x46')](function(){return _0x42fc5f[_0xac58('0x97')](_0x55859b,{'transaction':_0x31843c});})['then'](function(){return db[_0xac58('0x6e')][_0xac58('0x72')]({'where':{'teamId':_0x393440}})[_0xac58('0x46')](function(_0x5d1037){if(_0x5d1037){var _0x46f4c7=_[_0xac58('0x31')](_0x55859b,function(_0x2b7339){db[_0xac58('0x6f')][_0xac58('0x5a')]({'where':{'UserId':_0x2b7339,'VoicePrefixId':_0x5d1037[_0xac58('0x70')]}});});return Promise[_0xac58('0x94')](_0x46f4c7);}});});});}})[_0xac58('0x46')](respondWithStatusCode(_0x2148e6,null))[_0xac58('0x56')](handleError(_0x2148e6,null));};exports['getAgents']=function(_0x44a924,_0x591eb0,_0x4b8dc3){var _0x4db500={};var _0x45ea54={};var _0x490c03;var _0x1a04fd;return db[_0xac58('0x32')][_0xac58('0x72')]({'where':{'id':_0x44a924[_0xac58('0x4a')]['id']}})[_0xac58('0x46')](handleEntityNotFound(_0x591eb0,null))[_0xac58('0x46')](function(_0x1ab1f4){if(_0x1ab1f4){_0x490c03=_0x1ab1f4;_0x45ea54[_0xac58('0x36')]=_[_0xac58('0x37')](db[_0xac58('0x88')][_0xac58('0x33')]);_0x45ea54[_0xac58('0x38')]=_[_0xac58('0x37')](_0x44a924[_0xac58('0x38')]);_0x45ea54['filters']=_[_0xac58('0x3a')](_0x45ea54[_0xac58('0x36')],_0x45ea54[_0xac58('0x38')]);_0x4db500[_0xac58('0x3b')]=_['intersection'](_0x45ea54['model'],qs[_0xac58('0x3c')](_0x44a924[_0xac58('0x38')][_0xac58('0x3c')]));_0x4db500[_0xac58('0x3b')]=_0x4db500[_0xac58('0x3b')][_0xac58('0x77')]?_0x4db500[_0xac58('0x3b')]:_0x45ea54[_0xac58('0x36')];_0x4db500[_0xac58('0x78')]=qs[_0xac58('0x3e')](_0x44a924[_0xac58('0x38')][_0xac58('0x3e')]);_0x4db500[_0xac58('0x3f')]=qs['filters'](_['pick'](_0x44a924[_0xac58('0x38')],_0x45ea54[_0xac58('0x39')]));if(_0x44a924['query']['filter']){_0x4db500['where']=_[_0xac58('0x42')](_0x4db500['where'],{'$or':_['map'](_0x4db500[_0xac58('0x3b')],function(_0x580396){var _0x378309={};_0x378309[_0x580396]={'$like':'%'+_0x44a924[_0xac58('0x38')][_0xac58('0x41')]+'%'};return _0x378309;})});}_0x4db500=_[_0xac58('0x42')]({},_0x4db500,_0x44a924[_0xac58('0x45')]);return _0x490c03[_0xac58('0x9c')](_0x4db500);}})[_0xac58('0x46')](function(_0x47178c){if(_0x47178c){_0x1a04fd=_0x47178c[_0xac58('0x77')];if(!_0x44a924[_0xac58('0x38')][_0xac58('0x9d')]('nolimit')){_0x4db500['limit']=qs[_0xac58('0x27')](_0x44a924[_0xac58('0x38')]['limit']);_0x4db500['offset']=qs[_0xac58('0x26')](_0x44a924[_0xac58('0x38')][_0xac58('0x26')]);}return _0x490c03[_0xac58('0x9c')](_0x4db500);}})[_0xac58('0x46')](function(_0x533dd3){if(_0x533dd3){return _0x533dd3?{'count':_0x1a04fd,'rows':_0x533dd3}:null;}})[_0xac58('0x46')](respondWithResult(_0x591eb0,null))[_0xac58('0x56')](handleError(_0x591eb0,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f40919b..a9474c8 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 _0x8758=['save','update','emit','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x1dcd38,_0x4199d0){var _0x5743c2=function(_0x26190c){while(--_0x26190c){_0x1dcd38['push'](_0x1dcd38['shift']());}};_0x5743c2(++_0x4199d0);}(_0x8758,0xbc));var _0x8875=function(_0x3905ae,_0x416f37){_0x3905ae=_0x3905ae-0x0;var _0x1ec6ac=_0x8758[_0x3905ae];return _0x1ec6ac;};'use strict';var EventEmitter=require(_0x8875('0x0'));var Team=require(_0x8875('0x1'))['db'][_0x8875('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x8875('0x3')](0x0);var events={'afterCreate':_0x8875('0x4'),'afterUpdate':_0x8875('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53e5dc){return function(_0x2a7307,_0x2bfb08,_0x1fbef2){TeamEvents[_0x8875('0x6')](_0x53e5dc+':'+_0x2a7307['id'],_0x2a7307);TeamEvents[_0x8875('0x6')](_0x53e5dc,_0x2a7307);_0x1fbef2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x8875('0x7')]=TeamEvents; \ No newline at end of file +var _0x8a1e=['hasOwnProperty','exports','../../mysqldb','Team','setMaxListeners','save'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0x8a1e,0xb6));var _0xe8a1=function(_0x311404,_0x3f485f){_0x311404=_0x311404-0x0;var _0x4cfb62=_0x8a1e[_0x311404];return _0x4cfb62;};'use strict';var EventEmitter=require('events');var Team=require(_0xe8a1('0x0'))['db'][_0xe8a1('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe8a1('0x2')](0x0);var events={'afterCreate':_0xe8a1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5fcddf){return function(_0x40280c,_0x170043,_0x20e62e){TeamEvents['emit'](_0x5fcddf+':'+_0x40280c['id'],_0x40280c);TeamEvents['emit'](_0x5fcddf,_0x40280c);_0x20e62e(null);};}for(var e in events){if(events[_0xe8a1('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xe8a1('0x5')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 692a175..a15e008 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 _0xf413=['api','bluebird','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','util'];(function(_0x4c594f,_0x296e1b){var _0x4ee025=function(_0x259d0c){while(--_0x259d0c){_0x4c594f['push'](_0x4c594f['shift']());}};_0x4ee025(++_0x296e1b);}(_0xf413,0xfb));var _0x3f41=function(_0x2897d8,_0x46a0f8){_0x2897d8=_0x2897d8-0x0;var _0x543888=_0xf413[_0x2897d8];return _0x543888;};'use strict';var _=require(_0x3f41('0x0'));var util=require(_0x3f41('0x1'));var logger=require('../../config/logger')(_0x3f41('0x2'));var moment=require('moment');var BPromise=require(_0x3f41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f41('0x4'));var rimraf=require(_0x3f41('0x5'));var config=require(_0x3f41('0x6'));var attributes=require(_0x3f41('0x7'));module[_0x3f41('0x8')]=function(_0x164c33,_0x5466b2){return _0x164c33['define'](_0x3f41('0x9'),attributes,{'tableName':_0x3f41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42c1=['teams','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./team.attributes','exports','define','Team'];(function(_0x333243,_0x270e20){var _0x2e1ca1=function(_0x3cdbf5){while(--_0x3cdbf5){_0x333243['push'](_0x333243['shift']());}};_0x2e1ca1(++_0x270e20);}(_0x42c1,0x83));var _0x142c=function(_0x25c825,_0x1c6b4f){_0x25c825=_0x25c825-0x0;var _0x27a330=_0x42c1[_0x25c825];return _0x27a330;};'use strict';var _=require('lodash');var util=require(_0x142c('0x0'));var logger=require(_0x142c('0x1'))(_0x142c('0x2'));var moment=require(_0x142c('0x3'));var BPromise=require(_0x142c('0x4'));var rp=require(_0x142c('0x5'));var fs=require('fs');var path=require(_0x142c('0x6'));var rimraf=require('rimraf');var config=require(_0x142c('0x7'));var attributes=require(_0x142c('0x8'));module[_0x142c('0x9')]=function(_0x5d5b72,_0x32c522){return _0x5d5b72[_0x142c('0xa')](_0x142c('0xb'),attributes,{'tableName':_0x142c('0xc'),'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 1646bc9..2068fae 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 _0x5f20=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x5f20,0x7f));var _0x05f2=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x5f20[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0x05f2('0x0'));var util=require(_0x05f2('0x1'));var moment=require(_0x05f2('0x2'));var BPromise=require(_0x05f2('0x3'));var rs=require(_0x05f2('0x4'));var fs=require('fs');var Redis=require(_0x05f2('0x5'));var db=require(_0x05f2('0x6'))['db'];var utils=require(_0x05f2('0x7'));var logger=require(_0x05f2('0x8'))('rpc');var config=require(_0x05f2('0x9'));var jayson=require(_0x05f2('0xa'));var client=jayson[_0x05f2('0xb')][_0x05f2('0xc')]({'port':0x232a});config[_0x05f2('0xd')]=_[_0x05f2('0xe')](config[_0x05f2('0xd')],{'host':_0x05f2('0xf'),'port':0x18eb});var socket=require(_0x05f2('0x10'))(new Redis(config[_0x05f2('0xd')]));require('./team.socket')[_0x05f2('0x11')](socket);function respondWithRpcPromise(_0x4ba8ad,_0x1781ee,_0x2f9ed2){return new BPromise(function(_0x2005f3,_0x169b82){return client[_0x05f2('0x12')](_0x4ba8ad,_0x2f9ed2)[_0x05f2('0x13')](function(_0x59fb64){logger['info'](_0x05f2('0x14'),_0x1781ee,_0x05f2('0x15'));logger[_0x05f2('0x16')](_0x05f2('0x17'),_0x1781ee,'request\x20sent',JSON[_0x05f2('0x18')](_0x59fb64));if(_0x59fb64[_0x05f2('0x19')]){if(_0x59fb64['error'][_0x05f2('0x1a')]===0x1f4){logger['error'](_0x05f2('0x14'),_0x1781ee,_0x59fb64[_0x05f2('0x19')][_0x05f2('0x1b')]);return _0x169b82(_0x59fb64[_0x05f2('0x19')][_0x05f2('0x1b')]);}logger[_0x05f2('0x19')]('Team,\x20%s,\x20%s',_0x1781ee,_0x59fb64[_0x05f2('0x19')][_0x05f2('0x1b')]);return _0x2005f3(_0x59fb64['error'][_0x05f2('0x1b')]);}else{logger[_0x05f2('0x1c')]('Team,\x20%s,\x20%s',_0x1781ee,_0x05f2('0x15'));_0x2005f3(_0x59fb64[_0x05f2('0x1d')]['message']);}})[_0x05f2('0x1e')](function(_0x4e4463){logger[_0x05f2('0x19')](_0x05f2('0x14'),_0x1781ee,_0x4e4463);_0x169b82(_0x4e4463);});});} \ No newline at end of file +var _0xa3ec=['client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2ad1b8,_0x1ea09b){var _0x52547d=function(_0x33b77c){while(--_0x33b77c){_0x2ad1b8['push'](_0x2ad1b8['shift']());}};_0x52547d(++_0x1ea09b);}(_0xa3ec,0x1b6));var _0xca3e=function(_0x1445a8,_0x177e32){_0x1445a8=_0x1445a8-0x0;var _0x3fd1f0=_0xa3ec[_0x1445a8];return _0x3fd1f0;};'use strict';var _=require(_0xca3e('0x0'));var util=require(_0xca3e('0x1'));var moment=require(_0xca3e('0x2'));var BPromise=require(_0xca3e('0x3'));var rs=require(_0xca3e('0x4'));var fs=require('fs');var Redis=require(_0xca3e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xca3e('0x6'));var logger=require(_0xca3e('0x7'))(_0xca3e('0x8'));var config=require('../../config/environment');var jayson=require(_0xca3e('0x9'));var client=jayson[_0xca3e('0xa')][_0xca3e('0xb')]({'port':0x232a});config[_0xca3e('0xc')]=_[_0xca3e('0xd')](config[_0xca3e('0xc')],{'host':_0xca3e('0xe'),'port':0x18eb});var socket=require(_0xca3e('0xf'))(new Redis(config[_0xca3e('0xc')]));require(_0xca3e('0x10'))[_0xca3e('0x11')](socket);function respondWithRpcPromise(_0x460932,_0x26dff1,_0x48b041){return new BPromise(function(_0x4d3d7f,_0x11ddd9){return client[_0xca3e('0x12')](_0x460932,_0x48b041)['then'](function(_0x2d2bae){logger[_0xca3e('0x13')](_0xca3e('0x14'),_0x26dff1,_0xca3e('0x15'));logger[_0xca3e('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x26dff1,_0xca3e('0x15'),JSON['stringify'](_0x2d2bae));if(_0x2d2bae[_0xca3e('0x17')]){if(_0x2d2bae[_0xca3e('0x17')][_0xca3e('0x18')]===0x1f4){logger[_0xca3e('0x17')](_0xca3e('0x14'),_0x26dff1,_0x2d2bae[_0xca3e('0x17')]['message']);return _0x11ddd9(_0x2d2bae[_0xca3e('0x17')][_0xca3e('0x19')]);}logger[_0xca3e('0x17')](_0xca3e('0x14'),_0x26dff1,_0x2d2bae[_0xca3e('0x17')]['message']);return _0x4d3d7f(_0x2d2bae[_0xca3e('0x17')][_0xca3e('0x19')]);}else{logger[_0xca3e('0x13')]('Team,\x20%s,\x20%s',_0x26dff1,'request\x20sent');_0x4d3d7f(_0x2d2bae[_0xca3e('0x1a')][_0xca3e('0x19')]);}})[_0xca3e('0x1b')](function(_0x39cb1d){logger[_0xca3e('0x17')](_0xca3e('0x14'),_0x26dff1,_0x39cb1d);_0x11ddd9(_0x39cb1d);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2cf7c4f..2055284 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 _0x92a3=['remove','update','emit','removeListener','register','./team.events','save'];(function(_0x2ca2c4,_0x4acb49){var _0x40faf5=function(_0x503b87){while(--_0x503b87){_0x2ca2c4['push'](_0x2ca2c4['shift']());}};_0x40faf5(++_0x4acb49);}(_0x92a3,0x140));var _0x392a=function(_0x398001,_0x4d1d6e){_0x398001=_0x398001-0x0;var _0x328975=_0x92a3[_0x398001];return _0x328975;};'use strict';var TeamEvents=require(_0x392a('0x0'));var events=[_0x392a('0x1'),_0x392a('0x2'),_0x392a('0x3')];function createListener(_0x4df5d3,_0x20f259){return function(_0x41fc48){_0x20f259[_0x392a('0x4')](_0x4df5d3,_0x41fc48);};}function removeListener(_0x27d515,_0x1007b6){return function(){TeamEvents[_0x392a('0x5')](_0x27d515,_0x1007b6);};}exports[_0x392a('0x6')]=function(_0x5988cc){for(var _0x1af800=0x0,_0x38cbde=events['length'];_0x1af800<_0x38cbde;_0x1af800++){var _0x41f599=events[_0x1af800];var _0xe4c3b=createListener('team:'+_0x41f599,_0x5988cc);TeamEvents['on'](_0x41f599,_0xe4c3b);}}; \ No newline at end of file +var _0xe39a=['update','emit','register','length','team:','save'];(function(_0x3b16e1,_0x3bda3e){var _0x311d1b=function(_0x2a979b){while(--_0x2a979b){_0x3b16e1['push'](_0x3b16e1['shift']());}};_0x311d1b(++_0x3bda3e);}(_0xe39a,0xb3));var _0xae39=function(_0x1316c7,_0x5922f3){_0x1316c7=_0x1316c7-0x0;var _0x5ef86b=_0xe39a[_0x1316c7];return _0x5ef86b;};'use strict';var TeamEvents=require('./team.events');var events=[_0xae39('0x0'),'remove',_0xae39('0x1')];function createListener(_0xb3b777,_0x4648e9){return function(_0x59bea2){_0x4648e9[_0xae39('0x2')](_0xb3b777,_0x59bea2);};}function removeListener(_0x41c9da,_0xab7c03){return function(){TeamEvents['removeListener'](_0x41c9da,_0xab7c03);};}exports[_0xae39('0x3')]=function(_0x9e6c75){for(var _0x1401d9=0x0,_0x161878=events[_0xae39('0x4')];_0x1401d9<_0x161878;_0x1401d9++){var _0x44144a=events[_0x1401d9];var _0x393bce=createListener(_0xae39('0x5')+_0x44144a,_0x9e6c75);TeamEvents['on'](_0x44144a,_0x393bce);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7e18b41..69b013c 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 _0x938c=['exports','INTEGER','sequelize'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x938c,0x11f));var _0xc938=function(_0x268b06,_0x20a9cf){_0x268b06=_0x268b06-0x0;var _0xc1de1b=_0x938c[_0x268b06];return _0xc1de1b;};'use strict';var Sequelize=require(_0xc938('0x0'));module[_0xc938('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc938('0x2')]}}; \ No newline at end of file +var _0xf150=['INTEGER','sequelize','exports'];(function(_0x1277c9,_0x44de8c){var _0x5b16e6=function(_0x179bdc){while(--_0x179bdc){_0x1277c9['push'](_0x1277c9['shift']());}};_0x5b16e6(++_0x44de8c);}(_0xf150,0x106));var _0x0f15=function(_0x29da2e,_0x34d230){_0x29da2e=_0x29da2e-0x0;var _0x468562=_0xf150[_0x29da2e];return _0x468562;};'use strict';var Sequelize=require(_0x0f15('0x0'));module[_0x0f15('0x1')]={'TeamId':{'type':Sequelize[_0x0f15('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d9f7437..ee2d8f1 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 _0x5d86=['team_has_voice_prefixes','lodash','util','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x2c72bd,_0x1498ac){var _0x4fa1a4=function(_0xd4a323){while(--_0xd4a323){_0x2c72bd['push'](_0x2c72bd['shift']());}};_0x4fa1a4(++_0x1498ac);}(_0x5d86,0x76));var _0x65d8=function(_0x19ab90,_0x23773c){_0x19ab90=_0x19ab90-0x0;var _0x45b682=_0x5d86[_0x19ab90];return _0x45b682;};'use strict';var _=require(_0x65d8('0x0'));var util=require(_0x65d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x65d8('0x3'));var fs=require('fs');var path=require(_0x65d8('0x4'));var rimraf=require('rimraf');var config=require(_0x65d8('0x5'));var attributes=require('./teamVoicePrefix.attributes');module[_0x65d8('0x6')]=function(_0x50c922,_0x1581a6){return _0x50c922[_0x65d8('0x7')]('TeamVoicePrefix',attributes,{'tableName':_0x65d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f6a=['exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x20b1a7,_0x2f2ece){var _0x4d3a1a=function(_0x8c7c46){while(--_0x8c7c46){_0x20b1a7['push'](_0x20b1a7['shift']());}};_0x4d3a1a(++_0x2f2ece);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x52eb46,_0x5ddb51){_0x52eb46=_0x52eb46-0x0;var _0x39ab55=_0x5f6a[_0x52eb46];return _0x39ab55;};'use strict';var _=require(_0xa5f6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa5f6('0x1'));var moment=require(_0xa5f6('0x2'));var BPromise=require(_0xa5f6('0x3'));var rp=require(_0xa5f6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5f6('0x5'));var config=require(_0xa5f6('0x6'));var attributes=require(_0xa5f6('0x7'));module[_0xa5f6('0x8')]=function(_0xb6a42e,_0x9c569c){return _0xb6a42e[_0xa5f6('0x9')](_0xa5f6('0xa'),attributes,{'tableName':_0xa5f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ce2dfec..f94498d 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x565759,_0x3f8566){var _0x3df6b3=function(_0x43a1a3){while(--_0x43a1a3){_0x565759['push'](_0x565759['shift']());}};_0x3df6b3(++_0x3f8566);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0xcb91[_0x54d52];return _0x968345;};'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(_0x4e1984,_0x2919c1){var _0x22bf24=function(_0x13fb08){while(--_0x13fb08){_0x4e1984['push'](_0x4e1984['shift']());}};_0x22bf24(++_0x2919c1);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ea597,_0x2eee6c){_0x4ea597=_0x4ea597-0x0;var _0x96df74=_0xedd9[_0x4ea597];return _0x96df74;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 5d2f2c9..8380bc1 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 _0xc9b0=['exports','INTEGER','sequelize'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0xc9b0,0x143));var _0x0c9b=function(_0x4e1cd5,_0x1664bc){_0x4e1cd5=_0x4e1cd5-0x0;var _0x6e31b1=_0xc9b0[_0x4e1cd5];return _0x6e31b1;};'use strict';var Sequelize=require(_0x0c9b('0x0'));module[_0x0c9b('0x1')]={'penalty':{'type':Sequelize[_0x0c9b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a2e=['sequelize','exports','INTEGER'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6a2e,0x14d));var _0xe6a2=function(_0x89bb53,_0x2fdd59){_0x89bb53=_0x89bb53-0x0;var _0x449b8f=_0x6a2e[_0x89bb53];return _0x449b8f;};'use strict';var Sequelize=require(_0xe6a2('0x0'));module[_0xe6a2('0x1')]={'penalty':{'type':Sequelize[_0xe6a2('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 8b49fed..194b9e5 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 _0xbed7=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2df5db,_0x4fe432){var _0x33f706=function(_0x11b8bd){while(--_0x11b8bd){_0x2df5db['push'](_0x2df5db['shift']());}};_0x33f706(++_0x4fe432);}(_0xbed7,0x14b));var _0x7bed=function(_0x3458f7,_0x4a9fac){_0x3458f7=_0x3458f7-0x0;var _0x44a201=_0xbed7[_0x3458f7];return _0x44a201;};'use strict';var _=require(_0x7bed('0x0'));var util=require(_0x7bed('0x1'));var logger=require(_0x7bed('0x2'))(_0x7bed('0x3'));var moment=require(_0x7bed('0x4'));var BPromise=require('bluebird');var rp=require(_0x7bed('0x5'));var fs=require('fs');var path=require(_0x7bed('0x6'));var rimraf=require(_0x7bed('0x7'));var config=require(_0x7bed('0x8'));var attributes=require(_0x7bed('0x9'));module[_0x7bed('0xa')]=function(_0x41c148,_0x3aa0e9){return _0x41c148[_0x7bed('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0x7bed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd66c=['api','moment','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','../../config/logger'];(function(_0x14393d,_0xebbfe0){var _0x554bf6=function(_0x374951){while(--_0x374951){_0x14393d['push'](_0x14393d['shift']());}};_0x554bf6(++_0xebbfe0);}(_0xd66c,0x106));var _0xcd66=function(_0x5886ac,_0x36af11){_0x5886ac=_0x5886ac-0x0;var _0x6812f0=_0xd66c[_0x5886ac];return _0x6812f0;};'use strict';var _=require(_0xcd66('0x0'));var util=require('util');var logger=require(_0xcd66('0x1'))(_0xcd66('0x2'));var moment=require(_0xcd66('0x3'));var BPromise=require(_0xcd66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd66('0x5'));var rimraf=require(_0xcd66('0x6'));var config=require(_0xcd66('0x7'));var attributes=require(_0xcd66('0x8'));module[_0xcd66('0x9')]=function(_0x2cb861,_0x476c79){return _0x2cb861[_0xcd66('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0xcd66('0xb'),'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 33d3216..fe1c11d 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 _0x7c5d=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x2a215b,_0x3233c7){var _0x3b2519=function(_0xe9d57a){while(--_0xe9d57a){_0x2a215b['push'](_0x2a215b['shift']());}};_0x3b2519(++_0x3233c7);}(_0x7c5d,0x1aa));var _0xd7c5=function(_0x2d743f,_0x47458a){_0x2d743f=_0x2d743f-0x0;var _0x1fc4c2=_0x7c5d[_0x2d743f];return _0x1fc4c2;};'use strict';var _=require(_0xd7c5('0x0'));var util=require('util');var moment=require(_0xd7c5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7c5('0x2'));var db=require(_0xd7c5('0x3'))['db'];var utils=require(_0xd7c5('0x4'));var logger=require(_0xd7c5('0x5'))(_0xd7c5('0x6'));var config=require('../../config/environment');var jayson=require(_0xd7c5('0x7'));var client=jayson[_0xd7c5('0x8')][_0xd7c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f1518,_0x523443,_0x1edac4){return new BPromise(function(_0x4362b8,_0x14ae74){return client[_0xd7c5('0xa')](_0x1f1518,_0x1edac4)[_0xd7c5('0xb')](function(_0x15ab5f){logger[_0xd7c5('0xc')](_0xd7c5('0xd'),_0x523443,'request\x20sent');logger[_0xd7c5('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x523443,_0xd7c5('0xf'),JSON[_0xd7c5('0x10')](_0x15ab5f));if(_0x15ab5f[_0xd7c5('0x11')]){if(_0x15ab5f[_0xd7c5('0x11')][_0xd7c5('0x12')]===0x1f4){logger[_0xd7c5('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x523443,_0x15ab5f[_0xd7c5('0x11')][_0xd7c5('0x13')]);return _0x14ae74(_0x15ab5f[_0xd7c5('0x11')][_0xd7c5('0x13')]);}logger['error'](_0xd7c5('0xd'),_0x523443,_0x15ab5f[_0xd7c5('0x11')]['message']);return _0x4362b8(_0x15ab5f[_0xd7c5('0x11')]['message']);}else{logger[_0xd7c5('0xc')](_0xd7c5('0xd'),_0x523443,_0xd7c5('0xf'));_0x4362b8(_0x15ab5f[_0xd7c5('0x14')][_0xd7c5('0x13')]);}})[_0xd7c5('0x15')](function(_0x299b67){logger[_0xd7c5('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x523443,_0x299b67);_0x14ae74(_0x299b67);});});} \ No newline at end of file +var _0x1caa=['code','TeamVoiceQueue,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x1caa,0x15a));var _0xa1ca=function(_0x767f15,_0x433869){_0x767f15=_0x767f15-0x0;var _0x114e11=_0x1caa[_0x767f15];return _0x114e11;};'use strict';var _=require('lodash');var util=require(_0xa1ca('0x0'));var moment=require(_0xa1ca('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1ca('0x2'));var fs=require('fs');var Redis=require(_0xa1ca('0x3'));var db=require(_0xa1ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1ca('0x5'))(_0xa1ca('0x6'));var config=require(_0xa1ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa1ca('0x8')][_0xa1ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20af36,_0x52db2b,_0x6813d8){return new BPromise(function(_0x16b4ac,_0x53d5bf){return client['request'](_0x20af36,_0x6813d8)[_0xa1ca('0xa')](function(_0x40a22b){logger[_0xa1ca('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x52db2b,_0xa1ca('0xc'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x52db2b,_0xa1ca('0xc'),JSON[_0xa1ca('0xd')](_0x40a22b));if(_0x40a22b[_0xa1ca('0xe')]){if(_0x40a22b[_0xa1ca('0xe')][_0xa1ca('0xf')]===0x1f4){logger['error'](_0xa1ca('0x10'),_0x52db2b,_0x40a22b[_0xa1ca('0xe')][_0xa1ca('0x11')]);return _0x53d5bf(_0x40a22b[_0xa1ca('0xe')][_0xa1ca('0x11')]);}logger[_0xa1ca('0xe')](_0xa1ca('0x10'),_0x52db2b,_0x40a22b[_0xa1ca('0xe')][_0xa1ca('0x11')]);return _0x16b4ac(_0x40a22b[_0xa1ca('0xe')][_0xa1ca('0x11')]);}else{logger[_0xa1ca('0xb')](_0xa1ca('0x10'),_0x52db2b,_0xa1ca('0xc'));_0x16b4ac(_0x40a22b[_0xa1ca('0x12')]['message']);}})['catch'](function(_0x122b6f){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x52db2b,_0x122b6f);_0x53d5bf(_0x122b6f);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5cdb733..c5be34b 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 _0x65cb=['../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32934d,_0xd6e76e){var _0x4e6e8f=function(_0x39ebed){while(--_0x39ebed){_0x32934d['push'](_0x32934d['shift']());}};_0x4e6e8f(++_0xd6e76e);}(_0x65cb,0xa4));var _0xb65c=function(_0x12ec74,_0x46df96){_0x12ec74=_0x12ec74-0x0;var _0x502e6d=_0x65cb[_0x12ec74];return _0x502e6d;};'use strict';var multer=require(_0xb65c('0x0'));var util=require('util');var path=require(_0xb65c('0x1'));var timeout=require(_0xb65c('0x2'));var express=require(_0xb65c('0x3'));var router=express['Router']();var fs_extra=require(_0xb65c('0x4'));var auth=require(_0xb65c('0x5'));var interaction=require(_0xb65c('0x6'));var config=require(_0xb65c('0x7'));var controller=require(_0xb65c('0x8'));router['get']('/',auth[_0xb65c('0x9')](),controller[_0xb65c('0xa')]);router[_0xb65c('0xb')](_0xb65c('0xc'),auth[_0xb65c('0x9')](),controller[_0xb65c('0xd')]);router[_0xb65c('0xe')]('/',auth[_0xb65c('0x9')](),controller['create']);router[_0xb65c('0xf')](_0xb65c('0xc'),auth[_0xb65c('0x9')](),controller[_0xb65c('0x10')]);router['delete'](_0xb65c('0xc'),auth['isAuthenticated'](),controller[_0xb65c('0x11')]);module[_0xb65c('0x12')]=router; \ No newline at end of file +var _0xc00b=['post','create','update','delete','destroy','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x38f165,_0x1a582e){var _0x4ee98c=function(_0x199afb){while(--_0x199afb){_0x38f165['push'](_0x38f165['shift']());}};_0x4ee98c(++_0x1a582e);}(_0xc00b,0x1e5));var _0xbc00=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0xc00b[_0x2b737c];return _0x466ed5;};'use strict';var multer=require(_0xbc00('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc00('0x1'));var router=express['Router']();var fs_extra=require(_0xbc00('0x2'));var auth=require(_0xbc00('0x3'));var interaction=require(_0xbc00('0x4'));var config=require(_0xbc00('0x5'));var controller=require('./template.controller');router[_0xbc00('0x6')]('/',auth['isAuthenticated'](),controller[_0xbc00('0x7')]);router['get'](_0xbc00('0x8'),auth[_0xbc00('0x9')](),controller[_0xbc00('0xa')]);router[_0xbc00('0xb')]('/',auth[_0xbc00('0x9')](),controller[_0xbc00('0xc')]);router['put'](_0xbc00('0x8'),auth['isAuthenticated'](),controller[_0xbc00('0xd')]);router[_0xbc00('0xe')](_0xbc00('0x8'),auth['isAuthenticated'](),controller[_0xbc00('0xf')]);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 c32ab11..3d14835 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 _0x3031=['STRING','TEXT','sequelize','exports'];(function(_0x554d9b,_0x2ff157){var _0x24c6dd=function(_0x5f1070){while(--_0x5f1070){_0x554d9b['push'](_0x554d9b['shift']());}};_0x24c6dd(++_0x2ff157);}(_0x3031,0x176));var _0x1303=function(_0x5872ed,_0x1e468b){_0x5872ed=_0x5872ed-0x0;var _0x297213=_0x3031[_0x5872ed];return _0x297213;};'use strict';var Sequelize=require(_0x1303('0x0'));module[_0x1303('0x1')]={'name':{'type':Sequelize[_0x1303('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x1303('0x3')]}}; \ No newline at end of file +var _0x89f9=['TEXT','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x89f9,0x117));var _0x989f=function(_0x1aea3c,_0x1d0e45){_0x1aea3c=_0x1aea3c-0x0;var _0x35ff56=_0x89f9[_0x1aea3c];return _0x35ff56;};'use strict';var Sequelize=require(_0x989f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x989f('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 7088f1e..6708aa1 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 _0xaa28=['ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','error','name','send','index','Template','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5df5e3,_0x1274d6){var _0x3d1533=function(_0x42fae8){while(--_0x42fae8){_0x5df5e3['push'](_0x5df5e3['shift']());}};_0x3d1533(++_0x1274d6);}(_0xaa28,0x136));var _0x8aa2=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xaa28[_0x34df4a];return _0x145c69;};'use strict';var emlformat=require(_0x8aa2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8aa2('0x1'));var jsonpatch=require(_0x8aa2('0x2'));var rp=require(_0x8aa2('0x3'));var moment=require('moment');var BPromise=require(_0x8aa2('0x4'));var Mustache=require(_0x8aa2('0x5'));var util=require(_0x8aa2('0x6'));var path=require(_0x8aa2('0x7'));var sox=require(_0x8aa2('0x8'));var csv=require(_0x8aa2('0x9'));var ejs=require(_0x8aa2('0xa'));var fs=require('fs');var fs_extra=require(_0x8aa2('0xb'));var _=require(_0x8aa2('0xc'));var squel=require(_0x8aa2('0xd'));var crypto=require(_0x8aa2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8aa2('0xf'));var toCsv=require(_0x8aa2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8aa2('0x10'));var as=require(_0x8aa2('0x11'));var hardwareService=require(_0x8aa2('0x12'));var logger=require('../../config/logger')(_0x8aa2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8aa2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26611b,_0x266b25){_0x266b25=_0x266b25||0xcc;return function(_0x28a73f){if(_0x28a73f){return _0x26611b[_0x8aa2('0x15')](_0x266b25);}return _0x26611b[_0x8aa2('0x16')](_0x266b25)[_0x8aa2('0x17')]();};}function respondWithResult(_0x1e8baa,_0x3061ee){_0x3061ee=_0x3061ee||0xc8;return function(_0x549514){if(_0x549514){return _0x1e8baa[_0x8aa2('0x16')](_0x3061ee)[_0x8aa2('0x18')](_0x549514);}};}function respondWithFilteredResult(_0x139703,_0x37024a){return function(_0x216142){if(_0x216142){var _0x30ffd8=typeof _0x37024a['offset']===_0x8aa2('0x19')&&typeof _0x37024a['limit']===_0x8aa2('0x19');var _0x45a6dc=_0x216142[_0x8aa2('0x1a')];var _0x33262f=_0x30ffd8?0x0:_0x37024a[_0x8aa2('0x1b')];var _0x18d3c4=_0x30ffd8?_0x216142['count']:_0x37024a[_0x8aa2('0x1b')]+_0x37024a[_0x8aa2('0x1c')];var _0x1ca434;if(_0x18d3c4>=_0x45a6dc){_0x18d3c4=_0x45a6dc;_0x1ca434=0xc8;}else{_0x1ca434=0xce;}_0x139703[_0x8aa2('0x16')](_0x1ca434);return _0x139703['set'](_0x8aa2('0x1d'),_0x33262f+'-'+_0x18d3c4+'/'+_0x45a6dc)[_0x8aa2('0x18')](_0x216142);}return null;};}function patchUpdates(_0x19fd54){return function(_0x34cc09){try{jsonpatch[_0x8aa2('0x1e')](_0x34cc09,_0x19fd54,!![]);}catch(_0x4ef191){return BPromise[_0x8aa2('0x1f')](_0x4ef191);}return _0x34cc09['save']();};}function saveUpdates(_0x1b7fb8,_0x938007){return function(_0xa24718){if(_0xa24718){return _0xa24718[_0x8aa2('0x20')](_0x1b7fb8)[_0x8aa2('0x21')](function(_0x5e2f20){return _0x5e2f20;});}return null;};}function removeEntity(_0x2488fe,_0x1dc675){return function(_0x5f2128){if(_0x5f2128){return _0x5f2128[_0x8aa2('0x22')]()['then'](function(){var _0x23996c=_0x5f2128[_0x8aa2('0x23')]({'plain':!![]});var _0x4a33c7=_0x8aa2('0x24');return db[_0x8aa2('0x25')]['destroy']({'where':{'type':_0x4a33c7,'resourceId':_0x23996c['id']}})[_0x8aa2('0x21')](function(){return _0x5f2128;});})[_0x8aa2('0x21')](function(){_0x2488fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x368b78,_0x55888a){return function(_0x249baa){if(!_0x249baa){_0x368b78[_0x8aa2('0x15')](0x194);}return _0x249baa;};}function handleError(_0x3207de,_0x1c654f){_0x1c654f=_0x1c654f||0x1f4;return function(_0x3e747e){logger[_0x8aa2('0x26')](_0x3e747e['stack']);if(_0x3e747e[_0x8aa2('0x27')]){delete _0x3e747e[_0x8aa2('0x27')];}_0x3207de[_0x8aa2('0x16')](_0x1c654f)[_0x8aa2('0x28')](_0x3e747e);};}exports[_0x8aa2('0x29')]=function(_0x5ac961,_0x4d18ad){var _0x394aa2={},_0x5e28a6={},_0xeda13d={'count':0x0,'rows':[]};var _0x318db6=_['map'](db[_0x8aa2('0x2a')][_0x8aa2('0x2b')],function(_0x397011){return{'name':_0x397011[_0x8aa2('0x2c')],'type':_0x397011['type'][_0x8aa2('0x2d')]};});_0x5e28a6[_0x8aa2('0x2e')]=_[_0x8aa2('0x2f')](_0x318db6,_0x8aa2('0x27'));_0x5e28a6[_0x8aa2('0x30')]=_['keys'](_0x5ac961['query']);_0x5e28a6[_0x8aa2('0x31')]=_[_0x8aa2('0x32')](_0x5e28a6[_0x8aa2('0x2e')],_0x5e28a6[_0x8aa2('0x30')]);_0x394aa2['attributes']=_['intersection'](_0x5e28a6[_0x8aa2('0x2e')],qs[_0x8aa2('0x33')](_0x5ac961['query'][_0x8aa2('0x33')]));_0x394aa2['attributes']=_0x394aa2['attributes']['length']?_0x394aa2[_0x8aa2('0x34')]:_0x5e28a6['model'];if(!_0x5ac961[_0x8aa2('0x30')][_0x8aa2('0x35')](_0x8aa2('0x36'))){_0x394aa2[_0x8aa2('0x1c')]=qs[_0x8aa2('0x1c')](_0x5ac961[_0x8aa2('0x30')][_0x8aa2('0x1c')]);_0x394aa2['offset']=qs[_0x8aa2('0x1b')](_0x5ac961[_0x8aa2('0x30')][_0x8aa2('0x1b')]);}_0x394aa2['order']=qs[_0x8aa2('0x37')](_0x5ac961[_0x8aa2('0x30')]['sort']);_0x394aa2[_0x8aa2('0x38')]=qs[_0x8aa2('0x31')](_[_0x8aa2('0x39')](_0x5ac961[_0x8aa2('0x30')],_0x5e28a6[_0x8aa2('0x31')]),_0x318db6);if(_0x5ac961[_0x8aa2('0x30')][_0x8aa2('0x3a')]){_0x394aa2[_0x8aa2('0x38')]=_[_0x8aa2('0x3b')](_0x394aa2[_0x8aa2('0x38')],{'$or':_['map'](_0x318db6,function(_0x43c9a0){if(_0x43c9a0[_0x8aa2('0x3c')]!=='VIRTUAL'){var _0x43c040={};_0x43c040[_0x43c9a0[_0x8aa2('0x27')]]={'$like':'%'+_0x5ac961['query'][_0x8aa2('0x3a')]+'%'};return _0x43c040;}})});}_0x394aa2=_['merge']({},_0x394aa2,_0x5ac961[_0x8aa2('0x3d')]);var _0x309795={'where':_0x394aa2[_0x8aa2('0x38')]};return db['Template'][_0x8aa2('0x1a')](_0x309795)[_0x8aa2('0x21')](function(_0x37db18){_0xeda13d[_0x8aa2('0x1a')]=_0x37db18;if(_0x5ac961[_0x8aa2('0x30')]['includeAll']){_0x394aa2[_0x8aa2('0x3e')]=[{'all':!![]}];}return db[_0x8aa2('0x2a')][_0x8aa2('0x3f')](_0x394aa2);})['then'](function(_0x485a3b){_0xeda13d[_0x8aa2('0x40')]=_0x485a3b;return _0xeda13d;})[_0x8aa2('0x21')](respondWithFilteredResult(_0x4d18ad,_0x394aa2))[_0x8aa2('0x41')](handleError(_0x4d18ad,null));};exports[_0x8aa2('0x42')]=function(_0x50e6a4,_0x3e3a23){var _0x3f65d9={'raw':!![],'where':{'id':_0x50e6a4[_0x8aa2('0x43')]['id']}},_0x815f3e={};_0x815f3e[_0x8aa2('0x2e')]=_[_0x8aa2('0x44')](db[_0x8aa2('0x2a')][_0x8aa2('0x2b')]);_0x815f3e['query']=_[_0x8aa2('0x44')](_0x50e6a4[_0x8aa2('0x30')]);_0x815f3e[_0x8aa2('0x31')]=_[_0x8aa2('0x32')](_0x815f3e[_0x8aa2('0x2e')],_0x815f3e[_0x8aa2('0x30')]);_0x3f65d9[_0x8aa2('0x34')]=_['intersection'](_0x815f3e[_0x8aa2('0x2e')],qs['fields'](_0x50e6a4[_0x8aa2('0x30')][_0x8aa2('0x33')]));_0x3f65d9[_0x8aa2('0x34')]=_0x3f65d9[_0x8aa2('0x34')][_0x8aa2('0x45')]?_0x3f65d9[_0x8aa2('0x34')]:_0x815f3e['model'];if(_0x50e6a4[_0x8aa2('0x30')][_0x8aa2('0x46')]){_0x3f65d9[_0x8aa2('0x3e')]=[{'all':!![]}];}_0x3f65d9=_[_0x8aa2('0x3b')]({},_0x3f65d9,_0x50e6a4[_0x8aa2('0x3d')]);return db['Template'][_0x8aa2('0x47')](_0x3f65d9)[_0x8aa2('0x21')](handleEntityNotFound(_0x3e3a23,null))[_0x8aa2('0x21')](respondWithResult(_0x3e3a23,null))['catch'](handleError(_0x3e3a23,null));};exports['create']=function(_0x1e9d6b,_0x5ebdaf){return db['Template'][_0x8aa2('0x48')](_0x1e9d6b['body'],{})[_0x8aa2('0x21')](function(_0x21db41){var _0xee4e9c=_0x1e9d6b[_0x8aa2('0x49')][_0x8aa2('0x23')]({'plain':!![]});if(!_0xee4e9c)throw new Error(_0x8aa2('0x4a'));if(_0xee4e9c[_0x8aa2('0x4b')]===_0x8aa2('0x49')){var _0x300c59=_0x21db41[_0x8aa2('0x23')]({'plain':!![]});var _0xb91b65=_0x8aa2('0x24');return db[_0x8aa2('0x4c')]['find']({'where':{'name':_0xb91b65,'userProfileId':_0xee4e9c[_0x8aa2('0x4d')]},'raw':!![]})[_0x8aa2('0x21')](function(_0x4afa04){if(_0x4afa04&&_0x4afa04['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x300c59['name'],'resourceId':_0x300c59['id'],'type':_0x4afa04[_0x8aa2('0x27')],'sectionId':_0x4afa04['id']},{})[_0x8aa2('0x21')](function(){return _0x21db41;});}else{return _0x21db41;}})[_0x8aa2('0x41')](function(_0x19afab){logger[_0x8aa2('0x26')](_0x8aa2('0x4e'),_0x19afab);throw _0x19afab;});}return _0x21db41;})['then'](respondWithResult(_0x5ebdaf,0xc9))[_0x8aa2('0x41')](handleError(_0x5ebdaf,null));};exports[_0x8aa2('0x20')]=function(_0x50d54a,_0x54162a){if(_0x50d54a['body']['id']){delete _0x50d54a['body']['id'];}return db[_0x8aa2('0x2a')][_0x8aa2('0x47')]({'where':{'id':_0x50d54a[_0x8aa2('0x43')]['id']}})[_0x8aa2('0x21')](handleEntityNotFound(_0x54162a,null))['then'](saveUpdates(_0x50d54a[_0x8aa2('0x4f')],null))[_0x8aa2('0x21')](respondWithResult(_0x54162a,null))[_0x8aa2('0x41')](handleError(_0x54162a,null));};exports[_0x8aa2('0x22')]=function(_0x5a6173,_0x55d0d6){return db[_0x8aa2('0x2a')][_0x8aa2('0x47')]({'where':{'id':_0x5a6173[_0x8aa2('0x43')]['id']}})[_0x8aa2('0x21')](handleEntityNotFound(_0x55d0d6,null))[_0x8aa2('0x21')](removeEntity(_0x55d0d6,null))[_0x8aa2('0x41')](handleError(_0x55d0d6,null));}; \ No newline at end of file +var _0x130b=['findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Templates','sendStatus','error','stack','name','index','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','merge','options','includeAll','include'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x130b,0x69));var _0xb130=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x130b[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0xb130('0x0'));var rimraf=require(_0xb130('0x1'));var zipdir=require(_0xb130('0x2'));var jsonpatch=require(_0xb130('0x3'));var rp=require(_0xb130('0x4'));var moment=require(_0xb130('0x5'));var BPromise=require(_0xb130('0x6'));var Mustache=require(_0xb130('0x7'));var util=require(_0xb130('0x8'));var path=require(_0xb130('0x9'));var sox=require(_0xb130('0xa'));var csv=require(_0xb130('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb130('0xc'));var _=require(_0xb130('0xd'));var squel=require(_0xb130('0xe'));var crypto=require(_0xb130('0xf'));var jsforce=require(_0xb130('0x10'));var deskjs=require(_0xb130('0x11'));var toCsv=require(_0xb130('0xb'));var querystring=require('querystring');var Papa=require(_0xb130('0x12'));var Redis=require(_0xb130('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb130('0x14'));var as=require(_0xb130('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb130('0x16'))(_0xb130('0x17'));var utils=require(_0xb130('0x18'));var config=require(_0xb130('0x19'));var licenseUtil=require(_0xb130('0x1a'));var db=require(_0xb130('0x1b'))['db'];function respondWithStatusCode(_0x556777,_0x58f90a){_0x58f90a=_0x58f90a||0xcc;return function(_0x4ebb7c){if(_0x4ebb7c){return _0x556777['sendStatus'](_0x58f90a);}return _0x556777[_0xb130('0x1c')](_0x58f90a)[_0xb130('0x1d')]();};}function respondWithResult(_0x107a3e,_0x374168){_0x374168=_0x374168||0xc8;return function(_0x357fe2){if(_0x357fe2){return _0x107a3e[_0xb130('0x1c')](_0x374168)[_0xb130('0x1e')](_0x357fe2);}};}function respondWithFilteredResult(_0x5116cc,_0x255e31){return function(_0x4f8004){if(_0x4f8004){var _0x19a978=typeof _0x255e31[_0xb130('0x1f')]===_0xb130('0x20')&&typeof _0x255e31[_0xb130('0x21')]===_0xb130('0x20');var _0x155456=_0x4f8004[_0xb130('0x22')];var _0x448c2d=_0x19a978?0x0:_0x255e31[_0xb130('0x1f')];var _0x515da2=_0x19a978?_0x4f8004['count']:_0x255e31[_0xb130('0x1f')]+_0x255e31['limit'];var _0x6aa8c8;if(_0x515da2>=_0x155456){_0x515da2=_0x155456;_0x6aa8c8=0xc8;}else{_0x6aa8c8=0xce;}_0x5116cc[_0xb130('0x1c')](_0x6aa8c8);return _0x5116cc[_0xb130('0x23')](_0xb130('0x24'),_0x448c2d+'-'+_0x515da2+'/'+_0x155456)['json'](_0x4f8004);}return null;};}function patchUpdates(_0x5b4fa9){return function(_0x85b0cd){try{jsonpatch['apply'](_0x85b0cd,_0x5b4fa9,!![]);}catch(_0x116fca){return BPromise[_0xb130('0x25')](_0x116fca);}return _0x85b0cd['save']();};}function saveUpdates(_0x2f7b6c,_0x5b052a){return function(_0x318dcd){if(_0x318dcd){return _0x318dcd[_0xb130('0x26')](_0x2f7b6c)[_0xb130('0x27')](function(_0x42f355){return _0x42f355;});}return null;};}function removeEntity(_0x3d4c0f,_0x157807){return function(_0x4ddb58){if(_0x4ddb58){return _0x4ddb58[_0xb130('0x28')]()['then'](function(){var _0x5f210f=_0x4ddb58[_0xb130('0x29')]({'plain':!![]});var _0x728052=_0xb130('0x2a');return db['UserProfileResource'][_0xb130('0x28')]({'where':{'type':_0x728052,'resourceId':_0x5f210f['id']}})[_0xb130('0x27')](function(){return _0x4ddb58;});})[_0xb130('0x27')](function(){_0x3d4c0f[_0xb130('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45efa0,_0x32d620){return function(_0x48c50b){if(!_0x48c50b){_0x45efa0[_0xb130('0x2b')](0x194);}return _0x48c50b;};}function handleError(_0x3a0f01,_0x7db494){_0x7db494=_0x7db494||0x1f4;return function(_0xed4554){logger[_0xb130('0x2c')](_0xed4554[_0xb130('0x2d')]);if(_0xed4554['name']){delete _0xed4554[_0xb130('0x2e')];}_0x3a0f01[_0xb130('0x1c')](_0x7db494)['send'](_0xed4554);};}exports[_0xb130('0x2f')]=function(_0x16efd6,_0x112002){var _0x4ca07a={},_0x3b01e2={},_0x42c938={'count':0x0,'rows':[]};var _0x510290=_['map'](db[_0xb130('0x30')][_0xb130('0x31')],function(_0x3d44d2){return{'name':_0x3d44d2[_0xb130('0x32')],'type':_0x3d44d2[_0xb130('0x33')][_0xb130('0x34')]};});_0x3b01e2[_0xb130('0x35')]=_['map'](_0x510290,_0xb130('0x2e'));_0x3b01e2[_0xb130('0x36')]=_[_0xb130('0x37')](_0x16efd6['query']);_0x3b01e2[_0xb130('0x38')]=_['intersection'](_0x3b01e2[_0xb130('0x35')],_0x3b01e2[_0xb130('0x36')]);_0x4ca07a[_0xb130('0x39')]=_['intersection'](_0x3b01e2[_0xb130('0x35')],qs['fields'](_0x16efd6[_0xb130('0x36')][_0xb130('0x3a')]));_0x4ca07a[_0xb130('0x39')]=_0x4ca07a[_0xb130('0x39')][_0xb130('0x3b')]?_0x4ca07a[_0xb130('0x39')]:_0x3b01e2['model'];if(!_0x16efd6[_0xb130('0x36')][_0xb130('0x3c')]('nolimit')){_0x4ca07a[_0xb130('0x21')]=qs[_0xb130('0x21')](_0x16efd6[_0xb130('0x36')]['limit']);_0x4ca07a[_0xb130('0x1f')]=qs[_0xb130('0x1f')](_0x16efd6[_0xb130('0x36')]['offset']);}_0x4ca07a[_0xb130('0x3d')]=qs[_0xb130('0x3e')](_0x16efd6[_0xb130('0x36')][_0xb130('0x3e')]);_0x4ca07a[_0xb130('0x3f')]=qs[_0xb130('0x38')](_[_0xb130('0x40')](_0x16efd6[_0xb130('0x36')],_0x3b01e2[_0xb130('0x38')]),_0x510290);if(_0x16efd6[_0xb130('0x36')]['filter']){_0x4ca07a['where']=_['merge'](_0x4ca07a['where'],{'$or':_[_0xb130('0x41')](_0x510290,function(_0x13ff0d){if(_0x13ff0d[_0xb130('0x33')]!==_0xb130('0x42')){var _0x17c71d={};_0x17c71d[_0x13ff0d['name']]={'$like':'%'+_0x16efd6[_0xb130('0x36')]['filter']+'%'};return _0x17c71d;}})});}_0x4ca07a=_[_0xb130('0x43')]({},_0x4ca07a,_0x16efd6[_0xb130('0x44')]);var _0x48c803={'where':_0x4ca07a[_0xb130('0x3f')]};return db[_0xb130('0x30')][_0xb130('0x22')](_0x48c803)[_0xb130('0x27')](function(_0x2cee7b){_0x42c938[_0xb130('0x22')]=_0x2cee7b;if(_0x16efd6[_0xb130('0x36')][_0xb130('0x45')]){_0x4ca07a[_0xb130('0x46')]=[{'all':!![]}];}return db[_0xb130('0x30')][_0xb130('0x47')](_0x4ca07a);})[_0xb130('0x27')](function(_0x16ecfb){_0x42c938[_0xb130('0x48')]=_0x16ecfb;return _0x42c938;})[_0xb130('0x27')](respondWithFilteredResult(_0x112002,_0x4ca07a))[_0xb130('0x49')](handleError(_0x112002,null));};exports[_0xb130('0x4a')]=function(_0x1fe389,_0x91a0a2){var _0x14190d={'raw':!![],'where':{'id':_0x1fe389[_0xb130('0x4b')]['id']}},_0x1718fc={};_0x1718fc[_0xb130('0x35')]=_['keys'](db['Template']['rawAttributes']);_0x1718fc[_0xb130('0x36')]=_[_0xb130('0x37')](_0x1fe389[_0xb130('0x36')]);_0x1718fc[_0xb130('0x38')]=_[_0xb130('0x4c')](_0x1718fc['model'],_0x1718fc[_0xb130('0x36')]);_0x14190d[_0xb130('0x39')]=_['intersection'](_0x1718fc[_0xb130('0x35')],qs['fields'](_0x1fe389[_0xb130('0x36')][_0xb130('0x3a')]));_0x14190d['attributes']=_0x14190d['attributes']['length']?_0x14190d[_0xb130('0x39')]:_0x1718fc['model'];if(_0x1fe389['query'][_0xb130('0x45')]){_0x14190d[_0xb130('0x46')]=[{'all':!![]}];}_0x14190d=_[_0xb130('0x43')]({},_0x14190d,_0x1fe389[_0xb130('0x44')]);return db['Template'][_0xb130('0x4d')](_0x14190d)[_0xb130('0x27')](handleEntityNotFound(_0x91a0a2,null))[_0xb130('0x27')](respondWithResult(_0x91a0a2,null))[_0xb130('0x49')](handleError(_0x91a0a2,null));};exports[_0xb130('0x4e')]=function(_0x56ed36,_0x38b4a1){return db[_0xb130('0x30')]['create'](_0x56ed36[_0xb130('0x4f')],{})[_0xb130('0x27')](function(_0x1bcab6){var _0xf8d82e=_0x56ed36[_0xb130('0x50')][_0xb130('0x29')]({'plain':!![]});if(!_0xf8d82e)throw new Error(_0xb130('0x51'));if(_0xf8d82e[_0xb130('0x52')]===_0xb130('0x50')){var _0x213ef0=_0x1bcab6[_0xb130('0x29')]({'plain':!![]});var _0x5418e6=_0xb130('0x2a');return db[_0xb130('0x53')]['find']({'where':{'name':_0x5418e6,'userProfileId':_0xf8d82e[_0xb130('0x54')]},'raw':!![]})[_0xb130('0x27')](function(_0x69c5b1){if(_0x69c5b1&&_0x69c5b1[_0xb130('0x55')]===0x0){return db[_0xb130('0x56')][_0xb130('0x4e')]({'name':_0x213ef0['name'],'resourceId':_0x213ef0['id'],'type':_0x69c5b1[_0xb130('0x2e')],'sectionId':_0x69c5b1['id']},{})[_0xb130('0x27')](function(){return _0x1bcab6;});}else{return _0x1bcab6;}})[_0xb130('0x49')](function(_0x3857cd){logger[_0xb130('0x2c')](_0xb130('0x57'),_0x3857cd);throw _0x3857cd;});}return _0x1bcab6;})[_0xb130('0x27')](respondWithResult(_0x38b4a1,0xc9))['catch'](handleError(_0x38b4a1,null));};exports[_0xb130('0x26')]=function(_0xc1c28d,_0x264c22){if(_0xc1c28d['body']['id']){delete _0xc1c28d[_0xb130('0x4f')]['id'];}return db[_0xb130('0x30')][_0xb130('0x4d')]({'where':{'id':_0xc1c28d[_0xb130('0x4b')]['id']}})[_0xb130('0x27')](handleEntityNotFound(_0x264c22,null))[_0xb130('0x27')](saveUpdates(_0xc1c28d['body'],null))[_0xb130('0x27')](respondWithResult(_0x264c22,null))[_0xb130('0x49')](handleError(_0x264c22,null));};exports[_0xb130('0x28')]=function(_0x5cdfd8,_0x429e3d){return db[_0xb130('0x30')][_0xb130('0x4d')]({'where':{'id':_0x5cdfd8[_0xb130('0x4b')]['id']}})['then'](handleEntityNotFound(_0x429e3d,null))['then'](removeEntity(_0x429e3d,null))['catch'](handleError(_0x429e3d,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 70e8778..c2c925e 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 _0x9a22=['moment','bluebird','path','../../config/environment','./template.attributes','Template','tools_templates','lodash','util','../../config/logger','api'];(function(_0x52c27a,_0x2c6273){var _0x30f538=function(_0x124534){while(--_0x124534){_0x52c27a['push'](_0x52c27a['shift']());}};_0x30f538(++_0x2c6273);}(_0x9a22,0xc2));var _0x29a2=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x9a22[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x29a2('0x0'));var util=require(_0x29a2('0x1'));var logger=require(_0x29a2('0x2'))(_0x29a2('0x3'));var moment=require(_0x29a2('0x4'));var BPromise=require(_0x29a2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29a2('0x6'));var rimraf=require('rimraf');var config=require(_0x29a2('0x7'));var attributes=require(_0x29a2('0x8'));module['exports']=function(_0x4d2a98,_0xb1d7a9){return _0x4d2a98['define'](_0x29a2('0x9'),attributes,{'tableName':_0x29a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf6a=['path','rimraf','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3df41c,_0x2c4f5c){var _0x56cc7b=function(_0xcba7af){while(--_0xcba7af){_0x3df41c['push'](_0x3df41c['shift']());}};_0x56cc7b(++_0x2c4f5c);}(_0xaf6a,0x72));var _0xaaf6=function(_0x33654f,_0x1313a8){_0x33654f=_0x33654f-0x0;var _0x1e01b4=_0xaf6a[_0x33654f];return _0x1e01b4;};'use strict';var _=require(_0xaaf6('0x0'));var util=require(_0xaaf6('0x1'));var logger=require(_0xaaf6('0x2'))(_0xaaf6('0x3'));var moment=require(_0xaaf6('0x4'));var BPromise=require(_0xaaf6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaf6('0x6'));var rimraf=require(_0xaaf6('0x7'));var config=require('../../config/environment');var attributes=require(_0xaaf6('0x8'));module['exports']=function(_0x13306d,_0x527bdb){return _0x13306d[_0xaaf6('0x9')](_0xaaf6('0xa'),attributes,{'tableName':_0xaaf6('0xb'),'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 dd5945c..394debe 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 _0xa290=['model','GetTemplate','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Template,\x20%s,\x20%s','result','catch','Template','findAll','options','raw','attributes','limit','map','include'];(function(_0x31c133,_0x3075f7){var _0x596121=function(_0xcb270e){while(--_0xcb270e){_0x31c133['push'](_0x31c133['shift']());}};_0x596121(++_0x3075f7);}(_0xa290,0x16a));var _0x0a29=function(_0x5147c6,_0x129ce9){_0x5147c6=_0x5147c6-0x0;var _0x5a0e4e=_0xa290[_0x5147c6];return _0x5a0e4e;};'use strict';var _=require('lodash');var util=require(_0x0a29('0x0'));var moment=require(_0x0a29('0x1'));var BPromise=require('bluebird');var rs=require(_0x0a29('0x2'));var fs=require('fs');var Redis=require(_0x0a29('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0a29('0x4'));var jayson=require(_0x0a29('0x5'));var client=jayson['client'][_0x0a29('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a0fa8,_0x46b105,_0x2eba54){return new BPromise(function(_0x4917dc,_0x423db6){return client[_0x0a29('0x7')](_0x5a0fa8,_0x2eba54)[_0x0a29('0x8')](function(_0x3117f9){logger[_0x0a29('0x9')]('Template,\x20%s,\x20%s',_0x46b105,_0x0a29('0xa'));logger[_0x0a29('0xb')](_0x0a29('0xc'),_0x46b105,_0x0a29('0xa'),JSON[_0x0a29('0xd')](_0x3117f9));if(_0x3117f9[_0x0a29('0xe')]){if(_0x3117f9[_0x0a29('0xe')][_0x0a29('0xf')]===0x1f4){logger[_0x0a29('0xe')]('Template,\x20%s,\x20%s',_0x46b105,_0x3117f9[_0x0a29('0xe')][_0x0a29('0x10')]);return _0x423db6(_0x3117f9[_0x0a29('0xe')][_0x0a29('0x10')]);}logger[_0x0a29('0xe')](_0x0a29('0x11'),_0x46b105,_0x3117f9['error'][_0x0a29('0x10')]);return _0x4917dc(_0x3117f9[_0x0a29('0xe')][_0x0a29('0x10')]);}else{logger[_0x0a29('0x9')](_0x0a29('0x11'),_0x46b105,_0x0a29('0xa'));_0x4917dc(_0x3117f9[_0x0a29('0x12')][_0x0a29('0x10')]);}})[_0x0a29('0x13')](function(_0x2010ee){logger[_0x0a29('0xe')](_0x0a29('0x11'),_0x46b105,_0x2010ee);_0x423db6(_0x2010ee);});});}exports['GetTemplate']=function(_0x40a632){var _0x592df7=this;return new Promise(function(_0x2b064b,_0x2f89a7){return db[_0x0a29('0x14')][_0x0a29('0x15')]({'raw':_0x40a632[_0x0a29('0x16')]?_0x40a632[_0x0a29('0x16')][_0x0a29('0x17')]===undefined?!![]:![]:!![],'where':_0x40a632[_0x0a29('0x16')]?_0x40a632[_0x0a29('0x16')]['where']||null:null,'attributes':_0x40a632['options']?_0x40a632[_0x0a29('0x16')][_0x0a29('0x18')]||null:null,'limit':_0x40a632[_0x0a29('0x16')]?_0x40a632[_0x0a29('0x16')][_0x0a29('0x19')]||null:null,'include':_0x40a632[_0x0a29('0x16')]?_0x40a632[_0x0a29('0x16')]['include']?_[_0x0a29('0x1a')](_0x40a632[_0x0a29('0x16')][_0x0a29('0x1b')],function(_0x188094){return{'model':db[_0x188094['model']],'as':_0x188094['as'],'attributes':_0x188094['attributes'],'include':_0x188094[_0x0a29('0x1b')]?_['map'](_0x188094[_0x0a29('0x1b')],function(_0x304df7){return{'model':db[_0x304df7[_0x0a29('0x1c')]],'as':_0x304df7['as'],'attributes':_0x304df7[_0x0a29('0x18')],'include':_0x304df7[_0x0a29('0x1b')]?_[_0x0a29('0x1a')](_0x304df7[_0x0a29('0x1b')],function(_0x12ac75){return{'model':db[_0x12ac75[_0x0a29('0x1c')]],'as':_0x12ac75['as'],'attributes':_0x12ac75[_0x0a29('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0a29('0x8')](function(_0xc61ccd){logger[_0x0a29('0x9')](_0x0a29('0x1d'),_0x40a632);logger[_0x0a29('0xb')]('GetTemplate',_0x40a632,JSON[_0x0a29('0xd')](_0xc61ccd));_0x2b064b(_0xc61ccd);})[_0x0a29('0x13')](function(_0x5e212f){logger[_0x0a29('0xe')](_0x0a29('0x1d'),_0x5e212f[_0x0a29('0x10')],_0x40a632);_0x2f89a7(_0x592df7[_0x0a29('0xe')](0x1f4,_0x5e212f[_0x0a29('0x10')]));});});}; \ No newline at end of file +var _0xb0cb=['http','then','info','request\x20sent','debug','stringify','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','raw','options','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0xb0cb,0x1d0));var _0xbb0c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb0cb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xbb0c('0x0'));var util=require('util');var moment=require(_0xbb0c('0x1'));var BPromise=require(_0xbb0c('0x2'));var rs=require(_0xbb0c('0x3'));var fs=require('fs');var Redis=require(_0xbb0c('0x4'));var db=require(_0xbb0c('0x5'))['db'];var utils=require(_0xbb0c('0x6'));var logger=require(_0xbb0c('0x7'))(_0xbb0c('0x8'));var config=require(_0xbb0c('0x9'));var jayson=require(_0xbb0c('0xa'));var client=jayson[_0xbb0c('0xb')][_0xbb0c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cdeae,_0x3c6062,_0x5c02ad){return new BPromise(function(_0x162ca4,_0x11d046){return client['request'](_0x2cdeae,_0x5c02ad)[_0xbb0c('0xd')](function(_0x41f9bb){logger[_0xbb0c('0xe')]('Template,\x20%s,\x20%s',_0x3c6062,_0xbb0c('0xf'));logger[_0xbb0c('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x3c6062,_0xbb0c('0xf'),JSON[_0xbb0c('0x11')](_0x41f9bb));if(_0x41f9bb[_0xbb0c('0x12')]){if(_0x41f9bb[_0xbb0c('0x12')]['code']===0x1f4){logger['error'](_0xbb0c('0x13'),_0x3c6062,_0x41f9bb[_0xbb0c('0x12')][_0xbb0c('0x14')]);return _0x11d046(_0x41f9bb[_0xbb0c('0x12')][_0xbb0c('0x14')]);}logger[_0xbb0c('0x12')](_0xbb0c('0x13'),_0x3c6062,_0x41f9bb[_0xbb0c('0x12')][_0xbb0c('0x14')]);return _0x162ca4(_0x41f9bb[_0xbb0c('0x12')][_0xbb0c('0x14')]);}else{logger[_0xbb0c('0xe')](_0xbb0c('0x13'),_0x3c6062,_0xbb0c('0xf'));_0x162ca4(_0x41f9bb[_0xbb0c('0x15')][_0xbb0c('0x14')]);}})[_0xbb0c('0x16')](function(_0x2987e9){logger['error'](_0xbb0c('0x13'),_0x3c6062,_0x2987e9);_0x11d046(_0x2987e9);});});}exports[_0xbb0c('0x17')]=function(_0x50897d){var _0x5e46b5=this;return new Promise(function(_0x4e19dd,_0x487a5c){return db[_0xbb0c('0x18')][_0xbb0c('0x19')]({'raw':_0x50897d['options']?_0x50897d['options'][_0xbb0c('0x1a')]===undefined?!![]:![]:!![],'where':_0x50897d['options']?_0x50897d[_0xbb0c('0x1b')][_0xbb0c('0x1c')]||null:null,'attributes':_0x50897d[_0xbb0c('0x1b')]?_0x50897d[_0xbb0c('0x1b')][_0xbb0c('0x1d')]||null:null,'limit':_0x50897d['options']?_0x50897d[_0xbb0c('0x1b')][_0xbb0c('0x1e')]||null:null,'include':_0x50897d['options']?_0x50897d[_0xbb0c('0x1b')][_0xbb0c('0x1f')]?_[_0xbb0c('0x20')](_0x50897d[_0xbb0c('0x1b')][_0xbb0c('0x1f')],function(_0x5834f4){return{'model':db[_0x5834f4['model']],'as':_0x5834f4['as'],'attributes':_0x5834f4['attributes'],'include':_0x5834f4[_0xbb0c('0x1f')]?_[_0xbb0c('0x20')](_0x5834f4['include'],function(_0x5addbd){return{'model':db[_0x5addbd[_0xbb0c('0x21')]],'as':_0x5addbd['as'],'attributes':_0x5addbd[_0xbb0c('0x1d')],'include':_0x5addbd[_0xbb0c('0x1f')]?_[_0xbb0c('0x20')](_0x5addbd[_0xbb0c('0x1f')],function(_0x544faa){return{'model':db[_0x544faa[_0xbb0c('0x21')]],'as':_0x544faa['as'],'attributes':_0x544faa[_0xbb0c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39d607){logger['info']('GetTemplate',_0x50897d);logger[_0xbb0c('0x10')](_0xbb0c('0x17'),_0x50897d,JSON[_0xbb0c('0x11')](_0x39d607));_0x4e19dd(_0x39d607);})[_0xbb0c('0x16')](function(_0x35efd4){logger[_0xbb0c('0x12')](_0xbb0c('0x17'),_0x35efd4[_0xbb0c('0x14')],_0x50897d);_0x487a5c(_0x5e46b5[_0xbb0c('0x12')](0x1f4,_0x35efd4[_0xbb0c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 00072b3..db8de9a 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 _0x3064=['/:id/all_conditions','addAllCondition','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x3064,0x73));var _0x4306=function(_0x4866bd,_0x2b00b6){_0x4866bd=_0x4866bd-0x0;var _0x467ed9=_0x3064[_0x4866bd];return _0x467ed9;};'use strict';var multer=require(_0x4306('0x0'));var util=require(_0x4306('0x1'));var path=require(_0x4306('0x2'));var timeout=require(_0x4306('0x3'));var express=require(_0x4306('0x4'));var router=express[_0x4306('0x5')]();var fs_extra=require(_0x4306('0x6'));var auth=require(_0x4306('0x7'));var interaction=require(_0x4306('0x8'));var config=require(_0x4306('0x9'));var controller=require(_0x4306('0xa'));router[_0x4306('0xb')]('/',auth[_0x4306('0xc')](),controller[_0x4306('0xd')]);router[_0x4306('0xb')](_0x4306('0xe'),auth[_0x4306('0xc')](),controller['show']);router[_0x4306('0xb')]('/:id/all_conditions',auth[_0x4306('0xc')](),controller['getAllConditions']);router[_0x4306('0xb')](_0x4306('0xf'),auth[_0x4306('0xc')](),controller[_0x4306('0x10')]);router[_0x4306('0xb')](_0x4306('0x11'),auth[_0x4306('0xc')](),controller[_0x4306('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4306('0x13')](_0x4306('0x14'),auth[_0x4306('0xc')](),controller[_0x4306('0x15')]);router['post'](_0x4306('0xf'),auth[_0x4306('0xc')](),controller['addAnyCondition']);router[_0x4306('0x13')](_0x4306('0x11'),auth[_0x4306('0xc')](),controller[_0x4306('0x16')]);router[_0x4306('0x17')](_0x4306('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x4306('0x18')](_0x4306('0xe'),auth[_0x4306('0xc')](),controller[_0x4306('0x19')]);module[_0x4306('0x1a')]=router; \ No newline at end of file +var _0x5333=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','isAuthenticated','/:id','show','getAllConditions','get','getAnyConditions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction','put','update','delete','destroy'];(function(_0x2ebe55,_0x128938){var _0x248711=function(_0x36a65d){while(--_0x36a65d){_0x2ebe55['push'](_0x2ebe55['shift']());}};_0x248711(++_0x128938);}(_0x5333,0x1ef));var _0x3533=function(_0x13846e,_0x4c6eea){_0x13846e=_0x13846e-0x0;var _0x473baa=_0x5333[_0x13846e];return _0x473baa;};'use strict';var multer=require('multer');var util=require(_0x3533('0x0'));var path=require('path');var timeout=require(_0x3533('0x1'));var express=require(_0x3533('0x2'));var router=express[_0x3533('0x3')]();var fs_extra=require(_0x3533('0x4'));var auth=require(_0x3533('0x5'));var interaction=require(_0x3533('0x6'));var config=require('../../config/environment');var controller=require(_0x3533('0x7'));router['get']('/',auth[_0x3533('0x8')](),controller['index']);router['get'](_0x3533('0x9'),auth[_0x3533('0x8')](),controller[_0x3533('0xa')]);router['get']('/:id/all_conditions',auth[_0x3533('0x8')](),controller[_0x3533('0xb')]);router[_0x3533('0xc')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x3533('0xd')]);router[_0x3533('0xc')]('/:id/actions',auth['isAuthenticated'](),controller[_0x3533('0xe')]);router['post']('/',auth[_0x3533('0x8')](),controller['create']);router[_0x3533('0xf')](_0x3533('0x10'),auth[_0x3533('0x8')](),controller[_0x3533('0x11')]);router[_0x3533('0xf')]('/:id/any_conditions',auth[_0x3533('0x8')](),controller[_0x3533('0x12')]);router[_0x3533('0xf')](_0x3533('0x13'),auth['isAuthenticated'](),controller[_0x3533('0x14')]);router[_0x3533('0x15')](_0x3533('0x9'),auth['isAuthenticated'](),controller[_0x3533('0x16')]);router[_0x3533('0x17')](_0x3533('0x9'),auth['isAuthenticated'](),controller[_0x3533('0x18')]);module[_0x3533('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index cd20346..7ba9439 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 _0xa624=['BOOLEAN','STRING'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0xa624,0x9b));var _0x4a62=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xa624[_0x245afe];return _0x4eefde;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4a62('0x0')]},'channel':{'type':Sequelize[_0x4a62('0x0')]},'description':{'type':Sequelize[_0x4a62('0x0')]},'status':{'type':Sequelize[_0x4a62('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x40e1=['BOOLEAN','sequelize','STRING'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0x40e1,0x1e7));var _0x140e=function(_0x5d4600,_0x2c572f){_0x5d4600=_0x5d4600-0x0;var _0x5e71ef=_0x40e1[_0x5d4600];return _0x5e71ef;};'use strict';var Sequelize=require(_0x140e('0x0'));module['exports']={'name':{'type':Sequelize[_0x140e('0x1')]},'channel':{'type':Sequelize[_0x140e('0x1')]},'description':{'type':Sequelize[_0x140e('0x1')]},'status':{'type':Sequelize[_0x140e('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 c00dc62..2bd2b7e 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 _0xdf51=['VIRTUAL','filter','options','Trigger','count','includeAll','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','addAllCondition','Condition','addAnyCondition','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','getActions','Action','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','get','Triggers','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type'];(function(_0xeccd29,_0x2d9257){var _0x250450=function(_0x401876){while(--_0x401876){_0xeccd29['push'](_0xeccd29['shift']());}};_0x250450(++_0x2d9257);}(_0xdf51,0x13e));var _0x1df5=function(_0xdc660a,_0xdb2773){_0xdc660a=_0xdc660a-0x0;var _0x45c5e5=_0xdf51[_0xdc660a];return _0x45c5e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1df5('0x0'));var zipdir=require(_0x1df5('0x1'));var jsonpatch=require(_0x1df5('0x2'));var rp=require(_0x1df5('0x3'));var moment=require('moment');var BPromise=require(_0x1df5('0x4'));var Mustache=require(_0x1df5('0x5'));var util=require(_0x1df5('0x6'));var path=require(_0x1df5('0x7'));var sox=require(_0x1df5('0x8'));var csv=require(_0x1df5('0x9'));var ejs=require(_0x1df5('0xa'));var fs=require('fs');var fs_extra=require(_0x1df5('0xb'));var _=require(_0x1df5('0xc'));var squel=require(_0x1df5('0xd'));var crypto=require(_0x1df5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1df5('0xf'));var toCsv=require(_0x1df5('0x9'));var querystring=require(_0x1df5('0x10'));var Papa=require(_0x1df5('0x11'));var Redis=require('ioredis');var authService=require(_0x1df5('0x12'));var qs=require(_0x1df5('0x13'));var as=require(_0x1df5('0x14'));var hardwareService=require(_0x1df5('0x15'));var logger=require(_0x1df5('0x16'))('api');var utils=require(_0x1df5('0x17'));var config=require(_0x1df5('0x18'));var licenseUtil=require(_0x1df5('0x19'));var db=require(_0x1df5('0x1a'))['db'];function respondWithStatusCode(_0x1d403f,_0x43230a){_0x43230a=_0x43230a||0xcc;return function(_0x5cea95){if(_0x5cea95){return _0x1d403f[_0x1df5('0x1b')](_0x43230a);}return _0x1d403f[_0x1df5('0x1c')](_0x43230a)[_0x1df5('0x1d')]();};}function respondWithResult(_0x2ffd72,_0x5dbb92){_0x5dbb92=_0x5dbb92||0xc8;return function(_0x36b75e){if(_0x36b75e){return _0x2ffd72[_0x1df5('0x1c')](_0x5dbb92)['json'](_0x36b75e);}};}function respondWithFilteredResult(_0x2877ba,_0x3533c6){return function(_0x2e1c31){if(_0x2e1c31){var _0x3dc766=typeof _0x3533c6[_0x1df5('0x1e')]===_0x1df5('0x1f')&&typeof _0x3533c6[_0x1df5('0x20')]===_0x1df5('0x1f');var _0x3c7792=_0x2e1c31['count'];var _0x43ab1c=_0x3dc766?0x0:_0x3533c6[_0x1df5('0x1e')];var _0x5ca445=_0x3dc766?_0x2e1c31['count']:_0x3533c6[_0x1df5('0x1e')]+_0x3533c6[_0x1df5('0x20')];var _0x13cf2f;if(_0x5ca445>=_0x3c7792){_0x5ca445=_0x3c7792;_0x13cf2f=0xc8;}else{_0x13cf2f=0xce;}_0x2877ba['status'](_0x13cf2f);return _0x2877ba[_0x1df5('0x21')](_0x1df5('0x22'),_0x43ab1c+'-'+_0x5ca445+'/'+_0x3c7792)['json'](_0x2e1c31);}return null;};}function patchUpdates(_0x2bf7ad){return function(_0x934d8a){try{jsonpatch[_0x1df5('0x23')](_0x934d8a,_0x2bf7ad,!![]);}catch(_0x488fb8){return BPromise[_0x1df5('0x24')](_0x488fb8);}return _0x934d8a['save']();};}function saveUpdates(_0x5972e2,_0x370d83){return function(_0x1a9cd3){if(_0x1a9cd3){return _0x1a9cd3['update'](_0x5972e2)[_0x1df5('0x25')](function(_0x1b2f84){return _0x1b2f84;});}return null;};}function removeEntity(_0xef5ab0,_0x46a255){return function(_0x59225c){if(_0x59225c){return _0x59225c[_0x1df5('0x26')]()[_0x1df5('0x25')](function(){var _0x5270a1=_0x59225c[_0x1df5('0x27')]({'plain':!![]});var _0x536bd6=_0x1df5('0x28');return db['UserProfileResource'][_0x1df5('0x26')]({'where':{'type':_0x536bd6,'resourceId':_0x5270a1['id']}})[_0x1df5('0x25')](function(){return _0x59225c;});})['then'](function(){_0xef5ab0[_0x1df5('0x1c')](0xcc)[_0x1df5('0x1d')]();});}};}function handleEntityNotFound(_0xed3356,_0x1b9399){return function(_0x1c1485){if(!_0x1c1485){_0xed3356[_0x1df5('0x1b')](0x194);}return _0x1c1485;};}function handleError(_0x4d20f2,_0xb99f17){_0xb99f17=_0xb99f17||0x1f4;return function(_0x311049){logger[_0x1df5('0x29')](_0x311049[_0x1df5('0x2a')]);if(_0x311049[_0x1df5('0x2b')]){delete _0x311049[_0x1df5('0x2b')];}_0x4d20f2[_0x1df5('0x1c')](_0xb99f17)[_0x1df5('0x2c')](_0x311049);};}exports[_0x1df5('0x2d')]=function(_0x2f1379,_0x5cc6f6){var _0x12ed6b={},_0x5110e9={},_0x17763b={'count':0x0,'rows':[]};var _0x2cf8e9=_[_0x1df5('0x2e')](db['Trigger'][_0x1df5('0x2f')],function(_0x58fd20){return{'name':_0x58fd20[_0x1df5('0x30')],'type':_0x58fd20['type'][_0x1df5('0x31')]};});_0x5110e9[_0x1df5('0x32')]=_[_0x1df5('0x2e')](_0x2cf8e9,_0x1df5('0x2b'));_0x5110e9[_0x1df5('0x33')]=_[_0x1df5('0x34')](_0x2f1379[_0x1df5('0x33')]);_0x5110e9[_0x1df5('0x35')]=_[_0x1df5('0x36')](_0x5110e9[_0x1df5('0x32')],_0x5110e9[_0x1df5('0x33')]);_0x12ed6b['attributes']=_[_0x1df5('0x36')](_0x5110e9[_0x1df5('0x32')],qs[_0x1df5('0x37')](_0x2f1379['query'][_0x1df5('0x37')]));_0x12ed6b[_0x1df5('0x38')]=_0x12ed6b[_0x1df5('0x38')][_0x1df5('0x39')]?_0x12ed6b[_0x1df5('0x38')]:_0x5110e9[_0x1df5('0x32')];if(!_0x2f1379['query'][_0x1df5('0x3a')](_0x1df5('0x3b'))){_0x12ed6b['limit']=qs[_0x1df5('0x20')](_0x2f1379[_0x1df5('0x33')][_0x1df5('0x20')]);_0x12ed6b['offset']=qs[_0x1df5('0x1e')](_0x2f1379[_0x1df5('0x33')][_0x1df5('0x1e')]);}_0x12ed6b[_0x1df5('0x3c')]=qs['sort'](_0x2f1379[_0x1df5('0x33')][_0x1df5('0x3d')]);_0x12ed6b[_0x1df5('0x3e')]=qs['filters'](_[_0x1df5('0x3f')](_0x2f1379[_0x1df5('0x33')],_0x5110e9[_0x1df5('0x35')]),_0x2cf8e9);if(_0x2f1379[_0x1df5('0x33')]['filter']){_0x12ed6b[_0x1df5('0x3e')]=_[_0x1df5('0x40')](_0x12ed6b[_0x1df5('0x3e')],{'$or':_[_0x1df5('0x2e')](_0x2cf8e9,function(_0x4431ae){if(_0x4431ae[_0x1df5('0x41')]!==_0x1df5('0x42')){var _0x18b149={};_0x18b149[_0x4431ae[_0x1df5('0x2b')]]={'$like':'%'+_0x2f1379[_0x1df5('0x33')][_0x1df5('0x43')]+'%'};return _0x18b149;}})});}_0x12ed6b=_[_0x1df5('0x40')]({},_0x12ed6b,_0x2f1379[_0x1df5('0x44')]);var _0x4bc801={'where':_0x12ed6b['where']};return db[_0x1df5('0x45')][_0x1df5('0x46')](_0x4bc801)[_0x1df5('0x25')](function(_0x30c830){_0x17763b[_0x1df5('0x46')]=_0x30c830;if(_0x2f1379[_0x1df5('0x33')][_0x1df5('0x47')]){_0x12ed6b['include']=[{'all':!![]}];}return db[_0x1df5('0x45')][_0x1df5('0x48')](_0x12ed6b);})[_0x1df5('0x25')](function(_0x2f452c){_0x17763b[_0x1df5('0x49')]=_0x2f452c;return _0x17763b;})[_0x1df5('0x25')](respondWithFilteredResult(_0x5cc6f6,_0x12ed6b))[_0x1df5('0x4a')](handleError(_0x5cc6f6,null));};exports[_0x1df5('0x4b')]=function(_0x314bc6,_0x17f16c){var _0x5771ff={'raw':![],'where':{'id':_0x314bc6[_0x1df5('0x4c')]['id']}},_0x54df3a={};_0x54df3a[_0x1df5('0x32')]=_['keys'](db[_0x1df5('0x45')]['rawAttributes']);_0x54df3a[_0x1df5('0x33')]=_[_0x1df5('0x34')](_0x314bc6['query']);_0x54df3a[_0x1df5('0x35')]=_['intersection'](_0x54df3a[_0x1df5('0x32')],_0x54df3a[_0x1df5('0x33')]);_0x5771ff[_0x1df5('0x38')]=_[_0x1df5('0x36')](_0x54df3a[_0x1df5('0x32')],qs[_0x1df5('0x37')](_0x314bc6['query'][_0x1df5('0x37')]));_0x5771ff['attributes']=_0x5771ff[_0x1df5('0x38')]['length']?_0x5771ff[_0x1df5('0x38')]:_0x54df3a['model'];if(_0x314bc6[_0x1df5('0x33')][_0x1df5('0x47')]){_0x5771ff['include']=[{'all':!![]}];}_0x5771ff=_[_0x1df5('0x40')]({},_0x5771ff,_0x314bc6[_0x1df5('0x44')]);return db[_0x1df5('0x45')][_0x1df5('0x4d')](_0x5771ff)[_0x1df5('0x25')](handleEntityNotFound(_0x17f16c,null))[_0x1df5('0x25')](respondWithResult(_0x17f16c,null))[_0x1df5('0x4a')](handleError(_0x17f16c,null));};exports[_0x1df5('0x4e')]=function(_0x238d4c,_0x5363fe){return db[_0x1df5('0x45')][_0x1df5('0x4e')](_0x238d4c[_0x1df5('0x4f')],{})['then'](function(_0x3c778d){var _0x531303=_0x238d4c['user'][_0x1df5('0x27')]({'plain':!![]});if(!_0x531303)throw new Error(_0x1df5('0x50'));if(_0x531303['role']===_0x1df5('0x51')){var _0x4e744a=_0x3c778d[_0x1df5('0x27')]({'plain':!![]});var _0x4b8ff8=_0x1df5('0x28');return db[_0x1df5('0x52')]['find']({'where':{'name':_0x4b8ff8,'userProfileId':_0x531303[_0x1df5('0x53')]},'raw':!![]})[_0x1df5('0x25')](function(_0x31b426){if(_0x31b426&&_0x31b426[_0x1df5('0x54')]===0x0){return db[_0x1df5('0x55')][_0x1df5('0x4e')]({'name':_0x4e744a[_0x1df5('0x2b')],'resourceId':_0x4e744a['id'],'type':_0x31b426[_0x1df5('0x2b')],'sectionId':_0x31b426['id']},{})[_0x1df5('0x25')](function(){return _0x3c778d;});}else{return _0x3c778d;}})['catch'](function(_0xb49283){logger[_0x1df5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb49283);throw _0xb49283;});}return _0x3c778d;})[_0x1df5('0x25')](respondWithResult(_0x5363fe,0xc9))['catch'](handleError(_0x5363fe,null));};exports['update']=function(_0xb9ff0b,_0x4114c7){if(_0xb9ff0b['body']['id']){delete _0xb9ff0b['body']['id'];}return db[_0x1df5('0x45')]['find']({'where':{'id':_0xb9ff0b[_0x1df5('0x4c')]['id']}})[_0x1df5('0x25')](handleEntityNotFound(_0x4114c7,null))['then'](saveUpdates(_0xb9ff0b[_0x1df5('0x4f')],null))['then'](respondWithResult(_0x4114c7,null))[_0x1df5('0x4a')](handleError(_0x4114c7,null));};exports[_0x1df5('0x26')]=function(_0x391aef,_0x43b2ed){return db[_0x1df5('0x45')][_0x1df5('0x4d')]({'where':{'id':_0x391aef[_0x1df5('0x4c')]['id']}})[_0x1df5('0x25')](handleEntityNotFound(_0x43b2ed,null))[_0x1df5('0x25')](removeEntity(_0x43b2ed,null))[_0x1df5('0x4a')](handleError(_0x43b2ed,null));};exports[_0x1df5('0x56')]=function(_0x4eee7a,_0x4c0389,_0x577278){if(_0x4eee7a[_0x1df5('0x4f')]['id']){delete _0x4eee7a[_0x1df5('0x4f')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4eee7a[_0x1df5('0x4c')]['id']}})[_0x1df5('0x25')](handleEntityNotFound(_0x4c0389,null))['then'](function(_0x33ba7e){if(_0x33ba7e){_0x4eee7a[_0x1df5('0x4f')]['TriggerAllId']=_0x33ba7e['id'];return db[_0x1df5('0x57')][_0x1df5('0x4e')](_0x4eee7a[_0x1df5('0x4f')]);}})[_0x1df5('0x25')](respondWithResult(_0x4c0389,null))[_0x1df5('0x4a')](handleError(_0x4c0389,null));};exports[_0x1df5('0x58')]=function(_0x207ae4,_0x57fd24,_0x2d09cb){if(_0x207ae4[_0x1df5('0x4f')]['id']){delete _0x207ae4[_0x1df5('0x4f')]['id'];}return db[_0x1df5('0x45')][_0x1df5('0x4d')]({'where':{'id':_0x207ae4[_0x1df5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57fd24,null))[_0x1df5('0x25')](function(_0x44a212){if(_0x44a212){_0x207ae4[_0x1df5('0x4f')]['TriggerAnyId']=_0x44a212['id'];return db['Condition'][_0x1df5('0x4e')](_0x207ae4[_0x1df5('0x4f')]);}})['then'](respondWithResult(_0x57fd24,null))['catch'](handleError(_0x57fd24,null));};exports['getAllConditions']=function(_0x11a45c,_0x8db19a,_0x278132){var _0x5d067a={};var _0x29fb75={};var _0x1772b8;var _0x2de89a;return db[_0x1df5('0x45')]['findOne']({'where':{'id':_0x11a45c[_0x1df5('0x4c')]['id']}})[_0x1df5('0x25')](handleEntityNotFound(_0x8db19a,null))[_0x1df5('0x25')](function(_0x14be31){if(_0x14be31){_0x1772b8=_0x14be31;_0x29fb75[_0x1df5('0x32')]=_[_0x1df5('0x34')](db[_0x1df5('0x57')][_0x1df5('0x2f')]);_0x29fb75[_0x1df5('0x33')]=_[_0x1df5('0x34')](_0x11a45c[_0x1df5('0x33')]);_0x29fb75[_0x1df5('0x35')]=_[_0x1df5('0x36')](_0x29fb75[_0x1df5('0x32')],_0x29fb75[_0x1df5('0x33')]);_0x5d067a[_0x1df5('0x38')]=_[_0x1df5('0x36')](_0x29fb75[_0x1df5('0x32')],qs[_0x1df5('0x37')](_0x11a45c[_0x1df5('0x33')][_0x1df5('0x37')]));_0x5d067a['attributes']=_0x5d067a[_0x1df5('0x38')][_0x1df5('0x39')]?_0x5d067a['attributes']:_0x29fb75[_0x1df5('0x32')];_0x5d067a[_0x1df5('0x3c')]=qs['sort'](_0x11a45c[_0x1df5('0x33')][_0x1df5('0x3d')]);_0x5d067a[_0x1df5('0x3e')]=qs[_0x1df5('0x35')](_[_0x1df5('0x3f')](_0x11a45c[_0x1df5('0x33')],_0x29fb75['filters']));if(_0x11a45c[_0x1df5('0x33')][_0x1df5('0x43')]){_0x5d067a[_0x1df5('0x3e')]=_[_0x1df5('0x40')](_0x5d067a['where'],{'$or':_[_0x1df5('0x2e')](_0x5d067a['attributes'],function(_0x43da10){var _0x3ea36e={};_0x3ea36e[_0x43da10]={'$like':'%'+_0x11a45c[_0x1df5('0x33')][_0x1df5('0x43')]+'%'};return _0x3ea36e;})});}_0x5d067a=_[_0x1df5('0x40')]({},_0x5d067a,_0x11a45c[_0x1df5('0x44')]);return _0x1772b8[_0x1df5('0x59')](_0x5d067a);}})[_0x1df5('0x25')](function(_0x4a619d){if(_0x4a619d){_0x2de89a=_0x4a619d['length'];if(!_0x11a45c[_0x1df5('0x33')][_0x1df5('0x3a')]('nolimit')){_0x5d067a[_0x1df5('0x20')]=qs['limit'](_0x11a45c[_0x1df5('0x33')]['limit']);_0x5d067a[_0x1df5('0x1e')]=qs['offset'](_0x11a45c[_0x1df5('0x33')][_0x1df5('0x1e')]);}return _0x1772b8['getAllConditions'](_0x5d067a);}})[_0x1df5('0x25')](function(_0x39a5da){if(_0x39a5da){return _0x39a5da?{'count':_0x2de89a,'rows':_0x39a5da}:null;}})[_0x1df5('0x25')](respondWithResult(_0x8db19a,null))[_0x1df5('0x4a')](handleError(_0x8db19a,null));};exports[_0x1df5('0x5a')]=function(_0x4efded,_0x3d10c7,_0x6cf9a3){var _0x5c7e42={};var _0x54455a={};var _0x45cb30;var _0x31de2b;return db['Trigger'][_0x1df5('0x5b')]({'where':{'id':_0x4efded[_0x1df5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d10c7,null))['then'](function(_0x4528da){if(_0x4528da){_0x45cb30=_0x4528da;_0x54455a['model']=_[_0x1df5('0x34')](db[_0x1df5('0x57')]['rawAttributes']);_0x54455a[_0x1df5('0x33')]=_[_0x1df5('0x34')](_0x4efded[_0x1df5('0x33')]);_0x54455a[_0x1df5('0x35')]=_[_0x1df5('0x36')](_0x54455a[_0x1df5('0x32')],_0x54455a[_0x1df5('0x33')]);_0x5c7e42[_0x1df5('0x38')]=_['intersection'](_0x54455a[_0x1df5('0x32')],qs['fields'](_0x4efded[_0x1df5('0x33')][_0x1df5('0x37')]));_0x5c7e42['attributes']=_0x5c7e42['attributes'][_0x1df5('0x39')]?_0x5c7e42[_0x1df5('0x38')]:_0x54455a[_0x1df5('0x32')];_0x5c7e42['order']=qs[_0x1df5('0x3d')](_0x4efded[_0x1df5('0x33')]['sort']);_0x5c7e42[_0x1df5('0x3e')]=qs['filters'](_[_0x1df5('0x3f')](_0x4efded[_0x1df5('0x33')],_0x54455a['filters']));if(_0x4efded[_0x1df5('0x33')]['filter']){_0x5c7e42[_0x1df5('0x3e')]=_[_0x1df5('0x40')](_0x5c7e42[_0x1df5('0x3e')],{'$or':_['map'](_0x5c7e42[_0x1df5('0x38')],function(_0x240e7e){var _0x2d2598={};_0x2d2598[_0x240e7e]={'$like':'%'+_0x4efded[_0x1df5('0x33')][_0x1df5('0x43')]+'%'};return _0x2d2598;})});}_0x5c7e42=_[_0x1df5('0x40')]({},_0x5c7e42,_0x4efded['options']);return _0x45cb30[_0x1df5('0x5a')](_0x5c7e42);}})['then'](function(_0x318d69){if(_0x318d69){_0x31de2b=_0x318d69[_0x1df5('0x39')];if(!_0x4efded[_0x1df5('0x33')][_0x1df5('0x3a')]('nolimit')){_0x5c7e42[_0x1df5('0x20')]=qs[_0x1df5('0x20')](_0x4efded[_0x1df5('0x33')][_0x1df5('0x20')]);_0x5c7e42[_0x1df5('0x1e')]=qs[_0x1df5('0x1e')](_0x4efded[_0x1df5('0x33')][_0x1df5('0x1e')]);}return _0x45cb30[_0x1df5('0x5a')](_0x5c7e42);}})[_0x1df5('0x25')](function(_0x19b359){if(_0x19b359){return _0x19b359?{'count':_0x31de2b,'rows':_0x19b359}:null;}})[_0x1df5('0x25')](respondWithResult(_0x3d10c7,null))['catch'](handleError(_0x3d10c7,null));};exports[_0x1df5('0x5c')]=function(_0xcf1e8a,_0x2b9a9d,_0x23287d){if(_0xcf1e8a[_0x1df5('0x4f')]['id']){delete _0xcf1e8a[_0x1df5('0x4f')]['id'];}return db[_0x1df5('0x45')]['find']({'where':{'id':_0xcf1e8a['params']['id']}})[_0x1df5('0x25')](handleEntityNotFound(_0x2b9a9d,null))[_0x1df5('0x25')](function(_0x37d422){if(_0x37d422){_0xcf1e8a[_0x1df5('0x4f')][_0x1df5('0x5d')]=_0x37d422['id'];return db['Action']['create'](_0xcf1e8a[_0x1df5('0x4f')]);}})['then'](respondWithResult(_0x2b9a9d,null))[_0x1df5('0x4a')](handleError(_0x2b9a9d,null));};exports[_0x1df5('0x5e')]=function(_0x329aba,_0x1fb09a,_0x4b9dec){var _0x387f13={};var _0x5047f1={};var _0xe4c8a2;var _0x81a85;return db[_0x1df5('0x45')][_0x1df5('0x5b')]({'where':{'id':_0x329aba[_0x1df5('0x4c')]['id']}})[_0x1df5('0x25')](handleEntityNotFound(_0x1fb09a,null))['then'](function(_0x30e6d6){if(_0x30e6d6){_0xe4c8a2=_0x30e6d6;_0x5047f1['model']=_[_0x1df5('0x34')](db[_0x1df5('0x5f')][_0x1df5('0x2f')]);_0x5047f1['query']=_['keys'](_0x329aba[_0x1df5('0x33')]);_0x5047f1[_0x1df5('0x35')]=_['intersection'](_0x5047f1[_0x1df5('0x32')],_0x5047f1[_0x1df5('0x33')]);_0x387f13[_0x1df5('0x38')]=_[_0x1df5('0x36')](_0x5047f1['model'],qs['fields'](_0x329aba['query'][_0x1df5('0x37')]));_0x387f13[_0x1df5('0x38')]=_0x387f13[_0x1df5('0x38')][_0x1df5('0x39')]?_0x387f13[_0x1df5('0x38')]:_0x5047f1[_0x1df5('0x32')];_0x387f13[_0x1df5('0x3c')]=qs[_0x1df5('0x3d')](_0x329aba['query'][_0x1df5('0x3d')]);_0x387f13[_0x1df5('0x3e')]=qs['filters'](_['pick'](_0x329aba[_0x1df5('0x33')],_0x5047f1['filters']));if(_0x329aba[_0x1df5('0x33')][_0x1df5('0x43')]){_0x387f13['where']=_['merge'](_0x387f13[_0x1df5('0x3e')],{'$or':_['map'](_0x387f13[_0x1df5('0x38')],function(_0x35f098){var _0x35f7fd={};_0x35f7fd[_0x35f098]={'$like':'%'+_0x329aba['query'][_0x1df5('0x43')]+'%'};return _0x35f7fd;})});}_0x387f13=_['merge']({},_0x387f13,_0x329aba[_0x1df5('0x44')]);return _0xe4c8a2[_0x1df5('0x5e')](_0x387f13);}})[_0x1df5('0x25')](function(_0x460b2a){if(_0x460b2a){_0x81a85=_0x460b2a[_0x1df5('0x39')];if(!_0x329aba[_0x1df5('0x33')][_0x1df5('0x3a')](_0x1df5('0x3b'))){_0x387f13[_0x1df5('0x20')]=qs[_0x1df5('0x20')](_0x329aba[_0x1df5('0x33')][_0x1df5('0x20')]);_0x387f13['offset']=qs[_0x1df5('0x1e')](_0x329aba[_0x1df5('0x33')][_0x1df5('0x1e')]);}return _0xe4c8a2[_0x1df5('0x5e')](_0x387f13);}})[_0x1df5('0x25')](function(_0x39d6fe){if(_0x39d6fe){return _0x39d6fe?{'count':_0x81a85,'rows':_0x39d6fe}:null;}})[_0x1df5('0x25')](respondWithResult(_0x1fb09a,null))[_0x1df5('0x4a')](handleError(_0x1fb09a,null));}; \ No newline at end of file +var _0x6fcf=['UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','order','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','Triggers'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6fcf,0x1b7));var _0xf6fc=function(_0x4d0be7,_0xe3a0d0){_0x4d0be7=_0x4d0be7-0x0;var _0x2a4910=_0x6fcf[_0x4d0be7];return _0x2a4910;};'use strict';var emlformat=require(_0xf6fc('0x0'));var rimraf=require(_0xf6fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6fc('0x2'));var rp=require(_0xf6fc('0x3'));var moment=require(_0xf6fc('0x4'));var BPromise=require(_0xf6fc('0x5'));var Mustache=require('mustache');var util=require(_0xf6fc('0x6'));var path=require(_0xf6fc('0x7'));var sox=require(_0xf6fc('0x8'));var csv=require('to-csv');var ejs=require(_0xf6fc('0x9'));var fs=require('fs');var fs_extra=require(_0xf6fc('0xa'));var _=require(_0xf6fc('0xb'));var squel=require(_0xf6fc('0xc'));var crypto=require(_0xf6fc('0xd'));var jsforce=require(_0xf6fc('0xe'));var deskjs=require(_0xf6fc('0xf'));var toCsv=require(_0xf6fc('0x10'));var querystring=require(_0xf6fc('0x11'));var Papa=require(_0xf6fc('0x12'));var Redis=require(_0xf6fc('0x13'));var authService=require(_0xf6fc('0x14'));var qs=require(_0xf6fc('0x15'));var as=require(_0xf6fc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6fc('0x17'))(_0xf6fc('0x18'));var utils=require(_0xf6fc('0x19'));var config=require(_0xf6fc('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405685,_0x15ae55){_0x15ae55=_0x15ae55||0xcc;return function(_0x3f1d31){if(_0x3f1d31){return _0x405685[_0xf6fc('0x1b')](_0x15ae55);}return _0x405685[_0xf6fc('0x1c')](_0x15ae55)['end']();};}function respondWithResult(_0x368cc9,_0x3b9fa6){_0x3b9fa6=_0x3b9fa6||0xc8;return function(_0x1905a7){if(_0x1905a7){return _0x368cc9[_0xf6fc('0x1c')](_0x3b9fa6)[_0xf6fc('0x1d')](_0x1905a7);}};}function respondWithFilteredResult(_0x159b8b,_0x111c0f){return function(_0x3ca581){if(_0x3ca581){var _0x322aa6=typeof _0x111c0f[_0xf6fc('0x1e')]===_0xf6fc('0x1f')&&typeof _0x111c0f['limit']===_0xf6fc('0x1f');var _0x2c14a1=_0x3ca581[_0xf6fc('0x20')];var _0x569608=_0x322aa6?0x0:_0x111c0f[_0xf6fc('0x1e')];var _0x12273d=_0x322aa6?_0x3ca581[_0xf6fc('0x20')]:_0x111c0f[_0xf6fc('0x1e')]+_0x111c0f[_0xf6fc('0x21')];var _0x4510b0;if(_0x12273d>=_0x2c14a1){_0x12273d=_0x2c14a1;_0x4510b0=0xc8;}else{_0x4510b0=0xce;}_0x159b8b[_0xf6fc('0x1c')](_0x4510b0);return _0x159b8b[_0xf6fc('0x22')](_0xf6fc('0x23'),_0x569608+'-'+_0x12273d+'/'+_0x2c14a1)[_0xf6fc('0x1d')](_0x3ca581);}return null;};}function patchUpdates(_0x4aa978){return function(_0x2d3737){try{jsonpatch['apply'](_0x2d3737,_0x4aa978,!![]);}catch(_0x5a4718){return BPromise['reject'](_0x5a4718);}return _0x2d3737[_0xf6fc('0x24')]();};}function saveUpdates(_0x447c18,_0x4a5c35){return function(_0x2cb98d){if(_0x2cb98d){return _0x2cb98d[_0xf6fc('0x25')](_0x447c18)[_0xf6fc('0x26')](function(_0xf9740b){return _0xf9740b;});}return null;};}function removeEntity(_0x4c2483,_0x2fa400){return function(_0x116841){if(_0x116841){return _0x116841[_0xf6fc('0x27')]()[_0xf6fc('0x26')](function(){var _0x1afa34=_0x116841['get']({'plain':!![]});var _0x51b611=_0xf6fc('0x28');return db[_0xf6fc('0x29')][_0xf6fc('0x27')]({'where':{'type':_0x51b611,'resourceId':_0x1afa34['id']}})[_0xf6fc('0x26')](function(){return _0x116841;});})[_0xf6fc('0x26')](function(){_0x4c2483[_0xf6fc('0x1c')](0xcc)[_0xf6fc('0x2a')]();});}};}function handleEntityNotFound(_0x308174,_0x514f7b){return function(_0x4773ce){if(!_0x4773ce){_0x308174[_0xf6fc('0x1b')](0x194);}return _0x4773ce;};}function handleError(_0x37083f,_0x897d6a){_0x897d6a=_0x897d6a||0x1f4;return function(_0x467c55){logger['error'](_0x467c55[_0xf6fc('0x2b')]);if(_0x467c55[_0xf6fc('0x2c')]){delete _0x467c55['name'];}_0x37083f['status'](_0x897d6a)[_0xf6fc('0x2d')](_0x467c55);};}exports[_0xf6fc('0x2e')]=function(_0x1e6214,_0x3e8c97){var _0x2a018b={},_0x57524e={},_0xb56e47={'count':0x0,'rows':[]};var _0x7e4d2b=_[_0xf6fc('0x2f')](db[_0xf6fc('0x30')][_0xf6fc('0x31')],function(_0x3a38cc){return{'name':_0x3a38cc[_0xf6fc('0x32')],'type':_0x3a38cc[_0xf6fc('0x33')][_0xf6fc('0x34')]};});_0x57524e['model']=_[_0xf6fc('0x2f')](_0x7e4d2b,_0xf6fc('0x2c'));_0x57524e[_0xf6fc('0x35')]=_[_0xf6fc('0x36')](_0x1e6214[_0xf6fc('0x35')]);_0x57524e[_0xf6fc('0x37')]=_[_0xf6fc('0x38')](_0x57524e[_0xf6fc('0x39')],_0x57524e[_0xf6fc('0x35')]);_0x2a018b['attributes']=_[_0xf6fc('0x38')](_0x57524e[_0xf6fc('0x39')],qs[_0xf6fc('0x3a')](_0x1e6214[_0xf6fc('0x35')][_0xf6fc('0x3a')]));_0x2a018b[_0xf6fc('0x3b')]=_0x2a018b[_0xf6fc('0x3b')][_0xf6fc('0x3c')]?_0x2a018b[_0xf6fc('0x3b')]:_0x57524e[_0xf6fc('0x39')];if(!_0x1e6214['query'][_0xf6fc('0x3d')](_0xf6fc('0x3e'))){_0x2a018b['limit']=qs['limit'](_0x1e6214[_0xf6fc('0x35')][_0xf6fc('0x21')]);_0x2a018b['offset']=qs['offset'](_0x1e6214['query'][_0xf6fc('0x1e')]);}_0x2a018b['order']=qs[_0xf6fc('0x3f')](_0x1e6214[_0xf6fc('0x35')][_0xf6fc('0x3f')]);_0x2a018b[_0xf6fc('0x40')]=qs[_0xf6fc('0x37')](_[_0xf6fc('0x41')](_0x1e6214['query'],_0x57524e[_0xf6fc('0x37')]),_0x7e4d2b);if(_0x1e6214[_0xf6fc('0x35')][_0xf6fc('0x42')]){_0x2a018b[_0xf6fc('0x40')]=_[_0xf6fc('0x43')](_0x2a018b['where'],{'$or':_['map'](_0x7e4d2b,function(_0x9f4a02){if(_0x9f4a02[_0xf6fc('0x33')]!==_0xf6fc('0x44')){var _0x556cfe={};_0x556cfe[_0x9f4a02[_0xf6fc('0x2c')]]={'$like':'%'+_0x1e6214['query'][_0xf6fc('0x42')]+'%'};return _0x556cfe;}})});}_0x2a018b=_[_0xf6fc('0x43')]({},_0x2a018b,_0x1e6214[_0xf6fc('0x45')]);var _0x45ff50={'where':_0x2a018b[_0xf6fc('0x40')]};return db[_0xf6fc('0x30')][_0xf6fc('0x20')](_0x45ff50)[_0xf6fc('0x26')](function(_0x3979a4){_0xb56e47['count']=_0x3979a4;if(_0x1e6214[_0xf6fc('0x35')][_0xf6fc('0x46')]){_0x2a018b[_0xf6fc('0x47')]=[{'all':!![]}];}return db[_0xf6fc('0x30')]['findAll'](_0x2a018b);})[_0xf6fc('0x26')](function(_0x4b5c1d){_0xb56e47['rows']=_0x4b5c1d;return _0xb56e47;})['then'](respondWithFilteredResult(_0x3e8c97,_0x2a018b))[_0xf6fc('0x48')](handleError(_0x3e8c97,null));};exports[_0xf6fc('0x49')]=function(_0x2f5ed8,_0x4ceaab){var _0xda8506={'raw':![],'where':{'id':_0x2f5ed8['params']['id']}},_0x3e5cb9={};_0x3e5cb9['model']=_[_0xf6fc('0x36')](db[_0xf6fc('0x30')][_0xf6fc('0x31')]);_0x3e5cb9[_0xf6fc('0x35')]=_[_0xf6fc('0x36')](_0x2f5ed8[_0xf6fc('0x35')]);_0x3e5cb9['filters']=_[_0xf6fc('0x38')](_0x3e5cb9[_0xf6fc('0x39')],_0x3e5cb9['query']);_0xda8506[_0xf6fc('0x3b')]=_[_0xf6fc('0x38')](_0x3e5cb9[_0xf6fc('0x39')],qs[_0xf6fc('0x3a')](_0x2f5ed8['query'][_0xf6fc('0x3a')]));_0xda8506[_0xf6fc('0x3b')]=_0xda8506[_0xf6fc('0x3b')][_0xf6fc('0x3c')]?_0xda8506['attributes']:_0x3e5cb9[_0xf6fc('0x39')];if(_0x2f5ed8[_0xf6fc('0x35')]['includeAll']){_0xda8506[_0xf6fc('0x47')]=[{'all':!![]}];}_0xda8506=_[_0xf6fc('0x43')]({},_0xda8506,_0x2f5ed8[_0xf6fc('0x45')]);return db[_0xf6fc('0x30')][_0xf6fc('0x4a')](_0xda8506)[_0xf6fc('0x26')](handleEntityNotFound(_0x4ceaab,null))['then'](respondWithResult(_0x4ceaab,null))[_0xf6fc('0x48')](handleError(_0x4ceaab,null));};exports[_0xf6fc('0x4b')]=function(_0x10b524,_0x1c38be){return db[_0xf6fc('0x30')][_0xf6fc('0x4b')](_0x10b524[_0xf6fc('0x4c')],{})[_0xf6fc('0x26')](function(_0x479014){var _0x5c787d=_0x10b524[_0xf6fc('0x4d')]['get']({'plain':!![]});if(!_0x5c787d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c787d[_0xf6fc('0x4e')]===_0xf6fc('0x4d')){var _0x637a15=_0x479014[_0xf6fc('0x4f')]({'plain':!![]});var _0x1ad8c1='Triggers';return db[_0xf6fc('0x50')][_0xf6fc('0x4a')]({'where':{'name':_0x1ad8c1,'userProfileId':_0x5c787d[_0xf6fc('0x51')]},'raw':!![]})['then'](function(_0x42785d){if(_0x42785d&&_0x42785d[_0xf6fc('0x52')]===0x0){return db[_0xf6fc('0x29')][_0xf6fc('0x4b')]({'name':_0x637a15['name'],'resourceId':_0x637a15['id'],'type':_0x42785d[_0xf6fc('0x2c')],'sectionId':_0x42785d['id']},{})[_0xf6fc('0x26')](function(){return _0x479014;});}else{return _0x479014;}})[_0xf6fc('0x48')](function(_0x90eedb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x90eedb);throw _0x90eedb;});}return _0x479014;})[_0xf6fc('0x26')](respondWithResult(_0x1c38be,0xc9))[_0xf6fc('0x48')](handleError(_0x1c38be,null));};exports[_0xf6fc('0x25')]=function(_0xc2bd3e,_0x51172c){if(_0xc2bd3e[_0xf6fc('0x4c')]['id']){delete _0xc2bd3e['body']['id'];}return db['Trigger'][_0xf6fc('0x4a')]({'where':{'id':_0xc2bd3e[_0xf6fc('0x53')]['id']}})['then'](handleEntityNotFound(_0x51172c,null))[_0xf6fc('0x26')](saveUpdates(_0xc2bd3e[_0xf6fc('0x4c')],null))[_0xf6fc('0x26')](respondWithResult(_0x51172c,null))[_0xf6fc('0x48')](handleError(_0x51172c,null));};exports['destroy']=function(_0x124cc5,_0x5ace79){return db[_0xf6fc('0x30')][_0xf6fc('0x4a')]({'where':{'id':_0x124cc5[_0xf6fc('0x53')]['id']}})[_0xf6fc('0x26')](handleEntityNotFound(_0x5ace79,null))[_0xf6fc('0x26')](removeEntity(_0x5ace79,null))[_0xf6fc('0x48')](handleError(_0x5ace79,null));};exports[_0xf6fc('0x54')]=function(_0x27acf4,_0x5abda8,_0x5ac5e8){if(_0x27acf4[_0xf6fc('0x4c')]['id']){delete _0x27acf4['body']['id'];}return db[_0xf6fc('0x30')]['find']({'where':{'id':_0x27acf4[_0xf6fc('0x53')]['id']}})[_0xf6fc('0x26')](handleEntityNotFound(_0x5abda8,null))[_0xf6fc('0x26')](function(_0x4ca471){if(_0x4ca471){_0x27acf4[_0xf6fc('0x4c')][_0xf6fc('0x55')]=_0x4ca471['id'];return db[_0xf6fc('0x56')][_0xf6fc('0x4b')](_0x27acf4[_0xf6fc('0x4c')]);}})[_0xf6fc('0x26')](respondWithResult(_0x5abda8,null))[_0xf6fc('0x48')](handleError(_0x5abda8,null));};exports[_0xf6fc('0x57')]=function(_0x217f9e,_0x31e8be,_0x349a14){if(_0x217f9e['body']['id']){delete _0x217f9e[_0xf6fc('0x4c')]['id'];}return db[_0xf6fc('0x30')][_0xf6fc('0x4a')]({'where':{'id':_0x217f9e['params']['id']}})[_0xf6fc('0x26')](handleEntityNotFound(_0x31e8be,null))['then'](function(_0x1b0119){if(_0x1b0119){_0x217f9e[_0xf6fc('0x4c')]['TriggerAnyId']=_0x1b0119['id'];return db['Condition']['create'](_0x217f9e[_0xf6fc('0x4c')]);}})[_0xf6fc('0x26')](respondWithResult(_0x31e8be,null))[_0xf6fc('0x48')](handleError(_0x31e8be,null));};exports[_0xf6fc('0x58')]=function(_0x418adb,_0x503d3e,_0x1ca68d){var _0x51f8a0={};var _0x69dac0={};var _0x162c1c;var _0x3d3682;return db['Trigger'][_0xf6fc('0x59')]({'where':{'id':_0x418adb[_0xf6fc('0x53')]['id']}})['then'](handleEntityNotFound(_0x503d3e,null))['then'](function(_0x359d3b){if(_0x359d3b){_0x162c1c=_0x359d3b;_0x69dac0[_0xf6fc('0x39')]=_[_0xf6fc('0x36')](db[_0xf6fc('0x56')]['rawAttributes']);_0x69dac0['query']=_['keys'](_0x418adb[_0xf6fc('0x35')]);_0x69dac0[_0xf6fc('0x37')]=_['intersection'](_0x69dac0['model'],_0x69dac0[_0xf6fc('0x35')]);_0x51f8a0[_0xf6fc('0x3b')]=_[_0xf6fc('0x38')](_0x69dac0[_0xf6fc('0x39')],qs[_0xf6fc('0x3a')](_0x418adb['query'][_0xf6fc('0x3a')]));_0x51f8a0[_0xf6fc('0x3b')]=_0x51f8a0[_0xf6fc('0x3b')][_0xf6fc('0x3c')]?_0x51f8a0[_0xf6fc('0x3b')]:_0x69dac0[_0xf6fc('0x39')];_0x51f8a0[_0xf6fc('0x5a')]=qs[_0xf6fc('0x3f')](_0x418adb['query'][_0xf6fc('0x3f')]);_0x51f8a0[_0xf6fc('0x40')]=qs[_0xf6fc('0x37')](_['pick'](_0x418adb[_0xf6fc('0x35')],_0x69dac0[_0xf6fc('0x37')]));if(_0x418adb[_0xf6fc('0x35')]['filter']){_0x51f8a0[_0xf6fc('0x40')]=_[_0xf6fc('0x43')](_0x51f8a0['where'],{'$or':_['map'](_0x51f8a0[_0xf6fc('0x3b')],function(_0x55b200){var _0x36d4fb={};_0x36d4fb[_0x55b200]={'$like':'%'+_0x418adb[_0xf6fc('0x35')][_0xf6fc('0x42')]+'%'};return _0x36d4fb;})});}_0x51f8a0=_[_0xf6fc('0x43')]({},_0x51f8a0,_0x418adb[_0xf6fc('0x45')]);return _0x162c1c[_0xf6fc('0x58')](_0x51f8a0);}})[_0xf6fc('0x26')](function(_0x4ca195){if(_0x4ca195){_0x3d3682=_0x4ca195[_0xf6fc('0x3c')];if(!_0x418adb['query'][_0xf6fc('0x3d')](_0xf6fc('0x3e'))){_0x51f8a0[_0xf6fc('0x21')]=qs['limit'](_0x418adb[_0xf6fc('0x35')][_0xf6fc('0x21')]);_0x51f8a0[_0xf6fc('0x1e')]=qs[_0xf6fc('0x1e')](_0x418adb[_0xf6fc('0x35')][_0xf6fc('0x1e')]);}return _0x162c1c[_0xf6fc('0x58')](_0x51f8a0);}})[_0xf6fc('0x26')](function(_0x2fe851){if(_0x2fe851){return _0x2fe851?{'count':_0x3d3682,'rows':_0x2fe851}:null;}})[_0xf6fc('0x26')](respondWithResult(_0x503d3e,null))[_0xf6fc('0x48')](handleError(_0x503d3e,null));};exports[_0xf6fc('0x5b')]=function(_0x137e84,_0x3d1141,_0x2e1465){var _0x5a02f5={};var _0x1ba42c={};var _0x590a60;var _0x3e0a51;return db[_0xf6fc('0x30')][_0xf6fc('0x59')]({'where':{'id':_0x137e84[_0xf6fc('0x53')]['id']}})['then'](handleEntityNotFound(_0x3d1141,null))['then'](function(_0x109018){if(_0x109018){_0x590a60=_0x109018;_0x1ba42c[_0xf6fc('0x39')]=_[_0xf6fc('0x36')](db['Condition']['rawAttributes']);_0x1ba42c[_0xf6fc('0x35')]=_[_0xf6fc('0x36')](_0x137e84[_0xf6fc('0x35')]);_0x1ba42c[_0xf6fc('0x37')]=_['intersection'](_0x1ba42c[_0xf6fc('0x39')],_0x1ba42c[_0xf6fc('0x35')]);_0x5a02f5['attributes']=_[_0xf6fc('0x38')](_0x1ba42c[_0xf6fc('0x39')],qs[_0xf6fc('0x3a')](_0x137e84[_0xf6fc('0x35')][_0xf6fc('0x3a')]));_0x5a02f5[_0xf6fc('0x3b')]=_0x5a02f5[_0xf6fc('0x3b')]['length']?_0x5a02f5[_0xf6fc('0x3b')]:_0x1ba42c[_0xf6fc('0x39')];_0x5a02f5[_0xf6fc('0x5a')]=qs[_0xf6fc('0x3f')](_0x137e84['query']['sort']);_0x5a02f5[_0xf6fc('0x40')]=qs[_0xf6fc('0x37')](_[_0xf6fc('0x41')](_0x137e84[_0xf6fc('0x35')],_0x1ba42c[_0xf6fc('0x37')]));if(_0x137e84[_0xf6fc('0x35')]['filter']){_0x5a02f5['where']=_[_0xf6fc('0x43')](_0x5a02f5[_0xf6fc('0x40')],{'$or':_[_0xf6fc('0x2f')](_0x5a02f5[_0xf6fc('0x3b')],function(_0x24bc31){var _0x262a9f={};_0x262a9f[_0x24bc31]={'$like':'%'+_0x137e84[_0xf6fc('0x35')][_0xf6fc('0x42')]+'%'};return _0x262a9f;})});}_0x5a02f5=_['merge']({},_0x5a02f5,_0x137e84[_0xf6fc('0x45')]);return _0x590a60[_0xf6fc('0x5b')](_0x5a02f5);}})[_0xf6fc('0x26')](function(_0x4ccd4f){if(_0x4ccd4f){_0x3e0a51=_0x4ccd4f[_0xf6fc('0x3c')];if(!_0x137e84[_0xf6fc('0x35')][_0xf6fc('0x3d')](_0xf6fc('0x3e'))){_0x5a02f5[_0xf6fc('0x21')]=qs[_0xf6fc('0x21')](_0x137e84['query']['limit']);_0x5a02f5[_0xf6fc('0x1e')]=qs[_0xf6fc('0x1e')](_0x137e84[_0xf6fc('0x35')][_0xf6fc('0x1e')]);}return _0x590a60[_0xf6fc('0x5b')](_0x5a02f5);}})['then'](function(_0x2713b0){if(_0x2713b0){return _0x2713b0?{'count':_0x3e0a51,'rows':_0x2713b0}:null;}})[_0xf6fc('0x26')](respondWithResult(_0x3d1141,null))[_0xf6fc('0x48')](handleError(_0x3d1141,null));};exports[_0xf6fc('0x5c')]=function(_0x35056c,_0x2c695d,_0x15830d){if(_0x35056c[_0xf6fc('0x4c')]['id']){delete _0x35056c['body']['id'];}return db['Trigger'][_0xf6fc('0x4a')]({'where':{'id':_0x35056c[_0xf6fc('0x53')]['id']}})['then'](handleEntityNotFound(_0x2c695d,null))[_0xf6fc('0x26')](function(_0x403b8d){if(_0x403b8d){_0x35056c[_0xf6fc('0x4c')][_0xf6fc('0x5d')]=_0x403b8d['id'];return db['Action'][_0xf6fc('0x4b')](_0x35056c['body']);}})[_0xf6fc('0x26')](respondWithResult(_0x2c695d,null))['catch'](handleError(_0x2c695d,null));};exports[_0xf6fc('0x5e')]=function(_0x355cb8,_0x341e09,_0xc3bbc3){var _0x26e5b6={};var _0x3becdc={};var _0x5ba53c;var _0x3d622b;return db[_0xf6fc('0x30')][_0xf6fc('0x59')]({'where':{'id':_0x355cb8['params']['id']}})[_0xf6fc('0x26')](handleEntityNotFound(_0x341e09,null))[_0xf6fc('0x26')](function(_0x5044d3){if(_0x5044d3){_0x5ba53c=_0x5044d3;_0x3becdc['model']=_[_0xf6fc('0x36')](db[_0xf6fc('0x5f')]['rawAttributes']);_0x3becdc['query']=_[_0xf6fc('0x36')](_0x355cb8[_0xf6fc('0x35')]);_0x3becdc[_0xf6fc('0x37')]=_[_0xf6fc('0x38')](_0x3becdc[_0xf6fc('0x39')],_0x3becdc[_0xf6fc('0x35')]);_0x26e5b6[_0xf6fc('0x3b')]=_[_0xf6fc('0x38')](_0x3becdc['model'],qs[_0xf6fc('0x3a')](_0x355cb8[_0xf6fc('0x35')][_0xf6fc('0x3a')]));_0x26e5b6[_0xf6fc('0x3b')]=_0x26e5b6[_0xf6fc('0x3b')][_0xf6fc('0x3c')]?_0x26e5b6['attributes']:_0x3becdc[_0xf6fc('0x39')];_0x26e5b6[_0xf6fc('0x5a')]=qs[_0xf6fc('0x3f')](_0x355cb8[_0xf6fc('0x35')][_0xf6fc('0x3f')]);_0x26e5b6[_0xf6fc('0x40')]=qs[_0xf6fc('0x37')](_[_0xf6fc('0x41')](_0x355cb8['query'],_0x3becdc[_0xf6fc('0x37')]));if(_0x355cb8[_0xf6fc('0x35')][_0xf6fc('0x42')]){_0x26e5b6[_0xf6fc('0x40')]=_[_0xf6fc('0x43')](_0x26e5b6['where'],{'$or':_['map'](_0x26e5b6['attributes'],function(_0x404546){var _0x1dc21d={};_0x1dc21d[_0x404546]={'$like':'%'+_0x355cb8[_0xf6fc('0x35')][_0xf6fc('0x42')]+'%'};return _0x1dc21d;})});}_0x26e5b6=_['merge']({},_0x26e5b6,_0x355cb8[_0xf6fc('0x45')]);return _0x5ba53c[_0xf6fc('0x5e')](_0x26e5b6);}})[_0xf6fc('0x26')](function(_0x7122e3){if(_0x7122e3){_0x3d622b=_0x7122e3[_0xf6fc('0x3c')];if(!_0x355cb8[_0xf6fc('0x35')][_0xf6fc('0x3d')]('nolimit')){_0x26e5b6['limit']=qs['limit'](_0x355cb8[_0xf6fc('0x35')]['limit']);_0x26e5b6['offset']=qs[_0xf6fc('0x1e')](_0x355cb8['query'][_0xf6fc('0x1e')]);}return _0x5ba53c[_0xf6fc('0x5e')](_0x26e5b6);}})[_0xf6fc('0x26')](function(_0x1a0081){if(_0x1a0081){return _0x1a0081?{'count':_0x3d622b,'rows':_0x1a0081}:null;}})[_0xf6fc('0x26')](respondWithResult(_0x341e09,null))[_0xf6fc('0x48')](handleError(_0x341e09,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f2972d3..15fa95e 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 _0x7e16=['api','request-promise','rimraf','../../config/environment','exports','define','Trigger','lodash','util','../../config/logger'];(function(_0x2e4ab8,_0x6e5fcd){var _0x5c65bb=function(_0x8135c7){while(--_0x8135c7){_0x2e4ab8['push'](_0x2e4ab8['shift']());}};_0x5c65bb(++_0x6e5fcd);}(_0x7e16,0x16f));var _0x67e1=function(_0x574e03,_0xe74c4e){_0x574e03=_0x574e03-0x0;var _0x3e9e03=_0x7e16[_0x574e03];return _0x3e9e03;};'use strict';var _=require(_0x67e1('0x0'));var util=require(_0x67e1('0x1'));var logger=require(_0x67e1('0x2'))(_0x67e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67e1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67e1('0x5'));var config=require(_0x67e1('0x6'));var attributes=require('./trigger.attributes');module[_0x67e1('0x7')]=function(_0x3b5769,_0x2e0cb9){return _0x3b5769[_0x67e1('0x8')](_0x67e1('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd8f=['rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3729c,_0x1b1faf){var _0x20ce1f=function(_0x5f323d){while(--_0x5f323d){_0x3729c['push'](_0x3729c['shift']());}};_0x20ce1f(++_0x1b1faf);}(_0xfd8f,0xae));var _0xffd8=function(_0x5b5d65,_0x241252){_0x5b5d65=_0x5b5d65-0x0;var _0x54cb18=_0xfd8f[_0x5b5d65];return _0x54cb18;};'use strict';var _=require(_0xffd8('0x0'));var util=require(_0xffd8('0x1'));var logger=require('../../config/logger')(_0xffd8('0x2'));var moment=require(_0xffd8('0x3'));var BPromise=require(_0xffd8('0x4'));var rp=require(_0xffd8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffd8('0x6'));var config=require(_0xffd8('0x7'));var attributes=require('./trigger.attributes');module[_0xffd8('0x8')]=function(_0x135be6,_0x2ca514){return _0x135be6[_0xffd8('0x9')](_0xffd8('0xa'),attributes,{'tableName':_0xffd8('0xb'),'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 94e4d19..1f2e8ff 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 _0x0814=['map','model','stringify','catch','ShowTrigger','find','raw','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','GetTrigger','Trigger','options','where','attributes','limit','include'];(function(_0x482ddd,_0x3e1bd2){var _0x5c4a0f=function(_0x5c54f2){while(--_0x5c54f2){_0x482ddd['push'](_0x482ddd['shift']());}};_0x5c4a0f(++_0x3e1bd2);}(_0x0814,0x1c7));var _0x4081=function(_0x47b21c,_0x2ee03b){_0x47b21c=_0x47b21c-0x0;var _0x5a564e=_0x0814[_0x47b21c];return _0x5a564e;};'use strict';var _=require(_0x4081('0x0'));var util=require(_0x4081('0x1'));var moment=require(_0x4081('0x2'));var BPromise=require('bluebird');var rs=require(_0x4081('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4081('0x4'));var logger=require(_0x4081('0x5'))('rpc');var config=require(_0x4081('0x6'));var jayson=require(_0x4081('0x7'));var client=jayson['client'][_0x4081('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44409b,_0x4e5fb8,_0x1211f3){return new BPromise(function(_0x2247db,_0x3caade){return client[_0x4081('0x9')](_0x44409b,_0x1211f3)[_0x4081('0xa')](function(_0x1e8f45){logger[_0x4081('0xb')](_0x4081('0xc'),_0x4e5fb8,_0x4081('0xd'));logger[_0x4081('0xe')](_0x4081('0xf'),_0x4e5fb8,_0x4081('0xd'),JSON['stringify'](_0x1e8f45));if(_0x1e8f45[_0x4081('0x10')]){if(_0x1e8f45[_0x4081('0x10')]['code']===0x1f4){logger[_0x4081('0x10')]('Trigger,\x20%s,\x20%s',_0x4e5fb8,_0x1e8f45[_0x4081('0x10')][_0x4081('0x11')]);return _0x3caade(_0x1e8f45[_0x4081('0x10')]['message']);}logger['error'](_0x4081('0xc'),_0x4e5fb8,_0x1e8f45[_0x4081('0x10')][_0x4081('0x11')]);return _0x2247db(_0x1e8f45['error']['message']);}else{logger['info'](_0x4081('0xc'),_0x4e5fb8,_0x4081('0xd'));_0x2247db(_0x1e8f45['result'][_0x4081('0x11')]);}})['catch'](function(_0x5dfa4b){logger[_0x4081('0x10')](_0x4081('0xc'),_0x4e5fb8,_0x5dfa4b);_0x3caade(_0x5dfa4b);});});}exports[_0x4081('0x12')]=function(_0x33e0ee){var _0x2286ef=this;return new Promise(function(_0x22d30d,_0x99dd7b){return db[_0x4081('0x13')]['findAll']({'raw':_0x33e0ee[_0x4081('0x14')]?_0x33e0ee[_0x4081('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x33e0ee['options']?_0x33e0ee['options'][_0x4081('0x15')]||null:null,'attributes':_0x33e0ee[_0x4081('0x14')]?_0x33e0ee[_0x4081('0x14')][_0x4081('0x16')]||null:null,'limit':_0x33e0ee[_0x4081('0x14')]?_0x33e0ee[_0x4081('0x14')][_0x4081('0x17')]||null:null,'include':_0x33e0ee[_0x4081('0x14')]?_0x33e0ee[_0x4081('0x14')][_0x4081('0x18')]?_[_0x4081('0x19')](_0x33e0ee[_0x4081('0x14')][_0x4081('0x18')],function(_0x444fdf){return{'model':db[_0x444fdf[_0x4081('0x1a')]],'as':_0x444fdf['as'],'attributes':_0x444fdf['attributes'],'include':_0x444fdf[_0x4081('0x18')]?_[_0x4081('0x19')](_0x444fdf[_0x4081('0x18')],function(_0xb52a0b){return{'model':db[_0xb52a0b[_0x4081('0x1a')]],'as':_0xb52a0b['as'],'attributes':_0xb52a0b[_0x4081('0x16')],'include':_0xb52a0b[_0x4081('0x18')]?_[_0x4081('0x19')](_0xb52a0b[_0x4081('0x18')],function(_0x539aac){return{'model':db[_0x539aac['model']],'as':_0x539aac['as'],'attributes':_0x539aac[_0x4081('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x464ba8){logger[_0x4081('0xb')](_0x4081('0x12'),_0x33e0ee);logger[_0x4081('0xe')]('GetTrigger',_0x33e0ee,JSON[_0x4081('0x1b')](_0x464ba8));_0x22d30d(_0x464ba8);})[_0x4081('0x1c')](function(_0x413a34){logger[_0x4081('0x10')](_0x4081('0x12'),_0x413a34['message'],_0x33e0ee);_0x99dd7b(_0x2286ef[_0x4081('0x10')](0x1f4,_0x413a34['message']));});});};exports[_0x4081('0x1d')]=function(_0x10d2c0){var _0x7ea2e4=this;return new Promise(function(_0x402c90,_0x524786){return db[_0x4081('0x13')][_0x4081('0x1e')]({'raw':_0x10d2c0[_0x4081('0x14')]?_0x10d2c0[_0x4081('0x14')][_0x4081('0x1f')]===undefined?!![]:![]:!![],'where':_0x10d2c0[_0x4081('0x14')]?_0x10d2c0[_0x4081('0x14')]['where']||null:null,'attributes':_0x10d2c0[_0x4081('0x14')]?_0x10d2c0[_0x4081('0x14')]['attributes']||null:null,'include':_0x10d2c0['options']?_0x10d2c0[_0x4081('0x14')][_0x4081('0x18')]?_['map'](_0x10d2c0['options'][_0x4081('0x18')],function(_0x5bfcaa){return{'model':db[_0x5bfcaa[_0x4081('0x1a')]],'as':_0x5bfcaa['as'],'attributes':_0x5bfcaa[_0x4081('0x16')],'include':_0x5bfcaa[_0x4081('0x18')]?_['map'](_0x5bfcaa[_0x4081('0x18')],function(_0x38a6fb){return{'model':db[_0x38a6fb[_0x4081('0x1a')]],'as':_0x38a6fb['as'],'attributes':_0x38a6fb[_0x4081('0x16')],'include':_0x38a6fb[_0x4081('0x18')]?_[_0x4081('0x19')](_0x38a6fb['include'],function(_0x1d5b80){return{'model':db[_0x1d5b80[_0x4081('0x1a')]],'as':_0x1d5b80['as'],'attributes':_0x1d5b80[_0x4081('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48532c){logger['info'](_0x4081('0x1d'),_0x10d2c0);logger['debug'](_0x4081('0x1d'),_0x10d2c0,JSON[_0x4081('0x1b')](_0x48532c));_0x402c90(_0x48532c);})[_0x4081('0x1c')](function(_0x5aec77){logger[_0x4081('0x10')](_0x4081('0x1d'),_0x5aec77[_0x4081('0x11')],_0x10d2c0);_0x524786(_0x7ea2e4[_0x4081('0x10')](0x1f4,_0x5aec77[_0x4081('0x11')]));});});}; \ No newline at end of file +var _0xf889=['error','code','Trigger,\x20%s,\x20%s','message','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','debug','catch','ShowTrigger','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x51f1bc,_0x2f050c){var _0x47bc84=function(_0x3c4c2c){while(--_0x3c4c2c){_0x51f1bc['push'](_0x51f1bc['shift']());}};_0x47bc84(++_0x2f050c);}(_0xf889,0x19f));var _0x9f88=function(_0x1a6bf7,_0x175a0b){_0x1a6bf7=_0x1a6bf7-0x0;var _0x205614=_0xf889[_0x1a6bf7];return _0x205614;};'use strict';var _=require(_0x9f88('0x0'));var util=require('util');var moment=require(_0x9f88('0x1'));var BPromise=require(_0x9f88('0x2'));var rs=require(_0x9f88('0x3'));var fs=require('fs');var Redis=require(_0x9f88('0x4'));var db=require(_0x9f88('0x5'))['db'];var utils=require(_0x9f88('0x6'));var logger=require(_0x9f88('0x7'))(_0x9f88('0x8'));var config=require(_0x9f88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9f88('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xee4077,_0x5fa9cb,_0x1b6c39){return new BPromise(function(_0x44c4ad,_0x49cf07){return client[_0x9f88('0xb')](_0xee4077,_0x1b6c39)[_0x9f88('0xc')](function(_0x48e8b5){logger[_0x9f88('0xd')]('Trigger,\x20%s,\x20%s',_0x5fa9cb,_0x9f88('0xe'));logger['debug'](_0x9f88('0xf'),_0x5fa9cb,'request\x20sent',JSON[_0x9f88('0x10')](_0x48e8b5));if(_0x48e8b5[_0x9f88('0x11')]){if(_0x48e8b5['error'][_0x9f88('0x12')]===0x1f4){logger[_0x9f88('0x11')](_0x9f88('0x13'),_0x5fa9cb,_0x48e8b5[_0x9f88('0x11')]['message']);return _0x49cf07(_0x48e8b5['error'][_0x9f88('0x14')]);}logger[_0x9f88('0x11')](_0x9f88('0x13'),_0x5fa9cb,_0x48e8b5[_0x9f88('0x11')][_0x9f88('0x14')]);return _0x44c4ad(_0x48e8b5['error'][_0x9f88('0x14')]);}else{logger[_0x9f88('0xd')](_0x9f88('0x13'),_0x5fa9cb,_0x9f88('0xe'));_0x44c4ad(_0x48e8b5['result']['message']);}})['catch'](function(_0x32ad49){logger[_0x9f88('0x11')](_0x9f88('0x13'),_0x5fa9cb,_0x32ad49);_0x49cf07(_0x32ad49);});});}exports['GetTrigger']=function(_0x550a90){var _0x36effb=this;return new Promise(function(_0x19fb7a,_0x147cd8){return db[_0x9f88('0x15')][_0x9f88('0x16')]({'raw':_0x550a90['options']?_0x550a90[_0x9f88('0x17')][_0x9f88('0x18')]===undefined?!![]:![]:!![],'where':_0x550a90[_0x9f88('0x17')]?_0x550a90[_0x9f88('0x17')][_0x9f88('0x19')]||null:null,'attributes':_0x550a90['options']?_0x550a90['options'][_0x9f88('0x1a')]||null:null,'limit':_0x550a90[_0x9f88('0x17')]?_0x550a90[_0x9f88('0x17')][_0x9f88('0x1b')]||null:null,'include':_0x550a90['options']?_0x550a90[_0x9f88('0x17')][_0x9f88('0x1c')]?_[_0x9f88('0x1d')](_0x550a90[_0x9f88('0x17')][_0x9f88('0x1c')],function(_0x29f0bd){return{'model':db[_0x29f0bd['model']],'as':_0x29f0bd['as'],'attributes':_0x29f0bd[_0x9f88('0x1a')],'include':_0x29f0bd['include']?_[_0x9f88('0x1d')](_0x29f0bd['include'],function(_0xc82d39){return{'model':db[_0xc82d39[_0x9f88('0x1e')]],'as':_0xc82d39['as'],'attributes':_0xc82d39[_0x9f88('0x1a')],'include':_0xc82d39['include']?_[_0x9f88('0x1d')](_0xc82d39[_0x9f88('0x1c')],function(_0x5a3039){return{'model':db[_0x5a3039['model']],'as':_0x5a3039['as'],'attributes':_0x5a3039[_0x9f88('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9f88('0xc')](function(_0x58e3bd){logger['info'](_0x9f88('0x1f'),_0x550a90);logger[_0x9f88('0x20')](_0x9f88('0x1f'),_0x550a90,JSON[_0x9f88('0x10')](_0x58e3bd));_0x19fb7a(_0x58e3bd);})[_0x9f88('0x21')](function(_0x2652f2){logger[_0x9f88('0x11')](_0x9f88('0x1f'),_0x2652f2[_0x9f88('0x14')],_0x550a90);_0x147cd8(_0x36effb[_0x9f88('0x11')](0x1f4,_0x2652f2['message']));});});};exports[_0x9f88('0x22')]=function(_0x17e99c){var _0x5a142c=this;return new Promise(function(_0x2a08ee,_0x4fad9f){return db[_0x9f88('0x15')][_0x9f88('0x23')]({'raw':_0x17e99c['options']?_0x17e99c[_0x9f88('0x17')][_0x9f88('0x18')]===undefined?!![]:![]:!![],'where':_0x17e99c[_0x9f88('0x17')]?_0x17e99c[_0x9f88('0x17')][_0x9f88('0x19')]||null:null,'attributes':_0x17e99c[_0x9f88('0x17')]?_0x17e99c[_0x9f88('0x17')][_0x9f88('0x1a')]||null:null,'include':_0x17e99c[_0x9f88('0x17')]?_0x17e99c[_0x9f88('0x17')][_0x9f88('0x1c')]?_[_0x9f88('0x1d')](_0x17e99c[_0x9f88('0x17')]['include'],function(_0x2f27ae){return{'model':db[_0x2f27ae[_0x9f88('0x1e')]],'as':_0x2f27ae['as'],'attributes':_0x2f27ae[_0x9f88('0x1a')],'include':_0x2f27ae[_0x9f88('0x1c')]?_[_0x9f88('0x1d')](_0x2f27ae[_0x9f88('0x1c')],function(_0xe52eb6){return{'model':db[_0xe52eb6[_0x9f88('0x1e')]],'as':_0xe52eb6['as'],'attributes':_0xe52eb6[_0x9f88('0x1a')],'include':_0xe52eb6['include']?_['map'](_0xe52eb6['include'],function(_0x5171be){return{'model':db[_0x5171be[_0x9f88('0x1e')]],'as':_0x5171be['as'],'attributes':_0x5171be[_0x9f88('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9f88('0xc')](function(_0x5a815c){logger[_0x9f88('0xd')]('ShowTrigger',_0x17e99c);logger[_0x9f88('0x20')]('ShowTrigger',_0x17e99c,JSON[_0x9f88('0x10')](_0x5a815c));_0x2a08ee(_0x5a815c);})['catch'](function(_0x41b5f5){logger[_0x9f88('0x11')](_0x9f88('0x22'),_0x41b5f5['message'],_0x17e99c);_0x4fad9f(_0x5a142c[_0x9f88('0x11')](0x1f4,_0x41b5f5[_0x9f88('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 540fc18..caf645d 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 _0x4810=['/:id','post','/:id/clone','clone','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','get'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4810,0x1ca));var _0x0481=function(_0x46a2c0,_0x38e4a3){_0x46a2c0=_0x46a2c0-0x0;var _0x1d3fd7=_0x4810[_0x46a2c0];return _0x1d3fd7;};'use strict';var multer=require(_0x0481('0x0'));var util=require(_0x0481('0x1'));var path=require(_0x0481('0x2'));var timeout=require(_0x0481('0x3'));var express=require(_0x0481('0x4'));var router=express[_0x0481('0x5')]();var fs_extra=require(_0x0481('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0481('0x7'));var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth[_0x0481('0x8')](),controller['index']);router[_0x0481('0x9')](_0x0481('0xa'),auth[_0x0481('0x8')](),controller['show']);router[_0x0481('0xb')](_0x0481('0xc'),auth[_0x0481('0x8')](),controller[_0x0481('0xd')]);router[_0x0481('0xb')]('/',auth['isAuthenticated'](),controller[_0x0481('0xe')]);router['put'](_0x0481('0xa'),auth[_0x0481('0x8')](),controller[_0x0481('0xf')]);router[_0x0481('0x10')](_0x0481('0xa'),auth[_0x0481('0x8')](),controller['destroy']);module[_0x0481('0x11')]=router; \ No newline at end of file +var _0xfffc=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','/:id/clone','clone','post','create','put','update','delete'];(function(_0x3227c2,_0x22390f){var _0x1dc977=function(_0x34c591){while(--_0x34c591){_0x3227c2['push'](_0x3227c2['shift']());}};_0x1dc977(++_0x22390f);}(_0xfffc,0xd1));var _0xcfff=function(_0x2257dd,_0x5d3950){_0x2257dd=_0x2257dd-0x0;var _0x1fae7f=_0xfffc[_0x2257dd];return _0x1fae7f;};'use strict';var multer=require(_0xcfff('0x0'));var util=require(_0xcfff('0x1'));var path=require(_0xcfff('0x2'));var timeout=require(_0xcfff('0x3'));var express=require(_0xcfff('0x4'));var router=express[_0xcfff('0x5')]();var fs_extra=require(_0xcfff('0x6'));var auth=require(_0xcfff('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcfff('0x8'));var controller=require(_0xcfff('0x9'));router[_0xcfff('0xa')]('/',auth[_0xcfff('0xb')](),controller['index']);router[_0xcfff('0xa')](_0xcfff('0xc'),auth[_0xcfff('0xb')](),controller[_0xcfff('0xd')]);router['post'](_0xcfff('0xe'),auth[_0xcfff('0xb')](),controller[_0xcfff('0xf')]);router[_0xcfff('0x10')]('/',auth['isAuthenticated'](),controller[_0xcfff('0x11')]);router[_0xcfff('0x12')](_0xcfff('0xc'),auth[_0xcfff('0xb')](),controller[_0xcfff('0x13')]);router[_0xcfff('0x14')]('/:id',auth[_0xcfff('0xb')](),controller[_0xcfff('0x15')]);module[_0xcfff('0x16')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3c0817c..fe6dbd4 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 _0xbb06=['active','actpass','dynamic','update,nonat','BOOLEAN','exports','name','friend','user','peer','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','STRING','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','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\x22alaw\x22]','port,invite','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','uas','pai','fingerprint','certificate'];(function(_0x4286b7,_0x2fdb8e){var _0x597fd1=function(_0x220ea3){while(--_0x220ea3){_0x4286b7['push'](_0x4286b7['shift']());}};_0x597fd1(++_0x2fdb8e);}(_0xbb06,0x1a3));var _0x6bb0=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0xbb06[_0x26da89];return _0xc95b7b;};'use strict';var Sequelize=require('sequelize');module[_0x6bb0('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6bb0('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x6bb0('0x2'),_0x6bb0('0x3'),_0x6bb0('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x6bb0('0x5')]('ALLOWED_NOT_SCREENED',_0x6bb0('0x6'),'ALLOWED_FAILED_SCREEN',_0x6bb0('0x7'),_0x6bb0('0x8'),_0x6bb0('0x9'),'PROHIB_FAILED_SCREEN',_0x6bb0('0xa'))},'deny':{'type':Sequelize[_0x6bb0('0xb')]},'permit':{'type':Sequelize[_0x6bb0('0xb')]},'secret':{'type':Sequelize[_0x6bb0('0xb')]},'md5secret':{'type':Sequelize[_0x6bb0('0xb')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x496354){this[_0x6bb0('0xc')](_0x6bb0('0xd'),_0x496354?_0x496354[_0x6bb0('0xe')](','):null);},'get':function(){return this[_0x6bb0('0xf')](_0x6bb0('0xd'))?this[_0x6bb0('0xf')](_0x6bb0('0xd'))[_0x6bb0('0x10')](','):null;},'comment':_0x6bb0('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x6bb0('0x12'),'info',_0x6bb0('0x13'),'inband',_0x6bb0('0x14')),'defaultValue':_0x6bb0('0x12')},'directmedia':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no',_0x6bb0('0x16'),_0x6bb0('0x17'),_0x6bb0('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x6bb0('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x6bb0('0xb')],'defaultValue':_0x6bb0('0x19'),'set':function(_0x57068e){this[_0x6bb0('0xc')](_0x6bb0('0x1a'),_0x57068e?_0x57068e['join'](','):null);},'get':function(){return this[_0x6bb0('0xf')]('nat')?this[_0x6bb0('0xf')]('nat')[_0x6bb0('0x10')](','):null;},'comment':_0x6bb0('0x1b')},'callgroup':{'type':Sequelize[_0x6bb0('0xb')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x6bb0('0xb')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6bb0('0xb')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6bb0('0xb')],'defaultValue':_0x6bb0('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6bb0('0x1d'),'set':function(_0x4ddb39){this[_0x6bb0('0xc')](_0x6bb0('0x1e'),_0x4ddb39?_0x4ddb39['join'](';'):_0x6bb0('0x1d'));},'get':function(){return this[_0x6bb0('0xf')]('allow')?this[_0x6bb0('0xf')]('allow')[_0x6bb0('0x10')](';'):null;},'comment':_0x6bb0('0x1f')},'autoframing':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no')},'insecure':{'type':Sequelize[_0x6bb0('0xb')],'defaultValue':_0x6bb0('0x20'),'set':function(_0x2972de){this[_0x6bb0('0xc')]('insecure',_0x2972de?_0x2972de['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x6bb0('0xf')]('insecure')[_0x6bb0('0x10')](','):null;},'comment':_0x6bb0('0x21')},'trustrpid':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x6bb0('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6bb0('0x5')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x6bb0('0x5')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x6bb0('0x15'),'no')},'accountcode':{'type':Sequelize[_0x6bb0('0x22')](0xb)},'setvar':{'type':Sequelize[_0x6bb0('0xb')]},'callerid':{'type':Sequelize[_0x6bb0('0xb')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no'),'defaultValue':_0x6bb0('0x15')},'busylevel':{'type':Sequelize[_0x6bb0('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x6bb0('0x5')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x6bb0('0x5')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x6bb0('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x6bb0('0xb')]},'template':{'type':Sequelize[_0x6bb0('0xb')]},'videosupport':{'type':Sequelize[_0x6bb0('0x5')]('yes','no',_0x6bb0('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6bb0('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no')},'mailbox':{'type':Sequelize[_0x6bb0('0xb')]},'session_timers':{'type':Sequelize['ENUM'](_0x6bb0('0x24'),'refuse','originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x6bb0('0x5')]('uac','uas'),'defaultValue':_0x6bb0('0x25')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x6bb0('0xb')]},'fromdomain':{'type':Sequelize[_0x6bb0('0xb')]},'fromuser':{'type':Sequelize[_0x6bb0('0xb')]},'port':{'type':Sequelize[_0x6bb0('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x6bb0('0x15')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x6bb0('0xb')]},'rtptimeout':{'type':Sequelize[_0x6bb0('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6bb0('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no',_0x6bb0('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x6bb0('0x22')](0xb)},'timerb':{'type':Sequelize[_0x6bb0('0x22')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x6bb0('0xb')]},'unsolicited_mailbox':{'type':Sequelize[_0x6bb0('0xb')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x6bb0('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6bb0('0x5')]('yes','no')},'force_avp':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no')},'icesupport':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x6bb0('0x5')]('yes','no',_0x6bb0('0x27'),_0x6bb0('0x28'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x6bb0('0xb')]},'dtlsprivatekey':{'type':Sequelize[_0x6bb0('0xb')]},'dtlscipher':{'type':Sequelize[_0x6bb0('0xb')]},'dtlscafile':{'type':Sequelize[_0x6bb0('0xb')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x6bb0('0x29'),'passive',_0x6bb0('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6bb0('0xb')]},'recordofffeature':{'type':Sequelize[_0x6bb0('0xb')]},'call_limit':{'type':Sequelize[_0x6bb0('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6bb0('0x5')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x6bb0('0x5')](_0x6bb0('0x15'),'no')},'vmexten':{'type':Sequelize[_0x6bb0('0xb')]},'mohinterpret':{'type':Sequelize[_0x6bb0('0xb')]},'mohsuggest':{'type':Sequelize[_0x6bb0('0xb')]},'parkinglot':{'type':Sequelize[_0x6bb0('0xb')]},'description':{'type':Sequelize[_0x6bb0('0xb')]},'host':{'type':Sequelize[_0x6bb0('0xb')],'defaultValue':_0x6bb0('0x2b')},'canreinvite':{'type':Sequelize[_0x6bb0('0x5')]('yes','no',_0x6bb0('0x16'),'update',_0x6bb0('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6bb0('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6bb0('0xb')],'defaultValue':'no'}}; \ No newline at end of file +var _0x76ca=['shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x32292b,_0x4e9525){var _0x1845b4=function(_0x348377){while(--_0x348377){_0x32292b['push'](_0x32292b['shift']());}};_0x1845b4(++_0x4e9525);}(_0x76ca,0x13a));var _0xa76c=function(_0x5340b4,_0x3ddaa2){_0x5340b4=_0x5340b4-0x0;var _0x3c387a=_0x76ca[_0x5340b4];return _0x3c387a;};'use strict';var Sequelize=require(_0xa76c('0x0'));module[_0xa76c('0x1')]={'name':{'type':Sequelize[_0xa76c('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x4'),_0xa76c('0x5'),_0xa76c('0x6')),'allowNull':![],'defaultValue':_0xa76c('0x4')},'context':{'type':Sequelize[_0xa76c('0x2')],'allowNull':![],'defaultValue':_0xa76c('0x7')},'callingpres':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x8'),_0xa76c('0x9'),'ALLOWED_FAILED_SCREEN',_0xa76c('0xa'),_0xa76c('0xb'),_0xa76c('0xc'),_0xa76c('0xd'),_0xa76c('0xe'))},'deny':{'type':Sequelize[_0xa76c('0x2')]},'permit':{'type':Sequelize[_0xa76c('0x2')]},'secret':{'type':Sequelize[_0xa76c('0x2')]},'md5secret':{'type':Sequelize[_0xa76c('0x2')]},'remotesecret':{'type':Sequelize[_0xa76c('0x2')]},'transport':{'type':Sequelize[_0xa76c('0x2')],'defaultValue':_0xa76c('0xf'),'set':function(_0x4d8cb1){this['setDataValue'](_0xa76c('0x10'),_0x4d8cb1?_0x4d8cb1[_0xa76c('0x11')](','):null);},'get':function(){return this[_0xa76c('0x12')](_0xa76c('0x10'))?this[_0xa76c('0x12')](_0xa76c('0x10'))['split'](','):null;},'comment':_0xa76c('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xa76c('0x14'),_0xa76c('0x15'),_0xa76c('0x16'),'inband',_0xa76c('0x17')),'defaultValue':_0xa76c('0x14')},'directmedia':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no',_0xa76c('0x19'),_0xa76c('0x1a'),_0xa76c('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xa76c('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa76c('0x2')]},'directmediadeny':{'type':Sequelize[_0xa76c('0x2')]},'nat':{'type':Sequelize[_0xa76c('0x2')],'defaultValue':_0xa76c('0x1c'),'set':function(_0x5486e0){this['setDataValue']('nat',_0x5486e0?_0x5486e0[_0xa76c('0x11')](','):null);},'get':function(){return this[_0xa76c('0x12')](_0xa76c('0x1d'))?this[_0xa76c('0x12')]('nat')[_0xa76c('0x1e')](','):null;},'comment':_0xa76c('0x1f')},'callgroup':{'type':Sequelize[_0xa76c('0x2')]},'namedcallgroup':{'type':Sequelize[_0xa76c('0x2')]},'pickupgroup':{'type':Sequelize[_0xa76c('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xa76c('0x2')]},'language':{'type':Sequelize[_0xa76c('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa76c('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa76c('0x2')],'defaultValue':_0xa76c('0x20')},'allow':{'type':Sequelize[_0xa76c('0x2')],'allowNull':![],'defaultValue':_0xa76c('0x21'),'set':function(_0x4c8bf7){this[_0xa76c('0x22')](_0xa76c('0x23'),_0x4c8bf7?_0x4c8bf7['join'](';'):_0xa76c('0x21'));},'get':function(){return this['getDataValue'](_0xa76c('0x23'))?this['getDataValue'](_0xa76c('0x23'))[_0xa76c('0x1e')](';'):null;},'comment':_0xa76c('0x24')},'autoframing':{'type':Sequelize[_0xa76c('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xa76c('0x25'),'set':function(_0x286e64){this['setDataValue'](_0xa76c('0x26'),_0x286e64?_0x286e64[_0xa76c('0x11')](','):null);},'get':function(){return this[_0xa76c('0x12')]('insecure')?this['getDataValue'](_0xa76c('0x26'))[_0xa76c('0x1e')](','):null;},'comment':_0xa76c('0x27')},'trustrpid':{'type':Sequelize[_0xa76c('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no',_0xa76c('0x28'))},'promiscredir':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xa76c('0x18'),'no')},'accountcode':{'type':Sequelize[_0xa76c('0x29')](0xb)},'setvar':{'type':Sequelize[_0xa76c('0x2')]},'callerid':{'type':Sequelize[_0xa76c('0x2')],'defaultValue':_0xa76c('0x2a')},'amaflags':{'type':Sequelize[_0xa76c('0x2')]},'callcounter':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no'),'defaultValue':_0xa76c('0x18')},'busylevel':{'type':Sequelize[_0xa76c('0x29')](0xb)},'allowoverlap':{'type':Sequelize[_0xa76c('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xa76c('0x2')]},'template':{'type':Sequelize[_0xa76c('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xa76c('0x18'),'no',_0xa76c('0x2b')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa76c('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'mailbox':{'type':Sequelize[_0xa76c('0x2')]},'session_timers':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x2c'),_0xa76c('0x2d'),_0xa76c('0x2e'))},'session_expires':{'type':Sequelize[_0xa76c('0x29')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x2f'),_0xa76c('0x30')),'defaultValue':_0xa76c('0x30')},'t38pt_usertpsource':{'type':Sequelize[_0xa76c('0x2')]},'regexten':{'type':Sequelize[_0xa76c('0x2')]},'fromdomain':{'type':Sequelize[_0xa76c('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa76c('0x29')](0x5)},'qualify':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xa76c('0x29')](0xb)},'defaultip':{'type':Sequelize[_0xa76c('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa76c('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa76c('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xa76c('0x2')]},'timert1':{'type':Sequelize[_0xa76c('0x29')](0xb)},'timerb':{'type':Sequelize[_0xa76c('0x29')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xa76c('0x2')]},'contactdeny':{'type':Sequelize[_0xa76c('0x2')]},'contactacl':{'type':Sequelize[_0xa76c('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xa76c('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xa76c('0x29')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xa76c('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'force_avp':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'icesupport':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xa76c('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xa76c('0x3')]('yes','no',_0xa76c('0x31'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xa76c('0x29')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xa76c('0x2')]},'dtlscipher':{'type':Sequelize[_0xa76c('0x2')]},'dtlscafile':{'type':Sequelize[_0xa76c('0x2')]},'dtlscapath':{'type':Sequelize[_0xa76c('0x2')]},'dtlssetup':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x32'),_0xa76c('0x33'),_0xa76c('0x34')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa76c('0x2')]},'usereqphone':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa76c('0x2')]},'recordofffeature':{'type':Sequelize[_0xa76c('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xa76c('0x3')](_0xa76c('0x18'),'no')},'vmexten':{'type':Sequelize[_0xa76c('0x2')]},'mohinterpret':{'type':Sequelize[_0xa76c('0x2')]},'mohsuggest':{'type':Sequelize[_0xa76c('0x2')]},'parkinglot':{'type':Sequelize[_0xa76c('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xa76c('0x35')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0xa76c('0x19'),_0xa76c('0x1a'),_0xa76c('0x36')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa76c('0x2')]},'otherFields':{'type':Sequelize[_0xa76c('0x2')]},'active':{'type':Sequelize[_0xa76c('0x37')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa76c('0x2')],'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 de88e0f..81ee330 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0xdf5fc5,_0x37255b){var _0x52f5a5=function(_0x5e37aa){while(--_0x5e37aa){_0xdf5fc5['push'](_0xdf5fc5['shift']());}};_0x52f5a5(++_0x37255b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x48b329,_0xa9c97f){_0x48b329=_0x48b329-0x0;var _0x2ac307=_0xe5b3[_0x48b329];return _0x2ac307;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file +var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x50affd,_0xec8936){var _0x3c2503=function(_0x3bfa77){while(--_0x3bfa77){_0x50affd['push'](_0x50affd['shift']());}};_0x3c2503(++_0xec8936);}(_0xbec5,0xe5));var _0x5bec=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0xbec5[_0x55d829];return _0x52163b;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 4d73be5..81d60bb 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 _0xb167=['bluebird','path','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','../../config/logger','api','moment'];(function(_0x3c43f6,_0x429058){var _0x5677a4=function(_0x13b06b){while(--_0x13b06b){_0x3c43f6['push'](_0x3c43f6['shift']());}};_0x5677a4(++_0x429058);}(_0xb167,0x1bf));var _0x7b16=function(_0x42b99f,_0x5aeca4){_0x42b99f=_0x42b99f-0x0;var _0x3d3811=_0xb167[_0x42b99f];return _0x3d3811;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b16('0x0'))(_0x7b16('0x1'));var moment=require(_0x7b16('0x2'));var BPromise=require(_0x7b16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b16('0x4'));var rimraf=require('rimraf');var config=require(_0x7b16('0x5'));var attributes=require(_0x7b16('0x6'));module[_0x7b16('0x7')]=function(_0x3a5a40,_0x158288){return _0x3a5a40['define'](_0x7b16('0x8'),attributes,{'tableName':_0x7b16('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeabe=['Trunk','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xeabe,0x153));var _0xeeab=function(_0x2d9849,_0x53e20e){_0x2d9849=_0x2d9849-0x0;var _0x217c8d=_0xeabe[_0x2d9849];return _0x217c8d;};'use strict';var _=require(_0xeeab('0x0'));var util=require(_0xeeab('0x1'));var logger=require(_0xeeab('0x2'))(_0xeeab('0x3'));var moment=require(_0xeeab('0x4'));var BPromise=require(_0xeeab('0x5'));var rp=require(_0xeeab('0x6'));var fs=require('fs');var path=require(_0xeeab('0x7'));var rimraf=require(_0xeeab('0x8'));var config=require(_0xeeab('0x9'));var attributes=require(_0xeeab('0xa'));module['exports']=function(_0x4c0415,_0x53a746){return _0x4c0415[_0xeeab('0xb')](_0xeeab('0xc'),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 1590065..5061b54 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 _0xaa90=['where','attributes','limit','include','model','map','GetTrunk','catch','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Trunk','findAll','options','raw'];(function(_0x2f0bf1,_0x183ef1){var _0xf1df38=function(_0x56982a){while(--_0x56982a){_0x2f0bf1['push'](_0x2f0bf1['shift']());}};_0xf1df38(++_0x183ef1);}(_0xaa90,0x96));var _0x0aa9=function(_0x37645c,_0x1fee49){_0x37645c=_0x37645c-0x0;var _0x14862a=_0xaa90[_0x37645c];return _0x14862a;};'use strict';var _=require(_0x0aa9('0x0'));var util=require(_0x0aa9('0x1'));var moment=require(_0x0aa9('0x2'));var BPromise=require(_0x0aa9('0x3'));var rs=require(_0x0aa9('0x4'));var fs=require('fs');var Redis=require(_0x0aa9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0aa9('0x6'));var logger=require(_0x0aa9('0x7'))(_0x0aa9('0x8'));var config=require('../../config/environment');var jayson=require(_0x0aa9('0x9'));var client=jayson['client'][_0x0aa9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a657e,_0x53a416,_0x759cb3){return new BPromise(function(_0x3bc052,_0x2d543b){return client['request'](_0x1a657e,_0x759cb3)['then'](function(_0x22cbbb){logger[_0x0aa9('0xb')](_0x0aa9('0xc'),_0x53a416,_0x0aa9('0xd'));logger[_0x0aa9('0xe')](_0x0aa9('0xf'),_0x53a416,_0x0aa9('0xd'),JSON[_0x0aa9('0x10')](_0x22cbbb));if(_0x22cbbb['error']){if(_0x22cbbb[_0x0aa9('0x11')][_0x0aa9('0x12')]===0x1f4){logger[_0x0aa9('0x11')](_0x0aa9('0xc'),_0x53a416,_0x22cbbb[_0x0aa9('0x11')][_0x0aa9('0x13')]);return _0x2d543b(_0x22cbbb[_0x0aa9('0x11')]['message']);}logger[_0x0aa9('0x11')](_0x0aa9('0xc'),_0x53a416,_0x22cbbb['error'][_0x0aa9('0x13')]);return _0x3bc052(_0x22cbbb['error'][_0x0aa9('0x13')]);}else{logger['info'](_0x0aa9('0xc'),_0x53a416,'request\x20sent');_0x3bc052(_0x22cbbb[_0x0aa9('0x14')][_0x0aa9('0x13')]);}})['catch'](function(_0x34dc6a){logger['error'](_0x0aa9('0xc'),_0x53a416,_0x34dc6a);_0x2d543b(_0x34dc6a);});});}exports['GetTrunk']=function(_0x17a140){var _0x5d9a82=this;return new Promise(function(_0x1fc321,_0x51d386){return db[_0x0aa9('0x15')][_0x0aa9('0x16')]({'raw':_0x17a140[_0x0aa9('0x17')]?_0x17a140[_0x0aa9('0x17')][_0x0aa9('0x18')]===undefined?!![]:![]:!![],'where':_0x17a140[_0x0aa9('0x17')]?_0x17a140[_0x0aa9('0x17')][_0x0aa9('0x19')]||null:null,'attributes':_0x17a140[_0x0aa9('0x17')]?_0x17a140[_0x0aa9('0x17')][_0x0aa9('0x1a')]||null:null,'limit':_0x17a140[_0x0aa9('0x17')]?_0x17a140[_0x0aa9('0x17')][_0x0aa9('0x1b')]||null:null,'include':_0x17a140[_0x0aa9('0x17')]?_0x17a140['options'][_0x0aa9('0x1c')]?_['map'](_0x17a140['options']['include'],function(_0x3dab14){return{'model':db[_0x3dab14[_0x0aa9('0x1d')]],'as':_0x3dab14['as'],'attributes':_0x3dab14[_0x0aa9('0x1a')],'include':_0x3dab14[_0x0aa9('0x1c')]?_[_0x0aa9('0x1e')](_0x3dab14[_0x0aa9('0x1c')],function(_0x198950){return{'model':db[_0x198950['model']],'as':_0x198950['as'],'attributes':_0x198950[_0x0aa9('0x1a')],'include':_0x198950[_0x0aa9('0x1c')]?_['map'](_0x198950[_0x0aa9('0x1c')],function(_0x26b93d){return{'model':db[_0x26b93d[_0x0aa9('0x1d')]],'as':_0x26b93d['as'],'attributes':_0x26b93d[_0x0aa9('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d5e1e){logger['info']('GetTrunk',_0x17a140);logger[_0x0aa9('0xe')](_0x0aa9('0x1f'),_0x17a140,JSON[_0x0aa9('0x10')](_0x1d5e1e));_0x1fc321(_0x1d5e1e);})[_0x0aa9('0x20')](function(_0x287495){logger['error'](_0x0aa9('0x1f'),_0x287495[_0x0aa9('0x13')],_0x17a140);_0x51d386(_0x5d9a82[_0x0aa9('0x11')](0x1f4,_0x287495[_0x0aa9('0x13')]));});});};exports[_0x0aa9('0x21')]=function(_0x59e728){var _0x3b3f23=this;return new Promise(function(_0x3c41bc,_0x1a9b1a){return db[_0x0aa9('0x15')][_0x0aa9('0x22')]({'raw':_0x59e728[_0x0aa9('0x17')]?_0x59e728[_0x0aa9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x59e728['options']?_0x59e728['options'][_0x0aa9('0x19')]||null:null,'attributes':_0x59e728[_0x0aa9('0x17')]?_0x59e728[_0x0aa9('0x17')][_0x0aa9('0x1a')]||null:null,'include':_0x59e728[_0x0aa9('0x17')]?_0x59e728[_0x0aa9('0x17')][_0x0aa9('0x1c')]?_[_0x0aa9('0x1e')](_0x59e728[_0x0aa9('0x17')][_0x0aa9('0x1c')],function(_0x27c424){return{'model':db[_0x27c424['model']],'as':_0x27c424['as'],'attributes':_0x27c424[_0x0aa9('0x1a')],'include':_0x27c424[_0x0aa9('0x1c')]?_[_0x0aa9('0x1e')](_0x27c424[_0x0aa9('0x1c')],function(_0x242ba7){return{'model':db[_0x242ba7[_0x0aa9('0x1d')]],'as':_0x242ba7['as'],'attributes':_0x242ba7['attributes'],'include':_0x242ba7[_0x0aa9('0x1c')]?_[_0x0aa9('0x1e')](_0x242ba7['include'],function(_0x24ed86){return{'model':db[_0x24ed86[_0x0aa9('0x1d')]],'as':_0x24ed86['as'],'attributes':_0x24ed86[_0x0aa9('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3702ad){logger[_0x0aa9('0xb')](_0x0aa9('0x21'),_0x59e728);logger[_0x0aa9('0xe')](_0x0aa9('0x21'),_0x59e728,JSON['stringify'](_0x3702ad));_0x3c41bc(_0x3702ad);})['catch'](function(_0x54fd06){logger[_0x0aa9('0x11')]('ShowTrunk',_0x54fd06[_0x0aa9('0x13')],_0x59e728);_0x1a9b1a(_0x3b3f23['error'](0x1f4,_0x54fd06[_0x0aa9('0x13')]));});});}; \ No newline at end of file +var _0xf327=['catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','ShowTrunk','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','stringify','code','error','message','Trunk,\x20%s,\x20%s','result'];(function(_0x37c647,_0x4c061a){var _0x3ab2cb=function(_0x47ef31){while(--_0x47ef31){_0x37c647['push'](_0x37c647['shift']());}};_0x3ab2cb(++_0x4c061a);}(_0xf327,0x136));var _0x7f32=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf327[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7f32('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7f32('0x1'));var rs=require(_0x7f32('0x2'));var fs=require('fs');var Redis=require(_0x7f32('0x3'));var db=require(_0x7f32('0x4'))['db'];var utils=require(_0x7f32('0x5'));var logger=require(_0x7f32('0x6'))(_0x7f32('0x7'));var config=require(_0x7f32('0x8'));var jayson=require(_0x7f32('0x9'));var client=jayson[_0x7f32('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3da5d1,_0x42d365,_0x1955f9){return new BPromise(function(_0x57e93d,_0xdf8645){return client[_0x7f32('0xb')](_0x3da5d1,_0x1955f9)[_0x7f32('0xc')](function(_0x438696){logger[_0x7f32('0xd')]('Trunk,\x20%s,\x20%s',_0x42d365,'request\x20sent');logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x42d365,'request\x20sent',JSON[_0x7f32('0xe')](_0x438696));if(_0x438696['error']){if(_0x438696['error'][_0x7f32('0xf')]===0x1f4){logger[_0x7f32('0x10')]('Trunk,\x20%s,\x20%s',_0x42d365,_0x438696[_0x7f32('0x10')][_0x7f32('0x11')]);return _0xdf8645(_0x438696[_0x7f32('0x10')][_0x7f32('0x11')]);}logger['error'](_0x7f32('0x12'),_0x42d365,_0x438696[_0x7f32('0x10')][_0x7f32('0x11')]);return _0x57e93d(_0x438696[_0x7f32('0x10')][_0x7f32('0x11')]);}else{logger[_0x7f32('0xd')](_0x7f32('0x12'),_0x42d365,'request\x20sent');_0x57e93d(_0x438696[_0x7f32('0x13')][_0x7f32('0x11')]);}})[_0x7f32('0x14')](function(_0x585e40){logger['error']('Trunk,\x20%s,\x20%s',_0x42d365,_0x585e40);_0xdf8645(_0x585e40);});});}exports[_0x7f32('0x15')]=function(_0x40575c){var _0x15dfd5=this;return new Promise(function(_0x526682,_0x300402){return db[_0x7f32('0x16')][_0x7f32('0x17')]({'raw':_0x40575c[_0x7f32('0x18')]?_0x40575c[_0x7f32('0x18')][_0x7f32('0x19')]===undefined?!![]:![]:!![],'where':_0x40575c[_0x7f32('0x18')]?_0x40575c[_0x7f32('0x18')][_0x7f32('0x1a')]||null:null,'attributes':_0x40575c[_0x7f32('0x18')]?_0x40575c['options'][_0x7f32('0x1b')]||null:null,'limit':_0x40575c[_0x7f32('0x18')]?_0x40575c[_0x7f32('0x18')]['limit']||null:null,'include':_0x40575c['options']?_0x40575c[_0x7f32('0x18')][_0x7f32('0x1c')]?_[_0x7f32('0x1d')](_0x40575c[_0x7f32('0x18')][_0x7f32('0x1c')],function(_0x5a5bda){return{'model':db[_0x5a5bda[_0x7f32('0x1e')]],'as':_0x5a5bda['as'],'attributes':_0x5a5bda[_0x7f32('0x1b')],'include':_0x5a5bda[_0x7f32('0x1c')]?_[_0x7f32('0x1d')](_0x5a5bda[_0x7f32('0x1c')],function(_0x4707ca){return{'model':db[_0x4707ca['model']],'as':_0x4707ca['as'],'attributes':_0x4707ca['attributes'],'include':_0x4707ca[_0x7f32('0x1c')]?_[_0x7f32('0x1d')](_0x4707ca[_0x7f32('0x1c')],function(_0x5873b4){return{'model':db[_0x5873b4['model']],'as':_0x5873b4['as'],'attributes':_0x5873b4[_0x7f32('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7f32('0xc')](function(_0x555e28){logger[_0x7f32('0xd')](_0x7f32('0x15'),_0x40575c);logger['debug']('GetTrunk',_0x40575c,JSON['stringify'](_0x555e28));_0x526682(_0x555e28);})[_0x7f32('0x14')](function(_0x3f8e27){logger[_0x7f32('0x10')](_0x7f32('0x15'),_0x3f8e27[_0x7f32('0x11')],_0x40575c);_0x300402(_0x15dfd5[_0x7f32('0x10')](0x1f4,_0x3f8e27[_0x7f32('0x11')]));});});};exports['ShowTrunk']=function(_0x468d65){var _0x526abe=this;return new Promise(function(_0x2a0b82,_0x52ead5){return db[_0x7f32('0x16')]['find']({'raw':_0x468d65[_0x7f32('0x18')]?_0x468d65[_0x7f32('0x18')][_0x7f32('0x19')]===undefined?!![]:![]:!![],'where':_0x468d65[_0x7f32('0x18')]?_0x468d65['options']['where']||null:null,'attributes':_0x468d65[_0x7f32('0x18')]?_0x468d65[_0x7f32('0x18')]['attributes']||null:null,'include':_0x468d65[_0x7f32('0x18')]?_0x468d65[_0x7f32('0x18')][_0x7f32('0x1c')]?_['map'](_0x468d65[_0x7f32('0x18')][_0x7f32('0x1c')],function(_0x43c2bd){return{'model':db[_0x43c2bd['model']],'as':_0x43c2bd['as'],'attributes':_0x43c2bd[_0x7f32('0x1b')],'include':_0x43c2bd[_0x7f32('0x1c')]?_[_0x7f32('0x1d')](_0x43c2bd[_0x7f32('0x1c')],function(_0x97a9fd){return{'model':db[_0x97a9fd[_0x7f32('0x1e')]],'as':_0x97a9fd['as'],'attributes':_0x97a9fd['attributes'],'include':_0x97a9fd[_0x7f32('0x1c')]?_[_0x7f32('0x1d')](_0x97a9fd['include'],function(_0x53e5d0){return{'model':db[_0x53e5d0[_0x7f32('0x1e')]],'as':_0x53e5d0['as'],'attributes':_0x53e5d0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48fb69){logger[_0x7f32('0xd')](_0x7f32('0x1f'),_0x468d65);logger[_0x7f32('0x20')](_0x7f32('0x1f'),_0x468d65,JSON[_0x7f32('0xe')](_0x48fb69));_0x2a0b82(_0x48fb69);})[_0x7f32('0x14')](function(_0x446f47){logger[_0x7f32('0x10')](_0x7f32('0x1f'),_0x446f47['message'],_0x468d65);_0x52ead5(_0x526abe[_0x7f32('0x10')](0x1f4,_0x446f47[_0x7f32('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 0d0b944..bfd5f3c 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 _0x72ff=['getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','root','%s-%s','now','originalname','/:id/avatar','file','addAvatar','/:id/login','login','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/square_projects','getSquareProjects'];(function(_0x1756f3,_0x60f2ce){var _0x2795f1=function(_0x1dbd52){while(--_0x1dbd52){_0x1756f3['push'](_0x1756f3['shift']());}};_0x2795f1(++_0x60f2ce);}(_0x72ff,0xb4));var _0xf72f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x72ff[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xf72f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf72f('0x1'));var express=require(_0xf72f('0x2'));var router=express['Router']();var fs_extra=require(_0xf72f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf72f('0x4'));var config=require('../../config/environment');var controller=require(_0xf72f('0x5'));router[_0xf72f('0x6')]('/',auth[_0xf72f('0x7')](),controller[_0xf72f('0x8')]);router['get'](_0xf72f('0x9'),auth['isAuthenticated'](),controller[_0xf72f('0xa')]);router[_0xf72f('0x6')](_0xf72f('0xb'),auth['isAuthenticated'](),controller[_0xf72f('0xc')]);router[_0xf72f('0x6')](_0xf72f('0xd'),auth[_0xf72f('0x7')](),controller[_0xf72f('0xe')]);router[_0xf72f('0x6')](_0xf72f('0xf'),auth['isAuthenticated'](),controller[_0xf72f('0x10')]);router[_0xf72f('0x6')]('/:id/avatar',controller['getAvatar']);router[_0xf72f('0x6')](_0xf72f('0x11'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x12')]);router[_0xf72f('0x6')](_0xf72f('0x13'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x14')]);router[_0xf72f('0x6')](_0xf72f('0x15'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x16')]);router[_0xf72f('0x6')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0xf72f('0x17')]);router[_0xf72f('0x6')](_0xf72f('0x18'),auth['isAuthenticated'](),controller[_0xf72f('0x19')]);router[_0xf72f('0x6')](_0xf72f('0x1a'),auth['isAuthenticated'](),controller[_0xf72f('0x1b')]);router[_0xf72f('0x6')](_0xf72f('0x1c'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x1d')]);router[_0xf72f('0x6')](_0xf72f('0x1e'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x1f')]);router[_0xf72f('0x6')](_0xf72f('0x20'),auth[_0xf72f('0x7')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0xf72f('0x21')]);router['get'](_0xf72f('0x22'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x23')]);router[_0xf72f('0x6')](_0xf72f('0x24'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x25')]);router['get'](_0xf72f('0x26'),auth[_0xf72f('0x7')](),controller['getWhatsappInteractions']);router['get'](_0xf72f('0x27'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x28')]);router[_0xf72f('0x6')](_0xf72f('0x29'),auth[_0xf72f('0x7')](),controller['getLists']);router[_0xf72f('0x6')](_0xf72f('0x2a'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x2b')]);router[_0xf72f('0x6')](_0xf72f('0x2c'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x2d')]);router[_0xf72f('0x6')](_0xf72f('0x2e'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x2f')]);router[_0xf72f('0x6')](_0xf72f('0x30'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x31')]);router[_0xf72f('0x6')](_0xf72f('0x32'),auth['isAuthenticated'](),controller[_0xf72f('0x33')]);router[_0xf72f('0x6')](_0xf72f('0x34'),auth['isAuthenticated'](),controller[_0xf72f('0x35')]);router['get']('/:id/chat_websites',auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xf72f('0x6')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0xf72f('0x6')](_0xf72f('0x36'),auth['isAuthenticated'](),controller[_0xf72f('0x37')]);router[_0xf72f('0x6')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0xf72f('0x38')]);router[_0xf72f('0x6')](_0xf72f('0x39'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x3a')]);router[_0xf72f('0x3b')](_0xf72f('0x13'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x3c')]);router[_0xf72f('0x3b')]('/',auth[_0xf72f('0x7')](),controller[_0xf72f('0x3d')]);router[_0xf72f('0x3b')](_0xf72f('0x3e'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x3f')]);router[_0xf72f('0x3b')](_0xf72f('0x15'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x40')]);var upload=multer({'storage':multer[_0xf72f('0x41')]({'destination':function(_0x1b5b35,_0x331acb,_0x237001){_0x237001(null,path['join'](config[_0xf72f('0x42')],'server/files/images/'));},'filename':function(_0x457f51,_0x8f5efd,_0x848402){_0x848402(null,util['format'](_0xf72f('0x43'),Date[_0xf72f('0x44')](),_0x8f5efd[_0xf72f('0x45')]));}})});router['post'](_0xf72f('0x46'),upload['single'](_0xf72f('0x47')),controller[_0xf72f('0x48')]);router['post'](_0xf72f('0x49'),auth['isAuthenticated'](),controller[_0xf72f('0x4a')]);router[_0xf72f('0x3b')]('/:id/logout',auth[_0xf72f('0x7')](),controller['logout']);router['post'](_0xf72f('0x4b'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x4c')]);router[_0xf72f('0x3b')](_0xf72f('0x4d'),auth['isAuthenticated'](),controller[_0xf72f('0x4e')]);router[_0xf72f('0x3b')](_0xf72f('0x27'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x4f')]);router[_0xf72f('0x3b')](_0xf72f('0x50'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x51')]);router['post'](_0xf72f('0x52'),auth[_0xf72f('0x7')](),controller['addMailInteractions']);router[_0xf72f('0x3b')](_0xf72f('0x53'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0xf72f('0x54'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x55')]);router['post'](_0xf72f('0x56'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x57')]);router[_0xf72f('0x3b')]('/:id/whatsapp_interactions',auth[_0xf72f('0x7')](),controller[_0xf72f('0x58')]);router[_0xf72f('0x3b')](_0xf72f('0x2e'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x59')]);router[_0xf72f('0x3b')](_0xf72f('0x30'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x5a')]);router[_0xf72f('0x3b')](_0xf72f('0x32'),auth['isAuthenticated'](),controller[_0xf72f('0x5b')]);router[_0xf72f('0x3b')](_0xf72f('0x34'),auth['isAuthenticated'](),controller[_0xf72f('0x5c')]);router[_0xf72f('0x3b')](_0xf72f('0x5d'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x5e')]);router[_0xf72f('0x3b')](_0xf72f('0x5f'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x60')]);router[_0xf72f('0x3b')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xf72f('0x61')]);router[_0xf72f('0x3b')](_0xf72f('0x39'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x62')]);router[_0xf72f('0x63')]('/:id',auth['isAuthenticated'](),controller[_0xf72f('0x64')]);router[_0xf72f('0x63')](_0xf72f('0x65'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x66')]);router[_0xf72f('0x67')](_0xf72f('0x15'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x68')]);router[_0xf72f('0x67')](_0xf72f('0x27'),auth[_0xf72f('0x7')](),controller['removeTeams']);router[_0xf72f('0x67')]('/:id',auth[_0xf72f('0x7')](),controller['destroy']);router[_0xf72f('0x67')](_0xf72f('0x50'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x69')]);router[_0xf72f('0x67')]('/:id/mail_interactions',auth[_0xf72f('0x7')](),controller[_0xf72f('0x6a')]);router[_0xf72f('0x67')]('/:id/fax_interactions',auth[_0xf72f('0x7')](),controller[_0xf72f('0x6b')]);router[_0xf72f('0x67')](_0xf72f('0x54'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x6c')]);router[_0xf72f('0x67')](_0xf72f('0x56'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x6d')]);router[_0xf72f('0x67')]('/:id/whatsapp_interactions',auth[_0xf72f('0x7')](),controller[_0xf72f('0x6e')]);router[_0xf72f('0x67')](_0xf72f('0x2e'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xf72f('0x67')](_0xf72f('0x30'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x6f')]);router[_0xf72f('0x67')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xf72f('0x70')]);router[_0xf72f('0x67')](_0xf72f('0x34'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x71')]);router[_0xf72f('0x67')]('/:id/chat_websites',auth[_0xf72f('0x7')](),controller[_0xf72f('0x72')]);router[_0xf72f('0x67')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xf72f('0x73')]);router[_0xf72f('0x67')](_0xf72f('0x36'),auth['isAuthenticated'](),controller[_0xf72f('0x74')]);router['delete'](_0xf72f('0x39'),auth[_0xf72f('0x7')](),controller[_0xf72f('0x75')]);module['exports']=router; \ No newline at end of file +var _0x7a38=['express','Router','fs-extra','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','getAgents','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','/create_many','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path'];(function(_0x458fbd,_0x4feabc){var _0x758791=function(_0x413606){while(--_0x413606){_0x458fbd['push'](_0x458fbd['shift']());}};_0x758791(++_0x4feabc);}(_0x7a38,0x6d));var _0x87a3=function(_0x54bc4d,_0x3df0e9){_0x54bc4d=_0x54bc4d-0x0;var _0x1d41e0=_0x7a38[_0x54bc4d];return _0x1d41e0;};'use strict';var multer=require(_0x87a3('0x0'));var util=require('util');var path=require(_0x87a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x87a3('0x2'));var router=express[_0x87a3('0x3')]();var fs_extra=require(_0x87a3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x87a3('0x5'));var controller=require(_0x87a3('0x6'));router[_0x87a3('0x7')]('/',auth[_0x87a3('0x8')](),controller['index']);router[_0x87a3('0x7')](_0x87a3('0x9'),auth['isAuthenticated'](),controller[_0x87a3('0xa')]);router[_0x87a3('0x7')](_0x87a3('0xb'),auth['isAuthenticated'](),controller[_0x87a3('0xc')]);router[_0x87a3('0x7')](_0x87a3('0xd'),auth[_0x87a3('0x8')](),controller['getPresence']);router[_0x87a3('0x7')](_0x87a3('0xe'),auth[_0x87a3('0x8')](),controller['show']);router[_0x87a3('0x7')](_0x87a3('0xf'),controller['getAvatar']);router[_0x87a3('0x7')](_0x87a3('0x10'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x11')]);router[_0x87a3('0x7')]('/:id/contacts',auth[_0x87a3('0x8')](),controller['getContacts']);router[_0x87a3('0x7')](_0x87a3('0x12'),auth['isAuthenticated'](),controller[_0x87a3('0x13')]);router[_0x87a3('0x7')](_0x87a3('0x14'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x15')]);router[_0x87a3('0x7')](_0x87a3('0x16'),auth['isAuthenticated'](),controller['getGroups']);router[_0x87a3('0x7')]('/:id/recordings',auth[_0x87a3('0x8')](),controller[_0x87a3('0x17')]);router[_0x87a3('0x7')](_0x87a3('0x18'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x19')]);router[_0x87a3('0x7')](_0x87a3('0x1a'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x1b')]);router[_0x87a3('0x7')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x87a3('0x1c')]);router[_0x87a3('0x7')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x87a3('0x1d')]);router[_0x87a3('0x7')](_0x87a3('0x1e'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x1f')]);router[_0x87a3('0x7')](_0x87a3('0x20'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x21')]);router['get'](_0x87a3('0x22'),auth[_0x87a3('0x8')](),controller['getWhatsappInteractions']);router[_0x87a3('0x7')](_0x87a3('0x23'),auth['isAuthenticated'](),controller['getTeams']);router[_0x87a3('0x7')](_0x87a3('0x24'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x25')]);router[_0x87a3('0x7')]('/:id/agents',auth['isAuthenticated'](),controller[_0x87a3('0x26')]);router[_0x87a3('0x7')]('/:id/prefixes',auth[_0x87a3('0x8')](),controller['getVoicePrefixes']);router[_0x87a3('0x7')](_0x87a3('0x27'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x87a3('0x7')](_0x87a3('0x28'),auth['isAuthenticated'](),controller[_0x87a3('0x29')]);router['get']('/:id/openchannel_accounts',auth[_0x87a3('0x8')](),controller[_0x87a3('0x2a')]);router['get']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x87a3('0x2b')]);router[_0x87a3('0x7')](_0x87a3('0x2c'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x87a3('0x7')](_0x87a3('0x2d'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x2e')]);router['get'](_0x87a3('0x2f'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x87a3('0x7')](_0x87a3('0x30'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x87a3('0x7')](_0x87a3('0x31'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x32')]);router[_0x87a3('0x33')](_0x87a3('0x34'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x35')]);router[_0x87a3('0x33')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x87a3('0x36'),auth[_0x87a3('0x8')](),controller['bulkCreate']);router[_0x87a3('0x33')]('/:id/queues',auth[_0x87a3('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0x87a3('0x37')]({'destination':function(_0x4880e3,_0x3eeb6e,_0x497779){_0x497779(null,path[_0x87a3('0x38')](config[_0x87a3('0x39')],_0x87a3('0x3a')));},'filename':function(_0xfbbae8,_0x40b713,_0x5a607f){_0x5a607f(null,util[_0x87a3('0x3b')](_0x87a3('0x3c'),Date[_0x87a3('0x3d')](),_0x40b713[_0x87a3('0x3e')]));}})});router['post']('/:id/avatar',upload[_0x87a3('0x3f')](_0x87a3('0x40')),controller[_0x87a3('0x41')]);router[_0x87a3('0x33')](_0x87a3('0x42'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x43')]);router['post'](_0x87a3('0x44'),auth[_0x87a3('0x8')](),controller['logout']);router[_0x87a3('0x33')](_0x87a3('0x45'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x46')]);router[_0x87a3('0x33')](_0x87a3('0x47'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x48')]);router[_0x87a3('0x33')](_0x87a3('0x23'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x49')]);router[_0x87a3('0x33')]('/:id/chat_interactions',auth[_0x87a3('0x8')](),controller[_0x87a3('0x4a')]);router[_0x87a3('0x33')](_0x87a3('0x4b'),auth[_0x87a3('0x8')](),controller['addMailInteractions']);router['post']('/:id/fax_interactions',auth[_0x87a3('0x8')](),controller[_0x87a3('0x4c')]);router['post'](_0x87a3('0x4d'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x4e')]);router['post'](_0x87a3('0x4f'),auth['isAuthenticated'](),controller[_0x87a3('0x50')]);router[_0x87a3('0x33')](_0x87a3('0x51'),auth[_0x87a3('0x8')](),controller['addWhatsappInteractions']);router['post'](_0x87a3('0x27'),auth[_0x87a3('0x8')](),controller['addFaxAccounts']);router[_0x87a3('0x33')](_0x87a3('0x28'),auth['isAuthenticated'](),controller[_0x87a3('0x52')]);router[_0x87a3('0x33')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x87a3('0x53')]);router[_0x87a3('0x33')]('/:id/sms_accounts',auth[_0x87a3('0x8')](),controller[_0x87a3('0x54')]);router['post'](_0x87a3('0x2c'),auth['isAuthenticated'](),controller[_0x87a3('0x55')]);router[_0x87a3('0x33')]('/:id/whatsapp_accounts',auth[_0x87a3('0x8')](),controller[_0x87a3('0x56')]);router[_0x87a3('0x33')]('/:id/square_projects',auth[_0x87a3('0x8')](),controller[_0x87a3('0x57')]);router[_0x87a3('0x33')](_0x87a3('0x31'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x58')]);router[_0x87a3('0x59')](_0x87a3('0xe'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x5a')]);router['put'](_0x87a3('0x5b'),auth['isAuthenticated'](),controller[_0x87a3('0x5c')]);router[_0x87a3('0x5d')]('/:id/queues',auth[_0x87a3('0x8')](),controller['removeQueues']);router[_0x87a3('0x5d')](_0x87a3('0x23'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x5e')]);router['delete']('/:id',auth[_0x87a3('0x8')](),controller[_0x87a3('0x5f')]);router[_0x87a3('0x5d')](_0x87a3('0x60'),auth['isAuthenticated'](),controller[_0x87a3('0x61')]);router['delete'](_0x87a3('0x4b'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x62')]);router[_0x87a3('0x5d')](_0x87a3('0x63'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x87a3('0x5d')](_0x87a3('0x4d'),auth[_0x87a3('0x8')](),controller['removeSmsInteractions']);router[_0x87a3('0x5d')](_0x87a3('0x4f'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x64')]);router['delete']('/:id/whatsapp_interactions',auth[_0x87a3('0x8')](),controller['removeWhatsappInteractions']);router[_0x87a3('0x5d')]('/:id/fax_accounts',auth[_0x87a3('0x8')](),controller[_0x87a3('0x65')]);router[_0x87a3('0x5d')]('/:id/mail_accounts',auth[_0x87a3('0x8')](),controller[_0x87a3('0x66')]);router[_0x87a3('0x5d')](_0x87a3('0x67'),auth['isAuthenticated'](),controller[_0x87a3('0x68')]);router['delete'](_0x87a3('0x69'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x6a')]);router['delete'](_0x87a3('0x2c'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x87a3('0x5d')](_0x87a3('0x2d'),auth['isAuthenticated'](),controller[_0x87a3('0x6b')]);router['delete'](_0x87a3('0x2f'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x6c')]);router[_0x87a3('0x5d')]('/:id/api_key',auth[_0x87a3('0x8')](),controller[_0x87a3('0x6d')]);module[_0x87a3('0x6e')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 8037145..a41bde0 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 _0x6349=['icesupport','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','wss','force_avp','/etc/pki/tls/certs/motion.crt','TEXT','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','moment','util','exports','STRING','name','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','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','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','originate','uas','certificate','actpass','update,nonat','showWebBar','get','isArray','udp','encryption','avpf'];(function(_0x52f45a,_0x243c97){var _0x486a3c=function(_0x2cc237){while(--_0x2cc237){_0x52f45a['push'](_0x52f45a['shift']());}};_0x486a3c(++_0x243c97);}(_0x6349,0x110));var _0x9634=function(_0x42bb5b,_0x59acee){_0x42bb5b=_0x42bb5b-0x0;var _0x548f31=_0x6349[_0x42bb5b];return _0x548f31;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9634('0x0'));var util=require(_0x9634('0x1'));var _=require('lodash');module[_0x9634('0x2')]={'name':{'type':Sequelize[_0x9634('0x3')],'allowNull':![],'unique':_0x9634('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1ac542){this[_0x9634('0x5')](_0x9634('0x4'),_0x1ac542);this[_0x9634('0x5')]('defaultuser',_0x1ac542);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2a0a35){this[_0x9634('0x5')](_0x9634('0x6'),_0x2a0a35);this['setDataValue'](_0x9634('0x7'),util[_0x9634('0x8')](_0x9634('0x9'),_0x2a0a35,this[_0x9634('0xa')](_0x9634('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9634('0x3')],'allowNull':![],'unique':_0x9634('0xc'),'validate':{'isEmail':!![]},'set':function(_0x2bc8fe){if(_0x2bc8fe){this[_0x9634('0x5')](_0x9634('0xc'),_0x2bc8fe['toLowerCase']());}}},'role':{'type':Sequelize[_0x9634('0xd')]('admin',_0x9634('0xe'),_0x9634('0xf'),_0x9634('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x9634('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':![],'unique':_0x9634('0xb'),'set':function(_0x1fd8da){this['setDataValue'](_0x9634('0xb'),_0x1fd8da);this[_0x9634('0x5')](_0x9634('0x12'),_0x1fd8da);this[_0x9634('0x5')](_0x9634('0x7'),util[_0x9634('0x8')](_0x9634('0x9'),this[_0x9634('0xa')](_0x9634('0x6')),_0x1fd8da));}},'salt':{'type':Sequelize[_0x9634('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x9634('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9634('0x3')]},'country':{'type':Sequelize[_0x9634('0x3')]},'online':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9634('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9634('0x3')],'defaultValue':_0x9634('0x15')},'lastPauseAt':{'type':Sequelize[_0x9634('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9634('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x9634('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x16'),_0x9634('0xe'),_0x9634('0x17')),'allowNull':!![],'defaultValue':_0x9634('0x16')},'context':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![],'defaultValue':_0x9634('0x18')},'callingpres':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x19'),_0x9634('0x1a'),_0x9634('0x1b'),'ALLOWED',_0x9634('0x1c'),_0x9634('0x1d'),_0x9634('0x1e'),_0x9634('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x38bae0){this[_0x9634('0x5')](_0x9634('0x20'),_0x38bae0?_0x38bae0[_0x9634('0x21')](','):null);},'get':function(){return this['getDataValue'](_0x9634('0x20'))?this[_0x9634('0xa')](_0x9634('0x20'))[_0x9634('0x22')](','):null;},'comment':_0x9634('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x9634('0x24'),_0x9634('0x25'),_0x9634('0x26'),_0x9634('0x27'),_0x9634('0x28')),'allowNull':!![],'defaultValue':_0x9634('0x24')},'directmedia':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no',_0x9634('0x2a'),_0x9634('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9634('0x2c'),'set':function(_0x4cb275){this[_0x9634('0x5')](_0x9634('0x2d'),_0x4cb275?_0x4cb275[_0x9634('0x21')](','):null);},'get':function(){return this[_0x9634('0xa')](_0x9634('0x2d'))?this[_0x9634('0xa')](_0x9634('0x2d'))[_0x9634('0x22')](','):null;},'comment':_0x9634('0x2e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x9634('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9634('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9634('0x3')]},'disallow':{'type':Sequelize[_0x9634('0x3')],'allowNull':![],'defaultValue':_0x9634('0x2f')},'allow':{'type':Sequelize[_0x9634('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x16a534){this[_0x9634('0x5')](_0x9634('0x30'),_0x16a534?_0x16a534[_0x9634('0x21')](';'):_0x9634('0x31'));},'get':function(){return this[_0x9634('0xa')](_0x9634('0x30'))?this['getDataValue'](_0x9634('0x30'))['split'](';'):null;},'comment':_0x9634('0x32')},'autoframing':{'type':Sequelize[_0x9634('0xd')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![],'set':function(_0x490a8f){this[_0x9634('0x5')](_0x9634('0x33'),_0x490a8f?_0x490a8f[_0x9634('0x21')](','):null);},'get':function(){return this[_0x9634('0xa')]('insecure')?this[_0x9634('0xa')]('insecure')[_0x9634('0x22')](','):null;},'comment':_0x9634('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x9634('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x9634('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no',_0x9634('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![],'defaultValue':_0x9634('0x36')},'amaflags':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x9634('0x29'),'no'),'allowNull':!![],'defaultValue':_0x9634('0x29')},'busylevel':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9634('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x9634('0x37'),_0x9634('0x38'),_0x9634('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9634('0xd')]('uac',_0x9634('0x3a')),'allowNull':!![],'defaultValue':_0x9634('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9634('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x9634('0x29')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9634('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9634('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9634('0xd')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x9634('0x29'),'no','fingerprint',_0x9634('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9634('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9634('0xd')]('active','passive',_0x9634('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9634('0xd')](_0x9634('0x29'),'no','nonat',_0x9634('0x2b'),_0x9634('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0,'set':function(_0x539b55){this['setDataValue'](_0x9634('0x3e'),_0x539b55);var _0x56b391=this[_0x9634('0x3f')]({'plain':!![]});switch(_0x539b55){case 0x0:case 0x1:var _0x3cff1f=_0x56b391['transport']?_[_0x9634('0x40')](_0x56b391['transport'])?_0x56b391[_0x9634('0x20')][_0x9634('0x21')]():_0x56b391[_0x9634('0x20')]:_0x9634('0x41');if(_0x3cff1f==='wss'){_0x3cff1f=_0x9634('0x41');}this['setDataValue'](_0x9634('0x20'),_0x3cff1f);this[_0x9634('0x5')](_0x9634('0x42'),'no');this[_0x9634('0x5')](_0x9634('0x43'),null);this[_0x9634('0x5')]('force_avp',null);this['setDataValue'](_0x9634('0x44'),null);this['setDataValue']('dtlsenable',null);this['setDataValue'](_0x9634('0x45'),null);this[_0x9634('0x5')](_0x9634('0x46'),null);this['setDataValue'](_0x9634('0x47'),null);this[_0x9634('0x5')]('dtlsprivatekey',null);this[_0x9634('0x5')](_0x9634('0x48'),'no');break;case 0x2:this['setDataValue']('transport',_0x9634('0x49'));this[_0x9634('0x5')](_0x9634('0x42'),_0x9634('0x29'));this['setDataValue'](_0x9634('0x43'),_0x9634('0x29'));this['setDataValue'](_0x9634('0x4a'),_0x9634('0x29'));this[_0x9634('0x5')](_0x9634('0x44'),'yes');this['setDataValue']('dtlsenable',_0x9634('0x29'));this[_0x9634('0x5')](_0x9634('0x45'),'no');this[_0x9634('0x5')](_0x9634('0x46'),'actpass');this[_0x9634('0x5')](_0x9634('0x47'),_0x56b391[_0x9634('0x47')]||_0x9634('0x4b'));this[_0x9634('0x5')]('dtlsprivatekey',_0x56b391['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0x9634('0x5')](_0x9634('0x48'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x9634('0x4c')],'set':function(_0x248f68){this[_0x9634('0x5')]('permissions',_0x248f68?_0x248f68[_0x9634('0x21')](','):[]);},'get':function(){return this[_0x9634('0xa')](_0x9634('0x4d'))?_['map'](this[_0x9634('0xa')](_0x9634('0x4d'))['split'](','),function(_0x5ada6e){return parseInt(_0x5ada6e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9634('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9634('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9634('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9634('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9634('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9634('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9634('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9634('0xa')](_0x9634('0x4e'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9634('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9634('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![],'set':function(_0x3358dc){if(typeof _0x3358dc===_0x9634('0x4f')){var _0x3f5bc7=_0x3358dc==='1'?!![]:_0x3358dc==='0'?![]:_0x3358dc===_0x9634('0x50')?!![]:_0x3358dc===_0x9634('0x51')?![]:![];this[_0x9634('0x5')](_0x9634('0x52'),_0x3f5bc7);}else{this['setDataValue'](_0x9634('0x52'),_0x3358dc);}}},'blocked':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![],'set':function(_0x45b468){this[_0x9634('0x5')]('blocked',_0x45b468);if(_0x45b468===!![]){this[_0x9634('0x5')](_0x9634('0x53'),moment());this['setDataValue'](_0x9634('0x54'),0x0);}else{this[_0x9634('0x5')](_0x9634('0x53'),null);}}},'blockedAt':{'type':Sequelize[_0x9634('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9634('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9634('0x11')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9634('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9634('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9634('0x13')],'defaultValue':![]}}; \ No newline at end of file +var _0x496e=['agent','local','INTEGER','accountcode','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','user','peer','ALLOWED_NOT_SCREENED','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','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','nonat','update,nonat','showWebBar','get','isArray','udp','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','loginAttempts','blockedAt','UNSIGNED','lodash','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','callerid','format','getDataValue','email','toLowerCase','ENUM'];(function(_0x5b802c,_0x59caef){var _0x541fd0=function(_0x44f9c8){while(--_0x44f9c8){_0x5b802c['push'](_0x5b802c['shift']());}};_0x541fd0(++_0x59caef);}(_0x496e,0x155));var _0xe496=function(_0x17aded,_0x3c0771){_0x17aded=_0x17aded-0x0;var _0x43d096=_0x496e[_0x17aded];return _0x43d096;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require('util');var _=require(_0xe496('0x0'));module['exports']={'name':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'unique':_0xe496('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x337c0e){this[_0xe496('0x3')](_0xe496('0x2'),_0x337c0e);this[_0xe496('0x3')]('defaultuser',_0x337c0e);},'comment':_0xe496('0x4')},'fullname':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'set':function(_0xb503f2){this[_0xe496('0x3')]('fullname',_0xb503f2);this[_0xe496('0x3')](_0xe496('0x5'),util[_0xe496('0x6')]('\x22%s\x22\x20<%s>',_0xb503f2,this[_0xe496('0x7')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'unique':_0xe496('0x8'),'validate':{'isEmail':!![]},'set':function(_0x4c4dec){if(_0x4c4dec){this[_0xe496('0x3')](_0xe496('0x8'),_0x4c4dec[_0xe496('0x9')]());}}},'role':{'type':Sequelize[_0xe496('0xa')]('admin','user',_0xe496('0xb'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xe496('0x1')],'defaultValue':_0xe496('0xc')},'internal':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':![],'unique':'internal','set':function(_0x440aff){this[_0xe496('0x3')]('internal',_0x440aff);this['setDataValue'](_0xe496('0xe'),_0x440aff);this[_0xe496('0x3')](_0xe496('0x5'),util[_0xe496('0x6')]('\x22%s\x22\x20<%s>',this[_0xe496('0x7')](_0xe496('0xf')),_0x440aff));}},'salt':{'type':Sequelize[_0xe496('0x1')]},'phone':{'type':Sequelize[_0xe496('0x1')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xe496('0x1')]},'userpic':{'type':Sequelize[_0xe496('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xe496('0x11')]},'voicePause':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xe496('0x1')],'defaultValue':_0xe496('0x12')},'lastPauseAt':{'type':Sequelize[_0xe496('0x11')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xe496('0x10')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xe496('0xd')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xe496('0xd')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'host':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![],'defaultValue':_0xe496('0x13')},'ipaddr':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x14'),_0xe496('0x15'),_0xe496('0x16')),'allowNull':!![],'defaultValue':_0xe496('0x14')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x17'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xe496('0x18'),_0xe496('0x19'),_0xe496('0x1a'),_0xe496('0x1b'),_0xe496('0x1c')),'allowNull':!![]},'deny':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![],'defaultValue':'udp','set':function(_0x425a9e){this['setDataValue'](_0xe496('0x1d'),_0x425a9e?_0x425a9e[_0xe496('0x1e')](','):null);},'get':function(){return this[_0xe496('0x7')](_0xe496('0x1d'))?this['getDataValue'](_0xe496('0x1d'))[_0xe496('0x1f')](','):null;},'comment':_0xe496('0x20')},'dtmfmode':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x21'),_0xe496('0x22'),_0xe496('0x23'),_0xe496('0x24'),_0xe496('0x25')),'allowNull':!![],'defaultValue':_0xe496('0x21')},'directmedia':{'type':Sequelize['ENUM'](_0xe496('0x26'),'no','nonat',_0xe496('0x27'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe496('0xa')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'nat':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x162afc){this['setDataValue'](_0xe496('0x28'),_0x162afc?_0x162afc[_0xe496('0x1e')](','):null);},'get':function(){return this['getDataValue'](_0xe496('0x28'))?this[_0xe496('0x7')](_0xe496('0x28'))[_0xe496('0x1f')](','):null;},'comment':_0xe496('0x29')},'callgroup':{'type':Sequelize[_0xe496('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xe496('0x1')]},'language':{'type':Sequelize[_0xe496('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe496('0x1')]},'disallow':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'defaultValue':_0xe496('0x2a')},'allow':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xf889a6){this[_0xe496('0x3')](_0xe496('0x2b'),_0xf889a6?_0xf889a6[_0xe496('0x1e')](';'):_0xe496('0x2c'));},'get':function(){return this[_0xe496('0x7')](_0xe496('0x2b'))?this[_0xe496('0x7')](_0xe496('0x2b'))[_0xe496('0x1f')](';'):null;},'comment':_0xe496('0x2d')},'autoframing':{'type':Sequelize['ENUM'](_0xe496('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x5aa5c3){this[_0xe496('0x3')](_0xe496('0x2e'),_0x5aa5c3?_0x5aa5c3[_0xe496('0x1e')](','):null);},'get':function(){return this[_0xe496('0x7')](_0xe496('0x2e'))?this['getDataValue'](_0xe496('0x2e'))[_0xe496('0x1f')](','):null;},'comment':_0xe496('0x2f')},'trustrpid':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no',_0xe496('0x30')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![],'defaultValue':_0xe496('0x26')},'busylevel':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x31'),_0xe496('0x32'),_0xe496('0x33')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x34'),_0xe496('0x35')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xe496('0x26')},'keepalive':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xe496('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe496('0xa')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xe496('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xe496('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xe496('0xa')]('yes','no','fingerprint',_0xe496('0x36')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x37'),_0xe496('0x38'),_0xe496('0x39')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xe496('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xe496('0xd')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xe496('0xa')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no',_0xe496('0x3a'),_0xe496('0x27'),_0xe496('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xe496('0x1')]},'resetPasswordExpires':{'type':Sequelize[_0xe496('0x11')]},'passwordResetAt':{'type':Sequelize[_0xe496('0x11')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x36c937){this[_0xe496('0x3')](_0xe496('0x3c'),_0x36c937);var _0x5c70be=this[_0xe496('0x3d')]({'plain':!![]});switch(_0x36c937){case 0x0:case 0x1:var _0x222729=_0x5c70be[_0xe496('0x1d')]?_[_0xe496('0x3e')](_0x5c70be[_0xe496('0x1d')])?_0x5c70be['transport'][_0xe496('0x1e')]():_0x5c70be[_0xe496('0x1d')]:_0xe496('0x3f');if(_0x222729===_0xe496('0x40')){_0x222729=_0xe496('0x3f');}this[_0xe496('0x3')](_0xe496('0x1d'),_0x222729);this[_0xe496('0x3')](_0xe496('0x41'),'no');this[_0xe496('0x3')](_0xe496('0x42'),null);this['setDataValue'](_0xe496('0x43'),null);this[_0xe496('0x3')](_0xe496('0x44'),null);this[_0xe496('0x3')]('dtlsenable',null);this[_0xe496('0x3')](_0xe496('0x45'),null);this[_0xe496('0x3')](_0xe496('0x46'),null);this['setDataValue'](_0xe496('0x47'),null);this[_0xe496('0x3')](_0xe496('0x48'),null);this['setDataValue'](_0xe496('0x49'),'no');break;case 0x2:this['setDataValue'](_0xe496('0x1d'),'wss');this[_0xe496('0x3')](_0xe496('0x41'),'yes');this['setDataValue']('avpf','yes');this[_0xe496('0x3')]('force_avp',_0xe496('0x26'));this[_0xe496('0x3')](_0xe496('0x44'),_0xe496('0x26'));this[_0xe496('0x3')](_0xe496('0x4a'),_0xe496('0x26'));this[_0xe496('0x3')](_0xe496('0x45'),'no');this[_0xe496('0x3')](_0xe496('0x46'),_0xe496('0x39'));this[_0xe496('0x3')]('dtlscertfile',_0x5c70be[_0xe496('0x47')]||_0xe496('0x4b'));this[_0xe496('0x3')](_0xe496('0x48'),_0x5c70be[_0xe496('0x48')]||_0xe496('0x4c'));this[_0xe496('0x3')](_0xe496('0x49'),_0xe496('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xe496('0x4d')],'set':function(_0x43205a){this['setDataValue'](_0xe496('0x4e'),_0x43205a?_0x43205a[_0xe496('0x1e')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0xe496('0x4f')](this[_0xe496('0x7')](_0xe496('0x4e'))[_0xe496('0x1f')](','),function(_0x5ed93c){return parseInt(_0x5ed93c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xe496('0x1')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xe496('0x1')]},'phoneBarBusyNumber':{'type':Sequelize[_0xe496('0x1')]},'phoneBarUnconditional':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xe496('0x10')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xe496('0x1')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xe496('0xa')](_0xe496('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xe496('0x10')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xe496('0x1')]},'phoneBarEnableJaws':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xe496('0x50')],'get':function(){return this[_0xe496('0x7')](_0xe496('0x51'))?this[_0xe496('0x7')](_0xe496('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'interface':{'type':Sequelize[_0xe496('0x1')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xe496('0x1')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4cac02){if(typeof _0x4cac02===_0xe496('0x52')){var _0x59366a=_0x4cac02==='1'?!![]:_0x4cac02==='0'?![]:_0x4cac02===_0xe496('0x53')?!![]:_0x4cac02==='false'?![]:![];this[_0xe496('0x3')](_0xe496('0x54'),_0x59366a);}else{this[_0xe496('0x3')]('screenrecording',_0x4cac02);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xdabd2d){this[_0xe496('0x3')]('blocked',_0xdabd2d);if(_0xdabd2d===!![]){this[_0xe496('0x3')]('blockedAt',moment());this[_0xe496('0x3')](_0xe496('0x55'),0x0);}else{this[_0xe496('0x3')](_0xe496('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xe496('0x11')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xe496('0xd')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xe496('0x10')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xe496('0xd')](0x5)[_0xe496('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xe496('0x10')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe496('0x10')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe496('0x10')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xe496('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 4b33729..687b303 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 _0x5d58=['localhost','request','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','offset','undefined','limit','count','set','Content-Range','json','update','then','get','role','admin','Users','user','Telephones','telephone','filter','map','value','includes','find','name','UserProfileResource','destroy','end','stack','send','User','rawAttributes','type','password','getOptions','where','query','includeAll','include','push','findAll','rows','length','chat','dataValues','sms','fax','openchannel','catch','show','params','model','salt','filters','intersection','attributes','fields','merge','true','whatsapp','mail','body','describe','addContacts','ids','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','agent','permissions','101','102','113','105','106','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','userProfileId','UserProfileSection','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','all','each','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','penalty','spread','emit','capitalize','Queue:save','voice','online','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','channel','remove','Queues','QueueId','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','getContacts','keys','sort','options','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','order','pick','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','concat','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','omit','getVoiceQueues','setDataValue','getChatQueues','Chat','getMailQueues','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getSmsQueues','Whatsapp','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','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','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','CmHopper','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','firstName','CmContact','Contact','VoiceQueue','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','flatten','lower','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','unknown','ringing','voiceStatus','busy','slice','charAt','field','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','register','defaults'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5d58,0x187));var _0x85d5=function(_0x47f0c6,_0x5aef58){_0x47f0c6=_0x47f0c6-0x0;var _0x2209ce=_0x5d58[_0x47f0c6];return _0x2209ce;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x85d5('0x0'));var jayson=require(_0x85d5('0x1'));var Redis=require('ioredis');var authService=require(_0x85d5('0x2'));var qs=require(_0x85d5('0x3'));var logger=require('../../config/logger')(_0x85d5('0x4'));var utils=require(_0x85d5('0x5'));var config=require(_0x85d5('0x6'));var licenseUtil=require(_0x85d5('0x7'));var db=require('../../mysqldb')['db'];var socket=require(_0x85d5('0x8'))(new Redis(config[_0x85d5('0x9')]));require('./user.socket')[_0x85d5('0xa')](socket);config['redis']=_[_0x85d5('0xb')](config[_0x85d5('0x9')],{'host':_0x85d5('0xc'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x4e147a,_0x1a2b82,_0x12a681,_0xde1063){return new BPromise(function(_0x25369e,_0x229355){var _0x18331f=_0xde1063||client;return _0x18331f[_0x85d5('0xd')](_0x4e147a,_0x12a681)['then'](function(_0x4bbf2a){logger['info'](_0x85d5('0xe'),_0x1a2b82,_0x85d5('0xf'));logger[_0x85d5('0x10')](_0x85d5('0x11'),_0x1a2b82,_0x85d5('0xf'),JSON[_0x85d5('0x12')](_0x4bbf2a));if(_0x4bbf2a[_0x85d5('0x13')]){if(_0x4bbf2a['error'][_0x85d5('0x14')]===0x1f4){logger[_0x85d5('0x13')](_0x85d5('0xe'),_0x1a2b82,_0x4bbf2a[_0x85d5('0x13')][_0x85d5('0x15')]);return _0x229355(_0x4bbf2a[_0x85d5('0x13')][_0x85d5('0x15')]);}logger[_0x85d5('0x13')](_0x85d5('0xe'),_0x1a2b82,_0x4bbf2a[_0x85d5('0x13')][_0x85d5('0x15')]);return _0x25369e(_0x4bbf2a[_0x85d5('0x13')][_0x85d5('0x15')]);}else{logger[_0x85d5('0x16')](_0x85d5('0xe'),_0x1a2b82,_0x85d5('0xf'));_0x25369e(_0x4bbf2a[_0x85d5('0x17')][_0x85d5('0x15')]);}})['catch'](function(_0xc56ad1){logger[_0x85d5('0x13')]('User,\x20%s,\x20%s',_0x1a2b82,_0xc56ad1);_0x229355(_0xc56ad1);});});}function respondWithStatusCode(_0x231b57,_0x1264ca){_0x1264ca=_0x1264ca||0xcc;return function(_0x52ef3a){if(_0x52ef3a){return _0x231b57['sendStatus'](_0x1264ca);}return _0x231b57[_0x85d5('0x18')](_0x1264ca)['end']();};}function respondWithResult(_0x2f2bae,_0x5ce96e){_0x5ce96e=_0x5ce96e||0xc8;return function(_0x240000){if(_0x240000){return _0x2f2bae[_0x85d5('0x18')](_0x5ce96e)['json'](_0x240000);}};}function respondWithFilteredResult(_0x4e11c4,_0x4da71b){return function(_0x5f0268){if(_0x5f0268){var _0xf03669=typeof _0x4da71b[_0x85d5('0x19')]===_0x85d5('0x1a')&&typeof _0x4da71b[_0x85d5('0x1b')]===_0x85d5('0x1a');var _0xef2405=_0x5f0268['count'];var _0x7e9a11=_0xf03669?0x0:_0x4da71b['offset'];var _0x1b3fae=_0xf03669?_0x5f0268[_0x85d5('0x1c')]:_0x4da71b[_0x85d5('0x19')]+_0x4da71b['limit'];var _0x2d0497;if(_0x1b3fae>=_0xef2405){_0x1b3fae=_0xef2405;_0x2d0497=0xc8;}else{_0x2d0497=0xce;}_0x4e11c4[_0x85d5('0x18')](_0x2d0497);return _0x4e11c4[_0x85d5('0x1d')](_0x85d5('0x1e'),_0x7e9a11+'-'+_0x1b3fae+'/'+_0xef2405)[_0x85d5('0x1f')](_0x5f0268);}return null;};}function saveUpdates(_0x56031f){return function(_0x1cbef1){if(_0x1cbef1){return _0x1cbef1[_0x85d5('0x20')](_0x56031f)[_0x85d5('0x21')](function(_0x22a961){return _0x22a961;});}return null;};}function removeEntity(_0x43ac91){return function(_0x572daf){if(_0x572daf){return _0x572daf['destroy']()[_0x85d5('0x21')](function(){var _0x24a0a3=_0x572daf[_0x85d5('0x22')]({'plain':!![]});if(_0x24a0a3[_0x85d5('0x23')]===_0x85d5('0x24'))return;var _0x5efb7d=[{'name':_0x85d5('0x25'),'value':_0x85d5('0x26'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x85d5('0x27'),'value':_0x85d5('0x28'),'ignore':![]}];var _0x5a442c=_(_0x5efb7d)[_0x85d5('0x29')]('ignore')[_0x85d5('0x2a')](_0x85d5('0x2b'))['value']();if(_[_0x85d5('0x2c')](_0x5a442c,_0x24a0a3[_0x85d5('0x23')])){return;}var _0x22e213=_[_0x85d5('0x2d')](_0x5efb7d,['value',_0x24a0a3['role']])[_0x85d5('0x2e')];return db[_0x85d5('0x2f')][_0x85d5('0x30')]({'where':{'type':_0x22e213,'resourceId':_0x24a0a3['id']}})[_0x85d5('0x21')](function(){return _0x572daf;});})[_0x85d5('0x21')](function(){_0x43ac91[_0x85d5('0x18')](0xcc)[_0x85d5('0x31')]();});}};}function handleEntityNotFound(_0x3c07e1){return function(_0x37e757){if(!_0x37e757){_0x3c07e1['sendStatus'](0x194);}return _0x37e757;};}function handleError(_0x5a15fd,_0x27308c){_0x27308c=_0x27308c||0x1f4;return function(_0xb17769){logger[_0x85d5('0x13')](_0xb17769[_0x85d5('0x32')]);if(_0xb17769[_0x85d5('0x2e')]){delete _0xb17769[_0x85d5('0x2e')];}_0x5a15fd[_0x85d5('0x18')](_0x27308c)[_0x85d5('0x33')](_0xb17769);};}exports['index']=function(_0x358555,_0x42e8b4){var _0x11ed28={},_0x1fdb00={'count':0x0,'rows':[]};var _0x555214=_(db[_0x85d5('0x34')][_0x85d5('0x35')])[_0x85d5('0x2a')](function(_0x3e3c55){return{'name':_0x3e3c55['fieldName'],'type':_0x3e3c55[_0x85d5('0x36')]['key']};})['filter'](function(_0x17571a){return!_['includes']([_0x85d5('0x37'),'salt'],_0x17571a['name']);})[_0x85d5('0x2b')]();_0x11ed28=qs[_0x85d5('0x38')](_0x555214,_0x358555);var _0x40360f={'where':_0x11ed28[_0x85d5('0x39')]};return db[_0x85d5('0x34')]['count'](_0x40360f)['then'](function(_0x276aaf){_0x1fdb00[_0x85d5('0x1c')]=_0x276aaf;if(_0x358555[_0x85d5('0x3a')][_0x85d5('0x3b')]){_0x11ed28[_0x85d5('0x3c')]=[{'all':!![]}];}if(!_[_0x85d5('0x2c')](_0x11ed28['attributes'],'id')){_0x11ed28['attributes'][_0x85d5('0x3d')]('id');}return db['User'][_0x85d5('0x3e')](_0x11ed28);})[_0x85d5('0x21')](function(_0x7dd430){_0x1fdb00[_0x85d5('0x3f')]=_0x7dd430;if(_0x358555[_0x85d5('0x3a')]['openTabs']==='true'){var _0x34a42b=[];for(var _0x3325aa=0x0;_0x3325aa<_0x1fdb00[_0x85d5('0x3f')][_0x85d5('0x40')];_0x3325aa++){_0x34a42b[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x41'),_0x1fdb00[_0x85d5('0x3f')][_0x3325aa][_0x85d5('0x42')]));_0x34a42b[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x43'),_0x1fdb00[_0x85d5('0x3f')][_0x3325aa][_0x85d5('0x42')]));_0x34a42b[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x44'),_0x1fdb00[_0x85d5('0x3f')][_0x3325aa][_0x85d5('0x42')]));_0x34a42b[_0x85d5('0x3d')](get_open_tabs('mail',_0x1fdb00['rows'][_0x3325aa][_0x85d5('0x42')]));_0x34a42b[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x45'),_0x1fdb00[_0x85d5('0x3f')][_0x3325aa][_0x85d5('0x42')]));_0x34a42b[_0x85d5('0x3d')](get_open_tabs('whatsapp',_0x1fdb00[_0x85d5('0x3f')][_0x3325aa]['dataValues']));}return BPromise['all'](_0x34a42b)[_0x85d5('0x21')](function(_0x13ab32){return _0x1fdb00;});}else{return _0x1fdb00;}})[_0x85d5('0x21')](respondWithFilteredResult(_0x42e8b4,_0x11ed28))[_0x85d5('0x46')](handleError(_0x42e8b4,null));};exports[_0x85d5('0x47')]=function(_0x588d8a,_0x26adc5){var _0x4d3e06={'raw':![],'where':{'id':_0x588d8a[_0x85d5('0x48')]['id']}},_0x1f2ef9={};_0x1f2ef9[_0x85d5('0x49')]=_['differenceBy'](_['keys'](db['User'][_0x85d5('0x35')]),[_0x85d5('0x37'),_0x85d5('0x4a')]);_0x1f2ef9['query']=_['keys'](_0x588d8a[_0x85d5('0x3a')]);_0x1f2ef9[_0x85d5('0x4b')]=_[_0x85d5('0x4c')](_0x1f2ef9[_0x85d5('0x49')],_0x1f2ef9['query']);_0x4d3e06[_0x85d5('0x4d')]=_[_0x85d5('0x4c')](_0x1f2ef9[_0x85d5('0x49')],qs[_0x85d5('0x4e')](_0x588d8a[_0x85d5('0x3a')][_0x85d5('0x4e')]));_0x4d3e06[_0x85d5('0x4d')]=_0x4d3e06[_0x85d5('0x4d')][_0x85d5('0x40')]?_0x4d3e06[_0x85d5('0x4d')]:_0x1f2ef9[_0x85d5('0x49')];if(_0x588d8a[_0x85d5('0x3a')][_0x85d5('0x3b')]){_0x4d3e06[_0x85d5('0x3c')]=[{'all':!![]}];}_0x4d3e06=_[_0x85d5('0x4f')]({},_0x4d3e06,_0x588d8a['options']);if(!_[_0x85d5('0x2c')](_0x4d3e06[_0x85d5('0x4d')],'id')){_0x4d3e06[_0x85d5('0x4d')][_0x85d5('0x3d')]('id');}return db['User'][_0x85d5('0x2d')](_0x4d3e06)['then'](handleEntityNotFound(_0x26adc5,null))[_0x85d5('0x21')](function(_0x363aeb){var _0x2755cc=[];values=_0x363aeb;if(_0x588d8a[_0x85d5('0x3a')]['openTabs']===_0x85d5('0x50')){_0x2755cc['push'](get_open_tabs('chat',_0x363aeb['dataValues']));_0x2755cc[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x43'),_0x363aeb[_0x85d5('0x42')]));_0x2755cc[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x45'),_0x363aeb['dataValues']));_0x2755cc['push'](get_open_tabs(_0x85d5('0x51'),_0x363aeb[_0x85d5('0x42')]));_0x2755cc[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x44'),_0x363aeb['dataValues']));_0x2755cc[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x52'),_0x363aeb[_0x85d5('0x42')]));return BPromise['all'](_0x2755cc);}else{return values;}})['then'](function(_0x3ed683){return values;})[_0x85d5('0x21')](respondWithResult(_0x26adc5,null))[_0x85d5('0x46')](handleError(_0x26adc5,null));};exports['update']=function(_0x3dfbda,_0x3e7263){if(_0x3dfbda[_0x85d5('0x53')]['id']){delete _0x3dfbda[_0x85d5('0x53')]['id'];}delete _0x3dfbda['body'][_0x85d5('0x23')];return db[_0x85d5('0x34')][_0x85d5('0x2d')]({'where':{'id':_0x3dfbda['params']['id']}})[_0x85d5('0x21')](handleEntityNotFound(_0x3e7263,null))[_0x85d5('0x21')](saveUpdates(_0x3dfbda[_0x85d5('0x53')],null))['then'](respondWithResult(_0x3e7263,null))[_0x85d5('0x46')](handleError(_0x3e7263,null));};exports[_0x85d5('0x54')]=function(_0x5d6692,_0x242ad0){return db['User'][_0x85d5('0x54')]()['then'](respondWithResult(_0x242ad0,null))[_0x85d5('0x46')](handleError(_0x242ad0,null));};exports[_0x85d5('0x55')]=function(_0x40967c,_0x33c486){return db['User'][_0x85d5('0x2d')]({'where':{'id':_0x40967c[_0x85d5('0x48')]['id']}})[_0x85d5('0x21')](handleEntityNotFound(_0x33c486,null))[_0x85d5('0x21')](function(_0x21189e){if(_0x21189e){return _0x21189e[_0x85d5('0x55')](_0x40967c[_0x85d5('0x53')][_0x85d5('0x56')],_['omit'](_0x40967c['body'],[_0x85d5('0x56'),'id'])||{});}})['then'](respondWithResult(_0x33c486,null))[_0x85d5('0x46')](handleError(_0x33c486,null));};function validateUser(_0x12c235){return new BPromise(function(_0x5662d2,_0x580322){if(_0x12c235[_0x85d5('0x57')])return _0x5662d2(_0x12c235);return db[_0x85d5('0x58')][_0x85d5('0x59')](0x1)['then'](function(_0x1c0753){if(_0x1c0753[_0x85d5('0x5a')])authService[_0x85d5('0x5b')](_0x12c235[_0x85d5('0x37')]);db['User']['max'](_0x85d5('0x57'))['then'](function(_0x565337){if(_[_0x85d5('0x5c')](_0x565337)){_0x12c235[_0x85d5('0x57')]=_0x1c0753[_0x85d5('0x5d')]||0x1;return;}if(_['isNil'](_0x1c0753['min_internal'])||_0x1c0753[_0x85d5('0x5d')]===_0x565337){_0x12c235[_0x85d5('0x57')]=_0x565337+0x1;return;}if(_0x1c0753[_0x85d5('0x5d')]>_0x565337){_0x12c235['internal']=_0x1c0753[_0x85d5('0x5d')];return;}return db[_0x85d5('0x5e')][_0x85d5('0x3a')](_0x85d5('0x5f'),{'type':db[_0x85d5('0x5e')][_0x85d5('0x60')][_0x85d5('0x61')]})[_0x85d5('0x21')](function(_0x4f80dd){if(_0x4f80dd&&_0x4f80dd['length']){for(var _0x2a0a59=0x0,_0x176632=_0x4f80dd[_0x85d5('0x40')];_0x2a0a59<_0x176632&&_['isNil'](_0x12c235[_0x85d5('0x57')]);_0x2a0a59++){if(_0x1c0753[_0x85d5('0x5d')]<=_0x4f80dd[_0x2a0a59]['from']){_0x12c235[_0x85d5('0x57')]=_0x4f80dd[_0x2a0a59][_0x85d5('0x62')];}else if(_0x1c0753[_0x85d5('0x5d')]>_0x4f80dd[_0x2a0a59][_0x85d5('0x62')]&&_0x1c0753[_0x85d5('0x5d')]<=_0x4f80dd[_0x2a0a59]['to']){_0x12c235['internal']=_0x1c0753[_0x85d5('0x5d')];}}}if(_[_0x85d5('0x5c')](_0x12c235[_0x85d5('0x57')])){_0x12c235[_0x85d5('0x57')]=_0x565337+0x1;}return _0x5662d2(_0x12c235);});});})[_0x85d5('0x46')](function(_0x4d1674){_0x580322(_0x4d1674);});});}function updateUser(_0x403df1){return new BPromise(function(_0x1c8aac,_0x3bcc95){try{if(_0x403df1[_0x85d5('0x63')]){_0x403df1[_0x85d5('0x64')]=_0x403df1[_0x85d5('0x57')];_0x403df1[_0x85d5('0x65')]={'mailbox':_0x403df1[_0x85d5('0x57')],'password':_0x403df1[_0x85d5('0x37')],'fullname':_0x403df1[_0x85d5('0x66')],'email':_0x403df1['email']};}if(_0x403df1[_0x85d5('0x23')]===_0x85d5('0x67')){if(!_0x403df1[_0x85d5('0x68')])_0x403df1[_0x85d5('0x68')]=[_0x85d5('0x69'),_0x85d5('0x6a'),'103',_0x85d5('0x6b'),'110','104',_0x85d5('0x6c'),_0x85d5('0x6d'),_0x85d5('0x6e'),_0x85d5('0x6f'),_0x85d5('0x70'),_0x85d5('0x71'),_0x85d5('0x72'),_0x85d5('0x73'),_0x85d5('0x74')];}_0x1c8aac(_0x403df1);}catch(_0x5dc16a){_0x3bcc95(_0x5dc16a);}});}exports[_0x85d5('0x75')]=function(_0x1617ba,_0x8ef5f1){if(_0x1617ba[_0x85d5('0x26')][_0x85d5('0x23')]===_0x85d5('0x67'))throw new Error(_0x85d5('0x76'));if(_0x1617ba[_0x85d5('0x53')][_0x85d5('0x23')]===_0x85d5('0x26')&&_0x1617ba[_0x85d5('0x26')][_0x85d5('0x23')]!==_0x85d5('0x24')){throw new Error(_0x85d5('0x77'));}if(_0x1617ba[_0x85d5('0x53')]['role']==='admin'&&_0x1617ba[_0x85d5('0x26')]['role']!==_0x85d5('0x24')){throw new Error(_0x85d5('0x78'));}return licenseUtil[_0x85d5('0x79')]([_0x1617ba[_0x85d5('0x53')]])[_0x85d5('0x21')](function(){return validateUser(_0x1617ba[_0x85d5('0x53')]);})[_0x85d5('0x21')](function(_0xdeef5e){return updateUser(_0xdeef5e)[_0x85d5('0x21')](function(_0x5ed6cb){if(_0x5ed6cb[_0x85d5('0x23')]===_0x85d5('0x24')){_0x5ed6cb['settingsEnabled']=_0x1617ba[_0x85d5('0x26')]['settingsEnabled'];delete _0x5ed6cb[_0x85d5('0x7a')];}return _0x5ed6cb;});})[_0x85d5('0x21')](function(_0x1c1595){return db[_0x85d5('0x34')]['create'](_0x1c1595,{'include':[{'model':db[_0x85d5('0x65')],'as':_0x85d5('0x65')}]});})['then'](function(_0x31a9a5){if(_0x1617ba[_0x85d5('0x53')]['role']===_0x85d5('0x26'))return _0x31a9a5;if(_0x1617ba[_0x85d5('0x26')][_0x85d5('0x23')]!=='user')return _0x31a9a5;return db[_0x85d5('0x7b')][_0x85d5('0x2d')]({'where':{'name':_0x31a9a5[_0x85d5('0x23')]===_0x85d5('0x67')?_0x85d5('0x7c'):_0x85d5('0x27'),'userProfileId':_0x1617ba['user'][_0x85d5('0x7a')]},'raw':!![]})[_0x85d5('0x21')](function(_0x5b090c){if(!_0x5b090c||_0x5b090c[_0x85d5('0x7d')]!=0x0)return _0x31a9a5;return db['UserProfileResource'][_0x85d5('0x75')]({'name':_0x31a9a5[_0x85d5('0x2e')],'resourceId':_0x31a9a5['id'],'type':_0x5b090c[_0x85d5('0x2e')],'sectionId':_0x5b090c['id']},{})['then'](function(){return _0x31a9a5;});})[_0x85d5('0x46')](function(_0x176b68){logger[_0x85d5('0x13')](_0x85d5('0x7e'),_0x176b68);throw _0x176b68;});})[_0x85d5('0x21')](respondWithResult(_0x8ef5f1,0xc9))['catch'](handleError(_0x8ef5f1,null));};exports[_0x85d5('0x7f')]=function(_0x29ca79,_0xbbff78){var _0x19de1a=_0x29ca79['body'];var _0x1764b0=[];if(_0x29ca79[_0x85d5('0x26')][_0x85d5('0x23')]==='agent')throw new Error(_0x85d5('0x76'));if(_['some'](_0x19de1a,[_0x85d5('0x23'),_0x85d5('0x26')])&&_0x29ca79['user']['role']!==_0x85d5('0x24')){throw new Error(_0x85d5('0x77'));}if(_[_0x85d5('0x80')](_0x19de1a,[_0x85d5('0x23'),_0x85d5('0x24')])&&_0x29ca79[_0x85d5('0x26')][_0x85d5('0x23')]!==_0x85d5('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x85d5('0x79')](_0x19de1a)[_0x85d5('0x21')](function(){return validateUser(_0x19de1a[0x0]);})[_0x85d5('0x21')](function(){for(var _0x52bdee=0x1;_0x52bdee<_0x19de1a[_0x85d5('0x40')];_0x52bdee++){var _0x393a29=_0x19de1a[_0x52bdee-0x1]['internal'];if(!_0x19de1a[_0x52bdee][_0x85d5('0x57')])_0x19de1a[_0x52bdee][_0x85d5('0x57')]=_0x393a29+0x1;_0x1764b0[_0x85d5('0x3d')](validateUser(_0x19de1a[_0x52bdee]));}return BPromise[_0x85d5('0x81')](_0x1764b0);})[_0x85d5('0x21')](function(){_0x1764b0=[];for(var _0x9f9619=0x0;_0x9f9619<_0x19de1a[_0x85d5('0x40')];_0x9f9619++){_0x1764b0['push'](updateUser(_0x19de1a[_0x9f9619]));}return BPromise[_0x85d5('0x81')](_0x1764b0);})[_0x85d5('0x21')](function(){return BPromise[_0x85d5('0x82')](_0x19de1a,function(_0xd3cbc9){return db['User'][_0x85d5('0x75')](_0xd3cbc9,{'include':[{'model':db[_0x85d5('0x65')],'as':_0x85d5('0x65')}]})[_0x85d5('0x21')](function(_0x3664bd){_0xd3cbc9['id']=_0x3664bd['id'];return _0xd3cbc9;});});})['then'](function(_0x527f80){if(_0x29ca79[_0x85d5('0x53')]['role']===_0x85d5('0x26'))return _0x527f80;if(_0x29ca79[_0x85d5('0x26')][_0x85d5('0x23')]!==_0x85d5('0x26'))return _0x527f80;var _0x19da12=_[_0x85d5('0x80')](_0x527f80,function(_0x420460){return _0x420460['role']===_0x85d5('0x67')||_0x420460['role']===_0x85d5('0x28');});if(!_0x19da12)return _0x527f80;return db[_0x85d5('0x7b')][_0x85d5('0x3e')]({'where':{'name':{'$or':['Agents',_0x85d5('0x27')]},'userProfileId':_0x29ca79[_0x85d5('0x26')][_0x85d5('0x7a')]},'raw':!![]})['then'](function(_0x5cc7c1){if(_[_0x85d5('0x83')](_0x5cc7c1)||!_[_0x85d5('0x80')](_0x5cc7c1,['autoAssociation',0x0]))return _0x527f80;_0x1764b0=[];var _0x3d9a7b=_(_0x5cc7c1)[_0x85d5('0x2a')](function(_0x4a68e1){if(_0x4a68e1[_0x85d5('0x7d')]===0x1)return;return _0x4a68e1[_0x85d5('0x2e')]===_0x85d5('0x7c')?_0x85d5('0x67'):_0x85d5('0x28');})[_0x85d5('0x84')]()[_0x85d5('0x2b')]();for(var _0x537c28=0x0;_0x537c28<_0x527f80[_0x85d5('0x40')];_0x537c28++){if(!_[_0x85d5('0x2c')](_0x3d9a7b,_0x527f80[_0x537c28][_0x85d5('0x23')]))return;var _0xed4ac5=_0x527f80[_0x537c28]['role']==='agent'?'Agents':_0x85d5('0x27');_0x1764b0[_0x85d5('0x3d')](db[_0x85d5('0x2f')]['create']({'name':_0x527f80[_0x537c28][_0x85d5('0x2e')],'resourceId':_0x527f80[_0x537c28]['id'],'type':_0xed4ac5,'sectionId':_['find'](_0x5cc7c1,[_0x85d5('0x2e'),_0xed4ac5])['id']},{}));}return BPromise[_0x85d5('0x81')](_0x1764b0);});})['then'](respondWithResult(_0xbbff78,0xc9))[_0x85d5('0x46')](handleError(_0xbbff78,null));};exports[_0x85d5('0x85')]=function(_0x3fa8a4,_0x536c89){if(_0x3fa8a4['body']['id']){delete _0x3fa8a4['body']['id'];}return db[_0x85d5('0x34')]['find']({'where':{'id':_0x3fa8a4[_0x85d5('0x48')]['id']}})[_0x85d5('0x21')](function(_0x4dff53){if(!_0x4dff53)return null;if(_0x4dff53['id']===_0x3fa8a4[_0x85d5('0x26')]['id']){if(!_0x3fa8a4[_0x85d5('0x53')]['oldPassword']||!_0x3fa8a4[_0x85d5('0x53')][_0x85d5('0x86')]){throw new db[(_0x85d5('0x87'))][(_0x85d5('0x88'))](_0x85d5('0x89'));}if(!_0x4dff53[_0x85d5('0x8a')](_0x3fa8a4['body'][_0x85d5('0x8b')])){throw new db['Sequelize'][(_0x85d5('0x88'))](_0x85d5('0x8c'));}if(_0x3fa8a4[_0x85d5('0x53')]['oldPassword']===_0x3fa8a4['body'][_0x85d5('0x86')]){throw new db[(_0x85d5('0x87'))][(_0x85d5('0x88'))](_0x85d5('0x8d'));}}else if(_0x3fa8a4[_0x85d5('0x26')][_0x85d5('0x23')]===_0x85d5('0x24')){if(!_0x3fa8a4[_0x85d5('0x53')][_0x85d5('0x86')]){throw new db['Sequelize'][(_0x85d5('0x88'))](_0x85d5('0x8e'));}}else if(_0x3fa8a4[_0x85d5('0x26')][_0x85d5('0x23')]===_0x85d5('0x26')){if(!_0x3fa8a4[_0x85d5('0x53')][_0x85d5('0x86')]){throw new db[(_0x85d5('0x87'))][(_0x85d5('0x88'))](_0x85d5('0x8e'));}if(_0x4dff53['role']!=='agent'){throw new db[(_0x85d5('0x87'))][(_0x85d5('0x88'))](_0x85d5('0x76'));}}else{throw new db['Sequelize'][(_0x85d5('0x88'))](_0x85d5('0x76'));}return _0x4dff53;})[_0x85d5('0x21')](handleEntityNotFound(_0x536c89,null))['then'](function(_0x3364a3){return db[_0x85d5('0x58')][_0x85d5('0x8f')]({'attributes':['id','securePassword',_0x85d5('0x90'),_0x85d5('0x91')]})['then'](function(_0x60339e){if(_0x60339e[_0x85d5('0x5a')])authService['validatePasswordPattern'](_0x3fa8a4['body'][_0x85d5('0x86')]);if(!_0x60339e['enforcePasswordHistory']||!_0x3364a3['previousPasswords'])return _0x3364a3;authService[_0x85d5('0x92')](_0x3fa8a4[_0x85d5('0x53')][_0x85d5('0x86')],_0x3364a3[_0x85d5('0x93')],_0x60339e[_0x85d5('0x91')]);return _0x3364a3;})[_0x85d5('0x21')](saveUpdates({'password':_0x3fa8a4['body'][_0x85d5('0x86')],'passwordResetAt':_0x3fa8a4[_0x85d5('0x26')]['id']==_0x3fa8a4['params']['id']?moment():null,'previousPasswords':authService[_0x85d5('0x94')](_0x3fa8a4[_0x85d5('0x53')][_0x85d5('0x86')],_0x3364a3[_0x85d5('0x93')])},null));})[_0x85d5('0x21')](respondWithResult(_0x536c89,null))['catch'](handleError(_0x536c89,null));};exports[_0x85d5('0x95')]=function(_0x3cb198,_0x544f4e){var _0x3fec8d=_0x3cb198[_0x85d5('0x53')]['channel'];return db[_0x85d5('0x34')]['find']({'where':{'id':_0x3cb198[_0x85d5('0x48')]['id']},'attributes':['id',_0x85d5('0x2e'),_0x85d5('0x23'),'online','loginInPause',_0x85d5('0x96'),_0x85d5('0x97')]})[_0x85d5('0x21')](handleEntityNotFound(_0x544f4e,null))[_0x85d5('0x21')](function(_0x255507){if(_0x255507){if(!utils[_0x85d5('0x98')](_0x3fec8d)){throw new db[(_0x85d5('0x87'))][(_0x85d5('0x88'))](_0x85d5('0x99'));}return _0x255507[_0x85d5('0x9a')+_['capitalize'](_0x3fec8d[_0x85d5('0x9b')]())+'Queues'](_0x3cb198[_0x85d5('0x53')]['ids'],{'penalty':_0x3cb198['body'][_0x85d5('0x9c')]||0x0})[_0x85d5('0x9d')](function(_0x1391c4){for(var _0x4dbac8=0x0;_0x4dbac8<_0x3cb198['body'][_0x85d5('0x56')][_0x85d5('0x40')];_0x4dbac8+=0x1){var _0x29f73f={'UserId':Number(_0x3cb198[_0x85d5('0x48')]['id'])};_0x29f73f[_['capitalize'](_0x3fec8d[_0x85d5('0x9b')]())+'QueueId']=Number(_0x3cb198[_0x85d5('0x53')][_0x85d5('0x56')][_0x4dbac8]);socket[_0x85d5('0x9e')](_0x85d5('0x26')+_[_0x85d5('0x9f')](_0x3fec8d['toLowerCase']())+_0x85d5('0xa0'),_0x29f73f);}return _0x1391c4;})['then'](function(){if(_0x3fec8d===_0x85d5('0xa1')){return db['VoiceQueue'][_0x85d5('0x3e')]({'where':{'id':_0x3cb198[_0x85d5('0x53')]['ids']||[]},'raw':!![],'attributes':['id',_0x85d5('0x2e')]});}})[_0x85d5('0x21')](function(_0x4bc40a){var _0x330220=_0x255507['get']({'plain':!![]});var _0xa33e5c=[];if(_0x3fec8d===_0x85d5('0xa1')&&_0x330220[_0x85d5('0x23')]===_0x85d5('0x67')&&_0x330220[_0x85d5('0xa2')]){for(var _0x511dfe=0x0;_0x511dfe<_0x4bc40a[_0x85d5('0x40')];_0x511dfe+=0x1){_0xa33e5c[_0x85d5('0x3d')]({'membername':_0x330220[_0x85d5('0x2e')],'UserId':_0x330220['id'],'queue_name':_0x4bc40a[_0x511dfe]['name'],'VoiceQueueId':_0x4bc40a[_0x511dfe]['id'],'interface':_[_0x85d5('0x5c')](_0x330220[_0x85d5('0x97')])?util[_0x85d5('0xa3')](_0x85d5('0xa4'),_0x330220[_0x85d5('0x2e')]):_0x330220[_0x85d5('0x97')],'paused':_0x330220[_0x85d5('0x96')]||![],'penalty':_0x3cb198['body'][_0x85d5('0x9c')]||0x0});}return BPromise[_0x85d5('0x82')](_0xa33e5c,function(_0x3a0a98){return db[_0x85d5('0xa5')][_0x85d5('0xa6')](_0x3a0a98);});}return _0x255507;});}})['then'](respondWithStatusCode(_0x544f4e,null))[_0x85d5('0x46')](handleError(_0x544f4e,null));};exports[_0x85d5('0xa7')]=function(_0x475004,_0x4312ff){var _0x119d36;return db[_0x85d5('0x34')]['find']({'where':{'id':_0x475004['params']['id']},'attributes':['id',_0x85d5('0x2e'),_0x85d5('0x23')]})[_0x85d5('0x21')](handleEntityNotFound(_0x4312ff,null))[_0x85d5('0x21')](function(_0x5c60f4){if(_0x5c60f4){_0x119d36=_0x5c60f4;if(!_0x475004[_0x85d5('0x3a')][_0x85d5('0xa8')]||!utils[_0x85d5('0x98')](_0x475004['query'][_0x85d5('0xa8')])){throw new db[(_0x85d5('0x87'))][(_0x85d5('0x88'))](_0x85d5('0x99'));}return _0x5c60f4[_0x85d5('0xa9')+_[_0x85d5('0x9f')](_0x475004[_0x85d5('0x3a')]['channel'][_0x85d5('0x9b')]())+_0x85d5('0xaa')](_0x475004['query'][_0x85d5('0x56')]);}})[_0x85d5('0x21')](function(_0x5d0c83){if(_['isArray'](_0x475004[_0x85d5('0x3a')][_0x85d5('0x56')])){for(var _0x3d8e69=0x0;_0x3d8e69<_0x475004[_0x85d5('0x3a')][_0x85d5('0x56')]['length'];_0x3d8e69+=0x1){var _0x26e540={'UserId':Number(_0x475004[_0x85d5('0x48')]['id'])};_0x26e540[_[_0x85d5('0x9f')](_0x475004['query'][_0x85d5('0xa8')][_0x85d5('0x9b')]())+_0x85d5('0xab')]=Number(_0x475004[_0x85d5('0x3a')]['ids'][_0x3d8e69]);socket[_0x85d5('0x9e')](_0x85d5('0x26')+_['capitalize'](_0x475004[_0x85d5('0x3a')][_0x85d5('0xa8')][_0x85d5('0x9b')]())+_0x85d5('0xac'),_0x26e540);}}else{var _0x26e540={'UserId':Number(_0x475004[_0x85d5('0x48')]['id'])};_0x26e540[_[_0x85d5('0x9f')](_0x475004[_0x85d5('0x3a')][_0x85d5('0xa8')][_0x85d5('0x9b')]())+'QueueId']=Number(_0x475004['query'][_0x85d5('0x56')]);socket[_0x85d5('0x9e')](_0x85d5('0x26')+_[_0x85d5('0x9f')](_0x475004[_0x85d5('0x3a')][_0x85d5('0xa8')][_0x85d5('0x9b')]())+_0x85d5('0xac'),_0x26e540);}return _0x5d0c83;})[_0x85d5('0x21')](function(){if(_0x475004[_0x85d5('0x3a')][_0x85d5('0xa8')]===_0x85d5('0xa1')){return db[_0x85d5('0xa5')][_0x85d5('0x30')]({'where':{'UserId':_0x475004[_0x85d5('0x48')]['id'],'VoiceQueueId':_0x475004[_0x85d5('0x3a')][_0x85d5('0x56')]},'individualHooks':!![]})[_0x85d5('0x21')](function(){return _0x119d36;});}return _0x119d36;})[_0x85d5('0x21')](respondWithStatusCode(_0x4312ff,null))[_0x85d5('0x46')](handleError(_0x4312ff,null));};exports[_0x85d5('0xad')]=function(_0x196798,_0x28564d){_0x196798[_0x85d5('0x53')][_0x85d5('0xae')]=_0x196798['file'][_0x85d5('0xaf')];return db['User'][_0x85d5('0x2d')]({'where':{'id':_0x196798[_0x85d5('0x48')]['id']}})[_0x85d5('0x21')](handleEntityNotFound(_0x28564d,null))['then'](saveUpdates(_0x196798[_0x85d5('0x53')],null))[_0x85d5('0x21')](respondWithResult(_0x28564d,null))[_0x85d5('0x46')](handleError(_0x28564d,null));};exports[_0x85d5('0xb0')]=function(_0x1c67a0,_0x3d9288){var _0x295f8b=path[_0x85d5('0xb1')](config[_0x85d5('0xb2')],_0x85d5('0xb3'));return db[_0x85d5('0x34')][_0x85d5('0x2d')]({'where':{'id':_0x1c67a0[_0x85d5('0x48')]['id']},'attributes':['id',_0x85d5('0xae')],'raw':!![]})[_0x85d5('0x21')](handleEntityNotFound(_0x3d9288,null))[_0x85d5('0x21')](function(_0x244ce3){if(_0x244ce3){if(_[_0x85d5('0x5c')](_0x244ce3['userpic'])){return _0x3d9288['download'](_0x295f8b);}else{if(!fs[_0x85d5('0xb4')](path[_0x85d5('0xb1')](config[_0x85d5('0xb2')],_0x85d5('0xb5'),_0x244ce3[_0x85d5('0xae')]))){return _0x3d9288[_0x85d5('0xb6')](_0x295f8b);}return _0x3d9288['download'](path[_0x85d5('0xb1')](config[_0x85d5('0xb2')],'server/files/images/',_0x244ce3['userpic']));}}})[_0x85d5('0x46')](handleError(_0x3d9288,null));};exports[_0x85d5('0xb7')]=function(_0x2d8888,_0x243e68){return db[_0x85d5('0x34')][_0x85d5('0x2d')]({'where':{'id':_0x2d8888[_0x85d5('0x48')]['id']},'attributes':['id']})[_0x85d5('0x21')](handleEntityNotFound(_0x243e68,null))['then'](function(_0x5a5356){var _0x5ed29a=[];values=_0x5a5356[_0x85d5('0x42')];_0x5ed29a['push'](get_open_tabs(_0x85d5('0x41'),_0x5a5356[_0x85d5('0x42')]));_0x5ed29a[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x43'),_0x5a5356[_0x85d5('0x42')]));_0x5ed29a['push'](get_open_tabs('openchannel',_0x5a5356['dataValues']));_0x5ed29a['push'](get_open_tabs('whatsapp',_0x5a5356[_0x85d5('0x42')]));_0x5ed29a[_0x85d5('0x3d')](get_open_tabs(_0x85d5('0x44'),_0x5a5356['dataValues']));_0x5ed29a['push'](get_open_tabs(_0x85d5('0x52'),_0x5a5356[_0x85d5('0x42')]));return BPromise[_0x85d5('0x81')](_0x5ed29a);})['then'](function(_0x19aa8f){var _0x29001b=[];if(_0x19aa8f){for(var _0x538969=0x0;_0x538969=_0x1b07a7){_0x35eec3=_0x1b07a7;_0x541bc9=0xc8;}else{_0x541bc9=0xce;}_0x59cd8e[_0x1126('0x1d')](_0x541bc9);return _0x59cd8e[_0x1126('0x24')]('Content-Range',_0x38119d+'-'+_0x35eec3+'/'+_0x1b07a7)[_0x1126('0x1f')](_0x4b57ab);}return null;};}function saveUpdates(_0x23d2bc){return function(_0x4a334a){if(_0x4a334a){return _0x4a334a[_0x1126('0x25')](_0x23d2bc)['then'](function(_0xc62460){return _0xc62460;});}return null;};}function removeEntity(_0x4bd50b){return function(_0x771bb8){if(_0x771bb8){return _0x771bb8['destroy']()[_0x1126('0x13')](function(){var _0x5f2611=_0x771bb8['get']({'plain':!![]});if(_0x5f2611['role']===_0x1126('0x26'))return;var _0xa8906d=[{'name':_0x1126('0x27'),'value':'user','ignore':!![]},{'name':_0x1126('0x28'),'value':_0x1126('0x29'),'ignore':![]},{'name':'Telephones','value':_0x1126('0x2a'),'ignore':![]}];var _0x1e80aa=_(_0xa8906d)[_0x1126('0x2b')](_0x1126('0x2c'))['map']('value')[_0x1126('0x2d')]();if(_[_0x1126('0x2e')](_0x1e80aa,_0x5f2611[_0x1126('0x2f')])){return;}var _0x2c67eb=_['find'](_0xa8906d,[_0x1126('0x2d'),_0x5f2611[_0x1126('0x2f')]])[_0x1126('0x30')];return db[_0x1126('0x31')][_0x1126('0x32')]({'where':{'type':_0x2c67eb,'resourceId':_0x5f2611['id']}})['then'](function(){return _0x771bb8;});})[_0x1126('0x13')](function(){_0x4bd50b[_0x1126('0x1d')](0xcc)[_0x1126('0x1e')]();});}};}function handleEntityNotFound(_0x42e773){return function(_0x5c019d){if(!_0x5c019d){_0x42e773['sendStatus'](0x194);}return _0x5c019d;};}function handleError(_0x22827a,_0x31d07c){_0x31d07c=_0x31d07c||0x1f4;return function(_0x511e6b){logger[_0x1126('0x19')](_0x511e6b[_0x1126('0x33')]);if(_0x511e6b[_0x1126('0x30')]){delete _0x511e6b['name'];}_0x22827a['status'](_0x31d07c)[_0x1126('0x34')](_0x511e6b);};}exports[_0x1126('0x35')]=function(_0x3aa08f,_0x156554){var _0x4a202e={},_0x428d3d={'count':0x0,'rows':[]};var _0x4965d0=_(db[_0x1126('0x36')][_0x1126('0x37')])[_0x1126('0x38')](function(_0x1ea702){return{'name':_0x1ea702[_0x1126('0x39')],'type':_0x1ea702['type'][_0x1126('0x3a')]};})[_0x1126('0x2b')](function(_0x2939a9){return!_[_0x1126('0x2e')]([_0x1126('0x3b'),_0x1126('0x3c')],_0x2939a9[_0x1126('0x30')]);})['value']();_0x4a202e=qs[_0x1126('0x3d')](_0x4965d0,_0x3aa08f);var _0x154c28={'where':_0x4a202e[_0x1126('0x3e')]};return db[_0x1126('0x36')][_0x1126('0x23')](_0x154c28)['then'](function(_0x5bdf1a){_0x428d3d[_0x1126('0x23')]=_0x5bdf1a;if(_0x3aa08f[_0x1126('0x3f')][_0x1126('0x40')]){_0x4a202e[_0x1126('0x41')]=[{'all':!![]}];}if(!_[_0x1126('0x2e')](_0x4a202e[_0x1126('0x42')],'id')){_0x4a202e['attributes']['push']('id');}return db['User'][_0x1126('0x43')](_0x4a202e);})['then'](function(_0xf84005){_0x428d3d[_0x1126('0x44')]=_0xf84005;if(_0x3aa08f[_0x1126('0x3f')][_0x1126('0x45')]==='true'){var _0x4c94bb=[];for(var _0x353042=0x0;_0x353042<_0x428d3d[_0x1126('0x44')][_0x1126('0x46')];_0x353042++){_0x4c94bb['push'](get_open_tabs(_0x1126('0x47'),_0x428d3d['rows'][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs(_0x1126('0x49'),_0x428d3d[_0x1126('0x44')][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs(_0x1126('0x4a'),_0x428d3d[_0x1126('0x44')][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs('mail',_0x428d3d['rows'][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs(_0x1126('0x4b'),_0x428d3d['rows'][_0x353042][_0x1126('0x48')]));_0x4c94bb[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4d'),_0x428d3d[_0x1126('0x44')][_0x353042][_0x1126('0x48')]));}return BPromise['all'](_0x4c94bb)[_0x1126('0x13')](function(_0x512f60){return _0x428d3d;});}else{return _0x428d3d;}})['then'](respondWithFilteredResult(_0x156554,_0x4a202e))[_0x1126('0x1b')](handleError(_0x156554,null));};exports[_0x1126('0x4e')]=function(_0x575f79,_0x5f6d73){var _0x1ffa2b={'raw':![],'where':{'id':_0x575f79[_0x1126('0x4f')]['id']}},_0x518e0a={};_0x518e0a[_0x1126('0x50')]=_[_0x1126('0x51')](_['keys'](db[_0x1126('0x36')][_0x1126('0x37')]),[_0x1126('0x3b'),_0x1126('0x3c')]);_0x518e0a[_0x1126('0x3f')]=_[_0x1126('0x52')](_0x575f79[_0x1126('0x3f')]);_0x518e0a[_0x1126('0x53')]=_['intersection'](_0x518e0a[_0x1126('0x50')],_0x518e0a['query']);_0x1ffa2b[_0x1126('0x42')]=_[_0x1126('0x54')](_0x518e0a['model'],qs['fields'](_0x575f79[_0x1126('0x3f')][_0x1126('0x55')]));_0x1ffa2b[_0x1126('0x42')]=_0x1ffa2b['attributes'][_0x1126('0x46')]?_0x1ffa2b[_0x1126('0x42')]:_0x518e0a[_0x1126('0x50')];if(_0x575f79[_0x1126('0x3f')]['includeAll']){_0x1ffa2b[_0x1126('0x41')]=[{'all':!![]}];}_0x1ffa2b=_[_0x1126('0x56')]({},_0x1ffa2b,_0x575f79['options']);if(!_['includes'](_0x1ffa2b['attributes'],'id')){_0x1ffa2b['attributes'][_0x1126('0x4c')]('id');}return db[_0x1126('0x36')]['find'](_0x1ffa2b)[_0x1126('0x13')](handleEntityNotFound(_0x5f6d73,null))[_0x1126('0x13')](function(_0x38093e){var _0x38f521=[];values=_0x38093e;if(_0x575f79[_0x1126('0x3f')]['openTabs']===_0x1126('0x57')){_0x38f521[_0x1126('0x4c')](get_open_tabs('chat',_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs(_0x1126('0x49'),_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs('openchannel',_0x38093e[_0x1126('0x48')]));_0x38f521['push'](get_open_tabs(_0x1126('0x4d'),_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs('fax',_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs('mail',_0x38093e[_0x1126('0x48')]));return BPromise[_0x1126('0x58')](_0x38f521);}else{return values;}})[_0x1126('0x13')](function(_0x5a5340){return values;})[_0x1126('0x13')](respondWithResult(_0x5f6d73,null))[_0x1126('0x1b')](handleError(_0x5f6d73,null));};exports[_0x1126('0x25')]=function(_0x308ee4,_0x128c94){if(_0x308ee4[_0x1126('0x59')]['id']){delete _0x308ee4[_0x1126('0x59')]['id'];}delete _0x308ee4[_0x1126('0x59')]['role'];return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x308ee4[_0x1126('0x4f')]['id']}})[_0x1126('0x13')](handleEntityNotFound(_0x128c94,null))[_0x1126('0x13')](saveUpdates(_0x308ee4['body'],null))[_0x1126('0x13')](respondWithResult(_0x128c94,null))[_0x1126('0x1b')](handleError(_0x128c94,null));};exports['describe']=function(_0x3767e4,_0x5246aa){return db[_0x1126('0x36')][_0x1126('0x5b')]()['then'](respondWithResult(_0x5246aa,null))[_0x1126('0x1b')](handleError(_0x5246aa,null));};exports[_0x1126('0x5c')]=function(_0x375b76,_0x592960){return db[_0x1126('0x36')]['find']({'where':{'id':_0x375b76['params']['id']}})[_0x1126('0x13')](handleEntityNotFound(_0x592960,null))[_0x1126('0x13')](function(_0x130f26){if(_0x130f26){return _0x130f26[_0x1126('0x5c')](_0x375b76[_0x1126('0x59')][_0x1126('0x5d')],_[_0x1126('0x5e')](_0x375b76['body'],[_0x1126('0x5d'),'id'])||{});}})[_0x1126('0x13')](respondWithResult(_0x592960,null))[_0x1126('0x1b')](handleError(_0x592960,null));};function validateUser(_0xc39c36){return new BPromise(function(_0x3f87aa,_0x3cd788){if(_0xc39c36['internal'])return _0x3f87aa(_0xc39c36);return db['Setting'][_0x1126('0x5f')](0x1)[_0x1126('0x13')](function(_0x4bf2b3){if(_0x4bf2b3['securePassword'])authService['validatePasswordPattern'](_0xc39c36['password']);db[_0x1126('0x36')][_0x1126('0x60')](_0x1126('0x61'))['then'](function(_0x30e32f){if(_[_0x1126('0x62')](_0x30e32f)){_0xc39c36[_0x1126('0x61')]=_0x4bf2b3[_0x1126('0x63')]||0x1;return;}if(_[_0x1126('0x62')](_0x4bf2b3[_0x1126('0x63')])||_0x4bf2b3[_0x1126('0x63')]===_0x30e32f){_0xc39c36['internal']=_0x30e32f+0x1;return;}if(_0x4bf2b3[_0x1126('0x63')]>_0x30e32f){_0xc39c36[_0x1126('0x61')]=_0x4bf2b3[_0x1126('0x63')];return;}return db[_0x1126('0x64')][_0x1126('0x3f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0x1126('0x65')][_0x1126('0x66')]})['then'](function(_0x3bf25d){if(_0x3bf25d&&_0x3bf25d[_0x1126('0x46')]){for(var _0x366675=0x0,_0x6a41c0=_0x3bf25d[_0x1126('0x46')];_0x366675<_0x6a41c0&&_[_0x1126('0x62')](_0xc39c36[_0x1126('0x61')]);_0x366675++){if(_0x4bf2b3[_0x1126('0x63')]<=_0x3bf25d[_0x366675][_0x1126('0x67')]){_0xc39c36[_0x1126('0x61')]=_0x3bf25d[_0x366675][_0x1126('0x67')];}else if(_0x4bf2b3[_0x1126('0x63')]>_0x3bf25d[_0x366675][_0x1126('0x67')]&&_0x4bf2b3['min_internal']<=_0x3bf25d[_0x366675]['to']){_0xc39c36[_0x1126('0x61')]=_0x4bf2b3[_0x1126('0x63')];}}}if(_[_0x1126('0x62')](_0xc39c36['internal'])){_0xc39c36['internal']=_0x30e32f+0x1;}return _0x3f87aa(_0xc39c36);});});})[_0x1126('0x1b')](function(_0xa4e8d4){_0x3cd788(_0xa4e8d4);});});}function updateUser(_0x1998f2){return new BPromise(function(_0x3bfeb8,_0x51929e){try{if(_0x1998f2['voicemail']){_0x1998f2['mailbox']=_0x1998f2[_0x1126('0x61')];_0x1998f2[_0x1126('0x68')]={'mailbox':_0x1998f2[_0x1126('0x61')],'password':_0x1998f2[_0x1126('0x3b')],'fullname':_0x1998f2['fullname'],'email':_0x1998f2[_0x1126('0x69')]};}if(_0x1998f2['role']===_0x1126('0x29')){if(!_0x1998f2[_0x1126('0x6a')])_0x1998f2[_0x1126('0x6a')]=[_0x1126('0x6b'),_0x1126('0x6c'),_0x1126('0x6d'),_0x1126('0x6e'),'110',_0x1126('0x6f'),'105',_0x1126('0x70'),_0x1126('0x71'),'108',_0x1126('0x72'),_0x1126('0x73'),'111',_0x1126('0x74'),_0x1126('0x75')];}_0x3bfeb8(_0x1998f2);}catch(_0x4b1d04){_0x51929e(_0x4b1d04);}});}exports['create']=function(_0xb21659,_0xa27290){if(_0xb21659[_0x1126('0x76')]['role']==='agent')throw new Error('Unauthorized');if(_0xb21659[_0x1126('0x59')]['role']==='user'&&_0xb21659[_0x1126('0x76')]['role']!==_0x1126('0x26')){throw new Error(_0x1126('0x77'));}if(_0xb21659['body'][_0x1126('0x2f')]===_0x1126('0x26')&&_0xb21659[_0x1126('0x76')][_0x1126('0x2f')]!==_0x1126('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x1126('0x78')]([_0xb21659[_0x1126('0x59')]])['then'](function(){return validateUser(_0xb21659[_0x1126('0x59')]);})[_0x1126('0x13')](function(_0x2c0908){return updateUser(_0x2c0908)[_0x1126('0x13')](function(_0x2598a7){if(_0x2598a7[_0x1126('0x2f')]===_0x1126('0x26')){_0x2598a7[_0x1126('0x79')]=_0xb21659[_0x1126('0x76')][_0x1126('0x79')];delete _0x2598a7[_0x1126('0x7a')];}return _0x2598a7;});})[_0x1126('0x13')](function(_0x2010a9){return db[_0x1126('0x36')][_0x1126('0x7b')](_0x2010a9,{'include':[{'model':db[_0x1126('0x68')],'as':'VoiceMail'}]});})[_0x1126('0x13')](function(_0x20c91f){if(_0xb21659[_0x1126('0x59')][_0x1126('0x2f')]===_0x1126('0x76'))return _0x20c91f;if(_0xb21659['user'][_0x1126('0x2f')]!=='user')return _0x20c91f;return db['UserProfileSection'][_0x1126('0x5a')]({'where':{'name':_0x20c91f[_0x1126('0x2f')]==='agent'?'Agents':_0x1126('0x7c'),'userProfileId':_0xb21659[_0x1126('0x76')][_0x1126('0x7a')]},'raw':!![]})[_0x1126('0x13')](function(_0x1a60b9){if(!_0x1a60b9||_0x1a60b9[_0x1126('0x7d')]!=0x0)return _0x20c91f;return db[_0x1126('0x31')][_0x1126('0x7b')]({'name':_0x20c91f[_0x1126('0x30')],'resourceId':_0x20c91f['id'],'type':_0x1a60b9['name'],'sectionId':_0x1a60b9['id']},{})[_0x1126('0x13')](function(){return _0x20c91f;});})[_0x1126('0x1b')](function(_0x3178f5){logger[_0x1126('0x19')](_0x1126('0x7e'),_0x3178f5);throw _0x3178f5;});})[_0x1126('0x13')](respondWithResult(_0xa27290,0xc9))['catch'](handleError(_0xa27290,null));};exports[_0x1126('0x7f')]=function(_0x2cc4c8,_0x194b3c){var _0x37c8bb=_0x2cc4c8[_0x1126('0x59')];var _0x1796eb=[];if(_0x2cc4c8[_0x1126('0x76')][_0x1126('0x2f')]===_0x1126('0x29'))throw new Error(_0x1126('0x80'));if(_['some'](_0x37c8bb,['role',_0x1126('0x76')])&&_0x2cc4c8['user'][_0x1126('0x2f')]!=='admin'){throw new Error(_0x1126('0x77'));}if(_['some'](_0x37c8bb,[_0x1126('0x2f'),'admin'])&&_0x2cc4c8['user']['role']!==_0x1126('0x26')){throw new Error(_0x1126('0x81'));}return licenseUtil['checkUserLimits'](_0x37c8bb)['then'](function(){return validateUser(_0x37c8bb[0x0]);})[_0x1126('0x13')](function(){for(var _0xe2f82d=0x1;_0xe2f82d<_0x37c8bb[_0x1126('0x46')];_0xe2f82d++){var _0x5dfb8f=_0x37c8bb[_0xe2f82d-0x1]['internal'];if(!_0x37c8bb[_0xe2f82d][_0x1126('0x61')])_0x37c8bb[_0xe2f82d]['internal']=_0x5dfb8f+0x1;_0x1796eb[_0x1126('0x4c')](validateUser(_0x37c8bb[_0xe2f82d]));}return BPromise[_0x1126('0x58')](_0x1796eb);})[_0x1126('0x13')](function(){_0x1796eb=[];for(var _0x29922a=0x0;_0x29922a<_0x37c8bb[_0x1126('0x46')];_0x29922a++){_0x1796eb['push'](updateUser(_0x37c8bb[_0x29922a]));}return BPromise['all'](_0x1796eb);})[_0x1126('0x13')](function(){return BPromise[_0x1126('0x82')](_0x37c8bb,function(_0xfc9fb4){return db[_0x1126('0x36')][_0x1126('0x7b')](_0xfc9fb4,{'include':[{'model':db[_0x1126('0x68')],'as':_0x1126('0x68')}]})[_0x1126('0x13')](function(_0x324a37){_0xfc9fb4['id']=_0x324a37['id'];return _0xfc9fb4;});});})[_0x1126('0x13')](function(_0x1a6641){if(_0x2cc4c8['body'][_0x1126('0x2f')]==='user')return _0x1a6641;if(_0x2cc4c8[_0x1126('0x76')]['role']!==_0x1126('0x76'))return _0x1a6641;var _0x25a678=_[_0x1126('0x83')](_0x1a6641,function(_0x300253){return _0x300253['role']===_0x1126('0x29')||_0x300253[_0x1126('0x2f')]==='telephone';});if(!_0x25a678)return _0x1a6641;return db['UserProfileSection'][_0x1126('0x43')]({'where':{'name':{'$or':[_0x1126('0x28'),_0x1126('0x7c')]},'userProfileId':_0x2cc4c8['user'][_0x1126('0x7a')]},'raw':!![]})['then'](function(_0x144cb4){if(_[_0x1126('0x84')](_0x144cb4)||!_['some'](_0x144cb4,[_0x1126('0x7d'),0x0]))return _0x1a6641;_0x1796eb=[];var _0x315192=_(_0x144cb4)[_0x1126('0x38')](function(_0x34df7d){if(_0x34df7d[_0x1126('0x7d')]===0x1)return;return _0x34df7d['name']===_0x1126('0x28')?_0x1126('0x29'):_0x1126('0x2a');})['compact']()['value']();for(var _0x55b45e=0x0;_0x55b45e<_0x1a6641[_0x1126('0x46')];_0x55b45e++){if(!_[_0x1126('0x2e')](_0x315192,_0x1a6641[_0x55b45e][_0x1126('0x2f')]))return;var _0x2a1b22=_0x1a6641[_0x55b45e]['role']===_0x1126('0x29')?_0x1126('0x28'):_0x1126('0x7c');_0x1796eb[_0x1126('0x4c')](db[_0x1126('0x31')]['create']({'name':_0x1a6641[_0x55b45e][_0x1126('0x30')],'resourceId':_0x1a6641[_0x55b45e]['id'],'type':_0x2a1b22,'sectionId':_[_0x1126('0x5a')](_0x144cb4,['name',_0x2a1b22])['id']},{}));}return BPromise[_0x1126('0x58')](_0x1796eb);});})['then'](respondWithResult(_0x194b3c,0xc9))['catch'](handleError(_0x194b3c,null));};exports[_0x1126('0x85')]=function(_0x5e106e,_0x1e763){if(_0x5e106e[_0x1126('0x59')]['id']){delete _0x5e106e[_0x1126('0x59')]['id'];}return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x5e106e[_0x1126('0x4f')]['id']}})[_0x1126('0x13')](function(_0xdc07fc){if(!_0xdc07fc)return null;if(_0xdc07fc['id']===_0x5e106e[_0x1126('0x76')]['id']){if(!_0x5e106e['body'][_0x1126('0x86')]||!_0x5e106e[_0x1126('0x59')][_0x1126('0x87')]){throw new db[(_0x1126('0x88'))]['ValidationError'](_0x1126('0x89'));}if(!_0xdc07fc[_0x1126('0x8a')](_0x5e106e[_0x1126('0x59')][_0x1126('0x86')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x5e106e[_0x1126('0x59')]['oldPassword']===_0x5e106e[_0x1126('0x59')][_0x1126('0x87')]){throw new db['Sequelize']['ValidationError'](_0x1126('0x8b'));}}else if(_0x5e106e[_0x1126('0x76')]['role']===_0x1126('0x26')){if(!_0x5e106e[_0x1126('0x59')]['newPassword']){throw new db[(_0x1126('0x88'))]['ValidationError'](_0x1126('0x8c'));}}else if(_0x5e106e[_0x1126('0x76')][_0x1126('0x2f')]==='user'){if(!_0x5e106e[_0x1126('0x59')][_0x1126('0x87')]){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))](_0x1126('0x8c'));}if(_0xdc07fc[_0x1126('0x2f')]!==_0x1126('0x29')){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))](_0x1126('0x80'));}}else{throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))](_0x1126('0x80'));}return _0xdc07fc;})[_0x1126('0x13')](handleEntityNotFound(_0x1e763,null))[_0x1126('0x13')](function(_0xc4cc17){return db[_0x1126('0x8e')]['findOne']({'attributes':['id',_0x1126('0x8f'),_0x1126('0x90'),'passwordHistoryLimit']})['then'](function(_0xd6de57){if(_0xd6de57[_0x1126('0x8f')])authService[_0x1126('0x91')](_0x5e106e[_0x1126('0x59')]['newPassword']);if(!_0xd6de57[_0x1126('0x90')]||!_0xc4cc17[_0x1126('0x92')])return _0xc4cc17;authService['validatePasswordHistory'](_0x5e106e[_0x1126('0x59')]['newPassword'],_0xc4cc17[_0x1126('0x92')],_0xd6de57[_0x1126('0x93')]);return _0xc4cc17;})['then'](saveUpdates({'password':_0x5e106e['body'][_0x1126('0x87')],'passwordResetAt':_0x5e106e['user']['id']==_0x5e106e['params']['id']?moment():null,'previousPasswords':authService[_0x1126('0x94')](_0x5e106e[_0x1126('0x59')][_0x1126('0x87')],_0xc4cc17[_0x1126('0x92')])},null));})['then'](respondWithResult(_0x1e763,null))['catch'](handleError(_0x1e763,null));};exports['addQueues']=function(_0x207b77,_0x183bf8){var _0x52487b=_0x207b77[_0x1126('0x59')][_0x1126('0x95')];return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x207b77[_0x1126('0x4f')]['id']},'attributes':['id',_0x1126('0x30'),_0x1126('0x2f'),_0x1126('0x96'),_0x1126('0x97'),_0x1126('0x98'),_0x1126('0x99')]})['then'](handleEntityNotFound(_0x183bf8,null))[_0x1126('0x13')](function(_0x559430){if(_0x559430){if(!utils[_0x1126('0x9a')](_0x52487b)){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))]('Unknown\x20channel');}return _0x559430[_0x1126('0x9b')+_[_0x1126('0x9c')](_0x52487b[_0x1126('0x9d')]())+'Queues'](_0x207b77[_0x1126('0x59')][_0x1126('0x5d')],{'penalty':_0x207b77[_0x1126('0x59')][_0x1126('0x9e')]||0x0})[_0x1126('0x9f')](function(_0x589d0c){for(var _0x520371=0x0;_0x520371<_0x207b77[_0x1126('0x59')][_0x1126('0x5d')][_0x1126('0x46')];_0x520371+=0x1){var _0x2a7f87={'UserId':Number(_0x207b77[_0x1126('0x4f')]['id'])};_0x2a7f87[_[_0x1126('0x9c')](_0x52487b[_0x1126('0x9d')]())+_0x1126('0xa0')]=Number(_0x207b77[_0x1126('0x59')][_0x1126('0x5d')][_0x520371]);socket[_0x1126('0xa1')]('user'+_['capitalize'](_0x52487b[_0x1126('0x9d')]())+_0x1126('0xa2'),_0x2a7f87);}return _0x589d0c;})[_0x1126('0x13')](function(){if(_0x52487b==='voice'){return db['VoiceQueue'][_0x1126('0x43')]({'where':{'id':_0x207b77[_0x1126('0x59')][_0x1126('0x5d')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x1126('0x13')](function(_0x1cbd6c){var _0x5a28f9=_0x559430[_0x1126('0xa3')]({'plain':!![]});var _0x4411dc=[];if(_0x52487b===_0x1126('0xa4')&&_0x5a28f9[_0x1126('0x2f')]===_0x1126('0x29')&&_0x5a28f9['online']){for(var _0x346c68=0x0;_0x346c68<_0x1cbd6c[_0x1126('0x46')];_0x346c68+=0x1){_0x4411dc['push']({'membername':_0x5a28f9['name'],'UserId':_0x5a28f9['id'],'queue_name':_0x1cbd6c[_0x346c68]['name'],'VoiceQueueId':_0x1cbd6c[_0x346c68]['id'],'interface':_[_0x1126('0x62')](_0x5a28f9[_0x1126('0x99')])?util[_0x1126('0xa5')](_0x1126('0xa6'),_0x5a28f9[_0x1126('0x30')]):_0x5a28f9['interface'],'paused':_0x5a28f9[_0x1126('0x98')]||![],'penalty':_0x207b77['body'][_0x1126('0x9e')]||0x0});}return BPromise[_0x1126('0x82')](_0x4411dc,function(_0x4e4915){return db['UserVoiceQueueRt'][_0x1126('0xa7')](_0x4e4915);});}return _0x559430;});}})[_0x1126('0x13')](respondWithStatusCode(_0x183bf8,null))['catch'](handleError(_0x183bf8,null));};exports['removeQueues']=function(_0x8bd0dc,_0x278a51){var _0x19cd9d;return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x8bd0dc[_0x1126('0x4f')]['id']},'attributes':['id',_0x1126('0x30'),_0x1126('0x2f')]})[_0x1126('0x13')](handleEntityNotFound(_0x278a51,null))[_0x1126('0x13')](function(_0x47ab6e){if(_0x47ab6e){_0x19cd9d=_0x47ab6e;if(!_0x8bd0dc['query'][_0x1126('0x95')]||!utils[_0x1126('0x9a')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')])){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))]('Unknown\x20channel');}return _0x47ab6e['remove'+_[_0x1126('0x9c')](_0x8bd0dc['query']['channel'][_0x1126('0x9d')]())+_0x1126('0xa8')](_0x8bd0dc['query'][_0x1126('0x5d')]);}})[_0x1126('0x13')](function(_0x29c95f){if(_[_0x1126('0xa9')](_0x8bd0dc['query'][_0x1126('0x5d')])){for(var _0x2ea320=0x0;_0x2ea320<_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x5d')][_0x1126('0x46')];_0x2ea320+=0x1){var _0x232529={'UserId':Number(_0x8bd0dc[_0x1126('0x4f')]['id'])};_0x232529[_['capitalize'](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')][_0x1126('0x9d')]())+_0x1126('0xa0')]=Number(_0x8bd0dc['query'][_0x1126('0x5d')][_0x2ea320]);socket[_0x1126('0xa1')]('user'+_[_0x1126('0x9c')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')]['toLowerCase']())+_0x1126('0xaa'),_0x232529);}}else{var _0x232529={'UserId':Number(_0x8bd0dc[_0x1126('0x4f')]['id'])};_0x232529[_[_0x1126('0x9c')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')]['toLowerCase']())+_0x1126('0xa0')]=Number(_0x8bd0dc[_0x1126('0x3f')]['ids']);socket[_0x1126('0xa1')](_0x1126('0x76')+_[_0x1126('0x9c')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')][_0x1126('0x9d')]())+'Queue:remove',_0x232529);}return _0x29c95f;})['then'](function(){if(_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')]===_0x1126('0xa4')){return db[_0x1126('0xab')][_0x1126('0x32')]({'where':{'UserId':_0x8bd0dc[_0x1126('0x4f')]['id'],'VoiceQueueId':_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x5d')]},'individualHooks':!![]})[_0x1126('0x13')](function(){return _0x19cd9d;});}return _0x19cd9d;})[_0x1126('0x13')](respondWithStatusCode(_0x278a51,null))[_0x1126('0x1b')](handleError(_0x278a51,null));};exports[_0x1126('0xac')]=function(_0x13fdfd,_0x3aa4d5){_0x13fdfd[_0x1126('0x59')][_0x1126('0xad')]=_0x13fdfd[_0x1126('0xae')][_0x1126('0xaf')];return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x13fdfd[_0x1126('0x4f')]['id']}})[_0x1126('0x13')](handleEntityNotFound(_0x3aa4d5,null))[_0x1126('0x13')](saveUpdates(_0x13fdfd[_0x1126('0x59')],null))[_0x1126('0x13')](respondWithResult(_0x3aa4d5,null))['catch'](handleError(_0x3aa4d5,null));};exports[_0x1126('0xb0')]=function(_0x593386,_0x30f4d5){var _0x442f1c=path[_0x1126('0xb1')](config['root'],_0x1126('0xb2'));return db['User'][_0x1126('0x5a')]({'where':{'id':_0x593386[_0x1126('0x4f')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x1126('0x13')](handleEntityNotFound(_0x30f4d5,null))[_0x1126('0x13')](function(_0x2bea69){if(_0x2bea69){if(_[_0x1126('0x62')](_0x2bea69[_0x1126('0xad')])){return _0x30f4d5[_0x1126('0xb3')](_0x442f1c);}else{if(!fs[_0x1126('0xb4')](path[_0x1126('0xb1')](config[_0x1126('0xb5')],'server/files/images/',_0x2bea69[_0x1126('0xad')]))){return _0x30f4d5[_0x1126('0xb3')](_0x442f1c);}return _0x30f4d5[_0x1126('0xb3')](path[_0x1126('0xb1')](config['root'],'server/files/images/',_0x2bea69['userpic']));}}})['catch'](handleError(_0x30f4d5,null));};exports[_0x1126('0xb6')]=function(_0x4f62a1,_0x2fe211){return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x4f62a1[_0x1126('0x4f')]['id']},'attributes':['id']})[_0x1126('0x13')](handleEntityNotFound(_0x2fe211,null))[_0x1126('0x13')](function(_0x53b685){var _0x3f2e98=[];values=_0x53b685['dataValues'];_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x47'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x49'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4b'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4d'),_0x53b685['dataValues']));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4a'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0xb7'),_0x53b685[_0x1126('0x48')]));return BPromise[_0x1126('0x58')](_0x3f2e98);})['then'](function(_0x54a11c){var _0x5d7a22=[];if(_0x54a11c){for(var _0x1b77c0=0x0;_0x1b77c0=_0x4a9ea0['agents']){throw new Error(_0x627d('0x56'));}})['then'](function(){if(_0x5fa608){return db[_0x627d('0x41')]['destroy']({'where':{'membername':_0x5fa608[_0x627d('0x2b')]},'individualHooks':!![]});}})[_0x627d('0x12')](function(){if(_0x5fa608){return _0x5fa608['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x42fb1b){if(_0x5fa608){if(_0x42fb1b){var _0x550a68=[];_0x173a08=_0x42fb1b;if(_0x173a08[_0x627d('0x30')]){for(var _0x155012=0x0;_0x155012<_0x173a08[_0x627d('0x30')];_0x155012++){_0x550a68['push'](db[_0x627d('0x41')]['upsert']({'membername':_0x5fa608[_0x627d('0x2b')],'UserId':_0x5fa608['id'],'queue_name':_0x173a08[_0x155012][_0x627d('0x2b')],'VoiceQueueId':_0x173a08[_0x155012]['id'],'interface':_0xeec875,'paused':_0x5fa608['loginInPause']||![],'penalty':_0x173a08[_0x155012][_0x627d('0x57')]||0x0}));}return BPromise[_0x627d('0x4a')](_0x550a68);}}}})[_0x627d('0x12')](function(){if(_0x5fa608){return db[_0x627d('0x3a')][_0x627d('0x1e')]({'where':{'membername':_0x5fa608[_0x627d('0x2b')],'exitAt':null}});}})[_0x627d('0x12')](function(_0x29622f){if(_0x5fa608){if(_0x29622f&&_0x29622f['length']){var _0x4e01f2=[];_0x29622f[_0x627d('0x35')](function(_0x173f4b){_0x4e01f2[_0x627d('0x4d')](_0x173f4b[_0x627d('0x2e')]({'exitAt':moment()[_0x627d('0x31')](_0x627d('0x32'))}));});return BPromise[_0x627d('0x4a')](_0x4e01f2);}}})[_0x627d('0x12')](function(_0xad2329){if(_0x5fa608){var _0x3a953b=[];var _0x35ddbd=[];var _0x26c6b5=utils[_0x627d('0x34')]();var _0x32953f={'membername':_0x5fa608[_0x627d('0x2b')],'interface':_0xeec875,'enterAt':moment()[_0x627d('0x31')](_0x627d('0x32')),'role':_0x5fa608[_0x627d('0x2c')],'internal':_0x5fa608[_0x627d('0x51')]};_0x26c6b5[_0x627d('0x35')](function(_0xedccd9){_0x3a953b[_0x627d('0x4d')](_[_0x627d('0x58')]({'channel':_0xedccd9,'type':_0x627d('0x59'),'data1':_0x627d('0x5a'),'data2':_0xeec875},_0x32953f));if(_0x5fa608['loginInPause']){_0x35ddbd[_0x627d('0x4d')](_['merge']({'channel':_0xedccd9,'type':_0x627d('0x2f'),'data1':_0x627d('0x5b')},_0x32953f));}});return db[_0x627d('0x3a')][_0x627d('0x5c')](_0x3a953b['concat'](_0x35ddbd),{'individualHooks':!![]});}})['then'](function(){if(_0x5fa608){return _0x5fa608[_0x627d('0x2e')]({'online':!![],'lastLoginAt':moment()[_0x627d('0x31')](_0x627d('0x32')),'voicePause':_0x5fa608[_0x627d('0x52')]||![],'mailPause':_0x5fa608[_0x627d('0x52')]||![],'chatPause':_0x5fa608[_0x627d('0x52')]||![],'faxPause':_0x5fa608[_0x627d('0x52')]||![],'smsPause':_0x5fa608['loginInPause']||![],'openchannelPause':_0x5fa608[_0x627d('0x52')]||![],'pauseType':_0x5fa608[_0x627d('0x52')]?_0x627d('0x5b'):null,'lastPauseAt':moment()[_0x627d('0x31')](_0x627d('0x32')),'interface':_0xeec875});}})['then'](function(_0x23e0d2){_0x47e4b9(_0x23e0d2);})[_0x627d('0x1b')](function(_0xaff6b0){_0x4257b1(_0x331154[_0x627d('0x18')](0x1f4,_0xaff6b0['message']));});});}; \ No newline at end of file +var _0x6d6a=['PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','voice','system','mail','chat','openchannel','whatsapp','set','%s%s','Pause','LogoutUser','all','LoginUser','phone','loginInPause','count','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','LOGIN','callysquare','merge','concat','LOGININPAUSE','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./user.socket','register','request','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','User','findAll','options','raw','where','limit','include','map','model','attributes','then','GetUser','debug','catch','ShowUser','PauseUser','find','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport'];(function(_0x21f922,_0x51d445){var _0x3801c3=function(_0x1d4ac5){while(--_0x1d4ac5){_0x21f922['push'](_0x21f922['shift']());}};_0x3801c3(++_0x51d445);}(_0x6d6a,0x85));var _0xa6d6=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x6d6a[_0x1fcaf1];return _0x55f464;};'use strict';var _=require(_0xa6d6('0x0'));var util=require(_0xa6d6('0x1'));var moment=require(_0xa6d6('0x2'));var BPromise=require(_0xa6d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6d6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa6d6('0x5'));var config=require(_0xa6d6('0x6'));var jayson=require(_0xa6d6('0x7'));var client=jayson[_0xa6d6('0x8')][_0xa6d6('0x9')]({'port':0x232a});config[_0xa6d6('0xa')]=_[_0xa6d6('0xb')](config[_0xa6d6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa6d6('0xc'))(new Redis(config[_0xa6d6('0xa')]));require(_0xa6d6('0xd'))[_0xa6d6('0xe')](socket);function respondWithRpcPromise(_0x4cf8ae,_0xc90339,_0x47e237){return new BPromise(function(_0x121da1,_0x39733f){return client[_0xa6d6('0xf')](_0x4cf8ae,_0x47e237)['then'](function(_0x2701f5){logger['info'](_0xa6d6('0x10'),_0xc90339,_0xa6d6('0x11'));logger['debug'](_0xa6d6('0x12'),_0xc90339,_0xa6d6('0x11'),JSON[_0xa6d6('0x13')](_0x2701f5));if(_0x2701f5[_0xa6d6('0x14')]){if(_0x2701f5['error'][_0xa6d6('0x15')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0xc90339,_0x2701f5[_0xa6d6('0x14')][_0xa6d6('0x16')]);return _0x39733f(_0x2701f5[_0xa6d6('0x14')][_0xa6d6('0x16')]);}logger[_0xa6d6('0x14')](_0xa6d6('0x10'),_0xc90339,_0x2701f5[_0xa6d6('0x14')][_0xa6d6('0x16')]);return _0x121da1(_0x2701f5[_0xa6d6('0x14')][_0xa6d6('0x16')]);}else{logger[_0xa6d6('0x17')](_0xa6d6('0x10'),_0xc90339,_0xa6d6('0x11'));_0x121da1(_0x2701f5[_0xa6d6('0x18')][_0xa6d6('0x16')]);}})['catch'](function(_0x10ff3a){logger[_0xa6d6('0x14')](_0xa6d6('0x10'),_0xc90339,_0x10ff3a);_0x39733f(_0x10ff3a);});});}exports['GetUser']=function(_0x2ac56c){var _0x3b06a9=this;return new Promise(function(_0x4ba072,_0x31d455){return db[_0xa6d6('0x19')][_0xa6d6('0x1a')]({'raw':_0x2ac56c[_0xa6d6('0x1b')]?_0x2ac56c[_0xa6d6('0x1b')][_0xa6d6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ac56c[_0xa6d6('0x1b')]?_0x2ac56c[_0xa6d6('0x1b')][_0xa6d6('0x1d')]||null:null,'attributes':_0x2ac56c['options']?_0x2ac56c[_0xa6d6('0x1b')]['attributes']||null:null,'limit':_0x2ac56c[_0xa6d6('0x1b')]?_0x2ac56c['options'][_0xa6d6('0x1e')]||null:null,'include':_0x2ac56c[_0xa6d6('0x1b')]?_0x2ac56c[_0xa6d6('0x1b')][_0xa6d6('0x1f')]?_[_0xa6d6('0x20')](_0x2ac56c['options'][_0xa6d6('0x1f')],function(_0x2ef4ef){return{'model':db[_0x2ef4ef[_0xa6d6('0x21')]],'as':_0x2ef4ef['as'],'attributes':_0x2ef4ef[_0xa6d6('0x22')],'include':_0x2ef4ef['include']?_['map'](_0x2ef4ef[_0xa6d6('0x1f')],function(_0x7b99dc){return{'model':db[_0x7b99dc[_0xa6d6('0x21')]],'as':_0x7b99dc['as'],'attributes':_0x7b99dc[_0xa6d6('0x22')],'include':_0x7b99dc[_0xa6d6('0x1f')]?_[_0xa6d6('0x20')](_0x7b99dc[_0xa6d6('0x1f')],function(_0x2ad2b1){return{'model':db[_0x2ad2b1[_0xa6d6('0x21')]],'as':_0x2ad2b1['as'],'attributes':_0x2ad2b1[_0xa6d6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa6d6('0x23')](function(_0x2de443){logger['info'](_0xa6d6('0x24'),_0x2ac56c);logger[_0xa6d6('0x25')](_0xa6d6('0x24'),_0x2ac56c,JSON['stringify'](_0x2de443));_0x4ba072(_0x2de443);})[_0xa6d6('0x26')](function(_0x106c49){logger[_0xa6d6('0x14')](_0xa6d6('0x24'),_0x106c49[_0xa6d6('0x16')],_0x2ac56c);_0x31d455(_0x3b06a9['error'](0x1f4,_0x106c49['message']));});});};exports[_0xa6d6('0x27')]=function(_0x4b8417){var _0x2fd2f3=this;return new Promise(function(_0x3e95b8,_0x29a624){return db[_0xa6d6('0x19')]['find']({'raw':_0x4b8417['options']?_0x4b8417[_0xa6d6('0x1b')][_0xa6d6('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b8417[_0xa6d6('0x1b')]?_0x4b8417[_0xa6d6('0x1b')][_0xa6d6('0x1d')]||null:null,'attributes':_0x4b8417[_0xa6d6('0x1b')]?_0x4b8417['options'][_0xa6d6('0x22')]||null:null,'include':_0x4b8417[_0xa6d6('0x1b')]?_0x4b8417[_0xa6d6('0x1b')][_0xa6d6('0x1f')]?_[_0xa6d6('0x20')](_0x4b8417[_0xa6d6('0x1b')]['include'],function(_0x51e3ab){return{'model':db[_0x51e3ab[_0xa6d6('0x21')]],'as':_0x51e3ab['as'],'attributes':_0x51e3ab['attributes'],'include':_0x51e3ab['include']?_['map'](_0x51e3ab['include'],function(_0x189292){return{'model':db[_0x189292[_0xa6d6('0x21')]],'as':_0x189292['as'],'attributes':_0x189292[_0xa6d6('0x22')],'include':_0x189292[_0xa6d6('0x1f')]?_[_0xa6d6('0x20')](_0x189292[_0xa6d6('0x1f')],function(_0x104a14){return{'model':db[_0x104a14[_0xa6d6('0x21')]],'as':_0x104a14['as'],'attributes':_0x104a14[_0xa6d6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa6d6('0x23')](function(_0x392ef6){logger[_0xa6d6('0x17')]('ShowUser',_0x4b8417);logger['debug'](_0xa6d6('0x27'),_0x4b8417,JSON['stringify'](_0x392ef6));_0x3e95b8(_0x392ef6);})['catch'](function(_0x58497c){logger[_0xa6d6('0x14')]('ShowUser',_0x58497c[_0xa6d6('0x16')],_0x4b8417);_0x29a624(_0x2fd2f3[_0xa6d6('0x14')](0x1f4,_0x58497c[_0xa6d6('0x16')]));});});};exports[_0xa6d6('0x28')]=function(_0x2e8aff){var _0x56f247=this;return new Promise(function(_0x5a909a,_0x11f7a6){var _0x210e6c;return db[_0xa6d6('0x19')][_0xa6d6('0x29')]({'where':_0x2e8aff[_0xa6d6('0x1b')][_0xa6d6('0x1d')]||{},'attributes':['id',_0xa6d6('0x2a'),_0xa6d6('0x2b'),_0xa6d6('0x2c'),_0xa6d6('0x2d')]})[_0xa6d6('0x23')](function(_0xc2b1db){if(_0xc2b1db){_0x210e6c=_0xc2b1db;return db[_0xa6d6('0x2e')][_0xa6d6('0x2f')]({'paused':0x1},{'where':{'UserId':_0x210e6c['id']},'individualHooks':!![]});}})['then'](function(){if(_0x210e6c){return db[_0xa6d6('0x30')]['findAll']({'where':{'membername':_0x210e6c[_0xa6d6('0x2a')],'type':_0xa6d6('0x31'),'exitAt':null}});}})[_0xa6d6('0x23')](function(_0x36b356){if(_0x210e6c){if(_0x36b356&&_0x36b356[_0xa6d6('0x32')]){var _0x42683e=moment()[_0xa6d6('0x33')](_0xa6d6('0x34'));for(var _0x461134=0x0,_0x3bf093=_0x36b356[_0xa6d6('0x32')];_0x461134<_0x3bf093;_0x461134++){_0x36b356[_0x461134][_0xa6d6('0x35')]({'exitAt':_0x42683e});}}}})[_0xa6d6('0x23')](function(){if(_0x210e6c){var _0x190909=[];var _0x292deb=utils[_0xa6d6('0x36')]();_0x292deb[_0xa6d6('0x37')](function(_0x7b3d99){_0x190909[_0xa6d6('0x38')]({'channel':_0x7b3d99,'membername':_0x210e6c[_0xa6d6('0x2a')],'interface':_[_0xa6d6('0x39')](_0x210e6c[_0xa6d6('0x2d')])?util[_0xa6d6('0x33')](_0xa6d6('0x3a'),_0x210e6c[_0xa6d6('0x2a')]):_0x210e6c[_0xa6d6('0x2d')],'type':_0xa6d6('0x31'),'enterAt':moment()[_0xa6d6('0x33')](_0xa6d6('0x34')),'data1':_0x2e8aff[_0xa6d6('0x3b')][_0xa6d6('0x3c')]||_0xa6d6('0x3d'),'role':_0x210e6c[_0xa6d6('0x2b')],'internal':_0x210e6c[_0xa6d6('0x2c')],'uniqueid':_0x2e8aff['body']['uniqueid']||null});});return db[_0xa6d6('0x30')][_0xa6d6('0x3e')](_0x190909,{'individualHooks':!![]});}})[_0xa6d6('0x23')](function(){if(_0x210e6c){return _0x210e6c[_0xa6d6('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2e8aff[_0xa6d6('0x3b')]['type']||_0xa6d6('0x3d'),'lastPauseAt':moment()['format'](_0xa6d6('0x34'))});}})[_0xa6d6('0x23')](function(_0x100f9f){_0x5a909a(_0x100f9f);})[_0xa6d6('0x26')](function(_0x908a2c){_0x11f7a6(_0x56f247[_0xa6d6('0x14')](0x1f4,_0x908a2c[_0xa6d6('0x16')]));});});};exports[_0xa6d6('0x3f')]=function(_0x1135f6){var _0x18a24c=this;return new Promise(function(_0x5f5384,_0x1ddeb6){var _0x25d931;return db['User'][_0xa6d6('0x40')]({'where':_0x1135f6[_0xa6d6('0x1b')][_0xa6d6('0x1d')]||{},'attributes':['id',_0xa6d6('0x2a')]})[_0xa6d6('0x23')](function(_0x2bee19){if(_0x2bee19){_0x25d931=_0x2bee19;if(_0x1135f6['body'][_0xa6d6('0x41')]&&!utils[_0xa6d6('0x42')](_0x1135f6[_0xa6d6('0x3b')][_0xa6d6('0x41')])){throw new Error('Unknown\x20channel');}switch(_0x1135f6[_0xa6d6('0x3b')][_0xa6d6('0x41')]){case _0xa6d6('0x43'):return db[_0xa6d6('0x2e')][_0xa6d6('0x2f')]({'paused':0x0},{'where':{'UserId':_0x25d931['id']}})[_0xa6d6('0x23')](function(){return db['MemberReport'][_0xa6d6('0x29')]({'where':{'channel':_0x1135f6[_0xa6d6('0x3b')][_0xa6d6('0x41')],'membername':_0x25d931[_0xa6d6('0x2a')],'type':_0xa6d6('0x31'),'exitAt':null}});})[_0xa6d6('0x23')](function(_0x429af1){if(_0x429af1){return _0x429af1['update']({'exitAt':moment()[_0xa6d6('0x33')](_0xa6d6('0x34')),'data2':_0xa6d6('0x44')},{'individualHooks':!![]});}return null;})[_0xa6d6('0x23')](function(){return _0x25d931[_0xa6d6('0x2f')]({'voicePause':![]});});case _0xa6d6('0x45'):case _0xa6d6('0x46'):case'fax':case'sms':case _0xa6d6('0x47'):case _0xa6d6('0x48'):return db[_0xa6d6('0x30')][_0xa6d6('0x29')]({'where':{'channel':_0x1135f6['body'][_0xa6d6('0x41')],'membername':_0x25d931[_0xa6d6('0x2a')],'type':_0xa6d6('0x31'),'exitAt':null}})[_0xa6d6('0x23')](function(_0x1aadcc){return _0x1aadcc[_0xa6d6('0x2f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0xa6d6('0x23')](function(){var _0x5dcc39={};_[_0xa6d6('0x49')](_0x5dcc39,util[_0xa6d6('0x33')](_0xa6d6('0x4a'),_0x1135f6[_0xa6d6('0x3b')][_0xa6d6('0x41')],_0xa6d6('0x4b')),![]);return _0x25d931[_0xa6d6('0x2f')](_0x5dcc39);});default:return db[_0xa6d6('0x2e')][_0xa6d6('0x2f')]({'paused':0x0},{'where':{'UserId':_0x25d931['id']}})['then'](function(){return db[_0xa6d6('0x30')][_0xa6d6('0x1a')]({'where':{'membername':_0x25d931[_0xa6d6('0x2a')],'type':_0xa6d6('0x31'),'exitAt':null}});})['then'](function(_0x45ce4c){var _0x22f25d=[];_0x45ce4c[_0xa6d6('0x37')](function(_0x3e23c7){_0x22f25d[_0xa6d6('0x38')](_0x3e23c7[_0xa6d6('0x2f')]({'exitAt':moment()[_0xa6d6('0x33')](_0xa6d6('0x34')),'data2':_0xa6d6('0x44')}));});return BPromise['all'](_0x22f25d);})[_0xa6d6('0x23')](function(){return _0x25d931['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xa6d6('0x23')](function(_0x582d98){_0x5f5384(_0x582d98);})[_0xa6d6('0x26')](function(_0x25b142){_0x1ddeb6(_0x18a24c[_0xa6d6('0x14')](0x1f4,_0x25b142[_0xa6d6('0x16')]));});});};exports[_0xa6d6('0x4c')]=function(_0x1f58cb){var _0x8b7cd5=this;return new Promise(function(_0xb25d35,_0x29a9ac){var _0x124cd7;return db[_0xa6d6('0x19')][_0xa6d6('0x40')]({'where':_0x1f58cb[_0xa6d6('0x1b')][_0xa6d6('0x1d')]||{},'attributes':['id','name']})[_0xa6d6('0x23')](function(_0x5b2507){if(_0x5b2507){_0x124cd7=_0x5b2507;return db[_0xa6d6('0x2e')]['destroy']({'where':{'membername':_0x124cd7[_0xa6d6('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x124cd7){return db['MemberReport']['findAll']({'where':{'membername':_0x124cd7['name'],'exitAt':null}});}})[_0xa6d6('0x23')](function(_0x55bf85){if(_0x124cd7){if(_0x55bf85&&_0x55bf85['length']){var _0x28032a=[];_0x55bf85['forEach'](function(_0x293f98){_0x28032a['push'](_0x293f98[_0xa6d6('0x2f')]({'exitAt':moment()[_0xa6d6('0x33')](_0xa6d6('0x34'))}));});return BPromise[_0xa6d6('0x4d')](_0x28032a);}}})['then'](function(){if(_0x124cd7){return _0x124cd7[_0xa6d6('0x2f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x18316a){_0xb25d35(_0x18316a);})['catch'](function(_0x34e47b){_0x29a9ac(_0x8b7cd5[_0xa6d6('0x14')](0x1f4,_0x34e47b['message']));});});};exports[_0xa6d6('0x4e')]=function(_0x4a571a){var _0x5d53c6=this;return new Promise(function(_0x50bc6c,_0x5a70f1){var _0x39b490;var _0x24d682;var _0x197205;var _0x5f0119;return db['User'][_0xa6d6('0x40')]({'where':_0x4a571a['options']['where']||{},'attributes':['id',_0xa6d6('0x2a'),_0xa6d6('0x2b'),'mobile',_0xa6d6('0x4f'),'internal',_0xa6d6('0x50'),'interface']})[_0xa6d6('0x23')](function(_0x48bcb1){if(_0x48bcb1){_0x39b490=_0x48bcb1;_0x5f0119=_0x4a571a[_0xa6d6('0x3b')][_0xa6d6('0x2d')]?_0x4a571a[_0xa6d6('0x3b')][_0xa6d6('0x2d')]:util[_0xa6d6('0x33')](_0xa6d6('0x3a'),_0x39b490[_0xa6d6('0x2a')]);return db['User'][_0xa6d6('0x51')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x39b490['id']}}});}})[_0xa6d6('0x23')](function(_0x5ce7d5){if(_0x5ce7d5){_0x197205=_0x5ce7d5;return require(_0xa6d6('0x52'))['getLicense']();}})[_0xa6d6('0x23')](function(_0x33062f){if(_0x33062f&&_0x33062f[_0xa6d6('0x53')]&&_0x197205>=_0x33062f[_0xa6d6('0x53')]){throw new Error(_0xa6d6('0x54'));}})[_0xa6d6('0x23')](function(){if(_0x39b490){return db[_0xa6d6('0x2e')]['destroy']({'where':{'membername':_0x39b490[_0xa6d6('0x2a')]},'individualHooks':!![]});}})[_0xa6d6('0x23')](function(){if(_0x39b490){return _0x39b490['getVoiceQueues']({'raw':!![]});}})['then'](function(_0xe33ecb){if(_0x39b490){if(_0xe33ecb){var _0x28f7fc=[];_0x24d682=_0xe33ecb;if(_0x24d682[_0xa6d6('0x32')]){for(var _0x440e97=0x0;_0x440e97<_0x24d682[_0xa6d6('0x32')];_0x440e97++){_0x28f7fc[_0xa6d6('0x38')](db['UserVoiceQueueRt'][_0xa6d6('0x55')]({'membername':_0x39b490[_0xa6d6('0x2a')],'UserId':_0x39b490['id'],'queue_name':_0x24d682[_0x440e97]['name'],'VoiceQueueId':_0x24d682[_0x440e97]['id'],'interface':_0x5f0119,'paused':_0x39b490[_0xa6d6('0x50')]||![],'penalty':_0x24d682[_0x440e97]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xa6d6('0x4d')](_0x28f7fc);}}}})[_0xa6d6('0x23')](function(){if(_0x39b490){return db[_0xa6d6('0x30')][_0xa6d6('0x1a')]({'where':{'membername':_0x39b490['name'],'exitAt':null}});}})[_0xa6d6('0x23')](function(_0x137c8a){if(_0x39b490){if(_0x137c8a&&_0x137c8a['length']){var _0x42508d=[];_0x137c8a[_0xa6d6('0x37')](function(_0x16d7bd){_0x42508d[_0xa6d6('0x38')](_0x16d7bd['update']({'exitAt':moment()[_0xa6d6('0x33')](_0xa6d6('0x34'))}));});return BPromise[_0xa6d6('0x4d')](_0x42508d);}}})[_0xa6d6('0x23')](function(_0x3b668a){if(_0x39b490){var _0x5b3002=[];var _0x58dd3e=[];var _0x4d7599=utils['getChannels']();var _0x1b60f2={'membername':_0x39b490[_0xa6d6('0x2a')],'interface':_0x5f0119,'enterAt':moment()[_0xa6d6('0x33')](_0xa6d6('0x34')),'role':_0x39b490['role'],'internal':_0x39b490[_0xa6d6('0x2c')]};_0x4d7599['forEach'](function(_0x198390){_0x5b3002[_0xa6d6('0x38')](_['merge']({'channel':_0x198390,'type':_0xa6d6('0x56'),'data1':_0xa6d6('0x57'),'data2':_0x5f0119},_0x1b60f2));if(_0x39b490[_0xa6d6('0x50')]){_0x58dd3e[_0xa6d6('0x38')](_[_0xa6d6('0x58')]({'channel':_0x198390,'type':_0xa6d6('0x31'),'data1':'LOGININPAUSE'},_0x1b60f2));}});return db[_0xa6d6('0x30')][_0xa6d6('0x3e')](_0x5b3002[_0xa6d6('0x59')](_0x58dd3e),{'individualHooks':!![]});}})['then'](function(){if(_0x39b490){return _0x39b490[_0xa6d6('0x2f')]({'online':!![],'lastLoginAt':moment()[_0xa6d6('0x33')](_0xa6d6('0x34')),'voicePause':_0x39b490['loginInPause']||![],'mailPause':_0x39b490['loginInPause']||![],'chatPause':_0x39b490['loginInPause']||![],'faxPause':_0x39b490[_0xa6d6('0x50')]||![],'smsPause':_0x39b490[_0xa6d6('0x50')]||![],'openchannelPause':_0x39b490['loginInPause']||![],'pauseType':_0x39b490[_0xa6d6('0x50')]?_0xa6d6('0x5a'):null,'lastPauseAt':moment()[_0xa6d6('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5f0119});}})[_0xa6d6('0x23')](function(_0x242492){_0x50bc6c(_0x242492);})[_0xa6d6('0x26')](function(_0x26af5a){_0x5a70f1(_0x5d53c6[_0xa6d6('0x14')](0x1f4,_0x26af5a[_0xa6d6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 508e018..47127ba 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 _0x0cf7=['emit','removeListener','register','length','user:','remove','update'];(function(_0x39e827,_0x598748){var _0x181b6f=function(_0x56bbc9){while(--_0x56bbc9){_0x39e827['push'](_0x39e827['shift']());}};_0x181b6f(++_0x598748);}(_0x0cf7,0x101));var _0x70cf=function(_0x5b8371,_0xe2ae1a){_0x5b8371=_0x5b8371-0x0;var _0x50dec2=_0x0cf7[_0x5b8371];return _0x50dec2;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x70cf('0x0'),_0x70cf('0x1')];function createListener(_0x4cdd10,_0x40f241){return function(_0x3a815c){_0x40f241[_0x70cf('0x2')](_0x4cdd10,_0x3a815c);};}function removeListener(_0x18632c,_0x328362){return function(){UserEvents[_0x70cf('0x3')](_0x18632c,_0x328362);};}exports[_0x70cf('0x4')]=function(_0x27e13d){for(var _0x41e5f5=0x0,_0x451021=events[_0x70cf('0x5')];_0x41e5f5<_0x451021;_0x41e5f5++){var _0x2756eb=events[_0x41e5f5];var _0x5864d9=createListener(_0x70cf('0x6')+_0x2756eb,_0x27e13d);UserEvents['on'](_0x2756eb,_0x5864d9);}}; \ No newline at end of file +var _0x288c=['update','emit','removeListener','register','user:','./user.events','save','remove'];(function(_0x45321d,_0x58eb4f){var _0x1a999a=function(_0x3195c1){while(--_0x3195c1){_0x45321d['push'](_0x45321d['shift']());}};_0x1a999a(++_0x58eb4f);}(_0x288c,0x1ad));var _0xc288=function(_0xfbac0b,_0x20b38b){_0xfbac0b=_0xfbac0b-0x0;var _0x14e054=_0x288c[_0xfbac0b];return _0x14e054;};'use strict';var UserEvents=require(_0xc288('0x0'));var events=[_0xc288('0x1'),_0xc288('0x2'),_0xc288('0x3')];function createListener(_0x169e93,_0x2c3c36){return function(_0x4a3939){_0x2c3c36[_0xc288('0x4')](_0x169e93,_0x4a3939);};}function removeListener(_0xae8863,_0xf2a916){return function(){UserEvents[_0xc288('0x5')](_0xae8863,_0xf2a916);};}exports[_0xc288('0x6')]=function(_0x24dc74){for(var _0x3c36b4=0x0,_0x2ff81a=events['length'];_0x3c36b4<_0x2ff81a;_0x3c36b4++){var _0x10f04e=events[_0x3c36b4];var _0x526749=createListener(_0xc288('0x7')+_0x10f04e,_0x24dc74);UserEvents['on'](_0x10f04e,_0x526749);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index e6bc2b9..8332a70 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x32c57d,_0x4b455a){var _0x353d7f=function(_0x15b980){while(--_0x15b980){_0x32c57d['push'](_0x32c57d['shift']());}};_0x353d7f(++_0x4b455a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3427bd,_0x3e0d03){var _0x12038e=function(_0x1e666f){while(--_0x1e666f){_0x3427bd['push'](_0x3427bd['shift']());}};_0x12038e(++_0x3e0d03);}(_0xedd9,0xfc));var _0x9edd=function(_0x54fd02,_0x3cf8c3){_0x54fd02=_0x54fd02-0x0;var _0xc294ef=_0xedd9[_0x54fd02];return _0xc294ef;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 951a338..bad5e4b 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 _0xa467=['sequelize','exports','INTEGER'];(function(_0x5233d4,_0x323ed8){var _0x1b7f4f=function(_0x1b41b4){while(--_0x1b41b4){_0x5233d4['push'](_0x5233d4['shift']());}};_0x1b7f4f(++_0x323ed8);}(_0xa467,0xde));var _0x7a46=function(_0x2f5dc4,_0x31d0d2){_0x2f5dc4=_0x2f5dc4-0x0;var _0x3f0872=_0xa467[_0x2f5dc4];return _0x3f0872;};'use strict';var Sequelize=require(_0x7a46('0x0'));module[_0x7a46('0x1')]={'penalty':{'type':Sequelize[_0x7a46('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x41d7=['exports','INTEGER'];(function(_0x523924,_0x143357){var _0x2bdae8=function(_0x440612){while(--_0x440612){_0x523924['push'](_0x523924['shift']());}};_0x2bdae8(++_0x143357);}(_0x41d7,0x194));var _0x741d=function(_0x4ae733,_0x1add12){_0x4ae733=_0x4ae733-0x0;var _0xeac400=_0x41d7[_0x4ae733];return _0xeac400;};'use strict';var Sequelize=require('sequelize');module[_0x741d('0x0')]={'penalty':{'type':Sequelize[_0x741d('0x1')],'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 0ee3be1..5952612 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 _0xe3bb=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x596284,_0x1cd02b){var _0x5313c6=function(_0x77db49){while(--_0x77db49){_0x596284['push'](_0x596284['shift']());}};_0x5313c6(++_0x1cd02b);}(_0xe3bb,0x15a));var _0xbe3b=function(_0x43379c,_0x271d36){_0x43379c=_0x43379c-0x0;var _0x495648=_0xe3bb[_0x43379c];return _0x495648;};'use strict';var _=require('lodash');var util=require(_0xbe3b('0x0'));var logger=require(_0xbe3b('0x1'))(_0xbe3b('0x2'));var moment=require(_0xbe3b('0x3'));var BPromise=require(_0xbe3b('0x4'));var rp=require(_0xbe3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe3b('0x6'));module[_0xbe3b('0x7')]=function(_0x29b71b,_0x1abac5){return _0x29b71b[_0xbe3b('0x8')](_0xbe3b('0x9'),attributes,{'tableName':_0xbe3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3498=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x206588,_0x5aac5d){var _0x5df8e1=function(_0x5dc28f){while(--_0x5dc28f){_0x206588['push'](_0x206588['shift']());}};_0x5df8e1(++_0x5aac5d);}(_0x3498,0x90));var _0x8349=function(_0x19c788,_0x2cf31d){_0x19c788=_0x19c788-0x0;var _0x364e70=_0x3498[_0x19c788];return _0x364e70;};'use strict';var _=require(_0x8349('0x0'));var util=require(_0x8349('0x1'));var logger=require(_0x8349('0x2'))(_0x8349('0x3'));var moment=require(_0x8349('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8349('0x5'));var rimraf=require('rimraf');var config=require(_0x8349('0x6'));var attributes=require(_0x8349('0x7'));module[_0x8349('0x8')]=function(_0x331cf4,_0x15b828){return _0x331cf4[_0x8349('0x9')](_0x8349('0xa'),attributes,{'tableName':_0x8349('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index dedbfc7..2d0ff83 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 _0x6dfe=['moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x581a9b,_0x1cf0c4){var _0x50f763=function(_0x91a31e){while(--_0x91a31e){_0x581a9b['push'](_0x581a9b['shift']());}};_0x50f763(++_0x1cf0c4);}(_0x6dfe,0x1a3));var _0xe6df=function(_0x1b56a2,_0x1228a6){_0x1b56a2=_0x1b56a2-0x0;var _0x4a11da=_0x6dfe[_0x1b56a2];return _0x4a11da;};'use strict';var _=require('lodash');var util=require(_0xe6df('0x0'));var moment=require(_0xe6df('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6df('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6df('0x3'));var logger=require(_0xe6df('0x4'))('rpc');var config=require(_0xe6df('0x5'));var jayson=require(_0xe6df('0x6'));var client=jayson[_0xe6df('0x7')][_0xe6df('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x322401,_0x4767d9,_0x584cd8){return new BPromise(function(_0x145886,_0x176821){return client[_0xe6df('0x9')](_0x322401,_0x584cd8)[_0xe6df('0xa')](function(_0x56ad08){logger[_0xe6df('0xb')](_0xe6df('0xc'),_0x4767d9,_0xe6df('0xd'));logger[_0xe6df('0xe')](_0xe6df('0xf'),_0x4767d9,_0xe6df('0xd'),JSON[_0xe6df('0x10')](_0x56ad08));if(_0x56ad08[_0xe6df('0x11')]){if(_0x56ad08[_0xe6df('0x11')][_0xe6df('0x12')]===0x1f4){logger[_0xe6df('0x11')](_0xe6df('0xc'),_0x4767d9,_0x56ad08[_0xe6df('0x11')]['message']);return _0x176821(_0x56ad08[_0xe6df('0x11')]['message']);}logger[_0xe6df('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x4767d9,_0x56ad08[_0xe6df('0x11')]['message']);return _0x145886(_0x56ad08[_0xe6df('0x11')][_0xe6df('0x13')]);}else{logger['info'](_0xe6df('0xc'),_0x4767d9,_0xe6df('0xd'));_0x145886(_0x56ad08['result'][_0xe6df('0x13')]);}})[_0xe6df('0x14')](function(_0x42c68b){logger[_0xe6df('0x11')](_0xe6df('0xc'),_0x4767d9,_0x42c68b);_0x176821(_0x42c68b);});});} \ No newline at end of file +var _0x4dfe=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5c0188,_0x536535){var _0x3a9f68=function(_0x41b2ad){while(--_0x41b2ad){_0x5c0188['push'](_0x5c0188['shift']());}};_0x3a9f68(++_0x536535);}(_0x4dfe,0x119));var _0xe4df=function(_0x4296d8,_0x520326){_0x4296d8=_0x4296d8-0x0;var _0x4a3e70=_0x4dfe[_0x4296d8];return _0x4a3e70;};'use strict';var _=require('lodash');var util=require(_0xe4df('0x0'));var moment=require(_0xe4df('0x1'));var BPromise=require(_0xe4df('0x2'));var rs=require(_0xe4df('0x3'));var fs=require('fs');var Redis=require(_0xe4df('0x4'));var db=require(_0xe4df('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4df('0x6'))(_0xe4df('0x7'));var config=require(_0xe4df('0x8'));var jayson=require(_0xe4df('0x9'));var client=jayson['client'][_0xe4df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16ab34,_0x209961,_0x2532f1){return new BPromise(function(_0x2255c6,_0xf5cff0){return client['request'](_0x16ab34,_0x2532f1)[_0xe4df('0xb')](function(_0x152419){logger[_0xe4df('0xc')](_0xe4df('0xd'),_0x209961,_0xe4df('0xe'));logger[_0xe4df('0xf')](_0xe4df('0x10'),_0x209961,'request\x20sent',JSON[_0xe4df('0x11')](_0x152419));if(_0x152419[_0xe4df('0x12')]){if(_0x152419[_0xe4df('0x12')][_0xe4df('0x13')]===0x1f4){logger[_0xe4df('0x12')](_0xe4df('0xd'),_0x209961,_0x152419[_0xe4df('0x12')][_0xe4df('0x14')]);return _0xf5cff0(_0x152419[_0xe4df('0x12')]['message']);}logger['error'](_0xe4df('0xd'),_0x209961,_0x152419['error'][_0xe4df('0x14')]);return _0x2255c6(_0x152419['error'][_0xe4df('0x14')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x209961,'request\x20sent');_0x2255c6(_0x152419['result'][_0xe4df('0x14')]);}})[_0xe4df('0x15')](function(_0x5d60b4){logger[_0xe4df('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x209961,_0x5d60b4);_0xf5cff0(_0x5d60b4);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index dcc3f85..9ffadcc 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x530bb3,_0x540291){var _0x514a35=function(_0x241f83){while(--_0x241f83){_0x530bb3['push'](_0x530bb3['shift']());}};_0x514a35(++_0x540291);}(_0x70e0,0x17b));var _0x070e=function(_0x337b5f,_0x1fc5c9){_0x337b5f=_0x337b5f-0x0;var _0x588fe5=_0x70e0[_0x337b5f];return _0x588fe5;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x36167e,_0x359986){var _0x4df3af=function(_0x40b70d){while(--_0x40b70d){_0x36167e['push'](_0x36167e['shift']());}};_0x4df3af(++_0x359986);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index cc970e7..15dcf4b 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 _0xb288=['exports','INTEGER','STRING'];(function(_0x483481,_0x4adf19){var _0x35d44a=function(_0x5860a5){while(--_0x5860a5){_0x483481['push'](_0x483481['shift']());}};_0x35d44a(++_0x4adf19);}(_0xb288,0x111));var _0x8b28=function(_0x11e268,_0x7325a){_0x11e268=_0x11e268-0x0;var _0x2765e4=_0xb288[_0x11e268];return _0x2765e4;};'use strict';var Sequelize=require('sequelize');module[_0x8b28('0x0')]={'penalty':{'type':Sequelize[_0x8b28('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8b28('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8b28('0x2')]}}; \ No newline at end of file +var _0x3b47=['sequelize','exports','INTEGER','STRING'];(function(_0x5805bb,_0x26b7c1){var _0x128608=function(_0x25562b){while(--_0x25562b){_0x5805bb['push'](_0x5805bb['shift']());}};_0x128608(++_0x26b7c1);}(_0x3b47,0xf4));var _0x73b4=function(_0x33e74b,_0x4d16e0){_0x33e74b=_0x33e74b-0x0;var _0x3438e6=_0x3b47[_0x33e74b];return _0x3438e6;};'use strict';var Sequelize=require(_0x73b4('0x0'));module[_0x73b4('0x1')]={'penalty':{'type':Sequelize[_0x73b4('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x73b4('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x73b4('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8866f6f..69fe671 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 _0xfc96=['../../config/logger','bluebird','request-promise','path','../../config/environment','exports','UserFaxQueue','util'];(function(_0x2acb61,_0x4436ab){var _0x5361bf=function(_0x40b7f6){while(--_0x40b7f6){_0x2acb61['push'](_0x2acb61['shift']());}};_0x5361bf(++_0x4436ab);}(_0xfc96,0xc7));var _0x6fc9=function(_0xfd6596,_0x570a6e){_0xfd6596=_0xfd6596-0x0;var _0x1e80cc=_0xfc96[_0xfd6596];return _0x1e80cc;};'use strict';var _=require('lodash');var util=require(_0x6fc9('0x0'));var logger=require(_0x6fc9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6fc9('0x2'));var rp=require(_0x6fc9('0x3'));var fs=require('fs');var path=require(_0x6fc9('0x4'));var rimraf=require('rimraf');var config=require(_0x6fc9('0x5'));var attributes=require('./userFaxQueue.attributes');module[_0x6fc9('0x6')]=function(_0x5859d0,_0x186fd7){return _0x5859d0['define'](_0x6fc9('0x7'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4345=['path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x469eb9,_0x6c3137){var _0x435681=function(_0x16912f){while(--_0x16912f){_0x469eb9['push'](_0x469eb9['shift']());}};_0x435681(++_0x6c3137);}(_0x4345,0x159));var _0x5434=function(_0x10da9d,_0x1d0615){_0x10da9d=_0x10da9d-0x0;var _0x40d8ab=_0x4345[_0x10da9d];return _0x40d8ab;};'use strict';var _=require(_0x5434('0x0'));var util=require('util');var logger=require(_0x5434('0x1'))(_0x5434('0x2'));var moment=require(_0x5434('0x3'));var BPromise=require(_0x5434('0x4'));var rp=require(_0x5434('0x5'));var fs=require('fs');var path=require(_0x5434('0x6'));var rimraf=require(_0x5434('0x7'));var config=require('../../config/environment');var attributes=require(_0x5434('0x8'));module[_0x5434('0x9')]=function(_0x122390,_0x26735f){return _0x122390[_0x5434('0xa')](_0x5434('0xb'),attributes,{'tableName':_0x5434('0xc'),'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 ac0b4af..82e4f66 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 _0xe66d=['rpc','../../config/environment','jayson/promise','client','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3855f4,_0x16073b){var _0x3d4e63=function(_0x2dd743){while(--_0x2dd743){_0x3855f4['push'](_0x3855f4['shift']());}};_0x3d4e63(++_0x16073b);}(_0xe66d,0xc1));var _0xde66=function(_0x237815,_0x1ef2b0){_0x237815=_0x237815-0x0;var _0x5498ee=_0xe66d[_0x237815];return _0x5498ee;};'use strict';var _=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var moment=require(_0xde66('0x2'));var BPromise=require(_0xde66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde66('0x4'))['db'];var utils=require(_0xde66('0x5'));var logger=require(_0xde66('0x6'))(_0xde66('0x7'));var config=require(_0xde66('0x8'));var jayson=require(_0xde66('0x9'));var client=jayson[_0xde66('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13b396,_0x771b31,_0x77a1c0){return new BPromise(function(_0x57690a,_0x2aa2e7){return client['request'](_0x13b396,_0x77a1c0)['then'](function(_0x309eab){logger[_0xde66('0xb')](_0xde66('0xc'),_0x771b31,'request\x20sent');logger[_0xde66('0xd')](_0xde66('0xe'),_0x771b31,_0xde66('0xf'),JSON[_0xde66('0x10')](_0x309eab));if(_0x309eab[_0xde66('0x11')]){if(_0x309eab[_0xde66('0x11')]['code']===0x1f4){logger[_0xde66('0x11')](_0xde66('0xc'),_0x771b31,_0x309eab[_0xde66('0x11')][_0xde66('0x12')]);return _0x2aa2e7(_0x309eab[_0xde66('0x11')]['message']);}logger['error'](_0xde66('0xc'),_0x771b31,_0x309eab['error']['message']);return _0x57690a(_0x309eab['error']['message']);}else{logger['info'](_0xde66('0xc'),_0x771b31,_0xde66('0xf'));_0x57690a(_0x309eab[_0xde66('0x13')][_0xde66('0x12')]);}})['catch'](function(_0x590a1d){logger[_0xde66('0x11')](_0xde66('0xc'),_0x771b31,_0x590a1d);_0x2aa2e7(_0x590a1d);});});} \ No newline at end of file +var _0x8428=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserFaxQueue,\x20%s,\x20%s','result','catch','lodash'];(function(_0x1fe15c,_0x2779f7){var _0x1d0d60=function(_0x347c75){while(--_0x347c75){_0x1fe15c['push'](_0x1fe15c['shift']());}};_0x1d0d60(++_0x2779f7);}(_0x8428,0xfe));var _0x8842=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8428[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8842('0x0'));var util=require('util');var moment=require(_0x8842('0x1'));var BPromise=require(_0x8842('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8842('0x3'));var db=require(_0x8842('0x4'))['db'];var utils=require(_0x8842('0x5'));var logger=require(_0x8842('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8842('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdba490,_0x18676d,_0xe0b51e){return new BPromise(function(_0x317e02,_0x1fc3b1){return client['request'](_0xdba490,_0xe0b51e)['then'](function(_0x37514c){logger[_0x8842('0x8')]('UserFaxQueue,\x20%s,\x20%s',_0x18676d,_0x8842('0x9'));logger['debug'](_0x8842('0xa'),_0x18676d,_0x8842('0x9'),JSON[_0x8842('0xb')](_0x37514c));if(_0x37514c[_0x8842('0xc')]){if(_0x37514c[_0x8842('0xc')]['code']===0x1f4){logger[_0x8842('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x18676d,_0x37514c[_0x8842('0xc')][_0x8842('0xd')]);return _0x1fc3b1(_0x37514c[_0x8842('0xc')][_0x8842('0xd')]);}logger[_0x8842('0xc')](_0x8842('0xe'),_0x18676d,_0x37514c[_0x8842('0xc')]['message']);return _0x317e02(_0x37514c[_0x8842('0xc')][_0x8842('0xd')]);}else{logger[_0x8842('0x8')]('UserFaxQueue,\x20%s,\x20%s',_0x18676d,'request\x20sent');_0x317e02(_0x37514c[_0x8842('0xf')][_0x8842('0xd')]);}})[_0x8842('0x10')](function(_0x5c5459){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x18676d,_0x5c5459);_0x1fc3b1(_0x5c5459);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 882778c..b0dd544 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x291cb1,_0x374694){var _0x3ae235=function(_0x5f3d50){while(--_0x5f3d50){_0x291cb1['push'](_0x291cb1['shift']());}};_0x3ae235(++_0x374694);}(_0x70e0,0x17b));var _0x070e=function(_0x4726d4,_0x2e2ae5){_0x4726d4=_0x4726d4-0x0;var _0x8349f=_0x70e0[_0x4726d4];return _0x8349f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x12de6d,_0x4ed177){var _0x567eb7=function(_0x5048a9){while(--_0x5048a9){_0x12de6d['push'](_0x12de6d['shift']());}};_0x567eb7(++_0x4ed177);}(_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 57e93a0..bb433e1 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 _0x59cf=['INTEGER','sequelize','exports'];(function(_0x532f72,_0x4e3c9d){var _0x55231a=function(_0x51dfc5){while(--_0x51dfc5){_0x532f72['push'](_0x532f72['shift']());}};_0x55231a(++_0x4e3c9d);}(_0x59cf,0xf7));var _0xf59c=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0x59cf[_0x4e0a03];return _0x2478fc;};'use strict';var Sequelize=require(_0xf59c('0x0'));module[_0xf59c('0x1')]={'penalty':{'type':Sequelize[_0xf59c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c7b=['sequelize','INTEGER'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x4c7b,0x128));var _0xb4c7=function(_0x3f108a,_0x3dac08){_0x3f108a=_0x3f108a-0x0;var _0x8e230=_0x4c7b[_0x3f108a];return _0x8e230;};'use strict';var Sequelize=require(_0xb4c7('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb4c7('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 6469141..4c2f8e1 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 _0x8c45=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x8c45,0x1a3));var _0x58c4=function(_0x3a3787,_0x3e2c7b){_0x3a3787=_0x3a3787-0x0;var _0x3e9030=_0x8c45[_0x3a3787];return _0x3e9030;};'use strict';var _=require(_0x58c4('0x0'));var util=require(_0x58c4('0x1'));var logger=require(_0x58c4('0x2'))(_0x58c4('0x3'));var moment=require(_0x58c4('0x4'));var BPromise=require(_0x58c4('0x5'));var rp=require(_0x58c4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58c4('0x7'));var config=require('../../config/environment');var attributes=require(_0x58c4('0x8'));module[_0x58c4('0x9')]=function(_0x33c170,_0x527b19){return _0x33c170['define'](_0x58c4('0xa'),attributes,{'tableName':_0x58c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa308=['../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','util','../../config/logger','moment','request-promise','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa308,0x87));var _0x8a30=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xa308[_0xacb1e2];return _0x463815;};'use strict';var _=require('lodash');var util=require(_0x8a30('0x0'));var logger=require(_0x8a30('0x1'))('api');var moment=require(_0x8a30('0x2'));var BPromise=require('bluebird');var rp=require(_0x8a30('0x3'));var fs=require('fs');var path=require(_0x8a30('0x4'));var rimraf=require('rimraf');var config=require(_0x8a30('0x5'));var attributes=require('./userMailQueue.attributes');module[_0x8a30('0x6')]=function(_0x42e94e,_0x567438){return _0x42e94e[_0x8a30('0x7')](_0x8a30('0x8'),attributes,{'tableName':_0x8a30('0x9'),'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 7224c43..597f122 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x008c,0x188));var _0xc008=function(_0x3af40d,_0x5f38f6){_0x3af40d=_0x3af40d-0x0;var _0x363acb=_0x008c[_0x3af40d];return _0x363acb;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5704f3,_0x54f3d7){_0x5704f3=_0x5704f3-0x0;var _0x1d996a=_0x1cb9[_0x5704f3];return _0x1d996a;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 9af1c14..3c68b48 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 _0x460c=['../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x2d63f9,_0x120549){var _0x4ad697=function(_0x2e90e){while(--_0x2e90e){_0x2d63f9['push'](_0x2d63f9['shift']());}};_0x4ad697(++_0x120549);}(_0x460c,0x1be));var _0xc460=function(_0x3bc7f0,_0xdd948a){_0x3bc7f0=_0x3bc7f0-0x0;var _0xe87985=_0x460c[_0x3bc7f0];return _0xe87985;};'use strict';var multer=require(_0xc460('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc460('0x1'));var express=require(_0xc460('0x2'));var router=express[_0xc460('0x3')]();var fs_extra=require(_0xc460('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc460('0x5'));var config=require(_0xc460('0x6'));var controller=require('./userNotification.controller');router[_0xc460('0x7')]('/',auth[_0xc460('0x8')](),controller[_0xc460('0x9')]);module[_0xc460('0xa')]=router; \ No newline at end of file +var _0xf786=['./userNotification.controller','post','isAuthenticated','exports','multer','path','express','Router','../../config/environment'];(function(_0x24e2af,_0x4e5488){var _0x4f349a=function(_0x239715){while(--_0x239715){_0x24e2af['push'](_0x24e2af['shift']());}};_0x4f349a(++_0x4e5488);}(_0xf786,0x151));var _0x6f78=function(_0x584292,_0x3557d9){_0x584292=_0x584292-0x0;var _0x41cea7=_0xf786[_0x584292];return _0x41cea7;};'use strict';var multer=require(_0x6f78('0x0'));var util=require('util');var path=require(_0x6f78('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f78('0x2'));var router=express[_0x6f78('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f78('0x4'));var controller=require(_0x6f78('0x5'));router[_0x6f78('0x6')]('/',auth[_0x6f78('0x7')](),controller['sendUserNotification']);module[_0x6f78('0x8')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 385ece5..698c02b 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 _0x97af=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x596d5e,_0x4d5923){var _0x511140=function(_0x55cb48){while(--_0x55cb48){_0x596d5e['push'](_0x596d5e['shift']());}};_0x511140(++_0x4d5923);}(_0x97af,0x188));var _0xf97a=function(_0x1a0788,_0x20a2cb){_0x1a0788=_0x1a0788-0x0;var _0x482d3e=_0x97af[_0x1a0788];return _0x482d3e;};'use strict';var Sequelize=require(_0xf97a('0x0'));module[_0xf97a('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xf97a('0x2')]},'recipientsId':{'type':Sequelize[_0xf97a('0x3')]},'recipientsDescription':{'type':Sequelize[_0xf97a('0x2')]},'beep':{'type':Sequelize[_0xf97a('0x4')]}}; \ No newline at end of file +var _0xff7d=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xff7d,0x15a));var _0xdff7=function(_0x3642fe,_0x3bc348){_0x3642fe=_0x3642fe-0x0;var _0x3b54a2=_0xff7d[_0x3642fe];return _0x3b54a2;};'use strict';var Sequelize=require(_0xdff7('0x0'));module[_0xdff7('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xdff7('0x2')]},'recipientsDescription':{'type':Sequelize[_0xdff7('0x3')]},'beep':{'type':Sequelize[_0xdff7('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index ca1e625..5907d3a 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 _0xef02=['error','stack','name','send','sendUserNotification','body','hasOwnProperty','Sequelize','ValidationError','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','sortBy','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','queue','replace','Queue','push','all','union','flatten','map','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x248470,_0x5f433b){var _0xcdefc4=function(_0x3fe7cf){while(--_0x3fe7cf){_0x248470['push'](_0x248470['shift']());}};_0xcdefc4(++_0x5f433b);}(_0xef02,0xff));var _0x2ef0=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xef02[_0x4b174a];return _0x3cd7bf;};'use strict';var emlformat=require(_0x2ef0('0x0'));var rimraf=require(_0x2ef0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ef0('0x2'));var rp=require(_0x2ef0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2ef0('0x4'));var util=require(_0x2ef0('0x5'));var path=require(_0x2ef0('0x6'));var sox=require(_0x2ef0('0x7'));var csv=require(_0x2ef0('0x8'));var ejs=require(_0x2ef0('0x9'));var fs=require('fs');var fs_extra=require(_0x2ef0('0xa'));var _=require(_0x2ef0('0xb'));var squel=require(_0x2ef0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2ef0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2ef0('0xe'));var Papa=require(_0x2ef0('0xf'));var Redis=require(_0x2ef0('0x10'));var authService=require(_0x2ef0('0x11'));var qs=require(_0x2ef0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ef0('0x13'));var logger=require(_0x2ef0('0x14'))('api');var utils=require(_0x2ef0('0x15'));var config=require(_0x2ef0('0x16'));var licenseUtil=require(_0x2ef0('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2ef0('0x18')](config[_0x2ef0('0x19')],{'host':_0x2ef0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ef0('0x19')]));require(_0x2ef0('0x1b'))[_0x2ef0('0x1c')](socket);function respondWithStatusCode(_0x9843a5,_0xd3ba88){_0xd3ba88=_0xd3ba88||0xcc;return function(_0x4e4c8c){if(_0x4e4c8c){return _0x9843a5[_0x2ef0('0x1d')](_0xd3ba88);}return _0x9843a5[_0x2ef0('0x1e')](_0xd3ba88)[_0x2ef0('0x1f')]();};}function respondWithResult(_0xb30928,_0x42acc4){_0x42acc4=_0x42acc4||0xc8;return function(_0x4be78a){if(_0x4be78a){return _0xb30928[_0x2ef0('0x1e')](_0x42acc4)[_0x2ef0('0x20')](_0x4be78a);}};}function respondWithFilteredResult(_0xb64ceb,_0x188d92){return function(_0x4271e7){if(_0x4271e7){var _0x1f7b02=typeof _0x188d92[_0x2ef0('0x21')]===_0x2ef0('0x22')&&typeof _0x188d92[_0x2ef0('0x23')]==='undefined';var _0x174539=_0x4271e7[_0x2ef0('0x24')];var _0x31af33=_0x1f7b02?0x0:_0x188d92['offset'];var _0x274bf1=_0x1f7b02?_0x4271e7[_0x2ef0('0x24')]:_0x188d92[_0x2ef0('0x21')]+_0x188d92[_0x2ef0('0x23')];var _0x360b26;if(_0x274bf1>=_0x174539){_0x274bf1=_0x174539;_0x360b26=0xc8;}else{_0x360b26=0xce;}_0xb64ceb['status'](_0x360b26);return _0xb64ceb[_0x2ef0('0x25')](_0x2ef0('0x26'),_0x31af33+'-'+_0x274bf1+'/'+_0x174539)[_0x2ef0('0x20')](_0x4271e7);}return null;};}function patchUpdates(_0x453854){return function(_0x456de0){try{jsonpatch[_0x2ef0('0x27')](_0x456de0,_0x453854,!![]);}catch(_0x26be79){return BPromise[_0x2ef0('0x28')](_0x26be79);}return _0x456de0[_0x2ef0('0x29')]();};}function saveUpdates(_0x563c06,_0x6fbc3b){return function(_0x2f0575){if(_0x2f0575){return _0x2f0575[_0x2ef0('0x2a')](_0x563c06)['then'](function(_0x130a71){return _0x130a71;});}return null;};}function removeEntity(_0x49c849,_0x8f190e){return function(_0x313cf8){if(_0x313cf8){return _0x313cf8[_0x2ef0('0x2b')]()[_0x2ef0('0x2c')](function(){_0x49c849[_0x2ef0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dff2e,_0x5ce8fc){return function(_0x10e262){if(!_0x10e262){_0x1dff2e[_0x2ef0('0x1d')](0x194);}return _0x10e262;};}function handleError(_0x2e9e7e,_0x56d7a9){_0x56d7a9=_0x56d7a9||0x1f4;return function(_0x367f3e){logger[_0x2ef0('0x2d')](_0x367f3e[_0x2ef0('0x2e')]);if(_0x367f3e[_0x2ef0('0x2f')]){delete _0x367f3e['name'];}_0x2e9e7e[_0x2ef0('0x1e')](_0x56d7a9)[_0x2ef0('0x30')](_0x367f3e);};}exports[_0x2ef0('0x31')]=function(_0x161190,_0x36a82f,_0x1b383e){if(!_0x161190[_0x2ef0('0x32')][_0x2ef0('0x33')]('text')&&!_0x161190['body'][_0x2ef0('0x33')]('TemplateId')){throw new db[(_0x2ef0('0x34'))][(_0x2ef0('0x35'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x161190[_0x2ef0('0x32')][_0x2ef0('0x33')](_0x2ef0('0x36'))&&!_0x161190[_0x2ef0('0x32')][_0x2ef0('0x33')](_0x2ef0('0x37'))){throw new db[(_0x2ef0('0x34'))][(_0x2ef0('0x35'))](_0x2ef0('0x38'));}if(!_0x161190['body'][_0x2ef0('0x33')](_0x2ef0('0x39'))){throw new db['Sequelize'][(_0x2ef0('0x35'))](_0x2ef0('0x3a'));}else{try{var _0x3be39b=JSON[_0x2ef0('0x3b')](_0x161190['body'][_0x2ef0('0x39')]);}catch(_0x4503f9){logger[_0x2ef0('0x2d')](_0x4503f9);throw new db[(_0x2ef0('0x34'))][(_0x2ef0('0x35'))](_0x2ef0('0x3c'));}var _0x4fbe6b=[_0x2ef0('0x3d'),_0x2ef0('0x3e'),_0x2ef0('0x3f'),_0x2ef0('0x40'),_0x2ef0('0x41'),'voicequeue',_0x2ef0('0x42'),_0x2ef0('0x43'),_0x2ef0('0x44')];if(_[_0x2ef0('0x45')](_0x3be39b,function(_0x3f52d8){return!_[_0x2ef0('0x46')](_0x4fbe6b,_0x3f52d8[_0x2ef0('0x47')]['toLowerCase']());})){throw new db[(_0x2ef0('0x34'))][(_0x2ef0('0x35'))](_0x2ef0('0x48'));}}}var _0x2f1779={};_0x2f1779[_0x2ef0('0x49')]=_0x161190['body'][_0x2ef0('0x33')]('senderName')?_0x161190[_0x2ef0('0x32')][_0x2ef0('0x49')]:_0x161190['user'][_0x2ef0('0x4a')];_0x2f1779[_0x2ef0('0x4b')]=_['isEmpty'](_0x161190[_0x2ef0('0x32')][_0x2ef0('0x4b')])?null:_0x161190[_0x2ef0('0x32')][_0x2ef0('0x4b')];_0x2f1779[_0x2ef0('0x4c')]=_0x161190[_0x2ef0('0x32')][_0x2ef0('0x4c')]||![];_0x2f1779['SenderId']=_0x161190[_0x2ef0('0x44')]['id'];return getContent(_0x161190[_0x2ef0('0x32')])['then'](function(_0x296c0f){_0x2f1779[_0x2ef0('0x32')]=_0x296c0f;return getRecipients(_0x3be39b);})['then'](function(_0x3c1535){_0x2f1779['recipientsId']=_[_0x2ef0('0x4d')](_0x3c1535)['join'](',');return db['sequelize']['transaction'](function(_0x2ca84b){return db[_0x2ef0('0x4e')][_0x2ef0('0x4f')](_0x2f1779,{'raw':!![],'transaction':_0x2ca84b})['then'](function(_0x3aefed){var _0x500361={'sender':_0x2f1779[_0x2ef0('0x49')],'description':_0x2f1779[_0x2ef0('0x4b')],'content':_0x2f1779['body'],'beep':_0x2f1779[_0x2ef0('0x4c')]};_0x3c1535[_0x2ef0('0x50')](function(_0x4df894){_0x500361[_0x2ef0('0x51')]=_0x4df894;socket[_0x2ef0('0x52')](_0x2ef0('0x53'),_0x500361);});return _0x3aefed;});});})['then'](respondWithResult(_0x36a82f,0xc9))[_0x2ef0('0x54')](handleError(_0x36a82f,null));};function getContent(_0x170c69){return new BPromise(function(_0x1226f8,_0x592700){if(_0x170c69[_0x2ef0('0x55')]){_0x1226f8(_0x170c69[_0x2ef0('0x55')]);return;}return db['Template'][_0x2ef0('0x56')]({'attributes':[_0x2ef0('0x57')],'where':{'id':_0x170c69[_0x2ef0('0x36')]},'raw':!![]})[_0x2ef0('0x2c')](function(_0x32df9a){if(!_0x32df9a)throw new db[(_0x2ef0('0x34'))][(_0x2ef0('0x35'))](_0x2ef0('0x58'));var _0x46e740=Mustache[_0x2ef0('0x59')](_0x32df9a['html'],_0x170c69['view']);_0x1226f8(_0x46e740);})[_0x2ef0('0x54')](function(_0x4a7dcd){_0x592700(_0x4a7dcd);});});}function getRecipients(_0x649a08){return new BPromise(function(_0x25e5e3,_0x16413e){var _0x435c08=[];var _0x2aa279=[];_0x649a08[_0x2ef0('0x50')](function(_0x1cd2ae){var _0x23159e=_[_0x2ef0('0x5a')](_0x1cd2ae['model']['toLowerCase']());if(_0x23159e===_0x2ef0('0x5b')){_0x435c08=_['union'](_0x435c08,_0x1cd2ae['ids']);}else{if(_['includes'](_0x23159e,_0x2ef0('0x5c')))_0x23159e=_0x23159e[_0x2ef0('0x5d')](_0x2ef0('0x5c'),_0x2ef0('0x5e'));_0x1cd2ae['ids']['forEach'](function(_0x28a86f){_0x2aa279[_0x2ef0('0x5f')](getAgents(_0x23159e,_0x28a86f));});}});return BPromise[_0x2ef0('0x60')](_0x2aa279)[_0x2ef0('0x2c')](function(_0x4342d9){_0x435c08=_[_0x2ef0('0x61')](_0x435c08,_[_0x2ef0('0x62')](_0x4342d9));_0x25e5e3(_0x435c08);})['catch'](function(_0x260bee){_0x16413e(_0x260bee);});});}function getAgents(_0x15cfee,_0x1030e3){return new BPromise(function(_0x549932,_0x689f9b){return db[_0x15cfee][_0x2ef0('0x56')]({'where':{'id':_0x1030e3}})[_0x2ef0('0x2c')](function(_0x3d7fe7){return _0x3d7fe7['getAgents']({'attributes':['id'],'raw':!![]})[_0x2ef0('0x2c')](function(_0x5688e9){var _0x18e6c8=_[_0x2ef0('0x63')](_0x5688e9,'id');_0x549932(_0x18e6c8);});})[_0x2ef0('0x54')](function(_0x32acf9){_0x689f9b(_0x32acf9);});});} \ No newline at end of file +var _0x75a2=['send','sendUserNotification','body','text','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','recipients','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','then','recipientsId','sortBy','sequelize','UserNotification','create','forEach','recipient','catch','html','render','startCase','union','ids','queue','replace','push','all','findOne','getAgents','map','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userNotification.socket','end','json','undefined','limit','count','offset','status','set','apply','destroy','sendStatus','error','stack','name'];(function(_0x167e91,_0x890cb){var _0x12fd2a=function(_0x41c025){while(--_0x41c025){_0x167e91['push'](_0x167e91['shift']());}};_0x12fd2a(++_0x890cb);}(_0x75a2,0x1eb));var _0x275a=function(_0x2f727b,_0x3630bc){_0x2f727b=_0x2f727b-0x0;var _0x343a66=_0x75a2[_0x2f727b];return _0x343a66;};'use strict';var emlformat=require(_0x275a('0x0'));var rimraf=require(_0x275a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x275a('0x2'));var BPromise=require(_0x275a('0x3'));var Mustache=require(_0x275a('0x4'));var util=require('util');var path=require(_0x275a('0x5'));var sox=require(_0x275a('0x6'));var csv=require('to-csv');var ejs=require(_0x275a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x275a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x275a('0x9'));var toCsv=require(_0x275a('0xa'));var querystring=require(_0x275a('0xb'));var Papa=require(_0x275a('0xc'));var Redis=require(_0x275a('0xd'));var authService=require(_0x275a('0xe'));var qs=require(_0x275a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x275a('0x10'));var config=require(_0x275a('0x11'));var licenseUtil=require(_0x275a('0x12'));var db=require('../../mysqldb')['db'];config[_0x275a('0x13')]=_[_0x275a('0x14')](config[_0x275a('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x275a('0x15'))(new Redis(config[_0x275a('0x13')]));require(_0x275a('0x16'))['register'](socket);function respondWithStatusCode(_0xcecd1a,_0x26c61b){_0x26c61b=_0x26c61b||0xcc;return function(_0xe26106){if(_0xe26106){return _0xcecd1a['sendStatus'](_0x26c61b);}return _0xcecd1a['status'](_0x26c61b)[_0x275a('0x17')]();};}function respondWithResult(_0x5ecfca,_0x51f233){_0x51f233=_0x51f233||0xc8;return function(_0x2d471a){if(_0x2d471a){return _0x5ecfca['status'](_0x51f233)[_0x275a('0x18')](_0x2d471a);}};}function respondWithFilteredResult(_0xf49a2f,_0x1ef5eb){return function(_0x2a2b16){if(_0x2a2b16){var _0x36641a=typeof _0x1ef5eb['offset']===_0x275a('0x19')&&typeof _0x1ef5eb[_0x275a('0x1a')]===_0x275a('0x19');var _0x16b5ac=_0x2a2b16[_0x275a('0x1b')];var _0x4d0905=_0x36641a?0x0:_0x1ef5eb[_0x275a('0x1c')];var _0x454f3f=_0x36641a?_0x2a2b16[_0x275a('0x1b')]:_0x1ef5eb[_0x275a('0x1c')]+_0x1ef5eb[_0x275a('0x1a')];var _0x4a7447;if(_0x454f3f>=_0x16b5ac){_0x454f3f=_0x16b5ac;_0x4a7447=0xc8;}else{_0x4a7447=0xce;}_0xf49a2f[_0x275a('0x1d')](_0x4a7447);return _0xf49a2f[_0x275a('0x1e')]('Content-Range',_0x4d0905+'-'+_0x454f3f+'/'+_0x16b5ac)[_0x275a('0x18')](_0x2a2b16);}return null;};}function patchUpdates(_0x50faf9){return function(_0x45aed3){try{jsonpatch[_0x275a('0x1f')](_0x45aed3,_0x50faf9,!![]);}catch(_0x52759c){return BPromise['reject'](_0x52759c);}return _0x45aed3['save']();};}function saveUpdates(_0x53fe19,_0x159acb){return function(_0x5d6d11){if(_0x5d6d11){return _0x5d6d11['update'](_0x53fe19)['then'](function(_0x1809fc){return _0x1809fc;});}return null;};}function removeEntity(_0x29376b,_0x1a918c){return function(_0x1d9fd3){if(_0x1d9fd3){return _0x1d9fd3[_0x275a('0x20')]()['then'](function(){_0x29376b['status'](0xcc)[_0x275a('0x17')]();});}};}function handleEntityNotFound(_0x480d52,_0x57bf44){return function(_0x2280bf){if(!_0x2280bf){_0x480d52[_0x275a('0x21')](0x194);}return _0x2280bf;};}function handleError(_0x184cea,_0x16cfaf){_0x16cfaf=_0x16cfaf||0x1f4;return function(_0x456a65){logger[_0x275a('0x22')](_0x456a65[_0x275a('0x23')]);if(_0x456a65[_0x275a('0x24')]){delete _0x456a65[_0x275a('0x24')];}_0x184cea[_0x275a('0x1d')](_0x16cfaf)[_0x275a('0x25')](_0x456a65);};}exports[_0x275a('0x26')]=function(_0x2aa20e,_0x2f68a8,_0x598dac){if(!_0x2aa20e[_0x275a('0x27')]['hasOwnProperty'](_0x275a('0x28'))&&!_0x2aa20e[_0x275a('0x27')][_0x275a('0x29')]('TemplateId')){throw new db[(_0x275a('0x2a'))][(_0x275a('0x2b'))](_0x275a('0x2c'));}else{if(_0x2aa20e[_0x275a('0x27')][_0x275a('0x29')](_0x275a('0x2d'))&&!_0x2aa20e[_0x275a('0x27')][_0x275a('0x29')](_0x275a('0x2e'))){throw new db[(_0x275a('0x2a'))][(_0x275a('0x2b'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x2aa20e[_0x275a('0x27')]['hasOwnProperty'](_0x275a('0x2f'))){throw new db[(_0x275a('0x2a'))][(_0x275a('0x2b'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x140288=JSON[_0x275a('0x30')](_0x2aa20e[_0x275a('0x27')][_0x275a('0x2f')]);}catch(_0x2a9db4){logger[_0x275a('0x22')](_0x2a9db4);throw new db[(_0x275a('0x2a'))][(_0x275a('0x2b'))](_0x275a('0x31'));}var _0x502b39=['chatqueue',_0x275a('0x32'),_0x275a('0x33'),_0x275a('0x34'),_0x275a('0x35'),_0x275a('0x36'),'whatsappqueue',_0x275a('0x37'),_0x275a('0x38')];if(_[_0x275a('0x39')](_0x140288,function(_0xf5ea3e){return!_[_0x275a('0x3a')](_0x502b39,_0xf5ea3e[_0x275a('0x3b')][_0x275a('0x3c')]());})){throw new db[(_0x275a('0x2a'))][(_0x275a('0x2b'))](_0x275a('0x3d'));}}}var _0xd38453={};_0xd38453['senderName']=_0x2aa20e['body']['hasOwnProperty'](_0x275a('0x3e'))?_0x2aa20e[_0x275a('0x27')][_0x275a('0x3e')]:_0x2aa20e[_0x275a('0x38')][_0x275a('0x3f')];_0xd38453['recipientsDescription']=_['isEmpty'](_0x2aa20e[_0x275a('0x27')]['recipientsDescription'])?null:_0x2aa20e[_0x275a('0x27')][_0x275a('0x40')];_0xd38453[_0x275a('0x41')]=_0x2aa20e[_0x275a('0x27')][_0x275a('0x41')]||![];_0xd38453[_0x275a('0x42')]=_0x2aa20e[_0x275a('0x38')]['id'];return getContent(_0x2aa20e[_0x275a('0x27')])[_0x275a('0x43')](function(_0x422138){_0xd38453[_0x275a('0x27')]=_0x422138;return getRecipients(_0x140288);})['then'](function(_0x4fd132){_0xd38453[_0x275a('0x44')]=_[_0x275a('0x45')](_0x4fd132)['join'](',');return db[_0x275a('0x46')]['transaction'](function(_0x2d19b2){return db[_0x275a('0x47')][_0x275a('0x48')](_0xd38453,{'raw':!![],'transaction':_0x2d19b2})['then'](function(_0x1b9e38){var _0x361486={'sender':_0xd38453[_0x275a('0x3e')],'description':_0xd38453[_0x275a('0x40')],'content':_0xd38453['body'],'beep':_0xd38453['beep']};_0x4fd132[_0x275a('0x49')](function(_0x3e0dea){_0x361486[_0x275a('0x4a')]=_0x3e0dea;socket['emit']('userNotification:send',_0x361486);});return _0x1b9e38;});});})[_0x275a('0x43')](respondWithResult(_0x2f68a8,0xc9))[_0x275a('0x4b')](handleError(_0x2f68a8,null));};function getContent(_0x22d40f){return new BPromise(function(_0x445066,_0x16e730){if(_0x22d40f[_0x275a('0x28')]){_0x445066(_0x22d40f[_0x275a('0x28')]);return;}return db['Template']['findOne']({'attributes':[_0x275a('0x4c')],'where':{'id':_0x22d40f['TemplateId']},'raw':!![]})[_0x275a('0x43')](function(_0xcfbccd){if(!_0xcfbccd)throw new db[(_0x275a('0x2a'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x449ed=Mustache[_0x275a('0x4d')](_0xcfbccd[_0x275a('0x4c')],_0x22d40f[_0x275a('0x2e')]);_0x445066(_0x449ed);})[_0x275a('0x4b')](function(_0x3138a3){_0x16e730(_0x3138a3);});});}function getRecipients(_0x160f4d){return new BPromise(function(_0x24cc17,_0x3299e4){var _0x181f74=[];var _0x5604cf=[];_0x160f4d[_0x275a('0x49')](function(_0x5290eb){var _0x40bcd7=_[_0x275a('0x4e')](_0x5290eb['model']['toLowerCase']());if(_0x40bcd7==='User'){_0x181f74=_[_0x275a('0x4f')](_0x181f74,_0x5290eb[_0x275a('0x50')]);}else{if(_[_0x275a('0x3a')](_0x40bcd7,_0x275a('0x51')))_0x40bcd7=_0x40bcd7[_0x275a('0x52')](_0x275a('0x51'),'Queue');_0x5290eb['ids']['forEach'](function(_0x39e902){_0x5604cf[_0x275a('0x53')](getAgents(_0x40bcd7,_0x39e902));});}});return BPromise[_0x275a('0x54')](_0x5604cf)[_0x275a('0x43')](function(_0x3dc768){_0x181f74=_[_0x275a('0x4f')](_0x181f74,_['flatten'](_0x3dc768));_0x24cc17(_0x181f74);})[_0x275a('0x4b')](function(_0x30f837){_0x3299e4(_0x30f837);});});}function getAgents(_0xa551a6,_0x64ffd4){return new BPromise(function(_0x3c78b4,_0x46238a){return db[_0xa551a6][_0x275a('0x55')]({'where':{'id':_0x64ffd4}})[_0x275a('0x43')](function(_0x3e6cde){return _0x3e6cde[_0x275a('0x56')]({'attributes':['id'],'raw':!![]})[_0x275a('0x43')](function(_0x29b86e){var _0x5c9241=_[_0x275a('0x57')](_0x29b86e,'id');_0x3c78b4(_0x5c9241);});})[_0x275a('0x4b')](function(_0x311e1b){_0x46238a(_0x311e1b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index ee69d02..fa14721 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 _0x446a=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x446a,0x1a6));var _0xa446=function(_0x3e7b1f,_0x2e14f7){_0x3e7b1f=_0x3e7b1f-0x0;var _0x326692=_0x446a[_0x3e7b1f];return _0x326692;};'use strict';var EventEmitter=require(_0xa446('0x0'));var UserNotification=require(_0xa446('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa446('0x2')](0x0);var events={'afterCreate':_0xa446('0x3'),'afterUpdate':'update','afterDestroy':_0xa446('0x4')};function emitEvent(_0x226dab){return function(_0x46d3ca,_0x2d87e7,_0x451ca4){UserNotificationEvents['emit'](_0x226dab+':'+_0x46d3ca['id'],_0x46d3ca);UserNotificationEvents[_0xa446('0x5')](_0x226dab,_0x46d3ca);_0x451ca4(null);};}for(var e in events){if(events[_0xa446('0x6')](e)){var event=events[e];UserNotification[_0xa446('0x7')](e,emitEvent(event));}}module[_0xa446('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xfd1b=['emit','hasOwnProperty','../../mysqldb','UserNotification','setMaxListeners','update','remove'];(function(_0x35a03d,_0x1c8dd2){var _0x139369=function(_0x4c3c18){while(--_0x4c3c18){_0x35a03d['push'](_0x35a03d['shift']());}};_0x139369(++_0x1c8dd2);}(_0xfd1b,0x1d0));var _0xbfd1=function(_0x648dde,_0x295e10){_0x648dde=_0x648dde-0x0;var _0x4118bf=_0xfd1b[_0x648dde];return _0x4118bf;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xbfd1('0x0'))['db'][_0xbfd1('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xbfd1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbfd1('0x3'),'afterDestroy':_0xbfd1('0x4')};function emitEvent(_0x11b243){return function(_0x3af515,_0x2c53a6,_0x30ef99){UserNotificationEvents[_0xbfd1('0x5')](_0x11b243+':'+_0x3af515['id'],_0x3af515);UserNotificationEvents['emit'](_0x11b243,_0x3af515);_0x30ef99(null);};}for(var e in events){if(events[_0xbfd1('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 0a4c48f..d440eaf 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 _0x3d07=['path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise'];(function(_0x3adc17,_0x155c9c){var _0x1c8c6d=function(_0x29ef84){while(--_0x29ef84){_0x3adc17['push'](_0x3adc17['shift']());}};_0x1c8c6d(++_0x155c9c);}(_0x3d07,0xd8));var _0x73d0=function(_0x5a14dd,_0x55e143){_0x5a14dd=_0x5a14dd-0x0;var _0x43d8f6=_0x3d07[_0x5a14dd];return _0x43d8f6;};'use strict';var _=require(_0x73d0('0x0'));var util=require(_0x73d0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x73d0('0x2'));var BPromise=require(_0x73d0('0x3'));var rp=require(_0x73d0('0x4'));var fs=require('fs');var path=require(_0x73d0('0x5'));var rimraf=require(_0x73d0('0x6'));var config=require(_0x73d0('0x7'));var attributes=require(_0x73d0('0x8'));module[_0x73d0('0x9')]=function(_0x47aa9f,_0x401b2f){return _0x47aa9f[_0x73d0('0xa')](_0x73d0('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x73d0('0xc')});}; \ No newline at end of file +var _0xb160=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x149270,_0xd66c2c){var _0x3cd979=function(_0x1f569f){while(--_0x1f569f){_0x149270['push'](_0x149270['shift']());}};_0x3cd979(++_0xd66c2c);}(_0xb160,0x14f));var _0x0b16=function(_0x242491,_0x1b297d){_0x242491=_0x242491-0x0;var _0x4de9f0=_0xb160[_0x242491];return _0x4de9f0;};'use strict';var _=require(_0x0b16('0x0'));var util=require(_0x0b16('0x1'));var logger=require(_0x0b16('0x2'))(_0x0b16('0x3'));var moment=require(_0x0b16('0x4'));var BPromise=require(_0x0b16('0x5'));var rp=require(_0x0b16('0x6'));var fs=require('fs');var path=require(_0x0b16('0x7'));var rimraf=require(_0x0b16('0x8'));var config=require(_0x0b16('0x9'));var attributes=require(_0x0b16('0xa'));module[_0x0b16('0xb')]=function(_0x3022b6,_0x32681e){return _0x3022b6[_0x0b16('0xc')](_0x0b16('0xd'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b16('0xe'),'collate':_0x0b16('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 782ac83..10f9a30 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 _0x4139=['UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','stringify','error'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0x4139,0xc1));var _0x9413=function(_0x5b3575,_0x359f4b){_0x5b3575=_0x5b3575-0x0;var _0x3d17e5=_0x4139[_0x5b3575];return _0x3d17e5;};'use strict';var _=require(_0x9413('0x0'));var util=require(_0x9413('0x1'));var moment=require(_0x9413('0x2'));var BPromise=require(_0x9413('0x3'));var rs=require(_0x9413('0x4'));var fs=require('fs');var Redis=require(_0x9413('0x5'));var db=require(_0x9413('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9413('0x7'))(_0x9413('0x8'));var config=require(_0x9413('0x9'));var jayson=require(_0x9413('0xa'));var client=jayson[_0x9413('0xb')]['http']({'port':0x232a});config[_0x9413('0xc')]=_[_0x9413('0xd')](config[_0x9413('0xc')],{'host':_0x9413('0xe'),'port':0x18eb});var socket=require(_0x9413('0xf'))(new Redis(config[_0x9413('0xc')]));require('./userNotification.socket')[_0x9413('0x10')](socket);function respondWithRpcPromise(_0x55e512,_0x2dfac6,_0x2a369){return new BPromise(function(_0x3322eb,_0xc39e7d){return client[_0x9413('0x11')](_0x55e512,_0x2a369)['then'](function(_0x240aae){logger[_0x9413('0x12')]('UserNotification,\x20%s,\x20%s',_0x2dfac6,_0x9413('0x13'));logger[_0x9413('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x2dfac6,_0x9413('0x13'),JSON[_0x9413('0x15')](_0x240aae));if(_0x240aae['error']){if(_0x240aae[_0x9413('0x16')]['code']===0x1f4){logger['error'](_0x9413('0x17'),_0x2dfac6,_0x240aae['error'][_0x9413('0x18')]);return _0xc39e7d(_0x240aae[_0x9413('0x16')][_0x9413('0x18')]);}logger[_0x9413('0x16')](_0x9413('0x17'),_0x2dfac6,_0x240aae['error'][_0x9413('0x18')]);return _0x3322eb(_0x240aae['error']['message']);}else{logger['info'](_0x9413('0x17'),_0x2dfac6,_0x9413('0x13'));_0x3322eb(_0x240aae[_0x9413('0x19')]['message']);}})[_0x9413('0x1a')](function(_0x382f77){logger[_0x9413('0x16')](_0x9413('0x17'),_0x2dfac6,_0x382f77);_0xc39e7d(_0x382f77);});});} \ No newline at end of file +var _0x37c0=['socket.io-emitter','./userNotification.socket','register','request','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','request\x20sent','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis'];(function(_0x5558fb,_0xe6bb5e){var _0x11368d=function(_0x4f0cd6){while(--_0x4f0cd6){_0x5558fb['push'](_0x5558fb['shift']());}};_0x11368d(++_0xe6bb5e);}(_0x37c0,0x1f4));var _0x037c=function(_0x30ea2c,_0x37ca4c){_0x30ea2c=_0x30ea2c-0x0;var _0x3f7014=_0x37c0[_0x30ea2c];return _0x3f7014;};'use strict';var _=require(_0x037c('0x0'));var util=require('util');var moment=require(_0x037c('0x1'));var BPromise=require(_0x037c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x037c('0x3'));var db=require(_0x037c('0x4'))['db'];var utils=require(_0x037c('0x5'));var logger=require(_0x037c('0x6'))(_0x037c('0x7'));var config=require('../../config/environment');var jayson=require(_0x037c('0x8'));var client=jayson[_0x037c('0x9')][_0x037c('0xa')]({'port':0x232a});config['redis']=_[_0x037c('0xb')](config[_0x037c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x037c('0xd'))(new Redis(config['redis']));require(_0x037c('0xe'))[_0x037c('0xf')](socket);function respondWithRpcPromise(_0x45a5a0,_0x2a870a,_0x243936){return new BPromise(function(_0x31853b,_0x207373){return client[_0x037c('0x10')](_0x45a5a0,_0x243936)['then'](function(_0xd806a0){logger['info']('UserNotification,\x20%s,\x20%s',_0x2a870a,'request\x20sent');logger[_0x037c('0x11')](_0x037c('0x12'),_0x2a870a,'request\x20sent',JSON[_0x037c('0x13')](_0xd806a0));if(_0xd806a0[_0x037c('0x14')]){if(_0xd806a0[_0x037c('0x14')][_0x037c('0x15')]===0x1f4){logger['error'](_0x037c('0x16'),_0x2a870a,_0xd806a0['error'][_0x037c('0x17')]);return _0x207373(_0xd806a0[_0x037c('0x14')][_0x037c('0x17')]);}logger[_0x037c('0x14')](_0x037c('0x16'),_0x2a870a,_0xd806a0[_0x037c('0x14')][_0x037c('0x17')]);return _0x31853b(_0xd806a0[_0x037c('0x14')]['message']);}else{logger[_0x037c('0x18')](_0x037c('0x16'),_0x2a870a,_0x037c('0x19'));_0x31853b(_0xd806a0[_0x037c('0x1a')]['message']);}})['catch'](function(_0x377018){logger[_0x037c('0x14')](_0x037c('0x16'),_0x2a870a,_0x377018);_0x207373(_0x377018);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index c656fa0..faa0de8 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 _0x7770=['emit','userNotification:','./userNotification.events','save','remove','update'];(function(_0x6af1b1,_0x4ccf9e){var _0x139dae=function(_0x409ebf){while(--_0x409ebf){_0x6af1b1['push'](_0x6af1b1['shift']());}};_0x139dae(++_0x4ccf9e);}(_0x7770,0xa4));var _0x0777=function(_0x2c0374,_0x1fe6fa){_0x2c0374=_0x2c0374-0x0;var _0x297fea=_0x7770[_0x2c0374];return _0x297fea;};'use strict';var UserNotificationEvents=require(_0x0777('0x0'));var events=[_0x0777('0x1'),_0x0777('0x2'),_0x0777('0x3')];function createListener(_0x124fac,_0x108964){return function(_0x3b43e3){_0x108964[_0x0777('0x4')](_0x124fac,_0x3b43e3);};}function removeListener(_0x25ca57,_0x3e5198){return function(){UserNotificationEvents['removeListener'](_0x25ca57,_0x3e5198);};}exports['register']=function(_0x58176f){for(var _0x2abdbc=0x0,_0x5bc631=events['length'];_0x2abdbc<_0x5bc631;_0x2abdbc++){var _0x90a0b4=events[_0x2abdbc];var _0x571004=createListener(_0x0777('0x5')+_0x90a0b4,_0x58176f);UserNotificationEvents['on'](_0x90a0b4,_0x571004);}}; \ No newline at end of file +var _0xee13=['register','length','userNotification:','save','remove','update','emit'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xee13,0x14c));var _0x3ee1=function(_0x3f90e7,_0x3da2dd){_0x3f90e7=_0x3f90e7-0x0;var _0x5413ed=_0xee13[_0x3f90e7];return _0x5413ed;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x3ee1('0x0'),_0x3ee1('0x1'),_0x3ee1('0x2')];function createListener(_0x530591,_0x16189c){return function(_0x5439d0){_0x16189c[_0x3ee1('0x3')](_0x530591,_0x5439d0);};}function removeListener(_0x361ca0,_0x3a35e7){return function(){UserNotificationEvents['removeListener'](_0x361ca0,_0x3a35e7);};}exports[_0x3ee1('0x4')]=function(_0x65b879){for(var _0x352f4f=0x0,_0x50d2f0=events[_0x3ee1('0x5')];_0x352f4f<_0x50d2f0;_0x352f4f++){var _0x1afad6=events[_0x352f4f];var _0x3b8be4=createListener(_0x3ee1('0x6')+_0x1afad6,_0x65b879);UserNotificationEvents['on'](_0x1afad6,_0x3b8be4);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 1099fde..146743c 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(_0x32aaf2,_0xf1647a){var _0x497b19=function(_0x4b672e){while(--_0x4b672e){_0x32aaf2['push'](_0x32aaf2['shift']());}};_0x497b19(++_0xf1647a);}(_0x70e0,0x17b));var _0x070e=function(_0x2d4957,_0x27a86c){_0x2d4957=_0x2d4957-0x0;var _0x5f358a=_0x70e0[_0x2d4957];return _0x5f358a;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x48a76f,_0x55449d){var _0x372b77=function(_0x29c389){while(--_0x29c389){_0x48a76f['push'](_0x48a76f['shift']());}};_0x372b77(++_0x55449d);}(_0xedd9,0xfc));var _0x9edd=function(_0x213297,_0x2fa599){_0x213297=_0x213297-0x0;var _0x1c6a06=_0xedd9[_0x213297];return _0x1c6a06;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index a45f938..52d69ee 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 _0xcca3=['sequelize','exports'];(function(_0x142e3c,_0x48abf8){var _0x4ca0a9=function(_0x3bfd11){while(--_0x3bfd11){_0x142e3c['push'](_0x142e3c['shift']());}};_0x4ca0a9(++_0x48abf8);}(_0xcca3,0x1a8));var _0x3cca=function(_0x32017c,_0x3991d4){_0x32017c=_0x32017c-0x0;var _0xca9140=_0xcca3[_0x32017c];return _0xca9140;};'use strict';var Sequelize=require(_0x3cca('0x0'));module[_0x3cca('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xaf1b=['INTEGER','sequelize','exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xaf1b,0x1ed));var _0xbaf1=function(_0x49f811,_0x5b6e13){_0x49f811=_0x49f811-0x0;var _0x232e98=_0xaf1b[_0x49f811];return _0x232e98;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module[_0xbaf1('0x1')]={'penalty':{'type':Sequelize[_0xbaf1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index d215330..b9944a2 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 _0xe4e4=['bluebird','request-promise','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xe4e4,0xbc));var _0x4e4e=function(_0x3811a5,_0x2400f2){_0x3811a5=_0x3811a5-0x0;var _0x418da3=_0xe4e4[_0x3811a5];return _0x418da3;};'use strict';var _=require(_0x4e4e('0x0'));var util=require(_0x4e4e('0x1'));var logger=require('../../config/logger')(_0x4e4e('0x2'));var moment=require(_0x4e4e('0x3'));var BPromise=require(_0x4e4e('0x4'));var rp=require(_0x4e4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e4e('0x6'));var attributes=require(_0x4e4e('0x7'));module[_0x4e4e('0x8')]=function(_0x16cda3,_0x186038){return _0x16cda3[_0x4e4e('0x9')](_0x4e4e('0xa'),attributes,{'tableName':_0x4e4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc852=['rimraf','../../config/environment','exports','UserOpenchannelQueue','user_has_openchannel_queues','util','api','moment','bluebird','request-promise','path'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xc852,0x89));var _0x2c85=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc852[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x2c85('0x0'));var logger=require('../../config/logger')(_0x2c85('0x1'));var moment=require(_0x2c85('0x2'));var BPromise=require(_0x2c85('0x3'));var rp=require(_0x2c85('0x4'));var fs=require('fs');var path=require(_0x2c85('0x5'));var rimraf=require(_0x2c85('0x6'));var config=require(_0x2c85('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x2c85('0x8')]=function(_0x5f53e4,_0x81dc5e){return _0x5f53e4['define'](_0x2c85('0x9'),attributes,{'tableName':_0x2c85('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 4cdd75b..1b8888c 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 _0x9189=['jayson/promise','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9189,0xac));var _0x9918=function(_0x3fe14f,_0x21486f){_0x3fe14f=_0x3fe14f-0x0;var _0x41e8a5=_0x9189[_0x3fe14f];return _0x41e8a5;};'use strict';var _=require(_0x9918('0x0'));var util=require(_0x9918('0x1'));var moment=require(_0x9918('0x2'));var BPromise=require('bluebird');var rs=require(_0x9918('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9918('0x4'));var logger=require(_0x9918('0x5'))(_0x9918('0x6'));var config=require(_0x9918('0x7'));var jayson=require(_0x9918('0x8'));var client=jayson[_0x9918('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44009d,_0x528e53,_0x25d0a8){return new BPromise(function(_0x1c96f7,_0x1b4b05){return client['request'](_0x44009d,_0x25d0a8)[_0x9918('0xa')](function(_0x12fc78){logger[_0x9918('0xb')](_0x9918('0xc'),_0x528e53,_0x9918('0xd'));logger[_0x9918('0xe')](_0x9918('0xf'),_0x528e53,_0x9918('0xd'),JSON['stringify'](_0x12fc78));if(_0x12fc78[_0x9918('0x10')]){if(_0x12fc78[_0x9918('0x10')][_0x9918('0x11')]===0x1f4){logger[_0x9918('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x528e53,_0x12fc78[_0x9918('0x10')][_0x9918('0x12')]);return _0x1b4b05(_0x12fc78[_0x9918('0x10')][_0x9918('0x12')]);}logger['error'](_0x9918('0xc'),_0x528e53,_0x12fc78[_0x9918('0x10')][_0x9918('0x12')]);return _0x1c96f7(_0x12fc78[_0x9918('0x10')]['message']);}else{logger[_0x9918('0xb')](_0x9918('0xc'),_0x528e53,_0x9918('0xd'));_0x1c96f7(_0x12fc78[_0x9918('0x13')]['message']);}})['catch'](function(_0x22ba09){logger[_0x9918('0x10')](_0x9918('0xc'),_0x528e53,_0x22ba09);_0x1b4b05(_0x22ba09);});});} \ No newline at end of file +var _0x6828=['then','request\x20sent','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1137ac,_0x353892){var _0x2ac89b=function(_0x36993a){while(--_0x36993a){_0x1137ac['push'](_0x1137ac['shift']());}};_0x2ac89b(++_0x353892);}(_0x6828,0x15c));var _0x8682=function(_0x7859a8,_0xbd2ffe){_0x7859a8=_0x7859a8-0x0;var _0x296d09=_0x6828[_0x7859a8];return _0x296d09;};'use strict';var _=require(_0x8682('0x0'));var util=require(_0x8682('0x1'));var moment=require(_0x8682('0x2'));var BPromise=require(_0x8682('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8682('0x4'));var db=require(_0x8682('0x5'))['db'];var utils=require(_0x8682('0x6'));var logger=require(_0x8682('0x7'))(_0x8682('0x8'));var config=require(_0x8682('0x9'));var jayson=require(_0x8682('0xa'));var client=jayson[_0x8682('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3febcb,_0x585099,_0x1e5fc2){return new BPromise(function(_0x32531b,_0x33c035){return client[_0x8682('0xc')](_0x3febcb,_0x1e5fc2)[_0x8682('0xd')](function(_0x31d637){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x585099,_0x8682('0xe'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x585099,_0x8682('0xe'),JSON['stringify'](_0x31d637));if(_0x31d637[_0x8682('0xf')]){if(_0x31d637[_0x8682('0xf')][_0x8682('0x10')]===0x1f4){logger['error'](_0x8682('0x11'),_0x585099,_0x31d637['error'][_0x8682('0x12')]);return _0x33c035(_0x31d637['error'][_0x8682('0x12')]);}logger[_0x8682('0xf')](_0x8682('0x11'),_0x585099,_0x31d637[_0x8682('0xf')][_0x8682('0x12')]);return _0x32531b(_0x31d637['error'][_0x8682('0x12')]);}else{logger['info'](_0x8682('0x11'),_0x585099,_0x8682('0xe'));_0x32531b(_0x31d637['result'][_0x8682('0x12')]);}})['catch'](function(_0x2887e5){logger[_0x8682('0xf')](_0x8682('0x11'),_0x585099,_0x2887e5);_0x33c035(_0x2887e5);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b6d6968..f65196b 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 _0x797b=['destroy','delete','removeSections','removeResources','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','describe','/:id','show','/:id/sections','isAuthenticated','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','put','update'];(function(_0x1c079d,_0x20dd37){var _0x4093c0=function(_0x613574){while(--_0x613574){_0x1c079d['push'](_0x1c079d['shift']());}};_0x4093c0(++_0x20dd37);}(_0x797b,0xe5));var _0xb797=function(_0x32cfed,_0x278ecd){_0x32cfed=_0x32cfed-0x0;var _0x5735e9=_0x797b[_0x32cfed];return _0x5735e9;};'use strict';var multer=require('multer');var util=require(_0xb797('0x0'));var path=require(_0xb797('0x1'));var timeout=require(_0xb797('0x2'));var express=require(_0xb797('0x3'));var router=express[_0xb797('0x4')]();var fs_extra=require(_0xb797('0x5'));var auth=require(_0xb797('0x6'));var interaction=require(_0xb797('0x7'));var config=require(_0xb797('0x8'));var controller=require(_0xb797('0x9'));router[_0xb797('0xa')]('/',auth['isAuthenticated'](),controller[_0xb797('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xb797('0xc')]);router[_0xb797('0xa')](_0xb797('0xd'),auth['isAuthenticated'](),controller[_0xb797('0xe')]);router[_0xb797('0xa')](_0xb797('0xf'),auth[_0xb797('0x10')](),controller['getSections']);router[_0xb797('0xa')](_0xb797('0x11'),auth[_0xb797('0x10')](),controller[_0xb797('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb797('0x13')]);router[_0xb797('0x14')](_0xb797('0x15'),auth[_0xb797('0x10')](),controller[_0xb797('0x16')]);router[_0xb797('0x14')](_0xb797('0xf'),auth[_0xb797('0x10')](),controller[_0xb797('0x17')]);router['post'](_0xb797('0x11'),auth[_0xb797('0x10')](),controller[_0xb797('0x18')]);router[_0xb797('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xb797('0x1a')]);router['delete'](_0xb797('0xd'),auth[_0xb797('0x10')](),controller[_0xb797('0x1b')]);router[_0xb797('0x1c')]('/:id/sections',auth[_0xb797('0x10')](),controller[_0xb797('0x1d')]);router['delete']('/:id/resources',auth[_0xb797('0x10')](),controller[_0xb797('0x1e')]);module[_0xb797('0x1f')]=router; \ No newline at end of file +var _0x9c2b=['describe','get','show','/:id/sections','getSections','/:id/resources','post','create','clone','/:id','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','isAuthenticated','index','/describe'];(function(_0x3f9684,_0x3072f4){var _0x536b86=function(_0xf0fcc8){while(--_0xf0fcc8){_0x3f9684['push'](_0x3f9684['shift']());}};_0x536b86(++_0x3072f4);}(_0x9c2b,0x1a5));var _0xb9c2=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x9c2b[_0x5f3f88];return _0xd08119;};'use strict';var multer=require('multer');var util=require(_0xb9c2('0x0'));var path=require('path');var timeout=require(_0xb9c2('0x1'));var express=require(_0xb9c2('0x2'));var router=express[_0xb9c2('0x3')]();var fs_extra=require(_0xb9c2('0x4'));var auth=require(_0xb9c2('0x5'));var interaction=require(_0xb9c2('0x6'));var config=require('../../config/environment');var controller=require(_0xb9c2('0x7'));router['get']('/',auth[_0xb9c2('0x8')](),controller[_0xb9c2('0x9')]);router['get'](_0xb9c2('0xa'),auth[_0xb9c2('0x8')](),controller[_0xb9c2('0xb')]);router[_0xb9c2('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xb9c2('0xd')]);router[_0xb9c2('0xc')](_0xb9c2('0xe'),auth['isAuthenticated'](),controller[_0xb9c2('0xf')]);router['get'](_0xb9c2('0x10'),auth[_0xb9c2('0x8')](),controller['getResources']);router[_0xb9c2('0x11')]('/',auth['isAuthenticated'](),controller[_0xb9c2('0x12')]);router['post']('/:id/clone',auth[_0xb9c2('0x8')](),controller[_0xb9c2('0x13')]);router[_0xb9c2('0x11')](_0xb9c2('0xe'),auth[_0xb9c2('0x8')](),controller['addSections']);router['post']('/:id/resources',auth[_0xb9c2('0x8')](),controller['addResources']);router['put'](_0xb9c2('0x14'),auth[_0xb9c2('0x8')](),controller[_0xb9c2('0x15')]);router[_0xb9c2('0x16')](_0xb9c2('0x14'),auth[_0xb9c2('0x8')](),controller['destroy']);router[_0xb9c2('0x16')](_0xb9c2('0xe'),auth['isAuthenticated'](),controller['removeSections']);router[_0xb9c2('0x16')](_0xb9c2('0x10'),auth['isAuthenticated'](),controller['removeResources']);module[_0xb9c2('0x17')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3035609..975feeb 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 _0x336f=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x336f,0xe0));var _0xf336=function(_0x4a5acb,_0x349e42){_0x4a5acb=_0x4a5acb-0x0;var _0x5b6004=_0x336f[_0x4a5acb];return _0x5b6004;};'use strict';var Sequelize=require(_0xf336('0x0'));module[_0xf336('0x1')]={'name':{'type':Sequelize[_0xf336('0x2')],'allowNull':![],'unique':_0xf336('0x3')},'crudPermissions':{'type':Sequelize[_0xf336('0x2')],'set':function(_0x2cd0d4){this[_0xf336('0x4')](_0xf336('0x5'),_0x2cd0d4?_0x2cd0d4[_0xf336('0x6')](''):[]);},'get':function(){return this[_0xf336('0x7')](_0xf336('0x5'))?this[_0xf336('0x7')](_0xf336('0x5'))[_0xf336('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf336('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf336('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf336('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf336('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf336('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf336('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0xabc1=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0x2b9cf5,_0x2a7804){var _0xd0cf15=function(_0x92a896){while(--_0x92a896){_0x2b9cf5['push'](_0x2b9cf5['shift']());}};_0xd0cf15(++_0x2a7804);}(_0xabc1,0x67));var _0x1abc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xabc1[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x1abc('0x0'));module[_0x1abc('0x1')]={'name':{'type':Sequelize[_0x1abc('0x2')],'allowNull':![],'unique':_0x1abc('0x3')},'crudPermissions':{'type':Sequelize[_0x1abc('0x2')],'set':function(_0x466a7a){this[_0x1abc('0x4')](_0x1abc('0x5'),_0x466a7a?_0x466a7a[_0x1abc('0x6')](''):[]);},'get':function(){return this[_0x1abc('0x7')]('crudPermissions')?this[_0x1abc('0x7')](_0x1abc('0x5'))[_0x1abc('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x1abc('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x1abc('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x1abc('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x1abc('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x1abc('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x1abc('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1abc('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1abc('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 e970822..885272b 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 _0x87d9=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87d9,0x143));var _0x987d=function(_0xbc7ea,_0x4d3f90){_0xbc7ea=_0xbc7ea-0x0;var _0xadc703=_0x87d9[_0xbc7ea];return _0xadc703;};'use strict';var emlformat=require(_0x987d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x987d('0x1'));var jsonpatch=require(_0x987d('0x2'));var rp=require(_0x987d('0x3'));var moment=require(_0x987d('0x4'));var BPromise=require(_0x987d('0x5'));var Mustache=require('mustache');var util=require(_0x987d('0x6'));var path=require('path');var sox=require(_0x987d('0x7'));var csv=require(_0x987d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x987d('0x9'));var _=require(_0x987d('0xa'));var squel=require('squel');var crypto=require(_0x987d('0xb'));var jsforce=require(_0x987d('0xc'));var deskjs=require(_0x987d('0xd'));var toCsv=require(_0x987d('0x8'));var querystring=require(_0x987d('0xe'));var Papa=require(_0x987d('0xf'));var Redis=require(_0x987d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x987d('0x11'));var as=require(_0x987d('0x12'));var hardwareService=require(_0x987d('0x13'));var logger=require(_0x987d('0x14'))('api');var utils=require(_0x987d('0x15'));var config=require(_0x987d('0x16'));var licenseUtil=require(_0x987d('0x17'));var db=require(_0x987d('0x18'))['db'];config[_0x987d('0x19')]=_[_0x987d('0x1a')](config[_0x987d('0x19')],{'host':_0x987d('0x1b'),'port':0x18eb});var socket=require(_0x987d('0x1c'))(new Redis(config['redis']));require('./userProfile.socket')[_0x987d('0x1d')](socket);function respondWithStatusCode(_0x3278a1,_0x3edda1){_0x3edda1=_0x3edda1||0xcc;return function(_0x171cdb){if(_0x171cdb){return _0x3278a1[_0x987d('0x1e')](_0x3edda1);}return _0x3278a1[_0x987d('0x1f')](_0x3edda1)[_0x987d('0x20')]();};}function respondWithResult(_0x2da457,_0x410c27){_0x410c27=_0x410c27||0xc8;return function(_0x4169cc){if(_0x4169cc){return _0x2da457[_0x987d('0x1f')](_0x410c27)[_0x987d('0x21')](_0x4169cc);}};}function respondWithFilteredResult(_0x3793ae,_0xbbeb57){return function(_0x5911b4){if(_0x5911b4){var _0x234cae=typeof _0xbbeb57[_0x987d('0x22')]==='undefined'&&typeof _0xbbeb57['limit']===_0x987d('0x23');var _0x2751a0=_0x5911b4[_0x987d('0x24')];var _0x302064=_0x234cae?0x0:_0xbbeb57['offset'];var _0x4414b7=_0x234cae?_0x5911b4[_0x987d('0x24')]:_0xbbeb57['offset']+_0xbbeb57['limit'];var _0x5fc0ba;if(_0x4414b7>=_0x2751a0){_0x4414b7=_0x2751a0;_0x5fc0ba=0xc8;}else{_0x5fc0ba=0xce;}_0x3793ae[_0x987d('0x1f')](_0x5fc0ba);return _0x3793ae[_0x987d('0x25')](_0x987d('0x26'),_0x302064+'-'+_0x4414b7+'/'+_0x2751a0)['json'](_0x5911b4);}return null;};}function patchUpdates(_0x4af12c){return function(_0x60c445){try{jsonpatch[_0x987d('0x27')](_0x60c445,_0x4af12c,!![]);}catch(_0x441090){return BPromise[_0x987d('0x28')](_0x441090);}return _0x60c445[_0x987d('0x29')]();};}function saveUpdates(_0x44f859,_0x1f907d){return function(_0x58a9b0){if(_0x58a9b0){return _0x58a9b0[_0x987d('0x2a')](_0x44f859)[_0x987d('0x2b')](function(_0x45afff){return _0x45afff;});}return null;};}function removeEntity(_0x1ed19e,_0x48a478){return function(_0x3a7837){if(_0x3a7837){return _0x3a7837[_0x987d('0x2c')]()['then'](function(){_0x1ed19e[_0x987d('0x1f')](0xcc)[_0x987d('0x20')]();});}};}function handleEntityNotFound(_0x2a5a5b,_0x1dda25){return function(_0x56812f){if(!_0x56812f){_0x2a5a5b[_0x987d('0x1e')](0x194);}return _0x56812f;};}function handleError(_0x4f567b,_0x496e48){_0x496e48=_0x496e48||0x1f4;return function(_0x19338c){logger[_0x987d('0x2d')](_0x19338c[_0x987d('0x2e')]);if(_0x19338c[_0x987d('0x2f')]){delete _0x19338c['name'];}_0x4f567b[_0x987d('0x1f')](_0x496e48)[_0x987d('0x30')](_0x19338c);};}exports[_0x987d('0x31')]=function(_0x2ff711,_0xdb9ca6){var _0x3fe550={},_0x2f831d={},_0x58a4e5={'count':0x0,'rows':[]};var _0x43247e=_[_0x987d('0x32')](db[_0x987d('0x33')][_0x987d('0x34')],function(_0x2c9a82){return{'name':_0x2c9a82[_0x987d('0x35')],'type':_0x2c9a82[_0x987d('0x36')][_0x987d('0x37')]};});_0x2f831d[_0x987d('0x38')]=_[_0x987d('0x32')](_0x43247e,_0x987d('0x2f'));_0x2f831d[_0x987d('0x39')]=_[_0x987d('0x3a')](_0x2ff711[_0x987d('0x39')]);_0x2f831d[_0x987d('0x3b')]=_[_0x987d('0x3c')](_0x2f831d['model'],_0x2f831d[_0x987d('0x39')]);_0x3fe550[_0x987d('0x3d')]=_[_0x987d('0x3c')](_0x2f831d[_0x987d('0x38')],qs['fields'](_0x2ff711[_0x987d('0x39')]['fields']));_0x3fe550[_0x987d('0x3d')]=_0x3fe550[_0x987d('0x3d')][_0x987d('0x3e')]?_0x3fe550['attributes']:_0x2f831d['model'];if(!_0x2ff711['query'][_0x987d('0x3f')](_0x987d('0x40'))){_0x3fe550[_0x987d('0x41')]=qs[_0x987d('0x41')](_0x2ff711[_0x987d('0x39')]['limit']);_0x3fe550['offset']=qs[_0x987d('0x22')](_0x2ff711[_0x987d('0x39')][_0x987d('0x22')]);}_0x3fe550[_0x987d('0x42')]=qs[_0x987d('0x43')](_0x2ff711[_0x987d('0x39')]['sort']);_0x3fe550[_0x987d('0x44')]=qs[_0x987d('0x3b')](_[_0x987d('0x45')](_0x2ff711[_0x987d('0x39')],_0x2f831d[_0x987d('0x3b')]),_0x43247e);if(_0x2ff711[_0x987d('0x39')][_0x987d('0x46')]){_0x3fe550[_0x987d('0x44')]=_[_0x987d('0x47')](_0x3fe550['where'],{'$or':_['map'](_0x43247e,function(_0x46d467){if(_0x46d467[_0x987d('0x36')]!==_0x987d('0x48')){var _0xaa1931={};_0xaa1931[_0x46d467['name']]={'$like':'%'+_0x2ff711[_0x987d('0x39')][_0x987d('0x46')]+'%'};return _0xaa1931;}})});}_0x3fe550=_['merge']({},_0x3fe550,_0x2ff711[_0x987d('0x49')]);var _0x4670b7={'where':_0x3fe550[_0x987d('0x44')]};return db['UserProfile'][_0x987d('0x24')](_0x4670b7)[_0x987d('0x2b')](function(_0x11ae60){_0x58a4e5['count']=_0x11ae60;if(_0x2ff711[_0x987d('0x39')][_0x987d('0x4a')]){_0x3fe550[_0x987d('0x4b')]=[{'all':!![]}];}return db[_0x987d('0x33')][_0x987d('0x4c')](_0x3fe550);})[_0x987d('0x2b')](function(_0x5bfdbd){_0x58a4e5[_0x987d('0x4d')]=_0x5bfdbd;return _0x58a4e5;})[_0x987d('0x2b')](respondWithFilteredResult(_0xdb9ca6,_0x3fe550))['catch'](handleError(_0xdb9ca6,null));};exports[_0x987d('0x4e')]=function(_0x56463e,_0x46e6bc){var _0xa5ab5c={'raw':![],'where':{'id':_0x56463e[_0x987d('0x4f')]['id']}},_0x4b7b9f={};_0x4b7b9f['model']=_[_0x987d('0x3a')](db[_0x987d('0x33')]['rawAttributes']);_0x4b7b9f[_0x987d('0x39')]=_[_0x987d('0x3a')](_0x56463e[_0x987d('0x39')]);_0x4b7b9f[_0x987d('0x3b')]=_[_0x987d('0x3c')](_0x4b7b9f[_0x987d('0x38')],_0x4b7b9f[_0x987d('0x39')]);_0xa5ab5c['attributes']=_[_0x987d('0x3c')](_0x4b7b9f[_0x987d('0x38')],qs['fields'](_0x56463e[_0x987d('0x39')][_0x987d('0x50')]));_0xa5ab5c['attributes']=_0xa5ab5c['attributes']['length']?_0xa5ab5c[_0x987d('0x3d')]:_0x4b7b9f[_0x987d('0x38')];if(_0x56463e['query'][_0x987d('0x4a')]){_0xa5ab5c[_0x987d('0x4b')]=[{'all':!![]}];}_0xa5ab5c=_[_0x987d('0x47')]({},_0xa5ab5c,_0x56463e[_0x987d('0x49')]);return db[_0x987d('0x33')][_0x987d('0x51')](_0xa5ab5c)[_0x987d('0x2b')](handleEntityNotFound(_0x46e6bc,null))['then'](respondWithResult(_0x46e6bc,null))[_0x987d('0x52')](handleError(_0x46e6bc,null));};exports[_0x987d('0x53')]=function(_0x1e9773,_0x5a4276){return db[_0x987d('0x33')][_0x987d('0x53')](_0x1e9773[_0x987d('0x54')],{})['then'](respondWithResult(_0x5a4276,0xc9))['catch'](handleError(_0x5a4276,null));};exports['clone']=function(_0x3ff316,_0x2082ef){var _0x2fe8db={'where':{'id':_0x3ff316['params']['id']}},_0x237661={};_0x237661[_0x987d('0x38')]=_['keys'](db[_0x987d('0x33')]['rawAttributes']);_0x2fe8db[_0x987d('0x3d')]=_[_0x987d('0x3c')](_0x237661[_0x987d('0x38')],qs[_0x987d('0x50')](_0x3ff316[_0x987d('0x39')][_0x987d('0x50')]));_0x2fe8db[_0x987d('0x3d')]=_0x2fe8db[_0x987d('0x3d')][_0x987d('0x3e')]?_0x2fe8db[_0x987d('0x3d')]:_0x237661[_0x987d('0x38')];if(_0x3ff316[_0x987d('0x39')][_0x987d('0x4a')]){_0x2fe8db[_0x987d('0x4b')]=[{'all':!![]}];}_0x2fe8db=_['merge']({},_0x2fe8db,_0x3ff316[_0x987d('0x49')]);return db[_0x987d('0x33')]['find'](_0x2fe8db)[_0x987d('0x2b')](handleEntityNotFound(_0x2082ef,null))['then'](function(_0xe4a419){if(_0xe4a419){var _0xe1b837=_0xe4a419[_0x987d('0x55')]({'plain':!![]});_0xe1b837=qs[_0x987d('0x56')](_0xe1b837,['id',_0x987d('0x57'),_0x987d('0x58'),_0x987d('0x59')]);_0x3ff316[_0x987d('0x54')]=_[_0x987d('0x56')](_0x3ff316[_0x987d('0x54')],['id','createdAt','updatedAt']);return db['sequelize'][_0x987d('0x5a')](function(_0x840e59){return db['UserProfile'][_0x987d('0x53')](_[_0x987d('0x47')](_0xe1b837,_0x3ff316['body']),{'include':_0x3ff316[_0x987d('0x39')][_0x987d('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x840e59})[_0x987d('0x2b')](function(_0x24ad42){var _0x2586fd=_0x24ad42[_0x987d('0x55')]({'plain':!![]});return db[_0x987d('0x5b')][_0x987d('0x4c')]({'where':{'userProfileId':_0x3ff316[_0x987d('0x4f')]['id']},'raw':!![]})['then'](function(_0x561ba0){if(_0x561ba0){return BPromise[_0x987d('0x5c')](_0x561ba0,function(_0x1ed9ea){return new BPromise(function(_0x587ff,_0x403509){if(_0x1ed9ea[_0x987d('0x5d')]===null||_0x1ed9ea[_0x987d('0x5d')]===0x1)_0x587ff(null);return db[_0x987d('0x5e')][_0x987d('0x4c')]({'where':{'sectionId':_0x1ed9ea['id']},'raw':!![]})[_0x987d('0x2b')](function(_0x124d06){var _0x46030b=_[_0x987d('0x32')](_0x124d06,function(_0x4ae3c9){return qs[_0x987d('0x56')](_0x4ae3c9,['id',_0x987d('0x57'),_0x987d('0x58'),_0x987d('0x5f')]);});_0x587ff(_0x46030b);})[_0x987d('0x52')](function(_0x2ce4a8){_0x403509(_0x2ce4a8);});})[_0x987d('0x2b')](function(_0x2638bc){var _0x18467b=qs[_0x987d('0x56')](_0x1ed9ea,['id',_0x987d('0x57'),_0x987d('0x58')]);_0x18467b[_0x987d('0x60')]=_0x2586fd['id'];if(_0x2638bc)_0x18467b[_0x987d('0x61')]=_0x2638bc;return _0x18467b;})[_0x987d('0x2b')](function(_0x1bec4c){return db['UserProfileSection'][_0x987d('0x53')](_0x1bec4c,{'include':[{'model':db[_0x987d('0x5e')],'as':_0x987d('0x61')}],'raw':!![],'transaction':_0x840e59});});})['then'](function(){return _0x2586fd;});}});});});}})[_0x987d('0x2b')](respondWithResult(_0x2082ef,0xc9))[_0x987d('0x52')](handleError(_0x2082ef,null));};exports['update']=function(_0x2af8d1,_0x57104f){if(_0x2af8d1['body']['id']){delete _0x2af8d1[_0x987d('0x54')]['id'];}return db['UserProfile'][_0x987d('0x51')]({'where':{'id':_0x2af8d1[_0x987d('0x4f')]['id']}})[_0x987d('0x2b')](handleEntityNotFound(_0x57104f,null))['then'](saveUpdates(_0x2af8d1[_0x987d('0x54')],null))[_0x987d('0x2b')](respondWithResult(_0x57104f,null))[_0x987d('0x52')](handleError(_0x57104f,null));};exports[_0x987d('0x2c')]=function(_0x24c2fa,_0x1372a7){return db[_0x987d('0x33')][_0x987d('0x51')]({'where':{'id':_0x24c2fa[_0x987d('0x4f')]['id']}})[_0x987d('0x2b')](handleEntityNotFound(_0x1372a7,null))[_0x987d('0x2b')](removeEntity(_0x1372a7,null))['catch'](handleError(_0x1372a7,null));};exports[_0x987d('0x62')]=function(_0x356c0b,_0x2ed655){return db[_0x987d('0x33')]['describe']()[_0x987d('0x2b')](respondWithResult(_0x2ed655,null))['catch'](handleError(_0x2ed655,null));};exports[_0x987d('0x63')]=function(_0x2849b6,_0x28069e){var _0xd2a215=_0x2849b6['body'];return db[_0x987d('0x33')][_0x987d('0x51')]({'where':{'id':_0x2849b6[_0x987d('0x4f')]['id']}})[_0x987d('0x2b')](handleEntityNotFound(_0x28069e,null))[_0x987d('0x2b')](function(_0x3b2575){if(_0x3b2575){return db['sequelize']['transaction'](function(_0x2c8edb){return db['UserProfileSection'][_0x987d('0x2c')]({'where':{'userProfileId':_0x2849b6[_0x987d('0x4f')]['id'],'sectionId':_[_0x987d('0x32')](_0xd2a215,function(_0x29a92d){return _0x29a92d[_0x987d('0x5f')];})},'transaction':_0x2c8edb})[_0x987d('0x2b')](function(){var _0x29ad1e=_[_0x987d('0x32')](_0xd2a215,function(_0x24c1f1){_0x24c1f1['userProfileId']=_0x2849b6[_0x987d('0x4f')]['id'];return _0x24c1f1;});var _0x103f56=[];return BPromise[_0x987d('0x5c')](_0x29ad1e,function(_0x389352){return db[_0x987d('0x5b')]['create'](_0x389352,{'include':[{'model':db[_0x987d('0x5e')],'as':_0x987d('0x61')}],'raw':!![],'transaction':_0x2c8edb})[_0x987d('0x2b')](function(_0x4dd808){_0x103f56[_0x987d('0x64')](_0x4dd808['get']({'plain':!![]}));});})['then'](function(){return _0x103f56;});});});}})[_0x987d('0x2b')](function(_0x54e84a){return _0x54e84a;})[_0x987d('0x2b')](respondWithResult(_0x28069e,null))[_0x987d('0x52')](handleError(_0x28069e,null));};exports['removeSections']=function(_0x431008,_0x2ca297){var _0x48121f;return db[_0x987d('0x33')][_0x987d('0x51')]({'where':{'id':_0x431008[_0x987d('0x4f')]['id']},'attributes':['id',_0x987d('0x2f')]})['then'](handleEntityNotFound(_0x2ca297,null))[_0x987d('0x2b')](function(_0x14f37e){if(_0x14f37e){_0x48121f=_0x14f37e;return db[_0x987d('0x5b')][_0x987d('0x2c')]({'where':{'userProfileId':_0x431008[_0x987d('0x4f')]['id'],'sectionId':_0x431008[_0x987d('0x39')][_0x987d('0x65')]}});}})[_0x987d('0x2b')](function(){return _0x48121f;})['then'](respondWithStatusCode(_0x2ca297,null))[_0x987d('0x52')](handleError(_0x2ca297,null));};exports[_0x987d('0x66')]=function(_0x2e60ce,_0x5d3ac8){var _0x16c731=[];var _0x4df863=[];return db[_0x987d('0x5b')][_0x987d('0x4c')]({'where':{'userProfileId':_0x2e60ce['params']['id']},'raw':!![]})[_0x987d('0x2b')](function(_0x326ad4){_0x16c731=_[_0x987d('0x46')](_0x326ad4,function(_0x10c8d5){return _0x10c8d5[_0x987d('0x67')]===0x1||_[_0x987d('0x68')]([0x3eb,0x709],_0x10c8d5[_0x987d('0x5f')]);});if(!_[_0x987d('0x69')](_0x16c731)){return _[_0x987d('0x32')](_0x16c731,function(_0x39ae21){return _0x39ae21['sectionId'];});}else{return;}})[_0x987d('0x2b')](function(_0x1b0bd1){if(_0x1b0bd1)_0x4df863=_0x1b0bd1;if(_[_0x987d('0x68')](_0x4df863,0x64)){var _0x33d993=_[_0x987d('0x51')](_0x16c731,{'sectionId':0x64});return hasDefaultDashboard(_0x33d993)[_0x987d('0x2b')](function(_0x4c4895){return _[_0x987d('0x32')](_0x16c731,function(_0x3ea3f2){if(_0x3ea3f2[_0x987d('0x5f')]===0x64){_0x3ea3f2['subsections']=_0x4c4895;}return _0x3ea3f2;});});}else{return;}})['then'](function(_0x3e36a7){if(_0x3e36a7)_0x16c731=_0x3e36a7;if(_[_0x987d('0x68')](_0x4df863,0x3eb)){var _0x5b1e1f=_[_0x987d('0x51')](_0x16c731,{'sectionId':0x3eb});return getCustomDashboards(_0x5b1e1f)[_0x987d('0x2b')](function(_0x49bea5){return _[_0x987d('0x32')](_0x16c731,function(_0x216ae3){if(_0x5b1e1f[_0x987d('0x67')]){if(_0x216ae3[_0x987d('0x5f')]===0x3eb){_0x216ae3[_0x987d('0x6a')]=_0x49bea5;}}else{if(_0x216ae3[_0x987d('0x5f')]===0x64){_0x216ae3[_0x987d('0x6a')]=_0x49bea5;}}return _0x216ae3;});});}else{return;}})[_0x987d('0x2b')](function(_0x5a9fe1){if(_0x5a9fe1)_0x16c731=_0x5a9fe1;if(_[_0x987d('0x68')](_0x4df863,0x709)){var _0x10abfe=_[_0x987d('0x51')](_0x16c731,{'sectionId':0x709});return getPlugins(_0x10abfe)[_0x987d('0x2b')](function(_0x58be07){if(_0x10abfe['enabled']){return _[_0x987d('0x32')](_0x16c731,function(_0x55c3a0){if(_0x55c3a0['sectionId']===0x709){_0x55c3a0['subsections']=_0x58be07;}return _0x55c3a0;});}else{var _0x50cbf6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x58be07};var _0x5b9ea8=_[_0x987d('0x32')](_0x16c731);_0x5b9ea8[_0x987d('0x64')](_0x50cbf6);return _0x5b9ea8;}});}else{return;}})[_0x987d('0x2b')](function(_0x375913){if(_0x375913)_0x16c731=_0x375913;return _[_0x987d('0x46')](_0x16c731,[_0x987d('0x67'),0x1]);})['then'](respondWithResult(_0x5d3ac8,null))[_0x987d('0x52')](handleError(_0x5d3ac8,null));};function hasDefaultDashboard(_0x215035){var _0x3e5024=[0x65];return new BPromise(function(_0x9197d3,_0x1ce15c){try{if(_0x215035[_0x987d('0x5d')]){_0x9197d3(_0x3e5024);}else{return db['UserProfileResource'][_0x987d('0x6b')]({'where':{'sectionId':_0x215035['id']},'raw':!![]})[_0x987d('0x2b')](function(_0xde2056){_0xde2056?_0x9197d3(_0x3e5024):_0x9197d3();});}}catch(_0x2c4bbd){_0x1ce15c(_0x2c4bbd);}});}function getCustomDashboards(_0x2e51f0){var _0x37f5f7=[];return new BPromise(function(_0x1b7634,_0x1020d6){try{if(_0x2e51f0[_0x987d('0x5d')]){return db['Dashboard'][_0x987d('0x4c')]({'raw':!![]})['then'](function(_0xf78cef){_0xf78cef[_0x987d('0x6c')](function(_0x3e82b5){_0x37f5f7[_0x987d('0x64')](_0x3e82b5['id']+0x1869f);});_0x1b7634(_0x37f5f7);});}else{return db[_0x987d('0x5e')][_0x987d('0x4c')]({'where':{'sectionId':_0x2e51f0['id']},'raw':!![]})[_0x987d('0x2b')](function(_0x9998d9){_0x9998d9[_0x987d('0x6c')](function(_0x338d32){_0x37f5f7[_0x987d('0x64')](_0x338d32[_0x987d('0x6d')]+0x1869f);});_0x1b7634(_0x37f5f7);});}}catch(_0x47b7aa){_0x1020d6(_0x47b7aa);}});}function getPlugins(_0x4b74f1){var _0x4d8825=[];return new BPromise(function(_0x4b9e84,_0x38d23b){try{if(_0x4b74f1[_0x987d('0x5d')]){return db[_0x987d('0x6e')][_0x987d('0x4c')]({'raw':!![]})['then'](function(_0x38d027){_0x38d027[_0x987d('0x6c')](function(_0x506c66){_0x4d8825['push'](_0x506c66['id']+0x15b38);});_0x4b9e84(_0x4d8825);});}else{return db['UserProfileResource'][_0x987d('0x4c')]({'where':{'sectionId':_0x4b74f1['id']},'raw':!![]})[_0x987d('0x2b')](function(_0x282505){_0x282505[_0x987d('0x6c')](function(_0x20eec8){_0x4d8825[_0x987d('0x64')](_0x20eec8['resourceId']+0x15b38);});_0x4b9e84(_0x4d8825);});}}catch(_0x147171){_0x38d23b(_0x147171);}});}exports[_0x987d('0x6f')]=function(_0x1c20a2,_0x314817){return db['UserProfile'][_0x987d('0x51')]({'where':{'id':_0x1c20a2[_0x987d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x314817,null))[_0x987d('0x2b')](function(_0x2901f4){if(_0x2901f4){return db['sequelize'][_0x987d('0x5a')](function(_0x1e307d){return db[_0x987d('0x5b')]['findAll']({'where':{'userProfileId':_0x1c20a2[_0x987d('0x4f')]['id']},'attributes':['id'],'raw':!![]})[_0x987d('0x2b')](function(_0x42c10a){if(_0x42c10a){return db[_0x987d('0x5b')][_0x987d('0x2c')]({'where':{'userProfileId':_0x1c20a2[_0x987d('0x4f')]['id'],'id':_[_0x987d('0x32')](_0x42c10a,function(_0x5d6ed3){return _0x5d6ed3['id'];})},'transaction':_0x1e307d});}})[_0x987d('0x2b')](function(_0x2496b0){var _0x21199c=_[_0x987d('0x32')](_0x1c20a2['body'],function(_0x295825){_0x295825['userProfileId']=_0x1c20a2[_0x987d('0x4f')]['id'];return _0x295825;});return db[_0x987d('0x5b')][_0x987d('0x70')](_0x21199c,{'raw':!![],'transaction':_0x1e307d});})[_0x987d('0x2b')](function(_0x27d451){var _0x39d90b=_[_0x987d('0x46')](_[_0x987d('0x32')](_0x27d451,function(_0x338556){return _0x338556['get']({'plain':!![]});}),{'includeAll':![]});if(_0x39d90b){return db[_0x987d('0x5b')][_0x987d('0x4c')]({'where':{'userProfileId':_0x1c20a2[_0x987d('0x4f')]['id'],'sectionId':_[_0x987d('0x32')](_0x39d90b,function(_0x833dd6){return _0x833dd6[_0x987d('0x5f')];})},'attributes':['id',_0x987d('0x5f')],'raw':!![]})[_0x987d('0x2b')](function(_0x2d0efa){var _0x4c9e4c=_[_0x987d('0x32')](_0x1c20a2[_0x987d('0x54')],function(_0x2654ae){_0x2654ae[_0x987d('0x60')]=_0x1c20a2[_0x987d('0x4f')]['id'];return _0x2654ae;});return db[_0x987d('0x5e')]['bulkCreate'](_0x4c9e4c,{'raw':!![],'transaction':_0x1e307d});});}})[_0x987d('0x52')](handleError(_0x314817,null));});}})['then'](function(_0x8d7e4d){var _0x45b182=_[_0x987d('0x32')](_0x8d7e4d,function(_0x49aab3){return _0x49aab3[_0x987d('0x55')]({'plain':!![]});});})['then'](respondWithResult(_0x314817,null))[_0x987d('0x52')](handleError(_0x314817,null));};exports[_0x987d('0x71')]=function(_0x5653d2,_0x1ebeab,_0x177c54){return db['UserProfile']['find']({'where':{'id':_0x5653d2[_0x987d('0x4f')]['id']}})[_0x987d('0x2b')](handleEntityNotFound(_0x1ebeab,null))[_0x987d('0x2b')](function(_0x34a86c){if(_0x34a86c){return _0x34a86c[_0x987d('0x71')](_0x5653d2[_0x987d('0x39')][_0x987d('0x65')]);}})[_0x987d('0x2b')](respondWithStatusCode(_0x1ebeab,null))[_0x987d('0x52')](handleError(_0x1ebeab,null));};exports['getResources']=function(_0x5bc24c,_0x18d907){var _0x459bd5={};if(!_0x5bc24c[_0x987d('0x39')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x5bc24c['query'][_0x987d('0x3f')](_0x987d('0x40'))){_0x459bd5[_0x987d('0x41')]=qs[_0x987d('0x41')](_0x5bc24c[_0x987d('0x39')][_0x987d('0x41')]);_0x459bd5[_0x987d('0x22')]=qs[_0x987d('0x22')](_0x5bc24c[_0x987d('0x39')]['offset']);}return db[_0x987d('0x33')][_0x987d('0x51')]({'where':{'id':_0x5bc24c[_0x987d('0x4f')]['id']}})[_0x987d('0x2b')](function(_0x466933){if(!_0x466933)throw new Error(_0x987d('0x72')+_0x5bc24c['params']['id']);return db[_0x987d('0x33')][_0x987d('0x73')](_0x5bc24c);})[_0x987d('0x2b')](respondWithFilteredResult(_0x18d907,_0x459bd5))[_0x987d('0x52')](handleError(_0x18d907,null));}; \ No newline at end of file +var _0xf4c9=['zip-dir','request-promise','bluebird','mustache','util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','socket.io-emitter','register','status','end','offset','limit','undefined','count','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','UserProfile','includeAll','include','rows','catch','show','keys','find','create','body','clone','get','omit','updatedAt','crudPermissions','sequelize','UserProfileSection','findAll','params','each','autoAssociation','UserProfileResource','createdAt','sectionId','userProfileId','Resources','describe','removeSections','ids','getSections','includes','enabled','subsections','push','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf'];(function(_0x224a6b,_0x3e57fb){var _0x50e049=function(_0x5f1f44){while(--_0x5f1f44){_0x224a6b['push'](_0x224a6b['shift']());}};_0x50e049(++_0x3e57fb);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xf4c9[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0x9f4c('0x0'));var rimraf=require(_0x9f4c('0x1'));var zipdir=require(_0x9f4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f4c('0x3'));var moment=require('moment');var BPromise=require(_0x9f4c('0x4'));var Mustache=require(_0x9f4c('0x5'));var util=require(_0x9f4c('0x6'));var path=require('path');var sox=require(_0x9f4c('0x7'));var csv=require('to-csv');var ejs=require(_0x9f4c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f4c('0x9'));var jsforce=require(_0x9f4c('0xa'));var deskjs=require(_0x9f4c('0xb'));var toCsv=require(_0x9f4c('0xc'));var querystring=require(_0x9f4c('0xd'));var Papa=require(_0x9f4c('0xe'));var Redis=require('ioredis');var authService=require(_0x9f4c('0xf'));var qs=require(_0x9f4c('0x10'));var as=require(_0x9f4c('0x11'));var hardwareService=require(_0x9f4c('0x12'));var logger=require(_0x9f4c('0x13'))(_0x9f4c('0x14'));var utils=require(_0x9f4c('0x15'));var config=require(_0x9f4c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x9f4c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9f4c('0x18'))(new Redis(config['redis']));require('./userProfile.socket')[_0x9f4c('0x19')](socket);function respondWithStatusCode(_0x4ce352,_0x4d68ff){_0x4d68ff=_0x4d68ff||0xcc;return function(_0x1bcf14){if(_0x1bcf14){return _0x4ce352['sendStatus'](_0x4d68ff);}return _0x4ce352[_0x9f4c('0x1a')](_0x4d68ff)[_0x9f4c('0x1b')]();};}function respondWithResult(_0x46abfe,_0x1059e1){_0x1059e1=_0x1059e1||0xc8;return function(_0x182295){if(_0x182295){return _0x46abfe[_0x9f4c('0x1a')](_0x1059e1)['json'](_0x182295);}};}function respondWithFilteredResult(_0x2be1ba,_0x1b5146){return function(_0x143335){if(_0x143335){var _0x30da19=typeof _0x1b5146[_0x9f4c('0x1c')]==='undefined'&&typeof _0x1b5146[_0x9f4c('0x1d')]===_0x9f4c('0x1e');var _0x8efbfe=_0x143335['count'];var _0x4a33c7=_0x30da19?0x0:_0x1b5146['offset'];var _0x53d301=_0x30da19?_0x143335[_0x9f4c('0x1f')]:_0x1b5146['offset']+_0x1b5146['limit'];var _0x603a8d;if(_0x53d301>=_0x8efbfe){_0x53d301=_0x8efbfe;_0x603a8d=0xc8;}else{_0x603a8d=0xce;}_0x2be1ba[_0x9f4c('0x1a')](_0x603a8d);return _0x2be1ba['set'](_0x9f4c('0x20'),_0x4a33c7+'-'+_0x53d301+'/'+_0x8efbfe)[_0x9f4c('0x21')](_0x143335);}return null;};}function patchUpdates(_0x57b636){return function(_0x27a175){try{jsonpatch['apply'](_0x27a175,_0x57b636,!![]);}catch(_0x5e6632){return BPromise[_0x9f4c('0x22')](_0x5e6632);}return _0x27a175['save']();};}function saveUpdates(_0xa4a8e9,_0x30d9f6){return function(_0x2a8729){if(_0x2a8729){return _0x2a8729[_0x9f4c('0x23')](_0xa4a8e9)[_0x9f4c('0x24')](function(_0x10c9a9){return _0x10c9a9;});}return null;};}function removeEntity(_0x53c2d3,_0x25b775){return function(_0x1c2417){if(_0x1c2417){return _0x1c2417[_0x9f4c('0x25')]()[_0x9f4c('0x24')](function(){_0x53c2d3[_0x9f4c('0x1a')](0xcc)[_0x9f4c('0x1b')]();});}};}function handleEntityNotFound(_0x945f00,_0xadd84c){return function(_0x3bcc3f){if(!_0x3bcc3f){_0x945f00[_0x9f4c('0x26')](0x194);}return _0x3bcc3f;};}function handleError(_0x4712c7,_0x4f0d37){_0x4f0d37=_0x4f0d37||0x1f4;return function(_0x168ed8){logger[_0x9f4c('0x27')](_0x168ed8[_0x9f4c('0x28')]);if(_0x168ed8[_0x9f4c('0x29')]){delete _0x168ed8[_0x9f4c('0x29')];}_0x4712c7[_0x9f4c('0x1a')](_0x4f0d37)[_0x9f4c('0x2a')](_0x168ed8);};}exports[_0x9f4c('0x2b')]=function(_0x20d2f4,_0x2158ac){var _0x4e9b77={},_0x4b6d91={},_0x52ef31={'count':0x0,'rows':[]};var _0x101c13=_[_0x9f4c('0x2c')](db['UserProfile'][_0x9f4c('0x2d')],function(_0x8cd2b3){return{'name':_0x8cd2b3[_0x9f4c('0x2e')],'type':_0x8cd2b3['type']['key']};});_0x4b6d91[_0x9f4c('0x2f')]=_[_0x9f4c('0x2c')](_0x101c13,'name');_0x4b6d91[_0x9f4c('0x30')]=_['keys'](_0x20d2f4['query']);_0x4b6d91[_0x9f4c('0x31')]=_[_0x9f4c('0x32')](_0x4b6d91[_0x9f4c('0x2f')],_0x4b6d91[_0x9f4c('0x30')]);_0x4e9b77[_0x9f4c('0x33')]=_[_0x9f4c('0x32')](_0x4b6d91['model'],qs[_0x9f4c('0x34')](_0x20d2f4[_0x9f4c('0x30')][_0x9f4c('0x34')]));_0x4e9b77[_0x9f4c('0x33')]=_0x4e9b77[_0x9f4c('0x33')][_0x9f4c('0x35')]?_0x4e9b77[_0x9f4c('0x33')]:_0x4b6d91[_0x9f4c('0x2f')];if(!_0x20d2f4[_0x9f4c('0x30')][_0x9f4c('0x36')](_0x9f4c('0x37'))){_0x4e9b77[_0x9f4c('0x1d')]=qs[_0x9f4c('0x1d')](_0x20d2f4['query'][_0x9f4c('0x1d')]);_0x4e9b77['offset']=qs[_0x9f4c('0x1c')](_0x20d2f4[_0x9f4c('0x30')][_0x9f4c('0x1c')]);}_0x4e9b77[_0x9f4c('0x38')]=qs[_0x9f4c('0x39')](_0x20d2f4[_0x9f4c('0x30')][_0x9f4c('0x39')]);_0x4e9b77[_0x9f4c('0x3a')]=qs[_0x9f4c('0x31')](_[_0x9f4c('0x3b')](_0x20d2f4[_0x9f4c('0x30')],_0x4b6d91[_0x9f4c('0x31')]),_0x101c13);if(_0x20d2f4['query'][_0x9f4c('0x3c')]){_0x4e9b77[_0x9f4c('0x3a')]=_[_0x9f4c('0x3d')](_0x4e9b77['where'],{'$or':_[_0x9f4c('0x2c')](_0x101c13,function(_0x380c08){if(_0x380c08[_0x9f4c('0x3e')]!=='VIRTUAL'){var _0xb58e5a={};_0xb58e5a[_0x380c08[_0x9f4c('0x29')]]={'$like':'%'+_0x20d2f4[_0x9f4c('0x30')][_0x9f4c('0x3c')]+'%'};return _0xb58e5a;}})});}_0x4e9b77=_[_0x9f4c('0x3d')]({},_0x4e9b77,_0x20d2f4[_0x9f4c('0x3f')]);var _0x44b920={'where':_0x4e9b77[_0x9f4c('0x3a')]};return db[_0x9f4c('0x40')][_0x9f4c('0x1f')](_0x44b920)['then'](function(_0x167363){_0x52ef31[_0x9f4c('0x1f')]=_0x167363;if(_0x20d2f4['query'][_0x9f4c('0x41')]){_0x4e9b77[_0x9f4c('0x42')]=[{'all':!![]}];}return db[_0x9f4c('0x40')]['findAll'](_0x4e9b77);})[_0x9f4c('0x24')](function(_0x4da3ed){_0x52ef31[_0x9f4c('0x43')]=_0x4da3ed;return _0x52ef31;})['then'](respondWithFilteredResult(_0x2158ac,_0x4e9b77))[_0x9f4c('0x44')](handleError(_0x2158ac,null));};exports[_0x9f4c('0x45')]=function(_0x10437e,_0x437558){var _0x3ee559={'raw':![],'where':{'id':_0x10437e['params']['id']}},_0x51553d={};_0x51553d[_0x9f4c('0x2f')]=_[_0x9f4c('0x46')](db[_0x9f4c('0x40')]['rawAttributes']);_0x51553d[_0x9f4c('0x30')]=_['keys'](_0x10437e['query']);_0x51553d[_0x9f4c('0x31')]=_['intersection'](_0x51553d[_0x9f4c('0x2f')],_0x51553d[_0x9f4c('0x30')]);_0x3ee559[_0x9f4c('0x33')]=_['intersection'](_0x51553d[_0x9f4c('0x2f')],qs['fields'](_0x10437e[_0x9f4c('0x30')][_0x9f4c('0x34')]));_0x3ee559[_0x9f4c('0x33')]=_0x3ee559[_0x9f4c('0x33')]['length']?_0x3ee559[_0x9f4c('0x33')]:_0x51553d['model'];if(_0x10437e[_0x9f4c('0x30')]['includeAll']){_0x3ee559[_0x9f4c('0x42')]=[{'all':!![]}];}_0x3ee559=_[_0x9f4c('0x3d')]({},_0x3ee559,_0x10437e['options']);return db[_0x9f4c('0x40')][_0x9f4c('0x47')](_0x3ee559)['then'](handleEntityNotFound(_0x437558,null))[_0x9f4c('0x24')](respondWithResult(_0x437558,null))['catch'](handleError(_0x437558,null));};exports[_0x9f4c('0x48')]=function(_0x384f47,_0x5b8fca){return db['UserProfile']['create'](_0x384f47[_0x9f4c('0x49')],{})[_0x9f4c('0x24')](respondWithResult(_0x5b8fca,0xc9))['catch'](handleError(_0x5b8fca,null));};exports[_0x9f4c('0x4a')]=function(_0x16e255,_0xf684a1){var _0x4e0d96={'where':{'id':_0x16e255['params']['id']}},_0x1c4eba={};_0x1c4eba[_0x9f4c('0x2f')]=_[_0x9f4c('0x46')](db['UserProfile']['rawAttributes']);_0x4e0d96[_0x9f4c('0x33')]=_[_0x9f4c('0x32')](_0x1c4eba['model'],qs[_0x9f4c('0x34')](_0x16e255[_0x9f4c('0x30')][_0x9f4c('0x34')]));_0x4e0d96['attributes']=_0x4e0d96['attributes'][_0x9f4c('0x35')]?_0x4e0d96[_0x9f4c('0x33')]:_0x1c4eba[_0x9f4c('0x2f')];if(_0x16e255[_0x9f4c('0x30')]['includeAll']){_0x4e0d96[_0x9f4c('0x42')]=[{'all':!![]}];}_0x4e0d96=_[_0x9f4c('0x3d')]({},_0x4e0d96,_0x16e255[_0x9f4c('0x3f')]);return db[_0x9f4c('0x40')][_0x9f4c('0x47')](_0x4e0d96)[_0x9f4c('0x24')](handleEntityNotFound(_0xf684a1,null))[_0x9f4c('0x24')](function(_0x1e88b0){if(_0x1e88b0){var _0x20ea33=_0x1e88b0[_0x9f4c('0x4b')]({'plain':!![]});_0x20ea33=qs[_0x9f4c('0x4c')](_0x20ea33,['id','createdAt',_0x9f4c('0x4d'),_0x9f4c('0x4e')]);_0x16e255[_0x9f4c('0x49')]=_[_0x9f4c('0x4c')](_0x16e255[_0x9f4c('0x49')],['id','createdAt','updatedAt']);return db[_0x9f4c('0x4f')]['transaction'](function(_0x1e10fa){return db['UserProfile'][_0x9f4c('0x48')](_[_0x9f4c('0x3d')](_0x20ea33,_0x16e255[_0x9f4c('0x49')]),{'include':_0x16e255[_0x9f4c('0x30')][_0x9f4c('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x1e10fa})[_0x9f4c('0x24')](function(_0x559c65){var _0x1a4384=_0x559c65[_0x9f4c('0x4b')]({'plain':!![]});return db[_0x9f4c('0x50')][_0x9f4c('0x51')]({'where':{'userProfileId':_0x16e255[_0x9f4c('0x52')]['id']},'raw':!![]})['then'](function(_0xfd42ef){if(_0xfd42ef){return BPromise[_0x9f4c('0x53')](_0xfd42ef,function(_0x3e4c79){return new BPromise(function(_0x1557c1,_0x13c74b){if(_0x3e4c79[_0x9f4c('0x54')]===null||_0x3e4c79[_0x9f4c('0x54')]===0x1)_0x1557c1(null);return db[_0x9f4c('0x55')][_0x9f4c('0x51')]({'where':{'sectionId':_0x3e4c79['id']},'raw':!![]})['then'](function(_0x173d28){var _0x2d6e11=_[_0x9f4c('0x2c')](_0x173d28,function(_0xbc4737){return qs[_0x9f4c('0x4c')](_0xbc4737,['id',_0x9f4c('0x56'),'updatedAt',_0x9f4c('0x57')]);});_0x1557c1(_0x2d6e11);})[_0x9f4c('0x44')](function(_0x99b425){_0x13c74b(_0x99b425);});})[_0x9f4c('0x24')](function(_0x34ce5d){var _0xa3daa8=qs['omit'](_0x3e4c79,['id','createdAt','updatedAt']);_0xa3daa8[_0x9f4c('0x58')]=_0x1a4384['id'];if(_0x34ce5d)_0xa3daa8[_0x9f4c('0x59')]=_0x34ce5d;return _0xa3daa8;})[_0x9f4c('0x24')](function(_0x4fe718){return db[_0x9f4c('0x50')][_0x9f4c('0x48')](_0x4fe718,{'include':[{'model':db[_0x9f4c('0x55')],'as':_0x9f4c('0x59')}],'raw':!![],'transaction':_0x1e10fa});});})[_0x9f4c('0x24')](function(){return _0x1a4384;});}});});});}})[_0x9f4c('0x24')](respondWithResult(_0xf684a1,0xc9))[_0x9f4c('0x44')](handleError(_0xf684a1,null));};exports[_0x9f4c('0x23')]=function(_0x2ecb9a,_0x10ba77){if(_0x2ecb9a['body']['id']){delete _0x2ecb9a[_0x9f4c('0x49')]['id'];}return db[_0x9f4c('0x40')][_0x9f4c('0x47')]({'where':{'id':_0x2ecb9a[_0x9f4c('0x52')]['id']}})['then'](handleEntityNotFound(_0x10ba77,null))['then'](saveUpdates(_0x2ecb9a['body'],null))[_0x9f4c('0x24')](respondWithResult(_0x10ba77,null))[_0x9f4c('0x44')](handleError(_0x10ba77,null));};exports['destroy']=function(_0x40847e,_0x5a3b8a){return db['UserProfile'][_0x9f4c('0x47')]({'where':{'id':_0x40847e['params']['id']}})[_0x9f4c('0x24')](handleEntityNotFound(_0x5a3b8a,null))[_0x9f4c('0x24')](removeEntity(_0x5a3b8a,null))['catch'](handleError(_0x5a3b8a,null));};exports[_0x9f4c('0x5a')]=function(_0x4c99dd,_0x5b8a31){return db[_0x9f4c('0x40')][_0x9f4c('0x5a')]()[_0x9f4c('0x24')](respondWithResult(_0x5b8a31,null))[_0x9f4c('0x44')](handleError(_0x5b8a31,null));};exports['addSections']=function(_0x33967a,_0x5514a1){var _0x5505f3=_0x33967a[_0x9f4c('0x49')];return db['UserProfile'][_0x9f4c('0x47')]({'where':{'id':_0x33967a[_0x9f4c('0x52')]['id']}})[_0x9f4c('0x24')](handleEntityNotFound(_0x5514a1,null))[_0x9f4c('0x24')](function(_0x240b8b){if(_0x240b8b){return db['sequelize']['transaction'](function(_0x5a73d6){return db[_0x9f4c('0x50')]['destroy']({'where':{'userProfileId':_0x33967a[_0x9f4c('0x52')]['id'],'sectionId':_[_0x9f4c('0x2c')](_0x5505f3,function(_0x4d8007){return _0x4d8007['sectionId'];})},'transaction':_0x5a73d6})[_0x9f4c('0x24')](function(){var _0x394d4d=_[_0x9f4c('0x2c')](_0x5505f3,function(_0x3dee3d){_0x3dee3d['userProfileId']=_0x33967a[_0x9f4c('0x52')]['id'];return _0x3dee3d;});var _0xd4367c=[];return BPromise[_0x9f4c('0x53')](_0x394d4d,function(_0x21b0db){return db['UserProfileSection']['create'](_0x21b0db,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x5a73d6})['then'](function(_0x2b752d){_0xd4367c['push'](_0x2b752d[_0x9f4c('0x4b')]({'plain':!![]}));});})[_0x9f4c('0x24')](function(){return _0xd4367c;});});});}})['then'](function(_0x4e5f79){return _0x4e5f79;})[_0x9f4c('0x24')](respondWithResult(_0x5514a1,null))[_0x9f4c('0x44')](handleError(_0x5514a1,null));};exports[_0x9f4c('0x5b')]=function(_0x1c16b4,_0x5e67d7){var _0x737785;return db['UserProfile']['find']({'where':{'id':_0x1c16b4['params']['id']},'attributes':['id',_0x9f4c('0x29')]})[_0x9f4c('0x24')](handleEntityNotFound(_0x5e67d7,null))['then'](function(_0x2f29b8){if(_0x2f29b8){_0x737785=_0x2f29b8;return db[_0x9f4c('0x50')][_0x9f4c('0x25')]({'where':{'userProfileId':_0x1c16b4[_0x9f4c('0x52')]['id'],'sectionId':_0x1c16b4[_0x9f4c('0x30')][_0x9f4c('0x5c')]}});}})[_0x9f4c('0x24')](function(){return _0x737785;})[_0x9f4c('0x24')](respondWithStatusCode(_0x5e67d7,null))[_0x9f4c('0x44')](handleError(_0x5e67d7,null));};exports[_0x9f4c('0x5d')]=function(_0x35bec2,_0x187c52){var _0x289028=[];var _0x4804af=[];return db[_0x9f4c('0x50')][_0x9f4c('0x51')]({'where':{'userProfileId':_0x35bec2[_0x9f4c('0x52')]['id']},'raw':!![]})[_0x9f4c('0x24')](function(_0x3699c3){_0x289028=_['filter'](_0x3699c3,function(_0x218aed){return _0x218aed['enabled']===0x1||_[_0x9f4c('0x5e')]([0x3eb,0x709],_0x218aed[_0x9f4c('0x57')]);});if(!_['isEmpty'](_0x289028)){return _[_0x9f4c('0x2c')](_0x289028,function(_0x548f27){return _0x548f27['sectionId'];});}else{return;}})['then'](function(_0x5478b5){if(_0x5478b5)_0x4804af=_0x5478b5;if(_[_0x9f4c('0x5e')](_0x4804af,0x64)){var _0x2c043a=_[_0x9f4c('0x47')](_0x289028,{'sectionId':0x64});return hasDefaultDashboard(_0x2c043a)[_0x9f4c('0x24')](function(_0x4ec44c){return _[_0x9f4c('0x2c')](_0x289028,function(_0x36cbc6){if(_0x36cbc6[_0x9f4c('0x57')]===0x64){_0x36cbc6['subsections']=_0x4ec44c;}return _0x36cbc6;});});}else{return;}})[_0x9f4c('0x24')](function(_0x1ffbd6){if(_0x1ffbd6)_0x289028=_0x1ffbd6;if(_[_0x9f4c('0x5e')](_0x4804af,0x3eb)){var _0x4a06d3=_[_0x9f4c('0x47')](_0x289028,{'sectionId':0x3eb});return getCustomDashboards(_0x4a06d3)['then'](function(_0x5acefa){return _[_0x9f4c('0x2c')](_0x289028,function(_0x411d1b){if(_0x4a06d3[_0x9f4c('0x5f')]){if(_0x411d1b['sectionId']===0x3eb){_0x411d1b[_0x9f4c('0x60')]=_0x5acefa;}}else{if(_0x411d1b[_0x9f4c('0x57')]===0x64){_0x411d1b[_0x9f4c('0x60')]=_0x5acefa;}}return _0x411d1b;});});}else{return;}})['then'](function(_0x6eabc6){if(_0x6eabc6)_0x289028=_0x6eabc6;if(_[_0x9f4c('0x5e')](_0x4804af,0x709)){var _0x795824=_['find'](_0x289028,{'sectionId':0x709});return getPlugins(_0x795824)['then'](function(_0x283150){if(_0x795824[_0x9f4c('0x5f')]){return _[_0x9f4c('0x2c')](_0x289028,function(_0x5b5177){if(_0x5b5177[_0x9f4c('0x57')]===0x709){_0x5b5177[_0x9f4c('0x60')]=_0x283150;}return _0x5b5177;});}else{var _0x5271a0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x283150};var _0x3c4a01=_[_0x9f4c('0x2c')](_0x289028);_0x3c4a01[_0x9f4c('0x61')](_0x5271a0);return _0x3c4a01;}});}else{return;}})[_0x9f4c('0x24')](function(_0x5b53bb){if(_0x5b53bb)_0x289028=_0x5b53bb;return _[_0x9f4c('0x3c')](_0x289028,[_0x9f4c('0x5f'),0x1]);})[_0x9f4c('0x24')](respondWithResult(_0x187c52,null))[_0x9f4c('0x44')](handleError(_0x187c52,null));};function hasDefaultDashboard(_0x5ccb3d){var _0x34a952=[0x65];return new BPromise(function(_0x5eb438,_0x37df81){try{if(_0x5ccb3d[_0x9f4c('0x54')]){_0x5eb438(_0x34a952);}else{return db[_0x9f4c('0x55')][_0x9f4c('0x62')]({'where':{'sectionId':_0x5ccb3d['id']},'raw':!![]})[_0x9f4c('0x24')](function(_0x3e86dd){_0x3e86dd?_0x5eb438(_0x34a952):_0x5eb438();});}}catch(_0x349b1b){_0x37df81(_0x349b1b);}});}function getCustomDashboards(_0x1016d1){var _0x37bd0d=[];return new BPromise(function(_0x1b075c,_0x5ed4e9){try{if(_0x1016d1[_0x9f4c('0x54')]){return db['Dashboard'][_0x9f4c('0x51')]({'raw':!![]})[_0x9f4c('0x24')](function(_0x11ac6f){_0x11ac6f[_0x9f4c('0x63')](function(_0x14b0e7){_0x37bd0d[_0x9f4c('0x61')](_0x14b0e7['id']+0x1869f);});_0x1b075c(_0x37bd0d);});}else{return db[_0x9f4c('0x55')]['findAll']({'where':{'sectionId':_0x1016d1['id']},'raw':!![]})[_0x9f4c('0x24')](function(_0xfb532f){_0xfb532f['forEach'](function(_0x16c0e6){_0x37bd0d[_0x9f4c('0x61')](_0x16c0e6[_0x9f4c('0x64')]+0x1869f);});_0x1b075c(_0x37bd0d);});}}catch(_0x1f84c7){_0x5ed4e9(_0x1f84c7);}});}function getPlugins(_0x1d3ec5){var _0x14f4f3=[];return new BPromise(function(_0x44cc1f,_0x2927c6){try{if(_0x1d3ec5[_0x9f4c('0x54')]){return db['Plugin'][_0x9f4c('0x51')]({'raw':!![]})[_0x9f4c('0x24')](function(_0x46bcb8){_0x46bcb8[_0x9f4c('0x63')](function(_0x371e82){_0x14f4f3[_0x9f4c('0x61')](_0x371e82['id']+0x15b38);});_0x44cc1f(_0x14f4f3);});}else{return db[_0x9f4c('0x55')]['findAll']({'where':{'sectionId':_0x1d3ec5['id']},'raw':!![]})['then'](function(_0x471777){_0x471777[_0x9f4c('0x63')](function(_0x1eddab){_0x14f4f3[_0x9f4c('0x61')](_0x1eddab[_0x9f4c('0x64')]+0x15b38);});_0x44cc1f(_0x14f4f3);});}}catch(_0x4fc1b7){_0x2927c6(_0x4fc1b7);}});}exports[_0x9f4c('0x65')]=function(_0x15e7b0,_0x329409){return db[_0x9f4c('0x40')][_0x9f4c('0x47')]({'where':{'id':_0x15e7b0[_0x9f4c('0x52')]['id']}})[_0x9f4c('0x24')](handleEntityNotFound(_0x329409,null))['then'](function(_0x214e48){if(_0x214e48){return db[_0x9f4c('0x4f')]['transaction'](function(_0x2aa60f){return db[_0x9f4c('0x50')][_0x9f4c('0x51')]({'where':{'userProfileId':_0x15e7b0[_0x9f4c('0x52')]['id']},'attributes':['id'],'raw':!![]})[_0x9f4c('0x24')](function(_0xcb283d){if(_0xcb283d){return db[_0x9f4c('0x50')][_0x9f4c('0x25')]({'where':{'userProfileId':_0x15e7b0['params']['id'],'id':_[_0x9f4c('0x2c')](_0xcb283d,function(_0x5b32e0){return _0x5b32e0['id'];})},'transaction':_0x2aa60f});}})[_0x9f4c('0x24')](function(_0x5a076f){var _0x5cc53d=_[_0x9f4c('0x2c')](_0x15e7b0[_0x9f4c('0x49')],function(_0x44e01a){_0x44e01a[_0x9f4c('0x58')]=_0x15e7b0[_0x9f4c('0x52')]['id'];return _0x44e01a;});return db[_0x9f4c('0x50')][_0x9f4c('0x66')](_0x5cc53d,{'raw':!![],'transaction':_0x2aa60f});})[_0x9f4c('0x24')](function(_0x116254){var _0x38a135=_[_0x9f4c('0x3c')](_[_0x9f4c('0x2c')](_0x116254,function(_0x3b9eee){return _0x3b9eee[_0x9f4c('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x38a135){return db[_0x9f4c('0x50')][_0x9f4c('0x51')]({'where':{'userProfileId':_0x15e7b0[_0x9f4c('0x52')]['id'],'sectionId':_[_0x9f4c('0x2c')](_0x38a135,function(_0x3a965a){return _0x3a965a[_0x9f4c('0x57')];})},'attributes':['id',_0x9f4c('0x57')],'raw':!![]})[_0x9f4c('0x24')](function(_0x37c513){var _0x42a29c=_[_0x9f4c('0x2c')](_0x15e7b0[_0x9f4c('0x49')],function(_0x29e563){_0x29e563[_0x9f4c('0x58')]=_0x15e7b0[_0x9f4c('0x52')]['id'];return _0x29e563;});return db[_0x9f4c('0x55')][_0x9f4c('0x66')](_0x42a29c,{'raw':!![],'transaction':_0x2aa60f});});}})[_0x9f4c('0x44')](handleError(_0x329409,null));});}})[_0x9f4c('0x24')](function(_0xdfb5e8){var _0x594f15=_[_0x9f4c('0x2c')](_0xdfb5e8,function(_0x598e2d){return _0x598e2d[_0x9f4c('0x4b')]({'plain':!![]});});})[_0x9f4c('0x24')](respondWithResult(_0x329409,null))[_0x9f4c('0x44')](handleError(_0x329409,null));};exports[_0x9f4c('0x67')]=function(_0x3a4124,_0x1bef4c,_0x228ec8){return db[_0x9f4c('0x40')][_0x9f4c('0x47')]({'where':{'id':_0x3a4124[_0x9f4c('0x52')]['id']}})[_0x9f4c('0x24')](handleEntityNotFound(_0x1bef4c,null))[_0x9f4c('0x24')](function(_0x5f4596){if(_0x5f4596){return _0x5f4596[_0x9f4c('0x67')](_0x3a4124[_0x9f4c('0x30')][_0x9f4c('0x5c')]);}})[_0x9f4c('0x24')](respondWithStatusCode(_0x1bef4c,null))[_0x9f4c('0x44')](handleError(_0x1bef4c,null));};exports[_0x9f4c('0x68')]=function(_0x1ea399,_0x3e655a){var _0x4e446d={};if(!_0x1ea399[_0x9f4c('0x30')][_0x9f4c('0x69')])throw new Error(_0x9f4c('0x6a'));if(!_0x1ea399[_0x9f4c('0x30')][_0x9f4c('0x36')](_0x9f4c('0x37'))){_0x4e446d[_0x9f4c('0x1d')]=qs['limit'](_0x1ea399['query'][_0x9f4c('0x1d')]);_0x4e446d['offset']=qs[_0x9f4c('0x1c')](_0x1ea399[_0x9f4c('0x30')][_0x9f4c('0x1c')]);}return db[_0x9f4c('0x40')][_0x9f4c('0x47')]({'where':{'id':_0x1ea399[_0x9f4c('0x52')]['id']}})[_0x9f4c('0x24')](function(_0x45e86b){if(!_0x45e86b)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x1ea399[_0x9f4c('0x52')]['id']);return db[_0x9f4c('0x40')][_0x9f4c('0x68')](_0x1ea399);})[_0x9f4c('0x24')](respondWithFilteredResult(_0x3e655a,_0x4e446d))[_0x9f4c('0x44')](handleError(_0x3e655a,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 182c679..a7f495d 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 _0x2b29=['emit','hasOwnProperty','exports','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x3ee38e,_0x134c13){var _0x2f60a0=function(_0xc68e1f){while(--_0xc68e1f){_0x3ee38e['push'](_0x3ee38e['shift']());}};_0x2f60a0(++_0x134c13);}(_0x2b29,0x163));var _0x92b2=function(_0x183030,_0x550068){_0x183030=_0x183030-0x0;var _0xb0799=_0x2b29[_0x183030];return _0xb0799;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x92b2('0x0'))['db'][_0x92b2('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x92b2('0x2')](0x0);var events={'afterCreate':_0x92b2('0x3'),'afterUpdate':'update','afterDestroy':_0x92b2('0x4')};function emitEvent(_0xdb5991){return function(_0xbc7de4,_0x3963eb,_0x16c1b0){UserProfileEvents[_0x92b2('0x5')](_0xdb5991+':'+_0xbc7de4['id'],_0xbc7de4);UserProfileEvents['emit'](_0xdb5991,_0xbc7de4);_0x16c1b0(null);};}for(var e in events){if(events[_0x92b2('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x92b2('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xa24d=['../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x211e36,_0x4b7fbd){var _0x179c3f=function(_0x1fd207){while(--_0x1fd207){_0x211e36['push'](_0x211e36['shift']());}};_0x179c3f(++_0x4b7fbd);}(_0xa24d,0x1c1));var _0xda24=function(_0x135573,_0x479526){_0x135573=_0x135573-0x0;var _0x13ea56=_0xa24d[_0x135573];return _0x13ea56;};'use strict';var EventEmitter=require(_0xda24('0x0'));var UserProfile=require(_0xda24('0x1'))['db'][_0xda24('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xda24('0x3')](0x0);var events={'afterCreate':_0xda24('0x4'),'afterUpdate':_0xda24('0x5'),'afterDestroy':_0xda24('0x6')};function emitEvent(_0x501b16){return function(_0xcc2450,_0x2e6e4f,_0x24a908){UserProfileEvents[_0xda24('0x7')](_0x501b16+':'+_0xcc2450['id'],_0xcc2450);UserProfileEvents['emit'](_0x501b16,_0xcc2450);_0x24a908(null);};}for(var e in events){if(events[_0xda24('0x8')](e)){var event=events[e];UserProfile[_0xda24('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 472854c..68d657e 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 _0x9fd4=['sms','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','contacts','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','FaxQueue','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users','agents','telephones','Users','zendeskaccounts','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','intervals','Pause','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','toString','define','UserProfile','user_profiles','section','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','union','autoAssociation','all','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','reportType','default','DefaultReports','custom','rows','CmContact','Tags','tag','openTabs','true','chat','dataValues'];(function(_0x4ec043,_0x2f109f){var _0x1b208c=function(_0x315476){while(--_0x315476){_0x4ec043['push'](_0x4ec043['shift']());}};_0x1b208c(++_0x2f109f);}(_0x9fd4,0x16c));var _0x49fd=function(_0x593da6,_0x839a8d){_0x593da6=_0x593da6-0x0;var _0x1169de=_0x9fd4[_0x593da6];return _0x1169de;};'use strict';var _=require(_0x49fd('0x0'));var attributes=require(_0x49fd('0x1'));var qs=require(_0x49fd('0x2'));var squel=require(_0x49fd('0x3'));module[_0x49fd('0x4')]=function(_0xe1e23f){var _0x32d855=_0xe1e23f[_0x49fd('0x5')];function _0x3f149e(_0x55dda5,_0x481f6a){return new Promise(function(_0x3b4b46,_0x42fdc7){if(!_0x481f6a)return _0x3b4b46(null);var _0x1bc16e=_0x481f6a[_0x49fd('0x6')]?{[_0x481f6a['filter'][_0x49fd('0x7')]]:_0x481f6a[_0x49fd('0x6')][_0x49fd('0x8')]}:undefined;return _0x32d855[_0x55dda5][_0x49fd('0x9')]({'where':_0x1bc16e,'raw':!![]})[_0x49fd('0xa')](function(_0x4a1c47){_0x481f6a[_0x49fd('0xb')]=_[_0x49fd('0xc')](_0x4a1c47,'id');_0x3b4b46(_0x481f6a);})[_0x49fd('0xd')](function(_0x4969d3){_0x42fdc7(_0x4969d3);});});}function _0x426ec2(_0x2c6d77,_0x4733ce){return new Promise(function(_0x53a44e,_0x70933e){var _0x1a6ee5=_0x2c6d77[_0x49fd('0x6')]?{[_0x2c6d77[_0x49fd('0x6')][_0x49fd('0x7')]]:_0x2c6d77[_0x49fd('0x6')][_0x49fd('0x8')]}:undefined;return _0x32d855[_0x2c6d77[_0x49fd('0xe')]][_0x49fd('0x9')]({'where':_0x1a6ee5,'raw':!![]})[_0x49fd('0xa')](function(_0x157b09){_0x4733ce[_0x49fd('0xb')]=_[_0x49fd('0xc')](_0x157b09,function(_0x1a9063){return _0x1a9063[_0x49fd('0xf')];});_0x53a44e(_0x4733ce);})[_0x49fd('0xd')](function(_0x2859f2){_0x70933e(_0x2859f2);});});}function _0x3ca675(_0x2f8d68,_0x12ae8f,_0x14c34f){if(!_0x12ae8f)return Promise[_0x49fd('0x10')](null);return new Promise(function(_0x320fe5,_0x475eee){return _0x32d855[_0x49fd('0x11')][_0x49fd('0x9')]({'where':{'sectionId':_0x12ae8f['id']},'raw':!![]})['then'](function(_0x2dc611){if(_0x2f8d68[_0x49fd('0x7')]&&_0x2f8d68['field']!=='id'){_0x12ae8f['associatedResources']=_[_0x49fd('0xc')](_0x2dc611,function(_0x53cbd1){return _0x53cbd1[_0x2f8d68[_0x49fd('0x7')]];});}else{if(_0x14c34f===_0x49fd('0x12')){_0x12ae8f['associatedResources']=_[_0x49fd('0xc')](_0x2dc611,function(_0x83ab70){return{'id':_0x83ab70['resourceId'],'type':_0x83ab70[_0x49fd('0x13')]};});}else{_0x12ae8f[_0x49fd('0xb')]=_[_0x49fd('0xc')](_0x2dc611,function(_0x290f59){return _0x290f59[_0x49fd('0x14')];});}}_0x320fe5(_0x12ae8f);})[_0x49fd('0xd')](function(_0x5dc839){_0x475eee(_0x5dc839);});});}function _0x46019d(_0xd43815,_0x8f202b){var _0x4bf811={'parentSections':[]};switch(_0xd43815[_0x49fd('0x15')]()){case _0x49fd('0x16'):_0x4bf811[_0x49fd('0x17')]='SquareProject';break;case'odbc':_0x4bf811['childModel']=_0x49fd('0x18');break;case _0x49fd('0x19'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x1a');_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x1c'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x1d')}];break;case'projects':_0x4bf811[_0x49fd('0x17')]='JscriptyProject';break;case _0x49fd('0x1e'):_0x4bf811[_0x49fd('0x17')]='CmContact';_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x1f'),'field':'id','foreignKey':_0x49fd('0x20')}];break;case _0x49fd('0x21'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x22');break;case _0x49fd('0x23'):_0x4bf811[_0x49fd('0x17')]='CmCompany';break;case _0x49fd('0x24'):_0x4bf811['childModel']=_0x49fd('0x25');break;case'chatqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x26');break;case _0x49fd('0x27'):_0x4bf811['childModel']='ChatWebsite';break;case'faxqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x28');break;case'faxaccounts':_0x4bf811[_0x49fd('0x17')]='FaxAccount';break;case'inboundroutes':case _0x49fd('0x29'):case _0x49fd('0x2a'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x2b');break;case _0x49fd('0x2c'):_0x4bf811['childModel']='VoiceContext';break;case _0x49fd('0x2d'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x2e');break;case _0x49fd('0x2f'):_0x4bf811['childModel']=_0x49fd('0x30');_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x31'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x32'),'model':_0x49fd('0x33'),'filter':{'field':_0x49fd('0x34'),'value':[_0x49fd('0x35')]}},{'name':_0x49fd('0x36'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x32'),'model':'User','filter':{'field':_0x49fd('0x34'),'value':[_0x49fd('0x37')]}},{'name':_0x49fd('0x38'),'field':_0x49fd('0xf'),'foreignKey':_0x49fd('0x39'),'model':_0x49fd('0x3a'),'filter':{'field':_0x49fd('0x13'),'value':[_0x49fd('0x3b')]}},{'name':_0x49fd('0x3c'),'field':'name','foreignKey':_0x49fd('0x39'),'model':'VoiceQueue','filter':{'field':_0x49fd('0x13'),'value':[_0x49fd('0x3d')]}}];break;case'musiconholds':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x3e');break;case'chanspies':_0x4bf811[_0x49fd('0x17')]='VoiceChanSpy';break;case'voiceprefixes':_0x4bf811['childModel']=_0x49fd('0x3f');break;case _0x49fd('0x40'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x41');break;case'mailqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x42');break;case _0x49fd('0x43'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x44');break;case _0x49fd('0x45'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x46');break;case'openchannelqueues':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x47');break;case'openchannelaccounts':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x48');break;case'smsqueues':_0x4bf811[_0x49fd('0x17')]='SmsQueue';break;case _0x49fd('0x49'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x4a');break;case _0x49fd('0x4b'):_0x4bf811['childModel']='WhatsappQueue';break;case _0x49fd('0x4c'):_0x4bf811['childModel']=_0x49fd('0x4d');break;case _0x49fd('0x4e'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x4f');break;case'voicequeues':case _0x49fd('0x50'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x3a');if(_0x8f202b){_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x38')},{'name':_0x49fd('0x3c')}];}break;case _0x49fd('0x51'):case _0x49fd('0x52'):case _0x49fd('0x53'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x33');if(_0x8f202b){_0x4bf811[_0x49fd('0x1b')]=[{'name':_0x49fd('0x54'),'filter':{'field':_0x49fd('0x34'),'value':['admin','user']},'ignore':!![]},{'name':_0x49fd('0x31')},{'name':_0x49fd('0x36')}];}break;case _0x49fd('0x55'):_0x4bf811[_0x49fd('0x17')]='ZendeskAccount';break;case _0x49fd('0x56'):_0x4bf811[_0x49fd('0x17')]='SalesforceAccount';break;case _0x49fd('0x57'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x58');break;case _0x49fd('0x59'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x5a');break;case _0x49fd('0x5b'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x5c');break;case _0x49fd('0x5d'):_0x4bf811[_0x49fd('0x17')]='ZohoAccount';break;case _0x49fd('0x5e'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x33');break;case _0x49fd('0x5f'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x60');break;case'dispositions':_0x4bf811['childModel']=_0x49fd('0x61');break;case _0x49fd('0x62'):_0x4bf811[_0x49fd('0x17')]='Dashboard';break;case _0x49fd('0x63'):_0x4bf811[_0x49fd('0x17')]='Interval';break;case'pauses':_0x4bf811['childModel']=_0x49fd('0x64');break;case'scheduler':_0x4bf811['childModel']='Schedule';break;case _0x49fd('0x65'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x66');break;case _0x49fd('0x67'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x68');break;case _0x49fd('0x69'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x6a');break;case _0x49fd('0x6b'):_0x4bf811['childModel']=_0x49fd('0x6c');break;case _0x49fd('0x6d'):_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x6e');break;case _0x49fd('0x6f'):_0x4bf811[_0x49fd('0x17')]='Variable';break;case _0x49fd('0x70'):_0x4bf811[_0x49fd('0x17')]='Plugin';break;case'extractedreports':_0x4bf811[_0x49fd('0x17')]='AnalyticExtractedReport';_0x4bf811[_0x49fd('0x1b')]=[{'name':'Reports','field':'id','foreignKey':_0x49fd('0x71')}];break;case'metrics':_0x4bf811[_0x49fd('0x17')]=_0x49fd('0x72');break;}return _0x4bf811;}function _0x4fe873(_0x2e4f29,_0xc34aed){var _0x275a68=_0x2e4f29[_0x49fd('0x73')](0x0)[_0x49fd('0x74')]()+_0x2e4f29[_0x49fd('0x75')](0x1);var _0xd2cc88={'type':_0x32d855[_0x49fd('0x76')]['QueryTypes'][_0x49fd('0x77')],'raw':!![]};return new Promise(function(_0x46f351,_0x3732bb){var _0x5d0d68=squel[_0x49fd('0x78')]()[_0x49fd('0x7')](_0x49fd('0x79')+_0x275a68+_0x49fd('0x7a'),'id')[_0x49fd('0x7')](_0x49fd('0x7b'))[_0x49fd('0x7c')](_0x49fd('0x7d')+_0x2e4f29+_0x49fd('0x7e'),'ui')['where'](_0x49fd('0x7f'),_0xc34aed['id']);return _0x32d855[_0x49fd('0x80')]['query'](_0x5d0d68[_0x49fd('0x81')](),_0xd2cc88)[_0x49fd('0xa')](function(_0x51223a){_0xc34aed[_0x275a68+'OpenTabs']=_0x51223a;_0x46f351(_0x51223a);})['catch'](function(_0x197239){_0x3732bb(_0x197239);});});}return _0xe1e23f[_0x49fd('0x82')](_0x49fd('0x83'),attributes,{'tableName':_0x49fd('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xb1e0f3){var _0x582286={'raw':![],'where':{}};var _0x7e0750={};var _0x58ae06={'count':0x0,'rows':[]};var _0x418673=_0xb1e0f3['query'][_0x49fd('0x85')];var _0x1a8da2=_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x87')]||![];var _0x5a6fe0=_0x46019d(_0x418673,_0x1a8da2);if(!_0x5a6fe0[_0x49fd('0x17')])throw new Error(_0x49fd('0x88')+_0x418673+'\x27');var _0x547aea=[{'name':_0x418673}];if(!_[_0x49fd('0x89')](_0x5a6fe0[_0x49fd('0x1b')]))_0x547aea=_0x5a6fe0[_0x49fd('0x1b')];var _0x58215b=[];for(var _0x264fe9=0x0;_0x264fe9<_0x547aea[_0x49fd('0x8a')];_0x264fe9++){_0x58215b[_0x49fd('0x8b')](_0x32d855[_0x49fd('0x8c')][_0x49fd('0x8d')]({'where':{'userProfileId':_0xb1e0f3[_0x49fd('0x8e')]['id'],'name':_0x547aea[_0x264fe9]['name']},'raw':!![]}));}return Promise['all'](_0x58215b)[_0x49fd('0xa')](function(_0x1c64f8){var _0x4079e3=_[_0x49fd('0x6')](_0x1c64f8,function(_0x27806a){return _0x27806a?_0x27806a:undefined;});var _0xdc81cf=_[_0x49fd('0x6')](_0x547aea,[_0x49fd('0x8f'),!![]]);var _0x36de5c=_[_0x49fd('0x89')](_0x4079e3)&&_[_0x49fd('0x89')](_0xdc81cf)?null:_[_0x49fd('0x90')](_0xdc81cf,_0x4079e3);if(!_0x36de5c)return null;var _0xa63360=[];for(var _0x536262=0x0;_0x536262<_0x36de5c[_0x49fd('0x8a')];_0x536262++){var _0x35a8e4=_[_0x49fd('0x8d')](_0x547aea,function(_0x561e58){return _0x36de5c[_0x536262]?_0x561e58['name']===_0x36de5c[_0x536262][_0x49fd('0xf')]:null;});if(_0x35a8e4){if(_0x36de5c[_0x536262][_0x49fd('0x8f')]){_0xa63360[_0x49fd('0x8b')](_0x3f149e(_0x5a6fe0['childModel'],_0x36de5c[_0x536262]));}else{if(!_0x36de5c[_0x536262][_0x49fd('0x91')]){_0xa63360[_0x49fd('0x8b')](_0x3ca675(_0x35a8e4,_0x36de5c[_0x536262],_0x5a6fe0[_0x49fd('0x17')]));}else{if(_0x35a8e4[_0x49fd('0xe')]){_0xa63360[_0x49fd('0x8b')](_0x426ec2(_0x35a8e4,_0x36de5c[_0x536262]));}}}}}return Promise[_0x49fd('0x92')](_0xa63360);})[_0x49fd('0xa')](function(_0x4c8977){var _0x58eecf=_0x4c8977;var _0x4614d1=null;if(_0x58eecf){_0x4614d1=_0x58eecf['length']===0x1?_0x58eecf[0x0]:null;}if(!_0x4614d1&&!_0x58eecf)return _0x58ae06;var _0x3b94e1=_0x32d855[_0x5a6fe0['childModel']]['rawAttributes'];_0x7e0750['model']=_[_0x49fd('0x93')](_0x3b94e1);_0x7e0750[_0x49fd('0x86')]=_['keys'](_0xb1e0f3[_0x49fd('0x86')]);_0x7e0750[_0x49fd('0x94')]=_['intersection'](_0x7e0750[_0x49fd('0xe')],_0x7e0750[_0x49fd('0x86')]);_0x582286['attributes']=_[_0x49fd('0x95')](_0x7e0750['model'],qs[_0x49fd('0x96')](_0xb1e0f3[_0x49fd('0x86')]['fields']));_0x582286[_0x49fd('0x97')]=_0x582286[_0x49fd('0x97')]['length']?_0x582286[_0x49fd('0x97')]:_0x7e0750[_0x49fd('0xe')];if(!_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x98')](_0x49fd('0x99'))){_0x582286[_0x49fd('0x9a')]=qs[_0x49fd('0x9a')](_0xb1e0f3[_0x49fd('0x86')]['limit']);_0x582286['offset']=qs[_0x49fd('0x9b')](_0xb1e0f3[_0x49fd('0x86')]['offset']);}_0x582286[_0x49fd('0x9c')]=qs[_0x49fd('0x9d')](_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x9d')]);_0x582286[_0x49fd('0x9e')]=qs[_0x49fd('0x94')](_[_0x49fd('0x9f')](_0xb1e0f3['query'],_0x7e0750[_0x49fd('0x94')]));if(_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x6')]){_0x582286[_0x49fd('0x9e')]=_[_0x49fd('0xa0')](_0x582286[_0x49fd('0x9e')],{'$or':_[_0x49fd('0xc')](_0x3b94e1,function(_0x545740){if(_0x545740[_0x49fd('0x13')][_0x49fd('0xa1')]!==_0x49fd('0xa2')){var _0x373ce0={};_0x373ce0[_0x545740[_0x49fd('0x7')]]={'$like':'%'+_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0x6')]+'%'};return _0x373ce0;}})});}var _0x2da3c4=[];var _0xe96b86=null;var _0x333e8e={};if(_0x4614d1){_0xe96b86=_[_0x49fd('0x8d')](_0x547aea,[_0x49fd('0xf'),_0x4614d1[_0x49fd('0xf')]]);if(_0xe96b86[_0x49fd('0x7')]){_0x333e8e={};if(_0x5a6fe0[_0x49fd('0x17')]===_0x49fd('0x12')){_0x333e8e[_0xe96b86[_0x49fd('0xa3')]]=_[_0x49fd('0xc')](_0x4614d1[_0x49fd('0xb')],'id');}else{_0x333e8e[_0xe96b86[_0x49fd('0xa3')]]=_0x4614d1['associatedResources'];}_0x2da3c4[_0x49fd('0x8b')](_0x333e8e);}else{_0x582286['where']['id']=_0x4614d1[_0x49fd('0xb')];}}else{for(var _0x472450=0x0;_0x472450<_0x58eecf['length'];_0x472450++){_0xe96b86=_['find'](_0x547aea,[_0x49fd('0xf'),_0x58eecf[_0x472450][_0x49fd('0xf')]]);if(_0xe96b86[_0x49fd('0x7')]){_0x333e8e={};_0x333e8e[_0xe96b86['foreignKey']]=_0x58eecf[_0x472450][_0x49fd('0xb')];_0x2da3c4['push'](_0x333e8e);}else{if(!_0x582286[_0x49fd('0x9e')]['id'])_0x582286[_0x49fd('0x9e')]['id']=[];_0x58eecf[_0x472450]['associatedResources']['forEach'](function(_0x51afb5){_0x582286[_0x49fd('0x9e')]['id']['push'](_0x51afb5);});}}}if(!_[_0x49fd('0x89')](_0x2da3c4)){_0x582286[_0x49fd('0x9e')]=_[_0x49fd('0xa0')](_0x582286['where'],{'$and':{'$or':_0x2da3c4}});}_0x582286=_[_0x49fd('0xa0')]({},_0x582286,_0xb1e0f3[_0x49fd('0xa4')]);if(_0x4614d1&&!_0x4614d1[_0x49fd('0x91')]&&_0x5a6fe0[_0x49fd('0x17')]==='AnalyticExtractedReport'){if(_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0xa5')]){_0x582286[_0x49fd('0xa6')]=[{'all':!![]}];}return _0x32d855[_0x5a6fe0['childModel']][_0x49fd('0x9')](_0x582286)[_0x49fd('0xa')](function(_0x3f063e){var _0x43477d=[];_0x3f063e['forEach'](function(_0x3e2b65){var _0x268029;switch(_0x3e2b65[_0x49fd('0xa7')]){case _0x49fd('0xa8'):_0x268029=_['find'](_0x4614d1['associatedResources'],function(_0x2627ef){return _0x2627ef['id']===_0x3e2b65['reportId']&&_0x2627ef[_0x49fd('0x13')]===_0x49fd('0xa9');});break;case _0x49fd('0xaa'):_0x268029=_[_0x49fd('0x8d')](_0x4614d1['associatedResources'],function(_0x97bcd3){return _0x97bcd3['id']===_0x3e2b65[_0x49fd('0x71')]&&_0x97bcd3['type']==='CustomReports';});break;}if(_0x268029)_0x43477d[_0x49fd('0x8b')](_0x3e2b65);});_0x58ae06['count']=_0x43477d[_0x49fd('0x8a')];_0x58ae06[_0x49fd('0xab')]=_0x43477d;return _0x58ae06;});}else{return _0x32d855[_0x5a6fe0[_0x49fd('0x17')]]['count']({'where':_0x582286[_0x49fd('0x9e')]})['then'](function(_0x56c1d2){_0x58ae06['count']=_0x56c1d2;if(_0xb1e0f3[_0x49fd('0x86')]['includeAll']){if(_0x5a6fe0['childModel']===_0x49fd('0xac')){_0x582286['include']=[{'model':_0x32d855[_0x49fd('0x68')],'as':_0x49fd('0xad'),'attributes':['id',_0x49fd('0xf'),'color'],'required':_0xb1e0f3[_0x49fd('0x86')]['tag']?!![]:![]},{'model':_0x32d855[_0x49fd('0x68')],'as':'ThroughTags','attributes':['id',_0x49fd('0xf'),'color'],'through':_0xb1e0f3['query']['tag']?{'attributes':[],'where':{'TagId':_0xb1e0f3['query']['tag']||undefined}}:{},'required':_0xb1e0f3[_0x49fd('0x86')][_0x49fd('0xae')]?!![]:![]}];}else{_0x582286[_0x49fd('0xa6')]=[{'all':!![]}];}}return _0x32d855[_0x5a6fe0['childModel']][_0x49fd('0x9')](_0x582286);})[_0x49fd('0xa')](function(_0x20326b){_0x58ae06['rows']=_0x20326b;if(_0x418673===_0x49fd('0x31')&&_0xb1e0f3['query'][_0x49fd('0xaf')]===_0x49fd('0xb0')){var _0xd23a0a=[];for(var _0x148a2b=0x0;_0x148a2b<_0x58ae06[_0x49fd('0xab')][_0x49fd('0x8a')];_0x148a2b++){_0xd23a0a[_0x49fd('0x8b')](_0x4fe873(_0x49fd('0xb1'),_0x58ae06[_0x49fd('0xab')][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a['push'](_0x4fe873(_0x49fd('0xb3'),_0x58ae06[_0x49fd('0xab')][_0x148a2b]['dataValues']));_0xd23a0a[_0x49fd('0x8b')](_0x4fe873('fax',_0x58ae06['rows'][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a[_0x49fd('0x8b')](_0x4fe873('mail',_0x58ae06[_0x49fd('0xab')][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a[_0x49fd('0x8b')](_0x4fe873(_0x49fd('0xb4'),_0x58ae06[_0x49fd('0xab')][_0x148a2b][_0x49fd('0xb2')]));_0xd23a0a['push'](_0x4fe873('whatsapp',_0x58ae06['rows'][_0x148a2b][_0x49fd('0xb2')]));}return Promise['all'](_0xd23a0a)[_0x49fd('0xa')](function(){return _0x58ae06;});}return _0x58ae06;});}});}}});}; \ No newline at end of file +var _0xffd6=['FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','membername','User','role','agent','telephone','VoiceQueues','QueueCampaigns','queue','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','users','agents','telephones','Users','admin','user','Agents','Telephones','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','key','VIRTUAL','foreignKey','merge','options','includeAll','include','findAll','forEach','default','custom','CustomReports','count','color','tag','rows','openTabs','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','models','filter','field','value','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','type','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','parentSections','projectName','projects','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites'];(function(_0xfff28b,_0x204443){var _0x13c9f0=function(_0x4d9f58){while(--_0x4d9f58){_0xfff28b['push'](_0xfff28b['shift']());}};_0x13c9f0(++_0x204443);}(_0xffd6,0x97));var _0x6ffd=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0xffd6[_0x29d623];return _0x242e59;};'use strict';var _=require(_0x6ffd('0x0'));var attributes=require(_0x6ffd('0x1'));var qs=require(_0x6ffd('0x2'));var squel=require('squel');module['exports']=function(_0x305b6b){var _0x400c43=_0x305b6b[_0x6ffd('0x3')];function _0x560afa(_0x1d12e3,_0x173979){return new Promise(function(_0x3b8a46,_0x2949a4){if(!_0x173979)return _0x3b8a46(null);var _0x561055=_0x173979[_0x6ffd('0x4')]?{[_0x173979[_0x6ffd('0x4')][_0x6ffd('0x5')]]:_0x173979[_0x6ffd('0x4')][_0x6ffd('0x6')]}:undefined;return _0x400c43[_0x1d12e3]['findAll']({'where':_0x561055,'raw':!![]})[_0x6ffd('0x7')](function(_0x417f34){_0x173979['associatedResources']=_[_0x6ffd('0x8')](_0x417f34,'id');_0x3b8a46(_0x173979);})[_0x6ffd('0x9')](function(_0x23f7f2){_0x2949a4(_0x23f7f2);});});}function _0x3dda1e(_0x262023,_0x39323f){return new Promise(function(_0x836501,_0x5892e1){var _0x242078=_0x262023[_0x6ffd('0x4')]?{[_0x262023['filter'][_0x6ffd('0x5')]]:_0x262023[_0x6ffd('0x4')][_0x6ffd('0x6')]}:undefined;return _0x400c43[_0x262023[_0x6ffd('0xa')]]['findAll']({'where':_0x242078,'raw':!![]})[_0x6ffd('0x7')](function(_0x594cb3){_0x39323f[_0x6ffd('0xb')]=_['map'](_0x594cb3,function(_0xfd9569){return _0xfd9569[_0x6ffd('0xc')];});_0x836501(_0x39323f);})[_0x6ffd('0x9')](function(_0x5d8aff){_0x5892e1(_0x5d8aff);});});}function _0x15fca6(_0x9d2f93,_0x350c94,_0x3394b2){if(!_0x350c94)return Promise[_0x6ffd('0xd')](null);return new Promise(function(_0x19a772,_0x3f38e7){return _0x400c43[_0x6ffd('0xe')]['findAll']({'where':{'sectionId':_0x350c94['id']},'raw':!![]})[_0x6ffd('0x7')](function(_0x56c541){if(_0x9d2f93['field']&&_0x9d2f93[_0x6ffd('0x5')]!=='id'){_0x350c94[_0x6ffd('0xb')]=_['map'](_0x56c541,function(_0x34c3c1){return _0x34c3c1[_0x9d2f93[_0x6ffd('0x5')]];});}else{if(_0x3394b2==='AnalyticExtractedReport'){_0x350c94['associatedResources']=_[_0x6ffd('0x8')](_0x56c541,function(_0x1c9d19){return{'id':_0x1c9d19['resourceId'],'type':_0x1c9d19[_0x6ffd('0xf')]};});}else{_0x350c94[_0x6ffd('0xb')]=_[_0x6ffd('0x8')](_0x56c541,function(_0x53128a){return _0x53128a[_0x6ffd('0x10')];});}}_0x19a772(_0x350c94);})[_0x6ffd('0x9')](function(_0x50896b){_0x3f38e7(_0x50896b);});});}function _0x356c9c(_0x438d1a,_0x50c19a){var _0x31fb22={'parentSections':[]};switch(_0x438d1a[_0x6ffd('0x11')]()){case _0x6ffd('0x12'):_0x31fb22['childModel']=_0x6ffd('0x13');break;case _0x6ffd('0x14'):_0x31fb22[_0x6ffd('0x15')]='SquareOdbc';break;case _0x6ffd('0x16'):_0x31fb22['childModel']=_0x6ffd('0x17');_0x31fb22[_0x6ffd('0x18')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x6ffd('0x19')}];break;case _0x6ffd('0x1a'):_0x31fb22[_0x6ffd('0x15')]='JscriptyProject';break;case'contacts':_0x31fb22[_0x6ffd('0x15')]='CmContact';_0x31fb22[_0x6ffd('0x18')]=[{'name':_0x6ffd('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0x6ffd('0x1c'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x1d');break;case _0x6ffd('0x1e'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x1f');break;case _0x6ffd('0x20'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x21');break;case _0x6ffd('0x22'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x23');break;case _0x6ffd('0x24'):_0x31fb22['childModel']='ChatWebsite';break;case'faxqueues':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x25');break;case _0x6ffd('0x26'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x27');break;case _0x6ffd('0x28'):case _0x6ffd('0x29'):case _0x6ffd('0x2a'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x2b');break;case _0x6ffd('0x2c'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x2d');break;case'voicemails':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x2e');break;case _0x6ffd('0x2f'):_0x31fb22[_0x6ffd('0x15')]='VoiceRecording';_0x31fb22[_0x6ffd('0x18')]=[{'name':'Agents','field':'name','foreignKey':_0x6ffd('0x30'),'model':_0x6ffd('0x31'),'filter':{'field':_0x6ffd('0x32'),'value':[_0x6ffd('0x33')]}},{'name':'Telephones','field':_0x6ffd('0xc'),'foreignKey':'membername','model':_0x6ffd('0x31'),'filter':{'field':_0x6ffd('0x32'),'value':[_0x6ffd('0x34')]}},{'name':_0x6ffd('0x35'),'field':_0x6ffd('0xc'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x6ffd('0xf'),'value':['inbound']}},{'name':_0x6ffd('0x36'),'field':_0x6ffd('0xc'),'foreignKey':_0x6ffd('0x37'),'model':_0x6ffd('0x38'),'filter':{'field':_0x6ffd('0xf'),'value':[_0x6ffd('0x39')]}}];break;case'musiconholds':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x3a');break;case _0x6ffd('0x3b'):_0x31fb22[_0x6ffd('0x15')]='VoiceChanSpy';break;case _0x6ffd('0x3c'):_0x31fb22['childModel']=_0x6ffd('0x3d');break;case _0x6ffd('0x3e'):_0x31fb22[_0x6ffd('0x15')]='Campaign';break;case _0x6ffd('0x3f'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x40');break;case _0x6ffd('0x41'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x42');break;case _0x6ffd('0x43'):_0x31fb22['childModel']='MailSubstatus';break;case'openchannelqueues':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x44');break;case'openchannelaccounts':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x45');break;case _0x6ffd('0x46'):_0x31fb22[_0x6ffd('0x15')]='SmsQueue';break;case _0x6ffd('0x47'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x48');break;case _0x6ffd('0x49'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x4a');break;case _0x6ffd('0x4b'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x4c');break;case _0x6ffd('0x4d'):_0x31fb22[_0x6ffd('0x15')]='Team';break;case'voicequeues':case'queuecampaigns':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x38');if(_0x50c19a){_0x31fb22['parentSections']=[{'name':_0x6ffd('0x35')},{'name':_0x6ffd('0x36')}];}break;case _0x6ffd('0x4e'):case _0x6ffd('0x4f'):case _0x6ffd('0x50'):_0x31fb22['childModel']=_0x6ffd('0x31');if(_0x50c19a){_0x31fb22[_0x6ffd('0x18')]=[{'name':_0x6ffd('0x51'),'filter':{'field':'role','value':[_0x6ffd('0x52'),_0x6ffd('0x53')]},'ignore':!![]},{'name':_0x6ffd('0x54')},{'name':_0x6ffd('0x55')}];}break;case _0x6ffd('0x56'):_0x31fb22[_0x6ffd('0x15')]='ZendeskAccount';break;case _0x6ffd('0x57'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x58');break;case _0x6ffd('0x59'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x5a');break;case _0x6ffd('0x5b'):_0x31fb22['childModel']=_0x6ffd('0x5c');break;case _0x6ffd('0x5d'):_0x31fb22['childModel']='DeskAccount';break;case'zohoaccounts':_0x31fb22[_0x6ffd('0x15')]='ZohoAccount';break;case _0x6ffd('0x5e'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x31');break;case _0x6ffd('0x5f'):_0x31fb22['childModel']=_0x6ffd('0x60');break;case _0x6ffd('0x61'):_0x31fb22[_0x6ffd('0x15')]='Disposition';break;case _0x6ffd('0x62'):_0x31fb22[_0x6ffd('0x15')]='Dashboard';break;case'intervals':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x63');break;case _0x6ffd('0x64'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x65');break;case _0x6ffd('0x66'):_0x31fb22[_0x6ffd('0x15')]='Schedule';break;case _0x6ffd('0x67'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x68');break;case'tags':_0x31fb22['childModel']=_0x6ffd('0x69');break;case _0x6ffd('0x6a'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x6b');break;case'triggers':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x6c');break;case _0x6ffd('0x6d'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x6e');break;case _0x6ffd('0x6f'):_0x31fb22['childModel']=_0x6ffd('0x70');break;case _0x6ffd('0x71'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x72');break;case _0x6ffd('0x73'):_0x31fb22['childModel']=_0x6ffd('0x74');_0x31fb22[_0x6ffd('0x18')]=[{'name':_0x6ffd('0x75'),'field':'id','foreignKey':_0x6ffd('0x76')}];break;case _0x6ffd('0x77'):_0x31fb22['childModel']=_0x6ffd('0x78');break;}return _0x31fb22;}function _0x217e22(_0x1849ae,_0x55719f){var _0x3ba9c5=_0x1849ae[_0x6ffd('0x79')](0x0)['toUpperCase']()+_0x1849ae[_0x6ffd('0x7a')](0x1);var _0x4f057c={'type':_0x400c43[_0x6ffd('0x7b')][_0x6ffd('0x7c')]['SELECT'],'raw':!![]};return new Promise(function(_0x2c860e,_0x5be0d6){var _0x141e52=squel[_0x6ffd('0x7d')]()[_0x6ffd('0x5')](_0x6ffd('0x7e')+_0x3ba9c5+_0x6ffd('0x7f'),'id')['field'](_0x6ffd('0x80'))[_0x6ffd('0x81')](_0x6ffd('0x82')+_0x1849ae+_0x6ffd('0x83'),'ui')['where'](_0x6ffd('0x84'),_0x55719f['id']);return _0x400c43[_0x6ffd('0x85')][_0x6ffd('0x86')](_0x141e52['toString'](),_0x4f057c)[_0x6ffd('0x7')](function(_0x51cf91){_0x55719f[_0x3ba9c5+_0x6ffd('0x87')]=_0x51cf91;_0x2c860e(_0x51cf91);})['catch'](function(_0x363959){_0x5be0d6(_0x363959);});});}return _0x305b6b[_0x6ffd('0x88')](_0x6ffd('0x89'),attributes,{'tableName':_0x6ffd('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x54a057){var _0x176471={'raw':![],'where':{}};var _0x45d6b5={};var _0x2514cd={'count':0x0,'rows':[]};var _0x2cdcb2=_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x8b')];var _0x256a03=_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x8c')]||![];var _0x302db8=_0x356c9c(_0x2cdcb2,_0x256a03);if(!_0x302db8[_0x6ffd('0x15')])throw new Error(_0x6ffd('0x8d')+_0x2cdcb2+'\x27');var _0x4931e1=[{'name':_0x2cdcb2}];if(!_[_0x6ffd('0x8e')](_0x302db8[_0x6ffd('0x18')]))_0x4931e1=_0x302db8[_0x6ffd('0x18')];var _0x3d7d9d=[];for(var _0x179b3f=0x0;_0x179b3f<_0x4931e1[_0x6ffd('0x8f')];_0x179b3f++){_0x3d7d9d[_0x6ffd('0x90')](_0x400c43[_0x6ffd('0x91')][_0x6ffd('0x92')]({'where':{'userProfileId':_0x54a057[_0x6ffd('0x93')]['id'],'name':_0x4931e1[_0x179b3f][_0x6ffd('0xc')]},'raw':!![]}));}return Promise[_0x6ffd('0x94')](_0x3d7d9d)['then'](function(_0x2fbfdc){var _0x4a28bd=_[_0x6ffd('0x4')](_0x2fbfdc,function(_0x20d9ed){return _0x20d9ed?_0x20d9ed:undefined;});var _0x2657ed=_[_0x6ffd('0x4')](_0x4931e1,[_0x6ffd('0x95'),!![]]);var _0x199b6e=_[_0x6ffd('0x8e')](_0x4a28bd)&&_['isEmpty'](_0x2657ed)?null:_[_0x6ffd('0x96')](_0x2657ed,_0x4a28bd);if(!_0x199b6e)return null;var _0x8cece8=[];for(var _0xef9c35=0x0;_0xef9c35<_0x199b6e[_0x6ffd('0x8f')];_0xef9c35++){var _0x209b93=_[_0x6ffd('0x92')](_0x4931e1,function(_0x222636){return _0x199b6e[_0xef9c35]?_0x222636[_0x6ffd('0xc')]===_0x199b6e[_0xef9c35][_0x6ffd('0xc')]:null;});if(_0x209b93){if(_0x199b6e[_0xef9c35][_0x6ffd('0x95')]){_0x8cece8['push'](_0x560afa(_0x302db8[_0x6ffd('0x15')],_0x199b6e[_0xef9c35]));}else{if(!_0x199b6e[_0xef9c35][_0x6ffd('0x97')]){_0x8cece8[_0x6ffd('0x90')](_0x15fca6(_0x209b93,_0x199b6e[_0xef9c35],_0x302db8[_0x6ffd('0x15')]));}else{if(_0x209b93[_0x6ffd('0xa')]){_0x8cece8[_0x6ffd('0x90')](_0x3dda1e(_0x209b93,_0x199b6e[_0xef9c35]));}}}}}return Promise['all'](_0x8cece8);})['then'](function(_0x1bca62){var _0x193e8e=_0x1bca62;var _0x4ceb5b=null;if(_0x193e8e){_0x4ceb5b=_0x193e8e[_0x6ffd('0x8f')]===0x1?_0x193e8e[0x0]:null;}if(!_0x4ceb5b&&!_0x193e8e)return _0x2514cd;var _0x4fd6fa=_0x400c43[_0x302db8[_0x6ffd('0x15')]]['rawAttributes'];_0x45d6b5[_0x6ffd('0xa')]=_[_0x6ffd('0x98')](_0x4fd6fa);_0x45d6b5['query']=_[_0x6ffd('0x98')](_0x54a057['query']);_0x45d6b5[_0x6ffd('0x99')]=_[_0x6ffd('0x9a')](_0x45d6b5['model'],_0x45d6b5[_0x6ffd('0x86')]);_0x176471[_0x6ffd('0x9b')]=_[_0x6ffd('0x9a')](_0x45d6b5['model'],qs[_0x6ffd('0x9c')](_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x9c')]));_0x176471[_0x6ffd('0x9b')]=_0x176471[_0x6ffd('0x9b')][_0x6ffd('0x8f')]?_0x176471[_0x6ffd('0x9b')]:_0x45d6b5[_0x6ffd('0xa')];if(!_0x54a057['query'][_0x6ffd('0x9d')](_0x6ffd('0x9e'))){_0x176471['limit']=qs['limit'](_0x54a057['query'][_0x6ffd('0x9f')]);_0x176471[_0x6ffd('0xa0')]=qs[_0x6ffd('0xa0')](_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xa0')]);}_0x176471[_0x6ffd('0xa1')]=qs[_0x6ffd('0xa2')](_0x54a057[_0x6ffd('0x86')]['sort']);_0x176471[_0x6ffd('0xa3')]=qs[_0x6ffd('0x99')](_['pick'](_0x54a057[_0x6ffd('0x86')],_0x45d6b5[_0x6ffd('0x99')]));if(_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x4')]){_0x176471['where']=_['merge'](_0x176471[_0x6ffd('0xa3')],{'$or':_['map'](_0x4fd6fa,function(_0x5db7ac){if(_0x5db7ac[_0x6ffd('0xf')][_0x6ffd('0xa4')]!==_0x6ffd('0xa5')){var _0x976c59={};_0x976c59[_0x5db7ac[_0x6ffd('0x5')]]={'$like':'%'+_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x4')]+'%'};return _0x976c59;}})});}var _0xe63fdc=[];var _0x10b35e=null;var _0x11570f={};if(_0x4ceb5b){_0x10b35e=_[_0x6ffd('0x92')](_0x4931e1,[_0x6ffd('0xc'),_0x4ceb5b['name']]);if(_0x10b35e['field']){_0x11570f={};if(_0x302db8[_0x6ffd('0x15')]===_0x6ffd('0x74')){_0x11570f[_0x10b35e[_0x6ffd('0xa6')]]=_[_0x6ffd('0x8')](_0x4ceb5b[_0x6ffd('0xb')],'id');}else{_0x11570f[_0x10b35e['foreignKey']]=_0x4ceb5b[_0x6ffd('0xb')];}_0xe63fdc[_0x6ffd('0x90')](_0x11570f);}else{_0x176471[_0x6ffd('0xa3')]['id']=_0x4ceb5b[_0x6ffd('0xb')];}}else{for(var _0x58e1e4=0x0;_0x58e1e4<_0x193e8e[_0x6ffd('0x8f')];_0x58e1e4++){_0x10b35e=_[_0x6ffd('0x92')](_0x4931e1,['name',_0x193e8e[_0x58e1e4][_0x6ffd('0xc')]]);if(_0x10b35e[_0x6ffd('0x5')]){_0x11570f={};_0x11570f[_0x10b35e[_0x6ffd('0xa6')]]=_0x193e8e[_0x58e1e4][_0x6ffd('0xb')];_0xe63fdc[_0x6ffd('0x90')](_0x11570f);}else{if(!_0x176471[_0x6ffd('0xa3')]['id'])_0x176471['where']['id']=[];_0x193e8e[_0x58e1e4][_0x6ffd('0xb')]['forEach'](function(_0x4ad447){_0x176471[_0x6ffd('0xa3')]['id'][_0x6ffd('0x90')](_0x4ad447);});}}}if(!_['isEmpty'](_0xe63fdc)){_0x176471[_0x6ffd('0xa3')]=_[_0x6ffd('0xa7')](_0x176471[_0x6ffd('0xa3')],{'$and':{'$or':_0xe63fdc}});}_0x176471=_[_0x6ffd('0xa7')]({},_0x176471,_0x54a057[_0x6ffd('0xa8')]);if(_0x4ceb5b&&!_0x4ceb5b[_0x6ffd('0x97')]&&_0x302db8[_0x6ffd('0x15')]===_0x6ffd('0x74')){if(_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xa9')]){_0x176471[_0x6ffd('0xaa')]=[{'all':!![]}];}return _0x400c43[_0x302db8['childModel']][_0x6ffd('0xab')](_0x176471)[_0x6ffd('0x7')](function(_0x54546a){var _0xad693e=[];_0x54546a[_0x6ffd('0xac')](function(_0x6224fe){var _0x275eaa;switch(_0x6224fe['reportType']){case _0x6ffd('0xad'):_0x275eaa=_[_0x6ffd('0x92')](_0x4ceb5b['associatedResources'],function(_0x4c2fa6){return _0x4c2fa6['id']===_0x6224fe[_0x6ffd('0x76')]&&_0x4c2fa6['type']==='DefaultReports';});break;case _0x6ffd('0xae'):_0x275eaa=_[_0x6ffd('0x92')](_0x4ceb5b['associatedResources'],function(_0x113f5e){return _0x113f5e['id']===_0x6224fe['reportId']&&_0x113f5e['type']===_0x6ffd('0xaf');});break;}if(_0x275eaa)_0xad693e[_0x6ffd('0x90')](_0x6224fe);});_0x2514cd['count']=_0xad693e['length'];_0x2514cd['rows']=_0xad693e;return _0x2514cd;});}else{return _0x400c43[_0x302db8[_0x6ffd('0x15')]][_0x6ffd('0xb0')]({'where':_0x176471[_0x6ffd('0xa3')]})['then'](function(_0xdf230f){_0x2514cd[_0x6ffd('0xb0')]=_0xdf230f;if(_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xa9')]){if(_0x302db8[_0x6ffd('0x15')]==='CmContact'){_0x176471[_0x6ffd('0xaa')]=[{'model':_0x400c43[_0x6ffd('0x69')],'as':'Tags','attributes':['id','name',_0x6ffd('0xb1')],'required':_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xb2')]?!![]:![]},{'model':_0x400c43['Tag'],'as':'ThroughTags','attributes':['id',_0x6ffd('0xc'),_0x6ffd('0xb1')],'through':_0x54a057['query'][_0x6ffd('0xb2')]?{'attributes':[],'where':{'TagId':_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xb2')]||undefined}}:{},'required':_0x54a057['query'][_0x6ffd('0xb2')]?!![]:![]}];}else{_0x176471[_0x6ffd('0xaa')]=[{'all':!![]}];}}return _0x400c43[_0x302db8[_0x6ffd('0x15')]][_0x6ffd('0xab')](_0x176471);})[_0x6ffd('0x7')](function(_0x971a0a){_0x2514cd[_0x6ffd('0xb3')]=_0x971a0a;if(_0x2cdcb2==='Agents'&&_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xb4')]===_0x6ffd('0xb5')){var _0x55fda9=[];for(var _0x13243c=0x0;_0x13243c<_0x2514cd['rows'][_0x6ffd('0x8f')];_0x13243c++){_0x55fda9[_0x6ffd('0x90')](_0x217e22(_0x6ffd('0xb6'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9[_0x6ffd('0x90')](_0x217e22('sms',_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9[_0x6ffd('0x90')](_0x217e22(_0x6ffd('0xb8'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9['push'](_0x217e22(_0x6ffd('0xb9'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9[_0x6ffd('0x90')](_0x217e22(_0x6ffd('0xba'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c]['dataValues']));_0x55fda9['push'](_0x217e22(_0x6ffd('0xbb'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c]['dataValues']));}return Promise[_0x6ffd('0x94')](_0x55fda9)['then'](function(){return _0x2514cd;});}return _0x2514cd;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 54ce0e3..89a700a 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 _0x6d5e=['http','defaults','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb2454d,_0x291753){var _0x5464fb=function(_0x386805){while(--_0x386805){_0xb2454d['push'](_0xb2454d['shift']());}};_0x5464fb(++_0x291753);}(_0x6d5e,0x103));var _0xe6d5=function(_0x2e6bed,_0x10edff){_0x2e6bed=_0x2e6bed-0x0;var _0x210f48=_0x6d5e[_0x2e6bed];return _0x210f48;};'use strict';var _=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var moment=require(_0xe6d5('0x2'));var BPromise=require(_0xe6d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6d5('0x4'));var db=require(_0xe6d5('0x5'))['db'];var utils=require(_0xe6d5('0x6'));var logger=require(_0xe6d5('0x7'))(_0xe6d5('0x8'));var config=require(_0xe6d5('0x9'));var jayson=require(_0xe6d5('0xa'));var client=jayson['client'][_0xe6d5('0xb')]({'port':0x232a});config['redis']=_[_0xe6d5('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe6d5('0xd'))[_0xe6d5('0xe')](socket);function respondWithRpcPromise(_0x38ffa0,_0x1ce7d7,_0x54d5f8){return new BPromise(function(_0x108119,_0x21533d){return client[_0xe6d5('0xf')](_0x38ffa0,_0x54d5f8)['then'](function(_0x48eabd){logger[_0xe6d5('0x10')](_0xe6d5('0x11'),_0x1ce7d7,_0xe6d5('0x12'));logger[_0xe6d5('0x13')](_0xe6d5('0x14'),_0x1ce7d7,_0xe6d5('0x12'),JSON[_0xe6d5('0x15')](_0x48eabd));if(_0x48eabd['error']){if(_0x48eabd[_0xe6d5('0x16')][_0xe6d5('0x17')]===0x1f4){logger[_0xe6d5('0x16')](_0xe6d5('0x11'),_0x1ce7d7,_0x48eabd[_0xe6d5('0x16')][_0xe6d5('0x18')]);return _0x21533d(_0x48eabd[_0xe6d5('0x16')][_0xe6d5('0x18')]);}logger[_0xe6d5('0x16')]('UserProfile,\x20%s,\x20%s',_0x1ce7d7,_0x48eabd[_0xe6d5('0x16')][_0xe6d5('0x18')]);return _0x108119(_0x48eabd[_0xe6d5('0x16')]['message']);}else{logger[_0xe6d5('0x10')](_0xe6d5('0x11'),_0x1ce7d7,'request\x20sent');_0x108119(_0x48eabd[_0xe6d5('0x19')]['message']);}})[_0xe6d5('0x1a')](function(_0x4cfdf2){logger['error'](_0xe6d5('0x11'),_0x1ce7d7,_0x4cfdf2);_0x21533d(_0x4cfdf2);});});} \ No newline at end of file +var _0x0309=['../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2128a8,_0x1e41da){var _0x565b9b=function(_0x2f370f){while(--_0x2f370f){_0x2128a8['push'](_0x2128a8['shift']());}};_0x565b9b(++_0x1e41da);}(_0x0309,0x8d));var _0x9030=function(_0x34aab8,_0x36c036){_0x34aab8=_0x34aab8-0x0;var _0x2fee85=_0x0309[_0x34aab8];return _0x2fee85;};'use strict';var _=require(_0x9030('0x0'));var util=require(_0x9030('0x1'));var moment=require(_0x9030('0x2'));var BPromise=require(_0x9030('0x3'));var rs=require(_0x9030('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9030('0x5'))['db'];var utils=require(_0x9030('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9030('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9030('0x8')]=_['defaults'](config[_0x9030('0x8')],{'host':_0x9030('0x9'),'port':0x18eb});var socket=require(_0x9030('0xa'))(new Redis(config[_0x9030('0x8')]));require(_0x9030('0xb'))[_0x9030('0xc')](socket);function respondWithRpcPromise(_0xb0553f,_0x3e50f3,_0xae80e0){return new BPromise(function(_0x56d7cb,_0xa4a3b){return client['request'](_0xb0553f,_0xae80e0)[_0x9030('0xd')](function(_0x36836b){logger['info'](_0x9030('0xe'),_0x3e50f3,'request\x20sent');logger[_0x9030('0xf')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3e50f3,_0x9030('0x10'),JSON['stringify'](_0x36836b));if(_0x36836b[_0x9030('0x11')]){if(_0x36836b[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('UserProfile,\x20%s,\x20%s',_0x3e50f3,_0x36836b['error']['message']);return _0xa4a3b(_0x36836b['error'][_0x9030('0x13')]);}logger[_0x9030('0x11')]('UserProfile,\x20%s,\x20%s',_0x3e50f3,_0x36836b[_0x9030('0x11')][_0x9030('0x13')]);return _0x56d7cb(_0x36836b['error'][_0x9030('0x13')]);}else{logger['info'](_0x9030('0xe'),_0x3e50f3,'request\x20sent');_0x56d7cb(_0x36836b['result'][_0x9030('0x13')]);}})[_0x9030('0x14')](function(_0x2c020a){logger[_0x9030('0x11')](_0x9030('0xe'),_0x3e50f3,_0x2c020a);_0xa4a3b(_0x2c020a);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index e74ae13..9082ef8 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 _0x5b04=['save','remove','update','removeListener','register','length','userProfile:'];(function(_0x551fd2,_0x406d86){var _0xc26ad8=function(_0x2962ad){while(--_0x2962ad){_0x551fd2['push'](_0x551fd2['shift']());}};_0xc26ad8(++_0x406d86);}(_0x5b04,0x1ea));var _0x45b0=function(_0x5b60de,_0xaed950){_0x5b60de=_0x5b60de-0x0;var _0xb2ee80=_0x5b04[_0x5b60de];return _0xb2ee80;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x45b0('0x0'),_0x45b0('0x1'),_0x45b0('0x2')];function createListener(_0x4ac06a,_0x4d9c03){return function(_0x6e49fe){_0x4d9c03['emit'](_0x4ac06a,_0x6e49fe);};}function removeListener(_0xf809dd,_0x13a163){return function(){UserProfileEvents[_0x45b0('0x3')](_0xf809dd,_0x13a163);};}exports[_0x45b0('0x4')]=function(_0x1a2926){for(var _0x31cdee=0x0,_0x4d4d27=events[_0x45b0('0x5')];_0x31cdee<_0x4d4d27;_0x31cdee++){var _0x79d23b=events[_0x31cdee];var _0xba32ce=createListener(_0x45b0('0x6')+_0x79d23b,_0x1a2926);UserProfileEvents['on'](_0x79d23b,_0xba32ce);}}; \ No newline at end of file +var _0x6b45=['save','emit','removeListener','register','userProfile:','./userProfile.events'];(function(_0x39af6d,_0x4f7f45){var _0x3cdcfc=function(_0x598dcd){while(--_0x598dcd){_0x39af6d['push'](_0x39af6d['shift']());}};_0x3cdcfc(++_0x4f7f45);}(_0x6b45,0x1a3));var _0x56b4=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x6b45[_0x403cff];return _0x5a7c56;};'use strict';var UserProfileEvents=require(_0x56b4('0x0'));var events=[_0x56b4('0x1'),'remove','update'];function createListener(_0x26503a,_0x1de992){return function(_0x1bc1e9){_0x1de992[_0x56b4('0x2')](_0x26503a,_0x1bc1e9);};}function removeListener(_0x2bd0df,_0x9be368){return function(){UserProfileEvents[_0x56b4('0x3')](_0x2bd0df,_0x9be368);};}exports[_0x56b4('0x4')]=function(_0x433fc9){for(var _0x25934b=0x0,_0x346523=events['length'];_0x25934b<_0x346523;_0x25934b++){var _0x24ede8=events[_0x25934b];var _0x32544e=createListener(_0x56b4('0x5')+_0x24ede8,_0x433fc9);UserProfileEvents['on'](_0x24ede8,_0x32544e);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index bc0afe7..1a3662c 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 _0x8efb=['put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x5568e0,_0x516903){var _0x2075b8=function(_0x403e7e){while(--_0x403e7e){_0x5568e0['push'](_0x5568e0['shift']());}};_0x2075b8(++_0x516903);}(_0x8efb,0xed));var _0xb8ef=function(_0x298568,_0x30d4ff){_0x298568=_0x298568-0x0;var _0x656375=_0x8efb[_0x298568];return _0x656375;};'use strict';var multer=require(_0xb8ef('0x0'));var util=require('util');var path=require(_0xb8ef('0x1'));var timeout=require(_0xb8ef('0x2'));var express=require(_0xb8ef('0x3'));var router=express[_0xb8ef('0x4')]();var fs_extra=require(_0xb8ef('0x5'));var auth=require(_0xb8ef('0x6'));var interaction=require(_0xb8ef('0x7'));var config=require('../../config/environment');var controller=require(_0xb8ef('0x8'));router[_0xb8ef('0x9')]('/',auth[_0xb8ef('0xa')](),controller[_0xb8ef('0xb')]);router[_0xb8ef('0x9')]('/describe',auth[_0xb8ef('0xa')](),controller[_0xb8ef('0xc')]);router[_0xb8ef('0x9')](_0xb8ef('0xd'),auth[_0xb8ef('0xa')](),controller[_0xb8ef('0xe')]);router['post']('/',auth[_0xb8ef('0xa')](),controller['create']);router[_0xb8ef('0xf')](_0xb8ef('0xd'),auth[_0xb8ef('0xa')](),controller[_0xb8ef('0x10')]);router['delete'](_0xb8ef('0xd'),auth['isAuthenticated'](),controller[_0xb8ef('0x11')]);module['exports']=router; \ No newline at end of file +var _0x73a8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','/describe','isAuthenticated','describe','post','put','/:id','update','multer','util'];(function(_0x2b9255,_0x5be6c6){var _0x104ca4=function(_0x79f6d6){while(--_0x79f6d6){_0x2b9255['push'](_0x2b9255['shift']());}};_0x104ca4(++_0x5be6c6);}(_0x73a8,0x1de));var _0x873a=function(_0x578625,_0x2582fa){_0x578625=_0x578625-0x0;var _0x1ea1bc=_0x73a8[_0x578625];return _0x1ea1bc;};'use strict';var multer=require(_0x873a('0x0'));var util=require(_0x873a('0x1'));var path=require('path');var timeout=require(_0x873a('0x2'));var express=require(_0x873a('0x3'));var router=express[_0x873a('0x4')]();var fs_extra=require(_0x873a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x873a('0x6'));var config=require('../../config/environment');var controller=require(_0x873a('0x7'));router[_0x873a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x873a('0x8')](_0x873a('0x9'),auth[_0x873a('0xa')](),controller[_0x873a('0xb')]);router[_0x873a('0x8')]('/:id',auth[_0x873a('0xa')](),controller['show']);router[_0x873a('0xc')]('/',auth[_0x873a('0xa')](),controller['create']);router[_0x873a('0xd')](_0x873a('0xe'),auth['isAuthenticated'](),controller[_0x873a('0xf')]);router['delete'](_0x873a('0xe'),auth[_0x873a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3ee596b..014c864 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 _0xd0e0=['STRING','INTEGER','sequelize','exports'];(function(_0x210f65,_0x2d9898){var _0x16cdd6=function(_0x568cbe){while(--_0x568cbe){_0x210f65['push'](_0x210f65['shift']());}};_0x16cdd6(++_0x2d9898);}(_0xd0e0,0x6e));var _0x0d0e=function(_0x2ac680,_0x3765dd){_0x2ac680=_0x2ac680-0x0;var _0x5460f5=_0xd0e0[_0x2ac680];return _0x5460f5;};'use strict';var Sequelize=require(_0x0d0e('0x0'));module[_0x0d0e('0x1')]={'name':{'type':Sequelize[_0x0d0e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0d0e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0d0e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xafb7=['INTEGER','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xafb7,0x101));var _0x7afb=function(_0x28460c,_0x55177b){_0x28460c=_0x28460c-0x0;var _0x5e287c=_0xafb7[_0x28460c];return _0x5e287c;};'use strict';var Sequelize=require(_0x7afb('0x0'));module[_0x7afb('0x1')]={'name':{'type':Sequelize[_0x7afb('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7afb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7afb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 78bd82b..30c0d15 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 _0x5496=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x131713,_0x3d114d){var _0x44f361=function(_0x2ce119){while(--_0x2ce119){_0x131713['push'](_0x131713['shift']());}};_0x44f361(++_0x3d114d);}(_0x5496,0x175));var _0x6549=function(_0x1c588f,_0x50345e){_0x1c588f=_0x1c588f-0x0;var _0xf947ff=_0x5496[_0x1c588f];return _0xf947ff;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['UserProfileResource'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));};exports['describe']=function(_0x28af00,_0x4bbc61){return db[_0x6549('0x2b')][_0x6549('0x4e')]()[_0x6549('0x26')](respondWithResult(_0x4bbc61,null))[_0x6549('0x43')](handleError(_0x4bbc61,null));}; \ No newline at end of file +var _0x1a37=['index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a37,0xb4));var _0x71a3=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x1a37[_0xd0b415];return _0x2bdf2c;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index d1f9d3f..96d24a7 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 _0x4faf=['request-promise','path','rimraf','../../config/environment','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment'];(function(_0x302cb5,_0xc0e0fb){var _0x296710=function(_0x16cd6b){while(--_0x16cd6b){_0x302cb5['push'](_0x302cb5['shift']());}};_0x296710(++_0xc0e0fb);}(_0x4faf,0x19f));var _0xf4fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4faf[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf4fa('0x0'));var util=require(_0xf4fa('0x1'));var logger=require(_0xf4fa('0x2'))(_0xf4fa('0x3'));var moment=require(_0xf4fa('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4fa('0x5'));var fs=require('fs');var path=require(_0xf4fa('0x6'));var rimraf=require(_0xf4fa('0x7'));var config=require(_0xf4fa('0x8'));var attributes=require('./userProfileResource.attributes');module[_0xf4fa('0x9')]=function(_0x66b545,_0x3c24da){return _0x66b545[_0xf4fa('0xa')]('UserProfileResource',attributes,{'tableName':_0xf4fa('0xb'),'paranoid':![],'indexes':[{'name':_0xf4fa('0xc'),'fields':[_0xf4fa('0xd'),_0xf4fa('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e86=['compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources'];(function(_0x2144ed,_0x581302){var _0x296cb4=function(_0x5d9b99){while(--_0x5d9b99){_0x2144ed['push'](_0x2144ed['shift']());}};_0x296cb4(++_0x581302);}(_0x4e86,0xb9));var _0x64e8=function(_0x2b3ba1,_0x1eba89){_0x2b3ba1=_0x2b3ba1-0x0;var _0x281a27=_0x4e86[_0x2b3ba1];return _0x281a27;};'use strict';var _=require(_0x64e8('0x0'));var util=require(_0x64e8('0x1'));var logger=require(_0x64e8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64e8('0x3'));var fs=require('fs');var path=require(_0x64e8('0x4'));var rimraf=require(_0x64e8('0x5'));var config=require(_0x64e8('0x6'));var attributes=require(_0x64e8('0x7'));module[_0x64e8('0x8')]=function(_0x5bd994,_0xcc928){return _0x5bd994[_0x64e8('0x9')]('UserProfileResource',attributes,{'tableName':_0x64e8('0xa'),'paranoid':![],'indexes':[{'name':_0x64e8('0xb'),'fields':[_0x64e8('0xc'),_0x64e8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index adb40da..2683f6f 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 _0x50c4=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x46ea1f,_0x21565f){var _0x32fcc7=function(_0x94be86){while(--_0x94be86){_0x46ea1f['push'](_0x46ea1f['shift']());}};_0x32fcc7(++_0x21565f);}(_0x50c4,0x100));var _0x450c=function(_0x18bf17,_0x32626e){_0x18bf17=_0x18bf17-0x0;var _0x7c4e02=_0x50c4[_0x18bf17];return _0x7c4e02;};'use strict';var _=require(_0x450c('0x0'));var util=require(_0x450c('0x1'));var moment=require(_0x450c('0x2'));var BPromise=require(_0x450c('0x3'));var rs=require(_0x450c('0x4'));var fs=require('fs');var Redis=require(_0x450c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x450c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x450c('0x7'));var jayson=require(_0x450c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x240d4b,_0x46e59c,_0x537843){return new BPromise(function(_0x5f439d,_0x580c39){return client[_0x450c('0x9')](_0x240d4b,_0x537843)['then'](function(_0x4ceb6f){logger[_0x450c('0xa')](_0x450c('0xb'),_0x46e59c,_0x450c('0xc'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x46e59c,_0x450c('0xc'),JSON[_0x450c('0xd')](_0x4ceb6f));if(_0x4ceb6f['error']){if(_0x4ceb6f[_0x450c('0xe')][_0x450c('0xf')]===0x1f4){logger['error'](_0x450c('0xb'),_0x46e59c,_0x4ceb6f[_0x450c('0xe')][_0x450c('0x10')]);return _0x580c39(_0x4ceb6f[_0x450c('0xe')][_0x450c('0x10')]);}logger[_0x450c('0xe')](_0x450c('0xb'),_0x46e59c,_0x4ceb6f[_0x450c('0xe')][_0x450c('0x10')]);return _0x5f439d(_0x4ceb6f[_0x450c('0xe')][_0x450c('0x10')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x46e59c,_0x450c('0xc'));_0x5f439d(_0x4ceb6f['result'][_0x450c('0x10')]);}})[_0x450c('0x11')](function(_0x3c6067){logger['error'](_0x450c('0xb'),_0x46e59c,_0x3c6067);_0x580c39(_0x3c6067);});});} \ No newline at end of file +var _0xae9f=['UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xae9f,0x137));var _0xfae9=function(_0x1eb8b4,_0x72e744){_0x1eb8b4=_0x1eb8b4-0x0;var _0x216fb5=_0xae9f[_0x1eb8b4];return _0x216fb5;};'use strict';var _=require(_0xfae9('0x0'));var util=require(_0xfae9('0x1'));var moment=require(_0xfae9('0x2'));var BPromise=require('bluebird');var rs=require(_0xfae9('0x3'));var fs=require('fs');var Redis=require(_0xfae9('0x4'));var db=require(_0xfae9('0x5'))['db'];var utils=require(_0xfae9('0x6'));var logger=require(_0xfae9('0x7'))(_0xfae9('0x8'));var config=require(_0xfae9('0x9'));var jayson=require(_0xfae9('0xa'));var client=jayson['client'][_0xfae9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x401d12,_0xc26a3b,_0x4aa03f){return new BPromise(function(_0x377190,_0x53bc66){return client[_0xfae9('0xc')](_0x401d12,_0x4aa03f)[_0xfae9('0xd')](function(_0x5f5400){logger['info'](_0xfae9('0xe'),_0xc26a3b,_0xfae9('0xf'));logger[_0xfae9('0x10')](_0xfae9('0x11'),_0xc26a3b,_0xfae9('0xf'),JSON[_0xfae9('0x12')](_0x5f5400));if(_0x5f5400['error']){if(_0x5f5400['error'][_0xfae9('0x13')]===0x1f4){logger['error'](_0xfae9('0xe'),_0xc26a3b,_0x5f5400[_0xfae9('0x14')]['message']);return _0x53bc66(_0x5f5400[_0xfae9('0x14')][_0xfae9('0x15')]);}logger[_0xfae9('0x14')](_0xfae9('0xe'),_0xc26a3b,_0x5f5400['error'][_0xfae9('0x15')]);return _0x377190(_0x5f5400[_0xfae9('0x14')][_0xfae9('0x15')]);}else{logger[_0xfae9('0x16')]('UserProfileResource,\x20%s,\x20%s',_0xc26a3b,_0xfae9('0xf'));_0x377190(_0x5f5400[_0xfae9('0x17')][_0xfae9('0x15')]);}})[_0xfae9('0x18')](function(_0x58a075){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xc26a3b,_0x58a075);_0x53bc66(_0x58a075);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 257d305..c118c2b 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 _0x1c63=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1f37d5,_0x102bb8){var _0x3bbd99=function(_0x194067){while(--_0x194067){_0x1f37d5['push'](_0x1f37d5['shift']());}};_0x3bbd99(++_0x102bb8);}(_0x1c63,0x1cf));var _0x31c6=function(_0x3260eb,_0x284ae0){_0x3260eb=_0x3260eb-0x0;var _0x4c28d9=_0x1c63[_0x3260eb];return _0x4c28d9;};'use strict';var multer=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var path=require(_0x31c6('0x2'));var timeout=require(_0x31c6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x31c6('0x4'));var auth=require(_0x31c6('0x5'));var interaction=require(_0x31c6('0x6'));var config=require('../../config/environment');var controller=require(_0x31c6('0x7'));router[_0x31c6('0x8')]('/',auth[_0x31c6('0x9')](),controller[_0x31c6('0xa')]);router['get']('/describe',auth[_0x31c6('0x9')](),controller[_0x31c6('0xb')]);router['get'](_0x31c6('0xc'),auth[_0x31c6('0x9')](),controller[_0x31c6('0xd')]);router[_0x31c6('0xe')]('/',auth[_0x31c6('0x9')](),controller[_0x31c6('0xf')]);router[_0x31c6('0x10')](_0x31c6('0xc'),auth[_0x31c6('0x9')](),controller[_0x31c6('0x11')]);router[_0x31c6('0x12')](_0x31c6('0xc'),auth[_0x31c6('0x9')](),controller[_0x31c6('0x13')]);module[_0x31c6('0x14')]=router; \ No newline at end of file +var _0x2d21=['util','path','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','destroy','exports','multer'];(function(_0x2766ea,_0x348b8d){var _0x16439a=function(_0x1fd239){while(--_0x1fd239){_0x2766ea['push'](_0x2766ea['shift']());}};_0x16439a(++_0x348b8d);}(_0x2d21,0xcf));var _0x12d2=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x2d21[_0xa6cb09];return _0x12b437;};'use strict';var multer=require(_0x12d2('0x0'));var util=require(_0x12d2('0x1'));var path=require(_0x12d2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x12d2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x12d2('0x4'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x12d2('0x5')]('/',auth[_0x12d2('0x6')](),controller['index']);router[_0x12d2('0x5')](_0x12d2('0x7'),auth['isAuthenticated'](),controller[_0x12d2('0x8')]);router['get'](_0x12d2('0x9'),auth[_0x12d2('0x6')](),controller[_0x12d2('0xa')]);router[_0x12d2('0xb')]('/',auth[_0x12d2('0x6')](),controller['create']);router[_0x12d2('0xc')](_0x12d2('0x9'),auth[_0x12d2('0x6')](),controller[_0x12d2('0xd')]);router['delete'](_0x12d2('0x9'),auth[_0x12d2('0x6')](),controller[_0x12d2('0xe')]);module[_0x12d2('0xf')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index aed94f4..5cb257b 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 _0x1399=['sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x58ee32,_0x5b4e4a){var _0x41f6bd=function(_0x3812ac){while(--_0x3812ac){_0x58ee32['push'](_0x58ee32['shift']());}};_0x41f6bd(++_0x5b4e4a);}(_0x1399,0x16c));var _0x9139=function(_0x14612f,_0x1c3389){_0x14612f=_0x14612f-0x0;var _0x3c41ad=_0x1399[_0x14612f];return _0x3c41ad;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x9139('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9139('0x2')],'set':function(_0x28f155){this[_0x9139('0x4')](_0x9139('0x5'),_0x28f155?_0x28f155['join'](''):[]);},'get':function(){return this['getDataValue'](_0x9139('0x5'))?this[_0x9139('0x6')](_0x9139('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x9354=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9354,0x96));var _0x4935=function(_0x209302,_0x5826ac){_0x209302=_0x209302-0x0;var _0x1df8e9=_0x9354[_0x209302];return _0x1df8e9;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'name':{'type':Sequelize[_0x4935('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4935('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4935('0x1')],'set':function(_0x5327fc){this[_0x4935('0x4')](_0x4935('0x5'),_0x5327fc?_0x5327fc[_0x4935('0x6')](''):[]);},'get':function(){return this[_0x4935('0x7')](_0x4935('0x5'))?this[_0x4935('0x7')](_0x4935('0x5'))[_0x4935('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 66b0843..f335524 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 _0x299d=['keys','includeAll','find','create','body','params','describe','eml-format','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','include','findAll','rows','catch'];(function(_0x536eba,_0x38384e){var _0x3cc70f=function(_0x447b26){while(--_0x447b26){_0x536eba['push'](_0x536eba['shift']());}};_0x3cc70f(++_0x38384e);}(_0x299d,0x16f));var _0xd299=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x299d[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0xd299('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd299('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd299('0x2'));var BPromise=require(_0xd299('0x3'));var Mustache=require(_0xd299('0x4'));var util=require('util');var path=require(_0xd299('0x5'));var sox=require(_0xd299('0x6'));var csv=require('to-csv');var ejs=require(_0xd299('0x7'));var fs=require('fs');var fs_extra=require(_0xd299('0x8'));var _=require('lodash');var squel=require(_0xd299('0x9'));var crypto=require('crypto');var jsforce=require(_0xd299('0xa'));var deskjs=require(_0xd299('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd299('0xc'));var Papa=require(_0xd299('0xd'));var Redis=require(_0xd299('0xe'));var authService=require(_0xd299('0xf'));var qs=require(_0xd299('0x10'));var as=require(_0xd299('0x11'));var hardwareService=require(_0xd299('0x12'));var logger=require(_0xd299('0x13'))('api');var utils=require(_0xd299('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd299('0x15'));var db=require(_0xd299('0x16'))['db'];function respondWithStatusCode(_0x1c2ba6,_0x50f369){_0x50f369=_0x50f369||0xcc;return function(_0x2768cc){if(_0x2768cc){return _0x1c2ba6[_0xd299('0x17')](_0x50f369);}return _0x1c2ba6[_0xd299('0x18')](_0x50f369)[_0xd299('0x19')]();};}function respondWithResult(_0x57fc1f,_0x26654a){_0x26654a=_0x26654a||0xc8;return function(_0x162d04){if(_0x162d04){return _0x57fc1f[_0xd299('0x18')](_0x26654a)[_0xd299('0x1a')](_0x162d04);}};}function respondWithFilteredResult(_0x59b97d,_0x17155d){return function(_0x335311){if(_0x335311){var _0x38c9e4=typeof _0x17155d['offset']===_0xd299('0x1b')&&typeof _0x17155d[_0xd299('0x1c')]===_0xd299('0x1b');var _0x418b6d=_0x335311[_0xd299('0x1d')];var _0x389724=_0x38c9e4?0x0:_0x17155d[_0xd299('0x1e')];var _0x36d19b=_0x38c9e4?_0x335311[_0xd299('0x1d')]:_0x17155d[_0xd299('0x1e')]+_0x17155d['limit'];var _0x25ef62;if(_0x36d19b>=_0x418b6d){_0x36d19b=_0x418b6d;_0x25ef62=0xc8;}else{_0x25ef62=0xce;}_0x59b97d['status'](_0x25ef62);return _0x59b97d['set'](_0xd299('0x1f'),_0x389724+'-'+_0x36d19b+'/'+_0x418b6d)['json'](_0x335311);}return null;};}function patchUpdates(_0x47420f){return function(_0x3e3868){try{jsonpatch[_0xd299('0x20')](_0x3e3868,_0x47420f,!![]);}catch(_0x463531){return BPromise['reject'](_0x463531);}return _0x3e3868[_0xd299('0x21')]();};}function saveUpdates(_0xfcbc1d,_0x2d85f1){return function(_0x27a3d2){if(_0x27a3d2){return _0x27a3d2[_0xd299('0x22')](_0xfcbc1d)[_0xd299('0x23')](function(_0x47a2f2){return _0x47a2f2;});}return null;};}function removeEntity(_0x154072,_0x4b19f4){return function(_0x2a5a65){if(_0x2a5a65){return _0x2a5a65[_0xd299('0x24')]()[_0xd299('0x23')](function(){_0x154072[_0xd299('0x18')](0xcc)[_0xd299('0x19')]();});}};}function handleEntityNotFound(_0x2d20de,_0x5b68e5){return function(_0x11f740){if(!_0x11f740){_0x2d20de[_0xd299('0x17')](0x194);}return _0x11f740;};}function handleError(_0x3aa8c0,_0x1518df){_0x1518df=_0x1518df||0x1f4;return function(_0x45d5af){logger['error'](_0x45d5af[_0xd299('0x25')]);if(_0x45d5af[_0xd299('0x26')]){delete _0x45d5af['name'];}_0x3aa8c0[_0xd299('0x18')](_0x1518df)[_0xd299('0x27')](_0x45d5af);};}exports[_0xd299('0x28')]=function(_0x3fe6d2,_0x2ab000){var _0x9e60ce={},_0x1d8b3b={},_0xc1b632={'count':0x0,'rows':[]};var _0x2d7ac4=_[_0xd299('0x29')](db[_0xd299('0x2a')][_0xd299('0x2b')],function(_0x2d5b4a){return{'name':_0x2d5b4a[_0xd299('0x2c')],'type':_0x2d5b4a['type']['key']};});_0x1d8b3b[_0xd299('0x2d')]=_['map'](_0x2d7ac4,'name');_0x1d8b3b[_0xd299('0x2e')]=_['keys'](_0x3fe6d2['query']);_0x1d8b3b[_0xd299('0x2f')]=_[_0xd299('0x30')](_0x1d8b3b[_0xd299('0x2d')],_0x1d8b3b[_0xd299('0x2e')]);_0x9e60ce[_0xd299('0x31')]=_[_0xd299('0x30')](_0x1d8b3b[_0xd299('0x2d')],qs['fields'](_0x3fe6d2['query'][_0xd299('0x32')]));_0x9e60ce[_0xd299('0x31')]=_0x9e60ce[_0xd299('0x31')][_0xd299('0x33')]?_0x9e60ce[_0xd299('0x31')]:_0x1d8b3b[_0xd299('0x2d')];if(!_0x3fe6d2[_0xd299('0x2e')][_0xd299('0x34')](_0xd299('0x35'))){_0x9e60ce[_0xd299('0x1c')]=qs['limit'](_0x3fe6d2[_0xd299('0x2e')][_0xd299('0x1c')]);_0x9e60ce[_0xd299('0x1e')]=qs[_0xd299('0x1e')](_0x3fe6d2[_0xd299('0x2e')][_0xd299('0x1e')]);}_0x9e60ce[_0xd299('0x36')]=qs[_0xd299('0x37')](_0x3fe6d2[_0xd299('0x2e')][_0xd299('0x37')]);_0x9e60ce[_0xd299('0x38')]=qs[_0xd299('0x2f')](_['pick'](_0x3fe6d2[_0xd299('0x2e')],_0x1d8b3b[_0xd299('0x2f')]),_0x2d7ac4);if(_0x3fe6d2[_0xd299('0x2e')][_0xd299('0x39')]){_0x9e60ce[_0xd299('0x38')]=_['merge'](_0x9e60ce[_0xd299('0x38')],{'$or':_['map'](_0x2d7ac4,function(_0x503c6f){if(_0x503c6f[_0xd299('0x3a')]!=='VIRTUAL'){var _0x553640={};_0x553640[_0x503c6f[_0xd299('0x26')]]={'$like':'%'+_0x3fe6d2['query'][_0xd299('0x39')]+'%'};return _0x553640;}})});}_0x9e60ce=_[_0xd299('0x3b')]({},_0x9e60ce,_0x3fe6d2[_0xd299('0x3c')]);var _0x5f208b={'where':_0x9e60ce[_0xd299('0x38')]};return db['UserProfileSection'][_0xd299('0x1d')](_0x5f208b)[_0xd299('0x23')](function(_0x431c9d){_0xc1b632[_0xd299('0x1d')]=_0x431c9d;if(_0x3fe6d2[_0xd299('0x2e')]['includeAll']){_0x9e60ce[_0xd299('0x3d')]=[{'all':!![]}];}return db[_0xd299('0x2a')][_0xd299('0x3e')](_0x9e60ce);})[_0xd299('0x23')](function(_0x1fb1eb){_0xc1b632[_0xd299('0x3f')]=_0x1fb1eb;return _0xc1b632;})[_0xd299('0x23')](respondWithFilteredResult(_0x2ab000,_0x9e60ce))[_0xd299('0x40')](handleError(_0x2ab000,null));};exports['show']=function(_0x176bf6,_0x540b02){var _0x259315={'raw':![],'where':{'id':_0x176bf6['params']['id']}},_0x1408fa={};_0x1408fa[_0xd299('0x2d')]=_[_0xd299('0x41')](db[_0xd299('0x2a')][_0xd299('0x2b')]);_0x1408fa[_0xd299('0x2e')]=_[_0xd299('0x41')](_0x176bf6['query']);_0x1408fa[_0xd299('0x2f')]=_[_0xd299('0x30')](_0x1408fa['model'],_0x1408fa['query']);_0x259315[_0xd299('0x31')]=_['intersection'](_0x1408fa[_0xd299('0x2d')],qs[_0xd299('0x32')](_0x176bf6[_0xd299('0x2e')][_0xd299('0x32')]));_0x259315['attributes']=_0x259315[_0xd299('0x31')][_0xd299('0x33')]?_0x259315[_0xd299('0x31')]:_0x1408fa[_0xd299('0x2d')];if(_0x176bf6[_0xd299('0x2e')][_0xd299('0x42')]){_0x259315['include']=[{'all':!![]}];}_0x259315=_[_0xd299('0x3b')]({},_0x259315,_0x176bf6[_0xd299('0x3c')]);return db[_0xd299('0x2a')][_0xd299('0x43')](_0x259315)[_0xd299('0x23')](handleEntityNotFound(_0x540b02,null))[_0xd299('0x23')](respondWithResult(_0x540b02,null))[_0xd299('0x40')](handleError(_0x540b02,null));};exports[_0xd299('0x44')]=function(_0x10b97c,_0x1eb205){return db[_0xd299('0x2a')][_0xd299('0x44')](_0x10b97c[_0xd299('0x45')],{})[_0xd299('0x23')](respondWithResult(_0x1eb205,0xc9))[_0xd299('0x40')](handleError(_0x1eb205,null));};exports[_0xd299('0x22')]=function(_0x1c2602,_0x163dfb){if(_0x1c2602['body']['id']){delete _0x1c2602[_0xd299('0x45')]['id'];}return db[_0xd299('0x2a')]['find']({'where':{'id':_0x1c2602[_0xd299('0x46')]['id']}})['then'](handleEntityNotFound(_0x163dfb,null))['then'](saveUpdates(_0x1c2602['body'],null))[_0xd299('0x23')](respondWithResult(_0x163dfb,null))[_0xd299('0x40')](handleError(_0x163dfb,null));};exports['destroy']=function(_0x25f11c,_0x336ca6){return db[_0xd299('0x2a')][_0xd299('0x43')]({'where':{'id':_0x25f11c[_0xd299('0x46')]['id']}})[_0xd299('0x23')](handleEntityNotFound(_0x336ca6,null))[_0xd299('0x23')](removeEntity(_0x336ca6,null))['catch'](handleError(_0x336ca6,null));};exports[_0xd299('0x47')]=function(_0xd0b4ce,_0x515b9d){return db[_0xd299('0x2a')]['describe']()[_0xd299('0x23')](respondWithResult(_0x515b9d,null))[_0xd299('0x40')](handleError(_0x515b9d,null));}; \ No newline at end of file +var _0xbaac=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbaac,0x185));var _0xcbaa=function(_0x31659b,_0x3f07a1){_0x31659b=_0x31659b-0x0;var _0x48b140=_0xbaac[_0x31659b];return _0x48b140;};'use strict';var emlformat=require(_0xcbaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcbaa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbaa('0x2'));var moment=require(_0xcbaa('0x3'));var BPromise=require(_0xcbaa('0x4'));var Mustache=require(_0xcbaa('0x5'));var util=require(_0xcbaa('0x6'));var path=require(_0xcbaa('0x7'));var sox=require(_0xcbaa('0x8'));var csv=require(_0xcbaa('0x9'));var ejs=require(_0xcbaa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbaa('0xb'));var squel=require(_0xcbaa('0xc'));var crypto=require(_0xcbaa('0xd'));var jsforce=require(_0xcbaa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcbaa('0x9'));var querystring=require('querystring');var Papa=require(_0xcbaa('0xf'));var Redis=require(_0xcbaa('0x10'));var authService=require(_0xcbaa('0x11'));var qs=require(_0xcbaa('0x12'));var as=require(_0xcbaa('0x13'));var hardwareService=require(_0xcbaa('0x14'));var logger=require(_0xcbaa('0x15'))(_0xcbaa('0x16'));var utils=require('../../config/utils');var config=require(_0xcbaa('0x17'));var licenseUtil=require(_0xcbaa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11bb5f,_0x2e5ec2){_0x2e5ec2=_0x2e5ec2||0xcc;return function(_0x236334){if(_0x236334){return _0x11bb5f[_0xcbaa('0x19')](_0x2e5ec2);}return _0x11bb5f[_0xcbaa('0x1a')](_0x2e5ec2)[_0xcbaa('0x1b')]();};}function respondWithResult(_0x2dc807,_0xb88c87){_0xb88c87=_0xb88c87||0xc8;return function(_0x4d14cb){if(_0x4d14cb){return _0x2dc807[_0xcbaa('0x1a')](_0xb88c87)[_0xcbaa('0x1c')](_0x4d14cb);}};}function respondWithFilteredResult(_0x416748,_0x128250){return function(_0x57593a){if(_0x57593a){var _0x1a993e=typeof _0x128250['offset']==='undefined'&&typeof _0x128250[_0xcbaa('0x1d')]===_0xcbaa('0x1e');var _0x5a5ba5=_0x57593a['count'];var _0x2a9541=_0x1a993e?0x0:_0x128250['offset'];var _0x449327=_0x1a993e?_0x57593a[_0xcbaa('0x1f')]:_0x128250[_0xcbaa('0x20')]+_0x128250['limit'];var _0x144b1d;if(_0x449327>=_0x5a5ba5){_0x449327=_0x5a5ba5;_0x144b1d=0xc8;}else{_0x144b1d=0xce;}_0x416748[_0xcbaa('0x1a')](_0x144b1d);return _0x416748[_0xcbaa('0x21')]('Content-Range',_0x2a9541+'-'+_0x449327+'/'+_0x5a5ba5)['json'](_0x57593a);}return null;};}function patchUpdates(_0xe325f4){return function(_0x15114e){try{jsonpatch[_0xcbaa('0x22')](_0x15114e,_0xe325f4,!![]);}catch(_0x17b76b){return BPromise['reject'](_0x17b76b);}return _0x15114e[_0xcbaa('0x23')]();};}function saveUpdates(_0x2dd904,_0x4fe451){return function(_0x6b482e){if(_0x6b482e){return _0x6b482e[_0xcbaa('0x24')](_0x2dd904)[_0xcbaa('0x25')](function(_0x3fb338){return _0x3fb338;});}return null;};}function removeEntity(_0x2c26b2,_0x3e81bf){return function(_0x1f1c1f){if(_0x1f1c1f){return _0x1f1c1f[_0xcbaa('0x26')]()[_0xcbaa('0x25')](function(){_0x2c26b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5a0c,_0x858c0d){return function(_0x40e3f3){if(!_0x40e3f3){_0x3c5a0c[_0xcbaa('0x19')](0x194);}return _0x40e3f3;};}function handleError(_0x5f58db,_0x113cb0){_0x113cb0=_0x113cb0||0x1f4;return function(_0x4b66b9){logger[_0xcbaa('0x27')](_0x4b66b9[_0xcbaa('0x28')]);if(_0x4b66b9[_0xcbaa('0x29')]){delete _0x4b66b9['name'];}_0x5f58db[_0xcbaa('0x1a')](_0x113cb0)[_0xcbaa('0x2a')](_0x4b66b9);};}exports[_0xcbaa('0x2b')]=function(_0x1c5a29,_0x8ca64e){var _0x334b55={},_0x2a12d1={},_0x277454={'count':0x0,'rows':[]};var _0x30e0d9=_[_0xcbaa('0x2c')](db[_0xcbaa('0x2d')][_0xcbaa('0x2e')],function(_0x5a65a5){return{'name':_0x5a65a5[_0xcbaa('0x2f')],'type':_0x5a65a5[_0xcbaa('0x30')][_0xcbaa('0x31')]};});_0x2a12d1[_0xcbaa('0x32')]=_[_0xcbaa('0x2c')](_0x30e0d9,'name');_0x2a12d1[_0xcbaa('0x33')]=_[_0xcbaa('0x34')](_0x1c5a29[_0xcbaa('0x33')]);_0x2a12d1[_0xcbaa('0x35')]=_[_0xcbaa('0x36')](_0x2a12d1[_0xcbaa('0x32')],_0x2a12d1['query']);_0x334b55[_0xcbaa('0x37')]=_['intersection'](_0x2a12d1[_0xcbaa('0x32')],qs[_0xcbaa('0x38')](_0x1c5a29[_0xcbaa('0x33')]['fields']));_0x334b55[_0xcbaa('0x37')]=_0x334b55[_0xcbaa('0x37')][_0xcbaa('0x39')]?_0x334b55[_0xcbaa('0x37')]:_0x2a12d1[_0xcbaa('0x32')];if(!_0x1c5a29[_0xcbaa('0x33')][_0xcbaa('0x3a')](_0xcbaa('0x3b'))){_0x334b55[_0xcbaa('0x1d')]=qs[_0xcbaa('0x1d')](_0x1c5a29[_0xcbaa('0x33')][_0xcbaa('0x1d')]);_0x334b55[_0xcbaa('0x20')]=qs[_0xcbaa('0x20')](_0x1c5a29[_0xcbaa('0x33')][_0xcbaa('0x20')]);}_0x334b55[_0xcbaa('0x3c')]=qs['sort'](_0x1c5a29[_0xcbaa('0x33')][_0xcbaa('0x3d')]);_0x334b55[_0xcbaa('0x3e')]=qs['filters'](_['pick'](_0x1c5a29[_0xcbaa('0x33')],_0x2a12d1[_0xcbaa('0x35')]),_0x30e0d9);if(_0x1c5a29['query'][_0xcbaa('0x3f')]){_0x334b55[_0xcbaa('0x3e')]=_[_0xcbaa('0x40')](_0x334b55[_0xcbaa('0x3e')],{'$or':_[_0xcbaa('0x2c')](_0x30e0d9,function(_0x218759){if(_0x218759[_0xcbaa('0x30')]!==_0xcbaa('0x41')){var _0x81e5d7={};_0x81e5d7[_0x218759[_0xcbaa('0x29')]]={'$like':'%'+_0x1c5a29['query'][_0xcbaa('0x3f')]+'%'};return _0x81e5d7;}})});}_0x334b55=_['merge']({},_0x334b55,_0x1c5a29['options']);var _0xbf84b5={'where':_0x334b55[_0xcbaa('0x3e')]};return db[_0xcbaa('0x2d')][_0xcbaa('0x1f')](_0xbf84b5)[_0xcbaa('0x25')](function(_0x1b2a9a){_0x277454[_0xcbaa('0x1f')]=_0x1b2a9a;if(_0x1c5a29[_0xcbaa('0x33')][_0xcbaa('0x42')]){_0x334b55[_0xcbaa('0x43')]=[{'all':!![]}];}return db[_0xcbaa('0x2d')][_0xcbaa('0x44')](_0x334b55);})[_0xcbaa('0x25')](function(_0x3ee4dd){_0x277454[_0xcbaa('0x45')]=_0x3ee4dd;return _0x277454;})[_0xcbaa('0x25')](respondWithFilteredResult(_0x8ca64e,_0x334b55))[_0xcbaa('0x46')](handleError(_0x8ca64e,null));};exports[_0xcbaa('0x47')]=function(_0x3af057,_0x5075fd){var _0x1331eb={'raw':![],'where':{'id':_0x3af057[_0xcbaa('0x48')]['id']}},_0x896dd7={};_0x896dd7[_0xcbaa('0x32')]=_['keys'](db[_0xcbaa('0x2d')]['rawAttributes']);_0x896dd7[_0xcbaa('0x33')]=_['keys'](_0x3af057['query']);_0x896dd7[_0xcbaa('0x35')]=_[_0xcbaa('0x36')](_0x896dd7['model'],_0x896dd7['query']);_0x1331eb[_0xcbaa('0x37')]=_[_0xcbaa('0x36')](_0x896dd7[_0xcbaa('0x32')],qs[_0xcbaa('0x38')](_0x3af057[_0xcbaa('0x33')][_0xcbaa('0x38')]));_0x1331eb[_0xcbaa('0x37')]=_0x1331eb[_0xcbaa('0x37')][_0xcbaa('0x39')]?_0x1331eb[_0xcbaa('0x37')]:_0x896dd7[_0xcbaa('0x32')];if(_0x3af057[_0xcbaa('0x33')]['includeAll']){_0x1331eb['include']=[{'all':!![]}];}_0x1331eb=_[_0xcbaa('0x40')]({},_0x1331eb,_0x3af057[_0xcbaa('0x49')]);return db[_0xcbaa('0x2d')][_0xcbaa('0x4a')](_0x1331eb)['then'](handleEntityNotFound(_0x5075fd,null))[_0xcbaa('0x25')](respondWithResult(_0x5075fd,null))['catch'](handleError(_0x5075fd,null));};exports[_0xcbaa('0x4b')]=function(_0x58563d,_0x5e9ad3){return db['UserProfileSection'][_0xcbaa('0x4b')](_0x58563d['body'],{})[_0xcbaa('0x25')](respondWithResult(_0x5e9ad3,0xc9))[_0xcbaa('0x46')](handleError(_0x5e9ad3,null));};exports['update']=function(_0x158fd7,_0x553e0e){if(_0x158fd7['body']['id']){delete _0x158fd7[_0xcbaa('0x4c')]['id'];}return db[_0xcbaa('0x2d')]['find']({'where':{'id':_0x158fd7[_0xcbaa('0x48')]['id']}})[_0xcbaa('0x25')](handleEntityNotFound(_0x553e0e,null))[_0xcbaa('0x25')](saveUpdates(_0x158fd7['body'],null))['then'](respondWithResult(_0x553e0e,null))[_0xcbaa('0x46')](handleError(_0x553e0e,null));};exports[_0xcbaa('0x26')]=function(_0x3543f8,_0x54b5c1){return db[_0xcbaa('0x2d')][_0xcbaa('0x4a')]({'where':{'id':_0x3543f8[_0xcbaa('0x48')]['id']}})[_0xcbaa('0x25')](handleEntityNotFound(_0x54b5c1,null))[_0xcbaa('0x25')](removeEntity(_0x54b5c1,null))[_0xcbaa('0x46')](handleError(_0x54b5c1,null));};exports[_0xcbaa('0x4d')]=function(_0x3b8bb3,_0x5f320d){return db[_0xcbaa('0x2d')][_0xcbaa('0x4d')]()[_0xcbaa('0x25')](respondWithResult(_0x5f320d,null))[_0xcbaa('0x46')](handleError(_0x5f320d,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 250c211..20fe20d 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 _0xa683=['bluebird','request-promise','path','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa683,0xda));var _0x3a68=function(_0x13c1b5,_0x3728f7){_0x13c1b5=_0x13c1b5-0x0;var _0x373c66=_0xa683[_0x13c1b5];return _0x373c66;};'use strict';var _=require(_0x3a68('0x0'));var util=require('util');var logger=require(_0x3a68('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3a68('0x2'));var rp=require(_0x3a68('0x3'));var fs=require('fs');var path=require(_0x3a68('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x3a68('0x5')]=function(_0x292546,_0x41dfdf){return _0x292546['define'](_0x3a68('0x6'),attributes,{'tableName':_0x3a68('0x7'),'paranoid':![],'indexes':[{'name':_0x3a68('0x8'),'fields':[_0x3a68('0x9'),_0x3a68('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc71=['user_profile_has_sections','sectionId','lodash','../../config/logger','moment','request-promise','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x17bbe5,_0x2784bb){var _0x453863=function(_0x49f5e3){while(--_0x49f5e3){_0x17bbe5['push'](_0x17bbe5['shift']());}};_0x453863(++_0x2784bb);}(_0xbc71,0x86));var _0x1bc7=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xbc71[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x1bc7('0x0'));var util=require('util');var logger=require(_0x1bc7('0x1'))('api');var moment=require(_0x1bc7('0x2'));var BPromise=require('bluebird');var rp=require(_0x1bc7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1bc7('0x4'));var attributes=require(_0x1bc7('0x5'));module[_0x1bc7('0x6')]=function(_0x4c5a21,_0xd59149){return _0x4c5a21[_0x1bc7('0x7')](_0x1bc7('0x8'),attributes,{'tableName':_0x1bc7('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x1bc7('0xa'),'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 1da0d14..17f75f0 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 _0x7c95=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7c95,0x6b));var _0x57c9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7c95[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x57c9('0x0'));var util=require(_0x57c9('0x1'));var moment=require(_0x57c9('0x2'));var BPromise=require(_0x57c9('0x3'));var rs=require(_0x57c9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57c9('0x5'))['db'];var utils=require(_0x57c9('0x6'));var logger=require(_0x57c9('0x7'))(_0x57c9('0x8'));var config=require(_0x57c9('0x9'));var jayson=require(_0x57c9('0xa'));var client=jayson[_0x57c9('0xb')][_0x57c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d9903,_0x331db7,_0x51e96f){return new BPromise(function(_0x2dd23e,_0x1cce20){return client[_0x57c9('0xd')](_0x3d9903,_0x51e96f)[_0x57c9('0xe')](function(_0x486f4b){logger[_0x57c9('0xf')](_0x57c9('0x10'),_0x331db7,'request\x20sent');logger[_0x57c9('0x11')](_0x57c9('0x12'),_0x331db7,'request\x20sent',JSON[_0x57c9('0x13')](_0x486f4b));if(_0x486f4b[_0x57c9('0x14')]){if(_0x486f4b[_0x57c9('0x14')][_0x57c9('0x15')]===0x1f4){logger[_0x57c9('0x14')](_0x57c9('0x10'),_0x331db7,_0x486f4b[_0x57c9('0x14')][_0x57c9('0x16')]);return _0x1cce20(_0x486f4b[_0x57c9('0x14')][_0x57c9('0x16')]);}logger[_0x57c9('0x14')](_0x57c9('0x10'),_0x331db7,_0x486f4b[_0x57c9('0x14')]['message']);return _0x2dd23e(_0x486f4b[_0x57c9('0x14')][_0x57c9('0x16')]);}else{logger['info'](_0x57c9('0x10'),_0x331db7,_0x57c9('0x17'));_0x2dd23e(_0x486f4b[_0x57c9('0x18')][_0x57c9('0x16')]);}})[_0x57c9('0x19')](function(_0x379fda){logger[_0x57c9('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x331db7,_0x379fda);_0x1cce20(_0x379fda);});});} \ No newline at end of file +var _0xba12=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','UserProfileSection,\x20%s,\x20%s'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xba12,0xa4));var _0x2ba1=function(_0x261bb1,_0x132075){_0x261bb1=_0x261bb1-0x0;var _0x18127c=_0xba12[_0x261bb1];return _0x18127c;};'use strict';var _=require('lodash');var util=require(_0x2ba1('0x0'));var moment=require('moment');var BPromise=require(_0x2ba1('0x1'));var rs=require(_0x2ba1('0x2'));var fs=require('fs');var Redis=require(_0x2ba1('0x3'));var db=require(_0x2ba1('0x4'))['db'];var utils=require(_0x2ba1('0x5'));var logger=require(_0x2ba1('0x6'))(_0x2ba1('0x7'));var config=require('../../config/environment');var jayson=require(_0x2ba1('0x8'));var client=jayson[_0x2ba1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed09b,_0x175148,_0x3d8914){return new BPromise(function(_0xc9fce7,_0x41825f){return client['request'](_0x1ed09b,_0x3d8914)[_0x2ba1('0xa')](function(_0x2bf3cd){logger['info'](_0x2ba1('0xb'),_0x175148,'request\x20sent');logger[_0x2ba1('0xc')](_0x2ba1('0xd'),_0x175148,_0x2ba1('0xe'),JSON[_0x2ba1('0xf')](_0x2bf3cd));if(_0x2bf3cd[_0x2ba1('0x10')]){if(_0x2bf3cd[_0x2ba1('0x10')][_0x2ba1('0x11')]===0x1f4){logger[_0x2ba1('0x10')](_0x2ba1('0xb'),_0x175148,_0x2bf3cd[_0x2ba1('0x10')][_0x2ba1('0x12')]);return _0x41825f(_0x2bf3cd[_0x2ba1('0x10')][_0x2ba1('0x12')]);}logger[_0x2ba1('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x175148,_0x2bf3cd[_0x2ba1('0x10')][_0x2ba1('0x12')]);return _0xc9fce7(_0x2bf3cd[_0x2ba1('0x10')]['message']);}else{logger[_0x2ba1('0x13')](_0x2ba1('0xb'),_0x175148,_0x2ba1('0xe'));_0xc9fce7(_0x2bf3cd[_0x2ba1('0x14')]['message']);}})[_0x2ba1('0x15')](function(_0x35c30a){logger[_0x2ba1('0x10')](_0x2ba1('0xb'),_0x175148,_0x35c30a);_0x41825f(_0x35c30a);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0b83f9d..7fd7906 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4f74a5,_0x1fd979){var _0x5be8b2=function(_0x3bb233){while(--_0x3bb233){_0x4f74a5['push'](_0x4f74a5['shift']());}};_0x5be8b2(++_0x1fd979);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x19ada3,_0x4f2f82){var _0xb70caf=function(_0x4c71ed){while(--_0x4c71ed){_0x19ada3['push'](_0x19ada3['shift']());}};_0xb70caf(++_0x4f2f82);}(_0x70e0,0x17b));var _0x070e=function(_0x45b831,_0x487587){_0x45b831=_0x45b831-0x0;var _0x443fa1=_0x70e0[_0x45b831];return _0x443fa1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 3c8410c..c27c2de 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 _0x81b6=['exports','sequelize'];(function(_0x5ea622,_0x2b85bb){var _0x5d5e59=function(_0x44c149){while(--_0x44c149){_0x5ea622['push'](_0x5ea622['shift']());}};_0x5d5e59(++_0x2b85bb);}(_0x81b6,0x137));var _0x681b=function(_0x21cb0b,_0x4ee83f){_0x21cb0b=_0x21cb0b-0x0;var _0xbd856b=_0x81b6[_0x21cb0b];return _0xbd856b;};'use strict';var Sequelize=require(_0x681b('0x0'));module[_0x681b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xab90=['INTEGER','exports'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0xab90,0x175));var _0x0ab9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xab90[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module[_0x0ab9('0x0')]={'penalty':{'type':Sequelize[_0x0ab9('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index bbc9b80..2ec5116 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 _0xf61e=['bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4b9510,_0x1b8e42){var _0xc815ef=function(_0x135403){while(--_0x135403){_0x4b9510['push'](_0x4b9510['shift']());}};_0xc815ef(++_0x1b8e42);}(_0xf61e,0x191));var _0xef61=function(_0x2f9a35,_0x3c27b2){_0x2f9a35=_0x2f9a35-0x0;var _0x1e760c=_0xf61e[_0x2f9a35];return _0x1e760c;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));module[_0xef61('0xb')]=function(_0x5b00b2,_0x9e17f4){return _0x5b00b2[_0xef61('0xc')]('UserSmsQueue',attributes,{'tableName':_0xef61('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x292c=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0xf7ff4,_0x543a19){var _0x554e6a=function(_0x4b8192){while(--_0x4b8192){_0xf7ff4['push'](_0xf7ff4['shift']());}};_0x554e6a(++_0x543a19);}(_0x292c,0x66));var _0xc292=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x292c[_0x50cd41];return _0x399475;};'use strict';var _=require(_0xc292('0x0'));var util=require('util');var logger=require(_0xc292('0x1'))(_0xc292('0x2'));var moment=require(_0xc292('0x3'));var BPromise=require(_0xc292('0x4'));var rp=require(_0xc292('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc292('0x6'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xc292('0x7')]=function(_0x1c45ed,_0x2c01eb){return _0x1c45ed[_0xc292('0x8')](_0xc292('0x9'),attributes,{'tableName':_0xc292('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 88368f4..32ce4a5 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 _0xd908=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x335dd4,_0x101b74){var _0x32e79a=function(_0x56ac30){while(--_0x56ac30){_0x335dd4['push'](_0x335dd4['shift']());}};_0x32e79a(++_0x101b74);}(_0xd908,0xb2));var _0x8d90=function(_0x2dd72c,_0x36686a){_0x2dd72c=_0x2dd72c-0x0;var _0x31bf94=_0xd908[_0x2dd72c];return _0x31bf94;};'use strict';var _=require(_0x8d90('0x0'));var util=require(_0x8d90('0x1'));var moment=require(_0x8d90('0x2'));var BPromise=require('bluebird');var rs=require(_0x8d90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d90('0x4'))['db'];var utils=require(_0x8d90('0x5'));var logger=require('../../config/logger')(_0x8d90('0x6'));var config=require(_0x8d90('0x7'));var jayson=require(_0x8d90('0x8'));var client=jayson[_0x8d90('0x9')][_0x8d90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfb7aa5,_0xf104b4,_0x102fa0){return new BPromise(function(_0x33516c,_0x9413da){return client['request'](_0xfb7aa5,_0x102fa0)[_0x8d90('0xb')](function(_0x453018){logger[_0x8d90('0xc')](_0x8d90('0xd'),_0xf104b4,_0x8d90('0xe'));logger['debug'](_0x8d90('0xf'),_0xf104b4,_0x8d90('0xe'),JSON['stringify'](_0x453018));if(_0x453018[_0x8d90('0x10')]){if(_0x453018[_0x8d90('0x10')][_0x8d90('0x11')]===0x1f4){logger[_0x8d90('0x10')](_0x8d90('0xd'),_0xf104b4,_0x453018['error'][_0x8d90('0x12')]);return _0x9413da(_0x453018[_0x8d90('0x10')][_0x8d90('0x12')]);}logger[_0x8d90('0x10')](_0x8d90('0xd'),_0xf104b4,_0x453018['error'][_0x8d90('0x12')]);return _0x33516c(_0x453018[_0x8d90('0x10')]['message']);}else{logger[_0x8d90('0xc')](_0x8d90('0xd'),_0xf104b4,'request\x20sent');_0x33516c(_0x453018[_0x8d90('0x13')]['message']);}})[_0x8d90('0x14')](function(_0x9aac5){logger[_0x8d90('0x10')](_0x8d90('0xd'),_0xf104b4,_0x9aac5);_0x9413da(_0x9aac5);});});} \ No newline at end of file +var _0x7a43=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','UserSmsQueue,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a43,0xe2));var _0x37a4=function(_0x20c306,_0x4057ab){_0x20c306=_0x20c306-0x0;var _0x1af652=_0x7a43[_0x20c306];return _0x1af652;};'use strict';var _=require(_0x37a4('0x0'));var util=require(_0x37a4('0x1'));var moment=require(_0x37a4('0x2'));var BPromise=require(_0x37a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37a4('0x4'));var db=require(_0x37a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x37a4('0x6'))(_0x37a4('0x7'));var config=require(_0x37a4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x37a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8ffa79,_0x1b729e,_0x3ea9fc){return new BPromise(function(_0x1ac16e,_0x5ee853){return client[_0x37a4('0xa')](_0x8ffa79,_0x3ea9fc)[_0x37a4('0xb')](function(_0x4c5af9){logger['info'](_0x37a4('0xc'),_0x1b729e,'request\x20sent');logger[_0x37a4('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1b729e,'request\x20sent',JSON[_0x37a4('0xe')](_0x4c5af9));if(_0x4c5af9['error']){if(_0x4c5af9[_0x37a4('0xf')]['code']===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1b729e,_0x4c5af9[_0x37a4('0xf')][_0x37a4('0x10')]);return _0x5ee853(_0x4c5af9[_0x37a4('0xf')][_0x37a4('0x10')]);}logger['error'](_0x37a4('0xc'),_0x1b729e,_0x4c5af9[_0x37a4('0xf')][_0x37a4('0x10')]);return _0x1ac16e(_0x4c5af9['error'][_0x37a4('0x10')]);}else{logger[_0x37a4('0x11')](_0x37a4('0xc'),_0x1b729e,_0x37a4('0x12'));_0x1ac16e(_0x4c5af9[_0x37a4('0x13')][_0x37a4('0x10')]);}})[_0x37a4('0x14')](function(_0x5a97f7){logger[_0x37a4('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x1b729e,_0x5a97f7);_0x5ee853(_0x5a97f7);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index b33d7ad..8909e69 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 _0xd72d=['sequelize','exports','INTEGER'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0xd72d,0x171));var _0xdd72=function(_0x329d8d,_0x20cffc){_0x329d8d=_0x329d8d-0x0;var _0x5799df=_0xd72d[_0x329d8d];return _0x5799df;};'use strict';var Sequelize=require(_0xdd72('0x0'));module[_0xdd72('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xdd72('0x2')]}}; \ No newline at end of file +var _0xbb7a=['sequelize','exports','INTEGER'];(function(_0x1ed58b,_0x28dde8){var _0x2956b8=function(_0x5a2289){while(--_0x5a2289){_0x1ed58b['push'](_0x1ed58b['shift']());}};_0x2956b8(++_0x28dde8);}(_0xbb7a,0x132));var _0xabb7=function(_0x831d2a,_0x47b0b1){_0x831d2a=_0x831d2a-0x0;var _0x779be4=_0xbb7a[_0x831d2a];return _0x779be4;};'use strict';var Sequelize=require(_0xabb7('0x0'));module[_0xabb7('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xabb7('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 3276d7b..82604a5 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(_0x3c70fe,_0x5b9b9b){var _0x551282=function(_0x1761b6){while(--_0x1761b6){_0x3c70fe['push'](_0x3c70fe['shift']());}};_0x551282(++_0x5b9b9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x442990,_0x2a173c){var _0x1189b7=function(_0x25008b){while(--_0x25008b){_0x442990['push'](_0x442990['shift']());}};_0x1189b7(++_0x2a173c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index f6f93fe..692fb85 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x403d7c,_0x4a3668){var _0x2e4e4f=function(_0x4efc17){while(--_0x4efc17){_0x403d7c['push'](_0x403d7c['shift']());}};_0x2e4e4f(++_0x4a3668);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0xcb91[_0x336264];return _0x53cf91;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x235c75,_0x341193){var _0x4377a1=function(_0x5121b4){while(--_0x5121b4){_0x235c75['push'](_0x235c75['shift']());}};_0x4377a1(++_0x341193);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0xcb91[_0x44f974];return _0x805dbd;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 3fbb3db..e7f835f 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 _0xc0e1=['sequelize','exports','INTEGER'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc0e1,0x147));var _0x1c0e=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xc0e1[_0x361d3f];return _0x320229;};'use strict';var Sequelize=require(_0x1c0e('0x0'));module[_0x1c0e('0x1')]={'penalty':{'type':Sequelize[_0x1c0e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa2c5=['exports','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2c5,0x7a));var _0x5a2c=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xa2c5[_0x2080a3];return _0x8d7d17;};'use strict';var Sequelize=require('sequelize');module[_0x5a2c('0x0')]={'penalty':{'type':Sequelize[_0x5a2c('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 283fa3e..b19a358 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 _0xd32b=['api','bluebird','request-promise','path','../../config/environment','define','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x34967a,_0x2d119d){var _0x2fb2a3=function(_0x420743){while(--_0x420743){_0x34967a['push'](_0x34967a['shift']());}};_0x2fb2a3(++_0x2d119d);}(_0xd32b,0x165));var _0xbd32=function(_0x26ef8a,_0x11461a){_0x26ef8a=_0x26ef8a-0x0;var _0x441206=_0xd32b[_0x26ef8a];return _0x441206;};'use strict';var _=require(_0xbd32('0x0'));var util=require(_0xbd32('0x1'));var logger=require(_0xbd32('0x2'))(_0xbd32('0x3'));var moment=require('moment');var BPromise=require(_0xbd32('0x4'));var rp=require(_0xbd32('0x5'));var fs=require('fs');var path=require(_0xbd32('0x6'));var rimraf=require('rimraf');var config=require(_0xbd32('0x7'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x225d40,_0x3a1f7c){return _0x225d40[_0xbd32('0x8')]('UserVoiceQueue',attributes,{'tableName':_0xbd32('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e39=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x506cfa,_0x2e301){var _0x23c230=function(_0x271e21){while(--_0x271e21){_0x506cfa['push'](_0x506cfa['shift']());}};_0x23c230(++_0x2e301);}(_0x5e39,0xad));var _0x95e3=function(_0x56bac5,_0x62439b){_0x56bac5=_0x56bac5-0x0;var _0x55a104=_0x5e39[_0x56bac5];return _0x55a104;};'use strict';var _=require(_0x95e3('0x0'));var util=require(_0x95e3('0x1'));var logger=require(_0x95e3('0x2'))(_0x95e3('0x3'));var moment=require(_0x95e3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95e3('0x5'));var rimraf=require(_0x95e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x95e3('0x7'));module[_0x95e3('0x8')]=function(_0x3e57ec,_0x4c5f64){return _0x3e57ec[_0x95e3('0x9')](_0x95e3('0xa'),attributes,{'tableName':_0x95e3('0xb'),'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 c482434..5e9aa1e 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 _0xef42=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x470324,_0x1d7cee){var _0x2e0cb3=function(_0x5eae93){while(--_0x5eae93){_0x470324['push'](_0x470324['shift']());}};_0x2e0cb3(++_0x1d7cee);}(_0xef42,0x6b));var _0x2ef4=function(_0xe9e8f9,_0xa250b8){_0xe9e8f9=_0xe9e8f9-0x0;var _0x28768e=_0xef42[_0xe9e8f9];return _0x28768e;};'use strict';var _=require(_0x2ef4('0x0'));var util=require('util');var moment=require(_0x2ef4('0x1'));var BPromise=require(_0x2ef4('0x2'));var rs=require(_0x2ef4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ef4('0x4'))['db'];var utils=require(_0x2ef4('0x5'));var logger=require(_0x2ef4('0x6'))(_0x2ef4('0x7'));var config=require(_0x2ef4('0x8'));var jayson=require(_0x2ef4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x179a40,_0x740270,_0x243d8c){return new BPromise(function(_0x157494,_0xf65025){return client[_0x2ef4('0xa')](_0x179a40,_0x243d8c)[_0x2ef4('0xb')](function(_0x173843){logger[_0x2ef4('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x740270,'request\x20sent');logger[_0x2ef4('0xd')](_0x2ef4('0xe'),_0x740270,_0x2ef4('0xf'),JSON['stringify'](_0x173843));if(_0x173843[_0x2ef4('0x10')]){if(_0x173843['error'][_0x2ef4('0x11')]===0x1f4){logger[_0x2ef4('0x10')](_0x2ef4('0x12'),_0x740270,_0x173843['error']['message']);return _0xf65025(_0x173843[_0x2ef4('0x10')][_0x2ef4('0x13')]);}logger[_0x2ef4('0x10')](_0x2ef4('0x12'),_0x740270,_0x173843[_0x2ef4('0x10')][_0x2ef4('0x13')]);return _0x157494(_0x173843[_0x2ef4('0x10')]['message']);}else{logger[_0x2ef4('0xc')](_0x2ef4('0x12'),_0x740270,'request\x20sent');_0x157494(_0x173843[_0x2ef4('0x14')][_0x2ef4('0x13')]);}})[_0x2ef4('0x15')](function(_0x5c55c6){logger['error'](_0x2ef4('0x12'),_0x740270,_0x5c55c6);_0xf65025(_0x5c55c6);});});} \ No newline at end of file +var _0x989a=['stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4f5de4,_0x286cb4){var _0x57b780=function(_0x489554){while(--_0x489554){_0x4f5de4['push'](_0x4f5de4['shift']());}};_0x57b780(++_0x286cb4);}(_0x989a,0x17c));var _0xa989=function(_0x121839,_0x35e637){_0x121839=_0x121839-0x0;var _0x20bcb2=_0x989a[_0x121839];return _0x20bcb2;};'use strict';var _=require(_0xa989('0x0'));var util=require(_0xa989('0x1'));var moment=require('moment');var BPromise=require(_0xa989('0x2'));var rs=require(_0xa989('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa989('0x4'))['db'];var utils=require(_0xa989('0x5'));var logger=require(_0xa989('0x6'))('rpc');var config=require(_0xa989('0x7'));var jayson=require(_0xa989('0x8'));var client=jayson['client'][_0xa989('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4183f9,_0x40875b,_0x4b04a4){return new BPromise(function(_0x570ca4,_0x3e9500){return client[_0xa989('0xa')](_0x4183f9,_0x4b04a4)[_0xa989('0xb')](function(_0x4a9d99){logger[_0xa989('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x40875b,_0xa989('0xd'));logger[_0xa989('0xe')](_0xa989('0xf'),_0x40875b,_0xa989('0xd'),JSON[_0xa989('0x10')](_0x4a9d99));if(_0x4a9d99[_0xa989('0x11')]){if(_0x4a9d99[_0xa989('0x11')][_0xa989('0x12')]===0x1f4){logger[_0xa989('0x11')](_0xa989('0x13'),_0x40875b,_0x4a9d99['error'][_0xa989('0x14')]);return _0x3e9500(_0x4a9d99[_0xa989('0x11')][_0xa989('0x14')]);}logger[_0xa989('0x11')](_0xa989('0x13'),_0x40875b,_0x4a9d99[_0xa989('0x11')][_0xa989('0x14')]);return _0x570ca4(_0x4a9d99['error'][_0xa989('0x14')]);}else{logger[_0xa989('0xc')](_0xa989('0x13'),_0x40875b,_0xa989('0xd'));_0x570ca4(_0x4a9d99[_0xa989('0x15')]['message']);}})['catch'](function(_0x127dce){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x40875b,_0x127dce);_0x3e9500(_0x127dce);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 5f79251..cf8d976 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x161e77,_0x25be3f){var _0x38c062=function(_0x2b8fff){while(--_0x2b8fff){_0x161e77['push'](_0x161e77['shift']());}};_0x38c062(++_0x25be3f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x12e747,_0x33ab29){var _0x54adb6=function(_0x2ac204){while(--_0x2ac204){_0x12e747['push'](_0x12e747['shift']());}};_0x54adb6(++_0x33ab29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index b0ad16d..1d00ff5 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 _0xe93b=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x50277d,_0x16450c){var _0x566d69=function(_0x28b44c){while(--_0x28b44c){_0x50277d['push'](_0x50277d['shift']());}};_0x566d69(++_0x16450c);}(_0xe93b,0xb9));var _0xbe93=function(_0x31d581,_0x2aad7b){_0x31d581=_0x31d581-0x0;var _0x445150=_0xe93b[_0x31d581];return _0x445150;};'use strict';var Sequelize=require(_0xbe93('0x0'));module[_0xbe93('0x1')]={'uniqueid':{'type':Sequelize[_0xbe93('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xbe93('0x3')],'allowNull':![],'comment':_0xbe93('0x4')},'UserId':{'type':Sequelize[_0xbe93('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbe93('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xbe93('0x4')},'VoiceQueueId':{'type':Sequelize[_0xbe93('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xbe93('0x3')],'allowNull':![],'unique':_0xbe93('0x5'),'comment':_0xbe93('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xbe93('0x4')},'paused':{'type':Sequelize[_0xbe93('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x68cf=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x4f0a22,_0x508918){var _0x5b1b67=function(_0x3158d6){while(--_0x3158d6){_0x4f0a22['push'](_0x4f0a22['shift']());}};_0x5b1b67(++_0x508918);}(_0x68cf,0xe9));var _0xf68c=function(_0x3a99ab,_0x4d2c62){_0x3a99ab=_0x3a99ab-0x0;var _0x566b14=_0x68cf[_0x3a99ab];return _0x566b14;};'use strict';var Sequelize=require(_0xf68c('0x0'));module[_0xf68c('0x1')]={'uniqueid':{'type':Sequelize[_0xf68c('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf68c('0x3')},'membername':{'type':Sequelize[_0xf68c('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xf68c('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf68c('0x4')],'allowNull':![],'unique':_0xf68c('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xf68c('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xf68c('0x4')],'allowNull':![],'unique':_0xf68c('0x5'),'comment':_0xf68c('0x3')},'penalty':{'type':Sequelize[_0xf68c('0x2')](0xb),'defaultValue':0x0,'comment':_0xf68c('0x3')},'paused':{'type':Sequelize[_0xf68c('0x2')](0xb),'defaultValue':0x0,'comment':_0xf68c('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index b5df2d9..34953c0 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 _0xcd00=['emit','hasOwnProperty','events','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x589589,_0x484d80){var _0x1ae411=function(_0x193408){while(--_0x193408){_0x589589['push'](_0x589589['shift']());}};_0x1ae411(++_0x484d80);}(_0xcd00,0x102));var _0x0cd0=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcd00[_0x4a747d];return _0x3a5b5c;};'use strict';var EventEmitter=require(_0x0cd0('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x0cd0('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0cd0('0x2')](0x0);var events={'afterCreate':_0x0cd0('0x3'),'afterUpdate':_0x0cd0('0x4'),'afterDestroy':_0x0cd0('0x5')};function emitEvent(_0x3ac62e){return function(_0x5dc6f9,_0x377b21,_0x2af3f6){UserVoiceQueueRtEvents[_0x0cd0('0x6')](_0x3ac62e+':'+_0x5dc6f9['id'],_0x5dc6f9);UserVoiceQueueRtEvents[_0x0cd0('0x6')](_0x3ac62e,_0x5dc6f9);_0x2af3f6(null);};}for(var e in events){if(events[_0x0cd0('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x2768=['UserVoiceQueueRt','setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x42cbb0,_0x482573){var _0xa759ad=function(_0x58405){while(--_0x58405){_0x42cbb0['push'](_0x42cbb0['shift']());}};_0xa759ad(++_0x482573);}(_0x2768,0x86));var _0x8276=function(_0x33d558,_0x4d2bb5){_0x33d558=_0x33d558-0x0;var _0xba5a67=_0x2768[_0x33d558];return _0xba5a67;};'use strict';var EventEmitter=require(_0x8276('0x0'));var UserVoiceQueueRt=require(_0x8276('0x1'))['db'][_0x8276('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8276('0x3')](0x0);var events={'afterCreate':_0x8276('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c1517){return function(_0xf344a0,_0x1bf8e3,_0x32886b){UserVoiceQueueRtEvents[_0x8276('0x5')](_0x5c1517+':'+_0xf344a0['id'],_0xf344a0);UserVoiceQueueRtEvents[_0x8276('0x5')](_0x5c1517,_0xf344a0);_0x32886b(null);};}for(var e in events){if(events[_0x8276('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x8276('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 e858733..b89500f 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 _0xf871=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf871,0x127));var _0x1f87=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0xf871[_0xd21fe7];return _0x14d570;};'use strict';var _=require(_0x1f87('0x0'));var util=require(_0x1f87('0x1'));var logger=require(_0x1f87('0x2'))(_0x1f87('0x3'));var moment=require(_0x1f87('0x4'));var BPromise=require(_0x1f87('0x5'));var rp=require(_0x1f87('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f87('0x7'));var config=require(_0x1f87('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x1f87('0x9')]=function(_0x5488cc,_0x2bd89a){return _0x5488cc[_0x1f87('0xa')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bd2=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0x5bd2,0x13a));var _0x25bd=function(_0x38e692,_0x4d731e){_0x38e692=_0x38e692-0x0;var _0x38814a=_0x5bd2[_0x38e692];return _0x38814a;};'use strict';var _=require(_0x25bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x25bd('0x1'));var moment=require(_0x25bd('0x2'));var BPromise=require(_0x25bd('0x3'));var rp=require(_0x25bd('0x4'));var fs=require('fs');var path=require(_0x25bd('0x5'));var rimraf=require('rimraf');var config=require(_0x25bd('0x6'));var attributes=require(_0x25bd('0x7'));module[_0x25bd('0x8')]=function(_0x394f2c,_0x24d3cf){return _0x394f2c[_0x25bd('0x9')](_0x25bd('0xa'),attributes,{'tableName':_0x25bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 7b12d96..43e7f74 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 _0x2a90=['message','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x472a45,_0x10a8e6){var _0x2ce778=function(_0x58515d){while(--_0x58515d){_0x472a45['push'](_0x472a45['shift']());}};_0x2ce778(++_0x10a8e6);}(_0x2a90,0x174));var _0x02a9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2a90[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x02a9('0x0'));var util=require(_0x02a9('0x1'));var moment=require(_0x02a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x02a9('0x3'));var fs=require('fs');var Redis=require(_0x02a9('0x4'));var db=require(_0x02a9('0x5'))['db'];var utils=require(_0x02a9('0x6'));var logger=require('../../config/logger')(_0x02a9('0x7'));var config=require('../../config/environment');var jayson=require(_0x02a9('0x8'));var client=jayson[_0x02a9('0x9')][_0x02a9('0xa')]({'port':0x232a});config[_0x02a9('0xb')]=_['defaults'](config[_0x02a9('0xb')],{'host':_0x02a9('0xc'),'port':0x18eb});var socket=require(_0x02a9('0xd'))(new Redis(config[_0x02a9('0xb')]));require(_0x02a9('0xe'))[_0x02a9('0xf')](socket);function respondWithRpcPromise(_0x1dcf39,_0x28e4fc,_0x3ed46a){return new BPromise(function(_0x467c2c,_0x448353){return client['request'](_0x1dcf39,_0x3ed46a)[_0x02a9('0x10')](function(_0x35a146){logger[_0x02a9('0x11')](_0x02a9('0x12'),_0x28e4fc,'request\x20sent');logger[_0x02a9('0x13')](_0x02a9('0x14'),_0x28e4fc,'request\x20sent',JSON[_0x02a9('0x15')](_0x35a146));if(_0x35a146[_0x02a9('0x16')]){if(_0x35a146[_0x02a9('0x16')][_0x02a9('0x17')]===0x1f4){logger[_0x02a9('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x28e4fc,_0x35a146['error'][_0x02a9('0x18')]);return _0x448353(_0x35a146[_0x02a9('0x16')][_0x02a9('0x18')]);}logger[_0x02a9('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x28e4fc,_0x35a146[_0x02a9('0x16')]['message']);return _0x467c2c(_0x35a146[_0x02a9('0x16')][_0x02a9('0x18')]);}else{logger[_0x02a9('0x11')](_0x02a9('0x12'),_0x28e4fc,'request\x20sent');_0x467c2c(_0x35a146['result'][_0x02a9('0x18')]);}})[_0x02a9('0x19')](function(_0x12f499){logger[_0x02a9('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x28e4fc,_0x12f499);_0x448353(_0x12f499);});});}exports['GetVoiceQueueRtPauses']=function(_0x313246){var _0xa543bf=this;return new Promise(function(_0x3be772,_0x329f51){return db[_0x02a9('0x1a')][_0x02a9('0x1b')]({'raw':_0x313246[_0x02a9('0x1c')]?_0x313246[_0x02a9('0x1c')][_0x02a9('0x1d')]===undefined?!![]:![]:!![],'where':_0x313246[_0x02a9('0x1c')]?_0x313246['options'][_0x02a9('0x1e')]||null:null,'attributes':[[db[_0x02a9('0x1f')]['fn'](_0x02a9('0x20'),db[_0x02a9('0x1f')]['fn']('IF',db[_0x02a9('0x1f')][_0x02a9('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0x02a9('0x22')]]})[_0x02a9('0x10')](function(_0xac5a9f){logger[_0x02a9('0x11')](_0x02a9('0x23'),_0x313246);logger[_0x02a9('0x13')](_0x02a9('0x23'),_0x313246,JSON[_0x02a9('0x15')](_0xac5a9f));_0x3be772(_0xac5a9f);})[_0x02a9('0x19')](function(_0x1f61c8){logger[_0x02a9('0x16')](_0x02a9('0x23'),_0x1f61c8[_0x02a9('0x18')],_0x313246);_0x329f51(_0xa543bf[_0x02a9('0x16')](0x1f4,_0x1f61c8['message']));});});}; \ No newline at end of file +var _0xaa13=['findAll','options','where','COUNT','sequelize','literal','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt'];(function(_0x5ac154,_0x22df44){var _0x49aa5c=function(_0x17f247){while(--_0x17f247){_0x5ac154['push'](_0x5ac154['shift']());}};_0x49aa5c(++_0x22df44);}(_0xaa13,0x1e7));var _0x3aa1=function(_0x1c5eb8,_0x24b433){_0x1c5eb8=_0x1c5eb8-0x0;var _0x1d1f94=_0xaa13[_0x1c5eb8];return _0x1d1f94;};'use strict';var _=require(_0x3aa1('0x0'));var util=require(_0x3aa1('0x1'));var moment=require(_0x3aa1('0x2'));var BPromise=require(_0x3aa1('0x3'));var rs=require(_0x3aa1('0x4'));var fs=require('fs');var Redis=require(_0x3aa1('0x5'));var db=require(_0x3aa1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3aa1('0x7'))(_0x3aa1('0x8'));var config=require(_0x3aa1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3aa1('0xa')][_0x3aa1('0xb')]({'port':0x232a});config[_0x3aa1('0xc')]=_[_0x3aa1('0xd')](config[_0x3aa1('0xc')],{'host':_0x3aa1('0xe'),'port':0x18eb});var socket=require(_0x3aa1('0xf'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x3aa1('0x10')](socket);function respondWithRpcPromise(_0x2df894,_0x1895ca,_0x441d0e){return new BPromise(function(_0x413c35,_0x58cbb0){return client[_0x3aa1('0x11')](_0x2df894,_0x441d0e)[_0x3aa1('0x12')](function(_0x4fa557){logger[_0x3aa1('0x13')](_0x3aa1('0x14'),_0x1895ca,_0x3aa1('0x15'));logger[_0x3aa1('0x16')](_0x3aa1('0x17'),_0x1895ca,_0x3aa1('0x15'),JSON[_0x3aa1('0x18')](_0x4fa557));if(_0x4fa557[_0x3aa1('0x19')]){if(_0x4fa557[_0x3aa1('0x19')][_0x3aa1('0x1a')]===0x1f4){logger[_0x3aa1('0x19')](_0x3aa1('0x14'),_0x1895ca,_0x4fa557[_0x3aa1('0x19')]['message']);return _0x58cbb0(_0x4fa557[_0x3aa1('0x19')]['message']);}logger[_0x3aa1('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1895ca,_0x4fa557[_0x3aa1('0x19')][_0x3aa1('0x1b')]);return _0x413c35(_0x4fa557[_0x3aa1('0x19')][_0x3aa1('0x1b')]);}else{logger['info'](_0x3aa1('0x14'),_0x1895ca,_0x3aa1('0x15'));_0x413c35(_0x4fa557['result'][_0x3aa1('0x1b')]);}})[_0x3aa1('0x1c')](function(_0x3de910){logger[_0x3aa1('0x19')](_0x3aa1('0x14'),_0x1895ca,_0x3de910);_0x58cbb0(_0x3de910);});});}exports[_0x3aa1('0x1d')]=function(_0x5186f4){var _0x44d8c0=this;return new Promise(function(_0x585eb8,_0x350293){return db[_0x3aa1('0x1e')][_0x3aa1('0x1f')]({'raw':_0x5186f4[_0x3aa1('0x20')]?_0x5186f4['options']['raw']===undefined?!![]:![]:!![],'where':_0x5186f4[_0x3aa1('0x20')]?_0x5186f4[_0x3aa1('0x20')][_0x3aa1('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0x3aa1('0x22'),db[_0x3aa1('0x23')]['fn']('IF',db[_0x3aa1('0x23')][_0x3aa1('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})['then'](function(_0x4313df){logger['info'](_0x3aa1('0x1d'),_0x5186f4);logger[_0x3aa1('0x16')]('GetVoiceQueueRtPauses',_0x5186f4,JSON[_0x3aa1('0x18')](_0x4313df));_0x585eb8(_0x4313df);})['catch'](function(_0x514fa5){logger[_0x3aa1('0x19')](_0x3aa1('0x1d'),_0x514fa5[_0x3aa1('0x1b')],_0x5186f4);_0x350293(_0x44d8c0[_0x3aa1('0x19')](0x1f4,_0x514fa5[_0x3aa1('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index ed2cacf..f86e08c 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 _0x8a8b=['update','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x555092,_0x3091cb){var _0x413167=function(_0x1bd895){while(--_0x1bd895){_0x555092['push'](_0x555092['shift']());}};_0x413167(++_0x3091cb);}(_0x8a8b,0xae));var _0xb8a8=function(_0x406d1e,_0x2a5c57){_0x406d1e=_0x406d1e-0x0;var _0x4a7d27=_0x8a8b[_0x406d1e];return _0x4a7d27;};'use strict';var UserVoiceQueueRtEvents=require(_0xb8a8('0x0'));var events=['save','remove',_0xb8a8('0x1')];function createListener(_0x308da3,_0x4f56d4){return function(_0x13bc8b){_0x4f56d4['emit'](_0x308da3,_0x13bc8b);};}function removeListener(_0xca9854,_0x4fe301){return function(){UserVoiceQueueRtEvents[_0xb8a8('0x2')](_0xca9854,_0x4fe301);};}exports[_0xb8a8('0x3')]=function(_0xcca5ca){for(var _0x578e1b=0x0,_0x37e48d=events['length'];_0x578e1b<_0x37e48d;_0x578e1b++){var _0x32d542=events[_0x578e1b];var _0x4c46e9=createListener(_0xb8a8('0x4')+_0x32d542,_0xcca5ca);UserVoiceQueueRtEvents['on'](_0x32d542,_0x4c46e9);}}; \ No newline at end of file +var _0x6afc=['emit','removeListener','length','./userVoiceQueueRt.events','remove'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x6afc,0x16b));var _0xc6af=function(_0x5b2ecb,_0x23eeab){_0x5b2ecb=_0x5b2ecb-0x0;var _0x49e400=_0x6afc[_0x5b2ecb];return _0x49e400;};'use strict';var UserVoiceQueueRtEvents=require(_0xc6af('0x0'));var events=['save',_0xc6af('0x1'),'update'];function createListener(_0xa0489d,_0x2e6221){return function(_0x4ffb7c){_0x2e6221[_0xc6af('0x2')](_0xa0489d,_0x4ffb7c);};}function removeListener(_0x120eef,_0x1a8492){return function(){UserVoiceQueueRtEvents[_0xc6af('0x3')](_0x120eef,_0x1a8492);};}exports['register']=function(_0x3beacd){for(var _0x2bca8e=0x0,_0x3c0485=events[_0xc6af('0x4')];_0x2bca8e<_0x3c0485;_0x2bca8e++){var _0x3bfb71=events[_0x2bca8e];var _0x117df9=createListener('userVoiceQueueRt:'+_0x3bfb71,_0x3beacd);UserVoiceQueueRtEvents['on'](_0x3bfb71,_0x117df9);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 1890cd4..2495127 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2c5b74,_0x4c257e){var _0x85806c=function(_0x5478fd){while(--_0x5478fd){_0x2c5b74['push'](_0x2c5b74['shift']());}};_0x85806c(++_0x4c257e);}(_0x70e0,0x17b));var _0x070e=function(_0x1469a3,_0x169d74){_0x1469a3=_0x1469a3-0x0;var _0x4e15ed=_0x70e0[_0x1469a3];return _0x4e15ed;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x37e94a,_0x3b90e7){var _0x241dc8=function(_0xdb024e){while(--_0xdb024e){_0x37e94a['push'](_0x37e94a['shift']());}};_0x241dc8(++_0x3b90e7);}(_0x70e0,0x17b));var _0x070e=function(_0x5ef2f4,_0x106e6d){_0x5ef2f4=_0x5ef2f4-0x0;var _0x3d302b=_0x70e0[_0x5ef2f4];return _0x3d302b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 08da3f7..23ae764 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 _0xb871=['INTEGER','exports'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xb871,0x6b));var _0x1b87=function(_0x17144e,_0x54b854){_0x17144e=_0x17144e-0x0;var _0x393e3e=_0xb871[_0x17144e];return _0x393e3e;};'use strict';var Sequelize=require('sequelize');module[_0x1b87('0x0')]={'penalty':{'type':Sequelize[_0x1b87('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc196=['INTEGER','sequelize','exports'];(function(_0x3a9d79,_0x12852f){var _0x5adf19=function(_0x45b569){while(--_0x45b569){_0x3a9d79['push'](_0x3a9d79['shift']());}};_0x5adf19(++_0x12852f);}(_0xc196,0x15d));var _0x6c19=function(_0xf37a89,_0x509bd2){_0xf37a89=_0xf37a89-0x0;var _0x3034cf=_0xc196[_0xf37a89];return _0x3034cf;};'use strict';var Sequelize=require(_0x6c19('0x0'));module[_0x6c19('0x1')]={'penalty':{'type':Sequelize[_0x6c19('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 9598a71..ec200e0 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 _0x079e=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x079e,0x14c));var _0xe079=function(_0x276d10,_0x435d5f){_0x276d10=_0x276d10-0x0;var _0x56f291=_0x079e[_0x276d10];return _0x56f291;};'use strict';var _=require(_0xe079('0x0'));var util=require('util');var logger=require(_0xe079('0x1'))(_0xe079('0x2'));var moment=require(_0xe079('0x3'));var BPromise=require(_0xe079('0x4'));var rp=require(_0xe079('0x5'));var fs=require('fs');var path=require(_0xe079('0x6'));var rimraf=require('rimraf');var config=require(_0xe079('0x7'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x38cd13,_0x24df35){return _0x38cd13[_0xe079('0x8')](_0xe079('0x9'),attributes,{'tableName':_0xe079('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0813=['util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','UserWhatsappQueue'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0813,0x87));var _0x3081=function(_0x58e5a6,_0x364aee){_0x58e5a6=_0x58e5a6-0x0;var _0x4c65ff=_0x0813[_0x58e5a6];return _0x4c65ff;};'use strict';var _=require('lodash');var util=require(_0x3081('0x0'));var logger=require(_0x3081('0x1'))(_0x3081('0x2'));var moment=require('moment');var BPromise=require(_0x3081('0x3'));var rp=require(_0x3081('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3081('0x5'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x3081('0x6')]=function(_0x327d06,_0x546001){return _0x327d06[_0x3081('0x7')](_0x3081('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','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 e1b69c7..004c360 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 _0x2aec=['UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2aec,0x19a));var _0xc2ae=function(_0x5892cf,_0x395561){_0x5892cf=_0x5892cf-0x0;var _0x350f8e=_0x2aec[_0x5892cf];return _0x350f8e;};'use strict';var _=require(_0xc2ae('0x0'));var util=require(_0xc2ae('0x1'));var moment=require(_0xc2ae('0x2'));var BPromise=require(_0xc2ae('0x3'));var rs=require(_0xc2ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2ae('0x5'))['db'];var utils=require(_0xc2ae('0x6'));var logger=require(_0xc2ae('0x7'))(_0xc2ae('0x8'));var config=require(_0xc2ae('0x9'));var jayson=require(_0xc2ae('0xa'));var client=jayson['client'][_0xc2ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x221ace,_0x2fc3a1,_0x54519a){return new BPromise(function(_0x50291a,_0x37fd05){return client[_0xc2ae('0xc')](_0x221ace,_0x54519a)[_0xc2ae('0xd')](function(_0x8927c){logger[_0xc2ae('0xe')](_0xc2ae('0xf'),_0x2fc3a1,'request\x20sent');logger[_0xc2ae('0x10')](_0xc2ae('0x11'),_0x2fc3a1,'request\x20sent',JSON[_0xc2ae('0x12')](_0x8927c));if(_0x8927c['error']){if(_0x8927c[_0xc2ae('0x13')][_0xc2ae('0x14')]===0x1f4){logger['error'](_0xc2ae('0xf'),_0x2fc3a1,_0x8927c[_0xc2ae('0x13')][_0xc2ae('0x15')]);return _0x37fd05(_0x8927c[_0xc2ae('0x13')][_0xc2ae('0x15')]);}logger['error'](_0xc2ae('0xf'),_0x2fc3a1,_0x8927c[_0xc2ae('0x13')][_0xc2ae('0x15')]);return _0x50291a(_0x8927c[_0xc2ae('0x13')][_0xc2ae('0x15')]);}else{logger[_0xc2ae('0xe')](_0xc2ae('0xf'),_0x2fc3a1,_0xc2ae('0x16'));_0x50291a(_0x8927c[_0xc2ae('0x17')][_0xc2ae('0x15')]);}})[_0xc2ae('0x18')](function(_0x252469){logger['error'](_0xc2ae('0xf'),_0x2fc3a1,_0x252469);_0x37fd05(_0x252469);});});} \ No newline at end of file +var _0x4437=['UserWhatsappQueue,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/environment','client','http','then'];(function(_0x4e0026,_0x2b52b6){var _0x3f8ee7=function(_0x31d891){while(--_0x31d891){_0x4e0026['push'](_0x4e0026['shift']());}};_0x3f8ee7(++_0x2b52b6);}(_0x4437,0x13b));var _0x7443=function(_0x252baf,_0x8162a1){_0x252baf=_0x252baf-0x0;var _0x549108=_0x4437[_0x252baf];return _0x549108;};'use strict';var _=require(_0x7443('0x0'));var util=require(_0x7443('0x1'));var moment=require(_0x7443('0x2'));var BPromise=require('bluebird');var rs=require(_0x7443('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7443('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7443('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7443('0x6')][_0x7443('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f25eb,_0x288ba5,_0x4d08f9){return new BPromise(function(_0x3ef7ad,_0x9eafee){return client['request'](_0x4f25eb,_0x4d08f9)[_0x7443('0x8')](function(_0x324b43){logger['info'](_0x7443('0x9'),_0x288ba5,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x288ba5,'request\x20sent',JSON[_0x7443('0xa')](_0x324b43));if(_0x324b43[_0x7443('0xb')]){if(_0x324b43[_0x7443('0xb')][_0x7443('0xc')]===0x1f4){logger[_0x7443('0xb')](_0x7443('0x9'),_0x288ba5,_0x324b43['error'][_0x7443('0xd')]);return _0x9eafee(_0x324b43[_0x7443('0xb')]['message']);}logger['error'](_0x7443('0x9'),_0x288ba5,_0x324b43[_0x7443('0xb')][_0x7443('0xd')]);return _0x3ef7ad(_0x324b43[_0x7443('0xb')][_0x7443('0xd')]);}else{logger[_0x7443('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x288ba5,_0x7443('0xf'));_0x3ef7ad(_0x324b43[_0x7443('0x10')]['message']);}})[_0x7443('0x11')](function(_0x2bbdfd){logger[_0x7443('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x288ba5,_0x2bbdfd);_0x9eafee(_0x2bbdfd);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index cde5a14..3b3d2cd 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 _0x616c=['/:id','post','put','destroy','util','path','express','Router','fs-extra','../../components/auth/service','./variable.controller','get','isAuthenticated','index'];(function(_0x4ddfe9,_0x11daa8){var _0xb09fb7=function(_0x78002){while(--_0x78002){_0x4ddfe9['push'](_0x4ddfe9['shift']());}};_0xb09fb7(++_0x11daa8);}(_0x616c,0x1b6));var _0xc616=function(_0x5006e6,_0x2a688c){_0x5006e6=_0x5006e6-0x0;var _0x41a386=_0x616c[_0x5006e6];return _0x41a386;};'use strict';var multer=require('multer');var util=require(_0xc616('0x0'));var path=require(_0xc616('0x1'));var timeout=require('connect-timeout');var express=require(_0xc616('0x2'));var router=express[_0xc616('0x3')]();var fs_extra=require(_0xc616('0x4'));var auth=require(_0xc616('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc616('0x6'));router[_0xc616('0x7')]('/',auth[_0xc616('0x8')](),controller[_0xc616('0x9')]);router[_0xc616('0x7')](_0xc616('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc616('0xb')]('/',auth[_0xc616('0x8')](),controller['create']);router[_0xc616('0xc')]('/:id',auth[_0xc616('0x8')](),controller['update']);router['delete'](_0xc616('0xa'),auth[_0xc616('0x8')](),controller[_0xc616('0xd')]);module['exports']=router; \ No newline at end of file +var _0x3c6d=['./variable.controller','isAuthenticated','index','get','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3c6d,0x199));var _0xd3c6=function(_0x21abd1,_0x261e35){_0x21abd1=_0x21abd1-0x0;var _0x531ce8=_0x3c6d[_0x21abd1];return _0x531ce8;};'use strict';var multer=require(_0xd3c6('0x0'));var util=require(_0xd3c6('0x1'));var path=require(_0xd3c6('0x2'));var timeout=require(_0xd3c6('0x3'));var express=require('express');var router=express[_0xd3c6('0x4')]();var fs_extra=require(_0xd3c6('0x5'));var auth=require(_0xd3c6('0x6'));var interaction=require(_0xd3c6('0x7'));var config=require(_0xd3c6('0x8'));var controller=require(_0xd3c6('0x9'));router['get']('/',auth[_0xd3c6('0xa')](),controller[_0xd3c6('0xb')]);router[_0xd3c6('0xc')](_0xd3c6('0xd'),auth[_0xd3c6('0xa')](),controller[_0xd3c6('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd3c6('0xf')]);router[_0xd3c6('0x10')](_0xd3c6('0xd'),auth['isAuthenticated'](),controller[_0xd3c6('0x11')]);router['delete'](_0xd3c6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd3c6('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index fde882d..a3e31c1 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 _0x8c32=['name','sequelize','exports','STRING'];(function(_0x2d6bc6,_0x270079){var _0xde4bf8=function(_0x49b306){while(--_0x49b306){_0x2d6bc6['push'](_0x2d6bc6['shift']());}};_0xde4bf8(++_0x270079);}(_0x8c32,0x89));var _0x28c3=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x8c32[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x28c3('0x0'));module[_0x28c3('0x1')]={'name':{'type':Sequelize[_0x28c3('0x2')],'unique':_0x28c3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x98d4=['name','STRING','sequelize','exports'];(function(_0x1f6c33,_0x29070c){var _0x1d0392=function(_0x5e7221){while(--_0x5e7221){_0x1f6c33['push'](_0x1f6c33['shift']());}};_0x1d0392(++_0x29070c);}(_0x98d4,0xf6));var _0x498d=function(_0x126905,_0x28e1ae){_0x126905=_0x126905-0x0;var _0x475a87=_0x98d4[_0x126905];return _0x475a87;};'use strict';var Sequelize=require(_0x498d('0x0'));module[_0x498d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x498d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x498d('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index b2b28e6..3d3a50e 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 _0x150b=['autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','destroy','then','get','Variables','UserProfileResource','name','index','map','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Variable','include','findAll','rows','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId'];(function(_0x414fe5,_0x3bb42f){var _0x3def13=function(_0xcada20){while(--_0xcada20){_0x414fe5['push'](_0x414fe5['shift']());}};_0x3def13(++_0x3bb42f);}(_0x150b,0xa4));var _0xb150=function(_0x29fa3d,_0x45d24f){_0x29fa3d=_0x29fa3d-0x0;var _0x5d4bbf=_0x150b[_0x29fa3d];return _0x5d4bbf;};'use strict';var emlformat=require(_0xb150('0x0'));var rimraf=require(_0xb150('0x1'));var zipdir=require(_0xb150('0x2'));var jsonpatch=require(_0xb150('0x3'));var rp=require('request-promise');var moment=require(_0xb150('0x4'));var BPromise=require(_0xb150('0x5'));var Mustache=require(_0xb150('0x6'));var util=require(_0xb150('0x7'));var path=require(_0xb150('0x8'));var sox=require('sox');var csv=require(_0xb150('0x9'));var ejs=require(_0xb150('0xa'));var fs=require('fs');var fs_extra=require(_0xb150('0xb'));var _=require(_0xb150('0xc'));var squel=require(_0xb150('0xd'));var crypto=require(_0xb150('0xe'));var jsforce=require(_0xb150('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb150('0x9'));var querystring=require(_0xb150('0x10'));var Papa=require('papaparse');var Redis=require(_0xb150('0x11'));var authService=require(_0xb150('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb150('0x13'));var hardwareService=require(_0xb150('0x14'));var logger=require(_0xb150('0x15'))('api');var utils=require(_0xb150('0x16'));var config=require(_0xb150('0x17'));var licenseUtil=require(_0xb150('0x18'));var db=require(_0xb150('0x19'))['db'];function respondWithStatusCode(_0x3f65ef,_0x31c2e1){_0x31c2e1=_0x31c2e1||0xcc;return function(_0x4e9344){if(_0x4e9344){return _0x3f65ef[_0xb150('0x1a')](_0x31c2e1);}return _0x3f65ef[_0xb150('0x1b')](_0x31c2e1)[_0xb150('0x1c')]();};}function respondWithResult(_0x19cfb9,_0x349920){_0x349920=_0x349920||0xc8;return function(_0xf629f4){if(_0xf629f4){return _0x19cfb9['status'](_0x349920)[_0xb150('0x1d')](_0xf629f4);}};}function respondWithFilteredResult(_0x426c68,_0x4caa73){return function(_0x469d17){if(_0x469d17){var _0x30fa01=typeof _0x4caa73['offset']==='undefined'&&typeof _0x4caa73['limit']==='undefined';var _0x5556e3=_0x469d17[_0xb150('0x1e')];var _0x2193c9=_0x30fa01?0x0:_0x4caa73[_0xb150('0x1f')];var _0xe00470=_0x30fa01?_0x469d17[_0xb150('0x1e')]:_0x4caa73['offset']+_0x4caa73['limit'];var _0x322ad4;if(_0xe00470>=_0x5556e3){_0xe00470=_0x5556e3;_0x322ad4=0xc8;}else{_0x322ad4=0xce;}_0x426c68[_0xb150('0x1b')](_0x322ad4);return _0x426c68[_0xb150('0x20')](_0xb150('0x21'),_0x2193c9+'-'+_0xe00470+'/'+_0x5556e3)[_0xb150('0x1d')](_0x469d17);}return null;};}function patchUpdates(_0x18688d){return function(_0x14fd48){try{jsonpatch[_0xb150('0x22')](_0x14fd48,_0x18688d,!![]);}catch(_0x5f0bc8){return BPromise['reject'](_0x5f0bc8);}return _0x14fd48['save']();};}function saveUpdates(_0x626cde,_0xa63dc3){return function(_0x5a24d8){if(_0x5a24d8){return _0x5a24d8[_0xb150('0x23')](_0x626cde)['then'](function(_0x1099b5){return _0x1099b5;});}return null;};}function removeEntity(_0x4af4f1,_0x3841e6){return function(_0x8b76c5){if(_0x8b76c5){return _0x8b76c5[_0xb150('0x24')]()[_0xb150('0x25')](function(){var _0x3780a1=_0x8b76c5[_0xb150('0x26')]({'plain':!![]});var _0x25bc74=_0xb150('0x27');return db[_0xb150('0x28')][_0xb150('0x24')]({'where':{'type':_0x25bc74,'resourceId':_0x3780a1['id']}})[_0xb150('0x25')](function(){return _0x8b76c5;});})[_0xb150('0x25')](function(){_0x4af4f1[_0xb150('0x1b')](0xcc)[_0xb150('0x1c')]();});}};}function handleEntityNotFound(_0x313167,_0x19c2ea){return function(_0x2d96f0){if(!_0x2d96f0){_0x313167[_0xb150('0x1a')](0x194);}return _0x2d96f0;};}function handleError(_0x1c20ae,_0x17dfd5){_0x17dfd5=_0x17dfd5||0x1f4;return function(_0x362872){logger['error'](_0x362872['stack']);if(_0x362872[_0xb150('0x29')]){delete _0x362872[_0xb150('0x29')];}_0x1c20ae[_0xb150('0x1b')](_0x17dfd5)['send'](_0x362872);};}exports[_0xb150('0x2a')]=function(_0x17f237,_0x58d023){var _0x4d794c={},_0x3029cd={},_0x54b50e={'count':0x0,'rows':[]};var _0x578f7f=_[_0xb150('0x2b')](db['Variable']['rawAttributes'],function(_0x3ede78){return{'name':_0x3ede78[_0xb150('0x2c')],'type':_0x3ede78[_0xb150('0x2d')]['key']};});_0x3029cd[_0xb150('0x2e')]=_[_0xb150('0x2b')](_0x578f7f,'name');_0x3029cd[_0xb150('0x2f')]=_[_0xb150('0x30')](_0x17f237['query']);_0x3029cd[_0xb150('0x31')]=_[_0xb150('0x32')](_0x3029cd[_0xb150('0x2e')],_0x3029cd[_0xb150('0x2f')]);_0x4d794c['attributes']=_['intersection'](_0x3029cd[_0xb150('0x2e')],qs[_0xb150('0x33')](_0x17f237['query'][_0xb150('0x33')]));_0x4d794c['attributes']=_0x4d794c['attributes'][_0xb150('0x34')]?_0x4d794c[_0xb150('0x35')]:_0x3029cd['model'];if(!_0x17f237['query'][_0xb150('0x36')]('nolimit')){_0x4d794c['limit']=qs[_0xb150('0x37')](_0x17f237[_0xb150('0x2f')][_0xb150('0x37')]);_0x4d794c[_0xb150('0x1f')]=qs[_0xb150('0x1f')](_0x17f237[_0xb150('0x2f')][_0xb150('0x1f')]);}_0x4d794c[_0xb150('0x38')]=qs[_0xb150('0x39')](_0x17f237[_0xb150('0x2f')][_0xb150('0x39')]);_0x4d794c[_0xb150('0x3a')]=qs['filters'](_[_0xb150('0x3b')](_0x17f237[_0xb150('0x2f')],_0x3029cd['filters']),_0x578f7f);if(_0x17f237['query'][_0xb150('0x3c')]){_0x4d794c[_0xb150('0x3a')]=_[_0xb150('0x3d')](_0x4d794c[_0xb150('0x3a')],{'$or':_[_0xb150('0x2b')](_0x578f7f,function(_0x30e879){if(_0x30e879[_0xb150('0x2d')]!==_0xb150('0x3e')){var _0x3d95b8={};_0x3d95b8[_0x30e879['name']]={'$like':'%'+_0x17f237[_0xb150('0x2f')]['filter']+'%'};return _0x3d95b8;}})});}_0x4d794c=_['merge']({},_0x4d794c,_0x17f237[_0xb150('0x3f')]);var _0x5ac460={'where':_0x4d794c['where']};return db[_0xb150('0x40')][_0xb150('0x1e')](_0x5ac460)[_0xb150('0x25')](function(_0x2bbc6b){_0x54b50e[_0xb150('0x1e')]=_0x2bbc6b;if(_0x17f237[_0xb150('0x2f')]['includeAll']){_0x4d794c[_0xb150('0x41')]=[{'all':!![]}];}return db[_0xb150('0x40')][_0xb150('0x42')](_0x4d794c);})['then'](function(_0x511ab2){_0x54b50e[_0xb150('0x43')]=_0x511ab2;return _0x54b50e;})[_0xb150('0x25')](respondWithFilteredResult(_0x58d023,_0x4d794c))['catch'](handleError(_0x58d023,null));};exports['show']=function(_0x100ce1,_0x35a8dc){var _0x43b5f5={'raw':!![],'where':{'id':_0x100ce1['params']['id']}},_0x3513df={};_0x3513df[_0xb150('0x2e')]=_[_0xb150('0x30')](db[_0xb150('0x40')][_0xb150('0x44')]);_0x3513df['query']=_[_0xb150('0x30')](_0x100ce1[_0xb150('0x2f')]);_0x3513df[_0xb150('0x31')]=_['intersection'](_0x3513df[_0xb150('0x2e')],_0x3513df[_0xb150('0x2f')]);_0x43b5f5[_0xb150('0x35')]=_[_0xb150('0x32')](_0x3513df['model'],qs[_0xb150('0x33')](_0x100ce1[_0xb150('0x2f')]['fields']));_0x43b5f5[_0xb150('0x35')]=_0x43b5f5[_0xb150('0x35')][_0xb150('0x34')]?_0x43b5f5[_0xb150('0x35')]:_0x3513df['model'];if(_0x100ce1[_0xb150('0x2f')]['includeAll']){_0x43b5f5[_0xb150('0x41')]=[{'all':!![]}];}_0x43b5f5=_[_0xb150('0x3d')]({},_0x43b5f5,_0x100ce1['options']);return db[_0xb150('0x40')][_0xb150('0x45')](_0x43b5f5)[_0xb150('0x25')](handleEntityNotFound(_0x35a8dc,null))[_0xb150('0x25')](respondWithResult(_0x35a8dc,null))['catch'](handleError(_0x35a8dc,null));};exports[_0xb150('0x46')]=function(_0x5e015c,_0x461123){return db[_0xb150('0x40')][_0xb150('0x46')](_0x5e015c[_0xb150('0x47')],{})[_0xb150('0x25')](function(_0x481505){var _0x2ac6c9=_0x5e015c[_0xb150('0x48')][_0xb150('0x26')]({'plain':!![]});if(!_0x2ac6c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ac6c9[_0xb150('0x49')]===_0xb150('0x48')){var _0x23fe68=_0x481505[_0xb150('0x26')]({'plain':!![]});var _0x3a0c84=_0xb150('0x27');return db[_0xb150('0x4a')][_0xb150('0x45')]({'where':{'name':_0x3a0c84,'userProfileId':_0x2ac6c9[_0xb150('0x4b')]},'raw':!![]})['then'](function(_0x5f52bc){if(_0x5f52bc&&_0x5f52bc[_0xb150('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x23fe68[_0xb150('0x29')],'resourceId':_0x23fe68['id'],'type':_0x5f52bc[_0xb150('0x29')],'sectionId':_0x5f52bc['id']},{})[_0xb150('0x25')](function(){return _0x481505;});}else{return _0x481505;}})[_0xb150('0x4d')](function(_0x5d35ac){logger['error'](_0xb150('0x4e'),_0x5d35ac);throw _0x5d35ac;});}return _0x481505;})['then'](respondWithResult(_0x461123,0xc9))[_0xb150('0x4d')](handleError(_0x461123,null));};exports[_0xb150('0x23')]=function(_0x39423b,_0x5c27a1){if(_0x39423b[_0xb150('0x47')]['id']){delete _0x39423b[_0xb150('0x47')]['id'];}return db[_0xb150('0x40')][_0xb150('0x45')]({'where':{'id':_0x39423b[_0xb150('0x4f')]['id']}})[_0xb150('0x25')](handleEntityNotFound(_0x5c27a1,null))[_0xb150('0x25')](saveUpdates(_0x39423b['body'],null))[_0xb150('0x25')](respondWithResult(_0x5c27a1,null))[_0xb150('0x4d')](handleError(_0x5c27a1,null));};exports[_0xb150('0x24')]=function(_0x275b99,_0x4522ae){return db[_0xb150('0x40')]['find']({'where':{'id':_0x275b99['params']['id']}})['then'](handleEntityNotFound(_0x4522ae,null))[_0xb150('0x25')](removeEntity(_0x4522ae,null))[_0xb150('0x4d')](handleError(_0x4522ae,null));}; \ No newline at end of file +var _0xaa18=['error','stack','name','status','send','index','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','type','VIRTUAL','filter','options','Variable','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','json','offset','limit','undefined','count','set','apply','reject','save','update','then','Variables','end'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0xaa18,0x168));var _0x8aa1=function(_0x23be55,_0x4a5c07){_0x23be55=_0x23be55-0x0;var _0x521eab=_0xaa18[_0x23be55];return _0x521eab;};'use strict';var emlformat=require(_0x8aa1('0x0'));var rimraf=require(_0x8aa1('0x1'));var zipdir=require(_0x8aa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8aa1('0x3'));var Mustache=require(_0x8aa1('0x4'));var util=require(_0x8aa1('0x5'));var path=require(_0x8aa1('0x6'));var sox=require('sox');var csv=require(_0x8aa1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8aa1('0x8'));var squel=require(_0x8aa1('0x9'));var crypto=require('crypto');var jsforce=require(_0x8aa1('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8aa1('0xb'));var Papa=require(_0x8aa1('0xc'));var Redis=require(_0x8aa1('0xd'));var authService=require(_0x8aa1('0xe'));var qs=require(_0x8aa1('0xf'));var as=require(_0x8aa1('0x10'));var hardwareService=require(_0x8aa1('0x11'));var logger=require(_0x8aa1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x8aa1('0x13'));var licenseUtil=require(_0x8aa1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548f8b,_0x5c6b28){_0x5c6b28=_0x5c6b28||0xcc;return function(_0x3fa912){if(_0x3fa912){return _0x548f8b[_0x8aa1('0x15')](_0x5c6b28);}return _0x548f8b['status'](_0x5c6b28)['end']();};}function respondWithResult(_0x5198c8,_0xf8639a){_0xf8639a=_0xf8639a||0xc8;return function(_0x5ea969){if(_0x5ea969){return _0x5198c8['status'](_0xf8639a)[_0x8aa1('0x16')](_0x5ea969);}};}function respondWithFilteredResult(_0x414b79,_0x5581ef){return function(_0x3aa440){if(_0x3aa440){var _0x454fbe=typeof _0x5581ef[_0x8aa1('0x17')]==='undefined'&&typeof _0x5581ef[_0x8aa1('0x18')]===_0x8aa1('0x19');var _0x475ad8=_0x3aa440[_0x8aa1('0x1a')];var _0x40fe5b=_0x454fbe?0x0:_0x5581ef[_0x8aa1('0x17')];var _0x5de947=_0x454fbe?_0x3aa440[_0x8aa1('0x1a')]:_0x5581ef['offset']+_0x5581ef[_0x8aa1('0x18')];var _0x52b08d;if(_0x5de947>=_0x475ad8){_0x5de947=_0x475ad8;_0x52b08d=0xc8;}else{_0x52b08d=0xce;}_0x414b79['status'](_0x52b08d);return _0x414b79[_0x8aa1('0x1b')]('Content-Range',_0x40fe5b+'-'+_0x5de947+'/'+_0x475ad8)[_0x8aa1('0x16')](_0x3aa440);}return null;};}function patchUpdates(_0x290609){return function(_0x3942d5){try{jsonpatch[_0x8aa1('0x1c')](_0x3942d5,_0x290609,!![]);}catch(_0x5c504a){return BPromise[_0x8aa1('0x1d')](_0x5c504a);}return _0x3942d5[_0x8aa1('0x1e')]();};}function saveUpdates(_0x20f396,_0x22fd70){return function(_0x11653d){if(_0x11653d){return _0x11653d[_0x8aa1('0x1f')](_0x20f396)[_0x8aa1('0x20')](function(_0x4489c6){return _0x4489c6;});}return null;};}function removeEntity(_0xb534db,_0x214d93){return function(_0x5968eb){if(_0x5968eb){return _0x5968eb['destroy']()['then'](function(){var _0x364c1f=_0x5968eb['get']({'plain':!![]});var _0x5e8872=_0x8aa1('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x5e8872,'resourceId':_0x364c1f['id']}})['then'](function(){return _0x5968eb;});})[_0x8aa1('0x20')](function(){_0xb534db['status'](0xcc)[_0x8aa1('0x22')]();});}};}function handleEntityNotFound(_0x2c094d,_0x104efb){return function(_0x3cabd1){if(!_0x3cabd1){_0x2c094d[_0x8aa1('0x15')](0x194);}return _0x3cabd1;};}function handleError(_0x40f168,_0x2b15ee){_0x2b15ee=_0x2b15ee||0x1f4;return function(_0x36209e){logger[_0x8aa1('0x23')](_0x36209e[_0x8aa1('0x24')]);if(_0x36209e[_0x8aa1('0x25')]){delete _0x36209e[_0x8aa1('0x25')];}_0x40f168[_0x8aa1('0x26')](_0x2b15ee)[_0x8aa1('0x27')](_0x36209e);};}exports[_0x8aa1('0x28')]=function(_0x2c76b1,_0x4b7400){var _0x5ee1df={},_0x2c6ac3={},_0x4d1a3d={'count':0x0,'rows':[]};var _0x226e7a=_['map'](db['Variable']['rawAttributes'],function(_0x74e68a){return{'name':_0x74e68a['fieldName'],'type':_0x74e68a['type'][_0x8aa1('0x29')]};});_0x2c6ac3[_0x8aa1('0x2a')]=_[_0x8aa1('0x2b')](_0x226e7a,_0x8aa1('0x25'));_0x2c6ac3[_0x8aa1('0x2c')]=_[_0x8aa1('0x2d')](_0x2c76b1[_0x8aa1('0x2c')]);_0x2c6ac3[_0x8aa1('0x2e')]=_[_0x8aa1('0x2f')](_0x2c6ac3[_0x8aa1('0x2a')],_0x2c6ac3[_0x8aa1('0x2c')]);_0x5ee1df[_0x8aa1('0x30')]=_['intersection'](_0x2c6ac3[_0x8aa1('0x2a')],qs[_0x8aa1('0x31')](_0x2c76b1[_0x8aa1('0x2c')][_0x8aa1('0x31')]));_0x5ee1df[_0x8aa1('0x30')]=_0x5ee1df[_0x8aa1('0x30')][_0x8aa1('0x32')]?_0x5ee1df[_0x8aa1('0x30')]:_0x2c6ac3[_0x8aa1('0x2a')];if(!_0x2c76b1[_0x8aa1('0x2c')]['hasOwnProperty'](_0x8aa1('0x33'))){_0x5ee1df[_0x8aa1('0x18')]=qs[_0x8aa1('0x18')](_0x2c76b1[_0x8aa1('0x2c')][_0x8aa1('0x18')]);_0x5ee1df[_0x8aa1('0x17')]=qs['offset'](_0x2c76b1[_0x8aa1('0x2c')][_0x8aa1('0x17')]);}_0x5ee1df[_0x8aa1('0x34')]=qs[_0x8aa1('0x35')](_0x2c76b1[_0x8aa1('0x2c')][_0x8aa1('0x35')]);_0x5ee1df[_0x8aa1('0x36')]=qs[_0x8aa1('0x2e')](_['pick'](_0x2c76b1[_0x8aa1('0x2c')],_0x2c6ac3[_0x8aa1('0x2e')]),_0x226e7a);if(_0x2c76b1['query']['filter']){_0x5ee1df['where']=_['merge'](_0x5ee1df[_0x8aa1('0x36')],{'$or':_[_0x8aa1('0x2b')](_0x226e7a,function(_0x36bc5a){if(_0x36bc5a[_0x8aa1('0x37')]!==_0x8aa1('0x38')){var _0x54c9b9={};_0x54c9b9[_0x36bc5a['name']]={'$like':'%'+_0x2c76b1[_0x8aa1('0x2c')][_0x8aa1('0x39')]+'%'};return _0x54c9b9;}})});}_0x5ee1df=_['merge']({},_0x5ee1df,_0x2c76b1[_0x8aa1('0x3a')]);var _0x2df08a={'where':_0x5ee1df['where']};return db[_0x8aa1('0x3b')][_0x8aa1('0x1a')](_0x2df08a)[_0x8aa1('0x20')](function(_0x6da990){_0x4d1a3d['count']=_0x6da990;if(_0x2c76b1['query'][_0x8aa1('0x3c')]){_0x5ee1df[_0x8aa1('0x3d')]=[{'all':!![]}];}return db['Variable'][_0x8aa1('0x3e')](_0x5ee1df);})[_0x8aa1('0x20')](function(_0x42881f){_0x4d1a3d[_0x8aa1('0x3f')]=_0x42881f;return _0x4d1a3d;})[_0x8aa1('0x20')](respondWithFilteredResult(_0x4b7400,_0x5ee1df))[_0x8aa1('0x40')](handleError(_0x4b7400,null));};exports[_0x8aa1('0x41')]=function(_0x51bb77,_0xabb958){var _0x1429d2={'raw':!![],'where':{'id':_0x51bb77[_0x8aa1('0x42')]['id']}},_0x2be212={};_0x2be212[_0x8aa1('0x2a')]=_[_0x8aa1('0x2d')](db[_0x8aa1('0x3b')][_0x8aa1('0x43')]);_0x2be212[_0x8aa1('0x2c')]=_[_0x8aa1('0x2d')](_0x51bb77[_0x8aa1('0x2c')]);_0x2be212[_0x8aa1('0x2e')]=_[_0x8aa1('0x2f')](_0x2be212[_0x8aa1('0x2a')],_0x2be212[_0x8aa1('0x2c')]);_0x1429d2[_0x8aa1('0x30')]=_[_0x8aa1('0x2f')](_0x2be212[_0x8aa1('0x2a')],qs['fields'](_0x51bb77[_0x8aa1('0x2c')]['fields']));_0x1429d2['attributes']=_0x1429d2['attributes'][_0x8aa1('0x32')]?_0x1429d2[_0x8aa1('0x30')]:_0x2be212[_0x8aa1('0x2a')];if(_0x51bb77['query']['includeAll']){_0x1429d2[_0x8aa1('0x3d')]=[{'all':!![]}];}_0x1429d2=_[_0x8aa1('0x44')]({},_0x1429d2,_0x51bb77[_0x8aa1('0x3a')]);return db[_0x8aa1('0x3b')][_0x8aa1('0x45')](_0x1429d2)['then'](handleEntityNotFound(_0xabb958,null))[_0x8aa1('0x20')](respondWithResult(_0xabb958,null))[_0x8aa1('0x40')](handleError(_0xabb958,null));};exports[_0x8aa1('0x46')]=function(_0x45424c,_0x3dba69){return db[_0x8aa1('0x3b')][_0x8aa1('0x46')](_0x45424c[_0x8aa1('0x47')],{})[_0x8aa1('0x20')](function(_0x2ecb70){var _0x240306=_0x45424c[_0x8aa1('0x48')][_0x8aa1('0x49')]({'plain':!![]});if(!_0x240306)throw new Error(_0x8aa1('0x4a'));if(_0x240306[_0x8aa1('0x4b')]===_0x8aa1('0x48')){var _0x554931=_0x2ecb70['get']({'plain':!![]});var _0x6bdd94=_0x8aa1('0x21');return db[_0x8aa1('0x4c')][_0x8aa1('0x45')]({'where':{'name':_0x6bdd94,'userProfileId':_0x240306['userProfileId']},'raw':!![]})[_0x8aa1('0x20')](function(_0x579870){if(_0x579870&&_0x579870['autoAssociation']===0x0){return db[_0x8aa1('0x4d')][_0x8aa1('0x46')]({'name':_0x554931['name'],'resourceId':_0x554931['id'],'type':_0x579870[_0x8aa1('0x25')],'sectionId':_0x579870['id']},{})['then'](function(){return _0x2ecb70;});}else{return _0x2ecb70;}})[_0x8aa1('0x40')](function(_0x49dfe7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49dfe7);throw _0x49dfe7;});}return _0x2ecb70;})[_0x8aa1('0x20')](respondWithResult(_0x3dba69,0xc9))['catch'](handleError(_0x3dba69,null));};exports[_0x8aa1('0x1f')]=function(_0x24d9b8,_0xf8415d){if(_0x24d9b8[_0x8aa1('0x47')]['id']){delete _0x24d9b8['body']['id'];}return db[_0x8aa1('0x3b')][_0x8aa1('0x45')]({'where':{'id':_0x24d9b8[_0x8aa1('0x42')]['id']}})[_0x8aa1('0x20')](handleEntityNotFound(_0xf8415d,null))[_0x8aa1('0x20')](saveUpdates(_0x24d9b8['body'],null))[_0x8aa1('0x20')](respondWithResult(_0xf8415d,null))['catch'](handleError(_0xf8415d,null));};exports[_0x8aa1('0x4e')]=function(_0x4b3d8d,_0x3890be){return db[_0x8aa1('0x3b')]['find']({'where':{'id':_0x4b3d8d[_0x8aa1('0x42')]['id']}})['then'](handleEntityNotFound(_0x3890be,null))[_0x8aa1('0x20')](removeEntity(_0x3890be,null))['catch'](handleError(_0x3890be,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c86e33f..edf15dd 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 _0xcd52=['Variable','tools_variables','lodash','util','../../config/logger','api','request-promise','path','exports','define'];(function(_0x28add8,_0x18d6bd){var _0x2b1f4f=function(_0x454de1){while(--_0x454de1){_0x28add8['push'](_0x28add8['shift']());}};_0x2b1f4f(++_0x18d6bd);}(_0xcd52,0x7a));var _0x2cd5=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xcd52[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x2cd5('0x0'));var util=require(_0x2cd5('0x1'));var logger=require(_0x2cd5('0x2'))(_0x2cd5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2cd5('0x4'));var fs=require('fs');var path=require(_0x2cd5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x2cd5('0x6')]=function(_0x5e1a1f,_0x11c21a){return _0x5e1a1f[_0x2cd5('0x7')](_0x2cd5('0x8'),attributes,{'tableName':_0x2cd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd989=['request-promise','path','./variable.attributes','define','tools_variables','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1b30c4,_0x5cd2d9){var _0x1a180a=function(_0x4b2cf9){while(--_0x4b2cf9){_0x1b30c4['push'](_0x1b30c4['shift']());}};_0x1a180a(++_0x5cd2d9);}(_0xd989,0x145));var _0x9d98=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0xd989[_0x4cd846];return _0x2f2a7d;};'use strict';var _=require(_0x9d98('0x0'));var util=require('util');var logger=require(_0x9d98('0x1'))(_0x9d98('0x2'));var moment=require(_0x9d98('0x3'));var BPromise=require(_0x9d98('0x4'));var rp=require(_0x9d98('0x5'));var fs=require('fs');var path=require(_0x9d98('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9d98('0x7'));module['exports']=function(_0xf2f90a,_0x1a3873){return _0xf2f90a[_0x9d98('0x8')]('Variable',attributes,{'tableName':_0x9d98('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 556eca2..be294da 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 _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x4f9299,_0x4d6541){var _0x1b9ab3=function(_0x57cc2b){while(--_0x57cc2b){_0x4f9299['push'](_0x4f9299['shift']());}};_0x1b9ab3(++_0x4d6541);}(_0xf494,0x1c6));var _0x4f49=function(_0x16e648,_0x2b6fee){_0x16e648=_0x16e648-0x0;var _0x575bc7=_0xf494[_0x16e648];return _0x575bc7;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x492739,_0x4d7d80){var _0x4b668c=function(_0x1136af){while(--_0x1136af){_0x492739['push'](_0x492739['shift']());}};_0x4b668c(++_0x4d7d80);}(_0xe14b,0x93));var _0xbe14=function(_0x317257,_0x1677dc){_0x317257=_0x317257-0x0;var _0x1f235d=_0xe14b[_0x317257];return _0x1f235d;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3d0127a..e5cf533 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 _0x7caf=['migrations','exports','Router','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','/migrations'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7caf,0x102));var _0xf7ca=function(_0x2cdbb4,_0x30c4df){_0x2cdbb4=_0x2cdbb4-0x0;var _0x236315=_0x7caf[_0x2cdbb4];return _0x236315;};'use strict';var express=require('express');var router=express[_0xf7ca('0x0')]();var auth=require(_0xf7ca('0x1'));var controller=require('./version.controller');router[_0xf7ca('0x2')]('/',controller[_0xf7ca('0x3')]);router[_0xf7ca('0x2')](_0xf7ca('0x4'),auth[_0xf7ca('0x5')](),auth[_0xf7ca('0x6')](),controller[_0xf7ca('0x7')]);router[_0xf7ca('0x2')](_0xf7ca('0x8'),auth[_0xf7ca('0x5')](),auth[_0xf7ca('0x6')](),controller[_0xf7ca('0x9')]);router[_0xf7ca('0x2')](_0xf7ca('0xa'),auth[_0xf7ca('0x5')](),auth[_0xf7ca('0x6')](),controller[_0xf7ca('0xb')]);router[_0xf7ca('0x2')](_0xf7ca('0xc'),auth[_0xf7ca('0x5')](),controller['restart']);router[_0xf7ca('0x2')](_0xf7ca('0xd'),controller[_0xf7ca('0xe')]);module[_0xf7ca('0xf')]=router; \ No newline at end of file +var _0x2f6f=['../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','reset','/pull','isAuthenticated','pull','/restart','migrations','exports','Router'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x2f6f,0x1db));var _0xf2f6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2f6f[_0x3bf83f];return _0x22c4a9;};'use strict';var express=require('express');var router=express[_0xf2f6('0x0')]();var auth=require(_0xf2f6('0x1'));var controller=require(_0xf2f6('0x2'));router[_0xf2f6('0x3')]('/',controller[_0xf2f6('0x4')]);router[_0xf2f6('0x3')](_0xf2f6('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller['fetch']);router[_0xf2f6('0x3')]('/reset',auth['isAuthenticated'](),auth[_0xf2f6('0x6')](),controller[_0xf2f6('0x7')]);router[_0xf2f6('0x3')](_0xf2f6('0x8'),auth[_0xf2f6('0x9')](),auth[_0xf2f6('0x6')](),controller[_0xf2f6('0xa')]);router[_0xf2f6('0x3')](_0xf2f6('0xb'),auth[_0xf2f6('0x9')](),controller['restart']);router[_0xf2f6('0x3')]('/migrations',controller[_0xf2f6('0xc')]);module[_0xf2f6('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 51d6bb9..91a03e8 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 _0x94da=['server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','version','2.0.0','json','status','origin','master','error','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','root'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x94da,0x7c));var _0xa94d=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x94da[_0x5f3f88];return _0xd08119;};'use strict';var Umzug=require(_0xa94d('0x0'));var path=require(_0xa94d('0x1'));var fs=require('fs');var _=require(_0xa94d('0x2'));var pkginfo=require(_0xa94d('0x3'))(module,'version');var compareVersions=require(_0xa94d('0x4'));var exec=require('child_process')[_0xa94d('0x5')];var db=require(_0xa94d('0x6'))['db'];var config=require(_0xa94d('0x7'));var pm2=require(_0xa94d('0x8'));var logger=require(_0xa94d('0x9'))(_0xa94d('0xa'));var git=require(_0xa94d('0xb'))(config['root']);exports[_0xa94d('0xc')]=function(_0x392745,_0x1cf783){var _0x1a9c6e={'current':module[_0xa94d('0xd')]['version'],'phonebar':0x2};if(_0x392745[_0xa94d('0xe')]&&_0x392745['query'][_0xa94d('0xf')]){return git[_0xa94d('0x10')]()['tags'](function(_0xebf7f4,_0x29a746){_0x1a9c6e[_0xa94d('0xf')]=(_0xebf7f4?module[_0xa94d('0xd')][_0xa94d('0x11')]:_0x29a746[_0xa94d('0xf')])||_0xa94d('0x12');return _0x1cf783['status'](0xc8)[_0xa94d('0x13')](_0x1a9c6e);});}else{return _0x1cf783[_0xa94d('0x14')](0xc8)[_0xa94d('0x13')](_0x1a9c6e);}};exports[_0xa94d('0x10')]=function(_0x336d26,_0x4d3ba3){return git[_0xa94d('0x10')]([_0xa94d('0x15'),_0xa94d('0x16')],function(_0x5c6307){if(_0x5c6307){logger[_0xa94d('0x17')](_0x5c6307);return _0x4d3ba3[_0xa94d('0x14')](0x1f4)[_0xa94d('0x13')](_0x5c6307);}logger['info']('git\x20fetch');return _0x4d3ba3[_0xa94d('0x14')](0xc8)[_0xa94d('0x13')]({'output':_0xa94d('0x18')});});};exports[_0xa94d('0x19')]=function(_0x5ecb38,_0xf563dd){return git[_0xa94d('0x19')](['--hard',_0xa94d('0x1a')],function(_0x2bc046){if(_0x2bc046){logger[_0xa94d('0x17')](_0x2bc046);return _0xf563dd[_0xa94d('0x14')](0x1f4)[_0xa94d('0x13')](_0x2bc046);}logger[_0xa94d('0x1b')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xf563dd['status'](0xc8)['json']({'output':_0xa94d('0x1c')});});};exports['pull']=function(_0x58c0a1,_0x3fe03b){exec(_0xa94d('0x1d'),function(_0x5c483d,_0x5c6499,_0x494fa3){logger['info'](_0x5c6499);logger['info'](_0x494fa3);if(_0x5c483d){logger[_0xa94d('0x17')](_0x5c483d);return _0x3fe03b[_0xa94d('0x14')](0x1f4)[_0xa94d('0x13')](_0x5c483d);}return _0x3fe03b[_0xa94d('0x14')](0xc8)[_0xa94d('0x13')]({'output':_0x5c6499});});};exports[_0xa94d('0x1e')]=function(_0x38dc6b,_0xbe0782){return pm2[_0xa94d('0x1e')]('motion2')[_0xa94d('0x1f')](function(_0x550d29){logger[_0xa94d('0x1b')](_0xa94d('0x20'),_0x550d29);return _0xbe0782['status'](0xc8)['json']({'output':_0xa94d('0x21')});})[_0xa94d('0x22')](function(_0x23e7a3){logger['error'](_0x23e7a3);return _0xbe0782[_0xa94d('0x14')](0x1f4)[_0xa94d('0x13')](_0x23e7a3);});};exports[_0xa94d('0x23')]=function(_0x3954d8,_0x41a4fd){var _0x1cf81a=fs[_0xa94d('0x24')](path['join'](config[_0xa94d('0x25')],_0xa94d('0x26'),_0xa94d('0x23')));var _0x3e5873=[];for(var _0x3dfe8a=0x0;_0x3dfe8a<_0x1cf81a[_0xa94d('0x27')];_0x3dfe8a++){var _0x18cb4d=_0x1cf81a[_0x3dfe8a][_0xa94d('0x28')](_0xa94d('0x29'),'');if(compareVersions(module[_0xa94d('0xd')][_0xa94d('0x11')],_0x18cb4d)===-0x1){_0x3e5873[_0xa94d('0x2a')](_0x18cb4d);}}if(_0x3e5873[_0xa94d('0x27')]){var _0xb4ee5c=_0x3e5873[_0xa94d('0x2b')](compareVersions);var _0x4b26a2=new Umzug({'storage':_0xa94d('0x2c'),'storageOptions':{'model':db[_0xa94d('0x2d')],'modelName':_0xa94d('0x2d'),'columnName':_0xa94d('0x11')},'migrations':{'params':[db['sequelize'][_0xa94d('0x2e')](),db[_0xa94d('0x2c')][_0xa94d('0x2f')],function(){throw new Error(_0xa94d('0x30'));}],'path':path[_0xa94d('0x31')](config[_0xa94d('0x25')],_0xa94d('0x26'),_0xa94d('0x23')),'pattern':/\.js$/}});_0x4b26a2['up']({'migrations':_['map'](_0xb4ee5c,function(_0x2df44a){return _0x2df44a+_0xa94d('0x29');})})[_0xa94d('0x1f')](function(){return _0x41a4fd[_0xa94d('0x14')](0xc8)[_0xa94d('0x13')]({'output':_0xa94d('0x32')+module[_0xa94d('0xd')][_0xa94d('0x11')]+_0xa94d('0x33')+_['last'](_0xb4ee5c),'migrations':_[_0xa94d('0x31')](_0xb4ee5c)});})[_0xa94d('0x22')](function(_0x5af120){if(_0x5af120 instanceof db[_0xa94d('0x2c')][_0xa94d('0x34')]){return _0x41a4fd[_0xa94d('0x14')](0xc8)['json']({'output':_0xa94d('0x35')});}else{return _0x41a4fd['status'](0x1f4)[_0xa94d('0x13')](_0x5af120);}});}else{return _0x41a4fd['status'](0xc8)[_0xa94d('0x13')]({'output':_0xa94d('0x35')});}}; \ No newline at end of file +var _0xdb47=['replace','.js','push','Migration','sequelize','getQueryInterface','constructor','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','version','compare-versions','child_process','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','2.0.0','json','status','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','npm\x20install\x20--production','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length'];(function(_0x3086d0,_0x5ad3a0){var _0xb4cde=function(_0x393c0e){while(--_0x393c0e){_0x3086d0['push'](_0x3086d0['shift']());}};_0xb4cde(++_0x5ad3a0);}(_0xdb47,0xd1));var _0x7db4=function(_0x314bc6,_0x1e99bd){_0x314bc6=_0x314bc6-0x0;var _0x1449de=_0xdb47[_0x314bc6];return _0x1449de;};'use strict';var Umzug=require(_0x7db4('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x7db4('0x1'));var compareVersions=require(_0x7db4('0x2'));var exec=require(_0x7db4('0x3'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x7db4('0x4'));var pm2=require(_0x7db4('0x5'));var logger=require(_0x7db4('0x6'))(_0x7db4('0x7'));var git=require(_0x7db4('0x8'))(config['root']);exports[_0x7db4('0x9')]=function(_0x579cd4,_0x4a28b5){var _0x4c8e36={'current':module[_0x7db4('0xa')]['version'],'phonebar':0x2};if(_0x579cd4[_0x7db4('0xb')]&&_0x579cd4[_0x7db4('0xb')][_0x7db4('0xc')]){return git[_0x7db4('0xd')]()['tags'](function(_0x24967a,_0x54d789){_0x4c8e36['latest']=(_0x24967a?module[_0x7db4('0xa')][_0x7db4('0x1')]:_0x54d789[_0x7db4('0xc')])||_0x7db4('0xe');return _0x4a28b5['status'](0xc8)[_0x7db4('0xf')](_0x4c8e36);});}else{return _0x4a28b5[_0x7db4('0x10')](0xc8)[_0x7db4('0xf')](_0x4c8e36);}};exports['fetch']=function(_0x28fceb,_0x3cf825){return git[_0x7db4('0xd')]([_0x7db4('0x11'),_0x7db4('0x12')],function(_0x5d5149){if(_0x5d5149){logger[_0x7db4('0x13')](_0x5d5149);return _0x3cf825[_0x7db4('0x10')](0x1f4)['json'](_0x5d5149);}logger[_0x7db4('0x14')](_0x7db4('0x15'));return _0x3cf825[_0x7db4('0x10')](0xc8)[_0x7db4('0xf')]({'output':_0x7db4('0x16')});});};exports[_0x7db4('0x17')]=function(_0x31298b,_0x30bedf){return git[_0x7db4('0x17')]([_0x7db4('0x18'),'FETCH_HEAD'],function(_0x5114a8){if(_0x5114a8){logger[_0x7db4('0x13')](_0x5114a8);return _0x30bedf['status'](0x1f4)[_0x7db4('0xf')](_0x5114a8);}logger[_0x7db4('0x14')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x30bedf[_0x7db4('0x10')](0xc8)[_0x7db4('0xf')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x36d1ef,_0x16b6b7){exec(_0x7db4('0x19'),function(_0x527268,_0x2ab9b7,_0x3fe584){logger[_0x7db4('0x14')](_0x2ab9b7);logger[_0x7db4('0x14')](_0x3fe584);if(_0x527268){logger[_0x7db4('0x13')](_0x527268);return _0x16b6b7[_0x7db4('0x10')](0x1f4)[_0x7db4('0xf')](_0x527268);}return _0x16b6b7[_0x7db4('0x10')](0xc8)[_0x7db4('0xf')]({'output':_0x2ab9b7});});};exports[_0x7db4('0x1a')]=function(_0x38ec42,_0x485171){return pm2['restart'](_0x7db4('0x1b'))['then'](function(_0x5f33ef){logger[_0x7db4('0x14')]('pm2\x20restart\x20motion\x20%s',_0x5f33ef);return _0x485171[_0x7db4('0x10')](0xc8)[_0x7db4('0xf')]({'output':_0x7db4('0x1c')});})[_0x7db4('0x1d')](function(_0x395843){logger[_0x7db4('0x13')](_0x395843);return _0x485171[_0x7db4('0x10')](0x1f4)[_0x7db4('0xf')](_0x395843);});};exports[_0x7db4('0x1e')]=function(_0xcdfa2c,_0x53581d){var _0x14e9b3=fs[_0x7db4('0x1f')](path[_0x7db4('0x20')](config[_0x7db4('0x21')],_0x7db4('0x22'),'migrations'));var _0x5a89a1=[];for(var _0x4313fe=0x0;_0x4313fe<_0x14e9b3[_0x7db4('0x23')];_0x4313fe++){var _0x5b6055=_0x14e9b3[_0x4313fe][_0x7db4('0x24')](_0x7db4('0x25'),'');if(compareVersions(module[_0x7db4('0xa')][_0x7db4('0x1')],_0x5b6055)===-0x1){_0x5a89a1[_0x7db4('0x26')](_0x5b6055);}}if(_0x5a89a1[_0x7db4('0x23')]){var _0x2ee00f=_0x5a89a1['sort'](compareVersions);var _0x503e42=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7db4('0x27')],'modelName':_0x7db4('0x27'),'columnName':_0x7db4('0x1')},'migrations':{'params':[db[_0x7db4('0x28')][_0x7db4('0x29')](),db['sequelize'][_0x7db4('0x2a')],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[_0x7db4('0x20')](config['root'],_0x7db4('0x22'),_0x7db4('0x1e')),'pattern':/\.js$/}});_0x503e42['up']({'migrations':_[_0x7db4('0x2b')](_0x2ee00f,function(_0x2c4359){return _0x2c4359+_0x7db4('0x25');})})[_0x7db4('0x2c')](function(){return _0x53581d[_0x7db4('0x10')](0xc8)['json']({'output':_0x7db4('0x2d')+module['exports'][_0x7db4('0x1')]+'\x20to\x20'+_[_0x7db4('0x2e')](_0x2ee00f),'migrations':_[_0x7db4('0x20')](_0x2ee00f)});})[_0x7db4('0x1d')](function(_0x3b2d30){if(_0x3b2d30 instanceof db[_0x7db4('0x28')][_0x7db4('0x2f')]){return _0x53581d[_0x7db4('0x10')](0xc8)[_0x7db4('0xf')]({'output':_0x7db4('0x30')});}else{return _0x53581d[_0x7db4('0x10')](0x1f4)['json'](_0x3b2d30);}});}else{return _0x53581d[_0x7db4('0x10')](0xc8)[_0x7db4('0xf')]({'output':_0x7db4('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4999891..8dea9fd 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 _0x3708=['show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4e93f4,_0x46f3bb){var _0x2ee152=function(_0x561b06){while(--_0x561b06){_0x4e93f4['push'](_0x4e93f4['shift']());}};_0x2ee152(++_0x46f3bb);}(_0x3708,0xcd));var _0x8370=function(_0x22f67f,_0x4fd591){_0x22f67f=_0x22f67f-0x0;var _0x27fed1=_0x3708[_0x22f67f];return _0x27fed1;};'use strict';var multer=require(_0x8370('0x0'));var util=require(_0x8370('0x1'));var path=require(_0x8370('0x2'));var timeout=require('connect-timeout');var express=require(_0x8370('0x3'));var router=express[_0x8370('0x4')]();var fs_extra=require(_0x8370('0x5'));var auth=require(_0x8370('0x6'));var interaction=require(_0x8370('0x7'));var config=require('../../config/environment');var controller=require(_0x8370('0x8'));router[_0x8370('0x9')]('/',auth[_0x8370('0xa')](),controller[_0x8370('0xb')]);router[_0x8370('0x9')](_0x8370('0xc'),auth['isAuthenticated'](),controller[_0x8370('0xd')]);router[_0x8370('0x9')](_0x8370('0xe'),auth[_0x8370('0xa')](),controller[_0x8370('0xf')]);router[_0x8370('0x10')]('/',auth[_0x8370('0xa')](),controller['create']);router[_0x8370('0x11')](_0x8370('0xe'),auth['isAuthenticated'](),controller[_0x8370('0x12')]);router[_0x8370('0x13')](_0x8370('0xe'),auth['isAuthenticated'](),controller[_0x8370('0x14')]);module[_0x8370('0x15')]=router; \ No newline at end of file +var _0x6bf9=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x3c81c6,_0x21dc24){var _0x27ca12=function(_0x1c66ee){while(--_0x1c66ee){_0x3c81c6['push'](_0x3c81c6['shift']());}};_0x27ca12(++_0x21dc24);}(_0x6bf9,0x1cd));var _0x96bf=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x6bf9[_0x409353];return _0x4f4b59;};'use strict';var multer=require(_0x96bf('0x0'));var util=require(_0x96bf('0x1'));var path=require(_0x96bf('0x2'));var timeout=require(_0x96bf('0x3'));var express=require(_0x96bf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x96bf('0x5'));var config=require(_0x96bf('0x6'));var controller=require(_0x96bf('0x7'));router[_0x96bf('0x8')]('/',auth[_0x96bf('0x9')](),controller[_0x96bf('0xa')]);router['get'](_0x96bf('0xb'),auth['isAuthenticated'](),controller[_0x96bf('0xc')]);router[_0x96bf('0x8')]('/:id',auth[_0x96bf('0x9')](),controller[_0x96bf('0xd')]);router[_0x96bf('0xe')]('/',auth['isAuthenticated'](),controller[_0x96bf('0xf')]);router[_0x96bf('0x10')]('/:id',auth[_0x96bf('0x9')](),controller['update']);router['delete']('/:id',auth[_0x96bf('0x9')](),controller[_0x96bf('0x11')]);module[_0x96bf('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 536f21c..693462f 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 _0xc584=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x276167,_0x21086e){var _0x27a866=function(_0xa47f17){while(--_0xa47f17){_0x276167['push'](_0x276167['shift']());}};_0x27a866(++_0x21086e);}(_0xc584,0xa8));var _0x4c58=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xc584[_0x1a4748];return _0x28ca99;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'type':{'type':Sequelize[_0x4c58('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4c58('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4c58('0x1')]},'membername':{'type':Sequelize[_0x4c58('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4c58('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x4c58('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x4c58('0x2')]},'agentdumpAt':{'type':Sequelize[_0x4c58('0x2')]},'holdtime':{'type':Sequelize[_0x4c58('0x3')]},'agentcomplete':{'type':Sequelize[_0x4c58('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x4c58('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4c58('0x3')]},'reason':{'type':Sequelize[_0x4c58('0x1')]},'lastevent':{'type':Sequelize[_0x4c58('0x1')]},'channel':{'type':Sequelize[_0x4c58('0x1')]},'channelstate':{'type':Sequelize[_0x4c58('0x3')]},'channelstatedesc':{'type':Sequelize[_0x4c58('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4c58('0x1')]},'connectedlinename':{'type':Sequelize[_0x4c58('0x1')]},'language':{'type':Sequelize[_0x4c58('0x1')]},'accountcode':{'type':Sequelize[_0x4c58('0x1')]},'context':{'type':Sequelize[_0x4c58('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x4c58('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4c58('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4c58('0x1')]},'destcalleridname':{'type':Sequelize[_0x4c58('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4c58('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4c58('0x1')]},'destlanguage':{'type':Sequelize[_0x4c58('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4c58('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x4c58('0x1')]},'destuniqueid':{'type':Sequelize[_0x4c58('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4c58('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x4c58('0x1')]},'transfer':{'type':Sequelize[_0x4c58('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4c58('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x4c58('0x1')]},'transferuniqueid':{'type':Sequelize[_0x4c58('0x1')]},'agententerreason':{'type':Sequelize[_0x4c58('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xab95=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x23bad9,_0x2c2c8c){var _0x1fd1ef=function(_0x6e4333){while(--_0x6e4333){_0x23bad9['push'](_0x23bad9['shift']());}};_0x1fd1ef(++_0x2c2c8c);}(_0xab95,0x1d5));var _0x5ab9=function(_0x445aa8,_0xdd8ac9){_0x445aa8=_0x445aa8-0x0;var _0x58c887=_0xab95[_0x445aa8];return _0x58c887;};'use strict';var Sequelize=require(_0x5ab9('0x0'));module[_0x5ab9('0x1')]={'type':{'type':Sequelize[_0x5ab9('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5ab9('0x2')]},'calleridname':{'type':Sequelize[_0x5ab9('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5ab9('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5ab9('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x5ab9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x5ab9('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5ab9('0x4')]},'agentcomplete':{'type':Sequelize[_0x5ab9('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5ab9('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5ab9('0x4')]},'agentacw':{'type':Sequelize[_0x5ab9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x5ab9('0x2')]},'channel':{'type':Sequelize[_0x5ab9('0x2')]},'channelstate':{'type':Sequelize[_0x5ab9('0x4')]},'channelstatedesc':{'type':Sequelize[_0x5ab9('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5ab9('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5ab9('0x2')]},'context':{'type':Sequelize[_0x5ab9('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5ab9('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5ab9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x5ab9('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5ab9('0x2')]},'destcalleridname':{'type':Sequelize[_0x5ab9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5ab9('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5ab9('0x2')]},'destaccountcode':{'type':Sequelize[_0x5ab9('0x2')]},'destcontext':{'type':Sequelize[_0x5ab9('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5ab9('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5ab9('0x2')]},'transfer':{'type':Sequelize[_0x5ab9('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5ab9('0x2')],'comment':_0x5ab9('0x6')},'transferexten':{'type':Sequelize[_0x5ab9('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5ab9('0x2')]},'agententerreason':{'type':Sequelize[_0x5ab9('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 22e6c30..4d8bca4 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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 76c8644..f1c17d6 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 _0x746f=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x746f,0x9c));var _0xf746=function(_0x538260,_0x1862b9){_0x538260=_0x538260-0x0;var _0x54f305=_0x746f[_0x538260];return _0x54f305;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var logger=require(_0xf746('0x2'))(_0xf746('0x3'));var moment=require(_0xf746('0x4'));var BPromise=require(_0xf746('0x5'));var rp=require(_0xf746('0x6'));var fs=require('fs');var path=require(_0xf746('0x7'));var rimraf=require(_0xf746('0x8'));var config=require(_0xf746('0x9'));var attributes=require(_0xf746('0xa'));module[_0xf746('0xb')]=function(_0x19d855,_0x2f0f3c){return _0x19d855[_0xf746('0xc')](_0xf746('0xd'),attributes,{'tableName':_0xf746('0xe'),'paranoid':![],'indexes':[{'fields':[_0xf746('0xf'),_0xf746('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb2a=['exports','define','report_agent','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./voiceAgentReport.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdb2a,0x16f));var _0xadb2=function(_0x255b1b,_0x736efb){_0x255b1b=_0x255b1b-0x0;var _0x1f06eb=_0xdb2a[_0x255b1b];return _0x1f06eb;};'use strict';var _=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var logger=require(_0xadb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadb2('0x3'));var rp=require(_0xadb2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb2('0x6'));module[_0xadb2('0x7')]=function(_0x1f5c7e,_0x297e69){return _0x1f5c7e[_0xadb2('0x8')]('VoiceAgentReport',attributes,{'tableName':_0xadb2('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xadb2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 1f9e90a..d3928e8 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 _0x775f=['stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','VoiceAgentReport','create','options','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','body','raw','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x775f,0x1a3));var _0xf775=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0x775f[_0x2bfd4f];return _0x341849;};'use strict';var _=require(_0xf775('0x0'));var util=require(_0xf775('0x1'));var moment=require('moment');var BPromise=require(_0xf775('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf775('0x3'));var db=require(_0xf775('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf775('0x5'))('rpc');var config=require(_0xf775('0x6'));var jayson=require(_0xf775('0x7'));var client=jayson['client'][_0xf775('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46971f,_0x484e5a,_0x531ad8){return new BPromise(function(_0x4c4b66,_0x1ab36a){return client[_0xf775('0x9')](_0x46971f,_0x531ad8)[_0xf775('0xa')](function(_0x4273d0){logger[_0xf775('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x484e5a,_0xf775('0xc'));logger[_0xf775('0xd')](_0xf775('0xe'),_0x484e5a,_0xf775('0xc'),JSON[_0xf775('0xf')](_0x4273d0));if(_0x4273d0[_0xf775('0x10')]){if(_0x4273d0[_0xf775('0x10')][_0xf775('0x11')]===0x1f4){logger[_0xf775('0x10')](_0xf775('0x12'),_0x484e5a,_0x4273d0['error'][_0xf775('0x13')]);return _0x1ab36a(_0x4273d0[_0xf775('0x10')][_0xf775('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x484e5a,_0x4273d0['error'][_0xf775('0x13')]);return _0x4c4b66(_0x4273d0[_0xf775('0x10')][_0xf775('0x13')]);}else{logger[_0xf775('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x484e5a,_0xf775('0xc'));_0x4c4b66(_0x4273d0[_0xf775('0x14')][_0xf775('0x13')]);}})[_0xf775('0x15')](function(_0x34a9ec){logger[_0xf775('0x10')](_0xf775('0x12'),_0x484e5a,_0x34a9ec);_0x1ab36a(_0x34a9ec);});});}exports['CreateVoiceAgentReport']=function(_0x389f87){var _0x284aca=this;return new Promise(function(_0x1795ee,_0x51eefb){return db[_0xf775('0x16')][_0xf775('0x17')](_0x389f87['body'],{'raw':_0x389f87[_0xf775('0x18')]?_0x389f87[_0xf775('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xf775('0xa')](function(_0x19ff8a){logger['info']('CreateVoiceAgentReport',_0x389f87);logger[_0xf775('0xd')](_0xf775('0x19'),_0x389f87,JSON['stringify'](_0x19ff8a));_0x1795ee(_0x19ff8a);})[_0xf775('0x15')](function(_0x26d8a3){logger['error']('CreateVoiceAgentReport',_0x26d8a3[_0xf775('0x13')],_0x389f87);_0x51eefb(_0x284aca[_0xf775('0x10')](0x1f4,_0x26d8a3['message']));});});};exports[_0xf775('0x1a')]=function(_0xdf96e){var _0x2eaf3c=this;return new Promise(function(_0x248d71,_0x3fa416){return db[_0xf775('0x16')][_0xf775('0x1b')](_0xdf96e[_0xf775('0x1c')],{'raw':_0xdf96e[_0xf775('0x18')]?_0xdf96e[_0xf775('0x18')][_0xf775('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdf96e[_0xf775('0x18')]?_0xdf96e['options']['where']||null:null,'attributes':_0xdf96e[_0xf775('0x18')]?_0xdf96e[_0xf775('0x18')]['attributes']||null:null,'limit':_0xdf96e[_0xf775('0x18')]?_0xdf96e[_0xf775('0x18')][_0xf775('0x1e')]||null:null})[_0xf775('0xa')](function(_0x2b0c9b){logger[_0xf775('0xb')](_0xf775('0x1a'),_0xdf96e);logger['debug'](_0xf775('0x1a'),_0xdf96e,JSON[_0xf775('0xf')](_0x2b0c9b));_0x248d71(_0x2b0c9b);})['catch'](function(_0x17a9cb){logger['error'](_0xf775('0x1a'),_0x17a9cb[_0xf775('0x13')],_0xdf96e);_0x3fa416(_0x2eaf3c[_0xf775('0x10')](0x1f4,_0x17a9cb[_0xf775('0x13')]));});});}; \ No newline at end of file +var _0xa8fa=['info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','then','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x24ffa4,_0x143957){var _0x257fbc=function(_0x5e56de){while(--_0x5e56de){_0x24ffa4['push'](_0x24ffa4['shift']());}};_0x257fbc(++_0x143957);}(_0xa8fa,0xdc));var _0xaa8f=function(_0x409cff,_0x4b6971){_0x409cff=_0x409cff-0x0;var _0xdbc3c9=_0xa8fa[_0x409cff];return _0xdbc3c9;};'use strict';var _=require(_0xaa8f('0x0'));var util=require(_0xaa8f('0x1'));var moment=require(_0xaa8f('0x2'));var BPromise=require(_0xaa8f('0x3'));var rs=require(_0xaa8f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa8f('0x5'))['db'];var utils=require(_0xaa8f('0x6'));var logger=require(_0xaa8f('0x7'))(_0xaa8f('0x8'));var config=require(_0xaa8f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa8f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b8eba,_0x3d162a,_0x2a1b11){return new BPromise(function(_0xd7dfd5,_0x48296e){return client['request'](_0x3b8eba,_0x2a1b11)['then'](function(_0x341101){logger[_0xaa8f('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x3d162a,_0xaa8f('0xc'));logger[_0xaa8f('0xd')](_0xaa8f('0xe'),_0x3d162a,'request\x20sent',JSON[_0xaa8f('0xf')](_0x341101));if(_0x341101[_0xaa8f('0x10')]){if(_0x341101['error'][_0xaa8f('0x11')]===0x1f4){logger['error'](_0xaa8f('0x12'),_0x3d162a,_0x341101['error'][_0xaa8f('0x13')]);return _0x48296e(_0x341101[_0xaa8f('0x10')][_0xaa8f('0x13')]);}logger['error'](_0xaa8f('0x12'),_0x3d162a,_0x341101[_0xaa8f('0x10')][_0xaa8f('0x13')]);return _0xd7dfd5(_0x341101[_0xaa8f('0x10')][_0xaa8f('0x13')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x3d162a,_0xaa8f('0xc'));_0xd7dfd5(_0x341101[_0xaa8f('0x14')]['message']);}})[_0xaa8f('0x15')](function(_0x1bd9cf){logger['error'](_0xaa8f('0x12'),_0x3d162a,_0x1bd9cf);_0x48296e(_0x1bd9cf);});});}exports[_0xaa8f('0x16')]=function(_0xd7b0ae){var _0x349763=this;return new Promise(function(_0xf13b2e,_0x448d2b){return db[_0xaa8f('0x17')][_0xaa8f('0x18')](_0xd7b0ae['body'],{'raw':_0xd7b0ae[_0xaa8f('0x19')]?_0xd7b0ae['options'][_0xaa8f('0x1a')]===undefined?!![]:![]:!![]})[_0xaa8f('0x1b')](function(_0x26fdbd){logger[_0xaa8f('0xb')](_0xaa8f('0x16'),_0xd7b0ae);logger[_0xaa8f('0xd')]('CreateVoiceAgentReport',_0xd7b0ae,JSON['stringify'](_0x26fdbd));_0xf13b2e(_0x26fdbd);})['catch'](function(_0x182b5b){logger[_0xaa8f('0x10')]('CreateVoiceAgentReport',_0x182b5b['message'],_0xd7b0ae);_0x448d2b(_0x349763[_0xaa8f('0x10')](0x1f4,_0x182b5b[_0xaa8f('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x272ab6){var _0x98a9fc=this;return new Promise(function(_0x16f79f,_0x453815){return db[_0xaa8f('0x17')][_0xaa8f('0x1c')](_0x272ab6['body'],{'raw':_0x272ab6['options']?_0x272ab6['options'][_0xaa8f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x272ab6['options']?_0x272ab6[_0xaa8f('0x19')][_0xaa8f('0x1d')]||null:null,'attributes':_0x272ab6[_0xaa8f('0x19')]?_0x272ab6[_0xaa8f('0x19')][_0xaa8f('0x1e')]||null:null,'limit':_0x272ab6['options']?_0x272ab6[_0xaa8f('0x19')][_0xaa8f('0x1f')]||null:null})[_0xaa8f('0x1b')](function(_0x51f85e){logger[_0xaa8f('0xb')](_0xaa8f('0x20'),_0x272ab6);logger[_0xaa8f('0xd')](_0xaa8f('0x20'),_0x272ab6,JSON[_0xaa8f('0xf')](_0x51f85e));_0x16f79f(_0x51f85e);})[_0xaa8f('0x15')](function(_0x2e8e60){logger[_0xaa8f('0x10')](_0xaa8f('0x20'),_0x2e8e60['message'],_0x272ab6);_0x453815(_0x98a9fc[_0xaa8f('0x10')](0x1f4,_0x2e8e60[_0xaa8f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 7e05b17..54cbbfc 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 _0x5178=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x45b18b,_0x402942){var _0x581a12=function(_0x4cb8f6){while(--_0x4cb8f6){_0x45b18b['push'](_0x45b18b['shift']());}};_0x581a12(++_0x402942);}(_0x5178,0x171));var _0x8517=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5178[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./voiceCallReport.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0xd')]('/',auth[_0x8517('0xa')](),controller['create']);router[_0x8517('0xe')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0xf')]);router[_0x8517('0x10')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x11')]);module['exports']=router; \ No newline at end of file +var _0x008c=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','show','post','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x008c,0x188));var _0xc008=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x008c[_0x1098db];return _0x14f090;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['update']);router[_0xc008('0x10')](_0xc008('0xf'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);module[_0xc008('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index bda4cfd..8e68365 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 _0x457b=['dialer','STRING','DATE','INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax'];(function(_0x4c09df,_0x229112){var _0x1f33be=function(_0x3027a9){while(--_0x3027a9){_0x4c09df['push'](_0x4c09df['shift']());}};_0x1f33be(++_0x229112);}(_0x457b,0xca));var _0xb457=function(_0x1b3228,_0x220869){_0x1b3228=_0x1b3228-0x0;var _0x47dade=_0x457b[_0x1b3228];return _0x47dade;};'use strict';var Sequelize=require(_0xb457('0x0'));module[_0xb457('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb457('0x2')](_0xb457('0x3'),_0xb457('0x4'),_0xb457('0x5'),_0xb457('0x6'),'outbound-fax',_0xb457('0x7'))},'tag':{'type':Sequelize[_0xb457('0x8')]},'accountcode':{'type':Sequelize[_0xb457('0x8')]},'source':{'type':Sequelize[_0xb457('0x8')]},'destination':{'type':Sequelize[_0xb457('0x8')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb457('0x8')]},'channel':{'type':Sequelize[_0xb457('0x8')]},'destinationchannel':{'type':Sequelize[_0xb457('0x8')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xb457('0x9')]},'systemanswertime':{'type':Sequelize[_0xb457('0x9')]},'answertime':{'type':Sequelize[_0xb457('0x9')]},'endtime':{'type':Sequelize[_0xb457('0x9')]},'duration':{'type':Sequelize[_0xb457('0xa')]},'billableseconds':{'type':Sequelize[_0xb457('0xa')]},'mohtime':{'type':Sequelize[_0xb457('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb457('0x8')]},'amaflags':{'type':Sequelize[_0xb457('0x8')]},'userfield':{'type':Sequelize[_0xb457('0x8')]},'userDisposition':{'type':Sequelize[_0xb457('0x8')]},'userSecondDisposition':{'type':Sequelize[_0xb457('0x8')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb457('0x8')]},'routeid':{'type':Sequelize[_0xb457('0xa')]},'sipcallid':{'type':Sequelize[_0xb457('0x8')]}}; \ No newline at end of file +var _0x6e9b=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax'];(function(_0x302fc7,_0xa27d4){var _0x4b4c0a=function(_0x53c9c9){while(--_0x53c9c9){_0x302fc7['push'](_0x302fc7['shift']());}};_0x4b4c0a(++_0xa27d4);}(_0x6e9b,0xea));var _0xb6e9=function(_0x4cffd0,_0x43de82){_0x4cffd0=_0x4cffd0-0x0;var _0x12ac47=_0x6e9b[_0x4cffd0];return _0x12ac47;};'use strict';var Sequelize=require(_0xb6e9('0x0'));module[_0xb6e9('0x1')]={'uniqueid':{'type':Sequelize[_0xb6e9('0x2')]},'type':{'type':Sequelize[_0xb6e9('0x3')](_0xb6e9('0x4'),'internal',_0xb6e9('0x5'),_0xb6e9('0x6'),_0xb6e9('0x7'),'dialer')},'tag':{'type':Sequelize[_0xb6e9('0x2')]},'accountcode':{'type':Sequelize[_0xb6e9('0x2')]},'source':{'type':Sequelize[_0xb6e9('0x2')]},'destination':{'type':Sequelize[_0xb6e9('0x2')]},'destinationcontext':{'type':Sequelize[_0xb6e9('0x2')]},'callerid':{'type':Sequelize[_0xb6e9('0x2')]},'channel':{'type':Sequelize[_0xb6e9('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xb6e9('0x2')]},'lastdata':{'type':Sequelize[_0xb6e9('0x8')]},'starttime':{'type':Sequelize[_0xb6e9('0x9')]},'systemanswertime':{'type':Sequelize[_0xb6e9('0x9')]},'answertime':{'type':Sequelize[_0xb6e9('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xb6e9('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb6e9('0x2')]},'userfield':{'type':Sequelize[_0xb6e9('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xb6e9('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb6e9('0x2')]},'prefix':{'type':Sequelize[_0xb6e9('0x2')]},'routeid':{'type':Sequelize[_0xb6e9('0xa')]},'sipcallid':{'type':Sequelize[_0xb6e9('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index fdd6bb0..d744c1d 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(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x2ef3,0xba));var _0x32ef=function(_0x5a2c98,_0x2642c3){_0x5a2c98=_0x5a2c98-0x0;var _0x4ed8c7=_0x2ef3[_0x5a2c98];return _0x4ed8c7;};'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 _0x0b0e=['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','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x2cf3e4,_0x50ff08){var _0x377352=function(_0x389a63){while(--_0x389a63){_0x2cf3e4['push'](_0x2cf3e4['shift']());}};_0x377352(++_0x50ff08);}(_0x0b0e,0x187));var _0xe0b0=function(_0x919bbb,_0x55ef48){_0x919bbb=_0x919bbb-0x0;var _0x40971a=_0x0b0e[_0x919bbb];return _0x40971a;};'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['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4c4a129..2f4d164 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 _0x7798=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x7798,0x175));var _0x8779=function(_0x2d80d0,_0x33ee32){_0x2d80d0=_0x2d80d0-0x0;var _0x5b7582=_0x7798[_0x2d80d0];return _0x5b7582;};'use strict';var _=require(_0x8779('0x0'));var util=require('util');var logger=require(_0x8779('0x1'))(_0x8779('0x2'));var moment=require(_0x8779('0x3'));var BPromise=require(_0x8779('0x4'));var rp=require(_0x8779('0x5'));var fs=require('fs');var path=require(_0x8779('0x6'));var rimraf=require(_0x8779('0x7'));var config=require(_0x8779('0x8'));var attributes=require(_0x8779('0x9'));module[_0x8779('0xa')]=function(_0x28c8fa,_0x4db003){return _0x28c8fa[_0x8779('0xb')](_0x8779('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x8779('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb70=['define','uniqueid','lodash','util','../../config/logger','request-promise','../../config/environment','exports'];(function(_0x212cc8,_0x593d9d){var _0x4cc4d9=function(_0x5626b5){while(--_0x5626b5){_0x212cc8['push'](_0x212cc8['shift']());}};_0x4cc4d9(++_0x593d9d);}(_0xfb70,0x16a));var _0x0fb7=function(_0x1f53c8,_0x4e05da){_0x1f53c8=_0x1f53c8-0x0;var _0x88562e=_0xfb70[_0x1f53c8];return _0x88562e;};'use strict';var _=require(_0x0fb7('0x0'));var util=require(_0x0fb7('0x1'));var logger=require(_0x0fb7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0fb7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0fb7('0x4'));var attributes=require('./voiceCallReport.attributes');module[_0x0fb7('0x5')]=function(_0x424f99,_0x53bb1e){return _0x424f99[_0x0fb7('0x6')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x0fb7('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 5566cfc..dc3e0be 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 _0x82fb=['options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll'];(function(_0x542717,_0x34d89f){var _0x3abcbb=function(_0x4f9bd3){while(--_0x4f9bd3){_0x542717['push'](_0x542717['shift']());}};_0x3abcbb(++_0x34d89f);}(_0x82fb,0x110));var _0xb82f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x82fb[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb82f('0x0'));var util=require(_0xb82f('0x1'));var moment=require('moment');var BPromise=require(_0xb82f('0x2'));var rs=require(_0xb82f('0x3'));var fs=require('fs');var Redis=require(_0xb82f('0x4'));var db=require(_0xb82f('0x5'))['db'];var utils=require(_0xb82f('0x6'));var logger=require('../../config/logger')(_0xb82f('0x7'));var config=require(_0xb82f('0x8'));var jayson=require(_0xb82f('0x9'));var client=jayson[_0xb82f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17a14e,_0x3e6d96,_0x561a2a){return new BPromise(function(_0x32dfe6,_0x5e394c){return client['request'](_0x17a14e,_0x561a2a)[_0xb82f('0xb')](function(_0x44bc39){logger[_0xb82f('0xc')](_0xb82f('0xd'),_0x3e6d96,'request\x20sent');logger[_0xb82f('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x3e6d96,_0xb82f('0xf'),JSON['stringify'](_0x44bc39));if(_0x44bc39['error']){if(_0x44bc39[_0xb82f('0x10')][_0xb82f('0x11')]===0x1f4){logger[_0xb82f('0x10')](_0xb82f('0xd'),_0x3e6d96,_0x44bc39[_0xb82f('0x10')][_0xb82f('0x12')]);return _0x5e394c(_0x44bc39[_0xb82f('0x10')][_0xb82f('0x12')]);}logger[_0xb82f('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x3e6d96,_0x44bc39[_0xb82f('0x10')]['message']);return _0x32dfe6(_0x44bc39[_0xb82f('0x10')][_0xb82f('0x12')]);}else{logger[_0xb82f('0xc')](_0xb82f('0xd'),_0x3e6d96,_0xb82f('0xf'));_0x32dfe6(_0x44bc39[_0xb82f('0x13')]['message']);}})[_0xb82f('0x14')](function(_0x164314){logger[_0xb82f('0x10')](_0xb82f('0xd'),_0x3e6d96,_0x164314);_0x5e394c(_0x164314);});});}exports[_0xb82f('0x15')]=function(_0x28e552){var _0x139764=this;return new Promise(function(_0x5ca008,_0x772f54){return db[_0xb82f('0x16')][_0xb82f('0x17')]({'raw':_0x28e552[_0xb82f('0x18')]?_0x28e552[_0xb82f('0x18')][_0xb82f('0x19')]===undefined?!![]:![]:!![],'where':_0x28e552['options']?_0x28e552[_0xb82f('0x18')][_0xb82f('0x1a')]||null:null,'attributes':_0x28e552[_0xb82f('0x18')]?_0x28e552[_0xb82f('0x18')][_0xb82f('0x1b')]||null:null,'limit':_0x28e552[_0xb82f('0x18')]?_0x28e552['options'][_0xb82f('0x1c')]||null:null,'include':_0x28e552['options']?_0x28e552[_0xb82f('0x18')][_0xb82f('0x1d')]?_['map'](_0x28e552[_0xb82f('0x18')][_0xb82f('0x1d')],function(_0x9e8e80){return{'model':db[_0x9e8e80['model']],'as':_0x9e8e80['as'],'attributes':_0x9e8e80[_0xb82f('0x1b')],'include':_0x9e8e80[_0xb82f('0x1d')]?_[_0xb82f('0x1e')](_0x9e8e80[_0xb82f('0x1d')],function(_0x3ec6ea){return{'model':db[_0x3ec6ea[_0xb82f('0x1f')]],'as':_0x3ec6ea['as'],'attributes':_0x3ec6ea[_0xb82f('0x1b')],'include':_0x3ec6ea['include']?_[_0xb82f('0x1e')](_0x3ec6ea[_0xb82f('0x1d')],function(_0x4ced86){return{'model':db[_0x4ced86['model']],'as':_0x4ced86['as'],'attributes':_0x4ced86[_0xb82f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a03ee){logger[_0xb82f('0xc')](_0xb82f('0x15'),_0x28e552);logger['debug'](_0xb82f('0x15'),_0x28e552,JSON['stringify'](_0x5a03ee));_0x5ca008(_0x5a03ee);})[_0xb82f('0x14')](function(_0x39f9e5){logger[_0xb82f('0x10')](_0xb82f('0x15'),_0x39f9e5[_0xb82f('0x12')],_0x28e552);_0x772f54(_0x139764['error'](0x1f4,_0x39f9e5[_0xb82f('0x12')]));});});};exports[_0xb82f('0x20')]=function(_0x496c6b){var _0xbc167d=this;return new Promise(function(_0x20bdb4,_0x5cd0dd){return db[_0xb82f('0x16')][_0xb82f('0x21')](_0x496c6b['body'],{'raw':_0x496c6b[_0xb82f('0x18')]?_0x496c6b['options']['raw']===undefined?!![]:![]:!![]})[_0xb82f('0xb')](function(_0x310b4b){logger['info'](_0xb82f('0x20'),_0x496c6b);logger[_0xb82f('0xe')](_0xb82f('0x20'),_0x496c6b,JSON['stringify'](_0x310b4b));_0x20bdb4(_0x310b4b);})[_0xb82f('0x14')](function(_0x23d5b1){logger[_0xb82f('0x10')](_0xb82f('0x20'),_0x23d5b1[_0xb82f('0x12')],_0x496c6b);_0x5cd0dd(_0xbc167d[_0xb82f('0x10')](0x1f4,_0x23d5b1['message']));});});};exports[_0xb82f('0x22')]=function(_0x35bbca){var _0x484ba4=this;return new Promise(function(_0x35609d,_0x1adc6f){return db['VoiceCallReport'][_0xb82f('0x23')](_0x35bbca['body'],{'raw':_0x35bbca[_0xb82f('0x18')]?_0x35bbca[_0xb82f('0x18')][_0xb82f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35bbca[_0xb82f('0x18')]?_0x35bbca[_0xb82f('0x18')]['where']||null:null,'attributes':_0x35bbca['options']?_0x35bbca[_0xb82f('0x18')][_0xb82f('0x1b')]||null:null,'limit':_0x35bbca[_0xb82f('0x18')]?_0x35bbca[_0xb82f('0x18')][_0xb82f('0x1c')]||null:null})[_0xb82f('0xb')](function(_0x360b28){logger[_0xb82f('0xc')]('UpdateVoiceCallReport',_0x35bbca);logger['debug'](_0xb82f('0x22'),_0x35bbca,JSON[_0xb82f('0x24')](_0x360b28));_0x35609d(_0x360b28);})[_0xb82f('0x14')](function(_0x47fee4){logger[_0xb82f('0x10')](_0xb82f('0x22'),_0x47fee4[_0xb82f('0x12')],_0x35bbca);_0x1adc6f(_0x484ba4['error'](0x1f4,_0x47fee4[_0xb82f('0x12')]));});});}; \ No newline at end of file +var _0xed0a=['attributes','limit','include','map','model','CreateVoiceCallReport','create','body','raw','then','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where'];(function(_0x20046d,_0x45856a){var _0x24c1b5=function(_0x1ea2a0){while(--_0x1ea2a0){_0x20046d['push'](_0x20046d['shift']());}};_0x24c1b5(++_0x45856a);}(_0xed0a,0xd3));var _0xaed0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xed0a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaed0('0x0'));var util=require(_0xaed0('0x1'));var moment=require(_0xaed0('0x2'));var BPromise=require(_0xaed0('0x3'));var rs=require(_0xaed0('0x4'));var fs=require('fs');var Redis=require(_0xaed0('0x5'));var db=require(_0xaed0('0x6'))['db'];var utils=require(_0xaed0('0x7'));var logger=require(_0xaed0('0x8'))(_0xaed0('0x9'));var config=require('../../config/environment');var jayson=require(_0xaed0('0xa'));var client=jayson[_0xaed0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x485278,_0xee29cc,_0x1e9704){return new BPromise(function(_0x485048,_0x5c7388){return client[_0xaed0('0xc')](_0x485278,_0x1e9704)['then'](function(_0x4dd725){logger[_0xaed0('0xd')](_0xaed0('0xe'),_0xee29cc,_0xaed0('0xf'));logger[_0xaed0('0x10')](_0xaed0('0x11'),_0xee29cc,_0xaed0('0xf'),JSON[_0xaed0('0x12')](_0x4dd725));if(_0x4dd725[_0xaed0('0x13')]){if(_0x4dd725[_0xaed0('0x13')][_0xaed0('0x14')]===0x1f4){logger[_0xaed0('0x13')](_0xaed0('0xe'),_0xee29cc,_0x4dd725[_0xaed0('0x13')][_0xaed0('0x15')]);return _0x5c7388(_0x4dd725[_0xaed0('0x13')][_0xaed0('0x15')]);}logger[_0xaed0('0x13')](_0xaed0('0xe'),_0xee29cc,_0x4dd725['error'][_0xaed0('0x15')]);return _0x485048(_0x4dd725[_0xaed0('0x13')][_0xaed0('0x15')]);}else{logger[_0xaed0('0xd')](_0xaed0('0xe'),_0xee29cc,_0xaed0('0xf'));_0x485048(_0x4dd725[_0xaed0('0x16')][_0xaed0('0x15')]);}})[_0xaed0('0x17')](function(_0x49455f){logger[_0xaed0('0x13')](_0xaed0('0xe'),_0xee29cc,_0x49455f);_0x5c7388(_0x49455f);});});}exports[_0xaed0('0x18')]=function(_0x55ce3f){var _0x756644=this;return new Promise(function(_0x583fa6,_0x555db6){return db[_0xaed0('0x19')][_0xaed0('0x1a')]({'raw':_0x55ce3f[_0xaed0('0x1b')]?_0x55ce3f[_0xaed0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x55ce3f[_0xaed0('0x1b')]?_0x55ce3f[_0xaed0('0x1b')][_0xaed0('0x1c')]||null:null,'attributes':_0x55ce3f[_0xaed0('0x1b')]?_0x55ce3f[_0xaed0('0x1b')][_0xaed0('0x1d')]||null:null,'limit':_0x55ce3f[_0xaed0('0x1b')]?_0x55ce3f[_0xaed0('0x1b')][_0xaed0('0x1e')]||null:null,'include':_0x55ce3f[_0xaed0('0x1b')]?_0x55ce3f[_0xaed0('0x1b')][_0xaed0('0x1f')]?_[_0xaed0('0x20')](_0x55ce3f[_0xaed0('0x1b')]['include'],function(_0x52ec96){return{'model':db[_0x52ec96[_0xaed0('0x21')]],'as':_0x52ec96['as'],'attributes':_0x52ec96['attributes'],'include':_0x52ec96['include']?_[_0xaed0('0x20')](_0x52ec96['include'],function(_0x2674f3){return{'model':db[_0x2674f3[_0xaed0('0x21')]],'as':_0x2674f3['as'],'attributes':_0x2674f3[_0xaed0('0x1d')],'include':_0x2674f3[_0xaed0('0x1f')]?_[_0xaed0('0x20')](_0x2674f3[_0xaed0('0x1f')],function(_0x39f1b5){return{'model':db[_0x39f1b5[_0xaed0('0x21')]],'as':_0x39f1b5['as'],'attributes':_0x39f1b5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43450c){logger[_0xaed0('0xd')](_0xaed0('0x18'),_0x55ce3f);logger[_0xaed0('0x10')]('GetVoiceCallReport',_0x55ce3f,JSON['stringify'](_0x43450c));_0x583fa6(_0x43450c);})[_0xaed0('0x17')](function(_0x3b703b){logger[_0xaed0('0x13')](_0xaed0('0x18'),_0x3b703b['message'],_0x55ce3f);_0x555db6(_0x756644[_0xaed0('0x13')](0x1f4,_0x3b703b[_0xaed0('0x15')]));});});};exports[_0xaed0('0x22')]=function(_0x31f903){var _0x233aea=this;return new Promise(function(_0x8e8e1e,_0x31db5f){return db[_0xaed0('0x19')][_0xaed0('0x23')](_0x31f903[_0xaed0('0x24')],{'raw':_0x31f903[_0xaed0('0x1b')]?_0x31f903['options'][_0xaed0('0x25')]===undefined?!![]:![]:!![]})[_0xaed0('0x26')](function(_0x3d4838){logger['info'](_0xaed0('0x22'),_0x31f903);logger[_0xaed0('0x10')](_0xaed0('0x22'),_0x31f903,JSON['stringify'](_0x3d4838));_0x8e8e1e(_0x3d4838);})[_0xaed0('0x17')](function(_0x3cac22){logger[_0xaed0('0x13')](_0xaed0('0x22'),_0x3cac22['message'],_0x31f903);_0x31db5f(_0x233aea[_0xaed0('0x13')](0x1f4,_0x3cac22[_0xaed0('0x15')]));});});};exports[_0xaed0('0x27')]=function(_0x3c6b2e){var _0x1a6b8a=this;return new Promise(function(_0xb4c9e3,_0x359a76){return db[_0xaed0('0x19')]['update'](_0x3c6b2e[_0xaed0('0x24')],{'raw':_0x3c6b2e['options']?_0x3c6b2e[_0xaed0('0x1b')][_0xaed0('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c6b2e[_0xaed0('0x1b')]?_0x3c6b2e[_0xaed0('0x1b')][_0xaed0('0x1c')]||null:null,'attributes':_0x3c6b2e[_0xaed0('0x1b')]?_0x3c6b2e['options'][_0xaed0('0x1d')]||null:null,'limit':_0x3c6b2e[_0xaed0('0x1b')]?_0x3c6b2e[_0xaed0('0x1b')][_0xaed0('0x1e')]||null:null})[_0xaed0('0x26')](function(_0x4bada5){logger[_0xaed0('0xd')](_0xaed0('0x27'),_0x3c6b2e);logger['debug']('UpdateVoiceCallReport',_0x3c6b2e,JSON[_0xaed0('0x12')](_0x4bada5));_0xb4c9e3(_0x4bada5);})['catch'](function(_0x3061f7){logger['error'](_0xaed0('0x27'),_0x3061f7[_0xaed0('0x15')],_0x3c6b2e);_0x359a76(_0x1a6b8a[_0xaed0('0x13')](0x1f4,_0x3061f7[_0xaed0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index a14afd5..1d81179 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 _0x88de=['isAuthenticated','index','/:id','post','create','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0x88de,0x177));var _0xe88d=function(_0x4424d6,_0x6fcfb1){_0x4424d6=_0x4424d6-0x0;var _0x39c48e=_0x88de[_0x4424d6];return _0x39c48e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe88d('0x0'));var timeout=require(_0xe88d('0x1'));var express=require(_0xe88d('0x2'));var router=express[_0xe88d('0x3')]();var fs_extra=require(_0xe88d('0x4'));var auth=require(_0xe88d('0x5'));var interaction=require(_0xe88d('0x6'));var config=require('../../config/environment');var controller=require(_0xe88d('0x7'));router[_0xe88d('0x8')]('/',auth[_0xe88d('0x9')](),controller[_0xe88d('0xa')]);router['get'](_0xe88d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe88d('0xc')]('/',auth['isAuthenticated'](),controller[_0xe88d('0xd')]);router['put'](_0xe88d('0xb'),auth[_0xe88d('0x9')](),controller[_0xe88d('0xe')]);router['delete'](_0xe88d('0xb'),auth[_0xe88d('0x9')](),controller['destroy']);module[_0xe88d('0xf')]=router; \ No newline at end of file +var _0x25a8=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1e430f,_0x100317){var _0x450def=function(_0x477fc8){while(--_0x477fc8){_0x1e430f['push'](_0x1e430f['shift']());}};_0x450def(++_0x100317);}(_0x25a8,0xcb));var _0x825a=function(_0x519527,_0x47486e){_0x519527=_0x519527-0x0;var _0x5c9599=_0x25a8[_0x519527];return _0x5c9599;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x825a('0x0'));var timeout=require(_0x825a('0x1'));var express=require(_0x825a('0x2'));var router=express[_0x825a('0x3')]();var fs_extra=require(_0x825a('0x4'));var auth=require(_0x825a('0x5'));var interaction=require(_0x825a('0x6'));var config=require(_0x825a('0x7'));var controller=require(_0x825a('0x8'));router[_0x825a('0x9')]('/',auth[_0x825a('0xa')](),controller[_0x825a('0xb')]);router[_0x825a('0x9')](_0x825a('0xc'),auth[_0x825a('0xa')](),controller[_0x825a('0xd')]);router[_0x825a('0xe')]('/',auth[_0x825a('0xa')](),controller['create']);router[_0x825a('0xf')](_0x825a('0xc'),auth[_0x825a('0xa')](),controller[_0x825a('0x10')]);router['delete'](_0x825a('0xc'),auth[_0x825a('0xa')](),controller[_0x825a('0x11')]);module[_0x825a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 74b48f3..57f14e6 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 _0xbbe2=['exports','STRING','name','setDataValue','options','BOOLEAN','sequelize'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0xbbe2,0x1f0));var _0x2bbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbe2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2bbe('0x0'));module[_0x2bbe('0x1')]={'name':{'type':Sequelize[_0x2bbe('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x2bbe('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x2bbe('0x2')],'set':function(_0x500d4c){this[_0x2bbe('0x4')](_0x2bbe('0x5'),_0x500d4c?_0x500d4c['join'](''):[]);},'get':function(){return this['getDataValue'](_0x2bbe('0x5'))?this['getDataValue']('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x2bbe('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x2bbe('0x2')]},'record':{'type':Sequelize[_0x2bbe('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5da4=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0xed7db3,_0x17d1f4){var _0xce55d2=function(_0x18dde0){while(--_0x18dde0){_0xed7db3['push'](_0xed7db3['shift']());}};_0xce55d2(++_0x17d1f4);}(_0x5da4,0xdb));var _0x45da=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x5da4[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x45da('0x0'));module[_0x45da('0x1')]={'name':{'type':Sequelize[_0x45da('0x2')]},'prefix':{'type':Sequelize[_0x45da('0x2')],'unique':_0x45da('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x4c1652){this[_0x45da('0x4')](_0x45da('0x5'),_0x4c1652?_0x4c1652['join'](''):[]);},'get':function(){return this[_0x45da('0x6')]('options')?this['getDataValue'](_0x45da('0x5'))[_0x45da('0x7')](''):[];}},'auth':{'type':Sequelize[_0x45da('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x45da('0x2')]},'record':{'type':Sequelize[_0x45da('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x45da('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 60dddb1..c4590d7 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 _0x79d8=['attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','params','rawAttributes','options','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','ChanSpies','UserProfileResource','error','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x12c32c,_0x13af3b){var _0x39b809=function(_0x278d4e){while(--_0x278d4e){_0x12c32c['push'](_0x12c32c['shift']());}};_0x39b809(++_0x13af3b);}(_0x79d8,0x67));var _0x879d=function(_0x388e12,_0x4da67d){_0x388e12=_0x388e12-0x0;var _0x5c93fa=_0x79d8[_0x388e12];return _0x5c93fa;};'use strict';var emlformat=require(_0x879d('0x0'));var rimraf=require(_0x879d('0x1'));var zipdir=require(_0x879d('0x2'));var jsonpatch=require(_0x879d('0x3'));var rp=require('request-promise');var moment=require(_0x879d('0x4'));var BPromise=require(_0x879d('0x5'));var Mustache=require('mustache');var util=require(_0x879d('0x6'));var path=require(_0x879d('0x7'));var sox=require(_0x879d('0x8'));var csv=require('to-csv');var ejs=require(_0x879d('0x9'));var fs=require('fs');var fs_extra=require(_0x879d('0xa'));var _=require(_0x879d('0xb'));var squel=require(_0x879d('0xc'));var crypto=require('crypto');var jsforce=require(_0x879d('0xd'));var deskjs=require(_0x879d('0xe'));var toCsv=require(_0x879d('0xf'));var querystring=require(_0x879d('0x10'));var Papa=require(_0x879d('0x11'));var Redis=require('ioredis');var authService=require(_0x879d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879d('0x13'));var logger=require(_0x879d('0x14'))(_0x879d('0x15'));var utils=require('../../config/utils');var config=require(_0x879d('0x16'));var licenseUtil=require(_0x879d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27b087,_0x444fd0){_0x444fd0=_0x444fd0||0xcc;return function(_0x522926){if(_0x522926){return _0x27b087[_0x879d('0x18')](_0x444fd0);}return _0x27b087['status'](_0x444fd0)[_0x879d('0x19')]();};}function respondWithResult(_0x143e90,_0x28d5cf){_0x28d5cf=_0x28d5cf||0xc8;return function(_0x24e775){if(_0x24e775){return _0x143e90[_0x879d('0x1a')](_0x28d5cf)[_0x879d('0x1b')](_0x24e775);}};}function respondWithFilteredResult(_0x53dcdc,_0x575001){return function(_0x419401){if(_0x419401){var _0x175dfe=typeof _0x575001['offset']==='undefined'&&typeof _0x575001[_0x879d('0x1c')]===_0x879d('0x1d');var _0x3a7259=_0x419401[_0x879d('0x1e')];var _0x3a26e5=_0x175dfe?0x0:_0x575001[_0x879d('0x1f')];var _0x291c96=_0x175dfe?_0x419401['count']:_0x575001['offset']+_0x575001[_0x879d('0x1c')];var _0x54ae71;if(_0x291c96>=_0x3a7259){_0x291c96=_0x3a7259;_0x54ae71=0xc8;}else{_0x54ae71=0xce;}_0x53dcdc[_0x879d('0x1a')](_0x54ae71);return _0x53dcdc['set'](_0x879d('0x20'),_0x3a26e5+'-'+_0x291c96+'/'+_0x3a7259)[_0x879d('0x1b')](_0x419401);}return null;};}function patchUpdates(_0x31e5d5){return function(_0x2dba72){try{jsonpatch[_0x879d('0x21')](_0x2dba72,_0x31e5d5,!![]);}catch(_0x8b5d31){return BPromise[_0x879d('0x22')](_0x8b5d31);}return _0x2dba72['save']();};}function saveUpdates(_0x271e9b,_0x460020){return function(_0x237179){if(_0x237179){return _0x237179[_0x879d('0x23')](_0x271e9b)[_0x879d('0x24')](function(_0x8f0543){return _0x8f0543;});}return null;};}function removeEntity(_0x4fae0c,_0x18e3aa){return function(_0x4a0559){if(_0x4a0559){return _0x4a0559[_0x879d('0x25')]()[_0x879d('0x24')](function(){var _0x396a85=_0x4a0559['get']({'plain':!![]});var _0x39d838=_0x879d('0x26');return db[_0x879d('0x27')][_0x879d('0x25')]({'where':{'type':_0x39d838,'resourceId':_0x396a85['id']}})[_0x879d('0x24')](function(){return _0x4a0559;});})['then'](function(){_0x4fae0c['status'](0xcc)[_0x879d('0x19')]();});}};}function handleEntityNotFound(_0x20f777,_0x5480c7){return function(_0x4bc342){if(!_0x4bc342){_0x20f777[_0x879d('0x18')](0x194);}return _0x4bc342;};}function handleError(_0x1b3b96,_0x7a7d51){_0x7a7d51=_0x7a7d51||0x1f4;return function(_0x2c4510){logger[_0x879d('0x28')](_0x2c4510['stack']);if(_0x2c4510['name']){delete _0x2c4510[_0x879d('0x29')];}_0x1b3b96[_0x879d('0x1a')](_0x7a7d51)[_0x879d('0x2a')](_0x2c4510);};}exports[_0x879d('0x2b')]=function(_0x5d7683,_0x344101){var _0x15dc14={},_0x338e87={},_0x531ca9={'count':0x0,'rows':[]};var _0xfaff1c=_[_0x879d('0x2c')](db[_0x879d('0x2d')]['rawAttributes'],function(_0x1a1230){return{'name':_0x1a1230[_0x879d('0x2e')],'type':_0x1a1230[_0x879d('0x2f')][_0x879d('0x30')]};});_0x338e87[_0x879d('0x31')]=_[_0x879d('0x2c')](_0xfaff1c,_0x879d('0x29'));_0x338e87[_0x879d('0x32')]=_[_0x879d('0x33')](_0x5d7683[_0x879d('0x32')]);_0x338e87[_0x879d('0x34')]=_[_0x879d('0x35')](_0x338e87[_0x879d('0x31')],_0x338e87[_0x879d('0x32')]);_0x15dc14['attributes']=_[_0x879d('0x35')](_0x338e87[_0x879d('0x31')],qs[_0x879d('0x36')](_0x5d7683['query'][_0x879d('0x36')]));_0x15dc14[_0x879d('0x37')]=_0x15dc14['attributes'][_0x879d('0x38')]?_0x15dc14[_0x879d('0x37')]:_0x338e87[_0x879d('0x31')];if(!_0x5d7683[_0x879d('0x32')]['hasOwnProperty'](_0x879d('0x39'))){_0x15dc14[_0x879d('0x1c')]=qs[_0x879d('0x1c')](_0x5d7683['query'][_0x879d('0x1c')]);_0x15dc14[_0x879d('0x1f')]=qs[_0x879d('0x1f')](_0x5d7683[_0x879d('0x32')][_0x879d('0x1f')]);}_0x15dc14[_0x879d('0x3a')]=qs[_0x879d('0x3b')](_0x5d7683[_0x879d('0x32')][_0x879d('0x3b')]);_0x15dc14[_0x879d('0x3c')]=qs['filters'](_['pick'](_0x5d7683[_0x879d('0x32')],_0x338e87[_0x879d('0x34')]),_0xfaff1c);if(_0x5d7683['query'][_0x879d('0x3d')]){_0x15dc14['where']=_['merge'](_0x15dc14[_0x879d('0x3c')],{'$or':_['map'](_0xfaff1c,function(_0x445e5a){if(_0x445e5a[_0x879d('0x2f')]!==_0x879d('0x3e')){var _0x594e89={};_0x594e89[_0x445e5a[_0x879d('0x29')]]={'$like':'%'+_0x5d7683[_0x879d('0x32')][_0x879d('0x3d')]+'%'};return _0x594e89;}})});}_0x15dc14=_[_0x879d('0x3f')]({},_0x15dc14,_0x5d7683['options']);var _0x2c04c2={'where':_0x15dc14['where']};return db[_0x879d('0x2d')][_0x879d('0x1e')](_0x2c04c2)[_0x879d('0x24')](function(_0x37c4a2){_0x531ca9[_0x879d('0x1e')]=_0x37c4a2;if(_0x5d7683[_0x879d('0x32')][_0x879d('0x40')]){_0x15dc14['include']=[{'all':!![]}];}return db[_0x879d('0x2d')][_0x879d('0x41')](_0x15dc14);})[_0x879d('0x24')](function(_0x3110ff){_0x531ca9[_0x879d('0x42')]=_0x3110ff;return _0x531ca9;})[_0x879d('0x24')](respondWithFilteredResult(_0x344101,_0x15dc14))[_0x879d('0x43')](handleError(_0x344101,null));};exports['show']=function(_0x50e6ab,_0x35dd8f){var _0x30f744={'raw':![],'where':{'id':_0x50e6ab[_0x879d('0x44')]['id']}},_0x2c4da8={};_0x2c4da8[_0x879d('0x31')]=_['keys'](db[_0x879d('0x2d')][_0x879d('0x45')]);_0x2c4da8[_0x879d('0x32')]=_[_0x879d('0x33')](_0x50e6ab[_0x879d('0x32')]);_0x2c4da8[_0x879d('0x34')]=_['intersection'](_0x2c4da8[_0x879d('0x31')],_0x2c4da8[_0x879d('0x32')]);_0x30f744['attributes']=_[_0x879d('0x35')](_0x2c4da8['model'],qs['fields'](_0x50e6ab[_0x879d('0x32')][_0x879d('0x36')]));_0x30f744[_0x879d('0x37')]=_0x30f744[_0x879d('0x37')][_0x879d('0x38')]?_0x30f744[_0x879d('0x37')]:_0x2c4da8[_0x879d('0x31')];if(_0x50e6ab['query']['includeAll']){_0x30f744['include']=[{'all':!![]}];}_0x30f744=_[_0x879d('0x3f')]({},_0x30f744,_0x50e6ab[_0x879d('0x46')]);return db[_0x879d('0x2d')][_0x879d('0x47')](_0x30f744)[_0x879d('0x24')](handleEntityNotFound(_0x35dd8f,null))[_0x879d('0x24')](respondWithResult(_0x35dd8f,null))['catch'](handleError(_0x35dd8f,null));};exports[_0x879d('0x48')]=function(_0x5052f9,_0x6b3162){return db['VoiceChanSpy'][_0x879d('0x48')](_0x5052f9[_0x879d('0x49')],{})[_0x879d('0x24')](function(_0x1951fd){var _0x1a3eb4=_0x5052f9[_0x879d('0x4a')][_0x879d('0x4b')]({'plain':!![]});if(!_0x1a3eb4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a3eb4['role']===_0x879d('0x4a')){var _0x42c904=_0x1951fd[_0x879d('0x4b')]({'plain':!![]});var _0x1c6ac8=_0x879d('0x26');return db[_0x879d('0x4c')][_0x879d('0x47')]({'where':{'name':_0x1c6ac8,'userProfileId':_0x1a3eb4[_0x879d('0x4d')]},'raw':!![]})['then'](function(_0x336ef9){if(_0x336ef9&&_0x336ef9[_0x879d('0x4e')]===0x0){return db['UserProfileResource'][_0x879d('0x48')]({'name':_0x42c904[_0x879d('0x29')],'resourceId':_0x42c904['id'],'type':_0x336ef9[_0x879d('0x29')],'sectionId':_0x336ef9['id']},{})[_0x879d('0x24')](function(){return _0x1951fd;});}else{return _0x1951fd;}})['catch'](function(_0x58e9aa){logger[_0x879d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58e9aa);throw _0x58e9aa;});}return _0x1951fd;})['then'](respondWithResult(_0x6b3162,0xc9))[_0x879d('0x43')](handleError(_0x6b3162,null));};exports[_0x879d('0x23')]=function(_0x1743a5,_0x59f317){if(_0x1743a5[_0x879d('0x49')]['id']){delete _0x1743a5[_0x879d('0x49')]['id'];}return db['VoiceChanSpy'][_0x879d('0x47')]({'where':{'id':_0x1743a5[_0x879d('0x44')]['id']}})['then'](handleEntityNotFound(_0x59f317,null))[_0x879d('0x24')](saveUpdates(_0x1743a5['body'],null))[_0x879d('0x24')](respondWithResult(_0x59f317,null))['catch'](handleError(_0x59f317,null));};exports[_0x879d('0x25')]=function(_0x510a21,_0x2080b){return db[_0x879d('0x2d')][_0x879d('0x47')]({'where':{'id':_0x510a21[_0x879d('0x44')]['id']}})[_0x879d('0x24')](handleEntityNotFound(_0x2080b,null))[_0x879d('0x24')](removeEntity(_0x2080b,null))['catch'](handleError(_0x2080b,null));}; \ No newline at end of file +var _0x65b3=['query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','find','create','user','get','userProfileId','autoAssociation','catch','error','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','end','sendStatus','stack','name','send','index','VoiceChanSpy','rawAttributes','key','model'];(function(_0x2f36af,_0x3fd8b1){var _0x365c00=function(_0x5b1c3e){while(--_0x5b1c3e){_0x2f36af['push'](_0x2f36af['shift']());}};_0x365c00(++_0x3fd8b1);}(_0x65b3,0xc6));var _0x365b=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x65b3[_0x5ac84c];return _0x3c53d2;};'use strict';var emlformat=require(_0x365b('0x0'));var rimraf=require(_0x365b('0x1'));var zipdir=require(_0x365b('0x2'));var jsonpatch=require(_0x365b('0x3'));var rp=require(_0x365b('0x4'));var moment=require(_0x365b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x365b('0x6'));var util=require(_0x365b('0x7'));var path=require(_0x365b('0x8'));var sox=require('sox');var csv=require(_0x365b('0x9'));var ejs=require(_0x365b('0xa'));var fs=require('fs');var fs_extra=require(_0x365b('0xb'));var _=require('lodash');var squel=require(_0x365b('0xc'));var crypto=require(_0x365b('0xd'));var jsforce=require(_0x365b('0xe'));var deskjs=require(_0x365b('0xf'));var toCsv=require(_0x365b('0x9'));var querystring=require('querystring');var Papa=require(_0x365b('0x10'));var Redis=require(_0x365b('0x11'));var authService=require(_0x365b('0x12'));var qs=require(_0x365b('0x13'));var as=require(_0x365b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x365b('0x15'))(_0x365b('0x16'));var utils=require(_0x365b('0x17'));var config=require(_0x365b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d47f,_0x14ed59){_0x14ed59=_0x14ed59||0xcc;return function(_0x3b4127){if(_0x3b4127){return _0x10d47f['sendStatus'](_0x14ed59);}return _0x10d47f[_0x365b('0x19')](_0x14ed59)['end']();};}function respondWithResult(_0x3fa3e6,_0x40fa13){_0x40fa13=_0x40fa13||0xc8;return function(_0x8538f6){if(_0x8538f6){return _0x3fa3e6[_0x365b('0x19')](_0x40fa13)[_0x365b('0x1a')](_0x8538f6);}};}function respondWithFilteredResult(_0x3af95f,_0x2813df){return function(_0x248c4e){if(_0x248c4e){var _0x1e93d9=typeof _0x2813df[_0x365b('0x1b')]===_0x365b('0x1c')&&typeof _0x2813df[_0x365b('0x1d')]===_0x365b('0x1c');var _0x12e560=_0x248c4e[_0x365b('0x1e')];var _0x1cf7a3=_0x1e93d9?0x0:_0x2813df[_0x365b('0x1b')];var _0x2ac7ba=_0x1e93d9?_0x248c4e[_0x365b('0x1e')]:_0x2813df['offset']+_0x2813df[_0x365b('0x1d')];var _0x5b9eea;if(_0x2ac7ba>=_0x12e560){_0x2ac7ba=_0x12e560;_0x5b9eea=0xc8;}else{_0x5b9eea=0xce;}_0x3af95f[_0x365b('0x19')](_0x5b9eea);return _0x3af95f[_0x365b('0x1f')](_0x365b('0x20'),_0x1cf7a3+'-'+_0x2ac7ba+'/'+_0x12e560)[_0x365b('0x1a')](_0x248c4e);}return null;};}function patchUpdates(_0x16dc0e){return function(_0x27db06){try{jsonpatch[_0x365b('0x21')](_0x27db06,_0x16dc0e,!![]);}catch(_0xe49b2b){return BPromise[_0x365b('0x22')](_0xe49b2b);}return _0x27db06[_0x365b('0x23')]();};}function saveUpdates(_0x252ff0,_0x53f762){return function(_0x2b8122){if(_0x2b8122){return _0x2b8122[_0x365b('0x24')](_0x252ff0)[_0x365b('0x25')](function(_0x105d3a){return _0x105d3a;});}return null;};}function removeEntity(_0x537085,_0x3b1e18){return function(_0x39c6ac){if(_0x39c6ac){return _0x39c6ac[_0x365b('0x26')]()[_0x365b('0x25')](function(){var _0x265e83=_0x39c6ac['get']({'plain':!![]});var _0x31cea5=_0x365b('0x27');return db[_0x365b('0x28')]['destroy']({'where':{'type':_0x31cea5,'resourceId':_0x265e83['id']}})[_0x365b('0x25')](function(){return _0x39c6ac;});})[_0x365b('0x25')](function(){_0x537085[_0x365b('0x19')](0xcc)[_0x365b('0x29')]();});}};}function handleEntityNotFound(_0x446e55,_0x8b9b5c){return function(_0xdb347c){if(!_0xdb347c){_0x446e55[_0x365b('0x2a')](0x194);}return _0xdb347c;};}function handleError(_0x1d3499,_0x5bee92){_0x5bee92=_0x5bee92||0x1f4;return function(_0x2f79bc){logger['error'](_0x2f79bc[_0x365b('0x2b')]);if(_0x2f79bc[_0x365b('0x2c')]){delete _0x2f79bc['name'];}_0x1d3499[_0x365b('0x19')](_0x5bee92)[_0x365b('0x2d')](_0x2f79bc);};}exports[_0x365b('0x2e')]=function(_0x5a3b25,_0x5db320){var _0x319a72={},_0x80fb3f={},_0x41c86c={'count':0x0,'rows':[]};var _0x162356=_['map'](db[_0x365b('0x2f')][_0x365b('0x30')],function(_0x44d845){return{'name':_0x44d845['fieldName'],'type':_0x44d845['type'][_0x365b('0x31')]};});_0x80fb3f[_0x365b('0x32')]=_['map'](_0x162356,_0x365b('0x2c'));_0x80fb3f['query']=_['keys'](_0x5a3b25[_0x365b('0x33')]);_0x80fb3f['filters']=_['intersection'](_0x80fb3f[_0x365b('0x32')],_0x80fb3f[_0x365b('0x33')]);_0x319a72[_0x365b('0x34')]=_[_0x365b('0x35')](_0x80fb3f['model'],qs[_0x365b('0x36')](_0x5a3b25[_0x365b('0x33')][_0x365b('0x36')]));_0x319a72['attributes']=_0x319a72['attributes'][_0x365b('0x37')]?_0x319a72[_0x365b('0x34')]:_0x80fb3f['model'];if(!_0x5a3b25['query'][_0x365b('0x38')]('nolimit')){_0x319a72['limit']=qs[_0x365b('0x1d')](_0x5a3b25[_0x365b('0x33')][_0x365b('0x1d')]);_0x319a72[_0x365b('0x1b')]=qs[_0x365b('0x1b')](_0x5a3b25[_0x365b('0x33')][_0x365b('0x1b')]);}_0x319a72[_0x365b('0x39')]=qs[_0x365b('0x3a')](_0x5a3b25[_0x365b('0x33')]['sort']);_0x319a72[_0x365b('0x3b')]=qs[_0x365b('0x3c')](_[_0x365b('0x3d')](_0x5a3b25['query'],_0x80fb3f[_0x365b('0x3c')]),_0x162356);if(_0x5a3b25[_0x365b('0x33')]['filter']){_0x319a72['where']=_[_0x365b('0x3e')](_0x319a72[_0x365b('0x3b')],{'$or':_[_0x365b('0x3f')](_0x162356,function(_0x2a4afd){if(_0x2a4afd[_0x365b('0x40')]!==_0x365b('0x41')){var _0x5b2d50={};_0x5b2d50[_0x2a4afd[_0x365b('0x2c')]]={'$like':'%'+_0x5a3b25[_0x365b('0x33')][_0x365b('0x42')]+'%'};return _0x5b2d50;}})});}_0x319a72=_['merge']({},_0x319a72,_0x5a3b25[_0x365b('0x43')]);var _0x2ba36c={'where':_0x319a72[_0x365b('0x3b')]};return db['VoiceChanSpy'][_0x365b('0x1e')](_0x2ba36c)[_0x365b('0x25')](function(_0x489bd6){_0x41c86c[_0x365b('0x1e')]=_0x489bd6;if(_0x5a3b25['query'][_0x365b('0x44')]){_0x319a72[_0x365b('0x45')]=[{'all':!![]}];}return db[_0x365b('0x2f')]['findAll'](_0x319a72);})[_0x365b('0x25')](function(_0x4f8905){_0x41c86c[_0x365b('0x46')]=_0x4f8905;return _0x41c86c;})[_0x365b('0x25')](respondWithFilteredResult(_0x5db320,_0x319a72))['catch'](handleError(_0x5db320,null));};exports[_0x365b('0x47')]=function(_0x38f416,_0x3d9173){var _0x172bd0={'raw':![],'where':{'id':_0x38f416[_0x365b('0x48')]['id']}},_0x54bc52={};_0x54bc52[_0x365b('0x32')]=_[_0x365b('0x49')](db[_0x365b('0x2f')]['rawAttributes']);_0x54bc52['query']=_[_0x365b('0x49')](_0x38f416[_0x365b('0x33')]);_0x54bc52['filters']=_[_0x365b('0x35')](_0x54bc52['model'],_0x54bc52[_0x365b('0x33')]);_0x172bd0['attributes']=_[_0x365b('0x35')](_0x54bc52[_0x365b('0x32')],qs['fields'](_0x38f416[_0x365b('0x33')][_0x365b('0x36')]));_0x172bd0[_0x365b('0x34')]=_0x172bd0[_0x365b('0x34')][_0x365b('0x37')]?_0x172bd0['attributes']:_0x54bc52['model'];if(_0x38f416[_0x365b('0x33')][_0x365b('0x44')]){_0x172bd0['include']=[{'all':!![]}];}_0x172bd0=_[_0x365b('0x3e')]({},_0x172bd0,_0x38f416['options']);return db[_0x365b('0x2f')][_0x365b('0x4a')](_0x172bd0)[_0x365b('0x25')](handleEntityNotFound(_0x3d9173,null))[_0x365b('0x25')](respondWithResult(_0x3d9173,null))['catch'](handleError(_0x3d9173,null));};exports[_0x365b('0x4b')]=function(_0x48fee5,_0x1f13d5){return db[_0x365b('0x2f')][_0x365b('0x4b')](_0x48fee5['body'],{})['then'](function(_0x268186){var _0x42ef50=_0x48fee5[_0x365b('0x4c')][_0x365b('0x4d')]({'plain':!![]});if(!_0x42ef50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42ef50['role']===_0x365b('0x4c')){var _0x2097d1=_0x268186[_0x365b('0x4d')]({'plain':!![]});var _0x3d55a9='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x3d55a9,'userProfileId':_0x42ef50[_0x365b('0x4e')]},'raw':!![]})[_0x365b('0x25')](function(_0x438e1c){if(_0x438e1c&&_0x438e1c[_0x365b('0x4f')]===0x0){return db['UserProfileResource'][_0x365b('0x4b')]({'name':_0x2097d1[_0x365b('0x2c')],'resourceId':_0x2097d1['id'],'type':_0x438e1c[_0x365b('0x2c')],'sectionId':_0x438e1c['id']},{})[_0x365b('0x25')](function(){return _0x268186;});}else{return _0x268186;}})[_0x365b('0x50')](function(_0x58bad1){logger[_0x365b('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58bad1);throw _0x58bad1;});}return _0x268186;})['then'](respondWithResult(_0x1f13d5,0xc9))[_0x365b('0x50')](handleError(_0x1f13d5,null));};exports['update']=function(_0x78d2c9,_0x6f8194){if(_0x78d2c9[_0x365b('0x52')]['id']){delete _0x78d2c9[_0x365b('0x52')]['id'];}return db[_0x365b('0x2f')][_0x365b('0x4a')]({'where':{'id':_0x78d2c9[_0x365b('0x48')]['id']}})[_0x365b('0x25')](handleEntityNotFound(_0x6f8194,null))[_0x365b('0x25')](saveUpdates(_0x78d2c9[_0x365b('0x52')],null))[_0x365b('0x25')](respondWithResult(_0x6f8194,null))['catch'](handleError(_0x6f8194,null));};exports[_0x365b('0x26')]=function(_0xf49b5c,_0x2c4b3b){return db[_0x365b('0x2f')][_0x365b('0x4a')]({'where':{'id':_0xf49b5c[_0x365b('0x48')]['id']}})[_0x365b('0x25')](handleEntityNotFound(_0x2c4b3b,null))[_0x365b('0x25')](removeEntity(_0x2c4b3b,null))[_0x365b('0x50')](handleError(_0x2c4b3b,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 013326b..9f60696 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 _0x1a4f=['options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','length','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','name'];(function(_0x1f3ffb,_0xa7ee17){var _0x56bf3c=function(_0x39e3ac){while(--_0x39e3ac){_0x1f3ffb['push'](_0x1f3ffb['shift']());}};_0x56bf3c(++_0xa7ee17);}(_0x1a4f,0x1da));var _0xf1a4=function(_0x3fb4fc,_0x1b0be8){_0x3fb4fc=_0x3fb4fc-0x0;var _0x45cc9a=_0x1a4f[_0x3fb4fc];return _0x45cc9a;};'use strict';var _=require(_0xf1a4('0x0'));var util=require(_0xf1a4('0x1'));var BPromise=require(_0xf1a4('0x2'));var attributes=require(_0xf1a4('0x3'));var getUserApplications=function(_0x276cad,_0x2b8b99,_0x22a5f1){var _0x3525a3=0x1;var _0x2a5bf4=[];var _0x454c56={'context':_0x2b8b99[_0xf1a4('0x4')]||_0xf1a4('0x5'),'exten':util[_0xf1a4('0x6')](_0xf1a4('0x7'),_0x276cad[_0xf1a4('0x8')],_0x22a5f1),'type':_0xf1a4('0x9'),'isApp':![],'ChanSpyId':_0x276cad['id'],'UserId':_0x2b8b99['id']};_0x2a5bf4[_0xf1a4('0xa')](_[_0xf1a4('0xb')]({'app':'Set','appdata':util[_0xf1a4('0x6')]('CDR(type)=%s','chanspy'),'priority':_0x3525a3++},_0x454c56));if(_0x276cad[_0xf1a4('0xc')]){_0x2a5bf4[_0xf1a4('0xa')](_[_0xf1a4('0xb')]({'app':_0xf1a4('0xd'),'appdata':util[_0xf1a4('0x6')](_0xf1a4('0xe'),_0x276cad[_0xf1a4('0xf')]),'priority':_0x3525a3++},_0x454c56));}if(_0x276cad[_0xf1a4('0x10')]){_0x2a5bf4[_0xf1a4('0xa')](_[_0xf1a4('0xb')]({'app':_0xf1a4('0x11'),'appdata':_0x276cad['password'],'priority':_0x3525a3++},_0x454c56));}_0x2a5bf4[_0xf1a4('0xa')](_['merge']({'app':_0xf1a4('0x12'),'appdata':util[_0xf1a4('0x6')]('SIP/%s,%s',_0x2b8b99[_0xf1a4('0x13')],_0x276cad['options']?_0x276cad[_0xf1a4('0x14')][_0xf1a4('0x15')](''):''),'priority':_0x3525a3++},_0x454c56));if(_0x276cad[_0xf1a4('0xc')]){_0x2a5bf4[_0xf1a4('0xa')](_[_0xf1a4('0xb')]({'app':_0xf1a4('0x16'),'priority':_0x3525a3++},_0x454c56));}return _0x2a5bf4;};var getChanSpyApplications=function(_0x21df83,_0x943cd9){var _0x2f6ca2=[];for(var _0x3e6e14=0x0,_0x1259cd=0x1;_0x3e6e14<_0x943cd9['length'];_0x3e6e14++,_0x1259cd=0x1){_0x2f6ca2=_0x2f6ca2[_0xf1a4('0x17')](getUserApplications(_0x21df83,_0x943cd9[_0x3e6e14],_0x943cd9[_0x3e6e14][_0xf1a4('0x18')]));if(_0x943cd9[_0x3e6e14][_0xf1a4('0x18')]!=_0x943cd9[_0x3e6e14][_0xf1a4('0x13')]){_0x2f6ca2=_0x2f6ca2[_0xf1a4('0x17')](getUserApplications(_0x21df83,_0x943cd9[_0x3e6e14],_0x943cd9[_0x3e6e14][_0xf1a4('0x13')]));}}return _0x2f6ca2;};var getChanSpyPromise=function(_0x2e71ff,_0x2503bc){return new BPromise(function(_0x220e39,_0x8b139f){return _0x2e71ff[_0xf1a4('0x19')][_0xf1a4('0x1a')]({'attributes':['id',_0xf1a4('0x13'),_0xf1a4('0x18')],'where':{'role':_0xf1a4('0x1b'),'chanspy':!![]},'raw':!![]})[_0xf1a4('0x1c')](function(_0x36d6c8){if(_0x36d6c8){return _0x220e39(getChanSpyApplications(_0x2503bc,_0x36d6c8));}return _0x220e39([]);})[_0xf1a4('0x1d')](function(_0x556486){_0x8b139f(_0x556486);});});};module[_0xf1a4('0x1e')]=function(_0x443ff0,_0x6ef6b3){var _0x3a97bf=_0x443ff0[_0xf1a4('0x1f')];return _0x443ff0[_0xf1a4('0x20')](_0xf1a4('0x21'),attributes,{'tableName':_0xf1a4('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bbefc,_0x542ddd,_0x2f03d9){return getChanSpyPromise(_0x3a97bf,_0x5bbefc)['then'](function(_0x7f94c4){if(_0x7f94c4&&_0x7f94c4['length']){return _0x3a97bf['VoiceExtension'][_0xf1a4('0x23')](_0x7f94c4);}})[_0xf1a4('0x1c')](function(){_0x2f03d9();})[_0xf1a4('0x1d')](function(_0x19be5d){_0x2f03d9(_0x19be5d);});},'afterUpdate':function(_0x226ff5,_0x445522,_0x1cdc3a){return _0x3a97bf[_0xf1a4('0x24')]['destroy']({'where':{'ChanSpyId':_0x226ff5['id']}})['then'](function(){return getChanSpyPromise(_0x3a97bf,_0x226ff5);})[_0xf1a4('0x1c')](function(_0x99eb61){if(_0x99eb61&&_0x99eb61[_0xf1a4('0x25')]){return _0x3a97bf[_0xf1a4('0x24')][_0xf1a4('0x23')](_0x99eb61);}})['then'](function(){_0x1cdc3a();})[_0xf1a4('0x1d')](function(_0x281d2d){_0x1cdc3a(_0x281d2d);});},'afterDestroy':function(_0xf236aa,_0x351415,_0x1c65cc){return _0x3a97bf['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0xf236aa['id']}})['then'](function(){_0x1c65cc();})[_0xf1a4('0x1d')](function(_0x40df4e){_0x1c65cc(_0x40df4e);});}}});}; \ No newline at end of file +var _0x9e55=['bulkCreate','catch','destroy','lodash','util','bluebird','context','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','SIP/%s,%s','name','options','join','StopMixMonitor','concat','User','findAll','internal','then','exports','models','define','VoiceChanSpy','length','VoiceExtension'];(function(_0x5dee5b,_0x33e546){var _0x3cdd07=function(_0x58cb7a){while(--_0x58cb7a){_0x5dee5b['push'](_0x5dee5b['shift']());}};_0x3cdd07(++_0x33e546);}(_0x9e55,0x13e));var _0x59e5=function(_0x3671b9,_0x32b401){_0x3671b9=_0x3671b9-0x0;var _0x4f0148=_0x9e55[_0x3671b9];return _0x4f0148;};'use strict';var _=require(_0x59e5('0x0'));var util=require(_0x59e5('0x1'));var BPromise=require(_0x59e5('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x54295b,_0x37affa,_0x51933b){var _0x18d85b=0x1;var _0x402933=[];var _0x340b5f={'context':_0x37affa[_0x59e5('0x3')]||'from-sip','exten':util['format'](_0x59e5('0x4'),_0x54295b[_0x59e5('0x5')],_0x51933b),'type':_0x59e5('0x6'),'isApp':![],'ChanSpyId':_0x54295b['id'],'UserId':_0x37affa['id']};_0x402933[_0x59e5('0x7')](_[_0x59e5('0x8')]({'app':_0x59e5('0x9'),'appdata':util[_0x59e5('0xa')](_0x59e5('0xb'),_0x59e5('0xc')),'priority':_0x18d85b++},_0x340b5f));if(_0x54295b['record']){_0x402933[_0x59e5('0x7')](_[_0x59e5('0x8')]({'app':_0x59e5('0xd'),'appdata':util[_0x59e5('0xa')](_0x59e5('0xe'),_0x54295b[_0x59e5('0xf')]),'priority':_0x18d85b++},_0x340b5f));}if(_0x54295b['auth']){_0x402933[_0x59e5('0x7')](_[_0x59e5('0x8')]({'app':'Authenticate','appdata':_0x54295b['password'],'priority':_0x18d85b++},_0x340b5f));}_0x402933['push'](_[_0x59e5('0x8')]({'app':'ChanSpy','appdata':util[_0x59e5('0xa')](_0x59e5('0x10'),_0x37affa[_0x59e5('0x11')],_0x54295b[_0x59e5('0x12')]?_0x54295b['options'][_0x59e5('0x13')](''):''),'priority':_0x18d85b++},_0x340b5f));if(_0x54295b['record']){_0x402933[_0x59e5('0x7')](_[_0x59e5('0x8')]({'app':_0x59e5('0x14'),'priority':_0x18d85b++},_0x340b5f));}return _0x402933;};var getChanSpyApplications=function(_0x2868fc,_0x3faeb6){var _0x4452bc=[];for(var _0x1cdb28=0x0,_0x2d5ee7=0x1;_0x1cdb28<_0x3faeb6['length'];_0x1cdb28++,_0x2d5ee7=0x1){_0x4452bc=_0x4452bc['concat'](getUserApplications(_0x2868fc,_0x3faeb6[_0x1cdb28],_0x3faeb6[_0x1cdb28]['internal']));if(_0x3faeb6[_0x1cdb28]['internal']!=_0x3faeb6[_0x1cdb28][_0x59e5('0x11')]){_0x4452bc=_0x4452bc[_0x59e5('0x15')](getUserApplications(_0x2868fc,_0x3faeb6[_0x1cdb28],_0x3faeb6[_0x1cdb28][_0x59e5('0x11')]));}}return _0x4452bc;};var getChanSpyPromise=function(_0x1a34f6,_0x33b6f4){return new BPromise(function(_0x4a1975,_0x1c0ee6){return _0x1a34f6[_0x59e5('0x16')][_0x59e5('0x17')]({'attributes':['id',_0x59e5('0x11'),_0x59e5('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x59e5('0x19')](function(_0x34677c){if(_0x34677c){return _0x4a1975(getChanSpyApplications(_0x33b6f4,_0x34677c));}return _0x4a1975([]);})['catch'](function(_0x42d379){_0x1c0ee6(_0x42d379);});});};module[_0x59e5('0x1a')]=function(_0x5ca1c1,_0x20112c){var _0x1f60d2=_0x5ca1c1[_0x59e5('0x1b')];return _0x5ca1c1[_0x59e5('0x1c')](_0x59e5('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x276e78,_0x25dd81,_0x13c9b7){return getChanSpyPromise(_0x1f60d2,_0x276e78)[_0x59e5('0x19')](function(_0x49eb14){if(_0x49eb14&&_0x49eb14[_0x59e5('0x1e')]){return _0x1f60d2[_0x59e5('0x1f')][_0x59e5('0x20')](_0x49eb14);}})[_0x59e5('0x19')](function(){_0x13c9b7();})[_0x59e5('0x21')](function(_0x293b70){_0x13c9b7(_0x293b70);});},'afterUpdate':function(_0x4ba393,_0x51791c,_0x1bdbf3){return _0x1f60d2[_0x59e5('0x1f')][_0x59e5('0x22')]({'where':{'ChanSpyId':_0x4ba393['id']}})[_0x59e5('0x19')](function(){return getChanSpyPromise(_0x1f60d2,_0x4ba393);})[_0x59e5('0x19')](function(_0x8ccd1f){if(_0x8ccd1f&&_0x8ccd1f[_0x59e5('0x1e')]){return _0x1f60d2[_0x59e5('0x1f')][_0x59e5('0x20')](_0x8ccd1f);}})[_0x59e5('0x19')](function(){_0x1bdbf3();})['catch'](function(_0x376c42){_0x1bdbf3(_0x376c42);});},'afterDestroy':function(_0xf4182f,_0x2163b5,_0x13f3cf){return _0x1f60d2['VoiceExtension'][_0x59e5('0x22')]({'where':{'ChanSpyId':_0xf4182f['id']}})[_0x59e5('0x19')](function(){_0x13f3cf();})[_0x59e5('0x21')](function(_0x2fa37e){_0x13f3cf(_0x2fa37e);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2fc8875..077eaf3 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 _0x9b87=['error','code','VoiceChanSpy,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x20af18,_0x34385e){var _0x4f2359=function(_0x9ed322){while(--_0x9ed322){_0x20af18['push'](_0x20af18['shift']());}};_0x4f2359(++_0x34385e);}(_0x9b87,0x8e));var _0x79b8=function(_0x44e1c9,_0x6ca4ba){_0x44e1c9=_0x44e1c9-0x0;var _0xd147d6=_0x9b87[_0x44e1c9];return _0xd147d6;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var moment=require(_0x79b8('0x2'));var BPromise=require(_0x79b8('0x3'));var rs=require(_0x79b8('0x4'));var fs=require('fs');var Redis=require(_0x79b8('0x5'));var db=require(_0x79b8('0x6'))['db'];var utils=require(_0x79b8('0x7'));var logger=require(_0x79b8('0x8'))(_0x79b8('0x9'));var config=require(_0x79b8('0xa'));var jayson=require(_0x79b8('0xb'));var client=jayson[_0x79b8('0xc')][_0x79b8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d2c9f,_0xf5e0f2,_0x5e10fe){return new BPromise(function(_0x4e0dd8,_0x5c15d4){return client['request'](_0x1d2c9f,_0x5e10fe)[_0x79b8('0xe')](function(_0x317e29){logger[_0x79b8('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xf5e0f2,_0x79b8('0x10'));logger[_0x79b8('0x11')](_0x79b8('0x12'),_0xf5e0f2,'request\x20sent',JSON['stringify'](_0x317e29));if(_0x317e29[_0x79b8('0x13')]){if(_0x317e29[_0x79b8('0x13')][_0x79b8('0x14')]===0x1f4){logger[_0x79b8('0x13')](_0x79b8('0x15'),_0xf5e0f2,_0x317e29[_0x79b8('0x13')][_0x79b8('0x16')]);return _0x5c15d4(_0x317e29[_0x79b8('0x13')][_0x79b8('0x16')]);}logger[_0x79b8('0x13')](_0x79b8('0x15'),_0xf5e0f2,_0x317e29['error'][_0x79b8('0x16')]);return _0x4e0dd8(_0x317e29['error']['message']);}else{logger[_0x79b8('0xf')](_0x79b8('0x15'),_0xf5e0f2,_0x79b8('0x10'));_0x4e0dd8(_0x317e29['result'][_0x79b8('0x16')]);}})['catch'](function(_0x5ef869){logger[_0x79b8('0x13')](_0x79b8('0x15'),_0xf5e0f2,_0x5ef869);_0x5c15d4(_0x5ef869);});});} \ No newline at end of file +var _0xa25c=['message','VoiceChanSpy,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x286197,_0x4dac58){var _0x4e3b26=function(_0x208d63){while(--_0x208d63){_0x286197['push'](_0x286197['shift']());}};_0x4e3b26(++_0x4dac58);}(_0xa25c,0x13f));var _0xca25=function(_0x28bf5d,_0x4d2cfb){_0x28bf5d=_0x28bf5d-0x0;var _0x39a35c=_0xa25c[_0x28bf5d];return _0x39a35c;};'use strict';var _=require('lodash');var util=require(_0xca25('0x0'));var moment=require(_0xca25('0x1'));var BPromise=require(_0xca25('0x2'));var rs=require(_0xca25('0x3'));var fs=require('fs');var Redis=require(_0xca25('0x4'));var db=require(_0xca25('0x5'))['db'];var utils=require(_0xca25('0x6'));var logger=require(_0xca25('0x7'))('rpc');var config=require(_0xca25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xca25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e9352,_0xb2fc94,_0x3cee89){return new BPromise(function(_0x2c0b8c,_0x42a97a){return client[_0xca25('0xa')](_0x4e9352,_0x3cee89)['then'](function(_0x5d820c){logger[_0xca25('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0xb2fc94,_0xca25('0xc'));logger[_0xca25('0xd')](_0xca25('0xe'),_0xb2fc94,'request\x20sent',JSON['stringify'](_0x5d820c));if(_0x5d820c['error']){if(_0x5d820c[_0xca25('0xf')][_0xca25('0x10')]===0x1f4){logger[_0xca25('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xb2fc94,_0x5d820c['error'][_0xca25('0x11')]);return _0x42a97a(_0x5d820c['error'][_0xca25('0x11')]);}logger[_0xca25('0xf')](_0xca25('0x12'),_0xb2fc94,_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);return _0x2c0b8c(_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);}else{logger[_0xca25('0xb')](_0xca25('0x12'),_0xb2fc94,_0xca25('0xc'));_0x2c0b8c(_0x5d820c[_0xca25('0x13')]['message']);}})[_0xca25('0x14')](function(_0x340c9b){logger['error'](_0xca25('0x12'),_0xb2fc94,_0x340c9b);_0x42a97a(_0x340c9b);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index d2d4594..1609527 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 _0xa581=['index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceContext.controller','get','isAuthenticated'];(function(_0x53bbf3,_0x41d135){var _0x252520=function(_0x5ca73d){while(--_0x5ca73d){_0x53bbf3['push'](_0x53bbf3['shift']());}};_0x252520(++_0x41d135);}(_0xa581,0x19a));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1a58('0x0'));var util=require(_0x1a58('0x1'));var path=require(_0x1a58('0x2'));var timeout=require(_0x1a58('0x3'));var express=require(_0x1a58('0x4'));var router=express[_0x1a58('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a58('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a58('0x7'));router[_0x1a58('0x8')]('/',auth[_0x1a58('0x9')](),controller[_0x1a58('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a58('0xb')]);router[_0x1a58('0xc')]('/',auth[_0x1a58('0x9')](),controller[_0x1a58('0xd')]);router[_0x1a58('0xe')]('/:id',auth[_0x1a58('0x9')](),controller[_0x1a58('0xf')]);router[_0x1a58('0x10')](_0x1a58('0x11'),auth[_0x1a58('0x9')](),controller[_0x1a58('0x12')]);module[_0x1a58('0x13')]=router; \ No newline at end of file +var _0x6b63=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','create','put','update','delete','destroy','multer','util'];(function(_0x3f6021,_0x2ee18b){var _0x25e730=function(_0x551576){while(--_0x551576){_0x3f6021['push'](_0x3f6021['shift']());}};_0x25e730(++_0x2ee18b);}(_0x6b63,0x76));var _0x36b6=function(_0x36489b,_0x4cc3ac){_0x36489b=_0x36489b-0x0;var _0x37027c=_0x6b63[_0x36489b];return _0x37027c;};'use strict';var multer=require(_0x36b6('0x0'));var util=require(_0x36b6('0x1'));var path=require(_0x36b6('0x2'));var timeout=require(_0x36b6('0x3'));var express=require(_0x36b6('0x4'));var router=express[_0x36b6('0x5')]();var fs_extra=require(_0x36b6('0x6'));var auth=require(_0x36b6('0x7'));var interaction=require(_0x36b6('0x8'));var config=require(_0x36b6('0x9'));var controller=require(_0x36b6('0xa'));router[_0x36b6('0xb')]('/',auth[_0x36b6('0xc')](),controller[_0x36b6('0xd')]);router[_0x36b6('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x36b6('0xe')]);router['post']('/',auth[_0x36b6('0xc')](),controller[_0x36b6('0xf')]);router[_0x36b6('0x10')]('/:id',auth[_0x36b6('0xc')](),controller[_0x36b6('0x11')]);router[_0x36b6('0x12')]('/:id',auth[_0x36b6('0xc')](),controller[_0x36b6('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 2c77e1e..38b8ba1 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 _0x4436=['exports','name','STRING','BOOLEAN'];(function(_0x11fb16,_0x29a381){var _0x343de1=function(_0x4a69f7){while(--_0x4a69f7){_0x11fb16['push'](_0x11fb16['shift']());}};_0x343de1(++_0x29a381);}(_0x4436,0x1f4));var _0x6443=function(_0x384402,_0x953285){_0x384402=_0x384402-0x0;var _0x59875d=_0x4436[_0x384402];return _0x59875d;};'use strict';var Sequelize=require('sequelize');module[_0x6443('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6443('0x1')},'description':{'type':Sequelize[_0x6443('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6443('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9e2a=['exports','STRING','name','BOOLEAN'];(function(_0x166d7a,_0x386f61){var _0x58db23=function(_0x28c7f2){while(--_0x28c7f2){_0x166d7a['push'](_0x166d7a['shift']());}};_0x58db23(++_0x386f61);}(_0x9e2a,0x17c));var _0xa9e2=function(_0x531ed1,_0x74b376){_0x531ed1=_0x531ed1-0x0;var _0x3cbe81=_0x9e2a[_0x531ed1];return _0x3cbe81;};'use strict';var Sequelize=require('sequelize');module[_0xa9e2('0x0')]={'name':{'type':Sequelize[_0xa9e2('0x1')],'unique':_0xa9e2('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa9e2('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4b6a865..b6a3744 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 _0x60c0=['root','rimraf','moment','bluebird','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','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','merge','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','create','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','Reload'];(function(_0x5c6389,_0x263d6b){var _0x27ff68=function(_0x20127f){while(--_0x20127f){_0x5c6389['push'](_0x5c6389['shift']());}};_0x27ff68(++_0x263d6b);}(_0x60c0,0x65));var _0x060c=function(_0x302b5e,_0x564a8e){_0x302b5e=_0x302b5e-0x0;var _0x523ab7=_0x60c0[_0x302b5e];return _0x523ab7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x060c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x060c('0x1'));var BPromise=require(_0x060c('0x2'));var Mustache=require(_0x060c('0x3'));var util=require(_0x060c('0x4'));var path=require(_0x060c('0x5'));var sox=require(_0x060c('0x6'));var csv=require(_0x060c('0x7'));var ejs=require(_0x060c('0x8'));var fs=require('fs');var fs_extra=require(_0x060c('0x9'));var _=require(_0x060c('0xa'));var squel=require(_0x060c('0xb'));var crypto=require('crypto');var jsforce=require(_0x060c('0xc'));var deskjs=require(_0x060c('0xd'));var toCsv=require(_0x060c('0x7'));var querystring=require(_0x060c('0xe'));var Papa=require('papaparse');var Redis=require(_0x060c('0xf'));var authService=require(_0x060c('0x10'));var qs=require(_0x060c('0x11'));var as=require(_0x060c('0x12'));var hardwareService=require(_0x060c('0x13'));var logger=require(_0x060c('0x14'))(_0x060c('0x15'));var utils=require(_0x060c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x060c('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x060c('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f4983,_0x1ac456,_0x9ef20e,_0x1dfa6a){return new BPromise(function(_0x3cb974,_0x2652d3){var _0x5e3bc2=_0x1dfa6a||client;return _0x5e3bc2['request'](_0x2f4983,_0x9ef20e)[_0x060c('0x19')](function(_0x1f19e7){logger[_0x060c('0x1a')](_0x060c('0x1b'),_0x1ac456,_0x060c('0x1c'));logger[_0x060c('0x1d')](_0x060c('0x1e'),_0x1ac456,_0x060c('0x1c'),JSON[_0x060c('0x1f')](_0x1f19e7));if(_0x1f19e7[_0x060c('0x20')]){if(_0x1f19e7[_0x060c('0x20')][_0x060c('0x21')]===0x1f4){logger[_0x060c('0x20')](_0x060c('0x1b'),_0x1ac456,_0x1f19e7[_0x060c('0x20')][_0x060c('0x22')]);return _0x2652d3(_0x1f19e7[_0x060c('0x20')][_0x060c('0x22')]);}logger[_0x060c('0x20')](_0x060c('0x1b'),_0x1ac456,_0x1f19e7[_0x060c('0x20')][_0x060c('0x22')]);return _0x3cb974(_0x1f19e7[_0x060c('0x20')]['message']);}else{logger[_0x060c('0x1a')](_0x060c('0x1b'),_0x1ac456,'request\x20sent');_0x3cb974(_0x1f19e7['result'][_0x060c('0x22')]);}})[_0x060c('0x23')](function(_0x4cd3a8){logger[_0x060c('0x20')](_0x060c('0x1b'),_0x1ac456,_0x4cd3a8);_0x2652d3(_0x4cd3a8);});});}function respondWithStatusCode(_0x6331c7,_0x5b7191){_0x5b7191=_0x5b7191||0xcc;return function(_0x459837){if(_0x459837){return _0x6331c7[_0x060c('0x24')](_0x5b7191);}return _0x6331c7[_0x060c('0x25')](_0x5b7191)[_0x060c('0x26')]();};}function respondWithResult(_0x51293f,_0x50c594){_0x50c594=_0x50c594||0xc8;return function(_0x5de092){if(_0x5de092){return _0x51293f[_0x060c('0x25')](_0x50c594)['json'](_0x5de092);}};}function respondWithFilteredResult(_0x4c97de,_0x58bb55){return function(_0x2377b0){if(_0x2377b0){var _0x3856f5=typeof _0x58bb55[_0x060c('0x27')]==='undefined'&&typeof _0x58bb55['limit']===_0x060c('0x28');var _0x218a2f=_0x2377b0[_0x060c('0x29')];var _0x4ac4db=_0x3856f5?0x0:_0x58bb55[_0x060c('0x27')];var _0x461d95=_0x3856f5?_0x2377b0[_0x060c('0x29')]:_0x58bb55['offset']+_0x58bb55[_0x060c('0x2a')];var _0xbfd71b;if(_0x461d95>=_0x218a2f){_0x461d95=_0x218a2f;_0xbfd71b=0xc8;}else{_0xbfd71b=0xce;}_0x4c97de[_0x060c('0x25')](_0xbfd71b);return _0x4c97de['set'](_0x060c('0x2b'),_0x4ac4db+'-'+_0x461d95+'/'+_0x218a2f)['json'](_0x2377b0);}return null;};}function patchUpdates(_0x41411d){return function(_0xf17df3){try{jsonpatch[_0x060c('0x2c')](_0xf17df3,_0x41411d,!![]);}catch(_0x58fbab){return BPromise[_0x060c('0x2d')](_0x58fbab);}return _0xf17df3['save']();};}function saveUpdates(_0xca8e8c,_0x43edff){return function(_0xc159a8){if(_0xc159a8){return _0xc159a8[_0x060c('0x2e')](_0xca8e8c)[_0x060c('0x19')](function(_0x2a5f54){return _0x2a5f54;});}return null;};}function removeEntity(_0xdcce41,_0x393984){return function(_0x2a3b25){if(_0x2a3b25){return _0x2a3b25[_0x060c('0x2f')]()[_0x060c('0x19')](function(){var _0x5bc11f=_0x2a3b25['get']({'plain':!![]});var _0x2e0e74=_0x060c('0x30');return db[_0x060c('0x31')][_0x060c('0x2f')]({'where':{'type':_0x2e0e74,'resourceId':_0x5bc11f['id']}})[_0x060c('0x19')](function(){return _0x2a3b25;});})['then'](function(){_0xdcce41[_0x060c('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bd74d,_0x1fa94e){return function(_0x212e49){if(!_0x212e49){_0x2bd74d[_0x060c('0x24')](0x194);}return _0x212e49;};}function handleError(_0x8efa39,_0x5433e8){_0x5433e8=_0x5433e8||0x1f4;return function(_0x216dfd){logger[_0x060c('0x20')](_0x216dfd[_0x060c('0x32')]);if(_0x216dfd[_0x060c('0x33')]){delete _0x216dfd['name'];}_0x8efa39[_0x060c('0x25')](_0x5433e8)[_0x060c('0x34')](_0x216dfd);};}exports['index']=function(_0x61e52,_0x3c1d6c){var _0xdfff99={},_0x3d64a2={},_0x4969e4={'count':0x0,'rows':[]};var _0xcb2da1=_[_0x060c('0x35')](db[_0x060c('0x36')]['rawAttributes'],function(_0x2e9ad6){return{'name':_0x2e9ad6[_0x060c('0x37')],'type':_0x2e9ad6['type'][_0x060c('0x38')]};});_0x3d64a2[_0x060c('0x39')]=_[_0x060c('0x35')](_0xcb2da1,_0x060c('0x33'));_0x3d64a2[_0x060c('0x3a')]=_[_0x060c('0x3b')](_0x61e52[_0x060c('0x3a')]);_0x3d64a2[_0x060c('0x3c')]=_[_0x060c('0x3d')](_0x3d64a2[_0x060c('0x39')],_0x3d64a2[_0x060c('0x3a')]);_0xdfff99[_0x060c('0x3e')]=_[_0x060c('0x3d')](_0x3d64a2[_0x060c('0x39')],qs['fields'](_0x61e52[_0x060c('0x3a')][_0x060c('0x3f')]));_0xdfff99[_0x060c('0x3e')]=_0xdfff99[_0x060c('0x3e')][_0x060c('0x40')]?_0xdfff99[_0x060c('0x3e')]:_0x3d64a2[_0x060c('0x39')];if(!_0x61e52[_0x060c('0x3a')]['hasOwnProperty'](_0x060c('0x41'))){_0xdfff99[_0x060c('0x2a')]=qs[_0x060c('0x2a')](_0x61e52[_0x060c('0x3a')][_0x060c('0x2a')]);_0xdfff99[_0x060c('0x27')]=qs[_0x060c('0x27')](_0x61e52[_0x060c('0x3a')][_0x060c('0x27')]);}_0xdfff99[_0x060c('0x42')]=qs[_0x060c('0x43')](_0x61e52[_0x060c('0x3a')]['sort']);_0xdfff99[_0x060c('0x44')]=qs[_0x060c('0x3c')](_[_0x060c('0x45')](_0x61e52['query'],_0x3d64a2[_0x060c('0x3c')]),_0xcb2da1);if(_0x61e52[_0x060c('0x3a')]['filter']){_0xdfff99[_0x060c('0x44')]=_['merge'](_0xdfff99['where'],{'$or':_[_0x060c('0x35')](_0xcb2da1,function(_0x106b45){if(_0x106b45[_0x060c('0x46')]!==_0x060c('0x47')){var _0x1807fa={};_0x1807fa[_0x106b45['name']]={'$like':'%'+_0x61e52['query']['filter']+'%'};return _0x1807fa;}})});}_0xdfff99=_[_0x060c('0x48')]({},_0xdfff99,_0x61e52['options']);var _0x957de5={'where':_0xdfff99[_0x060c('0x44')]};return db[_0x060c('0x36')][_0x060c('0x29')](_0x957de5)[_0x060c('0x19')](function(_0x3e9db7){_0x4969e4[_0x060c('0x29')]=_0x3e9db7;if(_0x61e52['query'][_0x060c('0x49')]){_0xdfff99['include']=[{'all':!![]}];}return db[_0x060c('0x36')][_0x060c('0x4a')](_0xdfff99);})['then'](function(_0x10f1a1){_0x4969e4[_0x060c('0x4b')]=_0x10f1a1;return _0x4969e4;})[_0x060c('0x19')](respondWithFilteredResult(_0x3c1d6c,_0xdfff99))[_0x060c('0x23')](handleError(_0x3c1d6c,null));};exports[_0x060c('0x4c')]=function(_0x5ba10e,_0x1d224c){var _0x36c038={'raw':![],'where':{'id':_0x5ba10e[_0x060c('0x4d')]['id']}},_0x134b36={};_0x134b36[_0x060c('0x39')]=_[_0x060c('0x3b')](db[_0x060c('0x36')][_0x060c('0x4e')]);_0x134b36[_0x060c('0x3a')]=_['keys'](_0x5ba10e['query']);_0x134b36[_0x060c('0x3c')]=_['intersection'](_0x134b36[_0x060c('0x39')],_0x134b36[_0x060c('0x3a')]);_0x36c038[_0x060c('0x3e')]=_[_0x060c('0x3d')](_0x134b36[_0x060c('0x39')],qs[_0x060c('0x3f')](_0x5ba10e[_0x060c('0x3a')]['fields']));_0x36c038['attributes']=_0x36c038[_0x060c('0x3e')][_0x060c('0x40')]?_0x36c038['attributes']:_0x134b36['model'];if(_0x5ba10e[_0x060c('0x3a')][_0x060c('0x49')]){_0x36c038[_0x060c('0x4f')]=[{'all':!![]}];}_0x36c038=_[_0x060c('0x48')]({},_0x36c038,_0x5ba10e[_0x060c('0x50')]);return db[_0x060c('0x36')][_0x060c('0x51')](_0x36c038)[_0x060c('0x19')](handleEntityNotFound(_0x1d224c,null))[_0x060c('0x19')](respondWithResult(_0x1d224c,null))[_0x060c('0x23')](handleError(_0x1d224c,null));};exports[_0x060c('0x52')]=function(_0x2fc52c,_0x28fb56,_0x1fe43c){var _0x3fd39c;return db[_0x060c('0x36')]['create'](_0x2fc52c['body'],{'raw':!![]})[_0x060c('0x19')](function(_0xe70fac){_0x3fd39c=_0xe70fac;return db['VoiceContext'][_0x060c('0x4a')]({'raw':!![]});})[_0x060c('0x19')](function(_0x342a25){var _0x48c484=fs[_0x060c('0x53')](path[_0x060c('0x54')](config['root'],_0x060c('0x55')),_0x060c('0x56'));var _0x32c74e=ejs[_0x060c('0x57')](_0x48c484,{'contexts':_0x342a25||[]});fs['writeFileSync'](_0x060c('0x58'),_0x32c74e);})[_0x060c('0x19')](function(){return respondWithRpcPromise('Reload',_0x060c('0x52'),{'module':_0x060c('0x59')});})[_0x060c('0x19')](function(){var _0x545cd1=_0x2fc52c[_0x060c('0x5a')]['get']({'plain':!![]});if(!_0x545cd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x545cd1[_0x060c('0x5b')]===_0x060c('0x5a')){var _0x121759=_0x3fd39c[_0x060c('0x5c')]({'plain':!![]});return db[_0x060c('0x5d')][_0x060c('0x51')]({'where':{'name':_0x060c('0x30'),'userProfileId':_0x545cd1[_0x060c('0x5e')]},'raw':!![]})[_0x060c('0x19')](function(_0x388efd){if(_0x388efd&&_0x388efd[_0x060c('0x5f')]===0x0){return db['UserProfileResource'][_0x060c('0x52')]({'name':_0x121759[_0x060c('0x33')],'resourceId':_0x121759['id'],'type':_0x388efd[_0x060c('0x33')],'sectionId':_0x388efd['id']},{})[_0x060c('0x19')](function(){return _0x3fd39c;});}else{return _0x3fd39c;}})[_0x060c('0x23')](function(_0x35f75c){logger[_0x060c('0x20')](_0x060c('0x60'),_0x35f75c);throw _0x35f75c;});}return _0x3fd39c;})[_0x060c('0x19')](respondWithResult(_0x28fb56,0xc9))[_0x060c('0x23')](handleError(_0x28fb56,null));};exports[_0x060c('0x2e')]=function(_0x4e0835,_0x5f3b8e,_0x187ca8){var _0x1eece7;return db[_0x060c('0x36')][_0x060c('0x51')]({'where':{'id':_0x4e0835[_0x060c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5f3b8e,null))[_0x060c('0x19')](saveUpdates(_0x4e0835['body'],null))[_0x060c('0x19')](function(_0x4cb953){if(_0x4cb953){_0x1eece7=_0x4cb953;return db[_0x060c('0x36')][_0x060c('0x4a')]({'raw':!![]});}})[_0x060c('0x19')](function(_0x2e0910){var _0x132f58=fs[_0x060c('0x53')](path[_0x060c('0x54')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x3e4a5a=ejs[_0x060c('0x57')](_0x132f58,{'contexts':_0x2e0910||[]});fs[_0x060c('0x61')](_0x060c('0x58'),_0x3e4a5a);})[_0x060c('0x19')](function(){return respondWithRpcPromise(_0x060c('0x62'),_0x060c('0x2e'),{'module':_0x060c('0x59')});})[_0x060c('0x19')](function(){return _0x1eece7;})[_0x060c('0x19')](respondWithResult(_0x5f3b8e,null))[_0x060c('0x23')](handleError(_0x5f3b8e,null));};exports[_0x060c('0x2f')]=function(_0x25e7e3,_0x29815f,_0xc9ebc5){var _0x3725a1;return db[_0x060c('0x36')]['find']({'where':{'id':_0x25e7e3['params']['id']}})[_0x060c('0x19')](handleEntityNotFound(_0x29815f,null))[_0x060c('0x19')](removeEntity(_0x29815f,null))['then'](function(){return db[_0x060c('0x36')][_0x060c('0x4a')]({'raw':!![]});})[_0x060c('0x19')](function(_0x5a0815){var _0x55fd3b=fs[_0x060c('0x53')](path[_0x060c('0x54')](config[_0x060c('0x63')],'server/files/templates/context.ejs'),_0x060c('0x56'));var _0x4ac7bb=ejs['render'](_0x55fd3b,{'contexts':_0x5a0815});fs[_0x060c('0x61')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4ac7bb);return respondWithRpcPromise(_0x060c('0x62'),_0x060c('0x2f'),{'module':_0x060c('0x59')});})[_0x060c('0x23')](handleError(_0x29815f,null));}; \ No newline at end of file +var _0x5eef=['jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','name','send','map','VoiceContext','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','findAll','rows','show','params','includeAll','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x14eb9e,_0x29fe9e){var _0x4c59c4=function(_0x13b7a6){while(--_0x13b7a6){_0x14eb9e['push'](_0x14eb9e['shift']());}};_0x4c59c4(++_0x29fe9e);}(_0x5eef,0x188));var _0xf5ee=function(_0x1fdf6a,_0x64b096){_0x1fdf6a=_0x1fdf6a-0x0;var _0x1e6fd3=_0x5eef[_0x1fdf6a];return _0x1e6fd3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5ee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5ee('0x1'));var rp=require(_0xf5ee('0x2'));var moment=require(_0xf5ee('0x3'));var BPromise=require(_0xf5ee('0x4'));var Mustache=require(_0xf5ee('0x5'));var util=require('util');var path=require(_0xf5ee('0x6'));var sox=require(_0xf5ee('0x7'));var csv=require(_0xf5ee('0x8'));var ejs=require(_0xf5ee('0x9'));var fs=require('fs');var fs_extra=require(_0xf5ee('0xa'));var _=require('lodash');var squel=require(_0xf5ee('0xb'));var crypto=require(_0xf5ee('0xc'));var jsforce=require(_0xf5ee('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf5ee('0xe'));var Papa=require(_0xf5ee('0xf'));var Redis=require(_0xf5ee('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf5ee('0x11'));var as=require(_0xf5ee('0x12'));var hardwareService=require(_0xf5ee('0x13'));var logger=require(_0xf5ee('0x14'))(_0xf5ee('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf5ee('0x16'));var db=require(_0xf5ee('0x17'))['db'];var jayson=require(_0xf5ee('0x18'));var client=jayson[_0xf5ee('0x19')][_0xf5ee('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x31964c,_0x5074ff,_0x42c1e9,_0x331c12){return new BPromise(function(_0x4ce6e5,_0x44e2c8){var _0x50d405=_0x331c12||client;return _0x50d405[_0xf5ee('0x1b')](_0x31964c,_0x42c1e9)['then'](function(_0x22afb3){logger[_0xf5ee('0x1c')](_0xf5ee('0x1d'),_0x5074ff,_0xf5ee('0x1e'));logger[_0xf5ee('0x1f')](_0xf5ee('0x20'),_0x5074ff,'request\x20sent',JSON[_0xf5ee('0x21')](_0x22afb3));if(_0x22afb3['error']){if(_0x22afb3[_0xf5ee('0x22')]['code']===0x1f4){logger[_0xf5ee('0x22')](_0xf5ee('0x1d'),_0x5074ff,_0x22afb3[_0xf5ee('0x22')][_0xf5ee('0x23')]);return _0x44e2c8(_0x22afb3[_0xf5ee('0x22')][_0xf5ee('0x23')]);}logger[_0xf5ee('0x22')](_0xf5ee('0x1d'),_0x5074ff,_0x22afb3[_0xf5ee('0x22')]['message']);return _0x4ce6e5(_0x22afb3['error'][_0xf5ee('0x23')]);}else{logger['info'](_0xf5ee('0x1d'),_0x5074ff,_0xf5ee('0x1e'));_0x4ce6e5(_0x22afb3['result'][_0xf5ee('0x23')]);}})[_0xf5ee('0x24')](function(_0x41078f){logger[_0xf5ee('0x22')](_0xf5ee('0x1d'),_0x5074ff,_0x41078f);_0x44e2c8(_0x41078f);});});}function respondWithStatusCode(_0x40316b,_0x47a4fe){_0x47a4fe=_0x47a4fe||0xcc;return function(_0x513e2c){if(_0x513e2c){return _0x40316b['sendStatus'](_0x47a4fe);}return _0x40316b[_0xf5ee('0x25')](_0x47a4fe)[_0xf5ee('0x26')]();};}function respondWithResult(_0xd2814b,_0x2a82b4){_0x2a82b4=_0x2a82b4||0xc8;return function(_0x33f8d8){if(_0x33f8d8){return _0xd2814b[_0xf5ee('0x25')](_0x2a82b4)[_0xf5ee('0x27')](_0x33f8d8);}};}function respondWithFilteredResult(_0x3aaeba,_0x1afb21){return function(_0x336db8){if(_0x336db8){var _0xfaa595=typeof _0x1afb21[_0xf5ee('0x28')]==='undefined'&&typeof _0x1afb21[_0xf5ee('0x29')]===_0xf5ee('0x2a');var _0x2c0507=_0x336db8[_0xf5ee('0x2b')];var _0x5c9509=_0xfaa595?0x0:_0x1afb21[_0xf5ee('0x28')];var _0xf6c312=_0xfaa595?_0x336db8[_0xf5ee('0x2b')]:_0x1afb21[_0xf5ee('0x28')]+_0x1afb21[_0xf5ee('0x29')];var _0x3c8bf4;if(_0xf6c312>=_0x2c0507){_0xf6c312=_0x2c0507;_0x3c8bf4=0xc8;}else{_0x3c8bf4=0xce;}_0x3aaeba[_0xf5ee('0x25')](_0x3c8bf4);return _0x3aaeba[_0xf5ee('0x2c')](_0xf5ee('0x2d'),_0x5c9509+'-'+_0xf6c312+'/'+_0x2c0507)[_0xf5ee('0x27')](_0x336db8);}return null;};}function patchUpdates(_0x44dae){return function(_0x289636){try{jsonpatch[_0xf5ee('0x2e')](_0x289636,_0x44dae,!![]);}catch(_0x3b0144){return BPromise[_0xf5ee('0x2f')](_0x3b0144);}return _0x289636[_0xf5ee('0x30')]();};}function saveUpdates(_0x143326,_0x43beac){return function(_0x3c7991){if(_0x3c7991){return _0x3c7991[_0xf5ee('0x31')](_0x143326)[_0xf5ee('0x32')](function(_0x46653e){return _0x46653e;});}return null;};}function removeEntity(_0x50f2a4,_0x4dd0bc){return function(_0x22a14a){if(_0x22a14a){return _0x22a14a[_0xf5ee('0x33')]()[_0xf5ee('0x32')](function(){var _0x21dc5c=_0x22a14a['get']({'plain':!![]});var _0x404639='Contexts';return db[_0xf5ee('0x34')][_0xf5ee('0x33')]({'where':{'type':_0x404639,'resourceId':_0x21dc5c['id']}})[_0xf5ee('0x32')](function(){return _0x22a14a;});})[_0xf5ee('0x32')](function(){_0x50f2a4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x179aa2,_0x1cc3e7){return function(_0x18e5f5){if(!_0x18e5f5){_0x179aa2[_0xf5ee('0x35')](0x194);}return _0x18e5f5;};}function handleError(_0x569f87,_0x2fa6da){_0x2fa6da=_0x2fa6da||0x1f4;return function(_0x6d8f7){logger[_0xf5ee('0x22')](_0x6d8f7['stack']);if(_0x6d8f7[_0xf5ee('0x36')]){delete _0x6d8f7[_0xf5ee('0x36')];}_0x569f87[_0xf5ee('0x25')](_0x2fa6da)[_0xf5ee('0x37')](_0x6d8f7);};}exports['index']=function(_0x560373,_0x4a0ed4){var _0x28044e={},_0x5d0667={},_0x5e0ce3={'count':0x0,'rows':[]};var _0x52cb81=_[_0xf5ee('0x38')](db[_0xf5ee('0x39')][_0xf5ee('0x3a')],function(_0x5b75ea){return{'name':_0x5b75ea['fieldName'],'type':_0x5b75ea[_0xf5ee('0x3b')][_0xf5ee('0x3c')]};});_0x5d0667['model']=_[_0xf5ee('0x38')](_0x52cb81,_0xf5ee('0x36'));_0x5d0667[_0xf5ee('0x3d')]=_[_0xf5ee('0x3e')](_0x560373[_0xf5ee('0x3d')]);_0x5d0667[_0xf5ee('0x3f')]=_[_0xf5ee('0x40')](_0x5d0667['model'],_0x5d0667[_0xf5ee('0x3d')]);_0x28044e[_0xf5ee('0x41')]=_['intersection'](_0x5d0667['model'],qs[_0xf5ee('0x42')](_0x560373[_0xf5ee('0x3d')][_0xf5ee('0x42')]));_0x28044e[_0xf5ee('0x41')]=_0x28044e[_0xf5ee('0x41')][_0xf5ee('0x43')]?_0x28044e[_0xf5ee('0x41')]:_0x5d0667[_0xf5ee('0x44')];if(!_0x560373[_0xf5ee('0x3d')][_0xf5ee('0x45')](_0xf5ee('0x46'))){_0x28044e[_0xf5ee('0x29')]=qs['limit'](_0x560373[_0xf5ee('0x3d')][_0xf5ee('0x29')]);_0x28044e[_0xf5ee('0x28')]=qs[_0xf5ee('0x28')](_0x560373[_0xf5ee('0x3d')][_0xf5ee('0x28')]);}_0x28044e['order']=qs[_0xf5ee('0x47')](_0x560373[_0xf5ee('0x3d')][_0xf5ee('0x47')]);_0x28044e[_0xf5ee('0x48')]=qs[_0xf5ee('0x3f')](_[_0xf5ee('0x49')](_0x560373['query'],_0x5d0667['filters']),_0x52cb81);if(_0x560373[_0xf5ee('0x3d')]['filter']){_0x28044e['where']=_[_0xf5ee('0x4a')](_0x28044e['where'],{'$or':_['map'](_0x52cb81,function(_0xd230b3){if(_0xd230b3[_0xf5ee('0x3b')]!=='VIRTUAL'){var _0x2a59c1={};_0x2a59c1[_0xd230b3[_0xf5ee('0x36')]]={'$like':'%'+_0x560373[_0xf5ee('0x3d')][_0xf5ee('0x4b')]+'%'};return _0x2a59c1;}})});}_0x28044e=_[_0xf5ee('0x4a')]({},_0x28044e,_0x560373[_0xf5ee('0x4c')]);var _0x137f63={'where':_0x28044e[_0xf5ee('0x48')]};return db[_0xf5ee('0x39')]['count'](_0x137f63)[_0xf5ee('0x32')](function(_0x95c971){_0x5e0ce3[_0xf5ee('0x2b')]=_0x95c971;if(_0x560373[_0xf5ee('0x3d')]['includeAll']){_0x28044e['include']=[{'all':!![]}];}return db['VoiceContext'][_0xf5ee('0x4d')](_0x28044e);})['then'](function(_0x2aa7c7){_0x5e0ce3[_0xf5ee('0x4e')]=_0x2aa7c7;return _0x5e0ce3;})['then'](respondWithFilteredResult(_0x4a0ed4,_0x28044e))[_0xf5ee('0x24')](handleError(_0x4a0ed4,null));};exports[_0xf5ee('0x4f')]=function(_0x531f6e,_0x44f9e6){var _0x2fb023={'raw':![],'where':{'id':_0x531f6e[_0xf5ee('0x50')]['id']}},_0x1eef3d={};_0x1eef3d[_0xf5ee('0x44')]=_[_0xf5ee('0x3e')](db[_0xf5ee('0x39')][_0xf5ee('0x3a')]);_0x1eef3d[_0xf5ee('0x3d')]=_[_0xf5ee('0x3e')](_0x531f6e[_0xf5ee('0x3d')]);_0x1eef3d[_0xf5ee('0x3f')]=_[_0xf5ee('0x40')](_0x1eef3d[_0xf5ee('0x44')],_0x1eef3d['query']);_0x2fb023[_0xf5ee('0x41')]=_[_0xf5ee('0x40')](_0x1eef3d[_0xf5ee('0x44')],qs['fields'](_0x531f6e[_0xf5ee('0x3d')][_0xf5ee('0x42')]));_0x2fb023[_0xf5ee('0x41')]=_0x2fb023[_0xf5ee('0x41')][_0xf5ee('0x43')]?_0x2fb023['attributes']:_0x1eef3d['model'];if(_0x531f6e[_0xf5ee('0x3d')][_0xf5ee('0x51')]){_0x2fb023['include']=[{'all':!![]}];}_0x2fb023=_[_0xf5ee('0x4a')]({},_0x2fb023,_0x531f6e[_0xf5ee('0x4c')]);return db[_0xf5ee('0x39')][_0xf5ee('0x52')](_0x2fb023)[_0xf5ee('0x32')](handleEntityNotFound(_0x44f9e6,null))[_0xf5ee('0x32')](respondWithResult(_0x44f9e6,null))['catch'](handleError(_0x44f9e6,null));};exports[_0xf5ee('0x53')]=function(_0x4a9066,_0x22f71b,_0x31c47b){var _0x1ab2e4;return db[_0xf5ee('0x39')]['create'](_0x4a9066[_0xf5ee('0x54')],{'raw':!![]})['then'](function(_0x331d48){_0x1ab2e4=_0x331d48;return db[_0xf5ee('0x39')][_0xf5ee('0x4d')]({'raw':!![]});})['then'](function(_0x1ceb0f){var _0x5032c1=fs[_0xf5ee('0x55')](path[_0xf5ee('0x56')](config[_0xf5ee('0x57')],_0xf5ee('0x58')),_0xf5ee('0x59'));var _0x402f07=ejs[_0xf5ee('0x5a')](_0x5032c1,{'contexts':_0x1ceb0f||[]});fs[_0xf5ee('0x5b')](_0xf5ee('0x5c'),_0x402f07);})[_0xf5ee('0x32')](function(){return respondWithRpcPromise('Reload',_0xf5ee('0x53'),{'module':_0xf5ee('0x5d')});})[_0xf5ee('0x32')](function(){var _0x240437=_0x4a9066[_0xf5ee('0x5e')][_0xf5ee('0x5f')]({'plain':!![]});if(!_0x240437)throw new Error(_0xf5ee('0x60'));if(_0x240437[_0xf5ee('0x61')]==='user'){var _0x3f089a=_0x1ab2e4[_0xf5ee('0x5f')]({'plain':!![]});return db[_0xf5ee('0x62')][_0xf5ee('0x52')]({'where':{'name':_0xf5ee('0x63'),'userProfileId':_0x240437[_0xf5ee('0x64')]},'raw':!![]})[_0xf5ee('0x32')](function(_0x37df2e){if(_0x37df2e&&_0x37df2e[_0xf5ee('0x65')]===0x0){return db[_0xf5ee('0x34')][_0xf5ee('0x53')]({'name':_0x3f089a[_0xf5ee('0x36')],'resourceId':_0x3f089a['id'],'type':_0x37df2e['name'],'sectionId':_0x37df2e['id']},{})[_0xf5ee('0x32')](function(){return _0x1ab2e4;});}else{return _0x1ab2e4;}})[_0xf5ee('0x24')](function(_0x250c2f){logger['error'](_0xf5ee('0x66'),_0x250c2f);throw _0x250c2f;});}return _0x1ab2e4;})['then'](respondWithResult(_0x22f71b,0xc9))[_0xf5ee('0x24')](handleError(_0x22f71b,null));};exports['update']=function(_0xfa0d83,_0x1c7853,_0x1bc372){var _0x22dc30;return db[_0xf5ee('0x39')][_0xf5ee('0x52')]({'where':{'id':_0xfa0d83[_0xf5ee('0x50')]['id']}})[_0xf5ee('0x32')](handleEntityNotFound(_0x1c7853,null))[_0xf5ee('0x32')](saveUpdates(_0xfa0d83[_0xf5ee('0x54')],null))['then'](function(_0x286419){if(_0x286419){_0x22dc30=_0x286419;return db[_0xf5ee('0x39')][_0xf5ee('0x4d')]({'raw':!![]});}})[_0xf5ee('0x32')](function(_0x2f8244){var _0x4f84e8=fs['readFileSync'](path['join'](config[_0xf5ee('0x57')],_0xf5ee('0x58')),_0xf5ee('0x59'));var _0x5bd276=ejs[_0xf5ee('0x5a')](_0x4f84e8,{'contexts':_0x2f8244||[]});fs['writeFileSync'](_0xf5ee('0x5c'),_0x5bd276);})[_0xf5ee('0x32')](function(){return respondWithRpcPromise(_0xf5ee('0x67'),_0xf5ee('0x31'),{'module':_0xf5ee('0x5d')});})[_0xf5ee('0x32')](function(){return _0x22dc30;})[_0xf5ee('0x32')](respondWithResult(_0x1c7853,null))[_0xf5ee('0x24')](handleError(_0x1c7853,null));};exports[_0xf5ee('0x33')]=function(_0x582ae7,_0x1da09e,_0xd5d640){var _0xff490b;return db['VoiceContext'][_0xf5ee('0x52')]({'where':{'id':_0x582ae7[_0xf5ee('0x50')]['id']}})[_0xf5ee('0x32')](handleEntityNotFound(_0x1da09e,null))[_0xf5ee('0x32')](removeEntity(_0x1da09e,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xf5ee('0x32')](function(_0x419ea5){var _0x114941=fs[_0xf5ee('0x55')](path[_0xf5ee('0x56')](config['root'],_0xf5ee('0x58')),_0xf5ee('0x59'));var _0xd047a=ejs[_0xf5ee('0x5a')](_0x114941,{'contexts':_0x419ea5});fs[_0xf5ee('0x5b')](_0xf5ee('0x5c'),_0xd047a);return respondWithRpcPromise(_0xf5ee('0x67'),_0xf5ee('0x33'),{'module':_0xf5ee('0x5d')});})[_0xf5ee('0x24')](handleError(_0x1da09e,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c305393..248b888 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 _0x37c3=['define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./voiceContext.attributes','exports'];(function(_0x58752c,_0x30d8c6){var _0x4a58f8=function(_0x211db3){while(--_0x211db3){_0x58752c['push'](_0x58752c['shift']());}};_0x4a58f8(++_0x30d8c6);}(_0x37c3,0x13b));var _0x337c=function(_0x205f81,_0x4a8f50){_0x205f81=_0x205f81-0x0;var _0x310226=_0x37c3[_0x205f81];return _0x310226;};'use strict';var _=require(_0x337c('0x0'));var util=require(_0x337c('0x1'));var logger=require(_0x337c('0x2'))(_0x337c('0x3'));var moment=require(_0x337c('0x4'));var BPromise=require(_0x337c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x337c('0x6'));var attributes=require(_0x337c('0x7'));module[_0x337c('0x8')]=function(_0x19a235,_0x3ed851){return _0x19a235[_0x337c('0x9')](_0x337c('0xa'),attributes,{'tableName':_0x337c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fe5=['../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceContext.attributes','define','VoiceContext','lodash'];(function(_0x3a301a,_0x5e2318){var _0x51584e=function(_0x5b36ff){while(--_0x5b36ff){_0x3a301a['push'](_0x3a301a['shift']());}};_0x51584e(++_0x5e2318);}(_0x4fe5,0xbc));var _0x54fe=function(_0x1010d8,_0x1f3ef4){_0x1010d8=_0x1010d8-0x0;var _0x5c524b=_0x4fe5[_0x1010d8];return _0x5c524b;};'use strict';var _=require(_0x54fe('0x0'));var util=require('util');var logger=require(_0x54fe('0x1'))(_0x54fe('0x2'));var moment=require('moment');var BPromise=require(_0x54fe('0x3'));var rp=require(_0x54fe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x54fe('0x5'));var attributes=require(_0x54fe('0x6'));module['exports']=function(_0x26967a,_0x277b8e){return _0x26967a[_0x54fe('0x7')](_0x54fe('0x8'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index c71ab9a..4f0f7ce 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 _0xfff0=['../../config/environment','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x18b985,_0x1edce0){var _0x5180c3=function(_0x12576c){while(--_0x12576c){_0x18b985['push'](_0x18b985['shift']());}};_0x5180c3(++_0x1edce0);}(_0xfff0,0x139));var _0x0fff=function(_0x583622,_0x5866c4){_0x583622=_0x583622-0x0;var _0x1233bc=_0xfff0[_0x583622];return _0x1233bc;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('VoiceContext,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});} \ No newline at end of file +var _0xb0d2=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash'];(function(_0x19554e,_0x5b1ff4){var _0x570c02=function(_0x197ef3){while(--_0x197ef3){_0x19554e['push'](_0x19554e['shift']());}};_0x570c02(++_0x5b1ff4);}(_0xb0d2,0x1b4));var _0x2b0d=function(_0x19908f,_0xc32e70){_0x19908f=_0x19908f-0x0;var _0x36cfbe=_0xb0d2[_0x19908f];return _0x36cfbe;};'use strict';var _=require(_0x2b0d('0x0'));var util=require('util');var moment=require(_0x2b0d('0x1'));var BPromise=require(_0x2b0d('0x2'));var rs=require(_0x2b0d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b0d('0x4'))['db'];var utils=require(_0x2b0d('0x5'));var logger=require(_0x2b0d('0x6'))(_0x2b0d('0x7'));var config=require(_0x2b0d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2b0d('0x9')][_0x2b0d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x322c50,_0x2b8a25,_0xa3d517){return new BPromise(function(_0x3f8c66,_0x2ffe2a){return client[_0x2b0d('0xb')](_0x322c50,_0xa3d517)[_0x2b0d('0xc')](function(_0x2fff5e){logger['info'](_0x2b0d('0xd'),_0x2b8a25,'request\x20sent');logger[_0x2b0d('0xe')](_0x2b0d('0xf'),_0x2b8a25,_0x2b0d('0x10'),JSON['stringify'](_0x2fff5e));if(_0x2fff5e[_0x2b0d('0x11')]){if(_0x2fff5e[_0x2b0d('0x11')][_0x2b0d('0x12')]===0x1f4){logger[_0x2b0d('0x11')](_0x2b0d('0xd'),_0x2b8a25,_0x2fff5e[_0x2b0d('0x11')][_0x2b0d('0x13')]);return _0x2ffe2a(_0x2fff5e[_0x2b0d('0x11')]['message']);}logger[_0x2b0d('0x11')](_0x2b0d('0xd'),_0x2b8a25,_0x2fff5e['error'][_0x2b0d('0x13')]);return _0x3f8c66(_0x2fff5e[_0x2b0d('0x11')]['message']);}else{logger[_0x2b0d('0x14')](_0x2b0d('0xd'),_0x2b8a25,_0x2b0d('0x10'));_0x3f8c66(_0x2fff5e[_0x2b0d('0x15')][_0x2b0d('0x13')]);}})[_0x2b0d('0x16')](function(_0x432396){logger[_0x2b0d('0x11')](_0x2b0d('0xd'),_0x2b8a25,_0x432396);_0x2ffe2a(_0x432396);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4ac3c27..cbe20fc 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 _0xcae6=['post','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0xcae6,0x146));var _0x6cae=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xcae6[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0x6cae('0x0'));var util=require(_0x6cae('0x1'));var path=require('path');var timeout=require(_0x6cae('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6cae('0x3'));var interaction=require(_0x6cae('0x4'));var config=require(_0x6cae('0x5'));var controller=require(_0x6cae('0x6'));router[_0x6cae('0x7')]('/',auth[_0x6cae('0x8')](),controller[_0x6cae('0x9')]);router[_0x6cae('0x7')](_0x6cae('0xa'),auth[_0x6cae('0x8')](),controller[_0x6cae('0xb')]);router[_0x6cae('0x7')](_0x6cae('0xc'),auth[_0x6cae('0x8')](),controller[_0x6cae('0xd')]);router[_0x6cae('0xe')]('/',auth['isAuthenticated'](),controller[_0x6cae('0xf')]);router[_0x6cae('0x10')](_0x6cae('0xc'),auth[_0x6cae('0x8')](),controller[_0x6cae('0x11')]);router[_0x6cae('0x12')](_0x6cae('0xc'),auth[_0x6cae('0x8')](),controller[_0x6cae('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5699=['../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x5699,0xaf));var _0x9569=function(_0x19d3df,_0x2a14d4){_0x19d3df=_0x19d3df-0x0;var _0x40c475=_0x5699[_0x19d3df];return _0x40c475;};'use strict';var multer=require(_0x9569('0x0'));var util=require(_0x9569('0x1'));var path=require(_0x9569('0x2'));var timeout=require('connect-timeout');var express=require(_0x9569('0x3'));var router=express[_0x9569('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9569('0x5'));var interaction=require(_0x9569('0x6'));var config=require('../../config/environment');var controller=require(_0x9569('0x7'));router[_0x9569('0x8')]('/',auth[_0x9569('0x9')](),controller[_0x9569('0xa')]);router['get'](_0x9569('0xb'),auth['isAuthenticated'](),controller[_0x9569('0xc')]);router[_0x9569('0x8')]('/:id',auth[_0x9569('0x9')](),controller[_0x9569('0xd')]);router[_0x9569('0xe')]('/',auth[_0x9569('0x9')](),controller[_0x9569('0xf')]);router['put'](_0x9569('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x9569('0x11')]('/:id',auth[_0x9569('0x9')](),controller[_0x9569('0x12')]);module[_0x9569('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 7ed3c85..6f035b5 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 _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x53b93b,_0x1bfab1){var _0x485761=function(_0x41592e){while(--_0x41592e){_0x53b93b['push'](_0x53b93b['shift']());}};_0x485761(++_0x1bfab1);}(_0x84ab,0x12f));var _0xb84a=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0x84ab[_0x3f6565];return _0x4abd23;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'privilege':{'type':Sequelize[_0xb84a('0x2')]},'channel':{'type':Sequelize[_0xb84a('0x2')]},'channelstate':{'type':Sequelize[_0xb84a('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb84a('0x2')]},'calleridname':{'type':Sequelize[_0xb84a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'language':{'type':Sequelize[_0xb84a('0x2')]},'accountcode':{'type':Sequelize[_0xb84a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb84a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb84a('0x2')]},'destchannelstate':{'type':Sequelize[_0xb84a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb84a('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb84a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'destlanguage':{'type':Sequelize[_0xb84a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb84a('0x3')]},'destuniqueid':{'type':Sequelize[_0xb84a('0x2')]},'destlinkedid':{'type':Sequelize[_0xb84a('0x2')]},'dialstring':{'type':Sequelize[_0xb84a('0x2')]},'dialstatus':{'type':Sequelize[_0xb84a('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb84a('0x4')]},'endtime':{'type':Sequelize[_0xb84a('0x4')]},'lastevent':{'type':Sequelize[_0xb84a('0x2')],'comment':_0xb84a('0x5')},'routeId':{'type':Sequelize[_0xb84a('0x3')]},'duration':{'type':Sequelize[_0xb84a('0x3')]},'holdtime':{'type':Sequelize[_0xb84a('0x3')]},'billableseconds':{'type':Sequelize[_0xb84a('0x3')]}}; \ No newline at end of file +var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x55234f,_0x45b236){var _0x2e3573=function(_0xe43c3){while(--_0xe43c3){_0x55234f['push'](_0x55234f['shift']());}};_0x2e3573(++_0x45b236);}(_0xedd9,0xfc));var _0x9edd=function(_0x574394,_0x49d75f){_0x574394=_0x574394-0x0;var _0x93a092=_0xedd9[_0x574394];return _0x93a092;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d4f93fe..7287f4d 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 _0x2611=['describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','index','fieldName','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2611,0x164));var _0x1261=function(_0x539bf7,_0x4bb10c){_0x539bf7=_0x539bf7-0x0;var _0xd7fc85=_0x2611[_0x539bf7];return _0xd7fc85;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1261('0x0'));var jsonpatch=require(_0x1261('0x1'));var rp=require(_0x1261('0x2'));var moment=require(_0x1261('0x3'));var BPromise=require(_0x1261('0x4'));var Mustache=require('mustache');var util=require(_0x1261('0x5'));var path=require(_0x1261('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1261('0x7'));var _=require('lodash');var squel=require(_0x1261('0x8'));var crypto=require(_0x1261('0x9'));var jsforce=require(_0x1261('0xa'));var deskjs=require(_0x1261('0xb'));var toCsv=require(_0x1261('0xc'));var querystring=require('querystring');var Papa=require(_0x1261('0xd'));var Redis=require(_0x1261('0xe'));var authService=require(_0x1261('0xf'));var qs=require(_0x1261('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1261('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x1261('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1261('0x13'));var db=require(_0x1261('0x14'))['db'];function respondWithStatusCode(_0x478b19,_0x98a9cd){_0x98a9cd=_0x98a9cd||0xcc;return function(_0x482b70){if(_0x482b70){return _0x478b19['sendStatus'](_0x98a9cd);}return _0x478b19[_0x1261('0x15')](_0x98a9cd)[_0x1261('0x16')]();};}function respondWithResult(_0x48b056,_0x11408f){_0x11408f=_0x11408f||0xc8;return function(_0x671fae){if(_0x671fae){return _0x48b056['status'](_0x11408f)[_0x1261('0x17')](_0x671fae);}};}function respondWithFilteredResult(_0x3ec3f2,_0x32eac7){return function(_0x490b3b){if(_0x490b3b){var _0xa26e92=typeof _0x32eac7[_0x1261('0x18')]==='undefined'&&typeof _0x32eac7[_0x1261('0x19')]==='undefined';var _0x49520d=_0x490b3b[_0x1261('0x1a')];var _0x5c6d66=_0xa26e92?0x0:_0x32eac7['offset'];var _0xc07636=_0xa26e92?_0x490b3b[_0x1261('0x1a')]:_0x32eac7[_0x1261('0x18')]+_0x32eac7[_0x1261('0x19')];var _0x4bc051;if(_0xc07636>=_0x49520d){_0xc07636=_0x49520d;_0x4bc051=0xc8;}else{_0x4bc051=0xce;}_0x3ec3f2[_0x1261('0x15')](_0x4bc051);return _0x3ec3f2[_0x1261('0x1b')](_0x1261('0x1c'),_0x5c6d66+'-'+_0xc07636+'/'+_0x49520d)[_0x1261('0x17')](_0x490b3b);}return null;};}function patchUpdates(_0x408254){return function(_0x2a8513){try{jsonpatch[_0x1261('0x1d')](_0x2a8513,_0x408254,!![]);}catch(_0x5a7535){return BPromise['reject'](_0x5a7535);}return _0x2a8513[_0x1261('0x1e')]();};}function saveUpdates(_0x3dbb81,_0xa123dc){return function(_0x280fc1){if(_0x280fc1){return _0x280fc1[_0x1261('0x1f')](_0x3dbb81)['then'](function(_0x5f2e15){return _0x5f2e15;});}return null;};}function removeEntity(_0x27346b,_0x410d92){return function(_0x1f7744){if(_0x1f7744){return _0x1f7744[_0x1261('0x20')]()[_0x1261('0x21')](function(){_0x27346b['status'](0xcc)[_0x1261('0x16')]();});}};}function handleEntityNotFound(_0x27101e,_0x630205){return function(_0x4be1b5){if(!_0x4be1b5){_0x27101e[_0x1261('0x22')](0x194);}return _0x4be1b5;};}function handleError(_0xa02e1c,_0x1eb192){_0x1eb192=_0x1eb192||0x1f4;return function(_0x2d3644){logger[_0x1261('0x23')](_0x2d3644[_0x1261('0x24')]);if(_0x2d3644[_0x1261('0x25')]){delete _0x2d3644[_0x1261('0x25')];}_0xa02e1c[_0x1261('0x15')](_0x1eb192)['send'](_0x2d3644);};}exports[_0x1261('0x26')]=function(_0x39e9c5,_0x253ed7){var _0x4e007a={},_0xa26a3a={},_0x53835b={'count':0x0,'rows':[]};var _0x1e7b97=_['map'](db['VoiceDialReport']['rawAttributes'],function(_0x550197){return{'name':_0x550197[_0x1261('0x27')],'type':_0x550197[_0x1261('0x28')]['key']};});_0xa26a3a['model']=_[_0x1261('0x29')](_0x1e7b97,'name');_0xa26a3a[_0x1261('0x2a')]=_['keys'](_0x39e9c5[_0x1261('0x2a')]);_0xa26a3a[_0x1261('0x2b')]=_['intersection'](_0xa26a3a[_0x1261('0x2c')],_0xa26a3a['query']);_0x4e007a[_0x1261('0x2d')]=_[_0x1261('0x2e')](_0xa26a3a[_0x1261('0x2c')],qs[_0x1261('0x2f')](_0x39e9c5[_0x1261('0x2a')][_0x1261('0x2f')]));_0x4e007a['attributes']=_0x4e007a[_0x1261('0x2d')][_0x1261('0x30')]?_0x4e007a['attributes']:_0xa26a3a[_0x1261('0x2c')];if(!_0x39e9c5[_0x1261('0x2a')][_0x1261('0x31')]('nolimit')){_0x4e007a['limit']=qs['limit'](_0x39e9c5['query'][_0x1261('0x19')]);_0x4e007a[_0x1261('0x18')]=qs[_0x1261('0x18')](_0x39e9c5[_0x1261('0x2a')][_0x1261('0x18')]);}_0x4e007a[_0x1261('0x32')]=qs['sort'](_0x39e9c5[_0x1261('0x2a')]['sort']);_0x4e007a[_0x1261('0x33')]=qs['filters'](_[_0x1261('0x34')](_0x39e9c5[_0x1261('0x2a')],_0xa26a3a[_0x1261('0x2b')]),_0x1e7b97);if(_0x39e9c5[_0x1261('0x2a')][_0x1261('0x35')]){_0x4e007a[_0x1261('0x33')]=_[_0x1261('0x36')](_0x4e007a[_0x1261('0x33')],{'$or':_['map'](_0x1e7b97,function(_0x508677){if(_0x508677['type']!==_0x1261('0x37')){var _0x4fd9a7={};_0x4fd9a7[_0x508677[_0x1261('0x25')]]={'$like':'%'+_0x39e9c5[_0x1261('0x2a')]['filter']+'%'};return _0x4fd9a7;}})});}_0x4e007a=_[_0x1261('0x36')]({},_0x4e007a,_0x39e9c5[_0x1261('0x38')]);var _0x277f78={'where':_0x4e007a[_0x1261('0x33')]};return db[_0x1261('0x39')][_0x1261('0x1a')](_0x277f78)['then'](function(_0x1d52cc){_0x53835b[_0x1261('0x1a')]=_0x1d52cc;if(_0x39e9c5[_0x1261('0x2a')][_0x1261('0x3a')]){_0x4e007a[_0x1261('0x3b')]=[{'all':!![]}];}return db[_0x1261('0x39')][_0x1261('0x3c')](_0x4e007a);})['then'](function(_0x2cb693){_0x53835b[_0x1261('0x3d')]=_0x2cb693;return _0x53835b;})[_0x1261('0x21')](respondWithFilteredResult(_0x253ed7,_0x4e007a))[_0x1261('0x3e')](handleError(_0x253ed7,null));};exports[_0x1261('0x3f')]=function(_0x182a41,_0x37ba24){var _0x6cf48c={'raw':!![],'where':{'id':_0x182a41[_0x1261('0x40')]['id']}},_0x1b772f={};_0x1b772f['model']=_[_0x1261('0x41')](db[_0x1261('0x39')][_0x1261('0x42')]);_0x1b772f['query']=_[_0x1261('0x41')](_0x182a41[_0x1261('0x2a')]);_0x1b772f[_0x1261('0x2b')]=_['intersection'](_0x1b772f[_0x1261('0x2c')],_0x1b772f[_0x1261('0x2a')]);_0x6cf48c[_0x1261('0x2d')]=_['intersection'](_0x1b772f[_0x1261('0x2c')],qs['fields'](_0x182a41[_0x1261('0x2a')][_0x1261('0x2f')]));_0x6cf48c['attributes']=_0x6cf48c[_0x1261('0x2d')][_0x1261('0x30')]?_0x6cf48c[_0x1261('0x2d')]:_0x1b772f[_0x1261('0x2c')];if(_0x182a41[_0x1261('0x2a')]['includeAll']){_0x6cf48c[_0x1261('0x3b')]=[{'all':!![]}];}_0x6cf48c=_[_0x1261('0x36')]({},_0x6cf48c,_0x182a41[_0x1261('0x38')]);return db[_0x1261('0x39')][_0x1261('0x43')](_0x6cf48c)[_0x1261('0x21')](handleEntityNotFound(_0x37ba24,null))['then'](respondWithResult(_0x37ba24,null))['catch'](handleError(_0x37ba24,null));};exports['create']=function(_0x3dc91d,_0x2ff47f){return db[_0x1261('0x39')][_0x1261('0x44')](_0x3dc91d[_0x1261('0x45')],{})[_0x1261('0x21')](respondWithResult(_0x2ff47f,0xc9))[_0x1261('0x3e')](handleError(_0x2ff47f,null));};exports['update']=function(_0x323903,_0x466fe8){if(_0x323903[_0x1261('0x45')]['id']){delete _0x323903[_0x1261('0x45')]['id'];}return db[_0x1261('0x39')][_0x1261('0x43')]({'where':{'id':_0x323903[_0x1261('0x40')]['id']}})[_0x1261('0x21')](handleEntityNotFound(_0x466fe8,null))['then'](saveUpdates(_0x323903[_0x1261('0x45')],null))['then'](respondWithResult(_0x466fe8,null))[_0x1261('0x3e')](handleError(_0x466fe8,null));};exports[_0x1261('0x20')]=function(_0x10523f,_0x55059e){return db[_0x1261('0x39')][_0x1261('0x43')]({'where':{'id':_0x10523f[_0x1261('0x40')]['id']}})[_0x1261('0x21')](handleEntityNotFound(_0x55059e,null))['then'](removeEntity(_0x55059e,null))['catch'](handleError(_0x55059e,null));};exports[_0x1261('0x46')]=function(_0x4f3311,_0xad8f31){return db[_0x1261('0x39')]['describe']()['then'](respondWithResult(_0xad8f31,null))['catch'](handleError(_0xad8f31,null));}; \ No newline at end of file +var _0x3279=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x50b651,_0x2ce0c5){var _0x1ec2b0=function(_0x468b6d){while(--_0x468b6d){_0x50b651['push'](_0x50b651['shift']());}};_0x1ec2b0(++_0x2ce0c5);}(_0x3279,0x94));var _0x9327=function(_0x2b0d5c,_0x1cef0b){_0x2b0d5c=_0x2b0d5c-0x0;var _0x45b074=_0x3279[_0x2b0d5c];return _0x45b074;};'use strict';var emlformat=require(_0x9327('0x0'));var rimraf=require(_0x9327('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9327('0x2'));var rp=require(_0x9327('0x3'));var moment=require(_0x9327('0x4'));var BPromise=require(_0x9327('0x5'));var Mustache=require('mustache');var util=require(_0x9327('0x6'));var path=require(_0x9327('0x7'));var sox=require(_0x9327('0x8'));var csv=require(_0x9327('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9327('0xa'));var _=require(_0x9327('0xb'));var squel=require(_0x9327('0xc'));var crypto=require(_0x9327('0xd'));var jsforce=require(_0x9327('0xe'));var deskjs=require(_0x9327('0xf'));var toCsv=require(_0x9327('0x9'));var querystring=require(_0x9327('0x10'));var Papa=require(_0x9327('0x11'));var Redis=require(_0x9327('0x12'));var authService=require(_0x9327('0x13'));var qs=require(_0x9327('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9327('0x15'))(_0x9327('0x16'));var utils=require(_0x9327('0x17'));var config=require(_0x9327('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9327('0x19'))['db'];function respondWithStatusCode(_0x2c5824,_0x51644e){_0x51644e=_0x51644e||0xcc;return function(_0x31fd62){if(_0x31fd62){return _0x2c5824[_0x9327('0x1a')](_0x51644e);}return _0x2c5824[_0x9327('0x1b')](_0x51644e)[_0x9327('0x1c')]();};}function respondWithResult(_0x356993,_0x204aa8){_0x204aa8=_0x204aa8||0xc8;return function(_0x14d1f8){if(_0x14d1f8){return _0x356993[_0x9327('0x1b')](_0x204aa8)[_0x9327('0x1d')](_0x14d1f8);}};}function respondWithFilteredResult(_0xa1fe2,_0x4c690c){return function(_0x52fb1b){if(_0x52fb1b){var _0x4eff23=typeof _0x4c690c[_0x9327('0x1e')]===_0x9327('0x1f')&&typeof _0x4c690c['limit']===_0x9327('0x1f');var _0x42d188=_0x52fb1b[_0x9327('0x20')];var _0x3830a8=_0x4eff23?0x0:_0x4c690c[_0x9327('0x1e')];var _0x20e6ab=_0x4eff23?_0x52fb1b[_0x9327('0x20')]:_0x4c690c[_0x9327('0x1e')]+_0x4c690c[_0x9327('0x21')];var _0x1fc405;if(_0x20e6ab>=_0x42d188){_0x20e6ab=_0x42d188;_0x1fc405=0xc8;}else{_0x1fc405=0xce;}_0xa1fe2[_0x9327('0x1b')](_0x1fc405);return _0xa1fe2['set'](_0x9327('0x22'),_0x3830a8+'-'+_0x20e6ab+'/'+_0x42d188)[_0x9327('0x1d')](_0x52fb1b);}return null;};}function patchUpdates(_0x5845b8){return function(_0x419b19){try{jsonpatch[_0x9327('0x23')](_0x419b19,_0x5845b8,!![]);}catch(_0x34d2b0){return BPromise[_0x9327('0x24')](_0x34d2b0);}return _0x419b19['save']();};}function saveUpdates(_0x1a601b,_0x14d594){return function(_0x3796fc){if(_0x3796fc){return _0x3796fc[_0x9327('0x25')](_0x1a601b)[_0x9327('0x26')](function(_0x2f4e83){return _0x2f4e83;});}return null;};}function removeEntity(_0x21cb3d,_0x3ed760){return function(_0x57203c){if(_0x57203c){return _0x57203c[_0x9327('0x27')]()[_0x9327('0x26')](function(){_0x21cb3d[_0x9327('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45f655,_0x2244df){return function(_0x5772fa){if(!_0x5772fa){_0x45f655[_0x9327('0x1a')](0x194);}return _0x5772fa;};}function handleError(_0x30b1f3,_0xa4dc83){_0xa4dc83=_0xa4dc83||0x1f4;return function(_0xda3974){logger[_0x9327('0x28')](_0xda3974[_0x9327('0x29')]);if(_0xda3974[_0x9327('0x2a')]){delete _0xda3974[_0x9327('0x2a')];}_0x30b1f3['status'](_0xa4dc83)['send'](_0xda3974);};}exports[_0x9327('0x2b')]=function(_0x790f1c,_0x256765){var _0x3c632b={},_0x507da9={},_0x22ba96={'count':0x0,'rows':[]};var _0xb298f9=_[_0x9327('0x2c')](db[_0x9327('0x2d')][_0x9327('0x2e')],function(_0x1dff4d){return{'name':_0x1dff4d[_0x9327('0x2f')],'type':_0x1dff4d['type'][_0x9327('0x30')]};});_0x507da9[_0x9327('0x31')]=_[_0x9327('0x2c')](_0xb298f9,'name');_0x507da9[_0x9327('0x32')]=_['keys'](_0x790f1c['query']);_0x507da9[_0x9327('0x33')]=_[_0x9327('0x34')](_0x507da9['model'],_0x507da9['query']);_0x3c632b['attributes']=_['intersection'](_0x507da9[_0x9327('0x31')],qs[_0x9327('0x35')](_0x790f1c['query'][_0x9327('0x35')]));_0x3c632b[_0x9327('0x36')]=_0x3c632b['attributes'][_0x9327('0x37')]?_0x3c632b[_0x9327('0x36')]:_0x507da9[_0x9327('0x31')];if(!_0x790f1c[_0x9327('0x32')][_0x9327('0x38')](_0x9327('0x39'))){_0x3c632b[_0x9327('0x21')]=qs[_0x9327('0x21')](_0x790f1c[_0x9327('0x32')][_0x9327('0x21')]);_0x3c632b[_0x9327('0x1e')]=qs[_0x9327('0x1e')](_0x790f1c[_0x9327('0x32')][_0x9327('0x1e')]);}_0x3c632b[_0x9327('0x3a')]=qs[_0x9327('0x3b')](_0x790f1c[_0x9327('0x32')]['sort']);_0x3c632b[_0x9327('0x3c')]=qs[_0x9327('0x33')](_['pick'](_0x790f1c['query'],_0x507da9[_0x9327('0x33')]),_0xb298f9);if(_0x790f1c['query'][_0x9327('0x3d')]){_0x3c632b['where']=_[_0x9327('0x3e')](_0x3c632b[_0x9327('0x3c')],{'$or':_[_0x9327('0x2c')](_0xb298f9,function(_0x8ddd32){if(_0x8ddd32[_0x9327('0x3f')]!==_0x9327('0x40')){var _0x2ec449={};_0x2ec449[_0x8ddd32['name']]={'$like':'%'+_0x790f1c[_0x9327('0x32')]['filter']+'%'};return _0x2ec449;}})});}_0x3c632b=_[_0x9327('0x3e')]({},_0x3c632b,_0x790f1c[_0x9327('0x41')]);var _0x1141a6={'where':_0x3c632b[_0x9327('0x3c')]};return db['VoiceDialReport'][_0x9327('0x20')](_0x1141a6)[_0x9327('0x26')](function(_0x30d00f){_0x22ba96[_0x9327('0x20')]=_0x30d00f;if(_0x790f1c[_0x9327('0x32')][_0x9327('0x42')]){_0x3c632b[_0x9327('0x43')]=[{'all':!![]}];}return db[_0x9327('0x2d')][_0x9327('0x44')](_0x3c632b);})[_0x9327('0x26')](function(_0xaea916){_0x22ba96['rows']=_0xaea916;return _0x22ba96;})[_0x9327('0x26')](respondWithFilteredResult(_0x256765,_0x3c632b))[_0x9327('0x45')](handleError(_0x256765,null));};exports[_0x9327('0x46')]=function(_0x5d02c2,_0x454448){var _0x3286ec={'raw':!![],'where':{'id':_0x5d02c2[_0x9327('0x47')]['id']}},_0x53d8f1={};_0x53d8f1[_0x9327('0x31')]=_[_0x9327('0x48')](db[_0x9327('0x2d')][_0x9327('0x2e')]);_0x53d8f1[_0x9327('0x32')]=_['keys'](_0x5d02c2['query']);_0x53d8f1['filters']=_[_0x9327('0x34')](_0x53d8f1[_0x9327('0x31')],_0x53d8f1['query']);_0x3286ec[_0x9327('0x36')]=_[_0x9327('0x34')](_0x53d8f1[_0x9327('0x31')],qs[_0x9327('0x35')](_0x5d02c2[_0x9327('0x32')][_0x9327('0x35')]));_0x3286ec[_0x9327('0x36')]=_0x3286ec[_0x9327('0x36')][_0x9327('0x37')]?_0x3286ec['attributes']:_0x53d8f1[_0x9327('0x31')];if(_0x5d02c2[_0x9327('0x32')]['includeAll']){_0x3286ec[_0x9327('0x43')]=[{'all':!![]}];}_0x3286ec=_[_0x9327('0x3e')]({},_0x3286ec,_0x5d02c2[_0x9327('0x41')]);return db[_0x9327('0x2d')][_0x9327('0x49')](_0x3286ec)[_0x9327('0x26')](handleEntityNotFound(_0x454448,null))[_0x9327('0x26')](respondWithResult(_0x454448,null))['catch'](handleError(_0x454448,null));};exports[_0x9327('0x4a')]=function(_0x2f178f,_0x457097){return db['VoiceDialReport']['create'](_0x2f178f['body'],{})['then'](respondWithResult(_0x457097,0xc9))[_0x9327('0x45')](handleError(_0x457097,null));};exports[_0x9327('0x25')]=function(_0x4ffe05,_0x224ba6){if(_0x4ffe05[_0x9327('0x4b')]['id']){delete _0x4ffe05[_0x9327('0x4b')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x4ffe05['params']['id']}})[_0x9327('0x26')](handleEntityNotFound(_0x224ba6,null))[_0x9327('0x26')](saveUpdates(_0x4ffe05[_0x9327('0x4b')],null))[_0x9327('0x26')](respondWithResult(_0x224ba6,null))[_0x9327('0x45')](handleError(_0x224ba6,null));};exports['destroy']=function(_0x2e7344,_0x1cfa3b){return db[_0x9327('0x2d')][_0x9327('0x49')]({'where':{'id':_0x2e7344[_0x9327('0x47')]['id']}})[_0x9327('0x26')](handleEntityNotFound(_0x1cfa3b,null))[_0x9327('0x26')](removeEntity(_0x1cfa3b,null))[_0x9327('0x45')](handleError(_0x1cfa3b,null));};exports['describe']=function(_0x1d2767,_0xe7d43f){return db[_0x9327('0x2d')][_0x9327('0x4c')]()['then'](respondWithResult(_0xe7d43f,null))[_0x9327('0x45')](handleError(_0xe7d43f,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 94ad27f..1631f98 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 _0x351d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash'];(function(_0x478e88,_0x5b2026){var _0x203bfd=function(_0x30b051){while(--_0x30b051){_0x478e88['push'](_0x478e88['shift']());}};_0x203bfd(++_0x5b2026);}(_0x351d,0x137));var _0xd351=function(_0x7fed7d,_0x1cf817){_0x7fed7d=_0x7fed7d-0x0;var _0x4d8273=_0x351d[_0x7fed7d];return _0x4d8273;};'use strict';var _=require(_0xd351('0x0'));var util=require(_0xd351('0x1'));var logger=require(_0xd351('0x2'))(_0xd351('0x3'));var moment=require(_0xd351('0x4'));var BPromise=require(_0xd351('0x5'));var rp=require(_0xd351('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x7'));var config=require('../../config/environment');var attributes=require(_0xd351('0x8'));module['exports']=function(_0x3c9939,_0x5657e4){return _0x3c9939[_0xd351('0x9')](_0xd351('0xa'),attributes,{'tableName':_0xd351('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd351('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa34e=['exports','define','VoiceDialReport','report_dial','lodash','util','api','moment','bluebird','./voiceDialReport.attributes'];(function(_0x3632d1,_0x5359e6){var _0x13a16a=function(_0x272d97){while(--_0x272d97){_0x3632d1['push'](_0x3632d1['shift']());}};_0x13a16a(++_0x5359e6);}(_0xa34e,0x19e));var _0xea34=function(_0x307cec,_0x1cf922){_0x307cec=_0x307cec-0x0;var _0x285c73=_0xa34e[_0x307cec];return _0x285c73;};'use strict';var _=require(_0xea34('0x0'));var util=require(_0xea34('0x1'));var logger=require('../../config/logger')(_0xea34('0x2'));var moment=require(_0xea34('0x3'));var BPromise=require(_0xea34('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(_0xea34('0x5'));module[_0xea34('0x6')]=function(_0x1cacaf,_0xbdd54f){return _0x1cacaf[_0xea34('0x7')](_0xea34('0x8'),attributes,{'tableName':_0xea34('0x9'),'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 9be5820..ddcfa3e 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 _0x4475=['UpdateVoiceDialReport','update','body','raw','where','attributes','limit','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','stringify'];(function(_0x237fb2,_0x48d794){var _0x27a93b=function(_0x13d90a){while(--_0x13d90a){_0x237fb2['push'](_0x237fb2['shift']());}};_0x27a93b(++_0x48d794);}(_0x4475,0xe7));var _0x5447=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4475[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5447('0x0'));var util=require('util');var moment=require(_0x5447('0x1'));var BPromise=require(_0x5447('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5447('0x3'))['db'];var utils=require(_0x5447('0x4'));var logger=require('../../config/logger')(_0x5447('0x5'));var config=require(_0x5447('0x6'));var jayson=require(_0x5447('0x7'));var client=jayson[_0x5447('0x8')][_0x5447('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8b78fc,_0x25e7e0,_0x432eb9){return new BPromise(function(_0x5e24f0,_0x384ccf){return client['request'](_0x8b78fc,_0x432eb9)[_0x5447('0xa')](function(_0x3cbc1b){logger['info'](_0x5447('0xb'),_0x25e7e0,_0x5447('0xc'));logger[_0x5447('0xd')](_0x5447('0xe'),_0x25e7e0,_0x5447('0xc'),JSON['stringify'](_0x3cbc1b));if(_0x3cbc1b[_0x5447('0xf')]){if(_0x3cbc1b[_0x5447('0xf')]['code']===0x1f4){logger[_0x5447('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x25e7e0,_0x3cbc1b[_0x5447('0xf')]['message']);return _0x384ccf(_0x3cbc1b['error'][_0x5447('0x10')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x25e7e0,_0x3cbc1b[_0x5447('0xf')][_0x5447('0x10')]);return _0x5e24f0(_0x3cbc1b['error'][_0x5447('0x10')]);}else{logger[_0x5447('0x11')](_0x5447('0xb'),_0x25e7e0,_0x5447('0xc'));_0x5e24f0(_0x3cbc1b[_0x5447('0x12')]['message']);}})[_0x5447('0x13')](function(_0x21c790){logger['error'](_0x5447('0xb'),_0x25e7e0,_0x21c790);_0x384ccf(_0x21c790);});});}exports[_0x5447('0x14')]=function(_0x3f9d36){var _0x385c01=this;return new Promise(function(_0x4cf648,_0x1154f2){return db[_0x5447('0x15')][_0x5447('0x16')](_0x3f9d36['body'],{'raw':_0x3f9d36[_0x5447('0x17')]?_0x3f9d36[_0x5447('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x5447('0xa')](function(_0x2bee25){logger[_0x5447('0x11')](_0x5447('0x14'),_0x3f9d36);logger[_0x5447('0xd')](_0x5447('0x14'),_0x3f9d36,JSON[_0x5447('0x18')](_0x2bee25));_0x4cf648(_0x2bee25);})[_0x5447('0x13')](function(_0x58565a){logger[_0x5447('0xf')](_0x5447('0x14'),_0x58565a[_0x5447('0x10')],_0x3f9d36);_0x1154f2(_0x385c01[_0x5447('0xf')](0x1f4,_0x58565a['message']));});});};exports[_0x5447('0x19')]=function(_0x19ae44){var _0x294ef0=this;return new Promise(function(_0x525861,_0x4d72bb){return db['VoiceDialReport'][_0x5447('0x1a')](_0x19ae44[_0x5447('0x1b')],{'raw':_0x19ae44[_0x5447('0x17')]?_0x19ae44['options'][_0x5447('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19ae44[_0x5447('0x17')]?_0x19ae44[_0x5447('0x17')][_0x5447('0x1d')]||null:null,'attributes':_0x19ae44[_0x5447('0x17')]?_0x19ae44[_0x5447('0x17')][_0x5447('0x1e')]||null:null,'limit':_0x19ae44[_0x5447('0x17')]?_0x19ae44[_0x5447('0x17')][_0x5447('0x1f')]||null:null})['then'](function(_0xb60358){logger[_0x5447('0x11')](_0x5447('0x19'),_0x19ae44);logger['debug'](_0x5447('0x19'),_0x19ae44,JSON[_0x5447('0x18')](_0xb60358));_0x525861(_0xb60358);})[_0x5447('0x13')](function(_0xf72a7b){logger['error'](_0x5447('0x19'),_0xf72a7b[_0x5447('0x10')],_0x19ae44);_0x4d72bb(_0x294ef0[_0x5447('0xf')](0x1f4,_0xf72a7b[_0x5447('0x10')]));});});}; \ No newline at end of file +var _0xd7e8=['UpdateVoiceDialReport','update','options','attributes','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','raw'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd7e8,0x1e0));var _0x8d7e=function(_0x24d140,_0x3617ce){_0x24d140=_0x24d140-0x0;var _0x51156c=_0xd7e8[_0x24d140];return _0x51156c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8d7e('0x0'));var BPromise=require('bluebird');var rs=require(_0x8d7e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d7e('0x2'))['db'];var utils=require(_0x8d7e('0x3'));var logger=require(_0x8d7e('0x4'))(_0x8d7e('0x5'));var config=require('../../config/environment');var jayson=require(_0x8d7e('0x6'));var client=jayson[_0x8d7e('0x7')][_0x8d7e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a6dbe,_0x1808b4,_0x3e0584){return new BPromise(function(_0x3ac611,_0x3de116){return client['request'](_0x4a6dbe,_0x3e0584)[_0x8d7e('0x9')](function(_0xb96158){logger[_0x8d7e('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x1808b4,_0x8d7e('0xb'));logger[_0x8d7e('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1808b4,_0x8d7e('0xb'),JSON[_0x8d7e('0xd')](_0xb96158));if(_0xb96158['error']){if(_0xb96158[_0x8d7e('0xe')][_0x8d7e('0xf')]===0x1f4){logger[_0x8d7e('0xe')](_0x8d7e('0x10'),_0x1808b4,_0xb96158['error'][_0x8d7e('0x11')]);return _0x3de116(_0xb96158[_0x8d7e('0xe')]['message']);}logger[_0x8d7e('0xe')](_0x8d7e('0x10'),_0x1808b4,_0xb96158['error']['message']);return _0x3ac611(_0xb96158[_0x8d7e('0xe')]['message']);}else{logger['info'](_0x8d7e('0x10'),_0x1808b4,_0x8d7e('0xb'));_0x3ac611(_0xb96158[_0x8d7e('0x12')][_0x8d7e('0x11')]);}})[_0x8d7e('0x13')](function(_0x47597d){logger[_0x8d7e('0xe')](_0x8d7e('0x10'),_0x1808b4,_0x47597d);_0x3de116(_0x47597d);});});}exports[_0x8d7e('0x14')]=function(_0x1dbd51){var _0x4950c9=this;return new Promise(function(_0x2d3c76,_0x20d519){return db[_0x8d7e('0x15')]['create'](_0x1dbd51[_0x8d7e('0x16')],{'raw':_0x1dbd51['options']?_0x1dbd51['options'][_0x8d7e('0x17')]===undefined?!![]:![]:!![]})[_0x8d7e('0x9')](function(_0x478b14){logger[_0x8d7e('0xa')](_0x8d7e('0x14'),_0x1dbd51);logger[_0x8d7e('0xc')](_0x8d7e('0x14'),_0x1dbd51,JSON[_0x8d7e('0xd')](_0x478b14));_0x2d3c76(_0x478b14);})[_0x8d7e('0x13')](function(_0x58b1af){logger[_0x8d7e('0xe')]('CreateVoiceDialReport',_0x58b1af['message'],_0x1dbd51);_0x20d519(_0x4950c9['error'](0x1f4,_0x58b1af[_0x8d7e('0x11')]));});});};exports[_0x8d7e('0x18')]=function(_0x4813a5){var _0x5ac256=this;return new Promise(function(_0x5e8f15,_0x5f6954){return db[_0x8d7e('0x15')][_0x8d7e('0x19')](_0x4813a5[_0x8d7e('0x16')],{'raw':_0x4813a5['options']?_0x4813a5[_0x8d7e('0x1a')][_0x8d7e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4813a5[_0x8d7e('0x1a')]?_0x4813a5[_0x8d7e('0x1a')]['where']||null:null,'attributes':_0x4813a5['options']?_0x4813a5[_0x8d7e('0x1a')][_0x8d7e('0x1b')]||null:null,'limit':_0x4813a5[_0x8d7e('0x1a')]?_0x4813a5[_0x8d7e('0x1a')]['limit']||null:null})['then'](function(_0x4b77a8){logger[_0x8d7e('0xa')](_0x8d7e('0x18'),_0x4813a5);logger[_0x8d7e('0xc')]('UpdateVoiceDialReport',_0x4813a5,JSON['stringify'](_0x4b77a8));_0x5e8f15(_0x4b77a8);})[_0x8d7e('0x13')](function(_0x44e995){logger['error']('UpdateVoiceDialReport',_0x44e995[_0x8d7e('0x11')],_0x4813a5);_0x5f6954(_0x5ac256[_0x8d7e('0xe')](0x1f4,_0x44e995[_0x8d7e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 620f045..fa03ce2 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 _0xb9d5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','/:id/applications','addApplications','put','update','delete','destroy','exports','util','express'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0xb9d5,0x178));var _0x5b9d=function(_0x10ee9e,_0x116e4f){_0x10ee9e=_0x10ee9e-0x0;var _0x203768=_0xb9d5[_0x10ee9e];return _0x203768;};'use strict';var multer=require('multer');var util=require(_0x5b9d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5b9d('0x1'));var router=express[_0x5b9d('0x2')]();var fs_extra=require(_0x5b9d('0x3'));var auth=require(_0x5b9d('0x4'));var interaction=require(_0x5b9d('0x5'));var config=require(_0x5b9d('0x6'));var controller=require(_0x5b9d('0x7'));router[_0x5b9d('0x8')]('/',auth[_0x5b9d('0x9')](),controller[_0x5b9d('0xa')]);router['get'](_0x5b9d('0xb'),auth[_0x5b9d('0x9')](),controller[_0x5b9d('0xc')]);router['post']('/',auth[_0x5b9d('0x9')](),controller[_0x5b9d('0xd')]);router['post'](_0x5b9d('0xe'),auth[_0x5b9d('0x9')](),controller[_0x5b9d('0xf')]);router[_0x5b9d('0x10')](_0x5b9d('0xb'),auth['isAuthenticated'](),controller[_0x5b9d('0x11')]);router[_0x5b9d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5b9d('0x13')]);module[_0x5b9d('0x14')]=router; \ No newline at end of file +var _0xe902=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','/:id/applications','addApplications'];(function(_0x2f53e1,_0xf43184){var _0x456d45=function(_0x52008a){while(--_0x52008a){_0x2f53e1['push'](_0x2f53e1['shift']());}};_0x456d45(++_0xf43184);}(_0xe902,0xd4));var _0x2e90=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe902[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x2e90('0x0'));var util=require(_0x2e90('0x1'));var path=require(_0x2e90('0x2'));var timeout=require(_0x2e90('0x3'));var express=require(_0x2e90('0x4'));var router=express[_0x2e90('0x5')]();var fs_extra=require(_0x2e90('0x6'));var auth=require(_0x2e90('0x7'));var interaction=require(_0x2e90('0x8'));var config=require(_0x2e90('0x9'));var controller=require('./voiceExtension.controller');router[_0x2e90('0xa')]('/',auth[_0x2e90('0xb')](),controller[_0x2e90('0xc')]);router[_0x2e90('0xa')](_0x2e90('0xd'),auth[_0x2e90('0xb')](),controller[_0x2e90('0xe')]);router['post']('/',auth[_0x2e90('0xb')](),controller[_0x2e90('0xf')]);router['post'](_0x2e90('0x10'),auth['isAuthenticated'](),controller[_0x2e90('0x11')]);router[_0x2e90('0x12')](_0x2e90('0xd'),auth['isAuthenticated'](),controller[_0x2e90('0x13')]);router[_0x2e90('0x14')](_0x2e90('0xd'),auth['isAuthenticated'](),controller[_0x2e90('0x15')]);module[_0x2e90('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 5a32a8d..0957973 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 _0xa0b1=['compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING'];(function(_0x46a7c8,_0xd927d2){var _0x5561c6=function(_0x40e362){while(--_0x40e362){_0x46a7c8['push'](_0x46a7c8['shift']());}};_0x5561c6(++_0xd927d2);}(_0xa0b1,0x10b));var _0x1a0b=function(_0xf0330b,_0x814253){_0xf0330b=_0xf0330b-0x0;var _0x538518=_0xa0b1[_0xf0330b];return _0x538518;};'use strict';var Sequelize=require(_0x1a0b('0x0'));module[_0x1a0b('0x1')]={'context':{'type':Sequelize[_0x1a0b('0x2')],'allowNull':![],'unique':_0x1a0b('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1a0b('0x2')],'allowNull':![],'unique':_0x1a0b('0x3')},'priority':{'type':Sequelize[_0x1a0b('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x1a0b('0x3')},'tag':{'type':Sequelize[_0x1a0b('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x1a0b('0x2')],'allowNull':![],'defaultValue':_0x1a0b('0x4')},'appdata':{'type':Sequelize[_0x1a0b('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x1a0b('0x5')](_0x1a0b('0x6'),_0x1a0b('0x7'),'internal',_0x1a0b('0x8'),_0x1a0b('0x9'),_0x1a0b('0xa'),_0x1a0b('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x1a0b('0x2')]},'interval':{'type':Sequelize[_0x1a0b('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x1a0b('0xc')]},'isApp':{'type':Sequelize[_0x1a0b('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x1a0b('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x1a0b('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x1a0b('0x2')],'defaultValue':_0x1a0b('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x1a0b('0xf')],'get':function(_0x129703){return this[_0x1a0b('0x10')](_0x1a0b('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd236=['ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp'];(function(_0x362151,_0x459061){var _0xea7e9f=function(_0x5ba867){while(--_0x5ba867){_0x362151['push'](_0x362151['shift']());}};_0xea7e9f(++_0x459061);}(_0xd236,0x152));var _0x6d23=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd236[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x6d23('0x0'));module['exports']={'context':{'type':Sequelize[_0x6d23('0x1')],'allowNull':![],'unique':_0x6d23('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6d23('0x1')],'allowNull':![],'unique':_0x6d23('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6d23('0x1')],'allowNull':![],'defaultValue':_0x6d23('0x3')},'appdata':{'type':Sequelize[_0x6d23('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6d23('0x4')](_0x6d23('0x5'),_0x6d23('0x6'),_0x6d23('0x7'),_0x6d23('0x8'),_0x6d23('0x9'),_0x6d23('0xa'),_0x6d23('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x6d23('0x1')]},'interval':{'type':Sequelize[_0x6d23('0x1')],'allowNull':![],'defaultValue':_0x6d23('0xc')},'IntervalId':{'type':Sequelize[_0x6d23('0xd')]},'isApp':{'type':Sequelize[_0x6d23('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6d23('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6d23('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6d23('0xd')]},'recordingFormat':{'type':Sequelize[_0x6d23('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x6d23('0xf')],'get':function(_0x899730){return this[_0x6d23('0x10')](_0x6d23('0x11'));}},'alias':{'type':Sequelize[_0x6d23('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 5e13214..57231fe 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 _0xe0d7=['keys','rawAttributes','includeAll','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','InboundRoutes','InternalRoutes','UserProfileSection','autoAssociation','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','destroy','then','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceExtension','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','options','include','rows','catch','show'];(function(_0x464913,_0x427204){var _0x1a4dc3=function(_0x35938a){while(--_0x35938a){_0x464913['push'](_0x464913['shift']());}};_0x1a4dc3(++_0x427204);}(_0xe0d7,0x14f));var _0x7e0d=function(_0x23cb8c,_0xc0e298){_0x23cb8c=_0x23cb8c-0x0;var _0x377f09=_0xe0d7[_0x23cb8c];return _0x377f09;};'use strict';var _=require('lodash');var Redis=require(_0x7e0d('0x0'));var qs=require(_0x7e0d('0x1'));var logger=require(_0x7e0d('0x2'))(_0x7e0d('0x3'));var config=require(_0x7e0d('0x4'));var db=require(_0x7e0d('0x5'))['db'];config[_0x7e0d('0x6')]=_[_0x7e0d('0x7')](config[_0x7e0d('0x6')],{'host':_0x7e0d('0x8'),'port':0x18eb});var socket=require(_0x7e0d('0x9'))(new Redis(config[_0x7e0d('0x6')]));require(_0x7e0d('0xa'))[_0x7e0d('0xb')](socket);function respondWithStatusCode(_0x10e482,_0x17eef1){_0x17eef1=_0x17eef1||0xcc;return function(_0x1d2fca){if(_0x1d2fca){return _0x10e482[_0x7e0d('0xc')](_0x17eef1);}return _0x10e482['status'](_0x17eef1)[_0x7e0d('0xd')]();};}function respondWithResult(_0x406d37,_0x502895){_0x502895=_0x502895||0xc8;return function(_0x2dd6c2){if(_0x2dd6c2){return _0x406d37[_0x7e0d('0xe')](_0x502895)[_0x7e0d('0xf')](_0x2dd6c2);}};}function respondWithFilteredResult(_0x3b4cf7,_0x2bd08b){return function(_0x280071){if(_0x280071){var _0x2066ff=typeof _0x2bd08b['offset']===_0x7e0d('0x10')&&typeof _0x2bd08b['limit']==='undefined';var _0xaeed21=_0x280071[_0x7e0d('0x11')];var _0x57f21f=_0x2066ff?0x0:_0x2bd08b['offset'];var _0x5445f2=_0x2066ff?_0x280071['count']:_0x2bd08b[_0x7e0d('0x12')]+_0x2bd08b[_0x7e0d('0x13')];var _0x5b3168;if(_0x5445f2>=_0xaeed21){_0x5445f2=_0xaeed21;_0x5b3168=0xc8;}else{_0x5b3168=0xce;}_0x3b4cf7[_0x7e0d('0xe')](_0x5b3168);return _0x3b4cf7[_0x7e0d('0x14')](_0x7e0d('0x15'),_0x57f21f+'-'+_0x5445f2+'/'+_0xaeed21)[_0x7e0d('0xf')](_0x280071);}return null;};}function removeEntity(_0x18565c){return function(_0x4fedb5){if(_0x4fedb5){return _0x4fedb5[_0x7e0d('0x16')]()[_0x7e0d('0x17')](function(){var _0x1aee7e=_0x4fedb5['get']({'plain':!![]});var _0x3e5355=[{'name':'InboundRoutes','value':_0x7e0d('0x18'),'ignore':![]},{'name':_0x7e0d('0x19'),'value':_0x7e0d('0x1a'),'ignore':![]},{'name':'InternalRoutes','value':_0x7e0d('0x1b'),'ignore':![]}];var _0x50f3be=_(_0x3e5355)[_0x7e0d('0x1c')](_0x7e0d('0x1d'))[_0x7e0d('0x1e')](_0x7e0d('0x1f'))[_0x7e0d('0x1f')]();if(_[_0x7e0d('0x20')](_0x50f3be,_0x1aee7e[_0x7e0d('0x21')])){return;}var _0x245fbd=_[_0x7e0d('0x22')](_0x3e5355,[_0x7e0d('0x1f'),_0x1aee7e[_0x7e0d('0x21')]])[_0x7e0d('0x23')];return db[_0x7e0d('0x24')][_0x7e0d('0x16')]({'where':{'type':_0x245fbd,'resourceId':_0x1aee7e['id']}})[_0x7e0d('0x17')](function(){return _0x4fedb5;});})[_0x7e0d('0x17')](function(){_0x18565c['status'](0xcc)[_0x7e0d('0xd')]();});}};}function handleEntityNotFound(_0x3e740e){return function(_0x39b182){if(!_0x39b182){_0x3e740e[_0x7e0d('0xc')](0x194);}return _0x39b182;};}function handleError(_0x9b5468,_0xeee3f2){_0xeee3f2=_0xeee3f2||0x1f4;return function(_0x423d68){logger[_0x7e0d('0x25')](_0x423d68['stack']);if(_0x423d68[_0x7e0d('0x23')]){delete _0x423d68[_0x7e0d('0x23')];}_0x9b5468[_0x7e0d('0xe')](_0xeee3f2)[_0x7e0d('0x26')](_0x423d68);};}exports[_0x7e0d('0x27')]=function(_0x122cb1,_0x4704b3){var _0x2162f9={},_0x117595={},_0x578975={'count':0x0,'rows':[]};var _0x2001e5=_[_0x7e0d('0x1e')](db[_0x7e0d('0x28')]['rawAttributes'],function(_0x12ccbc){return{'name':_0x12ccbc[_0x7e0d('0x29')],'type':_0x12ccbc[_0x7e0d('0x21')][_0x7e0d('0x2a')]};});_0x117595[_0x7e0d('0x2b')]=_['map'](_0x2001e5,_0x7e0d('0x23'));_0x117595['query']=_['keys'](_0x122cb1[_0x7e0d('0x2c')]);_0x117595[_0x7e0d('0x2d')]=_[_0x7e0d('0x2e')](_0x117595[_0x7e0d('0x2b')],_0x117595[_0x7e0d('0x2c')]);_0x2162f9['attributes']=_[_0x7e0d('0x2e')](_0x117595[_0x7e0d('0x2b')],qs[_0x7e0d('0x2f')](_0x122cb1[_0x7e0d('0x2c')][_0x7e0d('0x2f')]));_0x2162f9[_0x7e0d('0x30')]=_0x2162f9[_0x7e0d('0x30')][_0x7e0d('0x31')]?_0x2162f9['attributes']:_0x117595[_0x7e0d('0x2b')];if(!_0x122cb1[_0x7e0d('0x2c')]['hasOwnProperty'](_0x7e0d('0x32'))){_0x2162f9[_0x7e0d('0x13')]=qs[_0x7e0d('0x13')](_0x122cb1[_0x7e0d('0x2c')][_0x7e0d('0x13')]);_0x2162f9[_0x7e0d('0x12')]=qs[_0x7e0d('0x12')](_0x122cb1[_0x7e0d('0x2c')][_0x7e0d('0x12')]);}_0x2162f9[_0x7e0d('0x33')]=qs[_0x7e0d('0x34')](_0x122cb1['query'][_0x7e0d('0x34')]);_0x2162f9[_0x7e0d('0x35')]=qs[_0x7e0d('0x2d')](_[_0x7e0d('0x36')](_0x122cb1[_0x7e0d('0x2c')],_0x117595[_0x7e0d('0x2d')]),_0x2001e5);if(_0x122cb1[_0x7e0d('0x2c')]['filter']){_0x2162f9[_0x7e0d('0x35')]=_['merge'](_0x2162f9[_0x7e0d('0x35')],{'$or':_['map'](_0x2001e5,function(_0x22db5a){if(_0x22db5a['type']!=='VIRTUAL'){var _0x5b1e95={};_0x5b1e95[_0x22db5a[_0x7e0d('0x23')]]={'$like':'%'+_0x122cb1[_0x7e0d('0x2c')][_0x7e0d('0x1c')]+'%'};return _0x5b1e95;}})});}_0x2162f9=_[_0x7e0d('0x37')]({},_0x2162f9,_0x122cb1[_0x7e0d('0x38')]);var _0x31e3f0={'where':_0x2162f9[_0x7e0d('0x35')]};return db[_0x7e0d('0x28')]['count'](_0x31e3f0)[_0x7e0d('0x17')](function(_0x30777b){_0x578975['count']=_0x30777b;if(_0x122cb1[_0x7e0d('0x2c')]['includeAll']){_0x2162f9[_0x7e0d('0x39')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x2162f9);})[_0x7e0d('0x17')](function(_0x31f6ea){_0x578975[_0x7e0d('0x3a')]=_0x31f6ea;return _0x578975;})[_0x7e0d('0x17')](respondWithFilteredResult(_0x4704b3,_0x2162f9))[_0x7e0d('0x3b')](handleError(_0x4704b3,null));};exports[_0x7e0d('0x3c')]=function(_0x3d7d79,_0x2e661a){var _0xc1f4e8={'raw':![],'where':{'id':_0x3d7d79['params']['id']}},_0x2e0278={};_0x2e0278['model']=_[_0x7e0d('0x3d')](db['VoiceExtension'][_0x7e0d('0x3e')]);_0x2e0278[_0x7e0d('0x2c')]=_[_0x7e0d('0x3d')](_0x3d7d79[_0x7e0d('0x2c')]);_0x2e0278[_0x7e0d('0x2d')]=_[_0x7e0d('0x2e')](_0x2e0278['model'],_0x2e0278[_0x7e0d('0x2c')]);_0xc1f4e8[_0x7e0d('0x30')]=_['intersection'](_0x2e0278['model'],qs['fields'](_0x3d7d79['query'][_0x7e0d('0x2f')]));_0xc1f4e8[_0x7e0d('0x30')]=_0xc1f4e8[_0x7e0d('0x30')][_0x7e0d('0x31')]?_0xc1f4e8[_0x7e0d('0x30')]:_0x2e0278[_0x7e0d('0x2b')];if(_0x3d7d79['query'][_0x7e0d('0x3f')]){_0xc1f4e8[_0x7e0d('0x39')]=[{'all':!![]}];}_0xc1f4e8=_['merge']({},_0xc1f4e8,_0x3d7d79[_0x7e0d('0x38')]);return db[_0x7e0d('0x28')]['find'](_0xc1f4e8)[_0x7e0d('0x17')](handleEntityNotFound(_0x2e661a,null))[_0x7e0d('0x17')](respondWithResult(_0x2e661a,null))[_0x7e0d('0x3b')](handleError(_0x2e661a,null));};exports[_0x7e0d('0x16')]=function(_0x46606c,_0x24e820){return db[_0x7e0d('0x28')][_0x7e0d('0x22')]({'where':{'id':_0x46606c[_0x7e0d('0x40')]['id']}})[_0x7e0d('0x17')](handleEntityNotFound(_0x24e820,null))[_0x7e0d('0x17')](removeEntity(_0x24e820,null))['catch'](handleError(_0x24e820,null));};exports[_0x7e0d('0x41')]=function(_0x2c1f0d,_0x411e4a){if(_0x2c1f0d[_0x7e0d('0x42')][_0x7e0d('0x21')]==='outbound'&&!_[_0x7e0d('0x43')](_0x2c1f0d[_0x7e0d('0x42')]['exten'],'_')){_0x2c1f0d[_0x7e0d('0x42')][_0x7e0d('0x44')]='_'[_0x7e0d('0x45')](_0x2c1f0d[_0x7e0d('0x42')][_0x7e0d('0x44')]);}return db[_0x7e0d('0x28')][_0x7e0d('0x41')](_0x2c1f0d[_0x7e0d('0x42')],{'raw':![]})['then'](function(_0x5c133a){var _0x3d9e6=_0x2c1f0d[_0x7e0d('0x46')]['get']({'plain':!![]});if(!_0x3d9e6)throw new Error(_0x7e0d('0x47'));if(_0x3d9e6[_0x7e0d('0x48')]===_0x7e0d('0x46')){var _0x43a941=_0x5c133a[_0x7e0d('0x49')]({'plain':!![]});var _0x12a0f3=[{'name':_0x7e0d('0x4a'),'value':_0x7e0d('0x18')},{'name':_0x7e0d('0x19'),'value':_0x7e0d('0x1a')},{'name':_0x7e0d('0x4b'),'value':_0x7e0d('0x1b')}];var _0x3edfb4=_['find'](_0x12a0f3,[_0x7e0d('0x1f'),_0x43a941[_0x7e0d('0x21')]])[_0x7e0d('0x23')];return db[_0x7e0d('0x4c')][_0x7e0d('0x22')]({'where':{'name':_0x3edfb4,'userProfileId':_0x3d9e6['userProfileId']},'raw':!![]})[_0x7e0d('0x17')](function(_0x436605){if(_0x436605&&_0x436605[_0x7e0d('0x4d')]===0x0){return db[_0x7e0d('0x24')]['create']({'name':_0x43a941[_0x7e0d('0x23')],'resourceId':_0x43a941['id'],'type':_0x436605[_0x7e0d('0x23')],'sectionId':_0x436605['id']},{})[_0x7e0d('0x17')](function(){return _0x5c133a;});}else{return _0x5c133a;}})[_0x7e0d('0x3b')](function(_0x3e5b68){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e5b68);throw _0x3e5b68;});}return _0x5c133a;})[_0x7e0d('0x17')](respondWithResult(_0x411e4a,0xc9))[_0x7e0d('0x3b')](handleError(_0x411e4a,null));};exports[_0x7e0d('0x4e')]=function(_0x1f7dce,_0x183dcd){if(_0x1f7dce['body']['id']){delete _0x1f7dce[_0x7e0d('0x42')]['id'];}return db[_0x7e0d('0x28')][_0x7e0d('0x22')]({'where':{'id':_0x1f7dce[_0x7e0d('0x40')]['id']}})['then'](handleEntityNotFound(_0x183dcd,null))[_0x7e0d('0x17')](function(_0x229576){if(_0x229576){return db['VoiceExtension'][_0x7e0d('0x4e')](_[_0x7e0d('0x36')](_0x1f7dce[_0x7e0d('0x42')],[_0x7e0d('0x44'),_0x7e0d('0x4f'),_0x7e0d('0x50'),_0x7e0d('0x51'),_0x7e0d('0x52'),_0x7e0d('0x53'),_0x7e0d('0x54')]),{'where':{'context':_0x229576[_0x7e0d('0x4f')],'exten':_0x229576[_0x7e0d('0x44')]},'individualHooks':!![]})['then'](function(_0xd04ef6){return _0xd04ef6;});}return null;})[_0x7e0d('0x17')](respondWithStatusCode(_0x183dcd,null))[_0x7e0d('0x3b')](handleError(_0x183dcd,null));};exports[_0x7e0d('0x55')]=function(_0x222214,_0x318080){var _0x1b0791=_0x222214[_0x7e0d('0x40')]['id'];var _0x3e7b33=_0x222214['body'];var _0x135875=0xc8;var _0x8c37f7=null;return db['sequelize'][_0x7e0d('0x56')]({'isolationLevel':db[_0x7e0d('0x57')][_0x7e0d('0x58')][_0x7e0d('0x59')]['READ_COMMITTED']},function(_0x443d22){return db[_0x7e0d('0x28')][_0x7e0d('0x5a')]({'where':{'id':_0x1b0791},'transaction':_0x443d22})[_0x7e0d('0x17')](function(_0x186738){if(_0x186738){return db[_0x7e0d('0x28')][_0x7e0d('0x16')]({'where':{'VoiceExtensionId':_0x1b0791},'transaction':_0x443d22})['then'](function(){var _0x523958=_[_0x7e0d('0x1e')](_0x3e7b33,function(_0x573f37){_0x573f37[_0x7e0d('0x5b')]=_0x1b0791;_0x573f37[_0x7e0d('0x5c')]=!![];return _0x573f37;});return _0x186738[_0x7e0d('0x5d')](_0x523958);})[_0x7e0d('0x17')](function(_0x6a4c80){return db[_0x7e0d('0x28')][_0x7e0d('0x5e')](_0x6a4c80,{'transaction':_0x443d22});});}else{_0x135875=0x194;_0x8c37f7=[];}});})['then'](function(){if(_0x135875!==0x194){return db[_0x7e0d('0x28')][_0x7e0d('0x5f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1b0791},'order':_0x7e0d('0x60')})['then'](function(_0x4b2425){_0x8c37f7=_0x4b2425;});}})[_0x7e0d('0x3b')](function(_0x29c8f7){_0x135875=0x1f4;logger[_0x7e0d('0x25')](_0x29c8f7[_0x7e0d('0x61')]);if(_0x29c8f7[_0x7e0d('0x23')]){delete _0x29c8f7[_0x7e0d('0x23')];}_0x8c37f7=_0x29c8f7;})[_0x7e0d('0x62')](function(){if(_0x8c37f7===null){_0x318080[_0x7e0d('0xc')](_0x135875);}else{if(_0x135875===0x1f4){_0x318080['status'](_0x135875)[_0x7e0d('0x26')](_0x8c37f7);}else{_0x318080['status'](_0x135875)[_0x7e0d('0xf')](_0x8c37f7);}}});}; \ No newline at end of file +var _0x2dec=['options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','OutboundRoutes','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','send','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','find','type','name','UserProfileResource','index','VoiceExtension','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge'];(function(_0x36ca51,_0x2c29bd){var _0xc5c29d=function(_0x1c2048){while(--_0x1c2048){_0x36ca51['push'](_0x36ca51['shift']());}};_0xc5c29d(++_0x2c29bd);}(_0x2dec,0xe2));var _0xc2de=function(_0x370723,_0x179030){_0x370723=_0x370723-0x0;var _0x4f82bb=_0x2dec[_0x370723];return _0x4f82bb;};'use strict';var _=require('lodash');var Redis=require(_0xc2de('0x0'));var qs=require(_0xc2de('0x1'));var logger=require(_0xc2de('0x2'))(_0xc2de('0x3'));var config=require('../../config/environment');var db=require(_0xc2de('0x4'))['db'];config['redis']=_[_0xc2de('0x5')](config['redis'],{'host':_0xc2de('0x6'),'port':0x18eb});var socket=require(_0xc2de('0x7'))(new Redis(config[_0xc2de('0x8')]));require(_0xc2de('0x9'))[_0xc2de('0xa')](socket);function respondWithStatusCode(_0x47f123,_0x4de8b9){_0x4de8b9=_0x4de8b9||0xcc;return function(_0x328feb){if(_0x328feb){return _0x47f123[_0xc2de('0xb')](_0x4de8b9);}return _0x47f123[_0xc2de('0xc')](_0x4de8b9)[_0xc2de('0xd')]();};}function respondWithResult(_0x46b1e0,_0xa8c4c5){_0xa8c4c5=_0xa8c4c5||0xc8;return function(_0x2f94ef){if(_0x2f94ef){return _0x46b1e0[_0xc2de('0xc')](_0xa8c4c5)[_0xc2de('0xe')](_0x2f94ef);}};}function respondWithFilteredResult(_0x265d4b,_0x5341d0){return function(_0x387a47){if(_0x387a47){var _0x51b951=typeof _0x5341d0[_0xc2de('0xf')]===_0xc2de('0x10')&&typeof _0x5341d0[_0xc2de('0x11')]===_0xc2de('0x10');var _0x2f71a5=_0x387a47[_0xc2de('0x12')];var _0x185c99=_0x51b951?0x0:_0x5341d0[_0xc2de('0xf')];var _0x12609c=_0x51b951?_0x387a47[_0xc2de('0x12')]:_0x5341d0[_0xc2de('0xf')]+_0x5341d0['limit'];var _0x252cf3;if(_0x12609c>=_0x2f71a5){_0x12609c=_0x2f71a5;_0x252cf3=0xc8;}else{_0x252cf3=0xce;}_0x265d4b[_0xc2de('0xc')](_0x252cf3);return _0x265d4b[_0xc2de('0x13')](_0xc2de('0x14'),_0x185c99+'-'+_0x12609c+'/'+_0x2f71a5)[_0xc2de('0xe')](_0x387a47);}return null;};}function removeEntity(_0x3051a7){return function(_0x2c0cee){if(_0x2c0cee){return _0x2c0cee[_0xc2de('0x15')]()[_0xc2de('0x16')](function(){var _0x2d0ae2=_0x2c0cee[_0xc2de('0x17')]({'plain':!![]});var _0x122c13=[{'name':'InboundRoutes','value':_0xc2de('0x18'),'ignore':![]},{'name':'OutboundRoutes','value':_0xc2de('0x19'),'ignore':![]},{'name':_0xc2de('0x1a'),'value':_0xc2de('0x1b'),'ignore':![]}];var _0x9daed0=_(_0x122c13)[_0xc2de('0x1c')](_0xc2de('0x1d'))[_0xc2de('0x1e')](_0xc2de('0x1f'))[_0xc2de('0x1f')]();if(_['includes'](_0x9daed0,_0x2d0ae2['type'])){return;}var _0x27c1b8=_[_0xc2de('0x20')](_0x122c13,['value',_0x2d0ae2[_0xc2de('0x21')]])[_0xc2de('0x22')];return db[_0xc2de('0x23')][_0xc2de('0x15')]({'where':{'type':_0x27c1b8,'resourceId':_0x2d0ae2['id']}})[_0xc2de('0x16')](function(){return _0x2c0cee;});})[_0xc2de('0x16')](function(){_0x3051a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49d9ee){return function(_0x496be0){if(!_0x496be0){_0x49d9ee[_0xc2de('0xb')](0x194);}return _0x496be0;};}function handleError(_0x47053c,_0x13ae65){_0x13ae65=_0x13ae65||0x1f4;return function(_0x25899e){logger['error'](_0x25899e['stack']);if(_0x25899e['name']){delete _0x25899e[_0xc2de('0x22')];}_0x47053c[_0xc2de('0xc')](_0x13ae65)['send'](_0x25899e);};}exports[_0xc2de('0x24')]=function(_0x2ca76b,_0x2044a9){var _0x4f3cbf={},_0x5ca45a={},_0x5ba28a={'count':0x0,'rows':[]};var _0x247c6e=_[_0xc2de('0x1e')](db[_0xc2de('0x25')]['rawAttributes'],function(_0x4718c4){return{'name':_0x4718c4[_0xc2de('0x26')],'type':_0x4718c4[_0xc2de('0x21')][_0xc2de('0x27')]};});_0x5ca45a['model']=_[_0xc2de('0x1e')](_0x247c6e,_0xc2de('0x22'));_0x5ca45a[_0xc2de('0x28')]=_[_0xc2de('0x29')](_0x2ca76b[_0xc2de('0x28')]);_0x5ca45a[_0xc2de('0x2a')]=_[_0xc2de('0x2b')](_0x5ca45a[_0xc2de('0x2c')],_0x5ca45a['query']);_0x4f3cbf[_0xc2de('0x2d')]=_[_0xc2de('0x2b')](_0x5ca45a['model'],qs[_0xc2de('0x2e')](_0x2ca76b['query'][_0xc2de('0x2e')]));_0x4f3cbf[_0xc2de('0x2d')]=_0x4f3cbf[_0xc2de('0x2d')]['length']?_0x4f3cbf[_0xc2de('0x2d')]:_0x5ca45a[_0xc2de('0x2c')];if(!_0x2ca76b[_0xc2de('0x28')][_0xc2de('0x2f')]('nolimit')){_0x4f3cbf[_0xc2de('0x11')]=qs[_0xc2de('0x11')](_0x2ca76b['query'][_0xc2de('0x11')]);_0x4f3cbf[_0xc2de('0xf')]=qs[_0xc2de('0xf')](_0x2ca76b[_0xc2de('0x28')][_0xc2de('0xf')]);}_0x4f3cbf[_0xc2de('0x30')]=qs[_0xc2de('0x31')](_0x2ca76b[_0xc2de('0x28')]['sort']);_0x4f3cbf[_0xc2de('0x32')]=qs['filters'](_[_0xc2de('0x33')](_0x2ca76b['query'],_0x5ca45a[_0xc2de('0x2a')]),_0x247c6e);if(_0x2ca76b[_0xc2de('0x28')][_0xc2de('0x1c')]){_0x4f3cbf[_0xc2de('0x32')]=_[_0xc2de('0x34')](_0x4f3cbf[_0xc2de('0x32')],{'$or':_[_0xc2de('0x1e')](_0x247c6e,function(_0x37e16e){if(_0x37e16e['type']!=='VIRTUAL'){var _0x2d32f3={};_0x2d32f3[_0x37e16e['name']]={'$like':'%'+_0x2ca76b[_0xc2de('0x28')]['filter']+'%'};return _0x2d32f3;}})});}_0x4f3cbf=_['merge']({},_0x4f3cbf,_0x2ca76b[_0xc2de('0x35')]);var _0xcb167e={'where':_0x4f3cbf[_0xc2de('0x32')]};return db['VoiceExtension'][_0xc2de('0x12')](_0xcb167e)[_0xc2de('0x16')](function(_0x4c5532){_0x5ba28a[_0xc2de('0x12')]=_0x4c5532;if(_0x2ca76b[_0xc2de('0x28')][_0xc2de('0x36')]){_0x4f3cbf[_0xc2de('0x37')]=[{'all':!![]}];}return db['VoiceExtension'][_0xc2de('0x38')](_0x4f3cbf);})[_0xc2de('0x16')](function(_0x40f864){_0x5ba28a[_0xc2de('0x39')]=_0x40f864;return _0x5ba28a;})['then'](respondWithFilteredResult(_0x2044a9,_0x4f3cbf))[_0xc2de('0x3a')](handleError(_0x2044a9,null));};exports[_0xc2de('0x3b')]=function(_0xb02d13,_0x442290){var _0x4a3174={'raw':![],'where':{'id':_0xb02d13[_0xc2de('0x3c')]['id']}},_0x2739b8={};_0x2739b8['model']=_[_0xc2de('0x29')](db['VoiceExtension'][_0xc2de('0x3d')]);_0x2739b8['query']=_['keys'](_0xb02d13[_0xc2de('0x28')]);_0x2739b8[_0xc2de('0x2a')]=_['intersection'](_0x2739b8[_0xc2de('0x2c')],_0x2739b8[_0xc2de('0x28')]);_0x4a3174[_0xc2de('0x2d')]=_[_0xc2de('0x2b')](_0x2739b8[_0xc2de('0x2c')],qs['fields'](_0xb02d13[_0xc2de('0x28')]['fields']));_0x4a3174[_0xc2de('0x2d')]=_0x4a3174['attributes']['length']?_0x4a3174['attributes']:_0x2739b8[_0xc2de('0x2c')];if(_0xb02d13[_0xc2de('0x28')][_0xc2de('0x36')]){_0x4a3174[_0xc2de('0x37')]=[{'all':!![]}];}_0x4a3174=_[_0xc2de('0x34')]({},_0x4a3174,_0xb02d13['options']);return db[_0xc2de('0x25')]['find'](_0x4a3174)[_0xc2de('0x16')](handleEntityNotFound(_0x442290,null))[_0xc2de('0x16')](respondWithResult(_0x442290,null))[_0xc2de('0x3a')](handleError(_0x442290,null));};exports['destroy']=function(_0x1987fc,_0x114073){return db[_0xc2de('0x25')][_0xc2de('0x20')]({'where':{'id':_0x1987fc[_0xc2de('0x3c')]['id']}})[_0xc2de('0x16')](handleEntityNotFound(_0x114073,null))[_0xc2de('0x16')](removeEntity(_0x114073,null))['catch'](handleError(_0x114073,null));};exports['create']=function(_0x42f06f,_0x3c4947){if(_0x42f06f[_0xc2de('0x3e')][_0xc2de('0x21')]===_0xc2de('0x19')&&!_['startsWith'](_0x42f06f['body'][_0xc2de('0x3f')],'_')){_0x42f06f['body']['exten']='_'['concat'](_0x42f06f['body'][_0xc2de('0x3f')]);}return db[_0xc2de('0x25')][_0xc2de('0x40')](_0x42f06f[_0xc2de('0x3e')],{'raw':![]})['then'](function(_0x280a20){var _0x337b92=_0x42f06f[_0xc2de('0x41')][_0xc2de('0x17')]({'plain':!![]});if(!_0x337b92)throw new Error(_0xc2de('0x42'));if(_0x337b92['role']===_0xc2de('0x41')){var _0x4ee038=_0x280a20[_0xc2de('0x17')]({'plain':!![]});var _0x5b8a7f=[{'name':_0xc2de('0x43'),'value':'inbound'},{'name':_0xc2de('0x44'),'value':_0xc2de('0x19')},{'name':_0xc2de('0x1a'),'value':_0xc2de('0x1b')}];var _0x5899a5=_[_0xc2de('0x20')](_0x5b8a7f,['value',_0x4ee038[_0xc2de('0x21')]])[_0xc2de('0x22')];return db[_0xc2de('0x45')][_0xc2de('0x20')]({'where':{'name':_0x5899a5,'userProfileId':_0x337b92['userProfileId']},'raw':!![]})[_0xc2de('0x16')](function(_0x5194ec){if(_0x5194ec&&_0x5194ec['autoAssociation']===0x0){return db[_0xc2de('0x23')][_0xc2de('0x40')]({'name':_0x4ee038['name'],'resourceId':_0x4ee038['id'],'type':_0x5194ec[_0xc2de('0x22')],'sectionId':_0x5194ec['id']},{})['then'](function(){return _0x280a20;});}else{return _0x280a20;}})[_0xc2de('0x3a')](function(_0x3d1825){logger[_0xc2de('0x46')](_0xc2de('0x47'),_0x3d1825);throw _0x3d1825;});}return _0x280a20;})[_0xc2de('0x16')](respondWithResult(_0x3c4947,0xc9))[_0xc2de('0x3a')](handleError(_0x3c4947,null));};exports[_0xc2de('0x48')]=function(_0x427cf2,_0x436d8e){if(_0x427cf2[_0xc2de('0x3e')]['id']){delete _0x427cf2[_0xc2de('0x3e')]['id'];}return db['VoiceExtension'][_0xc2de('0x20')]({'where':{'id':_0x427cf2['params']['id']}})[_0xc2de('0x16')](handleEntityNotFound(_0x436d8e,null))[_0xc2de('0x16')](function(_0x9b0568){if(_0x9b0568){return db[_0xc2de('0x25')]['update'](_[_0xc2de('0x33')](_0x427cf2[_0xc2de('0x3e')],['exten',_0xc2de('0x49'),'description',_0xc2de('0x4a'),_0xc2de('0x4b'),_0xc2de('0x4c'),_0xc2de('0x4d')]),{'where':{'context':_0x9b0568[_0xc2de('0x49')],'exten':_0x9b0568[_0xc2de('0x3f')]},'individualHooks':!![]})['then'](function(_0x37c0c1){return _0x37c0c1;});}return null;})[_0xc2de('0x16')](respondWithStatusCode(_0x436d8e,null))[_0xc2de('0x3a')](handleError(_0x436d8e,null));};exports[_0xc2de('0x4e')]=function(_0x28b5e4,_0x2222a8){var _0x246713=_0x28b5e4[_0xc2de('0x3c')]['id'];var _0x5e8bc2=_0x28b5e4[_0xc2de('0x3e')];var _0xb84b45=0xc8;var _0x3fa2f9=null;return db[_0xc2de('0x4f')][_0xc2de('0x50')]({'isolationLevel':db[_0xc2de('0x4f')][_0xc2de('0x51')][_0xc2de('0x52')]['READ_COMMITTED']},function(_0x23e5f0){return db[_0xc2de('0x25')][_0xc2de('0x53')]({'where':{'id':_0x246713},'transaction':_0x23e5f0})[_0xc2de('0x16')](function(_0x3902e5){if(_0x3902e5){return db['VoiceExtension'][_0xc2de('0x15')]({'where':{'VoiceExtensionId':_0x246713},'transaction':_0x23e5f0})[_0xc2de('0x16')](function(){var _0x3df863=_['map'](_0x5e8bc2,function(_0x23d72e){_0x23d72e[_0xc2de('0x54')]=_0x246713;_0x23d72e[_0xc2de('0x55')]=!![];return _0x23d72e;});return _0x3902e5[_0xc2de('0x56')](_0x3df863);})[_0xc2de('0x16')](function(_0x400cfe){return db[_0xc2de('0x25')][_0xc2de('0x57')](_0x400cfe,{'transaction':_0x23e5f0});});}else{_0xb84b45=0x194;_0x3fa2f9=[];}});})[_0xc2de('0x16')](function(){if(_0xb84b45!==0x194){return db[_0xc2de('0x25')][_0xc2de('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x246713},'order':_0xc2de('0x59')})['then'](function(_0x137ef7){_0x3fa2f9=_0x137ef7;});}})['catch'](function(_0x3dfd17){_0xb84b45=0x1f4;logger[_0xc2de('0x46')](_0x3dfd17[_0xc2de('0x5a')]);if(_0x3dfd17[_0xc2de('0x22')]){delete _0x3dfd17[_0xc2de('0x22')];}_0x3fa2f9=_0x3dfd17;})[_0xc2de('0x5b')](function(){if(_0x3fa2f9===null){_0x2222a8[_0xc2de('0xb')](_0xb84b45);}else{if(_0xb84b45===0x1f4){_0x2222a8[_0xc2de('0xc')](_0xb84b45)[_0xc2de('0x5c')](_0x3fa2f9);}else{_0x2222a8[_0xc2de('0xc')](_0xb84b45)['json'](_0x3fa2f9);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index cebf62f..f54028e 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 _0x36ab=['events','../../mysqldb','setMaxListeners','save','update','emit','exports'];(function(_0x13dd2d,_0x376196){var _0x5d4833=function(_0x223875){while(--_0x223875){_0x13dd2d['push'](_0x13dd2d['shift']());}};_0x5d4833(++_0x376196);}(_0x36ab,0xd2));var _0xb36a=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x36ab[_0xdc37a1];return _0x99b4fe;};'use strict';var EventEmitter=require(_0xb36a('0x0'));var VoiceExtension=require(_0xb36a('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb36a('0x2')](0x0);var events={'afterCreate':_0xb36a('0x3'),'afterUpdate':_0xb36a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e23e9){return function(_0x302975,_0x65402f,_0x390837){VoiceExtensionEvents[_0xb36a('0x5')](_0x3e23e9+':'+_0x302975['id'],_0x302975);VoiceExtensionEvents[_0xb36a('0x5')](_0x3e23e9,_0x302975);_0x390837(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xb36a('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xcdf6=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x45271f,_0x417470){var _0x9f819e=function(_0x52b1bf){while(--_0x52b1bf){_0x45271f['push'](_0x45271f['shift']());}};_0x9f819e(++_0x417470);}(_0xcdf6,0x100));var _0x6cdf=function(_0x3dd10a,_0x1fcaf2){_0x3dd10a=_0x3dd10a-0x0;var _0x2a685f=_0xcdf6[_0x3dd10a];return _0x2a685f;};'use strict';var EventEmitter=require(_0x6cdf('0x0'));var VoiceExtension=require(_0x6cdf('0x1'))['db'][_0x6cdf('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6cdf('0x3')](0x0);var events={'afterCreate':_0x6cdf('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4d0589){return function(_0x2bea74,_0x8a17d6,_0x290630){VoiceExtensionEvents[_0x6cdf('0x5')](_0x4d0589+':'+_0x2bea74['id'],_0x2bea74);VoiceExtensionEvents[_0x6cdf('0x5')](_0x4d0589,_0x2bea74);_0x290630(null);};}for(var e in events){if(events[_0x6cdf('0x6')](e)){var event=events[e];VoiceExtension[_0x6cdf('0x7')](e,emitEvent(event));}}module[_0x6cdf('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 e4b4259..f5e3252 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 _0x3f1c=['alias','No\x20alias\x20set','push','Set','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','CDR(prefix)=${EXTEN:0:','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','length','name','trunk','param','split','phone','prefix','SIP','join','none','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','IntervalId','then','intervals','interval','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','last','priority','catch','define','VoiceExtension','voice_extensions','concat','Hangup','lodash','type','CDR(type)=','context','exten','NoOp','CDR(routeAlias)='];(function(_0xa19632,_0x4d5df5){var _0xc2e16=function(_0x4876ed){while(--_0x4876ed){_0xa19632['push'](_0xa19632['shift']());}};_0xc2e16(++_0x4d5df5);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x361714,_0x5a93d5){_0x361714=_0x361714-0x0;var _0x3cc3f0=_0x3f1c[_0x361714];return _0x3cc3f0;};'use strict';var _=require(_0xc3f1('0x0'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x244293){var _0x47b765=_0x244293['models'];function _0x2679d9(_0x456f50){var _0x9f016d=0x2;var _0xaa09ea=[{'type':_0x456f50[_0xc3f1('0x1')],'app':'Set','appdata':_0xc3f1('0x2')+_0x456f50['type'],'context':_0x456f50[_0xc3f1('0x3')],'exten':_0x456f50[_0xc3f1('0x4')],'priority':_0x9f016d++,'VoiceExtensionId':_0x456f50['id']},{'type':_0x456f50[_0xc3f1('0x1')],'app':_0x456f50['alias']?'Set':_0xc3f1('0x5'),'appdata':_0x456f50['alias']?_0xc3f1('0x6')+_0x456f50[_0xc3f1('0x7')]:_0xc3f1('0x8'),'context':_0x456f50[_0xc3f1('0x3')],'exten':_0x456f50['exten'],'priority':_0x9f016d++,'VoiceExtensionId':_0x456f50['id']}];if(_0x456f50[_0xc3f1('0x1')]==='inbound'){_0xaa09ea[_0xc3f1('0x9')]({'type':'inbound','app':_0xc3f1('0xa'),'appdata':'CDR(routeid)='+_0x456f50['id'],'context':_0x456f50['context'],'exten':_0x456f50[_0xc3f1('0x4')],'priority':_0x9f016d++,'VoiceExtensionId':_0x456f50['id']});}_0xaa09ea[_0xc3f1('0x9')]({'type':_0x456f50[_0xc3f1('0x1')],'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0xb'),'context':_0x456f50[_0xc3f1('0x3')],'exten':_0x456f50['exten'],'priority':_0x9f016d++,'VoiceExtensionId':_0x456f50['id']},{'type':_0x456f50['type'],'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0xc'),'context':_0x456f50[_0xc3f1('0x3')],'exten':_0x456f50[_0xc3f1('0x4')],'priority':_0x9f016d++,'VoiceExtensionId':_0x456f50['id']},{'type':_0x456f50['type'],'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0xd'),'context':_0x456f50[_0xc3f1('0x3')],'exten':_0x456f50[_0xc3f1('0x4')],'priority':_0x9f016d++,'VoiceExtensionId':_0x456f50['id']});return _0xaa09ea;}function _0x5796c4(_0x3c51c1){var _0x59e1e3=0x2;var _0x462599=[{'type':_0xc3f1('0xe'),'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0xf'),'context':_0x3c51c1['context'],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':_0x3c51c1[_0xc3f1('0x7')]?_0xc3f1('0xa'):_0xc3f1('0x5'),'appdata':_0x3c51c1['alias']?_0xc3f1('0x6')+_0x3c51c1['alias']:'No\x20alias\x20set','context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':_0xc3f1('0xa'),'appdata':'CDR(destination)='+(_0x3c51c1[_0xc3f1('0x10')]?_0xc3f1('0x11')+_0x3c51c1[_0xc3f1('0x10')]+'}':_0xc3f1('0x12')),'context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':_0xc3f1('0xa'),'appdata':'CDR(routeid)='+_0x3c51c1['id'],'context':_0x3c51c1['context'],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':_0xc3f1('0x13'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x59e1e3+0x2)+'):Goto('+(_0x59e1e3+0x1)+')','context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':'Set','appdata':_0x3c51c1['cutdigits']?_0xc3f1('0x14')+_0x3c51c1[_0xc3f1('0x10')]+'}':'CDR(prefix)=noprefix','context':_0x3c51c1['context'],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':'Set','appdata':_0xc3f1('0xb'),'context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0xc'),'context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1['exten'],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0xd'),'context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':'outbound','app':_0xc3f1('0xa'),'appdata':'outboundrouteid='+_0x3c51c1['id'],'context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1['exten'],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']}];if(_0x3c51c1['hasOwnProperty'](_0xc3f1('0x15'))&&_0x3c51c1[_0xc3f1('0x15')]!=='none'){_0x462599[_0xc3f1('0x9')]({'type':_0xc3f1('0xe'),'app':'Set','appdata':_0xc3f1('0x16'),'context':_0x3c51c1['context'],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']},{'type':_0xc3f1('0xe'),'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0x17')+_0x3c51c1[_0xc3f1('0x15')]||'wav','context':_0x3c51c1[_0xc3f1('0x3')],'exten':_0x3c51c1[_0xc3f1('0x4')],'priority':_0x59e1e3++,'VoiceExtensionId':_0x3c51c1['id']});}return _0x462599;}function _0x552abe(_0x11aac3,_0x3b7f88){var _0x1ba48e=[{'name':'trunk','param':0x0},{'name':_0xc3f1('0x18'),'param':0x1},{'name':_0xc3f1('0x19'),'param':0x2},{'name':'url','param':0x3}];var _0x136ebf={};var _0x7bc49a=_0x3b7f88['split'](',');var _0x3c0e33=[];for(var _0x3db48e=0x0;_0x3db48e<_0x1ba48e[_0xc3f1('0x1a')];_0x3db48e++){switch(_0x1ba48e[_0x3db48e][_0xc3f1('0x1b')]){case _0xc3f1('0x1c'):_0x136ebf[_0xc3f1('0x1c')]=_0x7bc49a[_0x1ba48e[_0x3db48e][_0xc3f1('0x1d')]][_0xc3f1('0x1e')]('/')[0x1];_0x136ebf[_0xc3f1('0x1f')]=_0x7bc49a[_0x1ba48e[_0x3db48e][_0xc3f1('0x1d')]][_0xc3f1('0x1e')]('/')[0x2];_0x136ebf['prefix']=_0x136ebf[_0xc3f1('0x1f')]?_0x136ebf['phone']['split']('$')[0x0]:undefined;_0x136ebf[_0xc3f1('0x1f')]=_0x11aac3[_0xc3f1('0x10')]?(_0x136ebf[_0xc3f1('0x20')]||'')+'${EXTEN:'+_0x11aac3[_0xc3f1('0x10')]+'}':(_0x136ebf[_0xc3f1('0x20')]||'')+_0xc3f1('0x12');_0x3c0e33[_0x1ba48e[_0x3db48e][_0xc3f1('0x1d')]]=[_0xc3f1('0x21'),_0x136ebf[_0xc3f1('0x1c')],_0x136ebf['phone']][_0xc3f1('0x22')]('/');break;case _0xc3f1('0x19'):_0x136ebf[_0xc3f1('0x19')]=_0x7bc49a[_0x1ba48e[_0x3db48e]['param']];if(_0x11aac3['recordingFormat']!==_0xc3f1('0x23')){if(_0x136ebf[_0xc3f1('0x19')]['indexOf'](_0xc3f1('0x24'))<0x0){_0x136ebf[_0xc3f1('0x19')]+='U(xcally-mixmonitor-context)';}}else{_0x136ebf['options']=_0x136ebf['options']['replace']('U(xcally-mixmonitor-context)','');}_0x3c0e33[_0x1ba48e[_0x3db48e][_0xc3f1('0x1d')]]=_0x136ebf[_0xc3f1('0x19')];break;default:_0x3c0e33[_0x1ba48e[_0x3db48e][_0xc3f1('0x1d')]]=_0x7bc49a[_0x1ba48e[_0x3db48e][_0xc3f1('0x1d')]];}}return _0x3c0e33['join'](',');}function _0x4b4bce(_0x6800c0,_0x1e73da,_0xc8ce42){return new Promise(function(_0x45cd40,_0xab9c5d){var _0x6ef0e3=[];if(_[_0xc3f1('0x25')](_0x1e73da))return _0x45cd40(_0x6ef0e3);_0x47b765[_0xc3f1('0x26')][_0xc3f1('0x27')]({'attributes':['id','interval',_0xc3f1('0x28')],'raw':!![]})[_0xc3f1('0x29')](function(_0x498df7){for(var _0xb5a950=0x0,_0x3df648=0x0;_0xb5a950<_0x1e73da[_0xc3f1('0x1a')];_0xb5a950++,_0x3df648=0x0){var _0x34fbe7=_0x1e73da[_0xb5a950];var _0x4ff39e=[];var _0x5ee54e=[];delete _0x34fbe7['id'];if(_0x34fbe7['interval']!=='*,*,*,*'){_0x34fbe7[_0xc3f1('0x2a')]=[_0x34fbe7[_0xc3f1('0x2b')]];}else{_0x34fbe7['intervals']=_0x34fbe7[_0xc3f1('0x28')]?_[_0xc3f1('0x2c')](_[_0xc3f1('0x2d')](_0x498df7,{'IntervalId':_0x34fbe7[_0xc3f1('0x28')]}),_0xc3f1('0x2b')):[];}_0x34fbe7[_0xc3f1('0x3')]=_0x6800c0[_0xc3f1('0x3')];_0x34fbe7['exten']=_0x6800c0[_0xc3f1('0x4')];if(_0x34fbe7[_0xc3f1('0x1')])_0x34fbe7['type']=_0x34fbe7[_0xc3f1('0x1')][_0xc3f1('0x2e')]();if(_0x6800c0[_0xc3f1('0x1')]==='outbound'){if(_0x34fbe7[_0xc3f1('0x2f')](_0xc3f1('0x30'))&&_0x34fbe7['tag']&&_0x34fbe7[_0xc3f1('0x30')]!=='--'){_0x4ff39e[_0xc3f1('0x9')]({'type':_0x34fbe7[_0xc3f1('0x1')][_0xc3f1('0x2e')](),'app':_0xc3f1('0xa'),'appdata':_0xc3f1('0x31')+_0x34fbe7[_0xc3f1('0x30')],'context':_0x6800c0[_0xc3f1('0x3')],'exten':_0x6800c0[_0xc3f1('0x4')],'priority':_0x34fbe7['intervals'][_0xc3f1('0x1a')]+_0xc8ce42+_0x3df648++,'VoiceExtensionId':_0x6800c0['id']});}_0x4ff39e['push']({'type':_0x34fbe7[_0xc3f1('0x1')][_0xc3f1('0x2e')](),'app':_0xc3f1('0x13'),'appdata':_0xc3f1('0x32')+(_0x34fbe7[_0xc3f1('0x33')]?_0xc3f1('0x34')+_0x34fbe7[_0xc3f1('0x33')]+')':'NoOp(No\x20number\x20available)'),'context':_0x6800c0[_0xc3f1('0x3')],'exten':_0x6800c0[_0xc3f1('0x4')],'priority':_0x34fbe7['intervals'][_0xc3f1('0x1a')]+_0xc8ce42+_0x3df648++,'VoiceExtensionId':_0x6800c0['id']});}else{if(_0x34fbe7[_0xc3f1('0x2f')](_0xc3f1('0x35'))){if([_0xc3f1('0x36'),_0xc3f1('0x37')]['includes'](_0x34fbe7[_0xc3f1('0x38')][_0xc3f1('0x2e')]())&&_0x34fbe7[_0xc3f1('0x39')]!==_0xc3f1('0x3a')){if(_0x34fbe7[_0xc3f1('0x35')]){_0x4ff39e[_0xc3f1('0x9')]({'type':_0x34fbe7['type'][_0xc3f1('0x2e')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x6800c0[_0xc3f1('0x3')],'exten':_0x6800c0[_0xc3f1('0x4')],'priority':_0x34fbe7[_0xc3f1('0x2a')][_0xc3f1('0x1a')]+_0xc8ce42+_0x3df648++,'VoiceExtensionId':_0x6800c0['id']});_0x4ff39e[_0xc3f1('0x9')]({'type':_0x34fbe7[_0xc3f1('0x1')]['toLowerCase'](),'app':'Set','appdata':_0xc3f1('0x3b'),'context':_0x6800c0[_0xc3f1('0x3')],'exten':_0x6800c0['exten'],'priority':_0x34fbe7[_0xc3f1('0x2a')][_0xc3f1('0x1a')]+_0xc8ce42+_0x3df648++,'VoiceExtensionId':_0x6800c0['id']});}else{_0x4ff39e['push']({'type':_0x34fbe7[_0xc3f1('0x1')]['toLowerCase'](),'app':'ExecIf','appdata':_0xc3f1('0x3c'),'context':_0x6800c0[_0xc3f1('0x3')],'exten':_0x6800c0[_0xc3f1('0x4')],'priority':_0x34fbe7[_0xc3f1('0x2a')][_0xc3f1('0x1a')]+_0xc8ce42+_0x3df648++,'VoiceExtensionId':_0x6800c0['id']});_0x4ff39e['push']({'type':_0x34fbe7[_0xc3f1('0x1')][_0xc3f1('0x2e')](),'app':_0xc3f1('0xa'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x6800c0['context'],'exten':_0x6800c0[_0xc3f1('0x4')],'priority':_0x34fbe7['intervals']['length']+_0xc8ce42+_0x3df648++,'VoiceExtensionId':_0x6800c0['id']});}}}}for(var _0x499023=0x0;_0x499023<_0x34fbe7[_0xc3f1('0x2a')][_0xc3f1('0x1a')];_0x499023++){var _0x1c978=_0xc8ce42+_0x34fbe7[_0xc3f1('0x2a')]['length'];var _0x640b31=_0x499023===_0x34fbe7[_0xc3f1('0x2a')][_0xc3f1('0x1a')]-0x1?_0xc8ce42+_0x4ff39e['length']+_0x5ee54e['length']+0x2:_0xc8ce42+_0x499023+0x1;_0x4ff39e[_0xc3f1('0x3d')](_0x499023,0x0,{'type':_0x6800c0[_0xc3f1('0x1')],'app':'GotoIfTime','appdata':_0x34fbe7['intervals'][_0x499023]+'?'+_0x6800c0[_0xc3f1('0x3')]+_0xc3f1('0x3e')+_0x1c978+':'+_0x6800c0['context']+_0xc3f1('0x3e')+_0x640b31,'exten':_0x6800c0[_0xc3f1('0x4')],'context':_0x6800c0[_0xc3f1('0x3')],'priority':_0xc8ce42+_0x499023,'VoiceExtensionId':_0x6800c0['id']});}if(_0x34fbe7['appType']===_0xc3f1('0x3f'))_0x34fbe7[_0xc3f1('0x40')]=_0x552abe(_0x6800c0,_0x34fbe7[_0xc3f1('0x40')]);_0x34fbe7['priority']=_0x4ff39e[_0xc3f1('0x1a')]?_[_0xc3f1('0x41')](_0x4ff39e)[_0xc3f1('0x42')]+0x1:_0xc8ce42;_0x6ef0e3=_['concat'](_0x6ef0e3,_0x4ff39e,[_0x34fbe7],_0x5ee54e);_0xc8ce42=_[_0xc3f1('0x41')](_0x6ef0e3)[_0xc3f1('0x42')]+0x1;}return _0x45cd40(_0x6ef0e3);})[_0xc3f1('0x43')](function(_0x45f5cb){_0xab9c5d(_0x45f5cb);});});}return _0x244293[_0xc3f1('0x44')](_0xc3f1('0x45'),attributes,{'tableName':_0xc3f1('0x46'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x17ab2c){var _0x3a7a95=this['get']({'plain':!![]});var _0x1b826e=_0x3a7a95[_0xc3f1('0x1')]===_0xc3f1('0xe')?_0x5796c4(_0x3a7a95):_0x2679d9(_0x3a7a95);return _0x4b4bce(_0x3a7a95,_0x17ab2c,_['last'](_0x1b826e)[_0xc3f1('0x42')]+0x1)[_0xc3f1('0x29')](function(_0x4e25a5){var _0x52d9b1=_[_0xc3f1('0x47')](_0x1b826e,_0x4e25a5);_0x52d9b1[_0xc3f1('0x9')]({'type':_0x3a7a95[_0xc3f1('0x1')],'app':_0xc3f1('0x48'),'exten':_0x3a7a95[_0xc3f1('0x4')],'context':_0x3a7a95[_0xc3f1('0x3')],'priority':_['last'](_0x52d9b1)[_0xc3f1('0x42')]+0x1,'VoiceExtensionId':_0x3a7a95['id']});return _0x52d9b1;});}}});}; \ No newline at end of file +var _0x9fc5=['XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','get','then','Hangup','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','phone','param','prefix','SIP','none','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress'];(function(_0x110533,_0x467de3){var _0x23bba1=function(_0x115c62){while(--_0x115c62){_0x110533['push'](_0x110533['shift']());}};_0x23bba1(++_0x467de3);}(_0x9fc5,0xb6));var _0x59fc=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x9fc5[_0xfd9b19];return _0x514918;};'use strict';var _=require('lodash');var attributes=require(_0x59fc('0x0'));module[_0x59fc('0x1')]=function(_0x4a0dd0){var _0x4647c5=_0x4a0dd0[_0x59fc('0x2')];function _0x46c819(_0x96a4e){var _0x44979c=0x2;var _0x1b0778=[{'type':_0x96a4e[_0x59fc('0x3')],'app':_0x59fc('0x4'),'appdata':'CDR(type)='+_0x96a4e[_0x59fc('0x3')],'context':_0x96a4e[_0x59fc('0x5')],'exten':_0x96a4e[_0x59fc('0x6')],'priority':_0x44979c++,'VoiceExtensionId':_0x96a4e['id']},{'type':_0x96a4e['type'],'app':_0x96a4e[_0x59fc('0x7')]?_0x59fc('0x4'):_0x59fc('0x8'),'appdata':_0x96a4e[_0x59fc('0x7')]?_0x59fc('0x9')+_0x96a4e[_0x59fc('0x7')]:_0x59fc('0xa'),'context':_0x96a4e['context'],'exten':_0x96a4e[_0x59fc('0x6')],'priority':_0x44979c++,'VoiceExtensionId':_0x96a4e['id']}];if(_0x96a4e[_0x59fc('0x3')]===_0x59fc('0xb')){_0x1b0778[_0x59fc('0xc')]({'type':_0x59fc('0xb'),'app':_0x59fc('0x4'),'appdata':_0x59fc('0xd')+_0x96a4e['id'],'context':_0x96a4e['context'],'exten':_0x96a4e[_0x59fc('0x6')],'priority':_0x44979c++,'VoiceExtensionId':_0x96a4e['id']});}_0x1b0778[_0x59fc('0xc')]({'type':_0x96a4e[_0x59fc('0x3')],'app':_0x59fc('0x4'),'appdata':_0x59fc('0xe'),'context':_0x96a4e[_0x59fc('0x5')],'exten':_0x96a4e[_0x59fc('0x6')],'priority':_0x44979c++,'VoiceExtensionId':_0x96a4e['id']},{'type':_0x96a4e[_0x59fc('0x3')],'app':_0x59fc('0x4'),'appdata':_0x59fc('0xf'),'context':_0x96a4e[_0x59fc('0x5')],'exten':_0x96a4e['exten'],'priority':_0x44979c++,'VoiceExtensionId':_0x96a4e['id']},{'type':_0x96a4e[_0x59fc('0x3')],'app':_0x59fc('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x96a4e[_0x59fc('0x5')],'exten':_0x96a4e[_0x59fc('0x6')],'priority':_0x44979c++,'VoiceExtensionId':_0x96a4e['id']});return _0x1b0778;}function _0x4162c4(_0x1ddb29){var _0x175718=0x2;var _0x584481=[{'type':_0x59fc('0x10'),'app':_0x59fc('0x4'),'appdata':_0x59fc('0x11'),'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':_0x59fc('0x10'),'app':_0x1ddb29[_0x59fc('0x7')]?_0x59fc('0x4'):'NoOp','appdata':_0x1ddb29[_0x59fc('0x7')]?'CDR(routeAlias)='+_0x1ddb29[_0x59fc('0x7')]:'No\x20alias\x20set','context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':_0x59fc('0x10'),'app':_0x59fc('0x4'),'appdata':_0x59fc('0x12')+(_0x1ddb29[_0x59fc('0x13')]?'${EXTEN:'+_0x1ddb29[_0x59fc('0x13')]+'}':_0x59fc('0x14')),'context':_0x1ddb29['context'],'exten':_0x1ddb29['exten'],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':_0x59fc('0x10'),'app':_0x59fc('0x4'),'appdata':_0x59fc('0xd')+_0x1ddb29['id'],'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':_0x59fc('0x10'),'app':_0x59fc('0x15'),'appdata':_0x59fc('0x16')+(_0x175718+0x2)+_0x59fc('0x17')+(_0x175718+0x1)+')','context':_0x1ddb29['context'],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':'outbound','app':_0x59fc('0x4'),'appdata':_0x1ddb29['cutdigits']?_0x59fc('0x18')+_0x1ddb29[_0x59fc('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':'outbound','app':_0x59fc('0x4'),'appdata':_0x59fc('0xe'),'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':_0x59fc('0x10'),'app':'Set','appdata':_0x59fc('0xf'),'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':'outbound','app':_0x59fc('0x4'),'appdata':_0x59fc('0x19'),'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':_0x59fc('0x10'),'app':_0x59fc('0x4'),'appdata':_0x59fc('0x1a')+_0x1ddb29['id'],'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29['exten'],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']}];if(_0x1ddb29[_0x59fc('0x1b')](_0x59fc('0x1c'))&&_0x1ddb29[_0x59fc('0x1c')]!=='none'){_0x584481[_0x59fc('0xc')]({'type':'outbound','app':_0x59fc('0x4'),'appdata':_0x59fc('0x1d'),'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29['exten'],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']},{'type':'outbound','app':_0x59fc('0x4'),'appdata':_0x59fc('0x1e')+_0x1ddb29[_0x59fc('0x1c')]||_0x59fc('0x1f'),'context':_0x1ddb29[_0x59fc('0x5')],'exten':_0x1ddb29[_0x59fc('0x6')],'priority':_0x175718++,'VoiceExtensionId':_0x1ddb29['id']});}return _0x584481;}function _0xf57e05(_0x22ef91,_0x28d941){var _0x212d73=[{'name':_0x59fc('0x20'),'param':0x0},{'name':_0x59fc('0x21'),'param':0x1},{'name':_0x59fc('0x22'),'param':0x2},{'name':_0x59fc('0x23'),'param':0x3}];var _0x3bdca5={};var _0x6c6af1=_0x28d941[_0x59fc('0x24')](',');var _0x49d494=[];for(var _0x369f3b=0x0;_0x369f3b<_0x212d73[_0x59fc('0x25')];_0x369f3b++){switch(_0x212d73[_0x369f3b][_0x59fc('0x26')]){case'trunk':_0x3bdca5['trunk']=_0x6c6af1[_0x212d73[_0x369f3b]['param']]['split']('/')[0x1];_0x3bdca5[_0x59fc('0x27')]=_0x6c6af1[_0x212d73[_0x369f3b][_0x59fc('0x28')]]['split']('/')[0x2];_0x3bdca5[_0x59fc('0x29')]=_0x3bdca5[_0x59fc('0x27')]?_0x3bdca5[_0x59fc('0x27')][_0x59fc('0x24')]('$')[0x0]:undefined;_0x3bdca5[_0x59fc('0x27')]=_0x22ef91[_0x59fc('0x13')]?(_0x3bdca5['prefix']||'')+'${EXTEN:'+_0x22ef91[_0x59fc('0x13')]+'}':(_0x3bdca5[_0x59fc('0x29')]||'')+_0x59fc('0x14');_0x49d494[_0x212d73[_0x369f3b]['param']]=[_0x59fc('0x2a'),_0x3bdca5[_0x59fc('0x20')],_0x3bdca5[_0x59fc('0x27')]]['join']('/');break;case'options':_0x3bdca5[_0x59fc('0x22')]=_0x6c6af1[_0x212d73[_0x369f3b]['param']];if(_0x22ef91['recordingFormat']!==_0x59fc('0x2b')){if(_0x3bdca5[_0x59fc('0x22')][_0x59fc('0x2c')](_0x59fc('0x2d'))<0x0){_0x3bdca5['options']+=_0x59fc('0x2d');}}else{_0x3bdca5[_0x59fc('0x22')]=_0x3bdca5[_0x59fc('0x22')]['replace'](_0x59fc('0x2d'),'');}_0x49d494[_0x212d73[_0x369f3b][_0x59fc('0x28')]]=_0x3bdca5[_0x59fc('0x22')];break;default:_0x49d494[_0x212d73[_0x369f3b][_0x59fc('0x28')]]=_0x6c6af1[_0x212d73[_0x369f3b][_0x59fc('0x28')]];}}return _0x49d494['join'](',');}function _0x415f0a(_0x881c76,_0x534080,_0xcd6e5a){return new Promise(function(_0x31f89a,_0x247f72){var _0x8fc448=[];if(_['isEmpty'](_0x534080))return _0x31f89a(_0x8fc448);_0x4647c5[_0x59fc('0x2e')][_0x59fc('0x2f')]({'attributes':['id',_0x59fc('0x30'),_0x59fc('0x31')],'raw':!![]})['then'](function(_0x2900bf){for(var _0x1d98bd=0x0,_0x220bcd=0x0;_0x1d98bd<_0x534080[_0x59fc('0x25')];_0x1d98bd++,_0x220bcd=0x0){var _0x1c9d7e=_0x534080[_0x1d98bd];var _0x2a1b2f=[];var _0xe8ef06=[];delete _0x1c9d7e['id'];if(_0x1c9d7e[_0x59fc('0x30')]!==_0x59fc('0x32')){_0x1c9d7e[_0x59fc('0x33')]=[_0x1c9d7e[_0x59fc('0x30')]];}else{_0x1c9d7e['intervals']=_0x1c9d7e[_0x59fc('0x31')]?_['map'](_[_0x59fc('0x34')](_0x2900bf,{'IntervalId':_0x1c9d7e[_0x59fc('0x31')]}),'interval'):[];}_0x1c9d7e[_0x59fc('0x5')]=_0x881c76[_0x59fc('0x5')];_0x1c9d7e[_0x59fc('0x6')]=_0x881c76['exten'];if(_0x1c9d7e[_0x59fc('0x3')])_0x1c9d7e[_0x59fc('0x3')]=_0x1c9d7e['type'][_0x59fc('0x35')]();if(_0x881c76['type']===_0x59fc('0x10')){if(_0x1c9d7e[_0x59fc('0x1b')](_0x59fc('0x36'))&&_0x1c9d7e[_0x59fc('0x36')]&&_0x1c9d7e[_0x59fc('0x36')]!=='--'){_0x2a1b2f[_0x59fc('0xc')]({'type':_0x1c9d7e[_0x59fc('0x3')][_0x59fc('0x35')](),'app':_0x59fc('0x4'),'appdata':'CDR(tag)='+_0x1c9d7e[_0x59fc('0x36')],'context':_0x881c76[_0x59fc('0x5')],'exten':_0x881c76['exten'],'priority':_0x1c9d7e[_0x59fc('0x33')][_0x59fc('0x25')]+_0xcd6e5a+_0x220bcd++,'VoiceExtensionId':_0x881c76['id']});}_0x2a1b2f[_0x59fc('0xc')]({'type':_0x1c9d7e[_0x59fc('0x3')][_0x59fc('0x35')](),'app':_0x59fc('0x15'),'appdata':_0x59fc('0x37')+(_0x1c9d7e['callerID']?_0x59fc('0x38')+_0x1c9d7e[_0x59fc('0x39')]+')':_0x59fc('0x3a')),'context':_0x881c76[_0x59fc('0x5')],'exten':_0x881c76[_0x59fc('0x6')],'priority':_0x1c9d7e['intervals'][_0x59fc('0x25')]+_0xcd6e5a+_0x220bcd++,'VoiceExtensionId':_0x881c76['id']});}else{if(_0x1c9d7e[_0x59fc('0x1b')](_0x59fc('0x3b'))){if([_0x59fc('0x3c'),_0x59fc('0x3d')][_0x59fc('0x3e')](_0x1c9d7e[_0x59fc('0x3f')][_0x59fc('0x35')]())&&_0x1c9d7e['appType']!==_0x59fc('0x40')){if(_0x1c9d7e[_0x59fc('0x3b')]){_0x2a1b2f['push']({'type':_0x1c9d7e[_0x59fc('0x3')][_0x59fc('0x35')](),'app':_0x59fc('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x881c76[_0x59fc('0x5')],'exten':_0x881c76[_0x59fc('0x6')],'priority':_0x1c9d7e[_0x59fc('0x33')][_0x59fc('0x25')]+_0xcd6e5a+_0x220bcd++,'VoiceExtensionId':_0x881c76['id']});_0x2a1b2f['push']({'type':_0x1c9d7e[_0x59fc('0x3')][_0x59fc('0x35')](),'app':_0x59fc('0x4'),'appdata':_0x59fc('0x41'),'context':_0x881c76['context'],'exten':_0x881c76['exten'],'priority':_0x1c9d7e[_0x59fc('0x33')][_0x59fc('0x25')]+_0xcd6e5a+_0x220bcd++,'VoiceExtensionId':_0x881c76['id']});}else{_0x2a1b2f['push']({'type':_0x1c9d7e[_0x59fc('0x3')][_0x59fc('0x35')](),'app':_0x59fc('0x15'),'appdata':_0x59fc('0x42'),'context':_0x881c76['context'],'exten':_0x881c76[_0x59fc('0x6')],'priority':_0x1c9d7e['intervals'][_0x59fc('0x25')]+_0xcd6e5a+_0x220bcd++,'VoiceExtensionId':_0x881c76['id']});_0x2a1b2f['push']({'type':_0x1c9d7e[_0x59fc('0x3')][_0x59fc('0x35')](),'app':'Set','appdata':_0x59fc('0x43'),'context':_0x881c76[_0x59fc('0x5')],'exten':_0x881c76[_0x59fc('0x6')],'priority':_0x1c9d7e[_0x59fc('0x33')][_0x59fc('0x25')]+_0xcd6e5a+_0x220bcd++,'VoiceExtensionId':_0x881c76['id']});}}}}for(var _0x527f73=0x0;_0x527f73<_0x1c9d7e[_0x59fc('0x33')][_0x59fc('0x25')];_0x527f73++){var _0x2c5026=_0xcd6e5a+_0x1c9d7e[_0x59fc('0x33')][_0x59fc('0x25')];var _0x41f588=_0x527f73===_0x1c9d7e[_0x59fc('0x33')][_0x59fc('0x25')]-0x1?_0xcd6e5a+_0x2a1b2f[_0x59fc('0x25')]+_0xe8ef06[_0x59fc('0x25')]+0x2:_0xcd6e5a+_0x527f73+0x1;_0x2a1b2f[_0x59fc('0x44')](_0x527f73,0x0,{'type':_0x881c76[_0x59fc('0x3')],'app':_0x59fc('0x45'),'appdata':_0x1c9d7e[_0x59fc('0x33')][_0x527f73]+'?'+_0x881c76[_0x59fc('0x5')]+_0x59fc('0x46')+_0x2c5026+':'+_0x881c76['context']+_0x59fc('0x46')+_0x41f588,'exten':_0x881c76[_0x59fc('0x6')],'context':_0x881c76['context'],'priority':_0xcd6e5a+_0x527f73,'VoiceExtensionId':_0x881c76['id']});}if(_0x1c9d7e[_0x59fc('0x47')]===_0x59fc('0x48'))_0x1c9d7e[_0x59fc('0x49')]=_0xf57e05(_0x881c76,_0x1c9d7e[_0x59fc('0x49')]);_0x1c9d7e[_0x59fc('0x4a')]=_0x2a1b2f[_0x59fc('0x25')]?_[_0x59fc('0x4b')](_0x2a1b2f)[_0x59fc('0x4a')]+0x1:_0xcd6e5a;_0x8fc448=_[_0x59fc('0x4c')](_0x8fc448,_0x2a1b2f,[_0x1c9d7e],_0xe8ef06);_0xcd6e5a=_[_0x59fc('0x4b')](_0x8fc448)[_0x59fc('0x4a')]+0x1;}return _0x31f89a(_0x8fc448);})[_0x59fc('0x4d')](function(_0x139d3e){_0x247f72(_0x139d3e);});});}return _0x4a0dd0[_0x59fc('0x4e')](_0x59fc('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x423a88){var _0x1c8ae7=this[_0x59fc('0x50')]({'plain':!![]});var _0x47841b=_0x1c8ae7[_0x59fc('0x3')]===_0x59fc('0x10')?_0x4162c4(_0x1c8ae7):_0x46c819(_0x1c8ae7);return _0x415f0a(_0x1c8ae7,_0x423a88,_[_0x59fc('0x4b')](_0x47841b)[_0x59fc('0x4a')]+0x1)[_0x59fc('0x51')](function(_0x5f17a3){var _0x1d7be3=_[_0x59fc('0x4c')](_0x47841b,_0x5f17a3);_0x1d7be3['push']({'type':_0x1c8ae7[_0x59fc('0x3')],'app':_0x59fc('0x52'),'exten':_0x1c8ae7['exten'],'context':_0x1c8ae7[_0x59fc('0x5')],'priority':_[_0x59fc('0x4b')](_0x1d7be3)['priority']+0x1,'VoiceExtensionId':_0x1c8ae7['id']});return _0x1d7be3;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index bf89611..edf236f 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 _0x7d10=['request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then'];(function(_0x24af85,_0x5af43b){var _0x44d806=function(_0x4dc75f){while(--_0x4dc75f){_0x24af85['push'](_0x24af85['shift']());}};_0x44d806(++_0x5af43b);}(_0x7d10,0x1ce));var _0x07d1=function(_0x24dccf,_0x4af5b0){_0x24dccf=_0x24dccf-0x0;var _0x36f925=_0x7d10[_0x24dccf];return _0x36f925;};'use strict';var _=require('lodash');var util=require(_0x07d1('0x0'));var moment=require(_0x07d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x07d1('0x2'));var fs=require('fs');var Redis=require(_0x07d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x07d1('0x4'));var logger=require(_0x07d1('0x5'))('rpc');var config=require(_0x07d1('0x6'));var jayson=require(_0x07d1('0x7'));var client=jayson[_0x07d1('0x8')][_0x07d1('0x9')]({'port':0x232a});config['redis']=_[_0x07d1('0xa')](config[_0x07d1('0xb')],{'host':_0x07d1('0xc'),'port':0x18eb});var socket=require(_0x07d1('0xd'))(new Redis(config[_0x07d1('0xb')]));require(_0x07d1('0xe'))[_0x07d1('0xf')](socket);function respondWithRpcPromise(_0x42bf2b,_0x370103,_0x40eccc){return new BPromise(function(_0x259865,_0x33abbd){return client[_0x07d1('0x10')](_0x42bf2b,_0x40eccc)[_0x07d1('0x11')](function(_0x40ccbd){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x370103,_0x07d1('0x12'));logger[_0x07d1('0x13')](_0x07d1('0x14'),_0x370103,_0x07d1('0x12'),JSON[_0x07d1('0x15')](_0x40ccbd));if(_0x40ccbd[_0x07d1('0x16')]){if(_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x17')]===0x1f4){logger[_0x07d1('0x16')](_0x07d1('0x18'),_0x370103,_0x40ccbd['error'][_0x07d1('0x19')]);return _0x33abbd(_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x19')]);}logger[_0x07d1('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x370103,_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x19')]);return _0x259865(_0x40ccbd[_0x07d1('0x16')]['message']);}else{logger[_0x07d1('0x1a')](_0x07d1('0x18'),_0x370103,_0x07d1('0x12'));_0x259865(_0x40ccbd[_0x07d1('0x1b')][_0x07d1('0x19')]);}})[_0x07d1('0x1c')](function(_0x234d47){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x370103,_0x234d47);_0x33abbd(_0x234d47);});});}exports[_0x07d1('0x1d')]=function(_0x4aed02){var _0xf369a1=this;return new Promise(function(_0x550c7f,_0x2b5153){return db[_0x07d1('0x1e')][_0x07d1('0x1f')]({'raw':_0x4aed02[_0x07d1('0x20')]?_0x4aed02[_0x07d1('0x20')][_0x07d1('0x21')]===undefined?!![]:![]:!![],'where':_0x4aed02[_0x07d1('0x20')]?_0x4aed02[_0x07d1('0x20')][_0x07d1('0x22')]||null:null,'attributes':_0x4aed02['options']?_0x4aed02['options']['attributes']||null:null,'limit':_0x4aed02[_0x07d1('0x20')]?_0x4aed02['options'][_0x07d1('0x23')]||null:null,'include':_0x4aed02[_0x07d1('0x20')]?_0x4aed02[_0x07d1('0x20')][_0x07d1('0x24')]?_[_0x07d1('0x25')](_0x4aed02['options'][_0x07d1('0x24')],function(_0x16b55c){return{'model':db[_0x16b55c[_0x07d1('0x26')]],'as':_0x16b55c['as'],'attributes':_0x16b55c[_0x07d1('0x27')],'include':_0x16b55c[_0x07d1('0x24')]?_['map'](_0x16b55c[_0x07d1('0x24')],function(_0x16a56a){return{'model':db[_0x16a56a[_0x07d1('0x26')]],'as':_0x16a56a['as'],'attributes':_0x16a56a[_0x07d1('0x27')],'include':_0x16a56a[_0x07d1('0x24')]?_['map'](_0x16a56a['include'],function(_0x3a0254){return{'model':db[_0x3a0254[_0x07d1('0x26')]],'as':_0x3a0254['as'],'attributes':_0x3a0254['attributes']};}):[]};}):[]};}):[]:[]})[_0x07d1('0x11')](function(_0x12cb9c){logger['info']('GetVoiceExtension',_0x4aed02);logger['debug']('GetVoiceExtension',_0x4aed02,JSON[_0x07d1('0x15')](_0x12cb9c));_0x550c7f(_0x12cb9c);})['catch'](function(_0x3e8136){logger[_0x07d1('0x16')](_0x07d1('0x1d'),_0x3e8136[_0x07d1('0x19')],_0x4aed02);_0x2b5153(_0xf369a1[_0x07d1('0x16')](0x1f4,_0x3e8136['message']));});});}; \ No newline at end of file +var _0x8a5c=['./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','VoiceExtension','findAll','options','raw','attributes','include','map','model','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8a5c,0x112));var _0xc8a5=function(_0x198f2d,_0x3f6a8b){_0x198f2d=_0x198f2d-0x0;var _0x58e066=_0x8a5c[_0x198f2d];return _0x58e066;};'use strict';var _=require('lodash');var util=require(_0xc8a5('0x0'));var moment=require(_0xc8a5('0x1'));var BPromise=require(_0xc8a5('0x2'));var rs=require(_0xc8a5('0x3'));var fs=require('fs');var Redis=require(_0xc8a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8a5('0x5'));var logger=require(_0xc8a5('0x6'))('rpc');var config=require(_0xc8a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc8a5('0x8')][_0xc8a5('0x9')]({'port':0x232a});config[_0xc8a5('0xa')]=_[_0xc8a5('0xb')](config[_0xc8a5('0xa')],{'host':_0xc8a5('0xc'),'port':0x18eb});var socket=require(_0xc8a5('0xd'))(new Redis(config[_0xc8a5('0xa')]));require(_0xc8a5('0xe'))[_0xc8a5('0xf')](socket);function respondWithRpcPromise(_0x1b6dbc,_0x1a5d79,_0xa5f1f6){return new BPromise(function(_0xb75c77,_0x270030){return client[_0xc8a5('0x10')](_0x1b6dbc,_0xa5f1f6)[_0xc8a5('0x11')](function(_0x1c22e){logger[_0xc8a5('0x12')](_0xc8a5('0x13'),_0x1a5d79,'request\x20sent');logger[_0xc8a5('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x1a5d79,_0xc8a5('0x15'),JSON[_0xc8a5('0x16')](_0x1c22e));if(_0x1c22e['error']){if(_0x1c22e[_0xc8a5('0x17')]['code']===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x1a5d79,_0x1c22e[_0xc8a5('0x17')]['message']);return _0x270030(_0x1c22e[_0xc8a5('0x17')][_0xc8a5('0x18')]);}logger[_0xc8a5('0x17')](_0xc8a5('0x13'),_0x1a5d79,_0x1c22e[_0xc8a5('0x17')][_0xc8a5('0x18')]);return _0xb75c77(_0x1c22e[_0xc8a5('0x17')][_0xc8a5('0x18')]);}else{logger[_0xc8a5('0x12')](_0xc8a5('0x13'),_0x1a5d79,_0xc8a5('0x15'));_0xb75c77(_0x1c22e[_0xc8a5('0x19')][_0xc8a5('0x18')]);}})[_0xc8a5('0x1a')](function(_0x4defb9){logger[_0xc8a5('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x1a5d79,_0x4defb9);_0x270030(_0x4defb9);});});}exports['GetVoiceExtension']=function(_0x26cd2f){var _0x1d2325=this;return new Promise(function(_0x277aaf,_0x43ba3e){return db[_0xc8a5('0x1b')][_0xc8a5('0x1c')]({'raw':_0x26cd2f[_0xc8a5('0x1d')]?_0x26cd2f[_0xc8a5('0x1d')][_0xc8a5('0x1e')]===undefined?!![]:![]:!![],'where':_0x26cd2f[_0xc8a5('0x1d')]?_0x26cd2f[_0xc8a5('0x1d')]['where']||null:null,'attributes':_0x26cd2f[_0xc8a5('0x1d')]?_0x26cd2f[_0xc8a5('0x1d')][_0xc8a5('0x1f')]||null:null,'limit':_0x26cd2f[_0xc8a5('0x1d')]?_0x26cd2f[_0xc8a5('0x1d')]['limit']||null:null,'include':_0x26cd2f[_0xc8a5('0x1d')]?_0x26cd2f[_0xc8a5('0x1d')][_0xc8a5('0x20')]?_[_0xc8a5('0x21')](_0x26cd2f['options'][_0xc8a5('0x20')],function(_0xe7289d){return{'model':db[_0xe7289d[_0xc8a5('0x22')]],'as':_0xe7289d['as'],'attributes':_0xe7289d[_0xc8a5('0x1f')],'include':_0xe7289d[_0xc8a5('0x20')]?_[_0xc8a5('0x21')](_0xe7289d[_0xc8a5('0x20')],function(_0x13ed95){return{'model':db[_0x13ed95[_0xc8a5('0x22')]],'as':_0x13ed95['as'],'attributes':_0x13ed95[_0xc8a5('0x1f')],'include':_0x13ed95['include']?_['map'](_0x13ed95['include'],function(_0x2aa7eb){return{'model':db[_0x2aa7eb[_0xc8a5('0x22')]],'as':_0x2aa7eb['as'],'attributes':_0x2aa7eb[_0xc8a5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc8a5('0x11')](function(_0x545e9e){logger[_0xc8a5('0x12')](_0xc8a5('0x23'),_0x26cd2f);logger[_0xc8a5('0x14')]('GetVoiceExtension',_0x26cd2f,JSON['stringify'](_0x545e9e));_0x277aaf(_0x545e9e);})[_0xc8a5('0x1a')](function(_0x25c91c){logger[_0xc8a5('0x17')]('GetVoiceExtension',_0x25c91c[_0xc8a5('0x18')],_0x26cd2f);_0x43ba3e(_0x1d2325[_0xc8a5('0x17')](0x1f4,_0x25c91c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index d53917a..3c0b78d 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x10f387,_0x4ccb71){var _0x3de1b8=function(_0x325fbe){while(--_0x325fbe){_0x10f387['push'](_0x10f387['shift']());}};_0x3de1b8(++_0x4ccb71);}(_0xe14b,0x93));var _0xbe14=function(_0x55e722,_0xef5d78){_0x55e722=_0x55e722-0x0;var _0x33964d=_0xe14b[_0x55e722];return _0x33964d;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x1a5595,_0x518936){var _0x59f579=function(_0x353ce8){while(--_0x353ce8){_0x1a5595['push'](_0x1a5595['shift']());}};_0x59f579(++_0x518936);}(_0x53ec,0x192));var _0xc53e=function(_0x1915e5,_0xe53420){_0x1915e5=_0x1915e5-0x0;var _0x148dd0=_0x53ec[_0x1915e5];return _0x148dd0;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 374a018..3689846 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 _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xadb5,0xad));var _0x5adb=function(_0x477237,_0x137250){_0x477237=_0x477237-0x0;var _0x53de45=_0xadb5[_0x477237];return _0x53de45;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./voiceMail.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file +var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','/:id','isAuthenticated','show','/:id/messages','getMessages','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3b2f78,_0x27044a){var _0x543a2e=function(_0x4af8fb){while(--_0x4af8fb){_0x3b2f78['push'](_0x3b2f78['shift']());}};_0x543a2e(++_0x27044a);}(_0x2ef3,0xba));var _0x32ef=function(_0x466d83,_0xc56c08){_0x466d83=_0x466d83-0x0;var _0x414309=_0x2ef3[_0x466d83];return _0x414309;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('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 161b610..892ed2e 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 _0x2394=['contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','exports','from-voicemail','STRING'];(function(_0x463a64,_0x9452c0){var _0x23d836=function(_0x43db3a){while(--_0x43db3a){_0x463a64['push'](_0x463a64['shift']());}};_0x23d836(++_0x9452c0);}(_0x2394,0x1bd));var _0x4239=function(_0x4dea3c,_0x29c1ae){_0x4dea3c=_0x4dea3c-0x0;var _0x3e4538=_0x2394[_0x4dea3c];return _0x3e4538;};'use strict';var Sequelize=require('sequelize');module[_0x4239('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x4239('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x4239('0x2')],'defaultValue':'','allowNull':![],'unique':_0x4239('0x3')},'password':{'type':Sequelize[_0x4239('0x2')]},'fullname':{'type':Sequelize[_0x4239('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x54f5a5){this['setDataValue'](_0x4239('0x4'),typeof _0x54f5a5===_0x4239('0x5')&&_0x54f5a5[_0x4239('0x6')]()?_0x54f5a5[_0x4239('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x4239('0x7')},'attach':{'type':Sequelize[_0x4239('0x8')]('yes','no'),'defaultValue':_0x4239('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x4239('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x4239('0x2')]},'review':{'type':Sequelize[_0x4239('0x8')](_0x4239('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4239('0x8')](_0x4239('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4239('0x8')](_0x4239('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4239('0x8')](_0x4239('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4239('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4239('0x8')](_0x4239('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4239('0x8')](_0x4239('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4239('0x8')]('yes','no'),'defaultValue':_0x4239('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4239('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x4239('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4239('0x8')](_0x4239('0x9'),'no'),'defaultValue':_0x4239('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x4239('0x2')]},'emailbody':{'type':Sequelize[_0x4239('0x2')]},'maxsecs':{'type':Sequelize[_0x4239('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4239('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4239('0xc')],'get':function(){return this[_0x4239('0xd')](_0x4239('0xe'))+_0x4239('0xf')+this['getDataValue']('mailbox');}}}; \ No newline at end of file +var _0x2637=['fullname','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x3204e4,_0x391297){var _0x44a5e9=function(_0x44cc86){while(--_0x44cc86){_0x3204e4['push'](_0x3204e4['shift']());}};_0x44a5e9(++_0x391297);}(_0x2637,0x191));var _0x7263=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2637[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x7263('0x0'));module[_0x7263('0x1')]={'customer_id':{'type':Sequelize[_0x7263('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x7263('0x3')},'mailbox':{'type':Sequelize[_0x7263('0x2')],'defaultValue':'','allowNull':![],'unique':_0x7263('0x3')},'password':{'type':Sequelize[_0x7263('0x2')]},'fullname':{'type':Sequelize[_0x7263('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x592d49){this[_0x7263('0x4')](_0x7263('0x5'),typeof _0x592d49===_0x7263('0x6')&&_0x592d49['trim']()?_0x592d49['trim']():null);}},'pager':{'type':Sequelize[_0x7263('0x2')]},'tz':{'type':Sequelize[_0x7263('0x2')],'defaultValue':_0x7263('0x7')},'attach':{'type':Sequelize[_0x7263('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x7263('0x8')](_0x7263('0x9'),'no'),'defaultValue':_0x7263('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7263('0x2')]},'callback':{'type':Sequelize[_0x7263('0x2')]},'review':{'type':Sequelize[_0x7263('0x8')](_0x7263('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7263('0x8')](_0x7263('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7263('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7263('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7263('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x7263('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x7263('0x9'),'no'),'defaultValue':_0x7263('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7263('0x8')](_0x7263('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7263('0x8')](_0x7263('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7263('0x8')]('yes','no'),'defaultValue':_0x7263('0x9'),'allowNull':![]},'stamp':{'type':_0x7263('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x7263('0x2')]},'maxsecs':{'type':Sequelize[_0x7263('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7263('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7263('0xd')],'get':function(){return this[_0x7263('0xe')](_0x7263('0xf'))+'\x20-\x20'+this['getDataValue']('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3c64cda..4f3e1db 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 _0x1775=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','rawAttributes','mailbox','options','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','name','send','index','VoiceMail','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x28a87c,_0x40eef5){var _0x2513ab=function(_0x32bc8e){while(--_0x32bc8e){_0x28a87c['push'](_0x28a87c['shift']());}};_0x2513ab(++_0x40eef5);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){var _0x2503ef=_0x3b39b5['get']({'plain':!![]});var _0x564139=_0x5177('0x2a');return db[_0x5177('0x2b')]['destroy']({'where':{'type':_0x564139,'resourceId':_0x2503ef['id']}})[_0x5177('0x28')](function(){return _0x3b39b5;});})['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)[_0x5177('0x1e')]();});}};}function handleEntityNotFound(_0x58846c,_0x3e021a){return function(_0x2554ec){if(!_0x2554ec){_0x58846c[_0x5177('0x1c')](0x194);}return _0x2554ec;};}function handleError(_0x7f86e,_0xe98ff1){_0xe98ff1=_0xe98ff1||0x1f4;return function(_0x1cef5d){logger['error'](_0x1cef5d['stack']);if(_0x1cef5d[_0x5177('0x2c')]){delete _0x1cef5d[_0x5177('0x2c')];}_0x7f86e[_0x5177('0x1d')](_0xe98ff1)[_0x5177('0x2d')](_0x1cef5d);};}exports[_0x5177('0x2e')]=function(_0x8134f9,_0x31eb9f){var _0x72dced={},_0x49f6f1={},_0x42e1db={'count':0x0,'rows':[]};var _0x2233a2=_['map'](db[_0x5177('0x2f')]['rawAttributes'],function(_0x172b36){return{'name':_0x172b36[_0x5177('0x30')],'type':_0x172b36[_0x5177('0x31')]['key']};});_0x49f6f1['model']=_[_0x5177('0x32')](_0x2233a2,_0x5177('0x2c'));_0x49f6f1[_0x5177('0x33')]=_[_0x5177('0x34')](_0x8134f9[_0x5177('0x33')]);_0x49f6f1[_0x5177('0x35')]=_[_0x5177('0x36')](_0x49f6f1[_0x5177('0x37')],_0x49f6f1['query']);_0x72dced[_0x5177('0x38')]=_[_0x5177('0x36')](_0x49f6f1['model'],qs[_0x5177('0x39')](_0x8134f9[_0x5177('0x33')][_0x5177('0x39')]));_0x72dced[_0x5177('0x38')]=_0x72dced[_0x5177('0x38')][_0x5177('0x3a')]?_0x72dced['attributes']:_0x49f6f1[_0x5177('0x37')];if(!_0x8134f9[_0x5177('0x33')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x72dced[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x8134f9[_0x5177('0x33')]['limit']);_0x72dced[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x8134f9['query']['offset']);}_0x72dced[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x8134f9[_0x5177('0x33')][_0x5177('0x3f')]);_0x72dced[_0x5177('0x40')]=qs[_0x5177('0x35')](_[_0x5177('0x41')](_0x8134f9[_0x5177('0x33')],_0x49f6f1[_0x5177('0x35')]),_0x2233a2);if(_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]){_0x72dced[_0x5177('0x40')]=_[_0x5177('0x43')](_0x72dced['where'],{'$or':_[_0x5177('0x32')](_0x2233a2,function(_0x2a4db1){if(_0x2a4db1['type']!==_0x5177('0x44')){var _0x56f297={};_0x56f297[_0x2a4db1[_0x5177('0x2c')]]={'$like':'%'+_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]+'%'};return _0x56f297;}})});}_0x72dced=_['merge']({},_0x72dced,_0x8134f9['options']);var _0x210510={'where':_0x72dced[_0x5177('0x40')]};return db[_0x5177('0x2f')][_0x5177('0x22')](_0x210510)[_0x5177('0x28')](function(_0x3e710d){_0x42e1db[_0x5177('0x22')]=_0x3e710d;if(_0x8134f9[_0x5177('0x33')]['includeAll']){_0x72dced[_0x5177('0x45')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x72dced);})[_0x5177('0x28')](function(_0x17dc98){_0x42e1db['rows']=_0x17dc98;return _0x42e1db;})[_0x5177('0x28')](respondWithFilteredResult(_0x31eb9f,_0x72dced))['catch'](handleError(_0x31eb9f,null));};exports['show']=function(_0x46c833,_0x1769cd){var _0x262c71={'raw':!![],'where':{'id':_0x46c833[_0x5177('0x46')]['id']}},_0x3776b8={};_0x3776b8[_0x5177('0x37')]=_[_0x5177('0x34')](db['VoiceMail']['rawAttributes']);_0x3776b8[_0x5177('0x33')]=_['keys'](_0x46c833[_0x5177('0x33')]);_0x3776b8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],_0x3776b8['query']);_0x262c71[_0x5177('0x38')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],qs[_0x5177('0x39')](_0x46c833[_0x5177('0x33')][_0x5177('0x39')]));_0x262c71[_0x5177('0x38')]=_0x262c71[_0x5177('0x38')][_0x5177('0x3a')]?_0x262c71[_0x5177('0x38')]:_0x3776b8[_0x5177('0x37')];if(_0x46c833['query'][_0x5177('0x47')]){_0x262c71['include']=[{'all':!![]}];}_0x262c71=_['merge']({},_0x262c71,_0x46c833['options']);return db[_0x5177('0x2f')][_0x5177('0x48')](_0x262c71)['then'](handleEntityNotFound(_0x1769cd,null))[_0x5177('0x28')](respondWithResult(_0x1769cd,null))[_0x5177('0x49')](handleError(_0x1769cd,null));};exports[_0x5177('0x4a')]=function(_0x4891fe,_0x1d4ae4){return db['VoiceMail']['create'](_0x4891fe['body'],{})[_0x5177('0x28')](function(_0x37d5dd){var _0x1300d7=_0x4891fe['user']['get']({'plain':!![]});if(!_0x1300d7)throw new Error(_0x5177('0x4b'));if(_0x1300d7['role']===_0x5177('0x4c')){var _0x9dd7a2=_0x37d5dd[_0x5177('0x4d')]({'plain':!![]});var _0x31a6e1=_0x5177('0x2a');return db[_0x5177('0x4e')][_0x5177('0x48')]({'where':{'name':_0x31a6e1,'userProfileId':_0x1300d7[_0x5177('0x4f')]},'raw':!![]})[_0x5177('0x28')](function(_0x217aca){if(_0x217aca&&_0x217aca[_0x5177('0x50')]===0x0){return db[_0x5177('0x2b')][_0x5177('0x4a')]({'name':_0x9dd7a2['name'],'resourceId':_0x9dd7a2['id'],'type':_0x217aca['name'],'sectionId':_0x217aca['id']},{})[_0x5177('0x28')](function(){return _0x37d5dd;});}else{return _0x37d5dd;}})['catch'](function(_0x649c6f){logger['error'](_0x5177('0x51'),_0x649c6f);throw _0x649c6f;});}return _0x37d5dd;})[_0x5177('0x28')](respondWithResult(_0x1d4ae4,0xc9))[_0x5177('0x49')](handleError(_0x1d4ae4,null));};exports['update']=function(_0x5be224,_0x19884e){if(_0x5be224[_0x5177('0x52')]['id']){delete _0x5be224[_0x5177('0x52')]['id'];}return db[_0x5177('0x2f')]['find']({'where':{'id':_0x5be224['params']['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x19884e,null))[_0x5177('0x28')](saveUpdates(_0x5be224[_0x5177('0x52')],null))[_0x5177('0x28')](respondWithResult(_0x19884e,null))['catch'](handleError(_0x19884e,null));};exports[_0x5177('0x29')]=function(_0x143aff,_0x3a18ad){return db['VoiceMail'][_0x5177('0x48')]({'where':{'id':_0x143aff[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x3a18ad,null))['then'](removeEntity(_0x3a18ad,null))[_0x5177('0x49')](handleError(_0x3a18ad,null));};exports['getMessages']=function(_0x40dfd6,_0x39fb92,_0x3268bd){return db['VoiceMail'][_0x5177('0x53')]({'where':{'id':_0x40dfd6[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x39fb92,null))[_0x5177('0x28')](function(_0xc7a59e){var _0x74589e;var _0x37380c={},_0x267599={};_0x267599['model']=_['keys'](db['VoiceMailMessage'][_0x5177('0x54')]);_0x267599[_0x5177('0x33')]=_[_0x5177('0x34')](_0x40dfd6[_0x5177('0x33')]);_0x267599[_0x5177('0x35')]=_[_0x5177('0x36')](_0x267599['model'],_0x267599['query']);_0x37380c[_0x5177('0x38')]=_[_0x5177('0x36')](_0x267599[_0x5177('0x37')],qs[_0x5177('0x39')](_0x40dfd6[_0x5177('0x33')][_0x5177('0x39')]));_0x37380c[_0x5177('0x38')]=_0x37380c[_0x5177('0x38')][_0x5177('0x3a')]?_0x37380c['attributes']:_0x267599[_0x5177('0x37')];if(!_0x40dfd6[_0x5177('0x33')]['hasOwnProperty'](_0x5177('0x3c'))){_0x37380c[_0x5177('0x3d')]=qs['limit'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x3d')]);_0x37380c[_0x5177('0x20')]=qs['offset'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x20')]);}_0x37380c['order']=qs['sort'](_0x40dfd6[_0x5177('0x33')]['sort']);_0x37380c[_0x5177('0x40')]=qs['filters'](_[_0x5177('0x41')](_0x40dfd6[_0x5177('0x33')],_0x267599['filters']));if(_0x40dfd6[_0x5177('0x33')][_0x5177('0x42')]){_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c[_0x5177('0x40')],{'$or':_[_0x5177('0x32')](_0x37380c[_0x5177('0x38')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x40dfd6['query']['filter']+'%'};return _0x26b733;})});}_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c['where'],{'mailboxuser':_0xc7a59e[_0x5177('0x55')]});_0x37380c=_[_0x5177('0x43')]({},_0x37380c,_0x40dfd6[_0x5177('0x56')]);return db[_0x5177('0x57')][_0x5177('0x58')](_0x37380c)[_0x5177('0x28')](respondWithFilteredResult(_0x39fb92,_0x37380c));})[_0x5177('0x49')](handleError(_0x39fb92,null));}; \ No newline at end of file +var _0xeffd=['create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','nolimit','order','pick','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','update','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','options','find'];(function(_0x37bf43,_0x2203c3){var _0x266666=function(_0x26b2c1){while(--_0x26b2c1){_0x37bf43['push'](_0x37bf43['shift']());}};_0x266666(++_0x2203c3);}(_0xeffd,0x6b));var _0xdeff=function(_0x41c58f,_0x1891ce){_0x41c58f=_0x41c58f-0x0;var _0x28d0b0=_0xeffd[_0x41c58f];return _0x28d0b0;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461699,_0x116bf9){_0x116bf9=_0x116bf9||0xcc;return function(_0x4952f2){if(_0x4952f2){return _0x461699[_0xdeff('0x1d')](_0x116bf9);}return _0x461699['status'](_0x116bf9)['end']();};}function respondWithResult(_0x3e56a1,_0x47410f){_0x47410f=_0x47410f||0xc8;return function(_0x1585e8){if(_0x1585e8){return _0x3e56a1[_0xdeff('0x1e')](_0x47410f)['json'](_0x1585e8);}};}function respondWithFilteredResult(_0x826132,_0x314ded){return function(_0xea6c4){if(_0xea6c4){var _0x391633=typeof _0x314ded[_0xdeff('0x1f')]===_0xdeff('0x20')&&typeof _0x314ded['limit']==='undefined';var _0x7440af=_0xea6c4['count'];var _0x5c9837=_0x391633?0x0:_0x314ded[_0xdeff('0x1f')];var _0x369e13=_0x391633?_0xea6c4['count']:_0x314ded[_0xdeff('0x1f')]+_0x314ded[_0xdeff('0x21')];var _0x1ab1fa;if(_0x369e13>=_0x7440af){_0x369e13=_0x7440af;_0x1ab1fa=0xc8;}else{_0x1ab1fa=0xce;}_0x826132[_0xdeff('0x1e')](_0x1ab1fa);return _0x826132[_0xdeff('0x22')](_0xdeff('0x23'),_0x5c9837+'-'+_0x369e13+'/'+_0x7440af)[_0xdeff('0x24')](_0xea6c4);}return null;};}function patchUpdates(_0x919c93){return function(_0x488faa){try{jsonpatch['apply'](_0x488faa,_0x919c93,!![]);}catch(_0x56cb84){return BPromise[_0xdeff('0x25')](_0x56cb84);}return _0x488faa['save']();};}function saveUpdates(_0x189627,_0x91c0b4){return function(_0x543653){if(_0x543653){return _0x543653[_0xdeff('0x26')](_0x189627)[_0xdeff('0x27')](function(_0x4eb2a8){return _0x4eb2a8;});}return null;};}function removeEntity(_0x5dbe96,_0x3b2554){return function(_0x15c425){if(_0x15c425){return _0x15c425[_0xdeff('0x28')]()[_0xdeff('0x27')](function(){var _0x32add9=_0x15c425['get']({'plain':!![]});var _0xb08f19=_0xdeff('0x29');return db[_0xdeff('0x2a')][_0xdeff('0x28')]({'where':{'type':_0xb08f19,'resourceId':_0x32add9['id']}})[_0xdeff('0x27')](function(){return _0x15c425;});})[_0xdeff('0x27')](function(){_0x5dbe96[_0xdeff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bb72,_0x1a546c){return function(_0x53b168){if(!_0x53b168){_0x31bb72['sendStatus'](0x194);}return _0x53b168;};}function handleError(_0x830be4,_0x2ea8e9){_0x2ea8e9=_0x2ea8e9||0x1f4;return function(_0x16b2d0){logger[_0xdeff('0x2b')](_0x16b2d0[_0xdeff('0x2c')]);if(_0x16b2d0[_0xdeff('0x2d')]){delete _0x16b2d0[_0xdeff('0x2d')];}_0x830be4['status'](_0x2ea8e9)[_0xdeff('0x2e')](_0x16b2d0);};}exports[_0xdeff('0x2f')]=function(_0x34e258,_0x5045b8){var _0x59f7a0={},_0x346743={},_0x505e3f={'count':0x0,'rows':[]};var _0x69842a=_[_0xdeff('0x30')](db[_0xdeff('0x31')]['rawAttributes'],function(_0x189a51){return{'name':_0x189a51['fieldName'],'type':_0x189a51['type'][_0xdeff('0x32')]};});_0x346743[_0xdeff('0x33')]=_[_0xdeff('0x30')](_0x69842a,_0xdeff('0x2d'));_0x346743['query']=_[_0xdeff('0x34')](_0x34e258[_0xdeff('0x35')]);_0x346743[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x346743[_0xdeff('0x33')],_0x346743[_0xdeff('0x35')]);_0x59f7a0[_0xdeff('0x38')]=_['intersection'](_0x346743[_0xdeff('0x33')],qs['fields'](_0x34e258[_0xdeff('0x35')][_0xdeff('0x39')]));_0x59f7a0[_0xdeff('0x38')]=_0x59f7a0[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x59f7a0[_0xdeff('0x38')]:_0x346743['model'];if(!_0x34e258[_0xdeff('0x35')][_0xdeff('0x3b')]('nolimit')){_0x59f7a0[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x21')]);_0x59f7a0[_0xdeff('0x1f')]=qs[_0xdeff('0x1f')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x1f')]);}_0x59f7a0['order']=qs[_0xdeff('0x3c')](_0x34e258['query'][_0xdeff('0x3c')]);_0x59f7a0[_0xdeff('0x3d')]=qs[_0xdeff('0x36')](_['pick'](_0x34e258[_0xdeff('0x35')],_0x346743[_0xdeff('0x36')]),_0x69842a);if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x59f7a0[_0xdeff('0x3d')]=_['merge'](_0x59f7a0[_0xdeff('0x3d')],{'$or':_['map'](_0x69842a,function(_0x393d75){if(_0x393d75[_0xdeff('0x3f')]!=='VIRTUAL'){var _0x30609b={};_0x30609b[_0x393d75[_0xdeff('0x2d')]]={'$like':'%'+_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x30609b;}})});}_0x59f7a0=_[_0xdeff('0x40')]({},_0x59f7a0,_0x34e258['options']);var _0x3d8a33={'where':_0x59f7a0[_0xdeff('0x3d')]};return db[_0xdeff('0x31')][_0xdeff('0x41')](_0x3d8a33)[_0xdeff('0x27')](function(_0x5dfbb3){_0x505e3f['count']=_0x5dfbb3;if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x42')]){_0x59f7a0[_0xdeff('0x43')]=[{'all':!![]}];}return db[_0xdeff('0x31')][_0xdeff('0x44')](_0x59f7a0);})[_0xdeff('0x27')](function(_0x2cd68a){_0x505e3f['rows']=_0x2cd68a;return _0x505e3f;})[_0xdeff('0x27')](respondWithFilteredResult(_0x5045b8,_0x59f7a0))[_0xdeff('0x45')](handleError(_0x5045b8,null));};exports[_0xdeff('0x46')]=function(_0x54fa5b,_0x1c3532){var _0x2c5eee={'raw':!![],'where':{'id':_0x54fa5b[_0xdeff('0x47')]['id']}},_0x14dc7b={};_0x14dc7b['model']=_[_0xdeff('0x34')](db[_0xdeff('0x31')][_0xdeff('0x48')]);_0x14dc7b[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x54fa5b[_0xdeff('0x35')]);_0x14dc7b[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x14dc7b['model'],_0x14dc7b[_0xdeff('0x35')]);_0x2c5eee[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x14dc7b[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x54fa5b['query'][_0xdeff('0x39')]));_0x2c5eee[_0xdeff('0x38')]=_0x2c5eee[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x2c5eee[_0xdeff('0x38')]:_0x14dc7b['model'];if(_0x54fa5b[_0xdeff('0x35')]['includeAll']){_0x2c5eee[_0xdeff('0x43')]=[{'all':!![]}];}_0x2c5eee=_[_0xdeff('0x40')]({},_0x2c5eee,_0x54fa5b[_0xdeff('0x49')]);return db[_0xdeff('0x31')][_0xdeff('0x4a')](_0x2c5eee)[_0xdeff('0x27')](handleEntityNotFound(_0x1c3532,null))['then'](respondWithResult(_0x1c3532,null))['catch'](handleError(_0x1c3532,null));};exports[_0xdeff('0x4b')]=function(_0xf91a72,_0x3dc206){return db['VoiceMail']['create'](_0xf91a72[_0xdeff('0x4c')],{})[_0xdeff('0x27')](function(_0x497d9f){var _0x23f17d=_0xf91a72[_0xdeff('0x4d')][_0xdeff('0x4e')]({'plain':!![]});if(!_0x23f17d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f17d[_0xdeff('0x4f')]===_0xdeff('0x4d')){var _0x1ca376=_0x497d9f['get']({'plain':!![]});var _0xce8379=_0xdeff('0x29');return db[_0xdeff('0x50')][_0xdeff('0x4a')]({'where':{'name':_0xce8379,'userProfileId':_0x23f17d[_0xdeff('0x51')]},'raw':!![]})[_0xdeff('0x27')](function(_0x2c7fa4){if(_0x2c7fa4&&_0x2c7fa4['autoAssociation']===0x0){return db[_0xdeff('0x2a')][_0xdeff('0x4b')]({'name':_0x1ca376['name'],'resourceId':_0x1ca376['id'],'type':_0x2c7fa4[_0xdeff('0x2d')],'sectionId':_0x2c7fa4['id']},{})[_0xdeff('0x27')](function(){return _0x497d9f;});}else{return _0x497d9f;}})[_0xdeff('0x45')](function(_0x33482b){logger[_0xdeff('0x2b')](_0xdeff('0x52'),_0x33482b);throw _0x33482b;});}return _0x497d9f;})[_0xdeff('0x27')](respondWithResult(_0x3dc206,0xc9))[_0xdeff('0x45')](handleError(_0x3dc206,null));};exports['update']=function(_0x1b7eb3,_0x3a518d){if(_0x1b7eb3[_0xdeff('0x4c')]['id']){delete _0x1b7eb3['body']['id'];}return db['VoiceMail'][_0xdeff('0x4a')]({'where':{'id':_0x1b7eb3[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x3a518d,null))[_0xdeff('0x27')](saveUpdates(_0x1b7eb3[_0xdeff('0x4c')],null))[_0xdeff('0x27')](respondWithResult(_0x3a518d,null))['catch'](handleError(_0x3a518d,null));};exports['destroy']=function(_0x38338b,_0x1cc2c1){return db['VoiceMail']['find']({'where':{'id':_0x38338b[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x1cc2c1,null))['then'](removeEntity(_0x1cc2c1,null))[_0xdeff('0x45')](handleError(_0x1cc2c1,null));};exports[_0xdeff('0x53')]=function(_0x577fa8,_0x14fa7f,_0xe731d8){return db['VoiceMail'][_0xdeff('0x54')]({'where':{'id':_0x577fa8[_0xdeff('0x47')]['id']}})['then'](handleEntityNotFound(_0x14fa7f,null))[_0xdeff('0x27')](function(_0x152187){var _0x2a83ac;var _0x592ea6={},_0x47e86d={};_0x47e86d[_0xdeff('0x33')]=_['keys'](db[_0xdeff('0x55')][_0xdeff('0x48')]);_0x47e86d[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x577fa8[_0xdeff('0x35')]);_0x47e86d['filters']=_['intersection'](_0x47e86d[_0xdeff('0x33')],_0x47e86d[_0xdeff('0x35')]);_0x592ea6[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x47e86d[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x577fa8['query'][_0xdeff('0x39')]));_0x592ea6['attributes']=_0x592ea6[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x592ea6[_0xdeff('0x38')]:_0x47e86d[_0xdeff('0x33')];if(!_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3b')](_0xdeff('0x56'))){_0x592ea6[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x577fa8['query'][_0xdeff('0x21')]);_0x592ea6['offset']=qs[_0xdeff('0x1f')](_0x577fa8[_0xdeff('0x35')]['offset']);}_0x592ea6[_0xdeff('0x57')]=qs['sort'](_0x577fa8[_0xdeff('0x35')]['sort']);_0x592ea6['where']=qs[_0xdeff('0x36')](_[_0xdeff('0x58')](_0x577fa8['query'],_0x47e86d[_0xdeff('0x36')]));if(_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x592ea6[_0xdeff('0x3d')]=_[_0xdeff('0x40')](_0x592ea6[_0xdeff('0x3d')],{'$or':_[_0xdeff('0x30')](_0x592ea6[_0xdeff('0x38')],function(_0x46046a){var _0x517ca7={};_0x517ca7[_0x46046a]={'$like':'%'+_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x517ca7;})});}_0x592ea6['where']=_['merge'](_0x592ea6[_0xdeff('0x3d')],{'mailboxuser':_0x152187[_0xdeff('0x59')]});_0x592ea6=_['merge']({},_0x592ea6,_0x577fa8[_0xdeff('0x49')]);return db[_0xdeff('0x55')][_0xdeff('0x5a')](_0x592ea6)[_0xdeff('0x27')](respondWithFilteredResult(_0x14fa7f,_0x592ea6));})[_0xdeff('0x45')](handleError(_0x14fa7f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index e0847c4..6613259 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 _0x18ab=['util','api','moment','bluebird','request-promise','path','rimraf','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x565aaf,_0x256ac6){var _0x4a3349=function(_0xe92df1){while(--_0xe92df1){_0x565aaf['push'](_0x565aaf['shift']());}};_0x4a3349(++_0x256ac6);}(_0x18ab,0x1ee));var _0xb18a=function(_0x4cc562,_0xa5669a){_0x4cc562=_0x4cc562-0x0;var _0x37b503=_0x18ab[_0x4cc562];return _0x37b503;};'use strict';var _=require(_0xb18a('0x0'));var util=require(_0xb18a('0x1'));var logger=require('../../config/logger')(_0xb18a('0x2'));var moment=require(_0xb18a('0x3'));var BPromise=require(_0xb18a('0x4'));var rp=require(_0xb18a('0x5'));var fs=require('fs');var path=require(_0xb18a('0x6'));var rimraf=require(_0xb18a('0x7'));var config=require('../../config/environment');var attributes=require(_0xb18a('0x8'));module['exports']=function(_0x5c5696,_0x2acf5e){return _0x5c5696[_0xb18a('0x9')](_0xb18a('0xa'),attributes,{'tableName':_0xb18a('0xb'),'paranoid':![],'indexes':[{'name':_0xb18a('0xc'),'fields':[_0xb18a('0xd'),_0xb18a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e0=['define','voice_voicemail','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3e0,0xd3));var _0x0a3e=function(_0x4ed867,_0x40961c){_0x4ed867=_0x4ed867-0x0;var _0x47f0cb=_0xa3e0[_0x4ed867];return _0x47f0cb;};'use strict';var _=require(_0x0a3e('0x0'));var util=require(_0x0a3e('0x1'));var logger=require('../../config/logger')(_0x0a3e('0x2'));var moment=require(_0x0a3e('0x3'));var BPromise=require(_0x0a3e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a3e('0x5'));var rimraf=require(_0x0a3e('0x6'));var config=require(_0x0a3e('0x7'));var attributes=require('./voiceMail.attributes');module[_0x0a3e('0x8')]=function(_0x11ad3b,_0x2dd06d){return _0x11ad3b[_0x0a3e('0x9')]('VoiceMail',attributes,{'tableName':_0x0a3e('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index ba51839..14cd8b8 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 _0x1f00=['jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2543b9,_0x5281f9){var _0x4d30c7=function(_0x34149b){while(--_0x34149b){_0x2543b9['push'](_0x2543b9['shift']());}};_0x4d30c7(++_0x5281f9);}(_0x1f00,0x9f));var _0x01f0=function(_0x2aed5e,_0x1950a5){_0x2aed5e=_0x2aed5e-0x0;var _0x2e8ecb=_0x1f00[_0x2aed5e];return _0x2e8ecb;};'use strict';var _=require(_0x01f0('0x0'));var util=require(_0x01f0('0x1'));var moment=require(_0x01f0('0x2'));var BPromise=require('bluebird');var rs=require(_0x01f0('0x3'));var fs=require('fs');var Redis=require(_0x01f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x01f0('0x5'));var logger=require(_0x01f0('0x6'))(_0x01f0('0x7'));var config=require(_0x01f0('0x8'));var jayson=require(_0x01f0('0x9'));var client=jayson[_0x01f0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cfc21,_0x14d512,_0x5998c3){return new BPromise(function(_0x127094,_0xa0698a){return client[_0x01f0('0xb')](_0x1cfc21,_0x5998c3)[_0x01f0('0xc')](function(_0x4620ba){logger[_0x01f0('0xd')](_0x01f0('0xe'),_0x14d512,_0x01f0('0xf'));logger[_0x01f0('0x10')](_0x01f0('0x11'),_0x14d512,_0x01f0('0xf'),JSON[_0x01f0('0x12')](_0x4620ba));if(_0x4620ba[_0x01f0('0x13')]){if(_0x4620ba['error'][_0x01f0('0x14')]===0x1f4){logger[_0x01f0('0x13')](_0x01f0('0xe'),_0x14d512,_0x4620ba[_0x01f0('0x13')][_0x01f0('0x15')]);return _0xa0698a(_0x4620ba['error'][_0x01f0('0x15')]);}logger[_0x01f0('0x13')](_0x01f0('0xe'),_0x14d512,_0x4620ba[_0x01f0('0x13')][_0x01f0('0x15')]);return _0x127094(_0x4620ba['error'][_0x01f0('0x15')]);}else{logger[_0x01f0('0xd')]('VoiceMail,\x20%s,\x20%s',_0x14d512,'request\x20sent');_0x127094(_0x4620ba[_0x01f0('0x16')]['message']);}})[_0x01f0('0x17')](function(_0x56ac92){logger[_0x01f0('0x13')](_0x01f0('0xe'),_0x14d512,_0x56ac92);_0xa0698a(_0x56ac92);});});} \ No newline at end of file +var _0xda48=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceMail,\x20%s,\x20%s','message'];(function(_0x41bcfa,_0x512165){var _0x2d4eaa=function(_0x2f0714){while(--_0x2f0714){_0x41bcfa['push'](_0x41bcfa['shift']());}};_0x2d4eaa(++_0x512165);}(_0xda48,0x1a4));var _0x8da4=function(_0x5431e7,_0x19b1b9){_0x5431e7=_0x5431e7-0x0;var _0x388426=_0xda48[_0x5431e7];return _0x388426;};'use strict';var _=require(_0x8da4('0x0'));var util=require(_0x8da4('0x1'));var moment=require(_0x8da4('0x2'));var BPromise=require('bluebird');var rs=require(_0x8da4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8da4('0x4'))['db'];var utils=require(_0x8da4('0x5'));var logger=require('../../config/logger')(_0x8da4('0x6'));var config=require(_0x8da4('0x7'));var jayson=require(_0x8da4('0x8'));var client=jayson[_0x8da4('0x9')][_0x8da4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13d70d,_0x2d4edb,_0x5a60fa){return new BPromise(function(_0x2732c2,_0x1cea08){return client[_0x8da4('0xb')](_0x13d70d,_0x5a60fa)['then'](function(_0x2dcbb2){logger[_0x8da4('0xc')]('VoiceMail,\x20%s,\x20%s',_0x2d4edb,'request\x20sent');logger[_0x8da4('0xd')](_0x8da4('0xe'),_0x2d4edb,_0x8da4('0xf'),JSON[_0x8da4('0x10')](_0x2dcbb2));if(_0x2dcbb2[_0x8da4('0x11')]){if(_0x2dcbb2[_0x8da4('0x11')]['code']===0x1f4){logger[_0x8da4('0x11')](_0x8da4('0x12'),_0x2d4edb,_0x2dcbb2[_0x8da4('0x11')][_0x8da4('0x13')]);return _0x1cea08(_0x2dcbb2['error'][_0x8da4('0x13')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x2d4edb,_0x2dcbb2[_0x8da4('0x11')][_0x8da4('0x13')]);return _0x2732c2(_0x2dcbb2[_0x8da4('0x11')]['message']);}else{logger[_0x8da4('0xc')](_0x8da4('0x12'),_0x2d4edb,'request\x20sent');_0x2732c2(_0x2dcbb2[_0x8da4('0x14')]['message']);}})[_0x8da4('0x15')](function(_0x2e52b8){logger[_0x8da4('0x11')](_0x8da4('0x12'),_0x2d4edb,_0x2e52b8);_0x1cea08(_0x2e52b8);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 889dc66..314c0b4 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 _0x398c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','update','destroy','multer','path','connect-timeout','express','Router'];(function(_0x2bd266,_0x1cab75){var _0x355ab1=function(_0x5d3942){while(--_0x5d3942){_0x2bd266['push'](_0x2bd266['shift']());}};_0x355ab1(++_0x1cab75);}(_0x398c,0xaf));var _0xc398=function(_0x39b2ed,_0x44cb8d){_0x39b2ed=_0x39b2ed-0x0;var _0x1beb56=_0x398c[_0x39b2ed];return _0x1beb56;};'use strict';var multer=require(_0xc398('0x0'));var util=require('util');var path=require(_0xc398('0x1'));var timeout=require(_0xc398('0x2'));var express=require(_0xc398('0x3'));var router=express[_0xc398('0x4')]();var fs_extra=require(_0xc398('0x5'));var auth=require(_0xc398('0x6'));var interaction=require(_0xc398('0x7'));var config=require(_0xc398('0x8'));var controller=require('./voiceMailMessage.controller');router[_0xc398('0x9')]('/',auth[_0xc398('0xa')](),controller[_0xc398('0xb')]);router[_0xc398('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc398('0xc')]);router[_0xc398('0x9')](_0xc398('0xd'),auth[_0xc398('0xa')](),controller[_0xc398('0xe')]);router[_0xc398('0xf')]('/',auth[_0xc398('0xa')](),controller[_0xc398('0x10')]);router['put'](_0xc398('0x11'),auth[_0xc398('0xa')](),controller[_0xc398('0x12')]);router['delete'](_0xc398('0x11'),auth[_0xc398('0xa')](),controller[_0xc398('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd527=['isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x34bec8,_0x10950b){var _0x3eb5e6=function(_0x1fb0fd){while(--_0x1fb0fd){_0x34bec8['push'](_0x34bec8['shift']());}};_0x3eb5e6(++_0x10950b);}(_0xd527,0x1c4));var _0x7d52=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0xd527[_0x4d934b];return _0xc0338b;};'use strict';var multer=require(_0x7d52('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7d52('0x1'));var express=require(_0x7d52('0x2'));var router=express['Router']();var fs_extra=require(_0x7d52('0x3'));var auth=require(_0x7d52('0x4'));var interaction=require(_0x7d52('0x5'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x7d52('0x6')]('/',auth[_0x7d52('0x7')](),controller[_0x7d52('0x8')]);router[_0x7d52('0x6')](_0x7d52('0x9'),auth[_0x7d52('0x7')](),controller[_0x7d52('0xa')]);router[_0x7d52('0x6')](_0x7d52('0xb'),auth[_0x7d52('0x7')](),controller[_0x7d52('0xc')]);router[_0x7d52('0xd')]('/',auth['isAuthenticated'](),controller[_0x7d52('0xe')]);router[_0x7d52('0xf')]('/:id',auth[_0x7d52('0x7')](),controller['update']);router['delete'](_0x7d52('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7d52('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index b5ae772..5880c99 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 _0x941d=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','INTEGER','STRING','long','literal'];(function(_0x4a932e,_0x5e000b){var _0x4aebfa=function(_0x248d2b){while(--_0x248d2b){_0x4a932e['push'](_0x4a932e['shift']());}};_0x4aebfa(++_0x5e000b);}(_0x941d,0x197));var _0xd941=function(_0x3cdba4,_0x38853d){_0x3cdba4=_0x3cdba4-0x0;var _0x5b35bc=_0x941d[_0x3cdba4];return _0x5b35bc;};'use strict';var Sequelize=require(_0xd941('0x0'));module[_0xd941('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x46efb1){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xd941('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd941('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xd941('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd941('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd941('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd941('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xd941('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xd941('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd941('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xd941('0x5')](_0xd941('0x6'))}}; \ No newline at end of file +var _0x868b=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x868b,0x1bc));var _0xb868=function(_0x20d10a,_0x58c7f1){_0x20d10a=_0x20d10a-0x0;var _0xd15cb8=_0x868b[_0x20d10a];return _0xd15cb8;};'use strict';var Sequelize=require('sequelize');module[_0xb868('0x0')]={'name':{'type':Sequelize[_0xb868('0x1')],'get':function(_0x78174f){return this[_0xb868('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xb868('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb868('0x5')](_0xb868('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb868('0x4')],'defaultValue':''},'stamp':{'type':_0xb868('0x7'),'defaultValue':Sequelize[_0xb868('0x8')](_0xb868('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ae34aa8..f1b31b7 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 _0xbfc4=['then','error','stack','send','index','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','recording','msg_id','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy'];(function(_0x1a8d10,_0x154468){var _0x145c67=function(_0x7c781b){while(--_0x7c781b){_0x1a8d10['push'](_0x1a8d10['shift']());}};_0x145c67(++_0x154468);}(_0xbfc4,0xda));var _0x4bfc=function(_0x4168cc,_0x29b9b1){_0x4168cc=_0x4168cc-0x0;var _0x1156f9=_0xbfc4[_0x4168cc];return _0x1156f9;};'use strict';var emlformat=require(_0x4bfc('0x0'));var rimraf=require(_0x4bfc('0x1'));var zipdir=require(_0x4bfc('0x2'));var jsonpatch=require(_0x4bfc('0x3'));var rp=require(_0x4bfc('0x4'));var moment=require(_0x4bfc('0x5'));var BPromise=require(_0x4bfc('0x6'));var Mustache=require(_0x4bfc('0x7'));var util=require(_0x4bfc('0x8'));var path=require(_0x4bfc('0x9'));var sox=require('sox');var csv=require(_0x4bfc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bfc('0xb'));var _=require(_0x4bfc('0xc'));var squel=require(_0x4bfc('0xd'));var crypto=require(_0x4bfc('0xe'));var jsforce=require(_0x4bfc('0xf'));var deskjs=require(_0x4bfc('0x10'));var toCsv=require(_0x4bfc('0xa'));var querystring=require(_0x4bfc('0x11'));var Papa=require(_0x4bfc('0x12'));var Redis=require(_0x4bfc('0x13'));var authService=require(_0x4bfc('0x14'));var qs=require(_0x4bfc('0x15'));var as=require(_0x4bfc('0x16'));var hardwareService=require(_0x4bfc('0x17'));var logger=require(_0x4bfc('0x18'))(_0x4bfc('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4bfc('0x1a'));var db=require(_0x4bfc('0x1b'))['db'];function respondWithStatusCode(_0x7d958e,_0x1b6301){_0x1b6301=_0x1b6301||0xcc;return function(_0x12858f){if(_0x12858f){return _0x7d958e[_0x4bfc('0x1c')](_0x1b6301);}return _0x7d958e['status'](_0x1b6301)['end']();};}function respondWithResult(_0x491bcd,_0x880615){_0x880615=_0x880615||0xc8;return function(_0x2381c3){if(_0x2381c3){return _0x491bcd[_0x4bfc('0x1d')](_0x880615)[_0x4bfc('0x1e')](_0x2381c3);}};}function respondWithFilteredResult(_0x42308a,_0x4fd839){return function(_0x4a132e){if(_0x4a132e){var _0x27298c=typeof _0x4fd839[_0x4bfc('0x1f')]===_0x4bfc('0x20')&&typeof _0x4fd839[_0x4bfc('0x21')]==='undefined';var _0x270750=_0x4a132e[_0x4bfc('0x22')];var _0x434ab3=_0x27298c?0x0:_0x4fd839[_0x4bfc('0x1f')];var _0x1fff29=_0x27298c?_0x4a132e['count']:_0x4fd839['offset']+_0x4fd839[_0x4bfc('0x21')];var _0x5945a7;if(_0x1fff29>=_0x270750){_0x1fff29=_0x270750;_0x5945a7=0xc8;}else{_0x5945a7=0xce;}_0x42308a[_0x4bfc('0x1d')](_0x5945a7);return _0x42308a['set'](_0x4bfc('0x23'),_0x434ab3+'-'+_0x1fff29+'/'+_0x270750)['json'](_0x4a132e);}return null;};}function patchUpdates(_0x49568d){return function(_0xa31c6e){try{jsonpatch[_0x4bfc('0x24')](_0xa31c6e,_0x49568d,!![]);}catch(_0x3ae617){return BPromise['reject'](_0x3ae617);}return _0xa31c6e[_0x4bfc('0x25')]();};}function saveUpdates(_0x5e9551,_0x101970){return function(_0x2e81ab){if(_0x2e81ab){return _0x2e81ab[_0x4bfc('0x26')](_0x5e9551)['then'](function(_0x2ead95){return _0x2ead95;});}return null;};}function removeEntity(_0x4c42e1,_0x9ec258){return function(_0xd2fda3){if(_0xd2fda3){return _0xd2fda3[_0x4bfc('0x27')]()[_0x4bfc('0x28')](function(){_0x4c42e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40de90,_0x4f33bc){return function(_0x1195c7){if(!_0x1195c7){_0x40de90[_0x4bfc('0x1c')](0x194);}return _0x1195c7;};}function handleError(_0x296af5,_0x29a390){_0x29a390=_0x29a390||0x1f4;return function(_0x553de3){logger[_0x4bfc('0x29')](_0x553de3[_0x4bfc('0x2a')]);if(_0x553de3['name']){delete _0x553de3['name'];}_0x296af5['status'](_0x29a390)[_0x4bfc('0x2b')](_0x553de3);};}exports[_0x4bfc('0x2c')]=function(_0x67a91,_0x57f1cc){var _0x44fd46={},_0x6aff29={},_0x91164={'count':0x0,'rows':[]};var _0x32a7e6=_['map'](db[_0x4bfc('0x2d')][_0x4bfc('0x2e')],function(_0x2c2623){return{'name':_0x2c2623[_0x4bfc('0x2f')],'type':_0x2c2623['type'][_0x4bfc('0x30')]};});_0x6aff29[_0x4bfc('0x31')]=_[_0x4bfc('0x32')](_[_0x4bfc('0x33')](_0x32a7e6,'name'),[_0x4bfc('0x34')]);_0x6aff29[_0x4bfc('0x35')]=_[_0x4bfc('0x36')](_0x67a91[_0x4bfc('0x35')]);_0x6aff29[_0x4bfc('0x37')]=_[_0x4bfc('0x38')](_0x6aff29['model'],_0x6aff29[_0x4bfc('0x35')]);_0x44fd46[_0x4bfc('0x39')]=_[_0x4bfc('0x38')](_0x6aff29['model'],qs['fields'](_0x67a91['query'][_0x4bfc('0x3a')]));_0x44fd46[_0x4bfc('0x39')]=_0x44fd46[_0x4bfc('0x39')][_0x4bfc('0x3b')]?_0x44fd46[_0x4bfc('0x39')]:_0x6aff29[_0x4bfc('0x31')];if(!_0x67a91[_0x4bfc('0x35')][_0x4bfc('0x3c')](_0x4bfc('0x3d'))){_0x44fd46[_0x4bfc('0x21')]=qs[_0x4bfc('0x21')](_0x67a91[_0x4bfc('0x35')][_0x4bfc('0x21')]);_0x44fd46[_0x4bfc('0x1f')]=qs['offset'](_0x67a91[_0x4bfc('0x35')][_0x4bfc('0x1f')]);}_0x44fd46[_0x4bfc('0x3e')]=qs[_0x4bfc('0x3f')](_0x67a91[_0x4bfc('0x35')][_0x4bfc('0x3f')]);_0x44fd46[_0x4bfc('0x40')]=qs[_0x4bfc('0x37')](_['pick'](_0x67a91['query'],_0x6aff29['filters']),_0x32a7e6);if(_0x67a91[_0x4bfc('0x35')]['filter']){_0x44fd46['where']=_[_0x4bfc('0x41')](_0x44fd46[_0x4bfc('0x40')],{'$or':_['map'](_0x32a7e6,function(_0x4fc599){if(_0x4fc599[_0x4bfc('0x42')]!==_0x4bfc('0x43')){var _0x177dce={};_0x177dce[_0x4fc599[_0x4bfc('0x34')]]={'$like':'%'+_0x67a91['query']['filter']+'%'};return _0x177dce;}})});}_0x44fd46=_[_0x4bfc('0x41')]({},_0x44fd46,_0x67a91[_0x4bfc('0x44')]);var _0x4bb89b={'where':_0x44fd46[_0x4bfc('0x40')]};return db['VoiceMailMessage'][_0x4bfc('0x22')](_0x4bb89b)[_0x4bfc('0x28')](function(_0x4b272e){_0x91164[_0x4bfc('0x22')]=_0x4b272e;if(_0x67a91[_0x4bfc('0x35')]['includeAll']){_0x44fd46[_0x4bfc('0x45')]=[{'all':!![]}];}return db[_0x4bfc('0x2d')]['findAll'](_0x44fd46);})[_0x4bfc('0x28')](function(_0x58b219){_0x91164[_0x4bfc('0x46')]=_0x58b219;return _0x91164;})[_0x4bfc('0x28')](respondWithFilteredResult(_0x57f1cc,_0x44fd46))[_0x4bfc('0x47')](handleError(_0x57f1cc,null));};exports[_0x4bfc('0x48')]=function(_0x389fae,_0x49a50f){var _0x2912ba={'raw':!![],'where':{'id':_0x389fae[_0x4bfc('0x49')]['id']}},_0x3f4b3c={};_0x3f4b3c[_0x4bfc('0x31')]=_[_0x4bfc('0x36')](db[_0x4bfc('0x2d')]['rawAttributes']);_0x3f4b3c[_0x4bfc('0x35')]=_[_0x4bfc('0x36')](_0x389fae[_0x4bfc('0x35')]);_0x3f4b3c[_0x4bfc('0x37')]=_[_0x4bfc('0x38')](_0x3f4b3c[_0x4bfc('0x31')],_0x3f4b3c['query']);_0x2912ba['attributes']=_[_0x4bfc('0x38')](_0x3f4b3c[_0x4bfc('0x31')],qs[_0x4bfc('0x3a')](_0x389fae[_0x4bfc('0x35')][_0x4bfc('0x3a')]));_0x2912ba[_0x4bfc('0x39')]=_0x2912ba['attributes'][_0x4bfc('0x3b')]?_0x2912ba['attributes']:_0x3f4b3c['model'];if(_0x389fae[_0x4bfc('0x35')][_0x4bfc('0x4a')]){_0x2912ba[_0x4bfc('0x45')]=[{'all':!![]}];}_0x2912ba=_['merge']({},_0x2912ba,_0x389fae[_0x4bfc('0x44')]);return db['VoiceMailMessage'][_0x4bfc('0x4b')](_0x2912ba)[_0x4bfc('0x28')](handleEntityNotFound(_0x49a50f,null))[_0x4bfc('0x28')](respondWithResult(_0x49a50f,null))[_0x4bfc('0x47')](handleError(_0x49a50f,null));};exports['create']=function(_0x1a6480,_0x3016cd){return db[_0x4bfc('0x2d')][_0x4bfc('0x4c')](_0x1a6480['body'],{})['then'](respondWithResult(_0x3016cd,0xc9))['catch'](handleError(_0x3016cd,null));};exports['update']=function(_0x226930,_0x135262){if(_0x226930[_0x4bfc('0x4d')]['id']){delete _0x226930[_0x4bfc('0x4d')]['id'];}return db[_0x4bfc('0x2d')]['find']({'where':{'id':_0x226930['params']['id']}})['then'](handleEntityNotFound(_0x135262,null))[_0x4bfc('0x28')](saveUpdates(_0x226930['body'],null))[_0x4bfc('0x28')](respondWithResult(_0x135262,null))[_0x4bfc('0x47')](handleError(_0x135262,null));};exports['destroy']=function(_0x1344eb,_0x4dcef0){return db[_0x4bfc('0x2d')][_0x4bfc('0x4b')]({'where':{'id':_0x1344eb['params']['id']}})[_0x4bfc('0x28')](handleEntityNotFound(_0x4dcef0,null))[_0x4bfc('0x28')](removeEntity(_0x4dcef0,null))[_0x4bfc('0x47')](handleError(_0x4dcef0,null));};exports['download']=function(_0x224426,_0xeebb6d,_0x54ca39){return db[_0x4bfc('0x2d')][_0x4bfc('0x4b')]({'where':{'id':_0x224426['params']['id']},'attributes':['id',_0x4bfc('0x4e'),_0x4bfc('0x4f')]})[_0x4bfc('0x28')](handleEntityNotFound(_0xeebb6d,null))[_0x4bfc('0x28')](function(_0x5cea85){if(_0x5cea85){if(!_0x5cea85['recording']){throw new db['Sequelize']['ValidationError'](_0x4bfc('0x50'));}var _0x204689={'Content-Type':_0x4bfc('0x51'),'Content-Disposition':_0x4bfc('0x52')};if(_0x5cea85[_0x4bfc('0x4f')]){_0x204689[_0x4bfc('0x53')]='attachment;\x20filename=\x22'+_0x5cea85[_0x4bfc('0x4f')]+_0x4bfc('0x54');}_0xeebb6d[_0x4bfc('0x55')](_0x204689);return _0xeebb6d['send'](new Buffer(_0x5cea85['recording']));}})[_0x4bfc('0x47')](handleError(_0xeebb6d,null));}; \ No newline at end of file +var _0xf7eb=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','then','destroy','name','send','index','rawAttributes','fieldName','type','model','differenceBy','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','params','keys','find','create','update','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','msg_id','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x8056f5,_0x2e712b){var _0x593c27=function(_0x2122e8){while(--_0x2122e8){_0x8056f5['push'](_0x8056f5['shift']());}};_0x593c27(++_0x2e712b);}(_0xf7eb,0xec));var _0xbf7e=function(_0x285a94,_0x1cb302){_0x285a94=_0x285a94-0x0;var _0x27a564=_0xf7eb[_0x285a94];return _0x27a564;};'use strict';var emlformat=require(_0xbf7e('0x0'));var rimraf=require(_0xbf7e('0x1'));var zipdir=require(_0xbf7e('0x2'));var jsonpatch=require(_0xbf7e('0x3'));var rp=require(_0xbf7e('0x4'));var moment=require(_0xbf7e('0x5'));var BPromise=require(_0xbf7e('0x6'));var Mustache=require(_0xbf7e('0x7'));var util=require(_0xbf7e('0x8'));var path=require('path');var sox=require(_0xbf7e('0x9'));var csv=require(_0xbf7e('0xa'));var ejs=require(_0xbf7e('0xb'));var fs=require('fs');var fs_extra=require(_0xbf7e('0xc'));var _=require(_0xbf7e('0xd'));var squel=require(_0xbf7e('0xe'));var crypto=require(_0xbf7e('0xf'));var jsforce=require(_0xbf7e('0x10'));var deskjs=require(_0xbf7e('0x11'));var toCsv=require(_0xbf7e('0xa'));var querystring=require(_0xbf7e('0x12'));var Papa=require(_0xbf7e('0x13'));var Redis=require(_0xbf7e('0x14'));var authService=require(_0xbf7e('0x15'));var qs=require(_0xbf7e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf7e('0x17'));var logger=require(_0xbf7e('0x18'))(_0xbf7e('0x19'));var utils=require(_0xbf7e('0x1a'));var config=require(_0xbf7e('0x1b'));var licenseUtil=require(_0xbf7e('0x1c'));var db=require(_0xbf7e('0x1d'))['db'];function respondWithStatusCode(_0x34a0bf,_0x34a959){_0x34a959=_0x34a959||0xcc;return function(_0x523f8f){if(_0x523f8f){return _0x34a0bf[_0xbf7e('0x1e')](_0x34a959);}return _0x34a0bf[_0xbf7e('0x1f')](_0x34a959)[_0xbf7e('0x20')]();};}function respondWithResult(_0x5f1c9,_0x5ea196){_0x5ea196=_0x5ea196||0xc8;return function(_0x3e46db){if(_0x3e46db){return _0x5f1c9['status'](_0x5ea196)[_0xbf7e('0x21')](_0x3e46db);}};}function respondWithFilteredResult(_0x5c75aa,_0x5cbeea){return function(_0xa44bb0){if(_0xa44bb0){var _0x584904=typeof _0x5cbeea[_0xbf7e('0x22')]===_0xbf7e('0x23')&&typeof _0x5cbeea['limit']==='undefined';var _0x19ecf4=_0xa44bb0[_0xbf7e('0x24')];var _0x343bf9=_0x584904?0x0:_0x5cbeea['offset'];var _0xd3916b=_0x584904?_0xa44bb0[_0xbf7e('0x24')]:_0x5cbeea[_0xbf7e('0x22')]+_0x5cbeea[_0xbf7e('0x25')];var _0x2af43c;if(_0xd3916b>=_0x19ecf4){_0xd3916b=_0x19ecf4;_0x2af43c=0xc8;}else{_0x2af43c=0xce;}_0x5c75aa[_0xbf7e('0x1f')](_0x2af43c);return _0x5c75aa['set']('Content-Range',_0x343bf9+'-'+_0xd3916b+'/'+_0x19ecf4)[_0xbf7e('0x21')](_0xa44bb0);}return null;};}function patchUpdates(_0x2d8db8){return function(_0x5f0c7b){try{jsonpatch[_0xbf7e('0x26')](_0x5f0c7b,_0x2d8db8,!![]);}catch(_0x33cf38){return BPromise[_0xbf7e('0x27')](_0x33cf38);}return _0x5f0c7b['save']();};}function saveUpdates(_0x389541,_0x3c7db7){return function(_0x1be2fc){if(_0x1be2fc){return _0x1be2fc['update'](_0x389541)[_0xbf7e('0x28')](function(_0x217ff6){return _0x217ff6;});}return null;};}function removeEntity(_0x3a0409,_0x56d392){return function(_0x2a2666){if(_0x2a2666){return _0x2a2666[_0xbf7e('0x29')]()[_0xbf7e('0x28')](function(){_0x3a0409[_0xbf7e('0x1f')](0xcc)[_0xbf7e('0x20')]();});}};}function handleEntityNotFound(_0x491da2,_0x88dc76){return function(_0x370fd5){if(!_0x370fd5){_0x491da2[_0xbf7e('0x1e')](0x194);}return _0x370fd5;};}function handleError(_0x268ac4,_0x3b17a3){_0x3b17a3=_0x3b17a3||0x1f4;return function(_0x3b842d){logger['error'](_0x3b842d['stack']);if(_0x3b842d[_0xbf7e('0x2a')]){delete _0x3b842d[_0xbf7e('0x2a')];}_0x268ac4[_0xbf7e('0x1f')](_0x3b17a3)[_0xbf7e('0x2b')](_0x3b842d);};}exports[_0xbf7e('0x2c')]=function(_0x5cbdde,_0x49de85){var _0x55d169={},_0x37e5ae={},_0x157418={'count':0x0,'rows':[]};var _0x4e2ead=_['map'](db['VoiceMailMessage'][_0xbf7e('0x2d')],function(_0x21f63f){return{'name':_0x21f63f[_0xbf7e('0x2e')],'type':_0x21f63f[_0xbf7e('0x2f')]['key']};});_0x37e5ae[_0xbf7e('0x30')]=_[_0xbf7e('0x31')](_[_0xbf7e('0x32')](_0x4e2ead,_0xbf7e('0x2a')),[_0xbf7e('0x2a')]);_0x37e5ae[_0xbf7e('0x33')]=_['keys'](_0x5cbdde[_0xbf7e('0x33')]);_0x37e5ae[_0xbf7e('0x34')]=_['intersection'](_0x37e5ae[_0xbf7e('0x30')],_0x37e5ae[_0xbf7e('0x33')]);_0x55d169[_0xbf7e('0x35')]=_[_0xbf7e('0x36')](_0x37e5ae[_0xbf7e('0x30')],qs[_0xbf7e('0x37')](_0x5cbdde[_0xbf7e('0x33')][_0xbf7e('0x37')]));_0x55d169[_0xbf7e('0x35')]=_0x55d169[_0xbf7e('0x35')][_0xbf7e('0x38')]?_0x55d169['attributes']:_0x37e5ae[_0xbf7e('0x30')];if(!_0x5cbdde[_0xbf7e('0x33')]['hasOwnProperty'](_0xbf7e('0x39'))){_0x55d169[_0xbf7e('0x25')]=qs['limit'](_0x5cbdde[_0xbf7e('0x33')]['limit']);_0x55d169[_0xbf7e('0x22')]=qs[_0xbf7e('0x22')](_0x5cbdde[_0xbf7e('0x33')][_0xbf7e('0x22')]);}_0x55d169[_0xbf7e('0x3a')]=qs[_0xbf7e('0x3b')](_0x5cbdde[_0xbf7e('0x33')][_0xbf7e('0x3b')]);_0x55d169[_0xbf7e('0x3c')]=qs[_0xbf7e('0x34')](_['pick'](_0x5cbdde[_0xbf7e('0x33')],_0x37e5ae[_0xbf7e('0x34')]),_0x4e2ead);if(_0x5cbdde[_0xbf7e('0x33')]['filter']){_0x55d169[_0xbf7e('0x3c')]=_['merge'](_0x55d169[_0xbf7e('0x3c')],{'$or':_[_0xbf7e('0x32')](_0x4e2ead,function(_0x4de981){if(_0x4de981[_0xbf7e('0x2f')]!=='VIRTUAL'){var _0x2c7ad7={};_0x2c7ad7[_0x4de981['name']]={'$like':'%'+_0x5cbdde['query']['filter']+'%'};return _0x2c7ad7;}})});}_0x55d169=_[_0xbf7e('0x3d')]({},_0x55d169,_0x5cbdde[_0xbf7e('0x3e')]);var _0x1de1bf={'where':_0x55d169[_0xbf7e('0x3c')]};return db[_0xbf7e('0x3f')][_0xbf7e('0x24')](_0x1de1bf)[_0xbf7e('0x28')](function(_0xdb3cb2){_0x157418[_0xbf7e('0x24')]=_0xdb3cb2;if(_0x5cbdde['query'][_0xbf7e('0x40')]){_0x55d169[_0xbf7e('0x41')]=[{'all':!![]}];}return db[_0xbf7e('0x3f')][_0xbf7e('0x42')](_0x55d169);})[_0xbf7e('0x28')](function(_0x81e404){_0x157418[_0xbf7e('0x43')]=_0x81e404;return _0x157418;})[_0xbf7e('0x28')](respondWithFilteredResult(_0x49de85,_0x55d169))[_0xbf7e('0x44')](handleError(_0x49de85,null));};exports['show']=function(_0x390147,_0x38bebe){var _0x3bd4bb={'raw':!![],'where':{'id':_0x390147[_0xbf7e('0x45')]['id']}},_0x15aa81={};_0x15aa81['model']=_[_0xbf7e('0x46')](db[_0xbf7e('0x3f')][_0xbf7e('0x2d')]);_0x15aa81['query']=_[_0xbf7e('0x46')](_0x390147[_0xbf7e('0x33')]);_0x15aa81[_0xbf7e('0x34')]=_[_0xbf7e('0x36')](_0x15aa81['model'],_0x15aa81[_0xbf7e('0x33')]);_0x3bd4bb[_0xbf7e('0x35')]=_[_0xbf7e('0x36')](_0x15aa81[_0xbf7e('0x30')],qs[_0xbf7e('0x37')](_0x390147['query'][_0xbf7e('0x37')]));_0x3bd4bb[_0xbf7e('0x35')]=_0x3bd4bb[_0xbf7e('0x35')][_0xbf7e('0x38')]?_0x3bd4bb[_0xbf7e('0x35')]:_0x15aa81['model'];if(_0x390147[_0xbf7e('0x33')][_0xbf7e('0x40')]){_0x3bd4bb[_0xbf7e('0x41')]=[{'all':!![]}];}_0x3bd4bb=_[_0xbf7e('0x3d')]({},_0x3bd4bb,_0x390147[_0xbf7e('0x3e')]);return db[_0xbf7e('0x3f')][_0xbf7e('0x47')](_0x3bd4bb)[_0xbf7e('0x28')](handleEntityNotFound(_0x38bebe,null))['then'](respondWithResult(_0x38bebe,null))[_0xbf7e('0x44')](handleError(_0x38bebe,null));};exports[_0xbf7e('0x48')]=function(_0x50e6e0,_0xaf099){return db[_0xbf7e('0x3f')][_0xbf7e('0x48')](_0x50e6e0['body'],{})[_0xbf7e('0x28')](respondWithResult(_0xaf099,0xc9))[_0xbf7e('0x44')](handleError(_0xaf099,null));};exports[_0xbf7e('0x49')]=function(_0x33ac3f,_0x3e1165){if(_0x33ac3f[_0xbf7e('0x4a')]['id']){delete _0x33ac3f['body']['id'];}return db['VoiceMailMessage'][_0xbf7e('0x47')]({'where':{'id':_0x33ac3f[_0xbf7e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e1165,null))[_0xbf7e('0x28')](saveUpdates(_0x33ac3f[_0xbf7e('0x4a')],null))['then'](respondWithResult(_0x3e1165,null))[_0xbf7e('0x44')](handleError(_0x3e1165,null));};exports[_0xbf7e('0x29')]=function(_0x2cb105,_0x56a203){return db[_0xbf7e('0x3f')][_0xbf7e('0x47')]({'where':{'id':_0x2cb105[_0xbf7e('0x45')]['id']}})[_0xbf7e('0x28')](handleEntityNotFound(_0x56a203,null))[_0xbf7e('0x28')](removeEntity(_0x56a203,null))[_0xbf7e('0x44')](handleError(_0x56a203,null));};exports[_0xbf7e('0x4b')]=function(_0x26db2f,_0x21d878,_0x7178a3){return db['VoiceMailMessage'][_0xbf7e('0x47')]({'where':{'id':_0x26db2f[_0xbf7e('0x45')]['id']},'attributes':['id',_0xbf7e('0x4c'),'msg_id']})[_0xbf7e('0x28')](handleEntityNotFound(_0x21d878,null))[_0xbf7e('0x28')](function(_0x156325){if(_0x156325){if(!_0x156325[_0xbf7e('0x4c')]){throw new db[(_0xbf7e('0x4d'))][(_0xbf7e('0x4e'))](_0xbf7e('0x4f'));}var _0x57877f={'Content-Type':'audio/wav','Content-Disposition':_0xbf7e('0x50')};if(_0x156325['msg_id']){_0x57877f[_0xbf7e('0x51')]=_0xbf7e('0x52')+_0x156325[_0xbf7e('0x53')]+_0xbf7e('0x54');}_0x21d878[_0xbf7e('0x55')](_0x57877f);return _0x21d878[_0xbf7e('0x2b')](new Buffer(_0x156325[_0xbf7e('0x4c')]));}})[_0xbf7e('0x44')](handleError(_0x21d878,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 1bfa6a1..25fe81b 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 _0x8e0d=['./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x533be8,_0x241b7a){var _0x33d0ca=function(_0x5cdd82){while(--_0x5cdd82){_0x533be8['push'](_0x533be8['shift']());}};_0x33d0ca(++_0x241b7a);}(_0x8e0d,0x1b5));var _0xd8e0=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x8e0d[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0xd8e0('0x0'));var util=require(_0xd8e0('0x1'));var logger=require(_0xd8e0('0x2'))(_0xd8e0('0x3'));var moment=require(_0xd8e0('0x4'));var BPromise=require(_0xd8e0('0x5'));var rp=require(_0xd8e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd8e0('0x7'));module['exports']=function(_0x51d142,_0x3daef2){return _0x51d142[_0xd8e0('0x8')](_0xd8e0('0x9'),attributes,{'tableName':_0xd8e0('0xa'),'paranoid':![],'indexes':[{'name':_0xd8e0('0xb'),'fields':[_0xd8e0('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd17b=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x475b88,_0x3e3588){var _0x52081b=function(_0x30f208){while(--_0x30f208){_0x475b88['push'](_0x475b88['shift']());}};_0x52081b(++_0x3e3588);}(_0xd17b,0xb8));var _0xbd17=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xd17b[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0xbd17('0x0'));var util=require('util');var logger=require(_0xbd17('0x1'))(_0xbd17('0x2'));var moment=require(_0xbd17('0x3'));var BPromise=require(_0xbd17('0x4'));var rp=require(_0xbd17('0x5'));var fs=require('fs');var path=require(_0xbd17('0x6'));var rimraf=require(_0xbd17('0x7'));var config=require(_0xbd17('0x8'));var attributes=require(_0xbd17('0x9'));module[_0xbd17('0xa')]=function(_0x48c5ab,_0x437dff){return _0x48c5ab[_0xbd17('0xb')](_0xbd17('0xc'),attributes,{'tableName':_0xbd17('0xd'),'paranoid':![],'indexes':[{'name':_0xbd17('0xe'),'fields':[_0xbd17('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d07897d..bb6d480 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 _0x3407=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3407,0x19c));var _0x7340=function(_0x2c53cf,_0x5b3c3b){_0x2c53cf=_0x2c53cf-0x0;var _0x1f492c=_0x3407[_0x2c53cf];return _0x1f492c;};'use strict';var _=require(_0x7340('0x0'));var util=require(_0x7340('0x1'));var moment=require(_0x7340('0x2'));var BPromise=require(_0x7340('0x3'));var rs=require(_0x7340('0x4'));var fs=require('fs');var Redis=require(_0x7340('0x5'));var db=require(_0x7340('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7340('0x7'))(_0x7340('0x8'));var config=require(_0x7340('0x9'));var jayson=require(_0x7340('0xa'));var client=jayson[_0x7340('0xb')][_0x7340('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4de83a,_0x3f2eac,_0x381c42){return new BPromise(function(_0x4fd138,_0x515b5f){return client['request'](_0x4de83a,_0x381c42)[_0x7340('0xd')](function(_0x516672){logger[_0x7340('0xe')](_0x7340('0xf'),_0x3f2eac,'request\x20sent');logger['debug'](_0x7340('0x10'),_0x3f2eac,'request\x20sent',JSON[_0x7340('0x11')](_0x516672));if(_0x516672['error']){if(_0x516672['error'][_0x7340('0x12')]===0x1f4){logger[_0x7340('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x3f2eac,_0x516672[_0x7340('0x13')][_0x7340('0x14')]);return _0x515b5f(_0x516672[_0x7340('0x13')][_0x7340('0x14')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x3f2eac,_0x516672['error']['message']);return _0x4fd138(_0x516672[_0x7340('0x13')][_0x7340('0x14')]);}else{logger[_0x7340('0xe')](_0x7340('0xf'),_0x3f2eac,_0x7340('0x15'));_0x4fd138(_0x516672[_0x7340('0x16')][_0x7340('0x14')]);}})[_0x7340('0x17')](function(_0xcccabc){logger[_0x7340('0x13')](_0x7340('0xf'),_0x3f2eac,_0xcccabc);_0x515b5f(_0xcccabc);});});} \ No newline at end of file +var _0xac5d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0xac5d,0xb0));var _0xdac5=function(_0x46ea96,_0x2ada2a){_0x46ea96=_0x46ea96-0x0;var _0x23be1a=_0xac5d[_0x46ea96];return _0x23be1a;};'use strict';var _=require(_0xdac5('0x0'));var util=require(_0xdac5('0x1'));var moment=require(_0xdac5('0x2'));var BPromise=require(_0xdac5('0x3'));var rs=require(_0xdac5('0x4'));var fs=require('fs');var Redis=require(_0xdac5('0x5'));var db=require(_0xdac5('0x6'))['db'];var utils=require(_0xdac5('0x7'));var logger=require('../../config/logger')(_0xdac5('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac5('0x9'));var client=jayson[_0xdac5('0xa')][_0xdac5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x303602,_0x96a2a9,_0x5d9b93){return new BPromise(function(_0x1a1cae,_0x33202f){return client[_0xdac5('0xc')](_0x303602,_0x5d9b93)[_0xdac5('0xd')](function(_0x231267){logger[_0xdac5('0xe')](_0xdac5('0xf'),_0x96a2a9,_0xdac5('0x10'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x96a2a9,_0xdac5('0x10'),JSON[_0xdac5('0x11')](_0x231267));if(_0x231267[_0xdac5('0x12')]){if(_0x231267['error'][_0xdac5('0x13')]===0x1f4){logger[_0xdac5('0x12')](_0xdac5('0xf'),_0x96a2a9,_0x231267[_0xdac5('0x12')][_0xdac5('0x14')]);return _0x33202f(_0x231267[_0xdac5('0x12')][_0xdac5('0x14')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x96a2a9,_0x231267['error'][_0xdac5('0x14')]);return _0x1a1cae(_0x231267[_0xdac5('0x12')]['message']);}else{logger[_0xdac5('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x96a2a9,'request\x20sent');_0x1a1cae(_0x231267[_0xdac5('0x15')][_0xdac5('0x14')]);}})['catch'](function(_0x40c0e1){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x96a2a9,_0x40c0e1);_0x33202f(_0x40c0e1);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index fb034b1..0f7152c 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 _0xb5b6=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','create','addSound','delete'];(function(_0x4e2e96,_0x599557){var _0x489325=function(_0x1a6bbb){while(--_0x1a6bbb){_0x4e2e96['push'](_0x4e2e96['shift']());}};_0x489325(++_0x599557);}(_0xb5b6,0x7f));var _0x6b5b=function(_0x518ecc,_0x58cd4e){_0x518ecc=_0x518ecc-0x0;var _0x4deddd=_0xb5b6[_0x518ecc];return _0x4deddd;};'use strict';var multer=require(_0x6b5b('0x0'));var util=require(_0x6b5b('0x1'));var path=require(_0x6b5b('0x2'));var timeout=require(_0x6b5b('0x3'));var express=require(_0x6b5b('0x4'));var router=express[_0x6b5b('0x5')]();var fs_extra=require(_0x6b5b('0x6'));var auth=require(_0x6b5b('0x7'));var interaction=require(_0x6b5b('0x8'));var config=require(_0x6b5b('0x9'));var controller=require(_0x6b5b('0xa'));router[_0x6b5b('0xb')]('/',auth[_0x6b5b('0xc')](),controller[_0x6b5b('0xd')]);router[_0x6b5b('0xb')](_0x6b5b('0xe'),auth[_0x6b5b('0xc')](),controller[_0x6b5b('0xf')]);router['get'](_0x6b5b('0x10'),auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth['isAuthenticated'](),controller[_0x6b5b('0x11')]);router['post'](_0x6b5b('0x10'),auth[_0x6b5b('0xc')](),controller[_0x6b5b('0x12')]);router['put'](_0x6b5b('0xe'),auth[_0x6b5b('0xc')](),controller['update']);router[_0x6b5b('0x13')](_0x6b5b('0xe'),auth[_0x6b5b('0xc')](),controller[_0x6b5b('0x14')]);router[_0x6b5b('0x13')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0xb470=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x501078,_0x5bb1e9){var _0x18eaac=function(_0x496e1c){while(--_0x496e1c){_0x501078['push'](_0x501078['shift']());}};_0x18eaac(++_0x5bb1e9);}(_0xb470,0x10e));var _0x0b47=function(_0x46ad89,_0x20ff89){_0x46ad89=_0x46ad89-0x0;var _0x5a063e=_0xb470[_0x46ad89];return _0x5a063e;};'use strict';var multer=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var path=require(_0x0b47('0x2'));var timeout=require(_0x0b47('0x3'));var express=require('express');var router=express[_0x0b47('0x4')]();var fs_extra=require(_0x0b47('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0b47('0x6'));var config=require(_0x0b47('0x7'));var controller=require(_0x0b47('0x8'));router['get']('/',auth[_0x0b47('0x9')](),controller[_0x0b47('0xa')]);router[_0x0b47('0xb')](_0x0b47('0xc'),auth[_0x0b47('0x9')](),controller['show']);router[_0x0b47('0xb')](_0x0b47('0xd'),auth[_0x0b47('0x9')](),controller[_0x0b47('0xe')]);router[_0x0b47('0xf')]('/',auth[_0x0b47('0x9')](),controller['create']);router[_0x0b47('0xf')](_0x0b47('0xd'),auth[_0x0b47('0x9')](),controller['addSound']);router[_0x0b47('0x10')]('/:id',auth[_0x0b47('0x9')](),controller[_0x0b47('0x11')]);router[_0x0b47('0x12')](_0x0b47('0xc'),auth[_0x0b47('0x9')](),controller[_0x0b47('0x13')]);router[_0x0b47('0x12')](_0x0b47('0x14'),auth['isAuthenticated'](),controller[_0x0b47('0x15')]);module[_0x0b47('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index bc63789..3d5be46 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 _0xdc5a=['quietmp3','mp3','sequelize','STRING','name','custom','files','mp3nb','quietmp3nb'];(function(_0x41273a,_0x5e4ce6){var _0x4e3e6a=function(_0x1218c4){while(--_0x1218c4){_0x41273a['push'](_0x41273a['shift']());}};_0x4e3e6a(++_0x5e4ce6);}(_0xdc5a,0x65));var _0xadc5=function(_0x46bae4,_0x14fea9){_0x46bae4=_0x46bae4-0x0;var _0x3bd896=_0xdc5a[_0x46bae4];return _0x3bd896;};'use strict';var Sequelize=require(_0xadc5('0x0'));module['exports']={'name':{'type':Sequelize[_0xadc5('0x1')],'allowNull':![],'unique':_0xadc5('0x2')},'mode':{'type':Sequelize['ENUM'](_0xadc5('0x3'),_0xadc5('0x4'),_0xadc5('0x5'),_0xadc5('0x6'),_0xadc5('0x7'),_0xadc5('0x8')),'allowNull':!![],'defaultValue':_0xadc5('0x4')},'directory':{'type':Sequelize[_0xadc5('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xadc5('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xadc5('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xde7d=['quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files'];(function(_0x1edaea,_0x51abf8){var _0x3be6e6=function(_0x435e4f){while(--_0x435e4f){_0x1edaea['push'](_0x1edaea['shift']());}};_0x3be6e6(++_0x51abf8);}(_0xde7d,0xc0));var _0xdde7=function(_0x206af2,_0x4ab841){_0x206af2=_0x206af2-0x0;var _0x4c88f5=_0xde7d[_0x206af2];return _0x4c88f5;};'use strict';var Sequelize=require(_0xdde7('0x0'));module['exports']={'name':{'type':Sequelize[_0xdde7('0x1')],'allowNull':![],'unique':_0xdde7('0x2')},'mode':{'type':Sequelize[_0xdde7('0x3')](_0xdde7('0x4'),_0xdde7('0x5'),'mp3nb','quietmp3nb',_0xdde7('0x6'),_0xdde7('0x7')),'allowNull':!![],'defaultValue':_0xdde7('0x5')},'directory':{'type':Sequelize[_0xdde7('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xdde7('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdde7('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xdde7('0x9')},'defaultEntry':{'type':Sequelize[_0xdde7('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 b9a90e2..f0b7f72 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 _0x9895=['offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','findAll','catch','params','keys','includeAll','include','find','body','create','sequelize','transaction','mode','files','directory','root','0777','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','join','Sequelize','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','basename','extname','server/files/moh','format','symlinkSync','removeSound','id2','%s.%s','message','getSounds','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','end'];(function(_0x374d3c,_0x450b8b){var _0x1e38a2=function(_0xa8520e){while(--_0xa8520e){_0x374d3c['push'](_0x374d3c['shift']());}};_0x1e38a2(++_0x450b8b);}(_0x9895,0xbb));var _0x5989=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9895[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x5989('0x0'));var rimraf=require(_0x5989('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5989('0x2'));var moment=require('moment');var BPromise=require(_0x5989('0x3'));var Mustache=require(_0x5989('0x4'));var util=require(_0x5989('0x5'));var path=require(_0x5989('0x6'));var sox=require(_0x5989('0x7'));var csv=require(_0x5989('0x8'));var ejs=require(_0x5989('0x9'));var fs=require('fs');var fs_extra=require(_0x5989('0xa'));var _=require(_0x5989('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5989('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5989('0xd'));var Redis=require(_0x5989('0xe'));var authService=require(_0x5989('0xf'));var qs=require(_0x5989('0x10'));var as=require(_0x5989('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5989('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5989('0x13'));var db=require(_0x5989('0x14'))['db'];function respondWithStatusCode(_0x204a02,_0x474f48){_0x474f48=_0x474f48||0xcc;return function(_0x9d2c96){if(_0x9d2c96){return _0x204a02['sendStatus'](_0x474f48);}return _0x204a02[_0x5989('0x15')](_0x474f48)[_0x5989('0x16')]();};}function respondWithResult(_0x23000a,_0x27b1eb){_0x27b1eb=_0x27b1eb||0xc8;return function(_0x4edbc8){if(_0x4edbc8){return _0x23000a[_0x5989('0x15')](_0x27b1eb)['json'](_0x4edbc8);}};}function respondWithFilteredResult(_0x398bfa,_0x4a8078){return function(_0x4b2e7e){if(_0x4b2e7e){var _0x5753a7=typeof _0x4a8078[_0x5989('0x17')]===_0x5989('0x18')&&typeof _0x4a8078['limit']===_0x5989('0x18');var _0x461896=_0x4b2e7e[_0x5989('0x19')];var _0x4327aa=_0x5753a7?0x0:_0x4a8078[_0x5989('0x17')];var _0x36a5a8=_0x5753a7?_0x4b2e7e['count']:_0x4a8078['offset']+_0x4a8078[_0x5989('0x1a')];var _0x489fb8;if(_0x36a5a8>=_0x461896){_0x36a5a8=_0x461896;_0x489fb8=0xc8;}else{_0x489fb8=0xce;}_0x398bfa['status'](_0x489fb8);return _0x398bfa['set'](_0x5989('0x1b'),_0x4327aa+'-'+_0x36a5a8+'/'+_0x461896)[_0x5989('0x1c')](_0x4b2e7e);}return null;};}function patchUpdates(_0x4bb240){return function(_0x4be207){try{jsonpatch[_0x5989('0x1d')](_0x4be207,_0x4bb240,!![]);}catch(_0x401f44){return BPromise[_0x5989('0x1e')](_0x401f44);}return _0x4be207[_0x5989('0x1f')]();};}function saveUpdates(_0x1ee329,_0x1781a3){return function(_0x2b2727){if(_0x2b2727){return _0x2b2727[_0x5989('0x20')](_0x1ee329)[_0x5989('0x21')](function(_0x42cbd4){return _0x42cbd4;});}return null;};}function removeEntity(_0x45a8e2,_0x30c141){return function(_0x19d794){if(_0x19d794){return _0x19d794['destroy']()[_0x5989('0x21')](function(){var _0x3839a0=_0x19d794[_0x5989('0x22')]({'plain':!![]});var _0x2995d7=_0x5989('0x23');return db[_0x5989('0x24')][_0x5989('0x25')]({'where':{'type':_0x2995d7,'resourceId':_0x3839a0['id']}})[_0x5989('0x21')](function(){return _0x19d794;});})['then'](function(){_0x45a8e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x474a98,_0x19416b){return function(_0x36dcf9){if(!_0x36dcf9){_0x474a98[_0x5989('0x26')](0x194);}return _0x36dcf9;};}function handleError(_0x3e877b,_0x1a0fe7){_0x1a0fe7=_0x1a0fe7||0x1f4;return function(_0x4335c6){logger[_0x5989('0x27')](_0x4335c6[_0x5989('0x28')]);if(_0x4335c6[_0x5989('0x29')]){delete _0x4335c6['name'];}_0x3e877b[_0x5989('0x15')](_0x1a0fe7)[_0x5989('0x2a')](_0x4335c6);};}exports[_0x5989('0x2b')]=function(_0x52586a,_0x32c1b7){var _0x458da3={},_0x58d0b0={},_0x4349d9={'count':0x0,'rows':[]};var _0x3d95d2=_[_0x5989('0x2c')](db[_0x5989('0x2d')][_0x5989('0x2e')],function(_0x20fae0){return{'name':_0x20fae0['fieldName'],'type':_0x20fae0[_0x5989('0x2f')][_0x5989('0x30')]};});_0x58d0b0[_0x5989('0x31')]=_[_0x5989('0x2c')](_0x3d95d2,_0x5989('0x29'));_0x58d0b0['query']=_['keys'](_0x52586a[_0x5989('0x32')]);_0x58d0b0['filters']=_['intersection'](_0x58d0b0['model'],_0x58d0b0[_0x5989('0x32')]);_0x458da3[_0x5989('0x33')]=_[_0x5989('0x34')](_0x58d0b0['model'],qs[_0x5989('0x35')](_0x52586a['query'][_0x5989('0x35')]));_0x458da3[_0x5989('0x33')]=_0x458da3[_0x5989('0x33')][_0x5989('0x36')]?_0x458da3['attributes']:_0x58d0b0['model'];if(!_0x52586a['query'][_0x5989('0x37')](_0x5989('0x38'))){_0x458da3[_0x5989('0x1a')]=qs[_0x5989('0x1a')](_0x52586a['query'][_0x5989('0x1a')]);_0x458da3[_0x5989('0x17')]=qs[_0x5989('0x17')](_0x52586a[_0x5989('0x32')][_0x5989('0x17')]);}_0x458da3['order']=qs[_0x5989('0x39')](_0x52586a[_0x5989('0x32')]['sort']);delete _0x52586a[_0x5989('0x32')][_0x5989('0x39')];_0x458da3[_0x5989('0x3a')]=qs[_0x5989('0x3b')](_[_0x5989('0x3c')](_0x52586a[_0x5989('0x32')],_0x58d0b0['filters']),_0x3d95d2);if(_0x52586a[_0x5989('0x32')][_0x5989('0x3d')]){_0x458da3[_0x5989('0x3a')]=_[_0x5989('0x3e')](_0x458da3[_0x5989('0x3a')],{'$or':_[_0x5989('0x2c')](_0x3d95d2,function(_0x1c2533){if(_0x1c2533[_0x5989('0x2f')]!=='VIRTUAL'){var _0x566f91={};_0x566f91[_0x1c2533[_0x5989('0x29')]]={'$like':'%'+_0x52586a[_0x5989('0x32')][_0x5989('0x3d')]+'%'};return _0x566f91;}})});}_0x458da3=_[_0x5989('0x3e')]({},_0x458da3,_0x52586a[_0x5989('0x3f')]);var _0x45442b={'where':_0x458da3[_0x5989('0x3a')]};return db['VoiceMusicOnHold'][_0x5989('0x19')](_0x45442b)['then'](function(_0x46f8a1){_0x4349d9[_0x5989('0x19')]=_0x46f8a1;if(_0x52586a[_0x5989('0x32')]['includeAll']){_0x458da3['include']=[{'all':!![]}];}return db[_0x5989('0x2d')][_0x5989('0x40')](_0x458da3);})[_0x5989('0x21')](function(_0x3f0fc6){_0x4349d9['rows']=_0x3f0fc6;return _0x4349d9;})[_0x5989('0x21')](respondWithFilteredResult(_0x32c1b7,_0x458da3))[_0x5989('0x41')](handleError(_0x32c1b7,null));};exports['show']=function(_0x54e717,_0x383259){var _0xb1e687={'raw':![],'where':{'id':_0x54e717[_0x5989('0x42')]['id']}},_0x30d618={};_0x30d618[_0x5989('0x31')]=_[_0x5989('0x43')](db['VoiceMusicOnHold']['rawAttributes']);_0x30d618[_0x5989('0x32')]=_['keys'](_0x54e717['query']);_0x30d618[_0x5989('0x3b')]=_['intersection'](_0x30d618[_0x5989('0x31')],_0x30d618[_0x5989('0x32')]);_0xb1e687[_0x5989('0x33')]=_[_0x5989('0x34')](_0x30d618[_0x5989('0x31')],qs['fields'](_0x54e717['query'][_0x5989('0x35')]));_0xb1e687[_0x5989('0x33')]=_0xb1e687[_0x5989('0x33')][_0x5989('0x36')]?_0xb1e687['attributes']:_0x30d618[_0x5989('0x31')];if(_0x54e717['query'][_0x5989('0x44')]){_0xb1e687[_0x5989('0x45')]=[{'all':!![]}];}_0xb1e687=_['merge']({},_0xb1e687,_0x54e717['options']);return db[_0x5989('0x2d')][_0x5989('0x46')](_0xb1e687)[_0x5989('0x21')](handleEntityNotFound(_0x383259,null))['then'](respondWithResult(_0x383259,null))[_0x5989('0x41')](handleError(_0x383259,null));};exports[_0x5989('0x20')]=function(_0x58f5d7,_0x3fdc16){if(_0x58f5d7[_0x5989('0x47')]['id']){delete _0x58f5d7[_0x5989('0x47')]['id'];}return db['VoiceMusicOnHold'][_0x5989('0x46')]({'where':{'id':_0x58f5d7[_0x5989('0x42')]['id']}})[_0x5989('0x21')](handleEntityNotFound(_0x3fdc16,null))[_0x5989('0x21')](saveUpdates(_0x58f5d7[_0x5989('0x47')],null))['then'](respondWithResult(_0x3fdc16,null))[_0x5989('0x41')](handleError(_0x3fdc16,null));};exports[_0x5989('0x48')]=function(_0x2f8632,_0x5e9dbf,_0x43b9b9){return db[_0x5989('0x49')][_0x5989('0x4a')](function(_0x2938a6){if(_0x2f8632[_0x5989('0x47')][_0x5989('0x4b')]===_0x5989('0x4c')){_0x2f8632[_0x5989('0x47')][_0x5989('0x4d')]=path['join'](config[_0x5989('0x4e')],'server/files/moh',_0x2f8632[_0x5989('0x47')][_0x5989('0x29')]);}return db['VoiceMusicOnHold'][_0x5989('0x48')](_0x2f8632[_0x5989('0x47')],{'transaction':_0x2938a6})[_0x5989('0x21')](function(_0x190991){if(_0x2f8632[_0x5989('0x47')][_0x5989('0x4b')]===_0x5989('0x4c')){fs['mkdirSync'](_0x190991[_0x5989('0x4d')],parseInt(_0x5989('0x4f'),0x8));}var _0x2bb790=_0x2f8632[_0x5989('0x50')][_0x5989('0x22')]({'plain':!![]});if(!_0x2bb790)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bb790['role']===_0x5989('0x50')){var _0x492ff1=_0x190991[_0x5989('0x22')]({'plain':!![]});return db[_0x5989('0x51')][_0x5989('0x46')]({'where':{'name':'MusicOnHolds','userProfileId':_0x2bb790[_0x5989('0x52')]},'raw':!![]})['then'](function(_0xef4cf1){if(_0xef4cf1&&_0xef4cf1[_0x5989('0x53')]===0x0){return db[_0x5989('0x24')][_0x5989('0x48')]({'name':_0x492ff1[_0x5989('0x29')],'resourceId':_0x492ff1['id'],'type':_0xef4cf1[_0x5989('0x29')],'sectionId':_0xef4cf1['id']},{})[_0x5989('0x21')](function(){return _0x190991;});}else{return _0x190991;}})[_0x5989('0x41')](function(_0x20883a){logger[_0x5989('0x27')](_0x5989('0x54'),_0x20883a);});}return _0x190991;});})['then'](respondWithResult(_0x5e9dbf,0xc9))[_0x5989('0x41')](handleError(_0x5e9dbf,null));};exports[_0x5989('0x25')]=function(_0x1bd5f9,_0x2d937d,_0x4dd2aa){var _0x1bdb65;return db[_0x5989('0x2d')][_0x5989('0x46')]({'where':{'id':_0x1bd5f9[_0x5989('0x42')]['id']}})['then'](function(_0x24c3fd){if(_0x24c3fd){return db['sequelize'][_0x5989('0x4a')](function(_0x2d5834){return _0x24c3fd[_0x5989('0x25')]({'transaction':_0x2d5834,'raw':!![]})[_0x5989('0x21')](function(_0x38cfdf){if(_0x38cfdf[_0x5989('0x4d')]){fs['readdirSync'](_0x38cfdf['directory'])['forEach'](function(_0x54f3b4){fs[_0x5989('0x55')](path[_0x5989('0x56')](_0x38cfdf[_0x5989('0x4d')],_0x54f3b4));});fs['rmdirSync'](_0x38cfdf[_0x5989('0x4d')]);}return _0x38cfdf;});})[_0x5989('0x41')](function(_0x1518e9){throw new db[(_0x5989('0x57'))]['ValidationError'](_0x1518e9['message']);});}})[_0x5989('0x21')](handleEntityNotFound(_0x2d937d,null))['then'](removeEntity(_0x2d937d,null))['catch'](handleError(_0x2d937d,null));};exports[_0x5989('0x58')]=function(_0x29bec2,_0x1b679f,_0x1bff37){return db[_0x5989('0x49')]['transaction'](function(_0x33bc92){var _0x172bad;return db[_0x5989('0x2d')][_0x5989('0x46')]({'where':{'id':_0x29bec2[_0x5989('0x42')]['id']}})[_0x5989('0x21')](function(_0x41057a){if(_0x41057a){_0x172bad=_0x41057a;return _0x41057a[_0x5989('0x58')](_0x29bec2[_0x5989('0x47')]['id'],{'transaction':_0x33bc92});}})['then'](function(_0x426f76){if(_0x426f76){return db[_0x5989('0x59')][_0x5989('0x5a')]({'where':{'id':_0x29bec2[_0x5989('0x47')]['id']},'attributes':['id',_0x5989('0x29'),_0x5989('0x5b'),_0x5989('0x5c'),_0x5989('0x5d')],'raw':!![]});}})[_0x5989('0x21')](function(_0x3d20ff){if(_0x3d20ff){var _0x94ef56=path[_0x5989('0x56')](config[_0x5989('0x4e')],_0x5989('0x5e'),util['format']('%s.%s',path[_0x5989('0x5f')](_0x3d20ff[_0x5989('0x5b')],path[_0x5989('0x60')](_0x3d20ff['save_name'])),_0x3d20ff['converted_format']));var _0x468b77=path[_0x5989('0x56')](config[_0x5989('0x4e')],_0x5989('0x61'),_0x172bad[_0x5989('0x29')],util[_0x5989('0x62')]('%s.%s',_0x3d20ff['name'],_0x3d20ff['converted_format']));fs[_0x5989('0x63')](_0x94ef56,_0x468b77);return _0x3d20ff;}})[_0x5989('0x41')](function(_0x494d0f){throw new db[(_0x5989('0x57'))]['ValidationError'](_0x494d0f['message']);});})[_0x5989('0x21')](handleEntityNotFound(_0x1b679f,null))[_0x5989('0x21')](respondWithResult(_0x1b679f,0xc9))['catch'](handleError(_0x1b679f,null));};exports[_0x5989('0x64')]=function(_0x10c63a,_0x554c79,_0x28a230){return db[_0x5989('0x49')][_0x5989('0x4a')](function(_0x11abab){var _0x11d3e7;return db[_0x5989('0x2d')][_0x5989('0x5a')]({'where':{'id':_0x10c63a[_0x5989('0x42')]['id']}})['then'](handleEntityNotFound(_0x554c79,null))[_0x5989('0x21')](function(_0x194fc4){if(_0x194fc4){_0x11d3e7=_0x194fc4;return _0x194fc4[_0x5989('0x64')](_0x10c63a[_0x5989('0x42')][_0x5989('0x65')]);}})[_0x5989('0x21')](function(_0x229bd3){if(_0x229bd3){return db[_0x5989('0x59')][_0x5989('0x5a')]({'where':{'id':_0x10c63a[_0x5989('0x42')]['id2']},'attributes':['id',_0x5989('0x29'),_0x5989('0x5b'),_0x5989('0x5c'),'createdAt'],'raw':!![]});}})[_0x5989('0x21')](function(_0x5009e4){if(_0x5009e4){fs[_0x5989('0x55')](path[_0x5989('0x56')](_0x11d3e7[_0x5989('0x4d')],util[_0x5989('0x62')](_0x5989('0x66'),_0x5009e4[_0x5989('0x29')],_0x5009e4['converted_format'])));return _0x5009e4;}})[_0x5989('0x41')](function(_0x18b43e){throw new db[(_0x5989('0x57'))]['ValidationError'](_0x18b43e[_0x5989('0x67')]);});})[_0x5989('0x21')](handleEntityNotFound(_0x554c79,null))['then'](respondWithStatusCode(_0x554c79,0xcc))[_0x5989('0x41')](handleError(_0x554c79,null));};exports[_0x5989('0x68')]=function(_0x26e01d,_0x5b295d,_0x479d26){var _0x222d27={};var _0x2befb5={};var _0x396055;var _0x2a52db;return db[_0x5989('0x2d')][_0x5989('0x5a')]({'where':{'id':_0x26e01d[_0x5989('0x42')]['id']}})[_0x5989('0x21')](handleEntityNotFound(_0x5b295d,null))[_0x5989('0x21')](function(_0x25daf4){if(_0x25daf4){_0x396055=_0x25daf4;_0x2befb5[_0x5989('0x31')]=_[_0x5989('0x43')](db['Sound'][_0x5989('0x2e')]);_0x2befb5['query']=_[_0x5989('0x43')](_0x26e01d[_0x5989('0x32')]);_0x2befb5[_0x5989('0x3b')]=_[_0x5989('0x34')](_0x2befb5[_0x5989('0x31')],_0x2befb5[_0x5989('0x32')]);_0x222d27[_0x5989('0x33')]=_[_0x5989('0x34')](_0x2befb5[_0x5989('0x31')],qs[_0x5989('0x35')](_0x26e01d[_0x5989('0x32')]['fields']));_0x222d27[_0x5989('0x33')]=_0x222d27[_0x5989('0x33')][_0x5989('0x36')]?_0x222d27['attributes']:_0x2befb5[_0x5989('0x31')];_0x222d27['order']=qs[_0x5989('0x39')](_0x26e01d['query']['sort']);_0x222d27[_0x5989('0x3a')]=qs[_0x5989('0x3b')](_[_0x5989('0x3c')](_0x26e01d[_0x5989('0x32')],_0x2befb5[_0x5989('0x3b')]));if(_0x26e01d[_0x5989('0x32')][_0x5989('0x3d')]){_0x222d27[_0x5989('0x3a')]=_['merge'](_0x222d27[_0x5989('0x3a')],{'$or':_[_0x5989('0x2c')](_0x222d27[_0x5989('0x33')],function(_0x159ce9){var _0x2e1576={};_0x2e1576[_0x159ce9]={'$like':'%'+_0x26e01d[_0x5989('0x32')][_0x5989('0x3d')]+'%'};return _0x2e1576;})});}_0x222d27=_[_0x5989('0x3e')]({},_0x222d27,_0x26e01d[_0x5989('0x3f')]);return _0x396055[_0x5989('0x68')](_0x222d27);}})['then'](function(_0x2b8735){if(_0x2b8735){_0x2a52db=_0x2b8735[_0x5989('0x36')];if(!_0x26e01d[_0x5989('0x32')][_0x5989('0x37')](_0x5989('0x38'))){_0x222d27[_0x5989('0x1a')]=qs[_0x5989('0x1a')](_0x26e01d[_0x5989('0x32')][_0x5989('0x1a')]);_0x222d27['offset']=qs['offset'](_0x26e01d[_0x5989('0x32')][_0x5989('0x17')]);}return _0x396055[_0x5989('0x68')](_0x222d27);}})[_0x5989('0x21')](function(_0x140c69){if(_0x140c69){return _0x140c69?{'count':_0x2a52db,'rows':_0x140c69}:null;}})[_0x5989('0x21')](respondWithResult(_0x5b295d,null))[_0x5989('0x41')](handleError(_0x5b295d,null));}; \ No newline at end of file +var _0x0c52=['removeSound','id2','converted_format','%s.%s','getSounds','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','map','VoiceMusicOnHold','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','create','transaction','mode','files','directory','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','sequelize','forEach','unlinkSync','join','rmdirSync','ValidationError','addSound','Sound','findOne','save_name','server/files/sounds/converted','basename','extname','format','symlinkSync','Sequelize','message'];(function(_0x4e6afa,_0x1ca110){var _0x2f6837=function(_0x23cd9a){while(--_0x23cd9a){_0x4e6afa['push'](_0x4e6afa['shift']());}};_0x2f6837(++_0x1ca110);}(_0x0c52,0x74));var _0x20c5=function(_0x3a259e,_0x1b8ca8){_0x3a259e=_0x3a259e-0x0;var _0x2e376b=_0x0c52[_0x3a259e];return _0x2e376b;};'use strict';var emlformat=require(_0x20c5('0x0'));var rimraf=require(_0x20c5('0x1'));var zipdir=require(_0x20c5('0x2'));var jsonpatch=require(_0x20c5('0x3'));var rp=require(_0x20c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x20c5('0x5'));var util=require(_0x20c5('0x6'));var path=require(_0x20c5('0x7'));var sox=require(_0x20c5('0x8'));var csv=require(_0x20c5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20c5('0xa'));var squel=require(_0x20c5('0xb'));var crypto=require(_0x20c5('0xc'));var jsforce=require(_0x20c5('0xd'));var deskjs=require(_0x20c5('0xe'));var toCsv=require(_0x20c5('0x9'));var querystring=require(_0x20c5('0xf'));var Papa=require(_0x20c5('0x10'));var Redis=require(_0x20c5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x20c5('0x12'));var as=require(_0x20c5('0x13'));var hardwareService=require(_0x20c5('0x14'));var logger=require(_0x20c5('0x15'))('api');var utils=require(_0x20c5('0x16'));var config=require(_0x20c5('0x17'));var licenseUtil=require(_0x20c5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a7f1d,_0x2ad082){_0x2ad082=_0x2ad082||0xcc;return function(_0x57420f){if(_0x57420f){return _0x3a7f1d[_0x20c5('0x19')](_0x2ad082);}return _0x3a7f1d[_0x20c5('0x1a')](_0x2ad082)[_0x20c5('0x1b')]();};}function respondWithResult(_0x175be9,_0x79df4a){_0x79df4a=_0x79df4a||0xc8;return function(_0x6b8d9f){if(_0x6b8d9f){return _0x175be9[_0x20c5('0x1a')](_0x79df4a)[_0x20c5('0x1c')](_0x6b8d9f);}};}function respondWithFilteredResult(_0x372a43,_0x17fd7d){return function(_0x3cc62e){if(_0x3cc62e){var _0x36c47b=typeof _0x17fd7d[_0x20c5('0x1d')]===_0x20c5('0x1e')&&typeof _0x17fd7d[_0x20c5('0x1f')]===_0x20c5('0x1e');var _0x482790=_0x3cc62e[_0x20c5('0x20')];var _0x1077e4=_0x36c47b?0x0:_0x17fd7d[_0x20c5('0x1d')];var _0xd2d0b5=_0x36c47b?_0x3cc62e['count']:_0x17fd7d[_0x20c5('0x1d')]+_0x17fd7d[_0x20c5('0x1f')];var _0x47db9a;if(_0xd2d0b5>=_0x482790){_0xd2d0b5=_0x482790;_0x47db9a=0xc8;}else{_0x47db9a=0xce;}_0x372a43[_0x20c5('0x1a')](_0x47db9a);return _0x372a43[_0x20c5('0x21')](_0x20c5('0x22'),_0x1077e4+'-'+_0xd2d0b5+'/'+_0x482790)[_0x20c5('0x1c')](_0x3cc62e);}return null;};}function patchUpdates(_0x5d2256){return function(_0x3ee5f4){try{jsonpatch['apply'](_0x3ee5f4,_0x5d2256,!![]);}catch(_0x2c2437){return BPromise[_0x20c5('0x23')](_0x2c2437);}return _0x3ee5f4[_0x20c5('0x24')]();};}function saveUpdates(_0x3622a4,_0x49255b){return function(_0x52f754){if(_0x52f754){return _0x52f754['update'](_0x3622a4)[_0x20c5('0x25')](function(_0xe417ef){return _0xe417ef;});}return null;};}function removeEntity(_0x5d4f3f,_0x307095){return function(_0x2c4afe){if(_0x2c4afe){return _0x2c4afe['destroy']()[_0x20c5('0x25')](function(){var _0x27d680=_0x2c4afe[_0x20c5('0x26')]({'plain':!![]});var _0xed57e=_0x20c5('0x27');return db[_0x20c5('0x28')][_0x20c5('0x29')]({'where':{'type':_0xed57e,'resourceId':_0x27d680['id']}})['then'](function(){return _0x2c4afe;});})[_0x20c5('0x25')](function(){_0x5d4f3f[_0x20c5('0x1a')](0xcc)[_0x20c5('0x1b')]();});}};}function handleEntityNotFound(_0x46c756,_0x32f15f){return function(_0x17b5b6){if(!_0x17b5b6){_0x46c756[_0x20c5('0x19')](0x194);}return _0x17b5b6;};}function handleError(_0x3ccd49,_0x198219){_0x198219=_0x198219||0x1f4;return function(_0x320596){logger[_0x20c5('0x2a')](_0x320596[_0x20c5('0x2b')]);if(_0x320596['name']){delete _0x320596[_0x20c5('0x2c')];}_0x3ccd49['status'](_0x198219)['send'](_0x320596);};}exports['index']=function(_0x4619e8,_0x38afbe){var _0x2a3436={},_0x518373={},_0x513075={'count':0x0,'rows':[]};var _0x11a096=_[_0x20c5('0x2d')](db[_0x20c5('0x2e')][_0x20c5('0x2f')],function(_0x1e353f){return{'name':_0x1e353f[_0x20c5('0x30')],'type':_0x1e353f['type'][_0x20c5('0x31')]};});_0x518373['model']=_['map'](_0x11a096,_0x20c5('0x2c'));_0x518373[_0x20c5('0x32')]=_[_0x20c5('0x33')](_0x4619e8[_0x20c5('0x32')]);_0x518373[_0x20c5('0x34')]=_[_0x20c5('0x35')](_0x518373['model'],_0x518373[_0x20c5('0x32')]);_0x2a3436[_0x20c5('0x36')]=_['intersection'](_0x518373[_0x20c5('0x37')],qs[_0x20c5('0x38')](_0x4619e8[_0x20c5('0x32')][_0x20c5('0x38')]));_0x2a3436[_0x20c5('0x36')]=_0x2a3436['attributes']['length']?_0x2a3436[_0x20c5('0x36')]:_0x518373[_0x20c5('0x37')];if(!_0x4619e8[_0x20c5('0x32')][_0x20c5('0x39')]('nolimit')){_0x2a3436[_0x20c5('0x1f')]=qs['limit'](_0x4619e8[_0x20c5('0x32')][_0x20c5('0x1f')]);_0x2a3436[_0x20c5('0x1d')]=qs['offset'](_0x4619e8[_0x20c5('0x32')][_0x20c5('0x1d')]);}_0x2a3436['order']=qs['sort'](_0x4619e8['query'][_0x20c5('0x3a')]);delete _0x4619e8[_0x20c5('0x32')][_0x20c5('0x3a')];_0x2a3436[_0x20c5('0x3b')]=qs[_0x20c5('0x34')](_['pick'](_0x4619e8[_0x20c5('0x32')],_0x518373['filters']),_0x11a096);if(_0x4619e8['query'][_0x20c5('0x3c')]){_0x2a3436[_0x20c5('0x3b')]=_[_0x20c5('0x3d')](_0x2a3436[_0x20c5('0x3b')],{'$or':_[_0x20c5('0x2d')](_0x11a096,function(_0xa40da8){if(_0xa40da8['type']!==_0x20c5('0x3e')){var _0x4f83ed={};_0x4f83ed[_0xa40da8['name']]={'$like':'%'+_0x4619e8[_0x20c5('0x32')][_0x20c5('0x3c')]+'%'};return _0x4f83ed;}})});}_0x2a3436=_[_0x20c5('0x3d')]({},_0x2a3436,_0x4619e8[_0x20c5('0x3f')]);var _0x4a0c10={'where':_0x2a3436[_0x20c5('0x3b')]};return db['VoiceMusicOnHold'][_0x20c5('0x20')](_0x4a0c10)[_0x20c5('0x25')](function(_0x3e049a){_0x513075['count']=_0x3e049a;if(_0x4619e8[_0x20c5('0x32')][_0x20c5('0x40')]){_0x2a3436[_0x20c5('0x41')]=[{'all':!![]}];}return db[_0x20c5('0x2e')][_0x20c5('0x42')](_0x2a3436);})[_0x20c5('0x25')](function(_0x22afdf){_0x513075[_0x20c5('0x43')]=_0x22afdf;return _0x513075;})[_0x20c5('0x25')](respondWithFilteredResult(_0x38afbe,_0x2a3436))[_0x20c5('0x44')](handleError(_0x38afbe,null));};exports[_0x20c5('0x45')]=function(_0x452f3a,_0x65330){var _0x18722f={'raw':![],'where':{'id':_0x452f3a[_0x20c5('0x46')]['id']}},_0x422f35={};_0x422f35[_0x20c5('0x37')]=_[_0x20c5('0x33')](db['VoiceMusicOnHold'][_0x20c5('0x2f')]);_0x422f35[_0x20c5('0x32')]=_[_0x20c5('0x33')](_0x452f3a[_0x20c5('0x32')]);_0x422f35[_0x20c5('0x34')]=_['intersection'](_0x422f35['model'],_0x422f35[_0x20c5('0x32')]);_0x18722f['attributes']=_[_0x20c5('0x35')](_0x422f35['model'],qs[_0x20c5('0x38')](_0x452f3a[_0x20c5('0x32')][_0x20c5('0x38')]));_0x18722f['attributes']=_0x18722f['attributes'][_0x20c5('0x47')]?_0x18722f['attributes']:_0x422f35[_0x20c5('0x37')];if(_0x452f3a['query'][_0x20c5('0x40')]){_0x18722f[_0x20c5('0x41')]=[{'all':!![]}];}_0x18722f=_[_0x20c5('0x3d')]({},_0x18722f,_0x452f3a[_0x20c5('0x3f')]);return db['VoiceMusicOnHold'][_0x20c5('0x48')](_0x18722f)['then'](handleEntityNotFound(_0x65330,null))[_0x20c5('0x25')](respondWithResult(_0x65330,null))['catch'](handleError(_0x65330,null));};exports['update']=function(_0x14f1d9,_0x193408){if(_0x14f1d9['body']['id']){delete _0x14f1d9[_0x20c5('0x49')]['id'];}return db[_0x20c5('0x2e')][_0x20c5('0x48')]({'where':{'id':_0x14f1d9[_0x20c5('0x46')]['id']}})['then'](handleEntityNotFound(_0x193408,null))[_0x20c5('0x25')](saveUpdates(_0x14f1d9[_0x20c5('0x49')],null))[_0x20c5('0x25')](respondWithResult(_0x193408,null))[_0x20c5('0x44')](handleError(_0x193408,null));};exports[_0x20c5('0x4a')]=function(_0x48f6b0,_0x1f5b70,_0x59549d){return db['sequelize'][_0x20c5('0x4b')](function(_0x4a9389){if(_0x48f6b0[_0x20c5('0x49')][_0x20c5('0x4c')]===_0x20c5('0x4d')){_0x48f6b0[_0x20c5('0x49')][_0x20c5('0x4e')]=path['join'](config[_0x20c5('0x4f')],_0x20c5('0x50'),_0x48f6b0[_0x20c5('0x49')][_0x20c5('0x2c')]);}return db['VoiceMusicOnHold'][_0x20c5('0x4a')](_0x48f6b0['body'],{'transaction':_0x4a9389})[_0x20c5('0x25')](function(_0x213cdc){if(_0x48f6b0[_0x20c5('0x49')][_0x20c5('0x4c')]==='files'){fs['mkdirSync'](_0x213cdc[_0x20c5('0x4e')],parseInt(_0x20c5('0x51'),0x8));}var _0x3532c1=_0x48f6b0[_0x20c5('0x52')][_0x20c5('0x26')]({'plain':!![]});if(!_0x3532c1)throw new Error(_0x20c5('0x53'));if(_0x3532c1['role']===_0x20c5('0x52')){var _0x4ea8b7=_0x213cdc['get']({'plain':!![]});return db[_0x20c5('0x54')]['find']({'where':{'name':_0x20c5('0x27'),'userProfileId':_0x3532c1['userProfileId']},'raw':!![]})[_0x20c5('0x25')](function(_0x155fbf){if(_0x155fbf&&_0x155fbf['autoAssociation']===0x0){return db[_0x20c5('0x28')][_0x20c5('0x4a')]({'name':_0x4ea8b7[_0x20c5('0x2c')],'resourceId':_0x4ea8b7['id'],'type':_0x155fbf[_0x20c5('0x2c')],'sectionId':_0x155fbf['id']},{})[_0x20c5('0x25')](function(){return _0x213cdc;});}else{return _0x213cdc;}})[_0x20c5('0x44')](function(_0x12153e){logger[_0x20c5('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12153e);});}return _0x213cdc;});})[_0x20c5('0x25')](respondWithResult(_0x1f5b70,0xc9))[_0x20c5('0x44')](handleError(_0x1f5b70,null));};exports[_0x20c5('0x29')]=function(_0x985d08,_0x469f50,_0x5ab2b1){var _0x465077;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x985d08[_0x20c5('0x46')]['id']}})[_0x20c5('0x25')](function(_0x1b5fd4){if(_0x1b5fd4){return db[_0x20c5('0x55')][_0x20c5('0x4b')](function(_0x58f0d4){return _0x1b5fd4[_0x20c5('0x29')]({'transaction':_0x58f0d4,'raw':!![]})[_0x20c5('0x25')](function(_0x182a12){if(_0x182a12['directory']){fs['readdirSync'](_0x182a12['directory'])[_0x20c5('0x56')](function(_0x38eed1){fs[_0x20c5('0x57')](path[_0x20c5('0x58')](_0x182a12[_0x20c5('0x4e')],_0x38eed1));});fs[_0x20c5('0x59')](_0x182a12[_0x20c5('0x4e')]);}return _0x182a12;});})[_0x20c5('0x44')](function(_0x450409){throw new db['Sequelize'][(_0x20c5('0x5a'))](_0x450409['message']);});}})[_0x20c5('0x25')](handleEntityNotFound(_0x469f50,null))['then'](removeEntity(_0x469f50,null))['catch'](handleError(_0x469f50,null));};exports[_0x20c5('0x5b')]=function(_0x5d168b,_0x2576f6,_0x56b9af){return db[_0x20c5('0x55')][_0x20c5('0x4b')](function(_0x4983ec){var _0xb45474;return db['VoiceMusicOnHold'][_0x20c5('0x48')]({'where':{'id':_0x5d168b['params']['id']}})[_0x20c5('0x25')](function(_0xfcc369){if(_0xfcc369){_0xb45474=_0xfcc369;return _0xfcc369['addSound'](_0x5d168b[_0x20c5('0x49')]['id'],{'transaction':_0x4983ec});}})['then'](function(_0x4f4bb3){if(_0x4f4bb3){return db[_0x20c5('0x5c')][_0x20c5('0x5d')]({'where':{'id':_0x5d168b['body']['id']},'attributes':['id',_0x20c5('0x2c'),_0x20c5('0x5e'),'converted_format','createdAt'],'raw':!![]});}})[_0x20c5('0x25')](function(_0x5cdb4c){if(_0x5cdb4c){var _0x3266f7=path['join'](config[_0x20c5('0x4f')],_0x20c5('0x5f'),util['format']('%s.%s',path[_0x20c5('0x60')](_0x5cdb4c['save_name'],path[_0x20c5('0x61')](_0x5cdb4c['save_name'])),_0x5cdb4c['converted_format']));var _0x121822=path[_0x20c5('0x58')](config[_0x20c5('0x4f')],_0x20c5('0x50'),_0xb45474[_0x20c5('0x2c')],util[_0x20c5('0x62')]('%s.%s',_0x5cdb4c[_0x20c5('0x2c')],_0x5cdb4c['converted_format']));fs[_0x20c5('0x63')](_0x3266f7,_0x121822);return _0x5cdb4c;}})[_0x20c5('0x44')](function(_0x14765e){throw new db[(_0x20c5('0x64'))][(_0x20c5('0x5a'))](_0x14765e[_0x20c5('0x65')]);});})['then'](handleEntityNotFound(_0x2576f6,null))[_0x20c5('0x25')](respondWithResult(_0x2576f6,0xc9))[_0x20c5('0x44')](handleError(_0x2576f6,null));};exports['removeSound']=function(_0xfdab4c,_0x244360,_0x16e51b){return db[_0x20c5('0x55')][_0x20c5('0x4b')](function(_0x6925a){var _0x318b67;return db[_0x20c5('0x2e')][_0x20c5('0x5d')]({'where':{'id':_0xfdab4c['params']['id']}})[_0x20c5('0x25')](handleEntityNotFound(_0x244360,null))[_0x20c5('0x25')](function(_0x3e7315){if(_0x3e7315){_0x318b67=_0x3e7315;return _0x3e7315[_0x20c5('0x66')](_0xfdab4c['params'][_0x20c5('0x67')]);}})[_0x20c5('0x25')](function(_0xd23493){if(_0xd23493){return db[_0x20c5('0x5c')][_0x20c5('0x5d')]({'where':{'id':_0xfdab4c['params']['id2']},'attributes':['id','name',_0x20c5('0x5e'),_0x20c5('0x68'),'createdAt'],'raw':!![]});}})[_0x20c5('0x25')](function(_0xd0e380){if(_0xd0e380){fs['unlinkSync'](path[_0x20c5('0x58')](_0x318b67[_0x20c5('0x4e')],util[_0x20c5('0x62')](_0x20c5('0x69'),_0xd0e380[_0x20c5('0x2c')],_0xd0e380['converted_format'])));return _0xd0e380;}})[_0x20c5('0x44')](function(_0x193fb6){throw new db['Sequelize'][(_0x20c5('0x5a'))](_0x193fb6[_0x20c5('0x65')]);});})['then'](handleEntityNotFound(_0x244360,null))[_0x20c5('0x25')](respondWithStatusCode(_0x244360,0xcc))['catch'](handleError(_0x244360,null));};exports[_0x20c5('0x6a')]=function(_0xfe0984,_0x2517a9,_0x222549){var _0x49c3e3={};var _0xfdac5b={};var _0x5dc6a5;var _0x459a1e;return db[_0x20c5('0x2e')][_0x20c5('0x5d')]({'where':{'id':_0xfe0984['params']['id']}})[_0x20c5('0x25')](handleEntityNotFound(_0x2517a9,null))[_0x20c5('0x25')](function(_0x5a5c99){if(_0x5a5c99){_0x5dc6a5=_0x5a5c99;_0xfdac5b['model']=_['keys'](db[_0x20c5('0x5c')][_0x20c5('0x2f')]);_0xfdac5b[_0x20c5('0x32')]=_[_0x20c5('0x33')](_0xfe0984[_0x20c5('0x32')]);_0xfdac5b[_0x20c5('0x34')]=_[_0x20c5('0x35')](_0xfdac5b['model'],_0xfdac5b['query']);_0x49c3e3[_0x20c5('0x36')]=_[_0x20c5('0x35')](_0xfdac5b['model'],qs[_0x20c5('0x38')](_0xfe0984[_0x20c5('0x32')][_0x20c5('0x38')]));_0x49c3e3[_0x20c5('0x36')]=_0x49c3e3['attributes'][_0x20c5('0x47')]?_0x49c3e3[_0x20c5('0x36')]:_0xfdac5b['model'];_0x49c3e3['order']=qs[_0x20c5('0x3a')](_0xfe0984[_0x20c5('0x32')][_0x20c5('0x3a')]);_0x49c3e3[_0x20c5('0x3b')]=qs['filters'](_[_0x20c5('0x6b')](_0xfe0984[_0x20c5('0x32')],_0xfdac5b[_0x20c5('0x34')]));if(_0xfe0984[_0x20c5('0x32')][_0x20c5('0x3c')]){_0x49c3e3[_0x20c5('0x3b')]=_[_0x20c5('0x3d')](_0x49c3e3[_0x20c5('0x3b')],{'$or':_[_0x20c5('0x2d')](_0x49c3e3['attributes'],function(_0x502669){var _0x582d94={};_0x582d94[_0x502669]={'$like':'%'+_0xfe0984['query']['filter']+'%'};return _0x582d94;})});}_0x49c3e3=_[_0x20c5('0x3d')]({},_0x49c3e3,_0xfe0984['options']);return _0x5dc6a5['getSounds'](_0x49c3e3);}})['then'](function(_0x48a647){if(_0x48a647){_0x459a1e=_0x48a647[_0x20c5('0x47')];if(!_0xfe0984[_0x20c5('0x32')][_0x20c5('0x39')](_0x20c5('0x6c'))){_0x49c3e3[_0x20c5('0x1f')]=qs[_0x20c5('0x1f')](_0xfe0984[_0x20c5('0x32')][_0x20c5('0x1f')]);_0x49c3e3[_0x20c5('0x1d')]=qs[_0x20c5('0x1d')](_0xfe0984['query']['offset']);}return _0x5dc6a5[_0x20c5('0x6a')](_0x49c3e3);}})['then'](function(_0x2e8f52){if(_0x2e8f52){return _0x2e8f52?{'count':_0x459a1e,'rows':_0x2e8f52}:null;}})[_0x20c5('0x25')](respondWithResult(_0x2517a9,null))['catch'](handleError(_0x2517a9,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index f3ca18f..beadddf 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 _0x662b=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x662b,0x1e5));var _0xb662=function(_0x7ee6ea,_0x3d574d){_0x7ee6ea=_0x7ee6ea-0x0;var _0x1b27ce=_0x662b[_0x7ee6ea];return _0x1b27ce;};'use strict';var _=require(_0xb662('0x0'));var util=require(_0xb662('0x1'));var logger=require(_0xb662('0x2'))('api');var moment=require(_0xb662('0x3'));var BPromise=require('bluebird');var rp=require(_0xb662('0x4'));var fs=require('fs');var path=require(_0xb662('0x5'));var rimraf=require(_0xb662('0x6'));var config=require(_0xb662('0x7'));var attributes=require(_0xb662('0x8'));module[_0xb662('0x9')]=function(_0x432827,_0x49a88c){return _0x432827[_0xb662('0xa')](_0xb662('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89ba=['define','voice_musiconhold','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x53e26e,_0x4a5f9c){var _0xf87fd2=function(_0x1d5bdb){while(--_0x1d5bdb){_0x53e26e['push'](_0x53e26e['shift']());}};_0xf87fd2(++_0x4a5f9c);}(_0x89ba,0x110));var _0xa89b=function(_0x49213f,_0x3c64e1){_0x49213f=_0x49213f-0x0;var _0x3a9fae=_0x89ba[_0x49213f];return _0x3a9fae;};'use strict';var _=require(_0xa89b('0x0'));var util=require('util');var logger=require(_0xa89b('0x1'))('api');var moment=require(_0xa89b('0x2'));var BPromise=require(_0xa89b('0x3'));var rp=require(_0xa89b('0x4'));var fs=require('fs');var path=require(_0xa89b('0x5'));var rimraf=require('rimraf');var config=require(_0xa89b('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x24ed93,_0x446f56){return _0x24ed93[_0xa89b('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0xa89b('0x8'),'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 aece4ac..d55d309 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x446f50,_0x216273){var _0x11fd64=function(_0x3eb14e){while(--_0x3eb14e){_0x446f50['push'](_0x446f50['shift']());}};_0x11fd64(++_0x216273);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _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(_0x778a34,_0xb4f3d3){var _0x4b956f=function(_0x33410e){while(--_0x33410e){_0x778a34['push'](_0x778a34['shift']());}};_0x4b956f(++_0xb4f3d3);}(_0xedd9,0xfc));var _0x9edd=function(_0x17c5bf,_0x20f3e5){_0x17c5bf=_0x17c5bf-0x0;var _0x1cce18=_0xedd9[_0x17c5bf];return _0x1cce18;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 16df6f8..c737c79 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 _0x23ea=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','show','/:id/users','/:id/teams','getTeams','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x23ea,0xc3));var _0xa23e=function(_0x27bcb2,_0x412da4){_0x27bcb2=_0x27bcb2-0x0;var _0xef0f33=_0x23ea[_0x27bcb2];return _0xef0f33;};'use strict';var multer=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var path=require(_0xa23e('0x2'));var timeout=require(_0xa23e('0x3'));var express=require(_0xa23e('0x4'));var router=express[_0xa23e('0x5')]();var fs_extra=require(_0xa23e('0x6'));var auth=require(_0xa23e('0x7'));var interaction=require(_0xa23e('0x8'));var config=require(_0xa23e('0x9'));var controller=require(_0xa23e('0xa'));router['get']('/',auth[_0xa23e('0xb')](),controller[_0xa23e('0xc')]);router[_0xa23e('0xd')](_0xa23e('0xe'),auth[_0xa23e('0xb')](),controller[_0xa23e('0xf')]);router['get']('/:id',auth[_0xa23e('0xb')](),controller[_0xa23e('0x10')]);router[_0xa23e('0xd')](_0xa23e('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa23e('0xd')](_0xa23e('0x12'),auth['isAuthenticated'](),controller[_0xa23e('0x13')]);router[_0xa23e('0x14')]('/',auth['isAuthenticated'](),controller[_0xa23e('0x15')]);router[_0xa23e('0x14')](_0xa23e('0x11'),auth[_0xa23e('0xb')](),controller['addAgents']);router[_0xa23e('0x14')](_0xa23e('0x12'),auth[_0xa23e('0xb')](),controller['addTeams']);router[_0xa23e('0x16')](_0xa23e('0x17'),auth[_0xa23e('0xb')](),controller[_0xa23e('0x18')]);router[_0xa23e('0x19')](_0xa23e('0x17'),auth['isAuthenticated'](),controller[_0xa23e('0x1a')]);router['delete'](_0xa23e('0x11'),auth[_0xa23e('0xb')](),controller['removeAgents']);router[_0xa23e('0x19')](_0xa23e('0x12'),auth[_0xa23e('0xb')](),controller['removeTeams']);module[_0xa23e('0x1b')]=router; \ No newline at end of file +var _0x8bc3=['/:id/users','getAgents','/:id/teams','post','addTeams','update','delete','destroy','removeTeams','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x137fde,_0x74b497){var _0x4bcf0c=function(_0x288f1d){while(--_0x288f1d){_0x137fde['push'](_0x137fde['shift']());}};_0x4bcf0c(++_0x74b497);}(_0x8bc3,0x82));var _0x38bc=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x8bc3[_0x35b2a1];return _0x6023da;};'use strict';var multer=require(_0x38bc('0x0'));var util=require('util');var path=require(_0x38bc('0x1'));var timeout=require('connect-timeout');var express=require(_0x38bc('0x2'));var router=express[_0x38bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x38bc('0x4'));var interaction=require(_0x38bc('0x5'));var config=require(_0x38bc('0x6'));var controller=require(_0x38bc('0x7'));router['get']('/',auth[_0x38bc('0x8')](),controller[_0x38bc('0x9')]);router[_0x38bc('0xa')](_0x38bc('0xb'),auth[_0x38bc('0x8')](),controller['describe']);router['get'](_0x38bc('0xc'),auth[_0x38bc('0x8')](),controller[_0x38bc('0xd')]);router[_0x38bc('0xa')](_0x38bc('0xe'),auth[_0x38bc('0x8')](),controller[_0x38bc('0xf')]);router[_0x38bc('0xa')](_0x38bc('0x10'),auth[_0x38bc('0x8')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x38bc('0x11')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x38bc('0x10'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x12')]);router['put'](_0x38bc('0xc'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x13')]);router[_0x38bc('0x14')](_0x38bc('0xc'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x15')]);router[_0x38bc('0x14')]('/:id/users',auth[_0x38bc('0x8')](),controller['removeAgents']);router[_0x38bc('0x14')](_0x38bc('0x10'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x16')]);module[_0x38bc('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 886f7fb..e1bb9f6 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 _0xb689=['name','VIRTUAL','system-','getDataValue','exports','STRING'];(function(_0x312fb6,_0x49b5aa){var _0x5536f1=function(_0x3e2848){while(--_0x3e2848){_0x312fb6['push'](_0x312fb6['shift']());}};_0x5536f1(++_0x49b5aa);}(_0xb689,0x1ae));var _0x9b68=function(_0x27aa21,_0x3c66b1){_0x27aa21=_0x27aa21-0x0;var _0x432fc9=_0xb689[_0x27aa21];return _0x432fc9;};'use strict';var Sequelize=require('sequelize');module[_0x9b68('0x0')]={'name':{'type':Sequelize[_0x9b68('0x1')],'allowNull':![],'unique':_0x9b68('0x2')},'prefix':{'type':Sequelize[_0x9b68('0x3')],'get':function(_0x2c1a6c){return _0x9b68('0x4')+this[_0x9b68('0x5')](_0x9b68('0x2'))+'-';}},'description':{'type':Sequelize[_0x9b68('0x1')]},'callerIdAll':{'type':Sequelize[_0x9b68('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1d83=['STRING','name','VIRTUAL','getDataValue','INTEGER','sequelize'];(function(_0x28a5ad,_0x520afa){var _0x176b8a=function(_0x3d71b){while(--_0x3d71b){_0x28a5ad['push'](_0x28a5ad['shift']());}};_0x176b8a(++_0x520afa);}(_0x1d83,0xa1));var _0x31d8=function(_0x255caf,_0x2f893b){_0x255caf=_0x255caf-0x0;var _0x25e862=_0x1d83[_0x255caf];return _0x25e862;};'use strict';var Sequelize=require(_0x31d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x31d8('0x1')],'allowNull':![],'unique':_0x31d8('0x2')},'prefix':{'type':Sequelize[_0x31d8('0x3')],'get':function(_0x1b6367){return'system-'+this[_0x31d8('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x31d8('0x1')]},'callerIdAll':{'type':Sequelize[_0x31d8('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x31d8('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 6284be8..08419b4 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 _0x77e6=['send','index','map','VoicePrefix','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','catch','describe','create','sequelize','transaction','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','description','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','findById','addAgents','body','ids','omit','spread','emit','userVoicePrefix:save','userVoicePrefix:remove','findOne','User','getAgents','hasOwnProperty','getTeams','Team','addTeams','Agents','online','flatMap','TeamVoicePrefix','upsert','each','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x3db470,_0xd63502){var _0x44758a=function(_0x179eb4){while(--_0x179eb4){_0x3db470['push'](_0x3db470['shift']());}};_0x44758a(++_0xd63502);}(_0x77e6,0x1a6));var _0x677e=function(_0x8bf597,_0x53e1ff){_0x8bf597=_0x8bf597-0x0;var _0x30db49=_0x77e6[_0x8bf597];return _0x30db49;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];config[_0x677e('0x1a')]=_[_0x677e('0x1b')](config[_0x677e('0x1a')],{'host':_0x677e('0x1c'),'port':0x18eb});var socket=require(_0x677e('0x1d'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x213a50,_0x1dbe16){_0x1dbe16=_0x1dbe16||0xcc;return function(_0x105c88){if(_0x105c88){return _0x213a50[_0x677e('0x1e')](_0x1dbe16);}return _0x213a50[_0x677e('0x1f')](_0x1dbe16)[_0x677e('0x20')]();};}function respondWithResult(_0x24c9eb,_0xe88242){_0xe88242=_0xe88242||0xc8;return function(_0x251069){if(_0x251069){return _0x24c9eb[_0x677e('0x1f')](_0xe88242)[_0x677e('0x21')](_0x251069);}};}function respondWithFilteredResult(_0xe4d960,_0x49d428){return function(_0x1c5124){if(_0x1c5124){var _0x2ef2bf=typeof _0x49d428[_0x677e('0x22')]===_0x677e('0x23')&&typeof _0x49d428[_0x677e('0x24')]===_0x677e('0x23');var _0x52f65d=_0x1c5124[_0x677e('0x25')];var _0x4bfbb6=_0x2ef2bf?0x0:_0x49d428[_0x677e('0x22')];var _0x267aac=_0x2ef2bf?_0x1c5124[_0x677e('0x25')]:_0x49d428['offset']+_0x49d428[_0x677e('0x24')];var _0x1a6122;if(_0x267aac>=_0x52f65d){_0x267aac=_0x52f65d;_0x1a6122=0xc8;}else{_0x1a6122=0xce;}_0xe4d960[_0x677e('0x1f')](_0x1a6122);return _0xe4d960[_0x677e('0x26')](_0x677e('0x27'),_0x4bfbb6+'-'+_0x267aac+'/'+_0x52f65d)[_0x677e('0x21')](_0x1c5124);}return null;};}function patchUpdates(_0x3a7895){return function(_0x52ee8b){try{jsonpatch['apply'](_0x52ee8b,_0x3a7895,!![]);}catch(_0x52d915){return BPromise[_0x677e('0x28')](_0x52d915);}return _0x52ee8b[_0x677e('0x29')]();};}function saveUpdates(_0x31a1e4,_0x540d0e){return function(_0x424e5d){if(_0x424e5d){return _0x424e5d[_0x677e('0x2a')](_0x31a1e4)[_0x677e('0x2b')](function(_0x42f2b8){return _0x42f2b8;});}return null;};}function removeEntity(_0x2c51d3,_0x3f0646){return function(_0x5e5397){if(_0x5e5397){return _0x5e5397['destroy']()[_0x677e('0x2b')](function(){var _0x184f68=_0x5e5397['get']({'plain':!![]});var _0x51e39d=_0x677e('0x2c');return db[_0x677e('0x2d')][_0x677e('0x2e')]({'where':{'type':_0x51e39d,'resourceId':_0x184f68['id']}})[_0x677e('0x2b')](function(){return _0x5e5397;});})[_0x677e('0x2b')](function(){_0x2c51d3['status'](0xcc)[_0x677e('0x20')]();});}};}function handleEntityNotFound(_0x2a6033,_0xeca8e2){return function(_0x1e2694){if(!_0x1e2694){_0x2a6033[_0x677e('0x1e')](0x194);}return _0x1e2694;};}function handleError(_0x2bd6fb,_0x9179a0){_0x9179a0=_0x9179a0||0x1f4;return function(_0x10eb66){logger[_0x677e('0x2f')](_0x10eb66['stack']);if(_0x10eb66[_0x677e('0x30')]){delete _0x10eb66[_0x677e('0x30')];}_0x2bd6fb[_0x677e('0x1f')](_0x9179a0)[_0x677e('0x31')](_0x10eb66);};}exports[_0x677e('0x32')]=function(_0x16f516,_0x34bb3d){var _0x65331={},_0x3b875f={},_0x1d9756={'count':0x0,'rows':[]};var _0x4d0c01=_[_0x677e('0x33')](db[_0x677e('0x34')][_0x677e('0x35')],function(_0x2570b9){return{'name':_0x2570b9[_0x677e('0x36')],'type':_0x2570b9[_0x677e('0x37')]['key']};});_0x3b875f[_0x677e('0x38')]=_[_0x677e('0x33')](_0x4d0c01,_0x677e('0x30'));_0x3b875f['query']=_[_0x677e('0x39')](_0x16f516[_0x677e('0x3a')]);_0x3b875f[_0x677e('0x3b')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],_0x3b875f['query']);_0x65331[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x16f516['query'][_0x677e('0x3e')]));_0x65331[_0x677e('0x3d')]=_0x65331[_0x677e('0x3d')]['length']?_0x65331['attributes']:_0x3b875f[_0x677e('0x38')];if(!_0x16f516[_0x677e('0x3a')]['hasOwnProperty'](_0x677e('0x3f'))){_0x65331[_0x677e('0x24')]=qs['limit'](_0x16f516['query'][_0x677e('0x24')]);_0x65331[_0x677e('0x22')]=qs['offset'](_0x16f516['query'][_0x677e('0x22')]);}_0x65331[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x16f516['query'][_0x677e('0x41')]);_0x65331[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x16f516[_0x677e('0x3a')],_0x3b875f['filters']),_0x4d0c01);if(_0x16f516['query'][_0x677e('0x44')]){_0x65331[_0x677e('0x42')]=_[_0x677e('0x45')](_0x65331[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x4d0c01,function(_0x2f8ebb){if(_0x2f8ebb[_0x677e('0x37')]!==_0x677e('0x46')){var _0x78202e={};_0x78202e[_0x2f8ebb[_0x677e('0x30')]]={'$like':'%'+_0x16f516['query']['filter']+'%'};return _0x78202e;}})});}_0x65331=_[_0x677e('0x45')]({},_0x65331,_0x16f516[_0x677e('0x47')]);var _0x5abab2={'where':_0x65331[_0x677e('0x42')]};return db['VoicePrefix'][_0x677e('0x25')](_0x5abab2)[_0x677e('0x2b')](function(_0x283aaa){_0x1d9756[_0x677e('0x25')]=_0x283aaa;if(_0x16f516[_0x677e('0x3a')][_0x677e('0x48')]){_0x65331['include']=[{'all':!![]}];}return db[_0x677e('0x34')][_0x677e('0x49')](_0x65331);})[_0x677e('0x2b')](function(_0x33fce2){_0x1d9756[_0x677e('0x4a')]=_0x33fce2;return _0x1d9756;})[_0x677e('0x2b')](respondWithFilteredResult(_0x34bb3d,_0x65331))['catch'](handleError(_0x34bb3d,null));};exports[_0x677e('0x4b')]=function(_0x5ca3db,_0x3211a9){var _0x2470d0={'raw':![],'where':{'id':_0x5ca3db[_0x677e('0x4c')]['id']}},_0x3609da={};_0x3609da[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x34')][_0x677e('0x35')]);_0x3609da[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x5ca3db['query']);_0x3609da[_0x677e('0x3b')]=_['intersection'](_0x3609da['model'],_0x3609da[_0x677e('0x3a')]);_0x2470d0[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3609da[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x5ca3db['query'][_0x677e('0x3e')]));_0x2470d0[_0x677e('0x3d')]=_0x2470d0[_0x677e('0x3d')][_0x677e('0x4d')]?_0x2470d0[_0x677e('0x3d')]:_0x3609da['model'];if(_0x5ca3db[_0x677e('0x3a')][_0x677e('0x48')]){_0x2470d0[_0x677e('0x4e')]=[{'all':!![]}];}_0x2470d0=_['merge']({},_0x2470d0,_0x5ca3db[_0x677e('0x47')]);return db['VoicePrefix'][_0x677e('0x4f')](_0x2470d0)['then'](handleEntityNotFound(_0x3211a9,null))['then'](respondWithResult(_0x3211a9,null))[_0x677e('0x50')](handleError(_0x3211a9,null));};exports[_0x677e('0x2e')]=function(_0x1f767f,_0x3ff832){return db['VoicePrefix'][_0x677e('0x4f')]({'where':{'id':_0x1f767f[_0x677e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ff832,null))[_0x677e('0x2b')](removeEntity(_0x3ff832,null))[_0x677e('0x50')](handleError(_0x3ff832,null));};exports[_0x677e('0x51')]=function(_0x23d4fd,_0x2a362e){return db['VoicePrefix'][_0x677e('0x51')]()['then'](respondWithResult(_0x2a362e,null))['catch'](handleError(_0x2a362e,null));};exports[_0x677e('0x52')]=function(_0x4d826f,_0x1af05b){var _0x2f06e0;return db[_0x677e('0x53')][_0x677e('0x54')](function(_0x410012){return db[_0x677e('0x34')][_0x677e('0x52')](_0x4d826f['body'],{'transaction':_0x410012})['then'](function(_0x56a626){_0x2f06e0=_0x56a626[_0x677e('0x55')]({'plain':!![]});return db[_0x677e('0x56')][_0x677e('0x4f')]({'where':{'id':_0x2f06e0[_0x677e('0x57')]},'raw':!![]})[_0x677e('0x2b')](function(_0x1e59a7){return createVoicePrefixExtensions(_0x2f06e0,_0x1e59a7,_0x410012);});});})['then'](function(){var _0x118fb3=_0x4d826f[_0x677e('0x58')]['get']({'plain':!![]});if(!_0x118fb3)throw new Error(_0x677e('0x59'));if(_0x118fb3['role']===_0x677e('0x58')){var _0x20ae18=_0x2f06e0;return db[_0x677e('0x5a')][_0x677e('0x4f')]({'where':{'name':'VoicePrefixes','userProfileId':_0x118fb3[_0x677e('0x5b')]},'raw':!![]})['then'](function(_0x2cb161){if(_0x2cb161&&_0x2cb161[_0x677e('0x5c')]===0x0){return db[_0x677e('0x2d')][_0x677e('0x52')]({'name':_0x20ae18[_0x677e('0x30')],'resourceId':_0x20ae18['id'],'type':_0x2cb161['name'],'sectionId':_0x2cb161['id']},{})[_0x677e('0x2b')](function(){return _0x2f06e0;});}else{return _0x2f06e0;}})[_0x677e('0x50')](function(_0x3c1e10){logger['error'](_0x677e('0x5d'),_0x3c1e10);throw _0x3c1e10;});}return _0x2f06e0;})[_0x677e('0x2b')](respondWithResult(_0x1af05b,null))[_0x677e('0x50')](handleError(_0x1af05b,null));};function Extension(_0x15fd83,_0x35c3b7,_0x44988b,_0x52cd04){this[_0x677e('0x5e')]='from-sip';this['exten']=_0x15fd83;this[_0x677e('0x5f')]=_0x44988b;this['type']='system';this[_0x677e('0x60')]='Voice\x20Prefix\x20Extension';this[_0x677e('0x61')]=_0x35c3b7;this[_0x677e('0x62')]=_0x52cd04;}function createVoicePrefixExtensions(_0x585c4d,_0x3a1555,_0x100be4){return new BPromise(function(_0x379b92,_0x1f11c1){var _0x26479f=new Extension(formatPrefixName(_0x585c4d[_0x677e('0x63')]),0x1,'NoOp',_0x677e('0x64'));_0x26479f[_0x677e('0x65')]=_0x585c4d['id'];return db[_0x677e('0x56')]['create'](_0x26479f,{'transaction':_0x100be4})[_0x677e('0x2b')](function(_0x1da51f){var _0x32cc95=_0x1da51f[_0x677e('0x55')]({'plain':!![]});var _0x2298c8=_[_0x677e('0x33')](addVoicePrefixExtensions(_0x585c4d,_0x3a1555),function(_0x1bc37f){_0x1bc37f[_0x677e('0x57')]=_0x32cc95['id'];_0x1bc37f['VoicePrefixId']=_0x585c4d['id'];return _0x1bc37f;});return db[_0x677e('0x56')][_0x677e('0x66')](_0x2298c8,{'transaction':_0x100be4})[_0x677e('0x2b')](function(_0x2fa495){if(!_0x2fa495){return _0x1f11c1(_0x677e('0x67'));}else{return _0x379b92(_0x2fa495);}})['catch'](function(_0x6ee13d){return _0x1f11c1(_0x6ee13d);});});;});};function addVoicePrefixExtensions(_0x20e595,_0x3e84ba){var _0x16b622=[];var _0x5b5d34=formatPrefixName(_0x20e595[_0x677e('0x63')]);_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x2,_0x677e('0x69'),_0x677e('0x6a')+_0x20e595[_0x677e('0x30')]));if(_0x20e595[_0x677e('0x6b')]){_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x3,_0x677e('0x69'),_0x677e('0x6c')+_0x20e595[_0x677e('0x6b')]));}else{_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x3,'NoOp','No\x20callerid\x20available'));}_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x4,_0x677e('0x6d'),_0x3e84ba[_0x677e('0x5e')]+','+_0x677e('0x6e')+(0x8+_0x20e595[_0x677e('0x30')][_0x677e('0x4d')])+'}'+','+0x1));return _0x16b622;}function formatPrefixName(_0x522f82){var _0x10cdb6='_';for(var _0x1a3b1c=0x0;_0x1a3b1c<_0x522f82[_0x677e('0x4d')];_0x1a3b1c++){if(_0x522f82[_0x677e('0x6f')](_0x1a3b1c)=='-'){_0x10cdb6+=_0x522f82[_0x677e('0x6f')](_0x1a3b1c);}else{_0x10cdb6+='['+_0x522f82[_0x677e('0x6f')](_0x1a3b1c)+']';}}_0x10cdb6+='.';return _0x10cdb6;}exports['update']=function(_0x2230b0,_0x5390ee,_0x4b7dca){var _0x36aa6b=_0x2230b0['body'];_0x36aa6b[_0x677e('0x63')]='system-'+_0x36aa6b['name']+'-';return db[_0x677e('0x53')]['transaction'](function(_0x8f3069){return db[_0x677e('0x34')]['update'](_0x36aa6b,{'where':{'id':_0x36aa6b['id']},'transaction':_0x8f3069})[_0x677e('0x2b')](function(){return db[_0x677e('0x56')][_0x677e('0x2e')]({'where':{'VoicePrefixId':_0x36aa6b['id']},'transaction':_0x8f3069})[_0x677e('0x2b')](function(){return db[_0x677e('0x56')][_0x677e('0x4f')]({'where':{'id':_0x36aa6b['VoiceExtensionId']},'raw':!![]})[_0x677e('0x2b')](function(_0x56f918){return createVoicePrefixExtensions(_0x36aa6b,_0x56f918,_0x8f3069);});});});})[_0x677e('0x2b')](function(){return db['VoicePrefix'][_0x677e('0x70')](_0x36aa6b['id']);})[_0x677e('0x2b')](respondWithResult(_0x5390ee,null))[_0x677e('0x50')](handleError(_0x5390ee,null));};exports['addAgents']=function(_0x496dcc,_0x5f2a2a,_0x570fc9){return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x496dcc[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x5f2a2a,null))[_0x677e('0x2b')](function(_0x2f9c58){if(_0x2f9c58){return _0x2f9c58[_0x677e('0x71')](_0x496dcc[_0x677e('0x72')][_0x677e('0x73')],_[_0x677e('0x74')](_0x496dcc[_0x677e('0x72')],['ids','id'])||{})[_0x677e('0x75')](function(_0x358ba9){for(var _0x5b07c5=0x0;_0x5b07c5<_0x496dcc[_0x677e('0x72')][_0x677e('0x73')][_0x677e('0x4d')];_0x5b07c5+=0x1){socket[_0x677e('0x76')](_0x677e('0x77'),{'UserId':Number(_0x496dcc[_0x677e('0x72')][_0x677e('0x73')][_0x5b07c5]),'VoicePrefixId':Number(_0x496dcc[_0x677e('0x4c')]['id'])});}return _0x358ba9;});}})[_0x677e('0x2b')](respondWithResult(_0x5f2a2a,null))['catch'](handleError(_0x5f2a2a,null));};exports['removeAgents']=function(_0x3bc3e3,_0xe2d3e6,_0x353656){return db[_0x677e('0x34')]['find']({'where':{'id':_0x3bc3e3[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0xe2d3e6,null))[_0x677e('0x2b')](function(_0x5db841){if(_0x5db841){return _0x5db841['removeAgents'](_0x3bc3e3['query'][_0x677e('0x73')])[_0x677e('0x2b')](function(){if(_['isArray'](_0x3bc3e3[_0x677e('0x3a')][_0x677e('0x73')])){for(var _0x164211=0x0;_0x164211<_0x3bc3e3[_0x677e('0x3a')]['ids']['length'];_0x164211+=0x1){socket[_0x677e('0x76')](_0x677e('0x78'),{'UserId':Number(_0x3bc3e3[_0x677e('0x3a')][_0x677e('0x73')][_0x164211]),'VoicePrefixId':Number(_0x3bc3e3['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3bc3e3[_0x677e('0x3a')][_0x677e('0x73')]),'VoicePrefixId':Number(_0x3bc3e3['params']['id'])});}});}})['then'](respondWithStatusCode(_0xe2d3e6,null))[_0x677e('0x50')](handleError(_0xe2d3e6,null));};exports['getAgents']=function(_0x598aac,_0x3e4d40,_0x42746){var _0x30e13e={};var _0x37617d={};var _0x497df7;var _0x5bc26a;return db['VoicePrefix'][_0x677e('0x79')]({'where':{'id':_0x598aac[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x3e4d40,null))[_0x677e('0x2b')](function(_0x1bfd9e){if(_0x1bfd9e){_0x497df7=_0x1bfd9e;_0x37617d[_0x677e('0x38')]=_['keys'](db[_0x677e('0x7a')]['rawAttributes']);_0x37617d['query']=_[_0x677e('0x39')](_0x598aac[_0x677e('0x3a')]);_0x37617d['filters']=_[_0x677e('0x3c')](_0x37617d[_0x677e('0x38')],_0x37617d[_0x677e('0x3a')]);_0x30e13e['attributes']=_['intersection'](_0x37617d[_0x677e('0x38')],qs['fields'](_0x598aac['query'][_0x677e('0x3e')]));_0x30e13e[_0x677e('0x3d')]=_0x30e13e[_0x677e('0x3d')]['length']?_0x30e13e['attributes']:_0x37617d[_0x677e('0x38')];_0x30e13e[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x598aac['query'][_0x677e('0x41')]);_0x30e13e[_0x677e('0x42')]=qs['filters'](_[_0x677e('0x43')](_0x598aac['query'],_0x37617d[_0x677e('0x3b')]));if(_0x598aac[_0x677e('0x3a')]['filter']){_0x30e13e[_0x677e('0x42')]=_[_0x677e('0x45')](_0x30e13e[_0x677e('0x42')],{'$or':_['map'](_0x30e13e['attributes'],function(_0x519da2){var _0x38acdd={};_0x38acdd[_0x519da2]={'$like':'%'+_0x598aac[_0x677e('0x3a')][_0x677e('0x44')]+'%'};return _0x38acdd;})});}_0x30e13e=_[_0x677e('0x45')]({},_0x30e13e,_0x598aac[_0x677e('0x47')]);return _0x497df7[_0x677e('0x7b')](_0x30e13e);}})[_0x677e('0x2b')](function(_0x24a584){if(_0x24a584){_0x5bc26a=_0x24a584[_0x677e('0x4d')];if(!_0x598aac[_0x677e('0x3a')][_0x677e('0x7c')](_0x677e('0x3f'))){_0x30e13e['limit']=qs[_0x677e('0x24')](_0x598aac['query']['limit']);_0x30e13e['offset']=qs[_0x677e('0x22')](_0x598aac[_0x677e('0x3a')][_0x677e('0x22')]);}return _0x497df7['getAgents'](_0x30e13e);}})[_0x677e('0x2b')](function(_0x410a04){if(_0x410a04){return _0x410a04?{'count':_0x5bc26a,'rows':_0x410a04}:null;}})['then'](respondWithResult(_0x3e4d40,null))['catch'](handleError(_0x3e4d40,null));};exports[_0x677e('0x7d')]=function(_0x59cf17,_0x31701e,_0x4b6280){var _0x1cf5a8={};var _0x2171ec={};var _0x4d24ca;var _0x205591;return db[_0x677e('0x34')][_0x677e('0x79')]({'where':{'id':_0x59cf17[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x31701e,null))[_0x677e('0x2b')](function(_0x5a4f85){if(_0x5a4f85){_0x4d24ca=_0x5a4f85;_0x2171ec[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x7e')]['rawAttributes']);_0x2171ec['query']=_[_0x677e('0x39')](_0x59cf17[_0x677e('0x3a')]);_0x2171ec[_0x677e('0x3b')]=_['intersection'](_0x2171ec[_0x677e('0x38')],_0x2171ec[_0x677e('0x3a')]);_0x1cf5a8[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x2171ec['model'],qs[_0x677e('0x3e')](_0x59cf17[_0x677e('0x3a')][_0x677e('0x3e')]));_0x1cf5a8[_0x677e('0x3d')]=_0x1cf5a8['attributes']['length']?_0x1cf5a8[_0x677e('0x3d')]:_0x2171ec[_0x677e('0x38')];_0x1cf5a8['order']=qs[_0x677e('0x41')](_0x59cf17[_0x677e('0x3a')][_0x677e('0x41')]);_0x1cf5a8[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x59cf17[_0x677e('0x3a')],_0x2171ec[_0x677e('0x3b')]));if(_0x59cf17[_0x677e('0x3a')][_0x677e('0x44')]){_0x1cf5a8['where']=_[_0x677e('0x45')](_0x1cf5a8[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x1cf5a8[_0x677e('0x3d')],function(_0x39ab73){var _0x54ae47={};_0x54ae47[_0x39ab73]={'$like':'%'+_0x59cf17[_0x677e('0x3a')][_0x677e('0x44')]+'%'};return _0x54ae47;})});}_0x1cf5a8=_['merge']({},_0x1cf5a8,_0x59cf17[_0x677e('0x47')]);return _0x4d24ca[_0x677e('0x7d')](_0x1cf5a8);}})[_0x677e('0x2b')](function(_0x3bfa41){if(_0x3bfa41){_0x205591=_0x3bfa41['length'];if(!_0x59cf17[_0x677e('0x3a')][_0x677e('0x7c')]('nolimit')){_0x1cf5a8[_0x677e('0x24')]=qs[_0x677e('0x24')](_0x59cf17[_0x677e('0x3a')][_0x677e('0x24')]);_0x1cf5a8[_0x677e('0x22')]=qs['offset'](_0x59cf17[_0x677e('0x3a')][_0x677e('0x22')]);}return _0x4d24ca[_0x677e('0x7d')](_0x1cf5a8);}})['then'](function(_0x218773){if(_0x218773){return _0x218773?{'count':_0x205591,'rows':_0x218773}:null;}})[_0x677e('0x2b')](respondWithResult(_0x31701e,null))['catch'](handleError(_0x31701e,null));};exports[_0x677e('0x7f')]=function(_0x169ad3,_0x589b95,_0xfc07b9){var _0x244d15=_0x169ad3[_0x677e('0x72')][_0x677e('0x73')];var _0x3ceb0d;return db[_0x677e('0x7e')]['findAll']({'where':{'id':_0x244d15},'attributes':['id'],'include':[{'model':db[_0x677e('0x7a')],'as':_0x677e('0x80'),'attributes':['id','name',_0x677e('0x81'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1438f2){if(_0x1438f2){_0x3ceb0d=_0x1438f2;var _0x2b7e56=_[_0x677e('0x82')](_0x1438f2,function(_0x281857){var _0x524317=_0x281857['get']({'plain':!![]});return _0x524317[_0x677e('0x80')];});return db[_0x677e('0x34')]['find']({'where':{'id':_0x169ad3[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](function(_0x7c18c1){return db[_0x677e('0x53')]['transaction'](function(_0x286217){return _0x7c18c1['addTeams'](_0x244d15,{'transaction':_0x286217})[_0x677e('0x2b')](function(){return BPromise['each'](_0x3ceb0d,function(_0x5309c1){return db[_0x677e('0x83')][_0x677e('0x84')]({'TeamId':_0x5309c1['id'],'VoicePrefixId':_0x169ad3[_0x677e('0x4c')]['id']},{'transaction':_0x286217});});})[_0x677e('0x2b')](function(){return BPromise[_0x677e('0x85')](_0x2b7e56,function(_0x15b416){return db[_0x677e('0x86')][_0x677e('0x87')]({'where':{'UserId':_0x15b416['id'],'VoicePrefixId':_0x169ad3[_0x677e('0x4c')]['id']},'transaction':_0x286217});});})['then'](function(){_0x2b7e56[_0x677e('0x88')](function(_0x36680e){socket['emit'](_0x677e('0x77'),{'UserId':_0x36680e['id'],'VoicePrefixId':_0x7c18c1['id']});});});});});}})['then'](respondWithStatusCode(_0x589b95,null))[_0x677e('0x50')](handleError(_0x589b95,null));};exports[_0x677e('0x89')]=function(_0x3ac7bb,_0x4f149a,_0x9d34f1){return db[_0x677e('0x7e')][_0x677e('0x49')]({'where':{'id':_0x3ac7bb[_0x677e('0x3a')][_0x677e('0x73')]},'attributes':['id'],'include':[{'model':db[_0x677e('0x7a')],'as':_0x677e('0x80'),'attributes':['id'],'raw':!![]}]})[_0x677e('0x2b')](handleEntityNotFound(_0x4f149a,null))[_0x677e('0x2b')](function(_0x12c7f7){var _0x249f0c=_[_0x677e('0x33')](_0x12c7f7,'id');var _0x3d55e7=[];var _0x2b451e=[];var _0x477428=squel[_0x677e('0x8a')]();_0x477428[_0x677e('0x8b')](_0x677e('0x8c'))['from'](_0x677e('0x8d'),'tq')[_0x677e('0x8e')](_0x677e('0x8f'),'ut',_0x677e('0x90'))['where']('VoicePrefixId\x20=\x20?',_0x3ac7bb[_0x677e('0x4c')]['id']);for(var _0x3f54fc=0x0;_0x3f54fc<_0x12c7f7[_0x677e('0x4d')];_0x3f54fc+=0x1){let _0x23a71a=_0x12c7f7[_0x3f54fc];for(var _0x46997f=0x0;_0x46997f<_0x23a71a[_0x677e('0x80')][_0x677e('0x4d')];_0x46997f+=0x1){let _0x2519e9=_0x23a71a['Agents'][_0x46997f];var _0x57b67f=_0x477428[_0x677e('0x91')]();_0x57b67f[_0x677e('0x42')](_0x677e('0x92'),_0x2519e9['id']);_0x2b451e[_0x677e('0x68')](db[_0x677e('0x53')][_0x677e('0x3a')](_0x57b67f['toString'](),{'type':db[_0x677e('0x53')][_0x677e('0x93')][_0x677e('0x94')]})[_0x677e('0x2b')](function(_0x8a8748){if(_0x8a8748[_0x677e('0x4d')]===0x1){return _0x2519e9['id'];}else{var _0x248ddd=_['every'](_['map'](_0x8a8748,_0x677e('0x95')),function(_0x405048){return _[_0x677e('0x96')](_0x249f0c,_0x405048);});if(_0x248ddd){return _0x2519e9['id'];}}}));}}return BPromise[_0x677e('0x97')](_0x2b451e)[_0x677e('0x2b')](function(_0x4284d3){_0x3d55e7=_(_0x3d55e7)[_0x677e('0x98')](_0x4284d3)[_0x677e('0x99')]()[_0x677e('0x9a')]();return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x3ac7bb['params']['id']}})[_0x677e('0x2b')](function(_0x700834){return db['sequelize'][_0x677e('0x54')](function(_0x8e0c11){return _0x700834[_0x677e('0x89')](_0x3ac7bb['query'][_0x677e('0x73')],{'transaction':_0x8e0c11})[_0x677e('0x2b')](function(){if(!_[_0x677e('0x9b')](_0x3d55e7)){return _0x700834[_0x677e('0x9c')](_0x3d55e7,{'transaction':_0x8e0c11});}})['then'](function(){_0x3d55e7[_0x677e('0x88')](function(_0x50acd9){socket['emit'](_0x677e('0x78'),{'UserId':_0x50acd9,'VoicePrefixId':_0x700834['id']});});});});});});})[_0x677e('0x2b')](respondWithStatusCode(_0x4f149a,null))[_0x677e('0x50')](handleError(_0x4f149a,null));}; \ No newline at end of file +var _0x236c=['User','getAgents','getTeams','Team','pick','addTeams','findAll','Agents','online','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','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','defaults','socket.io-emitter','redis','./voicePrefix.socket','register','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','UserProfileResource','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','destroy','params','describe','create','sequelize','transaction','get','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','context','exten','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x236c,0x155));var _0xc236=function(_0x34a01a,_0x5094cf){_0x34a01a=_0x34a01a-0x0;var _0x40a476=_0x236c[_0x34a01a];return _0x40a476;};'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'];config['redis']=_[_0xc236('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc236('0x19'))(new Redis(config[_0xc236('0x1a')]));require(_0xc236('0x1b'))[_0xc236('0x1c')](socket);function respondWithStatusCode(_0x5052db,_0x13a42b){_0x13a42b=_0x13a42b||0xcc;return function(_0x55b188){if(_0x55b188){return _0x5052db['sendStatus'](_0x13a42b);}return _0x5052db[_0xc236('0x1d')](_0x13a42b)[_0xc236('0x1e')]();};}function respondWithResult(_0x443a46,_0x1aeafc){_0x1aeafc=_0x1aeafc||0xc8;return function(_0x267913){if(_0x267913){return _0x443a46['status'](_0x1aeafc)['json'](_0x267913);}};}function respondWithFilteredResult(_0x57355b,_0x3f5884){return function(_0x76f45){if(_0x76f45){var _0x11ec65=typeof _0x3f5884['offset']===_0xc236('0x1f')&&typeof _0x3f5884['limit']==='undefined';var _0x1eafba=_0x76f45[_0xc236('0x20')];var _0x3a6183=_0x11ec65?0x0:_0x3f5884[_0xc236('0x21')];var _0x2b6d3f=_0x11ec65?_0x76f45[_0xc236('0x20')]:_0x3f5884[_0xc236('0x21')]+_0x3f5884[_0xc236('0x22')];var _0x54ffac;if(_0x2b6d3f>=_0x1eafba){_0x2b6d3f=_0x1eafba;_0x54ffac=0xc8;}else{_0x54ffac=0xce;}_0x57355b[_0xc236('0x1d')](_0x54ffac);return _0x57355b[_0xc236('0x23')]('Content-Range',_0x3a6183+'-'+_0x2b6d3f+'/'+_0x1eafba)[_0xc236('0x24')](_0x76f45);}return null;};}function patchUpdates(_0x34d73a){return function(_0x3bd41b){try{jsonpatch[_0xc236('0x25')](_0x3bd41b,_0x34d73a,!![]);}catch(_0x27afba){return BPromise[_0xc236('0x26')](_0x27afba);}return _0x3bd41b[_0xc236('0x27')]();};}function saveUpdates(_0xf921e6,_0x1d65e2){return function(_0x3b4059){if(_0x3b4059){return _0x3b4059[_0xc236('0x28')](_0xf921e6)['then'](function(_0x308cd6){return _0x308cd6;});}return null;};}function removeEntity(_0x21d78f,_0x356042){return function(_0x9017ec){if(_0x9017ec){return _0x9017ec['destroy']()[_0xc236('0x29')](function(){var _0x5da4b2=_0x9017ec['get']({'plain':!![]});var _0x15ead8='VoicePrefixes';return db[_0xc236('0x2a')]['destroy']({'where':{'type':_0x15ead8,'resourceId':_0x5da4b2['id']}})[_0xc236('0x29')](function(){return _0x9017ec;});})['then'](function(){_0x21d78f[_0xc236('0x1d')](0xcc)[_0xc236('0x1e')]();});}};}function handleEntityNotFound(_0x4f5175,_0x5a61b5){return function(_0x265c8d){if(!_0x265c8d){_0x4f5175[_0xc236('0x2b')](0x194);}return _0x265c8d;};}function handleError(_0x1f4995,_0x6ad83f){_0x6ad83f=_0x6ad83f||0x1f4;return function(_0x5f3891){logger['error'](_0x5f3891[_0xc236('0x2c')]);if(_0x5f3891['name']){delete _0x5f3891[_0xc236('0x2d')];}_0x1f4995['status'](_0x6ad83f)[_0xc236('0x2e')](_0x5f3891);};}exports[_0xc236('0x2f')]=function(_0x57c99e,_0x5a5ec3){var _0x2537f9={},_0x3053a3={},_0xbda858={'count':0x0,'rows':[]};var _0x2f64bd=_[_0xc236('0x30')](db[_0xc236('0x31')][_0xc236('0x32')],function(_0x22a2ca){return{'name':_0x22a2ca[_0xc236('0x33')],'type':_0x22a2ca['type']['key']};});_0x3053a3['model']=_[_0xc236('0x30')](_0x2f64bd,_0xc236('0x2d'));_0x3053a3[_0xc236('0x34')]=_[_0xc236('0x35')](_0x57c99e[_0xc236('0x34')]);_0x3053a3[_0xc236('0x36')]=_[_0xc236('0x37')](_0x3053a3['model'],_0x3053a3[_0xc236('0x34')]);_0x2537f9[_0xc236('0x38')]=_[_0xc236('0x37')](_0x3053a3['model'],qs[_0xc236('0x39')](_0x57c99e[_0xc236('0x34')][_0xc236('0x39')]));_0x2537f9[_0xc236('0x38')]=_0x2537f9['attributes'][_0xc236('0x3a')]?_0x2537f9[_0xc236('0x38')]:_0x3053a3[_0xc236('0x3b')];if(!_0x57c99e[_0xc236('0x34')][_0xc236('0x3c')](_0xc236('0x3d'))){_0x2537f9[_0xc236('0x22')]=qs[_0xc236('0x22')](_0x57c99e[_0xc236('0x34')][_0xc236('0x22')]);_0x2537f9[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x57c99e[_0xc236('0x34')][_0xc236('0x21')]);}_0x2537f9[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x57c99e[_0xc236('0x34')]['sort']);_0x2537f9['where']=qs['filters'](_['pick'](_0x57c99e[_0xc236('0x34')],_0x3053a3['filters']),_0x2f64bd);if(_0x57c99e[_0xc236('0x34')][_0xc236('0x40')]){_0x2537f9[_0xc236('0x41')]=_[_0xc236('0x42')](_0x2537f9[_0xc236('0x41')],{'$or':_[_0xc236('0x30')](_0x2f64bd,function(_0x427de1){if(_0x427de1[_0xc236('0x43')]!==_0xc236('0x44')){var _0x12a270={};_0x12a270[_0x427de1[_0xc236('0x2d')]]={'$like':'%'+_0x57c99e[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x12a270;}})});}_0x2537f9=_[_0xc236('0x42')]({},_0x2537f9,_0x57c99e[_0xc236('0x45')]);var _0x594ffc={'where':_0x2537f9[_0xc236('0x41')]};return db[_0xc236('0x31')]['count'](_0x594ffc)[_0xc236('0x29')](function(_0x5b0bc5){_0xbda858[_0xc236('0x20')]=_0x5b0bc5;if(_0x57c99e['query'][_0xc236('0x46')]){_0x2537f9[_0xc236('0x47')]=[{'all':!![]}];}return db[_0xc236('0x31')]['findAll'](_0x2537f9);})[_0xc236('0x29')](function(_0x429e08){_0xbda858[_0xc236('0x48')]=_0x429e08;return _0xbda858;})['then'](respondWithFilteredResult(_0x5a5ec3,_0x2537f9))[_0xc236('0x49')](handleError(_0x5a5ec3,null));};exports[_0xc236('0x4a')]=function(_0x317431,_0x408312){var _0xc35ef9={'raw':![],'where':{'id':_0x317431['params']['id']}},_0x3235b0={};_0x3235b0[_0xc236('0x3b')]=_['keys'](db[_0xc236('0x31')][_0xc236('0x32')]);_0x3235b0[_0xc236('0x34')]=_[_0xc236('0x35')](_0x317431[_0xc236('0x34')]);_0x3235b0[_0xc236('0x36')]=_[_0xc236('0x37')](_0x3235b0['model'],_0x3235b0[_0xc236('0x34')]);_0xc35ef9['attributes']=_[_0xc236('0x37')](_0x3235b0[_0xc236('0x3b')],qs['fields'](_0x317431[_0xc236('0x34')][_0xc236('0x39')]));_0xc35ef9[_0xc236('0x38')]=_0xc35ef9[_0xc236('0x38')][_0xc236('0x3a')]?_0xc35ef9[_0xc236('0x38')]:_0x3235b0[_0xc236('0x3b')];if(_0x317431['query']['includeAll']){_0xc35ef9[_0xc236('0x47')]=[{'all':!![]}];}_0xc35ef9=_[_0xc236('0x42')]({},_0xc35ef9,_0x317431['options']);return db[_0xc236('0x31')][_0xc236('0x4b')](_0xc35ef9)[_0xc236('0x29')](handleEntityNotFound(_0x408312,null))[_0xc236('0x29')](respondWithResult(_0x408312,null))[_0xc236('0x49')](handleError(_0x408312,null));};exports[_0xc236('0x4c')]=function(_0x300523,_0x14a83d){return db[_0xc236('0x31')]['find']({'where':{'id':_0x300523[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x14a83d,null))[_0xc236('0x29')](removeEntity(_0x14a83d,null))[_0xc236('0x49')](handleError(_0x14a83d,null));};exports[_0xc236('0x4e')]=function(_0x28e6b4,_0x3ea045){return db['VoicePrefix'][_0xc236('0x4e')]()[_0xc236('0x29')](respondWithResult(_0x3ea045,null))[_0xc236('0x49')](handleError(_0x3ea045,null));};exports[_0xc236('0x4f')]=function(_0x4860d8,_0xa34c01){var _0x3e6da6;return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x9d81c8){return db['VoicePrefix'][_0xc236('0x4f')](_0x4860d8['body'],{'transaction':_0x9d81c8})[_0xc236('0x29')](function(_0x93904b){_0x3e6da6=_0x93904b[_0xc236('0x52')]({'plain':!![]});return db[_0xc236('0x53')][_0xc236('0x4b')]({'where':{'id':_0x3e6da6['VoiceExtensionId']},'raw':!![]})['then'](function(_0x3bee67){return createVoicePrefixExtensions(_0x3e6da6,_0x3bee67,_0x9d81c8);});});})[_0xc236('0x29')](function(){var _0x205d09=_0x4860d8[_0xc236('0x54')][_0xc236('0x52')]({'plain':!![]});if(!_0x205d09)throw new Error(_0xc236('0x55'));if(_0x205d09[_0xc236('0x56')]===_0xc236('0x54')){var _0x24af08=_0x3e6da6;return db[_0xc236('0x57')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x205d09[_0xc236('0x58')]},'raw':!![]})[_0xc236('0x29')](function(_0x8e19c6){if(_0x8e19c6&&_0x8e19c6[_0xc236('0x59')]===0x0){return db['UserProfileResource'][_0xc236('0x4f')]({'name':_0x24af08[_0xc236('0x2d')],'resourceId':_0x24af08['id'],'type':_0x8e19c6['name'],'sectionId':_0x8e19c6['id']},{})[_0xc236('0x29')](function(){return _0x3e6da6;});}else{return _0x3e6da6;}})[_0xc236('0x49')](function(_0x445f03){logger[_0xc236('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x445f03);throw _0x445f03;});}return _0x3e6da6;})[_0xc236('0x29')](respondWithResult(_0xa34c01,null))[_0xc236('0x49')](handleError(_0xa34c01,null));};function Extension(_0x35955c,_0x2602f8,_0x41a160,_0x1edbae){this[_0xc236('0x5b')]='from-sip';this[_0xc236('0x5c')]=_0x35955c;this['app']=_0x41a160;this[_0xc236('0x43')]=_0xc236('0x5d');this[_0xc236('0x5e')]=_0xc236('0x5f');this['priority']=_0x2602f8;this[_0xc236('0x60')]=_0x1edbae;}function createVoicePrefixExtensions(_0x3f1a5f,_0x379e99,_0x4ed4fc){return new BPromise(function(_0x175d5d,_0x2bc7f0){var _0x2ecad1=new Extension(formatPrefixName(_0x3f1a5f[_0xc236('0x61')]),0x1,_0xc236('0x62'),_0xc236('0x63'));_0x2ecad1['VoicePrefixId']=_0x3f1a5f['id'];return db['VoiceExtension'][_0xc236('0x4f')](_0x2ecad1,{'transaction':_0x4ed4fc})[_0xc236('0x29')](function(_0x125f9a){var _0x1e9ad8=_0x125f9a[_0xc236('0x52')]({'plain':!![]});var _0x4649a3=_[_0xc236('0x30')](addVoicePrefixExtensions(_0x3f1a5f,_0x379e99),function(_0x553f58){_0x553f58['VoiceExtensionId']=_0x1e9ad8['id'];_0x553f58['VoicePrefixId']=_0x3f1a5f['id'];return _0x553f58;});return db[_0xc236('0x53')][_0xc236('0x64')](_0x4649a3,{'transaction':_0x4ed4fc})[_0xc236('0x29')](function(_0x2d6b00){if(!_0x2d6b00){return _0x2bc7f0('Extensions\x20creation\x20failed');}else{return _0x175d5d(_0x2d6b00);}})['catch'](function(_0x506910){return _0x2bc7f0(_0x506910);});});;});};function addVoicePrefixExtensions(_0x528d3d,_0x145e86){var _0x5df2ba=[];var _0x20a1eb=formatPrefixName(_0x528d3d['prefix']);_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x2,_0xc236('0x66'),_0xc236('0x67')+_0x528d3d[_0xc236('0x2d')]));if(_0x528d3d[_0xc236('0x68')]){_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x3,_0xc236('0x66'),'PREFIX-CALLERIDALL='+_0x528d3d[_0xc236('0x68')]));}else{_0x5df2ba['push'](new Extension(_0x20a1eb,0x3,_0xc236('0x62'),_0xc236('0x69')));}_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x4,_0xc236('0x6a'),_0x145e86[_0xc236('0x5b')]+','+_0xc236('0x6b')+(0x8+_0x528d3d['name'][_0xc236('0x3a')])+'}'+','+0x1));return _0x5df2ba;}function formatPrefixName(_0x94f65d){var _0x4bb0c6='_';for(var _0x2fb86f=0x0;_0x2fb86f<_0x94f65d[_0xc236('0x3a')];_0x2fb86f++){if(_0x94f65d[_0xc236('0x6c')](_0x2fb86f)=='-'){_0x4bb0c6+=_0x94f65d['charAt'](_0x2fb86f);}else{_0x4bb0c6+='['+_0x94f65d[_0xc236('0x6c')](_0x2fb86f)+']';}}_0x4bb0c6+='.';return _0x4bb0c6;}exports[_0xc236('0x28')]=function(_0x5897a1,_0x2c8f89,_0x340f7c){var _0x1c07d7=_0x5897a1[_0xc236('0x6d')];_0x1c07d7[_0xc236('0x61')]=_0xc236('0x6e')+_0x1c07d7[_0xc236('0x2d')]+'-';return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x5d627d){return db[_0xc236('0x31')][_0xc236('0x28')](_0x1c07d7,{'where':{'id':_0x1c07d7['id']},'transaction':_0x5d627d})[_0xc236('0x29')](function(){return db['VoiceExtension'][_0xc236('0x4c')]({'where':{'VoicePrefixId':_0x1c07d7['id']},'transaction':_0x5d627d})[_0xc236('0x29')](function(){return db[_0xc236('0x53')][_0xc236('0x4b')]({'where':{'id':_0x1c07d7['VoiceExtensionId']},'raw':!![]})[_0xc236('0x29')](function(_0x4a433e){return createVoicePrefixExtensions(_0x1c07d7,_0x4a433e,_0x5d627d);});});});})[_0xc236('0x29')](function(){return db['VoicePrefix'][_0xc236('0x6f')](_0x1c07d7['id']);})[_0xc236('0x29')](respondWithResult(_0x2c8f89,null))['catch'](handleError(_0x2c8f89,null));};exports['addAgents']=function(_0x4ec6d1,_0x930527,_0x4e9624){return db[_0xc236('0x31')][_0xc236('0x4b')]({'where':{'id':_0x4ec6d1['params']['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x930527,null))[_0xc236('0x29')](function(_0x4d7e8d){if(_0x4d7e8d){return _0x4d7e8d[_0xc236('0x70')](_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')],_[_0xc236('0x72')](_0x4ec6d1['body'],[_0xc236('0x71'),'id'])||{})[_0xc236('0x73')](function(_0x14cbad){for(var _0x1a27c9=0x0;_0x1a27c9<_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')][_0xc236('0x3a')];_0x1a27c9+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')][_0x1a27c9]),'VoicePrefixId':Number(_0x4ec6d1[_0xc236('0x4d')]['id'])});}return _0x14cbad;});}})[_0xc236('0x29')](respondWithResult(_0x930527,null))[_0xc236('0x49')](handleError(_0x930527,null));};exports[_0xc236('0x74')]=function(_0x8967c,_0x1c6923,_0x4df1a5){return db['VoicePrefix'][_0xc236('0x4b')]({'where':{'id':_0x8967c['params']['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x1c6923,null))[_0xc236('0x29')](function(_0x25d982){if(_0x25d982){return _0x25d982['removeAgents'](_0x8967c[_0xc236('0x34')]['ids'])[_0xc236('0x29')](function(){if(_[_0xc236('0x75')](_0x8967c[_0xc236('0x34')][_0xc236('0x71')])){for(var _0x48cf03=0x0;_0x48cf03<_0x8967c[_0xc236('0x34')][_0xc236('0x71')]['length'];_0x48cf03+=0x1){socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':Number(_0x8967c[_0xc236('0x34')][_0xc236('0x71')][_0x48cf03]),'VoicePrefixId':Number(_0x8967c[_0xc236('0x4d')]['id'])});}}else{socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':Number(_0x8967c['query'][_0xc236('0x71')]),'VoicePrefixId':Number(_0x8967c[_0xc236('0x4d')]['id'])});}});}})[_0xc236('0x29')](respondWithStatusCode(_0x1c6923,null))[_0xc236('0x49')](handleError(_0x1c6923,null));};exports['getAgents']=function(_0x3646c6,_0x1ee8d0,_0x50d1c6){var _0x40fd6d={};var _0x593b62={};var _0x25f91e;var _0xfc94e8;return db['VoicePrefix'][_0xc236('0x78')]({'where':{'id':_0x3646c6[_0xc236('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ee8d0,null))['then'](function(_0x2a9308){if(_0x2a9308){_0x25f91e=_0x2a9308;_0x593b62[_0xc236('0x3b')]=_[_0xc236('0x35')](db[_0xc236('0x79')][_0xc236('0x32')]);_0x593b62[_0xc236('0x34')]=_['keys'](_0x3646c6[_0xc236('0x34')]);_0x593b62[_0xc236('0x36')]=_[_0xc236('0x37')](_0x593b62[_0xc236('0x3b')],_0x593b62['query']);_0x40fd6d[_0xc236('0x38')]=_[_0xc236('0x37')](_0x593b62[_0xc236('0x3b')],qs[_0xc236('0x39')](_0x3646c6[_0xc236('0x34')]['fields']));_0x40fd6d['attributes']=_0x40fd6d[_0xc236('0x38')]['length']?_0x40fd6d[_0xc236('0x38')]:_0x593b62[_0xc236('0x3b')];_0x40fd6d[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x3646c6['query'][_0xc236('0x3f')]);_0x40fd6d['where']=qs[_0xc236('0x36')](_['pick'](_0x3646c6[_0xc236('0x34')],_0x593b62[_0xc236('0x36')]));if(_0x3646c6[_0xc236('0x34')][_0xc236('0x40')]){_0x40fd6d[_0xc236('0x41')]=_[_0xc236('0x42')](_0x40fd6d[_0xc236('0x41')],{'$or':_[_0xc236('0x30')](_0x40fd6d[_0xc236('0x38')],function(_0x577ace){var _0x4849a6={};_0x4849a6[_0x577ace]={'$like':'%'+_0x3646c6[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x4849a6;})});}_0x40fd6d=_[_0xc236('0x42')]({},_0x40fd6d,_0x3646c6[_0xc236('0x45')]);return _0x25f91e[_0xc236('0x7a')](_0x40fd6d);}})[_0xc236('0x29')](function(_0x557ad9){if(_0x557ad9){_0xfc94e8=_0x557ad9[_0xc236('0x3a')];if(!_0x3646c6[_0xc236('0x34')][_0xc236('0x3c')](_0xc236('0x3d'))){_0x40fd6d[_0xc236('0x22')]=qs[_0xc236('0x22')](_0x3646c6[_0xc236('0x34')][_0xc236('0x22')]);_0x40fd6d[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x3646c6[_0xc236('0x34')][_0xc236('0x21')]);}return _0x25f91e[_0xc236('0x7a')](_0x40fd6d);}})[_0xc236('0x29')](function(_0x475c8f){if(_0x475c8f){return _0x475c8f?{'count':_0xfc94e8,'rows':_0x475c8f}:null;}})['then'](respondWithResult(_0x1ee8d0,null))[_0xc236('0x49')](handleError(_0x1ee8d0,null));};exports[_0xc236('0x7b')]=function(_0x17080e,_0x1070a3,_0x2bc6ed){var _0x4ed695={};var _0x424b51={};var _0x7bbb2c;var _0x1a938e;return db['VoicePrefix'][_0xc236('0x78')]({'where':{'id':_0x17080e['params']['id']}})['then'](handleEntityNotFound(_0x1070a3,null))[_0xc236('0x29')](function(_0x436845){if(_0x436845){_0x7bbb2c=_0x436845;_0x424b51[_0xc236('0x3b')]=_[_0xc236('0x35')](db[_0xc236('0x7c')]['rawAttributes']);_0x424b51[_0xc236('0x34')]=_[_0xc236('0x35')](_0x17080e[_0xc236('0x34')]);_0x424b51[_0xc236('0x36')]=_[_0xc236('0x37')](_0x424b51['model'],_0x424b51['query']);_0x4ed695[_0xc236('0x38')]=_[_0xc236('0x37')](_0x424b51[_0xc236('0x3b')],qs[_0xc236('0x39')](_0x17080e['query'][_0xc236('0x39')]));_0x4ed695[_0xc236('0x38')]=_0x4ed695[_0xc236('0x38')][_0xc236('0x3a')]?_0x4ed695[_0xc236('0x38')]:_0x424b51['model'];_0x4ed695[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x17080e[_0xc236('0x34')][_0xc236('0x3f')]);_0x4ed695[_0xc236('0x41')]=qs['filters'](_[_0xc236('0x7d')](_0x17080e[_0xc236('0x34')],_0x424b51['filters']));if(_0x17080e[_0xc236('0x34')][_0xc236('0x40')]){_0x4ed695[_0xc236('0x41')]=_[_0xc236('0x42')](_0x4ed695[_0xc236('0x41')],{'$or':_['map'](_0x4ed695[_0xc236('0x38')],function(_0x182750){var _0x32f936={};_0x32f936[_0x182750]={'$like':'%'+_0x17080e[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x32f936;})});}_0x4ed695=_[_0xc236('0x42')]({},_0x4ed695,_0x17080e['options']);return _0x7bbb2c[_0xc236('0x7b')](_0x4ed695);}})['then'](function(_0x391ad3){if(_0x391ad3){_0x1a938e=_0x391ad3['length'];if(!_0x17080e[_0xc236('0x34')]['hasOwnProperty'](_0xc236('0x3d'))){_0x4ed695['limit']=qs[_0xc236('0x22')](_0x17080e[_0xc236('0x34')][_0xc236('0x22')]);_0x4ed695[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x17080e[_0xc236('0x34')]['offset']);}return _0x7bbb2c[_0xc236('0x7b')](_0x4ed695);}})[_0xc236('0x29')](function(_0x32d1cc){if(_0x32d1cc){return _0x32d1cc?{'count':_0x1a938e,'rows':_0x32d1cc}:null;}})[_0xc236('0x29')](respondWithResult(_0x1070a3,null))[_0xc236('0x49')](handleError(_0x1070a3,null));};exports[_0xc236('0x7e')]=function(_0x424875,_0x14177d,_0x30e7b3){var _0x23fc57=_0x424875[_0xc236('0x6d')][_0xc236('0x71')];var _0x2bed4b;return db[_0xc236('0x7c')][_0xc236('0x7f')]({'where':{'id':_0x23fc57},'attributes':['id'],'include':[{'model':db[_0xc236('0x79')],'as':_0xc236('0x80'),'attributes':['id',_0xc236('0x2d'),_0xc236('0x81'),'voicePause',_0xc236('0x82')],'raw':!![]}]})[_0xc236('0x29')](function(_0x210989){if(_0x210989){_0x2bed4b=_0x210989;var _0x5164e5=_[_0xc236('0x83')](_0x210989,function(_0x32765e){var _0x4f9faf=_0x32765e[_0xc236('0x52')]({'plain':!![]});return _0x4f9faf[_0xc236('0x80')];});return db['VoicePrefix'][_0xc236('0x4b')]({'where':{'id':_0x424875[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](function(_0xfb7a98){return db['sequelize'][_0xc236('0x51')](function(_0x53287f){return _0xfb7a98[_0xc236('0x7e')](_0x23fc57,{'transaction':_0x53287f})[_0xc236('0x29')](function(){return BPromise[_0xc236('0x84')](_0x2bed4b,function(_0x2900ed){return db[_0xc236('0x85')]['upsert']({'TeamId':_0x2900ed['id'],'VoicePrefixId':_0x424875[_0xc236('0x4d')]['id']},{'transaction':_0x53287f});});})[_0xc236('0x29')](function(){return BPromise[_0xc236('0x84')](_0x5164e5,function(_0x29131a){return db[_0xc236('0x86')][_0xc236('0x87')]({'where':{'UserId':_0x29131a['id'],'VoicePrefixId':_0x424875[_0xc236('0x4d')]['id']},'transaction':_0x53287f});});})[_0xc236('0x29')](function(){_0x5164e5[_0xc236('0x88')](function(_0x833f85){socket[_0xc236('0x76')]('userVoicePrefix:save',{'UserId':_0x833f85['id'],'VoicePrefixId':_0xfb7a98['id']});});});});});}})['then'](respondWithStatusCode(_0x14177d,null))[_0xc236('0x49')](handleError(_0x14177d,null));};exports[_0xc236('0x89')]=function(_0x2207a8,_0x36fd37,_0x2494d9){return db[_0xc236('0x7c')][_0xc236('0x7f')]({'where':{'id':_0x2207a8[_0xc236('0x34')][_0xc236('0x71')]},'attributes':['id'],'include':[{'model':db[_0xc236('0x79')],'as':_0xc236('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x36fd37,null))[_0xc236('0x29')](function(_0x1669c4){var _0x29ae97=_[_0xc236('0x30')](_0x1669c4,'id');var _0x2a8f63=[];var _0x38aecf=[];var _0x2b46e4=squel[_0xc236('0x8a')]();_0x2b46e4['field']('tq.TeamId')['from'](_0xc236('0x8b'),'tq')['join'](_0xc236('0x8c'),'ut',_0xc236('0x8d'))[_0xc236('0x41')](_0xc236('0x8e'),_0x2207a8[_0xc236('0x4d')]['id']);for(var _0x43216e=0x0;_0x43216e<_0x1669c4[_0xc236('0x3a')];_0x43216e+=0x1){let _0x49d232=_0x1669c4[_0x43216e];for(var _0x870908=0x0;_0x870908<_0x49d232[_0xc236('0x80')][_0xc236('0x3a')];_0x870908+=0x1){let _0x364d8d=_0x49d232[_0xc236('0x80')][_0x870908];var _0x53cd27=_0x2b46e4[_0xc236('0x8f')]();_0x53cd27[_0xc236('0x41')](_0xc236('0x90'),_0x364d8d['id']);_0x38aecf[_0xc236('0x65')](db[_0xc236('0x50')][_0xc236('0x34')](_0x53cd27[_0xc236('0x91')](),{'type':db[_0xc236('0x50')][_0xc236('0x92')]['SELECT']})[_0xc236('0x29')](function(_0x281d3c){if(_0x281d3c[_0xc236('0x3a')]===0x1){return _0x364d8d['id'];}else{var _0x33cdb2=_['every'](_[_0xc236('0x30')](_0x281d3c,_0xc236('0x93')),function(_0x5ca99c){return _[_0xc236('0x94')](_0x29ae97,_0x5ca99c);});if(_0x33cdb2){return _0x364d8d['id'];}}}));}}return BPromise[_0xc236('0x95')](_0x38aecf)[_0xc236('0x29')](function(_0x32658a){_0x2a8f63=_(_0x2a8f63)[_0xc236('0x96')](_0x32658a)[_0xc236('0x97')]()[_0xc236('0x98')]();return db[_0xc236('0x31')]['find']({'where':{'id':_0x2207a8[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](function(_0x26c461){return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x57a83b){return _0x26c461[_0xc236('0x89')](_0x2207a8['query'][_0xc236('0x71')],{'transaction':_0x57a83b})[_0xc236('0x29')](function(){if(!_[_0xc236('0x99')](_0x2a8f63)){return _0x26c461[_0xc236('0x74')](_0x2a8f63,{'transaction':_0x57a83b});}})[_0xc236('0x29')](function(){_0x2a8f63[_0xc236('0x88')](function(_0x2e4215){socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':_0x2e4215,'VoicePrefixId':_0x26c461['id']});});});});});});})[_0xc236('0x29')](respondWithStatusCode(_0x36fd37,null))[_0xc236('0x49')](handleError(_0x36fd37,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8aaf92c..3b6265a 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 _0x0a6b=['save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x390d57,_0xbdd3a4){var _0x418012=function(_0x488df4){while(--_0x488df4){_0x390d57['push'](_0x390d57['shift']());}};_0x418012(++_0xbdd3a4);}(_0x0a6b,0xec));var _0xb0a6=function(_0xeb0035,_0x2c3d9a){_0xeb0035=_0xeb0035-0x0;var _0x190e57=_0x0a6b[_0xeb0035];return _0x190e57;};'use strict';var EventEmitter=require(_0xb0a6('0x0'));var VoicePrefix=require(_0xb0a6('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb0a6('0x2'),'afterUpdate':_0xb0a6('0x3'),'afterDestroy':_0xb0a6('0x4')};function emitEvent(_0x524d7d){return function(_0x1f3db2,_0x300e21,_0x115975){VoicePrefixEvents[_0xb0a6('0x5')](_0x524d7d+':'+_0x1f3db2['id'],_0x1f3db2);VoicePrefixEvents['emit'](_0x524d7d,_0x1f3db2);_0x115975(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xb0a6('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x6040=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0x44aac2,_0x336163){var _0x38a6bc=function(_0x423444){while(--_0x423444){_0x44aac2['push'](_0x44aac2['shift']());}};_0x38a6bc(++_0x336163);}(_0x6040,0x139));var _0x0604=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x6040[_0x2ae2ad];return _0x26dbd7;};'use strict';var EventEmitter=require(_0x0604('0x0'));var VoicePrefix=require(_0x0604('0x1'))['db'][_0x0604('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0604('0x3')](0x0);var events={'afterCreate':_0x0604('0x4'),'afterUpdate':_0x0604('0x5'),'afterDestroy':_0x0604('0x6')};function emitEvent(_0x3e720a){return function(_0x2eec43,_0x501f35,_0x5aa076){VoicePrefixEvents['emit'](_0x3e720a+':'+_0x2eec43['id'],_0x2eec43);VoicePrefixEvents[_0x0604('0x7')](_0x3e720a,_0x2eec43);_0x5aa076(null);};}for(var e in events){if(events[_0x0604('0x8')](e)){var event=events[e];VoicePrefix[_0x0604('0x9')](e,emitEvent(event));}}module[_0x0604('0xa')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 6b01ff8..1a7508f 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 _0xba32=['request-promise','../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x5c64a1,_0x10a799){var _0x3cc675=function(_0x3f3c38){while(--_0x3f3c38){_0x5c64a1['push'](_0x5c64a1['shift']());}};_0x3cc675(++_0x10a799);}(_0xba32,0xf8));var _0x2ba3=function(_0x2543be,_0x19ebd6){_0x2543be=_0x2543be-0x0;var _0x4636d0=_0xba32[_0x2543be];return _0x4636d0;};'use strict';var _=require(_0x2ba3('0x0'));var util=require(_0x2ba3('0x1'));var logger=require(_0x2ba3('0x2'))(_0x2ba3('0x3'));var moment=require(_0x2ba3('0x4'));var BPromise=require('bluebird');var rp=require(_0x2ba3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2ba3('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x2ba3('0x7')]=function(_0x1d5602,_0x683e3c){return _0x1d5602[_0x2ba3('0x8')](_0x2ba3('0x9'),attributes,{'tableName':_0x2ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00b8=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2ed919,_0x48314b){var _0x574174=function(_0x271045){while(--_0x271045){_0x2ed919['push'](_0x2ed919['shift']());}};_0x574174(++_0x48314b);}(_0x00b8,0x13d));var _0x800b=function(_0x398382,_0x3d252f){_0x398382=_0x398382-0x0;var _0x2d8dce=_0x00b8[_0x398382];return _0x2d8dce;};'use strict';var _=require(_0x800b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x800b('0x1'));var moment=require(_0x800b('0x2'));var BPromise=require(_0x800b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x800b('0x4'));var rimraf=require(_0x800b('0x5'));var config=require(_0x800b('0x6'));var attributes=require(_0x800b('0x7'));module[_0x800b('0x8')]=function(_0x372dca,_0x3b9ccf){return _0x372dca[_0x800b('0x9')](_0x800b('0xa'),attributes,{'tableName':_0x800b('0xb'),'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 bbb3b6e..4065603 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 _0x3837=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis'];(function(_0x8d6957,_0x19bfb9){var _0x227dc8=function(_0x42a2f8){while(--_0x42a2f8){_0x8d6957['push'](_0x8d6957['shift']());}};_0x227dc8(++_0x19bfb9);}(_0x3837,0x1d1));var _0x7383=function(_0x16852a,_0x24b03d){_0x16852a=_0x16852a-0x0;var _0x5d2842=_0x3837[_0x16852a];return _0x5d2842;};'use strict';var _=require('lodash');var util=require(_0x7383('0x0'));var moment=require('moment');var BPromise=require(_0x7383('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7383('0x2'));var db=require(_0x7383('0x3'))['db'];var utils=require(_0x7383('0x4'));var logger=require(_0x7383('0x5'))(_0x7383('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7383('0x7')][_0x7383('0x8')]({'port':0x232a});config[_0x7383('0x9')]=_[_0x7383('0xa')](config[_0x7383('0x9')],{'host':_0x7383('0xb'),'port':0x18eb});var socket=require(_0x7383('0xc'))(new Redis(config['redis']));require(_0x7383('0xd'))[_0x7383('0xe')](socket);function respondWithRpcPromise(_0x257254,_0x1316ec,_0x3d2d47){return new BPromise(function(_0x2dcdc9,_0x19f134){return client['request'](_0x257254,_0x3d2d47)[_0x7383('0xf')](function(_0x5ba02f){logger[_0x7383('0x10')](_0x7383('0x11'),_0x1316ec,_0x7383('0x12'));logger[_0x7383('0x13')](_0x7383('0x14'),_0x1316ec,_0x7383('0x12'),JSON[_0x7383('0x15')](_0x5ba02f));if(_0x5ba02f[_0x7383('0x16')]){if(_0x5ba02f[_0x7383('0x16')]['code']===0x1f4){logger[_0x7383('0x16')](_0x7383('0x11'),_0x1316ec,_0x5ba02f[_0x7383('0x16')][_0x7383('0x17')]);return _0x19f134(_0x5ba02f['error']['message']);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x1316ec,_0x5ba02f[_0x7383('0x16')][_0x7383('0x17')]);return _0x2dcdc9(_0x5ba02f[_0x7383('0x16')][_0x7383('0x17')]);}else{logger[_0x7383('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x1316ec,_0x7383('0x12'));_0x2dcdc9(_0x5ba02f[_0x7383('0x18')][_0x7383('0x17')]);}})[_0x7383('0x19')](function(_0x251702){logger[_0x7383('0x16')](_0x7383('0x11'),_0x1316ec,_0x251702);_0x19f134(_0x251702);});});} \ No newline at end of file +var _0x4e47=['client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x128975,_0x3a61e4){var _0x457e3f=function(_0x34898e){while(--_0x34898e){_0x128975['push'](_0x128975['shift']());}};_0x457e3f(++_0x3a61e4);}(_0x4e47,0x17f));var _0x74e4=function(_0x2bb79d,_0x145013){_0x2bb79d=_0x2bb79d-0x0;var _0x50fc4e=_0x4e47[_0x2bb79d];return _0x50fc4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x74e4('0x0'));var BPromise=require(_0x74e4('0x1'));var rs=require(_0x74e4('0x2'));var fs=require('fs');var Redis=require(_0x74e4('0x3'));var db=require(_0x74e4('0x4'))['db'];var utils=require(_0x74e4('0x5'));var logger=require(_0x74e4('0x6'))(_0x74e4('0x7'));var config=require('../../config/environment');var jayson=require(_0x74e4('0x8'));var client=jayson[_0x74e4('0x9')]['http']({'port':0x232a});config[_0x74e4('0xa')]=_[_0x74e4('0xb')](config[_0x74e4('0xa')],{'host':_0x74e4('0xc'),'port':0x18eb});var socket=require(_0x74e4('0xd'))(new Redis(config['redis']));require(_0x74e4('0xe'))[_0x74e4('0xf')](socket);function respondWithRpcPromise(_0x258940,_0x3525f8,_0xf13e3a){return new BPromise(function(_0x53567c,_0x46d9a7){return client[_0x74e4('0x10')](_0x258940,_0xf13e3a)['then'](function(_0x2f6d36){logger['info'](_0x74e4('0x11'),_0x3525f8,_0x74e4('0x12'));logger[_0x74e4('0x13')](_0x74e4('0x14'),_0x3525f8,_0x74e4('0x12'),JSON[_0x74e4('0x15')](_0x2f6d36));if(_0x2f6d36[_0x74e4('0x16')]){if(_0x2f6d36[_0x74e4('0x16')][_0x74e4('0x17')]===0x1f4){logger[_0x74e4('0x16')](_0x74e4('0x11'),_0x3525f8,_0x2f6d36['error']['message']);return _0x46d9a7(_0x2f6d36['error']['message']);}logger[_0x74e4('0x16')](_0x74e4('0x11'),_0x3525f8,_0x2f6d36[_0x74e4('0x16')]['message']);return _0x53567c(_0x2f6d36[_0x74e4('0x16')][_0x74e4('0x18')]);}else{logger[_0x74e4('0x19')](_0x74e4('0x11'),_0x3525f8,_0x74e4('0x12'));_0x53567c(_0x2f6d36[_0x74e4('0x1a')][_0x74e4('0x18')]);}})[_0x74e4('0x1b')](function(_0x4c9d2d){logger[_0x74e4('0x16')](_0x74e4('0x11'),_0x3525f8,_0x4c9d2d);_0x46d9a7(_0x4c9d2d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8a5cee8..4bb3142 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 _0x80fb=['remove','emit','removeListener','register','length','voicePrefix:','save'];(function(_0x862e5a,_0x50e08f){var _0x3a5782=function(_0xd49c27){while(--_0xd49c27){_0x862e5a['push'](_0x862e5a['shift']());}};_0x3a5782(++_0x50e08f);}(_0x80fb,0x11e));var _0xb80f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x80fb[_0x14add3];return _0x4a174f;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xb80f('0x0'),_0xb80f('0x1'),'update'];function createListener(_0x33f217,_0x374dc2){return function(_0x38def4){_0x374dc2[_0xb80f('0x2')](_0x33f217,_0x38def4);};}function removeListener(_0x22de9a,_0x4561c7){return function(){VoicePrefixEvents[_0xb80f('0x3')](_0x22de9a,_0x4561c7);};}exports[_0xb80f('0x4')]=function(_0x52d81c){for(var _0x1676a9=0x0,_0x251de5=events[_0xb80f('0x5')];_0x1676a9<_0x251de5;_0x1676a9++){var _0x2083ab=events[_0x1676a9];var _0x28027c=createListener(_0xb80f('0x6')+_0x2083ab,_0x52d81c);VoicePrefixEvents['on'](_0x2083ab,_0x28027c);}}; \ No newline at end of file +var _0x1789=['register','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x44124b,_0x2b2b32){var _0xafe8bf=function(_0x421d4e){while(--_0x421d4e){_0x44124b['push'](_0x44124b['shift']());}};_0xafe8bf(++_0x2b2b32);}(_0x1789,0x92));var _0x9178=function(_0x3c6b20,_0x315702){_0x3c6b20=_0x3c6b20-0x0;var _0x5d6849=_0x1789[_0x3c6b20];return _0x5d6849;};'use strict';var VoicePrefixEvents=require(_0x9178('0x0'));var events=[_0x9178('0x1'),_0x9178('0x2'),'update'];function createListener(_0xf9cb5d,_0xe7c1){return function(_0x3e7033){_0xe7c1[_0x9178('0x3')](_0xf9cb5d,_0x3e7033);};}function removeListener(_0x45af56,_0x5911d4){return function(){VoicePrefixEvents['removeListener'](_0x45af56,_0x5911d4);};}exports[_0x9178('0x4')]=function(_0x30f085){for(var _0x10a9fc=0x0,_0x1f00a8=events['length'];_0x10a9fc<_0x1f00a8;_0x10a9fc++){var _0x1001b0=events[_0x10a9fc];var _0x333b8b=createListener(_0x9178('0x5')+_0x1001b0,_0x30f085);VoicePrefixEvents['on'](_0x1001b0,_0x333b8b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 655c95a..5a77ec3 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x5af5a8,_0x10ce33){_0x5af5a8=_0x5af5a8-0x0;var _0x414545=_0xb10b[_0x5af5a8];return _0x414545;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x10e653,_0x59f1cc){var _0x328dfd=function(_0x2bc428){while(--_0x2bc428){_0x10e653['push'](_0x10e653['shift']());}};_0x328dfd(++_0x59f1cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 1c1b67f..dc69e58 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 _0x6800=['Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','outbound','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','getDataValue','type','strategy','booked','roundrobin','progressive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','split','BOOLEAN','wrapuptime'];(function(_0x30adee,_0x374192){var _0x1f2d61=function(_0x583324){while(--_0x583324){_0x30adee['push'](_0x30adee['shift']());}};_0x1f2d61(++_0x374192);}(_0x6800,0x1dc));var _0x0680=function(_0x14f282,_0x25c533){_0x14f282=_0x14f282-0x0;var _0x2bdeca=_0x6800[_0x14f282];return _0x2bdeca;};'use strict';var Sequelize=require(_0x0680('0x0'));module['exports']={'name':{'type':Sequelize[_0x0680('0x1')],'allowNull':![],'unique':_0x0680('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0680('0x3')]('inbound',_0x0680('0x4')),'allowNull':![],'defaultValue':_0x0680('0x5')},'musiconhold':{'type':Sequelize[_0x0680('0x1')],'defaultValue':_0x0680('0x6')},'announce':{'type':Sequelize[_0x0680('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x0680('0x7'),_0x0680('0x8'),_0x0680('0x9'),_0x0680('0xa'),_0x0680('0xb'),'linear',_0x0680('0xc'),_0x0680('0xd')),'allowNull':![],'defaultValue':_0x0680('0x7'),'set':function(_0x15769a){this[_0x0680('0xe')]('strategy',_0x15769a?_0x15769a:'rrmemory');},'get':function(){var _0x18d9c2=this[_0x0680('0xf')](_0x0680('0x10'));var _0x34d235=this[_0x0680('0xf')]('dialMethod');var _0x3f4f10=this[_0x0680('0xf')](_0x0680('0x11'));if(_0x18d9c2==='inbound'){return _0x3f4f10;}if(_0x34d235===_0x0680('0x12')&&_0x3f4f10===_0x0680('0xb')||_0x34d235===_0x0680('0x12')&&_0x3f4f10===_0x0680('0x13')){return _0x3f4f10;}if(_0x34d235===_0x0680('0x14')||_0x34d235==='predictive'||_0x34d235===_0x0680('0x15')){return _0x3f4f10;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0680('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0680('0x16')](0xb)},'timeout':{'type':Sequelize[_0x0680('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0680('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0680('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x17'),'no'),'defaultValue':_0x0680('0x17')},'autopause':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x17'),'no',_0x0680('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0680('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0680('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0680('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0680('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0680('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0680('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0680('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x17'),'no'),'defaultValue':_0x0680('0x17')},'announce_holdtime':{'type':Sequelize[_0x0680('0x3')]('yes','no',_0x0680('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0680('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0680('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x0680('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0680('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0680('0x1')]},'queue_youarenext':{'type':Sequelize[_0x0680('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0680('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0680('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0680('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0680('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0680('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x0680('0x1')]},'queue_quantity2':{'type':Sequelize[_0x0680('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x0680('0x1')]},'queue_less_than':{'type':Sequelize[_0x0680('0x1')]},'periodic_announce':{'type':Sequelize[_0x0680('0x1a')],'set':function(_0xf35392){this['setDataValue'](_0x0680('0x1b'),_0xf35392?_0xf35392[_0x0680('0x1c')](','):[]);},'get':function(){return this[_0x0680('0xf')](_0x0680('0x1b'))?this[_0x0680('0xf')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x0680('0x1')],'defaultValue':_0x0680('0x17'),'set':function(_0x5c3ab6){this['setDataValue'](_0x0680('0x1d'),_0x5c3ab6?_0x5c3ab6[_0x0680('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x0680('0x1d'))?this['getDataValue'](_0x0680('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0680('0x1')],'defaultValue':'no','set':function(_0x554c61){this[_0x0680('0xe')](_0x0680('0x1e'),_0x554c61?_0x554c61[_0x0680('0x1c')](','):undefined);},'get':function(){return this[_0x0680('0xf')](_0x0680('0x1e'))?this[_0x0680('0xf')](_0x0680('0x1e'))[_0x0680('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x0680('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0680('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0680('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0680('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0680('0x1')]},'acw':{'type':Sequelize[_0x0680('0x20')],'defaultValue':0x0,'set':function(_0x4b10e7){this[_0x0680('0xe')]('acw',_0x4b10e7);if(_0x4b10e7){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x0680('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0680('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0680('0x20')],'defaultValue':0x0,'comment':_0x0680('0x22')},'dialMethod':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x23'),'progressive',_0x0680('0x15'),_0x0680('0x24'),_0x0680('0x12')),'defaultValue':_0x0680('0x14'),'comment':_0x0680('0x25')},'dialLimitChannel':{'type':Sequelize[_0x0680('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0680('0x26')},'dialLimitQueue':{'type':Sequelize[_0x0680('0x16')](0x4)[_0x0680('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x0680('0x28')](0x2)[_0x0680('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x0680('0x3')]('agentBusyFactor',_0x0680('0x29')),'defaultValue':_0x0680('0x29'),'comment':_0x0680('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0680('0x28')](0x2)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0680('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0680('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0680('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x0680('0x1')],'defaultValue':_0x0680('0x2e'),'comment':_0x0680('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x30')},'dialQueueProject':{'type':Sequelize[_0x0680('0x1')],'comment':_0x0680('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0680('0x16')](0x5)[_0x0680('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0680('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0680('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0680('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x3,'comment':_0x0680('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0680('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0680('0x1')],'defaultValue':_0x0680('0x38')},'dialPrefix':{'type':Sequelize[_0x0680('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0680('0x39'),_0x0680('0x3a'),_0x0680('0x3b')),'defaultValue':_0x0680('0x39')},'dialAMDActive':{'type':Sequelize[_0x0680('0x20')],'defaultValue':0x0,'comment':_0x0680('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x0680('0x16')](0x9)[_0x0680('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0680('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x0680('0x16')](0x9)[_0x0680('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0680('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0680('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0680('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0680('0x16')](0x9)[_0x0680('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0680('0x16')](0x9)[_0x0680('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0680('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0680('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0680('0x16')](0x9)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0680('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0680('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0680('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0680('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x0680('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0680('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x0680('0x20')],'defaultValue':0x0,'comment':_0x0680('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0680('0x3')](_0x0680('0x45'),_0x0680('0x46')),'defaultValue':_0x0680('0x45')},'dialQueueProject2':{'type':Sequelize[_0x0680('0x1')],'comment':_0x0680('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0680('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0680('0x47')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0680('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0680('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0680('0x4a')},'dialDropMaxRetry':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x4b')},'dialDropRetryFrequency':{'type':Sequelize[_0x0680('0x16')](0x5)[_0x0680('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0680('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0680('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0x0680('0x16')](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x4e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0680('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0680('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0680('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0680('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0680('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x0680('0x52')},'mandatoryDisposition':{'type':Sequelize[_0x0680('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x210ebb){if(!_0x210ebb)this[_0x0680('0xe')](_0x0680('0x53'),null);this['setDataValue'](_0x0680('0x54'),_0x210ebb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0680('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0680('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0680('0x20')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa100=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','predictive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x4c993f,_0x14c241){var _0x4fb568=function(_0x246015){while(--_0x246015){_0x4c993f['push'](_0x4c993f['shift']());}};_0x4fb568(++_0x14c241);}(_0xa100,0x78));var _0x0a10=function(_0x16e8ad,_0x5f4726){_0x16e8ad=_0x16e8ad-0x0;var _0xbd3740=_0xa100[_0x16e8ad];return _0xbd3740;};'use strict';var Sequelize=require('sequelize');module[_0x0a10('0x0')]={'name':{'type':Sequelize[_0x0a10('0x1')],'allowNull':![],'unique':_0x0a10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a10('0x3')]('rr',_0x0a10('0x5'),_0x0a10('0x6'),_0x0a10('0x7'),_0x0a10('0x8'),_0x0a10('0x9'),_0x0a10('0xa'),_0x0a10('0xb'),_0x0a10('0xc')),'allowNull':![],'defaultValue':_0x0a10('0x5'),'set':function(_0x972cf2){this[_0x0a10('0xd')](_0x0a10('0xe'),_0x972cf2?_0x972cf2:_0x0a10('0x9'));},'get':function(){var _0xa2215a=this[_0x0a10('0xf')](_0x0a10('0x10'));var _0x221522=this[_0x0a10('0xf')](_0x0a10('0x11'));var _0x7fb9a3=this[_0x0a10('0xf')]('strategy');if(_0xa2215a===_0x0a10('0x4')){return _0x7fb9a3;}if(_0x221522===_0x0a10('0x12')&&_0x7fb9a3==='rrmemory'||_0x221522===_0x0a10('0x12')&&_0x7fb9a3===_0x0a10('0x13')){return _0x7fb9a3;}if(_0x221522==='progressive'||_0x221522===_0x0a10('0x14')||_0x221522==='power'){return _0x7fb9a3;}return null;}},'servicelevel':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0a10('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a10('0x1')]},'weight':{'type':Sequelize[_0x0a10('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':_0x0a10('0x16')},'autopause':{'type':Sequelize['ENUM'](_0x0a10('0x16'),'no',_0x0a10('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a10('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a10('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x0a10('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a10('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0a10('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x0a10('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':_0x0a10('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x0a10('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x0a10('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x0a10('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a10('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a10('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a10('0x1')]},'queue_quantity1':{'type':Sequelize[_0x0a10('0x1')]},'queue_quantity2':{'type':Sequelize[_0x0a10('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x0a10('0x1')]},'queue_less_than':{'type':Sequelize[_0x0a10('0x1')]},'periodic_announce':{'type':Sequelize[_0x0a10('0x18')],'set':function(_0x52723f){this['setDataValue'](_0x0a10('0x19'),_0x52723f?_0x52723f[_0x0a10('0x1a')](','):[]);},'get':function(){return this[_0x0a10('0xf')](_0x0a10('0x19'))?this['getDataValue'](_0x0a10('0x19'))[_0x0a10('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x0a10('0x16'),'set':function(_0x194a3f){this[_0x0a10('0xd')]('joinempty',_0x194a3f?_0x194a3f[_0x0a10('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a10('0x1c'))?this[_0x0a10('0xf')](_0x0a10('0x1c'))[_0x0a10('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':'no','set':function(_0x13e051){this[_0x0a10('0xd')](_0x0a10('0x1d'),_0x13e051?_0x13e051[_0x0a10('0x1a')](','):undefined);},'get':function(){return this[_0x0a10('0xf')](_0x0a10('0x1d'))?this['getDataValue'](_0x0a10('0x1d'))[_0x0a10('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a10('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0a10('0x1')]},'acw':{'type':Sequelize[_0x0a10('0x1e')],'defaultValue':0x0,'set':function(_0x4cdea8){this['setDataValue']('acw',_0x4cdea8);if(_0x4cdea8){if(this['getDataValue'](_0x0a10('0x1f'))<0x2){this['setDataValue'](_0x0a10('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0a10('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a10('0x1e')],'defaultValue':0x0,'comment':_0x0a10('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0x0a10('0x21'),_0x0a10('0x22'),_0x0a10('0x23'),_0x0a10('0x14'),_0x0a10('0x12')),'defaultValue':_0x0a10('0x22'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x0a10('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a10('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a10('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a10('0x26')},'dialPowerLevel':{'type':Sequelize[_0x0a10('0x27')](0x2)[_0x0a10('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x0a10('0x3')]('agentBusyFactor',_0x0a10('0x28')),'defaultValue':_0x0a10('0x28'),'comment':_0x0a10('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a10('0x27')](0x2)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a10('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x0a10('0x15')](0x3)[_0x0a10('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0a10('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a10('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a10('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a10('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a10('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':_0x0a10('0x2d'),'comment':_0x0a10('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a10('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a10('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a10('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a10('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a10('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a10('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a10('0x15')](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'comment':_0x0a10('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a10('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a10('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a10('0x15')](0x3)[_0x0a10('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a10('0x35')},'dialTimezone':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':_0x0a10('0x36')},'dialPrefix':{'type':Sequelize[_0x0a10('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x0a10('0x37'),_0x0a10('0x38')),'defaultValue':_0x0a10('0x39')},'dialAMDActive':{'type':Sequelize[_0x0a10('0x1e')],'defaultValue':0x0,'comment':_0x0a10('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x0a10('0x15')](0x9)[_0x0a10('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0a10('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a10('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a10('0x15')](0x9)[_0x0a10('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a10('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a10('0x15')](0x9)[_0x0a10('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0a10('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a10('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a10('0x15')](0x9)[_0x0a10('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0a10('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a10('0x15')](0x9)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a10('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a10('0x15')](0x5)[_0x0a10('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a10('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a10('0x15')](0x5)[_0x0a10('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a10('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x0a10('0x1e')],'defaultValue':0x0,'comment':_0x0a10('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a10('0x3')](_0x0a10('0x43'),_0x0a10('0x44')),'defaultValue':_0x0a10('0x43')},'dialQueueProject2':{'type':Sequelize[_0x0a10('0x1')],'comment':_0x0a10('0x45')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a10('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a10('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a10('0x15')](0x3)[_0x0a10('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a10('0x46')},'dialCutDigit':{'type':Sequelize[_0x0a10('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a10('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a10('0x15')](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a10('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a10('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a10('0x49')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a10('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a10('0x15')](0x5)[_0x0a10('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a10('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a10('0x4b')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a10('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a10('0x15')](0x5)[_0x0a10('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a10('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a10('0x15')](0x3)[_0x0a10('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a10('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a10('0x15')](0x5)[_0x0a10('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a10('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a10('0x15')],'allowNull':!![],'comment':_0x0a10('0x50')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0a10('0x51'),'set':function(_0x26e11d){if(!_0x26e11d)this[_0x0a10('0xd')](_0x0a10('0x52'),null);this[_0x0a10('0xd')](_0x0a10('0x53'),_0x26e11d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0a10('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0a10('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 9e5a54d..8aedb5a 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 _0xc9b2=['QueryTypes','all','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','fromQuery','ContactId','ListId','select','phone','scheduledAt','field','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','cm_contacts','phone\x20IS\x20NOT\x20NULL','into','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','limit','count','set','Content-Range','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','find','name','UserProfileResource','stack','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','include','VoiceQueue','findAll','catch','params','includeAll','create','role','user','outbound','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','autoAssociation','getHoppers','CmHopper','order','pick','VoiceQueueId','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','forEach','penalty','upsert','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc9b2,0xdf));var _0x2c9b=function(_0x14970e,_0x3dab4f){_0x14970e=_0x14970e-0x0;var _0x939d3c=_0xc9b2[_0x14970e];return _0x939d3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c9b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2c9b('0x1'));var moment=require(_0x2c9b('0x2'));var BPromise=require(_0x2c9b('0x3'));var Mustache=require(_0x2c9b('0x4'));var util=require(_0x2c9b('0x5'));var path=require(_0x2c9b('0x6'));var sox=require('sox');var csv=require(_0x2c9b('0x7'));var ejs=require(_0x2c9b('0x8'));var fs=require('fs');var fs_extra=require(_0x2c9b('0x9'));var _=require(_0x2c9b('0xa'));var squel=require(_0x2c9b('0xb'));var crypto=require(_0x2c9b('0xc'));var jsforce=require(_0x2c9b('0xd'));var deskjs=require(_0x2c9b('0xe'));var toCsv=require(_0x2c9b('0x7'));var querystring=require(_0x2c9b('0xf'));var Papa=require(_0x2c9b('0x10'));var Redis=require(_0x2c9b('0x11'));var authService=require(_0x2c9b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2c9b('0x13'));var hardwareService=require(_0x2c9b('0x14'));var logger=require(_0x2c9b('0x15'))(_0x2c9b('0x16'));var utils=require(_0x2c9b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2c9b('0x18'));var db=require(_0x2c9b('0x19'))['db'];config[_0x2c9b('0x1a')]=_[_0x2c9b('0x1b')](config[_0x2c9b('0x1a')],{'host':_0x2c9b('0x1c'),'port':0x18eb});var socket=require(_0x2c9b('0x1d'))(new Redis(config['redis']));require(_0x2c9b('0x1e'))[_0x2c9b('0x1f')](socket);function respondWithStatusCode(_0x1f7854,_0x57406e){_0x57406e=_0x57406e||0xcc;return function(_0x2a84da){if(_0x2a84da){return _0x1f7854[_0x2c9b('0x20')](_0x57406e);}return _0x1f7854['status'](_0x57406e)[_0x2c9b('0x21')]();};}function respondWithResult(_0xd85041,_0x5dcd6c){_0x5dcd6c=_0x5dcd6c||0xc8;return function(_0xabf44d){if(_0xabf44d){return _0xd85041[_0x2c9b('0x22')](_0x5dcd6c)[_0x2c9b('0x23')](_0xabf44d);}};}function respondWithFilteredResult(_0x27a5ce,_0x41def1){return function(_0x36f6c5){if(_0x36f6c5){var _0x417969=typeof _0x41def1[_0x2c9b('0x24')]==='undefined'&&typeof _0x41def1[_0x2c9b('0x25')]==='undefined';var _0x5a896d=_0x36f6c5[_0x2c9b('0x26')];var _0x1cd486=_0x417969?0x0:_0x41def1[_0x2c9b('0x24')];var _0xdf1a75=_0x417969?_0x36f6c5[_0x2c9b('0x26')]:_0x41def1['offset']+_0x41def1['limit'];var _0x769dcd;if(_0xdf1a75>=_0x5a896d){_0xdf1a75=_0x5a896d;_0x769dcd=0xc8;}else{_0x769dcd=0xce;}_0x27a5ce[_0x2c9b('0x22')](_0x769dcd);return _0x27a5ce[_0x2c9b('0x27')](_0x2c9b('0x28'),_0x1cd486+'-'+_0xdf1a75+'/'+_0x5a896d)[_0x2c9b('0x23')](_0x36f6c5);}return null;};}function patchUpdates(_0x217716){return function(_0x40d927){try{jsonpatch['apply'](_0x40d927,_0x217716,!![]);}catch(_0x173fea){return BPromise['reject'](_0x173fea);}return _0x40d927['save']();};}function saveUpdates(_0x22d834,_0x4ddac8){return function(_0x36e4fc){if(_0x36e4fc){return _0x36e4fc[_0x2c9b('0x29')](_0x22d834)[_0x2c9b('0x2a')](function(_0x4ebd2d){return _0x4ebd2d;});}return null;};}function removeEntity(_0x1cc927,_0x4e6ad5){return function(_0x61ead){if(_0x61ead){return _0x61ead[_0x2c9b('0x2b')]()[_0x2c9b('0x2a')](function(){var _0x236ff0=_0x61ead[_0x2c9b('0x2c')]({'plain':!![]});var _0x3090f7=[{'name':_0x2c9b('0x2d'),'value':_0x2c9b('0x2e'),'ignore':![]},{'name':_0x2c9b('0x2f'),'value':'outbound','ignore':![]}];var _0xb51e3d=_(_0x3090f7)[_0x2c9b('0x30')]('ignore')[_0x2c9b('0x31')](_0x2c9b('0x32'))[_0x2c9b('0x32')]();if(_[_0x2c9b('0x33')](_0xb51e3d,_0x236ff0[_0x2c9b('0x34')])){return;}var _0x32fbbc=_[_0x2c9b('0x35')](_0x3090f7,[_0x2c9b('0x32'),_0x236ff0[_0x2c9b('0x34')]])[_0x2c9b('0x36')];return db[_0x2c9b('0x37')][_0x2c9b('0x2b')]({'where':{'type':_0x32fbbc,'resourceId':_0x236ff0['id']}})['then'](function(){return _0x61ead;});})[_0x2c9b('0x2a')](function(){_0x1cc927[_0x2c9b('0x22')](0xcc)[_0x2c9b('0x21')]();});}};}function handleEntityNotFound(_0x246333,_0x481704){return function(_0x3647d6){if(!_0x3647d6){_0x246333['sendStatus'](0x194);}return _0x3647d6;};}function handleError(_0x52fcf8,_0x2ed946){_0x2ed946=_0x2ed946||0x1f4;return function(_0x3e45ac){logger['error'](_0x3e45ac[_0x2c9b('0x38')]);if(_0x3e45ac[_0x2c9b('0x36')]){delete _0x3e45ac[_0x2c9b('0x36')];}_0x52fcf8[_0x2c9b('0x22')](_0x2ed946)[_0x2c9b('0x39')](_0x3e45ac);};}exports[_0x2c9b('0x3a')]=function(_0x34b202,_0x2d88e0){var _0x1419be={},_0x1c7c6a={},_0x461f15={'count':0x0,'rows':[]};var _0xa58b46=_[_0x2c9b('0x31')](db['VoiceQueue'][_0x2c9b('0x3b')],function(_0x1233fe){return{'name':_0x1233fe[_0x2c9b('0x3c')],'type':_0x1233fe['type'][_0x2c9b('0x3d')]};});_0x1c7c6a[_0x2c9b('0x3e')]=_[_0x2c9b('0x31')](_0xa58b46,_0x2c9b('0x36'));_0x1c7c6a[_0x2c9b('0x3f')]=_[_0x2c9b('0x40')](_0x34b202['query']);_0x1c7c6a[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x1c7c6a['model'],_0x1c7c6a['query']);_0x1419be[_0x2c9b('0x43')]=_[_0x2c9b('0x42')](_0x1c7c6a[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x34b202['query'][_0x2c9b('0x44')]));_0x1419be['attributes']=_0x1419be['attributes'][_0x2c9b('0x45')]?_0x1419be['attributes']:_0x1c7c6a['model'];if(!_0x34b202['query'][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x1419be[_0x2c9b('0x25')]=qs['limit'](_0x34b202['query'][_0x2c9b('0x25')]);_0x1419be[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x34b202[_0x2c9b('0x3f')]['offset']);}_0x1419be['order']=qs['sort'](_0x34b202[_0x2c9b('0x3f')][_0x2c9b('0x48')]);_0x1419be[_0x2c9b('0x49')]=qs[_0x2c9b('0x41')](_['pick'](_0x34b202[_0x2c9b('0x3f')],_0x1c7c6a[_0x2c9b('0x41')]),_0xa58b46);if(_0x34b202[_0x2c9b('0x3f')][_0x2c9b('0x30')]){_0x1419be[_0x2c9b('0x49')]=_['merge'](_0x1419be[_0x2c9b('0x49')],{'$or':_[_0x2c9b('0x31')](_0xa58b46,function(_0x20dd12){if(_0x20dd12[_0x2c9b('0x34')]!==_0x2c9b('0x4a')){var _0x50b24c={};_0x50b24c[_0x20dd12[_0x2c9b('0x36')]]={'$like':'%'+_0x34b202[_0x2c9b('0x3f')][_0x2c9b('0x30')]+'%'};return _0x50b24c;}})});}_0x1419be=_[_0x2c9b('0x4b')]({},_0x1419be,_0x34b202[_0x2c9b('0x4c')]);var _0x43a214={'where':_0x1419be[_0x2c9b('0x49')]};return db['VoiceQueue'][_0x2c9b('0x26')](_0x43a214)[_0x2c9b('0x2a')](function(_0x15f0df){_0x461f15['count']=_0x15f0df;if(_0x34b202['query']['includeAll']){_0x1419be[_0x2c9b('0x4d')]=[{'all':!![]}];}return db[_0x2c9b('0x4e')][_0x2c9b('0x4f')](_0x1419be);})['then'](function(_0x4c36b0){_0x461f15['rows']=_0x4c36b0;return _0x461f15;})[_0x2c9b('0x2a')](respondWithFilteredResult(_0x2d88e0,_0x1419be))[_0x2c9b('0x50')](handleError(_0x2d88e0,null));};exports['show']=function(_0x102012,_0x10e7a8){var _0x594add={'raw':![],'where':{'id':_0x102012[_0x2c9b('0x51')]['id']}},_0x1166a3={};_0x1166a3[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x4e')][_0x2c9b('0x3b')]);_0x1166a3[_0x2c9b('0x3f')]=_['keys'](_0x102012[_0x2c9b('0x3f')]);_0x1166a3[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x1166a3['model'],_0x1166a3[_0x2c9b('0x3f')]);_0x594add[_0x2c9b('0x43')]=_[_0x2c9b('0x42')](_0x1166a3['model'],qs['fields'](_0x102012[_0x2c9b('0x3f')][_0x2c9b('0x44')]));_0x594add[_0x2c9b('0x43')]=_0x594add[_0x2c9b('0x43')]['length']?_0x594add[_0x2c9b('0x43')]:_0x1166a3[_0x2c9b('0x3e')];if(_0x102012[_0x2c9b('0x3f')][_0x2c9b('0x52')]){_0x594add[_0x2c9b('0x4d')]=[{'all':!![]}];}_0x594add=_[_0x2c9b('0x4b')]({},_0x594add,_0x102012[_0x2c9b('0x4c')]);return db['VoiceQueue'][_0x2c9b('0x35')](_0x594add)['then'](handleEntityNotFound(_0x10e7a8,null))[_0x2c9b('0x2a')](respondWithResult(_0x10e7a8,null))[_0x2c9b('0x50')](handleError(_0x10e7a8,null));};exports['create']=function(_0x4c3af8,_0x93206c){return db['VoiceQueue'][_0x2c9b('0x53')](_0x4c3af8['body'],{})[_0x2c9b('0x2a')](function(_0x54d81f){var _0x32e2bd=_0x4c3af8['user']['get']({'plain':!![]});if(!_0x32e2bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32e2bd[_0x2c9b('0x54')]===_0x2c9b('0x55')){var _0x5ef4fc=_0x54d81f[_0x2c9b('0x2c')]({'plain':!![]});var _0x599dcd=[{'name':_0x2c9b('0x2d'),'value':'inbound'},{'name':_0x2c9b('0x2f'),'value':_0x2c9b('0x56')}];var _0x2054b9=_['find'](_0x599dcd,['value',_0x5ef4fc[_0x2c9b('0x34')]])['name'];return db[_0x2c9b('0x57')]['find']({'where':{'name':_0x2054b9,'userProfileId':_0x32e2bd[_0x2c9b('0x58')]},'raw':!![]})[_0x2c9b('0x2a')](function(_0x2ce5ea){if(_0x2ce5ea&&_0x2ce5ea['autoAssociation']===0x0){return db[_0x2c9b('0x37')]['create']({'name':_0x5ef4fc[_0x2c9b('0x36')],'resourceId':_0x5ef4fc['id'],'type':_0x2ce5ea[_0x2c9b('0x36')],'sectionId':_0x2ce5ea['id']},{})[_0x2c9b('0x2a')](function(){return _0x54d81f;});}else{return _0x54d81f;}})[_0x2c9b('0x50')](function(_0x27269a){logger[_0x2c9b('0x59')](_0x2c9b('0x5a'),_0x27269a);throw _0x27269a;});}return _0x54d81f;})['then'](respondWithResult(_0x93206c,0xc9))[_0x2c9b('0x50')](handleError(_0x93206c,null));};exports[_0x2c9b('0x5b')]=function(_0x4a33af,_0x1327c0){var _0xa9bcb6={'where':{'id':_0x4a33af[_0x2c9b('0x51')]['id']}},_0x233cc0={};_0x233cc0[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x4e')]['rawAttributes']);_0xa9bcb6[_0x2c9b('0x43')]=_[_0x2c9b('0x42')](_0x233cc0[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x4a33af[_0x2c9b('0x3f')][_0x2c9b('0x44')]));_0xa9bcb6[_0x2c9b('0x43')]=_0xa9bcb6[_0x2c9b('0x43')][_0x2c9b('0x45')]?_0xa9bcb6[_0x2c9b('0x43')]:_0x233cc0[_0x2c9b('0x3e')];if(_0x4a33af['query'][_0x2c9b('0x52')]){_0xa9bcb6[_0x2c9b('0x4d')]=[{'all':!![]}];}_0xa9bcb6=_[_0x2c9b('0x4b')]({},_0xa9bcb6,_0x4a33af[_0x2c9b('0x4c')]);return db['VoiceQueue'][_0x2c9b('0x35')](_0xa9bcb6)[_0x2c9b('0x2a')](handleEntityNotFound(_0x1327c0,null))[_0x2c9b('0x2a')](function(_0x2acfcc){if(_0x2acfcc){var _0x330fd0=_0x2acfcc[_0x2c9b('0x2c')]({'plain':!![]});_0x330fd0=qs[_0x2c9b('0x5c')](_0x330fd0,['id',_0x2c9b('0x5d'),_0x2c9b('0x5e')]);_0x4a33af[_0x2c9b('0x5f')]=_[_0x2c9b('0x5c')](_0x4a33af[_0x2c9b('0x5f')],['id','createdAt',_0x2c9b('0x5e')]);return db[_0x2c9b('0x4e')][_0x2c9b('0x53')](_[_0x2c9b('0x4b')](_0x330fd0,_0x4a33af[_0x2c9b('0x5f')]),{'include':_0x4a33af['query'][_0x2c9b('0x52')]?[{'all':!![]}]:undefined})[_0x2c9b('0x2a')](function(_0x4ee764){var _0x4bc60b=_0x4a33af[_0x2c9b('0x55')][_0x2c9b('0x2c')]({'plain':!![]});if(!_0x4bc60b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bc60b['role']===_0x2c9b('0x55')){var _0x50c201=_0x4ee764[_0x2c9b('0x2c')]({'plain':!![]});var _0x59ba7f=[{'name':_0x2c9b('0x2d'),'value':_0x2c9b('0x2e')},{'name':'QueueCampaigns','value':'outbound'}];var _0x17cfea=_[_0x2c9b('0x35')](_0x59ba7f,[_0x2c9b('0x32'),_0x50c201[_0x2c9b('0x34')]])[_0x2c9b('0x36')];return db[_0x2c9b('0x57')][_0x2c9b('0x35')]({'where':{'name':_0x17cfea,'userProfileId':_0x4bc60b[_0x2c9b('0x58')]},'raw':!![]})[_0x2c9b('0x2a')](function(_0x511fce){if(_0x511fce&&_0x511fce[_0x2c9b('0x60')]===0x0){return db[_0x2c9b('0x37')][_0x2c9b('0x53')]({'name':_0x50c201[_0x2c9b('0x36')],'resourceId':_0x50c201['id'],'type':_0x511fce['name'],'sectionId':_0x511fce['id']},{})[_0x2c9b('0x2a')](function(){return _0x4ee764;});}else{return _0x4ee764;}})[_0x2c9b('0x50')](function(_0x3978dc){logger[_0x2c9b('0x59')](_0x2c9b('0x5a'),_0x3978dc);throw _0x3978dc;});}return _0x4ee764;});}})[_0x2c9b('0x2a')](respondWithResult(_0x1327c0,0xc9))[_0x2c9b('0x50')](handleError(_0x1327c0,null));};exports[_0x2c9b('0x29')]=function(_0x588285,_0x14e560){if(_0x588285['body']['id']){delete _0x588285[_0x2c9b('0x5f')]['id'];}return db['VoiceQueue'][_0x2c9b('0x35')]({'where':{'id':_0x588285[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x14e560,null))[_0x2c9b('0x2a')](saveUpdates(_0x588285[_0x2c9b('0x5f')],null))[_0x2c9b('0x2a')](respondWithResult(_0x14e560,null))[_0x2c9b('0x50')](handleError(_0x14e560,null));};exports[_0x2c9b('0x2b')]=function(_0x4e012e,_0x3a9dbe){return db['VoiceQueue'][_0x2c9b('0x35')]({'where':{'id':_0x4e012e[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x3a9dbe,null))['then'](removeEntity(_0x3a9dbe,null))['catch'](handleError(_0x3a9dbe,null));};exports[_0x2c9b('0x61')]=function(_0x287fc0,_0xa7a8f6,_0x2dfcb1){var _0x4d6307={'raw':![],'where':{}};var _0x474128={};var _0x2581eb={'count':0x0,'rows':[]};return db[_0x2c9b('0x4e')]['findOne']({'where':{'id':_0x287fc0[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0xa7a8f6,null))['then'](function(_0x2cfde9){if(_0x2cfde9){_0x474128[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x62')][_0x2c9b('0x3b')]);_0x474128[_0x2c9b('0x3f')]=_['keys'](_0x287fc0[_0x2c9b('0x3f')]);_0x474128[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x474128[_0x2c9b('0x3e')],_0x474128[_0x2c9b('0x3f')]);_0x4d6307[_0x2c9b('0x43')]=_[_0x2c9b('0x42')](_0x474128[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x287fc0[_0x2c9b('0x3f')]['fields']));_0x4d6307[_0x2c9b('0x43')]=_0x4d6307[_0x2c9b('0x43')][_0x2c9b('0x45')]?_0x4d6307[_0x2c9b('0x43')]:_0x474128[_0x2c9b('0x3e')];if(!_0x287fc0[_0x2c9b('0x3f')][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x4d6307[_0x2c9b('0x25')]=qs[_0x2c9b('0x25')](_0x287fc0[_0x2c9b('0x3f')]['limit']);_0x4d6307[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x287fc0[_0x2c9b('0x3f')][_0x2c9b('0x24')]);}_0x4d6307[_0x2c9b('0x63')]=qs[_0x2c9b('0x48')](_0x287fc0[_0x2c9b('0x3f')][_0x2c9b('0x48')]);_0x4d6307[_0x2c9b('0x49')]=qs[_0x2c9b('0x41')](_[_0x2c9b('0x64')](_0x287fc0['query'],_0x474128[_0x2c9b('0x41')]));_0x4d6307['where'][_0x2c9b('0x65')]=_0x2cfde9['id'];if(_0x287fc0[_0x2c9b('0x3f')][_0x2c9b('0x30')]){_0x4d6307[_0x2c9b('0x49')]=_['merge'](_0x4d6307[_0x2c9b('0x49')],{'$or':_[_0x2c9b('0x31')](_0x4d6307[_0x2c9b('0x43')],function(_0x37e410){var _0x12874d={};_0x12874d[_0x37e410]={'$like':'%'+_0x287fc0['query'][_0x2c9b('0x30')]+'%'};return _0x12874d;})});}_0x4d6307=_[_0x2c9b('0x4b')]({},_0x4d6307,_0x287fc0[_0x2c9b('0x4c')]);return db[_0x2c9b('0x62')][_0x2c9b('0x26')]({'where':_0x4d6307[_0x2c9b('0x49')]})['then'](function(_0x42ba75){_0x2581eb[_0x2c9b('0x26')]=_0x42ba75;if(_0x287fc0[_0x2c9b('0x3f')][_0x2c9b('0x52')]){_0x4d6307[_0x2c9b('0x4d')]=[{'all':!![]}];}return db[_0x2c9b('0x62')][_0x2c9b('0x4f')](_0x4d6307);})[_0x2c9b('0x2a')](function(_0x237055){_0x2581eb[_0x2c9b('0x66')]=_0x237055;return _0x2581eb;});}})[_0x2c9b('0x2a')](respondWithFilteredResult(_0xa7a8f6,_0x4d6307))['catch'](handleError(_0xa7a8f6,null));};exports[_0x2c9b('0x67')]=function(_0x12d187,_0x5a5d1d,_0xa23dca){var _0x5b748a={'raw':!![],'where':{}};var _0x20216f={};var _0x11cc47={'count':0x0,'rows':[]};return db[_0x2c9b('0x4e')][_0x2c9b('0x68')]({'where':{'id':_0x12d187[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x5a5d1d,null))[_0x2c9b('0x2a')](function(_0x486941){if(_0x486941){_0x20216f[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x69')][_0x2c9b('0x3b')]);_0x20216f[_0x2c9b('0x3f')]=_['keys'](_0x12d187[_0x2c9b('0x3f')]);_0x20216f[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x20216f[_0x2c9b('0x3e')],_0x20216f['query']);_0x5b748a['attributes']=_[_0x2c9b('0x42')](_0x20216f['model'],qs['fields'](_0x12d187['query'][_0x2c9b('0x44')]));_0x5b748a['attributes']=_0x5b748a[_0x2c9b('0x43')]['length']?_0x5b748a[_0x2c9b('0x43')]:_0x20216f[_0x2c9b('0x3e')];if(!_0x12d187[_0x2c9b('0x3f')]['hasOwnProperty'](_0x2c9b('0x47'))){_0x5b748a['limit']=qs[_0x2c9b('0x25')](_0x12d187[_0x2c9b('0x3f')][_0x2c9b('0x25')]);_0x5b748a[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x12d187['query'][_0x2c9b('0x24')]);}_0x5b748a['order']=qs[_0x2c9b('0x48')](_0x12d187[_0x2c9b('0x3f')]['sort']);_0x5b748a['where']=qs[_0x2c9b('0x41')](_[_0x2c9b('0x64')](_0x12d187['query'],_0x20216f[_0x2c9b('0x41')]));_0x5b748a[_0x2c9b('0x49')]['VoiceQueueId']=_0x486941['id'];if(_0x12d187[_0x2c9b('0x3f')][_0x2c9b('0x30')]){_0x5b748a[_0x2c9b('0x49')]=_[_0x2c9b('0x4b')](_0x5b748a[_0x2c9b('0x49')],{'$or':_[_0x2c9b('0x31')](_0x5b748a[_0x2c9b('0x43')],function(_0x41eea6){var _0x3659e1={};_0x3659e1[_0x41eea6]={'$like':'%'+_0x12d187[_0x2c9b('0x3f')]['filter']+'%'};return _0x3659e1;})});}_0x5b748a=_[_0x2c9b('0x4b')]({},_0x5b748a,_0x12d187[_0x2c9b('0x4c')]);return db[_0x2c9b('0x69')][_0x2c9b('0x26')]({'where':_0x5b748a[_0x2c9b('0x49')]})[_0x2c9b('0x2a')](function(_0x2227b9){_0x11cc47[_0x2c9b('0x26')]=_0x2227b9;if(_0x12d187['query'][_0x2c9b('0x52')]){_0x5b748a[_0x2c9b('0x4d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x2c9b('0x4f')](_0x5b748a);})[_0x2c9b('0x2a')](function(_0x29450a){_0x11cc47[_0x2c9b('0x66')]=_0x29450a;return _0x11cc47;});}})[_0x2c9b('0x2a')](respondWithFilteredResult(_0x5a5d1d,_0x5b748a))[_0x2c9b('0x50')](handleError(_0x5a5d1d,null));};exports[_0x2c9b('0x6a')]=function(_0x2a96c5,_0x3fd9a3,_0x242098){var _0x11b7bb={'raw':!![],'where':{}};var _0x3edd33={};var _0x16058d={'count':0x0,'rows':[]};return db[_0x2c9b('0x4e')][_0x2c9b('0x68')]({'where':{'id':_0x2a96c5['params']['id']}})['then'](handleEntityNotFound(_0x3fd9a3,null))['then'](function(_0x832a43){if(_0x832a43){_0x3edd33[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x6b')][_0x2c9b('0x3b')]);_0x3edd33[_0x2c9b('0x3f')]=_['keys'](_0x2a96c5[_0x2c9b('0x3f')]);_0x3edd33[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x3edd33[_0x2c9b('0x3e')],_0x3edd33[_0x2c9b('0x3f')]);_0x11b7bb['attributes']=_[_0x2c9b('0x42')](_0x3edd33['model'],qs['fields'](_0x2a96c5[_0x2c9b('0x3f')][_0x2c9b('0x44')]));_0x11b7bb[_0x2c9b('0x43')]=_0x11b7bb['attributes'][_0x2c9b('0x45')]?_0x11b7bb[_0x2c9b('0x43')]:_0x3edd33[_0x2c9b('0x3e')];if(!_0x2a96c5[_0x2c9b('0x3f')][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x11b7bb[_0x2c9b('0x25')]=qs[_0x2c9b('0x25')](_0x2a96c5['query'][_0x2c9b('0x25')]);_0x11b7bb['offset']=qs[_0x2c9b('0x24')](_0x2a96c5['query']['offset']);}_0x11b7bb['order']=qs['sort'](_0x2a96c5['query'][_0x2c9b('0x48')]);_0x11b7bb[_0x2c9b('0x49')]=qs[_0x2c9b('0x41')](_['pick'](_0x2a96c5[_0x2c9b('0x3f')],_0x3edd33[_0x2c9b('0x41')]));_0x11b7bb[_0x2c9b('0x49')]['VoiceQueueId']=_0x832a43['id'];if(_0x2a96c5[_0x2c9b('0x3f')][_0x2c9b('0x30')]){_0x11b7bb[_0x2c9b('0x49')]=_['merge'](_0x11b7bb[_0x2c9b('0x49')],{'$or':_[_0x2c9b('0x31')](_0x11b7bb[_0x2c9b('0x43')],function(_0xc18ef9){var _0x16d343={};_0x16d343[_0xc18ef9]={'$like':'%'+_0x2a96c5[_0x2c9b('0x3f')][_0x2c9b('0x30')]+'%'};return _0x16d343;})});}_0x11b7bb=_[_0x2c9b('0x4b')]({},_0x11b7bb,_0x2a96c5[_0x2c9b('0x4c')]);return db[_0x2c9b('0x6b')][_0x2c9b('0x26')]({'where':_0x11b7bb[_0x2c9b('0x49')]})['then'](function(_0x21221b){_0x16058d[_0x2c9b('0x26')]=_0x21221b;if(_0x2a96c5['query'][_0x2c9b('0x52')]){_0x11b7bb[_0x2c9b('0x4d')]=[{'all':!![]}];}return db[_0x2c9b('0x6b')][_0x2c9b('0x4f')](_0x11b7bb);})[_0x2c9b('0x2a')](function(_0x4c160b){_0x16058d[_0x2c9b('0x66')]=_0x4c160b;return _0x16058d;});}})[_0x2c9b('0x2a')](respondWithFilteredResult(_0x3fd9a3,_0x11b7bb))[_0x2c9b('0x50')](handleError(_0x3fd9a3,null));};exports[_0x2c9b('0x6c')]=function(_0x4989e9,_0x27759d,_0xfc822){var _0x58685b={'raw':!![],'where':{}};var _0x2e428c={};var _0x154d00={'count':0x0,'rows':[]};return db[_0x2c9b('0x4e')][_0x2c9b('0x68')]({'where':{'id':_0x4989e9[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x27759d,null))[_0x2c9b('0x2a')](function(_0x12687d){if(_0x12687d){_0x2e428c[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x6d')]['rawAttributes']);_0x2e428c[_0x2c9b('0x3f')]=_[_0x2c9b('0x40')](_0x4989e9['query']);_0x2e428c[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x2e428c['model'],_0x2e428c[_0x2c9b('0x3f')]);_0x58685b[_0x2c9b('0x43')]=_[_0x2c9b('0x42')](_0x2e428c[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x4989e9[_0x2c9b('0x3f')][_0x2c9b('0x44')]));_0x58685b[_0x2c9b('0x43')]=_0x58685b[_0x2c9b('0x43')]['length']?_0x58685b[_0x2c9b('0x43')]:_0x2e428c[_0x2c9b('0x3e')];if(!_0x4989e9[_0x2c9b('0x3f')]['hasOwnProperty'](_0x2c9b('0x47'))){_0x58685b['limit']=qs['limit'](_0x4989e9[_0x2c9b('0x3f')][_0x2c9b('0x25')]);_0x58685b[_0x2c9b('0x24')]=qs['offset'](_0x4989e9[_0x2c9b('0x3f')]['offset']);}_0x58685b[_0x2c9b('0x63')]=qs[_0x2c9b('0x48')](_0x4989e9[_0x2c9b('0x3f')][_0x2c9b('0x48')]);_0x58685b[_0x2c9b('0x49')]=qs[_0x2c9b('0x41')](_[_0x2c9b('0x64')](_0x4989e9[_0x2c9b('0x3f')],_0x2e428c[_0x2c9b('0x41')]));_0x58685b[_0x2c9b('0x49')]['VoiceQueueId']=_0x12687d['id'];if(_0x4989e9[_0x2c9b('0x3f')][_0x2c9b('0x30')]){_0x58685b[_0x2c9b('0x49')]=_[_0x2c9b('0x4b')](_0x58685b['where'],{'$or':_['map'](_0x58685b['attributes'],function(_0x30f054){var _0x4019a6={};_0x4019a6[_0x30f054]={'$like':'%'+_0x4989e9[_0x2c9b('0x3f')][_0x2c9b('0x30')]+'%'};return _0x4019a6;})});}_0x58685b=_['merge']({},_0x58685b,_0x4989e9[_0x2c9b('0x4c')]);return db[_0x2c9b('0x6d')][_0x2c9b('0x26')]({'where':_0x58685b[_0x2c9b('0x49')]})[_0x2c9b('0x2a')](function(_0x11e610){_0x154d00[_0x2c9b('0x26')]=_0x11e610;if(_0x4989e9[_0x2c9b('0x3f')][_0x2c9b('0x52')]){_0x58685b[_0x2c9b('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x58685b);})[_0x2c9b('0x2a')](function(_0x395736){_0x154d00[_0x2c9b('0x66')]=_0x395736;return _0x154d00;});}})[_0x2c9b('0x2a')](respondWithFilteredResult(_0x27759d,_0x58685b))[_0x2c9b('0x50')](handleError(_0x27759d,null));};exports[_0x2c9b('0x6e')]=function(_0x4248a4,_0x3dd792,_0x12bb40){var _0x1e066f={};var _0x5eacca={};var _0x31ddea;var _0x12f979;return db['VoiceQueue'][_0x2c9b('0x68')]({'where':{'id':_0x4248a4[_0x2c9b('0x51')]['id']}})['then'](handleEntityNotFound(_0x3dd792,null))[_0x2c9b('0x2a')](function(_0x4220b3){if(_0x4220b3){_0x31ddea=_0x4220b3;_0x5eacca['model']=_[_0x2c9b('0x40')](db[_0x2c9b('0x6f')][_0x2c9b('0x3b')]);_0x5eacca[_0x2c9b('0x3f')]=_[_0x2c9b('0x40')](_0x4248a4[_0x2c9b('0x3f')]);_0x5eacca['filters']=_[_0x2c9b('0x42')](_0x5eacca['model'],_0x5eacca[_0x2c9b('0x3f')]);_0x1e066f[_0x2c9b('0x43')]=_[_0x2c9b('0x42')](_0x5eacca[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x4248a4[_0x2c9b('0x3f')]['fields']));_0x1e066f[_0x2c9b('0x43')]=_0x1e066f[_0x2c9b('0x43')][_0x2c9b('0x45')]?_0x1e066f[_0x2c9b('0x43')]:_0x5eacca['model'];_0x1e066f['order']=qs[_0x2c9b('0x48')](_0x4248a4[_0x2c9b('0x3f')]['sort']);_0x1e066f[_0x2c9b('0x49')]=qs[_0x2c9b('0x41')](_[_0x2c9b('0x64')](_0x4248a4[_0x2c9b('0x3f')],_0x5eacca[_0x2c9b('0x41')]));if(_0x4248a4[_0x2c9b('0x3f')][_0x2c9b('0x30')]){_0x1e066f[_0x2c9b('0x49')]=_[_0x2c9b('0x4b')](_0x1e066f[_0x2c9b('0x49')],{'$or':_[_0x2c9b('0x31')](_0x1e066f[_0x2c9b('0x43')],function(_0x71d521){var _0x2f7eef={};_0x2f7eef[_0x71d521]={'$like':'%'+_0x4248a4['query'][_0x2c9b('0x30')]+'%'};return _0x2f7eef;})});}_0x1e066f=_[_0x2c9b('0x4b')]({},_0x1e066f,_0x4248a4[_0x2c9b('0x4c')]);return _0x31ddea['getTeams'](_0x1e066f);}})[_0x2c9b('0x2a')](function(_0x558525){if(_0x558525){_0x12f979=_0x558525[_0x2c9b('0x45')];if(!_0x4248a4[_0x2c9b('0x3f')][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x1e066f[_0x2c9b('0x25')]=qs['limit'](_0x4248a4[_0x2c9b('0x3f')][_0x2c9b('0x25')]);_0x1e066f['offset']=qs['offset'](_0x4248a4[_0x2c9b('0x3f')][_0x2c9b('0x24')]);}return _0x31ddea[_0x2c9b('0x6e')](_0x1e066f);}})['then'](function(_0x17b3d7){if(_0x17b3d7){return _0x17b3d7?{'count':_0x12f979,'rows':_0x17b3d7}:null;}})['then'](respondWithResult(_0x3dd792,null))[_0x2c9b('0x50')](handleError(_0x3dd792,null));};exports[_0x2c9b('0x70')]=function(_0x55ddb7,_0x11a6d5,_0x2dfd6b){var _0x411565=_0x55ddb7[_0x2c9b('0x5f')][_0x2c9b('0x71')];var _0x3cddbb=_[_0x2c9b('0x31')](_0x411565,'id');return db['Team'][_0x2c9b('0x4f')]({'where':{'id':_0x3cddbb},'attributes':['id'],'include':[{'model':db[_0x2c9b('0x72')],'as':_0x2c9b('0x73'),'attributes':['id',_0x2c9b('0x36'),'online',_0x2c9b('0x74'),_0x2c9b('0x75')],'raw':!![]}]})[_0x2c9b('0x2a')](function(_0x560b85){if(_0x560b85){var _0x4496ba=_['flatMap'](_0x560b85,function(_0xd02b4){var _0x5c12fd=_0xd02b4[_0x2c9b('0x2c')]({'plain':!![]});_0x5c12fd[_0x2c9b('0x73')][_0x2c9b('0x76')](function(_0x2d7901){_0x2d7901[_0x2c9b('0x77')]=_['find'](_0x411565,{'id':_0x5c12fd['id']})[_0x2c9b('0x77')];});return _0x5c12fd['Agents'];});return db['VoiceQueue'][_0x2c9b('0x35')]({'where':{'id':_0x55ddb7[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](function(_0x15081f){return db['sequelize']['transaction'](function(_0x2d82d7){return _0x15081f['addTeams'](_0x3cddbb,{'transaction':_0x2d82d7})[_0x2c9b('0x2a')](function(){return BPromise['each'](_0x411565,function(_0x1d4e50){return db['TeamVoiceQueue'][_0x2c9b('0x78')]({'TeamId':_0x1d4e50['id'],'VoiceQueueId':_0x55ddb7[_0x2c9b('0x51')]['id'],'penalty':_0x1d4e50['penalty']},{'transaction':_0x2d82d7});});})[_0x2c9b('0x2a')](function(){return BPromise['each'](_0x4496ba,function(_0x332231){return db[_0x2c9b('0x79')][_0x2c9b('0x7a')]({'where':{'UserId':_0x332231['id'],'VoiceQueueId':_0x55ddb7[_0x2c9b('0x51')]['id']},'defaults':{'penalty':_0x332231[_0x2c9b('0x77')]},'transaction':_0x2d82d7});});})[_0x2c9b('0x2a')](function(){return BPromise[_0x2c9b('0x7b')](_['filter'](_0x4496ba,{'online':!![]}),function(_0x2299cf){return db[_0x2c9b('0x7c')][_0x2c9b('0x78')]({'membername':_0x2299cf[_0x2c9b('0x36')],'UserId':_0x2299cf['id'],'queue_name':_0x15081f['name'],'VoiceQueueId':_0x15081f['id'],'interface':_[_0x2c9b('0x7d')](_0x2299cf[_0x2c9b('0x75')])?util[_0x2c9b('0x7e')](_0x2c9b('0x7f'),_0x2299cf['name']):_0x2299cf[_0x2c9b('0x75')],'paused':_0x2299cf[_0x2c9b('0x74')]||![],'penalty':_0x2299cf[_0x2c9b('0x77')]},{'transaction':_0x2d82d7});});})[_0x2c9b('0x2a')](function(){_0x4496ba[_0x2c9b('0x76')](function(_0x5c5c1f){socket[_0x2c9b('0x80')]('userVoiceQueue:save',{'UserId':_0x5c5c1f['id'],'VoiceQueueId':_0x15081f['id']});});});});});}})[_0x2c9b('0x2a')](respondWithStatusCode(_0x11a6d5,null))['catch'](handleError(_0x11a6d5,null));};exports['removeTeams']=function(_0x161179,_0x497289,_0x4e540d){return db[_0x2c9b('0x6f')]['findAll']({'where':{'id':_0x161179['query'][_0x2c9b('0x81')]},'attributes':['id'],'include':[{'model':db[_0x2c9b('0x72')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2c9b('0x2a')](handleEntityNotFound(_0x497289,null))[_0x2c9b('0x2a')](function(_0x3dd580){var _0x35613f=_[_0x2c9b('0x31')](_0x3dd580,'id');var _0x1c370c=[];var _0x342048=[];var _0x12a3d4=squel['select']();_0x12a3d4['field'](_0x2c9b('0x82'))[_0x2c9b('0x83')](_0x2c9b('0x84'),'tq')[_0x2c9b('0x85')](_0x2c9b('0x86'),'ut',_0x2c9b('0x87'))[_0x2c9b('0x49')](_0x2c9b('0x88'),_0x161179[_0x2c9b('0x51')]['id']);for(var _0x280c59=0x0;_0x280c59<_0x3dd580[_0x2c9b('0x45')];_0x280c59+=0x1){let _0x2dc65d=_0x3dd580[_0x280c59];for(var _0x244340=0x0;_0x244340<_0x2dc65d[_0x2c9b('0x73')]['length'];_0x244340+=0x1){let _0x4be2d5=_0x2dc65d[_0x2c9b('0x73')][_0x244340];var _0x41185e=_0x12a3d4[_0x2c9b('0x5b')]();_0x41185e[_0x2c9b('0x49')](_0x2c9b('0x89'),_0x4be2d5['id']);_0x342048[_0x2c9b('0x8a')](db[_0x2c9b('0x8b')][_0x2c9b('0x3f')](_0x41185e[_0x2c9b('0x8c')](),{'type':db['sequelize'][_0x2c9b('0x8d')]['SELECT']})[_0x2c9b('0x2a')](function(_0x4be759){if(_0x4be759['length']===0x1){return _0x4be2d5['id'];}else{var _0x3a7519=_['every'](_[_0x2c9b('0x31')](_0x4be759,'TeamId'),function(_0x42aee3){return _['includes'](_0x35613f,_0x42aee3);});if(_0x3a7519){return _0x4be2d5['id'];}}}));}}return BPromise[_0x2c9b('0x8e')](_0x342048)[_0x2c9b('0x2a')](function(_0xecf1aa){_0x1c370c=_(_0x1c370c)['union'](_0xecf1aa)['compact']()[_0x2c9b('0x32')]();return db[_0x2c9b('0x4e')]['find']({'where':{'id':_0x161179[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](function(_0x431c85){return db[_0x2c9b('0x8b')][_0x2c9b('0x8f')](function(_0x450690){return _0x431c85['removeTeams'](_0x161179['query'][_0x2c9b('0x81')],{'transaction':_0x450690})[_0x2c9b('0x2a')](function(){if(!_[_0x2c9b('0x90')](_0x1c370c)){return _0x431c85[_0x2c9b('0x91')](_0x1c370c,{'transaction':_0x450690})['then'](function(){return db[_0x2c9b('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x161179[_0x2c9b('0x51')]['id'],'UserId':_0x1c370c},'transaction':_0x450690});});}})[_0x2c9b('0x2a')](function(){_0x1c370c[_0x2c9b('0x76')](function(_0x41bd56){socket[_0x2c9b('0x80')](_0x2c9b('0x92'),{'UserId':_0x41bd56,'VoiceQueueId':_0x431c85['id']});});});});});});})[_0x2c9b('0x2a')](respondWithStatusCode(_0x497289,null))[_0x2c9b('0x50')](handleError(_0x497289,null));};exports[_0x2c9b('0x93')]=function(_0x3d4379,_0x3125ac,_0x2d9842){var _0x41eb54,_0x5ccd7b;return db[_0x2c9b('0x4e')][_0x2c9b('0x35')]({'where':{'id':_0x3d4379[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x3125ac,null))['then'](function(_0x4cb7ad){if(_0x4cb7ad){_0x5ccd7b=_0x4cb7ad;return _0x4cb7ad[_0x2c9b('0x93')](_0x3d4379[_0x2c9b('0x5f')]['ids'],_[_0x2c9b('0x5c')](_0x3d4379[_0x2c9b('0x5f')],[_0x2c9b('0x81'),'id'])||{})[_0x2c9b('0x94')](function(_0x590a3f){for(var _0x39542f=0x0;_0x39542f<_0x3d4379['body'][_0x2c9b('0x81')][_0x2c9b('0x45')];_0x39542f+=0x1){socket[_0x2c9b('0x80')](_0x2c9b('0x95'),{'UserId':Number(_0x3d4379[_0x2c9b('0x5f')][_0x2c9b('0x81')][_0x39542f]),'VoiceQueueId':Number(_0x3d4379[_0x2c9b('0x51')]['id'])});}return _0x590a3f;});}})[_0x2c9b('0x2a')](function(_0x3d7345){_0x41eb54=_0x3d7345||[];if(_0x5ccd7b){return db[_0x2c9b('0x72')][_0x2c9b('0x4f')]({'where':{'id':_0x3d4379[_0x2c9b('0x5f')][_0x2c9b('0x81')]},'attributes':['id','name',_0x2c9b('0x96'),_0x2c9b('0x74'),_0x2c9b('0x75')],'raw':!![]});}})[_0x2c9b('0x2a')](function(_0xbf15e4){if(!_[_0x2c9b('0x90')](_0xbf15e4)){var _0x539b7e=[];for(var _0x2a5a60=0x0;_0x2a5a60<_0xbf15e4[_0x2c9b('0x45')];_0x2a5a60++){if(_0xbf15e4[_0x2a5a60]['online']){_0x539b7e[_0x2c9b('0x8a')](db['UserVoiceQueueRt']['upsert']({'membername':_0xbf15e4[_0x2a5a60]['name'],'UserId':_0xbf15e4[_0x2a5a60]['id'],'queue_name':_0x5ccd7b[_0x2c9b('0x36')],'VoiceQueueId':_0x5ccd7b['id'],'interface':_[_0x2c9b('0x7d')](_0xbf15e4[_0x2a5a60][_0x2c9b('0x75')])?util[_0x2c9b('0x7e')](_0x2c9b('0x7f'),_0xbf15e4[_0x2a5a60]['name']):_0xbf15e4[_0x2a5a60]['interface'],'paused':_0xbf15e4[_0x2a5a60]['voicePause']||![],'penalty':_0x3d4379[_0x2c9b('0x5f')][_0x2c9b('0x77')]||0x0}));}}return BPromise[_0x2c9b('0x8e')](_0x539b7e);}})['then'](function(){return _0x41eb54;})[_0x2c9b('0x2a')](respondWithResult(_0x3125ac,null))['catch'](handleError(_0x3125ac,null));};exports[_0x2c9b('0x91')]=function(_0xfa61c4,_0x33d068,_0x350e40){return db[_0x2c9b('0x4e')]['find']({'where':{'id':_0xfa61c4['params']['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x33d068,null))[_0x2c9b('0x2a')](function(_0x2be22d){if(_0x2be22d){return _0x2be22d[_0x2c9b('0x91')](_0xfa61c4[_0x2c9b('0x3f')][_0x2c9b('0x81')])[_0x2c9b('0x2a')](function(){if(_[_0x2c9b('0x97')](_0xfa61c4[_0x2c9b('0x3f')][_0x2c9b('0x81')])){for(var _0x7abf3c=0x0;_0x7abf3c<_0xfa61c4[_0x2c9b('0x3f')][_0x2c9b('0x81')][_0x2c9b('0x45')];_0x7abf3c+=0x1){socket[_0x2c9b('0x80')](_0x2c9b('0x92'),{'UserId':Number(_0xfa61c4['query'][_0x2c9b('0x81')][_0x7abf3c]),'VoiceQueueId':Number(_0xfa61c4['params']['id'])});}}else{socket[_0x2c9b('0x80')](_0x2c9b('0x92'),{'UserId':Number(_0xfa61c4[_0x2c9b('0x3f')][_0x2c9b('0x81')]),'VoiceQueueId':Number(_0xfa61c4[_0x2c9b('0x51')]['id'])});}});}})[_0x2c9b('0x2a')](function(_0x58533){return db[_0x2c9b('0x7c')][_0x2c9b('0x2b')]({'where':{'VoiceQueueId':_0xfa61c4[_0x2c9b('0x51')]['id'],'UserId':_0xfa61c4['query'][_0x2c9b('0x81')]}})[_0x2c9b('0x2a')](function(){return _0x58533;});})[_0x2c9b('0x2a')](respondWithStatusCode(_0x33d068,null))['catch'](handleError(_0x33d068,null));};exports[_0x2c9b('0x98')]=function(_0x2dbf86,_0x267a21,_0x50e642){var _0x4448be={};var _0x52e69c={};var _0x56b10b;var _0x537c59;return db[_0x2c9b('0x4e')]['findOne']({'where':{'id':_0x2dbf86[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x267a21,null))[_0x2c9b('0x2a')](function(_0x4efd19){if(_0x4efd19){_0x56b10b=_0x4efd19;_0x52e69c[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x72')][_0x2c9b('0x3b')]);_0x52e69c[_0x2c9b('0x3f')]=_[_0x2c9b('0x40')](_0x2dbf86['query']);_0x52e69c[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x52e69c[_0x2c9b('0x3e')],_0x52e69c[_0x2c9b('0x3f')]);_0x4448be['attributes']=_[_0x2c9b('0x42')](_0x52e69c[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x2dbf86[_0x2c9b('0x3f')][_0x2c9b('0x44')]));_0x4448be[_0x2c9b('0x43')]=_0x4448be[_0x2c9b('0x43')][_0x2c9b('0x45')]?_0x4448be['attributes']:_0x52e69c['model'];_0x4448be[_0x2c9b('0x63')]=qs[_0x2c9b('0x48')](_0x2dbf86['query']['sort']);_0x4448be[_0x2c9b('0x49')]=qs[_0x2c9b('0x41')](_[_0x2c9b('0x64')](_0x2dbf86[_0x2c9b('0x3f')],_0x52e69c[_0x2c9b('0x41')]));if(_0x2dbf86[_0x2c9b('0x3f')][_0x2c9b('0x30')]){_0x4448be[_0x2c9b('0x49')]=_['merge'](_0x4448be[_0x2c9b('0x49')],{'$or':_[_0x2c9b('0x31')](_0x4448be[_0x2c9b('0x43')],function(_0x1b71de){var _0x335422={};_0x335422[_0x1b71de]={'$like':'%'+_0x2dbf86[_0x2c9b('0x3f')][_0x2c9b('0x30')]+'%'};return _0x335422;})});}_0x4448be=_['merge']({},_0x4448be,_0x2dbf86[_0x2c9b('0x4c')]);return _0x56b10b[_0x2c9b('0x98')](_0x4448be);}})[_0x2c9b('0x2a')](function(_0x1e8589){if(_0x1e8589){_0x537c59=_0x1e8589[_0x2c9b('0x45')];if(!_0x2dbf86[_0x2c9b('0x3f')][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x4448be[_0x2c9b('0x25')]=qs[_0x2c9b('0x25')](_0x2dbf86['query'][_0x2c9b('0x25')]);_0x4448be['offset']=qs[_0x2c9b('0x24')](_0x2dbf86[_0x2c9b('0x3f')][_0x2c9b('0x24')]);}return _0x56b10b[_0x2c9b('0x98')](_0x4448be);}})[_0x2c9b('0x2a')](function(_0x486dcc){if(_0x486dcc){return _0x486dcc?{'count':_0x537c59,'rows':_0x486dcc}:null;}})['then'](respondWithResult(_0x267a21,null))[_0x2c9b('0x50')](handleError(_0x267a21,null));};exports[_0x2c9b('0x99')]=function(_0x3f74bd,_0x555d7c,_0x1367b7){var _0x4ce663={};var _0x41beb4={};var _0xf5f1f6;var _0x4227b9;return db['VoiceQueue'][_0x2c9b('0x68')]({'where':{'id':_0x3f74bd[_0x2c9b('0x51')]['id']}})['then'](handleEntityNotFound(_0x555d7c,null))[_0x2c9b('0x2a')](function(_0x415849){if(_0x415849){_0xf5f1f6=_0x415849;_0x41beb4[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0x7c')][_0x2c9b('0x3b')]);_0x41beb4[_0x2c9b('0x3f')]=_['keys'](_0x3f74bd[_0x2c9b('0x3f')]);_0x41beb4[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x41beb4[_0x2c9b('0x3e')],_0x41beb4['query']);_0x4ce663[_0x2c9b('0x43')]=_[_0x2c9b('0x42')](_0x41beb4[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x3f74bd[_0x2c9b('0x3f')][_0x2c9b('0x44')]));_0x4ce663[_0x2c9b('0x43')]=_0x4ce663['attributes'][_0x2c9b('0x45')]?_0x4ce663['attributes']:_0x41beb4[_0x2c9b('0x3e')];_0x4ce663[_0x2c9b('0x63')]=qs[_0x2c9b('0x48')](_0x3f74bd[_0x2c9b('0x3f')]['sort']);_0x4ce663[_0x2c9b('0x49')]=qs['filters'](_[_0x2c9b('0x64')](_0x3f74bd[_0x2c9b('0x3f')],_0x41beb4[_0x2c9b('0x41')]));if(_0x3f74bd[_0x2c9b('0x3f')]['filter']){_0x4ce663[_0x2c9b('0x49')]=_[_0x2c9b('0x4b')](_0x4ce663[_0x2c9b('0x49')],{'$or':_[_0x2c9b('0x31')](_0x4ce663[_0x2c9b('0x43')],function(_0x1e62b4){var _0x4618a8={};_0x4618a8[_0x1e62b4]={'$like':'%'+_0x3f74bd['query'][_0x2c9b('0x30')]+'%'};return _0x4618a8;})});}_0x4ce663=_[_0x2c9b('0x4b')]({},_0x4ce663,_0x3f74bd[_0x2c9b('0x4c')]);return _0xf5f1f6[_0x2c9b('0x99')](_0x4ce663);}})['then'](function(_0x200bc9){if(_0x200bc9){_0x4227b9=_0x200bc9[_0x2c9b('0x45')];if(!_0x3f74bd['query'][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x4ce663[_0x2c9b('0x25')]=qs['limit'](_0x3f74bd[_0x2c9b('0x3f')]['limit']);_0x4ce663['offset']=qs['offset'](_0x3f74bd[_0x2c9b('0x3f')][_0x2c9b('0x24')]);}return _0xf5f1f6[_0x2c9b('0x99')](_0x4ce663);}})[_0x2c9b('0x2a')](function(_0x422f7c){return _0x422f7c?{'count':_0x4227b9,'rows':_0x422f7c}:null;})[_0x2c9b('0x2a')](respondWithResult(_0x555d7c,null))['catch'](handleError(_0x555d7c,null));};exports[_0x2c9b('0x9a')]=function(_0x3fb242,_0x43da55,_0x5383a5){var _0x1c7289={};var _0x356582={};var _0x59d750;var _0x539f41;return db[_0x2c9b('0x4e')][_0x2c9b('0x68')]({'where':{'id':_0x3fb242['params']['id']}})['then'](handleEntityNotFound(_0x43da55,null))[_0x2c9b('0x2a')](function(_0xf3fb3c){if(_0xf3fb3c){_0x59d750=_0xf3fb3c;_0x356582[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db['CmList']['rawAttributes']);_0x356582['query']=_[_0x2c9b('0x40')](_0x3fb242[_0x2c9b('0x3f')]);_0x356582['filters']=_[_0x2c9b('0x42')](_0x356582[_0x2c9b('0x3e')],_0x356582['query']);_0x1c7289[_0x2c9b('0x43')]=_['intersection'](_0x356582[_0x2c9b('0x3e')],qs['fields'](_0x3fb242[_0x2c9b('0x3f')][_0x2c9b('0x44')]));_0x1c7289[_0x2c9b('0x43')]=_0x1c7289['attributes']['length']?_0x1c7289['attributes']:_0x356582['model'];_0x1c7289[_0x2c9b('0x63')]=qs[_0x2c9b('0x48')](_0x3fb242[_0x2c9b('0x3f')]['sort']);_0x1c7289['where']=qs[_0x2c9b('0x41')](_[_0x2c9b('0x64')](_0x3fb242[_0x2c9b('0x3f')],_0x356582[_0x2c9b('0x41')]));if(_0x3fb242['query'][_0x2c9b('0x30')]){_0x1c7289['where']=_[_0x2c9b('0x4b')](_0x1c7289['where'],{'$or':_[_0x2c9b('0x31')](_0x1c7289[_0x2c9b('0x43')],function(_0x136ec2){var _0x31a33d={};_0x31a33d[_0x136ec2]={'$like':'%'+_0x3fb242['query'][_0x2c9b('0x30')]+'%'};return _0x31a33d;})});}_0x1c7289=_['merge']({},_0x1c7289,_0x3fb242['options']);return _0x59d750[_0x2c9b('0x9a')](_0x1c7289);}})[_0x2c9b('0x2a')](function(_0x429112){if(_0x429112){_0x539f41=_0x429112[_0x2c9b('0x45')];if(!_0x3fb242[_0x2c9b('0x3f')][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x1c7289['limit']=qs['limit'](_0x3fb242[_0x2c9b('0x3f')][_0x2c9b('0x25')]);_0x1c7289[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x3fb242[_0x2c9b('0x3f')][_0x2c9b('0x24')]);}return _0x59d750[_0x2c9b('0x9a')](_0x1c7289);}})[_0x2c9b('0x2a')](function(_0x539c64){if(_0x539c64){return _0x539c64?{'count':_0x539f41,'rows':_0x539c64}:null;}})[_0x2c9b('0x2a')](respondWithResult(_0x43da55,null))[_0x2c9b('0x50')](handleError(_0x43da55,null));};exports[_0x2c9b('0x9b')]=function(_0x4cd754,_0x541cbc,_0x462e91){var _0x45ceb2,_0x1e46f8;return db[_0x2c9b('0x4e')]['find']({'where':{'id':_0x4cd754[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x541cbc,null))[_0x2c9b('0x2a')](function(_0x3c3230){if(_0x3c3230){_0x1e46f8=_0x3c3230;return _0x3c3230['addLists'](_0x4cd754[_0x2c9b('0x5f')][_0x2c9b('0x81')],_['omit'](_0x4cd754[_0x2c9b('0x5f')],[_0x2c9b('0x81'),'id'])||{});}return null;})['spread'](function(_0x293d4e){var _0x320a25;_0x45ceb2=_0x293d4e||[];var _0x22b066=[];if(_0x293d4e){for(var _0x17ea2b=0x0;_0x17ea2b<_0x293d4e[_0x2c9b('0x45')];_0x17ea2b+=0x1){var _0x4c5e11=_0x293d4e[_0x17ea2b][_0x2c9b('0x2c')]({'plain':!![]});_0x1e46f8['dialCheckDuplicateType']=_0x4cd754[_0x2c9b('0x5f')][_0x2c9b('0x9c')]?_0x4cd754[_0x2c9b('0x5f')]['dialCheckDuplicateType']:_0x1e46f8[_0x2c9b('0x9c')];switch(_0x1e46f8[_0x2c9b('0x9c')]){case _0x2c9b('0x9d'):_0x320a25=squel[_0x2c9b('0x9e')]()['into']('cm_hopper')[_0x2c9b('0x9f')](['phone','scheduledAt',_0x2c9b('0xa0'),_0x2c9b('0xa1'),_0x2c9b('0x65'),'createdAt',_0x2c9b('0x5e')],squel[_0x2c9b('0xa2')]()['field']('phone',_0x2c9b('0xa3'))['field']('NOW()',_0x2c9b('0xa4'))[_0x2c9b('0xa5')]('id',_0x2c9b('0xa0'))[_0x2c9b('0xa5')](_0x4c5e11['CmListId'][_0x2c9b('0x8c')](),_0x2c9b('0xa1'))[_0x2c9b('0xa5')](_0x4cd754[_0x2c9b('0x51')]['id']['toString'](),'VoiceQueueId')['field'](_0x2c9b('0xa6'),_0x2c9b('0x5d'))[_0x2c9b('0xa5')](_0x2c9b('0xa6'),_0x2c9b('0x5e'))['from']('cm_contacts')[_0x2c9b('0x49')](_0x2c9b('0xa7'))['where'](_0x2c9b('0xa8'),_0x4c5e11[_0x2c9b('0xa9')][_0x2c9b('0x8c')]())[_0x2c9b('0x49')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x2c9b('0xaa'),squel[_0x2c9b('0xa2')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x2c9b('0x83')](_0x2c9b('0xab'))[_0x2c9b('0x49')](_0x2c9b('0x88'),_0x4cd754[_0x2c9b('0x51')]['id'][_0x2c9b('0x8c')]()))[_0x2c9b('0x49')](_0x2c9b('0xaa'),squel[_0x2c9b('0xa2')]()[_0x2c9b('0xa5')](_0x2c9b('0xac'))[_0x2c9b('0x83')](_0x2c9b('0xad'))['where'](_0x2c9b('0x88'),_0x4cd754[_0x2c9b('0x51')]['id']['toString']())))[_0x2c9b('0x8c')]();break;case'onlyIfOpen':_0x320a25=squel[_0x2c9b('0x9e')]()['into']('cm_hopper')[_0x2c9b('0x9f')](['phone',_0x2c9b('0xa4'),_0x2c9b('0xa0'),_0x2c9b('0xa1'),'VoiceQueueId','createdAt','updatedAt'],squel[_0x2c9b('0xa2')]()[_0x2c9b('0xa5')](_0x2c9b('0xa3'),_0x2c9b('0xa3'))['field']('NOW()',_0x2c9b('0xa4'))[_0x2c9b('0xa5')]('id',_0x2c9b('0xa0'))[_0x2c9b('0xa5')](_0x4c5e11[_0x2c9b('0xa9')][_0x2c9b('0x8c')](),'ListId')[_0x2c9b('0xa5')](_0x4cd754[_0x2c9b('0x51')]['id'][_0x2c9b('0x8c')](),_0x2c9b('0x65'))[_0x2c9b('0xa5')](_0x2c9b('0xa6'),_0x2c9b('0x5d'))[_0x2c9b('0xa5')](_0x2c9b('0xa6'),_0x2c9b('0x5e'))[_0x2c9b('0x83')](_0x2c9b('0xae'))['where'](_0x2c9b('0xa7'))['where'](_0x2c9b('0xa8'),_0x4c5e11['CmListId'][_0x2c9b('0x8c')]())[_0x2c9b('0x49')](_0x2c9b('0xaf'))[_0x2c9b('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2c9b('0xa2')]()['field'](_0x2c9b('0xac'))[_0x2c9b('0x83')](_0x2c9b('0xad'))['where'](_0x2c9b('0x88'),_0x4cd754[_0x2c9b('0x51')]['id']['toString']())))[_0x2c9b('0x8c')]();break;default:_0x320a25=squel['insert']()[_0x2c9b('0xb0')](_0x2c9b('0xad'))['fromQuery']([_0x2c9b('0xa3'),'scheduledAt','ContactId',_0x2c9b('0xa1'),_0x2c9b('0x65'),_0x2c9b('0x5d'),'updatedAt'],squel[_0x2c9b('0xa2')]()[_0x2c9b('0xa5')](_0x2c9b('0xa3'),'phone')[_0x2c9b('0xa5')](_0x2c9b('0xa6'),'scheduledAt')['field']('id',_0x2c9b('0xa0'))[_0x2c9b('0xa5')](_0x4c5e11[_0x2c9b('0xa9')][_0x2c9b('0x8c')](),'ListId')[_0x2c9b('0xa5')](_0x4cd754[_0x2c9b('0x51')]['id']['toString'](),_0x2c9b('0x65'))[_0x2c9b('0xa5')](_0x2c9b('0xa6'),'createdAt')[_0x2c9b('0xa5')](_0x2c9b('0xa6'),_0x2c9b('0x5e'))[_0x2c9b('0x83')](_0x2c9b('0xae'))[_0x2c9b('0x49')](_0x2c9b('0xa7'))[_0x2c9b('0x49')](_0x2c9b('0xa8'),_0x4c5e11[_0x2c9b('0xa9')][_0x2c9b('0x8c')]())[_0x2c9b('0x49')](_0x2c9b('0xaf')))[_0x2c9b('0x8c')]();}_0x22b066[_0x2c9b('0x8a')](db[_0x2c9b('0x8b')][_0x2c9b('0x3f')](_0x320a25));}return BPromise['all'](_0x22b066);}})['then'](function(){return _0x45ceb2;})['then'](respondWithResult(_0x541cbc,null))['catch'](handleError(_0x541cbc,null));};exports['removeLists']=function(_0xe7ab3e,_0x4fc60f,_0x4821b3){return db[_0x2c9b('0x4e')][_0x2c9b('0x35')]({'where':{'id':_0xe7ab3e[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x4fc60f,null))[_0x2c9b('0x2a')](function(_0x31f00f){if(_0x31f00f){return _0x31f00f['removeLists'](_0xe7ab3e[_0x2c9b('0x3f')][_0x2c9b('0x81')]);}})[_0x2c9b('0x2a')](function(_0x46ae03){if(_0x46ae03){return db['CmHopper'][_0x2c9b('0x2b')]({'where':{'ListId':_0xe7ab3e[_0x2c9b('0x3f')][_0x2c9b('0x81')],'VoiceQueueId':_0xe7ab3e[_0x2c9b('0x51')]['id']}})['then'](function(){return _0x46ae03;});}})['then'](respondWithStatusCode(_0x4fc60f,null))[_0x2c9b('0x50')](handleError(_0x4fc60f,null));};exports[_0x2c9b('0xb1')]=function(_0x41851f,_0x1352ce,_0x3edae5){var _0x4383e8={};var _0x5cbdf7={};var _0x6b5009;var _0x2accb3;return db[_0x2c9b('0x4e')][_0x2c9b('0x68')]({'where':{'id':_0x41851f[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x1352ce,null))[_0x2c9b('0x2a')](function(_0x358c38){if(_0x358c38){_0x6b5009=_0x358c38;_0x5cbdf7[_0x2c9b('0x3e')]=_[_0x2c9b('0x40')](db[_0x2c9b('0xb2')][_0x2c9b('0x3b')]);_0x5cbdf7[_0x2c9b('0x3f')]=_[_0x2c9b('0x40')](_0x41851f[_0x2c9b('0x3f')]);_0x5cbdf7[_0x2c9b('0x41')]=_[_0x2c9b('0x42')](_0x5cbdf7[_0x2c9b('0x3e')],_0x5cbdf7['query']);_0x4383e8['attributes']=_[_0x2c9b('0x42')](_0x5cbdf7[_0x2c9b('0x3e')],qs[_0x2c9b('0x44')](_0x41851f['query']['fields']));_0x4383e8['attributes']=_0x4383e8[_0x2c9b('0x43')][_0x2c9b('0x45')]?_0x4383e8['attributes']:_0x5cbdf7[_0x2c9b('0x3e')];_0x4383e8[_0x2c9b('0x63')]=qs[_0x2c9b('0x48')](_0x41851f[_0x2c9b('0x3f')][_0x2c9b('0x48')]);_0x4383e8[_0x2c9b('0x49')]=qs['filters'](_[_0x2c9b('0x64')](_0x41851f[_0x2c9b('0x3f')],_0x5cbdf7['filters']));if(_0x41851f['query'][_0x2c9b('0x30')]){_0x4383e8[_0x2c9b('0x49')]=_[_0x2c9b('0x4b')](_0x4383e8[_0x2c9b('0x49')],{'$or':_['map'](_0x4383e8[_0x2c9b('0x43')],function(_0x2a9b16){var _0x3abb13={};_0x3abb13[_0x2a9b16]={'$like':'%'+_0x41851f['query'][_0x2c9b('0x30')]+'%'};return _0x3abb13;})});}_0x4383e8=_['merge']({},_0x4383e8,_0x41851f[_0x2c9b('0x4c')]);return _0x6b5009[_0x2c9b('0xb1')](_0x4383e8);}})[_0x2c9b('0x2a')](function(_0x274614){if(_0x274614){_0x2accb3=_0x274614[_0x2c9b('0x45')];if(!_0x41851f[_0x2c9b('0x3f')][_0x2c9b('0x46')](_0x2c9b('0x47'))){_0x4383e8[_0x2c9b('0x25')]=qs['limit'](_0x41851f[_0x2c9b('0x3f')][_0x2c9b('0x25')]);_0x4383e8['offset']=qs[_0x2c9b('0x24')](_0x41851f[_0x2c9b('0x3f')][_0x2c9b('0x24')]);}return _0x6b5009[_0x2c9b('0xb1')](_0x4383e8);}})[_0x2c9b('0x2a')](function(_0x368560){if(_0x368560){return _0x368560?{'count':_0x2accb3,'rows':_0x368560}:null;}})[_0x2c9b('0x2a')](respondWithResult(_0x1352ce,null))[_0x2c9b('0x50')](handleError(_0x1352ce,null));};exports[_0x2c9b('0xb3')]=function(_0x19e3aa,_0x35f3aa,_0x12ee62){var _0x20c2c3,_0x27a2b4;return db[_0x2c9b('0x4e')][_0x2c9b('0x35')]({'where':{'id':_0x19e3aa[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x35f3aa,null))[_0x2c9b('0x2a')](function(_0x303c9a){if(_0x303c9a){_0x27a2b4=_0x303c9a;return _0x303c9a[_0x2c9b('0xb3')](_0x19e3aa[_0x2c9b('0x5f')][_0x2c9b('0x81')],_[_0x2c9b('0x5c')](_0x19e3aa[_0x2c9b('0x5f')],['ids','id'])||{});}return null;})[_0x2c9b('0x94')](function(_0x222233){var _0x19982b;_0x20c2c3=_0x222233||[];var _0x2eaecb=[];if(_0x222233){for(var _0x3c0fb5=0x0;_0x3c0fb5<_0x222233[_0x2c9b('0x45')];_0x3c0fb5+=0x1){var _0x17350e=_0x222233[_0x3c0fb5]['get']({'plain':!![]});_0x19982b=squel[_0x2c9b('0x9e')]()[_0x2c9b('0xb0')](_0x2c9b('0xb4'))[_0x2c9b('0x9f')]([_0x2c9b('0xa3'),_0x2c9b('0xa0'),_0x2c9b('0xa1'),_0x2c9b('0x65'),'createdAt',_0x2c9b('0x5e')],squel[_0x2c9b('0xa2')]()['field'](_0x2c9b('0xa3'),_0x2c9b('0xa3'))[_0x2c9b('0xa5')]('id',_0x2c9b('0xa0'))[_0x2c9b('0xa5')](_0x17350e[_0x2c9b('0xa9')][_0x2c9b('0x8c')](),_0x2c9b('0xa1'))[_0x2c9b('0xa5')](_0x19e3aa[_0x2c9b('0x51')]['id'][_0x2c9b('0x8c')](),'VoiceQueueId')['field'](_0x2c9b('0xa6'),_0x2c9b('0x5d'))['field'](_0x2c9b('0xa6'),'updatedAt')[_0x2c9b('0x83')](_0x2c9b('0xae'))['where'](_0x2c9b('0xa7'))['where'](_0x2c9b('0xa8'),_0x17350e[_0x2c9b('0xa9')]['toString']())[_0x2c9b('0x49')](_0x2c9b('0xaf')))[_0x2c9b('0x8c')]();_0x2eaecb[_0x2c9b('0x8a')](db[_0x2c9b('0x8b')][_0x2c9b('0x3f')](_0x19982b));}return BPromise[_0x2c9b('0x8e')](_0x2eaecb);}})[_0x2c9b('0x2a')](function(){return _0x20c2c3;})[_0x2c9b('0x2a')](respondWithResult(_0x35f3aa,null))[_0x2c9b('0x50')](handleError(_0x35f3aa,null));};exports[_0x2c9b('0xb5')]=function(_0x2e65b0,_0x2e63fa,_0x3b18de){return db[_0x2c9b('0x4e')][_0x2c9b('0x35')]({'where':{'id':_0x2e65b0['params']['id']}})[_0x2c9b('0x2a')](handleEntityNotFound(_0x2e63fa,null))[_0x2c9b('0x2a')](function(_0x4bab6f){if(_0x4bab6f){return _0x4bab6f['removeBlackLists'](_0x2e65b0['query'][_0x2c9b('0x81')]);}})[_0x2c9b('0x2a')](function(_0x172099){if(_0x172099){return db[_0x2c9b('0x6d')][_0x2c9b('0x2b')]({'where':{'ListId':_0x2e65b0[_0x2c9b('0x3f')][_0x2c9b('0x81')],'VoiceQueueId':_0x2e65b0[_0x2c9b('0x51')]['id']}})[_0x2c9b('0x2a')](function(){return _0x172099;});}})[_0x2c9b('0x2a')](respondWithStatusCode(_0x2e63fa,null))[_0x2c9b('0x50')](handleError(_0x2e63fa,null));}; \ No newline at end of file +var _0x4cbe=['getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','QueueCampaigns','outbound','value','includes','find','type','name','UserProfileResource','destroy','error','stack','send','index','map','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','inbound','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','getHoppers','sort','CmHopper','findAll','getHopperHistories','findOne','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','User','Agents','voicePause','flatMap','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','online','interface','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','removeLists'];(function(_0x3bc425,_0x57e53b){var _0x1f29bf=function(_0x340b9b){while(--_0x340b9b){_0x3bc425['push'](_0x3bc425['shift']());}};_0x1f29bf(++_0x57e53b);}(_0x4cbe,0x16e));var _0xe4cb=function(_0x1fc514,_0x2fce6a){_0x1fc514=_0x1fc514-0x0;var _0x118496=_0x4cbe[_0x1fc514];return _0x118496;};'use strict';var emlformat=require(_0xe4cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4cb('0x1'));var jsonpatch=require(_0xe4cb('0x2'));var rp=require(_0xe4cb('0x3'));var moment=require(_0xe4cb('0x4'));var BPromise=require(_0xe4cb('0x5'));var Mustache=require(_0xe4cb('0x6'));var util=require(_0xe4cb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe4cb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4cb('0x9'));var _=require(_0xe4cb('0xa'));var squel=require(_0xe4cb('0xb'));var crypto=require('crypto');var jsforce=require(_0xe4cb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe4cb('0x8'));var querystring=require(_0xe4cb('0xd'));var Papa=require('papaparse');var Redis=require(_0xe4cb('0xe'));var authService=require(_0xe4cb('0xf'));var qs=require(_0xe4cb('0x10'));var as=require(_0xe4cb('0x11'));var hardwareService=require(_0xe4cb('0x12'));var logger=require(_0xe4cb('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe4cb('0x14'));var db=require(_0xe4cb('0x15'))['db'];config[_0xe4cb('0x16')]=_[_0xe4cb('0x17')](config[_0xe4cb('0x16')],{'host':_0xe4cb('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe4cb('0x16')]));require(_0xe4cb('0x19'))['register'](socket);function respondWithStatusCode(_0x290564,_0x32d5c4){_0x32d5c4=_0x32d5c4||0xcc;return function(_0x560d90){if(_0x560d90){return _0x290564[_0xe4cb('0x1a')](_0x32d5c4);}return _0x290564[_0xe4cb('0x1b')](_0x32d5c4)[_0xe4cb('0x1c')]();};}function respondWithResult(_0x220874,_0x4c1591){_0x4c1591=_0x4c1591||0xc8;return function(_0x36e1f3){if(_0x36e1f3){return _0x220874[_0xe4cb('0x1b')](_0x4c1591)[_0xe4cb('0x1d')](_0x36e1f3);}};}function respondWithFilteredResult(_0xc462ee,_0x2561e9){return function(_0x1e51e9){if(_0x1e51e9){var _0x305225=typeof _0x2561e9[_0xe4cb('0x1e')]===_0xe4cb('0x1f')&&typeof _0x2561e9[_0xe4cb('0x20')]===_0xe4cb('0x1f');var _0x32bf88=_0x1e51e9[_0xe4cb('0x21')];var _0x46c123=_0x305225?0x0:_0x2561e9['offset'];var _0x125c68=_0x305225?_0x1e51e9[_0xe4cb('0x21')]:_0x2561e9[_0xe4cb('0x1e')]+_0x2561e9[_0xe4cb('0x20')];var _0x57f84e;if(_0x125c68>=_0x32bf88){_0x125c68=_0x32bf88;_0x57f84e=0xc8;}else{_0x57f84e=0xce;}_0xc462ee[_0xe4cb('0x1b')](_0x57f84e);return _0xc462ee[_0xe4cb('0x22')](_0xe4cb('0x23'),_0x46c123+'-'+_0x125c68+'/'+_0x32bf88)[_0xe4cb('0x1d')](_0x1e51e9);}return null;};}function patchUpdates(_0x509fad){return function(_0x413756){try{jsonpatch[_0xe4cb('0x24')](_0x413756,_0x509fad,!![]);}catch(_0xc68479){return BPromise['reject'](_0xc68479);}return _0x413756[_0xe4cb('0x25')]();};}function saveUpdates(_0x49a119,_0x330506){return function(_0x598fea){if(_0x598fea){return _0x598fea[_0xe4cb('0x26')](_0x49a119)[_0xe4cb('0x27')](function(_0x4bf077){return _0x4bf077;});}return null;};}function removeEntity(_0x232519,_0x11ee08){return function(_0x94fd61){if(_0x94fd61){return _0x94fd61['destroy']()[_0xe4cb('0x27')](function(){var _0x4f0632=_0x94fd61[_0xe4cb('0x28')]({'plain':!![]});var _0x48bfce=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0xe4cb('0x29'),'value':_0xe4cb('0x2a'),'ignore':![]}];var _0x5c5556=_(_0x48bfce)['filter']('ignore')['map']('value')[_0xe4cb('0x2b')]();if(_[_0xe4cb('0x2c')](_0x5c5556,_0x4f0632['type'])){return;}var _0x27ede8=_[_0xe4cb('0x2d')](_0x48bfce,['value',_0x4f0632[_0xe4cb('0x2e')]])[_0xe4cb('0x2f')];return db[_0xe4cb('0x30')][_0xe4cb('0x31')]({'where':{'type':_0x27ede8,'resourceId':_0x4f0632['id']}})[_0xe4cb('0x27')](function(){return _0x94fd61;});})['then'](function(){_0x232519['status'](0xcc)[_0xe4cb('0x1c')]();});}};}function handleEntityNotFound(_0x76916d,_0x54395b){return function(_0x3321a7){if(!_0x3321a7){_0x76916d['sendStatus'](0x194);}return _0x3321a7;};}function handleError(_0x49908b,_0x113e6b){_0x113e6b=_0x113e6b||0x1f4;return function(_0x15dd0c){logger[_0xe4cb('0x32')](_0x15dd0c[_0xe4cb('0x33')]);if(_0x15dd0c[_0xe4cb('0x2f')]){delete _0x15dd0c[_0xe4cb('0x2f')];}_0x49908b['status'](_0x113e6b)[_0xe4cb('0x34')](_0x15dd0c);};}exports[_0xe4cb('0x35')]=function(_0x45248e,_0x441cf8){var _0x2e4264={},_0x2c2656={},_0x527505={'count':0x0,'rows':[]};var _0x5432e0=_[_0xe4cb('0x36')](db[_0xe4cb('0x37')][_0xe4cb('0x38')],function(_0x42d2ce){return{'name':_0x42d2ce[_0xe4cb('0x39')],'type':_0x42d2ce['type'][_0xe4cb('0x3a')]};});_0x2c2656[_0xe4cb('0x3b')]=_['map'](_0x5432e0,_0xe4cb('0x2f'));_0x2c2656[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0x45248e[_0xe4cb('0x3c')]);_0x2c2656['filters']=_[_0xe4cb('0x3e')](_0x2c2656[_0xe4cb('0x3b')],_0x2c2656[_0xe4cb('0x3c')]);_0x2e4264[_0xe4cb('0x3f')]=_['intersection'](_0x2c2656[_0xe4cb('0x3b')],qs[_0xe4cb('0x40')](_0x45248e[_0xe4cb('0x3c')]['fields']));_0x2e4264[_0xe4cb('0x3f')]=_0x2e4264[_0xe4cb('0x3f')][_0xe4cb('0x41')]?_0x2e4264[_0xe4cb('0x3f')]:_0x2c2656['model'];if(!_0x45248e[_0xe4cb('0x3c')][_0xe4cb('0x42')](_0xe4cb('0x43'))){_0x2e4264[_0xe4cb('0x20')]=qs['limit'](_0x45248e[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x2e4264[_0xe4cb('0x1e')]=qs[_0xe4cb('0x1e')](_0x45248e[_0xe4cb('0x3c')][_0xe4cb('0x1e')]);}_0x2e4264[_0xe4cb('0x44')]=qs['sort'](_0x45248e[_0xe4cb('0x3c')]['sort']);_0x2e4264[_0xe4cb('0x45')]=qs[_0xe4cb('0x46')](_[_0xe4cb('0x47')](_0x45248e[_0xe4cb('0x3c')],_0x2c2656[_0xe4cb('0x46')]),_0x5432e0);if(_0x45248e[_0xe4cb('0x3c')][_0xe4cb('0x48')]){_0x2e4264[_0xe4cb('0x45')]=_[_0xe4cb('0x49')](_0x2e4264[_0xe4cb('0x45')],{'$or':_['map'](_0x5432e0,function(_0x1aa508){if(_0x1aa508[_0xe4cb('0x2e')]!==_0xe4cb('0x4a')){var _0x28547a={};_0x28547a[_0x1aa508['name']]={'$like':'%'+_0x45248e[_0xe4cb('0x3c')][_0xe4cb('0x48')]+'%'};return _0x28547a;}})});}_0x2e4264=_['merge']({},_0x2e4264,_0x45248e[_0xe4cb('0x4b')]);var _0x4b9516={'where':_0x2e4264[_0xe4cb('0x45')]};return db[_0xe4cb('0x37')]['count'](_0x4b9516)[_0xe4cb('0x27')](function(_0xcfcbe5){_0x527505[_0xe4cb('0x21')]=_0xcfcbe5;if(_0x45248e[_0xe4cb('0x3c')][_0xe4cb('0x4c')]){_0x2e4264[_0xe4cb('0x4d')]=[{'all':!![]}];}return db[_0xe4cb('0x37')]['findAll'](_0x2e4264);})['then'](function(_0x17c49f){_0x527505[_0xe4cb('0x4e')]=_0x17c49f;return _0x527505;})[_0xe4cb('0x27')](respondWithFilteredResult(_0x441cf8,_0x2e4264))['catch'](handleError(_0x441cf8,null));};exports['show']=function(_0x13c2ad,_0x3a0e00){var _0x46b002={'raw':![],'where':{'id':_0x13c2ad[_0xe4cb('0x4f')]['id']}},_0xc3e529={};_0xc3e529[_0xe4cb('0x3b')]=_[_0xe4cb('0x3d')](db[_0xe4cb('0x37')][_0xe4cb('0x38')]);_0xc3e529['query']=_['keys'](_0x13c2ad[_0xe4cb('0x3c')]);_0xc3e529['filters']=_[_0xe4cb('0x3e')](_0xc3e529[_0xe4cb('0x3b')],_0xc3e529[_0xe4cb('0x3c')]);_0x46b002[_0xe4cb('0x3f')]=_[_0xe4cb('0x3e')](_0xc3e529[_0xe4cb('0x3b')],qs['fields'](_0x13c2ad[_0xe4cb('0x3c')]['fields']));_0x46b002[_0xe4cb('0x3f')]=_0x46b002['attributes'][_0xe4cb('0x41')]?_0x46b002[_0xe4cb('0x3f')]:_0xc3e529['model'];if(_0x13c2ad[_0xe4cb('0x3c')][_0xe4cb('0x4c')]){_0x46b002[_0xe4cb('0x4d')]=[{'all':!![]}];}_0x46b002=_['merge']({},_0x46b002,_0x13c2ad[_0xe4cb('0x4b')]);return db[_0xe4cb('0x37')][_0xe4cb('0x2d')](_0x46b002)[_0xe4cb('0x27')](handleEntityNotFound(_0x3a0e00,null))[_0xe4cb('0x27')](respondWithResult(_0x3a0e00,null))[_0xe4cb('0x50')](handleError(_0x3a0e00,null));};exports[_0xe4cb('0x51')]=function(_0x186694,_0x5c8a7d){return db[_0xe4cb('0x37')][_0xe4cb('0x51')](_0x186694[_0xe4cb('0x52')],{})[_0xe4cb('0x27')](function(_0x10ff60){var _0x17f981=_0x186694[_0xe4cb('0x53')][_0xe4cb('0x28')]({'plain':!![]});if(!_0x17f981)throw new Error(_0xe4cb('0x54'));if(_0x17f981[_0xe4cb('0x55')]==='user'){var _0x59803=_0x10ff60[_0xe4cb('0x28')]({'plain':!![]});var _0x1b00a1=[{'name':_0xe4cb('0x56'),'value':_0xe4cb('0x57')},{'name':_0xe4cb('0x29'),'value':'outbound'}];var _0x1d7721=_[_0xe4cb('0x2d')](_0x1b00a1,[_0xe4cb('0x2b'),_0x59803['type']])[_0xe4cb('0x2f')];return db['UserProfileSection'][_0xe4cb('0x2d')]({'where':{'name':_0x1d7721,'userProfileId':_0x17f981[_0xe4cb('0x58')]},'raw':!![]})[_0xe4cb('0x27')](function(_0x79349){if(_0x79349&&_0x79349['autoAssociation']===0x0){return db[_0xe4cb('0x30')]['create']({'name':_0x59803[_0xe4cb('0x2f')],'resourceId':_0x59803['id'],'type':_0x79349[_0xe4cb('0x2f')],'sectionId':_0x79349['id']},{})['then'](function(){return _0x10ff60;});}else{return _0x10ff60;}})['catch'](function(_0x1cbc5e){logger[_0xe4cb('0x32')](_0xe4cb('0x59'),_0x1cbc5e);throw _0x1cbc5e;});}return _0x10ff60;})[_0xe4cb('0x27')](respondWithResult(_0x5c8a7d,0xc9))[_0xe4cb('0x50')](handleError(_0x5c8a7d,null));};exports[_0xe4cb('0x5a')]=function(_0x5b1a31,_0x14a05e){var _0x43deb2={'where':{'id':_0x5b1a31[_0xe4cb('0x4f')]['id']}},_0x52870e={};_0x52870e[_0xe4cb('0x3b')]=_[_0xe4cb('0x3d')](db[_0xe4cb('0x37')][_0xe4cb('0x38')]);_0x43deb2[_0xe4cb('0x3f')]=_[_0xe4cb('0x3e')](_0x52870e['model'],qs[_0xe4cb('0x40')](_0x5b1a31[_0xe4cb('0x3c')][_0xe4cb('0x40')]));_0x43deb2[_0xe4cb('0x3f')]=_0x43deb2[_0xe4cb('0x3f')][_0xe4cb('0x41')]?_0x43deb2[_0xe4cb('0x3f')]:_0x52870e[_0xe4cb('0x3b')];if(_0x5b1a31[_0xe4cb('0x3c')][_0xe4cb('0x4c')]){_0x43deb2[_0xe4cb('0x4d')]=[{'all':!![]}];}_0x43deb2=_[_0xe4cb('0x49')]({},_0x43deb2,_0x5b1a31[_0xe4cb('0x4b')]);return db[_0xe4cb('0x37')]['find'](_0x43deb2)['then'](handleEntityNotFound(_0x14a05e,null))[_0xe4cb('0x27')](function(_0x5edbf1){if(_0x5edbf1){var _0x2abe9d=_0x5edbf1[_0xe4cb('0x28')]({'plain':!![]});_0x2abe9d=qs[_0xe4cb('0x5b')](_0x2abe9d,['id',_0xe4cb('0x5c'),'updatedAt']);_0x5b1a31[_0xe4cb('0x52')]=_[_0xe4cb('0x5b')](_0x5b1a31[_0xe4cb('0x52')],['id',_0xe4cb('0x5c'),_0xe4cb('0x5d')]);return db['VoiceQueue'][_0xe4cb('0x51')](_['merge'](_0x2abe9d,_0x5b1a31[_0xe4cb('0x52')]),{'include':_0x5b1a31[_0xe4cb('0x3c')][_0xe4cb('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x173eb1){var _0x2e12ce=_0x5b1a31[_0xe4cb('0x53')][_0xe4cb('0x28')]({'plain':!![]});if(!_0x2e12ce)throw new Error(_0xe4cb('0x54'));if(_0x2e12ce[_0xe4cb('0x55')]==='user'){var _0x3f540e=_0x173eb1[_0xe4cb('0x28')]({'plain':!![]});var _0x36863a=[{'name':'VoiceQueues','value':_0xe4cb('0x57')},{'name':_0xe4cb('0x29'),'value':_0xe4cb('0x2a')}];var _0x22bd9a=_['find'](_0x36863a,['value',_0x3f540e[_0xe4cb('0x2e')]])['name'];return db['UserProfileSection'][_0xe4cb('0x2d')]({'where':{'name':_0x22bd9a,'userProfileId':_0x2e12ce[_0xe4cb('0x58')]},'raw':!![]})[_0xe4cb('0x27')](function(_0x2fff77){if(_0x2fff77&&_0x2fff77[_0xe4cb('0x5e')]===0x0){return db[_0xe4cb('0x30')][_0xe4cb('0x51')]({'name':_0x3f540e[_0xe4cb('0x2f')],'resourceId':_0x3f540e['id'],'type':_0x2fff77[_0xe4cb('0x2f')],'sectionId':_0x2fff77['id']},{})[_0xe4cb('0x27')](function(){return _0x173eb1;});}else{return _0x173eb1;}})[_0xe4cb('0x50')](function(_0x3ebc25){logger[_0xe4cb('0x32')](_0xe4cb('0x59'),_0x3ebc25);throw _0x3ebc25;});}return _0x173eb1;});}})[_0xe4cb('0x27')](respondWithResult(_0x14a05e,0xc9))[_0xe4cb('0x50')](handleError(_0x14a05e,null));};exports['update']=function(_0x2a4c49,_0x2c810f){if(_0x2a4c49[_0xe4cb('0x52')]['id']){delete _0x2a4c49[_0xe4cb('0x52')]['id'];}return db[_0xe4cb('0x37')][_0xe4cb('0x2d')]({'where':{'id':_0x2a4c49[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x2c810f,null))[_0xe4cb('0x27')](saveUpdates(_0x2a4c49[_0xe4cb('0x52')],null))[_0xe4cb('0x27')](respondWithResult(_0x2c810f,null))[_0xe4cb('0x50')](handleError(_0x2c810f,null));};exports['destroy']=function(_0x3b8e72,_0x350a32){return db[_0xe4cb('0x37')]['find']({'where':{'id':_0x3b8e72['params']['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x350a32,null))[_0xe4cb('0x27')](removeEntity(_0x350a32,null))[_0xe4cb('0x50')](handleError(_0x350a32,null));};exports[_0xe4cb('0x5f')]=function(_0x4b02a8,_0x51169f,_0x2cb64c){var _0x167644={'raw':![],'where':{}};var _0x388c71={};var _0x10ad63={'count':0x0,'rows':[]};return db[_0xe4cb('0x37')]['findOne']({'where':{'id':_0x4b02a8[_0xe4cb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x51169f,null))['then'](function(_0x456b02){if(_0x456b02){_0x388c71[_0xe4cb('0x3b')]=_['keys'](db['CmHopper']['rawAttributes']);_0x388c71[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0x4b02a8[_0xe4cb('0x3c')]);_0x388c71[_0xe4cb('0x46')]=_[_0xe4cb('0x3e')](_0x388c71[_0xe4cb('0x3b')],_0x388c71['query']);_0x167644[_0xe4cb('0x3f')]=_['intersection'](_0x388c71[_0xe4cb('0x3b')],qs[_0xe4cb('0x40')](_0x4b02a8[_0xe4cb('0x3c')]['fields']));_0x167644['attributes']=_0x167644[_0xe4cb('0x3f')][_0xe4cb('0x41')]?_0x167644[_0xe4cb('0x3f')]:_0x388c71[_0xe4cb('0x3b')];if(!_0x4b02a8[_0xe4cb('0x3c')][_0xe4cb('0x42')](_0xe4cb('0x43'))){_0x167644[_0xe4cb('0x20')]=qs[_0xe4cb('0x20')](_0x4b02a8[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x167644['offset']=qs[_0xe4cb('0x1e')](_0x4b02a8[_0xe4cb('0x3c')][_0xe4cb('0x1e')]);}_0x167644[_0xe4cb('0x44')]=qs[_0xe4cb('0x60')](_0x4b02a8[_0xe4cb('0x3c')][_0xe4cb('0x60')]);_0x167644[_0xe4cb('0x45')]=qs['filters'](_[_0xe4cb('0x47')](_0x4b02a8[_0xe4cb('0x3c')],_0x388c71['filters']));_0x167644['where']['VoiceQueueId']=_0x456b02['id'];if(_0x4b02a8['query'][_0xe4cb('0x48')]){_0x167644[_0xe4cb('0x45')]=_[_0xe4cb('0x49')](_0x167644[_0xe4cb('0x45')],{'$or':_[_0xe4cb('0x36')](_0x167644['attributes'],function(_0x16e2f1){var _0x59c54c={};_0x59c54c[_0x16e2f1]={'$like':'%'+_0x4b02a8['query']['filter']+'%'};return _0x59c54c;})});}_0x167644=_[_0xe4cb('0x49')]({},_0x167644,_0x4b02a8[_0xe4cb('0x4b')]);return db[_0xe4cb('0x61')][_0xe4cb('0x21')]({'where':_0x167644[_0xe4cb('0x45')]})[_0xe4cb('0x27')](function(_0x130131){_0x10ad63['count']=_0x130131;if(_0x4b02a8['query']['includeAll']){_0x167644[_0xe4cb('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0xe4cb('0x62')](_0x167644);})[_0xe4cb('0x27')](function(_0x106b49){_0x10ad63[_0xe4cb('0x4e')]=_0x106b49;return _0x10ad63;});}})[_0xe4cb('0x27')](respondWithFilteredResult(_0x51169f,_0x167644))[_0xe4cb('0x50')](handleError(_0x51169f,null));};exports[_0xe4cb('0x63')]=function(_0x1a5418,_0xcb76d2,_0x1d88b0){var _0x1e4075={'raw':!![],'where':{}};var _0xfa5c90={};var _0x112ccc={'count':0x0,'rows':[]};return db[_0xe4cb('0x37')][_0xe4cb('0x64')]({'where':{'id':_0x1a5418['params']['id']}})['then'](handleEntityNotFound(_0xcb76d2,null))['then'](function(_0xd167e7){if(_0xd167e7){_0xfa5c90[_0xe4cb('0x3b')]=_[_0xe4cb('0x3d')](db[_0xe4cb('0x65')]['rawAttributes']);_0xfa5c90[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0x1a5418[_0xe4cb('0x3c')]);_0xfa5c90[_0xe4cb('0x46')]=_[_0xe4cb('0x3e')](_0xfa5c90[_0xe4cb('0x3b')],_0xfa5c90[_0xe4cb('0x3c')]);_0x1e4075[_0xe4cb('0x3f')]=_[_0xe4cb('0x3e')](_0xfa5c90[_0xe4cb('0x3b')],qs['fields'](_0x1a5418[_0xe4cb('0x3c')][_0xe4cb('0x40')]));_0x1e4075[_0xe4cb('0x3f')]=_0x1e4075['attributes'][_0xe4cb('0x41')]?_0x1e4075['attributes']:_0xfa5c90[_0xe4cb('0x3b')];if(!_0x1a5418[_0xe4cb('0x3c')][_0xe4cb('0x42')](_0xe4cb('0x43'))){_0x1e4075[_0xe4cb('0x20')]=qs[_0xe4cb('0x20')](_0x1a5418[_0xe4cb('0x3c')]['limit']);_0x1e4075['offset']=qs[_0xe4cb('0x1e')](_0x1a5418[_0xe4cb('0x3c')]['offset']);}_0x1e4075[_0xe4cb('0x44')]=qs[_0xe4cb('0x60')](_0x1a5418['query'][_0xe4cb('0x60')]);_0x1e4075[_0xe4cb('0x45')]=qs[_0xe4cb('0x46')](_[_0xe4cb('0x47')](_0x1a5418['query'],_0xfa5c90[_0xe4cb('0x46')]));_0x1e4075[_0xe4cb('0x45')][_0xe4cb('0x66')]=_0xd167e7['id'];if(_0x1a5418[_0xe4cb('0x3c')][_0xe4cb('0x48')]){_0x1e4075[_0xe4cb('0x45')]=_['merge'](_0x1e4075[_0xe4cb('0x45')],{'$or':_[_0xe4cb('0x36')](_0x1e4075[_0xe4cb('0x3f')],function(_0x547e9a){var _0x554d90={};_0x554d90[_0x547e9a]={'$like':'%'+_0x1a5418[_0xe4cb('0x3c')][_0xe4cb('0x48')]+'%'};return _0x554d90;})});}_0x1e4075=_[_0xe4cb('0x49')]({},_0x1e4075,_0x1a5418[_0xe4cb('0x4b')]);return db[_0xe4cb('0x65')][_0xe4cb('0x21')]({'where':_0x1e4075[_0xe4cb('0x45')]})[_0xe4cb('0x27')](function(_0x2860f5){_0x112ccc['count']=_0x2860f5;if(_0x1a5418[_0xe4cb('0x3c')][_0xe4cb('0x4c')]){_0x1e4075[_0xe4cb('0x4d')]=[{'all':!![]}];}return db[_0xe4cb('0x65')][_0xe4cb('0x62')](_0x1e4075);})[_0xe4cb('0x27')](function(_0x1dbc40){_0x112ccc[_0xe4cb('0x4e')]=_0x1dbc40;return _0x112ccc;});}})[_0xe4cb('0x27')](respondWithFilteredResult(_0xcb76d2,_0x1e4075))['catch'](handleError(_0xcb76d2,null));};exports[_0xe4cb('0x67')]=function(_0x5c2799,_0x7e639c,_0x2c76c0){var _0x2656d2={'raw':!![],'where':{}};var _0x289c6a={};var _0x22149a={'count':0x0,'rows':[]};return db[_0xe4cb('0x37')]['findOne']({'where':{'id':_0x5c2799[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x7e639c,null))[_0xe4cb('0x27')](function(_0x5e0d8d){if(_0x5e0d8d){_0x289c6a['model']=_[_0xe4cb('0x3d')](db[_0xe4cb('0x68')][_0xe4cb('0x38')]);_0x289c6a[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0x5c2799[_0xe4cb('0x3c')]);_0x289c6a[_0xe4cb('0x46')]=_[_0xe4cb('0x3e')](_0x289c6a[_0xe4cb('0x3b')],_0x289c6a[_0xe4cb('0x3c')]);_0x2656d2[_0xe4cb('0x3f')]=_[_0xe4cb('0x3e')](_0x289c6a[_0xe4cb('0x3b')],qs[_0xe4cb('0x40')](_0x5c2799[_0xe4cb('0x3c')]['fields']));_0x2656d2[_0xe4cb('0x3f')]=_0x2656d2[_0xe4cb('0x3f')][_0xe4cb('0x41')]?_0x2656d2[_0xe4cb('0x3f')]:_0x289c6a[_0xe4cb('0x3b')];if(!_0x5c2799[_0xe4cb('0x3c')][_0xe4cb('0x42')](_0xe4cb('0x43'))){_0x2656d2[_0xe4cb('0x20')]=qs[_0xe4cb('0x20')](_0x5c2799[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x2656d2[_0xe4cb('0x1e')]=qs[_0xe4cb('0x1e')](_0x5c2799[_0xe4cb('0x3c')][_0xe4cb('0x1e')]);}_0x2656d2[_0xe4cb('0x44')]=qs[_0xe4cb('0x60')](_0x5c2799[_0xe4cb('0x3c')][_0xe4cb('0x60')]);_0x2656d2[_0xe4cb('0x45')]=qs[_0xe4cb('0x46')](_[_0xe4cb('0x47')](_0x5c2799[_0xe4cb('0x3c')],_0x289c6a[_0xe4cb('0x46')]));_0x2656d2[_0xe4cb('0x45')]['VoiceQueueId']=_0x5e0d8d['id'];if(_0x5c2799['query'][_0xe4cb('0x48')]){_0x2656d2[_0xe4cb('0x45')]=_[_0xe4cb('0x49')](_0x2656d2[_0xe4cb('0x45')],{'$or':_[_0xe4cb('0x36')](_0x2656d2['attributes'],function(_0x12cda2){var _0x19645b={};_0x19645b[_0x12cda2]={'$like':'%'+_0x5c2799['query']['filter']+'%'};return _0x19645b;})});}_0x2656d2=_[_0xe4cb('0x49')]({},_0x2656d2,_0x5c2799[_0xe4cb('0x4b')]);return db[_0xe4cb('0x68')][_0xe4cb('0x21')]({'where':_0x2656d2[_0xe4cb('0x45')]})[_0xe4cb('0x27')](function(_0xd4555c){_0x22149a[_0xe4cb('0x21')]=_0xd4555c;if(_0x5c2799[_0xe4cb('0x3c')][_0xe4cb('0x4c')]){_0x2656d2['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xe4cb('0x62')](_0x2656d2);})[_0xe4cb('0x27')](function(_0x13e676){_0x22149a['rows']=_0x13e676;return _0x22149a;});}})['then'](respondWithFilteredResult(_0x7e639c,_0x2656d2))['catch'](handleError(_0x7e639c,null));};exports['getHopperBlacks']=function(_0xd8d0,_0x4a8360,_0x2ac946){var _0x4fa16c={'raw':!![],'where':{}};var _0x27781c={};var _0x1b9e07={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe4cb('0x64')]({'where':{'id':_0xd8d0[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x4a8360,null))[_0xe4cb('0x27')](function(_0x140cff){if(_0x140cff){_0x27781c['model']=_[_0xe4cb('0x3d')](db[_0xe4cb('0x69')][_0xe4cb('0x38')]);_0x27781c[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0xd8d0[_0xe4cb('0x3c')]);_0x27781c['filters']=_[_0xe4cb('0x3e')](_0x27781c[_0xe4cb('0x3b')],_0x27781c[_0xe4cb('0x3c')]);_0x4fa16c[_0xe4cb('0x3f')]=_[_0xe4cb('0x3e')](_0x27781c[_0xe4cb('0x3b')],qs['fields'](_0xd8d0[_0xe4cb('0x3c')][_0xe4cb('0x40')]));_0x4fa16c[_0xe4cb('0x3f')]=_0x4fa16c[_0xe4cb('0x3f')]['length']?_0x4fa16c[_0xe4cb('0x3f')]:_0x27781c[_0xe4cb('0x3b')];if(!_0xd8d0[_0xe4cb('0x3c')][_0xe4cb('0x42')]('nolimit')){_0x4fa16c[_0xe4cb('0x20')]=qs[_0xe4cb('0x20')](_0xd8d0[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x4fa16c[_0xe4cb('0x1e')]=qs[_0xe4cb('0x1e')](_0xd8d0[_0xe4cb('0x3c')]['offset']);}_0x4fa16c[_0xe4cb('0x44')]=qs['sort'](_0xd8d0[_0xe4cb('0x3c')][_0xe4cb('0x60')]);_0x4fa16c['where']=qs[_0xe4cb('0x46')](_['pick'](_0xd8d0['query'],_0x27781c['filters']));_0x4fa16c[_0xe4cb('0x45')][_0xe4cb('0x66')]=_0x140cff['id'];if(_0xd8d0['query'][_0xe4cb('0x48')]){_0x4fa16c[_0xe4cb('0x45')]=_['merge'](_0x4fa16c['where'],{'$or':_[_0xe4cb('0x36')](_0x4fa16c[_0xe4cb('0x3f')],function(_0x1f6ca3){var _0x31f193={};_0x31f193[_0x1f6ca3]={'$like':'%'+_0xd8d0['query'][_0xe4cb('0x48')]+'%'};return _0x31f193;})});}_0x4fa16c=_[_0xe4cb('0x49')]({},_0x4fa16c,_0xd8d0[_0xe4cb('0x4b')]);return db[_0xe4cb('0x69')][_0xe4cb('0x21')]({'where':_0x4fa16c[_0xe4cb('0x45')]})[_0xe4cb('0x27')](function(_0x196c41){_0x1b9e07[_0xe4cb('0x21')]=_0x196c41;if(_0xd8d0[_0xe4cb('0x3c')]['includeAll']){_0x4fa16c[_0xe4cb('0x4d')]=[{'all':!![]}];}return db[_0xe4cb('0x69')][_0xe4cb('0x62')](_0x4fa16c);})[_0xe4cb('0x27')](function(_0x19de4e){_0x1b9e07[_0xe4cb('0x4e')]=_0x19de4e;return _0x1b9e07;});}})[_0xe4cb('0x27')](respondWithFilteredResult(_0x4a8360,_0x4fa16c))[_0xe4cb('0x50')](handleError(_0x4a8360,null));};exports[_0xe4cb('0x6a')]=function(_0x5b67e2,_0x332f41,_0xad49f6){var _0x3e7e31={};var _0xfc823={};var _0xa7dcc0;var _0x1590f6;return db[_0xe4cb('0x37')][_0xe4cb('0x64')]({'where':{'id':_0x5b67e2['params']['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x332f41,null))['then'](function(_0x70debf){if(_0x70debf){_0xa7dcc0=_0x70debf;_0xfc823[_0xe4cb('0x3b')]=_['keys'](db['Team'][_0xe4cb('0x38')]);_0xfc823[_0xe4cb('0x3c')]=_['keys'](_0x5b67e2[_0xe4cb('0x3c')]);_0xfc823[_0xe4cb('0x46')]=_[_0xe4cb('0x3e')](_0xfc823[_0xe4cb('0x3b')],_0xfc823['query']);_0x3e7e31['attributes']=_['intersection'](_0xfc823[_0xe4cb('0x3b')],qs[_0xe4cb('0x40')](_0x5b67e2['query'][_0xe4cb('0x40')]));_0x3e7e31[_0xe4cb('0x3f')]=_0x3e7e31[_0xe4cb('0x3f')]['length']?_0x3e7e31[_0xe4cb('0x3f')]:_0xfc823[_0xe4cb('0x3b')];_0x3e7e31[_0xe4cb('0x44')]=qs[_0xe4cb('0x60')](_0x5b67e2['query'][_0xe4cb('0x60')]);_0x3e7e31[_0xe4cb('0x45')]=qs[_0xe4cb('0x46')](_[_0xe4cb('0x47')](_0x5b67e2[_0xe4cb('0x3c')],_0xfc823[_0xe4cb('0x46')]));if(_0x5b67e2[_0xe4cb('0x3c')][_0xe4cb('0x48')]){_0x3e7e31['where']=_[_0xe4cb('0x49')](_0x3e7e31[_0xe4cb('0x45')],{'$or':_[_0xe4cb('0x36')](_0x3e7e31[_0xe4cb('0x3f')],function(_0xd493d0){var _0x193f01={};_0x193f01[_0xd493d0]={'$like':'%'+_0x5b67e2[_0xe4cb('0x3c')][_0xe4cb('0x48')]+'%'};return _0x193f01;})});}_0x3e7e31=_[_0xe4cb('0x49')]({},_0x3e7e31,_0x5b67e2[_0xe4cb('0x4b')]);return _0xa7dcc0[_0xe4cb('0x6a')](_0x3e7e31);}})[_0xe4cb('0x27')](function(_0x34e722){if(_0x34e722){_0x1590f6=_0x34e722[_0xe4cb('0x41')];if(!_0x5b67e2[_0xe4cb('0x3c')][_0xe4cb('0x42')](_0xe4cb('0x43'))){_0x3e7e31['limit']=qs[_0xe4cb('0x20')](_0x5b67e2[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x3e7e31['offset']=qs[_0xe4cb('0x1e')](_0x5b67e2['query'][_0xe4cb('0x1e')]);}return _0xa7dcc0[_0xe4cb('0x6a')](_0x3e7e31);}})[_0xe4cb('0x27')](function(_0x2ec697){if(_0x2ec697){return _0x2ec697?{'count':_0x1590f6,'rows':_0x2ec697}:null;}})[_0xe4cb('0x27')](respondWithResult(_0x332f41,null))[_0xe4cb('0x50')](handleError(_0x332f41,null));};exports[_0xe4cb('0x6b')]=function(_0x3d15b8,_0x3367ec,_0x2172a7){var _0x1cde8f=_0x3d15b8[_0xe4cb('0x52')][_0xe4cb('0x6c')];var _0x1abb0f=_['map'](_0x1cde8f,'id');return db['Team'][_0xe4cb('0x62')]({'where':{'id':_0x1abb0f},'attributes':['id'],'include':[{'model':db[_0xe4cb('0x6d')],'as':_0xe4cb('0x6e'),'attributes':['id',_0xe4cb('0x2f'),'online',_0xe4cb('0x6f'),'interface'],'raw':!![]}]})[_0xe4cb('0x27')](function(_0x3a27a6){if(_0x3a27a6){var _0x8df1d6=_[_0xe4cb('0x70')](_0x3a27a6,function(_0x18f5e7){var _0x5e221f=_0x18f5e7[_0xe4cb('0x28')]({'plain':!![]});_0x5e221f[_0xe4cb('0x6e')]['forEach'](function(_0x4e1ba4){_0x4e1ba4[_0xe4cb('0x71')]=_[_0xe4cb('0x2d')](_0x1cde8f,{'id':_0x5e221f['id']})[_0xe4cb('0x71')];});return _0x5e221f[_0xe4cb('0x6e')];});return db['VoiceQueue']['find']({'where':{'id':_0x3d15b8['params']['id']}})[_0xe4cb('0x27')](function(_0x316f7e){return db[_0xe4cb('0x72')][_0xe4cb('0x73')](function(_0x2c4e67){return _0x316f7e[_0xe4cb('0x6b')](_0x1abb0f,{'transaction':_0x2c4e67})['then'](function(){return BPromise['each'](_0x1cde8f,function(_0x5b4789){return db[_0xe4cb('0x74')][_0xe4cb('0x75')]({'TeamId':_0x5b4789['id'],'VoiceQueueId':_0x3d15b8[_0xe4cb('0x4f')]['id'],'penalty':_0x5b4789['penalty']},{'transaction':_0x2c4e67});});})[_0xe4cb('0x27')](function(){return BPromise[_0xe4cb('0x76')](_0x8df1d6,function(_0x3a2dad){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x3a2dad['id'],'VoiceQueueId':_0x3d15b8[_0xe4cb('0x4f')]['id']},'defaults':{'penalty':_0x3a2dad[_0xe4cb('0x71')]},'transaction':_0x2c4e67});});})['then'](function(){return BPromise[_0xe4cb('0x76')](_[_0xe4cb('0x48')](_0x8df1d6,{'online':!![]}),function(_0x2a29a7){return db[_0xe4cb('0x77')]['upsert']({'membername':_0x2a29a7[_0xe4cb('0x2f')],'UserId':_0x2a29a7['id'],'queue_name':_0x316f7e[_0xe4cb('0x2f')],'VoiceQueueId':_0x316f7e['id'],'interface':_[_0xe4cb('0x78')](_0x2a29a7['interface'])?util[_0xe4cb('0x79')]('SIP/%s',_0x2a29a7[_0xe4cb('0x2f')]):_0x2a29a7['interface'],'paused':_0x2a29a7[_0xe4cb('0x6f')]||![],'penalty':_0x2a29a7['penalty']},{'transaction':_0x2c4e67});});})[_0xe4cb('0x27')](function(){_0x8df1d6[_0xe4cb('0x7a')](function(_0x310c65){socket[_0xe4cb('0x7b')](_0xe4cb('0x7c'),{'UserId':_0x310c65['id'],'VoiceQueueId':_0x316f7e['id']});});});});});}})[_0xe4cb('0x27')](respondWithStatusCode(_0x3367ec,null))['catch'](handleError(_0x3367ec,null));};exports[_0xe4cb('0x7d')]=function(_0x3111e6,_0x27c4f2,_0x3f6b63){return db['Team'][_0xe4cb('0x62')]({'where':{'id':_0x3111e6[_0xe4cb('0x3c')][_0xe4cb('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xe4cb('0x6d')],'as':_0xe4cb('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xe4cb('0x27')](handleEntityNotFound(_0x27c4f2,null))[_0xe4cb('0x27')](function(_0x50a66e){var _0x1a53cf=_[_0xe4cb('0x36')](_0x50a66e,'id');var _0x1571d2=[];var _0x18660e=[];var _0x14ba02=squel['select']();_0x14ba02[_0xe4cb('0x7f')](_0xe4cb('0x80'))[_0xe4cb('0x81')](_0xe4cb('0x82'),'tq')[_0xe4cb('0x83')](_0xe4cb('0x84'),'ut',_0xe4cb('0x85'))['where'](_0xe4cb('0x86'),_0x3111e6['params']['id']);for(var _0x51e4d4=0x0;_0x51e4d4<_0x50a66e[_0xe4cb('0x41')];_0x51e4d4+=0x1){let _0x39947c=_0x50a66e[_0x51e4d4];for(var _0x56a698=0x0;_0x56a698<_0x39947c[_0xe4cb('0x6e')][_0xe4cb('0x41')];_0x56a698+=0x1){let _0x468dd1=_0x39947c['Agents'][_0x56a698];var _0x2415e8=_0x14ba02[_0xe4cb('0x5a')]();_0x2415e8[_0xe4cb('0x45')](_0xe4cb('0x87'),_0x468dd1['id']);_0x18660e[_0xe4cb('0x88')](db['sequelize'][_0xe4cb('0x3c')](_0x2415e8[_0xe4cb('0x89')](),{'type':db[_0xe4cb('0x72')][_0xe4cb('0x8a')]['SELECT']})[_0xe4cb('0x27')](function(_0x459917){if(_0x459917[_0xe4cb('0x41')]===0x1){return _0x468dd1['id'];}else{var _0x1a2edc=_['every'](_[_0xe4cb('0x36')](_0x459917,_0xe4cb('0x8b')),function(_0x54b9d8){return _[_0xe4cb('0x2c')](_0x1a53cf,_0x54b9d8);});if(_0x1a2edc){return _0x468dd1['id'];}}}));}}return BPromise[_0xe4cb('0x8c')](_0x18660e)['then'](function(_0x1ff982){_0x1571d2=_(_0x1571d2)[_0xe4cb('0x8d')](_0x1ff982)[_0xe4cb('0x8e')]()[_0xe4cb('0x2b')]();return db['VoiceQueue'][_0xe4cb('0x2d')]({'where':{'id':_0x3111e6[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](function(_0x1be651){return db[_0xe4cb('0x72')][_0xe4cb('0x73')](function(_0x271fac){return _0x1be651[_0xe4cb('0x7d')](_0x3111e6[_0xe4cb('0x3c')][_0xe4cb('0x7e')],{'transaction':_0x271fac})['then'](function(){if(!_[_0xe4cb('0x8f')](_0x1571d2)){return _0x1be651[_0xe4cb('0x90')](_0x1571d2,{'transaction':_0x271fac})[_0xe4cb('0x27')](function(){return db[_0xe4cb('0x77')]['destroy']({'where':{'VoiceQueueId':_0x3111e6[_0xe4cb('0x4f')]['id'],'UserId':_0x1571d2},'transaction':_0x271fac});});}})[_0xe4cb('0x27')](function(){_0x1571d2[_0xe4cb('0x7a')](function(_0x36ec57){socket[_0xe4cb('0x7b')](_0xe4cb('0x91'),{'UserId':_0x36ec57,'VoiceQueueId':_0x1be651['id']});});});});});});})[_0xe4cb('0x27')](respondWithStatusCode(_0x27c4f2,null))[_0xe4cb('0x50')](handleError(_0x27c4f2,null));};exports[_0xe4cb('0x92')]=function(_0x39794b,_0x59b95a,_0x2437bf){var _0x34cc73,_0x3dd96d;return db['VoiceQueue']['find']({'where':{'id':_0x39794b[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x59b95a,null))[_0xe4cb('0x27')](function(_0x48bd0b){if(_0x48bd0b){_0x3dd96d=_0x48bd0b;return _0x48bd0b[_0xe4cb('0x92')](_0x39794b[_0xe4cb('0x52')]['ids'],_[_0xe4cb('0x5b')](_0x39794b[_0xe4cb('0x52')],[_0xe4cb('0x7e'),'id'])||{})['spread'](function(_0x4b6f91){for(var _0x2f8ab9=0x0;_0x2f8ab9<_0x39794b['body'][_0xe4cb('0x7e')]['length'];_0x2f8ab9+=0x1){socket[_0xe4cb('0x7b')](_0xe4cb('0x7c'),{'UserId':Number(_0x39794b[_0xe4cb('0x52')][_0xe4cb('0x7e')][_0x2f8ab9]),'VoiceQueueId':Number(_0x39794b[_0xe4cb('0x4f')]['id'])});}return _0x4b6f91;});}})[_0xe4cb('0x27')](function(_0x9d08c9){_0x34cc73=_0x9d08c9||[];if(_0x3dd96d){return db[_0xe4cb('0x6d')][_0xe4cb('0x62')]({'where':{'id':_0x39794b[_0xe4cb('0x52')]['ids']},'attributes':['id','name',_0xe4cb('0x93'),_0xe4cb('0x6f'),_0xe4cb('0x94')],'raw':!![]});}})['then'](function(_0xa38b6a){if(!_['isEmpty'](_0xa38b6a)){var _0x50cc53=[];for(var _0x59d966=0x0;_0x59d966<_0xa38b6a[_0xe4cb('0x41')];_0x59d966++){if(_0xa38b6a[_0x59d966]['online']){_0x50cc53[_0xe4cb('0x88')](db[_0xe4cb('0x77')][_0xe4cb('0x75')]({'membername':_0xa38b6a[_0x59d966][_0xe4cb('0x2f')],'UserId':_0xa38b6a[_0x59d966]['id'],'queue_name':_0x3dd96d[_0xe4cb('0x2f')],'VoiceQueueId':_0x3dd96d['id'],'interface':_[_0xe4cb('0x78')](_0xa38b6a[_0x59d966]['interface'])?util[_0xe4cb('0x79')]('SIP/%s',_0xa38b6a[_0x59d966]['name']):_0xa38b6a[_0x59d966][_0xe4cb('0x94')],'paused':_0xa38b6a[_0x59d966][_0xe4cb('0x6f')]||![],'penalty':_0x39794b[_0xe4cb('0x52')][_0xe4cb('0x71')]||0x0}));}}return BPromise['all'](_0x50cc53);}})['then'](function(){return _0x34cc73;})[_0xe4cb('0x27')](respondWithResult(_0x59b95a,null))['catch'](handleError(_0x59b95a,null));};exports[_0xe4cb('0x90')]=function(_0x29a02c,_0x1a25a6,_0x186ac0){return db[_0xe4cb('0x37')][_0xe4cb('0x2d')]({'where':{'id':_0x29a02c[_0xe4cb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a25a6,null))[_0xe4cb('0x27')](function(_0x592b17){if(_0x592b17){return _0x592b17[_0xe4cb('0x90')](_0x29a02c[_0xe4cb('0x3c')][_0xe4cb('0x7e')])[_0xe4cb('0x27')](function(){if(_[_0xe4cb('0x95')](_0x29a02c[_0xe4cb('0x3c')]['ids'])){for(var _0x273aab=0x0;_0x273aab<_0x29a02c[_0xe4cb('0x3c')][_0xe4cb('0x7e')][_0xe4cb('0x41')];_0x273aab+=0x1){socket[_0xe4cb('0x7b')]('userVoiceQueue:remove',{'UserId':Number(_0x29a02c[_0xe4cb('0x3c')][_0xe4cb('0x7e')][_0x273aab]),'VoiceQueueId':Number(_0x29a02c['params']['id'])});}}else{socket[_0xe4cb('0x7b')](_0xe4cb('0x91'),{'UserId':Number(_0x29a02c[_0xe4cb('0x3c')][_0xe4cb('0x7e')]),'VoiceQueueId':Number(_0x29a02c[_0xe4cb('0x4f')]['id'])});}});}})[_0xe4cb('0x27')](function(_0x56f2c4){return db[_0xe4cb('0x77')][_0xe4cb('0x31')]({'where':{'VoiceQueueId':_0x29a02c[_0xe4cb('0x4f')]['id'],'UserId':_0x29a02c[_0xe4cb('0x3c')][_0xe4cb('0x7e')]}})[_0xe4cb('0x27')](function(){return _0x56f2c4;});})[_0xe4cb('0x27')](respondWithStatusCode(_0x1a25a6,null))['catch'](handleError(_0x1a25a6,null));};exports[_0xe4cb('0x96')]=function(_0x1f6f07,_0xf86d69,_0x523192){var _0x570e5f={};var _0x5eb90b={};var _0x458e5e;var _0x2d1321;return db['VoiceQueue'][_0xe4cb('0x64')]({'where':{'id':_0x1f6f07['params']['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0xf86d69,null))[_0xe4cb('0x27')](function(_0x76bf5d){if(_0x76bf5d){_0x458e5e=_0x76bf5d;_0x5eb90b['model']=_[_0xe4cb('0x3d')](db['User'][_0xe4cb('0x38')]);_0x5eb90b[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0x1f6f07[_0xe4cb('0x3c')]);_0x5eb90b[_0xe4cb('0x46')]=_[_0xe4cb('0x3e')](_0x5eb90b[_0xe4cb('0x3b')],_0x5eb90b[_0xe4cb('0x3c')]);_0x570e5f['attributes']=_[_0xe4cb('0x3e')](_0x5eb90b[_0xe4cb('0x3b')],qs[_0xe4cb('0x40')](_0x1f6f07['query']['fields']));_0x570e5f['attributes']=_0x570e5f['attributes'][_0xe4cb('0x41')]?_0x570e5f[_0xe4cb('0x3f')]:_0x5eb90b[_0xe4cb('0x3b')];_0x570e5f[_0xe4cb('0x44')]=qs[_0xe4cb('0x60')](_0x1f6f07['query']['sort']);_0x570e5f['where']=qs[_0xe4cb('0x46')](_[_0xe4cb('0x47')](_0x1f6f07['query'],_0x5eb90b['filters']));if(_0x1f6f07[_0xe4cb('0x3c')][_0xe4cb('0x48')]){_0x570e5f[_0xe4cb('0x45')]=_['merge'](_0x570e5f[_0xe4cb('0x45')],{'$or':_[_0xe4cb('0x36')](_0x570e5f[_0xe4cb('0x3f')],function(_0x274113){var _0x2d8a5b={};_0x2d8a5b[_0x274113]={'$like':'%'+_0x1f6f07[_0xe4cb('0x3c')][_0xe4cb('0x48')]+'%'};return _0x2d8a5b;})});}_0x570e5f=_['merge']({},_0x570e5f,_0x1f6f07[_0xe4cb('0x4b')]);return _0x458e5e[_0xe4cb('0x96')](_0x570e5f);}})[_0xe4cb('0x27')](function(_0x3694d0){if(_0x3694d0){_0x2d1321=_0x3694d0['length'];if(!_0x1f6f07[_0xe4cb('0x3c')][_0xe4cb('0x42')](_0xe4cb('0x43'))){_0x570e5f[_0xe4cb('0x20')]=qs['limit'](_0x1f6f07[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x570e5f[_0xe4cb('0x1e')]=qs[_0xe4cb('0x1e')](_0x1f6f07['query'][_0xe4cb('0x1e')]);}return _0x458e5e['getAgents'](_0x570e5f);}})[_0xe4cb('0x27')](function(_0x3f2867){if(_0x3f2867){return _0x3f2867?{'count':_0x2d1321,'rows':_0x3f2867}:null;}})['then'](respondWithResult(_0xf86d69,null))[_0xe4cb('0x50')](handleError(_0xf86d69,null));};exports[_0xe4cb('0x97')]=function(_0x354ba2,_0x2aff54,_0x11b3a3){var _0x3713f2={};var _0x4646ec={};var _0x1cc0dd;var _0x242b0a;return db[_0xe4cb('0x37')][_0xe4cb('0x64')]({'where':{'id':_0x354ba2['params']['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x2aff54,null))[_0xe4cb('0x27')](function(_0x155b5a){if(_0x155b5a){_0x1cc0dd=_0x155b5a;_0x4646ec[_0xe4cb('0x3b')]=_[_0xe4cb('0x3d')](db[_0xe4cb('0x77')][_0xe4cb('0x38')]);_0x4646ec[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0x354ba2['query']);_0x4646ec[_0xe4cb('0x46')]=_[_0xe4cb('0x3e')](_0x4646ec[_0xe4cb('0x3b')],_0x4646ec[_0xe4cb('0x3c')]);_0x3713f2[_0xe4cb('0x3f')]=_['intersection'](_0x4646ec[_0xe4cb('0x3b')],qs[_0xe4cb('0x40')](_0x354ba2[_0xe4cb('0x3c')][_0xe4cb('0x40')]));_0x3713f2[_0xe4cb('0x3f')]=_0x3713f2[_0xe4cb('0x3f')]['length']?_0x3713f2[_0xe4cb('0x3f')]:_0x4646ec[_0xe4cb('0x3b')];_0x3713f2[_0xe4cb('0x44')]=qs[_0xe4cb('0x60')](_0x354ba2[_0xe4cb('0x3c')][_0xe4cb('0x60')]);_0x3713f2[_0xe4cb('0x45')]=qs['filters'](_[_0xe4cb('0x47')](_0x354ba2['query'],_0x4646ec['filters']));if(_0x354ba2['query']['filter']){_0x3713f2['where']=_[_0xe4cb('0x49')](_0x3713f2['where'],{'$or':_[_0xe4cb('0x36')](_0x3713f2[_0xe4cb('0x3f')],function(_0x4fd693){var _0xd1ccde={};_0xd1ccde[_0x4fd693]={'$like':'%'+_0x354ba2[_0xe4cb('0x3c')][_0xe4cb('0x48')]+'%'};return _0xd1ccde;})});}_0x3713f2=_['merge']({},_0x3713f2,_0x354ba2[_0xe4cb('0x4b')]);return _0x1cc0dd[_0xe4cb('0x97')](_0x3713f2);}})[_0xe4cb('0x27')](function(_0x3b613e){if(_0x3b613e){_0x242b0a=_0x3b613e[_0xe4cb('0x41')];if(!_0x354ba2[_0xe4cb('0x3c')]['hasOwnProperty'](_0xe4cb('0x43'))){_0x3713f2['limit']=qs[_0xe4cb('0x20')](_0x354ba2[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x3713f2[_0xe4cb('0x1e')]=qs[_0xe4cb('0x1e')](_0x354ba2[_0xe4cb('0x3c')][_0xe4cb('0x1e')]);}return _0x1cc0dd['getMembers'](_0x3713f2);}})[_0xe4cb('0x27')](function(_0x4ca86a){return _0x4ca86a?{'count':_0x242b0a,'rows':_0x4ca86a}:null;})[_0xe4cb('0x27')](respondWithResult(_0x2aff54,null))[_0xe4cb('0x50')](handleError(_0x2aff54,null));};exports[_0xe4cb('0x98')]=function(_0x531c4c,_0x5d1fb2,_0x164f06){var _0x19241b={};var _0x25741e={};var _0x5733a5;var _0x4d5ca4;return db['VoiceQueue'][_0xe4cb('0x64')]({'where':{'id':_0x531c4c['params']['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x5d1fb2,null))[_0xe4cb('0x27')](function(_0x1ac178){if(_0x1ac178){_0x5733a5=_0x1ac178;_0x25741e[_0xe4cb('0x3b')]=_['keys'](db[_0xe4cb('0x99')][_0xe4cb('0x38')]);_0x25741e[_0xe4cb('0x3c')]=_[_0xe4cb('0x3d')](_0x531c4c[_0xe4cb('0x3c')]);_0x25741e['filters']=_['intersection'](_0x25741e['model'],_0x25741e[_0xe4cb('0x3c')]);_0x19241b[_0xe4cb('0x3f')]=_[_0xe4cb('0x3e')](_0x25741e[_0xe4cb('0x3b')],qs['fields'](_0x531c4c[_0xe4cb('0x3c')]['fields']));_0x19241b['attributes']=_0x19241b[_0xe4cb('0x3f')][_0xe4cb('0x41')]?_0x19241b[_0xe4cb('0x3f')]:_0x25741e['model'];_0x19241b['order']=qs['sort'](_0x531c4c['query'][_0xe4cb('0x60')]);_0x19241b['where']=qs[_0xe4cb('0x46')](_[_0xe4cb('0x47')](_0x531c4c[_0xe4cb('0x3c')],_0x25741e[_0xe4cb('0x46')]));if(_0x531c4c['query']['filter']){_0x19241b[_0xe4cb('0x45')]=_[_0xe4cb('0x49')](_0x19241b[_0xe4cb('0x45')],{'$or':_['map'](_0x19241b[_0xe4cb('0x3f')],function(_0x5eddcc){var _0x54c075={};_0x54c075[_0x5eddcc]={'$like':'%'+_0x531c4c['query'][_0xe4cb('0x48')]+'%'};return _0x54c075;})});}_0x19241b=_[_0xe4cb('0x49')]({},_0x19241b,_0x531c4c[_0xe4cb('0x4b')]);return _0x5733a5['getLists'](_0x19241b);}})[_0xe4cb('0x27')](function(_0x21fc1e){if(_0x21fc1e){_0x4d5ca4=_0x21fc1e['length'];if(!_0x531c4c['query'][_0xe4cb('0x42')]('nolimit')){_0x19241b['limit']=qs[_0xe4cb('0x20')](_0x531c4c[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x19241b[_0xe4cb('0x1e')]=qs[_0xe4cb('0x1e')](_0x531c4c[_0xe4cb('0x3c')][_0xe4cb('0x1e')]);}return _0x5733a5[_0xe4cb('0x98')](_0x19241b);}})[_0xe4cb('0x27')](function(_0x2a0c85){if(_0x2a0c85){return _0x2a0c85?{'count':_0x4d5ca4,'rows':_0x2a0c85}:null;}})[_0xe4cb('0x27')](respondWithResult(_0x5d1fb2,null))[_0xe4cb('0x50')](handleError(_0x5d1fb2,null));};exports[_0xe4cb('0x9a')]=function(_0x510554,_0x3ab1fc,_0x36a19c){var _0x44a843,_0x1663c1;return db['VoiceQueue'][_0xe4cb('0x2d')]({'where':{'id':_0x510554[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x3ab1fc,null))['then'](function(_0x2b3c0e){if(_0x2b3c0e){_0x1663c1=_0x2b3c0e;return _0x2b3c0e[_0xe4cb('0x9a')](_0x510554[_0xe4cb('0x52')][_0xe4cb('0x7e')],_['omit'](_0x510554['body'],[_0xe4cb('0x7e'),'id'])||{});}return null;})[_0xe4cb('0x9b')](function(_0x225472){var _0x3b2dbf;_0x44a843=_0x225472||[];var _0x245e74=[];if(_0x225472){for(var _0x198fcc=0x0;_0x198fcc<_0x225472['length'];_0x198fcc+=0x1){var _0x1c45b5=_0x225472[_0x198fcc]['get']({'plain':!![]});_0x1663c1['dialCheckDuplicateType']=_0x510554[_0xe4cb('0x52')][_0xe4cb('0x9c')]?_0x510554[_0xe4cb('0x52')]['dialCheckDuplicateType']:_0x1663c1[_0xe4cb('0x9c')];switch(_0x1663c1[_0xe4cb('0x9c')]){case _0xe4cb('0x9d'):_0x3b2dbf=squel[_0xe4cb('0x9e')]()[_0xe4cb('0x9f')]('cm_hopper')[_0xe4cb('0xa0')](['phone',_0xe4cb('0xa1'),_0xe4cb('0xa2'),_0xe4cb('0xa3'),'VoiceQueueId',_0xe4cb('0x5c'),_0xe4cb('0x5d')],squel['select']()['field']('phone',_0xe4cb('0xa4'))[_0xe4cb('0x7f')](_0xe4cb('0xa5'),_0xe4cb('0xa1'))[_0xe4cb('0x7f')]('id','ContactId')[_0xe4cb('0x7f')](_0x1c45b5[_0xe4cb('0xa6')][_0xe4cb('0x89')](),_0xe4cb('0xa3'))[_0xe4cb('0x7f')](_0x510554['params']['id'][_0xe4cb('0x89')](),'VoiceQueueId')['field'](_0xe4cb('0xa5'),'createdAt')['field'](_0xe4cb('0xa5'),_0xe4cb('0x5d'))[_0xe4cb('0x81')](_0xe4cb('0xa7'))['where'](_0xe4cb('0xa8'))['where'](_0xe4cb('0xa9'),_0x1c45b5[_0xe4cb('0xa6')][_0xe4cb('0x89')]())[_0xe4cb('0x45')](_0xe4cb('0xaa'))[_0xe4cb('0x45')](_0xe4cb('0xab'),squel[_0xe4cb('0xac')]()[_0xe4cb('0x7f')]('COALESCE(calleridnum,\x27\x27)')[_0xe4cb('0x81')](_0xe4cb('0xad'))[_0xe4cb('0x45')](_0xe4cb('0x86'),_0x510554['params']['id']['toString']()))[_0xe4cb('0x45')](_0xe4cb('0xab'),squel[_0xe4cb('0xac')]()[_0xe4cb('0x7f')](_0xe4cb('0xae'))[_0xe4cb('0x81')](_0xe4cb('0xaf'))[_0xe4cb('0x45')]('VoiceQueueId\x20=\x20?',_0x510554[_0xe4cb('0x4f')]['id'][_0xe4cb('0x89')]())))[_0xe4cb('0x89')]();break;case'onlyIfOpen':_0x3b2dbf=squel[_0xe4cb('0x9e')]()[_0xe4cb('0x9f')](_0xe4cb('0xaf'))[_0xe4cb('0xa0')]([_0xe4cb('0xa4'),'scheduledAt',_0xe4cb('0xa2'),'ListId',_0xe4cb('0x66'),'createdAt','updatedAt'],squel[_0xe4cb('0xac')]()[_0xe4cb('0x7f')](_0xe4cb('0xa4'),'phone')['field'](_0xe4cb('0xa5'),'scheduledAt')[_0xe4cb('0x7f')]('id','ContactId')[_0xe4cb('0x7f')](_0x1c45b5[_0xe4cb('0xa6')][_0xe4cb('0x89')](),_0xe4cb('0xa3'))[_0xe4cb('0x7f')](_0x510554[_0xe4cb('0x4f')]['id']['toString'](),_0xe4cb('0x66'))['field'](_0xe4cb('0xa5'),_0xe4cb('0x5c'))[_0xe4cb('0x7f')]('NOW()',_0xe4cb('0x5d'))['from'](_0xe4cb('0xa7'))[_0xe4cb('0x45')](_0xe4cb('0xa8'))[_0xe4cb('0x45')]('ListId\x20=\x20?',_0x1c45b5[_0xe4cb('0xa6')]['toString']())[_0xe4cb('0x45')](_0xe4cb('0xaa'))['where'](_0xe4cb('0xab'),squel[_0xe4cb('0xac')]()[_0xe4cb('0x7f')](_0xe4cb('0xae'))[_0xe4cb('0x81')](_0xe4cb('0xaf'))['where'](_0xe4cb('0x86'),_0x510554[_0xe4cb('0x4f')]['id'][_0xe4cb('0x89')]())))[_0xe4cb('0x89')]();break;default:_0x3b2dbf=squel[_0xe4cb('0x9e')]()['into'](_0xe4cb('0xaf'))[_0xe4cb('0xa0')]([_0xe4cb('0xa4'),'scheduledAt',_0xe4cb('0xa2'),_0xe4cb('0xa3'),_0xe4cb('0x66'),'createdAt',_0xe4cb('0x5d')],squel['select']()['field'](_0xe4cb('0xa4'),_0xe4cb('0xa4'))[_0xe4cb('0x7f')](_0xe4cb('0xa5'),'scheduledAt')['field']('id',_0xe4cb('0xa2'))[_0xe4cb('0x7f')](_0x1c45b5[_0xe4cb('0xa6')][_0xe4cb('0x89')](),_0xe4cb('0xa3'))[_0xe4cb('0x7f')](_0x510554[_0xe4cb('0x4f')]['id'][_0xe4cb('0x89')](),'VoiceQueueId')[_0xe4cb('0x7f')]('NOW()',_0xe4cb('0x5c'))[_0xe4cb('0x7f')](_0xe4cb('0xa5'),_0xe4cb('0x5d'))[_0xe4cb('0x81')]('cm_contacts')[_0xe4cb('0x45')](_0xe4cb('0xa8'))[_0xe4cb('0x45')](_0xe4cb('0xa9'),_0x1c45b5[_0xe4cb('0xa6')][_0xe4cb('0x89')]())[_0xe4cb('0x45')](_0xe4cb('0xaa')))['toString']();}_0x245e74[_0xe4cb('0x88')](db['sequelize'][_0xe4cb('0x3c')](_0x3b2dbf));}return BPromise[_0xe4cb('0x8c')](_0x245e74);}})[_0xe4cb('0x27')](function(){return _0x44a843;})[_0xe4cb('0x27')](respondWithResult(_0x3ab1fc,null))[_0xe4cb('0x50')](handleError(_0x3ab1fc,null));};exports[_0xe4cb('0xb0')]=function(_0x527e7f,_0x3f264e,_0x5e6e58){return db[_0xe4cb('0x37')][_0xe4cb('0x2d')]({'where':{'id':_0x527e7f[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x3f264e,null))[_0xe4cb('0x27')](function(_0x100961){if(_0x100961){return _0x100961['removeLists'](_0x527e7f[_0xe4cb('0x3c')]['ids']);}})[_0xe4cb('0x27')](function(_0x3aea39){if(_0x3aea39){return db[_0xe4cb('0x61')][_0xe4cb('0x31')]({'where':{'ListId':_0x527e7f['query'][_0xe4cb('0x7e')],'VoiceQueueId':_0x527e7f[_0xe4cb('0x4f')]['id']}})['then'](function(){return _0x3aea39;});}})['then'](respondWithStatusCode(_0x3f264e,null))['catch'](handleError(_0x3f264e,null));};exports['getBlackLists']=function(_0x163d43,_0x1f4b00,_0x251f65){var _0x31eb37={};var _0x30489a={};var _0x4cea5e;var _0x4386fb;return db[_0xe4cb('0x37')][_0xe4cb('0x64')]({'where':{'id':_0x163d43['params']['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x1f4b00,null))['then'](function(_0x415a1e){if(_0x415a1e){_0x4cea5e=_0x415a1e;_0x30489a[_0xe4cb('0x3b')]=_['keys'](db[_0xe4cb('0x99')][_0xe4cb('0x38')]);_0x30489a[_0xe4cb('0x3c')]=_['keys'](_0x163d43[_0xe4cb('0x3c')]);_0x30489a['filters']=_[_0xe4cb('0x3e')](_0x30489a[_0xe4cb('0x3b')],_0x30489a['query']);_0x31eb37[_0xe4cb('0x3f')]=_['intersection'](_0x30489a['model'],qs[_0xe4cb('0x40')](_0x163d43[_0xe4cb('0x3c')][_0xe4cb('0x40')]));_0x31eb37[_0xe4cb('0x3f')]=_0x31eb37[_0xe4cb('0x3f')][_0xe4cb('0x41')]?_0x31eb37[_0xe4cb('0x3f')]:_0x30489a[_0xe4cb('0x3b')];_0x31eb37[_0xe4cb('0x44')]=qs['sort'](_0x163d43[_0xe4cb('0x3c')][_0xe4cb('0x60')]);_0x31eb37[_0xe4cb('0x45')]=qs['filters'](_['pick'](_0x163d43['query'],_0x30489a[_0xe4cb('0x46')]));if(_0x163d43['query'][_0xe4cb('0x48')]){_0x31eb37['where']=_[_0xe4cb('0x49')](_0x31eb37['where'],{'$or':_[_0xe4cb('0x36')](_0x31eb37[_0xe4cb('0x3f')],function(_0x51ca35){var _0x4d984b={};_0x4d984b[_0x51ca35]={'$like':'%'+_0x163d43[_0xe4cb('0x3c')][_0xe4cb('0x48')]+'%'};return _0x4d984b;})});}_0x31eb37=_[_0xe4cb('0x49')]({},_0x31eb37,_0x163d43[_0xe4cb('0x4b')]);return _0x4cea5e[_0xe4cb('0xb1')](_0x31eb37);}})[_0xe4cb('0x27')](function(_0xb728b9){if(_0xb728b9){_0x4386fb=_0xb728b9['length'];if(!_0x163d43[_0xe4cb('0x3c')][_0xe4cb('0x42')]('nolimit')){_0x31eb37[_0xe4cb('0x20')]=qs[_0xe4cb('0x20')](_0x163d43[_0xe4cb('0x3c')][_0xe4cb('0x20')]);_0x31eb37[_0xe4cb('0x1e')]=qs[_0xe4cb('0x1e')](_0x163d43[_0xe4cb('0x3c')][_0xe4cb('0x1e')]);}return _0x4cea5e[_0xe4cb('0xb1')](_0x31eb37);}})['then'](function(_0x5725d6){if(_0x5725d6){return _0x5725d6?{'count':_0x4386fb,'rows':_0x5725d6}:null;}})[_0xe4cb('0x27')](respondWithResult(_0x1f4b00,null))['catch'](handleError(_0x1f4b00,null));};exports[_0xe4cb('0xb2')]=function(_0x2511dc,_0x295873,_0x2dea54){var _0x3e22f5,_0x2b966b;return db['VoiceQueue'][_0xe4cb('0x2d')]({'where':{'id':_0x2511dc['params']['id']}})['then'](handleEntityNotFound(_0x295873,null))[_0xe4cb('0x27')](function(_0x5a4bc0){if(_0x5a4bc0){_0x2b966b=_0x5a4bc0;return _0x5a4bc0[_0xe4cb('0xb2')](_0x2511dc[_0xe4cb('0x52')][_0xe4cb('0x7e')],_[_0xe4cb('0x5b')](_0x2511dc[_0xe4cb('0x52')],['ids','id'])||{});}return null;})[_0xe4cb('0x9b')](function(_0x47085b){var _0x5a1b59;_0x3e22f5=_0x47085b||[];var _0x34ca59=[];if(_0x47085b){for(var _0x5c3014=0x0;_0x5c3014<_0x47085b[_0xe4cb('0x41')];_0x5c3014+=0x1){var _0x479868=_0x47085b[_0x5c3014][_0xe4cb('0x28')]({'plain':!![]});_0x5a1b59=squel[_0xe4cb('0x9e')]()[_0xe4cb('0x9f')](_0xe4cb('0xb3'))[_0xe4cb('0xa0')](['phone',_0xe4cb('0xa2'),'ListId',_0xe4cb('0x66'),_0xe4cb('0x5c'),_0xe4cb('0x5d')],squel[_0xe4cb('0xac')]()[_0xe4cb('0x7f')]('phone',_0xe4cb('0xa4'))['field']('id',_0xe4cb('0xa2'))['field'](_0x479868[_0xe4cb('0xa6')][_0xe4cb('0x89')](),'ListId')[_0xe4cb('0x7f')](_0x2511dc['params']['id'][_0xe4cb('0x89')](),'VoiceQueueId')[_0xe4cb('0x7f')](_0xe4cb('0xa5'),_0xe4cb('0x5c'))[_0xe4cb('0x7f')](_0xe4cb('0xa5'),'updatedAt')[_0xe4cb('0x81')]('cm_contacts')[_0xe4cb('0x45')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x479868['CmListId'][_0xe4cb('0x89')]())[_0xe4cb('0x45')](_0xe4cb('0xaa')))[_0xe4cb('0x89')]();_0x34ca59[_0xe4cb('0x88')](db[_0xe4cb('0x72')]['query'](_0x5a1b59));}return BPromise[_0xe4cb('0x8c')](_0x34ca59);}})[_0xe4cb('0x27')](function(){return _0x3e22f5;})['then'](respondWithResult(_0x295873,null))[_0xe4cb('0x50')](handleError(_0x295873,null));};exports[_0xe4cb('0xb4')]=function(_0xcd2c1f,_0x4fc14a,_0x14bf32){return db[_0xe4cb('0x37')]['find']({'where':{'id':_0xcd2c1f[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](handleEntityNotFound(_0x4fc14a,null))['then'](function(_0x493ef0){if(_0x493ef0){return _0x493ef0[_0xe4cb('0xb4')](_0xcd2c1f['query'][_0xe4cb('0x7e')]);}})[_0xe4cb('0x27')](function(_0x39b188){if(_0x39b188){return db[_0xe4cb('0x69')]['destroy']({'where':{'ListId':_0xcd2c1f[_0xe4cb('0x3c')]['ids'],'VoiceQueueId':_0xcd2c1f[_0xe4cb('0x4f')]['id']}})[_0xe4cb('0x27')](function(){return _0x39b188;});}})[_0xe4cb('0x27')](respondWithStatusCode(_0x4fc14a,null))[_0xe4cb('0x50')](handleError(_0x4fc14a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index fb667b6..957a3e4 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 _0x16ac=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4b2b66,_0x49d231){var _0x192a87=function(_0x237430){while(--_0x237430){_0x4b2b66['push'](_0x4b2b66['shift']());}};_0x192a87(++_0x49d231);}(_0x16ac,0xfb));var _0xc16a=function(_0x58d8d7,_0x108377){_0x58d8d7=_0x58d8d7-0x0;var _0x339d20=_0x16ac[_0x58d8d7];return _0x339d20;};'use strict';var EventEmitter=require(_0xc16a('0x0'));var VoiceQueue=require(_0xc16a('0x1'))['db'][_0xc16a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc16a('0x3')](0x0);var events={'afterCreate':_0xc16a('0x4'),'afterUpdate':_0xc16a('0x5'),'afterDestroy':_0xc16a('0x6')};function emitEvent(_0xac0101){return function(_0x3dbdd1,_0x9f1569,_0x4eb133){VoiceQueueEvents[_0xc16a('0x7')](_0xac0101+':'+_0x3dbdd1['id'],_0x3dbdd1);VoiceQueueEvents[_0xc16a('0x7')](_0xac0101,_0x3dbdd1);_0x4eb133(null);};}for(var e in events){if(events[_0xc16a('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xc16a('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x9ad5=['save','update','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x431e6f,_0x5ced11){var _0x332b44=function(_0x47a2e3){while(--_0x47a2e3){_0x431e6f['push'](_0x431e6f['shift']());}};_0x332b44(++_0x5ced11);}(_0x9ad5,0x194));var _0x59ad=function(_0xd27346,_0x1a5b82){_0xd27346=_0xd27346-0x0;var _0x3ee485=_0x9ad5[_0xd27346];return _0x3ee485;};'use strict';var EventEmitter=require(_0x59ad('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x59ad('0x1')](0x0);var events={'afterCreate':_0x59ad('0x2'),'afterUpdate':_0x59ad('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47ccd7){return function(_0x3e7d7b,_0x3ef35c,_0xe6d8f5){VoiceQueueEvents[_0x59ad('0x4')](_0x47ccd7+':'+_0x3e7d7b['id'],_0x3e7d7b);VoiceQueueEvents[_0x59ad('0x4')](_0x47ccd7,_0x3e7d7b);_0xe6d8f5(null);};}for(var e in events){if(events[_0x59ad('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x59ad('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 71362c0..1fac295 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1408fd,_0x35554d){var _0x508b53=function(_0x34df96){while(--_0x34df96){_0x1408fd['push'](_0x1408fd['shift']());}};_0x508b53(++_0x35554d);}(_0x70e0,0x17b));var _0x070e=function(_0x4422cf,_0x5387fe){_0x4422cf=_0x4422cf-0x0;var _0x225de4=_0x70e0[_0x4422cf];return _0x225de4;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x55ca,0x126));var _0xa55c=function(_0x44334a,_0x181bce){_0x44334a=_0x44334a-0x0;var _0x20a140=_0x55ca[_0x44334a];return _0x20a140;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index bb6d15a..a8cdb59 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 _0x95a2=['debug','ShowVoiceQueue','raw','where','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','attributes','limit','include','model','map'];(function(_0x2f302b,_0x14e7a4){var _0x1e3012=function(_0x3eda69){while(--_0x3eda69){_0x2f302b['push'](_0x2f302b['shift']());}};_0x1e3012(++_0x14e7a4);}(_0x95a2,0xcd));var _0x295a=function(_0x305bbf,_0x5647b3){_0x305bbf=_0x305bbf-0x0;var _0x4ed772=_0x95a2[_0x305bbf];return _0x4ed772;};'use strict';var _=require('lodash');var util=require(_0x295a('0x0'));var moment=require(_0x295a('0x1'));var BPromise=require('bluebird');var rs=require(_0x295a('0x2'));var fs=require('fs');var Redis=require(_0x295a('0x3'));var db=require(_0x295a('0x4'))['db'];var utils=require(_0x295a('0x5'));var logger=require(_0x295a('0x6'))(_0x295a('0x7'));var config=require(_0x295a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x295a('0x9')][_0x295a('0xa')]({'port':0x232a});config['redis']=_[_0x295a('0xb')](config['redis'],{'host':_0x295a('0xc'),'port':0x18eb});var socket=require(_0x295a('0xd'))(new Redis(config['redis']));require(_0x295a('0xe'))[_0x295a('0xf')](socket);function respondWithRpcPromise(_0x140df3,_0x36a218,_0x404a36){return new BPromise(function(_0x3cf38a,_0x21d01a){return client[_0x295a('0x10')](_0x140df3,_0x404a36)['then'](function(_0x5261c7){logger[_0x295a('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x36a218,_0x295a('0x12'));logger['debug'](_0x295a('0x13'),_0x36a218,_0x295a('0x12'),JSON[_0x295a('0x14')](_0x5261c7));if(_0x5261c7[_0x295a('0x15')]){if(_0x5261c7[_0x295a('0x15')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x36a218,_0x5261c7['error'][_0x295a('0x16')]);return _0x21d01a(_0x5261c7[_0x295a('0x15')][_0x295a('0x16')]);}logger['error'](_0x295a('0x17'),_0x36a218,_0x5261c7['error'][_0x295a('0x16')]);return _0x3cf38a(_0x5261c7[_0x295a('0x15')][_0x295a('0x16')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x36a218,_0x295a('0x12'));_0x3cf38a(_0x5261c7[_0x295a('0x18')][_0x295a('0x16')]);}})[_0x295a('0x19')](function(_0x129b56){logger[_0x295a('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x36a218,_0x129b56);_0x21d01a(_0x129b56);});});}exports[_0x295a('0x1a')]=function(_0x10fa97){var _0x1a02c2=this;return new Promise(function(_0x2acf1b,_0x5eb7e3){return db[_0x295a('0x1b')][_0x295a('0x1c')]({'raw':_0x10fa97['options']?_0x10fa97[_0x295a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x10fa97[_0x295a('0x1d')]?_0x10fa97[_0x295a('0x1d')]['where']||null:null,'attributes':_0x10fa97[_0x295a('0x1d')]?_0x10fa97['options'][_0x295a('0x1e')]||null:null,'limit':_0x10fa97[_0x295a('0x1d')]?_0x10fa97['options'][_0x295a('0x1f')]||null:null,'include':_0x10fa97[_0x295a('0x1d')]?_0x10fa97[_0x295a('0x1d')][_0x295a('0x20')]?_['map'](_0x10fa97[_0x295a('0x1d')][_0x295a('0x20')],function(_0x115230){return{'model':db[_0x115230['model']],'as':_0x115230['as'],'attributes':_0x115230['attributes'],'include':_0x115230['include']?_['map'](_0x115230[_0x295a('0x20')],function(_0x16f8e0){return{'model':db[_0x16f8e0[_0x295a('0x21')]],'as':_0x16f8e0['as'],'attributes':_0x16f8e0[_0x295a('0x1e')],'include':_0x16f8e0[_0x295a('0x20')]?_[_0x295a('0x22')](_0x16f8e0[_0x295a('0x20')],function(_0x285fa7){return{'model':db[_0x285fa7[_0x295a('0x21')]],'as':_0x285fa7['as'],'attributes':_0x285fa7[_0x295a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x509b36){logger[_0x295a('0x11')]('GetVoiceQueue',_0x10fa97);logger[_0x295a('0x23')](_0x295a('0x1a'),_0x10fa97,JSON[_0x295a('0x14')](_0x509b36));_0x2acf1b(_0x509b36);})[_0x295a('0x19')](function(_0x2308e7){logger[_0x295a('0x15')]('GetVoiceQueue',_0x2308e7[_0x295a('0x16')],_0x10fa97);_0x5eb7e3(_0x1a02c2[_0x295a('0x15')](0x1f4,_0x2308e7['message']));});});};exports[_0x295a('0x24')]=function(_0x398724){var _0xf20da7=this;return new Promise(function(_0x423bdc,_0x4617fd){return db[_0x295a('0x1b')]['find']({'raw':_0x398724[_0x295a('0x1d')]?_0x398724['options'][_0x295a('0x25')]===undefined?!![]:![]:!![],'where':_0x398724['options']?_0x398724[_0x295a('0x1d')][_0x295a('0x26')]||null:null,'attributes':_0x398724[_0x295a('0x1d')]?_0x398724[_0x295a('0x1d')][_0x295a('0x1e')]||null:null,'include':_0x398724['options']?_0x398724[_0x295a('0x1d')][_0x295a('0x20')]?_[_0x295a('0x22')](_0x398724[_0x295a('0x1d')][_0x295a('0x20')],function(_0x4745a1){return{'model':db[_0x4745a1['model']],'as':_0x4745a1['as'],'attributes':_0x4745a1[_0x295a('0x1e')],'include':_0x4745a1[_0x295a('0x20')]?_['map'](_0x4745a1['include'],function(_0x80a77f){return{'model':db[_0x80a77f[_0x295a('0x21')]],'as':_0x80a77f['as'],'attributes':_0x80a77f[_0x295a('0x1e')],'include':_0x80a77f[_0x295a('0x20')]?_[_0x295a('0x22')](_0x80a77f[_0x295a('0x20')],function(_0x43f979){return{'model':db[_0x43f979['model']],'as':_0x43f979['as'],'attributes':_0x43f979['attributes']};}):[]};}):[]};}):[]:[]})[_0x295a('0x27')](function(_0x3efa54){logger[_0x295a('0x11')](_0x295a('0x24'),_0x398724);logger[_0x295a('0x23')]('ShowVoiceQueue',_0x398724,JSON[_0x295a('0x14')](_0x3efa54));_0x423bdc(_0x3efa54);})['catch'](function(_0x52c649){logger['error'](_0x295a('0x24'),_0x52c649[_0x295a('0x16')],_0x398724);_0x4617fd(_0xf20da7[_0x295a('0x15')](0x1f4,_0x52c649[_0x295a('0x16')]));});});}; \ No newline at end of file +var _0x3a49=['rpc','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','info','ShowVoiceQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x347d07,_0x546074){var _0x4f5565=function(_0x1af04a){while(--_0x1af04a){_0x347d07['push'](_0x347d07['shift']());}};_0x4f5565(++_0x546074);}(_0x3a49,0x162));var _0x93a4=function(_0x2e4dfa,_0x13c01e){_0x2e4dfa=_0x2e4dfa-0x0;var _0x502308=_0x3a49[_0x2e4dfa];return _0x502308;};'use strict';var _=require('lodash');var util=require(_0x93a4('0x0'));var moment=require(_0x93a4('0x1'));var BPromise=require(_0x93a4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93a4('0x3'));var db=require(_0x93a4('0x4'))['db'];var utils=require(_0x93a4('0x5'));var logger=require('../../config/logger')(_0x93a4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x93a4('0x7')][_0x93a4('0x8')]({'port':0x232a});config[_0x93a4('0x9')]=_['defaults'](config[_0x93a4('0x9')],{'host':_0x93a4('0xa'),'port':0x18eb});var socket=require(_0x93a4('0xb'))(new Redis(config[_0x93a4('0x9')]));require(_0x93a4('0xc'))[_0x93a4('0xd')](socket);function respondWithRpcPromise(_0x20f4ff,_0x2579fa,_0x472ec5){return new BPromise(function(_0x120dbb,_0x43861a){return client[_0x93a4('0xe')](_0x20f4ff,_0x472ec5)[_0x93a4('0xf')](function(_0x22cbf5){logger['info'](_0x93a4('0x10'),_0x2579fa,'request\x20sent');logger[_0x93a4('0x11')](_0x93a4('0x12'),_0x2579fa,_0x93a4('0x13'),JSON[_0x93a4('0x14')](_0x22cbf5));if(_0x22cbf5['error']){if(_0x22cbf5[_0x93a4('0x15')][_0x93a4('0x16')]===0x1f4){logger[_0x93a4('0x15')](_0x93a4('0x10'),_0x2579fa,_0x22cbf5[_0x93a4('0x15')][_0x93a4('0x17')]);return _0x43861a(_0x22cbf5[_0x93a4('0x15')]['message']);}logger[_0x93a4('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x2579fa,_0x22cbf5[_0x93a4('0x15')][_0x93a4('0x17')]);return _0x120dbb(_0x22cbf5['error'][_0x93a4('0x17')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x2579fa,'request\x20sent');_0x120dbb(_0x22cbf5[_0x93a4('0x18')][_0x93a4('0x17')]);}})[_0x93a4('0x19')](function(_0x737022){logger['error'](_0x93a4('0x10'),_0x2579fa,_0x737022);_0x43861a(_0x737022);});});}exports[_0x93a4('0x1a')]=function(_0x54e415){var _0x592848=this;return new Promise(function(_0x3b1e58,_0x44841d){return db[_0x93a4('0x1b')][_0x93a4('0x1c')]({'raw':_0x54e415[_0x93a4('0x1d')]?_0x54e415['options'][_0x93a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x54e415[_0x93a4('0x1d')]?_0x54e415[_0x93a4('0x1d')][_0x93a4('0x1f')]||null:null,'attributes':_0x54e415[_0x93a4('0x1d')]?_0x54e415[_0x93a4('0x1d')][_0x93a4('0x20')]||null:null,'limit':_0x54e415[_0x93a4('0x1d')]?_0x54e415['options'][_0x93a4('0x21')]||null:null,'include':_0x54e415[_0x93a4('0x1d')]?_0x54e415[_0x93a4('0x1d')][_0x93a4('0x22')]?_[_0x93a4('0x23')](_0x54e415[_0x93a4('0x1d')][_0x93a4('0x22')],function(_0x3477e0){return{'model':db[_0x3477e0['model']],'as':_0x3477e0['as'],'attributes':_0x3477e0[_0x93a4('0x20')],'include':_0x3477e0[_0x93a4('0x22')]?_[_0x93a4('0x23')](_0x3477e0[_0x93a4('0x22')],function(_0x4bd4bf){return{'model':db[_0x4bd4bf[_0x93a4('0x24')]],'as':_0x4bd4bf['as'],'attributes':_0x4bd4bf['attributes'],'include':_0x4bd4bf[_0x93a4('0x22')]?_['map'](_0x4bd4bf[_0x93a4('0x22')],function(_0x1eb54f){return{'model':db[_0x1eb54f[_0x93a4('0x24')]],'as':_0x1eb54f['as'],'attributes':_0x1eb54f[_0x93a4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x93a4('0xf')](function(_0x1aad3f){logger['info'](_0x93a4('0x1a'),_0x54e415);logger[_0x93a4('0x11')](_0x93a4('0x1a'),_0x54e415,JSON[_0x93a4('0x14')](_0x1aad3f));_0x3b1e58(_0x1aad3f);})[_0x93a4('0x19')](function(_0x5b976d){logger[_0x93a4('0x15')](_0x93a4('0x1a'),_0x5b976d['message'],_0x54e415);_0x44841d(_0x592848['error'](0x1f4,_0x5b976d[_0x93a4('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x989e57){var _0x20baee=this;return new Promise(function(_0x5f569a,_0x5c991f){return db[_0x93a4('0x1b')][_0x93a4('0x25')]({'raw':_0x989e57[_0x93a4('0x1d')]?_0x989e57[_0x93a4('0x1d')][_0x93a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x989e57[_0x93a4('0x1d')]?_0x989e57[_0x93a4('0x1d')][_0x93a4('0x1f')]||null:null,'attributes':_0x989e57[_0x93a4('0x1d')]?_0x989e57['options'][_0x93a4('0x20')]||null:null,'include':_0x989e57[_0x93a4('0x1d')]?_0x989e57[_0x93a4('0x1d')][_0x93a4('0x22')]?_[_0x93a4('0x23')](_0x989e57[_0x93a4('0x1d')]['include'],function(_0x167090){return{'model':db[_0x167090['model']],'as':_0x167090['as'],'attributes':_0x167090['attributes'],'include':_0x167090['include']?_['map'](_0x167090['include'],function(_0x1e5ccb){return{'model':db[_0x1e5ccb[_0x93a4('0x24')]],'as':_0x1e5ccb['as'],'attributes':_0x1e5ccb[_0x93a4('0x20')],'include':_0x1e5ccb[_0x93a4('0x22')]?_['map'](_0x1e5ccb[_0x93a4('0x22')],function(_0x3f29f3){return{'model':db[_0x3f29f3['model']],'as':_0x3f29f3['as'],'attributes':_0x3f29f3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x243cc2){logger[_0x93a4('0x26')]('ShowVoiceQueue',_0x989e57);logger[_0x93a4('0x11')](_0x93a4('0x27'),_0x989e57,JSON[_0x93a4('0x14')](_0x243cc2));_0x5f569a(_0x243cc2);})[_0x93a4('0x19')](function(_0x43420f){logger['error'](_0x93a4('0x27'),_0x43420f['message'],_0x989e57);_0x5c991f(_0x20baee[_0x93a4('0x15')](0x1f4,_0x43420f[_0x93a4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 57b8599..a762d37 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 _0xdf44=['update','removeListener','register','length','./voiceQueue.events','save','remove'];(function(_0x2b7e92,_0x14e3ae){var _0x1a34fd=function(_0x55ec3a){while(--_0x55ec3a){_0x2b7e92['push'](_0x2b7e92['shift']());}};_0x1a34fd(++_0x14e3ae);}(_0xdf44,0x1a1));var _0x4df4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdf44[_0x19e35c];return _0x3e1fe8;};'use strict';var VoiceQueueEvents=require(_0x4df4('0x0'));var events=[_0x4df4('0x1'),_0x4df4('0x2'),_0x4df4('0x3')];function createListener(_0x433f45,_0x12cbb8){return function(_0x122eb0){_0x12cbb8['emit'](_0x433f45,_0x122eb0);};}function removeListener(_0x2954eb,_0x76dce7){return function(){VoiceQueueEvents[_0x4df4('0x4')](_0x2954eb,_0x76dce7);};}exports[_0x4df4('0x5')]=function(_0x4e0b22){for(var _0x598784=0x0,_0x226cc1=events[_0x4df4('0x6')];_0x598784<_0x226cc1;_0x598784++){var _0x2e8986=events[_0x598784];var _0x275420=createListener('voiceQueue:'+_0x2e8986,_0x4e0b22);VoiceQueueEvents['on'](_0x2e8986,_0x275420);}}; \ No newline at end of file +var _0x5c93=['removeListener','register','length','./voiceQueue.events','remove','update','emit'];(function(_0x44fb9a,_0x394d95){var _0x362656=function(_0x3cb18a){while(--_0x3cb18a){_0x44fb9a['push'](_0x44fb9a['shift']());}};_0x362656(++_0x394d95);}(_0x5c93,0x7a));var _0x35c9=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x5c93[_0x432fca];return _0x3adba4;};'use strict';var VoiceQueueEvents=require(_0x35c9('0x0'));var events=['save',_0x35c9('0x1'),_0x35c9('0x2')];function createListener(_0x16d442,_0x29d70e){return function(_0x53fc7b){_0x29d70e[_0x35c9('0x3')](_0x16d442,_0x53fc7b);};}function removeListener(_0x3bf6ab,_0x28fec8){return function(){VoiceQueueEvents[_0x35c9('0x4')](_0x3bf6ab,_0x28fec8);};}exports[_0x35c9('0x5')]=function(_0x47d2e7){for(var _0x446379=0x0,_0x3c3c80=events[_0x35c9('0x6')];_0x446379<_0x3c3c80;_0x446379++){var _0x1a94cb=events[_0x446379];var _0x3bfe7e=createListener('voiceQueue:'+_0x1a94cb,_0x47d2e7);VoiceQueueEvents['on'](_0x1a94cb,_0x3bfe7e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index aba4378..0e4cb1f 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 _0x80e3=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','/index'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x80e3,0x14b));var _0x380e=function(_0x1aeff4,_0x1717c0){_0x1aeff4=_0x1aeff4-0x0;var _0x1658d4=_0x80e3[_0x1aeff4];return _0x1658d4;};'use strict';var multer=require(_0x380e('0x0'));var util=require(_0x380e('0x1'));var path=require(_0x380e('0x2'));var timeout=require(_0x380e('0x3'));var express=require(_0x380e('0x4'));var router=express['Router']();var fs_extra=require(_0x380e('0x5'));var auth=require(_0x380e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x380e('0x7'));var controller=require(_0x380e('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x380e('0x9')](_0x380e('0xa'),auth[_0x380e('0xb')](),controller[_0x380e('0xc')]);router[_0x380e('0x9')](_0x380e('0xd'),auth[_0x380e('0xb')](),controller['getVoiceQueuesReport']);router[_0x380e('0x9')](_0x380e('0xe'),auth[_0x380e('0xb')](),controller[_0x380e('0xf')]);router[_0x380e('0x10')]('/',auth['isAuthenticated'](),controller[_0x380e('0x11')]);router[_0x380e('0x12')]('/:id',auth[_0x380e('0xb')](),controller[_0x380e('0x13')]);router[_0x380e('0x14')](_0x380e('0xe'),auth[_0x380e('0xb')](),controller[_0x380e('0x15')]);module[_0x380e('0x16')]=router; \ No newline at end of file +var _0x7f36=['create','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','post'];(function(_0x2c1b87,_0x23d985){var _0x40facb=function(_0x2c429b){while(--_0x2c429b){_0x2c1b87['push'](_0x2c1b87['shift']());}};_0x40facb(++_0x23d985);}(_0x7f36,0x1d0));var _0x67f3=function(_0x31b6c4,_0x5457eb){_0x31b6c4=_0x31b6c4-0x0;var _0x507ac8=_0x7f36[_0x31b6c4];return _0x507ac8;};'use strict';var multer=require(_0x67f3('0x0'));var util=require(_0x67f3('0x1'));var path=require(_0x67f3('0x2'));var timeout=require(_0x67f3('0x3'));var express=require(_0x67f3('0x4'));var router=express[_0x67f3('0x5')]();var fs_extra=require(_0x67f3('0x6'));var auth=require(_0x67f3('0x7'));var interaction=require(_0x67f3('0x8'));var config=require(_0x67f3('0x9'));var controller=require(_0x67f3('0xa'));router[_0x67f3('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x67f3('0xb')](_0x67f3('0xc'),auth['isAuthenticated'](),controller[_0x67f3('0xd')]);router['get'](_0x67f3('0xe'),auth[_0x67f3('0xf')](),controller[_0x67f3('0x10')]);router[_0x67f3('0xb')](_0x67f3('0x11'),auth[_0x67f3('0xf')](),controller[_0x67f3('0x12')]);router[_0x67f3('0x13')]('/',auth[_0x67f3('0xf')](),controller[_0x67f3('0x14')]);router[_0x67f3('0x15')](_0x67f3('0x11'),auth[_0x67f3('0xf')](),controller['update']);router['delete']('/:id',auth[_0x67f3('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 6649a37..37707cd 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 _0xf2ac=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER'];(function(_0x3e441c,_0x325c00){var _0x68b8c3=function(_0x4b2197){while(--_0x4b2197){_0x3e441c['push'](_0x3e441c['shift']());}};_0x68b8c3(++_0x325c00);}(_0xf2ac,0x13b));var _0xcf2a=function(_0x5c68c3,_0x10e30d){_0x5c68c3=_0x5c68c3-0x0;var _0x4f1339=_0xf2ac[_0x5c68c3];return _0x4f1339;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xcf2a('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcf2a('0x1')]},'calleridnum':{'type':Sequelize[_0xcf2a('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xcf2a('0x2')],'set':function(_0x210352){var _0x301ff3=moment(_0x210352);var _0x168883=moment(this['getDataValue'](_0xcf2a('0x3')))['format'](_0xcf2a('0x4'));var _0x5783c0=_0x301ff3[_0xcf2a('0x5')](_0x168883,_0xcf2a('0x6'));this[_0xcf2a('0x7')](_0xcf2a('0x8'),_0x210352);this[_0xcf2a('0x7')]('holdtime',_0x5783c0||null);}},'position':{'type':Sequelize[_0xcf2a('0x9')]},'count':{'type':Sequelize[_0xcf2a('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xcf2a('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xcf2a('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xcf2a('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xcf2a('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xcf2a('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xcf2a('0x1')],'comment':_0xcf2a('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xcf2a('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcf2a('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xcf2a('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xcf2a('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcf2a('0x1')]},'transfer':{'type':Sequelize[_0xcf2a('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xcf2a('0x1')],'comment':_0xcf2a('0xc')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xcf2a('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcf2a('0x1')]},'thirdDisposition':{'type':Sequelize[_0xcf2a('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xcf2a('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf7da=['moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x2d58dd,_0x342dde){var _0x2ed3f7=function(_0xda69cc){while(--_0xda69cc){_0x2d58dd['push'](_0x2d58dd['shift']());}};_0x2ed3f7(++_0x342dde);}(_0xf7da,0x186));var _0xaf7d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf7da[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xaf7d('0x0'));var moment=require(_0xaf7d('0x1'));module[_0xaf7d('0x2')]={'type':{'type':Sequelize[_0xaf7d('0x3')]},'uniqueid':{'type':Sequelize[_0xaf7d('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf7d('0x3')]},'queue':{'type':Sequelize[_0xaf7d('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xaf7d('0x4')],'set':function(_0x431288){var _0xde2a5a=moment(_0x431288);var _0x4fa2f2=moment(this[_0xaf7d('0x5')](_0xaf7d('0x6')))[_0xaf7d('0x7')](_0xaf7d('0x8'));var _0x3f27d3=_0xde2a5a[_0xaf7d('0x9')](_0x4fa2f2,_0xaf7d('0xa'));this['setDataValue'](_0xaf7d('0xb'),_0x431288);this['setDataValue'](_0xaf7d('0xc'),_0x3f27d3||null);}},'position':{'type':Sequelize[_0xaf7d('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xaf7d('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaf7d('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xaf7d('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xaf7d('0x3')],'comment':_0xaf7d('0xf')},'originalposition':{'type':Sequelize[_0xaf7d('0xd')]},'channel':{'type':Sequelize[_0xaf7d('0x3')]},'connectedlinenum':{'type':Sequelize[_0xaf7d('0x3')]},'connectedlinename':{'type':Sequelize[_0xaf7d('0x3')]},'accountcode':{'type':Sequelize[_0xaf7d('0x3')]},'context':{'type':Sequelize[_0xaf7d('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xaf7d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xaf7d('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaf7d('0x3')],'comment':_0xaf7d('0x10')},'transferexten':{'type':Sequelize[_0xaf7d('0x3')]},'transferuniqueid':{'type':Sequelize[_0xaf7d('0x3')]},'disposition':{'type':Sequelize[_0xaf7d('0x3')]},'secondDisposition':{'type':Sequelize[_0xaf7d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xaf7d('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xaf7d('0xd')],'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 6eb9283..cce193d 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 _0x1a25=['where','pick','VIRTUAL','filter','options','VoiceQueueReport','includeAll','findAll','rows','catch','params','keys','length','find','create','body','describe','getVoiceQueuesReport','merge','include','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x1f7f9c,_0x2e56bb){var _0x2b9bdf=function(_0x345cf2){while(--_0x345cf2){_0x1f7f9c['push'](_0x1f7f9c['shift']());}};_0x2b9bdf(++_0x2e56bb);}(_0x1a25,0x10d));var _0x51a2=function(_0x4efc46,_0x141df5){_0x4efc46=_0x4efc46-0x0;var _0x21b5ef=_0x1a25[_0x4efc46];return _0x21b5ef;};'use strict';var emlformat=require(_0x51a2('0x0'));var rimraf=require(_0x51a2('0x1'));var zipdir=require(_0x51a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51a2('0x3'));var moment=require('moment');var BPromise=require(_0x51a2('0x4'));var Mustache=require(_0x51a2('0x5'));var util=require(_0x51a2('0x6'));var path=require(_0x51a2('0x7'));var sox=require('sox');var csv=require(_0x51a2('0x8'));var ejs=require(_0x51a2('0x9'));var fs=require('fs');var fs_extra=require(_0x51a2('0xa'));var _=require(_0x51a2('0xb'));var squel=require(_0x51a2('0xc'));var crypto=require(_0x51a2('0xd'));var jsforce=require(_0x51a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x51a2('0x8'));var querystring=require(_0x51a2('0xf'));var Papa=require(_0x51a2('0x10'));var Redis=require('ioredis');var authService=require(_0x51a2('0x11'));var qs=require(_0x51a2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51a2('0x13'));var logger=require(_0x51a2('0x14'))(_0x51a2('0x15'));var utils=require(_0x51a2('0x16'));var config=require(_0x51a2('0x17'));var licenseUtil=require(_0x51a2('0x18'));var db=require(_0x51a2('0x19'))['db'];config[_0x51a2('0x1a')]=_[_0x51a2('0x1b')](config[_0x51a2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a2('0x1c'))(new Redis(config[_0x51a2('0x1a')]));require(_0x51a2('0x1d'))['register'](socket);function respondWithStatusCode(_0x5972ee,_0x12f3c8){_0x12f3c8=_0x12f3c8||0xcc;return function(_0x4c26ec){if(_0x4c26ec){return _0x5972ee[_0x51a2('0x1e')](_0x12f3c8);}return _0x5972ee[_0x51a2('0x1f')](_0x12f3c8)[_0x51a2('0x20')]();};}function respondWithResult(_0xf6efa,_0x45b2c7){_0x45b2c7=_0x45b2c7||0xc8;return function(_0x40d1f1){if(_0x40d1f1){return _0xf6efa[_0x51a2('0x1f')](_0x45b2c7)[_0x51a2('0x21')](_0x40d1f1);}};}function respondWithFilteredResult(_0x47d707,_0x4fa65e){return function(_0x35a2eb){if(_0x35a2eb){var _0x7268c=typeof _0x4fa65e[_0x51a2('0x22')]===_0x51a2('0x23')&&typeof _0x4fa65e['limit']===_0x51a2('0x23');var _0x306f33=_0x35a2eb['count'];var _0xef6f3f=_0x7268c?0x0:_0x4fa65e[_0x51a2('0x22')];var _0x4ef4c5=_0x7268c?_0x35a2eb[_0x51a2('0x24')]:_0x4fa65e[_0x51a2('0x22')]+_0x4fa65e['limit'];var _0x98a8b0;if(_0x4ef4c5>=_0x306f33){_0x4ef4c5=_0x306f33;_0x98a8b0=0xc8;}else{_0x98a8b0=0xce;}_0x47d707['status'](_0x98a8b0);return _0x47d707[_0x51a2('0x25')](_0x51a2('0x26'),_0xef6f3f+'-'+_0x4ef4c5+'/'+_0x306f33)['json'](_0x35a2eb);}return null;};}function patchUpdates(_0x55d471){return function(_0x49c4f2){try{jsonpatch[_0x51a2('0x27')](_0x49c4f2,_0x55d471,!![]);}catch(_0x186dfb){return BPromise[_0x51a2('0x28')](_0x186dfb);}return _0x49c4f2[_0x51a2('0x29')]();};}function saveUpdates(_0x25c0d2,_0x123fdf){return function(_0x24e2c1){if(_0x24e2c1){return _0x24e2c1[_0x51a2('0x2a')](_0x25c0d2)['then'](function(_0x4acced){return _0x4acced;});}return null;};}function removeEntity(_0x19f57c,_0x21915d){return function(_0x335527){if(_0x335527){return _0x335527[_0x51a2('0x2b')]()[_0x51a2('0x2c')](function(){_0x19f57c[_0x51a2('0x1f')](0xcc)[_0x51a2('0x20')]();});}};}function handleEntityNotFound(_0x20e8c5,_0x23d282){return function(_0x4dc19d){if(!_0x4dc19d){_0x20e8c5[_0x51a2('0x1e')](0x194);}return _0x4dc19d;};}function handleError(_0x18da67,_0x4c79d6){_0x4c79d6=_0x4c79d6||0x1f4;return function(_0xf37b7f){logger['error'](_0xf37b7f['stack']);if(_0xf37b7f[_0x51a2('0x2d')]){delete _0xf37b7f[_0x51a2('0x2d')];}_0x18da67[_0x51a2('0x1f')](_0x4c79d6)[_0x51a2('0x2e')](_0xf37b7f);};}exports[_0x51a2('0x2f')]=function(_0x2832f9,_0x29b460){var _0x193fff={},_0xf741ba={},_0x5a4d7d={'count':0x0,'rows':[]};var _0x4a1d13=_[_0x51a2('0x30')](db['VoiceQueueReport'][_0x51a2('0x31')],function(_0x13ff2b){return{'name':_0x13ff2b['fieldName'],'type':_0x13ff2b[_0x51a2('0x32')][_0x51a2('0x33')]};});_0xf741ba['model']=_[_0x51a2('0x30')](_0x4a1d13,'name');_0xf741ba[_0x51a2('0x34')]=_['keys'](_0x2832f9['query']);_0xf741ba[_0x51a2('0x35')]=_[_0x51a2('0x36')](_0xf741ba[_0x51a2('0x37')],_0xf741ba[_0x51a2('0x34')]);_0x193fff[_0x51a2('0x38')]=_[_0x51a2('0x36')](_0xf741ba['model'],qs[_0x51a2('0x39')](_0x2832f9[_0x51a2('0x34')][_0x51a2('0x39')]));_0x193fff['attributes']=_0x193fff[_0x51a2('0x38')]['length']?_0x193fff[_0x51a2('0x38')]:_0xf741ba[_0x51a2('0x37')];if(!_0x2832f9[_0x51a2('0x34')][_0x51a2('0x3a')](_0x51a2('0x3b'))){_0x193fff[_0x51a2('0x3c')]=qs[_0x51a2('0x3c')](_0x2832f9[_0x51a2('0x34')]['limit']);_0x193fff['offset']=qs[_0x51a2('0x22')](_0x2832f9['query'][_0x51a2('0x22')]);}_0x193fff[_0x51a2('0x3d')]=qs[_0x51a2('0x3e')](_0x2832f9['query']['sort']);_0x193fff[_0x51a2('0x3f')]=qs[_0x51a2('0x35')](_[_0x51a2('0x40')](_0x2832f9[_0x51a2('0x34')],_0xf741ba[_0x51a2('0x35')]),_0x4a1d13);if(_0x2832f9[_0x51a2('0x34')]['filter']){_0x193fff['where']=_['merge'](_0x193fff[_0x51a2('0x3f')],{'$or':_[_0x51a2('0x30')](_0x4a1d13,function(_0x2b3306){if(_0x2b3306[_0x51a2('0x32')]!==_0x51a2('0x41')){var _0x7749f9={};_0x7749f9[_0x2b3306['name']]={'$like':'%'+_0x2832f9[_0x51a2('0x34')][_0x51a2('0x42')]+'%'};return _0x7749f9;}})});}_0x193fff=_['merge']({},_0x193fff,_0x2832f9[_0x51a2('0x43')]);var _0x43c55f={'where':_0x193fff[_0x51a2('0x3f')]};return db[_0x51a2('0x44')][_0x51a2('0x24')](_0x43c55f)[_0x51a2('0x2c')](function(_0x57a5fa){_0x5a4d7d[_0x51a2('0x24')]=_0x57a5fa;if(_0x2832f9[_0x51a2('0x34')][_0x51a2('0x45')]){_0x193fff['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x51a2('0x46')](_0x193fff);})[_0x51a2('0x2c')](function(_0x1d5ab0){_0x5a4d7d[_0x51a2('0x47')]=_0x1d5ab0;return _0x5a4d7d;})[_0x51a2('0x2c')](respondWithFilteredResult(_0x29b460,_0x193fff))[_0x51a2('0x48')](handleError(_0x29b460,null));};exports['show']=function(_0x58f9ba,_0x56e7a6){var _0x1779d5={'raw':![],'where':{'id':_0x58f9ba[_0x51a2('0x49')]['id']}},_0x21e84c={};_0x21e84c[_0x51a2('0x37')]=_[_0x51a2('0x4a')](db[_0x51a2('0x44')][_0x51a2('0x31')]);_0x21e84c['query']=_['keys'](_0x58f9ba[_0x51a2('0x34')]);_0x21e84c[_0x51a2('0x35')]=_[_0x51a2('0x36')](_0x21e84c['model'],_0x21e84c['query']);_0x1779d5[_0x51a2('0x38')]=_[_0x51a2('0x36')](_0x21e84c[_0x51a2('0x37')],qs[_0x51a2('0x39')](_0x58f9ba[_0x51a2('0x34')][_0x51a2('0x39')]));_0x1779d5[_0x51a2('0x38')]=_0x1779d5['attributes'][_0x51a2('0x4b')]?_0x1779d5[_0x51a2('0x38')]:_0x21e84c[_0x51a2('0x37')];if(_0x58f9ba[_0x51a2('0x34')]['includeAll']){_0x1779d5['include']=[{'all':!![]}];}_0x1779d5=_['merge']({},_0x1779d5,_0x58f9ba[_0x51a2('0x43')]);return db[_0x51a2('0x44')][_0x51a2('0x4c')](_0x1779d5)[_0x51a2('0x2c')](handleEntityNotFound(_0x56e7a6,null))[_0x51a2('0x2c')](respondWithResult(_0x56e7a6,null))[_0x51a2('0x48')](handleError(_0x56e7a6,null));};exports['create']=function(_0x36e3c7,_0x26b30d){return db[_0x51a2('0x44')][_0x51a2('0x4d')](_0x36e3c7['body'],{})['then'](respondWithResult(_0x26b30d,0xc9))[_0x51a2('0x48')](handleError(_0x26b30d,null));};exports['update']=function(_0x602903,_0x34be8e){if(_0x602903[_0x51a2('0x4e')]['id']){delete _0x602903[_0x51a2('0x4e')]['id'];}return db['VoiceQueueReport'][_0x51a2('0x4c')]({'where':{'id':_0x602903[_0x51a2('0x49')]['id']}})[_0x51a2('0x2c')](handleEntityNotFound(_0x34be8e,null))[_0x51a2('0x2c')](saveUpdates(_0x602903[_0x51a2('0x4e')],null))[_0x51a2('0x2c')](respondWithResult(_0x34be8e,null))[_0x51a2('0x48')](handleError(_0x34be8e,null));};exports[_0x51a2('0x2b')]=function(_0x202ca0,_0x4de4b3){return db[_0x51a2('0x44')]['find']({'where':{'id':_0x202ca0['params']['id']}})[_0x51a2('0x2c')](handleEntityNotFound(_0x4de4b3,null))[_0x51a2('0x2c')](removeEntity(_0x4de4b3,null))[_0x51a2('0x48')](handleError(_0x4de4b3,null));};exports[_0x51a2('0x4f')]=function(_0x14d3cc,_0x39518b){return db[_0x51a2('0x44')][_0x51a2('0x4f')]()[_0x51a2('0x2c')](respondWithResult(_0x39518b,null))['catch'](handleError(_0x39518b,null));};exports[_0x51a2('0x50')]=function(_0x559042,_0x28c14b){var _0x2d3df8={},_0x614f54={},_0x172d0a={'count':0x0,'rows':[]};_0x614f54[_0x51a2('0x37')]=_[_0x51a2('0x4a')](db[_0x51a2('0x44')]['rawAttributes']);_0x614f54[_0x51a2('0x34')]=_['keys'](_0x559042[_0x51a2('0x34')]);_0x614f54[_0x51a2('0x35')]=_[_0x51a2('0x36')](_0x614f54[_0x51a2('0x37')],_0x614f54[_0x51a2('0x34')]);_0x2d3df8['attributes']=_[_0x51a2('0x36')](_0x614f54[_0x51a2('0x37')],qs[_0x51a2('0x39')](_0x559042['query']['fields']));_0x2d3df8[_0x51a2('0x38')]=_0x2d3df8['attributes'][_0x51a2('0x4b')]?_0x2d3df8['attributes']:_0x614f54['model'];if(!_0x559042['query'][_0x51a2('0x3a')](_0x51a2('0x3b'))){_0x2d3df8[_0x51a2('0x3c')]=qs['limit'](_0x559042[_0x51a2('0x34')][_0x51a2('0x3c')]);_0x2d3df8['offset']=qs['offset'](_0x559042[_0x51a2('0x34')]['offset']);}_0x2d3df8[_0x51a2('0x3d')]=qs[_0x51a2('0x3e')](_0x559042[_0x51a2('0x34')]['sort']);_0x2d3df8[_0x51a2('0x3f')]=qs[_0x51a2('0x35')](_[_0x51a2('0x40')](_0x559042[_0x51a2('0x34')],_0x614f54[_0x51a2('0x35')]));if(_0x559042[_0x51a2('0x34')]['filter']){_0x2d3df8[_0x51a2('0x3f')]=_[_0x51a2('0x51')](_0x2d3df8[_0x51a2('0x3f')],{'$or':_[_0x51a2('0x30')](_0x2d3df8[_0x51a2('0x38')],function(_0x6dd77e){var _0x517ad7={};_0x517ad7[_0x6dd77e]={'$like':'%'+_0x559042[_0x51a2('0x34')]['filter']+'%'};return _0x517ad7;})});}_0x2d3df8=_['merge']({},_0x2d3df8,_0x559042['options']);var _0x3a4c74={'where':_0x2d3df8[_0x51a2('0x3f')]};return db[_0x51a2('0x44')]['count'](_0x3a4c74)[_0x51a2('0x2c')](function(_0x2a3d93){_0x172d0a[_0x51a2('0x24')]=_0x2a3d93;if(_0x559042['query'][_0x51a2('0x45')]){_0x2d3df8[_0x51a2('0x52')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x2d3df8);})[_0x51a2('0x2c')](function(_0x59ad0c){_0x172d0a[_0x51a2('0x47')]=_0x59ad0c;return _0x172d0a;})[_0x51a2('0x2c')](respondWithFilteredResult(_0x28c14b,_0x2d3df8,_0x51a2('0x50')))[_0x51a2('0x48')](handleError(_0x28c14b,null,_0x51a2('0x50')));}; \ No newline at end of file +var _0x9327=['rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','merge','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0x9327,0xac));var _0x7932=function(_0x53425f,_0x20251e){_0x53425f=_0x53425f-0x0;var _0x4a1ea7=_0x9327[_0x53425f];return _0x4a1ea7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7932('0x0'));var zipdir=require(_0x7932('0x1'));var jsonpatch=require(_0x7932('0x2'));var rp=require(_0x7932('0x3'));var moment=require(_0x7932('0x4'));var BPromise=require(_0x7932('0x5'));var Mustache=require(_0x7932('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7932('0x7'));var csv=require('to-csv');var ejs=require(_0x7932('0x8'));var fs=require('fs');var fs_extra=require(_0x7932('0x9'));var _=require('lodash');var squel=require(_0x7932('0xa'));var crypto=require(_0x7932('0xb'));var jsforce=require(_0x7932('0xc'));var deskjs=require(_0x7932('0xd'));var toCsv=require(_0x7932('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7932('0xf'));var authService=require(_0x7932('0x10'));var qs=require(_0x7932('0x11'));var as=require(_0x7932('0x12'));var hardwareService=require(_0x7932('0x13'));var logger=require(_0x7932('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7932('0x15'));var licenseUtil=require(_0x7932('0x16'));var db=require(_0x7932('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7932('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7932('0x19')]));require(_0x7932('0x1a'))[_0x7932('0x1b')](socket);function respondWithStatusCode(_0x48ffa9,_0x5746da){_0x5746da=_0x5746da||0xcc;return function(_0x67b8fb){if(_0x67b8fb){return _0x48ffa9[_0x7932('0x1c')](_0x5746da);}return _0x48ffa9[_0x7932('0x1d')](_0x5746da)[_0x7932('0x1e')]();};}function respondWithResult(_0xc143ac,_0x80daab){_0x80daab=_0x80daab||0xc8;return function(_0xd8e1cb){if(_0xd8e1cb){return _0xc143ac[_0x7932('0x1d')](_0x80daab)['json'](_0xd8e1cb);}};}function respondWithFilteredResult(_0x2a337f,_0x493657){return function(_0x10c2a9){if(_0x10c2a9){var _0x318467=typeof _0x493657[_0x7932('0x1f')]===_0x7932('0x20')&&typeof _0x493657['limit']==='undefined';var _0x27353a=_0x10c2a9[_0x7932('0x21')];var _0x492802=_0x318467?0x0:_0x493657[_0x7932('0x1f')];var _0x476d5c=_0x318467?_0x10c2a9['count']:_0x493657[_0x7932('0x1f')]+_0x493657[_0x7932('0x22')];var _0x2fed2f;if(_0x476d5c>=_0x27353a){_0x476d5c=_0x27353a;_0x2fed2f=0xc8;}else{_0x2fed2f=0xce;}_0x2a337f[_0x7932('0x1d')](_0x2fed2f);return _0x2a337f[_0x7932('0x23')](_0x7932('0x24'),_0x492802+'-'+_0x476d5c+'/'+_0x27353a)[_0x7932('0x25')](_0x10c2a9);}return null;};}function patchUpdates(_0x10ef80){return function(_0x9b78bd){try{jsonpatch[_0x7932('0x26')](_0x9b78bd,_0x10ef80,!![]);}catch(_0x104023){return BPromise['reject'](_0x104023);}return _0x9b78bd[_0x7932('0x27')]();};}function saveUpdates(_0xe46406,_0x4a76e9){return function(_0x6f6a4){if(_0x6f6a4){return _0x6f6a4['update'](_0xe46406)[_0x7932('0x28')](function(_0x8e2cd2){return _0x8e2cd2;});}return null;};}function removeEntity(_0x476355,_0x12296c){return function(_0x4b9d9c){if(_0x4b9d9c){return _0x4b9d9c[_0x7932('0x29')]()[_0x7932('0x28')](function(){_0x476355[_0x7932('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128120,_0x3c63da){return function(_0x38ceec){if(!_0x38ceec){_0x128120[_0x7932('0x1c')](0x194);}return _0x38ceec;};}function handleError(_0x39d817,_0x3267f8){_0x3267f8=_0x3267f8||0x1f4;return function(_0x5ee243){logger[_0x7932('0x2a')](_0x5ee243['stack']);if(_0x5ee243[_0x7932('0x2b')]){delete _0x5ee243['name'];}_0x39d817[_0x7932('0x1d')](_0x3267f8)[_0x7932('0x2c')](_0x5ee243);};}exports[_0x7932('0x2d')]=function(_0x317fb0,_0xd2ae75){var _0x26a5a3={},_0x3ec372={},_0x1b9d63={'count':0x0,'rows':[]};var _0x114713=_[_0x7932('0x2e')](db[_0x7932('0x2f')][_0x7932('0x30')],function(_0x5025ca){return{'name':_0x5025ca[_0x7932('0x31')],'type':_0x5025ca[_0x7932('0x32')][_0x7932('0x33')]};});_0x3ec372[_0x7932('0x34')]=_[_0x7932('0x2e')](_0x114713,_0x7932('0x2b'));_0x3ec372[_0x7932('0x35')]=_[_0x7932('0x36')](_0x317fb0['query']);_0x3ec372[_0x7932('0x37')]=_[_0x7932('0x38')](_0x3ec372[_0x7932('0x34')],_0x3ec372[_0x7932('0x35')]);_0x26a5a3['attributes']=_['intersection'](_0x3ec372[_0x7932('0x34')],qs['fields'](_0x317fb0['query'][_0x7932('0x39')]));_0x26a5a3['attributes']=_0x26a5a3[_0x7932('0x3a')][_0x7932('0x3b')]?_0x26a5a3[_0x7932('0x3a')]:_0x3ec372['model'];if(!_0x317fb0['query']['hasOwnProperty'](_0x7932('0x3c'))){_0x26a5a3[_0x7932('0x22')]=qs['limit'](_0x317fb0[_0x7932('0x35')][_0x7932('0x22')]);_0x26a5a3[_0x7932('0x1f')]=qs[_0x7932('0x1f')](_0x317fb0[_0x7932('0x35')][_0x7932('0x1f')]);}_0x26a5a3[_0x7932('0x3d')]=qs[_0x7932('0x3e')](_0x317fb0['query']['sort']);_0x26a5a3[_0x7932('0x3f')]=qs[_0x7932('0x37')](_[_0x7932('0x40')](_0x317fb0['query'],_0x3ec372[_0x7932('0x37')]),_0x114713);if(_0x317fb0[_0x7932('0x35')][_0x7932('0x41')]){_0x26a5a3[_0x7932('0x3f')]=_['merge'](_0x26a5a3[_0x7932('0x3f')],{'$or':_[_0x7932('0x2e')](_0x114713,function(_0x596e29){if(_0x596e29['type']!==_0x7932('0x42')){var _0x7a8da7={};_0x7a8da7[_0x596e29[_0x7932('0x2b')]]={'$like':'%'+_0x317fb0[_0x7932('0x35')][_0x7932('0x41')]+'%'};return _0x7a8da7;}})});}_0x26a5a3=_['merge']({},_0x26a5a3,_0x317fb0[_0x7932('0x43')]);var _0x2f9ba6={'where':_0x26a5a3[_0x7932('0x3f')]};return db[_0x7932('0x2f')][_0x7932('0x21')](_0x2f9ba6)[_0x7932('0x28')](function(_0x27c4a3){_0x1b9d63[_0x7932('0x21')]=_0x27c4a3;if(_0x317fb0['query'][_0x7932('0x44')]){_0x26a5a3[_0x7932('0x45')]=[{'all':!![]}];}return db[_0x7932('0x2f')][_0x7932('0x46')](_0x26a5a3);})[_0x7932('0x28')](function(_0x522bb9){_0x1b9d63[_0x7932('0x47')]=_0x522bb9;return _0x1b9d63;})['then'](respondWithFilteredResult(_0xd2ae75,_0x26a5a3))[_0x7932('0x48')](handleError(_0xd2ae75,null));};exports[_0x7932('0x49')]=function(_0x17a782,_0x4ba8c4){var _0x11c200={'raw':![],'where':{'id':_0x17a782[_0x7932('0x4a')]['id']}},_0x76d852={};_0x76d852['model']=_[_0x7932('0x36')](db['VoiceQueueReport'][_0x7932('0x30')]);_0x76d852[_0x7932('0x35')]=_[_0x7932('0x36')](_0x17a782['query']);_0x76d852[_0x7932('0x37')]=_[_0x7932('0x38')](_0x76d852[_0x7932('0x34')],_0x76d852[_0x7932('0x35')]);_0x11c200[_0x7932('0x3a')]=_[_0x7932('0x38')](_0x76d852[_0x7932('0x34')],qs[_0x7932('0x39')](_0x17a782['query'][_0x7932('0x39')]));_0x11c200['attributes']=_0x11c200[_0x7932('0x3a')][_0x7932('0x3b')]?_0x11c200['attributes']:_0x76d852[_0x7932('0x34')];if(_0x17a782[_0x7932('0x35')]['includeAll']){_0x11c200['include']=[{'all':!![]}];}_0x11c200=_['merge']({},_0x11c200,_0x17a782[_0x7932('0x43')]);return db[_0x7932('0x2f')][_0x7932('0x4b')](_0x11c200)['then'](handleEntityNotFound(_0x4ba8c4,null))[_0x7932('0x28')](respondWithResult(_0x4ba8c4,null))[_0x7932('0x48')](handleError(_0x4ba8c4,null));};exports['create']=function(_0x538252,_0x5e18bc){return db[_0x7932('0x2f')][_0x7932('0x4c')](_0x538252[_0x7932('0x4d')],{})[_0x7932('0x28')](respondWithResult(_0x5e18bc,0xc9))['catch'](handleError(_0x5e18bc,null));};exports['update']=function(_0x4fdc71,_0x567a11){if(_0x4fdc71[_0x7932('0x4d')]['id']){delete _0x4fdc71[_0x7932('0x4d')]['id'];}return db['VoiceQueueReport'][_0x7932('0x4b')]({'where':{'id':_0x4fdc71[_0x7932('0x4a')]['id']}})[_0x7932('0x28')](handleEntityNotFound(_0x567a11,null))['then'](saveUpdates(_0x4fdc71[_0x7932('0x4d')],null))[_0x7932('0x28')](respondWithResult(_0x567a11,null))[_0x7932('0x48')](handleError(_0x567a11,null));};exports[_0x7932('0x29')]=function(_0x4ebc41,_0x2e37ae){return db[_0x7932('0x2f')][_0x7932('0x4b')]({'where':{'id':_0x4ebc41[_0x7932('0x4a')]['id']}})[_0x7932('0x28')](handleEntityNotFound(_0x2e37ae,null))[_0x7932('0x28')](removeEntity(_0x2e37ae,null))[_0x7932('0x48')](handleError(_0x2e37ae,null));};exports['describe']=function(_0x311be1,_0x8fd282){return db[_0x7932('0x2f')][_0x7932('0x4e')]()[_0x7932('0x28')](respondWithResult(_0x8fd282,null))[_0x7932('0x48')](handleError(_0x8fd282,null));};exports[_0x7932('0x4f')]=function(_0x40afc0,_0x385b7e){var _0x1171df={},_0x2d4915={},_0x5badd8={'count':0x0,'rows':[]};_0x2d4915[_0x7932('0x34')]=_[_0x7932('0x36')](db[_0x7932('0x2f')][_0x7932('0x30')]);_0x2d4915[_0x7932('0x35')]=_[_0x7932('0x36')](_0x40afc0[_0x7932('0x35')]);_0x2d4915[_0x7932('0x37')]=_[_0x7932('0x38')](_0x2d4915[_0x7932('0x34')],_0x2d4915['query']);_0x1171df['attributes']=_[_0x7932('0x38')](_0x2d4915['model'],qs[_0x7932('0x39')](_0x40afc0['query']['fields']));_0x1171df[_0x7932('0x3a')]=_0x1171df['attributes'][_0x7932('0x3b')]?_0x1171df[_0x7932('0x3a')]:_0x2d4915[_0x7932('0x34')];if(!_0x40afc0[_0x7932('0x35')]['hasOwnProperty'](_0x7932('0x3c'))){_0x1171df[_0x7932('0x22')]=qs[_0x7932('0x22')](_0x40afc0[_0x7932('0x35')][_0x7932('0x22')]);_0x1171df['offset']=qs[_0x7932('0x1f')](_0x40afc0[_0x7932('0x35')][_0x7932('0x1f')]);}_0x1171df['order']=qs[_0x7932('0x3e')](_0x40afc0[_0x7932('0x35')][_0x7932('0x3e')]);_0x1171df[_0x7932('0x3f')]=qs[_0x7932('0x37')](_['pick'](_0x40afc0['query'],_0x2d4915[_0x7932('0x37')]));if(_0x40afc0['query'][_0x7932('0x41')]){_0x1171df[_0x7932('0x3f')]=_[_0x7932('0x50')](_0x1171df[_0x7932('0x3f')],{'$or':_[_0x7932('0x2e')](_0x1171df[_0x7932('0x3a')],function(_0x5188d2){var _0x5244c3={};_0x5244c3[_0x5188d2]={'$like':'%'+_0x40afc0[_0x7932('0x35')][_0x7932('0x41')]+'%'};return _0x5244c3;})});}_0x1171df=_[_0x7932('0x50')]({},_0x1171df,_0x40afc0[_0x7932('0x43')]);var _0x2eec9e={'where':_0x1171df[_0x7932('0x3f')]};return db['VoiceQueueReport'][_0x7932('0x21')](_0x2eec9e)['then'](function(_0xc8ff65){_0x5badd8[_0x7932('0x21')]=_0xc8ff65;if(_0x40afc0['query'][_0x7932('0x44')]){_0x1171df['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x1171df);})[_0x7932('0x28')](function(_0x3b1293){_0x5badd8[_0x7932('0x47')]=_0x3b1293;return _0x5badd8;})['then'](respondWithFilteredResult(_0x385b7e,_0x1171df,_0x7932('0x4f')))['catch'](handleError(_0x385b7e,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 831be37..97bca37 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 _0x4161=['exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hook'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x4161,0x1a8));var _0x1416=function(_0x44127c,_0x268589){_0x44127c=_0x44127c-0x0;var _0x4ecfc0=_0x4161[_0x44127c];return _0x4ecfc0;};'use strict';var EventEmitter=require(_0x1416('0x0'));var VoiceQueueReport=require(_0x1416('0x1'))['db'][_0x1416('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1416('0x3')](0x0);var events={'afterCreate':_0x1416('0x4'),'afterUpdate':_0x1416('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2459c4){return function(_0x372db4,_0x5e844b,_0x67d1eb){VoiceQueueReportEvents['emit'](_0x2459c4+':'+_0x372db4['id'],_0x372db4);VoiceQueueReportEvents[_0x1416('0x6')](_0x2459c4,_0x372db4);_0x67d1eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x1416('0x7')](e,emitEvent(event));}}module[_0x1416('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x2245=['events','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x492e33,_0x111910){var _0x51be0d=function(_0x4a2ac8){while(--_0x4a2ac8){_0x492e33['push'](_0x492e33['shift']());}};_0x51be0d(++_0x111910);}(_0x2245,0x1a4));var _0x5224=function(_0x4d62ef,_0x2fb99d){_0x4d62ef=_0x4d62ef-0x0;var _0x4087a3=_0x2245[_0x4d62ef];return _0x4087a3;};'use strict';var EventEmitter=require(_0x5224('0x0'));var VoiceQueueReport=require(_0x5224('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5224('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5224('0x3')};function emitEvent(_0x51671f){return function(_0x1f0b99,_0x16c094,_0x3fb12f){VoiceQueueReportEvents[_0x5224('0x4')](_0x51671f+':'+_0x1f0b99['id'],_0x1f0b99);VoiceQueueReportEvents[_0x5224('0x4')](_0x51671f,_0x1f0b99);_0x3fb12f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x5224('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2065b07..709ae41 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 _0x3fc8=['bluebird','request-promise','path','./voiceQueueReport.attributes','exports','VoiceQueueReport','uniqueid','lodash','util'];(function(_0xbcef04,_0x2eac98){var _0x4e47fa=function(_0x191012){while(--_0x191012){_0xbcef04['push'](_0xbcef04['shift']());}};_0x4e47fa(++_0x2eac98);}(_0x3fc8,0x10c));var _0x83fc=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x3fc8[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x83fc('0x0'));var util=require(_0x83fc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x83fc('0x2'));var rp=require(_0x83fc('0x3'));var fs=require('fs');var path=require(_0x83fc('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x83fc('0x5'));module[_0x83fc('0x6')]=function(_0x300424,_0x5ee092){return _0x300424['define'](_0x83fc('0x7'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x83fc('0x8')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaae6=['bluebird','request-promise','path','exports','define','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x1c69d7,_0x222868){var _0x1ba8c7=function(_0x7a2ed9){while(--_0x7a2ed9){_0x1c69d7['push'](_0x1c69d7['shift']());}};_0x1ba8c7(++_0x222868);}(_0xaae6,0xd3));var _0x6aae=function(_0x209a4a,_0x498628){_0x209a4a=_0x209a4a-0x0;var _0x26ec1c=_0xaae6[_0x209a4a];return _0x26ec1c;};'use strict';var _=require(_0x6aae('0x0'));var util=require(_0x6aae('0x1'));var logger=require(_0x6aae('0x2'))(_0x6aae('0x3'));var moment=require(_0x6aae('0x4'));var BPromise=require(_0x6aae('0x5'));var rp=require(_0x6aae('0x6'));var fs=require('fs');var path=require(_0x6aae('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x6aae('0x8')]=function(_0x5e8ad6,_0x56bb82){return _0x5e8ad6[_0x6aae('0x9')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x6aae('0xa')]},{'fields':[_0x6aae('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 486ba95..b7fda1e 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 _0x4e57=['localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','create','body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x3e6826,_0x59dd66){var _0x349aee=function(_0x4b7bc7){while(--_0x4b7bc7){_0x3e6826['push'](_0x3e6826['shift']());}};_0x349aee(++_0x59dd66);}(_0x4e57,0x78));var _0x74e5=function(_0x396d17,_0x46d4aa){_0x396d17=_0x396d17-0x0;var _0x378d9e=_0x4e57[_0x396d17];return _0x378d9e;};'use strict';var _=require(_0x74e5('0x0'));var util=require(_0x74e5('0x1'));var moment=require(_0x74e5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74e5('0x3'))['db'];var utils=require(_0x74e5('0x4'));var logger=require(_0x74e5('0x5'))(_0x74e5('0x6'));var config=require(_0x74e5('0x7'));var jayson=require(_0x74e5('0x8'));var client=jayson['client'][_0x74e5('0x9')]({'port':0x232a});config[_0x74e5('0xa')]=_[_0x74e5('0xb')](config[_0x74e5('0xa')],{'host':_0x74e5('0xc'),'port':0x18eb});var socket=require(_0x74e5('0xd'))(new Redis(config[_0x74e5('0xa')]));require(_0x74e5('0xe'))[_0x74e5('0xf')](socket);function respondWithRpcPromise(_0x125430,_0x437d07,_0xc716dc){return new BPromise(function(_0x1310ca,_0x4c92bb){return client[_0x74e5('0x10')](_0x125430,_0xc716dc)[_0x74e5('0x11')](function(_0x5b727a){logger[_0x74e5('0x12')](_0x74e5('0x13'),_0x437d07,_0x74e5('0x14'));logger[_0x74e5('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x437d07,'request\x20sent',JSON[_0x74e5('0x16')](_0x5b727a));if(_0x5b727a[_0x74e5('0x17')]){if(_0x5b727a[_0x74e5('0x17')][_0x74e5('0x18')]===0x1f4){logger[_0x74e5('0x17')](_0x74e5('0x13'),_0x437d07,_0x5b727a['error'][_0x74e5('0x19')]);return _0x4c92bb(_0x5b727a[_0x74e5('0x17')][_0x74e5('0x19')]);}logger[_0x74e5('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x437d07,_0x5b727a['error']['message']);return _0x1310ca(_0x5b727a[_0x74e5('0x17')][_0x74e5('0x19')]);}else{logger[_0x74e5('0x12')](_0x74e5('0x13'),_0x437d07,_0x74e5('0x14'));_0x1310ca(_0x5b727a[_0x74e5('0x1a')][_0x74e5('0x19')]);}})[_0x74e5('0x1b')](function(_0x37502c){logger[_0x74e5('0x17')](_0x74e5('0x13'),_0x437d07,_0x37502c);_0x4c92bb(_0x37502c);});});}exports[_0x74e5('0x1c')]=function(_0x39e7b0){var _0x36acc5=this;return new Promise(function(_0x41af13,_0x30702c){return db[_0x74e5('0x1d')][_0x74e5('0x1e')]({'raw':_0x39e7b0[_0x74e5('0x1f')]?_0x39e7b0[_0x74e5('0x1f')][_0x74e5('0x20')]===undefined?!![]:![]:!![],'where':_0x39e7b0[_0x74e5('0x1f')]?_0x39e7b0[_0x74e5('0x1f')][_0x74e5('0x21')]||null:null,'attributes':_0x39e7b0['options']?_0x39e7b0[_0x74e5('0x1f')][_0x74e5('0x22')]||null:null,'limit':_0x39e7b0[_0x74e5('0x1f')]?_0x39e7b0[_0x74e5('0x1f')][_0x74e5('0x23')]||null:null,'include':_0x39e7b0[_0x74e5('0x1f')]?_0x39e7b0[_0x74e5('0x1f')]['include']?_[_0x74e5('0x24')](_0x39e7b0[_0x74e5('0x1f')][_0x74e5('0x25')],function(_0x33124e){return{'model':db[_0x33124e[_0x74e5('0x26')]],'as':_0x33124e['as'],'attributes':_0x33124e[_0x74e5('0x22')],'include':_0x33124e[_0x74e5('0x25')]?_[_0x74e5('0x24')](_0x33124e['include'],function(_0x5e9638){return{'model':db[_0x5e9638['model']],'as':_0x5e9638['as'],'attributes':_0x5e9638[_0x74e5('0x22')],'include':_0x5e9638[_0x74e5('0x25')]?_[_0x74e5('0x24')](_0x5e9638[_0x74e5('0x25')],function(_0x580830){return{'model':db[_0x580830[_0x74e5('0x26')]],'as':_0x580830['as'],'attributes':_0x580830['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28b177){logger[_0x74e5('0x12')](_0x74e5('0x1c'),_0x39e7b0);logger['debug'](_0x74e5('0x1c'),_0x39e7b0,JSON[_0x74e5('0x16')](_0x28b177));_0x41af13(_0x28b177);})[_0x74e5('0x1b')](function(_0x5aa5c9){logger['error'](_0x74e5('0x1c'),_0x5aa5c9['message'],_0x39e7b0);_0x30702c(_0x36acc5['error'](0x1f4,_0x5aa5c9[_0x74e5('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x11bf93){var _0x1fe46d=this;return new Promise(function(_0x2e8eea,_0x5cc8aa){return db['VoiceQueueReport'][_0x74e5('0x27')](_0x11bf93[_0x74e5('0x28')],{'raw':_0x11bf93['options']?_0x11bf93[_0x74e5('0x1f')][_0x74e5('0x20')]===undefined?!![]:![]:!![]})[_0x74e5('0x11')](function(_0x2bfaf1){logger[_0x74e5('0x12')](_0x74e5('0x29'),_0x11bf93);logger[_0x74e5('0x15')]('CreateVoiceQueueReport',_0x11bf93,JSON['stringify'](_0x2bfaf1));_0x2e8eea(_0x2bfaf1);})[_0x74e5('0x1b')](function(_0x295dc3){logger[_0x74e5('0x17')](_0x74e5('0x29'),_0x295dc3['message'],_0x11bf93);_0x5cc8aa(_0x1fe46d[_0x74e5('0x17')](0x1f4,_0x295dc3[_0x74e5('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0x43574b){var _0x3b61d9=this;return new Promise(function(_0x3432ef,_0x1ddc1a){return db['VoiceQueueReport'][_0x74e5('0x2a')](_0x43574b[_0x74e5('0x28')],{'raw':_0x43574b[_0x74e5('0x1f')]?_0x43574b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43574b[_0x74e5('0x1f')]?_0x43574b[_0x74e5('0x1f')]['where']||null:null,'attributes':_0x43574b[_0x74e5('0x1f')]?_0x43574b[_0x74e5('0x1f')]['attributes']||null:null,'limit':_0x43574b[_0x74e5('0x1f')]?_0x43574b[_0x74e5('0x1f')]['limit']||null:null})[_0x74e5('0x11')](function(_0x35f446){logger[_0x74e5('0x12')](_0x74e5('0x2b'),_0x43574b);logger[_0x74e5('0x15')]('UpdateVoiceQueueReport',_0x43574b,JSON['stringify'](_0x35f446));_0x3432ef(_0x35f446);})[_0x74e5('0x1b')](function(_0x598d44){logger[_0x74e5('0x17')](_0x74e5('0x2b'),_0x598d44[_0x74e5('0x19')],_0x43574b);_0x1ddc1a(_0x3b61d9[_0x74e5('0x17')](0x1f4,_0x598d44['message']));});});}; \ No newline at end of file +var _0xf0ed=['raw','attributes','limit','include','model','map','CreateVoiceQueueReport','VoiceQueueReport','body','UpdateVoiceQueueReport','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','findAll','options'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf0ed,0x1b8));var _0xdf0e=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xf0ed[_0x47adb8];return _0x4689a8;};'use strict';var _=require(_0xdf0e('0x0'));var util=require(_0xdf0e('0x1'));var moment=require(_0xdf0e('0x2'));var BPromise=require(_0xdf0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf0e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf0e('0x5'));var logger=require(_0xdf0e('0x6'))('rpc');var config=require(_0xdf0e('0x7'));var jayson=require(_0xdf0e('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xdf0e('0x9')](config[_0xdf0e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf0e('0xb'))(new Redis(config[_0xdf0e('0xa')]));require(_0xdf0e('0xc'))['register'](socket);function respondWithRpcPromise(_0x4a7de5,_0x428621,_0x465a58){return new BPromise(function(_0x48f64f,_0x1bfee5){return client[_0xdf0e('0xd')](_0x4a7de5,_0x465a58)[_0xdf0e('0xe')](function(_0x23e1fb){logger[_0xdf0e('0xf')](_0xdf0e('0x10'),_0x428621,_0xdf0e('0x11'));logger[_0xdf0e('0x12')](_0xdf0e('0x13'),_0x428621,_0xdf0e('0x11'),JSON[_0xdf0e('0x14')](_0x23e1fb));if(_0x23e1fb[_0xdf0e('0x15')]){if(_0x23e1fb[_0xdf0e('0x15')][_0xdf0e('0x16')]===0x1f4){logger['error'](_0xdf0e('0x10'),_0x428621,_0x23e1fb[_0xdf0e('0x15')]['message']);return _0x1bfee5(_0x23e1fb['error']['message']);}logger[_0xdf0e('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x428621,_0x23e1fb['error'][_0xdf0e('0x17')]);return _0x48f64f(_0x23e1fb['error'][_0xdf0e('0x17')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x428621,_0xdf0e('0x11'));_0x48f64f(_0x23e1fb['result'][_0xdf0e('0x17')]);}})[_0xdf0e('0x18')](function(_0x34d4d5){logger[_0xdf0e('0x15')](_0xdf0e('0x10'),_0x428621,_0x34d4d5);_0x1bfee5(_0x34d4d5);});});}exports[_0xdf0e('0x19')]=function(_0x56d3b2){var _0x56f053=this;return new Promise(function(_0x579be9,_0x208fa5){return db['VoiceQueueReport'][_0xdf0e('0x1a')]({'raw':_0x56d3b2[_0xdf0e('0x1b')]?_0x56d3b2[_0xdf0e('0x1b')][_0xdf0e('0x1c')]===undefined?!![]:![]:!![],'where':_0x56d3b2[_0xdf0e('0x1b')]?_0x56d3b2[_0xdf0e('0x1b')]['where']||null:null,'attributes':_0x56d3b2[_0xdf0e('0x1b')]?_0x56d3b2[_0xdf0e('0x1b')][_0xdf0e('0x1d')]||null:null,'limit':_0x56d3b2[_0xdf0e('0x1b')]?_0x56d3b2[_0xdf0e('0x1b')][_0xdf0e('0x1e')]||null:null,'include':_0x56d3b2[_0xdf0e('0x1b')]?_0x56d3b2[_0xdf0e('0x1b')][_0xdf0e('0x1f')]?_['map'](_0x56d3b2[_0xdf0e('0x1b')][_0xdf0e('0x1f')],function(_0x44e7a6){return{'model':db[_0x44e7a6[_0xdf0e('0x20')]],'as':_0x44e7a6['as'],'attributes':_0x44e7a6[_0xdf0e('0x1d')],'include':_0x44e7a6[_0xdf0e('0x1f')]?_[_0xdf0e('0x21')](_0x44e7a6['include'],function(_0x2a30e1){return{'model':db[_0x2a30e1[_0xdf0e('0x20')]],'as':_0x2a30e1['as'],'attributes':_0x2a30e1[_0xdf0e('0x1d')],'include':_0x2a30e1['include']?_[_0xdf0e('0x21')](_0x2a30e1[_0xdf0e('0x1f')],function(_0x32cb76){return{'model':db[_0x32cb76[_0xdf0e('0x20')]],'as':_0x32cb76['as'],'attributes':_0x32cb76[_0xdf0e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55fdca){logger[_0xdf0e('0xf')]('GetVoiceQueueReport',_0x56d3b2);logger[_0xdf0e('0x12')]('GetVoiceQueueReport',_0x56d3b2,JSON[_0xdf0e('0x14')](_0x55fdca));_0x579be9(_0x55fdca);})[_0xdf0e('0x18')](function(_0xd25e0e){logger['error'](_0xdf0e('0x19'),_0xd25e0e[_0xdf0e('0x17')],_0x56d3b2);_0x208fa5(_0x56f053[_0xdf0e('0x15')](0x1f4,_0xd25e0e['message']));});});};exports[_0xdf0e('0x22')]=function(_0x2fcdf1){var _0x535e75=this;return new Promise(function(_0x226c51,_0x43fc40){return db[_0xdf0e('0x23')]['create'](_0x2fcdf1[_0xdf0e('0x24')],{'raw':_0x2fcdf1[_0xdf0e('0x1b')]?_0x2fcdf1['options']['raw']===undefined?!![]:![]:!![]})[_0xdf0e('0xe')](function(_0x29e174){logger[_0xdf0e('0xf')]('CreateVoiceQueueReport',_0x2fcdf1);logger[_0xdf0e('0x12')](_0xdf0e('0x22'),_0x2fcdf1,JSON[_0xdf0e('0x14')](_0x29e174));_0x226c51(_0x29e174);})[_0xdf0e('0x18')](function(_0x26035f){logger['error'](_0xdf0e('0x22'),_0x26035f[_0xdf0e('0x17')],_0x2fcdf1);_0x43fc40(_0x535e75[_0xdf0e('0x15')](0x1f4,_0x26035f[_0xdf0e('0x17')]));});});};exports[_0xdf0e('0x25')]=function(_0x5b2fb5){var _0x14df87=this;return new Promise(function(_0x25f0b5,_0x103dfd){return db[_0xdf0e('0x23')]['update'](_0x5b2fb5[_0xdf0e('0x24')],{'raw':_0x5b2fb5[_0xdf0e('0x1b')]?_0x5b2fb5[_0xdf0e('0x1b')][_0xdf0e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b2fb5[_0xdf0e('0x1b')]?_0x5b2fb5['options'][_0xdf0e('0x26')]||null:null,'attributes':_0x5b2fb5['options']?_0x5b2fb5['options'][_0xdf0e('0x1d')]||null:null,'limit':_0x5b2fb5['options']?_0x5b2fb5[_0xdf0e('0x1b')]['limit']||null:null})[_0xdf0e('0xe')](function(_0x443bcb){logger[_0xdf0e('0xf')](_0xdf0e('0x25'),_0x5b2fb5);logger[_0xdf0e('0x12')]('UpdateVoiceQueueReport',_0x5b2fb5,JSON['stringify'](_0x443bcb));_0x25f0b5(_0x443bcb);})[_0xdf0e('0x18')](function(_0x1a18b4){logger[_0xdf0e('0x15')]('UpdateVoiceQueueReport',_0x1a18b4[_0xdf0e('0x17')],_0x5b2fb5);_0x103dfd(_0x14df87[_0xdf0e('0x15')](0x1f4,_0x1a18b4[_0xdf0e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 28e91cd..c2a5fa7 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 _0x4be6=['removeListener','save','remove','update','emit'];(function(_0x12244d,_0x1b8766){var _0x3fe4f8=function(_0x1e8065){while(--_0x1e8065){_0x12244d['push'](_0x12244d['shift']());}};_0x3fe4f8(++_0x1b8766);}(_0x4be6,0xb5));var _0x64be=function(_0x58e2a5,_0x4e822c){_0x58e2a5=_0x58e2a5-0x0;var _0x440ba0=_0x4be6[_0x58e2a5];return _0x440ba0;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x64be('0x0'),_0x64be('0x1'),_0x64be('0x2')];function createListener(_0x2bbd6b,_0x1cb7dd){return function(_0x2dea47){_0x1cb7dd[_0x64be('0x3')](_0x2bbd6b,_0x2dea47);};}function removeListener(_0x85d7a2,_0x217ce6){return function(){VoiceQueueReportEvents[_0x64be('0x4')](_0x85d7a2,_0x217ce6);};}exports['register']=function(_0x131822){for(var _0x2430e2=0x0,_0x3e8639=events['length'];_0x2430e2<_0x3e8639;_0x2430e2++){var _0x19bdb3=events[_0x2430e2];var _0x21fcb7=createListener('voiceQueueReport:'+_0x19bdb3,_0x131822);VoiceQueueReportEvents['on'](_0x19bdb3,_0x21fcb7);}}; \ No newline at end of file +var _0x56e6=['save','remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x5d8084,_0x1947e9){var _0x4c0147=function(_0x20c7f0){while(--_0x20c7f0){_0x5d8084['push'](_0x5d8084['shift']());}};_0x4c0147(++_0x1947e9);}(_0x56e6,0x6b));var _0x656e=function(_0x5c5733,_0x712184){_0x5c5733=_0x5c5733-0x0;var _0x41c1c7=_0x56e6[_0x5c5733];return _0x41c1c7;};'use strict';var VoiceQueueReportEvents=require(_0x656e('0x0'));var events=[_0x656e('0x1'),_0x656e('0x2'),_0x656e('0x3')];function createListener(_0x3a7a6a,_0x3833eb){return function(_0x5adaa8){_0x3833eb[_0x656e('0x4')](_0x3a7a6a,_0x5adaa8);};}function removeListener(_0x23c947,_0xe7d540){return function(){VoiceQueueReportEvents[_0x656e('0x5')](_0x23c947,_0xe7d540);};}exports[_0x656e('0x6')]=function(_0x3fef98){for(var _0x81c232=0x0,_0x54eddb=events[_0x656e('0x7')];_0x81c232<_0x54eddb;_0x81c232++){var _0x1538a5=events[_0x81c232];var _0x1dad4e=createListener(_0x656e('0x8')+_0x1538a5,_0x3fef98);VoiceQueueReportEvents['on'](_0x1538a5,_0x1dad4e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 093d013..2c09dd0 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 _0xf63f=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','show','post','isAuthenticated','update','destroy'];(function(_0x102977,_0x3a99a6){var _0x15c466=function(_0x1a6a12){while(--_0x1a6a12){_0x102977['push'](_0x102977['shift']());}};_0x15c466(++_0x3a99a6);}(_0xf63f,0xf8));var _0xff63=function(_0x5cbb22,_0x22de61){_0x5cbb22=_0x5cbb22-0x0;var _0x257b90=_0xf63f[_0x5cbb22];return _0x257b90;};'use strict';var multer=require(_0xff63('0x0'));var util=require('util');var path=require(_0xff63('0x1'));var timeout=require(_0xff63('0x2'));var express=require(_0xff63('0x3'));var router=express[_0xff63('0x4')]();var fs_extra=require(_0xff63('0x5'));var auth=require(_0xff63('0x6'));var interaction=require(_0xff63('0x7'));var config=require(_0xff63('0x8'));var controller=require(_0xff63('0x9'));router[_0xff63('0xa')]('/',auth['isAuthenticated'](),controller[_0xff63('0xb')]);router[_0xff63('0xa')](_0xff63('0xc'),auth['isAuthenticated'](),controller[_0xff63('0xd')]);router[_0xff63('0xe')]('/',auth[_0xff63('0xf')](),controller['create']);router['put']('/:id',auth[_0xff63('0xf')](),controller[_0xff63('0x10')]);router['delete'](_0xff63('0xc'),auth[_0xff63('0xf')](),controller[_0xff63('0x11')]);module[_0xff63('0x12')]=router; \ No newline at end of file +var _0x8523=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','get','/:id','show','post','isAuthenticated','put','delete','destroy'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x8523,0x65));var _0x3852=function(_0x4b630,_0x151f86){_0x4b630=_0x4b630-0x0;var _0x24f855=_0x8523[_0x4b630];return _0x24f855;};'use strict';var multer=require(_0x3852('0x0'));var util=require('util');var path=require(_0x3852('0x1'));var timeout=require(_0x3852('0x2'));var express=require(_0x3852('0x3'));var router=express[_0x3852('0x4')]();var fs_extra=require(_0x3852('0x5'));var auth=require(_0x3852('0x6'));var interaction=require(_0x3852('0x7'));var config=require(_0x3852('0x8'));var controller=require(_0x3852('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3852('0xa')]);router[_0x3852('0xb')](_0x3852('0xc'),auth['isAuthenticated'](),controller[_0x3852('0xd')]);router[_0x3852('0xe')]('/',auth[_0x3852('0xf')](),controller['create']);router[_0x3852('0x10')]('/:id',auth[_0x3852('0xf')](),controller['update']);router[_0x3852('0x11')](_0x3852('0xc'),auth[_0x3852('0xf')](),controller[_0x3852('0x12')]);module[_0x3852('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index b8eb67b..7099a09 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 _0x9cd1=['format','sequelize','moment','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9cd1,0xdd));var _0x19cd=function(_0x5937ac,_0x5b1862){_0x5937ac=_0x5937ac-0x0;var _0x508618=_0x9cd1[_0x5937ac];return _0x508618;};'use strict';var Sequelize=require(_0x19cd('0x0'));var moment=require(_0x19cd('0x1'));module[_0x19cd('0x2')]={'time':{'type':Sequelize[_0x19cd('0x3')]},'callid':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x19cd('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x19cd('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x5dd2=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x2db0a4,_0x2dc95e){var _0x5e2f48=function(_0x21cb0b){while(--_0x21cb0b){_0x2db0a4['push'](_0x2db0a4['shift']());}};_0x5e2f48(++_0x2dc95e);}(_0x5dd2,0x19e));var _0x25dd=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x5dd2[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x25dd('0x0'));module[_0x25dd('0x1')]={'time':{'type':Sequelize[_0x25dd('0x2')]},'callid':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x25dd('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x25dd('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 4ae717e..2e1a826 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 _0x1162=['rawAttributes','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','fields','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','map','VoiceQueuesLog'];(function(_0x38e730,_0x2e63b6){var _0x29b82e=function(_0x7ab722){while(--_0x7ab722){_0x38e730['push'](_0x38e730['shift']());}};_0x29b82e(++_0x2e63b6);}(_0x1162,0x142));var _0x2116=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1162[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x2116('0x0'));var rimraf=require(_0x2116('0x1'));var zipdir=require(_0x2116('0x2'));var jsonpatch=require(_0x2116('0x3'));var rp=require(_0x2116('0x4'));var moment=require(_0x2116('0x5'));var BPromise=require(_0x2116('0x6'));var Mustache=require(_0x2116('0x7'));var util=require('util');var path=require(_0x2116('0x8'));var sox=require(_0x2116('0x9'));var csv=require(_0x2116('0xa'));var ejs=require(_0x2116('0xb'));var fs=require('fs');var fs_extra=require(_0x2116('0xc'));var _=require('lodash');var squel=require(_0x2116('0xd'));var crypto=require('crypto');var jsforce=require(_0x2116('0xe'));var deskjs=require(_0x2116('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2116('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2116('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2116('0x12'));var logger=require('../../config/logger')(_0x2116('0x13'));var utils=require(_0x2116('0x14'));var config=require(_0x2116('0x15'));var licenseUtil=require(_0x2116('0x16'));var db=require(_0x2116('0x17'))['db'];function respondWithStatusCode(_0x80213b,_0x8cf823){_0x8cf823=_0x8cf823||0xcc;return function(_0x2824f2){if(_0x2824f2){return _0x80213b[_0x2116('0x18')](_0x8cf823);}return _0x80213b[_0x2116('0x19')](_0x8cf823)[_0x2116('0x1a')]();};}function respondWithResult(_0x1b240b,_0x3ac58e){_0x3ac58e=_0x3ac58e||0xc8;return function(_0x431e65){if(_0x431e65){return _0x1b240b[_0x2116('0x19')](_0x3ac58e)[_0x2116('0x1b')](_0x431e65);}};}function respondWithFilteredResult(_0x836924,_0x2658a0){return function(_0x499462){if(_0x499462){var _0x371951=typeof _0x2658a0[_0x2116('0x1c')]===_0x2116('0x1d')&&typeof _0x2658a0[_0x2116('0x1e')]==='undefined';var _0x3bdfc2=_0x499462[_0x2116('0x1f')];var _0x2aecd4=_0x371951?0x0:_0x2658a0[_0x2116('0x1c')];var _0xcc8ca5=_0x371951?_0x499462[_0x2116('0x1f')]:_0x2658a0['offset']+_0x2658a0[_0x2116('0x1e')];var _0x5112a2;if(_0xcc8ca5>=_0x3bdfc2){_0xcc8ca5=_0x3bdfc2;_0x5112a2=0xc8;}else{_0x5112a2=0xce;}_0x836924[_0x2116('0x19')](_0x5112a2);return _0x836924[_0x2116('0x20')]('Content-Range',_0x2aecd4+'-'+_0xcc8ca5+'/'+_0x3bdfc2)[_0x2116('0x1b')](_0x499462);}return null;};}function patchUpdates(_0x1c8ee4){return function(_0xad3df4){try{jsonpatch[_0x2116('0x21')](_0xad3df4,_0x1c8ee4,!![]);}catch(_0x4c3770){return BPromise['reject'](_0x4c3770);}return _0xad3df4[_0x2116('0x22')]();};}function saveUpdates(_0x4e9c6c,_0x52642c){return function(_0x343c90){if(_0x343c90){return _0x343c90[_0x2116('0x23')](_0x4e9c6c)[_0x2116('0x24')](function(_0x1a806e){return _0x1a806e;});}return null;};}function removeEntity(_0x50d45e,_0x6c6b88){return function(_0x437ea4){if(_0x437ea4){return _0x437ea4[_0x2116('0x25')]()[_0x2116('0x24')](function(){_0x50d45e[_0x2116('0x19')](0xcc)[_0x2116('0x1a')]();});}};}function handleEntityNotFound(_0x4e96e6,_0x4a2921){return function(_0x1c65d6){if(!_0x1c65d6){_0x4e96e6[_0x2116('0x18')](0x194);}return _0x1c65d6;};}function handleError(_0x59aa51,_0x922402){_0x922402=_0x922402||0x1f4;return function(_0x9e54ad){logger[_0x2116('0x26')](_0x9e54ad[_0x2116('0x27')]);if(_0x9e54ad[_0x2116('0x28')]){delete _0x9e54ad['name'];}_0x59aa51['status'](_0x922402)['send'](_0x9e54ad);};}exports['index']=function(_0x155689,_0x27f2a2){var _0x4f057d={},_0x2741ec={},_0x2932cb={'count':0x0,'rows':[]};var _0x271643=_[_0x2116('0x29')](db[_0x2116('0x2a')][_0x2116('0x2b')],function(_0x4acbe6){return{'name':_0x4acbe6['fieldName'],'type':_0x4acbe6[_0x2116('0x2c')][_0x2116('0x2d')]};});_0x2741ec['model']=_[_0x2116('0x29')](_0x271643,_0x2116('0x28'));_0x2741ec[_0x2116('0x2e')]=_[_0x2116('0x2f')](_0x155689[_0x2116('0x2e')]);_0x2741ec[_0x2116('0x30')]=_[_0x2116('0x31')](_0x2741ec[_0x2116('0x32')],_0x2741ec[_0x2116('0x2e')]);_0x4f057d[_0x2116('0x33')]=_[_0x2116('0x31')](_0x2741ec['model'],qs['fields'](_0x155689[_0x2116('0x2e')]['fields']));_0x4f057d['attributes']=_0x4f057d['attributes']['length']?_0x4f057d[_0x2116('0x33')]:_0x2741ec[_0x2116('0x32')];if(!_0x155689[_0x2116('0x2e')][_0x2116('0x34')](_0x2116('0x35'))){_0x4f057d[_0x2116('0x1e')]=qs[_0x2116('0x1e')](_0x155689[_0x2116('0x2e')][_0x2116('0x1e')]);_0x4f057d['offset']=qs[_0x2116('0x1c')](_0x155689[_0x2116('0x2e')][_0x2116('0x1c')]);}_0x4f057d[_0x2116('0x36')]=qs['sort'](_0x155689[_0x2116('0x2e')][_0x2116('0x37')]);_0x4f057d['where']=qs[_0x2116('0x30')](_[_0x2116('0x38')](_0x155689[_0x2116('0x2e')],_0x2741ec[_0x2116('0x30')]),_0x271643);if(_0x155689[_0x2116('0x2e')]['filter']){_0x4f057d[_0x2116('0x39')]=_['merge'](_0x4f057d[_0x2116('0x39')],{'$or':_[_0x2116('0x29')](_0x271643,function(_0x391469){if(_0x391469[_0x2116('0x2c')]!==_0x2116('0x3a')){var _0x51865f={};_0x51865f[_0x391469['name']]={'$like':'%'+_0x155689[_0x2116('0x2e')][_0x2116('0x3b')]+'%'};return _0x51865f;}})});}_0x4f057d=_[_0x2116('0x3c')]({},_0x4f057d,_0x155689[_0x2116('0x3d')]);var _0x2ed884={'where':_0x4f057d[_0x2116('0x39')]};return db[_0x2116('0x2a')][_0x2116('0x1f')](_0x2ed884)[_0x2116('0x24')](function(_0x28a4d0){_0x2932cb[_0x2116('0x1f')]=_0x28a4d0;if(_0x155689[_0x2116('0x2e')][_0x2116('0x3e')]){_0x4f057d[_0x2116('0x3f')]=[{'all':!![]}];}return db[_0x2116('0x2a')][_0x2116('0x40')](_0x4f057d);})[_0x2116('0x24')](function(_0x53834b){_0x2932cb[_0x2116('0x41')]=_0x53834b;return _0x2932cb;})[_0x2116('0x24')](respondWithFilteredResult(_0x27f2a2,_0x4f057d))[_0x2116('0x42')](handleError(_0x27f2a2,null));};exports['show']=function(_0x646b55,_0x3f1db6){var _0xdc9c3c={'raw':!![],'where':{'id':_0x646b55[_0x2116('0x43')]['id']}},_0x54f564={};_0x54f564[_0x2116('0x32')]=_[_0x2116('0x2f')](db[_0x2116('0x2a')][_0x2116('0x2b')]);_0x54f564[_0x2116('0x2e')]=_['keys'](_0x646b55['query']);_0x54f564[_0x2116('0x30')]=_['intersection'](_0x54f564['model'],_0x54f564[_0x2116('0x2e')]);_0xdc9c3c[_0x2116('0x33')]=_['intersection'](_0x54f564['model'],qs[_0x2116('0x44')](_0x646b55['query'][_0x2116('0x44')]));_0xdc9c3c[_0x2116('0x33')]=_0xdc9c3c[_0x2116('0x33')][_0x2116('0x45')]?_0xdc9c3c[_0x2116('0x33')]:_0x54f564[_0x2116('0x32')];if(_0x646b55[_0x2116('0x2e')][_0x2116('0x3e')]){_0xdc9c3c[_0x2116('0x3f')]=[{'all':!![]}];}_0xdc9c3c=_[_0x2116('0x3c')]({},_0xdc9c3c,_0x646b55[_0x2116('0x3d')]);return db['VoiceQueuesLog'][_0x2116('0x46')](_0xdc9c3c)[_0x2116('0x24')](handleEntityNotFound(_0x3f1db6,null))[_0x2116('0x24')](respondWithResult(_0x3f1db6,null))[_0x2116('0x42')](handleError(_0x3f1db6,null));};exports[_0x2116('0x47')]=function(_0x33dcc7,_0x586b24){return db[_0x2116('0x2a')][_0x2116('0x47')](_0x33dcc7['body'],{})[_0x2116('0x24')](respondWithResult(_0x586b24,0xc9))[_0x2116('0x42')](handleError(_0x586b24,null));};exports['update']=function(_0x1e96be,_0x3e4a68){if(_0x1e96be[_0x2116('0x48')]['id']){delete _0x1e96be[_0x2116('0x48')]['id'];}return db[_0x2116('0x2a')]['find']({'where':{'id':_0x1e96be[_0x2116('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e4a68,null))[_0x2116('0x24')](saveUpdates(_0x1e96be[_0x2116('0x48')],null))['then'](respondWithResult(_0x3e4a68,null))['catch'](handleError(_0x3e4a68,null));};exports[_0x2116('0x25')]=function(_0x7a6415,_0x38821c){return db[_0x2116('0x2a')][_0x2116('0x46')]({'where':{'id':_0x7a6415[_0x2116('0x43')]['id']}})[_0x2116('0x24')](handleEntityNotFound(_0x38821c,null))['then'](removeEntity(_0x38821c,null))[_0x2116('0x42')](handleError(_0x38821c,null));}; \ No newline at end of file +var _0x16be=['create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','update','then','destroy','error','stack','name','index','map','VoiceQueuesLog','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch'];(function(_0x211ed9,_0x55740d){var _0x24d3ad=function(_0x579870){while(--_0x579870){_0x211ed9['push'](_0x211ed9['shift']());}};_0x24d3ad(++_0x55740d);}(_0x16be,0x1c4));var _0xe16b=function(_0x43b793,_0xcf6619){_0x43b793=_0x43b793-0x0;var _0x3ae44f=_0x16be[_0x43b793];return _0x3ae44f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe16b('0x0'));var zipdir=require(_0xe16b('0x1'));var jsonpatch=require(_0xe16b('0x2'));var rp=require(_0xe16b('0x3'));var moment=require(_0xe16b('0x4'));var BPromise=require(_0xe16b('0x5'));var Mustache=require(_0xe16b('0x6'));var util=require(_0xe16b('0x7'));var path=require(_0xe16b('0x8'));var sox=require('sox');var csv=require(_0xe16b('0x9'));var ejs=require(_0xe16b('0xa'));var fs=require('fs');var fs_extra=require(_0xe16b('0xb'));var _=require(_0xe16b('0xc'));var squel=require(_0xe16b('0xd'));var crypto=require(_0xe16b('0xe'));var jsforce=require(_0xe16b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe16b('0x9'));var querystring=require('querystring');var Papa=require(_0xe16b('0x10'));var Redis=require(_0xe16b('0x11'));var authService=require(_0xe16b('0x12'));var qs=require(_0xe16b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe16b('0x14'));var logger=require(_0xe16b('0x15'))(_0xe16b('0x16'));var utils=require(_0xe16b('0x17'));var config=require(_0xe16b('0x18'));var licenseUtil=require(_0xe16b('0x19'));var db=require(_0xe16b('0x1a'))['db'];function respondWithStatusCode(_0x5a586a,_0x15d4d9){_0x15d4d9=_0x15d4d9||0xcc;return function(_0x3a3176){if(_0x3a3176){return _0x5a586a[_0xe16b('0x1b')](_0x15d4d9);}return _0x5a586a[_0xe16b('0x1c')](_0x15d4d9)[_0xe16b('0x1d')]();};}function respondWithResult(_0x5b0af2,_0x467390){_0x467390=_0x467390||0xc8;return function(_0x4eb172){if(_0x4eb172){return _0x5b0af2['status'](_0x467390)[_0xe16b('0x1e')](_0x4eb172);}};}function respondWithFilteredResult(_0x166061,_0x2018cb){return function(_0x2f9ac6){if(_0x2f9ac6){var _0x3bd7bf=typeof _0x2018cb['offset']==='undefined'&&typeof _0x2018cb['limit']===_0xe16b('0x1f');var _0x3f3f31=_0x2f9ac6[_0xe16b('0x20')];var _0x21445f=_0x3bd7bf?0x0:_0x2018cb[_0xe16b('0x21')];var _0xddaaca=_0x3bd7bf?_0x2f9ac6[_0xe16b('0x20')]:_0x2018cb[_0xe16b('0x21')]+_0x2018cb['limit'];var _0x1c9257;if(_0xddaaca>=_0x3f3f31){_0xddaaca=_0x3f3f31;_0x1c9257=0xc8;}else{_0x1c9257=0xce;}_0x166061[_0xe16b('0x1c')](_0x1c9257);return _0x166061[_0xe16b('0x22')]('Content-Range',_0x21445f+'-'+_0xddaaca+'/'+_0x3f3f31)[_0xe16b('0x1e')](_0x2f9ac6);}return null;};}function patchUpdates(_0x24455d){return function(_0x1ff201){try{jsonpatch[_0xe16b('0x23')](_0x1ff201,_0x24455d,!![]);}catch(_0x26a55b){return BPromise[_0xe16b('0x24')](_0x26a55b);}return _0x1ff201['save']();};}function saveUpdates(_0x286115,_0x556d96){return function(_0x1dda71){if(_0x1dda71){return _0x1dda71[_0xe16b('0x25')](_0x286115)[_0xe16b('0x26')](function(_0x3353d2){return _0x3353d2;});}return null;};}function removeEntity(_0x5621b6,_0x1efc3d){return function(_0x4ad68c){if(_0x4ad68c){return _0x4ad68c[_0xe16b('0x27')]()['then'](function(){_0x5621b6[_0xe16b('0x1c')](0xcc)[_0xe16b('0x1d')]();});}};}function handleEntityNotFound(_0x34c94b,_0x2432e0){return function(_0x5835e1){if(!_0x5835e1){_0x34c94b[_0xe16b('0x1b')](0x194);}return _0x5835e1;};}function handleError(_0x5a96d8,_0x36beb1){_0x36beb1=_0x36beb1||0x1f4;return function(_0x2df842){logger[_0xe16b('0x28')](_0x2df842[_0xe16b('0x29')]);if(_0x2df842[_0xe16b('0x2a')]){delete _0x2df842[_0xe16b('0x2a')];}_0x5a96d8[_0xe16b('0x1c')](_0x36beb1)['send'](_0x2df842);};}exports[_0xe16b('0x2b')]=function(_0x599bb1,_0x12120a){var _0x32b761={},_0xc32d10={},_0x266971={'count':0x0,'rows':[]};var _0x34685f=_[_0xe16b('0x2c')](db[_0xe16b('0x2d')]['rawAttributes'],function(_0x49aa72){return{'name':_0x49aa72[_0xe16b('0x2e')],'type':_0x49aa72[_0xe16b('0x2f')][_0xe16b('0x30')]};});_0xc32d10['model']=_[_0xe16b('0x2c')](_0x34685f,_0xe16b('0x2a'));_0xc32d10['query']=_['keys'](_0x599bb1[_0xe16b('0x31')]);_0xc32d10[_0xe16b('0x32')]=_[_0xe16b('0x33')](_0xc32d10[_0xe16b('0x34')],_0xc32d10[_0xe16b('0x31')]);_0x32b761['attributes']=_[_0xe16b('0x33')](_0xc32d10[_0xe16b('0x34')],qs['fields'](_0x599bb1[_0xe16b('0x31')][_0xe16b('0x35')]));_0x32b761[_0xe16b('0x36')]=_0x32b761[_0xe16b('0x36')][_0xe16b('0x37')]?_0x32b761[_0xe16b('0x36')]:_0xc32d10[_0xe16b('0x34')];if(!_0x599bb1[_0xe16b('0x31')][_0xe16b('0x38')](_0xe16b('0x39'))){_0x32b761[_0xe16b('0x3a')]=qs['limit'](_0x599bb1[_0xe16b('0x31')]['limit']);_0x32b761['offset']=qs['offset'](_0x599bb1[_0xe16b('0x31')][_0xe16b('0x21')]);}_0x32b761[_0xe16b('0x3b')]=qs[_0xe16b('0x3c')](_0x599bb1[_0xe16b('0x31')][_0xe16b('0x3c')]);_0x32b761['where']=qs[_0xe16b('0x32')](_['pick'](_0x599bb1[_0xe16b('0x31')],_0xc32d10[_0xe16b('0x32')]),_0x34685f);if(_0x599bb1[_0xe16b('0x31')][_0xe16b('0x3d')]){_0x32b761[_0xe16b('0x3e')]=_[_0xe16b('0x3f')](_0x32b761[_0xe16b('0x3e')],{'$or':_['map'](_0x34685f,function(_0x58c05e){if(_0x58c05e['type']!=='VIRTUAL'){var _0x45d6f2={};_0x45d6f2[_0x58c05e['name']]={'$like':'%'+_0x599bb1['query']['filter']+'%'};return _0x45d6f2;}})});}_0x32b761=_[_0xe16b('0x3f')]({},_0x32b761,_0x599bb1['options']);var _0x1b617f={'where':_0x32b761[_0xe16b('0x3e')]};return db[_0xe16b('0x2d')][_0xe16b('0x20')](_0x1b617f)['then'](function(_0x491569){_0x266971['count']=_0x491569;if(_0x599bb1[_0xe16b('0x31')][_0xe16b('0x40')]){_0x32b761[_0xe16b('0x41')]=[{'all':!![]}];}return db[_0xe16b('0x2d')][_0xe16b('0x42')](_0x32b761);})[_0xe16b('0x26')](function(_0x449fb5){_0x266971[_0xe16b('0x43')]=_0x449fb5;return _0x266971;})[_0xe16b('0x26')](respondWithFilteredResult(_0x12120a,_0x32b761))['catch'](handleError(_0x12120a,null));};exports[_0xe16b('0x44')]=function(_0xdd0e40,_0x2b2c89){var _0x2f52f7={'raw':!![],'where':{'id':_0xdd0e40[_0xe16b('0x45')]['id']}},_0x4d744e={};_0x4d744e[_0xe16b('0x34')]=_['keys'](db[_0xe16b('0x2d')][_0xe16b('0x46')]);_0x4d744e[_0xe16b('0x31')]=_['keys'](_0xdd0e40[_0xe16b('0x31')]);_0x4d744e[_0xe16b('0x32')]=_['intersection'](_0x4d744e[_0xe16b('0x34')],_0x4d744e[_0xe16b('0x31')]);_0x2f52f7[_0xe16b('0x36')]=_[_0xe16b('0x33')](_0x4d744e[_0xe16b('0x34')],qs['fields'](_0xdd0e40['query'][_0xe16b('0x35')]));_0x2f52f7[_0xe16b('0x36')]=_0x2f52f7[_0xe16b('0x36')][_0xe16b('0x37')]?_0x2f52f7['attributes']:_0x4d744e[_0xe16b('0x34')];if(_0xdd0e40['query'][_0xe16b('0x40')]){_0x2f52f7[_0xe16b('0x41')]=[{'all':!![]}];}_0x2f52f7=_[_0xe16b('0x3f')]({},_0x2f52f7,_0xdd0e40['options']);return db[_0xe16b('0x2d')][_0xe16b('0x47')](_0x2f52f7)[_0xe16b('0x26')](handleEntityNotFound(_0x2b2c89,null))[_0xe16b('0x26')](respondWithResult(_0x2b2c89,null))[_0xe16b('0x48')](handleError(_0x2b2c89,null));};exports[_0xe16b('0x49')]=function(_0x30d7d9,_0x354448){return db[_0xe16b('0x2d')][_0xe16b('0x49')](_0x30d7d9[_0xe16b('0x4a')],{})['then'](respondWithResult(_0x354448,0xc9))[_0xe16b('0x48')](handleError(_0x354448,null));};exports[_0xe16b('0x25')]=function(_0x19cadb,_0x295795){if(_0x19cadb[_0xe16b('0x4a')]['id']){delete _0x19cadb['body']['id'];}return db[_0xe16b('0x2d')][_0xe16b('0x47')]({'where':{'id':_0x19cadb['params']['id']}})[_0xe16b('0x26')](handleEntityNotFound(_0x295795,null))[_0xe16b('0x26')](saveUpdates(_0x19cadb['body'],null))[_0xe16b('0x26')](respondWithResult(_0x295795,null))['catch'](handleError(_0x295795,null));};exports[_0xe16b('0x27')]=function(_0x1a5f1e,_0x271f0d){return db[_0xe16b('0x2d')][_0xe16b('0x47')]({'where':{'id':_0x1a5f1e[_0xe16b('0x45')]['id']}})[_0xe16b('0x26')](handleEntityNotFound(_0x271f0d,null))['then'](removeEntity(_0x271f0d,null))[_0xe16b('0x48')](handleError(_0x271f0d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4fd89d4..caa6b40 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 _0x0e94=['event_dtm','dtm','lodash','api','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log'];(function(_0x30946b,_0x4f5a51){var _0x159e5d=function(_0x564ed6){while(--_0x564ed6){_0x30946b['push'](_0x30946b['shift']());}};_0x159e5d(++_0x4f5a51);}(_0x0e94,0x8e));var _0x40e9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0e94[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x40e9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40e9('0x1'));var moment=require(_0x40e9('0x2'));var BPromise=require(_0x40e9('0x3'));var rp=require(_0x40e9('0x4'));var fs=require('fs');var path=require(_0x40e9('0x5'));var rimraf=require(_0x40e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x40e9('0x7'));module[_0x40e9('0x8')]=function(_0xea3cdb,_0x41b6be){return _0xea3cdb[_0x40e9('0x9')](_0x40e9('0xa'),attributes,{'tableName':_0x40e9('0xb'),'paranoid':![],'indexes':[{'name':_0x40e9('0xc'),'fields':['event',_0x40e9('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x51a8=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','bluebird'];(function(_0x8d720,_0x2183f1){var _0x56a534=function(_0x34cbb2){while(--_0x34cbb2){_0x8d720['push'](_0x8d720['shift']());}};_0x56a534(++_0x2183f1);}(_0x51a8,0xec));var _0x851a=function(_0x58af3f,_0x5e356b){_0x58af3f=_0x58af3f-0x0;var _0x3e7104=_0x51a8[_0x58af3f];return _0x3e7104;};'use strict';var _=require(_0x851a('0x0'));var util=require(_0x851a('0x1'));var logger=require('../../config/logger')(_0x851a('0x2'));var moment=require('moment');var BPromise=require(_0x851a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x851a('0x4'));var rimraf=require(_0x851a('0x5'));var config=require(_0x851a('0x6'));var attributes=require(_0x851a('0x7'));module[_0x851a('0x8')]=function(_0x58a3b6,_0x317ead){return _0x58a3b6[_0x851a('0x9')](_0x851a('0xa'),attributes,{'tableName':_0x851a('0xb'),'paranoid':![],'indexes':[{'name':_0x851a('0xc'),'fields':[_0x851a('0xd'),_0x851a('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 333a938..f42eb94 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 _0xf429=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x574d9b,_0x2063da){var _0x31d2a5=function(_0x97ce4c){while(--_0x97ce4c){_0x574d9b['push'](_0x574d9b['shift']());}};_0x31d2a5(++_0x2063da);}(_0xf429,0xd4));var _0x9f42=function(_0x3a9e73,_0x567a70){_0x3a9e73=_0x3a9e73-0x0;var _0x5af67a=_0xf429[_0x3a9e73];return _0x5af67a;};'use strict';var _=require('lodash');var util=require(_0x9f42('0x0'));var moment=require(_0x9f42('0x1'));var BPromise=require(_0x9f42('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f42('0x3'));var db=require(_0x9f42('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f42('0x5'))(_0x9f42('0x6'));var config=require(_0x9f42('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9f42('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x419791,_0x4329bf,_0x108fcb){return new BPromise(function(_0x484ccd,_0x5a8452){return client[_0x9f42('0x9')](_0x419791,_0x108fcb)['then'](function(_0x9ebde2){logger['info'](_0x9f42('0xa'),_0x4329bf,_0x9f42('0xb'));logger[_0x9f42('0xc')](_0x9f42('0xd'),_0x4329bf,_0x9f42('0xb'),JSON[_0x9f42('0xe')](_0x9ebde2));if(_0x9ebde2['error']){if(_0x9ebde2[_0x9f42('0xf')]['code']===0x1f4){logger[_0x9f42('0xf')](_0x9f42('0xa'),_0x4329bf,_0x9ebde2[_0x9f42('0xf')][_0x9f42('0x10')]);return _0x5a8452(_0x9ebde2[_0x9f42('0xf')][_0x9f42('0x10')]);}logger['error'](_0x9f42('0xa'),_0x4329bf,_0x9ebde2[_0x9f42('0xf')][_0x9f42('0x10')]);return _0x484ccd(_0x9ebde2[_0x9f42('0xf')]['message']);}else{logger['info'](_0x9f42('0xa'),_0x4329bf,_0x9f42('0xb'));_0x484ccd(_0x9ebde2[_0x9f42('0x11')][_0x9f42('0x10')]);}})[_0x9f42('0x12')](function(_0x3bdae8){logger[_0x9f42('0xf')](_0x9f42('0xa'),_0x4329bf,_0x3bdae8);_0x5a8452(_0x3bdae8);});});} \ No newline at end of file +var _0xbbba=['VoiceQueuesLog,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x117f18,_0x43cb2b){var _0x2d04e6=function(_0x15f1f7){while(--_0x15f1f7){_0x117f18['push'](_0x117f18['shift']());}};_0x2d04e6(++_0x43cb2b);}(_0xbbba,0x100));var _0xabbb=function(_0x911353,_0x1648ed){_0x911353=_0x911353-0x0;var _0x2f05fa=_0xbbba[_0x911353];return _0x2f05fa;};'use strict';var _=require(_0xabbb('0x0'));var util=require(_0xabbb('0x1'));var moment=require(_0xabbb('0x2'));var BPromise=require(_0xabbb('0x3'));var rs=require(_0xabbb('0x4'));var fs=require('fs');var Redis=require(_0xabbb('0x5'));var db=require(_0xabbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xabbb('0x7'))(_0xabbb('0x8'));var config=require(_0xabbb('0x9'));var jayson=require(_0xabbb('0xa'));var client=jayson[_0xabbb('0xb')][_0xabbb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c8f91,_0x22341d,_0x479aa6){return new BPromise(function(_0x1f5693,_0x5a43d2){return client[_0xabbb('0xd')](_0x2c8f91,_0x479aa6)[_0xabbb('0xe')](function(_0x14bb32){logger[_0xabbb('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x22341d,_0xabbb('0x10'));logger['debug'](_0xabbb('0x11'),_0x22341d,_0xabbb('0x10'),JSON['stringify'](_0x14bb32));if(_0x14bb32[_0xabbb('0x12')]){if(_0x14bb32['error'][_0xabbb('0x13')]===0x1f4){logger['error'](_0xabbb('0x14'),_0x22341d,_0x14bb32[_0xabbb('0x12')][_0xabbb('0x15')]);return _0x5a43d2(_0x14bb32['error'][_0xabbb('0x15')]);}logger[_0xabbb('0x12')](_0xabbb('0x14'),_0x22341d,_0x14bb32[_0xabbb('0x12')][_0xabbb('0x15')]);return _0x1f5693(_0x14bb32[_0xabbb('0x12')][_0xabbb('0x15')]);}else{logger['info'](_0xabbb('0x14'),_0x22341d,'request\x20sent');_0x1f5693(_0x14bb32['result'][_0xabbb('0x15')]);}})[_0xabbb('0x16')](function(_0x39b0d5){logger[_0xabbb('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x22341d,_0x39b0d5);_0x5a43d2(_0x39b0d5);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2767166..4782719 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 _0x5f23=['/:id','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x3fedee,_0x43b9bf){var _0x2382a1=function(_0x2197d9){while(--_0x2197d9){_0x3fedee['push'](_0x3fedee['shift']());}};_0x2382a1(++_0x43b9bf);}(_0x5f23,0x1cf));var _0x35f2=function(_0x432b8f,_0x3d1150){_0x432b8f=_0x432b8f-0x0;var _0x19e53b=_0x5f23[_0x432b8f];return _0x19e53b;};'use strict';var multer=require(_0x35f2('0x0'));var util=require(_0x35f2('0x1'));var path=require(_0x35f2('0x2'));var timeout=require('connect-timeout');var express=require(_0x35f2('0x3'));var router=express[_0x35f2('0x4')]();var fs_extra=require(_0x35f2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x35f2('0x6'));var controller=require('./voiceRecording.controller');router[_0x35f2('0x7')]('/',auth[_0x35f2('0x8')](),controller[_0x35f2('0x9')]);router['get'](_0x35f2('0xa'),auth[_0x35f2('0x8')](),controller[_0x35f2('0xb')]);router[_0x35f2('0x7')](_0x35f2('0xc'),auth[_0x35f2('0x8')](),controller['show']);router[_0x35f2('0x7')]('/:id/download',auth[_0x35f2('0x8')](),controller['download']);router['get'](_0x35f2('0xd'),controller[_0x35f2('0xe')]);router[_0x35f2('0x7')](_0x35f2('0xf'),auth[_0x35f2('0x8')](),controller[_0x35f2('0x10')]);router[_0x35f2('0x11')]('/',auth[_0x35f2('0x8')](),controller[_0x35f2('0x12')]);router[_0x35f2('0x11')](_0x35f2('0xf'),auth[_0x35f2('0x8')](),controller[_0x35f2('0x13')]);router[_0x35f2('0x14')](_0x35f2('0xc'),auth['isAuthenticated'](),controller[_0x35f2('0x15')]);router[_0x35f2('0x16')](_0x35f2('0xc'),auth['isAuthenticated'](),controller[_0x35f2('0x17')]);module[_0x35f2('0x18')]=router; \ No newline at end of file +var _0x6f30=['destroy','path','connect-timeout','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','/:id','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','create','post','put','update','delete'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x6f30,0xb1));var _0x06f3=function(_0x32c98a,_0x5e6eb0){_0x32c98a=_0x32c98a-0x0;var _0x1796d3=_0x6f30[_0x32c98a];return _0x1796d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x06f3('0x0'));var timeout=require(_0x06f3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x06f3('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x06f3('0x3'));var controller=require(_0x06f3('0x4'));router[_0x06f3('0x5')]('/',auth['isAuthenticated'](),controller[_0x06f3('0x6')]);router[_0x06f3('0x5')]('/describe',auth[_0x06f3('0x7')](),controller[_0x06f3('0x8')]);router[_0x06f3('0x5')](_0x06f3('0x9'),auth[_0x06f3('0x7')](),controller[_0x06f3('0xa')]);router['get'](_0x06f3('0xb'),auth[_0x06f3('0x7')](),controller[_0x06f3('0xc')]);router[_0x06f3('0x5')]('/:id/downloads',controller[_0x06f3('0xd')]);router[_0x06f3('0x5')](_0x06f3('0xe'),auth[_0x06f3('0x7')](),controller[_0x06f3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x06f3('0x10')]);router[_0x06f3('0x11')](_0x06f3('0xe'),auth[_0x06f3('0x7')](),controller['runTranscribe']);router[_0x06f3('0x12')](_0x06f3('0x9'),auth['isAuthenticated'](),controller[_0x06f3('0x13')]);router[_0x06f3('0x14')](_0x06f3('0x9'),auth[_0x06f3('0x7')](),controller[_0x06f3('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 2ed5cfd..983572d 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(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 db7a54f..2b5205e 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 _0x93ac=['count','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','value','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','downloads','../../components/encryptor','MD5','col','uniqueid','token','$and','decryptFile','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','apply','reject','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceRecording'];(function(_0x2bbe58,_0x2af1f8){var _0xb6960e=function(_0x3d31d9){while(--_0x3d31d9){_0x2bbe58['push'](_0x2bbe58['shift']());}};_0xb6960e(++_0x2af1f8);}(_0x93ac,0xf7));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc93a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc93a('0x1'));var rp=require(_0xc93a('0x2'));var moment=require(_0xc93a('0x3'));var BPromise=require(_0xc93a('0x4'));var Mustache=require(_0xc93a('0x5'));var util=require('util');var path=require(_0xc93a('0x6'));var sox=require(_0xc93a('0x7'));var csv=require('to-csv');var ejs=require(_0xc93a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc93a('0x9'));var squel=require(_0xc93a('0xa'));var crypto=require(_0xc93a('0xb'));var jsforce=require(_0xc93a('0xc'));var deskjs=require(_0xc93a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc93a('0xe'));var Papa=require('papaparse');var AWS=require(_0xc93a('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0xc93a('0x10'));var authService=require(_0xc93a('0x11'));var qs=require(_0xc93a('0x12'));var as=require(_0xc93a('0x13'));var hardwareService=require(_0xc93a('0x14'));var logger=require('../../config/logger')(_0xc93a('0x15'));var utils=require(_0xc93a('0x16'));var config=require(_0xc93a('0x17'));var licenseUtil=require(_0xc93a('0x18'));var db=require(_0xc93a('0x19'))['db'];function respondWithStatusCode(_0x43d17e,_0x5c80b6){_0x5c80b6=_0x5c80b6||0xcc;return function(_0x472c28){if(_0x472c28){return _0x43d17e['sendStatus'](_0x5c80b6);}return _0x43d17e[_0xc93a('0x1a')](_0x5c80b6)[_0xc93a('0x1b')]();};}function respondWithResult(_0xa6ddd9,_0x48e5dc){_0x48e5dc=_0x48e5dc||0xc8;return function(_0x4fa7b3){if(_0x4fa7b3){return _0xa6ddd9['status'](_0x48e5dc)['json'](_0x4fa7b3);}};}function respondWithFilteredResult(_0x43d75f,_0xd1e337){return function(_0x901866){if(_0x901866){var _0x536c58=typeof _0xd1e337[_0xc93a('0x1c')]==='undefined'&&typeof _0xd1e337['limit']===_0xc93a('0x1d');var _0x100533=_0x901866['count'];var _0x2d20a7=_0x536c58?0x0:_0xd1e337[_0xc93a('0x1c')];var _0x2818a5=_0x536c58?_0x901866['count']:_0xd1e337[_0xc93a('0x1c')]+_0xd1e337[_0xc93a('0x1e')];var _0x2caeb2;if(_0x2818a5>=_0x100533){_0x2818a5=_0x100533;_0x2caeb2=0xc8;}else{_0x2caeb2=0xce;}_0x43d75f[_0xc93a('0x1a')](_0x2caeb2);return _0x43d75f[_0xc93a('0x1f')]('Content-Range',_0x2d20a7+'-'+_0x2818a5+'/'+_0x100533)['json'](_0x901866);}return null;};}function patchUpdates(_0x2b3c7f){return function(_0x4f35e0){try{jsonpatch[_0xc93a('0x20')](_0x4f35e0,_0x2b3c7f,!![]);}catch(_0x333791){return BPromise[_0xc93a('0x21')](_0x333791);}return _0x4f35e0['save']();};}function saveUpdates(_0x3cabdb,_0x5e70c4){return function(_0x56e782){if(_0x56e782){return _0x56e782[_0xc93a('0x22')](_0x3cabdb)[_0xc93a('0x23')](function(_0x2cd9ba){return _0x2cd9ba;});}return null;};}function removeEntity(_0x57d9f9,_0x4b3aca){return function(_0x30b04a){if(_0x30b04a){return _0x30b04a['destroy']()[_0xc93a('0x23')](function(){_0x57d9f9[_0xc93a('0x1a')](0xcc)[_0xc93a('0x1b')]();});}};}function handleEntityNotFound(_0x4de375,_0x2d85d9){return function(_0x3958fb){if(!_0x3958fb){_0x4de375[_0xc93a('0x24')](0x194);}return _0x3958fb;};}function handleError(_0x1bcb58,_0x479f66){_0x479f66=_0x479f66||0x1f4;return function(_0x3a0dc9){logger['error'](_0x3a0dc9[_0xc93a('0x25')]);if(_0x3a0dc9[_0xc93a('0x26')]){delete _0x3a0dc9['name'];}_0x1bcb58[_0xc93a('0x1a')](_0x479f66)[_0xc93a('0x27')](_0x3a0dc9);};}exports[_0xc93a('0x28')]=function(_0x8a9fc5,_0xb94a52){var _0x5aaf81={},_0x26d284={},_0x19bd17={'count':0x0,'rows':[]};var _0x404ed8=_[_0xc93a('0x29')](db['VoiceRecording'][_0xc93a('0x2a')],function(_0x55970c){return{'name':_0x55970c[_0xc93a('0x2b')],'type':_0x55970c[_0xc93a('0x2c')]['key']};});_0x26d284['model']=_[_0xc93a('0x2d')](_['map'](_0x404ed8,'name'),[_0xc93a('0x2e')]);_0x26d284[_0xc93a('0x2f')]=_[_0xc93a('0x30')](_0x8a9fc5['query']);_0x26d284[_0xc93a('0x31')]=_[_0xc93a('0x32')](_0x26d284[_0xc93a('0x33')],_0x26d284[_0xc93a('0x2f')]);_0x5aaf81[_0xc93a('0x34')]=_[_0xc93a('0x32')](_0x26d284['model'],qs[_0xc93a('0x35')](_0x8a9fc5[_0xc93a('0x2f')][_0xc93a('0x35')]));_0x5aaf81[_0xc93a('0x34')]=_0x5aaf81['attributes'][_0xc93a('0x36')]?_0x5aaf81[_0xc93a('0x34')]:_0x26d284[_0xc93a('0x33')];if(!_0x8a9fc5['query'][_0xc93a('0x37')](_0xc93a('0x38'))){_0x5aaf81['limit']=qs[_0xc93a('0x1e')](_0x8a9fc5['query']['limit']);_0x5aaf81[_0xc93a('0x1c')]=qs['offset'](_0x8a9fc5['query'][_0xc93a('0x1c')]);}_0x5aaf81[_0xc93a('0x39')]=qs[_0xc93a('0x3a')](_0x8a9fc5['query'][_0xc93a('0x3a')]);_0x5aaf81[_0xc93a('0x3b')]=qs[_0xc93a('0x31')](_[_0xc93a('0x3c')](_0x8a9fc5[_0xc93a('0x2f')],_0x26d284[_0xc93a('0x31')]),_0x404ed8);if(_0x8a9fc5[_0xc93a('0x2f')][_0xc93a('0x3d')]){_0x5aaf81['where']=_['merge'](_0x5aaf81['where'],{'$or':_[_0xc93a('0x29')](_0x404ed8,function(_0x27e72b){if(_0x27e72b[_0xc93a('0x2c')]!=='VIRTUAL'){var _0x313d7c={};_0x313d7c[_0x27e72b[_0xc93a('0x26')]]={'$like':'%'+_0x8a9fc5['query'][_0xc93a('0x3d')]+'%'};return _0x313d7c;}})});}_0x5aaf81=_[_0xc93a('0x3e')]({},_0x5aaf81,_0x8a9fc5[_0xc93a('0x3f')]);var _0x5539b2={'where':_0x5aaf81[_0xc93a('0x3b')]};return db[_0xc93a('0x40')][_0xc93a('0x41')](_0x5539b2)[_0xc93a('0x23')](function(_0x117ff2){_0x19bd17[_0xc93a('0x41')]=_0x117ff2;if(_0x8a9fc5[_0xc93a('0x2f')]['includeAll']){_0x5aaf81['include']=[{'all':!![]}];}return db[_0xc93a('0x40')][_0xc93a('0x42')](_0x5aaf81);})[_0xc93a('0x23')](function(_0x43b3e5){_0x19bd17[_0xc93a('0x43')]=_0x43b3e5;return _0x19bd17;})['then'](respondWithFilteredResult(_0xb94a52,_0x5aaf81))[_0xc93a('0x44')](handleError(_0xb94a52,null));};exports[_0xc93a('0x45')]=function(_0x3200f5,_0x488bb2){var _0x4016e0={'raw':![],'where':{'id':_0x3200f5[_0xc93a('0x46')]['id']}},_0x31a197={};_0x31a197[_0xc93a('0x33')]=_['keys'](db[_0xc93a('0x40')]['rawAttributes']);_0x31a197[_0xc93a('0x2f')]=_[_0xc93a('0x30')](_0x3200f5['query']);_0x31a197[_0xc93a('0x31')]=_['intersection'](_0x31a197[_0xc93a('0x33')],_0x31a197[_0xc93a('0x2f')]);_0x4016e0['attributes']=_['intersection'](_0x31a197[_0xc93a('0x33')],qs[_0xc93a('0x35')](_0x3200f5[_0xc93a('0x2f')][_0xc93a('0x35')]));_0x4016e0['attributes']=_0x4016e0[_0xc93a('0x34')][_0xc93a('0x36')]?_0x4016e0[_0xc93a('0x34')]:_0x31a197['model'];if(_0x3200f5[_0xc93a('0x2f')][_0xc93a('0x47')]){_0x4016e0[_0xc93a('0x48')]=[{'all':!![]}];}_0x4016e0=_[_0xc93a('0x3e')]({},_0x4016e0,_0x3200f5['options']);return db[_0xc93a('0x40')][_0xc93a('0x49')](_0x4016e0)[_0xc93a('0x23')](handleEntityNotFound(_0x488bb2,null))[_0xc93a('0x23')](respondWithResult(_0x488bb2,null))['catch'](handleError(_0x488bb2,null));};exports[_0xc93a('0x4a')]=function(_0x2eb632,_0x194a6e){return db[_0xc93a('0x40')]['create'](_0x2eb632['body'],{})[_0xc93a('0x23')](respondWithResult(_0x194a6e,0xc9))[_0xc93a('0x44')](handleError(_0x194a6e,null));};exports['update']=function(_0xea762b,_0x9836c6){if(_0xea762b[_0xc93a('0x4b')]['id']){delete _0xea762b[_0xc93a('0x4b')]['id'];}return db[_0xc93a('0x40')][_0xc93a('0x49')]({'where':{'id':_0xea762b['params']['id']}})['then'](handleEntityNotFound(_0x9836c6,null))[_0xc93a('0x23')](saveUpdates(_0xea762b[_0xc93a('0x4b')],null))[_0xc93a('0x23')](respondWithResult(_0x9836c6,null))[_0xc93a('0x44')](handleError(_0x9836c6,null));};exports[_0xc93a('0x4c')]=function(_0x182eb5,_0x4aca05){return db[_0xc93a('0x40')]['describe']()[_0xc93a('0x23')](respondWithResult(_0x4aca05,null))[_0xc93a('0x44')](handleError(_0x4aca05,null));};exports['download']=function(_0x58ec9a,_0x27b5dc,_0x86b18){var _0x3b4483=require('../../components/encryptor');var _0x44522c=![];var _0x3ed111={};if(_0x58ec9a[_0xc93a('0x2f')][_0xc93a('0x2c')]&&_0x58ec9a[_0xc93a('0x2f')][_0xc93a('0x2c')]==='uniqueid'){_0x3ed111['uniqueid']=_0x58ec9a['params']['id'];}else{_0x3ed111['id']=_0x58ec9a['params']['id'];}return db[_0xc93a('0x40')][_0xc93a('0x49')]({'where':_0x3ed111,'attributes':['id',_0xc93a('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x27b5dc,null))[_0xc93a('0x23')](function(_0xe965f){if(_0xe965f){var _0x37c5c0=_0xe965f[_0xc93a('0x4d')];var _0x4b8657=util[_0xc93a('0x2e')](_0xc93a('0x4e'),_0x37c5c0);if(fs['existsSync'](_0x4b8657)){_0x44522c=!![];return _0x3b4483['decryptFile'](_0x4b8657,_0x37c5c0,config[_0xc93a('0x4f')][_0xc93a('0x50')])[_0xc93a('0x23')](function(){return _0xe965f;});}return _0xe965f;}})['then'](function(_0xdc4816){if(_0xdc4816){var _0xc5f4c1=_0xdc4816['value'];if(!fs[_0xc93a('0x51')](_0xc5f4c1)){throw new db[(_0xc93a('0x52'))][(_0xc93a('0x53'))](_0xc93a('0x54'));}if(_0xdc4816[_0xc93a('0x55')]){return _0x27b5dc[_0xc93a('0x56')](_0xc5f4c1,_0xdc4816['filename']+path[_0xc93a('0x57')](_0xc5f4c1),function(){if(_0x44522c){fs[_0xc93a('0x58')](_0xc5f4c1);}});}else{return _0x27b5dc[_0xc93a('0x56')](_0xc5f4c1,function(_0x4f22da){if(_0x44522c){fs[_0xc93a('0x58')](_0xc5f4c1);}});}}})['catch'](function(_0xb8d166){if(_0xb8d166[_0xc93a('0x59')]===_0xc93a('0x54')){_0x27b5dc[_0xc93a('0x1a')](0x194)[_0xc93a('0x27')]('Not\x20found');}else{return handleError(_0x27b5dc,null);}});};exports[_0xc93a('0x5a')]=function(_0x31b2ee,_0xf8a501,_0x120825){var _0xc3f78c=require(_0xc93a('0x5b'));var _0x1780ab=![];var _0x50b0a7={'$and':[db['sequelize']['where'](db['sequelize']['fn'](_0xc93a('0x5c'),db['sequelize'][_0xc93a('0x5d')](_0xc93a('0x5e'))),_0x31b2ee[_0xc93a('0x2f')][_0xc93a('0x5f')])]};if(_0x31b2ee[_0xc93a('0x2f')][_0xc93a('0x2c')]&&_0x31b2ee[_0xc93a('0x2f')][_0xc93a('0x2c')]===_0xc93a('0x5e')){_0x50b0a7[_0xc93a('0x60')]['push']({'uniqueid':_0x31b2ee[_0xc93a('0x46')]['id']});}else{_0x50b0a7[_0xc93a('0x60')]['push']({'id':_0x31b2ee[_0xc93a('0x46')]['id']});}return db[_0xc93a('0x40')]['find']({'where':_0x50b0a7,'attributes':['id',_0xc93a('0x4d')],'raw':!![]})[_0xc93a('0x23')](handleEntityNotFound(_0xf8a501,null))[_0xc93a('0x23')](function(_0x1248fb){if(_0x1248fb){var _0x3a4e08=util[_0xc93a('0x2e')](_0xc93a('0x4e'),_0x1248fb[_0xc93a('0x4d')]);if(fs[_0xc93a('0x51')](_0x3a4e08)){_0x1780ab=!![];return _0xc3f78c[_0xc93a('0x61')](_0x3a4e08,_0x1248fb['value'],config[_0xc93a('0x4f')][_0xc93a('0x50')])[_0xc93a('0x23')](function(){return _0x1248fb;});}return _0x1248fb;}})[_0xc93a('0x23')](function(_0x3407e6){if(_0x3407e6){if(!fs[_0xc93a('0x51')](_0x3407e6[_0xc93a('0x4d')])){throw new db[(_0xc93a('0x52'))][(_0xc93a('0x53'))](_0xc93a('0x54'));}if(_0x3407e6['filename']){return _0xf8a501[_0xc93a('0x56')](_0x3407e6[_0xc93a('0x4d')],_0x3407e6[_0xc93a('0x55')]+path['extname'](_0x3407e6['value']),function(){if(_0x1780ab){fs[_0xc93a('0x58')](_0x3407e6[_0xc93a('0x4d')]);}});}else{return _0xf8a501[_0xc93a('0x56')](_0x3407e6[_0xc93a('0x4d')],function(_0x581291){if(_0x1780ab){fs[_0xc93a('0x58')](_0x3407e6['value']);}});}}})[_0xc93a('0x44')](handleError(_0xf8a501,null));};exports[_0xc93a('0x62')]=function(_0x149c77,_0x17b99c){return db['VoiceRecording']['find']({'where':{'id':_0x149c77['params']['id']}})[_0xc93a('0x23')](function(_0x19b9db){if(_[_0xc93a('0x63')](_0x19b9db)){throw new ReferenceError(_0xc93a('0x64'));}return _0x19b9db;})[_0xc93a('0x23')](function(_0x2c0924){var _0x328ecf=_0x2c0924[_0xc93a('0x4d')];logger[_0xc93a('0x65')](_0xc93a('0x66'),_0x328ecf);if(!_['isNil'](_0x2c0924[_0xc93a('0x4d')])&&fs['existsSync'](_0x328ecf)){logger[_0xc93a('0x65')](_0xc93a('0x67')+_0x328ecf+_0xc93a('0x68'));fs[_0xc93a('0x69')](_0x328ecf);}_0x328ecf=_0x328ecf+_0xc93a('0x6a');if(!_['isNil'](_0x2c0924[_0xc93a('0x4d')])&&fs['existsSync'](_0x328ecf)){logger['info']('File:\x20\x22'+_0x328ecf+_0xc93a('0x68'));fs[_0xc93a('0x69')](_0x328ecf);}return _0x2c0924;})[_0xc93a('0x23')](function(_0x1fb36a){if(!_0x1fb36a)throw new InternalError();return _0x1fb36a['destroy']();})['then'](function(){_0x17b99c[_0xc93a('0x1a')](0xcc)[_0xc93a('0x1b')]();})[_0xc93a('0x44')](handleError(_0x17b99c,null));};function getBucketslist(_0x8cf42f,_0x58619b,_0x178027){return new Promise(function(_0x187b39,_0x34d1bd){var _0x4f3a5a=new AWS['S3']({'accessKeyId':_0x58619b,'secretAccessKey':_0x8cf42f,'region':_0x178027});_0x4f3a5a[_0xc93a('0x6b')]({},function(_0x4c2d84,_0xd2cbee){if(_0x4c2d84){return _0x34d1bd(_0x4c2d84);}else{return _0x187b39(_0xd2cbee);}});});}function createBucket(_0x13b293,_0x4150c3,_0x47f0d0,_0x56d697){return new Promise(function(_0x30ef30,_0x352285){var _0x59879d=new AWS['S3']({'accessKeyId':_0x4150c3,'secretAccessKey':_0x13b293,'region':_0x47f0d0});_0x59879d['createBucket']({'Bucket':_0x56d697},function(_0x3c2a7c,_0xc72f39){if(_0x3c2a7c){return _0x352285(_0x3c2a7c);}else{return _0x30ef30(_0xc72f39);}});});}function uploadFile(_0x3e0f0f,_0x4bef52,_0x48edab,_0x2e97c4,_0x4c111e,_0x5d26fd){return new Promise(function(_0xfa25ee,_0x2a1cab){var _0xd5c477=new AWS['S3']({'accessKeyId':_0x4bef52,'secretAccessKey':_0x3e0f0f,'region':_0x48edab});_0xd5c477[_0xc93a('0x6c')]({'Bucket':_0x2e97c4,'Key':_0x4c111e,'Body':_0x5d26fd},function(_0x4c0622,_0x520f01){if(_0x4c0622){return _0x2a1cab(_0x4c0622);}else{return _0xfa25ee(_0x520f01);}});});}function startTranscribe(_0x5a9189,_0x12aafb,_0x2ce130,_0x24420a,_0x4635eb,_0x15b008){return new Promise(function(_0x1d27b9,_0x55bc11){var _0x5c62a8=new AWS[(_0xc93a('0x6d'))]({'accessKeyId':_0x12aafb,'secretAccessKey':_0x5a9189,'region':_0x2ce130});_0x5c62a8[_0xc93a('0x6e')]({'TranscriptionJobName':_0x24420a,'LanguageCode':_0x4635eb,'Media':{'MediaFileUri':_0x15b008}},function(_0x5988b0,_0xe36ccf){if(_0x5988b0){return _0x55bc11(_0x5988b0);}else{return _0x1d27b9(_0xe36ccf);}});});}function transcribe(_0x23158c,_0xe3d65a,_0x19a31b,_0x19aa53,_0x478221,_0x145835,_0x7d51ca){return new Promise(function(_0x502f0c,_0x528d07){var _0x554c48={};logger[_0xc93a('0x65')](util['format'](_0xc93a('0x6f'),_0x23158c,_0x478221));return uploadFile(_0xe3d65a,_0x19a31b,_0x19aa53,_0x478221,path[_0xc93a('0x70')](_0x145835),fs[_0xc93a('0x71')](_0x145835))[_0xc93a('0x23')](function(_0x1133ed){logger[_0xc93a('0x65')](util['format'](_0xc93a('0x72'),_0x23158c,_0x478221,_0x1133ed['Location']));_0x554c48[_0xc93a('0x73')]=_0x1133ed['Bucket'];_0x554c48[_0xc93a('0x74')]=_0x1133ed[_0xc93a('0x75')];logger['info'](util[_0xc93a('0x2e')](_0xc93a('0x76'),_0x23158c));return startTranscribe(_0xe3d65a,_0x19a31b,_0x19aa53,uuidv4(),_0x7d51ca,_0x1133ed['Location']);})[_0xc93a('0x23')](function(_0x8044c5){logger[_0xc93a('0x65')](util[_0xc93a('0x2e')](_0xc93a('0x77'),_0x23158c,_0x8044c5[_0xc93a('0x78')][_0xc93a('0x79')]));_0x554c48[_0xc93a('0x7a')]=_0x8044c5[_0xc93a('0x78')][_0xc93a('0x79')];_0x554c48[_0xc93a('0x7b')]=_0x8044c5[_0xc93a('0x78')][_0xc93a('0x7c')];return _0x502f0c(_0x554c48);})['catch'](function(_0x1674c8){return _0x528d07(_0x1674c8);});});}exports[_0xc93a('0x7d')]=function(_0x305013,_0x446d7d,_0x4fa7c){var _0x46a424;var _0xdc71ab;var _0x2aaea5;var _0x114145=require(_0xc93a('0x5b'));return db[_0xc93a('0x40')][_0xc93a('0x7e')]({'where':{'id':_0x305013[_0xc93a('0x46')]['id']}})[_0xc93a('0x23')](function(_0x35ecd8){if(_0x35ecd8){var _0x20ff26=util[_0xc93a('0x2e')]('%s.cypher',_0x35ecd8[_0xc93a('0x4d')]);if(fs[_0xc93a('0x51')](_0x20ff26)){cypher=!![];return _0x114145[_0xc93a('0x61')](_0x20ff26,_0x35ecd8[_0xc93a('0x4d')],config['secrets'][_0xc93a('0x50')])['then'](function(){return _0x35ecd8;});}return _0x35ecd8;}})[_0xc93a('0x23')](function(_0x4d7c05){if(!_0x4d7c05){throw new db['Sequelize'][(_0xc93a('0x53'))](_0xc93a('0x7f'));}_0xdc71ab=_0x4d7c05;return db[_0xc93a('0x80')]['findOne']({'where':{'id':0x1}});})[_0xc93a('0x23')](handleEntityNotFound(_0x446d7d,null))['then'](function(_0x523cc9){if(_0x523cc9){_0x46a424=_0x523cc9;if(!_0x46a424[_0xc93a('0x81')]||!_0x46a424[_0xc93a('0x82')]||!_0x46a424[_0xc93a('0x83')]||!_0x46a424[_0xc93a('0x84')]||!_0x46a424[_0xc93a('0x73')]){throw new db[(_0xc93a('0x52'))][(_0xc93a('0x53'))](_0xc93a('0x85'));}if(_0x305013[_0xc93a('0x4b')][_0xc93a('0x86')]&&(!_0x46a424[_0xc93a('0x87')]||!_0x46a424[_0xc93a('0x88')]||!_0x46a424['sentimentRegion']||!_0x46a424[_0xc93a('0x84')]||!_0x46a424['bucket'])){throw new db[(_0xc93a('0x52'))][(_0xc93a('0x53'))](_0xc93a('0x89'));}return db[_0xc93a('0x8a')][_0xc93a('0x7e')]({'where':{'id':_0x46a424['transcribeAccountId']}});}})['then'](function(_0x414c3f){if(!_0x414c3f){throw new db[(_0xc93a('0x52'))][(_0xc93a('0x53'))](_0xc93a('0x8b'));}if(!_0x414c3f[_0xc93a('0x8c')]||!_0x414c3f[_0xc93a('0x8d')]){throw new db[(_0xc93a('0x52'))][(_0xc93a('0x53'))](_0xc93a('0x8e'));}_0x2aaea5=_0x414c3f;return getBucketslist(_0x2aaea5[_0xc93a('0x8c')],_0x2aaea5[_0xc93a('0x8d')],_0x46a424[_0xc93a('0x83')]);})[_0xc93a('0x23')](function(_0x2b1106){if(_0x2b1106&&_0x2b1106[_0xc93a('0x8f')]){var _0x4e321f=_[_0xc93a('0x49')](_0x2b1106[_0xc93a('0x8f')],function(_0x54f592){return _0x54f592['Name']===_0x46a424[_0xc93a('0x73')];});if(!_0x4e321f){logger[_0xc93a('0x65')](util[_0xc93a('0x2e')](_0xc93a('0x90'),_0x305013[_0xc93a('0x46')]['id'],_0x46a424[_0xc93a('0x73')]));return createBucket(_0x2aaea5[_0xc93a('0x8c')],_0x2aaea5[_0xc93a('0x8d')],_0x46a424['transcribeRegion'],_0x46a424[_0xc93a('0x73')]);}logger[_0xc93a('0x65')](util[_0xc93a('0x2e')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x305013[_0xc93a('0x46')]['id'],_0x46a424[_0xc93a('0x73')]));return;}})[_0xc93a('0x23')](function(_0x245c4d){if(_0xdc71ab[_0xc93a('0x7b')]==='NEW'){return transcribe(_0x305013['params']['id'],_0x2aaea5[_0xc93a('0x8c')],_0x2aaea5[_0xc93a('0x8d')],_0x46a424[_0xc93a('0x83')],_0x46a424[_0xc93a('0x73')],_0xdc71ab[_0xc93a('0x4d')],_0x46a424[_0xc93a('0x84')]);}else{logger['info'](util[_0xc93a('0x2e')](_0xc93a('0x91'),_0x305013['params']['id']));return{'transcribeStatus':_0xc93a('0x92')};}})['then'](function(_0x19ca41){if(_0x19ca41){_0x19ca41[_0xc93a('0x93')]=_0x305013[_0xc93a('0x4b')][_0xc93a('0x86')];return _0xdc71ab[_0xc93a('0x94')](_0x19ca41);}})[_0xc93a('0x23')](respondWithResult(_0x446d7d,null))[_0xc93a('0x44')](handleError(_0x446d7d,null));};function writeFile(_0x3a5edd,_0xa1d249){return new Promise(function(_0x36d588,_0x50847b){fs[_0xc93a('0x95')](_0xa1d249,_0x3a5edd,function(_0x24265e,_0xb3eac6){if(_0x24265e){return _0x50847b(_0x24265e);}else{return _0x36d588(_0xb3eac6);}});});}exports[_0xc93a('0x96')]=function(_0x11fa41,_0x57b714,_0x278c68){return db[_0xc93a('0x40')][_0xc93a('0x7e')]({'where':{'id':_0x11fa41[_0xc93a('0x46')]['id']}})[_0xc93a('0x23')](handleEntityNotFound(_0x57b714))['then'](function(_0x4db6ee){if(_0x4db6ee&&_0x4db6ee[_0xc93a('0x97')]){var _0x1ac7d8=_0x4db6ee[_0xc93a('0x97')];var _0x2a3b1f=config[_0xc93a('0x98')]+_0xc93a('0x99')+_0x4db6ee['id']+_0xc93a('0x9a');if(fs[_0xc93a('0x51')](_0x2a3b1f)){return _0x2a3b1f;}return writeFile(_0x1ac7d8,_0x2a3b1f)[_0xc93a('0x23')](function(){return _0x2a3b1f;});}else{throw new db[(_0xc93a('0x52'))][(_0xc93a('0x53'))](_0xc93a('0x9b'));}})[_0xc93a('0x23')](function(_0x3a56a1){return _0x57b714['download'](_0x3a56a1);})[_0xc93a('0x44')](handleError(_0x57b714));}; \ No newline at end of file +var _0x59ba=['util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','aws-sdk','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','show','params','intersection','includeAll','find','create','body','catch','describe','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','ValidationError','unlink','download','message','VoiceRecording\x20not\x20found','send','downloads','../../components/encryptor','sequelize','MD5','token','$and','push','secrets','Sequelize','filename','extname','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','[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','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x59ba,0x12c));var _0xa59b=function(_0x255eb8,_0x4cfdd3){_0x255eb8=_0x255eb8-0x0;var _0x4398d0=_0x59ba[_0x255eb8];return _0x4398d0;};'use strict';var emlformat=require(_0xa59b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa59b('0x1'));var rp=require(_0xa59b('0x2'));var moment=require(_0xa59b('0x3'));var BPromise=require(_0xa59b('0x4'));var Mustache=require(_0xa59b('0x5'));var util=require(_0xa59b('0x6'));var path=require(_0xa59b('0x7'));var sox=require(_0xa59b('0x8'));var csv=require(_0xa59b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa59b('0xa'));var _=require('lodash');var squel=require(_0xa59b('0xb'));var crypto=require(_0xa59b('0xc'));var jsforce=require(_0xa59b('0xd'));var deskjs=require(_0xa59b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa59b('0xf'));var Papa=require('papaparse');var AWS=require(_0xa59b('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xa59b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa59b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa59b('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa59b('0x14'));var licenseUtil=require(_0xa59b('0x15'));var db=require(_0xa59b('0x16'))['db'];function respondWithStatusCode(_0x33f617,_0x1b7ccc){_0x1b7ccc=_0x1b7ccc||0xcc;return function(_0x151c05){if(_0x151c05){return _0x33f617[_0xa59b('0x17')](_0x1b7ccc);}return _0x33f617[_0xa59b('0x18')](_0x1b7ccc)[_0xa59b('0x19')]();};}function respondWithResult(_0x21d91e,_0x38f5c0){_0x38f5c0=_0x38f5c0||0xc8;return function(_0x49a43f){if(_0x49a43f){return _0x21d91e[_0xa59b('0x18')](_0x38f5c0)['json'](_0x49a43f);}};}function respondWithFilteredResult(_0x3a24dd,_0x378aca){return function(_0x3923d3){if(_0x3923d3){var _0x4252cd=typeof _0x378aca[_0xa59b('0x1a')]===_0xa59b('0x1b')&&typeof _0x378aca[_0xa59b('0x1c')]===_0xa59b('0x1b');var _0x5184af=_0x3923d3['count'];var _0x3f169b=_0x4252cd?0x0:_0x378aca[_0xa59b('0x1a')];var _0x1edac8=_0x4252cd?_0x3923d3['count']:_0x378aca[_0xa59b('0x1a')]+_0x378aca['limit'];var _0x203eca;if(_0x1edac8>=_0x5184af){_0x1edac8=_0x5184af;_0x203eca=0xc8;}else{_0x203eca=0xce;}_0x3a24dd[_0xa59b('0x18')](_0x203eca);return _0x3a24dd[_0xa59b('0x1d')](_0xa59b('0x1e'),_0x3f169b+'-'+_0x1edac8+'/'+_0x5184af)[_0xa59b('0x1f')](_0x3923d3);}return null;};}function patchUpdates(_0x37fc68){return function(_0xb422c5){try{jsonpatch[_0xa59b('0x20')](_0xb422c5,_0x37fc68,!![]);}catch(_0x577a44){return BPromise[_0xa59b('0x21')](_0x577a44);}return _0xb422c5[_0xa59b('0x22')]();};}function saveUpdates(_0x2d2cda,_0x5cc5ce){return function(_0xff3024){if(_0xff3024){return _0xff3024['update'](_0x2d2cda)[_0xa59b('0x23')](function(_0x3eebfa){return _0x3eebfa;});}return null;};}function removeEntity(_0xda64f0,_0x4909b6){return function(_0x514ef6){if(_0x514ef6){return _0x514ef6['destroy']()[_0xa59b('0x23')](function(){_0xda64f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xadac20,_0x2b43a1){return function(_0x11d0c1){if(!_0x11d0c1){_0xadac20[_0xa59b('0x17')](0x194);}return _0x11d0c1;};}function handleError(_0x2f8888,_0x5203f9){_0x5203f9=_0x5203f9||0x1f4;return function(_0xc2b335){logger[_0xa59b('0x24')](_0xc2b335[_0xa59b('0x25')]);if(_0xc2b335['name']){delete _0xc2b335[_0xa59b('0x26')];}_0x2f8888[_0xa59b('0x18')](_0x5203f9)['send'](_0xc2b335);};}exports['index']=function(_0x5a9e78,_0x27d9c4){var _0x34d414={},_0xd36eae={},_0x505fb2={'count':0x0,'rows':[]};var _0x4d177d=_[_0xa59b('0x27')](db[_0xa59b('0x28')][_0xa59b('0x29')],function(_0x4f1c7b){return{'name':_0x4f1c7b['fieldName'],'type':_0x4f1c7b[_0xa59b('0x2a')][_0xa59b('0x2b')]};});_0xd36eae[_0xa59b('0x2c')]=_[_0xa59b('0x2d')](_[_0xa59b('0x27')](_0x4d177d,_0xa59b('0x26')),['format']);_0xd36eae[_0xa59b('0x2e')]=_[_0xa59b('0x2f')](_0x5a9e78[_0xa59b('0x2e')]);_0xd36eae[_0xa59b('0x30')]=_['intersection'](_0xd36eae[_0xa59b('0x2c')],_0xd36eae['query']);_0x34d414[_0xa59b('0x31')]=_['intersection'](_0xd36eae['model'],qs[_0xa59b('0x32')](_0x5a9e78['query'][_0xa59b('0x32')]));_0x34d414[_0xa59b('0x31')]=_0x34d414[_0xa59b('0x31')][_0xa59b('0x33')]?_0x34d414[_0xa59b('0x31')]:_0xd36eae['model'];if(!_0x5a9e78[_0xa59b('0x2e')][_0xa59b('0x34')](_0xa59b('0x35'))){_0x34d414['limit']=qs['limit'](_0x5a9e78[_0xa59b('0x2e')][_0xa59b('0x1c')]);_0x34d414[_0xa59b('0x1a')]=qs[_0xa59b('0x1a')](_0x5a9e78[_0xa59b('0x2e')][_0xa59b('0x1a')]);}_0x34d414['order']=qs['sort'](_0x5a9e78[_0xa59b('0x2e')][_0xa59b('0x36')]);_0x34d414['where']=qs[_0xa59b('0x30')](_[_0xa59b('0x37')](_0x5a9e78[_0xa59b('0x2e')],_0xd36eae[_0xa59b('0x30')]),_0x4d177d);if(_0x5a9e78[_0xa59b('0x2e')][_0xa59b('0x38')]){_0x34d414[_0xa59b('0x39')]=_[_0xa59b('0x3a')](_0x34d414['where'],{'$or':_[_0xa59b('0x27')](_0x4d177d,function(_0x36a006){if(_0x36a006[_0xa59b('0x2a')]!==_0xa59b('0x3b')){var _0x244c35={};_0x244c35[_0x36a006[_0xa59b('0x26')]]={'$like':'%'+_0x5a9e78['query'][_0xa59b('0x38')]+'%'};return _0x244c35;}})});}_0x34d414=_[_0xa59b('0x3a')]({},_0x34d414,_0x5a9e78[_0xa59b('0x3c')]);var _0x5cc213={'where':_0x34d414['where']};return db[_0xa59b('0x28')][_0xa59b('0x3d')](_0x5cc213)['then'](function(_0x97db61){_0x505fb2[_0xa59b('0x3d')]=_0x97db61;if(_0x5a9e78[_0xa59b('0x2e')]['includeAll']){_0x34d414[_0xa59b('0x3e')]=[{'all':!![]}];}return db[_0xa59b('0x28')][_0xa59b('0x3f')](_0x34d414);})[_0xa59b('0x23')](function(_0x5bf9db){_0x505fb2[_0xa59b('0x40')]=_0x5bf9db;return _0x505fb2;})[_0xa59b('0x23')](respondWithFilteredResult(_0x27d9c4,_0x34d414))['catch'](handleError(_0x27d9c4,null));};exports[_0xa59b('0x41')]=function(_0x42d8d2,_0x29df4b){var _0x15ea6d={'raw':![],'where':{'id':_0x42d8d2[_0xa59b('0x42')]['id']}},_0x18c755={};_0x18c755[_0xa59b('0x2c')]=_[_0xa59b('0x2f')](db[_0xa59b('0x28')][_0xa59b('0x29')]);_0x18c755[_0xa59b('0x2e')]=_['keys'](_0x42d8d2[_0xa59b('0x2e')]);_0x18c755[_0xa59b('0x30')]=_['intersection'](_0x18c755['model'],_0x18c755[_0xa59b('0x2e')]);_0x15ea6d[_0xa59b('0x31')]=_[_0xa59b('0x43')](_0x18c755['model'],qs[_0xa59b('0x32')](_0x42d8d2[_0xa59b('0x2e')]['fields']));_0x15ea6d[_0xa59b('0x31')]=_0x15ea6d[_0xa59b('0x31')][_0xa59b('0x33')]?_0x15ea6d[_0xa59b('0x31')]:_0x18c755['model'];if(_0x42d8d2['query'][_0xa59b('0x44')]){_0x15ea6d['include']=[{'all':!![]}];}_0x15ea6d=_[_0xa59b('0x3a')]({},_0x15ea6d,_0x42d8d2[_0xa59b('0x3c')]);return db[_0xa59b('0x28')][_0xa59b('0x45')](_0x15ea6d)[_0xa59b('0x23')](handleEntityNotFound(_0x29df4b,null))[_0xa59b('0x23')](respondWithResult(_0x29df4b,null))['catch'](handleError(_0x29df4b,null));};exports[_0xa59b('0x46')]=function(_0x10f0be,_0x55b990){return db[_0xa59b('0x28')]['create'](_0x10f0be[_0xa59b('0x47')],{})[_0xa59b('0x23')](respondWithResult(_0x55b990,0xc9))[_0xa59b('0x48')](handleError(_0x55b990,null));};exports['update']=function(_0x1f5b20,_0x1ab946){if(_0x1f5b20[_0xa59b('0x47')]['id']){delete _0x1f5b20['body']['id'];}return db['VoiceRecording'][_0xa59b('0x45')]({'where':{'id':_0x1f5b20[_0xa59b('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ab946,null))[_0xa59b('0x23')](saveUpdates(_0x1f5b20['body'],null))[_0xa59b('0x23')](respondWithResult(_0x1ab946,null))[_0xa59b('0x48')](handleError(_0x1ab946,null));};exports[_0xa59b('0x49')]=function(_0x16d6be,_0xb942b4){return db['VoiceRecording'][_0xa59b('0x49')]()[_0xa59b('0x23')](respondWithResult(_0xb942b4,null))[_0xa59b('0x48')](handleError(_0xb942b4,null));};exports['download']=function(_0xf2efd3,_0x4e2bbe,_0x28992a){var _0x2c2a98=require('../../components/encryptor');var _0x8d73bb=![];var _0x5b45fe={};if(_0xf2efd3[_0xa59b('0x2e')][_0xa59b('0x2a')]&&_0xf2efd3[_0xa59b('0x2e')]['type']===_0xa59b('0x4a')){_0x5b45fe['uniqueid']=_0xf2efd3[_0xa59b('0x42')]['id'];}else{_0x5b45fe['id']=_0xf2efd3['params']['id'];}return db['VoiceRecording'][_0xa59b('0x45')]({'where':_0x5b45fe,'attributes':['id','value'],'raw':!![]})[_0xa59b('0x23')](handleEntityNotFound(_0x4e2bbe,null))['then'](function(_0x39e625){if(_0x39e625){var _0x2620ee=_0x39e625[_0xa59b('0x4b')];var _0x3c1b70=util[_0xa59b('0x4c')](_0xa59b('0x4d'),_0x2620ee);if(fs[_0xa59b('0x4e')](_0x3c1b70)){_0x8d73bb=!![];return _0x2c2a98[_0xa59b('0x4f')](_0x3c1b70,_0x2620ee,config['secrets'][_0xa59b('0x50')])[_0xa59b('0x23')](function(){return _0x39e625;});}return _0x39e625;}})[_0xa59b('0x23')](function(_0x3eeec9){if(_0x3eeec9){var _0x5530a1=_0x3eeec9[_0xa59b('0x4b')];if(!fs[_0xa59b('0x4e')](_0x5530a1)){throw new db['Sequelize'][(_0xa59b('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x3eeec9['filename']){return _0x4e2bbe['download'](_0x5530a1,_0x3eeec9['filename']+path['extname'](_0x5530a1),function(){if(_0x8d73bb){fs[_0xa59b('0x52')](_0x5530a1);}});}else{return _0x4e2bbe[_0xa59b('0x53')](_0x5530a1,function(_0x3c9358){if(_0x8d73bb){fs['unlink'](_0x5530a1);}});}}})[_0xa59b('0x48')](function(_0x58a3ac){if(_0x58a3ac[_0xa59b('0x54')]===_0xa59b('0x55')){_0x4e2bbe[_0xa59b('0x18')](0x194)[_0xa59b('0x56')]('Not\x20found');}else{return handleError(_0x4e2bbe,null);}});};exports[_0xa59b('0x57')]=function(_0x4a6d53,_0xdbd441,_0x6dee6e){var _0x538951=require(_0xa59b('0x58'));var _0x3f50ad=![];var _0x85c8cf={'$and':[db[_0xa59b('0x59')]['where'](db[_0xa59b('0x59')]['fn'](_0xa59b('0x5a'),db[_0xa59b('0x59')]['col']('uniqueid')),_0x4a6d53[_0xa59b('0x2e')][_0xa59b('0x5b')])]};if(_0x4a6d53['query'][_0xa59b('0x2a')]&&_0x4a6d53[_0xa59b('0x2e')][_0xa59b('0x2a')]===_0xa59b('0x4a')){_0x85c8cf['$and']['push']({'uniqueid':_0x4a6d53[_0xa59b('0x42')]['id']});}else{_0x85c8cf[_0xa59b('0x5c')][_0xa59b('0x5d')]({'id':_0x4a6d53['params']['id']});}return db['VoiceRecording']['find']({'where':_0x85c8cf,'attributes':['id',_0xa59b('0x4b')],'raw':!![]})[_0xa59b('0x23')](handleEntityNotFound(_0xdbd441,null))[_0xa59b('0x23')](function(_0x26e7dd){if(_0x26e7dd){var _0x16f7aa=util['format'](_0xa59b('0x4d'),_0x26e7dd[_0xa59b('0x4b')]);if(fs['existsSync'](_0x16f7aa)){_0x3f50ad=!![];return _0x538951[_0xa59b('0x4f')](_0x16f7aa,_0x26e7dd['value'],config[_0xa59b('0x5e')][_0xa59b('0x50')])[_0xa59b('0x23')](function(){return _0x26e7dd;});}return _0x26e7dd;}})[_0xa59b('0x23')](function(_0x586e1c){if(_0x586e1c){if(!fs[_0xa59b('0x4e')](_0x586e1c[_0xa59b('0x4b')])){throw new db[(_0xa59b('0x5f'))][(_0xa59b('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x586e1c['filename']){return _0xdbd441[_0xa59b('0x53')](_0x586e1c['value'],_0x586e1c[_0xa59b('0x60')]+path[_0xa59b('0x61')](_0x586e1c[_0xa59b('0x4b')]),function(){if(_0x3f50ad){fs['unlink'](_0x586e1c[_0xa59b('0x4b')]);}});}else{return _0xdbd441['download'](_0x586e1c[_0xa59b('0x4b')],function(_0x3adcb1){if(_0x3f50ad){fs[_0xa59b('0x52')](_0x586e1c[_0xa59b('0x4b')]);}});}}})[_0xa59b('0x48')](handleError(_0xdbd441,null));};exports[_0xa59b('0x62')]=function(_0x25bf07,_0x5e54a8){return db[_0xa59b('0x28')][_0xa59b('0x45')]({'where':{'id':_0x25bf07[_0xa59b('0x42')]['id']}})[_0xa59b('0x23')](function(_0x16fe2a){if(_['isNil'](_0x16fe2a)){throw new ReferenceError(_0xa59b('0x63'));}return _0x16fe2a;})['then'](function(_0x330bc5){var _0x39b264=_0x330bc5[_0xa59b('0x4b')];logger[_0xa59b('0x64')](_0xa59b('0x65'),_0x39b264);if(!_[_0xa59b('0x66')](_0x330bc5[_0xa59b('0x4b')])&&fs[_0xa59b('0x4e')](_0x39b264)){logger[_0xa59b('0x64')](_0xa59b('0x67')+_0x39b264+_0xa59b('0x68'));fs[_0xa59b('0x69')](_0x39b264);}_0x39b264=_0x39b264+_0xa59b('0x6a');if(!_[_0xa59b('0x66')](_0x330bc5[_0xa59b('0x4b')])&&fs[_0xa59b('0x4e')](_0x39b264)){logger[_0xa59b('0x64')](_0xa59b('0x67')+_0x39b264+_0xa59b('0x68'));fs[_0xa59b('0x69')](_0x39b264);}return _0x330bc5;})[_0xa59b('0x23')](function(_0xbb3e37){if(!_0xbb3e37)throw new InternalError();return _0xbb3e37[_0xa59b('0x62')]();})[_0xa59b('0x23')](function(){_0x5e54a8[_0xa59b('0x18')](0xcc)[_0xa59b('0x19')]();})[_0xa59b('0x48')](handleError(_0x5e54a8,null));};function getBucketslist(_0x14f15a,_0x393482,_0x552a73){return new Promise(function(_0x55c358,_0x512122){var _0x1e87ce=new AWS['S3']({'accessKeyId':_0x393482,'secretAccessKey':_0x14f15a,'region':_0x552a73});_0x1e87ce[_0xa59b('0x6b')]({},function(_0x4e7c1e,_0x33e396){if(_0x4e7c1e){return _0x512122(_0x4e7c1e);}else{return _0x55c358(_0x33e396);}});});}function createBucket(_0x245762,_0x377bd3,_0x4f0731,_0x288cb7){return new Promise(function(_0x4fc1b6,_0x1c43a0){var _0x3ac219=new AWS['S3']({'accessKeyId':_0x377bd3,'secretAccessKey':_0x245762,'region':_0x4f0731});_0x3ac219[_0xa59b('0x6c')]({'Bucket':_0x288cb7},function(_0x1a237b,_0x57bb5c){if(_0x1a237b){return _0x1c43a0(_0x1a237b);}else{return _0x4fc1b6(_0x57bb5c);}});});}function uploadFile(_0x2572df,_0x2c27e3,_0x21d48b,_0x5d3e5a,_0x3c021a,_0x211d63){return new Promise(function(_0x2c4554,_0x4a26d6){var _0x2f7184=new AWS['S3']({'accessKeyId':_0x2c27e3,'secretAccessKey':_0x2572df,'region':_0x21d48b});_0x2f7184['upload']({'Bucket':_0x5d3e5a,'Key':_0x3c021a,'Body':_0x211d63},function(_0x431d34,_0x3a23f7){if(_0x431d34){return _0x4a26d6(_0x431d34);}else{return _0x2c4554(_0x3a23f7);}});});}function startTranscribe(_0x1e094c,_0x2faf5e,_0x3f1939,_0x32b979,_0x270a6d,_0x4057cf){return new Promise(function(_0xe3ad1a,_0x5a30b5){var _0x3fbfd2=new AWS[(_0xa59b('0x6d'))]({'accessKeyId':_0x2faf5e,'secretAccessKey':_0x1e094c,'region':_0x3f1939});_0x3fbfd2['startTranscriptionJob']({'TranscriptionJobName':_0x32b979,'LanguageCode':_0x270a6d,'Media':{'MediaFileUri':_0x4057cf}},function(_0x247520,_0x5d0333){if(_0x247520){return _0x5a30b5(_0x247520);}else{return _0xe3ad1a(_0x5d0333);}});});}function transcribe(_0x5b9826,_0x19ba50,_0xadfd9f,_0x4894ec,_0x40c608,_0x3ed35a,_0x23fe12){return new Promise(function(_0x22288a,_0x494d46){var _0x284b79={};logger[_0xa59b('0x64')](util[_0xa59b('0x4c')](_0xa59b('0x6e'),_0x5b9826,_0x40c608));return uploadFile(_0x19ba50,_0xadfd9f,_0x4894ec,_0x40c608,path[_0xa59b('0x6f')](_0x3ed35a),fs[_0xa59b('0x70')](_0x3ed35a))[_0xa59b('0x23')](function(_0x346d7a){logger['info'](util[_0xa59b('0x4c')](_0xa59b('0x71'),_0x5b9826,_0x40c608,_0x346d7a[_0xa59b('0x72')]));_0x284b79[_0xa59b('0x73')]=_0x346d7a[_0xa59b('0x74')];_0x284b79[_0xa59b('0x75')]=_0x346d7a[_0xa59b('0x72')];logger[_0xa59b('0x64')](util['format'](_0xa59b('0x76'),_0x5b9826));return startTranscribe(_0x19ba50,_0xadfd9f,_0x4894ec,uuidv4(),_0x23fe12,_0x346d7a[_0xa59b('0x72')]);})[_0xa59b('0x23')](function(_0x2b49e4){logger[_0xa59b('0x64')](util[_0xa59b('0x4c')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x5b9826,_0x2b49e4[_0xa59b('0x77')][_0xa59b('0x78')]));_0x284b79[_0xa59b('0x79')]=_0x2b49e4[_0xa59b('0x77')]['TranscriptionJobName'];_0x284b79['transcribeStatus']=_0x2b49e4['TranscriptionJob']['TranscriptionJobStatus'];return _0x22288a(_0x284b79);})[_0xa59b('0x48')](function(_0x536f63){return _0x494d46(_0x536f63);});});}exports[_0xa59b('0x7a')]=function(_0x273d25,_0x494131,_0x4c2e2e){var _0x2ade1b;var _0x4e61b5;var _0x1a58f1;var _0x3e71f7=require(_0xa59b('0x58'));return db[_0xa59b('0x28')][_0xa59b('0x7b')]({'where':{'id':_0x273d25['params']['id']}})[_0xa59b('0x23')](function(_0x2469de){if(_0x2469de){var _0x4b4ea3=util[_0xa59b('0x4c')](_0xa59b('0x4d'),_0x2469de[_0xa59b('0x4b')]);if(fs['existsSync'](_0x4b4ea3)){cypher=!![];return _0x3e71f7[_0xa59b('0x4f')](_0x4b4ea3,_0x2469de['value'],config[_0xa59b('0x5e')][_0xa59b('0x50')])[_0xa59b('0x23')](function(){return _0x2469de;});}return _0x2469de;}})['then'](function(_0x32246d){if(!_0x32246d){throw new db[(_0xa59b('0x5f'))][(_0xa59b('0x51'))](_0xa59b('0x7c'));}_0x4e61b5=_0x32246d;return db['Setting'][_0xa59b('0x7b')]({'where':{'id':0x1}});})[_0xa59b('0x23')](handleEntityNotFound(_0x494131,null))[_0xa59b('0x23')](function(_0x4ca324){if(_0x4ca324){_0x2ade1b=_0x4ca324;if(!_0x2ade1b[_0xa59b('0x7d')]||!_0x2ade1b['transcribeAccountId']||!_0x2ade1b[_0xa59b('0x7e')]||!_0x2ade1b[_0xa59b('0x7f')]||!_0x2ade1b[_0xa59b('0x73')]){throw new db['Sequelize'][(_0xa59b('0x51'))](_0xa59b('0x80'));}if(_0x273d25['body'][_0xa59b('0x81')]&&(!_0x2ade1b[_0xa59b('0x82')]||!_0x2ade1b['sentimentAccountId']||!_0x2ade1b['sentimentRegion']||!_0x2ade1b['language']||!_0x2ade1b[_0xa59b('0x73')])){throw new db['Sequelize'][(_0xa59b('0x51'))](_0xa59b('0x83'));}return db[_0xa59b('0x84')]['findOne']({'where':{'id':_0x2ade1b['transcribeAccountId']}});}})[_0xa59b('0x23')](function(_0x14c65d){if(!_0x14c65d){throw new db[(_0xa59b('0x5f'))][(_0xa59b('0x51'))](_0xa59b('0x85'));}if(!_0x14c65d['data1']||!_0x14c65d['data2']){throw new db[(_0xa59b('0x5f'))][(_0xa59b('0x51'))](_0xa59b('0x86'));}_0x1a58f1=_0x14c65d;return getBucketslist(_0x1a58f1[_0xa59b('0x87')],_0x1a58f1[_0xa59b('0x88')],_0x2ade1b[_0xa59b('0x7e')]);})['then'](function(_0x4f17fd){if(_0x4f17fd&&_0x4f17fd['Buckets']){var _0x57e5f8=_[_0xa59b('0x45')](_0x4f17fd[_0xa59b('0x89')],function(_0x3e9a9e){return _0x3e9a9e[_0xa59b('0x8a')]===_0x2ade1b['bucket'];});if(!_0x57e5f8){logger[_0xa59b('0x64')](util[_0xa59b('0x4c')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x273d25['params']['id'],_0x2ade1b[_0xa59b('0x73')]));return createBucket(_0x1a58f1[_0xa59b('0x87')],_0x1a58f1[_0xa59b('0x88')],_0x2ade1b[_0xa59b('0x7e')],_0x2ade1b[_0xa59b('0x73')]);}logger[_0xa59b('0x64')](util[_0xa59b('0x4c')](_0xa59b('0x8b'),_0x273d25[_0xa59b('0x42')]['id'],_0x2ade1b[_0xa59b('0x73')]));return;}})['then'](function(_0x1c2035){if(_0x4e61b5[_0xa59b('0x8c')]===_0xa59b('0x8d')){return transcribe(_0x273d25[_0xa59b('0x42')]['id'],_0x1a58f1[_0xa59b('0x87')],_0x1a58f1[_0xa59b('0x88')],_0x2ade1b[_0xa59b('0x7e')],_0x2ade1b[_0xa59b('0x73')],_0x4e61b5[_0xa59b('0x4b')],_0x2ade1b[_0xa59b('0x7f')]);}else{logger['info'](util['format'](_0xa59b('0x8e'),_0x273d25[_0xa59b('0x42')]['id']));return{'transcribeStatus':_0xa59b('0x8f')};}})[_0xa59b('0x23')](function(_0x317af4){if(_0x317af4){_0x317af4[_0xa59b('0x90')]=_0x273d25['body'][_0xa59b('0x81')];return _0x4e61b5[_0xa59b('0x91')](_0x317af4);}})[_0xa59b('0x23')](respondWithResult(_0x494131,null))[_0xa59b('0x48')](handleError(_0x494131,null));};function writeFile(_0x382dd7,_0x5e2170){return new Promise(function(_0x302b41,_0x2ef3a7){fs[_0xa59b('0x92')](_0x5e2170,_0x382dd7,function(_0x4837ad,_0x37d166){if(_0x4837ad){return _0x2ef3a7(_0x4837ad);}else{return _0x302b41(_0x37d166);}});});}exports[_0xa59b('0x93')]=function(_0x5873fa,_0x450ac8,_0x4c8808){return db[_0xa59b('0x28')][_0xa59b('0x7b')]({'where':{'id':_0x5873fa['params']['id']}})[_0xa59b('0x23')](handleEntityNotFound(_0x450ac8))[_0xa59b('0x23')](function(_0xfda548){if(_0xfda548&&_0xfda548[_0xa59b('0x94')]){var _0x1b72c9=_0xfda548[_0xa59b('0x94')];var _0x56b715=config[_0xa59b('0x95')]+_0xa59b('0x96')+_0xfda548['id']+_0xa59b('0x97');if(fs[_0xa59b('0x4e')](_0x56b715)){return _0x56b715;}return writeFile(_0x1b72c9,_0x56b715)[_0xa59b('0x23')](function(){return _0x56b715;});}else{throw new db[(_0xa59b('0x5f'))][(_0xa59b('0x51'))](_0xa59b('0x98'));}})[_0xa59b('0x23')](function(_0x4b4eca){return _0x450ac8[_0xa59b('0x53')](_0x4b4eca);})[_0xa59b('0x48')](handleError(_0x450ac8));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 35c4033..ea6921e 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 _0xcb03=['voice_recordings','uniqueid','api','path','../../config/environment','exports','define'];(function(_0x46f80f,_0x5a4c76){var _0x177a43=function(_0xb3e099){while(--_0xb3e099){_0x46f80f['push'](_0x46f80f['shift']());}};_0x177a43(++_0x5a4c76);}(_0xcb03,0x19f));var _0x3cb0=function(_0x32b5ff,_0x4584c5){_0x32b5ff=_0x32b5ff-0x0;var _0x5e5c4f=_0xcb03[_0x32b5ff];return _0x5e5c4f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3cb0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cb0('0x1'));var rimraf=require('rimraf');var config=require(_0x3cb0('0x2'));var attributes=require('./voiceRecording.attributes');module[_0x3cb0('0x3')]=function(_0x2c4436,_0x4098fa){return _0x2c4436[_0x3cb0('0x4')]('VoiceRecording',attributes,{'tableName':_0x3cb0('0x5'),'paranoid':![],'indexes':[{'name':_0x3cb0('0x6'),'fields':[_0x3cb0('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb907=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash'];(function(_0x57dedb,_0x1849b7){var _0x88b1bc=function(_0x40c064){while(--_0x40c064){_0x57dedb['push'](_0x57dedb['shift']());}};_0x88b1bc(++_0x1849b7);}(_0xb907,0x158));var _0x7b90=function(_0x435b3d,_0x13fe2e){_0x435b3d=_0x435b3d-0x0;var _0x1b7fe5=_0xb907[_0x435b3d];return _0x1b7fe5;};'use strict';var _=require(_0x7b90('0x0'));var util=require(_0x7b90('0x1'));var logger=require(_0x7b90('0x2'))(_0x7b90('0x3'));var moment=require(_0x7b90('0x4'));var BPromise=require(_0x7b90('0x5'));var rp=require(_0x7b90('0x6'));var fs=require('fs');var path=require(_0x7b90('0x7'));var rimraf=require(_0x7b90('0x8'));var config=require(_0x7b90('0x9'));var attributes=require(_0x7b90('0xa'));module[_0x7b90('0xb')]=function(_0x3ea9e3,_0x160cb0){return _0x3ea9e3[_0x7b90('0xc')]('VoiceRecording',attributes,{'tableName':_0x7b90('0xd'),'paranoid':![],'indexes':[{'name':_0x7b90('0xe'),'fields':[_0x7b90('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 6646a5d..43a2c26 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 _0x524e=['UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','%s.cypher','recording','unlink','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording','update','options','where','attributes','limit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x524e,0x15e));var _0xe524=function(_0x534ba9,_0x495341){_0x534ba9=_0x534ba9-0x0;var _0x297b2f=_0x524e[_0x534ba9];return _0x297b2f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['UpdateVoiceRecording']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')](_0x3a4027['body'],{'raw':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null})['then'](function(_0x7d1f92){logger['info']('UpdateVoiceRecording',_0x3a4027);logger[_0xe524('0x10')](_0xe524('0x1c'),_0x3a4027,JSON[_0xe524('0x12')](_0x7d1f92));_0x11b2a1(_0x7d1f92);})[_0xe524('0x1d')](function(_0x599d5d){logger[_0xe524('0x13')]('UpdateVoiceRecording',_0x599d5d[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb[_0xe524('0x13')](0x1f4,_0x599d5d[_0xe524('0x15')]));});});};exports[_0xe524('0x1e')]=function(_0x4102d9){var _0xfd5965=this;return new Promise(function(_0x2141db,_0x583cc3){var _0x58a896=require(_0xe524('0x1f'));var _0x45abad;return db[_0xe524('0x20')][_0xe524('0x21')]({'attributes':['id',_0xe524('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x52f140){_0x45abad=_0x52f140;return db[_0xe524('0x16')][_0xe524('0x23')](_0x4102d9[_0xe524('0x24')]);})[_0xe524('0xc')](function(_0x25c0a1){if(_0x45abad['callRecordingEncryption']&&fs[_0xe524('0x25')](_0x25c0a1[_0xe524('0x26')])){var _0x4a4e15=util['format'](_0xe524('0x27'),_0x25c0a1[_0xe524('0x26')]);return _0x58a896['encryptFile'](_0x25c0a1[_0xe524('0x26')],_0x4a4e15,config['secrets'][_0xe524('0x28')])['then'](function(){fs[_0xe524('0x29')](_0x25c0a1[_0xe524('0x26')]);logger[_0xe524('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x25c0a1;});}return _0x25c0a1;})[_0xe524('0xc')](function(_0x5238c9){logger[_0xe524('0xd')](_0xe524('0x1e'),_0x4102d9);logger[_0xe524('0x10')]('CreateVoiceRecording',_0x4102d9,JSON[_0xe524('0x12')](_0x5238c9));_0x2141db(_0x5238c9);})[_0xe524('0x1d')](function(_0x49c43e){logger[_0xe524('0x13')](_0xe524('0x1e'),_0x49c43e[_0xe524('0x15')],_0x4102d9);_0x583cc3(_0xfd5965[_0xe524('0x13')](0x1f4,_0x49c43e['message']));});});}; \ No newline at end of file +var _0xdf55=['create','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','info','result','catch','UpdateVoiceRecording','update','options','raw','attributes','limit','debug','stringify','CreateVoiceRecording','findOne','callRecordingEncryption'];(function(_0x5ad3a0,_0x5309d2){var _0x332530=function(_0x477766){while(--_0x477766){_0x5ad3a0['push'](_0x5ad3a0['shift']());}};_0x332530(++_0x5309d2);}(_0xdf55,0x83));var _0x5df5=function(_0x3dbccb,_0x126d36){_0x3dbccb=_0x3dbccb-0x0;var _0x3e90e7=_0xdf55[_0x3dbccb];return _0x3e90e7;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});}exports[_0x5df5('0x16')]=function(_0xb7e1c2){var _0x44f700=this;return new Promise(function(_0x215d59,_0x4b499d){return db['VoiceRecording'][_0x5df5('0x17')](_0xb7e1c2['body'],{'raw':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')]['where']||null:null,'attributes':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1a')]||null:null,'limit':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1b')]||null:null})['then'](function(_0x2e99a1){logger[_0x5df5('0x13')](_0x5df5('0x16'),_0xb7e1c2);logger[_0x5df5('0x1c')]('UpdateVoiceRecording',_0xb7e1c2,JSON[_0x5df5('0x1d')](_0x2e99a1));_0x215d59(_0x2e99a1);})[_0x5df5('0x15')](function(_0x395f3e){logger['error']('UpdateVoiceRecording',_0x395f3e['message'],_0xb7e1c2);_0x4b499d(_0x44f700[_0x5df5('0xf')](0x1f4,_0x395f3e[_0x5df5('0x12')]));});});};exports[_0x5df5('0x1e')]=function(_0xa7f4b3){var _0x1baf52=this;return new Promise(function(_0x1fd83c,_0x210d20){var _0x28723e=require('../../components/encryptor');var _0x18bb61;return db['Setting'][_0x5df5('0x1f')]({'attributes':['id',_0x5df5('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3854d0){_0x18bb61=_0x3854d0;return db['VoiceRecording'][_0x5df5('0x21')](_0xa7f4b3['body']);})[_0x5df5('0xc')](function(_0x4afe36){if(_0x18bb61[_0x5df5('0x20')]&&fs['existsSync'](_0x4afe36[_0x5df5('0x22')])){var _0x47bebb=util[_0x5df5('0x23')]('%s.cypher',_0x4afe36[_0x5df5('0x22')]);return _0x28723e[_0x5df5('0x24')](_0x4afe36[_0x5df5('0x22')],_0x47bebb,config[_0x5df5('0x25')][_0x5df5('0x26')])[_0x5df5('0xc')](function(){fs[_0x5df5('0x27')](_0x4afe36['value']);logger['info'](_0x5df5('0x28'));return _0x4afe36;});}return _0x4afe36;})[_0x5df5('0xc')](function(_0x3bbd2b){logger[_0x5df5('0x13')](_0x5df5('0x1e'),_0xa7f4b3);logger[_0x5df5('0x1c')]('CreateVoiceRecording',_0xa7f4b3,JSON[_0x5df5('0x1d')](_0x3bbd2b));_0x1fd83c(_0x3bbd2b);})[_0x5df5('0x15')](function(_0x2f1001){logger[_0x5df5('0xf')]('CreateVoiceRecording',_0x2f1001[_0x5df5('0x12')],_0xa7f4b3);_0x210d20(_0x1baf52['error'](0x1f4,_0x2f1001[_0x5df5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9b6ea3b..9ae4649 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 _0x9c8d=['describe','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x161d5c,_0x1ed618){var _0x5bf5c4=function(_0x15ae70){while(--_0x15ae70){_0x161d5c['push'](_0x161d5c['shift']());}};_0x5bf5c4(++_0x1ed618);}(_0x9c8d,0x194));var _0xd9c8=function(_0x4148c2,_0x1be0b1){_0x4148c2=_0x4148c2-0x0;var _0x4dd7e8=_0x9c8d[_0x4148c2];return _0x4dd7e8;};'use strict';var multer=require(_0xd9c8('0x0'));var util=require(_0xd9c8('0x1'));var path=require(_0xd9c8('0x2'));var timeout=require(_0xd9c8('0x3'));var express=require('express');var router=express[_0xd9c8('0x4')]();var fs_extra=require(_0xd9c8('0x5'));var auth=require(_0xd9c8('0x6'));var interaction=require(_0xd9c8('0x7'));var config=require(_0xd9c8('0x8'));var controller=require(_0xd9c8('0x9'));router[_0xd9c8('0xa')]('/',auth['isAuthenticated'](),controller[_0xd9c8('0xb')]);router['get'](_0xd9c8('0xc'),auth[_0xd9c8('0xd')](),controller[_0xd9c8('0xe')]);router[_0xd9c8('0xa')]('/:id',auth[_0xd9c8('0xd')](),controller[_0xd9c8('0xf')]);router[_0xd9c8('0x10')]('/',auth[_0xd9c8('0xd')](),controller['create']);router[_0xd9c8('0x11')](_0xd9c8('0x12'),auth['isAuthenticated'](),controller[_0xd9c8('0x13')]);router[_0xd9c8('0x14')](_0xd9c8('0x12'),auth[_0xd9c8('0xd')](),controller['destroy']);module[_0xd9c8('0x15')]=router; \ No newline at end of file +var _0x3449=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','multer','util'];(function(_0x940c36,_0x2c7978){var _0x435f13=function(_0x4c6b8e){while(--_0x4c6b8e){_0x940c36['push'](_0x940c36['shift']());}};_0x435f13(++_0x2c7978);}(_0x3449,0x13e));var _0x9344=function(_0x5d6127,_0x7ece83){_0x5d6127=_0x5d6127-0x0;var _0x282bbe=_0x3449[_0x5d6127];return _0x282bbe;};'use strict';var multer=require(_0x9344('0x0'));var util=require(_0x9344('0x1'));var path=require(_0x9344('0x2'));var timeout=require(_0x9344('0x3'));var express=require('express');var router=express[_0x9344('0x4')]();var fs_extra=require(_0x9344('0x5'));var auth=require(_0x9344('0x6'));var interaction=require(_0x9344('0x7'));var config=require(_0x9344('0x8'));var controller=require(_0x9344('0x9'));router[_0x9344('0xa')]('/',auth[_0x9344('0xb')](),controller['index']);router[_0x9344('0xa')]('/describe',auth[_0x9344('0xb')](),controller[_0x9344('0xc')]);router[_0x9344('0xa')](_0x9344('0xd'),auth['isAuthenticated'](),controller[_0x9344('0xe')]);router[_0x9344('0xf')]('/',auth[_0x9344('0xb')](),controller['create']);router[_0x9344('0x10')](_0x9344('0xd'),auth['isAuthenticated'](),controller[_0x9344('0x11')]);router['delete'](_0x9344('0xd'),auth['isAuthenticated'](),controller[_0x9344('0x12')]);module[_0x9344('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 4773e89..73eb79e 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 _0x9a92=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x2fb68e,_0x179697){var _0x4b33ef=function(_0x421103){while(--_0x421103){_0x2fb68e['push'](_0x2fb68e['shift']());}};_0x4b33ef(++_0x179697);}(_0x9a92,0x196));var _0x29a9=function(_0x3af922,_0x449d6f){_0x3af922=_0x3af922-0x0;var _0x5b88e0=_0x9a92[_0x3af922];return _0x5b88e0;};'use strict';var Sequelize=require(_0x29a9('0x0'));var moment=require(_0x29a9('0x1'));module[_0x29a9('0x2')]={'type':{'type':Sequelize[_0x29a9('0x3')](_0x29a9('0x4'),_0x29a9('0x5'))},'result':{'type':Sequelize[_0x29a9('0x6')]},'transfererchannel':{'type':Sequelize[_0x29a9('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x29a9('0x6')]},'transferercalleridname':{'type':Sequelize[_0x29a9('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x29a9('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x29a9('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x29a9('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x29a9('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x29a9('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x29a9('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x29a9('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x29a9('0x6')]},'transfereecontext':{'type':Sequelize[_0x29a9('0x6')]},'transfereeexten':{'type':Sequelize[_0x29a9('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x29a9('0x6')]},'isexternal':{'type':Sequelize[_0x29a9('0x3')](_0x29a9('0x7'),'No')},'context':{'type':Sequelize[_0x29a9('0x6')]},'extension':{'type':Sequelize[_0x29a9('0x6')]}}; \ No newline at end of file +var _0xb88c=['moment','ENUM','blind','attended','STRING'];(function(_0x54b907,_0x29ff96){var _0x363d89=function(_0x184d8f){while(--_0x184d8f){_0x54b907['push'](_0x54b907['shift']());}};_0x363d89(++_0x29ff96);}(_0xb88c,0xcd));var _0xcb88=function(_0x18849b,_0x530b07){_0x18849b=_0x18849b-0x0;var _0x23b2df=_0xb88c[_0x18849b];return _0x23b2df;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcb88('0x0'));module['exports']={'type':{'type':Sequelize[_0xcb88('0x1')](_0xcb88('0x2'),_0xcb88('0x3'))},'result':{'type':Sequelize[_0xcb88('0x4')]},'transfererchannel':{'type':Sequelize[_0xcb88('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xcb88('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xcb88('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xcb88('0x4')]},'transferercontext':{'type':Sequelize[_0xcb88('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xcb88('0x4')]},'transfereechannel':{'type':Sequelize[_0xcb88('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xcb88('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xcb88('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xcb88('0x1')]('Yes','No')},'context':{'type':Sequelize[_0xcb88('0x4')]},'extension':{'type':Sequelize[_0xcb88('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b90c833..519eb98 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 _0x6283=['VoiceTransferReport','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','error','index'];(function(_0x1ea37f,_0x3fa0d5){var _0x43c566=function(_0x2ab9ec){while(--_0x2ab9ec){_0x1ea37f['push'](_0x1ea37f['shift']());}};_0x43c566(++_0x3fa0d5);}(_0x6283,0x199));var _0x3628=function(_0x4c4da0,_0x3f2083){_0x4c4da0=_0x4c4da0-0x0;var _0x257623=_0x6283[_0x4c4da0];return _0x257623;};'use strict';var emlformat=require(_0x3628('0x0'));var rimraf=require(_0x3628('0x1'));var zipdir=require(_0x3628('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3628('0x3'));var moment=require(_0x3628('0x4'));var BPromise=require(_0x3628('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3628('0x6'));var sox=require('sox');var csv=require(_0x3628('0x7'));var ejs=require(_0x3628('0x8'));var fs=require('fs');var fs_extra=require(_0x3628('0x9'));var _=require(_0x3628('0xa'));var squel=require(_0x3628('0xb'));var crypto=require(_0x3628('0xc'));var jsforce=require(_0x3628('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3628('0xe'));var Papa=require(_0x3628('0xf'));var Redis=require(_0x3628('0x10'));var authService=require(_0x3628('0x11'));var qs=require(_0x3628('0x12'));var as=require(_0x3628('0x13'));var hardwareService=require(_0x3628('0x14'));var logger=require(_0x3628('0x15'))('api');var utils=require(_0x3628('0x16'));var config=require(_0x3628('0x17'));var licenseUtil=require(_0x3628('0x18'));var db=require(_0x3628('0x19'))['db'];function respondWithStatusCode(_0x4e7830,_0x41ee20){_0x41ee20=_0x41ee20||0xcc;return function(_0x5d19ba){if(_0x5d19ba){return _0x4e7830['sendStatus'](_0x41ee20);}return _0x4e7830[_0x3628('0x1a')](_0x41ee20)[_0x3628('0x1b')]();};}function respondWithResult(_0x5230ab,_0x15d1a7){_0x15d1a7=_0x15d1a7||0xc8;return function(_0x381b28){if(_0x381b28){return _0x5230ab[_0x3628('0x1a')](_0x15d1a7)['json'](_0x381b28);}};}function respondWithFilteredResult(_0x8b170c,_0x4ed733){return function(_0x432fe4){if(_0x432fe4){var _0x1ef8db=typeof _0x4ed733['offset']===_0x3628('0x1c')&&typeof _0x4ed733[_0x3628('0x1d')]===_0x3628('0x1c');var _0x9ae3e1=_0x432fe4[_0x3628('0x1e')];var _0x339813=_0x1ef8db?0x0:_0x4ed733[_0x3628('0x1f')];var _0x3de6f6=_0x1ef8db?_0x432fe4['count']:_0x4ed733[_0x3628('0x1f')]+_0x4ed733[_0x3628('0x1d')];var _0x5cda8a;if(_0x3de6f6>=_0x9ae3e1){_0x3de6f6=_0x9ae3e1;_0x5cda8a=0xc8;}else{_0x5cda8a=0xce;}_0x8b170c['status'](_0x5cda8a);return _0x8b170c[_0x3628('0x20')](_0x3628('0x21'),_0x339813+'-'+_0x3de6f6+'/'+_0x9ae3e1)['json'](_0x432fe4);}return null;};}function patchUpdates(_0x5d0db9){return function(_0x39b592){try{jsonpatch[_0x3628('0x22')](_0x39b592,_0x5d0db9,!![]);}catch(_0x1ca03e){return BPromise[_0x3628('0x23')](_0x1ca03e);}return _0x39b592[_0x3628('0x24')]();};}function saveUpdates(_0x4eec74,_0x3e9f70){return function(_0x52056c){if(_0x52056c){return _0x52056c['update'](_0x4eec74)['then'](function(_0xddd1f){return _0xddd1f;});}return null;};}function removeEntity(_0x17c613,_0x9292dc){return function(_0x2d843b){if(_0x2d843b){return _0x2d843b[_0x3628('0x25')]()['then'](function(){_0x17c613[_0x3628('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43f8c5,_0x5cef3f){return function(_0x269c2e){if(!_0x269c2e){_0x43f8c5[_0x3628('0x26')](0x194);}return _0x269c2e;};}function handleError(_0x2e40b3,_0x470c5c){_0x470c5c=_0x470c5c||0x1f4;return function(_0x2a5fb9){logger[_0x3628('0x27')](_0x2a5fb9['stack']);if(_0x2a5fb9['name']){delete _0x2a5fb9['name'];}_0x2e40b3[_0x3628('0x1a')](_0x470c5c)['send'](_0x2a5fb9);};}exports[_0x3628('0x28')]=function(_0x36a31a,_0x136e3d){var _0x1bdb00={},_0x156f64={},_0x437a69={'count':0x0,'rows':[]};var _0x12b9f8=_['map'](db[_0x3628('0x29')]['rawAttributes'],function(_0x17571a){return{'name':_0x17571a[_0x3628('0x2a')],'type':_0x17571a[_0x3628('0x2b')][_0x3628('0x2c')]};});_0x156f64[_0x3628('0x2d')]=_[_0x3628('0x2e')](_0x12b9f8,_0x3628('0x2f'));_0x156f64[_0x3628('0x30')]=_[_0x3628('0x31')](_0x36a31a[_0x3628('0x30')]);_0x156f64[_0x3628('0x32')]=_[_0x3628('0x33')](_0x156f64[_0x3628('0x2d')],_0x156f64[_0x3628('0x30')]);_0x1bdb00['attributes']=_[_0x3628('0x33')](_0x156f64[_0x3628('0x2d')],qs[_0x3628('0x34')](_0x36a31a[_0x3628('0x30')]['fields']));_0x1bdb00[_0x3628('0x35')]=_0x1bdb00['attributes'][_0x3628('0x36')]?_0x1bdb00[_0x3628('0x35')]:_0x156f64[_0x3628('0x2d')];if(!_0x36a31a['query'][_0x3628('0x37')](_0x3628('0x38'))){_0x1bdb00[_0x3628('0x1d')]=qs['limit'](_0x36a31a[_0x3628('0x30')][_0x3628('0x1d')]);_0x1bdb00[_0x3628('0x1f')]=qs[_0x3628('0x1f')](_0x36a31a[_0x3628('0x30')]['offset']);}_0x1bdb00['order']=qs[_0x3628('0x39')](_0x36a31a[_0x3628('0x30')][_0x3628('0x39')]);_0x1bdb00[_0x3628('0x3a')]=qs[_0x3628('0x32')](_[_0x3628('0x3b')](_0x36a31a['query'],_0x156f64['filters']),_0x12b9f8);if(_0x36a31a['query'][_0x3628('0x3c')]){_0x1bdb00[_0x3628('0x3a')]=_[_0x3628('0x3d')](_0x1bdb00[_0x3628('0x3a')],{'$or':_[_0x3628('0x2e')](_0x12b9f8,function(_0x1050e4){if(_0x1050e4[_0x3628('0x2b')]!=='VIRTUAL'){var _0x45cf2d={};_0x45cf2d[_0x1050e4['name']]={'$like':'%'+_0x36a31a[_0x3628('0x30')][_0x3628('0x3c')]+'%'};return _0x45cf2d;}})});}_0x1bdb00=_['merge']({},_0x1bdb00,_0x36a31a[_0x3628('0x3e')]);var _0x39db39={'where':_0x1bdb00[_0x3628('0x3a')]};return db[_0x3628('0x29')][_0x3628('0x1e')](_0x39db39)[_0x3628('0x3f')](function(_0x168507){_0x437a69[_0x3628('0x1e')]=_0x168507;if(_0x36a31a['query'][_0x3628('0x40')]){_0x1bdb00[_0x3628('0x41')]=[{'all':!![]}];}return db[_0x3628('0x29')][_0x3628('0x42')](_0x1bdb00);})[_0x3628('0x3f')](function(_0x16c48e){_0x437a69[_0x3628('0x43')]=_0x16c48e;return _0x437a69;})[_0x3628('0x3f')](respondWithFilteredResult(_0x136e3d,_0x1bdb00))[_0x3628('0x44')](handleError(_0x136e3d,null));};exports[_0x3628('0x45')]=function(_0x5d17b5,_0x3c4128){var _0x28916b={'raw':!![],'where':{'id':_0x5d17b5[_0x3628('0x46')]['id']}},_0x495931={};_0x495931['model']=_[_0x3628('0x31')](db['VoiceTransferReport']['rawAttributes']);_0x495931[_0x3628('0x30')]=_[_0x3628('0x31')](_0x5d17b5[_0x3628('0x30')]);_0x495931['filters']=_[_0x3628('0x33')](_0x495931['model'],_0x495931[_0x3628('0x30')]);_0x28916b[_0x3628('0x35')]=_[_0x3628('0x33')](_0x495931[_0x3628('0x2d')],qs[_0x3628('0x34')](_0x5d17b5[_0x3628('0x30')][_0x3628('0x34')]));_0x28916b[_0x3628('0x35')]=_0x28916b[_0x3628('0x35')][_0x3628('0x36')]?_0x28916b[_0x3628('0x35')]:_0x495931['model'];if(_0x5d17b5['query'][_0x3628('0x40')]){_0x28916b[_0x3628('0x41')]=[{'all':!![]}];}_0x28916b=_['merge']({},_0x28916b,_0x5d17b5['options']);return db[_0x3628('0x29')][_0x3628('0x47')](_0x28916b)['then'](handleEntityNotFound(_0x3c4128,null))[_0x3628('0x3f')](respondWithResult(_0x3c4128,null))['catch'](handleError(_0x3c4128,null));};exports['create']=function(_0x56d32d,_0xb8db1){return db[_0x3628('0x29')][_0x3628('0x48')](_0x56d32d['body'],{})[_0x3628('0x3f')](respondWithResult(_0xb8db1,0xc9))['catch'](handleError(_0xb8db1,null));};exports['update']=function(_0x52c7f5,_0x36953b){if(_0x52c7f5[_0x3628('0x49')]['id']){delete _0x52c7f5[_0x3628('0x49')]['id'];}return db[_0x3628('0x29')][_0x3628('0x47')]({'where':{'id':_0x52c7f5['params']['id']}})[_0x3628('0x3f')](handleEntityNotFound(_0x36953b,null))[_0x3628('0x3f')](saveUpdates(_0x52c7f5[_0x3628('0x49')],null))['then'](respondWithResult(_0x36953b,null))[_0x3628('0x44')](handleError(_0x36953b,null));};exports[_0x3628('0x25')]=function(_0x1e1e81,_0x2cd4f9){return db[_0x3628('0x29')]['find']({'where':{'id':_0x1e1e81[_0x3628('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cd4f9,null))[_0x3628('0x3f')](removeEntity(_0x2cd4f9,null))[_0x3628('0x44')](handleError(_0x2cd4f9,null));};exports[_0x3628('0x4a')]=function(_0x224f03,_0x3f41ca){return db[_0x3628('0x29')][_0x3628('0x4a')]()[_0x3628('0x3f')](respondWithResult(_0x3f41ca,null))[_0x3628('0x44')](handleError(_0x3f41ca,null));}; \ No newline at end of file +var _0x0114=['options','VoiceTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','name','index','map','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x0114,0xe9));var _0x4011=function(_0x4072ad,_0x12b8b2){_0x4072ad=_0x4072ad-0x0;var _0x4bd860=_0x0114[_0x4072ad];return _0x4bd860;};'use strict';var emlformat=require(_0x4011('0x0'));var rimraf=require(_0x4011('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4011('0x2'));var rp=require(_0x4011('0x3'));var moment=require(_0x4011('0x4'));var BPromise=require(_0x4011('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4011('0x6'));var sox=require(_0x4011('0x7'));var csv=require(_0x4011('0x8'));var ejs=require(_0x4011('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4011('0xa'));var squel=require('squel');var crypto=require(_0x4011('0xb'));var jsforce=require(_0x4011('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4011('0x8'));var querystring=require(_0x4011('0xd'));var Papa=require('papaparse');var Redis=require(_0x4011('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4011('0xf'));var hardwareService=require(_0x4011('0x10'));var logger=require('../../config/logger')(_0x4011('0x11'));var utils=require(_0x4011('0x12'));var config=require(_0x4011('0x13'));var licenseUtil=require(_0x4011('0x14'));var db=require(_0x4011('0x15'))['db'];function respondWithStatusCode(_0x24acf2,_0x3f60a6){_0x3f60a6=_0x3f60a6||0xcc;return function(_0x44b602){if(_0x44b602){return _0x24acf2[_0x4011('0x16')](_0x3f60a6);}return _0x24acf2[_0x4011('0x17')](_0x3f60a6)[_0x4011('0x18')]();};}function respondWithResult(_0x31b44f,_0xd00b05){_0xd00b05=_0xd00b05||0xc8;return function(_0x45a4d3){if(_0x45a4d3){return _0x31b44f[_0x4011('0x17')](_0xd00b05)[_0x4011('0x19')](_0x45a4d3);}};}function respondWithFilteredResult(_0xa06e3f,_0x271f24){return function(_0x5dcdec){if(_0x5dcdec){var _0x31534a=typeof _0x271f24[_0x4011('0x1a')]==='undefined'&&typeof _0x271f24[_0x4011('0x1b')]===_0x4011('0x1c');var _0x4a1863=_0x5dcdec[_0x4011('0x1d')];var _0x24efb6=_0x31534a?0x0:_0x271f24[_0x4011('0x1a')];var _0x209077=_0x31534a?_0x5dcdec[_0x4011('0x1d')]:_0x271f24[_0x4011('0x1a')]+_0x271f24['limit'];var _0x3b180b;if(_0x209077>=_0x4a1863){_0x209077=_0x4a1863;_0x3b180b=0xc8;}else{_0x3b180b=0xce;}_0xa06e3f['status'](_0x3b180b);return _0xa06e3f[_0x4011('0x1e')](_0x4011('0x1f'),_0x24efb6+'-'+_0x209077+'/'+_0x4a1863)['json'](_0x5dcdec);}return null;};}function patchUpdates(_0x29a3c3){return function(_0xd96ba7){try{jsonpatch[_0x4011('0x20')](_0xd96ba7,_0x29a3c3,!![]);}catch(_0x4d1b6d){return BPromise[_0x4011('0x21')](_0x4d1b6d);}return _0xd96ba7[_0x4011('0x22')]();};}function saveUpdates(_0x220d94,_0x2ad41e){return function(_0x3bfea5){if(_0x3bfea5){return _0x3bfea5[_0x4011('0x23')](_0x220d94)['then'](function(_0xd02ac7){return _0xd02ac7;});}return null;};}function removeEntity(_0xd0de2c,_0x2a9aa6){return function(_0x12eb04){if(_0x12eb04){return _0x12eb04[_0x4011('0x24')]()[_0x4011('0x25')](function(){_0xd0de2c[_0x4011('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5915ee,_0x14f7df){return function(_0x2d7284){if(!_0x2d7284){_0x5915ee[_0x4011('0x16')](0x194);}return _0x2d7284;};}function handleError(_0x19690f,_0x5dfd6d){_0x5dfd6d=_0x5dfd6d||0x1f4;return function(_0xf01e56){logger['error'](_0xf01e56['stack']);if(_0xf01e56[_0x4011('0x26')]){delete _0xf01e56[_0x4011('0x26')];}_0x19690f[_0x4011('0x17')](_0x5dfd6d)['send'](_0xf01e56);};}exports[_0x4011('0x27')]=function(_0x5616ed,_0x2dea49){var _0x381b6d={},_0x4eb5d5={},_0x16ed04={'count':0x0,'rows':[]};var _0x4f2c06=_[_0x4011('0x28')](db['VoiceTransferReport']['rawAttributes'],function(_0x4e0566){return{'name':_0x4e0566['fieldName'],'type':_0x4e0566[_0x4011('0x29')][_0x4011('0x2a')]};});_0x4eb5d5['model']=_['map'](_0x4f2c06,_0x4011('0x26'));_0x4eb5d5['query']=_[_0x4011('0x2b')](_0x5616ed[_0x4011('0x2c')]);_0x4eb5d5['filters']=_[_0x4011('0x2d')](_0x4eb5d5[_0x4011('0x2e')],_0x4eb5d5[_0x4011('0x2c')]);_0x381b6d[_0x4011('0x2f')]=_['intersection'](_0x4eb5d5[_0x4011('0x2e')],qs[_0x4011('0x30')](_0x5616ed[_0x4011('0x2c')]['fields']));_0x381b6d['attributes']=_0x381b6d[_0x4011('0x2f')][_0x4011('0x31')]?_0x381b6d[_0x4011('0x2f')]:_0x4eb5d5[_0x4011('0x2e')];if(!_0x5616ed[_0x4011('0x2c')][_0x4011('0x32')](_0x4011('0x33'))){_0x381b6d[_0x4011('0x1b')]=qs[_0x4011('0x1b')](_0x5616ed[_0x4011('0x2c')][_0x4011('0x1b')]);_0x381b6d[_0x4011('0x1a')]=qs[_0x4011('0x1a')](_0x5616ed[_0x4011('0x2c')][_0x4011('0x1a')]);}_0x381b6d['order']=qs[_0x4011('0x34')](_0x5616ed[_0x4011('0x2c')][_0x4011('0x34')]);_0x381b6d[_0x4011('0x35')]=qs[_0x4011('0x36')](_[_0x4011('0x37')](_0x5616ed[_0x4011('0x2c')],_0x4eb5d5[_0x4011('0x36')]),_0x4f2c06);if(_0x5616ed['query'][_0x4011('0x38')]){_0x381b6d['where']=_[_0x4011('0x39')](_0x381b6d[_0x4011('0x35')],{'$or':_[_0x4011('0x28')](_0x4f2c06,function(_0x11b143){if(_0x11b143[_0x4011('0x29')]!==_0x4011('0x3a')){var _0x23beb9={};_0x23beb9[_0x11b143[_0x4011('0x26')]]={'$like':'%'+_0x5616ed[_0x4011('0x2c')][_0x4011('0x38')]+'%'};return _0x23beb9;}})});}_0x381b6d=_[_0x4011('0x39')]({},_0x381b6d,_0x5616ed[_0x4011('0x3b')]);var _0x535ca6={'where':_0x381b6d[_0x4011('0x35')]};return db[_0x4011('0x3c')][_0x4011('0x1d')](_0x535ca6)[_0x4011('0x25')](function(_0x18296c){_0x16ed04['count']=_0x18296c;if(_0x5616ed[_0x4011('0x2c')][_0x4011('0x3d')]){_0x381b6d[_0x4011('0x3e')]=[{'all':!![]}];}return db[_0x4011('0x3c')][_0x4011('0x3f')](_0x381b6d);})[_0x4011('0x25')](function(_0x4c4d89){_0x16ed04[_0x4011('0x40')]=_0x4c4d89;return _0x16ed04;})[_0x4011('0x25')](respondWithFilteredResult(_0x2dea49,_0x381b6d))[_0x4011('0x41')](handleError(_0x2dea49,null));};exports[_0x4011('0x42')]=function(_0x46eb56,_0x4cde08){var _0x49777f={'raw':!![],'where':{'id':_0x46eb56[_0x4011('0x43')]['id']}},_0x466f18={};_0x466f18[_0x4011('0x2e')]=_[_0x4011('0x2b')](db[_0x4011('0x3c')][_0x4011('0x44')]);_0x466f18[_0x4011('0x2c')]=_[_0x4011('0x2b')](_0x46eb56[_0x4011('0x2c')]);_0x466f18[_0x4011('0x36')]=_[_0x4011('0x2d')](_0x466f18[_0x4011('0x2e')],_0x466f18[_0x4011('0x2c')]);_0x49777f[_0x4011('0x2f')]=_[_0x4011('0x2d')](_0x466f18['model'],qs[_0x4011('0x30')](_0x46eb56[_0x4011('0x2c')]['fields']));_0x49777f[_0x4011('0x2f')]=_0x49777f[_0x4011('0x2f')]['length']?_0x49777f[_0x4011('0x2f')]:_0x466f18[_0x4011('0x2e')];if(_0x46eb56[_0x4011('0x2c')][_0x4011('0x3d')]){_0x49777f[_0x4011('0x3e')]=[{'all':!![]}];}_0x49777f=_[_0x4011('0x39')]({},_0x49777f,_0x46eb56['options']);return db['VoiceTransferReport']['find'](_0x49777f)[_0x4011('0x25')](handleEntityNotFound(_0x4cde08,null))['then'](respondWithResult(_0x4cde08,null))['catch'](handleError(_0x4cde08,null));};exports['create']=function(_0x4b249b,_0xf43529){return db[_0x4011('0x3c')][_0x4011('0x45')](_0x4b249b[_0x4011('0x46')],{})[_0x4011('0x25')](respondWithResult(_0xf43529,0xc9))['catch'](handleError(_0xf43529,null));};exports['update']=function(_0x3f6f20,_0x2be7ef){if(_0x3f6f20['body']['id']){delete _0x3f6f20[_0x4011('0x46')]['id'];}return db[_0x4011('0x3c')][_0x4011('0x47')]({'where':{'id':_0x3f6f20[_0x4011('0x43')]['id']}})['then'](handleEntityNotFound(_0x2be7ef,null))[_0x4011('0x25')](saveUpdates(_0x3f6f20[_0x4011('0x46')],null))[_0x4011('0x25')](respondWithResult(_0x2be7ef,null))[_0x4011('0x41')](handleError(_0x2be7ef,null));};exports[_0x4011('0x24')]=function(_0x789c6a,_0x10147d){return db[_0x4011('0x3c')]['find']({'where':{'id':_0x789c6a[_0x4011('0x43')]['id']}})[_0x4011('0x25')](handleEntityNotFound(_0x10147d,null))[_0x4011('0x25')](removeEntity(_0x10147d,null))['catch'](handleError(_0x10147d,null));};exports[_0x4011('0x48')]=function(_0x282c1f,_0x13fbaf){return db[_0x4011('0x3c')][_0x4011('0x48')]()[_0x4011('0x25')](respondWithResult(_0x13fbaf,null))[_0x4011('0x41')](handleError(_0x13fbaf,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index ca7660f..d8438c5 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 _0xa805=['exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0xc325bf,_0x14971c){var _0x341a4c=function(_0x316b6d){while(--_0x316b6d){_0xc325bf['push'](_0xc325bf['shift']());}};_0x341a4c(++_0x14971c);}(_0xa805,0x156));var _0x5a80=function(_0x330387,_0x41f0ac){_0x330387=_0x330387-0x0;var _0x2b1a84=_0xa805[_0x330387];return _0x2b1a84;};'use strict';var _=require(_0x5a80('0x0'));var util=require(_0x5a80('0x1'));var logger=require(_0x5a80('0x2'))('api');var moment=require(_0x5a80('0x3'));var BPromise=require(_0x5a80('0x4'));var rp=require(_0x5a80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a80('0x6'));var config=require(_0x5a80('0x7'));var attributes=require(_0x5a80('0x8'));module[_0x5a80('0x9')]=function(_0x176a53,_0x4d818a){return _0x176a53[_0x5a80('0xa')](_0x5a80('0xb'),attributes,{'tableName':_0x5a80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd331=['api','moment','bluebird','request-promise','../../config/environment','./voiceTransferReport.attributes','exports','report_call_transfer','lodash','../../config/logger'];(function(_0x59033b,_0x482dba){var _0x2ff17e=function(_0x3e11f0){while(--_0x3e11f0){_0x59033b['push'](_0x59033b['shift']());}};_0x2ff17e(++_0x482dba);}(_0xd331,0x1de));var _0x1d33=function(_0x4ece92,_0x4f9a45){_0x4ece92=_0x4ece92-0x0;var _0x51edb2=_0xd331[_0x4ece92];return _0x51edb2;};'use strict';var _=require(_0x1d33('0x0'));var util=require('util');var logger=require(_0x1d33('0x1'))(_0x1d33('0x2'));var moment=require(_0x1d33('0x3'));var BPromise=require(_0x1d33('0x4'));var rp=require(_0x1d33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1d33('0x6'));var attributes=require(_0x1d33('0x7'));module[_0x1d33('0x8')]=function(_0x7d78af,_0x1b97c6){return _0x7d78af['define']('VoiceTransferReport',attributes,{'tableName':_0x1d33('0x9'),'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 dcf866a..a4bfb5f 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 _0x18ed=['catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x18ed,0xd7));var _0xd18e=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x18ed[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0xd18e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd18e('0x1'));var fs=require('fs');var Redis=require(_0xd18e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd18e('0x3'))(_0xd18e('0x4'));var config=require('../../config/environment');var jayson=require(_0xd18e('0x5'));var client=jayson[_0xd18e('0x6')][_0xd18e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40a572,_0xcdb961,_0x59a8ba){return new BPromise(function(_0x513c48,_0x3613d0){return client[_0xd18e('0x8')](_0x40a572,_0x59a8ba)[_0xd18e('0x9')](function(_0x3738e4){logger['info'](_0xd18e('0xa'),_0xcdb961,_0xd18e('0xb'));logger[_0xd18e('0xc')](_0xd18e('0xd'),_0xcdb961,'request\x20sent',JSON[_0xd18e('0xe')](_0x3738e4));if(_0x3738e4[_0xd18e('0xf')]){if(_0x3738e4[_0xd18e('0xf')]['code']===0x1f4){logger[_0xd18e('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0xcdb961,_0x3738e4[_0xd18e('0xf')][_0xd18e('0x10')]);return _0x3613d0(_0x3738e4[_0xd18e('0xf')]['message']);}logger[_0xd18e('0xf')](_0xd18e('0xa'),_0xcdb961,_0x3738e4[_0xd18e('0xf')]['message']);return _0x513c48(_0x3738e4['error'][_0xd18e('0x10')]);}else{logger[_0xd18e('0x11')](_0xd18e('0xa'),_0xcdb961,_0xd18e('0xb'));_0x513c48(_0x3738e4[_0xd18e('0x12')][_0xd18e('0x10')]);}})[_0xd18e('0x13')](function(_0x427cd9){logger['error'](_0xd18e('0xa'),_0xcdb961,_0x427cd9);_0x3613d0(_0x427cd9);});});}exports[_0xd18e('0x14')]=function(_0x2f96d3){var _0x5d35b9=this;return new Promise(function(_0x4d3e1d,_0x58182c){return db[_0xd18e('0x15')][_0xd18e('0x16')](_0x2f96d3[_0xd18e('0x17')],{'raw':_0x2f96d3[_0xd18e('0x18')]?_0x2f96d3[_0xd18e('0x18')][_0xd18e('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1dbbef){logger['info']('CreateVoiceTransferReport',_0x2f96d3);logger[_0xd18e('0xc')](_0xd18e('0x14'),_0x2f96d3,JSON[_0xd18e('0xe')](_0x1dbbef));_0x4d3e1d(_0x1dbbef);})['catch'](function(_0x53105f){logger[_0xd18e('0xf')](_0xd18e('0x14'),_0x53105f['message'],_0x2f96d3);_0x58182c(_0x5d35b9['error'](0x1f4,_0x53105f['message']));});});}; \ No newline at end of file +var _0x35a8=['jayson/promise','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3fc1d3,_0x3cd8d0){var _0x1d4dd8=function(_0x4a71e4){while(--_0x4a71e4){_0x3fc1d3['push'](_0x3fc1d3['shift']());}};_0x1d4dd8(++_0x3cd8d0);}(_0x35a8,0xde));var _0x835a=function(_0x32f044,_0x2db3b8){_0x32f044=_0x32f044-0x0;var _0x10ab05=_0x35a8[_0x32f044];return _0x10ab05;};'use strict';var _=require(_0x835a('0x0'));var util=require(_0x835a('0x1'));var moment=require(_0x835a('0x2'));var BPromise=require('bluebird');var rs=require(_0x835a('0x3'));var fs=require('fs');var Redis=require(_0x835a('0x4'));var db=require(_0x835a('0x5'))['db'];var utils=require(_0x835a('0x6'));var logger=require(_0x835a('0x7'))(_0x835a('0x8'));var config=require(_0x835a('0x9'));var jayson=require(_0x835a('0xa'));var client=jayson[_0x835a('0xb')][_0x835a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56d367,_0x4e8fa0,_0x5ed677){return new BPromise(function(_0x15e60d,_0x31b094){return client['request'](_0x56d367,_0x5ed677)[_0x835a('0xd')](function(_0x5fab06){logger['info'](_0x835a('0xe'),_0x4e8fa0,_0x835a('0xf'));logger[_0x835a('0x10')](_0x835a('0x11'),_0x4e8fa0,_0x835a('0xf'),JSON[_0x835a('0x12')](_0x5fab06));if(_0x5fab06[_0x835a('0x13')]){if(_0x5fab06[_0x835a('0x13')]['code']===0x1f4){logger[_0x835a('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x4e8fa0,_0x5fab06[_0x835a('0x13')][_0x835a('0x14')]);return _0x31b094(_0x5fab06[_0x835a('0x13')][_0x835a('0x14')]);}logger[_0x835a('0x13')](_0x835a('0xe'),_0x4e8fa0,_0x5fab06[_0x835a('0x13')][_0x835a('0x14')]);return _0x15e60d(_0x5fab06[_0x835a('0x13')][_0x835a('0x14')]);}else{logger[_0x835a('0x15')](_0x835a('0xe'),_0x4e8fa0,_0x835a('0xf'));_0x15e60d(_0x5fab06[_0x835a('0x16')]['message']);}})[_0x835a('0x17')](function(_0x3b0ccc){logger[_0x835a('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x4e8fa0,_0x3b0ccc);_0x31b094(_0x3b0ccc);});});}exports[_0x835a('0x18')]=function(_0x3836c5){var _0x5f307a=this;return new Promise(function(_0x29bac8,_0x38dd75){return db[_0x835a('0x19')]['create'](_0x3836c5[_0x835a('0x1a')],{'raw':_0x3836c5[_0x835a('0x1b')]?_0x3836c5[_0x835a('0x1b')][_0x835a('0x1c')]===undefined?!![]:![]:!![]})[_0x835a('0xd')](function(_0x3d0f4b){logger[_0x835a('0x15')](_0x835a('0x18'),_0x3836c5);logger[_0x835a('0x10')](_0x835a('0x18'),_0x3836c5,JSON[_0x835a('0x12')](_0x3d0f4b));_0x29bac8(_0x3d0f4b);})['catch'](function(_0x16f80d){logger[_0x835a('0x13')]('CreateVoiceTransferReport',_0x16f80d[_0x835a('0x14')],_0x3836c5);_0x38dd75(_0x5f307a[_0x835a('0x13')](0x1f4,_0x16f80d[_0x835a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index e8b6675..8729a94 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 _0x008c=['/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','/calls','calls'];(function(_0x23fddc,_0x1423c5){var _0x22920d=function(_0x2ef30a){while(--_0x2ef30a){_0x23fddc['push'](_0x23fddc['shift']());}};_0x22920d(++_0x1423c5);}(_0x008c,0x188));var _0xc008=function(_0x4da493,_0x15e45a){_0x4da493=_0x4da493-0x0;var _0x33e403=_0x008c[_0x4da493];return _0x33e403;};'use strict';var express=require(_0xc008('0x0'));var router=express[_0xc008('0x1')]();var auth=require(_0xc008('0x2'));var controller=require(_0xc008('0x3'));router[_0xc008('0x4')]('/originate',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x7')]);router[_0xc008('0x4')](_0xc008('0x8'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x9')]);router[_0xc008('0x4')]('/answer',auth[_0xc008('0x5')](),auth['isWebrtcLicence'](),controller[_0xc008('0xa')]);router['post']('/hold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['hold']);router['post']('/unhold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['unhold']);router[_0xc008('0x4')](_0xc008('0xb'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0xc')]);router[_0xc008('0x4')](_0xc008('0xd'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0xf3cd[_0x34bc94];return _0xee41e7;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 64f2707..7f1a87d 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 _0x9c5e=['webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','http','../../config/logger','ioredis','redis','defaults','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','User','findOne','agent','VoiceChannels','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20executed!','hold','sessionId','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','filter','conference\x20fired:'];(function(_0x536385,_0x58939f){var _0x99b884=function(_0x219dc4){while(--_0x219dc4){_0x536385['push'](_0x536385['shift']());}};_0x99b884(++_0x58939f);}(_0x9c5e,0x9c));var _0xe9c5=function(_0xd22c0,_0x2629ce){_0xd22c0=_0xd22c0-0x0;var _0x3de320=_0x9c5e[_0xd22c0];return _0x3de320;};'use strict';var path=require(_0xe9c5('0x0'));var fs=require('fs');var _=require(_0xe9c5('0x1'));var db=require(_0xe9c5('0x2'))['db'];var config=require(_0xe9c5('0x3'));var util=require(_0xe9c5('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson['client'][_0xe9c5('0x5')]({'port':0x232a});var logger=require(_0xe9c5('0x6'))('webbarapi');var Redis=require(_0xe9c5('0x7'));config[_0xe9c5('0x8')]=_[_0xe9c5('0x9')](config[_0xe9c5('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe9c5('0xa'))(new Redis(config[_0xe9c5('0x8')]));var Schema=require(_0xe9c5('0xb'));var originateValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xe9c5('0xd')]},'callerId':{'type':_0xe9c5('0xe')},'callbackUrl':{'type':_0xe9c5('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':[!![],_0xe9c5('0x10')]},'transferNumber':{'type':_0xe9c5('0xe'),'required':[!![],_0xe9c5('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe9c5('0xf')]}});function emit(_0x14eb41,_0x5d5fb4,_0x3aa80b){logger[_0xe9c5('0x12')](_0x14eb41,_0x5d5fb4,JSON[_0xe9c5('0x13')](_0x3aa80b));io['to'](_0x14eb41)[_0xe9c5('0x14')](_0x5d5fb4,_0x3aa80b);}function handleError(_0x23156c){return function(_0x4d9c7d){console[_0xe9c5('0x15')](_0xe9c5('0x16'),_0x4d9c7d,_0x4d9c7d instanceof RangeError);logger[_0xe9c5('0x17')](_0x4d9c7d[_0xe9c5('0x18')]);if(_0x4d9c7d instanceof RangeError){if(_0x4d9c7d['name']){delete _0x4d9c7d[_0xe9c5('0x19')];}_0x23156c[_0xe9c5('0x1a')](0x194)[_0xe9c5('0x1b')](_0x4d9c7d);}else{if(_0x4d9c7d[_0xe9c5('0x19')]){delete _0x4d9c7d[_0xe9c5('0x19')];}_0x23156c['status'](0x1f4)['send'](_0x4d9c7d);}};}function checkError(){return function(_0xaa891){if(!_0xaa891){throw new RangeError('NotFound');}return _0xaa891;};}function respondWithRpcPromise(_0x3c3d53,_0xc4d208){return new BPromise(function(_0x21b02a,_0x4d16bc){var _0x5750ff=amiClient;return _0x5750ff[_0xe9c5('0x1c')](_0x3c3d53,_0xc4d208)[_0xe9c5('0x1d')](function(_0x37fb90){if(_0x37fb90[_0xe9c5('0x17')]){if(_0x37fb90[_0xe9c5('0x17')][_0xe9c5('0x1e')]===0x1f4){return _0x4d16bc(_0x37fb90[_0xe9c5('0x17')][_0xe9c5('0x1f')]);}return _0x21b02a(_0x37fb90[_0xe9c5('0x17')][_0xe9c5('0x1f')]);}else{_0x21b02a(_0x37fb90['result']);}})['catch'](function(_0x250e1c){_0x4d16bc(_0x250e1c);});});}function getAgent(_0x3dd39d){return db[_0xe9c5('0x20')][_0xe9c5('0x21')]({'where':{'id':_0x3dd39d,'role':_0xe9c5('0x22')}})[_0xe9c5('0x1d')](checkError());}function getAgentCheckSession(_0x493108,_0x2c3fcb){return new BPromise(function(_0x480187,_0x3fa00b){var _0x50256b=respondWithRpcPromise(_0xe9c5('0x23'));var _0x2112a6=getAgent(_0x493108);Promise['all']([_0x50256b,_0x2112a6])[_0xe9c5('0x1d')](function(_0x46d253){var _0x334f5a=_0x46d253[0x0];var _0x37cfa5=_0x46d253[0x1];var _0x1fa0f6=_['filter'](_0x334f5a[_0xe9c5('0x24')],function(_0x4fcabd){return _0x4fcabd[_0xe9c5('0x25')]==_0x37cfa5['id']&&_0x4fcabd['sessionId']==_0x2c3fcb;});if(_0x1fa0f6[_0xe9c5('0x26')]==0x1){_0x480187(_0x37cfa5);}else{_0x3fa00b(new RangeError(_0xe9c5('0x27')+_0x2c3fcb+_0xe9c5('0x28')));}});});}exports[_0xe9c5('0x29')]=function(_0x4766c8,_0x4e6043){logger[_0xe9c5('0x12')](_0xe9c5('0x2a'),_0x4766c8[_0xe9c5('0x2b')]);var _0x12ed89=originateValidation[_0xe9c5('0xb')](_0x4766c8['body']);if(_0x12ed89['length']>0x0){return _0x4e6043[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x12ed89);}var _0x3c409e=_0x4766c8[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x96753=_0x4766c8[_0xe9c5('0x2b')][_0xe9c5('0x2e')];var _0x4feba2=_0x4766c8[_0xe9c5('0x2b')][_0xe9c5('0x2f')];var _0x558277=_0x4766c8[_0xe9c5('0x2b')]['callbackUrl'];return getAgent(_0x3c409e)[_0xe9c5('0x1d')](function(_0x2642cc){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x2642cc[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x2642cc[_0xe9c5('0x19')]),_0xe9c5('0x33'),{'callNumber':_0x96753,'callerId':_0x4feba2,'callbackUrl':_0x558277});return _0x4e6043[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x34')});})[_0xe9c5('0x35')](handleError(_0x4e6043));};exports[_0xe9c5('0x36')]=function(_0x312168,_0x4570e9){logger[_0xe9c5('0x12')](_0xe9c5('0x37'),_0x312168[_0xe9c5('0x2b')]);var _0x55cd00=hangupValidation[_0xe9c5('0xb')](_0x312168[_0xe9c5('0x2b')]);if(_0x55cd00[_0xe9c5('0x26')]>0x0){return _0x4570e9[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x55cd00);}var _0x3b85bf=_0x312168['body'][_0xe9c5('0x2d')];var _0x420558=_0x312168[_0xe9c5('0x2b')]['sessionId'];return getAgent(_0x3b85bf)[_0xe9c5('0x1d')](function(_0x1bf7c5){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x1bf7c5[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x1bf7c5[_0xe9c5('0x19')]),_0xe9c5('0x38'),{'sessionId':_0x420558});return _0x4570e9[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x4570e9));};exports[_0xe9c5('0x39')]=function(_0xbde18b,_0x21bc80){logger[_0xe9c5('0x12')]('answer\x20fired:',_0xbde18b['body']);var _0x382405=answerValidation[_0xe9c5('0xb')](_0xbde18b['body']);if(_0x382405[_0xe9c5('0x26')]>0x0){return _0x21bc80['status'](0x190)['json'](_0x382405);}var _0x5c395d=_0xbde18b[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x1d081a=_0xbde18b[_0xe9c5('0x2b')]['sessionId'];return getAgent(_0x5c395d)[_0xe9c5('0x1d')](function(_0x2ae53a){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x2ae53a[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x2ae53a[_0xe9c5('0x19')]),'webbar:answer',{'sessionId':_0x1d081a});return _0x21bc80[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x3a')});})[_0xe9c5('0x35')](handleError(_0x21bc80));};exports[_0xe9c5('0x3b')]=function(_0x537fcc,_0x562066){logger['info']('hold\x20fired:',_0x537fcc['body']);var _0xa5bf36=holdValidation[_0xe9c5('0xb')](_0x537fcc[_0xe9c5('0x2b')]);if(_0xa5bf36['length']>0x0){return _0x562066[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0xa5bf36);}var _0x1ed99e=_0x537fcc[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x27b8db=_0x537fcc['body'][_0xe9c5('0x3c')];return getAgent(_0x1ed99e)[_0xe9c5('0x1d')](function(_0x1da6a3){logger[_0xe9c5('0x12')]('entityFound:',_0x1da6a3[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x1da6a3[_0xe9c5('0x19')]),_0xe9c5('0x3d'),{'sessionId':_0x27b8db});return _0x562066[_0xe9c5('0x1a')](0xc8)['json']({'error':![],'message':_0xe9c5('0x3e')});})[_0xe9c5('0x35')](handleError(_0x562066));};exports[_0xe9c5('0x3f')]=function(_0x9d0154,_0x5e7c24){logger[_0xe9c5('0x12')](_0xe9c5('0x40'),_0x9d0154[_0xe9c5('0x2b')]);var _0x284706=unholdValidation[_0xe9c5('0xb')](_0x9d0154[_0xe9c5('0x2b')]);if(_0x284706['length']>0x0){return _0x5e7c24['status'](0x190)[_0xe9c5('0x2c')](_0x284706);}var _0x15380c=_0x9d0154[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x30a79b=_0x9d0154[_0xe9c5('0x2b')][_0xe9c5('0x3c')];return getAgent(_0x15380c)[_0xe9c5('0x1d')](function(_0x276393){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x276393[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x276393[_0xe9c5('0x19')]),_0xe9c5('0x41'),{'sessionId':_0x30a79b});return _0x5e7c24['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0xe9c5('0x35')](handleError(_0x5e7c24));};exports[_0xe9c5('0x42')]=function(_0x2b8076,_0x5504d9){logger[_0xe9c5('0x12')]('calls\x20fired:',_0x5504d9[_0xe9c5('0x2b')]);var _0xbac8ef=callsValidation[_0xe9c5('0xb')](_0x2b8076[_0xe9c5('0x2b')]);if(_0xbac8ef[_0xe9c5('0x26')]>0x0){return _0x5504d9['status'](0x190)[_0xe9c5('0x2c')](_0xbac8ef);}var _0x1b4515=_0x2b8076['body'][_0xe9c5('0x2d')];var _0x424f1d=respondWithRpcPromise(_0xe9c5('0x23'));var _0x20d8e8=getAgent(_0x1b4515);return Promise['all']([_0x424f1d,_0x20d8e8])[_0xe9c5('0x1d')](function(_0x499f4f){var _0x1f978d=_0x499f4f[0x0];var _0x40c555=_0x499f4f[0x1];var _0x277323=_[_0xe9c5('0x43')](_0x1f978d['rows'],function(_0x4439cf){return _0x4439cf[_0xe9c5('0x25')]==_0x40c555['id'];});return _0x5504d9[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'count':_0x277323[_0xe9c5('0x26')],'rows':_0x277323});})[_0xe9c5('0x35')](handleError(_0x5504d9));};exports['conference']=function(_0x2dd877,_0x181a9c){logger['info'](_0xe9c5('0x44'),_0x2dd877['body']);var _0x1e5603=conferenceValidation[_0xe9c5('0xb')](_0x2dd877[_0xe9c5('0x2b')]);if(_0x1e5603[_0xe9c5('0x26')]>0x0){return _0x181a9c[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x1e5603);}var _0xa2ba99=_0x2dd877['body'][_0xe9c5('0x2d')];return getAgent(_0xa2ba99)[_0xe9c5('0x1d')](function(_0x117e9f){logger['info'](_0xe9c5('0x30'),_0x117e9f['name']);emit(util['format'](_0xe9c5('0x32'),_0x117e9f[_0xe9c5('0x19')]),_0xe9c5('0x45'));return _0x181a9c[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x46')});})[_0xe9c5('0x35')](handleError(_0x181a9c));};exports[_0xe9c5('0x47')]=function(_0x344235,_0x213be5){logger['info'](_0xe9c5('0x48'),_0x344235[_0xe9c5('0x2b')]);var _0x257a96=transferValidation[_0xe9c5('0xb')](_0x344235[_0xe9c5('0x2b')]);if(_0x257a96[_0xe9c5('0x26')]>0x0){return _0x213be5[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x257a96);}var _0x8b6101=_0x344235['body'][_0xe9c5('0x2d')];var _0x1caca3=_0x344235[_0xe9c5('0x2b')][_0xe9c5('0x3c')];var _0x1db82f=_0x344235[_0xe9c5('0x2b')][_0xe9c5('0x49')];return getAgent(_0x8b6101)['then'](function(_0xfe9e61){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0xfe9e61[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')]('user:%s',_0xfe9e61[_0xe9c5('0x19')]),'webbar:transfer',{'sessionId':_0x1caca3,'transferNumber':_0x1db82f});return _0x213be5['status'](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x4a')});})['catch'](handleError(_0x213be5));}; \ No newline at end of file +var _0xe130=['jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','info','emit','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','catch','User','findOne','agent','then','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','hangup','webbar:hangup','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','entityFound:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird'];(function(_0x1e1267,_0x4eadd2){var _0x8e2352=function(_0x231987){while(--_0x231987){_0x1e1267['push'](_0x1e1267['shift']());}};_0x8e2352(++_0x4eadd2);}(_0xe130,0x127));var _0x0e13=function(_0x1982fb,_0x1ff0cc){_0x1982fb=_0x1982fb-0x0;var _0x41b08d=_0xe130[_0x1982fb];return _0x41b08d;};'use strict';var path=require(_0x0e13('0x0'));var fs=require('fs');var _=require(_0x0e13('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x0e13('0x2'));var util=require(_0x0e13('0x3'));var BPromise=require(_0x0e13('0x4'));var jayson=require(_0x0e13('0x5'));var amiClient=jayson[_0x0e13('0x6')]['http']({'port':0x232a});var logger=require(_0x0e13('0x7'))(_0x0e13('0x8'));var Redis=require(_0x0e13('0x9'));config[_0x0e13('0xa')]=_['defaults'](config[_0x0e13('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x0e13('0xb'));var originateValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x0e13('0xd')]},'callerId':{'type':_0x0e13('0xe')},'callbackUrl':{'type':_0x0e13('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]},'sessionId':{'type':_0x0e13('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x0e13('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x0e13('0xe'),'required':[!![],_0x0e13('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]},'sessionId':{'type':_0x0e13('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]},'sessionId':{'type':_0x0e13('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]}});function emit(_0x2057fe,_0x433965,_0x38bfb3){logger[_0x0e13('0x11')](_0x2057fe,_0x433965,JSON['stringify'](_0x38bfb3));io['to'](_0x2057fe)[_0x0e13('0x12')](_0x433965,_0x38bfb3);}function handleError(_0x2964d3){return function(_0x510a2b){console['log'](_0x0e13('0x13'),_0x510a2b,_0x510a2b instanceof RangeError);logger['error'](_0x510a2b[_0x0e13('0x14')]);if(_0x510a2b instanceof RangeError){if(_0x510a2b['name']){delete _0x510a2b[_0x0e13('0x15')];}_0x2964d3[_0x0e13('0x16')](0x194)[_0x0e13('0x17')](_0x510a2b);}else{if(_0x510a2b[_0x0e13('0x15')]){delete _0x510a2b[_0x0e13('0x15')];}_0x2964d3['status'](0x1f4)['send'](_0x510a2b);}};}function checkError(){return function(_0x580d43){if(!_0x580d43){throw new RangeError(_0x0e13('0x18'));}return _0x580d43;};}function respondWithRpcPromise(_0x141c84,_0x505d53){return new BPromise(function(_0x515222,_0x295eb0){var _0x296ed3=amiClient;return _0x296ed3[_0x0e13('0x19')](_0x141c84,_0x505d53)['then'](function(_0x400e87){if(_0x400e87[_0x0e13('0x1a')]){if(_0x400e87[_0x0e13('0x1a')][_0x0e13('0x1b')]===0x1f4){return _0x295eb0(_0x400e87[_0x0e13('0x1a')][_0x0e13('0x1c')]);}return _0x515222(_0x400e87[_0x0e13('0x1a')][_0x0e13('0x1c')]);}else{_0x515222(_0x400e87[_0x0e13('0x1d')]);}})[_0x0e13('0x1e')](function(_0x9621e2){_0x295eb0(_0x9621e2);});});}function getAgent(_0x443a85){return db[_0x0e13('0x1f')][_0x0e13('0x20')]({'where':{'id':_0x443a85,'role':_0x0e13('0x21')}})[_0x0e13('0x22')](checkError());}function getAgentCheckSession(_0x1edc48,_0x59ae33){return new BPromise(function(_0x37fe42,_0x3e8c13){var _0x3684bb=respondWithRpcPromise('VoiceChannels');var _0x2182ae=getAgent(_0x1edc48);Promise[_0x0e13('0x23')]([_0x3684bb,_0x2182ae])[_0x0e13('0x22')](function(_0x4606de){var _0x5d41c3=_0x4606de[0x0];var _0xe9151f=_0x4606de[0x1];var _0x3867d5=_[_0x0e13('0x24')](_0x5d41c3[_0x0e13('0x25')],function(_0x2e65e2){return _0x2e65e2[_0x0e13('0x26')]==_0xe9151f['id']&&_0x2e65e2[_0x0e13('0x27')]==_0x59ae33;});if(_0x3867d5[_0x0e13('0x28')]==0x1){_0x37fe42(_0xe9151f);}else{_0x3e8c13(new RangeError('sessionId\x20'+_0x59ae33+_0x0e13('0x29')));}});});}exports[_0x0e13('0x2a')]=function(_0x325003,_0x53ef0a){logger[_0x0e13('0x11')](_0x0e13('0x2b'),_0x325003[_0x0e13('0x2c')]);var _0x4311da=originateValidation[_0x0e13('0xb')](_0x325003[_0x0e13('0x2c')]);if(_0x4311da[_0x0e13('0x28')]>0x0){return _0x53ef0a[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x4311da);}var _0x4a5cc1=_0x325003[_0x0e13('0x2c')][_0x0e13('0x2e')];var _0x29e017=_0x325003['body'][_0x0e13('0x2f')];var _0x560bee=_0x325003[_0x0e13('0x2c')][_0x0e13('0x30')];var _0x33d819=_0x325003[_0x0e13('0x2c')][_0x0e13('0x31')];return getAgent(_0x4a5cc1)[_0x0e13('0x22')](function(_0x110b37){logger['info']('entityFound:',_0x110b37[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x110b37[_0x0e13('0x15')]),_0x0e13('0x34'),{'callNumber':_0x29e017,'callerId':_0x560bee,'callbackUrl':_0x33d819});return _0x53ef0a[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':'originate\x20executed!'});})[_0x0e13('0x1e')](handleError(_0x53ef0a));};exports[_0x0e13('0x35')]=function(_0x476c6e,_0x4729da){logger[_0x0e13('0x11')]('hangup\x20fired:',_0x476c6e[_0x0e13('0x2c')]);var _0x2dd946=hangupValidation[_0x0e13('0xb')](_0x476c6e['body']);if(_0x2dd946[_0x0e13('0x28')]>0x0){return _0x4729da['status'](0x190)[_0x0e13('0x2d')](_0x2dd946);}var _0x5557e6=_0x476c6e[_0x0e13('0x2c')]['userId'];var _0x411b44=_0x476c6e[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x5557e6)[_0x0e13('0x22')](function(_0x11e209){logger[_0x0e13('0x11')]('entityFound:',_0x11e209[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x11e209[_0x0e13('0x15')]),_0x0e13('0x36'),{'sessionId':_0x411b44});return _0x4729da[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':'hangup\x20executed!'});})[_0x0e13('0x1e')](handleError(_0x4729da));};exports['answer']=function(_0x54da3f,_0x4ba4ec){logger[_0x0e13('0x11')](_0x0e13('0x37'),_0x54da3f[_0x0e13('0x2c')]);var _0x14ab2a=answerValidation[_0x0e13('0xb')](_0x54da3f[_0x0e13('0x2c')]);if(_0x14ab2a[_0x0e13('0x28')]>0x0){return _0x4ba4ec['status'](0x190)[_0x0e13('0x2d')](_0x14ab2a);}var _0x4f9f28=_0x54da3f['body'][_0x0e13('0x2e')];var _0x3bacaf=_0x54da3f[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x4f9f28)['then'](function(_0xa8f369){logger[_0x0e13('0x11')]('entityFound:',_0xa8f369[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0xa8f369[_0x0e13('0x15')]),_0x0e13('0x38'),{'sessionId':_0x3bacaf});return _0x4ba4ec[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x39')});})[_0x0e13('0x1e')](handleError(_0x4ba4ec));};exports[_0x0e13('0x3a')]=function(_0x4b2a3b,_0x514b1d){logger[_0x0e13('0x11')](_0x0e13('0x3b'),_0x4b2a3b[_0x0e13('0x2c')]);var _0x18bc94=holdValidation[_0x0e13('0xb')](_0x4b2a3b['body']);if(_0x18bc94[_0x0e13('0x28')]>0x0){return _0x514b1d[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x18bc94);}var _0x548259=_0x4b2a3b[_0x0e13('0x2c')]['userId'];var _0x17b5c4=_0x4b2a3b[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x548259)[_0x0e13('0x22')](function(_0x35249c){logger['info'](_0x0e13('0x3c'),_0x35249c['name']);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x35249c['name']),_0x0e13('0x3d'),{'sessionId':_0x17b5c4});return _0x514b1d[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x3e')});})['catch'](handleError(_0x514b1d));};exports[_0x0e13('0x3f')]=function(_0x359de5,_0x4d9afd){logger[_0x0e13('0x11')]('unhold\x20fired:',_0x359de5['body']);var _0x56b589=unholdValidation[_0x0e13('0xb')](_0x359de5['body']);if(_0x56b589[_0x0e13('0x28')]>0x0){return _0x4d9afd[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x56b589);}var _0x417a31=_0x359de5[_0x0e13('0x2c')]['userId'];var _0x39cdc8=_0x359de5[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x417a31)[_0x0e13('0x22')](function(_0x4539f6){logger[_0x0e13('0x11')](_0x0e13('0x3c'),_0x4539f6[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x4539f6[_0x0e13('0x15')]),_0x0e13('0x40'),{'sessionId':_0x39cdc8});return _0x4d9afd['status'](0xc8)[_0x0e13('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0x0e13('0x1e')](handleError(_0x4d9afd));};exports[_0x0e13('0x41')]=function(_0x509c31,_0x10799f){logger[_0x0e13('0x11')]('calls\x20fired:',_0x10799f[_0x0e13('0x2c')]);var _0x65111c=callsValidation[_0x0e13('0xb')](_0x509c31[_0x0e13('0x2c')]);if(_0x65111c['length']>0x0){return _0x10799f[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x65111c);}var _0x348ea5=_0x509c31[_0x0e13('0x2c')][_0x0e13('0x2e')];var _0x27df87=respondWithRpcPromise(_0x0e13('0x42'));var _0x1132ac=getAgent(_0x348ea5);return Promise[_0x0e13('0x23')]([_0x27df87,_0x1132ac])['then'](function(_0x3d5c20){var _0xa3db49=_0x3d5c20[0x0];var _0x15ad8f=_0x3d5c20[0x1];var _0x1d670f=_[_0x0e13('0x24')](_0xa3db49[_0x0e13('0x25')],function(_0x17f680){return _0x17f680[_0x0e13('0x26')]==_0x15ad8f['id'];});return _0x10799f[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'count':_0x1d670f[_0x0e13('0x28')],'rows':_0x1d670f});})['catch'](handleError(_0x10799f));};exports[_0x0e13('0x43')]=function(_0x15ddfa,_0x35b1ea){logger[_0x0e13('0x11')](_0x0e13('0x44'),_0x15ddfa[_0x0e13('0x2c')]);var _0x2e17e7=conferenceValidation['validate'](_0x15ddfa[_0x0e13('0x2c')]);if(_0x2e17e7[_0x0e13('0x28')]>0x0){return _0x35b1ea[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x2e17e7);}var _0x36b553=_0x15ddfa[_0x0e13('0x2c')][_0x0e13('0x2e')];return getAgent(_0x36b553)['then'](function(_0x49774c){logger[_0x0e13('0x11')](_0x0e13('0x3c'),_0x49774c[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x49774c[_0x0e13('0x15')]),_0x0e13('0x45'));return _0x35b1ea[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x46')});})[_0x0e13('0x1e')](handleError(_0x35b1ea));};exports[_0x0e13('0x47')]=function(_0x4d3468,_0x378649){logger[_0x0e13('0x11')]('transfer\x20fired:',_0x4d3468['body']);var _0x343275=transferValidation['validate'](_0x4d3468[_0x0e13('0x2c')]);if(_0x343275[_0x0e13('0x28')]>0x0){return _0x378649['status'](0x190)[_0x0e13('0x2d')](_0x343275);}var _0x882e6b=_0x4d3468['body'][_0x0e13('0x2e')];var _0x24329f=_0x4d3468[_0x0e13('0x2c')][_0x0e13('0x27')];var _0xc9d498=_0x4d3468['body'][_0x0e13('0x48')];return getAgent(_0x882e6b)[_0x0e13('0x22')](function(_0x37252e){logger[_0x0e13('0x11')](_0x0e13('0x3c'),_0x37252e[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')]('user:%s',_0x37252e[_0x0e13('0x15')]),_0x0e13('0x49'),{'sessionId':_0x24329f,'transferNumber':_0xc9d498});return _0x378649[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x4a')});})[_0x0e13('0x1e')](handleError(_0x378649));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 6592b3a..834e662 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 _0x2542=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x5dce0d,_0x18d2fd){var _0x4dd8fa=function(_0x129a43){while(--_0x129a43){_0x5dce0d['push'](_0x5dce0d['shift']());}};_0x4dd8fa(++_0x18d2fd);}(_0x2542,0x169));var _0x2254=function(_0x366d91,_0x4abd6c){_0x366d91=_0x366d91-0x0;var _0x11ac2c=_0x2542[_0x366d91];return _0x11ac2c;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x9')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x11')]);router[_0x2254('0x9')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['getAnswers']);router['get'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x14')]);router[_0x2254('0x9')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['getApplications']);router[_0x2254('0x16')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x16')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller[_0x2254('0x17')]);router[_0x2254('0x16')](_0x2254('0x12'),auth['isAuthenticated'](),controller[_0x2254('0x18')]);router['post'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x19')]);router[_0x2254('0x16')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x2254('0x1a')]);router[_0x2254('0x16')](_0x2254('0x1b'),auth[_0x2254('0xc')](),controller[_0x2254('0x1c')]);router[_0x2254('0x1d')]('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x1e')]);router[_0x2254('0x1f')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2254('0x1f')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x20')]);module[_0x2254('0x21')]=router; \ No newline at end of file +var _0x6343=['/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeAnswers','removeAgents','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers'];(function(_0x18d047,_0x4e2cfb){var _0x28c3c2=function(_0xe750e0){while(--_0xe750e0){_0x18d047['push'](_0x18d047['shift']());}};_0x28c3c2(++_0x4e2cfb);}(_0x6343,0x168));var _0x3634=function(_0xf8d696,_0x23cd7c){_0xf8d696=_0xf8d696-0x0;var _0x55d6a9=_0x6343[_0xf8d696];return _0x55d6a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var controller=require('./whatsappAccount.controller');router[_0x3634('0x4')]('/',auth[_0x3634('0x5')](),controller['index']);router[_0x3634('0x4')](_0x3634('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x3634('0x4')](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x8')]);router[_0x3634('0x4')](_0x3634('0x9'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x3634('0x4')](_0x3634('0xa'),auth['isAuthenticated'](),controller[_0x3634('0xb')]);router[_0x3634('0x4')](_0x3634('0xc'),auth[_0x3634('0x5')](),controller[_0x3634('0xd')]);router[_0x3634('0x4')](_0x3634('0xe'),auth[_0x3634('0x5')](),controller[_0x3634('0xf')]);router[_0x3634('0x10')]('/',auth[_0x3634('0x5')](),controller[_0x3634('0x11')]);router[_0x3634('0x10')](_0x3634('0x9'),auth['isAuthenticated'](),controller[_0x3634('0x12')]);router['post'](_0x3634('0xa'),auth[_0x3634('0x5')](),controller[_0x3634('0x13')]);router[_0x3634('0x10')](_0x3634('0xc'),auth['isAuthenticated'](),controller[_0x3634('0x14')]);router['post']('/:id/applications',auth[_0x3634('0x5')](),controller['addApplications']);router[_0x3634('0x10')](_0x3634('0x15'),controller[_0x3634('0x16')]);router['post'](_0x3634('0x17'),auth[_0x3634('0x5')](),controller['send']);router[_0x3634('0x18')]('/:id',auth[_0x3634('0x5')](),controller[_0x3634('0x19')]);router['delete'](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x1a')]);router['delete'](_0x3634('0x9'),auth[_0x3634('0x5')](),controller['removeDispositions']);router[_0x3634('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3634('0x1c')]);router[_0x3634('0x1b')]('/:id/users',auth[_0x3634('0x5')](),controller[_0x3634('0x1d')]);module[_0x3634('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index fbcddda..e963976 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 _0x077b=['mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM','twilio','sinch','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x35a920,_0xb431e1){var _0x130fd9=function(_0x342ce5){while(--_0x342ce5){_0x35a920['push'](_0x35a920['shift']());}};_0x130fd9(++_0xb431e1);}(_0x077b,0x9b));var _0xb077=function(_0x549953,_0x58b1aa){_0x549953=_0x549953-0x0;var _0x136cdb=_0x077b[_0x549953];return _0x136cdb;};'use strict';var Sequelize=require(_0xb077('0x0'));var rs=require(_0xb077('0x1'));module[_0xb077('0x2')]={'name':{'type':Sequelize[_0xb077('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xb077('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb077('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xb077('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb077('0x4')](_0xb077('0x5'),_0xb077('0x6'))},'accountSid':{'type':Sequelize[_0xb077('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb077('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb077('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb077('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb077('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb077('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb077('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb077('0x8')],'comment':_0xb077('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb077('0xa'),'set':function(_0x73d104){if(!_0x73d104){this[_0xb077('0xb')](_0xb077('0xc'),null);}this[_0xb077('0xb')](_0xb077('0xd'),_0x73d104);}},'description':{'type':Sequelize[_0xb077('0x3')]}}; \ No newline at end of file +var _0xd0b9=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd0b9,0x139));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9d0b('0x0'));var rs=require(_0x9d0b('0x1'));module[_0x9d0b('0x2')]={'name':{'type':Sequelize[_0x9d0b('0x3')],'unique':_0x9d0b('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x9d0b('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9d0b('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9d0b('0x3')],'defaultValue':function(){return rs[_0x9d0b('0x5')]();}},'phone':{'type':Sequelize[_0x9d0b('0x3')]},'type':{'type':Sequelize[_0x9d0b('0x6')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0x9d0b('0x3')]},'baseUrl':{'type':Sequelize[_0x9d0b('0x3')]},'authToken':{'type':Sequelize[_0x9d0b('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9d0b('0x7')],'defaultValue':function(){return _0x9d0b('0x8');}},'notificationSound':{'type':Sequelize[_0x9d0b('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9d0b('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9d0b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9d0b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9d0b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9d0b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9d0b('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x248f8d){if(!_0x248f8d){this[_0x9d0b('0xb')]('mandatoryDispositionPauseId',null);}this[_0x9d0b('0xb')](_0x9d0b('0xc'),_0x248f8d);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index a715081..8a1692f 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 _0x0f03=['count','set','Content-Range','reject','save','then','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','merge','options','findAll','rows','show','rawAttributes','includeAll','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','update','params','describe','addDisposition','Disposition','findOne','WhatsappAccountId','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','send','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','from','replace','whatsapp:','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','list','defaults','contact','WhatsappInteraction','interaction','created','applications','push','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappAccount.socket','jayson/promise','client','http','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined'];(function(_0x225815,_0x5db310){var _0x47a32e=function(_0xafe283){while(--_0xafe283){_0x225815['push'](_0x225815['shift']());}};_0x47a32e(++_0x5db310);}(_0x0f03,0x155));var _0x30f0=function(_0x8c9fe7,_0x207533){_0x8c9fe7=_0x8c9fe7-0x0;var _0x4000fb=_0x0f03[_0x8c9fe7];return _0x4000fb;};'use strict';var emlformat=require(_0x30f0('0x0'));var rimraf=require(_0x30f0('0x1'));var zipdir=require(_0x30f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30f0('0x3'));var moment=require(_0x30f0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x30f0('0x5'));var util=require('util');var path=require(_0x30f0('0x6'));var sox=require(_0x30f0('0x7'));var csv=require('to-csv');var ejs=require(_0x30f0('0x8'));var fs=require('fs');var fs_extra=require(_0x30f0('0x9'));var _=require(_0x30f0('0xa'));var squel=require(_0x30f0('0xb'));var crypto=require(_0x30f0('0xc'));var jsforce=require(_0x30f0('0xd'));var deskjs=require(_0x30f0('0xe'));var toCsv=require(_0x30f0('0xf'));var querystring=require(_0x30f0('0x10'));var Papa=require(_0x30f0('0x11'));var Redis=require(_0x30f0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30f0('0x13'));var hardwareService=require(_0x30f0('0x14'));var logger=require('../../config/logger')(_0x30f0('0x15'));var utils=require(_0x30f0('0x16'));var config=require(_0x30f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x30f0('0x18'))['db'];config['redis']=_['defaults'](config[_0x30f0('0x19')],{'host':_0x30f0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x30f0('0x19')]));require(_0x30f0('0x1b'))['register'](socket);var jayson=require(_0x30f0('0x1c'));var client=jayson[_0x30f0('0x1d')][_0x30f0('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2e2df5,_0x4203b5,_0x1d842d,_0xdd259e){return new BPromise(function(_0x2ca8c4,_0x5af27c){var _0x29c402=_0xdd259e||client;return _0x29c402[_0x30f0('0x1f')](_0x2e2df5,_0x1d842d)['then'](function(_0x2e547d){logger['info'](_0x30f0('0x20'),_0x4203b5,_0x30f0('0x21'));logger['debug'](_0x30f0('0x22'),_0x4203b5,_0x30f0('0x21'),JSON[_0x30f0('0x23')](_0x2e547d));if(_0x2e547d[_0x30f0('0x24')]){if(_0x2e547d[_0x30f0('0x24')][_0x30f0('0x25')]===0x1f4){logger[_0x30f0('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x4203b5,_0x2e547d[_0x30f0('0x24')][_0x30f0('0x26')]);return _0x5af27c(_0x2e547d[_0x30f0('0x24')][_0x30f0('0x26')]);}logger[_0x30f0('0x24')](_0x30f0('0x20'),_0x4203b5,_0x2e547d[_0x30f0('0x24')]['message']);return _0x2ca8c4(_0x2e547d[_0x30f0('0x24')]['message']);}else{logger['info'](_0x30f0('0x20'),_0x4203b5,'request\x20sent');_0x2ca8c4(_0x2e547d[_0x30f0('0x27')][_0x30f0('0x26')]);}})[_0x30f0('0x28')](function(_0x5151f9){logger['error'](_0x30f0('0x20'),_0x4203b5,_0x5151f9);_0x5af27c(_0x5151f9);});});}function respondWithStatusCode(_0x8f20c9,_0xa0bb63){_0xa0bb63=_0xa0bb63||0xcc;return function(_0x1015ab){if(_0x1015ab){return _0x8f20c9['sendStatus'](_0xa0bb63);}return _0x8f20c9[_0x30f0('0x29')](_0xa0bb63)[_0x30f0('0x2a')]();};}function respondWithResult(_0x53ad14,_0x1c8f28){_0x1c8f28=_0x1c8f28||0xc8;return function(_0x48fda5){if(_0x48fda5){return _0x53ad14['status'](_0x1c8f28)[_0x30f0('0x2b')](_0x48fda5);}};}function respondWithFilteredResult(_0x306e0e,_0x5f1faa){return function(_0x306557){if(_0x306557){var _0x197619=typeof _0x5f1faa[_0x30f0('0x2c')]==='undefined'&&typeof _0x5f1faa[_0x30f0('0x2d')]===_0x30f0('0x2e');var _0x3b1f0c=_0x306557[_0x30f0('0x2f')];var _0x2341da=_0x197619?0x0:_0x5f1faa[_0x30f0('0x2c')];var _0x4facd4=_0x197619?_0x306557[_0x30f0('0x2f')]:_0x5f1faa['offset']+_0x5f1faa[_0x30f0('0x2d')];var _0xaba4d;if(_0x4facd4>=_0x3b1f0c){_0x4facd4=_0x3b1f0c;_0xaba4d=0xc8;}else{_0xaba4d=0xce;}_0x306e0e['status'](_0xaba4d);return _0x306e0e[_0x30f0('0x30')](_0x30f0('0x31'),_0x2341da+'-'+_0x4facd4+'/'+_0x3b1f0c)[_0x30f0('0x2b')](_0x306557);}return null;};}function patchUpdates(_0xea0d2c){return function(_0x2a7954){try{jsonpatch['apply'](_0x2a7954,_0xea0d2c,!![]);}catch(_0x154fc2){return BPromise[_0x30f0('0x32')](_0x154fc2);}return _0x2a7954[_0x30f0('0x33')]();};}function saveUpdates(_0x381510,_0xb8f28d){return function(_0x39886a){if(_0x39886a){return _0x39886a['update'](_0x381510)[_0x30f0('0x34')](function(_0x28bc99){return _0x28bc99;});}return null;};}function removeEntity(_0x30392c,_0x1e003d){return function(_0x151360){if(_0x151360){return _0x151360[_0x30f0('0x35')]()['then'](function(){var _0x39e9d8=_0x151360[_0x30f0('0x36')]({'plain':!![]});var _0x284c1d=_0x30f0('0x37');return db[_0x30f0('0x38')][_0x30f0('0x35')]({'where':{'type':_0x284c1d,'resourceId':_0x39e9d8['id']}})['then'](function(){return _0x151360;});})[_0x30f0('0x34')](function(){_0x30392c['status'](0xcc)[_0x30f0('0x2a')]();});}};}function handleEntityNotFound(_0x51ee7f,_0x10bee0){return function(_0x19290d){if(!_0x19290d){_0x51ee7f[_0x30f0('0x39')](0x194);}return _0x19290d;};}function handleError(_0x54e1eb,_0x171556){_0x171556=_0x171556||0x1f4;return function(_0x5b1c61){logger[_0x30f0('0x24')](_0x5b1c61[_0x30f0('0x3a')]);if(_0x5b1c61['name']){delete _0x5b1c61[_0x30f0('0x3b')];}_0x54e1eb[_0x30f0('0x29')](_0x171556)['send'](_0x5b1c61);};}exports['index']=function(_0x57ec1f,_0x580ac3){var _0x1deb1a={'include':[{'model':db[_0x30f0('0x3c')],'as':_0x30f0('0x3d')}]},_0x23f3bc={},_0x1970ce={'count':0x0,'rows':[]};var _0x3be7d2=_[_0x30f0('0x3e')](db[_0x30f0('0x3f')]['rawAttributes'],function(_0x11637e){return{'name':_0x11637e[_0x30f0('0x40')],'type':_0x11637e[_0x30f0('0x41')][_0x30f0('0x42')]};});_0x23f3bc[_0x30f0('0x43')]=_[_0x30f0('0x3e')](_0x3be7d2,_0x30f0('0x3b'));_0x23f3bc[_0x30f0('0x44')]=_[_0x30f0('0x45')](_0x57ec1f[_0x30f0('0x44')]);_0x23f3bc['filters']=_['intersection'](_0x23f3bc['model'],_0x23f3bc['query']);_0x1deb1a[_0x30f0('0x46')]=_[_0x30f0('0x47')](_0x23f3bc['model'],qs['fields'](_0x57ec1f['query'][_0x30f0('0x48')]));_0x1deb1a[_0x30f0('0x46')]=_0x1deb1a[_0x30f0('0x46')][_0x30f0('0x49')]?_0x1deb1a[_0x30f0('0x46')]:_0x23f3bc[_0x30f0('0x43')];if(!_0x57ec1f[_0x30f0('0x44')][_0x30f0('0x4a')](_0x30f0('0x4b'))){_0x1deb1a[_0x30f0('0x2d')]=qs[_0x30f0('0x2d')](_0x57ec1f[_0x30f0('0x44')][_0x30f0('0x2d')]);_0x1deb1a[_0x30f0('0x2c')]=qs[_0x30f0('0x2c')](_0x57ec1f['query'][_0x30f0('0x2c')]);}_0x1deb1a[_0x30f0('0x4c')]=qs[_0x30f0('0x4d')](_0x57ec1f[_0x30f0('0x44')][_0x30f0('0x4d')]);_0x1deb1a['where']=qs[_0x30f0('0x4e')](_[_0x30f0('0x4f')](_0x57ec1f[_0x30f0('0x44')],_0x23f3bc[_0x30f0('0x4e')]),_0x3be7d2);if(_0x57ec1f[_0x30f0('0x44')]['filter']){_0x1deb1a['where']=_['merge'](_0x1deb1a[_0x30f0('0x50')],{'$or':_[_0x30f0('0x3e')](_0x3be7d2,function(_0x59ae88){if(_0x59ae88['type']!==_0x30f0('0x51')){var _0x3fb3f7={};_0x3fb3f7[_0x59ae88['name']]={'$like':'%'+_0x57ec1f[_0x30f0('0x44')]['filter']+'%'};return _0x3fb3f7;}})});}_0x1deb1a=_[_0x30f0('0x52')]({},_0x1deb1a,_0x57ec1f[_0x30f0('0x53')]);var _0x2b19af={'where':_0x1deb1a[_0x30f0('0x50')]};return db[_0x30f0('0x3f')][_0x30f0('0x2f')](_0x2b19af)[_0x30f0('0x34')](function(_0x50be5e){_0x1970ce[_0x30f0('0x2f')]=_0x50be5e;if(_0x57ec1f[_0x30f0('0x44')]['includeAll']){_0x1deb1a['include']=[{'all':!![]}];}return db[_0x30f0('0x3f')][_0x30f0('0x54')](_0x1deb1a);})[_0x30f0('0x34')](function(_0x1da16b){_0x1970ce[_0x30f0('0x55')]=_0x1da16b;return _0x1970ce;})['then'](respondWithFilteredResult(_0x580ac3,_0x1deb1a))['catch'](handleError(_0x580ac3,null));};exports[_0x30f0('0x56')]=function(_0x431d0a,_0x2985f3){var _0x277293={'raw':![],'where':{'id':_0x431d0a['params']['id']},'include':[{'model':db[_0x30f0('0x3c')],'as':_0x30f0('0x3d')}]},_0x3e087c={};_0x3e087c[_0x30f0('0x43')]=_[_0x30f0('0x45')](db[_0x30f0('0x3f')][_0x30f0('0x57')]);_0x3e087c['query']=_['keys'](_0x431d0a[_0x30f0('0x44')]);_0x3e087c[_0x30f0('0x4e')]=_['intersection'](_0x3e087c['model'],_0x3e087c['query']);_0x277293[_0x30f0('0x46')]=_[_0x30f0('0x47')](_0x3e087c[_0x30f0('0x43')],qs[_0x30f0('0x48')](_0x431d0a[_0x30f0('0x44')][_0x30f0('0x48')]));_0x277293[_0x30f0('0x46')]=_0x277293[_0x30f0('0x46')]['length']?_0x277293[_0x30f0('0x46')]:_0x3e087c[_0x30f0('0x43')];if(_0x431d0a[_0x30f0('0x44')][_0x30f0('0x58')]){_0x277293[_0x30f0('0x59')]=[{'all':!![]}];}_0x277293=_[_0x30f0('0x52')]({},_0x277293,_0x431d0a[_0x30f0('0x53')]);return db[_0x30f0('0x3f')]['find'](_0x277293)[_0x30f0('0x34')](handleEntityNotFound(_0x2985f3,null))[_0x30f0('0x34')](respondWithResult(_0x2985f3,null))[_0x30f0('0x28')](handleError(_0x2985f3,null));};exports[_0x30f0('0x5a')]=function(_0x1d6d10,_0x301741){return db[_0x30f0('0x3f')][_0x30f0('0x5a')](_0x1d6d10[_0x30f0('0x5b')],{})[_0x30f0('0x34')](function(_0x2ba565){var _0x3e47b1=_0x1d6d10[_0x30f0('0x5c')][_0x30f0('0x36')]({'plain':!![]});if(!_0x3e47b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e47b1[_0x30f0('0x5d')]===_0x30f0('0x5c')){var _0x305d6b=_0x2ba565['get']({'plain':!![]});var _0x1c6bdb='WhatsappAccounts';return db[_0x30f0('0x5e')][_0x30f0('0x5f')]({'where':{'name':_0x1c6bdb,'userProfileId':_0x3e47b1[_0x30f0('0x60')]},'raw':!![]})[_0x30f0('0x34')](function(_0x5af297){if(_0x5af297&&_0x5af297[_0x30f0('0x61')]===0x0){return db[_0x30f0('0x38')]['create']({'name':_0x305d6b[_0x30f0('0x3b')],'resourceId':_0x305d6b['id'],'type':_0x5af297[_0x30f0('0x3b')],'sectionId':_0x5af297['id']},{})[_0x30f0('0x34')](function(){return _0x2ba565;});}else{return _0x2ba565;}})['catch'](function(_0x4a045c){logger[_0x30f0('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a045c);throw _0x4a045c;});}return _0x2ba565;})[_0x30f0('0x34')](respondWithResult(_0x301741,0xc9))[_0x30f0('0x28')](handleError(_0x301741,null));};exports[_0x30f0('0x62')]=function(_0x30f893,_0x23854b){if(_0x30f893['body']['id']){delete _0x30f893['body']['id'];}return db[_0x30f0('0x3f')][_0x30f0('0x5f')]({'where':{'id':_0x30f893['params']['id']},'include':[{'model':db[_0x30f0('0x3c')],'as':_0x30f0('0x3d')}]})[_0x30f0('0x34')](handleEntityNotFound(_0x23854b,null))[_0x30f0('0x34')](saveUpdates(_0x30f893[_0x30f0('0x5b')],null))[_0x30f0('0x34')](respondWithResult(_0x23854b,null))[_0x30f0('0x28')](handleError(_0x23854b,null));};exports[_0x30f0('0x35')]=function(_0x55bd63,_0x259b90){return db[_0x30f0('0x3f')][_0x30f0('0x5f')]({'where':{'id':_0x55bd63[_0x30f0('0x63')]['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x259b90,null))[_0x30f0('0x34')](removeEntity(_0x259b90,null))[_0x30f0('0x28')](handleError(_0x259b90,null));};exports[_0x30f0('0x64')]=function(_0x21ff6c,_0x4668fa){return db[_0x30f0('0x3f')]['describe']()[_0x30f0('0x34')](respondWithResult(_0x4668fa,null))['catch'](handleError(_0x4668fa,null));};exports[_0x30f0('0x65')]=function(_0x25bd17,_0x51f982,_0x4ec122){if(_0x25bd17['body']['id']){delete _0x25bd17[_0x30f0('0x5b')]['id'];}return db[_0x30f0('0x3f')][_0x30f0('0x5f')]({'where':{'id':_0x25bd17[_0x30f0('0x63')]['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x51f982,null))[_0x30f0('0x34')](function(_0x8643a1){if(_0x8643a1){_0x25bd17[_0x30f0('0x5b')]['WhatsappAccountId']=_0x8643a1['id'];return db[_0x30f0('0x66')][_0x30f0('0x5a')](_0x25bd17[_0x30f0('0x5b')]);}})['then'](respondWithResult(_0x51f982,null))[_0x30f0('0x28')](handleError(_0x51f982,null));};exports['getDispositions']=function(_0x11e706,_0x16fec5,_0x1cc727){var _0x3e261e={'raw':![],'where':{}};var _0x145d9e={};var _0x44651a={'count':0x0,'rows':[]};return db[_0x30f0('0x3f')][_0x30f0('0x67')]({'where':{'id':_0x11e706['params']['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x16fec5,null))[_0x30f0('0x34')](function(_0x1a4ace){if(_0x1a4ace){_0x145d9e['model']=_[_0x30f0('0x45')](db[_0x30f0('0x66')]['rawAttributes']);_0x145d9e[_0x30f0('0x44')]=_[_0x30f0('0x45')](_0x11e706[_0x30f0('0x44')]);_0x145d9e[_0x30f0('0x4e')]=_[_0x30f0('0x47')](_0x145d9e[_0x30f0('0x43')],_0x145d9e['query']);_0x3e261e['attributes']=_[_0x30f0('0x47')](_0x145d9e['model'],qs['fields'](_0x11e706[_0x30f0('0x44')][_0x30f0('0x48')]));_0x3e261e[_0x30f0('0x46')]=_0x3e261e['attributes'][_0x30f0('0x49')]?_0x3e261e['attributes']:_0x145d9e[_0x30f0('0x43')];if(!_0x11e706[_0x30f0('0x44')][_0x30f0('0x4a')](_0x30f0('0x4b'))){_0x3e261e['limit']=qs[_0x30f0('0x2d')](_0x11e706[_0x30f0('0x44')]['limit']);_0x3e261e[_0x30f0('0x2c')]=qs[_0x30f0('0x2c')](_0x11e706['query'][_0x30f0('0x2c')]);}_0x3e261e[_0x30f0('0x4c')]=qs[_0x30f0('0x4d')](_0x11e706[_0x30f0('0x44')][_0x30f0('0x4d')]);_0x3e261e[_0x30f0('0x50')]=qs[_0x30f0('0x4e')](_[_0x30f0('0x4f')](_0x11e706[_0x30f0('0x44')],_0x145d9e[_0x30f0('0x4e')]));_0x3e261e['where'][_0x30f0('0x68')]=_0x1a4ace['id'];if(_0x11e706[_0x30f0('0x44')][_0x30f0('0x69')]){_0x3e261e[_0x30f0('0x50')]=_[_0x30f0('0x52')](_0x3e261e['where'],{'$or':_[_0x30f0('0x3e')](_0x3e261e[_0x30f0('0x46')],function(_0x5e498c){var _0xfe1efc={};_0xfe1efc[_0x5e498c]={'$like':'%'+_0x11e706[_0x30f0('0x44')][_0x30f0('0x69')]+'%'};return _0xfe1efc;})});}_0x3e261e=_[_0x30f0('0x52')]({},_0x3e261e,_0x11e706[_0x30f0('0x53')]);return db[_0x30f0('0x66')][_0x30f0('0x2f')]({'where':_0x3e261e[_0x30f0('0x50')]})['then'](function(_0x583ed3){_0x44651a[_0x30f0('0x2f')]=_0x583ed3;if(_0x11e706['query']['includeAll']){_0x3e261e[_0x30f0('0x59')]=[{'all':!![]}];}return db[_0x30f0('0x66')][_0x30f0('0x54')](_0x3e261e);})['then'](function(_0x4c5525){_0x44651a['rows']=_0x4c5525;return _0x44651a;});}})[_0x30f0('0x34')](respondWithFilteredResult(_0x16fec5,_0x3e261e))[_0x30f0('0x28')](handleError(_0x16fec5,null));};exports[_0x30f0('0x6a')]=function(_0x36583d,_0x5ceb63,_0x1f12b1){return db[_0x30f0('0x3f')]['find']({'where':{'id':_0x36583d[_0x30f0('0x63')]['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x5ceb63,null))[_0x30f0('0x34')](function(_0x2007c0){if(_0x2007c0){return _0x2007c0['removeDispositions'](_0x36583d[_0x30f0('0x44')][_0x30f0('0x6b')]);}})['then'](respondWithStatusCode(_0x5ceb63,null))[_0x30f0('0x28')](handleError(_0x5ceb63,null));};exports[_0x30f0('0x6c')]=function(_0x20622b,_0x214747,_0x515285){if(_0x20622b[_0x30f0('0x5b')]['id']){delete _0x20622b[_0x30f0('0x5b')]['id'];}return db[_0x30f0('0x3f')]['find']({'where':{'id':_0x20622b[_0x30f0('0x63')]['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x214747,null))[_0x30f0('0x34')](function(_0x10d1f4){if(_0x10d1f4){_0x20622b[_0x30f0('0x5b')][_0x30f0('0x68')]=_0x10d1f4['id'];return db[_0x30f0('0x6d')][_0x30f0('0x5a')](_0x20622b[_0x30f0('0x5b')]);}})[_0x30f0('0x34')](respondWithResult(_0x214747,null))['catch'](handleError(_0x214747,null));};exports[_0x30f0('0x6e')]=function(_0x57a55f,_0x2b2ebb,_0x94b5c7){var _0x352478={'raw':![],'where':{}};var _0xcff735={};var _0x414b30={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x30f0('0x67')]({'where':{'id':_0x57a55f[_0x30f0('0x63')]['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x2b2ebb,null))['then'](function(_0x2fed0b){if(_0x2fed0b){_0xcff735[_0x30f0('0x43')]=_[_0x30f0('0x45')](db[_0x30f0('0x6d')][_0x30f0('0x57')]);_0xcff735['query']=_['keys'](_0x57a55f['query']);_0xcff735[_0x30f0('0x4e')]=_['intersection'](_0xcff735['model'],_0xcff735['query']);_0x352478[_0x30f0('0x46')]=_[_0x30f0('0x47')](_0xcff735[_0x30f0('0x43')],qs[_0x30f0('0x48')](_0x57a55f[_0x30f0('0x44')]['fields']));_0x352478[_0x30f0('0x46')]=_0x352478[_0x30f0('0x46')][_0x30f0('0x49')]?_0x352478['attributes']:_0xcff735[_0x30f0('0x43')];if(!_0x57a55f[_0x30f0('0x44')][_0x30f0('0x4a')](_0x30f0('0x4b'))){_0x352478[_0x30f0('0x2d')]=qs[_0x30f0('0x2d')](_0x57a55f[_0x30f0('0x44')][_0x30f0('0x2d')]);_0x352478[_0x30f0('0x2c')]=qs[_0x30f0('0x2c')](_0x57a55f[_0x30f0('0x44')][_0x30f0('0x2c')]);}_0x352478[_0x30f0('0x4c')]=qs[_0x30f0('0x4d')](_0x57a55f[_0x30f0('0x44')][_0x30f0('0x4d')]);_0x352478['where']=qs['filters'](_[_0x30f0('0x4f')](_0x57a55f[_0x30f0('0x44')],_0xcff735['filters']));_0x352478[_0x30f0('0x50')][_0x30f0('0x68')]=_0x2fed0b['id'];if(_0x57a55f[_0x30f0('0x44')][_0x30f0('0x69')]){_0x352478[_0x30f0('0x50')]=_[_0x30f0('0x52')](_0x352478[_0x30f0('0x50')],{'$or':_[_0x30f0('0x3e')](_0x352478['attributes'],function(_0x34f620){var _0x372c0e={};_0x372c0e[_0x34f620]={'$like':'%'+_0x57a55f[_0x30f0('0x44')][_0x30f0('0x69')]+'%'};return _0x372c0e;})});}_0x352478=_[_0x30f0('0x52')]({},_0x352478,_0x57a55f[_0x30f0('0x53')]);return db[_0x30f0('0x6d')][_0x30f0('0x2f')]({'where':_0x352478[_0x30f0('0x50')]})[_0x30f0('0x34')](function(_0x109af5){_0x414b30[_0x30f0('0x2f')]=_0x109af5;if(_0x57a55f[_0x30f0('0x44')][_0x30f0('0x58')]){_0x352478['include']=[{'all':!![]}];}return db[_0x30f0('0x6d')]['findAll'](_0x352478);})[_0x30f0('0x34')](function(_0x3a2ace){_0x414b30['rows']=_0x3a2ace;return _0x414b30;});}})[_0x30f0('0x34')](respondWithFilteredResult(_0x2b2ebb,_0x352478))[_0x30f0('0x28')](handleError(_0x2b2ebb,null));};exports['removeAnswers']=function(_0x1b3324,_0x20cbd7,_0x1da86e){return db[_0x30f0('0x3f')][_0x30f0('0x5f')]({'where':{'id':_0x1b3324['params']['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x20cbd7,null))[_0x30f0('0x34')](function(_0x396b49){if(_0x396b49){return _0x396b49[_0x30f0('0x6f')](_0x1b3324['query'][_0x30f0('0x6b')]);}})[_0x30f0('0x34')](respondWithStatusCode(_0x20cbd7,null))['catch'](handleError(_0x20cbd7,null));};exports[_0x30f0('0x70')]=function(_0x10087b,_0x488c63,_0x318dab){return db[_0x30f0('0x3f')][_0x30f0('0x5f')]({'where':{'id':_0x10087b[_0x30f0('0x63')]['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x488c63,null))[_0x30f0('0x34')](function(_0x5419d0){if(_0x5419d0){return _0x5419d0[_0x30f0('0x70')](_0x10087b['body'][_0x30f0('0x6b')],_[_0x30f0('0x71')](_0x10087b[_0x30f0('0x5b')],[_0x30f0('0x6b'),'id'])||{})[_0x30f0('0x72')](function(_0x2bc821){for(var _0xb6e51f=0x0;_0xb6e51f<_0x10087b[_0x30f0('0x5b')][_0x30f0('0x6b')][_0x30f0('0x49')];_0xb6e51f+=0x1){socket[_0x30f0('0x73')](_0x30f0('0x74'),{'UserId':Number(_0x10087b['body'][_0x30f0('0x6b')][_0xb6e51f]),'WhatsappAccountId':Number(_0x10087b[_0x30f0('0x63')]['id'])});}return _0x2bc821;});}})[_0x30f0('0x34')](respondWithResult(_0x488c63,null))[_0x30f0('0x28')](handleError(_0x488c63,null));};exports[_0x30f0('0x75')]=function(_0x43822a,_0x395307,_0x1ed870){return db[_0x30f0('0x3f')][_0x30f0('0x5f')]({'where':{'id':_0x43822a[_0x30f0('0x63')]['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x395307,null))['then'](function(_0x41318f){if(_0x41318f){return _0x41318f[_0x30f0('0x75')](_0x43822a[_0x30f0('0x44')][_0x30f0('0x6b')])[_0x30f0('0x34')](function(){if(_['isArray'](_0x43822a[_0x30f0('0x44')]['ids'])){for(var _0x12e6c1=0x0;_0x12e6c1<_0x43822a['query']['ids'][_0x30f0('0x49')];_0x12e6c1+=0x1){socket[_0x30f0('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x43822a[_0x30f0('0x44')][_0x30f0('0x6b')][_0x12e6c1]),'WhatsappAccountId':Number(_0x43822a[_0x30f0('0x63')]['id'])});}}else{socket['emit'](_0x30f0('0x76'),{'UserId':Number(_0x43822a[_0x30f0('0x44')]['ids']),'WhatsappAccountId':Number(_0x43822a['params']['id'])});}});}})[_0x30f0('0x34')](respondWithStatusCode(_0x395307,null))[_0x30f0('0x28')](handleError(_0x395307,null));};exports[_0x30f0('0x77')]=function(_0x3d0c78,_0x4e7dc3,_0x46c572){var _0x2dac50={};var _0x5be3d6={};var _0x2eea5c;var _0x314fb5;return db[_0x30f0('0x3f')][_0x30f0('0x67')]({'where':{'id':_0x3d0c78[_0x30f0('0x63')]['id']}})['then'](handleEntityNotFound(_0x4e7dc3,null))[_0x30f0('0x34')](function(_0x59ec5d){if(_0x59ec5d){_0x2eea5c=_0x59ec5d;_0x5be3d6[_0x30f0('0x43')]=_[_0x30f0('0x45')](db['User']['rawAttributes']);_0x5be3d6[_0x30f0('0x44')]=_['keys'](_0x3d0c78[_0x30f0('0x44')]);_0x5be3d6[_0x30f0('0x4e')]=_[_0x30f0('0x47')](_0x5be3d6['model'],_0x5be3d6[_0x30f0('0x44')]);_0x2dac50[_0x30f0('0x46')]=_[_0x30f0('0x47')](_0x5be3d6[_0x30f0('0x43')],qs[_0x30f0('0x48')](_0x3d0c78[_0x30f0('0x44')][_0x30f0('0x48')]));_0x2dac50[_0x30f0('0x46')]=_0x2dac50[_0x30f0('0x46')][_0x30f0('0x49')]?_0x2dac50[_0x30f0('0x46')]:_0x5be3d6[_0x30f0('0x43')];_0x2dac50['order']=qs[_0x30f0('0x4d')](_0x3d0c78[_0x30f0('0x44')][_0x30f0('0x4d')]);_0x2dac50[_0x30f0('0x50')]=qs['filters'](_['pick'](_0x3d0c78[_0x30f0('0x44')],_0x5be3d6[_0x30f0('0x4e')]));if(_0x3d0c78[_0x30f0('0x44')][_0x30f0('0x69')]){_0x2dac50['where']=_[_0x30f0('0x52')](_0x2dac50[_0x30f0('0x50')],{'$or':_[_0x30f0('0x3e')](_0x2dac50['attributes'],function(_0x2d9c87){var _0x2e0037={};_0x2e0037[_0x2d9c87]={'$like':'%'+_0x3d0c78[_0x30f0('0x44')]['filter']+'%'};return _0x2e0037;})});}_0x2dac50=_[_0x30f0('0x52')]({},_0x2dac50,_0x3d0c78[_0x30f0('0x53')]);return _0x2eea5c[_0x30f0('0x77')](_0x2dac50);}})[_0x30f0('0x34')](function(_0x5c3956){if(_0x5c3956){_0x314fb5=_0x5c3956[_0x30f0('0x49')];if(!_0x3d0c78[_0x30f0('0x44')][_0x30f0('0x4a')](_0x30f0('0x4b'))){_0x2dac50[_0x30f0('0x2d')]=qs[_0x30f0('0x2d')](_0x3d0c78[_0x30f0('0x44')][_0x30f0('0x2d')]);_0x2dac50[_0x30f0('0x2c')]=qs[_0x30f0('0x2c')](_0x3d0c78[_0x30f0('0x44')]['offset']);}return _0x2eea5c['getAgents'](_0x2dac50);}})[_0x30f0('0x34')](function(_0x6e295e){if(_0x6e295e){return _0x6e295e?{'count':_0x314fb5,'rows':_0x6e295e}:null;}})[_0x30f0('0x34')](respondWithResult(_0x4e7dc3,null))[_0x30f0('0x28')](handleError(_0x4e7dc3,null));};exports['addApplications']=function(_0x227099,_0x343a33){var _0x23b996=_0x227099['params']['id'];var _0x52abc8=_0x227099['body'];var _0x3d9a19=0xc8;var _0x3e9488=null;return db[_0x30f0('0x78')][_0x30f0('0x79')]({'isolationLevel':db[_0x30f0('0x78')]['Transaction']['ISOLATION_LEVELS'][_0x30f0('0x7a')]},function(_0xdac6ff){return db[_0x30f0('0x3f')][_0x30f0('0x67')]({'where':{'id':_0x23b996},'transaction':_0xdac6ff})[_0x30f0('0x34')](function(_0x350c1b){if(_0x350c1b){return db[_0x30f0('0x7b')][_0x30f0('0x35')]({'where':{'WhatsappAccountId':_0x23b996},'transaction':_0xdac6ff})['then'](function(){var _0x3458ce=_[_0x30f0('0x3e')](_0x52abc8,function(_0xeae9f7){_0xeae9f7[_0x30f0('0x68')]=_0x23b996;return _0xeae9f7;});return db[_0x30f0('0x7b')][_0x30f0('0x7c')](_0x3458ce,{'transaction':_0xdac6ff});});}else{_0x3d9a19=0x194;_0x3e9488=[];}});})[_0x30f0('0x34')](function(){if(_0x3d9a19!==0x194){return db[_0x30f0('0x7b')][_0x30f0('0x7d')]({'where':{'WhatsappAccountId':_0x23b996},'order':'priority'})['then'](function(_0x5ad9ab){_0x3e9488=_0x5ad9ab;});}})[_0x30f0('0x28')](function(_0x362682){_0x3d9a19=0x1f4;logger[_0x30f0('0x24')](_0x362682['stack']);if(_0x362682['name']){delete _0x362682[_0x30f0('0x3b')];}_0x3e9488=_0x362682;})[_0x30f0('0x7e')](function(){if(_0x3e9488===null){_0x343a33[_0x30f0('0x39')](_0x3d9a19);}else{if(_0x3d9a19===0x1f4){_0x343a33['status'](_0x3d9a19)[_0x30f0('0x7f')](_0x3e9488);}else{_0x343a33['status'](_0x3d9a19)[_0x30f0('0x2b')](_0x3e9488);}}});};exports[_0x30f0('0x80')]=function(_0x53b020,_0x19af9e,_0x102eb1){var _0x5ca73d={};var _0x2f411c={};var _0x27c25c;var _0x3fdceb;return db[_0x30f0('0x3f')][_0x30f0('0x67')]({'where':{'id':_0x53b020['params']['id']}})[_0x30f0('0x34')](handleEntityNotFound(_0x19af9e,null))['then'](function(_0xc0aa55){if(_0xc0aa55){_0x27c25c=_0xc0aa55;_0x2f411c[_0x30f0('0x43')]=_[_0x30f0('0x45')](db[_0x30f0('0x7b')][_0x30f0('0x57')]);_0x2f411c[_0x30f0('0x44')]=_[_0x30f0('0x45')](_0x53b020[_0x30f0('0x44')]);_0x2f411c[_0x30f0('0x4e')]=_['intersection'](_0x2f411c[_0x30f0('0x43')],_0x2f411c['query']);_0x5ca73d[_0x30f0('0x46')]=_[_0x30f0('0x47')](_0x2f411c[_0x30f0('0x43')],qs[_0x30f0('0x48')](_0x53b020['query'][_0x30f0('0x48')]));_0x5ca73d[_0x30f0('0x46')]=_0x5ca73d[_0x30f0('0x46')][_0x30f0('0x49')]?_0x5ca73d[_0x30f0('0x46')]:_0x2f411c[_0x30f0('0x43')];_0x5ca73d[_0x30f0('0x4c')]=qs['sort'](_0x53b020[_0x30f0('0x44')]['sort']);_0x5ca73d[_0x30f0('0x50')]=qs[_0x30f0('0x4e')](_[_0x30f0('0x4f')](_0x53b020[_0x30f0('0x44')],_0x2f411c[_0x30f0('0x4e')]));if(_0x53b020['query'][_0x30f0('0x69')]){_0x5ca73d[_0x30f0('0x50')]=_[_0x30f0('0x52')](_0x5ca73d[_0x30f0('0x50')],{'$or':_[_0x30f0('0x3e')](_0x5ca73d[_0x30f0('0x46')],function(_0x1901b6){var _0xb2da31={};_0xb2da31[_0x1901b6]={'$like':'%'+_0x53b020[_0x30f0('0x44')][_0x30f0('0x69')]+'%'};return _0xb2da31;})});}_0x5ca73d=_[_0x30f0('0x52')]({},_0x5ca73d,_0x53b020[_0x30f0('0x53')]);return _0x27c25c[_0x30f0('0x80')](_0x5ca73d);}})[_0x30f0('0x34')](function(_0x36c34f){if(_0x36c34f){_0x3fdceb=_0x36c34f[_0x30f0('0x49')];if(!_0x53b020['query'][_0x30f0('0x4a')](_0x30f0('0x4b'))){_0x5ca73d[_0x30f0('0x2d')]=qs['limit'](_0x53b020[_0x30f0('0x44')][_0x30f0('0x2d')]);_0x5ca73d['offset']=qs[_0x30f0('0x2c')](_0x53b020[_0x30f0('0x44')][_0x30f0('0x2c')]);}return _0x27c25c[_0x30f0('0x80')](_0x5ca73d);}})[_0x30f0('0x34')](function(_0x1903f5){if(_0x1903f5){return _0x1903f5?{'count':_0x3fdceb,'rows':_0x1903f5}:null;}})[_0x30f0('0x34')](respondWithResult(_0x19af9e,null))[_0x30f0('0x28')](handleError(_0x19af9e,null));};exports[_0x30f0('0x81')]=function(_0x23c1af,_0x46de02,_0x77e69e){var _0x4dd98f={'channel':'whatsapp'};var _0x50e104=[];var _0x5e3d25=[];var _0x5a22f2={};return db[_0x30f0('0x3f')]['find']({'where':{'id':_0x23c1af[_0x30f0('0x63')]['id']},'include':[{'model':db[_0x30f0('0x7b')],'as':_0x30f0('0x82')}]})['then'](handleEntityNotFound(_0x46de02,null))[_0x30f0('0x34')](function(_0x1d5917){_0x4dd98f['account']=_0x1d5917;if(_0x4dd98f[_0x30f0('0x83')]&&_0x4dd98f[_0x30f0('0x83')]['type']===_0x30f0('0x84')&&_0x23c1af['body']['statuses']){if(_0x23c1af[_0x30f0('0x5b')]['statuses']['length']===0x0)return;if(_0x23c1af[_0x30f0('0x5b')][_0x30f0('0x85')][0x0][_0x30f0('0x86')]!==_0x30f0('0x87'))return;return db[_0x30f0('0x88')][_0x30f0('0x62')]({'read':!![],'readAt':_0x23c1af[_0x30f0('0x5b')][_0x30f0('0x85')][0x0][_0x30f0('0x89')]},{'where':{'messageId':_0x23c1af[_0x30f0('0x5b')]['statuses'][0x0][_0x30f0('0x8a')]},'individualHooks':!![]})[_0x30f0('0x34')](function(_0x35d4ce){return _0x46de02[_0x30f0('0x29')](0xc8)['json'](_0x35d4ce);});}_0x4dd98f['applications']=_['orderBy'](_0x1d5917[_0x30f0('0x82')],['priority'],['asc']);if(_0x4dd98f[_0x30f0('0x83')][_0x30f0('0x82')]){delete _0x4dd98f[_0x30f0('0x83')]['Applications'];}return db[_0x30f0('0x8b')][_0x30f0('0x64')]()[_0x30f0('0x34')](function(_0x2118e6){if(!_0x2118e6){throw new db[(_0x30f0('0x8c'))][(_0x30f0('0x8d'))](_0x30f0('0x8e'));}_0x50e104=_[_0x30f0('0x8f')](_[_0x30f0('0x45')](_0x2118e6),[_0x30f0('0x90'),'updatedAt']);_0x5e3d25=_[_0x30f0('0x8f')](_[_0x30f0('0x45')](_0x2118e6),[_0x30f0('0x90'),'updatedAt',_0x30f0('0x91'),_0x30f0('0x92')]);_0x4dd98f[_0x30f0('0x5b')]={'mapKey':_0x30f0('0x93')};if(_0x4dd98f[_0x30f0('0x83')]&&_0x4dd98f[_0x30f0('0x83')][_0x30f0('0x41')]==='twilio'){_0x4dd98f['body'][_0x30f0('0x94')]=_0x23c1af['body']['From'][_0x30f0('0x95')](_0x30f0('0x96'),'');_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x5b')]=_0x23c1af[_0x30f0('0x5b')]['Body'];_0x4dd98f['body'][_0x30f0('0x97')]=_0x23c1af['body'][_0x30f0('0x98')];}if(_0x4dd98f[_0x30f0('0x83')]&&_0x4dd98f['account'][_0x30f0('0x41')]==='sinch'){_0x4dd98f[_0x30f0('0x5b')]['from']=_0x23c1af[_0x30f0('0x5b')][_0x30f0('0x99')][0x0][_0x30f0('0x94')];_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x5b')]=_0x23c1af[_0x30f0('0x5b')][_0x30f0('0x99')][0x0][_0x30f0('0x26')][_0x30f0('0x5b')];_0x4dd98f['body'][_0x30f0('0x97')]=_0x23c1af['body'][_0x30f0('0x99')][0x0][_0x30f0('0x8a')];}if(_0x4dd98f[_0x30f0('0x5b')]['id']){delete _0x4dd98f[_0x30f0('0x5b')]['id'];}if(_['isNil'](_0x4dd98f['body'][_0x30f0('0x94')])){throw new db[(_0x30f0('0x8c'))][(_0x30f0('0x8d'))](_0x30f0('0x9a'));}if(_[_0x30f0('0x9b')](_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x5b')])||_0x4dd98f['body'][_0x30f0('0x5b')]===''){throw new db['Sequelize'][(_0x30f0('0x8d'))](_0x30f0('0x9c'));}if(_[_0x30f0('0x9b')](_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x9d')])){throw new db[(_0x30f0('0x8c'))][(_0x30f0('0x8d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e3d25);}if(!_[_0x30f0('0x9e')](_0x5e3d25,_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x9d')])){throw new db[(_0x30f0('0x8c'))][(_0x30f0('0x8d'))](_0x30f0('0x9f')+_0x5e3d25);}_0x5a22f2[_0x4dd98f['body'][_0x30f0('0x9d')]]=_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x94')];return db[_0x30f0('0xa0')][_0x30f0('0x5f')]({'where':{'id':_0x4dd98f[_0x30f0('0x83')][_0x30f0('0x92')]},'include':[{'model':db[_0x30f0('0x8b')],'as':_0x30f0('0xa1'),'where':_0x5a22f2,'limit':0x1,'order':[[_0x30f0('0xa2'),_0x30f0('0xa3')]]}]});})[_0x30f0('0x34')](handleEntityNotFound(_0x46de02,null))[_0x30f0('0x34')](function(_0x2c207c){if(_0x2c207c){_0x4dd98f[_0x30f0('0xa4')]=_[_0x30f0('0x71')](_0x2c207c,[_0x30f0('0xa1')]);if(_0x2c207c[_0x30f0('0xa1')][_0x30f0('0x49')]){return _0x2c207c[_0x30f0('0xa1')][0x0];}var _0x1cd9b8=_[_0x30f0('0xa5')](_0x4dd98f[_0x30f0('0x5b')],{'firstName':_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x94')],'ListId':_0x2c207c['id']});_0x1cd9b8[_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x9d')]]=_0x4dd98f['body'][_0x30f0('0x94')];return db['CmContact'][_0x30f0('0x5a')](_0x1cd9b8,{'fields':_0x50e104,'raw':!![]});}})['then'](handleEntityNotFound(_0x46de02,null))[_0x30f0('0x34')](function(_0x572618){if(_0x572618){_0x4dd98f[_0x30f0('0xa6')]=_0x572618;var _0x434631={'ContactId':_0x572618['id'],'phone':_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0x94')],'WhatsappAccountId':_0x23c1af[_0x30f0('0x63')]['id']};var _0xaac97b={'ContactId':_0x572618['id'],'WhatsappAccountId':_0x23c1af[_0x30f0('0x63')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x30f0('0x5f')]({'where':_0xaac97b})['then'](function(_0x12ed46){if(_0x12ed46){return[_0x12ed46,![]];}return db[_0x30f0('0xa7')][_0x30f0('0x5a')](_0x434631)['then'](function(_0x1e4390){return[_0x1e4390,!![]];});});}})[_0x30f0('0x72')](function(_0x595de1,_0x5799d9){_0x4dd98f[_0x30f0('0xa8')]=_0x595de1[_0x30f0('0x36')]({'plain':!![]});_0x4dd98f['interaction'][_0x30f0('0xa9')]=![];if(_0x5799d9){if(_0x4dd98f[_0x30f0('0x83')]['autoclose']){_0x4dd98f[_0x30f0('0xaa')][_0x30f0('0xab')]({'id':0x0,'priority':_0x4dd98f[_0x30f0('0xaa')][_0x30f0('0x49')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x30f0('0xac')});}_0x4dd98f[_0x30f0('0xa8')][_0x30f0('0xa9')]=!![];}return db[_0x30f0('0x88')][_0x30f0('0x5a')]({'phone':_0x4dd98f['body']['from'],'messageId':_0x4dd98f[_0x30f0('0x5b')]['messageId'],'body':_0x4dd98f[_0x30f0('0x5b')]['body'],'WhatsappAccountId':_0x23c1af[_0x30f0('0x63')]['id'],'WhatsappInteractionId':_0x595de1['id'],'direction':'in','ContactId':_0x595de1[_0x30f0('0xad')],'AttachmentId':_0x4dd98f[_0x30f0('0x5b')][_0x30f0('0xae')]});})[_0x30f0('0x34')](function(_0x1ac427){_0x4dd98f['message']=_0x1ac427;if(_0x4dd98f[_0x30f0('0xa8')][_0x30f0('0xaf')]){return db[_0x30f0('0xb0')][_0x30f0('0x5f')]({'attributes':['id',_0x30f0('0x3b')],'where':{'id':_0x4dd98f[_0x30f0('0xa8')][_0x30f0('0xaf')]}})['then'](function(_0x1cee16){if(_0x1cee16){_0x4dd98f[_0x30f0('0xaa')][_0x30f0('0xb1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1cee16[_0x30f0('0x3b')]+','+(_0x4dd98f[_0x30f0('0x83')][_0x30f0('0xb2')]||0xa),'interval':_0x30f0('0xac')});}return respondWithRpcPromise(_0x30f0('0xb3'),'startRouting',_0x4dd98f);});}return respondWithRpcPromise(_0x30f0('0xb3'),_0x30f0('0xb4'),_0x4dd98f);})['then'](function(_0x1cd635){if(_0x1cd635){var _0x6dc273=0xc8;var _0xf82596=_0x30f0('0xb5');logger[_0x30f0('0xb6')](_0x30f0('0x22'),_0xf82596,_0x6dc273,_0x30f0('0xb7'));logger[_0x30f0('0xb8')](_0x30f0('0xb9'),_0xf82596,_0x6dc273,'entity\x20found',JSON[_0x30f0('0x23')](_0x1cd635));if(_0x4dd98f[_0x30f0('0x83')]['type']===_0x30f0('0xba')){return _0x46de02[_0x30f0('0x29')](_0x6dc273)[_0x30f0('0x30')](_0x30f0('0xbb'),_0x30f0('0xbc'))['send']('\x0a');}else{return _0x46de02[_0x30f0('0x29')](_0x6dc273)[_0x30f0('0x2b')](_0x1cd635);}}});})['catch'](handleError(_0x46de02,null));};exports['send']=function(_0x4fce17,_0x54c837,_0x1c4fc5){var _0x1ef702,_0xc2c255,_0x33c413;if(_[_0x30f0('0x9b')](_0x4fce17[_0x30f0('0x5b')][_0x30f0('0x5b')])||_0x4fce17[_0x30f0('0x5b')][_0x30f0('0x5b')]===''){throw new db[(_0x30f0('0x8c'))]['ValidationError'](_0x30f0('0x9c'));}if(_['isNil'](_0x4fce17['body']['to'])){throw new db['Sequelize']['ValidationError'](_0x30f0('0xbd'));}_0x1ef702=_0x4fce17['body']['to'];return db[_0x30f0('0x3f')]['find']({'where':{'id':_0x4fce17[_0x30f0('0x63')]['id']},'include':[{'model':db[_0x30f0('0xa0')],'as':'List','include':[{'model':db[_0x30f0('0x8b')],'as':'Contacts','where':{'mobile':_0x1ef702},'limit':0x1,'order':[[_0x30f0('0xa2'),_0x30f0('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x54c837,null))[_0x30f0('0x34')](function(_0x157d45){if(_0x157d45&&_0x157d45['List']){_0xc2c255=_0x157d45['get']({'plain':!![]});if(_0xc2c255[_0x30f0('0xbe')]&&_0xc2c255['List'][_0x30f0('0xa1')][_0x30f0('0x49')]){return _0xc2c255[_0x30f0('0xbe')][_0x30f0('0xa1')][0x0];}return db['CmContact'][_0x30f0('0x5a')](_[_0x30f0('0xa5')](_0x4fce17[_0x30f0('0x5b')],{'firstName':_0x1ef702,'mobile':_0x1ef702,'phone':_0x1ef702,'ListId':_0xc2c255[_0x30f0('0x92')]}));}})[_0x30f0('0x34')](handleEntityNotFound(_0x54c837,null))[_0x30f0('0x34')](function(_0x13a2fd){if(_0x13a2fd){_0x33c413=_0x13a2fd;return db['WhatsappInteraction'][_0x30f0('0x5f')]({'where':{'ContactId':_0x33c413['id'],'closed':![],'WhatsappAccountId':_0xc2c255['id']}})[_0x30f0('0x34')](function(_0x372518){if(_0x372518){return[_0x372518,![]];}return db['WhatsappInteraction'][_0x30f0('0x5a')]({'UserId':_0x4fce17[_0x30f0('0x5c')]['id'],'ContactId':_0x33c413['id'],'WhatsappAccountId':_0xc2c255['id'],'phone':_0x1ef702,'firstMsgDirection':_0x30f0('0xbf'),'Messages':[_[_0x30f0('0x52')](_0x4fce17[_0x30f0('0x5b')],{'read':![],'body':_0x4fce17['body'][_0x30f0('0x5b')],'phone':_0x1ef702,'WhatsappAccountId':_0xc2c255['id'],'UserId':_0x4fce17['user']['id'],'ContactId':_0x33c413['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x30f0('0xc0')}]})[_0x30f0('0x34')](function(_0x2adcd0){return[_0x2adcd0,!![]];});});}})[_0x30f0('0x72')](function(_0x36b828,_0x335c38){if(_0x335c38){return _0x36b828;}return db['WhatsappMessage'][_0x30f0('0x5a')](_[_0x30f0('0x52')](_0x4fce17['body'],{'read':![],'body':_0x4fce17[_0x30f0('0x5b')][_0x30f0('0x5b')],'phone':_0x1ef702,'WhatsappAccountId':_0xc2c255['id'],'WhatsappInteractionId':_0x36b828['id'],'UserId':_0x4fce17[_0x30f0('0x5c')]['id'],'ContactId':_0x33c413['id']}))[_0x30f0('0x34')](function(_0x91dce6){_0x36b828['dataValues'][_0x30f0('0xc0')]=[];_0x36b828[_0x30f0('0xc1')][_0x30f0('0xc0')][_0x30f0('0xab')](_0x91dce6[_0x30f0('0xc1')]);return _0x36b828;});})[_0x30f0('0x34')](respondWithResult(_0x54c837,null))['catch'](handleError(_0x54c837,null));}; \ No newline at end of file +var _0x6ac1=['removeAnswers','addAgents','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','stack','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','timestamp','message_id','applications','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','list','omit','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','WhatsappMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','push','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','WhatsappAccount','include','rows','show','params','includeAll','find','create','user','UserProfileSection','userProfileId','autoAssociation','body','describe','WhatsappAccountId','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit'];(function(_0x405635,_0x5a99a6){var _0x4eb141=function(_0x2addc1){while(--_0x2addc1){_0x405635['push'](_0x405635['shift']());}};_0x4eb141(++_0x5a99a6);}(_0x6ac1,0x1e0));var _0x16ac=function(_0x3d0e15,_0xdb46ae){_0x3d0e15=_0x3d0e15-0x0;var _0x4723bc=_0x6ac1[_0x3d0e15];return _0x4723bc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x16ac('0x0'));var rp=require('request-promise');var moment=require(_0x16ac('0x1'));var BPromise=require(_0x16ac('0x2'));var Mustache=require(_0x16ac('0x3'));var util=require('util');var path=require(_0x16ac('0x4'));var sox=require(_0x16ac('0x5'));var csv=require(_0x16ac('0x6'));var ejs=require(_0x16ac('0x7'));var fs=require('fs');var fs_extra=require(_0x16ac('0x8'));var _=require('lodash');var squel=require(_0x16ac('0x9'));var crypto=require('crypto');var jsforce=require(_0x16ac('0xa'));var deskjs=require(_0x16ac('0xb'));var toCsv=require(_0x16ac('0x6'));var querystring=require('querystring');var Papa=require(_0x16ac('0xc'));var Redis=require(_0x16ac('0xd'));var authService=require(_0x16ac('0xe'));var qs=require(_0x16ac('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x16ac('0x10'))('api');var utils=require(_0x16ac('0x11'));var config=require(_0x16ac('0x12'));var licenseUtil=require(_0x16ac('0x13'));var db=require(_0x16ac('0x14'))['db'];config[_0x16ac('0x15')]=_[_0x16ac('0x16')](config[_0x16ac('0x15')],{'host':_0x16ac('0x17'),'port':0x18eb});var socket=require(_0x16ac('0x18'))(new Redis(config[_0x16ac('0x15')]));require(_0x16ac('0x19'))[_0x16ac('0x1a')](socket);var jayson=require(_0x16ac('0x1b'));var client=jayson[_0x16ac('0x1c')][_0x16ac('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xe4aa67,_0x852805,_0x2ef0aa,_0x2de545){return new BPromise(function(_0x29ac4a,_0x7a551e){var _0xc785f5=_0x2de545||client;return _0xc785f5[_0x16ac('0x1e')](_0xe4aa67,_0x2ef0aa)[_0x16ac('0x1f')](function(_0x53ab41){logger[_0x16ac('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x852805,_0x16ac('0x21'));logger['debug'](_0x16ac('0x22'),_0x852805,_0x16ac('0x21'),JSON[_0x16ac('0x23')](_0x53ab41));if(_0x53ab41[_0x16ac('0x24')]){if(_0x53ab41[_0x16ac('0x24')][_0x16ac('0x25')]===0x1f4){logger['error'](_0x16ac('0x26'),_0x852805,_0x53ab41[_0x16ac('0x24')]['message']);return _0x7a551e(_0x53ab41['error'][_0x16ac('0x27')]);}logger[_0x16ac('0x24')](_0x16ac('0x26'),_0x852805,_0x53ab41[_0x16ac('0x24')]['message']);return _0x29ac4a(_0x53ab41['error'][_0x16ac('0x27')]);}else{logger['info'](_0x16ac('0x26'),_0x852805,'request\x20sent');_0x29ac4a(_0x53ab41[_0x16ac('0x28')][_0x16ac('0x27')]);}})[_0x16ac('0x29')](function(_0x3ad2c3){logger[_0x16ac('0x24')](_0x16ac('0x26'),_0x852805,_0x3ad2c3);_0x7a551e(_0x3ad2c3);});});}function respondWithStatusCode(_0x4c0536,_0x589bd0){_0x589bd0=_0x589bd0||0xcc;return function(_0x265ffa){if(_0x265ffa){return _0x4c0536['sendStatus'](_0x589bd0);}return _0x4c0536[_0x16ac('0x2a')](_0x589bd0)[_0x16ac('0x2b')]();};}function respondWithResult(_0x18dabb,_0x19e3bf){_0x19e3bf=_0x19e3bf||0xc8;return function(_0x282a1a){if(_0x282a1a){return _0x18dabb[_0x16ac('0x2a')](_0x19e3bf)[_0x16ac('0x2c')](_0x282a1a);}};}function respondWithFilteredResult(_0x4f7f3a,_0x81347f){return function(_0x58744a){if(_0x58744a){var _0x3e8864=typeof _0x81347f[_0x16ac('0x2d')]===_0x16ac('0x2e')&&typeof _0x81347f['limit']===_0x16ac('0x2e');var _0x1a454d=_0x58744a[_0x16ac('0x2f')];var _0xa9829c=_0x3e8864?0x0:_0x81347f[_0x16ac('0x2d')];var _0x4bf787=_0x3e8864?_0x58744a[_0x16ac('0x2f')]:_0x81347f['offset']+_0x81347f[_0x16ac('0x30')];var _0x4294bd;if(_0x4bf787>=_0x1a454d){_0x4bf787=_0x1a454d;_0x4294bd=0xc8;}else{_0x4294bd=0xce;}_0x4f7f3a[_0x16ac('0x2a')](_0x4294bd);return _0x4f7f3a[_0x16ac('0x31')](_0x16ac('0x32'),_0xa9829c+'-'+_0x4bf787+'/'+_0x1a454d)[_0x16ac('0x2c')](_0x58744a);}return null;};}function patchUpdates(_0x3ea497){return function(_0x53d019){try{jsonpatch[_0x16ac('0x33')](_0x53d019,_0x3ea497,!![]);}catch(_0x372dea){return BPromise[_0x16ac('0x34')](_0x372dea);}return _0x53d019['save']();};}function saveUpdates(_0x3ec757,_0x4cc599){return function(_0x4a12ca){if(_0x4a12ca){return _0x4a12ca[_0x16ac('0x35')](_0x3ec757)[_0x16ac('0x1f')](function(_0x54d714){return _0x54d714;});}return null;};}function removeEntity(_0xc0fdc4,_0x4d0ce3){return function(_0x3fb6b7){if(_0x3fb6b7){return _0x3fb6b7[_0x16ac('0x36')]()[_0x16ac('0x1f')](function(){var _0x29809f=_0x3fb6b7[_0x16ac('0x37')]({'plain':!![]});var _0x2cd7db=_0x16ac('0x38');return db[_0x16ac('0x39')][_0x16ac('0x36')]({'where':{'type':_0x2cd7db,'resourceId':_0x29809f['id']}})[_0x16ac('0x1f')](function(){return _0x3fb6b7;});})[_0x16ac('0x1f')](function(){_0xc0fdc4[_0x16ac('0x2a')](0xcc)[_0x16ac('0x2b')]();});}};}function handleEntityNotFound(_0x4cfa4e,_0x5688f1){return function(_0x24b166){if(!_0x24b166){_0x4cfa4e[_0x16ac('0x3a')](0x194);}return _0x24b166;};}function handleError(_0x1a640d,_0x5be5a9){_0x5be5a9=_0x5be5a9||0x1f4;return function(_0x23f61d){logger[_0x16ac('0x24')](_0x23f61d['stack']);if(_0x23f61d[_0x16ac('0x3b')]){delete _0x23f61d['name'];}_0x1a640d['status'](_0x5be5a9)[_0x16ac('0x3c')](_0x23f61d);};}exports[_0x16ac('0x3d')]=function(_0x8a0add,_0x3fe698){var _0x103a06={'include':[{'model':db[_0x16ac('0x3e')],'as':_0x16ac('0x3f')}]},_0x39050d={},_0x45af11={'count':0x0,'rows':[]};var _0x81361b=_['map'](db['WhatsappAccount'][_0x16ac('0x40')],function(_0x44295b){return{'name':_0x44295b[_0x16ac('0x41')],'type':_0x44295b[_0x16ac('0x42')][_0x16ac('0x43')]};});_0x39050d['model']=_[_0x16ac('0x44')](_0x81361b,_0x16ac('0x3b'));_0x39050d[_0x16ac('0x45')]=_[_0x16ac('0x46')](_0x8a0add[_0x16ac('0x45')]);_0x39050d[_0x16ac('0x47')]=_['intersection'](_0x39050d['model'],_0x39050d[_0x16ac('0x45')]);_0x103a06['attributes']=_[_0x16ac('0x48')](_0x39050d[_0x16ac('0x49')],qs[_0x16ac('0x4a')](_0x8a0add[_0x16ac('0x45')][_0x16ac('0x4a')]));_0x103a06[_0x16ac('0x4b')]=_0x103a06[_0x16ac('0x4b')][_0x16ac('0x4c')]?_0x103a06[_0x16ac('0x4b')]:_0x39050d[_0x16ac('0x49')];if(!_0x8a0add['query'][_0x16ac('0x4d')]('nolimit')){_0x103a06[_0x16ac('0x30')]=qs[_0x16ac('0x30')](_0x8a0add[_0x16ac('0x45')][_0x16ac('0x30')]);_0x103a06[_0x16ac('0x2d')]=qs[_0x16ac('0x2d')](_0x8a0add[_0x16ac('0x45')][_0x16ac('0x2d')]);}_0x103a06[_0x16ac('0x4e')]=qs[_0x16ac('0x4f')](_0x8a0add[_0x16ac('0x45')]['sort']);_0x103a06['where']=qs[_0x16ac('0x47')](_['pick'](_0x8a0add['query'],_0x39050d[_0x16ac('0x47')]),_0x81361b);if(_0x8a0add['query'][_0x16ac('0x50')]){_0x103a06['where']=_[_0x16ac('0x51')](_0x103a06[_0x16ac('0x52')],{'$or':_['map'](_0x81361b,function(_0x58c54e){if(_0x58c54e[_0x16ac('0x42')]!==_0x16ac('0x53')){var _0x5497aa={};_0x5497aa[_0x58c54e[_0x16ac('0x3b')]]={'$like':'%'+_0x8a0add[_0x16ac('0x45')][_0x16ac('0x50')]+'%'};return _0x5497aa;}})});}_0x103a06=_[_0x16ac('0x51')]({},_0x103a06,_0x8a0add[_0x16ac('0x54')]);var _0x2befd5={'where':_0x103a06['where']};return db[_0x16ac('0x55')][_0x16ac('0x2f')](_0x2befd5)[_0x16ac('0x1f')](function(_0x88ff0d){_0x45af11['count']=_0x88ff0d;if(_0x8a0add[_0x16ac('0x45')]['includeAll']){_0x103a06[_0x16ac('0x56')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x103a06);})[_0x16ac('0x1f')](function(_0x3464b9){_0x45af11[_0x16ac('0x57')]=_0x3464b9;return _0x45af11;})[_0x16ac('0x1f')](respondWithFilteredResult(_0x3fe698,_0x103a06))[_0x16ac('0x29')](handleError(_0x3fe698,null));};exports[_0x16ac('0x58')]=function(_0x2a7526,_0x3f9e8e){var _0x5b9935={'raw':![],'where':{'id':_0x2a7526[_0x16ac('0x59')]['id']},'include':[{'model':db[_0x16ac('0x3e')],'as':'mandatoryDispositionPause'}]},_0x55cead={};_0x55cead[_0x16ac('0x49')]=_[_0x16ac('0x46')](db[_0x16ac('0x55')][_0x16ac('0x40')]);_0x55cead[_0x16ac('0x45')]=_[_0x16ac('0x46')](_0x2a7526[_0x16ac('0x45')]);_0x55cead[_0x16ac('0x47')]=_[_0x16ac('0x48')](_0x55cead[_0x16ac('0x49')],_0x55cead[_0x16ac('0x45')]);_0x5b9935[_0x16ac('0x4b')]=_[_0x16ac('0x48')](_0x55cead['model'],qs['fields'](_0x2a7526['query'][_0x16ac('0x4a')]));_0x5b9935['attributes']=_0x5b9935['attributes']['length']?_0x5b9935[_0x16ac('0x4b')]:_0x55cead[_0x16ac('0x49')];if(_0x2a7526[_0x16ac('0x45')][_0x16ac('0x5a')]){_0x5b9935[_0x16ac('0x56')]=[{'all':!![]}];}_0x5b9935=_[_0x16ac('0x51')]({},_0x5b9935,_0x2a7526['options']);return db[_0x16ac('0x55')][_0x16ac('0x5b')](_0x5b9935)[_0x16ac('0x1f')](handleEntityNotFound(_0x3f9e8e,null))['then'](respondWithResult(_0x3f9e8e,null))['catch'](handleError(_0x3f9e8e,null));};exports[_0x16ac('0x5c')]=function(_0x5c7c55,_0x1197ff){return db[_0x16ac('0x55')][_0x16ac('0x5c')](_0x5c7c55['body'],{})[_0x16ac('0x1f')](function(_0x1def91){var _0x549112=_0x5c7c55[_0x16ac('0x5d')][_0x16ac('0x37')]({'plain':!![]});if(!_0x549112)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x549112['role']===_0x16ac('0x5d')){var _0x5845e1=_0x1def91[_0x16ac('0x37')]({'plain':!![]});var _0x450a10=_0x16ac('0x38');return db[_0x16ac('0x5e')]['find']({'where':{'name':_0x450a10,'userProfileId':_0x549112[_0x16ac('0x5f')]},'raw':!![]})[_0x16ac('0x1f')](function(_0x5246ac){if(_0x5246ac&&_0x5246ac[_0x16ac('0x60')]===0x0){return db[_0x16ac('0x39')][_0x16ac('0x5c')]({'name':_0x5845e1[_0x16ac('0x3b')],'resourceId':_0x5845e1['id'],'type':_0x5246ac['name'],'sectionId':_0x5246ac['id']},{})['then'](function(){return _0x1def91;});}else{return _0x1def91;}})['catch'](function(_0xcd2e15){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcd2e15);throw _0xcd2e15;});}return _0x1def91;})[_0x16ac('0x1f')](respondWithResult(_0x1197ff,0xc9))[_0x16ac('0x29')](handleError(_0x1197ff,null));};exports[_0x16ac('0x35')]=function(_0x36171d,_0x3e8305){if(_0x36171d['body']['id']){delete _0x36171d[_0x16ac('0x61')]['id'];}return db['WhatsappAccount'][_0x16ac('0x5b')]({'where':{'id':_0x36171d[_0x16ac('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x16ac('0x3f')}]})[_0x16ac('0x1f')](handleEntityNotFound(_0x3e8305,null))['then'](saveUpdates(_0x36171d[_0x16ac('0x61')],null))['then'](respondWithResult(_0x3e8305,null))[_0x16ac('0x29')](handleError(_0x3e8305,null));};exports['destroy']=function(_0x4808da,_0x2c49db){return db[_0x16ac('0x55')][_0x16ac('0x5b')]({'where':{'id':_0x4808da[_0x16ac('0x59')]['id']}})['then'](handleEntityNotFound(_0x2c49db,null))[_0x16ac('0x1f')](removeEntity(_0x2c49db,null))[_0x16ac('0x29')](handleError(_0x2c49db,null));};exports[_0x16ac('0x62')]=function(_0xbb8600,_0x11a9bc){return db['WhatsappAccount'][_0x16ac('0x62')]()['then'](respondWithResult(_0x11a9bc,null))[_0x16ac('0x29')](handleError(_0x11a9bc,null));};exports['addDisposition']=function(_0x228cf6,_0x2618ed,_0x602f2f){if(_0x228cf6[_0x16ac('0x61')]['id']){delete _0x228cf6['body']['id'];}return db[_0x16ac('0x55')][_0x16ac('0x5b')]({'where':{'id':_0x228cf6[_0x16ac('0x59')]['id']}})[_0x16ac('0x1f')](handleEntityNotFound(_0x2618ed,null))[_0x16ac('0x1f')](function(_0x496ddf){if(_0x496ddf){_0x228cf6[_0x16ac('0x61')][_0x16ac('0x63')]=_0x496ddf['id'];return db[_0x16ac('0x64')][_0x16ac('0x5c')](_0x228cf6[_0x16ac('0x61')]);}})[_0x16ac('0x1f')](respondWithResult(_0x2618ed,null))[_0x16ac('0x29')](handleError(_0x2618ed,null));};exports[_0x16ac('0x65')]=function(_0x2d40af,_0x433655,_0x20047c){var _0x3b320e={'raw':![],'where':{}};var _0x441296={};var _0x44b489={'count':0x0,'rows':[]};return db[_0x16ac('0x55')][_0x16ac('0x66')]({'where':{'id':_0x2d40af[_0x16ac('0x59')]['id']}})[_0x16ac('0x1f')](handleEntityNotFound(_0x433655,null))['then'](function(_0xb38db4){if(_0xb38db4){_0x441296['model']=_[_0x16ac('0x46')](db[_0x16ac('0x64')][_0x16ac('0x40')]);_0x441296[_0x16ac('0x45')]=_['keys'](_0x2d40af[_0x16ac('0x45')]);_0x441296[_0x16ac('0x47')]=_[_0x16ac('0x48')](_0x441296[_0x16ac('0x49')],_0x441296['query']);_0x3b320e[_0x16ac('0x4b')]=_[_0x16ac('0x48')](_0x441296[_0x16ac('0x49')],qs[_0x16ac('0x4a')](_0x2d40af['query']['fields']));_0x3b320e['attributes']=_0x3b320e[_0x16ac('0x4b')][_0x16ac('0x4c')]?_0x3b320e[_0x16ac('0x4b')]:_0x441296[_0x16ac('0x49')];if(!_0x2d40af[_0x16ac('0x45')][_0x16ac('0x4d')]('nolimit')){_0x3b320e[_0x16ac('0x30')]=qs[_0x16ac('0x30')](_0x2d40af['query']['limit']);_0x3b320e[_0x16ac('0x2d')]=qs[_0x16ac('0x2d')](_0x2d40af['query'][_0x16ac('0x2d')]);}_0x3b320e[_0x16ac('0x4e')]=qs[_0x16ac('0x4f')](_0x2d40af[_0x16ac('0x45')]['sort']);_0x3b320e[_0x16ac('0x52')]=qs[_0x16ac('0x47')](_[_0x16ac('0x67')](_0x2d40af[_0x16ac('0x45')],_0x441296[_0x16ac('0x47')]));_0x3b320e['where']['WhatsappAccountId']=_0xb38db4['id'];if(_0x2d40af[_0x16ac('0x45')]['filter']){_0x3b320e['where']=_[_0x16ac('0x51')](_0x3b320e[_0x16ac('0x52')],{'$or':_['map'](_0x3b320e['attributes'],function(_0x5a71fb){var _0x2bbda9={};_0x2bbda9[_0x5a71fb]={'$like':'%'+_0x2d40af['query'][_0x16ac('0x50')]+'%'};return _0x2bbda9;})});}_0x3b320e=_[_0x16ac('0x51')]({},_0x3b320e,_0x2d40af[_0x16ac('0x54')]);return db['Disposition']['count']({'where':_0x3b320e[_0x16ac('0x52')]})[_0x16ac('0x1f')](function(_0x440282){_0x44b489['count']=_0x440282;if(_0x2d40af[_0x16ac('0x45')][_0x16ac('0x5a')]){_0x3b320e['include']=[{'all':!![]}];}return db[_0x16ac('0x64')][_0x16ac('0x68')](_0x3b320e);})[_0x16ac('0x1f')](function(_0x259b47){_0x44b489[_0x16ac('0x57')]=_0x259b47;return _0x44b489;});}})[_0x16ac('0x1f')](respondWithFilteredResult(_0x433655,_0x3b320e))[_0x16ac('0x29')](handleError(_0x433655,null));};exports[_0x16ac('0x69')]=function(_0xf55fd0,_0x1b6a9a,_0x27854b){return db['WhatsappAccount'][_0x16ac('0x5b')]({'where':{'id':_0xf55fd0[_0x16ac('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b6a9a,null))[_0x16ac('0x1f')](function(_0x51a043){if(_0x51a043){return _0x51a043[_0x16ac('0x69')](_0xf55fd0[_0x16ac('0x45')][_0x16ac('0x6a')]);}})[_0x16ac('0x1f')](respondWithStatusCode(_0x1b6a9a,null))[_0x16ac('0x29')](handleError(_0x1b6a9a,null));};exports[_0x16ac('0x6b')]=function(_0x3338ea,_0x5e2aa2,_0x52bca1){if(_0x3338ea[_0x16ac('0x61')]['id']){delete _0x3338ea['body']['id'];}return db[_0x16ac('0x55')][_0x16ac('0x5b')]({'where':{'id':_0x3338ea[_0x16ac('0x59')]['id']}})[_0x16ac('0x1f')](handleEntityNotFound(_0x5e2aa2,null))[_0x16ac('0x1f')](function(_0x151ace){if(_0x151ace){_0x3338ea[_0x16ac('0x61')][_0x16ac('0x63')]=_0x151ace['id'];return db[_0x16ac('0x6c')]['create'](_0x3338ea['body']);}})['then'](respondWithResult(_0x5e2aa2,null))[_0x16ac('0x29')](handleError(_0x5e2aa2,null));};exports[_0x16ac('0x6d')]=function(_0x2ade76,_0xf46244,_0x322871){var _0x147a52={'raw':![],'where':{}};var _0x309228={};var _0x26cb8a={'count':0x0,'rows':[]};return db[_0x16ac('0x55')][_0x16ac('0x66')]({'where':{'id':_0x2ade76[_0x16ac('0x59')]['id']}})['then'](handleEntityNotFound(_0xf46244,null))['then'](function(_0x5a179b){if(_0x5a179b){_0x309228[_0x16ac('0x49')]=_[_0x16ac('0x46')](db[_0x16ac('0x6c')]['rawAttributes']);_0x309228[_0x16ac('0x45')]=_[_0x16ac('0x46')](_0x2ade76[_0x16ac('0x45')]);_0x309228[_0x16ac('0x47')]=_[_0x16ac('0x48')](_0x309228[_0x16ac('0x49')],_0x309228[_0x16ac('0x45')]);_0x147a52[_0x16ac('0x4b')]=_['intersection'](_0x309228[_0x16ac('0x49')],qs[_0x16ac('0x4a')](_0x2ade76[_0x16ac('0x45')][_0x16ac('0x4a')]));_0x147a52[_0x16ac('0x4b')]=_0x147a52[_0x16ac('0x4b')][_0x16ac('0x4c')]?_0x147a52[_0x16ac('0x4b')]:_0x309228[_0x16ac('0x49')];if(!_0x2ade76['query']['hasOwnProperty'](_0x16ac('0x6e'))){_0x147a52[_0x16ac('0x30')]=qs['limit'](_0x2ade76[_0x16ac('0x45')][_0x16ac('0x30')]);_0x147a52[_0x16ac('0x2d')]=qs[_0x16ac('0x2d')](_0x2ade76[_0x16ac('0x45')]['offset']);}_0x147a52[_0x16ac('0x4e')]=qs['sort'](_0x2ade76[_0x16ac('0x45')][_0x16ac('0x4f')]);_0x147a52[_0x16ac('0x52')]=qs[_0x16ac('0x47')](_[_0x16ac('0x67')](_0x2ade76['query'],_0x309228['filters']));_0x147a52['where']['WhatsappAccountId']=_0x5a179b['id'];if(_0x2ade76['query']['filter']){_0x147a52[_0x16ac('0x52')]=_[_0x16ac('0x51')](_0x147a52[_0x16ac('0x52')],{'$or':_[_0x16ac('0x44')](_0x147a52[_0x16ac('0x4b')],function(_0x54e87a){var _0x1dc355={};_0x1dc355[_0x54e87a]={'$like':'%'+_0x2ade76[_0x16ac('0x45')][_0x16ac('0x50')]+'%'};return _0x1dc355;})});}_0x147a52=_['merge']({},_0x147a52,_0x2ade76[_0x16ac('0x54')]);return db[_0x16ac('0x6c')]['count']({'where':_0x147a52[_0x16ac('0x52')]})[_0x16ac('0x1f')](function(_0x416667){_0x26cb8a['count']=_0x416667;if(_0x2ade76[_0x16ac('0x45')][_0x16ac('0x5a')]){_0x147a52[_0x16ac('0x56')]=[{'all':!![]}];}return db[_0x16ac('0x6c')][_0x16ac('0x68')](_0x147a52);})[_0x16ac('0x1f')](function(_0x1bbac1){_0x26cb8a[_0x16ac('0x57')]=_0x1bbac1;return _0x26cb8a;});}})[_0x16ac('0x1f')](respondWithFilteredResult(_0xf46244,_0x147a52))[_0x16ac('0x29')](handleError(_0xf46244,null));};exports[_0x16ac('0x6f')]=function(_0x522ca6,_0x127718,_0xa69237){return db[_0x16ac('0x55')][_0x16ac('0x5b')]({'where':{'id':_0x522ca6['params']['id']}})[_0x16ac('0x1f')](handleEntityNotFound(_0x127718,null))[_0x16ac('0x1f')](function(_0x27360e){if(_0x27360e){return _0x27360e[_0x16ac('0x6f')](_0x522ca6[_0x16ac('0x45')][_0x16ac('0x6a')]);}})[_0x16ac('0x1f')](respondWithStatusCode(_0x127718,null))[_0x16ac('0x29')](handleError(_0x127718,null));};exports['addAgents']=function(_0x39a79d,_0x5e4aae,_0x44ed7b){return db[_0x16ac('0x55')][_0x16ac('0x5b')]({'where':{'id':_0x39a79d[_0x16ac('0x59')]['id']}})[_0x16ac('0x1f')](handleEntityNotFound(_0x5e4aae,null))['then'](function(_0x5326f6){if(_0x5326f6){return _0x5326f6[_0x16ac('0x70')](_0x39a79d['body'][_0x16ac('0x6a')],_['omit'](_0x39a79d[_0x16ac('0x61')],['ids','id'])||{})[_0x16ac('0x71')](function(_0x32a9cc){for(var _0x57b458=0x0;_0x57b458<_0x39a79d[_0x16ac('0x61')][_0x16ac('0x6a')][_0x16ac('0x4c')];_0x57b458+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x39a79d[_0x16ac('0x61')][_0x16ac('0x6a')][_0x57b458]),'WhatsappAccountId':Number(_0x39a79d[_0x16ac('0x59')]['id'])});}return _0x32a9cc;});}})[_0x16ac('0x1f')](respondWithResult(_0x5e4aae,null))[_0x16ac('0x29')](handleError(_0x5e4aae,null));};exports[_0x16ac('0x72')]=function(_0x2630dc,_0x3e5bf4,_0x5bea0f){return db[_0x16ac('0x55')][_0x16ac('0x5b')]({'where':{'id':_0x2630dc['params']['id']}})['then'](handleEntityNotFound(_0x3e5bf4,null))['then'](function(_0x3f1ac9){if(_0x3f1ac9){return _0x3f1ac9[_0x16ac('0x72')](_0x2630dc[_0x16ac('0x45')]['ids'])[_0x16ac('0x1f')](function(){if(_[_0x16ac('0x73')](_0x2630dc[_0x16ac('0x45')]['ids'])){for(var _0x2e31cf=0x0;_0x2e31cf<_0x2630dc[_0x16ac('0x45')][_0x16ac('0x6a')][_0x16ac('0x4c')];_0x2e31cf+=0x1){socket[_0x16ac('0x74')](_0x16ac('0x75'),{'UserId':Number(_0x2630dc[_0x16ac('0x45')][_0x16ac('0x6a')][_0x2e31cf]),'WhatsappAccountId':Number(_0x2630dc[_0x16ac('0x59')]['id'])});}}else{socket[_0x16ac('0x74')](_0x16ac('0x75'),{'UserId':Number(_0x2630dc[_0x16ac('0x45')][_0x16ac('0x6a')]),'WhatsappAccountId':Number(_0x2630dc[_0x16ac('0x59')]['id'])});}});}})[_0x16ac('0x1f')](respondWithStatusCode(_0x3e5bf4,null))['catch'](handleError(_0x3e5bf4,null));};exports[_0x16ac('0x76')]=function(_0x2bd0a0,_0x5263ed,_0x4af2cd){var _0x567790={};var _0x1e385b={};var _0x3f0006;var _0x42bf65;return db['WhatsappAccount']['findOne']({'where':{'id':_0x2bd0a0[_0x16ac('0x59')]['id']}})[_0x16ac('0x1f')](handleEntityNotFound(_0x5263ed,null))[_0x16ac('0x1f')](function(_0xc73d1f){if(_0xc73d1f){_0x3f0006=_0xc73d1f;_0x1e385b[_0x16ac('0x49')]=_[_0x16ac('0x46')](db['User'][_0x16ac('0x40')]);_0x1e385b[_0x16ac('0x45')]=_[_0x16ac('0x46')](_0x2bd0a0['query']);_0x1e385b[_0x16ac('0x47')]=_[_0x16ac('0x48')](_0x1e385b[_0x16ac('0x49')],_0x1e385b[_0x16ac('0x45')]);_0x567790[_0x16ac('0x4b')]=_[_0x16ac('0x48')](_0x1e385b[_0x16ac('0x49')],qs[_0x16ac('0x4a')](_0x2bd0a0[_0x16ac('0x45')][_0x16ac('0x4a')]));_0x567790[_0x16ac('0x4b')]=_0x567790[_0x16ac('0x4b')][_0x16ac('0x4c')]?_0x567790['attributes']:_0x1e385b[_0x16ac('0x49')];_0x567790['order']=qs[_0x16ac('0x4f')](_0x2bd0a0[_0x16ac('0x45')]['sort']);_0x567790[_0x16ac('0x52')]=qs[_0x16ac('0x47')](_['pick'](_0x2bd0a0[_0x16ac('0x45')],_0x1e385b[_0x16ac('0x47')]));if(_0x2bd0a0[_0x16ac('0x45')][_0x16ac('0x50')]){_0x567790[_0x16ac('0x52')]=_[_0x16ac('0x51')](_0x567790[_0x16ac('0x52')],{'$or':_[_0x16ac('0x44')](_0x567790[_0x16ac('0x4b')],function(_0x202abc){var _0xea63c5={};_0xea63c5[_0x202abc]={'$like':'%'+_0x2bd0a0['query'][_0x16ac('0x50')]+'%'};return _0xea63c5;})});}_0x567790=_['merge']({},_0x567790,_0x2bd0a0['options']);return _0x3f0006['getAgents'](_0x567790);}})[_0x16ac('0x1f')](function(_0x3b7a88){if(_0x3b7a88){_0x42bf65=_0x3b7a88[_0x16ac('0x4c')];if(!_0x2bd0a0[_0x16ac('0x45')]['hasOwnProperty'](_0x16ac('0x6e'))){_0x567790[_0x16ac('0x30')]=qs[_0x16ac('0x30')](_0x2bd0a0[_0x16ac('0x45')][_0x16ac('0x30')]);_0x567790[_0x16ac('0x2d')]=qs[_0x16ac('0x2d')](_0x2bd0a0[_0x16ac('0x45')][_0x16ac('0x2d')]);}return _0x3f0006[_0x16ac('0x76')](_0x567790);}})[_0x16ac('0x1f')](function(_0x17c1f2){if(_0x17c1f2){return _0x17c1f2?{'count':_0x42bf65,'rows':_0x17c1f2}:null;}})[_0x16ac('0x1f')](respondWithResult(_0x5263ed,null))[_0x16ac('0x29')](handleError(_0x5263ed,null));};exports[_0x16ac('0x77')]=function(_0x28cfcf,_0x267fff){var _0x9966f7=_0x28cfcf[_0x16ac('0x59')]['id'];var _0x2a1520=_0x28cfcf[_0x16ac('0x61')];var _0x2df5f0=0xc8;var _0xc5f820=null;return db[_0x16ac('0x78')][_0x16ac('0x79')]({'isolationLevel':db[_0x16ac('0x78')][_0x16ac('0x7a')][_0x16ac('0x7b')][_0x16ac('0x7c')]},function(_0x24647e){return db[_0x16ac('0x55')][_0x16ac('0x66')]({'where':{'id':_0x9966f7},'transaction':_0x24647e})['then'](function(_0xc0819e){if(_0xc0819e){return db[_0x16ac('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x9966f7},'transaction':_0x24647e})[_0x16ac('0x1f')](function(){var _0x19241e=_[_0x16ac('0x44')](_0x2a1520,function(_0x138555){_0x138555[_0x16ac('0x63')]=_0x9966f7;return _0x138555;});return db[_0x16ac('0x7d')][_0x16ac('0x7e')](_0x19241e,{'transaction':_0x24647e});});}else{_0x2df5f0=0x194;_0xc5f820=[];}});})[_0x16ac('0x1f')](function(){if(_0x2df5f0!==0x194){return db[_0x16ac('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x9966f7},'order':_0x16ac('0x7f')})['then'](function(_0x3f561d){_0xc5f820=_0x3f561d;});}})[_0x16ac('0x29')](function(_0x533838){_0x2df5f0=0x1f4;logger[_0x16ac('0x24')](_0x533838[_0x16ac('0x80')]);if(_0x533838['name']){delete _0x533838['name'];}_0xc5f820=_0x533838;})['finally'](function(){if(_0xc5f820===null){_0x267fff[_0x16ac('0x3a')](_0x2df5f0);}else{if(_0x2df5f0===0x1f4){_0x267fff[_0x16ac('0x2a')](_0x2df5f0)[_0x16ac('0x3c')](_0xc5f820);}else{_0x267fff[_0x16ac('0x2a')](_0x2df5f0)[_0x16ac('0x2c')](_0xc5f820);}}});};exports[_0x16ac('0x81')]=function(_0x4ed1c0,_0x3fe6e5,_0x5f1bc5){var _0x2e8826={};var _0x1dea39={};var _0x55b006;var _0x4582ef;return db[_0x16ac('0x55')]['findOne']({'where':{'id':_0x4ed1c0[_0x16ac('0x59')]['id']}})['then'](handleEntityNotFound(_0x3fe6e5,null))[_0x16ac('0x1f')](function(_0x16ca51){if(_0x16ca51){_0x55b006=_0x16ca51;_0x1dea39['model']=_[_0x16ac('0x46')](db['WhatsappApplication'][_0x16ac('0x40')]);_0x1dea39[_0x16ac('0x45')]=_[_0x16ac('0x46')](_0x4ed1c0[_0x16ac('0x45')]);_0x1dea39[_0x16ac('0x47')]=_['intersection'](_0x1dea39[_0x16ac('0x49')],_0x1dea39[_0x16ac('0x45')]);_0x2e8826[_0x16ac('0x4b')]=_[_0x16ac('0x48')](_0x1dea39[_0x16ac('0x49')],qs[_0x16ac('0x4a')](_0x4ed1c0[_0x16ac('0x45')][_0x16ac('0x4a')]));_0x2e8826[_0x16ac('0x4b')]=_0x2e8826[_0x16ac('0x4b')][_0x16ac('0x4c')]?_0x2e8826[_0x16ac('0x4b')]:_0x1dea39[_0x16ac('0x49')];_0x2e8826[_0x16ac('0x4e')]=qs[_0x16ac('0x4f')](_0x4ed1c0[_0x16ac('0x45')]['sort']);_0x2e8826[_0x16ac('0x52')]=qs['filters'](_['pick'](_0x4ed1c0[_0x16ac('0x45')],_0x1dea39[_0x16ac('0x47')]));if(_0x4ed1c0[_0x16ac('0x45')]['filter']){_0x2e8826['where']=_['merge'](_0x2e8826[_0x16ac('0x52')],{'$or':_[_0x16ac('0x44')](_0x2e8826['attributes'],function(_0x568c59){var _0x40bab7={};_0x40bab7[_0x568c59]={'$like':'%'+_0x4ed1c0[_0x16ac('0x45')][_0x16ac('0x50')]+'%'};return _0x40bab7;})});}_0x2e8826=_[_0x16ac('0x51')]({},_0x2e8826,_0x4ed1c0[_0x16ac('0x54')]);return _0x55b006[_0x16ac('0x81')](_0x2e8826);}})[_0x16ac('0x1f')](function(_0x40fe15){if(_0x40fe15){_0x4582ef=_0x40fe15[_0x16ac('0x4c')];if(!_0x4ed1c0['query']['hasOwnProperty']('nolimit')){_0x2e8826[_0x16ac('0x30')]=qs[_0x16ac('0x30')](_0x4ed1c0[_0x16ac('0x45')]['limit']);_0x2e8826[_0x16ac('0x2d')]=qs[_0x16ac('0x2d')](_0x4ed1c0[_0x16ac('0x45')][_0x16ac('0x2d')]);}return _0x55b006[_0x16ac('0x81')](_0x2e8826);}})['then'](function(_0x408b7a){if(_0x408b7a){return _0x408b7a?{'count':_0x4582ef,'rows':_0x408b7a}:null;}})['then'](respondWithResult(_0x3fe6e5,null))[_0x16ac('0x29')](handleError(_0x3fe6e5,null));};exports[_0x16ac('0x82')]=function(_0x5cd6c2,_0x1f76d1,_0x2b63b7){var _0x169cac={'channel':_0x16ac('0x83')};var _0x28ad66=[];var _0xe28b9b=[];var _0xac207b={};return db['WhatsappAccount'][_0x16ac('0x5b')]({'where':{'id':_0x5cd6c2[_0x16ac('0x59')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x16ac('0x84')}]})[_0x16ac('0x1f')](handleEntityNotFound(_0x1f76d1,null))[_0x16ac('0x1f')](function(_0x1abc3d){_0x169cac['account']=_0x1abc3d;if(_0x169cac[_0x16ac('0x85')]&&_0x169cac[_0x16ac('0x85')]['type']===_0x16ac('0x86')&&_0x5cd6c2['body'][_0x16ac('0x87')]){if(_0x5cd6c2[_0x16ac('0x61')][_0x16ac('0x87')]['length']===0x0)return;if(_0x5cd6c2[_0x16ac('0x61')][_0x16ac('0x87')][0x0][_0x16ac('0x88')]!=='read')return;return db['WhatsappMessage'][_0x16ac('0x35')]({'read':!![],'readAt':_0x5cd6c2[_0x16ac('0x61')][_0x16ac('0x87')][0x0][_0x16ac('0x89')]},{'where':{'messageId':_0x5cd6c2['body'][_0x16ac('0x87')][0x0][_0x16ac('0x8a')]},'individualHooks':!![]})[_0x16ac('0x1f')](function(_0x2aa01c){return _0x1f76d1[_0x16ac('0x2a')](0xc8)[_0x16ac('0x2c')](_0x2aa01c);});}_0x169cac[_0x16ac('0x8b')]=_['orderBy'](_0x1abc3d[_0x16ac('0x84')],[_0x16ac('0x7f')],[_0x16ac('0x8c')]);if(_0x169cac[_0x16ac('0x85')][_0x16ac('0x84')]){delete _0x169cac[_0x16ac('0x85')][_0x16ac('0x84')];}return db['CmContact'][_0x16ac('0x62')]()[_0x16ac('0x1f')](function(_0x3f7f67){if(!_0x3f7f67){throw new db[(_0x16ac('0x8d'))][(_0x16ac('0x8e'))](_0x16ac('0x8f'));}_0x28ad66=_[_0x16ac('0x90')](_['keys'](_0x3f7f67),[_0x16ac('0x91'),_0x16ac('0x92')]);_0xe28b9b=_[_0x16ac('0x90')](_[_0x16ac('0x46')](_0x3f7f67),[_0x16ac('0x91'),_0x16ac('0x92'),_0x16ac('0x93'),_0x16ac('0x94')]);_0x169cac['body']={'mapKey':'mobile'};if(_0x169cac[_0x16ac('0x85')]&&_0x169cac[_0x16ac('0x85')][_0x16ac('0x42')]===_0x16ac('0x95')){_0x169cac['body'][_0x16ac('0x96')]=_0x5cd6c2['body'][_0x16ac('0x97')][_0x16ac('0x98')](_0x16ac('0x99'),'');_0x169cac[_0x16ac('0x61')][_0x16ac('0x61')]=_0x5cd6c2[_0x16ac('0x61')][_0x16ac('0x9a')];_0x169cac[_0x16ac('0x61')][_0x16ac('0x9b')]=_0x5cd6c2[_0x16ac('0x61')][_0x16ac('0x9c')];}if(_0x169cac['account']&&_0x169cac['account']['type']===_0x16ac('0x86')){_0x169cac[_0x16ac('0x61')]['from']=_0x5cd6c2[_0x16ac('0x61')][_0x16ac('0x9d')][0x0][_0x16ac('0x96')];_0x169cac[_0x16ac('0x61')][_0x16ac('0x61')]=_0x5cd6c2[_0x16ac('0x61')][_0x16ac('0x9d')][0x0][_0x16ac('0x27')][_0x16ac('0x61')];_0x169cac[_0x16ac('0x61')][_0x16ac('0x9b')]=_0x5cd6c2[_0x16ac('0x61')]['notifications'][0x0][_0x16ac('0x8a')];}if(_0x169cac[_0x16ac('0x61')]['id']){delete _0x169cac[_0x16ac('0x61')]['id'];}if(_['isNil'](_0x169cac[_0x16ac('0x61')][_0x16ac('0x96')])){throw new db[(_0x16ac('0x8d'))]['ValidationError'](_0x16ac('0x9e'));}if(_[_0x16ac('0x9f')](_0x169cac[_0x16ac('0x61')][_0x16ac('0x61')])||_0x169cac['body']['body']===''){throw new db[(_0x16ac('0x8d'))]['ValidationError'](_0x16ac('0xa0'));}if(_[_0x16ac('0x9f')](_0x169cac['body'][_0x16ac('0xa1')])){throw new db[(_0x16ac('0x8d'))][(_0x16ac('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe28b9b);}if(!_[_0x16ac('0xa2')](_0xe28b9b,_0x169cac[_0x16ac('0x61')][_0x16ac('0xa1')])){throw new db[(_0x16ac('0x8d'))][(_0x16ac('0x8e'))](_0x16ac('0xa3')+_0xe28b9b);}_0xac207b[_0x169cac[_0x16ac('0x61')][_0x16ac('0xa1')]]=_0x169cac[_0x16ac('0x61')][_0x16ac('0x96')];return db['CmList'][_0x16ac('0x5b')]({'where':{'id':_0x169cac[_0x16ac('0x85')]['ListId']},'include':[{'model':db[_0x16ac('0xa4')],'as':'Contacts','where':_0xac207b,'limit':0x1,'order':[[_0x16ac('0x92'),'DESC']]}]});})[_0x16ac('0x1f')](handleEntityNotFound(_0x1f76d1,null))['then'](function(_0x532de1){if(_0x532de1){_0x169cac[_0x16ac('0xa5')]=_[_0x16ac('0xa6')](_0x532de1,[_0x16ac('0xa7')]);if(_0x532de1[_0x16ac('0xa7')][_0x16ac('0x4c')]){return _0x532de1[_0x16ac('0xa7')][0x0];}var _0x3b7273=_['defaults'](_0x169cac['body'],{'firstName':_0x169cac[_0x16ac('0x61')]['from'],'ListId':_0x532de1['id']});_0x3b7273[_0x169cac[_0x16ac('0x61')][_0x16ac('0xa1')]]=_0x169cac[_0x16ac('0x61')][_0x16ac('0x96')];return db[_0x16ac('0xa4')][_0x16ac('0x5c')](_0x3b7273,{'fields':_0x28ad66,'raw':!![]});}})[_0x16ac('0x1f')](handleEntityNotFound(_0x1f76d1,null))['then'](function(_0x2ab84c){if(_0x2ab84c){_0x169cac[_0x16ac('0xa8')]=_0x2ab84c;var _0xfa2cbe={'ContactId':_0x2ab84c['id'],'phone':_0x169cac[_0x16ac('0x61')][_0x16ac('0x96')],'WhatsappAccountId':_0x5cd6c2['params']['id']};var _0x438e0b={'ContactId':_0x2ab84c['id'],'WhatsappAccountId':_0x5cd6c2[_0x16ac('0x59')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x438e0b})[_0x16ac('0x1f')](function(_0x2a4df3){if(_0x2a4df3){return[_0x2a4df3,![]];}return db[_0x16ac('0xa9')][_0x16ac('0x5c')](_0xfa2cbe)['then'](function(_0x380c02){return[_0x380c02,!![]];});});}})[_0x16ac('0x71')](function(_0x296d2f,_0x20c4e5){_0x169cac[_0x16ac('0xaa')]=_0x296d2f[_0x16ac('0x37')]({'plain':!![]});_0x169cac[_0x16ac('0xaa')][_0x16ac('0xab')]=![];if(_0x20c4e5){if(_0x169cac[_0x16ac('0x85')][_0x16ac('0xac')]){_0x169cac[_0x16ac('0x8b')]['push']({'id':0x0,'priority':_0x169cac[_0x16ac('0x8b')]['length']+0x1,'app':'close','appdata':_0x16ac('0xad'),'interval':_0x16ac('0xae')});}_0x169cac[_0x16ac('0xaa')][_0x16ac('0xab')]=!![];}return db[_0x16ac('0xaf')][_0x16ac('0x5c')]({'phone':_0x169cac[_0x16ac('0x61')][_0x16ac('0x96')],'messageId':_0x169cac['body']['messageId'],'body':_0x169cac[_0x16ac('0x61')][_0x16ac('0x61')],'WhatsappAccountId':_0x5cd6c2[_0x16ac('0x59')]['id'],'WhatsappInteractionId':_0x296d2f['id'],'direction':'in','ContactId':_0x296d2f[_0x16ac('0xb0')],'AttachmentId':_0x169cac[_0x16ac('0x61')]['AttachmentId']});})[_0x16ac('0x1f')](function(_0x5a61f6){_0x169cac['message']=_0x5a61f6;if(_0x169cac['interaction'][_0x16ac('0xb1')]){return db[_0x16ac('0xb2')]['find']({'attributes':['id','name'],'where':{'id':_0x169cac[_0x16ac('0xaa')][_0x16ac('0xb1')]}})[_0x16ac('0x1f')](function(_0x10ecec){if(_0x10ecec){_0x169cac[_0x16ac('0x8b')][_0x16ac('0xb3')]({'id':0x0,'priority':0x0,'app':_0x16ac('0xb4'),'appdata':_0x10ecec['name']+','+(_0x169cac['account'][_0x16ac('0xb5')]||0xa),'interval':_0x16ac('0xae')});}return respondWithRpcPromise('Start',_0x16ac('0xb6'),_0x169cac);});}return respondWithRpcPromise(_0x16ac('0xb7'),_0x16ac('0xb6'),_0x169cac);})[_0x16ac('0x1f')](function(_0x2c9033){if(_0x2c9033){var _0x352e40=0xc8;var _0x324b19=_0x16ac('0xb8');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x324b19,_0x352e40,_0x16ac('0xb9'));logger[_0x16ac('0xba')](_0x16ac('0xbb'),_0x324b19,_0x352e40,_0x16ac('0xb9'),JSON[_0x16ac('0x23')](_0x2c9033));if(_0x169cac[_0x16ac('0x85')][_0x16ac('0x42')]===_0x16ac('0x95')){return _0x1f76d1[_0x16ac('0x2a')](_0x352e40)[_0x16ac('0x31')](_0x16ac('0xbc'),_0x16ac('0xbd'))['send']('\x0a');}else{return _0x1f76d1[_0x16ac('0x2a')](_0x352e40)[_0x16ac('0x2c')](_0x2c9033);}}});})[_0x16ac('0x29')](handleError(_0x1f76d1,null));};exports[_0x16ac('0x3c')]=function(_0x511a54,_0x367059,_0x39b254){var _0x3855dc,_0x763b97,_0xed34f3;if(_[_0x16ac('0x9f')](_0x511a54[_0x16ac('0x61')][_0x16ac('0x61')])||_0x511a54[_0x16ac('0x61')][_0x16ac('0x61')]===''){throw new db[(_0x16ac('0x8d'))][(_0x16ac('0x8e'))](_0x16ac('0xa0'));}if(_[_0x16ac('0x9f')](_0x511a54[_0x16ac('0x61')]['to'])){throw new db['Sequelize'][(_0x16ac('0x8e'))](_0x16ac('0xbe'));}_0x3855dc=_0x511a54[_0x16ac('0x61')]['to'];return db['WhatsappAccount'][_0x16ac('0x5b')]({'where':{'id':_0x511a54['params']['id']},'include':[{'model':db['CmList'],'as':_0x16ac('0xbf'),'include':[{'model':db['CmContact'],'as':_0x16ac('0xa7'),'where':{'mobile':_0x3855dc},'limit':0x1,'order':[[_0x16ac('0x92'),_0x16ac('0xc0')]]}]}]})[_0x16ac('0x1f')](handleEntityNotFound(_0x367059,null))[_0x16ac('0x1f')](function(_0x5d7efa){if(_0x5d7efa&&_0x5d7efa[_0x16ac('0xbf')]){_0x763b97=_0x5d7efa[_0x16ac('0x37')]({'plain':!![]});if(_0x763b97[_0x16ac('0xbf')]&&_0x763b97[_0x16ac('0xbf')][_0x16ac('0xa7')]['length']){return _0x763b97[_0x16ac('0xbf')][_0x16ac('0xa7')][0x0];}return db[_0x16ac('0xa4')][_0x16ac('0x5c')](_['defaults'](_0x511a54['body'],{'firstName':_0x3855dc,'mobile':_0x3855dc,'phone':_0x3855dc,'ListId':_0x763b97[_0x16ac('0x94')]}));}})[_0x16ac('0x1f')](handleEntityNotFound(_0x367059,null))[_0x16ac('0x1f')](function(_0x52af57){if(_0x52af57){_0xed34f3=_0x52af57;return db[_0x16ac('0xa9')]['find']({'where':{'ContactId':_0xed34f3['id'],'closed':![],'WhatsappAccountId':_0x763b97['id']}})[_0x16ac('0x1f')](function(_0x1dda20){if(_0x1dda20){return[_0x1dda20,![]];}return db[_0x16ac('0xa9')]['create']({'UserId':_0x511a54['user']['id'],'ContactId':_0xed34f3['id'],'WhatsappAccountId':_0x763b97['id'],'phone':_0x3855dc,'firstMsgDirection':_0x16ac('0xc1'),'Messages':[_[_0x16ac('0x51')](_0x511a54['body'],{'read':![],'body':_0x511a54[_0x16ac('0x61')][_0x16ac('0x61')],'phone':_0x3855dc,'WhatsappAccountId':_0x763b97['id'],'UserId':_0x511a54[_0x16ac('0x5d')]['id'],'ContactId':_0xed34f3['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x16ac('0xc2')}]})[_0x16ac('0x1f')](function(_0x2eba17){return[_0x2eba17,!![]];});});}})[_0x16ac('0x71')](function(_0x3ecce4,_0x4dcdd4){if(_0x4dcdd4){return _0x3ecce4;}return db[_0x16ac('0xaf')][_0x16ac('0x5c')](_[_0x16ac('0x51')](_0x511a54[_0x16ac('0x61')],{'read':![],'body':_0x511a54[_0x16ac('0x61')]['body'],'phone':_0x3855dc,'WhatsappAccountId':_0x763b97['id'],'WhatsappInteractionId':_0x3ecce4['id'],'UserId':_0x511a54[_0x16ac('0x5d')]['id'],'ContactId':_0xed34f3['id']}))[_0x16ac('0x1f')](function(_0x28405c){_0x3ecce4[_0x16ac('0xc3')][_0x16ac('0xc2')]=[];_0x3ecce4[_0x16ac('0xc3')][_0x16ac('0xc2')][_0x16ac('0xc4')](_0x28405c[_0x16ac('0xc3')]);return _0x3ecce4;});})[_0x16ac('0x1f')](respondWithResult(_0x367059,null))[_0x16ac('0x29')](handleError(_0x367059,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 937d54f..85d5401 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 _0x088f=['WhatsappAccount','save','update','emit','events','../../mysqldb'];(function(_0x107f75,_0x117428){var _0x503a3f=function(_0x16698c){while(--_0x16698c){_0x107f75['push'](_0x107f75['shift']());}};_0x503a3f(++_0x117428);}(_0x088f,0x1d2));var _0xf088=function(_0x4706ec,_0x1aae82){_0x4706ec=_0x4706ec-0x0;var _0x5271de=_0x088f[_0x4706ec];return _0x5271de;};'use strict';var EventEmitter=require(_0xf088('0x0'));var WhatsappAccount=require(_0xf088('0x1'))['db'][_0xf088('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf088('0x3'),'afterUpdate':_0xf088('0x4'),'afterDestroy':'remove'};function emitEvent(_0x357184){return function(_0x16ca0e,_0x27a11b,_0x4c1c5a){WhatsappAccountEvents[_0xf088('0x5')](_0x357184+':'+_0x16ca0e['id'],_0x16ca0e);WhatsappAccountEvents[_0xf088('0x5')](_0x357184,_0x16ca0e);_0x4c1c5a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xfc77=['WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfc77,0xb9));var _0x7fc7=function(_0x946156,_0x4902e0){_0x946156=_0x946156-0x0;var _0x5a7488=_0xfc77[_0x946156];return _0x5a7488;};'use strict';var EventEmitter=require(_0x7fc7('0x0'));var WhatsappAccount=require(_0x7fc7('0x1'))['db'][_0x7fc7('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7fc7('0x3')](0x0);var events={'afterCreate':_0x7fc7('0x4'),'afterUpdate':_0x7fc7('0x5'),'afterDestroy':_0x7fc7('0x6')};function emitEvent(_0x4881d2){return function(_0x24e257,_0x5d9245,_0x42c13c){WhatsappAccountEvents[_0x7fc7('0x7')](_0x4881d2+':'+_0x24e257['id'],_0x24e257);WhatsappAccountEvents[_0x7fc7('0x7')](_0x4881d2,_0x24e257);_0x42c13c(null);};}for(var e in events){if(events[_0x7fc7('0x8')](e)){var event=events[e];WhatsappAccount[_0x7fc7('0x9')](e,emitEvent(event));}}module[_0x7fc7('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index d804a29..ea82efc 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 _0x98c7=['api','moment','bluebird','request-promise','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger'];(function(_0x4a0a90,_0x1ac8bf){var _0x52fe98=function(_0x12c44d){while(--_0x12c44d){_0x4a0a90['push'](_0x4a0a90['shift']());}};_0x52fe98(++_0x1ac8bf);}(_0x98c7,0x65));var _0x798c=function(_0x153c6a,_0x2a217a){_0x153c6a=_0x153c6a-0x0;var _0xce898f=_0x98c7[_0x153c6a];return _0xce898f;};'use strict';var _=require(_0x798c('0x0'));var util=require(_0x798c('0x1'));var logger=require(_0x798c('0x2'))(_0x798c('0x3'));var moment=require(_0x798c('0x4'));var BPromise=require(_0x798c('0x5'));var rp=require(_0x798c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x798c('0x7'));var attributes=require(_0x798c('0x8'));module[_0x798c('0x9')]=function(_0x562825,_0x257ed4){return _0x562825[_0x798c('0xa')](_0x798c('0xb'),attributes,{'tableName':_0x798c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf62=['define','WhatsappAccount','whatsapp_accounts','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0xc0e58f,_0x3234a5){var _0x21eb6c=function(_0x25819a){while(--_0x25819a){_0xc0e58f['push'](_0xc0e58f['shift']());}};_0x21eb6c(++_0x3234a5);}(_0xaf62,0x16b));var _0x2af6=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xaf62[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x2af6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2af6('0x1'));var moment=require(_0x2af6('0x2'));var BPromise=require(_0x2af6('0x3'));var rp=require(_0x2af6('0x4'));var fs=require('fs');var path=require(_0x2af6('0x5'));var rimraf=require('rimraf');var config=require(_0x2af6('0x6'));var attributes=require(_0x2af6('0x7'));module[_0x2af6('0x8')]=function(_0x19021b,_0x3929ea){return _0x19021b[_0x2af6('0x9')](_0x2af6('0xa'),attributes,{'tableName':_0x2af6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 15643e1..7167c51 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 _0x3121=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','options','raw','where','attributes','include','map','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x290dfc,_0x52c9c5){var _0x39efdb=function(_0x47237c){while(--_0x47237c){_0x290dfc['push'](_0x290dfc['shift']());}};_0x39efdb(++_0x52c9c5);}(_0x3121,0x14d));var _0x1312=function(_0x483783,_0x5c17bc){_0x483783=_0x483783-0x0;var _0x4304c5=_0x3121[_0x483783];return _0x4304c5;};'use strict';var _=require('lodash');var util=require(_0x1312('0x0'));var moment=require(_0x1312('0x1'));var BPromise=require('bluebird');var rs=require(_0x1312('0x2'));var fs=require('fs');var Redis=require(_0x1312('0x3'));var db=require(_0x1312('0x4'))['db'];var utils=require(_0x1312('0x5'));var logger=require(_0x1312('0x6'))(_0x1312('0x7'));var config=require(_0x1312('0x8'));var jayson=require(_0x1312('0x9'));var client=jayson[_0x1312('0xa')][_0x1312('0xb')]({'port':0x232a});config[_0x1312('0xc')]=_['defaults'](config['redis'],{'host':_0x1312('0xd'),'port':0x18eb});var socket=require(_0x1312('0xe'))(new Redis(config[_0x1312('0xc')]));require(_0x1312('0xf'))[_0x1312('0x10')](socket);function respondWithRpcPromise(_0x575927,_0x3764fa,_0x2015c7){return new BPromise(function(_0xc0de3a,_0x51ffa2){return client[_0x1312('0x11')](_0x575927,_0x2015c7)[_0x1312('0x12')](function(_0x27c1ea){logger[_0x1312('0x13')](_0x1312('0x14'),_0x3764fa,_0x1312('0x15'));logger[_0x1312('0x16')](_0x1312('0x17'),_0x3764fa,_0x1312('0x15'),JSON[_0x1312('0x18')](_0x27c1ea));if(_0x27c1ea[_0x1312('0x19')]){if(_0x27c1ea[_0x1312('0x19')][_0x1312('0x1a')]===0x1f4){logger['error'](_0x1312('0x14'),_0x3764fa,_0x27c1ea['error']['message']);return _0x51ffa2(_0x27c1ea[_0x1312('0x19')][_0x1312('0x1b')]);}logger[_0x1312('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x3764fa,_0x27c1ea[_0x1312('0x19')][_0x1312('0x1b')]);return _0xc0de3a(_0x27c1ea[_0x1312('0x19')][_0x1312('0x1b')]);}else{logger[_0x1312('0x13')](_0x1312('0x14'),_0x3764fa,'request\x20sent');_0xc0de3a(_0x27c1ea[_0x1312('0x1c')]['message']);}})[_0x1312('0x1d')](function(_0x4223a9){logger['error'](_0x1312('0x14'),_0x3764fa,_0x4223a9);_0x51ffa2(_0x4223a9);});});}exports[_0x1312('0x1e')]=function(_0x482fcc){var _0x4834f8=this;return new Promise(function(_0x1756cb,_0x5e1705){return db['WhatsappAccount']['find']({'raw':_0x482fcc[_0x1312('0x1f')]?_0x482fcc[_0x1312('0x1f')][_0x1312('0x20')]===undefined?!![]:![]:!![],'where':_0x482fcc[_0x1312('0x1f')]?_0x482fcc['options'][_0x1312('0x21')]||null:null,'attributes':_0x482fcc[_0x1312('0x1f')]?_0x482fcc['options'][_0x1312('0x22')]||null:null,'include':_0x482fcc[_0x1312('0x1f')]?_0x482fcc['options'][_0x1312('0x23')]?_[_0x1312('0x24')](_0x482fcc['options'][_0x1312('0x23')],function(_0x57ea45){return{'model':db[_0x57ea45[_0x1312('0x25')]],'as':_0x57ea45['as'],'attributes':_0x57ea45[_0x1312('0x22')],'include':_0x57ea45[_0x1312('0x23')]?_['map'](_0x57ea45[_0x1312('0x23')],function(_0x2fb316){return{'model':db[_0x2fb316['model']],'as':_0x2fb316['as'],'attributes':_0x2fb316[_0x1312('0x22')],'include':_0x2fb316[_0x1312('0x23')]?_[_0x1312('0x24')](_0x2fb316[_0x1312('0x23')],function(_0x4d7654){return{'model':db[_0x4d7654['model']],'as':_0x4d7654['as'],'attributes':_0x4d7654[_0x1312('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1312('0x12')](function(_0x141068){logger[_0x1312('0x13')](_0x1312('0x1e'),_0x482fcc);logger[_0x1312('0x16')](_0x1312('0x1e'),_0x482fcc,JSON[_0x1312('0x18')](_0x141068));_0x1756cb(_0x141068);})['catch'](function(_0x525fcb){logger[_0x1312('0x19')](_0x1312('0x1e'),_0x525fcb[_0x1312('0x1b')],_0x482fcc);_0x5e1705(_0x4834f8[_0x1312('0x19')](0x1f4,_0x525fcb[_0x1312('0x1b')]));});});}; \ No newline at end of file +var _0xa24a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','map','include','model'];(function(_0x470c92,_0x104210){var _0x16c0ae=function(_0x4006b4){while(--_0x4006b4){_0x470c92['push'](_0x470c92['shift']());}};_0x16c0ae(++_0x104210);}(_0xa24a,0x1a2));var _0xaa24=function(_0x1c7000,_0x3e7dfd){_0x1c7000=_0x1c7000-0x0;var _0x559c7f=_0xa24a[_0x1c7000];return _0x559c7f;};'use strict';var _=require(_0xaa24('0x0'));var util=require(_0xaa24('0x1'));var moment=require(_0xaa24('0x2'));var BPromise=require(_0xaa24('0x3'));var rs=require(_0xaa24('0x4'));var fs=require('fs');var Redis=require(_0xaa24('0x5'));var db=require(_0xaa24('0x6'))['db'];var utils=require(_0xaa24('0x7'));var logger=require(_0xaa24('0x8'))(_0xaa24('0x9'));var config=require('../../config/environment');var jayson=require(_0xaa24('0xa'));var client=jayson[_0xaa24('0xb')]['http']({'port':0x232a});config[_0xaa24('0xc')]=_[_0xaa24('0xd')](config['redis'],{'host':_0xaa24('0xe'),'port':0x18eb});var socket=require(_0xaa24('0xf'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xaa24('0x10')](socket);function respondWithRpcPromise(_0x3537b3,_0x385743,_0x325ffb){return new BPromise(function(_0x16a029,_0x3667ee){return client[_0xaa24('0x11')](_0x3537b3,_0x325ffb)[_0xaa24('0x12')](function(_0x212c67){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x385743,_0xaa24('0x13'));logger['debug'](_0xaa24('0x14'),_0x385743,_0xaa24('0x13'),JSON[_0xaa24('0x15')](_0x212c67));if(_0x212c67[_0xaa24('0x16')]){if(_0x212c67['error'][_0xaa24('0x17')]===0x1f4){logger[_0xaa24('0x16')](_0xaa24('0x18'),_0x385743,_0x212c67[_0xaa24('0x16')][_0xaa24('0x19')]);return _0x3667ee(_0x212c67['error'][_0xaa24('0x19')]);}logger['error'](_0xaa24('0x18'),_0x385743,_0x212c67[_0xaa24('0x16')][_0xaa24('0x19')]);return _0x16a029(_0x212c67[_0xaa24('0x16')][_0xaa24('0x19')]);}else{logger[_0xaa24('0x1a')]('WhatsappAccount,\x20%s,\x20%s',_0x385743,_0xaa24('0x13'));_0x16a029(_0x212c67[_0xaa24('0x1b')]['message']);}})[_0xaa24('0x1c')](function(_0xcddd8a){logger[_0xaa24('0x16')](_0xaa24('0x18'),_0x385743,_0xcddd8a);_0x3667ee(_0xcddd8a);});});}exports[_0xaa24('0x1d')]=function(_0xfd43c9){var _0xcbcafd=this;return new Promise(function(_0x81723c,_0x181c7e){return db[_0xaa24('0x1e')][_0xaa24('0x1f')]({'raw':_0xfd43c9[_0xaa24('0x20')]?_0xfd43c9[_0xaa24('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xfd43c9[_0xaa24('0x20')]?_0xfd43c9['options'][_0xaa24('0x21')]||null:null,'attributes':_0xfd43c9[_0xaa24('0x20')]?_0xfd43c9[_0xaa24('0x20')][_0xaa24('0x22')]||null:null,'include':_0xfd43c9['options']?_0xfd43c9['options']['include']?_[_0xaa24('0x23')](_0xfd43c9[_0xaa24('0x20')][_0xaa24('0x24')],function(_0xd52e15){return{'model':db[_0xd52e15['model']],'as':_0xd52e15['as'],'attributes':_0xd52e15[_0xaa24('0x22')],'include':_0xd52e15['include']?_['map'](_0xd52e15[_0xaa24('0x24')],function(_0x54e5e7){return{'model':db[_0x54e5e7[_0xaa24('0x25')]],'as':_0x54e5e7['as'],'attributes':_0x54e5e7['attributes'],'include':_0x54e5e7[_0xaa24('0x24')]?_[_0xaa24('0x23')](_0x54e5e7['include'],function(_0x3459b3){return{'model':db[_0x3459b3[_0xaa24('0x25')]],'as':_0x3459b3['as'],'attributes':_0x3459b3[_0xaa24('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaa24('0x12')](function(_0x3d90b9){logger[_0xaa24('0x1a')](_0xaa24('0x1d'),_0xfd43c9);logger['debug']('ShowWhatsappAccount',_0xfd43c9,JSON[_0xaa24('0x15')](_0x3d90b9));_0x81723c(_0x3d90b9);})[_0xaa24('0x1c')](function(_0x506d00){logger[_0xaa24('0x16')](_0xaa24('0x1d'),_0x506d00['message'],_0xfd43c9);_0x181c7e(_0xcbcafd[_0xaa24('0x16')](0x1f4,_0x506d00[_0xaa24('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index d046784..ff682ce 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 _0xa27d=['register','length','whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener'];(function(_0x3ea495,_0x2cd347){var _0x108ee0=function(_0xc7339d){while(--_0xc7339d){_0x3ea495['push'](_0x3ea495['shift']());}};_0x108ee0(++_0x2cd347);}(_0xa27d,0xf3));var _0xda27=function(_0x4d2994,_0x56436c){_0x4d2994=_0x4d2994-0x0;var _0x473167=_0xa27d[_0x4d2994];return _0x473167;};'use strict';var WhatsappAccountEvents=require(_0xda27('0x0'));var events=[_0xda27('0x1'),'remove',_0xda27('0x2')];function createListener(_0x55512b,_0x1fbeab){return function(_0x200d3a){_0x1fbeab[_0xda27('0x3')](_0x55512b,_0x200d3a);};}function removeListener(_0x53f442,_0x440875){return function(){WhatsappAccountEvents[_0xda27('0x4')](_0x53f442,_0x440875);};}exports[_0xda27('0x5')]=function(_0x36cc42){for(var _0x448d19=0x0,_0x59f029=events[_0xda27('0x6')];_0x448d19<_0x59f029;_0x448d19++){var _0x161893=events[_0x448d19];var _0x2a4878=createListener(_0xda27('0x7')+_0x161893,_0x36cc42);WhatsappAccountEvents['on'](_0x161893,_0x2a4878);}}; \ No newline at end of file +var _0x5e6e=['whatsappAccount:','save','remove','update','emit','removeListener','register','length'];(function(_0xc8db2,_0x3d3894){var _0x12736f=function(_0x111ac4){while(--_0x111ac4){_0xc8db2['push'](_0xc8db2['shift']());}};_0x12736f(++_0x3d3894);}(_0x5e6e,0x189));var _0xe5e6=function(_0x53acea,_0x16a9f1){_0x53acea=_0x53acea-0x0;var _0x107bc5=_0x5e6e[_0x53acea];return _0x107bc5;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xe5e6('0x0'),_0xe5e6('0x1'),_0xe5e6('0x2')];function createListener(_0x17c66d,_0x195f61){return function(_0x497e51){_0x195f61[_0xe5e6('0x3')](_0x17c66d,_0x497e51);};}function removeListener(_0x5e43d6,_0x3fdf18){return function(){WhatsappAccountEvents[_0xe5e6('0x4')](_0x5e43d6,_0x3fdf18);};}exports[_0xe5e6('0x5')]=function(_0x326b20){for(var _0x19f1ed=0x0,_0x7b2e5e=events[_0xe5e6('0x6')];_0x19f1ed<_0x7b2e5e;_0x19f1ed++){var _0x5ea41b=events[_0x19f1ed];var _0x506452=createListener(_0xe5e6('0x7')+_0x5ea41b,_0x326b20);WhatsappAccountEvents['on'](_0x5ea41b,_0x506452);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 5eacc6a..2843eae 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 _0x0075=['/:id','post','create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0x533ca6,_0x4ed3fb){var _0x34f0bd=function(_0x2cc877){while(--_0x2cc877){_0x533ca6['push'](_0x533ca6['shift']());}};_0x34f0bd(++_0x4ed3fb);}(_0x0075,0xd2));var _0x5007=function(_0x33bb70,_0x1619f5){_0x33bb70=_0x33bb70-0x0;var _0x5443ad=_0x0075[_0x33bb70];return _0x5443ad;};'use strict';var multer=require(_0x5007('0x0'));var util=require(_0x5007('0x1'));var path=require(_0x5007('0x2'));var timeout=require(_0x5007('0x3'));var express=require('express');var router=express[_0x5007('0x4')]();var fs_extra=require(_0x5007('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5007('0x6'));var controller=require(_0x5007('0x7'));router[_0x5007('0x8')]('/',auth[_0x5007('0x9')](),controller[_0x5007('0xa')]);router[_0x5007('0x8')](_0x5007('0xb'),auth[_0x5007('0x9')](),controller['show']);router[_0x5007('0xc')]('/',auth[_0x5007('0x9')](),controller[_0x5007('0xd')]);router[_0x5007('0xe')]('/:id',auth[_0x5007('0x9')](),controller[_0x5007('0xf')]);router[_0x5007('0x10')](_0x5007('0xb'),auth[_0x5007('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x824a=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','/:id','isAuthenticated','post','update','delete','multer','path','connect-timeout','express','Router'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x824a,0x167));var _0xa824=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x824a[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xa824('0x0'));var util=require('util');var path=require(_0xa824('0x1'));var timeout=require(_0xa824('0x2'));var express=require(_0xa824('0x3'));var router=express[_0xa824('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa824('0x5'));var interaction=require(_0xa824('0x6'));var config=require('../../config/environment');var controller=require(_0xa824('0x7'));router[_0xa824('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa824('0x9'),auth[_0xa824('0xa')](),controller['show']);router[_0xa824('0xb')]('/',auth[_0xa824('0xa')](),controller['create']);router['put'](_0xa824('0x9'),auth[_0xa824('0xa')](),controller[_0xa824('0xc')]);router[_0xa824('0xd')](_0xa824('0x9'),auth[_0xa824('0xa')](),controller['destroy']);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 d23da6f..f8f6588 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 _0x7cb6=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x7cb6,0x179));var _0x67cb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7cb6[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x67cb('0x0'));module[_0x67cb('0x1')]={'priority':{'type':Sequelize[_0x67cb('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x67cb('0x3')],'allowNull':![],'defaultValue':_0x67cb('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x67cb('0x3')]},'interval':{'type':Sequelize[_0x67cb('0x3')],'defaultValue':_0x67cb('0x5')}}; \ No newline at end of file +var _0xd80e=['INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x48b841,_0x2a2d46){var _0xaaa991=function(_0x3615dc){while(--_0x3615dc){_0x48b841['push'](_0x48b841['shift']());}};_0xaaa991(++_0x2a2d46);}(_0xd80e,0x167));var _0xed80=function(_0x4b8193,_0x37cf81){_0x4b8193=_0x4b8193-0x0;var _0x295f34=_0xd80e[_0x4b8193];return _0x295f34;};'use strict';var Sequelize=require(_0xed80('0x0'));module['exports']={'priority':{'type':Sequelize[_0xed80('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xed80('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xed80('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xed80('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 2544f49..946eff0 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 _0xf8f2=['end','json','undefined','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','options','includeAll','include','findAll','rows','show','length','find','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x249a62,_0x40c57a){_0x249a62=_0x249a62-0x0;var _0xf022=_0xf8f2[_0x249a62];return _0xf022;};'use strict';var emlformat=require(_0x2f8f('0x0'));var rimraf=require(_0x2f8f('0x1'));var zipdir=require(_0x2f8f('0x2'));var jsonpatch=require(_0x2f8f('0x3'));var rp=require('request-promise');var moment=require(_0x2f8f('0x4'));var BPromise=require(_0x2f8f('0x5'));var Mustache=require(_0x2f8f('0x6'));var util=require(_0x2f8f('0x7'));var path=require(_0x2f8f('0x8'));var sox=require('sox');var csv=require(_0x2f8f('0x9'));var ejs=require(_0x2f8f('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8f('0xb'));var _=require(_0x2f8f('0xc'));var squel=require(_0x2f8f('0xd'));var crypto=require(_0x2f8f('0xe'));var jsforce=require(_0x2f8f('0xf'));var deskjs=require(_0x2f8f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8f('0x11'));var Papa=require(_0x2f8f('0x12'));var Redis=require(_0x2f8f('0x13'));var authService=require(_0x2f8f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2f8f('0x15'));var hardwareService=require(_0x2f8f('0x16'));var logger=require('../../config/logger')(_0x2f8f('0x17'));var utils=require(_0x2f8f('0x18'));var config=require(_0x2f8f('0x19'));var licenseUtil=require(_0x2f8f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x76061b,_0xcbbb2b){_0xcbbb2b=_0xcbbb2b||0xcc;return function(_0x4e9312){if(_0x4e9312){return _0x76061b['sendStatus'](_0xcbbb2b);}return _0x76061b[_0x2f8f('0x1b')](_0xcbbb2b)[_0x2f8f('0x1c')]();};}function respondWithResult(_0x553035,_0x3327e3){_0x3327e3=_0x3327e3||0xc8;return function(_0x3c8461){if(_0x3c8461){return _0x553035[_0x2f8f('0x1b')](_0x3327e3)[_0x2f8f('0x1d')](_0x3c8461);}};}function respondWithFilteredResult(_0x1e0492,_0x593a53){return function(_0x5a1baf){if(_0x5a1baf){var _0x5d7dfa=typeof _0x593a53['offset']===_0x2f8f('0x1e')&&typeof _0x593a53[_0x2f8f('0x1f')]===_0x2f8f('0x1e');var _0x98a34c=_0x5a1baf[_0x2f8f('0x20')];var _0x54a5d2=_0x5d7dfa?0x0:_0x593a53['offset'];var _0x8329c4=_0x5d7dfa?_0x5a1baf['count']:_0x593a53['offset']+_0x593a53[_0x2f8f('0x1f')];var _0x100344;if(_0x8329c4>=_0x98a34c){_0x8329c4=_0x98a34c;_0x100344=0xc8;}else{_0x100344=0xce;}_0x1e0492[_0x2f8f('0x1b')](_0x100344);return _0x1e0492[_0x2f8f('0x21')](_0x2f8f('0x22'),_0x54a5d2+'-'+_0x8329c4+'/'+_0x98a34c)[_0x2f8f('0x1d')](_0x5a1baf);}return null;};}function patchUpdates(_0x420b47){return function(_0x417130){try{jsonpatch['apply'](_0x417130,_0x420b47,!![]);}catch(_0x2e94df){return BPromise[_0x2f8f('0x23')](_0x2e94df);}return _0x417130['save']();};}function saveUpdates(_0x56083a,_0x305b87){return function(_0x44fba4){if(_0x44fba4){return _0x44fba4[_0x2f8f('0x24')](_0x56083a)[_0x2f8f('0x25')](function(_0x2cc09e){return _0x2cc09e;});}return null;};}function removeEntity(_0x291f10,_0x35d7ca){return function(_0x3cf648){if(_0x3cf648){return _0x3cf648[_0x2f8f('0x26')]()[_0x2f8f('0x25')](function(){_0x291f10[_0x2f8f('0x1b')](0xcc)[_0x2f8f('0x1c')]();});}};}function handleEntityNotFound(_0x1bef3c,_0x55b591){return function(_0x38a16a){if(!_0x38a16a){_0x1bef3c[_0x2f8f('0x27')](0x194);}return _0x38a16a;};}function handleError(_0x14dc5f,_0x613faf){_0x613faf=_0x613faf||0x1f4;return function(_0x286fb2){logger['error'](_0x286fb2[_0x2f8f('0x28')]);if(_0x286fb2[_0x2f8f('0x29')]){delete _0x286fb2['name'];}_0x14dc5f['status'](_0x613faf)['send'](_0x286fb2);};}exports[_0x2f8f('0x2a')]=function(_0x5e3ffe,_0xb6207c){var _0x1f9ad1={},_0x125ed5={},_0x12924d={'count':0x0,'rows':[]};var _0x2ffba2=_[_0x2f8f('0x2b')](db[_0x2f8f('0x2c')][_0x2f8f('0x2d')],function(_0x4cd180){return{'name':_0x4cd180[_0x2f8f('0x2e')],'type':_0x4cd180[_0x2f8f('0x2f')][_0x2f8f('0x30')]};});_0x125ed5[_0x2f8f('0x31')]=_[_0x2f8f('0x2b')](_0x2ffba2,_0x2f8f('0x29'));_0x125ed5[_0x2f8f('0x32')]=_[_0x2f8f('0x33')](_0x5e3ffe[_0x2f8f('0x32')]);_0x125ed5['filters']=_[_0x2f8f('0x34')](_0x125ed5[_0x2f8f('0x31')],_0x125ed5[_0x2f8f('0x32')]);_0x1f9ad1[_0x2f8f('0x35')]=_['intersection'](_0x125ed5[_0x2f8f('0x31')],qs[_0x2f8f('0x36')](_0x5e3ffe[_0x2f8f('0x32')][_0x2f8f('0x36')]));_0x1f9ad1[_0x2f8f('0x35')]=_0x1f9ad1[_0x2f8f('0x35')]['length']?_0x1f9ad1[_0x2f8f('0x35')]:_0x125ed5[_0x2f8f('0x31')];if(!_0x5e3ffe[_0x2f8f('0x32')][_0x2f8f('0x37')](_0x2f8f('0x38'))){_0x1f9ad1[_0x2f8f('0x1f')]=qs['limit'](_0x5e3ffe['query']['limit']);_0x1f9ad1['offset']=qs[_0x2f8f('0x39')](_0x5e3ffe[_0x2f8f('0x32')][_0x2f8f('0x39')]);}_0x1f9ad1[_0x2f8f('0x3a')]=qs[_0x2f8f('0x3b')](_0x5e3ffe[_0x2f8f('0x32')][_0x2f8f('0x3b')]);_0x1f9ad1['where']=qs[_0x2f8f('0x3c')](_[_0x2f8f('0x3d')](_0x5e3ffe[_0x2f8f('0x32')],_0x125ed5[_0x2f8f('0x3c')]),_0x2ffba2);if(_0x5e3ffe['query'][_0x2f8f('0x3e')]){_0x1f9ad1['where']=_['merge'](_0x1f9ad1['where'],{'$or':_[_0x2f8f('0x2b')](_0x2ffba2,function(_0x55b5e8){if(_0x55b5e8['type']!=='VIRTUAL'){var _0x25ab26={};_0x25ab26[_0x55b5e8['name']]={'$like':'%'+_0x5e3ffe[_0x2f8f('0x32')]['filter']+'%'};return _0x25ab26;}})});}_0x1f9ad1=_['merge']({},_0x1f9ad1,_0x5e3ffe[_0x2f8f('0x3f')]);var _0x57654c={'where':_0x1f9ad1['where']};return db[_0x2f8f('0x2c')][_0x2f8f('0x20')](_0x57654c)[_0x2f8f('0x25')](function(_0x49c158){_0x12924d[_0x2f8f('0x20')]=_0x49c158;if(_0x5e3ffe[_0x2f8f('0x32')][_0x2f8f('0x40')]){_0x1f9ad1[_0x2f8f('0x41')]=[{'all':!![]}];}return db[_0x2f8f('0x2c')][_0x2f8f('0x42')](_0x1f9ad1);})[_0x2f8f('0x25')](function(_0xaf0bee){_0x12924d[_0x2f8f('0x43')]=_0xaf0bee;return _0x12924d;})[_0x2f8f('0x25')](respondWithFilteredResult(_0xb6207c,_0x1f9ad1))['catch'](handleError(_0xb6207c,null));};exports[_0x2f8f('0x44')]=function(_0x5d0cb1,_0x4af90b){var _0x8bf041={'raw':!![],'where':{'id':_0x5d0cb1['params']['id']}},_0x5d665b={};_0x5d665b[_0x2f8f('0x31')]=_['keys'](db[_0x2f8f('0x2c')][_0x2f8f('0x2d')]);_0x5d665b[_0x2f8f('0x32')]=_[_0x2f8f('0x33')](_0x5d0cb1[_0x2f8f('0x32')]);_0x5d665b[_0x2f8f('0x3c')]=_[_0x2f8f('0x34')](_0x5d665b[_0x2f8f('0x31')],_0x5d665b[_0x2f8f('0x32')]);_0x8bf041[_0x2f8f('0x35')]=_[_0x2f8f('0x34')](_0x5d665b[_0x2f8f('0x31')],qs[_0x2f8f('0x36')](_0x5d0cb1[_0x2f8f('0x32')][_0x2f8f('0x36')]));_0x8bf041[_0x2f8f('0x35')]=_0x8bf041[_0x2f8f('0x35')][_0x2f8f('0x45')]?_0x8bf041[_0x2f8f('0x35')]:_0x5d665b[_0x2f8f('0x31')];if(_0x5d0cb1[_0x2f8f('0x32')][_0x2f8f('0x40')]){_0x8bf041['include']=[{'all':!![]}];}_0x8bf041=_['merge']({},_0x8bf041,_0x5d0cb1[_0x2f8f('0x3f')]);return db['WhatsappApplication'][_0x2f8f('0x46')](_0x8bf041)[_0x2f8f('0x25')](handleEntityNotFound(_0x4af90b,null))['then'](respondWithResult(_0x4af90b,null))['catch'](handleError(_0x4af90b,null));};exports['create']=function(_0x3c228e,_0x3c1cf4){return db[_0x2f8f('0x2c')]['create'](_0x3c228e[_0x2f8f('0x47')],{})[_0x2f8f('0x25')](respondWithResult(_0x3c1cf4,0xc9))[_0x2f8f('0x48')](handleError(_0x3c1cf4,null));};exports[_0x2f8f('0x24')]=function(_0x5d9938,_0x27d35e){if(_0x5d9938['body']['id']){delete _0x5d9938['body']['id'];}return db['WhatsappApplication'][_0x2f8f('0x46')]({'where':{'id':_0x5d9938[_0x2f8f('0x49')]['id']}})[_0x2f8f('0x25')](handleEntityNotFound(_0x27d35e,null))[_0x2f8f('0x25')](saveUpdates(_0x5d9938[_0x2f8f('0x47')],null))[_0x2f8f('0x25')](respondWithResult(_0x27d35e,null))[_0x2f8f('0x48')](handleError(_0x27d35e,null));};exports[_0x2f8f('0x26')]=function(_0x2cf8d9,_0x34bcdc){return db[_0x2f8f('0x2c')][_0x2f8f('0x46')]({'where':{'id':_0x2cf8d9[_0x2f8f('0x49')]['id']}})[_0x2f8f('0x25')](handleEntityNotFound(_0x34bcdc,null))['then'](removeEntity(_0x34bcdc,null))[_0x2f8f('0x48')](handleError(_0x34bcdc,null));}; \ No newline at end of file +var _0x4753=['create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','catch'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0x4753,0x1f4));var _0x3475=function(_0x30261c,_0x431962){_0x30261c=_0x30261c-0x0;var _0x2719dc=_0x4753[_0x30261c];return _0x2719dc;};'use strict';var emlformat=require(_0x3475('0x0'));var rimraf=require(_0x3475('0x1'));var zipdir=require(_0x3475('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3475('0x3'));var moment=require(_0x3475('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3475('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3475('0x6'));var fs=require('fs');var fs_extra=require(_0x3475('0x7'));var _=require('lodash');var squel=require(_0x3475('0x8'));var crypto=require(_0x3475('0x9'));var jsforce=require(_0x3475('0xa'));var deskjs=require(_0x3475('0xb'));var toCsv=require(_0x3475('0xc'));var querystring=require(_0x3475('0xd'));var Papa=require(_0x3475('0xe'));var Redis=require(_0x3475('0xf'));var authService=require(_0x3475('0x10'));var qs=require(_0x3475('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3475('0x12'));var logger=require(_0x3475('0x13'))(_0x3475('0x14'));var utils=require('../../config/utils');var config=require(_0x3475('0x15'));var licenseUtil=require(_0x3475('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4510dc,_0x5a1f57){_0x5a1f57=_0x5a1f57||0xcc;return function(_0x907c8b){if(_0x907c8b){return _0x4510dc[_0x3475('0x17')](_0x5a1f57);}return _0x4510dc[_0x3475('0x18')](_0x5a1f57)['end']();};}function respondWithResult(_0x3fbdd5,_0x36d593){_0x36d593=_0x36d593||0xc8;return function(_0x306cd8){if(_0x306cd8){return _0x3fbdd5[_0x3475('0x18')](_0x36d593)['json'](_0x306cd8);}};}function respondWithFilteredResult(_0x455322,_0x56e77a){return function(_0x4b21af){if(_0x4b21af){var _0x3fd0d2=typeof _0x56e77a[_0x3475('0x19')]===_0x3475('0x1a')&&typeof _0x56e77a[_0x3475('0x1b')]===_0x3475('0x1a');var _0x49ba96=_0x4b21af[_0x3475('0x1c')];var _0x547009=_0x3fd0d2?0x0:_0x56e77a[_0x3475('0x19')];var _0x26764a=_0x3fd0d2?_0x4b21af[_0x3475('0x1c')]:_0x56e77a[_0x3475('0x19')]+_0x56e77a['limit'];var _0x3711a1;if(_0x26764a>=_0x49ba96){_0x26764a=_0x49ba96;_0x3711a1=0xc8;}else{_0x3711a1=0xce;}_0x455322['status'](_0x3711a1);return _0x455322[_0x3475('0x1d')](_0x3475('0x1e'),_0x547009+'-'+_0x26764a+'/'+_0x49ba96)[_0x3475('0x1f')](_0x4b21af);}return null;};}function patchUpdates(_0x18b0f7){return function(_0x5d85a4){try{jsonpatch[_0x3475('0x20')](_0x5d85a4,_0x18b0f7,!![]);}catch(_0xdac710){return BPromise[_0x3475('0x21')](_0xdac710);}return _0x5d85a4['save']();};}function saveUpdates(_0x217f68,_0x381aea){return function(_0x438992){if(_0x438992){return _0x438992[_0x3475('0x22')](_0x217f68)[_0x3475('0x23')](function(_0x44b708){return _0x44b708;});}return null;};}function removeEntity(_0x412d53,_0x1d72f9){return function(_0x10746b){if(_0x10746b){return _0x10746b[_0x3475('0x24')]()[_0x3475('0x23')](function(){_0x412d53[_0x3475('0x18')](0xcc)[_0x3475('0x25')]();});}};}function handleEntityNotFound(_0x4ff2a1,_0x4d35f9){return function(_0x52c825){if(!_0x52c825){_0x4ff2a1[_0x3475('0x17')](0x194);}return _0x52c825;};}function handleError(_0x2939e3,_0x4ad783){_0x4ad783=_0x4ad783||0x1f4;return function(_0x1f3481){logger[_0x3475('0x26')](_0x1f3481[_0x3475('0x27')]);if(_0x1f3481[_0x3475('0x28')]){delete _0x1f3481[_0x3475('0x28')];}_0x2939e3['status'](_0x4ad783)['send'](_0x1f3481);};}exports[_0x3475('0x29')]=function(_0x465d42,_0x3e78a8){var _0x3a3b8a={},_0x2a3ced={},_0x2755cc={'count':0x0,'rows':[]};var _0x5e8cc3=_[_0x3475('0x2a')](db[_0x3475('0x2b')][_0x3475('0x2c')],function(_0x19bc27){return{'name':_0x19bc27[_0x3475('0x2d')],'type':_0x19bc27['type']['key']};});_0x2a3ced[_0x3475('0x2e')]=_[_0x3475('0x2a')](_0x5e8cc3,_0x3475('0x28'));_0x2a3ced['query']=_[_0x3475('0x2f')](_0x465d42[_0x3475('0x30')]);_0x2a3ced[_0x3475('0x31')]=_[_0x3475('0x32')](_0x2a3ced[_0x3475('0x2e')],_0x2a3ced[_0x3475('0x30')]);_0x3a3b8a[_0x3475('0x33')]=_['intersection'](_0x2a3ced[_0x3475('0x2e')],qs[_0x3475('0x34')](_0x465d42[_0x3475('0x30')][_0x3475('0x34')]));_0x3a3b8a[_0x3475('0x33')]=_0x3a3b8a[_0x3475('0x33')][_0x3475('0x35')]?_0x3a3b8a[_0x3475('0x33')]:_0x2a3ced[_0x3475('0x2e')];if(!_0x465d42[_0x3475('0x30')]['hasOwnProperty']('nolimit')){_0x3a3b8a[_0x3475('0x1b')]=qs[_0x3475('0x1b')](_0x465d42[_0x3475('0x30')][_0x3475('0x1b')]);_0x3a3b8a[_0x3475('0x19')]=qs['offset'](_0x465d42['query'][_0x3475('0x19')]);}_0x3a3b8a[_0x3475('0x36')]=qs[_0x3475('0x37')](_0x465d42[_0x3475('0x30')]['sort']);_0x3a3b8a[_0x3475('0x38')]=qs[_0x3475('0x31')](_[_0x3475('0x39')](_0x465d42[_0x3475('0x30')],_0x2a3ced[_0x3475('0x31')]),_0x5e8cc3);if(_0x465d42[_0x3475('0x30')][_0x3475('0x3a')]){_0x3a3b8a[_0x3475('0x38')]=_[_0x3475('0x3b')](_0x3a3b8a[_0x3475('0x38')],{'$or':_[_0x3475('0x2a')](_0x5e8cc3,function(_0x5909db){if(_0x5909db['type']!==_0x3475('0x3c')){var _0x19760a={};_0x19760a[_0x5909db[_0x3475('0x28')]]={'$like':'%'+_0x465d42[_0x3475('0x30')][_0x3475('0x3a')]+'%'};return _0x19760a;}})});}_0x3a3b8a=_[_0x3475('0x3b')]({},_0x3a3b8a,_0x465d42[_0x3475('0x3d')]);var _0x191818={'where':_0x3a3b8a['where']};return db[_0x3475('0x2b')][_0x3475('0x1c')](_0x191818)[_0x3475('0x23')](function(_0x5962d4){_0x2755cc[_0x3475('0x1c')]=_0x5962d4;if(_0x465d42[_0x3475('0x30')][_0x3475('0x3e')]){_0x3a3b8a[_0x3475('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x3475('0x40')](_0x3a3b8a);})[_0x3475('0x23')](function(_0xcd8f8d){_0x2755cc['rows']=_0xcd8f8d;return _0x2755cc;})[_0x3475('0x23')](respondWithFilteredResult(_0x3e78a8,_0x3a3b8a))['catch'](handleError(_0x3e78a8,null));};exports[_0x3475('0x41')]=function(_0x2bfe1c,_0x2b40b9){var _0x14de28={'raw':!![],'where':{'id':_0x2bfe1c['params']['id']}},_0x1c9a92={};_0x1c9a92[_0x3475('0x2e')]=_['keys'](db['WhatsappApplication'][_0x3475('0x2c')]);_0x1c9a92[_0x3475('0x30')]=_['keys'](_0x2bfe1c[_0x3475('0x30')]);_0x1c9a92[_0x3475('0x31')]=_[_0x3475('0x32')](_0x1c9a92[_0x3475('0x2e')],_0x1c9a92['query']);_0x14de28['attributes']=_[_0x3475('0x32')](_0x1c9a92['model'],qs['fields'](_0x2bfe1c['query'][_0x3475('0x34')]));_0x14de28['attributes']=_0x14de28[_0x3475('0x33')][_0x3475('0x35')]?_0x14de28[_0x3475('0x33')]:_0x1c9a92[_0x3475('0x2e')];if(_0x2bfe1c[_0x3475('0x30')][_0x3475('0x3e')]){_0x14de28['include']=[{'all':!![]}];}_0x14de28=_[_0x3475('0x3b')]({},_0x14de28,_0x2bfe1c['options']);return db[_0x3475('0x2b')][_0x3475('0x42')](_0x14de28)[_0x3475('0x23')](handleEntityNotFound(_0x2b40b9,null))[_0x3475('0x23')](respondWithResult(_0x2b40b9,null))[_0x3475('0x43')](handleError(_0x2b40b9,null));};exports[_0x3475('0x44')]=function(_0x554959,_0x24991a){return db['WhatsappApplication'][_0x3475('0x44')](_0x554959['body'],{})['then'](respondWithResult(_0x24991a,0xc9))[_0x3475('0x43')](handleError(_0x24991a,null));};exports[_0x3475('0x22')]=function(_0x35f1f2,_0x4e3390){if(_0x35f1f2['body']['id']){delete _0x35f1f2[_0x3475('0x45')]['id'];}return db['WhatsappApplication'][_0x3475('0x42')]({'where':{'id':_0x35f1f2[_0x3475('0x46')]['id']}})[_0x3475('0x23')](handleEntityNotFound(_0x4e3390,null))[_0x3475('0x23')](saveUpdates(_0x35f1f2['body'],null))[_0x3475('0x23')](respondWithResult(_0x4e3390,null))['catch'](handleError(_0x4e3390,null));};exports['destroy']=function(_0x534b77,_0x266961){return db[_0x3475('0x2b')][_0x3475('0x42')]({'where':{'id':_0x534b77['params']['id']}})[_0x3475('0x23')](handleEntityNotFound(_0x266961,null))[_0x3475('0x23')](removeEntity(_0x266961,null))['catch'](handleError(_0x266961,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 60a3b69..83683ba 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 _0x17ba=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x4ccdee,_0x5ec92f){var _0x330ec9=function(_0x3d5aec){while(--_0x3d5aec){_0x4ccdee['push'](_0x4ccdee['shift']());}};_0x330ec9(++_0x5ec92f);}(_0x17ba,0xab));var _0xa17b=function(_0x571634,_0x4fa064){_0x571634=_0x571634-0x0;var _0x10f2a5=_0x17ba[_0x571634];return _0x10f2a5;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var attributes=require(_0xa17b('0x9'));module[_0xa17b('0xa')]=function(_0x3cced2,_0xf72ed4){return _0x3cced2[_0xa17b('0xb')](_0xa17b('0xc'),attributes,{'tableName':_0xa17b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa17b('0xe'),'collate':_0xa17b('0xf')});}; \ No newline at end of file +var _0x093a=['api','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1e21df,_0x49e8e2){var _0x46c016=function(_0x3ba0ce){while(--_0x3ba0ce){_0x1e21df['push'](_0x1e21df['shift']());}};_0x46c016(++_0x49e8e2);}(_0x093a,0x16a));var _0xa093=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x093a[_0x510b98];return _0x45e775;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var logger=require(_0xa093('0x1'))(_0xa093('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa093('0x3'));var fs=require('fs');var path=require(_0xa093('0x4'));var rimraf=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var attributes=require(_0xa093('0x7'));module[_0xa093('0x8')]=function(_0x2346f1,_0x145f58){return _0x2346f1[_0xa093('0x9')](_0xa093('0xa'),attributes,{'tableName':_0xa093('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa093('0xc'),'collate':_0xa093('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 4fe2b2e..5111ac1 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 _0xd6d6=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x59427c,_0x5e862d){var _0x4cac2d=function(_0x4b0533){while(--_0x4b0533){_0x59427c['push'](_0x59427c['shift']());}};_0x4cac2d(++_0x5e862d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x14a66b,_0x116e54){_0x14a66b=_0x14a66b-0x0;var _0x3d8431=_0xd6d6[_0x14a66b];return _0x3d8431;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x4996d3,_0x4e6002){var _0x82e84c=function(_0x1898c4){while(--_0x1898c4){_0x4996d3['push'](_0x4996d3['shift']());}};_0x82e84c(++_0x4e6002);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4ccc20,_0x5e33d6){_0x4ccc20=_0x4ccc20-0x0;var _0x348fd8=_0xa8a8[_0x4ccc20];return _0x348fd8;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index e5b28c5..c0b5d4c 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 _0x444e=['addTags','put','tracked','whatsappinteraction:update','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','post','create','/:id/tags','whatsapp'];(function(_0x3a81f5,_0x11137c){var _0x54425c=function(_0x4ed337){while(--_0x4ed337){_0x3a81f5['push'](_0x3a81f5['shift']());}};_0x54425c(++_0x11137c);}(_0x444e,0xe8));var _0xe444=function(_0x564dd7,_0x248174){_0x564dd7=_0x564dd7-0x0;var _0xede844=_0x444e[_0x564dd7];return _0xede844;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['get'](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0xd')]);router['get']('/:id/messages',auth[_0xe444('0x8')](),controller[_0xe444('0xe')]);router['get'](_0xe444('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xe444('0x10')]('/',auth['isAuthenticated'](),controller[_0xe444('0x11')]);router[_0xe444('0x10')]('/:id/messages',auth[_0xe444('0x8')](),controller['addMessage']);router['post'](_0xe444('0x12'),auth[_0xe444('0x8')](),interaction['tracked'](_0xe444('0x13'),'whatsappinteraction:addtags'),controller[_0xe444('0x14')]);router[_0xe444('0x15')](_0xe444('0xc'),auth[_0xe444('0x8')](),interaction[_0xe444('0x16')](_0xe444('0x13'),_0xe444('0x17')),controller[_0xe444('0x18')]);router[_0xe444('0x19')](_0xe444('0xc'),auth[_0xe444('0x8')](),interaction[_0xe444('0x16')](_0xe444('0x13'),'whatsappinteraction:destroy'),controller[_0xe444('0x1a')]);router[_0xe444('0x19')](_0xe444('0x12'),auth[_0xe444('0x8')](),controller['removeTags']);module[_0xe444('0x1b')]=router; \ No newline at end of file +var _0x4f0d=['show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id'];(function(_0x331639,_0x3ceeaa){var _0x5420ea=function(_0x175c36){while(--_0x175c36){_0x331639['push'](_0x331639['shift']());}};_0x5420ea(++_0x3ceeaa);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0x4f0d[_0x2a2e72];return _0x3cfb4a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd4f0('0x0')]();var fs_extra=require(_0xd4f0('0x1'));var auth=require(_0xd4f0('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd4f0('0x3'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xd4f0('0x4')](),controller['index']);router[_0xd4f0('0x5')](_0xd4f0('0x6'),auth['isAuthenticated'](),controller[_0xd4f0('0x7')]);router[_0xd4f0('0x5')](_0xd4f0('0x8'),auth[_0xd4f0('0x4')](),controller[_0xd4f0('0x9')]);router['get'](_0xd4f0('0xa'),auth[_0xd4f0('0x4')](),controller['getMessages']);router['get'](_0xd4f0('0xb'),auth[_0xd4f0('0x4')](),controller['download']);router[_0xd4f0('0xc')]('/',auth[_0xd4f0('0x4')](),controller[_0xd4f0('0xd')]);router[_0xd4f0('0xc')](_0xd4f0('0xa'),auth['isAuthenticated'](),controller[_0xd4f0('0xe')]);router[_0xd4f0('0xc')](_0xd4f0('0xf'),auth[_0xd4f0('0x4')](),interaction[_0xd4f0('0x10')](_0xd4f0('0x11'),_0xd4f0('0x12')),controller[_0xd4f0('0x13')]);router[_0xd4f0('0x14')](_0xd4f0('0x8'),auth[_0xd4f0('0x4')](),interaction[_0xd4f0('0x10')]('whatsapp','whatsappinteraction:update'),controller[_0xd4f0('0x15')]);router[_0xd4f0('0x16')](_0xd4f0('0x8'),auth[_0xd4f0('0x4')](),interaction['tracked']('whatsapp',_0xd4f0('0x17')),controller[_0xd4f0('0x18')]);router[_0xd4f0('0x16')](_0xd4f0('0xf'),auth[_0xd4f0('0x4')](),controller[_0xd4f0('0x19')]);module[_0xd4f0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 120d9b7..7a4a220 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 _0x4677=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x417211,_0x473c09){var _0x2c04a5=function(_0x4a3bb8){while(--_0x4a3bb8){_0x417211['push'](_0x417211['shift']());}};_0x2c04a5(++_0x473c09);}(_0x4677,0x155));var _0x7467=function(_0x289518,_0x598901){_0x289518=_0x289518-0x0;var _0x170a46=_0x4677[_0x289518];return _0x170a46;};'use strict';var Sequelize=require(_0x7467('0x0'));var moment=require('moment');module[_0x7467('0x1')]={'closed':{'type':Sequelize[_0x7467('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7467('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7467('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7467('0x4')]},'note':{'type':Sequelize[_0x7467('0x4')]},'phone':{'type':Sequelize[_0x7467('0x4')]},'read1stAt':{'type':Sequelize[_0x7467('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7467('0x5')]('in',_0x7467('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7467('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7467('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe4b8=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x31b7f5,_0x223407){var _0x29f497=function(_0x294f10){while(--_0x294f10){_0x31b7f5['push'](_0x31b7f5['shift']());}};_0x29f497(++_0x223407);}(_0xe4b8,0x179));var _0x8e4b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe4b8[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x8e4b('0x0'));var moment=require(_0x8e4b('0x1'));module[_0x8e4b('0x2')]={'closed':{'type':Sequelize[_0x8e4b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8e4b('0x4')]},'disposition':{'type':Sequelize[_0x8e4b('0x5')]},'secondDisposition':{'type':Sequelize[_0x8e4b('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8e4b('0x5')]},'read1stAt':{'type':Sequelize[_0x8e4b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x8e4b('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8e4b('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8e4b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 338963f..da3a226 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 _0xc6d7=['$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','forEach','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.email','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','catch','params','WhatsappInteraction','include','merge','options','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','includeAll','findAll','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','fullname','CmContact','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','existsSync','pipe','out','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','Users','TagIds','Tags','split','answered','unmanaged','total','closed','UserId','waiting','talking','index','rawAttributes','type','key','model','map','query','intersection','attributes','fields','nolimit','order','sort','pick','filters','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','isEmpty','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte'];(function(_0x37f4df,_0x1ad8af){var _0x2c9462=function(_0x53517e){while(--_0x53517e){_0x37f4df['push'](_0x37f4df['shift']());}};_0x2c9462(++_0x1ad8af);}(_0xc6d7,0x71));var _0x7c6d=function(_0x186fc3,_0xda4714){_0x186fc3=_0x186fc3-0x0;var _0x288e5=_0xc6d7[_0x186fc3];return _0x288e5;};'use strict';var emlformat=require(_0x7c6d('0x0'));var rimraf=require(_0x7c6d('0x1'));var zipdir=require(_0x7c6d('0x2'));var jsonpatch=require(_0x7c6d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7c6d('0x4'));var Mustache=require(_0x7c6d('0x5'));var util=require(_0x7c6d('0x6'));var path=require(_0x7c6d('0x7'));var sox=require(_0x7c6d('0x8'));var csv=require(_0x7c6d('0x9'));var ejs=require(_0x7c6d('0xa'));var fs=require('fs');var fs_extra=require(_0x7c6d('0xb'));var _=require(_0x7c6d('0xc'));var squel=require(_0x7c6d('0xd'));var crypto=require(_0x7c6d('0xe'));var jsforce=require(_0x7c6d('0xf'));var deskjs=require(_0x7c6d('0x10'));var toCsv=require(_0x7c6d('0x9'));var querystring=require('querystring');var Papa=require(_0x7c6d('0x11'));var Redis=require('ioredis');var authService=require(_0x7c6d('0x12'));var qs=require(_0x7c6d('0x13'));var as=require(_0x7c6d('0x14'));var pdf=require(_0x7c6d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c6d('0x16'))(_0x7c6d('0x17'));var utils=require(_0x7c6d('0x18'));var config=require(_0x7c6d('0x19'));var licenseUtil=require(_0x7c6d('0x1a'));var db=require(_0x7c6d('0x1b'))['db'];config[_0x7c6d('0x1c')]=_['defaults'](config[_0x7c6d('0x1c')],{'host':_0x7c6d('0x1d'),'port':0x18eb});var socket=require(_0x7c6d('0x1e'))(new Redis(config[_0x7c6d('0x1c')]));require(_0x7c6d('0x1f'))[_0x7c6d('0x20')](socket);function respondWithStatusCode(_0x1a5a82,_0x2149ea){_0x2149ea=_0x2149ea||0xcc;return function(_0x27d31a){if(_0x27d31a){return _0x1a5a82['sendStatus'](_0x2149ea);}return _0x1a5a82[_0x7c6d('0x21')](_0x2149ea)[_0x7c6d('0x22')]();};}function respondWithResult(_0x57d8b2,_0x398007){_0x398007=_0x398007||0xc8;return function(_0x220bae){if(_0x220bae){return _0x57d8b2[_0x7c6d('0x21')](_0x398007)[_0x7c6d('0x23')](_0x220bae);}};}function respondWithFilteredResult(_0x70d2d2,_0x156474){return function(_0x33f097){if(_0x33f097){var _0x3c39e6=typeof _0x156474[_0x7c6d('0x24')]==='undefined'&&typeof _0x156474[_0x7c6d('0x25')]==='undefined';var _0x4020b8=_0x33f097[_0x7c6d('0x26')];var _0x4a40e8=_0x3c39e6?0x0:_0x156474[_0x7c6d('0x24')];var _0x149bd3=_0x3c39e6?_0x33f097[_0x7c6d('0x26')]:_0x156474[_0x7c6d('0x24')]+_0x156474[_0x7c6d('0x25')];var _0x4b3a33;if(_0x149bd3>=_0x4020b8){_0x149bd3=_0x4020b8;_0x4b3a33=0xc8;}else{_0x4b3a33=0xce;}_0x70d2d2[_0x7c6d('0x21')](_0x4b3a33);return _0x70d2d2[_0x7c6d('0x27')](_0x7c6d('0x28'),_0x4a40e8+'-'+_0x149bd3+'/'+_0x4020b8)[_0x7c6d('0x23')](_0x33f097);}return null;};}function patchUpdates(_0x5ab3e5){return function(_0x35fb7d){try{jsonpatch[_0x7c6d('0x29')](_0x35fb7d,_0x5ab3e5,!![]);}catch(_0x3a6928){return BPromise[_0x7c6d('0x2a')](_0x3a6928);}return _0x35fb7d[_0x7c6d('0x2b')]();};}function saveUpdates(_0x3a0129,_0x589046){return function(_0x3e9377){if(_0x3e9377){return _0x3e9377[_0x7c6d('0x2c')](_0x3a0129)[_0x7c6d('0x2d')](function(_0x81bb1b){return _0x81bb1b;});}return null;};}function removeEntity(_0x5154cd,_0x53461a){return function(_0x57c4c9){if(_0x57c4c9){return _0x57c4c9[_0x7c6d('0x2e')]()[_0x7c6d('0x2d')](function(){_0x5154cd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f9e80,_0x3766cb){return function(_0x4378a4){if(!_0x4378a4){_0x4f9e80[_0x7c6d('0x2f')](0x194);}return _0x4378a4;};}function handleError(_0x448e41,_0x194276){_0x194276=_0x194276||0x1f4;return function(_0x162efb){logger['error'](_0x162efb['stack']);if(_0x162efb['name']){delete _0x162efb[_0x7c6d('0x30')];}_0x448e41[_0x7c6d('0x21')](_0x194276)['send'](_0x162efb);};}function getInteractionUsers(_0x152225,_0x2bb96b){return new BPromise(function(_0x435b52,_0x297056){try{if(_0x2bb96b[_0x152225['id']]){_0x152225[_0x7c6d('0x31')]=_['map'](_0x2bb96b[_0x152225['id']],function(_0x47b8ef){return{'id':_0x47b8ef['id'],'fullname':_0x47b8ef['fullname']};});}}catch(_0x6dfef6){_0x297056(_0x6dfef6);}_0x435b52(_0x152225);});}function getInteractionTags(_0x4edfaa,_0x86bef1){return new BPromise(function(_0x5cb915,_0x48f655){try{if(_0x4edfaa[_0x7c6d('0x32')]){_0x4edfaa[_0x7c6d('0x33')]=[];_0x4edfaa[_0x7c6d('0x32')][_0x7c6d('0x34')](',')['forEach'](function(_0x56ac2e){_0x4edfaa[_0x7c6d('0x33')]['push'](_0x86bef1[_0x56ac2e]);});}delete _0x4edfaa[_0x7c6d('0x32')];}catch(_0x5375f6){_0x48f655(_0x5375f6);}_0x5cb915(_0x4edfaa);});}function updateWhatsappInteraction(_0x3dd7a8,_0x23a8e9,_0xb92090){return new BPromise(function(_0x3587b3,_0x802aa3){return getInteractionUsers(_0x3dd7a8,_0xb92090)[_0x7c6d('0x2d')](function(_0x432aca){return getInteractionTags(_0x432aca,_0x23a8e9);})[_0x7c6d('0x2d')](function(_0x2795bd){return getStateInteraction(_0x2795bd);})[_0x7c6d('0x2d')](function(_0x3cebed){_0x3587b3(_0x3cebed);})['catch'](function(_0x31c7c9){_0x802aa3(_0x31c7c9);});});}function getStateInteraction(_0x4af647){return new BPromise(function(_0x26115a){_0x4af647['waiting']=0x0;_0x4af647['talking']=0x0;_0x4af647[_0x7c6d('0x35')]=0x0;_0x4af647[_0x7c6d('0x36')]=0x0;_0x4af647[_0x7c6d('0x37')]=0x0;if(!_0x4af647[_0x7c6d('0x38')]&&!_0x4af647[_0x7c6d('0x39')]){_0x4af647[_0x7c6d('0x3a')]+=0x1;}if(!_0x4af647[_0x7c6d('0x38')]&&_0x4af647[_0x7c6d('0x39')]){_0x4af647[_0x7c6d('0x3b')]+=0x1;if(_0x4af647[_0x7c6d('0x3a')]){_0x4af647[_0x7c6d('0x3a')]-=0x1;}}if(_0x4af647['closed']&&_0x4af647[_0x7c6d('0x39')]){_0x4af647[_0x7c6d('0x35')]+=0x1;if(_0x4af647[_0x7c6d('0x3b')]){_0x4af647[_0x7c6d('0x3b')]-=0x1;}}if(_0x4af647[_0x7c6d('0x38')]&&!_0x4af647['UserId']){_0x4af647['unmanaged']+=0x1;if(_0x4af647[_0x7c6d('0x3a')]){_0x4af647[_0x7c6d('0x3a')]-=0x1;}}_0x4af647[_0x7c6d('0x37')]+=0x1;_0x26115a(_0x4af647);});}exports[_0x7c6d('0x3c')]=function(_0x39d823,_0x29460e){var _0x2af9de={},_0x249aa0={},_0x1e7a8a={'count':0x0,'rows':[]};var _0x3b7571=_['map'](db['WhatsappInteraction'][_0x7c6d('0x3d')],function(_0x346f1d){return{'name':_0x346f1d['fieldName'],'type':_0x346f1d[_0x7c6d('0x3e')][_0x7c6d('0x3f')]};});_0x249aa0[_0x7c6d('0x40')]=_[_0x7c6d('0x41')](_0x3b7571,_0x7c6d('0x30'));_0x249aa0[_0x7c6d('0x42')]=_['keys'](_0x39d823[_0x7c6d('0x42')]);_0x249aa0['filters']=_[_0x7c6d('0x43')](_0x249aa0['model'],_0x249aa0['query']);_0x2af9de[_0x7c6d('0x44')]=_['intersection'](_0x249aa0[_0x7c6d('0x40')],qs['fields'](_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x45')]));_0x2af9de['attributes']=_0x2af9de['attributes']['length']?_0x2af9de[_0x7c6d('0x44')]:_0x249aa0['model'];if(!_0x39d823['query']['hasOwnProperty'](_0x7c6d('0x46'))){_0x2af9de['limit']=qs[_0x7c6d('0x25')](_0x39d823['query']['limit']);_0x2af9de[_0x7c6d('0x24')]=qs['offset'](_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x24')]);}_0x2af9de[_0x7c6d('0x47')]=qs[_0x7c6d('0x48')](_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x48')]);_0x2af9de['where']=qs['filters'](_[_0x7c6d('0x49')](_0x39d823[_0x7c6d('0x42')],_0x249aa0[_0x7c6d('0x4a')]),_0x3b7571);var _0x29a169=[];var _0x310b86=squel['select']()[_0x7c6d('0x4b')]('id')[_0x7c6d('0x4b')](_0x7c6d('0x30'))[_0x7c6d('0x4b')]('color')[_0x7c6d('0x4c')](_0x7c6d('0x4d'));var _0x4d1b90=squel['select']()[_0x7c6d('0x4b')](_0x7c6d('0x4e'))[_0x7c6d('0x4b')](_0x7c6d('0x4f'))['field'](_0x7c6d('0x50'))[_0x7c6d('0x4c')](_0x7c6d('0x51'),'ui')[_0x7c6d('0x52')](_0x7c6d('0x53'),'u',_0x7c6d('0x54'));var _0x272d10=squel[_0x7c6d('0x55')]()[_0x7c6d('0x4c')](_0x7c6d('0x56'),'i')['left_join'](_0x7c6d('0x57'),'c',_0x7c6d('0x58'))[_0x7c6d('0x52')]('users','o','o.id\x20=\x20i.UserId')[_0x7c6d('0x52')]('whatsapp_accounts','a',_0x7c6d('0x59'))[_0x7c6d('0x52')](_0x7c6d('0x5a'),'me',_0x7c6d('0x5b'))[_0x7c6d('0x52')]('whatsapp_interaction_has_tags','it',_0x7c6d('0x5c'))[_0x7c6d('0x52')](_0x7c6d('0x4d'),'t',_0x7c6d('0x5d'));var _0x46ffc7=squel[_0x7c6d('0x5e')]();var _0x384b54=[];var _0x37d9e7=squel[_0x7c6d('0x5e')]();var _0x513c08;if(_0x39d823['query'][_0x7c6d('0x5f')]){_0x513c08=as[_0x7c6d('0x60')](_0x39d823['query'][_0x7c6d('0x5f')]);var _0x3597df=_0x513c08[_0x7c6d('0x61')];for(var _0x236ac1=0x0;_0x236ac1<_0x513c08[_0x7c6d('0x62')]['length'];_0x236ac1++){var _0x31fbde=_0x513c08[_0x7c6d('0x62')][_0x236ac1];var _0x3f83f7='i';var _0x414575=_[_0x7c6d('0x63')](_0x3b7571,[_0x7c6d('0x30'),_0x31fbde[_0x7c6d('0x4b')]]);if(!_0x414575){switch(_0x31fbde['field']){case _0x7c6d('0x64'):if(_0x31fbde[_0x7c6d('0x65')]==0x1){_0x272d10['having']('`'+_0x31fbde['field']+'`\x20=\x200');}else{_0x272d10[_0x7c6d('0x66')]('`'+_0x31fbde[_0x7c6d('0x4b')]+_0x7c6d('0x67'));}break;case _0x7c6d('0x68'):if(_0x31fbde[_0x7c6d('0x69')]===_0x7c6d('0x6a')){if(_0x31fbde[_0x7c6d('0x65')][_0x7c6d('0x34')]('\x20')[_0x7c6d('0x6b')]>0x1){_0x46ffc7[_0x3597df](_0x7c6d('0x6c'),qs[_0x7c6d('0x6d')](_0x31fbde[_0x7c6d('0x65')]),null);}else{var _0x50857b='%'+_0x31fbde[_0x7c6d('0x65')]+'%';_0x46ffc7[_0x3597df]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x50857b,_0x50857b,_0x50857b);}}else{_0x414575=_[_0x7c6d('0x63')](_0x3b7571,[_0x7c6d('0x30'),_0x7c6d('0x6e')]);_0x31fbde['field']=_0x7c6d('0x6e');_0x39ba0e=as[_0x7c6d('0x6f')](_0x3f83f7,_0x414575[_0x7c6d('0x3e')],_0x31fbde);_0x46ffc7[_0x3597df](_0x39ba0e[_0x7c6d('0x70')],_0x39ba0e[_0x7c6d('0x65')][_0x7c6d('0x71')],_0x39ba0e['value'][_0x7c6d('0x22')]);}break;case'Tag':var _0x4c6d64=_0x31fbde[_0x7c6d('0x65')][_0x7c6d('0x34')](',')['map'](function(_0x17b809){return Number(_0x17b809);});_0x4c6d64['forEach'](function(_0x52ccb8){_0x37d9e7['or'](_0x7c6d('0x72'),'%,'+_0x52ccb8+',%');});_0x384b54=_[_0x7c6d('0x73')](_0x384b54,_0x4c6d64);break;case _0x7c6d('0x74'):if(_0x31fbde[_0x7c6d('0x69')]===_0x7c6d('0x6a')){_0x46ffc7[_0x3597df](_0x7c6d('0x75'),'%'+_0x31fbde[_0x7c6d('0x65')]+'%',null);}else{_0x414575=_[_0x7c6d('0x63')](_0x3b7571,[_0x7c6d('0x30'),_0x7c6d('0x39')]);_0x31fbde[_0x7c6d('0x4b')]=_0x7c6d('0x39');_0x39ba0e=as[_0x7c6d('0x6f')](_0x3f83f7,_0x414575[_0x7c6d('0x3e')],_0x31fbde);_0x46ffc7[_0x3597df](_0x39ba0e[_0x7c6d('0x70')],_0x39ba0e[_0x7c6d('0x65')][_0x7c6d('0x71')],_0x39ba0e[_0x7c6d('0x65')][_0x7c6d('0x22')]);}break;case'body':_0x39ba0e=as[_0x7c6d('0x6f')]('me',null,_0x31fbde);_0x46ffc7[_0x3597df](_0x39ba0e['text'],_0x39ba0e[_0x7c6d('0x65')]['start'],_0x39ba0e[_0x7c6d('0x65')][_0x7c6d('0x22')]);break;}}else{var _0x39ba0e=as[_0x7c6d('0x6f')](_0x3f83f7,_0x414575['type'],_0x31fbde);_0x46ffc7[_0x3597df](_0x39ba0e[_0x7c6d('0x70')],_0x39ba0e[_0x7c6d('0x65')][_0x7c6d('0x71')],_0x39ba0e[_0x7c6d('0x65')][_0x7c6d('0x22')]);}}}else{var _0x962855=_(_0x39d823[_0x7c6d('0x42')])[_0x7c6d('0x76')]()[_0x7c6d('0x41')](function(_0x4a799c){return _[_0x7c6d('0x77')](_0x3b7571,[_0x7c6d('0x30'),_0x4a799c])?_0x4a799c:undefined;})[_0x7c6d('0x78')]()['value']();if(!_[_0x7c6d('0x79')](_0x962855)){_0x962855['forEach'](function(_0x445ff8){if(_0x445ff8==='WhatsappAccountId'){_0x272d10[_0x7c6d('0x7a')](_0x7c6d('0x7b'),[][_0x7c6d('0x7c')](_0x39d823[_0x7c6d('0x42')][_0x445ff8]));}else if(_0x445ff8===_0x7c6d('0x7d')){var _0x431b31=JSON[_0x7c6d('0x7e')](_0x39d823[_0x7c6d('0x42')][_0x445ff8])[_0x7c6d('0x7f')];var _0x270a8f=JSON['parse'](_0x39d823[_0x7c6d('0x42')][_0x445ff8])[_0x7c6d('0x80')];_0x272d10[_0x7c6d('0x7a')](_0x7c6d('0x81'),_0x431b31,_0x270a8f);}else{if(_0x39d823[_0x7c6d('0x42')][_0x445ff8]==='null'){_0x272d10['where']('i.'+_0x445ff8+_0x7c6d('0x82'));}else{_0x272d10[_0x7c6d('0x7a')]('i.'+_0x445ff8+_0x7c6d('0x83'),_0x39d823[_0x7c6d('0x42')][_0x445ff8]);}}});}if(_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x84')]){if(_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x84')]==0x1){_0x272d10[_0x7c6d('0x66')]('`unreadMessages`\x20=\x200');}else{_0x272d10[_0x7c6d('0x66')](_0x7c6d('0x85'));}}if(_0x39d823['query']['tag']){_0x384b54=_[_0x7c6d('0x86')](_0x39d823['query'][_0x7c6d('0x87')])?_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x87')]:new Array(_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x87')]);_0x384b54['forEach'](function(_0x55c1cc){_0x37d9e7['or'](_0x7c6d('0x72'),'%,'+_0x55c1cc+',%');});}if(_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x88')]){var _0x48e3de=_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x88')][_0x7c6d('0x89')]('\x5c','\x5c\x5c')[_0x7c6d('0x89')](/'/g,'\x27\x27');if(qs[_0x7c6d('0x8a')](_0x48e3de)){_0x46ffc7['or'](_0x7c6d('0x8b'),_0x48e3de+'%')['or']('i.phone\x20LIKE\x20?',_0x48e3de+'%');}else{_0x46ffc7['or'](_0x7c6d('0x8c'),qs[_0x7c6d('0x6d')](_0x48e3de))['or'](_0x7c6d('0x8d'),_0x48e3de+'%');}}}_0x272d10['where'](_0x46ffc7);_0x272d10['group'](_0x7c6d('0x8e'));var _0x34fdb3={'type':db[_0x7c6d('0x8f')][_0x7c6d('0x90')][_0x7c6d('0x91')],'raw':!![]};var _0x1d78e1=_0x272d10[_0x7c6d('0x92')]();_0x1d78e1[_0x7c6d('0x4b')](_0x7c6d('0x8e'));_0x1d78e1[_0x7c6d('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7c6d('0x64'));if(_0x2af9de[_0x7c6d('0x47')]){_0x2af9de[_0x7c6d('0x47')]['forEach'](function(_0x4cbfb6){var _0x57053d=_0x4cbfb6[0x0]===_0x7c6d('0x93')?_0x4cbfb6[0x0]:'i.'+_0x4cbfb6[0x0];_0x272d10[_0x7c6d('0x47')](_0x57053d,_0x4cbfb6[0x1]===_0x7c6d('0x94')?![]:!![]);});}if(!_[_0x7c6d('0x79')](_0x384b54)){_0x272d10[_0x7c6d('0x66')](_0x37d9e7);_0x1d78e1['where']('t.id\x20IN\x20?',_0x384b54);}BPromise[_0x7c6d('0x95')]()[_0x7c6d('0x2d')](function(){if(!_0x513c08){if(_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x96')])return;_0x1d78e1[_0x7c6d('0x7a')](_0x7c6d('0x97'));_0x272d10[_0x7c6d('0x7a')](_0x7c6d('0x97'));return;}if(_0x39d823[_0x7c6d('0x98')][_0x7c6d('0x99')]!==_0x7c6d('0x9a'))return;return _0x39d823[_0x7c6d('0x98')][_0x7c6d('0x9b')]({'attributes':['id'],'raw':!![]})[_0x7c6d('0x2d')](function(_0x35566b){if(_['isEmpty'](_0x35566b)){_0x1d78e1['where'](_0x7c6d('0x9c'));_0x272d10['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x1d78e1['where'](_0x7c6d('0x7b'),_[_0x7c6d('0x41')](_0x35566b,'id'));_0x272d10[_0x7c6d('0x7a')](_0x7c6d('0x7b'),_['map'](_0x35566b,'id'));}});})['then'](function(){if(_0x39d823['user'][_0x7c6d('0x99')]==='agent'&&!_0x513c08&&!_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x96')])return[];return db['sequelize']['query'](_0x1d78e1[_0x7c6d('0x9d')](),_0x34fdb3);})[_0x7c6d('0x2d')](function(_0x1503d4){_0x1e7a8a[_0x7c6d('0x26')]=_0x1503d4['length'];if(_0x1e7a8a['count']===0x0)return[];return db[_0x7c6d('0x9e')][_0x7c6d('0x42')](_0x310b86[_0x7c6d('0x9d')](),_0x34fdb3)['then'](function(_0x4a807a){_0x29a169=_[_0x7c6d('0x9f')](_0x4a807a,'id');_0x34fdb3=_['merge'](_0x34fdb3,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39d823[_0x7c6d('0x42')][_0x7c6d('0x45')]){_0x2af9de[_0x7c6d('0x44')][_0x7c6d('0xa0')](function(_0x4465d8){_0x272d10[_0x7c6d('0x4b')]('i.'+_0x4465d8);});}else{_0x272d10[_0x7c6d('0x4b')](_0x7c6d('0xa1'),_0x7c6d('0x64'));_0x272d10[_0x7c6d('0x4b')]('a.key',_0x7c6d('0xa2'));_0x272d10[_0x7c6d('0x4b')](_0x7c6d('0xa3'),_0x7c6d('0xa4'));_0x272d10['field'](_0x7c6d('0xa5'),_0x7c6d('0x93'));_0x272d10[_0x7c6d('0x4b')](_0x7c6d('0xa6'));_0x272d10[_0x7c6d('0x4b')](_0x7c6d('0xa7'),_0x7c6d('0xa8'));_0x272d10[_0x7c6d('0x4b')](_0x7c6d('0xa9'),'Contact.lastName');_0x272d10['field']('c.email',_0x7c6d('0xaa'));_0x272d10[_0x7c6d('0x4b')]('c.phone',_0x7c6d('0xab'));_0x272d10[_0x7c6d('0x4b')](_0x7c6d('0xac'),'Contact.mobile');_0x272d10[_0x7c6d('0x4b')]('c.fax',_0x7c6d('0xad'));_0x272d10[_0x7c6d('0x4b')](_0x7c6d('0xae'),_0x7c6d('0xaf'));_0x272d10['field']('o.internal','Owner.internal');_0x272d10[_0x7c6d('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7c6d('0x32'));}if(_0x2af9de[_0x7c6d('0x25')])_0x272d10[_0x7c6d('0x25')](_0x2af9de[_0x7c6d('0x25')]);if(_0x2af9de[_0x7c6d('0x24')])_0x272d10[_0x7c6d('0x24')](_0x2af9de[_0x7c6d('0x24')]);return db['sequelize'][_0x7c6d('0x42')](_0x272d10['toString'](),_0x34fdb3);})['then'](function(_0x95e001){if(_0x95e001[_0x7c6d('0x6b')]>0x0)_0x4d1b90[_0x7c6d('0x7a')](_0x7c6d('0xb0'),_['map'](_0x95e001,'id'));return db['sequelize'][_0x7c6d('0x42')](_0x4d1b90[_0x7c6d('0x9d')](),_0x34fdb3)['then'](function(_0x9018ac){var _0x46f498=_[_0x7c6d('0xb1')](_0x9018ac,'WhatsappInteractionId');var _0x21ce9c=[];_0x95e001[_0x7c6d('0xa0')](function(_0xd10530){_0x21ce9c['push'](updateWhatsappInteraction(_0xd10530,_0x29a169,_0x46f498));});return BPromise[_0x7c6d('0xb2')](_0x21ce9c);});});})[_0x7c6d('0x2d')](function(_0x4af42f){_0x1e7a8a[_0x7c6d('0xb3')]=_0x4af42f;return _0x1e7a8a;})['then'](respondWithFilteredResult(_0x29460e,_0x2af9de))[_0x7c6d('0xb4')](handleError(_0x29460e,null));};exports['show']=function(_0x1fea06,_0x23f172){var _0x278614={'raw':![],'where':{'id':_0x1fea06[_0x7c6d('0xb5')]['id']}},_0x1a3b21={};_0x1a3b21['model']=_[_0x7c6d('0x76')](db[_0x7c6d('0xb6')][_0x7c6d('0x3d')]);_0x1a3b21['query']=_[_0x7c6d('0x76')](_0x1fea06['query']);_0x1a3b21['filters']=_[_0x7c6d('0x43')](_0x1a3b21[_0x7c6d('0x40')],_0x1a3b21[_0x7c6d('0x42')]);_0x278614[_0x7c6d('0x44')]=_['intersection'](_0x1a3b21[_0x7c6d('0x40')],qs[_0x7c6d('0x45')](_0x1fea06[_0x7c6d('0x42')][_0x7c6d('0x45')]));_0x278614[_0x7c6d('0x44')]=_0x278614[_0x7c6d('0x44')][_0x7c6d('0x6b')]?_0x278614[_0x7c6d('0x44')]:_0x1a3b21[_0x7c6d('0x40')];if(_0x1fea06[_0x7c6d('0x42')]['includeAll']){_0x278614[_0x7c6d('0xb7')]=[{'all':!![]}];}_0x278614=_[_0x7c6d('0xb8')]({},_0x278614,_0x1fea06[_0x7c6d('0xb9')]);return db[_0x7c6d('0xb6')][_0x7c6d('0x63')](_0x278614)['then'](handleEntityNotFound(_0x23f172,null))[_0x7c6d('0x2d')](respondWithResult(_0x23f172,null))[_0x7c6d('0xb4')](handleError(_0x23f172,null));};exports[_0x7c6d('0xba')]=function(_0x17b0e3,_0x50793a){return db[_0x7c6d('0xb6')][_0x7c6d('0xba')](_0x17b0e3[_0x7c6d('0xbb')],{})['then'](respondWithResult(_0x50793a,0xc9))['catch'](handleError(_0x50793a,null));};exports[_0x7c6d('0x2c')]=function(_0x149800,_0x30715c){if(_0x149800[_0x7c6d('0xbb')]['id']){delete _0x149800[_0x7c6d('0xbb')]['id'];}return db['WhatsappInteraction'][_0x7c6d('0x63')]({'where':{'id':_0x149800[_0x7c6d('0xb5')]['id']}})['then'](handleEntityNotFound(_0x30715c,null))['then'](saveUpdates(_0x149800[_0x7c6d('0xbb')],null))[_0x7c6d('0x2d')](respondWithResult(_0x30715c,null))['catch'](handleError(_0x30715c,null));};exports[_0x7c6d('0x2e')]=function(_0x13113a,_0x524cf5){return db[_0x7c6d('0xb6')][_0x7c6d('0x63')]({'where':{'id':_0x13113a[_0x7c6d('0xb5')]['id']}})[_0x7c6d('0x2d')](handleEntityNotFound(_0x524cf5,null))[_0x7c6d('0x2d')](removeEntity(_0x524cf5,null))['catch'](handleError(_0x524cf5,null));};exports[_0x7c6d('0xbc')]=function(_0x22ae67,_0x3e8b9c){return db['WhatsappInteraction']['describe']()[_0x7c6d('0x2d')](respondWithResult(_0x3e8b9c,null))[_0x7c6d('0xb4')](handleError(_0x3e8b9c,null));};exports[_0x7c6d('0xbd')]=function(_0x4a7da9,_0xefbb56,_0x18f477){return db[_0x7c6d('0xbe')][_0x7c6d('0x63')]({'where':{'id':_0x4a7da9['params']['id']}})['then'](handleEntityNotFound(_0xefbb56,null))[_0x7c6d('0x2d')](function(_0x3b2384){if(_0x3b2384){return _0x3b2384[_0x7c6d('0xbd')](_0x4a7da9[_0x7c6d('0xbb')][_0x7c6d('0xbf')],_[_0x7c6d('0xc0')](_0x4a7da9[_0x7c6d('0xbb')],[_0x7c6d('0xbf'),'id'])||{});}})['then'](respondWithResult(_0xefbb56,null))['catch'](handleError(_0xefbb56,null));};exports[_0x7c6d('0xc1')]=function(_0x12cf79,_0x3ad9f3,_0x28bd9d){var _0x172c5e={'raw':![],'where':{}};var _0x26abc0={};var _0x1105a0={'count':0x0,'rows':[]};return db[_0x7c6d('0xb6')][_0x7c6d('0xc2')]({'where':{'id':_0x12cf79[_0x7c6d('0xb5')]['id']}})[_0x7c6d('0x2d')](handleEntityNotFound(_0x3ad9f3,null))[_0x7c6d('0x2d')](function(_0x5ce661){if(_0x5ce661){_0x26abc0[_0x7c6d('0x40')]=_[_0x7c6d('0x76')](db[_0x7c6d('0xbe')]['rawAttributes']);_0x26abc0[_0x7c6d('0x42')]=_['keys'](_0x12cf79[_0x7c6d('0x42')]);_0x26abc0[_0x7c6d('0x4a')]=_[_0x7c6d('0x43')](_0x26abc0[_0x7c6d('0x40')],_0x26abc0['query']);_0x172c5e[_0x7c6d('0x44')]=_[_0x7c6d('0x43')](_0x26abc0[_0x7c6d('0x40')],qs['fields'](_0x12cf79[_0x7c6d('0x42')]['fields']));_0x172c5e[_0x7c6d('0x44')]=_0x172c5e[_0x7c6d('0x44')][_0x7c6d('0x6b')]?_0x172c5e[_0x7c6d('0x44')]:_0x26abc0[_0x7c6d('0x40')];if(!_0x12cf79['query'][_0x7c6d('0xc3')](_0x7c6d('0x46'))){_0x172c5e[_0x7c6d('0x25')]=qs[_0x7c6d('0x25')](_0x12cf79[_0x7c6d('0x42')][_0x7c6d('0x25')]);_0x172c5e[_0x7c6d('0x24')]=qs['offset'](_0x12cf79[_0x7c6d('0x42')]['offset']);}_0x172c5e[_0x7c6d('0x47')]=qs[_0x7c6d('0x48')](_0x12cf79['query'][_0x7c6d('0x48')]);_0x172c5e[_0x7c6d('0x7a')]=qs[_0x7c6d('0x4a')](_[_0x7c6d('0x49')](_0x12cf79[_0x7c6d('0x42')],_0x26abc0['filters']));_0x172c5e['where']['WhatsappInteractionId']=_0x5ce661['id'];if(_0x12cf79[_0x7c6d('0x42')]['filter']){_0x172c5e[_0x7c6d('0x7a')]=_[_0x7c6d('0xb8')](_0x172c5e[_0x7c6d('0x7a')],{'$or':_[_0x7c6d('0x41')](_0x172c5e[_0x7c6d('0x44')],function(_0x988870){var _0x565b55={};_0x565b55[_0x988870]={'$like':'%'+_0x12cf79['query'][_0x7c6d('0x88')]+'%'};return _0x565b55;})});}if(_0x12cf79[_0x7c6d('0x42')][_0x7c6d('0x7f')]){var _0x79d86e=_0x12cf79[_0x7c6d('0x42')][_0x7c6d('0x7f')][_0x7c6d('0x34')](',');var _0x283dda={};_0x283dda[_0x79d86e[0x0]]={'$gte':moment(_0x79d86e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x172c5e[_0x7c6d('0x7a')]=_[_0x7c6d('0xb8')](_0x172c5e[_0x7c6d('0x7a')],_0x283dda);}_0x172c5e=_[_0x7c6d('0xb8')]({},_0x172c5e,_0x12cf79[_0x7c6d('0xb9')]);return db['WhatsappMessage'][_0x7c6d('0x26')]({'where':_0x172c5e['where']})[_0x7c6d('0x2d')](function(_0x1cf301){_0x1105a0[_0x7c6d('0x26')]=_0x1cf301;if(_0x12cf79[_0x7c6d('0x42')][_0x7c6d('0xc4')]){_0x172c5e[_0x7c6d('0xb7')]=[{'all':!![]}];}return db[_0x7c6d('0xbe')][_0x7c6d('0xc5')](_0x172c5e);})[_0x7c6d('0x2d')](function(_0x686673){_0x1105a0['rows']=_0x686673;return _0x1105a0;});}})[_0x7c6d('0x2d')](respondWithFilteredResult(_0x3ad9f3,_0x172c5e))['catch'](handleError(_0x3ad9f3,null));};exports['addTags']=function(_0x3f097b,_0xad54c9,_0x5b7725){return db[_0x7c6d('0xb6')][_0x7c6d('0x63')]({'where':{'id':_0x3f097b[_0x7c6d('0xb5')]['id']}})[_0x7c6d('0x2d')](handleEntityNotFound(_0xad54c9,null))[_0x7c6d('0x2d')](function(_0x3e8b5c){if(_0x3e8b5c){return _0x3e8b5c[_0x7c6d('0xc6')](_0x3f097b[_0x7c6d('0xbb')][_0x7c6d('0xbf')],_[_0x7c6d('0xc0')](_0x3f097b[_0x7c6d('0xbb')],[_0x7c6d('0xbf'),'id'])||{})[_0x7c6d('0xc7')](function(){return db[_0x7c6d('0xc8')]['findAll']({'attributes':['id',_0x7c6d('0x30'),'color'],'where':{'id':_0x3f097b[_0x7c6d('0xbb')][_0x7c6d('0xbf')]}});})[_0x7c6d('0x2d')](function(_0x53377e){socket[_0x7c6d('0xc9')](_0x7c6d('0xca'),{'id':Number(_0x3f097b[_0x7c6d('0xb5')]['id']),'tags':_0x53377e||[]});return{'id':Number(_0x3f097b['params']['id']),'tags':_0x53377e||[]};});}})[_0x7c6d('0x2d')](respondWithResult(_0xad54c9,null))[_0x7c6d('0xb4')](handleError(_0xad54c9,null));};exports['removeTags']=function(_0x1e74ec,_0x3d215b,_0x310170){return db[_0x7c6d('0xb6')]['find']({'where':{'id':_0x1e74ec[_0x7c6d('0xb5')]['id']}})[_0x7c6d('0x2d')](handleEntityNotFound(_0x3d215b,null))['then'](function(_0xc52db9){if(_0xc52db9){return _0xc52db9[_0x7c6d('0xcb')](_0x1e74ec[_0x7c6d('0x42')][_0x7c6d('0xbf')]);}})[_0x7c6d('0x2d')](respondWithStatusCode(_0x3d215b,null))['catch'](handleError(_0x3d215b,null));};exports[_0x7c6d('0xcc')]=function(_0x59155e,_0x27fe39){var _0xb59f2f=moment()[_0x7c6d('0xcd')]()[_0x7c6d('0x9d')]();var _0x559c1a=path[_0x7c6d('0xce')](config[_0x7c6d('0xcf')],_0x7c6d('0xd0'),_0x7c6d('0xd1'),'tmp');var _0x395921=path[_0x7c6d('0xce')](config['root'],_0x7c6d('0xd0'),'files',_0x7c6d('0xd2'));var _0x22bca0=path[_0x7c6d('0xce')](_0x559c1a,_0xb59f2f);var _0x16b8ff=util[_0x7c6d('0xd3')](_0x7c6d('0xd4'),_0x59155e['params']['id'],_0xb59f2f);var _0x3a9e8b=path['join'](_0x559c1a,_0x16b8ff);var _0xf75004=[];_0xf75004[_0x7c6d('0xd5')]({'model':db[_0x7c6d('0x74')],'as':_0x7c6d('0x74'),'attributes':['id',_0x7c6d('0xd6')],'raw':!![]});_0xf75004[_0x7c6d('0xd5')]({'model':db[_0x7c6d('0xd7')],'as':_0x7c6d('0x68'),'attributes':['id','firstName',_0x7c6d('0xd8')],'raw':!![]});if(_0x59155e[_0x7c6d('0x42')]['attachments']){_0xf75004[_0x7c6d('0xd5')]({'model':db[_0x7c6d('0xd9')],'as':_0x7c6d('0xd9'),'raw':!![]});}var _0x3563a0=[{'model':db['WhatsappMessage'],'as':_0x7c6d('0xda'),'attributes':['id',_0x7c6d('0xbb'),_0x7c6d('0x7d'),_0x7c6d('0xdb'),_0x7c6d('0xdc'),_0x7c6d('0x84')],'include':_0xf75004}];_0x3563a0[_0x7c6d('0xd5')]({'model':db[_0x7c6d('0xdd')],'as':_0x7c6d('0xde'),'attributes':['id','name']});_0x3563a0[_0x7c6d('0xd5')]({'model':db[_0x7c6d('0x74')],'as':_0x7c6d('0xdf'),'attributes':['id','fullname']});return db[_0x7c6d('0xb6')]['find']({'where':{'id':_0x59155e['params']['id']},'include':_0x3563a0})[_0x7c6d('0x2d')](handleEntityNotFound(_0x27fe39,null))[_0x7c6d('0x2d')](function(_0x51e73b){if(_0x51e73b){var _0x20075e=_0x51e73b[_0x7c6d('0xe0')]({'plain':!![]});fs[_0x7c6d('0xe1')](_0x22bca0);var _0x2ff061={'channel':_0x7c6d('0xe2'),'account':_0x20075e[_0x7c6d('0xde')][_0x7c6d('0x30')],'agent':_0x20075e[_0x7c6d('0xdf')]?_0x20075e[_0x7c6d('0xdf')][_0x7c6d('0xd6')]:'N.A.','createdAt':moment(_0x20075e[_0x7c6d('0x7d')])[_0x7c6d('0xd3')](_0x7c6d('0xe3'))[_0x7c6d('0x9d')](),'closedAt':_0x20075e[_0x7c6d('0x38')]?moment(_0x20075e[_0x7c6d('0xe4')])[_0x7c6d('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x20075e[_0x7c6d('0xe5')],'messages':_(_0x20075e[_0x7c6d('0xda')])[_0x7c6d('0x88')]({'secret':![]})[_0x7c6d('0x41')](function(_0x275d1b){if(_0x275d1b['Attachment']){var _0x5c1044=path[_0x7c6d('0xce')](_0x395921,_0x275d1b[_0x7c6d('0xd9')]['basename']);if(fs[_0x7c6d('0xe6')](_0x5c1044)){fs['createReadStream'](_0x5c1044)[_0x7c6d('0xe7')](fs['createWriteStream'](path[_0x7c6d('0xce')](_0x22bca0,_0x275d1b[_0x7c6d('0xd9')]['basename'])));}}return{'date':moment(_0x275d1b[_0x7c6d('0x7d')])[_0x7c6d('0xd3')](_0x7c6d('0xe3'))[_0x7c6d('0x9d')](),'sender':_0x275d1b[_0x7c6d('0xdb')]===_0x7c6d('0xe8')?_0x275d1b[_0x7c6d('0x74')]?_0x275d1b['User'][_0x7c6d('0xd6')]:'System':_0x275d1b[_0x7c6d('0x68')]['firstName']+(_0x275d1b[_0x7c6d('0x68')][_0x7c6d('0xd8')]?'\x20'+_0x275d1b[_0x7c6d('0x68')][_0x7c6d('0xd8')]:''),'body':_0x275d1b[_0x7c6d('0xd9')]?_0x275d1b[_0x7c6d('0xd9')]['basename']:_0x275d1b[_0x7c6d('0xbb')],'direction':_0x275d1b[_0x7c6d('0xdb')]===_0x7c6d('0xe8')?'A':'C','secret':_0x275d1b['secret'],'read':_0x275d1b[_0x7c6d('0x84')],'attachment':_0x275d1b[_0x7c6d('0xd9')]};})[_0x7c6d('0x65')]()};return ejs[_0x7c6d('0xe9')](path['join'](config[_0x7c6d('0xcf')],'server',_0x7c6d('0xea'),'downloadInteraction.ejs'),{'interaction':_0x2ff061})[_0x7c6d('0x2d')](function(_0x494785){var _0x42e148=path[_0x7c6d('0xce')](_0x22bca0,_0x7c6d('0xeb')+_0x20075e['id']+'-'+_0xb59f2f+_0x7c6d('0xec'));var _0x18286a={'path':_0x42e148,'channel':'Whatsapp','interactionId':_0x20075e['id']};return pdf[_0x7c6d('0xed')](_0x494785,_0x18286a);})[_0x7c6d('0x2d')](function(){return new BPromise(function(_0x46fc22,_0x2199c6){zipdir(_0x22bca0,{'saveTo':_0x3a9e8b},function(_0x1c0b0c,_0x1fd1e4){if(_0x1c0b0c)return _0x2199c6(_0x1c0b0c);return _0x46fc22(_0x1fd1e4);});})[_0x7c6d('0x2d')](function(){return new BPromise(function(_0x3a6486,_0x329441){rimraf(_0x22bca0,function(_0x5a9e68){if(_0x5a9e68)_0x329441(_0x5a9e68);return _0x3a6486();});});})[_0x7c6d('0x2d')](function(){return _0x27fe39[_0x7c6d('0xcc')](_0x3a9e8b,_0x16b8ff,function(_0x2e5928){if(_0x2e5928){console[_0x7c6d('0xee')](_0x7c6d('0xef'),_0x2e5928);}else{fs[_0x7c6d('0xf0')](_0x3a9e8b);}});});});}else{return _0x27fe39[_0x7c6d('0x2f')](0xc8);}})[_0x7c6d('0xb4')](handleError(_0x27fe39,null));}; \ No newline at end of file +var _0x4e7b=['.pdf','Whatsapp','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','split','waiting','talking','answered','unmanaged','total','closed','UserId','index','WhatsappInteraction','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','start','body','isEmpty','createdAt','$gte','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','forEach','filter','replace','isNumeric','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','rows','catch','show','params','includeAll','include','options','create','describe','addMessage','omit','getMessages','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','ids','spread','emit','whatsappInteractionTags:save','removeTags','unix','root','server','files','join','attachments','CmContact','secret','WhatsappAccount','Account','Owner','get','closedAt','Messages','Attachment','createReadStream','createWriteStream','basename','direction','System','firstName','lastName','out','renderFile','views','downloadInteraction.ejs','transcript-'];(function(_0x29bfbe,_0x37060a){var _0x230663=function(_0x3b2a6f){while(--_0x3b2a6f){_0x29bfbe['push'](_0x29bfbe['shift']());}};_0x230663(++_0x37060a);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x234cf0,_0x220601){_0x234cf0=_0x234cf0-0x0;var _0xba3ed7=_0x4e7b[_0x234cf0];return _0xba3ed7;};'use strict';var emlformat=require(_0xb4e7('0x0'));var rimraf=require(_0xb4e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4e7('0x2'));var rp=require('request-promise');var moment=require(_0xb4e7('0x3'));var BPromise=require(_0xb4e7('0x4'));var Mustache=require('mustache');var util=require(_0xb4e7('0x5'));var path=require(_0xb4e7('0x6'));var sox=require('sox');var csv=require(_0xb4e7('0x7'));var ejs=require(_0xb4e7('0x8'));var fs=require('fs');var fs_extra=require(_0xb4e7('0x9'));var _=require(_0xb4e7('0xa'));var squel=require(_0xb4e7('0xb'));var crypto=require('crypto');var jsforce=require(_0xb4e7('0xc'));var deskjs=require(_0xb4e7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb4e7('0xe'));var Papa=require(_0xb4e7('0xf'));var Redis=require(_0xb4e7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4e7('0x11'));var as=require(_0xb4e7('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb4e7('0x13'));var config=require(_0xb4e7('0x14'));var licenseUtil=require(_0xb4e7('0x15'));var db=require(_0xb4e7('0x16'))['db'];config[_0xb4e7('0x17')]=_[_0xb4e7('0x18')](config[_0xb4e7('0x17')],{'host':_0xb4e7('0x19'),'port':0x18eb});var socket=require(_0xb4e7('0x1a'))(new Redis(config[_0xb4e7('0x17')]));require(_0xb4e7('0x1b'))[_0xb4e7('0x1c')](socket);function respondWithStatusCode(_0x205570,_0x44c9ea){_0x44c9ea=_0x44c9ea||0xcc;return function(_0x5623fa){if(_0x5623fa){return _0x205570[_0xb4e7('0x1d')](_0x44c9ea);}return _0x205570[_0xb4e7('0x1e')](_0x44c9ea)[_0xb4e7('0x1f')]();};}function respondWithResult(_0x13f5fe,_0x2ee21b){_0x2ee21b=_0x2ee21b||0xc8;return function(_0x3078a0){if(_0x3078a0){return _0x13f5fe['status'](_0x2ee21b)['json'](_0x3078a0);}};}function respondWithFilteredResult(_0x1eddfd,_0xad7516){return function(_0x451572){if(_0x451572){var _0x597f39=typeof _0xad7516[_0xb4e7('0x20')]===_0xb4e7('0x21')&&typeof _0xad7516[_0xb4e7('0x22')]===_0xb4e7('0x21');var _0x577df8=_0x451572[_0xb4e7('0x23')];var _0x44440c=_0x597f39?0x0:_0xad7516[_0xb4e7('0x20')];var _0x434a73=_0x597f39?_0x451572[_0xb4e7('0x23')]:_0xad7516[_0xb4e7('0x20')]+_0xad7516[_0xb4e7('0x22')];var _0x3c0d46;if(_0x434a73>=_0x577df8){_0x434a73=_0x577df8;_0x3c0d46=0xc8;}else{_0x3c0d46=0xce;}_0x1eddfd[_0xb4e7('0x1e')](_0x3c0d46);return _0x1eddfd[_0xb4e7('0x24')](_0xb4e7('0x25'),_0x44440c+'-'+_0x434a73+'/'+_0x577df8)['json'](_0x451572);}return null;};}function patchUpdates(_0x25d435){return function(_0x4d6abc){try{jsonpatch[_0xb4e7('0x26')](_0x4d6abc,_0x25d435,!![]);}catch(_0xa7be18){return BPromise[_0xb4e7('0x27')](_0xa7be18);}return _0x4d6abc[_0xb4e7('0x28')]();};}function saveUpdates(_0x417072,_0x42afce){return function(_0x2177f6){if(_0x2177f6){return _0x2177f6[_0xb4e7('0x29')](_0x417072)[_0xb4e7('0x2a')](function(_0x4c531a){return _0x4c531a;});}return null;};}function removeEntity(_0x27677b,_0x3b15ce){return function(_0x31ffb9){if(_0x31ffb9){return _0x31ffb9[_0xb4e7('0x2b')]()['then'](function(){_0x27677b[_0xb4e7('0x1e')](0xcc)[_0xb4e7('0x1f')]();});}};}function handleEntityNotFound(_0x50bdcd,_0x21c231){return function(_0x48ebc5){if(!_0x48ebc5){_0x50bdcd['sendStatus'](0x194);}return _0x48ebc5;};}function handleError(_0x498e9a,_0x380e0c){_0x380e0c=_0x380e0c||0x1f4;return function(_0x23693d){logger[_0xb4e7('0x2c')](_0x23693d[_0xb4e7('0x2d')]);if(_0x23693d['name']){delete _0x23693d[_0xb4e7('0x2e')];}_0x498e9a[_0xb4e7('0x1e')](_0x380e0c)[_0xb4e7('0x2f')](_0x23693d);};}function getInteractionUsers(_0x3b75da,_0x40006e){return new BPromise(function(_0x235cdc,_0x3a946c){try{if(_0x40006e[_0x3b75da['id']]){_0x3b75da['Users']=_[_0xb4e7('0x30')](_0x40006e[_0x3b75da['id']],function(_0x5e600a){return{'id':_0x5e600a['id'],'fullname':_0x5e600a[_0xb4e7('0x31')]};});}}catch(_0xb31c38){_0x3a946c(_0xb31c38);}_0x235cdc(_0x3b75da);});}function getInteractionTags(_0x3605fb,_0x5c6cb7){return new BPromise(function(_0x4be946,_0xc3dc38){try{if(_0x3605fb[_0xb4e7('0x32')]){_0x3605fb['Tags']=[];_0x3605fb[_0xb4e7('0x32')][_0xb4e7('0x33')](',')['forEach'](function(_0x4c1919){_0x3605fb['Tags']['push'](_0x5c6cb7[_0x4c1919]);});}delete _0x3605fb[_0xb4e7('0x32')];}catch(_0x52adfc){_0xc3dc38(_0x52adfc);}_0x4be946(_0x3605fb);});}function updateWhatsappInteraction(_0x140788,_0x1a92f6,_0x44951f){return new BPromise(function(_0x1e3bb3,_0x36f323){return getInteractionUsers(_0x140788,_0x44951f)[_0xb4e7('0x2a')](function(_0x52c854){return getInteractionTags(_0x52c854,_0x1a92f6);})[_0xb4e7('0x2a')](function(_0x2af52d){return getStateInteraction(_0x2af52d);})[_0xb4e7('0x2a')](function(_0x4f16c3){_0x1e3bb3(_0x4f16c3);})['catch'](function(_0x23605e){_0x36f323(_0x23605e);});});}function getStateInteraction(_0x4191d8){return new BPromise(function(_0x5b738d){_0x4191d8[_0xb4e7('0x34')]=0x0;_0x4191d8[_0xb4e7('0x35')]=0x0;_0x4191d8[_0xb4e7('0x36')]=0x0;_0x4191d8[_0xb4e7('0x37')]=0x0;_0x4191d8[_0xb4e7('0x38')]=0x0;if(!_0x4191d8[_0xb4e7('0x39')]&&!_0x4191d8[_0xb4e7('0x3a')]){_0x4191d8[_0xb4e7('0x34')]+=0x1;}if(!_0x4191d8[_0xb4e7('0x39')]&&_0x4191d8[_0xb4e7('0x3a')]){_0x4191d8[_0xb4e7('0x35')]+=0x1;if(_0x4191d8[_0xb4e7('0x34')]){_0x4191d8[_0xb4e7('0x34')]-=0x1;}}if(_0x4191d8[_0xb4e7('0x39')]&&_0x4191d8[_0xb4e7('0x3a')]){_0x4191d8[_0xb4e7('0x36')]+=0x1;if(_0x4191d8[_0xb4e7('0x35')]){_0x4191d8[_0xb4e7('0x35')]-=0x1;}}if(_0x4191d8[_0xb4e7('0x39')]&&!_0x4191d8[_0xb4e7('0x3a')]){_0x4191d8['unmanaged']+=0x1;if(_0x4191d8[_0xb4e7('0x34')]){_0x4191d8['waiting']-=0x1;}}_0x4191d8[_0xb4e7('0x38')]+=0x1;_0x5b738d(_0x4191d8);});}exports[_0xb4e7('0x3b')]=function(_0x2a3427,_0x4fd564){var _0xf9b731={},_0x558a17={},_0x5af513={'count':0x0,'rows':[]};var _0x4149ad=_['map'](db[_0xb4e7('0x3c')][_0xb4e7('0x3d')],function(_0xba698c){return{'name':_0xba698c['fieldName'],'type':_0xba698c[_0xb4e7('0x3e')][_0xb4e7('0x3f')]};});_0x558a17['model']=_['map'](_0x4149ad,_0xb4e7('0x2e'));_0x558a17[_0xb4e7('0x40')]=_[_0xb4e7('0x41')](_0x2a3427[_0xb4e7('0x40')]);_0x558a17[_0xb4e7('0x42')]=_[_0xb4e7('0x43')](_0x558a17[_0xb4e7('0x44')],_0x558a17[_0xb4e7('0x40')]);_0xf9b731[_0xb4e7('0x45')]=_[_0xb4e7('0x43')](_0x558a17['model'],qs[_0xb4e7('0x46')](_0x2a3427[_0xb4e7('0x40')]['fields']));_0xf9b731['attributes']=_0xf9b731['attributes']['length']?_0xf9b731[_0xb4e7('0x45')]:_0x558a17[_0xb4e7('0x44')];if(!_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x47')](_0xb4e7('0x48'))){_0xf9b731[_0xb4e7('0x22')]=qs['limit'](_0x2a3427[_0xb4e7('0x40')]['limit']);_0xf9b731[_0xb4e7('0x20')]=qs['offset'](_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x20')]);}_0xf9b731[_0xb4e7('0x49')]=qs['sort'](_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x4a')]);_0xf9b731[_0xb4e7('0x4b')]=qs[_0xb4e7('0x42')](_[_0xb4e7('0x4c')](_0x2a3427[_0xb4e7('0x40')],_0x558a17['filters']),_0x4149ad);var _0x24403e=[];var _0x14869d=squel[_0xb4e7('0x4d')]()[_0xb4e7('0x4e')]('id')[_0xb4e7('0x4e')]('name')[_0xb4e7('0x4e')](_0xb4e7('0x4f'))[_0xb4e7('0x50')](_0xb4e7('0x51'));var _0x32d244=squel[_0xb4e7('0x4d')]()[_0xb4e7('0x4e')](_0xb4e7('0x52'))[_0xb4e7('0x4e')](_0xb4e7('0x53'))[_0xb4e7('0x4e')](_0xb4e7('0x54'))[_0xb4e7('0x50')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb4e7('0x55'),'u',_0xb4e7('0x56'));var _0x3c734b=squel[_0xb4e7('0x4d')]()[_0xb4e7('0x50')](_0xb4e7('0x57'),'i')[_0xb4e7('0x58')](_0xb4e7('0x59'),'c',_0xb4e7('0x5a'))['left_join'](_0xb4e7('0x55'),'o',_0xb4e7('0x5b'))['left_join'](_0xb4e7('0x5c'),'a',_0xb4e7('0x5d'))['left_join']('whatsapp_messages','me','me.WhatsappInteractionId\x20=\x20i.id')[_0xb4e7('0x58')](_0xb4e7('0x5e'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0xb4e7('0x58')](_0xb4e7('0x51'),'t','t.id\x20=\x20it.TagId');var _0x48f156=squel[_0xb4e7('0x5f')]();var _0x5dcf72=[];var _0x459f11=squel[_0xb4e7('0x5f')]();var _0xb05b3a;if(_0x2a3427['query'][_0xb4e7('0x60')]){_0xb05b3a=as[_0xb4e7('0x61')](_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x60')]);var _0x2975c3=_0xb05b3a[_0xb4e7('0x62')];for(var _0x362af1=0x0;_0x362af1<_0xb05b3a[_0xb4e7('0x63')]['length'];_0x362af1++){var _0x436181=_0xb05b3a[_0xb4e7('0x63')][_0x362af1];var _0x4f5be4='i';var _0x448377=_[_0xb4e7('0x64')](_0x4149ad,[_0xb4e7('0x2e'),_0x436181[_0xb4e7('0x4e')]]);if(!_0x448377){switch(_0x436181['field']){case'unreadMessages':if(_0x436181[_0xb4e7('0x65')]==0x1){_0x3c734b[_0xb4e7('0x66')]('`'+_0x436181[_0xb4e7('0x4e')]+_0xb4e7('0x67'));}else{_0x3c734b[_0xb4e7('0x66')]('`'+_0x436181[_0xb4e7('0x4e')]+_0xb4e7('0x68'));}break;case _0xb4e7('0x69'):if(_0x436181[_0xb4e7('0x6a')]===_0xb4e7('0x6b')){if(_0x436181[_0xb4e7('0x65')][_0xb4e7('0x33')]('\x20')[_0xb4e7('0x6c')]>0x1){_0x48f156[_0x2975c3](_0xb4e7('0x6d'),qs[_0xb4e7('0x6e')](_0x436181[_0xb4e7('0x65')]),null);}else{var _0xde673e='%'+_0x436181[_0xb4e7('0x65')]+'%';_0x48f156[_0x2975c3](_0xb4e7('0x6f'),_0xde673e,_0xde673e,_0xde673e);}}else{_0x448377=_[_0xb4e7('0x64')](_0x4149ad,[_0xb4e7('0x2e'),'ContactId']);_0x436181[_0xb4e7('0x4e')]=_0xb4e7('0x70');_0x422bd2=as[_0xb4e7('0x71')](_0x4f5be4,_0x448377[_0xb4e7('0x3e')],_0x436181);_0x48f156[_0x2975c3](_0x422bd2[_0xb4e7('0x72')],_0x422bd2[_0xb4e7('0x65')]['start'],_0x422bd2[_0xb4e7('0x65')][_0xb4e7('0x1f')]);}break;case _0xb4e7('0x73'):var _0x41aebb=_0x436181[_0xb4e7('0x65')][_0xb4e7('0x33')](',')[_0xb4e7('0x30')](function(_0x5bb245){return Number(_0x5bb245);});_0x41aebb['forEach'](function(_0x2ac787){_0x459f11['or'](_0xb4e7('0x74'),'%,'+_0x2ac787+',%');});_0x5dcf72=_[_0xb4e7('0x75')](_0x5dcf72,_0x41aebb);break;case _0xb4e7('0x76'):if(_0x436181[_0xb4e7('0x6a')]===_0xb4e7('0x6b')){_0x48f156[_0x2975c3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x436181[_0xb4e7('0x65')]+'%',null);}else{_0x448377=_[_0xb4e7('0x64')](_0x4149ad,[_0xb4e7('0x2e'),_0xb4e7('0x3a')]);_0x436181['field']=_0xb4e7('0x3a');_0x422bd2=as[_0xb4e7('0x71')](_0x4f5be4,_0x448377['type'],_0x436181);_0x48f156[_0x2975c3](_0x422bd2[_0xb4e7('0x72')],_0x422bd2['value'][_0xb4e7('0x77')],_0x422bd2[_0xb4e7('0x65')][_0xb4e7('0x1f')]);}break;case _0xb4e7('0x78'):_0x422bd2=as['buildExpression']('me',null,_0x436181);_0x48f156[_0x2975c3](_0x422bd2['text'],_0x422bd2[_0xb4e7('0x65')]['start'],_0x422bd2[_0xb4e7('0x65')][_0xb4e7('0x1f')]);break;}}else{var _0x422bd2=as[_0xb4e7('0x71')](_0x4f5be4,_0x448377[_0xb4e7('0x3e')],_0x436181);_0x48f156[_0x2975c3](_0x422bd2['text'],_0x422bd2[_0xb4e7('0x65')][_0xb4e7('0x77')],_0x422bd2[_0xb4e7('0x65')][_0xb4e7('0x1f')]);}}}else{var _0xf921a=_(_0x2a3427[_0xb4e7('0x40')])[_0xb4e7('0x41')]()[_0xb4e7('0x30')](function(_0x33cfc1){return _['some'](_0x4149ad,[_0xb4e7('0x2e'),_0x33cfc1])?_0x33cfc1:undefined;})['compact']()[_0xb4e7('0x65')]();if(!_[_0xb4e7('0x79')](_0xf921a)){_0xf921a['forEach'](function(_0x4bb5e7){if(_0x4bb5e7==='WhatsappAccountId'){_0x3c734b['where']('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x2a3427[_0xb4e7('0x40')][_0x4bb5e7]));}else if(_0x4bb5e7===_0xb4e7('0x7a')){var _0x2eb7c5=JSON['parse'](_0x2a3427[_0xb4e7('0x40')][_0x4bb5e7])[_0xb4e7('0x7b')];var _0x3cbc31=JSON[_0xb4e7('0x7c')](_0x2a3427[_0xb4e7('0x40')][_0x4bb5e7])[_0xb4e7('0x7d')];_0x3c734b['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2eb7c5,_0x3cbc31);}else{if(_0x2a3427['query'][_0x4bb5e7]===_0xb4e7('0x7e')){_0x3c734b['where']('i.'+_0x4bb5e7+_0xb4e7('0x7f'));}else{_0x3c734b[_0xb4e7('0x4b')]('i.'+_0x4bb5e7+'\x20=\x20?',_0x2a3427[_0xb4e7('0x40')][_0x4bb5e7]);}}});}if(_0x2a3427[_0xb4e7('0x40')]['read']){if(_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x80')]==0x1){_0x3c734b[_0xb4e7('0x66')](_0xb4e7('0x81'));}else{_0x3c734b[_0xb4e7('0x66')](_0xb4e7('0x82'));}}if(_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x83')]){_0x5dcf72=_[_0xb4e7('0x84')](_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x83')])?_0x2a3427[_0xb4e7('0x40')]['tag']:new Array(_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x83')]);_0x5dcf72[_0xb4e7('0x85')](function(_0x13353a){_0x459f11['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x13353a+',%');});}if(_0x2a3427[_0xb4e7('0x40')]['filter']){var _0x4eceef=_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x86')]['replace']('\x5c','\x5c\x5c')[_0xb4e7('0x87')](/'/g,'\x27\x27');if(qs[_0xb4e7('0x88')](_0x4eceef)){_0x48f156['or']('i.id\x20LIKE\x20?',_0x4eceef+'%')['or'](_0xb4e7('0x89'),_0x4eceef+'%');}else{_0x48f156['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb4e7('0x6e')](_0x4eceef))['or'](_0xb4e7('0x8a'),_0x4eceef+'%');}}}_0x3c734b['where'](_0x48f156);_0x3c734b['group'](_0xb4e7('0x8b'));var _0x594adb={'type':db[_0xb4e7('0x8c')][_0xb4e7('0x8d')]['SELECT'],'raw':!![]};var _0x3db9ae=_0x3c734b[_0xb4e7('0x8e')]();_0x3db9ae[_0xb4e7('0x4e')](_0xb4e7('0x8b'));_0x3db9ae[_0xb4e7('0x4e')](_0xb4e7('0x8f'),_0xb4e7('0x90'));if(_0xf9b731[_0xb4e7('0x49')]){_0xf9b731[_0xb4e7('0x49')][_0xb4e7('0x85')](function(_0x33a4d2){var _0x58b62b=_0x33a4d2[0x0]===_0xb4e7('0x91')?_0x33a4d2[0x0]:'i.'+_0x33a4d2[0x0];_0x3c734b[_0xb4e7('0x49')](_0x58b62b,_0x33a4d2[0x1]===_0xb4e7('0x92')?![]:!![]);});}if(!_[_0xb4e7('0x79')](_0x5dcf72)){_0x3c734b[_0xb4e7('0x66')](_0x459f11);_0x3db9ae[_0xb4e7('0x4b')](_0xb4e7('0x93'),_0x5dcf72);}BPromise[_0xb4e7('0x94')]()[_0xb4e7('0x2a')](function(){if(!_0xb05b3a){if(_0x2a3427['query'][_0xb4e7('0x95')])return;_0x3db9ae[_0xb4e7('0x4b')](_0xb4e7('0x96'));_0x3c734b[_0xb4e7('0x4b')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2a3427[_0xb4e7('0x97')][_0xb4e7('0x98')]!==_0xb4e7('0x99'))return;return _0x2a3427[_0xb4e7('0x97')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xb4e7('0x2a')](function(_0xf8703f){if(_[_0xb4e7('0x79')](_0xf8703f)){_0x3db9ae['where'](_0xb4e7('0x9a'));_0x3c734b[_0xb4e7('0x4b')](_0xb4e7('0x9a'));}else{_0x3db9ae[_0xb4e7('0x4b')](_0xb4e7('0x9b'),_[_0xb4e7('0x30')](_0xf8703f,'id'));_0x3c734b[_0xb4e7('0x4b')](_0xb4e7('0x9b'),_[_0xb4e7('0x30')](_0xf8703f,'id'));}});})[_0xb4e7('0x2a')](function(){if(_0x2a3427[_0xb4e7('0x97')][_0xb4e7('0x98')]==='agent'&&!_0xb05b3a&&!_0x2a3427['query']['WhatsappAccountId'])return[];return db[_0xb4e7('0x9c')]['query'](_0x3db9ae[_0xb4e7('0x9d')](),_0x594adb);})[_0xb4e7('0x2a')](function(_0x5821a8){_0x5af513[_0xb4e7('0x23')]=_0x5821a8['length'];if(_0x5af513[_0xb4e7('0x23')]===0x0)return[];return db[_0xb4e7('0x9c')][_0xb4e7('0x40')](_0x14869d[_0xb4e7('0x9d')](),_0x594adb)[_0xb4e7('0x2a')](function(_0x19f6b8){_0x24403e=_[_0xb4e7('0x9e')](_0x19f6b8,'id');_0x594adb=_[_0xb4e7('0x9f')](_0x594adb,{'model':db[_0xb4e7('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a3427[_0xb4e7('0x40')][_0xb4e7('0x46')]){_0xf9b731['attributes'][_0xb4e7('0x85')](function(_0x4db45c){_0x3c734b['field']('i.'+_0x4db45c);});}else{_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0x8f'),_0xb4e7('0x90'));_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xa0'),_0xb4e7('0xa1'));_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xa2'),'Account.mandatoryDisposition');_0x3c734b['field'](_0xb4e7('0xa3'),_0xb4e7('0x91'));_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xa4'));_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xa5'),_0xb4e7('0xa6'));_0x3c734b[_0xb4e7('0x4e')]('c.lastName',_0xb4e7('0xa7'));_0x3c734b['field'](_0xb4e7('0xa8'),'Contact.email');_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xa9'),_0xb4e7('0xaa'));_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xab'),_0xb4e7('0xac'));_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xad'),'Contact.fax');_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xae'),_0xb4e7('0xaf'));_0x3c734b[_0xb4e7('0x4e')](_0xb4e7('0xb0'),'Owner.internal');_0x3c734b['field'](_0xb4e7('0xb1'),_0xb4e7('0x32'));}if(_0xf9b731['limit'])_0x3c734b[_0xb4e7('0x22')](_0xf9b731[_0xb4e7('0x22')]);if(_0xf9b731[_0xb4e7('0x20')])_0x3c734b[_0xb4e7('0x20')](_0xf9b731[_0xb4e7('0x20')]);return db[_0xb4e7('0x9c')][_0xb4e7('0x40')](_0x3c734b['toString'](),_0x594adb);})[_0xb4e7('0x2a')](function(_0x201241){if(_0x201241[_0xb4e7('0x6c')]>0x0)_0x32d244[_0xb4e7('0x4b')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xb4e7('0x30')](_0x201241,'id'));return db['sequelize'][_0xb4e7('0x40')](_0x32d244['toString'](),_0x594adb)['then'](function(_0x170877){var _0x210562=_[_0xb4e7('0xb2')](_0x170877,'WhatsappInteractionId');var _0x499d90=[];_0x201241['forEach'](function(_0x2c7492){_0x499d90[_0xb4e7('0xb3')](updateWhatsappInteraction(_0x2c7492,_0x24403e,_0x210562));});return BPromise['all'](_0x499d90);});});})[_0xb4e7('0x2a')](function(_0x256539){_0x5af513[_0xb4e7('0xb4')]=_0x256539;return _0x5af513;})[_0xb4e7('0x2a')](respondWithFilteredResult(_0x4fd564,_0xf9b731))[_0xb4e7('0xb5')](handleError(_0x4fd564,null));};exports[_0xb4e7('0xb6')]=function(_0x1efce5,_0x2b473e){var _0x380c6c={'raw':![],'where':{'id':_0x1efce5[_0xb4e7('0xb7')]['id']}},_0x2cc374={};_0x2cc374[_0xb4e7('0x44')]=_[_0xb4e7('0x41')](db[_0xb4e7('0x3c')][_0xb4e7('0x3d')]);_0x2cc374[_0xb4e7('0x40')]=_[_0xb4e7('0x41')](_0x1efce5[_0xb4e7('0x40')]);_0x2cc374['filters']=_[_0xb4e7('0x43')](_0x2cc374[_0xb4e7('0x44')],_0x2cc374[_0xb4e7('0x40')]);_0x380c6c[_0xb4e7('0x45')]=_[_0xb4e7('0x43')](_0x2cc374['model'],qs[_0xb4e7('0x46')](_0x1efce5['query']['fields']));_0x380c6c[_0xb4e7('0x45')]=_0x380c6c[_0xb4e7('0x45')]['length']?_0x380c6c[_0xb4e7('0x45')]:_0x2cc374['model'];if(_0x1efce5['query'][_0xb4e7('0xb8')]){_0x380c6c[_0xb4e7('0xb9')]=[{'all':!![]}];}_0x380c6c=_[_0xb4e7('0x9f')]({},_0x380c6c,_0x1efce5[_0xb4e7('0xba')]);return db['WhatsappInteraction']['find'](_0x380c6c)[_0xb4e7('0x2a')](handleEntityNotFound(_0x2b473e,null))[_0xb4e7('0x2a')](respondWithResult(_0x2b473e,null))[_0xb4e7('0xb5')](handleError(_0x2b473e,null));};exports[_0xb4e7('0xbb')]=function(_0x2bc604,_0x3eabc6){return db['WhatsappInteraction'][_0xb4e7('0xbb')](_0x2bc604[_0xb4e7('0x78')],{})[_0xb4e7('0x2a')](respondWithResult(_0x3eabc6,0xc9))[_0xb4e7('0xb5')](handleError(_0x3eabc6,null));};exports[_0xb4e7('0x29')]=function(_0x314f8d,_0x3b4463){if(_0x314f8d[_0xb4e7('0x78')]['id']){delete _0x314f8d[_0xb4e7('0x78')]['id'];}return db[_0xb4e7('0x3c')][_0xb4e7('0x64')]({'where':{'id':_0x314f8d[_0xb4e7('0xb7')]['id']}})[_0xb4e7('0x2a')](handleEntityNotFound(_0x3b4463,null))[_0xb4e7('0x2a')](saveUpdates(_0x314f8d[_0xb4e7('0x78')],null))['then'](respondWithResult(_0x3b4463,null))[_0xb4e7('0xb5')](handleError(_0x3b4463,null));};exports['destroy']=function(_0x52f616,_0x50efd2){return db[_0xb4e7('0x3c')]['find']({'where':{'id':_0x52f616[_0xb4e7('0xb7')]['id']}})['then'](handleEntityNotFound(_0x50efd2,null))[_0xb4e7('0x2a')](removeEntity(_0x50efd2,null))[_0xb4e7('0xb5')](handleError(_0x50efd2,null));};exports[_0xb4e7('0xbc')]=function(_0x31bfe6,_0x4ab21e){return db['WhatsappInteraction'][_0xb4e7('0xbc')]()['then'](respondWithResult(_0x4ab21e,null))[_0xb4e7('0xb5')](handleError(_0x4ab21e,null));};exports[_0xb4e7('0xbd')]=function(_0x167714,_0x2764ba,_0x35c337){return db['WhatsappMessage'][_0xb4e7('0x64')]({'where':{'id':_0x167714[_0xb4e7('0xb7')]['id']}})[_0xb4e7('0x2a')](handleEntityNotFound(_0x2764ba,null))['then'](function(_0x25b20c){if(_0x25b20c){return _0x25b20c[_0xb4e7('0xbd')](_0x167714[_0xb4e7('0x78')]['ids'],_[_0xb4e7('0xbe')](_0x167714[_0xb4e7('0x78')],['ids','id'])||{});}})[_0xb4e7('0x2a')](respondWithResult(_0x2764ba,null))[_0xb4e7('0xb5')](handleError(_0x2764ba,null));};exports[_0xb4e7('0xbf')]=function(_0x2a48f3,_0x1ea07b,_0x57ef11){var _0x542faa={'raw':![],'where':{}};var _0x2e8f68={};var _0x5a4b84={'count':0x0,'rows':[]};return db[_0xb4e7('0x3c')]['findOne']({'where':{'id':_0x2a48f3[_0xb4e7('0xb7')]['id']}})['then'](handleEntityNotFound(_0x1ea07b,null))['then'](function(_0x17aa84){if(_0x17aa84){_0x2e8f68['model']=_[_0xb4e7('0x41')](db[_0xb4e7('0xc0')][_0xb4e7('0x3d')]);_0x2e8f68[_0xb4e7('0x40')]=_[_0xb4e7('0x41')](_0x2a48f3[_0xb4e7('0x40')]);_0x2e8f68[_0xb4e7('0x42')]=_[_0xb4e7('0x43')](_0x2e8f68[_0xb4e7('0x44')],_0x2e8f68[_0xb4e7('0x40')]);_0x542faa[_0xb4e7('0x45')]=_[_0xb4e7('0x43')](_0x2e8f68[_0xb4e7('0x44')],qs[_0xb4e7('0x46')](_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0x46')]));_0x542faa['attributes']=_0x542faa['attributes'][_0xb4e7('0x6c')]?_0x542faa[_0xb4e7('0x45')]:_0x2e8f68[_0xb4e7('0x44')];if(!_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0x47')](_0xb4e7('0x48'))){_0x542faa['limit']=qs[_0xb4e7('0x22')](_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0x22')]);_0x542faa['offset']=qs[_0xb4e7('0x20')](_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0x20')]);}_0x542faa[_0xb4e7('0x49')]=qs[_0xb4e7('0x4a')](_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0x4a')]);_0x542faa['where']=qs[_0xb4e7('0x42')](_[_0xb4e7('0x4c')](_0x2a48f3[_0xb4e7('0x40')],_0x2e8f68[_0xb4e7('0x42')]));_0x542faa[_0xb4e7('0x4b')]['WhatsappInteractionId']=_0x17aa84['id'];if(_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0x86')]){_0x542faa[_0xb4e7('0x4b')]=_[_0xb4e7('0x9f')](_0x542faa['where'],{'$or':_[_0xb4e7('0x30')](_0x542faa[_0xb4e7('0x45')],function(_0x497a35){var _0x3f576b={};_0x3f576b[_0x497a35]={'$like':'%'+_0x2a48f3[_0xb4e7('0x40')]['filter']+'%'};return _0x3f576b;})});}if(_0x2a48f3[_0xb4e7('0x40')]['$gte']){var _0x375b43=_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0x7b')][_0xb4e7('0x33')](',');var _0x577354={};_0x577354[_0x375b43[0x0]]={'$gte':moment(_0x375b43[0x1])[_0xb4e7('0xc1')](_0xb4e7('0xc2'))};_0x542faa['where']=_[_0xb4e7('0x9f')](_0x542faa['where'],_0x577354);}_0x542faa=_['merge']({},_0x542faa,_0x2a48f3[_0xb4e7('0xba')]);return db[_0xb4e7('0xc0')][_0xb4e7('0x23')]({'where':_0x542faa[_0xb4e7('0x4b')]})[_0xb4e7('0x2a')](function(_0x311d64){_0x5a4b84['count']=_0x311d64;if(_0x2a48f3[_0xb4e7('0x40')][_0xb4e7('0xb8')]){_0x542faa[_0xb4e7('0xb9')]=[{'all':!![]}];}return db[_0xb4e7('0xc0')][_0xb4e7('0xc3')](_0x542faa);})[_0xb4e7('0x2a')](function(_0xa7deb1){_0x5a4b84[_0xb4e7('0xb4')]=_0xa7deb1;return _0x5a4b84;});}})[_0xb4e7('0x2a')](respondWithFilteredResult(_0x1ea07b,_0x542faa))[_0xb4e7('0xb5')](handleError(_0x1ea07b,null));};exports[_0xb4e7('0xc4')]=function(_0x133c11,_0x1a02f2,_0x420daa){return db['WhatsappInteraction'][_0xb4e7('0x64')]({'where':{'id':_0x133c11['params']['id']}})[_0xb4e7('0x2a')](handleEntityNotFound(_0x1a02f2,null))[_0xb4e7('0x2a')](function(_0x47431c){if(_0x47431c){return _0x47431c['setTags'](_0x133c11['body'][_0xb4e7('0xc5')],_[_0xb4e7('0xbe')](_0x133c11[_0xb4e7('0x78')],[_0xb4e7('0xc5'),'id'])||{})[_0xb4e7('0xc6')](function(){return db[_0xb4e7('0x73')][_0xb4e7('0xc3')]({'attributes':['id',_0xb4e7('0x2e'),_0xb4e7('0x4f')],'where':{'id':_0x133c11[_0xb4e7('0x78')][_0xb4e7('0xc5')]}});})[_0xb4e7('0x2a')](function(_0x1c33f3){socket[_0xb4e7('0xc7')](_0xb4e7('0xc8'),{'id':Number(_0x133c11[_0xb4e7('0xb7')]['id']),'tags':_0x1c33f3||[]});return{'id':Number(_0x133c11[_0xb4e7('0xb7')]['id']),'tags':_0x1c33f3||[]};});}})['then'](respondWithResult(_0x1a02f2,null))[_0xb4e7('0xb5')](handleError(_0x1a02f2,null));};exports[_0xb4e7('0xc9')]=function(_0x5124a5,_0x234b48,_0x3f7a44){return db[_0xb4e7('0x3c')][_0xb4e7('0x64')]({'where':{'id':_0x5124a5[_0xb4e7('0xb7')]['id']}})['then'](handleEntityNotFound(_0x234b48,null))[_0xb4e7('0x2a')](function(_0x53d645){if(_0x53d645){return _0x53d645[_0xb4e7('0xc9')](_0x5124a5[_0xb4e7('0x40')]['ids']);}})[_0xb4e7('0x2a')](respondWithStatusCode(_0x234b48,null))[_0xb4e7('0xb5')](handleError(_0x234b48,null));};exports['download']=function(_0x43c812,_0x4688d3){var _0x14f7e3=moment()[_0xb4e7('0xca')]()[_0xb4e7('0x9d')]();var _0x399923=path['join'](config[_0xb4e7('0xcb')],_0xb4e7('0xcc'),_0xb4e7('0xcd'),'tmp');var _0x114315=path[_0xb4e7('0xce')](config[_0xb4e7('0xcb')],_0xb4e7('0xcc'),_0xb4e7('0xcd'),_0xb4e7('0xcf'));var _0x52bc04=path[_0xb4e7('0xce')](_0x399923,_0x14f7e3);var _0x506c25=util[_0xb4e7('0xc1')]('transcript-%d-%s.zip',_0x43c812['params']['id'],_0x14f7e3);var _0x3b2ad1=path['join'](_0x399923,_0x506c25);var _0x1a8042=[];_0x1a8042[_0xb4e7('0xb3')]({'model':db[_0xb4e7('0x76')],'as':_0xb4e7('0x76'),'attributes':['id','fullname'],'raw':!![]});_0x1a8042[_0xb4e7('0xb3')]({'model':db[_0xb4e7('0xd0')],'as':_0xb4e7('0x69'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x43c812[_0xb4e7('0x40')][_0xb4e7('0xcf')]){_0x1a8042[_0xb4e7('0xb3')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0xbdbb74=[{'model':db[_0xb4e7('0xc0')],'as':'Messages','attributes':['id','body',_0xb4e7('0x7a'),'direction',_0xb4e7('0xd1'),_0xb4e7('0x80')],'include':_0x1a8042}];_0xbdbb74[_0xb4e7('0xb3')]({'model':db[_0xb4e7('0xd2')],'as':_0xb4e7('0xd3'),'attributes':['id',_0xb4e7('0x2e')]});_0xbdbb74['push']({'model':db[_0xb4e7('0x76')],'as':_0xb4e7('0xd4'),'attributes':['id',_0xb4e7('0x31')]});return db[_0xb4e7('0x3c')][_0xb4e7('0x64')]({'where':{'id':_0x43c812['params']['id']},'include':_0xbdbb74})[_0xb4e7('0x2a')](handleEntityNotFound(_0x4688d3,null))[_0xb4e7('0x2a')](function(_0x42e990){if(_0x42e990){var _0x54f4c5=_0x42e990[_0xb4e7('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x52bc04);var _0x5d82d9={'channel':'Whatsapp','account':_0x54f4c5['Account'][_0xb4e7('0x2e')],'agent':_0x54f4c5[_0xb4e7('0xd4')]?_0x54f4c5['Owner'][_0xb4e7('0x31')]:'N.A.','createdAt':moment(_0x54f4c5[_0xb4e7('0x7a')])[_0xb4e7('0xc1')](_0xb4e7('0xc2'))[_0xb4e7('0x9d')](),'closedAt':_0x54f4c5[_0xb4e7('0x39')]?moment(_0x54f4c5[_0xb4e7('0xd6')])['format'](_0xb4e7('0xc2'))['toString']():'','disposition':_0x54f4c5['disposition'],'messages':_(_0x54f4c5[_0xb4e7('0xd7')])[_0xb4e7('0x86')]({'secret':![]})['map'](function(_0x390da7){if(_0x390da7['Attachment']){var _0x4b1928=path[_0xb4e7('0xce')](_0x114315,_0x390da7[_0xb4e7('0xd8')]['basename']);if(fs['existsSync'](_0x4b1928)){fs[_0xb4e7('0xd9')](_0x4b1928)['pipe'](fs[_0xb4e7('0xda')](path[_0xb4e7('0xce')](_0x52bc04,_0x390da7[_0xb4e7('0xd8')][_0xb4e7('0xdb')])));}}return{'date':moment(_0x390da7['createdAt'])['format'](_0xb4e7('0xc2'))[_0xb4e7('0x9d')](),'sender':_0x390da7[_0xb4e7('0xdc')]==='out'?_0x390da7[_0xb4e7('0x76')]?_0x390da7[_0xb4e7('0x76')][_0xb4e7('0x31')]:_0xb4e7('0xdd'):_0x390da7[_0xb4e7('0x69')][_0xb4e7('0xde')]+(_0x390da7[_0xb4e7('0x69')]['lastName']?'\x20'+_0x390da7[_0xb4e7('0x69')][_0xb4e7('0xdf')]:''),'body':_0x390da7[_0xb4e7('0xd8')]?_0x390da7[_0xb4e7('0xd8')][_0xb4e7('0xdb')]:_0x390da7[_0xb4e7('0x78')],'direction':_0x390da7[_0xb4e7('0xdc')]===_0xb4e7('0xe0')?'A':'C','secret':_0x390da7[_0xb4e7('0xd1')],'read':_0x390da7[_0xb4e7('0x80')],'attachment':_0x390da7[_0xb4e7('0xd8')]};})[_0xb4e7('0x65')]()};return ejs[_0xb4e7('0xe1')](path[_0xb4e7('0xce')](config[_0xb4e7('0xcb')],'server',_0xb4e7('0xe2'),_0xb4e7('0xe3')),{'interaction':_0x5d82d9})[_0xb4e7('0x2a')](function(_0x2a5fb5){var _0x48901f=path[_0xb4e7('0xce')](_0x52bc04,_0xb4e7('0xe4')+_0x54f4c5['id']+'-'+_0x14f7e3+_0xb4e7('0xe5'));var _0x45c964={'path':_0x48901f,'channel':_0xb4e7('0xe6'),'interactionId':_0x54f4c5['id']};return pdf[_0xb4e7('0xe7')](_0x2a5fb5,_0x45c964);})[_0xb4e7('0x2a')](function(){return new BPromise(function(_0x33971e,_0x3e07f1){zipdir(_0x52bc04,{'saveTo':_0x3b2ad1},function(_0x5d4f21,_0x4813eb){if(_0x5d4f21)return _0x3e07f1(_0x5d4f21);return _0x33971e(_0x4813eb);});})[_0xb4e7('0x2a')](function(){return new BPromise(function(_0x2382a0,_0x5bea96){rimraf(_0x52bc04,function(_0x16ea76){if(_0x16ea76)_0x5bea96(_0x16ea76);return _0x2382a0();});});})[_0xb4e7('0x2a')](function(){return _0x4688d3[_0xb4e7('0xe8')](_0x3b2ad1,_0x506c25,function(_0x70e195){if(_0x70e195){console[_0xb4e7('0xe9')](_0xb4e7('0xea'),_0x70e195);}else{fs[_0xb4e7('0xeb')](_0x3b2ad1);}});});});}else{return _0x4688d3[_0xb4e7('0x1d')](0xc8);}})[_0xb4e7('0xb5')](handleError(_0x4688d3,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e74792a..af6462a 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 _0x684c=['WhatsappMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4c79a8,_0x3b2a6d){var _0x5680e8=function(_0x778441){while(--_0x778441){_0x4c79a8['push'](_0x4c79a8['shift']());}};_0x5680e8(++_0x3b2a6d);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc684('0x0'));var WhatsappInteraction=require(_0xc684('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xc684('0x1'))['db'][_0xc684('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc684('0x3')](0x0);var events={'afterCreate':_0xc684('0x4'),'afterUpdate':_0xc684('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3519e8){return function(_0x239760,_0x4219b6,_0x4487f6){_0x239760[_0xc684('0x6')]({'attributes':['id'],'raw':!![]})[_0xc684('0x7')](function(_0x23bd1c){_0x239760[_0xc684('0x8')](_0xc684('0x9'),_0x23bd1c[_0xc684('0xa')](function(_0x3d9282){return{'id':_0x3d9282['id']};}));return WhatsappMessage[_0xc684('0xb')]({'where':{'WhatsappInteractionId':_0x239760['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc684('0x7')](function(_0x31cd11){_0x239760[_0xc684('0x8')](_0xc684('0xc'),_0x31cd11[_0xc684('0xd')]);WhatsappInteractionEvents['emit'](_0x3519e8+':'+_0x239760['id'],_0x239760);WhatsappInteractionEvents[_0xc684('0xe')](_0x3519e8,_0x239760);_0x4487f6(null);})[_0xc684('0xf')](_0x4487f6(null));};}for(var e in events){if(events[_0xc684('0x10')](e)){var event=events[e];WhatsappInteraction[_0xc684('0x11')](e,emitEvent(event));}}module[_0xc684('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xaaa2=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','getUsers','then'];(function(_0x846e06,_0x2a6d6e){var _0x4b397c=function(_0x12e579){while(--_0x12e579){_0x846e06['push'](_0x846e06['shift']());}};_0x4b397c(++_0x2a6d6e);}(_0xaaa2,0xac));var _0x2aaa=function(_0x2fe8a2,_0x2bb11f){_0x2fe8a2=_0x2fe8a2-0x0;var _0x35c702=_0xaaa2[_0x2fe8a2];return _0x35c702;};'use strict';var EventEmitter=require(_0x2aaa('0x0'));var WhatsappInteraction=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x2')];var WhatsappMessage=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2aaa('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2aaa('0x5'),'afterDestroy':'remove'};function emitEvent(_0x35b5c8){return function(_0x340071,_0x4e949b,_0x25cb1d){_0x340071[_0x2aaa('0x6')]({'attributes':['id'],'raw':!![]})[_0x2aaa('0x7')](function(_0x4f51e6){_0x340071[_0x2aaa('0x8')]('Users',_0x4f51e6['map'](function(_0x139ca7){return{'id':_0x139ca7['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x340071['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2aaa('0x7')](function(_0x491279){_0x340071['setDataValue'](_0x2aaa('0x9'),_0x491279[_0x2aaa('0xa')]);WhatsappInteractionEvents['emit'](_0x35b5c8+':'+_0x340071['id'],_0x340071);WhatsappInteractionEvents[_0x2aaa('0xb')](_0x35b5c8,_0x340071);_0x25cb1d(null);})[_0x2aaa('0xc')](_0x25cb1d(null));};}for(var e in events){if(events[_0x2aaa('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x2aaa('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 07b7593..52fe250 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 _0x12dd=['../../config/environment','exports','define','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','rimraf'];(function(_0xef802,_0x36b008){var _0x3de459=function(_0x3cfd4e){while(--_0x3cfd4e){_0xef802['push'](_0xef802['shift']());}};_0x3de459(++_0x36b008);}(_0x12dd,0xd8));var _0xd12d=function(_0x2e1939,_0x53f83f){_0x2e1939=_0x2e1939-0x0;var _0x3fa101=_0x12dd[_0x2e1939];return _0x3fa101;};'use strict';var _=require(_0xd12d('0x0'));var util=require(_0xd12d('0x1'));var logger=require(_0xd12d('0x2'))('api');var moment=require(_0xd12d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd12d('0x4'));var config=require(_0xd12d('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0xd12d('0x6')]=function(_0x3b5afa,_0x390f8c){return _0x3b5afa[_0xd12d('0x7')]('WhatsappInteraction',attributes,{'tableName':_0xd12d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c9bb0,_0x19b756,_0x11bae2){if(_0x3c9bb0[_0xd12d('0x9')](_0xd12d('0xa'))){_0x3c9bb0[_0xd12d('0xb')]=moment()['format'](_0xd12d('0xc'));}_0x11bae2(null,_0x3c9bb0);}}});}; \ No newline at end of file +var _0xd6b0=['../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd6b0,0x13b));var _0x0d6b=function(_0x42084b,_0x46a8d8){_0x42084b=_0x42084b-0x0;var _0x349484=_0xd6b0[_0x42084b];return _0x349484;};'use strict';var _=require(_0x0d6b('0x0'));var util=require(_0x0d6b('0x1'));var logger=require(_0x0d6b('0x2'))(_0x0d6b('0x3'));var moment=require(_0x0d6b('0x4'));var BPromise=require('bluebird');var rp=require(_0x0d6b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d6b('0x6'));var config=require(_0x0d6b('0x7'));var attributes=require(_0x0d6b('0x8'));module['exports']=function(_0x52c075,_0x577c8a){return _0x52c075[_0x0d6b('0x9')](_0x0d6b('0xa'),attributes,{'tableName':_0x0d6b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7d535c,_0x524a3c,_0x295396){if(_0x7d535c['changed'](_0x0d6b('0xc'))){_0x7d535c['closedAt']=moment()['format'](_0x0d6b('0xd'));}_0x295396(null,_0x7d535c);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 616c419..55ad4af 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 _0x7376=['options','raw','attributes','limit','find','where','addTags','omit','spread','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body'];(function(_0x16013e,_0x347375){var _0x567943=function(_0x7a8c76){while(--_0x7a8c76){_0x16013e['push'](_0x16013e['shift']());}};_0x567943(++_0x347375);}(_0x7376,0xbb));var _0x6737=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7376[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6737('0x0'));var util=require(_0x6737('0x1'));var moment=require('moment');var BPromise=require(_0x6737('0x2'));var rs=require(_0x6737('0x3'));var fs=require('fs');var Redis=require(_0x6737('0x4'));var db=require(_0x6737('0x5'))['db'];var utils=require(_0x6737('0x6'));var logger=require(_0x6737('0x7'))(_0x6737('0x8'));var config=require(_0x6737('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6737('0xa')]({'port':0x232a});config[_0x6737('0xb')]=_[_0x6737('0xc')](config[_0x6737('0xb')],{'host':_0x6737('0xd'),'port':0x18eb});var socket=require(_0x6737('0xe'))(new Redis(config[_0x6737('0xb')]));require(_0x6737('0xf'))[_0x6737('0x10')](socket);function respondWithRpcPromise(_0x37f26b,_0x3f19d3,_0x1beda7){return new BPromise(function(_0x19d42c,_0x5f5537){return client[_0x6737('0x11')](_0x37f26b,_0x1beda7)[_0x6737('0x12')](function(_0x42e2e9){logger[_0x6737('0x13')](_0x6737('0x14'),_0x3f19d3,_0x6737('0x15'));logger[_0x6737('0x16')](_0x6737('0x17'),_0x3f19d3,_0x6737('0x15'),JSON['stringify'](_0x42e2e9));if(_0x42e2e9[_0x6737('0x18')]){if(_0x42e2e9[_0x6737('0x18')][_0x6737('0x19')]===0x1f4){logger['error'](_0x6737('0x14'),_0x3f19d3,_0x42e2e9['error']['message']);return _0x5f5537(_0x42e2e9['error']['message']);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3f19d3,_0x42e2e9[_0x6737('0x18')][_0x6737('0x1a')]);return _0x19d42c(_0x42e2e9[_0x6737('0x18')]['message']);}else{logger[_0x6737('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x3f19d3,_0x6737('0x15'));_0x19d42c(_0x42e2e9[_0x6737('0x1b')]['message']);}})[_0x6737('0x1c')](function(_0x490f35){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3f19d3,_0x490f35);_0x5f5537(_0x490f35);});});}exports[_0x6737('0x1d')]=function(_0x16eb06){var _0x4c82d0=this;return new Promise(function(_0xc62e84,_0x180591){return db[_0x6737('0x1e')][_0x6737('0x1f')](_0x16eb06[_0x6737('0x20')],{'raw':_0x16eb06[_0x6737('0x21')]?_0x16eb06[_0x6737('0x21')][_0x6737('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16eb06[_0x6737('0x21')]?_0x16eb06[_0x6737('0x21')]['where']||null:null,'attributes':_0x16eb06['options']?_0x16eb06['options'][_0x6737('0x23')]||null:null,'limit':_0x16eb06['options']?_0x16eb06[_0x6737('0x21')][_0x6737('0x24')]||null:null})[_0x6737('0x12')](function(_0x32f5d3){logger['info'](_0x6737('0x1d'),_0x16eb06);logger['debug'](_0x6737('0x1d'),_0x16eb06,JSON['stringify'](_0x32f5d3));_0xc62e84(_0x32f5d3);})['catch'](function(_0x8299ad){logger['error'](_0x6737('0x1d'),_0x8299ad[_0x6737('0x1a')],_0x16eb06);_0x180591(_0x4c82d0['error'](0x1f4,_0x8299ad['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x136406){return new Promise(function(_0x4015a8,_0x1be39f){return db[_0x6737('0x1e')][_0x6737('0x25')]({'where':_0x136406['options']?_0x136406[_0x6737('0x21')][_0x6737('0x26')]||null:null})['then'](function(_0x920594){if(_0x920594){return _0x920594[_0x6737('0x27')](_0x136406[_0x6737('0x20')]['ids'],_[_0x6737('0x28')](_0x136406[_0x6737('0x20')],['ids','id'])||{});}})[_0x6737('0x29')](function(_0x41c8ed){logger[_0x6737('0x13')](_0x6737('0x2a'),_0x136406);logger[_0x6737('0x16')](_0x6737('0x2a'),_0x136406,JSON[_0x6737('0x2b')](_0x41c8ed));_0x4015a8(_0x41c8ed);})['catch'](function(_0x46f122){logger[_0x6737('0x18')](_0x6737('0x2a'),_0x46f122[_0x6737('0x1a')],_0x136406);_0x1be39f(_this['error'](0x1f4,_0x46f122[_0x6737('0x1a')]));});});}; \ No newline at end of file +var _0x63f0=['body','options','raw','attributes','AddTagsToWhatsappInteraction','find','then','ids','omit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update'];(function(_0x28015a,_0x37d2d7){var _0x43bbd5=function(_0x146b86){while(--_0x146b86){_0x28015a['push'](_0x28015a['shift']());}};_0x43bbd5(++_0x37d2d7);}(_0x63f0,0x171));var _0x063f=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x63f0[_0x234ae1];return _0x227ba0;};'use strict';var _=require(_0x063f('0x0'));var util=require(_0x063f('0x1'));var moment=require(_0x063f('0x2'));var BPromise=require(_0x063f('0x3'));var rs=require(_0x063f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x063f('0x5'))['db'];var utils=require(_0x063f('0x6'));var logger=require(_0x063f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x063f('0x8'));var client=jayson[_0x063f('0x9')][_0x063f('0xa')]({'port':0x232a});config[_0x063f('0xb')]=_[_0x063f('0xc')](config[_0x063f('0xb')],{'host':_0x063f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x063f('0xb')]));require(_0x063f('0xe'))[_0x063f('0xf')](socket);function respondWithRpcPromise(_0x4cf52b,_0x2167de,_0xe3cd09){return new BPromise(function(_0x3ca214,_0x39cd81){return client[_0x063f('0x10')](_0x4cf52b,_0xe3cd09)['then'](function(_0x40c841){logger[_0x063f('0x11')](_0x063f('0x12'),_0x2167de,_0x063f('0x13'));logger[_0x063f('0x14')](_0x063f('0x15'),_0x2167de,_0x063f('0x13'),JSON[_0x063f('0x16')](_0x40c841));if(_0x40c841[_0x063f('0x17')]){if(_0x40c841[_0x063f('0x17')][_0x063f('0x18')]===0x1f4){logger[_0x063f('0x17')](_0x063f('0x12'),_0x2167de,_0x40c841[_0x063f('0x17')][_0x063f('0x19')]);return _0x39cd81(_0x40c841['error'][_0x063f('0x19')]);}logger[_0x063f('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x2167de,_0x40c841[_0x063f('0x17')][_0x063f('0x19')]);return _0x3ca214(_0x40c841[_0x063f('0x17')][_0x063f('0x19')]);}else{logger[_0x063f('0x11')](_0x063f('0x12'),_0x2167de,_0x063f('0x13'));_0x3ca214(_0x40c841[_0x063f('0x1a')]['message']);}})[_0x063f('0x1b')](function(_0x15df1b){logger[_0x063f('0x17')](_0x063f('0x12'),_0x2167de,_0x15df1b);_0x39cd81(_0x15df1b);});});}exports[_0x063f('0x1c')]=function(_0x23ed19){var _0x3cbbfc=this;return new Promise(function(_0x19a21b,_0x58e14c){return db[_0x063f('0x1d')][_0x063f('0x1e')](_0x23ed19[_0x063f('0x1f')],{'raw':_0x23ed19[_0x063f('0x20')]?_0x23ed19[_0x063f('0x20')][_0x063f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23ed19['options']?_0x23ed19[_0x063f('0x20')]['where']||null:null,'attributes':_0x23ed19[_0x063f('0x20')]?_0x23ed19['options'][_0x063f('0x22')]||null:null,'limit':_0x23ed19[_0x063f('0x20')]?_0x23ed19[_0x063f('0x20')]['limit']||null:null})['then'](function(_0x4d4ce4){logger[_0x063f('0x11')](_0x063f('0x1c'),_0x23ed19);logger[_0x063f('0x14')](_0x063f('0x1c'),_0x23ed19,JSON[_0x063f('0x16')](_0x4d4ce4));_0x19a21b(_0x4d4ce4);})[_0x063f('0x1b')](function(_0x5f2005){logger[_0x063f('0x17')]('UpdateWhatsappInteraction',_0x5f2005['message'],_0x23ed19);_0x58e14c(_0x3cbbfc[_0x063f('0x17')](0x1f4,_0x5f2005[_0x063f('0x19')]));});});};exports[_0x063f('0x23')]=function(_0x687ae2){return new Promise(function(_0x286c9d,_0x3a97d5){return db['WhatsappInteraction'][_0x063f('0x24')]({'where':_0x687ae2[_0x063f('0x20')]?_0x687ae2[_0x063f('0x20')]['where']||null:null})[_0x063f('0x25')](function(_0x382a2b){if(_0x382a2b){return _0x382a2b['addTags'](_0x687ae2[_0x063f('0x1f')][_0x063f('0x26')],_[_0x063f('0x27')](_0x687ae2['body'],[_0x063f('0x26'),'id'])||{});}})['spread'](function(_0x494412){logger['info']('AddTags',_0x687ae2);logger['debug']('AddTags',_0x687ae2,JSON[_0x063f('0x16')](_0x494412));_0x286c9d(_0x494412);})[_0x063f('0x1b')](function(_0x81b107){logger[_0x063f('0x17')]('AddTags',_0x81b107[_0x063f('0x19')],_0x687ae2);_0x3a97d5(_this['error'](0x1f4,_0x81b107[_0x063f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 9f2422f..2f4a8b1 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 _0xa863=['register','save','remove','emit','removeListener'];(function(_0x4318bd,_0x423db0){var _0xba3eb8=function(_0x2841ae){while(--_0x2841ae){_0x4318bd['push'](_0x4318bd['shift']());}};_0xba3eb8(++_0x423db0);}(_0xa863,0x83));var _0x3a86=function(_0x58abb9,_0x47ae6b){_0x58abb9=_0x58abb9-0x0;var _0x163f63=_0xa863[_0x58abb9];return _0x163f63;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x3a86('0x0'),_0x3a86('0x1'),'update'];function createListener(_0xd2fb6c,_0x1f84e9){return function(_0x2794b7){_0x1f84e9[_0x3a86('0x2')](_0xd2fb6c,_0x2794b7);};}function removeListener(_0x5d3679,_0x35db95){return function(){WhatsappInteractionEvents[_0x3a86('0x3')](_0x5d3679,_0x35db95);};}exports[_0x3a86('0x4')]=function(_0x24af7d){for(var _0x333066=0x0,_0x3b7409=events['length'];_0x333066<_0x3b7409;_0x333066++){var _0x37f92c=events[_0x333066];var _0xb583b6=createListener('whatsappInteraction:'+_0x37f92c,_0x24af7d);WhatsappInteractionEvents['on'](_0x37f92c,_0xb583b6);}}; \ No newline at end of file +var _0xbb64=['whatsappInteraction:','remove','update','emit','removeListener','register'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xbb64,0xd9));var _0x4bb6=function(_0x491e93,_0x3f2842){_0x491e93=_0x491e93-0x0;var _0x268b04=_0xbb64[_0x491e93];return _0x268b04;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x4bb6('0x0'),_0x4bb6('0x1')];function createListener(_0x1455a4,_0x130e32){return function(_0x20043c){_0x130e32[_0x4bb6('0x2')](_0x1455a4,_0x20043c);};}function removeListener(_0x55439d,_0x2a53c0){return function(){WhatsappInteractionEvents[_0x4bb6('0x3')](_0x55439d,_0x2a53c0);};}exports[_0x4bb6('0x4')]=function(_0x1c35be){for(var _0x22c05f=0x0,_0x47fdba=events['length'];_0x22c05f<_0x47fdba;_0x22c05f++){var _0x362288=events[_0x22c05f];var _0x490ed1=createListener(_0x4bb6('0x5')+_0x362288,_0x1c35be);WhatsappInteractionEvents['on'](_0x362288,_0x490ed1);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 5f4aeae..0c54cde 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 _0xc667=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','put','update','/:id/accept','accept'];(function(_0x3fd09d,_0x3f577c){var _0x42f5b4=function(_0x3de02a){while(--_0x3de02a){_0x3fd09d['push'](_0x3fd09d['shift']());}};_0x42f5b4(++_0x3f577c);}(_0xc667,0x12b));var _0x7c66=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc667[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x7c66('0x0'));var path=require(_0x7c66('0x1'));var timeout=require(_0x7c66('0x2'));var express=require(_0x7c66('0x3'));var router=express[_0x7c66('0x4')]();var fs_extra=require(_0x7c66('0x5'));var auth=require(_0x7c66('0x6'));var interaction=require(_0x7c66('0x7'));var config=require(_0x7c66('0x8'));var controller=require(_0x7c66('0x9'));router[_0x7c66('0xa')]('/',auth[_0x7c66('0xb')](),controller[_0x7c66('0xc')]);router[_0x7c66('0xa')](_0x7c66('0xd'),auth[_0x7c66('0xb')](),controller['describe']);router[_0x7c66('0xa')](_0x7c66('0xe'),auth[_0x7c66('0xb')](),controller[_0x7c66('0xf')]);router[_0x7c66('0x10')]('/',auth[_0x7c66('0xb')](),interaction[_0x7c66('0x11')](_0x7c66('0x12'),_0x7c66('0x13')),controller['create']);router['post'](_0x7c66('0x14'),controller['status']);router[_0x7c66('0x15')](_0x7c66('0xe'),auth[_0x7c66('0xb')](),controller[_0x7c66('0x16')]);router[_0x7c66('0x15')](_0x7c66('0x17'),auth['isAuthenticated'](),controller[_0x7c66('0x18')]);router[_0x7c66('0x15')]('/:id/reject',auth[_0x7c66('0xb')](),controller['reject']);router[_0x7c66('0x19')](_0x7c66('0xe'),auth[_0x7c66('0xb')](),controller[_0x7c66('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x6a0a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','express','Router'];(function(_0x522bad,_0x35fc86){var _0xa47a2c=function(_0x4f0d7a){while(--_0x4f0d7a){_0x522bad['push'](_0x522bad['shift']());}};_0xa47a2c(++_0x35fc86);}(_0x6a0a,0x11b));var _0xa6a0=function(_0x27926c,_0x37d579){_0x27926c=_0x27926c-0x0;var _0x584578=_0x6a0a[_0x27926c];return _0x584578;};'use strict';var multer=require(_0xa6a0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa6a0('0x1'));var router=express[_0xa6a0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa6a0('0x3'));var interaction=require(_0xa6a0('0x4'));var config=require(_0xa6a0('0x5'));var controller=require(_0xa6a0('0x6'));router[_0xa6a0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa6a0('0x7')](_0xa6a0('0x8'),auth['isAuthenticated'](),controller[_0xa6a0('0x9')]);router[_0xa6a0('0x7')](_0xa6a0('0xa'),auth[_0xa6a0('0xb')](),controller[_0xa6a0('0xc')]);router[_0xa6a0('0xd')]('/',auth[_0xa6a0('0xb')](),interaction[_0xa6a0('0xe')](_0xa6a0('0xf'),_0xa6a0('0x10')),controller[_0xa6a0('0x11')]);router[_0xa6a0('0xd')]('/:id/status',controller[_0xa6a0('0x12')]);router[_0xa6a0('0x13')]('/:id',auth[_0xa6a0('0xb')](),controller['update']);router[_0xa6a0('0x13')](_0xa6a0('0x14'),auth[_0xa6a0('0xb')](),controller[_0xa6a0('0x15')]);router[_0xa6a0('0x13')](_0xa6a0('0x16'),auth[_0xa6a0('0xb')](),controller[_0xa6a0('0x17')]);router[_0xa6a0('0x18')]('/:id',auth[_0xa6a0('0xb')](),controller['destroy']);module[_0xa6a0('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 80ada25..fbc85e0 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 _0x87cc=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x87cc,0x15c));var _0xc87c=function(_0xe93926,_0x1cc03c){_0xe93926=_0xe93926-0x0;var _0x4d1619=_0x87cc[_0xe93926];return _0x4d1619;};'use strict';var Sequelize=require(_0xc87c('0x0'));module[_0xc87c('0x1')]={'body':{'type':Sequelize[_0xc87c('0x2')](_0xc87c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc87c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xc87c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc87c('0x6')]},'readAt':{'type':Sequelize[_0xc87c('0x7')]},'secret':{'type':Sequelize[_0xc87c('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc87c('0x6')]},'providerResponse':{'type':Sequelize[_0xc87c('0x2')]}}; \ No newline at end of file +var _0x5c24=['TEXT','sequelize','exports','medium','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5c24,0x184));var _0x45c2=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0x5c24[_0x549278];return _0x1ea9a1;};'use strict';var Sequelize=require(_0x45c2('0x0'));module[_0x45c2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x45c2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x45c2('0x3')]('in',_0x45c2('0x4')),'defaultValue':_0x45c2('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x45c2('0x5')]},'readAt':{'type':Sequelize[_0x45c2('0x6')]},'secret':{'type':Sequelize[_0x45c2('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x45c2('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index bc05fb2..06019a4 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 _0xa47c=['received\x20delivery\x20report\x20from','inspect','twilio','messageId','MessageStatus','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','WhatsappMessage,\x20%s,\x20%s','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','fields','find','create','body','destroy','describe','whatsapp-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','ContactId','QueryTypes','SELECT','User','email','manual','interface','channel','motionChannel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','fullname','internal','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s'];(function(_0x538144,_0x5d81ee){var _0x47270a=function(_0x11f76a){while(--_0x11f76a){_0x538144['push'](_0x538144['shift']());}};_0x47270a(++_0x5d81ee);}(_0xa47c,0x11b));var _0xca47=function(_0x46ad37,_0xe119c){_0x46ad37=_0x46ad37-0x0;var _0x536f54=_0xa47c[_0x46ad37];return _0x536f54;};'use strict';var emlformat=require(_0xca47('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xca47('0x1'));var rp=require(_0xca47('0x2'));var moment=require(_0xca47('0x3'));var BPromise=require(_0xca47('0x4'));var Mustache=require(_0xca47('0x5'));var util=require(_0xca47('0x6'));var path=require('path');var sox=require(_0xca47('0x7'));var csv=require(_0xca47('0x8'));var ejs=require(_0xca47('0x9'));var fs=require('fs');var fs_extra=require(_0xca47('0xa'));var _=require(_0xca47('0xb'));var squel=require(_0xca47('0xc'));var crypto=require(_0xca47('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xca47('0xe'));var toCsv=require(_0xca47('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca47('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca47('0x10'));var as=require(_0xca47('0x11'));var hardwareService=require(_0xca47('0x12'));var logger=require(_0xca47('0x13'))(_0xca47('0x14'));var utils=require(_0xca47('0x15'));var config=require(_0xca47('0x16'));var licenseUtil=require(_0xca47('0x17'));var db=require(_0xca47('0x18'))['db'];config[_0xca47('0x19')]=_[_0xca47('0x1a')](config['redis'],{'host':_0xca47('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xca47('0x1c'))[_0xca47('0x1d')](socket);var jayson=require(_0xca47('0x1e'));var client=jayson[_0xca47('0x1f')][_0xca47('0x20')]({'port':0x232c});var client9002=jayson[_0xca47('0x1f')][_0xca47('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3e7581,_0x39a833,_0x5df5e7,_0x2a4b63){return new BPromise(function(_0x790cad,_0x332f5c){var _0x1f3086=_0x2a4b63||client;return _0x1f3086['request'](_0x3e7581,_0x5df5e7)[_0xca47('0x21')](function(_0x3223af){logger[_0xca47('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x39a833,_0xca47('0x23'));logger[_0xca47('0x24')](_0xca47('0x25'),_0x39a833,_0xca47('0x23'),JSON['stringify'](_0x3223af));if(_0x3223af[_0xca47('0x26')]){if(_0x3223af[_0xca47('0x26')][_0xca47('0x27')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x39a833,_0x3223af[_0xca47('0x26')][_0xca47('0x28')]);return _0x332f5c(_0x3223af['error'][_0xca47('0x28')]);}logger[_0xca47('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x39a833,_0x3223af[_0xca47('0x26')][_0xca47('0x28')]);return _0x790cad(_0x3223af[_0xca47('0x26')][_0xca47('0x28')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x39a833,'request\x20sent');_0x790cad(_0x3223af['result'][_0xca47('0x28')]);}})[_0xca47('0x29')](function(_0x1fd6a4){logger[_0xca47('0x26')](_0xca47('0x2a'),_0x39a833,_0x1fd6a4);_0x332f5c(_0x1fd6a4);});});}function respondWithStatusCode(_0x2b2333,_0x1d3b87){_0x1d3b87=_0x1d3b87||0xcc;return function(_0xc24735){if(_0xc24735){return _0x2b2333[_0xca47('0x2b')](_0x1d3b87);}return _0x2b2333[_0xca47('0x2c')](_0x1d3b87)[_0xca47('0x2d')]();};}function respondWithResult(_0x3b69ce,_0x5b4d03){_0x5b4d03=_0x5b4d03||0xc8;return function(_0x54eb62){if(_0x54eb62){return _0x3b69ce['status'](_0x5b4d03)['json'](_0x54eb62);}};}function respondWithFilteredResult(_0x2f4732,_0x500c7f){return function(_0x5e7511){if(_0x5e7511){var _0x5ec06b=typeof _0x500c7f[_0xca47('0x2e')]===_0xca47('0x2f')&&typeof _0x500c7f[_0xca47('0x30')]===_0xca47('0x2f');var _0x5edb7f=_0x5e7511['count'];var _0x467016=_0x5ec06b?0x0:_0x500c7f[_0xca47('0x2e')];var _0x5de5de=_0x5ec06b?_0x5e7511[_0xca47('0x31')]:_0x500c7f[_0xca47('0x2e')]+_0x500c7f['limit'];var _0x48b98d;if(_0x5de5de>=_0x5edb7f){_0x5de5de=_0x5edb7f;_0x48b98d=0xc8;}else{_0x48b98d=0xce;}_0x2f4732['status'](_0x48b98d);return _0x2f4732[_0xca47('0x32')](_0xca47('0x33'),_0x467016+'-'+_0x5de5de+'/'+_0x5edb7f)[_0xca47('0x34')](_0x5e7511);}return null;};}function patchUpdates(_0xa1aeeb){return function(_0xda0870){try{jsonpatch[_0xca47('0x35')](_0xda0870,_0xa1aeeb,!![]);}catch(_0x4d71ad){return BPromise[_0xca47('0x36')](_0x4d71ad);}return _0xda0870[_0xca47('0x37')]();};}function saveUpdates(_0x19c718,_0x2c1ba3){return function(_0x266c6e){if(_0x266c6e){return _0x266c6e[_0xca47('0x38')](_0x19c718)['then'](function(_0x39d7b9){return _0x39d7b9;});}return null;};}function removeEntity(_0x5a84f9,_0x53b16a){return function(_0x42f841){if(_0x42f841){return _0x42f841['destroy']()[_0xca47('0x21')](function(){_0x5a84f9[_0xca47('0x2c')](0xcc)[_0xca47('0x2d')]();});}};}function handleEntityNotFound(_0x5b1493,_0x13501f){return function(_0x5dcd67){if(!_0x5dcd67){_0x5b1493[_0xca47('0x2b')](0x194);}return _0x5dcd67;};}function handleError(_0x5dd57c,_0x51eb69){_0x51eb69=_0x51eb69||0x1f4;return function(_0x1304f7){logger[_0xca47('0x26')](_0x1304f7[_0xca47('0x39')]);if(_0x1304f7['name']){delete _0x1304f7[_0xca47('0x3a')];}_0x5dd57c['status'](_0x51eb69)[_0xca47('0x3b')](_0x1304f7);};}exports['index']=function(_0x5128cc,_0x1302fe){var _0x4305a7={},_0x62fc23={},_0x5d0f19={'count':0x0,'rows':[]};var _0x34486a=_[_0xca47('0x3c')](db[_0xca47('0x3d')][_0xca47('0x3e')],function(_0x4097c4){return{'name':_0x4097c4[_0xca47('0x3f')],'type':_0x4097c4['type'][_0xca47('0x40')]};});_0x62fc23[_0xca47('0x41')]=_['map'](_0x34486a,_0xca47('0x3a'));_0x62fc23[_0xca47('0x42')]=_['keys'](_0x5128cc[_0xca47('0x42')]);_0x62fc23[_0xca47('0x43')]=_[_0xca47('0x44')](_0x62fc23[_0xca47('0x41')],_0x62fc23[_0xca47('0x42')]);_0x4305a7[_0xca47('0x45')]=_['intersection'](_0x62fc23[_0xca47('0x41')],qs['fields'](_0x5128cc['query']['fields']));_0x4305a7[_0xca47('0x45')]=_0x4305a7[_0xca47('0x45')][_0xca47('0x46')]?_0x4305a7['attributes']:_0x62fc23[_0xca47('0x41')];if(!_0x5128cc[_0xca47('0x42')][_0xca47('0x47')](_0xca47('0x48'))){_0x4305a7['limit']=qs[_0xca47('0x30')](_0x5128cc[_0xca47('0x42')]['limit']);_0x4305a7['offset']=qs[_0xca47('0x2e')](_0x5128cc[_0xca47('0x42')]['offset']);}_0x4305a7['order']=qs[_0xca47('0x49')](_0x5128cc[_0xca47('0x42')][_0xca47('0x49')]);_0x4305a7[_0xca47('0x4a')]=qs[_0xca47('0x43')](_[_0xca47('0x4b')](_0x5128cc[_0xca47('0x42')],_0x62fc23[_0xca47('0x43')]),_0x34486a);if(_0x5128cc['query'][_0xca47('0x4c')]){_0x4305a7['where']=_[_0xca47('0x4d')](_0x4305a7[_0xca47('0x4a')],{'$or':_['map'](_0x34486a,function(_0x1c0970){if(_0x1c0970[_0xca47('0x4e')]!=='VIRTUAL'){var _0x5ac33f={};_0x5ac33f[_0x1c0970[_0xca47('0x3a')]]={'$like':'%'+_0x5128cc[_0xca47('0x42')][_0xca47('0x4c')]+'%'};return _0x5ac33f;}})});}_0x4305a7=_[_0xca47('0x4d')]({},_0x4305a7,_0x5128cc[_0xca47('0x4f')]);var _0x10156c={'where':_0x4305a7[_0xca47('0x4a')]};return db[_0xca47('0x3d')][_0xca47('0x31')](_0x10156c)[_0xca47('0x21')](function(_0x4d0b7f){_0x5d0f19[_0xca47('0x31')]=_0x4d0b7f;if(_0x5128cc[_0xca47('0x42')][_0xca47('0x50')]){_0x4305a7[_0xca47('0x51')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xca47('0x52')](_0x4305a7);})[_0xca47('0x21')](function(_0x134406){_0x5d0f19[_0xca47('0x53')]=_0x134406;return _0x5d0f19;})[_0xca47('0x21')](respondWithFilteredResult(_0x1302fe,_0x4305a7))[_0xca47('0x29')](handleError(_0x1302fe,null));};exports[_0xca47('0x54')]=function(_0x17e1fd,_0x10fa49){var _0x4ac7fd={'raw':!![],'where':{'id':_0x17e1fd[_0xca47('0x55')]['id']}},_0x3d544e={};_0x3d544e[_0xca47('0x41')]=_[_0xca47('0x56')](db[_0xca47('0x3d')][_0xca47('0x3e')]);_0x3d544e['query']=_[_0xca47('0x56')](_0x17e1fd['query']);_0x3d544e[_0xca47('0x43')]=_[_0xca47('0x44')](_0x3d544e['model'],_0x3d544e[_0xca47('0x42')]);_0x4ac7fd[_0xca47('0x45')]=_[_0xca47('0x44')](_0x3d544e[_0xca47('0x41')],qs[_0xca47('0x57')](_0x17e1fd['query'][_0xca47('0x57')]));_0x4ac7fd[_0xca47('0x45')]=_0x4ac7fd[_0xca47('0x45')][_0xca47('0x46')]?_0x4ac7fd['attributes']:_0x3d544e[_0xca47('0x41')];if(_0x17e1fd['query']['includeAll']){_0x4ac7fd[_0xca47('0x51')]=[{'all':!![]}];}_0x4ac7fd=_['merge']({},_0x4ac7fd,_0x17e1fd[_0xca47('0x4f')]);return db[_0xca47('0x3d')][_0xca47('0x58')](_0x4ac7fd)['then'](handleEntityNotFound(_0x10fa49,null))['then'](respondWithResult(_0x10fa49,null))[_0xca47('0x29')](handleError(_0x10fa49,null));};exports[_0xca47('0x59')]=function(_0x3b3c6d,_0x12b13e){return db['WhatsappMessage'][_0xca47('0x59')](_0x3b3c6d['body'],{})[_0xca47('0x21')](respondWithResult(_0x12b13e,0xc9))['catch'](handleError(_0x12b13e,null));};exports[_0xca47('0x38')]=function(_0x43cd2e,_0x325414){if(_0x43cd2e[_0xca47('0x5a')]['id']){delete _0x43cd2e[_0xca47('0x5a')]['id'];}return db[_0xca47('0x3d')][_0xca47('0x58')]({'where':{'id':_0x43cd2e[_0xca47('0x55')]['id']}})[_0xca47('0x21')](handleEntityNotFound(_0x325414,null))[_0xca47('0x21')](saveUpdates(_0x43cd2e[_0xca47('0x5a')],null))['then'](respondWithResult(_0x325414,null))[_0xca47('0x29')](handleError(_0x325414,null));};exports[_0xca47('0x5b')]=function(_0x201d86,_0x215fa5){return db['WhatsappMessage']['find']({'where':{'id':_0x201d86[_0xca47('0x55')]['id']}})[_0xca47('0x21')](handleEntityNotFound(_0x215fa5,null))[_0xca47('0x21')](removeEntity(_0x215fa5,null))['catch'](handleError(_0x215fa5,null));};exports[_0xca47('0x5c')]=function(_0x504916,_0x391b93){return db[_0xca47('0x3d')][_0xca47('0x5c')]()[_0xca47('0x21')](respondWithResult(_0x391b93,null))[_0xca47('0x29')](handleError(_0x391b93,null));};var interaction_log=require(_0xca47('0x13'))(_0xca47('0x5d'));exports['accept']=function(_0x48ac10,_0x32c827,_0x23d49e){var _0x23eab4={'agent':{},'channel':'whatsapp'};if(_0x48ac10[_0xca47('0x5a')]['id']){delete _0x48ac10[_0xca47('0x5a')]['id'];}_0x48ac10[_0xca47('0x5a')][_0xca47('0x5e')]=!![];_0x48ac10[_0xca47('0x5a')][_0xca47('0x5f')]=moment()[_0xca47('0x60')](_0xca47('0x61'));_0x48ac10[_0xca47('0x5a')]['UserId']=_0x48ac10[_0xca47('0x5a')]['UserId']||_0x48ac10[_0xca47('0x62')]['id'];_0x23eab4[_0xca47('0x63')]['id']=_0x48ac10[_0xca47('0x5a')][_0xca47('0x64')];return db['WhatsappMessage']['find']({'where':{'id':_0x48ac10[_0xca47('0x55')]['id'],'UserId':null}})[_0xca47('0x21')](handleEntityNotFound(_0x32c827,null))[_0xca47('0x21')](saveUpdates(_0x48ac10['body'],null))[_0xca47('0x21')](function(_0x58cb58){if(_0x58cb58){_0x23eab4[_0xca47('0x28')]=_0x58cb58[_0xca47('0x65')]({'plain':!![]});return db[_0xca47('0x66')][_0xca47('0x58')]({'where':{'id':_0x58cb58[_0xca47('0x67')]}});}return null;})[_0xca47('0x21')](handleEntityNotFound(_0x32c827,null))[_0xca47('0x21')](function(_0x4fd2c4){if(_0x4fd2c4){return _0x4fd2c4[_0xca47('0x38')]({'UserId':_0x48ac10[_0xca47('0x5a')][_0xca47('0x64')],'read1stAt':_[_0xca47('0x68')](_0x4fd2c4[_0xca47('0x69')])?moment()[_0xca47('0x60')](_0xca47('0x61')):undefined});}return null;})[_0xca47('0x21')](function(_0x1a2658){if(_0x1a2658){_0x23eab4[_0xca47('0x6a')]=_0x1a2658[_0xca47('0x65')]({'plain':!![]});interaction_log[_0xca47('0x22')](_0xca47('0x6b'),_0x48ac10[_0xca47('0x62')]['id'],_0x48ac10['user'][_0xca47('0x3a')],_0x48ac10[_0xca47('0x62')][_0xca47('0x6c')],_0x23eab4[_0xca47('0x6a')]['id'],_0x48ac10['body']?JSON[_0xca47('0x6d')](_0x48ac10[_0xca47('0x5a')]):_0xca47('0x6e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x23eab4);}return null;})[_0xca47('0x21')](function(_0x4550e6){var _0x2ac45c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4550e6[_0xca47('0x28')][_0xca47('0x6f')];return db['sequelize']['query'](_0x2ac45c,{'type':db['Sequelize'][_0xca47('0x70')][_0xca47('0x71')],'raw':!![]})[_0xca47('0x21')](function(_0xb3f329){return _0xb3f329;});})['then'](function(_0xe31b16){if(_0xe31b16){_0x23eab4[_0xca47('0x28')]['contact']=_0xe31b16[0x0];if(!_0x48ac10[_0xca47('0x5a')][_0xca47('0x64')])return;return db[_0xca47('0x72')][_0xca47('0x58')]({'where':{'id':_0x48ac10['body'][_0xca47('0x64')],'role':'agent'},'attributes':['id',_0xca47('0x3a'),'fullname',_0xca47('0x73'),'internal'],'raw':!![]});}return null;})[_0xca47('0x21')](function(_0x47dba2){if(!_0x47dba2)return null;_0x23eab4['message'][_0xca47('0x63')]=_0x47dba2;return _0x23eab4;})[_0xca47('0x21')](function(_0x3e6153){if(_0x3e6153){if(_0x48ac10[_0xca47('0x5a')][_0xca47('0x74')]){_0x23eab4[_0xca47('0x28')][_0xca47('0x75')]=util[_0xca47('0x60')]('SIP/%s',_0x48ac10[_0xca47('0x62')][_0xca47('0x3a')]);_0x23eab4[_0xca47('0x28')][_0xca47('0x76')]=_0x23eab4[_0xca47('0x76')];_0x23eab4[_0xca47('0x28')][_0xca47('0x77')]=_0x23eab4[_0xca47('0x76')];_0x23eab4[_0xca47('0x28')][_0xca47('0x78')]='accept';return respondWithRpcPromise(_0xca47('0x79'),'EventManager',{'event':'acceptmessage','message':_0x23eab4['message']},client9002)[_0xca47('0x21')](function(){return _0x23eab4;});}return _0x23eab4;}return null;})[_0xca47('0x21')](respondWithResult(_0x32c827,null))[_0xca47('0x29')](handleError(_0x32c827,null));};var interaction_log=require(_0xca47('0x13'))('whatsapp-interactions');exports['reject']=function(_0x523462,_0x404857,_0x493d53){var _0x5a2a68={'agent':{},'channel':'whatsapp'};if(_0x523462[_0xca47('0x5a')]['id']){delete _0x523462[_0xca47('0x5a')]['id'];}_0x523462['body'][_0xca47('0x64')]=_0x523462['body'][_0xca47('0x64')]||_0x523462[_0xca47('0x62')]['id'];_0x5a2a68[_0xca47('0x63')]['id']=_0x523462[_0xca47('0x5a')][_0xca47('0x64')];return db[_0xca47('0x3d')][_0xca47('0x58')]({'where':{'id':_0x523462[_0xca47('0x55')]['id'],'UserId':null}})[_0xca47('0x21')](handleEntityNotFound(_0x404857,null))[_0xca47('0x21')](function(_0x27b36b){if(_0x27b36b){_0x5a2a68[_0xca47('0x28')]=_0x27b36b['get']({'plain':!![]});return db[_0xca47('0x66')][_0xca47('0x58')]({'where':{'id':_0x27b36b[_0xca47('0x67')]}});}return null;})[_0xca47('0x21')](handleEntityNotFound(_0x404857,null))[_0xca47('0x21')](function(_0x1901e1){if(_0x1901e1){_0x5a2a68['interaction']=_0x1901e1[_0xca47('0x65')]({'plain':!![]});interaction_log[_0xca47('0x22')](_0xca47('0x7a'),_0x523462[_0xca47('0x62')]['id'],_0x523462[_0xca47('0x62')][_0xca47('0x3a')],_0x523462[_0xca47('0x62')][_0xca47('0x6c')],_0x5a2a68[_0xca47('0x6a')]['id'],_0x523462[_0xca47('0x5a')]?JSON['stringify'](_0x523462['body']):_0xca47('0x6e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5a2a68);}return null;})[_0xca47('0x21')](function(_0x1f5866){var _0x5edc7e=_0xca47('0x7b')+_0x1f5866[_0xca47('0x28')][_0xca47('0x6f')];return db[_0xca47('0x7c')][_0xca47('0x42')](_0x5edc7e,{'type':db[_0xca47('0x7d')]['QueryTypes']['SELECT'],'raw':!![]})[_0xca47('0x21')](function(_0x3a5307){return _0x3a5307;});})[_0xca47('0x21')](function(_0x18798f){if(_0x18798f){_0x5a2a68[_0xca47('0x28')][_0xca47('0x7e')]=_0x18798f[0x0];if(!_0x523462['body'][_0xca47('0x64')])return;return db[_0xca47('0x72')][_0xca47('0x58')]({'where':{'id':_0x523462['body'][_0xca47('0x64')],'role':_0xca47('0x63')},'attributes':['id',_0xca47('0x3a'),_0xca47('0x7f'),'email',_0xca47('0x80')],'raw':!![]});}return null;})[_0xca47('0x21')](function(_0x2d0757){if(!_0x2d0757)return null;_0x5a2a68['message'][_0xca47('0x63')]=_0x2d0757;return _0x5a2a68;})[_0xca47('0x21')](function(_0x1bb4b4){if(_0x1bb4b4){_0x1bb4b4[_0xca47('0x28')][_0xca47('0x75')]=util[_0xca47('0x60')](_0xca47('0x81'),_0x523462[_0xca47('0x62')][_0xca47('0x3a')]);_0x1bb4b4[_0xca47('0x28')][_0xca47('0x76')]=_0x5a2a68['channel'];_0x1bb4b4[_0xca47('0x28')][_0xca47('0x77')]=_0x5a2a68[_0xca47('0x76')];_0x1bb4b4[_0xca47('0x28')][_0xca47('0x78')]='reject';respondWithRpcPromise('EventManager',_0xca47('0x79'),{'event':_0xca47('0x82'),'message':_0x1bb4b4[_0xca47('0x28')]},client9002);return _0x5a2a68;}return null;})['then'](respondWithResult(_0x404857,null))[_0xca47('0x29')](handleError(_0x404857,null));};exports[_0xca47('0x2c')]=function(_0x4932b1,_0x51c06e,_0xe892b5){if(_0x4932b1[_0xca47('0x5a')]['id']){delete _0x4932b1[_0xca47('0x5a')]['id'];}var _0x2341ed;return db['WhatsappMessage'][_0xca47('0x58')]({'where':{'id':_0x4932b1['params']['id']}})[_0xca47('0x21')](handleEntityNotFound(_0x51c06e,null))['then'](function(_0x4746bf){if(_0x4746bf){_0x2341ed=_0x4746bf;return db[_0xca47('0x83')][_0xca47('0x58')]({'where':{'id':_0x4746bf[_0xca47('0x84')]}});}})[_0xca47('0x21')](handleEntityNotFound(_0x51c06e,null))[_0xca47('0x21')](function(_0x5c7fab){if(_0x5c7fab){logger[_0xca47('0x24')](_0xca47('0x85'),_0xca47('0x2c'),_0xca47('0x86'),_0x5c7fab['type'],util[_0xca47('0x87')](_0x4932b1[_0xca47('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5c7fab[_0xca47('0x4e')]){case _0xca47('0x88'):if(_0x4932b1[_0xca47('0x5a')]['MessageSid']&&_0x4932b1[_0xca47('0x5a')]['MessageSid']===_0x2341ed[_0xca47('0x89')]&&_0x4932b1[_0xca47('0x5a')][_0xca47('0x8a')]&&_0x4932b1[_0xca47('0x5a')]['MessageStatus']===_0xca47('0x5e')){return _0x2341ed['update']({'read':!![]});}else{logger[_0xca47('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xca47('0x88'),util[_0xca47('0x87')](_0x4932b1['body'],{'showHidden':![],'depth':null}));}break;}return _0x2341ed;}})[_0xca47('0x21')](respondWithResult(_0x51c06e,null))[_0xca47('0x29')](handleError(_0x51c06e,null));}; \ No newline at end of file +var _0xf791=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','end','status','offset','undefined','count','set','Content-Range','reject','save','update','sendStatus','stack','name','send','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','include','show','params','includeAll','find','catch','create','body','destroy','describe','whatsapp-interactions','whatsapp','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SIP/%s','rejectmessage','WhatsappAccount','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','fast-json-patch','request-promise'];(function(_0x1e1e97,_0x17267e){var _0x2ab971=function(_0xe1381a){while(--_0xe1381a){_0x1e1e97['push'](_0x1e1e97['shift']());}};_0x2ab971(++_0x17267e);}(_0xf791,0x115));var _0x1f79=function(_0x11a741,_0x1e7097){_0x11a741=_0x11a741-0x0;var _0xa466f6=_0xf791[_0x11a741];return _0xa466f6;};'use strict';var emlformat=require(_0x1f79('0x0'));var rimraf=require(_0x1f79('0x1'));var zipdir=require(_0x1f79('0x2'));var jsonpatch=require(_0x1f79('0x3'));var rp=require(_0x1f79('0x4'));var moment=require(_0x1f79('0x5'));var BPromise=require(_0x1f79('0x6'));var Mustache=require(_0x1f79('0x7'));var util=require(_0x1f79('0x8'));var path=require(_0x1f79('0x9'));var sox=require('sox');var csv=require(_0x1f79('0xa'));var ejs=require(_0x1f79('0xb'));var fs=require('fs');var fs_extra=require(_0x1f79('0xc'));var _=require(_0x1f79('0xd'));var squel=require(_0x1f79('0xe'));var crypto=require(_0x1f79('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1f79('0x10'));var toCsv=require(_0x1f79('0xa'));var querystring=require(_0x1f79('0x11'));var Papa=require(_0x1f79('0x12'));var Redis=require(_0x1f79('0x13'));var authService=require(_0x1f79('0x14'));var qs=require(_0x1f79('0x15'));var as=require(_0x1f79('0x16'));var hardwareService=require(_0x1f79('0x17'));var logger=require(_0x1f79('0x18'))(_0x1f79('0x19'));var utils=require(_0x1f79('0x1a'));var config=require(_0x1f79('0x1b'));var licenseUtil=require(_0x1f79('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x1f79('0x1d')],{'host':_0x1f79('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f79('0x1d')]));require(_0x1f79('0x1f'))[_0x1f79('0x20')](socket);var jayson=require(_0x1f79('0x21'));var client=jayson[_0x1f79('0x22')][_0x1f79('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x1f79('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x556a8c,_0x5a0d02,_0x43bf50,_0x36cb5a){return new BPromise(function(_0x1547b7,_0x4324de){var _0x1c7439=_0x36cb5a||client;return _0x1c7439[_0x1f79('0x24')](_0x556a8c,_0x43bf50)[_0x1f79('0x25')](function(_0x3d3a5c){logger[_0x1f79('0x26')](_0x1f79('0x27'),_0x5a0d02,_0x1f79('0x28'));logger[_0x1f79('0x29')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5a0d02,'request\x20sent',JSON[_0x1f79('0x2a')](_0x3d3a5c));if(_0x3d3a5c['error']){if(_0x3d3a5c[_0x1f79('0x2b')][_0x1f79('0x2c')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5a0d02,_0x3d3a5c['error'][_0x1f79('0x2d')]);return _0x4324de(_0x3d3a5c[_0x1f79('0x2b')][_0x1f79('0x2d')]);}logger[_0x1f79('0x2b')](_0x1f79('0x27'),_0x5a0d02,_0x3d3a5c[_0x1f79('0x2b')][_0x1f79('0x2d')]);return _0x1547b7(_0x3d3a5c[_0x1f79('0x2b')][_0x1f79('0x2d')]);}else{logger[_0x1f79('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x5a0d02,_0x1f79('0x28'));_0x1547b7(_0x3d3a5c[_0x1f79('0x2e')][_0x1f79('0x2d')]);}})['catch'](function(_0x233b8e){logger[_0x1f79('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0x5a0d02,_0x233b8e);_0x4324de(_0x233b8e);});});}function respondWithStatusCode(_0x2e534c,_0x319da6){_0x319da6=_0x319da6||0xcc;return function(_0x222116){if(_0x222116){return _0x2e534c['sendStatus'](_0x319da6);}return _0x2e534c['status'](_0x319da6)[_0x1f79('0x2f')]();};}function respondWithResult(_0x2e97fb,_0x22ec56){_0x22ec56=_0x22ec56||0xc8;return function(_0x5b8a62){if(_0x5b8a62){return _0x2e97fb[_0x1f79('0x30')](_0x22ec56)['json'](_0x5b8a62);}};}function respondWithFilteredResult(_0x27d6e1,_0x1a54dd){return function(_0xfe85e7){if(_0xfe85e7){var _0x11bdc0=typeof _0x1a54dd[_0x1f79('0x31')]===_0x1f79('0x32')&&typeof _0x1a54dd['limit']==='undefined';var _0x35f454=_0xfe85e7[_0x1f79('0x33')];var _0x57c91a=_0x11bdc0?0x0:_0x1a54dd['offset'];var _0x5d68fb=_0x11bdc0?_0xfe85e7['count']:_0x1a54dd[_0x1f79('0x31')]+_0x1a54dd['limit'];var _0x28d486;if(_0x5d68fb>=_0x35f454){_0x5d68fb=_0x35f454;_0x28d486=0xc8;}else{_0x28d486=0xce;}_0x27d6e1[_0x1f79('0x30')](_0x28d486);return _0x27d6e1[_0x1f79('0x34')](_0x1f79('0x35'),_0x57c91a+'-'+_0x5d68fb+'/'+_0x35f454)['json'](_0xfe85e7);}return null;};}function patchUpdates(_0x244e6){return function(_0x30ac10){try{jsonpatch['apply'](_0x30ac10,_0x244e6,!![]);}catch(_0x379be8){return BPromise[_0x1f79('0x36')](_0x379be8);}return _0x30ac10[_0x1f79('0x37')]();};}function saveUpdates(_0x5b39ce,_0x23056e){return function(_0x2e01ca){if(_0x2e01ca){return _0x2e01ca[_0x1f79('0x38')](_0x5b39ce)[_0x1f79('0x25')](function(_0xdf330c){return _0xdf330c;});}return null;};}function removeEntity(_0x293a9d,_0x2bf42e){return function(_0x20e23c){if(_0x20e23c){return _0x20e23c['destroy']()[_0x1f79('0x25')](function(){_0x293a9d[_0x1f79('0x30')](0xcc)[_0x1f79('0x2f')]();});}};}function handleEntityNotFound(_0x3941aa,_0x5894f9){return function(_0x20875e){if(!_0x20875e){_0x3941aa[_0x1f79('0x39')](0x194);}return _0x20875e;};}function handleError(_0x4a9cbe,_0x5ae69d){_0x5ae69d=_0x5ae69d||0x1f4;return function(_0x12c4d5){logger[_0x1f79('0x2b')](_0x12c4d5[_0x1f79('0x3a')]);if(_0x12c4d5[_0x1f79('0x3b')]){delete _0x12c4d5[_0x1f79('0x3b')];}_0x4a9cbe['status'](_0x5ae69d)[_0x1f79('0x3c')](_0x12c4d5);};}exports['index']=function(_0x2deca0,_0x303565){var _0x42b878={},_0x346df7={},_0x310b24={'count':0x0,'rows':[]};var _0x569464=_[_0x1f79('0x3d')](db[_0x1f79('0x3e')][_0x1f79('0x3f')],function(_0x16e809){return{'name':_0x16e809['fieldName'],'type':_0x16e809[_0x1f79('0x40')][_0x1f79('0x41')]};});_0x346df7[_0x1f79('0x42')]=_[_0x1f79('0x3d')](_0x569464,_0x1f79('0x3b'));_0x346df7[_0x1f79('0x43')]=_[_0x1f79('0x44')](_0x2deca0[_0x1f79('0x43')]);_0x346df7['filters']=_[_0x1f79('0x45')](_0x346df7[_0x1f79('0x42')],_0x346df7[_0x1f79('0x43')]);_0x42b878['attributes']=_[_0x1f79('0x45')](_0x346df7[_0x1f79('0x42')],qs['fields'](_0x2deca0[_0x1f79('0x43')][_0x1f79('0x46')]));_0x42b878[_0x1f79('0x47')]=_0x42b878[_0x1f79('0x47')][_0x1f79('0x48')]?_0x42b878['attributes']:_0x346df7[_0x1f79('0x42')];if(!_0x2deca0[_0x1f79('0x43')][_0x1f79('0x49')](_0x1f79('0x4a'))){_0x42b878['limit']=qs[_0x1f79('0x4b')](_0x2deca0['query']['limit']);_0x42b878[_0x1f79('0x31')]=qs['offset'](_0x2deca0['query'][_0x1f79('0x31')]);}_0x42b878[_0x1f79('0x4c')]=qs[_0x1f79('0x4d')](_0x2deca0[_0x1f79('0x43')]['sort']);_0x42b878[_0x1f79('0x4e')]=qs[_0x1f79('0x4f')](_['pick'](_0x2deca0[_0x1f79('0x43')],_0x346df7[_0x1f79('0x4f')]),_0x569464);if(_0x2deca0[_0x1f79('0x43')][_0x1f79('0x50')]){_0x42b878['where']=_[_0x1f79('0x51')](_0x42b878['where'],{'$or':_[_0x1f79('0x3d')](_0x569464,function(_0x58a8b9){if(_0x58a8b9[_0x1f79('0x40')]!=='VIRTUAL'){var _0x6e34d3={};_0x6e34d3[_0x58a8b9[_0x1f79('0x3b')]]={'$like':'%'+_0x2deca0[_0x1f79('0x43')][_0x1f79('0x50')]+'%'};return _0x6e34d3;}})});}_0x42b878=_['merge']({},_0x42b878,_0x2deca0[_0x1f79('0x52')]);var _0x3e0150={'where':_0x42b878[_0x1f79('0x4e')]};return db[_0x1f79('0x3e')][_0x1f79('0x33')](_0x3e0150)[_0x1f79('0x25')](function(_0x593235){_0x310b24[_0x1f79('0x33')]=_0x593235;if(_0x2deca0[_0x1f79('0x43')]['includeAll']){_0x42b878[_0x1f79('0x53')]=[{'all':!![]}];}return db[_0x1f79('0x3e')]['findAll'](_0x42b878);})[_0x1f79('0x25')](function(_0x37714c){_0x310b24['rows']=_0x37714c;return _0x310b24;})[_0x1f79('0x25')](respondWithFilteredResult(_0x303565,_0x42b878))['catch'](handleError(_0x303565,null));};exports[_0x1f79('0x54')]=function(_0x1c7832,_0xa79096){var _0x29ddc0={'raw':!![],'where':{'id':_0x1c7832[_0x1f79('0x55')]['id']}},_0xe0cad6={};_0xe0cad6[_0x1f79('0x42')]=_[_0x1f79('0x44')](db[_0x1f79('0x3e')]['rawAttributes']);_0xe0cad6[_0x1f79('0x43')]=_[_0x1f79('0x44')](_0x1c7832['query']);_0xe0cad6[_0x1f79('0x4f')]=_['intersection'](_0xe0cad6['model'],_0xe0cad6[_0x1f79('0x43')]);_0x29ddc0[_0x1f79('0x47')]=_['intersection'](_0xe0cad6[_0x1f79('0x42')],qs[_0x1f79('0x46')](_0x1c7832[_0x1f79('0x43')]['fields']));_0x29ddc0[_0x1f79('0x47')]=_0x29ddc0[_0x1f79('0x47')][_0x1f79('0x48')]?_0x29ddc0['attributes']:_0xe0cad6[_0x1f79('0x42')];if(_0x1c7832[_0x1f79('0x43')][_0x1f79('0x56')]){_0x29ddc0[_0x1f79('0x53')]=[{'all':!![]}];}_0x29ddc0=_[_0x1f79('0x51')]({},_0x29ddc0,_0x1c7832[_0x1f79('0x52')]);return db['WhatsappMessage'][_0x1f79('0x57')](_0x29ddc0)['then'](handleEntityNotFound(_0xa79096,null))[_0x1f79('0x25')](respondWithResult(_0xa79096,null))[_0x1f79('0x58')](handleError(_0xa79096,null));};exports[_0x1f79('0x59')]=function(_0x2d7e86,_0x3168bf){return db[_0x1f79('0x3e')][_0x1f79('0x59')](_0x2d7e86[_0x1f79('0x5a')],{})[_0x1f79('0x25')](respondWithResult(_0x3168bf,0xc9))[_0x1f79('0x58')](handleError(_0x3168bf,null));};exports[_0x1f79('0x38')]=function(_0x2ef01a,_0x30429e){if(_0x2ef01a[_0x1f79('0x5a')]['id']){delete _0x2ef01a['body']['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x2ef01a[_0x1f79('0x55')]['id']}})[_0x1f79('0x25')](handleEntityNotFound(_0x30429e,null))[_0x1f79('0x25')](saveUpdates(_0x2ef01a[_0x1f79('0x5a')],null))[_0x1f79('0x25')](respondWithResult(_0x30429e,null))[_0x1f79('0x58')](handleError(_0x30429e,null));};exports[_0x1f79('0x5b')]=function(_0x287f28,_0x1f4a5c){return db['WhatsappMessage'][_0x1f79('0x57')]({'where':{'id':_0x287f28[_0x1f79('0x55')]['id']}})[_0x1f79('0x25')](handleEntityNotFound(_0x1f4a5c,null))[_0x1f79('0x25')](removeEntity(_0x1f4a5c,null))['catch'](handleError(_0x1f4a5c,null));};exports[_0x1f79('0x5c')]=function(_0x1d7ded,_0x2f1e20){return db[_0x1f79('0x3e')][_0x1f79('0x5c')]()['then'](respondWithResult(_0x2f1e20,null))['catch'](handleError(_0x2f1e20,null));};var interaction_log=require(_0x1f79('0x18'))(_0x1f79('0x5d'));exports['accept']=function(_0x2db709,_0x6317ed,_0x16e7dd){var _0x1c0fac={'agent':{},'channel':_0x1f79('0x5e')};if(_0x2db709['body']['id']){delete _0x2db709['body']['id'];}_0x2db709[_0x1f79('0x5a')][_0x1f79('0x5f')]=!![];_0x2db709[_0x1f79('0x5a')]['readAt']=moment()['format'](_0x1f79('0x60'));_0x2db709[_0x1f79('0x5a')][_0x1f79('0x61')]=_0x2db709[_0x1f79('0x5a')]['UserId']||_0x2db709[_0x1f79('0x62')]['id'];_0x1c0fac[_0x1f79('0x63')]['id']=_0x2db709[_0x1f79('0x5a')][_0x1f79('0x61')];return db['WhatsappMessage'][_0x1f79('0x57')]({'where':{'id':_0x2db709[_0x1f79('0x55')]['id'],'UserId':null}})[_0x1f79('0x25')](handleEntityNotFound(_0x6317ed,null))[_0x1f79('0x25')](saveUpdates(_0x2db709[_0x1f79('0x5a')],null))[_0x1f79('0x25')](function(_0xaedb7f){if(_0xaedb7f){_0x1c0fac[_0x1f79('0x2d')]=_0xaedb7f[_0x1f79('0x64')]({'plain':!![]});return db[_0x1f79('0x65')][_0x1f79('0x57')]({'where':{'id':_0xaedb7f[_0x1f79('0x66')]}});}return null;})[_0x1f79('0x25')](handleEntityNotFound(_0x6317ed,null))[_0x1f79('0x25')](function(_0x395619){if(_0x395619){return _0x395619[_0x1f79('0x38')]({'UserId':_0x2db709[_0x1f79('0x5a')][_0x1f79('0x61')],'read1stAt':_[_0x1f79('0x67')](_0x395619[_0x1f79('0x68')])?moment()[_0x1f79('0x69')](_0x1f79('0x60')):undefined});}return null;})['then'](function(_0x56d0d0){if(_0x56d0d0){_0x1c0fac[_0x1f79('0x6a')]=_0x56d0d0['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2db709[_0x1f79('0x62')]['id'],_0x2db709['user']['name'],_0x2db709['user'][_0x1f79('0x6b')],_0x1c0fac[_0x1f79('0x6a')]['id'],_0x2db709['body']?JSON[_0x1f79('0x2a')](_0x2db709['body']):_0x1f79('0x6c'));return respondWithRpcPromise(_0x1f79('0x6d'),_0x1f79('0x6e'),_0x1c0fac);}return null;})[_0x1f79('0x25')](function(_0x5c6123){var _0x153014=_0x1f79('0x6f')+_0x5c6123[_0x1f79('0x2d')][_0x1f79('0x70')];return db[_0x1f79('0x71')][_0x1f79('0x43')](_0x153014,{'type':db[_0x1f79('0x72')]['QueryTypes'][_0x1f79('0x73')],'raw':!![]})[_0x1f79('0x25')](function(_0x1865f8){return _0x1865f8;});})[_0x1f79('0x25')](function(_0x5041e9){if(_0x5041e9){_0x1c0fac[_0x1f79('0x2d')][_0x1f79('0x74')]=_0x5041e9[0x0];if(!_0x2db709['body'][_0x1f79('0x61')])return;return db[_0x1f79('0x75')]['find']({'where':{'id':_0x2db709[_0x1f79('0x5a')]['UserId'],'role':_0x1f79('0x63')},'attributes':['id',_0x1f79('0x3b'),_0x1f79('0x76'),_0x1f79('0x77'),_0x1f79('0x78')],'raw':!![]});}return null;})[_0x1f79('0x25')](function(_0x1548ab){if(!_0x1548ab)return null;_0x1c0fac['message'][_0x1f79('0x63')]=_0x1548ab;return _0x1c0fac;})[_0x1f79('0x25')](function(_0x2f6425){if(_0x2f6425){if(_0x2db709['body'][_0x1f79('0x79')]){_0x1c0fac[_0x1f79('0x2d')][_0x1f79('0x7a')]=util[_0x1f79('0x69')]('SIP/%s',_0x2db709[_0x1f79('0x62')][_0x1f79('0x3b')]);_0x1c0fac[_0x1f79('0x2d')]['channel']=_0x1c0fac[_0x1f79('0x7b')];_0x1c0fac[_0x1f79('0x2d')][_0x1f79('0x7c')]=_0x1c0fac[_0x1f79('0x7b')];_0x1c0fac[_0x1f79('0x2d')][_0x1f79('0x7d')]=_0x1f79('0x7e');return respondWithRpcPromise(_0x1f79('0x7f'),_0x1f79('0x7f'),{'event':_0x1f79('0x80'),'message':_0x1c0fac['message']},client9002)[_0x1f79('0x25')](function(){return _0x1c0fac;});}return _0x1c0fac;}return null;})[_0x1f79('0x25')](respondWithResult(_0x6317ed,null))['catch'](handleError(_0x6317ed,null));};var interaction_log=require(_0x1f79('0x18'))('whatsapp-interactions');exports['reject']=function(_0x72570a,_0x272f2b,_0x3416c5){var _0x345f23={'agent':{},'channel':'whatsapp'};if(_0x72570a['body']['id']){delete _0x72570a['body']['id'];}_0x72570a['body'][_0x1f79('0x61')]=_0x72570a[_0x1f79('0x5a')]['UserId']||_0x72570a['user']['id'];_0x345f23[_0x1f79('0x63')]['id']=_0x72570a[_0x1f79('0x5a')][_0x1f79('0x61')];return db[_0x1f79('0x3e')][_0x1f79('0x57')]({'where':{'id':_0x72570a['params']['id'],'UserId':null}})[_0x1f79('0x25')](handleEntityNotFound(_0x272f2b,null))[_0x1f79('0x25')](function(_0x49b85c){if(_0x49b85c){_0x345f23['message']=_0x49b85c[_0x1f79('0x64')]({'plain':!![]});return db[_0x1f79('0x65')]['find']({'where':{'id':_0x49b85c[_0x1f79('0x66')]}});}return null;})[_0x1f79('0x25')](handleEntityNotFound(_0x272f2b,null))[_0x1f79('0x25')](function(_0x2f660f){if(_0x2f660f){_0x345f23[_0x1f79('0x6a')]=_0x2f660f[_0x1f79('0x64')]({'plain':!![]});interaction_log[_0x1f79('0x26')](_0x1f79('0x81'),_0x72570a[_0x1f79('0x62')]['id'],_0x72570a[_0x1f79('0x62')][_0x1f79('0x3b')],_0x72570a[_0x1f79('0x62')]['role'],_0x345f23['interaction']['id'],_0x72570a[_0x1f79('0x5a')]?JSON[_0x1f79('0x2a')](_0x72570a[_0x1f79('0x5a')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x345f23);}return null;})[_0x1f79('0x25')](function(_0x2ef81a){var _0x4c16b5=_0x1f79('0x6f')+_0x2ef81a['message'][_0x1f79('0x70')];return db['sequelize'][_0x1f79('0x43')](_0x4c16b5,{'type':db[_0x1f79('0x72')]['QueryTypes'][_0x1f79('0x73')],'raw':!![]})['then'](function(_0x4bece7){return _0x4bece7;});})[_0x1f79('0x25')](function(_0x5d0ab1){if(_0x5d0ab1){_0x345f23[_0x1f79('0x2d')][_0x1f79('0x74')]=_0x5d0ab1[0x0];if(!_0x72570a[_0x1f79('0x5a')]['UserId'])return;return db[_0x1f79('0x75')]['find']({'where':{'id':_0x72570a[_0x1f79('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0x1f79('0x3b'),_0x1f79('0x76'),'email',_0x1f79('0x78')],'raw':!![]});}return null;})[_0x1f79('0x25')](function(_0x69f3e4){if(!_0x69f3e4)return null;_0x345f23[_0x1f79('0x2d')]['agent']=_0x69f3e4;return _0x345f23;})[_0x1f79('0x25')](function(_0x5aa60e){if(_0x5aa60e){_0x5aa60e[_0x1f79('0x2d')][_0x1f79('0x7a')]=util[_0x1f79('0x69')](_0x1f79('0x82'),_0x72570a[_0x1f79('0x62')]['name']);_0x5aa60e['message'][_0x1f79('0x7b')]=_0x345f23['channel'];_0x5aa60e[_0x1f79('0x2d')][_0x1f79('0x7c')]=_0x345f23['channel'];_0x5aa60e[_0x1f79('0x2d')]['event']=_0x1f79('0x36');respondWithRpcPromise(_0x1f79('0x7f'),_0x1f79('0x7f'),{'event':_0x1f79('0x83'),'message':_0x5aa60e[_0x1f79('0x2d')]},client9002);return _0x345f23;}return null;})[_0x1f79('0x25')](respondWithResult(_0x272f2b,null))[_0x1f79('0x58')](handleError(_0x272f2b,null));};exports['status']=function(_0x5523c2,_0x25a03e,_0xc0f687){if(_0x5523c2['body']['id']){delete _0x5523c2[_0x1f79('0x5a')]['id'];}var _0x304fcc;return db[_0x1f79('0x3e')][_0x1f79('0x57')]({'where':{'id':_0x5523c2[_0x1f79('0x55')]['id']}})[_0x1f79('0x25')](handleEntityNotFound(_0x25a03e,null))[_0x1f79('0x25')](function(_0x10744a){if(_0x10744a){_0x304fcc=_0x10744a;return db[_0x1f79('0x84')][_0x1f79('0x57')]({'where':{'id':_0x10744a['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x25a03e,null))[_0x1f79('0x25')](function(_0x394d8f){if(_0x394d8f){logger[_0x1f79('0x29')](_0x1f79('0x85'),_0x1f79('0x30'),_0x1f79('0x86'),_0x394d8f[_0x1f79('0x40')],util[_0x1f79('0x87')](_0x5523c2[_0x1f79('0x5a')],{'showHidden':![],'depth':null}));switch(_0x394d8f['type']){case _0x1f79('0x88'):if(_0x5523c2[_0x1f79('0x5a')][_0x1f79('0x89')]&&_0x5523c2[_0x1f79('0x5a')][_0x1f79('0x89')]===_0x304fcc[_0x1f79('0x8a')]&&_0x5523c2[_0x1f79('0x5a')][_0x1f79('0x8b')]&&_0x5523c2['body'][_0x1f79('0x8b')]==='read'){return _0x304fcc[_0x1f79('0x38')]({'read':!![]});}else{logger[_0x1f79('0x2b')](_0x1f79('0x8c'),_0x1f79('0x30'),_0x1f79('0x88'),util[_0x1f79('0x87')](_0x5523c2[_0x1f79('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x304fcc;}})[_0x1f79('0x25')](respondWithResult(_0x25a03e,null))[_0x1f79('0x58')](handleError(_0x25a03e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index a81d392..7ff921b 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 _0x8cc8=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x40542f,_0x9c86f7){var _0x3b961f=function(_0x25c185){while(--_0x25c185){_0x40542f['push'](_0x40542f['shift']());}};_0x3b961f(++_0x9c86f7);}(_0x8cc8,0x177));var _0x88cc=function(_0x2943a0,_0xe0339d){_0x2943a0=_0x2943a0-0x0;var _0x5cdaf2=_0x8cc8[_0x2943a0];return _0x5cdaf2;};'use strict';var EventEmitter=require(_0x88cc('0x0'));var WhatsappMessage=require(_0x88cc('0x1'))['db'][_0x88cc('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x88cc('0x3')](0x0);var events={'afterCreate':_0x88cc('0x4'),'afterUpdate':_0x88cc('0x5'),'afterDestroy':_0x88cc('0x6')};function emitEvent(_0x41ec3a){return function(_0x407cb0,_0xce4dc7,_0x1c943a){WhatsappMessageEvents[_0x88cc('0x7')](_0x41ec3a+':'+_0x407cb0['id'],_0x407cb0);WhatsappMessageEvents[_0x88cc('0x7')](_0x41ec3a,_0x407cb0);_0x1c943a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x88cc('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xa5fa=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage'];(function(_0x4af8d5,_0x5416ed){var _0x33a1db=function(_0x341b41){while(--_0x341b41){_0x4af8d5['push'](_0x4af8d5['shift']());}};_0x33a1db(++_0x5416ed);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x5a5dc6,_0x1ad6dd){_0x5a5dc6=_0x5a5dc6-0x0;var _0x4c47b9=_0xa5fa[_0x5a5dc6];return _0x4c47b9;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xaa5f('0x0'))['db'][_0xaa5f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xaa5f('0x2')](0x0);var events={'afterCreate':_0xaa5f('0x3'),'afterUpdate':'update','afterDestroy':_0xaa5f('0x4')};function emitEvent(_0x106128){return function(_0x4d1c8b,_0x233cd6,_0x42450a){WhatsappMessageEvents[_0xaa5f('0x5')](_0x106128+':'+_0x4d1c8b['id'],_0x4d1c8b);WhatsappMessageEvents[_0xaa5f('0x5')](_0x106128,_0x4d1c8b);_0x42450a(null);};}for(var e in events){if(events[_0xaa5f('0x6')](e)){var event=events[e];WhatsappMessage[_0xaa5f('0x7')](e,emitEvent(event));}}module[_0xaa5f('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 1150078..ac3398d 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 _0xede3=['WhatsappMessage,\x20%s','finally','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','err'];(function(_0x1232a4,_0x33d271){var _0x2bd915=function(_0x326bbc){while(--_0x326bbc){_0x1232a4['push'](_0x1232a4['shift']());}};_0x2bd915(++_0x33d271);}(_0xede3,0xf3));var _0x3ede=function(_0x55289d,_0x256e0f){_0x55289d=_0x55289d-0x0;var _0x235191=_0xede3[_0x55289d];return _0x235191;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3ede('0x0'))(_0x3ede('0x1'));var moment=require(_0x3ede('0x2'));var BPromise=require(_0x3ede('0x3'));var rp=require(_0x3ede('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x3ede('0x5'));var rimraf=require(_0x3ede('0x6'));var config=require(_0x3ede('0x7'));var attributes=require(_0x3ede('0x8'));module['exports']=function(_0x2dcd30,_0x58e26d){return _0x2dcd30[_0x3ede('0x9')](_0x3ede('0xa'),attributes,{'tableName':_0x3ede('0xb'),'paranoid':![],'indexes':[{'name':_0x3ede('0xc'),'fields':[_0x3ede('0xc')]},{'name':_0x3ede('0xd'),'fields':[_0x3ede('0xe')],'type':_0x3ede('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56a3f0,_0x44b729,_0x50a6a4){var _0xff1f89=_0x2dcd30[_0x3ede('0x10')];var _0x57d9d5=_0x56a3f0['get']({'plain':!![]});if(_0x57d9d5[_0x3ede('0x11')][_0x3ede('0x12')]()==='in'||_0x57d9d5[_0x3ede('0x11')][_0x3ede('0x12')]()===_0x3ede('0x13')&&!_0x57d9d5[_0x3ede('0x14')]&&!_['isNil'](_0x57d9d5[_0x3ede('0x15')])){_0xff1f89[_0x3ede('0x16')][_0x3ede('0x17')]({'where':{'id':_0x57d9d5[_0x3ede('0x18')]}})[_0x3ede('0x19')](function(_0x3f4494){if(_0x3f4494){_0x3f4494['update']({'lastMsgAt':_0x57d9d5['createdAt'],'lastMsgDirection':_0x57d9d5[_0x3ede('0x11')][_0x3ede('0x12')]()});}})[_0x3ede('0x1a')](function(_0x3ec44e){console[_0x3ede('0x1b')](_0x3ec44e);});}if(_0x57d9d5[_0x3ede('0x11')]===_0x3ede('0x13')&&!_0x57d9d5[_0x3ede('0x14')]){var _0xdad1eb;_0xff1f89[_0x3ede('0x1c')][_0x3ede('0x1d')]({'where':{'id':_0x57d9d5[_0x3ede('0x1e')]},'raw':!![]})[_0x3ede('0x19')](function(_0x52e057){_0xdad1eb=_0x52e057;if(_0xdad1eb&&_0xdad1eb['type']){switch(_0xdad1eb[_0x3ede('0x1f')]){case _0x3ede('0x20'):var _0x5b1555=require(_0x3ede('0x20'));if(_0xdad1eb[_0x3ede('0x21')]&&_0xdad1eb[_0x3ede('0x22')]&&_0xdad1eb[_0x3ede('0x23')]){var _0x17b299=new _0x5b1555(_0xdad1eb[_0x3ede('0x21')],_0xdad1eb[_0x3ede('0x22')]);_0x17b299[_0x3ede('0x24')][_0x3ede('0x25')]({'body':_0x57d9d5[_0x3ede('0xe')],'to':_0x3ede('0x26')+_0x57d9d5[_0x3ede('0x23')],'from':'whatsapp:'+_0xdad1eb[_0x3ede('0x23')],'statusCallback':_0xdad1eb[_0x3ede('0x27')]+_0x3ede('0x28')+_0x57d9d5['id']+_0x3ede('0x29')+_0xdad1eb[_0x3ede('0x2a')]})['then'](function(_0x510beb){if(_0x510beb[_0x3ede('0x2b')]){return _0x56a3f0[_0x3ede('0x2c')]({'messageId':_0x510beb[_0x3ede('0x2b')]});}})[_0x3ede('0x1a')](function(_0x2db192){logger[_0x3ede('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3ede('0x2d'),'twilio',util[_0x3ede('0x2e')](_0x2db192,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ede('0x2f'),_0x3ede('0x2d'),_0x3ede('0x20'),_0x3ede('0x30'));}break;case'sinch':var _0x1549ec=_0xdad1eb[_0x3ede('0x21')];var _0x3b945b=_0xdad1eb[_0x3ede('0x22')];var _0x194f47=_0xdad1eb['baseUrl']+_0x3ede('0x31')+_0x1549ec+'/messages/';var _0x304146={'to':[_0x57d9d5['phone']],'message':{'type':_0x3ede('0x32'),'text':_0x57d9d5[_0x3ede('0xe')]}};var _0x28c1a7={'method':_0x3ede('0x33'),'uri':_0x194f47,'headers':{'Authorization':_0x3ede('0x34')+_0x3b945b,'Content-Type':_0x3ede('0x35')},'body':_0x304146,'json':!![]};rp(_0x28c1a7)[_0x3ede('0x19')](function(_0xece258){if(_0xece258[_0x3ede('0x36')][0x0][_0x3ede('0x37')]){return _0x56a3f0[_0x3ede('0x2c')]({'messageId':_0xece258['statuses'][0x0][_0x3ede('0x37')]});}})[_0x3ede('0x1a')](function(_0x4e2bfd){logger[_0x3ede('0x38')](_0x3ede('0x39'),_0x4e2bfd);});break;}}})[_0x3ede('0x3a')](function(){_0x50a6a4();});}else{_0x50a6a4();}}},'charset':_0x3ede('0x3b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe5a2=['request-promise','node-fetch','rimraf','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','findOne','WhatsappInteractionId','then','update','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','token','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','body','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x5c0032,_0x5e118a){var _0x285939=function(_0x555465){while(--_0x555465){_0x5c0032['push'](_0x5c0032['shift']());}};_0x285939(++_0x5e118a);}(_0xe5a2,0xdb));var _0x2e5a=function(_0x4bdf1d,_0x2bbc17){_0x4bdf1d=_0x4bdf1d-0x0;var _0x2000d1=_0xe5a2[_0x4bdf1d];return _0x2000d1;};'use strict';var _=require('lodash');var util=require(_0x2e5a('0x0'));var logger=require(_0x2e5a('0x1'))(_0x2e5a('0x2'));var moment=require(_0x2e5a('0x3'));var BPromise=require(_0x2e5a('0x4'));var rp=require(_0x2e5a('0x5'));var fetch=require(_0x2e5a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e5a('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x2e5a('0x8')]=function(_0x29b7ba,_0x20c3b9){return _0x29b7ba[_0x2e5a('0x9')](_0x2e5a('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x2e5a('0xb'),'fields':[_0x2e5a('0xb')]},{'name':_0x2e5a('0xc'),'fields':['body'],'type':_0x2e5a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d57d3,_0x309573,_0x35857b){var _0x5bbada=_0x29b7ba[_0x2e5a('0xe')];var _0x543cfd=_0x4d57d3[_0x2e5a('0xf')]({'plain':!![]});if(_0x543cfd[_0x2e5a('0x10')][_0x2e5a('0x11')]()==='in'||_0x543cfd[_0x2e5a('0x10')][_0x2e5a('0x11')]()===_0x2e5a('0x12')&&!_0x543cfd[_0x2e5a('0x13')]&&!_['isNil'](_0x543cfd[_0x2e5a('0x14')])){_0x5bbada['WhatsappInteraction'][_0x2e5a('0x15')]({'where':{'id':_0x543cfd[_0x2e5a('0x16')]}})[_0x2e5a('0x17')](function(_0x4eed35){if(_0x4eed35){_0x4eed35[_0x2e5a('0x18')]({'lastMsgAt':_0x543cfd['createdAt'],'lastMsgDirection':_0x543cfd[_0x2e5a('0x10')][_0x2e5a('0x11')]()});}})[_0x2e5a('0x19')](function(_0x552e9c){console[_0x2e5a('0x1a')](_0x552e9c);});}if(_0x543cfd['direction']==='out'&&!_0x543cfd['secret']){var _0x2cfdfe;_0x5bbada[_0x2e5a('0x1b')]['find']({'where':{'id':_0x543cfd[_0x2e5a('0x1c')]},'raw':!![]})[_0x2e5a('0x17')](function(_0x5f2f35){_0x2cfdfe=_0x5f2f35;if(_0x2cfdfe&&_0x2cfdfe['type']){switch(_0x2cfdfe[_0x2e5a('0x1d')]){case'twilio':var _0x4fb45c=require(_0x2e5a('0x1e'));if(_0x2cfdfe[_0x2e5a('0x1f')]&&_0x2cfdfe[_0x2e5a('0x20')]&&_0x2cfdfe[_0x2e5a('0x21')]){var _0x5003c3=new _0x4fb45c(_0x2cfdfe[_0x2e5a('0x1f')],_0x2cfdfe[_0x2e5a('0x20')]);_0x5003c3['messages'][_0x2e5a('0x22')]({'body':_0x543cfd['body'],'to':_0x2e5a('0x23')+_0x543cfd['phone'],'from':_0x2e5a('0x23')+_0x2cfdfe['phone'],'statusCallback':_0x2cfdfe[_0x2e5a('0x24')]+_0x2e5a('0x25')+_0x543cfd['id']+'/status?token='+_0x2cfdfe[_0x2e5a('0x26')]})['then'](function(_0x511de0){if(_0x511de0['sid']){return _0x4d57d3[_0x2e5a('0x18')]({'messageId':_0x511de0['sid']});}})[_0x2e5a('0x19')](function(_0x400956){logger[_0x2e5a('0x1a')](_0x2e5a('0x27'),_0x2e5a('0x28'),'twilio',util['inspect'](_0x400956,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2e5a('0x27'),_0x2e5a('0x28'),_0x2e5a('0x1e'),_0x2e5a('0x29'));}break;case _0x2e5a('0x2a'):var _0x42e406=_0x2cfdfe[_0x2e5a('0x1f')];var _0x302188=_0x2cfdfe[_0x2e5a('0x20')];var _0x4d95a1=_0x2cfdfe[_0x2e5a('0x2b')]+_0x2e5a('0x2c')+_0x42e406+_0x2e5a('0x2d');var _0x95fce={'to':[_0x543cfd[_0x2e5a('0x21')]],'message':{'type':'text','text':_0x543cfd[_0x2e5a('0x2e')]}};var _0x3c2955={'method':_0x2e5a('0x2f'),'uri':_0x4d95a1,'headers':{'Authorization':_0x2e5a('0x30')+_0x302188,'Content-Type':'application/json'},'body':_0x95fce,'json':!![]};rp(_0x3c2955)[_0x2e5a('0x17')](function(_0x3a7385){if(_0x3a7385[_0x2e5a('0x31')][0x0][_0x2e5a('0x32')]){return _0x4d57d3[_0x2e5a('0x18')]({'messageId':_0x3a7385[_0x2e5a('0x31')][0x0][_0x2e5a('0x32')]});}})[_0x2e5a('0x19')](function(_0x4c05fc){logger[_0x2e5a('0x33')](_0x2e5a('0x34'),_0x4c05fc);});break;}}})[_0x2e5a('0x35')](function(){_0x35857b();});}else{_0x35857b();}}},'charset':_0x2e5a('0x36'),'collate':_0x2e5a('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index fd1b36e..c6ef3f1 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 _0x4518=['register','then','debug','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x35622c,_0x529771){var _0x52b4a9=function(_0x515e33){while(--_0x515e33){_0x35622c['push'](_0x35622c['shift']());}};_0x52b4a9(++_0x529771);}(_0x4518,0x139));var _0x8451=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x4518[_0x30abff];return _0x4c571e;};'use strict';var _=require(_0x8451('0x0'));var util=require(_0x8451('0x1'));var moment=require(_0x8451('0x2'));var BPromise=require(_0x8451('0x3'));var rs=require(_0x8451('0x4'));var fs=require('fs');var Redis=require(_0x8451('0x5'));var db=require(_0x8451('0x6'))['db'];var utils=require(_0x8451('0x7'));var logger=require(_0x8451('0x8'))(_0x8451('0x9'));var config=require(_0x8451('0xa'));var jayson=require(_0x8451('0xb'));var client=jayson[_0x8451('0xc')][_0x8451('0xd')]({'port':0x232a});config[_0x8451('0xe')]=_['defaults'](config[_0x8451('0xe')],{'host':_0x8451('0xf'),'port':0x18eb});var socket=require(_0x8451('0x10'))(new Redis(config[_0x8451('0xe')]));require('./whatsappMessage.socket')[_0x8451('0x11')](socket);function respondWithRpcPromise(_0x1a323f,_0x505b22,_0x2b536e){return new BPromise(function(_0xde56fc,_0x184bcb){return client['request'](_0x1a323f,_0x2b536e)[_0x8451('0x12')](function(_0x2f18be){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x505b22,'request\x20sent');logger[_0x8451('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x505b22,_0x8451('0x14'),JSON[_0x8451('0x15')](_0x2f18be));if(_0x2f18be[_0x8451('0x16')]){if(_0x2f18be[_0x8451('0x16')][_0x8451('0x17')]===0x1f4){logger['error'](_0x8451('0x18'),_0x505b22,_0x2f18be[_0x8451('0x16')][_0x8451('0x19')]);return _0x184bcb(_0x2f18be[_0x8451('0x16')][_0x8451('0x19')]);}logger[_0x8451('0x16')](_0x8451('0x18'),_0x505b22,_0x2f18be['error']['message']);return _0xde56fc(_0x2f18be[_0x8451('0x16')][_0x8451('0x19')]);}else{logger[_0x8451('0x1a')](_0x8451('0x18'),_0x505b22,_0x8451('0x14'));_0xde56fc(_0x2f18be[_0x8451('0x1b')]['message']);}})[_0x8451('0x1c')](function(_0x2411f9){logger[_0x8451('0x16')](_0x8451('0x18'),_0x505b22,_0x2411f9);_0x184bcb(_0x2411f9);});});}exports[_0x8451('0x1d')]=function(_0x4da621){var _0x4b5c43=this;return new Promise(function(_0x267b86,_0x450e33){return db[_0x8451('0x1e')]['create'](_0x4da621[_0x8451('0x1f')],{'raw':_0x4da621[_0x8451('0x20')]?_0x4da621[_0x8451('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x8451('0x12')](function(_0x3396c5){logger['info'](_0x8451('0x1d'),_0x4da621);logger[_0x8451('0x13')](_0x8451('0x1d'),_0x4da621,JSON[_0x8451('0x15')](_0x3396c5));_0x267b86(_0x3396c5);})[_0x8451('0x1c')](function(_0x50eccc){logger[_0x8451('0x16')]('CreateWhatsappMessage',_0x50eccc['message'],_0x4da621);_0x450e33(_0x4b5c43['error'](0x1f4,_0x50eccc['message']));});});}; \ No newline at end of file +var _0x50b5=['message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x3d403c,_0x2eb5a1){var _0x5d0bbd=function(_0x43b3ff){while(--_0x43b3ff){_0x3d403c['push'](_0x3d403c['shift']());}};_0x5d0bbd(++_0x2eb5a1);}(_0x50b5,0x15d));var _0x550b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x50b5[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require(_0x550b('0x0'));var moment=require(_0x550b('0x1'));var BPromise=require(_0x550b('0x2'));var rs=require(_0x550b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x550b('0x4'))['db'];var utils=require(_0x550b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x550b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x550b('0x7')]['http']({'port':0x232a});config[_0x550b('0x8')]=_[_0x550b('0x9')](config['redis'],{'host':_0x550b('0xa'),'port':0x18eb});var socket=require(_0x550b('0xb'))(new Redis(config[_0x550b('0x8')]));require(_0x550b('0xc'))['register'](socket);function respondWithRpcPromise(_0x4c1a73,_0x188e4f,_0x36e04f){return new BPromise(function(_0x3d67ee,_0x335ab3){return client[_0x550b('0xd')](_0x4c1a73,_0x36e04f)[_0x550b('0xe')](function(_0x254ef5){logger[_0x550b('0xf')](_0x550b('0x10'),_0x188e4f,_0x550b('0x11'));logger[_0x550b('0x12')](_0x550b('0x13'),_0x188e4f,_0x550b('0x11'),JSON[_0x550b('0x14')](_0x254ef5));if(_0x254ef5['error']){if(_0x254ef5['error'][_0x550b('0x15')]===0x1f4){logger[_0x550b('0x16')](_0x550b('0x10'),_0x188e4f,_0x254ef5['error'][_0x550b('0x17')]);return _0x335ab3(_0x254ef5[_0x550b('0x16')][_0x550b('0x17')]);}logger['error'](_0x550b('0x10'),_0x188e4f,_0x254ef5[_0x550b('0x16')]['message']);return _0x3d67ee(_0x254ef5[_0x550b('0x16')]['message']);}else{logger[_0x550b('0xf')](_0x550b('0x10'),_0x188e4f,'request\x20sent');_0x3d67ee(_0x254ef5[_0x550b('0x18')][_0x550b('0x17')]);}})['catch'](function(_0x2d1693){logger[_0x550b('0x16')](_0x550b('0x10'),_0x188e4f,_0x2d1693);_0x335ab3(_0x2d1693);});});}exports[_0x550b('0x19')]=function(_0x951789){var _0x3b2910=this;return new Promise(function(_0x30cfba,_0x43820c){return db[_0x550b('0x1a')][_0x550b('0x1b')](_0x951789['body'],{'raw':_0x951789[_0x550b('0x1c')]?_0x951789[_0x550b('0x1c')][_0x550b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1de750){logger[_0x550b('0xf')](_0x550b('0x19'),_0x951789);logger[_0x550b('0x12')](_0x550b('0x19'),_0x951789,JSON[_0x550b('0x14')](_0x1de750));_0x30cfba(_0x1de750);})[_0x550b('0x1e')](function(_0xe31590){logger[_0x550b('0x16')]('CreateWhatsappMessage',_0xe31590[_0x550b('0x17')],_0x951789);_0x43820c(_0x3b2910['error'](0x1f4,_0xe31590[_0x550b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ed5f968..476ea6b 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 _0x6738=['register','length','save','remove','removeListener'];(function(_0x478240,_0x1d8d22){var _0x33ab8f=function(_0x1aefd2){while(--_0x1aefd2){_0x478240['push'](_0x478240['shift']());}};_0x33ab8f(++_0x1d8d22);}(_0x6738,0x1c4));var _0x8673=function(_0x314fa9,_0x14d5df){_0x314fa9=_0x314fa9-0x0;var _0x38d6c=_0x6738[_0x314fa9];return _0x38d6c;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x8673('0x0'),_0x8673('0x1'),'update'];function createListener(_0x2c0e18,_0x1ba2b1){return function(_0x2a1727){_0x1ba2b1['emit'](_0x2c0e18,_0x2a1727);};}function removeListener(_0x5b91fe,_0x93af9e){return function(){WhatsappMessageEvents[_0x8673('0x2')](_0x5b91fe,_0x93af9e);};}exports[_0x8673('0x3')]=function(_0x2850af){for(var _0x3f2776=0x0,_0xc7a5ad=events[_0x8673('0x4')];_0x3f2776<_0xc7a5ad;_0x3f2776++){var _0x2603fe=events[_0x3f2776];var _0x4758f6=createListener('whatsappMessage:'+_0x2603fe,_0x2850af);WhatsappMessageEvents['on'](_0x2603fe,_0x4758f6);}}; \ No newline at end of file +var _0x64a9=['whatsappMessage:','remove','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64a9,0xd8));var _0x964a=function(_0x4fd08b,_0x88236e){_0x4fd08b=_0x4fd08b-0x0;var _0x38ce4d=_0x64a9[_0x4fd08b];return _0x38ce4d;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x964a('0x0'),_0x964a('0x1')];function createListener(_0x1cdba7,_0x18273b){return function(_0x2945bb){_0x18273b['emit'](_0x1cdba7,_0x2945bb);};}function removeListener(_0x28bf0c,_0x198c79){return function(){WhatsappMessageEvents[_0x964a('0x2')](_0x28bf0c,_0x198c79);};}exports[_0x964a('0x3')]=function(_0x16c177){for(var _0x35c2c5=0x0,_0x3964d3=events['length'];_0x35c2c5<_0x3964d3;_0x35c2c5++){var _0x240aa5=events[_0x35c2c5];var _0x17e24f=createListener(_0x964a('0x4')+_0x240aa5,_0x16c177);WhatsappMessageEvents['on'](_0x240aa5,_0x17e24f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5459cf3..6412fe4 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 _0xb9e6=['addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','/:id/users'];(function(_0x5db7e8,_0x1c0262){var _0x27027e=function(_0x3c709b){while(--_0x3c709b){_0x5db7e8['push'](_0x5db7e8['shift']());}};_0x27027e(++_0x1c0262);}(_0xb9e6,0x99));var _0x6b9e=function(_0x1b8af8,_0xfa3c54){_0x1b8af8=_0x1b8af8-0x0;var _0x712fca=_0xb9e6[_0x1b8af8];return _0x712fca;};'use strict';var multer=require(_0x6b9e('0x0'));var util=require(_0x6b9e('0x1'));var path=require(_0x6b9e('0x2'));var timeout=require(_0x6b9e('0x3'));var express=require('express');var router=express[_0x6b9e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6b9e('0x5'));var controller=require(_0x6b9e('0x6'));router[_0x6b9e('0x7')]('/',auth[_0x6b9e('0x8')](),controller[_0x6b9e('0x9')]);router[_0x6b9e('0x7')](_0x6b9e('0xa'),auth[_0x6b9e('0x8')](),controller[_0x6b9e('0xb')]);router['get']('/:id',auth[_0x6b9e('0x8')](),controller[_0x6b9e('0xc')]);router[_0x6b9e('0x7')](_0x6b9e('0xd'),auth[_0x6b9e('0x8')](),controller[_0x6b9e('0xe')]);router[_0x6b9e('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6b9e('0xf')]);router[_0x6b9e('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x6b9e('0x10')]);router[_0x6b9e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x6b9e('0x12'),auth[_0x6b9e('0x8')](),controller[_0x6b9e('0x13')]);router[_0x6b9e('0x11')](_0x6b9e('0x14'),auth['isAuthenticated'](),controller[_0x6b9e('0x15')]);router['put'](_0x6b9e('0x16'),auth['isAuthenticated'](),controller[_0x6b9e('0x17')]);router[_0x6b9e('0x18')](_0x6b9e('0x16'),auth[_0x6b9e('0x8')](),controller[_0x6b9e('0x19')]);router[_0x6b9e('0x18')](_0x6b9e('0x12'),auth[_0x6b9e('0x8')](),controller[_0x6b9e('0x1a')]);router[_0x6b9e('0x18')]('/:id/users',auth[_0x6b9e('0x8')](),controller[_0x6b9e('0x1b')]);module[_0x6b9e('0x1c')]=router; \ No newline at end of file +var _0xb672=['put','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents'];(function(_0x56ad45,_0x4452ea){var _0xcc0bc5=function(_0x5ea88d){while(--_0x5ea88d){_0x56ad45['push'](_0x56ad45['shift']());}};_0xcc0bc5(++_0x4452ea);}(_0xb672,0xf6));var _0x2b67=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb672[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x2b67('0x0'));var path=require(_0x2b67('0x1'));var timeout=require(_0x2b67('0x2'));var express=require(_0x2b67('0x3'));var router=express[_0x2b67('0x4')]();var fs_extra=require(_0x2b67('0x5'));var auth=require(_0x2b67('0x6'));var interaction=require(_0x2b67('0x7'));var config=require(_0x2b67('0x8'));var controller=require('./whatsappQueue.controller');router[_0x2b67('0x9')]('/',auth[_0x2b67('0xa')](),controller[_0x2b67('0xb')]);router[_0x2b67('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2b67('0xc')]);router[_0x2b67('0x9')](_0x2b67('0xd'),auth[_0x2b67('0xa')](),controller[_0x2b67('0xe')]);router[_0x2b67('0x9')](_0x2b67('0xf'),auth[_0x2b67('0xa')](),controller[_0x2b67('0x10')]);router['get'](_0x2b67('0x11'),auth[_0x2b67('0xa')](),controller[_0x2b67('0x12')]);router['get'](_0x2b67('0x13'),auth['isAuthenticated'](),controller[_0x2b67('0x14')]);router[_0x2b67('0x15')]('/',auth[_0x2b67('0xa')](),controller[_0x2b67('0x16')]);router[_0x2b67('0x15')]('/:id/teams',auth[_0x2b67('0xa')](),controller['addTeams']);router[_0x2b67('0x15')](_0x2b67('0x13'),auth[_0x2b67('0xa')](),controller[_0x2b67('0x17')]);router[_0x2b67('0x18')](_0x2b67('0xd'),auth[_0x2b67('0xa')](),controller[_0x2b67('0x19')]);router[_0x2b67('0x1a')](_0x2b67('0xd'),auth['isAuthenticated'](),controller[_0x2b67('0x1b')]);router['delete'](_0x2b67('0x11'),auth[_0x2b67('0xa')](),controller[_0x2b67('0x1c')]);router[_0x2b67('0x1a')](_0x2b67('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2b67('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index fe108ff..005732a 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 _0xfa7c=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x6f6fa5,_0x423171){var _0x1cc13e=function(_0x4fc3e6){while(--_0x4fc3e6){_0x6f6fa5['push'](_0x6f6fa5['shift']());}};_0x1cc13e(++_0x423171);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x56f43c,_0x532d1c){_0x56f43c=_0x56f43c-0x0;var _0x15bca1=_0xfa7c[_0x56f43c];return _0x15bca1;};'use strict';var Sequelize=require(_0xcfa7('0x0'));module['exports']={'name':{'type':Sequelize[_0xcfa7('0x1')],'unique':_0xcfa7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcfa7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcfa7('0x4')](_0xcfa7('0x5'),_0xcfa7('0x6'),_0xcfa7('0x7'))},'description':{'type':Sequelize[_0xcfa7('0x1')]}}; \ No newline at end of file +var _0x851a=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x851a,0x19b));var _0xa851=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x851a[_0x344a3f];return _0x264712;};'use strict';var Sequelize=require(_0xa851('0x0'));module['exports']={'name':{'type':Sequelize[_0xa851('0x1')],'unique':_0xa851('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa851('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa851('0x4')](_0xa851('0x5'),_0xa851('0x6'),_0xa851('0x7'))},'description':{'type':Sequelize[_0xa851('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 313596e..335495b 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 _0x9230=['userWhatsappQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','sendStatus','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','name','status','send','index','WhatsappQueue','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','type','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','length','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents'];(function(_0x492e33,_0x111910){var _0x51be0d=function(_0x4a2ac8){while(--_0x4a2ac8){_0x492e33['push'](_0x492e33['shift']());}};_0x51be0d(++_0x111910);}(_0x9230,0x19c));var _0x0923=function(_0x3ca99e,_0x2f0241){_0x3ca99e=_0x3ca99e-0x0;var _0x2921b9=_0x9230[_0x3ca99e];return _0x2921b9;};'use strict';var emlformat=require(_0x0923('0x0'));var rimraf=require(_0x0923('0x1'));var zipdir=require(_0x0923('0x2'));var jsonpatch=require(_0x0923('0x3'));var rp=require(_0x0923('0x4'));var moment=require(_0x0923('0x5'));var BPromise=require(_0x0923('0x6'));var Mustache=require(_0x0923('0x7'));var util=require(_0x0923('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0923('0x9'));var ejs=require(_0x0923('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0923('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0923('0xc'));var toCsv=require(_0x0923('0x9'));var querystring=require(_0x0923('0xd'));var Papa=require(_0x0923('0xe'));var Redis=require(_0x0923('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0923('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0923('0x11'));var logger=require(_0x0923('0x12'))(_0x0923('0x13'));var utils=require('../../config/utils');var config=require(_0x0923('0x14'));var licenseUtil=require(_0x0923('0x15'));var db=require(_0x0923('0x16'))['db'];config['redis']=_[_0x0923('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0923('0x18'))(new Redis(config[_0x0923('0x19')]));require('./whatsappQueue.socket')[_0x0923('0x1a')](socket);function respondWithStatusCode(_0x2327ba,_0x67c8d4){_0x67c8d4=_0x67c8d4||0xcc;return function(_0x2f12f1){if(_0x2f12f1){return _0x2327ba[_0x0923('0x1b')](_0x67c8d4);}return _0x2327ba['status'](_0x67c8d4)['end']();};}function respondWithResult(_0x51b578,_0x20325f){_0x20325f=_0x20325f||0xc8;return function(_0x25fd03){if(_0x25fd03){return _0x51b578['status'](_0x20325f)[_0x0923('0x1c')](_0x25fd03);}};}function respondWithFilteredResult(_0x3c1dec,_0x245e5f){return function(_0x5eee01){if(_0x5eee01){var _0x4abe50=typeof _0x245e5f[_0x0923('0x1d')]===_0x0923('0x1e')&&typeof _0x245e5f[_0x0923('0x1f')]===_0x0923('0x1e');var _0x5bcf16=_0x5eee01[_0x0923('0x20')];var _0x325715=_0x4abe50?0x0:_0x245e5f[_0x0923('0x1d')];var _0x5baba8=_0x4abe50?_0x5eee01[_0x0923('0x20')]:_0x245e5f['offset']+_0x245e5f[_0x0923('0x1f')];var _0x4f65ce;if(_0x5baba8>=_0x5bcf16){_0x5baba8=_0x5bcf16;_0x4f65ce=0xc8;}else{_0x4f65ce=0xce;}_0x3c1dec['status'](_0x4f65ce);return _0x3c1dec[_0x0923('0x21')](_0x0923('0x22'),_0x325715+'-'+_0x5baba8+'/'+_0x5bcf16)[_0x0923('0x1c')](_0x5eee01);}return null;};}function patchUpdates(_0x239b80){return function(_0x1b9461){try{jsonpatch['apply'](_0x1b9461,_0x239b80,!![]);}catch(_0x507674){return BPromise['reject'](_0x507674);}return _0x1b9461[_0x0923('0x23')]();};}function saveUpdates(_0x3ca664,_0x4cb0fa){return function(_0x42b1a7){if(_0x42b1a7){return _0x42b1a7[_0x0923('0x24')](_0x3ca664)[_0x0923('0x25')](function(_0x12e8aa){return _0x12e8aa;});}return null;};}function removeEntity(_0x14814d,_0x35c929){return function(_0xa581b9){if(_0xa581b9){return _0xa581b9[_0x0923('0x26')]()[_0x0923('0x25')](function(){var _0x3a6768=_0xa581b9[_0x0923('0x27')]({'plain':!![]});var _0x335611=_0x0923('0x28');return db[_0x0923('0x29')][_0x0923('0x26')]({'where':{'type':_0x335611,'resourceId':_0x3a6768['id']}})['then'](function(){return _0xa581b9;});})[_0x0923('0x25')](function(){_0x14814d['status'](0xcc)[_0x0923('0x2a')]();});}};}function handleEntityNotFound(_0x556d47,_0x4ad89e){return function(_0x3c2e96){if(!_0x3c2e96){_0x556d47[_0x0923('0x1b')](0x194);}return _0x3c2e96;};}function handleError(_0x2a547b,_0xbb7865){_0xbb7865=_0xbb7865||0x1f4;return function(_0x26a665){logger[_0x0923('0x2b')](_0x26a665['stack']);if(_0x26a665[_0x0923('0x2c')]){delete _0x26a665['name'];}_0x2a547b[_0x0923('0x2d')](_0xbb7865)[_0x0923('0x2e')](_0x26a665);};}exports[_0x0923('0x2f')]=function(_0x13079e,_0x53f2f3){var _0x78fa35={},_0x293e83={},_0xc5fa5b={'count':0x0,'rows':[]};var _0xdc3c08=_['map'](db[_0x0923('0x30')][_0x0923('0x31')],function(_0x2b5c5b){return{'name':_0x2b5c5b['fieldName'],'type':_0x2b5c5b['type']['key']};});_0x293e83[_0x0923('0x32')]=_['map'](_0xdc3c08,_0x0923('0x2c'));_0x293e83[_0x0923('0x33')]=_[_0x0923('0x34')](_0x13079e[_0x0923('0x33')]);_0x293e83['filters']=_[_0x0923('0x35')](_0x293e83[_0x0923('0x32')],_0x293e83[_0x0923('0x33')]);_0x78fa35[_0x0923('0x36')]=_[_0x0923('0x35')](_0x293e83[_0x0923('0x32')],qs[_0x0923('0x37')](_0x13079e[_0x0923('0x33')]['fields']));_0x78fa35['attributes']=_0x78fa35[_0x0923('0x36')]['length']?_0x78fa35['attributes']:_0x293e83['model'];if(!_0x13079e[_0x0923('0x33')][_0x0923('0x38')](_0x0923('0x39'))){_0x78fa35[_0x0923('0x1f')]=qs[_0x0923('0x1f')](_0x13079e[_0x0923('0x33')][_0x0923('0x1f')]);_0x78fa35[_0x0923('0x1d')]=qs['offset'](_0x13079e[_0x0923('0x33')][_0x0923('0x1d')]);}_0x78fa35[_0x0923('0x3a')]=qs['sort'](_0x13079e[_0x0923('0x33')][_0x0923('0x3b')]);_0x78fa35[_0x0923('0x3c')]=qs[_0x0923('0x3d')](_['pick'](_0x13079e[_0x0923('0x33')],_0x293e83[_0x0923('0x3d')]),_0xdc3c08);if(_0x13079e[_0x0923('0x33')][_0x0923('0x3e')]){_0x78fa35[_0x0923('0x3c')]=_['merge'](_0x78fa35[_0x0923('0x3c')],{'$or':_[_0x0923('0x3f')](_0xdc3c08,function(_0x101f26){if(_0x101f26[_0x0923('0x40')]!=='VIRTUAL'){var _0x501d39={};_0x501d39[_0x101f26[_0x0923('0x2c')]]={'$like':'%'+_0x13079e[_0x0923('0x33')][_0x0923('0x3e')]+'%'};return _0x501d39;}})});}_0x78fa35=_[_0x0923('0x41')]({},_0x78fa35,_0x13079e[_0x0923('0x42')]);var _0x2b65c7={'where':_0x78fa35[_0x0923('0x3c')]};return db[_0x0923('0x30')][_0x0923('0x20')](_0x2b65c7)[_0x0923('0x25')](function(_0x56a11f){_0xc5fa5b[_0x0923('0x20')]=_0x56a11f;if(_0x13079e[_0x0923('0x33')][_0x0923('0x43')]){_0x78fa35[_0x0923('0x44')]=[{'all':!![]}];}return db[_0x0923('0x30')][_0x0923('0x45')](_0x78fa35);})[_0x0923('0x25')](function(_0x46f068){_0xc5fa5b[_0x0923('0x46')]=_0x46f068;return _0xc5fa5b;})['then'](respondWithFilteredResult(_0x53f2f3,_0x78fa35))[_0x0923('0x47')](handleError(_0x53f2f3,null));};exports[_0x0923('0x48')]=function(_0x3f6426,_0x2713d3){var _0x266b97={'raw':!![],'where':{'id':_0x3f6426[_0x0923('0x49')]['id']}},_0x5a63d5={};_0x5a63d5[_0x0923('0x32')]=_[_0x0923('0x34')](db[_0x0923('0x30')][_0x0923('0x31')]);_0x5a63d5[_0x0923('0x33')]=_['keys'](_0x3f6426[_0x0923('0x33')]);_0x5a63d5['filters']=_['intersection'](_0x5a63d5[_0x0923('0x32')],_0x5a63d5[_0x0923('0x33')]);_0x266b97['attributes']=_[_0x0923('0x35')](_0x5a63d5[_0x0923('0x32')],qs[_0x0923('0x37')](_0x3f6426[_0x0923('0x33')][_0x0923('0x37')]));_0x266b97[_0x0923('0x36')]=_0x266b97['attributes']['length']?_0x266b97[_0x0923('0x36')]:_0x5a63d5['model'];if(_0x3f6426[_0x0923('0x33')][_0x0923('0x43')]){_0x266b97[_0x0923('0x44')]=[{'all':!![]}];}_0x266b97=_[_0x0923('0x41')]({},_0x266b97,_0x3f6426[_0x0923('0x42')]);return db['WhatsappQueue'][_0x0923('0x4a')](_0x266b97)['then'](handleEntityNotFound(_0x2713d3,null))[_0x0923('0x25')](respondWithResult(_0x2713d3,null))['catch'](handleError(_0x2713d3,null));};exports['create']=function(_0x1fa54e,_0x471e2a){return db[_0x0923('0x30')]['create'](_0x1fa54e[_0x0923('0x4b')],{})[_0x0923('0x25')](function(_0x302b7e){var _0x24bbb0=_0x1fa54e[_0x0923('0x4c')][_0x0923('0x27')]({'plain':!![]});if(!_0x24bbb0)throw new Error(_0x0923('0x4d'));if(_0x24bbb0['role']==='user'){var _0x5d3320=_0x302b7e[_0x0923('0x27')]({'plain':!![]});var _0x13edd4=_0x0923('0x28');return db['UserProfileSection'][_0x0923('0x4a')]({'where':{'name':_0x13edd4,'userProfileId':_0x24bbb0['userProfileId']},'raw':!![]})[_0x0923('0x25')](function(_0x4dcf8b){if(_0x4dcf8b&&_0x4dcf8b[_0x0923('0x4e')]===0x0){return db[_0x0923('0x29')][_0x0923('0x4f')]({'name':_0x5d3320['name'],'resourceId':_0x5d3320['id'],'type':_0x4dcf8b[_0x0923('0x2c')],'sectionId':_0x4dcf8b['id']},{})[_0x0923('0x25')](function(){return _0x302b7e;});}else{return _0x302b7e;}})[_0x0923('0x47')](function(_0x572997){logger[_0x0923('0x2b')](_0x0923('0x50'),_0x572997);throw _0x572997;});}return _0x302b7e;})['then'](respondWithResult(_0x471e2a,0xc9))[_0x0923('0x47')](handleError(_0x471e2a,null));};exports[_0x0923('0x24')]=function(_0x391e57,_0x59ee78){if(_0x391e57[_0x0923('0x4b')]['id']){delete _0x391e57[_0x0923('0x4b')]['id'];}return db[_0x0923('0x30')][_0x0923('0x4a')]({'where':{'id':_0x391e57['params']['id']}})[_0x0923('0x25')](handleEntityNotFound(_0x59ee78,null))[_0x0923('0x25')](saveUpdates(_0x391e57['body'],null))[_0x0923('0x25')](respondWithResult(_0x59ee78,null))[_0x0923('0x47')](handleError(_0x59ee78,null));};exports['destroy']=function(_0x5910bf,_0xf4ebe3){return db[_0x0923('0x30')][_0x0923('0x4a')]({'where':{'id':_0x5910bf[_0x0923('0x49')]['id']}})[_0x0923('0x25')](handleEntityNotFound(_0xf4ebe3,null))[_0x0923('0x25')](removeEntity(_0xf4ebe3,null))[_0x0923('0x47')](handleError(_0xf4ebe3,null));};exports[_0x0923('0x51')]=function(_0xd23f,_0x7d215b){return db[_0x0923('0x30')]['describe']()['then'](respondWithResult(_0x7d215b,null))[_0x0923('0x47')](handleError(_0x7d215b,null));};exports[_0x0923('0x52')]=function(_0x7aff28,_0x562e13,_0x151001){var _0x247f57={'raw':!![],'where':{}},_0x57818d={},_0x24204e;return db[_0x0923('0x30')][_0x0923('0x53')]({'where':{'id':_0x7aff28[_0x0923('0x49')]['id']}})[_0x0923('0x25')](handleEntityNotFound(_0x562e13,null))[_0x0923('0x25')](function(_0xeec976){if(_0xeec976){_0x24204e=_0xeec976['get']({'plain':!![]});_0x57818d[_0x0923('0x32')]=_['keys'](db[_0x0923('0x54')]['rawAttributes']);_0x57818d[_0x0923('0x33')]=_[_0x0923('0x34')](_0x7aff28['query']);_0x57818d[_0x0923('0x3d')]=_[_0x0923('0x35')](_0x57818d[_0x0923('0x32')],_0x57818d['query']);_0x247f57[_0x0923('0x36')]=_[_0x0923('0x35')](_0x57818d[_0x0923('0x32')],qs[_0x0923('0x37')](_0x7aff28['query'][_0x0923('0x37')]));_0x247f57[_0x0923('0x36')]=_0x247f57[_0x0923('0x36')][_0x0923('0x55')]?_0x247f57[_0x0923('0x36')]:_0x57818d[_0x0923('0x32')];if(!_0x7aff28[_0x0923('0x33')][_0x0923('0x38')]('nolimit')){_0x247f57['limit']=qs['limit'](_0x7aff28[_0x0923('0x33')][_0x0923('0x1f')]);_0x247f57[_0x0923('0x1d')]=qs[_0x0923('0x1d')](_0x7aff28[_0x0923('0x33')][_0x0923('0x1d')]);}_0x247f57[_0x0923('0x3a')]=qs[_0x0923('0x3b')](_0x7aff28[_0x0923('0x33')][_0x0923('0x3b')]);_0x247f57['where']=qs['filters'](_[_0x0923('0x56')](_0x7aff28[_0x0923('0x33')],_0x57818d[_0x0923('0x3d')]));_0x247f57[_0x0923('0x3c')][_0x0923('0x57')]=_0xeec976['id'];if(_0x7aff28[_0x0923('0x33')][_0x0923('0x3e')]){_0x247f57['where']=_[_0x0923('0x41')](_0x247f57['where'],{'$or':_['map'](_0x247f57['attributes'],function(_0x3b5f5b){var _0x312ddd={};_0x312ddd[_0x3b5f5b]={'$like':'%'+_0x7aff28[_0x0923('0x33')][_0x0923('0x3e')]+'%'};return _0x312ddd;})});}_0x247f57=_[_0x0923('0x41')]({},_0x247f57,_0x7aff28[_0x0923('0x42')]);return db[_0x0923('0x54')]['findAll'](_0x247f57);}})[_0x0923('0x25')](function(_0x4fe179){if(_0x4fe179){return db[_0x0923('0x58')][_0x0923('0x59')]({'where':{'id':_[_0x0923('0x3f')](_0x4fe179,_0x0923('0x5a')),'role':_0x0923('0x5b')},'attributes':['id',_0x0923('0x2c'),_0x0923('0x5c'),_0x0923('0x5d'),_0x0923('0x5e')]});}})[_0x0923('0x25')](function(_0x38b712){if(_0x38b712){return{'count':_0x38b712[_0x0923('0x20')],'rows':_[_0x0923('0x3f')](_0x38b712['rows'],function(_0xf95a89){return{'membername':_0xf95a89[_0x0923('0x2c')],'UserId':_0xf95a89['id'],'queue_name':_0x24204e[_0x0923('0x2c')],'WhatsappQueueId':_0x24204e['id'],'interface':util[_0x0923('0x5f')](_0x0923('0x60'),_0x0923('0x61'),_0xf95a89[_0x0923('0x2c')]),'penalty':0x0,'paused':_0xf95a89[_0x0923('0x5c')],'createdAt':_0xf95a89[_0x0923('0x5e')],'updatedAt':_0xf95a89[_0x0923('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0923('0x25')](respondWithFilteredResult(_0x562e13,_0x247f57))['catch'](handleError(_0x562e13,null));};exports[_0x0923('0x62')]=function(_0x41ad90,_0x1b096f,_0x403dd7){var _0x1958a2={};var _0x24ef8e={};var _0x32caac;var _0xf3bae8;return db['WhatsappQueue'][_0x0923('0x53')]({'where':{'id':_0x41ad90[_0x0923('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b096f,null))[_0x0923('0x25')](function(_0x5366d3){if(_0x5366d3){_0x32caac=_0x5366d3;_0x24ef8e[_0x0923('0x32')]=_[_0x0923('0x34')](db['Team'][_0x0923('0x31')]);_0x24ef8e[_0x0923('0x33')]=_['keys'](_0x41ad90['query']);_0x24ef8e['filters']=_[_0x0923('0x35')](_0x24ef8e['model'],_0x24ef8e[_0x0923('0x33')]);_0x1958a2[_0x0923('0x36')]=_[_0x0923('0x35')](_0x24ef8e['model'],qs['fields'](_0x41ad90['query']['fields']));_0x1958a2[_0x0923('0x36')]=_0x1958a2['attributes']['length']?_0x1958a2['attributes']:_0x24ef8e[_0x0923('0x32')];_0x1958a2['order']=qs['sort'](_0x41ad90[_0x0923('0x33')][_0x0923('0x3b')]);_0x1958a2[_0x0923('0x3c')]=qs['filters'](_[_0x0923('0x56')](_0x41ad90[_0x0923('0x33')],_0x24ef8e['filters']));if(_0x41ad90[_0x0923('0x33')][_0x0923('0x3e')]){_0x1958a2[_0x0923('0x3c')]=_[_0x0923('0x41')](_0x1958a2[_0x0923('0x3c')],{'$or':_['map'](_0x1958a2[_0x0923('0x36')],function(_0x561825){var _0xf12205={};_0xf12205[_0x561825]={'$like':'%'+_0x41ad90[_0x0923('0x33')][_0x0923('0x3e')]+'%'};return _0xf12205;})});}_0x1958a2=_[_0x0923('0x41')]({},_0x1958a2,_0x41ad90[_0x0923('0x42')]);return _0x32caac[_0x0923('0x62')](_0x1958a2);}})[_0x0923('0x25')](function(_0x2a03e0){if(_0x2a03e0){_0xf3bae8=_0x2a03e0[_0x0923('0x55')];if(!_0x41ad90[_0x0923('0x33')]['hasOwnProperty'](_0x0923('0x39'))){_0x1958a2[_0x0923('0x1f')]=qs[_0x0923('0x1f')](_0x41ad90[_0x0923('0x33')][_0x0923('0x1f')]);_0x1958a2['offset']=qs[_0x0923('0x1d')](_0x41ad90['query']['offset']);}return _0x32caac[_0x0923('0x62')](_0x1958a2);}})[_0x0923('0x25')](function(_0x552596){if(_0x552596){return _0x552596?{'count':_0xf3bae8,'rows':_0x552596}:null;}})['then'](respondWithResult(_0x1b096f,null))[_0x0923('0x47')](handleError(_0x1b096f,null));};exports[_0x0923('0x63')]=function(_0xf989d0,_0xbf63a0,_0x43e0b8){var _0x4820e6=_0xf989d0[_0x0923('0x4b')][_0x0923('0x64')];return db[_0x0923('0x65')][_0x0923('0x45')]({'where':{'id':_0x4820e6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0923('0x66'),'attributes':['id','name',_0x0923('0x67'),_0x0923('0x68'),'interface'],'raw':!![]}]})[_0x0923('0x25')](function(_0x111df7){if(_0x111df7){var _0x4fc191=_[_0x0923('0x69')](_0x111df7,function(_0x58be43){var _0x20871e=_0x58be43[_0x0923('0x27')]({'plain':!![]});return _0x20871e['Agents'];});return db[_0x0923('0x30')][_0x0923('0x4a')]({'where':{'id':_0xf989d0[_0x0923('0x49')]['id']}})[_0x0923('0x25')](function(_0x14e873){return db[_0x0923('0x6a')][_0x0923('0x6b')](function(_0x9ad41a){return _0x14e873['addTeams'](_0x4820e6,{'transaction':_0x9ad41a})[_0x0923('0x25')](function(){return BPromise[_0x0923('0x6c')](_0x4fc191,function(_0x54ad06){return db[_0x0923('0x54')]['findOrCreate']({'where':{'UserId':_0x54ad06['id'],'WhatsappQueueId':_0xf989d0[_0x0923('0x49')]['id']},'transaction':_0x9ad41a});});})[_0x0923('0x25')](function(){_0x4fc191[_0x0923('0x6d')](function(_0x22562b){socket[_0x0923('0x6e')](_0x0923('0x6f'),{'UserId':_0x22562b['id'],'WhatsappQueueId':_0x14e873['id']});});});});});}})[_0x0923('0x25')](respondWithStatusCode(_0xbf63a0,null))['catch'](handleError(_0xbf63a0,null));};exports[_0x0923('0x70')]=function(_0x36a123,_0x576bb0,_0x2fa66f){return db[_0x0923('0x65')][_0x0923('0x45')]({'where':{'id':_0x36a123[_0x0923('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0923('0x58')],'as':_0x0923('0x66'),'attributes':['id'],'raw':!![]}]})[_0x0923('0x25')](handleEntityNotFound(_0x576bb0,null))[_0x0923('0x25')](function(_0x2d5386){var _0x50e1cd=_[_0x0923('0x3f')](_0x2d5386,'id');var _0x3ec205=[];var _0x524fb2=[];var _0x588a91=squel['select']();_0x588a91[_0x0923('0x71')](_0x0923('0x72'))['from'](_0x0923('0x73'),'tq')[_0x0923('0x74')](_0x0923('0x75'),'ut',_0x0923('0x76'))[_0x0923('0x3c')]('WhatsappQueueId\x20=\x20?',_0x36a123['params']['id']);for(var _0x2c41f8=0x0;_0x2c41f8<_0x2d5386[_0x0923('0x55')];_0x2c41f8+=0x1){let _0x643c70=_0x2d5386[_0x2c41f8];for(var _0x31a9f2=0x0;_0x31a9f2<_0x643c70[_0x0923('0x66')]['length'];_0x31a9f2+=0x1){let _0x4b7851=_0x643c70[_0x0923('0x66')][_0x31a9f2];var _0x14e2c6=_0x588a91['clone']();_0x14e2c6[_0x0923('0x3c')](_0x0923('0x77'),_0x4b7851['id']);_0x524fb2[_0x0923('0x78')](db[_0x0923('0x6a')]['query'](_0x14e2c6[_0x0923('0x79')](),{'type':db['sequelize'][_0x0923('0x7a')][_0x0923('0x7b')]})[_0x0923('0x25')](function(_0x12083d){if(_0x12083d['length']===0x1){return _0x4b7851['id'];}else{var _0xb73c49=_[_0x0923('0x7c')](_[_0x0923('0x3f')](_0x12083d,_0x0923('0x7d')),function(_0x5e4a53){return _[_0x0923('0x7e')](_0x50e1cd,_0x5e4a53);});if(_0xb73c49){return _0x4b7851['id'];}}}));}}return BPromise[_0x0923('0x7f')](_0x524fb2)[_0x0923('0x25')](function(_0x26e40d){_0x3ec205=_(_0x3ec205)[_0x0923('0x80')](_0x26e40d)[_0x0923('0x81')]()[_0x0923('0x82')]();return db['WhatsappQueue'][_0x0923('0x4a')]({'where':{'id':_0x36a123[_0x0923('0x49')]['id']}})[_0x0923('0x25')](function(_0x18c887){return db[_0x0923('0x6a')][_0x0923('0x6b')](function(_0x2ddacf){return _0x18c887[_0x0923('0x70')](_0x36a123[_0x0923('0x33')]['ids'],{'transaction':_0x2ddacf})[_0x0923('0x25')](function(){if(!_['isEmpty'](_0x3ec205)){return _0x18c887[_0x0923('0x83')](_0x3ec205,{'transaction':_0x2ddacf});}})[_0x0923('0x25')](function(){_0x3ec205['forEach'](function(_0x430690){socket[_0x0923('0x6e')](_0x0923('0x84'),{'UserId':_0x430690,'WhatsappQueueId':_0x18c887['id']});});});});});});})['then'](respondWithStatusCode(_0x576bb0,null))[_0x0923('0x47')](handleError(_0x576bb0,null));};exports[_0x0923('0x85')]=function(_0x257a97,_0x1255c0,_0x34c954){return db['WhatsappQueue']['find']({'where':{'id':_0x257a97[_0x0923('0x49')]['id']}})[_0x0923('0x25')](handleEntityNotFound(_0x1255c0,null))[_0x0923('0x25')](function(_0x165ae9){if(_0x165ae9){return _0x165ae9[_0x0923('0x85')](_0x257a97[_0x0923('0x4b')][_0x0923('0x64')],_['omit'](_0x257a97[_0x0923('0x4b')],[_0x0923('0x64'),'id'])||{})['spread'](function(_0x47d1ee){for(var _0x3c8d62=0x0;_0x3c8d62<_0x257a97['body'][_0x0923('0x64')]['length'];_0x3c8d62+=0x1){socket[_0x0923('0x6e')](_0x0923('0x6f'),{'UserId':Number(_0x257a97[_0x0923('0x4b')][_0x0923('0x64')][_0x3c8d62]),'WhatsappQueueId':Number(_0x257a97['params']['id'])});}return _0x47d1ee;});}})[_0x0923('0x25')](respondWithResult(_0x1255c0,null))[_0x0923('0x47')](handleError(_0x1255c0,null));};exports[_0x0923('0x83')]=function(_0x5dffd5,_0x3d7422,_0x56a408){return db[_0x0923('0x30')][_0x0923('0x4a')]({'where':{'id':_0x5dffd5[_0x0923('0x49')]['id']}})[_0x0923('0x25')](handleEntityNotFound(_0x3d7422,null))[_0x0923('0x25')](function(_0x50a99d){if(_0x50a99d){return _0x50a99d[_0x0923('0x83')](_0x5dffd5[_0x0923('0x33')]['ids'])['then'](function(){if(_[_0x0923('0x86')](_0x5dffd5[_0x0923('0x33')][_0x0923('0x64')])){for(var _0x53781e=0x0;_0x53781e<_0x5dffd5[_0x0923('0x33')][_0x0923('0x64')]['length'];_0x53781e+=0x1){socket['emit'](_0x0923('0x84'),{'UserId':Number(_0x5dffd5[_0x0923('0x33')][_0x0923('0x64')][_0x53781e]),'WhatsappQueueId':Number(_0x5dffd5[_0x0923('0x49')]['id'])});}}else{socket[_0x0923('0x6e')](_0x0923('0x84'),{'UserId':Number(_0x5dffd5[_0x0923('0x33')][_0x0923('0x64')]),'WhatsappQueueId':Number(_0x5dffd5['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3d7422,null))[_0x0923('0x47')](handleError(_0x3d7422,null));};exports[_0x0923('0x87')]=function(_0x494bce,_0x3bd32e,_0x1b56f4){var _0x518434={};var _0x4c4d1f={};var _0x249b47;var _0x3e0e24;return db['WhatsappQueue'][_0x0923('0x53')]({'where':{'id':_0x494bce[_0x0923('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bd32e,null))[_0x0923('0x25')](function(_0xcd8c68){if(_0xcd8c68){_0x249b47=_0xcd8c68;_0x4c4d1f[_0x0923('0x32')]=_[_0x0923('0x34')](db[_0x0923('0x58')]['rawAttributes']);_0x4c4d1f[_0x0923('0x33')]=_[_0x0923('0x34')](_0x494bce[_0x0923('0x33')]);_0x4c4d1f[_0x0923('0x3d')]=_[_0x0923('0x35')](_0x4c4d1f[_0x0923('0x32')],_0x4c4d1f[_0x0923('0x33')]);_0x518434[_0x0923('0x36')]=_[_0x0923('0x35')](_0x4c4d1f['model'],qs[_0x0923('0x37')](_0x494bce[_0x0923('0x33')][_0x0923('0x37')]));_0x518434[_0x0923('0x36')]=_0x518434['attributes'][_0x0923('0x55')]?_0x518434['attributes']:_0x4c4d1f[_0x0923('0x32')];_0x518434[_0x0923('0x3a')]=qs['sort'](_0x494bce[_0x0923('0x33')][_0x0923('0x3b')]);_0x518434['where']=qs['filters'](_[_0x0923('0x56')](_0x494bce['query'],_0x4c4d1f[_0x0923('0x3d')]));if(_0x494bce[_0x0923('0x33')][_0x0923('0x3e')]){_0x518434[_0x0923('0x3c')]=_[_0x0923('0x41')](_0x518434[_0x0923('0x3c')],{'$or':_[_0x0923('0x3f')](_0x518434[_0x0923('0x36')],function(_0x1e6fc8){var _0x1ff1ae={};_0x1ff1ae[_0x1e6fc8]={'$like':'%'+_0x494bce['query'][_0x0923('0x3e')]+'%'};return _0x1ff1ae;})});}_0x518434=_['merge']({},_0x518434,_0x494bce['options']);return _0x249b47[_0x0923('0x87')](_0x518434);}})[_0x0923('0x25')](function(_0x1fea13){if(_0x1fea13){_0x3e0e24=_0x1fea13[_0x0923('0x55')];if(!_0x494bce['query']['hasOwnProperty'](_0x0923('0x39'))){_0x518434[_0x0923('0x1f')]=qs[_0x0923('0x1f')](_0x494bce[_0x0923('0x33')][_0x0923('0x1f')]);_0x518434['offset']=qs[_0x0923('0x1d')](_0x494bce[_0x0923('0x33')]['offset']);}return _0x249b47['getAgents'](_0x518434);}})[_0x0923('0x25')](function(_0xe3fd14){if(_0xe3fd14){return _0xe3fd14?{'count':_0x3e0e24,'rows':_0xe3fd14}:null;}})[_0x0923('0x25')](respondWithResult(_0x3bd32e,null))['catch'](handleError(_0x3bd32e,null));}; \ No newline at end of file +var _0xd665=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','WhatsappQueues','UserProfileResource','error','stack','name','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserWhatsappQueue','length','order','WhatsappQueueId','User','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','removeTeams','select','tq.TeamId','from','user_has_teams','WhatsappQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','findOne','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x36ac10,_0x10d60e){var _0xc3166b=function(_0xb9047e){while(--_0xb9047e){_0x36ac10['push'](_0x36ac10['shift']());}};_0xc3166b(++_0x10d60e);}(_0xd665,0x105));var _0x5d66=function(_0x3e3403,_0x4e126d){_0x3e3403=_0x3e3403-0x0;var _0x4059ee=_0xd665[_0x3e3403];return _0x4059ee;};'use strict';var emlformat=require(_0x5d66('0x0'));var rimraf=require(_0x5d66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d66('0x2'));var rp=require(_0x5d66('0x3'));var moment=require(_0x5d66('0x4'));var BPromise=require(_0x5d66('0x5'));var Mustache=require(_0x5d66('0x6'));var util=require(_0x5d66('0x7'));var path=require(_0x5d66('0x8'));var sox=require(_0x5d66('0x9'));var csv=require('to-csv');var ejs=require(_0x5d66('0xa'));var fs=require('fs');var fs_extra=require(_0x5d66('0xb'));var _=require(_0x5d66('0xc'));var squel=require(_0x5d66('0xd'));var crypto=require(_0x5d66('0xe'));var jsforce=require(_0x5d66('0xf'));var deskjs=require(_0x5d66('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5d66('0x11'));var Papa=require(_0x5d66('0x12'));var Redis=require(_0x5d66('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5d66('0x14'));var as=require(_0x5d66('0x15'));var hardwareService=require(_0x5d66('0x16'));var logger=require(_0x5d66('0x17'))(_0x5d66('0x18'));var utils=require('../../config/utils');var config=require(_0x5d66('0x19'));var licenseUtil=require(_0x5d66('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5d66('0x1b')]=_[_0x5d66('0x1c')](config[_0x5d66('0x1b')],{'host':_0x5d66('0x1d'),'port':0x18eb});var socket=require(_0x5d66('0x1e'))(new Redis(config[_0x5d66('0x1b')]));require(_0x5d66('0x1f'))[_0x5d66('0x20')](socket);function respondWithStatusCode(_0x4cc54f,_0x40c202){_0x40c202=_0x40c202||0xcc;return function(_0x47a5e8){if(_0x47a5e8){return _0x4cc54f[_0x5d66('0x21')](_0x40c202);}return _0x4cc54f['status'](_0x40c202)[_0x5d66('0x22')]();};}function respondWithResult(_0x20665b,_0xb3964){_0xb3964=_0xb3964||0xc8;return function(_0x3fd8b1){if(_0x3fd8b1){return _0x20665b[_0x5d66('0x23')](_0xb3964)[_0x5d66('0x24')](_0x3fd8b1);}};}function respondWithFilteredResult(_0x42b42f,_0x32d182){return function(_0x59cb73){if(_0x59cb73){var _0x177b59=typeof _0x32d182[_0x5d66('0x25')]===_0x5d66('0x26')&&typeof _0x32d182['limit']===_0x5d66('0x26');var _0xe94fa4=_0x59cb73[_0x5d66('0x27')];var _0x4fce6e=_0x177b59?0x0:_0x32d182['offset'];var _0x103f8c=_0x177b59?_0x59cb73[_0x5d66('0x27')]:_0x32d182[_0x5d66('0x25')]+_0x32d182[_0x5d66('0x28')];var _0x43380b;if(_0x103f8c>=_0xe94fa4){_0x103f8c=_0xe94fa4;_0x43380b=0xc8;}else{_0x43380b=0xce;}_0x42b42f['status'](_0x43380b);return _0x42b42f[_0x5d66('0x29')](_0x5d66('0x2a'),_0x4fce6e+'-'+_0x103f8c+'/'+_0xe94fa4)[_0x5d66('0x24')](_0x59cb73);}return null;};}function patchUpdates(_0x38b554){return function(_0xa449a2){try{jsonpatch[_0x5d66('0x2b')](_0xa449a2,_0x38b554,!![]);}catch(_0x2cf129){return BPromise[_0x5d66('0x2c')](_0x2cf129);}return _0xa449a2[_0x5d66('0x2d')]();};}function saveUpdates(_0x42d55e,_0x4d2128){return function(_0x31107d){if(_0x31107d){return _0x31107d['update'](_0x42d55e)['then'](function(_0x18a5d3){return _0x18a5d3;});}return null;};}function removeEntity(_0x2e5755,_0x3f8c68){return function(_0x2a897c){if(_0x2a897c){return _0x2a897c[_0x5d66('0x2e')]()[_0x5d66('0x2f')](function(){var _0x2423d7=_0x2a897c[_0x5d66('0x30')]({'plain':!![]});var _0x4d42a9=_0x5d66('0x31');return db[_0x5d66('0x32')][_0x5d66('0x2e')]({'where':{'type':_0x4d42a9,'resourceId':_0x2423d7['id']}})[_0x5d66('0x2f')](function(){return _0x2a897c;});})['then'](function(){_0x2e5755[_0x5d66('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b46fb,_0x5cf981){return function(_0x2596e5){if(!_0x2596e5){_0x2b46fb['sendStatus'](0x194);}return _0x2596e5;};}function handleError(_0x38d855,_0x51be6f){_0x51be6f=_0x51be6f||0x1f4;return function(_0x27dc22){logger[_0x5d66('0x33')](_0x27dc22[_0x5d66('0x34')]);if(_0x27dc22[_0x5d66('0x35')]){delete _0x27dc22[_0x5d66('0x35')];}_0x38d855[_0x5d66('0x23')](_0x51be6f)['send'](_0x27dc22);};}exports['index']=function(_0x5599dd,_0x5ae38d){var _0x184e86={},_0x3ee053={},_0x5467d8={'count':0x0,'rows':[]};var _0x250b78=_[_0x5d66('0x36')](db[_0x5d66('0x37')][_0x5d66('0x38')],function(_0x3687c4){return{'name':_0x3687c4[_0x5d66('0x39')],'type':_0x3687c4['type'][_0x5d66('0x3a')]};});_0x3ee053[_0x5d66('0x3b')]=_[_0x5d66('0x36')](_0x250b78,_0x5d66('0x35'));_0x3ee053[_0x5d66('0x3c')]=_[_0x5d66('0x3d')](_0x5599dd[_0x5d66('0x3c')]);_0x3ee053[_0x5d66('0x3e')]=_['intersection'](_0x3ee053[_0x5d66('0x3b')],_0x3ee053[_0x5d66('0x3c')]);_0x184e86[_0x5d66('0x3f')]=_[_0x5d66('0x40')](_0x3ee053[_0x5d66('0x3b')],qs[_0x5d66('0x41')](_0x5599dd[_0x5d66('0x3c')][_0x5d66('0x41')]));_0x184e86[_0x5d66('0x3f')]=_0x184e86[_0x5d66('0x3f')]['length']?_0x184e86[_0x5d66('0x3f')]:_0x3ee053['model'];if(!_0x5599dd[_0x5d66('0x3c')][_0x5d66('0x42')](_0x5d66('0x43'))){_0x184e86[_0x5d66('0x28')]=qs[_0x5d66('0x28')](_0x5599dd['query'][_0x5d66('0x28')]);_0x184e86[_0x5d66('0x25')]=qs[_0x5d66('0x25')](_0x5599dd[_0x5d66('0x3c')][_0x5d66('0x25')]);}_0x184e86['order']=qs[_0x5d66('0x44')](_0x5599dd['query'][_0x5d66('0x44')]);_0x184e86['where']=qs[_0x5d66('0x3e')](_[_0x5d66('0x45')](_0x5599dd[_0x5d66('0x3c')],_0x3ee053[_0x5d66('0x3e')]),_0x250b78);if(_0x5599dd[_0x5d66('0x3c')][_0x5d66('0x46')]){_0x184e86[_0x5d66('0x47')]=_['merge'](_0x184e86[_0x5d66('0x47')],{'$or':_[_0x5d66('0x36')](_0x250b78,function(_0x16beb5){if(_0x16beb5[_0x5d66('0x48')]!==_0x5d66('0x49')){var _0x10e467={};_0x10e467[_0x16beb5['name']]={'$like':'%'+_0x5599dd['query'][_0x5d66('0x46')]+'%'};return _0x10e467;}})});}_0x184e86=_[_0x5d66('0x4a')]({},_0x184e86,_0x5599dd[_0x5d66('0x4b')]);var _0x5800ef={'where':_0x184e86[_0x5d66('0x47')]};return db[_0x5d66('0x37')][_0x5d66('0x27')](_0x5800ef)['then'](function(_0xc9a651){_0x5467d8[_0x5d66('0x27')]=_0xc9a651;if(_0x5599dd['query'][_0x5d66('0x4c')]){_0x184e86[_0x5d66('0x4d')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x5d66('0x4e')](_0x184e86);})[_0x5d66('0x2f')](function(_0x5ed13b){_0x5467d8[_0x5d66('0x4f')]=_0x5ed13b;return _0x5467d8;})['then'](respondWithFilteredResult(_0x5ae38d,_0x184e86))[_0x5d66('0x50')](handleError(_0x5ae38d,null));};exports['show']=function(_0x458d6a,_0x34a5a9){var _0x4c508d={'raw':!![],'where':{'id':_0x458d6a[_0x5d66('0x51')]['id']}},_0x37cbf6={};_0x37cbf6[_0x5d66('0x3b')]=_['keys'](db[_0x5d66('0x37')][_0x5d66('0x38')]);_0x37cbf6[_0x5d66('0x3c')]=_[_0x5d66('0x3d')](_0x458d6a[_0x5d66('0x3c')]);_0x37cbf6[_0x5d66('0x3e')]=_[_0x5d66('0x40')](_0x37cbf6[_0x5d66('0x3b')],_0x37cbf6[_0x5d66('0x3c')]);_0x4c508d[_0x5d66('0x3f')]=_['intersection'](_0x37cbf6['model'],qs[_0x5d66('0x41')](_0x458d6a['query'][_0x5d66('0x41')]));_0x4c508d[_0x5d66('0x3f')]=_0x4c508d['attributes']['length']?_0x4c508d['attributes']:_0x37cbf6[_0x5d66('0x3b')];if(_0x458d6a[_0x5d66('0x3c')]['includeAll']){_0x4c508d[_0x5d66('0x4d')]=[{'all':!![]}];}_0x4c508d=_['merge']({},_0x4c508d,_0x458d6a[_0x5d66('0x4b')]);return db['WhatsappQueue'][_0x5d66('0x52')](_0x4c508d)['then'](handleEntityNotFound(_0x34a5a9,null))['then'](respondWithResult(_0x34a5a9,null))['catch'](handleError(_0x34a5a9,null));};exports[_0x5d66('0x53')]=function(_0x16e5c6,_0x941133){return db['WhatsappQueue'][_0x5d66('0x53')](_0x16e5c6[_0x5d66('0x54')],{})['then'](function(_0x508aa1){var _0x2361f4=_0x16e5c6[_0x5d66('0x55')][_0x5d66('0x30')]({'plain':!![]});if(!_0x2361f4)throw new Error(_0x5d66('0x56'));if(_0x2361f4[_0x5d66('0x57')]==='user'){var _0x425c6c=_0x508aa1[_0x5d66('0x30')]({'plain':!![]});var _0x13498b=_0x5d66('0x31');return db['UserProfileSection'][_0x5d66('0x52')]({'where':{'name':_0x13498b,'userProfileId':_0x2361f4[_0x5d66('0x58')]},'raw':!![]})['then'](function(_0x4a341f){if(_0x4a341f&&_0x4a341f['autoAssociation']===0x0){return db[_0x5d66('0x32')]['create']({'name':_0x425c6c['name'],'resourceId':_0x425c6c['id'],'type':_0x4a341f[_0x5d66('0x35')],'sectionId':_0x4a341f['id']},{})[_0x5d66('0x2f')](function(){return _0x508aa1;});}else{return _0x508aa1;}})['catch'](function(_0x5bae99){logger[_0x5d66('0x33')](_0x5d66('0x59'),_0x5bae99);throw _0x5bae99;});}return _0x508aa1;})['then'](respondWithResult(_0x941133,0xc9))[_0x5d66('0x50')](handleError(_0x941133,null));};exports[_0x5d66('0x5a')]=function(_0x1fb189,_0x4d86cc){if(_0x1fb189['body']['id']){delete _0x1fb189[_0x5d66('0x54')]['id'];}return db[_0x5d66('0x37')][_0x5d66('0x52')]({'where':{'id':_0x1fb189['params']['id']}})[_0x5d66('0x2f')](handleEntityNotFound(_0x4d86cc,null))['then'](saveUpdates(_0x1fb189['body'],null))[_0x5d66('0x2f')](respondWithResult(_0x4d86cc,null))['catch'](handleError(_0x4d86cc,null));};exports[_0x5d66('0x2e')]=function(_0x3ff725,_0x1e60cf){return db[_0x5d66('0x37')][_0x5d66('0x52')]({'where':{'id':_0x3ff725[_0x5d66('0x51')]['id']}})[_0x5d66('0x2f')](handleEntityNotFound(_0x1e60cf,null))['then'](removeEntity(_0x1e60cf,null))[_0x5d66('0x50')](handleError(_0x1e60cf,null));};exports[_0x5d66('0x5b')]=function(_0x1c6c93,_0x3a800a){return db[_0x5d66('0x37')]['describe']()[_0x5d66('0x2f')](respondWithResult(_0x3a800a,null))['catch'](handleError(_0x3a800a,null));};exports[_0x5d66('0x5c')]=function(_0x34045b,_0x3e89f7,_0x12a3af){var _0x1f21fb={'raw':!![],'where':{}},_0x3bd1c5={},_0xb4650a;return db['WhatsappQueue']['findOne']({'where':{'id':_0x34045b['params']['id']}})[_0x5d66('0x2f')](handleEntityNotFound(_0x3e89f7,null))[_0x5d66('0x2f')](function(_0x4e9c2b){if(_0x4e9c2b){_0xb4650a=_0x4e9c2b[_0x5d66('0x30')]({'plain':!![]});_0x3bd1c5['model']=_[_0x5d66('0x3d')](db[_0x5d66('0x5d')]['rawAttributes']);_0x3bd1c5[_0x5d66('0x3c')]=_['keys'](_0x34045b[_0x5d66('0x3c')]);_0x3bd1c5[_0x5d66('0x3e')]=_[_0x5d66('0x40')](_0x3bd1c5[_0x5d66('0x3b')],_0x3bd1c5['query']);_0x1f21fb[_0x5d66('0x3f')]=_[_0x5d66('0x40')](_0x3bd1c5['model'],qs[_0x5d66('0x41')](_0x34045b[_0x5d66('0x3c')][_0x5d66('0x41')]));_0x1f21fb['attributes']=_0x1f21fb[_0x5d66('0x3f')][_0x5d66('0x5e')]?_0x1f21fb[_0x5d66('0x3f')]:_0x3bd1c5['model'];if(!_0x34045b['query']['hasOwnProperty']('nolimit')){_0x1f21fb['limit']=qs[_0x5d66('0x28')](_0x34045b[_0x5d66('0x3c')][_0x5d66('0x28')]);_0x1f21fb[_0x5d66('0x25')]=qs[_0x5d66('0x25')](_0x34045b['query'][_0x5d66('0x25')]);}_0x1f21fb[_0x5d66('0x5f')]=qs[_0x5d66('0x44')](_0x34045b['query'][_0x5d66('0x44')]);_0x1f21fb[_0x5d66('0x47')]=qs[_0x5d66('0x3e')](_[_0x5d66('0x45')](_0x34045b[_0x5d66('0x3c')],_0x3bd1c5['filters']));_0x1f21fb[_0x5d66('0x47')][_0x5d66('0x60')]=_0x4e9c2b['id'];if(_0x34045b[_0x5d66('0x3c')]['filter']){_0x1f21fb[_0x5d66('0x47')]=_[_0x5d66('0x4a')](_0x1f21fb[_0x5d66('0x47')],{'$or':_[_0x5d66('0x36')](_0x1f21fb[_0x5d66('0x3f')],function(_0x87411b){var _0x28de30={};_0x28de30[_0x87411b]={'$like':'%'+_0x34045b[_0x5d66('0x3c')][_0x5d66('0x46')]+'%'};return _0x28de30;})});}_0x1f21fb=_['merge']({},_0x1f21fb,_0x34045b['options']);return db[_0x5d66('0x5d')][_0x5d66('0x4e')](_0x1f21fb);}})[_0x5d66('0x2f')](function(_0x5ba93b){if(_0x5ba93b){return db[_0x5d66('0x61')]['findAndCountAll']({'where':{'id':_[_0x5d66('0x36')](_0x5ba93b,_0x5d66('0x62')),'role':_0x5d66('0x63')},'attributes':['id',_0x5d66('0x35'),_0x5d66('0x64'),_0x5d66('0x65'),_0x5d66('0x66')]});}})[_0x5d66('0x2f')](function(_0x10c301){if(_0x10c301){return{'count':_0x10c301['count'],'rows':_[_0x5d66('0x36')](_0x10c301[_0x5d66('0x4f')],function(_0x47bb39){return{'membername':_0x47bb39[_0x5d66('0x35')],'UserId':_0x47bb39['id'],'queue_name':_0xb4650a['name'],'WhatsappQueueId':_0xb4650a['id'],'interface':util['format'](_0x5d66('0x67'),'SIP',_0x47bb39[_0x5d66('0x35')]),'penalty':0x0,'paused':_0x47bb39['whatsappPause'],'createdAt':_0x47bb39[_0x5d66('0x66')],'updatedAt':_0x47bb39['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3e89f7,_0x1f21fb))[_0x5d66('0x50')](handleError(_0x3e89f7,null));};exports[_0x5d66('0x68')]=function(_0x3d26a8,_0x2add2d,_0x1f0ffd){var _0x57256e={};var _0xdcccec={};var _0x28be35;var _0x8c9797;return db['WhatsappQueue']['findOne']({'where':{'id':_0x3d26a8[_0x5d66('0x51')]['id']}})[_0x5d66('0x2f')](handleEntityNotFound(_0x2add2d,null))[_0x5d66('0x2f')](function(_0x13df3a){if(_0x13df3a){_0x28be35=_0x13df3a;_0xdcccec[_0x5d66('0x3b')]=_['keys'](db[_0x5d66('0x69')]['rawAttributes']);_0xdcccec[_0x5d66('0x3c')]=_[_0x5d66('0x3d')](_0x3d26a8[_0x5d66('0x3c')]);_0xdcccec[_0x5d66('0x3e')]=_['intersection'](_0xdcccec[_0x5d66('0x3b')],_0xdcccec[_0x5d66('0x3c')]);_0x57256e[_0x5d66('0x3f')]=_[_0x5d66('0x40')](_0xdcccec[_0x5d66('0x3b')],qs[_0x5d66('0x41')](_0x3d26a8['query'][_0x5d66('0x41')]));_0x57256e[_0x5d66('0x3f')]=_0x57256e[_0x5d66('0x3f')][_0x5d66('0x5e')]?_0x57256e['attributes']:_0xdcccec[_0x5d66('0x3b')];_0x57256e[_0x5d66('0x5f')]=qs['sort'](_0x3d26a8[_0x5d66('0x3c')][_0x5d66('0x44')]);_0x57256e['where']=qs[_0x5d66('0x3e')](_[_0x5d66('0x45')](_0x3d26a8[_0x5d66('0x3c')],_0xdcccec[_0x5d66('0x3e')]));if(_0x3d26a8[_0x5d66('0x3c')][_0x5d66('0x46')]){_0x57256e[_0x5d66('0x47')]=_[_0x5d66('0x4a')](_0x57256e[_0x5d66('0x47')],{'$or':_[_0x5d66('0x36')](_0x57256e[_0x5d66('0x3f')],function(_0x50eddf){var _0x5b0f4d={};_0x5b0f4d[_0x50eddf]={'$like':'%'+_0x3d26a8[_0x5d66('0x3c')][_0x5d66('0x46')]+'%'};return _0x5b0f4d;})});}_0x57256e=_[_0x5d66('0x4a')]({},_0x57256e,_0x3d26a8[_0x5d66('0x4b')]);return _0x28be35['getTeams'](_0x57256e);}})[_0x5d66('0x2f')](function(_0x362b17){if(_0x362b17){_0x8c9797=_0x362b17[_0x5d66('0x5e')];if(!_0x3d26a8[_0x5d66('0x3c')][_0x5d66('0x42')]('nolimit')){_0x57256e['limit']=qs[_0x5d66('0x28')](_0x3d26a8[_0x5d66('0x3c')][_0x5d66('0x28')]);_0x57256e[_0x5d66('0x25')]=qs[_0x5d66('0x25')](_0x3d26a8[_0x5d66('0x3c')][_0x5d66('0x25')]);}return _0x28be35['getTeams'](_0x57256e);}})[_0x5d66('0x2f')](function(_0x1b6c47){if(_0x1b6c47){return _0x1b6c47?{'count':_0x8c9797,'rows':_0x1b6c47}:null;}})['then'](respondWithResult(_0x2add2d,null))[_0x5d66('0x50')](handleError(_0x2add2d,null));};exports[_0x5d66('0x6a')]=function(_0x4feb55,_0xf5a14e,_0x490755){var _0x366d14=_0x4feb55[_0x5d66('0x54')][_0x5d66('0x6b')];return db['Team'][_0x5d66('0x4e')]({'where':{'id':_0x366d14},'attributes':['id'],'include':[{'model':db[_0x5d66('0x61')],'as':_0x5d66('0x6c'),'attributes':['id',_0x5d66('0x35'),_0x5d66('0x6d'),_0x5d66('0x6e'),_0x5d66('0x6f')],'raw':!![]}]})['then'](function(_0x5184fb){if(_0x5184fb){var _0x29b0f3=_[_0x5d66('0x70')](_0x5184fb,function(_0x4b4c89){var _0x4dae86=_0x4b4c89[_0x5d66('0x30')]({'plain':!![]});return _0x4dae86[_0x5d66('0x6c')];});return db['WhatsappQueue'][_0x5d66('0x52')]({'where':{'id':_0x4feb55[_0x5d66('0x51')]['id']}})[_0x5d66('0x2f')](function(_0x3dff4b){return db['sequelize'][_0x5d66('0x71')](function(_0x4d90c4){return _0x3dff4b[_0x5d66('0x6a')](_0x366d14,{'transaction':_0x4d90c4})[_0x5d66('0x2f')](function(){return BPromise[_0x5d66('0x72')](_0x29b0f3,function(_0x12ec63){return db[_0x5d66('0x5d')]['findOrCreate']({'where':{'UserId':_0x12ec63['id'],'WhatsappQueueId':_0x4feb55[_0x5d66('0x51')]['id']},'transaction':_0x4d90c4});});})['then'](function(){_0x29b0f3[_0x5d66('0x73')](function(_0x545a1b){socket[_0x5d66('0x74')]('userWhatsappQueue:save',{'UserId':_0x545a1b['id'],'WhatsappQueueId':_0x3dff4b['id']});});});});});}})[_0x5d66('0x2f')](respondWithStatusCode(_0xf5a14e,null))['catch'](handleError(_0xf5a14e,null));};exports[_0x5d66('0x75')]=function(_0x348356,_0x1613d3,_0x52929c){return db[_0x5d66('0x69')][_0x5d66('0x4e')]({'where':{'id':_0x348356[_0x5d66('0x3c')][_0x5d66('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x5d66('0x61')],'as':_0x5d66('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1613d3,null))[_0x5d66('0x2f')](function(_0x202f24){var _0x22b1ec=_[_0x5d66('0x36')](_0x202f24,'id');var _0xf3c7e3=[];var _0x52c657=[];var _0x510150=squel[_0x5d66('0x76')]();_0x510150['field'](_0x5d66('0x77'))[_0x5d66('0x78')]('team_has_whatsapp_queues','tq')['join'](_0x5d66('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x5d66('0x7a'),_0x348356['params']['id']);for(var _0x3cdf72=0x0;_0x3cdf72<_0x202f24[_0x5d66('0x5e')];_0x3cdf72+=0x1){let _0x28abaf=_0x202f24[_0x3cdf72];for(var _0x3b6399=0x0;_0x3b6399<_0x28abaf[_0x5d66('0x6c')][_0x5d66('0x5e')];_0x3b6399+=0x1){let _0x24922b=_0x28abaf[_0x5d66('0x6c')][_0x3b6399];var _0x290907=_0x510150[_0x5d66('0x7b')]();_0x290907[_0x5d66('0x47')]('ut.UserId\x20=\x20?',_0x24922b['id']);_0x52c657['push'](db[_0x5d66('0x7c')]['query'](_0x290907[_0x5d66('0x7d')](),{'type':db[_0x5d66('0x7c')][_0x5d66('0x7e')][_0x5d66('0x7f')]})[_0x5d66('0x2f')](function(_0x2e245f){if(_0x2e245f[_0x5d66('0x5e')]===0x1){return _0x24922b['id'];}else{var _0x5c3cb1=_[_0x5d66('0x80')](_[_0x5d66('0x36')](_0x2e245f,_0x5d66('0x81')),function(_0x528fea){return _[_0x5d66('0x82')](_0x22b1ec,_0x528fea);});if(_0x5c3cb1){return _0x24922b['id'];}}}));}}return BPromise[_0x5d66('0x83')](_0x52c657)['then'](function(_0x190737){_0xf3c7e3=_(_0xf3c7e3)['union'](_0x190737)[_0x5d66('0x84')]()[_0x5d66('0x85')]();return db[_0x5d66('0x37')]['find']({'where':{'id':_0x348356[_0x5d66('0x51')]['id']}})['then'](function(_0x11cb63){return db[_0x5d66('0x7c')][_0x5d66('0x71')](function(_0x428577){return _0x11cb63[_0x5d66('0x75')](_0x348356[_0x5d66('0x3c')][_0x5d66('0x6b')],{'transaction':_0x428577})[_0x5d66('0x2f')](function(){if(!_[_0x5d66('0x86')](_0xf3c7e3)){return _0x11cb63[_0x5d66('0x87')](_0xf3c7e3,{'transaction':_0x428577});}})[_0x5d66('0x2f')](function(){_0xf3c7e3[_0x5d66('0x73')](function(_0x12b614){socket['emit'](_0x5d66('0x88'),{'UserId':_0x12b614,'WhatsappQueueId':_0x11cb63['id']});});});});});});})['then'](respondWithStatusCode(_0x1613d3,null))[_0x5d66('0x50')](handleError(_0x1613d3,null));};exports[_0x5d66('0x89')]=function(_0x5cb99b,_0x35c0a1,_0x37efcc){return db[_0x5d66('0x37')]['find']({'where':{'id':_0x5cb99b[_0x5d66('0x51')]['id']}})[_0x5d66('0x2f')](handleEntityNotFound(_0x35c0a1,null))[_0x5d66('0x2f')](function(_0x4f9826){if(_0x4f9826){return _0x4f9826['addAgents'](_0x5cb99b[_0x5d66('0x54')][_0x5d66('0x6b')],_[_0x5d66('0x8a')](_0x5cb99b['body'],[_0x5d66('0x6b'),'id'])||{})[_0x5d66('0x8b')](function(_0x3488c5){for(var _0x2172a8=0x0;_0x2172a8<_0x5cb99b[_0x5d66('0x54')][_0x5d66('0x6b')][_0x5d66('0x5e')];_0x2172a8+=0x1){socket[_0x5d66('0x74')]('userWhatsappQueue:save',{'UserId':Number(_0x5cb99b[_0x5d66('0x54')][_0x5d66('0x6b')][_0x2172a8]),'WhatsappQueueId':Number(_0x5cb99b[_0x5d66('0x51')]['id'])});}return _0x3488c5;});}})[_0x5d66('0x2f')](respondWithResult(_0x35c0a1,null))[_0x5d66('0x50')](handleError(_0x35c0a1,null));};exports[_0x5d66('0x87')]=function(_0x18354f,_0x148ad8,_0x5b15ad){return db[_0x5d66('0x37')][_0x5d66('0x52')]({'where':{'id':_0x18354f[_0x5d66('0x51')]['id']}})[_0x5d66('0x2f')](handleEntityNotFound(_0x148ad8,null))['then'](function(_0x3e8111){if(_0x3e8111){return _0x3e8111['removeAgents'](_0x18354f[_0x5d66('0x3c')][_0x5d66('0x6b')])[_0x5d66('0x2f')](function(){if(_[_0x5d66('0x8c')](_0x18354f['query'][_0x5d66('0x6b')])){for(var _0x33b210=0x0;_0x33b210<_0x18354f['query'][_0x5d66('0x6b')]['length'];_0x33b210+=0x1){socket[_0x5d66('0x74')](_0x5d66('0x88'),{'UserId':Number(_0x18354f[_0x5d66('0x3c')][_0x5d66('0x6b')][_0x33b210]),'WhatsappQueueId':Number(_0x18354f[_0x5d66('0x51')]['id'])});}}else{socket[_0x5d66('0x74')]('userWhatsappQueue:remove',{'UserId':Number(_0x18354f[_0x5d66('0x3c')]['ids']),'WhatsappQueueId':Number(_0x18354f[_0x5d66('0x51')]['id'])});}});}})[_0x5d66('0x2f')](respondWithStatusCode(_0x148ad8,null))[_0x5d66('0x50')](handleError(_0x148ad8,null));};exports['getAgents']=function(_0x1673a4,_0x45f7a6,_0x4fbe08){var _0x49797b={};var _0x4ea6a0={};var _0x32d925;var _0x1cfd44;return db[_0x5d66('0x37')][_0x5d66('0x8d')]({'where':{'id':_0x1673a4[_0x5d66('0x51')]['id']}})[_0x5d66('0x2f')](handleEntityNotFound(_0x45f7a6,null))[_0x5d66('0x2f')](function(_0x4854db){if(_0x4854db){_0x32d925=_0x4854db;_0x4ea6a0[_0x5d66('0x3b')]=_['keys'](db[_0x5d66('0x61')][_0x5d66('0x38')]);_0x4ea6a0['query']=_[_0x5d66('0x3d')](_0x1673a4[_0x5d66('0x3c')]);_0x4ea6a0[_0x5d66('0x3e')]=_[_0x5d66('0x40')](_0x4ea6a0[_0x5d66('0x3b')],_0x4ea6a0[_0x5d66('0x3c')]);_0x49797b['attributes']=_[_0x5d66('0x40')](_0x4ea6a0['model'],qs[_0x5d66('0x41')](_0x1673a4[_0x5d66('0x3c')][_0x5d66('0x41')]));_0x49797b[_0x5d66('0x3f')]=_0x49797b['attributes'][_0x5d66('0x5e')]?_0x49797b[_0x5d66('0x3f')]:_0x4ea6a0[_0x5d66('0x3b')];_0x49797b[_0x5d66('0x5f')]=qs[_0x5d66('0x44')](_0x1673a4[_0x5d66('0x3c')][_0x5d66('0x44')]);_0x49797b['where']=qs[_0x5d66('0x3e')](_[_0x5d66('0x45')](_0x1673a4[_0x5d66('0x3c')],_0x4ea6a0[_0x5d66('0x3e')]));if(_0x1673a4[_0x5d66('0x3c')][_0x5d66('0x46')]){_0x49797b[_0x5d66('0x47')]=_['merge'](_0x49797b[_0x5d66('0x47')],{'$or':_[_0x5d66('0x36')](_0x49797b[_0x5d66('0x3f')],function(_0x14312c){var _0x20cda7={};_0x20cda7[_0x14312c]={'$like':'%'+_0x1673a4[_0x5d66('0x3c')][_0x5d66('0x46')]+'%'};return _0x20cda7;})});}_0x49797b=_[_0x5d66('0x4a')]({},_0x49797b,_0x1673a4[_0x5d66('0x4b')]);return _0x32d925[_0x5d66('0x8e')](_0x49797b);}})[_0x5d66('0x2f')](function(_0x49cbf8){if(_0x49cbf8){_0x1cfd44=_0x49cbf8[_0x5d66('0x5e')];if(!_0x1673a4['query'][_0x5d66('0x42')]('nolimit')){_0x49797b[_0x5d66('0x28')]=qs[_0x5d66('0x28')](_0x1673a4[_0x5d66('0x3c')][_0x5d66('0x28')]);_0x49797b['offset']=qs[_0x5d66('0x25')](_0x1673a4[_0x5d66('0x3c')]['offset']);}return _0x32d925[_0x5d66('0x8e')](_0x49797b);}})[_0x5d66('0x2f')](function(_0x5b9ba0){if(_0x5b9ba0){return _0x5b9ba0?{'count':_0x1cfd44,'rows':_0x5b9ba0}:null;}})[_0x5d66('0x2f')](respondWithResult(_0x45f7a6,null))['catch'](handleError(_0x45f7a6,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index cca03ae..89995d2 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 _0xcb0b=['exports','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3a41a8,_0x1e25b9){var _0x19dfeb=function(_0x4f6567){while(--_0x4f6567){_0x3a41a8['push'](_0x3a41a8['shift']());}};_0x19dfeb(++_0x1e25b9);}(_0xcb0b,0xb5));var _0xbcb0=function(_0x49fbc9,_0x223a6d){_0x49fbc9=_0x49fbc9-0x0;var _0x59e98f=_0xcb0b[_0x49fbc9];return _0x59e98f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xbcb0('0x0'))['db'][_0xbcb0('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xbcb0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbcb0('0x3'),'afterDestroy':_0xbcb0('0x4')};function emitEvent(_0x15daa9){return function(_0x28b76a,_0x363713,_0x1b79ae){WhatsappQueueEvents[_0xbcb0('0x5')](_0x15daa9+':'+_0x28b76a['id'],_0x28b76a);WhatsappQueueEvents[_0xbcb0('0x5')](_0x15daa9,_0x28b76a);_0x1b79ae(null);};}for(var e in events){if(events[_0xbcb0('0x6')](e)){var event=events[e];WhatsappQueue[_0xbcb0('0x7')](e,emitEvent(event));}}module[_0xbcb0('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc4a6=['../../mysqldb','WhatsappQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5de8df,_0x35f8c5){var _0x1e4b5c=function(_0x378b49){while(--_0x378b49){_0x5de8df['push'](_0x5de8df['shift']());}};_0x1e4b5c(++_0x35f8c5);}(_0xc4a6,0x9f));var _0x6c4a=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xc4a6[_0x54d4a8];return _0x3b321b;};'use strict';var EventEmitter=require(_0x6c4a('0x0'));var WhatsappQueue=require(_0x6c4a('0x1'))['db'][_0x6c4a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c4a('0x3'),'afterUpdate':_0x6c4a('0x4'),'afterDestroy':_0x6c4a('0x5')};function emitEvent(_0x6c3bfa){return function(_0x22ecd5,_0x51e517,_0x563ec0){WhatsappQueueEvents[_0x6c4a('0x6')](_0x6c3bfa+':'+_0x22ecd5['id'],_0x22ecd5);WhatsappQueueEvents['emit'](_0x6c3bfa,_0x22ecd5);_0x563ec0(null);};}for(var e in events){if(events[_0x6c4a('0x7')](e)){var event=events[e];WhatsappQueue[_0x6c4a('0x8')](e,emitEvent(event));}}module[_0x6c4a('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 6073d4c..445f399 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 _0xcf56=['path','rimraf','./whatsappQueue.attributes','exports','whatsapp_queues','util','../../config/logger','bluebird'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xcf56,0x1e5));var _0x6cf5=function(_0x7bf151,_0x24e4ad){_0x7bf151=_0x7bf151-0x0;var _0x13a554=_0xcf56[_0x7bf151];return _0x13a554;};'use strict';var _=require('lodash');var util=require(_0x6cf5('0x0'));var logger=require(_0x6cf5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6cf5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cf5('0x3'));var rimraf=require(_0x6cf5('0x4'));var config=require('../../config/environment');var attributes=require(_0x6cf5('0x5'));module[_0x6cf5('0x6')]=function(_0x13d7d0,_0x41e8e3){return _0x13d7d0['define']('WhatsappQueue',attributes,{'tableName':_0x6cf5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf53c=['path','../../config/environment','exports','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4b2b9a,_0x5f38bd){var _0x207207=function(_0x28a31b){while(--_0x28a31b){_0x4b2b9a['push'](_0x4b2b9a['shift']());}};_0x207207(++_0x5f38bd);}(_0xf53c,0x73));var _0xcf53=function(_0x3293d1,_0x1493ed){_0x3293d1=_0x3293d1-0x0;var _0x147659=_0xf53c[_0x3293d1];return _0x147659;};'use strict';var _=require('lodash');var util=require(_0xcf53('0x0'));var logger=require(_0xcf53('0x1'))(_0xcf53('0x2'));var moment=require(_0xcf53('0x3'));var BPromise=require(_0xcf53('0x4'));var rp=require(_0xcf53('0x5'));var fs=require('fs');var path=require(_0xcf53('0x6'));var rimraf=require('rimraf');var config=require(_0xcf53('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0xcf53('0x8')]=function(_0x2ecfad,_0x25a32f){return _0x2ecfad['define'](_0xcf53('0x9'),attributes,{'tableName':_0xcf53('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 6622da6..0891e95 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 _0x767a=['map','model','attributes','then','ShowWhatsappQueue','WhatsappQueue','find','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','findAll','options','raw','where','limit','include'];(function(_0x2da679,_0x263f44){var _0x27f84c=function(_0x2097c4){while(--_0x2097c4){_0x2da679['push'](_0x2da679['shift']());}};_0x27f84c(++_0x263f44);}(_0x767a,0x12e));var _0xa767=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x767a[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xa767('0x0'));var util=require(_0xa767('0x1'));var moment=require(_0xa767('0x2'));var BPromise=require(_0xa767('0x3'));var rs=require(_0xa767('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa767('0x5'))['db'];var utils=require(_0xa767('0x6'));var logger=require(_0xa767('0x7'))(_0xa767('0x8'));var config=require(_0xa767('0x9'));var jayson=require(_0xa767('0xa'));var client=jayson[_0xa767('0xb')]['http']({'port':0x232a});config[_0xa767('0xc')]=_[_0xa767('0xd')](config[_0xa767('0xc')],{'host':_0xa767('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa767('0xc')]));require(_0xa767('0xf'))[_0xa767('0x10')](socket);function respondWithRpcPromise(_0x2978d0,_0x1a09b8,_0x34e9be){return new BPromise(function(_0xe767d,_0x348a19){return client[_0xa767('0x11')](_0x2978d0,_0x34e9be)['then'](function(_0x34ddc6){logger[_0xa767('0x12')](_0xa767('0x13'),_0x1a09b8,_0xa767('0x14'));logger['debug'](_0xa767('0x15'),_0x1a09b8,_0xa767('0x14'),JSON[_0xa767('0x16')](_0x34ddc6));if(_0x34ddc6[_0xa767('0x17')]){if(_0x34ddc6[_0xa767('0x17')][_0xa767('0x18')]===0x1f4){logger[_0xa767('0x17')](_0xa767('0x13'),_0x1a09b8,_0x34ddc6['error'][_0xa767('0x19')]);return _0x348a19(_0x34ddc6[_0xa767('0x17')][_0xa767('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x1a09b8,_0x34ddc6[_0xa767('0x17')][_0xa767('0x19')]);return _0xe767d(_0x34ddc6[_0xa767('0x17')][_0xa767('0x19')]);}else{logger['info'](_0xa767('0x13'),_0x1a09b8,'request\x20sent');_0xe767d(_0x34ddc6['result'][_0xa767('0x19')]);}})[_0xa767('0x1a')](function(_0x533458){logger['error'](_0xa767('0x13'),_0x1a09b8,_0x533458);_0x348a19(_0x533458);});});}exports[_0xa767('0x1b')]=function(_0x57247e){var _0x3400da=this;return new Promise(function(_0xdeb337,_0x492ea2){return db['WhatsappQueue'][_0xa767('0x1c')]({'raw':_0x57247e[_0xa767('0x1d')]?_0x57247e[_0xa767('0x1d')][_0xa767('0x1e')]===undefined?!![]:![]:!![],'where':_0x57247e['options']?_0x57247e[_0xa767('0x1d')][_0xa767('0x1f')]||null:null,'attributes':_0x57247e[_0xa767('0x1d')]?_0x57247e[_0xa767('0x1d')]['attributes']||null:null,'limit':_0x57247e[_0xa767('0x1d')]?_0x57247e[_0xa767('0x1d')][_0xa767('0x20')]||null:null,'include':_0x57247e['options']?_0x57247e[_0xa767('0x1d')][_0xa767('0x21')]?_[_0xa767('0x22')](_0x57247e[_0xa767('0x1d')][_0xa767('0x21')],function(_0x5a09c3){return{'model':db[_0x5a09c3[_0xa767('0x23')]],'as':_0x5a09c3['as'],'attributes':_0x5a09c3['attributes'],'include':_0x5a09c3[_0xa767('0x21')]?_[_0xa767('0x22')](_0x5a09c3[_0xa767('0x21')],function(_0x2c1869){return{'model':db[_0x2c1869[_0xa767('0x23')]],'as':_0x2c1869['as'],'attributes':_0x2c1869[_0xa767('0x24')],'include':_0x2c1869[_0xa767('0x21')]?_[_0xa767('0x22')](_0x2c1869[_0xa767('0x21')],function(_0xaf79da){return{'model':db[_0xaf79da[_0xa767('0x23')]],'as':_0xaf79da['as'],'attributes':_0xaf79da[_0xa767('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa767('0x25')](function(_0x2d40c0){logger['info'](_0xa767('0x1b'),_0x57247e);logger['debug'](_0xa767('0x1b'),_0x57247e,JSON['stringify'](_0x2d40c0));_0xdeb337(_0x2d40c0);})['catch'](function(_0x3fc4aa){logger[_0xa767('0x17')](_0xa767('0x1b'),_0x3fc4aa[_0xa767('0x19')],_0x57247e);_0x492ea2(_0x3400da['error'](0x1f4,_0x3fc4aa[_0xa767('0x19')]));});});};exports[_0xa767('0x26')]=function(_0x39cdc1){var _0x20371d=this;return new Promise(function(_0x2fbb93,_0x4ddb7b){return db[_0xa767('0x27')][_0xa767('0x28')]({'raw':_0x39cdc1[_0xa767('0x1d')]?_0x39cdc1['options'][_0xa767('0x1e')]===undefined?!![]:![]:!![],'where':_0x39cdc1[_0xa767('0x1d')]?_0x39cdc1[_0xa767('0x1d')][_0xa767('0x1f')]||null:null,'attributes':_0x39cdc1[_0xa767('0x1d')]?_0x39cdc1[_0xa767('0x1d')][_0xa767('0x24')]||null:null,'include':_0x39cdc1[_0xa767('0x1d')]?_0x39cdc1[_0xa767('0x1d')][_0xa767('0x21')]?_['map'](_0x39cdc1[_0xa767('0x1d')]['include'],function(_0x1ca68b){return{'model':db[_0x1ca68b[_0xa767('0x23')]],'as':_0x1ca68b['as'],'attributes':_0x1ca68b[_0xa767('0x24')],'include':_0x1ca68b[_0xa767('0x21')]?_[_0xa767('0x22')](_0x1ca68b[_0xa767('0x21')],function(_0x12ba9b){return{'model':db[_0x12ba9b['model']],'as':_0x12ba9b['as'],'attributes':_0x12ba9b['attributes'],'include':_0x12ba9b[_0xa767('0x21')]?_['map'](_0x12ba9b['include'],function(_0x4f7d42){return{'model':db[_0x4f7d42['model']],'as':_0x4f7d42['as'],'attributes':_0x4f7d42[_0xa767('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa767('0x25')](function(_0x69974){logger[_0xa767('0x12')](_0xa767('0x26'),_0x39cdc1);logger[_0xa767('0x29')](_0xa767('0x26'),_0x39cdc1,JSON[_0xa767('0x16')](_0x69974));_0x2fbb93(_0x69974);})[_0xa767('0x1a')](function(_0xc8ea61){logger[_0xa767('0x17')]('ShowWhatsappQueue',_0xc8ea61['message'],_0x39cdc1);_0x4ddb7b(_0x20371d[_0xa767('0x17')](0x1f4,_0xc8ea61[_0xa767('0x19')]));});});}; \ No newline at end of file +var _0x547b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./whatsappQueue.socket','register','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','catch','GetWhatsappQueue','findAll','options','where','attributes','limit','include','map','model','ShowWhatsappQueue','WhatsappQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4789ad,_0x104c32){var _0x5f1c90=function(_0x2dda7c){while(--_0x2dda7c){_0x4789ad['push'](_0x4789ad['shift']());}};_0x5f1c90(++_0x104c32);}(_0x547b,0x139));var _0xb547=function(_0x202c1c,_0x4eea9c){_0x202c1c=_0x202c1c-0x0;var _0xb165ab=_0x547b[_0x202c1c];return _0xb165ab;};'use strict';var _=require(_0xb547('0x0'));var util=require(_0xb547('0x1'));var moment=require(_0xb547('0x2'));var BPromise=require('bluebird');var rs=require(_0xb547('0x3'));var fs=require('fs');var Redis=require(_0xb547('0x4'));var db=require(_0xb547('0x5'))['db'];var utils=require(_0xb547('0x6'));var logger=require(_0xb547('0x7'))(_0xb547('0x8'));var config=require(_0xb547('0x9'));var jayson=require(_0xb547('0xa'));var client=jayson[_0xb547('0xb')]['http']({'port':0x232a});config[_0xb547('0xc')]=_['defaults'](config[_0xb547('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb547('0xd'))(new Redis(config['redis']));require(_0xb547('0xe'))[_0xb547('0xf')](socket);function respondWithRpcPromise(_0x4e8788,_0x434bc4,_0x43430d){return new BPromise(function(_0x138707,_0x5cbd7d){return client['request'](_0x4e8788,_0x43430d)[_0xb547('0x10')](function(_0x48d692){logger[_0xb547('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x434bc4,_0xb547('0x12'));logger[_0xb547('0x13')](_0xb547('0x14'),_0x434bc4,_0xb547('0x12'),JSON[_0xb547('0x15')](_0x48d692));if(_0x48d692[_0xb547('0x16')]){if(_0x48d692[_0xb547('0x16')][_0xb547('0x17')]===0x1f4){logger[_0xb547('0x16')](_0xb547('0x18'),_0x434bc4,_0x48d692[_0xb547('0x16')][_0xb547('0x19')]);return _0x5cbd7d(_0x48d692[_0xb547('0x16')][_0xb547('0x19')]);}logger[_0xb547('0x16')](_0xb547('0x18'),_0x434bc4,_0x48d692[_0xb547('0x16')]['message']);return _0x138707(_0x48d692[_0xb547('0x16')][_0xb547('0x19')]);}else{logger['info'](_0xb547('0x18'),_0x434bc4,_0xb547('0x12'));_0x138707(_0x48d692['result'][_0xb547('0x19')]);}})[_0xb547('0x1a')](function(_0x4d2e1e){logger[_0xb547('0x16')](_0xb547('0x18'),_0x434bc4,_0x4d2e1e);_0x5cbd7d(_0x4d2e1e);});});}exports[_0xb547('0x1b')]=function(_0x3671db){var _0x1755c5=this;return new Promise(function(_0x37ee1e,_0x31d80c){return db['WhatsappQueue'][_0xb547('0x1c')]({'raw':_0x3671db[_0xb547('0x1d')]?_0x3671db[_0xb547('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3671db[_0xb547('0x1d')]?_0x3671db[_0xb547('0x1d')][_0xb547('0x1e')]||null:null,'attributes':_0x3671db[_0xb547('0x1d')]?_0x3671db[_0xb547('0x1d')][_0xb547('0x1f')]||null:null,'limit':_0x3671db['options']?_0x3671db['options'][_0xb547('0x20')]||null:null,'include':_0x3671db[_0xb547('0x1d')]?_0x3671db['options'][_0xb547('0x21')]?_[_0xb547('0x22')](_0x3671db[_0xb547('0x1d')][_0xb547('0x21')],function(_0x7114fb){return{'model':db[_0x7114fb['model']],'as':_0x7114fb['as'],'attributes':_0x7114fb[_0xb547('0x1f')],'include':_0x7114fb['include']?_[_0xb547('0x22')](_0x7114fb[_0xb547('0x21')],function(_0x223c0f){return{'model':db[_0x223c0f[_0xb547('0x23')]],'as':_0x223c0f['as'],'attributes':_0x223c0f['attributes'],'include':_0x223c0f[_0xb547('0x21')]?_['map'](_0x223c0f[_0xb547('0x21')],function(_0x520469){return{'model':db[_0x520469[_0xb547('0x23')]],'as':_0x520469['as'],'attributes':_0x520469[_0xb547('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x286de2){logger['info']('GetWhatsappQueue',_0x3671db);logger[_0xb547('0x13')]('GetWhatsappQueue',_0x3671db,JSON[_0xb547('0x15')](_0x286de2));_0x37ee1e(_0x286de2);})[_0xb547('0x1a')](function(_0x48e3b7){logger[_0xb547('0x16')](_0xb547('0x1b'),_0x48e3b7[_0xb547('0x19')],_0x3671db);_0x31d80c(_0x1755c5['error'](0x1f4,_0x48e3b7['message']));});});};exports[_0xb547('0x24')]=function(_0x30a376){var _0x497632=this;return new Promise(function(_0x17fc09,_0x30d0b9){return db[_0xb547('0x25')][_0xb547('0x26')]({'raw':_0x30a376[_0xb547('0x1d')]?_0x30a376[_0xb547('0x1d')][_0xb547('0x27')]===undefined?!![]:![]:!![],'where':_0x30a376[_0xb547('0x1d')]?_0x30a376[_0xb547('0x1d')]['where']||null:null,'attributes':_0x30a376[_0xb547('0x1d')]?_0x30a376[_0xb547('0x1d')][_0xb547('0x1f')]||null:null,'include':_0x30a376['options']?_0x30a376[_0xb547('0x1d')][_0xb547('0x21')]?_[_0xb547('0x22')](_0x30a376[_0xb547('0x1d')]['include'],function(_0x27cf0f){return{'model':db[_0x27cf0f[_0xb547('0x23')]],'as':_0x27cf0f['as'],'attributes':_0x27cf0f[_0xb547('0x1f')],'include':_0x27cf0f[_0xb547('0x21')]?_[_0xb547('0x22')](_0x27cf0f[_0xb547('0x21')],function(_0x4517a4){return{'model':db[_0x4517a4[_0xb547('0x23')]],'as':_0x4517a4['as'],'attributes':_0x4517a4[_0xb547('0x1f')],'include':_0x4517a4['include']?_[_0xb547('0x22')](_0x4517a4[_0xb547('0x21')],function(_0x16e3c2){return{'model':db[_0x16e3c2[_0xb547('0x23')]],'as':_0x16e3c2['as'],'attributes':_0x16e3c2[_0xb547('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb547('0x10')](function(_0x464577){logger[_0xb547('0x11')]('ShowWhatsappQueue',_0x30a376);logger[_0xb547('0x13')]('ShowWhatsappQueue',_0x30a376,JSON[_0xb547('0x15')](_0x464577));_0x17fc09(_0x464577);})[_0xb547('0x1a')](function(_0x1b35b3){logger[_0xb547('0x16')]('ShowWhatsappQueue',_0x1b35b3[_0xb547('0x19')],_0x30a376);_0x30d0b9(_0x497632[_0xb547('0x16')](0x1f4,_0x1b35b3[_0xb547('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 3a455c8..3d1f5af 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 _0x1a1f=['./whatsappQueue.events','save','remove','emit','removeListener'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1a1f,0x1b8));var _0xf1a1=function(_0xa405fe,_0xa3f241){_0xa405fe=_0xa405fe-0x0;var _0x541a8e=_0x1a1f[_0xa405fe];return _0x541a8e;};'use strict';var WhatsappQueueEvents=require(_0xf1a1('0x0'));var events=[_0xf1a1('0x1'),_0xf1a1('0x2'),'update'];function createListener(_0x45130b,_0x23ce52){return function(_0x4cc9c7){_0x23ce52[_0xf1a1('0x3')](_0x45130b,_0x4cc9c7);};}function removeListener(_0x4c368a,_0xc3d412){return function(){WhatsappQueueEvents[_0xf1a1('0x4')](_0x4c368a,_0xc3d412);};}exports['register']=function(_0x553d42){for(var _0xfeb5dd=0x0,_0x527143=events['length'];_0xfeb5dd<_0x527143;_0xfeb5dd++){var _0x31ccdf=events[_0xfeb5dd];var _0x441a1e=createListener('whatsappQueue:'+_0x31ccdf,_0x553d42);WhatsappQueueEvents['on'](_0x31ccdf,_0x441a1e);}}; \ No newline at end of file +var _0xf1a9=['whatsappQueue:','./whatsappQueue.events','save','remove','update','register','length'];(function(_0x56bbf6,_0x2ff73d){var _0x399d68=function(_0x3112c5){while(--_0x3112c5){_0x56bbf6['push'](_0x56bbf6['shift']());}};_0x399d68(++_0x2ff73d);}(_0xf1a9,0x78));var _0x9f1a=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xf1a9[_0xaa0309];return _0x5de7ce;};'use strict';var WhatsappQueueEvents=require(_0x9f1a('0x0'));var events=[_0x9f1a('0x1'),_0x9f1a('0x2'),_0x9f1a('0x3')];function createListener(_0x17bff4,_0x197298){return function(_0x5382c8){_0x197298['emit'](_0x17bff4,_0x5382c8);};}function removeListener(_0x4cb094,_0x408154){return function(){WhatsappQueueEvents['removeListener'](_0x4cb094,_0x408154);};}exports[_0x9f1a('0x4')]=function(_0x35dffc){for(var _0xe7998=0x0,_0xee3c42=events[_0x9f1a('0x5')];_0xe7998<_0xee3c42;_0xe7998++){var _0xd9140f=events[_0xe7998];var _0x1a625a=createListener(_0x9f1a('0x6')+_0xd9140f,_0x35dffc);WhatsappQueueEvents['on'](_0xd9140f,_0x1a625a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ff097af..62baef8 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 _0xd585=['post','create','put','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xd585,0xef));var _0x5d58=function(_0x13ba52,_0x4039c6){_0x13ba52=_0x13ba52-0x0;var _0x7da249=_0xd585[_0x13ba52];return _0x7da249;};'use strict';var multer=require(_0x5d58('0x0'));var util=require(_0x5d58('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5d58('0x2')]();var fs_extra=require(_0x5d58('0x3'));var auth=require(_0x5d58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5d58('0x5'));var controller=require(_0x5d58('0x6'));router[_0x5d58('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5d58('0x7')](_0x5d58('0x8'),auth[_0x5d58('0x9')](),controller[_0x5d58('0xa')]);router[_0x5d58('0x7')](_0x5d58('0xb'),auth[_0x5d58('0x9')](),controller[_0x5d58('0xc')]);router[_0x5d58('0xd')]('/',auth[_0x5d58('0x9')](),controller[_0x5d58('0xe')]);router[_0x5d58('0xf')]('/:id',auth[_0x5d58('0x9')](),controller['update']);router[_0x5d58('0x10')](_0x5d58('0xb'),auth[_0x5d58('0x9')](),controller[_0x5d58('0x11')]);module['exports']=router; \ No newline at end of file +var _0x159c=['delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x159c,0x10c));var _0xc159=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x159c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc159('0x0'));var util=require(_0xc159('0x1'));var path=require(_0xc159('0x2'));var timeout=require(_0xc159('0x3'));var express=require(_0xc159('0x4'));var router=express[_0xc159('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc159('0x6'));var controller=require(_0xc159('0x7'));router[_0xc159('0x8')]('/',auth[_0xc159('0x9')](),controller[_0xc159('0xa')]);router['get'](_0xc159('0xb'),auth[_0xc159('0x9')](),controller[_0xc159('0xc')]);router[_0xc159('0x8')](_0xc159('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc159('0xe')]('/',auth[_0xc159('0x9')](),controller[_0xc159('0xf')]);router['put']('/:id',auth[_0xc159('0x9')](),controller[_0xc159('0x10')]);router[_0xc159('0x11')]('/:id',auth[_0xc159('0x9')](),controller['destroy']);module[_0xc159('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index b47be32..7fe31aa 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4af0df,_0x356f2c){var _0x30132b=function(_0x3ae0d6){while(--_0x3ae0d6){_0x4af0df['push'](_0x4af0df['shift']());}};_0x30132b(++_0x356f2c);}(_0x7a54,0x106));var _0x47a5=function(_0x2d6381,_0x18f2bf){_0x2d6381=_0x2d6381-0x0;var _0xa94dd6=_0x7a54[_0x2d6381];return _0xa94dd6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x3763ca,_0x1ddb80){var _0x451fea=function(_0x9bfdf9){while(--_0x9bfdf9){_0x3763ca['push'](_0x3763ca['shift']());}};_0x451fea(++_0x1ddb80);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 fc61756..0aa8cea 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 _0x0abf=['intersection','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','filter','options','include','findAll','catch','show','params'];(function(_0x1fc554,_0x577c58){var _0x18e981=function(_0x134b2e){while(--_0x134b2e){_0x1fc554['push'](_0x1fc554['shift']());}};_0x18e981(++_0x577c58);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ab('0x11'));var logger=require('../../config/logger')(_0xf0ab('0x12'));var utils=require(_0xf0ab('0x13'));var config=require(_0xf0ab('0x14'));var licenseUtil=require(_0xf0ab('0x15'));var db=require(_0xf0ab('0x16'))['db'];function respondWithStatusCode(_0x38ca67,_0x34ccdc){_0x34ccdc=_0x34ccdc||0xcc;return function(_0x4fdd5f){if(_0x4fdd5f){return _0x38ca67[_0xf0ab('0x17')](_0x34ccdc);}return _0x38ca67[_0xf0ab('0x18')](_0x34ccdc)[_0xf0ab('0x19')]();};}function respondWithResult(_0x35c75f,_0x1824ef){_0x1824ef=_0x1824ef||0xc8;return function(_0x36cabe){if(_0x36cabe){return _0x35c75f[_0xf0ab('0x18')](_0x1824ef)[_0xf0ab('0x1a')](_0x36cabe);}};}function respondWithFilteredResult(_0x180d0b,_0x3c5bfd){return function(_0x20f453){if(_0x20f453){var _0x221bac=typeof _0x3c5bfd[_0xf0ab('0x1b')]===_0xf0ab('0x1c')&&typeof _0x3c5bfd[_0xf0ab('0x1d')]==='undefined';var _0x457465=_0x20f453[_0xf0ab('0x1e')];var _0x1803f0=_0x221bac?0x0:_0x3c5bfd[_0xf0ab('0x1b')];var _0x776619=_0x221bac?_0x20f453[_0xf0ab('0x1e')]:_0x3c5bfd[_0xf0ab('0x1b')]+_0x3c5bfd[_0xf0ab('0x1d')];var _0x1713d6;if(_0x776619>=_0x457465){_0x776619=_0x457465;_0x1713d6=0xc8;}else{_0x1713d6=0xce;}_0x180d0b[_0xf0ab('0x18')](_0x1713d6);return _0x180d0b[_0xf0ab('0x1f')](_0xf0ab('0x20'),_0x1803f0+'-'+_0x776619+'/'+_0x457465)[_0xf0ab('0x1a')](_0x20f453);}return null;};}function patchUpdates(_0x22a205){return function(_0x2cd961){try{jsonpatch[_0xf0ab('0x21')](_0x2cd961,_0x22a205,!![]);}catch(_0x537673){return BPromise[_0xf0ab('0x22')](_0x537673);}return _0x2cd961[_0xf0ab('0x23')]();};}function saveUpdates(_0x1e1483,_0x11ab3a){return function(_0x3bf6a1){if(_0x3bf6a1){return _0x3bf6a1[_0xf0ab('0x24')](_0x1e1483)[_0xf0ab('0x25')](function(_0x20140b){return _0x20140b;});}return null;};}function removeEntity(_0x36ad01,_0x18bb37){return function(_0x43119f){if(_0x43119f){return _0x43119f['destroy']()['then'](function(){_0x36ad01['status'](0xcc)[_0xf0ab('0x19')]();});}};}function handleEntityNotFound(_0x4f0caf,_0x3eca32){return function(_0x16b979){if(!_0x16b979){_0x4f0caf['sendStatus'](0x194);}return _0x16b979;};}function handleError(_0x163078,_0x22671e){_0x22671e=_0x22671e||0x1f4;return function(_0x10bf5f){logger[_0xf0ab('0x26')](_0x10bf5f[_0xf0ab('0x27')]);if(_0x10bf5f['name']){delete _0x10bf5f[_0xf0ab('0x28')];}_0x163078['status'](_0x22671e)['send'](_0x10bf5f);};}exports[_0xf0ab('0x29')]=function(_0x4306c6,_0x1b223d){var _0x445160={},_0x43476c={},_0x174052={'count':0x0,'rows':[]};var _0x367302=_[_0xf0ab('0x2a')](db[_0xf0ab('0x2b')][_0xf0ab('0x2c')],function(_0x21e8ac){return{'name':_0x21e8ac[_0xf0ab('0x2d')],'type':_0x21e8ac['type'][_0xf0ab('0x2e')]};});_0x43476c[_0xf0ab('0x2f')]=_['map'](_0x367302,'name');_0x43476c[_0xf0ab('0x30')]=_[_0xf0ab('0x31')](_0x4306c6[_0xf0ab('0x30')]);_0x43476c['filters']=_['intersection'](_0x43476c[_0xf0ab('0x2f')],_0x43476c['query']);_0x445160[_0xf0ab('0x32')]=_['intersection'](_0x43476c[_0xf0ab('0x2f')],qs[_0xf0ab('0x33')](_0x4306c6['query']['fields']));_0x445160[_0xf0ab('0x32')]=_0x445160[_0xf0ab('0x32')][_0xf0ab('0x34')]?_0x445160[_0xf0ab('0x32')]:_0x43476c[_0xf0ab('0x2f')];if(!_0x4306c6[_0xf0ab('0x30')][_0xf0ab('0x35')](_0xf0ab('0x36'))){_0x445160[_0xf0ab('0x1d')]=qs[_0xf0ab('0x1d')](_0x4306c6[_0xf0ab('0x30')][_0xf0ab('0x1d')]);_0x445160[_0xf0ab('0x1b')]=qs[_0xf0ab('0x1b')](_0x4306c6['query'][_0xf0ab('0x1b')]);}_0x445160[_0xf0ab('0x37')]=qs[_0xf0ab('0x38')](_0x4306c6['query'][_0xf0ab('0x38')]);_0x445160[_0xf0ab('0x39')]=qs[_0xf0ab('0x3a')](_['pick'](_0x4306c6[_0xf0ab('0x30')],_0x43476c['filters']),_0x367302);if(_0x4306c6[_0xf0ab('0x30')]['filter']){_0x445160[_0xf0ab('0x39')]=_[_0xf0ab('0x3b')](_0x445160[_0xf0ab('0x39')],{'$or':_[_0xf0ab('0x2a')](_0x367302,function(_0xcb0117){if(_0xcb0117[_0xf0ab('0x3c')]!=='VIRTUAL'){var _0x1adead={};_0x1adead[_0xcb0117[_0xf0ab('0x28')]]={'$like':'%'+_0x4306c6['query'][_0xf0ab('0x3d')]+'%'};return _0x1adead;}})});}_0x445160=_[_0xf0ab('0x3b')]({},_0x445160,_0x4306c6[_0xf0ab('0x3e')]);var _0x44988b={'where':_0x445160[_0xf0ab('0x39')]};return db[_0xf0ab('0x2b')][_0xf0ab('0x1e')](_0x44988b)['then'](function(_0x406a1d){_0x174052[_0xf0ab('0x1e')]=_0x406a1d;if(_0x4306c6[_0xf0ab('0x30')]['includeAll']){_0x445160[_0xf0ab('0x3f')]=[{'all':!![]}];}return db[_0xf0ab('0x2b')][_0xf0ab('0x40')](_0x445160);})[_0xf0ab('0x25')](function(_0x2b7ed5){_0x174052['rows']=_0x2b7ed5;return _0x174052;})[_0xf0ab('0x25')](respondWithFilteredResult(_0x1b223d,_0x445160))[_0xf0ab('0x41')](handleError(_0x1b223d,null));};exports[_0xf0ab('0x42')]=function(_0x197955,_0x191caf){var _0x17a73={'raw':!![],'where':{'id':_0x197955[_0xf0ab('0x43')]['id']}},_0x45849c={};_0x45849c[_0xf0ab('0x2f')]=_[_0xf0ab('0x31')](db[_0xf0ab('0x2b')][_0xf0ab('0x2c')]);_0x45849c[_0xf0ab('0x30')]=_['keys'](_0x197955['query']);_0x45849c[_0xf0ab('0x3a')]=_['intersection'](_0x45849c[_0xf0ab('0x2f')],_0x45849c[_0xf0ab('0x30')]);_0x17a73['attributes']=_[_0xf0ab('0x44')](_0x45849c[_0xf0ab('0x2f')],qs['fields'](_0x197955[_0xf0ab('0x30')][_0xf0ab('0x33')]));_0x17a73[_0xf0ab('0x32')]=_0x17a73[_0xf0ab('0x32')][_0xf0ab('0x34')]?_0x17a73[_0xf0ab('0x32')]:_0x45849c[_0xf0ab('0x2f')];if(_0x197955[_0xf0ab('0x30')][_0xf0ab('0x45')]){_0x17a73[_0xf0ab('0x3f')]=[{'all':!![]}];}_0x17a73=_[_0xf0ab('0x3b')]({},_0x17a73,_0x197955[_0xf0ab('0x3e')]);return db[_0xf0ab('0x2b')][_0xf0ab('0x46')](_0x17a73)['then'](handleEntityNotFound(_0x191caf,null))['then'](respondWithResult(_0x191caf,null))[_0xf0ab('0x41')](handleError(_0x191caf,null));};exports['create']=function(_0x4f6dd8,_0x4e57d3){return db[_0xf0ab('0x2b')][_0xf0ab('0x47')](_0x4f6dd8[_0xf0ab('0x48')],{})[_0xf0ab('0x25')](respondWithResult(_0x4e57d3,0xc9))[_0xf0ab('0x41')](handleError(_0x4e57d3,null));};exports[_0xf0ab('0x24')]=function(_0x472c1b,_0x1a0f21){if(_0x472c1b[_0xf0ab('0x48')]['id']){delete _0x472c1b[_0xf0ab('0x48')]['id'];}return db[_0xf0ab('0x2b')][_0xf0ab('0x46')]({'where':{'id':_0x472c1b['params']['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0x1a0f21,null))[_0xf0ab('0x25')](saveUpdates(_0x472c1b[_0xf0ab('0x48')],null))[_0xf0ab('0x25')](respondWithResult(_0x1a0f21,null))[_0xf0ab('0x41')](handleError(_0x1a0f21,null));};exports[_0xf0ab('0x49')]=function(_0x430921,_0x2e6c5e){return db['WhatsappQueueReport']['find']({'where':{'id':_0x430921['params']['id']}})[_0xf0ab('0x25')](handleEntityNotFound(_0x2e6c5e,null))[_0xf0ab('0x25')](removeEntity(_0x2e6c5e,null))['catch'](handleError(_0x2e6c5e,null));};exports[_0xf0ab('0x4a')]=function(_0x22c7ae,_0x4edb01){return db[_0xf0ab('0x2b')][_0xf0ab('0x4a')]()[_0xf0ab('0x25')](respondWithResult(_0x4edb01,null))[_0xf0ab('0x41')](handleError(_0x4edb01,null));}; \ No newline at end of file +var _0xe511=['destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','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','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','error','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','WhatsappQueueReport','findAll','catch','show','params','rawAttributes','find','create','body'];(function(_0x28b2bc,_0x100785){var _0x20fd6b=function(_0x2783ea){while(--_0x2783ea){_0x28b2bc['push'](_0x28b2bc['shift']());}};_0x20fd6b(++_0x100785);}(_0xe511,0x16f));var _0x1e51=function(_0x374c4a,_0x5afa32){_0x374c4a=_0x374c4a-0x0;var _0x103f4a=_0xe511[_0x374c4a];return _0x103f4a;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];function respondWithStatusCode(_0x3c5330,_0x5544eb){_0x5544eb=_0x5544eb||0xcc;return function(_0x408a77){if(_0x408a77){return _0x3c5330[_0x1e51('0x18')](_0x5544eb);}return _0x3c5330[_0x1e51('0x19')](_0x5544eb)[_0x1e51('0x1a')]();};}function respondWithResult(_0x21bcbd,_0x32945d){_0x32945d=_0x32945d||0xc8;return function(_0x441c70){if(_0x441c70){return _0x21bcbd[_0x1e51('0x19')](_0x32945d)[_0x1e51('0x1b')](_0x441c70);}};}function respondWithFilteredResult(_0xd76fba,_0x5a5c07){return function(_0x3b01b7){if(_0x3b01b7){var _0x24db4f=typeof _0x5a5c07[_0x1e51('0x1c')]==='undefined'&&typeof _0x5a5c07[_0x1e51('0x1d')]==='undefined';var _0x53d222=_0x3b01b7[_0x1e51('0x1e')];var _0x27dcad=_0x24db4f?0x0:_0x5a5c07[_0x1e51('0x1c')];var _0x4785a5=_0x24db4f?_0x3b01b7[_0x1e51('0x1e')]:_0x5a5c07[_0x1e51('0x1c')]+_0x5a5c07['limit'];var _0x39449b;if(_0x4785a5>=_0x53d222){_0x4785a5=_0x53d222;_0x39449b=0xc8;}else{_0x39449b=0xce;}_0xd76fba['status'](_0x39449b);return _0xd76fba[_0x1e51('0x1f')](_0x1e51('0x20'),_0x27dcad+'-'+_0x4785a5+'/'+_0x53d222)[_0x1e51('0x1b')](_0x3b01b7);}return null;};}function patchUpdates(_0x183a95){return function(_0x506f40){try{jsonpatch['apply'](_0x506f40,_0x183a95,!![]);}catch(_0x4e6a49){return BPromise['reject'](_0x4e6a49);}return _0x506f40[_0x1e51('0x21')]();};}function saveUpdates(_0x4f1f56,_0x3f7340){return function(_0x28aacb){if(_0x28aacb){return _0x28aacb[_0x1e51('0x22')](_0x4f1f56)[_0x1e51('0x23')](function(_0x23c85a){return _0x23c85a;});}return null;};}function removeEntity(_0xf9298,_0x270adf){return function(_0x461d3d){if(_0x461d3d){return _0x461d3d['destroy']()['then'](function(){_0xf9298[_0x1e51('0x19')](0xcc)[_0x1e51('0x1a')]();});}};}function handleEntityNotFound(_0x2e42b1,_0x1386db){return function(_0x505d79){if(!_0x505d79){_0x2e42b1['sendStatus'](0x194);}return _0x505d79;};}function handleError(_0x486ad6,_0x1eb83f){_0x1eb83f=_0x1eb83f||0x1f4;return function(_0x2a1561){logger[_0x1e51('0x24')](_0x2a1561['stack']);if(_0x2a1561[_0x1e51('0x25')]){delete _0x2a1561['name'];}_0x486ad6['status'](_0x1eb83f)[_0x1e51('0x26')](_0x2a1561);};}exports['index']=function(_0x170ec6,_0x1eb79f){var _0x56722f={},_0x3e6ef2={},_0x10ee23={'count':0x0,'rows':[]};var _0x71c7af=_[_0x1e51('0x27')](db['WhatsappQueueReport']['rawAttributes'],function(_0x4f67d3){return{'name':_0x4f67d3[_0x1e51('0x28')],'type':_0x4f67d3[_0x1e51('0x29')][_0x1e51('0x2a')]};});_0x3e6ef2[_0x1e51('0x2b')]=_[_0x1e51('0x27')](_0x71c7af,_0x1e51('0x25'));_0x3e6ef2[_0x1e51('0x2c')]=_[_0x1e51('0x2d')](_0x170ec6[_0x1e51('0x2c')]);_0x3e6ef2[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x3e6ef2['model'],_0x3e6ef2[_0x1e51('0x2c')]);_0x56722f[_0x1e51('0x30')]=_[_0x1e51('0x2f')](_0x3e6ef2[_0x1e51('0x2b')],qs[_0x1e51('0x31')](_0x170ec6['query'][_0x1e51('0x31')]));_0x56722f['attributes']=_0x56722f[_0x1e51('0x30')][_0x1e51('0x32')]?_0x56722f[_0x1e51('0x30')]:_0x3e6ef2['model'];if(!_0x170ec6[_0x1e51('0x2c')]['hasOwnProperty'](_0x1e51('0x33'))){_0x56722f['limit']=qs['limit'](_0x170ec6[_0x1e51('0x2c')][_0x1e51('0x1d')]);_0x56722f[_0x1e51('0x1c')]=qs['offset'](_0x170ec6[_0x1e51('0x2c')]['offset']);}_0x56722f[_0x1e51('0x34')]=qs[_0x1e51('0x35')](_0x170ec6['query'][_0x1e51('0x35')]);_0x56722f[_0x1e51('0x36')]=qs[_0x1e51('0x2e')](_[_0x1e51('0x37')](_0x170ec6[_0x1e51('0x2c')],_0x3e6ef2[_0x1e51('0x2e')]),_0x71c7af);if(_0x170ec6['query']['filter']){_0x56722f[_0x1e51('0x36')]=_['merge'](_0x56722f[_0x1e51('0x36')],{'$or':_[_0x1e51('0x27')](_0x71c7af,function(_0x32c41b){if(_0x32c41b[_0x1e51('0x29')]!==_0x1e51('0x38')){var _0x174a24={};_0x174a24[_0x32c41b[_0x1e51('0x25')]]={'$like':'%'+_0x170ec6[_0x1e51('0x2c')][_0x1e51('0x39')]+'%'};return _0x174a24;}})});}_0x56722f=_[_0x1e51('0x3a')]({},_0x56722f,_0x170ec6[_0x1e51('0x3b')]);var _0x5360b3={'where':_0x56722f[_0x1e51('0x36')]};return db['WhatsappQueueReport'][_0x1e51('0x1e')](_0x5360b3)[_0x1e51('0x23')](function(_0x2b287e){_0x10ee23[_0x1e51('0x1e')]=_0x2b287e;if(_0x170ec6[_0x1e51('0x2c')][_0x1e51('0x3c')]){_0x56722f[_0x1e51('0x3d')]=[{'all':!![]}];}return db[_0x1e51('0x3e')][_0x1e51('0x3f')](_0x56722f);})[_0x1e51('0x23')](function(_0xc40fce){_0x10ee23['rows']=_0xc40fce;return _0x10ee23;})['then'](respondWithFilteredResult(_0x1eb79f,_0x56722f))[_0x1e51('0x40')](handleError(_0x1eb79f,null));};exports[_0x1e51('0x41')]=function(_0x3be495,_0x4650e4){var _0x1ef3d3={'raw':!![],'where':{'id':_0x3be495[_0x1e51('0x42')]['id']}},_0x1a9e0d={};_0x1a9e0d[_0x1e51('0x2b')]=_['keys'](db[_0x1e51('0x3e')][_0x1e51('0x43')]);_0x1a9e0d[_0x1e51('0x2c')]=_[_0x1e51('0x2d')](_0x3be495[_0x1e51('0x2c')]);_0x1a9e0d[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x1a9e0d['model'],_0x1a9e0d[_0x1e51('0x2c')]);_0x1ef3d3[_0x1e51('0x30')]=_['intersection'](_0x1a9e0d[_0x1e51('0x2b')],qs[_0x1e51('0x31')](_0x3be495[_0x1e51('0x2c')]['fields']));_0x1ef3d3[_0x1e51('0x30')]=_0x1ef3d3[_0x1e51('0x30')][_0x1e51('0x32')]?_0x1ef3d3[_0x1e51('0x30')]:_0x1a9e0d[_0x1e51('0x2b')];if(_0x3be495[_0x1e51('0x2c')][_0x1e51('0x3c')]){_0x1ef3d3[_0x1e51('0x3d')]=[{'all':!![]}];}_0x1ef3d3=_[_0x1e51('0x3a')]({},_0x1ef3d3,_0x3be495['options']);return db[_0x1e51('0x3e')][_0x1e51('0x44')](_0x1ef3d3)['then'](handleEntityNotFound(_0x4650e4,null))[_0x1e51('0x23')](respondWithResult(_0x4650e4,null))[_0x1e51('0x40')](handleError(_0x4650e4,null));};exports[_0x1e51('0x45')]=function(_0x4f6405,_0x44468a){return db[_0x1e51('0x3e')][_0x1e51('0x45')](_0x4f6405['body'],{})[_0x1e51('0x23')](respondWithResult(_0x44468a,0xc9))['catch'](handleError(_0x44468a,null));};exports['update']=function(_0x54688b,_0x169e6c){if(_0x54688b[_0x1e51('0x46')]['id']){delete _0x54688b['body']['id'];}return db['WhatsappQueueReport'][_0x1e51('0x44')]({'where':{'id':_0x54688b[_0x1e51('0x42')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x169e6c,null))[_0x1e51('0x23')](saveUpdates(_0x54688b[_0x1e51('0x46')],null))[_0x1e51('0x23')](respondWithResult(_0x169e6c,null))['catch'](handleError(_0x169e6c,null));};exports[_0x1e51('0x47')]=function(_0x48a2d0,_0xf6bd35){return db[_0x1e51('0x3e')]['find']({'where':{'id':_0x48a2d0['params']['id']}})['then'](handleEntityNotFound(_0xf6bd35,null))[_0x1e51('0x23')](removeEntity(_0xf6bd35,null))[_0x1e51('0x40')](handleError(_0xf6bd35,null));};exports[_0x1e51('0x48')]=function(_0x4cdfe3,_0x2fdee1){return db[_0x1e51('0x3e')][_0x1e51('0x48')]()[_0x1e51('0x23')](respondWithResult(_0x2fdee1,null))[_0x1e51('0x40')](handleError(_0x2fdee1,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a05f787..bad21ea 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 _0x17f7=['rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfd0380,_0x20399b){var _0x54f7fd=function(_0x1edc8d){while(--_0x1edc8d){_0xfd0380['push'](_0xfd0380['shift']());}};_0x54f7fd(++_0x20399b);}(_0x17f7,0x77));var _0x717f=function(_0x4f4058,_0x2261ca){_0x4f4058=_0x4f4058-0x0;var _0x5c2789=_0x17f7[_0x4f4058];return _0x5c2789;};'use strict';var _=require('lodash');var util=require(_0x717f('0x0'));var logger=require(_0x717f('0x1'))(_0x717f('0x2'));var moment=require(_0x717f('0x3'));var BPromise=require(_0x717f('0x4'));var rp=require(_0x717f('0x5'));var fs=require('fs');var path=require(_0x717f('0x6'));var rimraf=require(_0x717f('0x7'));var config=require(_0x717f('0x8'));var attributes=require(_0x717f('0x9'));module[_0x717f('0xa')]=function(_0x4364d1,_0x151e00){return _0x4364d1['define'](_0x717f('0xb'),attributes,{'tableName':_0x717f('0xc'),'paranoid':![],'indexes':[{'name':_0x717f('0xd'),'fields':[_0x717f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafd4=['../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','api','moment','bluebird','path'];(function(_0x3d61d3,_0x1444c8){var _0x6da2ca=function(_0x35c422){while(--_0x35c422){_0x3d61d3['push'](_0x3d61d3['shift']());}};_0x6da2ca(++_0x1444c8);}(_0xafd4,0xc7));var _0x4afd=function(_0x5da112,_0x1c7f79){_0x5da112=_0x5da112-0x0;var _0x2cd57e=_0xafd4[_0x5da112];return _0x2cd57e;};'use strict';var _=require('lodash');var util=require(_0x4afd('0x0'));var logger=require('../../config/logger')(_0x4afd('0x1'));var moment=require(_0x4afd('0x2'));var BPromise=require(_0x4afd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4afd('0x4'));var rimraf=require('rimraf');var config=require(_0x4afd('0x5'));var attributes=require(_0x4afd('0x6'));module[_0x4afd('0x7')]=function(_0x3687e7,_0x5deae2){return _0x3687e7[_0x4afd('0x8')](_0x4afd('0x9'),attributes,{'tableName':_0x4afd('0xa'),'paranoid':![],'indexes':[{'name':_0x4afd('0xb'),'fields':[_0x4afd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 9f8aa64..4300500 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 _0x14f6=['../../config/environment','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateWhatsappQueueReport','create','body','options','info','stringify','catch','WhatsappQueueReport','update','raw','attributes','limit','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x14f6,0x1d8));var _0x614f=function(_0x54c71d,_0x346a53){_0x54c71d=_0x54c71d-0x0;var _0x10190c=_0x14f6[_0x54c71d];return _0x10190c;};'use strict';var _=require(_0x614f('0x0'));var util=require(_0x614f('0x1'));var moment=require('moment');var BPromise=require(_0x614f('0x2'));var rs=require(_0x614f('0x3'));var fs=require('fs');var Redis=require(_0x614f('0x4'));var db=require(_0x614f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x614f('0x6'))(_0x614f('0x7'));var config=require(_0x614f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x614f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5337f1,_0x47fc7d,_0x52a8ea){return new BPromise(function(_0x47e57e,_0x54630f){return client[_0x614f('0xa')](_0x5337f1,_0x52a8ea)[_0x614f('0xb')](function(_0x96a984){logger['info'](_0x614f('0xc'),_0x47fc7d,_0x614f('0xd'));logger[_0x614f('0xe')](_0x614f('0xf'),_0x47fc7d,_0x614f('0xd'),JSON['stringify'](_0x96a984));if(_0x96a984[_0x614f('0x10')]){if(_0x96a984[_0x614f('0x10')][_0x614f('0x11')]===0x1f4){logger[_0x614f('0x10')](_0x614f('0xc'),_0x47fc7d,_0x96a984[_0x614f('0x10')][_0x614f('0x12')]);return _0x54630f(_0x96a984[_0x614f('0x10')][_0x614f('0x12')]);}logger[_0x614f('0x10')](_0x614f('0xc'),_0x47fc7d,_0x96a984['error']['message']);return _0x47e57e(_0x96a984[_0x614f('0x10')][_0x614f('0x12')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x47fc7d,_0x614f('0xd'));_0x47e57e(_0x96a984['result'][_0x614f('0x12')]);}})['catch'](function(_0x219b61){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x47fc7d,_0x219b61);_0x54630f(_0x219b61);});});}exports[_0x614f('0x13')]=function(_0x22c573){var _0x7e3cae=this;return new Promise(function(_0x24039a,_0x41ce22){return db['WhatsappQueueReport'][_0x614f('0x14')](_0x22c573[_0x614f('0x15')],{'raw':_0x22c573[_0x614f('0x16')]?_0x22c573[_0x614f('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x37f216){logger[_0x614f('0x17')](_0x614f('0x13'),_0x22c573);logger[_0x614f('0xe')]('CreateWhatsappQueueReport',_0x22c573,JSON[_0x614f('0x18')](_0x37f216));_0x24039a(_0x37f216);})[_0x614f('0x19')](function(_0x4aa847){logger[_0x614f('0x10')]('CreateWhatsappQueueReport',_0x4aa847[_0x614f('0x12')],_0x22c573);_0x41ce22(_0x7e3cae[_0x614f('0x10')](0x1f4,_0x4aa847['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x582688){var _0x5a7eb9=this;return new Promise(function(_0x4c0649,_0x21c9c0){return db[_0x614f('0x1a')][_0x614f('0x1b')](_0x582688[_0x614f('0x15')],{'raw':_0x582688['options']?_0x582688['options'][_0x614f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x582688[_0x614f('0x16')]?_0x582688[_0x614f('0x16')]['where']||null:null,'attributes':_0x582688[_0x614f('0x16')]?_0x582688['options'][_0x614f('0x1d')]||null:null,'limit':_0x582688[_0x614f('0x16')]?_0x582688[_0x614f('0x16')][_0x614f('0x1e')]||null:null})[_0x614f('0xb')](function(_0x258757){logger['info'](_0x614f('0x1f'),_0x582688);logger[_0x614f('0xe')](_0x614f('0x1f'),_0x582688,JSON[_0x614f('0x18')](_0x258757));_0x4c0649(_0x258757);})[_0x614f('0x19')](function(_0xe8399){logger[_0x614f('0x10')]('UpdateWhatsappQueueReport',_0xe8399[_0x614f('0x12')],_0x582688);_0x21c9c0(_0x5a7eb9[_0x614f('0x10')](0x1f4,_0xe8399[_0x614f('0x12')]));});});}; \ No newline at end of file +var _0x574b=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','update','raw','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x574b,0x197));var _0xb574=function(_0x43d726,_0x55412f){_0x43d726=_0x43d726-0x0;var _0x4a864d=_0x574b[_0x43d726];return _0x4a864d;};'use strict';var _=require(_0xb574('0x0'));var util=require(_0xb574('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb574('0x2'));var fs=require('fs');var Redis=require(_0xb574('0x3'));var db=require(_0xb574('0x4'))['db'];var utils=require(_0xb574('0x5'));var logger=require(_0xb574('0x6'))(_0xb574('0x7'));var config=require(_0xb574('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb574('0x9')][_0xb574('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58991d,_0x24279b,_0x2b8822){return new BPromise(function(_0x3caef8,_0x4ab391){return client[_0xb574('0xb')](_0x58991d,_0x2b8822)[_0xb574('0xc')](function(_0x3db2b1){logger[_0xb574('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x24279b,_0xb574('0xe'));logger[_0xb574('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x24279b,_0xb574('0xe'),JSON[_0xb574('0x10')](_0x3db2b1));if(_0x3db2b1[_0xb574('0x11')]){if(_0x3db2b1[_0xb574('0x11')][_0xb574('0x12')]===0x1f4){logger[_0xb574('0x11')](_0xb574('0x13'),_0x24279b,_0x3db2b1[_0xb574('0x11')]['message']);return _0x4ab391(_0x3db2b1['error'][_0xb574('0x14')]);}logger[_0xb574('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x24279b,_0x3db2b1[_0xb574('0x11')][_0xb574('0x14')]);return _0x3caef8(_0x3db2b1[_0xb574('0x11')]['message']);}else{logger[_0xb574('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x24279b,_0xb574('0xe'));_0x3caef8(_0x3db2b1[_0xb574('0x15')][_0xb574('0x14')]);}})[_0xb574('0x16')](function(_0x507fb9){logger[_0xb574('0x11')](_0xb574('0x13'),_0x24279b,_0x507fb9);_0x4ab391(_0x507fb9);});});}exports[_0xb574('0x17')]=function(_0x32664c){var _0x1010c5=this;return new Promise(function(_0x3c5dc2,_0x1f1952){return db[_0xb574('0x18')][_0xb574('0x19')](_0x32664c[_0xb574('0x1a')],{'raw':_0x32664c[_0xb574('0x1b')]?_0x32664c[_0xb574('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xb574('0xc')](function(_0x2a0f01){logger[_0xb574('0xd')](_0xb574('0x17'),_0x32664c);logger['debug'](_0xb574('0x17'),_0x32664c,JSON[_0xb574('0x10')](_0x2a0f01));_0x3c5dc2(_0x2a0f01);})[_0xb574('0x16')](function(_0x5f5d99){logger[_0xb574('0x11')](_0xb574('0x17'),_0x5f5d99[_0xb574('0x14')],_0x32664c);_0x1f1952(_0x1010c5[_0xb574('0x11')](0x1f4,_0x5f5d99[_0xb574('0x14')]));});});};exports[_0xb574('0x1c')]=function(_0x4f8fe9){var _0x3861f7=this;return new Promise(function(_0x10e1cd,_0x2493eb){return db[_0xb574('0x18')][_0xb574('0x1d')](_0x4f8fe9[_0xb574('0x1a')],{'raw':_0x4f8fe9[_0xb574('0x1b')]?_0x4f8fe9['options'][_0xb574('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f8fe9['options']?_0x4f8fe9['options'][_0xb574('0x1f')]||null:null,'attributes':_0x4f8fe9[_0xb574('0x1b')]?_0x4f8fe9['options'][_0xb574('0x20')]||null:null,'limit':_0x4f8fe9['options']?_0x4f8fe9[_0xb574('0x1b')]['limit']||null:null})[_0xb574('0xc')](function(_0x8bfd25){logger['info']('UpdateWhatsappQueueReport',_0x4f8fe9);logger[_0xb574('0xf')](_0xb574('0x1c'),_0x4f8fe9,JSON[_0xb574('0x10')](_0x8bfd25));_0x10e1cd(_0x8bfd25);})[_0xb574('0x16')](function(_0x14c2bc){logger[_0xb574('0x11')](_0xb574('0x1c'),_0x14c2bc[_0xb574('0x14')],_0x4f8fe9);_0x2493eb(_0x3861f7[_0xb574('0x11')](0x1f4,_0x14c2bc[_0xb574('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index fff95b0..e2514a7 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 _0x03a4=['index','/describe','/:id','show','post','create','destroy','exports','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x03a4,0x1e8));var _0x403a=function(_0x326797,_0x39262a){_0x326797=_0x326797-0x0;var _0x4c2052=_0x03a4[_0x326797];return _0x4c2052;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x403a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x403a('0x1')]();var fs_extra=require(_0x403a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x403a('0x3'));var config=require(_0x403a('0x4'));var controller=require(_0x403a('0x5'));router[_0x403a('0x6')]('/',auth[_0x403a('0x7')](),controller[_0x403a('0x8')]);router['get'](_0x403a('0x9'),auth[_0x403a('0x7')](),controller['describe']);router[_0x403a('0x6')](_0x403a('0xa'),auth['isAuthenticated'](),controller[_0x403a('0xb')]);router[_0x403a('0xc')]('/',auth[_0x403a('0x7')](),controller[_0x403a('0xd')]);router['put']('/:id',auth[_0x403a('0x7')](),controller['update']);router['delete']('/:id',auth[_0x403a('0x7')](),controller[_0x403a('0xe')]);module[_0x403a('0xf')]=router; \ No newline at end of file +var _0xba6f=['./whatsappTransferReport.controller','isAuthenticated','index','/describe','post','create','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x319ff8,_0x45ca90){var _0x11d674=function(_0x2e8194){while(--_0x2e8194){_0x319ff8['push'](_0x319ff8['shift']());}};_0x11d674(++_0x45ca90);}(_0xba6f,0xbf));var _0xfba6=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xba6f[_0x1bbc08];return _0x5d825b;};'use strict';var multer=require(_0xfba6('0x0'));var util=require('util');var path=require(_0xfba6('0x1'));var timeout=require(_0xfba6('0x2'));var express=require(_0xfba6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfba6('0x4'));var interaction=require(_0xfba6('0x5'));var config=require(_0xfba6('0x6'));var controller=require(_0xfba6('0x7'));router['get']('/',auth[_0xfba6('0x8')](),controller[_0xfba6('0x9')]);router['get'](_0xfba6('0xa'),auth[_0xfba6('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfba6('0xb')]('/',auth[_0xfba6('0x8')](),controller[_0xfba6('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfba6('0xd')]);router[_0xfba6('0xe')](_0xfba6('0xf'),auth[_0xfba6('0x8')](),controller[_0xfba6('0x10')]);module[_0xfba6('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index a55b8a7..485514f 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 _0x8f4c=['agent','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8f4c,0x113));var _0xc8f4=function(_0x29db25,_0x457467){_0x29db25=_0x29db25-0x0;var _0x48b1a5=_0x8f4c[_0x29db25];return _0x48b1a5;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'uniqueid':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc8f4('0x3')](_0xc8f4('0x4'),_0xc8f4('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc8f4('0x6')]}}; \ No newline at end of file +var _0x5276=['DATE','STRING','ENUM','account','agent','queue'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5276,0x163));var _0x6527=function(_0x438b19,_0x460481){_0x438b19=_0x438b19-0x0;var _0x5d90f1=_0x5276[_0x438b19];return _0x5d90f1;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6527('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x6527('0x1')](_0x6527('0x2'),_0x6527('0x3'),_0x6527('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6527('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 2cdd8bb..e79b935 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 _0x9a0c=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','WhatsappTransferReport','includeAll','include','rows','params','keys','fields','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3b4455,_0x3e4395){var _0x34dd09=function(_0x5006d3){while(--_0x5006d3){_0x3b4455['push'](_0x3b4455['shift']());}};_0x34dd09(++_0x3e4395);}(_0x9a0c,0x8b));var _0xc9a0=function(_0x399a24,_0x17d1e2){_0x399a24=_0x399a24-0x0;var _0x244d54=_0x9a0c[_0x399a24];return _0x244d54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9a0('0x0'));var zipdir=require(_0xc9a0('0x1'));var jsonpatch=require(_0xc9a0('0x2'));var rp=require(_0xc9a0('0x3'));var moment=require(_0xc9a0('0x4'));var BPromise=require(_0xc9a0('0x5'));var Mustache=require(_0xc9a0('0x6'));var util=require(_0xc9a0('0x7'));var path=require(_0xc9a0('0x8'));var sox=require(_0xc9a0('0x9'));var csv=require('to-csv');var ejs=require(_0xc9a0('0xa'));var fs=require('fs');var fs_extra=require(_0xc9a0('0xb'));var _=require(_0xc9a0('0xc'));var squel=require('squel');var crypto=require(_0xc9a0('0xd'));var jsforce=require(_0xc9a0('0xe'));var deskjs=require(_0xc9a0('0xf'));var toCsv=require(_0xc9a0('0x10'));var querystring=require(_0xc9a0('0x11'));var Papa=require(_0xc9a0('0x12'));var Redis=require(_0xc9a0('0x13'));var authService=require(_0xc9a0('0x14'));var qs=require(_0xc9a0('0x15'));var as=require(_0xc9a0('0x16'));var hardwareService=require(_0xc9a0('0x17'));var logger=require(_0xc9a0('0x18'))(_0xc9a0('0x19'));var utils=require(_0xc9a0('0x1a'));var config=require(_0xc9a0('0x1b'));var licenseUtil=require(_0xc9a0('0x1c'));var db=require(_0xc9a0('0x1d'))['db'];function respondWithStatusCode(_0x2d3243,_0x128f93){_0x128f93=_0x128f93||0xcc;return function(_0x333301){if(_0x333301){return _0x2d3243[_0xc9a0('0x1e')](_0x128f93);}return _0x2d3243[_0xc9a0('0x1f')](_0x128f93)[_0xc9a0('0x20')]();};}function respondWithResult(_0x46fece,_0x4f273d){_0x4f273d=_0x4f273d||0xc8;return function(_0x200fad){if(_0x200fad){return _0x46fece[_0xc9a0('0x1f')](_0x4f273d)['json'](_0x200fad);}};}function respondWithFilteredResult(_0x3216fd,_0x2a0459){return function(_0x1b7ae4){if(_0x1b7ae4){var _0x44237f=typeof _0x2a0459['offset']===_0xc9a0('0x21')&&typeof _0x2a0459[_0xc9a0('0x22')]==='undefined';var _0x3cb9f6=_0x1b7ae4['count'];var _0x1048b4=_0x44237f?0x0:_0x2a0459[_0xc9a0('0x23')];var _0x3ad0fb=_0x44237f?_0x1b7ae4[_0xc9a0('0x24')]:_0x2a0459['offset']+_0x2a0459['limit'];var _0x18a632;if(_0x3ad0fb>=_0x3cb9f6){_0x3ad0fb=_0x3cb9f6;_0x18a632=0xc8;}else{_0x18a632=0xce;}_0x3216fd[_0xc9a0('0x1f')](_0x18a632);return _0x3216fd[_0xc9a0('0x25')](_0xc9a0('0x26'),_0x1048b4+'-'+_0x3ad0fb+'/'+_0x3cb9f6)[_0xc9a0('0x27')](_0x1b7ae4);}return null;};}function patchUpdates(_0x452e05){return function(_0x36cc9d){try{jsonpatch[_0xc9a0('0x28')](_0x36cc9d,_0x452e05,!![]);}catch(_0x2b693c){return BPromise[_0xc9a0('0x29')](_0x2b693c);}return _0x36cc9d[_0xc9a0('0x2a')]();};}function saveUpdates(_0x2beced,_0x18e2a1){return function(_0x668d3d){if(_0x668d3d){return _0x668d3d[_0xc9a0('0x2b')](_0x2beced)['then'](function(_0x4b8ad8){return _0x4b8ad8;});}return null;};}function removeEntity(_0x1e5834,_0x2722b9){return function(_0x16bf19){if(_0x16bf19){return _0x16bf19['destroy']()[_0xc9a0('0x2c')](function(){_0x1e5834[_0xc9a0('0x1f')](0xcc)[_0xc9a0('0x20')]();});}};}function handleEntityNotFound(_0x3a7508,_0x544b07){return function(_0x14857f){if(!_0x14857f){_0x3a7508[_0xc9a0('0x1e')](0x194);}return _0x14857f;};}function handleError(_0x1ef98a,_0x1eea0b){_0x1eea0b=_0x1eea0b||0x1f4;return function(_0x3a3e22){logger[_0xc9a0('0x2d')](_0x3a3e22[_0xc9a0('0x2e')]);if(_0x3a3e22[_0xc9a0('0x2f')]){delete _0x3a3e22['name'];}_0x1ef98a[_0xc9a0('0x1f')](_0x1eea0b)[_0xc9a0('0x30')](_0x3a3e22);};}exports[_0xc9a0('0x31')]=function(_0x426b7a,_0x46dd19){var _0x2fc335={},_0x3f6892={},_0x54f414={'count':0x0,'rows':[]};var _0x209187=_[_0xc9a0('0x32')](db['WhatsappTransferReport'][_0xc9a0('0x33')],function(_0x205297){return{'name':_0x205297['fieldName'],'type':_0x205297[_0xc9a0('0x34')][_0xc9a0('0x35')]};});_0x3f6892['model']=_[_0xc9a0('0x32')](_0x209187,'name');_0x3f6892[_0xc9a0('0x36')]=_['keys'](_0x426b7a[_0xc9a0('0x36')]);_0x3f6892[_0xc9a0('0x37')]=_[_0xc9a0('0x38')](_0x3f6892[_0xc9a0('0x39')],_0x3f6892['query']);_0x2fc335[_0xc9a0('0x3a')]=_[_0xc9a0('0x38')](_0x3f6892[_0xc9a0('0x39')],qs['fields'](_0x426b7a[_0xc9a0('0x36')]['fields']));_0x2fc335['attributes']=_0x2fc335['attributes'][_0xc9a0('0x3b')]?_0x2fc335[_0xc9a0('0x3a')]:_0x3f6892['model'];if(!_0x426b7a[_0xc9a0('0x36')][_0xc9a0('0x3c')](_0xc9a0('0x3d'))){_0x2fc335[_0xc9a0('0x22')]=qs[_0xc9a0('0x22')](_0x426b7a[_0xc9a0('0x36')][_0xc9a0('0x22')]);_0x2fc335[_0xc9a0('0x23')]=qs[_0xc9a0('0x23')](_0x426b7a[_0xc9a0('0x36')][_0xc9a0('0x23')]);}_0x2fc335['order']=qs['sort'](_0x426b7a[_0xc9a0('0x36')][_0xc9a0('0x3e')]);_0x2fc335[_0xc9a0('0x3f')]=qs[_0xc9a0('0x37')](_[_0xc9a0('0x40')](_0x426b7a[_0xc9a0('0x36')],_0x3f6892[_0xc9a0('0x37')]),_0x209187);if(_0x426b7a[_0xc9a0('0x36')]['filter']){_0x2fc335[_0xc9a0('0x3f')]=_[_0xc9a0('0x41')](_0x2fc335[_0xc9a0('0x3f')],{'$or':_['map'](_0x209187,function(_0x3c8fbf){if(_0x3c8fbf[_0xc9a0('0x34')]!==_0xc9a0('0x42')){var _0x4d98e7={};_0x4d98e7[_0x3c8fbf[_0xc9a0('0x2f')]]={'$like':'%'+_0x426b7a[_0xc9a0('0x36')][_0xc9a0('0x43')]+'%'};return _0x4d98e7;}})});}_0x2fc335=_[_0xc9a0('0x41')]({},_0x2fc335,_0x426b7a['options']);var _0x32a6c5={'where':_0x2fc335[_0xc9a0('0x3f')]};return db[_0xc9a0('0x44')][_0xc9a0('0x24')](_0x32a6c5)[_0xc9a0('0x2c')](function(_0x10bf0a){_0x54f414[_0xc9a0('0x24')]=_0x10bf0a;if(_0x426b7a[_0xc9a0('0x36')][_0xc9a0('0x45')]){_0x2fc335[_0xc9a0('0x46')]=[{'all':!![]}];}return db[_0xc9a0('0x44')]['findAll'](_0x2fc335);})[_0xc9a0('0x2c')](function(_0x28e513){_0x54f414[_0xc9a0('0x47')]=_0x28e513;return _0x54f414;})[_0xc9a0('0x2c')](respondWithFilteredResult(_0x46dd19,_0x2fc335))['catch'](handleError(_0x46dd19,null));};exports['show']=function(_0x4c4d15,_0x422ae4){var _0x5a7b7d={'raw':!![],'where':{'id':_0x4c4d15[_0xc9a0('0x48')]['id']}},_0x30373d={};_0x30373d[_0xc9a0('0x39')]=_[_0xc9a0('0x49')](db[_0xc9a0('0x44')][_0xc9a0('0x33')]);_0x30373d['query']=_['keys'](_0x4c4d15['query']);_0x30373d[_0xc9a0('0x37')]=_['intersection'](_0x30373d['model'],_0x30373d[_0xc9a0('0x36')]);_0x5a7b7d[_0xc9a0('0x3a')]=_[_0xc9a0('0x38')](_0x30373d[_0xc9a0('0x39')],qs[_0xc9a0('0x4a')](_0x4c4d15['query'][_0xc9a0('0x4a')]));_0x5a7b7d[_0xc9a0('0x3a')]=_0x5a7b7d['attributes']['length']?_0x5a7b7d[_0xc9a0('0x3a')]:_0x30373d[_0xc9a0('0x39')];if(_0x4c4d15[_0xc9a0('0x36')][_0xc9a0('0x45')]){_0x5a7b7d[_0xc9a0('0x46')]=[{'all':!![]}];}_0x5a7b7d=_[_0xc9a0('0x41')]({},_0x5a7b7d,_0x4c4d15[_0xc9a0('0x4b')]);return db[_0xc9a0('0x44')][_0xc9a0('0x4c')](_0x5a7b7d)[_0xc9a0('0x2c')](handleEntityNotFound(_0x422ae4,null))['then'](respondWithResult(_0x422ae4,null))[_0xc9a0('0x4d')](handleError(_0x422ae4,null));};exports[_0xc9a0('0x4e')]=function(_0x2176e7,_0x41aa16){return db['WhatsappTransferReport'][_0xc9a0('0x4e')](_0x2176e7[_0xc9a0('0x4f')],{})[_0xc9a0('0x2c')](respondWithResult(_0x41aa16,0xc9))[_0xc9a0('0x4d')](handleError(_0x41aa16,null));};exports[_0xc9a0('0x2b')]=function(_0x67301c,_0x3040b3){if(_0x67301c[_0xc9a0('0x4f')]['id']){delete _0x67301c[_0xc9a0('0x4f')]['id'];}return db['WhatsappTransferReport'][_0xc9a0('0x4c')]({'where':{'id':_0x67301c['params']['id']}})[_0xc9a0('0x2c')](handleEntityNotFound(_0x3040b3,null))[_0xc9a0('0x2c')](saveUpdates(_0x67301c[_0xc9a0('0x4f')],null))['then'](respondWithResult(_0x3040b3,null))[_0xc9a0('0x4d')](handleError(_0x3040b3,null));};exports[_0xc9a0('0x50')]=function(_0xc51603,_0x1a50f0){return db[_0xc9a0('0x44')][_0xc9a0('0x4c')]({'where':{'id':_0xc51603[_0xc9a0('0x48')]['id']}})[_0xc9a0('0x2c')](handleEntityNotFound(_0x1a50f0,null))[_0xc9a0('0x2c')](removeEntity(_0x1a50f0,null))[_0xc9a0('0x4d')](handleError(_0x1a50f0,null));};exports['describe']=function(_0x2bcfcf,_0x54cce8){return db[_0xc9a0('0x44')][_0xc9a0('0x51')]()['then'](respondWithResult(_0x54cce8,null))[_0xc9a0('0x4d')](handleError(_0x54cce8,null));}; \ No newline at end of file +var _0xe3bb=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','error','name','send','index','map','WhatsappTransferReport','fieldName','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','then','includeAll','include','findAll','rows','show','params','keys','model','length','find','catch','create','body','destroy','describe'];(function(_0x5f0cab,_0x57c4a6){var _0x4de8b8=function(_0xdbf96f){while(--_0xdbf96f){_0x5f0cab['push'](_0x5f0cab['shift']());}};_0x4de8b8(++_0x57c4a6);}(_0xe3bb,0x1c8));var _0xbe3b=function(_0x353898,_0x3dd5fb){_0x353898=_0x353898-0x0;var _0x19275f=_0xe3bb[_0x353898];return _0x19275f;};'use strict';var emlformat=require(_0xbe3b('0x0'));var rimraf=require(_0xbe3b('0x1'));var zipdir=require(_0xbe3b('0x2'));var jsonpatch=require(_0xbe3b('0x3'));var rp=require(_0xbe3b('0x4'));var moment=require('moment');var BPromise=require(_0xbe3b('0x5'));var Mustache=require(_0xbe3b('0x6'));var util=require(_0xbe3b('0x7'));var path=require(_0xbe3b('0x8'));var sox=require(_0xbe3b('0x9'));var csv=require(_0xbe3b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe3b('0xb'));var _=require(_0xbe3b('0xc'));var squel=require('squel');var crypto=require(_0xbe3b('0xd'));var jsforce=require(_0xbe3b('0xe'));var deskjs=require(_0xbe3b('0xf'));var toCsv=require(_0xbe3b('0xa'));var querystring=require(_0xbe3b('0x10'));var Papa=require('papaparse');var Redis=require(_0xbe3b('0x11'));var authService=require(_0xbe3b('0x12'));var qs=require(_0xbe3b('0x13'));var as=require(_0xbe3b('0x14'));var hardwareService=require(_0xbe3b('0x15'));var logger=require(_0xbe3b('0x16'))(_0xbe3b('0x17'));var utils=require('../../config/utils');var config=require(_0xbe3b('0x18'));var licenseUtil=require(_0xbe3b('0x19'));var db=require(_0xbe3b('0x1a'))['db'];function respondWithStatusCode(_0x1023d3,_0x5da8da){_0x5da8da=_0x5da8da||0xcc;return function(_0x1c668e){if(_0x1c668e){return _0x1023d3[_0xbe3b('0x1b')](_0x5da8da);}return _0x1023d3[_0xbe3b('0x1c')](_0x5da8da)[_0xbe3b('0x1d')]();};}function respondWithResult(_0x31602e,_0x55e458){_0x55e458=_0x55e458||0xc8;return function(_0x693839){if(_0x693839){return _0x31602e[_0xbe3b('0x1c')](_0x55e458)[_0xbe3b('0x1e')](_0x693839);}};}function respondWithFilteredResult(_0x2d268e,_0x30c9ce){return function(_0x585c22){if(_0x585c22){var _0x4498ce=typeof _0x30c9ce[_0xbe3b('0x1f')]==='undefined'&&typeof _0x30c9ce[_0xbe3b('0x20')]===_0xbe3b('0x21');var _0x4276b0=_0x585c22['count'];var _0x3383f4=_0x4498ce?0x0:_0x30c9ce[_0xbe3b('0x1f')];var _0x965e42=_0x4498ce?_0x585c22[_0xbe3b('0x22')]:_0x30c9ce['offset']+_0x30c9ce[_0xbe3b('0x20')];var _0x33b10f;if(_0x965e42>=_0x4276b0){_0x965e42=_0x4276b0;_0x33b10f=0xc8;}else{_0x33b10f=0xce;}_0x2d268e[_0xbe3b('0x1c')](_0x33b10f);return _0x2d268e[_0xbe3b('0x23')]('Content-Range',_0x3383f4+'-'+_0x965e42+'/'+_0x4276b0)['json'](_0x585c22);}return null;};}function patchUpdates(_0x2111bf){return function(_0x296512){try{jsonpatch['apply'](_0x296512,_0x2111bf,!![]);}catch(_0x56957c){return BPromise[_0xbe3b('0x24')](_0x56957c);}return _0x296512[_0xbe3b('0x25')]();};}function saveUpdates(_0x56debc,_0x598933){return function(_0x45bb96){if(_0x45bb96){return _0x45bb96[_0xbe3b('0x26')](_0x56debc)['then'](function(_0x1e6376){return _0x1e6376;});}return null;};}function removeEntity(_0x59fd57,_0x15c508){return function(_0x40d8ff){if(_0x40d8ff){return _0x40d8ff['destroy']()['then'](function(){_0x59fd57[_0xbe3b('0x1c')](0xcc)[_0xbe3b('0x1d')]();});}};}function handleEntityNotFound(_0x3d81c3,_0x4b2ed1){return function(_0x5878d7){if(!_0x5878d7){_0x3d81c3[_0xbe3b('0x1b')](0x194);}return _0x5878d7;};}function handleError(_0x3d17d2,_0x3088de){_0x3088de=_0x3088de||0x1f4;return function(_0x408e82){logger[_0xbe3b('0x27')](_0x408e82['stack']);if(_0x408e82[_0xbe3b('0x28')]){delete _0x408e82[_0xbe3b('0x28')];}_0x3d17d2['status'](_0x3088de)[_0xbe3b('0x29')](_0x408e82);};}exports[_0xbe3b('0x2a')]=function(_0x540a1d,_0x1d068d){var _0x88b6cd={},_0x5a9405={},_0x42449c={'count':0x0,'rows':[]};var _0x3020e6=_[_0xbe3b('0x2b')](db[_0xbe3b('0x2c')]['rawAttributes'],function(_0x5ed6b8){return{'name':_0x5ed6b8[_0xbe3b('0x2d')],'type':_0x5ed6b8['type']['key']};});_0x5a9405['model']=_[_0xbe3b('0x2b')](_0x3020e6,_0xbe3b('0x28'));_0x5a9405[_0xbe3b('0x2e')]=_['keys'](_0x540a1d['query']);_0x5a9405['filters']=_[_0xbe3b('0x2f')](_0x5a9405['model'],_0x5a9405[_0xbe3b('0x2e')]);_0x88b6cd['attributes']=_[_0xbe3b('0x2f')](_0x5a9405['model'],qs[_0xbe3b('0x30')](_0x540a1d[_0xbe3b('0x2e')][_0xbe3b('0x30')]));_0x88b6cd[_0xbe3b('0x31')]=_0x88b6cd[_0xbe3b('0x31')]['length']?_0x88b6cd[_0xbe3b('0x31')]:_0x5a9405['model'];if(!_0x540a1d[_0xbe3b('0x2e')]['hasOwnProperty'](_0xbe3b('0x32'))){_0x88b6cd['limit']=qs['limit'](_0x540a1d[_0xbe3b('0x2e')][_0xbe3b('0x20')]);_0x88b6cd[_0xbe3b('0x1f')]=qs[_0xbe3b('0x1f')](_0x540a1d[_0xbe3b('0x2e')][_0xbe3b('0x1f')]);}_0x88b6cd[_0xbe3b('0x33')]=qs[_0xbe3b('0x34')](_0x540a1d[_0xbe3b('0x2e')][_0xbe3b('0x34')]);_0x88b6cd[_0xbe3b('0x35')]=qs[_0xbe3b('0x36')](_[_0xbe3b('0x37')](_0x540a1d[_0xbe3b('0x2e')],_0x5a9405['filters']),_0x3020e6);if(_0x540a1d[_0xbe3b('0x2e')][_0xbe3b('0x38')]){_0x88b6cd[_0xbe3b('0x35')]=_[_0xbe3b('0x39')](_0x88b6cd['where'],{'$or':_[_0xbe3b('0x2b')](_0x3020e6,function(_0x5c661b){if(_0x5c661b[_0xbe3b('0x3a')]!==_0xbe3b('0x3b')){var _0x4bf327={};_0x4bf327[_0x5c661b[_0xbe3b('0x28')]]={'$like':'%'+_0x540a1d[_0xbe3b('0x2e')][_0xbe3b('0x38')]+'%'};return _0x4bf327;}})});}_0x88b6cd=_['merge']({},_0x88b6cd,_0x540a1d['options']);var _0xc5228={'where':_0x88b6cd[_0xbe3b('0x35')]};return db[_0xbe3b('0x2c')][_0xbe3b('0x22')](_0xc5228)[_0xbe3b('0x3c')](function(_0x147fc6){_0x42449c[_0xbe3b('0x22')]=_0x147fc6;if(_0x540a1d[_0xbe3b('0x2e')][_0xbe3b('0x3d')]){_0x88b6cd[_0xbe3b('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xbe3b('0x3f')](_0x88b6cd);})['then'](function(_0x1b195c){_0x42449c[_0xbe3b('0x40')]=_0x1b195c;return _0x42449c;})['then'](respondWithFilteredResult(_0x1d068d,_0x88b6cd))['catch'](handleError(_0x1d068d,null));};exports[_0xbe3b('0x41')]=function(_0x1cdcd6,_0x4acb12){var _0x32ef78={'raw':!![],'where':{'id':_0x1cdcd6[_0xbe3b('0x42')]['id']}},_0x3accda={};_0x3accda['model']=_['keys'](db['WhatsappTransferReport']['rawAttributes']);_0x3accda[_0xbe3b('0x2e')]=_[_0xbe3b('0x43')](_0x1cdcd6[_0xbe3b('0x2e')]);_0x3accda[_0xbe3b('0x36')]=_['intersection'](_0x3accda['model'],_0x3accda[_0xbe3b('0x2e')]);_0x32ef78[_0xbe3b('0x31')]=_['intersection'](_0x3accda[_0xbe3b('0x44')],qs[_0xbe3b('0x30')](_0x1cdcd6[_0xbe3b('0x2e')][_0xbe3b('0x30')]));_0x32ef78[_0xbe3b('0x31')]=_0x32ef78[_0xbe3b('0x31')][_0xbe3b('0x45')]?_0x32ef78[_0xbe3b('0x31')]:_0x3accda[_0xbe3b('0x44')];if(_0x1cdcd6[_0xbe3b('0x2e')]['includeAll']){_0x32ef78[_0xbe3b('0x3e')]=[{'all':!![]}];}_0x32ef78=_[_0xbe3b('0x39')]({},_0x32ef78,_0x1cdcd6['options']);return db[_0xbe3b('0x2c')][_0xbe3b('0x46')](_0x32ef78)[_0xbe3b('0x3c')](handleEntityNotFound(_0x4acb12,null))[_0xbe3b('0x3c')](respondWithResult(_0x4acb12,null))[_0xbe3b('0x47')](handleError(_0x4acb12,null));};exports[_0xbe3b('0x48')]=function(_0x575b9d,_0x2e2faa){return db[_0xbe3b('0x2c')][_0xbe3b('0x48')](_0x575b9d['body'],{})[_0xbe3b('0x3c')](respondWithResult(_0x2e2faa,0xc9))[_0xbe3b('0x47')](handleError(_0x2e2faa,null));};exports[_0xbe3b('0x26')]=function(_0x438e9e,_0x30e4a2){if(_0x438e9e[_0xbe3b('0x49')]['id']){delete _0x438e9e[_0xbe3b('0x49')]['id'];}return db[_0xbe3b('0x2c')][_0xbe3b('0x46')]({'where':{'id':_0x438e9e[_0xbe3b('0x42')]['id']}})[_0xbe3b('0x3c')](handleEntityNotFound(_0x30e4a2,null))[_0xbe3b('0x3c')](saveUpdates(_0x438e9e[_0xbe3b('0x49')],null))[_0xbe3b('0x3c')](respondWithResult(_0x30e4a2,null))[_0xbe3b('0x47')](handleError(_0x30e4a2,null));};exports[_0xbe3b('0x4a')]=function(_0x2e3fba,_0x4e3d3a){return db[_0xbe3b('0x2c')][_0xbe3b('0x46')]({'where':{'id':_0x2e3fba[_0xbe3b('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e3d3a,null))[_0xbe3b('0x3c')](removeEntity(_0x4e3d3a,null))[_0xbe3b('0x47')](handleError(_0x4e3d3a,null));};exports['describe']=function(_0x1e2328,_0x3428bb){return db['WhatsappTransferReport'][_0xbe3b('0x4b')]()[_0xbe3b('0x3c')](respondWithResult(_0x3428bb,null))[_0xbe3b('0x47')](handleError(_0x3428bb,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 90466b1..1a13722 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 _0xd9ce=['uniqueid','util','moment','bluebird','request-promise','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x46d100,_0x1397e5){var _0x397408=function(_0x21001d){while(--_0x21001d){_0x46d100['push'](_0x46d100['shift']());}};_0x397408(++_0x1397e5);}(_0xd9ce,0x1d7));var _0xed9c=function(_0x1f7a00,_0x341591){_0x1f7a00=_0x1f7a00-0x0;var _0x4b151c=_0xd9ce[_0x1f7a00];return _0x4b151c;};'use strict';var _=require('lodash');var util=require(_0xed9c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xed9c('0x1'));var BPromise=require(_0xed9c('0x2'));var rp=require(_0xed9c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed9c('0x4'));var config=require('../../config/environment');var attributes=require(_0xed9c('0x5'));module[_0xed9c('0x6')]=function(_0x35eee4,_0x1ce59c){return _0x35eee4[_0xed9c('0x7')](_0xed9c('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xed9c('0x9'),'fields':[_0xed9c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9a0=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','WhatsappTransferReport'];(function(_0x13225b,_0x2f1e95){var _0x16c39a=function(_0x397d19){while(--_0x397d19){_0x13225b['push'](_0x13225b['shift']());}};_0x16c39a(++_0x2f1e95);}(_0xa9a0,0x13a));var _0x0a9a=function(_0x257c10,_0x92b66e){_0x257c10=_0x257c10-0x0;var _0x255e43=_0xa9a0[_0x257c10];return _0x255e43;};'use strict';var _=require(_0x0a9a('0x0'));var util=require(_0x0a9a('0x1'));var logger=require(_0x0a9a('0x2'))('api');var moment=require(_0x0a9a('0x3'));var BPromise=require(_0x0a9a('0x4'));var rp=require(_0x0a9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0a9a('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x0a9a('0x7')]=function(_0x3c7516,_0x4deca5){return _0x3c7516[_0x0a9a('0x8')](_0x0a9a('0x9'),attributes,{'tableName':_0x0a9a('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 764db1e..ce303cb 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 _0x245b=['WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x315aea,_0x318a80){var _0x4a4bdb=function(_0x7c049c){while(--_0x7c049c){_0x315aea['push'](_0x315aea['shift']());}};_0x4a4bdb(++_0x318a80);}(_0x245b,0x7c));var _0xb245=function(_0x24c48f,_0x527415){_0x24c48f=_0x24c48f-0x0;var _0x2b91d7=_0x245b[_0x24c48f];return _0x2b91d7;};'use strict';var _=require(_0xb245('0x0'));var util=require(_0xb245('0x1'));var moment=require('moment');var BPromise=require(_0xb245('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb245('0x3'));var db=require(_0xb245('0x4'))['db'];var utils=require(_0xb245('0x5'));var logger=require(_0xb245('0x6'))(_0xb245('0x7'));var config=require(_0xb245('0x8'));var jayson=require(_0xb245('0x9'));var client=jayson[_0xb245('0xa')][_0xb245('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57dadc,_0x4cc8cb,_0x17a8ba){return new BPromise(function(_0x13e916,_0x2620a9){return client[_0xb245('0xc')](_0x57dadc,_0x17a8ba)[_0xb245('0xd')](function(_0x474396){logger[_0xb245('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4cc8cb,_0xb245('0xf'));logger[_0xb245('0x10')](_0xb245('0x11'),_0x4cc8cb,_0xb245('0xf'),JSON['stringify'](_0x474396));if(_0x474396['error']){if(_0x474396['error'][_0xb245('0x12')]===0x1f4){logger[_0xb245('0x13')](_0xb245('0x14'),_0x4cc8cb,_0x474396[_0xb245('0x13')][_0xb245('0x15')]);return _0x2620a9(_0x474396['error']['message']);}logger[_0xb245('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4cc8cb,_0x474396[_0xb245('0x13')][_0xb245('0x15')]);return _0x13e916(_0x474396['error'][_0xb245('0x15')]);}else{logger['info'](_0xb245('0x14'),_0x4cc8cb,'request\x20sent');_0x13e916(_0x474396[_0xb245('0x16')][_0xb245('0x15')]);}})[_0xb245('0x17')](function(_0x4eca15){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x4cc8cb,_0x4eca15);_0x2620a9(_0x4eca15);});});} \ No newline at end of file +var _0xe883=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1b383f,_0x7aa189){var _0x494e55=function(_0x5ae072){while(--_0x5ae072){_0x1b383f['push'](_0x1b383f['shift']());}};_0x494e55(++_0x7aa189);}(_0xe883,0x14a));var _0x3e88=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xe883[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x3e88('0x0'));var util=require(_0x3e88('0x1'));var moment=require(_0x3e88('0x2'));var BPromise=require(_0x3e88('0x3'));var rs=require(_0x3e88('0x4'));var fs=require('fs');var Redis=require(_0x3e88('0x5'));var db=require(_0x3e88('0x6'))['db'];var utils=require(_0x3e88('0x7'));var logger=require('../../config/logger')(_0x3e88('0x8'));var config=require(_0x3e88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3e88('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29101f,_0x1ed996,_0x5b6c08){return new BPromise(function(_0x8855ab,_0x527875){return client[_0x3e88('0xb')](_0x29101f,_0x5b6c08)[_0x3e88('0xc')](function(_0x5dcf9c){logger[_0x3e88('0xd')](_0x3e88('0xe'),_0x1ed996,_0x3e88('0xf'));logger[_0x3e88('0x10')](_0x3e88('0x11'),_0x1ed996,_0x3e88('0xf'),JSON[_0x3e88('0x12')](_0x5dcf9c));if(_0x5dcf9c[_0x3e88('0x13')]){if(_0x5dcf9c[_0x3e88('0x13')][_0x3e88('0x14')]===0x1f4){logger[_0x3e88('0x13')](_0x3e88('0xe'),_0x1ed996,_0x5dcf9c[_0x3e88('0x13')][_0x3e88('0x15')]);return _0x527875(_0x5dcf9c[_0x3e88('0x13')][_0x3e88('0x15')]);}logger[_0x3e88('0x13')](_0x3e88('0xe'),_0x1ed996,_0x5dcf9c[_0x3e88('0x13')][_0x3e88('0x15')]);return _0x8855ab(_0x5dcf9c[_0x3e88('0x13')][_0x3e88('0x15')]);}else{logger[_0x3e88('0xd')](_0x3e88('0xe'),_0x1ed996,_0x3e88('0xf'));_0x8855ab(_0x5dcf9c[_0x3e88('0x16')]['message']);}})[_0x3e88('0x17')](function(_0x35de0b){logger[_0x3e88('0x13')](_0x3e88('0xe'),_0x1ed996,_0x35de0b);_0x527875(_0x35de0b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 12f807c..7b2d5c8 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8112=['info','start','Online\x20apps:','name','Offline\x20apps:','map','status','join','seedDB','./config/seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen'];(function(_0x29fa50,_0x463a30){var _0x48e79a=function(_0x54dbf1){while(--_0x54dbf1){_0x29fa50['push'](_0x29fa50['shift']());}};_0x48e79a(++_0x463a30);}(_0x8112,0x1a2));var _0x2811=function(_0x456be1,_0x248c6e){_0x456be1=_0x456be1-0x0;var _0x43fa66=_0x8112[_0x456be1];return _0x43fa66;};'use strict';var _=require('lodash');var mysqldb=require(_0x2811('0x0'));var rpc=require(_0x2811('0x1'));var config=require(_0x2811('0x2'));var logger=require('./config/logger')(_0x2811('0x3'));var pm2=require(_0x2811('0x4'));var pm2Config=require(_0x2811('0x5'));var schedule=require(_0x2811('0x6'));var chat=require(_0x2811('0x7'));var whatsapp=require(_0x2811('0x8'));var transcribe=require(_0x2811('0x9'));function main(){return mysqldb['db'][_0x2811('0xa')][_0x2811('0xb')]()[_0x2811('0xc')](function(){return rpc[_0x2811('0xd')]();})['then'](function(_0x2cc2d8){logger[_0x2811('0xe')](_0x2cc2d8);return chat[_0x2811('0xf')]();})[_0x2811('0xc')](function(){return whatsapp[_0x2811('0xf')]();})['then'](function(){return schedule[_0x2811('0xf')]();})['then'](function(){return transcribe[_0x2811('0xf')]();})[_0x2811('0xc')](function(_0x55f8f7){logger[_0x2811('0xe')](_0x55f8f7);return pm2['start'](pm2Config);})['then'](function(_0x243924){logger['info'](_0x2811('0x10'),_['map'](_['filter'](_0x243924,{'status':'online'}),_0x2811('0x11'))['join']());logger[_0x2811('0xe')](_0x2811('0x12'),_[_0x2811('0x13')](_['filter'](_0x243924,function(_0x3da405){return _0x3da405[_0x2811('0x14')]!=='online';}),_0x2811('0x11'))[_0x2811('0x15')]()||'None');config[_0x2811('0x16')]&&require(_0x2811('0x17'))[_0x2811('0x18')]();require('./config/license')['default']();})[_0x2811('0x19')](function(_0x5d1cbc){logger['error'](_0x2811('0x1a'),_0x5d1cbc);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x7a5a=['./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','listen','info','start','Online\x20apps:','map','filter','online','Offline\x20apps:','name','join','None','seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule'];(function(_0xcdf6d4,_0x1bd76f){var _0x359f23=function(_0x5c6dd2){while(--_0x5c6dd2){_0xcdf6d4['push'](_0xcdf6d4['shift']());}};_0x359f23(++_0x1bd76f);}(_0x7a5a,0x71));var _0xa7a5=function(_0x52eaff,_0x4b39a6){_0x52eaff=_0x52eaff-0x0;var _0x472f4e=_0x7a5a[_0x52eaff];return _0x472f4e;};'use strict';var _=require(_0xa7a5('0x0'));var mysqldb=require(_0xa7a5('0x1'));var rpc=require(_0xa7a5('0x2'));var config=require(_0xa7a5('0x3'));var logger=require(_0xa7a5('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xa7a5('0x5'));var schedule=require(_0xa7a5('0x6'));var chat=require(_0xa7a5('0x7'));var whatsapp=require(_0xa7a5('0x8'));var transcribe=require(_0xa7a5('0x9'));function main(){return mysqldb['db']['sequelize'][_0xa7a5('0xa')]()[_0xa7a5('0xb')](function(){return rpc[_0xa7a5('0xc')]();})[_0xa7a5('0xb')](function(_0x1f18a4){logger[_0xa7a5('0xd')](_0x1f18a4);return chat[_0xa7a5('0xe')]();})['then'](function(){return whatsapp[_0xa7a5('0xe')]();})[_0xa7a5('0xb')](function(){return schedule[_0xa7a5('0xe')]();})[_0xa7a5('0xb')](function(){return transcribe['start']();})[_0xa7a5('0xb')](function(_0x5a96e6){logger[_0xa7a5('0xd')](_0x5a96e6);return pm2[_0xa7a5('0xe')](pm2Config);})[_0xa7a5('0xb')](function(_0x43c50f){logger['info'](_0xa7a5('0xf'),_[_0xa7a5('0x10')](_[_0xa7a5('0x11')](_0x43c50f,{'status':_0xa7a5('0x12')}),'name')['join']());logger[_0xa7a5('0xd')](_0xa7a5('0x13'),_[_0xa7a5('0x10')](_[_0xa7a5('0x11')](_0x43c50f,function(_0x311f80){return _0x311f80['status']!==_0xa7a5('0x12');}),_0xa7a5('0x14'))[_0xa7a5('0x15')]()||_0xa7a5('0x16'));config[_0xa7a5('0x17')]&&require('./config/seedDB')['default']();require(_0xa7a5('0x18'))[_0xa7a5('0x19')]();})[_0xa7a5('0x1a')](function(_0x9430b7){logger[_0xa7a5('0x1b')](_0xa7a5('0x1c'),_0x9430b7);process[_0xa7a5('0x1d')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 2f3655b..76f01b0 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 _0xb624=['role','cookie','motion.token','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','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.','Sequelize','ValidationError','updatePasswordsHistory','split','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','now','HS512','../../config/environment','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','fullname','name','userpic','mailPause','faxPause','smsPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','user','ChatInteraction','findOne','params','then','closed','disposition','unmanaged','json','Forbidden.','catch','isAuthenticated','use','headers','authorization','User','find','pass','Wrong\x20credentials.','startsWith','apikey','getUuid','query','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','status','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie'];(function(_0x445425,_0x55fffc){var _0x2722d4=function(_0x460ec3){while(--_0x460ec3){_0x445425['push'](_0x445425['shift']());}};_0x2722d4(++_0x55fffc);}(_0xb624,0x9c));var _0x4b62=function(_0x5ab238,_0x4ddda9){_0x5ab238=_0x5ab238-0x0;var _0x236db6=_0xb624[_0x5ab238];return _0x236db6;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x4b62('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x4b62('0x1'));var encryptor=require(_0x4b62('0x2'));var _=require('lodash');var jwt=require(_0x4b62('0x3'));var expressJwt=require(_0x4b62('0x4'));var compose=require(_0x4b62('0x5'));var basicAuth=require(_0x4b62('0x6'));var crypto=require(_0x4b62('0x7'));var BPromise=require(_0x4b62('0x8'));var util=require(_0x4b62('0x9'));var moment=require(_0x4b62('0xa'));var validateJwt=expressJwt({'secret':config[_0x4b62('0xb')][_0x4b62('0xc')]});var userAttributes=['id','role',_0x4b62('0xd'),_0x4b62('0xe'),'internal','email',_0x4b62('0xf'),'permissions','md5secret','voicePause','chatPause',_0x4b62('0x10'),_0x4b62('0x11'),_0x4b62('0x12'),'openchannelPause',_0x4b62('0x13'),_0x4b62('0x14'),'lastLoginAt',_0x4b62('0x15'),_0x4b62('0x16'),_0x4b62('0x17'),_0x4b62('0x18'),'alias',_0x4b62('0x19'),'phoneBarAutoAnswerDelay',_0x4b62('0x1a'),_0x4b62('0x1b'),_0x4b62('0x1c'),_0x4b62('0x1d'),_0x4b62('0x1e'),_0x4b62('0x1f'),'phoneBarRemoteControl','phoneBarRemoteControlPort',_0x4b62('0x20'),'interface',_0x4b62('0x21'),_0x4b62('0x22'),_0x4b62('0x23'),_0x4b62('0x24'),_0x4b62('0x25'),_0x4b62('0x26'),'downloadAttachments',_0x4b62('0x27'),'selectRecallMeCampaign'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])['use'](function(_0x503b8b,_0x5b2bc0,_0xeabbfd){if(_0x503b8b[_0x4b62('0x28')]){_0xeabbfd();}else{return db[_0x4b62('0x29')][_0x4b62('0x2a')]({'where':{'id':_0x503b8b[_0x4b62('0x2b')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x4b62('0x2c')](function(_0x80c033){if(_0x80c033&&_0x80c033[_0x4b62('0x2d')]){return _0x5b2bc0['status'](_0x80c033[_0x4b62('0x2e')]===_0x4b62('0x2f')?0x195:0x193)[_0x4b62('0x30')]({'message':_0x80c033[_0x4b62('0x2e')]===_0x4b62('0x2f')?'Unmanaged.':_0x4b62('0x31')});}else{_0xeabbfd();}})[_0x4b62('0x32')](function(_0x1b5efd){_0xeabbfd(_0x1b5efd);});}});};exports[_0x4b62('0x33')]=function isAuthenticated(_0x342e76){return compose()[_0x4b62('0x34')](function(_0x425aee,_0x5b430f,_0x15ac4b){var _0x22a008;if(_0x425aee[_0x4b62('0x35')][_0x4b62('0x36')]){if(_['startsWith'](_0x425aee['headers'][_0x4b62('0x36')],'Basic')){var _0x528cae=basicAuth(_0x425aee);db[_0x4b62('0x37')][_0x4b62('0x38')]({'where':{'name':_0x528cae[_0x4b62('0xe')]}})[_0x4b62('0x2c')](function(_0x1191ff){if(!_0x1191ff||!_0x1191ff['authenticate'](_0x528cae[_0x4b62('0x39')])){return _0x5b430f['status'](0x191)[_0x4b62('0x30')]({'message':_0x4b62('0x3a')});}_0x425aee[_0x4b62('0x28')]={'id':_0x1191ff['id']};_0x15ac4b();})[_0x4b62('0x32')](function(_0x21b7d6){_0x15ac4b(_0x21b7d6);});}else if(_[_0x4b62('0x3b')](_0x425aee['headers'][_0x4b62('0x36')],'Bearer')){validateJwt(_0x425aee,_0x5b430f,_0x15ac4b);}else{if(_0x342e76){_0x15ac4b();}else{return _0x5b430f['status'](0x193)[_0x4b62('0x30')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x425aee['query'][_0x4b62('0x3c')]){try{var _0x1ea296={'audience':hardwareConf[_0x4b62('0x3d')](),'issuer':hardwareConf[_0x4b62('0x3d')]()};verifyJwt(_0x425aee[_0x4b62('0x3e')]['apikey'],_0x1ea296)[_0x4b62('0x2c')](function(_0x305090){return db[_0x4b62('0x37')][_0x4b62('0x38')]({'where':{'id':_0x305090[_0x4b62('0x3f')]}})[_0x4b62('0x2c')](function(_0x41856c){_0x22a008=_0x41856c;return db[_0x4b62('0x40')][_0x4b62('0x2a')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x4b62('0x41')],'raw':!![]});})[_0x4b62('0x2c')](function(_0x371899){if(!_0x22a008||!_[_0x4b62('0x42')](_0x22a008[_0x4b62('0x43')],_0x305090[_0x4b62('0x44')])){return _0x5b430f[_0x4b62('0x45')](0x191)['json']({'message':_0x4b62('0x46')});}if(_0x22a008[_0x4b62('0x47')]){return _0x5b430f[_0x4b62('0x45')](0x191)[_0x4b62('0x30')]({'message':_0x4b62('0x48')});}if(_0x22a008[_0x4b62('0x49')]){if(_0x371899[_0x4b62('0x41')]>0x0){if(moment(_0x22a008[_0x4b62('0x4a')])[_0x4b62('0x4b')](_0x371899[_0x4b62('0x41')],_0x4b62('0x4c'))>moment()){return _0x5b430f['status'](0x191)[_0x4b62('0x30')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5b430f[_0x4b62('0x45')](0x191)[_0x4b62('0x30')]({'message':_0x4b62('0x48')});}}_0x425aee['user']={'id':_0x22a008['id']};_0x15ac4b();});})[_0x4b62('0x32')](function(){return _0x5b430f[_0x4b62('0x45')](0x191)['json']({'message':_0x4b62('0x48')});});}catch(_0xefe73){_0x15ac4b(_0xefe73);}}else if(_0x342e76){_0x15ac4b();}else{return _0x5b430f['status'](0x193)[_0x4b62('0x30')]({'message':_0x4b62('0x4d')});}})[_0x4b62('0x34')](function(_0x59d6ae,_0x44d39b,_0x48684d){if(_0x59d6ae['user']){db[_0x4b62('0x37')][_0x4b62('0x38')]({'where':{'id':_0x59d6ae[_0x4b62('0x28')]['id']},'attributes':userAttributes})['then'](function(_0x2f3cae){if(!_0x2f3cae){return _0x44d39b[_0x4b62('0x45')](0x194)[_0x4b62('0x30')]({'message':'User\x20not\x20found.'});}_0x59d6ae[_0x4b62('0x28')]=_0x2f3cae;_0x48684d();})['catch'](function(_0xb6979a){_0x48684d(_0xb6979a);});}else if(_0x342e76){_0x48684d();}else{return _0x44d39b['status'](0x194)['json']({'message':_0x4b62('0x4e')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x4b62('0x34')](function(_0x5dd544,_0x66bfda,_0xb5a303){return licenseUtil[_0x4b62('0x4f')]()[_0x4b62('0x2c')](function(_0x4de8e7){if(_0x4de8e7[_0x4b62('0x50')]){_0xb5a303();}else{return _0x66bfda[_0x4b62('0x45')](0x193)[_0x4b62('0x30')]({'message':_0x4b62('0x51')});}})['catch'](function(_0x52b553){_0xb5a303(_0x52b553);});});};exports[_0x4b62('0x52')]=function isWebrtcLicence(){return compose()[_0x4b62('0x34')](function(_0x205bf7,_0x4c7cc4,_0x96718c){return licenseUtil['getLicense']()[_0x4b62('0x2c')](function(_0x3a9779){if(_0x3a9779[_0x4b62('0x53')]){_0x96718c();}else{return _0x4c7cc4[_0x4b62('0x45')](0x193)['json']({'message':_0x4b62('0x51')});}})[_0x4b62('0x32')](function(_0x9bbf26){_0x96718c(_0x9bbf26);});});};exports['isMiddleware']=function(_0x26b312,_0x1e85e2,_0x15f4d9){_0x26b312[_0x4b62('0x54')]=!![];return _0x15f4d9();};exports['signToken']=function signToken(_0x46b693){return signJwt(_0x46b693);};exports[_0x4b62('0x55')]=function(_0x392902,_0x2363cb){if(!_0x392902[_0x4b62('0x28')]){return _0x2363cb[_0x4b62('0x45')](0x194)[_0x4b62('0x30')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3d4462={'payload':{'id':_0x392902[_0x4b62('0x28')]['id'],'role':_0x392902['user'][_0x4b62('0x56')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3d4462)[_0x4b62('0x2c')](function(_0x24abfd){_0x2363cb[_0x4b62('0x57')](_0x4b62('0x58'),_0x24abfd);_0x2363cb['redirect'](_0x4b62('0x59'));})[_0x4b62('0x32')](function(_0x3255a3){return _0x2363cb['status'](0x1f4)['send'](_0x3255a3);});};exports[_0x4b62('0x5a')]=function(_0x11bbc4){if(_[_0x4b62('0x5b')](_0x11bbc4[_0x4b62('0x43')])||_[_0x4b62('0x5b')](_0x11bbc4[_0x4b62('0x5c')])){return null;}else{return createJwt(_0x11bbc4);}};exports[_0x4b62('0x5d')]=function(_0x4b1172){_0x4b1172[_0x4b62('0x43')]=generateNonce();_0x4b1172[_0x4b62('0x5c')]=generateIssuedAt();return createJwt(_0x4b1172);};exports[_0x4b62('0x5e')]=function(_0x4cb381,_0x49890d){var _0xac558b=_0x4cb381[_0x4b62('0x3e')][_0x4b62('0x3c')];if(_0xac558b){var _0x57d2b3={'nonce':_0x49890d[_0x4b62('0x43')],'iat':_0x49890d[_0x4b62('0x5c')],'audience':hardwareConf[_0x4b62('0x3d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xac558b,_0x57d2b3)[_0x4b62('0x2c')](function(){return generateApiKey(_0x49890d);});}else{throw{'message':_0x4b62('0x5f')};}};exports['validatePasswordPattern']=function(_0x1a57ff){var _0x358df4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x358df4['test'](_0x1a57ff))throw new db['Sequelize']['ValidationError'](_0x4b62('0x60'));return;};exports[_0x4b62('0x61')]=function(_0x4a43c0,_0x17268c,_0x257275){var _0xcb7492=encryptor[_0x4b62('0x62')](_0x17268c)['split'](',');for(var _0x3e353c=0x0;_0x3e353c<_0x257275;_0x3e353c++){if(!_0xcb7492[_0x3e353c])break;if(_0x4a43c0[_0x4b62('0x63')]()===_0xcb7492[_0x3e353c]['toLowerCase']()){var _0x106a93=util['format'](_0x4b62('0x64'),_0x257275);if(_0x257275===0x1){_0x106a93=_0x4b62('0x65');}throw new db[(_0x4b62('0x66'))][(_0x4b62('0x67'))](_0x106a93);}}return;};exports[_0x4b62('0x68')]=function(_0x40d57a,_0x4c0a27){var _0x101560=_0x4c0a27?encryptor[_0x4b62('0x62')](_0x4c0a27)[_0x4b62('0x69')](','):[];if(_0x101560['length']===0x5){_0x101560[_0x4b62('0x6a')](-0x1,0x1);}_0x101560[_0x4b62('0x6b')](_0x40d57a);return encryptor[_0x4b62('0x6c')](_0x101560[_0x4b62('0x6d')](','));};function signJwt(_0x1e4b6a){var _0x188b2b=BPromise[_0x4b62('0x6e')](jwt[_0x4b62('0x6f')],{'context':jwt});var _0x2a33ce=_0x1e4b6a[_0x4b62('0x70')]||config['secrets'][_0x4b62('0xc')];return new BPromise(function(_0x402c7b,_0x55acb9){_0x188b2b(_0x1e4b6a[_0x4b62('0x71')],_0x2a33ce,_0x1e4b6a[_0x4b62('0x72')])[_0x4b62('0x2c')](function(_0x1df767){_0x402c7b(_0x1df767);})[_0x4b62('0x32')](function(_0x5887a9){_0x55acb9(_0x5887a9);});});}function verifyJwt(_0x212d35,_0x3c62d1,_0x1b48b3){var _0x5a30f7=BPromise[_0x4b62('0x6e')](jwt[_0x4b62('0x73')],{'context':jwt});var _0x102e5a=_0x1b48b3||config[_0x4b62('0xb')][_0x4b62('0xc')];return new BPromise(function(_0x376e8d,_0xda5f62){_0x5a30f7(_0x212d35,_0x102e5a,_0x3c62d1)['then'](function(_0x461487){_0x376e8d(_0x461487);})[_0x4b62('0x32')](function(_0x52fdd9){_0xda5f62(_0x52fdd9);});});}function generateNonce(){return crypto[_0x4b62('0x74')](0x10)[_0x4b62('0x75')](_0x4b62('0x76'));}function generateIssuedAt(){return Math['floor'](Date[_0x4b62('0x77')]()/0x3e8)['toString']();}function createJwt(_0xb61884){var _0x4ddced={'payload':{'iat':_0xb61884['apiKeyIat'],'nonce':_0xb61884[_0x4b62('0x43')]},'options':{'algorithm':_0x4b62('0x78'),'subject':_0xb61884['id'][_0x4b62('0x75')](),'issuer':hardwareConf[_0x4b62('0x3d')](),'audience':hardwareConf[_0x4b62('0x3d')]()}};return signJwt(_0x4ddced)['then'](function(_0x2a0ce4){return{'iat':_0xb61884['apiKeyIat'],'nonce':_0xb61884[_0x4b62('0x43')],'token':_0x2a0ce4};});} \ No newline at end of file +var _0x1177=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','splice','unshift','join','promisify','sign','secret','secrets','options','verify','hex','now','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','moment','session','role','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','user','findOne','params','closed','disposition','status','unmanaged','json','Unmanaged.','catch','use','authorization','Basic','User','find','name','then','authenticate','headers','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','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.'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x1177,0x10b));var _0x7117=function(_0x3ef597,_0x517be6){_0x3ef597=_0x3ef597-0x0;var _0x467cad=_0x1177[_0x3ef597];return _0x467cad;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x7117('0x0'));var hardwareConf=require(_0x7117('0x1'));var licenseUtil=require(_0x7117('0x2'));var encryptor=require('../encryptor');var _=require(_0x7117('0x3'));var jwt=require(_0x7117('0x4'));var expressJwt=require(_0x7117('0x5'));var compose=require(_0x7117('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x7117('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0x7117('0x8'));var validateJwt=expressJwt({'secret':config['secrets'][_0x7117('0x9')]});var userAttributes=['id',_0x7117('0xa'),'fullname','name',_0x7117('0xb'),_0x7117('0xc'),'userpic',_0x7117('0xd'),_0x7117('0xe'),_0x7117('0xf'),_0x7117('0x10'),_0x7117('0x11'),_0x7117('0x12'),_0x7117('0x13'),_0x7117('0x14'),_0x7117('0x15'),_0x7117('0x16'),_0x7117('0x17'),_0x7117('0x18'),_0x7117('0x19'),'allowmessenger',_0x7117('0x1a'),_0x7117('0x1b'),_0x7117('0x1c'),_0x7117('0x1d'),_0x7117('0x1e'),_0x7117('0x1f'),_0x7117('0x20'),'phoneBarEnableSettings','phoneBarExpires',_0x7117('0x21'),_0x7117('0x22'),'phoneBarRemoteControlPort',_0x7117('0x23'),_0x7117('0x24'),_0x7117('0x25'),_0x7117('0x26'),_0x7117('0x27'),_0x7117('0x28'),'downloadVoiceRecordings',_0x7117('0x29'),_0x7117('0x2a'),_0x7117('0x2b'),_0x7117('0x2c')];exports[_0x7117('0x2d')]=function(){return this[_0x7117('0x2e')](!![])['use'](function(_0xf83bcb,_0x175fce,_0x182676){if(_0xf83bcb[_0x7117('0x2f')]){_0x182676();}else{return db['ChatInteraction'][_0x7117('0x30')]({'where':{'id':_0xf83bcb[_0x7117('0x31')]['id']},'attributes':['id',_0x7117('0x32'),_0x7117('0x33')],'raw':!![]})['then'](function(_0xde8ef9){if(_0xde8ef9&&_0xde8ef9['closed']){return _0x175fce[_0x7117('0x34')](_0xde8ef9['disposition']===_0x7117('0x35')?0x195:0x193)[_0x7117('0x36')]({'message':_0xde8ef9[_0x7117('0x33')]===_0x7117('0x35')?_0x7117('0x37'):'Forbidden.'});}else{_0x182676();}})[_0x7117('0x38')](function(_0x58d019){_0x182676(_0x58d019);});}});};exports[_0x7117('0x2e')]=function isAuthenticated(_0x1f44d6){return compose()[_0x7117('0x39')](function(_0xcce1d2,_0x416f86,_0x45a37d){var _0x36b7e2;if(_0xcce1d2['headers'][_0x7117('0x3a')]){if(_['startsWith'](_0xcce1d2['headers'][_0x7117('0x3a')],_0x7117('0x3b'))){var _0x6bb077=basicAuth(_0xcce1d2);db[_0x7117('0x3c')][_0x7117('0x3d')]({'where':{'name':_0x6bb077[_0x7117('0x3e')]}})[_0x7117('0x3f')](function(_0x47bcf5){if(!_0x47bcf5||!_0x47bcf5[_0x7117('0x40')](_0x6bb077['pass'])){return _0x416f86[_0x7117('0x34')](0x191)[_0x7117('0x36')]({'message':'Wrong\x20credentials.'});}_0xcce1d2[_0x7117('0x2f')]={'id':_0x47bcf5['id']};_0x45a37d();})[_0x7117('0x38')](function(_0x120224){_0x45a37d(_0x120224);});}else if(_['startsWith'](_0xcce1d2[_0x7117('0x41')]['authorization'],_0x7117('0x42'))){validateJwt(_0xcce1d2,_0x416f86,_0x45a37d);}else{if(_0x1f44d6){_0x45a37d();}else{return _0x416f86[_0x7117('0x34')](0x193)[_0x7117('0x36')]({'message':_0x7117('0x43')});}}}else if(_0xcce1d2[_0x7117('0x44')][_0x7117('0x45')]){try{var _0x25892b={'audience':hardwareConf[_0x7117('0x46')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0xcce1d2['query']['apikey'],_0x25892b)[_0x7117('0x3f')](function(_0x4d6f47){return db['User']['find']({'where':{'id':_0x4d6f47[_0x7117('0x47')]}})[_0x7117('0x3f')](function(_0x2443ed){_0x36b7e2=_0x2443ed;return db[_0x7117('0x48')][_0x7117('0x30')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7117('0x49')],'raw':!![]});})['then'](function(_0x1ead7a){if(!_0x36b7e2||!_[_0x7117('0x4a')](_0x36b7e2[_0x7117('0x4b')],_0x4d6f47[_0x7117('0x4c')])){return _0x416f86[_0x7117('0x34')](0x191)[_0x7117('0x36')]({'message':_0x7117('0x4d')});}if(_0x36b7e2[_0x7117('0x4e')]){return _0x416f86[_0x7117('0x34')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x36b7e2['blocked']){if(_0x1ead7a['blockDuration']>0x0){if(moment(_0x36b7e2[_0x7117('0x4f')])[_0x7117('0x50')](_0x1ead7a[_0x7117('0x49')],'minutes')>moment()){return _0x416f86['status'](0x191)[_0x7117('0x36')]({'message':_0x7117('0x51')});}}else{return _0x416f86[_0x7117('0x34')](0x191)[_0x7117('0x36')]({'message':_0x7117('0x51')});}}_0xcce1d2[_0x7117('0x2f')]={'id':_0x36b7e2['id']};_0x45a37d();});})['catch'](function(){return _0x416f86[_0x7117('0x34')](0x191)[_0x7117('0x36')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x89e5da){_0x45a37d(_0x89e5da);}}else if(_0x1f44d6){_0x45a37d();}else{return _0x416f86['status'](0x193)[_0x7117('0x36')]({'message':_0x7117('0x43')});}})['use'](function(_0x32085f,_0x4c0551,_0x2189f1){if(_0x32085f[_0x7117('0x2f')]){db['User']['find']({'where':{'id':_0x32085f['user']['id']},'attributes':userAttributes})['then'](function(_0x474923){if(!_0x474923){return _0x4c0551[_0x7117('0x34')](0x194)['json']({'message':_0x7117('0x52')});}_0x32085f[_0x7117('0x2f')]=_0x474923;_0x2189f1();})[_0x7117('0x38')](function(_0x3887c6){_0x2189f1(_0x3887c6);});}else if(_0x1f44d6){_0x2189f1();}else{return _0x4c0551[_0x7117('0x34')](0x194)[_0x7117('0x36')]({'message':_0x7117('0x53')});}});};exports[_0x7117('0x54')]=function canUpdate(){return compose()['use'](function(_0x54f756,_0x5db086,_0x1963b5){return licenseUtil['getLicense']()[_0x7117('0x3f')](function(_0x20b652){if(_0x20b652[_0x7117('0x55')]){_0x1963b5();}else{return _0x5db086[_0x7117('0x34')](0x193)[_0x7117('0x36')]({'message':_0x7117('0x56')});}})['catch'](function(_0x2670a5){_0x1963b5(_0x2670a5);});});};exports[_0x7117('0x57')]=function isWebrtcLicence(){return compose()[_0x7117('0x39')](function(_0x4cb0ba,_0x384023,_0x12c3d4){return licenseUtil['getLicense']()[_0x7117('0x3f')](function(_0x46ebe0){if(_0x46ebe0['webrtc']){_0x12c3d4();}else{return _0x384023[_0x7117('0x34')](0x193)[_0x7117('0x36')]({'message':_0x7117('0x56')});}})[_0x7117('0x38')](function(_0x541dc5){_0x12c3d4(_0x541dc5);});});};exports['isMiddleware']=function(_0x843ca5,_0x444636,_0x3d9e9c){_0x843ca5[_0x7117('0x58')]=!![];return _0x3d9e9c();};exports[_0x7117('0x59')]=function signToken(_0x191fb9){return signJwt(_0x191fb9);};exports[_0x7117('0x5a')]=function(_0x4194fd,_0x1138e5){if(!_0x4194fd[_0x7117('0x2f')]){return _0x1138e5[_0x7117('0x34')](0x194)[_0x7117('0x36')]({'message':_0x7117('0x5b')});}var _0xc5e63a={'payload':{'id':_0x4194fd[_0x7117('0x2f')]['id'],'role':_0x4194fd[_0x7117('0x2f')][_0x7117('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0xc5e63a)[_0x7117('0x3f')](function(_0x2c7894){_0x1138e5[_0x7117('0x5c')]('motion.token',_0x2c7894);_0x1138e5[_0x7117('0x5d')]('/dashboards/general');})['catch'](function(_0x1e9550){return _0x1138e5[_0x7117('0x34')](0x1f4)[_0x7117('0x5e')](_0x1e9550);});};exports[_0x7117('0x5f')]=function(_0x361555){if(_[_0x7117('0x60')](_0x361555[_0x7117('0x4b')])||_[_0x7117('0x60')](_0x361555[_0x7117('0x61')])){return null;}else{return createJwt(_0x361555);}};exports[_0x7117('0x62')]=function(_0x20d446){_0x20d446[_0x7117('0x4b')]=generateNonce();_0x20d446[_0x7117('0x61')]=generateIssuedAt();return createJwt(_0x20d446);};exports[_0x7117('0x63')]=function(_0x5b5432,_0x26ac54){var _0x42bf41=_0x5b5432[_0x7117('0x44')][_0x7117('0x45')];if(_0x42bf41){var _0x32690b={'nonce':_0x26ac54[_0x7117('0x4b')],'iat':_0x26ac54[_0x7117('0x61')],'audience':hardwareConf[_0x7117('0x46')](),'issuer':hardwareConf[_0x7117('0x46')]()};return verifyJwt(_0x42bf41,_0x32690b)[_0x7117('0x3f')](function(){return generateApiKey(_0x26ac54);});}else{throw{'message':_0x7117('0x64')};}};exports[_0x7117('0x65')]=function(_0x13dac4){var _0x375b4b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x375b4b[_0x7117('0x66')](_0x13dac4))throw new db['Sequelize'][(_0x7117('0x67'))](_0x7117('0x68'));return;};exports[_0x7117('0x69')]=function(_0x39c65d,_0x5f2c34,_0x168ad8){var _0x295d58=encryptor[_0x7117('0x6a')](_0x5f2c34)[_0x7117('0x6b')](',');for(var _0x26c168=0x0;_0x26c168<_0x168ad8;_0x26c168++){if(!_0x295d58[_0x26c168])break;if(_0x39c65d[_0x7117('0x6c')]()===_0x295d58[_0x26c168][_0x7117('0x6c')]()){var _0x5b8877=util[_0x7117('0x6d')](_0x7117('0x6e'),_0x168ad8);if(_0x168ad8===0x1){_0x5b8877=_0x7117('0x6f');}throw new db[(_0x7117('0x70'))][(_0x7117('0x67'))](_0x5b8877);}}return;};exports['updatePasswordsHistory']=function(_0x3fc52a,_0x164f25){var _0x585df6=_0x164f25?encryptor[_0x7117('0x6a')](_0x164f25)[_0x7117('0x6b')](','):[];if(_0x585df6['length']===0x5){_0x585df6[_0x7117('0x71')](-0x1,0x1);}_0x585df6[_0x7117('0x72')](_0x3fc52a);return encryptor['encryptString'](_0x585df6[_0x7117('0x73')](','));};function signJwt(_0x20aed9){var _0x58ad8c=BPromise[_0x7117('0x74')](jwt[_0x7117('0x75')],{'context':jwt});var _0x3e576a=_0x20aed9[_0x7117('0x76')]||config[_0x7117('0x77')]['session'];return new BPromise(function(_0x4efb51,_0x2c73e0){_0x58ad8c(_0x20aed9['payload'],_0x3e576a,_0x20aed9[_0x7117('0x78')])[_0x7117('0x3f')](function(_0x3d9512){_0x4efb51(_0x3d9512);})[_0x7117('0x38')](function(_0x56f7a2){_0x2c73e0(_0x56f7a2);});});}function verifyJwt(_0x2f6fa4,_0x1a4fab,_0x5eea3c){var _0x393090=BPromise[_0x7117('0x74')](jwt[_0x7117('0x79')],{'context':jwt});var _0x1d2a3c=_0x5eea3c||config['secrets'][_0x7117('0x9')];return new BPromise(function(_0x3c270f,_0x2389f1){_0x393090(_0x2f6fa4,_0x1d2a3c,_0x1a4fab)[_0x7117('0x3f')](function(_0x49388f){_0x3c270f(_0x49388f);})[_0x7117('0x38')](function(_0x1c159e){_0x2389f1(_0x1c159e);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x7117('0x7a'));}function generateIssuedAt(){return Math['floor'](Date[_0x7117('0x7b')]()/0x3e8)[_0x7117('0x7c')]();}function createJwt(_0xf174b7){var _0x3e6119={'payload':{'iat':_0xf174b7[_0x7117('0x61')],'nonce':_0xf174b7[_0x7117('0x4b')]},'options':{'algorithm':_0x7117('0x7d'),'subject':_0xf174b7['id'][_0x7117('0x7c')](),'issuer':hardwareConf[_0x7117('0x46')](),'audience':hardwareConf[_0x7117('0x46')]()}};return signJwt(_0x3e6119)[_0x7117('0x3f')](function(_0x43b58a){return{'iat':_0xf174b7[_0x7117('0x61')],'nonce':_0xf174b7[_0x7117('0x4b')],'token':_0x43b58a};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b1c76fc..b81d1d3 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 _0x93be=['decryptString','secret','crypto','bluebird','lodash','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','end','final','binary','write','close','unlink','createDecipher','createCipher','utf8','base64'];(function(_0x4f89ff,_0x5e466b){var _0x42f34c=function(_0x2806d6){while(--_0x2806d6){_0x4f89ff['push'](_0x4f89ff['shift']());}};_0x42f34c(++_0x5e466b);}(_0x93be,0x14c));var _0xe93b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x93be[_0x14add3];return _0x4a174f;};'use strict';var crypto=require(_0xe93b('0x0'));var fs=require('fs');var BPromise=require(_0xe93b('0x1'));var _=require(_0xe93b('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xe93b('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xe93b('0x4')]['session'],'algorithm':_0xe93b('0x5')};const fileOptions={'algorithm':_0xe93b('0x6')};if(config[_0xe93b('0x7')]&&config[_0xe93b('0x7')][_0xe93b('0x8')]){var isSupported=isAlgorithmSupported(config[_0xe93b('0x7')][_0xe93b('0x8')]);if(isSupported){fileOptions[_0xe93b('0x8')]=config[_0xe93b('0x7')][_0xe93b('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe93b('0x9')](',\x20');logger[_0xe93b('0xa')](config[_0xe93b('0x7')][_0xe93b('0x8')],_0xe93b('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0xcb4f57){return AES_SUPPORTED_RX[_0xe93b('0xc')](_0xcb4f57);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xe93b('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x2d7120){return getSupportedCiphers()[_0xe93b('0xe')](_0x2d7120)>-0x1;}function combineOptions(_0x322043){var _0x527763={};for(var _0x4299b3 in fileOptions){if(fileOptions[_0xe93b('0xf')](_0x4299b3)){_0x527763[_0x4299b3]=fileOptions[_0x4299b3];}}if(_0x322043){for(var _0x34181f in _0x322043){if(_0x322043['hasOwnProperty'](_0x34181f)){_0x527763[_0x34181f]=_0x322043[_0x34181f];}}}return _0x527763;}exports[_0xe93b('0x10')]=function(_0x171a76,_0x2a8d88,_0x3189a3,_0x74787a){return new BPromise(function(_0x484827,_0xf40b46){_0x74787a=combineOptions(_0x74787a);var _0x369cde=new Buffer(_0x3189a3);var _0x37d418=fs[_0xe93b('0x11')](_0x171a76);var _0x141309=fs[_0xe93b('0x12')](_0x2a8d88);var _0x3f8a3e=crypto['createCipher'](_0x74787a['algorithm'],_0x369cde);_0x37d418['on'](_0xe93b('0x13'),function(_0x52d338){var _0x19d54a=new Buffer(_0x3f8a3e[_0xe93b('0x14')](_0x52d338),'binary');_0x141309['write'](_0x19d54a);});_0x37d418['on'](_0xe93b('0x15'),function(){try{var _0x15cd19=new Buffer(_0x3f8a3e[_0xe93b('0x16')](_0xe93b('0x17')),'binary');_0x141309[_0xe93b('0x18')](_0x15cd19);_0x141309[_0xe93b('0x15')]();_0x141309['on'](_0xe93b('0x19'),function(){return _0x484827(_0x2a8d88);});}catch(_0x35cd3f){fs[_0xe93b('0x1a')](_0x2a8d88);return _0xf40b46(_0x35cd3f);}});});};exports['decryptFile']=function(_0x11b802,_0x19da03,_0x1a8443,_0x2ae38d){return new BPromise(function(_0x5af0c2,_0x1ea883){_0x2ae38d=combineOptions(_0x2ae38d);var _0x10faee=new Buffer(_0x1a8443);var _0xbd0a46=fs[_0xe93b('0x11')](_0x11b802);var _0x11b1ea=fs[_0xe93b('0x12')](_0x19da03);var _0x4f6fbb=crypto[_0xe93b('0x1b')](_0x2ae38d[_0xe93b('0x8')],_0x10faee);_0xbd0a46['on'](_0xe93b('0x13'),function(_0x180dba){var _0x2d2486=new Buffer(_0x4f6fbb[_0xe93b('0x14')](_0x180dba),'binary');_0x11b1ea[_0xe93b('0x18')](_0x2d2486);});_0xbd0a46['on'](_0xe93b('0x15'),function(){try{var _0x43a5bb=new Buffer(_0x4f6fbb[_0xe93b('0x16')](_0xe93b('0x17')),_0xe93b('0x17'));_0x11b1ea[_0xe93b('0x18')](_0x43a5bb);_0x11b1ea[_0xe93b('0x15')]();_0x11b1ea['on'](_0xe93b('0x19'),function(){return _0x5af0c2(_0x19da03);});}catch(_0x279004){fs[_0xe93b('0x1a')](_0x19da03);return _0x1ea883(_0x279004);}});});};exports['encryptString']=function(_0x5eb693,_0x16bd52,_0x5089fd){var _0x18dca9=_0x5089fd||stringOptions[_0xe93b('0x8')];var _0x46bc3e=_0x16bd52||stringOptions['secret'];var _0x338377=crypto[_0xe93b('0x1c')](_0x18dca9,_0x46bc3e);var _0x5a9322=_0x338377[_0xe93b('0x14')](_0x5eb693,_0xe93b('0x1d'),_0xe93b('0x1e'));_0x5a9322+=_0x338377[_0xe93b('0x16')](_0xe93b('0x1e'));return _0x5a9322;};exports[_0xe93b('0x1f')]=function(_0x903240,_0x52f29a,_0x3e82c8){var _0x2e5b5a=_0x3e82c8||stringOptions['algorithm'];var _0x26e914=_0x52f29a||stringOptions[_0xe93b('0x20')];var _0x3efdc0=crypto[_0xe93b('0x1b')](_0x2e5b5a,_0x26e914);var _0x25c3dd=_0x3efdc0[_0xe93b('0x14')](_0x903240,_0xe93b('0x1e'),_0xe93b('0x1d'));_0x25c3dd+=_0x3efdc0[_0xe93b('0x16')](_0xe93b('0x1d'));return _0x25c3dd;}; \ No newline at end of file +var _0xbca3=['../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','binary','write','end','final','close','decryptFile','createDecipher','data','unlink','encryptString','secret','utf8','base64','update','lodash','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbca3,0x1e8));var _0x3bca=function(_0x5714ac,_0x17d90d){_0x5714ac=_0x5714ac-0x0;var _0x3a4bec=_0xbca3[_0x5714ac];return _0x3a4bec;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x3bca('0x0'));var config=require(_0x3bca('0x1'));var logger=require(_0x3bca('0x2'))(_0x3bca('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3bca('0x4')][_0x3bca('0x5')],'algorithm':_0x3bca('0x6')};const fileOptions={'algorithm':_0x3bca('0x7')};if(config[_0x3bca('0x8')]&&config[_0x3bca('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x3bca('0x8')][_0x3bca('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x3bca('0x8')][_0x3bca('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3bca('0xa')](',\x20');logger[_0x3bca('0xb')](config[_0x3bca('0x8')]['algorithm'],_0x3bca('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x5a4f8c){return AES_SUPPORTED_RX['test'](_0x5a4f8c);}function getSupportedCiphers(){return crypto[_0x3bca('0xd')]()[_0x3bca('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x122aff){return getSupportedCiphers()[_0x3bca('0xf')](_0x122aff)>-0x1;}function combineOptions(_0x267bf4){var _0x4fd8c2={};for(var _0x50970f in fileOptions){if(fileOptions[_0x3bca('0x10')](_0x50970f)){_0x4fd8c2[_0x50970f]=fileOptions[_0x50970f];}}if(_0x267bf4){for(var _0x739f7b in _0x267bf4){if(_0x267bf4[_0x3bca('0x10')](_0x739f7b)){_0x4fd8c2[_0x739f7b]=_0x267bf4[_0x739f7b];}}}return _0x4fd8c2;}exports[_0x3bca('0x11')]=function(_0x38869c,_0x1e093d,_0x36402b,_0x1b4ff4){return new BPromise(function(_0x4cfd95,_0x565e90){_0x1b4ff4=combineOptions(_0x1b4ff4);var _0x2302ab=new Buffer(_0x36402b);var _0x50e1b2=fs[_0x3bca('0x12')](_0x38869c);var _0x2c63a0=fs[_0x3bca('0x13')](_0x1e093d);var _0x245424=crypto[_0x3bca('0x14')](_0x1b4ff4[_0x3bca('0x9')],_0x2302ab);_0x50e1b2['on']('data',function(_0x2a672d){var _0x5c4e5c=new Buffer(_0x245424['update'](_0x2a672d),_0x3bca('0x15'));_0x2c63a0[_0x3bca('0x16')](_0x5c4e5c);});_0x50e1b2['on'](_0x3bca('0x17'),function(){try{var _0x5c1865=new Buffer(_0x245424[_0x3bca('0x18')](_0x3bca('0x15')),_0x3bca('0x15'));_0x2c63a0['write'](_0x5c1865);_0x2c63a0[_0x3bca('0x17')]();_0x2c63a0['on'](_0x3bca('0x19'),function(){return _0x4cfd95(_0x1e093d);});}catch(_0x32b7d3){fs['unlink'](_0x1e093d);return _0x565e90(_0x32b7d3);}});});};exports[_0x3bca('0x1a')]=function(_0x9cdb06,_0x46d767,_0x482287,_0x52004e){return new BPromise(function(_0x2f148c,_0x5721f4){_0x52004e=combineOptions(_0x52004e);var _0xd10c54=new Buffer(_0x482287);var _0x5999ad=fs[_0x3bca('0x12')](_0x9cdb06);var _0x3dc717=fs['createWriteStream'](_0x46d767);var _0x535e3e=crypto[_0x3bca('0x1b')](_0x52004e[_0x3bca('0x9')],_0xd10c54);_0x5999ad['on'](_0x3bca('0x1c'),function(_0x3b1b46){var _0x5c26b3=new Buffer(_0x535e3e['update'](_0x3b1b46),'binary');_0x3dc717[_0x3bca('0x16')](_0x5c26b3);});_0x5999ad['on'](_0x3bca('0x17'),function(){try{var _0x27d0ed=new Buffer(_0x535e3e['final'](_0x3bca('0x15')),_0x3bca('0x15'));_0x3dc717['write'](_0x27d0ed);_0x3dc717[_0x3bca('0x17')]();_0x3dc717['on'](_0x3bca('0x19'),function(){return _0x2f148c(_0x46d767);});}catch(_0x109e95){fs[_0x3bca('0x1d')](_0x46d767);return _0x5721f4(_0x109e95);}});});};exports[_0x3bca('0x1e')]=function(_0x1731dd,_0x1fb712,_0xdc4422){var _0x252d09=_0xdc4422||stringOptions[_0x3bca('0x9')];var _0x49d434=_0x1fb712||stringOptions[_0x3bca('0x1f')];var _0x354b36=crypto[_0x3bca('0x14')](_0x252d09,_0x49d434);var _0x9b8d20=_0x354b36['update'](_0x1731dd,_0x3bca('0x20'),_0x3bca('0x21'));_0x9b8d20+=_0x354b36[_0x3bca('0x18')](_0x3bca('0x21'));return _0x9b8d20;};exports['decryptString']=function(_0x1955a0,_0x429d53,_0x16ec21){var _0x7a77e=_0x16ec21||stringOptions[_0x3bca('0x9')];var _0x31f1ec=_0x429d53||stringOptions['secret'];var _0x1e92aa=crypto[_0x3bca('0x1b')](_0x7a77e,_0x31f1ec);var _0x16b3a0=_0x1e92aa[_0x3bca('0x22')](_0x1955a0,'base64','utf8');_0x16b3a0+=_0x1e92aa[_0x3bca('0x18')](_0x3bca('0x20'));return _0x16b3a0;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 17d1797..8437151 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 _0x736d=['%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','format','basename','.csv','existsSync','join','each','%s%d.%s','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','csv','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','../../config/logger','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','num','Empty','length','range','forEach'];(function(_0x3aa9d0,_0x58a7fa){var _0x343cd2=function(_0x427249){while(--_0x427249){_0x3aa9d0['push'](_0x3aa9d0['shift']());}};_0x343cd2(++_0x58a7fa);}(_0x736d,0x1ec));var _0xd736=function(_0x24686e,_0x42cb7c){_0x24686e=_0x24686e-0x0;var _0x1a1efc=_0x736d[_0x24686e];return _0x1a1efc;};'use strict';var util=require(_0xd736('0x0'));var path=require(_0xd736('0x1'));var _=require(_0xd736('0x2'));var csv=require(_0xd736('0x3'));var fs=require('fs');var BPromise=require(_0xd736('0x4'));var zipdir=require(_0xd736('0x5'));var rimraf=require('rimraf');var db=require(_0xd736('0x6'))['db'];var dbH=require(_0xd736('0x6'))['dbH'];var logger=require(_0xd736('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd736('0x8')][0x3];var PATH=process[_0xd736('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x282be4,_0x370e98){var _0x4fc821={'status':_0x282be4};var _0x2ef2a5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x370e98){_0x4fc821[_0xd736('0x9')]=_0x370e98;}return db['AnalyticExtractedReport'][_0xd736('0xa')](_0x4fc821,_0x2ef2a5);}function main(){var _0x4ce270=0x1388;var _0x1abf27;logger[_0xd736('0xb')](util['format'](_0xd736('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xd736('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd736('0xe'),_0xd736('0xf')]})[_0xd736('0x10')](function(_0x4eef0a){if(_0x4eef0a){_0x1abf27=_0x4eef0a;_0x4ce270=_0x1abf27[_0xd736('0xf')]||0x1388;}})[_0xd736('0x10')](function(){return dbH[_0xd736('0x11')][_0xd736('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd736('0x11')][_0xd736('0x13')]['SELECT']});})[_0xd736('0x10')](function(_0x422d25){if(!_0x422d25[0x0][_0xd736('0x14')]){return analyticExtractedReport(_0xd736('0x15'));}var _0x501d4c=[];var _0x4b420b=0x0;if(_0x1abf27[_0xd736('0xe')]){if(_0x422d25&&_0x422d25[_0xd736('0x16')]){var _0x1133ee=_[_0xd736('0x17')](_0x422d25[0x0][_0xd736('0x14')]/_0x4ce270);var _0x924531=Number['isInteger'](_0x422d25[0x0][_0xd736('0x14')]/_0x4ce270)?_0x422d25[0x0]['num']%_0x4ce270:0x0;_0x1133ee[_0xd736('0x18')](function(_0x3561fd){if(_0x3561fd>0x0){_0x4b420b+=_0x4ce270;}_0x501d4c['push'](dbH['sequelize'][_0xd736('0x12')](util['format'](_0xd736('0x19'),QUERY,_0x4ce270,_0x4b420b),{'type':dbH[_0xd736('0x11')][_0xd736('0x13')][_0xd736('0x1a')]}));});if(_0x924531>0x0){_0x4b420b+=_0x4ce270;_0x501d4c[_0xd736('0x1b')](dbH['sequelize']['query'](util[_0xd736('0x1c')](_0xd736('0x19'),QUERY,_0x924531,_0x4b420b),{'type':dbH[_0xd736('0x11')][_0xd736('0x13')][_0xd736('0x1a')]}));}}}else{_0x501d4c[_0xd736('0x1b')](dbH[_0xd736('0x11')][_0xd736('0x12')](QUERY,{'type':dbH['sequelize'][_0xd736('0x13')][_0xd736('0x1a')]}));}var _0x25421f=path['dirname'](PATH);var _0x301c3d=path[_0xd736('0x1d')](PATH,_0xd736('0x1e'));var _0x85c369=_0x1abf27['split']&&_0x501d4c[_0xd736('0x16')]>0x1;var _0x13c9f2=[];if(!fs[_0xd736('0x1f')](path[_0xd736('0x20')](_0x25421f,_0x301c3d))&&_0x85c369){fs['mkdirSync'](path['join'](_0x25421f,_0x301c3d));}return BPromise[_0xd736('0x21')](_0x501d4c,function(_0x292236){_0x13c9f2['push'](_0x292236);})[_0xd736('0x10')](function(){for(var _0x36a978=0x0;_0x36a978<_0x13c9f2[_0xd736('0x16')];_0x36a978+=0x1){var _0x578d5a;var _0x192dfb=_0x13c9f2[_0x36a978];if(_0x85c369){_0x578d5a=path['join'](_0x25421f,_0x301c3d,util[_0xd736('0x1c')](_0xd736('0x22'),_0x301c3d,_0x36a978,'csv'));}else{_0x578d5a=path[_0xd736('0x20')](_0x25421f,util[_0xd736('0x1c')](_0xd736('0x23'),_0x301c3d,'csv'));}fs[_0xd736('0x24')](_0x578d5a,csv(_0x192dfb));}})[_0xd736('0x10')](function(){if(_0x85c369){return new Promise(function(_0x595149){zipdir(path[_0xd736('0x20')](_0x25421f,_0x301c3d),{'saveTo':path[_0xd736('0x20')](_0x25421f,util['format']('%s.%s',_0x301c3d,_0xd736('0x25')))},function(_0x269801,_0x43248d){rimraf(path[_0xd736('0x20')](_0x25421f,_0x301c3d),function(){});_0x595149(_0xd736('0x26'));});});}})[_0xd736('0x10')](function(){logger[_0xd736('0xb')](util['format'](_0xd736('0x27'),EXTRACTED_REPORT_ID,_0xd736('0x28')));return analyticExtractedReport(_0xd736('0x29'),_0x85c369?util['format']('%s.%s',_0x301c3d,_0x85c369?_0xd736('0x25'):_0xd736('0x2a')):null);});})['catch'](function(_0x406848){logger[_0xd736('0xb')](util[_0xd736('0x1c')](_0xd736('0x2b'),EXTRACTED_REPORT_ID,_0xd736('0x28')),util[_0xd736('0x2c')](_0x406848,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd736('0x2d'));})['finally'](function(){process[_0xd736('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2770=['%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','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','join','mkdirSync','%s%d.%s','csv'];(function(_0x3316b9,_0x57de35){var _0x59f1bf=function(_0x4f2b7c){while(--_0x4f2b7c){_0x3316b9['push'](_0x3316b9['shift']());}};_0x59f1bf(++_0x57de35);}(_0x2770,0xd3));var _0x0277=function(_0x46d9d6,_0x1cffb2){_0x46d9d6=_0x46d9d6-0x0;var _0x17e6a6=_0x2770[_0x46d9d6];return _0x17e6a6;};'use strict';var util=require(_0x0277('0x0'));var path=require(_0x0277('0x1'));var _=require(_0x0277('0x2'));var csv=require(_0x0277('0x3'));var fs=require('fs');var BPromise=require(_0x0277('0x4'));var zipdir=require(_0x0277('0x5'));var rimraf=require(_0x0277('0x6'));var db=require(_0x0277('0x7'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x0277('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0277('0x9')][0x3];var PATH=process[_0x0277('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ead5,_0x2c076a){var _0x4a72d4={'status':_0x3ead5};var _0x516e9e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c076a){_0x4a72d4[_0x0277('0xa')]=_0x2c076a;}return db[_0x0277('0xb')]['update'](_0x4a72d4,_0x516e9e);}function main(){var _0xac8027=0x1388;var _0x99f49e;logger['info'](util[_0x0277('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0277('0xd')));return db[_0x0277('0xe')][_0x0277('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0277('0x10'),_0x0277('0x11')]})[_0x0277('0x12')](function(_0x28928f){if(_0x28928f){_0x99f49e=_0x28928f;_0xac8027=_0x99f49e['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x0277('0x13')][_0x0277('0x14')](util[_0x0277('0xc')](_0x0277('0x15'),QUERY),{'type':dbH[_0x0277('0x13')][_0x0277('0x16')][_0x0277('0x17')]});})[_0x0277('0x12')](function(_0x273594){if(!_0x273594[0x0][_0x0277('0x18')]){return analyticExtractedReport(_0x0277('0x19'));}var _0x34fa83=[];var _0x4d8660=0x0;if(_0x99f49e[_0x0277('0x10')]){if(_0x273594&&_0x273594[_0x0277('0x1a')]){var _0x9df36=_[_0x0277('0x1b')](_0x273594[0x0]['num']/_0xac8027);var _0x2c4e47=Number[_0x0277('0x1c')](_0x273594[0x0][_0x0277('0x18')]/_0xac8027)?_0x273594[0x0][_0x0277('0x18')]%_0xac8027:0x0;_0x9df36['forEach'](function(_0x3d6cdb){if(_0x3d6cdb>0x0){_0x4d8660+=_0xac8027;}_0x34fa83['push'](dbH[_0x0277('0x13')][_0x0277('0x14')](util['format'](_0x0277('0x1d'),QUERY,_0xac8027,_0x4d8660),{'type':dbH[_0x0277('0x13')][_0x0277('0x16')][_0x0277('0x17')]}));});if(_0x2c4e47>0x0){_0x4d8660+=_0xac8027;_0x34fa83[_0x0277('0x1e')](dbH[_0x0277('0x13')][_0x0277('0x14')](util[_0x0277('0xc')](_0x0277('0x1d'),QUERY,_0x2c4e47,_0x4d8660),{'type':dbH[_0x0277('0x13')][_0x0277('0x16')]['SELECT']}));}}}else{_0x34fa83[_0x0277('0x1e')](dbH['sequelize'][_0x0277('0x14')](QUERY,{'type':dbH[_0x0277('0x13')][_0x0277('0x16')][_0x0277('0x17')]}));}var _0x1fcc1a=path[_0x0277('0x1f')](PATH);var _0x5e21d5=path[_0x0277('0x20')](PATH,_0x0277('0x21'));var _0x20cc75=_0x99f49e[_0x0277('0x10')]&&_0x34fa83['length']>0x1;var _0xd67c2f=[];if(!fs[_0x0277('0x22')](path[_0x0277('0x23')](_0x1fcc1a,_0x5e21d5))&&_0x20cc75){fs[_0x0277('0x24')](path[_0x0277('0x23')](_0x1fcc1a,_0x5e21d5));}return BPromise['each'](_0x34fa83,function(_0x593f40){_0xd67c2f[_0x0277('0x1e')](_0x593f40);})[_0x0277('0x12')](function(){for(var _0x878687=0x0;_0x878687<_0xd67c2f[_0x0277('0x1a')];_0x878687+=0x1){var _0x264419;var _0x3df1eb=_0xd67c2f[_0x878687];if(_0x20cc75){_0x264419=path[_0x0277('0x23')](_0x1fcc1a,_0x5e21d5,util[_0x0277('0xc')](_0x0277('0x25'),_0x5e21d5,_0x878687,_0x0277('0x26')));}else{_0x264419=path[_0x0277('0x23')](_0x1fcc1a,util['format'](_0x0277('0x27'),_0x5e21d5,_0x0277('0x26')));}fs[_0x0277('0x28')](_0x264419,csv(_0x3df1eb));}})[_0x0277('0x12')](function(){if(_0x20cc75){return new Promise(function(_0x91ceeb){zipdir(path['join'](_0x1fcc1a,_0x5e21d5),{'saveTo':path['join'](_0x1fcc1a,util[_0x0277('0xc')](_0x0277('0x27'),_0x5e21d5,_0x0277('0x29')))},function(_0x84a0f8,_0x5c56e9){rimraf(path[_0x0277('0x23')](_0x1fcc1a,_0x5e21d5),function(){});_0x91ceeb(_0x0277('0x2a'));});});}})['then'](function(){logger['info'](util[_0x0277('0xc')](_0x0277('0x2b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0277('0x2c'),_0x20cc75?util[_0x0277('0xc')](_0x0277('0x27'),_0x5e21d5,_0x20cc75?_0x0277('0x29'):_0x0277('0x26')):null);});})[_0x0277('0x2d')](function(_0x3240da){logger['info'](util[_0x0277('0xc')](_0x0277('0x2e'),EXTRACTED_REPORT_ID,'CSV'),util[_0x0277('0x2f')](_0x3240da,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0277('0x30'));})[_0x0277('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0d9409f..07fcce4 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 _0x56b8=['isInteger','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','YYYY-MM-DD','toString','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','path','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','argv','savename','map','tableHeader','pick','value','length','push','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','splitSizePdf','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x56b8,0xee));var _0x856b=function(_0x317e2d,_0x4bea77){_0x317e2d=_0x317e2d-0x0;var _0x34f979=_0x56b8[_0x317e2d];return _0x34f979;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x856b('0x0'));var path=require('path');var moment=require(_0x856b('0x1'));var htmlToPdfmake=require(_0x856b('0x2'));var PdfPrinter=require(_0x856b('0x3'));var zipdir=require(_0x856b('0x4'));var rimraf=require(_0x856b('0x5'));var JSDOM=require(_0x856b('0x6'))[_0x856b('0x7')];var window=new JSDOM('')[_0x856b('0x8')];var BPromise=require(_0x856b('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x856b('0xa'))['dbH'];var logger=require(_0x856b('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x856b('0xc')][0x4];var NAME=process[_0x856b('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5268c9,_0x17e9eb){var _0x230335={'status':_0x5268c9};var _0x4df57e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17e9eb){_0x230335[_0x856b('0xd')]=_0x17e9eb;}return db['AnalyticExtractedReport']['update'](_0x230335,_0x4df57e);}function getHeaders(_0x24717d){return _[_0x856b('0xe')](_0x24717d,function(_0x59f2e0){return{'text':_0x59f2e0,'style':_0x856b('0xf')};});}function getRows(_0xc2334b,_0x3e7109){return _['map'](_0x3e7109,function(_0x471507){return _(_0x471507)[_0x856b('0x10')](_0xc2334b)[_0x856b('0xe')](function(_0x3a6049){return _0x3a6049?_['toString'](_0x3a6049):'';})[_0x856b('0x11')]();});}function createTable(_0x3527ec,_0x1ae556){var _0x4a0430={'widths':_['fill'](Array(_0x3527ec[_0x856b('0x12')]),0x91),'heights':function(_0x5a4aad){return _0x5a4aad===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3c53e9=getHeaders(_0x3527ec);_0x4a0430['body'][_0x856b('0x13')](_0x3c53e9);var _0x3cdff9=getRows(_0x3527ec,_0x1ae556);_0x4a0430[_0x856b('0x14')]=_0x4a0430['body'][_0x856b('0x15')](_0x3cdff9);return _0x4a0430;}function createTables(_0xf9c97){var _0x51bede=[];var _0xede67a=_[_0x856b('0x16')](Object['keys'](_0xf9c97[0x0]),0x5);_0xede67a[_0x856b('0x17')](function(_0x11592d){_0x51bede[_0x856b('0x13')](createTable(_0x11592d,_0xf9c97));});return _0x51bede;}function getPDFDocDefinition(_0xdc37ab){var _0x21b712=util[_0x856b('0x18')](_0x856b('0x19'),NAME,EXTRACTED_REPORT[_0x856b('0x1a')],moment(EXTRACTED_REPORT['startDate'])[_0x856b('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x856b('0x1b')])['format'](FORMAT));var _0x5dc53b=[];for(var _0x2a36c6=0x0;_0x2a36c6<_0xdc37ab[_0x856b('0x12')];_0x2a36c6++){var _0x23a86d=[];if(_0x2a36c6===0x0){_0x23a86d[_0x856b('0x13')]({'text':_0x21b712,'style':_0x856b('0x1c')});}var _0x2593a5={'table':_0xdc37ab[_0x2a36c6]};if(_0x2a36c6>0x0){_0x2593a5[_0x856b('0x1d')]=_0x856b('0x1e');_0x2593a5[_0x856b('0x1f')]=[0x0,0x46,0x0,0x0];}_0x23a86d[_0x856b('0x13')](_0x2593a5);_0x5dc53b['push'](_0x23a86d);}return{'pageSize':'A4','pageOrientation':_0x856b('0x20'),'content':_0x5dc53b,'footer':function(_0xcdbbc2,_0x46605f){return{'text':_0xcdbbc2['toString']()+_0x856b('0x21')+_0x46605f,'style':_0x856b('0x22')};},'defaultStyle':{'font':_0x856b('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x856b('0x24')},'footer':{'alignment':_0x856b('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x478484){var _0x19aabe=0x1388;var _0x489dc2;if(!_0x478484[0x0]['num']){return analyticExtractedReport(_0x856b('0x26'));}return db[_0x856b('0x27')][_0x856b('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x856b('0x29'),_0x856b('0x2a')]})[_0x856b('0x2b')](function(_0x3838a9){if(_0x3838a9){_0x489dc2=_0x3838a9;_0x19aabe=_0x489dc2[_0x856b('0x2a')]||0x3e8;}})['then'](function(){var _0x56bb0e=[];var _0x10f5ec=0x0;if(_0x489dc2[_0x856b('0x29')]){if(_0x478484&&_0x478484[_0x856b('0x12')]){var _0x425f65=_['range'](_0x478484[0x0]['num']/_0x19aabe);var _0x5986ff=Number[_0x856b('0x2c')](_0x478484[0x0][_0x856b('0x2d')]/_0x19aabe)?_0x478484[0x0]['num']%_0x19aabe:0x0;_0x425f65['forEach'](function(_0x14f880){if(_0x14f880>0x0){_0x10f5ec+=_0x19aabe;}_0x56bb0e['push'](dbH[_0x856b('0x2e')][_0x856b('0x2f')](util[_0x856b('0x18')](_0x856b('0x30'),QUERY,_0x19aabe,_0x10f5ec),{'type':dbH[_0x856b('0x2e')][_0x856b('0x31')][_0x856b('0x32')]}));});if(_0x5986ff>0x0){_0x10f5ec+=_0x19aabe;_0x56bb0e[_0x856b('0x13')](dbH[_0x856b('0x2e')][_0x856b('0x2f')](util[_0x856b('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5986ff,_0x10f5ec),{'type':dbH[_0x856b('0x2e')]['QueryTypes'][_0x856b('0x32')]}));}}}else{_0x56bb0e[_0x856b('0x13')](dbH[_0x856b('0x2e')][_0x856b('0x2f')](QUERY,{'type':dbH[_0x856b('0x2e')][_0x856b('0x31')][_0x856b('0x32')]}));}var _0x3530f3=path[_0x856b('0x33')](PATH);var _0x34e673=path[_0x856b('0x34')](PATH,_0x856b('0x35'));var _0x1efcda=_0x489dc2[_0x856b('0x29')]&&_0x56bb0e[_0x856b('0x12')]>0x1;var _0x132361=[];if(!fs[_0x856b('0x36')](path[_0x856b('0x37')](_0x3530f3,_0x34e673))&&_0x1efcda){fs['mkdirSync'](path[_0x856b('0x37')](_0x3530f3,_0x34e673));}return BPromise[_0x856b('0x38')](_0x56bb0e,function(_0x21a4db){_0x132361[_0x856b('0x13')](_0x21a4db);})[_0x856b('0x2b')](function(){var _0xb1da30=[];for(var _0x51d33c=0x0;_0x51d33c<_0x132361[_0x856b('0x12')];_0x51d33c+=0x1){var _0x43da2b=_0x132361[_0x51d33c];var _0x4b8bfc=createTables(_[_0x856b('0x39')](_0x43da2b));var _0x46ff66;var _0x29b5e3=getPDFDocDefinition(_0x4b8bfc);var _0x324110=getPDFPrinter();var _0x358e33=_0x324110[_0x856b('0x3a')](_0x29b5e3);if(_0x1efcda){_0x46ff66=path[_0x856b('0x37')](_0x3530f3,_0x34e673,util[_0x856b('0x18')](_0x856b('0x3b'),_0x34e673,_0x51d33c,_0x856b('0x3c')));}else{_0x46ff66=path[_0x856b('0x37')](_0x3530f3,util[_0x856b('0x18')](_0x856b('0x3d'),_0x34e673,_0x856b('0x3c')));}_0xb1da30[_0x856b('0x13')](writePDFDocument(_0x358e33,_0x46ff66));}return Promise[_0x856b('0x3e')](_0xb1da30);})[_0x856b('0x2b')](function(){if(_0x1efcda){return new Promise(function(_0x1034f9){zipdir(path[_0x856b('0x37')](_0x3530f3,_0x34e673),{'saveTo':path[_0x856b('0x37')](_0x3530f3,util[_0x856b('0x18')]('%s.%s',_0x34e673,_0x856b('0x3f')))},function(){rimraf(path[_0x856b('0x37')](_0x3530f3,_0x34e673),function(){});_0x1034f9(_0x856b('0x40'));});});}})[_0x856b('0x2b')](function(){if(!_0x1efcda)return;rimraf(path[_0x856b('0x37')](_0x3530f3,_0x34e673),function(){});})[_0x856b('0x2b')](function(){logger[_0x856b('0x41')](util['format'](_0x856b('0x42'),EXTRACTED_REPORT_ID,_0x856b('0x43')));return analyticExtractedReport(_0x856b('0x44'),_0x1efcda?util['format'](_0x856b('0x3d'),_0x34e673,_0x1efcda?_0x856b('0x3f'):_0x856b('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x856b('0x45'),EXTRACTED_REPORT_ID,_0x856b('0x43')));return db[_0x856b('0x46')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x856b('0x2b')](function(_0x4723c3){EXTRACTED_REPORT=_0x4723c3;return dbH[_0x856b('0x2e')][_0x856b('0x2f')](util['format'](_0x856b('0x47'),QUERY),{'type':dbH[_0x856b('0x2e')][_0x856b('0x31')]['SELECT']});})['then'](extractReport)[_0x856b('0x48')](function(_0x26185a){logger['info'](util[_0x856b('0x18')](_0x856b('0x49'),EXTRACTED_REPORT_ID,_0x856b('0x43')),util[_0x856b('0x4a')](_0x26185a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x856b('0x4b'));})[_0x856b('0x4c')](function(){process[_0x856b('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4e8f59=new PdfPrinter({'Arial':{'normal':__dirname+_0x856b('0x4e'),'bold':__dirname+_0x856b('0x4f'),'italics':__dirname+_0x856b('0x50'),'bolditalics':__dirname+_0x856b('0x51')}});return _0x4e8f59;}function getPDFDocDefinitionFromHTML(_0x3dfe55,_0xdf8082){var _0x23a807=util[_0x856b('0x18')](_0x856b('0x52'),_0xdf8082['channel'],_0xdf8082['interactionId']);var _0x1d13cd=moment()[_0x856b('0x18')](_0x856b('0x53'))[_0x856b('0x54')]();var _0x145a1a=htmlToPdfmake(_0x3dfe55,{'window':window,'tableAutoSize':!![]});return{'content':[_0x145a1a],'defaultStyle':{'font':_0x856b('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x856b('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x856b('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x856b('0x55')}},'header':function(){return[{'text':_0x856b('0x56'),'style':_0x856b('0x1c')}];},'footer':function(_0x593398,_0x110128){return[{'text':util[_0x856b('0x18')](_0x856b('0x57'),_0x23a807,_0x593398,_0x110128,_0x1d13cd),'style':_0x856b('0x22')}];}};}function writePDFDocument(_0xc76054,_0x2e1121){return new Promise(function(_0x5a3a72,_0xd5b2e){var _0xe9ab6b=_0xc76054['pipe'](fs[_0x856b('0x58')](_0x2e1121));_0xe9ab6b['on'](_0x856b('0x59'),function(){_0x5a3a72(_0x856b('0x59'));});_0xe9ab6b['on'](_0x856b('0x5a'),function(_0x430b15){_0xd5b2e(_0x430b15);});_0xc76054[_0x856b('0x5b')]();});}exports[_0x856b('0x5c')]=function(_0x30e140,_0x3cd369){var _0x5ae735=getPDFPrinter();var _0x4a6d82=getPDFDocDefinitionFromHTML(_0x30e140,_0x3cd369);var _0x55a612=_0x5ae735[_0x856b('0x3a')](_0x4a6d82);return writePDFDocument(_0x55a612,_0x3cd369[_0x856b('0x5d')])[_0x856b('0x48')](function(_0x37e9a7){throw _0x37e9a7;});}; \ No newline at end of file +var _0x6ea5=['query','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','pick','toString','fill','length','auto','body','push','concat','chunk','keys','format','endDate','header','before','landscape','\x20/\x20','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT'];(function(_0x3cff6c,_0x107a6c){var _0x442fb7=function(_0x40221c){while(--_0x40221c){_0x3cff6c['push'](_0x3cff6c['shift']());}};_0x442fb7(++_0x107a6c);}(_0x6ea5,0xda));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x56ea('0x0'));var moment=require('moment');var htmlToPdfmake=require(_0x56ea('0x1'));var PdfPrinter=require(_0x56ea('0x2'));var zipdir=require(_0x56ea('0x3'));var rimraf=require(_0x56ea('0x4'));var JSDOM=require(_0x56ea('0x5'))['JSDOM'];var window=new JSDOM('')[_0x56ea('0x6')];var BPromise=require(_0x56ea('0x7'));var db=require(_0x56ea('0x8'))['db'];var dbH=require(_0x56ea('0x8'))[_0x56ea('0x9')];var logger=require(_0x56ea('0xa'))(_0x56ea('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x56ea('0xc')][0x2]);var QUERY=process[_0x56ea('0xc')][0x3];var PATH=process[_0x56ea('0xc')][0x4];var NAME=process[_0x56ea('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x54fe0e,_0x47130c){var _0x760f06={'status':_0x54fe0e};var _0x22024a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x47130c){_0x760f06[_0x56ea('0xd')]=_0x47130c;}return db[_0x56ea('0xe')][_0x56ea('0xf')](_0x760f06,_0x22024a);}function getHeaders(_0x1929f8){return _[_0x56ea('0x10')](_0x1929f8,function(_0xb5fef7){return{'text':_0xb5fef7,'style':'tableHeader'};});}function getRows(_0x5c6c8f,_0x5775fe){return _[_0x56ea('0x10')](_0x5775fe,function(_0x123eef){return _(_0x123eef)[_0x56ea('0x11')](_0x5c6c8f)[_0x56ea('0x10')](function(_0x48e61c){return _0x48e61c?_[_0x56ea('0x12')](_0x48e61c):'';})['value']();});}function createTable(_0x3b1ffb,_0x2fcf58){var _0x3f5886={'widths':_[_0x56ea('0x13')](Array(_0x3b1ffb[_0x56ea('0x14')]),0x91),'heights':function(_0x1a305a){return _0x1a305a===0x0?_0x56ea('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x32bda7=getHeaders(_0x3b1ffb);_0x3f5886[_0x56ea('0x16')][_0x56ea('0x17')](_0x32bda7);var _0x562944=getRows(_0x3b1ffb,_0x2fcf58);_0x3f5886[_0x56ea('0x16')]=_0x3f5886[_0x56ea('0x16')][_0x56ea('0x18')](_0x562944);return _0x3f5886;}function createTables(_0x1ff983){var _0x39be94=[];var _0x5922d1=_[_0x56ea('0x19')](Object[_0x56ea('0x1a')](_0x1ff983[0x0]),0x5);_0x5922d1['forEach'](function(_0x41b2c2){_0x39be94[_0x56ea('0x17')](createTable(_0x41b2c2,_0x1ff983));});return _0x39be94;}function getPDFDocDefinition(_0x412637){var _0x1f5e7b=util[_0x56ea('0x1b')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x56ea('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x56ea('0x1c')])[_0x56ea('0x1b')](FORMAT));var _0x258299=[];for(var _0x5af73f=0x0;_0x5af73f<_0x412637[_0x56ea('0x14')];_0x5af73f++){var _0x4a67a0=[];if(_0x5af73f===0x0){_0x4a67a0[_0x56ea('0x17')]({'text':_0x1f5e7b,'style':_0x56ea('0x1d')});}var _0x4f1a6b={'table':_0x412637[_0x5af73f]};if(_0x5af73f>0x0){_0x4f1a6b['pageBreak']=_0x56ea('0x1e');_0x4f1a6b['margin']=[0x0,0x46,0x0,0x0];}_0x4a67a0[_0x56ea('0x17')](_0x4f1a6b);_0x258299['push'](_0x4a67a0);}return{'pageSize':'A4','pageOrientation':_0x56ea('0x1f'),'content':_0x258299,'footer':function(_0x3fd298,_0x424199){return{'text':_0x3fd298['toString']()+_0x56ea('0x20')+_0x424199,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x56ea('0x21')},'footer':{'alignment':_0x56ea('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x58c602){var _0x312103=0x1388;var _0x531e1c;if(!_0x58c602[0x0][_0x56ea('0x23')]){return analyticExtractedReport(_0x56ea('0x24'));}return db[_0x56ea('0x25')][_0x56ea('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x56ea('0x27')]})[_0x56ea('0x28')](function(_0x16d30a){if(_0x16d30a){_0x531e1c=_0x16d30a;_0x312103=_0x531e1c['splitSizePdf']||0x3e8;}})[_0x56ea('0x28')](function(){var _0x284a08=[];var _0x4b4f58=0x0;if(_0x531e1c[_0x56ea('0x29')]){if(_0x58c602&&_0x58c602[_0x56ea('0x14')]){var _0x616c2e=_[_0x56ea('0x2a')](_0x58c602[0x0]['num']/_0x312103);var _0xe9f98a=Number[_0x56ea('0x2b')](_0x58c602[0x0]['num']/_0x312103)?_0x58c602[0x0][_0x56ea('0x23')]%_0x312103:0x0;_0x616c2e[_0x56ea('0x2c')](function(_0x1217a2){if(_0x1217a2>0x0){_0x4b4f58+=_0x312103;}_0x284a08['push'](dbH[_0x56ea('0x2d')]['query'](util[_0x56ea('0x1b')](_0x56ea('0x2e'),QUERY,_0x312103,_0x4b4f58),{'type':dbH['sequelize'][_0x56ea('0x2f')][_0x56ea('0x30')]}));});if(_0xe9f98a>0x0){_0x4b4f58+=_0x312103;_0x284a08[_0x56ea('0x17')](dbH[_0x56ea('0x2d')][_0x56ea('0x31')](util[_0x56ea('0x1b')](_0x56ea('0x2e'),QUERY,_0xe9f98a,_0x4b4f58),{'type':dbH['sequelize']['QueryTypes'][_0x56ea('0x30')]}));}}}else{_0x284a08[_0x56ea('0x17')](dbH[_0x56ea('0x2d')]['query'](QUERY,{'type':dbH['sequelize'][_0x56ea('0x2f')]['SELECT']}));}var _0x19db89=path[_0x56ea('0x32')](PATH);var _0x193f8b=path[_0x56ea('0x33')](PATH,_0x56ea('0x34'));var _0x52e9cd=_0x531e1c[_0x56ea('0x29')]&&_0x284a08[_0x56ea('0x14')]>0x1;var _0x4cd31b=[];if(!fs[_0x56ea('0x35')](path[_0x56ea('0x36')](_0x19db89,_0x193f8b))&&_0x52e9cd){fs['mkdirSync'](path[_0x56ea('0x36')](_0x19db89,_0x193f8b));}return BPromise[_0x56ea('0x37')](_0x284a08,function(_0xb7c864){_0x4cd31b['push'](_0xb7c864);})[_0x56ea('0x28')](function(){var _0x4e7e4d=[];for(var _0x3ced38=0x0;_0x3ced38<_0x4cd31b['length'];_0x3ced38+=0x1){var _0x543c3d=_0x4cd31b[_0x3ced38];var _0x1f49bf=createTables(_[_0x56ea('0x38')](_0x543c3d));var _0x4c08f2;var _0x22046d=getPDFDocDefinition(_0x1f49bf);var _0x56f5b6=getPDFPrinter();var _0xbafc41=_0x56f5b6[_0x56ea('0x39')](_0x22046d);if(_0x52e9cd){_0x4c08f2=path[_0x56ea('0x36')](_0x19db89,_0x193f8b,util[_0x56ea('0x1b')]('%s%d.%s',_0x193f8b,_0x3ced38,_0x56ea('0x3a')));}else{_0x4c08f2=path[_0x56ea('0x36')](_0x19db89,util[_0x56ea('0x1b')]('%s.%s',_0x193f8b,_0x56ea('0x3a')));}_0x4e7e4d[_0x56ea('0x17')](writePDFDocument(_0xbafc41,_0x4c08f2));}return Promise[_0x56ea('0x3b')](_0x4e7e4d);})['then'](function(){if(_0x52e9cd){return new Promise(function(_0x10fed0){zipdir(path['join'](_0x19db89,_0x193f8b),{'saveTo':path[_0x56ea('0x36')](_0x19db89,util[_0x56ea('0x1b')](_0x56ea('0x3c'),_0x193f8b,_0x56ea('0x3d')))},function(){rimraf(path[_0x56ea('0x36')](_0x19db89,_0x193f8b),function(){});_0x10fed0(_0x56ea('0x3e'));});});}})[_0x56ea('0x28')](function(){if(!_0x52e9cd)return;rimraf(path[_0x56ea('0x36')](_0x19db89,_0x193f8b),function(){});})[_0x56ea('0x28')](function(){logger[_0x56ea('0x3f')](util[_0x56ea('0x1b')](_0x56ea('0x40'),EXTRACTED_REPORT_ID,_0x56ea('0x41')));return analyticExtractedReport(_0x56ea('0x42'),_0x52e9cd?util['format'](_0x56ea('0x3c'),_0x193f8b,_0x52e9cd?'zip':_0x56ea('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x56ea('0x3f')](util[_0x56ea('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x56ea('0x41')));return db['AnalyticExtractedReport'][_0x56ea('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x56ea('0x28')](function(_0x10718f){EXTRACTED_REPORT=_0x10718f;return dbH[_0x56ea('0x2d')][_0x56ea('0x31')](util[_0x56ea('0x1b')](_0x56ea('0x44'),QUERY),{'type':dbH[_0x56ea('0x2d')]['QueryTypes'][_0x56ea('0x30')]});})[_0x56ea('0x28')](extractReport)[_0x56ea('0x45')](function(_0x5e258f){logger[_0x56ea('0x3f')](util[_0x56ea('0x1b')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x56ea('0x41')),util[_0x56ea('0x46')](_0x5e258f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x56ea('0x47'));})[_0x56ea('0x48')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2bb6ba=new PdfPrinter({'Arial':{'normal':__dirname+_0x56ea('0x49'),'bold':__dirname+_0x56ea('0x4a'),'italics':__dirname+_0x56ea('0x4b'),'bolditalics':__dirname+_0x56ea('0x4c')}});return _0x2bb6ba;}function getPDFDocDefinitionFromHTML(_0x4f274a,_0x5b7840){var _0x5f3dd2=util[_0x56ea('0x1b')]('%s\x20#%d',_0x5b7840[_0x56ea('0x4d')],_0x5b7840[_0x56ea('0x4e')]);var _0x591490=moment()[_0x56ea('0x1b')](_0x56ea('0x4f'))[_0x56ea('0x12')]();var _0x3edd96=htmlToPdfmake(_0x4f274a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3edd96],'defaultStyle':{'font':_0x56ea('0x50')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x56ea('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x56ea('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x56ea('0x51')}},'header':function(){return[{'text':_0x56ea('0x52'),'style':_0x56ea('0x1d')}];},'footer':function(_0x1bed1a,_0x6f8b7f){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x5f3dd2,_0x1bed1a,_0x6f8b7f,_0x591490),'style':'footer'}];}};}function writePDFDocument(_0xc23ad8,_0x5db996){return new Promise(function(_0x20fa23,_0x292df8){var _0x4715c7=_0xc23ad8[_0x56ea('0x53')](fs[_0x56ea('0x54')](_0x5db996));_0x4715c7['on']('finish',function(){_0x20fa23(_0x56ea('0x55'));});_0x4715c7['on'](_0x56ea('0x56'),function(_0x3961c6){_0x292df8(_0x3961c6);});_0xc23ad8[_0x56ea('0x57')]();});}exports[_0x56ea('0x58')]=function(_0xb80c0f,_0x4c09fc){var _0x512668=getPDFPrinter();var _0x46acef=getPDFDocDefinitionFromHTML(_0xb80c0f,_0x4c09fc);var _0x2a8019=_0x512668[_0x56ea('0x39')](_0x46acef);return writePDFDocument(_0x2a8019,_0x4c09fc['path'])[_0x56ea('0x45')](function(_0x450907){throw _0x450907;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d29edc8..75098f2 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 _0x4f03=['../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH'];(function(_0x18392b,_0x432937){var _0x269280=function(_0x2eb3d3){while(--_0x2eb3d3){_0x18392b['push'](_0x18392b['shift']());}};_0x269280(++_0x432937);}(_0x4f03,0xb9));var _0x34f0=function(_0x3c4d2a,_0x1e5816){_0x3c4d2a=_0x3c4d2a-0x0;var _0x596a0b=_0x4f03[_0x3c4d2a];return _0x596a0b;};'use strict';var util=require('util');var path=require(_0x34f0('0x0'));var _=require(_0x34f0('0x1'));var fs=require('fs');var json2xls=require(_0x34f0('0x2'));var BPromise=require(_0x34f0('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x34f0('0x4'));var db=require(_0x34f0('0x5'))['db'];var dbH=require(_0x34f0('0x5'))[_0x34f0('0x6')];var logger=require(_0x34f0('0x7'))(_0x34f0('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x34f0('0x9')][0x3];var PATH=process[_0x34f0('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x572d07,_0x27d745){var _0x49e032={'status':_0x572d07};var _0x2f0117={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x27d745){_0x49e032[_0x34f0('0xa')]=_0x27d745;}return db[_0x34f0('0xb')][_0x34f0('0xc')](_0x49e032,_0x2f0117);}function main(){var _0x22c26f=0x1388;var _0xdf2c03;logger['info'](util[_0x34f0('0xd')](_0x34f0('0xe'),EXTRACTED_REPORT_ID,_0x34f0('0xf')));return db[_0x34f0('0x10')][_0x34f0('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x34f0('0x12'),_0x34f0('0x13')]})[_0x34f0('0x14')](function(_0x3ca57d){if(_0x3ca57d){_0xdf2c03=_0x3ca57d;_0x22c26f=_0xdf2c03['splitSizeXlsx']||0x1388;}})[_0x34f0('0x14')](function(){return dbH[_0x34f0('0x15')][_0x34f0('0x16')](util[_0x34f0('0xd')](_0x34f0('0x17'),QUERY),{'type':dbH[_0x34f0('0x15')][_0x34f0('0x18')][_0x34f0('0x19')]});})[_0x34f0('0x14')](function(_0xf43b2a){if(!_0xf43b2a[0x0][_0x34f0('0x1a')]){return analyticExtractedReport('Empty');}var _0x22fb6b=[];var _0x18c803=0x0;if(_0xdf2c03[_0x34f0('0x12')]){if(_0xf43b2a&&_0xf43b2a[_0x34f0('0x1b')]){var _0x40de01=_['range'](_0xf43b2a[0x0][_0x34f0('0x1a')]/_0x22c26f);var _0x2eaff0=Number[_0x34f0('0x1c')](_0xf43b2a[0x0][_0x34f0('0x1a')]/_0x22c26f)?_0xf43b2a[0x0][_0x34f0('0x1a')]%_0x22c26f:0x0;_0x40de01[_0x34f0('0x1d')](function(_0x186c1e){if(_0x186c1e>0x0){_0x18c803+=_0x22c26f;}_0x22fb6b[_0x34f0('0x1e')](dbH[_0x34f0('0x15')][_0x34f0('0x16')](util[_0x34f0('0xd')](_0x34f0('0x1f'),QUERY,_0x22c26f,_0x18c803),{'type':dbH[_0x34f0('0x15')][_0x34f0('0x18')][_0x34f0('0x19')]}));});if(_0x2eaff0>0x0){_0x18c803+=_0x22c26f;_0x22fb6b[_0x34f0('0x1e')](dbH[_0x34f0('0x15')][_0x34f0('0x16')](util[_0x34f0('0xd')](_0x34f0('0x1f'),QUERY,_0x2eaff0,_0x18c803),{'type':dbH[_0x34f0('0x15')]['QueryTypes']['SELECT']}));}}}else{_0x22fb6b['push'](dbH[_0x34f0('0x15')][_0x34f0('0x16')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x34f0('0x19')]}));}var _0x110716=path[_0x34f0('0x20')](PATH);var _0x10cccd=path['basename'](PATH,'.xlsx');var _0x1a8d78=_0xdf2c03['split']&&_0x22fb6b[_0x34f0('0x1b')]>0x1;var _0x15ec6b=[];if(!fs[_0x34f0('0x21')](path[_0x34f0('0x22')](_0x110716,_0x10cccd))&&_0x1a8d78){fs['mkdirSync'](path['join'](_0x110716,_0x10cccd));}return BPromise['each'](_0x22fb6b,function(_0x4275d5){_0x15ec6b[_0x34f0('0x1e')](_0x4275d5);})[_0x34f0('0x14')](function(){for(var _0x1e10be=0x0;_0x1e10be<_0x15ec6b[_0x34f0('0x1b')];_0x1e10be+=0x1){var _0x161806;var _0x8b7111=_0x15ec6b[_0x1e10be];if(_0x1a8d78){_0x161806=path[_0x34f0('0x22')](_0x110716,_0x10cccd,util['format'](_0x34f0('0x23'),_0x10cccd,_0x1e10be,_0x34f0('0x24')));}else{_0x161806=path['join'](_0x110716,util[_0x34f0('0xd')]('%s.%s',_0x10cccd,'xlsx'));}fs[_0x34f0('0x25')](_0x161806,json2xls(_0x8b7111),_0x34f0('0x26'));}})[_0x34f0('0x14')](function(){if(_0x1a8d78){return new Promise(function(_0x1495ff){zipdir(path[_0x34f0('0x22')](_0x110716,_0x10cccd),{'saveTo':path[_0x34f0('0x22')](_0x110716,util[_0x34f0('0xd')](_0x34f0('0x27'),_0x10cccd,_0x34f0('0x28')))},function(_0x3452b1,_0x7642a3){rimraf(path[_0x34f0('0x22')](_0x110716,_0x10cccd),function(){});_0x1495ff('zip\x20finished');});});}})[_0x34f0('0x14')](function(){logger[_0x34f0('0x29')](util[_0x34f0('0xd')](_0x34f0('0x2a'),EXTRACTED_REPORT_ID,_0x34f0('0xf')));return analyticExtractedReport(_0x34f0('0x2b'),_0x1a8d78?util[_0x34f0('0xd')](_0x34f0('0x27'),_0x10cccd,_0x1a8d78?_0x34f0('0x28'):_0x34f0('0x24')):null);});})[_0x34f0('0x2c')](function(_0x2aa23c){logger[_0x34f0('0x29')](util[_0x34f0('0xd')](_0x34f0('0x2d'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x34f0('0x2e')](_0x2aa23c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x34f0('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7b3d=['info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7b3d,0x1ca));var _0xd7b3=function(_0x198347,_0x2d830b){_0x198347=_0x198347-0x0;var _0x311799=_0x7b3d[_0x198347];return _0x311799;};'use strict';var util=require(_0xd7b3('0x0'));var path=require(_0xd7b3('0x1'));var _=require(_0xd7b3('0x2'));var fs=require('fs');var json2xls=require(_0xd7b3('0x3'));var BPromise=require('bluebird');var zipdir=require(_0xd7b3('0x4'));var rimraf=require(_0xd7b3('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xd7b3('0x6')];var logger=require(_0xd7b3('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd7b3('0x8')][0x2]);var QUERY=process[_0xd7b3('0x8')][0x3];var PATH=process[_0xd7b3('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a50af,_0x4ee217){var _0x2975e4={'status':_0x4a50af};var _0x4d8fdc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4ee217){_0x2975e4[_0xd7b3('0x9')]=_0x4ee217;}return db[_0xd7b3('0xa')][_0xd7b3('0xb')](_0x2975e4,_0x4d8fdc);}function main(){var _0x42fe8e=0x1388;var _0x27a5ed;logger['info'](util[_0xd7b3('0xc')](_0xd7b3('0xd'),EXTRACTED_REPORT_ID,_0xd7b3('0xe')));return db[_0xd7b3('0xf')][_0xd7b3('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd7b3('0x11'),_0xd7b3('0x12')]})[_0xd7b3('0x13')](function(_0x4c66af){if(_0x4c66af){_0x27a5ed=_0x4c66af;_0x42fe8e=_0x27a5ed['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xd7b3('0x14')][_0xd7b3('0x15')](util[_0xd7b3('0xc')](_0xd7b3('0x16'),QUERY),{'type':dbH[_0xd7b3('0x14')][_0xd7b3('0x17')]['SELECT']});})[_0xd7b3('0x13')](function(_0x45253c){if(!_0x45253c[0x0]['num']){return analyticExtractedReport(_0xd7b3('0x18'));}var _0x15bf96=[];var _0x3a353d=0x0;if(_0x27a5ed['split']){if(_0x45253c&&_0x45253c[_0xd7b3('0x19')]){var _0x17854c=_['range'](_0x45253c[0x0][_0xd7b3('0x1a')]/_0x42fe8e);var _0x581b88=Number['isInteger'](_0x45253c[0x0][_0xd7b3('0x1a')]/_0x42fe8e)?_0x45253c[0x0][_0xd7b3('0x1a')]%_0x42fe8e:0x0;_0x17854c[_0xd7b3('0x1b')](function(_0x2c808e){if(_0x2c808e>0x0){_0x3a353d+=_0x42fe8e;}_0x15bf96['push'](dbH[_0xd7b3('0x14')]['query'](util[_0xd7b3('0xc')](_0xd7b3('0x1c'),QUERY,_0x42fe8e,_0x3a353d),{'type':dbH[_0xd7b3('0x14')][_0xd7b3('0x17')]['SELECT']}));});if(_0x581b88>0x0){_0x3a353d+=_0x42fe8e;_0x15bf96[_0xd7b3('0x1d')](dbH['sequelize'][_0xd7b3('0x15')](util[_0xd7b3('0xc')](_0xd7b3('0x1c'),QUERY,_0x581b88,_0x3a353d),{'type':dbH[_0xd7b3('0x14')][_0xd7b3('0x17')]['SELECT']}));}}}else{_0x15bf96[_0xd7b3('0x1d')](dbH[_0xd7b3('0x14')][_0xd7b3('0x15')](QUERY,{'type':dbH[_0xd7b3('0x14')][_0xd7b3('0x17')][_0xd7b3('0x1e')]}));}var _0x124926=path['dirname'](PATH);var _0x174133=path['basename'](PATH,_0xd7b3('0x1f'));var _0x41fbab=_0x27a5ed[_0xd7b3('0x11')]&&_0x15bf96[_0xd7b3('0x19')]>0x1;var _0x5bdf53=[];if(!fs[_0xd7b3('0x20')](path[_0xd7b3('0x21')](_0x124926,_0x174133))&&_0x41fbab){fs[_0xd7b3('0x22')](path[_0xd7b3('0x21')](_0x124926,_0x174133));}return BPromise[_0xd7b3('0x23')](_0x15bf96,function(_0x40ef7d){_0x5bdf53[_0xd7b3('0x1d')](_0x40ef7d);})[_0xd7b3('0x13')](function(){for(var _0x456ff0=0x0;_0x456ff0<_0x5bdf53[_0xd7b3('0x19')];_0x456ff0+=0x1){var _0x20b8a4;var _0x5ccb64=_0x5bdf53[_0x456ff0];if(_0x41fbab){_0x20b8a4=path[_0xd7b3('0x21')](_0x124926,_0x174133,util['format']('%s%d.%s',_0x174133,_0x456ff0,_0xd7b3('0x24')));}else{_0x20b8a4=path[_0xd7b3('0x21')](_0x124926,util[_0xd7b3('0xc')](_0xd7b3('0x25'),_0x174133,_0xd7b3('0x24')));}fs[_0xd7b3('0x26')](_0x20b8a4,json2xls(_0x5ccb64),_0xd7b3('0x27'));}})[_0xd7b3('0x13')](function(){if(_0x41fbab){return new Promise(function(_0x158356){zipdir(path[_0xd7b3('0x21')](_0x124926,_0x174133),{'saveTo':path[_0xd7b3('0x21')](_0x124926,util[_0xd7b3('0xc')](_0xd7b3('0x25'),_0x174133,_0xd7b3('0x28')))},function(_0x1aa5b9,_0x372e4c){rimraf(path[_0xd7b3('0x21')](_0x124926,_0x174133),function(){});_0x158356(_0xd7b3('0x29'));});});}})[_0xd7b3('0x13')](function(){logger[_0xd7b3('0x2a')](util[_0xd7b3('0xc')](_0xd7b3('0x2b'),EXTRACTED_REPORT_ID,_0xd7b3('0xe')));return analyticExtractedReport(_0xd7b3('0x2c'),_0x41fbab?util[_0xd7b3('0xc')](_0xd7b3('0x25'),_0x174133,_0x41fbab?_0xd7b3('0x28'):_0xd7b3('0x24')):null);});})[_0xd7b3('0x2d')](function(_0x1aba9d){logger[_0xd7b3('0x2a')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd7b3('0xe')),util[_0xd7b3('0x2e')](_0x1aba9d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd7b3('0x2f'));})[_0xd7b3('0x30')](function(){process[_0xd7b3('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index ffdf12f..6740cc4 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 _0x5741=['outbound','CDR(destination)=','cutdigits','${EXTEN:','extension','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','*,*,*,*','map','interval','tag','CDR(tag)=','callerID','$[${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-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','catch','error','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','extensions','push','Set','CDR(type)=%s','type','context','VoiceExtensionId','CDR(routeid)='];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x5741,0x1ca));var _0x1574=function(_0x5a41a0,_0x578f73){_0x5a41a0=_0x5a41a0-0x0;var _0x5ef041=_0x5741[_0x5a41a0];return _0x5ef041;};'use strict';var _=require(_0x1574('0x0'));var util=require(_0x1574('0x1'));function rewrite(_0x349716,_0x28ee5f){var _0x245959=this;return _0x349716[_0x1574('0x2')][_0x1574('0x3')][_0x1574('0x4')]({'raw':!![]})[_0x1574('0x5')](function(_0x395961){_0x245959[_0x1574('0x6')]=_0x395961;return _0x349716[_0x1574('0x2')]['VoiceExtension'][_0x1574('0x4')]({'where':{'IntervalId':_0x28ee5f[_0x1574('0x7')]},'raw':!![]});})[_0x1574('0x5')](function(_0x3deb9e){return _0x349716[_0x1574('0x2')][_0x1574('0x8')][_0x1574('0x4')]({'where':{'exten':{'$in':_[_0x1574('0x9')](_['map'](_0x3deb9e,_0x1574('0xa')))}},'order':[{'raw':_0x1574('0xb')}],'raw':!![]});})[_0x1574('0x5')](function(_0x4081e0){var _0x2f88cb=_[_0x1574('0xc')](_0x4081e0,{'priority':'1'});var _0x3e6083=_[_0x1574('0xc')](_0x4081e0,{'isApp':0x1});var _0x7c8ec4=_['groupBy'](_0x3e6083,_0x1574('0xa'));var _0xd91ed=[_0x1574('0xd'),_0x1574('0xe')];var _0x2a093c=[];var _0x4a85d4=[];for(var _0x340951 in _0x7c8ec4){if(_0x7c8ec4[_0x1574('0xf')](_0x340951)){_0x245959[_0x1574('0x10')]=0x2;_0x245959['extensions']=[];_0x245959['extension']=_['find'](_0x2f88cb,{'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')]});_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0]['type'],'app':_0x1574('0x13'),'appdata':util['format'](_0x1574('0x14'),_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')]),'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});if(_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')]==='inbound'){_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0]['type'],'app':_0x1574('0x13'),'appdata':_0x1574('0x18')+_0x7c8ec4[_0x340951][0x0]['VoiceExtensionId'],'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});}else if(_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')]===_0x1574('0x19')){if(_0x245959['extension']){_0x245959[_0x1574('0x11')]['push']({'type':_0x7c8ec4[_0x340951][0x0]['type'],'app':'Set','appdata':_0x1574('0x1a')+(_0x245959['extension'][_0x1574('0x1b')]?_0x1574('0x1c')+_0x245959[_0x1574('0x1d')]['cutdigits']+'}':_0x1574('0x1e')),'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});}_0x245959[_0x1574('0x11')]['push']({'type':_0x7c8ec4[_0x340951][0x0]['type'],'app':_0x1574('0x13'),'appdata':_0x1574('0x18')+_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')],'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});var _0x54cefd=_0x245959[_0x1574('0x10')]++;_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')],'app':_0x1574('0x1f'),'appdata':_0x1574('0x20')+(_0x54cefd+0x2)+_0x1574('0x21')+(_0x54cefd+0x1)+')','context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0]['exten'],'priority':_0x54cefd,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});if(_0x245959[_0x1574('0x1d')]){_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0]['type'],'app':_0x1574('0x13'),'appdata':_0x245959[_0x1574('0x1d')][_0x1574('0x1b')]?_0x1574('0x22')+_0x245959[_0x1574('0x1d')]['cutdigits']+'}':_0x1574('0x23'),'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});}_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')],'app':'Set','appdata':_0x1574('0x24')+_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')],'context':_0x7c8ec4[_0x340951][0x0]['context'],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});if(_0x245959[_0x1574('0x1d')]&&_0x245959[_0x1574('0x1d')][_0x1574('0xf')](_0x1574('0x25'))&&_0x245959[_0x1574('0x1d')]['recordingFormat']!=='none'){_0x245959['extensions']['push']({'type':_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')],'app':_0x1574('0x13'),'appdata':_0x1574('0x26'),'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959['priority']++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0]['VoiceExtensionId']});_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')],'app':_0x1574('0x13'),'appdata':_0x1574('0x27')+_0x245959['extension'][_0x1574('0x25')]||'wav','context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0]['VoiceExtensionId']});}}_0x245959['extensions'][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')],'app':_0x1574('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0]['exten'],'priority':_0x245959['priority']++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});_0x245959[_0x1574('0x11')]['push']({'type':_0x7c8ec4[_0x340951][0x0]['type'],'app':'Set','appdata':_0x1574('0x28'),'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0]['exten'],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0][_0x1574('0x15')],'app':_0x1574('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'priority':_0x245959[_0x1574('0x10')]++,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});for(var _0xe6fcac=0x0,_0x55db92=0x0;_0xe6fcac<_0x7c8ec4[_0x340951][_0x1574('0x29')];_0xe6fcac+=0x1,_0x55db92=0x0){var _0x659371=_0x7c8ec4[_0x340951][_0xe6fcac];if(_0x659371[_0x1574('0x15')]){_0x659371[_0x1574('0x15')]=_0x659371[_0x1574('0x15')]['toLowerCase']();}var _0x4aa6a8=[];var _0x143b5d=[];delete _0x659371['id'];delete _0x659371[_0x1574('0x2a')];delete _0x659371[_0x1574('0x2b')];var _0x5c765f=_0x659371['interval']!==_0x1574('0x2c')?[_0x659371['interval']]:_0x659371[_0x1574('0x7')]?_[_0x1574('0x2d')](_['filter'](_0x245959[_0x1574('0x6')],{'IntervalId':_0x659371[_0x1574('0x7')]}),_0x1574('0x2e')):[];if(_0x659371['hasOwnProperty'](_0x1574('0x2f'))){if(_0x659371['tag']&&_0x659371[_0x1574('0x2f')]!=='--'){_0x4aa6a8[_0x1574('0x12')]({'type':_0x659371[_0x1574('0x15')],'app':_0x1574('0x13'),'appdata':_0x1574('0x30')+_0x659371[_0x1574('0x2f')],'context':_0x659371[_0x1574('0x16')],'exten':_0x659371[_0x1574('0xa')],'priority':_0x5c765f['length']+_0x245959[_0x1574('0x10')]+_0x55db92++,'VoiceExtensionId':_0x659371[_0x1574('0x17')]});}}if(_0x659371[_0x1574('0x15')]===_0x1574('0x19')&&_0x659371[_0x1574('0xf')](_0x1574('0x31'))){if(_0x659371[_0x1574('0x31')]){_0x4aa6a8['push']({'type':_0x659371[_0x1574('0x15')],'app':_0x1574('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x659371['callerID']+')','context':_0x659371[_0x1574('0x16')],'exten':_0x659371[_0x1574('0xa')],'priority':_0x5c765f[_0x1574('0x29')]+_0x245959[_0x1574('0x10')]+_0x55db92++,'VoiceExtensionId':_0x659371['VoiceExtensionId']});}else{_0x4aa6a8[_0x1574('0x12')]({'type':_0x659371['type'],'app':_0x1574('0x1f'),'appdata':_0x1574('0x32'),'context':_0x659371[_0x1574('0x16')],'exten':_0x659371[_0x1574('0xa')],'priority':_0x5c765f[_0x1574('0x29')]+_0x245959[_0x1574('0x10')]+_0x55db92++,'VoiceExtensionId':_0x659371[_0x1574('0x17')]});}}if(_0x659371[_0x1574('0xf')](_0x1574('0x33'))){if(_0xd91ed[_0x1574('0x34')](_0x659371[_0x1574('0x35')][_0x1574('0x36')]())>=0x0&&_0x659371['appType']!==_0x1574('0x37')){if(_0x659371[_0x1574('0x33')]){_0x4aa6a8[_0x1574('0x12')]({'type':_0x659371[_0x1574('0x15')],'app':_0x1574('0x1f'),'appdata':_0x1574('0x38'),'context':_0x659371[_0x1574('0x16')],'exten':_0x659371['exten'],'priority':_0x5c765f[_0x1574('0x29')]+_0x245959['priority']+_0x55db92++,'VoiceExtensionId':_0x659371[_0x1574('0x17')]});_0x4aa6a8['push']({'type':_0x659371[_0x1574('0x15')],'app':_0x1574('0x13'),'appdata':_0x1574('0x39'),'context':_0x659371[_0x1574('0x16')],'exten':_0x659371['exten'],'priority':_0x5c765f[_0x1574('0x29')]+_0x245959[_0x1574('0x10')]+_0x55db92++,'VoiceExtensionId':_0x659371[_0x1574('0x17')]});}else{_0x4aa6a8['push']({'type':_0x659371[_0x1574('0x15')],'app':_0x1574('0x1f'),'appdata':_0x1574('0x3a'),'context':_0x659371[_0x1574('0x16')],'exten':_0x659371[_0x1574('0xa')],'priority':_0x5c765f[_0x1574('0x29')]+_0x245959[_0x1574('0x10')]+_0x55db92++,'VoiceExtensionId':_0x659371[_0x1574('0x17')]});_0x4aa6a8['push']({'type':_0x659371[_0x1574('0x15')],'app':_0x1574('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x659371[_0x1574('0x16')],'exten':_0x659371[_0x1574('0xa')],'priority':_0x5c765f['length']+_0x245959['priority']+_0x55db92++,'VoiceExtensionId':_0x659371[_0x1574('0x17')]});}}}for(var _0x46d88f=0x0;_0x46d88f<_0x5c765f[_0x1574('0x29')];_0x46d88f+=0x1){var _0x3f44ff=_0x245959[_0x1574('0x10')]+_0x5c765f[_0x1574('0x29')];var _0x3c7b83=_0x46d88f===_0x5c765f[_0x1574('0x29')]-0x1?_0x245959[_0x1574('0x10')]+_0x4aa6a8[_0x1574('0x29')]+_0x143b5d[_0x1574('0x29')]+0x2:_0x245959[_0x1574('0x10')]+_0x46d88f+0x1;_0x4aa6a8[_0x1574('0x3b')](_0x46d88f,0x0,{'type':_0x659371[_0x1574('0x15')],'app':_0x1574('0x3c'),'appdata':_0x5c765f[_0x46d88f]+'?'+_0x659371[_0x1574('0x16')]+',${EXTEN},'+_0x3f44ff+':'+_0x659371[_0x1574('0x16')]+_0x1574('0x3d')+_0x3c7b83,'exten':_0x659371['exten'],'context':_0x659371[_0x1574('0x16')],'priority':_0x245959['priority']+_0x46d88f,'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});}_0x659371['priority']=_0x4aa6a8[_0x1574('0x29')]?_[_0x1574('0x3e')](_0x4aa6a8)['priority']+0x1:_0x245959[_0x1574('0x10')];_0x245959[_0x1574('0x10')]=(_0x143b5d['length']?_[_0x1574('0x3e')](_0x143b5d)['priority']:_0x659371['priority'])+0x1;_0x245959[_0x1574('0x11')]=_[_0x1574('0x3f')](_0x245959[_0x1574('0x11')],_0x4aa6a8,[_0x659371],_0x143b5d);}_0x245959[_0x1574('0x11')][_0x1574('0x12')]({'type':_0x7c8ec4[_0x340951][0x0]['type'],'app':'Hangup','exten':_0x7c8ec4[_0x340951][0x0][_0x1574('0xa')],'context':_0x7c8ec4[_0x340951][0x0][_0x1574('0x16')],'priority':_0x245959['priority'],'VoiceExtensionId':_0x7c8ec4[_0x340951][0x0][_0x1574('0x17')]});_0x2a093c[_0x1574('0x12')](_0x7c8ec4[_0x340951][0x0]['VoiceExtensionId']);_0x4a85d4=_['concat'](_0x4a85d4,_0x245959['extensions']);}}return _0x349716[_0x1574('0x40')](function(_0x2543b1){return _0x349716[_0x1574('0x2')][_0x1574('0x8')][_0x1574('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x2a093c}},'transaction':_0x2543b1})[_0x1574('0x5')](function(_0x4750d4){return _0x349716[_0x1574('0x2')][_0x1574('0x8')][_0x1574('0x42')](_['sortBy'](_0x4a85d4,'priority'),{'transaction':_0x2543b1});});});})[_0x1574('0x43')](function(_0x1cc53f){console[_0x1574('0x44')](_0x1cc53f);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x10f6=['intervals','findAll','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','type','Set','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','map','tag','outbound','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','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','error','lodash','util','models','Interval','then'];(function(_0x34ac32,_0x41a42a){var _0x5a3c6a=function(_0xaf4bd5){while(--_0xaf4bd5){_0x34ac32['push'](_0x34ac32['shift']());}};_0x5a3c6a(++_0x41a42a);}(_0x10f6,0x85));var _0x610f=function(_0x18c10e,_0x478635){_0x18c10e=_0x18c10e-0x0;var _0x4c2094=_0x10f6[_0x18c10e];return _0x4c2094;};'use strict';var _=require(_0x610f('0x0'));var util=require(_0x610f('0x1'));function rewrite(_0x588d48,_0x714c8){var _0x25147c=this;return _0x588d48[_0x610f('0x2')][_0x610f('0x3')]['findAll']({'raw':!![]})[_0x610f('0x4')](function(_0x3b5d46){_0x25147c[_0x610f('0x5')]=_0x3b5d46;return _0x588d48[_0x610f('0x2')]['VoiceExtension'][_0x610f('0x6')]({'where':{'IntervalId':_0x714c8['IntervalId']},'raw':!![]});})[_0x610f('0x4')](function(_0x101dba){return _0x588d48['models'][_0x610f('0x7')][_0x610f('0x6')]({'where':{'exten':{'$in':_[_0x610f('0x8')](_['map'](_0x101dba,_0x610f('0x9')))}},'order':[{'raw':_0x610f('0xa')}],'raw':!![]});})[_0x610f('0x4')](function(_0xbe208e){var _0x5f0c0c=_[_0x610f('0xb')](_0xbe208e,{'priority':'1'});var _0x555374=_[_0x610f('0xb')](_0xbe208e,{'isApp':0x1});var _0x5ee459=_[_0x610f('0xc')](_0x555374,_0x610f('0x9'));var _0x4dda95=[_0x610f('0xd'),_0x610f('0xe')];var _0x2f84fa=[];var _0x26d553=[];for(var _0x25925e in _0x5ee459){if(_0x5ee459[_0x610f('0xf')](_0x25925e)){_0x25147c['priority']=0x2;_0x25147c[_0x610f('0x10')]=[];_0x25147c[_0x610f('0x11')]=_[_0x610f('0x12')](_0x5f0c0c,{'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')]});_0x25147c['extensions'][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':_0x610f('0x15'),'appdata':util['format'](_0x610f('0x16'),_0x5ee459[_0x25925e][0x0][_0x610f('0x14')]),'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c[_0x610f('0x18')]++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});if(_0x5ee459[_0x25925e][0x0][_0x610f('0x14')]===_0x610f('0x1a')){_0x25147c[_0x610f('0x10')][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':'Set','appdata':_0x610f('0x1b')+_0x5ee459[_0x25925e][0x0][_0x610f('0x19')],'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c[_0x610f('0x18')]++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});}else if(_0x5ee459[_0x25925e][0x0]['type']==='outbound'){if(_0x25147c['extension']){_0x25147c[_0x610f('0x10')][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':'Set','appdata':_0x610f('0x1c')+(_0x25147c[_0x610f('0x11')][_0x610f('0x1d')]?_0x610f('0x1e')+_0x25147c[_0x610f('0x11')][_0x610f('0x1d')]+'}':_0x610f('0x1f')),'context':_0x5ee459[_0x25925e][0x0]['context'],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c[_0x610f('0x18')]++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});}_0x25147c[_0x610f('0x10')][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0x5ee459[_0x25925e][0x0][_0x610f('0x19')],'context':_0x5ee459[_0x25925e][0x0]['context'],'exten':_0x5ee459[_0x25925e][0x0]['exten'],'priority':_0x25147c['priority']++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});var _0x29f9e8=_0x25147c[_0x610f('0x18')]++;_0x25147c['extensions'][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':_0x610f('0x20'),'appdata':_0x610f('0x21')+(_0x29f9e8+0x2)+_0x610f('0x22')+(_0x29f9e8+0x1)+')','context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x29f9e8,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});if(_0x25147c[_0x610f('0x11')]){_0x25147c[_0x610f('0x10')]['push']({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':_0x610f('0x15'),'appdata':_0x25147c[_0x610f('0x11')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x25147c[_0x610f('0x11')][_0x610f('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c['priority']++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});}_0x25147c[_0x610f('0x10')][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':'Set','appdata':_0x610f('0x23')+_0x5ee459[_0x25925e][0x0][_0x610f('0x19')],'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c[_0x610f('0x18')]++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});if(_0x25147c[_0x610f('0x11')]&&_0x25147c[_0x610f('0x11')][_0x610f('0xf')](_0x610f('0x24'))&&_0x25147c['extension']['recordingFormat']!=='none'){_0x25147c['extensions']['push']({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':_0x610f('0x15'),'appdata':_0x610f('0x25'),'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0]['exten'],'priority':_0x25147c[_0x610f('0x18')]++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0]['VoiceExtensionId']});_0x25147c[_0x610f('0x10')][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':'Set','appdata':_0x610f('0x26')+_0x25147c['extension']['recordingFormat']||_0x610f('0x27'),'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c[_0x610f('0x18')]++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});}}_0x25147c[_0x610f('0x10')][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':_0x610f('0x15'),'appdata':_0x610f('0x28'),'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c['priority']++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0]['VoiceExtensionId']});_0x25147c[_0x610f('0x10')][_0x610f('0x13')]({'type':_0x5ee459[_0x25925e][0x0][_0x610f('0x14')],'app':_0x610f('0x15'),'appdata':_0x610f('0x29'),'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c['priority']++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0]['VoiceExtensionId']});_0x25147c['extensions']['push']({'type':_0x5ee459[_0x25925e][0x0]['type'],'app':_0x610f('0x15'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'priority':_0x25147c[_0x610f('0x18')]++,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});for(var _0x37314f=0x0,_0x5dc4bf=0x0;_0x37314f<_0x5ee459[_0x25925e][_0x610f('0x2a')];_0x37314f+=0x1,_0x5dc4bf=0x0){var _0xbb3fff=_0x5ee459[_0x25925e][_0x37314f];if(_0xbb3fff['type']){_0xbb3fff[_0x610f('0x14')]=_0xbb3fff['type'][_0x610f('0x2b')]();}var _0x5b4d1b=[];var _0x3be6e7=[];delete _0xbb3fff['id'];delete _0xbb3fff[_0x610f('0x2c')];delete _0xbb3fff['updatedAt'];var _0x1bcffc=_0xbb3fff[_0x610f('0x2d')]!==_0x610f('0x2e')?[_0xbb3fff[_0x610f('0x2d')]]:_0xbb3fff[_0x610f('0x2f')]?_[_0x610f('0x30')](_[_0x610f('0xb')](_0x25147c[_0x610f('0x5')],{'IntervalId':_0xbb3fff[_0x610f('0x2f')]}),_0x610f('0x2d')):[];if(_0xbb3fff[_0x610f('0xf')](_0x610f('0x31'))){if(_0xbb3fff[_0x610f('0x31')]&&_0xbb3fff[_0x610f('0x31')]!=='--'){_0x5b4d1b['push']({'type':_0xbb3fff[_0x610f('0x14')],'app':_0x610f('0x15'),'appdata':'CDR(tag)='+_0xbb3fff[_0x610f('0x31')],'context':_0xbb3fff['context'],'exten':_0xbb3fff[_0x610f('0x9')],'priority':_0x1bcffc[_0x610f('0x2a')]+_0x25147c['priority']+_0x5dc4bf++,'VoiceExtensionId':_0xbb3fff[_0x610f('0x19')]});}}if(_0xbb3fff[_0x610f('0x14')]===_0x610f('0x32')&&_0xbb3fff[_0x610f('0xf')](_0x610f('0x33'))){if(_0xbb3fff['callerID']){_0x5b4d1b['push']({'type':_0xbb3fff[_0x610f('0x14')],'app':'ExecIf','appdata':_0x610f('0x34')+_0xbb3fff[_0x610f('0x33')]+')','context':_0xbb3fff[_0x610f('0x17')],'exten':_0xbb3fff['exten'],'priority':_0x1bcffc[_0x610f('0x2a')]+_0x25147c[_0x610f('0x18')]+_0x5dc4bf++,'VoiceExtensionId':_0xbb3fff[_0x610f('0x19')]});}else{_0x5b4d1b[_0x610f('0x13')]({'type':_0xbb3fff['type'],'app':'ExecIf','appdata':_0x610f('0x35'),'context':_0xbb3fff[_0x610f('0x17')],'exten':_0xbb3fff[_0x610f('0x9')],'priority':_0x1bcffc[_0x610f('0x2a')]+_0x25147c['priority']+_0x5dc4bf++,'VoiceExtensionId':_0xbb3fff['VoiceExtensionId']});}}if(_0xbb3fff[_0x610f('0xf')](_0x610f('0x36'))){if(_0x4dda95[_0x610f('0x37')](_0xbb3fff['app'][_0x610f('0x2b')]())>=0x0&&_0xbb3fff['appType']!=='custom'){if(_0xbb3fff[_0x610f('0x36')]){_0x5b4d1b[_0x610f('0x13')]({'type':_0xbb3fff['type'],'app':_0x610f('0x20'),'appdata':_0x610f('0x38'),'context':_0xbb3fff['context'],'exten':_0xbb3fff[_0x610f('0x9')],'priority':_0x1bcffc['length']+_0x25147c[_0x610f('0x18')]+_0x5dc4bf++,'VoiceExtensionId':_0xbb3fff['VoiceExtensionId']});_0x5b4d1b[_0x610f('0x13')]({'type':_0xbb3fff[_0x610f('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0xbb3fff[_0x610f('0x17')],'exten':_0xbb3fff['exten'],'priority':_0x1bcffc[_0x610f('0x2a')]+_0x25147c[_0x610f('0x18')]+_0x5dc4bf++,'VoiceExtensionId':_0xbb3fff[_0x610f('0x19')]});}else{_0x5b4d1b[_0x610f('0x13')]({'type':_0xbb3fff[_0x610f('0x14')],'app':_0x610f('0x20'),'appdata':_0x610f('0x39'),'context':_0xbb3fff['context'],'exten':_0xbb3fff['exten'],'priority':_0x1bcffc[_0x610f('0x2a')]+_0x25147c['priority']+_0x5dc4bf++,'VoiceExtensionId':_0xbb3fff[_0x610f('0x19')]});_0x5b4d1b[_0x610f('0x13')]({'type':_0xbb3fff[_0x610f('0x14')],'app':_0x610f('0x15'),'appdata':_0x610f('0x3a'),'context':_0xbb3fff['context'],'exten':_0xbb3fff[_0x610f('0x9')],'priority':_0x1bcffc[_0x610f('0x2a')]+_0x25147c[_0x610f('0x18')]+_0x5dc4bf++,'VoiceExtensionId':_0xbb3fff[_0x610f('0x19')]});}}}for(var _0x481c2b=0x0;_0x481c2b<_0x1bcffc['length'];_0x481c2b+=0x1){var _0x10afc2=_0x25147c[_0x610f('0x18')]+_0x1bcffc[_0x610f('0x2a')];var _0x40200e=_0x481c2b===_0x1bcffc[_0x610f('0x2a')]-0x1?_0x25147c[_0x610f('0x18')]+_0x5b4d1b[_0x610f('0x2a')]+_0x3be6e7[_0x610f('0x2a')]+0x2:_0x25147c[_0x610f('0x18')]+_0x481c2b+0x1;_0x5b4d1b[_0x610f('0x3b')](_0x481c2b,0x0,{'type':_0xbb3fff[_0x610f('0x14')],'app':_0x610f('0x3c'),'appdata':_0x1bcffc[_0x481c2b]+'?'+_0xbb3fff[_0x610f('0x17')]+',${EXTEN},'+_0x10afc2+':'+_0xbb3fff[_0x610f('0x17')]+',${EXTEN},'+_0x40200e,'exten':_0xbb3fff[_0x610f('0x9')],'context':_0xbb3fff['context'],'priority':_0x25147c[_0x610f('0x18')]+_0x481c2b,'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});}_0xbb3fff['priority']=_0x5b4d1b['length']?_[_0x610f('0x3d')](_0x5b4d1b)[_0x610f('0x18')]+0x1:_0x25147c[_0x610f('0x18')];_0x25147c[_0x610f('0x18')]=(_0x3be6e7[_0x610f('0x2a')]?_[_0x610f('0x3d')](_0x3be6e7)[_0x610f('0x18')]:_0xbb3fff[_0x610f('0x18')])+0x1;_0x25147c[_0x610f('0x10')]=_['concat'](_0x25147c['extensions'],_0x5b4d1b,[_0xbb3fff],_0x3be6e7);}_0x25147c[_0x610f('0x10')]['push']({'type':_0x5ee459[_0x25925e][0x0]['type'],'app':_0x610f('0x3e'),'exten':_0x5ee459[_0x25925e][0x0][_0x610f('0x9')],'context':_0x5ee459[_0x25925e][0x0][_0x610f('0x17')],'priority':_0x25147c[_0x610f('0x18')],'VoiceExtensionId':_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]});_0x2f84fa['push'](_0x5ee459[_0x25925e][0x0][_0x610f('0x19')]);_0x26d553=_[_0x610f('0x3f')](_0x26d553,_0x25147c['extensions']);}}return _0x588d48[_0x610f('0x40')](function(_0x2c8c54){return _0x588d48[_0x610f('0x2')][_0x610f('0x7')][_0x610f('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x2f84fa}},'transaction':_0x2c8c54})[_0x610f('0x4')](function(_0x4ef967){return _0x588d48[_0x610f('0x2')][_0x610f('0x7')][_0x610f('0x42')](_[_0x610f('0x43')](_0x26d553,_0x610f('0x18')),{'transaction':_0x2c8c54});});});})['catch'](function(_0x565867){console[_0x610f('0x44')](_0x565867);});}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 9645ec7..4b67cbf 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 _0xe770=['redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','ListId','CompanyId','find','duplicate','CmContact','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','id\x20IN\x20?','str','calleridnum','deletedAt\x20IS\x20NULL','cm_hopper_black','outbound','dialCheckDuplicateType','CmList','always','query','VoiceQueueId','sequelize','all','findAll','get','Campaign','CampaignId','BlackLists','generalCheckHopper','message','Error\x20processing\x20rows\x20block:','finally','emit','resolve','contact:csv_','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../config/logger','api'];(function(_0x36b7c4,_0x2fcff4){var _0x349917=function(_0x190b92){while(--_0x190b92){_0x36b7c4['push'](_0x36b7c4['shift']());}};_0x349917(++_0x2fcff4);}(_0xe770,0x12e));var _0x0e77=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe770[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require('bluebird');var util=require(_0x0e77('0x0'));var _=require(_0x0e77('0x1'));var fs=require('fs');var squel=require(_0x0e77('0x2'));var Papa=require(_0x0e77('0x3'));var Redis=require(_0x0e77('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x0e77('0x5'))(_0x0e77('0x6'));config[_0x0e77('0x7')]=_[_0x0e77('0x8')](config[_0x0e77('0x7')],{'host':_0x0e77('0x9'),'port':0x18eb});var socket=require(_0x0e77('0xa'))(new Redis(config[_0x0e77('0x7')]));require(_0x0e77('0xb'))[_0x0e77('0xc')](socket);try{if(!process[_0x0e77('0xd')][0x2]||process[_0x0e77('0xd')][0x2]===_0x0e77('0xe')||process[_0x0e77('0xd')][0x2]===_0x0e77('0xf')){throw new Error(_0x0e77('0x10'));}var FILEPATH=process[_0x0e77('0xd')][0x2];if(!process[_0x0e77('0xd')][0x3]||process[_0x0e77('0xd')][0x3]===_0x0e77('0xe')||process[_0x0e77('0xd')][0x3]===_0x0e77('0xf')||!process[_0x0e77('0xd')][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]===_0x0e77('0xf')){throw new Error(_0x0e77('0x11'));}var FIELDS=_[_0x0e77('0x12')](process[_0x0e77('0xd')][0x3]['split'](','),process[_0x0e77('0xd')][0x4][_0x0e77('0x13')](','));if(!process[_0x0e77('0xd')][0x5]||process['argv'][0x5]===_0x0e77('0xe')||process['argv'][0x5]===_0x0e77('0xf')){throw new Error(_0x0e77('0x14'));}var LISTID=process[_0x0e77('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0e77('0xd')][0x6]!==_0x0e77('0xe')&&process['argv'][0x6]!==_0x0e77('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0e77('0xd')][0x7]&&process[_0x0e77('0xd')][0x7]!==_0x0e77('0xe')&&process[_0x0e77('0xd')][0x7]!==_0x0e77('0xf')?process[_0x0e77('0xd')][0x7]:null;if(!process[_0x0e77('0xd')][0x8]||process[_0x0e77('0xd')][0x8]==='undefined'||process[_0x0e77('0xd')][0x8]===_0x0e77('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x0e77('0xd')][0x8];}catch(_0x48fe30){logger[_0x0e77('0x15')](_0x48fe30);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(_0x1e2b8b,_0x112ef9,_0x4ad135,_0x27a273){var _0x307dc9={'message':_0x112ef9};_0x307dc9[_0x1e2b8b]=!![];if(_0x4ad135){_0x307dc9[_0x0e77('0x16')]=_0x4ad135;}if(_0x27a273){_0x307dc9['index']=_0x27a273;}return _0x307dc9;}function isEmail(_0x2b317c){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x2b317c);}function checkRow(_0x1b1558,_0x44ebb7,_0x174529){return new BPromise(function(_0x147738,_0x296386){if(_[_0x0e77('0x17')](_0x1b1558)){return _0x296386(handleCheckRowError(_0x0e77('0x15'),_0x0e77('0x18'),null,_0x174529));}if(_0x1b1558[_0x0e77('0x19')]&&_0x1b1558[_0x0e77('0x19')][_0x0e77('0x1a')]){var _0x15f595=_[_0x0e77('0x1b')](_0x1b1558[_0x0e77('0x19')],'message')[_0x0e77('0x1c')](';');return _0x296386(handleCheckRowError(_0x0e77('0x15'),_0x15f595,null,_0x174529));}var _0x49fba9={};for(var _0x45f809 in FIELDS){if(FIELDS[_0x0e77('0x1d')](_0x45f809)&&FIELDS[_0x45f809]){_0x49fba9[_0x45f809]=_0x1b1558[_0x0e77('0x1e')][0x0][FIELDS[_0x45f809]]||_0x1b1558[_0x0e77('0x1e')][0x0]['\ufeff'+FIELDS[_0x45f809]];}}if(!_0x49fba9['firstName']){return _0x296386(handleCheckRowError(_0x0e77('0x15'),_0x0e77('0x1f'),null,_0x174529));}if(!_0x49fba9[_0x0e77('0x20')]){return _0x296386(handleCheckRowError('error',_0x0e77('0x21'),null,_0x174529));}if(_0x49fba9[_0x0e77('0x22')]){var _0x206b92=moment(_0x49fba9[_0x0e77('0x22')],_0x0e77('0x23'));if(!_0x206b92[_0x0e77('0x24')]()){return _0x296386(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x174529));}}if(_0x49fba9[_0x0e77('0x25')]){if(!isEmail(_0x49fba9[_0x0e77('0x25')])){return _0x296386(handleCheckRowError(_0x0e77('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x174529));}}_0x49fba9[_0x0e77('0x26')]=LISTID;_0x49fba9[_0x0e77('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x44ebb7){var _0x1da6a1={};for(var _0x201f30=0x0,_0xef1128=DUPLICATES[_0x0e77('0x1a')];_0x201f30<_0xef1128;_0x201f30+=0x1){_0x1da6a1[DUPLICATES[_0x201f30]]=_0x49fba9[DUPLICATES[_0x201f30]];}var _0x526587=_[_0x0e77('0x28')](_0x44ebb7,_0x1da6a1);if(_0x526587){return _0x296386(handleCheckRowError(_0x0e77('0x29'),'Duplicate\x20Contact',_0x526587,_0x174529));}}return db[_0x0e77('0x2a')]['create'](_0x49fba9,{'raw':!![],'hooks':![],'fields':_['keys'](_0x49fba9)})[_0x0e77('0x2b')](function(_0x490ae0){if(DUPLICATES&&DUPLICATES['length']&&_0x44ebb7){_0x44ebb7[_0x0e77('0x2c')](_['pick'](_0x49fba9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x490ae0['id'];return _0x147738();})[_0x0e77('0x2d')](function(_0x4dcc35){return _0x296386(handleCheckRowError(_0x0e77('0x15'),_0x0e77('0x2e')+(_0x4dcc35['message']||JSON[_0x0e77('0x2f')](_0x4dcc35)),null,_0x174529));});});}function checkHopper(){function _0xc0aa7(){return function(_0x1bc64a){logger[_0x0e77('0x15')](_0x0e77('0x30'),'checkHopper',util[_0x0e77('0x31')](_0x1bc64a,{'showHidden':![],'depth':null}));};}var _0x4ce1b4=function(_0xfc7c8d,_0x3ff21d){var _0x1a831d=squel[_0x0e77('0x32')]()[_0x0e77('0x33')](_0x0e77('0x34'))[_0x0e77('0x35')]([_0x0e77('0x20'),_0x0e77('0x36'),_0x0e77('0x37'),_0x0e77('0x26'),_0x3ff21d,_0x0e77('0x38'),_0x0e77('0x39')],squel['select']()[_0x0e77('0x3a')](_0x0e77('0x20'),'phone')[_0x0e77('0x3a')](_0x0e77('0x3b'),_0x0e77('0x36'))[_0x0e77('0x3a')]('id',_0x0e77('0x37'))[_0x0e77('0x3a')](LISTID[_0x0e77('0x3c')](),_0x0e77('0x26'))['field'](_0xfc7c8d['id']['toString'](),_0x3ff21d)[_0x0e77('0x3a')](_0x0e77('0x3b'),_0x0e77('0x38'))[_0x0e77('0x3a')](_0x0e77('0x3b'),_0x0e77('0x39'))['from'](_0x0e77('0x3d'))[_0x0e77('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0e77('0x3e')](_0x0e77('0x3f'),LISTID[_0x0e77('0x3c')]())[_0x0e77('0x3e')](_0x0e77('0x40'))[_0x0e77('0x3e')](_0x0e77('0x41'),squel[_0x0e77('0x42')]()[_0x0e77('0x3a')](_0x0e77('0x20'))[_0x0e77('0x43')]('cm_hopper')[_0x0e77('0x3e')](_0x3ff21d+_0x0e77('0x44'),_0xfc7c8d['id']['toString']())))['toString']();return _0x1a831d;};var _0x26eaff=function(_0x2cd67f,_0x420538){var _0x47c967=squel[_0x0e77('0x32')]()['into'](_0x0e77('0x34'))[_0x0e77('0x35')]([_0x0e77('0x20'),_0x0e77('0x36'),_0x0e77('0x37'),'ListId',_0x420538,_0x0e77('0x38'),_0x0e77('0x39')],squel[_0x0e77('0x42')]()[_0x0e77('0x3a')](_0x0e77('0x20'),_0x0e77('0x20'))[_0x0e77('0x3a')]('NOW()',_0x0e77('0x36'))[_0x0e77('0x3a')]('id',_0x0e77('0x37'))['field'](LISTID[_0x0e77('0x3c')](),_0x0e77('0x26'))[_0x0e77('0x3a')](_0x2cd67f['id'][_0x0e77('0x3c')](),_0x420538)['field']('NOW()',_0x0e77('0x38'))[_0x0e77('0x3a')](_0x0e77('0x3b'),_0x0e77('0x39'))[_0x0e77('0x43')](_0x0e77('0x3d'))[_0x0e77('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0e77('0x3e')]('ListId\x20=\x20?',LISTID[_0x0e77('0x3c')]())[_0x0e77('0x3e')](_0x0e77('0x45'),squel[_0x0e77('0x46')](hopperContacts))[_0x0e77('0x3e')](_0x0e77('0x40'))[_0x0e77('0x3e')](_0x0e77('0x41'),squel[_0x0e77('0x42')]()['field'](_0x0e77('0x47'))[_0x0e77('0x43')]('cm_hopper_final')[_0x0e77('0x3e')](_0x420538+_0x0e77('0x44'),_0x2cd67f['id']['toString']()))['where'](_0x0e77('0x41'),squel[_0x0e77('0x42')]()['field']('phone')[_0x0e77('0x43')](_0x0e77('0x34'))['where'](_0x420538+_0x0e77('0x44'),_0x2cd67f['id'][_0x0e77('0x3c')]())))[_0x0e77('0x3c')]();return _0x47c967;};function _0x5e9019(_0x408b4e,_0x13c3a6){var _0x5b163a=squel['insert']()[_0x0e77('0x33')](_0x0e77('0x34'))[_0x0e77('0x35')]([_0x0e77('0x20'),_0x0e77('0x36'),_0x0e77('0x37'),_0x0e77('0x26'),_0x13c3a6,_0x0e77('0x38'),'updatedAt'],squel[_0x0e77('0x42')]()[_0x0e77('0x3a')]('phone',_0x0e77('0x20'))[_0x0e77('0x3a')](_0x0e77('0x3b'),_0x0e77('0x36'))['field']('id',_0x0e77('0x37'))[_0x0e77('0x3a')](LISTID[_0x0e77('0x3c')](),_0x0e77('0x26'))[_0x0e77('0x3a')](_0x408b4e['id'][_0x0e77('0x3c')](),_0x13c3a6)[_0x0e77('0x3a')](_0x0e77('0x3b'),_0x0e77('0x38'))['field'](_0x0e77('0x3b'),_0x0e77('0x39'))[_0x0e77('0x43')](_0x0e77('0x3d'))['where'](_0x0e77('0x48'))[_0x0e77('0x3e')](_0x0e77('0x3f'),LISTID[_0x0e77('0x3c')]())[_0x0e77('0x3e')](_0x0e77('0x45'),squel[_0x0e77('0x46')](hopperContacts))[_0x0e77('0x3e')](_0x0e77('0x40')))['toString']();return _0x5b163a;}function _0x3fcbd7(_0x409d2e,_0x4dd025){var _0x4b9e3e=squel[_0x0e77('0x32')]()[_0x0e77('0x33')](_0x0e77('0x49'))['fromQuery'](['phone',_0x0e77('0x37'),_0x0e77('0x26'),_0x4dd025,'createdAt',_0x0e77('0x39')],squel[_0x0e77('0x42')]()[_0x0e77('0x3a')](_0x0e77('0x20'),'phone')[_0x0e77('0x3a')]('id','ContactId')['field'](LISTID[_0x0e77('0x3c')](),_0x0e77('0x26'))['field'](_0x409d2e['id'][_0x0e77('0x3c')](),_0x4dd025)[_0x0e77('0x3a')](_0x0e77('0x3b'),'createdAt')[_0x0e77('0x3a')]('NOW()',_0x0e77('0x39'))[_0x0e77('0x43')](_0x0e77('0x3d'))[_0x0e77('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0e77('0x3e')](_0x0e77('0x3f'),LISTID[_0x0e77('0x3c')]())[_0x0e77('0x3e')]('id\x20IN\x20?',squel[_0x0e77('0x46')](hopperContacts))[_0x0e77('0x3e')](_0x0e77('0x40')))['toString']();return _0x4b9e3e;}return db['VoiceQueue']['findAll']({'where':{'type':_0x0e77('0x4a')},'attributes':['id',_0x0e77('0x4b')],'include':[{'model':db[_0x0e77('0x4c')],'as':'Lists','where':{'id':LISTID}}]})[_0x0e77('0x2b')](function(_0x1d3f62){var _0x5e3606=[];if(_0x1d3f62){var _0x144b26;for(var _0x6b79d7=0x0,_0x337a1d;_0x6b79d7<_0x1d3f62[_0x0e77('0x1a')];_0x6b79d7+=0x1){_0x337a1d=_0x1d3f62[_0x6b79d7]['get']({'plain':!![]});switch(_0x337a1d[_0x0e77('0x4b')]){case _0x0e77('0x4d'):_0x5e3606[_0x0e77('0x2c')](db['sequelize'][_0x0e77('0x4e')](_0x26eaff(_0x337a1d,_0x0e77('0x4f')))[_0x0e77('0x2b')](function(){})[_0x0e77('0x2d')](_0xc0aa7()));break;case'onlyIfOpen':_0x5e3606[_0x0e77('0x2c')](db[_0x0e77('0x50')][_0x0e77('0x4e')](_0x4ce1b4(_0x337a1d,'VoiceQueueId'))[_0x0e77('0x2b')](function(){})['catch'](_0xc0aa7()));break;default:_0x5e3606[_0x0e77('0x2c')](db[_0x0e77('0x50')][_0x0e77('0x4e')](_0x5e9019(_0x337a1d,_0x0e77('0x4f')))[_0x0e77('0x2b')](function(){})[_0x0e77('0x2d')](_0xc0aa7()));}}}return _0x5e3606;})[_0x0e77('0x51')]()[_0x0e77('0x2b')](function(){return db['VoiceQueue'][_0x0e77('0x52')]({'where':{'type':_0x0e77('0x4a')},'attributes':['id'],'include':[{'model':db[_0x0e77('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0e77('0x2b')](function(_0x5b539d){var _0x119fba=[];if(_0x5b539d){var _0x47cc0a;for(var _0x3e884e=0x0,_0x37bd48;_0x3e884e<_0x5b539d['length'];_0x3e884e+=0x1){_0x37bd48=_0x5b539d[_0x3e884e][_0x0e77('0x53')]({'plain':!![]});_0x119fba[_0x0e77('0x2c')](db[_0x0e77('0x50')]['query'](_0x3fcbd7(_0x37bd48,_0x0e77('0x4f')))['then'](function(){})[_0x0e77('0x2d')](_0xc0aa7()));}}return _0x119fba;})[_0x0e77('0x51')]();})[_0x0e77('0x2b')](function(){return db[_0x0e77('0x54')][_0x0e77('0x52')]({'attributes':['id',_0x0e77('0x4b')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x0e77('0x2b')](function(_0x1eea1c){var _0x414e69=[];if(_0x1eea1c){for(var _0x3ba1cd=0x0,_0x2172b7;_0x3ba1cd<_0x1eea1c[_0x0e77('0x1a')];_0x3ba1cd+=0x1){_0x2172b7=_0x1eea1c[_0x3ba1cd][_0x0e77('0x53')]({'plain':!![]});switch(_0x2172b7[_0x0e77('0x4b')]){case _0x0e77('0x4d'):_0x414e69['push'](db[_0x0e77('0x50')]['query'](_0x26eaff(_0x2172b7,_0x0e77('0x55')))[_0x0e77('0x2b')](function(){})[_0x0e77('0x2d')](_0xc0aa7()));break;case'onlyIfOpen':_0x414e69[_0x0e77('0x2c')](db[_0x0e77('0x50')]['query'](_0x4ce1b4(_0x2172b7,_0x0e77('0x55')))[_0x0e77('0x2b')](function(){})[_0x0e77('0x2d')](_0xc0aa7()));break;default:_0x414e69[_0x0e77('0x2c')](db[_0x0e77('0x50')]['query'](_0x5e9019(_0x2172b7,_0x0e77('0x55')))[_0x0e77('0x2b')](function(){})['catch'](_0xc0aa7()));}}}return _0x414e69;})[_0x0e77('0x51')]();})[_0x0e77('0x2b')](function(){return db['Campaign'][_0x0e77('0x52')]({'attributes':['id'],'include':[{'model':db[_0x0e77('0x4c')],'as':_0x0e77('0x56'),'where':{'id':LISTID}}]})[_0x0e77('0x2b')](function(_0x116977){var _0xb43552=[];if(_0x116977){for(var _0x27cb0b=0x0,_0x3128c1;_0x27cb0b<_0x116977[_0x0e77('0x1a')];_0x27cb0b+=0x1){_0x3128c1=_0x116977[_0x27cb0b][_0x0e77('0x53')]({'plain':!![]});_0xb43552[_0x0e77('0x2c')](db['sequelize'][_0x0e77('0x4e')](_0x3fcbd7(_0x3128c1,_0x0e77('0x55')))[_0x0e77('0x2b')](function(){})[_0x0e77('0x2d')](_0xc0aa7()));}}return _0xb43552;})['all']();})[_0x0e77('0x2d')](function(_0x4cf80d){logger[_0x0e77('0x15')]('cmContact,\x20%s,\x20%s',_0x0e77('0x57'),_0x4cf80d[_0x0e77('0x58')]);});}var processPromises=function(_0x40c7e1){return BPromise[_0x0e77('0x51')](promises)['then'](function(_0x19787e){})[_0x0e77('0x2d')](function(_0x1edcce){logger[_0x0e77('0x15')](_0x0e77('0x59'),JSON[_0x0e77('0x2f')](_0x1edcce));})[_0x0e77('0x5a')](function(){socket[_0x0e77('0x5b')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x40c7e1){return _0x40c7e1['resume']();}});};var endCsv=function(){return BPromise[_0x0e77('0x5c')]()[_0x0e77('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x0e77('0x2b')](function(){socket[_0x0e77('0x5b')](_0x0e77('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x3887ae){logger[_0x0e77('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0e77('0x2f')](_0x3887ae));}finally{process[_0x0e77('0x5e')](0x0);}});};process['on'](_0x0e77('0x5f'),function(){logger[_0x0e77('0x60')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x0e77('0x5c')]()[_0x0e77('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0e77('0x13')](',');return db[_0x0e77('0x2a')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0e77('0x2b')](function(_0xd300fb){var _0x14448c=fs[_0x0e77('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0e77('0x62')](_0x14448c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e60d0,_0x21bed3){total+=0x1;var _0x1d8842=total;promises[_0x0e77('0x2c')](checkRow(_0x5e60d0,_0xd300fb,_0x1d8842)[_0x0e77('0x2b')](function(){success+=0x1;})[_0x0e77('0x2d')](function(_0x21e9cf){if(_0x21e9cf[_0x0e77('0x15')]){errors+=0x1;delete _0x21e9cf[_0x0e77('0x15')];}else if(_0x21e9cf[_0x0e77('0x29')]){duplicates+=0x1;delete _0x21e9cf[_0x0e77('0x29')];}rows[_0x0e77('0x2c')](_0x21e9cf);}));if(total%0xc8===0x0){_0x21bed3[_0x0e77('0x63')]();return processPromises(_0x21bed3);}},'complete':function(){return processPromises()[_0x0e77('0x2b')](function(){logger[_0x0e77('0x60')](_0x0e77('0x64'));endCsv();});},'error':function(_0xf0e3c8,_0x4c5252){logger[_0x0e77('0x60')](_0x0e77('0x65'),JSON[_0x0e77('0x2f')](_0xf0e3c8));endCsv();}});})[_0x0e77('0x2d')](function(_0x43ec1a){logger['error'](_0x0e77('0x66'),JSON[_0x0e77('0x2f')](_0x43ec1a));});}main(); \ No newline at end of file +var _0x1b17=['Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','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','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','find','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','scheduledAt','ContactId','ListId','select','field','NOW()','toString','createdAt','updatedAt','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','fromQuery','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','ListId\x20=\x20?','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','always','CampaignId','Campaign','cmContact,\x20%s,\x20%s','finally','resume','resolve','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!'];(function(_0x27804a,_0x4df8f0){var _0xa378b4=function(_0x1b990d){while(--_0x1b990d){_0x27804a['push'](_0x27804a['shift']());}};_0xa378b4(++_0x4df8f0);}(_0x1b17,0x133));var _0x71b1=function(_0x722103,_0x5732f3){_0x722103=_0x722103-0x0;var _0x3e2435=_0x1b17[_0x722103];return _0x3e2435;};'use strict';var BPromise=require(_0x71b1('0x0'));var util=require(_0x71b1('0x1'));var _=require(_0x71b1('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x71b1('0x3'));var Redis=require(_0x71b1('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x71b1('0x5'));var logger=require(_0x71b1('0x6'))('api');config[_0x71b1('0x7')]=_[_0x71b1('0x8')](config[_0x71b1('0x7')],{'host':_0x71b1('0x9'),'port':0x18eb});var socket=require(_0x71b1('0xa'))(new Redis(config[_0x71b1('0x7')]));require(_0x71b1('0xb'))[_0x71b1('0xc')](socket);try{if(!process[_0x71b1('0xd')][0x2]||process[_0x71b1('0xd')][0x2]===_0x71b1('0xe')||process[_0x71b1('0xd')][0x2]===_0x71b1('0xf')){throw new Error(_0x71b1('0x10'));}var FILEPATH=process[_0x71b1('0xd')][0x2];if(!process[_0x71b1('0xd')][0x3]||process[_0x71b1('0xd')][0x3]===_0x71b1('0xe')||process['argv'][0x3]===_0x71b1('0xf')||!process[_0x71b1('0xd')][0x4]||process[_0x71b1('0xd')][0x4]==='undefined'||process[_0x71b1('0xd')][0x4]===_0x71b1('0xf')){throw new Error(_0x71b1('0x11'));}var FIELDS=_['zipObject'](process[_0x71b1('0xd')][0x3]['split'](','),process[_0x71b1('0xd')][0x4][_0x71b1('0x12')](','));if(!process[_0x71b1('0xd')][0x5]||process[_0x71b1('0xd')][0x5]===_0x71b1('0xe')||process[_0x71b1('0xd')][0x5]==='null'){throw new Error(_0x71b1('0x13'));}var LISTID=process[_0x71b1('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x71b1('0xd')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x71b1('0xf')?process[_0x71b1('0xd')][0x6]:null;var DUPLICATES=process[_0x71b1('0xd')][0x7]&&process[_0x71b1('0xd')][0x7]!=='undefined'&&process[_0x71b1('0xd')][0x7]!==_0x71b1('0xf')?process[_0x71b1('0xd')][0x7]:null;if(!process[_0x71b1('0xd')][0x8]||process['argv'][0x8]===_0x71b1('0xe')||process[_0x71b1('0xd')][0x8]===_0x71b1('0xf')){throw new Error(_0x71b1('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4436b4){logger['error'](_0x4436b4);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(_0x25dbe5,_0x50f582,_0xc789eb,_0x5f76c9){var _0x35fe5a={'message':_0x50f582};_0x35fe5a[_0x25dbe5]=!![];if(_0xc789eb){_0x35fe5a[_0x71b1('0x15')]=_0xc789eb;}if(_0x5f76c9){_0x35fe5a[_0x71b1('0x16')]=_0x5f76c9;}return _0x35fe5a;}function isEmail(_0x231352){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))*$/[_0x71b1('0x17')](_0x231352);}function checkRow(_0x2e4091,_0x1c2454,_0x5af64a){return new BPromise(function(_0x28cd15,_0xab4e7b){if(_[_0x71b1('0x18')](_0x2e4091)){return _0xab4e7b(handleCheckRowError(_0x71b1('0x19'),_0x71b1('0x1a'),null,_0x5af64a));}if(_0x2e4091['errors']&&_0x2e4091[_0x71b1('0x1b')][_0x71b1('0x1c')]){var _0x5084f0=_[_0x71b1('0x1d')](_0x2e4091[_0x71b1('0x1b')],_0x71b1('0x1e'))['join'](';');return _0xab4e7b(handleCheckRowError('error',_0x5084f0,null,_0x5af64a));}var _0x48ee54={};for(var _0x2255a8 in FIELDS){if(FIELDS[_0x71b1('0x1f')](_0x2255a8)&&FIELDS[_0x2255a8]){_0x48ee54[_0x2255a8]=_0x2e4091[_0x71b1('0x20')][0x0][FIELDS[_0x2255a8]]||_0x2e4091['data'][0x0]['\ufeff'+FIELDS[_0x2255a8]];}}if(!_0x48ee54[_0x71b1('0x21')]){return _0xab4e7b(handleCheckRowError(_0x71b1('0x19'),_0x71b1('0x22'),null,_0x5af64a));}if(!_0x48ee54[_0x71b1('0x23')]){return _0xab4e7b(handleCheckRowError(_0x71b1('0x19'),'phone\x20not\x20specified!',null,_0x5af64a));}if(_0x48ee54['birthDate']){var _0x104bbb=moment(_0x48ee54[_0x71b1('0x24')],_0x71b1('0x25'));if(!_0x104bbb[_0x71b1('0x26')]()){return _0xab4e7b(handleCheckRowError(_0x71b1('0x19'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5af64a));}}if(_0x48ee54[_0x71b1('0x27')]){if(!isEmail(_0x48ee54[_0x71b1('0x27')])){return _0xab4e7b(handleCheckRowError(_0x71b1('0x19'),_0x71b1('0x28'),null,_0x5af64a));}}_0x48ee54['ListId']=LISTID;_0x48ee54['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x1c2454){var _0xa88565={};for(var _0x26123f=0x0,_0x40413b=DUPLICATES['length'];_0x26123f<_0x40413b;_0x26123f+=0x1){_0xa88565[DUPLICATES[_0x26123f]]=_0x48ee54[DUPLICATES[_0x26123f]];}var _0x58083d=_[_0x71b1('0x29')](_0x1c2454,_0xa88565);if(_0x58083d){return _0xab4e7b(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x58083d,_0x5af64a));}}return db[_0x71b1('0x2a')]['create'](_0x48ee54,{'raw':!![],'hooks':![],'fields':_[_0x71b1('0x2b')](_0x48ee54)})[_0x71b1('0x2c')](function(_0x4915c5){if(DUPLICATES&&DUPLICATES[_0x71b1('0x1c')]&&_0x1c2454){_0x1c2454[_0x71b1('0x2d')](_[_0x71b1('0x2e')](_0x48ee54,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4915c5['id'];return _0x28cd15();})[_0x71b1('0x2f')](function(_0x507b7e){return _0xab4e7b(handleCheckRowError(_0x71b1('0x19'),_0x71b1('0x30')+(_0x507b7e[_0x71b1('0x1e')]||JSON[_0x71b1('0x31')](_0x507b7e)),null,_0x5af64a));});});}function checkHopper(){function _0x517b33(){return function(_0x426639){logger[_0x71b1('0x19')](_0x71b1('0x32'),'checkHopper',util[_0x71b1('0x33')](_0x426639,{'showHidden':![],'depth':null}));};}var _0x59c2f9=function(_0x21de96,_0x2a1349){var _0x5253b8=squel[_0x71b1('0x34')]()[_0x71b1('0x35')](_0x71b1('0x36'))['fromQuery'](['phone',_0x71b1('0x37'),_0x71b1('0x38'),_0x71b1('0x39'),_0x2a1349,'createdAt','updatedAt'],squel[_0x71b1('0x3a')]()['field'](_0x71b1('0x23'),_0x71b1('0x23'))[_0x71b1('0x3b')](_0x71b1('0x3c'),_0x71b1('0x37'))['field']('id',_0x71b1('0x38'))[_0x71b1('0x3b')](LISTID[_0x71b1('0x3d')](),'ListId')[_0x71b1('0x3b')](_0x21de96['id']['toString'](),_0x2a1349)[_0x71b1('0x3b')](_0x71b1('0x3c'),_0x71b1('0x3e'))[_0x71b1('0x3b')](_0x71b1('0x3c'),_0x71b1('0x3f'))['from'](_0x71b1('0x40'))[_0x71b1('0x41')]('deletedAt\x20IS\x20NULL')[_0x71b1('0x41')]('ListId\x20=\x20?',LISTID['toString']())[_0x71b1('0x41')](_0x71b1('0x42'))[_0x71b1('0x41')](_0x71b1('0x43'),squel['select']()[_0x71b1('0x3b')](_0x71b1('0x23'))[_0x71b1('0x44')](_0x71b1('0x36'))[_0x71b1('0x41')](_0x2a1349+_0x71b1('0x45'),_0x21de96['id']['toString']())))[_0x71b1('0x3d')]();return _0x5253b8;};var _0x1a810a=function(_0x113874,_0x25184d){var _0x243053=squel[_0x71b1('0x34')]()[_0x71b1('0x35')](_0x71b1('0x36'))[_0x71b1('0x46')]([_0x71b1('0x23'),_0x71b1('0x37'),_0x71b1('0x38'),'ListId',_0x25184d,'createdAt','updatedAt'],squel[_0x71b1('0x3a')]()['field'](_0x71b1('0x23'),_0x71b1('0x23'))[_0x71b1('0x3b')](_0x71b1('0x3c'),'scheduledAt')[_0x71b1('0x3b')]('id',_0x71b1('0x38'))[_0x71b1('0x3b')](LISTID['toString'](),'ListId')['field'](_0x113874['id'][_0x71b1('0x3d')](),_0x25184d)[_0x71b1('0x3b')]('NOW()','createdAt')[_0x71b1('0x3b')](_0x71b1('0x3c'),'updatedAt')[_0x71b1('0x44')](_0x71b1('0x40'))['where'](_0x71b1('0x47'))[_0x71b1('0x41')]('ListId\x20=\x20?',LISTID[_0x71b1('0x3d')]())['where'](_0x71b1('0x48'),squel[_0x71b1('0x49')](hopperContacts))[_0x71b1('0x41')](_0x71b1('0x42'))[_0x71b1('0x41')](_0x71b1('0x43'),squel['select']()[_0x71b1('0x3b')](_0x71b1('0x4a'))[_0x71b1('0x44')](_0x71b1('0x4b'))[_0x71b1('0x41')](_0x25184d+_0x71b1('0x45'),_0x113874['id'][_0x71b1('0x3d')]()))[_0x71b1('0x41')](_0x71b1('0x43'),squel['select']()[_0x71b1('0x3b')](_0x71b1('0x23'))[_0x71b1('0x44')](_0x71b1('0x36'))[_0x71b1('0x41')](_0x25184d+_0x71b1('0x45'),_0x113874['id'][_0x71b1('0x3d')]())))[_0x71b1('0x3d')]();return _0x243053;};function _0x5d2678(_0x1cf0be,_0x1068ae){var _0x53418b=squel[_0x71b1('0x34')]()[_0x71b1('0x35')]('cm_hopper')[_0x71b1('0x46')]([_0x71b1('0x23'),'scheduledAt',_0x71b1('0x38'),_0x71b1('0x39'),_0x1068ae,'createdAt','updatedAt'],squel[_0x71b1('0x3a')]()[_0x71b1('0x3b')](_0x71b1('0x23'),_0x71b1('0x23'))[_0x71b1('0x3b')](_0x71b1('0x3c'),_0x71b1('0x37'))[_0x71b1('0x3b')]('id',_0x71b1('0x38'))[_0x71b1('0x3b')](LISTID[_0x71b1('0x3d')](),_0x71b1('0x39'))[_0x71b1('0x3b')](_0x1cf0be['id'][_0x71b1('0x3d')](),_0x1068ae)[_0x71b1('0x3b')]('NOW()',_0x71b1('0x3e'))[_0x71b1('0x3b')](_0x71b1('0x3c'),'updatedAt')[_0x71b1('0x44')]('cm_contacts')[_0x71b1('0x41')]('deletedAt\x20IS\x20NULL')[_0x71b1('0x41')]('ListId\x20=\x20?',LISTID[_0x71b1('0x3d')]())[_0x71b1('0x41')](_0x71b1('0x48'),squel['str'](hopperContacts))[_0x71b1('0x41')](_0x71b1('0x42')))['toString']();return _0x53418b;}function _0x155974(_0x49bb3d,_0x33d8c4){var _0x32303b=squel[_0x71b1('0x34')]()[_0x71b1('0x35')]('cm_hopper_black')['fromQuery']([_0x71b1('0x23'),_0x71b1('0x38'),_0x71b1('0x39'),_0x33d8c4,_0x71b1('0x3e'),_0x71b1('0x3f')],squel[_0x71b1('0x3a')]()[_0x71b1('0x3b')]('phone',_0x71b1('0x23'))[_0x71b1('0x3b')]('id',_0x71b1('0x38'))['field'](LISTID[_0x71b1('0x3d')](),_0x71b1('0x39'))[_0x71b1('0x3b')](_0x49bb3d['id']['toString'](),_0x33d8c4)[_0x71b1('0x3b')](_0x71b1('0x3c'),_0x71b1('0x3e'))['field']('NOW()',_0x71b1('0x3f'))[_0x71b1('0x44')]('cm_contacts')[_0x71b1('0x41')](_0x71b1('0x47'))['where'](_0x71b1('0x4c'),LISTID[_0x71b1('0x3d')]())[_0x71b1('0x41')]('id\x20IN\x20?',squel[_0x71b1('0x49')](hopperContacts))[_0x71b1('0x41')](_0x71b1('0x42')))[_0x71b1('0x3d')]();return _0x32303b;}return db[_0x71b1('0x4d')]['findAll']({'where':{'type':_0x71b1('0x4e')},'attributes':['id',_0x71b1('0x4f')],'include':[{'model':db[_0x71b1('0x50')],'as':_0x71b1('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x309af4){var _0x5a2b7d=[];if(_0x309af4){var _0xd3b835;for(var _0x4f2bb0=0x0,_0x5d65d6;_0x4f2bb0<_0x309af4[_0x71b1('0x1c')];_0x4f2bb0+=0x1){_0x5d65d6=_0x309af4[_0x4f2bb0][_0x71b1('0x52')]({'plain':!![]});switch(_0x5d65d6[_0x71b1('0x4f')]){case'always':_0x5a2b7d[_0x71b1('0x2d')](db[_0x71b1('0x53')][_0x71b1('0x54')](_0x1a810a(_0x5d65d6,_0x71b1('0x55')))[_0x71b1('0x2c')](function(){})[_0x71b1('0x2f')](_0x517b33()));break;case _0x71b1('0x56'):_0x5a2b7d[_0x71b1('0x2d')](db[_0x71b1('0x53')][_0x71b1('0x54')](_0x59c2f9(_0x5d65d6,_0x71b1('0x55')))[_0x71b1('0x2c')](function(){})[_0x71b1('0x2f')](_0x517b33()));break;default:_0x5a2b7d[_0x71b1('0x2d')](db[_0x71b1('0x53')][_0x71b1('0x54')](_0x5d2678(_0x5d65d6,_0x71b1('0x55')))['then'](function(){})[_0x71b1('0x2f')](_0x517b33()));}}}return _0x5a2b7d;})[_0x71b1('0x57')]()['then'](function(){return db[_0x71b1('0x4d')][_0x71b1('0x58')]({'where':{'type':_0x71b1('0x4e')},'attributes':['id'],'include':[{'model':db[_0x71b1('0x50')],'as':_0x71b1('0x59'),'where':{'id':LISTID}}]})[_0x71b1('0x2c')](function(_0x151dff){var _0xbf9291=[];if(_0x151dff){var _0x56a747;for(var _0x1baa38=0x0,_0x22e125;_0x1baa38<_0x151dff[_0x71b1('0x1c')];_0x1baa38+=0x1){_0x22e125=_0x151dff[_0x1baa38][_0x71b1('0x52')]({'plain':!![]});_0xbf9291[_0x71b1('0x2d')](db[_0x71b1('0x53')][_0x71b1('0x54')](_0x155974(_0x22e125,_0x71b1('0x55')))['then'](function(){})[_0x71b1('0x2f')](_0x517b33()));}}return _0xbf9291;})[_0x71b1('0x57')]();})[_0x71b1('0x2c')](function(){return db['Campaign'][_0x71b1('0x58')]({'attributes':['id',_0x71b1('0x4f')],'include':[{'model':db[_0x71b1('0x50')],'as':'Lists','where':{'id':LISTID}}]})[_0x71b1('0x2c')](function(_0x3e9eb4){var _0x28693b=[];if(_0x3e9eb4){for(var _0x17655f=0x0,_0x1d3a68;_0x17655f<_0x3e9eb4['length'];_0x17655f+=0x1){_0x1d3a68=_0x3e9eb4[_0x17655f][_0x71b1('0x52')]({'plain':!![]});switch(_0x1d3a68[_0x71b1('0x4f')]){case _0x71b1('0x5a'):_0x28693b[_0x71b1('0x2d')](db[_0x71b1('0x53')]['query'](_0x1a810a(_0x1d3a68,_0x71b1('0x5b')))['then'](function(){})['catch'](_0x517b33()));break;case _0x71b1('0x56'):_0x28693b[_0x71b1('0x2d')](db[_0x71b1('0x53')][_0x71b1('0x54')](_0x59c2f9(_0x1d3a68,_0x71b1('0x5b')))[_0x71b1('0x2c')](function(){})[_0x71b1('0x2f')](_0x517b33()));break;default:_0x28693b[_0x71b1('0x2d')](db[_0x71b1('0x53')][_0x71b1('0x54')](_0x5d2678(_0x1d3a68,_0x71b1('0x5b')))[_0x71b1('0x2c')](function(){})['catch'](_0x517b33()));}}}return _0x28693b;})[_0x71b1('0x57')]();})[_0x71b1('0x2c')](function(){return db[_0x71b1('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x71b1('0x50')],'as':_0x71b1('0x59'),'where':{'id':LISTID}}]})['then'](function(_0xc0e6c1){var _0x4bed67=[];if(_0xc0e6c1){for(var _0x52c045=0x0,_0x30e899;_0x52c045<_0xc0e6c1[_0x71b1('0x1c')];_0x52c045+=0x1){_0x30e899=_0xc0e6c1[_0x52c045][_0x71b1('0x52')]({'plain':!![]});_0x4bed67['push'](db[_0x71b1('0x53')][_0x71b1('0x54')](_0x155974(_0x30e899,_0x71b1('0x5b')))[_0x71b1('0x2c')](function(){})['catch'](_0x517b33()));}}return _0x4bed67;})[_0x71b1('0x57')]();})[_0x71b1('0x2f')](function(_0x394c3d){logger[_0x71b1('0x19')](_0x71b1('0x5d'),'generalCheckHopper',_0x394c3d['message']);});}var processPromises=function(_0x5f5792){return BPromise[_0x71b1('0x57')](promises)[_0x71b1('0x2c')](function(_0x6f5875){})[_0x71b1('0x2f')](function(_0x246ec0){logger[_0x71b1('0x19')]('Error\x20processing\x20rows\x20block:',JSON[_0x71b1('0x31')](_0x246ec0));})[_0x71b1('0x5e')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5f5792){return _0x5f5792[_0x71b1('0x5f')]();}});};var endCsv=function(){return BPromise[_0x71b1('0x60')]()[_0x71b1('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x71b1('0x61')](_0x71b1('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x71b1('0x63')](FILEPATH);}catch(_0x343cc8){logger['error'](_0x71b1('0x64'),JSON[_0x71b1('0x31')](_0x343cc8));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x71b1('0x65')](_0x71b1('0x66'));endCsv();});function main(){return BPromise[_0x71b1('0x60')]()[_0x71b1('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x71b1('0x12')](',');return db[_0x71b1('0x2a')][_0x71b1('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x71b1('0x2c')](function(_0x432f59){var _0xe32bc2=fs[_0x71b1('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x71b1('0x68')](_0xe32bc2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ce38f,_0xcad257){total+=0x1;var _0x3599f0=total;promises['push'](checkRow(_0x2ce38f,_0x432f59,_0x3599f0)['then'](function(){success+=0x1;})[_0x71b1('0x2f')](function(_0x26cb5c){if(_0x26cb5c['error']){errors+=0x1;delete _0x26cb5c[_0x71b1('0x19')];}else if(_0x26cb5c[_0x71b1('0x69')]){duplicates+=0x1;delete _0x26cb5c[_0x71b1('0x69')];}rows['push'](_0x26cb5c);}));if(total%0xc8===0x0){_0xcad257['pause']();return processPromises(_0xcad257);}},'complete':function(){return processPromises()[_0x71b1('0x2c')](function(){logger[_0x71b1('0x65')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1ed7c5,_0x1fdc39){logger[_0x71b1('0x65')](_0x71b1('0x6a'),JSON[_0x71b1('0x31')](_0x1ed7c5));endCsv();}});})[_0x71b1('0x2f')](function(_0x455696){logger['error'](_0x71b1('0x6b'),JSON[_0x71b1('0x31')](_0x455696));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3d71926..7686065 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 _0x3d9a=['Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','import','redis','defaults','socket.io-emitter','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_hopper','\x22always\x22','toString','insert','into','cm_hopper_black','fields','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','MIN(id)','min_id','group','info','error','exit','errors','code','query','spread','push','catch','message','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','parse','createReadStream','length','rows','data','hasOwnProperty','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','SystemRow','emit'];(function(_0x355473,_0x10be8f){var _0x57d0f6=function(_0x366e11){while(--_0x366e11){_0x355473['push'](_0x355473['shift']());}};_0x57d0f6(++_0x10be8f);}(_0x3d9a,0x11a));var _0xa3d9=function(_0x3c0501,_0x459fed){_0x3c0501=_0x3c0501-0x0;var _0xa5ef33=_0x3d9a[_0x3c0501];return _0xa5ef33;};'use strict';var fs=require('fs');var path=require(_0xa3d9('0x0'));var _=require(_0xa3d9('0x1'));var Papa=require('papaparse');var util=require(_0xa3d9('0x2'));var BPromise=require(_0xa3d9('0x3'));var moment=require(_0xa3d9('0x4'));var squel=require(_0xa3d9('0x5'));var Redis=require('ioredis');var db=require(_0xa3d9('0x6'))['db'];var config=require(_0xa3d9('0x7'));var logger=require('../../../config/logger')(_0xa3d9('0x8'));config[_0xa3d9('0x9')]=_[_0xa3d9('0xa')](config[_0xa3d9('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3d9('0xb'))(new Redis(config[_0xa3d9('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x33f90d){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))*$/[_0xa3d9('0xc')](_0x33f90d);}function selectNotIn(_0x1748b8,_0x11426b,_0x243bf6,_0x5d7cb6,_0x2e8018){return squel[_0xa3d9('0xd')]()[_0xa3d9('0xe')](_0xa3d9('0xf'))[_0xa3d9('0x10')](_0x5d7cb6)[_0xa3d9('0x11')](_0x11426b,null,_0x11426b+_0xa3d9('0x12')+_0x5d7cb6+'.'+_0x243bf6)[_0xa3d9('0x13')](_0x5d7cb6+'.'+_0x243bf6+_0xa3d9('0x14')+_0x1748b8+'.'+_0x243bf6)[_0xa3d9('0x13')](_0x11426b+_0xa3d9('0x15')+_0x2e8018[_0xa3d9('0x11')]()+')');}function insertCmHopper(_0x5e8ab1,_0x33820a,_0x4a75df,_0x126d1a,_0x4d6ce4){var _0x3ade34=[_0xa3d9('0x16'),_0xa3d9('0x17'),_0xa3d9('0x18'),_0xa3d9('0x19'),_0x33820a+'.'+_0x126d1a,'cm_contacts.createdAt',_0xa3d9('0x1a'),'cm_contacts.priority',_0xa3d9('0x1b'),'\x22'+_0x4d6ce4+'\x22'];return squel['insert']()['into']('cm_hopper')[_0xa3d9('0x1c')]([_0xa3d9('0xf'),'scheduledat',_0xa3d9('0x1d'),_0xa3d9('0x1e'),_0x126d1a,_0xa3d9('0x1f'),_0xa3d9('0x20'),_0xa3d9('0x21'),_0xa3d9('0x22'),_0xa3d9('0x23')],squel[_0xa3d9('0xd')]()['fields'](_0x3ade34)[_0xa3d9('0x10')](_0x33820a)['join'](_0xa3d9('0x24'),null,_0xa3d9('0x25')+_0x33820a+'.CmListId')[_0xa3d9('0x11')](_0x4a75df,null,_0x4a75df+_0xa3d9('0x12')+_0x33820a+'.'+_0x126d1a)[_0xa3d9('0x13')](_0x33820a+_0xa3d9('0x26'),_0x5e8ab1)[_0xa3d9('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x33820a,_0x4a75df,_0x126d1a,_0xa3d9('0x27'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xa3d9('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x33820a,_0x4a75df,_0x126d1a,_0xa3d9('0x27'),[_0xa3d9('0x28')])))[_0xa3d9('0x29')]();}function insertCmHopperBlack(_0x1af9ad,_0x579081,_0x52e66f,_0xb8888e){var _0x1f3432=[_0xa3d9('0x16'),'cm_contacts.id',_0xa3d9('0x19'),_0x579081+'.'+_0xb8888e,'cm_contacts.createdAt',_0xa3d9('0x1a')];return squel[_0xa3d9('0x2a')]()[_0xa3d9('0x2b')](_0xa3d9('0x2c'))[_0xa3d9('0x1c')](['phone',_0xa3d9('0x1d'),_0xa3d9('0x1e'),_0xb8888e,_0xa3d9('0x1f'),_0xa3d9('0x20')],squel[_0xa3d9('0xd')]()[_0xa3d9('0x2d')](_0x1f3432)[_0xa3d9('0x10')](_0x579081)[_0xa3d9('0x11')]('cm_contacts',null,_0xa3d9('0x25')+_0x579081+_0xa3d9('0x2e'))['join'](_0x52e66f,null,_0x52e66f+'.id\x20=\x20'+_0x579081+'.'+_0xb8888e)[_0xa3d9('0x13')](_0x579081+_0xa3d9('0x26'),_0x1af9ad)[_0xa3d9('0x13')](_0xa3d9('0x2f'),NOW)[_0xa3d9('0x13')](_0xa3d9('0x30'),squel['select']()[_0xa3d9('0xe')](_0xa3d9('0xf'))['from']('cm_hopper_black')[_0xa3d9('0x13')]('ListId\x20=\x20?',_0x1af9ad)[_0xa3d9('0x13')](_0xb8888e+'\x20=\x20?',_0x579081+'.'+_0xb8888e)))['toString']();}function insertCmContact(_0x57a3b9,_0xd741d4,_0x142e9e,_0x212f82){var _0x419006=_[_0xa3d9('0x31')](_[_0xa3d9('0x32')](_0x212f82),[_0xa3d9('0x1e'),_0xa3d9('0x33'),_0xa3d9('0x1f'),'updatedAt']);return squel['insert']()[_0xa3d9('0x2b')](_0xa3d9('0x24'))[_0xa3d9('0x1c')](_0x419006,squel['select']()[_0xa3d9('0x2d')](_0x419006)[_0xa3d9('0x10')](_0xd741d4)[_0xa3d9('0x13')]('('+_0x142e9e[_0xa3d9('0x11')](',')+_0xa3d9('0x34'),squel['select']()['fields'](_0x142e9e)['from'](_0xa3d9('0x24'))[_0xa3d9('0x13')](_0xa3d9('0x35'),_0x57a3b9)[_0xa3d9('0x13')]('deletedAt\x20IS\x20NULL'))[_0xa3d9('0x13')]('id\x20IN\x20?',squel[_0xa3d9('0xd')]()['field'](_0xa3d9('0x36'),_0xa3d9('0x37'))[_0xa3d9('0x10')](_0xd741d4)[_0xa3d9('0x38')](_0x142e9e['join'](','))))[_0xa3d9('0x29')]();}function handleStop(){logger[_0xa3d9('0x39')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4757a9){logger[_0xa3d9('0x3a')](_0x4757a9['message']);process[_0xa3d9('0x3b')](0x1);}function handleError(_0x4c8b58,_0x8c2cd3){stats[_0xa3d9('0x3c')]['push']({'name':_0x8c2cd3[_0xa3d9('0x3d')],'message':_0x8c2cd3['message'],'row':_0x4c8b58});}function handleQuery(_0xdbd580){logger[_0xa3d9('0x39')](_0xdbd580);return db['sequelize'][_0xa3d9('0x3e')](_0xdbd580)[_0xa3d9('0x3f')](function(_0x8ab474){results[_0xa3d9('0x40')](_0x8ab474);})[_0xa3d9('0x41')](function(_0x4318aa){logger[_0xa3d9('0x3a')](_0x4318aa[_0xa3d9('0x42')]);});}function main(_0x1dd209,_0x20cb87,_0x4259b9,_0x119a3b){logger['info'](_0xa3d9('0x43'),_0x1dd209,JSON[_0xa3d9('0x44')](_0x20cb87));process['send'](_0xa3d9('0x45'));var _0x48f900=_0x20cb87[_0xa3d9('0x46')];var _0x3d45d5=_0x20cb87[_0xa3d9('0x47')];var _0x6fe4ac=path['join'](config[_0xa3d9('0x48')],_0xa3d9('0x49'),_0x3d45d5+_0xa3d9('0x4a'));var _0x329438=_[_0xa3d9('0x32')](_0x48f900)['join']();logger[_0xa3d9('0x39')](_0xa3d9('0x4b'),_0x329438);fs['writeFileSync'](_0x6fe4ac,_0x329438+'\x0a');Papa[_0xa3d9('0x4c')](fs[_0xa3d9('0x4d')](_0x1dd209),{'header':!![],'skipEmptyLines':!![],'step':function(_0x628d94,_0x498669){try{for(var _0x59bdfa=0x0,_0x2cb609=[];_0x59bdfa<_0x628d94['data'][_0xa3d9('0x4e')];_0x59bdfa++){stats[_0xa3d9('0x4f')]+=0x1;if(_0x628d94[_0xa3d9('0x3c')][_0x59bdfa]){handleError(_0x628d94[_0xa3d9('0x50')][_0x59bdfa],_0x628d94[_0xa3d9('0x3c')][_0x59bdfa]);}else{var _0x5ac4db=[];for(var _0x5a6892 in _0x48f900){if(_0x48f900[_0xa3d9('0x51')](_0x5a6892)){if(_0x628d94[_0xa3d9('0x50')][_0x59bdfa][_0x48f900[_0x5a6892]]){var _0x2c2d26=_['trim'](_0x628d94[_0xa3d9('0x50')][_0x59bdfa][_0x48f900[_0x5a6892]]['replace'](/"/g,'\x27'));switch(_0x5a6892){case _0xa3d9('0x52'):var _0xebd7fd=moment(_0x2c2d26,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xebd7fd['isValid']()){_0x2cb609['push']('\x22'+_0x2c2d26+'\x22');}else{_0x5ac4db[_0xa3d9('0x40')](_0xa3d9('0x53'));}break;case _0xa3d9('0x21'):var _0x312081=parseInt(_0x2c2d26);_0x2c2d26=_['isNaN'](_0x312081)||_0x312081<0x0||_0x312081>0x4?_0x119a3b?0x3:0x2:_0x312081;_0x2cb609[_0xa3d9('0x40')]('\x22'+_0x2c2d26+'\x22');break;case _0xa3d9('0x22'):var _0x2afe83=parseInt(_0x2c2d26);if(_[_0xa3d9('0x54')](_0x2afe83)&&_['includes'](_0x4259b9,_0x2afe83)){_0x2cb609[_0xa3d9('0x40')]('\x22'+_0x2afe83+'\x22');}else{_0x5ac4db[_0xa3d9('0x40')]('agent\x20not\x20exists');}break;case _0xa3d9('0x55'):if(isEmail(_0x2c2d26)){_0x2cb609[_0xa3d9('0x40')]('\x22'+_0x2c2d26+'\x22');}else{_0x5ac4db['push'](_0xa3d9('0x56'));}break;case'dateOfBirth':var _0x2deede=moment(_0x2c2d26,_0xa3d9('0x57'),!![]);if(_0x2deede[_0xa3d9('0x58')]()){_0x2cb609[_0xa3d9('0x40')]('\x22'+_0x2c2d26+'\x22');}else{_0x5ac4db[_0xa3d9('0x40')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2cb609[_0xa3d9('0x40')]('\x22'+_0x2c2d26+'\x22');}}else{switch(_0x5a6892){case _0xa3d9('0x59'):case'phone':_0x5ac4db[_0xa3d9('0x40')](_0x5a6892+_0xa3d9('0x5a'));break;default:_0x2cb609['push']('\x22\x22');}}}}if(_0x5ac4db[_0xa3d9('0x4e')]){handleError(_0x628d94[_0xa3d9('0x50')][_0x59bdfa],{'code':_0xa3d9('0x5b'),'message':_0x5ac4db['join']()});}else{fs['appendFileSync'](_0x6fe4ac,_0x2cb609[_0xa3d9('0x11')]()+'\x0a');}_0x2cb609=[];}if(!(stats[_0xa3d9('0x4f')]%0xc8)){socket[_0xa3d9('0x5c')]('contact:import:'+_0x3d45d5,stats);stats[_0xa3d9('0x3c')]=[];}}if(stopped){logger[_0xa3d9('0x39')](_0xa3d9('0x5d'));_0x498669[_0xa3d9('0x5e')]();}}catch(_0x58b94c){handleError(_0x628d94[_0xa3d9('0x50')][_0x59bdfa],{'code':'SystemError','message':_0x58b94c[_0xa3d9('0x42')]});logger['error'](_0xa3d9('0x5f'),_0x58b94c[_0xa3d9('0x42')]);}},'complete':function(){try{var _0x4bcfbd=[];var _0xb570b8=_0xa3d9('0x24');if(_0x20cb87[_0xa3d9('0x60')]&&_0x20cb87[_0xa3d9('0x60')][_0xa3d9('0x4e')]){_0xb570b8='cm_contacts_'+_0x3d45d5;_0x4bcfbd[_0xa3d9('0x40')](_0xa3d9('0x61')+_0xb570b8+_0xa3d9('0x62'));}var _0x560914=util[_0xa3d9('0x63')]('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',_0x6fe4ac,_0xb570b8,_0x329438,_0x20cb87[_0xa3d9('0x1e')],_0x20cb87[_0xa3d9('0x33')]||null,NOW,NOW);if(_[_0xa3d9('0x64')](_0x48f900[_0xa3d9('0x52')])){_0x560914+=_0xa3d9('0x65');}_0x4bcfbd[_0xa3d9('0x40')](_0x560914);if(_0x20cb87['duplicates']&&_0x20cb87[_0xa3d9('0x60')][_0xa3d9('0x4e')]){_0x4bcfbd[_0xa3d9('0x40')](insertCmContact(_0x20cb87['ListId'],_0xb570b8,_0x20cb87[_0xa3d9('0x60')],_0x48f900));_0x4bcfbd[_0xa3d9('0x40')](_0xa3d9('0x66')+_0xb570b8+';');}_0x4bcfbd['push'](insertCmHopper(_0x20cb87[_0xa3d9('0x1e')],'voice_queues_has_cm_lists',_0xa3d9('0x67'),'VoiceQueueId',_0x119a3b));_0x4bcfbd[_0xa3d9('0x40')](insertCmHopperBlack(_0x20cb87[_0xa3d9('0x1e')],'voice_queues_has_cm_blacklists','voice_queues',_0xa3d9('0x68')));_0x4bcfbd[_0xa3d9('0x40')](insertCmHopper(_0x20cb87['ListId'],_0xa3d9('0x69'),_0xa3d9('0x6a'),_0xa3d9('0x6b'),_0x119a3b));_0x4bcfbd['push'](insertCmHopperBlack(_0x20cb87[_0xa3d9('0x1e')],_0xa3d9('0x6c'),_0xa3d9('0x6a'),_0xa3d9('0x6b')));BPromise['each'](_0x4bcfbd,handleQuery)[_0xa3d9('0x6d')](function(_0x25e790){stats[_0xa3d9('0x6e')]=!![];stats['affectedRows']=_0x20cb87[_0xa3d9('0x60')]&&_0x20cb87[_0xa3d9('0x60')]['length']?results[0x2]['affectedRows']:results[0x0][_0xa3d9('0x6f')];socket['emit'](_0xa3d9('0x70')+_0x3d45d5,stats);fs['unlink'](_0x1dd209);fs[_0xa3d9('0x71')](_0x6fe4ac);process[_0xa3d9('0x3b')](0x0);})[_0xa3d9('0x41')](function(_0x4ed24e){logger[_0xa3d9('0x3a')](_0x4ed24e[_0xa3d9('0x42')]);process[_0xa3d9('0x3b')](0x1);});}catch(_0x2fd14f){logger[_0xa3d9('0x3a')](_0xa3d9('0x72'),_0x2fd14f[_0xa3d9('0x42')]);process[_0xa3d9('0x3b')](0x1);}},'error':function(_0x47bcc2,_0x34dd76,_0x12de8c,_0x2251ec){throw new Error(_0x2251ec);}});}function validate(){if(process['argv']&&process[_0xa3d9('0x73')][_0xa3d9('0x4e')]<0x4){throw new Error(_0xa3d9('0x74'));}var _0x5198af=path[_0xa3d9('0x11')](config['root'],'server/files/tmp',process[_0xa3d9('0x73')][0x2]);if(!fs[_0xa3d9('0x75')](_0x5198af)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x28e711={};try{_0x28e711=JSON[_0xa3d9('0x4c')](process[_0xa3d9('0x73')][0x3]);if(!_0x28e711[_0xa3d9('0x46')]){throw new Error(_0xa3d9('0x76'));}if(!_0x28e711[_0xa3d9('0x46')][_0xa3d9('0xf')]){throw new Error(_0xa3d9('0x77'));}if(!_0x28e711[_0xa3d9('0x46')][_0xa3d9('0x59')]){throw new Error('firstName\x20is\x20mandatory');}var _0x12a4ac=0x0;if(_0x28e711[_0xa3d9('0x46')][_0xa3d9('0x22')]){_0x12a4ac=0x1;}if(!_0x28e711[_0xa3d9('0x1e')]){throw new Error(_0xa3d9('0x78'));}}catch(_0x4da835){throw new Error('body\x20id\x20mandatory');}var _0x1430bd=[];try{_0x1430bd=_[_0xa3d9('0x79')](JSON[_0xa3d9('0x4c')](process['argv'][0x4]),'id');}catch(_0x3e8b44){logger[_0xa3d9('0x39')](_0xa3d9('0x7a'));}main(_0x5198af,_0x28e711,_0x1430bd,_0x12a4ac);}validate();process['on'](_0xa3d9('0x7b'),handleStop);process['on'](_0xa3d9('0x7c'),handleUncaughtException); \ No newline at end of file +var _0x1301=['firstName','SystemRow','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','each','then','affectedRows','unlink','exit','complete','argv','server/files/tmp','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','ContactId','createdAt','priority','UserId','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','into','ListId','updatedAt','cm_hopper_black','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','errors','push','code','query','spread','catch','main','stringify','send','start','binding','socket_timestamp','root','keys','header','writeFileSync','parse','length','rows','data','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)'];(function(_0x2e9948,_0x2c72a1){var _0x156ef9=function(_0x208553){while(--_0x208553){_0x2e9948['push'](_0x2e9948['shift']());}};_0x156ef9(++_0x2c72a1);}(_0x1301,0xb0));var _0x1130=function(_0x191043,_0x4f49b9){_0x191043=_0x191043-0x0;var _0x4c4a1b=_0x1301[_0x191043];return _0x4c4a1b;};'use strict';var fs=require('fs');var path=require(_0x1130('0x0'));var _=require(_0x1130('0x1'));var Papa=require(_0x1130('0x2'));var util=require('util');var BPromise=require(_0x1130('0x3'));var moment=require('moment');var squel=require(_0x1130('0x4'));var Redis=require(_0x1130('0x5'));var db=require(_0x1130('0x6'))['db'];var config=require(_0x1130('0x7'));var logger=require(_0x1130('0x8'))(_0x1130('0x9'));config[_0x1130('0xa')]=_[_0x1130('0xb')](config[_0x1130('0xa')],{'host':_0x1130('0xc'),'port':0x18eb});var socket=require(_0x1130('0xd'))(new Redis(config[_0x1130('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x1130('0xe')](_0x1130('0xf'));function isEmail(_0x58a182){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))*$/[_0x1130('0x10')](_0x58a182);}function selectNotIn(_0x38bfed,_0x28e360,_0x72df1,_0x4506d2,_0x22a34f){return squel['select']()[_0x1130('0x11')](_0x1130('0x12'))[_0x1130('0x13')](_0x4506d2)['join'](_0x28e360,null,_0x28e360+_0x1130('0x14')+_0x4506d2+'.'+_0x72df1)[_0x1130('0x15')](_0x4506d2+'.'+_0x72df1+_0x1130('0x16')+_0x38bfed+'.'+_0x72df1)[_0x1130('0x15')](_0x28e360+_0x1130('0x17')+_0x22a34f[_0x1130('0x18')]()+')');}function insertCmHopper(_0x4ce450,_0x144564,_0x5a8296,_0x7f7ecb,_0x1fd684){var _0x113e78=[_0x1130('0x19'),_0x1130('0x1a'),_0x1130('0x1b'),_0x1130('0x1c'),_0x144564+'.'+_0x7f7ecb,_0x1130('0x1d'),_0x1130('0x1e'),_0x1130('0x1f'),_0x1130('0x20'),'\x22'+_0x1fd684+'\x22'];return squel[_0x1130('0x21')]()['into'](_0x1130('0x22'))[_0x1130('0x23')]([_0x1130('0x12'),'scheduledat',_0x1130('0x24'),'ListId',_0x7f7ecb,_0x1130('0x25'),'updatedAt',_0x1130('0x26'),_0x1130('0x27'),_0x1130('0x28')],squel[_0x1130('0x29')]()[_0x1130('0x2a')](_0x113e78)[_0x1130('0x13')](_0x144564)[_0x1130('0x18')](_0x1130('0x2b'),null,'cm_contacts.ListId\x20=\x20'+_0x144564+_0x1130('0x2c'))['join'](_0x5a8296,null,_0x5a8296+_0x1130('0x14')+_0x144564+'.'+_0x7f7ecb)[_0x1130('0x15')](_0x144564+_0x1130('0x2d'),_0x4ce450)[_0x1130('0x15')](_0x1130('0x2e'),NOW)['where'](_0x1130('0x2f'),selectNotIn(_0x144564,_0x5a8296,_0x7f7ecb,_0x1130('0x22'),[_0x1130('0x30'),'\x22onlyIfOpen\x22']))[_0x1130('0x15')](_0x1130('0x2f'),selectNotIn(_0x144564,_0x5a8296,_0x7f7ecb,_0x1130('0x22'),['\x22always\x22'])))[_0x1130('0x31')]();}function insertCmHopperBlack(_0x45774c,_0x4d1a22,_0x2fa9fb,_0x52ff1c){var _0x203666=[_0x1130('0x19'),_0x1130('0x1b'),'cm_contacts.ListId',_0x4d1a22+'.'+_0x52ff1c,_0x1130('0x1d'),_0x1130('0x1e')];return squel[_0x1130('0x21')]()[_0x1130('0x32')]('cm_hopper_black')[_0x1130('0x23')]([_0x1130('0x12'),_0x1130('0x24'),_0x1130('0x33'),_0x52ff1c,'createdAt',_0x1130('0x34')],squel['select']()[_0x1130('0x2a')](_0x203666)[_0x1130('0x13')](_0x4d1a22)[_0x1130('0x18')](_0x1130('0x2b'),null,'cm_contacts.ListId\x20=\x20'+_0x4d1a22+_0x1130('0x2c'))['join'](_0x2fa9fb,null,_0x2fa9fb+_0x1130('0x14')+_0x4d1a22+'.'+_0x52ff1c)[_0x1130('0x15')](_0x4d1a22+'.CmListId\x20=\x20?',_0x45774c)[_0x1130('0x15')](_0x1130('0x2e'),NOW)[_0x1130('0x15')](_0x1130('0x2f'),squel['select']()[_0x1130('0x11')]('phone')[_0x1130('0x13')](_0x1130('0x35'))['where']('ListId\x20=\x20?',_0x45774c)['where'](_0x52ff1c+_0x1130('0x36'),_0x4d1a22+'.'+_0x52ff1c)))[_0x1130('0x31')]();}function insertCmContact(_0x2fcee7,_0x4e89cd,_0x415f64,_0x42041a){var _0x4c058d=_[_0x1130('0x37')](_['keys'](_0x42041a),[_0x1130('0x33'),_0x1130('0x38'),_0x1130('0x25'),'updatedAt']);return squel[_0x1130('0x21')]()[_0x1130('0x32')](_0x1130('0x2b'))[_0x1130('0x23')](_0x4c058d,squel[_0x1130('0x29')]()[_0x1130('0x2a')](_0x4c058d)['from'](_0x4e89cd)[_0x1130('0x15')]('('+_0x415f64[_0x1130('0x18')](',')+_0x1130('0x39'),squel[_0x1130('0x29')]()['fields'](_0x415f64)[_0x1130('0x13')](_0x1130('0x2b'))[_0x1130('0x15')]('ListId\x20=\x20?',_0x2fcee7)[_0x1130('0x15')](_0x1130('0x3a')))['where'](_0x1130('0x3b'),squel['select']()[_0x1130('0x11')](_0x1130('0x3c'),'min_id')['from'](_0x4e89cd)[_0x1130('0x3d')](_0x415f64[_0x1130('0x18')](','))))['toString']();}function handleStop(){logger[_0x1130('0x3e')](_0x1130('0x3f'));stopped=!![];}function handleUncaughtException(_0x508cd0){logger[_0x1130('0x40')](_0x508cd0[_0x1130('0x41')]);process['exit'](0x1);}function handleError(_0x1dfc8a,_0x30cf16){stats[_0x1130('0x42')][_0x1130('0x43')]({'name':_0x30cf16[_0x1130('0x44')],'message':_0x30cf16['message'],'row':_0x1dfc8a});}function handleQuery(_0x8dcfc){logger[_0x1130('0x3e')](_0x8dcfc);return db['sequelize'][_0x1130('0x45')](_0x8dcfc)[_0x1130('0x46')](function(_0x242359){results['push'](_0x242359);})[_0x1130('0x47')](function(_0x46040a){logger[_0x1130('0x40')](_0x46040a['message']);});}function main(_0x3d1d54,_0x2bd358,_0x1cb4eb,_0xda3c7f){logger[_0x1130('0x3e')](_0x1130('0x48'),_0x3d1d54,JSON[_0x1130('0x49')](_0x2bd358));process[_0x1130('0x4a')](_0x1130('0x4b'));var _0x44d23c=_0x2bd358[_0x1130('0x4c')];var _0x538c31=_0x2bd358[_0x1130('0x4d')];var _0x49eba6=path[_0x1130('0x18')](config[_0x1130('0x4e')],'server/files/tmp',_0x538c31+'.csv');var _0x26700e=_[_0x1130('0x4f')](_0x44d23c)['join']();logger[_0x1130('0x3e')](_0x1130('0x50'),_0x26700e);fs[_0x1130('0x51')](_0x49eba6,_0x26700e+'\x0a');Papa[_0x1130('0x52')](fs['createReadStream'](_0x3d1d54),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4ecb94,_0xbe660c){try{for(var _0xf90fc7=0x0,_0x42e20a=[];_0xf90fc7<_0x4ecb94['data'][_0x1130('0x53')];_0xf90fc7++){stats[_0x1130('0x54')]+=0x1;if(_0x4ecb94[_0x1130('0x42')][_0xf90fc7]){handleError(_0x4ecb94['data'][_0xf90fc7],_0x4ecb94[_0x1130('0x42')][_0xf90fc7]);}else{var _0x1a2b50=[];for(var _0x2ccc49 in _0x44d23c){if(_0x44d23c['hasOwnProperty'](_0x2ccc49)){if(_0x4ecb94[_0x1130('0x55')][_0xf90fc7][_0x44d23c[_0x2ccc49]]){var _0x15396e=_[_0x1130('0x56')](_0x4ecb94[_0x1130('0x55')][_0xf90fc7][_0x44d23c[_0x2ccc49]][_0x1130('0x57')](/"/g,'\x27'));switch(_0x2ccc49){case _0x1130('0x58'):var _0xb6f200=moment(_0x15396e,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xb6f200[_0x1130('0x59')]()){_0x42e20a[_0x1130('0x43')]('\x22'+_0x15396e+'\x22');}else{_0x1a2b50[_0x1130('0x43')](_0x1130('0x5a'));}break;case'priority':var _0x13541f=parseInt(_0x15396e);_0x15396e=_[_0x1130('0x5b')](_0x13541f)||_0x13541f<0x0||_0x13541f>0x4?_0xda3c7f?0x3:0x2:_0x13541f;_0x42e20a[_0x1130('0x43')]('\x22'+_0x15396e+'\x22');break;case'UserId':var _0x530854=parseInt(_0x15396e);if(_[_0x1130('0x5c')](_0x530854)&&_[_0x1130('0x5d')](_0x1cb4eb,_0x530854)){_0x42e20a[_0x1130('0x43')]('\x22'+_0x530854+'\x22');}else{_0x1a2b50[_0x1130('0x43')](_0x1130('0x5e'));}break;case _0x1130('0x5f'):if(isEmail(_0x15396e)){_0x42e20a[_0x1130('0x43')]('\x22'+_0x15396e+'\x22');}else{_0x1a2b50[_0x1130('0x43')](_0x1130('0x60'));}break;case _0x1130('0x61'):var _0xe341ef=moment(_0x15396e,_0x1130('0x62'),!![]);if(_0xe341ef[_0x1130('0x59')]()){_0x42e20a[_0x1130('0x43')]('\x22'+_0x15396e+'\x22');}else{_0x1a2b50[_0x1130('0x43')](_0x1130('0x63'));}break;default:_0x42e20a[_0x1130('0x43')]('\x22'+_0x15396e+'\x22');}}else{switch(_0x2ccc49){case _0x1130('0x64'):case _0x1130('0x12'):_0x1a2b50[_0x1130('0x43')](_0x2ccc49+'\x20not\x20specified');break;default:_0x42e20a['push']('\x22\x22');}}}}if(_0x1a2b50['length']){handleError(_0x4ecb94['data'][_0xf90fc7],{'code':_0x1130('0x65'),'message':_0x1a2b50['join']()});}else{fs['appendFileSync'](_0x49eba6,_0x42e20a[_0x1130('0x18')]()+'\x0a');}_0x42e20a=[];}if(!(stats[_0x1130('0x54')]%0xc8)){socket[_0x1130('0x66')](_0x1130('0x67')+_0x538c31,stats);stats[_0x1130('0x42')]=[];}}if(stopped){logger[_0x1130('0x3e')](_0x1130('0x68'));_0xbe660c[_0x1130('0x69')]();}}catch(_0x39f305){handleError(_0x4ecb94[_0x1130('0x55')][_0xf90fc7],{'code':'SystemError','message':_0x39f305['message']});logger[_0x1130('0x40')](_0x1130('0x6a'),_0x39f305[_0x1130('0x41')]);}},'complete':function(){try{var _0x5e5246=[];var _0x1db8ef=_0x1130('0x2b');if(_0x2bd358[_0x1130('0x6b')]&&_0x2bd358[_0x1130('0x6b')][_0x1130('0x53')]){_0x1db8ef=_0x1130('0x6c')+_0x538c31;_0x5e5246['push'](_0x1130('0x6d')+_0x1db8ef+_0x1130('0x6e'));}var _0x2b928f=util[_0x1130('0xe')]('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',_0x49eba6,_0x1db8ef,_0x26700e,_0x2bd358[_0x1130('0x33')],_0x2bd358['CompanyId']||null,NOW,NOW);if(_[_0x1130('0x6f')](_0x44d23c[_0x1130('0x58')])){_0x2b928f+=_0x1130('0x70');}_0x5e5246[_0x1130('0x43')](_0x2b928f);if(_0x2bd358[_0x1130('0x6b')]&&_0x2bd358['duplicates'][_0x1130('0x53')]){_0x5e5246[_0x1130('0x43')](insertCmContact(_0x2bd358[_0x1130('0x33')],_0x1db8ef,_0x2bd358[_0x1130('0x6b')],_0x44d23c));_0x5e5246['push'](_0x1130('0x71')+_0x1db8ef+';');}_0x5e5246[_0x1130('0x43')](insertCmHopper(_0x2bd358[_0x1130('0x33')],_0x1130('0x72'),_0x1130('0x73'),_0x1130('0x74'),_0xda3c7f));_0x5e5246['push'](insertCmHopperBlack(_0x2bd358[_0x1130('0x33')],_0x1130('0x75'),_0x1130('0x73'),_0x1130('0x74')));_0x5e5246['push'](insertCmHopper(_0x2bd358['ListId'],_0x1130('0x76'),_0x1130('0x77'),_0x1130('0x78'),_0xda3c7f));_0x5e5246[_0x1130('0x43')](insertCmHopperBlack(_0x2bd358['ListId'],'campaigns_has_cm_blacklists',_0x1130('0x77'),_0x1130('0x78')));BPromise[_0x1130('0x79')](_0x5e5246,handleQuery)[_0x1130('0x7a')](function(_0x4aad8c){stats['finish']=!![];stats[_0x1130('0x7b')]=_0x2bd358[_0x1130('0x6b')]&&_0x2bd358[_0x1130('0x6b')][_0x1130('0x53')]?results[0x2][_0x1130('0x7b')]:results[0x0][_0x1130('0x7b')];socket[_0x1130('0x66')](_0x1130('0x67')+_0x538c31,stats);fs['unlink'](_0x3d1d54);fs[_0x1130('0x7c')](_0x49eba6);process[_0x1130('0x7d')](0x0);})[_0x1130('0x47')](function(_0x4071e9){logger['error'](_0x4071e9[_0x1130('0x41')]);process['exit'](0x1);});}catch(_0x4c7efa){logger[_0x1130('0x40')](_0x1130('0x7e'),_0x4c7efa['message']);process[_0x1130('0x7d')](0x1);}},'error':function(_0x6985ff,_0x2da162,_0xed4ca,_0x4f0ff1){throw new Error(_0x4f0ff1);}});}function validate(){if(process[_0x1130('0x7f')]&&process[_0x1130('0x7f')][_0x1130('0x53')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0xfd7262=path[_0x1130('0x18')](config[_0x1130('0x4e')],_0x1130('0x80'),process[_0x1130('0x7f')][0x2]);if(!fs['existsSync'](_0xfd7262)){throw new Error(_0x1130('0x81'));}var _0x2206fd={};try{_0x2206fd=JSON[_0x1130('0x52')](process[_0x1130('0x7f')][0x3]);if(!_0x2206fd[_0x1130('0x4c')]){throw new Error(_0x1130('0x82'));}if(!_0x2206fd[_0x1130('0x4c')][_0x1130('0x12')]){throw new Error(_0x1130('0x83'));}if(!_0x2206fd[_0x1130('0x4c')]['firstName']){throw new Error(_0x1130('0x84'));}var _0x5abd72=0x0;if(_0x2206fd[_0x1130('0x4c')][_0x1130('0x27')]){_0x5abd72=0x1;}if(!_0x2206fd[_0x1130('0x33')]){throw new Error(_0x1130('0x85'));}}catch(_0x5f4481){throw new Error(_0x1130('0x86'));}var _0x3d5ffd=[];try{_0x3d5ffd=_[_0x1130('0x87')](JSON[_0x1130('0x52')](process[_0x1130('0x7f')][0x4]),'id');}catch(_0x2a5699){logger['info'](_0x1130('0x88'));}main(_0xfd7262,_0x2206fd,_0x3d5ffd,_0x5abd72);}validate();process['on'](_0x1130('0x89'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 4c28dc4..7347560 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 _0x6a27=['agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','***\x20Time\x20Info\x20***','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','destcalleridnum','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x6a27,0x192));var _0x76a2=function(_0x155d89,_0x24d2e9){_0x155d89=_0x155d89-0x0;var _0x4b0806=_0x6a27[_0x155d89];return _0x4b0806;};'use strict';exports[_0x76a2('0x0')]=function(_0x4cd7d5,_0x857418){var _0x59fe94=[{'type':_0x76a2('0x1'),'content':_0x76a2('0x2'),'variableName':null}];switch(_0x4cd7d5[_0x76a2('0x3')]()){case'voice':switch(_0x857418[_0x76a2('0x3')]()){case _0x76a2('0x4'):_0x59fe94[_0x76a2('0x5')]({'type':_0x76a2('0x6'),'content':'','variableName':_0x76a2('0x7')});_0x59fe94[_0x76a2('0x5')]({'type':_0x76a2('0x6'),'content':'','variableName':_0x76a2('0x8')});break;case _0x76a2('0x9'):_0x59fe94['push']({'type':_0x76a2('0x1'),'content':'Outbound\x20Call','variableName':null});_0x59fe94['push']({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x59fe94;};exports[_0x76a2('0xa')]=function(_0x21f662,_0x1c8059){var _0x5d7516=[];switch(_0x21f662[_0x76a2('0x3')]()){case'voice':switch(_0x1c8059[_0x76a2('0x3')]()){case _0x76a2('0x4'):_0x5d7516=[{'type':_0x76a2('0x1'),'content':_0x76a2('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0x76a2('0x6'),'variableName':'calleridnum'},{'type':_0x76a2('0xc'),'content':'','key':'Caller\x20Name','keyType':_0x76a2('0x6'),'variableName':'calleridname'},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0xd'),'keyType':_0x76a2('0x6'),'variableName':_0x76a2('0xe')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0xf'),'keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x7')},{'type':'keyValue','content':'','key':_0x76a2('0x10'),'keyType':'variable','variableName':_0x76a2('0x11')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x12'),'keyType':'variable','variableName':_0x76a2('0x13')},{'type':_0x76a2('0x1'),'content':_0x76a2('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x15'),'keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x16')},{'type':_0x76a2('0xc'),'content':'','key':'Agent\x20Number','keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x17')},{'type':_0x76a2('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x18'),'keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x13')},{'type':'keyValue','content':'','key':_0x76a2('0x19'),'keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x1a')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x1b'),'keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x1c')},{'type':_0x76a2('0xc'),'content':'','key':'Hold\x20Time','keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x1d')},{'type':'keyValue','content':'','key':_0x76a2('0x1e'),'keyType':_0x76a2('0x6'),'variableName':_0x76a2('0x1f')}];break;case _0x76a2('0x9'):_0x5d7516=[{'type':_0x76a2('0x1'),'content':_0x76a2('0xb'),'variableName':null},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x20'),'keyType':_0x76a2('0x6'),'keyContent':'','variableName':_0x76a2('0x17')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x21'),'keyType':_0x76a2('0x6'),'keyContent':'','variableName':_0x76a2('0x22')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x10'),'keyType':'variable','keyContent':'','variableName':_0x76a2('0x11')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x12'),'keyType':_0x76a2('0x6'),'keyContent':'','variableName':'starttime'},{'type':_0x76a2('0x1'),'content':_0x76a2('0x23')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x24'),'keyType':_0x76a2('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x25'),'keyType':_0x76a2('0x6'),'keyContent':'','variableName':_0x76a2('0x26')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x27'),'keyType':_0x76a2('0x6'),'keyContent':'','variableName':_0x76a2('0x28')},{'type':_0x76a2('0xc'),'content':'','key':_0x76a2('0x29'),'keyType':_0x76a2('0x6'),'keyContent':'','variableName':_0x76a2('0x2a')}];break;}}return _0x5d7516;}; \ No newline at end of file +var _0xda67=['Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','queue','variable','calleridnum','outbound','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','endtime','duration'];(function(_0x208dcd,_0x21b78a){var _0x471717=function(_0x4bf68a){while(--_0x4bf68a){_0x208dcd['push'](_0x208dcd['shift']());}};_0x471717(++_0x21b78a);}(_0xda67,0x1b0));var _0x7da6=function(_0x5cf209,_0x274212){_0x5cf209=_0x5cf209-0x0;var _0x2ac22d=_0xda67[_0x5cf209];return _0x2ac22d;};'use strict';exports[_0x7da6('0x0')]=function(_0x27867a,_0x244a1b){var _0x18be99=[{'type':_0x7da6('0x1'),'content':_0x7da6('0x2'),'variableName':null}];switch(_0x27867a[_0x7da6('0x3')]()){case'voice':switch(_0x244a1b[_0x7da6('0x3')]()){case _0x7da6('0x4'):_0x18be99[_0x7da6('0x5')]({'type':'variable','content':'','variableName':_0x7da6('0x6')});_0x18be99['push']({'type':_0x7da6('0x7'),'content':'','variableName':_0x7da6('0x8')});break;case _0x7da6('0x9'):_0x18be99[_0x7da6('0x5')]({'type':_0x7da6('0x1'),'content':'Outbound\x20Call','variableName':null});_0x18be99[_0x7da6('0x5')]({'type':_0x7da6('0x7'),'content':'','variableName':_0x7da6('0xa')});break;}}return _0x18be99;};exports[_0x7da6('0xb')]=function(_0x1d80a5,_0x331dc8){var _0x1334fc=[];switch(_0x1d80a5['toLowerCase']()){case _0x7da6('0xc'):switch(_0x331dc8['toLowerCase']()){case _0x7da6('0x4'):_0x1334fc=[{'type':_0x7da6('0x1'),'content':_0x7da6('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0xf'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x8')},{'type':'keyValue','content':'','key':_0x7da6('0x10'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x11')},{'type':'keyValue','content':'','key':_0x7da6('0x12'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x13')},{'type':_0x7da6('0xe'),'content':'','key':'Queue','keyType':_0x7da6('0x7'),'variableName':'queue'},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x14'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x15')},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x16'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x17')},{'type':_0x7da6('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x18')},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x19'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0xa')},{'type':_0x7da6('0x1'),'content':_0x7da6('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x7da6('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x17')},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x1b'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x1c')},{'type':'keyValue','content':'','key':_0x7da6('0x1d'),'keyType':'variable','variableName':_0x7da6('0x1e')},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x1f'),'keyType':_0x7da6('0x7'),'variableName':_0x7da6('0x20')},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x21'),'keyType':_0x7da6('0x7'),'variableName':'talktime'}];break;case _0x7da6('0x9'):_0x1334fc=[{'type':_0x7da6('0x1'),'content':_0x7da6('0xd'),'variableName':null},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x22'),'keyType':_0x7da6('0x7'),'keyContent':'','variableName':_0x7da6('0xa')},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x23'),'keyType':_0x7da6('0x7'),'keyContent':'','variableName':_0x7da6('0x24')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x7da6('0x7'),'keyContent':'','variableName':_0x7da6('0x15')},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x16'),'keyType':_0x7da6('0x7'),'keyContent':'','variableName':_0x7da6('0x25')},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0x7da6('0xe'),'content':'','key':_0x7da6('0x26'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x7da6('0x7'),'keyContent':'','variableName':_0x7da6('0x27')},{'type':_0x7da6('0xe'),'content':'','key':'Duration','keyType':_0x7da6('0x7'),'keyContent':'','variableName':_0x7da6('0x28')},{'type':'keyValue','content':'','key':_0x7da6('0x29'),'keyType':_0x7da6('0x7'),'keyContent':'','variableName':_0x7da6('0x2a')}];break;}}return _0x1334fc;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 0920d29..eb700b7 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 _0xf1cc=['clone','body','omit','html','phone','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','then','update','info','catch','error','query'];(function(_0x1d39e9,_0xa49794){var _0x43a4c8=function(_0x115bac){while(--_0x115bac){_0x1d39e9['push'](_0x1d39e9['shift']());}};_0x43a4c8(++_0xa49794);}(_0xf1cc,0x17f));var _0xcf1c=function(_0x21a9a7,_0x223b80){_0x21a9a7=_0x21a9a7-0x0;var _0x29b1a2=_0xf1cc[_0x21a9a7];return _0x29b1a2;};'use strict';var _=require(_0xcf1c('0x0'));var db=require(_0xcf1c('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xcf1c('0x2')),'mail':require(_0xcf1c('0x3'))(_0xcf1c('0x4')),'fax':require(_0xcf1c('0x3'))(_0xcf1c('0x5')),'sms':require('../../config/logger')(_0xcf1c('0x6')),'chat':require(_0xcf1c('0x3'))('chat-interactions'),'whatsapp':require(_0xcf1c('0x3'))('whatsapp-interactions')};function getInteractionId(_0x2ef160,_0x5d6d9f,_0x210586){if(_0x2ef160&&_0x2ef160[_[_0xcf1c('0x7')](_0x210586)+'InteractionId']){return _0x2ef160[_[_0xcf1c('0x7')](_0x210586)+'InteractionId'];}else if(_0x2ef160&&_0x2ef160['id']){return _0x2ef160['id'];}else if(_0x5d6d9f&&_0x5d6d9f['id']){return _0x5d6d9f['id'];}else{return _0xcf1c('0x8');}}function log(_0x29f2c1,_0x221e9,_0x46df80,_0x53dc9c,_0x37f942,_0x2e0047){loggers[_0x37f942[_0xcf1c('0x9')]()][_0x29f2c1](_0xcf1c('0xa'),_0x2e0047[_0xcf1c('0xb')](),_0x221e9?_0x221e9['id']:null,_0x221e9?_0x221e9[_0xcf1c('0xc')]:null,_0x221e9?_0x221e9[_0xcf1c('0xd')]:null,getInteractionId(_0x46df80,_0x53dc9c,_0x37f942),_0x46df80?JSON[_0xcf1c('0xe')](_0x46df80):_0xcf1c('0xf'));}function updateUser(_0x2aa8d1,_0xe69f74,_0x51c67a,_0x5139c0,_0x161a85){db[_[_0xcf1c('0x7')](_0x5139c0)+_0xcf1c('0x10')]['findOne']({'where':{'id':getInteractionId(_0xe69f74,_0x51c67a,_0x5139c0)}})[_0xcf1c('0x11')](function(_0x13e39d){if(_0x13e39d){return _0x13e39d[_0xcf1c('0x12')]({'UserId':_0x2aa8d1?_0x2aa8d1['id']:null});}})[_0xcf1c('0x11')](function(_0x5b130b){if(_0x5b130b){log(_0xcf1c('0x13'),_0x2aa8d1,_0xe69f74,_0x51c67a,_0x5139c0,_0x161a85);}})[_0xcf1c('0x14')](function(){log(_0xcf1c('0x15'),_0x2aa8d1,_0xe69f74,_0x51c67a,_0x5139c0,_0x161a85);});}exports['tracked']=function(_0x2ba096,_0x2ab9d1){return function(_0x53e37e,_0x1c0538,_0x327c6f){var _0x5b502e=_0x53e37e['user'];var _0x291e27={};var _0x217cd4=_0x53e37e[_0xcf1c('0x16')];if(_0x291e27){_0x291e27=_[_0xcf1c('0x17')](_0x53e37e[_0xcf1c('0x18')]);_0x291e27=_[_0xcf1c('0x19')](_0x291e27,['body',_0xcf1c('0x1a'),_0xcf1c('0x1b'),'fax',_0xcf1c('0x1c')]);}updateUser(_0x5b502e,_0x291e27,_0x217cd4,_0x2ba096,_0x2ab9d1);_0x327c6f(null);};}; \ No newline at end of file +var _0xb425=['then','update','catch','tracked','query','clone','body','omit','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','fax-interactions','sms-interactions','whatsapp-interactions','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne'];(function(_0x240362,_0x156794){var _0x26de18=function(_0x4a4431){while(--_0x4a4431){_0x240362['push'](_0x240362['shift']());}};_0x26de18(++_0x156794);}(_0xb425,0x193));var _0x5b42=function(_0x4a58c1,_0x1acc7f){_0x4a58c1=_0x4a58c1-0x0;var _0xbd1a75=_0xb425[_0x4a58c1];return _0xbd1a75;};'use strict';var _=require(_0x5b42('0x0'));var db=require(_0x5b42('0x1'))['db'];var loggers={'openchannel':require(_0x5b42('0x2'))('openchannel-interactions'),'mail':require(_0x5b42('0x2'))('mail-interactions'),'fax':require('../../config/logger')(_0x5b42('0x3')),'sms':require(_0x5b42('0x2'))(_0x5b42('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x5b42('0x2'))(_0x5b42('0x5'))};function getInteractionId(_0x1b82fa,_0x2f1c71,_0x290c9d){if(_0x1b82fa&&_0x1b82fa[_['upperFirst'](_0x290c9d)+_0x5b42('0x6')]){return _0x1b82fa[_['upperFirst'](_0x290c9d)+'InteractionId'];}else if(_0x1b82fa&&_0x1b82fa['id']){return _0x1b82fa['id'];}else if(_0x2f1c71&&_0x2f1c71['id']){return _0x2f1c71['id'];}else{return _0x5b42('0x7');}}function log(_0x2ec003,_0x425843,_0x1d25e5,_0x32e3af,_0xc741c3,_0xb61faa){loggers[_0xc741c3[_0x5b42('0x8')]()][_0x2ec003](_0x5b42('0x9'),_0xb61faa[_0x5b42('0xa')](),_0x425843?_0x425843['id']:null,_0x425843?_0x425843[_0x5b42('0xb')]:null,_0x425843?_0x425843[_0x5b42('0xc')]:null,getInteractionId(_0x1d25e5,_0x32e3af,_0xc741c3),_0x1d25e5?JSON[_0x5b42('0xd')](_0x1d25e5):_0x5b42('0xe'));}function updateUser(_0x356180,_0x35d79e,_0x1658d3,_0x24bc3d,_0x43a58e){db[_['upperFirst'](_0x24bc3d)+_0x5b42('0xf')][_0x5b42('0x10')]({'where':{'id':getInteractionId(_0x35d79e,_0x1658d3,_0x24bc3d)}})[_0x5b42('0x11')](function(_0x3c6862){if(_0x3c6862){return _0x3c6862[_0x5b42('0x12')]({'UserId':_0x356180?_0x356180['id']:null});}})[_0x5b42('0x11')](function(_0xc9297f){if(_0xc9297f){log('info',_0x356180,_0x35d79e,_0x1658d3,_0x24bc3d,_0x43a58e);}})[_0x5b42('0x13')](function(){log('error',_0x356180,_0x35d79e,_0x1658d3,_0x24bc3d,_0x43a58e);});}exports[_0x5b42('0x14')]=function(_0x3edc3a,_0x296e75){return function(_0x290693,_0x22dfc2,_0x1c532a){var _0x346544=_0x290693['user'];var _0xf7e2cb={};var _0x2d433c=_0x290693[_0x5b42('0x15')];if(_0xf7e2cb){_0xf7e2cb=_[_0x5b42('0x16')](_0x290693[_0x5b42('0x17')]);_0xf7e2cb=_[_0x5b42('0x18')](_0xf7e2cb,[_0x5b42('0x17'),'html',_0x5b42('0x19'),_0x5b42('0x1a'),_0x5b42('0x1b')]);}updateUser(_0x346544,_0xf7e2cb,_0x2d433c,_0x3edc3a,_0x296e75);_0x1c532a(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index bf1c4b2..ab0f6b3 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 _0x2fce=['isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','License','then','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','admin'];(function(_0x36aae8,_0x3fc00b){var _0x2cada6=function(_0x3ed039){while(--_0x3ed039){_0x36aae8['push'](_0x36aae8['shift']());}};_0x2cada6(++_0x3fc00b);}(_0x2fce,0xd3));var _0xe2fc=function(_0x24ff5b,_0x54d0d0){_0x24ff5b=_0x24ff5b-0x0;var _0x330785=_0x2fce[_0x24ff5b];return _0x330785;};'use strict';var crypto=require(_0xe2fc('0x0'));var util=require(_0xe2fc('0x1'));var compose=require(_0xe2fc('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xe2fc('0x3'));function getValueFromLicense(_0x4df64f,_0x2de9c7){if(_0x4df64f&&_0x2de9c7){if(_0x2de9c7[_0xe2fc('0x4')]&&_0x2de9c7[_0xe2fc('0x5')]){var _0x466b3e=_0x2de9c7[_0xe2fc('0x4')];var _0x770b5a=_0x2de9c7[_0xe2fc('0x5')];var _0x43aa1b=_0x466b3e[_0xe2fc('0x6')]('-')[0x4];var _0x421504=_0x466b3e[_0xe2fc('0x6')]('-')[0x0];var _0xa78555=crypto[_0xe2fc('0x7')](_0xe2fc('0x8'),util[_0xe2fc('0x9')](_0xe2fc('0xa'),_0x43aa1b,_0x466b3e,_0x421504));var _0x3a3995=_0xa78555[_0xe2fc('0xb')](_0x770b5a,'base64',_0xe2fc('0xc'));_0x3a3995+=_0xa78555[_0xe2fc('0xd')](_0xe2fc('0xc'));var _0x4ad68f=JSON[_0xe2fc('0xe')](_0x3a3995);return _0x4ad68f['hasOwnProperty'](_0x4df64f)?_0x4ad68f[_0x4df64f]:null;}}return null;}function isLimit(_0x4b7a18,_0x21343a,_0x5017e4,_0x3a5e18){var _0x2f3676=_0x21343a;return compose()['use'](function(_0x58d832,_0x50a894,_0x2feb6b){return db[_0xe2fc('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe2fc('0x10')](function(_0x27922b){var _0x269d21=getValueFromLicense(_0x4b7a18,_0x27922b);return _0x269d21?_0x269d21:_0x2f3676;})[_0xe2fc('0x10')](function(_0x388481){_0x2f3676=_0x388481;return _0x5017e4['count'](_0x3a5e18);})['then'](function(_0x40c853){if(_0x40c853>=_0x2f3676){return _0x50a894['status'](0x193)['json']({'message':util[_0xe2fc('0x9')](_0xe2fc('0x11'),_0x4b7a18)});}_0x2feb6b();})['catch'](function(_0x3ae857){_0x2feb6b(_0x3ae857);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xe2fc('0x12')],{'where':{'$or':[{'role':_0xe2fc('0x13')},{'role':'user'}]}});}exports[_0xe2fc('0x14')]=isUserLimit; \ No newline at end of file +var _0x1edd=['hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','data1','split','createDecipher','aes-256-ctr','format','update','base64','final','parse'];(function(_0x293b69,_0x2c6725){var _0x2d6f22=function(_0x57081d){while(--_0x57081d){_0x293b69['push'](_0x293b69['shift']());}};_0x2d6f22(++_0x2c6725);}(_0x1edd,0x111));var _0xd1ed=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x1edd[_0x2e2681];return _0x368a64;};'use strict';var crypto=require(_0xd1ed('0x0'));var util=require(_0xd1ed('0x1'));var compose=require(_0xd1ed('0x2'));var db=require(_0xd1ed('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1c25ed,_0x2aab8e){if(_0x1c25ed&&_0x2aab8e){if(_0x2aab8e['data1']&&_0x2aab8e['license']){var _0x401fee=_0x2aab8e[_0xd1ed('0x4')];var _0x332b60=_0x2aab8e['license'];var _0x150321=_0x401fee[_0xd1ed('0x5')]('-')[0x4];var _0x28c144=_0x401fee[_0xd1ed('0x5')]('-')[0x0];var _0x576d0f=crypto[_0xd1ed('0x6')](_0xd1ed('0x7'),util[_0xd1ed('0x8')]('%s:%s:%s',_0x150321,_0x401fee,_0x28c144));var _0x5c8e99=_0x576d0f[_0xd1ed('0x9')](_0x332b60,_0xd1ed('0xa'),'utf8');_0x5c8e99+=_0x576d0f[_0xd1ed('0xb')]('utf8');var _0x102619=JSON[_0xd1ed('0xc')](_0x5c8e99);return _0x102619[_0xd1ed('0xd')](_0x1c25ed)?_0x102619[_0x1c25ed]:null;}}return null;}function isLimit(_0x3fa061,_0x3bb138,_0x519048,_0x363791){var _0x441239=_0x3bb138;return compose()[_0xd1ed('0xe')](function(_0x53fc4e,_0x4dfe70,_0x265a7f){return db[_0xd1ed('0xf')][_0xd1ed('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xd1ed('0x11')](function(_0x50bc0e){var _0x402b14=getValueFromLicense(_0x3fa061,_0x50bc0e);return _0x402b14?_0x402b14:_0x441239;})[_0xd1ed('0x11')](function(_0x27b1d9){_0x441239=_0x27b1d9;return _0x519048[_0xd1ed('0x12')](_0x363791);})[_0xd1ed('0x11')](function(_0x233676){if(_0x233676>=_0x441239){return _0x4dfe70[_0xd1ed('0x13')](0x193)[_0xd1ed('0x14')]({'message':util['format'](_0xd1ed('0x15'),_0x3fa061)});}_0x265a7f();})['catch'](function(_0x3b828d){_0x265a7f(_0x3b828d);});});}function isUserLimit(){return isLimit(_0xd1ed('0x16'),0x1,db[_0xd1ed('0x17')],{'where':{'$or':[{'role':_0xd1ed('0x18')},{'role':_0xd1ed('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 80da18d..9e71b02 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 _0xb541=['>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','$between','pop','DATE','utcOffset','minutes','seconds','format','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','length','split','slice','forEach','shift','indexOf','conditions','push','buildExpression','operator','$eq','value','includes','$lte','add','days','castTo','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?'];(function(_0x33cf33,_0x539eb7){var _0x589476=function(_0x1f3253){while(--_0x1f3253){_0x33cf33['push'](_0x33cf33['shift']());}};_0x589476(++_0x539eb7);}(_0xb541,0x1ae));var _0x1b54=function(_0x808816,_0x35b12b){_0x808816=_0x808816-0x0;var _0x37b215=_0xb541[_0x808816];return _0x37b215;};'use strict';var _=require(_0x1b54('0x0'));var moment=require(_0x1b54('0x1'));exports[_0x1b54('0x2')]=function(_0x1e2282){var _0x5a735f={'conditions':[]};_0x5a735f[_0x1b54('0x3')]=_['startsWith'](_0x1e2282,_0x1b54('0x4'))?'or':_0x1b54('0x5');var _0x5e4c83=_0x1e2282[_0x1b54('0x6')](_0x1b54('0x7'),'')[_0x1b54('0x6')]('[$or]','')['split']('||');for(var _0x552ccd=0x0;_0x552ccd<_0x5e4c83[_0x1b54('0x8')];_0x552ccd++){var _0x29b155=_0x5e4c83[_0x552ccd][_0x1b54('0x9')](':=');var _0x5544fa=_0x29b155[0x0];var _0x4c179b=_0x29b155[_0x1b54('0xa')](0x1);_0x4c179b[_0x1b54('0xb')](function(_0x539b45){var _0x3eda88=_0x539b45['split']('[')[_0x1b54('0xc')]();var _0x3c4e2d=_0x539b45['match'](/\[(.*?)\]/g);_0x3c4e2d[_0x1b54('0xb')](function(_0x3ec523){var _0x42f2f9=_0x3ec523[_0x1b54('0x9')]('[')['filter'](function(_0x52941e){return _0x52941e[_0x1b54('0xd')](']')>-0x1;})['map'](function(_0x3768cb){return _0x3768cb[_0x1b54('0x9')](']')[0x0];})[0x0];_0x5a735f[_0x1b54('0xe')][_0x1b54('0xf')]({'field':_0x5544fa,'operator':_0x3eda88,'value':_0x42f2f9});});});}return _0x5a735f;};exports[_0x1b54('0x10')]=function(_0x4ba698,_0x3de99d,_0x385768){var _0x3a04dd={};if(_0x3de99d==='DATE'){if(_0x385768[_0x1b54('0x11')]===_0x1b54('0x12')){_0x385768[_0x1b54('0x11')]='$between';_0x385768[_0x1b54('0x13')]+=','+_0x385768['value'];}else if(_[_0x1b54('0x14')](['$gt',_0x1b54('0x15')],_0x385768[_0x1b54('0x11')])){_0x385768[_0x1b54('0x13')]=moment(_0x385768[_0x1b54('0x13')])[_0x1b54('0x16')](0x1,_0x1b54('0x17'))['format']('YYYY-MM-DD');}}if(_0x385768[_0x1b54('0x18')]){_0x3de99d=_0x385768[_0x1b54('0x18')];_0x3a04dd[_0x1b54('0x19')]='CAST('+_0x4ba698+'.'+_0x385768['field']+'\x20AS\x20'+_0x385768[_0x1b54('0x18')]+')\x20'+parseOperator(_0x385768[_0x1b54('0x11')]);}else{_0x3a04dd[_0x1b54('0x19')]=_0x4ba698+'.'+_0x385768['field']+'\x20'+parseOperator(_0x385768[_0x1b54('0x11')]);}if(_[_0x1b54('0x14')]([_0x1b54('0x1a'),_0x1b54('0x1b')],_0x385768[_0x1b54('0x11')]))_0x3a04dd[_0x1b54('0x19')]='('+_0x3a04dd[_0x1b54('0x19')]+_0x1b54('0x1c')+_0x4ba698+'.'+_0x385768['field']+_0x1b54('0x1d');_0x3a04dd[_0x1b54('0x13')]=parseValue(_0x3de99d,_0x385768[_0x1b54('0x11')],_0x385768[_0x1b54('0x13')]);return _0x3a04dd;};function parseOperator(_0x512af0){var _0x1dcc1d;switch(_0x512af0){case _0x1b54('0x1e'):_0x1dcc1d='IN\x20?';break;case _0x1b54('0x1b'):_0x1dcc1d=_0x1b54('0x1f');break;case'$eq':_0x1dcc1d=_0x1b54('0x20');break;case _0x1b54('0x1a'):_0x1dcc1d='<>\x20?';break;case _0x1b54('0x21'):case'$startsWith':case _0x1b54('0x22'):_0x1dcc1d=_0x1b54('0x23');break;case _0x1b54('0x24'):_0x1dcc1d=_0x1b54('0x25');break;case'$gt':_0x1dcc1d=_0x1b54('0x26');break;case _0x1b54('0x15'):_0x1dcc1d=_0x1b54('0x27');break;case _0x1b54('0x28'):_0x1dcc1d=_0x1b54('0x29');break;case'$between':_0x1dcc1d=_0x1b54('0x2a');break;}return _0x1dcc1d;}function parseValue(_0x22497c,_0x5e1410,_0x15723c){var _0x34e114={'start':undefined,'end':undefined};switch(_0x5e1410){case _0x1b54('0x1e'):case _0x1b54('0x1b'):_0x34e114[_0x1b54('0x2b')]=_0x15723c[_0x1b54('0x9')](',');break;case _0x1b54('0x21'):_0x34e114['start']='%'+_0x15723c+'%';break;case _0x1b54('0x2c'):_0x34e114['start']=_0x15723c+'%';break;case _0x1b54('0x22'):_0x34e114[_0x1b54('0x2b')]='%'+_0x15723c;break;case _0x1b54('0x2d'):var _0x3e98da=_0x15723c[_0x1b54('0x9')](',');var _0x15723c=_0x3e98da['shift']();var _0x20a9d1=_0x3e98da[_0x1b54('0x2e')]();if(_0x22497c===_0x1b54('0x2f')){_0x15723c=moment(_0x15723c)[_0x1b54('0x30')](0x0,!![])['format']();_0x20a9d1=moment(_0x20a9d1)[_0x1b54('0x30')](0x0,!![])[_0x1b54('0x16')](0x17,'hours')[_0x1b54('0x16')](0x3b,_0x1b54('0x31'))[_0x1b54('0x16')](0x3b,_0x1b54('0x32'))[_0x1b54('0x33')]();}_0x34e114={'start':_0x15723c,'end':_0x20a9d1};break;default:_0x34e114[_0x1b54('0x2b')]=_0x15723c;break;}return _0x34e114;} \ No newline at end of file +var _0x3909=['shift','match','forEach','filter','indexOf','map','conditions','push','operator','$eq','$between','value','includes','$gt','$lte','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$in','IN\x20?','$notIn','<>\x20?','$substring','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','DATE','utcOffset','format','hours','minutes','seconds','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','length','split','slice'];(function(_0x58cb06,_0x172008){var _0x400970=function(_0x2b312b){while(--_0x2b312b){_0x58cb06['push'](_0x58cb06['shift']());}};_0x400970(++_0x172008);}(_0x3909,0xd2));var _0x9390=function(_0x558099,_0x4be744){_0x558099=_0x558099-0x0;var _0x18ac2e=_0x3909[_0x558099];return _0x18ac2e;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x9390('0x0')]=function(_0x3505d7){var _0x14266a={'conditions':[]};_0x14266a[_0x9390('0x1')]=_[_0x9390('0x2')](_0x3505d7,_0x9390('0x3'))?'or':_0x9390('0x4');var _0x369ec9=_0x3505d7[_0x9390('0x5')](_0x9390('0x6'),'')['replace'](_0x9390('0x3'),'')['split']('||');for(var _0x35c060=0x0;_0x35c060<_0x369ec9[_0x9390('0x7')];_0x35c060++){var _0x125e65=_0x369ec9[_0x35c060][_0x9390('0x8')](':=');var _0xd6ae0c=_0x125e65[0x0];var _0x2b2f34=_0x125e65[_0x9390('0x9')](0x1);_0x2b2f34['forEach'](function(_0x38f1cc){var _0x2510f9=_0x38f1cc['split']('[')[_0x9390('0xa')]();var _0x5dca62=_0x38f1cc[_0x9390('0xb')](/\[(.*?)\]/g);_0x5dca62[_0x9390('0xc')](function(_0x4acad7){var _0x2de575=_0x4acad7['split']('[')[_0x9390('0xd')](function(_0x318423){return _0x318423[_0x9390('0xe')](']')>-0x1;})[_0x9390('0xf')](function(_0x154e0d){return _0x154e0d[_0x9390('0x8')](']')[0x0];})[0x0];_0x14266a[_0x9390('0x10')][_0x9390('0x11')]({'field':_0xd6ae0c,'operator':_0x2510f9,'value':_0x2de575});});});}return _0x14266a;};exports['buildExpression']=function(_0x31e55c,_0x3f0228,_0x9cea3f){var _0x15b682={};if(_0x3f0228==='DATE'){if(_0x9cea3f[_0x9390('0x12')]===_0x9390('0x13')){_0x9cea3f[_0x9390('0x12')]=_0x9390('0x14');_0x9cea3f[_0x9390('0x15')]+=','+_0x9cea3f[_0x9390('0x15')];}else if(_[_0x9390('0x16')]([_0x9390('0x17'),_0x9390('0x18')],_0x9cea3f[_0x9390('0x12')])){_0x9cea3f[_0x9390('0x15')]=moment(_0x9cea3f[_0x9390('0x15')])[_0x9390('0x19')](0x1,_0x9390('0x1a'))['format'](_0x9390('0x1b'));}}if(_0x9cea3f[_0x9390('0x1c')]){_0x3f0228=_0x9cea3f['castTo'];_0x15b682[_0x9390('0x1d')]=_0x9390('0x1e')+_0x31e55c+'.'+_0x9cea3f[_0x9390('0x1f')]+_0x9390('0x20')+_0x9cea3f[_0x9390('0x1c')]+')\x20'+parseOperator(_0x9cea3f[_0x9390('0x12')]);}else{_0x15b682[_0x9390('0x1d')]=_0x31e55c+'.'+_0x9cea3f['field']+'\x20'+parseOperator(_0x9cea3f['operator']);}if(_[_0x9390('0x16')]([_0x9390('0x21'),'$notIn'],_0x9cea3f['operator']))_0x15b682[_0x9390('0x1d')]='('+_0x15b682['text']+'\x20OR\x20'+_0x31e55c+'.'+_0x9cea3f[_0x9390('0x1f')]+'\x20IS\x20NULL)';_0x15b682[_0x9390('0x15')]=parseValue(_0x3f0228,_0x9cea3f['operator'],_0x9cea3f[_0x9390('0x15')]);return _0x15b682;};function parseOperator(_0x4244f4){var _0x2d9e32;switch(_0x4244f4){case _0x9390('0x22'):_0x2d9e32=_0x9390('0x23');break;case _0x9390('0x24'):_0x2d9e32='NOT\x20IN\x20?';break;case _0x9390('0x13'):_0x2d9e32='=\x20?';break;case _0x9390('0x21'):_0x2d9e32=_0x9390('0x25');break;case _0x9390('0x26'):case'$startsWith':case'$endsWith':_0x2d9e32=_0x9390('0x27');break;case _0x9390('0x28'):_0x2d9e32=_0x9390('0x29');break;case _0x9390('0x17'):_0x2d9e32=_0x9390('0x2a');break;case'$lte':_0x2d9e32=_0x9390('0x2b');break;case'$gte':_0x2d9e32=_0x9390('0x2c');break;case _0x9390('0x14'):_0x2d9e32=_0x9390('0x2d');break;}return _0x2d9e32;}function parseValue(_0x316806,_0x24a0f1,_0x23f997){var _0x5257e0={'start':undefined,'end':undefined};switch(_0x24a0f1){case _0x9390('0x22'):case _0x9390('0x24'):_0x5257e0[_0x9390('0x2e')]=_0x23f997[_0x9390('0x8')](',');break;case'$substring':_0x5257e0[_0x9390('0x2e')]='%'+_0x23f997+'%';break;case _0x9390('0x2f'):_0x5257e0[_0x9390('0x2e')]=_0x23f997+'%';break;case'$endsWith':_0x5257e0[_0x9390('0x2e')]='%'+_0x23f997;break;case _0x9390('0x14'):var _0x57ed48=_0x23f997['split'](',');var _0x23f997=_0x57ed48['shift']();var _0x568a65=_0x57ed48[_0x9390('0x30')]();if(_0x316806===_0x9390('0x31')){_0x23f997=moment(_0x23f997)[_0x9390('0x32')](0x0,!![])[_0x9390('0x33')]();_0x568a65=moment(_0x568a65)[_0x9390('0x32')](0x0,!![])[_0x9390('0x19')](0x17,_0x9390('0x34'))[_0x9390('0x19')](0x3b,_0x9390('0x35'))[_0x9390('0x19')](0x3b,_0x9390('0x36'))[_0x9390('0x33')]();}_0x5257e0={'start':_0x23f997,'end':_0x568a65};break;default:_0x5257e0[_0x9390('0x2e')]=_0x23f997;break;}return _0x5257e0;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index f01c1a6..6c61ac9 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 _0xf2ca=['isArray','split','limit','offset','sort','map','indexOf','priority','cast','unsigned','substr','col','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','attributes','nolimit','order','where','pick','filter','object','value','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid'];(function(_0x469ae2,_0x24cd30){var _0x5e33e4=function(_0x1aaeb1){while(--_0x1aaeb1){_0x469ae2['push'](_0x469ae2['shift']());}};_0x5e33e4(++_0x24cd30);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0xf2ca[_0x1de43c];return _0x296d3e;};'use strict';var _=require(_0xaf2c('0x0'));var sequelize=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x598667){var _0xbb7f52=['ne'];try{var _0x2102e2=JSON[_0xaf2c('0x3')](_0x598667);var _0x219511=Object[_0xaf2c('0x4')](_0x2102e2)[0x0];return _0xbb7f52[_0xaf2c('0x5')](_0x219511);}catch(_0x5b8c81){return![];}}function getOperatorValue(_0x1fd101){var _0x100d17=JSON[_0xaf2c('0x3')](_0x1fd101);var _0x1f9531=Object['keys'](_0x100d17)[0x0];var _0x37fedd=_0x100d17[_0x1f9531];return{['$'+_0x1f9531]:_0x37fedd};}exports[_0xaf2c('0x6')]=function(_0x4a7397){var _0x2a011d=null;if(_0x4a7397){_0x2a011d=_0x4a7397['split'](',');}return _0x2a011d;};exports[_0xaf2c('0x7')]=function(_0x4a0064,_0x2f5099){var _0x144a7a={};if(!_[_0xaf2c('0x8')](_0x4a0064)){_[_0xaf2c('0x9')](_0x4a0064,function(_0x5ad9b0,_0x4adc8c){try{if(_0x2f5099){var _0x2c0d88=_[_0xaf2c('0xa')](_0x2f5099,{'name':_0x4adc8c})||{};if(hasSequelizeOperator(_0x5ad9b0)){_0x144a7a[_0x4adc8c]=getOperatorValue(_0x5ad9b0);}else if(_0x2c0d88[_0xaf2c('0xb')]===_0xaf2c('0xc')&&_[_0xaf2c('0xd')](_0x5ad9b0)){var _0x59a59b=JSON['parse'](_0x5ad9b0);var _0x15ccb4={'$gte':moment(moment(_0x59a59b[_0xaf2c('0xe')])[_0xaf2c('0xf')](_0xaf2c('0x10')))[_0xaf2c('0x11')]()[_0xaf2c('0xf')](),'$lte':moment(moment(_0x59a59b[_0xaf2c('0x12')])[_0xaf2c('0xf')](_0xaf2c('0x10')))[_0xaf2c('0x11')]()[_0xaf2c('0x13')](0x1,'s')[_0xaf2c('0xf')]()};_0x144a7a[_0x4adc8c]=_0x15ccb4;}else if(_0x2c0d88[_0xaf2c('0x14')]===_0xaf2c('0x15')){_0x144a7a[_0x4adc8c]=_0x5ad9b0;}else{_0x144a7a[_0x4adc8c]=_[_0xaf2c('0x16')](_0x5ad9b0)?_0x5ad9b0:JSON['parse'](_0x5ad9b0);}}else{_0x144a7a[_0x4adc8c]=_[_0xaf2c('0x16')](_0x5ad9b0)?_0x5ad9b0:JSON['parse'](_0x5ad9b0);}}catch(_0x278a28){_0x144a7a[_0x4adc8c]=_0x5ad9b0[_0xaf2c('0x17')](',');}});}return _0x144a7a;};exports[_0xaf2c('0x18')]=function(_0x578492){_0x578492=parseInt(_0x578492,0xa);if(!_0x578492||_0x578492<0x0){_0x578492=LIMIT_VALUE;}return _0x578492;};exports[_0xaf2c('0x19')]=function(_0x297bcd){_0x297bcd=parseInt(_0x297bcd,0xa);if(!_0x297bcd||_0x297bcd<0x0){_0x297bcd=0x0;}return _0x297bcd;};exports[_0xaf2c('0x1a')]=function(_0x20000b){var _0x3f977c,_0x1b7f07=null;if(_0x20000b){_0x3f977c=_0x20000b['split'](',');_0x1b7f07=_[_0xaf2c('0x1b')](_0x3f977c,function(_0x164bcb){if(_0x164bcb[_0xaf2c('0x1c')]('-')===0x0){return[_0x164bcb===_0xaf2c('0x1d')?sequelize[_0xaf2c('0x1e')](sequelize['col'](_0xaf2c('0x1d')),_0xaf2c('0x1f')):_0x164bcb[_0xaf2c('0x20')](0x1),'DESC'];}else{return[_0x164bcb==='priority'?sequelize[_0xaf2c('0x1e')](sequelize[_0xaf2c('0x21')](_0xaf2c('0x1d')),_0xaf2c('0x1f')):_0x164bcb,'ASC'];}});}return _0x1b7f07;};exports[_0xaf2c('0x22')]=function(_0xf1a7cf,_0x3a0145){if(_[_0xaf2c('0x8')](_0xf1a7cf)){return _0xf1a7cf;}if(_[_0xaf2c('0x16')](_0xf1a7cf)){for(var _0xff396f=0x0;_0xff396f<_0xf1a7cf[_0xaf2c('0x23')];_0xff396f+=0x1){_0xf1a7cf[_0xff396f]=this['omit'](_0xf1a7cf[_0xff396f],_0x3a0145);}return _0xf1a7cf;}if(!_[_0xaf2c('0x24')](_0xf1a7cf)){return _0xf1a7cf;}if(_[_0xaf2c('0x25')](_0x3a0145)){_0x3a0145=[_0x3a0145];}if(!_[_0xaf2c('0x16')](_0x3a0145)){return _0xf1a7cf;}for(var _0x410536=0x0;_0x410536<_0x3a0145['length'];_0x410536+=0x1){_[_0xaf2c('0x26')](_0xf1a7cf,_0x3a0145[_0x410536]);}for(var _0x589d47 in _0xf1a7cf){if(_0xf1a7cf[_0xaf2c('0x27')](_0x589d47)){_0xf1a7cf[_0x589d47]=this[_0xaf2c('0x22')](_0xf1a7cf[_0x589d47],_0x3a0145);}}return _0xf1a7cf;};exports[_0xaf2c('0x28')]=function(_0x5d685a){return _0x5d685a[_0xaf2c('0x29')](RegExp(_0xaf2c('0x2a')))?!![]:![];};exports[_0xaf2c('0x2b')]=function(_0x4a96d2){return _0x4a96d2[_0xaf2c('0x29')](/^\S+@\S+$/)?!![]:![];};exports[_0xaf2c('0x2c')]=function(_0x42e2a5){var _0x19364e=[];_0x42e2a5['split'](/[ ,]+/)[_0xaf2c('0x2d')](function(_0x4072ff){_0x4072ff=_0x4072ff[_0xaf2c('0x2e')](/([^:]")"+/g,'$1');_0x4072ff='+'+_0x4072ff+'*';var _0x51a49c=/[ `!@#$%^&*()_\-?~]/;if(_0x4072ff['match'](_0x51a49c))_0x4072ff='\x22'+_0x4072ff+'\x22';_0x19364e[_0xaf2c('0x2f')](_0x4072ff);});return _0x19364e['join']('\x20');};exports[_0xaf2c('0x30')]=function(_0x5e7247,_0x337cea,_0x1e4de2){var _0x4ffbb9={},_0x1408e3={};if(_0x337cea[_0xaf2c('0x31')]['$id']){_0x337cea[_0xaf2c('0x31')]['id']=_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x32')];delete _0x337cea[_0xaf2c('0x31')][_0xaf2c('0x32')];}_0x4ffbb9[_0xaf2c('0x33')]=_['map'](_0x5e7247,_0xaf2c('0x14'));_0x4ffbb9['query']=_[_0xaf2c('0x4')](_0x337cea['query']);_0x4ffbb9[_0xaf2c('0x7')]=_['intersection'](_0x4ffbb9[_0xaf2c('0x33')],_0x4ffbb9['query']);_0x1408e3[_0xaf2c('0x34')]=_['intersection'](_0x4ffbb9[_0xaf2c('0x33')],this[_0xaf2c('0x6')](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x6')]));_0x1408e3[_0xaf2c('0x34')]=_0x1408e3['attributes']['length']?_0x1408e3[_0xaf2c('0x34')]:_0x4ffbb9[_0xaf2c('0x33')];if(!_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x27')](_0xaf2c('0x35'))){_0x1408e3[_0xaf2c('0x18')]=this['limit'](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x18')]);_0x1408e3['offset']=this[_0xaf2c('0x19')](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x19')]);}_0x1408e3[_0xaf2c('0x36')]=this[_0xaf2c('0x1a')](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x1a')]);_0x1408e3[_0xaf2c('0x37')]=this[_0xaf2c('0x7')](_[_0xaf2c('0x38')](_0x337cea[_0xaf2c('0x31')],_0x4ffbb9[_0xaf2c('0x7')]),_0x5e7247);if(_0x337cea[_0xaf2c('0x31')]['filter']){var _0x54a953=_0x5e7247;var _0x4db7d0=_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x39')];if(typeof _0x4db7d0===_0xaf2c('0x3a')){_0x54a953=_[_0xaf2c('0x39')](_0x5e7247,function(_0x715f39){return _[_0xaf2c('0x5')](_0x4db7d0['columns'],_0x715f39[_0xaf2c('0x14')]);});_0x4db7d0=_0x4db7d0[_0xaf2c('0x3b')];}_0x1408e3[_0xaf2c('0x37')]=_['merge'](_0x1408e3['where'],{'$or':_[_0xaf2c('0x1b')](_0x54a953,function(_0x4f8440){if(_0x4f8440[_0xaf2c('0xb')]!==_0xaf2c('0x3c')){if(_0x1e4de2){return sequelize[_0xaf2c('0x37')](sequelize['fn'](_0xaf2c('0x3d'),sequelize['col'](_0x4f8440[_0xaf2c('0x14')])),{'$like':sequelize['fn']('lower','%'+_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x39')]+'%')});}else{var _0x58bd9b={};_0x58bd9b[_0x4f8440[_0xaf2c('0x14')]]={'$like':'%'+_0x337cea['query'][_0xaf2c('0x39')]+'%'};return _0x58bd9b;}}})});}_0x1408e3=_[_0xaf2c('0x3e')]({},_0x1408e3,_0x337cea[_0xaf2c('0x3f')]);return _0x1408e3;}; \ No newline at end of file +var _0x0bde=['pick','filter','columns','where','lower','merge','options','sequelize','parse','includes','keys','fields','split','filters','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','map','indexOf','cast','col','priority','substr','unsigned','ASC','omit','isEmpty','isObject','length','unset','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','order','sort'];(function(_0x25c510,_0x5c5bc8){var _0x7c812c=function(_0x4b96de){while(--_0x4b96de){_0x25c510['push'](_0x25c510['shift']());}};_0x7c812c(++_0x5c5bc8);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var sequelize=require(_0xe0bd('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3fb344){var _0x3dc984=['ne'];try{var _0x1d8922=JSON[_0xe0bd('0x1')](_0x3fb344);var _0x2da4bd=Object['keys'](_0x1d8922)[0x0];return _0x3dc984[_0xe0bd('0x2')](_0x2da4bd);}catch(_0x124139){return![];}}function getOperatorValue(_0x2b9812){var _0x3b712a=JSON[_0xe0bd('0x1')](_0x2b9812);var _0x26393f=Object[_0xe0bd('0x3')](_0x3b712a)[0x0];var _0x491dc7=_0x3b712a[_0x26393f];return{['$'+_0x26393f]:_0x491dc7};}exports[_0xe0bd('0x4')]=function(_0x44cb0b){var _0xb17265=null;if(_0x44cb0b){_0xb17265=_0x44cb0b[_0xe0bd('0x5')](',');}return _0xb17265;};exports[_0xe0bd('0x6')]=function(_0x3c47c4,_0x475265){var _0x58d892={};if(!_['isEmpty'](_0x3c47c4)){_['forOwn'](_0x3c47c4,function(_0x47f96d,_0x44ffa9){try{if(_0x475265){var _0x5e2a24=_['find'](_0x475265,{'name':_0x44ffa9})||{};if(hasSequelizeOperator(_0x47f96d)){_0x58d892[_0x44ffa9]=getOperatorValue(_0x47f96d);}else if(_0x5e2a24[_0xe0bd('0x7')]===_0xe0bd('0x8')&&_['isPlainObject'](_0x47f96d)){var _0xc492b4=JSON['parse'](_0x47f96d);var _0x1bf268={'$gte':moment(moment(_0xc492b4[_0xe0bd('0x9')])[_0xe0bd('0xa')](_0xe0bd('0xb')))[_0xe0bd('0xc')]()[_0xe0bd('0xa')](),'$lte':moment(moment(_0xc492b4[_0xe0bd('0xd')])[_0xe0bd('0xa')]('YYYY-MM-DD'))['utc']()['subtract'](0x1,'s')[_0xe0bd('0xa')]()};_0x58d892[_0x44ffa9]=_0x1bf268;}else if(_0x5e2a24[_0xe0bd('0xe')]===_0xe0bd('0xf')){_0x58d892[_0x44ffa9]=_0x47f96d;}else{_0x58d892[_0x44ffa9]=_[_0xe0bd('0x10')](_0x47f96d)?_0x47f96d:JSON[_0xe0bd('0x1')](_0x47f96d);}}else{_0x58d892[_0x44ffa9]=_['isArray'](_0x47f96d)?_0x47f96d:JSON['parse'](_0x47f96d);}}catch(_0x1becc8){_0x58d892[_0x44ffa9]=_0x47f96d['split'](',');}});}return _0x58d892;};exports[_0xe0bd('0x11')]=function(_0x418d64){_0x418d64=parseInt(_0x418d64,0xa);if(!_0x418d64||_0x418d64<0x0){_0x418d64=LIMIT_VALUE;}return _0x418d64;};exports[_0xe0bd('0x12')]=function(_0x20157b){_0x20157b=parseInt(_0x20157b,0xa);if(!_0x20157b||_0x20157b<0x0){_0x20157b=0x0;}return _0x20157b;};exports['sort']=function(_0x1311b1){var _0xe1d808,_0x2b9f93=null;if(_0x1311b1){_0xe1d808=_0x1311b1['split'](',');_0x2b9f93=_[_0xe0bd('0x13')](_0xe1d808,function(_0x25f595){if(_0x25f595[_0xe0bd('0x14')]('-')===0x0){return[_0x25f595==='priority'?sequelize[_0xe0bd('0x15')](sequelize[_0xe0bd('0x16')](_0xe0bd('0x17')),'unsigned'):_0x25f595[_0xe0bd('0x18')](0x1),'DESC'];}else{return[_0x25f595===_0xe0bd('0x17')?sequelize[_0xe0bd('0x15')](sequelize['col'](_0xe0bd('0x17')),_0xe0bd('0x19')):_0x25f595,_0xe0bd('0x1a')];}});}return _0x2b9f93;};exports[_0xe0bd('0x1b')]=function(_0x2a1f92,_0x30e9d3){if(_[_0xe0bd('0x1c')](_0x2a1f92)){return _0x2a1f92;}if(_[_0xe0bd('0x10')](_0x2a1f92)){for(var _0x537708=0x0;_0x537708<_0x2a1f92['length'];_0x537708+=0x1){_0x2a1f92[_0x537708]=this[_0xe0bd('0x1b')](_0x2a1f92[_0x537708],_0x30e9d3);}return _0x2a1f92;}if(!_[_0xe0bd('0x1d')](_0x2a1f92)){return _0x2a1f92;}if(_['isString'](_0x30e9d3)){_0x30e9d3=[_0x30e9d3];}if(!_['isArray'](_0x30e9d3)){return _0x2a1f92;}for(var _0x3bac51=0x0;_0x3bac51<_0x30e9d3[_0xe0bd('0x1e')];_0x3bac51+=0x1){_[_0xe0bd('0x1f')](_0x2a1f92,_0x30e9d3[_0x3bac51]);}for(var _0x1b5861 in _0x2a1f92){if(_0x2a1f92['hasOwnProperty'](_0x1b5861)){_0x2a1f92[_0x1b5861]=this[_0xe0bd('0x1b')](_0x2a1f92[_0x1b5861],_0x30e9d3);}}return _0x2a1f92;};exports['isNumeric']=function(_0x9146fe){return _0x9146fe[_0xe0bd('0x20')](RegExp(_0xe0bd('0x21')))?!![]:![];};exports[_0xe0bd('0x22')]=function(_0x1e2020){return _0x1e2020[_0xe0bd('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0xe0bd('0x23')]=function(_0x2d31e9){var _0x25d515=[];_0x2d31e9[_0xe0bd('0x5')](/[ ,]+/)[_0xe0bd('0x24')](function(_0x12d506){_0x12d506=_0x12d506[_0xe0bd('0x25')](/([^:]")"+/g,'$1');_0x12d506='+'+_0x12d506+'*';var _0x56f310=/[ `!@#$%^&*()_\-?~]/;if(_0x12d506[_0xe0bd('0x20')](_0x56f310))_0x12d506='\x22'+_0x12d506+'\x22';_0x25d515[_0xe0bd('0x26')](_0x12d506);});return _0x25d515[_0xe0bd('0x27')]('\x20');};exports[_0xe0bd('0x28')]=function(_0x8c9de3,_0x380c13,_0x56b770){var _0x507c7a={},_0x35019d={};if(_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x2a')]){_0x380c13[_0xe0bd('0x29')]['id']=_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x2a')];delete _0x380c13[_0xe0bd('0x29')]['$id'];}_0x507c7a[_0xe0bd('0x2b')]=_[_0xe0bd('0x13')](_0x8c9de3,_0xe0bd('0xe'));_0x507c7a[_0xe0bd('0x29')]=_[_0xe0bd('0x3')](_0x380c13[_0xe0bd('0x29')]);_0x507c7a['filters']=_[_0xe0bd('0x2c')](_0x507c7a[_0xe0bd('0x2b')],_0x507c7a[_0xe0bd('0x29')]);_0x35019d[_0xe0bd('0x2d')]=_[_0xe0bd('0x2c')](_0x507c7a['model'],this['fields'](_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x4')]));_0x35019d[_0xe0bd('0x2d')]=_0x35019d['attributes'][_0xe0bd('0x1e')]?_0x35019d['attributes']:_0x507c7a['model'];if(!_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x2e')]('nolimit')){_0x35019d['limit']=this['limit'](_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x11')]);_0x35019d[_0xe0bd('0x12')]=this['offset'](_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x12')]);}_0x35019d[_0xe0bd('0x2f')]=this['sort'](_0x380c13['query'][_0xe0bd('0x30')]);_0x35019d['where']=this[_0xe0bd('0x6')](_[_0xe0bd('0x31')](_0x380c13['query'],_0x507c7a[_0xe0bd('0x6')]),_0x8c9de3);if(_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x32')]){var _0xb65059=_0x8c9de3;var _0x2a7782=_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x32')];if(typeof _0x2a7782==='object'){_0xb65059=_[_0xe0bd('0x32')](_0x8c9de3,function(_0x39b832){return _[_0xe0bd('0x2')](_0x2a7782[_0xe0bd('0x33')],_0x39b832[_0xe0bd('0xe')]);});_0x2a7782=_0x2a7782['value'];}_0x35019d['where']=_['merge'](_0x35019d[_0xe0bd('0x34')],{'$or':_[_0xe0bd('0x13')](_0xb65059,function(_0x15de49){if(_0x15de49[_0xe0bd('0x7')]!=='VIRTUAL'){if(_0x56b770){return sequelize['where'](sequelize['fn'](_0xe0bd('0x35'),sequelize[_0xe0bd('0x16')](_0x15de49[_0xe0bd('0xe')])),{'$like':sequelize['fn'](_0xe0bd('0x35'),'%'+_0x380c13[_0xe0bd('0x29')][_0xe0bd('0x32')]+'%')});}else{var _0x3d218d={};_0x3d218d[_0x15de49['name']]={'$like':'%'+_0x380c13[_0xe0bd('0x29')]['filter']+'%'};return _0x3d218d;}}})});}_0x35019d=_[_0xe0bd('0x36')]({},_0x35019d,_0x380c13[_0xe0bd('0x37')]);return _0x35019d;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6330f0d..9416acd 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2205=['toISOString','split','static','get','views','/server/views','engine','ejs','renderFile','html','urlencoded','json','50mb','initialize','body-parser','method-override','errorhandler','path','passport','cors','env','set','appPath','join','root','public','development','test','use','json\x20replacer'];(function(_0x3df341,_0x589786){var _0x301209=function(_0x363f1d){while(--_0x363f1d){_0x3df341['push'](_0x3df341['shift']());}};_0x301209(++_0x589786);}(_0x2205,0x176));var _0x5220=function(_0x5db09d,_0x303fbf){_0x5db09d=_0x5db09d-0x0;var _0x51ed3a=_0x2205[_0x5db09d];return _0x51ed3a;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x5220('0x0'));var methodOverride=require(_0x5220('0x1'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x5220('0x2'));var path=require(_0x5220('0x3'));var passport=require(_0x5220('0x4'));var cors=require(_0x5220('0x5'));var moment=require('moment');var config=require('./environment');var db=require('../mysqldb')['db'];exports['default']=function(_0x10829a){var _0x5a8f41=_0x10829a['get'](_0x5220('0x6'));if(_0x5a8f41==='production'){_0x10829a[_0x5220('0x7')](_0x5220('0x8'),path[_0x5220('0x9')](config[_0x5220('0xa')],_0x5220('0xb')));}if(_0x5a8f41===_0x5220('0xc')||_0x5a8f41===_0x5220('0xd')){_0x10829a['set']('appPath',path[_0x5220('0x9')](config[_0x5220('0xa')],'client'));_0x10829a[_0x5220('0xe')](errorHandler());}_0x10829a[_0x5220('0x7')](_0x5220('0xf'),function(_0x193d26,_0x18430b){if(this[_0x193d26]instanceof Date){_0x18430b=this[_0x193d26][_0x5220('0x10')]()[_0x5220('0x11')]('.')[0x0]+'Z';}return _0x18430b;});_0x10829a[_0x5220('0xe')](express[_0x5220('0x12')](_0x10829a[_0x5220('0x13')](_0x5220('0x8'))));_0x10829a[_0x5220('0x7')](_0x5220('0x14'),config[_0x5220('0xa')]+_0x5220('0x15'));_0x10829a[_0x5220('0x16')]('html',require(_0x5220('0x17'))[_0x5220('0x18')]);_0x10829a['set']('view\x20engine',_0x5220('0x19'));_0x10829a[_0x5220('0xe')](bodyParser[_0x5220('0x1a')]({'limit':'50mb','extended':!![]}));_0x10829a[_0x5220('0xe')](bodyParser[_0x5220('0x1b')]({'limit':_0x5220('0x1c')}));_0x10829a[_0x5220('0xe')](cors());_0x10829a[_0x5220('0xe')](methodOverride());_0x10829a[_0x5220('0xe')](cookieParser());_0x10829a[_0x5220('0xe')](passport[_0x5220('0x1d')]());}; \ No newline at end of file +var _0xf815=['default','get','env','production','appPath','join','root','public','development','test','set','client','json\x20replacer','toISOString','split','use','engine','html','ejs','urlencoded','50mb','json','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','../mysqldb'];(function(_0x1e8ff5,_0x5c1a95){var _0x4513bb=function(_0x362fe3){while(--_0x362fe3){_0x1e8ff5['push'](_0x1e8ff5['shift']());}};_0x4513bb(++_0x5c1a95);}(_0xf815,0x1d8));var _0x5f81=function(_0x469e57,_0x45b860){_0x469e57=_0x469e57-0x0;var _0x5de368=_0xf815[_0x469e57];return _0x5de368;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0x5f81('0x0'));var cookieParser=require(_0x5f81('0x1'));var errorHandler=require(_0x5f81('0x2'));var path=require(_0x5f81('0x3'));var passport=require(_0x5f81('0x4'));var cors=require(_0x5f81('0x5'));var moment=require('moment');var config=require(_0x5f81('0x6'));var db=require(_0x5f81('0x7'))['db'];exports[_0x5f81('0x8')]=function(_0xe3b0){var _0xb3e49b=_0xe3b0[_0x5f81('0x9')](_0x5f81('0xa'));if(_0xb3e49b===_0x5f81('0xb')){_0xe3b0['set'](_0x5f81('0xc'),path[_0x5f81('0xd')](config[_0x5f81('0xe')],_0x5f81('0xf')));}if(_0xb3e49b===_0x5f81('0x10')||_0xb3e49b===_0x5f81('0x11')){_0xe3b0[_0x5f81('0x12')](_0x5f81('0xc'),path[_0x5f81('0xd')](config[_0x5f81('0xe')],_0x5f81('0x13')));_0xe3b0['use'](errorHandler());}_0xe3b0[_0x5f81('0x12')](_0x5f81('0x14'),function(_0x579697,_0x2c3bca){if(this[_0x579697]instanceof Date){_0x2c3bca=this[_0x579697][_0x5f81('0x15')]()[_0x5f81('0x16')]('.')[0x0]+'Z';}return _0x2c3bca;});_0xe3b0[_0x5f81('0x17')](express['static'](_0xe3b0[_0x5f81('0x9')]('appPath')));_0xe3b0[_0x5f81('0x12')]('views',config[_0x5f81('0xe')]+'/server/views');_0xe3b0[_0x5f81('0x18')](_0x5f81('0x19'),require(_0x5f81('0x1a'))['renderFile']);_0xe3b0[_0x5f81('0x12')]('view\x20engine','html');_0xe3b0['use'](bodyParser[_0x5f81('0x1b')]({'limit':_0x5f81('0x1c'),'extended':!![]}));_0xe3b0['use'](bodyParser[_0x5f81('0x1d')]({'limit':_0x5f81('0x1c')}));_0xe3b0['use'](cors());_0xe3b0['use'](methodOverride());_0xe3b0[_0x5f81('0x17')](cookieParser());_0xe3b0[_0x5f81('0x17')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index a39540c..372c811 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 _0x85df=['bimedia-machine-uuid','child_process','../environment','keys','length','filter','concat','head','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','substring','lodash','crypto'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x85df,0x13e));var _0xf85d=function(_0x54b975,_0x78c433){_0x54b975=_0x54b975-0x0;var _0x264109=_0x85df[_0x54b975];return _0x264109;};'use strict';var _=require(_0xf85d('0x0'));var os=require('os');var crypto=require(_0xf85d('0x1'));var machine=require(_0xf85d('0x2'));var exec=require(_0xf85d('0x3'))['execSync'];var config=require(_0xf85d('0x4'));function getInterfaces(){var _0x3b48f1=[];var _0x54ff0a=os['networkInterfaces']();var _0x552fe1=_['orderBy'](_[_0xf85d('0x5')](_0x54ff0a));for(var _0x3c1a2f=0x0;_0x3c1a2f<_0x552fe1[_0xf85d('0x6')];_0x3c1a2f++){var _0x30271e=_0x54ff0a[_0x552fe1[_0x3c1a2f]][_0xf85d('0x7')](function(_0x3de345){return _0x3de345['family']==='IPv4'&&_0x3de345['internal']===![];});_0x3b48f1=_0x3b48f1[_0xf85d('0x8')](_0x30271e);}return _0x3b48f1;}function getFirstInterface(){var _0x481005=_[_0xf85d('0x9')](getInterfaces());return{'macAddress':_0x481005&&_0x481005['mac']?_0x481005['mac']:_0xf85d('0xa'),'ipAddress':_0x481005&&_0x481005['address']?_0x481005[_0xf85d('0xb')]:'127.0.0.1'};}exports[_0xf85d('0xc')]=getFirstInterface;function getCPUhash(){var _0xa62a8d=_[_0xf85d('0xd')](os[_0xf85d('0xe')]()[_0xf85d('0xf')](function(_0x4c165c){return _0x4c165c['model'];}))[_0xf85d('0x10')](':');return crypto[_0xf85d('0x11')](_0xf85d('0x12'))[_0xf85d('0x13')](_0xa62a8d)[_0xf85d('0x14')](_0xf85d('0x15'));}exports[_0xf85d('0x16')]=function(){var _0x5e9e5e=os[_0xf85d('0x17')]();var _0x34556c=/[0-9a-f-]{36}/;if(config[_0xf85d('0x18')]&&_0x34556c[_0xf85d('0x19')](config[_0xf85d('0x18')])){return config[_0xf85d('0x18')];}else if(_0x5e9e5e===_0xf85d('0x1a')){return exec(_0xf85d('0x1b'),{'encoding':_0xf85d('0x1c')})[_0xf85d('0x1d')]('\x0d\x0a','');}else{var _0xeb6ac5=getFirstInterface();var _0x37c714=getCPUhash();var _0x23263b=_0x37c714+'|'+os[_0xf85d('0x1e')]()+'|'+_0xeb6ac5['macAddress']+'|'+_0xeb6ac5['ipAddress'];var _0x2ff3dc=crypto[_0xf85d('0x11')](_0xf85d('0x12'))[_0xf85d('0x13')](_0x23263b)[_0xf85d('0x14')](_0xf85d('0x15'));return _0x2ff3dc['substring'](0x0,0x8)+'-'+_0x2ff3dc[_0xf85d('0x1f')](0x8,0xc)+'-'+_0x2ff3dc[_0xf85d('0x1f')](0xc,0x10)+'-'+_0x2ff3dc[_0xf85d('0x1f')](0x10,0x14)+'-'+_0x2ff3dc[_0xf85d('0x1f')](0x14);}}; \ No newline at end of file +var _0x11cc=['digest','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','md5','hex','substring','crypto','child_process','orderBy','keys','length','family','head','mac','00:00:00:00:00:00','address','cpus','model','join','createHash','update'];(function(_0x2db1c4,_0x1f338c){var _0x46b4af=function(_0x2555b7){while(--_0x2555b7){_0x2db1c4['push'](_0x2db1c4['shift']());}};_0x46b4af(++_0x1f338c);}(_0x11cc,0x15d));var _0xc11c=function(_0x19e89d,_0x4793ce){_0x19e89d=_0x19e89d-0x0;var _0x48aeed=_0x11cc[_0x19e89d];return _0x48aeed;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xc11c('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xc11c('0x1'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x597e1f=[];var _0x3c49c4=os['networkInterfaces']();var _0x409660=_[_0xc11c('0x2')](_[_0xc11c('0x3')](_0x3c49c4));for(var _0x567024=0x0;_0x567024<_0x409660[_0xc11c('0x4')];_0x567024++){var _0x2728ef=_0x3c49c4[_0x409660[_0x567024]]['filter'](function(_0x42b192){return _0x42b192[_0xc11c('0x5')]==='IPv4'&&_0x42b192['internal']===![];});_0x597e1f=_0x597e1f['concat'](_0x2728ef);}return _0x597e1f;}function getFirstInterface(){var _0x3610ec=_[_0xc11c('0x6')](getInterfaces());return{'macAddress':_0x3610ec&&_0x3610ec[_0xc11c('0x7')]?_0x3610ec['mac']:_0xc11c('0x8'),'ipAddress':_0x3610ec&&_0x3610ec[_0xc11c('0x9')]?_0x3610ec['address']:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x167477=_[_0xc11c('0x2')](os[_0xc11c('0xa')]()['map'](function(_0x4d75cf){return _0x4d75cf[_0xc11c('0xb')];}))[_0xc11c('0xc')](':');return crypto[_0xc11c('0xd')]('md5')[_0xc11c('0xe')](_0x167477)[_0xc11c('0xf')]('hex');}exports[_0xc11c('0x10')]=function(){var _0x37b490=os[_0xc11c('0x11')]();var _0xe3ceb0=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0xe3ceb0[_0xc11c('0x12')](config['licenseToken'])){return config[_0xc11c('0x13')];}else if(_0x37b490===_0xc11c('0x14')){return exec(_0xc11c('0x15'),{'encoding':_0xc11c('0x16')})['replace']('\x0d\x0a','');}else{var _0x12b6d6=getFirstInterface();var _0x4b38bc=getCPUhash();var _0x12c3a9=_0x4b38bc+'|'+os[_0xc11c('0x17')]()+'|'+_0x12b6d6[_0xc11c('0x18')]+'|'+_0x12b6d6['ipAddress'];var _0x2a109d=crypto[_0xc11c('0xd')](_0xc11c('0x19'))[_0xc11c('0xe')](_0x12c3a9)[_0xc11c('0xf')](_0xc11c('0x1a'));return _0x2a109d[_0xc11c('0x1b')](0x0,0x8)+'-'+_0x2a109d[_0xc11c('0x1b')](0x8,0xc)+'-'+_0x2a109d[_0xc11c('0x1b')](0xc,0x10)+'-'+_0x2a109d[_0xc11c('0x1b')](0x10,0x14)+'-'+_0x2a109d['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0a056a4..abc134a 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 _0x5203=['License','spread','message','default','util','request-promise','bluebird','pkginfo','version','../../components/encryptor','license','https://www.xcallymotion.com','exports','format','GET','catch','get','data1','data2','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x5203,0xe8));var _0x3520=function(_0xb6b173,_0x23fafd){_0xb6b173=_0xb6b173-0x0;var _0x2515ba=_0x5203[_0xb6b173];return _0x2515ba;};'use strict';var util=require(_0x3520('0x0'));var moment=require('moment');var rp=require(_0x3520('0x1'));var BPromise=require(_0x3520('0x2'));var pkginfo=require(_0x3520('0x3'))(module,_0x3520('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x3520('0x5'));var hardware=require('./hardware');var logger=require('../logger')(_0x3520('0x6'));var HOST=_0x3520('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x29b78a){return new BPromise(function(_0x232d90,_0x5680ac){var _0x18deee=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x29b78a,module[_0x3520('0x8')][_0x3520('0x4')]);if(oldToken){_0x18deee=util[_0x3520('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x29b78a,module['exports'][_0x3520('0x4')],oldToken);}var _0x4e4ca5={'uri':_0x18deee,'method':_0x3520('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x4e4ca5)['then'](function(_0x19e273){_0x232d90(_0x19e273);})[_0x3520('0xb')](function(_0x4441e5){_0x5680ac(_0x4441e5);});});}function manageLicense(_0x5f210c,_0x20e557){var _0x4f0f47=_0x20e557[_0x3520('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x4f0f47[_0x3520('0xd')]!==_0x5f210c&&!_0x4f0f47[_0x3520('0xe')]){oldToken=_0x4f0f47[_0x3520('0xd')];}httpRequest(_0x5f210c)[_0x3520('0xf')](function(_0xb9b9c8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xb9b9c8[_0x3520('0x10')]){isOldTokenSent=![];if(!_0x4f0f47[_0x3520('0x6')]&&_0x4f0f47[_0x3520('0x6')]!=_0xb9b9c8[_0x3520('0x6')]||_0x4f0f47[_0x3520('0x6')]&&_0x4f0f47[_0x3520('0xe')]){logger['info'](_0x3520('0x11'));}if(_0x4f0f47[_0x3520('0x6')]&&!_0x4f0f47[_0x3520('0xe')]&&_0x4f0f47[_0x3520('0x6')]!=_0xb9b9c8[_0x3520('0x6')]){logger['info'](_0x3520('0x12'));}if(_0x4f0f47[_0x3520('0x6')]&&!_0x4f0f47[_0x3520('0xe')]&&_0x4f0f47['license']==_0xb9b9c8[_0x3520('0x6')]){return _0x20e557;}return _0x20e557[_0x3520('0x13')]({'data1':_0x5f210c,'data2':null,'license':_0xb9b9c8['license']});}else{if(_0xb9b9c8[_0x3520('0x6')]||_0x4f0f47[_0x3520('0x6')]){if(!_0x4f0f47[_0x3520('0xe')]){if(_0x4f0f47['data1']==_0x5f210c){GRAY_PERIOD_REASON='Disabled';logger[_0x3520('0x14')](_0x3520('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x3520('0x16'),_0x4f0f47[_0x3520('0xd')],_0x5f210c);}logger[_0x3520('0x14')](_0x3520('0x17'),GRAY_PERIOD_REASON[_0x3520('0x18')](),moment()[_0x3520('0x9')](_0x3520('0x19')));return _0x20e557[_0x3520('0x13')]({'data2':encryptor[_0x3520('0x1a')](moment()['format'](_0x3520('0x19')))});}else{if(moment()[_0x3520('0x1b')](encryptor[_0x3520('0x1c')](_0x4f0f47['data2']),_0x3520('0x1d'))>DAYS){logger[_0x3520('0x14')](_0x3520('0x1e'),moment()['format'](_0x3520('0x19')));isOldTokenSent=![];return _0x20e557[_0x3520('0x13')]({'data1':_0x5f210c,'data2':null,'license':null});}}}else{if(_0x4f0f47['data1']!=_0x5f210c){logger[_0x3520('0x14')](_0x3520('0x16'),_0x4f0f47[_0x3520('0xd')],_0x5f210c);return _0x20e557[_0x3520('0x13')]({'data1':_0x5f210c,'data2':null,'license':null});}}}return _0x20e557;})[_0x3520('0xf')](function(_0x8afbe7){_0x20e557=_0x8afbe7;})[_0x3520('0xb')](function(_0x412e6e){logger[_0x3520('0x1f')](_0x412e6e['message']);})[_0x3520('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x3520('0x21')](),_0x20e557);},TIME);});}function defaultLicense(){var _0x23f701=hardware[_0x3520('0x21')]();if(_0x23f701){return db[_0x3520('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x23f701}})[_0x3520('0x23')](function(_0x2ccfe4,_0x2558de){logger[_0x3520('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x23f701);manageLicense(_0x23f701,_0x2ccfe4);})[_0x3520('0xb')](function(_0x45cb7a){logger[_0x3520('0x1f')](_0x45cb7a[_0x3520('0x24')]);});}}exports[_0x3520('0x25')]=defaultLicense; \ No newline at end of file +var _0x811f=['%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','update','Disabled','Changed'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0x811f,0x1bc));var _0xf811=function(_0x290844,_0x366077){_0x290844=_0x290844-0x0;var _0x546847=_0x811f[_0x290844];return _0x546847;};'use strict';var util=require('util');var moment=require(_0xf811('0x0'));var rp=require('request-promise');var BPromise=require(_0xf811('0x1'));var pkginfo=require(_0xf811('0x2'))(module,_0xf811('0x3'));var db=require(_0xf811('0x4'))['db'];var encryptor=require(_0xf811('0x5'));var hardware=require(_0xf811('0x6'));var logger=require(_0xf811('0x7'))(_0xf811('0x8'));var HOST=_0xf811('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3ea8f6){return new BPromise(function(_0x19da28,_0x44ca86){var _0x24de7f=util[_0xf811('0xa')](_0xf811('0xb'),HOST,_0x3ea8f6,module['exports'][_0xf811('0x3')]);if(oldToken){_0x24de7f=util['format'](_0xf811('0xc'),HOST,_0x3ea8f6,module[_0xf811('0xd')][_0xf811('0x3')],oldToken);}var _0x25803c={'uri':_0x24de7f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x25803c)[_0xf811('0xe')](function(_0x3471a7){_0x19da28(_0x3471a7);})['catch'](function(_0x382e78){_0x44ca86(_0x382e78);});});}function manageLicense(_0x12a9e3,_0x17f5bd){var _0x534927=_0x17f5bd[_0xf811('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x534927[_0xf811('0x10')]!==_0x12a9e3&&!_0x534927[_0xf811('0x11')]){oldToken=_0x534927[_0xf811('0x10')];}httpRequest(_0x12a9e3)[_0xf811('0xe')](function(_0x50e021){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x50e021[_0xf811('0x12')]){isOldTokenSent=![];if(!_0x534927[_0xf811('0x8')]&&_0x534927[_0xf811('0x8')]!=_0x50e021['license']||_0x534927[_0xf811('0x8')]&&_0x534927[_0xf811('0x11')]){logger['info'](_0xf811('0x13'));}if(_0x534927[_0xf811('0x8')]&&!_0x534927[_0xf811('0x11')]&&_0x534927['license']!=_0x50e021[_0xf811('0x8')]){logger[_0xf811('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x534927[_0xf811('0x8')]&&!_0x534927[_0xf811('0x11')]&&_0x534927['license']==_0x50e021[_0xf811('0x8')]){return _0x17f5bd;}return _0x17f5bd[_0xf811('0x15')]({'data1':_0x12a9e3,'data2':null,'license':_0x50e021[_0xf811('0x8')]});}else{if(_0x50e021[_0xf811('0x8')]||_0x534927['license']){if(!_0x534927['data2']){if(_0x534927['data1']==_0x12a9e3){GRAY_PERIOD_REASON=_0xf811('0x16');logger[_0xf811('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xf811('0x17');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x534927[_0xf811('0x10')],_0x12a9e3);}logger[_0xf811('0x14')](_0xf811('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xf811('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x17f5bd[_0xf811('0x15')]({'data2':encryptor[_0xf811('0x19')](moment()[_0xf811('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xf811('0x1a')](encryptor['decryptString'](_0x534927[_0xf811('0x11')]),_0xf811('0x1b'))>DAYS){logger['info'](_0xf811('0x1c'),moment()['format'](_0xf811('0x1d')));isOldTokenSent=![];return _0x17f5bd[_0xf811('0x15')]({'data1':_0x12a9e3,'data2':null,'license':null});}}}else{if(_0x534927[_0xf811('0x10')]!=_0x12a9e3){logger[_0xf811('0x14')](_0xf811('0x1e'),_0x534927['data1'],_0x12a9e3);return _0x17f5bd[_0xf811('0x15')]({'data1':_0x12a9e3,'data2':null,'license':null});}}}return _0x17f5bd;})['then'](function(_0x4c259e){_0x17f5bd=_0x4c259e;})[_0xf811('0x1f')](function(_0x3ba11d){logger[_0xf811('0x20')](_0x3ba11d[_0xf811('0x21')]);})[_0xf811('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x17f5bd);},TIME);});}function defaultLicense(){var _0x2938cb=hardware[_0xf811('0x23')]();if(_0x2938cb){return db[_0xf811('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2938cb}})[_0xf811('0x25')](function(_0x4b3558,_0x4b1b74){logger['info'](_0xf811('0x26'),_0x2938cb);manageLicense(_0x2938cb,_0x4b3558);})[_0xf811('0x1f')](function(_0x72b2b7){logger[_0xf811('0x20')](_0x72b2b7[_0xf811('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 708d5ed..49c77ed 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 _0x1b25=['machineUuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','telephones','forEach','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','catch','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','Breaking\x20license','License','find','then','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','format','%s:%s:%s','parse','demo','decryptString','deadline','days','grayReason'];(function(_0x5ab701,_0x1c8f6c){var _0xd8b404=function(_0x30243a){while(--_0x30243a){_0x5ab701['push'](_0x5ab701['shift']());}};_0xd8b404(++_0x1c8f6c);}(_0x1b25,0x18d));var _0x51b2=function(_0x231622,_0x5f5d8e){_0x231622=_0x231622-0x0;var _0x8bdbc2=_0x1b25[_0x231622];return _0x8bdbc2;};'use strict';var util=require(_0x51b2('0x0'));var _=require(_0x51b2('0x1'));var moment=require(_0x51b2('0x2'));var BPromise=require(_0x51b2('0x3'));var hardware=require(_0x51b2('0x4'));var encryptor=require(_0x51b2('0x5'));var db=require(_0x51b2('0x6'))['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':_0x51b2('0x7'),'machineUuid':hardware[_0x51b2('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x51b2('0x9'),'machineUuid':hardware[_0x51b2('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x31eb6a){return new BPromise(function(_0x4effd2,_0xccefd7){return db[_0x51b2('0xa')][_0x51b2('0xb')](_['defaults'](_0x31eb6a,{'raw':!![],'where':{'id':0x1}}))[_0x51b2('0xc')](function(_0x59f291){return checkLicense(_0x59f291,null);})['then'](function(_0x8e4a4f){_0x4effd2(_0x8e4a4f);return;})['catch'](function(_0x4cbf48){_0xccefd7(_0x4cbf48);});});}function checkLicense(_0x1ba0bb,_0x31c226){if(!_0x1ba0bb){demoLicense[_0x51b2('0xd')]=_0x1ba0bb[_0x51b2('0xe')];return demoLicense;}try{var _0x42627c=_0x31c226||_0x1ba0bb['license'];if(_[_0x51b2('0xf')](_0x42627c)){throw new Error(_0x51b2('0x10'));}var _0x53dbba=_0x1ba0bb[_0x51b2('0xe')];var _0x4a2e4a=_0x1ba0bb[_0x51b2('0x11')];var _0x30b05a=_0x53dbba['split']('-')[0x4];var _0x2e7204=_0x53dbba['split']('-')[0x0];var _0x18fe47=encryptor['decryptString'](_0x42627c,util[_0x51b2('0x12')](_0x51b2('0x13'),_0x30b05a,_0x53dbba,_0x2e7204));var _0x167c53=JSON[_0x51b2('0x14')](_0x18fe47);_0x167c53[_0x51b2('0x15')]=![];_0x167c53[_0x51b2('0xd')]=_0x53dbba;_0x167c53['machineUuid']=hardware[_0x51b2('0x8')]();if(_0x4a2e4a){var _0x3a3fcd=encryptor[_0x51b2('0x16')](_0x4a2e4a);_0x167c53['gray']=_0x3a3fcd;_0x167c53[_0x51b2('0x17')]=moment(_0x3a3fcd)['add'](0x7,_0x51b2('0x18'))[_0x51b2('0x12')]();_0x167c53[_0x51b2('0x19')]=_0x167c53[_0x51b2('0xd')]!=_0x167c53[_0x51b2('0x1a')]?_0x51b2('0x1b'):_0x51b2('0x1c');}return _0x167c53;}catch(_0x13f68a){breakingLicense[_0x51b2('0xd')]=_0x1ba0bb[_0x51b2('0xe')];breakingLicense[_0x51b2('0x1d')]=_0x13f68a[_0x51b2('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x534bdc,_0x5ca621){getLicense()[_0x51b2('0xc')](function(_0x80d913){return db[_0x51b2('0x1e')][_0x51b2('0x1f')]({'attributes':[_0x51b2('0x20'),[db[_0x51b2('0x21')]['fn'](_0x51b2('0x22'),db['sequelize'][_0x51b2('0x23')](_0x51b2('0x20'))),_0x51b2('0x24')]],'group':_0x51b2('0x20'),'where':{'role':{'$or':[_0x51b2('0x25'),_0x51b2('0x26'),_0x51b2('0x27')]}},'raw':!![]})[_0x51b2('0xc')](function(_0x37d7a0){var _0x46e74f={'user':_0x80d913['users']||0x0,'telephone':_0x80d913[_0x51b2('0x28')]||0x0};_0x37d7a0[_0x51b2('0x29')](function(_0x5cce0e){var _0x1b5921=_0x5cce0e[_0x51b2('0x20')]===_0x51b2('0x25')?_0x51b2('0x26'):_0x5cce0e['role'];_0x46e74f[_0x1b5921]-=_0x5cce0e[_0x51b2('0x24')];if(_0x46e74f[_0x1b5921]<0x0)_0x46e74f[_0x1b5921]=0x0;});_0x534bdc(_0x46e74f);return;});})['catch'](function(_0xe6e935){_0x5ca621(_0xe6e935);});});}function checkUserLimits(_0x1402a6){return new BPromise(function(_0x4dfd2d,_0x1ff7b8){getLimits()['then'](function(_0x38813a){var _0x402a33=_[_0x51b2('0x2a')](_['countBy'](_0x1402a6,'role'),[_0x51b2('0x25'),'user',_0x51b2('0x27')]);var _0x4d4fa8=(_0x402a33[_0x51b2('0x25')]||0x0)+(_0x402a33[_0x51b2('0x26')]||0x0);var _0x4b39b7=_0x402a33['telephone']||0x0;if(_0x4d4fa8>_0x38813a['user'])return _0x1ff7b8(_0x51b2('0x2b'));if(_0x4b39b7>_0x38813a[_0x51b2('0x27')])return _0x1ff7b8(_0x51b2('0x2c'));return _0x4dfd2d();})[_0x51b2('0x2d')](function(_0x56665d){_0x1ff7b8(_0x56665d);});});}module[_0x51b2('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x5975=['format','grayReason','changed','disabled','message','findAll','role','sequelize','COUNT','admin','user','telephone','users','forEach','count','License\x20limit\x20reached\x20for\x20users','exports','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','parse','demo','uuid','machineUuid','deadline','add','days'];(function(_0x6b45,_0x56987c){var _0x190bf3=function(_0x51cfa2){while(--_0x51cfa2){_0x6b45['push'](_0x6b45['shift']());}};_0x190bf3(++_0x56987c);}(_0x5975,0x98));var _0x5597=function(_0x4ccbad,_0x53b7ae){_0x4ccbad=_0x4ccbad-0x0;var _0x56e5d8=_0x5975[_0x4ccbad];return _0x56e5d8;};'use strict';var util=require('util');var _=require(_0x5597('0x0'));var moment=require('moment');var BPromise=require(_0x5597('0x1'));var hardware=require(_0x5597('0x2'));var encryptor=require(_0x5597('0x3'));var db=require(_0x5597('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5597('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5597('0x6'),'machineUuid':hardware[_0x5597('0x7')](),'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':_0x5597('0x8'),'machineUuid':hardware[_0x5597('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x10ff98){return new BPromise(function(_0x480bb1,_0x42cf7a){return db[_0x5597('0x9')][_0x5597('0xa')](_[_0x5597('0xb')](_0x10ff98,{'raw':!![],'where':{'id':0x1}}))[_0x5597('0xc')](function(_0x4e371a){return checkLicense(_0x4e371a,null);})['then'](function(_0x4ac409){_0x480bb1(_0x4ac409);return;})[_0x5597('0xd')](function(_0x56609e){_0x42cf7a(_0x56609e);});});}function checkLicense(_0x3cd4ef,_0x54d8b6){if(!_0x3cd4ef){demoLicense['uuid']=_0x3cd4ef[_0x5597('0xe')];return demoLicense;}try{var _0x8e5579=_0x54d8b6||_0x3cd4ef[_0x5597('0xf')];if(_[_0x5597('0x10')](_0x8e5579)){throw new Error(_0x5597('0x11'));}var _0x1f0b71=_0x3cd4ef['data1'];var _0x4ede77=_0x3cd4ef[_0x5597('0x12')];var _0x5762ba=_0x1f0b71[_0x5597('0x13')]('-')[0x4];var _0x38499a=_0x1f0b71[_0x5597('0x13')]('-')[0x0];var _0xf009d1=encryptor[_0x5597('0x14')](_0x8e5579,util['format']('%s:%s:%s',_0x5762ba,_0x1f0b71,_0x38499a));var _0x574060=JSON[_0x5597('0x15')](_0xf009d1);_0x574060[_0x5597('0x16')]=![];_0x574060[_0x5597('0x17')]=_0x1f0b71;_0x574060[_0x5597('0x18')]=hardware['getUuid']();if(_0x4ede77){var _0x2195e5=encryptor['decryptString'](_0x4ede77);_0x574060['gray']=_0x2195e5;_0x574060[_0x5597('0x19')]=moment(_0x2195e5)[_0x5597('0x1a')](0x7,_0x5597('0x1b'))[_0x5597('0x1c')]();_0x574060[_0x5597('0x1d')]=_0x574060['uuid']!=_0x574060[_0x5597('0x18')]?_0x5597('0x1e'):_0x5597('0x1f');}return _0x574060;}catch(_0x485fdf){breakingLicense[_0x5597('0x17')]=_0x3cd4ef[_0x5597('0xe')];breakingLicense['message']=_0x485fdf[_0x5597('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x586456,_0x4236e7){getLicense()[_0x5597('0xc')](function(_0x511b50){return db['User'][_0x5597('0x21')]({'attributes':[_0x5597('0x22'),[db[_0x5597('0x23')]['fn'](_0x5597('0x24'),db[_0x5597('0x23')]['col'](_0x5597('0x22'))),'count']],'group':_0x5597('0x22'),'where':{'role':{'$or':[_0x5597('0x25'),_0x5597('0x26'),_0x5597('0x27')]}},'raw':!![]})[_0x5597('0xc')](function(_0x1d16a1){var _0x594ca5={'user':_0x511b50[_0x5597('0x28')]||0x0,'telephone':_0x511b50['telephones']||0x0};_0x1d16a1[_0x5597('0x29')](function(_0x4b6482){var _0x5af8b0=_0x4b6482[_0x5597('0x22')]===_0x5597('0x25')?_0x5597('0x26'):_0x4b6482[_0x5597('0x22')];_0x594ca5[_0x5af8b0]-=_0x4b6482[_0x5597('0x2a')];if(_0x594ca5[_0x5af8b0]<0x0)_0x594ca5[_0x5af8b0]=0x0;});_0x586456(_0x594ca5);return;});})[_0x5597('0xd')](function(_0x6383e8){_0x4236e7(_0x6383e8);});});}function checkUserLimits(_0x2bcee6){return new BPromise(function(_0x3589fb,_0x14d24d){getLimits()[_0x5597('0xc')](function(_0x58e771){var _0x480176=_['pick'](_['countBy'](_0x2bcee6,_0x5597('0x22')),['admin','user',_0x5597('0x27')]);var _0x19cb43=(_0x480176[_0x5597('0x25')]||0x0)+(_0x480176[_0x5597('0x26')]||0x0);var _0x316f9d=_0x480176['telephone']||0x0;if(_0x19cb43>_0x58e771['user'])return _0x14d24d(_0x5597('0x2b'));if(_0x316f9d>_0x58e771[_0x5597('0x27')])return _0x14d24d('License\x20limit\x20reached\x20for\x20telephones');return _0x3589fb();})[_0x5597('0xd')](function(_0x29f8d6){_0x14d24d(_0x29f8d6);});});}module[_0x5597('0x2c')]={'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 6eb6f38..ee0b8ad 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 _0x0972=['http://localhost:9000','app-id'];(function(_0x390c14,_0x49dcea){var _0x46d7ef=function(_0x1c0ec0){while(--_0x1c0ec0){_0x390c14['push'](_0x390c14['shift']());}};_0x46d7ef(++_0x49dcea);}(_0x0972,0x64));var _0x2097=function(_0x165a08,_0x30bd95){_0x165a08=_0x165a08-0x0;var _0x4ede0c=_0x0972[_0x165a08];return _0x4ede0c;};'use strict';module['exports']={'DOMAIN':_0x2097('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2097('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x66fa=['http://localhost:9000','app-id','secret','exports'];(function(_0x2c1416,_0x2cf104){var _0xbb05e9=function(_0x3ae1b2){while(--_0x3ae1b2){_0x2c1416['push'](_0x2c1416['shift']());}};_0xbb05e9(++_0x2cf104);}(_0x66fa,0x117));var _0xa66f=function(_0x8a4cb2,_0x5c8647){_0x8a4cb2=_0x8a4cb2-0x0;var _0x41e1b0=_0x66fa[_0x8a4cb2];return _0x41e1b0;};'use strict';module[_0xa66f('0x0')]={'DOMAIN':_0xa66f('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xa66f('0x2'),'GOOGLE_SECRET':_0xa66f('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d1b8f52..0d15c37 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf186=['YYYY-MM-DD\x20HH:mm:ss','exports','Logger','File','%s-%s','error','transports','info','Console','env','debugLevel','moment','winston','util','INFO','/var','log','xcally','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x48a583,_0x229f86){var _0x50fefe=function(_0x4b1f5e){while(--_0x4b1f5e){_0x48a583['push'](_0x48a583['shift']());}};_0x50fefe(++_0x229f86);}(_0xf186,0x1bb));var _0x6f18=function(_0x4ce05c,_0x2dec75){_0x4ce05c=_0x4ce05c-0x0;var _0x41fa4a=_0xf186[_0x4ce05c];return _0x41fa4a;};'use strict';var moment=require(_0x6f18('0x0'));var winston=require(_0x6f18('0x1'));var util=require(_0x6f18('0x2'));var path=require('path');var debugLevel=_0x6f18('0x3');function filename(_0x2eea3a,_0x3da3e8){return path['join'](_0x6f18('0x4'),_0x6f18('0x5'),_0x6f18('0x6'),util['format']('%s-%s.log',_0x2eea3a,_0x3da3e8));}function formatter(_0x396d09,_0x135496){_0x135496[_0x6f18('0x7')]=_0x135496[_0x6f18('0x7')][_0x6f18('0x8')](/@@{/g,_0x6f18('0x9'))[_0x6f18('0x8')](/}@@/g,_0x6f18('0xa'))[_0x6f18('0x8')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x6f18('0xb')](_0x6f18('0xc'),moment()[_0x6f18('0xb')](_0x6f18('0xd')),_0x135496['level']['toUpperCase'](),_0x396d09,_0x135496[_0x6f18('0x7')]);}module[_0x6f18('0xe')]=function(_0x907352){return new winston[(_0x6f18('0xf'))]({'transports':[new winston['transports'][(_0x6f18('0x10'))]({'name':util['format'](_0x6f18('0x11'),_0x907352,_0x6f18('0x12')),'filename':filename(_0x907352,'error'),'level':_0x6f18('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x49b7be){return formatter(_0x907352,_0x49b7be);}}),new winston[(_0x6f18('0x13'))][(_0x6f18('0x10'))]({'name':util[_0x6f18('0xb')](_0x6f18('0x11'),_0x907352,'info'),'filename':filename(_0x907352,_0x6f18('0x14')),'level':_0x6f18('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3bce47){return formatter(_0x907352,_0x3bce47);}}),new winston[(_0x6f18('0x13'))][(_0x6f18('0x15'))]({'level':process[_0x6f18('0x16')][_0x6f18('0x17')]||debugLevel,'json':![],'formatter':function(_0x28c9ec){return formatter(_0x907352,_0x28c9ec);}})]});}; \ No newline at end of file +var _0x7d70=['File','%s-%s','info','Console','moment','winston','util','path','INFO','join','/var','log','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','error'];(function(_0x2c0c25,_0x5b0a19){var _0x2d8cf8=function(_0x5be48f){while(--_0x5be48f){_0x2c0c25['push'](_0x2c0c25['shift']());}};_0x2d8cf8(++_0x5b0a19);}(_0x7d70,0x118));var _0x07d7=function(_0x5a6920,_0x421cc4){_0x5a6920=_0x5a6920-0x0;var _0x3d11d4=_0x7d70[_0x5a6920];return _0x3d11d4;};'use strict';var moment=require(_0x07d7('0x0'));var winston=require(_0x07d7('0x1'));var util=require(_0x07d7('0x2'));var path=require(_0x07d7('0x3'));var debugLevel=_0x07d7('0x4');function filename(_0x2163de,_0x918ec){return path[_0x07d7('0x5')](_0x07d7('0x6'),_0x07d7('0x7'),'xcally',util[_0x07d7('0x8')]('%s-%s.log',_0x2163de,_0x918ec));}function formatter(_0x11dda2,_0x3597d6){_0x3597d6[_0x07d7('0x9')]=_0x3597d6['message'][_0x07d7('0xa')](/@@{/g,'{{{')['replace'](/}@@/g,_0x07d7('0xb'))[_0x07d7('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x07d7('0x8')](_0x07d7('0xc'),moment()[_0x07d7('0x8')](_0x07d7('0xd')),_0x3597d6[_0x07d7('0xe')]['toUpperCase'](),_0x11dda2,_0x3597d6[_0x07d7('0x9')]);}module[_0x07d7('0xf')]=function(_0xe413d7){return new winston[(_0x07d7('0x10'))]({'transports':[new winston[(_0x07d7('0x11'))]['File']({'name':util[_0x07d7('0x8')]('%s-%s',_0xe413d7,_0x07d7('0x12')),'filename':filename(_0xe413d7,_0x07d7('0x12')),'level':_0x07d7('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x326bcf){return formatter(_0xe413d7,_0x326bcf);}}),new winston[(_0x07d7('0x11'))][(_0x07d7('0x13'))]({'name':util[_0x07d7('0x8')](_0x07d7('0x14'),_0xe413d7,_0x07d7('0x15')),'filename':filename(_0xe413d7,_0x07d7('0x15')),'level':_0x07d7('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ac0dd){return formatter(_0xe413d7,_0x3ac0dd);}}),new winston[(_0x07d7('0x11'))][(_0x07d7('0x16'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x15e972){return formatter(_0xe413d7,_0x15e972);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 90afb63..31239e3 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 _0x97c8=['express','join','ami','../../services/ami/index.js','agi','../../services/email/index.js','routing','../../services/routing/index.js','xdr'];(function(_0x5ceba8,_0x43e84c){var _0x26d432=function(_0xbb2ae){while(--_0xbb2ae){_0x5ceba8['push'](_0x5ceba8['shift']());}};_0x26d432(++_0x43e84c);}(_0x97c8,0xd8));var _0x897c=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x97c8[_0x3c4dad];return _0x1a4f49;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x897c('0x0'),'script':path[_0x897c('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x897c('0x2'),'script':path[_0x897c('0x1')](__dirname,_0x897c('0x3'))},{'name':_0x897c('0x4'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x897c('0x1')](__dirname,_0x897c('0x5'))},{'name':_0x897c('0x6'),'script':path['join'](__dirname,_0x897c('0x7'))},{'name':_0x897c('0x8'),'script':path[_0x897c('0x1')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0x44a8=['../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','join'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x44a8,0xef));var _0x844a=function(_0x2d6bad,_0x3851f2){_0x2d6bad=_0x2d6bad-0x0;var _0x4202da=_0x44a8[_0x2d6bad];return _0x4202da;};'use strict';var path=require(_0x844a('0x0'));var os=require('os');var config={'apps':[{'name':_0x844a('0x1'),'script':path[_0x844a('0x2')](__dirname,_0x844a('0x3'))},{'name':'ami','script':path[_0x844a('0x2')](__dirname,_0x844a('0x4'))},{'name':_0x844a('0x5'),'script':path[_0x844a('0x2')](__dirname,_0x844a('0x6'))},{'name':_0x844a('0x7'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0x844a('0x2')](__dirname,_0x844a('0x8'))},{'name':'xdr','script':path[_0x844a('0x2')](__dirname,_0x844a('0x9'))}]};module[_0x844a('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 49a908a..bb94422 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 _0xe402=['dump','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x34bd11,_0x322433){var _0x2a4f5c=function(_0x3296e3){while(--_0x3296e3){_0x34bd11['push'](_0x34bd11['shift']());}};_0x2a4f5c(++_0x322433);}(_0xe402,0x127));var _0x2e40=function(_0x4ac5c2,_0x7aa7df){_0x4ac5c2=_0x4ac5c2-0x0;var _0x5aed95=_0xe402[_0x4ac5c2];return _0x5aed95;};'use strict';var pm2=require(_0x2e40('0x0'));var BPromise=require(_0x2e40('0x1'));var config=require(_0x2e40('0x2'));function connect(){return new BPromise(function(_0x1ae558,_0x62d259){return pm2[_0x2e40('0x3')](function(_0x5eee9a){if(_0x5eee9a){return _0x62d259(_0x5eee9a);}return _0x1ae558(_0x2e40('0x4'));});});};exports[_0x2e40('0x5')]=function(_0x44dc08){return connect()[_0x2e40('0x6')](function(){return new BPromise(function(_0x215060,_0x523a44){return pm2[_0x2e40('0x5')](_0x44dc08,function(_0x2c6486,_0x1fec49){if(_0x2c6486){return _0x523a44(_0x2c6486);}pm2[_0x2e40('0x7')]();return _0x215060(_0x1fec49);});});});};exports[_0x2e40('0x8')]=function(_0x364c18){return connect()[_0x2e40('0x6')](function(){return new BPromise(function(_0x36fbde,_0x17218f){return pm2[_0x2e40('0x8')](_0x364c18,function(_0x89bc9d,_0x135424){if(_0x89bc9d){return _0x17218f(_0x89bc9d);}pm2[_0x2e40('0x7')]();return _0x36fbde(_0x135424);});});});};exports[_0x2e40('0x9')]=function(_0x33b694){return connect()[_0x2e40('0x6')](function(){return new BPromise(function(_0x30a11d,_0x661c7){return pm2[_0x2e40('0x9')](_0x33b694,function(_0x5c7700,_0x3d972e){if(_0x5c7700){return _0x661c7(_0x5c7700);}pm2[_0x2e40('0x7')]();return _0x30a11d(_0x3d972e);});});});};exports['list']=function(){return connect()[_0x2e40('0x6')](function(){return new BPromise(function(_0xa1e81f,_0x2a4e0c){return pm2[_0x2e40('0xa')](function(_0x311dbd,_0x5d8906){if(_0x311dbd){return _0x2a4e0c(_0x311dbd);}pm2[_0x2e40('0x7')]();return _0xa1e81f(_0x5d8906);});});});};exports[_0x2e40('0xb')]=function(_0x213039){return connect()[_0x2e40('0x6')](function(){return new BPromise(function(_0x579c55,_0x379100){return pm2[_0x2e40('0xb')](_0x213039,function(_0x1426c4,_0x324b6f){if(_0x1426c4){return _0x379100(_0x1426c4);}pm2[_0x2e40('0x7')]();return _0x579c55(_0x324b6f);});});});};exports[_0x2e40('0xc')]=function(_0x4834a1){return connect()[_0x2e40('0x6')](function(){return new BPromise(function(_0xdb2960,_0x31b20f){return pm2[_0x2e40('0xc')](_0x4834a1,function(_0x13f82a,_0x3de219){if(_0x13f82a){return _0x31b20f(_0x13f82a);}pm2[_0x2e40('0x7')]();return _0xdb2960(_0x3de219);});});});};exports[_0x2e40('0xd')]=function(){return connect()[_0x2e40('0x6')](function(){return new BPromise(function(_0x3efac5,_0x40212a){return pm2[_0x2e40('0xd')](function(_0x1b0e13){if(_0x1b0e13){return _0x40212a(_0x1b0e13);}return _0x3efac5('saved');});});});}; \ No newline at end of file +var _0xaf95=['then','disconnect','stop','restart','list','describe','dump','./config','connect','start'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0xaf95,0x151));var _0x5af9=function(_0x327ec1,_0x14e5be){_0x327ec1=_0x327ec1-0x0;var _0x36d595=_0xaf95[_0x327ec1];return _0x36d595;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x5af9('0x0'));function connect(){return new BPromise(function(_0x155e13,_0x54ec28){return pm2[_0x5af9('0x1')](function(_0x1fd2de){if(_0x1fd2de){return _0x54ec28(_0x1fd2de);}return _0x155e13('connected');});});};exports[_0x5af9('0x2')]=function(_0x3e8109){return connect()[_0x5af9('0x3')](function(){return new BPromise(function(_0x1b84c2,_0x22b5b8){return pm2['start'](_0x3e8109,function(_0x16c054,_0x1ff818){if(_0x16c054){return _0x22b5b8(_0x16c054);}pm2[_0x5af9('0x4')]();return _0x1b84c2(_0x1ff818);});});});};exports[_0x5af9('0x5')]=function(_0x253403){return connect()[_0x5af9('0x3')](function(){return new BPromise(function(_0x41933e,_0x9e1d01){return pm2['stop'](_0x253403,function(_0x161481,_0x157e6d){if(_0x161481){return _0x9e1d01(_0x161481);}pm2[_0x5af9('0x4')]();return _0x41933e(_0x157e6d);});});});};exports[_0x5af9('0x6')]=function(_0x3ae008){return connect()[_0x5af9('0x3')](function(){return new BPromise(function(_0x91fd02,_0x9ed880){return pm2['restart'](_0x3ae008,function(_0x306c7b,_0x5f55fc){if(_0x306c7b){return _0x9ed880(_0x306c7b);}pm2[_0x5af9('0x4')]();return _0x91fd02(_0x5f55fc);});});});};exports[_0x5af9('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1fc1cf,_0x4edb6e){return pm2['list'](function(_0x3bd176,_0x185116){if(_0x3bd176){return _0x4edb6e(_0x3bd176);}pm2['disconnect']();return _0x1fc1cf(_0x185116);});});});};exports['describe']=function(_0x3f4729){return connect()['then'](function(){return new BPromise(function(_0x43d864,_0x2c40a9){return pm2[_0x5af9('0x8')](_0x3f4729,function(_0x180bc7,_0x3c0bde){if(_0x180bc7){return _0x2c40a9(_0x180bc7);}pm2[_0x5af9('0x4')]();return _0x43d864(_0x3c0bde);});});});};exports['delete']=function(_0x399f2c){return connect()[_0x5af9('0x3')](function(){return new BPromise(function(_0x574f6f,_0x5544c6){return pm2['delete'](_0x399f2c,function(_0x3d7188,_0x3004bf){if(_0x3d7188){return _0x5544c6(_0x3d7188);}pm2[_0x5af9('0x4')]();return _0x574f6f(_0x3004bf);});});});};exports[_0x5af9('0x9')]=function(){return connect()[_0x5af9('0x3')](function(){return new BPromise(function(_0x23781b,_0x2ea18b){return pm2[_0x5af9('0x9')](function(_0x30a504){if(_0x30a504){return _0x2ea18b(_0x30a504);}return _0x23781b('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index dc39645..b2062d0 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 _0x405b=['system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../config/environment','../logger','schedule','defaults','redis','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update'];(function(_0x4517cf,_0x3aaaca){var _0x408bf4=function(_0x387a57){while(--_0x387a57){_0x4517cf['push'](_0x4517cf['shift']());}};_0x408bf4(++_0x3aaaca);}(_0x405b,0x125));var _0xb405=function(_0x326529,_0x436250){_0x326529=_0x326529-0x0;var _0x18f7c1=_0x405b[_0x326529];return _0x18f7c1;};'use strict';var _=require('lodash');var moment=require(_0xb405('0x0'));var Redis=require('ioredis');var util=require(_0xb405('0x1'));var config=require(_0xb405('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xb405('0x3'))(_0xb405('0x4'));config['redis']=_[_0xb405('0x5')](config[_0xb405('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb405('0x7'))(new Redis(config[_0xb405('0x6')]));function closeInteractions(){var _0x16d906=0x0;var _0xc0ddcd=[];return db[_0xb405('0x8')][_0xb405('0x9')]({'raw':!![],'attributes':['id',_0xb405('0xa')],'where':{'id':0x1}})[_0xb405('0xb')](function(_0x125ee0){_0x16d906=_0x125ee0[_0xb405('0xa')];if(_0x16d906){return db[_0xb405('0xc')][_0xb405('0xd')]({'raw':!![],'attributes':['id',_0xb405('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb405('0xf')](_0x125ee0[_0xb405('0xa')],_0xb405('0x10'))}}});}else{return[];}})['then'](function(_0x4e8cb1){if(_0x4e8cb1&&_0x4e8cb1['length']){_0xc0ddcd=_[_0xb405('0x11')](_0x4e8cb1||[],'id');logger[_0xb405('0x12')](_0xb405('0x13'),_0xc0ddcd[_0xb405('0x14')]());return db[_0xb405('0xc')][_0xb405('0x15')]({'closeReason':_0xb405('0x16'),'disposition':_0xb405('0x17'),'closed':!![],'closedAt':moment()[_0xb405('0x18')](_0xb405('0x19'))},{'where':{'id':_0xc0ddcd}});}})[_0xb405('0xb')](function(){if(_0xc0ddcd&&_0xc0ddcd[_0xb405('0x1a')]){logger[_0xb405('0x12')](_0xb405('0x1b'),_0xc0ddcd[_0xb405('0x14')]());for(var _0x38e574=0x0;_0x38e574<_0xc0ddcd[_0xb405('0x1a')];_0x38e574++){io[_0xb405('0x1c')](_0xb405('0x1d'),{'id':_0xc0ddcd[_0x38e574],'closed':!![]});}}})[_0xb405('0x1e')](function(_0x332db6){logger[_0xb405('0x1f')](_0xb405('0x20'),_0x332db6?util[_0xb405('0x21')](_0x332db6,{'showHidden':![],'depth':null}):'');});}exports[_0xb405('0x22')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb0d9=['schedule','redis','localhost','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','format','length','emit','chatInteraction:update','catch','error','inspect','start','ioredis','../../config/environment','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0d9,0x1a1));var _0x9b0d=function(_0x11b6bc,_0x5f129d){_0x11b6bc=_0x11b6bc-0x0;var _0xf03f7b=_0xb0d9[_0x11b6bc];return _0xf03f7b;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x9b0d('0x0'));var util=require('util');var config=require(_0x9b0d('0x1'));var db=require(_0x9b0d('0x2'))['db'];var logger=require('../logger')(_0x9b0d('0x3'));config[_0x9b0d('0x4')]=_['defaults'](config[_0x9b0d('0x4')],{'host':_0x9b0d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x394933=0x0;var _0x43c340=[];return db[_0x9b0d('0x6')][_0x9b0d('0x7')]({'raw':!![],'attributes':['id',_0x9b0d('0x8')],'where':{'id':0x1}})['then'](function(_0x1ef64c){_0x394933=_0x1ef64c['chatTimeout'];if(_0x394933){return db[_0x9b0d('0x9')][_0x9b0d('0xa')]({'raw':!![],'attributes':['id',_0x9b0d('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9b0d('0xc')](_0x1ef64c[_0x9b0d('0x8')],_0x9b0d('0xd'))}}});}else{return[];}})[_0x9b0d('0xe')](function(_0x5db28a){if(_0x5db28a&&_0x5db28a['length']){_0x43c340=_[_0x9b0d('0xf')](_0x5db28a||[],'id');logger[_0x9b0d('0x10')](_0x9b0d('0x11'),_0x43c340[_0x9b0d('0x12')]());return db[_0x9b0d('0x9')]['update']({'closeReason':_0x9b0d('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9b0d('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x43c340}});}})[_0x9b0d('0xe')](function(){if(_0x43c340&&_0x43c340[_0x9b0d('0x15')]){logger[_0x9b0d('0x10')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x43c340[_0x9b0d('0x12')]());for(var _0x486a5b=0x0;_0x486a5b<_0x43c340[_0x9b0d('0x15')];_0x486a5b++){io[_0x9b0d('0x16')](_0x9b0d('0x17'),{'id':_0x43c340[_0x486a5b],'closed':!![]});}}})[_0x9b0d('0x18')](function(_0x5cd332){logger[_0x9b0d('0x19')]('[CHAT]\x20Error\x20closing\x20interactions',_0x5cd332?util[_0x9b0d('0x1a')](_0x5cd332,{'showHidden':![],'depth':null}):'');});}exports[_0x9b0d('0x1b')]=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 859153a..04ca756 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 _0xaf37=['jobs','map','keyBy','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','toString','index','my\x20id','resolve','run\x20job','active','isBetween','startAt','endAt','add','start','add\x20cron','cron','update','update\x20cron','stop\x20cron','util','lodash','moment','cron-job-manager','jayson/promise','schedule','../../mysqldb','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','status','Sent','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','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','request','SendMail','then','error','error\x20mail','stringify','data','subtractNumber\x20null\x20or\x20undefined','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','no\x20report\x20id','Schedule','keys'];(function(_0x20d08e,_0x4cc575){var _0x2cbd12=function(_0x3de355){while(--_0x3de355){_0x20d08e['push'](_0x20d08e['shift']());}};_0x2cbd12(++_0x4cc575);}(_0xaf37,0x18b));var _0x7af3=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xaf37[_0x48b810];return _0x23c17d;};'use strict';var fs=require('fs');var util=require(_0x7af3('0x0'));var path=require('path');var _=require(_0x7af3('0x1'));var moment=require(_0x7af3('0x2'));var CronJobManager=require(_0x7af3('0x3'));var jayson=require(_0x7af3('0x4'));var BPromise=require('bluebird');var logger=require('../logger')(_0x7af3('0x5'));var db=require(_0x7af3('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7af3('0x7')][_0x7af3('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e43f1,_0xa4e5eb){return function(){logger[_0x7af3('0x9')](_0x7af3('0xa'),_0x1e43f1[_0x7af3('0xb')]);var _0x2f574e=!![];var _0x34e7ff={'tls':{'rejectUnauthorized':![]}};if(_0x1e43f1[_0x7af3('0xc')][_0x7af3('0xd')]['service']){_0x34e7ff[_0x7af3('0xe')]=_0x1e43f1[_0x7af3('0xc')][_0x7af3('0xd')][_0x7af3('0xe')];}else{_0x34e7ff[_0x7af3('0xf')]=_0x1e43f1[_0x7af3('0xc')][_0x7af3('0xd')]['host'];_0x34e7ff[_0x7af3('0x10')]=_0x1e43f1[_0x7af3('0xc')][_0x7af3('0xd')][_0x7af3('0x10')];_0x34e7ff[_0x7af3('0x11')]=_0x1e43f1['MailAccount'][_0x7af3('0xd')][_0x7af3('0x11')];}if(_0x1e43f1['MailAccount'][_0x7af3('0xd')][_0x7af3('0x12')]){_0x34e7ff[_0x7af3('0x13')]={'user':_0x1e43f1[_0x7af3('0xc')]['Smtp']['user'],'pass':_0x1e43f1[_0x7af3('0xc')][_0x7af3('0xd')]['pass']};}var _0x964365={'account':_0x34e7ff,'message':{'from':util[_0x7af3('0x14')](_0x7af3('0x15'),_0x1e43f1['MailAccount'][_0x7af3('0x16')],_0x1e43f1[_0x7af3('0xc')][_0x7af3('0xb')]||_0x1e43f1[_0x7af3('0xc')][_0x7af3('0xd')]['user']),'to':_0x1e43f1[_0x7af3('0xb')],'cc':_0x1e43f1['cc'],'bcc':_0x1e43f1[_0x7af3('0x17')],'subject':util[_0x7af3('0x14')](_0x7af3('0x18'),_0xa4e5eb[_0x7af3('0x16')],_0x1e43f1['subtractNumber'],_0x1e43f1[_0x7af3('0x19')])}};var _0x20a541=path[_0x7af3('0x1a')](__dirname,_0x7af3('0x1b'));var _0x31d271=_0xa4e5eb[_0x7af3('0x1c')];var _0x3bb807=util['format'](_0x7af3('0x1d'),path[_0x7af3('0x1e')](_0xa4e5eb[_0x7af3('0x1c')],path['extname'](_0xa4e5eb[_0x7af3('0x1c')])),_0x7af3('0x1f'));var _0x277bce=path[_0x7af3('0x1a')](_0x20a541,_0x31d271);var _0x4ae399=path[_0x7af3('0x1a')](_0x20a541,_0x3bb807);if(fs['existsSync'](_0x277bce)){_0xa4e5eb[_0x7af3('0x20')]=_0x7af3('0x21');_0x964365['message'][_0x7af3('0x22')]=[{'filename':_0x31d271,'path':_0x277bce}];_0x964365['message'][_0x7af3('0x23')]=util[_0x7af3('0x14')](_0x7af3('0x24'),JSON['stringify'](_0xa4e5eb,null,0x2));}else if(fs[_0x7af3('0x25')](_0x4ae399)){_0xa4e5eb['status']=_0x7af3('0x21');_0x964365[_0x7af3('0x26')][_0x7af3('0x22')]=[{'filename':_0x3bb807,'path':_0x4ae399}];}else{_0x964365[_0x7af3('0x26')][_0x7af3('0x23')]=_0x7af3('0x27');if(!_0x1e43f1[_0x7af3('0x28')]){_0x2f574e=![];logger[_0x7af3('0x9')](_0x7af3('0x29'));}}if(_0x2f574e){return client[_0x7af3('0x2a')](_0x7af3('0x2b'),_0x964365)[_0x7af3('0x2c')](function(_0x59b6d6){if(_0x59b6d6[_0x7af3('0x2d')]){return logger[_0x7af3('0x2d')](_0x7af3('0x2e'),JSON[_0x7af3('0x2f')](_0x59b6d6));}return logger[_0x7af3('0x9')]('email\x20sent');})['catch'](function(_0xbf9acf){return logger[_0x7af3('0x2d')]('error\x20mail',JSON['stringify'](_0xbf9acf));});}};}function handleError(){return function(_0x1ab6e4){return logger[_0x7af3('0x2d')](JSON['stringify'](_0x1ab6e4));};}function handleResult(_0x33a613){return function(_0x404962){logger[_0x7af3('0x9')](_0x7af3('0x30'),JSON[_0x7af3('0x2f')](_0x404962));if(_0x33a613[_0x7af3('0xc')]&&_0x33a613[_0x7af3('0xc')][_0x7af3('0xd')]&&!_['isNil'](_0x33a613[_0x7af3('0xb')])){setTimeout(handleSendEmail(_0x33a613,_0x404962),0x3c*0x3e8);}};}function handleJob(_0x227b5d){return function(){try{if(_['isNil'](_0x227b5d['subtractNumber'])){return logger['info'](_0x7af3('0x31'));}if(_[_0x7af3('0x32')](_0x227b5d[_0x7af3('0x19')])){return logger['info'](_0x7af3('0x33'));}var _0x1dae3a={'startDate':moment()[_0x7af3('0x34')](_0x227b5d[_0x7af3('0x35')],_0x227b5d[_0x7af3('0x19')])[_0x7af3('0x14')](_0x7af3('0x36')),'endDate':moment()[_0x7af3('0x14')](_0x7af3('0x36')),'type':_0x7af3('0x37'),'output':_0x227b5d[_0x7af3('0x38')],'name':_0x227b5d[_0x7af3('0x16')]};if(!_[_0x7af3('0x32')](_0x227b5d[_0x7af3('0x39')])){logger['info'](_0x7af3('0x3a'),_0x227b5d[_0x7af3('0x39')]);return analyticDefaultReportController[_0x7af3('0x3b')]({'id':_0x227b5d[_0x7af3('0x39')]},_0x1dae3a)[_0x7af3('0x2c')](handleResult(_0x227b5d))[_0x7af3('0x3c')](handleError());}if(!_[_0x7af3('0x32')](_0x227b5d[_0x7af3('0x3d')])){logger[_0x7af3('0x9')]('exec\x20custom\x20report\x20id:%s',_0x227b5d[_0x7af3('0x3d')]);return analyticCustomReportController[_0x7af3('0x3b')]({'id':_0x227b5d[_0x7af3('0x3d')]},_0x1dae3a)[_0x7af3('0x2c')](handleResult(_0x227b5d))[_0x7af3('0x3c')](handleError());}}catch(_0x13f70e){logger[_0x7af3('0x2d')](JSON[_0x7af3('0x2f')](_0x13f70e));}return logger['info'](_0x7af3('0x3e'));};}function getJobs(_0x5ecc2e){var _0xe6bd39={};if(_0x5ecc2e){_0xe6bd39['id']=_0x5ecc2e;}return db[_0x7af3('0x3f')]['findAll']({'where':_0xe6bd39,'include':[{'model':db['MailAccount'],'attributes':['id',_0x7af3('0x16'),_0x7af3('0xb')],'include':[{'model':db['MailServerOut'],'as':_0x7af3('0xd')}]}]})[_0x7af3('0x2c')](function(_0x586e02){var _0x183f66=_[_0x7af3('0x40')](manager[_0x7af3('0x41')]);var _0x1f2b5c=_[_0x7af3('0x42')](_0x586e02,function(_0x2bda62){return _0x2bda62['id']['toString']();});var _0x52099a=_[_0x7af3('0x43')](_0x586e02,function(_0x31ef97){return _0x31ef97['id']['toString']();});var _0x5827b1=_0x5ecc2e?_0x1f2b5c:_['difference'](_0x1f2b5c,_0x183f66);var _0x5b9377=_[_0x7af3('0x44')](_0x1f2b5c,_0x183f66);var _0x385247=_[_0x7af3('0x45')](_0x183f66,_0x1f2b5c);var _0x2efa7c;var _0x4c0ca6;for(_0x2efa7c=0x0;_0x2efa7c<_0x385247[_0x7af3('0x46')]&&!_0x5ecc2e;_0x2efa7c+=0x1){_0x4c0ca6=_0x385247[_0x2efa7c]['toString']();if(manager[_0x7af3('0x47')](_0x4c0ca6)){manager[_0x7af3('0x48')](_0x4c0ca6);manager[_0x7af3('0x49')](_0x4c0ca6);logger[_0x7af3('0x9')](_0x7af3('0x4a'),_0x4c0ca6);}}logger['info'](_0x7af3('0x4b'),JSON[_0x7af3('0x2f')](_0x5827b1));for(_0x2efa7c=0x0;_0x2efa7c<_0x5827b1[_0x7af3('0x46')];_0x2efa7c+=0x1){_0x4c0ca6=_0x5827b1[_0x2efa7c][_0x7af3('0x4c')]();logger[_0x7af3('0x9')](_0x7af3('0x4d'),_0x4c0ca6);if(_0x5ecc2e){logger[_0x7af3('0x9')](_0x7af3('0x4e'),_0x5ecc2e);logger[_0x7af3('0x9')](JSON[_0x7af3('0x2f')](_0x52099a[_0x4c0ca6]));BPromise[_0x7af3('0x4f')]()['then'](handleJob(_0x52099a[_0x4c0ca6]));logger[_0x7af3('0x9')](_0x7af3('0x50'),_0x52099a[_0x4c0ca6]['name'],_0x52099a[_0x4c0ca6]['cron']);}else if(_0x52099a[_0x4c0ca6]['cron']&&_0x52099a[_0x4c0ca6][_0x7af3('0x51')]&&moment()[_0x7af3('0x52')](_0x52099a[_0x4c0ca6][_0x7af3('0x53')],_0x52099a[_0x4c0ca6][_0x7af3('0x54')])){manager[_0x7af3('0x55')](_0x4c0ca6,_0x52099a[_0x4c0ca6]['cron'],handleJob(_0x52099a[_0x4c0ca6]));manager[_0x7af3('0x56')](_0x4c0ca6);logger['info'](_0x7af3('0x57'),_0x52099a[_0x4c0ca6][_0x7af3('0x16')],_0x52099a[_0x4c0ca6][_0x7af3('0x58')]);}else if(manager[_0x7af3('0x47')](_0x4c0ca6)){manager[_0x7af3('0x48')](_0x4c0ca6);manager[_0x7af3('0x49')](_0x4c0ca6);logger[_0x7af3('0x9')]('stop\x20cron',_0x52099a[_0x4c0ca6][_0x7af3('0x16')],_0x52099a[_0x4c0ca6]['cron']);}}for(_0x2efa7c=0x0,_0x4c0ca6;_0x2efa7c<_0x5b9377[_0x7af3('0x46')]&&!_0x5ecc2e;_0x2efa7c+=0x1){_0x4c0ca6=_0x5b9377[_0x2efa7c]['toString']();if(manager['exists'](_0x4c0ca6)){if(_0x52099a[_0x4c0ca6]['cron']&&_0x52099a[_0x4c0ca6][_0x7af3('0x51')]&&moment()[_0x7af3('0x52')](_0x52099a[_0x4c0ca6][_0x7af3('0x53')],_0x52099a[_0x4c0ca6][_0x7af3('0x54')])){manager[_0x7af3('0x59')](_0x4c0ca6,_0x52099a[_0x4c0ca6]['cron'],handleJob(_0x52099a[_0x4c0ca6]));logger['info'](_0x7af3('0x5a'),_0x52099a[_0x4c0ca6][_0x7af3('0x16')],_0x52099a[_0x4c0ca6][_0x7af3('0x58')]);}else{manager['stop'](_0x4c0ca6);manager[_0x7af3('0x49')](_0x4c0ca6);logger[_0x7af3('0x9')](_0x7af3('0x5b'),_0x52099a[_0x4c0ca6][_0x7af3('0x16')],_0x52099a[_0x4c0ca6][_0x7af3('0x58')]);}}}})[_0x7af3('0x3c')](function(_0x1fc60c){logger[_0x7af3('0x2d')](JSON[_0x7af3('0x2f')](_0x1fc60c));});}exports['run']=function(_0x379a90){return getJobs(_0x379a90);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xbbf6=['host','port','secure','authentication','auth','pass','format','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','attachments','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','data','subtractNumber\x20null\x20or\x20undefined','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','jobs','map','toString','difference','exists','deleteJob','length','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','update','update\x20cron','stop','stop\x20cron','path','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount'];(function(_0x2020fc,_0x5b34b1){var _0x32a732=function(_0x20aefd){while(--_0x20aefd){_0x2020fc['push'](_0x2020fc['shift']());}};_0x32a732(++_0x5b34b1);}(_0xbbf6,0xa4));var _0x6bbf=function(_0x28cf38,_0x3a342c){_0x28cf38=_0x28cf38-0x0;var _0x596a6e=_0xbbf6[_0x28cf38];return _0x596a6e;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x6bbf('0x0'));var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x6bbf('0x1'));var BPromise=require(_0x6bbf('0x2'));var logger=require(_0x6bbf('0x3'))(_0x6bbf('0x4'));var db=require(_0x6bbf('0x5'))['db'];var analyticCustomReportController=require(_0x6bbf('0x6'));var analyticDefaultReportController=require(_0x6bbf('0x7'));var client=jayson[_0x6bbf('0x8')][_0x6bbf('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x48549e,_0x17b9a5){return function(){logger[_0x6bbf('0xa')](_0x6bbf('0xb'),_0x48549e[_0x6bbf('0xc')]);var _0x509158=!![];var _0x42b168={'tls':{'rejectUnauthorized':![]}};if(_0x48549e['MailAccount'][_0x6bbf('0xd')]['service']){_0x42b168[_0x6bbf('0xe')]=_0x48549e[_0x6bbf('0xf')][_0x6bbf('0xd')][_0x6bbf('0xe')];}else{_0x42b168['host']=_0x48549e['MailAccount'][_0x6bbf('0xd')][_0x6bbf('0x10')];_0x42b168[_0x6bbf('0x11')]=_0x48549e[_0x6bbf('0xf')][_0x6bbf('0xd')][_0x6bbf('0x11')];_0x42b168[_0x6bbf('0x12')]=_0x48549e['MailAccount'][_0x6bbf('0xd')]['secure'];}if(_0x48549e[_0x6bbf('0xf')][_0x6bbf('0xd')][_0x6bbf('0x13')]){_0x42b168[_0x6bbf('0x14')]={'user':_0x48549e[_0x6bbf('0xf')][_0x6bbf('0xd')]['user'],'pass':_0x48549e[_0x6bbf('0xf')][_0x6bbf('0xd')][_0x6bbf('0x15')]};}var _0xe5419={'account':_0x42b168,'message':{'from':util[_0x6bbf('0x16')]('\x22%s\x22\x20<%s>',_0x48549e['MailAccount'][_0x6bbf('0x17')],_0x48549e[_0x6bbf('0xf')][_0x6bbf('0xc')]||_0x48549e[_0x6bbf('0xf')][_0x6bbf('0xd')]['user']),'to':_0x48549e[_0x6bbf('0xc')],'cc':_0x48549e['cc'],'bcc':_0x48549e[_0x6bbf('0x18')],'subject':util['format'](_0x6bbf('0x19'),_0x17b9a5[_0x6bbf('0x17')],_0x48549e['subtractNumber'],_0x48549e[_0x6bbf('0x1a')])}};var _0x3fde42=path[_0x6bbf('0x1b')](__dirname,_0x6bbf('0x1c'));var _0x232035=_0x17b9a5[_0x6bbf('0x1d')];var _0x5856a2=util['format'](_0x6bbf('0x1e'),path['basename'](_0x17b9a5[_0x6bbf('0x1d')],path[_0x6bbf('0x1f')](_0x17b9a5[_0x6bbf('0x1d')])),_0x6bbf('0x20'));var _0x26d879=path['join'](_0x3fde42,_0x232035);var _0x17264f=path[_0x6bbf('0x1b')](_0x3fde42,_0x5856a2);if(fs[_0x6bbf('0x21')](_0x26d879)){_0x17b9a5['status']=_0x6bbf('0x22');_0xe5419[_0x6bbf('0x23')]['attachments']=[{'filename':_0x232035,'path':_0x26d879}];_0xe5419[_0x6bbf('0x23')][_0x6bbf('0x24')]=util[_0x6bbf('0x16')](_0x6bbf('0x25'),JSON[_0x6bbf('0x26')](_0x17b9a5,null,0x2));}else if(fs[_0x6bbf('0x21')](_0x17264f)){_0x17b9a5[_0x6bbf('0x27')]=_0x6bbf('0x22');_0xe5419[_0x6bbf('0x23')][_0x6bbf('0x28')]=[{'filename':_0x5856a2,'path':_0x17264f}];}else{_0xe5419[_0x6bbf('0x23')][_0x6bbf('0x24')]=_0x6bbf('0x29');if(!_0x48549e[_0x6bbf('0x2a')]){_0x509158=![];logger[_0x6bbf('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x509158){return client[_0x6bbf('0x2b')](_0x6bbf('0x2c'),_0xe5419)[_0x6bbf('0x2d')](function(_0x574654){if(_0x574654[_0x6bbf('0x2e')]){return logger[_0x6bbf('0x2e')](_0x6bbf('0x2f'),JSON[_0x6bbf('0x26')](_0x574654));}return logger[_0x6bbf('0xa')](_0x6bbf('0x30'));})['catch'](function(_0x3f4163){return logger['error']('error\x20mail',JSON[_0x6bbf('0x26')](_0x3f4163));});}};}function handleError(){return function(_0x1fb050){return logger[_0x6bbf('0x2e')](JSON['stringify'](_0x1fb050));};}function handleResult(_0x4a1a8d){return function(_0x4a850b){logger['info'](_0x6bbf('0x31'),JSON['stringify'](_0x4a850b));if(_0x4a1a8d['MailAccount']&&_0x4a1a8d[_0x6bbf('0xf')]['Smtp']&&!_['isNil'](_0x4a1a8d[_0x6bbf('0xc')])){setTimeout(handleSendEmail(_0x4a1a8d,_0x4a850b),0x3c*0x3e8);}};}function handleJob(_0x463051){return function(){try{if(_['isNil'](_0x463051['subtractNumber'])){return logger[_0x6bbf('0xa')](_0x6bbf('0x32'));}if(_[_0x6bbf('0x33')](_0x463051[_0x6bbf('0x1a')])){return logger[_0x6bbf('0xa')](_0x6bbf('0x34'));}var _0x5a0b9d={'startDate':moment()[_0x6bbf('0x35')](_0x463051[_0x6bbf('0x36')],_0x463051[_0x6bbf('0x1a')])[_0x6bbf('0x16')](_0x6bbf('0x37')),'endDate':moment()[_0x6bbf('0x16')](_0x6bbf('0x37')),'type':_0x6bbf('0x38'),'output':_0x463051[_0x6bbf('0x39')],'name':_0x463051[_0x6bbf('0x17')]};if(!_[_0x6bbf('0x33')](_0x463051[_0x6bbf('0x3a')])){logger[_0x6bbf('0xa')](_0x6bbf('0x3b'),_0x463051[_0x6bbf('0x3a')]);return analyticDefaultReportController[_0x6bbf('0x3c')]({'id':_0x463051['DefaultReportId']},_0x5a0b9d)['then'](handleResult(_0x463051))[_0x6bbf('0x3d')](handleError());}if(!_[_0x6bbf('0x33')](_0x463051['CustomReportId'])){logger[_0x6bbf('0xa')](_0x6bbf('0x3e'),_0x463051[_0x6bbf('0x3f')]);return analyticCustomReportController[_0x6bbf('0x3c')]({'id':_0x463051[_0x6bbf('0x3f')]},_0x5a0b9d)[_0x6bbf('0x2d')](handleResult(_0x463051))['catch'](handleError());}}catch(_0x4515b4){logger[_0x6bbf('0x2e')](JSON[_0x6bbf('0x26')](_0x4515b4));}return logger['info'](_0x6bbf('0x40'));};}function getJobs(_0x29abd9){var _0x1f5bf9={};if(_0x29abd9){_0x1f5bf9['id']=_0x29abd9;}return db[_0x6bbf('0x41')][_0x6bbf('0x42')]({'where':_0x1f5bf9,'include':[{'model':db['MailAccount'],'attributes':['id',_0x6bbf('0x17'),_0x6bbf('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x6bbf('0xd')}]}]})['then'](function(_0x23f50b){var _0x51d237=_[_0x6bbf('0x43')](manager[_0x6bbf('0x44')]);var _0x79d560=_[_0x6bbf('0x45')](_0x23f50b,function(_0x56adb9){return _0x56adb9['id'][_0x6bbf('0x46')]();});var _0x18d538=_['keyBy'](_0x23f50b,function(_0x4d7ec4){return _0x4d7ec4['id'][_0x6bbf('0x46')]();});var _0x2df143=_0x29abd9?_0x79d560:_[_0x6bbf('0x47')](_0x79d560,_0x51d237);var _0x5568f3=_['intersection'](_0x79d560,_0x51d237);var _0x1254f0=_[_0x6bbf('0x47')](_0x51d237,_0x79d560);var _0x8ebe;var _0x516534;for(_0x8ebe=0x0;_0x8ebe<_0x1254f0['length']&&!_0x29abd9;_0x8ebe+=0x1){_0x516534=_0x1254f0[_0x8ebe][_0x6bbf('0x46')]();if(manager[_0x6bbf('0x48')](_0x516534)){manager['stop'](_0x516534);manager[_0x6bbf('0x49')](_0x516534);logger['info']('delete\x20cron',_0x516534);}}logger[_0x6bbf('0xa')]('toRun',JSON[_0x6bbf('0x26')](_0x2df143));for(_0x8ebe=0x0;_0x8ebe<_0x2df143[_0x6bbf('0x4a')];_0x8ebe+=0x1){_0x516534=_0x2df143[_0x8ebe][_0x6bbf('0x46')]();logger[_0x6bbf('0xa')]('index',_0x516534);if(_0x29abd9){logger[_0x6bbf('0xa')](_0x6bbf('0x4b'),_0x29abd9);logger[_0x6bbf('0xa')](JSON[_0x6bbf('0x26')](_0x18d538[_0x516534]));BPromise[_0x6bbf('0x4c')]()[_0x6bbf('0x2d')](handleJob(_0x18d538[_0x516534]));logger[_0x6bbf('0xa')](_0x6bbf('0x4d'),_0x18d538[_0x516534][_0x6bbf('0x17')],_0x18d538[_0x516534][_0x6bbf('0x4e')]);}else if(_0x18d538[_0x516534][_0x6bbf('0x4e')]&&_0x18d538[_0x516534][_0x6bbf('0x4f')]&&moment()[_0x6bbf('0x50')](_0x18d538[_0x516534][_0x6bbf('0x51')],_0x18d538[_0x516534][_0x6bbf('0x52')])){manager[_0x6bbf('0x53')](_0x516534,_0x18d538[_0x516534][_0x6bbf('0x4e')],handleJob(_0x18d538[_0x516534]));manager[_0x6bbf('0x54')](_0x516534);logger[_0x6bbf('0xa')](_0x6bbf('0x55'),_0x18d538[_0x516534]['name'],_0x18d538[_0x516534]['cron']);}else if(manager['exists'](_0x516534)){manager['stop'](_0x516534);manager['deleteJob'](_0x516534);logger[_0x6bbf('0xa')]('stop\x20cron',_0x18d538[_0x516534][_0x6bbf('0x17')],_0x18d538[_0x516534][_0x6bbf('0x4e')]);}}for(_0x8ebe=0x0,_0x516534;_0x8ebe<_0x5568f3[_0x6bbf('0x4a')]&&!_0x29abd9;_0x8ebe+=0x1){_0x516534=_0x5568f3[_0x8ebe]['toString']();if(manager['exists'](_0x516534)){if(_0x18d538[_0x516534][_0x6bbf('0x4e')]&&_0x18d538[_0x516534][_0x6bbf('0x4f')]&&moment()[_0x6bbf('0x50')](_0x18d538[_0x516534][_0x6bbf('0x51')],_0x18d538[_0x516534][_0x6bbf('0x52')])){manager[_0x6bbf('0x56')](_0x516534,_0x18d538[_0x516534]['cron'],handleJob(_0x18d538[_0x516534]));logger['info'](_0x6bbf('0x57'),_0x18d538[_0x516534][_0x6bbf('0x17')],_0x18d538[_0x516534][_0x6bbf('0x4e')]);}else{manager[_0x6bbf('0x58')](_0x516534);manager[_0x6bbf('0x49')](_0x516534);logger[_0x6bbf('0xa')](_0x6bbf('0x59'),_0x18d538[_0x516534]['name'],_0x18d538[_0x516534][_0x6bbf('0x4e')]);}}}})[_0x6bbf('0x3d')](function(_0x265455){logger[_0x6bbf('0x2e')](JSON[_0x6bbf('0x26')](_0x265455));});}exports['run']=function(_0x20757c){return getJobs(_0x20757c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 524bea5..72f2e04 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 _0x1131=['Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Negative','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','push','all','aws-sdk','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','transcribeName','data1','data2','transcribeRegion','then','info','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x1131,0x71));var _0x1113=function(_0xee3fcb,_0x5c210b){_0xee3fcb=_0xee3fcb-0x0;var _0x290091=_0x1131[_0xee3fcb];return _0x290091;};var _=require('lodash');var AWS=require(_0x1113('0x0'));var rp=require('request-promise');var util=require('util');var BPromise=require('bluebird');var db=require(_0x1113('0x1'))['db'];var logger=require(_0x1113('0x2'))(_0x1113('0x3'));function getTranscriptionJob(_0x3d255e,_0x2f8f72,_0xb514f9,_0x57dd30){return new Promise(function(_0x3880aa,_0x4e6389){var _0x1f76a7=new AWS['TranscribeService']({'accessKeyId':_0x2f8f72,'secretAccessKey':_0x3d255e,'region':_0xb514f9});_0x1f76a7['getTranscriptionJob']({'TranscriptionJobName':_0x57dd30},function(_0x458f86,_0x53a218){if(_0x458f86){return _0x4e6389(_0x458f86);}else{return _0x3880aa(_0x53a218);}});});}function sentiment(_0x44e3b5,_0x16ddba,_0x3e20dd,_0x36df92,_0x399e4c){return new Promise(function(_0x4deffb,_0x4da83a){var _0x37405f=new AWS[(_0x1113('0x4'))]({'accessKeyId':_0x16ddba,'secretAccessKey':_0x44e3b5,'region':_0x3e20dd});_0x37405f[_0x1113('0x5')]({'Text':_0x36df92,'LanguageCode':_0x399e4c['substring'](0x0,0x2)},function(_0x3658ec,_0xc0b564){if(_0x3658ec){return _0x4da83a(_0x3658ec);}else{return _0x4deffb(_0xc0b564);}});});}function checkTranscribeJob(_0x4e4387,_0x31a919,_0x31b550){var _0x26bf52;return new BPromise(function(_0x3b929e,_0x517a7e){logger['info'](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x4e4387['id'],_0x4e4387[_0x1113('0x6')]));return getTranscriptionJob(_0x31b550[_0x1113('0x7')],_0x31b550[_0x1113('0x8')],_0x31a919[_0x1113('0x9')],_0x4e4387['transcribeName'])[_0x1113('0xa')](function(_0x1f7537){logger[_0x1113('0xb')](util[_0x1113('0xc')](_0x1113('0xd'),_0x4e4387['id'],_0x4e4387[_0x1113('0x6')],_0x1f7537[_0x1113('0xe')][_0x1113('0xf')]));if(!_0x4e4387[_0x1113('0x10')]){switch(_0x1f7537[_0x1113('0xe')]['TranscriptionJobStatus']){case _0x1113('0x11'):var _0x4d3cbe={'transcribeStatus':_0x1f7537[_0x1113('0xe')]['TranscriptionJobStatus'],'fileUri':_0x1f7537[_0x1113('0xe')][_0x1113('0x12')]['TranscriptFileUri']};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x4e4387['id']));return rp({'uri':_0x1f7537[_0x1113('0xe')][_0x1113('0x12')][_0x1113('0x13')],'json':!![]})[_0x1113('0xa')](function(_0x1ab3ef){logger[_0x1113('0xb')](util[_0x1113('0xc')](_0x1113('0x14'),_0x4e4387['id']));if(_0x1ab3ef&&_0x1ab3ef[_0x1113('0x15')]&&_0x1ab3ef['results'][_0x1113('0x16')]&&_0x1ab3ef[_0x1113('0x15')][_0x1113('0x16')]['length']){_0x4d3cbe[_0x1113('0x10')]='';for(var _0x4d49bb=0x0;_0x4d49bb<_0x1ab3ef[_0x1113('0x15')][_0x1113('0x16')][_0x1113('0x17')];_0x4d49bb++){_0x4d3cbe[_0x1113('0x10')]+=_0x1ab3ef['results'][_0x1113('0x16')][_0x4d49bb][_0x1113('0x18')]+'';}}return _0x4e4387[_0x1113('0x19')](_0x4d3cbe);})[_0x1113('0xa')](function(){logger['info'](util[_0x1113('0xc')](_0x1113('0x1a'),_0x4e4387['id']));if(!_0x4e4387[_0x1113('0x1b')]){throw new db['Sequelize'][(_0x1113('0x1c'))](_0x1113('0x1d'));}if(!_0x31a919[_0x1113('0x1e')]||!_0x31a919['sentimentAccountId']||!_0x31a919[_0x1113('0x1f')]||!_0x31a919[_0x1113('0x20')]||!_0x31a919[_0x1113('0x21')]){throw new db[(_0x1113('0x22'))][(_0x1113('0x1c'))](_0x1113('0x23'));}if(!_0x4d3cbe[_0x1113('0x10')]){throw new Error(_0x1113('0x24'));}if(_0x31a919[_0x1113('0x25')]===_0x31b550['id']){return _0x31b550;}else{return db[_0x1113('0x26')][_0x1113('0x27')]({'where':{'id':_settings[_0x1113('0x25')]}});}})['then'](function(_0x47d165){if(!_0x47d165){throw new db[(_0x1113('0x22'))][(_0x1113('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x47d165[_0x1113('0x7')]||!_0x47d165[_0x1113('0x8')]){throw new db['Sequelize'][(_0x1113('0x1c'))](_0x1113('0x28'));}_0x26bf52=_0x47d165;logger['info'](util[_0x1113('0xc')](_0x1113('0x29'),_0x4e4387['id']));return sentiment(_0x26bf52[_0x1113('0x7')],_0x26bf52[_0x1113('0x8')],_0x31a919['sentimentRegion'],_0x4d3cbe['fileText'],_0x31a919[_0x1113('0x20')]);})[_0x1113('0xa')](function(_0x494d69){logger[_0x1113('0xb')](util['format'](_0x1113('0x2a'),_0x4e4387['id']));return _0x4e4387[_0x1113('0x19')]({'sentiment':_0x494d69[_0x1113('0x2b')],'sPositive':_0x494d69[_0x1113('0x2c')][_0x1113('0x2d')],'sNegative':_0x494d69[_0x1113('0x2c')]['Negative'],'sMixed':_0x494d69[_0x1113('0x2c')]['Mixed'],'sNeutral':_0x494d69[_0x1113('0x2c')][_0x1113('0x2e')]});})['then'](function(){logger[_0x1113('0xb')](util['format'](_0x1113('0x1a'),_0x4e4387['id']));_0x3b929e();});case _0x1113('0x2f'):return _0x4e4387['update']({'transcribeStatus':_0x1113('0x2f'),'failureReason':_0x1f7537['TranscriptionJob'][_0x1113('0x30')]})[_0x1113('0xa')](function(){logger[_0x1113('0xb')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4e4387['id']));_0x3b929e();});default:logger[_0x1113('0xb')](util[_0x1113('0xc')](_0x1113('0x31'),_0x4e4387['id']));break;}}else{return BPromise[_0x1113('0x32')]()[_0x1113('0xa')](function(){if(!_0x4e4387[_0x1113('0x1b')]){throw new db[(_0x1113('0x22'))]['ValidationError'](_0x1113('0x1d'));}if(!_0x31a919[_0x1113('0x1e')]||!_0x31a919[_0x1113('0x25')]||!_0x31a919[_0x1113('0x1f')]||!_0x31a919['language']||!_0x31a919[_0x1113('0x21')]){throw new db['Sequelize'][(_0x1113('0x1c'))](_0x1113('0x23'));}if(!_0x4e4387[_0x1113('0x10')]){throw new Error(_0x1113('0x24'));}if(_0x31a919[_0x1113('0x25')]===_0x31b550['id']){return _0x31b550;}else{return db[_0x1113('0x26')][_0x1113('0x27')]({'where':{'id':_settings[_0x1113('0x25')]}});}})[_0x1113('0xa')](function(_0x258a23){if(!_0x258a23){throw new db['Sequelize'][(_0x1113('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x258a23['data1']||!_0x258a23['data2']){throw new db[(_0x1113('0x22'))][(_0x1113('0x1c'))](_0x1113('0x28'));}_0x26bf52=_0x258a23;logger[_0x1113('0xb')](util['format'](_0x1113('0x29'),_0x4e4387['id']));return sentiment(_0x26bf52['data1'],_0x26bf52[_0x1113('0x8')],_0x31a919[_0x1113('0x1f')],_0x4e4387[_0x1113('0x10')],_0x31a919[_0x1113('0x20')]);})['then'](function(_0x21a577){logger[_0x1113('0xb')](util['format'](_0x1113('0x2a'),_0x4e4387['id']));return _0x4e4387[_0x1113('0x19')]({'sentiment':_0x21a577['Sentiment'],'sPositive':_0x21a577[_0x1113('0x2c')][_0x1113('0x2d')],'sNegative':_0x21a577[_0x1113('0x2c')][_0x1113('0x33')],'sMixed':_0x21a577[_0x1113('0x2c')][_0x1113('0x34')],'sNeutral':_0x21a577[_0x1113('0x2c')]['Neutral'],'transcribeStatus':'COMPLETED'});})[_0x1113('0xa')](function(){logger[_0x1113('0xb')](util[_0x1113('0xc')](_0x1113('0x1a'),_0x4e4387['id']));_0x3b929e();});}})[_0x1113('0x35')](function(_0x969851){if(_0x969851){if(!_0x969851[_0x1113('0x36')]||_0x969851['name']!==_0x1113('0x37')){logger[_0x1113('0x38')](util[_0x1113('0xc')](_0x1113('0x39'),_0x4e4387['id']),util[_0x1113('0x3a')](_0x969851,{'showHidden':![],'depth':null}));}}_0x3b929e();});});}function checkTranscribe(){var _0x130a90;var _0xb8a1d6;var _0xcfe1c0;return db[_0x1113('0x3b')][_0x1113('0x3c')]({'where':{'transcribeStatus':_0x1113('0x3d')}})[_0x1113('0xa')](function(_0xc078c){if(!_0xc078c||!_0xc078c[_0x1113('0x17')]){throw new db[(_0x1113('0x22'))][(_0x1113('0x1c'))](_0x1113('0x3e'));}_0x130a90=_0xc078c;return db[_0x1113('0x3f')][_0x1113('0x27')]({'where':{'id':0x1}});})[_0x1113('0xa')](function(_0x54f9e1){if(!_0x54f9e1){throw new db[(_0x1113('0x22'))][(_0x1113('0x1c'))](_0x1113('0x40'));}_0xb8a1d6=_0x54f9e1;if(!_0xb8a1d6[_0x1113('0x3')]||!_0xb8a1d6[_0x1113('0x41')]||!_0xb8a1d6[_0x1113('0x9')]||!_0xb8a1d6['language']||!_0xb8a1d6[_0x1113('0x21')]){throw new db[(_0x1113('0x22'))]['ValidationError'](_0x1113('0x42'));}return db['CloudProvider'][_0x1113('0x27')]({'where':{'id':_0xb8a1d6[_0x1113('0x41')]}});})['then'](function(_0x502f86){if(!_0x502f86){throw new db[(_0x1113('0x22'))][(_0x1113('0x1c'))](_0x1113('0x43'));}if(!_0x502f86[_0x1113('0x7')]||!_0x502f86['data2']){throw new db[(_0x1113('0x22'))][(_0x1113('0x1c'))]('Cloud\x20Provider\x20not\x20configured');}_0xcfe1c0=_0x502f86;var _0x57f6de=[];_0x130a90[_0x1113('0x44')](function(_0x33ac27){_0x57f6de[_0x1113('0x45')](checkTranscribeJob(_0x33ac27,_0xb8a1d6,_0xcfe1c0));});return BPromise[_0x1113('0x46')](_0x57f6de);})[_0x1113('0x35')](function(_0x4a2705){if(_0x4a2705){if(!_0x4a2705[_0x1113('0x36')]||_0x4a2705[_0x1113('0x36')]!==_0x1113('0x37')){logger[_0x1113('0x38')](util['inspect'](_0x4a2705,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x74f4=['sentimentAccountId','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','sentiment','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribe','transcribeAccountId','all','start','lodash','aws-sdk','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','info','then','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','results','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available'];(function(_0x158bfe,_0x42a9f3){var _0x1bffb7=function(_0x31d2ae){while(--_0x31d2ae){_0x158bfe['push'](_0x158bfe['shift']());}};_0x1bffb7(++_0x42a9f3);}(_0x74f4,0xaa));var _0x474f=function(_0x6e9222,_0x2b455d){_0x6e9222=_0x6e9222-0x0;var _0x78ae92=_0x74f4[_0x6e9222];return _0x78ae92;};var _=require(_0x474f('0x0'));var AWS=require(_0x474f('0x1'));var rp=require('request-promise');var util=require(_0x474f('0x2'));var BPromise=require(_0x474f('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x474f('0x4'))('transcribe');function getTranscriptionJob(_0x1e5962,_0x978477,_0x301664,_0x503ad4){return new Promise(function(_0x5b6d20,_0x119d22){var _0x3344a5=new AWS[(_0x474f('0x5'))]({'accessKeyId':_0x978477,'secretAccessKey':_0x1e5962,'region':_0x301664});_0x3344a5[_0x474f('0x6')]({'TranscriptionJobName':_0x503ad4},function(_0x461707,_0x18fdc1){if(_0x461707){return _0x119d22(_0x461707);}else{return _0x5b6d20(_0x18fdc1);}});});}function sentiment(_0x3b06be,_0x3f3e70,_0x322d95,_0x403d67,_0x52c8a5){return new Promise(function(_0x38779f,_0x16edb5){var _0xd02110=new AWS['Comprehend']({'accessKeyId':_0x3f3e70,'secretAccessKey':_0x3b06be,'region':_0x322d95});_0xd02110[_0x474f('0x7')]({'Text':_0x403d67,'LanguageCode':_0x52c8a5[_0x474f('0x8')](0x0,0x2)},function(_0x150e48,_0x599aed){if(_0x150e48){return _0x16edb5(_0x150e48);}else{return _0x38779f(_0x599aed);}});});}function checkTranscribeJob(_0x73a0cf,_0x3c44d1,_0x5e2235){var _0xb3eb13;return new BPromise(function(_0x30ba8d,_0x30a358){logger['info'](util[_0x474f('0x9')](_0x474f('0xa'),_0x73a0cf['id'],_0x73a0cf[_0x474f('0xb')]));return getTranscriptionJob(_0x5e2235[_0x474f('0xc')],_0x5e2235[_0x474f('0xd')],_0x3c44d1[_0x474f('0xe')],_0x73a0cf[_0x474f('0xb')])['then'](function(_0xe4b5d3){logger['info'](util[_0x474f('0x9')](_0x474f('0xf'),_0x73a0cf['id'],_0x73a0cf['transcribeName'],_0xe4b5d3[_0x474f('0x10')]['TranscriptionJobStatus']));if(!_0x73a0cf[_0x474f('0x11')]){switch(_0xe4b5d3[_0x474f('0x10')][_0x474f('0x12')]){case _0x474f('0x13'):var _0x3a05b9={'transcribeStatus':_0xe4b5d3['TranscriptionJob'][_0x474f('0x12')],'fileUri':_0xe4b5d3[_0x474f('0x10')][_0x474f('0x14')][_0x474f('0x15')]};logger[_0x474f('0x16')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x73a0cf['id']));return rp({'uri':_0xe4b5d3[_0x474f('0x10')][_0x474f('0x14')]['TranscriptFileUri'],'json':!![]})[_0x474f('0x17')](function(_0x5bf9dd){logger[_0x474f('0x16')](util[_0x474f('0x9')](_0x474f('0x18'),_0x73a0cf['id']));if(_0x5bf9dd&&_0x5bf9dd['results']&&_0x5bf9dd['results'][_0x474f('0x19')]&&_0x5bf9dd[_0x474f('0x1a')]['transcripts'][_0x474f('0x1b')]){_0x3a05b9[_0x474f('0x11')]='';for(var _0x2e4c82=0x0;_0x2e4c82<_0x5bf9dd[_0x474f('0x1a')][_0x474f('0x19')][_0x474f('0x1b')];_0x2e4c82++){_0x3a05b9['fileText']+=_0x5bf9dd[_0x474f('0x1a')][_0x474f('0x19')][_0x2e4c82][_0x474f('0x1c')]+'';}}return _0x73a0cf[_0x474f('0x1d')](_0x3a05b9);})[_0x474f('0x17')](function(){logger[_0x474f('0x16')](util['format'](_0x474f('0x1e'),_0x73a0cf['id']));if(!_0x73a0cf[_0x474f('0x1f')]){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x22'));}if(!_0x3c44d1['sentiment']||!_0x3c44d1['sentimentAccountId']||!_0x3c44d1[_0x474f('0x23')]||!_0x3c44d1[_0x474f('0x24')]||!_0x3c44d1[_0x474f('0x25')]){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x26'));}if(!_0x3a05b9['fileText']){throw new Error(_0x474f('0x27'));}if(_0x3c44d1[_0x474f('0x28')]===_0x5e2235['id']){return _0x5e2235;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x474f('0x28')]}});}})['then'](function(_0x12668f){if(!_0x12668f){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x29'));}if(!_0x12668f[_0x474f('0xc')]||!_0x12668f[_0x474f('0xd')]){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x2a'));}_0xb3eb13=_0x12668f;logger[_0x474f('0x16')](util[_0x474f('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x73a0cf['id']));return sentiment(_0xb3eb13[_0x474f('0xc')],_0xb3eb13[_0x474f('0xd')],_0x3c44d1[_0x474f('0x23')],_0x3a05b9[_0x474f('0x11')],_0x3c44d1[_0x474f('0x24')]);})[_0x474f('0x17')](function(_0x269fbb){logger[_0x474f('0x16')](util[_0x474f('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x73a0cf['id']));return _0x73a0cf['update']({'sentiment':_0x269fbb['Sentiment'],'sPositive':_0x269fbb[_0x474f('0x2b')]['Positive'],'sNegative':_0x269fbb['SentimentScore'][_0x474f('0x2c')],'sMixed':_0x269fbb[_0x474f('0x2b')][_0x474f('0x2d')],'sNeutral':_0x269fbb['SentimentScore'][_0x474f('0x2e')]});})['then'](function(){logger[_0x474f('0x16')](util[_0x474f('0x9')](_0x474f('0x1e'),_0x73a0cf['id']));_0x30ba8d();});case _0x474f('0x2f'):return _0x73a0cf[_0x474f('0x1d')]({'transcribeStatus':_0x474f('0x2f'),'failureReason':_0xe4b5d3[_0x474f('0x10')][_0x474f('0x30')]})[_0x474f('0x17')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x73a0cf['id']));_0x30ba8d();});default:logger[_0x474f('0x16')](util[_0x474f('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x73a0cf['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x73a0cf[_0x474f('0x1f')]){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x22'));}if(!_0x3c44d1[_0x474f('0x31')]||!_0x3c44d1[_0x474f('0x28')]||!_0x3c44d1[_0x474f('0x23')]||!_0x3c44d1[_0x474f('0x24')]||!_0x3c44d1['bucket']){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x26'));}if(!_0x73a0cf['fileText']){throw new Error(_0x474f('0x27'));}if(_0x3c44d1[_0x474f('0x28')]===_0x5e2235['id']){return _0x5e2235;}else{return db[_0x474f('0x32')]['findOne']({'where':{'id':_settings[_0x474f('0x28')]}});}})[_0x474f('0x17')](function(_0x35cad7){if(!_0x35cad7){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x29'));}if(!_0x35cad7[_0x474f('0xc')]||!_0x35cad7[_0x474f('0xd')]){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x2a'));}_0xb3eb13=_0x35cad7;logger[_0x474f('0x16')](util[_0x474f('0x9')](_0x474f('0x33'),_0x73a0cf['id']));return sentiment(_0xb3eb13[_0x474f('0xc')],_0xb3eb13[_0x474f('0xd')],_0x3c44d1[_0x474f('0x23')],_0x73a0cf['fileText'],_0x3c44d1[_0x474f('0x24')]);})[_0x474f('0x17')](function(_0x755054){logger[_0x474f('0x16')](util[_0x474f('0x9')](_0x474f('0x34'),_0x73a0cf['id']));return _0x73a0cf['update']({'sentiment':_0x755054[_0x474f('0x35')],'sPositive':_0x755054['SentimentScore']['Positive'],'sNegative':_0x755054[_0x474f('0x2b')]['Negative'],'sMixed':_0x755054[_0x474f('0x2b')]['Mixed'],'sNeutral':_0x755054[_0x474f('0x2b')][_0x474f('0x2e')],'transcribeStatus':_0x474f('0x13')});})[_0x474f('0x17')](function(){logger[_0x474f('0x16')](util[_0x474f('0x9')](_0x474f('0x1e'),_0x73a0cf['id']));_0x30ba8d();});}})[_0x474f('0x36')](function(_0x287018){if(_0x287018){if(!_0x287018[_0x474f('0x37')]||_0x287018['name']!==_0x474f('0x38')){logger[_0x474f('0x39')](util['format'](_0x474f('0x3a'),_0x73a0cf['id']),util[_0x474f('0x3b')](_0x287018,{'showHidden':![],'depth':null}));}}_0x30ba8d();});});}function checkTranscribe(){var _0x32a971;var _0x407c76;var _0x39c95b;return db[_0x474f('0x3c')][_0x474f('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x474f('0x17')](function(_0xd9f31c){if(!_0xd9f31c||!_0xd9f31c[_0x474f('0x1b')]){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x3e'));}_0x32a971=_0xd9f31c;return db[_0x474f('0x3f')][_0x474f('0x40')]({'where':{'id':0x1}});})[_0x474f('0x17')](function(_0xa3477f){if(!_0xa3477f){throw new db[(_0x474f('0x20'))][(_0x474f('0x21'))](_0x474f('0x41'));}_0x407c76=_0xa3477f;if(!_0x407c76[_0x474f('0x42')]||!_0x407c76[_0x474f('0x43')]||!_0x407c76[_0x474f('0xe')]||!_0x407c76[_0x474f('0x24')]||!_0x407c76[_0x474f('0x25')]){throw new db['Sequelize'][(_0x474f('0x21'))]('Transcribe\x20not\x20configured');}return db[_0x474f('0x32')][_0x474f('0x40')]({'where':{'id':_0x407c76['transcribeAccountId']}});})[_0x474f('0x17')](function(_0x199796){if(!_0x199796){throw new db['Sequelize'][(_0x474f('0x21'))](_0x474f('0x29'));}if(!_0x199796[_0x474f('0xc')]||!_0x199796[_0x474f('0xd')]){throw new db['Sequelize'][(_0x474f('0x21'))](_0x474f('0x2a'));}_0x39c95b=_0x199796;var _0x1286b8=[];_0x32a971['forEach'](function(_0x14b956){_0x1286b8['push'](checkTranscribeJob(_0x14b956,_0x407c76,_0x39c95b));});return BPromise[_0x474f('0x44')](_0x1286b8);})[_0x474f('0x36')](function(_0x1d794c){if(_0x1d794c){if(!_0x1d794c[_0x474f('0x37')]||_0x1d794c[_0x474f('0x37')]!=='SequelizeValidationError'){logger[_0x474f('0x39')](util[_0x474f('0x3b')](_0x1d794c,{'showHidden':![],'depth':null}));}}});}exports[_0x474f('0x45')]=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 d290a63..240b56b 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 _0x4815=['catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../logger','schedule','defaults','redis','localhost','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update'];(function(_0x40c30d,_0x1d5a06){var _0xbce429=function(_0x227d76){while(--_0x227d76){_0x40c30d['push'](_0x40c30d['shift']());}};_0xbce429(++_0x1d5a06);}(_0x4815,0x1f1));var _0x5481=function(_0x2d8765,_0x4a7a3d){_0x2d8765=_0x2d8765-0x0;var _0x3d6ee8=_0x4815[_0x2d8765];return _0x3d6ee8;};'use strict';var _=require(_0x5481('0x0'));var moment=require('moment');var Redis=require(_0x5481('0x1'));var util=require(_0x5481('0x2'));var config=require(_0x5481('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x5481('0x4'))(_0x5481('0x5'));config['redis']=_[_0x5481('0x6')](config[_0x5481('0x7')],{'host':_0x5481('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5481('0x7')]));function closeInteractions(){var _0x558852=[];return db[_0x5481('0x9')]['findAll']({'raw':!![],'attributes':['id',_0x5481('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5481('0xb')](0x18,_0x5481('0xc'))}}})[_0x5481('0xd')](function(_0x3e8242){if(_0x3e8242&&_0x3e8242[_0x5481('0xe')]){_0x558852=_[_0x5481('0xf')](_0x3e8242||[],'id');logger[_0x5481('0x10')](_0x5481('0x11'),_0x558852[_0x5481('0x12')]());return db[_0x5481('0x9')][_0x5481('0x13')]({'closeReason':_0x5481('0x14'),'disposition':_0x5481('0x15'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x558852}});}})['then'](function(){if(_0x558852&&_0x558852[_0x5481('0xe')]){logger[_0x5481('0x10')](_0x5481('0x16'),_0x558852[_0x5481('0x12')]());for(var _0x453446=0x0;_0x453446<_0x558852[_0x5481('0xe')];_0x453446++){io[_0x5481('0x17')](_0x5481('0x18'),{'id':_0x558852[_0x453446],'closed':!![]});}}})[_0x5481('0x19')](function(_0x2862ec){logger['error'](_0x5481('0x1a'),_0x2862ec?util[_0x5481('0x1b')](_0x2862ec,{'showHidden':![],'depth':null}):'');});}exports[_0x5481('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6033=['../../config/environment','../logger','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','error','inspect','start','moment','util'];(function(_0x155af3,_0x4b7f9a){var _0x15a675=function(_0xec0188){while(--_0xec0188){_0x155af3['push'](_0x155af3['shift']());}};_0x15a675(++_0x4b7f9a);}(_0x6033,0x177));var _0x3603=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6033[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var moment=require(_0x3603('0x0'));var Redis=require('ioredis');var util=require(_0x3603('0x1'));var config=require(_0x3603('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x3603('0x3'))('schedule');config[_0x3603('0x4')]=_[_0x3603('0x5')](config[_0x3603('0x4')],{'host':_0x3603('0x6'),'port':0x18eb});var io=require(_0x3603('0x7'))(new Redis(config[_0x3603('0x4')]));function closeInteractions(){var _0x499eac=[];return db[_0x3603('0x8')][_0x3603('0x9')]({'raw':!![],'attributes':['id',_0x3603('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3603('0xb')](0x18,_0x3603('0xc'))}}})[_0x3603('0xd')](function(_0x2a8ae5){if(_0x2a8ae5&&_0x2a8ae5[_0x3603('0xe')]){_0x499eac=_['map'](_0x2a8ae5||[],'id');logger[_0x3603('0xf')](_0x3603('0x10'),_0x499eac['join']());return db[_0x3603('0x8')][_0x3603('0x11')]({'closeReason':_0x3603('0x12'),'disposition':_0x3603('0x13'),'closed':!![],'closedAt':moment()[_0x3603('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x499eac}});}})[_0x3603('0xd')](function(){if(_0x499eac&&_0x499eac[_0x3603('0xe')]){logger[_0x3603('0xf')](_0x3603('0x15'),_0x499eac[_0x3603('0x16')]());for(var _0x2dccaa=0x0;_0x2dccaa<_0x499eac['length'];_0x2dccaa++){io[_0x3603('0x17')](_0x3603('0x18'),{'id':_0x499eac[_0x2dccaa],'closed':!![]});}}})[_0x3603('0x19')](function(_0x1dd8fa){logger[_0x3603('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1dd8fa?util[_0x3603('0x1b')](_0x1dd8fa,{'showHidden':![],'depth':null}):'');});}exports[_0x3603('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index e2cfff8..4431776 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x972d=['Innocenzo','Biondo','push','now','innocenzo.biondo','@xcally.com','CmContact','then','bulkCreate','finished\x20populating','CmHopper','log','hopper1','catch','util','../mysqldb'];(function(_0x4c425d,_0x2c2c03){var _0xc5f718=function(_0x24e404){while(--_0x24e404){_0x4c425d['push'](_0x4c425d['shift']());}};_0xc5f718(++_0x2c2c03);}(_0x972d,0x17e));var _0xd972=function(_0x2a9e25,_0x78bb15){_0x2a9e25=_0x2a9e25-0x0;var _0x307944=_0x972d[_0x2a9e25];return _0x307944;};'use strict';var util=require(_0xd972('0x0'));var db=require(_0xd972('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xd972('0x2')+i,'lastName':_0xd972('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd972('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd972('0x5')](),'updatedAt':Date[_0xd972('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd972('0x4')]({'id':i,'firstName':_0xd972('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xd972('0x6')+i+_0xd972('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd972('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xd972('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xd972('0x5')]()});}db[_0xd972('0x8')]['destroy']({'where':{}})[_0xd972('0x9')](function(){return db[_0xd972('0x8')][_0xd972('0xa')](contacts);})[_0xd972('0x9')](function(){console['log'](_0xd972('0xb'),'contacts1');return db[_0xd972('0xc')]['destroy']({'where':{}});})['then'](function(){return db[_0xd972('0xc')][_0xd972('0xa')](hopper);})[_0xd972('0x9')](function(){console[_0xd972('0xd')](_0xd972('0xb'),_0xd972('0xe'));return db[_0xd972('0x8')][_0xd972('0xa')](contacts2);})['then'](function(){console['log'](_0xd972('0xb'),'contacts2');return db[_0xd972('0xc')][_0xd972('0xa')](hopper2);})[_0xd972('0x9')](function(){console['log']('finished\x20populating','hopper2');})[_0xd972('0xf')](function(_0x1533d4){console['log'](_0x1533d4);}); \ No newline at end of file +var _0xeff8=['../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','CmContact','destroy','then','bulkCreate','finished\x20populating','CmHopper','hopper1','log','contacts2','catch','util'];(function(_0x2813ea,_0x47434d){var _0x5d674a=function(_0x650b91){while(--_0x650b91){_0x2813ea['push'](_0x2813ea['shift']());}};_0x5d674a(++_0x47434d);}(_0xeff8,0x6b));var _0x8eff=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0xeff8[_0x3e3bee];return _0x3ae14c;};'use strict';var util=require(_0x8eff('0x0'));var db=require(_0x8eff('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8eff('0x2')]({'id':i,'firstName':_0x8eff('0x3')+i,'lastName':_0x8eff('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x8eff('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8eff('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x8eff('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8eff('0x6')](),'updatedAt':Date[_0x8eff('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8eff('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8eff('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x8eff('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8eff('0x6')](),'updatedAt':Date[_0x8eff('0x6')]()});}db[_0x8eff('0x8')][_0x8eff('0x9')]({'where':{}})[_0x8eff('0xa')](function(){return db[_0x8eff('0x8')][_0x8eff('0xb')](contacts);})[_0x8eff('0xa')](function(){console['log'](_0x8eff('0xc'),'contacts1');return db[_0x8eff('0xd')][_0x8eff('0x9')]({'where':{}});})[_0x8eff('0xa')](function(){return db[_0x8eff('0xd')]['bulkCreate'](hopper);})[_0x8eff('0xa')](function(){console['log']('finished\x20populating',_0x8eff('0xe'));return db[_0x8eff('0x8')][_0x8eff('0xb')](contacts2);})['then'](function(){console[_0x8eff('0xf')](_0x8eff('0xc'),_0x8eff('0x10'));return db[_0x8eff('0xd')][_0x8eff('0xb')](hopper2);})[_0x8eff('0xa')](function(){console[_0x8eff('0xf')]('finished\x20populating','hopper2');})[_0x8eff('0x11')](function(_0x2b1dc0){console['log'](_0x2b1dc0);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index bb7d3d8..4ab3b0e 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bbf=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','push','%s%s','format','agent','friend','udp','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x778740,_0x2640cc){var _0x5745f6=function(_0x5a928e){while(--_0x5a928e){_0x778740['push'](_0x778740['shift']());}};_0x5745f6(++_0x2640cc);}(_0x2bbf,0xbc));var _0xf2bb=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x2bbf[_0x13b02f];return _0x12e9a6;};'use strict';var util=require(_0xf2bb('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf2bb('0x1')]({'name':util['format'](_0xf2bb('0x2'),'agent',i),'fullname':util[_0xf2bb('0x3')](_0xf2bb('0x2'),_0xf2bb('0x4'),i),'email':util[_0xf2bb('0x3')]('%s%s@xcally.com',_0xf2bb('0x4'),i),'role':_0xf2bb('0x4'),'password':'password','internal':0xfa0+i,'type':_0xf2bb('0x5'),'transport':[_0xf2bb('0x6'),'ws','wss'],'disallow':['all'],'allow':[_0xf2bb('0x7')],'defaultuser':util[_0xf2bb('0x3')](_0xf2bb('0x2'),_0xf2bb('0x4'),i),'encryption':_0xf2bb('0x8'),'avpf':'yes','force_avp':_0xf2bb('0x8'),'icesupport':_0xf2bb('0x8'),'dtlsenable':_0xf2bb('0x8'),'dtlsverify':'no','dtlscertfile':_0xf2bb('0x9'),'dtlsprivatekey':_0xf2bb('0xa'),'dtlssetup':_0xf2bb('0xb'),'callerid':util[_0xf2bb('0x3')](_0xf2bb('0xc'),util[_0xf2bb('0x3')](_0xf2bb('0x2'),_0xf2bb('0x4'),i),0xfa0+i)});}db[_0xf2bb('0xd')][_0xf2bb('0xe')](users)[_0xf2bb('0xf')](function(){console[_0xf2bb('0x10')]('add\x20user');})[_0xf2bb('0x11')](function(_0x33c472){console[_0xf2bb('0x10')](_0x33c472);}); \ No newline at end of file +var _0x8098=['udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x3c50bf,_0x1d6e38){var _0x4ce646=function(_0x212555){while(--_0x212555){_0x3c50bf['push'](_0x3c50bf['shift']());}};_0x4ce646(++_0x1d6e38);}(_0x8098,0x15d));var _0x8809=function(_0x472dda,_0x16a82f){_0x472dda=_0x472dda-0x0;var _0x2b2cb7=_0x8098[_0x472dda];return _0x2b2cb7;};'use strict';var util=require(_0x8809('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8809('0x1')]({'name':util[_0x8809('0x2')]('%s%s','agent',i),'fullname':util[_0x8809('0x2')](_0x8809('0x3'),_0x8809('0x4'),i),'email':util[_0x8809('0x2')](_0x8809('0x5'),_0x8809('0x4'),i),'role':_0x8809('0x4'),'password':_0x8809('0x6'),'internal':0xfa0+i,'type':_0x8809('0x7'),'transport':[_0x8809('0x8'),'ws',_0x8809('0x9')],'disallow':[_0x8809('0xa')],'allow':[_0x8809('0xb')],'defaultuser':util['format'](_0x8809('0x3'),_0x8809('0x4'),i),'encryption':_0x8809('0xc'),'avpf':_0x8809('0xc'),'force_avp':_0x8809('0xc'),'icesupport':_0x8809('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x8809('0xd'),'dtlsprivatekey':_0x8809('0xe'),'dtlssetup':_0x8809('0xf'),'callerid':util[_0x8809('0x2')]('\x22%s\x22\x20<%s>',util[_0x8809('0x2')](_0x8809('0x3'),_0x8809('0x4'),i),0xfa0+i)});}db[_0x8809('0x10')][_0x8809('0x11')](users)['then'](function(){console[_0x8809('0x12')](_0x8809('0x13'));})[_0x8809('0x14')](function(_0x253daa){console['log'](_0x253daa);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index d37c63d..42e9835 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x110e=['join','connection','setMaxListeners','address','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','lodash','util','../mysqldb','./environment','name','Agents','User','telephone','agent','type','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','role','%s:queue:%s','length','format','user:%s','query','find','ChatInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','admin','voice:outbound','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:inbound','userProfileId','VoiceQueue','FaxQueue','MailQueues','WhatsappQueues','WhatsappQueue','Trunks','Campaign','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log'];(function(_0x1fc2be,_0x19668c){var _0x2df4c6=function(_0x331338){while(--_0x331338){_0x1fc2be['push'](_0x1fc2be['shift']());}};_0x2df4c6(++_0x19668c);}(_0x110e,0x68));var _0xe110=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x110e[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var BPromise=require('bluebird');var db=require(_0xe110('0x2'))['db'];var config=require(_0xe110('0x3'));var queryQueues={'attributes':['id',_0xe110('0x4')],'include':[{'as':_0xe110('0x5'),'model':db[_0xe110('0x6')],'attributes':['id','name','role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xe110('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xe110('0x4')],'where':{'role':_0xe110('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xe110('0x4'),_0xe110('0x9')],'where':{'type':_0xe110('0xa')}};function getAssociatedResources(_0x2eebc9,_0x2473cb,_0x3c194a){return db[_0xe110('0xb')]['findOne']({'where':{'name':_0x2eebc9,'userProfileId':_0x2473cb},'raw':!![]})[_0xe110('0xc')](function(_0x435722){if(_0x435722){if(_0x435722['autoAssociation']){switch(_0x2eebc9){case _0xe110('0xd'):case _0xe110('0xe'):case _0xe110('0xf'):case _0xe110('0x10'):case'MailQueues':case'OpenchannelQueues':case'WhatsappQueues':return db[_0x3c194a][_0xe110('0x11')](queryQueues);case _0xe110('0x12'):return db[_0x3c194a]['findAll'](queryTelephones);case'Trunks':return db[_0x3c194a]['findAll'](queryTrunks);case _0xe110('0x13'):return db[_0x3c194a][_0xe110('0x11')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xe110('0x14')],'where':{'sectionId':_0x435722['id']},'raw':!![]})['then'](function(_0x4653bb){if(_0x4653bb){var _0x32b1be={'where':{'id':_[_0xe110('0x15')](_0x4653bb,_0xe110('0x14'))},'raw':!![]};switch(_0x3c194a){case'User':_0x32b1be[_0xe110('0x16')][_0xe110('0x17')]='telephone';break;case'Campaign':_0x32b1be[_0xe110('0x16')]['type']=_0xe110('0xa');break;}return db[_0x3c194a][_0xe110('0x11')](_0x32b1be);}else{return[];}});}}else{return[];}})['then'](function(_0x81a9ff){return _0x81a9ff;});}function joinOrLeaveQueues(_0x20f470,_0x374298,_0x29a36d,_0x37e37c){_0x20f470[_0x374298](util['format'](_0xe110('0x18'),_0x29a36d,_0x37e37c[_0xe110('0x4')]));if(_0x37e37c['Agents']){for(var _0x250902=0x0;_0x250902<_0x37e37c[_0xe110('0x5')][_0xe110('0x19')];_0x250902+=0x1){_0x20f470[_0x374298](util[_0xe110('0x1a')](_0xe110('0x1b'),_0x37e37c[_0xe110('0x5')][_0x250902][_0xe110('0x4')]));}}}function joinOrLeave(_0x3de3df,_0x146986,_0x100697){var _0x2cef74;if(_0x3de3df['handshake'][_0xe110('0x1c')]['id']){db[_0xe110('0x6')][_0xe110('0x1d')]({'attributes':['id',_0xe110('0x4'),_0xe110('0x17'),'userProfileId'],'where':{'id':_0x3de3df['handshake'][_0xe110('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xe110('0x1e'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe110('0x1f')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe110('0x20')],'as':_0xe110('0x21'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x5b76ce){if(_0x5b76ce){_0x2cef74=_0x5b76ce;_0x3de3df[_0x146986](util['format'](_0xe110('0x1b'),_0x5b76ce[_0xe110('0x4')]));var _0x1a2d75=[];switch(_0x5b76ce[_0xe110('0x17')]){case _0xe110('0x22'):_0x3de3df[_0x146986]('voice:inbound');_0x3de3df[_0x146986](_0xe110('0x23'));if(queryQueues['hasOwnProperty'](_0xe110('0x24'))){delete queryQueues[_0xe110('0x24')];}_0x1a2d75[_0xe110('0x25')](db['VoiceQueue'][_0xe110('0x11')](queryQueues));_0x1a2d75[_0xe110('0x25')](db[_0xe110('0x26')]['findAll'](queryQueues));_0x1a2d75['push'](db['FaxQueue'][_0xe110('0x11')](queryQueues));_0x1a2d75[_0xe110('0x25')](db[_0xe110('0x27')][_0xe110('0x11')](queryQueues));_0x1a2d75[_0xe110('0x25')](db[_0xe110('0x28')][_0xe110('0x11')](queryQueues));_0x1a2d75[_0xe110('0x25')](db[_0xe110('0x29')]['findAll'](queryQueues));_0x1a2d75[_0xe110('0x25')](db['WhatsappQueue'][_0xe110('0x11')](queryQueues));_0x1a2d75['push'](db[_0xe110('0x6')]['findAll'](queryTelephones));_0x1a2d75['push'](db[_0xe110('0x2a')][_0xe110('0x11')](queryTrunks));_0x1a2d75[_0xe110('0x25')](db['Campaign']['findAll'](queryCampaigns));_0x1a2d75[_0xe110('0x25')](db[_0xe110('0x6')]['findAll'](queryAgents));break;case _0xe110('0x2b'):_0x3de3df[_0x146986](_0xe110('0x2c'));_0x3de3df[_0x146986](_0xe110('0x23'));_0x1a2d75[_0xe110('0x25')](getAssociatedResources(_0xe110('0xd'),_0x5b76ce[_0xe110('0x2d')],_0xe110('0x2e')));_0x1a2d75[_0xe110('0x25')](getAssociatedResources(_0xe110('0xe'),_0x5b76ce[_0xe110('0x2d')],'ChatQueue'));_0x1a2d75[_0xe110('0x25')](getAssociatedResources(_0xe110('0xf'),_0x5b76ce[_0xe110('0x2d')],_0xe110('0x2f')));_0x1a2d75[_0xe110('0x25')](getAssociatedResources(_0xe110('0x10'),_0x5b76ce[_0xe110('0x2d')],_0xe110('0x27')));_0x1a2d75[_0xe110('0x25')](getAssociatedResources(_0xe110('0x30'),_0x5b76ce[_0xe110('0x2d')],_0xe110('0x28')));_0x1a2d75[_0xe110('0x25')](getAssociatedResources('OpenchannelQueues',_0x5b76ce[_0xe110('0x2d')],_0xe110('0x29')));_0x1a2d75[_0xe110('0x25')](getAssociatedResources(_0xe110('0x31'),_0x5b76ce['userProfileId'],_0xe110('0x32')));_0x1a2d75[_0xe110('0x25')](getAssociatedResources('Telephones',_0x5b76ce['userProfileId'],_0xe110('0x6')));_0x1a2d75['push'](getAssociatedResources(_0xe110('0x33'),_0x5b76ce[_0xe110('0x2d')],_0xe110('0x2a')));_0x1a2d75[_0xe110('0x25')](getAssociatedResources(_0xe110('0x13'),_0x5b76ce['userProfileId'],_0xe110('0x34')));_0x1a2d75[_0xe110('0x25')](db[_0xe110('0x6')]['findAll'](queryAgents));break;case _0xe110('0x8'):_0x3de3df[_0x146986](_0xe110('0x2c'));_0x3de3df[_0x146986]('voice:outbound');_0x1a2d75[_0xe110('0x25')](_0x5b76ce[_0xe110('0x35')]({'attributes':['id',_0xe110('0x4')]}));_0x1a2d75['push'](_0x5b76ce[_0xe110('0x36')]({'attributes':['id',_0xe110('0x4')]}));_0x1a2d75['push'](_0x5b76ce[_0xe110('0x37')]({'attributes':['id','name']}));_0x1a2d75['push'](_0x5b76ce[_0xe110('0x38')]({'attributes':['id','name']}));_0x1a2d75[_0xe110('0x25')](_0x5b76ce['getMailQueues']({'attributes':['id','name']}));_0x1a2d75[_0xe110('0x25')](_0x5b76ce['getOpenchannelQueues']({'attributes':['id','name']}));_0x1a2d75['push'](_0x5b76ce[_0xe110('0x39')]({'attributes':['id',_0xe110('0x4')]}));break;}return BPromise[_0xe110('0x3a')](_0x1a2d75);}})[_0xe110('0xc')](function(_0x1be128){if(_0x1be128&&_0x1be128['length']){for(var _0x16e891=0x0;_0x16e891<_0x1be128[_0xe110('0x19')];_0x16e891+=0x1){for(var _0x4ed1ab=0x0;_0x4ed1ab<_0x1be128[_0x16e891][_0xe110('0x19')];_0x4ed1ab+=0x1){switch(_0x16e891){case 0x0:joinOrLeaveQueues(_0x3de3df,_0x146986,'voice',_0x1be128[_0x16e891][_0x4ed1ab]);break;case 0x1:joinOrLeaveQueues(_0x3de3df,_0x146986,_0xe110('0x3b'),_0x1be128[_0x16e891][_0x4ed1ab]);break;case 0x2:joinOrLeaveQueues(_0x3de3df,_0x146986,_0xe110('0x3c'),_0x1be128[_0x16e891][_0x4ed1ab]);break;case 0x3:joinOrLeaveQueues(_0x3de3df,_0x146986,_0xe110('0x3d'),_0x1be128[_0x16e891][_0x4ed1ab]);break;case 0x4:joinOrLeaveQueues(_0x3de3df,_0x146986,_0xe110('0x3e'),_0x1be128[_0x16e891][_0x4ed1ab]);break;case 0x5:joinOrLeaveQueues(_0x3de3df,_0x146986,_0xe110('0x3f'),_0x1be128[_0x16e891][_0x4ed1ab]);break;case 0x6:joinOrLeaveQueues(_0x3de3df,_0x146986,_0xe110('0x40'),_0x1be128[_0x16e891][_0x4ed1ab]);break;case 0x7:if(_0x2cef74[_0xe110('0x17')]!==_0xe110('0x8'))_0x3de3df[_0x146986](util[_0xe110('0x1a')](_0xe110('0x41'),_0x1be128[_0x16e891][_0x4ed1ab]['name']));break;case 0x8:if(_0x2cef74['role']!=='agent')_0x3de3df[_0x146986](util[_0xe110('0x1a')](_0xe110('0x42'),_0x1be128[_0x16e891][_0x4ed1ab]['name']));break;case 0x9:if(_0x2cef74['role']!==_0xe110('0x8'))_0x3de3df[_0x146986](util['format'](_0xe110('0x43'),_0x1be128[_0x16e891][_0x4ed1ab][_0xe110('0x9')],_0x1be128[_0x16e891][_0x4ed1ab][_0xe110('0x4')]));break;case 0xa:_0x3de3df[_0x146986](util['format'](_0xe110('0x1b'),_0x1be128[_0x16e891][_0x4ed1ab]['name']));break;}}}}})['then'](function(){if(_0x146986===_0xe110('0x44')){var _0x319417=_[_0xe110('0x15')](_0x2cef74['ChatInteractions'],'id');return _0x2cef74[_0xe110('0x45')](_0x319417)[_0xe110('0xc')](function(){for(var _0x75ad12=0x0;_0x75ad12<_0x319417[_0xe110('0x19')];_0x75ad12+=0x1){_0x100697['emit'](_0xe110('0x46'),{'ChatInteractionId':Number(_0x319417[_0x75ad12]),'UserId':Number(_0x2cef74['id'])});}});}})['then'](function(){if(_0x146986===_0xe110('0x44')){var _0x119dad=_[_0xe110('0x15')](_0x2cef74[_0xe110('0x47')],'id');return _0x2cef74[_0xe110('0x48')](_0x119dad)[_0xe110('0xc')](function(){for(var _0x2b6158=0x0;_0x2b6158<_0x119dad['length'];_0x2b6158+=0x1){_0x100697['emit'](_0xe110('0x49'),{'MailInteractionId':Number(_0x119dad[_0x2b6158]),'UserId':Number(_0x2cef74['id'])});}});}})['then'](function(){if(_0x146986===_0xe110('0x44')){var _0x2fc775=_['map'](_0x2cef74['FaxInteractions'],'id');return _0x2cef74[_0xe110('0x4a')](_0x2fc775)[_0xe110('0xc')](function(){for(var _0x2b7c06=0x0;_0x2b7c06<_0x2fc775[_0xe110('0x19')];_0x2b7c06+=0x1){_0x100697[_0xe110('0x4b')](_0xe110('0x4c'),{'FaxInteractionId':Number(_0x2fc775[_0x2b7c06]),'UserId':Number(_0x2cef74['id'])});}});}})[_0xe110('0xc')](function(){if(_0x146986===_0xe110('0x44')){var _0x30c6af=_[_0xe110('0x15')](_0x2cef74[_0xe110('0x4d')],'id');return _0x2cef74[_0xe110('0x4e')](_0x30c6af)[_0xe110('0xc')](function(){for(var _0x4a87a9=0x0;_0x4a87a9<_0x30c6af[_0xe110('0x19')];_0x4a87a9+=0x1){_0x100697['emit'](_0xe110('0x4f'),{'SmsInteractionId':Number(_0x30c6af[_0x4a87a9]),'UserId':Number(_0x2cef74['id'])});}});}})[_0xe110('0xc')](function(){if(_0x146986==='leave'){var _0x4a270e=_[_0xe110('0x15')](_0x2cef74['OpenchannelInteractions'],'id');return _0x2cef74[_0xe110('0x50')](_0x4a270e)[_0xe110('0xc')](function(){for(var _0x583106=0x0;_0x583106<_0x4a270e['length'];_0x583106+=0x1){_0x100697[_0xe110('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x4a270e[_0x583106]),'UserId':Number(_0x2cef74['id'])});}});}})[_0xe110('0xc')](function(){if(_0x146986===_0xe110('0x44')){var _0x21fc90=_[_0xe110('0x15')](_0x2cef74[_0xe110('0x51')],'id');return _0x2cef74[_0xe110('0x52')](_0x21fc90)[_0xe110('0xc')](function(){for(var _0x1ded3b=0x0;_0x1ded3b<_0x21fc90[_0xe110('0x19')];_0x1ded3b+=0x1){_0x100697['emit'](_0xe110('0x53'),{'WhatsappInteractionId':Number(_0x21fc90[_0x1ded3b]),'UserId':Number(_0x2cef74['id'])});}});}})[_0xe110('0x54')](function(_0x2d3702){_0x3de3df[_0xe110('0x55')](_0x2d3702);});}}function onDisconnect(_0x5975d7,_0x583843){joinOrLeave(_0x5975d7,_0xe110('0x44'),_0x583843);}function onConnect(_0x182f17){joinOrLeave(_0x182f17,_0xe110('0x56'));}exports['default']=function(_0x1d2d4f){_0x1d2d4f['on'](_0xe110('0x57'),function(_0x55f4c7){_0x55f4c7[_0xe110('0x58')](0x0);_0x55f4c7[_0xe110('0x59')]=_0x55f4c7['request']['connection'][_0xe110('0x5a')]+':'+_0x55f4c7['request'][_0xe110('0x57')][_0xe110('0x5b')];_0x55f4c7[_0xe110('0x5c')]=new Date();_0x55f4c7[_0xe110('0x55')]=function(_0x434523){console[_0xe110('0x55')](_0xe110('0x5d')+_0x55f4c7[_0xe110('0x5e')]['name']+'['+_0x55f4c7[_0xe110('0x59')]+']',_0x434523);};_0x55f4c7['on']('disconnect',function(){onDisconnect(_0x55f4c7,_0x1d2d4f);_0x55f4c7[_0xe110('0x55')]('DISCONNECTED');});onConnect(_0x55f4c7);_0x55f4c7[_0xe110('0x55')]('CONNECTED');});}; \ No newline at end of file +var _0x9494=['MailInteraction','MailInteractions','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','voice:outbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','user','voice:inbound','VoiceQueue','FaxQueues','FaxQueue','MailQueues','MailQueue','WhatsappQueues','Trunk','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','voice','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','map','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','leave','removeSmsInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','default','connection','setMaxListeners','address','request','remotePort','connectedAt','log','disconnect','lodash','util','../mysqldb','./environment','User','role','name','telephone','agent','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','format','%s:queue:%s','length','user:%s','Agents','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions'];(function(_0xe13924,_0x111d72){var _0x4c3973=function(_0x4d091d){while(--_0x4d091d){_0xe13924['push'](_0xe13924['shift']());}};_0x4c3973(++_0x111d72);}(_0x9494,0x1a7));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4949('0x0'));var util=require(_0x4949('0x1'));var BPromise=require('bluebird');var db=require(_0x4949('0x2'))['db'];var config=require(_0x4949('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x4949('0x4')],'attributes':['id','name',_0x4949('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4949('0x6')],'where':{'role':_0x4949('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4949('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4949('0x6'),_0x4949('0x9')],'where':{'type':_0x4949('0xa')}};function getAssociatedResources(_0x2d6793,_0x1cee67,_0x212cc8){return db[_0x4949('0xb')]['findOne']({'where':{'name':_0x2d6793,'userProfileId':_0x1cee67},'raw':!![]})[_0x4949('0xc')](function(_0x500856){if(_0x500856){if(_0x500856[_0x4949('0xd')]){switch(_0x2d6793){case _0x4949('0xe'):case _0x4949('0xf'):case'FaxQueues':case _0x4949('0x10'):case'MailQueues':case _0x4949('0x11'):case'WhatsappQueues':return db[_0x212cc8][_0x4949('0x12')](queryQueues);case _0x4949('0x13'):return db[_0x212cc8]['findAll'](queryTelephones);case _0x4949('0x14'):return db[_0x212cc8][_0x4949('0x12')](queryTrunks);case _0x4949('0x15'):return db[_0x212cc8][_0x4949('0x12')](queryCampaigns);}}else{return db[_0x4949('0x16')]['findAll']({'attributes':[_0x4949('0x17')],'where':{'sectionId':_0x500856['id']},'raw':!![]})[_0x4949('0xc')](function(_0x11537a){if(_0x11537a){var _0x3ae0af={'where':{'id':_['map'](_0x11537a,'resourceId')},'raw':!![]};switch(_0x212cc8){case _0x4949('0x4'):_0x3ae0af[_0x4949('0x18')][_0x4949('0x5')]=_0x4949('0x7');break;case _0x4949('0x19'):_0x3ae0af[_0x4949('0x18')][_0x4949('0x9')]=_0x4949('0xa');break;}return db[_0x212cc8]['findAll'](_0x3ae0af);}else{return[];}});}}else{return[];}})[_0x4949('0xc')](function(_0x7dbd75){return _0x7dbd75;});}function joinOrLeaveQueues(_0x44811b,_0x10b787,_0x2ce92a,_0x5affa5){_0x44811b[_0x10b787](util[_0x4949('0x1a')](_0x4949('0x1b'),_0x2ce92a,_0x5affa5[_0x4949('0x6')]));if(_0x5affa5['Agents']){for(var _0xdb6f15=0x0;_0xdb6f15<_0x5affa5['Agents'][_0x4949('0x1c')];_0xdb6f15+=0x1){_0x44811b[_0x10b787](util[_0x4949('0x1a')](_0x4949('0x1d'),_0x5affa5[_0x4949('0x1e')][_0xdb6f15][_0x4949('0x6')]));}}}function joinOrLeave(_0x2187f8,_0x278018,_0x1a4046){var _0x536180;if(_0x2187f8[_0x4949('0x1f')][_0x4949('0x20')]['id']){db[_0x4949('0x4')][_0x4949('0x21')]({'attributes':['id',_0x4949('0x6'),_0x4949('0x5'),_0x4949('0x22')],'where':{'id':_0x2187f8[_0x4949('0x1f')]['query']['id']},'include':[{'model':db[_0x4949('0x23')],'as':_0x4949('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x4949('0x25')],'as':_0x4949('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x4949('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4949('0x28')],'as':_0x4949('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x4949('0x2a')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x4949('0xc')](function(_0x22b0eb){if(_0x22b0eb){_0x536180=_0x22b0eb;_0x2187f8[_0x278018](util[_0x4949('0x1a')](_0x4949('0x1d'),_0x22b0eb[_0x4949('0x6')]));var _0x42de57=[];switch(_0x22b0eb[_0x4949('0x5')]){case'admin':_0x2187f8[_0x278018]('voice:inbound');_0x2187f8[_0x278018](_0x4949('0x2b'));if(queryQueues[_0x4949('0x2c')]('include')){delete queryQueues[_0x4949('0x2d')];}_0x42de57[_0x4949('0x2e')](db['VoiceQueue']['findAll'](queryQueues));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x2f')][_0x4949('0x12')](queryQueues));_0x42de57[_0x4949('0x2e')](db['FaxQueue'][_0x4949('0x12')](queryQueues));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x30')]['findAll'](queryQueues));_0x42de57['push'](db['MailQueue'][_0x4949('0x12')](queryQueues));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x31')][_0x4949('0x12')](queryQueues));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x32')][_0x4949('0x12')](queryQueues));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x4')][_0x4949('0x12')](queryTelephones));_0x42de57[_0x4949('0x2e')](db['Trunk']['findAll'](queryTrunks));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x19')][_0x4949('0x12')](queryCampaigns));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x4')][_0x4949('0x12')](queryAgents));break;case _0x4949('0x33'):_0x2187f8[_0x278018](_0x4949('0x34'));_0x2187f8[_0x278018](_0x4949('0x2b'));_0x42de57[_0x4949('0x2e')](getAssociatedResources(_0x4949('0xe'),_0x22b0eb['userProfileId'],_0x4949('0x35')));_0x42de57[_0x4949('0x2e')](getAssociatedResources(_0x4949('0xf'),_0x22b0eb[_0x4949('0x22')],'ChatQueue'));_0x42de57['push'](getAssociatedResources(_0x4949('0x36'),_0x22b0eb[_0x4949('0x22')],_0x4949('0x37')));_0x42de57[_0x4949('0x2e')](getAssociatedResources(_0x4949('0x10'),_0x22b0eb[_0x4949('0x22')],'SmsQueue'));_0x42de57['push'](getAssociatedResources(_0x4949('0x38'),_0x22b0eb[_0x4949('0x22')],_0x4949('0x39')));_0x42de57[_0x4949('0x2e')](getAssociatedResources(_0x4949('0x11'),_0x22b0eb[_0x4949('0x22')],'OpenchannelQueue'));_0x42de57[_0x4949('0x2e')](getAssociatedResources(_0x4949('0x3a'),_0x22b0eb[_0x4949('0x22')],_0x4949('0x32')));_0x42de57[_0x4949('0x2e')](getAssociatedResources(_0x4949('0x13'),_0x22b0eb[_0x4949('0x22')],_0x4949('0x4')));_0x42de57['push'](getAssociatedResources(_0x4949('0x14'),_0x22b0eb[_0x4949('0x22')],_0x4949('0x3b')));_0x42de57['push'](getAssociatedResources(_0x4949('0x15'),_0x22b0eb[_0x4949('0x22')],'Campaign'));_0x42de57[_0x4949('0x2e')](db[_0x4949('0x4')]['findAll'](queryAgents));break;case'agent':_0x2187f8[_0x278018](_0x4949('0x34'));_0x2187f8[_0x278018](_0x4949('0x2b'));_0x42de57[_0x4949('0x2e')](_0x22b0eb['getVoiceQueues']({'attributes':['id',_0x4949('0x6')]}));_0x42de57[_0x4949('0x2e')](_0x22b0eb[_0x4949('0x3c')]({'attributes':['id','name']}));_0x42de57[_0x4949('0x2e')](_0x22b0eb[_0x4949('0x3d')]({'attributes':['id',_0x4949('0x6')]}));_0x42de57['push'](_0x22b0eb[_0x4949('0x3e')]({'attributes':['id',_0x4949('0x6')]}));_0x42de57[_0x4949('0x2e')](_0x22b0eb['getMailQueues']({'attributes':['id','name']}));_0x42de57[_0x4949('0x2e')](_0x22b0eb['getOpenchannelQueues']({'attributes':['id',_0x4949('0x6')]}));_0x42de57[_0x4949('0x2e')](_0x22b0eb[_0x4949('0x3f')]({'attributes':['id',_0x4949('0x6')]}));break;}return BPromise['all'](_0x42de57);}})[_0x4949('0xc')](function(_0x2f5371){if(_0x2f5371&&_0x2f5371[_0x4949('0x1c')]){for(var _0x45e043=0x0;_0x45e043<_0x2f5371[_0x4949('0x1c')];_0x45e043+=0x1){for(var _0x29f34a=0x0;_0x29f34a<_0x2f5371[_0x45e043][_0x4949('0x1c')];_0x29f34a+=0x1){switch(_0x45e043){case 0x0:joinOrLeaveQueues(_0x2187f8,_0x278018,_0x4949('0x40'),_0x2f5371[_0x45e043][_0x29f34a]);break;case 0x1:joinOrLeaveQueues(_0x2187f8,_0x278018,'chat',_0x2f5371[_0x45e043][_0x29f34a]);break;case 0x2:joinOrLeaveQueues(_0x2187f8,_0x278018,_0x4949('0x41'),_0x2f5371[_0x45e043][_0x29f34a]);break;case 0x3:joinOrLeaveQueues(_0x2187f8,_0x278018,_0x4949('0x42'),_0x2f5371[_0x45e043][_0x29f34a]);break;case 0x4:joinOrLeaveQueues(_0x2187f8,_0x278018,_0x4949('0x43'),_0x2f5371[_0x45e043][_0x29f34a]);break;case 0x5:joinOrLeaveQueues(_0x2187f8,_0x278018,_0x4949('0x44'),_0x2f5371[_0x45e043][_0x29f34a]);break;case 0x6:joinOrLeaveQueues(_0x2187f8,_0x278018,'whatsapp',_0x2f5371[_0x45e043][_0x29f34a]);break;case 0x7:if(_0x536180[_0x4949('0x5')]!==_0x4949('0x8'))_0x2187f8[_0x278018](util[_0x4949('0x1a')](_0x4949('0x45'),_0x2f5371[_0x45e043][_0x29f34a]['name']));break;case 0x8:if(_0x536180[_0x4949('0x5')]!==_0x4949('0x8'))_0x2187f8[_0x278018](util['format'](_0x4949('0x46'),_0x2f5371[_0x45e043][_0x29f34a][_0x4949('0x6')]));break;case 0x9:if(_0x536180[_0x4949('0x5')]!==_0x4949('0x8'))_0x2187f8[_0x278018](util[_0x4949('0x1a')](_0x4949('0x47'),_0x2f5371[_0x45e043][_0x29f34a][_0x4949('0x9')],_0x2f5371[_0x45e043][_0x29f34a]['name']));break;case 0xa:_0x2187f8[_0x278018](util['format'](_0x4949('0x1d'),_0x2f5371[_0x45e043][_0x29f34a][_0x4949('0x6')]));break;}}}}})[_0x4949('0xc')](function(){if(_0x278018==='leave'){var _0x27fcd5=_['map'](_0x536180[_0x4949('0x24')],'id');return _0x536180['removeChatInteractions'](_0x27fcd5)[_0x4949('0xc')](function(){for(var _0x4e8455=0x0;_0x4e8455<_0x27fcd5[_0x4949('0x1c')];_0x4e8455+=0x1){_0x1a4046['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x27fcd5[_0x4e8455]),'UserId':Number(_0x536180['id'])});}});}})[_0x4949('0xc')](function(){if(_0x278018==='leave'){var _0x2e549e=_[_0x4949('0x48')](_0x536180[_0x4949('0x26')],'id');return _0x536180[_0x4949('0x49')](_0x2e549e)['then'](function(){for(var _0x38ecb0=0x0;_0x38ecb0<_0x2e549e[_0x4949('0x1c')];_0x38ecb0+=0x1){_0x1a4046[_0x4949('0x4a')](_0x4949('0x4b'),{'MailInteractionId':Number(_0x2e549e[_0x38ecb0]),'UserId':Number(_0x536180['id'])});}});}})['then'](function(){if(_0x278018==='leave'){var _0x1e10cd=_['map'](_0x536180[_0x4949('0x27')],'id');return _0x536180[_0x4949('0x4c')](_0x1e10cd)[_0x4949('0xc')](function(){for(var _0x198560=0x0;_0x198560<_0x1e10cd[_0x4949('0x1c')];_0x198560+=0x1){_0x1a4046['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1e10cd[_0x198560]),'UserId':Number(_0x536180['id'])});}});}})[_0x4949('0xc')](function(){if(_0x278018===_0x4949('0x4d')){var _0x7aad1a=_['map'](_0x536180['SmsInteractions'],'id');return _0x536180[_0x4949('0x4e')](_0x7aad1a)[_0x4949('0xc')](function(){for(var _0xf916ae=0x0;_0xf916ae<_0x7aad1a[_0x4949('0x1c')];_0xf916ae+=0x1){_0x1a4046[_0x4949('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x7aad1a[_0xf916ae]),'UserId':Number(_0x536180['id'])});}});}})['then'](function(){if(_0x278018===_0x4949('0x4d')){var _0x126c26=_[_0x4949('0x48')](_0x536180[_0x4949('0x29')],'id');return _0x536180['removeOpenchannelInteractions'](_0x126c26)['then'](function(){for(var _0x45d7e3=0x0;_0x45d7e3<_0x126c26[_0x4949('0x1c')];_0x45d7e3+=0x1){_0x1a4046[_0x4949('0x4a')](_0x4949('0x4f'),{'OpenchannelInteractionId':Number(_0x126c26[_0x45d7e3]),'UserId':Number(_0x536180['id'])});}});}})['then'](function(){if(_0x278018===_0x4949('0x4d')){var _0x44b3a3=_[_0x4949('0x48')](_0x536180[_0x4949('0x50')],'id');return _0x536180[_0x4949('0x51')](_0x44b3a3)[_0x4949('0xc')](function(){for(var _0x2e4953=0x0;_0x2e4953<_0x44b3a3[_0x4949('0x1c')];_0x2e4953+=0x1){_0x1a4046['emit'](_0x4949('0x52'),{'WhatsappInteractionId':Number(_0x44b3a3[_0x2e4953]),'UserId':Number(_0x536180['id'])});}});}})['catch'](function(_0x58f4a4){_0x2187f8['log'](_0x58f4a4);});}}function onDisconnect(_0x3b8100,_0x2d84f9){joinOrLeave(_0x3b8100,_0x4949('0x4d'),_0x2d84f9);}function onConnect(_0x558f9b){joinOrLeave(_0x558f9b,'join');}exports[_0x4949('0x53')]=function(_0xfb4b60){_0xfb4b60['on'](_0x4949('0x54'),function(_0x4b77e4){_0x4b77e4[_0x4949('0x55')](0x0);_0x4b77e4[_0x4949('0x56')]=_0x4b77e4[_0x4949('0x57')][_0x4949('0x54')]['remoteAddress']+':'+_0x4b77e4[_0x4949('0x57')][_0x4949('0x54')][_0x4949('0x58')];_0x4b77e4[_0x4949('0x59')]=new Date();_0x4b77e4[_0x4949('0x5a')]=function(_0x1f366b){console[_0x4949('0x5a')]('SocketIO\x20'+_0x4b77e4['nsp'][_0x4949('0x6')]+'['+_0x4b77e4[_0x4949('0x56')]+']',_0x1f366b);};_0x4b77e4['on'](_0x4949('0x5b'),function(){onDisconnect(_0x4b77e4,_0xfb4b60);_0x4b77e4[_0x4949('0x5a')]('DISCONNECTED');});onConnect(_0x4b77e4);_0x4b77e4[_0x4949('0x5a')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ea18f25..7dd40fd 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 _0x5d99=['get','motionChannel','resolve','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','contact','UserId','interface','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','channel','event','offlineMessage','opened','QueryTypes','format','AfterCreate','changed','closed','substatus','ContactId','AfterUpdate','User','fullname','email','internal','default','hasOwnProperty','model','hook','callback','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappMessage','FaxInteraction','Fax','FaxMessage','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','code','error','catch'];(function(_0x52a04b,_0x226f86){var _0x3a871b=function(_0x35a271){while(--_0x35a271){_0x52a04b['push'](_0x52a04b['shift']());}};_0x3a871b(++_0x226f86);}(_0x5d99,0x150));var _0x95d9=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x5d99[_0x34d275];return _0x1379cc;};'use strict';var util=require('util');var db=require(_0x95d9('0x0'))['db'];var jayson=require(_0x95d9('0x1'));var logger=require(_0x95d9('0x2'))(_0x95d9('0x3'));var client=jayson[_0x95d9('0x4')][_0x95d9('0x5')]({'port':0x232a});var triggers=[{'channel':_0x95d9('0x6'),'model':_0x95d9('0x7'),'event':_0x95d9('0x8'),'condition':_0x95d9('0x9'),'callback':afterCreate},{'channel':_0x95d9('0x6'),'model':_0x95d9('0x7'),'event':_0x95d9('0xa'),'condition':_0x95d9('0xb'),'callback':afterUpdate},{'channel':'Chat','model':_0x95d9('0xc'),'event':_0x95d9('0x8'),'condition':_0x95d9('0xd'),'callback':afterCreateMessage},{'channel':'Chat','model':'ChatOfflineMessage','event':_0x95d9('0x8'),'condition':_0x95d9('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x95d9('0xe'),'model':_0x95d9('0xf'),'event':_0x95d9('0x8'),'condition':_0x95d9('0x9'),'callback':afterCreate},{'channel':'Sms','model':_0x95d9('0xf'),'event':'afterUpdate','condition':_0x95d9('0xb'),'callback':afterUpdate},{'channel':_0x95d9('0xe'),'model':'SmsMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x95d9('0x10'),'model':'WhatsappInteraction','event':'afterCreate','condition':_0x95d9('0x9'),'callback':afterCreate},{'channel':_0x95d9('0x10'),'model':'WhatsappInteraction','event':_0x95d9('0xa'),'condition':_0x95d9('0xb'),'callback':afterUpdate},{'channel':_0x95d9('0x10'),'model':_0x95d9('0x11'),'event':_0x95d9('0x8'),'condition':_0x95d9('0xd'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x95d9('0x12'),'event':'afterCreate','condition':_0x95d9('0x9'),'callback':afterCreate},{'channel':_0x95d9('0x13'),'model':'FaxInteraction','event':'afterUpdate','condition':_0x95d9('0xb'),'callback':afterUpdate},{'channel':_0x95d9('0x13'),'model':_0x95d9('0x14'),'event':'afterCreate','condition':_0x95d9('0xd'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x95d9('0x15'),'event':_0x95d9('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':'afterUpdate','condition':_0x95d9('0xb'),'callback':afterUpdate},{'channel':'Mail','model':_0x95d9('0x16'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x95d9('0x17'),'model':_0x95d9('0x18'),'event':_0x95d9('0x8'),'condition':_0x95d9('0x9'),'callback':afterCreate},{'channel':_0x95d9('0x17'),'model':_0x95d9('0x18'),'event':'afterUpdate','condition':_0x95d9('0xb'),'callback':afterUpdate},{'channel':_0x95d9('0x17'),'model':_0x95d9('0x19'),'event':_0x95d9('0x8'),'condition':_0x95d9('0xd'),'callback':afterCreateMessage}];function request(_0x481897){return client[_0x95d9('0x1a')](_0x95d9('0x1b'),_0x481897)[_0x95d9('0x1c')](function(_0x26820d){logger[_0x95d9('0x1d')](_0x95d9('0x1e'),_0x95d9('0x1b'),_0x26820d);if(_0x26820d['error']){if(_0x26820d['error'][_0x95d9('0x1f')]===0x1f4){logger[_0x95d9('0x20')](_0x95d9('0x1e'),_0x95d9('0x1b'),_0x26820d['error']);}}})[_0x95d9('0x21')](function(_0x1f16f2){logger[_0x95d9('0x20')]('Trigger,\x20%s',_0x95d9('0x1b'),_0x1f16f2);});}function afterCreateMessage(_0x239c6e){return function(_0x2ec4e5){_0x2ec4e5=_0x2ec4e5[_0x95d9('0x22')]({'plain':!![]});_0x2ec4e5['channel']=_0x239c6e;_0x2ec4e5[_0x95d9('0x23')]=_0x239c6e;_0x2ec4e5['event']=_0x2ec4e5['direction'];Promise[_0x95d9('0x24')]()['then'](function(){if(typeof _0x2ec4e5['ContactId']===_0x95d9('0x25'))return null;var _0x1f63d0=_0x95d9('0x26')+_0x2ec4e5['ContactId'];return db[_0x95d9('0x27')][_0x95d9('0x28')](_0x1f63d0,{'type':db[_0x95d9('0x29')]['QueryTypes'][_0x95d9('0x2a')],'raw':!![]});})['then'](function(_0x37ec6e){if(_0x37ec6e){_0x2ec4e5[_0x95d9('0x2b')]=_0x37ec6e[0x0];}if(typeof _0x2ec4e5['UserId']===_0x95d9('0x25'))return;return getAgent(_0x2ec4e5[_0x95d9('0x2c')]);})[_0x95d9('0x1c')](function(_0x216401){if(_0x216401){_0x2ec4e5[_0x95d9('0x2d')]=util['format'](_0x95d9('0x2e'),_0x216401[_0x95d9('0x2f')]);_0x2ec4e5[_0x95d9('0x30')]=_0x216401;_0x2ec4e5['channel']=_0x239c6e;return request({'event':_0x95d9('0x31'),'message':_0x2ec4e5});}else{return request({'event':_0x95d9('0x32'),'message':_0x2ec4e5});}})[_0x95d9('0x21')](function(_0x4697ad){logger[_0x95d9('0x20')](_0x95d9('0x1e'),_0x95d9('0x33'),_0x4697ad);});};}function afterCreateOfflineMessage(_0xe0c77e){return function(_0x2d8ed0){_0x2d8ed0=_0x2d8ed0[_0x95d9('0x22')]({'plain':!![]});_0x2d8ed0[_0x95d9('0x34')]=_0xe0c77e;_0x2d8ed0[_0x95d9('0x23')]=_0xe0c77e;_0x2d8ed0[_0x95d9('0x35')]=_0x95d9('0x36');Promise[_0x95d9('0x24')]()['then'](function(){return request({'event':_0x2d8ed0[_0x95d9('0x35')],'message':_0x2d8ed0});});};}function afterCreate(_0x309c4e,_0x4a0405){return function(_0x441d4d){_0x441d4d=_0x441d4d[_0x95d9('0x22')]({'plain':!![]});_0x441d4d['channel']=_0x309c4e;_0x441d4d[_0x95d9('0x23')]=_0x309c4e;_0x441d4d['event']=_0x95d9('0x37');Promise[_0x95d9('0x24')]()[_0x95d9('0x1c')](function(){var _0x2dbf37=_0x95d9('0x26')+_0x441d4d['ContactId'];return db[_0x95d9('0x27')][_0x95d9('0x28')](_0x2dbf37,{'type':db[_0x95d9('0x29')][_0x95d9('0x38')][_0x95d9('0x2a')],'raw':!![]});})[_0x95d9('0x1c')](function(_0x429e24){if(_0x429e24){_0x441d4d['contact']=_0x429e24[0x0];}if(typeof _0x441d4d[_0x95d9('0x2c')]===_0x95d9('0x25'))return;return getAgent(_0x441d4d[_0x95d9('0x2c')]);})[_0x95d9('0x1c')](function(_0x36ac71){if(_0x36ac71){_0x441d4d['interface']=util[_0x95d9('0x39')](_0x95d9('0x2e'),_0x36ac71[_0x95d9('0x2f')]);_0x441d4d[_0x95d9('0x30')]=_0x36ac71;}return request({'event':_0x4a0405,'message':_0x441d4d});})[_0x95d9('0x21')](function(_0x5cfe53){logger[_0x95d9('0x20')](_0x95d9('0x1e'),_0x95d9('0x3a'),_0x5cfe53);});};}function afterUpdate(_0x36ff43){return function(_0x52fce8){var _0x5d2d03=_0x52fce8[_0x95d9('0x3b')](_0x95d9('0x3c'))&&_0x52fce8[_0x95d9('0x3c')];var _0x2b78eb=_0x52fce8[_0x95d9('0x3b')](_0x95d9('0x3d'));if(_0x5d2d03||_0x2b78eb){var _0x120f38=_0x5d2d03?_0x95d9('0xb'):_0x95d9('0x3d');var _0xd5bb8a=_0x52fce8['get']({'plain':!![]});_0xd5bb8a['channel']=_0x36ff43;_0xd5bb8a[_0x95d9('0x23')]=_0x36ff43;_0xd5bb8a[_0x95d9('0x35')]=_0x5d2d03?_0x95d9('0x3c'):_0x95d9('0x3d');var _0x52b4ac=_0x95d9('0x26')+_0xd5bb8a[_0x95d9('0x3e')];return db[_0x95d9('0x27')]['query'](_0x52b4ac,{'type':db['Sequelize']['QueryTypes'][_0x95d9('0x2a')],'raw':!![]})[_0x95d9('0x1c')](function(_0x517b06){if(_0x517b06){_0xd5bb8a[_0x95d9('0x2b')]=_0x517b06[0x0];}if(typeof _0xd5bb8a[_0x95d9('0x2c')]===_0x95d9('0x25'))return;return getAgent(_0xd5bb8a[_0x95d9('0x2c')]);})[_0x95d9('0x1c')](function(_0x929b85){if(_0x929b85){_0xd5bb8a[_0x95d9('0x2d')]=util[_0x95d9('0x39')]('SIP/%s',_0x929b85[_0x95d9('0x2f')]);_0xd5bb8a[_0x95d9('0x30')]=_0x929b85;}return request({'event':_0x120f38,'message':_0xd5bb8a});})[_0x95d9('0x21')](function(_0x14c95d){logger[_0x95d9('0x20')](_0x95d9('0x1e'),_0x95d9('0x3f'),_0x14c95d);});}};}function getAgent(_0x4003ff){return db[_0x95d9('0x40')]['find']({'where':{'id':_0x4003ff},'attributes':['id',_0x95d9('0x2f'),_0x95d9('0x41'),_0x95d9('0x42'),_0x95d9('0x43')],'raw':!![]})[_0x95d9('0x1c')](function(_0x10d6d4){return _0x10d6d4;});}exports[_0x95d9('0x44')]=function(){for(var _0x190741=0x0;_0x190741=_0xb05232['agents']){throw Error(_0x0bde('0x16'));}_0x5efb71(_0x9146e4);})['catch'](function(_0x379239){_0x38b187(_0x379239);});});}; \ No newline at end of file +var _0x5fd8=['includes','isUndefined','blockedAt','updateAttributes','getLicense','role','User','count','agent','agents','catch','lodash','bluebird','./license/util','voice','mail','chat','whatsapp','openchannel','isValidChannel','toLowerCase'];(function(_0x139b57,_0x5edd0d){var _0x1bb827=function(_0x376d65){while(--_0x376d65){_0x139b57['push'](_0x139b57['shift']());}};_0x1bb827(++_0x5edd0d);}(_0x5fd8,0x74));var _0x85fd=function(_0x5944cf,_0x38144a){_0x5944cf=_0x5944cf-0x0;var _0x65778f=_0x5fd8[_0x5944cf];return _0x65778f;};'use strict';var _=require(_0x85fd('0x0'));var BPromise=require(_0x85fd('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x85fd('0x2'));var channels=[_0x85fd('0x3'),_0x85fd('0x4'),_0x85fd('0x5'),'fax','sms',_0x85fd('0x6'),_0x85fd('0x7')];exports['getChannels']=function(){return channels;};exports[_0x85fd('0x8')]=function(_0x28ec71){_0x28ec71=_0x28ec71[_0x85fd('0x9')]();return _[_0x85fd('0xa')](channels,_0x28ec71);};exports['clearBlockUser']=function(_0x13b4c9,_0x5835e5,_0x14db00,_0xde5207){var _0x243551={'loginAttempts':_0x5835e5,'blocked':_0x14db00};if(!_[_0x85fd('0xb')](_0xde5207)){_0x243551[_0x85fd('0xc')]=_0xde5207;}return _0x13b4c9[_0x85fd('0xd')](_0x243551);};exports[_0x85fd('0xe')]=function(_0x4245c2){return new BPromise(function(_0x8b538,_0x1c6c72){var _0x40b240=0x0;if(_0x4245c2[_0x85fd('0xf')]!=='agent'){_0x8b538(_0x4245c2);}db[_0x85fd('0x10')][_0x85fd('0x11')]({'where':{'role':_0x85fd('0x12'),'online':!![],'id':{'$ne':_0x4245c2['id']}}})['then'](function(_0x1a3098){_0x40b240=_0x1a3098;return util['getLicense']();})['then'](function(_0xb7df94){if(_0xb7df94&&_0xb7df94[_0x85fd('0x13')]&&_0x40b240>=_0xb7df94['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x8b538(_0x4245c2);})[_0x85fd('0x14')](function(_0x1592ed){_0x1c6c72(_0x1592ed);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 35e2eea..347b27b 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf01=['send','exports','status','json'];(function(_0x508b02,_0x2220f9){var _0x4142d3=function(_0x5c4aa2){while(--_0x5c4aa2){_0x508b02['push'](_0x508b02['shift']());}};_0x4142d3(++_0x2220f9);}(_0xcf01,0x141));var _0x1cf0=function(_0x348b29,_0x3be5e9){_0x348b29=_0x348b29-0x0;var _0xc260c5=_0xcf01[_0x348b29];return _0xc260c5;};'use strict';module[_0x1cf0('0x0')][0x194]=function pageNotFound(_0x5434cc,_0x15ec5d){var _0x4c1dba='404';var _0x1cae70=0x194;var _0x9f7f21={'status':_0x1cae70};_0x15ec5d['status'](_0x9f7f21['status']);_0x15ec5d['render'](_0x4c1dba,{},function(_0x13ba39,_0x5dd3f2){if(_0x13ba39){return _0x15ec5d['status'](_0x9f7f21[_0x1cf0('0x1')])[_0x1cf0('0x2')](_0x9f7f21);}_0x15ec5d[_0x1cf0('0x3')](_0x5dd3f2);});}; \ No newline at end of file +var _0x64ea=['exports','404','render','status','json'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x64ea,0x127));var _0xa64e=function(_0x51a0a9,_0x569499){_0x51a0a9=_0x51a0a9-0x0;var _0x4bd20c=_0x64ea[_0x51a0a9];return _0x4bd20c;};'use strict';module[_0xa64e('0x0')][0x194]=function pageNotFound(_0xf9cce8,_0x28b839){var _0xe9d2e=_0xa64e('0x1');var _0x4a3bd3=0x194;var _0x3c197a={'status':_0x4a3bd3};_0x28b839['status'](_0x3c197a['status']);_0x28b839[_0xa64e('0x2')](_0xe9d2e,{},function(_0x4dd745,_0x47bc3b){if(_0x4dd745){return _0x28b839[_0xa64e('0x3')](_0x3c197a[_0xa64e('0x3')])[_0xa64e('0x4')](_0x3c197a);}_0x28b839['send'](_0x47bc3b);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 6522406..2da6d4e 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','Integration','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','CmHopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueue','ChatQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','user_has_square_projects','ChanSpyId','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccount','MailAccountId','hasOne','Imap','Smtp','Dispositions','CannedAnswer','Answers','MailMessage','Interactions','Applications','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','Tags','mail_interaction_has_tags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','Dashboard','FaxAccountId','Exntensions','FaxApplication','FaxInteractionId','fax_interaction_has_tags','ThroughTags','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','mandatoryDispositionPause','SmsApplication','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','ChatApplication','ChatMessage','user_has_chat_websites','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','HopperHistories','SmsInteractions','MailInteractions','Company','cm_contact_has_tags','Agent','CampaignId','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','VoiceMusicOnHold','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmConfiguration','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_openchannel_queues','team_has_whatsapp_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToQueue','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToAgent','ToAccount','FromOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','jstz','determine','motion2','xcall','xC@LL1234','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','mysql','name','username','database','User','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','import','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','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','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailQueue/mailQueue.model','MailSubstatus'];(function(_0x3e1ed7,_0x2d7508){var _0x24dca3=function(_0x37fe6){while(--_0x37fe6){_0x3e1ed7['push'](_0x3e1ed7['shift']());}};_0x24dca3(++_0x2d7508);}(_0xb43b,0x1b2));var _0xbb43=function(_0x12925e,_0x365a92){_0x12925e=_0x12925e-0x0;var _0x37f519=_0xb43b[_0x12925e];return _0x37f519;};'use strict';var config=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));var _=require('lodash');var jstz=require(_0xbb43('0x2'));var timezone=jstz[_0xbb43('0x3')]();config[_0xbb43('0x1')]=_['defaultsDeep'](config[_0xbb43('0x1')],{'database':_0xbb43('0x4'),'username':_0xbb43('0x5'),'password':_0xbb43('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xbb43('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xbb43('0x8'),'collate':_0xbb43('0x9')}}});config[_0xbb43('0xa')]=_[_0xbb43('0xb')](config[_0xbb43('0xa')],{'database':'motion2','username':_0xbb43('0x5'),'password':_0xbb43('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xbb43('0xc'),'dialectOptions':{'charset':_0xbb43('0x7')},'logging':![],'timezone':timezone[_0xbb43('0xd')](),'define':{'charset':_0xbb43('0x8'),'collate':_0xbb43('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbb43('0x1')]['database'],config[_0xbb43('0x1')][_0xbb43('0xe')],config['sequelize']['password'],config[_0xbb43('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xbb43('0xf')],config['sequelizeHistory'][_0xbb43('0xe')],config[_0xbb43('0xa')]['password'],config['sequelizeHistory']['options'])};db[_0xbb43('0x10')]=db[_0xbb43('0x1')]['import']('../api/user/user.model');db[_0xbb43('0x11')]=db['sequelize']['import'](_0xbb43('0x12'));db[_0xbb43('0x13')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x14'));db['VoiceExtension']=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x16'));db[_0xbb43('0x17')]=db['sequelize'][_0xbb43('0x15')]('../api/voiceQueue/voiceQueue.model');db[_0xbb43('0x18')]=db['sequelize'][_0xbb43('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0xbb43('0x19')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x1a'));db['VoiceMail']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x1b'));db['VoiceMailMessage']=db['sequelize']['import'](_0xbb43('0x1c'));db[_0xbb43('0x1d')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x1e'));db[_0xbb43('0x1f')]=db[_0xbb43('0x1')]['import']('../api/voiceDialReport/voiceDialReport.model');db[_0xbb43('0x20')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x21'));db[_0xbb43('0x22')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x23'));db['MemberReport']=db[_0xbb43('0x1')]['import'](_0xbb43('0x24'));db[_0xbb43('0x25')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/trunk/trunk.model');db[_0xbb43('0x26')]=db['sequelize']['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xbb43('0x27')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x28'));db[_0xbb43('0x29')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x2a'));db[_0xbb43('0x2b')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x2c'));db[_0xbb43('0x2d')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x2e'));db[_0xbb43('0x2f')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x30'));db[_0xbb43('0x31')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x32'));db[_0xbb43('0x33')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x34'));db[_0xbb43('0x35')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xbb43('0x36')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x37'));db[_0xbb43('0x38')]=db[_0xbb43('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x39'));db[_0xbb43('0x3a')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x3b'));db[_0xbb43('0x3c')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x3d'));db['MailMessage']=db[_0xbb43('0x1')]['import'](_0xbb43('0x3e'));db[_0xbb43('0x3f')]=db['sequelize'][_0xbb43('0x15')]('../api/mailApplication/mailApplication.model');db[_0xbb43('0x40')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x41'));db['Dashboard']=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/dashboard/dashboard.model');db[_0xbb43('0x42')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x43'));db[_0xbb43('0x44')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x45'));db['FaxApplication']=db[_0xbb43('0x1')]['import'](_0xbb43('0x46'));db[_0xbb43('0x47')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/faxInteraction/faxInteraction.model');db[_0xbb43('0x48')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x49'));db[_0xbb43('0x4a')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x4b'));db['FaxQueueReport']=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/faxQueueReport/faxQueueReport.model');db[_0xbb43('0x4c')]=db['sequelize']['import']('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xbb43('0x1')]['import'](_0xbb43('0x4d'));db['SmsInteraction']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x4e'));db['SmsMessage']=db[_0xbb43('0x1')]['import'](_0xbb43('0x4f'));db[_0xbb43('0x50')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x51'));db[_0xbb43('0x52')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x53'));db[_0xbb43('0x54')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0xbb43('0x55')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x56'));db['OpenchannelMessage']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x57'));db['OpenchannelQueue']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x58'));db[_0xbb43('0x59')]=db[_0xbb43('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db[_0xbb43('0x5a')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x5b'));db['ChatApplication']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x5c'));db[_0xbb43('0x5d')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x5e'));db['ChatMessage']=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x5f'));db[_0xbb43('0x60')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x61'));db[_0xbb43('0x62')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x63'));db[_0xbb43('0x64')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x65'));db[_0xbb43('0x66')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x67'));db[_0xbb43('0x68')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x69'));db['CmHopper']=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x6a'));db[_0xbb43('0x6b')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x6c'));db[_0xbb43('0x6d')]=db['sequelize'][_0xbb43('0x15')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x6e'));db[_0xbb43('0x6f')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x70'));db[_0xbb43('0x71')]=db['sequelize']['import'](_0xbb43('0x72'));db[_0xbb43('0x73')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x74'));db[_0xbb43('0x75')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x76'));db['CannedAnswer']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x77'));db[_0xbb43('0x78')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/disposition/disposition.model');db[_0xbb43('0x79')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x7a'));db[_0xbb43('0x7b')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x7c'));db[_0xbb43('0x7d')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x7e'));db[_0xbb43('0x7f')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x80'));db['VoiceQueuesLog']=db[_0xbb43('0x1')]['import'](_0xbb43('0x81'));db[_0xbb43('0x82')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x83'));db['Sound']=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x84'));db['Tag']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x85'));db[_0xbb43('0x86')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x87'));db[_0xbb43('0x88')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x89'));db[_0xbb43('0x8a')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/variable/variable.model');db['Integration']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x8b'));db['IntegrationReport']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x8c'));db[_0xbb43('0x8d')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x8e'));db[_0xbb43('0x8f')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x90'));db[_0xbb43('0x91')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x92'));db[_0xbb43('0x93')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x94'));db[_0xbb43('0x95')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x96'));db[_0xbb43('0x97')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x98'));db['SalesforceAccount']=db['sequelize']['import'](_0xbb43('0x99'));db[_0xbb43('0x9a')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x9b'));db[_0xbb43('0x9c')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x9d'));db[_0xbb43('0x9e')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x9f'));db['SugarcrmConfiguration']=db[_0xbb43('0x1')]['import'](_0xbb43('0xa0'));db[_0xbb43('0xa1')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xa2'));db[_0xbb43('0xa3')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/intDeskAccount/intDeskAccount.model');db[_0xbb43('0xa4')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xa5'));db[_0xbb43('0xa6')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xa7'));db[_0xbb43('0xa8')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xa9'));db[_0xbb43('0xaa')]=db['sequelize'][_0xbb43('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xbb43('0xab')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xac'));db[_0xbb43('0xad')]=db['sequelize']['import'](_0xbb43('0xae'));db[_0xbb43('0xaf')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xb0'));db[_0xbb43('0xb1')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xb2'));db[_0xbb43('0xb3')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xb4'));db[_0xbb43('0xb5')]=db['sequelize']['import'](_0xbb43('0xb6'));db[_0xbb43('0xb7')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xbb43('0xb8')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xb9'));db[_0xbb43('0xba')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xbb'));db['VtigerField']=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xbc'));db[_0xbb43('0xbd')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xbe'));db[_0xbb43('0xbf')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xc0'));db[_0xbb43('0xc1')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/intServicenowField/intServicenowField.model');db[_0xbb43('0xc2')]=db['sequelize']['import'](_0xbb43('0xc3'));db[_0xbb43('0xc4')]=db[_0xbb43('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xc5'));db[_0xbb43('0xc6')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xc7'));db['FreshsalesConfiguration']=db[_0xbb43('0x1')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xbb43('0xc8')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x8b'));db[_0xbb43('0xc9')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xca'));db[_0xbb43('0xcb')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0xbb43('0xcc')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xcd'));db[_0xbb43('0xce')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xcf'));db[_0xbb43('0xd0')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xbb43('0xd1')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xd2'));db[_0xbb43('0xd3')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xd4'));db['SquareDetailsReport']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xd5'));db[_0xbb43('0xd6')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xd7'));db[_0xbb43('0xd8')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xd9'));db[_0xbb43('0xda')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xdb'));db['SquareProject']=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0xbb43('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0xbb43('0xdc')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xdd'));db[_0xbb43('0xde')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xdf'));db[_0xbb43('0xe0')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xe1'));db[_0xbb43('0xe2')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xe3'));db[_0xbb43('0xe4')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xe5'));db[_0xbb43('0xe6')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xe7'));db[_0xbb43('0xe8')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xe9'));db['MailTransferReport']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xea'));db[_0xbb43('0xeb')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xec'));db[_0xbb43('0xed')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0xbb43('0xee')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xef'));db[_0xbb43('0xf0')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xf1'));db[_0xbb43('0xf2')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/cmList/cmList.model');db[_0xbb43('0xf3')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xf4'));db[_0xbb43('0xf5')]=db['sequelize'][_0xbb43('0x15')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xf6'));db[_0xbb43('0xf7')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db['sequelize'][_0xbb43('0x15')](_0xbb43('0xf8'));db[_0xbb43('0xf9')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xfa'));db[_0xbb43('0xfb')]=db[_0xbb43('0x1')]['import'](_0xbb43('0xfc'));db['WhatsappInteraction']=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xfd'));db[_0xbb43('0xfe')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0xff'));db[_0xbb43('0x100')]=db[_0xbb43('0x1')]['import'](_0xbb43('0x101'));db[_0xbb43('0x102')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x103'));db[_0xbb43('0x104')]=db['sequelize'][_0xbb43('0x15')](_0xbb43('0x105'));db[_0xbb43('0x106')]=db[_0xbb43('0x1')][_0xbb43('0x15')](_0xbb43('0x107'));db[_0xbb43('0x108')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xbb43('0x109')]=db[_0xbb43('0x1')][_0xbb43('0x15')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xbb43('0x10a')]=db['sequelize']['import'](_0xbb43('0x10b'));db[_0xbb43('0x10')]['hasOne'](db[_0xbb43('0x10c')],{'as':'VoiceMail','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')]['hasMany'](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')][_0xbb43('0x10f')](db[_0xbb43('0x27')],{'as':_0xbb43('0x110'),'foreignKey':'UserId'});db[_0xbb43('0x10')][_0xbb43('0x10f')](db[_0xbb43('0x111')],{'as':_0xbb43('0x112'),'onDelete':_0xbb43('0x10d'),'hooks':!![]});db[_0xbb43('0x10')]['hasMany'](db['CmHopperFinal'],{'as':_0xbb43('0x113'),'foreignKey':_0xbb43('0x10e')});db['User']['hasMany'](db[_0xbb43('0x114')],{'as':'HopperHistory','foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')][_0xbb43('0x10f')](db[_0xbb43('0x6f')],{'as':'ReportAgentPreview','foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')][_0xbb43('0x10f')](db[_0xbb43('0x55')],{'as':_0xbb43('0x115'),'foreignKey':_0xbb43('0x10e')});db['User']['hasMany'](db[_0xbb43('0x5d')],{'as':_0xbb43('0x116'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')][_0xbb43('0x10f')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')][_0xbb43('0x10f')](db['FaxInteraction'],{'as':_0xbb43('0x117'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')]['hasMany'](db[_0xbb43('0x3c')],{'as':'MailInteractions','foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')][_0xbb43('0x10f')](db['WhatsappInteraction'],{'as':_0xbb43('0x118'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x10')][_0xbb43('0x10f')](db[_0xbb43('0x119')],{'as':_0xbb43('0x11a'),'foreignKey':_0xbb43('0x11b')});db[_0xbb43('0x10')][_0xbb43('0x11c')](db[_0xbb43('0xf5')],{'as':_0xbb43('0xf5'),'foreignKey':_0xbb43('0x11d')});db[_0xbb43('0x10')][_0xbb43('0x11e')](db['ChatGroup'],{'as':_0xbb43('0x11f'),'through':_0xbb43('0x120')});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0x68')],{'as':_0xbb43('0x121'),'through':_0xbb43('0x122')});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0xf2')],{'as':_0xbb43('0x123'),'through':_0xbb43('0x124')});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0xde')],{'through':_0xbb43('0x125')});db[_0xbb43('0x10')]['belongsToMany'](db[_0xbb43('0x3c')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0xbb43('0x10')][_0xbb43('0x11e')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0xbb43('0x126')});db[_0xbb43('0x10')]['belongsToMany'](db[_0xbb43('0x47')],{'as':'FaxInteractions','through':_0xbb43('0x127')});db['User'][_0xbb43('0x11e')](db[_0xbb43('0x128')],{'as':'SmsInteractions','through':_0xbb43('0x129')});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0x55')],{'as':_0xbb43('0x115'),'through':'user_has_openchannel_interactions'});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0x12a')],{'as':_0xbb43('0x118'),'through':_0xbb43('0x12b')});db['User'][_0xbb43('0x11e')](db[_0xbb43('0x17')],{'as':_0xbb43('0x12c'),'through':'UserVoiceQueue','required':![]});db['User'][_0xbb43('0x11e')](db[_0xbb43('0xf3')],{'as':_0xbb43('0x12d'),'through':'UserVoicePrefix','required':![]});db['User'][_0xbb43('0x11e')](db[_0xbb43('0x12e')],{'as':_0xbb43('0x12f'),'through':_0xbb43('0x2d'),'required':![]});db[_0xbb43('0x10')]['belongsToMany'](db[_0xbb43('0x130')],{'as':_0xbb43('0x131'),'through':_0xbb43('0x2b'),'required':![],'hooks':!![]});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0x4a')],{'as':'FaxQueues','through':_0xbb43('0x2f'),'required':![]});db[_0xbb43('0x10')][_0xbb43('0x11e')](db['SmsQueue'],{'as':_0xbb43('0x132'),'through':'UserSmsQueue','required':![]});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0x133')],{'as':_0xbb43('0x134'),'through':'UserOpenchannelQueue','required':![]});db[_0xbb43('0x10')]['belongsToMany'](db[_0xbb43('0x104')],{'as':_0xbb43('0x135'),'through':_0xbb43('0x35'),'required':![]});db[_0xbb43('0x10')][_0xbb43('0x11e')](db['CmList'],{'through':_0xbb43('0x124')});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0x59')],{'as':_0xbb43('0x136'),'through':'user_has_chat_websites'});db[_0xbb43('0x10')][_0xbb43('0x11e')](db[_0xbb43('0x44')],{'as':'FaxAccounts','through':_0xbb43('0x137')});db['User']['belongsToMany'](db['MailAccount'],{'as':'MailAccounts','through':_0xbb43('0x138')});db['User'][_0xbb43('0x11e')](db[_0xbb43('0x52')],{'as':_0xbb43('0x139'),'through':_0xbb43('0x13a')});db['User'][_0xbb43('0x11e')](db[_0xbb43('0x4c')],{'as':'SmsAccounts','through':_0xbb43('0x13b')});db[_0xbb43('0x10')]['belongsToMany'](db['WhatsappAccount'],{'as':_0xbb43('0x13c'),'through':_0xbb43('0x13d')});db[_0xbb43('0x10')]['belongsToMany'](db[_0xbb43('0x13e')],{'as':'SquareProjects','through':_0xbb43('0x13f')});db[_0xbb43('0x11')][_0xbb43('0x10f')](db[_0xbb43('0x111')],{'as':'SpiedAgents','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x140')});db[_0xbb43('0x13')][_0xbb43('0x10f')](db[_0xbb43('0x111')],{'onDelete':'cascade'});db[_0xbb43('0x111')][_0xbb43('0x10f')](db['VoiceExtension'],{'as':'Applications','onDelete':_0xbb43('0x10d')});db['VoiceMusicOnHold'][_0xbb43('0x11e')](db[_0xbb43('0x141')],{'as':_0xbb43('0x142'),'through':_0xbb43('0x143')});db[_0xbb43('0x17')][_0xbb43('0x10f')](db[_0xbb43('0x27')],{'as':_0xbb43('0x144'),'foreignKey':_0xbb43('0x145')});db[_0xbb43('0x17')]['hasMany'](db[_0xbb43('0x146')],{'as':_0xbb43('0x147'),'foreignKey':_0xbb43('0x145')});db['VoiceQueue'][_0xbb43('0x10f')](db[_0xbb43('0x6d')],{'as':_0xbb43('0x113'),'foreignKey':_0xbb43('0x145')});db[_0xbb43('0x17')]['hasMany'](db[_0xbb43('0x114')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xbb43('0x6f')],{'as':_0xbb43('0x6f'),'foreignKey':_0xbb43('0x145')});db[_0xbb43('0x17')][_0xbb43('0x10f')](db[_0xbb43('0x6b')],{'as':_0xbb43('0x148'),'foreignKey':'VoiceQueueId'});db[_0xbb43('0x17')][_0xbb43('0x10f')](db[_0xbb43('0x149')],{'as':_0xbb43('0x14a'),'foreignKey':_0xbb43('0x145')});db[_0xbb43('0x17')][_0xbb43('0x11c')](db[_0xbb43('0x25')],{'as':_0xbb43('0x25'),'foreignKey':_0xbb43('0x14b')});db[_0xbb43('0x17')]['belongsTo'](db['Trunk'],{'as':_0xbb43('0x14c'),'foreignKey':_0xbb43('0x14d')});db[_0xbb43('0x17')][_0xbb43('0x11c')](db['Interval'],{'as':_0xbb43('0x7b'),'foreignKey':_0xbb43('0x14e')});db[_0xbb43('0x17')][_0xbb43('0x11c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xbb43('0x14f')});db['VoiceQueue']['belongsToMany'](db[_0xbb43('0xf2')],{'as':_0xbb43('0x123'),'through':_0xbb43('0x150')});db[_0xbb43('0x17')]['belongsToMany'](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':_0xbb43('0x29')});db['VoiceQueue'][_0xbb43('0x11e')](db[_0xbb43('0xde')],{'as':_0xbb43('0x152'),'through':_0xbb43('0x108')});db[_0xbb43('0x17')][_0xbb43('0x11e')](db['CmList'],{'as':_0xbb43('0x153'),'through':'voice_queues_has_cm_blacklists'});db[_0xbb43('0x18')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x10'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x19')]['belongsTo'](db[_0xbb43('0x10')],{'as':_0xbb43('0x10'),'foreignKey':'UserId'});db[_0xbb43('0x10c')][_0xbb43('0x10f')](db[_0xbb43('0x154')],{'as':_0xbb43('0x155'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x156'),'sourceKey':_0xbb43('0x157')});db[_0xbb43('0x154')]['belongsTo'](db[_0xbb43('0x10c')],{'foreignKey':_0xbb43('0x156'),'targetKey':_0xbb43('0x157')});db[_0xbb43('0x1d')]['hasMany'](db[_0xbb43('0x22')],{'as':_0xbb43('0x158'),'foreignKey':_0xbb43('0x159'),'constraints':![]});db[_0xbb43('0x1d')][_0xbb43('0x10f')](db[_0xbb43('0x20')],{'as':_0xbb43('0x15a'),'foreignKey':_0xbb43('0x159'),'constraints':![]});db[_0xbb43('0x1d')][_0xbb43('0x11c')](db['User'],{'as':_0xbb43('0x10'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x1d')]['belongsTo'](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x36')][_0xbb43('0x11c')](db['MailAccount'],{'as':_0xbb43('0x15d'),'foreignKey':_0xbb43('0x15e')});db[_0xbb43('0x38')][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{'as':_0xbb43('0x15d'),'foreignKey':'MailAccountId'});db[_0xbb43('0x15d')][_0xbb43('0x15f')](db[_0xbb43('0x36')],{'as':_0xbb43('0x160'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x15d')][_0xbb43('0x15f')](db[_0xbb43('0x38')],{'as':_0xbb43('0x161'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x15d')][_0xbb43('0x10f')](db[_0xbb43('0x78')],{'as':_0xbb43('0x162'),'foreignKey':'MailAccountId','onDelete':_0xbb43('0x10d')});db[_0xbb43('0x15d')][_0xbb43('0x10f')](db[_0xbb43('0x163')],{'as':_0xbb43('0x164'),'foreignKey':_0xbb43('0x15e')});db['MailAccount'][_0xbb43('0x10f')](db[_0xbb43('0x165')],{'as':_0xbb43('0x155'),'foreignKey':_0xbb43('0x15e')});db[_0xbb43('0x15d')][_0xbb43('0x10f')](db[_0xbb43('0x3c')],{'as':_0xbb43('0x166')});db[_0xbb43('0x15d')]['hasMany'](db[_0xbb43('0x3f')],{'as':_0xbb43('0x167')});db[_0xbb43('0x15d')][_0xbb43('0x11c')](db[_0xbb43('0xf2')],{'as':'List','foreignKey':_0xbb43('0x168')});db['MailAccount']['belongsTo'](db['Template'],{'as':_0xbb43('0x86'),'foreignKey':_0xbb43('0x169')});db['MailAccount']['belongsTo'](db[_0xbb43('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xbb43('0x14f')});db[_0xbb43('0x15d')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':'user_has_mail_accounts'});db[_0xbb43('0x12e')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':_0xbb43('0x2d')});db[_0xbb43('0x12e')]['belongsToMany'](db[_0xbb43('0xde')],{'through':_0xbb43('0x16a'),'as':_0xbb43('0x152')});db[_0xbb43('0x3c')][_0xbb43('0x10f')](db['MailMessage'],{'as':_0xbb43('0x155'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x16b')});db[_0xbb43('0x3c')][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x15e')});db[_0xbb43('0x3c')]['belongsTo'](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x3c')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x16d'),'foreignKey':'UserId'});db[_0xbb43('0x3c')]['belongsToMany'](db[_0xbb43('0x16e')],{'through':'mail_interaction_has_tags','as':_0xbb43('0x16f')});db[_0xbb43('0x3c')][_0xbb43('0x11e')](db[_0xbb43('0x16e')],{'through':_0xbb43('0x170'),'as':'ThroughTags'});db['MailInteraction']['belongsToMany'](db[_0xbb43('0x10')],{'as':_0xbb43('0x171'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0xbb43('0x165')][_0xbb43('0x10f')](db[_0xbb43('0xe6')],{'as':_0xbb43('0x172'),'onDelete':_0xbb43('0x10d')});db['MailMessage'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':'User'});db['MailMessage'][_0xbb43('0x11c')](db[_0xbb43('0x68')],{'onDelete':_0xbb43('0x10d'),'as':'Contact'});db[_0xbb43('0x165')]['belongsTo'](db[_0xbb43('0x3c')],{'as':_0xbb43('0x173'),'foreignKey':_0xbb43('0x16b')});db[_0xbb43('0x165')][_0xbb43('0x11c')](db['MailAccount'],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x15e')});db[_0xbb43('0x165')][_0xbb43('0x11c')](db[_0xbb43('0x59')],{'as':'ChatWebsite','foreignKey':_0xbb43('0x174')});db[_0xbb43('0x165')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xbb43('0x60'),'foreignKey':_0xbb43('0x175')});db['MailApplication']['belongsTo'](db[_0xbb43('0x10')],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0x3f')][_0xbb43('0x11c')](db['MailQueue'],{'onDelete':_0xbb43('0x176')});db['MailApplication'][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{'onDelete':_0xbb43('0x176')});db['MailApplication'][_0xbb43('0x11c')](db[_0xbb43('0x7b')],{'onDelete':_0xbb43('0x176'),'foreignKey':_0xbb43('0x14e')});db[_0xbb43('0x3f')][_0xbb43('0x11c')](db[_0xbb43('0x16e')],{'onDelete':'restrict','foreignKey':_0xbb43('0x177')});db['MailQueueReport'][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{});db[_0xbb43('0x40')][_0xbb43('0x11c')](db['CmList'],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db['MailQueueReport'][_0xbb43('0x11c')](db['CmContact'],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x40')]['belongsTo'](db['MailInteraction'],{});db[_0xbb43('0x40')]['belongsTo'](db[_0xbb43('0x165')],{});db['MailQueueReport'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{});db[_0xbb43('0x40')][_0xbb43('0x11c')](db[_0xbb43('0x12e')],{});db[_0xbb43('0x179')][_0xbb43('0x10f')](db[_0xbb43('0x42')],{'as':'Items','onDelete':_0xbb43('0x10d')});db[_0xbb43('0x44')][_0xbb43('0x10f')](db[_0xbb43('0x78')],{'as':'Dispositions','foreignKey':_0xbb43('0x17a'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x44')][_0xbb43('0x10f')](db[_0xbb43('0x163')],{'as':_0xbb43('0x164'),'foreignKey':'FaxAccountId'});db['FaxAccount']['hasMany'](db[_0xbb43('0x47')],{'as':'Interactions'});db[_0xbb43('0x44')][_0xbb43('0x10f')](db['FaxApplication'],{'as':_0xbb43('0x167')});db[_0xbb43('0x44')][_0xbb43('0x10f')](db[_0xbb43('0x111')],{'as':_0xbb43('0x17b'),'onDelete':'cascade'});db[_0xbb43('0x44')][_0xbb43('0x10f')](db['FaxMessage'],{'as':'Messages'});db[_0xbb43('0x44')]['belongsTo'](db[_0xbb43('0x25')],{'as':_0xbb43('0x25')});db['FaxAccount'][_0xbb43('0x11c')](db[_0xbb43('0xf2')],{'as':'List','foreignKey':_0xbb43('0x168')});db['FaxAccount']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xbb43('0x14f')});db[_0xbb43('0x44')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':_0xbb43('0x137')});db[_0xbb43('0x17c')][_0xbb43('0x11c')](db['User'],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0x17c')][_0xbb43('0x11c')](db[_0xbb43('0x4a')],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0x17c')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0x17c')][_0xbb43('0x11c')](db['Tag'],{'onDelete':_0xbb43('0x176'),'foreignKey':_0xbb43('0x177')});db[_0xbb43('0x47')][_0xbb43('0x10f')](db['FaxMessage'],{'as':_0xbb43('0x155'),'onDelete':'cascade','foreignKey':_0xbb43('0x17d')});db[_0xbb43('0x47')][_0xbb43('0x11c')](db['FaxAccount'],{'as':_0xbb43('0x16c'),'foreignKey':'FaxAccountId'});db[_0xbb43('0x47')]['belongsTo'](db['CmContact'],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db['FaxInteraction'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':'Owner','foreignKey':'UserId'});db['FaxInteraction'][_0xbb43('0x11e')](db['Tag'],{'through':_0xbb43('0x17e'),'as':_0xbb43('0x16f')});db[_0xbb43('0x47')][_0xbb43('0x11e')](db[_0xbb43('0x16e')],{'through':'fax_interaction_has_tags','as':_0xbb43('0x17f')});db[_0xbb43('0x47')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x171'),'through':_0xbb43('0x127'),'foreignKey':_0xbb43('0x17d')});db['FaxMessage']['belongsTo'](db['User'],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x10')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':_0xbb43('0x173'),'foreignKey':_0xbb43('0x17d')});db['FaxMessage'][_0xbb43('0x11c')](db[_0xbb43('0x68')],{'onDelete':'cascade','as':_0xbb43('0x15b')});db[_0xbb43('0x48')]['belongsTo'](db[_0xbb43('0xe6')],{'as':_0xbb43('0xe6'),'foreignKey':'AttachmentId'});db[_0xbb43('0x48')][_0xbb43('0x11c')](db[_0xbb43('0x44')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x17a')});db[_0xbb43('0x4a')][_0xbb43('0x11e')](db['User'],{'as':_0xbb43('0x151'),'through':_0xbb43('0x2f')});db['FaxQueue'][_0xbb43('0x11e')](db[_0xbb43('0xde')],{'through':_0xbb43('0x180'),'as':'Teams'});db[_0xbb43('0x181')][_0xbb43('0x11c')](db[_0xbb43('0x44')],{});db[_0xbb43('0x181')][_0xbb43('0x11c')](db['CmList'],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db['FaxQueueReport'][_0xbb43('0x11c')](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x181')][_0xbb43('0x11c')](db[_0xbb43('0x47')],{});db[_0xbb43('0x181')][_0xbb43('0x11c')](db[_0xbb43('0x48')],{});db['FaxQueueReport'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{});db[_0xbb43('0x181')][_0xbb43('0x11c')](db['FaxQueue'],{});db['SmsAccount'][_0xbb43('0x10f')](db[_0xbb43('0x78')],{'as':_0xbb43('0x162'),'foreignKey':_0xbb43('0x182'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x4c')][_0xbb43('0x10f')](db['CannedAnswer'],{'as':_0xbb43('0x164'),'foreignKey':_0xbb43('0x182')});db[_0xbb43('0x4c')][_0xbb43('0x10f')](db[_0xbb43('0x183')],{'as':_0xbb43('0x155'),'foreignKey':_0xbb43('0x182')});db[_0xbb43('0x4c')][_0xbb43('0x10f')](db[_0xbb43('0x128')],{'as':'Interactions'});db['SmsAccount'][_0xbb43('0x10f')](db['SmsApplication'],{'as':_0xbb43('0x167')});db[_0xbb43('0x4c')][_0xbb43('0x11c')](db['CmList'],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0x4c')][_0xbb43('0x11c')](db[_0xbb43('0x7d')],{'as':_0xbb43('0x184'),'foreignKey':_0xbb43('0x14f')});db['SmsAccount'][_0xbb43('0x11e')](db['User'],{'as':_0xbb43('0x151'),'through':'user_has_sms_accounts'});db[_0xbb43('0x185')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0x185')][_0xbb43('0x11c')](db['SmsQueue'],{'onDelete':_0xbb43('0x176')});db['SmsApplication']['belongsTo'](db['SmsAccount'],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0x185')][_0xbb43('0x11c')](db[_0xbb43('0x7b')],{'onDelete':_0xbb43('0x176'),'foreignKey':_0xbb43('0x14e')});db[_0xbb43('0x185')][_0xbb43('0x11c')](db[_0xbb43('0x16e')],{'onDelete':_0xbb43('0x176'),'foreignKey':'TagId'});db[_0xbb43('0x128')][_0xbb43('0x10f')](db[_0xbb43('0x183')],{'as':'Messages','onDelete':_0xbb43('0x10d'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0xbb43('0x11c')](db[_0xbb43('0x4c')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xbb43('0x128')][_0xbb43('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['SmsInteraction'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x16d'),'foreignKey':'UserId'});db[_0xbb43('0x128')][_0xbb43('0x11e')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xbb43('0x16f')});db['SmsInteraction'][_0xbb43('0x11e')](db[_0xbb43('0x16e')],{'through':_0xbb43('0x186'),'as':'ThroughTags'});db[_0xbb43('0x128')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x171'),'through':'user_has_sms_interactions','foreignKey':_0xbb43('0x187')});db[_0xbb43('0x183')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x10')});db['SmsMessage']['belongsTo'](db[_0xbb43('0x68')],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x15b')});db[_0xbb43('0x183')][_0xbb43('0x11c')](db[_0xbb43('0x128')],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x173'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xbb43('0x11c')](db[_0xbb43('0x4c')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x182')});db[_0xbb43('0x50')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xbb43('0x50')][_0xbb43('0x11e')](db[_0xbb43('0xde')],{'through':_0xbb43('0x188'),'as':_0xbb43('0x152')});db[_0xbb43('0x52')][_0xbb43('0x10f')](db['Disposition'],{'as':_0xbb43('0x162'),'foreignKey':_0xbb43('0x189'),'onDelete':'cascade'});db[_0xbb43('0x52')][_0xbb43('0x10f')](db[_0xbb43('0x163')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0xbb43('0x52')][_0xbb43('0x10f')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0xbb43('0x52')][_0xbb43('0x10f')](db[_0xbb43('0x18a')],{'as':'Messages','foreignKey':_0xbb43('0x189')});db[_0xbb43('0x52')]['hasMany'](db['OpenchannelApplication'],{'as':_0xbb43('0x167'),'foreignKey':_0xbb43('0x189')});db['OpenchannelAccount'][_0xbb43('0x11c')](db[_0xbb43('0xf2')],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0x52')]['belongsTo'](db[_0xbb43('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xbb43('0x14f')});db[_0xbb43('0x52')][_0xbb43('0x11e')](db['User'],{'as':_0xbb43('0x151'),'through':_0xbb43('0x13a')});db[_0xbb43('0x54')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0x54')][_0xbb43('0x11c')](db[_0xbb43('0x133')],{'onDelete':_0xbb43('0x176'),'foreignKey':'OpenchannelQueueId'});db[_0xbb43('0x54')][_0xbb43('0x11c')](db[_0xbb43('0x52')],{'onDelete':_0xbb43('0x176'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0xbb43('0x11c')](db[_0xbb43('0x7b')],{'onDelete':_0xbb43('0x176'),'foreignKey':'IntervalId'});db[_0xbb43('0x54')]['belongsTo'](db[_0xbb43('0x16e')],{'onDelete':_0xbb43('0x176'),'foreignKey':'TagId'});db[_0xbb43('0x55')]['hasMany'](db['OpenchannelMessage'],{'as':_0xbb43('0x155'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x18b')});db[_0xbb43('0x55')][_0xbb43('0x11c')](db[_0xbb43('0x52')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xbb43('0x55')][_0xbb43('0x11c')](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x55')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x16d'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0xbb43('0x11e')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xbb43('0x16f')});db[_0xbb43('0x55')][_0xbb43('0x11e')](db['Tag'],{'through':_0xbb43('0x18c'),'as':_0xbb43('0x17f')});db[_0xbb43('0x55')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x171'),'through':_0xbb43('0x18d'),'foreignKey':'OpenchannelInteractionId'});db[_0xbb43('0x18a')]['belongsTo'](db['User'],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x10')});db[_0xbb43('0x18a')][_0xbb43('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0xbb43('0x15b')});db[_0xbb43('0x18a')][_0xbb43('0x11c')](db[_0xbb43('0x55')],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x173'),'foreignKey':_0xbb43('0x18b')});db[_0xbb43('0x18a')][_0xbb43('0x11c')](db[_0xbb43('0xe6')],{'as':'Attachment','foreignKey':_0xbb43('0x18e')});db[_0xbb43('0x18a')]['belongsTo'](db[_0xbb43('0x52')],{'as':'Account','foreignKey':_0xbb43('0x189')});db[_0xbb43('0x133')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':_0xbb43('0x33'),'foreignKey':'OpenchannelQueueId'});db[_0xbb43('0x133')][_0xbb43('0x11e')](db[_0xbb43('0xde')],{'through':'team_has_openchannel_queues','as':_0xbb43('0x152')});db['ChatWebsite'][_0xbb43('0x10f')](db[_0xbb43('0x78')],{'as':_0xbb43('0x162'),'foreignKey':_0xbb43('0x174'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x59')][_0xbb43('0x10f')](db[_0xbb43('0x163')],{'as':_0xbb43('0x164'),'foreignKey':_0xbb43('0x174')});db[_0xbb43('0x59')]['hasMany'](db['ChatProactiveAction'],{'as':'ProactiveActions'});db['ChatWebsite'][_0xbb43('0x10f')](db[_0xbb43('0x5d')],{'as':'Interactions'});db[_0xbb43('0x59')][_0xbb43('0x10f')](db[_0xbb43('0x18f')],{'as':_0xbb43('0x167')});db[_0xbb43('0x59')][_0xbb43('0x10f')](db[_0xbb43('0x190')],{'as':'Messages'});db[_0xbb43('0x59')][_0xbb43('0x11c')](db[_0xbb43('0xf2')],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0x59')][_0xbb43('0x11c')](db[_0xbb43('0x7b')],{'as':_0xbb43('0x7b'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{'as':_0xbb43('0x15d'),'foreignKey':'MailAccountId'});db[_0xbb43('0x59')][_0xbb43('0x11c')](db[_0xbb43('0x7d')],{'as':_0xbb43('0x184'),'foreignKey':_0xbb43('0x14f')});db[_0xbb43('0x59')][_0xbb43('0x11e')](db['User'],{'as':'Agents','through':_0xbb43('0x191')});db[_0xbb43('0x5a')][_0xbb43('0x11c')](db[_0xbb43('0x52')],{});db[_0xbb43('0x5a')][_0xbb43('0x11c')](db['CmList'],{'as':'List','foreignKey':_0xbb43('0x168')});db[_0xbb43('0x5a')][_0xbb43('0x11c')](db[_0xbb43('0x68')],{'as':'Contact','foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x5a')][_0xbb43('0x11c')](db[_0xbb43('0x55')],{});db[_0xbb43('0x5a')][_0xbb43('0x11c')](db[_0xbb43('0x18a')],{});db[_0xbb43('0x5a')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0xbb43('0x18f')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':'Agent','foreignKey':_0xbb43('0x10e'),'onDelete':'restrict'});db[_0xbb43('0x18f')][_0xbb43('0x11c')](db['ChatQueue'],{'as':_0xbb43('0x192'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0xbb43('0x18f')]['belongsTo'](db['ChatWebsite'],{'as':_0xbb43('0x193'),'foreignKey':'ChatWebsiteId','onDelete':_0xbb43('0x176')});db[_0xbb43('0x18f')][_0xbb43('0x11c')](db[_0xbb43('0x16e')],{'onDelete':'restrict','foreignKey':_0xbb43('0x177')});db[_0xbb43('0x5d')][_0xbb43('0x10f')](db[_0xbb43('0x190')],{'as':_0xbb43('0x155'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x194')});db[_0xbb43('0x5d')][_0xbb43('0x11c')](db['ChatWebsite'],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x174')});db[_0xbb43('0x5d')]['belongsTo'](db['CmContact'],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x5d')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x16d'),'foreignKey':_0xbb43('0x10e')});db['ChatInteraction'][_0xbb43('0x11e')](db['Tag'],{'through':_0xbb43('0x195'),'as':_0xbb43('0x16f')});db['ChatInteraction']['belongsToMany'](db[_0xbb43('0x16e')],{'through':_0xbb43('0x195'),'as':_0xbb43('0x17f')});db[_0xbb43('0x5d')]['belongsToMany'](db[_0xbb43('0x10')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xbb43('0x194')});db[_0xbb43('0x190')]['belongsTo'](db[_0xbb43('0x10')],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x10')});db['ChatMessage'][_0xbb43('0x11c')](db['CmContact'],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db['ChatMessage'][_0xbb43('0x11c')](db[_0xbb43('0x5d')],{'onDelete':'cascade','as':_0xbb43('0x173'),'foreignKey':_0xbb43('0x194')});db[_0xbb43('0x190')][_0xbb43('0x11c')](db[_0xbb43('0xe6')],{'as':_0xbb43('0xe6'),'foreignKey':'AttachmentId'});db[_0xbb43('0x190')][_0xbb43('0x11c')](db[_0xbb43('0x59')],{'as':_0xbb43('0x16c'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xbb43('0x10f')](db['Attachment'],{'as':_0xbb43('0x172'),'foreignKey':_0xbb43('0x175'),'onDelete':_0xbb43('0x10d'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xbb43('0x68')],{'onDelete':_0xbb43('0x10d'),'as':'Contact','foreignKey':'ContactId'});db[_0xbb43('0x60')][_0xbb43('0x11c')](db['ChatWebsite'],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x174')});db[_0xbb43('0x130')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':_0xbb43('0x2b'),'hooks':!![]});db[_0xbb43('0x130')][_0xbb43('0x11e')](db[_0xbb43('0xde')],{'through':_0xbb43('0x196'),'as':_0xbb43('0x152')});db['ChatGroup'][_0xbb43('0x10f')](db[_0xbb43('0xcc')],{'as':_0xbb43('0x155'),'foreignKey':_0xbb43('0x197'),'onDelete':_0xbb43('0x10d')});db['ChatGroup'][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x144'),'through':_0xbb43('0x120')});db[_0xbb43('0x64')][_0xbb43('0x11c')](db[_0xbb43('0x59')],{'as':_0xbb43('0x193'),'foreignKey':_0xbb43('0x174')});db[_0xbb43('0x66')]['hasMany'](db[_0xbb43('0x68')],{'as':_0xbb43('0x121'),'foreignKey':_0xbb43('0x198')});db['CmContact'][_0xbb43('0x10f')](db[_0xbb43('0x146')],{'as':'Hoppers','foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x68')][_0xbb43('0x10f')](db[_0xbb43('0x6d')],{'as':'HopperFinals','foreignKey':_0xbb43('0x15c')});db['CmContact'][_0xbb43('0x10f')](db[_0xbb43('0x114')],{'as':_0xbb43('0x199'),'foreignKey':'ContactId'});db[_0xbb43('0x68')]['hasMany'](db[_0xbb43('0x6f')],{'as':_0xbb43('0x6f'),'foreignKey':'ContactId'});db[_0xbb43('0x68')][_0xbb43('0x10f')](db['JscriptySessionReport'],{'as':_0xbb43('0x14a'),'foreignKey':_0xbb43('0x15c')});db['CmContact'][_0xbb43('0x10f')](db[_0xbb43('0x55')],{'as':'OpenchannelInteractions','foreignKey':_0xbb43('0x15c'),'onDelete':'restrict'});db[_0xbb43('0x68')][_0xbb43('0x10f')](db[_0xbb43('0x5d')],{'as':_0xbb43('0x116'),'foreignKey':_0xbb43('0x15c'),'onDelete':'restrict'});db[_0xbb43('0x68')][_0xbb43('0x10f')](db['SmsInteraction'],{'as':_0xbb43('0x19a'),'foreignKey':_0xbb43('0x15c'),'onDelete':_0xbb43('0x176')});db[_0xbb43('0x68')][_0xbb43('0x10f')](db[_0xbb43('0x47')],{'as':_0xbb43('0x117'),'foreignKey':'ContactId','onDelete':_0xbb43('0x176')});db['CmContact'][_0xbb43('0x10f')](db[_0xbb43('0x3c')],{'as':_0xbb43('0x19b'),'foreignKey':_0xbb43('0x15c'),'onDelete':_0xbb43('0x176')});db[_0xbb43('0x68')][_0xbb43('0x11c')](db[_0xbb43('0x66')],{'as':_0xbb43('0x19c'),'foreignKey':_0xbb43('0x198')});db['CmContact'][_0xbb43('0x11c')](db[_0xbb43('0xf2')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0xbb43('0x68')][_0xbb43('0x11e')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0xbb43('0x68')][_0xbb43('0x11e')](db[_0xbb43('0x16e')],{'as':'Tags','through':_0xbb43('0x19d')});db[_0xbb43('0x68')]['belongsToMany'](db[_0xbb43('0x16e')],{'through':_0xbb43('0x19d'),'as':_0xbb43('0x17f')});db[_0xbb43('0x146')]['belongsTo'](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x146')]['belongsTo'](db[_0xbb43('0xf2')],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x146')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x19e'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x146')]['belongsTo'](db[_0xbb43('0x17')],{'as':'Queue','foreignKey':_0xbb43('0x145'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x146')][_0xbb43('0x11c')](db['Campaign'],{'as':_0xbb43('0xe2'),'foreignKey':_0xbb43('0x19f'),'onDelete':'cascade'});db['CmHopper'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x16d'),'foreignKey':'OwnerId'});db['CmHopperBlack']['belongsTo'](db[_0xbb43('0x68')],{'as':'Contact','foreignKey':_0xbb43('0x15c'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x6b')]['belongsTo'](db[_0xbb43('0xf2')],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168'),'onDelete':'cascade'});db['CmHopperBlack'][_0xbb43('0x11c')](db[_0xbb43('0x17')],{'as':'Queue','foreignKey':_0xbb43('0x145'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x6b')][_0xbb43('0x11c')](db[_0xbb43('0xe2')],{'as':_0xbb43('0xe2'),'foreignKey':'CampaignId','onDelete':_0xbb43('0x10d')});db[_0xbb43('0x75')]['hasMany'](db['Condition'],{'as':{'plural':'All','singular':_0xbb43('0x1a0')},'foreignKey':_0xbb43('0x1a1'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xbb43('0x10f')](db[_0xbb43('0x79')],{'as':{'plural':'Any','singular':_0xbb43('0x1a2')},'foreignKey':_0xbb43('0x1a3'),'onDelete':_0xbb43('0x10d'),'hooks':!![]});db['Automation'][_0xbb43('0x10f')](db[_0xbb43('0x73')],{'as':_0xbb43('0x1a4'),'foreignKey':_0xbb43('0x1a5'),'onDelete':_0xbb43('0x10d'),'hooks':!![]});db['Disposition'][_0xbb43('0x10f')](db[_0xbb43('0x78')],{'as':_0xbb43('0x162'),'foreignKey':_0xbb43('0x1a6'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x7b')][_0xbb43('0x10f')](db[_0xbb43('0x7b')],{'as':_0xbb43('0x1a7'),'foreignKey':'IntervalId','onDelete':_0xbb43('0x10d'),'hooks':!![],'required':![]});db[_0xbb43('0x7b')][_0xbb43('0x10f')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0xbb43('0x14e'),'onDelete':_0xbb43('0x176')});db[_0xbb43('0x7b')][_0xbb43('0x10f')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xbb43('0x14e')});db[_0xbb43('0x7b')]['hasMany'](db[_0xbb43('0x18f')],{'as':_0xbb43('0x1a8'),'foreignKey':_0xbb43('0x14e')});db[_0xbb43('0x7b')][_0xbb43('0x10f')](db[_0xbb43('0x17c')],{'as':_0xbb43('0x1a9'),'foreignKey':_0xbb43('0x14e')});db['Interval'][_0xbb43('0x10f')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xbb43('0x14e')});db[_0xbb43('0x82')][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{});db[_0xbb43('0x82')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0xbb43('0x1aa')});db[_0xbb43('0x82')][_0xbb43('0x11c')](db['AnalyticCustomReport'],{'foreignKey':_0xbb43('0x1ab')});db[_0xbb43('0x141')][_0xbb43('0x11e')](db[_0xbb43('0x1ac')],{'as':_0xbb43('0x1ad'),'through':_0xbb43('0x143'),'onDelete':_0xbb43('0x176')});db[_0xbb43('0x16e')]['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xbb43('0x16e')][_0xbb43('0x11e')](db[_0xbb43('0x5d')],{'through':_0xbb43('0x195')});db[_0xbb43('0x16e')][_0xbb43('0x11e')](db[_0xbb43('0x3c')],{'through':_0xbb43('0x170')});db[_0xbb43('0x16e')]['belongsToMany'](db[_0xbb43('0x128')],{'through':'sms_interaction_has_tags'});db[_0xbb43('0x16e')]['belongsToMany'](db[_0xbb43('0x47')],{'through':_0xbb43('0x17e')});db[_0xbb43('0x16e')][_0xbb43('0x11e')](db[_0xbb43('0x55')],{'through':_0xbb43('0x18c')});db[_0xbb43('0x16e')][_0xbb43('0x11e')](db['WhatsappInteraction'],{'through':_0xbb43('0x1ae')});db[_0xbb43('0x88')]['hasMany'](db[_0xbb43('0x79')],{'as':{'plural':_0xbb43('0x1af'),'singular':'AllCondition'},'foreignKey':_0xbb43('0x1b0'),'onDelete':_0xbb43('0x10d'),'hooks':!![]});db['Trigger']['hasMany'](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0xbb43('0x1b1')},'foreignKey':_0xbb43('0x1b2'),'onDelete':'cascade','hooks':!![]});db[_0xbb43('0x88')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0xbb43('0x1b3'),'onDelete':_0xbb43('0x10d'),'hooks':!![]});db[_0xbb43('0x8d')][_0xbb43('0x10f')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1ab'),'hooks':!![]});db[_0xbb43('0x8f')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xbb43('0x1b4'),'onDelete':'cascade','foreignKey':_0xbb43('0x1aa')});db['AnalyticMetric'][_0xbb43('0x10f')](db['AnalyticFieldReport'],{'as':_0xbb43('0x1b4'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b5')});db['AnalyticFieldReport']['belongsTo'](db[_0xbb43('0x93')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xbb43('0x10f')](db[_0xbb43('0x9a')],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0x9a')][_0xbb43('0x10f')](db[_0xbb43('0x9c')],{'as':_0xbb43('0x1b8'),'onDelete':'cascade','foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0x9a')][_0xbb43('0x10f')](db[_0xbb43('0x9c')],{'as':_0xbb43('0x1ba'),'onDelete':'cascade','foreignKey':_0xbb43('0x1bb')});db['SalesforceConfiguration'][_0xbb43('0x10f')](db[_0xbb43('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0x9a')][_0xbb43('0x11c')](db['SalesforceAccount'],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0x9c')][_0xbb43('0x10f')](db['SalesforceField'],{'as':_0xbb43('0x1bd'),'foreignKey':'SubjectId'});db[_0xbb43('0x9c')][_0xbb43('0x10f')](db['SalesforceField'],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db['SalesforceField'][_0xbb43('0x10f')](db['SalesforceField'],{'as':_0xbb43('0x1bf'),'foreignKey':'FieldId'});db[_0xbb43('0x9c')][_0xbb43('0x11c')](db[_0xbb43('0x8a')],{'as':'Variable','foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0x9e')][_0xbb43('0x10f')](db[_0xbb43('0x1c1')],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':'AccountId'});db[_0xbb43('0x1c1')][_0xbb43('0x10f')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0x1c1')][_0xbb43('0x10f')](db[_0xbb43('0xa1')],{'as':_0xbb43('0x1ba'),'onDelete':_0xbb43('0x10d'),'foreignKey':'DescriptionId'});db[_0xbb43('0x1c1')][_0xbb43('0x10f')](db[_0xbb43('0xa1')],{'as':'Fields','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0x1c1')]['belongsTo'](db[_0xbb43('0x9e')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xa1')][_0xbb43('0x10f')](db[_0xbb43('0xa1')],{'as':_0xbb43('0x1bd'),'foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0xa1')]['hasMany'](db[_0xbb43('0xa1')],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0xa1')]['hasMany'](db[_0xbb43('0xa1')],{'as':'Field','foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xa1')][_0xbb43('0x11c')](db[_0xbb43('0x8a')],{'as':_0xbb43('0x8a'),'foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xa3')][_0xbb43('0x10f')](db[_0xbb43('0xa4')],{'as':'Configurations','onDelete':_0xbb43('0x10d'),'foreignKey':'AccountId'});db[_0xbb43('0xa4')]['hasMany'](db[_0xbb43('0xa6')],{'as':'Subjects','onDelete':_0xbb43('0x10d'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0xbb43('0x10f')](db[_0xbb43('0xa6')],{'as':_0xbb43('0x1ba'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0xa4')][_0xbb43('0x10f')](db[_0xbb43('0xa6')],{'as':_0xbb43('0x1b4'),'onDelete':_0xbb43('0x10d'),'foreignKey':'FieldId'});db[_0xbb43('0xa4')][_0xbb43('0x11c')](db[_0xbb43('0xa3')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xa4')][_0xbb43('0x11e')](db[_0xbb43('0x16e')],{'through':_0xbb43('0x1c2')});db[_0xbb43('0xa6')]['hasMany'](db[_0xbb43('0xa6')],{'as':_0xbb43('0x1bd'),'foreignKey':'SubjectId'});db[_0xbb43('0xa6')][_0xbb43('0x10f')](db['DeskField'],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db['DeskField'][_0xbb43('0x10f')](db['DeskField'],{'as':_0xbb43('0x1bf'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xa6')]['belongsTo'](db[_0xbb43('0x8a')],{'as':_0xbb43('0x8a'),'foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xa8')][_0xbb43('0x10f')](db[_0xbb43('0xaa')],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db['ZohoConfiguration'][_0xbb43('0x10f')](db[_0xbb43('0xab')],{'as':_0xbb43('0x1b8'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0xaa')][_0xbb43('0x10f')](db['ZohoField'],{'as':'Descriptions','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0xaa')]['hasMany'](db[_0xbb43('0xab')],{'as':'Fields','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xaa')][_0xbb43('0x11c')](db[_0xbb43('0xa8')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xab')][_0xbb43('0x10f')](db[_0xbb43('0xab')],{'as':_0xbb43('0x1bd'),'foreignKey':'SubjectId'});db[_0xbb43('0xab')][_0xbb43('0x10f')](db[_0xbb43('0xab')],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db['ZohoField'][_0xbb43('0x10f')](db[_0xbb43('0xab')],{'as':_0xbb43('0x1bf'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xab')][_0xbb43('0x11c')](db[_0xbb43('0x8a')],{'as':'Variable','foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xad')]['hasMany'](db[_0xbb43('0xaf')],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xaf')][_0xbb43('0x10f')](db[_0xbb43('0xb1')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xbb43('0xaf')][_0xbb43('0x10f')](db[_0xbb43('0xb1')],{'as':_0xbb43('0x1ba'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0xaf')][_0xbb43('0x10f')](db['ZendeskField'],{'as':_0xbb43('0x1b4'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xaf')][_0xbb43('0x11c')](db[_0xbb43('0xad')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xaf')]['belongsToMany'](db['Tag'],{'through':_0xbb43('0x1c3')});db['ZendeskField'][_0xbb43('0x10f')](db[_0xbb43('0xb1')],{'as':'Subject','foreignKey':'SubjectId'});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0xb1')]['hasMany'](db[_0xbb43('0xb1')],{'as':_0xbb43('0x1bf'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xb1')]['belongsTo'](db[_0xbb43('0x8a')],{'as':_0xbb43('0x8a'),'foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xb3')][_0xbb43('0x10f')](db['FreshdeskConfiguration'],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db['FreshdeskConfiguration'][_0xbb43('0x10f')](db[_0xbb43('0xb7')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xbb43('0xb5')][_0xbb43('0x10f')](db[_0xbb43('0xb7')],{'as':_0xbb43('0x1ba'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1bb')});db['FreshdeskConfiguration'][_0xbb43('0x10f')](db['FreshdeskField'],{'as':_0xbb43('0x1b4'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1bc')});db['FreshdeskConfiguration']['belongsTo'](db['FreshdeskAccount'],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xb5')]['belongsToMany'](db['Tag'],{'through':_0xbb43('0x1c4')});db[_0xbb43('0xb7')][_0xbb43('0x10f')](db[_0xbb43('0xb7')],{'as':'Subject','foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0xb7')][_0xbb43('0x10f')](db[_0xbb43('0xb7')],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0xb7')][_0xbb43('0x10f')](db[_0xbb43('0xb7')],{'as':_0xbb43('0x1bf'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xb7')]['belongsTo'](db[_0xbb43('0x8a')],{'as':'Variable','foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xb8')][_0xbb43('0x10f')](db[_0xbb43('0xba')],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xba')][_0xbb43('0x10f')](db[_0xbb43('0x1c5')],{'as':'Subjects','foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0xba')][_0xbb43('0x10f')](db[_0xbb43('0x1c5')],{'as':_0xbb43('0x1ba'),'foreignKey':'DescriptionId'});db['VtigerConfiguration']['hasMany'](db[_0xbb43('0x1c5')],{'as':_0xbb43('0x1b4'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xba')][_0xbb43('0x11c')](db[_0xbb43('0xb8')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db['VtigerField']['hasMany'](db[_0xbb43('0x1c5')],{'as':'Subject','foreignKey':_0xbb43('0x1b9')});db['VtigerField'][_0xbb43('0x10f')](db[_0xbb43('0x1c5')],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db['VtigerField'][_0xbb43('0x10f')](db[_0xbb43('0x1c5')],{'as':_0xbb43('0x1bf'),'foreignKey':'FieldId'});db[_0xbb43('0x1c5')]['belongsTo'](db[_0xbb43('0x8a')],{'as':'Variable','foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xbd')][_0xbb43('0x10f')](db[_0xbb43('0xbf')],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xbf')][_0xbb43('0x10f')](db['ServicenowField'],{'as':_0xbb43('0x1b8'),'foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0xbf')][_0xbb43('0x10f')](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0xbb43('0x1bb')});db['ServicenowConfiguration'][_0xbb43('0x10f')](db[_0xbb43('0xc1')],{'as':_0xbb43('0x1b4'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xbf')]['belongsTo'](db[_0xbb43('0xbd')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db['ServicenowField'][_0xbb43('0x10f')](db['ServicenowField'],{'as':'Subject','foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0xc1')][_0xbb43('0x10f')](db['ServicenowField'],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0xc1')][_0xbb43('0x10f')](db[_0xbb43('0xc1')],{'as':'Field','foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xc1')][_0xbb43('0x11c')](db[_0xbb43('0x8a')],{'as':_0xbb43('0x8a'),'foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xc2')][_0xbb43('0x10f')](db[_0xbb43('0xc4')],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0xc4')]['hasMany'](db[_0xbb43('0x1c6')],{'as':_0xbb43('0x1b8'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0xc4')][_0xbb43('0x10f')](db[_0xbb43('0x1c6')],{'as':_0xbb43('0x1ba'),'onDelete':_0xbb43('0x10d'),'foreignKey':'DescriptionId'});db[_0xbb43('0xc4')][_0xbb43('0x10f')](db[_0xbb43('0x1c6')],{'as':_0xbb43('0x1b4'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0xc4')][_0xbb43('0x11c')](db[_0xbb43('0xc2')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0x1c6')][_0xbb43('0x10f')](db[_0xbb43('0x1c6')],{'as':_0xbb43('0x1bd'),'foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0x1c6')]['hasMany'](db['Dynamics365Field'],{'as':_0xbb43('0x1be'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0x1c6')]['hasMany'](db[_0xbb43('0x1c6')],{'as':_0xbb43('0x1bf'),'foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0x1c6')][_0xbb43('0x11c')](db[_0xbb43('0x8a')],{'as':'Variable','foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xc6')][_0xbb43('0x10f')](db['FreshsalesConfiguration'],{'as':_0xbb43('0x1b6'),'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0x1c7')]['hasMany'](db[_0xbb43('0x1c8')],{'as':_0xbb43('0x1b8'),'foreignKey':_0xbb43('0x1b9')});db[_0xbb43('0x1c7')][_0xbb43('0x10f')](db[_0xbb43('0x1c8')],{'as':_0xbb43('0x1ba'),'foreignKey':_0xbb43('0x1bb')});db[_0xbb43('0x1c7')][_0xbb43('0x10f')](db[_0xbb43('0x1c8')],{'as':'Fields','foreignKey':_0xbb43('0x1bc')});db[_0xbb43('0x1c7')][_0xbb43('0x11c')](db[_0xbb43('0xc6')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1b7')});db[_0xbb43('0x1c8')]['hasMany'](db[_0xbb43('0x1c8')],{'as':_0xbb43('0x1bd'),'foreignKey':_0xbb43('0x1b9')});db['FreshsalesField'][_0xbb43('0x10f')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xbb43('0x1bb')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0xbb43('0x1bf'),'foreignKey':_0xbb43('0x1bc')});db['FreshsalesField']['belongsTo'](db['Variable'],{'as':_0xbb43('0x8a'),'foreignKey':_0xbb43('0x1c0')});db[_0xbb43('0xcb')][_0xbb43('0x11c')](db[_0xbb43('0x59')],{});db[_0xbb43('0xcb')][_0xbb43('0x11c')](db['CmList'],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0xcb')]['belongsTo'](db[_0xbb43('0x68')],{'as':'Contact','foreignKey':_0xbb43('0x15c')});db[_0xbb43('0xcb')][_0xbb43('0x11c')](db[_0xbb43('0x5d')],{});db[_0xbb43('0xcb')][_0xbb43('0x11c')](db[_0xbb43('0x190')],{});db[_0xbb43('0xcb')]['belongsTo'](db[_0xbb43('0x10')],{});db['ChatQueueReport'][_0xbb43('0x11c')](db[_0xbb43('0x130')],{});db[_0xbb43('0xcc')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'onDelete':'cascade','foreignKey':_0xbb43('0x1c9')});db[_0xbb43('0xcc')][_0xbb43('0x11c')](db['User'],{'onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1ca')});db[_0xbb43('0x149')][_0xbb43('0x10f')](db[_0xbb43('0xd0')],{'foreignKey':_0xbb43('0x1cb'),'onDelete':_0xbb43('0x10d')});db[_0xbb43('0x149')]['hasMany'](db[_0xbb43('0xce')],{'foreignKey':'SessionId','onDelete':_0xbb43('0x10d')});db[_0xbb43('0xd1')][_0xbb43('0x11c')](db['SmsAccount'],{});db[_0xbb43('0xd1')][_0xbb43('0x11c')](db[_0xbb43('0xf2')],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0xd1')][_0xbb43('0x11c')](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':'ContactId'});db[_0xbb43('0xd1')][_0xbb43('0x11c')](db[_0xbb43('0x128')],{});db[_0xbb43('0xd1')][_0xbb43('0x11c')](db['SmsMessage'],{});db[_0xbb43('0xd1')][_0xbb43('0x11c')](db['User'],{});db['SmsQueueReport'][_0xbb43('0x11c')](db[_0xbb43('0x50')],{});db['JscriptyProject'][_0xbb43('0x10f')](db['JscriptySessionReport'],{'foreignKey':_0xbb43('0x1cc')});db[_0xbb43('0xd6')]['hasMany'](db[_0xbb43('0xd0')],{'foreignKey':'ProjectId'});db[_0xbb43('0xd6')][_0xbb43('0x10f')](db[_0xbb43('0xce')],{'foreignKey':_0xbb43('0x1cc')});db['SquareProject'][_0xbb43('0x11e')](db['User'],{'as':'Users','through':_0xbb43('0x13f')});db[_0xbb43('0xde')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':_0xbb43('0x125')});db[_0xbb43('0xde')][_0xbb43('0x11e')](db[_0xbb43('0x17')],{'through':'TeamVoiceQueue','as':_0xbb43('0x12c')});db[_0xbb43('0xde')]['belongsToMany'](db['MailQueue'],{'through':_0xbb43('0x16a'),'as':_0xbb43('0x12f')});db[_0xbb43('0xde')][_0xbb43('0x11e')](db['ChatQueue'],{'through':_0xbb43('0x196'),'as':_0xbb43('0x131')});db['Team'][_0xbb43('0x11e')](db[_0xbb43('0x4a')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xbb43('0xde')][_0xbb43('0x11e')](db[_0xbb43('0x50')],{'through':_0xbb43('0x188'),'as':_0xbb43('0x132')});db[_0xbb43('0xde')][_0xbb43('0x11e')](db[_0xbb43('0x133')],{'through':_0xbb43('0x1cd'),'as':_0xbb43('0x134')});db['Team']['belongsToMany'](db['WhatsappQueue'],{'through':_0xbb43('0x1ce'),'as':_0xbb43('0x135')});db[_0xbb43('0xde')]['belongsToMany'](db[_0xbb43('0xf3')],{'through':'TeamVoicePrefix','as':_0xbb43('0x12d')});db[_0xbb43('0xe2')][_0xbb43('0x10f')](db[_0xbb43('0x146')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xbb43('0xe2')][_0xbb43('0x10f')](db[_0xbb43('0x6d')],{'as':'HopperFinals','foreignKey':_0xbb43('0x19f')});db[_0xbb43('0xe2')]['hasMany'](db[_0xbb43('0x114')],{'as':'HopperHistories','foreignKey':_0xbb43('0x19f')});db[_0xbb43('0xe2')][_0xbb43('0x10f')](db[_0xbb43('0x6b')],{'as':_0xbb43('0x148'),'foreignKey':_0xbb43('0x19f')});db[_0xbb43('0xe2')][_0xbb43('0x11c')](db[_0xbb43('0x25')],{'as':_0xbb43('0x25'),'foreignKey':'TrunkId'});db[_0xbb43('0xe2')][_0xbb43('0x11c')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xbb43('0x14d')});db[_0xbb43('0xe2')]['belongsTo'](db[_0xbb43('0x7b')],{'as':_0xbb43('0x7b'),'foreignKey':'IntervalId'});db[_0xbb43('0xe2')][_0xbb43('0x11c')](db['SquareProject'],{'as':_0xbb43('0x13e'),'foreignKey':'SquareProjectId'});db[_0xbb43('0xe2')][_0xbb43('0x11e')](db[_0xbb43('0xf2')],{'as':_0xbb43('0x123'),'through':_0xbb43('0x1cf')});db[_0xbb43('0xe2')][_0xbb43('0x11e')](db[_0xbb43('0xf2')],{'as':_0xbb43('0x153'),'through':_0xbb43('0x1d0')});db[_0xbb43('0xe6')][_0xbb43('0x11c')](db['ChatOfflineMessage'],{'as':_0xbb43('0x60'),'foreignKey':_0xbb43('0x175')});db[_0xbb43('0x1d1')][_0xbb43('0x11c')](db[_0xbb43('0x165')],{});db['MailTransferReport'][_0xbb43('0x11c')](db[_0xbb43('0x3c')],{});db[_0xbb43('0x1d1')][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{'foreignKey':_0xbb43('0x1d2'),'as':_0xbb43('0x1d3')});db['MailTransferReport'][_0xbb43('0x11c')](db['User'],{'foreignKey':'FromUserId','as':_0xbb43('0x1d4')});db['MailTransferReport'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1d5'),'as':'ToAgent'});db['MailTransferReport'][_0xbb43('0x11c')](db[_0xbb43('0x12e')],{'foreignKey':_0xbb43('0x1d6'),'as':_0xbb43('0x1d7')});db[_0xbb43('0x1d1')][_0xbb43('0x11c')](db[_0xbb43('0x15d')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db['ChatTransferReport']['belongsTo'](db[_0xbb43('0x190')],{});db[_0xbb43('0xeb')][_0xbb43('0x11c')](db['ChatInteraction'],{});db[_0xbb43('0xeb')][_0xbb43('0x11c')](db[_0xbb43('0x59')],{'foreignKey':_0xbb43('0x1d8'),'as':_0xbb43('0x1d3')});db[_0xbb43('0xeb')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':'FromUserId','as':_0xbb43('0x1d4')});db[_0xbb43('0xeb')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1d5'),'as':'ToAgent'});db[_0xbb43('0xeb')][_0xbb43('0x11c')](db[_0xbb43('0x130')],{'foreignKey':_0xbb43('0x1d9'),'as':_0xbb43('0x1d7')});db[_0xbb43('0xeb')][_0xbb43('0x11c')](db['ChatWebsite'],{'foreignKey':_0xbb43('0x1da'),'as':'ToAccount'});db['FaxTransferReport'][_0xbb43('0x11c')](db['FaxMessage'],{});db[_0xbb43('0xed')][_0xbb43('0x11c')](db[_0xbb43('0x47')],{});db['FaxTransferReport'][_0xbb43('0x11c')](db[_0xbb43('0x44')],{'foreignKey':_0xbb43('0x1db'),'as':_0xbb43('0x1d3')});db['FaxTransferReport'][_0xbb43('0x11c')](db['User'],{'foreignKey':_0xbb43('0x1dc'),'as':_0xbb43('0x1d4')});db['FaxTransferReport'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1d5'),'as':_0xbb43('0x1dd')});db[_0xbb43('0xed')]['belongsTo'](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0xbb43('0x1d7')});db[_0xbb43('0xed')]['belongsTo'](db[_0xbb43('0x44')],{'foreignKey':'ToFaxAccountId','as':_0xbb43('0x1de')});db[_0xbb43('0xee')][_0xbb43('0x11c')](db[_0xbb43('0x18a')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xbb43('0x55')],{});db[_0xbb43('0xee')][_0xbb43('0x11c')](db[_0xbb43('0x52')],{'foreignKey':_0xbb43('0x1df'),'as':'FromAccount'});db[_0xbb43('0xee')]['belongsTo'](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1dc'),'as':_0xbb43('0x1d4')});db[_0xbb43('0xee')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1d5'),'as':_0xbb43('0x1dd')});db['OpenchannelTransferReport']['belongsTo'](db[_0xbb43('0x133')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0xbb43('0xee')][_0xbb43('0x11c')](db[_0xbb43('0x52')],{'foreignKey':'ToOpenchannelAccountId','as':_0xbb43('0x1de')});db[_0xbb43('0xf0')][_0xbb43('0x11c')](db[_0xbb43('0x183')],{});db[_0xbb43('0xf0')]['belongsTo'](db[_0xbb43('0x128')],{});db[_0xbb43('0xf0')][_0xbb43('0x11c')](db[_0xbb43('0x4c')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0xbb43('0xf0')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1dc'),'as':_0xbb43('0x1d4')});db[_0xbb43('0xf0')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1d5'),'as':'ToAgent'});db[_0xbb43('0xf0')][_0xbb43('0x11c')](db['SmsQueue'],{'foreignKey':_0xbb43('0x1e0'),'as':_0xbb43('0x1d7')});db[_0xbb43('0xf0')]['belongsTo'](db[_0xbb43('0x4c')],{'foreignKey':_0xbb43('0x1e1'),'as':_0xbb43('0x1de')});db[_0xbb43('0xf2')]['hasMany'](db['Disposition'],{'as':_0xbb43('0x162'),'foreignKey':'ListId','onDelete':_0xbb43('0x10d')});db[_0xbb43('0xf2')]['hasMany'](db[_0xbb43('0x71')],{'as':_0xbb43('0x1e2'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0xf2')][_0xbb43('0x10f')](db[_0xbb43('0x68')],{'as':'Contacts','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0xf2')][_0xbb43('0x10f')](db['CmHopperFinal'],{'as':_0xbb43('0x113'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0xf2')]['hasMany'](db[_0xbb43('0x114')],{'as':'HopperHistory','foreignKey':_0xbb43('0x168')});db[_0xbb43('0xf2')][_0xbb43('0x10f')](db[_0xbb43('0x6f')],{'as':_0xbb43('0x6f'),'foreignKey':'ListId'});db[_0xbb43('0xf2')][_0xbb43('0x11e')](db[_0xbb43('0x17')],{'as':_0xbb43('0x1e3'),'through':_0xbb43('0x150')});db['CmList'][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0xbb43('0x10f')](db['VoiceExtension'],{'as':_0xbb43('0x112'),'onDelete':_0xbb43('0x10d')});db['VoicePrefix']['belongsToMany'](db[_0xbb43('0x10')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xbb43('0xf3')]['belongsToMany'](db[_0xbb43('0xde')],{'through':_0xbb43('0x109'),'as':_0xbb43('0x152')});db['UserProfile'][_0xbb43('0x10f')](db[_0xbb43('0x10')],{'as':_0xbb43('0x171'),'foreignKey':'userProfileId'});db[_0xbb43('0xf5')][_0xbb43('0x10f')](db[_0xbb43('0x1e4')],{'as':_0xbb43('0x1e5'),'foreignKey':_0xbb43('0x11d'),'onDelete':'cascade'});db[_0xbb43('0x1e4')]['hasMany'](db[_0xbb43('0xf7')],{'as':_0xbb43('0x1e6'),'foreignKey':_0xbb43('0x1e7'),'onDelete':_0xbb43('0x10d')});db['WhatsappAccount'][_0xbb43('0x10f')](db[_0xbb43('0x78')],{'as':_0xbb43('0x162'),'foreignKey':_0xbb43('0x1e8'),'onDelete':'cascade'});db['WhatsappAccount'][_0xbb43('0x10f')](db[_0xbb43('0x163')],{'as':_0xbb43('0x164'),'foreignKey':_0xbb43('0x1e8')});db['WhatsappAccount'][_0xbb43('0x10f')](db[_0xbb43('0xfe')],{'as':_0xbb43('0x155'),'foreignKey':_0xbb43('0x1e8')});db[_0xbb43('0xf9')][_0xbb43('0x10f')](db[_0xbb43('0x12a')],{'as':_0xbb43('0x166')});db[_0xbb43('0xf9')][_0xbb43('0x10f')](db[_0xbb43('0xfb')],{'as':'Applications'});db['WhatsappAccount'][_0xbb43('0x11c')](db[_0xbb43('0xf2')],{'as':'List','foreignKey':_0xbb43('0x168')});db[_0xbb43('0xf9')]['belongsTo'](db[_0xbb43('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xbb43('0x14f')});db[_0xbb43('0xf9')][_0xbb43('0x11e')](db['User'],{'as':_0xbb43('0x151'),'through':_0xbb43('0x13d')});db[_0xbb43('0xfb')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'onDelete':'restrict'});db[_0xbb43('0xfb')][_0xbb43('0x11c')](db[_0xbb43('0x104')],{'onDelete':'restrict'});db[_0xbb43('0xfb')][_0xbb43('0x11c')](db[_0xbb43('0xf9')],{'onDelete':_0xbb43('0x176')});db[_0xbb43('0xfb')]['belongsTo'](db[_0xbb43('0x7b')],{'onDelete':_0xbb43('0x176'),'foreignKey':_0xbb43('0x14e')});db['WhatsappApplication'][_0xbb43('0x11c')](db[_0xbb43('0x16e')],{'onDelete':_0xbb43('0x176'),'foreignKey':'TagId'});db[_0xbb43('0x12a')][_0xbb43('0x10f')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xbb43('0x10d'),'foreignKey':_0xbb43('0x1e9')});db[_0xbb43('0x12a')][_0xbb43('0x11c')](db[_0xbb43('0xf9')],{'as':_0xbb43('0x16c'),'foreignKey':_0xbb43('0x1e8')});db[_0xbb43('0x12a')][_0xbb43('0x11c')](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db[_0xbb43('0x12a')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':_0xbb43('0x16d'),'foreignKey':_0xbb43('0x10e')});db[_0xbb43('0x12a')][_0xbb43('0x11e')](db[_0xbb43('0x16e')],{'through':_0xbb43('0x1ae'),'as':'Tags'});db[_0xbb43('0x12a')][_0xbb43('0x11e')](db[_0xbb43('0x16e')],{'through':_0xbb43('0x1ae'),'as':'ThroughTags'});db[_0xbb43('0x12a')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x171'),'through':_0xbb43('0x12b'),'foreignKey':_0xbb43('0x1e9')});db[_0xbb43('0xfe')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'as':'User'});db[_0xbb43('0xfe')]['belongsTo'](db['CmContact'],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x15b')});db[_0xbb43('0xfe')][_0xbb43('0x11c')](db[_0xbb43('0x12a')],{'onDelete':_0xbb43('0x10d'),'as':_0xbb43('0x173'),'foreignKey':'WhatsappInteractionId'});db[_0xbb43('0xfe')][_0xbb43('0x11c')](db['WhatsappAccount'],{'as':_0xbb43('0x16c'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db[_0xbb43('0xf9')],{});db[_0xbb43('0x100')][_0xbb43('0x11c')](db['CmList'],{'as':_0xbb43('0x178'),'foreignKey':_0xbb43('0x168')});db[_0xbb43('0x100')]['belongsTo'](db[_0xbb43('0x68')],{'as':_0xbb43('0x15b'),'foreignKey':_0xbb43('0x15c')});db['WhatsappQueueReport'][_0xbb43('0x11c')](db[_0xbb43('0x12a')],{});db[_0xbb43('0x100')]['belongsTo'](db[_0xbb43('0x104')],{});db[_0xbb43('0x100')][_0xbb43('0x11c')](db[_0xbb43('0xfe')],{});db[_0xbb43('0x100')]['belongsTo'](db[_0xbb43('0x10')],{});db[_0xbb43('0x102')][_0xbb43('0x11c')](db[_0xbb43('0xfe')],{});db[_0xbb43('0x102')][_0xbb43('0x11c')](db[_0xbb43('0x12a')],{});db['WhatsappTransferReport'][_0xbb43('0x11c')](db['WhatsappAccount'],{'foreignKey':_0xbb43('0x1ea'),'as':_0xbb43('0x1d3')});db[_0xbb43('0x102')][_0xbb43('0x11c')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db['WhatsappTransferReport'][_0xbb43('0x11c')](db['WhatsappQueue'],{'foreignKey':_0xbb43('0x1eb'),'as':'ToQueue'});db['WhatsappTransferReport'][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1dc'),'as':_0xbb43('0x1d4')});db[_0xbb43('0x102')][_0xbb43('0x11c')](db[_0xbb43('0x10')],{'foreignKey':_0xbb43('0x1d5'),'as':_0xbb43('0x1dd')});db[_0xbb43('0x104')][_0xbb43('0x11e')](db[_0xbb43('0x10')],{'as':_0xbb43('0x151'),'through':_0xbb43('0x35'),'foreignKey':_0xbb43('0x1ec')});db[_0xbb43('0x104')][_0xbb43('0x11e')](db[_0xbb43('0xde')],{'through':_0xbb43('0x1ce'),'as':'Teams'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x9ffd=['ScreenRecording','VoiceMailMessage','Messages','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','VoiceCallReport','Contact','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','Answers','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','Items','FaxAccountId','Interactions','FaxApplication','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatGroupId','chat_group_has_users','CmCompany','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','Automation','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Actions','Fields','MetricId','Configurations','Subjects','SubjectId','FieldId','AccountId','Subject','DescriptionId','Field','VariableId','Description','int_desk_configuration_has_tags','ZohoConfiguration','Descriptions','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesAccount','FreshsalesField','FromId','ToId','SessionId','ProjectId','user_has_square_projects','MailQueues','ChatQueues','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','VoicePrefix','TeamVoicePrefix','TrunkBackup','TrunkBackupId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','ToUserId','ToAgent','ToChatQueueId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserVoicePrefix','userProfileId','UserProfileSection','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_accounts','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','database','username','options','password','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','Team','Campaign','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','User','hasMany','VoiceRecording','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','SenderId','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','FaxQueues','SmsQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','WhatsappAccounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','CmHopper','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','IntervalId','Agents','Teams','voice_queues_has_cm_blacklists'];(function(_0xeba049,_0x1096ae){var _0x375207=function(_0x3d5cb5){while(--_0x3d5cb5){_0xeba049['push'](_0xeba049['shift']());}};_0x375207(++_0x1096ae);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xe6d7d1,_0x1752d1){_0xe6d7d1=_0xe6d7d1-0x0;var _0xee04c2=_0x9ffd[_0xe6d7d1];return _0xee04c2;};'use strict';var config=require(_0xd9ff('0x0'));var Sequelize=require(_0xd9ff('0x1'));var _=require(_0xd9ff('0x2'));var jstz=require('jstz');var timezone=jstz[_0xd9ff('0x3')]();config[_0xd9ff('0x1')]=_[_0xd9ff('0x4')](config[_0xd9ff('0x1')],{'database':'motion2','username':_0xd9ff('0x5'),'password':_0xd9ff('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xd9ff('0x7'),'dialectOptions':{'charset':_0xd9ff('0x8')},'logging':![],'timezone':timezone[_0xd9ff('0x9')](),'define':{'charset':_0xd9ff('0xa'),'collate':_0xd9ff('0xb')}}});config[_0xd9ff('0xc')]=_[_0xd9ff('0x4')](config[_0xd9ff('0xc')],{'database':_0xd9ff('0xd'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd9ff('0x8')},'logging':![],'timezone':timezone[_0xd9ff('0x9')](),'define':{'charset':_0xd9ff('0xa'),'collate':_0xd9ff('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd9ff('0x1')][_0xd9ff('0xe')],config[_0xd9ff('0x1')][_0xd9ff('0xf')],config['sequelize']['password'],config[_0xd9ff('0x1')][_0xd9ff('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd9ff('0xc')][_0xd9ff('0xe')],config[_0xd9ff('0xc')]['username'],config[_0xd9ff('0xc')][_0xd9ff('0x11')],config['sequelizeHistory'][_0xd9ff('0x10')])};db['User']=db['sequelize']['import']('../api/user/user.model');db[_0xd9ff('0x12')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x14'));db[_0xd9ff('0x15')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x16'));db[_0xd9ff('0x17')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x18'));db[_0xd9ff('0x19')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db['sequelize']['import'](_0xd9ff('0x1a'));db['ScreenRecording']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x1b'));db[_0xd9ff('0x1c')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x1d'));db['VoiceCallReport']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x1e'));db[_0xd9ff('0x1f')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0xd9ff('0x20')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x21'));db['VoiceQueueReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x22'));db[_0xd9ff('0x23')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x24'));db[_0xd9ff('0x25')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x26'));db['VoiceTransferReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x27'));db['UserVoiceQueueRt']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x28'));db[_0xd9ff('0x29')]=db['sequelize'][_0xd9ff('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd9ff('0x2a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x2b'));db[_0xd9ff('0x2c')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x2d'));db[_0xd9ff('0x2e')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x2f'));db[_0xd9ff('0x30')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x31'));db[_0xd9ff('0x32')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x33'));db['UserWhatsappQueue']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x34'));db['MailServerIn']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x35'));db['MailServerOut']=db['sequelize']['import'](_0xd9ff('0x36'));db[_0xd9ff('0x37')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x38'));db[_0xd9ff('0x39')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0xd9ff('0x3a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x3b'));db['MailInteraction']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x3c'));db[_0xd9ff('0x3d')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/mailMessage/mailMessage.model');db[_0xd9ff('0x3e')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x3f'));db[_0xd9ff('0x40')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x41'));db[_0xd9ff('0x42')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x43'));db[_0xd9ff('0x44')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0xd9ff('0x45')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x46'));db[_0xd9ff('0x47')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0xd9ff('0x48')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x49'));db[_0xd9ff('0x4a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x4b'));db['FaxQueueReport']=db['sequelize']['import'](_0xd9ff('0x4c'));db['SmsAccount']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x4d'));db['SmsApplication']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/smsApplication/smsApplication.model');db[_0xd9ff('0x4e')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x4f'));db['SmsMessage']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x50'));db['SmsQueue']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x51'));db[_0xd9ff('0x52')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x53'));db[_0xd9ff('0x54')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x55'));db[_0xd9ff('0x56')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x57'));db[_0xd9ff('0x58')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x59'));db[_0xd9ff('0x5a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x5b'));db[_0xd9ff('0x5c')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xd9ff('0x5d')]=db['sequelize'][_0xd9ff('0x13')]('../api/chatApplication/chatApplication.model');db[_0xd9ff('0x5e')]=db['sequelize'][_0xd9ff('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xd9ff('0x5f')]=db['sequelize'][_0xd9ff('0x13')]('../api/chatMessage/chatMessage.model');db[_0xd9ff('0x60')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x61'));db[_0xd9ff('0x62')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x63'));db[_0xd9ff('0x64')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x65'));db[_0xd9ff('0x66')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x67'));db['CmCompany']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x68'));db[_0xd9ff('0x69')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x6a'));db['CmHopper']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/cmHopper/cmHopper.model');db[_0xd9ff('0x6b')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x6c'));db[_0xd9ff('0x6d')]=db[_0xd9ff('0x1')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0xd9ff('0x6e')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x6f'));db[_0xd9ff('0x70')]=db[_0xd9ff('0x1')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x71'));db[_0xd9ff('0x72')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x73'));db['Automation']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x74'));db[_0xd9ff('0x75')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x76'));db[_0xd9ff('0x77')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x78'));db['Condition']=db['sequelize'][_0xd9ff('0x13')]('../api/condition/condition.model');db[_0xd9ff('0x79')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x7a'));db[_0xd9ff('0x7b')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x7c'));db['Cdr']=db[_0xd9ff('0x1')]['import']('../api/cdr/cdr.model');db[_0xd9ff('0x7d')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x7e'));db['Schedule']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x7f'));db[_0xd9ff('0x80')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x81'));db[_0xd9ff('0x82')]=db['sequelize']['import']('../api/tag/tag.model');db[_0xd9ff('0x83')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x84'));db[_0xd9ff('0x85')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x86'));db[_0xd9ff('0x87')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/variable/variable.model');db[_0xd9ff('0x88')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/integration/integration.model');db[_0xd9ff('0x89')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x8a'));db[_0xd9ff('0x8b')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x8c'));db[_0xd9ff('0x8d')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x8e'));db[_0xd9ff('0x8f')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x90'));db[_0xd9ff('0x91')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x92'));db[_0xd9ff('0x93')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x94'));db['AnalyticTreeReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xd9ff('0x95')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xd9ff('0x96')]=db['sequelize'][_0xd9ff('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xd9ff('0x97')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x98'));db[_0xd9ff('0x99')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x9a'));db[_0xd9ff('0x9b')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x9c'));db[_0xd9ff('0x9d')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x9e'));db[_0xd9ff('0x9f')]=db['sequelize']['import'](_0xd9ff('0xa0'));db[_0xd9ff('0xa1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa2'));db[_0xd9ff('0xa3')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xa4'));db[_0xd9ff('0xa5')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa6'));db['ZohoConfiguration']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa7'));db[_0xd9ff('0xa8')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa9'));db[_0xd9ff('0xaa')]=db['sequelize'][_0xd9ff('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xd9ff('0xab')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xac'));db[_0xd9ff('0xad')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xae'));db[_0xd9ff('0xaf')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xb0'));db[_0xd9ff('0xb1')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xb2'));db[_0xd9ff('0xb3')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xb4'));db[_0xd9ff('0xb5')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xb6'));db[_0xd9ff('0xb7')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xb8'));db[_0xd9ff('0xb9')]=db['sequelize'][_0xd9ff('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0xd9ff('0xba')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xbb'));db[_0xd9ff('0xbc')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xbd'));db[_0xd9ff('0xbe')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0xd9ff('0xbf')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xc0'));db[_0xd9ff('0xc1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xc2'));db[_0xd9ff('0xc3')]=db['sequelize']['import'](_0xd9ff('0xc4'));db['FreshsalesAccount']=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xd9ff('0xc5')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xc6'));db['Integration']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xc7'));db[_0xd9ff('0xc8')]=db[_0xd9ff('0x1')]['import']('../api/network/network.model');db[_0xd9ff('0xc9')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xca'));db[_0xd9ff('0xcb')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xcc'));db[_0xd9ff('0xcd')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xce'));db[_0xd9ff('0xcf')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xd0'));db[_0xd9ff('0xd1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xd9ff('0xd2')]=db[_0xd9ff('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0xd9ff('0xd3')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xd4'));db[_0xd9ff('0xd5')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xd6'));db[_0xd9ff('0xd7')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xd8'));db[_0xd9ff('0xd9')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xda'));db[_0xd9ff('0xdb')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xdc'));db['SquareRecording']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xdd'));db[_0xd9ff('0xde')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/squareMessage/squareMessage.model');db[_0xd9ff('0xdf')]=db[_0xd9ff('0x1')]['import']('../api/team/team.model');db['License']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/license/license.model');db[_0xd9ff('0xe0')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0xd9ff('0x13')]('../api/migration/migration.model');db[_0xd9ff('0xe1')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xe2'));db[_0xd9ff('0xe3')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xe4'));db['MailTransferReport']=db[_0xd9ff('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xe5'));db[_0xd9ff('0xe6')]=db['sequelize']['import'](_0xd9ff('0xe7'));db[_0xd9ff('0xe8')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xe9'));db['SmsTransferReport']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xea'));db[_0xd9ff('0xeb')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xec'));db['VoicePrefix']=db[_0xd9ff('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db[_0xd9ff('0xed')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xee'));db['UserProfileSection']=db['sequelize'][_0xd9ff('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xef'));db['UserNotification']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf0'));db[_0xd9ff('0xf1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf2'));db['WhatsappApplication']=db[_0xd9ff('0x1')]['import']('../api/whatsappApplication/whatsappApplication.model');db[_0xd9ff('0xf3')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xf4'));db['WhatsappMessage']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xf5'));db[_0xd9ff('0xf6')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf7'));db[_0xd9ff('0xf8')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf9'));db[_0xd9ff('0xfa')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db['sequelize'][_0xd9ff('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0xd9ff('0xfb')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xfc'));db['TeamVoicePrefix']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xfd'));db['UserVoicePrefix']=db['sequelize']['import'](_0xd9ff('0xfe'));db['User'][_0xd9ff('0xff')](db['VoiceMail'],{'as':_0xd9ff('0x1c'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x104')],{'as':'Recordings','foreignKey':'UserId'});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x105')],{'as':_0xd9ff('0x106'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x107'),'onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db['CmHopperFinal'],{'as':_0xd9ff('0x108'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x109'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x70')],{'as':_0xd9ff('0x70'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x10a')],{'as':_0xd9ff('0x10b'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')]['hasMany'](db[_0xd9ff('0x5e')],{'as':_0xd9ff('0x10c'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x10d'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db['FaxInteraction'],{'as':_0xd9ff('0x10e'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x10f')],{'as':_0xd9ff('0x110'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db[_0xd9ff('0xf3')],{'as':_0xd9ff('0x111'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db[_0xd9ff('0x112')],{'as':'UserNotifications','foreignKey':_0xd9ff('0x113')});db[_0xd9ff('0x102')]['belongsTo'](db['UserProfile'],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x64')],{'as':'Groups','through':'chat_group_has_users'});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x115'),'through':_0xd9ff('0x116')});db['User']['belongsToMany'](db['CmList'],{'as':_0xd9ff('0x117'),'through':_0xd9ff('0x118')});db['User'][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x119')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x10f')],{'as':_0xd9ff('0x110'),'through':_0xd9ff('0x11a')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x5e')],{'as':_0xd9ff('0x10c'),'through':_0xd9ff('0x11b')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x47')],{'as':_0xd9ff('0x10e'),'through':_0xd9ff('0x11c')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x10d'),'through':_0xd9ff('0x11d')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x10a')],{'as':_0xd9ff('0x10b'),'through':_0xd9ff('0x11e')});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0xf3')],{'as':_0xd9ff('0x111'),'through':'user_has_whatsapp_interactions'});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x11f')],{'as':_0xd9ff('0x120'),'through':_0xd9ff('0x29'),'required':![]});db[_0xd9ff('0x102')]['belongsToMany'](db['VoicePrefix'],{'as':_0xd9ff('0x121'),'through':'UserVoicePrefix','required':![]});db['User'][_0xd9ff('0x114')](db[_0xd9ff('0x39')],{'as':'MailQueues','through':_0xd9ff('0x2c'),'required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x62')],{'as':'ChatQueues','through':_0xd9ff('0x2a'),'required':![],'hooks':!![]});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0x4a')],{'as':_0xd9ff('0x122'),'through':'UserFaxQueue','required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x123')],{'as':'SmsQueues','through':_0xd9ff('0x30'),'required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db['OpenchannelQueue'],{'as':_0xd9ff('0x124'),'through':'UserOpenchannelQueue','required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0xfa')],{'as':_0xd9ff('0x125'),'through':_0xd9ff('0x126'),'required':![]});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0xeb')],{'through':_0xd9ff('0x118')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x5a')],{'as':'ChatWebsites','through':_0xd9ff('0x127')});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0x45')],{'as':_0xd9ff('0x128'),'through':_0xd9ff('0x129')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x37')],{'as':_0xd9ff('0x12a'),'through':_0xd9ff('0x12b')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x52')],{'as':_0xd9ff('0x12c'),'through':_0xd9ff('0x12d')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x12e')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db['User'][_0xd9ff('0x114')](db['WhatsappAccount'],{'as':_0xd9ff('0x12f'),'through':'user_has_whatsapp_accounts'});db['User']['belongsToMany'](db[_0xd9ff('0xdb')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0xd9ff('0x12')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x130'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x131')});db[_0xd9ff('0x15')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x17')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x132'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xd9ff('0x114')](db[_0xd9ff('0x80')],{'as':_0xd9ff('0x133'),'through':_0xd9ff('0x134')});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x105')],{'as':_0xd9ff('0x135'),'foreignKey':'VoiceQueueId'});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x136')],{'as':_0xd9ff('0x137'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xd9ff('0x103')](db[_0xd9ff('0x6d')],{'as':'HopperFinals','foreignKey':_0xd9ff('0x138')});db[_0xd9ff('0x11f')]['hasMany'](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x139'),'foreignKey':_0xd9ff('0x138')});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x70')],{'as':_0xd9ff('0x70'),'foreignKey':'VoiceQueueId'});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x6b')],{'as':_0xd9ff('0x13a'),'foreignKey':_0xd9ff('0x138')});db['VoiceQueue'][_0xd9ff('0x103')](db[_0xd9ff('0xd1')],{'as':_0xd9ff('0x13b'),'foreignKey':'VoiceQueueId'});db[_0xd9ff('0x11f')][_0xd9ff('0x13c')](db[_0xd9ff('0x25')],{'as':'Trunk','foreignKey':_0xd9ff('0x13d')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xd9ff('0x11f')][_0xd9ff('0x13c')](db['Interval'],{'as':_0xd9ff('0x79'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x11f')]['belongsTo'](db[_0xd9ff('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xd9ff('0x11f')][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xd9ff('0x11f')][_0xd9ff('0x114')](db['User'],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x29')});db[_0xd9ff('0x11f')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'as':_0xd9ff('0x140'),'through':_0xd9ff('0xfb')});db['VoiceQueue'][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':'BlackLists','through':_0xd9ff('0x141')});db[_0xd9ff('0x104')]['belongsTo'](db[_0xd9ff('0x102')],{'as':'User','foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x142')]['belongsTo'](db[_0xd9ff('0x102')],{'as':'User','foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x1c')][_0xd9ff('0x103')](db[_0xd9ff('0x143')],{'as':_0xd9ff('0x144'),'onDelete':_0xd9ff('0x100'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0xd9ff('0x143')]['belongsTo'](db[_0xd9ff('0x1c')],{'foreignKey':_0xd9ff('0x145'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0xd9ff('0x146')],{'as':_0xd9ff('0x147'),'foreignKey':_0xd9ff('0x148'),'constraints':![]});db['VoiceCallReport'][_0xd9ff('0x103')](db[_0xd9ff('0x20')],{'as':_0xd9ff('0x149'),'foreignKey':_0xd9ff('0x148'),'constraints':![]});db[_0xd9ff('0x14a')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':'User','foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x14a')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x14d')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'as':_0xd9ff('0x37'),'foreignKey':_0xd9ff('0x14e')});db['MailServerOut']['belongsTo'](db[_0xd9ff('0x37')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xd9ff('0x37')][_0xd9ff('0xff')](db[_0xd9ff('0x14d')],{'as':_0xd9ff('0x14f'),'onDelete':_0xd9ff('0x100')});db['MailAccount'][_0xd9ff('0xff')](db['MailServerOut'],{'as':_0xd9ff('0x150'),'onDelete':_0xd9ff('0x100')});db['MailAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x14e'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x37')][_0xd9ff('0x103')](db['CannedAnswer'],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x14e')});db[_0xd9ff('0x37')][_0xd9ff('0x103')](db[_0xd9ff('0x3d')],{'as':_0xd9ff('0x144'),'foreignKey':'MailAccountId'});db[_0xd9ff('0x37')][_0xd9ff('0x103')](db[_0xd9ff('0x10f')],{'as':'Interactions'});db[_0xd9ff('0x37')]['hasMany'](db[_0xd9ff('0x3e')],{'as':'Applications'});db[_0xd9ff('0x37')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':'List','foreignKey':_0xd9ff('0x153')});db['MailAccount'][_0xd9ff('0x13c')](db[_0xd9ff('0x83')],{'as':_0xd9ff('0x83'),'foreignKey':_0xd9ff('0x154')});db[_0xd9ff('0x37')]['belongsTo'](db[_0xd9ff('0x7b')],{'as':_0xd9ff('0x155'),'foreignKey':_0xd9ff('0x156')});db[_0xd9ff('0x37')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xd9ff('0x39')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x2c')});db[_0xd9ff('0x39')][_0xd9ff('0x114')](db['Team'],{'through':_0xd9ff('0x157'),'as':_0xd9ff('0x140')});db[_0xd9ff('0x10f')][_0xd9ff('0x103')](db[_0xd9ff('0x3d')],{'as':_0xd9ff('0x144'),'onDelete':'cascade','foreignKey':_0xd9ff('0x158')});db[_0xd9ff('0x10f')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x14e')});db['MailInteraction']['belongsTo'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x10f')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db['MailInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x15b'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x10f')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x15b'),'as':'ThroughTags'});db['MailInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11a'),'foreignKey':_0xd9ff('0x158')});db[_0xd9ff('0x3d')][_0xd9ff('0x103')](db[_0xd9ff('0xe1')],{'as':'Attachments','onDelete':_0xd9ff('0x100')});db['MailMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x102')});db[_0xd9ff('0x3d')]['belongsTo'](db[_0xd9ff('0x69')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b')});db[_0xd9ff('0x3d')][_0xd9ff('0x13c')](db[_0xd9ff('0x10f')],{'as':_0xd9ff('0x15e'),'foreignKey':_0xd9ff('0x158')});db[_0xd9ff('0x3d')]['belongsTo'](db[_0xd9ff('0x37')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xd9ff('0x3d')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x5a'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x3d')][_0xd9ff('0x13c')](db[_0xd9ff('0x60')],{'as':_0xd9ff('0x60'),'foreignKey':_0xd9ff('0x160')});db[_0xd9ff('0x3e')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db['MailApplication'][_0xd9ff('0x13c')](db[_0xd9ff('0x39')],{'onDelete':'restrict'});db['MailApplication'][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'onDelete':'restrict'});db[_0xd9ff('0x3e')][_0xd9ff('0x13c')](db['Interval'],{'onDelete':_0xd9ff('0x161'),'foreignKey':'IntervalId'});db[_0xd9ff('0x3e')][_0xd9ff('0x13c')](db[_0xd9ff('0x82')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x162')});db[_0xd9ff('0x40')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{});db[_0xd9ff('0x40')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x40')]['belongsTo'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x40')][_0xd9ff('0x13c')](db[_0xd9ff('0x10f')],{});db['MailQueueReport']['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{});db['MailQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x39')],{});db[_0xd9ff('0x42')]['hasMany'](db['DashboardItem'],{'as':_0xd9ff('0x164'),'onDelete':_0xd9ff('0x100')});db['FaxAccount']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x165')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x47')],{'as':_0xd9ff('0x166')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x167')],{'as':_0xd9ff('0x132')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':'Exntensions','onDelete':_0xd9ff('0x100')});db['FaxAccount'][_0xd9ff('0x103')](db['FaxMessage'],{'as':_0xd9ff('0x144')});db[_0xd9ff('0x45')][_0xd9ff('0x13c')](db['Trunk'],{'as':'Trunk'});db['FaxAccount']['belongsTo'](db['CmList'],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x45')][_0xd9ff('0x13c')](db[_0xd9ff('0x7b')],{'as':_0xd9ff('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd9ff('0x45')][_0xd9ff('0x114')](db['User'],{'as':'Agents','through':_0xd9ff('0x129')});db[_0xd9ff('0x167')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x167')]['belongsTo'](db[_0xd9ff('0x4a')],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x167')][_0xd9ff('0x13c')](db['FaxAccount'],{'onDelete':'restrict'});db[_0xd9ff('0x167')][_0xd9ff('0x13c')](db['Tag'],{'onDelete':_0xd9ff('0x161'),'foreignKey':'TagId'});db[_0xd9ff('0x47')][_0xd9ff('0x103')](db[_0xd9ff('0x48')],{'as':_0xd9ff('0x144'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x168')});db['FaxInteraction']['belongsTo'](db[_0xd9ff('0x45')],{'as':'Account','foreignKey':_0xd9ff('0x165')});db['FaxInteraction'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':'ContactId'});db[_0xd9ff('0x47')][_0xd9ff('0x13c')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xd9ff('0x47')][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x169'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x47')][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':'fax_interaction_has_tags','as':_0xd9ff('0x16a')});db[_0xd9ff('0x47')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11c'),'foreignKey':_0xd9ff('0x168')});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db['User'],{'onDelete':'cascade','as':'User'});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db['FaxInteraction'],{'as':_0xd9ff('0x15e'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b')});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db['Attachment'],{'as':_0xd9ff('0xe1'),'foreignKey':_0xd9ff('0x16b')});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xd9ff('0x4a')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x2e')});db[_0xd9ff('0x4a')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x16c'),'as':_0xd9ff('0x140')});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{});db['FaxQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x47')],{});db[_0xd9ff('0x16d')]['belongsTo'](db[_0xd9ff('0x48')],{});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{});db['FaxQueueReport'][_0xd9ff('0x13c')](db['FaxQueue'],{});db['SmsAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x16e'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x12e')][_0xd9ff('0x103')](db['CannedAnswer'],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x16e')});db['SmsAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x16f')],{'as':_0xd9ff('0x144'),'foreignKey':_0xd9ff('0x16e')});db[_0xd9ff('0x12e')][_0xd9ff('0x103')](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x166')});db[_0xd9ff('0x12e')][_0xd9ff('0x103')](db[_0xd9ff('0x170')],{'as':'Applications'});db['SmsAccount'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x12e')][_0xd9ff('0x13c')](db[_0xd9ff('0x7b')],{'as':_0xd9ff('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd9ff('0x12e')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'user_has_sms_accounts'});db[_0xd9ff('0x170')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db['SmsApplication']['belongsTo'](db[_0xd9ff('0x123')],{'onDelete':'restrict'});db['SmsApplication'][_0xd9ff('0x13c')](db['SmsAccount'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x170')][_0xd9ff('0x13c')](db[_0xd9ff('0x79')],{'onDelete':_0xd9ff('0x161'),'foreignKey':'IntervalId'});db[_0xd9ff('0x170')][_0xd9ff('0x13c')](db['Tag'],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x162')});db['SmsInteraction']['hasMany'](db[_0xd9ff('0x16f')],{'as':'Messages','onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xd9ff('0x4e')]['belongsTo'](db['SmsAccount'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x16e')});db[_0xd9ff('0x4e')][_0xd9ff('0x13c')](db['CmContact'],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x4e')][_0xd9ff('0x13c')](db['User'],{'as':_0xd9ff('0x15a'),'foreignKey':'UserId'});db['SmsInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x171'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x4e')][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x171'),'as':_0xd9ff('0x16a')});db['SmsInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11d'),'foreignKey':_0xd9ff('0x172')});db[_0xd9ff('0x16f')]['belongsTo'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x102')});db[_0xd9ff('0x16f')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'onDelete':'cascade','as':_0xd9ff('0x14b')});db[_0xd9ff('0x16f')][_0xd9ff('0x13c')](db[_0xd9ff('0x4e')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x15e'),'foreignKey':_0xd9ff('0x172')});db['SmsMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x12e')],{'as':'Account','foreignKey':_0xd9ff('0x16e')});db[_0xd9ff('0x123')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x30'),'foreignKey':_0xd9ff('0x173')});db[_0xd9ff('0x123')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':'team_has_sms_queues','as':_0xd9ff('0x140')});db[_0xd9ff('0x52')]['hasMany'](db[_0xd9ff('0x77')],{'as':'Dispositions','foreignKey':_0xd9ff('0x174'),'onDelete':_0xd9ff('0x100')});db['OpenchannelAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0xd9ff('0x52')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xd9ff('0x166'),'foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x52')][_0xd9ff('0x103')](db[_0xd9ff('0x56')],{'as':'Messages','foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x52')][_0xd9ff('0x103')](db[_0xd9ff('0x54')],{'as':'Applications','foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x52')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x52')][_0xd9ff('0x13c')](db['Pause'],{'as':_0xd9ff('0x155'),'foreignKey':_0xd9ff('0x156')});db[_0xd9ff('0x52')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x12d')});db['OpenchannelApplication'][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x58')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x175')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x79')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x82')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x162')});db['OpenchannelInteraction'][_0xd9ff('0x103')](db[_0xd9ff('0x56')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xd9ff('0x176')});db[_0xd9ff('0x10a')][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x174')});db['OpenchannelInteraction'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x10a')]['belongsTo'](db['User'],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db['OpenchannelInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x177'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x10a')]['belongsToMany'](db[_0xd9ff('0x82')],{'through':'openchannel_interaction_has_tags','as':_0xd9ff('0x16a')});db['OpenchannelInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11e'),'foreignKey':_0xd9ff('0x176')});db[_0xd9ff('0x56')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x100'),'as':'User'});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b')});db['OpenchannelMessage'][_0xd9ff('0x13c')](db['OpenchannelInteraction'],{'onDelete':_0xd9ff('0x100'),'as':'Interaction','foreignKey':_0xd9ff('0x176')});db[_0xd9ff('0x56')]['belongsTo'](db[_0xd9ff('0xe1')],{'as':_0xd9ff('0xe1'),'foreignKey':_0xd9ff('0x16b')});db[_0xd9ff('0x56')]['belongsTo'](db[_0xd9ff('0x52')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x58')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0xd9ff('0x175')});db[_0xd9ff('0x58')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x178'),'as':_0xd9ff('0x140')});db['ChatWebsite'][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x15f'),'onDelete':_0xd9ff('0x100')});db['ChatWebsite'][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x5a')][_0xd9ff('0x103')](db[_0xd9ff('0x66')],{'as':_0xd9ff('0x179')});db['ChatWebsite'][_0xd9ff('0x103')](db['ChatInteraction'],{'as':_0xd9ff('0x166')});db[_0xd9ff('0x5a')][_0xd9ff('0x103')](db[_0xd9ff('0x5d')],{'as':_0xd9ff('0x132')});db[_0xd9ff('0x5a')][_0xd9ff('0x103')](db['ChatMessage'],{'as':_0xd9ff('0x144')});db[_0xd9ff('0x5a')]['belongsTo'](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db['ChatWebsite']['belongsTo'](db[_0xd9ff('0x79')],{'as':_0xd9ff('0x79'),'foreignKey':_0xd9ff('0x13e')});db['ChatWebsite'][_0xd9ff('0x13c')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xd9ff('0x14e')});db[_0xd9ff('0x5a')][_0xd9ff('0x13c')](db['Pause'],{'as':_0xd9ff('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{});db['OpenchannelQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':'ListId'});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':'Contact','foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db[_0xd9ff('0x10a')],{});db['OpenchannelQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x56')],{});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db['User'],{});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db[_0xd9ff('0x58')],{});db[_0xd9ff('0x5d')]['belongsTo'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x17a'),'foreignKey':'UserId','onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x5d')][_0xd9ff('0x13c')](db[_0xd9ff('0x62')],{'as':'Queue','foreignKey':_0xd9ff('0x17b'),'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x5d')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x17c'),'foreignKey':_0xd9ff('0x15f'),'onDelete':'restrict'});db[_0xd9ff('0x5d')][_0xd9ff('0x13c')](db[_0xd9ff('0x82')],{'onDelete':_0xd9ff('0x161'),'foreignKey':'TagId'});db['ChatInteraction'][_0xd9ff('0x103')](db[_0xd9ff('0x5f')],{'as':'Messages','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x17d')});db[_0xd9ff('0x5e')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x5e')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':'ContactId'});db[_0xd9ff('0x5e')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x5e')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x17e'),'as':_0xd9ff('0x15c')});db['ChatInteraction']['belongsToMany'](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x17e'),'as':'ThroughTags'});db[_0xd9ff('0x5e')][_0xd9ff('0x114')](db['User'],{'as':_0xd9ff('0x15d'),'through':'user_has_chat_interactions','foreignKey':_0xd9ff('0x17d')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x102')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db['CmContact'],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db['ChatMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x5e')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x15e'),'foreignKey':_0xd9ff('0x17d')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db[_0xd9ff('0xe1')],{'as':'Attachment','foreignKey':_0xd9ff('0x16b')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db['ChatWebsite'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x60')][_0xd9ff('0x103')](db[_0xd9ff('0xe1')],{'as':_0xd9ff('0x17f'),'foreignKey':_0xd9ff('0x160'),'onDelete':'cascade','hooks':!![]});db[_0xd9ff('0x60')]['belongsTo'](db[_0xd9ff('0x69')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db['ChatOfflineMessage']['belongsTo'](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x15f')});db['ChatQueue'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':'team_has_chat_queues','as':_0xd9ff('0x140')});db[_0xd9ff('0x64')][_0xd9ff('0x103')](db[_0xd9ff('0xcb')],{'as':_0xd9ff('0x144'),'foreignKey':_0xd9ff('0x180'),'onDelete':'cascade'});db[_0xd9ff('0x64')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x135'),'through':_0xd9ff('0x181')});db[_0xd9ff('0x66')][_0xd9ff('0x13c')](db['ChatWebsite'],{'as':_0xd9ff('0x17c'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0xd9ff('0x103')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x115'),'foreignKey':'CompanyId'});db[_0xd9ff('0x69')]['hasMany'](db[_0xd9ff('0x136')],{'as':_0xd9ff('0x137'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')]['hasMany'](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x139'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')]['hasMany'](db[_0xd9ff('0x70')],{'as':_0xd9ff('0x70'),'foreignKey':_0xd9ff('0x14c')});db['CmContact'][_0xd9ff('0x103')](db[_0xd9ff('0xd1')],{'as':'JscriptySessions','foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x10a')],{'as':_0xd9ff('0x10b'),'foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x5e')],{'as':_0xd9ff('0x10c'),'foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x161')});db['CmContact']['hasMany'](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x10d'),'foreignKey':'ContactId','onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x47')],{'as':_0xd9ff('0x10e'),'foreignKey':_0xd9ff('0x14c'),'onDelete':'restrict'});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x10f')],{'as':'MailInteractions','foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x69')][_0xd9ff('0x13c')](db[_0xd9ff('0x182')],{'as':_0xd9ff('0x183'),'foreignKey':'CompanyId'});db[_0xd9ff('0x69')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153'),'onDelete':'cascade'});db[_0xd9ff('0x69')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x116')});db[_0xd9ff('0x69')]['belongsToMany'](db[_0xd9ff('0x82')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xd9ff('0x69')]['belongsToMany'](db['Tag'],{'through':_0xd9ff('0x184'),'as':_0xd9ff('0x16a')});db['CmHopper']['belongsTo'](db['CmContact'],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x136')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':'List','foreignKey':_0xd9ff('0x153'),'onDelete':'cascade'});db[_0xd9ff('0x136')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x17a'),'foreignKey':_0xd9ff('0x101')});db['CmHopper'][_0xd9ff('0x13c')](db[_0xd9ff('0x11f')],{'as':_0xd9ff('0x185'),'foreignKey':_0xd9ff('0x138'),'onDelete':_0xd9ff('0x100')});db['CmHopper'][_0xd9ff('0x13c')](db[_0xd9ff('0xe0')],{'as':'Campaign','foreignKey':_0xd9ff('0x186'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x136')][_0xd9ff('0x13c')](db['User'],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x187')});db['CmHopperBlack']['belongsTo'](db[_0xd9ff('0x69')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xd9ff('0x100')});db['CmHopperBlack'][_0xd9ff('0x13c')](db['CmList'],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x6b')][_0xd9ff('0x13c')](db['VoiceQueue'],{'as':_0xd9ff('0x185'),'foreignKey':_0xd9ff('0x138'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x6b')][_0xd9ff('0x13c')](db[_0xd9ff('0xe0')],{'as':_0xd9ff('0xe0'),'foreignKey':_0xd9ff('0x186'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x188')][_0xd9ff('0x103')](db[_0xd9ff('0x189')],{'as':{'plural':_0xd9ff('0x18a'),'singular':_0xd9ff('0x18b')},'foreignKey':_0xd9ff('0x18c'),'onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x188')][_0xd9ff('0x103')](db[_0xd9ff('0x189')],{'as':{'plural':_0xd9ff('0x18d'),'singular':_0xd9ff('0x18e')},'foreignKey':_0xd9ff('0x18f'),'onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x188')][_0xd9ff('0x103')](db[_0xd9ff('0x72')],{'as':'Actions','foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0xd9ff('0x77')]['hasMany'](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x190'),'onDelete':_0xd9ff('0x100')});db['Interval'][_0xd9ff('0x103')](db[_0xd9ff('0x79')],{'as':'Intervals','foreignKey':_0xd9ff('0x13e'),'onDelete':_0xd9ff('0x100'),'hooks':!![],'required':![]});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x107'),'foreignKey':_0xd9ff('0x13e'),'onDelete':'restrict'});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db['MailApplication'],{'as':_0xd9ff('0x191'),'foreignKey':'IntervalId'});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db[_0xd9ff('0x5d')],{'as':_0xd9ff('0x192'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db[_0xd9ff('0x167')],{'as':_0xd9ff('0x193'),'foreignKey':'IntervalId'});db[_0xd9ff('0x79')]['hasMany'](db['SmsApplication'],{'as':_0xd9ff('0x194'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x195')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{});db[_0xd9ff('0x195')][_0xd9ff('0x13c')](db[_0xd9ff('0x8d')],{'foreignKey':_0xd9ff('0x196')});db['Schedule'][_0xd9ff('0x13c')](db[_0xd9ff('0x8b')],{'foreignKey':_0xd9ff('0x197')});db[_0xd9ff('0x80')][_0xd9ff('0x114')](db[_0xd9ff('0x19')],{'as':_0xd9ff('0x198'),'through':_0xd9ff('0x134'),'onDelete':_0xd9ff('0x161')});db['Tag'][_0xd9ff('0x114')](db[_0xd9ff('0x69')],{'through':_0xd9ff('0x184')});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db[_0xd9ff('0x5e')],{'through':_0xd9ff('0x17e')});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db[_0xd9ff('0x10f')],{'through':'mail_interaction_has_tags'});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db[_0xd9ff('0x4e')],{'through':'sms_interaction_has_tags'});db['Tag'][_0xd9ff('0x114')](db[_0xd9ff('0x47')],{'through':_0xd9ff('0x169')});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db['OpenchannelInteraction'],{'through':_0xd9ff('0x177')});db['Tag'][_0xd9ff('0x114')](db[_0xd9ff('0xf3')],{'through':_0xd9ff('0x199')});db[_0xd9ff('0x85')][_0xd9ff('0x103')](db[_0xd9ff('0x189')],{'as':{'plural':_0xd9ff('0x19a'),'singular':_0xd9ff('0x19b')},'foreignKey':_0xd9ff('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0xd9ff('0x85')][_0xd9ff('0x103')](db['Condition'],{'as':{'plural':_0xd9ff('0x19d'),'singular':_0xd9ff('0x19e')},'foreignKey':'TriggerAnyId','onDelete':_0xd9ff('0x100'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xd9ff('0x72')],{'as':_0xd9ff('0x19f'),'foreignKey':'TriggerId','onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x8b')][_0xd9ff('0x103')](db['AnalyticFieldReport'],{'as':_0xd9ff('0x1a0'),'onDelete':'cascade','foreignKey':_0xd9ff('0x197'),'hooks':!![]});db[_0xd9ff('0x8d')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x196')});db[_0xd9ff('0x91')]['hasMany'](db[_0xd9ff('0x93')],{'as':'Fields','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a1')});db['AnalyticFieldReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x91')],{'foreignKey':_0xd9ff('0x1a1')});db['SalesforceAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x96')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':'AccountId'});db[_0xd9ff('0x96')][_0xd9ff('0x103')](db['SalesforceField'],{'as':_0xd9ff('0x1a3'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0x96')]['hasMany'](db[_0xd9ff('0x97')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':'DescriptionId'});db[_0xd9ff('0x96')]['hasMany'](db[_0xd9ff('0x97')],{'as':_0xd9ff('0x1a0'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0x96')][_0xd9ff('0x13c')](db[_0xd9ff('0x95')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db['SalesforceField'][_0xd9ff('0x103')](db[_0xd9ff('0x97')],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db['SalesforceField'][_0xd9ff('0x103')](db[_0xd9ff('0x97')],{'as':'Description','foreignKey':_0xd9ff('0x1a8')});db['SalesforceField'][_0xd9ff('0x103')](db[_0xd9ff('0x97')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db['SalesforceField']['belongsTo'](db[_0xd9ff('0x87')],{'as':'Variable','foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0x99')][_0xd9ff('0x103')](db['SugarcrmConfiguration'],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0x9b')][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1a3'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0x9b')]['hasMany'](db[_0xd9ff('0x9d')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0x9b')][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1a0'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db['SugarcrmConfiguration'][_0xd9ff('0x13c')](db['SugarcrmAccount'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0x9d')]['hasMany'](db['SugarcrmField'],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0x9d')][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db['SugarcrmField'][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0x9d')]['belongsTo'](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0x9f')]['hasMany'](db[_0xd9ff('0xa1')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a6')});db['DeskConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xa3')],{'as':'Subjects','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xa1')]['hasMany'](db[_0xd9ff('0xa3')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xa3')],{'as':'Fields','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xa1')][_0xd9ff('0x13c')](db['DeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xd9ff('0xa1')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x1ac')});db[_0xd9ff('0xa3')][_0xd9ff('0x103')](db[_0xd9ff('0xa3')],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xa3')][_0xd9ff('0x103')](db['DeskField'],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xa3')][_0xd9ff('0x103')](db['DeskField'],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xa3')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xa5')][_0xd9ff('0x103')](db[_0xd9ff('0x1ad')],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xd9ff('0x1ad')][_0xd9ff('0x103')](db[_0xd9ff('0xa8')],{'as':_0xd9ff('0x1a3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xd9ff('0x1ad')][_0xd9ff('0x103')](db[_0xd9ff('0xa8')],{'as':_0xd9ff('0x1ae'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0x1ad')][_0xd9ff('0x103')](db['ZohoField'],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xd9ff('0x1ad')]['belongsTo'](db[_0xd9ff('0xa5')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db['ZohoField'][_0xd9ff('0x103')](db[_0xd9ff('0xa8')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xa8')][_0xd9ff('0x103')](db['ZohoField'],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xa8')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xaa')][_0xd9ff('0x103')](db[_0xd9ff('0xab')],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xab')][_0xd9ff('0x103')](db[_0xd9ff('0xad')],{'as':'Subjects','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xab')][_0xd9ff('0x103')](db[_0xd9ff('0xad')],{'as':'Descriptions','foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xab')][_0xd9ff('0x103')](db['ZendeskField'],{'as':_0xd9ff('0x1a0'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0xd9ff('0xaa')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db['ZendeskConfiguration'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x1af')});db[_0xd9ff('0xad')]['hasMany'](db[_0xd9ff('0xad')],{'as':'Subject','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xad')]['hasMany'](db[_0xd9ff('0xad')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xad')][_0xd9ff('0x103')](db[_0xd9ff('0xad')],{'as':'Field','foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xad')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xaf')][_0xd9ff('0x103')](db['FreshdeskConfiguration'],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xb1')][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':_0xd9ff('0x1a3'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xb1')][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':_0xd9ff('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xb1')][_0xd9ff('0x13c')](db[_0xd9ff('0xaf')],{'as':'Account','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xb1')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x1b0')});db['FreshdeskField'][_0xd9ff('0x103')](db['FreshdeskField'],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xb3')][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0xd9ff('0xb3')],{'as':_0xd9ff('0x1a9'),'foreignKey':'FieldId'});db['FreshdeskField'][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':'VariableId'});db[_0xd9ff('0xb5')]['hasMany'](db[_0xd9ff('0xb7')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a6')});db['VtigerConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a3'),'foreignKey':'SubjectId'});db[_0xd9ff('0xb7')]['hasMany'](db['VtigerField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a0'),'foreignKey':'FieldId'});db[_0xd9ff('0xb7')][_0xd9ff('0x13c')](db['VtigerAccount'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xb9')]['hasMany'](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xb9')]['hasMany'](db['VtigerField'],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db['VtigerField']['hasMany'](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xb9')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xba')][_0xd9ff('0x103')](db[_0xd9ff('0xbc')],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db['ServicenowConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':_0xd9ff('0x1a3'),'foreignKey':'SubjectId'});db[_0xd9ff('0xbc')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':'Descriptions','foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xbc')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':'Fields','foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xbc')][_0xd9ff('0x13c')](db[_0xd9ff('0xba')],{'as':_0xd9ff('0x159'),'foreignKey':'AccountId'});db['ServicenowField'][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':'Subject','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xbe')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':_0xd9ff('0x1ab'),'foreignKey':'DescriptionId'});db[_0xd9ff('0xbe')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xbe')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':'Variable','foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xbf')]['hasMany'](db[_0xd9ff('0xc1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xc1')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':_0xd9ff('0x1a3'),'onDelete':_0xd9ff('0x100'),'foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a8')});db['Dynamics365Configuration'][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':_0xd9ff('0x1a0'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db['Dynamics365Configuration'][_0xd9ff('0x13c')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xc3')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':'Subject','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xc3')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xd9ff('0xc3')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db['Dynamics365Field']['belongsTo'](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0x1b1')][_0xd9ff('0x103')](db[_0xd9ff('0xc5')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':'AccountId'});db[_0xd9ff('0xc5')]['hasMany'](db['FreshsalesField'],{'as':_0xd9ff('0x1a3'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xc5')][_0xd9ff('0x103')](db['FreshsalesField'],{'as':_0xd9ff('0x1ae'),'foreignKey':'DescriptionId'});db[_0xd9ff('0xc5')][_0xd9ff('0x103')](db['FreshsalesField'],{'as':_0xd9ff('0x1a0'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xc5')][_0xd9ff('0x13c')](db[_0xd9ff('0x1b1')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0x1b2')]['hasMany'](db[_0xd9ff('0x1b2')],{'as':_0xd9ff('0x1a7'),'foreignKey':'SubjectId'});db[_0xd9ff('0x1b2')][_0xd9ff('0x103')](db[_0xd9ff('0x1b2')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db['FreshsalesField'][_0xd9ff('0x103')](db[_0xd9ff('0x1b2')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db['FreshsalesField'][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':'VariableId'});db[_0xd9ff('0xc9')][_0xd9ff('0x13c')](db['ChatWebsite'],{});db['ChatQueueReport']['belongsTo'](db['CmList'],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xc9')][_0xd9ff('0x13c')](db['CmContact'],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db['ChatQueueReport'][_0xd9ff('0x13c')](db['ChatInteraction'],{});db['ChatQueueReport'][_0xd9ff('0x13c')](db['ChatMessage'],{});db['ChatQueueReport'][_0xd9ff('0x13c')](db['User'],{});db[_0xd9ff('0xc9')][_0xd9ff('0x13c')](db[_0xd9ff('0x62')],{});db[_0xd9ff('0xcb')][_0xd9ff('0x13c')](db['User'],{'onDelete':'cascade','foreignKey':_0xd9ff('0x1b3')});db['ChatInternalMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1b4')});db[_0xd9ff('0xd1')][_0xd9ff('0x103')](db[_0xd9ff('0xcf')],{'foreignKey':'SessionId','onDelete':_0xd9ff('0x100')});db['JscriptySessionReport']['hasMany'](db[_0xd9ff('0xcd')],{'foreignKey':_0xd9ff('0x1b5'),'onDelete':_0xd9ff('0x100')});db['SmsQueueReport'][_0xd9ff('0x13c')](db['SmsAccount'],{});db['SmsQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':'List','foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xd2')][_0xd9ff('0x13c')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xd9ff('0xd2')]['belongsTo'](db[_0xd9ff('0x4e')],{});db[_0xd9ff('0xd2')]['belongsTo'](db[_0xd9ff('0x16f')],{});db['SmsQueueReport'][_0xd9ff('0x13c')](db['User'],{});db[_0xd9ff('0xd2')][_0xd9ff('0x13c')](db[_0xd9ff('0x123')],{});db[_0xd9ff('0xd7')][_0xd9ff('0x103')](db[_0xd9ff('0xd1')],{'foreignKey':_0xd9ff('0x1b6')});db[_0xd9ff('0xd7')][_0xd9ff('0x103')](db[_0xd9ff('0xcf')],{'foreignKey':_0xd9ff('0x1b6')});db[_0xd9ff('0xd7')][_0xd9ff('0x103')](db[_0xd9ff('0xcd')],{'foreignKey':'ProjectId'});db['SquareProject']['belongsToMany'](db['User'],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x1b7')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':'Agents','through':_0xd9ff('0x119')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x11f')],{'through':_0xd9ff('0xfb'),'as':_0xd9ff('0x120')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xd9ff('0x1b8')});db['Team'][_0xd9ff('0x114')](db[_0xd9ff('0x62')],{'through':'team_has_chat_queues','as':_0xd9ff('0x1b9')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x4a')],{'through':_0xd9ff('0x16c'),'as':_0xd9ff('0x122')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x123')],{'through':_0xd9ff('0x1ba'),'as':_0xd9ff('0x1bb')});db['Team']['belongsToMany'](db['OpenchannelQueue'],{'through':_0xd9ff('0x178'),'as':'OpenchannelQueues'});db['Team']['belongsToMany'](db['WhatsappQueue'],{'through':_0xd9ff('0x1bc'),'as':_0xd9ff('0x125')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x1bd')],{'through':_0xd9ff('0x1be'),'as':_0xd9ff('0x121')});db['Campaign'][_0xd9ff('0x103')](db[_0xd9ff('0x136')],{'as':_0xd9ff('0x137'),'foreignKey':'CampaignId'});db['Campaign'][_0xd9ff('0x103')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd9ff('0x186')});db[_0xd9ff('0xe0')]['hasMany'](db['CmHopperHistory'],{'as':_0xd9ff('0x139'),'foreignKey':_0xd9ff('0x186')});db[_0xd9ff('0xe0')][_0xd9ff('0x103')](db[_0xd9ff('0x6b')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0xd9ff('0xe0')]['belongsTo'](db[_0xd9ff('0x25')],{'as':_0xd9ff('0x25'),'foreignKey':_0xd9ff('0x13d')});db['Campaign'][_0xd9ff('0x13c')](db[_0xd9ff('0x25')],{'as':_0xd9ff('0x1bf'),'foreignKey':_0xd9ff('0x1c0')});db[_0xd9ff('0xe0')][_0xd9ff('0x13c')](db[_0xd9ff('0x79')],{'as':'Interval','foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0xe0')][_0xd9ff('0x13c')](db['SquareProject'],{'as':_0xd9ff('0xdb'),'foreignKey':'SquareProjectId'});db[_0xd9ff('0xe0')][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x117'),'through':_0xd9ff('0x1c1')});db[_0xd9ff('0xe0')][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x1c2'),'through':_0xd9ff('0x1c3')});db[_0xd9ff('0xe1')][_0xd9ff('0x13c')](db[_0xd9ff('0x60')],{'as':_0xd9ff('0x60'),'foreignKey':_0xd9ff('0x160')});db['MailTransferReport']['belongsTo'](db[_0xd9ff('0x3d')],{});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x10f')],{});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'foreignKey':_0xd9ff('0x1c5'),'as':_0xd9ff('0x1c6')});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xd9ff('0x1c7'),'as':_0xd9ff('0x1c8')});db[_0xd9ff('0x1c4')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x39')],{'foreignKey':'ToMailQueueId','as':_0xd9ff('0x1c9')});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'foreignKey':_0xd9ff('0x1ca'),'as':'ToAccount'});db[_0xd9ff('0x1cb')][_0xd9ff('0x13c')](db[_0xd9ff('0x5f')],{});db['ChatTransferReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x5e')],{});db[_0xd9ff('0x1cb')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xd9ff('0x1cc'),'as':_0xd9ff('0x1c6')});db[_0xd9ff('0x1cb')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1c7'),'as':_0xd9ff('0x1c8')});db[_0xd9ff('0x1cb')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1cd'),'as':_0xd9ff('0x1ce')});db[_0xd9ff('0x1cb')][_0xd9ff('0x13c')](db['ChatQueue'],{'foreignKey':_0xd9ff('0x1cf'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0x1cb')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'foreignKey':'ToChatWebsiteId','as':_0xd9ff('0x1d0')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db['FaxMessage'],{});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db['FaxInteraction'],{});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{'foreignKey':_0xd9ff('0x1d1'),'as':'FromAccount'});db[_0xd9ff('0xe6')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':'FromUserId','as':_0xd9ff('0x1c8')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'foreignKey':'ToUserId','as':_0xd9ff('0x1ce')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x4a')],{'foreignKey':_0xd9ff('0x1d2'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{'foreignKey':_0xd9ff('0x1d3'),'as':'ToAccount'});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db['OpenchannelMessage'],{});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db[_0xd9ff('0x10a')],{});db['OpenchannelTransferReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'foreignKey':_0xd9ff('0x1d4'),'as':_0xd9ff('0x1c6')});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db['User'],{'foreignKey':'FromUserId','as':_0xd9ff('0x1c8')});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1cd'),'as':_0xd9ff('0x1ce')});db[_0xd9ff('0xe8')]['belongsTo'](db[_0xd9ff('0x58')],{'foreignKey':_0xd9ff('0x1d5'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'foreignKey':_0xd9ff('0x1d6'),'as':_0xd9ff('0x1d0')});db[_0xd9ff('0x1d7')]['belongsTo'](db[_0xd9ff('0x16f')],{});db[_0xd9ff('0x1d7')]['belongsTo'](db[_0xd9ff('0x4e')],{});db[_0xd9ff('0x1d7')][_0xd9ff('0x13c')](db[_0xd9ff('0x12e')],{'foreignKey':'FromSmsAccountId','as':_0xd9ff('0x1c6')});db[_0xd9ff('0x1d7')][_0xd9ff('0x13c')](db['User'],{'foreignKey':_0xd9ff('0x1c7'),'as':_0xd9ff('0x1c8')});db[_0xd9ff('0x1d7')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':'ToUserId','as':_0xd9ff('0x1ce')});db['SmsTransferReport'][_0xd9ff('0x13c')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0xd9ff('0x1c9')});db[_0xd9ff('0x1d7')][_0xd9ff('0x13c')](db[_0xd9ff('0x12e')],{'foreignKey':_0xd9ff('0x1d8'),'as':_0xd9ff('0x1d0')});db[_0xd9ff('0xeb')][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xd9ff('0xeb')]['hasMany'](db[_0xd9ff('0x1d9')],{'as':_0xd9ff('0x1da'),'foreignKey':'ListId'});db[_0xd9ff('0xeb')]['hasMany'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x115'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xeb')][_0xd9ff('0x103')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd9ff('0x153')});db['CmList'][_0xd9ff('0x103')](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x109'),'foreignKey':'ListId'});db[_0xd9ff('0xeb')][_0xd9ff('0x103')](db[_0xd9ff('0x70')],{'as':'ReportAgentPreview','foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xeb')][_0xd9ff('0x114')](db[_0xd9ff('0x11f')],{'as':_0xd9ff('0x1db'),'through':'voice_queues_has_cm_lists'});db[_0xd9ff('0xeb')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'cm_user_has_lists'});db[_0xd9ff('0x1bd')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x107'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x1bd')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x1dc')});db[_0xd9ff('0x1bd')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x1be'),'as':_0xd9ff('0x140')});db[_0xd9ff('0xed')][_0xd9ff('0x103')](db['User'],{'as':'Users','foreignKey':_0xd9ff('0x1dd')});db[_0xd9ff('0xed')][_0xd9ff('0x103')](db[_0xd9ff('0x1de')],{'as':_0xd9ff('0x1df'),'foreignKey':'userProfileId','onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x1de')][_0xd9ff('0x103')](db[_0xd9ff('0x1e0')],{'as':'Resources','foreignKey':_0xd9ff('0x1e1'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0xf1')][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x1e2'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0xf1')][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x1e2')});db[_0xd9ff('0xf1')][_0xd9ff('0x103')](db['WhatsappMessage'],{'as':_0xd9ff('0x144'),'foreignKey':_0xd9ff('0x1e2')});db[_0xd9ff('0xf1')]['hasMany'](db[_0xd9ff('0xf3')],{'as':'Interactions'});db['WhatsappAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x1e3')],{'as':_0xd9ff('0x132')});db[_0xd9ff('0xf1')]['belongsTo'](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db['WhatsappAccount'][_0xd9ff('0x13c')](db[_0xd9ff('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':_0xd9ff('0x156')});db[_0xd9ff('0xf1')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':'Agents','through':_0xd9ff('0x1e4')});db[_0xd9ff('0x1e3')]['belongsTo'](db['User'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x1e3')][_0xd9ff('0x13c')](db['WhatsappQueue'],{'onDelete':'restrict'});db[_0xd9ff('0x1e3')][_0xd9ff('0x13c')](db['WhatsappAccount'],{'onDelete':_0xd9ff('0x161')});db['WhatsappApplication'][_0xd9ff('0x13c')](db['Interval'],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x1e3')][_0xd9ff('0x13c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xd9ff('0x162')});db[_0xd9ff('0xf3')][_0xd9ff('0x103')](db[_0xd9ff('0x1e5')],{'as':_0xd9ff('0x144'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1e6')});db[_0xd9ff('0xf3')][_0xd9ff('0x13c')](db[_0xd9ff('0xf1')],{'as':'Account','foreignKey':_0xd9ff('0x1e2')});db['WhatsappInteraction'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':'Contact','foreignKey':'ContactId'});db[_0xd9ff('0xf3')]['belongsTo'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0xf3')]['belongsToMany'](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x199'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0xf3')]['belongsToMany'](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x199'),'as':_0xd9ff('0x16a')});db['WhatsappInteraction'][_0xd9ff('0x114')](db['User'],{'as':_0xd9ff('0x15d'),'through':'user_has_whatsapp_interactions','foreignKey':_0xd9ff('0x1e6')});db[_0xd9ff('0x1e5')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x102')});db[_0xd9ff('0x1e5')][_0xd9ff('0x13c')](db['CmContact'],{'onDelete':_0xd9ff('0x100'),'as':'Contact'});db[_0xd9ff('0x1e5')][_0xd9ff('0x13c')](db[_0xd9ff('0xf3')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xd9ff('0x1e6')});db[_0xd9ff('0x1e5')]['belongsTo'](db[_0xd9ff('0xf1')],{'as':_0xd9ff('0x159'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xd9ff('0x13c')](db['WhatsappAccount'],{});db[_0xd9ff('0xf6')]['belongsTo'](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db['WhatsappInteraction'],{});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0xfa')],{});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0x1e5')],{});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{});db[_0xd9ff('0xf8')][_0xd9ff('0x13c')](db['WhatsappMessage'],{});db[_0xd9ff('0xf8')][_0xd9ff('0x13c')](db[_0xd9ff('0xf3')],{});db['WhatsappTransferReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xf1')],{'foreignKey':_0xd9ff('0x1e7'),'as':'FromAccount'});db[_0xd9ff('0xf8')]['belongsTo'](db[_0xd9ff('0xf1')],{'foreignKey':_0xd9ff('0x1e8'),'as':_0xd9ff('0x1d0')});db[_0xd9ff('0xf8')][_0xd9ff('0x13c')](db[_0xd9ff('0xfa')],{'foreignKey':_0xd9ff('0x1e9'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0xf8')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1c7'),'as':'FromAgent'});db[_0xd9ff('0xf8')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1cd'),'as':_0xd9ff('0x1ce')});db['WhatsappQueue'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'UserWhatsappQueue','foreignKey':_0xd9ff('0x1ea')});db[_0xd9ff('0xfa')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x1bc'),'as':'Teams'});module[_0xd9ff('0x1eb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 9e69d47..f1b2633 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5210=['/api/cm/lists','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','sendFile','resolve','get','appPath','/index.html','password','lastName','street','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','calleridname','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','key','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','replace','@@{','}@@','includes','lodash','express-winston','util','./errors','./config/logger','api','auth','./safe-template','safeTemplate','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','connection','other','agent_id','agent_name','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./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/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/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/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/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/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/plugins','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport'];(function(_0x31a9d1,_0x283ae9){var _0x127d8e=function(_0x5b7079){while(--_0x5b7079){_0x31a9d1['push'](_0x31a9d1['shift']());}};_0x127d8e(++_0x283ae9);}(_0x5210,0x1a1));var _0x0521=function(_0x467b69,_0x208aec){_0x467b69=_0x467b69-0x0;var _0x4f5e01=_0x5210[_0x467b69];return _0x4f5e01;};'use strict';var _=require(_0x0521('0x0'));var path=require('path');var express=require('express');var ewinston=require(_0x0521('0x1'));var util=require(_0x0521('0x2'));var errors=require(_0x0521('0x3'));var config=require('./config/environment');var logger=require(_0x0521('0x4'))(_0x0521('0x5'));var authLogger=require(_0x0521('0x4'))(_0x0521('0x6'));var safeTemplate=require(_0x0521('0x7'))[_0x0521('0x8')];exports[_0x0521('0x9')]=function(_0x2bce42){_0x2bce42[_0x0521('0xa')](ewinston[_0x0521('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xf3daa6,_0x4163b3){var _0x5db9b9=_0x0521('0xc');if(!_[_0x0521('0xd')](_0xf3daa6[_0x0521('0xe')])){_0x5db9b9+=_0x0521('0xf');var _0x2ad0e6=_0xf3daa6[_0x0521('0xe')];maskSensitiveData(_0x2ad0e6);}return safeTemplate(util[_0x0521('0x10')](_0x5db9b9,_0xf3daa6[_0x0521('0x11')],_0xf3daa6[_0x0521('0x12')][_0x0521('0x13')]?_0xf3daa6[_0x0521('0x12')]['x-forwarded-for']:_0xf3daa6['connection'][_0x0521('0x14')]||_0xf3daa6['ip'],_0xf3daa6[_0x0521('0x15')],_0x4163b3[_0x0521('0x16')],_0x4163b3[_0x0521('0x17')],_0xf3daa6[_0x0521('0x18')]?_0xf3daa6[_0x0521('0x18')]['id']:null,_0xf3daa6[_0x0521('0x18')]?_0xf3daa6['user'][_0x0521('0x19')]:null,_0xf3daa6[_0x0521('0x18')]?_0xf3daa6[_0x0521('0x18')][_0x0521('0x1a')]:null,_0x2ad0e6?util[_0x0521('0x1b')](_0x2ad0e6,![],null):''));}}));_0x2bce42[_0x0521('0xa')](ewinston[_0x0521('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3b58fb,_0x159ce6){var _0x24da64=_0x0521('0x1c');if(_0x3b58fb['body']&&_0x3b58fb[_0x0521('0xe')][_0x0521('0x1d')]&&_0x3b58fb['body']['agent_id']){_0x24da64='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x0521('0x10')](_0x24da64,_0x3b58fb[_0x0521('0x11')],_0x3b58fb[_0x0521('0x12')]['x-forwarded-for']?_0x3b58fb[_0x0521('0x12')][_0x0521('0x13')]:_0x3b58fb[_0x0521('0x1e')]['remoteAddress']||_0x3b58fb['ip'],_0x3b58fb[_0x0521('0x15')],_0x159ce6[_0x0521('0x16')],_0x159ce6['responseTime'],_0x3b58fb['user']?_0x3b58fb[_0x0521('0x18')]['id']:null,_0x3b58fb[_0x0521('0x18')]?_0x3b58fb[_0x0521('0x18')][_0x0521('0x19')]:null,_0x3b58fb[_0x0521('0x18')]?_0x3b58fb[_0x0521('0x18')]['role']:null,_0x3b58fb[_0x0521('0xe')]&&_0x3b58fb[_0x0521('0xe')][_0x0521('0x1d')]?_0x3b58fb['body']['device']:_0x0521('0x1f'),_0x3b58fb[_0x0521('0xe')]&&_0x3b58fb[_0x0521('0xe')][_0x0521('0x20')]?_0x3b58fb[_0x0521('0xe')][_0x0521('0x20')]:'',_0x3b58fb[_0x0521('0xe')]&&_0x3b58fb['body'][_0x0521('0x21')]?_0x3b58fb[_0x0521('0xe')]['agent_name']:'');},'ignoreRoute':function(_0x4e6c42){var _0x441d9f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x441d9f['test'](_0x4e6c42['url']);}}));_0x2bce42[_0x0521('0xa')](_0x0521('0x22'),require('./api/user'));_0x2bce42['use'](_0x0521('0x23'),require(_0x0521('0x24')));_0x2bce42[_0x0521('0xa')]('/api/voice/contexts',require(_0x0521('0x25')));_0x2bce42[_0x0521('0xa')](_0x0521('0x26'),require('./api/voiceExtension'));_0x2bce42[_0x0521('0xa')](_0x0521('0x27'),require('./api/voiceMusicOnHold'));_0x2bce42[_0x0521('0xa')](_0x0521('0x28'),require(_0x0521('0x29')));_0x2bce42['use'](_0x0521('0x2a'),require(_0x0521('0x2b')));_0x2bce42[_0x0521('0xa')](_0x0521('0x2c'),require('./api/screenRecording'));_0x2bce42[_0x0521('0xa')](_0x0521('0x2d'),require(_0x0521('0x2e')));_0x2bce42['use'](_0x0521('0x2f'),require(_0x0521('0x30')));_0x2bce42[_0x0521('0xa')](_0x0521('0x31'),require(_0x0521('0x32')));_0x2bce42['use'](_0x0521('0x33'),require(_0x0521('0x34')));_0x2bce42[_0x0521('0xa')](_0x0521('0x35'),require(_0x0521('0x36')));_0x2bce42[_0x0521('0xa')](_0x0521('0x37'),require(_0x0521('0x38')));_0x2bce42['use'](_0x0521('0x39'),require(_0x0521('0x3a')));_0x2bce42[_0x0521('0xa')]('/api/trunks',require(_0x0521('0x3b')));_0x2bce42[_0x0521('0xa')](_0x0521('0x3c'),require(_0x0521('0x3d')));_0x2bce42[_0x0521('0xa')](_0x0521('0x3e'),require('./api/mailServerOut'));_0x2bce42['use'](_0x0521('0x3f'),require(_0x0521('0x40')));_0x2bce42['use'](_0x0521('0x41'),require(_0x0521('0x42')));_0x2bce42['use'](_0x0521('0x43'),require(_0x0521('0x44')));_0x2bce42[_0x0521('0xa')](_0x0521('0x45'),require(_0x0521('0x46')));_0x2bce42[_0x0521('0xa')]('/api/mail/messages',require('./api/mailMessage'));_0x2bce42[_0x0521('0xa')](_0x0521('0x47'),require('./api/mailApplication'));_0x2bce42[_0x0521('0xa')](_0x0521('0x48'),require(_0x0521('0x49')));_0x2bce42[_0x0521('0xa')](_0x0521('0x4a'),require(_0x0521('0x4b')));_0x2bce42['use']('/api/dashboards/items',require(_0x0521('0x4c')));_0x2bce42[_0x0521('0xa')](_0x0521('0x4d'),require('./api/faxAccount'));_0x2bce42[_0x0521('0xa')]('/api/fax/applications',require('./api/faxApplication'));_0x2bce42[_0x0521('0xa')](_0x0521('0x4e'),require('./api/faxInteraction'));_0x2bce42['use'](_0x0521('0x4f'),require(_0x0521('0x50')));_0x2bce42['use'](_0x0521('0x51'),require('./api/faxQueue'));_0x2bce42[_0x0521('0xa')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x2bce42[_0x0521('0xa')](_0x0521('0x52'),require(_0x0521('0x53')));_0x2bce42[_0x0521('0xa')](_0x0521('0x54'),require(_0x0521('0x55')));_0x2bce42['use'](_0x0521('0x56'),require(_0x0521('0x57')));_0x2bce42[_0x0521('0xa')](_0x0521('0x58'),require(_0x0521('0x59')));_0x2bce42[_0x0521('0xa')](_0x0521('0x5a'),require(_0x0521('0x5b')));_0x2bce42['use']('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x2bce42['use']('/api/openchannel/applications',require(_0x0521('0x5c')));_0x2bce42[_0x0521('0xa')](_0x0521('0x5d'),require(_0x0521('0x5e')));_0x2bce42['use'](_0x0521('0x5f'),require(_0x0521('0x60')));_0x2bce42[_0x0521('0xa')](_0x0521('0x61'),require(_0x0521('0x62')));_0x2bce42['use'](_0x0521('0x63'),require(_0x0521('0x64')));_0x2bce42[_0x0521('0xa')](_0x0521('0x65'),require(_0x0521('0x66')));_0x2bce42[_0x0521('0xa')](_0x0521('0x67'),require('./api/chatApplication'));_0x2bce42[_0x0521('0xa')](_0x0521('0x68'),require(_0x0521('0x69')));_0x2bce42[_0x0521('0xa')](_0x0521('0x6a'),require(_0x0521('0x6b')));_0x2bce42['use'](_0x0521('0x6c'),require(_0x0521('0x6d')));_0x2bce42[_0x0521('0xa')](_0x0521('0x6e'),require(_0x0521('0x6f')));_0x2bce42['use']('/api/chat/groups',require('./api/chatGroup'));_0x2bce42[_0x0521('0xa')](_0x0521('0x70'),require(_0x0521('0x71')));_0x2bce42['use'](_0x0521('0x72'),require(_0x0521('0x73')));_0x2bce42[_0x0521('0xa')](_0x0521('0x74'),require('./api/cmContact'));_0x2bce42[_0x0521('0xa')](_0x0521('0x75'),require(_0x0521('0x76')));_0x2bce42[_0x0521('0xa')](_0x0521('0x77'),require(_0x0521('0x78')));_0x2bce42['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x2bce42[_0x0521('0xa')](_0x0521('0x79'),require(_0x0521('0x7a')));_0x2bce42[_0x0521('0xa')](_0x0521('0x7b'),require(_0x0521('0x7c')));_0x2bce42['use'](_0x0521('0x7d'),require('./api/action'));_0x2bce42[_0x0521('0xa')](_0x0521('0x7e'),require(_0x0521('0x7f')));_0x2bce42['use'](_0x0521('0x80'),require(_0x0521('0x81')));_0x2bce42[_0x0521('0xa')](_0x0521('0x82'),require(_0x0521('0x83')));_0x2bce42['use'](_0x0521('0x84'),require('./api/condition'));_0x2bce42['use'](_0x0521('0x85'),require('./api/interval'));_0x2bce42[_0x0521('0xa')](_0x0521('0x86'),require(_0x0521('0x87')));_0x2bce42['use']('/api/cdr',require(_0x0521('0x88')));_0x2bce42[_0x0521('0xa')](_0x0521('0x89'),require(_0x0521('0x8a')));_0x2bce42[_0x0521('0xa')](_0x0521('0x8b'),require(_0x0521('0x8c')));_0x2bce42[_0x0521('0xa')]('/api/sounds',require(_0x0521('0x8d')));_0x2bce42[_0x0521('0xa')](_0x0521('0x8e'),require(_0x0521('0x8f')));_0x2bce42[_0x0521('0xa')](_0x0521('0x90'),require(_0x0521('0x91')));_0x2bce42[_0x0521('0xa')](_0x0521('0x92'),require(_0x0521('0x93')));_0x2bce42[_0x0521('0xa')](_0x0521('0x94'),require(_0x0521('0x95')));_0x2bce42[_0x0521('0xa')](_0x0521('0x96'),require(_0x0521('0x97')));_0x2bce42[_0x0521('0xa')](_0x0521('0x98'),require(_0x0521('0x99')));_0x2bce42[_0x0521('0xa')](_0x0521('0x9a'),require('./api/analyticCustomReport'));_0x2bce42[_0x0521('0xa')](_0x0521('0x9b'),require('./api/analyticDefaultReport'));_0x2bce42[_0x0521('0xa')](_0x0521('0x9c'),require(_0x0521('0x9d')));_0x2bce42[_0x0521('0xa')](_0x0521('0x9e'),require(_0x0521('0x9f')));_0x2bce42[_0x0521('0xa')](_0x0521('0xa0'),require('./api/analyticFieldReport'));_0x2bce42['use'](_0x0521('0xa1'),require(_0x0521('0xa2')));_0x2bce42[_0x0521('0xa')](_0x0521('0xa3'),require('./api/intSalesforceAccount'));_0x2bce42['use'](_0x0521('0xa4'),require(_0x0521('0xa5')));_0x2bce42[_0x0521('0xa')](_0x0521('0xa6'),require(_0x0521('0xa7')));_0x2bce42['use']('/api/integrations/sugarcrm/accounts',require(_0x0521('0xa8')));_0x2bce42[_0x0521('0xa')](_0x0521('0xa9'),require(_0x0521('0xaa')));_0x2bce42[_0x0521('0xa')](_0x0521('0xab'),require('./api/intSugarcrmField'));_0x2bce42['use']('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x2bce42['use'](_0x0521('0xac'),require(_0x0521('0xad')));_0x2bce42[_0x0521('0xa')](_0x0521('0xae'),require(_0x0521('0xaf')));_0x2bce42['use'](_0x0521('0xb0'),require(_0x0521('0xb1')));_0x2bce42['use'](_0x0521('0xb2'),require(_0x0521('0xb3')));_0x2bce42[_0x0521('0xa')](_0x0521('0xb4'),require(_0x0521('0xb5')));_0x2bce42['use'](_0x0521('0xb6'),require(_0x0521('0xb7')));_0x2bce42[_0x0521('0xa')](_0x0521('0xb8'),require(_0x0521('0xb9')));_0x2bce42[_0x0521('0xa')]('/api/integrations/zendesk/fields',require(_0x0521('0xba')));_0x2bce42[_0x0521('0xa')](_0x0521('0xbb'),require('./api/intFreshdeskAccount'));_0x2bce42['use'](_0x0521('0xbc'),require(_0x0521('0xbd')));_0x2bce42[_0x0521('0xa')](_0x0521('0xbe'),require(_0x0521('0xbf')));_0x2bce42[_0x0521('0xa')](_0x0521('0xc0'),require(_0x0521('0xc1')));_0x2bce42[_0x0521('0xa')]('/api/integrations/vtiger/configurations',require(_0x0521('0xc2')));_0x2bce42['use'](_0x0521('0xc3'),require('./api/intVtigerField'));_0x2bce42[_0x0521('0xa')](_0x0521('0xc4'),require(_0x0521('0xc5')));_0x2bce42[_0x0521('0xa')]('/api/integrations/servicenow/configurations',require(_0x0521('0xc6')));_0x2bce42[_0x0521('0xa')](_0x0521('0xc7'),require(_0x0521('0xc8')));_0x2bce42['use'](_0x0521('0xc9'),require(_0x0521('0xca')));_0x2bce42[_0x0521('0xa')](_0x0521('0xcb'),require(_0x0521('0xcc')));_0x2bce42['use'](_0x0521('0xcd'),require(_0x0521('0xce')));_0x2bce42['use'](_0x0521('0xcf'),require(_0x0521('0xd0')));_0x2bce42[_0x0521('0xa')](_0x0521('0xd1'),require(_0x0521('0xd2')));_0x2bce42[_0x0521('0xa')](_0x0521('0xd3'),require(_0x0521('0xd4')));_0x2bce42[_0x0521('0xa')](_0x0521('0xd5'),require(_0x0521('0xd6')));_0x2bce42['use'](_0x0521('0xd7'),require(_0x0521('0xd8')));_0x2bce42['use'](_0x0521('0xd9'),require('./api/chatInternalMessage'));_0x2bce42['use']('/api/jscripty/answers/reports',require(_0x0521('0xda')));_0x2bce42[_0x0521('0xa')](_0x0521('0xdb'),require('./api/jscriptyQuestionReport'));_0x2bce42['use'](_0x0521('0xdc'),require(_0x0521('0xdd')));_0x2bce42[_0x0521('0xa')](_0x0521('0xde'),require('./api/smsQueueReport'));_0x2bce42[_0x0521('0xa')]('/api/square/reports',require('./api/squareReport'));_0x2bce42[_0x0521('0xa')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x2bce42[_0x0521('0xa')](_0x0521('0xdf'),require(_0x0521('0xe0')));_0x2bce42[_0x0521('0xa')](_0x0521('0xe1'),require(_0x0521('0xe2')));_0x2bce42[_0x0521('0xa')](_0x0521('0xe3'),require(_0x0521('0xe4')));_0x2bce42[_0x0521('0xa')](_0x0521('0xe5'),require(_0x0521('0xe6')));_0x2bce42['use']('/api/square/recordings',require(_0x0521('0xe7')));_0x2bce42[_0x0521('0xa')](_0x0521('0xe8'),require(_0x0521('0xe9')));_0x2bce42[_0x0521('0xa')](_0x0521('0xea'),require('./api/team'));_0x2bce42[_0x0521('0xa')]('/api/license',require(_0x0521('0xeb')));_0x2bce42[_0x0521('0xa')](_0x0521('0xec'),require('./api/campaign'));_0x2bce42[_0x0521('0xa')](_0x0521('0xed'),require(_0x0521('0xee')));_0x2bce42[_0x0521('0xa')]('/api/attachments',require('./api/attachment'));_0x2bce42[_0x0521('0xa')](_0x0521('0xef'),require('./api/plugin'));_0x2bce42[_0x0521('0xa')](_0x0521('0xf0'),require('./api/mailTransferReport'));_0x2bce42['use']('/api/chat/reports/transfer',require(_0x0521('0xf1')));_0x2bce42[_0x0521('0xa')](_0x0521('0xf2'),require(_0x0521('0xf3')));_0x2bce42[_0x0521('0xa')]('/api/openchannel/reports/transfer',require(_0x0521('0xf4')));_0x2bce42[_0x0521('0xa')](_0x0521('0xf5'),require(_0x0521('0xf6')));_0x2bce42[_0x0521('0xa')](_0x0521('0xf7'),require('./api/cmList'));_0x2bce42[_0x0521('0xa')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x2bce42[_0x0521('0xa')](_0x0521('0xf8'),require('./api/userProfile'));_0x2bce42['use'](_0x0521('0xf9'),require(_0x0521('0xfa')));_0x2bce42['use']('/api/userProfile/resources',require(_0x0521('0xfb')));_0x2bce42[_0x0521('0xa')](_0x0521('0xfc'),require(_0x0521('0xfd')));_0x2bce42[_0x0521('0xa')](_0x0521('0xfe'),require(_0x0521('0xff')));_0x2bce42[_0x0521('0xa')](_0x0521('0x100'),require(_0x0521('0x101')));_0x2bce42['use']('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x2bce42['use'](_0x0521('0x102'),require('./api/whatsappMessage'));_0x2bce42['use']('/api/whatsapp/reports/queue',require(_0x0521('0x103')));_0x2bce42[_0x0521('0xa')](_0x0521('0x104'),require(_0x0521('0x105')));_0x2bce42['use'](_0x0521('0x106'),require('./api/whatsappQueue'));_0x2bce42['use'](_0x0521('0x107'),require(_0x0521('0x108')));_0x2bce42['use'](_0x0521('0x109'),require(_0x0521('0x10a')));_0x2bce42[_0x0521('0xa')]('/api/auth/local',require(_0x0521('0x10b')));_0x2bce42[_0x0521('0xa')](_0x0521('0x10c'),require(_0x0521('0x10d')));_0x2bce42[_0x0521('0xa')](_0x0521('0x10e'),require('./api/authActiveDirectory'));_0x2bce42[_0x0521('0xa')](_0x0521('0x10f'),require(_0x0521('0x110')));_0x2bce42['use'](_0x0521('0x111'),require(_0x0521('0x112')));_0x2bce42[_0x0521('0xa')](_0x0521('0x113'),require(_0x0521('0x114')));_0x2bce42[_0x0521('0xa')]('/api/system',require(_0x0521('0x115')));_0x2bce42['use'](_0x0521('0x116'),require(_0x0521('0x117')));_0x2bce42['use']('/api/webbar',require(_0x0521('0x118')));_0x2bce42[_0x0521('0xa')](_0x0521('0x119'),express[_0x0521('0x11a')](path[_0x0521('0x11b')](config[_0x0521('0x11c')],_0x0521('0x119'))));_0x2bce42[_0x0521('0xa')](_0x0521('0x11d'),express[_0x0521('0x11a')](path['join'](config[_0x0521('0x11c')],'/www')));_0x2bce42[_0x0521('0xa')](_0x0521('0x11e'),express[_0x0521('0x11a')](path['join'](config[_0x0521('0x11c')],_0x0521('0x11e'))));_0x2bce42[_0x0521('0xa')](_0x0521('0x11f'),express['static'](path[_0x0521('0x11b')](config[_0x0521('0x11c')],_0x0521('0x120'),_0x0521('0x121'))));_0x2bce42[_0x0521('0xa')]('/plugins',express[_0x0521('0x11a')](path['join'](config[_0x0521('0x11c')],_0x0521('0x122'))));_0x2bce42['route'](_0x0521('0x123'))['get'](errors[0x194]);_0x2bce42[_0x0521('0x124')]('/*')['get'](function(_0x24515e,_0x4b2532){_0x4b2532[_0x0521('0x125')](path[_0x0521('0x126')](_0x2bce42[_0x0521('0x127')](_0x0521('0x128'))+_0x0521('0x129')));});};var sensitiveFields=['username',_0x0521('0x12a'),'newPassword','apiKey','firstName',_0x0521('0x12b'),_0x0521('0x12c'),'phone',_0x0521('0x12d'),_0x0521('0x12e'),'email',_0x0521('0x12f'),_0x0521('0x130'),_0x0521('0x131'),_0x0521('0x132'),_0x0521('0x133'),'tenantId',_0x0521('0x134'),_0x0521('0x135'),_0x0521('0x136'),_0x0521('0x137'),'authToken',_0x0521('0x138'),_0x0521('0x139'),'membername',_0x0521('0x13a'),'calleridnum',_0x0521('0x13b'),_0x0521('0x13c'),_0x0521('0x13d'),_0x0521('0x13e'),_0x0521('0x13f'),'secretaccesskey',_0x0521('0x140'),_0x0521('0x18'),'pass',_0x0521('0x141'),'localstationid',_0x0521('0x142'),_0x0521('0x143'),_0x0521('0x144'),_0x0521('0x145')];function maskSensitiveData(_0x1d6662){var _0x3cfbc9=/(?!^)[\s\S](?!$)/g;if(!_[_0x0521('0x146')](_0x1d6662))return;for(var _0x296097 in _0x1d6662){if(_[_0x0521('0x147')](_0x1d6662[_0x296097])){for(var _0x2ba7a5=0x0;_0x2ba7a5<_0x1d6662[_0x296097]['length'];_0x2ba7a5++){maskSensitiveData(_0x1d6662[_0x296097][_0x2ba7a5]);}}else if(_[_0x0521('0x146')](_0x1d6662[_0x296097])){maskSensitiveData(_0x1d6662[_0x296097]);}else if(_['isString'](_0x1d6662[_0x296097])){_0x1d6662[_0x296097]=_0x1d6662[_0x296097][_0x0521('0x148')](/{{{/g,_0x0521('0x149'))[_0x0521('0x148')](/}}}/g,_0x0521('0x14a'))[_0x0521('0x148')](/{{/g,'@{')[_0x0521('0x148')](/}}/g,'}@');if(_[_0x0521('0x14b')](sensitiveFields,_0x296097)){_0x1d6662[_0x296097]=_0x1d6662[_0x296097][_0x0521('0x148')](_0x3cfbc9,'*');}}}} \ No newline at end of file +var _0x5fdc=['test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxApplication','/api/fax/interactions','/api/fax/messages','/api/fax/queues','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/cloudProvider','/api/realtime','./api/realtime','./api/authLocal','/api/auth/google','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','resolve','appPath','/index.html','username','newPassword','street','phone','mobile','clientId','clientSecret','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','key','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','./safe-template','safeTemplate','default','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','url','statusCode','responseTime','user','name','role','inspect','use','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)','connection','other','agent_name'];(function(_0x349a6a,_0x291b2a){var _0x3f6577=function(_0x384071){while(--_0x384071){_0x349a6a['push'](_0x349a6a['shift']());}};_0x3f6577(++_0x291b2a);}(_0x5fdc,0x127));var _0xc5fd=function(_0x16d68f,_0x445905){_0x16d68f=_0x16d68f-0x0;var _0x532423=_0x5fdc[_0x16d68f];return _0x532423;};'use strict';var _=require(_0xc5fd('0x0'));var path=require(_0xc5fd('0x1'));var express=require(_0xc5fd('0x2'));var ewinston=require(_0xc5fd('0x3'));var util=require(_0xc5fd('0x4'));var errors=require(_0xc5fd('0x5'));var config=require(_0xc5fd('0x6'));var logger=require(_0xc5fd('0x7'))(_0xc5fd('0x8'));var authLogger=require(_0xc5fd('0x7'))(_0xc5fd('0x9'));var safeTemplate=require(_0xc5fd('0xa'))[_0xc5fd('0xb')];exports[_0xc5fd('0xc')]=function(_0x15ffe7){_0x15ffe7['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x493389,_0x224801){var _0x46bce3=_0xc5fd('0xd');if(!_[_0xc5fd('0xe')](_0x493389['body'])){_0x46bce3+='\x20body=%s';var _0x3442dd=_0x493389[_0xc5fd('0xf')];maskSensitiveData(_0x3442dd);}return safeTemplate(util[_0xc5fd('0x10')](_0x46bce3,_0x493389[_0xc5fd('0x11')],_0x493389[_0xc5fd('0x12')][_0xc5fd('0x13')]?_0x493389['headers'][_0xc5fd('0x13')]:_0x493389['connection']['remoteAddress']||_0x493389['ip'],_0x493389[_0xc5fd('0x14')],_0x224801[_0xc5fd('0x15')],_0x224801[_0xc5fd('0x16')],_0x493389[_0xc5fd('0x17')]?_0x493389[_0xc5fd('0x17')]['id']:null,_0x493389[_0xc5fd('0x17')]?_0x493389[_0xc5fd('0x17')][_0xc5fd('0x18')]:null,_0x493389['user']?_0x493389[_0xc5fd('0x17')][_0xc5fd('0x19')]:null,_0x3442dd?util[_0xc5fd('0x1a')](_0x3442dd,![],null):''));}}));_0x15ffe7[_0xc5fd('0x1b')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4fd364,_0x4efafd){var _0x5529b3='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4fd364[_0xc5fd('0xf')]&&_0x4fd364[_0xc5fd('0xf')][_0xc5fd('0x1c')]&&_0x4fd364[_0xc5fd('0xf')][_0xc5fd('0x1d')]){_0x5529b3=_0xc5fd('0x1e');}return util[_0xc5fd('0x10')](_0x5529b3,_0x4fd364['method'],_0x4fd364[_0xc5fd('0x12')][_0xc5fd('0x13')]?_0x4fd364[_0xc5fd('0x12')][_0xc5fd('0x13')]:_0x4fd364[_0xc5fd('0x1f')]['remoteAddress']||_0x4fd364['ip'],_0x4fd364[_0xc5fd('0x14')],_0x4efafd[_0xc5fd('0x15')],_0x4efafd[_0xc5fd('0x16')],_0x4fd364[_0xc5fd('0x17')]?_0x4fd364['user']['id']:null,_0x4fd364['user']?_0x4fd364[_0xc5fd('0x17')][_0xc5fd('0x18')]:null,_0x4fd364[_0xc5fd('0x17')]?_0x4fd364[_0xc5fd('0x17')][_0xc5fd('0x19')]:null,_0x4fd364[_0xc5fd('0xf')]&&_0x4fd364['body'][_0xc5fd('0x1c')]?_0x4fd364[_0xc5fd('0xf')][_0xc5fd('0x1c')]:_0xc5fd('0x20'),_0x4fd364[_0xc5fd('0xf')]&&_0x4fd364[_0xc5fd('0xf')][_0xc5fd('0x1d')]?_0x4fd364['body'][_0xc5fd('0x1d')]:'',_0x4fd364['body']&&_0x4fd364[_0xc5fd('0xf')][_0xc5fd('0x21')]?_0x4fd364[_0xc5fd('0xf')][_0xc5fd('0x21')]:'');},'ignoreRoute':function(_0x5cafd3){var _0x176313=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x176313[_0xc5fd('0x22')](_0x5cafd3[_0xc5fd('0x14')]);}}));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x23'),require(_0xc5fd('0x24')));_0x15ffe7['use'](_0xc5fd('0x25'),require('./api/voiceChanSpy'));_0x15ffe7['use'](_0xc5fd('0x26'),require(_0xc5fd('0x27')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x28'),require(_0xc5fd('0x29')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x2a'),require(_0xc5fd('0x2b')));_0x15ffe7['use'](_0xc5fd('0x2c'),require(_0xc5fd('0x2d')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x2e'),require(_0xc5fd('0x2f')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x30'),require(_0xc5fd('0x31')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x32'),require(_0xc5fd('0x33')));_0x15ffe7[_0xc5fd('0x1b')]('/api/voice/mails/messages',require(_0xc5fd('0x34')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x35'),require(_0xc5fd('0x36')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x37'),require(_0xc5fd('0x38')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x39'),require('./api/voiceAgentReport'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x3a'),require(_0xc5fd('0x3b')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x3c'),require(_0xc5fd('0x3d')));_0x15ffe7[_0xc5fd('0x1b')]('/api/trunks',require(_0xc5fd('0x3e')));_0x15ffe7[_0xc5fd('0x1b')]('/api/voice/transfers/reports',require(_0xc5fd('0x3f')));_0x15ffe7['use'](_0xc5fd('0x40'),require(_0xc5fd('0x41')));_0x15ffe7[_0xc5fd('0x1b')]('/api/mail/accounts',require(_0xc5fd('0x42')));_0x15ffe7[_0xc5fd('0x1b')]('/api/mail/queues',require(_0xc5fd('0x43')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x44'),require(_0xc5fd('0x45')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x46'),require('./api/mailInteraction'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x47'),require(_0xc5fd('0x48')));_0x15ffe7[_0xc5fd('0x1b')]('/api/mail/applications',require('./api/mailApplication'));_0x15ffe7['use'](_0xc5fd('0x49'),require(_0xc5fd('0x4a')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x4b'),require(_0xc5fd('0x4c')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x4d'),require(_0xc5fd('0x4e')));_0x15ffe7[_0xc5fd('0x1b')]('/api/fax/accounts',require('./api/faxAccount'));_0x15ffe7[_0xc5fd('0x1b')]('/api/fax/applications',require(_0xc5fd('0x4f')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x50'),require('./api/faxInteraction'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x51'),require('./api/faxMessage'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x52'),require('./api/faxQueue'));_0x15ffe7[_0xc5fd('0x1b')]('/api/fax/reports/queue',require(_0xc5fd('0x53')));_0x15ffe7[_0xc5fd('0x1b')]('/api/sms/accounts',require(_0xc5fd('0x54')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x55'),require('./api/smsApplication'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x56'),require('./api/smsInteraction'));_0x15ffe7['use'](_0xc5fd('0x57'),require('./api/smsMessage'));_0x15ffe7['use']('/api/sms/queues',require(_0xc5fd('0x58')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x59'),require(_0xc5fd('0x5a')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x5b'),require('./api/openchannelApplication'));_0x15ffe7['use']('/api/openchannel/interactions',require(_0xc5fd('0x5c')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x5d'),require('./api/openchannelMessage'));_0x15ffe7[_0xc5fd('0x1b')]('/api/openchannel/queues',require(_0xc5fd('0x5e')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x5f'),require(_0xc5fd('0x60')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x61'),require('./api/openchannelQueueReport'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x62'),require('./api/chatApplication'));_0x15ffe7['use'](_0xc5fd('0x63'),require('./api/chatInteraction'));_0x15ffe7['use'](_0xc5fd('0x64'),require(_0xc5fd('0x65')));_0x15ffe7['use'](_0xc5fd('0x66'),require(_0xc5fd('0x67')));_0x15ffe7['use'](_0xc5fd('0x68'),require(_0xc5fd('0x69')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x6a'),require(_0xc5fd('0x6b')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x6c'),require(_0xc5fd('0x6d')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x6e'),require(_0xc5fd('0x6f')));_0x15ffe7['use'](_0xc5fd('0x70'),require(_0xc5fd('0x71')));_0x15ffe7[_0xc5fd('0x1b')]('/api/cm/hopper',require(_0xc5fd('0x72')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x73'),require(_0xc5fd('0x74')));_0x15ffe7['use'](_0xc5fd('0x75'),require('./api/cmHopperFinal'));_0x15ffe7['use'](_0xc5fd('0x76'),require(_0xc5fd('0x77')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x78'),require(_0xc5fd('0x79')));_0x15ffe7['use']('/api/actions',require(_0xc5fd('0x7a')));_0x15ffe7[_0xc5fd('0x1b')]('/api/automations',require('./api/automation'));_0x15ffe7['use'](_0xc5fd('0x7b'),require('./api/cannedAnswer'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x7c'),require(_0xc5fd('0x7d')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x7e'),require(_0xc5fd('0x7f')));_0x15ffe7[_0xc5fd('0x1b')]('/api/intervals',require(_0xc5fd('0x80')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x81'),require('./api/pause'));_0x15ffe7['use'](_0xc5fd('0x82'),require(_0xc5fd('0x83')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x84'),require(_0xc5fd('0x85')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x86'),require(_0xc5fd('0x87')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x88'),require(_0xc5fd('0x89')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x8a'),require(_0xc5fd('0x8b')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x8c'),require('./api/template'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x8d'),require(_0xc5fd('0x8e')));_0x15ffe7['use'](_0xc5fd('0x8f'),require(_0xc5fd('0x90')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x91'),require('./api/integration'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x92'),require('./api/integrationReport'));_0x15ffe7[_0xc5fd('0x1b')]('/api/analytics/custom_reports',require(_0xc5fd('0x93')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x94'),require(_0xc5fd('0x95')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x96'),require('./api/analyticExtractedReport'));_0x15ffe7['use'](_0xc5fd('0x97'),require(_0xc5fd('0x98')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x99'),require(_0xc5fd('0x9a')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x9b'),require(_0xc5fd('0x9c')));_0x15ffe7['use'](_0xc5fd('0x9d'),require(_0xc5fd('0x9e')));_0x15ffe7['use']('/api/integrations/salesforce/configurations',require(_0xc5fd('0x9f')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xa0'),require(_0xc5fd('0xa1')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xa2'),require(_0xc5fd('0xa3')));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/sugarcrm/configurations',require(_0xc5fd('0xa4')));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/sugarcrm/fields',require(_0xc5fd('0xa5')));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/desk/accounts',require(_0xc5fd('0xa6')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xa7'),require(_0xc5fd('0xa8')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xa9'),require(_0xc5fd('0xaa')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xab'),require(_0xc5fd('0xac')));_0x15ffe7['use']('/api/integrations/zoho/configurations',require(_0xc5fd('0xad')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xae'),require('./api/intZohoField'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xaf'),require(_0xc5fd('0xb0')));_0x15ffe7['use'](_0xc5fd('0xb1'),require(_0xc5fd('0xb2')));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xb3'),require('./api/intFreshdeskAccount'));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/freshdesk/configurations',require(_0xc5fd('0xb4')));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xb5'),require(_0xc5fd('0xb6')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xb7'),require(_0xc5fd('0xb8')));_0x15ffe7['use'](_0xc5fd('0xb9'),require(_0xc5fd('0xba')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xbb'),require(_0xc5fd('0xbc')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xbd'),require(_0xc5fd('0xbe')));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/servicenow/fields',require(_0xc5fd('0xbf')));_0x15ffe7['use'](_0xc5fd('0xc0'),require(_0xc5fd('0xc1')));_0x15ffe7[_0xc5fd('0x1b')]('/api/integrations/dynamics365/configurations',require(_0xc5fd('0xc2')));_0x15ffe7['use']('/api/integrations/dynamics365/fields',require(_0xc5fd('0xc3')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xc4'),require(_0xc5fd('0xc5')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xc6'),require('./api/intFreshsalesConfiguration'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xc7'),require(_0xc5fd('0xc8')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xc9'),require('./api/network'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xca'),require(_0xc5fd('0xcb')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xcc'),require(_0xc5fd('0xcd')));_0x15ffe7[_0xc5fd('0x1b')]('/api/jscripty/answers/reports',require(_0xc5fd('0xce')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xcf'),require(_0xc5fd('0xd0')));_0x15ffe7['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xd1'),require(_0xc5fd('0xd2')));_0x15ffe7['use'](_0xc5fd('0xd3'),require(_0xc5fd('0xd4')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xd5'),require(_0xc5fd('0xd6')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xd7'),require('./api/jscriptyProject'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xd8'),require(_0xc5fd('0xd9')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xda'),require(_0xc5fd('0xdb')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xdc'),require(_0xc5fd('0xdd')));_0x15ffe7[_0xc5fd('0x1b')]('/api/square/recordings',require(_0xc5fd('0xde')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xdf'),require(_0xc5fd('0xe0')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xe1'),require(_0xc5fd('0xe2')));_0x15ffe7['use'](_0xc5fd('0xe3'),require('./api/license'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xe4'),require(_0xc5fd('0xe5')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xe6'),require(_0xc5fd('0xe7')));_0x15ffe7['use'](_0xc5fd('0xe8'),require('./api/attachment'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xe9'),require('./api/plugin'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xea'),require(_0xc5fd('0xeb')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xec'),require(_0xc5fd('0xed')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xee'),require(_0xc5fd('0xef')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xf0'),require(_0xc5fd('0xf1')));_0x15ffe7['use'](_0xc5fd('0xf2'),require('./api/smsTransferReport'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xf3'),require('./api/cmList'));_0x15ffe7['use'](_0xc5fd('0xf4'),require('./api/voicePrefix'));_0x15ffe7['use'](_0xc5fd('0xf5'),require(_0xc5fd('0xf6')));_0x15ffe7['use'](_0xc5fd('0xf7'),require(_0xc5fd('0xf8')));_0x15ffe7['use'](_0xc5fd('0xf9'),require(_0xc5fd('0xfa')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xfb'),require(_0xc5fd('0xfc')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0xfd'),require(_0xc5fd('0xfe')));_0x15ffe7[_0xc5fd('0x1b')]('/api/whatsapp/applications',require(_0xc5fd('0xff')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x100'),require(_0xc5fd('0x101')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x102'),require('./api/whatsappMessage'));_0x15ffe7[_0xc5fd('0x1b')]('/api/whatsapp/reports/queue',require(_0xc5fd('0x103')));_0x15ffe7[_0xc5fd('0x1b')]('/api/whatsapp/reports/transfer',require(_0xc5fd('0x104')));_0x15ffe7[_0xc5fd('0x1b')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x15ffe7[_0xc5fd('0x1b')]('/api/cloudProviders',require(_0xc5fd('0x105')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x106'),require(_0xc5fd('0x107')));_0x15ffe7[_0xc5fd('0x1b')]('/api/auth/local',require(_0xc5fd('0x108')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x109'),require('./api/authGoogle'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x10a'),require('./api/authActiveDirectory'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x10b'),require('./api/jira'));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x10c'),require(_0xc5fd('0x10d')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x10e'),require(_0xc5fd('0x10f')));_0x15ffe7['use'](_0xc5fd('0x110'),require(_0xc5fd('0x111')));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x112'),require(_0xc5fd('0x113')));_0x15ffe7[_0xc5fd('0x1b')]('/api/webbar',require(_0xc5fd('0x114')));_0x15ffe7[_0xc5fd('0x1b')]('/apidoc',express[_0xc5fd('0x115')](path[_0xc5fd('0x116')](config[_0xc5fd('0x117')],_0xc5fd('0x118'))));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x119'),express[_0xc5fd('0x115')](path[_0xc5fd('0x116')](config[_0xc5fd('0x117')],_0xc5fd('0x119'))));_0x15ffe7['use'](_0xc5fd('0x11a'),express[_0xc5fd('0x115')](path[_0xc5fd('0x116')](config[_0xc5fd('0x117')],_0xc5fd('0x11a'))));_0x15ffe7['use'](_0xc5fd('0x11b'),express[_0xc5fd('0x115')](path[_0xc5fd('0x116')](config[_0xc5fd('0x117')],_0xc5fd('0x11c'),_0xc5fd('0x11d'))));_0x15ffe7[_0xc5fd('0x1b')](_0xc5fd('0x11e'),express[_0xc5fd('0x115')](path['join'](config[_0xc5fd('0x117')],_0xc5fd('0x11f'))));_0x15ffe7[_0xc5fd('0x120')](_0xc5fd('0x121'))['get'](errors[0x194]);_0x15ffe7[_0xc5fd('0x120')]('/*')['get'](function(_0x5afaf5,_0x5e0206){_0x5e0206['sendFile'](path[_0xc5fd('0x122')](_0x15ffe7['get'](_0xc5fd('0x123'))+_0xc5fd('0x124')));});};var sensitiveFields=[_0xc5fd('0x125'),'password',_0xc5fd('0x126'),'apiKey','firstName','lastName',_0xc5fd('0x127'),_0xc5fd('0x128'),_0xc5fd('0x129'),'fax','email',_0xc5fd('0x12a'),_0xc5fd('0x12b'),'securityToken',_0xc5fd('0x12c'),_0xc5fd('0x12d'),'tenantId',_0xc5fd('0x12e'),_0xc5fd('0x12f'),_0xc5fd('0x130'),_0xc5fd('0x131'),_0xc5fd('0x132'),_0xc5fd('0x133'),_0xc5fd('0x134'),_0xc5fd('0x135'),_0xc5fd('0x136'),_0xc5fd('0x137'),_0xc5fd('0x138'),_0xc5fd('0x139'),'clientEmail',_0xc5fd('0x13a'),'accesskeyid',_0xc5fd('0x13b'),_0xc5fd('0x13c'),_0xc5fd('0x17'),'pass',_0xc5fd('0x13d'),'localstationid',_0xc5fd('0x13e'),_0xc5fd('0x13f'),_0xc5fd('0x140'),_0xc5fd('0x141')];function maskSensitiveData(_0x2d4ecc){var _0x4065d9=/(?!^)[\s\S](?!$)/g;if(!_[_0xc5fd('0x142')](_0x2d4ecc))return;for(var _0x241693 in _0x2d4ecc){if(_[_0xc5fd('0x143')](_0x2d4ecc[_0x241693])){for(var _0x1a00b6=0x0;_0x1a00b6<_0x2d4ecc[_0x241693][_0xc5fd('0x144')];_0x1a00b6++){maskSensitiveData(_0x2d4ecc[_0x241693][_0x1a00b6]);}}else if(_[_0xc5fd('0x142')](_0x2d4ecc[_0x241693])){maskSensitiveData(_0x2d4ecc[_0x241693]);}else if(_[_0xc5fd('0x145')](_0x2d4ecc[_0x241693])){_0x2d4ecc[_0x241693]=_0x2d4ecc[_0x241693][_0xc5fd('0x146')](/{{{/g,_0xc5fd('0x147'))[_0xc5fd('0x146')](/}}}/g,_0xc5fd('0x148'))[_0xc5fd('0x146')](/{{/g,'@{')[_0xc5fd('0x146')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x241693)){_0x2d4ecc[_0x241693]=_0x2d4ecc[_0x241693][_0xc5fd('0x146')](_0x4065d9,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 52b72a9..92cf539 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x606d=['../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.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/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.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/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc'];(function(_0x106895,_0xf6b6be){var _0x3ee675=function(_0x14d789){while(--_0x14d789){_0x106895['push'](_0x106895['shift']());}};_0x3ee675(++_0xf6b6be);}(_0x606d,0x1c3));var _0xd606=function(_0x5b9106,_0x50050e){_0x5b9106=_0x5b9106-0x0;var _0x1cbbf7=_0x606d[_0x5b9106];return _0x1cbbf7;};'use strict';var jayson=require(_0xd606('0x0'));var BPromise=require(_0xd606('0x1'));var _=require(_0xd606('0x2'));var config=require(_0xd606('0x3'));exports['listen']=function(){return new BPromise(function(_0x2b2af9,_0xb16b34){var _0x11c327={};_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x5')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x6')));_0x11c327=_['merge'](_0x11c327,require('../api/voiceQueue/voiceQueue.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require('../api/voiceRecording/voiceRecording.rpc'));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x7')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x8')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x9')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0xa')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0xb')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0xc')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0xd')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0xe')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0xf')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x10')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x11')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x12')));_0x11c327=_['merge'](_0x11c327,require('../api/mailMessage/mailMessage.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x13')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x14')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x15')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x16')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x17')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x18')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x19')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x1a')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x1b')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x1c')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x1d')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require('../api/smsQueue/smsQueue.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x1e')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x1f')));_0x11c327=_['merge'](_0x11c327,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x20')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x21')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x22')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x23')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x24')));_0x11c327=_['merge'](_0x11c327,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x25')));_0x11c327=_['merge'](_0x11c327,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x11c327=_['merge'](_0x11c327,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x26')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x27')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x28')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x29')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x2a')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x2b')));_0x11c327=_['merge'](_0x11c327,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x2c')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x2d')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x2e')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x2f')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x30')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x31')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x32')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x33')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x34')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x35')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x36')));_0x11c327=_['merge'](_0x11c327,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x37')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x38')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require('../api/squareProject/squareProject.rpc'));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x39')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x3a')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x3b')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x3c')));_0x11c327=_['merge'](_0x11c327,require(_0xd606('0x3d')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x3e')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x3f')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x40')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x41')));_0x11c327=_[_0xd606('0x4')](_0x11c327,require(_0xd606('0x42')));var _0x2fd5de=jayson[_0xd606('0x43')](_0x11c327)[_0xd606('0x44')]();var _0x5c2412=config['rpc'][_0xd606('0x45')]||config[_0xd606('0x45')]+0x1;var _0x4679d7=config[_0xd606('0x46')]['ip']||_0xd606('0x47');_0x2fd5de['on'](_0xd606('0x48'),function(_0x34b873){return _0xb16b34(_0x34b873);});_0x2fd5de[_0xd606('0x49')](_0x5c2412,_0x4679d7,function(){console[_0xd606('0x4a')](_0xd606('0x4b'),_0x4679d7,_0x5c2412);require(_0xd606('0x4c'))[_0xd606('0x4d')]();return _0x2b2af9(_0xd606('0x4e')+_0x4679d7+':'+_0x5c2412);});});}; \ No newline at end of file +var _0x4fc1=['../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','error','listen','log','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/template/template.rpc','../api/variable/variable.rpc'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4fc1,0x1b6));var _0x14fc=function(_0x47e250,_0x29c86d){_0x47e250=_0x47e250-0x0;var _0x2063ea=_0x4fc1[_0x47e250];return _0x2063ea;};'use strict';var jayson=require(_0x14fc('0x0'));var BPromise=require(_0x14fc('0x1'));var _=require(_0x14fc('0x2'));var config=require(_0x14fc('0x3'));exports['listen']=function(){return new BPromise(function(_0x16f319,_0x11628d){var _0x7339e1={};_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/user/user.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x5')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x6')));_0x7339e1=_['merge'](_0x7339e1,require('../api/voiceRecording/voiceRecording.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x7')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x8')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x9')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/memberReport/memberReport.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0xa')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0xb')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0xc')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/mailAccount/mailAccount.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0xd')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/mailInteraction/mailInteraction.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0xe')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0xf')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x10')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x11')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/faxApplication/faxApplication.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x12')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x13')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x14')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x15')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x16')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x17')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x18')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/smsQueue/smsQueue.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x19')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x1a')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x1b')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x1c')));_0x7339e1=_['merge'](_0x7339e1,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x1d')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x1e')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x1f')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x20')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x21')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x22')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x7339e1=_['merge'](_0x7339e1,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x23')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/interval/interval.rpc'));_0x7339e1=_['merge'](_0x7339e1,require('../api/pause/pause.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/sound/sound.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x24')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/trigger/trigger.rpc'));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x25')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x26')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x27')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x28')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x29')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x2a')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x2b')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x2c')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x2d')));_0x7339e1=_['merge'](_0x7339e1,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x2e')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x2f')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x30')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x31')));_0x7339e1=_['merge'](_0x7339e1,require('../api/squareOdbc/squareOdbc.rpc'));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x32')));_0x7339e1=_['merge'](_0x7339e1,require('../api/squareRecording/squareRecording.rpc'));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x33')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x34')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x35')));_0x7339e1=_['merge'](_0x7339e1,require(_0x14fc('0x36')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x37')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x38')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x39')));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x7339e1=_[_0x14fc('0x4')](_0x7339e1,require(_0x14fc('0x3a')));var _0x13f654=jayson[_0x14fc('0x3b')](_0x7339e1)[_0x14fc('0x3c')]();var _0x327cb2=config['rpc'][_0x14fc('0x3d')]||config['port']+0x1;var _0x44392c=config[_0x14fc('0x3e')]['ip']||'localhost';_0x13f654['on'](_0x14fc('0x3f'),function(_0x5d3d4f){return _0x11628d(_0x5d3d4f);});_0x13f654[_0x14fc('0x40')](_0x327cb2,_0x44392c,function(){console[_0x14fc('0x41')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x44392c,_0x327cb2);require(_0x14fc('0x42'))['default']();return _0x16f319(_0x14fc('0x43')+_0x44392c+':'+_0x327cb2);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index b98d00d..e963442 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb03e=['safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','exports'];(function(_0x50d9b1,_0x14ec54){var _0x2f5333=function(_0x30962a){while(--_0x30962a){_0x50d9b1['push'](_0x50d9b1['shift']());}};_0x2f5333(++_0x14ec54);}(_0xb03e,0x1eb));var _0xeb03=function(_0x28522d,_0x1ac989){_0x28522d=_0x28522d-0x0;var _0x5f1115=_0xb03e[_0x28522d];return _0x5f1115;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x36351b){return _0x36351b==='{{'?_0xeb03('0x0'):_0xeb03('0x1');}function safeTemplate(_0x3c5e68){var _0x1c58b5=_0x3c5e68;if(typeof _0x3c5e68===_0xeb03('0x2')){_0x1c58b5=_0x3c5e68[_0xeb03('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb03('0x4')](_0x3c5e68)){_0x1c58b5=_0x3c5e68[_0xeb03('0x5')](function(_0x3ba4b0){return safeTemplate(_0x3ba4b0);});}else if(_[_0xeb03('0x6')](_0x3c5e68)){_0x1c58b5=Object[_0xeb03('0x7')](_0x3c5e68)['reduce'](function(_0x3b58a2,_0x3d3322){_0x3b58a2[_0x3d3322]=safeTemplate(_0x3c5e68[_0x3d3322]);return _0x3b58a2;},{});}return _0x1c58b5;}module[_0xeb03('0x8')][_0xeb03('0x9')]=safeTemplate; \ No newline at end of file +var _0xf4f4=['replace','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}','string'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x158fc6,_0x260dfe){_0x158fc6=_0x158fc6-0x0;var _0x224b0d=_0xf4f4[_0x158fc6];return _0x224b0d;};var _=require(_0x4f4f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x230375){return _0x230375==='{{'?'{\x20{\x20':_0x4f4f('0x1');}function safeTemplate(_0x304b11){var _0x19aa05=_0x304b11;if(typeof _0x304b11===_0x4f4f('0x2')){_0x19aa05=_0x304b11[_0x4f4f('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x304b11)){_0x19aa05=_0x304b11[_0x4f4f('0x4')](function(_0x593952){return safeTemplate(_0x593952);});}else if(_[_0x4f4f('0x5')](_0x304b11)){_0x19aa05=Object[_0x4f4f('0x6')](_0x304b11)[_0x4f4f('0x7')](function(_0x1ff75a,_0x3c4877){_0x1ff75a[_0x3c4877]=safeTemplate(_0x304b11[_0x3c4877]);return _0x1ff75a;},{});}return _0x19aa05;}module[_0x4f4f('0x8')][_0x4f4f('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 7fbc7dc..6c1bb38 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 _0xf130=['HANGUP','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','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','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','noop','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','emit','ready','line','substring','520-Invalid','search','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','sendRequest','getData','beep','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s'];(function(_0x4789a5,_0x37d94c){var _0x58ec6d=function(_0x2af2bd){while(--_0x2af2bd){_0x4789a5['push'](_0x4789a5['shift']());}};_0x58ec6d(++_0x37d94c);}(_0xf130,0x149));var _0x0f13=function(_0xfe9875,_0x5b829a){_0xfe9875=_0xfe9875-0x0;var _0x2005d6=_0xf130[_0xfe9875];return _0x2005d6;};'use strict';var util=require(_0x0f13('0x0'));var _=require(_0x0f13('0x1'));var EventEmitter=require(_0x0f13('0x2'))[_0x0f13('0x3')];var AGIReply=require(_0x0f13('0x4'));var AGIError=require(_0x0f13('0x5'));function AGIChannel(_0x73975e){var _0x27a2aa=this,_0x485021=new AGIReply(),_0x1313c4=![],_0x1f9807={};EventEmitter[_0x0f13('0x6')](_0x27a2aa);_0x73975e[_0x0f13('0x7')]('utf8');_0x73975e[_0x0f13('0x8')](0x8*0x3c*0x3c*0x3e8);_0x485021[_0x0f13('0x7')](_0x0f13('0x9'));_0x485021['on']('headers',function(_0x4407fc){for(var _0x41ebe8 in _0x4407fc){_0x27a2aa[_0x41ebe8]=_0x4407fc[_0x41ebe8];}_0x27a2aa[_0x0f13('0xa')](_0x0f13('0xb'));});_0x485021['on'](_0x0f13('0xc'),function(_0x3573de){if(_0x3573de['toLowerCase']()=='hangup'){_0x27a2aa[_0x0f13('0xa')]('hangup');return;}if(_0x3573de[_0x0f13('0xd')](0x0,0xb)==_0x0f13('0xe')){_0x1313c4=!![];}if(_0x1313c4){_0x1f9807['rx']+=_0x3573de+'\x0a';if(_0x3573de[_0x0f13('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x1313c4=![];}}else{_0x1f9807['rx']=_0x3573de;}if(_0x1313c4){return;}if(typeof _0x1f9807['cb']==_0x0f13('0x10')){var _0x216bb7=_0x1f9807['rx'][_0x0f13('0xd')](0x0,0x3),_0x3e7de8=null,_0x2ad79e=null;_0x216bb7=parseInt(_0x216bb7);if(isNaN(_0x216bb7)){_0x1f9807['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0f13('0x11')});return;}if(_0x216bb7!=0xc8){_0x1f9807['cb'](null,{'code':_0x216bb7,'result':-0x1,'extra':'KO'});return;}_0x3e7de8=_0x1f9807['rx']['substring'](0x4)[_0x0f13('0x12')](_0x0f13('0x13'),'');if(_0x3e7de8['indexOf']('\x20')!=-0x1){_0x3e7de8=_0x3e7de8[_0x0f13('0x14')](0x0,_0x3e7de8[_0x0f13('0x15')]('\x20'));}if(_[_0x0f13('0x16')](_0x3e7de8,'-1')){_0x3e7de8=parseInt(_0x3e7de8);}_0x2ad79e=_0x1f9807['rx'][_0x0f13('0x17')]('\x20');if(_0x2ad79e[_0x0f13('0x18')]==0x3){_0x2ad79e=_0x2ad79e[0x2][_0x0f13('0xd')](0x1,_0x2ad79e[0x2][_0x0f13('0x18')]-0x1);}else if(_0x2ad79e[_0x0f13('0x18')]>0x3){var _0x5702c3=/\((.+)\)/;var _0x2d3c7a=_0x1f9807['rx'][_0x0f13('0x19')](_0x5702c3);if(_0x2d3c7a){_0x2ad79e=_0x2d3c7a[0x1];}else{_0x2ad79e=null;}}else{_0x2ad79e=null;}_0x1f9807['cb'](null,{'code':_0x216bb7,'result':_0x3e7de8,'extra':_0x2ad79e});}});_0x73975e['on']('error',function(_0x467e84){_0x27a2aa['emit'](_0x0f13('0x1a'),new AGIError(_0x0f13('0x1b'),_0x467e84[_0x0f13('0x1c')]));});_0x73975e['on'](_0x0f13('0x1d'),function(){_0x27a2aa['emit']('close',new AGIError(_0x0f13('0x1e')));});_0x73975e['on'](_0x0f13('0x1f'),function(){_0x27a2aa[_0x0f13('0xa')](_0x0f13('0x1f'),new AGIError(_0x0f13('0x20')));_0x73975e[_0x0f13('0x21')]();});_0x73975e[_0x0f13('0x22')](_0x485021);this[_0x0f13('0x23')]=function(_0x188c77,_0x728b17){var _0x188c77=_0x188c77||'',_0x728b17=typeof _0x728b17==_0x0f13('0x10')?_0x728b17:new Function();_0x1f9807={'tx':_0x188c77,'rx':'','cb':_0x728b17};_0x73975e[_0x0f13('0x24')](_0x188c77+'\x0a');},this[_0x0f13('0x1d')]=function(){_0x73975e[_0x0f13('0x21')]();};}util[_0x0f13('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x0f13('0x26')]['sendRequest']=function(_0xcf272e){return this[_0x0f13('0x23')][_0x0f13('0x27')](this,_0xcf272e);};AGIChannel[_0x0f13('0x26')]['answer']=function(){return this[_0x0f13('0x28')]('ANSWER');};AGIChannel[_0x0f13('0x26')][_0x0f13('0x29')]=function(_0x1f5c7e,_0x5c6141,_0x196fc6){_0x1f5c7e=_0x1f5c7e===undefined?_0x0f13('0x2a'):_0x1f5c7e;_0x5c6141=_0x5c6141===undefined?'5':_0x5c6141;_0x196fc6=_0x196fc6===undefined?'1':_0x196fc6;return this[_0x0f13('0x28')](util[_0x0f13('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x1f5c7e,_0x5c6141*0x3e8,_0x196fc6));};AGIChannel[_0x0f13('0x26')]['noop']=function(_0x57b9ed){_0x57b9ed=_0x57b9ed||'NO\x20MESSAGE';return this[_0x0f13('0x28')](util[_0x0f13('0x2b')](_0x0f13('0x2c'),_0x57b9ed));};AGIChannel['prototype'][_0x0f13('0x2d')]=function(_0x234713,_0x51a83d){if(_['isArray'](_0x51a83d)){return this[_0x0f13('0x28')](util[_0x0f13('0x2b')]('EXEC\x20%s\x20%s',_0x234713,_0x51a83d['join'](',')));}return this[_0x0f13('0x28')](util[_0x0f13('0x2b')](_0x0f13('0x2e'),_0x234713,_0x51a83d));};AGIChannel[_0x0f13('0x26')]['setContext']=function(_0x29f479){return this[_0x0f13('0x28')](util['format'](_0x0f13('0x2f'),_0x29f479));};AGIChannel[_0x0f13('0x26')][_0x0f13('0x30')]=function(_0x8f695){return this[_0x0f13('0x28')](util['format']('SET\x20EXTENSION\x20%s',_0x8f695));};AGIChannel['prototype'][_0x0f13('0x31')]=function(_0x59e936){return this[_0x0f13('0x28')](util[_0x0f13('0x2b')](_0x0f13('0x32'),_0x59e936));};AGIChannel[_0x0f13('0x26')]['hangup']=function(){return this[_0x0f13('0x28')](_0x0f13('0x33'));};AGIChannel[_0x0f13('0x26')]['setVariable']=function(_0x16a1d4,_0x1a459e){var _0xa31da5=_[_0x0f13('0x34')](_0x1a459e)||_[_0x0f13('0x35')](_0x1a459e)?_0x1a459e['toString']():_0x1a459e;return this[_0x0f13('0x28')](util[_0x0f13('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x16a1d4,_0xa31da5?_0xa31da5['toString']()[_0x0f13('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0f13('0x26')][_0x0f13('0x36')]=function(_0x4c251b,_0x54ef43){return this[_0x0f13('0x28')](util['format'](_0x0f13('0x37'),_0x4c251b,_0x54ef43));};AGIChannel[_0x0f13('0x26')][_0x0f13('0x38')]=function(_0x19f7b5,_0x3eb593){return this[_0x0f13('0x28')](util[_0x0f13('0x2b')]('SAY\x20DIGITS\x20%s\x20%s',_0x19f7b5,_0x3eb593));};AGIChannel['prototype'][_0x0f13('0x39')]=function(_0x54b225,_0x9f8274){return this['sendRequest'](util[_0x0f13('0x2b')](_0x0f13('0x3a'),_0x54b225,_0x9f8274));};AGIChannel[_0x0f13('0x26')][_0x0f13('0x3b')]=function(_0x58d0ad,_0x1ab190,_0x8d2ff8){_0x1ab190=_0x1ab190||this['extension'];_0x8d2ff8=_0x8d2ff8||0x1;this[_0x0f13('0x3c')](_0x58d0ad);this[_0x0f13('0x30')](_0x1ab190);this['setPriority'](_0x8d2ff8);return this['noop'](util[_0x0f13('0x2b')](_0x0f13('0x3d'),_0x58d0ad,_0x1ab190,_0x8d2ff8));};AGIChannel[_0x0f13('0x26')][_0x0f13('0x3e')]=function(_0x31b5ec){return this['sendRequest'](util[_0x0f13('0x2b')](_0x0f13('0x3f'),_0x31b5ec));};AGIChannel['prototype'][_0x0f13('0x40')]=function(_0x147a08,_0x2c11d6,_0x3c4de8,_0x2573c6,_0x4c03f7,_0x4fc678){_0x2c11d6=_0x2c11d6||_0x0f13('0x41');_0x3c4de8=_0x3c4de8||'';_0x2573c6=_0x2573c6===undefined?-0x1:_0x2573c6==='-1'?-0x1:_0x2573c6*0x3e8;_0x4c03f7=_0x4c03f7===undefined?'':'s='+_0x4c03f7;_0x4fc678=_0x4fc678?_0x0f13('0x42'):'';return this[_0x0f13('0x28')](util[_0x0f13('0x2b')](_0x0f13('0x43'),_0x147a08,_0x2c11d6,_0x3c4de8,_0x2573c6,_0x4fc678,_0x4c03f7));};AGIChannel[_0x0f13('0x26')][_0x0f13('0x44')]=function(_0x1b6285,_0x17ea8e){_0x17ea8e=_0x17ea8e||'';return this[_0x0f13('0x28')](util['format'](_0x0f13('0x45'),_0x1b6285,_0x17ea8e));};AGIChannel[_0x0f13('0x26')][_0x0f13('0x46')]=function(_0x1f210c){return this['exec'](_0x0f13('0x47'),_0x1f210c);};AGIChannel[_0x0f13('0x26')][_0x0f13('0x48')]=function(_0x26eef7){return this['exec'](_0x0f13('0x49'),_0x26eef7);};AGIChannel[_0x0f13('0x26')][_0x0f13('0x1a')]=function(_0x3c6301,_0x54ac44){this[_0x0f13('0x4a')](util[_0x0f13('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3c6301['id'],_0x3c6301['label'],_0x54ac44));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0f13('0x4b')]=AGIChannel; \ No newline at end of file +var _0x29eb=['./reply','./error','call','setEncoding','utf8','setTimeout','headers','line','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','destroy','inherits','prototype','sendRequest','sync','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20PRIORITY\x20%s','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','util','lodash','events'];(function(_0x3a3a6a,_0x5eb6a9){var _0xa89294=function(_0x55d78c){while(--_0x55d78c){_0x3a3a6a['push'](_0x3a3a6a['shift']());}};_0xa89294(++_0x5eb6a9);}(_0x29eb,0x1c5));var _0xb29e=function(_0x4537cf,_0x5bd246){_0x4537cf=_0x4537cf-0x0;var _0x773ac5=_0x29eb[_0x4537cf];return _0x773ac5;};'use strict';var util=require(_0xb29e('0x0'));var _=require(_0xb29e('0x1'));var EventEmitter=require(_0xb29e('0x2'))['EventEmitter'];var AGIReply=require(_0xb29e('0x3'));var AGIError=require(_0xb29e('0x4'));function AGIChannel(_0xbacdd6){var _0x4a9b91=this,_0x29356f=new AGIReply(),_0x4c648e=![],_0x14c35b={};EventEmitter[_0xb29e('0x5')](_0x4a9b91);_0xbacdd6[_0xb29e('0x6')](_0xb29e('0x7'));_0xbacdd6[_0xb29e('0x8')](0x8*0x3c*0x3c*0x3e8);_0x29356f[_0xb29e('0x6')]('utf8');_0x29356f['on'](_0xb29e('0x9'),function(_0x29758f){for(var _0x285152 in _0x29758f){_0x4a9b91[_0x285152]=_0x29758f[_0x285152];}_0x4a9b91['emit']('ready');});_0x29356f['on'](_0xb29e('0xa'),function(_0x521d07){if(_0x521d07['toLowerCase']()==_0xb29e('0xb')){_0x4a9b91[_0xb29e('0xc')]('hangup');return;}if(_0x521d07[_0xb29e('0xd')](0x0,0xb)==_0xb29e('0xe')){_0x4c648e=!![];}if(_0x4c648e){_0x14c35b['rx']+=_0x521d07+'\x0a';if(_0x521d07[_0xb29e('0xf')](_0xb29e('0x10'))!=-0x1){_0x4c648e=![];}}else{_0x14c35b['rx']=_0x521d07;}if(_0x4c648e){return;}if(typeof _0x14c35b['cb']==_0xb29e('0x11')){var _0x4d5083=_0x14c35b['rx']['substring'](0x0,0x3),_0x3cef5d=null,_0x5ee22e=null;_0x4d5083=parseInt(_0x4d5083);if(isNaN(_0x4d5083)){_0x14c35b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4d5083!=0xc8){_0x14c35b['cb'](null,{'code':_0x4d5083,'result':-0x1,'extra':'KO'});return;}_0x3cef5d=_0x14c35b['rx'][_0xb29e('0xd')](0x4)[_0xb29e('0x12')](_0xb29e('0x13'),'');if(_0x3cef5d[_0xb29e('0x14')]('\x20')!=-0x1){_0x3cef5d=_0x3cef5d[_0xb29e('0x15')](0x0,_0x3cef5d[_0xb29e('0x14')]('\x20'));}if(_['startsWith'](_0x3cef5d,'-1')){_0x3cef5d=parseInt(_0x3cef5d);}_0x5ee22e=_0x14c35b['rx'][_0xb29e('0x16')]('\x20');if(_0x5ee22e[_0xb29e('0x17')]==0x3){_0x5ee22e=_0x5ee22e[0x2][_0xb29e('0xd')](0x1,_0x5ee22e[0x2][_0xb29e('0x17')]-0x1);}else if(_0x5ee22e['length']>0x3){var _0x523341=/\((.+)\)/;var _0x244067=_0x14c35b['rx'][_0xb29e('0x18')](_0x523341);if(_0x244067){_0x5ee22e=_0x244067[0x1];}else{_0x5ee22e=null;}}else{_0x5ee22e=null;}_0x14c35b['cb'](null,{'code':_0x4d5083,'result':_0x3cef5d,'extra':_0x5ee22e});}});_0xbacdd6['on'](_0xb29e('0x19'),function(_0x355521){_0x4a9b91[_0xb29e('0xc')](_0xb29e('0x19'),new AGIError(_0xb29e('0x1a'),_0x355521[_0xb29e('0x1b')]));});_0xbacdd6['on'](_0xb29e('0x1c'),function(){_0x4a9b91[_0xb29e('0xc')]('close',new AGIError(_0xb29e('0x1d')));});_0xbacdd6['on'](_0xb29e('0x1e'),function(){_0x4a9b91[_0xb29e('0xc')]('timeout',new AGIError(_0xb29e('0x1f')));_0xbacdd6['destroy']();});_0xbacdd6[_0xb29e('0x20')](_0x29356f);this[_0xb29e('0x21')]=function(_0x2a9957,_0x3e3d09){var _0x2a9957=_0x2a9957||'',_0x3e3d09=typeof _0x3e3d09==_0xb29e('0x11')?_0x3e3d09:new Function();_0x14c35b={'tx':_0x2a9957,'rx':'','cb':_0x3e3d09};_0xbacdd6['write'](_0x2a9957+'\x0a');},this['close']=function(){_0xbacdd6[_0xb29e('0x22')]();};}util[_0xb29e('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xb29e('0x24')][_0xb29e('0x25')]=function(_0x190a71){return this[_0xb29e('0x21')][_0xb29e('0x26')](this,_0x190a71);};AGIChannel['prototype']['answer']=function(){return this[_0xb29e('0x25')](_0xb29e('0x27'));};AGIChannel[_0xb29e('0x24')]['getData']=function(_0x58dfdc,_0x4a5c39,_0x9840cc){_0x58dfdc=_0x58dfdc===undefined?_0xb29e('0x28'):_0x58dfdc;_0x4a5c39=_0x4a5c39===undefined?'5':_0x4a5c39;_0x9840cc=_0x9840cc===undefined?'1':_0x9840cc;return this[_0xb29e('0x25')](util[_0xb29e('0x29')](_0xb29e('0x2a'),_0x58dfdc,_0x4a5c39*0x3e8,_0x9840cc));};AGIChannel[_0xb29e('0x24')][_0xb29e('0x2b')]=function(_0x11a022){_0x11a022=_0x11a022||_0xb29e('0x2c');return this[_0xb29e('0x25')](util['format'](_0xb29e('0x2d'),_0x11a022));};AGIChannel[_0xb29e('0x24')][_0xb29e('0x2e')]=function(_0x491c9b,_0x1e62c6){if(_[_0xb29e('0x2f')](_0x1e62c6)){return this[_0xb29e('0x25')](util[_0xb29e('0x29')]('EXEC\x20%s\x20%s',_0x491c9b,_0x1e62c6[_0xb29e('0x30')](',')));}return this[_0xb29e('0x25')](util[_0xb29e('0x29')](_0xb29e('0x31'),_0x491c9b,_0x1e62c6));};AGIChannel['prototype'][_0xb29e('0x32')]=function(_0x1cef23){return this['sendRequest'](util[_0xb29e('0x29')]('SET\x20CONTEXT\x20%s',_0x1cef23));};AGIChannel[_0xb29e('0x24')]['setExtension']=function(_0x2afed2){return this['sendRequest'](util[_0xb29e('0x29')]('SET\x20EXTENSION\x20%s',_0x2afed2));};AGIChannel[_0xb29e('0x24')]['setPriority']=function(_0x1af8a7){return this['sendRequest'](util[_0xb29e('0x29')](_0xb29e('0x33'),_0x1af8a7));};AGIChannel['prototype']['hangup']=function(){return this[_0xb29e('0x25')]('HANGUP');};AGIChannel[_0xb29e('0x24')][_0xb29e('0x34')]=function(_0x23eae1,_0x524451){var _0x500d95=_[_0xb29e('0x35')](_0x524451)||_['isNumber'](_0x524451)?_0x524451[_0xb29e('0x36')]():_0x524451;return this[_0xb29e('0x25')](util['format'](_0xb29e('0x37'),_0x23eae1,_0x500d95?_0x500d95['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xb29e('0x38')]=function(_0x102490,_0x5d1ed7){return this[_0xb29e('0x25')](util[_0xb29e('0x29')](_0xb29e('0x39'),_0x102490,_0x5d1ed7));};AGIChannel[_0xb29e('0x24')][_0xb29e('0x3a')]=function(_0x3a0ce2,_0x21bc16){return this['sendRequest'](util[_0xb29e('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0x3a0ce2,_0x21bc16));};AGIChannel[_0xb29e('0x24')][_0xb29e('0x3b')]=function(_0x42a023,_0x3fcb50){return this[_0xb29e('0x25')](util['format'](_0xb29e('0x3c'),_0x42a023,_0x3fcb50));};AGIChannel[_0xb29e('0x24')][_0xb29e('0x3d')]=function(_0x55663e,_0x3bbdbb,_0x5752fc){_0x3bbdbb=_0x3bbdbb||this[_0xb29e('0x3e')];_0x5752fc=_0x5752fc||0x1;this[_0xb29e('0x32')](_0x55663e);this[_0xb29e('0x3f')](_0x3bbdbb);this['setPriority'](_0x5752fc);return this[_0xb29e('0x2b')](util[_0xb29e('0x29')](_0xb29e('0x40'),_0x55663e,_0x3bbdbb,_0x5752fc));};AGIChannel['prototype']['getVariable']=function(_0xc2747d){return this[_0xb29e('0x25')](util[_0xb29e('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0xc2747d));};AGIChannel['prototype'][_0xb29e('0x41')]=function(_0xa60d23,_0x150812,_0x3aeebc,_0x1e5e22,_0x57d4b7,_0x3d4d1d){_0x150812=_0x150812||_0xb29e('0x42');_0x3aeebc=_0x3aeebc||'';_0x1e5e22=_0x1e5e22===undefined?-0x1:_0x1e5e22==='-1'?-0x1:_0x1e5e22*0x3e8;_0x57d4b7=_0x57d4b7===undefined?'':'s='+_0x57d4b7;_0x3d4d1d=_0x3d4d1d?_0xb29e('0x43'):'';return this['sendRequest'](util[_0xb29e('0x29')](_0xb29e('0x44'),_0xa60d23,_0x150812,_0x3aeebc,_0x1e5e22,_0x3d4d1d,_0x57d4b7));};AGIChannel[_0xb29e('0x24')][_0xb29e('0x45')]=function(_0x28581e,_0x293e5e){_0x293e5e=_0x293e5e||'';return this[_0xb29e('0x25')](util[_0xb29e('0x29')](_0xb29e('0x46'),_0x28581e,_0x293e5e));};AGIChannel[_0xb29e('0x24')][_0xb29e('0x47')]=function(_0x169c56){return this['exec'](_0xb29e('0x48'),_0x169c56);};AGIChannel['prototype'][_0xb29e('0x49')]=function(_0x189988){return this[_0xb29e('0x2e')](_0xb29e('0x4a'),_0x189988);};AGIChannel['prototype'][_0xb29e('0x19')]=function(_0x19f1c6,_0x8be475){this[_0xb29e('0x2b')](util[_0xb29e('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x19f1c6['id'],_0x19f1c6[_0xb29e('0x4b')],_0x8be475));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 3fbe4bc..e6265ea 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 _0xbc93=['Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.'];(function(_0x592b32,_0x16326b){var _0x27deec=function(_0x170607){while(--_0x170607){_0x592b32['push'](_0x592b32['shift']());}};_0x27deec(++_0x16326b);}(_0xbc93,0x158));var _0x3bc9=function(_0x31eea7,_0x5550e0){_0x31eea7=_0x31eea7-0x0;var _0x5796d5=_0xbc93[_0x31eea7];return _0x5796d5;};'use strict';var util=require(_0x3bc9('0x0'));var error={'E_AGI_UNDEFINED':_0x3bc9('0x1'),'E_AGI_ARGUMENT_PORT':_0x3bc9('0x2'),'E_AGI_SERVER_ERROR':_0x3bc9('0x3'),'E_AGI_SERVER_CLOSE':_0x3bc9('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x3bc9('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x3bc9('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x3bc9('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x3bc9('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x3bc9('0x9')};function AGIError(_0x1aab67){var _0x1aab67=_0x1aab67||null,_0x141a4e=_0x141a4e||[],_0x21ab84=0x1,_0x518a64='';if(!error[_0x1aab67]){_0x1aab67=_0x3bc9('0xa');}_0x141a4e[_0x3bc9('0xb')](error[_0x1aab67]);while(arguments[_0x21ab84]){_0x141a4e[_0x3bc9('0xb')](arguments[_0x21ab84]);_0x21ab84++;}_0x518a64=util[_0x3bc9('0xc')]['apply'](util,_0x141a4e);this[_0x3bc9('0xd')]=_0x518a64;this[_0x3bc9('0xe')]=_0x1aab67;}module[_0x3bc9('0xf')]=AGIError; \ No newline at end of file +var _0x5ac6=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','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.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.'];(function(_0x4c3939,_0x51e498){var _0x3005e4=function(_0x34fe5a){while(--_0x34fe5a){_0x4c3939['push'](_0x4c3939['shift']());}};_0x3005e4(++_0x51e498);}(_0x5ac6,0x1b9));var _0x65ac=function(_0x48f601,_0x2ae584){_0x48f601=_0x48f601-0x0;var _0x204a71=_0x5ac6[_0x48f601];return _0x204a71;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x65ac('0x0'),'E_AGI_ARGUMENT_PORT':_0x65ac('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x65ac('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x65ac('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x65ac('0x4'),'E_AGI_SOCKET_ERROR':_0x65ac('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x65ac('0x6'),'E_AGI_COMMAND_EMPTY':_0x65ac('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x65ac('0x8'),'E_AGI_IVR_ENTRY':_0x65ac('0x9')};function AGIError(_0x54d921){var _0x54d921=_0x54d921||null,_0x28b62e=_0x28b62e||[],_0x153de5=0x1,_0x5cf9b9='';if(!error[_0x54d921]){_0x54d921=_0x65ac('0xa');}_0x28b62e['push'](error[_0x54d921]);while(arguments[_0x153de5]){_0x28b62e['push'](arguments[_0x153de5]);_0x153de5++;}_0x5cf9b9=util[_0x65ac('0xb')][_0x65ac('0xc')](util,_0x28b62e);this[_0x65ac('0xd')]=_0x5cf9b9;this[_0x65ac('0xe')]=_0x54d921;}module[_0x65ac('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 56900cb..29fe677 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 _0xea7c=['no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','traverseBFS','includes','max\x20retry\x20reach','agi','getdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','relations'];(function(_0x338951,_0x7bf78e){var _0x54cabe=function(_0x3c70eb){while(--_0x3c70eb){_0x338951['push'](_0x338951['shift']());}};_0x54cabe(++_0x7bf78e);}(_0xea7c,0xe6));var _0xcea7=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xea7c[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0xcea7('0x0'));var verticesWithRetry=['menu',_0xcea7('0x1'),'getsecretdigits'];var Graph=function(){this[_0xcea7('0x2')]={};this[_0xcea7('0x3')]={};this[_0xcea7('0x4')]=0x0;};Graph[_0xcea7('0x5')][_0xcea7('0x6')]=function(_0x9e4db9){this[_0xcea7('0x2')][_0x9e4db9['id']]=_0x9e4db9;this[_0xcea7('0x3')][_0x9e4db9['id']]=[];};Graph[_0xcea7('0x5')]['addEdge']=function(_0x2d32a7,_0x2ab570,_0x286da1){this[_0xcea7('0x3')][_0x2d32a7][_0xcea7('0x7')]({'target':_0x2ab570,'condition':_0x286da1});this['numberOfEdges']+=0x1;};Graph[_0xcea7('0x5')]['size']=function(){return _[_0xcea7('0x8')](this[_0xcea7('0x2')]);};Graph[_0xcea7('0x5')][_0xcea7('0x9')]=function(){return this[_0xcea7('0x4')];};Graph[_0xcea7('0x5')]['getVertex']=function(_0x598ccc){return this[_0xcea7('0x2')][_0x598ccc];};Graph['prototype']['traverseBFS']=function(_0x1e20a5,_0x1b2bf7){if(!this['vertices'][_0x1e20a5]){return logger['info'](_0xcea7('0xa'));}var _0x230e8b=_0x1b2bf7(this[_0xcea7('0x2')][_0x1e20a5]);if(!_0x230e8b){return logger[_0xcea7('0xb')]('stop\x20traverse');}if(this[_0xcea7('0x3')][_0x1e20a5][_0xcea7('0xc')]===0x0){return logger[_0xcea7('0xb')](_0xcea7('0xd'));}for(var _0x4c2741=0x0,_0x6b5f2c=[],_0x57476d=![];_0x4c2741\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','indexOf','agi_','substring','inspect','stringify','info','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup','hangup','sync','production','start','debug','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20published','continueAt'];(function(_0x59943d,_0x2e751b){var _0x46ace9=function(_0xfbd5f2){while(--_0xfbd5f2){_0x59943d['push'](_0x59943d['shift']());}};_0x46ace9(++_0x2e751b);}(_0x04aa,0x171));var _0xa04a=function(_0x499885,_0xceb536){_0x499885=_0x499885-0x0;var _0x40f513=_0x04aa[_0x499885];return _0x40f513;};'use strict';var parser=require('xml2json');var _=require(_0xa04a('0x0'));var syncho=require(_0xa04a('0x1'));var util=require(_0xa04a('0x2'));var moment=require('moment');var config=require(_0xa04a('0x3'));var logger=require(_0xa04a('0x4'))(_0xa04a('0x5'));var utilLicense=require(_0xa04a('0x6'));var rpc=require(_0xa04a('0x7'));var mailRpc=require(_0xa04a('0x8'));var Graph=require(_0xa04a('0x9'));var Vertices=require(_0xa04a('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xa04a('0x5')]=_['defaults'](config['agi'],{'ip':_0xa04a('0xb'),'port':0x11dd});function connectionHandler(_0x474090){process[_0xa04a('0xc')](function(){syncho(function(){try{setChannelVariables(_0x474090);agiHandler(_0x474090);}catch(_0x7fe1e){logger[_0xa04a('0xd')](_0x7fe1e[_0xa04a('0xe')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0xa04a('0xf')]);logger['info'](util[_0xa04a('0x10')](_0xa04a('0x11'),config[_0xa04a('0x5')]['ip'],config[_0xa04a('0x5')][_0xa04a('0xf')]));}function errorHandler(_0x33c65b){if(_0x33c65b&&_0x33c65b[_0xa04a('0x12')]&&_0x33c65b[_0xa04a('0x13')]){logger[_0xa04a('0xd')](util[_0xa04a('0x10')](_0xa04a('0x14'),_0x33c65b['name'],_0x33c65b[_0xa04a('0x13')]));}else{logger[_0xa04a('0xd')](util[_0xa04a('0x10')](_0xa04a('0x15'),_0x33c65b['stack']));}}function closeHandler(){logger['info'](util[_0xa04a('0x10')](_0xa04a('0x16'),this[_0xa04a('0x17')],this[_0xa04a('0x18')],this[_0xa04a('0x19')],this[_0xa04a('0x1a')],this[_0xa04a('0x1b')]));try{createSquareReport(this);}catch(_0xec0c1a){logger[_0xa04a('0xd')](_0xec0c1a[_0xa04a('0xe')]);}}function timeoutHandler(){logger['info'](util[_0xa04a('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa04a('0x17')],this[_0xa04a('0x18')],this[_0xa04a('0x19')],this[_0xa04a('0x1a')],this[_0xa04a('0x1b')]));}function hangupHandler(){logger['info'](util[_0xa04a('0x10')](_0xa04a('0x1c'),this[_0xa04a('0x17')],this[_0xa04a('0x18')],this['callerid'],this[_0xa04a('0x1a')],this[_0xa04a('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x42f5eb){return parser[_0xa04a('0x1d')](_0x42f5eb,{'object':!![]})[_0xa04a('0x1e')][_0xa04a('0x1f')];}function addVertex(_0x251872,_0x414181,_0x28c6b8){_0x414181[_0xa04a('0x20')]=_0x28c6b8;if(_0x414181[_0xa04a('0x21')]('retry')){_0x414181['maxRetry']=parseInt(_0x414181[_0xa04a('0x22')],0xa);}_0x251872[_0xa04a('0x23')](_[_0xa04a('0x24')](_0x414181,_0xa04a('0x25')));}function initGraph(_0x4f22bf,_0x4d63fe){var _0x3ccfa2=new Graph();for(var _0x32f43 in _0x4f22bf){if(_0x4f22bf[_0xa04a('0x21')](_0x32f43)){if(_[_0xa04a('0x26')](_0x4f22bf[_0x32f43])){for(var _0x7187d3=0x0;_0x7187d3<_0x4f22bf[_0x32f43][_0xa04a('0x27')];_0x7187d3+=0x1){addVertex(_0x3ccfa2,_0x4f22bf[_0x32f43][_0x7187d3],_0x32f43);}}else{addVertex(_0x3ccfa2,_0x4f22bf[_0x32f43],_0x32f43);}}}for(var _0x5f119f=0x0;_0x5f119f<_0x4d63fe['length'];_0x5f119f+=0x1){if(_0x4d63fe[_0x5f119f][_0xa04a('0x28')]&&_0x4d63fe[_0x5f119f][_0xa04a('0x29')]){_0x3ccfa2[_0xa04a('0x2a')](_0x4d63fe[_0x5f119f]['source'],_0x4d63fe[_0x5f119f][_0xa04a('0x29')],_0x4d63fe[_0x5f119f][_0xa04a('0x2b')]);}}return _0x3ccfa2;}function getSquareProject(_0x552fea,_0x177a7b){rpc[_0xa04a('0x2c')](_0x552fea)[_0xa04a('0x2d')](function(_0x9fa3b8){_0x177a7b(null,_0x9fa3b8);})[_0xa04a('0x2e')](function(_0x1f3ac5){_0x177a7b(null,_0x1f3ac5);});}function createSquareReport(_0x5e1507,_0x2416d2){rpc['createSquareReport'](_0x5e1507)['then'](function(_0x36c5da){if(_0x2416d2){_0x2416d2(null,_0x36c5da);}})['catch'](function(_0x4db008){if(_0x2416d2){_0x2416d2(null,_0x4db008);}});}function setChannelVariables(_0x8372){for(var _0x49dc04 in _0x8372){if(_0x8372[_0xa04a('0x21')](_0x49dc04)){if(_0x49dc04[_0xa04a('0x2f')](_0xa04a('0x30'))===0x0){_0x8372[_0x49dc04[_0xa04a('0x31')](0x4)]=_0x8372[_0x49dc04];delete _0x8372[_0x49dc04];}}}}function getLogFromObject(_0x2e307c){return util[_0xa04a('0x32')](_0x2e307c,{'showHidden':![],'depth':null});}function agiHandler(_0x544338){var _0xf21315,_0x3a7c93,_0x3c6ed2,_0x133e30,_0x967092;logger['debug']('variables',JSON[_0xa04a('0x33')](_0x544338,null,0x2));logger[_0xa04a('0x34')](util[_0xa04a('0x10')](_0xa04a('0x35'),_0x544338['arg_1'],_0x544338[_0xa04a('0x18')],_0x544338[_0xa04a('0x19')],_0x544338['dnid'],_0x544338[_0xa04a('0x1b')]));_0x544338['on']('error',errorHandler);_0x544338['on']('close',closeHandler);_0x544338['on'](_0xa04a('0x36'),timeoutHandler);_0x544338[_0xa04a('0x37')]=![];_0x544338['on'](_0xa04a('0x38'),hangupHandler);var _0x157f42=getSquareProject[_0xa04a('0x39')](null,_0x544338[_0xa04a('0x17')]);if(_0x157f42){if(_0x157f42[_0xa04a('0x3a')]){_0xf21315=getRoot(_0x157f42[_0xa04a('0x3a')]);if(_0xf21315&&_0xf21315[_0xa04a('0x3b')]){logger[_0xa04a('0x3c')]('root',JSON[_0xa04a('0x33')](_0xf21315,null,0x2));_0x544338['joinAt']=moment()[_0xa04a('0x10')](_0xa04a('0x3d'));_0x3a7c93=initGraph(_[_0xa04a('0x24')](_0xf21315,'mxCell'),_0xf21315[_0xa04a('0x25')]);_0x3c6ed2=new Vertices(_0x544338,rpc,mailRpc);logger[_0xa04a('0x34')](util[_0xa04a('0x10')](_0xa04a('0x3e'),_0x544338[_0xa04a('0x17')],_0x544338[_0xa04a('0x18')],_0x544338[_0xa04a('0x19')],_0x544338[_0xa04a('0x1a')],_0x544338[_0xa04a('0x1b')]));_0x3a7c93[_0xa04a('0x3f')](_0xf21315['start']['id'],function(_0x5ae5ea){try{_0x5ae5ea=_0x3c6ed2[_0xa04a('0x40')](_0x5ae5ea);logger[_0xa04a('0x3c')](_0xa04a('0x41'),JSON[_0xa04a('0x33')](_0x5ae5ea,null,0x2));if(_0x5ae5ea['agicommand']===_0xa04a('0x42')){logger['info'](_0xa04a('0x43'));_0x544338[_0xa04a('0x44')]=_0x5ae5ea[_0xa04a('0x44')]||_0x544338['context'];_0x544338[_0xa04a('0x45')]=_0x5ae5ea[_0xa04a('0x45')];_0x544338[_0xa04a('0x46')]=_0x5ae5ea['priority']?_0x5ae5ea[_0xa04a('0x46')]-0x1:0x1;return null;}else if(_0x5ae5ea&&_0x3c6ed2[_0x5ae5ea[_0xa04a('0x20')]]){_0x967092=_0x3c6ed2[_0x5ae5ea[_0xa04a('0x20')]](_0x5ae5ea);logger['info'](_0xa04a('0x47'),JSON[_0xa04a('0x33')](_0x967092,null,0x2));if(_0x967092&&_0x967092['code']===AGI_CODE_SUCCESS&&_0x967092[_0xa04a('0x48')]!==AGI_RESULT_ERROR&&!_0x544338['evtHangup']){logger[_0xa04a('0x3c')]('response',getLogFromObject(_0x967092));return _[_0xa04a('0x49')](_0x967092['result'])?null:_0x967092['result']['toString']();}else{logger['error'](_0xa04a('0x47'),getLogFromObject(_0x967092));return null;}}else{logger[_0xa04a('0xd')](_0xa04a('0x4a'));return null;}}catch(_0x573b05){logger['error'](_0x573b05[_0xa04a('0xe')]);return null;}});if(_0xf21315[_0xa04a('0x4b')]){logger[_0xa04a('0x34')](util[_0xa04a('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x544338[_0xa04a('0x17')],_0x544338[_0xa04a('0x18')],_0x544338[_0xa04a('0x19')],_0x544338[_0xa04a('0x1a')],_0x544338[_0xa04a('0x1b')]));_0x3a7c93['traverseBFS'](_0xf21315[_0xa04a('0x4b')]['id'],function(_0x4a1a67){try{_0x4a1a67=_0x3c6ed2[_0xa04a('0x40')](_0x4a1a67);logger[_0xa04a('0x3c')](_0xa04a('0x41'),JSON[_0xa04a('0x33')](_0x4a1a67,null,0x2));if(_0x4a1a67&&_0x3c6ed2[_0x4a1a67[_0xa04a('0x20')]]){_0x967092=_0x3c6ed2[_0x4a1a67[_0xa04a('0x20')]](_0x4a1a67);if(_0x967092){logger[_0xa04a('0x3c')](_0xa04a('0x47'),getLogFromObject(_0x967092));return _[_0xa04a('0x49')](_0x967092[_0xa04a('0x48')])?null:_0x967092[_0xa04a('0x48')]['toString']();}else{logger['error'](_0xa04a('0x47'),getLogFromObject(_0x967092));return null;}}else{logger[_0xa04a('0xd')](_0xa04a('0x4a'));return null;}}catch(_0x683a50){logger[_0xa04a('0xd')](_0x683a50[_0xa04a('0xe')]);return null;}});}logger['info'](util['format'](_0xa04a('0x4c'),_0x544338[_0xa04a('0x17')],_0x544338['calleridname'],_0x544338[_0xa04a('0x19')],_0x544338[_0xa04a('0x1a')],_0x544338[_0xa04a('0x1b')]));logger['info'](util[_0xa04a('0x10')](_0xa04a('0x4d'),_0x544338[_0xa04a('0x44')],_0x544338[_0xa04a('0x45')],parseInt(_0x544338[_0xa04a('0x46')],0xa)+0x1));_0x544338['continueAt'](_0x544338[_0xa04a('0x44')],_0x544338['extension'],parseInt(_0x544338['priority'],0xa)+0x1);_0x544338[_0xa04a('0x4e')]();}}else{logger['error'](util[_0xa04a('0x10')](_0xa04a('0x4f'),_0x544338[_0xa04a('0x17')]));_0x544338[_0xa04a('0x50')](_0x544338['context'],_0x544338[_0xa04a('0x45')],parseInt(_0x544338[_0xa04a('0x46')],0xa)+0x1);_0x544338[_0xa04a('0x4e')]();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20found',_0x544338[_0xa04a('0x17')]));_0x544338[_0xa04a('0x50')](_0x544338['context'],_0x544338['extension'],parseInt(_0x544338[_0xa04a('0x46')],0xa)+0x1);_0x544338['close']();}}function main(){var _0x2d83b9;return utilLicense[_0xa04a('0x51')]()[_0xa04a('0x2d')](function(_0x1f7ac4){if(_0x1f7ac4){if(_0x1f7ac4['voice']){if(_0x1f7ac4['callysquare']&&_0x1f7ac4[_0xa04a('0x52')]>0x0){logger[_0xa04a('0x34')](util[_0xa04a('0x10')](_0xa04a('0x53'),_0x1f7ac4['callysquare']));_0x2d83b9=_0x1f7ac4['callysquare'];}else{logger[_0xa04a('0x34')](_0xa04a('0x54'));}}else{logger[_0xa04a('0x34')](_0xa04a('0x55'));_0x2d83b9=-0x1;}}})['catch'](function(_0x33e7e1){logger[_0xa04a('0xd')](_0xa04a('0x56'),_0x33e7e1[_0xa04a('0xe')]);})[_0xa04a('0x4b')](function(){var _0x4895cd=require(_0xa04a('0x57'))(config[_0xa04a('0x5')][_0xa04a('0xf')],config[_0xa04a('0x5')]['ip'],_0x2d83b9);_0x4895cd['on'](_0xa04a('0xd'),errorHandler);_0x4895cd['on'](_0xa04a('0x58'),listeningHandler);_0x4895cd['on'](_0xa04a('0x59'),connectionHandler);_0x4895cd['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xf257=['[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','agicommand','hasOwnProperty','omit','isArray','length','source','value','then','catch','createSquareReport','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','port','listening','connection','xml2json','syncho','util','moment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./vertices','agi','defaults','127.0.0.1','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','name','[%s]\x20%s','message','[ERROR]\x20%s'];(function(_0x2c44c5,_0x1e2f75){var _0x221f9c=function(_0x41a28c){while(--_0x41a28c){_0x2c44c5['push'](_0x2c44c5['shift']());}};_0x221f9c(++_0x1e2f75);}(_0xf257,0x19f));var _0x7f25=function(_0xefb4e,_0xe56689){_0xefb4e=_0xefb4e-0x0;var _0x36c78c=_0xf257[_0xefb4e];return _0x36c78c;};'use strict';var parser=require(_0x7f25('0x0'));var _=require('lodash');var syncho=require(_0x7f25('0x1'));var util=require(_0x7f25('0x2'));var moment=require(_0x7f25('0x3'));var config=require('../../config/environment');var logger=require(_0x7f25('0x4'))('agi');var utilLicense=require(_0x7f25('0x5'));var rpc=require(_0x7f25('0x6'));var mailRpc=require(_0x7f25('0x7'));var Graph=require('./graph');var Vertices=require(_0x7f25('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7f25('0x9')]=_[_0x7f25('0xa')](config['agi'],{'ip':_0x7f25('0xb'),'port':0x11dd});function connectionHandler(_0x4b35ee){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4b35ee);agiHandler(_0x4b35ee);}catch(_0x101d48){logger[_0x7f25('0xc')](_0x101d48[_0x7f25('0xd')]);}});});}function listeningHandler(){console['log'](_0x7f25('0xe'),config[_0x7f25('0x9')]['port']);logger['info'](util[_0x7f25('0xf')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x7f25('0x9')]['ip'],config[_0x7f25('0x9')]['port']));}function errorHandler(_0x36b646){if(_0x36b646&&_0x36b646[_0x7f25('0x10')]&&_0x36b646['message']){logger[_0x7f25('0xc')](util['format'](_0x7f25('0x11'),_0x36b646[_0x7f25('0x10')],_0x36b646[_0x7f25('0x12')]));}else{logger[_0x7f25('0xc')](util[_0x7f25('0xf')](_0x7f25('0x13'),_0x36b646[_0x7f25('0xd')]));}}function closeHandler(){logger['info'](util[_0x7f25('0xf')](_0x7f25('0x14'),this[_0x7f25('0x15')],this['calleridname'],this['callerid'],this[_0x7f25('0x16')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1a6a67){logger[_0x7f25('0xc')](_0x1a6a67[_0x7f25('0xd')]);}}function timeoutHandler(){logger[_0x7f25('0x17')](util[_0x7f25('0xf')](_0x7f25('0x18'),this[_0x7f25('0x15')],this[_0x7f25('0x19')],this[_0x7f25('0x1a')],this[_0x7f25('0x16')],this[_0x7f25('0x1b')]));}function hangupHandler(){logger[_0x7f25('0x17')](util[_0x7f25('0xf')](_0x7f25('0x1c'),this['arg_1'],this['calleridname'],this[_0x7f25('0x1a')],this['dnid'],this[_0x7f25('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x2bcfa8){return parser[_0x7f25('0x1d')](_0x2bcfa8,{'object':!![]})['mxGraphModel'][_0x7f25('0x1e')];}function addVertex(_0x3c0eaf,_0x24774f,_0x3422ba){_0x24774f[_0x7f25('0x1f')]=_0x3422ba;if(_0x24774f[_0x7f25('0x20')]('retry')){_0x24774f['maxRetry']=parseInt(_0x24774f['retry'],0xa);}_0x3c0eaf['addVertex'](_[_0x7f25('0x21')](_0x24774f,'mxCell'));}function initGraph(_0xce7871,_0x36c80f){var _0x3da106=new Graph();for(var _0x256382 in _0xce7871){if(_0xce7871['hasOwnProperty'](_0x256382)){if(_[_0x7f25('0x22')](_0xce7871[_0x256382])){for(var _0x55733d=0x0;_0x55733d<_0xce7871[_0x256382]['length'];_0x55733d+=0x1){addVertex(_0x3da106,_0xce7871[_0x256382][_0x55733d],_0x256382);}}else{addVertex(_0x3da106,_0xce7871[_0x256382],_0x256382);}}}for(var _0x1c9506=0x0;_0x1c9506<_0x36c80f[_0x7f25('0x23')];_0x1c9506+=0x1){if(_0x36c80f[_0x1c9506][_0x7f25('0x24')]&&_0x36c80f[_0x1c9506]['target']){_0x3da106['addEdge'](_0x36c80f[_0x1c9506][_0x7f25('0x24')],_0x36c80f[_0x1c9506]['target'],_0x36c80f[_0x1c9506][_0x7f25('0x25')]);}}return _0x3da106;}function getSquareProject(_0x5286e7,_0x5decd8){rpc['getSquareProject'](_0x5286e7)[_0x7f25('0x26')](function(_0x51def8){_0x5decd8(null,_0x51def8);})[_0x7f25('0x27')](function(_0x465841){_0x5decd8(null,_0x465841);});}function createSquareReport(_0x3b0505,_0x5dd8e5){rpc[_0x7f25('0x28')](_0x3b0505)['then'](function(_0x4b8105){if(_0x5dd8e5){_0x5dd8e5(null,_0x4b8105);}})[_0x7f25('0x27')](function(_0x25b50b){if(_0x5dd8e5){_0x5dd8e5(null,_0x25b50b);}});}function setChannelVariables(_0x4a734a){for(var _0x7d9eb7 in _0x4a734a){if(_0x4a734a[_0x7f25('0x20')](_0x7d9eb7)){if(_0x7d9eb7[_0x7f25('0x29')](_0x7f25('0x2a'))===0x0){_0x4a734a[_0x7d9eb7[_0x7f25('0x2b')](0x4)]=_0x4a734a[_0x7d9eb7];delete _0x4a734a[_0x7d9eb7];}}}}function getLogFromObject(_0x4ee70f){return util['inspect'](_0x4ee70f,{'showHidden':![],'depth':null});}function agiHandler(_0x91c0b3){var _0x476f04,_0x4a1b3c,_0x55ecfb,_0x44817e,_0x313490;logger[_0x7f25('0x2c')](_0x7f25('0x2d'),JSON[_0x7f25('0x2e')](_0x91c0b3,null,0x2));logger['info'](util['format'](_0x7f25('0x2f'),_0x91c0b3[_0x7f25('0x15')],_0x91c0b3[_0x7f25('0x19')],_0x91c0b3[_0x7f25('0x1a')],_0x91c0b3[_0x7f25('0x16')],_0x91c0b3[_0x7f25('0x1b')]));_0x91c0b3['on'](_0x7f25('0xc'),errorHandler);_0x91c0b3['on'](_0x7f25('0x30'),closeHandler);_0x91c0b3['on'](_0x7f25('0x31'),timeoutHandler);_0x91c0b3['evtHangup']=![];_0x91c0b3['on']('hangup',hangupHandler);var _0x886083=getSquareProject[_0x7f25('0x32')](null,_0x91c0b3[_0x7f25('0x15')]);if(_0x886083){if(_0x886083[_0x7f25('0x33')]){_0x476f04=getRoot(_0x886083[_0x7f25('0x33')]);if(_0x476f04&&_0x476f04[_0x7f25('0x34')]){logger['debug']('root',JSON[_0x7f25('0x2e')](_0x476f04,null,0x2));_0x91c0b3[_0x7f25('0x35')]=moment()['format'](_0x7f25('0x36'));_0x4a1b3c=initGraph(_[_0x7f25('0x21')](_0x476f04,_0x7f25('0x37')),_0x476f04[_0x7f25('0x37')]);_0x55ecfb=new Vertices(_0x91c0b3,rpc,mailRpc);logger[_0x7f25('0x17')](util['format'](_0x7f25('0x38'),_0x91c0b3[_0x7f25('0x15')],_0x91c0b3['calleridname'],_0x91c0b3[_0x7f25('0x1a')],_0x91c0b3[_0x7f25('0x16')],_0x91c0b3[_0x7f25('0x1b')]));_0x4a1b3c['traverseBFS'](_0x476f04[_0x7f25('0x34')]['id'],function(_0x416dd9){try{_0x416dd9=_0x55ecfb[_0x7f25('0x39')](_0x416dd9);logger['debug']('vertex',JSON[_0x7f25('0x2e')](_0x416dd9,null,0x2));if(_0x416dd9['agicommand']===_0x7f25('0x3a')){logger[_0x7f25('0x17')](_0x7f25('0x3b'));_0x91c0b3[_0x7f25('0x3c')]=_0x416dd9[_0x7f25('0x3c')]||_0x91c0b3['context'];_0x91c0b3['extension']=_0x416dd9[_0x7f25('0x3d')];_0x91c0b3[_0x7f25('0x3e')]=_0x416dd9[_0x7f25('0x3e')]?_0x416dd9[_0x7f25('0x3e')]-0x1:0x1;return null;}else if(_0x416dd9&&_0x55ecfb[_0x416dd9[_0x7f25('0x1f')]]){_0x313490=_0x55ecfb[_0x416dd9[_0x7f25('0x1f')]](_0x416dd9);logger[_0x7f25('0x17')](_0x7f25('0x3f'),JSON[_0x7f25('0x2e')](_0x313490,null,0x2));if(_0x313490&&_0x313490[_0x7f25('0x40')]===AGI_CODE_SUCCESS&&_0x313490[_0x7f25('0x41')]!==AGI_RESULT_ERROR&&!_0x91c0b3[_0x7f25('0x42')]){logger[_0x7f25('0x2c')](_0x7f25('0x3f'),getLogFromObject(_0x313490));return _[_0x7f25('0x43')](_0x313490['result'])?null:_0x313490[_0x7f25('0x41')]['toString']();}else{logger[_0x7f25('0xc')](_0x7f25('0x3f'),getLogFromObject(_0x313490));return null;}}else{logger[_0x7f25('0xc')](_0x7f25('0x44'));return null;}}catch(_0x233e53){logger[_0x7f25('0xc')](_0x233e53[_0x7f25('0xd')]);return null;}});if(_0x476f04['finally']){logger[_0x7f25('0x17')](util['format'](_0x7f25('0x45'),_0x91c0b3[_0x7f25('0x15')],_0x91c0b3[_0x7f25('0x19')],_0x91c0b3[_0x7f25('0x1a')],_0x91c0b3[_0x7f25('0x16')],_0x91c0b3[_0x7f25('0x1b')]));_0x4a1b3c[_0x7f25('0x46')](_0x476f04['finally']['id'],function(_0x45ede9){try{_0x45ede9=_0x55ecfb[_0x7f25('0x39')](_0x45ede9);logger[_0x7f25('0x2c')](_0x7f25('0x47'),JSON[_0x7f25('0x2e')](_0x45ede9,null,0x2));if(_0x45ede9&&_0x55ecfb[_0x45ede9[_0x7f25('0x1f')]]){_0x313490=_0x55ecfb[_0x45ede9['agicommand']](_0x45ede9);if(_0x313490){logger[_0x7f25('0x2c')](_0x7f25('0x3f'),getLogFromObject(_0x313490));return _[_0x7f25('0x43')](_0x313490['result'])?null:_0x313490[_0x7f25('0x41')][_0x7f25('0x48')]();}else{logger['error'](_0x7f25('0x3f'),getLogFromObject(_0x313490));return null;}}else{logger[_0x7f25('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x3b6356){logger[_0x7f25('0xc')](_0x3b6356[_0x7f25('0xd')]);return null;}});}logger[_0x7f25('0x17')](util[_0x7f25('0xf')](_0x7f25('0x49'),_0x91c0b3[_0x7f25('0x15')],_0x91c0b3[_0x7f25('0x19')],_0x91c0b3[_0x7f25('0x1a')],_0x91c0b3[_0x7f25('0x16')],_0x91c0b3[_0x7f25('0x1b')]));logger['info'](util[_0x7f25('0xf')](_0x7f25('0x4a'),_0x91c0b3['context'],_0x91c0b3[_0x7f25('0x3d')],parseInt(_0x91c0b3[_0x7f25('0x3e')],0xa)+0x1));_0x91c0b3['continueAt'](_0x91c0b3[_0x7f25('0x3c')],_0x91c0b3['extension'],parseInt(_0x91c0b3['priority'],0xa)+0x1);_0x91c0b3[_0x7f25('0x30')]();}}else{logger[_0x7f25('0xc')](util[_0x7f25('0xf')](_0x7f25('0x4b'),_0x91c0b3[_0x7f25('0x15')]));_0x91c0b3[_0x7f25('0x4c')](_0x91c0b3[_0x7f25('0x3c')],_0x91c0b3[_0x7f25('0x3d')],parseInt(_0x91c0b3[_0x7f25('0x3e')],0xa)+0x1);_0x91c0b3['close']();}}else{logger[_0x7f25('0xc')](util[_0x7f25('0xf')](_0x7f25('0x4d'),_0x91c0b3[_0x7f25('0x15')]));_0x91c0b3['continueAt'](_0x91c0b3['context'],_0x91c0b3['extension'],parseInt(_0x91c0b3[_0x7f25('0x3e')],0xa)+0x1);_0x91c0b3[_0x7f25('0x30')]();}}function main(){var _0x22ad1a;return utilLicense['getLicense']()['then'](function(_0xdfdc15){if(_0xdfdc15){if(_0xdfdc15[_0x7f25('0x4e')]){if(_0xdfdc15[_0x7f25('0x4f')]&&_0xdfdc15[_0x7f25('0x4f')]>0x0){logger[_0x7f25('0x17')](util[_0x7f25('0xf')](_0x7f25('0x50'),_0xdfdc15[_0x7f25('0x4f')]));_0x22ad1a=_0xdfdc15['callysquare'];}else{logger['info'](_0x7f25('0x51'));}}else{logger[_0x7f25('0x17')](_0x7f25('0x52'));_0x22ad1a=-0x1;}}})[_0x7f25('0x27')](function(_0x49ea87){logger['error']('[LICENSE]',_0x49ea87['stack']);})[_0x7f25('0x53')](function(){var _0x90c8e8=require('./server')(config['agi'][_0x7f25('0x54')],config[_0x7f25('0x9')]['ip'],_0x22ad1a);_0x90c8e8['on'](_0x7f25('0xc'),errorHandler);_0x90c8e8['on'](_0x7f25('0x55'),listeningHandler);_0x90c8e8['on'](_0x7f25('0x56'),connectionHandler);_0x90c8e8['on'](_0x7f25('0x30'),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 cff5139..2aece2e 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 _0x8079=['error','catch','sendMailMessage','SendMail','jayson/promise','client','then'];(function(_0x1c4b8d,_0x146a41){var _0x203346=function(_0x541d4d){while(--_0x541d4d){_0x1c4b8d['push'](_0x1c4b8d['shift']());}};_0x203346(++_0x146a41);}(_0x8079,0x10e));var _0x9807=function(_0x1feb65,_0x59d59b){_0x1feb65=_0x1feb65-0x0;var _0xb2dbb3=_0x8079[_0x1feb65];return _0xb2dbb3;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x9807('0x0'));var client=jayson[_0x9807('0x1')]['http']({'port':0x232b});function request(_0x1cd08d,_0x2367d3){return new BPromise(function(_0xbbdb88,_0x586d09){return client['request'](_0x1cd08d,_0x2367d3)[_0x9807('0x2')](function(_0x79a6fb){if(_0x79a6fb[_0x9807('0x3')]){return _0x586d09(_0x79a6fb[_0x9807('0x3')]['message']);}else{return _0xbbdb88(_0x79a6fb['result']);}})[_0x9807('0x4')](function(_0x92d4f2){return _0x586d09(_0x92d4f2);});});}exports[_0x9807('0x5')]=function(_0x5163a9,_0x78f044){return request(_0x9807('0x6'),{'account':_0x5163a9,'message':_0x78f044});}; \ No newline at end of file +var _0xcd0b=['http','then','error','message','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcd0b,0x14a));var _0xbcd0=function(_0x36d079,_0x52bbeb){_0x36d079=_0x36d079-0x0;var _0x351772=_0xcd0b[_0x36d079];return _0x351772;};'use strict';var BPromise=require(_0xbcd0('0x0'));var jayson=require(_0xbcd0('0x1'));var client=jayson[_0xbcd0('0x2')][_0xbcd0('0x3')]({'port':0x232b});function request(_0x3602f1,_0x5c3914){return new BPromise(function(_0x4ad30e,_0x429e17){return client['request'](_0x3602f1,_0x5c3914)[_0xbcd0('0x4')](function(_0x372067){if(_0x372067[_0xbcd0('0x5')]){return _0x429e17(_0x372067[_0xbcd0('0x5')][_0xbcd0('0x6')]);}else{return _0x4ad30e(_0x372067['result']);}})['catch'](function(_0xf0335f){return _0x429e17(_0xf0335f);});});}exports[_0xbcd0('0x7')]=function(_0x1ae5b1,_0x310062){return request(_0xbcd0('0x8'),{'account':_0x1ae5b1,'message':_0x310062});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index adf53f4..43b4444 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 _0xf948=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','trim','headers','emit','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype'];(function(_0x2c002e,_0x59f77a){var _0x2b666f=function(_0x4dc718){while(--_0x4dc718){_0x2c002e['push'](_0x2c002e['shift']());}};_0x2b666f(++_0x59f77a);}(_0xf948,0x79));var _0x8f94=function(_0x13f2d6,_0x1cbf18){_0x13f2d6=_0x13f2d6-0x0;var _0x4a8b4f=_0xf948[_0x13f2d6];return _0x4a8b4f;};'use strict';var util=require(_0x8f94('0x0'));var Transform=require(_0x8f94('0x1'))[_0x8f94('0x2')];function AGIReply(_0x3f1ac0){Transform['call'](this,_0x3f1ac0);this[_0x8f94('0x3')]='';this[_0x8f94('0x4')]=![];}util[_0x8f94('0x5')](AGIReply,Transform);AGIReply[_0x8f94('0x6')]['_transform']=function(_0x396942,_0x39aaa8,_0x85cf13){var _0x2a89b5='\x0a',_0x4fee5f=['\x0a\x0a',_0x8f94('0x7')],_0x399260=-0x1,_0x42d2a9=-0x1,_0x581d3d='',_0x284141=0x0,_0x292aa6='',_0x471fb9='';this[_0x8f94('0x3')]+=_0x396942[_0x8f94('0x8')]();_0x292aa6=this[_0x8f94('0x3')];if(!this['_inBody']){_0x284141=0x0;while(_0x4fee5f[_0x284141]){while((_0x42d2a9=_0x292aa6[_0x8f94('0x9')](_0x4fee5f[_0x284141]))!=-0x1){_0x581d3d=_0x4fee5f[_0x284141];_0x471fb9=_0x292aa6[_0x8f94('0xa')](0x0,_0x42d2a9);_0x292aa6=_0x292aa6[_0x8f94('0xa')](_0x42d2a9+_0x581d3d[_0x8f94('0xb')]);var _0x361d01=_0x471fb9['split'](_0x2a89b5),_0x4f8050=0x0,_0x2cc185={},_0x438f51='',_0x2a61a5='',_0x351d76=-0x1;while(_0x361d01[_0x4f8050]){_0x351d76=_0x361d01[_0x4f8050]['indexOf'](':');if(_0x351d76!=-0x1){_0x438f51=_0x361d01[_0x4f8050]['slice'](0x0,_0x351d76)[_0x8f94('0xc')]();_0x2a61a5=_0x361d01[_0x4f8050]['slice'](_0x351d76+0x1)['trim']();if(_0x438f51[_0x8f94('0xb')]>0x0){_0x2cc185[_0x438f51]=_0x2a61a5;}}else{}_0x4f8050++;}this['emit'](_0x8f94('0xd'),_0x2cc185);this[_0x8f94('0x4')]=!![];}_0x284141++;}this[_0x8f94('0x3')]=_0x292aa6;}else{while((_0x399260=_0x292aa6[_0x8f94('0x9')](_0x2a89b5))!=-0x1){_0x471fb9=_0x292aa6['substring'](0x0,_0x399260);this[_0x8f94('0xe')]('line',_0x471fb9);_0x292aa6=_0x292aa6[_0x8f94('0xa')](_0x399260+_0x2a89b5['length']);}this[_0x8f94('0x3')]=_0x292aa6;}_0x85cf13();};module[_0x8f94('0xf')]=AGIReply; \ No newline at end of file +var _0x167a=['toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','Transform','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer'];(function(_0x414a4e,_0x181824){var _0x13025f=function(_0x395d93){while(--_0x395d93){_0x414a4e['push'](_0x414a4e['shift']());}};_0x13025f(++_0x181824);}(_0x167a,0x187));var _0xa167=function(_0x173a09,_0x51a65e){_0x173a09=_0x173a09-0x0;var _0x2b86b3=_0x167a[_0x173a09];return _0x2b86b3;};'use strict';var util=require(_0xa167('0x0'));var Transform=require(_0xa167('0x1'))[_0xa167('0x2')];function AGIReply(_0x2de412){Transform[_0xa167('0x3')](this,_0x2de412);this['_localBuffer']='';this[_0xa167('0x4')]=![];}util[_0xa167('0x5')](AGIReply,Transform);AGIReply[_0xa167('0x6')]['_transform']=function(_0x123537,_0x42130d,_0x592215){var _0x118ece='\x0a',_0x34e817=['\x0a\x0a',_0xa167('0x7')],_0x159eb7=-0x1,_0x5e702f=-0x1,_0x20304b='',_0x5dfbff=0x0,_0x4af7fc='',_0x4820e='';this[_0xa167('0x8')]+=_0x123537[_0xa167('0x9')]();_0x4af7fc=this['_localBuffer'];if(!this[_0xa167('0x4')]){_0x5dfbff=0x0;while(_0x34e817[_0x5dfbff]){while((_0x5e702f=_0x4af7fc[_0xa167('0xa')](_0x34e817[_0x5dfbff]))!=-0x1){_0x20304b=_0x34e817[_0x5dfbff];_0x4820e=_0x4af7fc[_0xa167('0xb')](0x0,_0x5e702f);_0x4af7fc=_0x4af7fc['substring'](_0x5e702f+_0x20304b[_0xa167('0xc')]);var _0x5dcdfa=_0x4820e[_0xa167('0xd')](_0x118ece),_0x2368f2=0x0,_0x57a868={},_0x2e346c='',_0x325911='',_0x40fd87=-0x1;while(_0x5dcdfa[_0x2368f2]){_0x40fd87=_0x5dcdfa[_0x2368f2][_0xa167('0xa')](':');if(_0x40fd87!=-0x1){_0x2e346c=_0x5dcdfa[_0x2368f2][_0xa167('0xe')](0x0,_0x40fd87)['trim']();_0x325911=_0x5dcdfa[_0x2368f2][_0xa167('0xe')](_0x40fd87+0x1)[_0xa167('0xf')]();if(_0x2e346c[_0xa167('0xc')]>0x0){_0x57a868[_0x2e346c]=_0x325911;}}else{}_0x2368f2++;}this[_0xa167('0x10')](_0xa167('0x11'),_0x57a868);this[_0xa167('0x4')]=!![];}_0x5dfbff++;}this[_0xa167('0x8')]=_0x4af7fc;}else{while((_0x159eb7=_0x4af7fc[_0xa167('0xa')](_0x118ece))!=-0x1){_0x4820e=_0x4af7fc[_0xa167('0xb')](0x0,_0x159eb7);this[_0xa167('0x10')](_0xa167('0x12'),_0x4820e);_0x4af7fc=_0x4af7fc[_0xa167('0xb')](_0x159eb7+_0x118ece[_0xa167('0xc')]);}this[_0xa167('0x8')]=_0x4af7fc;}_0x592215();};module[_0xa167('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 2c9f017..1a36a1e 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 _0x255b=['CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','client','http','request','then','error','message','result','catch','ShowSquareProject','production','ShowMailAccount','MailServerOut','email','getSquareProjectById','name','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage'];(function(_0x1c4305,_0x5b3288){var _0x3e4329=function(_0x5dece2){while(--_0x5dece2){_0x1c4305['push'](_0x1c4305['shift']());}};_0x3e4329(++_0x5b3288);}(_0x255b,0x16d));var _0xb255=function(_0x3ae803,_0x2fe947){_0x3ae803=_0x3ae803-0x0;var _0x5a687e=_0x255b[_0x3ae803];return _0x5a687e;};'use strict';var BPromise=require(_0xb255('0x0'));var moment=require(_0xb255('0x1'));var _=require(_0xb255('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0xb255('0x3')][_0xb255('0x4')]({'port':0x2329});function request(_0x5c8553,_0x227ec9){return new BPromise(function(_0x3be541,_0x5cea22){return client[_0xb255('0x5')](_0x5c8553,_0x227ec9)[_0xb255('0x6')](function(_0x4585b9){if(_0x4585b9[_0xb255('0x7')]){return _0x5cea22(_0x4585b9['error'][_0xb255('0x8')]);}else{return _0x3be541(_0x4585b9[_0xb255('0x9')]);}})[_0xb255('0xa')](function(_0x546b0d){return _0x5cea22(_0x546b0d);});});}exports['getSquareProject']=function(_0xd39f93){return request(_0xb255('0xb'),{'options':{'raw':![],'where':{'name':_0xd39f93},'attributes':[_0xb255('0xc')]}});};exports['getMailAccountById']=function(_0x554721){return request(_0xb255('0xd'),{'options':{'raw':![],'where':{'id':_0x554721},'include':[{'model':_0xb255('0xe'),'as':'Smtp'}],'attributes':['id','name',_0xb255('0xf')]}});};exports[_0xb255('0x10')]=function(_0x3e741d){return request(_0xb255('0xb'),{'options':{'where':{'id':_0x3e741d},'attributes':[_0xb255('0x11')]}});};exports['getVoiceQueueById']=function(_0x5d60a4){return request(_0xb255('0x12'),{'options':{'where':{'id':_0x5d60a4},'attributes':[_0xb255('0x11')]}});};exports[_0xb255('0x13')]=function(_0x39b785){return request('ShowVariable',{'options':{'where':{'id':_0x39b785},'attributes':[_0xb255('0x11')]}});};exports[_0xb255('0x14')]=function(_0x34c3d4){return request(_0xb255('0x15'),{'options':{'where':{'id':_0x34c3d4},'attributes':[_0xb255('0x16')]}});};exports[_0xb255('0x17')]=function(_0x3eab20){return request(_0xb255('0x18'),{'options':{'where':{'id':_0x3eab20},'attributes':[_0xb255('0x11')]}});};exports[_0xb255('0x19')]=function(_0x6777d9){return request(_0xb255('0x1a'),{'options':{'where':{'id':_0x6777d9},'attributes':['name']}});};exports['getSoundById']=function(_0x1c7f1a){return request(_0xb255('0x1b'),{'options':{'where':{'id':_0x1c7f1a},'attributes':['save_name']}});};exports[_0xb255('0x1c')]=function(_0x43a505){return request(_0xb255('0x1d'),{'options':{'raw':![],'where':{'id':_0x43a505},'include':[{'model':'Interval','as':_0xb255('0x1e')}]}});};exports[_0xb255('0x1f')]=function(_0x118e60){return request(_0xb255('0x20'),{'options':{'where':{'id':_0x118e60},'attributes':['id','name']}});};exports[_0xb255('0x21')]=function(_0x5a41a7){return request('CreateSmsMessage',{'body':_0x5a41a7});};exports['createSquareDetailsReport']=function(_0x36d892){return request(_0xb255('0x22'),{'body':_0x36d892});};exports[_0xb255('0x23')]=function(_0x2a94f0){return request(_0xb255('0x24'),{'body':_[_0xb255('0x25')](_0x2a94f0,{'project_name':_0x2a94f0[_0xb255('0x26')],'prev_project_name':_0x2a94f0[_0xb255('0x27')]||'','is_subproject':_0x2a94f0[_0xb255('0x27')]?!![]:![],'leaveAt':moment()[_0xb255('0x28')](_0xb255('0x29'))})});};exports[_0xb255('0x2a')]=function(_0x5af404){return request('CreateSquareRecording',{'body':_0x5af404});};exports[_0xb255('0x2b')]=function(_0x5dc8a3){return request(_0xb255('0x2c'),{'body':_0x5dc8a3});};exports['createCmContact']=function(_0x4f35b3){return request(_0xb255('0x2d'),{'options':{'raw':![],'where':{'phone':_0x4f35b3[_0xb255('0x2e')],'ListId':_0x4f35b3['ListId']}}})[_0xb255('0x6')](function(_0x5010e2){if(_0x5010e2){return _0x5010e2;}return request(_0xb255('0x2f'),{'body':_0x4f35b3});});};exports[_0xb255('0x30')]=function(_0x11c5f2){return request(_0xb255('0x31'),{'options':{'where':{'id':_0x11c5f2},'attributes':[_0xb255('0x11')]}});};exports[_0xb255('0x32')]=function(_0x53c51d,_0xebef7a){return request(_0xb255('0x33'),{'body':{'interface':_0xebef7a},'options':{'where':_0x53c51d}});};exports['agentPause']=function(_0x3d7e53,_0x7cdd0a,_0x4a5c0b){return request(_0xb255('0x34'),{'body':{'type':_0x7cdd0a,'uniqueid':_0x4a5c0b},'options':{'where':_0x3d7e53}});};exports[_0xb255('0x35')]=function(_0x3198a9){return request(_0xb255('0x36'),{'body':{},'options':{'where':_0x3198a9}});};exports[_0xb255('0x37')]=function(_0x3483b6){return request(_0xb255('0x38'),{'body':{},'options':{'where':_0x3483b6}});}; \ No newline at end of file +var _0x06d8=['then','error','message','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','bluebird','lodash','util','jayson/promise','client','http'];(function(_0x443dca,_0x520dcb){var _0xf32ba9=function(_0x313c01){while(--_0x313c01){_0x443dca['push'](_0x443dca['shift']());}};_0xf32ba9(++_0x520dcb);}(_0x06d8,0x9c));var _0x806d=function(_0x455699,_0x30b319){_0x455699=_0x455699-0x0;var _0x121348=_0x06d8[_0x455699];return _0x121348;};'use strict';var BPromise=require(_0x806d('0x0'));var moment=require('moment');var _=require(_0x806d('0x1'));var util=require(_0x806d('0x2'));var jayson=require(_0x806d('0x3'));var client=jayson[_0x806d('0x4')][_0x806d('0x5')]({'port':0x2329});function request(_0x58234a,_0x3d0672){return new BPromise(function(_0x4ac970,_0x2011bc){return client['request'](_0x58234a,_0x3d0672)[_0x806d('0x6')](function(_0x1d495a){if(_0x1d495a[_0x806d('0x7')]){return _0x2011bc(_0x1d495a[_0x806d('0x7')][_0x806d('0x8')]);}else{return _0x4ac970(_0x1d495a['result']);}})[_0x806d('0x9')](function(_0x44b9d7){return _0x2011bc(_0x44b9d7);});});}exports['getSquareProject']=function(_0x457cdf){return request(_0x806d('0xa'),{'options':{'raw':![],'where':{'name':_0x457cdf},'attributes':[_0x806d('0xb')]}});};exports[_0x806d('0xc')]=function(_0x4b8ad3){return request(_0x806d('0xd'),{'options':{'raw':![],'where':{'id':_0x4b8ad3},'include':[{'model':'MailServerOut','as':_0x806d('0xe')}],'attributes':['id',_0x806d('0xf'),'email']}});};exports[_0x806d('0x10')]=function(_0x490cd8){return request(_0x806d('0xa'),{'options':{'where':{'id':_0x490cd8},'attributes':[_0x806d('0xf')]}});};exports[_0x806d('0x11')]=function(_0x83cc0b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x83cc0b},'attributes':[_0x806d('0xf')]}});};exports['getVariableById']=function(_0x15e5e1){return request('ShowVariable',{'options':{'where':{'id':_0x15e5e1},'attributes':[_0x806d('0xf')]}});};exports['getSquareOdbcById']=function(_0x472076){return request(_0x806d('0x12'),{'options':{'where':{'id':_0x472076},'attributes':[_0x806d('0x13')]}});};exports['getUserById']=function(_0x58da3c){return request('ShowUser',{'options':{'where':{'id':_0x58da3c},'attributes':[_0x806d('0xf')]}});};exports[_0x806d('0x14')]=function(_0x161911){return request(_0x806d('0x15'),{'options':{'where':{'id':_0x161911},'attributes':[_0x806d('0xf')]}});};exports[_0x806d('0x16')]=function(_0x2e7d7e){return request(_0x806d('0x17'),{'options':{'where':{'id':_0x2e7d7e},'attributes':['save_name']}});};exports[_0x806d('0x18')]=function(_0x312fd4){return request(_0x806d('0x19'),{'options':{'raw':![],'where':{'id':_0x312fd4},'include':[{'model':_0x806d('0x1a'),'as':_0x806d('0x1b')}]}});};exports[_0x806d('0x1c')]=function(_0x17a8bb){return request(_0x806d('0x1d'),{'options':{'where':{'id':_0x17a8bb},'attributes':['id',_0x806d('0xf')]}});};exports[_0x806d('0x1e')]=function(_0x457901){return request(_0x806d('0x1f'),{'body':_0x457901});};exports[_0x806d('0x20')]=function(_0x445929){return request(_0x806d('0x21'),{'body':_0x445929});};exports[_0x806d('0x22')]=function(_0x138ee0){return request(_0x806d('0x23'),{'body':_['merge'](_0x138ee0,{'project_name':_0x138ee0[_0x806d('0x24')],'prev_project_name':_0x138ee0['arg_2']||'','is_subproject':_0x138ee0[_0x806d('0x25')]?!![]:![],'leaveAt':moment()[_0x806d('0x26')](_0x806d('0x27'))})});};exports[_0x806d('0x28')]=function(_0x5062f6){return request(_0x806d('0x29'),{'body':_0x5062f6});};exports[_0x806d('0x2a')]=function(_0x52c2cf){return request(_0x806d('0x2b'),{'body':_0x52c2cf});};exports[_0x806d('0x2c')]=function(_0x1f508e){return request(_0x806d('0x2d'),{'options':{'raw':![],'where':{'phone':_0x1f508e['phone'],'ListId':_0x1f508e[_0x806d('0x2e')]}}})[_0x806d('0x6')](function(_0x44c318){if(_0x44c318){return _0x44c318;}return request(_0x806d('0x2f'),{'body':_0x1f508e});});};exports[_0x806d('0x30')]=function(_0x2fc051){return request('ShowPause',{'options':{'where':{'id':_0x2fc051},'attributes':[_0x806d('0xf')]}});};exports[_0x806d('0x31')]=function(_0x3a50ac,_0x14e0c6){return request(_0x806d('0x32'),{'body':{'interface':_0x14e0c6},'options':{'where':_0x3a50ac}});};exports[_0x806d('0x33')]=function(_0x20e403,_0x2bc35e,_0xec7030){return request(_0x806d('0x34'),{'body':{'type':_0x2bc35e,'uniqueid':_0xec7030},'options':{'where':_0x20e403}});};exports[_0x806d('0x35')]=function(_0x5d69fe){return request('UnpauseUser',{'body':{},'options':{'where':_0x5d69fe}});};exports['agentLogout']=function(_0x5aa8c4){return request('LogoutUser',{'body':{},'options':{'where':_0x5aa8c4}});}; \ 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 6db7872..99d0649 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 _0xf360=['./lex','exports','./polly'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf360,0x9e));var _0x0f36=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf360[_0x126558];return _0x1f6d14;};var polly=require(_0x0f36('0x0'));var lex=require(_0x0f36('0x1'));module[_0x0f36('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0c23=['./polly','./lex','exports'];(function(_0xfc02f8,_0x5aaac0){var _0x24c389=function(_0x12b878){while(--_0x12b878){_0xfc02f8['push'](_0xfc02f8['shift']());}};_0x24c389(++_0x5aaac0);}(_0x0c23,0x13e));var _0x30c2=function(_0x574030,_0xae6f8b){_0x574030=_0x574030-0x0;var _0x2588de=_0x0c23[_0x574030];return _0x2588de;};var polly=require(_0x30c2('0x0'));var lex=require(_0x30c2('0x1'));module[_0x30c2('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 38027e9..2ee80f9 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 _0xf109=['./lib/api','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf109,0xce));var _0x9f10=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xf109[_0x4b73a2];return _0x383c66;};'use strict';var lex=require(_0x9f10('0x0'));module[_0x9f10('0x1')]=function(_0x44c4f2,_0x5d2950,_0x5b381d,_0x4cbc7a,_0x3659ce,_0x74f517){return lex(_0x44c4f2,_0x5d2950,_0x5b381d,_0x4cbc7a,_0x3659ce,_0x74f517);}; \ No newline at end of file +var _0x2dae=['./lib/api'];(function(_0x73cb1a,_0x35f977){var _0x223ae7=function(_0x24dde9){while(--_0x24dde9){_0x73cb1a['push'](_0x73cb1a['shift']());}};_0x223ae7(++_0x35f977);}(_0x2dae,0xc3));var _0xe2da=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0x2dae[_0x13e300];return _0x5a3eea;};'use strict';var lex=require(_0xe2da('0x0'));module['exports']=function(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97){return lex(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 610b380..abc8a40 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(_0x40e423,_0x10e3df){var _0x2c41f9=function(_0x516a82){while(--_0x516a82){_0x40e423['push'](_0x40e423['shift']());}};_0x2c41f9(++_0x10e3df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x26a764,_0x4ea53a){var _0x4a554a=function(_0x36577e){while(--_0x36577e){_0x26a764['push'](_0x26a764['shift']());}};_0x4a554a(++_0x4ea53a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 c70a721..1f0a78f 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 _0x65e7=['./lib/api','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x65e7,0x174));var _0x765e=function(_0x426f39,_0x2a387c){_0x426f39=_0x426f39-0x0;var _0x5eb253=_0x65e7[_0x426f39];return _0x5eb253;};'use strict';var polly=require(_0x765e('0x0'));module[_0x765e('0x1')]=function(_0x1c0fcb,_0x597ced,_0x59282d,_0xe112f3,_0x22ce81,_0x30a7ad,_0x5dd1d5){return polly(_0x1c0fcb,_0x597ced,_0x59282d,_0xe112f3,_0x22ce81,_0x30a7ad,_0x5dd1d5);}; \ No newline at end of file +var _0x7975=['exports','./lib/api'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7975,0x147));var _0x5797=function(_0x1a2b1d,_0x5cf900){_0x1a2b1d=_0x1a2b1d-0x0;var _0x19882f=_0x7975[_0x1a2b1d];return _0x19882f;};'use strict';var polly=require(_0x5797('0x0'));module[_0x5797('0x1')]=function(_0x45c04f,_0x2831d5,_0x2f4d29,_0x4a1398,_0x3525ba,_0x2ad179,_0x36143f){return polly(_0x45c04f,_0x2831d5,_0x2f4d29,_0x4a1398,_0x3525ba,_0x2ad179,_0x36143f);}; \ 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 e0578df..713aebf 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 _0x728f=['bluebird','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x44ea0e,_0x1ad5e8){var _0x9eedc7=function(_0x1ff09d){while(--_0x1ff09d){_0x44ea0e['push'](_0x44ea0e['shift']());}};_0x9eedc7(++_0x1ad5e8);}(_0x728f,0xe6));var _0xf728=function(_0x301bed,_0x3c3207){_0x301bed=_0x301bed-0x0;var _0x2d1c16=_0x728f[_0x301bed];return _0x2d1c16;};'use strict';var fs=require('fs');var path=require(_0xf728('0x0'));var BPromise=require(_0xf728('0x1'));var rs=require(_0xf728('0x2'));var AWS=require(_0xf728('0x3'));function pollyResult(_0x57b125,_0x3f6f0f,_0x2cfcca){return new BPromise(function(_0x22455e,_0x1e9cf2){_0x57b125['synthesizeSpeech'](_0x3f6f0f,function(_0x1c2b5e,_0x3fa818){if(_0x1c2b5e){_0x1e9cf2(_0x1c2b5e);}else if(_0x3fa818){if(_0x3fa818['AudioStream']instanceof Buffer){fs['writeFile'](_0x2cfcca,_0x3fa818[_0xf728('0x4')],function(_0x1f1196){if(_0x1f1196){_0x1e9cf2(_0x1f1196);}else{_0x22455e();}});}else{_0x1e9cf2(new Error(_0xf728('0x5')));}}else{_0x1e9cf2(new Error(_0xf728('0x6')));}});});}module[_0xf728('0x7')]=function(_0x239a22,_0x162b37,_0x15ae02,_0x5a3c05,_0x8d0105,_0x473280,_0x2ebf11){var _0x1a1cfb=new AWS[(_0xf728('0x8'))]({'accessKeyId':_0x239a22,'secretAccessKey':_0x162b37,'region':_0x15ae02});var _0x3095e4={'Text':_0x8d0105,'TextType':_0x473280||_0xf728('0x9'),'OutputFormat':_0xf728('0xa'),'VoiceId':_0x5a3c05};return pollyResult(_0x1a1cfb,_0x3095e4,_0x2ebf11);}; \ No newline at end of file +var _0xc5ac=['synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','aws-sdk'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xc5ac,0x1e6));var _0xcc5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5ac[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0xcc5a('0x0'));var BPromise=require(_0xcc5a('0x1'));var rs=require(_0xcc5a('0x2'));var AWS=require(_0xcc5a('0x3'));function pollyResult(_0x1263e7,_0x44e724,_0xfd3e1b){return new BPromise(function(_0x423bc9,_0x425211){_0x1263e7[_0xcc5a('0x4')](_0x44e724,function(_0x43909b,_0x44eba7){if(_0x43909b){_0x425211(_0x43909b);}else if(_0x44eba7){if(_0x44eba7[_0xcc5a('0x5')]instanceof Buffer){fs['writeFile'](_0xfd3e1b,_0x44eba7[_0xcc5a('0x5')],function(_0x3c4ff2){if(_0x3c4ff2){_0x425211(_0x3c4ff2);}else{_0x423bc9();}});}else{_0x425211(new Error(_0xcc5a('0x6')));}}else{_0x425211(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xcc5a('0x7')]=function(_0x22d5f4,_0x1aa094,_0x282a22,_0x50fa3c,_0x23ad23,_0x53a6e8,_0x204722){var _0x2b190b=new AWS['Polly']({'accessKeyId':_0x22d5f4,'secretAccessKey':_0x1aa094,'region':_0x282a22});var _0x4ca721={'Text':_0x23ad23,'TextType':_0x53a6e8||_0xcc5a('0x8'),'OutputFormat':_0xcc5a('0x9'),'VoiceId':_0x50fa3c};return pollyResult(_0x2b190b,_0x4ca721,_0x204722);}; \ 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 58c1fb4..b2d62bf 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 _0x3a8a=['./lib/api','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x3a8a,0xd8));var _0xa3a8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x3a8a[_0x13d07a];return _0x5ee0ee;};'use strict';var asr=require(_0xa3a8('0x0'));module[_0xa3a8('0x1')]=function(_0x54fe06,_0x1fa14f,_0x4206e6,_0xd2be95){return asr(_0x54fe06,_0x1fa14f,_0x4206e6);}; \ No newline at end of file +var _0xdc7f=['exports','./lib/api'];(function(_0x5e1cae,_0x44c44a){var _0x270d1f=function(_0x547919){while(--_0x547919){_0x5e1cae['push'](_0x5e1cae['shift']());}};_0x270d1f(++_0x44c44a);}(_0xdc7f,0xf1));var _0xfdc7=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0xdc7f[_0xc8db6b];return _0x12cb81;};'use strict';var asr=require(_0xfdc7('0x0'));module[_0xfdc7('0x1')]=function(_0x537bcf,_0x2fdd3a,_0xde0b5b,_0x3a51e1){return asr(_0x537bcf,_0x2fdd3a,_0xde0b5b);}; \ 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 3a4d7bd..3356993 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 _0x6e16=['base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x14a77c,_0x1be66d){var _0x59fc12=function(_0x3e3bbe){while(--_0x3e3bbe){_0x14a77c['push'](_0x14a77c['shift']());}};_0x59fc12(++_0x1be66d);}(_0x6e16,0x1d3));var _0x66e1=function(_0x2514a8,_0x107f37){_0x2514a8=_0x2514a8-0x0;var _0x84e30a=_0x6e16[_0x2514a8];return _0x84e30a;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x66e1('0x0');module['exports']=function(_0xac185,_0x4e3854,_0x4f811b){return new BPromise(function(_0x45d429,_0x491345){var _0x892e60;if(typeof _0xac185!=='string'||_0xac185[_0x66e1('0x1')]===0x0){return _0x491345(_0x66e1('0x2'));}if(typeof _0x4e3854!==_0x66e1('0x3')||_0x4e3854['length']===0x0){return _0x491345(_0x66e1('0x4'));}if(typeof _0x4f811b!==_0x66e1('0x5')&&(typeof _0x4f811b!==_0x66e1('0x3')||_0x4f811b[_0x66e1('0x1')]===0x0)){return _0x491345(_0x66e1('0x6'));}try{_0x892e60=fs[_0x66e1('0x7')](_0xac185)[_0x66e1('0x8')](_0x66e1('0x9'));}catch(_0x9cba7){return _0x491345(_0x9cba7);}return _0x45d429({'method':_0x66e1('0xa'),'uri':host+_0x66e1('0xb')+_0x4e3854,'body':{'config':{'encoding':_0x66e1('0xc'),'sampleRateHertz':_0x66e1('0xd'),'languageCode':_0x4f811b},'audio':{'content':_0x892e60}},'json':!![]});});}; \ No newline at end of file +var _0x78f0=['base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x78f0,0x15d));var _0x078f=function(_0x1986e1,_0x39b3c7){_0x1986e1=_0x1986e1-0x0;var _0x39568b=_0x78f0[_0x1986e1];return _0x39568b;};'use strict';var url=require(_0x078f('0x0'));var BPromise=require(_0x078f('0x1'));var fs=require('fs');var host=_0x078f('0x2');module[_0x078f('0x3')]=function(_0x11b4c1,_0x2bde34,_0x34a715){return new BPromise(function(_0x316f1c,_0x5785fd){var _0x2f3d53;if(typeof _0x11b4c1!==_0x078f('0x4')||_0x11b4c1[_0x078f('0x5')]===0x0){return _0x5785fd(_0x078f('0x6'));}if(typeof _0x2bde34!=='string'||_0x2bde34[_0x078f('0x5')]===0x0){return _0x5785fd(_0x078f('0x7'));}if(typeof _0x34a715!=='undefined'&&(typeof _0x34a715!==_0x078f('0x4')||_0x34a715[_0x078f('0x5')]===0x0)){return _0x5785fd(_0x078f('0x8'));}try{_0x2f3d53=fs[_0x078f('0x9')](_0x11b4c1)[_0x078f('0xa')](_0x078f('0xb'));}catch(_0x4207d0){return _0x5785fd(_0x4207d0);}return _0x316f1c({'method':_0x078f('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x2bde34,'body':{'config':{'encoding':_0x078f('0xd'),'sampleRateHertz':_0x078f('0xe'),'languageCode':_0x34a715},'audio':{'content':_0x2f3d53}},'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 297f468..55cd0c5 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 _0x051d=['exports','./asr'];(function(_0xdbd357,_0x3d0895){var _0x34b46a=function(_0x4ebfca){while(--_0x4ebfca){_0xdbd357['push'](_0xdbd357['shift']());}};_0x34b46a(++_0x3d0895);}(_0x051d,0x1e7));var _0xd051=function(_0x3aba72,_0x1f4876){_0x3aba72=_0x3aba72-0x0;var _0x59b797=_0x051d[_0x3aba72];return _0x59b797;};var asr=require(_0xd051('0x0'));module[_0xd051('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3d16=['exports','./asr'];(function(_0x2bd4e8,_0x358494){var _0x217dd4=function(_0x1cac47){while(--_0x1cac47){_0x2bd4e8['push'](_0x2bd4e8['shift']());}};_0x217dd4(++_0x358494);}(_0x3d16,0x133));var _0x63d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d16[_0x3dd15e];return _0x231fd0;};var asr=require(_0x63d1('0x0'));module[_0x63d1('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index a0970d4..fd4821e 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 _0x3be6=['replace','SessionsClient','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','name','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','polly','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','model=%s','sestekNDA','text','channelData','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','querystring','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https:','host','path','WHAT_EVER','get','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','protocol','end','wav','error\x20convert','tmp','base64','then','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','chmodSync','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','resolve','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','fulfillment','speech','status','code','endConversation','metadata','googleDialogflowV2'];(function(_0x59abf2,_0x39f27c){var _0x514e40=function(_0x41f349){while(--_0x41f349){_0x59abf2['push'](_0x59abf2['shift']());}};_0x514e40(++_0x39f27c);}(_0x3be6,0xa7));var _0x63be=function(_0x597992,_0x516580){_0x597992=_0x597992-0x0;var _0x2bea67=_0x3be6[_0x597992];return _0x2bea67;};'use strict';var apiai=require(_0x63be('0x0'));var BPromise=require(_0x63be('0x1'));var dialogflow=require(_0x63be('0x2'));var fs=require('fs');var http=require(_0x63be('0x3'));var https=require(_0x63be('0x4'));var md5=require(_0x63be('0x5'));var path=require('path');var querystring=require(_0x63be('0x6'));var rp=require('request-promise');var rs=require(_0x63be('0x7'));var sox=require(_0x63be('0x8'));var tts=require(_0x63be('0x9'));var urlParse=require('url')[_0x63be('0xa')];var util=require(_0x63be('0xb'));var aws=require(_0x63be('0xc'));var google=require(_0x63be('0xd'));var sestek=require(_0x63be('0xe'));var tilde=require(_0x63be('0xf'));var logger=require(_0x63be('0x10'))(_0x63be('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x31075d,_0x1d9313){return new BPromise(function(_0x157fad,_0xc9522){var _0x5f3e23=urlParse(_0x31075d);var _0x461ff6=_0x5f3e23['protocol']===_0x63be('0x12')?https:http;var _0x1ee286={'host':_0x5f3e23[_0x63be('0x13')],'path':_0x5f3e23[_0x63be('0x14')],'headers':{'user-agent':_0x63be('0x15')}};_0x461ff6[_0x63be('0x16')](_0x1ee286,function(_0x3ec29f){if(_0x3ec29f[_0x63be('0x17')]!==0xc8){logger['error'](_0x63be('0x18')+_0x31075d+'\x20failed,\x20status\x20code\x20=\x20'+_0x3ec29f[_0x63be('0x17')]+'\x20('+_0x3ec29f[_0x63be('0x19')]+')');_0xc9522(new Error(_0x63be('0x18')+_0x31075d+_0x63be('0x1a')+_0x3ec29f['statusCode']+'\x20('+_0x3ec29f[_0x63be('0x19')]+')'));return;}var _0x595db6=fs[_0x63be('0x1b')](_0x1d9313);_0x595db6['on'](_0x63be('0x1c'),function(){logger[_0x63be('0x1d')](_0x63be('0x1e'));_0x595db6[_0x63be('0x1f')](_0x157fad);});_0x595db6['on'](_0x63be('0x20'),function(_0x31f11b){fs[_0x63be('0x21')](_0x1d9313);logger[_0x63be('0x20')](_0x63be('0x22'),_0x31f11b);_0xc9522(_0x31f11b);});_0x3ec29f[_0x63be('0x23')](_0x595db6);})['on']('error',function(_0x462bd5){logger[_0x63be('0x20')](_0x462bd5);_0xc9522(_0x462bd5);})['end']();});}function uploadFile(_0x610f5c){return new BPromise(function(_0x39de0a,_0xa931c9){var _0x278c7=urlParse(_0x610f5c);var _0x5649ff=_0x278c7[_0x63be('0x24')]===_0x63be('0x12')?https:http;var _0x43cab8={'host':_0x278c7[_0x63be('0x13')],'path':_0x278c7[_0x63be('0x14')],'headers':{'user-agent':_0x63be('0x15')}};_0x5649ff[_0x63be('0x16')](_0x43cab8,function(_0x4f3efa){if(_0x4f3efa[_0x63be('0x17')]!==0xc8){_0xa931c9(new Error(_0x63be('0x18')+_0x610f5c+_0x63be('0x1a')+_0x4f3efa[_0x63be('0x17')]+'\x20('+_0x4f3efa[_0x63be('0x19')]+')'));return;}var _0x10bcd7='';_0x4f3efa['on']('data',function(_0x2ea128){_0x10bcd7+=_0x2ea128;});_0x4f3efa['on']('end',function(){_0x39de0a(_0x10bcd7);});})['on']('error',function(_0x375359){_0xa931c9(_0x375359);})[_0x63be('0x25')]();});}function convertFile(_0x1e1278,_0x40a01a){return new BPromise(function(_0x5ba9bd,_0x25aa94){var _0x416fe0=sox['transcode'](_0x1e1278,_0x40a01a,{'sampleRate':0x1f40,'format':_0x63be('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x416fe0['on'](_0x63be('0x20'),function(_0x1bed04){logger[_0x63be('0x20')](_0x63be('0x27'),_0x1bed04);_0x25aa94(_0x1bed04);});_0x416fe0['on'](_0x63be('0x25'),function(){logger['info']('finish\x20to\x20convert');_0x5ba9bd();});_0x416fe0['start']();});}function base64Decode(_0x27138b,_0x48d665){var _0x357a95=path['resolve'](__dirname,_0x63be('0x28'),rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x357a95,_0x27138b,_0x63be('0x29'));return convertFile(_0x357a95,_0x48d665)[_0x63be('0x2a')](function(){try{fs[_0x63be('0x21')](_0x357a95);fs['chmodSync'](_0x48d665,_0x63be('0x2b'));}catch(_0x1fce94){logger[_0x63be('0x20')](_0x1fce94);}return _0x48d665[_0x63be('0x2c')]('.')[0x0];});}function base64Encode(_0x57963f){var _0x1157dd=fs[_0x63be('0x2d')](_0x57963f);return new Buffer(_0x1157dd)[_0x63be('0x2e')](_0x63be('0x29'));}exports[_0x63be('0x2f')]=function(_0x1b2ff2,_0x5c4aba,_0x1c39c0,_0xbf4e2a,_0x5bf6bc,_0x54d560){var _0x56a604,_0x54f049;var _0x23bc40=_0x63be('0x30');var _0x27ee37=_0x63be('0x31')+_0x1b2ff2;var _0x30218c={};if(_0x5c4aba===_0x63be('0x32')){_0x30218c[_0x63be('0x33')]={'ssml':_0x1c39c0};}else{_0x30218c['input']={'text':_0x1c39c0};};_0x30218c[_0x63be('0x34')]={'languageCode':_0xbf4e2a,'ssmlGender':_0x5bf6bc};_0x30218c['audioConfig']={'audioEncoding':_0x63be('0x35'),'sampleRateHertz':0x1f40};var _0x173d0a={'url':_0x23bc40+_0x63be('0x36')+_0x27ee37,'method':_0x63be('0x37'),'json':!![],'body':_0x30218c};return rp(_0x173d0a)['then'](function(_0x434ef4){return new BPromise(function(_0x42ed68,_0xdc06ee){_0x56a604=path['resolve'](__dirname,'tmp',rs[_0x63be('0x38')](0x4)+_0x63be('0x39'));var _0x14b314=Buffer[_0x63be('0x3a')](_0x434ef4[_0x63be('0x3b')],_0x63be('0x29'));return fs[_0x63be('0x3c')](_0x56a604,_0x14b314,function(_0x2bcb59){_0xdc06ee(_0x2bcb59);},function(_0x1cac46){fs[_0x63be('0x3d')](_0x56a604,'777');_0x42ed68(_0x1cac46);});});})[_0x63be('0x2a')](function(_0x3bd43c){_0x54f049=path['resolve'](__dirname,_0x63be('0x28'),rs[_0x63be('0x38')](0x4)+_0x63be('0x3e'));return convertFile(_0x56a604,_0x54f049);})['then'](function(){try{fs[_0x63be('0x21')](_0x56a604);fs['chmodSync'](_0x54f049,_0x63be('0x2b'));}catch(_0x210c66){logger[_0x63be('0x20')](_0x210c66);}logger[_0x63be('0x1d')](_0x63be('0x3f'),_0x54f049[_0x63be('0x2c')]('.')[0x0]);return _0x54f049['split']('.')[0x0];});};exports[_0x63be('0x40')]=function(_0x4c7aca,_0x5eb382){var _0x56b3a7=_0x63be('0x41');var _0x238e29,_0x3974b7;var _0x43a388;var _0x580b5a={'encoding':_0x63be('0x42'),'method':_0x63be('0x37'),'timeout':0x2710,'url':_0x56b3a7,'headers':{'Content-Type':_0x63be('0x43')},'body':'f.req='+encodeURIComponent(JSON[_0x63be('0x44')]([[[_0x63be('0x45'),JSON[_0x63be('0x44')]([_0x4c7aca,_0x5eb382||'en',![],_0x63be('0x46')]),null,_0x63be('0x47')]]]))};return rp(_0x580b5a)['then'](function(_0x580ba4){try{_0x43a388=eval(_0x580ba4[_0x63be('0x48')](0x5))[0x0][0x2];}catch(_0x328ff1){throw new Error(_0x63be('0x49')+_0x580ba4[_0x63be('0x4a')]);}if(!_0x43a388){if(_0x4c7aca[_0x63be('0x4b')]>0xc8){throw new Error(_0x63be('0x4c'));}else{throw new Error(_0x63be('0x4d')+_0x5eb382+_0x63be('0x4e'));}}try{_0x43a388=eval(_0x43a388)[0x0];}catch(_0x3ad865){throw new Error(_0x63be('0x49')+res['data']);}const _0x2538f4=_0x43a388;_0x238e29=path['resolve'](__dirname,_0x63be('0x28'),rs[_0x63be('0x38')](0x4)+_0x63be('0x39'));fs[_0x63be('0x4f')](_0x238e29,_0x43a388,{'encoding':_0x63be('0x29')});_0x3974b7=path[_0x63be('0x50')](__dirname,_0x63be('0x28'),rs[_0x63be('0x38')](0x4)+_0x63be('0x3e'));return convertFile(_0x238e29,_0x3974b7);})[_0x63be('0x2a')](function(){try{fs[_0x63be('0x21')](_0x238e29);fs[_0x63be('0x3d')](_0x3974b7,'777');}catch(_0x4d091d){logger[_0x63be('0x20')](_0x4d091d);}logger['info'](_0x63be('0x51'),_0x3974b7[_0x63be('0x2c')]('.')[0x0]);return _0x3974b7[_0x63be('0x2c')]('.')[0x0];});};exports[_0x63be('0x52')]=function(_0x1add05,_0x5560d8,_0x562fbb){return google[_0x63be('0x53')](_0x1add05,_0x5560d8,_0x562fbb)[_0x63be('0x2a')](function(_0x4e7a85){logger[_0x63be('0x1d')](_0x4e7a85[_0x63be('0x54')]);return rp(_0x4e7a85);})[_0x63be('0x2a')](function(_0x72137c){var _0x41e577='';var _0x530cbf=0x0;try{fs['unlink'](_0x1add05);}catch(_0x5755a2){logger[_0x63be('0x20')](_0x5755a2);}if(_0x72137c&&_0x72137c[_0x63be('0x55')]){_0x41e577=_0x72137c[_0x63be('0x55')][_0x63be('0x56')](function(_0x24f790){return _0x24f790&&_0x24f790['alternatives'][0x0]&&_0x24f790['alternatives'][0x0]['transcript']?_0x24f790[_0x63be('0x57')][0x0][_0x63be('0x58')]:'';})[_0x63be('0x59')]('\x0a');_0x530cbf=_0x72137c['results'][_0x63be('0x56')](function(_0x489cdd){return _0x489cdd&&_0x489cdd[_0x63be('0x57')][0x0]&&_0x489cdd[_0x63be('0x57')][0x0][_0x63be('0x5a')]?_0x489cdd['alternatives'][0x0][_0x63be('0x5a')]:0x0;})[_0x63be('0x59')]('\x0a');}logger[_0x63be('0x1d')](_0x63be('0x5b'),_0x41e577);logger['info'](_0x63be('0x5c'),_0x530cbf);return{'transcript':_0x41e577,'confidence':_0x530cbf};})[_0x63be('0x5d')](function(_0x46c88c){logger['error'](_0x63be('0x5e'),_0x46c88c[_0x63be('0x17')],_0x46c88c['name'],_0x46c88c[_0x63be('0x5f')]);});};exports[_0x63be('0x60')]=function(_0x43c178,_0x1ad23e,_0x218394,_0x2dc348){var _0x4deae3=apiai(_0x1ad23e,{'language':_0x2dc348||'en'});return _0x4deae3[_0x63be('0x61')](_0x218394,{'sessionId':md5(_0x43c178)})[_0x63be('0x2a')](function(_0x1dfc57){logger['info'](JSON[_0x63be('0x44')](_0x1dfc57));return{'source':_0x1dfc57['result'][_0x63be('0x62')],'resolvedQuery':_0x1dfc57[_0x63be('0x63')][_0x63be('0x64')],'action':_0x1dfc57['result'][_0x63be('0x65')],'actionIncomplete':_0x1dfc57[_0x63be('0x63')]['actionIncomplete'],'speech':_0x1dfc57[_0x63be('0x63')][_0x63be('0x66')][_0x63be('0x67')],'score':_0x1dfc57['result']['score'],'statusCode':_0x1dfc57[_0x63be('0x68')][_0x63be('0x69')],'endConversation':_0x1dfc57[_0x63be('0x63')]['metadata'][_0x63be('0x6a')]||![],'isFallbackIntent':_0x1dfc57[_0x63be('0x63')][_0x63be('0x6b')]['isFallbackIntent']};});};exports[_0x63be('0x6c')]=function(_0x24f97e,_0x5b0ad9,_0x3e698b,_0x4467cb,_0x196490,_0x45e6af){var _0x60b200=_0x4467cb[_0x63be('0x6d')](/\\n/g,'\x0a');var _0xb30884={'credentials':{'private_key':_0x60b200,'client_email':_0x3e698b}};var _0x36fbaf=new dialogflow[(_0x63be('0x6e'))](_0xb30884);var _0x5eb20d=_0x36fbaf['sessionPath'](_0x5b0ad9,md5(_0x24f97e));var _0xe6e675={'session':_0x5eb20d,'queryInput':{'text':{'text':_0x196490,'languageCode':_0x45e6af}}};return _0x36fbaf[_0x63be('0x6f')](_0xe6e675)[_0x63be('0x2a')](function(_0x510a72){if(_0x510a72&&_0x510a72[_0x63be('0x4b')]){logger[_0x63be('0x1d')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x510a72));var _0x11dfa6=_0x510a72[0x0];if(_0x11dfa6){var _0x46274f={'action':_0x11dfa6[_0x63be('0x70')][_0x63be('0x65')],'allRequiredParamsPresent':_0x11dfa6[_0x63be('0x70')]['allRequiredParamsPresent'],'endConversation':_0x11dfa6[_0x63be('0x70')][_0x63be('0x71')]&&_0x11dfa6[_0x63be('0x70')][_0x63be('0x71')][_0x63be('0x72')]?_0x11dfa6['queryResult'][_0x63be('0x71')][_0x63be('0x72')][_0x63be('0x73')][_0x63be('0x74')]:![],'fulfillmentText':_0x11dfa6[_0x63be('0x70')]['fulfillmentText'],'intentName':_0x11dfa6['queryResult'][_0x63be('0x75')][_0x63be('0x76')],'intentDisplayName':_0x11dfa6[_0x63be('0x70')][_0x63be('0x75')][_0x63be('0x77')],'isFallbackIntent':_0x11dfa6[_0x63be('0x70')][_0x63be('0x75')][_0x63be('0x78')],'languageCode':_0x11dfa6[_0x63be('0x70')][_0x63be('0x79')],'queryText':_0x11dfa6[_0x63be('0x70')]['queryText'],'responseId':_0x11dfa6[_0x63be('0x7a')],'score':_0x11dfa6['queryResult'][_0x63be('0x7b')],'speech':_0x11dfa6[_0x63be('0x70')]['fulfillmentText'],'providerResponse':JSON[_0x63be('0x44')](_0x510a72)};return _0x46274f;}}});};exports[_0x63be('0x7c')]=function(_0x13eb21,_0x1cb2e8,_0x36ceba,_0x2bbbd4){return tilde[_0x63be('0x53')](_0x13eb21,_0x1cb2e8,_0x36ceba,_0x2bbbd4)[_0x63be('0x2a')](function(_0x13059e){try{fs['unlink'](_0x13eb21);}catch(_0x355a5e){logger[_0x63be('0x20')](_0x355a5e);}logger[_0x63be('0x1d')]('Tilde\x20ASR\x20transcription',_0x13059e['transcript']);logger['info'](_0x63be('0x7d'),_0x13059e[_0x63be('0x5a')]);return _0x13059e;});};exports['awsPolly']=function(_0xe35747,_0x1b41b4,_0x1c15dc,_0x960825,_0x4353b1,_0x4a4a81){var _0x43a747=path[_0x63be('0x50')](__dirname,_0x63be('0x28'),rs[_0x63be('0x38')](0x4)+_0x63be('0x39'));var _0x27fe0a;return aws[_0x63be('0x7e')](_0xe35747,_0x1b41b4,_0x1c15dc,_0x960825,_0x4353b1,_0x4a4a81,_0x43a747)['then'](function(){_0x27fe0a=path[_0x63be('0x50')](__dirname,_0x63be('0x28'),rs[_0x63be('0x38')](0x4)+'.wav');return convertFile(_0x43a747,_0x27fe0a);})[_0x63be('0x2a')](function(){try{fs['unlink'](_0x43a747);fs[_0x63be('0x3d')](_0x27fe0a,_0x63be('0x2b'));}catch(_0xf81653){logger[_0x63be('0x20')](_0xf81653);}return _0x27fe0a[_0x63be('0x2c')]('.')[0x0];});};exports['awsLex']=function(_0x1fba87,_0x3def74,_0x1f42dd,_0x297a6b,_0x59ff1b,_0xbf4a1c){return aws[_0x63be('0x7f')](_0x1fba87,_0x3def74,_0x1f42dd,_0x297a6b,_0x59ff1b,_0xbf4a1c)[_0x63be('0x2a')](function(_0x467ea2){logger[_0x63be('0x1d')](JSON[_0x63be('0x44')](_0x467ea2));return _0x467ea2;});};exports['ispeechTTS']=function(_0x17802e,_0x424e82,_0x3c9431,_0x3c2b65){var _0x1d363c=util['format'](_0x63be('0x80'),ISPEECH_API,_0x17802e,encodeURIComponent(_0x424e82),_0x3c9431,_0x3c2b65);var _0x4211e5=path[_0x63be('0x50')](__dirname,_0x63be('0x28'),rs['generate'](0x4)+_0x63be('0x39'));var _0x1ea0c2;return downloadFile(_0x1d363c,_0x4211e5)[_0x63be('0x2a')](function(){_0x1ea0c2=path['resolve'](__dirname,_0x63be('0x28'),rs[_0x63be('0x38')](0x4)+_0x63be('0x3e'));return convertFile(_0x4211e5,_0x1ea0c2);})['then'](function(){try{fs[_0x63be('0x21')](_0x4211e5);fs[_0x63be('0x3d')](_0x1ea0c2,_0x63be('0x2b'));}catch(_0xf7fc61){logger['error'](_0xf7fc61);}return _0x1ea0c2['split']('.')[0x0];});};exports['ispeechASR']=function(_0x1d8f64,_0x4f0331,_0x186d31,_0x68df9b){var _0x48cde3=util[_0x63be('0x81')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4f0331,_0x186d31,base64Encode(_0x1d8f64),_0x68df9b?util['format'](_0x63be('0x82'),encodeURIComponent(_0x68df9b)):'freeform=3');return uploadFile(_0x48cde3)[_0x63be('0x2a')](function(_0x4bdfc9){return querystring[_0x63be('0xa')](_0x4bdfc9);});};exports[_0x63be('0x83')]=function(_0x4d1d3b,_0x4bda91){return sestek['nda'](_0x4d1d3b,_0x4bda91)[_0x63be('0x2a')](function(_0x3e9b2c){logger[_0x63be('0x1d')](JSON['stringify'](_0x3e9b2c));var _0x250bc8={'speech':_0x3e9b2c[_0x63be('0x84')],'action':_0x3e9b2c[_0x63be('0x85')]?_0x3e9b2c['channelData']['CustomAction']:undefined,'actiondata':_0x3e9b2c[_0x63be('0x85')]?_0x3e9b2c['channelData'][_0x63be('0x86')]:undefined};if(_0x3e9b2c[_0x63be('0x85')]&&_0x3e9b2c[_0x63be('0x85')][_0x63be('0x87')]){return base64Decode(_0x3e9b2c['channelData']['AudioFromTts'][_0x63be('0x88')],path['resolve'](__dirname,_0x63be('0x28'),rs[_0x63be('0x38')](0x4)+_0x63be('0x3e')))[_0x63be('0x2a')](function(_0x5b8fd3){_0x250bc8['audiofile']=_0x5b8fd3;return _0x250bc8;});}return _0x250bc8;});};exports[_0x63be('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x458d=['%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','util','./aws','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','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','protocol','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','base64','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','stringify','result','resolvedQuery','action','fulfillment','status','code','metadata','endConversation','googleDialogflowV2','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR'];(function(_0x5cf1df,_0x509b69){var _0x2e9dda=function(_0x4c19c2){while(--_0x4c19c2){_0x5cf1df['push'](_0x5cf1df['shift']());}};_0x2e9dda(++_0x509b69);}(_0x458d,0x1ae));var _0xd458=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x458d[_0x36ed48];return _0x51c63a;};'use strict';var apiai=require(_0xd458('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xd458('0x1'));var fs=require('fs');var http=require(_0xd458('0x2'));var https=require(_0xd458('0x3'));var md5=require(_0xd458('0x4'));var path=require(_0xd458('0x5'));var querystring=require(_0xd458('0x6'));var rp=require(_0xd458('0x7'));var rs=require(_0xd458('0x8'));var sox=require(_0xd458('0x9'));var tts=require(_0xd458('0xa'));var urlParse=require('url')['parse'];var util=require(_0xd458('0xb'));var aws=require(_0xd458('0xc'));var google=require(_0xd458('0xd'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0xd458('0xe'))(_0xd458('0xf'));var ISPEECH_API=_0xd458('0x10');function downloadFile(_0x3d5a56,_0x3f2e9f){return new BPromise(function(_0x1dd68a,_0xe1e34){var _0x2f63a0=urlParse(_0x3d5a56);var _0x6b8ca8=_0x2f63a0['protocol']===_0xd458('0x11')?https:http;var _0x50e378={'host':_0x2f63a0[_0xd458('0x12')],'path':_0x2f63a0[_0xd458('0x5')],'headers':{'user-agent':_0xd458('0x13')}};_0x6b8ca8[_0xd458('0x14')](_0x50e378,function(_0x89d3a){if(_0x89d3a[_0xd458('0x15')]!==0xc8){logger[_0xd458('0x16')](_0xd458('0x17')+_0x3d5a56+_0xd458('0x18')+_0x89d3a[_0xd458('0x15')]+'\x20('+_0x89d3a[_0xd458('0x19')]+')');_0xe1e34(new Error(_0xd458('0x17')+_0x3d5a56+'\x20failed,\x20status\x20code\x20=\x20'+_0x89d3a['statusCode']+'\x20('+_0x89d3a[_0xd458('0x19')]+')'));return;}var _0x30d44b=fs[_0xd458('0x1a')](_0x3f2e9f);_0x30d44b['on'](_0xd458('0x1b'),function(){logger[_0xd458('0x1c')](_0xd458('0x1d'));_0x30d44b[_0xd458('0x1e')](_0x1dd68a);});_0x30d44b['on'](_0xd458('0x16'),function(_0x539845){fs[_0xd458('0x1f')](_0x3f2e9f);logger[_0xd458('0x16')](_0xd458('0x20'),_0x539845);_0xe1e34(_0x539845);});_0x89d3a[_0xd458('0x21')](_0x30d44b);})['on'](_0xd458('0x16'),function(_0x3795e0){logger[_0xd458('0x16')](_0x3795e0);_0xe1e34(_0x3795e0);})[_0xd458('0x22')]();});}function uploadFile(_0x1349ff){return new BPromise(function(_0x34950b,_0x15ab38){var _0x283d1a=urlParse(_0x1349ff);var _0x10d19a=_0x283d1a[_0xd458('0x23')]==='https:'?https:http;var _0x21346a={'host':_0x283d1a[_0xd458('0x12')],'path':_0x283d1a[_0xd458('0x5')],'headers':{'user-agent':_0xd458('0x13')}};_0x10d19a[_0xd458('0x14')](_0x21346a,function(_0x34101a){if(_0x34101a[_0xd458('0x15')]!==0xc8){_0x15ab38(new Error(_0xd458('0x17')+_0x1349ff+_0xd458('0x18')+_0x34101a[_0xd458('0x15')]+'\x20('+_0x34101a[_0xd458('0x19')]+')'));return;}var _0x7379fe='';_0x34101a['on'](_0xd458('0x24'),function(_0x5b9dd4){_0x7379fe+=_0x5b9dd4;});_0x34101a['on'](_0xd458('0x22'),function(){_0x34950b(_0x7379fe);});})['on'](_0xd458('0x16'),function(_0x281a){_0x15ab38(_0x281a);})[_0xd458('0x22')]();});}function convertFile(_0x243372,_0x5439cc){return new BPromise(function(_0x16cc22,_0x3da6f6){var _0x3ebc43=sox[_0xd458('0x25')](_0x243372,_0x5439cc,{'sampleRate':0x1f40,'format':_0xd458('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ebc43['on'](_0xd458('0x16'),function(_0x298c3f){logger[_0xd458('0x16')](_0xd458('0x27'),_0x298c3f);_0x3da6f6(_0x298c3f);});_0x3ebc43['on'](_0xd458('0x22'),function(){logger['info'](_0xd458('0x28'));_0x16cc22();});_0x3ebc43['start']();});}function base64Decode(_0x2c5dcc,_0x4b3a8e){var _0x3b0db4=path[_0xd458('0x29')](__dirname,'tmp',rs[_0xd458('0x2a')](0x4)+_0xd458('0x2b'));fs[_0xd458('0x2c')](_0x3b0db4,_0x2c5dcc,'base64');return convertFile(_0x3b0db4,_0x4b3a8e)[_0xd458('0x2d')](function(){try{fs['unlink'](_0x3b0db4);fs[_0xd458('0x2e')](_0x4b3a8e,_0xd458('0x2f'));}catch(_0x26adc8){logger[_0xd458('0x16')](_0x26adc8);}return _0x4b3a8e[_0xd458('0x30')]('.')[0x0];});}function base64Encode(_0x30fe70){var _0x25cb6c=fs[_0xd458('0x31')](_0x30fe70);return new Buffer(_0x25cb6c)[_0xd458('0x32')]('base64');}exports['googleCloudTTS']=function(_0x2f273b,_0x45fda8,_0x29e6ce,_0x533936,_0x2c190a,_0x113dd7){var _0x12e0c8,_0x399355;var _0x49c3f9='https://texttospeech.googleapis.com/v1/';var _0x483975=_0xd458('0x33')+_0x2f273b;var _0x42d6ee={};if(_0x45fda8===_0xd458('0x34')){_0x42d6ee[_0xd458('0x35')]={'ssml':_0x29e6ce};}else{_0x42d6ee['input']={'text':_0x29e6ce};};_0x42d6ee['voice']={'languageCode':_0x533936,'ssmlGender':_0x2c190a};_0x42d6ee[_0xd458('0x36')]={'audioEncoding':_0xd458('0x37'),'sampleRateHertz':0x1f40};var _0x3fd40f={'url':_0x49c3f9+_0xd458('0x38')+_0x483975,'method':_0xd458('0x39'),'json':!![],'body':_0x42d6ee};return rp(_0x3fd40f)[_0xd458('0x2d')](function(_0x262a34){return new BPromise(function(_0x55727f,_0x5cd108){_0x12e0c8=path[_0xd458('0x29')](__dirname,_0xd458('0x3a'),rs[_0xd458('0x2a')](0x4)+_0xd458('0x3b'));var _0x200b76=Buffer[_0xd458('0x3c')](_0x262a34[_0xd458('0x3d')],_0xd458('0x3e'));return fs[_0xd458('0x3f')](_0x12e0c8,_0x200b76,function(_0x3c4d87){_0x5cd108(_0x3c4d87);},function(_0x54b946){fs[_0xd458('0x2e')](_0x12e0c8,_0xd458('0x2f'));_0x55727f(_0x54b946);});});})[_0xd458('0x2d')](function(_0x5eeadc){_0x399355=path['resolve'](__dirname,_0xd458('0x3a'),rs['generate'](0x4)+_0xd458('0x2b'));return convertFile(_0x12e0c8,_0x399355);})[_0xd458('0x2d')](function(){try{fs['unlink'](_0x12e0c8);fs[_0xd458('0x2e')](_0x399355,_0xd458('0x2f'));}catch(_0x1ad372){logger[_0xd458('0x16')](_0x1ad372);}logger['info'](_0xd458('0x40'),_0x399355[_0xd458('0x30')]('.')[0x0]);return _0x399355['split']('.')[0x0];});};exports[_0xd458('0x41')]=function(_0x17f2f8,_0x28c1ef){var _0x37c6ab=_0xd458('0x42');var _0x1caf86,_0x2fc457;var _0x3e4bdc;var _0x232932={'encoding':'utf8','method':_0xd458('0x39'),'timeout':0x2710,'url':_0x37c6ab,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xd458('0x43'),JSON['stringify']([_0x17f2f8,_0x28c1ef||'en',![],_0xd458('0x44')]),null,_0xd458('0x45')]]]))};return rp(_0x232932)['then'](function(_0x85c66c){try{_0x3e4bdc=eval(_0x85c66c[_0xd458('0x46')](0x5))[0x0][0x2];}catch(_0x3528a0){throw new Error(_0xd458('0x47')+_0x85c66c['data']);}if(!_0x3e4bdc){if(_0x17f2f8[_0xd458('0x48')]>0xc8){throw new Error(_0xd458('0x49'));}else{throw new Error(_0xd458('0x4a')+_0x28c1ef+'\x22\x20might\x20not\x20exist');}}try{_0x3e4bdc=eval(_0x3e4bdc)[0x0];}catch(_0x44a7be){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xd458('0x24')]);}const _0x1324c7=_0x3e4bdc;_0x1caf86=path[_0xd458('0x29')](__dirname,_0xd458('0x3a'),rs[_0xd458('0x2a')](0x4)+_0xd458('0x3b'));fs[_0xd458('0x2c')](_0x1caf86,_0x3e4bdc,{'encoding':'base64'});_0x2fc457=path[_0xd458('0x29')](__dirname,_0xd458('0x3a'),rs['generate'](0x4)+'.wav');return convertFile(_0x1caf86,_0x2fc457);})[_0xd458('0x2d')](function(){try{fs[_0xd458('0x1f')](_0x1caf86);fs[_0xd458('0x2e')](_0x2fc457,_0xd458('0x2f'));}catch(_0x21ef64){logger['error'](_0x21ef64);}logger['info']('goggleTTS\x20path',_0x2fc457[_0xd458('0x30')]('.')[0x0]);return _0x2fc457[_0xd458('0x30')]('.')[0x0];});};exports[_0xd458('0x4b')]=function(_0x31f884,_0x415886,_0xe66573){return google[_0xd458('0x4c')](_0x31f884,_0x415886,_0xe66573)['then'](function(_0x2f56e7){logger[_0xd458('0x1c')](_0x2f56e7[_0xd458('0x4d')]);return rp(_0x2f56e7);})[_0xd458('0x2d')](function(_0x4326ee){var _0x3930e0='';var _0x142b3f=0x0;try{fs[_0xd458('0x1f')](_0x31f884);}catch(_0x10e74d){logger[_0xd458('0x16')](_0x10e74d);}if(_0x4326ee&&_0x4326ee[_0xd458('0x4e')]){_0x3930e0=_0x4326ee[_0xd458('0x4e')][_0xd458('0x4f')](function(_0x18bbc0){return _0x18bbc0&&_0x18bbc0[_0xd458('0x50')][0x0]&&_0x18bbc0[_0xd458('0x50')][0x0][_0xd458('0x51')]?_0x18bbc0['alternatives'][0x0][_0xd458('0x51')]:'';})[_0xd458('0x52')]('\x0a');_0x142b3f=_0x4326ee[_0xd458('0x4e')]['map'](function(_0x499770){return _0x499770&&_0x499770[_0xd458('0x50')][0x0]&&_0x499770[_0xd458('0x50')][0x0]['confidence']?_0x499770[_0xd458('0x50')][0x0][_0xd458('0x53')]:0x0;})[_0xd458('0x52')]('\x0a');}logger[_0xd458('0x1c')](_0xd458('0x54'),_0x3930e0);logger['info'](_0xd458('0x55'),_0x142b3f);return{'transcript':_0x3930e0,'confidence':_0x142b3f};})[_0xd458('0x56')](function(_0x1afe60){logger[_0xd458('0x16')](_0xd458('0x57'),_0x1afe60['statusCode'],_0x1afe60[_0xd458('0x58')],_0x1afe60[_0xd458('0x59')]);});};exports[_0xd458('0x5a')]=function(_0x4d3095,_0x58bb1b,_0x116ab9,_0x5cc005){var _0x2f781e=apiai(_0x58bb1b,{'language':_0x5cc005||'en'});return _0x2f781e['textRequest'](_0x116ab9,{'sessionId':md5(_0x4d3095)})['then'](function(_0x34fba2){logger['info'](JSON[_0xd458('0x5b')](_0x34fba2));return{'source':_0x34fba2[_0xd458('0x5c')]['source'],'resolvedQuery':_0x34fba2['result'][_0xd458('0x5d')],'action':_0x34fba2[_0xd458('0x5c')][_0xd458('0x5e')],'actionIncomplete':_0x34fba2[_0xd458('0x5c')]['actionIncomplete'],'speech':_0x34fba2[_0xd458('0x5c')][_0xd458('0x5f')]['speech'],'score':_0x34fba2[_0xd458('0x5c')]['score'],'statusCode':_0x34fba2[_0xd458('0x60')][_0xd458('0x61')],'endConversation':_0x34fba2[_0xd458('0x5c')][_0xd458('0x62')][_0xd458('0x63')]||![],'isFallbackIntent':_0x34fba2[_0xd458('0x5c')][_0xd458('0x62')]['isFallbackIntent']};});};exports[_0xd458('0x64')]=function(_0x38b49e,_0x4d02a2,_0x5db7ed,_0x594c51,_0x166761,_0x2bbcff){var _0x30a028=_0x594c51['replace'](/\\n/g,'\x0a');var _0x1cd03c={'credentials':{'private_key':_0x30a028,'client_email':_0x5db7ed}};var _0x331f26=new dialogflow[(_0xd458('0x65'))](_0x1cd03c);var _0x32414a=_0x331f26[_0xd458('0x66')](_0x4d02a2,md5(_0x38b49e));var _0xaca78f={'session':_0x32414a,'queryInput':{'text':{'text':_0x166761,'languageCode':_0x2bbcff}}};return _0x331f26['detectIntent'](_0xaca78f)[_0xd458('0x2d')](function(_0x3b3b68){if(_0x3b3b68&&_0x3b3b68[_0xd458('0x48')]){logger[_0xd458('0x1c')](_0xd458('0x67'),JSON['stringify'](_0x3b3b68));var _0x391f94=_0x3b3b68[0x0];if(_0x391f94){var _0x2436aa={'action':_0x391f94[_0xd458('0x68')]['action'],'allRequiredParamsPresent':_0x391f94[_0xd458('0x68')]['allRequiredParamsPresent'],'endConversation':_0x391f94[_0xd458('0x68')][_0xd458('0x69')]&&_0x391f94[_0xd458('0x68')][_0xd458('0x69')][_0xd458('0x6a')]?_0x391f94['queryResult'][_0xd458('0x69')]['fields'][_0xd458('0x6b')][_0xd458('0x6c')]:![],'fulfillmentText':_0x391f94[_0xd458('0x68')][_0xd458('0x6d')],'intentName':_0x391f94[_0xd458('0x68')][_0xd458('0x6e')]['name'],'intentDisplayName':_0x391f94['queryResult']['intent'][_0xd458('0x6f')],'isFallbackIntent':_0x391f94[_0xd458('0x68')][_0xd458('0x6e')][_0xd458('0x70')],'languageCode':_0x391f94[_0xd458('0x68')][_0xd458('0x71')],'queryText':_0x391f94[_0xd458('0x68')][_0xd458('0x72')],'responseId':_0x391f94['responseId'],'score':_0x391f94[_0xd458('0x68')][_0xd458('0x73')],'speech':_0x391f94['queryResult'][_0xd458('0x6d')],'providerResponse':JSON[_0xd458('0x5b')](_0x3b3b68)};return _0x2436aa;}}});};exports[_0xd458('0x74')]=function(_0x35e5aa,_0x28b475,_0x1ea39e,_0x42730b){return tilde[_0xd458('0x4c')](_0x35e5aa,_0x28b475,_0x1ea39e,_0x42730b)[_0xd458('0x2d')](function(_0x7f9a14){try{fs['unlink'](_0x35e5aa);}catch(_0x5844d0){logger[_0xd458('0x16')](_0x5844d0);}logger['info'](_0xd458('0x75'),_0x7f9a14['transcript']);logger['info'](_0xd458('0x76'),_0x7f9a14['confidence']);return _0x7f9a14;});};exports[_0xd458('0x77')]=function(_0x14b15d,_0x209a64,_0x5a3abc,_0x48aa2a,_0x84ba3a,_0x474a9a){var _0x2844f6=path['resolve'](__dirname,_0xd458('0x3a'),rs[_0xd458('0x2a')](0x4)+_0xd458('0x3b'));var _0x275d27;return aws['polly'](_0x14b15d,_0x209a64,_0x5a3abc,_0x48aa2a,_0x84ba3a,_0x474a9a,_0x2844f6)[_0xd458('0x2d')](function(){_0x275d27=path[_0xd458('0x29')](__dirname,'tmp',rs[_0xd458('0x2a')](0x4)+_0xd458('0x2b'));return convertFile(_0x2844f6,_0x275d27);})[_0xd458('0x2d')](function(){try{fs['unlink'](_0x2844f6);fs['chmodSync'](_0x275d27,_0xd458('0x2f'));}catch(_0x2c33ce){logger[_0xd458('0x16')](_0x2c33ce);}return _0x275d27[_0xd458('0x30')]('.')[0x0];});};exports[_0xd458('0x78')]=function(_0x409591,_0x4c4800,_0x20a35d,_0x56d7ab,_0x2eb548,_0x2ebf91){return aws[_0xd458('0x79')](_0x409591,_0x4c4800,_0x20a35d,_0x56d7ab,_0x2eb548,_0x2ebf91)['then'](function(_0x2e03c3){logger[_0xd458('0x1c')](JSON[_0xd458('0x5b')](_0x2e03c3));return _0x2e03c3;});};exports[_0xd458('0x7a')]=function(_0x485649,_0x3ec158,_0xb2dc4,_0x2cd696){var _0xc367ef=util[_0xd458('0x7b')](_0xd458('0x7c'),ISPEECH_API,_0x485649,encodeURIComponent(_0x3ec158),_0xb2dc4,_0x2cd696);var _0xb1b9a9=path[_0xd458('0x29')](__dirname,_0xd458('0x3a'),rs[_0xd458('0x2a')](0x4)+_0xd458('0x3b'));var _0x483bd7;return downloadFile(_0xc367ef,_0xb1b9a9)[_0xd458('0x2d')](function(){_0x483bd7=path['resolve'](__dirname,'tmp',rs[_0xd458('0x2a')](0x4)+_0xd458('0x2b'));return convertFile(_0xb1b9a9,_0x483bd7);})['then'](function(){try{fs['unlink'](_0xb1b9a9);fs[_0xd458('0x2e')](_0x483bd7,_0xd458('0x2f'));}catch(_0x1dff59){logger['error'](_0x1dff59);}return _0x483bd7[_0xd458('0x30')]('.')[0x0];});};exports[_0xd458('0x7d')]=function(_0x7f646a,_0xd6b8d2,_0x4392c4,_0x277a8f){var _0x353fb2=util[_0xd458('0x7b')](_0xd458('0x7e'),ISPEECH_API,_0xd6b8d2,_0x4392c4,base64Encode(_0x7f646a),_0x277a8f?util['format']('model=%s',encodeURIComponent(_0x277a8f)):_0xd458('0x7f'));return uploadFile(_0x353fb2)['then'](function(_0xa8a3d0){return querystring[_0xd458('0x80')](_0xa8a3d0);});};exports[_0xd458('0x81')]=function(_0x525e79,_0x4a0230){return sestek[_0xd458('0x82')](_0x525e79,_0x4a0230)[_0xd458('0x2d')](function(_0x220384){logger[_0xd458('0x1c')](JSON[_0xd458('0x5b')](_0x220384));var _0x21be2d={'speech':_0x220384[_0xd458('0x83')],'action':_0x220384['channelData']?_0x220384[_0xd458('0x84')][_0xd458('0x85')]:undefined,'actiondata':_0x220384['channelData']?_0x220384['channelData'][_0xd458('0x86')]:undefined};if(_0x220384['channelData']&&_0x220384[_0xd458('0x84')][_0xd458('0x87')]){return base64Decode(_0x220384['channelData'][_0xd458('0x87')][_0xd458('0x88')],path[_0xd458('0x29')](__dirname,_0xd458('0x3a'),rs[_0xd458('0x2a')](0x4)+_0xd458('0x2b')))[_0xd458('0x2d')](function(_0x5a1489){_0x21be2d[_0xd458('0x89')]=_0x5a1489;return _0x21be2d;});}return _0x21be2d;});};exports[_0xd458('0x8a')]=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 c9c5a9d..8d837f0 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 _0x7ef3=['./nda','exports'];(function(_0x485cc8,_0x3934cf){var _0x51b38b=function(_0x3f7944){while(--_0x3f7944){_0x485cc8['push'](_0x485cc8['shift']());}};_0x51b38b(++_0x3934cf);}(_0x7ef3,0x1a2));var _0x37ef=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x7ef3[_0x11005e];return _0x29338f;};var nda=require(_0x37ef('0x0'));module[_0x37ef('0x1')]={'nda':nda}; \ No newline at end of file +var _0x0819=['exports'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x0819,0x9d));var _0x9081=function(_0xf50d76,_0x1d8fb7){_0xf50d76=_0xf50d76-0x0;var _0x4eb3b1=_0x0819[_0xf50d76];return _0x4eb3b1;};var nda=require('./nda');module[_0x9081('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 3b7b58c..4238c33 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 _0x4ffe=['/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','project','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url'];(function(_0x3b8c8d,_0x18a4d3){var _0x140e8d=function(_0x597e87){while(--_0x597e87){_0x3b8c8d['push'](_0x3b8c8d['shift']());}};_0x140e8d(++_0x18a4d3);}(_0x4ffe,0x172));var _0xe4ff=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x4ffe[_0x2c0ded];return _0x4473e5;};'use strict';var rp=require(_0xe4ff('0x0'));var url=require(_0xe4ff('0x1'));var logger=require(_0xe4ff('0x2'))('agi');module[_0xe4ff('0x3')]=function(_0x13bb2f,_0x1ede19){var _0x52dbd6={'method':_0xe4ff('0x4'),'uri':url[_0xe4ff('0x5')](_0x1ede19[_0xe4ff('0x6')],_0xe4ff('0x7')),'form':{'grant_type':_0xe4ff('0x8'),'username':_0x1ede19['username'],'password':_0x1ede19[_0xe4ff('0x8')]},'json':!![]};return rp(_0x52dbd6)[_0xe4ff('0x9')](function(_0x227be1){var _0x2aa67c={'method':'POST','uri':url[_0xe4ff('0x5')](_0x1ede19['ndassistant_url'],_0xe4ff('0xa')),'body':{'type':_0x1ede19[_0xe4ff('0xb')]||_0xe4ff('0xc'),'channelId':_0xe4ff('0xd'),'conversation':{'id':_0x13bb2f['uniqueid']},'from':{'id':_0x13bb2f['callerid'],'name':_0x13bb2f[_0xe4ff('0xe')]},'recipient':{'id':_0x13bb2f[_0xe4ff('0xf')],'name':_0x13bb2f[_0xe4ff('0x10')]},'text':_0x1ede19[_0xe4ff('0x11')],'channelData':{}},'headers':{'Authorization':_0xe4ff('0x12')+_0x227be1[_0xe4ff('0x13')]},'json':!![]};if(_0x1ede19['project']){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')]['ProjectName']=_0x1ede19[_0xe4ff('0x16')];}if(_0x1ede19['ndagenerate_audio']=='1'){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe4ff('0x17')};}if(_0x1ede19[_0xe4ff('0x18')]){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')][_0xe4ff('0x19')]=_0x1ede19[_0xe4ff('0x18')];if(_0x1ede19['custom_action_data']){_0x2aa67c[_0xe4ff('0x14')][_0xe4ff('0x15')][_0xe4ff('0x1a')]=_0x1ede19[_0xe4ff('0x1b')];}}logger['info'](JSON[_0xe4ff('0x1c')](_0x2aa67c));return rp(_0x2aa67c);});}; \ No newline at end of file +var _0x1b73=['password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','info','url','../../../../../config/logger','agi','exports','POST','resolve','/token'];(function(_0x4d8ceb,_0x193d75){var _0xec568b=function(_0x437552){while(--_0x437552){_0x4d8ceb['push'](_0x4d8ceb['shift']());}};_0xec568b(++_0x193d75);}(_0x1b73,0x1d5));var _0x31b7=function(_0x4f824b,_0x2df4a8){_0x4f824b=_0x4f824b-0x0;var _0xc11e30=_0x1b73[_0x4f824b];return _0xc11e30;};'use strict';var rp=require('request-promise');var url=require(_0x31b7('0x0'));var logger=require(_0x31b7('0x1'))(_0x31b7('0x2'));module[_0x31b7('0x3')]=function(_0x4bf5ae,_0x17c0ef){var _0x59e606={'method':_0x31b7('0x4'),'uri':url[_0x31b7('0x5')](_0x17c0ef['ndauth_url'],_0x31b7('0x6')),'form':{'grant_type':_0x31b7('0x7'),'username':_0x17c0ef[_0x31b7('0x8')],'password':_0x17c0ef['password']},'json':!![]};return rp(_0x59e606)[_0x31b7('0x9')](function(_0x1a730f){var _0x86ef8e={'method':_0x31b7('0x4'),'uri':url[_0x31b7('0x5')](_0x17c0ef[_0x31b7('0xa')],_0x31b7('0xb')),'body':{'type':_0x17c0ef['ndaactivity_type']||_0x31b7('0xc'),'channelId':_0x31b7('0xd'),'conversation':{'id':_0x4bf5ae[_0x31b7('0xe')]},'from':{'id':_0x4bf5ae[_0x31b7('0xf')],'name':_0x4bf5ae[_0x31b7('0x10')]},'recipient':{'id':_0x4bf5ae[_0x31b7('0x11')],'name':_0x4bf5ae[_0x31b7('0x12')]},'text':_0x17c0ef[_0x31b7('0x13')],'channelData':{}},'headers':{'Authorization':_0x31b7('0x14')+_0x1a730f[_0x31b7('0x15')]},'json':!![]};if(_0x17c0ef['project']){_0x86ef8e[_0x31b7('0x16')][_0x31b7('0x17')][_0x31b7('0x18')]=_0x17c0ef[_0x31b7('0x19')];}if(_0x17c0ef[_0x31b7('0x1a')]=='1'){_0x86ef8e[_0x31b7('0x16')][_0x31b7('0x17')][_0x31b7('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x31b7('0x1c')};}if(_0x17c0ef['custom_action']){_0x86ef8e[_0x31b7('0x16')]['channelData'][_0x31b7('0x1d')]=_0x17c0ef[_0x31b7('0x1e')];if(_0x17c0ef['custom_action_data']){_0x86ef8e[_0x31b7('0x16')][_0x31b7('0x17')][_0x31b7('0x1f')]=_0x17c0ef[_0x31b7('0x20')];}}logger[_0x31b7('0x21')](JSON['stringify'](_0x86ef8e));return rp(_0x86ef8e);});}; \ 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 2719e88..0cbc16e 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 _0x0c92=['exports','./lib/api'];(function(_0x491c80,_0x5a7b1d){var _0x44447d=function(_0x669c80){while(--_0x669c80){_0x491c80['push'](_0x491c80['shift']());}};_0x44447d(++_0x5a7b1d);}(_0x0c92,0x183));var _0x20c9=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x0c92[_0x45fe9c];return _0x233d48;};'use strict';var asr=require(_0x20c9('0x0'));module[_0x20c9('0x1')]=function(_0x3c5856,_0xa04bdb,_0x530906,_0x5231e1){return asr(_0x3c5856,_0xa04bdb,_0x530906,_0x5231e1);}; \ No newline at end of file +var _0x2d9e=['exports'];(function(_0x305227,_0x146e56){var _0xae37e6=function(_0x497ea7){while(--_0x497ea7){_0x305227['push'](_0x305227['shift']());}};_0xae37e6(++_0x146e56);}(_0x2d9e,0x19e));var _0xe2d9=function(_0x38175c,_0x2de69b){_0x38175c=_0x38175c-0x0;var _0x1566ad=_0x2d9e[_0x38175c];return _0x1566ad;};'use strict';var asr=require('./lib/api');module[_0xe2d9('0x0')]=function(_0x5e2022,_0x19592f,_0x4550c1,_0x4152dd){return asr(_0x5e2022,_0x19592f,_0x4550c1,_0x4152dd);}; \ 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 fb53665..5b1bbd1 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 _0xf21d=['hypotheses','transcript','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','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','open','bluebird','moment','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x530567,_0x24721b){var _0xa0898b=function(_0x28c4f9){while(--_0x28c4f9){_0x530567['push'](_0x530567['shift']());}};_0xa0898b(++_0x24721b);}(_0xf21d,0x1ed));var _0xdf21=function(_0x1d0285,_0x5b3746){_0x1d0285=_0x1d0285-0x0;var _0x1a03f8=_0xf21d[_0x1d0285];return _0x1a03f8;};'use strict';var BPromise=require(_0xdf21('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xdf21('0x1'));var crypto=require('crypto');var logger=require(_0xdf21('0x2'))(_0xdf21('0x3'));module[_0xdf21('0x4')]=function(_0x1b3cca,_0x466f50,_0x33c995,_0x2c7f97){return new BPromise(function(_0x2094aa,_0x14e676){logger[_0xdf21('0x5')](_0xdf21('0x6'),_0x2c7f97||_0xdf21('0x7'));var _0x19def8=new WebSocket(_0x2c7f97||_0xdf21('0x7'),{'perMessageDeflate':![]});var _0x3fe666='';var _0x4c22dc='0';var _0x17d732='1';var _0x4cb5b3='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x3a3ce5(_0x5cfbc8){var _0x514a72=crypto[_0xdf21('0x8')]('sha1');_0x514a72[_0xdf21('0x9')](_0x5cfbc8);return _0x514a72[_0xdf21('0xa')](_0xdf21('0xb'));}function _0x5beda1(){try{logger[_0xdf21('0x5')](_0xdf21('0xc'));var _0x4031ef=moment()[_0xdf21('0xd')]();var _0x50378d=_0x3a3ce5(_0x4031ef+_0x466f50+_0x33c995);_0x19def8[_0xdf21('0xe')](JSON[_0xdf21('0xf')]({'appID':_0x466f50,'timestamp':_0x4031ef,'appKey':_0x50378d}));var _0x4fdf0b=fs[_0xdf21('0x10')](_0x1b3cca);_0x4fdf0b['on']('data',function(_0xbc11a4){_0x19def8[_0xdf21('0xe')](_0xbc11a4);});_0x4fdf0b['on'](_0xdf21('0x11'),function(){_0x19def8[_0xdf21('0xe')]('EOS');});}catch(_0x31f32e){logger['error'](_0xdf21('0x12'),JSON[_0xdf21('0xf')](_0x31f32e));_0x19def8[_0xdf21('0x13')]();}}function _0x266a41(_0x6b3b1a){try{if(_0x6b3b1a){var _0x44cef4=JSON[_0xdf21('0x14')](_0x6b3b1a);switch(_0x44cef4[_0xdf21('0x15')]){case 0x0:if(_0x44cef4[_0xdf21('0x16')]){if(_0x44cef4[_0xdf21('0x16')][_0xdf21('0x17')]){logger['info'](_0xdf21('0x18'),JSON['stringify'](_0x44cef4[_0xdf21('0x16')][_0xdf21('0x19')]));_0x3fe666=_0x44cef4[_0xdf21('0x16')][_0xdf21('0x19')][0x0][_0xdf21('0x1a')];_0x4c22dc=_0x44cef4[_0xdf21('0x16')][_0xdf21('0x19')][0x0]['likelihood'];_0x17d732='0';_0x4cb5b3=_0xdf21('0x1b');_0x19def8[_0xdf21('0x13')]();}}break;case 0x1:logger[_0xdf21('0x5')](_0xdf21('0x1c'));_0x17d732='1';_0x4cb5b3=_0xdf21('0x1c');break;case 0x2:logger['info'](_0xdf21('0x1d'));_0x17d732='2';_0x4cb5b3=_0xdf21('0x1d');break;case 0x9:logger['info'](_0xdf21('0x1e'));_0x17d732='9';_0x4cb5b3=_0xdf21('0x1e');break;case 0xa:logger[_0xdf21('0x5')]('Authentication\x20failed.');_0x17d732='10';_0x4cb5b3='Authentication\x20failed.';break;case 0xb:logger[_0xdf21('0x5')](_0xdf21('0x1f'));_0x17d732='11';_0x4cb5b3=_0xdf21('0x1f');}}}catch(_0x4bcbb3){logger[_0xdf21('0x20')](_0xdf21('0x21'),JSON[_0xdf21('0xf')](_0x4bcbb3));_0x19def8[_0xdf21('0x13')]();}}function _0x292aed(){logger[_0xdf21('0x5')](_0xdf21('0x22'));_0x2094aa({'transcript':_0x3fe666,'confidence':_0x4c22dc,'status':_0x17d732,'status_message':_0x4cb5b3});}function _0x13c77b(_0x556576){logger[_0xdf21('0x20')](_0xdf21('0x23'));if(!_['isNil'](_0x556576)){logger[_0xdf21('0x20')](_['isObject'](_0x556576)?JSON[_0xdf21('0xf')](_0x556576):_0x556576);}}_0x19def8['on'](_0xdf21('0x24'),_0x5beda1);_0x19def8['on']('message',_0x266a41);_0x19def8['on'](_0xdf21('0x11'),_0x292aed);_0x19def8['on'](_0xdf21('0x20'),_0x13c77b);});}; \ No newline at end of file +var _0xeb7f=['sha1','update','hex','unix','send','createReadStream','data','error','stringify','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','isObject','open','message','close','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash'];(function(_0x352160,_0x3410f3){var _0x2f43ea=function(_0x3d1166){while(--_0x3d1166){_0x352160['push'](_0x352160['shift']());}};_0x2f43ea(++_0x3410f3);}(_0xeb7f,0x100));var _0xfeb7=function(_0x17ca2b,_0x505718){_0x17ca2b=_0x17ca2b-0x0;var _0x410423=_0xeb7f[_0x17ca2b];return _0x410423;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xfeb7('0x0'));var crypto=require(_0xfeb7('0x1'));var logger=require(_0xfeb7('0x2'))('agi');module[_0xfeb7('0x3')]=function(_0x1c44e2,_0x501149,_0x9974c6,_0x4c7896){return new BPromise(function(_0x4531cd,_0x41f5c0){logger[_0xfeb7('0x4')](_0xfeb7('0x5'),_0x4c7896||_0xfeb7('0x6'));var _0x59201d=new WebSocket(_0x4c7896||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4c071e='';var _0x5776d6='0';var _0x2fe35b='1';var _0x59d954='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x53767b(_0x10d2dc){var _0x416e14=crypto[_0xfeb7('0x7')](_0xfeb7('0x8'));_0x416e14[_0xfeb7('0x9')](_0x10d2dc);return _0x416e14['digest'](_0xfeb7('0xa'));}function _0x5a98c7(){try{logger[_0xfeb7('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x27c16d=moment()[_0xfeb7('0xb')]();var _0x4f8f21=_0x53767b(_0x27c16d+_0x501149+_0x9974c6);_0x59201d[_0xfeb7('0xc')](JSON['stringify']({'appID':_0x501149,'timestamp':_0x27c16d,'appKey':_0x4f8f21}));var _0x2e2ec7=fs[_0xfeb7('0xd')](_0x1c44e2);_0x2e2ec7['on'](_0xfeb7('0xe'),function(_0x5a550c){_0x59201d[_0xfeb7('0xc')](_0x5a550c);});_0x2e2ec7['on']('close',function(){_0x59201d[_0xfeb7('0xc')]('EOS');});}catch(_0x20de88){logger[_0xfeb7('0xf')]('Tilde\x20ASR\x20send\x20error',JSON[_0xfeb7('0x10')](_0x20de88));_0x59201d[_0xfeb7('0x11')]();}}function _0x22e766(_0x1e1cbc){try{if(_0x1e1cbc){var _0x4e0f03=JSON['parse'](_0x1e1cbc);switch(_0x4e0f03[_0xfeb7('0x12')]){case 0x0:if(_0x4e0f03['result']){if(_0x4e0f03[_0xfeb7('0x13')]['final']){logger[_0xfeb7('0x4')](_0xfeb7('0x14'),JSON['stringify'](_0x4e0f03[_0xfeb7('0x13')]['hypotheses']));_0x4c071e=_0x4e0f03[_0xfeb7('0x13')][_0xfeb7('0x15')][0x0][_0xfeb7('0x16')];_0x5776d6=_0x4e0f03[_0xfeb7('0x13')][_0xfeb7('0x15')][0x0][_0xfeb7('0x17')];_0x2fe35b='0';_0x59d954=_0xfeb7('0x18');_0x59201d['terminate']();}}break;case 0x1:logger['info'](_0xfeb7('0x19'));_0x2fe35b='1';_0x59d954=_0xfeb7('0x19');break;case 0x2:logger[_0xfeb7('0x4')](_0xfeb7('0x1a'));_0x2fe35b='2';_0x59d954=_0xfeb7('0x1a');break;case 0x9:logger['info'](_0xfeb7('0x1b'));_0x2fe35b='9';_0x59d954=_0xfeb7('0x1b');break;case 0xa:logger[_0xfeb7('0x4')](_0xfeb7('0x1c'));_0x2fe35b='10';_0x59d954=_0xfeb7('0x1c');break;case 0xb:logger[_0xfeb7('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2fe35b='11';_0x59d954='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x541084){logger[_0xfeb7('0xf')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xfeb7('0x10')](_0x541084));_0x59201d[_0xfeb7('0x11')]();}}function _0x58e2f2(){logger[_0xfeb7('0x4')]('Close\x20Tilde\x20ASR\x20socket');_0x4531cd({'transcript':_0x4c071e,'confidence':_0x5776d6,'status':_0x2fe35b,'status_message':_0x59d954});}function _0x532d28(_0x2ff66a){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x2ff66a)){logger[_0xfeb7('0xf')](_[_0xfeb7('0x1d')](_0x2ff66a)?JSON[_0xfeb7('0x10')](_0x2ff66a):_0x2ff66a);}}_0x59201d['on'](_0xfeb7('0x1e'),_0x5a98c7);_0x59201d['on'](_0xfeb7('0x1f'),_0x22e766);_0x59201d['on'](_0xfeb7('0x20'),_0x58e2f2);_0x59201d['on']('error',_0x532d28);});}; \ 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 99ef235..b0dd5d6 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 _0x6fc9=['./asr'];(function(_0xfbc402,_0x5185fb){var _0x331507=function(_0x49db27){while(--_0x49db27){_0xfbc402['push'](_0xfbc402['shift']());}};_0x331507(++_0x5185fb);}(_0x6fc9,0x120));var _0x96fc=function(_0x3bff58,_0x40b1da){_0x3bff58=_0x3bff58-0x0;var _0x4d722d=_0x6fc9[_0x3bff58];return _0x4d722d;};var asr=require(_0x96fc('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xd48d=['./asr','exports'];(function(_0x2b65af,_0x3e54d9){var _0x183d7f=function(_0x377fe1){while(--_0x377fe1){_0x2b65af['push'](_0x2b65af['shift']());}};_0x183d7f(++_0x3e54d9);}(_0xd48d,0x124));var _0xdd48=function(_0x12cbdb,_0x5b6318){_0x12cbdb=_0x12cbdb-0x0;var _0x1fb2f2=_0xd48d[_0x12cbdb];return _0x1fb2f2;};var asr=require(_0xdd48('0x0'));module[_0xdd48('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5eecc20..5d50561 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 _0x2ea1=['E_AGI_SERVER_CLOSE','nextTick','inherits','util','events','EventEmitter','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close'];(function(_0x45631b,_0x4f8c38){var _0x37e583=function(_0x2dde63){while(--_0x2dde63){_0x45631b['push'](_0x45631b['shift']());}};_0x37e583(++_0x4f8c38);}(_0x2ea1,0xe9));var _0x12ea=function(_0xc0ee18,_0x2411e3){_0xc0ee18=_0xc0ee18-0x0;var _0x592ebd=_0x2ea1[_0xc0ee18];return _0x592ebd;};'use strict';var util=require(_0x12ea('0x0'));var net=require('net');var EventEmitter=require(_0x12ea('0x1'))[_0x12ea('0x2')];var AGIError=require(_0x12ea('0x3'));var AGIChannel=require(_0x12ea('0x4'));var AGIServer=function(_0x2e7046,_0x1806e5,_0x3e52af){var _0x6a297f=this,_0x2e7046=_0x2e7046||0x11dd,_0x1806e5=_0x1806e5||_0x12ea('0x5'),_0x35ad29=null,_0xc89bca=0x0;EventEmitter[_0x12ea('0x6')](_0x6a297f);function _0xfcf152(){if(!_0x2e7046){_0x6a297f['emit'](_0x12ea('0x7'),new AGIError(_0x12ea('0x8')));return![];}_0x35ad29=net[_0x12ea('0x9')]();_0x35ad29['listen'](_0x2e7046,_0x1806e5);_0x35ad29['on'](_0x12ea('0xa'),function(){_0x6a297f[_0x12ea('0xb')]('listening');});_0x35ad29['on'](_0x12ea('0xc'),function(_0x408ec1){_0x35ad29[_0x12ea('0xd')](function(_0xf44d4,_0x499e6c){if(_0xf44d4){_0x6a297f['emit'](_0x12ea('0x7'),new AGIError(_0x12ea('0xe'),_0xf44d4));}else if(_0x3e52af&&_0x3e52af<0x0){_0x6a297f[_0x12ea('0xb')](_0x12ea('0x7'),new AGIError(_0x12ea('0xf')));_0x408ec1[_0x12ea('0x10')]();}else if(_0x3e52af&&_0x3e52af>0x0&&_0x3e52af<_0x499e6c){_0xc89bca+=0x1;_0x6a297f[_0x12ea('0xb')](_0x12ea('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0xc89bca));_0x408ec1[_0x12ea('0x10')]();}else{var _0x2cfc1f=new AGIChannel(_0x408ec1);_0x2cfc1f['on'](_0x12ea('0x11'),function(){_0x6a297f[_0x12ea('0xb')](_0x12ea('0xc'),_0x2cfc1f);});}});});_0x35ad29['on']('error',function(_0x4e85ce){_0x6a297f['emit'](_0x12ea('0x7'),new AGIError(_0x12ea('0xe'),_0x4e85ce[_0x12ea('0x12')]));});_0x35ad29['on'](_0x12ea('0x13'),function(){_0x6a297f[_0x12ea('0xb')](_0x12ea('0x13'),new AGIError(_0x12ea('0x14')));});}process[_0x12ea('0x15')](function(){_0xfcf152();});};util[_0x12ea('0x16')](AGIServer,EventEmitter);module['exports']=function(_0x438765,_0x4c92d9,_0x35aa49){return new AGIServer(_0x438765,_0x4c92d9,_0x35aa49);}; \ No newline at end of file +var _0x0a88=['close','E_AGI_SERVER_CLOSE','inherits','exports','util','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','ready','connection','code'];(function(_0x560f6f,_0x40c513){var _0x1a5819=function(_0x5363ce){while(--_0x5363ce){_0x560f6f['push'](_0x560f6f['shift']());}};_0x1a5819(++_0x40c513);}(_0x0a88,0x1b9));var _0x80a8=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x0a88[_0x4709c8];return _0x478cdd;};'use strict';var util=require(_0x80a8('0x0'));var net=require('net');var EventEmitter=require(_0x80a8('0x1'))[_0x80a8('0x2')];var AGIError=require(_0x80a8('0x3'));var AGIChannel=require(_0x80a8('0x4'));var AGIServer=function(_0x547da6,_0x1fa091,_0x66d76b){var _0x56f6e3=this,_0x547da6=_0x547da6||0x11dd,_0x1fa091=_0x1fa091||_0x80a8('0x5'),_0x4177d0=null,_0x1e7558=0x0;EventEmitter[_0x80a8('0x6')](_0x56f6e3);function _0x43d112(){if(!_0x547da6){_0x56f6e3[_0x80a8('0x7')](_0x80a8('0x8'),new AGIError(_0x80a8('0x9')));return![];}_0x4177d0=net[_0x80a8('0xa')]();_0x4177d0[_0x80a8('0xb')](_0x547da6,_0x1fa091);_0x4177d0['on'](_0x80a8('0xc'),function(){_0x56f6e3[_0x80a8('0x7')](_0x80a8('0xc'));});_0x4177d0['on']('connection',function(_0x1f5f41){_0x4177d0[_0x80a8('0xd')](function(_0x53c09c,_0x44ab8c){if(_0x53c09c){_0x56f6e3[_0x80a8('0x7')](_0x80a8('0x8'),new AGIError(_0x80a8('0xe'),_0x53c09c));}else if(_0x66d76b&&_0x66d76b<0x0){_0x56f6e3[_0x80a8('0x7')](_0x80a8('0x8'),new AGIError(_0x80a8('0xf')));_0x1f5f41['destroy']();}else if(_0x66d76b&&_0x66d76b>0x0&&_0x66d76b<_0x44ab8c){_0x1e7558+=0x1;_0x56f6e3[_0x80a8('0x7')](_0x80a8('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x1e7558));_0x1f5f41['destroy']();}else{var _0x337fe2=new AGIChannel(_0x1f5f41);_0x337fe2['on'](_0x80a8('0x10'),function(){_0x56f6e3[_0x80a8('0x7')](_0x80a8('0x11'),_0x337fe2);});}});});_0x4177d0['on'](_0x80a8('0x8'),function(_0x22f079){_0x56f6e3[_0x80a8('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x22f079[_0x80a8('0x12')]));});_0x4177d0['on'](_0x80a8('0x13'),function(){_0x56f6e3['emit'](_0x80a8('0x13'),new AGIError(_0x80a8('0x14')));});}process['nextTick'](function(){_0x43d112();});};util[_0x80a8('0x15')](AGIServer,EventEmitter);module[_0x80a8('0x16')]=function(_0x17b21d,_0x32e498,_0x1c2058){return new AGIServer(_0x17b21d,_0x32e498,_0x1c2058);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 2db36fe..e40ccfb 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 _0x2355=['test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','NOBEEP','intKey','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','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','key','beep','ispeech\x20%s\x20file\x20created','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','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','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','Smtp','user','bcc','subject','service','host','port','secure','auth','pass','sendMail\x20message','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','lodash','shelljs','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','mailRpc','getIntervals','IntervalId','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','toString','getPause','getPauseById','agentPause','agent','callerid','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','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','computedVariables','render','url','stringify','statusCode','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_secret_access_key','aws_bot_name','google_asr_language','tildeASR','appid','appsecret','uri','clear','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','isPlainObject','saveRestApiResult','%s.%s','length','setVariable','split','result','extra','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','add','delay','callback_priority','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','SIP/%s','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit'];(function(_0x53ca2e,_0x4cde73){var _0x45069d=function(_0x3d6c76){while(--_0x3d6c76){_0x53ca2e['push'](_0x53ca2e['shift']());}};_0x45069d(++_0x4cde73);}(_0x2355,0xb4));var _0x5235=function(_0x4c219d,_0x512ea4){_0x4c219d=_0x4c219d-0x0;var _0x3bdef5=_0x2355[_0x4c219d];return _0x3bdef5;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x5235('0x0'));var _=require(_0x5235('0x1'));var sh=require(_0x5235('0x2'));var odbc=require('odbc')();var rs=require(_0x5235('0x3'));var moment=require(_0x5235('0x4'));var Mustache=require(_0x5235('0x5'));var rp=require(_0x5235('0x6'));var logger=require('../../config/logger')(_0x5235('0x7'));var config=require(_0x5235('0x8'));var scripts=require(_0x5235('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x5235('0xa'),_0x5235('0xb')];var verticesWithRetry=[_0x5235('0xc'),_0x5235('0xd'),_0x5235('0xe')];var AGIVertices=function(_0x26a186,_0x54617c,_0x41834c){this['channel']=_0x26a186;this[_0x5235('0xf')]=_0x54617c;this['mailRpc']=_0x41834c;};AGIVertices[_0x5235('0x10')][_0x5235('0x11')]=function(_0x432943,_0x452e9e){this[_0x5235('0xf')]['getVariableById'](_0x432943)[_0x5235('0x12')](function(_0x7ef1f5){_0x452e9e(null,_0x7ef1f5?_0x7ef1f5[_0x5235('0x13')]:![]);})[_0x5235('0x14')](function(_0x44026b){_0x452e9e(_0x44026b);});};AGIVertices[_0x5235('0x10')][_0x5235('0x15')]=function(_0x92d4f3,_0x4076b1){this[_0x5235('0xf')][_0x5235('0x16')](_0x92d4f3)[_0x5235('0x12')](function(_0x5607c5){_0x4076b1(null,_0x5607c5?_0x5607c5['name']:![]);})[_0x5235('0x14')](function(_0x1fea07){_0x4076b1(_0x1fea07);});};AGIVertices[_0x5235('0x10')][_0x5235('0x17')]=function(_0x14d32b,_0x53eb3f){this[_0x5235('0xf')]['getSquareProjectById'](_0x14d32b)[_0x5235('0x12')](function(_0x1d965e){_0x53eb3f(null,_0x1d965e?_0x1d965e[_0x5235('0x13')]:![]);})[_0x5235('0x14')](function(_0x90462d){_0x53eb3f(_0x90462d);});};AGIVertices[_0x5235('0x10')][_0x5235('0x18')]=function(_0x128feb,_0x3d5520){this[_0x5235('0xf')][_0x5235('0x19')](_0x128feb)[_0x5235('0x12')](function(_0x2a0b25){_0x3d5520(null,_0x2a0b25?_0x2a0b25[_0x5235('0x1a')]:![]);})[_0x5235('0x14')](function(_0x24bc39){_0x3d5520(_0x24bc39);});};AGIVertices[_0x5235('0x10')][_0x5235('0x1b')]=function(_0x7c4a56,_0x2ec5da){this['rpc'][_0x5235('0x1c')](_0x7c4a56)[_0x5235('0x12')](function(_0x2cb768){_0x2ec5da(null,_0x2cb768?_0x2cb768[_0x5235('0x13')]:![]);})[_0x5235('0x14')](function(_0x2d3c79){_0x2ec5da(_0x2d3c79);});};AGIVertices[_0x5235('0x10')]['getTrunk']=function(_0xca5231,_0x36c13d){this[_0x5235('0xf')][_0x5235('0x1d')](_0xca5231)['then'](function(_0x413528){_0x36c13d(null,_0x413528?_0x413528['name']:![]);})['catch'](function(_0x278381){_0x36c13d(_0x278381);});};AGIVertices[_0x5235('0x10')][_0x5235('0x1e')]=function(_0x186ae7,_0x411ab3){var _0x520bb5=this;this['rpc'][_0x5235('0x1f')](_0x186ae7)[_0x5235('0x12')](function(_0x4cad85){_0x411ab3(null,_0x4cad85?_0x520bb5[_0x5235('0x20')](_0x4cad85[_0x5235('0x21')]):![]);})['catch'](function(_0x267881){_0x411ab3(_0x267881);});};AGIVertices['prototype'][_0x5235('0x22')]=function(_0x563c9f,_0x11455b){this['rpc'][_0x5235('0x23')](_0x563c9f)[_0x5235('0x12')](function(_0x13b9d0){_0x11455b(null,_0x13b9d0?_0x13b9d0:![]);})[_0x5235('0x14')](function(_0x288bc6){_0x11455b(_0x288bc6);});};AGIVertices[_0x5235('0x10')]['sendMailMessage']=function(_0x5decb5,_0x22471b,_0x5d09d2){this[_0x5235('0x24')]['sendMailMessage'](_0x5decb5,_0x22471b)['then'](function(){_0x5d09d2(null);})[_0x5235('0x14')](function(_0xb5d4f8){_0x5d09d2(_0xb5d4f8);});};AGIVertices[_0x5235('0x10')][_0x5235('0x25')]=function(_0xb357fd,_0x2d92b1){this[_0x5235('0xf')]['getIntervalById'](_0xb357fd)['then'](function(_0x4f82a2){if(_0x4f82a2){if(_0x4f82a2[_0x5235('0x26')]){_0x2d92b1(null,[_0x4f82a2[_0x5235('0x27')]]);}else{_0x2d92b1(null,_['map'](_0x4f82a2[_0x5235('0x28')],_0x5235('0x27')));}}else{_0x2d92b1(null,![]);}})['catch'](function(_0x399aed){_0x2d92b1(_0x399aed);});};AGIVertices[_0x5235('0x10')][_0x5235('0x20')]=function(_0x22100b){return util['format'](_0x5235('0x29'),FILES_PATH,_0x22100b);};AGIVertices[_0x5235('0x10')][_0x5235('0x2a')]=function(_0xb684f3,_0x58ea3e,_0xb00fa3){odbc[_0x5235('0x2b')](_0xb684f3,function(_0x58c25f){if(_0x58c25f){logger[_0x5235('0x2c')](_0x5235('0x2d'),_0x58c25f);_0xb00fa3(_0x58c25f);}else{logger[_0x5235('0x2e')](_0x5235('0x2f'));odbc[_0x5235('0x30')](_0x58ea3e,function(_0x1a7744,_0x5cca91){if(_0x1a7744){logger[_0x5235('0x2e')]('Error\x20executing\x20query\x20%s',_0x58ea3e);_0xb00fa3(_0x1a7744);}else{logger[_0x5235('0x2e')](_0x5235('0x31'),_0x58ea3e);odbc[_0x5235('0x32')](function(_0x90e8bb){if(_0x90e8bb){logger[_0x5235('0x2c')](_0x5235('0x33'),_0x90e8bb);}_0xb00fa3(null,_0x5cca91);});}});}});};AGIVertices['prototype'][_0x5235('0x34')]=function(_0x38becd,_0x3263f5){this[_0x5235('0xf')]['getSmsAccountById'](_0x38becd)['then'](function(_0x27bcb9){_0x3263f5(null,_0x27bcb9?_0x27bcb9:![]);})[_0x5235('0x14')](function(_0x225739){_0x3263f5(_0x225739);});};AGIVertices[_0x5235('0x10')][_0x5235('0x35')]=function(_0x211236,_0x24a4fc){this[_0x5235('0xf')][_0x5235('0x35')](_0x211236)['then'](function(_0x4dffbf){_0x24a4fc(null,_0x4dffbf);})[_0x5235('0x14')](function(_0x289e8a){_0x24a4fc(_0x289e8a);});};AGIVertices['prototype'][_0x5235('0x36')]=function(_0x175f50,_0x52fcdd,_0x1f8918){this[_0x5235('0xf')][_0x5235('0x36')]({'uniqueid':this[_0x5235('0x37')][_0x5235('0x38')],'node':_0x175f50[_0x5235('0x39')],'application':_0x175f50[_0x5235('0x3a')],'data':_0x52fcdd||null,'project_name':this[_0x5235('0x37')][_0x5235('0x3b')],'callerid':this['channel']['callerid']})[_0x5235('0x12')](function(_0x282e80){if(_0x1f8918){_0x1f8918(null,_0x282e80);}})[_0x5235('0x14')](function(_0x33882d){if(_0x1f8918){_0x1f8918(_0x33882d);}});};AGIVertices[_0x5235('0x10')][_0x5235('0x3c')]=function(_0x705771,_0xe1460e,_0x173424,_0x28b412){this[_0x5235('0xf')][_0x5235('0x3c')]({'uniqueid':this[_0x5235('0x37')][_0x5235('0x38')],'callerid':this['channel']['callerid'],'calleridname':this[_0x5235('0x37')][_0x5235('0x3d')],'context':this[_0x5235('0x37')][_0x5235('0x3e')],'extension':this['channel']['extension'],'priority':this['channel'][_0x5235('0x3f')],'accountcode':this[_0x5235('0x37')][_0x5235('0x40')],'dnid':this[_0x5235('0x37')][_0x5235('0x41')],'projectName':this[_0x5235('0x37')][_0x5235('0x3b')],'saveName':_0xe1460e,'filename':_0x705771[_0x5235('0x42')]||_0xe1460e,'savePath':_0x173424})[_0x5235('0x12')](function(_0x29e1db){_0x28b412(null,_0x29e1db);})['catch'](function(_0x450348){_0x28b412(_0x450348);});};AGIVertices['prototype']['createSquareMessage']=function(_0x8d365d,_0x476e28,_0x2054dc,_0x5ea124,_0x12aa58){this[_0x5235('0xf')][_0x5235('0x43')]({'uniqueid':this[_0x5235('0x37')][_0x5235('0x38')],'body':_0x8d365d,'direction':_0x476e28,'providerName':_0x2054dc,'providerResponse':_0x5ea124})[_0x5235('0x12')](function(_0x541d10){if(_0x12aa58){_0x12aa58(null,_0x541d10);}})[_0x5235('0x14')](function(_0x3199c0){if(_0x12aa58){_0x12aa58(_0x3199c0);}});};AGIVertices[_0x5235('0x10')][_0x5235('0x44')]=function(_0x255491,_0x24a169){this[_0x5235('0xf')]['createCmContact']({'firstName':_['isEmpty'](_0x255491[_0x5235('0x13')])||_[_0x5235('0x45')](_0x255491[_0x5235('0x13')])?_0x5235('0x46')+Math[_0x5235('0x47')]():_0x255491[_0x5235('0x13')],'lastName':_[_0x5235('0x48')](_0x255491[_0x5235('0x49')])||_['isNil'](_0x255491[_0x5235('0x49')])?null:_0x255491[_0x5235('0x49')],'phone':_0x255491[_0x5235('0x4a')],'ListId':_0x255491[_0x5235('0x4b')],'scheduledat':_0x255491[_0x5235('0x4c')],'callbackUniqueid':this[_0x5235('0x37')][_0x5235('0x38')],'tags':_0x5235('0x4d'),'description':'Callback\x20scheduled\x20at\x20'+_0x255491[_0x5235('0x4c')][_0x5235('0x4e')](),'priority':_0x255491['callback_priority']})[_0x5235('0x12')](function(_0x582adb){_0x24a169(null,_0x582adb);})[_0x5235('0x14')](function(_0x1115f5){_0x24a169(_0x1115f5);});};AGIVertices['prototype'][_0x5235('0x4f')]=function(_0xdf30ab,_0xa3ef4e){this[_0x5235('0xf')][_0x5235('0x50')](_0xdf30ab)[_0x5235('0x12')](function(_0x104e50){_0xa3ef4e(null,_0x104e50?_0x104e50[_0x5235('0x13')]:![]);})['catch'](function(_0x3cdf2d){_0xa3ef4e(_0x3cdf2d);});};AGIVertices[_0x5235('0x10')][_0x5235('0x51')]=function(_0xa8ea1,_0x486969,_0x1ddc99){var _0x61ced2={'role':_0x5235('0x52')};_0x61ced2[_0xa8ea1]=this[_0x5235('0x37')][_0x5235('0x53')];this[_0x5235('0xf')][_0x5235('0x51')](_0x61ced2,_0x486969,this['channel'][_0x5235('0x38')])['then'](function(_0x3e7509){_0x1ddc99(null,_[_0x5235('0x45')](_0x3e7509)?![]:!![]);})[_0x5235('0x14')](function(_0xfaec69){logger[_0x5235('0x2c')](_0xfaec69);_0x1ddc99(null,![]);});};AGIVertices[_0x5235('0x10')][_0x5235('0x54')]=function(_0x3a6b1d,_0x1bba84){var _0x2f72bf={'role':_0x5235('0x52')};_0x2f72bf[_0x3a6b1d]=this[_0x5235('0x37')][_0x5235('0x53')];this[_0x5235('0xf')]['agentUnpause'](_0x2f72bf)['then'](function(_0x290eb6){_0x1bba84(null,_['isNil'](_0x290eb6)?![]:!![]);})['catch'](function(_0x35a176){logger['error'](_0x35a176);_0x1bba84(null,![]);});};AGIVertices[_0x5235('0x10')][_0x5235('0x55')]=function(_0x41c533,_0x3ea815){var _0x219f17={'role':_0x5235('0x52')};_0x219f17[_0x41c533]=this[_0x5235('0x37')][_0x5235('0x53')];this[_0x5235('0xf')][_0x5235('0x55')](_0x219f17)[_0x5235('0x12')](function(_0x11501c){_0x3ea815(null,_[_0x5235('0x45')](_0x11501c)?![]:!![]);})[_0x5235('0x14')](function(_0x2628e2){logger['error'](_0x2628e2);_0x3ea815(null,![]);});};AGIVertices[_0x5235('0x10')][_0x5235('0x56')]=function(_0x1200b0,_0xfae4aa){var _0x3c4160={'role':_0x5235('0x52')};_0x3c4160[_0x1200b0]=this[_0x5235('0x37')]['callerid'];var _0x1a1ced=_0x1200b0!=_0x5235('0x57')?util[_0x5235('0x58')]('%s/%s@from-sip/n',_0x5235('0x59'),this[_0x5235('0x37')]['callerid']):undefined;this[_0x5235('0xf')][_0x5235('0x56')](_0x3c4160,_0x1a1ced)[_0x5235('0x12')](function(_0x26efee){_0xfae4aa(null,_[_0x5235('0x45')](_0x26efee)?![]:!![]);})[_0x5235('0x14')](function(_0x5e6250){logger[_0x5235('0x2c')](_0x5e6250);_0xfae4aa(null,![]);});};AGIVertices[_0x5235('0x10')][_0x5235('0x5a')]=function(_0x2e3730,_0x5c0a34){sh['exec'](_[_0x5235('0x5b')](_0x2e3730),function(_0x1432c9,_0x577e80){var _0x182ca4=_0x577e80[_0x5235('0x5c')](/(\r\n|\n|\r)/gm,'');_0x5c0a34(null,_0x182ca4);});};AGIVertices[_0x5235('0x10')][_0x5235('0x5d')]=function(_0x3d17ec,_0x47dcfb){scripts[_0x5235('0x5d')](_0x3d17ec[_0x5235('0x5e')],_0x3d17ec[_0x5235('0x5f')]||_0x5235('0x60'),_0x3d17ec[_0x5235('0x60')],_0x3d17ec[_0x5235('0x61')]||'en-US',_0x3d17ec['ssmlGender']||_0x5235('0x62'),_0x3d17ec[_0x5235('0x63')]||_0x5235('0x64'))['then'](function(_0x3a6a1a){_0x47dcfb(null,_0x3a6a1a);})[_0x5235('0x14')](function(_0x5b843e){_0x47dcfb(_0x5b843e);});};AGIVertices['prototype'][_0x5235('0x65')]=function(_0x1ea9ba,_0x3de4d5){scripts[_0x5235('0x65')](_0x1ea9ba[_0x5235('0x60')],_0x1ea9ba[_0x5235('0x66')]||'en',0x1)[_0x5235('0x12')](function(_0x524643){_0x3de4d5(null,_0x524643);})[_0x5235('0x14')](function(_0x442571){_0x3de4d5(_0x442571);});};AGIVertices['prototype'][_0x5235('0x67')]=function(_0x39b314,_0x5b3a9a){var _0x3ed549={'uri':_0x39b314['url'],'method':_0x39b314[_0x5235('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x39b314[_0x5235('0x69')])===_0x5235('0x6a')&&parseInt(_0x39b314[_0x5235('0x69')])>=0x1?parseInt(_0x39b314['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x5235('0x6b')]([_0x5235('0x6c'),'PUT'],_0x3ed549[_0x5235('0x68')][_0x5235('0x6d')]())){try{_0x3ed549[_0x5235('0x6e')]=_0x39b314[_0x5235('0xb')]?JSON[_0x5235('0x6f')](_0x39b314[_0x5235('0xb')]):{};}catch(_0x2b4c5b){logger[_0x5235('0x2c')](_0x5235('0x70'),_0x2b4c5b);}}try{_0x3ed549[_0x5235('0x71')]=_0x39b314[_0x5235('0xa')]?JSON['parse'](_0x39b314['rawHeaders']):{};}catch(_0x167e83){logger[_0x5235('0x2c')](_0x5235('0x72'),_0x167e83);}if(_0x39b314[_0x5235('0x73')]){try{var _0x5cf54c=require(_0x39b314[_0x5235('0x73')])['sync'](this,_0x3ed549);_0x3ed549['uri']=Mustache[_0x5235('0x74')](_0x39b314[_0x5235('0x75')],_0x5cf54c,{},['$$','$$']);if(_0x3ed549[_0x5235('0x71')]){_0x3ed549['headers']=JSON[_0x5235('0x6f')](Mustache['render'](JSON[_0x5235('0x76')](_0x3ed549[_0x5235('0x71')]),_0x5cf54c,{},['$$','$$']));}if(_0x3ed549[_0x5235('0x6e')]){_0x3ed549[_0x5235('0x6e')]=JSON['parse'](Mustache['render'](JSON[_0x5235('0x76')](_0x3ed549[_0x5235('0x6e')]),_0x5cf54c,{},['$$','$$']));}}catch(_0x40f1cf){logger[_0x5235('0x2c')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x40f1cf);}}rp(_0x3ed549)[_0x5235('0x12')](function(_0x399e71){var _0x1580f4={'statusCode':_0x399e71[_0x5235('0x77')]||0xc8,'statusMessage':_0x399e71['statusMessage']||'OK','headers':_0x399e71[_0x5235('0x71')]||{},'body':_0x399e71[_0x5235('0x6e')]||{}};_0x5b3a9a(null,_0x1580f4);})[_0x5235('0x14')](function(_0x45e506){var _0x25d978={'statusCode':_0x45e506['statusCode']||0x1f4,'statusMessage':_0x45e506[_0x5235('0x78')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x45e506[_0x5235('0x79')][_0x5235('0x71')]||{},'body':_0x45e506[_0x5235('0x79')]['body']||{}};_0x5b3a9a(null,_0x25d978);});};AGIVertices[_0x5235('0x10')][_0x5235('0x7a')]=function(_0x289856,_0x5ee5cc){scripts[_0x5235('0x7a')](this['channel'][_0x5235('0x38')],_0x289856['key'],_0x289856[_0x5235('0x60')],_0x289856[_0x5235('0x7b')]||'en')[_0x5235('0x12')](function(_0x26a73d){_0x5ee5cc(null,_0x26a73d);})[_0x5235('0x14')](function(_0x47cdf8){_0x5ee5cc(_0x47cdf8);});};AGIVertices['prototype'][_0x5235('0x7c')]=function(_0x494acf,_0x249a55){scripts[_0x5235('0x7c')](this[_0x5235('0x37')][_0x5235('0x38')],_0x494acf['dialogflowV2_project_id'],_0x494acf['client_email'],_0x494acf['private_key'],_0x494acf[_0x5235('0x60')],_0x494acf[_0x5235('0x7d')]||'en')['then'](function(_0x34e06b){_0x249a55(null,_0x34e06b);})[_0x5235('0x14')](function(_0x4af4ab){_0x249a55(_0x4af4ab);});};AGIVertices['prototype'][_0x5235('0x7e')]=function(_0x3bfb48,_0x1aceb9){scripts[_0x5235('0x7e')](this[_0x5235('0x37')],_0x3bfb48)[_0x5235('0x12')](function(_0xede302){_0x1aceb9(null,_0xede302);})[_0x5235('0x14')](function(_0xfcd1a){_0x1aceb9(_0xfcd1a);});};AGIVertices[_0x5235('0x10')][_0x5235('0x7f')]=function(_0x471b19,_0x779cde){scripts[_0x5235('0x7f')](_0x471b19['key'],_0x471b19[_0x5235('0x60')],_0x471b19[_0x5235('0x80')]||_0x5235('0x81'),_0x471b19[_0x5235('0x82')])[_0x5235('0x12')](function(_0x134908){_0x779cde(null,_0x134908);})[_0x5235('0x14')](function(_0x2a8080){_0x779cde(_0x2a8080);});};AGIVertices[_0x5235('0x10')][_0x5235('0x83')]=function(_0x200969,_0xd22137,_0x55fbb9){scripts[_0x5235('0x83')](_0xd22137,_0x200969['key'],_0x200969[_0x5235('0x84')]||_0x5235('0x81'),this[_0x5235('0x85')](_0x200969[_0x5235('0x86')])?_0x200969[_0x5235('0x86')]:undefined)['then'](function(_0x28c8ed){_0x55fbb9(null,_0x28c8ed);})[_0x5235('0x14')](function(_0x3ff8fa){_0x55fbb9(_0x3ff8fa);});};AGIVertices[_0x5235('0x10')]['awsPolly']=function(_0x547635,_0x3e3ccf){scripts['awsPolly'](_0x547635['aws_access_key_id'],_0x547635['aws_secret_access_key'],_0x547635[_0x5235('0x87')],_0x547635[_0x5235('0x88')]||_0x5235('0x89'),_0x547635[_0x5235('0x60')],_0x547635['aws_text_type']||_0x5235('0x60'))[_0x5235('0x12')](function(_0x5f3363){_0x3e3ccf(null,_0x5f3363);})[_0x5235('0x14')](function(_0x11c6b7){_0x3e3ccf(_0x11c6b7);});};AGIVertices[_0x5235('0x10')][_0x5235('0x8a')]=function(_0x44ee44,_0x372631){scripts['awsLex'](this['channel'][_0x5235('0x38')],_0x44ee44['aws_access_key_id'],_0x44ee44[_0x5235('0x8b')],_0x44ee44['aws_lex_region'],_0x44ee44['text'],_0x44ee44[_0x5235('0x8c')])[_0x5235('0x12')](function(_0x34e433){_0x372631(null,_0x34e433);})['catch'](function(_0x421eaa){_0x372631(_0x421eaa);});};AGIVertices[_0x5235('0x10')]['googleASR']=function(_0x541c1f,_0xa71780,_0x48c2bb){scripts['googleASR'](_0xa71780,_0x541c1f['key'],_0x541c1f[_0x5235('0x8d')]||_0x5235('0x81'))[_0x5235('0x12')](function(_0x523ded){_0x48c2bb(null,_0x523ded);})['catch'](function(_0x4f8e62){_0x48c2bb(_0x4f8e62);});};AGIVertices['prototype'][_0x5235('0x8e')]=function(_0x4ed82a,_0x1b3fc9,_0x1ae438){scripts[_0x5235('0x8e')](_0x1b3fc9,_0x4ed82a[_0x5235('0x8f')],_0x4ed82a[_0x5235('0x90')],_0x4ed82a[_0x5235('0x91')])[_0x5235('0x12')](function(_0x56ada0){_0x1ae438(null,_0x56ada0);})['catch'](function(_0x1758a6){_0x1ae438(_0x1758a6);});};AGIVertices[_0x5235('0x10')][_0x5235('0x92')]=function(_0x4440d6){var _0x2834a5=_[_0x5235('0x6b')](verticesWithRetry,_0x4440d6[_0x5235('0x3a')])?_0x4440d6:_['clone'](_0x4440d6);for(var _0x4fd7af in _0x2834a5){if(_0x2834a5[_0x5235('0x93')](_0x4fd7af)){if(_0x2834a5[_0x4fd7af]&&_[_0x5235('0x94')](_0x2834a5[_0x4fd7af])){if(_[_0x5235('0x6b')](recursiveMapAttributes,_0x4fd7af)){_0x2834a5[_0x4fd7af]=this['replaceObjectAllVariables'](_0x2834a5[_0x4fd7af]);}else{_0x2834a5[_0x4fd7af]=this[_0x5235('0x95')](_0x2834a5[_0x4fd7af]);}}}}return _0x2834a5;};AGIVertices[_0x5235('0x10')][_0x5235('0x96')]=function(_0x2fe3d3){for(var _0x1c9ac1 in _0x2fe3d3){if(_0x2fe3d3['hasOwnProperty'](_0x1c9ac1)){if(_['isPlainObject'](_0x2fe3d3[_0x1c9ac1])){this[_0x5235('0x96')](_0x2fe3d3[_0x1c9ac1]);}else if(_[_0x5235('0x97')](_0x2fe3d3[_0x1c9ac1])){for(var _0x5b6167=0x0;_0x5b6167<_0x2fe3d3[_0x1c9ac1]['length'];_0x5b6167++){this[_0x5235('0x96')](_0x2fe3d3[_0x1c9ac1][_0x5b6167]);}}else if(_['isString'](_0x2fe3d3[_0x1c9ac1])){_0x2fe3d3[_0x1c9ac1]=this[_0x5235('0x95')](_0x2fe3d3[_0x1c9ac1]);}}}};AGIVertices[_0x5235('0x10')]['saveRestApiResult']=function(_0x5ad801,_0x571572){for(var _0x47c53f in _0x5ad801){if(_0x5ad801[_0x5235('0x93')](_0x47c53f)){if(_[_0x5235('0x98')](_0x5ad801[_0x47c53f])){if(!_['isEmpty'](_0x5ad801[_0x47c53f])){this[_0x5235('0x99')](_0x5ad801[_0x47c53f],util[_0x5235('0x58')](_0x5235('0x9a'),_0x571572,_0x47c53f));}}else if(_['isArray'](_0x5ad801[_0x47c53f])){for(var _0x26ad84=0x0;_0x26ad84<_0x5ad801[_0x47c53f][_0x5235('0x9b')];_0x26ad84++){this[_0x5235('0x99')](_0x5ad801[_0x47c53f][_0x26ad84],util[_0x5235('0x58')]('%s.%s',_0x571572,_0x47c53f+'['+_0x26ad84+']'));}}else{if(!_[_0x5235('0x45')](_0x5ad801[_0x47c53f])){this[_0x5235('0x37')][_0x5235('0x9c')](util['format']('%s.%s',_0x571572,_0x47c53f),_0x5ad801[_0x47c53f]);}}}}};AGIVertices[_0x5235('0x10')]['replaceObjectAllVariables']=function(_0x23f24b){try{var _0x53811f=JSON[_0x5235('0x6f')](_0x23f24b);this[_0x5235('0x96')](_0x53811f);return JSON[_0x5235('0x76')](_0x53811f);}catch(_0x39f3e1){return this[_0x5235('0x95')](_0x23f24b);}};AGIVertices[_0x5235('0x10')][_0x5235('0x95')]=function(_0x2f8ae5){var _0x1d7043=_0x2f8ae5['split']('{');for(var _0x2daaf1=0x1;_0x2daaf1<_0x1d7043[_0x5235('0x9b')];_0x2daaf1+=0x1){var _0x75de2d=_0x1d7043[_0x2daaf1][_0x5235('0x9d')]('}');if(_0x75de2d['length']>0x1){_0x2f8ae5=_0x2f8ae5['replaceAll']('{'+_0x75de2d[0x0]+'}',this[_0x5235('0x37')][_0x5235('0x11')](_0x75de2d[0x0])['extra']||_0x75de2d[0x0]);}}if(_0x1d7043[_0x5235('0x9b')]===0x1){return _0x2f8ae5[_0x5235('0x4e')]();}return this[_0x5235('0x95')](_0x2f8ae5);};AGIVertices['prototype']['getAndSetVariable']=function(_0x17a872,_0x5825ec){var _0x3b7af8=this[_0x5235('0x37')]['getVariable'](_0x17a872);if(_0x3b7af8[_0x5235('0x9e')]===-0x1){return _0x3b7af8;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5825ec,_0x3b7af8[_0x5235('0x9f')]));return this[_0x5235('0x37')][_0x5235('0x9c')](_0x5825ec,_0x3b7af8[_0x5235('0x9f')]);};AGIVertices['prototype']['isConfigured']=function(_0x33fa5f){return _0x33fa5f&&_0x33fa5f!=='0'&&_0x33fa5f!=='-1'&&_0x33fa5f!=='';};AGIVertices[_0x5235('0x10')]['maxRetry']=function(_0x22fd63){this[_0x5235('0x36')]['sync'](this,_0x22fd63,'-');_0x22fd63[_0x5235('0xa0')]=_0x22fd63['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5235('0x10')][_0x5235('0xa1')]=function(_0x53c926){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xa2'),_0x53c926[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x53c926[_0x5235('0x60')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xa4'));}var _0x3a8db0='\x22'+_0x53c926[_0x5235('0x60')]+'\x22';if(this['isConfigured'](_0x53c926[_0x5235('0x79')])){_0x3a8db0+=','+_0x53c926[_0x5235('0x79')];}var _0x381267=this[_0x5235('0x37')][_0x5235('0xa5')](_0x5235('0xa6'),_0x3a8db0);if(_0x381267[_0x5235('0x9e')]===-0x1){return _0x381267;}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xa7'),_0x3a8db0));};AGIVertices[_0x5235('0x10')][_0x5235('0xa8')]=function(_0x21a114){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xa9'),_0x21a114[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x21a114['grammar'])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xaa'));}var _0x4b8bbb=_0x21a114[_0x5235('0xab')];if(this['isConfigured'](_0x21a114[_0x5235('0x79')])){_0x4b8bbb+=','+_0x21a114['options'];}var _0x22e7df=this[_0x5235('0x37')][_0x5235('0xa5')](_0x5235('0xac'),_0x4b8bbb);if(_0x22e7df['result']===-0x1){return _0x22e7df;}var _0x292157=this[_0x5235('0xad')]('RECOG_CONFIDENCE()',_0x5235('0xae'));if(_0x292157[_0x5235('0x9e')]===-0x1){return _0x292157;}var _0x5d5849=this[_0x5235('0xad')](_0x5235('0xaf'),'MRCP_RECOG_TRANSCRIPT');if(_0x5d5849[_0x5235('0x9e')]===-0x1){return _0x5d5849;}var _0x5177f6=this['getAndSetVariable']('RECOG_INSTANCE()',_0x5235('0xb0'));if(_0x5177f6['result']===-0x1){return _0x5177f6;}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4b8bbb));};AGIVertices[_0x5235('0x10')][_0x5235('0x7')]=function(_0x37505e){logger['info'](util['format'](_0x5235('0xb1'),_0x37505e[_0x5235('0x39')]));return this[_0x5235('0x37')]['agi']([_0x37505e[_0x5235('0xb2')],_0x37505e[_0x5235('0xb3')]]);};AGIVertices[_0x5235('0x10')][_0x5235('0xb4')]=function(_0x8545c5){logger['info'](util[_0x5235('0x58')](_0x5235('0xb5'),_0x8545c5[_0x5235('0x39')]));if(this[_0x5235('0x85')](_0x8545c5[_0x5235('0x69')])){logger['info'](util[_0x5235('0x58')](_0x5235('0xb6'),_0x8545c5['timeout']));var _0x37c125=this[_0x5235('0x37')][_0x5235('0xb7')](_0x8545c5['timeout']);if(_0x37c125['result']===-0x1){return _0x37c125;}}return this[_0x5235('0x37')][_0x5235('0xb4')]();};AGIVertices[_0x5235('0x10')][_0x5235('0x4d')]=function(_0x51df9b){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x51df9b[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x51df9b['list_id'])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x51df9b,_0x5235('0xb8'));}_0x51df9b[_0x5235('0x4c')]=moment();if(this[_0x5235('0x85')](_0x51df9b['delay'])){_0x51df9b[_0x5235('0x4c')]=moment()[_0x5235('0xb9')](_0x51df9b[_0x5235('0xba')],'minutes');}if(!this['isConfigured'](_0x51df9b['callback_priority'])){_0x51df9b[_0x5235('0xbb')]=0x2;}this[_0x5235('0x44')][_0x5235('0xbc')](this,_0x51df9b);return this['channel'][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xbd'),_0x51df9b[_0x5235('0x4a')],_0x51df9b[_0x5235('0x4b')],_0x51df9b['scheduledAt']));};AGIVertices[_0x5235('0x10')]['custom_app']=function(_0x4ebbe6){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xbe'),_0x4ebbe6[_0x5235('0x39')]));var _0x163c5f=this[_0x5235('0x37')][_0x5235('0xa5')](_0x4ebbe6[_0x5235('0xbf')],_0x4ebbe6[_0x5235('0x79')]);if(_0x163c5f['result']===-0x1){return _0x163c5f;}return this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')](_0x5235('0xc0'),_0x4ebbe6[_0x5235('0xbf')],_0x4ebbe6[_0x5235('0x79')]));};AGIVertices['prototype'][_0x5235('0xc1')]=function(_0x5df928){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xc2'),_0x5df928[_0x5235('0x39')]));if(!this['isConfigured'](_0x5df928[_0x5235('0x60')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x10ccc8='\x22'+_0x5df928['text']+'\x22';if(this[_0x5235('0x85')](_0x5df928[_0x5235('0x79')])){_0x10ccc8+=','+_0x5df928[_0x5235('0x79')];}var _0x3438dc=this[_0x5235('0x37')]['exec'](_0x5235('0xa6'),_0x10ccc8);if(_0x3438dc[_0x5235('0x9e')]===-0x1){return _0x3438dc;}return this['channel'][_0x5235('0xa3')](util[_0x5235('0x58')]('Executed\x20command\x20MRCPSynth\x20%s',_0x10ccc8));};AGIVertices['prototype'][_0x5235('0xc3')]=function(_0x13daa1){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xc4'),_0x13daa1[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x13daa1['text'])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xa4'));}var _0x58360a='\x22'+_0x13daa1[_0x5235('0x60')]+'\x22';if(this[_0x5235('0x85')](_0x13daa1[_0x5235('0x79')])){_0x58360a+=','+_0x13daa1[_0x5235('0x79')];}var _0x226f55=this['channel'][_0x5235('0xa5')](_0x5235('0xa6'),_0x58360a);if(_0x226f55[_0x5235('0x9e')]===-0x1){return _0x226f55;}return this[_0x5235('0x37')][_0x5235('0xa3')](util['format'](_0x5235('0xa7'),_0x58360a));};AGIVertices[_0x5235('0x10')][_0x5235('0xc5')]=function(_0x27de95){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x27de95[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x27de95[_0x5235('0xab')])){return this[_0x5235('0x37')]['noop'](_0x5235('0xaa'));}var _0x477a64=_0x27de95[_0x5235('0xab')];if(this[_0x5235('0x85')](_0x27de95[_0x5235('0x79')])){_0x477a64+=','+_0x27de95['options'];}var _0x3aaf1b=this[_0x5235('0x37')][_0x5235('0xa5')](_0x5235('0xac'),_0x477a64);if(_0x3aaf1b[_0x5235('0x9e')]===-0x1){return _0x3aaf1b;}var _0x2d6d0b=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x5235('0xc6'));if(_0x2d6d0b[_0x5235('0x9e')]===-0x1){return _0x2d6d0b;}var _0x33c6b3=this[_0x5235('0xad')](_0x5235('0xaf'),_0x5235('0xc7'));if(_0x33c6b3[_0x5235('0x9e')]===-0x1){return _0x33c6b3;}var _0x4393f8=this[_0x5235('0xad')](_0x5235('0xc8'),_0x5235('0xc9'));if(_0x4393f8[_0x5235('0x9e')]===-0x1){return _0x4393f8;}return this[_0x5235('0x37')][_0x5235('0xa3')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x477a64));};AGIVertices[_0x5235('0x10')][_0x5235('0xca')]=function(_0x1a05eb){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xcb'),_0x1a05eb[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x1a05eb[_0x5235('0xab')])){return this['channel'][_0x5235('0xa3')]('no\x20grammar\x20configured');}var _0x21425f=_0x1a05eb['grammar'];if(this[_0x5235('0x85')](_0x1a05eb[_0x5235('0x79')])){_0x21425f+=','+_0x1a05eb[_0x5235('0x79')];}var _0x253193=this[_0x5235('0x37')][_0x5235('0xa5')]('MRCPRecog',_0x21425f);if(_0x253193['result']===-0x1){return _0x253193;}var _0x28fdb0=this['getAndSetVariable'](_0x5235('0xcc'),'SESTEK_ASR_CONFIDENCE');if(_0x28fdb0['result']===-0x1){return _0x28fdb0;}var _0x538609=this[_0x5235('0xad')](_0x5235('0xaf'),_0x5235('0xcd'));if(_0x538609[_0x5235('0x9e')]===-0x1){return _0x538609;}var _0x14e9df=this[_0x5235('0xad')](_0x5235('0xc8'),'SESTEK_ASR_INSTANCE');if(_0x14e9df[_0x5235('0x9e')]===-0x1){return _0x14e9df;}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')]('Executed\x20command\x20MRCPRecog\x20%s',_0x21425f));};AGIVertices[_0x5235('0x10')]['database']=function(_0x51fa0f){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xce'),_0x51fa0f[_0x5235('0x39')]));if(!this['isConfigured'](_0x51fa0f['odbc_id'])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x51fa0f,_0x5235('0xcf'));}var _0x41a82b=this[_0x5235('0x18')][_0x5235('0xbc')](this,_0x51fa0f[_0x5235('0xd0')]);if(!_0x41a82b){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x51fa0f,_0x5235('0xd1'));}if(!this[_0x5235('0x85')](_0x51fa0f['query'])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x51fa0f,'no\x20query\x20configured');}var _0x5db5fb=_0x51fa0f[_0x5235('0x30')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xd2'),_0x5db5fb));var _0x511148=this['getQueryOdbc'][_0x5235('0xbc')](this,_0x41a82b,_0x5db5fb);this[_0x5235('0x36')]['sync'](this,_0x51fa0f,_0x5db5fb);if(!this[_0x5235('0x85')](_0x51fa0f[_0x5235('0xd3')])){return this['channel'][_0x5235('0xa3')](_0x5235('0xd4'));}var _0x51e4=this[_0x5235('0x11')][_0x5235('0xbc')](this,_0x51fa0f[_0x5235('0xd3')]);if(!_0x51e4){return this[_0x5235('0x37')]['error'](_0x51fa0f,'no\x20variable\x20found');}var _0x4b2760=this;_0x511148['forEach'](function(_0x21ca0c,_0x29c803){Object[_0x5235('0xd5')](_0x21ca0c)['forEach'](function(_0x2a2586){_0x4b2760[_0x5235('0x37')]['setVariable'](util['format'](_0x5235('0xd6'),_0x51e4,_0x29c803,_0x2a2586),_0x21ca0c[_0x2a2586]);});});this[_0x5235('0x37')]['setVariable'](util[_0x5235('0x58')](_0x5235('0xd7'),_0x51e4),_0x511148[_0x5235('0x9b')]);return this[_0x5235('0x37')][_0x5235('0xa3')](util['format'](_0x5235('0xd8'),_0x51e4));};AGIVertices['prototype']['dial']=function(_0x1c0160){logger[_0x5235('0xd9')](util[_0x5235('0x58')](_0x5235('0xda'),_0x1c0160[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x1c0160[_0x5235('0xdb')])){return this['channel'][_0x5235('0x2c')](_0x1c0160,_0x5235('0xdc'));}var _0x3f17c9=this[_0x5235('0x1b')][_0x5235('0xbc')](this,_0x1c0160[_0x5235('0xdb')]);if(!_0x3f17c9){return this['channel'][_0x5235('0x2c')](_0x1c0160,'no\x20user\x20found');}var _0x59d5a4=this[_0x5235('0x37')][_0x5235('0xa5')]('DIAL',[util[_0x5235('0x58')](_0x5235('0xdd'),_0x3f17c9),_0x1c0160[_0x5235('0x69')],_0x1c0160[_0x5235('0xde')],_0x1c0160[_0x5235('0x75')]]);if(_0x59d5a4['result']===-0x1){return _0x59d5a4;}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xdf'),_0x5235('0xe0')));};AGIVertices['prototype']['dialogflow']=function(_0x4d1e2f){logger['info'](util[_0x5235('0x58')](_0x5235('0xe1'),_0x4d1e2f[_0x5235('0x39')]));if(!this['isConfigured'](_0x4d1e2f['key'])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xe2'));}if(!this[_0x5235('0x85')](_0x4d1e2f[_0x5235('0x60')])){return this[_0x5235('0x37')][_0x5235('0xa3')]('no\x20text\x20configured');}this[_0x5235('0x37')][_0x5235('0xe3')]=!![];this[_0x5235('0x36')](_0x4d1e2f);this[_0x5235('0x43')](_0x4d1e2f[_0x5235('0x60')],'in','','');this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xe4'),_0x4d1e2f[_0x5235('0x60')]));var _0x36a17f=this[_0x5235('0x7a')][_0x5235('0xbc')](this,_0x4d1e2f);if(_0x36a17f){for(var _0x5e2694 in _0x36a17f){if(_0x36a17f[_0x5235('0x93')](_0x5e2694)){this[_0x5235('0x37')][_0x5235('0x9c')](util['format'](_0x5235('0xe5'),_0x5e2694[_0x5235('0x6d')]()),_0x36a17f[_0x5e2694]);}}this['createSquareMessage'](_0x36a17f[_0x5235('0xe6')],'out',_0x5235('0xe7'),'');return this[_0x5235('0x37')][_0x5235('0xa3')](util['format'](_0x5235('0xe8'),_0x36a17f[_0x5235('0xe6')]));}return this[_0x5235('0x37')][_0x5235('0x2c')](_0x4d1e2f,_0x5235('0xe9'));};AGIVertices[_0x5235('0x10')][_0x5235('0xea')]=function(_0xd4e181){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xeb'),_0xd4e181[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0xd4e181[_0x5235('0xec')])){return this['channel']['noop'](_0x5235('0xed'));}if(!this[_0x5235('0x85')](_0xd4e181[_0x5235('0xee')])){return this['channel'][_0x5235('0xa3')](_0x5235('0xef'));}if(!this[_0x5235('0x85')](_0xd4e181[_0x5235('0xf0')])){return this['channel']['noop'](_0x5235('0xf1'));}if(!this[_0x5235('0x85')](_0xd4e181[_0x5235('0x7d')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xf2'));}if(!this[_0x5235('0x85')](_0xd4e181[_0x5235('0x60')])){return this[_0x5235('0x37')]['noop']('no\x20text\x20configured');}this[_0x5235('0x37')][_0x5235('0xe3')]=!![];this[_0x5235('0x36')](_0xd4e181);this[_0x5235('0x43')](_0xd4e181['text'],'in','','');this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')]('Trying\x20DialogflowV2:\x20%s',_0xd4e181[_0x5235('0x60')]));var _0x48b7f5=this[_0x5235('0x7c')][_0x5235('0xbc')](this,_0xd4e181);if(_0x48b7f5){for(var _0x454a11 in _0x48b7f5){if(_0x48b7f5[_0x5235('0x93')](_0x454a11)){if(_0x454a11!==_0x5235('0xf3')){this['channel'][_0x5235('0x9c')](util['format']('DIALOGFLOW_%s',_0x454a11['toUpperCase']()),_0x48b7f5[_0x454a11]);}}}this[_0x5235('0x43')](_0x48b7f5[_0x5235('0xe6')],_0x5235('0xf4'),_0x5235('0xea'),_0x48b7f5[_0x5235('0xf3')]);return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xf5'),_0x48b7f5[_0x5235('0xe6')]));}return this[_0x5235('0x37')][_0x5235('0x2c')](_0xd4e181,_0x5235('0xf6'));};AGIVertices[_0x5235('0x10')]['sesteknda']=function(_0x2049ed){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0xf7'),_0x2049ed[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x2049ed[_0x5235('0xf8')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xf9'));}if(!this[_0x5235('0x85')](_0x2049ed[_0x5235('0xfa')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xfb'));}if(!this[_0x5235('0x85')](_0x2049ed[_0x5235('0xfc')])){return this[_0x5235('0x37')]['noop']('no\x20password\x20configured');}if(!this[_0x5235('0x85')](_0x2049ed[_0x5235('0xfd')])){return this[_0x5235('0x37')][_0x5235('0xa3')]('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x2049ed);this['createSquareMessage'](_0x2049ed[_0x5235('0x60')],'in','','');this[_0x5235('0x37')][_0x5235('0xa3')](util['format'](_0x5235('0xfe'),_0x2049ed['text']));var _0x1667bb=this[_0x5235('0x7e')][_0x5235('0xbc')](this,_0x2049ed);if(_0x1667bb){for(var _0x2e5659 in _0x1667bb){if(_0x1667bb[_0x5235('0x93')](_0x2e5659)){this[_0x5235('0x37')]['setVariable'](util['format']('SESTEK_NDA_%s',_0x2e5659[_0x5235('0x6d')]()),_0x1667bb[_0x2e5659]);}}this[_0x5235('0x43')](_0x1667bb[_0x5235('0xe6')],_0x5235('0xf4'),_0x5235('0xff'),'');if(_0x1667bb[_0x5235('0x100')]){this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x101'),_0x1667bb[_0x5235('0x100')]));var _0x315266=this[_0x5235('0x37')][_0x5235('0x102')](_0x1667bb[_0x5235('0x100')]);try{fs['unlink'](_0x1667bb[_0x5235('0x100')]+'.wav');}catch(_0x41ec12){logger[_0x5235('0x2c')](_0x41ec12);}return _0x315266;}else{return this['channel']['noop'](util[_0x5235('0x58')](_0x5235('0x103'),_0x1667bb[_0x5235('0xe6')]));}}return this[_0x5235('0x37')][_0x5235('0x2c')](_0x2049ed,_0x5235('0x104'));};AGIVertices['prototype'][_0x5235('0x105')]=function(_0xf6d68c){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20END\x20(%s)\x20block',_0xf6d68c[_0x5235('0x39')]));return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x105'));};AGIVertices['prototype']['ext_dial']=function(_0x423541){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x106'),_0x423541[_0x5235('0x39')]));var _0x56825f='';if(_0x423541[_0x5235('0x107')]){if(!this['isConfigured'](_0x423541[_0x5235('0x107')])){return this['channel'][_0x5235('0x2c')](_0x423541,_0x5235('0x108'));}else{var _0x1d8a5e=parseInt(_0x423541[_0x5235('0x107')],0xa);if(isNaN(_0x1d8a5e)){_0x56825f=_0x423541[_0x5235('0x107')];}else{_0x56825f=this[_0x5235('0x109')]['sync'](this,_0x423541[_0x5235('0x107')]);if(!_0x56825f){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x423541,'no\x20trunk\x20found');}}}}else if(_0x423541[_0x5235('0x10a')]){_0x56825f=_0x423541[_0x5235('0x10a')];}else{return this[_0x5235('0x37')]['error'](_0x423541,_0x5235('0x108'));}var _0x234d12=this['channel'][_0x5235('0xa5')](_0x5235('0xe0'),[util['format'](_0x5235('0x10b'),_0x56825f,_0x423541['phone']),_0x423541[_0x5235('0x69')],_0x423541[_0x5235('0xde')],_0x423541['url']]);if(_0x234d12[_0x5235('0x9e')]===-0x1){return _0x234d12;}return this['channel'][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xdf'),'DIAL'));};AGIVertices[_0x5235('0x10')][_0x5235('0x10c')]=function(_0x25bdeb){logger[_0x5235('0x2e')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x25bdeb[_0x5235('0x39')]));return this['channel']['noop'](_0x5235('0x10c'));};AGIVertices['prototype']['getdigits']=function(_0x441f81){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x10d'),_0x441f81[_0x5235('0x39')]));if(_0x441f81[_0x5235('0xa0')]===0x0){return this[_0x5235('0x10e')](_0x441f81);}_0x441f81[_0x5235('0xa0')]-=0x1;if(!this[_0x5235('0x85')](_0x441f81[_0x5235('0x10f')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x441f81,_0x5235('0x110'));}var _0x37f156=this['getSound'][_0x5235('0xbc')](this,_0x441f81[_0x5235('0x10f')]);if(!_0x37f156){return this['channel'][_0x5235('0x2c')](_0x441f81,_0x5235('0x111'));}if(!this[_0x5235('0x85')](_0x441f81['variable_id'])){return this['channel'][_0x5235('0x2c')](_0x5235('0xd4'));}var _0x32ac52=this[_0x5235('0x37')][_0x5235('0x112')](_0x37f156,_0x441f81[_0x5235('0x113')],_0x441f81[_0x5235('0x114')]);var _0x138783=_0x32ac52[_0x5235('0x9e')]?_0x32ac52[_0x5235('0x9e')][_0x5235('0x4e')]():'';logger['info'](_0x5235('0x115'),JSON[_0x5235('0x76')](_0x32ac52));if(_0x32ac52[_0x5235('0x9e')]===-0x1){this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x441f81,_0x138783);return _0x32ac52;}else if(_0x32ac52[_0x5235('0x9f')]===_0x5235('0x69')){_0x32ac52['result']=_0x138783[_0x5235('0x9b')]>=parseInt(_0x441f81[_0x5235('0x116')])?'x':'i';}else{_0x32ac52[_0x5235('0x9e')]=_0x138783['length']>=parseInt(_0x441f81['mindigit'])&&_0x138783[_0x5235('0x9b')]<=parseInt(_0x441f81[_0x5235('0x114')])?'x':'i';}var _0x48f44e=this[_0x5235('0x11')][_0x5235('0xbc')](this,_0x441f81[_0x5235('0xd3')]);if(!_0x48f44e){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x441f81,_0x5235('0x117'));}this[_0x5235('0x37')]['setVariable'](_0x48f44e,_0x138783);if(this[_0x5235('0x85')](_0x441f81[_0x5235('0x118')])){var _0x215aa0=parseInt(_0x441f81[_0x5235('0x118')],0xa);var _0x364044=rs[_0x5235('0x119')]({'charset':'*','length':_0x215aa0});var _0x1e0077=_0x138783['length'];if(_0x1e0077>0x0){if(_0x1e0077>_0x215aa0){this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x441f81,_0x441f81[_0x5235('0x11a')]===_0x5235('0x11b')?_0x364044+_0x138783[_0x5235('0x11c')](_0x215aa0):_0x138783['substr'](0x0,_0x1e0077-_0x215aa0)+_0x364044);}else{this[_0x5235('0x36')]['sync'](this,_0x441f81,rs[_0x5235('0x119')]({'charset':'*','length':_0x1e0077}));}}else{this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x441f81,'');}}else{this['createSquareDetailsReport'][_0x5235('0xbc')](this,_0x441f81,_0x138783);}return _0x32ac52;};AGIVertices[_0x5235('0x10')][_0x5235('0xe')]=function(_0x201cca){logger[_0x5235('0x2e')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x201cca[_0x5235('0x39')]));return this[_0x5235('0xd')](_0x201cca);};AGIVertices[_0x5235('0x10')][_0x5235('0x11d')]=function(_0x4f622b){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x11e'),_0x4f622b[_0x5235('0x39')]));this[_0x5235('0x36')]['sync'](this,_0x4f622b,_0x4f622b[_0x5235('0x11f')]);return this[_0x5235('0x37')][_0x5235('0xa3')](util['format'](_0x5235('0x120'),_0x4f622b[_0x5235('0x11f')]));};AGIVertices[_0x5235('0x10')]['awspolly']=function(_0x3e9141){logger['info'](util['format'](_0x5235('0x121'),_0x3e9141[_0x5235('0x39')]));if(!this['isConfigured'](_0x3e9141[_0x5235('0x122')])||!this[_0x5235('0x85')](_0x3e9141[_0x5235('0x8b')])){return this['channel']['noop'](_0x5235('0x123'));}if(!this['isConfigured'](_0x3e9141[_0x5235('0x60')])){return this[_0x5235('0x37')]['noop'](_0x5235('0xa4'));}this['channel'][_0x5235('0xa3')](util['format'](_0x5235('0x124'),_0x3e9141[_0x5235('0x60')]));var _0x47c49b=this[_0x5235('0x125')][_0x5235('0xbc')](this,_0x3e9141);if(_0x47c49b){this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')](_0x5235('0x126'),_0x47c49b));var _0x16479d=this['channel'][_0x5235('0x102')](_0x47c49b);try{fs[_0x5235('0x127')](_0x47c49b+_0x5235('0x128'));}catch(_0x31e7d3){logger['error'](_0x31e7d3);}return _0x16479d;}return this['channel']['error'](_0x3e9141,_0x5235('0x129'));};AGIVertices[_0x5235('0x10')][_0x5235('0x12a')]=function(_0x2de77a){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x12b'),_0x2de77a['label']));if(!this[_0x5235('0x85')](_0x2de77a[_0x5235('0x122')])||!this[_0x5235('0x85')](_0x2de77a[_0x5235('0x8b')])){return this[_0x5235('0x37')]['noop'](_0x5235('0x123'));}if(!this[_0x5235('0x85')](_0x2de77a[_0x5235('0x8c')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x12c'));}if(!this[_0x5235('0x85')](_0x2de77a[_0x5235('0x60')])){return this['channel'][_0x5235('0xa3')](_0x5235('0xa4'));}this[_0x5235('0x37')][_0x5235('0xe3')]=!![];this[_0x5235('0x36')](_0x2de77a);this[_0x5235('0x43')](_0x2de77a[_0x5235('0x60')],'in','','');this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x12d'),_0x2de77a[_0x5235('0x60')]));var _0xaba423=this[_0x5235('0x8a')]['sync'](this,_0x2de77a);if(_0xaba423){for(var _0x1007ee in _0xaba423){if(_0xaba423[_0x5235('0x93')](_0x1007ee)&&_[_0x5235('0x94')](_0xaba423[_0x1007ee])){this['channel'][_0x5235('0x9c')](util[_0x5235('0x58')](_0x5235('0x12e'),_0x1007ee[_0x5235('0x6d')]()),_0xaba423[_0x1007ee]);}}if(_[_0x5235('0x45')](_0xaba423[_0x5235('0x78')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x12f'));}else{this[_0x5235('0x43')](_0xaba423[_0x5235('0x78')],'out','amazonlex','');return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')]('Amazon\x20Lex\x20Result\x20%s',_0xaba423[_0x5235('0x78')]));}}return this['channel']['error'](_0x2de77a,_0x5235('0x130'));};AGIVertices['prototype'][_0x5235('0x131')]=function(_0x4c8fe9){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x4c8fe9[_0x5235('0x39')],_0x4c8fe9[_0x5235('0x69')]));if(!this[_0x5235('0x85')](_0x4c8fe9['key'])){return this['channel']['noop'](_0x5235('0xe2'));}var _0x4b76e9=_0x5235('0x132');var _0x6fe5e6=util[_0x5235('0x58')](_0x5235('0x133'),FILES_PATH,rs[_0x5235('0x119')](0x4));var _0x2e64c3=util['format'](_0x5235('0x9a'),_0x6fe5e6,_0x4b76e9);var _0x539e94=!![];if(_0x4c8fe9['beep']===_0x5235('0x134')){_0x539e94=![];}var _0x3cc7ce=this[_0x5235('0x37')]['recordFile'](_0x6fe5e6,_0x4b76e9,_0x4c8fe9[_0x5235('0x135')],_0x4c8fe9['timeout'],undefined,_0x539e94);if(_0x3cc7ce[_0x5235('0x9e')]!==-0x1){this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x136'),_0x2e64c3));var _0x3816fb=this[_0x5235('0x137')]['sync'](this,_0x4c8fe9,_0x2e64c3);if(_0x3816fb){for(var _0x5e8b9b in _0x3816fb){if(_0x3816fb['hasOwnProperty'](_0x5e8b9b)){this[_0x5235('0x37')]['setVariable'](util[_0x5235('0x58')](_0x5235('0x138'),_0x5e8b9b['toUpperCase']()),_0x3816fb[_0x5e8b9b]);}}return this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')](_0x5235('0x139'),JSON[_0x5235('0x76')](_0x3816fb)));}}return _0x3cc7ce;};AGIVertices['prototype'][_0x5235('0x13a')]=function(_0x120c58){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x120c58[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x120c58[_0x5235('0x8f')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x13b'));}if(!this['isConfigured'](_0x120c58['appsecret'])){return this['channel'][_0x5235('0xa3')](_0x5235('0x13c'));}var _0x31cda0=_0x5235('0x132');var _0x55abc4=util['format'](_0x5235('0x133'),FILES_PATH,rs[_0x5235('0x119')](0x4));var _0x4b560b=util[_0x5235('0x58')](_0x5235('0x9a'),_0x55abc4,_0x31cda0);var _0x26fbb4=!![];if(_0x120c58['beep']==='NOBEEP'){_0x26fbb4=![];}var _0x5d8696=this[_0x5235('0x37')][_0x5235('0x13d')](_0x55abc4,_0x31cda0,_0x120c58['intKey'],_0x120c58['timeout'],undefined,_0x26fbb4);if(_0x5d8696['result']!==-0x1){this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x13e'),_0x4b560b));var _0x59c8e9=this[_0x5235('0x8e')][_0x5235('0xbc')](this,_0x120c58,_0x4b560b);if(_0x59c8e9){for(var _0x2187e6 in _0x59c8e9){if(_0x59c8e9[_0x5235('0x93')](_0x2187e6)){this['channel'][_0x5235('0x9c')](util[_0x5235('0x58')](_0x5235('0x13f'),_0x2187e6['toUpperCase']()),_0x59c8e9[_0x2187e6]);}}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x59c8e9)));}}return _0x5d8696;};AGIVertices['prototype'][_0x5235('0x140')]=function(_0x3a47a1){logger[_0x5235('0x2e')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3a47a1['label']));return this[_0x5235('0x37')][_0x5235('0x141')](_0x3a47a1[_0x5235('0x3e')],_0x3a47a1['extension'],_0x3a47a1[_0x5235('0x3f')]);};AGIVertices['prototype'][_0x5235('0x142')]=function(_0x435255){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x143'),_0x435255[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x435255[_0x5235('0x144')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x435255,_0x5235('0x145'));}try{var _0x7d5131=eval(_0x435255[_0x5235('0x144')])?_0x5235('0x146'):_0x5235('0x147');this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')](_0x5235('0x148'),_0x435255[_0x5235('0x144')],_0x7d5131));return{'code':0xc8,'result':_0x7d5131};}catch(_0x2c31f7){return{'code':0xc8,'result':_0x5235('0x147')};}};AGIVertices[_0x5235('0x10')]['gotoiftime']=function(_0x4306d7){logger['info'](util[_0x5235('0x58')](_0x5235('0x149'),_0x4306d7[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x4306d7[_0x5235('0x14a')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x4306d7,'no\x20interval\x20configured');}var _0x26ddb0=this[_0x5235('0x25')][_0x5235('0xbc')](this,_0x4306d7[_0x5235('0x14a')]);if(!_0x26ddb0){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x4306d7,_0x5235('0x14b'));}for(var _0x414312=0x0;_0x414312<_0x26ddb0[_0x5235('0x9b')];_0x414312+=0x1){var _0xa7f0e0=this[_0x5235('0x37')]['getVariable'](util[_0x5235('0x58')](_0x5235('0x14c'),_0x26ddb0[_0x414312]));if(_0xa7f0e0[_0x5235('0x9e')]===-0x1){return _0xa7f0e0;}logger[_0x5235('0x2e')](util[_0x5235('0x58')]('IFTIME\x20%s\x20%s',_0x26ddb0[_0x414312],_0xa7f0e0['extra']));if(_0xa7f0e0['extra']==='true'){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x14d'),_0x26ddb0[_0x414312],'true'));this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')]('IFTIME\x20%s\x20%s',_0x26ddb0[_0x414312],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x5235('0x58')](_0x5235('0x14d'),_0x26ddb0[_0x414312],_0x5235('0x147')));this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x14d'),_0x26ddb0[_0x414312],_0x5235('0x147')));}}return{'code':0xc8,'result':_0x5235('0x147')};};AGIVertices[_0x5235('0x10')][_0x5235('0x14e')]=function(_0x2c86ae){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x14f'),_0x2c86ae[_0x5235('0x39')]));return this['channel'][_0x5235('0x14e')]();};AGIVertices[_0x5235('0x10')][_0x5235('0x150')]=function(_0x3fb384){logger['info'](util[_0x5235('0x58')](_0x5235('0x151'),_0x3fb384[_0x5235('0x39')]));if(!this['isConfigured'](_0x3fb384[_0x5235('0x152')])){return this[_0x5235('0x37')]['noop'](_0x5235('0xe2'));}var _0x3e02d5=_0x5235('0x132');var _0x5173ce=util[_0x5235('0x58')](_0x5235('0x133'),FILES_PATH,rs[_0x5235('0x119')](0x4));var _0x216074=util['format'](_0x5235('0x9a'),_0x5173ce,_0x3e02d5);var _0xa0585b=!![];if(_0x3fb384[_0x5235('0x153')]==='NOBEEP'){_0xa0585b=![];}var _0x55a39e=this['channel'][_0x5235('0x13d')](_0x5173ce,_0x3e02d5,_0x3fb384[_0x5235('0x135')],_0x3fb384[_0x5235('0x69')],undefined,_0xa0585b);if(_0x55a39e[_0x5235('0x9e')]!==-0x1){this['channel'][_0x5235('0xa3')](util['format'](_0x5235('0x154'),_0x216074));var _0x52117c=this[_0x5235('0x83')][_0x5235('0xbc')](this,_0x3fb384,_0x216074);if(_0x52117c){for(var _0x76e91f in _0x52117c){if(_0x52117c[_0x5235('0x93')](_0x76e91f)){this[_0x5235('0x37')]['setVariable'](util[_0x5235('0x58')]('ISPEECH_ASR_%s',_0x76e91f[_0x5235('0x6d')]()),_0x52117c[_0x76e91f]);}}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')]('IspeechASR\x20Result\x20%s',JSON[_0x5235('0x76')](_0x52117c)));}}return _0x55a39e;};AGIVertices[_0x5235('0x10')]['ispeechtts']=function(_0x270b3e){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x270b3e[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x270b3e[_0x5235('0x152')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xe2'));}if(!this[_0x5235('0x85')](_0x270b3e[_0x5235('0x60')])){return this[_0x5235('0x37')]['noop']('no\x20text\x20configured');}this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x155'),_0x270b3e[_0x5235('0x60')]));var _0xfe6d8e=this['ispeechTTS'][_0x5235('0xbc')](this,_0x270b3e);if(_0xfe6d8e){this[_0x5235('0x37')][_0x5235('0xa3')](util['format']('ispeech\x20%s\x20file\x20created',_0xfe6d8e));var _0xdd5d8c=this[_0x5235('0x37')][_0x5235('0x102')](_0xfe6d8e,_0x270b3e[_0x5235('0x135')]);try{fs[_0x5235('0x127')](_0xfe6d8e+_0x5235('0x128'));}catch(_0x43b5d1){logger[_0x5235('0x2c')](_0x43b5d1);}return _0xdd5d8c;}return this[_0x5235('0x37')]['error'](_0x270b3e,_0x5235('0x156'));};AGIVertices['prototype'][_0x5235('0x157')]=function(_0x231533){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x231533[_0x5235('0x39')]));if(!this['isConfigured'](_0x231533[_0x5235('0x158')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x231533,_0x5235('0x159'));}logger['info'](util[_0x5235('0x58')](_0x5235('0x15a'),this[_0x5235('0x37')][_0x5235('0x53')],_0x231533[_0x5235('0x158')]));var _0x565dab=this[_0x5235('0x56')][_0x5235('0xbc')](this,_0x231533[_0x5235('0x158')]);if(_0x565dab){logger['info'](util[_0x5235('0x58')](_0x5235('0x15b'),this['channel'][_0x5235('0x53')],_0x231533[_0x5235('0x158')]));this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x15b'),this[_0x5235('0x37')]['callerid'],_0x231533[_0x5235('0x158')]));return{'code':0xc8,'result':_0x5235('0x15c')};}else{logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x15d'),this[_0x5235('0x37')][_0x5235('0x53')],_0x231533[_0x5235('0x158')]));this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x15d'),this['channel'][_0x5235('0x53')],_0x231533['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5235('0x10')][_0x5235('0x15e')]=function(_0x4f68e4){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x15f'),_0x4f68e4[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x4f68e4['findBy'])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x4f68e4,_0x5235('0x159'));}logger[_0x5235('0x2e')](util['format'](_0x5235('0x15a'),this[_0x5235('0x37')][_0x5235('0x53')],_0x4f68e4[_0x5235('0x158')]));var _0xc27d87=this[_0x5235('0x55')][_0x5235('0xbc')](this,_0x4f68e4[_0x5235('0x158')]);if(_0xc27d87){logger['info'](util[_0x5235('0x58')](_0x5235('0x15b'),this['channel'][_0x5235('0x53')],_0x4f68e4['findBy']));this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')](_0x5235('0x15b'),this['channel'][_0x5235('0x53')],_0x4f68e4[_0x5235('0x158')]));return{'code':0xc8,'result':_0x5235('0x15c')};}else{logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x15d'),this[_0x5235('0x37')][_0x5235('0x53')],_0x4f68e4[_0x5235('0x158')]));this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x15d'),this[_0x5235('0x37')]['callerid'],_0x4f68e4['findBy']));return{'code':0xc8,'result':_0x5235('0x160')};}};AGIVertices[_0x5235('0x10')][_0x5235('0x161')]=function(_0x493fed){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x162'),_0x493fed['label']));if(!this[_0x5235('0x85')](_0x493fed[_0x5235('0x163')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x493fed,_0x5235('0x164'));}this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x165'),_0x493fed[_0x5235('0x163')]));var _0x33b4e4=eval(_0x493fed[_0x5235('0x163')]);if(!this[_0x5235('0x85')](_0x493fed[_0x5235('0xd3')])){return this[_0x5235('0x37')][_0x5235('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x76787a=this[_0x5235('0x11')][_0x5235('0xbc')](this,_0x493fed[_0x5235('0xd3')]);if(!_0x76787a){return this[_0x5235('0x37')]['error'](_0x493fed,'no\x20variable\x20found');}if(_[_0x5235('0x97')](_0x33b4e4)){var _0x440f3a=this;_0x33b4e4[_0x5235('0x166')](function(_0x29e8da,_0x535191){_0x440f3a[_0x5235('0x37')]['setVariable'](util[_0x5235('0x58')](_0x5235('0x167'),_0x76787a,_0x535191),_0x29e8da);});return this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')](_0x5235('0x168'),_0x76787a));}else{return this[_0x5235('0x37')]['setVariable'](_0x76787a,_0x33b4e4);}};AGIVertices['prototype'][_0x5235('0xc')]=function(_0x2516c4){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x169'),_0x2516c4['label']));if(_0x2516c4[_0x5235('0xa0')]===0x0){return this[_0x5235('0x10e')](_0x2516c4);}_0x2516c4['retry']-=0x1;if(!this['isConfigured'](_0x2516c4[_0x5235('0x10f')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x2516c4,'no\x20file\x20audio\x20selected');}var _0x128aad=this[_0x5235('0x1e')][_0x5235('0xbc')](this,_0x2516c4[_0x5235('0x10f')]);if(!_0x128aad){return this['channel']['error'](_0x2516c4,'no\x20file\x20audio\x20found');}var _0x3cd9b0=this['channel'][_0x5235('0x112')](_0x128aad,_0x2516c4[_0x5235('0x113')],_0x2516c4['digit']);var _0x1c76b7=_0x3cd9b0[_0x5235('0x9e')];if(_0x3cd9b0['result']===-0x1){this[_0x5235('0x36')]['sync'](this,_0x2516c4,'-1');return _0x3cd9b0;}else if(_0x3cd9b0[_0x5235('0x9f')]===_0x5235('0x69')){_0x3cd9b0[_0x5235('0x9e')]=_0x3cd9b0[_0x5235('0x9e')][_0x5235('0x9b')]>0x0?_0x3cd9b0['result']:'t';}else if(_[_0x5235('0x48')](_0x3cd9b0[_0x5235('0x9e')])){_0x3cd9b0[_0x5235('0x9e')]='#';_0x1c76b7='#';}if(!this['isConfigured'](_0x2516c4[_0x5235('0xd3')])){this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0xd4'));}else{var _0x18d781=this[_0x5235('0x11')][_0x5235('0xbc')](this,_0x2516c4['variable_id']);if(!_0x18d781){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x2516c4,_0x5235('0x117'));}this[_0x5235('0x37')]['setVariable'](_0x18d781,_0x1c76b7);}this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x2516c4,_0x1c76b7);return _0x3cd9b0;};AGIVertices['prototype']['noop']=function(_0x2e728b){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x16a'),_0x2e728b['label']));return this[_0x5235('0x37')][_0x5235('0xa3')](_0x2e728b[_0x5235('0x16b')]||_0x2e728b[_0x5235('0x39')]);};AGIVertices[_0x5235('0x10')][_0x5235('0x16c')]=function(_0x1674ae){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x16d'),_0x1674ae[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x1674ae[_0x5235('0x158')])){return this[_0x5235('0x37')]['error'](_0x1674ae,'no\x20find\x20by\x20configured');}logger[_0x5235('0x2e')](util[_0x5235('0x58')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5235('0x37')][_0x5235('0x53')],_0x1674ae[_0x5235('0x158')]));var _0x202873=this[_0x5235('0x4f')][_0x5235('0xbc')](this,_0x1674ae['pause_id']);var _0x20afc8=this[_0x5235('0x51')][_0x5235('0xbc')](this,_0x1674ae['findBy'],_0x202873);if(_0x20afc8){logger[_0x5235('0x2e')](util['format'](_0x5235('0x15b'),this[_0x5235('0x37')]['callerid'],_0x1674ae[_0x5235('0x158')]));this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x15b'),this[_0x5235('0x37')][_0x5235('0x53')],_0x1674ae[_0x5235('0x158')]));return{'code':0xc8,'result':_0x5235('0x15c')};}else{logger[_0x5235('0x2e')](util[_0x5235('0x58')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5235('0x37')][_0x5235('0x53')],_0x1674ae[_0x5235('0x158')]));this[_0x5235('0x37')][_0x5235('0xa3')](util['format'](_0x5235('0x15b'),this['channel'][_0x5235('0x53')],_0x1674ae[_0x5235('0x158')]));return{'code':0xc8,'result':_0x5235('0x160')};}};AGIVertices['prototype'][_0x5235('0x16e')]=function(_0x3c4c73){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3c4c73[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x3c4c73[_0x5235('0x10f')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x3c4c73,'no\x20file\x20audio\x20selected');}var _0x279cbf=this[_0x5235('0x1e')][_0x5235('0xbc')](this,_0x3c4c73['file_id']);if(!_0x279cbf){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x3c4c73,_0x5235('0x111'));}var _0x5a68ff=this[_0x5235('0x37')][_0x5235('0xa5')](_0x5235('0x16f'),[_0x279cbf,_0x3c4c73[_0x5235('0xde')]]);if(_0x5a68ff['result']===-0x1){return _0x5a68ff;}return this['channel'][_0x5235('0xa3')](util[_0x5235('0x58')]('Executed\x20command\x20%s\x20%s',_0x5235('0x16f'),_0x279cbf));};AGIVertices[_0x5235('0x10')][_0x5235('0x170')]=function(_0x5c58b9){logger[_0x5235('0x2e')](util['format'](_0x5235('0x171'),_0x5c58b9[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x5c58b9[_0x5235('0x172')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x5c58b9,'no\x20queue\x20selected');}var _0x458f96='';var _0x243998=parseInt(_0x5c58b9[_0x5235('0x172')],0xa);if(isNaN(_0x243998)){_0x458f96=_0x5c58b9[_0x5235('0x172')];}else{_0x458f96=this['getVoiceQueue'][_0x5235('0xbc')](this,_0x5c58b9['queue_id']);if(!_0x458f96){return this[_0x5235('0x37')]['error'](_0x5c58b9,_0x5235('0x173'));}}var _0x59be2d='';if(this[_0x5235('0x85')](_0x5c58b9['file_id'])){var _0x313c1d=this[_0x5235('0x1e')]['sync'](this,_0x5c58b9['file_id']);if(_0x313c1d){_0x59be2d=_0x313c1d;}}this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x5c58b9,_0x458f96);if(_0x5c58b9[_0x5235('0xde')]['indexOf']('x')<0x0){_0x5c58b9[_0x5235('0xde')]+='x';}if(_0x5c58b9[_0x5235('0xde')][_0x5235('0x174')]('X')<0x0){_0x5c58b9['opts']+='X';}this[_0x5235('0x37')]['setVariable']('XMCS-QUEUE',_0x458f96?_0x458f96[_0x5235('0x175')]():'');var _0x342a93=this[_0x5235('0x37')][_0x5235('0xa5')](_0x5235('0x176'),[_0x458f96,_0x5c58b9[_0x5235('0xde')],_0x5c58b9[_0x5235('0x75')],_0x59be2d,_0x5c58b9[_0x5235('0x69')],_0x5c58b9[_0x5235('0x7')],_0x5c58b9[_0x5235('0x177')],_0x5c58b9[_0x5235('0x178')],'',_0x5c58b9['position']]);if(_0x342a93[_0x5235('0x9e')]===-0x1){return _0x342a93;}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xc0'),_0x5235('0x176'),_0x458f96));};AGIVertices[_0x5235('0x10')]['record']=function(_0x4413c2){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x179'),_0x4413c2['label']));var _0x358515=_0x4413c2['recordingFormat']||_0x5235('0x132');var _0x2f19a8=util[_0x5235('0x58')](_0x5235('0x17a'),this[_0x5235('0x37')]['uniqueid'],rs['generate'](0x5));var _0x4d2699=util[_0x5235('0x58')](_0x5235('0x17b'),FILES_PATH,_0x2f19a8,_0x358515);var _0x80c3a0=util['format'](_0x5235('0x133'),FILES_PATH,_0x2f19a8);this[_0x5235('0x3c')][_0x5235('0xbc')](this,_0x4413c2,_0x2f19a8,_0x4d2699);this['channel']['setVariable'](_0x5235('0x17c'),_0x2f19a8);logger[_0x5235('0x2e')](_0x5235('0x17d'),_0x80c3a0,_0x358515,_0x4413c2[_0x5235('0x17e')],_0x4413c2['timeout']);return this[_0x5235('0x37')][_0x5235('0x13d')](_0x80c3a0,_0x358515,_0x4413c2[_0x5235('0x17e')],_0x4413c2[_0x5235('0x69')],undefined,!![]);};AGIVertices['prototype'][_0x5235('0x17f')]=function(_0x80f31b){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x180'),_0x80f31b[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x80f31b['url'])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x181'));}var _0x2d7c5a=this[_0x5235('0x67')]['sync'](this,_0x80f31b);logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x182'),util[_0x5235('0x183')](_0x2d7c5a,{'showHidden':![],'depth':null})));if(!this[_0x5235('0x85')](_0x80f31b['variable_id'])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x184'));}var _0x1922d7=this[_0x5235('0x11')][_0x5235('0xbc')](this,_0x80f31b[_0x5235('0xd3')]);if(!_0x1922d7){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x80f31b,_0x5235('0x117'));}this[_0x5235('0x37')]['setVariable'](util[_0x5235('0x58')]('%s_STATUS_CODE',_0x1922d7),_0x2d7c5a[_0x5235('0x77')]?_0x2d7c5a[_0x5235('0x77')]:'200');this['channel'][_0x5235('0x9c')](util['format']('%s_STATUS_MESSAGE',_0x1922d7),_0x2d7c5a[_0x5235('0x185')]?_0x2d7c5a[_0x5235('0x185')]:'OK');if(_0x2d7c5a[_0x5235('0x6e')]){try{this[_0x5235('0x99')](_0x2d7c5a[_0x5235('0x6e')],_0x1922d7);}catch(_0x190c09){logger[_0x5235('0x2c')](util[_0x5235('0x58')](_0x5235('0x186'),_0x1922d7));}}return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0xd8'),_0x1922d7));};AGIVertices[_0x5235('0x10')]['saydigits']=function(_0x6c0bcc){logger['info'](util[_0x5235('0x58')](_0x5235('0x187'),_0x6c0bcc[_0x5235('0x39')]));return this['channel'][_0x5235('0x188')](_0x6c0bcc[_0x5235('0x189')][_0x5235('0x5c')](/\s+/g,''),_0x6c0bcc['escape_digits']);};AGIVertices[_0x5235('0x10')][_0x5235('0x18a')]=function(_0x229cf4){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x229cf4[_0x5235('0x39')]));return this[_0x5235('0x37')]['sayNumber'](_0x229cf4['number'][_0x5235('0x5c')](/\s+/g,''),_0x229cf4['escape_digits']);};AGIVertices[_0x5235('0x10')]['sayphonetic']=function(_0x34de5f){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x18b'),_0x34de5f['label']));return this[_0x5235('0x37')][_0x5235('0x18c')](_0x34de5f[_0x5235('0x60')],_0x34de5f[_0x5235('0x17e')]);};AGIVertices[_0x5235('0x10')]['sendMail']=function(_0xcc6b31){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x18d'),_0xcc6b31[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0xcc6b31[_0x5235('0x18e')])){return this[_0x5235('0x37')]['noop'](_0x5235('0x18f'));}var _0x3ebd97=this[_0x5235('0x22')]['sync'](this,_0xcc6b31[_0x5235('0x18e')]);if(!_0x3ebd97||!_0x3ebd97['Smtp']){return this[_0x5235('0x37')][_0x5235('0x2c')](_0xcc6b31,'no\x20mail\x20account\x20found');}var _0x1764a5={'from':util['format'](_0x5235('0x190'),_0x3ebd97[_0x5235('0x13')],_0x3ebd97['email']||_0x3ebd97[_0x5235('0x191')][_0x5235('0x192')]),'to':_0xcc6b31['to']||'','cc':_0xcc6b31['cc']||'','bcc':_0xcc6b31[_0x5235('0x193')]||'','subject':_0xcc6b31[_0x5235('0x194')],'html':_0xcc6b31[_0x5235('0x60')],'text':_0xcc6b31['text']};var _0x2412ec={'tls':{'rejectUnauthorized':![]}};if(_0x3ebd97['Smtp'][_0x5235('0x195')]){_0x2412ec['service']=_0x3ebd97[_0x5235('0x191')][_0x5235('0x195')];}else{_0x2412ec['host']=_0x3ebd97['Smtp'][_0x5235('0x196')];_0x2412ec[_0x5235('0x197')]=_0x3ebd97[_0x5235('0x191')][_0x5235('0x197')];_0x2412ec[_0x5235('0x198')]=_0x3ebd97['Smtp'][_0x5235('0x198')];}if(_0x3ebd97[_0x5235('0x191')]['authentication']){_0x2412ec[_0x5235('0x199')]={'user':_0x3ebd97['Smtp']['user'],'pass':_0x3ebd97['Smtp'][_0x5235('0x19a')]};}if(this[_0x5235('0x85')](_0xcc6b31['template_id'])){}logger[_0x5235('0xd9')](_0x5235('0x19b'),JSON[_0x5235('0x76')](_0x1764a5));this[_0x5235('0x36')]['sync'](this,_0xcc6b31,_0xcc6b31[_0x5235('0x18e')]);this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3ebd97[_0x5235('0x13')]));this['sendMailMessage'][_0x5235('0xbc')](this,_0x2412ec,_0x1764a5);return this[_0x5235('0x37')][_0x5235('0xa3')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x5235('0x19c')]=function(_0xe421ad){logger[_0x5235('0x2e')](util['format'](_0x5235('0x19d'),_0xe421ad[_0x5235('0x39')]));return this[_0x5235('0x37')][_0x5235('0xa3')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x5235('0x10')][_0x5235('0x19e')]=function(_0x4c88e3){logger[_0x5235('0x2e')](util['format'](_0x5235('0x19f'),_0x4c88e3['label']));if(!this[_0x5235('0x85')](_0x4c88e3[_0x5235('0x1a0')])){return this['channel'][_0x5235('0xa3')](_0x5235('0x1a1'));}var _0x1842b7=this[_0x5235('0x34')][_0x5235('0xbc')](this,_0x4c88e3[_0x5235('0x1a0')]);if(!_0x1842b7){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x4c88e3,_0x5235('0x1a2'));}var _0x478fa8={'body':_0x4c88e3['sms_text'],'phone':_0x4c88e3['to']||'','SmsAccountId':_0x1842b7['id']};logger[_0x5235('0xd9')](_0x5235('0x1a3'),JSON[_0x5235('0x76')](_0x478fa8));this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x4c88e3,_0x4c88e3[_0x5235('0x1a0')]);this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x1a4'),_0x1842b7['name']));this['createSmsMessage'][_0x5235('0xbc')](this,_0x478fa8);return this['channel']['noop'](_0x5235('0x1a5'));};AGIVertices[_0x5235('0x10')][_0x5235('0x1a6')]=function(_0x535e02){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x1a7'),_0x535e02[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x535e02[_0x5235('0xd3')])){return this[_0x5235('0x37')]['error'](_0x535e02,_0x5235('0x1a8'));}var _0x4a3b37=this[_0x5235('0x11')][_0x5235('0xbc')](this,_0x535e02[_0x5235('0xd3')]);if(!_0x4a3b37){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x535e02,_0x5235('0x117'));}return this[_0x5235('0x37')]['setVariable'](_0x4a3b37,_0x535e02[_0x5235('0x1a9')]);};AGIVertices[_0x5235('0x10')][_0x5235('0x1aa')]=function(_0x3f5fa3){logger[_0x5235('0x2e')](util[_0x5235('0x58')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3f5fa3[_0x5235('0x39')]));this['channel'][_0x5235('0xa3')](_0x5235('0x1ab'));if(_0x3f5fa3[_0x5235('0xb4')]===_0x5235('0x1ac')){this['channel'][_0x5235('0xa3')](_0x5235('0x1ad'));return this[_0x5235('0x37')][_0x5235('0xb4')]();}return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x1ae'));};AGIVertices['prototype']['subproject']=function(_0x2abd6c){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x1af'),_0x2abd6c['label']));if(!this[_0x5235('0x85')](_0x2abd6c['project_id'])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x2abd6c,_0x5235('0x1b0'));}var _0x264270=this['getSquareProject'][_0x5235('0xbc')](this,_0x2abd6c[_0x5235('0x1b1')]);if(!this[_0x5235('0x85')](_0x264270)){return this['channel'][_0x5235('0x2c')](_0x2abd6c,util[_0x5235('0x58')](_0x5235('0x1b2'),_0x2abd6c[_0x5235('0x1b1')]));}if(_0x264270===this[_0x5235('0x37')][_0x5235('0x3b')]){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x2abd6c,_0x5235('0x1b3'));}this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x2abd6c,_0x264270);var _0x5d0545=this[_0x5235('0x37')][_0x5235('0xa5')](_0x5235('0x1b4'),util[_0x5235('0x58')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x5235('0x7')][_0x5235('0x196')]||'127.0.0.1',_0x264270,this[_0x5235('0x37')][_0x5235('0x3b')]));if(_0x5d0545[_0x5235('0x9e')]===-0x1){return _0x5d0545;}return this['channel'][_0x5235('0xa3')](util['format']('Executed\x20command\x20%s\x20%s','AGI',_0x264270));};AGIVertices['prototype']['system']=function(_0x4e8646){logger[_0x5235('0x2e')](util['format'](_0x5235('0x1b5'),_0x4e8646[_0x5235('0x39')]));var _0xf8ab4b=this[_0x5235('0x5a')]['sync'](this,_0x4e8646['command']);this[_0x5235('0x36')][_0x5235('0xbc')](this,_0x4e8646,_0x4e8646[_0x5235('0xb2')]);if(this[_0x5235('0x85')](_0x4e8646[_0x5235('0xd3')])){var _0x6034e7=this['getVariable'][_0x5235('0xbc')](this,_0x4e8646[_0x5235('0xd3')]);if(_0x6034e7){this[_0x5235('0x37')]['setVariable'](_0x6034e7,_0xf8ab4b);return this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x1b6'),_0x4e8646[_0x5235('0xb2')],_0x6034e7));}}return this['channel']['noop'](util[_0x5235('0x58')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4e8646[_0x5235('0xb2')]));};AGIVertices[_0x5235('0x10')]['google_cloud_tts']=function(_0x4d27ce){logger[_0x5235('0x2e')](util['format'](_0x5235('0x1b7'),_0x4d27ce[_0x5235('0x39')]));_0x4d27ce[_0x5235('0x60')]=_0x4d27ce[_0x5235('0x60')][_0x5235('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5235('0x85')](_0x4d27ce[_0x5235('0x5e')])){return this[_0x5235('0x37')][_0x5235('0xa3')](_0x5235('0x1b8'));}if(!this[_0x5235('0x85')](_0x4d27ce[_0x5235('0x60')])){return this[_0x5235('0x37')]['noop'](_0x5235('0xa4'));}this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x1b9'),_0x4d27ce[_0x5235('0x60')]));var _0x135e2f=this[_0x5235('0x5d')][_0x5235('0xbc')](this,_0x4d27ce);if(_0x135e2f){this[_0x5235('0x37')]['noop'](util[_0x5235('0x58')](_0x5235('0x1ba'),_0x135e2f));var _0x516307=this[_0x5235('0x37')][_0x5235('0x102')](_0x135e2f);try{fs['unlink'](_0x135e2f+_0x5235('0x128'));}catch(_0xf2e708){logger[_0x5235('0x2c')](_0xf2e708);}return _0x516307;}return this[_0x5235('0x37')][_0x5235('0x2c')](_0x4d27ce,_0x5235('0x1bb'));};AGIVertices['prototype']['tts']=function(_0x1a88c8){logger['info'](util[_0x5235('0x58')](_0x5235('0x1bc'),_0x1a88c8[_0x5235('0x39')]));_0x1a88c8[_0x5235('0x60')]=_0x1a88c8[_0x5235('0x60')][_0x5235('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5235('0x85')](_0x1a88c8[_0x5235('0x60')])){return this[_0x5235('0x37')][_0x5235('0xa3')]('no\x20text\x20configured');}this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x1bd'),_0x1a88c8[_0x5235('0x60')]));var _0x582690=this[_0x5235('0x65')][_0x5235('0xbc')](this,_0x1a88c8);if(_0x582690){this[_0x5235('0x37')][_0x5235('0xa3')](util['format'](_0x5235('0x1be'),_0x582690));var _0x5a3f8d=this[_0x5235('0x37')][_0x5235('0x102')](_0x582690);try{fs[_0x5235('0x127')](_0x582690+_0x5235('0x128'));}catch(_0x356c68){logger[_0x5235('0x2c')](_0x356c68);}return _0x5a3f8d;}return this[_0x5235('0x37')][_0x5235('0x2c')](_0x1a88c8,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5235('0x10')][_0x5235('0x1bf')]=function(_0x1cb336){logger[_0x5235('0x2e')](util['format'](_0x5235('0x1c0'),_0x1cb336['label']));if(!this[_0x5235('0x85')](_0x1cb336[_0x5235('0x158')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x1cb336,_0x5235('0x159'));}logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x15a'),this['channel'][_0x5235('0x53')],_0x1cb336[_0x5235('0x158')]));var _0x3944ac=this[_0x5235('0x54')][_0x5235('0xbc')](this,_0x1cb336[_0x5235('0x158')]);if(_0x3944ac){logger['info'](util[_0x5235('0x58')](_0x5235('0x15b'),this[_0x5235('0x37')][_0x5235('0x53')],_0x1cb336[_0x5235('0x158')]));this['channel'][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x15b'),this['channel'][_0x5235('0x53')],_0x1cb336[_0x5235('0x158')]));return{'code':0xc8,'result':_0x5235('0x15c')};}else{logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x15d'),this[_0x5235('0x37')][_0x5235('0x53')],_0x1cb336[_0x5235('0x158')]));this[_0x5235('0x37')][_0x5235('0xa3')](util[_0x5235('0x58')](_0x5235('0x15d'),this[_0x5235('0x37')][_0x5235('0x53')],_0x1cb336[_0x5235('0x158')]));return{'code':0xc8,'result':_0x5235('0x160')};}};AGIVertices[_0x5235('0x10')]['voicemail']=function(_0x1cf131){logger[_0x5235('0x2e')](util['format'](_0x5235('0x1c1'),_0x1cf131['label']));var _0x3ee609=this['channel'][_0x5235('0xa5')](_0x5235('0x1c2'),[_0x1cf131[_0x5235('0x1c3')],_0x1cf131[_0x5235('0x79')]]);if(_0x3ee609[_0x5235('0x9e')]===-0x1){return _0x3ee609;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x5235('0x1c2'),_0x1cf131[_0x5235('0x1c3')]));};AGIVertices['prototype'][_0x5235('0x1c4')]=function(_0x482d60){logger[_0x5235('0x2e')](util[_0x5235('0x58')](_0x5235('0x1c5'),_0x482d60[_0x5235('0x39')]));if(!this[_0x5235('0x85')](_0x482d60[_0x5235('0xd3')])){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x482d60,_0x5235('0x1a8'));}var _0x29cbca=this['getVariable'][_0x5235('0xbc')](this,_0x482d60[_0x5235('0xd3')]);if(!_0x29cbca){return this[_0x5235('0x37')][_0x5235('0x2c')](_0x482d60,_0x5235('0x117'));}var _0x28fe1b=this['channel']['getVariable'](_0x29cbca);return{'code':0xc8,'result':_0x28fe1b[_0x5235('0x9f')]?_0x28fe1b[_0x5235('0x9f')]:'-'};};String[_0x5235('0x10')][_0x5235('0x1c6')]=function(_0x26ee9e,_0x21a452){return this[_0x5235('0x9d')](_0x26ee9e)[_0x5235('0x1c7')](_0x21a452);};module[_0x5235('0x1c8')]=AGIVertices; \ No newline at end of file +var _0x463f=['timeout','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','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','isEmpty','%s.%s','setVariable','replaceObjectAllVariables','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','url','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','dialogflow','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','createSquareDetailsReport','Trying\x20SestekNDA:\x20%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','context','extension','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','getIntervals','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','service','host','port','secure','authentication','auth','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','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://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','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','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','path','util','lodash','shelljs','odbc','randomstring','moment','request-promise','agi','../../config/environment','rawHeaders','rawBody','getdigits','getsecretdigits','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','close','getSmsAccount','createSmsMessage','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','priority','accountcode','file','createSquareMessage','createCmContact','isNil','callback_','random','lastName','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','method','number'];(function(_0x15d4bb,_0x4fb29a){var _0x4a3e1d=function(_0x44f395){while(--_0x44f395){_0x15d4bb['push'](_0x15d4bb['shift']());}};_0x4a3e1d(++_0x4fb29a);}(_0x463f,0x164));var _0xf463=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x463f[_0x46698a];return _0x356db0;};'use strict';var fs=require('fs');var path=require(_0xf463('0x0'));var util=require(_0xf463('0x1'));var _=require(_0xf463('0x2'));var sh=require(_0xf463('0x3'));var odbc=require(_0xf463('0x4'))();var rs=require(_0xf463('0x5'));var moment=require(_0xf463('0x6'));var Mustache=require('mustache');var rp=require(_0xf463('0x7'));var logger=require('../../config/logger')(_0xf463('0x8'));var config=require(_0xf463('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xf463('0xa'),_0xf463('0xb')];var verticesWithRetry=['menu',_0xf463('0xc'),_0xf463('0xd')];var AGIVertices=function(_0x8165d8,_0x4246fa,_0x20690d){this['channel']=_0x8165d8;this[_0xf463('0xe')]=_0x4246fa;this['mailRpc']=_0x20690d;};AGIVertices[_0xf463('0xf')][_0xf463('0x10')]=function(_0x18abc9,_0x184d8a){this[_0xf463('0xe')][_0xf463('0x11')](_0x18abc9)[_0xf463('0x12')](function(_0x21b934){_0x184d8a(null,_0x21b934?_0x21b934[_0xf463('0x13')]:![]);})[_0xf463('0x14')](function(_0x2b2255){_0x184d8a(_0x2b2255);});};AGIVertices['prototype'][_0xf463('0x15')]=function(_0x41abfb,_0x1627ad){this[_0xf463('0xe')][_0xf463('0x16')](_0x41abfb)[_0xf463('0x12')](function(_0x13e55f){_0x1627ad(null,_0x13e55f?_0x13e55f['name']:![]);})[_0xf463('0x14')](function(_0x513e22){_0x1627ad(_0x513e22);});};AGIVertices[_0xf463('0xf')][_0xf463('0x17')]=function(_0x200c86,_0x302597){this['rpc'][_0xf463('0x18')](_0x200c86)[_0xf463('0x12')](function(_0x2c83f6){_0x302597(null,_0x2c83f6?_0x2c83f6[_0xf463('0x13')]:![]);})['catch'](function(_0x204ae7){_0x302597(_0x204ae7);});};AGIVertices['prototype'][_0xf463('0x19')]=function(_0x4e9cb9,_0x4e0fc6){this['rpc'][_0xf463('0x1a')](_0x4e9cb9)[_0xf463('0x12')](function(_0x106e47){_0x4e0fc6(null,_0x106e47?_0x106e47[_0xf463('0x1b')]:![]);})[_0xf463('0x14')](function(_0x489e7e){_0x4e0fc6(_0x489e7e);});};AGIVertices[_0xf463('0xf')][_0xf463('0x1c')]=function(_0x1642b5,_0x442e25){this[_0xf463('0xe')][_0xf463('0x1d')](_0x1642b5)[_0xf463('0x12')](function(_0x3b0e4d){_0x442e25(null,_0x3b0e4d?_0x3b0e4d[_0xf463('0x13')]:![]);})['catch'](function(_0x259161){_0x442e25(_0x259161);});};AGIVertices['prototype']['getTrunk']=function(_0x25fb78,_0x470cb4){this[_0xf463('0xe')][_0xf463('0x1e')](_0x25fb78)[_0xf463('0x12')](function(_0x17c494){_0x470cb4(null,_0x17c494?_0x17c494[_0xf463('0x13')]:![]);})[_0xf463('0x14')](function(_0x7c0e76){_0x470cb4(_0x7c0e76);});};AGIVertices[_0xf463('0xf')][_0xf463('0x1f')]=function(_0x7a48bc,_0x1be0ac){var _0x452df1=this;this['rpc'][_0xf463('0x20')](_0x7a48bc)[_0xf463('0x12')](function(_0xe13dce){_0x1be0ac(null,_0xe13dce?_0x452df1[_0xf463('0x21')](_0xe13dce[_0xf463('0x22')]):![]);})[_0xf463('0x14')](function(_0x4643fc){_0x1be0ac(_0x4643fc);});};AGIVertices[_0xf463('0xf')][_0xf463('0x23')]=function(_0x3c947a,_0x3d6425){this[_0xf463('0xe')][_0xf463('0x24')](_0x3c947a)[_0xf463('0x12')](function(_0x3ab539){_0x3d6425(null,_0x3ab539?_0x3ab539:![]);})['catch'](function(_0x2be652){_0x3d6425(_0x2be652);});};AGIVertices[_0xf463('0xf')][_0xf463('0x25')]=function(_0x266ce8,_0x9feffc,_0x4b3b30){this[_0xf463('0x26')][_0xf463('0x25')](_0x266ce8,_0x9feffc)[_0xf463('0x12')](function(){_0x4b3b30(null);})[_0xf463('0x14')](function(_0x2821cb){_0x4b3b30(_0x2821cb);});};AGIVertices[_0xf463('0xf')]['getIntervals']=function(_0x5eb590,_0x53e694){this[_0xf463('0xe')][_0xf463('0x27')](_0x5eb590)[_0xf463('0x12')](function(_0x4b4082){if(_0x4b4082){if(_0x4b4082[_0xf463('0x28')]){_0x53e694(null,[_0x4b4082[_0xf463('0x29')]]);}else{_0x53e694(null,_['map'](_0x4b4082['Intervals'],_0xf463('0x29')));}}else{_0x53e694(null,![]);}})[_0xf463('0x14')](function(_0xde5532){_0x53e694(_0xde5532);});};AGIVertices['prototype'][_0xf463('0x21')]=function(_0x1ceb10){return util[_0xf463('0x2a')](_0xf463('0x2b'),FILES_PATH,_0x1ceb10);};AGIVertices[_0xf463('0xf')][_0xf463('0x2c')]=function(_0x2b1fe2,_0x5c839d,_0x340bc0){odbc[_0xf463('0x2d')](_0x2b1fe2,function(_0x7c9f9a){if(_0x7c9f9a){logger[_0xf463('0x2e')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x7c9f9a);_0x340bc0(_0x7c9f9a);}else{logger['info'](_0xf463('0x2f'));odbc[_0xf463('0x30')](_0x5c839d,function(_0x551150,_0x2a7458){if(_0x551150){logger[_0xf463('0x31')](_0xf463('0x32'),_0x5c839d);_0x340bc0(_0x551150);}else{logger[_0xf463('0x31')]('Query\x20executed\x20correctly\x20%s',_0x5c839d);odbc[_0xf463('0x33')](function(_0x4624fb){if(_0x4624fb){logger[_0xf463('0x2e')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4624fb);}_0x340bc0(null,_0x2a7458);});}});}});};AGIVertices['prototype'][_0xf463('0x34')]=function(_0x5328a2,_0x3dfbbe){this['rpc']['getSmsAccountById'](_0x5328a2)[_0xf463('0x12')](function(_0x28ef77){_0x3dfbbe(null,_0x28ef77?_0x28ef77:![]);})[_0xf463('0x14')](function(_0x43e5ab){_0x3dfbbe(_0x43e5ab);});};AGIVertices[_0xf463('0xf')][_0xf463('0x35')]=function(_0x19b0aa,_0x181ee2){this[_0xf463('0xe')][_0xf463('0x35')](_0x19b0aa)[_0xf463('0x12')](function(_0x5e7ba9){_0x181ee2(null,_0x5e7ba9);})[_0xf463('0x14')](function(_0x2a2ca6){_0x181ee2(_0x2a2ca6);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x2f7d48,_0x525717,_0x15e08c){this[_0xf463('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0xf463('0x36')][_0xf463('0x37')],'node':_0x2f7d48[_0xf463('0x38')],'application':_0x2f7d48[_0xf463('0x39')],'data':_0x525717||null,'project_name':this[_0xf463('0x36')][_0xf463('0x3a')],'callerid':this['channel'][_0xf463('0x3b')]})[_0xf463('0x12')](function(_0x47e0ab){if(_0x15e08c){_0x15e08c(null,_0x47e0ab);}})[_0xf463('0x14')](function(_0x36f9ca){if(_0x15e08c){_0x15e08c(_0x36f9ca);}});};AGIVertices[_0xf463('0xf')][_0xf463('0x3c')]=function(_0x4384bc,_0x1cbe46,_0x230d6f,_0x31aa1e){this[_0xf463('0xe')]['createSquareRecording']({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xf463('0x36')][_0xf463('0x3b')],'calleridname':this[_0xf463('0x36')][_0xf463('0x3d')],'context':this[_0xf463('0x36')]['context'],'extension':this[_0xf463('0x36')]['extension'],'priority':this[_0xf463('0x36')][_0xf463('0x3e')],'accountcode':this[_0xf463('0x36')][_0xf463('0x3f')],'dnid':this[_0xf463('0x36')]['dnid'],'projectName':this[_0xf463('0x36')][_0xf463('0x3a')],'saveName':_0x1cbe46,'filename':_0x4384bc[_0xf463('0x40')]||_0x1cbe46,'savePath':_0x230d6f})[_0xf463('0x12')](function(_0x42abd7){_0x31aa1e(null,_0x42abd7);})[_0xf463('0x14')](function(_0x65dd9){_0x31aa1e(_0x65dd9);});};AGIVertices[_0xf463('0xf')][_0xf463('0x41')]=function(_0x447393,_0x38e34e,_0x450e6b,_0x20a9b2,_0x230804){this[_0xf463('0xe')][_0xf463('0x41')]({'uniqueid':this['channel']['uniqueid'],'body':_0x447393,'direction':_0x38e34e,'providerName':_0x450e6b,'providerResponse':_0x20a9b2})[_0xf463('0x12')](function(_0x408027){if(_0x230804){_0x230804(null,_0x408027);}})[_0xf463('0x14')](function(_0x2c2395){if(_0x230804){_0x230804(_0x2c2395);}});};AGIVertices[_0xf463('0xf')][_0xf463('0x42')]=function(_0x73d93f,_0x25e38e){this[_0xf463('0xe')][_0xf463('0x42')]({'firstName':_['isEmpty'](_0x73d93f[_0xf463('0x13')])||_[_0xf463('0x43')](_0x73d93f[_0xf463('0x13')])?_0xf463('0x44')+Math[_0xf463('0x45')]():_0x73d93f[_0xf463('0x13')],'lastName':_['isEmpty'](_0x73d93f['lastName'])||_[_0xf463('0x43')](_0x73d93f[_0xf463('0x46')])?null:_0x73d93f[_0xf463('0x46')],'phone':_0x73d93f[_0xf463('0x47')],'ListId':_0x73d93f['list_id'],'scheduledat':_0x73d93f['scheduledAt'],'callbackUniqueid':this[_0xf463('0x36')]['uniqueid'],'tags':_0xf463('0x48'),'description':_0xf463('0x49')+_0x73d93f[_0xf463('0x4a')][_0xf463('0x4b')](),'priority':_0x73d93f[_0xf463('0x4c')]})['then'](function(_0x5bc065){_0x25e38e(null,_0x5bc065);})[_0xf463('0x14')](function(_0x1d5bac){_0x25e38e(_0x1d5bac);});};AGIVertices[_0xf463('0xf')][_0xf463('0x4d')]=function(_0x3b447b,_0x17a2c8){this[_0xf463('0xe')][_0xf463('0x4e')](_0x3b447b)[_0xf463('0x12')](function(_0x21505a){_0x17a2c8(null,_0x21505a?_0x21505a['name']:![]);})[_0xf463('0x14')](function(_0x499985){_0x17a2c8(_0x499985);});};AGIVertices[_0xf463('0xf')][_0xf463('0x4f')]=function(_0x5a0015,_0x51170f,_0x521f98){var _0x2e6a4e={'role':_0xf463('0x50')};_0x2e6a4e[_0x5a0015]=this[_0xf463('0x36')]['callerid'];this['rpc'][_0xf463('0x4f')](_0x2e6a4e,_0x51170f,this[_0xf463('0x36')]['uniqueid'])[_0xf463('0x12')](function(_0xca7be1){_0x521f98(null,_[_0xf463('0x43')](_0xca7be1)?![]:!![]);})[_0xf463('0x14')](function(_0x367129){logger[_0xf463('0x2e')](_0x367129);_0x521f98(null,![]);});};AGIVertices[_0xf463('0xf')][_0xf463('0x51')]=function(_0x3179a1,_0x41d09b){var _0x30b36a={'role':'agent'};_0x30b36a[_0x3179a1]=this[_0xf463('0x36')][_0xf463('0x3b')];this['rpc'][_0xf463('0x51')](_0x30b36a)['then'](function(_0x4a4cee){_0x41d09b(null,_['isNil'](_0x4a4cee)?![]:!![]);})[_0xf463('0x14')](function(_0x5d959c){logger[_0xf463('0x2e')](_0x5d959c);_0x41d09b(null,![]);});};AGIVertices[_0xf463('0xf')]['agentLogout']=function(_0xd14cab,_0x1c9b52){var _0x4c88a0={'role':_0xf463('0x50')};_0x4c88a0[_0xd14cab]=this[_0xf463('0x36')][_0xf463('0x3b')];this[_0xf463('0xe')]['agentLogout'](_0x4c88a0)[_0xf463('0x12')](function(_0x436ef9){_0x1c9b52(null,_['isNil'](_0x436ef9)?![]:!![]);})[_0xf463('0x14')](function(_0x1e5073){logger['error'](_0x1e5073);_0x1c9b52(null,![]);});};AGIVertices[_0xf463('0xf')][_0xf463('0x52')]=function(_0x10ad86,_0x218220){var _0x185985={'role':_0xf463('0x50')};_0x185985[_0x10ad86]=this[_0xf463('0x36')]['callerid'];var _0x4b88ce=_0x10ad86!=_0xf463('0x53')?util['format']('%s/%s@from-sip/n',_0xf463('0x54'),this['channel']['callerid']):undefined;this[_0xf463('0xe')][_0xf463('0x52')](_0x185985,_0x4b88ce)['then'](function(_0x1ec956){_0x218220(null,_[_0xf463('0x43')](_0x1ec956)?![]:!![]);})[_0xf463('0x14')](function(_0x7ac31){logger[_0xf463('0x2e')](_0x7ac31);_0x218220(null,![]);});};AGIVertices[_0xf463('0xf')][_0xf463('0x55')]=function(_0x1e55de,_0x3a439a){sh[_0xf463('0x56')](_[_0xf463('0x57')](_0x1e55de),function(_0x443700,_0x3a5b53){var _0x5838c9=_0x3a5b53[_0xf463('0x58')](/(\r\n|\n|\r)/gm,'');_0x3a439a(null,_0x5838c9);});};AGIVertices['prototype'][_0xf463('0x59')]=function(_0x26596c,_0x3983bf){scripts['googleCloudTTS'](_0x26596c[_0xf463('0x5a')],_0x26596c[_0xf463('0x5b')]||_0xf463('0x5c'),_0x26596c['text'],_0x26596c[_0xf463('0x5d')]||_0xf463('0x5e'),_0x26596c[_0xf463('0x5f')]||_0xf463('0x60'),_0x26596c['audioEncoding']||_0xf463('0x61'))['then'](function(_0x2de69f){_0x3983bf(null,_0x2de69f);})[_0xf463('0x14')](function(_0x14115d){_0x3983bf(_0x14115d);});};AGIVertices['prototype'][_0xf463('0x62')]=function(_0x34a987,_0x1eed13){scripts[_0xf463('0x62')](_0x34a987[_0xf463('0x5c')],_0x34a987[_0xf463('0x63')]||'en',0x1)[_0xf463('0x12')](function(_0x158156){_0x1eed13(null,_0x158156);})[_0xf463('0x14')](function(_0x92c4d7){_0x1eed13(_0x92c4d7);});};AGIVertices[_0xf463('0xf')]['restAPI']=function(_0x272904,_0x1b0bf5){var _0x22a4e9={'uri':_0x272904['url'],'method':_0x272904[_0xf463('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x272904['timeout'])===_0xf463('0x65')&&parseInt(_0x272904[_0xf463('0x66')])>=0x1?parseInt(_0x272904[_0xf463('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xf463('0x67')]([_0xf463('0x68'),_0xf463('0x69')],_0x22a4e9[_0xf463('0x64')][_0xf463('0x6a')]())){try{_0x22a4e9[_0xf463('0x6b')]=_0x272904[_0xf463('0xb')]?JSON[_0xf463('0x6c')](_0x272904[_0xf463('0xb')]):{};}catch(_0x489297){logger[_0xf463('0x2e')](_0xf463('0x6d'),_0x489297);}}try{_0x22a4e9[_0xf463('0x6e')]=_0x272904[_0xf463('0xa')]?JSON['parse'](_0x272904[_0xf463('0xa')]):{};}catch(_0x558c0a){logger['error'](_0xf463('0x6f'),_0x558c0a);}if(_0x272904[_0xf463('0x70')]){try{var _0x4159e2=require(_0x272904[_0xf463('0x70')])[_0xf463('0x71')](this,_0x22a4e9);_0x22a4e9[_0xf463('0x72')]=Mustache['render'](_0x272904['url'],_0x4159e2,{},['$$','$$']);if(_0x22a4e9[_0xf463('0x6e')]){_0x22a4e9[_0xf463('0x6e')]=JSON[_0xf463('0x6c')](Mustache[_0xf463('0x73')](JSON['stringify'](_0x22a4e9['headers']),_0x4159e2,{},['$$','$$']));}if(_0x22a4e9[_0xf463('0x6b')]){_0x22a4e9['body']=JSON[_0xf463('0x6c')](Mustache[_0xf463('0x73')](JSON[_0xf463('0x74')](_0x22a4e9['body']),_0x4159e2,{},['$$','$$']));}}catch(_0x265290){logger['error'](_0xf463('0x75'),_0x265290);}}rp(_0x22a4e9)[_0xf463('0x12')](function(_0x31aa00){var _0x5ed71e={'statusCode':_0x31aa00[_0xf463('0x76')]||0xc8,'statusMessage':_0x31aa00['statusMessage']||'OK','headers':_0x31aa00[_0xf463('0x6e')]||{},'body':_0x31aa00['body']||{}};_0x1b0bf5(null,_0x5ed71e);})[_0xf463('0x14')](function(_0x1203d4){var _0x39b3c2={'statusCode':_0x1203d4[_0xf463('0x76')]||0x1f4,'statusMessage':_0x1203d4[_0xf463('0x77')]||_0xf463('0x78'),'headers':_0x1203d4[_0xf463('0x79')][_0xf463('0x6e')]||{},'body':_0x1203d4['options'][_0xf463('0x6b')]||{}};_0x1b0bf5(null,_0x39b3c2);});};AGIVertices[_0xf463('0xf')][_0xf463('0x7a')]=function(_0x430e8d,_0x4486c1){scripts[_0xf463('0x7a')](this[_0xf463('0x36')][_0xf463('0x37')],_0x430e8d[_0xf463('0x7b')],_0x430e8d['text'],_0x430e8d['dialogflow_language']||'en')['then'](function(_0x4c8e5e){_0x4486c1(null,_0x4c8e5e);})[_0xf463('0x14')](function(_0x2b55d1){_0x4486c1(_0x2b55d1);});};AGIVertices[_0xf463('0xf')][_0xf463('0x7c')]=function(_0x580d01,_0x5be8e1){scripts[_0xf463('0x7c')](this[_0xf463('0x36')]['uniqueid'],_0x580d01['dialogflowV2_project_id'],_0x580d01[_0xf463('0x7d')],_0x580d01[_0xf463('0x7e')],_0x580d01[_0xf463('0x5c')],_0x580d01[_0xf463('0x7f')]||'en')[_0xf463('0x12')](function(_0x5bb1fb){_0x5be8e1(null,_0x5bb1fb);})[_0xf463('0x14')](function(_0x46567c){_0x5be8e1(_0x46567c);});};AGIVertices[_0xf463('0xf')][_0xf463('0x80')]=function(_0xad84d9,_0x99b3c0){scripts[_0xf463('0x80')](this[_0xf463('0x36')],_0xad84d9)[_0xf463('0x12')](function(_0xf6235d){_0x99b3c0(null,_0xf6235d);})['catch'](function(_0x553cbb){_0x99b3c0(_0x553cbb);});};AGIVertices[_0xf463('0xf')]['ispeechTTS']=function(_0x13c0f4,_0x4c28d7){scripts[_0xf463('0x81')](_0x13c0f4[_0xf463('0x7b')],_0x13c0f4['text'],_0x13c0f4[_0xf463('0x82')]||_0xf463('0x5e'),_0x13c0f4['speed'])[_0xf463('0x12')](function(_0x4175f3){_0x4c28d7(null,_0x4175f3);})['catch'](function(_0x256557){_0x4c28d7(_0x256557);});};AGIVertices[_0xf463('0xf')]['ispeechASR']=function(_0x4e3915,_0x4a48c1,_0x306c83){scripts['ispeechASR'](_0x4a48c1,_0x4e3915['key'],_0x4e3915[_0xf463('0x83')]||_0xf463('0x5e'),this['isConfigured'](_0x4e3915['model'])?_0x4e3915[_0xf463('0x84')]:undefined)[_0xf463('0x12')](function(_0xce8e1){_0x306c83(null,_0xce8e1);})[_0xf463('0x14')](function(_0x2de7c3){_0x306c83(_0x2de7c3);});};AGIVertices[_0xf463('0xf')][_0xf463('0x85')]=function(_0x3c82ac,_0x55db38){scripts[_0xf463('0x85')](_0x3c82ac[_0xf463('0x86')],_0x3c82ac[_0xf463('0x87')],_0x3c82ac[_0xf463('0x88')],_0x3c82ac[_0xf463('0x89')]||_0xf463('0x8a'),_0x3c82ac[_0xf463('0x5c')],_0x3c82ac[_0xf463('0x8b')]||'text')[_0xf463('0x12')](function(_0x596d22){_0x55db38(null,_0x596d22);})[_0xf463('0x14')](function(_0x22d650){_0x55db38(_0x22d650);});};AGIVertices['prototype']['awsLex']=function(_0x26efc4,_0x4fe13e){scripts['awsLex'](this[_0xf463('0x36')][_0xf463('0x37')],_0x26efc4[_0xf463('0x86')],_0x26efc4[_0xf463('0x87')],_0x26efc4[_0xf463('0x8c')],_0x26efc4[_0xf463('0x5c')],_0x26efc4[_0xf463('0x8d')])[_0xf463('0x12')](function(_0x48d857){_0x4fe13e(null,_0x48d857);})[_0xf463('0x14')](function(_0x1767e2){_0x4fe13e(_0x1767e2);});};AGIVertices['prototype'][_0xf463('0x8e')]=function(_0x493fae,_0x5f303f,_0x5224ee){scripts[_0xf463('0x8e')](_0x5f303f,_0x493fae['key'],_0x493fae[_0xf463('0x8f')]||_0xf463('0x5e'))[_0xf463('0x12')](function(_0x16d748){_0x5224ee(null,_0x16d748);})[_0xf463('0x14')](function(_0x1541ba){_0x5224ee(_0x1541ba);});};AGIVertices['prototype'][_0xf463('0x90')]=function(_0x1dba6b,_0x5dde80,_0xab7a51){scripts[_0xf463('0x90')](_0x5dde80,_0x1dba6b[_0xf463('0x91')],_0x1dba6b[_0xf463('0x92')],_0x1dba6b[_0xf463('0x72')])[_0xf463('0x12')](function(_0x32bd96){_0xab7a51(null,_0x32bd96);})[_0xf463('0x14')](function(_0x5d76e0){_0xab7a51(_0x5d76e0);});};AGIVertices['prototype'][_0xf463('0x93')]=function(_0x5e1e60){var _0x418d9e=_[_0xf463('0x67')](verticesWithRetry,_0x5e1e60[_0xf463('0x39')])?_0x5e1e60:_[_0xf463('0x94')](_0x5e1e60);for(var _0x1e1c04 in _0x418d9e){if(_0x418d9e[_0xf463('0x95')](_0x1e1c04)){if(_0x418d9e[_0x1e1c04]&&_[_0xf463('0x96')](_0x418d9e[_0x1e1c04])){if(_[_0xf463('0x67')](recursiveMapAttributes,_0x1e1c04)){_0x418d9e[_0x1e1c04]=this['replaceObjectAllVariables'](_0x418d9e[_0x1e1c04]);}else{_0x418d9e[_0x1e1c04]=this[_0xf463('0x97')](_0x418d9e[_0x1e1c04]);}}}}return _0x418d9e;};AGIVertices[_0xf463('0xf')][_0xf463('0x98')]=function(_0x57d372){for(var _0x4f21af in _0x57d372){if(_0x57d372[_0xf463('0x95')](_0x4f21af)){if(_[_0xf463('0x99')](_0x57d372[_0x4f21af])){this[_0xf463('0x98')](_0x57d372[_0x4f21af]);}else if(_[_0xf463('0x9a')](_0x57d372[_0x4f21af])){for(var _0x25136c=0x0;_0x25136c<_0x57d372[_0x4f21af][_0xf463('0x9b')];_0x25136c++){this['recursiveNodeIndex'](_0x57d372[_0x4f21af][_0x25136c]);}}else if(_['isString'](_0x57d372[_0x4f21af])){_0x57d372[_0x4f21af]=this['replaceAllVariables'](_0x57d372[_0x4f21af]);}}}};AGIVertices[_0xf463('0xf')][_0xf463('0x9c')]=function(_0x766956,_0x332fcc){for(var _0x40224c in _0x766956){if(_0x766956['hasOwnProperty'](_0x40224c)){if(_['isPlainObject'](_0x766956[_0x40224c])){if(!_[_0xf463('0x9d')](_0x766956[_0x40224c])){this['saveRestApiResult'](_0x766956[_0x40224c],util[_0xf463('0x2a')](_0xf463('0x9e'),_0x332fcc,_0x40224c));}}else if(_[_0xf463('0x9a')](_0x766956[_0x40224c])){for(var _0x594080=0x0;_0x594080<_0x766956[_0x40224c][_0xf463('0x9b')];_0x594080++){this['saveRestApiResult'](_0x766956[_0x40224c][_0x594080],util[_0xf463('0x2a')]('%s.%s',_0x332fcc,_0x40224c+'['+_0x594080+']'));}}else{if(!_['isNil'](_0x766956[_0x40224c])){this[_0xf463('0x36')][_0xf463('0x9f')](util['format'](_0xf463('0x9e'),_0x332fcc,_0x40224c),_0x766956[_0x40224c]);}}}}};AGIVertices[_0xf463('0xf')][_0xf463('0xa0')]=function(_0x10f48c){try{var _0x224e29=JSON[_0xf463('0x6c')](_0x10f48c);this[_0xf463('0x98')](_0x224e29);return JSON[_0xf463('0x74')](_0x224e29);}catch(_0x177c53){return this[_0xf463('0x97')](_0x10f48c);}};AGIVertices['prototype'][_0xf463('0x97')]=function(_0x11f392){var _0x1dc21a=_0x11f392[_0xf463('0xa1')]('{');for(var _0x7c8458=0x1;_0x7c8458<_0x1dc21a[_0xf463('0x9b')];_0x7c8458+=0x1){var _0x1ec02d=_0x1dc21a[_0x7c8458]['split']('}');if(_0x1ec02d[_0xf463('0x9b')]>0x1){_0x11f392=_0x11f392['replaceAll']('{'+_0x1ec02d[0x0]+'}',this[_0xf463('0x36')]['getVariable'](_0x1ec02d[0x0])[_0xf463('0xa2')]||_0x1ec02d[0x0]);}}if(_0x1dc21a[_0xf463('0x9b')]===0x1){return _0x11f392[_0xf463('0x4b')]();}return this['replaceAllVariables'](_0x11f392);};AGIVertices[_0xf463('0xf')][_0xf463('0xa3')]=function(_0x1aab21,_0x41c870){var _0x50add6=this[_0xf463('0x36')][_0xf463('0x10')](_0x1aab21);if(_0x50add6['result']===-0x1){return _0x50add6;}logger[_0xf463('0x31')](util['format'](_0xf463('0xa4'),_0x41c870,_0x50add6[_0xf463('0xa2')]));return this[_0xf463('0x36')][_0xf463('0x9f')](_0x41c870,_0x50add6[_0xf463('0xa2')]);};AGIVertices['prototype'][_0xf463('0xa5')]=function(_0x54550e){return _0x54550e&&_0x54550e!=='0'&&_0x54550e!=='-1'&&_0x54550e!=='';};AGIVertices[_0xf463('0xf')][_0xf463('0xa6')]=function(_0x1d7c58){this['createSquareDetailsReport'][_0xf463('0x71')](this,_0x1d7c58,'-');_0x1d7c58[_0xf463('0xa7')]=_0x1d7c58['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xf463('0xa8')]=function(_0x2f361e){logger[_0xf463('0x31')](util['format'](_0xf463('0xa9'),_0x2f361e['label']));if(!this[_0xf463('0xa5')](_0x2f361e[_0xf463('0x5c')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xab'));}var _0xb42563='\x22'+_0x2f361e[_0xf463('0x5c')]+'\x22';if(this[_0xf463('0xa5')](_0x2f361e[_0xf463('0x79')])){_0xb42563+=','+_0x2f361e[_0xf463('0x79')];}var _0x2a1cb=this[_0xf463('0x36')]['exec'](_0xf463('0xac'),_0xb42563);if(_0x2a1cb[_0xf463('0xad')]===-0x1){return _0x2a1cb;}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xae'),_0xb42563));};AGIVertices[_0xf463('0xf')][_0xf463('0xaf')]=function(_0x530994){logger['info'](util[_0xf463('0x2a')](_0xf463('0xb0'),_0x530994['label']));if(!this[_0xf463('0xa5')](_0x530994[_0xf463('0xb1')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xb2'));}var _0xdce187=_0x530994[_0xf463('0xb1')];if(this['isConfigured'](_0x530994['options'])){_0xdce187+=','+_0x530994[_0xf463('0x79')];}var _0x3ccd89=this['channel'][_0xf463('0x56')](_0xf463('0xb3'),_0xdce187);if(_0x3ccd89[_0xf463('0xad')]===-0x1){return _0x3ccd89;}var _0x40f119=this[_0xf463('0xa3')](_0xf463('0xb4'),'MRCP_RECOG_CONFIDENCE');if(_0x40f119[_0xf463('0xad')]===-0x1){return _0x40f119;}var _0x441566=this[_0xf463('0xa3')]('RECOG_INPUT()',_0xf463('0xb5'));if(_0x441566[_0xf463('0xad')]===-0x1){return _0x441566;}var _0x1b9027=this[_0xf463('0xa3')](_0xf463('0xb6'),_0xf463('0xb7'));if(_0x1b9027[_0xf463('0xad')]===-0x1){return _0x1b9027;}return this[_0xf463('0x36')][_0xf463('0xaa')](util['format'](_0xf463('0xb8'),_0xdce187));};AGIVertices['prototype'][_0xf463('0x8')]=function(_0x549810){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0xb9'),_0x549810['label']));return this[_0xf463('0x36')][_0xf463('0x8')]([_0x549810['command'],_0x549810[_0xf463('0xba')]]);};AGIVertices[_0xf463('0xf')][_0xf463('0xbb')]=function(_0x3ee19e){logger[_0xf463('0x31')](util['format'](_0xf463('0xbc'),_0x3ee19e['label']));if(this[_0xf463('0xa5')](_0x3ee19e[_0xf463('0x66')])){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0xbd'),_0x3ee19e['timeout']));var _0x463d0e=this[_0xf463('0x36')][_0xf463('0xbe')](_0x3ee19e[_0xf463('0x66')]);if(_0x463d0e[_0xf463('0xad')]===-0x1){return _0x463d0e;}}return this['channel'][_0xf463('0xbb')]();};AGIVertices[_0xf463('0xf')][_0xf463('0x48')]=function(_0x2192db){logger['info'](util[_0xf463('0x2a')](_0xf463('0xbf'),_0x2192db[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x2192db[_0xf463('0xc0')])){return this[_0xf463('0x36')]['error'](_0x2192db,'no\x20list\x20selected');}_0x2192db[_0xf463('0x4a')]=moment();if(this['isConfigured'](_0x2192db['delay'])){_0x2192db['scheduledAt']=moment()[_0xf463('0xc1')](_0x2192db[_0xf463('0xc2')],_0xf463('0xc3'));}if(!this['isConfigured'](_0x2192db['callback_priority'])){_0x2192db[_0xf463('0x4c')]=0x2;}this['createCmContact']['sync'](this,_0x2192db);return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xc4'),_0x2192db['phone'],_0x2192db[_0xf463('0xc0')],_0x2192db[_0xf463('0x4a')]));};AGIVertices[_0xf463('0xf')]['custom_app']=function(_0x1a9784){logger[_0xf463('0x31')](util[_0xf463('0x2a')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1a9784[_0xf463('0x38')]));var _0x2b121c=this[_0xf463('0x36')]['exec'](_0x1a9784[_0xf463('0xc5')],_0x1a9784[_0xf463('0x79')]);if(_0x2b121c['result']===-0x1){return _0x2b121c;}return this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xc6'),_0x1a9784[_0xf463('0xc5')],_0x1a9784['options']));};AGIVertices[_0xf463('0xf')][_0xf463('0xc7')]=function(_0x4c3de0){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0xc8'),_0x4c3de0[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x4c3de0[_0xf463('0x5c')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xab'));}var _0xd8711='\x22'+_0x4c3de0[_0xf463('0x5c')]+'\x22';if(this[_0xf463('0xa5')](_0x4c3de0[_0xf463('0x79')])){_0xd8711+=','+_0x4c3de0[_0xf463('0x79')];}var _0x3f7c17=this[_0xf463('0x36')]['exec'](_0xf463('0xac'),_0xd8711);if(_0x3f7c17[_0xf463('0xad')]===-0x1){return _0x3f7c17;}return this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xae'),_0xd8711));};AGIVertices[_0xf463('0xf')][_0xf463('0xc9')]=function(_0xf2bb64){logger[_0xf463('0x31')](util[_0xf463('0x2a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xf2bb64[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0xf2bb64[_0xf463('0x5c')])){return this['channel']['noop'](_0xf463('0xab'));}var _0x423038='\x22'+_0xf2bb64[_0xf463('0x5c')]+'\x22';if(this[_0xf463('0xa5')](_0xf2bb64['options'])){_0x423038+=','+_0xf2bb64[_0xf463('0x79')];}var _0x38ddc0=this['channel']['exec'](_0xf463('0xac'),_0x423038);if(_0x38ddc0[_0xf463('0xad')]===-0x1){return _0x38ddc0;}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x423038));};AGIVertices[_0xf463('0xf')][_0xf463('0xca')]=function(_0x470c6b){logger['info'](util[_0xf463('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x470c6b[_0xf463('0x38')]));if(!this['isConfigured'](_0x470c6b[_0xf463('0xb1')])){return this[_0xf463('0x36')]['noop'](_0xf463('0xb2'));}var _0x583539=_0x470c6b[_0xf463('0xb1')];if(this[_0xf463('0xa5')](_0x470c6b['options'])){_0x583539+=','+_0x470c6b[_0xf463('0x79')];}var _0x542411=this[_0xf463('0x36')][_0xf463('0x56')](_0xf463('0xb3'),_0x583539);if(_0x542411[_0xf463('0xad')]===-0x1){return _0x542411;}var _0x5b65f8=this[_0xf463('0xa3')](_0xf463('0xb4'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5b65f8[_0xf463('0xad')]===-0x1){return _0x5b65f8;}var _0x1f4fdb=this[_0xf463('0xa3')](_0xf463('0xcb'),_0xf463('0xcc'));if(_0x1f4fdb[_0xf463('0xad')]===-0x1){return _0x1f4fdb;}var _0x1f4dbd=this[_0xf463('0xa3')](_0xf463('0xb6'),_0xf463('0xcd'));if(_0x1f4dbd['result']===-0x1){return _0x1f4dbd;}return this['channel']['noop'](util[_0xf463('0x2a')](_0xf463('0xb8'),_0x583539));};AGIVertices[_0xf463('0xf')]['sestekasr']=function(_0x39e461){logger['info'](util[_0xf463('0x2a')](_0xf463('0xce'),_0x39e461[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x39e461[_0xf463('0xb1')])){return this['channel'][_0xf463('0xaa')](_0xf463('0xb2'));}var _0x4b15f5=_0x39e461[_0xf463('0xb1')];if(this[_0xf463('0xa5')](_0x39e461['options'])){_0x4b15f5+=','+_0x39e461['options'];}var _0x3e36d1=this['channel'][_0xf463('0x56')](_0xf463('0xb3'),_0x4b15f5);if(_0x3e36d1[_0xf463('0xad')]===-0x1){return _0x3e36d1;}var _0xe1d16=this[_0xf463('0xa3')]('RECOG_CONFIDENCE()',_0xf463('0xcf'));if(_0xe1d16['result']===-0x1){return _0xe1d16;}var _0x3058ab=this[_0xf463('0xa3')](_0xf463('0xcb'),_0xf463('0xd0'));if(_0x3058ab[_0xf463('0xad')]===-0x1){return _0x3058ab;}var _0x49928f=this[_0xf463('0xa3')](_0xf463('0xb6'),'SESTEK_ASR_INSTANCE');if(_0x49928f[_0xf463('0xad')]===-0x1){return _0x49928f;}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xb8'),_0x4b15f5));};AGIVertices['prototype']['database']=function(_0x5a9c47){logger['info'](util[_0xf463('0x2a')](_0xf463('0xd1'),_0x5a9c47[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x5a9c47[_0xf463('0xd2')])){return this['channel'][_0xf463('0x2e')](_0x5a9c47,_0xf463('0xd3'));}var _0x86fa11=this['getSquareOdbc'][_0xf463('0x71')](this,_0x5a9c47[_0xf463('0xd2')]);if(!_0x86fa11){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x5a9c47,_0xf463('0xd4'));}if(!this['isConfigured'](_0x5a9c47[_0xf463('0x30')])){return this[_0xf463('0x36')]['error'](_0x5a9c47,_0xf463('0xd5'));}var _0x511c07=_0x5a9c47[_0xf463('0x30')][_0xf463('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xd6'),_0x511c07));var _0xc51ee1=this[_0xf463('0x2c')][_0xf463('0x71')](this,_0x86fa11,_0x511c07);this['createSquareDetailsReport']['sync'](this,_0x5a9c47,_0x511c07);if(!this[_0xf463('0xa5')](_0x5a9c47['variable_id'])){return this[_0xf463('0x36')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x16164b=this[_0xf463('0x10')]['sync'](this,_0x5a9c47[_0xf463('0xd7')]);if(!_0x16164b){return this[_0xf463('0x36')]['error'](_0x5a9c47,_0xf463('0xd8'));}var _0x2c26c1=this;_0xc51ee1['forEach'](function(_0x5849a4,_0x504730){Object[_0xf463('0xd9')](_0x5849a4)[_0xf463('0xda')](function(_0x50eb61){_0x2c26c1[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')]('%s[%s][%s]',_0x16164b,_0x504730,_0x50eb61),_0x5849a4[_0x50eb61]);});});this[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')](_0xf463('0xdb'),_0x16164b),_0xc51ee1['length']);return this[_0xf463('0x36')]['noop'](util['format'](_0xf463('0xdc'),_0x16164b));};AGIVertices[_0xf463('0xf')]['dial']=function(_0x28a00a){logger['debug'](util[_0xf463('0x2a')](_0xf463('0xdd'),_0x28a00a[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x28a00a[_0xf463('0xde')])){return this[_0xf463('0x36')]['error'](_0x28a00a,'no\x20user\x20selected');}var _0x1c376e=this[_0xf463('0x1c')][_0xf463('0x71')](this,_0x28a00a[_0xf463('0xde')]);if(!_0x1c376e){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x28a00a,_0xf463('0xdf'));}var _0x8037c4=this[_0xf463('0x36')]['exec'](_0xf463('0xe0'),[util['format']('SIP/%s',_0x1c376e),_0x28a00a['timeout'],_0x28a00a['opts'],_0x28a00a[_0xf463('0xe1')]]);if(_0x8037c4['result']===-0x1){return _0x8037c4;}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xe2'),_0xf463('0xe0')));};AGIVertices[_0xf463('0xf')]['dialogflow']=function(_0x298da6){logger['info'](util[_0xf463('0x2a')](_0xf463('0xe3'),_0x298da6[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x298da6[_0xf463('0x7b')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xe4'));}if(!this['isConfigured'](_0x298da6[_0xf463('0x5c')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xab'));}this[_0xf463('0x36')][_0xf463('0xe5')]=!![];this['createSquareDetailsReport'](_0x298da6);this[_0xf463('0x41')](_0x298da6['text'],'in','','');this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xe6'),_0x298da6[_0xf463('0x5c')]));var _0x3b4770=this['googleDialogflow'][_0xf463('0x71')](this,_0x298da6);if(_0x3b4770){for(var _0x68c11e in _0x3b4770){if(_0x3b4770[_0xf463('0x95')](_0x68c11e)){this[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')]('DIALOGFLOW_%s',_0x68c11e[_0xf463('0x6a')]()),_0x3b4770[_0x68c11e]);}}this[_0xf463('0x41')](_0x3b4770[_0xf463('0xe7')],_0xf463('0xe8'),_0xf463('0xe9'),'');return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')]('Dialogflow\x20Result\x20%s',_0x3b4770[_0xf463('0xe7')]));}return this[_0xf463('0x36')][_0xf463('0x2e')](_0x298da6,_0xf463('0xea'));};AGIVertices[_0xf463('0xf')]['dialogflowV2']=function(_0x50c819){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0xeb'),_0x50c819[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x50c819[_0xf463('0xec')])){return this[_0xf463('0x36')]['noop']('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x50c819['client_email'])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xed'));}if(!this[_0xf463('0xa5')](_0x50c819[_0xf463('0x7e')])){return this[_0xf463('0x36')]['noop'](_0xf463('0xee'));}if(!this[_0xf463('0xa5')](_0x50c819[_0xf463('0x7f')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xef'));}if(!this[_0xf463('0xa5')](_0x50c819[_0xf463('0x5c')])){return this[_0xf463('0x36')]['noop'](_0xf463('0xab'));}this[_0xf463('0x36')]['bot']=!![];this['createSquareDetailsReport'](_0x50c819);this[_0xf463('0x41')](_0x50c819[_0xf463('0x5c')],'in','','');this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xf0'),_0x50c819[_0xf463('0x5c')]));var _0x377192=this[_0xf463('0x7c')]['sync'](this,_0x50c819);if(_0x377192){for(var _0x5396de in _0x377192){if(_0x377192[_0xf463('0x95')](_0x5396de)){if(_0x5396de!==_0xf463('0xf1')){this[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')]('DIALOGFLOW_%s',_0x5396de['toUpperCase']()),_0x377192[_0x5396de]);}}}this[_0xf463('0x41')](_0x377192[_0xf463('0xe7')],_0xf463('0xe8'),_0xf463('0xf2'),_0x377192[_0xf463('0xf1')]);return this[_0xf463('0x36')][_0xf463('0xaa')](util['format']('DialogflowV2\x20Result\x20%s',_0x377192[_0xf463('0xe7')]));}return this['channel'][_0xf463('0x2e')](_0x50c819,_0xf463('0xf3'));};AGIVertices[_0xf463('0xf')]['sesteknda']=function(_0xd942a){logger[_0xf463('0x31')](util['format'](_0xf463('0xf4'),_0xd942a[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0xd942a['ndauth_url'])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xf5'));}if(!this[_0xf463('0xa5')](_0xd942a[_0xf463('0xf6')])){return this[_0xf463('0x36')]['noop']('no\x20username\x20configured');}if(!this[_0xf463('0xa5')](_0xd942a[_0xf463('0xf7')])){return this['channel'][_0xf463('0xaa')](_0xf463('0xf8'));}if(!this[_0xf463('0xa5')](_0xd942a['ndassistant_url'])){return this[_0xf463('0x36')]['noop'](_0xf463('0xab'));}this[_0xf463('0x36')][_0xf463('0xe5')]=!![];this[_0xf463('0xf9')](_0xd942a);this[_0xf463('0x41')](_0xd942a[_0xf463('0x5c')],'in','','');this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xfa'),_0xd942a[_0xf463('0x5c')]));var _0x145d1c=this[_0xf463('0x80')][_0xf463('0x71')](this,_0xd942a);if(_0x145d1c){for(var _0x2cf512 in _0x145d1c){if(_0x145d1c[_0xf463('0x95')](_0x2cf512)){this[_0xf463('0x36')]['setVariable'](util[_0xf463('0x2a')]('SESTEK_NDA_%s',_0x2cf512[_0xf463('0x6a')]()),_0x145d1c[_0x2cf512]);}}this['createSquareMessage'](_0x145d1c[_0xf463('0xe7')],_0xf463('0xe8'),_0xf463('0xfb'),'');if(_0x145d1c[_0xf463('0xfc')]){this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xfd'),_0x145d1c[_0xf463('0xfc')]));var _0x38f83e=this[_0xf463('0x36')][_0xf463('0xfe')](_0x145d1c[_0xf463('0xfc')]);try{fs[_0xf463('0xff')](_0x145d1c[_0xf463('0xfc')]+'.wav');}catch(_0x4223e4){logger['error'](_0x4223e4);}return _0x38f83e;}else{return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x100'),_0x145d1c[_0xf463('0xe7')]));}}return this['channel']['error'](_0xd942a,_0xf463('0x101'));};AGIVertices[_0xf463('0xf')][_0xf463('0x102')]=function(_0x3db1f3){logger['info'](util['format'](_0xf463('0x103'),_0x3db1f3['label']));return this[_0xf463('0x36')]['noop'](_0xf463('0x102'));};AGIVertices[_0xf463('0xf')]['ext_dial']=function(_0x59b1e0){logger['info'](util['format'](_0xf463('0x104'),_0x59b1e0[_0xf463('0x38')]));var _0xcbfffa='';if(_0x59b1e0[_0xf463('0x105')]){if(!this[_0xf463('0xa5')](_0x59b1e0['trunk_id'])){return this['channel'][_0xf463('0x2e')](_0x59b1e0,'no\x20trunk\x20selected');}else{var _0x5f3cec=parseInt(_0x59b1e0['trunk_id'],0xa);if(isNaN(_0x5f3cec)){_0xcbfffa=_0x59b1e0[_0xf463('0x105')];}else{_0xcbfffa=this[_0xf463('0x106')][_0xf463('0x71')](this,_0x59b1e0[_0xf463('0x105')]);if(!_0xcbfffa){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x59b1e0,'no\x20trunk\x20found');}}}}else if(_0x59b1e0[_0xf463('0x107')]){_0xcbfffa=_0x59b1e0['trunk_name'];}else{return this[_0xf463('0x36')][_0xf463('0x2e')](_0x59b1e0,_0xf463('0x108'));}var _0x25008e=this['channel']['exec']('DIAL',[util[_0xf463('0x2a')](_0xf463('0x109'),_0xcbfffa,_0x59b1e0[_0xf463('0x47')]),_0x59b1e0[_0xf463('0x66')],_0x59b1e0[_0xf463('0x10a')],_0x59b1e0[_0xf463('0xe1')]]);if(_0x25008e[_0xf463('0xad')]===-0x1){return _0x25008e;}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xe2'),'DIAL'));};AGIVertices[_0xf463('0xf')][_0xf463('0x10b')]=function(_0x165bc9){logger['info'](util['format'](_0xf463('0x10c'),_0x165bc9[_0xf463('0x38')]));return this[_0xf463('0x36')]['noop'](_0xf463('0x10b'));};AGIVertices[_0xf463('0xf')][_0xf463('0xc')]=function(_0x53a0a9){logger[_0xf463('0x31')](util[_0xf463('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x53a0a9[_0xf463('0x38')]));if(_0x53a0a9[_0xf463('0xa7')]===0x0){return this[_0xf463('0xa6')](_0x53a0a9);}_0x53a0a9[_0xf463('0xa7')]-=0x1;if(!this['isConfigured'](_0x53a0a9['file_id'])){return this[_0xf463('0x36')]['error'](_0x53a0a9,_0xf463('0x10d'));}var _0x1aab44=this[_0xf463('0x1f')][_0xf463('0x71')](this,_0x53a0a9[_0xf463('0x10e')]);if(!_0x1aab44){return this['channel'][_0xf463('0x2e')](_0x53a0a9,_0xf463('0x10f'));}if(!this[_0xf463('0xa5')](_0x53a0a9[_0xf463('0xd7')])){return this[_0xf463('0x36')]['error'](_0xf463('0x110'));}var _0x1a0e73=this[_0xf463('0x36')][_0xf463('0x111')](_0x1aab44,_0x53a0a9[_0xf463('0x112')],_0x53a0a9[_0xf463('0x113')]);var _0x3dfdb0=_0x1a0e73[_0xf463('0xad')]?_0x1a0e73[_0xf463('0xad')][_0xf463('0x4b')]():'';logger['info']('test',JSON[_0xf463('0x74')](_0x1a0e73));if(_0x1a0e73['result']===-0x1){this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x53a0a9,_0x3dfdb0);return _0x1a0e73;}else if(_0x1a0e73[_0xf463('0xa2')]===_0xf463('0x66')){_0x1a0e73[_0xf463('0xad')]=_0x3dfdb0[_0xf463('0x9b')]>=parseInt(_0x53a0a9['mindigit'])?'x':'i';}else{_0x1a0e73['result']=_0x3dfdb0[_0xf463('0x9b')]>=parseInt(_0x53a0a9['mindigit'])&&_0x3dfdb0['length']<=parseInt(_0x53a0a9[_0xf463('0x113')])?'x':'i';}var _0x1636f7=this[_0xf463('0x10')]['sync'](this,_0x53a0a9['variable_id']);if(!_0x1636f7){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x53a0a9,'no\x20variable\x20found');}this[_0xf463('0x36')][_0xf463('0x9f')](_0x1636f7,_0x3dfdb0);if(this[_0xf463('0xa5')](_0x53a0a9['hiddendigitsnum'])){var _0x4ceb0c=parseInt(_0x53a0a9['hiddendigitsnum'],0xa);var _0x2f09b5=rs[_0xf463('0x114')]({'charset':'*','length':_0x4ceb0c});var _0x547b74=_0x3dfdb0[_0xf463('0x9b')];if(_0x547b74>0x0){if(_0x547b74>_0x4ceb0c){this['createSquareDetailsReport'][_0xf463('0x71')](this,_0x53a0a9,_0x53a0a9[_0xf463('0x115')]==='first'?_0x2f09b5+_0x3dfdb0[_0xf463('0x116')](_0x4ceb0c):_0x3dfdb0[_0xf463('0x116')](0x0,_0x547b74-_0x4ceb0c)+_0x2f09b5);}else{this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x53a0a9,rs[_0xf463('0x114')]({'charset':'*','length':_0x547b74}));}}else{this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x53a0a9,'');}}else{this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x53a0a9,_0x3dfdb0);}return _0x1a0e73;};AGIVertices[_0xf463('0xf')]['getsecretdigits']=function(_0x52dc09){logger[_0xf463('0x31')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x52dc09[_0xf463('0x38')]));return this['getdigits'](_0x52dc09);};AGIVertices['prototype'][_0xf463('0x117')]=function(_0x579fc2){logger['info'](util['format'](_0xf463('0x118'),_0x579fc2[_0xf463('0x38')]));this[_0xf463('0xf9')]['sync'](this,_0x579fc2,_0x579fc2[_0xf463('0x119')]);return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x11a'),_0x579fc2['goalname']));};AGIVertices[_0xf463('0xf')][_0xf463('0x11b')]=function(_0x3a9dff){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x11c'),_0x3a9dff[_0xf463('0x38')]));if(!this['isConfigured'](_0x3a9dff['aws_access_key_id'])||!this[_0xf463('0xa5')](_0x3a9dff['aws_secret_access_key'])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x11d'));}if(!this[_0xf463('0xa5')](_0x3a9dff['text'])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xab'));}this[_0xf463('0x36')][_0xf463('0xaa')](util['format'](_0xf463('0x11e'),_0x3a9dff[_0xf463('0x5c')]));var _0x34d750=this[_0xf463('0x85')][_0xf463('0x71')](this,_0x3a9dff);if(_0x34d750){this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')]('aws\x20Polly\x20%s\x20file\x20created',_0x34d750));var _0xeda351=this['channel'][_0xf463('0xfe')](_0x34d750);try{fs[_0xf463('0xff')](_0x34d750+_0xf463('0x11f'));}catch(_0x524578){logger[_0xf463('0x2e')](_0x524578);}return _0xeda351;}return this[_0xf463('0x36')]['error'](_0x3a9dff,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x3e0b14){logger[_0xf463('0x31')](util[_0xf463('0x2a')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x3e0b14[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x3e0b14[_0xf463('0x86')])||!this[_0xf463('0xa5')](_0x3e0b14[_0xf463('0x87')])){return this[_0xf463('0x36')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xf463('0xa5')](_0x3e0b14[_0xf463('0x8d')])){return this['channel'][_0xf463('0xaa')](_0xf463('0x120'));}if(!this['isConfigured'](_0x3e0b14[_0xf463('0x5c')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xab'));}this[_0xf463('0x36')][_0xf463('0xe5')]=!![];this[_0xf463('0xf9')](_0x3e0b14);this[_0xf463('0x41')](_0x3e0b14[_0xf463('0x5c')],'in','','');this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x3e0b14[_0xf463('0x5c')]));var _0x113400=this['awsLex'][_0xf463('0x71')](this,_0x3e0b14);if(_0x113400){for(var _0x116c57 in _0x113400){if(_0x113400[_0xf463('0x95')](_0x116c57)&&_[_0xf463('0x96')](_0x113400[_0x116c57])){this['channel'][_0xf463('0x9f')](util[_0xf463('0x2a')](_0xf463('0x121'),_0x116c57[_0xf463('0x6a')]()),_0x113400[_0x116c57]);}}if(_[_0xf463('0x43')](_0x113400[_0xf463('0x77')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x122'));}else{this[_0xf463('0x41')](_0x113400[_0xf463('0x77')],'out',_0xf463('0x123'),'');return this[_0xf463('0x36')][_0xf463('0xaa')](util['format'](_0xf463('0x124'),_0x113400[_0xf463('0x77')]));}}return this[_0xf463('0x36')]['error'](_0x3e0b14,_0xf463('0x125'));};AGIVertices[_0xf463('0xf')][_0xf463('0x126')]=function(_0x491bad){logger[_0xf463('0x31')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x491bad['label'],_0x491bad[_0xf463('0x66')]));if(!this['isConfigured'](_0x491bad[_0xf463('0x7b')])){return this[_0xf463('0x36')][_0xf463('0xaa')]('no\x20key\x20configured');}var _0x185f84=_0xf463('0x127');var _0x5b97de=util[_0xf463('0x2a')](_0xf463('0x128'),FILES_PATH,rs[_0xf463('0x114')](0x4));var _0x2abfbb=util[_0xf463('0x2a')]('%s.%s',_0x5b97de,_0x185f84);var _0x447459=!![];if(_0x491bad[_0xf463('0x129')]===_0xf463('0x12a')){_0x447459=![];}var _0x2ab069=this['channel'][_0xf463('0x12b')](_0x5b97de,_0x185f84,_0x491bad[_0xf463('0x12c')],_0x491bad[_0xf463('0x66')],undefined,_0x447459);if(_0x2ab069[_0xf463('0xad')]!==-0x1){this[_0xf463('0x36')]['noop'](util[_0xf463('0x2a')](_0xf463('0x12d'),_0x2abfbb));var _0x5dad03=this[_0xf463('0x8e')][_0xf463('0x71')](this,_0x491bad,_0x2abfbb);if(_0x5dad03){for(var _0x589de5 in _0x5dad03){if(_0x5dad03[_0xf463('0x95')](_0x589de5)){this['channel'][_0xf463('0x9f')](util[_0xf463('0x2a')](_0xf463('0x12e'),_0x589de5[_0xf463('0x6a')]()),_0x5dad03[_0x589de5]);}}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x12f'),JSON[_0xf463('0x74')](_0x5dad03)));}}return _0x2ab069;};AGIVertices[_0xf463('0xf')][_0xf463('0x130')]=function(_0x2dd0c6){logger[_0xf463('0x31')](util['format'](_0xf463('0x131'),_0x2dd0c6[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x2dd0c6['appid'])){return this['channel'][_0xf463('0xaa')](_0xf463('0x132'));}if(!this[_0xf463('0xa5')](_0x2dd0c6[_0xf463('0x92')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x133'));}var _0x42f722=_0xf463('0x127');var _0x320a9d=util[_0xf463('0x2a')](_0xf463('0x128'),FILES_PATH,rs[_0xf463('0x114')](0x4));var _0x125081=util[_0xf463('0x2a')](_0xf463('0x9e'),_0x320a9d,_0x42f722);var _0x2f2492=!![];if(_0x2dd0c6[_0xf463('0x129')]===_0xf463('0x12a')){_0x2f2492=![];}var _0x2ba33c=this['channel'][_0xf463('0x12b')](_0x320a9d,_0x42f722,_0x2dd0c6[_0xf463('0x12c')],_0x2dd0c6['timeout'],undefined,_0x2f2492);if(_0x2ba33c['result']!==-0x1){this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')]('tilde\x20%s\x20file\x20created',_0x125081));var _0xcafaa8=this['tildeASR']['sync'](this,_0x2dd0c6,_0x125081);if(_0xcafaa8){for(var _0x5e1893 in _0xcafaa8){if(_0xcafaa8[_0xf463('0x95')](_0x5e1893)){this[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')](_0xf463('0x134'),_0x5e1893[_0xf463('0x6a')]()),_0xcafaa8[_0x5e1893]);}}return this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x135'),JSON[_0xf463('0x74')](_0xcafaa8)));}}return _0x2ba33c;};AGIVertices[_0xf463('0xf')][_0xf463('0x136')]=function(_0x35782b){logger['info'](util[_0xf463('0x2a')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x35782b[_0xf463('0x38')]));return this[_0xf463('0x36')][_0xf463('0x137')](_0x35782b[_0xf463('0x138')],_0x35782b[_0xf463('0x139')],_0x35782b[_0xf463('0x3e')]);};AGIVertices[_0xf463('0xf')]['gotoif']=function(_0x4f6765){logger[_0xf463('0x31')](util[_0xf463('0x2a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4f6765[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x4f6765[_0xf463('0x13a')])){return this['channel'][_0xf463('0x2e')](_0x4f6765,_0xf463('0x13b'));}try{var _0x1740f8=eval(_0x4f6765[_0xf463('0x13a')])?'true':_0xf463('0x13c');this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')]('EVAL\x20CONDITION\x20%s\x20%s',_0x4f6765[_0xf463('0x13a')],_0x1740f8));return{'code':0xc8,'result':_0x1740f8};}catch(_0x13e9c8){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xf463('0xf')][_0xf463('0x13d')]=function(_0x14a977){logger['info'](util[_0xf463('0x2a')](_0xf463('0x13e'),_0x14a977['label']));if(!this['isConfigured'](_0x14a977['interval_id'])){return this['channel'][_0xf463('0x2e')](_0x14a977,'no\x20interval\x20configured');}var _0x344c40=this[_0xf463('0x13f')][_0xf463('0x71')](this,_0x14a977[_0xf463('0x140')]);if(!_0x344c40){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x14a977,'no\x20intervals\x20found');}for(var _0x5b3969=0x0;_0x5b3969<_0x344c40[_0xf463('0x9b')];_0x5b3969+=0x1){var _0x1fb5c2=this[_0xf463('0x36')][_0xf463('0x10')](util['format'](_0xf463('0x141'),_0x344c40[_0x5b3969]));if(_0x1fb5c2['result']===-0x1){return _0x1fb5c2;}logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x142'),_0x344c40[_0x5b3969],_0x1fb5c2[_0xf463('0xa2')]));if(_0x1fb5c2[_0xf463('0xa2')]===_0xf463('0x143')){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x142'),_0x344c40[_0x5b3969],_0xf463('0x143')));this['channel'][_0xf463('0xaa')](util['format'](_0xf463('0x142'),_0x344c40[_0x5b3969],'true'));return{'code':0xc8,'result':_0xf463('0x143')};}else{logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x142'),_0x344c40[_0x5b3969],'false'));this[_0xf463('0x36')]['noop'](util['format'](_0xf463('0x142'),_0x344c40[_0x5b3969],'false'));}}return{'code':0xc8,'result':_0xf463('0x13c')};};AGIVertices['prototype'][_0xf463('0x144')]=function(_0x41a7cc){logger[_0xf463('0x31')](util['format'](_0xf463('0x145'),_0x41a7cc['label']));return this[_0xf463('0x36')][_0xf463('0x144')]();};AGIVertices[_0xf463('0xf')][_0xf463('0x146')]=function(_0x765109){logger['info'](util[_0xf463('0x2a')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x765109[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x765109['key'])){return this['channel'][_0xf463('0xaa')](_0xf463('0xe4'));}var _0x26f437=_0xf463('0x127');var _0x207b55=util[_0xf463('0x2a')](_0xf463('0x128'),FILES_PATH,rs[_0xf463('0x114')](0x4));var _0xa5b1c1=util[_0xf463('0x2a')](_0xf463('0x9e'),_0x207b55,_0x26f437);var _0x1c78f4=!![];if(_0x765109[_0xf463('0x129')]===_0xf463('0x12a')){_0x1c78f4=![];}var _0x228033=this[_0xf463('0x36')][_0xf463('0x12b')](_0x207b55,_0x26f437,_0x765109[_0xf463('0x12c')],_0x765109['timeout'],undefined,_0x1c78f4);if(_0x228033[_0xf463('0xad')]!==-0x1){this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x147'),_0xa5b1c1));var _0x132474=this[_0xf463('0x148')][_0xf463('0x71')](this,_0x765109,_0xa5b1c1);if(_0x132474){for(var _0x5aa04f in _0x132474){if(_0x132474[_0xf463('0x95')](_0x5aa04f)){this[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')](_0xf463('0x149'),_0x5aa04f['toUpperCase']()),_0x132474[_0x5aa04f]);}}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x14a'),JSON[_0xf463('0x74')](_0x132474)));}}return _0x228033;};AGIVertices['prototype']['ispeechtts']=function(_0x493df3){logger[_0xf463('0x31')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x493df3[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x493df3[_0xf463('0x7b')])){return this[_0xf463('0x36')][_0xf463('0xaa')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x493df3['text'])){return this[_0xf463('0x36')][_0xf463('0xaa')]('no\x20text\x20configured');}this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x14b'),_0x493df3[_0xf463('0x5c')]));var _0x8619f0=this['ispeechTTS'][_0xf463('0x71')](this,_0x493df3);if(_0x8619f0){this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x147'),_0x8619f0));var _0x4e6eef=this[_0xf463('0x36')]['streamFile'](_0x8619f0,_0x493df3[_0xf463('0x12c')]);try{fs[_0xf463('0xff')](_0x8619f0+'.wav');}catch(_0x53cb28){logger['error'](_0x53cb28);}return _0x4e6eef;}return this['channel']['error'](_0x493df3,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0x454cc0){logger['info'](util[_0xf463('0x2a')](_0xf463('0x14c'),_0x454cc0[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x454cc0[_0xf463('0x14d')])){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x454cc0,'no\x20find\x20by\x20configured');}logger[_0xf463('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xf463('0x3b')],_0x454cc0[_0xf463('0x14d')]));var _0x6ba7e=this[_0xf463('0x52')][_0xf463('0x71')](this,_0x454cc0[_0xf463('0x14d')]);if(_0x6ba7e){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x14e'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x454cc0['findBy']));this['channel'][_0xf463('0xaa')](util['format'](_0xf463('0x14e'),this['channel'][_0xf463('0x3b')],_0x454cc0[_0xf463('0x14d')]));return{'code':0xc8,'result':_0xf463('0x14f')};}else{logger[_0xf463('0x31')](util[_0xf463('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf463('0x36')]['callerid'],_0x454cc0[_0xf463('0x14d')]));this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x150'),this['channel'][_0xf463('0x3b')],_0x454cc0['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf463('0xf')][_0xf463('0x151')]=function(_0x4a5667){logger[_0xf463('0x31')](util['format'](_0xf463('0x152'),_0x4a5667[_0xf463('0x38')]));if(!this['isConfigured'](_0x4a5667[_0xf463('0x14d')])){return this['channel'][_0xf463('0x2e')](_0x4a5667,_0xf463('0x153'));}logger['info'](util[_0xf463('0x2a')](_0xf463('0x154'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x4a5667[_0xf463('0x14d')]));var _0x58c219=this['agentLogout'][_0xf463('0x71')](this,_0x4a5667[_0xf463('0x14d')]);if(_0x58c219){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x14e'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x4a5667[_0xf463('0x14d')]));this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x14e'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x4a5667[_0xf463('0x14d')]));return{'code':0xc8,'result':_0xf463('0x14f')};}else{logger[_0xf463('0x31')](util['format'](_0xf463('0x150'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x4a5667[_0xf463('0x14d')]));this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x150'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x4a5667[_0xf463('0x14d')]));return{'code':0xc8,'result':_0xf463('0x155')};}};AGIVertices[_0xf463('0xf')][_0xf463('0x156')]=function(_0x2b3238){logger[_0xf463('0x31')](util['format'](_0xf463('0x157'),_0x2b3238['label']));if(!this[_0xf463('0xa5')](_0x2b3238['operation'])){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x2b3238,_0xf463('0x158'));}this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x159'),_0x2b3238[_0xf463('0x15a')]));var _0xb4c362=eval(_0x2b3238[_0xf463('0x15a')]);if(!this[_0xf463('0xa5')](_0x2b3238[_0xf463('0xd7')])){return this[_0xf463('0x36')][_0xf463('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4f8a7f=this[_0xf463('0x10')]['sync'](this,_0x2b3238['variable_id']);if(!_0x4f8a7f){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x2b3238,'no\x20variable\x20found');}if(_[_0xf463('0x9a')](_0xb4c362)){var _0x590526=this;_0xb4c362[_0xf463('0xda')](function(_0x1e3a10,_0x31a52d){_0x590526[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')]('%s[%s]',_0x4f8a7f,_0x31a52d),_0x1e3a10);});return this[_0xf463('0x36')]['noop'](util[_0xf463('0x2a')](_0xf463('0x15b'),_0x4f8a7f));}else{return this[_0xf463('0x36')][_0xf463('0x9f')](_0x4f8a7f,_0xb4c362);}};AGIVertices[_0xf463('0xf')][_0xf463('0x15c')]=function(_0x537890){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x15d'),_0x537890[_0xf463('0x38')]));if(_0x537890[_0xf463('0xa7')]===0x0){return this[_0xf463('0xa6')](_0x537890);}_0x537890[_0xf463('0xa7')]-=0x1;if(!this[_0xf463('0xa5')](_0x537890[_0xf463('0x10e')])){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x537890,_0xf463('0x10d'));}var _0x232ae1=this[_0xf463('0x1f')][_0xf463('0x71')](this,_0x537890[_0xf463('0x10e')]);if(!_0x232ae1){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x537890,'no\x20file\x20audio\x20found');}var _0xd68c6a=this[_0xf463('0x36')][_0xf463('0x111')](_0x232ae1,_0x537890[_0xf463('0x112')],_0x537890['digit']);var _0x7a3b45=_0xd68c6a[_0xf463('0xad')];if(_0xd68c6a[_0xf463('0xad')]===-0x1){this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x537890,'-1');return _0xd68c6a;}else if(_0xd68c6a['extra']===_0xf463('0x66')){_0xd68c6a['result']=_0xd68c6a[_0xf463('0xad')][_0xf463('0x9b')]>0x0?_0xd68c6a[_0xf463('0xad')]:'t';}else if(_['isEmpty'](_0xd68c6a[_0xf463('0xad')])){_0xd68c6a[_0xf463('0xad')]='#';_0x7a3b45='#';}if(!this[_0xf463('0xa5')](_0x537890['variable_id'])){this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x110'));}else{var _0x45fd03=this[_0xf463('0x10')][_0xf463('0x71')](this,_0x537890[_0xf463('0xd7')]);if(!_0x45fd03){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x537890,'no\x20variable\x20found');}this['channel'][_0xf463('0x9f')](_0x45fd03,_0x7a3b45);}this['createSquareDetailsReport'][_0xf463('0x71')](this,_0x537890,_0x7a3b45);return _0xd68c6a;};AGIVertices[_0xf463('0xf')]['noop']=function(_0x4a305e){logger['info'](util[_0xf463('0x2a')](_0xf463('0x15e'),_0x4a305e['label']));return this[_0xf463('0x36')]['noop'](_0x4a305e[_0xf463('0x15f')]||_0x4a305e['label']);};AGIVertices[_0xf463('0xf')]['pause']=function(_0x51c01f){logger[_0xf463('0x31')](util['format'](_0xf463('0x160'),_0x51c01f[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x51c01f[_0xf463('0x14d')])){return this[_0xf463('0x36')]['error'](_0x51c01f,'no\x20find\x20by\x20configured');}logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x154'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x51c01f[_0xf463('0x14d')]));var _0x5c1dd3=this[_0xf463('0x4d')]['sync'](this,_0x51c01f[_0xf463('0x161')]);var _0x32ef4a=this[_0xf463('0x4f')][_0xf463('0x71')](this,_0x51c01f[_0xf463('0x14d')],_0x5c1dd3);if(_0x32ef4a){logger['info'](util[_0xf463('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xf463('0x3b')],_0x51c01f['findBy']));this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x14e'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x51c01f['findBy']));return{'code':0xc8,'result':_0xf463('0x14f')};}else{logger['info'](util['format'](_0xf463('0x150'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x51c01f[_0xf463('0x14d')]));this[_0xf463('0x36')][_0xf463('0xaa')](util['format'](_0xf463('0x14e'),this['channel'][_0xf463('0x3b')],_0x51c01f[_0xf463('0x14d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf463('0xf')][_0xf463('0x162')]=function(_0x24066f){logger['info'](util['format'](_0xf463('0x163'),_0x24066f['label']));if(!this['isConfigured'](_0x24066f[_0xf463('0x10e')])){return this['channel'][_0xf463('0x2e')](_0x24066f,_0xf463('0x10d'));}var _0x48be20=this[_0xf463('0x1f')][_0xf463('0x71')](this,_0x24066f[_0xf463('0x10e')]);if(!_0x48be20){return this['channel']['error'](_0x24066f,_0xf463('0x10f'));}var _0x2b3287=this[_0xf463('0x36')]['exec'](_0xf463('0x164'),[_0x48be20,_0x24066f[_0xf463('0x10a')]]);if(_0x2b3287['result']===-0x1){return _0x2b3287;}return this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')]('Executed\x20command\x20%s\x20%s',_0xf463('0x164'),_0x48be20));};AGIVertices[_0xf463('0xf')]['queue']=function(_0xb0861c){logger['info'](util[_0xf463('0x2a')](_0xf463('0x165'),_0xb0861c[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0xb0861c[_0xf463('0x166')])){return this[_0xf463('0x36')]['error'](_0xb0861c,_0xf463('0x167'));}var _0x2fd692='';var _0x3b071b=parseInt(_0xb0861c[_0xf463('0x166')],0xa);if(isNaN(_0x3b071b)){_0x2fd692=_0xb0861c[_0xf463('0x166')];}else{_0x2fd692=this[_0xf463('0x15')]['sync'](this,_0xb0861c[_0xf463('0x166')]);if(!_0x2fd692){return this[_0xf463('0x36')][_0xf463('0x2e')](_0xb0861c,_0xf463('0x168'));}}var _0x5869f0='';if(this[_0xf463('0xa5')](_0xb0861c['file_id'])){var _0x463787=this[_0xf463('0x1f')][_0xf463('0x71')](this,_0xb0861c[_0xf463('0x10e')]);if(_0x463787){_0x5869f0=_0x463787;}}this[_0xf463('0xf9')][_0xf463('0x71')](this,_0xb0861c,_0x2fd692);if(_0xb0861c[_0xf463('0x10a')][_0xf463('0x169')]('x')<0x0){_0xb0861c[_0xf463('0x10a')]+='x';}if(_0xb0861c['opts'][_0xf463('0x169')]('X')<0x0){_0xb0861c[_0xf463('0x10a')]+='X';}this[_0xf463('0x36')][_0xf463('0x9f')](_0xf463('0x16a'),_0x2fd692?_0x2fd692[_0xf463('0x16b')]():'');var _0x32ca36=this[_0xf463('0x36')][_0xf463('0x56')](_0xf463('0x16c'),[_0x2fd692,_0xb0861c['opts'],_0xb0861c[_0xf463('0xe1')],_0x5869f0,_0xb0861c[_0xf463('0x66')],_0xb0861c[_0xf463('0x8')],_0xb0861c['macro'],_0xb0861c['gosub'],'',_0xb0861c[_0xf463('0x16d')]]);if(_0x32ca36[_0xf463('0xad')]===-0x1){return _0x32ca36;}return this[_0xf463('0x36')]['noop'](util[_0xf463('0x2a')](_0xf463('0xc6'),_0xf463('0x16c'),_0x2fd692));};AGIVertices[_0xf463('0xf')]['record']=function(_0x50b9c9){logger[_0xf463('0x31')](util['format'](_0xf463('0x16e'),_0x50b9c9[_0xf463('0x38')]));var _0x58c3d6=_0x50b9c9[_0xf463('0x16f')]||_0xf463('0x127');var _0x59b00c=util[_0xf463('0x2a')](_0xf463('0x170'),this['channel']['uniqueid'],rs['generate'](0x5));var _0x5c4b6f=util['format'](_0xf463('0x171'),FILES_PATH,_0x59b00c,_0x58c3d6);var _0x2ff199=util[_0xf463('0x2a')](_0xf463('0x128'),FILES_PATH,_0x59b00c);this['createSquareRecording'][_0xf463('0x71')](this,_0x50b9c9,_0x59b00c,_0x5c4b6f);this[_0xf463('0x36')][_0xf463('0x9f')](_0xf463('0x172'),_0x59b00c);logger[_0xf463('0x31')](_0xf463('0x173'),_0x2ff199,_0x58c3d6,_0x50b9c9['escape_digits'],_0x50b9c9['timeout']);return this['channel']['recordFile'](_0x2ff199,_0x58c3d6,_0x50b9c9[_0xf463('0x174')],_0x50b9c9[_0xf463('0x66')],undefined,!![]);};AGIVertices[_0xf463('0xf')][_0xf463('0x175')]=function(_0x2dba11){logger['info'](util[_0xf463('0x2a')](_0xf463('0x176'),_0x2dba11[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x2dba11[_0xf463('0xe1')])){return this[_0xf463('0x36')][_0xf463('0xaa')]('no\x20url\x20configured');}var _0x378ded=this['restAPI']['sync'](this,_0x2dba11);logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x177'),util[_0xf463('0x178')](_0x378ded,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x2dba11['variable_id'])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x179'));}var _0xceb5d9=this['getVariable'][_0xf463('0x71')](this,_0x2dba11[_0xf463('0xd7')]);if(!_0xceb5d9){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x2dba11,_0xf463('0xd8'));}this[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')]('%s_STATUS_CODE',_0xceb5d9),_0x378ded['statusCode']?_0x378ded[_0xf463('0x76')]:_0xf463('0x17a'));this[_0xf463('0x36')][_0xf463('0x9f')](util[_0xf463('0x2a')](_0xf463('0x17b'),_0xceb5d9),_0x378ded[_0xf463('0x17c')]?_0x378ded['statusMessage']:'OK');if(_0x378ded[_0xf463('0x6b')]){try{this[_0xf463('0x9c')](_0x378ded[_0xf463('0x6b')],_0xceb5d9);}catch(_0x49890a){logger[_0xf463('0x2e')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xceb5d9));}}return this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')]('variable\x20%s\x20set',_0xceb5d9));};AGIVertices[_0xf463('0xf')][_0xf463('0x17d')]=function(_0x33d162){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x17e'),_0x33d162['label']));return this['channel'][_0xf463('0x17f')](_0x33d162[_0xf463('0x180')][_0xf463('0x58')](/\s+/g,''),_0x33d162[_0xf463('0x174')]);};AGIVertices['prototype'][_0xf463('0x181')]=function(_0x5b74ff){logger['info'](util[_0xf463('0x2a')](_0xf463('0x182'),_0x5b74ff['label']));return this[_0xf463('0x36')][_0xf463('0x183')](_0x5b74ff['number'][_0xf463('0x58')](/\s+/g,''),_0x5b74ff['escape_digits']);};AGIVertices['prototype'][_0xf463('0x184')]=function(_0x5ab438){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x185'),_0x5ab438[_0xf463('0x38')]));return this[_0xf463('0x36')][_0xf463('0x186')](_0x5ab438[_0xf463('0x5c')],_0x5ab438['escape_digits']);};AGIVertices[_0xf463('0xf')]['sendMail']=function(_0x40c810){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x187'),_0x40c810[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x40c810[_0xf463('0x188')])){return this[_0xf463('0x36')]['noop'](_0xf463('0x189'));}var _0x27b009=this['getMailAccount'][_0xf463('0x71')](this,_0x40c810[_0xf463('0x188')]);if(!_0x27b009||!_0x27b009['Smtp']){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x40c810,_0xf463('0x18a'));}var _0x4e2682={'from':util[_0xf463('0x2a')](_0xf463('0x18b'),_0x27b009[_0xf463('0x13')],_0x27b009[_0xf463('0x18c')]||_0x27b009[_0xf463('0x18d')][_0xf463('0x18e')]),'to':_0x40c810['to']||'','cc':_0x40c810['cc']||'','bcc':_0x40c810[_0xf463('0x18f')]||'','subject':_0x40c810['subject'],'html':_0x40c810[_0xf463('0x5c')],'text':_0x40c810['text']};var _0x3e607b={'tls':{'rejectUnauthorized':![]}};if(_0x27b009[_0xf463('0x18d')]['service']){_0x3e607b[_0xf463('0x190')]=_0x27b009['Smtp']['service'];}else{_0x3e607b[_0xf463('0x191')]=_0x27b009[_0xf463('0x18d')][_0xf463('0x191')];_0x3e607b['port']=_0x27b009[_0xf463('0x18d')][_0xf463('0x192')];_0x3e607b[_0xf463('0x193')]=_0x27b009['Smtp'][_0xf463('0x193')];}if(_0x27b009[_0xf463('0x18d')][_0xf463('0x194')]){_0x3e607b[_0xf463('0x195')]={'user':_0x27b009[_0xf463('0x18d')]['user'],'pass':_0x27b009[_0xf463('0x18d')]['pass']};}if(this['isConfigured'](_0x40c810['template_id'])){}logger['debug']('sendMail\x20message',JSON[_0xf463('0x74')](_0x4e2682));this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x40c810,_0x40c810[_0xf463('0x188')]);this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x196'),_0x27b009[_0xf463('0x13')]));this[_0xf463('0x25')][_0xf463('0x71')](this,_0x3e607b,_0x4e2682);return this['channel']['noop'](_0xf463('0x197'));};AGIVertices['prototype'][_0xf463('0x198')]=function(_0x59520c){logger[_0xf463('0x31')](util['format'](_0xf463('0x199'),_0x59520c[_0xf463('0x38')]));return this[_0xf463('0x36')][_0xf463('0xaa')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xf463('0xf')][_0xf463('0x19a')]=function(_0x4d78e6){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x19b'),_0x4d78e6['label']));if(!this[_0xf463('0xa5')](_0x4d78e6[_0xf463('0x19c')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x19d'));}var _0x13ac2b=this['getSmsAccount']['sync'](this,_0x4d78e6[_0xf463('0x19c')]);if(!_0x13ac2b){return this[_0xf463('0x36')]['error'](_0x4d78e6,'no\x20sms\x20account\x20found');}var _0x44036d={'body':_0x4d78e6[_0xf463('0x19e')],'phone':_0x4d78e6['to']||'','SmsAccountId':_0x13ac2b['id']};logger[_0xf463('0x19f')](_0xf463('0x1a0'),JSON[_0xf463('0x74')](_0x44036d));this[_0xf463('0xf9')]['sync'](this,_0x4d78e6,_0x4d78e6[_0xf463('0x19c')]);this['channel']['noop'](util[_0xf463('0x2a')](_0xf463('0x1a1'),_0x13ac2b['name']));this[_0xf463('0x35')][_0xf463('0x71')](this,_0x44036d);return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x1a2'));};AGIVertices[_0xf463('0xf')][_0xf463('0x1a3')]=function(_0x2ef617){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x1a4'),_0x2ef617[_0xf463('0x38')]));if(!this[_0xf463('0xa5')](_0x2ef617[_0xf463('0xd7')])){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x2ef617,_0xf463('0x1a5'));}var _0x4f32fe=this['getVariable'][_0xf463('0x71')](this,_0x2ef617[_0xf463('0xd7')]);if(!_0x4f32fe){return this['channel'][_0xf463('0x2e')](_0x2ef617,'no\x20variable\x20found');}return this[_0xf463('0x36')][_0xf463('0x9f')](_0x4f32fe,_0x2ef617[_0xf463('0x1a6')]);};AGIVertices['prototype'][_0xf463('0x1a7')]=function(_0x35d7b2){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x1a8'),_0x35d7b2[_0xf463('0x38')]));this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x1a9'));if(_0x35d7b2[_0xf463('0xbb')]===_0xf463('0x1aa')){this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x1ab'));return this['channel'][_0xf463('0xbb')]();}return this['channel'][_0xf463('0xaa')](_0xf463('0x1ac'));};AGIVertices[_0xf463('0xf')]['subproject']=function(_0x3a1b8e){logger[_0xf463('0x31')](util['format'](_0xf463('0x1ad'),_0x3a1b8e[_0xf463('0x38')]));if(!this['isConfigured'](_0x3a1b8e[_0xf463('0x1ae')])){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x3a1b8e,_0xf463('0x1af'));}var _0x282817=this[_0xf463('0x17')][_0xf463('0x71')](this,_0x3a1b8e[_0xf463('0x1ae')]);if(!this[_0xf463('0xa5')](_0x282817)){return this['channel']['error'](_0x3a1b8e,util[_0xf463('0x2a')](_0xf463('0x1b0'),_0x3a1b8e['project_id']));}if(_0x282817===this[_0xf463('0x36')][_0xf463('0x3a')]){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x3a1b8e,_0xf463('0x1b1'));}this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x3a1b8e,_0x282817);var _0x4c93d0=this['channel'][_0xf463('0x56')]('AGI',util[_0xf463('0x2a')](_0xf463('0x1b2'),config['agi'][_0xf463('0x191')]||_0xf463('0x1b3'),_0x282817,this['channel'][_0xf463('0x3a')]));if(_0x4c93d0[_0xf463('0xad')]===-0x1){return _0x4c93d0;}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xc6'),_0xf463('0x1b4'),_0x282817));};AGIVertices[_0xf463('0xf')]['system']=function(_0x3c852b){logger[_0xf463('0x31')](util[_0xf463('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3c852b['label']));var _0x3e966e=this[_0xf463('0x55')][_0xf463('0x71')](this,_0x3c852b[_0xf463('0x1b5')]);this[_0xf463('0xf9')][_0xf463('0x71')](this,_0x3c852b,_0x3c852b[_0xf463('0x1b5')]);if(this[_0xf463('0xa5')](_0x3c852b[_0xf463('0xd7')])){var _0x5e56d7=this[_0xf463('0x10')][_0xf463('0x71')](this,_0x3c852b['variable_id']);if(_0x5e56d7){this[_0xf463('0x36')][_0xf463('0x9f')](_0x5e56d7,_0x3e966e);return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x1b6'),_0x3c852b[_0xf463('0x1b5')],_0x5e56d7));}}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3c852b[_0xf463('0x1b5')]));};AGIVertices[_0xf463('0xf')][_0xf463('0x1b7')]=function(_0x2939a6){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x1b8'),_0x2939a6[_0xf463('0x38')]));_0x2939a6['text']=_0x2939a6[_0xf463('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2939a6[_0xf463('0x5a')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0x1b9'));}if(!this[_0xf463('0xa5')](_0x2939a6['text'])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xab'));}this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x1ba'),_0x2939a6[_0xf463('0x5c')]));var _0x211229=this['googleCloudTTS'][_0xf463('0x71')](this,_0x2939a6);if(_0x211229){this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x1bb'),_0x211229));var _0x42f8e3=this[_0xf463('0x36')][_0xf463('0xfe')](_0x211229);try{fs[_0xf463('0xff')](_0x211229+_0xf463('0x11f'));}catch(_0x5d12bc){logger[_0xf463('0x2e')](_0x5d12bc);}return _0x42f8e3;}return this[_0xf463('0x36')][_0xf463('0x2e')](_0x2939a6,_0xf463('0x1bc'));};AGIVertices[_0xf463('0xf')][_0xf463('0x1bd')]=function(_0x3a9be7){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x1be'),_0x3a9be7[_0xf463('0x38')]));_0x3a9be7[_0xf463('0x5c')]=_0x3a9be7['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf463('0xa5')](_0x3a9be7[_0xf463('0x5c')])){return this[_0xf463('0x36')][_0xf463('0xaa')](_0xf463('0xab'));}this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x1bf'),_0x3a9be7['text']));var _0x3de2a6=this[_0xf463('0x62')][_0xf463('0x71')](this,_0x3a9be7);if(_0x3de2a6){this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x1c0'),_0x3de2a6));var _0x125e04=this[_0xf463('0x36')]['streamFile'](_0x3de2a6);try{fs[_0xf463('0xff')](_0x3de2a6+_0xf463('0x11f'));}catch(_0x4fbe57){logger[_0xf463('0x2e')](_0x4fbe57);}return _0x125e04;}return this[_0xf463('0x36')][_0xf463('0x2e')](_0x3a9be7,_0xf463('0x1c1'));};AGIVertices[_0xf463('0xf')]['unpause']=function(_0x106945){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x1c2'),_0x106945[_0xf463('0x38')]));if(!this['isConfigured'](_0x106945['findBy'])){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x106945,_0xf463('0x153'));}logger['info'](util[_0xf463('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf463('0x36')][_0xf463('0x3b')],_0x106945[_0xf463('0x14d')]));var _0x3e9d5f=this[_0xf463('0x51')][_0xf463('0x71')](this,_0x106945[_0xf463('0x14d')]);if(_0x3e9d5f){logger[_0xf463('0x31')](util[_0xf463('0x2a')](_0xf463('0x14e'),this[_0xf463('0x36')]['callerid'],_0x106945['findBy']));this[_0xf463('0x36')]['noop'](util[_0xf463('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf463('0x36')][_0xf463('0x3b')],_0x106945[_0xf463('0x14d')]));return{'code':0xc8,'result':_0xf463('0x14f')};}else{logger['info'](util['format'](_0xf463('0x150'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x106945['findBy']));this['channel'][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0x150'),this[_0xf463('0x36')][_0xf463('0x3b')],_0x106945[_0xf463('0x14d')]));return{'code':0xc8,'result':_0xf463('0x155')};}};AGIVertices[_0xf463('0xf')][_0xf463('0x1c3')]=function(_0x6152ae){logger[_0xf463('0x31')](util['format'](_0xf463('0x1c4'),_0x6152ae[_0xf463('0x38')]));var _0x4e46d2=this[_0xf463('0x36')][_0xf463('0x56')](_0xf463('0x1c5'),[_0x6152ae['mailbox'],_0x6152ae[_0xf463('0x79')]]);if(_0x4e46d2['result']===-0x1){return _0x4e46d2;}return this[_0xf463('0x36')][_0xf463('0xaa')](util[_0xf463('0x2a')](_0xf463('0xc6'),_0xf463('0x1c5'),_0x6152ae[_0xf463('0x1c6')]));};AGIVertices[_0xf463('0xf')]['vswitch']=function(_0x5d3a01){logger['info'](util[_0xf463('0x2a')](_0xf463('0x1c7'),_0x5d3a01['label']));if(!this[_0xf463('0xa5')](_0x5d3a01[_0xf463('0xd7')])){return this[_0xf463('0x36')][_0xf463('0x2e')](_0x5d3a01,_0xf463('0x1a5'));}var _0x497882=this[_0xf463('0x10')][_0xf463('0x71')](this,_0x5d3a01[_0xf463('0xd7')]);if(!_0x497882){return this['channel'][_0xf463('0x2e')](_0x5d3a01,'no\x20variable\x20found');}var _0x1f3fcb=this['channel'][_0xf463('0x10')](_0x497882);return{'code':0xc8,'result':_0x1f3fcb[_0xf463('0xa2')]?_0x1f3fcb[_0xf463('0xa2')]:'-'};};String['prototype'][_0xf463('0x1c8')]=function(_0xae3bd3,_0xca9baf){return this[_0xf463('0xa1')](_0xae3bd3)[_0xf463('0x1c9')](_0xca9baf);};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 2826dd4..a5ae4bd 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 _0x4195=['format','uniqueid','updateAcw','update','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','acwTimeout','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','lastPauseAt'];(function(_0x569960,_0x5827a5){var _0x2e88ac=function(_0x4547b9){while(--_0x4547b9){_0x569960['push'](_0x569960['shift']());}};_0x2e88ac(++_0x5827a5);}(_0x4195,0x124));var _0x5419=function(_0x5555c6,_0x3b388f){_0x5555c6=_0x5555c6-0x0;var _0x5e8dc5=_0x4195[_0x5555c6];return _0x5e8dc5;};'use strict';var util=require(_0x5419('0x0'));var _=require(_0x5419('0x1'));var moment=require(_0x5419('0x2'));var ami=require(_0x5419('0x3'));var logger=require(_0x5419('0x4'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x5419('0x5'));function Acw(_0xe33199){this['voiceQueues']=_0xe33199[_0x5419('0x6')];this[_0x5419('0x7')]=_0xe33199[_0x5419('0x7')];this[_0x5419('0x8')]=_0xe33199['timers'];this[_0x5419('0x9')]={};ami['on'](_0x5419('0xa'),this[_0x5419('0xb')]['bind'](this));ami['on'](_0x5419('0xc'),this[_0x5419('0xd')][_0x5419('0xe')](this));ami['on']('hangup',this['syncHangup'][_0x5419('0xe')](this));ami['on'](_0x5419('0xf'),this[_0x5419('0x10')][_0x5419('0xe')](this));ami['on'](_0x5419('0x11'),this[_0x5419('0x12')][_0x5419('0xe')](this));ami['on']('blindtransfer',this[_0x5419('0x13')][_0x5419('0xe')](this));ami['on'](_0x5419('0x14'),this[_0x5419('0x15')][_0x5419('0xe')](this));}function getDiff(_0x44ac57){var _0x4ee6d3=moment()[_0x5419('0x16')](0x0);var _0x33811e=moment(_0x44ac57)['milliseconds'](0x0);return _0x4ee6d3[_0x5419('0x17')](_0x33811e,_0x5419('0x18'));}Acw[_0x5419('0x19')]['startAcw']=function(_0x505ce4){try{var _0x4b1748=this;var _0x33bb34=this[_0x5419('0x9')][_0x505ce4][_0x5419('0x1a')];var _0x3812e1=this['channels'][_0x505ce4][_0x5419('0x1b')];var _0x8e582a=this[_0x5419('0x6')][_0x3812e1];var _0x402759=![];var _0x51a09e='ACW';if(_0x8e582a[_0x5419('0x1c')]){if(_0x8e582a[_0x5419('0x1d')][_0x5419('0x1e')]){_0x402759=!![];_0x51a09e=_0x8e582a['mandatoryDispositionPause']['name'];}}ami['Action']({'action':_0x5419('0x1f'),'interface':_0x33bb34,'paused':!![],'reason':_0x51a09e})[_0x5419('0x20')](function(_0xc6d0d2){if(_0x4b1748[_0x5419('0x7')][_0x33bb34]){return RpcUser[_0x5419('0x21')](_0x4b1748[_0x5419('0x7')][_0x33bb34]['id'])[_0x5419('0x20')](function(_0x1857e6){if(_0x1857e6&&!_0x1857e6[_0x5419('0x22')]){logger[_0x5419('0x23')](_0x5419('0x24'),_0x505ce4,_0x33bb34,_0x3812e1);var _0x58cab5=_0x4b1748[_0x5419('0x9')][_0x505ce4][_0x5419('0x25')]&&_0x4b1748[_0x5419('0x9')][_0x505ce4]['destlinkedid']?_0x4b1748['channels'][_0x505ce4][_0x5419('0x26')]:_0x505ce4;return RpcUser[_0x5419('0x27')](_0x4b1748['agents'][_0x33bb34],_0x51a09e,_0x58cab5)[_0x5419('0x20')](function(_0x5cb6b7){if(!_0x402759){_0x4b1748[_0x5419('0x8')][_0x33bb34]={};logger[_0x5419('0x23')](_0x5419('0x28'),_0x505ce4,_0x4b1748[_0x5419('0x6')][_0x3812e1]['acwTimeout'],_0x33bb34,_0x3812e1);_0x4b1748[_0x5419('0x8')][_0x33bb34][_0x5419('0x29')]=setTimeout(_0x4b1748[_0x5419('0x2a')][_0x5419('0xe')](_0x4b1748,_0x33bb34),_0x4b1748[_0x5419('0x6')][_0x3812e1]['acwTimeout']*0x3e8);_0x4b1748[_0x5419('0x8')][_0x33bb34][_0x5419('0x2b')]=moment()[_0x5419('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b1748[_0x5419('0x8')][_0x33bb34][_0x5419('0x2d')]=_0x505ce4;_0x4b1748[_0x5419('0x8')][_0x33bb34][_0x5419('0x1b')]=_0x3812e1;_0x4b1748['timers'][_0x33bb34][_0x5419('0x2e')]=function(){var _0x1ef8ed=getDiff(_0x4b1748[_0x5419('0x8')][_0x33bb34][_0x5419('0x2b')]);clearTimeout(_0x4b1748['timers'][_0x33bb34][_0x5419('0x29')]);_0x4b1748[_0x5419('0x8')][_0x33bb34][_0x5419('0x29')]=![];RpcVoiceAgentReport[_0x5419('0x2f')]({'acwtime':_0x1ef8ed},_0x4b1748[_0x5419('0x8')][_0x33bb34][_0x5419('0x2d')],_0x33bb34)['then'](function(_0x59c08a){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x505ce4,_0x1ef8ed,_0x59c08a);})['catch'](function(_0x5f3354){logger[_0x5419('0x30')](_0x5419('0x31'),_0x505ce4,_0x5f3354);});delete _0x4b1748[_0x5419('0x8')][_0x33bb34];};}});}else{logger[_0x5419('0x23')](_0x5419('0x32'),_0x505ce4,_0x33bb34,_0x3812e1);}});}})[_0x5419('0x33')](function(_0x541751){logger[_0x5419('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x505ce4,_0x4b1748[_0x5419('0x6')][_0x3812e1][_0x5419('0x34')],_0x33bb34,_0x3812e1);})[_0x5419('0x35')](function(){delete _0x4b1748[_0x5419('0x9')][_0x505ce4];});}catch(_0x453f52){logger[_0x5419('0x30')](_0x5419('0x36'),_0x453f52[_0x5419('0x37')]);}};Acw[_0x5419('0x19')][_0x5419('0x2a')]=function(_0x413c24){try{var _0x32e081=this;if(_0x32e081['timers'][_0x413c24]){_0x32e081['timers'][_0x413c24][_0x5419('0x29')]=![];var _0x438273=_0x32e081[_0x5419('0x8')][_0x413c24][_0x5419('0x2d')];var _0xf4fec1=_0x32e081[_0x5419('0x8')][_0x413c24][_0x5419('0x1b')];var _0x3ee7a1=_0x32e081[_0x5419('0x6')][_0xf4fec1][_0x5419('0x34')];logger['info'](_0x5419('0x38'),_0x438273,_0x413c24);RpcUser[_0x5419('0x39')](this[_0x5419('0x7')][_0x413c24]);RpcVoiceAgentReport[_0x5419('0x2f')]({'acwtime':_0x3ee7a1,'agentacw':!![]},_0x438273,_0x413c24)[_0x5419('0x20')](function(_0x1559d3){logger['info'](_0x5419('0x3a'),_0x438273,_0x3ee7a1,_0x1559d3);})['catch'](function(_0x586818){logger[_0x5419('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x438273,_0x586818);});}else{logger['error'](_0x5419('0x3b'),_0x413c24);if(_0x32e081[_0x5419('0x8')]){logger['info'](_0x5419('0x3c'),JSON[_0x5419('0x3d')](_0x32e081[_0x5419('0x8')]));}}}catch(_0x1c896b){logger[_0x5419('0x30')](_0x5419('0x3e'),_0x1c896b[_0x5419('0x37')]);}};Acw[_0x5419('0x19')][_0x5419('0xb')]=function(_0x2c15ac){try{if(this[_0x5419('0x6')][_0x2c15ac['queue']]&&(this[_0x5419('0x6')][_0x2c15ac[_0x5419('0x1b')]][_0x5419('0x3f')]||this[_0x5419('0x6')][_0x2c15ac[_0x5419('0x1b')]]['mandatoryDisposition'])){if(this[_0x5419('0x7')][_0x2c15ac['interface']]){this[_0x5419('0x9')][_0x2c15ac['uniqueid']]={'queue':_0x2c15ac[_0x5419('0x1b')],'interface':_0x2c15ac['interface'],'destlinkedid':_0x2c15ac['destlinkedid']};}}}catch(_0x4f150d){logger[_0x5419('0x30')]('[ACW][syncAgentConnect]\x20%s',_0x4f150d['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x56b185){try{if(this[_0x5419('0x6')][_0x56b185[_0x5419('0x1b')]]&&(this[_0x5419('0x6')][_0x56b185[_0x5419('0x1b')]]['acw']||this[_0x5419('0x6')][_0x56b185[_0x5419('0x1b')]]['mandatoryDisposition'])){if(this[_0x5419('0x7')][_0x56b185['interface']]){this[_0x5419('0x9')][_0x56b185['uniqueid']]={'queue':_0x56b185[_0x5419('0x1b')],'interface':_0x56b185['interface']};}}}catch(_0x1b432c){logger[_0x5419('0x30')](_0x5419('0x40'),_0x1b432c['message']);}};Acw[_0x5419('0x19')][_0x5419('0xd')]=function(_0x5ec1a8){try{if(this[_0x5419('0x9')][_0x5ec1a8[_0x5419('0x2d')]]&&_[_0x5419('0x41')](this[_0x5419('0x9')][_0x5ec1a8[_0x5419('0x2d')]][_0x5419('0x25')])){logger[_0x5419('0x23')](_0x5419('0x42'),_0x5ec1a8['uniqueid']);this[_0x5419('0x43')](_0x5ec1a8[_0x5419('0x2d')]);}else if(this['channels'][_0x5ec1a8[_0x5419('0x44')]]&&_[_0x5419('0x41')](this[_0x5419('0x9')][_0x5ec1a8[_0x5419('0x44')]][_0x5419('0x25')])){logger[_0x5419('0x23')](_0x5419('0x45'),_0x5ec1a8[_0x5419('0x44')]);this[_0x5419('0x43')](_0x5ec1a8[_0x5419('0x44')]);}}catch(_0x4a0375){logger[_0x5419('0x30')](_0x5419('0x46'),_0x4a0375[_0x5419('0x37')]);}};Acw['prototype'][_0x5419('0x47')]=function(_0x5dca6a){try{if(this[_0x5419('0x9')][_0x5dca6a[_0x5419('0x2d')]]&&this['channels'][_0x5dca6a[_0x5419('0x2d')]]['attended']){logger[_0x5419('0x23')](_0x5419('0x48'),_0x5dca6a[_0x5419('0x2d')]);this[_0x5419('0x43')](_0x5dca6a[_0x5419('0x2d')]);}else if(this[_0x5419('0x9')][_0x5dca6a[_0x5419('0x44')]]&&this[_0x5419('0x9')][_0x5dca6a[_0x5419('0x44')]][_0x5419('0x25')]){logger[_0x5419('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5dca6a[_0x5419('0x44')]);this['startAcw'](_0x5dca6a[_0x5419('0x44')]);}}catch(_0x33482b){logger[_0x5419('0x30')]('[ACW][syncHangup]\x20%s',_0x33482b[_0x5419('0x37')]);}};Acw[_0x5419('0x19')]['syncAttendedTransfer']=function(_0x3b7bc5){try{if(!_[_0x5419('0x49')](this['channels'][_0x3b7bc5[_0x5419('0x4a')]])){this['startAcw'](_0x3b7bc5[_0x5419('0x4a')]);if(this[_0x5419('0x9')][_0x3b7bc5['secondtransfereruniqueid']]){this['channels'][_0x3b7bc5[_0x5419('0x4b')]][_0x5419('0x25')]=!![];this[_0x5419('0x9')][_0x3b7bc5[_0x5419('0x4c')]]=this[_0x5419('0x9')][_0x3b7bc5[_0x5419('0x4b')]];delete this['channels'][_0x3b7bc5[_0x5419('0x4b')]];}}else if(!_[_0x5419('0x49')](this[_0x5419('0x9')][_0x3b7bc5['transfertargetuniqueid']])){this[_0x5419('0x43')](_0x3b7bc5[_0x5419('0x4c')]);if(this[_0x5419('0x9')][_0x3b7bc5[_0x5419('0x4d')]]){this[_0x5419('0x9')][_0x3b7bc5[_0x5419('0x4d')]][_0x5419('0x25')]=!![];this[_0x5419('0x9')][_0x3b7bc5[_0x5419('0x4a')]]=this[_0x5419('0x9')][_0x3b7bc5[_0x5419('0x4d')]];delete this[_0x5419('0x9')][_0x3b7bc5[_0x5419('0x4d')]];}}}catch(_0xf1393){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0xf1393[_0x5419('0x37')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x3dfe42){try{if(this[_0x5419('0x9')][_0x3dfe42[_0x5419('0x4e')]]){logger[_0x5419('0x23')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x5419('0x3d')](_0x3dfe42[_0x5419('0x4e')]));this[_0x5419('0x43')](_0x3dfe42[_0x5419('0x4e')]);}else if(this[_0x5419('0x9')][_0x3dfe42[_0x5419('0x4f')]]){logger[_0x5419('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x5419('0x3d')](_0x3dfe42['transfererlinkedid']));this[_0x5419('0x43')](_0x3dfe42[_0x5419('0x4f')]);}}catch(_0x55ee5e){logger[_0x5419('0x30')](_0x5419('0x50'),_0x55ee5e[_0x5419('0x37')]);}};Acw[_0x5419('0x19')]['syncAgentRingNoAnswer']=function(_0x474236){try{if(this['voiceQueues'][_0x474236[_0x5419('0x1b')]]&&this[_0x5419('0x6')][_0x474236[_0x5419('0x1b')]]['autopause']===_0x5419('0x51')){if(this[_0x5419('0x7')][_0x474236[_0x5419('0x1a')]]){logger[_0x5419('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x474236['uniqueid'],_0x474236[_0x5419('0x1a')],_0x474236['queue']);return RpcUser['savePause'](this['agents'][_0x474236[_0x5419('0x1a')]],_0x5419('0x52'),_0x474236[_0x5419('0x2d')]);}}}catch(_0x402d48){logger[_0x5419('0x30')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x402d48['message']);}};module[_0x5419('0x53')]=Acw; \ No newline at end of file +var _0x7211=['error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','prototype','acw','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]'];(function(_0x50ce2b,_0x316b8f){var _0x1a1b36=function(_0x1895e5){while(--_0x1895e5){_0x50ce2b['push'](_0x50ce2b['shift']());}};_0x1a1b36(++_0x316b8f);}(_0x7211,0x1df));var _0x1721=function(_0x2d66df,_0x1069f7){_0x2d66df=_0x2d66df-0x0;var _0x2f9b50=_0x7211[_0x2d66df];return _0x2f9b50;};'use strict';var util=require(_0x1721('0x0'));var _=require(_0x1721('0x1'));var moment=require(_0x1721('0x2'));var ami=require(_0x1721('0x3'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x1721('0x4'));var RpcVoiceAgentReport=require(_0x1721('0x5'));function Acw(_0x5279d5){this[_0x1721('0x6')]=_0x5279d5[_0x1721('0x6')];this[_0x1721('0x7')]=_0x5279d5[_0x1721('0x7')];this['timers']=_0x5279d5[_0x1721('0x8')];this[_0x1721('0x9')]={};ami['on'](_0x1721('0xa'),this['syncAgentConnect'][_0x1721('0xb')](this));ami['on'](_0x1721('0xc'),this[_0x1721('0xd')][_0x1721('0xb')](this));ami['on'](_0x1721('0xe'),this[_0x1721('0xf')][_0x1721('0xb')](this));ami['on'](_0x1721('0x10'),this[_0x1721('0x11')][_0x1721('0xb')](this));ami['on'](_0x1721('0x12'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x1721('0x13')][_0x1721('0xb')](this));ami['on'](_0x1721('0x14'),this[_0x1721('0x15')][_0x1721('0xb')](this));}function getDiff(_0x3aed4c){var _0x2b0cb8=moment()[_0x1721('0x16')](0x0);var _0x58cd57=moment(_0x3aed4c)[_0x1721('0x16')](0x0);return _0x2b0cb8[_0x1721('0x17')](_0x58cd57,'seconds');}Acw['prototype'][_0x1721('0x18')]=function(_0x192b64){try{var _0x409bd4=this;var _0xfbee48=this[_0x1721('0x9')][_0x192b64][_0x1721('0x19')];var _0x19a300=this[_0x1721('0x9')][_0x192b64][_0x1721('0x1a')];var _0x4e45cd=this[_0x1721('0x6')][_0x19a300];var _0x52723c=![];var _0x597597=_0x1721('0x1b');if(_0x4e45cd[_0x1721('0x1c')]){if(_0x4e45cd['mandatoryDispositionPause']['name']){_0x52723c=!![];_0x597597=_0x4e45cd[_0x1721('0x1d')][_0x1721('0x1e')];}}ami['Action']({'action':'QueuePause','interface':_0xfbee48,'paused':!![],'reason':_0x597597})[_0x1721('0x1f')](function(_0x3c389c){if(_0x409bd4[_0x1721('0x7')][_0xfbee48]){return RpcUser[_0x1721('0x20')](_0x409bd4[_0x1721('0x7')][_0xfbee48]['id'])[_0x1721('0x1f')](function(_0x15186b){if(_0x15186b&&!_0x15186b[_0x1721('0x21')]){logger['info'](_0x1721('0x22'),_0x192b64,_0xfbee48,_0x19a300);var _0x5d7609=_0x409bd4['channels'][_0x192b64][_0x1721('0x23')]&&_0x409bd4['channels'][_0x192b64][_0x1721('0x24')]?_0x409bd4['channels'][_0x192b64][_0x1721('0x24')]:_0x192b64;return RpcUser[_0x1721('0x25')](_0x409bd4[_0x1721('0x7')][_0xfbee48],_0x597597,_0x5d7609)[_0x1721('0x1f')](function(_0x42e54b){if(!_0x52723c){_0x409bd4[_0x1721('0x8')][_0xfbee48]={};logger[_0x1721('0x26')](_0x1721('0x27'),_0x192b64,_0x409bd4[_0x1721('0x6')][_0x19a300][_0x1721('0x28')],_0xfbee48,_0x19a300);_0x409bd4[_0x1721('0x8')][_0xfbee48][_0x1721('0x29')]=setTimeout(_0x409bd4['stopAcw'][_0x1721('0xb')](_0x409bd4,_0xfbee48),_0x409bd4[_0x1721('0x6')][_0x19a300]['acwTimeout']*0x3e8);_0x409bd4[_0x1721('0x8')][_0xfbee48][_0x1721('0x2a')]=moment()[_0x1721('0x2b')](_0x1721('0x2c'));_0x409bd4[_0x1721('0x8')][_0xfbee48]['uniqueid']=_0x192b64;_0x409bd4[_0x1721('0x8')][_0xfbee48][_0x1721('0x1a')]=_0x19a300;_0x409bd4[_0x1721('0x8')][_0xfbee48][_0x1721('0x2d')]=function(){var _0x513277=getDiff(_0x409bd4[_0x1721('0x8')][_0xfbee48][_0x1721('0x2a')]);clearTimeout(_0x409bd4['timers'][_0xfbee48][_0x1721('0x29')]);_0x409bd4[_0x1721('0x8')][_0xfbee48][_0x1721('0x29')]=![];RpcVoiceAgentReport[_0x1721('0x2e')]({'acwtime':_0x513277},_0x409bd4[_0x1721('0x8')][_0xfbee48][_0x1721('0x2f')],_0xfbee48)[_0x1721('0x1f')](function(_0x163765){logger[_0x1721('0x26')](_0x1721('0x30'),_0x192b64,_0x513277,_0x163765);})['catch'](function(_0x242495){logger[_0x1721('0x31')](_0x1721('0x32'),_0x192b64,_0x242495);});delete _0x409bd4[_0x1721('0x8')][_0xfbee48];};}});}else{logger[_0x1721('0x26')](_0x1721('0x33'),_0x192b64,_0xfbee48,_0x19a300);}});}})[_0x1721('0x34')](function(_0x29f96f){logger['error'](_0x1721('0x27'),_0x192b64,_0x409bd4[_0x1721('0x6')][_0x19a300][_0x1721('0x28')],_0xfbee48,_0x19a300);})[_0x1721('0x35')](function(){delete _0x409bd4[_0x1721('0x9')][_0x192b64];});}catch(_0x2f3870){logger[_0x1721('0x31')](_0x1721('0x36'),_0x2f3870['message']);}};Acw['prototype']['stopAcw']=function(_0x147a35){try{var _0x1d0a5d=this;if(_0x1d0a5d['timers'][_0x147a35]){_0x1d0a5d['timers'][_0x147a35]['timer']=![];var _0x296c0c=_0x1d0a5d['timers'][_0x147a35]['uniqueid'];var _0x5e5832=_0x1d0a5d['timers'][_0x147a35]['queue'];var _0x10e718=_0x1d0a5d[_0x1721('0x6')][_0x5e5832][_0x1721('0x28')];logger[_0x1721('0x26')]('[%s][TIMER][STOP][AGENT:%s]',_0x296c0c,_0x147a35);RpcUser[_0x1721('0x37')](this[_0x1721('0x7')][_0x147a35]);RpcVoiceAgentReport['update']({'acwtime':_0x10e718,'agentacw':!![]},_0x296c0c,_0x147a35)[_0x1721('0x1f')](function(_0x69d899){logger[_0x1721('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x296c0c,_0x10e718,_0x69d899);})['catch'](function(_0x247f87){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x296c0c,_0x247f87);});}else{logger[_0x1721('0x31')](_0x1721('0x38'),_0x147a35);if(_0x1d0a5d[_0x1721('0x8')]){logger['info']('[ACW][TIMERS]',JSON[_0x1721('0x39')](_0x1d0a5d['timers']));}}}catch(_0x571b08){logger['error'](_0x1721('0x3a'),_0x571b08[_0x1721('0x3b')]);}};Acw[_0x1721('0x3c')]['syncAgentConnect']=function(_0x5c17a3){try{if(this['voiceQueues'][_0x5c17a3[_0x1721('0x1a')]]&&(this[_0x1721('0x6')][_0x5c17a3[_0x1721('0x1a')]][_0x1721('0x3d')]||this[_0x1721('0x6')][_0x5c17a3[_0x1721('0x1a')]]['mandatoryDisposition'])){if(this[_0x1721('0x7')][_0x5c17a3['interface']]){this[_0x1721('0x9')][_0x5c17a3[_0x1721('0x2f')]]={'queue':_0x5c17a3[_0x1721('0x1a')],'interface':_0x5c17a3[_0x1721('0x19')],'destlinkedid':_0x5c17a3[_0x1721('0x24')]};}}}catch(_0x5f574c){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x5f574c[_0x1721('0x3b')]);}};Acw[_0x1721('0x3c')][_0x1721('0x15')]=function(_0x522d56){try{if(this[_0x1721('0x6')][_0x522d56[_0x1721('0x1a')]]&&(this['voiceQueues'][_0x522d56['queue']][_0x1721('0x3d')]||this[_0x1721('0x6')][_0x522d56['queue']][_0x1721('0x1c')])){if(this['agents'][_0x522d56[_0x1721('0x19')]]){this[_0x1721('0x9')][_0x522d56[_0x1721('0x2f')]]={'queue':_0x522d56[_0x1721('0x1a')],'interface':_0x522d56[_0x1721('0x19')]};}}}catch(_0x11dd40){logger[_0x1721('0x31')](_0x1721('0x3e'),_0x11dd40[_0x1721('0x3b')]);}};Acw[_0x1721('0x3c')][_0x1721('0xd')]=function(_0x4f5e20){try{if(this[_0x1721('0x9')][_0x4f5e20[_0x1721('0x2f')]]&&_['isUndefined'](this[_0x1721('0x9')][_0x4f5e20[_0x1721('0x2f')]][_0x1721('0x23')])){logger['info'](_0x1721('0x3f'),_0x4f5e20[_0x1721('0x2f')]);this[_0x1721('0x18')](_0x4f5e20[_0x1721('0x2f')]);}else if(this[_0x1721('0x9')][_0x4f5e20[_0x1721('0x40')]]&&_[_0x1721('0x41')](this[_0x1721('0x9')][_0x4f5e20[_0x1721('0x40')]][_0x1721('0x23')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x4f5e20[_0x1721('0x40')]);this[_0x1721('0x18')](_0x4f5e20[_0x1721('0x40')]);}}catch(_0x3918e1){logger[_0x1721('0x31')](_0x1721('0x42'),_0x3918e1[_0x1721('0x3b')]);}};Acw[_0x1721('0x3c')]['syncHangup']=function(_0x195c15){try{if(this['channels'][_0x195c15['uniqueid']]&&this[_0x1721('0x9')][_0x195c15['uniqueid']][_0x1721('0x23')]){logger[_0x1721('0x26')](_0x1721('0x43'),_0x195c15['uniqueid']);this[_0x1721('0x18')](_0x195c15[_0x1721('0x2f')]);}else if(this[_0x1721('0x9')][_0x195c15['linkedid']]&&this[_0x1721('0x9')][_0x195c15[_0x1721('0x40')]]['attended']){logger[_0x1721('0x26')](_0x1721('0x44'),_0x195c15['linkedid']);this['startAcw'](_0x195c15[_0x1721('0x40')]);}}catch(_0x4aaf2d){logger[_0x1721('0x31')](_0x1721('0x45'),_0x4aaf2d['message']);}};Acw['prototype'][_0x1721('0x46')]=function(_0x387347){try{if(!_[_0x1721('0x47')](this[_0x1721('0x9')][_0x387347[_0x1721('0x48')]])){this['startAcw'](_0x387347[_0x1721('0x48')]);if(this['channels'][_0x387347[_0x1721('0x49')]]){this[_0x1721('0x9')][_0x387347[_0x1721('0x49')]][_0x1721('0x23')]=!![];this[_0x1721('0x9')][_0x387347['transfertargetuniqueid']]=this[_0x1721('0x9')][_0x387347[_0x1721('0x49')]];delete this['channels'][_0x387347[_0x1721('0x49')]];}}else if(!_[_0x1721('0x47')](this['channels'][_0x387347[_0x1721('0x4a')]])){this[_0x1721('0x18')](_0x387347['transfertargetuniqueid']);if(this[_0x1721('0x9')][_0x387347[_0x1721('0x4b')]]){this[_0x1721('0x9')][_0x387347[_0x1721('0x4b')]][_0x1721('0x23')]=!![];this['channels'][_0x387347[_0x1721('0x48')]]=this[_0x1721('0x9')][_0x387347[_0x1721('0x4b')]];delete this[_0x1721('0x9')][_0x387347[_0x1721('0x4b')]];}}}catch(_0x1f3b9b){logger[_0x1721('0x31')](_0x1721('0x4c'),_0x1f3b9b[_0x1721('0x3b')]);}};Acw['prototype'][_0x1721('0x13')]=function(_0x35fc60){try{if(this[_0x1721('0x9')][_0x35fc60['transfereruniqueid']]){logger['info'](_0x1721('0x4d'),JSON['stringify'](_0x35fc60['transfereruniqueid']));this[_0x1721('0x18')](_0x35fc60[_0x1721('0x4e')]);}else if(this[_0x1721('0x9')][_0x35fc60[_0x1721('0x4f')]]){logger[_0x1721('0x26')](_0x1721('0x50'),JSON[_0x1721('0x39')](_0x35fc60['transfererlinkedid']));this[_0x1721('0x18')](_0x35fc60[_0x1721('0x4f')]);}}catch(_0x49cf30){logger[_0x1721('0x31')](_0x1721('0x51'),_0x49cf30[_0x1721('0x3b')]);}};Acw[_0x1721('0x3c')][_0x1721('0x11')]=function(_0x5e42be){try{if(this['voiceQueues'][_0x5e42be[_0x1721('0x1a')]]&&this[_0x1721('0x6')][_0x5e42be[_0x1721('0x1a')]][_0x1721('0x52')]===_0x1721('0x53')){if(this[_0x1721('0x7')][_0x5e42be[_0x1721('0x19')]]){logger[_0x1721('0x26')](_0x1721('0x54'),_0x5e42be[_0x1721('0x2f')],_0x5e42be['interface'],_0x5e42be[_0x1721('0x1a')]);return RpcUser[_0x1721('0x25')](this[_0x1721('0x7')][_0x5e42be[_0x1721('0x19')]],_0x1721('0x55'),_0x5e42be['uniqueid']);}}}catch(_0x4a7ad1){logger[_0x1721('0x31')](_0x1721('0x56'),_0x4a7ad1[_0x1721('0x3b')]);}};module[_0x1721('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c21e0c8..1b16827 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 _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x58c8be,_0x458021){var _0x308502=function(_0x494ca7){while(--_0x494ca7){_0x58c8be['push'](_0x58c8be['shift']());}};_0x308502(++_0x458021);}(_0x757a,0xde));var _0xa757=function(_0x414e4d,_0x6e25f2){_0x414e4d=_0x414e4d-0x0;var _0x3ff685=_0x757a[_0x414e4d];return _0x3ff685;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file +var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x3021c1,_0x55014a){var _0x21e10e=function(_0x1159cd){while(--_0x1159cd){_0x3021c1['push'](_0x3021c1['shift']());}};_0x21e10e(++_0x55014a);}(_0x0b0e,0x187));var _0xe0b0=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x0b0e[_0xbb14db];return _0x36bed7;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 42de608..112dc4b 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 _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x70e0,0x17b));var _0x070e=function(_0x409fe1,_0x183a06){_0x409fe1=_0x409fe1-0x0;var _0x4a2fa5=_0x70e0[_0x409fe1];return _0x4a2fa5;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x1b5cc2,_0x4321c2){var _0x375f3b=function(_0x265ddb){while(--_0x265ddb){_0x1b5cc2['push'](_0x1b5cc2['shift']());}};_0x375f3b(++_0x4321c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 22a888d..ab5ff5e 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 _0xb4c1=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','format','callback','callbackuniqueid','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','getQueue','queue','util','moment','isNil','string','uniqueid','name','phone','Contact','firstName','lastName','number','type','dialQueueTimeout','scheduledat','countbusyretry'];(function(_0x5c993e,_0x23922e){var _0x4577bc=function(_0x27258b){while(--_0x27258b){_0x5c993e['push'](_0x5c993e['shift']());}};_0x4577bc(++_0x23922e);}(_0xb4c1,0x102));var _0x1b4c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb4c1[_0x46e363];return _0x3fb059;};'use strict';var util=require(_0x1b4c('0x0'));var _=require('lodash');var moment=require(_0x1b4c('0x1'));function checkNameSurname(_0x4de171,_0x177ff2,_0x222121){var _0x564fa4='';if(!_[_0x1b4c('0x2')](_0x177ff2)&&_0x1b4c('0x3')===typeof _0x177ff2){_0x564fa4+=_0x177ff2;}if(!_['isNil'](_0x222121)&&_0x1b4c('0x3')===typeof _0x222121){_0x564fa4+='\x20'+_0x222121;}if(_0x564fa4!==''){return _0x564fa4;}return _0x4de171;}function Action(_0x18cb10,_0x4dc9f8,_0x1d2580){this['voiceQueue']=_0x18cb10;this[_0x1b4c('0x4')]=_0x1d2580||undefined;this[_0x1b4c('0x5')]=checkNameSurname(_0x4dc9f8['Contact'][_0x1b4c('0x6')],_0x4dc9f8[_0x1b4c('0x7')][_0x1b4c('0x8')],_0x4dc9f8[_0x1b4c('0x7')][_0x1b4c('0x9')]);this[_0x1b4c('0xa')]=_0x4dc9f8[_0x1b4c('0x7')][_0x1b4c('0x6')];this['queue']=_0x18cb10[_0x1b4c('0x5')];this['active']=_0x4dc9f8['active']||![];this['type']=_0x18cb10[_0x1b4c('0xb')];this['dialQueueTimeout']=_0x18cb10[_0x1b4c('0xc')]||0x3;this[_0x1b4c('0xd')]=_0x4dc9f8[_0x1b4c('0xd')];this[_0x1b4c('0xe')]=_0x4dc9f8[_0x1b4c('0xe')];this[_0x1b4c('0xf')]=_0x4dc9f8[_0x1b4c('0xf')];this['countnoanswerretry']=_0x4dc9f8[_0x1b4c('0x10')];this[_0x1b4c('0x11')]=_0x4dc9f8[_0x1b4c('0x11')];this[_0x1b4c('0x12')]=_0x4dc9f8['countdropretry'];this[_0x1b4c('0x13')]=_0x4dc9f8[_0x1b4c('0x13')];this[_0x1b4c('0x14')]=_0x4dc9f8['countmachineretry'];this[_0x1b4c('0x15')]=_0x4dc9f8[_0x1b4c('0x15')];this['ContactId']=_0x4dc9f8[_0x1b4c('0x16')];this[_0x1b4c('0x17')]=_0x4dc9f8['ListId'];this[_0x1b4c('0x18')]=_0x4dc9f8['UserId'];this[_0x1b4c('0x19')]=_0x4dc9f8[_0x1b4c('0x19')];this['CampaignId']=_0x4dc9f8['CampaignId'];this['idHopper']=_0x4dc9f8['id'];this[_0x1b4c('0x1a')]=_0x4dc9f8['Contact'][_0x1b4c('0x8')]||'';this['starttime']=moment()[_0x1b4c('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1b4c('0x1c')]=_0x4dc9f8[_0x1b4c('0x1c')];this[_0x1b4c('0x1d')]=_0x4dc9f8[_0x1b4c('0x1d')];this['callbackat']=_0x4dc9f8['callbackat'];this[_0x1b4c('0x1e')]=_0x4dc9f8[_0x1b4c('0x1e')];this[_0x1b4c('0x1f')]='';this['originatecalleridname']='';}Action['prototype'][_0x1b4c('0x20')]=function(){return util[_0x1b4c('0x1b')](_0x1b4c('0x21'),this[_0x1b4c('0x5')],this[_0x1b4c('0x22')]['dialCutDigit']>0x0?this['number'][_0x1b4c('0x23')](this[_0x1b4c('0x22')][_0x1b4c('0x24')]):this['number']);};Action['prototype'][_0x1b4c('0x25')]=function(){return this[_0x1b4c('0x26')];};module['exports']=Action; \ No newline at end of file +var _0xf278=['string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','queue','exports','util','lodash','moment'];(function(_0x24c15e,_0x2c83ab){var _0x435fe7=function(_0x50a0d9){while(--_0x50a0d9){_0x24c15e['push'](_0x24c15e['shift']());}};_0x435fe7(++_0x2c83ab);}(_0xf278,0x10b));var _0x8f27=function(_0x370284,_0x3348d5){_0x370284=_0x370284-0x0;var _0x1445c8=_0xf278[_0x370284];return _0x1445c8;};'use strict';var util=require(_0x8f27('0x0'));var _=require(_0x8f27('0x1'));var moment=require(_0x8f27('0x2'));function checkNameSurname(_0xe80d74,_0x4ef350,_0xfc5308){var _0xafcd8a='';if(!_['isNil'](_0x4ef350)&&_0x8f27('0x3')===typeof _0x4ef350){_0xafcd8a+=_0x4ef350;}if(!_['isNil'](_0xfc5308)&&_0x8f27('0x3')===typeof _0xfc5308){_0xafcd8a+='\x20'+_0xfc5308;}if(_0xafcd8a!==''){return _0xafcd8a;}return _0xe80d74;}function Action(_0x1a3a1f,_0x4c2973,_0x3478f6){this[_0x8f27('0x4')]=_0x1a3a1f;this[_0x8f27('0x5')]=_0x3478f6||undefined;this[_0x8f27('0x6')]=checkNameSurname(_0x4c2973['Contact']['phone'],_0x4c2973[_0x8f27('0x7')][_0x8f27('0x8')],_0x4c2973[_0x8f27('0x7')][_0x8f27('0x9')]);this[_0x8f27('0xa')]=_0x4c2973['Contact'][_0x8f27('0xb')];this['queue']=_0x1a3a1f[_0x8f27('0x6')];this['active']=_0x4c2973[_0x8f27('0xc')]||![];this['type']=_0x1a3a1f[_0x8f27('0xd')];this['dialQueueTimeout']=_0x1a3a1f[_0x8f27('0xe')]||0x3;this[_0x8f27('0xf')]=_0x4c2973[_0x8f27('0xf')];this[_0x8f27('0x10')]=_0x4c2973['countbusyretry'];this[_0x8f27('0x11')]=_0x4c2973[_0x8f27('0x11')];this[_0x8f27('0x12')]=_0x4c2973['countnoanswerretry'];this[_0x8f27('0x13')]=_0x4c2973[_0x8f27('0x13')];this[_0x8f27('0x14')]=_0x4c2973[_0x8f27('0x14')];this[_0x8f27('0x15')]=_0x4c2973[_0x8f27('0x15')];this['countmachineretry']=_0x4c2973[_0x8f27('0x16')];this[_0x8f27('0x17')]=_0x4c2973[_0x8f27('0x17')];this['ContactId']=_0x4c2973[_0x8f27('0x18')];this[_0x8f27('0x19')]=_0x4c2973[_0x8f27('0x19')];this[_0x8f27('0x1a')]=_0x4c2973['UserId'];this[_0x8f27('0x1b')]=_0x4c2973[_0x8f27('0x1b')];this[_0x8f27('0x1c')]=_0x4c2973[_0x8f27('0x1c')];this['idHopper']=_0x4c2973['id'];this[_0x8f27('0x1d')]=_0x4c2973[_0x8f27('0x7')][_0x8f27('0x8')]||'';this['starttime']=moment()[_0x8f27('0x1e')](_0x8f27('0x1f'));this['callback']=_0x4c2973[_0x8f27('0x20')];this[_0x8f27('0x21')]=_0x4c2973['callbackuniqueid'];this['callbackat']=_0x4c2973[_0x8f27('0x22')];this[_0x8f27('0x23')]=_0x4c2973[_0x8f27('0x23')];this[_0x8f27('0x24')]='';this[_0x8f27('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0x8f27('0x1e')](_0x8f27('0x26'),this[_0x8f27('0x6')],this[_0x8f27('0x4')][_0x8f27('0x27')]>0x0?this[_0x8f27('0xa')][_0x8f27('0x28')](this['voiceQueue']['dialCutDigit']):this['number']);};Action[_0x8f27('0x29')][_0x8f27('0x2a')]=function(){return this[_0x8f27('0x2b')];};module[_0x8f27('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index c802480..18fcd8d 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 _0x5f6f=['number','starttime','responsetime','answertime','ringtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum'];(function(_0x5def41,_0x2d9419){var _0x4df11a=function(_0x2a50d5){while(--_0x2a50d5){_0x5def41['push'](_0x5def41['shift']());}};_0x4df11a(++_0x2d9419);}(_0x5f6f,0x141));var _0xf5f6=function(_0x5af89d,_0xa40ecd){_0x5af89d=_0x5af89d-0x0;var _0x44e390=_0x5f6f[_0x5af89d];return _0x44e390;};'use strict';var util=require('util');var _=require(_0xf5f6('0x0'));var moment=require(_0xf5f6('0x1'));function getSeconds(_0x5a7692,_0x105060){var _0x5ef6b8=moment(_0x5a7692)['milliseconds'](0x0);var _0x24e2f0=moment(_0x105060)[_0xf5f6('0x2')](0x0);return _0x5ef6b8[_0xf5f6('0x3')](_0x24e2f0,'seconds');}function AgentComplete(_0x4260c1,_0x8a382a){this[_0xf5f6('0x4')]=0x4;this[_0xf5f6('0x5')]=_0xf5f6('0x6');this[_0xf5f6('0x7')]=_0x4260c1['scheduledat'];this[_0xf5f6('0x8')]=_0x4260c1['type'];this[_0xf5f6('0x9')]=_0x4260c1['type']==='outbound'?_0xf5f6('0xa'):_0x4260c1[_0xf5f6('0x8')];this[_0xf5f6('0xb')]=_0x4260c1[_0xf5f6('0xb')];this['countcongestionretry']=_0x4260c1[_0xf5f6('0xc')];this[_0xf5f6('0xd')]=_0x4260c1[_0xf5f6('0xd')];this[_0xf5f6('0xe')]=_0x4260c1[_0xf5f6('0xb')]+_0x4260c1[_0xf5f6('0xc')]+_0x4260c1[_0xf5f6('0xd')]+_0x4260c1['countnosuchnumberretry']+_0x4260c1[_0xf5f6('0xf')]+_0x4260c1['countabandonedretry']+_0x4260c1[_0xf5f6('0x10')]+_0x4260c1['countagentrejectretry'];this[_0xf5f6('0x11')]=_0x4260c1[_0xf5f6('0x11')];this['countdropretry']=_0x4260c1[_0xf5f6('0xf')];this[_0xf5f6('0x12')]=_0x4260c1[_0xf5f6('0x12')];this[_0xf5f6('0x10')]=_0x4260c1[_0xf5f6('0x10')];this[_0xf5f6('0x13')]=_0x4260c1['countagentrejectretry'];this[_0xf5f6('0x14')]=_0x8a382a[_0xf5f6('0x14')];this['calleridname']=_0x4260c1[_0xf5f6('0x15')];this[_0xf5f6('0x16')]=_0x4260c1[_0xf5f6('0x17')];this['starttime']=_0x4260c1[_0xf5f6('0x18')];this[_0xf5f6('0x19')]=_0x4260c1['responsetime'];this[_0xf5f6('0x1a')]=_0x4260c1[_0xf5f6('0x1a')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xf5f6('0x1b')]=getSeconds(_0x4260c1[_0xf5f6('0x19')],_0x4260c1[_0xf5f6('0x18')]);this['holdtime']=getSeconds(_0x4260c1[_0xf5f6('0x1a')],_0x4260c1[_0xf5f6('0x19')]);this[_0xf5f6('0x1c')]=getSeconds(this[_0xf5f6('0x1d')],_0x4260c1[_0xf5f6('0x1a')]);this[_0xf5f6('0xa')]=_0x8a382a[_0xf5f6('0xa')];this[_0xf5f6('0x1e')]=_0x8a382a['membername'];this['reason']=_0x8a382a[_0xf5f6('0x1f')];this[_0xf5f6('0x20')]=_0x4260c1[_0xf5f6('0x20')];this[_0xf5f6('0x21')]=_0x4260c1[_0xf5f6('0x21')];this[_0xf5f6('0x22')]=_0x4260c1[_0xf5f6('0x22')];this[_0xf5f6('0x23')]=_0x4260c1[_0xf5f6('0x23')];this[_0xf5f6('0x24')]=_0x4260c1[_0xf5f6('0x24')];this[_0xf5f6('0x25')]=_0x4260c1['ListId'];this[_0xf5f6('0x26')]=_0x4260c1[_0xf5f6('0x26')];this['VoiceQueueId']=_0x4260c1['VoiceQueueId'];this[_0xf5f6('0x27')]=_0x4260c1['CampaignId'];this[_0xf5f6('0x28')]=_0x4260c1[_0xf5f6('0x28')]||'';this[_0xf5f6('0x29')]=_0x4260c1[_0xf5f6('0x29')]||'';}module[_0xf5f6('0x2a')]=AgentComplete; \ No newline at end of file +var _0x9700=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','number','starttime','responsetime','answertime','holdtime','endtime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x9700,0x12f));var _0x0970=function(_0x42317b,_0x28563d){_0x42317b=_0x42317b-0x0;var _0x34dcd0=_0x9700[_0x42317b];return _0x34dcd0;};'use strict';var util=require('util');var _=require(_0x0970('0x0'));var moment=require('moment');function getSeconds(_0x204d4b,_0x3199ea){var _0x7b271c=moment(_0x204d4b)[_0x0970('0x1')](0x0);var _0x2ffa07=moment(_0x3199ea)['milliseconds'](0x0);return _0x7b271c[_0x0970('0x2')](_0x2ffa07,_0x0970('0x3'));}function AgentComplete(_0x4b76ac,_0x44a28f){this[_0x0970('0x4')]=0x4;this['statedesc']=_0x0970('0x5');this[_0x0970('0x6')]=_0x4b76ac[_0x0970('0x6')];this['type']=_0x4b76ac[_0x0970('0x7')];this[_0x0970('0x8')]=_0x4b76ac[_0x0970('0x7')]===_0x0970('0x9')?_0x0970('0xa'):_0x4b76ac[_0x0970('0x7')];this[_0x0970('0xb')]=_0x4b76ac[_0x0970('0xb')];this[_0x0970('0xc')]=_0x4b76ac['countcongestionretry'];this[_0x0970('0xd')]=_0x4b76ac[_0x0970('0xd')];this[_0x0970('0xe')]=_0x4b76ac[_0x0970('0xb')]+_0x4b76ac[_0x0970('0xc')]+_0x4b76ac['countnoanswerretry']+_0x4b76ac[_0x0970('0xf')]+_0x4b76ac['countdropretry']+_0x4b76ac[_0x0970('0x10')]+_0x4b76ac[_0x0970('0x11')]+_0x4b76ac[_0x0970('0x12')];this[_0x0970('0xf')]=_0x4b76ac['countnosuchnumberretry'];this[_0x0970('0x13')]=_0x4b76ac['countdropretry'];this[_0x0970('0x10')]=_0x4b76ac[_0x0970('0x10')];this[_0x0970('0x11')]=_0x4b76ac[_0x0970('0x11')];this[_0x0970('0x12')]=_0x4b76ac[_0x0970('0x12')];this[_0x0970('0x14')]=_0x44a28f[_0x0970('0x14')];this['calleridname']=_0x4b76ac['name'];this['calleridnum']=_0x4b76ac[_0x0970('0x15')];this[_0x0970('0x16')]=_0x4b76ac[_0x0970('0x16')];this['responsetime']=_0x4b76ac[_0x0970('0x17')];this[_0x0970('0x18')]=_0x4b76ac[_0x0970('0x18')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x4b76ac['responsetime'],_0x4b76ac[_0x0970('0x16')]);this[_0x0970('0x19')]=getSeconds(_0x4b76ac[_0x0970('0x18')],_0x4b76ac[_0x0970('0x17')]);this['talktime']=getSeconds(this[_0x0970('0x1a')],_0x4b76ac[_0x0970('0x18')]);this[_0x0970('0xa')]=_0x44a28f[_0x0970('0xa')];this[_0x0970('0x1b')]=_0x44a28f['membername'];this['reason']=_0x44a28f[_0x0970('0x1c')];this['callback']=_0x4b76ac[_0x0970('0x1d')];this['callbackuniqueid']=_0x4b76ac[_0x0970('0x1e')];this['callbackat']=_0x4b76ac['callbackat'];this[_0x0970('0x1f')]=_0x4b76ac['recallme'];this[_0x0970('0x20')]=_0x4b76ac['ContactId'];this[_0x0970('0x21')]=_0x4b76ac['ListId'];this[_0x0970('0x22')]=_0x4b76ac[_0x0970('0x22')];this[_0x0970('0x23')]=_0x4b76ac[_0x0970('0x23')];this[_0x0970('0x24')]=_0x4b76ac[_0x0970('0x24')];this[_0x0970('0x25')]=_0x4b76ac['originatecalleridnum']||'';this[_0x0970('0x26')]=_0x4b76ac['originatecalleridname']||'';}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 d8841bc..4c29bc9 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 _0x8a28=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x4269d3,_0x3c88c2){var _0x3b4d6e=function(_0x50decb){while(--_0x50decb){_0x4269d3['push'](_0x4269d3['shift']());}};_0x3b4d6e(++_0x3c88c2);}(_0x8a28,0xfd));var _0x88a2=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8a28[_0x55f8b4];return _0x2475f9;};'use strict';var util=require(_0x88a2('0x0'));var _=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));function getSeconds(_0x3c2c72,_0x27b1c1){var _0x29e6d8=moment(_0x3c2c72)[_0x88a2('0x3')](0x0);var _0x3fc89d=moment(_0x27b1c1)['milliseconds'](0x0);return _0x29e6d8[_0x88a2('0x4')](_0x3fc89d,_0x88a2('0x5'));}function Final(_0x3c3392){this[_0x88a2('0x6')]=_0x3c3392[_0x88a2('0x6')];this['scheduledat']=_0x3c3392[_0x88a2('0x7')];this['type']=_0x3c3392[_0x88a2('0x8')];this[_0x88a2('0x9')]=_0x3c3392[_0x88a2('0x8')]===_0x88a2('0xa')?_0x88a2('0xb'):_0x3c3392[_0x88a2('0x8')];this[_0x88a2('0xc')]=_0x3c3392[_0x88a2('0xc')];this[_0x88a2('0xd')]=_0x3c3392['countcongestionretry'];this['countnoanswerretry']=_0x3c3392[_0x88a2('0xe')];this[_0x88a2('0xf')]=_0x3c3392[_0x88a2('0xc')]+_0x3c3392[_0x88a2('0xd')]+_0x3c3392[_0x88a2('0xe')]+_0x3c3392['countnosuchnumberretry']+_0x3c3392[_0x88a2('0x10')]+_0x3c3392[_0x88a2('0x11')]+_0x3c3392[_0x88a2('0x12')]+_0x3c3392[_0x88a2('0x13')];this['countnosuchnumberretry']=_0x3c3392[_0x88a2('0x14')];this[_0x88a2('0x10')]=_0x3c3392[_0x88a2('0x10')];this['countabandonedretry']=_0x3c3392[_0x88a2('0x11')];this[_0x88a2('0x12')]=_0x3c3392[_0x88a2('0x12')];this[_0x88a2('0x13')]=_0x3c3392[_0x88a2('0x13')];this[_0x88a2('0xb')]=_0x3c3392[_0x88a2('0xb')];this[_0x88a2('0x15')]=_0x3c3392[_0x88a2('0x15')];this[_0x88a2('0x16')]=_0x3c3392[_0x88a2('0x16')];this[_0x88a2('0x17')]=_0x3c3392[_0x88a2('0x17')];this[_0x88a2('0x18')]=_0x3c3392[_0x88a2('0x18')];this[_0x88a2('0x19')]=_0x3c3392[_0x88a2('0x18')];this[_0x88a2('0x1a')]=_0x3c3392['ringtime']||0x0;this[_0x88a2('0x1b')]=_0x3c3392[_0x88a2('0x1b')]||0x0;this['talktime']=_0x3c3392['talktime']||0x0;this[_0x88a2('0x1c')]=_0x3c3392[_0x88a2('0x1c')];this[_0x88a2('0x1d')]=_0x3c3392[_0x88a2('0x1d')];this[_0x88a2('0x1e')]=_0x3c3392['callbackat'];this[_0x88a2('0x1f')]=_0x3c3392[_0x88a2('0x1f')];this[_0x88a2('0x20')]=_0x3c3392[_0x88a2('0x20')];this['ListId']=_0x3c3392[_0x88a2('0x21')];this['UserId']=_0x3c3392['UserId'];this[_0x88a2('0x22')]=_0x3c3392[_0x88a2('0x22')];this['CampaignId']=_0x3c3392['CampaignId'];this[_0x88a2('0x23')]=_0x3c3392[_0x88a2('0x23')]||'';this['originatecalleridname']=_0x3c3392[_0x88a2('0x24')]||'';}module[_0x88a2('0x25')]=Final; \ No newline at end of file +var _0x2eb2=['type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','uniqueid','scheduledat'];(function(_0x5d4eb6,_0x13c132){var _0x14b249=function(_0x566ce5){while(--_0x566ce5){_0x5d4eb6['push'](_0x5d4eb6['shift']());}};_0x14b249(++_0x13c132);}(_0x2eb2,0x19f));var _0x22eb=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x2eb2[_0x433a86];return _0x23000c;};'use strict';var util=require('util');var _=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));function getSeconds(_0x2ac73a,_0x1a002b){var _0x1dd079=moment(_0x2ac73a)[_0x22eb('0x2')](0x0);var _0x545a45=moment(_0x1a002b)[_0x22eb('0x2')](0x0);return _0x1dd079['diff'](_0x545a45,'seconds');}function Final(_0x1dfef7){this[_0x22eb('0x3')]=_0x1dfef7[_0x22eb('0x3')];this[_0x22eb('0x4')]=_0x1dfef7[_0x22eb('0x4')];this[_0x22eb('0x5')]=_0x1dfef7[_0x22eb('0x5')];this[_0x22eb('0x6')]=_0x1dfef7[_0x22eb('0x5')]===_0x22eb('0x7')?_0x22eb('0x8'):_0x1dfef7[_0x22eb('0x5')];this['countbusyretry']=_0x1dfef7[_0x22eb('0x9')];this['countcongestionretry']=_0x1dfef7['countcongestionretry'];this[_0x22eb('0xa')]=_0x1dfef7['countnoanswerretry'];this[_0x22eb('0xb')]=_0x1dfef7[_0x22eb('0x9')]+_0x1dfef7['countcongestionretry']+_0x1dfef7['countnoanswerretry']+_0x1dfef7[_0x22eb('0xc')]+_0x1dfef7[_0x22eb('0xd')]+_0x1dfef7[_0x22eb('0xe')]+_0x1dfef7[_0x22eb('0xf')]+_0x1dfef7[_0x22eb('0x10')];this['countnosuchnumberretry']=_0x1dfef7[_0x22eb('0xc')];this['countdropretry']=_0x1dfef7[_0x22eb('0xd')];this['countabandonedretry']=_0x1dfef7[_0x22eb('0xe')];this[_0x22eb('0xf')]=_0x1dfef7['countmachineretry'];this['countagentrejectretry']=_0x1dfef7['countagentrejectretry'];this[_0x22eb('0x8')]=_0x1dfef7['queue'];this['calleridname']=_0x1dfef7[_0x22eb('0x11')];this['calleridnum']=_0x1dfef7['calleridnum'];this[_0x22eb('0x12')]=_0x1dfef7[_0x22eb('0x12')];this[_0x22eb('0x13')]=_0x1dfef7[_0x22eb('0x13')];this[_0x22eb('0x14')]=_0x1dfef7['responsetime'];this[_0x22eb('0x15')]=_0x1dfef7[_0x22eb('0x15')]||0x0;this[_0x22eb('0x16')]=_0x1dfef7[_0x22eb('0x16')]||0x0;this[_0x22eb('0x17')]=_0x1dfef7['talktime']||0x0;this[_0x22eb('0x18')]=_0x1dfef7[_0x22eb('0x18')];this[_0x22eb('0x19')]=_0x1dfef7['callbackuniqueid'];this['callbackat']=_0x1dfef7[_0x22eb('0x1a')];this[_0x22eb('0x1b')]=_0x1dfef7[_0x22eb('0x1b')];this[_0x22eb('0x1c')]=_0x1dfef7[_0x22eb('0x1c')];this[_0x22eb('0x1d')]=_0x1dfef7[_0x22eb('0x1d')];this['UserId']=_0x1dfef7[_0x22eb('0x1e')];this[_0x22eb('0x1f')]=_0x1dfef7[_0x22eb('0x1f')];this[_0x22eb('0x20')]=_0x1dfef7[_0x22eb('0x20')];this['originatecalleridnum']=_0x1dfef7[_0x22eb('0x21')]||'';this[_0x22eb('0x22')]=_0x1dfef7[_0x22eb('0x22')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 31e5704..60225c4 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 _0x2c9e=['holdtime','talktime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime'];(function(_0x17397c,_0x2e2208){var _0x58aa5f=function(_0xf2c324){while(--_0xf2c324){_0x17397c['push'](_0x17397c['shift']());}};_0x58aa5f(++_0x2e2208);}(_0x2c9e,0x95));var _0xe2c9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2c9e[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xe2c9('0x0'));var _=require(_0xe2c9('0x1'));var moment=require(_0xe2c9('0x2'));function getSeconds(_0xf3474,_0xdc75d6){var _0x397bb0=moment(_0xf3474)[_0xe2c9('0x3')](0x0);var _0x58b292=moment(_0xdc75d6)[_0xe2c9('0x3')](0x0);return _0x397bb0[_0xe2c9('0x4')](_0x58b292,_0xe2c9('0x5'));}function Hangup(_0x1e8002,_0x2583bd){this[_0xe2c9('0x6')]=0x4;this[_0xe2c9('0x7')]=_0xe2c9('0x8');this[_0xe2c9('0x9')]=_0x1e8002[_0xe2c9('0x9')];this[_0xe2c9('0xa')]=_0x1e8002[_0xe2c9('0xa')];this[_0xe2c9('0xb')]=_0x1e8002[_0xe2c9('0xa')]==='outbound'?_0xe2c9('0xc'):_0x1e8002['type'];this[_0xe2c9('0xd')]=_0x1e8002[_0xe2c9('0xd')];this[_0xe2c9('0xe')]=_0x1e8002[_0xe2c9('0xe')];this[_0xe2c9('0xf')]=_0x1e8002[_0xe2c9('0xf')];this[_0xe2c9('0x10')]=_0x1e8002[_0xe2c9('0xd')]+_0x1e8002['countcongestionretry']+_0x1e8002[_0xe2c9('0xf')]+_0x1e8002[_0xe2c9('0x11')]+_0x1e8002[_0xe2c9('0x12')]+_0x1e8002['countabandonedretry']+_0x1e8002[_0xe2c9('0x13')]+_0x1e8002['countagentrejectretry'];this[_0xe2c9('0x11')]=_0x1e8002[_0xe2c9('0x11')];this[_0xe2c9('0x12')]=_0x1e8002[_0xe2c9('0x12')];this[_0xe2c9('0x14')]=_0x1e8002[_0xe2c9('0x14')];this[_0xe2c9('0x13')]=_0x1e8002[_0xe2c9('0x13')];this[_0xe2c9('0x15')]=_0x1e8002[_0xe2c9('0x15')];this['uniqueid']=_0x2583bd[_0xe2c9('0x16')];this[_0xe2c9('0x17')]=_0x1e8002[_0xe2c9('0x18')];this[_0xe2c9('0x19')]=_0x1e8002[_0xe2c9('0x1a')];this[_0xe2c9('0x1b')]=_0x1e8002['starttime'];this[_0xe2c9('0x1c')]=_0x1e8002[_0xe2c9('0x1c')];this[_0xe2c9('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xe2c9('0x1e')]=getSeconds(_0x1e8002[_0xe2c9('0x1c')],_0x1e8002[_0xe2c9('0x1b')]);this[_0xe2c9('0x1f')]=0x0;this[_0xe2c9('0x20')]=getSeconds(this[_0xe2c9('0x1d')],_0x1e8002['responsetime']);this[_0xe2c9('0xc')]=_0x1e8002['queue'];this[_0xe2c9('0x21')]='IVR';this['reason']=_0x2583bd[_0xe2c9('0x22')];this[_0xe2c9('0x23')]=_0x1e8002[_0xe2c9('0x23')];this[_0xe2c9('0x24')]=_0x1e8002[_0xe2c9('0x24')];this[_0xe2c9('0x25')]=_0x1e8002[_0xe2c9('0x25')];this[_0xe2c9('0x26')]=_0x1e8002[_0xe2c9('0x26')];this[_0xe2c9('0x27')]=_0x1e8002[_0xe2c9('0x27')];this[_0xe2c9('0x28')]=_0x1e8002[_0xe2c9('0x28')];this[_0xe2c9('0x29')]=_0x1e8002[_0xe2c9('0x29')];this['VoiceQueueId']=_0x1e8002[_0xe2c9('0x2a')];this[_0xe2c9('0x2b')]=_0x1e8002['CampaignId'];}module[_0xe2c9('0x2c')]=Hangup; \ No newline at end of file +var _0xb99d=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','queue','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry'];(function(_0x49efba,_0x575a10){var _0x5dceff=function(_0xaf2edb){while(--_0xaf2edb){_0x49efba['push'](_0x49efba['shift']());}};_0x5dceff(++_0x575a10);}(_0xb99d,0xd3));var _0xdb99=function(_0x39a73d,_0x4ab2ec){_0x39a73d=_0x39a73d-0x0;var _0x2946d3=_0xb99d[_0x39a73d];return _0x2946d3;};'use strict';var util=require(_0xdb99('0x0'));var _=require(_0xdb99('0x1'));var moment=require('moment');function getSeconds(_0x1b2482,_0x546048){var _0xf66d85=moment(_0x1b2482)[_0xdb99('0x2')](0x0);var _0x307273=moment(_0x546048)[_0xdb99('0x2')](0x0);return _0xf66d85[_0xdb99('0x3')](_0x307273,_0xdb99('0x4'));}function Hangup(_0x21e657,_0x531971){this[_0xdb99('0x5')]=0x4;this[_0xdb99('0x6')]=_0xdb99('0x7');this[_0xdb99('0x8')]=_0x21e657[_0xdb99('0x8')];this[_0xdb99('0x9')]=_0x21e657[_0xdb99('0x9')];this[_0xdb99('0xa')]=_0x21e657['type']===_0xdb99('0xb')?'queue':_0x21e657[_0xdb99('0x9')];this[_0xdb99('0xc')]=_0x21e657[_0xdb99('0xc')];this[_0xdb99('0xd')]=_0x21e657['countcongestionretry'];this[_0xdb99('0xe')]=_0x21e657[_0xdb99('0xe')];this[_0xdb99('0xf')]=_0x21e657[_0xdb99('0xc')]+_0x21e657[_0xdb99('0xd')]+_0x21e657[_0xdb99('0xe')]+_0x21e657[_0xdb99('0x10')]+_0x21e657[_0xdb99('0x11')]+_0x21e657[_0xdb99('0x12')]+_0x21e657[_0xdb99('0x13')]+_0x21e657[_0xdb99('0x14')];this['countnosuchnumberretry']=_0x21e657[_0xdb99('0x10')];this[_0xdb99('0x11')]=_0x21e657[_0xdb99('0x11')];this['countabandonedretry']=_0x21e657[_0xdb99('0x12')];this[_0xdb99('0x13')]=_0x21e657[_0xdb99('0x13')];this[_0xdb99('0x14')]=_0x21e657[_0xdb99('0x14')];this[_0xdb99('0x15')]=_0x531971['uniqueid'];this[_0xdb99('0x16')]=_0x21e657[_0xdb99('0x17')];this[_0xdb99('0x18')]=_0x21e657[_0xdb99('0x19')];this[_0xdb99('0x1a')]=_0x21e657[_0xdb99('0x1a')];this['responsetime']=_0x21e657[_0xdb99('0x1b')];this[_0xdb99('0x1c')]=moment()[_0xdb99('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdb99('0x1e')]=getSeconds(_0x21e657[_0xdb99('0x1b')],_0x21e657[_0xdb99('0x1a')]);this[_0xdb99('0x1f')]=0x0;this[_0xdb99('0x20')]=getSeconds(this[_0xdb99('0x1c')],_0x21e657['responsetime']);this['queue']=_0x21e657[_0xdb99('0x21')];this['membername']=_0xdb99('0x22');this[_0xdb99('0x23')]=_0x531971['cause-txt'];this['callback']=_0x21e657[_0xdb99('0x24')];this[_0xdb99('0x25')]=_0x21e657[_0xdb99('0x25')];this['callbackat']=_0x21e657[_0xdb99('0x26')];this[_0xdb99('0x27')]=_0x21e657['recallme'];this[_0xdb99('0x28')]=_0x21e657[_0xdb99('0x28')];this[_0xdb99('0x29')]=_0x21e657[_0xdb99('0x29')];this[_0xdb99('0x2a')]=_0x21e657[_0xdb99('0x2a')];this[_0xdb99('0x2b')]=_0x21e657[_0xdb99('0x2b')];this[_0xdb99('0x2c')]=_0x21e657[_0xdb99('0x2c')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index ebb7134..598c753 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 _0x2592=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','milliseconds','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0x3ccfaa,_0x5e7818){var _0x5cd116=function(_0x57d310){while(--_0x57d310){_0x3ccfaa['push'](_0x3ccfaa['shift']());}};_0x5cd116(++_0x5e7818);}(_0x2592,0x119));var _0x2259=function(_0x4d560a,_0x48d9dd){_0x4d560a=_0x4d560a-0x0;var _0x368b51=_0x2592[_0x4d560a];return _0x368b51;};'use strict';var util=require(_0x2259('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x10dbdc,_0x2cb522){var _0x965491=moment(_0x10dbdc)[_0x2259('0x1')](0x0);var _0x946f85=moment(_0x2cb522)[_0x2259('0x1')](0x0);return _0x965491['diff'](_0x946f85,_0x2259('0x2'));}function History(_0x58b2dd){this[_0x2259('0x3')]=_0x58b2dd[_0x2259('0x3')];this[_0x2259('0x4')]=_0x58b2dd[_0x2259('0x4')]||undefined;this[_0x2259('0x5')]=_0x58b2dd[_0x2259('0x5')];this['campaigntype']=_0x58b2dd[_0x2259('0x5')]===_0x2259('0x6')?_0x2259('0x7'):_0x58b2dd[_0x2259('0x5')];this[_0x2259('0x8')]=_0x58b2dd[_0x2259('0x8')];this[_0x2259('0x9')]=_0x58b2dd[_0x2259('0x9')];this[_0x2259('0xa')]=_0x58b2dd[_0x2259('0xa')];this['countglobal']=_0x58b2dd['countbusyretry']+_0x58b2dd[_0x2259('0x9')]+_0x58b2dd[_0x2259('0xa')]+_0x58b2dd[_0x2259('0xb')]+_0x58b2dd['countdropretry']+_0x58b2dd[_0x2259('0xc')]+_0x58b2dd['countmachineretry']+_0x58b2dd[_0x2259('0xd')];this['countnosuchnumberretry']=_0x58b2dd[_0x2259('0xb')];this[_0x2259('0xe')]=_0x58b2dd[_0x2259('0xe')];this[_0x2259('0xc')]=_0x58b2dd[_0x2259('0xc')];this[_0x2259('0xf')]=_0x58b2dd[_0x2259('0xf')];this[_0x2259('0xd')]=_0x58b2dd['countagentrejectretry'];this['queue']=_0x58b2dd['queue'];this['calleridname']=_0x58b2dd[_0x2259('0x10')];this['calleridnum']=_0x58b2dd[_0x2259('0x11')];this[_0x2259('0x12')]=_0x58b2dd[_0x2259('0x12')];this[_0x2259('0x13')]=_0x58b2dd['responsetime'];this[_0x2259('0x14')]=_0x58b2dd[_0x2259('0x13')];this[_0x2259('0x15')]=getSeconds(_0x58b2dd[_0x2259('0x13')],_0x58b2dd['starttime']);this[_0x2259('0x16')]=0x0;this[_0x2259('0x17')]=0x0;this[_0x2259('0x18')]=_0x58b2dd[_0x2259('0x18')];this[_0x2259('0x19')]=_0x58b2dd[_0x2259('0x19')];this[_0x2259('0x1a')]=_0x58b2dd[_0x2259('0x1a')];this[_0x2259('0x1b')]=_0x58b2dd[_0x2259('0x1b')];this[_0x2259('0x1c')]=_0x58b2dd[_0x2259('0x1c')];this['ListId']=_0x58b2dd[_0x2259('0x1d')];this[_0x2259('0x1e')]=_0x58b2dd[_0x2259('0x1e')];this[_0x2259('0x1f')]=_0x58b2dd['VoiceQueueId'];this['CampaignId']=_0x58b2dd[_0x2259('0x20')];this['originatecalleridnum']=_0x58b2dd['originatecalleridnum']||'';this['originatecalleridname']=_0x58b2dd[_0x2259('0x21')]||'';}module['exports']=History; \ No newline at end of file +var _0x732f=['recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackat'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x732f,0x9b));var _0xf732=function(_0x51672a,_0x3b1a3d){_0x51672a=_0x51672a-0x0;var _0x3ee24a=_0x732f[_0x51672a];return _0x3ee24a;};'use strict';var util=require(_0xf732('0x0'));var _=require(_0xf732('0x1'));var moment=require(_0xf732('0x2'));function getSeconds(_0x28763a,_0x4a818b){var _0x176543=moment(_0x28763a)[_0xf732('0x3')](0x0);var _0x3f668b=moment(_0x4a818b)[_0xf732('0x3')](0x0);return _0x176543[_0xf732('0x4')](_0x3f668b,_0xf732('0x5'));}function History(_0x548266){this[_0xf732('0x6')]=_0x548266[_0xf732('0x6')];this[_0xf732('0x7')]=_0x548266[_0xf732('0x7')]||undefined;this[_0xf732('0x8')]=_0x548266[_0xf732('0x8')];this[_0xf732('0x9')]=_0x548266['type']===_0xf732('0xa')?_0xf732('0xb'):_0x548266[_0xf732('0x8')];this['countbusyretry']=_0x548266[_0xf732('0xc')];this[_0xf732('0xd')]=_0x548266[_0xf732('0xd')];this[_0xf732('0xe')]=_0x548266[_0xf732('0xe')];this[_0xf732('0xf')]=_0x548266[_0xf732('0xc')]+_0x548266[_0xf732('0xd')]+_0x548266[_0xf732('0xe')]+_0x548266[_0xf732('0x10')]+_0x548266['countdropretry']+_0x548266[_0xf732('0x11')]+_0x548266[_0xf732('0x12')]+_0x548266[_0xf732('0x13')];this[_0xf732('0x10')]=_0x548266[_0xf732('0x10')];this[_0xf732('0x14')]=_0x548266[_0xf732('0x14')];this[_0xf732('0x11')]=_0x548266[_0xf732('0x11')];this[_0xf732('0x12')]=_0x548266[_0xf732('0x12')];this[_0xf732('0x13')]=_0x548266[_0xf732('0x13')];this[_0xf732('0xb')]=_0x548266[_0xf732('0xb')];this['calleridname']=_0x548266[_0xf732('0x15')];this['calleridnum']=_0x548266[_0xf732('0x16')];this[_0xf732('0x17')]=_0x548266[_0xf732('0x17')];this[_0xf732('0x18')]=_0x548266[_0xf732('0x18')];this[_0xf732('0x19')]=_0x548266[_0xf732('0x18')];this['ringtime']=getSeconds(_0x548266['responsetime'],_0x548266[_0xf732('0x17')]);this[_0xf732('0x1a')]=0x0;this[_0xf732('0x1b')]=0x0;this[_0xf732('0x1c')]=_0x548266[_0xf732('0x1c')];this['callbackuniqueid']=_0x548266['callbackuniqueid'];this[_0xf732('0x1d')]=_0x548266[_0xf732('0x1d')];this['recallme']=_0x548266[_0xf732('0x1e')];this[_0xf732('0x1f')]=_0x548266[_0xf732('0x1f')];this['ListId']=_0x548266[_0xf732('0x20')];this['UserId']=_0x548266['UserId'];this[_0xf732('0x21')]=_0x548266[_0xf732('0x21')];this[_0xf732('0x22')]=_0x548266[_0xf732('0x22')];this['originatecalleridnum']=_0x548266[_0xf732('0x23')]||'';this[_0xf732('0x24')]=_0x548266[_0xf732('0x24')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b14bb04..fe944c6 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 _0xd6f9=['XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialPrefix','dialCutDigit','trim','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','nosuchnumber','dialNoSuchNumberMaxRetry','createStateFinal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','agentBusyFactor','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','Contact.phone','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','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','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','md5','ioredis','../../../config/environment/','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','startPredictive','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','available','pTalking','sumHoldTime','total','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','dialAMDActive','HANGUP','state','HangupInAMD','membername','custom:amd','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','AMD','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','value','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countnosuchnumberretry','countdropretry','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','agiafterat','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','[syncAgentComplete][createHistory][11]','syncNewExten','syncQueueMember','actionid','roundrobin','paused','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','launchHandleIvr','handleIvr','dialActive','loggedIn','dialGlobalInterval','dialTimezone','[syncCampaigns]','pow','random','match','actionOriginate','object','originate','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS'];(function(_0x27484b,_0x3ba07b){var _0x176b94=function(_0x459b5c){while(--_0x459b5c){_0x27484b['push'](_0x27484b['shift']());}};_0x176b94(++_0x3ba07b);}(_0xd6f9,0x99));var _0x9d6f=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xd6f9[_0x5783f4];return _0x28e380;};'use strict';var util=require(_0x9d6f('0x0'));var _=require('lodash');var BPromise=require(_0x9d6f('0x1'));var uuid=require(_0x9d6f('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x9d6f('0x3'));var Redis=require(_0x9d6f('0x4'));var ut=require('../preview/util/util');var config=require(_0x9d6f('0x5'));var logger=require('../../../config/logger')(_0x9d6f('0x6'));var loggerBooked=require('../../../config/logger')(_0x9d6f('0x7'));var loggerPredictive=require(_0x9d6f('0x8'))(_0x9d6f('0x9'));var loggerPredictiveCalls=require(_0x9d6f('0x8'))(_0x9d6f('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x9d6f('0xb'));var ami=require(_0x9d6f('0xc'));config[_0x9d6f('0xd')]=_[_0x9d6f('0xe')](config[_0x9d6f('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x9d6f('0xf'))(new Redis(config['redis']));var cmHopper=require(_0x9d6f('0x10'));var cmHopperHistory=require(_0x9d6f('0x11'));var cmHopperBlack=require(_0x9d6f('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x9d6f('0x13'));var History=require(_0x9d6f('0x14'));var Final=require(_0x9d6f('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x9d6f('0x16'));var ipAgi=process[_0x9d6f('0x17')][_0x9d6f('0x18')]||_0x9d6f('0x19');var strategy={'rrmemory':_0x9d6f('0x1a'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x9d6f('0x1b')][_0x9d6f('0x1c')]=function(_0x47b3a5){this[_0x9d6f('0x1d')]=this[_0x9d6f('0x1d')]?this['tail'][_0x9d6f('0x1e')](_0x47b3a5):_0x47b3a5();};function Dialer(_0x185ded,_0x5d47fe){this[_0x9d6f('0x1f')]=new Sequence();this['preview']=_0x5d47fe;this[_0x9d6f('0x20')]=_0x185ded['voiceQueues'];this[_0x9d6f('0x21')]=_0x185ded['campaigns'];this['agents']=_0x185ded[_0x9d6f('0x22')];this[_0x9d6f('0x23')]=_0x185ded[_0x9d6f('0x23')];this[_0x9d6f('0x24')]=config[_0x9d6f('0x24')]||0x2;this[_0x9d6f('0x25')]={};this[_0x9d6f('0x26')]={};this['contactsId']={};this[_0x9d6f('0x27')]={};this['optionPredictive']={};this[_0x9d6f('0x28')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x9d6f('0x29')]={};this[_0x9d6f('0x2a')]={};ami['on'](_0x9d6f('0x2b'),this['syncAgentConnect'][_0x9d6f('0x2c')](this));ami['on'](_0x9d6f('0x2d'),this[_0x9d6f('0x2e')][_0x9d6f('0x2c')](this));ami['on'](_0x9d6f('0x2f'),this[_0x9d6f('0x30')][_0x9d6f('0x2c')](this));ami['on'](_0x9d6f('0x31'),this[_0x9d6f('0x32')][_0x9d6f('0x2c')](this));ami['on']('custom:queuesummary',this[_0x9d6f('0xb')][_0x9d6f('0x2c')](this));ami['on'](_0x9d6f('0x33'),this[_0x9d6f('0x34')][_0x9d6f('0x2c')](this));ami['on'](_0x9d6f('0x35'),this['syncNewExten'][_0x9d6f('0x2c')](this));ami['on'](_0x9d6f('0x36'),this[_0x9d6f('0x37')]['bind'](this));ami['on'](_0x9d6f('0x38'),this['syncQueueMember'][_0x9d6f('0x2c')](this));ami['on'](_0x9d6f('0x39'),this[_0x9d6f('0x3a')][_0x9d6f('0x2c')](this));this[_0x9d6f('0x3b')]();this[_0x9d6f('0x3c')]();}function isNotNull(_0x4c63d3){return _0x4c63d3!==null&&!_[_0x9d6f('0x3d')](_0x4c63d3);}function checkIsLoggedIn(_0x14dfed,_0x168af0){return function(){if(_0x168af0<=0x0){_0x14dfed[_0x9d6f('0x3e')]=_0x9d6f('0x3f');throw _0x14dfed[_0x9d6f('0x40')]+_0x9d6f('0x41');}};}function isActive(_0x5e5351){return _0x5e5351;}function checkIsActive(_0x23f140,_0x462d55){return function(){if(!isActive(_0x462d55)){_0x23f140[_0x9d6f('0x3e')]=_0x9d6f('0x42');throw _0x23f140[_0x9d6f('0x40')]+_0x9d6f('0x43');}};}function checkInterval(_0x116e82){return function(){if(!isNotNull(_0x116e82['Interval'])){_0x116e82['message']=_0x9d6f('0x44');throw _0x116e82[_0x9d6f('0x40')]+_0x9d6f('0x45');}if(!isNotNull(_0x116e82[_0x9d6f('0x46')]['Intervals'])){_0x116e82[_0x9d6f('0x3e')]=_0x9d6f('0x44');throw _0x116e82[_0x9d6f('0x40')]+_0x9d6f('0x45');}if(!isNotNull(_[_0x9d6f('0x47')](_0x116e82[_0x9d6f('0x46')][_0x9d6f('0x48')]))){_0x116e82[_0x9d6f('0x3e')]=_0x9d6f('0x44');throw _0x116e82[_0x9d6f('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x16ec76,_0x2bb6e8,_0x452702){return{'action':_0x16ec76,'response':_0x2bb6e8,'message':_0x452702,'stack':_0x452702};}function myreject(_0x41194a){return function(_0x280523){return _0x41194a(msgResponse('[ifTime][Action]',_0x9d6f('0x49'),JSON[_0x9d6f('0x4a')](_0x280523)));};}function getSeconds(_0x47d539,_0x121942){var _0x26c2f9=moment(_0x47d539)[_0x9d6f('0x4b')](0x0);var _0x23988a=moment(_0x121942)['milliseconds'](0x0);return _0x26c2f9[_0x9d6f('0x4c')](_0x23988a,_0x9d6f('0x4d'));}function emit(_0x3f86b9,_0x2ec308,_0x3565b4){io['to'](_0x3f86b9)[_0x9d6f('0x4e')](_0x2ec308,_0x3565b4);}function emitVoiceQueueSummary(_0x1df79a){if(_0x1df79a[_0x9d6f('0x4f')]==='outbound'){var _0x4738df={'id':_0x1df79a['id'],'name':_0x1df79a[_0x9d6f('0x40')],'strategy':_0x1df79a[_0x9d6f('0x50')],'answered':_0x1df79a[_0x9d6f('0x51')],'available':_0x1df79a[_0x9d6f('0x52')],'loggedIn':_0x1df79a['loggedIn'],'pTalking':_0x1df79a[_0x9d6f('0x53')],'sumBillable':_0x1df79a['sumBillable'],'sumDuration':_0x1df79a['sumDuration'],'sumHoldTime':_0x1df79a[_0x9d6f('0x54')]||0x0,'talking':_0x1df79a['talking'],'total':_0x1df79a[_0x9d6f('0x55')],'type':_0x1df79a[_0x9d6f('0x4f')],'unmanaged':_0x1df79a['unmanaged'],'abandoned':_0x1df79a['abandoned'],'waiting':_0x1df79a[_0x9d6f('0x56')],'loggedInDb':_0x1df79a[_0x9d6f('0x57')],'dialActive':_0x1df79a['dialActive'],'dialMethod':_0x1df79a['dialMethod'],'dialOriginateCallerIdName':_0x1df79a[_0x9d6f('0x58')],'dialOriginateCallerIdNumber':_0x1df79a[_0x9d6f('0x59')],'dialOriginateTimeout':_0x1df79a[_0x9d6f('0x5a')],'dialPrefix':_0x1df79a['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1df79a[_0x9d6f('0x5b')],'outboundAnswerCallsDay':_0x1df79a[_0x9d6f('0x5c')],'outboundBlacklistCallsDay':_0x1df79a['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1df79a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1df79a[_0x9d6f('0x5d')],'outboundDropCallsDayACS':_0x1df79a['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1df79a['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1df79a[_0x9d6f('0x5e')],'outboundNoAnswerCallsDay':_0x1df79a['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1df79a[_0x9d6f('0x5f')],'outboundOriginateFailureCallsDay':_0x1df79a[_0x9d6f('0x60')],'outboundReCallsDay':_0x1df79a[_0x9d6f('0x61')],'outboundRejectCallsDay':_0x1df79a['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1df79a[_0x9d6f('0x62')],'predictiveIntervalAnsweredCalls':_0x1df79a[_0x9d6f('0x63')],'predictiveIntervalAvgHoldtime':_0x1df79a[_0x9d6f('0x64')],'predictiveIntervalAvgTalktime':_0x1df79a[_0x9d6f('0x65')],'predictiveIntervalDroppedCallsCallersExit':_0x1df79a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1df79a[_0x9d6f('0x66')],'predictiveIntervalErlangCalls':_0x1df79a[_0x9d6f('0x67')],'predictiveIntervalErlangCallsDroppedCalls':_0x1df79a[_0x9d6f('0x68')],'predictiveIntervalHitRate':_0x1df79a[_0x9d6f('0x69')],'predictiveIntervalMultiplicativeFactor':_0x1df79a[_0x9d6f('0x6a')],'predictiveIntervalPauses':_0x1df79a[_0x9d6f('0x6b')],'predictiveIntervalAvailable':_0x1df79a[_0x9d6f('0x6c')],'predictiveIntervalTotalCalls':_0x1df79a[_0x9d6f('0x6d')],'message':_0x1df79a[_0x9d6f('0x3e')],'originated':_0x1df79a[_0x9d6f('0x6e')],'erlangCalls':_0x1df79a[_0x9d6f('0x6f')],'erlangCallToSecond':_0x1df79a[_0x9d6f('0x70')],'erlangAbandonmentRate':_0x1df79a[_0x9d6f('0x71')],'erlangBusyFactor':_0x1df79a[_0x9d6f('0x72')],'startPredictive':_0x1df79a[_0x9d6f('0x28')],'startProgressive':_0x1df79a[_0x9d6f('0x73')]};if(_0x1df79a[_0x9d6f('0x74')]){_0x4738df[_0x9d6f('0x74')]={'id':_0x1df79a[_0x9d6f('0x74')]['id'],'name':_0x1df79a[_0x9d6f('0x74')][_0x9d6f('0x40')],'active':_0x1df79a[_0x9d6f('0x74')]['active'],'callerid':_0x1df79a[_0x9d6f('0x74')]['callerid']};}if(_0x1df79a[_0x9d6f('0x46')]){_0x4738df[_0x9d6f('0x46')]={'id':_0x1df79a[_0x9d6f('0x46')]['id'],'name':_0x1df79a['Interval'][_0x9d6f('0x40')]};}var _0x36b245=md5(JSON[_0x9d6f('0x4a')](_0x4738df));if(_0x1df79a[_0x9d6f('0x3')]!==_0x36b245){_0x1df79a[_0x9d6f('0x3')]=_0x36b245;emit(util[_0x9d6f('0x75')](_0x9d6f('0x76'),_0x4738df[_0x9d6f('0x40')]),_0x9d6f('0x77'),_0x4738df);}}}function emitCampaignSummary(_0x5d744a){if(_0x5d744a[_0x9d6f('0x4f')]===_0x9d6f('0x78')){emit(util[_0x9d6f('0x75')](_0x9d6f('0x79'),_0x5d744a[_0x9d6f('0x40')]),_0x9d6f('0x7a'),_0x5d744a);}}function checkGetDataPredictive(_0x5f44ab){if(isNotNull(_0x5f44ab)&&!_[_0x9d6f('0x47')](_0x5f44ab)){loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x7c'));loggerPredictive[_0x9d6f('0x7b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f44ab[_0x9d6f('0x6d')]);loggerPredictive[_0x9d6f('0x7b')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f44ab['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x7d'),_0x5f44ab[_0x9d6f('0x66')]);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x7e'),_0x5f44ab[_0x9d6f('0x7f')]);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x80'),_0x5f44ab[_0x9d6f('0x64')]);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x81'),_0x5f44ab[_0x9d6f('0x65')]);loggerPredictive[_0x9d6f('0x7b')]('---------------------------');if(_0x5f44ab['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x5f44ab['predictiveIntervalAvgTalktime'])&&_0x5f44ab['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x82'));if(!_[_0x9d6f('0x3d')](_0x5f44ab[_0x9d6f('0x64')])&&_0x5f44ab['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x83'));}else{loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x84'));}}else{loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x85'));}return![];}function mergeDataErlangB(_0x329d45){return function(_0x246c8b){loggerPredictive[_0x9d6f('0x7b')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x86'),_0x246c8b[_0x9d6f('0x6f')]);loggerPredictive[_0x9d6f('0x7b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x246c8b[_0x9d6f('0x70')]);loggerPredictive['info'](_0x9d6f('0x87'),_0x246c8b['erlangAbandonmentRate']);loggerPredictive[_0x9d6f('0x7b')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x246c8b[_0x9d6f('0x72')]);loggerPredictive[_0x9d6f('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x246c8b[_0x9d6f('0x71')]);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x88'));_[_0x9d6f('0x89')](_0x329d45,_0x246c8b);};}function getDiff(_0x47fc04){var _0x145691=moment()[_0x9d6f('0x4b')](0x0);var _0xeb4f0c=moment(_0x47fc04)[_0x9d6f('0x4b')](0x0);return _0x145691['diff'](_0xeb4f0c,_0x9d6f('0x4d'));}function ifInterval(_0x3e1774,_0x43d606){if(_[_0x9d6f('0x3d')](_0x43d606)){return![];}return getDiff(_0x43d606)<_0x3e1774*0x3c;}function freeVariablesPredictive(_0x2cbb49){if(isNotNull(_0x2cbb49)){if(!_[_0x9d6f('0x3d')](_0x2cbb49[_0x9d6f('0x73')])){_0x2cbb49[_0x9d6f('0x73')]=undefined;loggerPredictive[_0x9d6f('0x7b')](_0x2cbb49[_0x9d6f('0x40')],_0x9d6f('0x8a'));}if(!_[_0x9d6f('0x3d')](_0x2cbb49['startPredictive'])){_0x2cbb49[_0x9d6f('0x28')]=undefined;loggerPredictive[_0x9d6f('0x7b')](_0x2cbb49['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x9d6f('0x3d')](_0x2cbb49[_0x9d6f('0x8b')])){clearInterval(_0x2cbb49[_0x9d6f('0x8b')]);_0x2cbb49['handlePredictive']=undefined;loggerPredictive[_0x9d6f('0x7b')](_0x2cbb49[_0x9d6f('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1123ad,_0x4c4daa){if(_0x4c4daa===0x0){return 0x0;}var _0x3c1b0a=0x1;for(var _0x5a21a1=0x1;_0x5a21a1<=_0x4c4daa;_0x5a21a1+=0x1){_0x3c1b0a=0x1+_0x3c1b0a*_0x5a21a1/_0x1123ad;}return 0x1/_0x3c1b0a;}function isVoiceQueueOutbound(_0x2df735){return _0x2df735===_0x9d6f('0x8c');}function isNotPreview(_0x5b6ec4){return _0x5b6ec4!==_0x9d6f('0x8d');}function isCampaignIvr(_0x33b42b){return _0x33b42b===_0x9d6f('0x78');}function getCallerId(_0x3ea968,_0x516e53,_0x4672ba){if(!_[_0x9d6f('0x3d')](_0x4672ba)&&typeof _0x4672ba===_0x9d6f('0x8e')&&!_[_0x9d6f('0x47')](_0x4672ba)){if(!_[_0x9d6f('0x3d')](_0x516e53)&&typeof _0x516e53===_0x9d6f('0x8e')&&!_[_0x9d6f('0x47')](_0x516e53)){return util['format'](_0x9d6f('0x8f'),_0x516e53,_0x4672ba);}return util[_0x9d6f('0x75')](_0x9d6f('0x8f'),_0x4672ba,_0x4672ba);}if(!_[_0x9d6f('0x3d')](_0x3ea968)&&typeof _0x3ea968===_0x9d6f('0x8e')&&!_[_0x9d6f('0x47')](_0x3ea968)){return _0x3ea968;}return _0x9d6f('0x90');}function loggerCatchQueueSummary(_0x3534c3,_0x2e762e){return function(_0x277d70){freeVariablesPredictive(_0x2e762e);emitVoiceQueueSummary(_0x2e762e);emitCampaignSummary(_0x2e762e);loggerSyncQueueSummary[_0x9d6f('0x91')](_0x3534c3,util[_0x9d6f('0x92')](_0x277d70,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x41b68a,_0x5ae782){return function(_0x8ee129){loggerPredictive[_0x9d6f('0x91')](_0x5ae782['name'],_0x41b68a);loggerPredictive['error'](_0x8ee129[_0x9d6f('0x93')]);freeVariablesPredictive(_0x5ae782);};}function loggerCatch(_0x447635){return function(_0x5d33f8){logger[_0x9d6f('0x91')](_0x447635,util[_0x9d6f('0x92')](_0x5d33f8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x58477c){return _0x58477c&&!_[_0x9d6f('0x3d')](_0x58477c)&&_0x58477c[_0x9d6f('0x94')]>0x0;}function decremetOriginate(_0x556caf){if(!_[_0x9d6f('0x3d')](_0x556caf)&&_0x556caf!==null){if(typeof _0x556caf[_0x9d6f('0x6e')]!==_0x9d6f('0x95')){if(_0x556caf[_0x9d6f('0x6e')]>0x0){_0x556caf[_0x9d6f('0x6e')]-=0x1;}else{logger[_0x9d6f('0x91')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9d6f('0x91')](_0x9d6f('0x96'));}}function checkContactLowerLimitOriginate(_0x2c26cf,_0x772f15,_0xc91e61){if(_0x772f15>_0xc91e61){for(var _0x26e48f=0x0;_0x26e48f<_0x772f15-_0xc91e61;_0x26e48f+=0x1){decremetOriginate(_0x2c26cf);}}}function loggerGetContactDialer(_0x447348,_0x512679,_0xc49937){return function(_0x1a1f1a){checkContactLowerLimitOriginate(_0x512679,_0xc49937,0x0);logger['error'](_0x447348,util['inspect'](_0x1a1f1a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3a1cd1){return function(_0x6a9e7d){if(isNotNull(_0x6a9e7d)&&isNotNull(_0x6a9e7d[0x0])){if(_0x6a9e7d[0x0][_0x9d6f('0x97')]>0x0){_0x3a1cd1['message']=_0x9d6f('0x98');logger[_0x9d6f('0x7b')](_0x9d6f('0x99')+_0x3a1cd1[_0x9d6f('0x40')],_0x6a9e7d[0x0][_0x9d6f('0x97')],_0x9d6f('0x9a'));}else{_0x3a1cd1[_0x9d6f('0x3e')]=_0x9d6f('0x9b');logger[_0x9d6f('0x7b')](_0x9d6f('0x9c')+_0x3a1cd1[_0x9d6f('0x40')]);}}};}function notSendMessagesQueue(_0x5ba770){if(_0x5ba770[_0x9d6f('0x9d')]){freeVariablesPredictive(_0x5ba770);if(_0x5ba770[_0x9d6f('0x6e')]===0x0&&_0x5ba770[_0x9d6f('0x9e')]===0x0&&_0x5ba770[_0x9d6f('0x56')]===0x0&&(_0x5ba770[_0x9d6f('0x53')]||0x0)===0x0){_0x5ba770[_0x9d6f('0x9d')]=![];_0x5ba770[_0x9d6f('0x52')]=0x0;_0x5ba770['message']=_0x9d6f('0x42');loggerSyncQueueSummary[_0x9d6f('0x91')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5ba770[_0x9d6f('0x40')],_0x9d6f('0x9f'));}else{_0x5ba770[_0x9d6f('0x3e')]=_0x9d6f('0xa0');loggerSyncQueueSummary['error'](_0x9d6f('0xa1'),_0x5ba770[_0x9d6f('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x5ba770);}}function notSendMessagesCampaign(_0x135d8a){if(_0x135d8a[_0x9d6f('0x9d')]){if(_0x135d8a[_0x9d6f('0x6e')]===0x0){_0x135d8a[_0x9d6f('0x9d')]=![];_0x135d8a[_0x9d6f('0x3e')]=_0x9d6f('0x42');loggerSyncQueueSummary[_0x9d6f('0x91')](_0x9d6f('0xa2'),_0x135d8a[_0x9d6f('0x40')],_0x9d6f('0x9f'));}else{_0x135d8a[_0x9d6f('0x3e')]=_0x9d6f('0xa0');loggerSyncQueueSummary[_0x9d6f('0x91')](_0x9d6f('0xa2'),_0x135d8a[_0x9d6f('0x40')],'is\x20disactive');}emitCampaignSummary(_0x135d8a);}}function createObjHistory(_0x450130,_0xf11bb1,_0xe89bc1,_0x38090c,_0xf000c5){_0x450130[_0x9d6f('0x3e')]=_0xe89bc1;var _0x42a2b7=new Action(_0x450130,_0xf11bb1);var _0x2d13be=new History(_0x42a2b7);_0x2d13be['state']=_0x38090c;_0x2d13be[_0x9d6f('0xa3')]=_0xf000c5;_0x2d13be[_0x9d6f('0xa4')]=_0x42a2b7[_0x9d6f('0xa5')];return _0x2d13be;}Dialer[_0x9d6f('0x1b')][_0x9d6f('0x3c')]=function(){var _0x1058c4=this;setInterval(function(){_0x1058c4[_0x9d6f('0xa6')](_0x1058c4[_0x9d6f('0x27')],_0x9d6f('0xa7'));_0x1058c4[_0x9d6f('0xa6')](_0x1058c4[_0x9d6f('0x26')],_0x9d6f('0xa8'));},0x32c8);};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xa6')]=function(_0x50c47d,_0x2accb6){var _0x4631d6=this;for(var _0x1283a4 in _0x50c47d){if(typeof _0x50c47d[_0x1283a4]!==_0x9d6f('0x95')){this[_0x9d6f('0x1f')][_0x9d6f('0x1c')](function(){if(!_[_0x9d6f('0xa9')](_0x50c47d[_0x1283a4])){return ami[_0x9d6f('0xaa')]({'action':_0x9d6f('0xab'),'channel':_0x50c47d[_0x1283a4][_0x9d6f('0xac')]})[_0x9d6f('0xad')](function(_0x21881a){if(_0x21881a[_0x9d6f('0x3e')]===_0x9d6f('0xae')){setTimeout(function(){if(_0x50c47d[_0x1283a4]&&_0x50c47d[_0x1283a4][_0x9d6f('0x4f')]!=='ivr'){_0x4631d6['updateOriginated'](_0x4631d6['voiceQueues'][_0x50c47d[_0x1283a4]['queue']]);logger[_0x9d6f('0x91')](_0x9d6f('0xaf'),_0x2accb6,_0x1283a4,_0x50c47d[_0x1283a4][_0x9d6f('0xb0')]);delete _0x50c47d[_0x1283a4];}if(_0x50c47d[_0x1283a4]&&_0x50c47d[_0x1283a4][_0x9d6f('0x4f')]===_0x9d6f('0x78')){_0x4631d6[_0x9d6f('0xb1')](_0x4631d6[_0x9d6f('0x21')][_0x50c47d[_0x1283a4]['queue']]);logger['error'](_0x9d6f('0xb2'),_0x2accb6,_0x1283a4,_0x50c47d[_0x1283a4][_0x9d6f('0xb0')]);delete _0x50c47d[_0x1283a4];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x5ee67f){return BPromise[_0x9d6f('0xb3')]()[_0x9d6f('0xb4')](cmHopper[_0x9d6f('0xb5')](_0x5ee67f))[_0x9d6f('0xad')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xb6')]=function(_0x4674d0){return BPromise[_0x9d6f('0xb3')]()[_0x9d6f('0xb4')](cmHopperBlack[_0x9d6f('0xb6')](_0x4674d0))[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xb7')));};Dialer['prototype'][_0x9d6f('0xb8')]=function(_0x2d3e42){return BPromise[_0x9d6f('0xb3')]()[_0x9d6f('0xb4')](cmHopperBlack[_0x9d6f('0xb8')](_0x2d3e42))[_0x9d6f('0xad')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xb9')]=function(_0x3db3cf){return BPromise[_0x9d6f('0xb3')]()[_0x9d6f('0xb4')](cmHopperHistory[_0x9d6f('0xba')](_0x3db3cf))[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xbb')));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xbc')]=function(_0x46088b){return BPromise['resolve']()[_0x9d6f('0xb4')](cmHopper['rescheduleContact'](_0x46088b))['catch'](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xbd')]=function(_0x9443ef,_0x4605e1,_0x1d01d8){return BPromise[_0x9d6f('0xb3')]()['then'](cmHopper[_0x9d6f('0xbd')](_0x9443ef,_0x4605e1,_0x1d01d8))[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xbe')));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xbf')]=function(_0x11a5c6,_0x3fa66c,_0x1b5340,_0x1e6d0e,_0x455b53){return BPromise[_0x9d6f('0xb3')]()[_0x9d6f('0xb4')](cmHopper[_0x9d6f('0xbf')](_0x11a5c6,_0x3fa66c,_0x1b5340,_0x1e6d0e))[_0x9d6f('0xad')](function(_0x3ed468){_0x455b53[_0x9d6f('0xc0')]-=_0x1b5340;_0x455b53[_0x9d6f('0xc0')]=_0x455b53[_0x9d6f('0xc0')]>0x0?_0x455b53[_0x9d6f('0xc0')]:0x0;loggerCatch(_0x9d6f('0xc1'))(_0x3ed468);});};Dialer[_0x9d6f('0x1b')]['getContactDialerIvr']=function(_0x45f68a,_0x55235f,_0x21216e,_0x1847f8){return BPromise[_0x9d6f('0xb3')]()['then'](cmHopper[_0x9d6f('0xc2')](_0x45f68a,_0x55235f,_0x21216e))[_0x9d6f('0xad')](function(_0x92c420){_0x1847f8[_0x9d6f('0xc0')]-=_0x55235f;_0x1847f8[_0x9d6f('0xc0')]=_0x1847f8[_0x9d6f('0xc0')]>0x0?_0x1847f8['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x92c420);});};Dialer['prototype'][_0x9d6f('0xc3')]=function(_0x23daf4){return BPromise[_0x9d6f('0xb3')]()['then'](voiceQueueRt[_0x9d6f('0xc3')](_0x23daf4))['catch'](loggerCatch(_0x9d6f('0xc4')));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xc5')]=function(_0x51c3a9){return BPromise[_0x9d6f('0xb3')]()['then'](cmHopper[_0x9d6f('0xc5')](_0x51c3a9))['catch'](loggerCatch(_0x9d6f('0xc6')));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xc7')]=function(_0x2c1268){return BPromise[_0x9d6f('0xb3')]()[_0x9d6f('0xb4')](cmHopperHistory[_0x9d6f('0xc7')](_0x2c1268))[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xc8')));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xb1')]=function(_0x41f2d5){if(!_[_0x9d6f('0x3d')](_0x41f2d5)&&_0x41f2d5!==null){if(typeof _0x41f2d5[_0x9d6f('0x6e')]!==_0x9d6f('0x95')){if(_0x41f2d5[_0x9d6f('0x6e')]>0x0){_0x41f2d5[_0x9d6f('0x6e')]-=0x1;}else{logger[_0x9d6f('0x91')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9d6f('0x91')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xc9')]=function(_0x200621,_0x445816){var _0x3867c2=this;return function(_0x57967a){_0x3867c2[_0x9d6f('0xb1')](_0x445816);logger[_0x9d6f('0x91')](_0x200621,util['inspect'](_0x57967a,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x9d6f('0xca')]=function(_0x567875,_0x185fdf,_0x1e5813){var _0x1d8e82={'state':0x19,'statedesc':_0x9d6f('0xcb')};this[_0x9d6f('0xb1')](_0x185fdf);this[_0x9d6f('0xcc')](_[_0x9d6f('0x89')](_0x1d8e82,_[_0x9d6f('0xcd')](_0x1e5813,[_0x9d6f('0xce'),_0x9d6f('0xcf'),_0x9d6f('0xd0'),_0x9d6f('0xd1'),'CampaignId'])),_0x9d6f('0xd2'),_0x9d6f('0xd3'));logger[_0x9d6f('0x91')](_0x567875);};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xd4')]=function(_0x25b21e){return _0x25b21e==='Success';};Dialer['prototype'][_0x9d6f('0xd5')]=function(_0x33aece){return!_['isUndefined'](_0x33aece)&&_0x33aece&&!_[_0x9d6f('0x3d')](_0x33aece[_0x9d6f('0x40')])&&!_[_0x9d6f('0x3d')](_0x33aece[_0x9d6f('0xd6')])&&_0x33aece[_0x9d6f('0xd6')]&&(this[_0x9d6f('0x23')][util[_0x9d6f('0x75')](_0x9d6f('0xd7'),_0x33aece[_0x9d6f('0x40')])][_0x9d6f('0xab')]===_0x9d6f('0xd8')||this[_0x9d6f('0x23')][util[_0x9d6f('0x75')](_0x9d6f('0xd7'),_0x33aece[_0x9d6f('0x40')])][_0x9d6f('0xab')]===_0x9d6f('0xd9'));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xcc')]=function(_0x4f6c03,_0xfc0121,_0x1d6f67){this[_0x9d6f('0xc7')](_0x4f6c03)[_0x9d6f('0xad')](loggerCatch(_0xfc0121));this['moveContactManagedDialer'](_0x4f6c03)[_0x9d6f('0xad')](loggerCatch(_0x1d6f67));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x37')]=function(_0xb1dde9){var _0x207dfd=this[_0x9d6f('0x27')][_0xb1dde9[_0x9d6f('0xda')]];var _0x4b63f8;if(!_[_0x9d6f('0xa9')](_0xb1dde9)&&!_['isNil'](_0xb1dde9[_0x9d6f('0xdb')])&&!_[_0x9d6f('0xa9')](_0xb1dde9['variable'][_0x9d6f('0xdc')])&&_0xb1dde9['exten']==='xcally-motion-dialer'&&_0x207dfd){if(_0x207dfd[_0x9d6f('0x4f')]!==_0x9d6f('0x78')&&this[_0x9d6f('0x20')][_0x207dfd[_0x9d6f('0xb0')]][_0x9d6f('0xdd')]&&_0xb1dde9['value']===_0x9d6f('0xde')){delete this[_0x9d6f('0x27')][_0xb1dde9[_0x9d6f('0xda')]];this[_0x9d6f('0xb1')](this[_0x9d6f('0x20')][_0x207dfd[_0x9d6f('0xb0')]]);this[_0x9d6f('0x20')][_0x207dfd[_0x9d6f('0xb0')]][_0x9d6f('0x5c')]+=0x1;this[_0x9d6f('0x20')][_0x207dfd[_0x9d6f('0xb0')]][_0x9d6f('0x5b')]+=0x1;_0x4b63f8=new Hangup(_0x207dfd,_0xb1dde9);_0x4b63f8[_0x9d6f('0xdf')]=0x12;_0x4b63f8[_0x9d6f('0xa3')]=_0x9d6f('0xe0');_0x4b63f8[_0x9d6f('0xe1')]='AMD';ami[_0x9d6f('0x4e')](_0x9d6f('0xe2'),ut['buildObj'](_0x4b63f8,_0x9d6f('0xe3')));this[_0x9d6f('0xcc')](_0x4b63f8,_0x9d6f('0xe4'),'[syncHangupInAMD]');}if(_0x207dfd[_0x9d6f('0x4f')]!=='ivr'&&this[_0x9d6f('0x20')][_0x207dfd[_0x9d6f('0xb0')]]['dialAMDActive']&&_0xb1dde9['value']===_0x9d6f('0xe5')){var _0x374fba=this;return new BPromise(function(_0x514bfb,_0x463d6f){delete _0x374fba[_0x9d6f('0x27')][_0xb1dde9[_0x9d6f('0xda')]];_0x374fba['updateOriginated'](_0x374fba[_0x9d6f('0x20')][_0x207dfd[_0x9d6f('0xb0')]]);_0x374fba[_0x9d6f('0x20')][_0x207dfd[_0x9d6f('0xb0')]]['outboundAnswerCallsDay']+=0x1;_0x374fba[_0x9d6f('0x20')][_0x207dfd['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x1d798a=_0x374fba['voiceQueues'][_0x207dfd[_0x9d6f('0xb0')]];var _0x5bbbcb=new Hangup(_0x207dfd,_0xb1dde9);_0x5bbbcb['state']=0x13;_0x5bbbcb['statedesc']=_0x9d6f('0xe6');_0x5bbbcb[_0x9d6f('0xe1')]=_0x9d6f('0xe7');_0x5bbbcb['countmachineretry']+=0x1;_0x5bbbcb['countglobal']+=0x1;_0x5bbbcb[_0x9d6f('0xe3')]=!![];ami[_0x9d6f('0x4e')]('custom:amd',ut['buildObj'](_0x5bbbcb,_0x9d6f('0xe3')));_0x374fba[_0x9d6f('0xc7')](_0x5bbbcb)['catch'](loggerCatch(_0x9d6f('0xe8')));if(_0x5bbbcb[_0x9d6f('0xe9')]+_0x5bbbcb[_0x9d6f('0xea')]+_0x5bbbcb[_0x9d6f('0xeb')]+_0x5bbbcb['countnosuchnumberretry']+_0x5bbbcb['countdropretry']+_0x5bbbcb[_0x9d6f('0xec')]+_0x5bbbcb[_0x9d6f('0xed')]+_0x5bbbcb[_0x9d6f('0xee')]>=_0x1d798a[_0x9d6f('0xef')]){_0x374fba[_0x9d6f('0xf0')](_0x5bbbcb,_0x514bfb,_0x463d6f,_0x9d6f('0xf1'));}else{if(_0x5bbbcb[_0x9d6f('0xed')]>=_0x1d798a['dialMachineMaxRetry']){_0x374fba['createStateFinal'](_0x5bbbcb,_0x514bfb,_0x463d6f,_0x9d6f('0xf2'));}else{_0x374fba['rescheduleContact']({'active':![],'countmachineretry':_0x5bbbcb[_0x9d6f('0xed')],'scheduledat':moment()[_0x9d6f('0xf3')](_0x1d798a[_0x9d6f('0xf4')],_0x9d6f('0xf5'))['format'](_0x9d6f('0xf6')),'ContactId':_0x5bbbcb['ContactId'],'ListId':_0x5bbbcb[_0x9d6f('0xcf')],'VoiceQueueId':_0x5bbbcb[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x5bbbcb[_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xf8')));_0x514bfb({'reschedule':0x1});}}});}if(_0x207dfd[_0x9d6f('0x4f')]===_0x9d6f('0x78')&&this[_0x9d6f('0x21')][_0x207dfd['queue']][_0x9d6f('0xdd')]&&_0xb1dde9[_0x9d6f('0xf9')]===_0x9d6f('0xde')){delete this[_0x9d6f('0x27')][_0xb1dde9[_0x9d6f('0xda')]];this[_0x9d6f('0xb1')](this[_0x9d6f('0x21')][_0x207dfd[_0x9d6f('0xb0')]]);_0x4b63f8=new Hangup(_0x207dfd,_0xb1dde9);_0x4b63f8[_0x9d6f('0xdf')]=0x12;_0x4b63f8[_0x9d6f('0xa3')]=_0x9d6f('0xe0');_0x4b63f8[_0x9d6f('0xe1')]='AMD';ami[_0x9d6f('0x4e')]('custom:amd',ut[_0x9d6f('0xfa')](_0x4b63f8,_0x9d6f('0xe3')));this[_0x9d6f('0xcc')](_0x4b63f8,_0x9d6f('0xfb'),_0x9d6f('0xfc'));}if(_0x207dfd['type']===_0x9d6f('0x78')&&this[_0x9d6f('0x21')][_0x207dfd[_0x9d6f('0xb0')]][_0x9d6f('0xdd')]&&_0xb1dde9['value']==='MACHINE'){var _0x374fba=this;return new BPromise(function(_0x54b450,_0x3edc11){delete _0x374fba['uniqueId'][_0xb1dde9[_0x9d6f('0xda')]];_0x374fba[_0x9d6f('0xb1')](_0x374fba[_0x9d6f('0x21')][_0x207dfd[_0x9d6f('0xb0')]]);_0x374fba['campaigns'][_0x207dfd['queue']]['outboundAnswerCallsDay']+=0x1;_0x374fba[_0x9d6f('0x21')][_0x207dfd[_0x9d6f('0xb0')]][_0x9d6f('0x5b')]+=0x1;var _0x191e71=_0x374fba[_0x9d6f('0x21')][_0x207dfd['queue']];var _0x35ee53=new Hangup(_0x207dfd,_0xb1dde9);_0x35ee53[_0x9d6f('0xdf')]=0x13;_0x35ee53[_0x9d6f('0xa3')]=_0x9d6f('0xe6');_0x35ee53[_0x9d6f('0xe1')]=_0x9d6f('0xe7');_0x35ee53[_0x9d6f('0xed')]+=0x1;_0x35ee53[_0x9d6f('0xfd')]+=0x1;_0x35ee53[_0x9d6f('0xe3')]=!![];ami[_0x9d6f('0x4e')](_0x9d6f('0xe2'),ut['buildObj'](_0x35ee53,'amd'));_0x374fba['createHistory'](_0x35ee53)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xe8')));if(_0x35ee53[_0x9d6f('0xe9')]+_0x35ee53['countcongestionretry']+_0x35ee53[_0x9d6f('0xeb')]+_0x35ee53[_0x9d6f('0xfe')]+_0x35ee53[_0x9d6f('0xff')]+_0x35ee53[_0x9d6f('0xec')]+_0x35ee53[_0x9d6f('0xed')]+_0x35ee53['countagentrejectretry']>=_0x191e71['dialGlobalMaxRetry']){_0x374fba[_0x9d6f('0xf0')](_0x35ee53,_0x54b450,_0x3edc11,_0x9d6f('0xf1'));}else{if(_0x35ee53['countmachineretry']>=_0x191e71[_0x9d6f('0x100')]){_0x374fba['createStateFinal'](_0x35ee53,_0x54b450,_0x3edc11,_0x9d6f('0xf2'));}else{_0x374fba[_0x9d6f('0xbc')]({'active':![],'countmachineretry':_0x35ee53[_0x9d6f('0xed')],'scheduledat':moment()[_0x9d6f('0xf3')](_0x191e71[_0x9d6f('0xf4')],_0x9d6f('0xf5'))[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x35ee53[_0x9d6f('0xce')],'ListId':_0x35ee53[_0x9d6f('0xcf')],'VoiceQueueId':_0x35ee53[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x35ee53[_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xf8')));_0x54b450({'reschedule':0x1});}}});}}};Dialer[_0x9d6f('0x1b')]['syncHangup']=function(_0x4eb935){var _0x28d9c3=this[_0x9d6f('0x27')][_0x4eb935[_0x9d6f('0xda')]];var _0x5bd1b7=this;var _0x1ef2df;if(_0x28d9c3&&_0x28d9c3[_0x9d6f('0x4f')]===_0x9d6f('0x78')){delete this[_0x9d6f('0x27')][_0x4eb935[_0x9d6f('0xda')]];this[_0x9d6f('0xb1')](this['campaigns'][_0x28d9c3[_0x9d6f('0xb0')]]);this[_0x9d6f('0x21')][_0x28d9c3['queue']][_0x9d6f('0x101')]+=0x1;_0x1ef2df=new Hangup(_0x28d9c3,_0x4eb935);this['createHistory'](_0x1ef2df)['catch'](loggerCatch(_0x9d6f('0x102')));this[_0x9d6f('0xc5')](_0x1ef2df)['catch'](loggerCatch(_0x9d6f('0x103')));}if(_0x28d9c3&&_0x28d9c3['type']!=='ivr'&&isNotNull(this[_0x9d6f('0x20')][_0x28d9c3[_0x9d6f('0xb0')]][_0x9d6f('0x104')])){delete this[_0x9d6f('0x27')][_0x4eb935['uniqueid']];this[_0x9d6f('0xb1')](this['voiceQueues'][_0x28d9c3['queue']]);this[_0x9d6f('0x20')][_0x28d9c3['queue']][_0x9d6f('0x5c')]+=0x1;this[_0x9d6f('0x20')][_0x28d9c3[_0x9d6f('0xb0')]][_0x9d6f('0x5b')]+=0x1;_0x1ef2df=new Hangup(_0x28d9c3,_0x4eb935);_0x1ef2df[_0x9d6f('0xdf')]=0x10;_0x1ef2df[_0x9d6f('0xa3')]=_0x9d6f('0x105');_0x1ef2df[_0x9d6f('0xe1')]=_0x9d6f('0x106');this[_0x9d6f('0xc7')](_0x1ef2df)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x102')));this[_0x9d6f('0xc5')](_0x1ef2df)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x103')));}if(_0x28d9c3&&_0x28d9c3[_0x9d6f('0x4f')]!==_0x9d6f('0x78')&&!isNotNull(this['voiceQueues'][_0x28d9c3[_0x9d6f('0xb0')]][_0x9d6f('0x104')])){delete this['uniqueId'][_0x4eb935['uniqueid']];this[_0x9d6f('0xb1')](this[_0x9d6f('0x20')][_0x28d9c3[_0x9d6f('0xb0')]]);this[_0x9d6f('0x20')][_0x28d9c3[_0x9d6f('0xb0')]][_0x9d6f('0x62')]+=0x1;_0x1ef2df=new Hangup(_0x28d9c3,_0x4eb935);_0x1ef2df[_0x9d6f('0xdf')]=0xc;_0x1ef2df[_0x9d6f('0xa3')]=_0x4eb935[_0x9d6f('0x107')];_0x1ef2df[_0x9d6f('0xe1')]=_0x9d6f('0x108');this[_0x9d6f('0xc7')](_0x1ef2df)['catch'](loggerCatch(_0x9d6f('0x102')));this['moveContactManagedDialer'](_0x1ef2df)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x103')));}};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x32')]=function(_0x439430){var _0x4279b9=this['uniqueId'][_0x439430[_0x9d6f('0xda')]];var _0x5bbab5=this;if(this[_0x9d6f('0x20')][_0x439430[_0x9d6f('0xb0')]]){if(_0x4279b9&&_0x4279b9[_0x9d6f('0x4f')]!==_0x9d6f('0x78')){delete this[_0x9d6f('0x27')][_0x439430[_0x9d6f('0xda')]];this['voiceQueues'][_0x439430[_0x9d6f('0xb0')]][_0x9d6f('0x5c')]+=0x1;var _0x3cf71d=new AgentComplete(_0x4279b9,_0x439430);if(_0x439430['reason']==='agent'){_0x3cf71d['agiafterat']=this['voiceQueues'][_0x439430[_0x9d6f('0xb0')]]['dialQueueProject2']&&this[_0x9d6f('0x20')][_0x439430[_0x9d6f('0xb0')]]['dialAgiAfterHangupAgent']?moment()[_0x9d6f('0x75')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x3cf71d)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x109')));this['moveContactManagedDialer'](_0x3cf71d)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x10a')));}}};Dialer[_0x9d6f('0x1b')]['syncAgentConnect']=function(_0x4252dd){if(this[_0x9d6f('0x20')][_0x4252dd[_0x9d6f('0xb0')]]){if(this['uniqueId'][_0x4252dd[_0x9d6f('0xda')]]&&this[_0x9d6f('0x27')][_0x4252dd[_0x9d6f('0xda')]][_0x9d6f('0x4f')]!=='ivr'){this[_0x9d6f('0xb1')](this[_0x9d6f('0x20')][_0x4252dd[_0x9d6f('0xb0')]]);this[_0x9d6f('0x27')][_0x4252dd[_0x9d6f('0xda')]][_0x9d6f('0x10b')]=moment()[_0x9d6f('0x75')](_0x9d6f('0xf6'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x3c3bf5){this[_0x9d6f('0xc7')](_0x3c3bf5)[_0x9d6f('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x9d6f('0xc5')](_0x3c3bf5)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x10c')));};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x2e')]=function(_0x21447c){var _0x3e2ce4=this[_0x9d6f('0x27')][_0x21447c[_0x9d6f('0xda')]];var _0xe7d7b6=this;if(this[_0x9d6f('0x20')][_0x21447c[_0x9d6f('0xb0')]]){if(_0x3e2ce4&&_0x3e2ce4[_0x9d6f('0x4f')]!==_0x9d6f('0x78')){delete this[_0x9d6f('0x27')][_0x21447c['uniqueid']];this[_0x9d6f('0xb1')](this[_0x9d6f('0x20')][_0x21447c[_0x9d6f('0xb0')]]);_0x3e2ce4[_0x9d6f('0x10d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x363507=new QueueCallerAbandon(_0x3e2ce4,_0x21447c);if(getSeconds(_0x3e2ce4[_0x9d6f('0x10d')],_0x3e2ce4[_0x9d6f('0x10e')])>=_0x3e2ce4[_0x9d6f('0x10f')]){this[_0x9d6f('0x20')][_0x21447c[_0x9d6f('0xb0')]][_0x9d6f('0x66')]+=0x1;this['voiceQueues'][_0x21447c[_0x9d6f('0xb0')]][_0x9d6f('0x5e')]+=0x1;this[_0x9d6f('0x20')][_0x21447c[_0x9d6f('0xb0')]][_0x9d6f('0x68')]+=0x1;_0x363507[_0x9d6f('0xdf')]=0xa;_0x363507[_0x9d6f('0xa3')]=_0x9d6f('0x110');_0x363507['dropreason']=_0x9d6f('0x111');_0x363507[_0x9d6f('0x112')]=this[_0x9d6f('0x20')][_0x21447c['queue']][_0x9d6f('0x113')]?moment()[_0x9d6f('0x75')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x363507[_0x9d6f('0xff')]+=0x1;_0x363507[_0x9d6f('0xfd')]+=0x1;if(_0x363507[_0x9d6f('0xff')]>=this[_0x9d6f('0x20')][_0x21447c[_0x9d6f('0xb0')]][_0x9d6f('0x114')]){this[_0x9d6f('0x115')](_0x363507);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x363507['countdropretry'],'scheduledat':moment()[_0x9d6f('0xf3')](this[_0x9d6f('0x20')][_0x21447c[_0x9d6f('0xb0')]][_0x9d6f('0x116')],_0x9d6f('0xf5'))[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x3e2ce4['ContactId'],'ListId':_0x3e2ce4['ListId'],'VoiceQueueId':_0x3e2ce4[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x3e2ce4[_0x9d6f('0xf7')]||undefined})['catch'](loggerCatch(_0x9d6f('0x117')));var _0xba04e4=new History(_0x363507);_0xba04e4[_0x9d6f('0xdf')]=0xa;_0xba04e4[_0x9d6f('0xa3')]=_0x9d6f('0x110');_0xba04e4[_0x9d6f('0xa5')]=moment()[_0x9d6f('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0xba04e4[_0x9d6f('0xa4')]=_0xba04e4['starttime'];_0xba04e4['calleridname']=_0x363507[_0x9d6f('0x118')];_0xba04e4[_0x9d6f('0x119')]=_0x363507[_0x9d6f('0x119')];this[_0x9d6f('0xc7')](_0xba04e4)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x11a')));}}else{this['voiceQueues'][_0x21447c['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x9d6f('0x20')][_0x21447c['queue']][_0x9d6f('0x11b')]+=0x1;_0x363507['state']=0xb;_0x363507[_0x9d6f('0xa3')]=_0x9d6f('0x11c');_0x363507[_0x9d6f('0x11d')]=_0x9d6f('0x11e');_0x363507['countabandonedretry']+=0x1;_0x363507[_0x9d6f('0xfd')]+=0x1;if(_0x363507['countabandonedretry']>=this[_0x9d6f('0x20')][_0x21447c['queue']][_0x9d6f('0x11f')]){this[_0x9d6f('0x115')](_0x363507);}else{this[_0x9d6f('0xbc')]({'active':![],'countabandonedretry':_0x363507['countabandonedretry'],'scheduledat':moment()[_0x9d6f('0xf3')](this[_0x9d6f('0x20')][_0x21447c['queue']]['dialAbandonedRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3e2ce4['ContactId'],'ListId':_0x3e2ce4[_0x9d6f('0xcf')],'VoiceQueueId':_0x3e2ce4[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x3e2ce4[_0x9d6f('0xf7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0xba04e4=new History(_0x363507);_0xba04e4[_0x9d6f('0xdf')]=0xb;_0xba04e4['statedesc']=_0x9d6f('0x11c');_0xba04e4[_0x9d6f('0xa5')]=moment()['format'](_0x9d6f('0xf6'));_0xba04e4[_0x9d6f('0xa4')]=_0xba04e4[_0x9d6f('0xa5')];_0xba04e4[_0x9d6f('0x118')]=_0x363507[_0x9d6f('0x118')];_0xba04e4[_0x9d6f('0x119')]=_0x363507[_0x9d6f('0x119')];this[_0x9d6f('0xc7')](_0xba04e4)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x120')));}}}}};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x121')]=function(_0x2b64f4){if(this['actions'][_0x2b64f4[_0x9d6f('0xda')]]){this[_0x9d6f('0x26')][_0x2b64f4[_0x9d6f('0xda')]][_0x9d6f('0xac')]=_0x2b64f4[_0x9d6f('0xac')];}if(this[_0x9d6f('0x27')][_0x2b64f4[_0x9d6f('0xda')]]){this[_0x9d6f('0x27')][_0x2b64f4[_0x9d6f('0xda')]][_0x9d6f('0xac')]=_0x2b64f4[_0x9d6f('0xac')];}};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x122')]=function(_0x9275c0){if(strategy[this['voiceQueues'][this['actions'][_0x9275c0[_0x9d6f('0x123')]][_0x9d6f('0xb0')]][_0x9d6f('0x50')]]===_0x9d6f('0x124')){if(this[_0x9d6f('0x26')][_0x9275c0[_0x9d6f('0x123')]]&&_[_0x9d6f('0xa9')](this[_0x9d6f('0x26')][_0x9275c0[_0x9d6f('0x123')]]['locked'])&&_0x9275c0['status']==='1'&&_0x9275c0[_0x9d6f('0x125')]==='0'){if(this[_0x9d6f('0x22')][_0x9275c0[_0x9d6f('0x126')]]){if(!this[_0x9d6f('0x22')][_0x9275c0[_0x9d6f('0x126')]]['locked']){this[_0x9d6f('0x22')][_0x9275c0[_0x9d6f('0x126')]][_0x9d6f('0x127')]=!![];this[_0x9d6f('0x26')][_0x9275c0[_0x9d6f('0x123')]][_0x9d6f('0x127')]=!![];this[_0x9d6f('0x26')][_0x9275c0[_0x9d6f('0x123')]][_0x9d6f('0x126')]=_0x9275c0[_0x9d6f('0x126')];}}}}else if((strategy[this[_0x9d6f('0x20')][this[_0x9d6f('0x26')][_0x9275c0[_0x9d6f('0x123')]][_0x9d6f('0xb0')]]['strategy']]||_0x9d6f('0x1a'))===_0x9d6f('0x1a')){if(this[_0x9d6f('0x26')][_0x9275c0[_0x9d6f('0x123')]]){if(this[_0x9d6f('0x22')][_0x9275c0[_0x9d6f('0x126')]]){this[_0x9d6f('0x26')][_0x9275c0[_0x9d6f('0x123')]]['stateinterface']=_0x9275c0['stateinterface'];if(_['isNil'](this[_0x9d6f('0x29')][this['actions'][_0x9275c0[_0x9d6f('0x123')]]['queue']])){this[_0x9d6f('0x29')][this[_0x9d6f('0x26')][_0x9275c0['actionid']][_0x9d6f('0xb0')]]=[];}this['queueBooked'][this['actions'][_0x9275c0[_0x9d6f('0x123')]][_0x9d6f('0xb0')]][_0x9d6f('0x128')](_[_0x9d6f('0x89')](_[_0x9d6f('0xcd')](this['actions'][_0x9275c0['actionid']],[_0x9d6f('0x129'),'stateinterface']),{'status':_0x9275c0[_0x9d6f('0xab')],'paused':_0x9275c0[_0x9d6f('0x125')]}));}}}};function unlockQueueStatus(_0x1d9a0d,_0x533660){setTimeout(function(){if(_['isUndefined'](_0x1d9a0d[_0x9d6f('0x12a')])){loggerBooked[_0x9d6f('0x91')](_0x9d6f('0x12b'),_0x533660);}_0x1d9a0d['queueStatusComplete']=!![];loggerBooked[_0x9d6f('0x7b')]('[booked][unlockQueueStatus]',_0x533660,JSON[_0x9d6f('0x4a')](_[_0x9d6f('0xcd')](_0x1d9a0d,['name',_0x9d6f('0x12a')])));},0x1f3);}Dialer['prototype'][_0x9d6f('0x3a')]=function(_0xa4f208){var _0x26234d=this;var _0x467c91=_0x26234d[_0x9d6f('0x20')][_0x26234d[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]]['queue']];if(strategy[this[_0x9d6f('0x20')][this['actions'][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]][_0x9d6f('0x50')]]==='roundrobin'){if(this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]]&&this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0x126')]){this[_0x9d6f('0x8d')][_0x9d6f('0x12c')](this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0x129')],this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0x126')])[_0x9d6f('0xad')](function(_0x4db8ca){logger['error'](_0x9d6f('0x12d'),util[_0x9d6f('0x92')](_0x4db8ca,{'showHidden':![],'depth':null}));})[_0x9d6f('0x1e')](function(){_0x26234d[_0x9d6f('0xb1')](_0x26234d[_0x9d6f('0x20')][_0x26234d[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]]);_0x26234d[_0x9d6f('0x22')][_0x26234d[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]]['stateinterface']][_0x9d6f('0x127')]=![];delete _0x26234d['actions'][_0xa4f208[_0x9d6f('0x123')]];unlockQueueStatus(_0x467c91);});}else{this['updateOriginated'](this[_0x9d6f('0x20')][this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]]);this[_0x9d6f('0xbc')]({'active':![],'ContactId':this[_0x9d6f('0x26')][_0xa4f208['actionid']][_0x9d6f('0xce')],'ListId':this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xcf')],'VoiceQueueId':this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xd1')]||undefined,'CampaignId':this['actions'][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x12e')));delete this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]];unlockQueueStatus(_0x467c91);}}else if((strategy[this[_0x9d6f('0x20')][this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]][_0x9d6f('0x50')]]||_0x9d6f('0x1a'))===_0x9d6f('0x1a')){var _0x185a75;if(this['actions'][_0xa4f208[_0x9d6f('0x123')]]&&!_[_0x9d6f('0x47')](this['queueBooked'][this[_0x9d6f('0x26')][_0xa4f208['actionid']][_0x9d6f('0xb0')]])){if(this[_0x9d6f('0x2a')][_0x26234d[_0x9d6f('0x26')][_0xa4f208['actionid']][_0x9d6f('0xb0')]]){this[_0x9d6f('0x2a')][_0x26234d['actions'][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]]=this['queueBookedRR'][this[_0x9d6f('0x26')][_0xa4f208['actionid']][_0x9d6f('0xb0')]]?this[_0x9d6f('0x2a')][this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]]:this['queueBooked'][this['actions'][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]]?this[_0x9d6f('0x29')][this[_0x9d6f('0x26')][_0xa4f208[_0x9d6f('0x123')]][_0x9d6f('0xb0')]][_0x9d6f('0x12f')]||0x0:0x0;}this['queueBooked'][this[_0x9d6f('0x26')][_0xa4f208['actionid']]['queue']]['_rr']=this[_0x9d6f('0x2a')][this[_0x9d6f('0x26')][_0xa4f208['actionid']][_0x9d6f('0xb0')]];for(var _0x3e94ff=0x0;_0x3e94ff=0x0;})[_0x9d6f('0xad')](myreject(_0x563cd3)));}}else{_0x460d06[_0x9d6f('0x128')](ami[_0x9d6f('0xaa')]({'action':_0x9d6f('0x143'),'command':util[_0x9d6f('0x75')]('iftime\x20%s,%s',_0x2e6e8e,!_[_0x9d6f('0x3d')](config[_0x9d6f('0x144')][_0x4b8ce1])?_0x4b8ce1:'')})['then'](function(_0x533507){return _0x533507[_0x9d6f('0x145')][_0x9d6f('0x146')](_0x9d6f('0x147'))>=0x0;})[_0x9d6f('0xad')](myreject(_0x563cd3)));}BPromise[_0x9d6f('0x148')](_0x460d06)[_0x9d6f('0xb4')](function(_0x1982aa){var _0x13ff83=_[_0x9d6f('0x149')](_0x1982aa);if(_0x13ff83){return _0xd91d78(_0x13ff83);}else{_0xe636fa[_0x9d6f('0x3e')]=_0x1bcadd?_0x9d6f('0x14a'):'INTERVAL_IS_OVERTIME';return _0x563cd3(msgResponse('[ifTime][promiseAll]','Failure',_0x9d6f('0x14b')+_0x1bcadd+'\x20'+_0x8ea639+_0x9d6f('0x14c')+util[_0x9d6f('0x92')](_0x2e6e8e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4b8ce1));}})[_0x9d6f('0xad')](function(_0x575106){return _0x563cd3(msgResponse('ifTime','Failure',JSON[_0x9d6f('0x4a')](_0x575106)));});});};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x14d')]=function(_0x491d1c){var _0x4f7c4d=this;return function(){switch(_0x491d1c[_0x9d6f('0x14e')]){case _0x9d6f('0x14f'):freeVariablesPredictive(_0x491d1c);_0x4f7c4d[_0x9d6f('0x150')](_0x491d1c,0x1);break;case _0x9d6f('0x151'):freeVariablesPredictive(_0x491d1c);_0x4f7c4d[_0x9d6f('0x150')](_0x491d1c,_0x491d1c[_0x9d6f('0x152')]);break;case _0x9d6f('0x9'):_0x4f7c4d['predictive'](_0x491d1c);break;case _0x9d6f('0x7'):freeVariablesPredictive(_0x491d1c);_0x4f7c4d['handlePower'](_0x491d1c,0x1);break;default:freeVariablesPredictive(_0x491d1c);logger['error'](_0x9d6f('0x153'),_0x491d1c[_0x9d6f('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x154')]=function(_0x54da19){var _0x314bd7=this;return function(){_0x314bd7[_0x9d6f('0x155')](_0x54da19);};};Dialer[_0x9d6f('0x1b')][_0x9d6f('0xb')]=function(_0x4b2104){var _0x189607=this;if(isNotPreview(_0x4b2104['dialMethod'])){if(isVoiceQueueOutbound(_0x4b2104[_0x9d6f('0x4f')])&&isActive(_0x4b2104[_0x9d6f('0x156')])){_0x4b2104[_0x9d6f('0x9d')]=!![];BPromise[_0x9d6f('0xb3')]()[_0x9d6f('0xb4')](checkIsLoggedIn(_0x4b2104,_0x4b2104[_0x9d6f('0x157')]))[_0x9d6f('0xb4')](checkIsActive(_0x4b2104,_0x4b2104[_0x9d6f('0x156')]))['then'](checkInterval(_0x4b2104))[_0x9d6f('0xb4')](_0x189607[_0x9d6f('0x138')](_0x4b2104))[_0x9d6f('0xb4')](_0x189607[_0x9d6f('0x13a')](_0x4b2104[_0x9d6f('0x158')],_0x4b2104['dialTimezone'],_0x4b2104['name'],_0x4b2104))[_0x9d6f('0xb4')](_0x189607[_0x9d6f('0x13c')](_0x4b2104[_0x9d6f('0x46')],_0x4b2104[_0x9d6f('0x159')],_0x4b2104[_0x9d6f('0x40')],_0x4b2104))[_0x9d6f('0xb4')](_0x189607['checkDialMethod'](_0x4b2104))[_0x9d6f('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4b2104));}else{notSendMessagesQueue(_0x4b2104);}}else{freeVariablesPredictive(_0x4b2104);}};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x137')]=function(){var _0x230e72=this;var _0x45dcf6;for(var _0x47a097 in this['campaigns']){if(typeof this[_0x9d6f('0x21')][_0x47a097]!=='undefined'){_0x45dcf6=this['campaigns'][_0x47a097];if(isCampaignIvr(_0x45dcf6[_0x9d6f('0x4f')])&&isActive(_0x45dcf6[_0x9d6f('0xd6')])){_0x45dcf6[_0x9d6f('0x9d')]=!![];BPromise[_0x9d6f('0xb3')]()['then'](checkIsActive(_0x45dcf6,_0x45dcf6[_0x9d6f('0xd6')]))['then'](checkInterval(_0x45dcf6))[_0x9d6f('0xb4')](_0x230e72['checkIsTrunkReachable'](_0x45dcf6))[_0x9d6f('0xb4')](_0x230e72[_0x9d6f('0x13a')](_0x45dcf6[_0x9d6f('0x158')],_0x45dcf6[_0x9d6f('0x159')],_0x45dcf6[_0x9d6f('0x40')],_0x45dcf6))[_0x9d6f('0xb4')](_0x230e72['checkIfTimeIntervals'](_0x45dcf6[_0x9d6f('0x46')],_0x45dcf6['dialTimezone'],_0x45dcf6[_0x9d6f('0x40')],_0x45dcf6))[_0x9d6f('0xb4')](_0x230e72[_0x9d6f('0x154')](_0x45dcf6))[_0x9d6f('0xad')](loggerCatchQueueSummary(_0x9d6f('0x15a'),_0x45dcf6));}else{notSendMessagesCampaign(_0x45dcf6);}}}};function getCallerIdRandom(_0x576068,_0x383755){var _0x584f76;var _0xd938a6;var _0xdf72c8;if(_0x383755<=0x0){_0x383755=0x1;}_0x584f76=new RegExp('\x5cw{0,'+_0x383755+'}$');_0xd938a6=Math[_0x9d6f('0x15b')](0xa,_0x383755-0x1);_0xdf72c8=Math[_0x9d6f('0x15b')](0xa,_0x383755)-0x1;return util[_0x9d6f('0x75')]('%s',_['replace'](_0x576068,_0x584f76,_[_0x9d6f('0x15c')](_0xd938a6,_0xdf72c8)));}function extractCalleridName(_0x4f2769){var _0x960be7=_0x4f2769[_0x9d6f('0x15d')](/"(.*?)"/);return _0x960be7?_0x960be7[0x1]:_0x4f2769;}function extractCalleridNumber(_0x3e5711){var _0x25bacf=_0x3e5711[_0x9d6f('0x15d')](/<(.*?)>/);return _0x25bacf?_0x25bacf[0x1]:_0x3e5711;}Dialer[_0x9d6f('0x1b')][_0x9d6f('0x15e')]=function(_0x4b9ca0,_0x3f8aba){var _0x4a525e=this;var _0x141a22=uuid['v4']();this[_0x9d6f('0x26')][_0x141a22]=new Action(_0x4b9ca0,_0x3f8aba,_0x141a22);return new BPromise(function(_0x2dd48b,_0x44a863){if(_[_0x9d6f('0x3d')](_0x4b9ca0)&&typeof _0x4b9ca0!==_0x9d6f('0x15f')){return _0x44a863(msgResponse(_0x9d6f('0x160'),_0x9d6f('0x13d'),'voiceQueue\x20is\x20undefine'));}if(_[_0x9d6f('0x3d')](_0x3f8aba['Contact'][_0x9d6f('0x161')])||_0x3f8aba[_0x9d6f('0x162')][_0x9d6f('0x161')]===null){return _0x44a863(msgResponse('originate',_0x9d6f('0x13d'),_0x9d6f('0x163')));}var _0x2c959d={'XMD-CALLERID':_0x4a525e['actions'][_0x141a22][_0x9d6f('0x164')](),'XMD-AGI':_0x4b9ca0[_0x9d6f('0x104')]?util[_0x9d6f('0x75')](_0x9d6f('0x165'),ipAgi,_0x4b9ca0[_0x9d6f('0x104')]):_0x9d6f('0x166'),'XMD-AGIAFTER':_0x4b9ca0[_0x9d6f('0x113')]?util[_0x9d6f('0x75')](_0x9d6f('0x165'),ipAgi,_0x4b9ca0['dialQueueProject2']):_0x9d6f('0x166'),'XMD-QUEUE':_0x4b9ca0['type']===_0x9d6f('0x8c')?util[_0x9d6f('0x75')]('\x22%s,%s%s,,,%s\x22',_0x4b9ca0[_0x9d6f('0x40')],_0x4b9ca0[_0x9d6f('0x167')]||'',_0x4b9ca0[_0x9d6f('0x168')]?'c':'',_0x4b9ca0[_0x9d6f('0x10f')]||0x3):_0x9d6f('0x166'),'XMD-CONTACTID':_0x3f8aba[_0x9d6f('0xce')],'XMD-CDRTYPE':_0x9d6f('0x6'),'CALLERID(all)':_0x4a525e[_0x9d6f('0x26')][_0x141a22][_0x9d6f('0x164')](),'XMD-AMD':_0x4b9ca0['dialAMDActive']?_0x9d6f('0x169'):_0x9d6f('0x166'),'XMD-DESTINATION':_0x9d6f('0x16a')};if(_0x4b9ca0['dialAMDActive']){_0x2c959d['XMD-AMDINITIALSILENCE']=_0x4b9ca0[_0x9d6f('0x16b')]||0x9c4;_0x2c959d[_0x9d6f('0x16c')]=_0x4b9ca0[_0x9d6f('0x16d')]||0x5dc;_0x2c959d[_0x9d6f('0x16e')]=_0x4b9ca0['dialAMDAfterGreetingSilence']||0x320;_0x2c959d[_0x9d6f('0x16f')]=_0x4b9ca0['dialAMDTotalAnalysisTime']||0x1388;_0x2c959d[_0x9d6f('0x170')]=_0x4b9ca0[_0x9d6f('0x171')]||0x64;_0x2c959d['XMD-AMDBETWEENWORDSSILENCE']=_0x4b9ca0['dialAMDBetweenWordsSilence']||0x32;_0x2c959d[_0x9d6f('0x172')]=_0x4b9ca0['dialAMDMaximumNumberOfWords']||0x3;_0x2c959d[_0x9d6f('0x173')]=_0x4b9ca0[_0x9d6f('0x174')]||0x100;_0x2c959d[_0x9d6f('0x175')]=_0x4b9ca0[_0x9d6f('0x176')]||0x1388;}if(_0x4b9ca0[_0x9d6f('0x4f')]===_0x9d6f('0x8c')){_0x2c959d[_0x9d6f('0x177')]=_0x3f8aba[_0x9d6f('0xd1')];}else{_0x2c959d['XMD-CAMPAIGNID']=_0x3f8aba['CampaignId'];}for(var _0x76ed04 in _0x3f8aba[_0x9d6f('0x162')]){if(typeof _0x3f8aba[_0x9d6f('0x162')][_0x76ed04]!==_0x9d6f('0x95')){if(isNotNull(_0x3f8aba['Contact'][_0x76ed04])&&_0x76ed04!=='id'&&_0x76ed04!=='tags'&&_0x76ed04!=='createdAt'&&_0x76ed04!==_0x9d6f('0x178')){_0x2c959d[util[_0x9d6f('0x75')](_0x9d6f('0x179'),_0x9d6f('0x17a'),_[_0x9d6f('0x17b')](_0x76ed04))]=_0x3f8aba[_0x9d6f('0x162')][_0x76ed04];}}}var _0x1e4a96=_0x4a525e[_0x9d6f('0xd5')](_0x4b9ca0[_0x9d6f('0x74')])?getCallerId(_0x4b9ca0[_0x9d6f('0x74')][_0x9d6f('0x17c')],_0x4b9ca0[_0x9d6f('0x58')],_0x4b9ca0[_0x9d6f('0x17d')]>0x0?getCallerIdRandom(_0x4b9ca0[_0x9d6f('0x59')],_0x4b9ca0[_0x9d6f('0x17d')]):_0x4b9ca0['dialOriginateCallerIdNumber']):getCallerId(_[_0x9d6f('0xa9')](_0x4b9ca0[_0x9d6f('0x139')])?_0x4b9ca0[_0x9d6f('0x74')][_0x9d6f('0x17c')]:_0x4b9ca0['TrunkBackup']['callerid'],_0x4b9ca0[_0x9d6f('0x58')],_0x4b9ca0[_0x9d6f('0x17d')]>0x0?getCallerIdRandom(_0x4b9ca0[_0x9d6f('0x59')],_0x4b9ca0[_0x9d6f('0x17d')]):_0x4b9ca0[_0x9d6f('0x59')]);if(_0x1e4a96){_0x2c959d['XMD-ORIGINATECALLERIDNAME']=_0x4a525e[_0x9d6f('0x26')][_0x141a22][_0x9d6f('0x17e')]=extractCalleridName(_0x1e4a96);_0x2c959d['XMD-ORIGINATECALLERIDNUM']=_0x4a525e[_0x9d6f('0x26')][_0x141a22][_0x9d6f('0x17f')]=extractCalleridNumber(_0x1e4a96);}return ami['Action']({'actionid':_0x141a22,'action':_0x9d6f('0x160'),'channel':_0x4a525e[_0x9d6f('0xd5')](_0x4b9ca0[_0x9d6f('0x74')])?util[_0x9d6f('0x75')](_0x9d6f('0x180'),_0x4b9ca0[_0x9d6f('0x74')][_0x9d6f('0x40')],isNotNull(_0x4b9ca0[_0x9d6f('0x181')])?_0x4b9ca0['dialPrefix']['trim']()||'':'',_0x4b9ca0[_0x9d6f('0x182')]>0x0?_0x3f8aba[_0x9d6f('0x162')][_0x9d6f('0x161')]['substring'](_0x4b9ca0[_0x9d6f('0x182')]):_0x3f8aba[_0x9d6f('0x162')][_0x9d6f('0x161')]):util[_0x9d6f('0x75')]('SIP/%s/%s%s',_[_0x9d6f('0xa9')](_0x4b9ca0[_0x9d6f('0x139')])?_0x4b9ca0[_0x9d6f('0x74')][_0x9d6f('0x40')]:_0x4b9ca0[_0x9d6f('0x139')][_0x9d6f('0x40')],isNotNull(_0x4b9ca0['dialPrefix'])?_0x4b9ca0[_0x9d6f('0x181')][_0x9d6f('0x183')]()||'':'',_0x4b9ca0[_0x9d6f('0x182')]>0x0?_0x3f8aba[_0x9d6f('0x162')][_0x9d6f('0x161')][_0x9d6f('0x184')](_0x4b9ca0['dialCutDigit']):_0x3f8aba['Contact'][_0x9d6f('0x161')]),'callerid':_0x1e4a96,'Exten':_0x9d6f('0x16a'),'Context':_0x9d6f('0x185'),'Priority':'1','variable':_0x2c959d,'timeout':(_0x4b9ca0[_0x9d6f('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x141a22})[_0x9d6f('0xb4')](function(_0x35be94){return _0x2dd48b(_0x35be94);})[_0x9d6f('0xad')](function(_0x34f88a){_0x4b9ca0[_0x9d6f('0x60')]+=0x1;var _0x31c045=new History(_0x4a525e[_0x9d6f('0x26')][_0x141a22]);logger[_0x9d6f('0x91')](util['format'](_0x9d6f('0x186'),JSON[_0x9d6f('0x4a')](_0x34f88a)));_0x31c045[_0x9d6f('0xdf')]=0xe;_0x31c045[_0x9d6f('0xa3')]='OriginateError';_0x31c045[_0x9d6f('0xa5')]=moment()['format'](_0x9d6f('0xf6'));_0x31c045['endtime']=_0x31c045['starttime'];_0x4a525e['createHistory'](_0x31c045)['catch'](loggerCatch(_0x9d6f('0x187')));_0x4a525e['moveContactManagedDialer'](_0x31c045)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x187')))[_0x9d6f('0x1e')](function(){delete _0x4a525e[_0x9d6f('0x26')][_0x141a22];return _0x44a863(msgResponse(_0x9d6f('0x160'),_0x9d6f('0x49'),_0x9d6f('0x188')));});});});};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x30')]=function(_0x1ce35b){var _0x3e0244=this[_0x9d6f('0x26')][_0x1ce35b[_0x9d6f('0x123')]];if(_0x3e0244){delete this[_0x9d6f('0x26')][_0x1ce35b[_0x9d6f('0x123')]];_0x3e0244[_0x9d6f('0x10e')]=moment()[_0x9d6f('0x75')](_0x9d6f('0xf6'));var _0x32a673=_0x3e0244[_0x9d6f('0x4f')]===_0x9d6f('0x78')?this[_0x9d6f('0x21')][_0x3e0244[_0x9d6f('0xb0')]]:this[_0x9d6f('0x20')][_0x3e0244[_0x9d6f('0x189')]()];if(!this[_0x9d6f('0xd4')](_0x1ce35b[_0x9d6f('0x18a')])){this[_0x9d6f('0xb1')](_0x32a673);return this[_0x9d6f('0x18b')](_0x3e0244,_0x32a673,_0x1ce35b)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x9d6f('0x27')][_0x1ce35b[_0x9d6f('0xda')]]=_0x3e0244;}};Dialer['prototype'][_0x9d6f('0x18c')]=function(_0x1cc060,_0x3858b5,_0x36e122){var _0x3028aa=new History(_0x3858b5);if(_0x3028aa[_0x9d6f('0xe9')]+_0x3028aa[_0x9d6f('0xea')]+_0x3028aa['countnoanswerretry']+_0x3028aa[_0x9d6f('0xfe')]+_0x3028aa[_0x9d6f('0xff')]+_0x3028aa[_0x9d6f('0xec')]+_0x3028aa['countmachineretry']+_0x3028aa['countagentrejectretry']>=_0x36e122[_0x9d6f('0xef')]-0x1){return!![];}switch(_0x1cc060){case 0x3:if(_0x3028aa[_0x9d6f('0xeb')]>=_0x36e122[_0x9d6f('0x18d')]-0x1){return!![];}this[_0x9d6f('0xbc')]({'active':![],'countnoanswerretry':_0x3028aa[_0x9d6f('0xeb')]+=0x1,'scheduledat':moment()[_0x9d6f('0xf3')](_0x36e122['dialNoAnswerRetryFrequency'],_0x9d6f('0xf5'))[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x3028aa[_0x9d6f('0xce')],'ListId':_0x3028aa[_0x9d6f('0xcf')],'VoiceQueueId':_0x3028aa[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x3028aa['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x3028aa[_0x9d6f('0xe9')]>=_0x36e122[_0x9d6f('0x18e')]-0x1){return!![];}this[_0x9d6f('0xbc')]({'active':![],'countbusyretry':_0x3028aa[_0x9d6f('0xe9')]+=0x1,'scheduledat':moment()['add'](_0x36e122['dialBusyRetryFrequency'],_0x9d6f('0xf5'))[_0x9d6f('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3028aa[_0x9d6f('0xce')],'ListId':_0x3028aa[_0x9d6f('0xcf')],'VoiceQueueId':_0x3028aa['VoiceQueueId']||undefined,'CampaignId':_0x3028aa[_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x18f')));break;case 0x8:if(_0x3028aa[_0x9d6f('0xea')]>=_0x36e122[_0x9d6f('0x190')]-0x1){return!![];}this[_0x9d6f('0xbc')]({'active':![],'countcongestionretry':_0x3028aa['countcongestionretry']+=0x1,'scheduledat':moment()[_0x9d6f('0xf3')](_0x36e122[_0x9d6f('0x191')],_0x9d6f('0xf5'))[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x3028aa[_0x9d6f('0xce')],'ListId':_0x3028aa[_0x9d6f('0xcf')],'VoiceQueueId':_0x3028aa[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x3028aa['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3028aa[_0x9d6f('0xfe')]>=_0x36e122['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x9d6f('0xbc')]({'active':![],'countnosuchnumberretry':_0x3028aa['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x9d6f('0xf3')](_0x36e122['dialNoSuchNumberRetryFrequency'],'minutes')[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x3028aa[_0x9d6f('0xce')],'ListId':_0x3028aa[_0x9d6f('0xcf')],'VoiceQueueId':_0x3028aa['VoiceQueueId']||undefined,'CampaignId':_0x3028aa['CampaignId']||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x192')));}break;case 0xa:if(_0x3028aa[_0x9d6f('0xff')]>=_0x36e122[_0x9d6f('0x114')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x3028aa[_0x9d6f('0xff')]+=0x1,'scheduledat':moment()[_0x9d6f('0xf3')](_0x36e122['dialDropRetryFrequency'],_0x9d6f('0xf5'))['format'](_0x9d6f('0xf6')),'ContactId':_0x3028aa['ContactId'],'ListId':_0x3028aa['ListId'],'VoiceQueueId':_0x3028aa['VoiceQueueId']||undefined,'CampaignId':_0x3028aa[_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x117')));break;case 0xb:if(_0x3028aa[_0x9d6f('0xec')]>=_0x36e122[_0x9d6f('0x11f')]-0x1){return!![];}this[_0x9d6f('0xbc')]({'active':![],'countabandonedretry':_0x3028aa[_0x9d6f('0xec')]+=0x1,'scheduledat':moment()['add'](_0x36e122['dialAbandonedRetryFrequency'],'minutes')[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x3028aa[_0x9d6f('0xce')],'ListId':_0x3028aa[_0x9d6f('0xcf')],'VoiceQueueId':_0x3028aa['VoiceQueueId']||undefined,'CampaignId':_0x3028aa[_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3028aa[_0x9d6f('0xed')]>=_0x36e122[_0x9d6f('0x100')]-0x1){return!![];}this[_0x9d6f('0xbc')]({'active':![],'countmachineretry':_0x3028aa[_0x9d6f('0xed')]+=0x1,'scheduledat':moment()[_0x9d6f('0xf3')](_0x36e122[_0x9d6f('0xf4')],_0x9d6f('0xf5'))[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x3028aa[_0x9d6f('0xce')],'ListId':_0x3028aa[_0x9d6f('0xcf')],'VoiceQueueId':_0x3028aa[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x3028aa[_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xf8')));break;case 0x14:if(_0x3028aa[_0x9d6f('0xee')]>=_0x36e122['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x3028aa[_0x9d6f('0xee')]+=0x1,'scheduledat':moment()[_0x9d6f('0xf3')](_0x36e122['dialAgentRejectRetryFrequency'],'minutes')[_0x9d6f('0x75')](_0x9d6f('0xf6')),'ContactId':_0x3028aa[_0x9d6f('0xce')],'ListId':_0x3028aa[_0x9d6f('0xcf')],'VoiceQueueId':_0x3028aa['VoiceQueueId']||undefined,'CampaignId':_0x3028aa[_0x9d6f('0xf7')]||undefined})['catch'](loggerCatch(_0x9d6f('0x193')));break;default:return!![];}};Dialer['prototype'][_0x9d6f('0x18b')]=function(_0xf43045,_0x3079b8,_0x453bb7){var _0x2f4c01=this;var _0x25c383=new History(_0xf43045);return new BPromise(function(_0x2507ba,_0x5e0958){if(_['isUndefined'](_0x3079b8)&&typeof _0x3079b8!==_0x9d6f('0x15f')){return _0x5e0958(msgResponse(_0x9d6f('0x194'),_0x9d6f('0x13d'),_0x9d6f('0x195')));}if(_[_0x9d6f('0x3d')](_0x453bb7)&&typeof _0x453bb7!==_0x9d6f('0x15f')){return _0x5e0958(msgResponse('[callProgressDetecting]',_0x9d6f('0x13d'),_0x9d6f('0x196')));}switch(_0x453bb7[_0x9d6f('0x197')]){case'0':_0x3079b8[_0x9d6f('0x5f')]+=0x1;_0x25c383[_0x9d6f('0xdf')]=0x0;_0x25c383[_0x9d6f('0xa3')]=_0x9d6f('0x198');_0x25c383[_0x9d6f('0xfe')]+=0x1;_0x25c383[_0x9d6f('0xfd')]+=0x1;ami[_0x9d6f('0x4e')]('custom:agentnosuchnumber',ut[_0x9d6f('0xfa')](_0xf43045,_0x9d6f('0x199')));_0x2f4c01[_0x9d6f('0xc7')](_0x25c383)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0xe8')));if(_0x2f4c01[_0x9d6f('0x18c')](0x0,_0xf43045,_0x3079b8)){if(_0x25c383[_0x9d6f('0xfe')]>=_0x3079b8[_0x9d6f('0x19a')]){_0x2f4c01[_0x9d6f('0x19b')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x19c'));}else{_0x2f4c01[_0x9d6f('0xf0')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x19c'));}}break;case'3':_0x3079b8[_0x9d6f('0x19d')]+=0x1;_0x25c383[_0x9d6f('0xdf')]=0x3;_0x25c383['statedesc']=_0x9d6f('0x19e');_0x25c383[_0x9d6f('0xeb')]+=0x1;_0x25c383['countglobal']+=0x1;ami['emit'](_0x9d6f('0x19f'),ut[_0x9d6f('0xfa')](_0xf43045,_0x9d6f('0x1a0')));_0x2f4c01[_0x9d6f('0xc7')](_0x25c383)['catch'](loggerCatch(_0x9d6f('0x1a1')));if(_0x2f4c01['checkRetriveMax'](0x3,_0xf43045,_0x3079b8)){if(_0x25c383[_0x9d6f('0xeb')]>=_0x3079b8[_0x9d6f('0x18d')]){_0x2f4c01[_0x9d6f('0x19b')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1a2'));}else{_0x2f4c01['stateGlobal'](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1a2'));}}break;case'5':_0x3079b8[_0x9d6f('0x1a3')]+=0x1;_0x25c383[_0x9d6f('0xdf')]=0x5;_0x25c383[_0x9d6f('0xa3')]=_0x9d6f('0x1a4');_0x25c383[_0x9d6f('0xe9')]+=0x1;_0x25c383[_0x9d6f('0xfd')]+=0x1;ami['emit'](_0x9d6f('0x1a5'),ut[_0x9d6f('0xfa')](_0xf43045,_0x9d6f('0x1a6')));_0x2f4c01[_0x9d6f('0xc7')](_0x25c383)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x1a7')));if(_0x2f4c01[_0x9d6f('0x18c')](0x5,_0xf43045,_0x3079b8)){if(_0x25c383[_0x9d6f('0xe9')]>=_0x3079b8[_0x9d6f('0x18e')]){_0x2f4c01[_0x9d6f('0x19b')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1a8'));}else{_0x2f4c01['stateGlobal'](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1a8'));}}break;case'8':_0x3079b8[_0x9d6f('0x5d')]+=0x1;_0x25c383[_0x9d6f('0xdf')]=0x8;_0x25c383[_0x9d6f('0xa3')]=_0x9d6f('0x1a9');_0x25c383[_0x9d6f('0xea')]+=0x1;_0x25c383['countglobal']+=0x1;ami[_0x9d6f('0x4e')](_0x9d6f('0x1aa'),ut[_0x9d6f('0xfa')](_0xf43045,_0x9d6f('0x1ab')));_0x2f4c01[_0x9d6f('0xc7')](_0x25c383)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x1ac')));if(_0x2f4c01[_0x9d6f('0x18c')](0x8,_0xf43045,_0x3079b8)){if(_0x25c383['countcongestionretry']>=_0x3079b8[_0x9d6f('0x190')]){_0x2f4c01[_0x9d6f('0x19b')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1ad'));}else{_0x2f4c01['stateGlobal'](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1ad'));}}break;case'11':_0x3079b8['outboundAbandonedCallsDay']+=0x1;_0x25c383[_0x9d6f('0xdf')]=0xb;_0x25c383[_0x9d6f('0xa3')]=_0x9d6f('0x11c');_0x25c383['countabandonedretry']+=0x1;_0x25c383[_0x9d6f('0xfd')]+=0x1;_0x2f4c01[_0x9d6f('0xc7')](_0x25c383)['catch'](loggerCatch(_0x9d6f('0x120')));if(_0x2f4c01[_0x9d6f('0x18c')](0xb,_0xf43045,_0x3079b8)){if(_0x25c383[_0x9d6f('0xec')]>=_0x3079b8[_0x9d6f('0x11f')]){_0x2f4c01[_0x9d6f('0x19b')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1ae'));}else{_0x2f4c01[_0x9d6f('0xf0')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1ae'));}}break;case'20':_0x3079b8['outboundRejectCallsDay']+=0x1;_0x25c383[_0x9d6f('0xdf')]=0x14;_0x25c383['statedesc']=_0x9d6f('0x1af');_0x25c383[_0x9d6f('0xee')]+=0x1;_0x25c383[_0x9d6f('0xfd')]+=0x1;ami[_0x9d6f('0x4e')](_0x9d6f('0x1b0'),ut[_0x9d6f('0xfa')](_0xf43045,_0x9d6f('0x1b1')));_0x2f4c01[_0x9d6f('0xc7')](_0x25c383)[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x1b2')));if(_0x2f4c01[_0x9d6f('0x18c')](0x14,_0xf43045,_0x3079b8)){if(_0x25c383[_0x9d6f('0xee')]>=_0x3079b8[_0x9d6f('0x1b3')]){_0x2f4c01[_0x9d6f('0x19b')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1b4'));}else{_0x2f4c01[_0x9d6f('0xf0')](_0x25c383,_0x2507ba,_0x5e0958,_0x9d6f('0x1b4'));}}break;default:_0x3079b8['outboundUnknownCallsDay']+=0x1;_0x25c383[_0x9d6f('0xdf')]=0xc;_0x25c383['statedesc']=_0x453bb7[_0x9d6f('0x197')];_0x2f4c01[_0x9d6f('0xc7')](_0x25c383)['catch'](loggerCatch(_0x9d6f('0x1b5')));if(_0x2f4c01[_0x9d6f('0x18c')](_0x453bb7[_0x9d6f('0x197')],_0xf43045,_0x3079b8)){if(_0x25c383[_0x9d6f('0xe9')]+_0x25c383[_0x9d6f('0xea')]+_0x25c383[_0x9d6f('0xeb')]+_0x25c383[_0x9d6f('0xfe')]+_0x25c383[_0x9d6f('0xff')]+_0x25c383['countabandonedretry']+_0x25c383[_0x9d6f('0xed')]+_0x25c383[_0x9d6f('0xee')]>=_0x3079b8[_0x9d6f('0xef')]){_0x2f4c01[_0x9d6f('0xf0')](_0x25c383,_0x2507ba,_0x5e0958,_0x453bb7[_0x9d6f('0x197')]);}else{_0x2f4c01[_0x9d6f('0x19b')](_0x25c383,_0x2507ba,_0x5e0958,_0x453bb7['reason']);}}}});};Dialer[_0x9d6f('0x1b')]['stateGlobal']=function(_0x568cbe,_0x51fc36,_0x555944,_0x5368ec){var _0x5e06a8=new Final(_0x568cbe);_0x5e06a8[_0x9d6f('0xdf')]=0xf;_0x5e06a8[_0x9d6f('0xa3')]=_0x9d6f('0x1b6');this[_0x9d6f('0x19b')](_0x5e06a8,_0x51fc36,_0x555944,_0x5368ec);};Dialer[_0x9d6f('0x1b')]['createStateFinal']=function(_0x3447eb,_0x1a769d,_0x4594b3,_0xa610f5){this[_0x9d6f('0xc5')](_0x3447eb)['then'](function(){return _0x1a769d(msgResponse(_0x9d6f('0x194'),_0x9d6f('0x1b7'),_0xa610f5));})[_0x9d6f('0xad')](function(){return _0x4594b3(msgResponse(_0x9d6f('0x1b8'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x9')]=function(_0x4ff5e5){var _0x2dfc34=_0x4ff5e5[_0x9d6f('0x1b9')]/0x64;var _0x4e7da9=_0x4ff5e5[_0x9d6f('0x5e')]/(_0x4ff5e5[_0x9d6f('0x5e')]+_0x4ff5e5[_0x9d6f('0x5c')]);var _0x14e3f5=Math[_0x9d6f('0x1ba')](_0x4ff5e5[_0x9d6f('0x6c')]*(_0x4ff5e5[_0x9d6f('0x1bb')]/0x64));var _0x55bb9b=Math['round'](_0x4ff5e5[_0x9d6f('0x6c')]*(_0x4ff5e5['predictiveIntervalMinThreshold']/0x64));var _0x3530fb=_0x4ff5e5[_0x9d6f('0x52')]+_0x4ff5e5[_0x9d6f('0x9e')];var _0x402301=Math[_0x9d6f('0x1bc')](_0x4ff5e5[_0x9d6f('0x6f')]*_0x4ff5e5[_0x9d6f('0x71')]*_0x4ff5e5['predictiveIntervalHitRate']*_0x4ff5e5[_0x9d6f('0x6a')]);if(_[_0x9d6f('0x3d')](_0x4ff5e5[_0x9d6f('0x73')])){if(!_[_0x9d6f('0x3d')](_0x4ff5e5[_0x9d6f('0x28')])){_0x4ff5e5['startPredictive']=undefined;loggerPredictive[_0x9d6f('0x91')](_0x9d6f('0x1bd'),_0x9d6f('0x1be'));}if(!_[_0x9d6f('0x3d')](_0x4ff5e5[_0x9d6f('0x8b')])){loggerPredictive[_0x9d6f('0x91')](_0x9d6f('0x1bd'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4ff5e5[_0x9d6f('0x8b')]);_0x4ff5e5[_0x9d6f('0x8b')]=undefined;}_0x4ff5e5[_0x9d6f('0x73')]=moment()[_0x9d6f('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x9d6f('0x7b')](_0x4ff5e5[_0x9d6f('0x40')],_0x9d6f('0x1bf'),_0x4ff5e5[_0x9d6f('0x73')]);this['handlePower'](_0x4ff5e5,0x1);}else if(ifInterval(_0x4ff5e5[_0x9d6f('0x1c0')],_0x4ff5e5[_0x9d6f('0x73')])){this[_0x9d6f('0x150')](_0x4ff5e5,0x1);loggerPredictiveCalls[_0x9d6f('0x7b')](_0x9d6f('0x1c1'),_0x4ff5e5['startProgressive'],_0x4ff5e5['name']);_0x4ff5e5[_0x9d6f('0x6f')]=0x0;_0x4ff5e5[_0x9d6f('0x68')]=0x0;}else if(_0x2dfc34<_0x4e7da9&&_0x4ff5e5[_0x9d6f('0x1c2')]==='dropRate'){freeVariablesPredictive(_0x4ff5e5);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x1c3'),_0x9d6f('0x1c4'),_0x4e7da9,_0x9d6f('0x73'),_0x4ff5e5['name']);}else if(_0x402301<_0x4ff5e5['predictiveIntervalErlangCallsDroppedCalls']&&_0x4ff5e5['dialPredictiveOptimization']===_0x9d6f('0x1c5')){freeVariablesPredictive(_0x4ff5e5);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x1c6'),'Max\x20Drop\x20',_0x402301,'Drop\x20in\x20this\x20interval',_0x4ff5e5[_0x9d6f('0x68')],_0x9d6f('0x73'),_0x4ff5e5['name']);}else if(!ifInterval(_0x4ff5e5[_0x9d6f('0x1c0')],_0x4ff5e5['startProgressive'])&&_[_0x9d6f('0x3d')](_0x4ff5e5[_0x9d6f('0x28')])&&!_[_0x9d6f('0x3d')](_0x4ff5e5[_0x9d6f('0x73')])){_0x4ff5e5[_0x9d6f('0x28')]=moment()[_0x9d6f('0x75')](_0x9d6f('0xf6'));loggerPredictive[_0x9d6f('0x7b')](_0x4ff5e5[_0x9d6f('0x40')],_0x9d6f('0x1c7'),_0x4ff5e5[_0x9d6f('0x28')]);this[_0x9d6f('0xb9')](_0x4ff5e5['dialPredictiveInterval'])[_0x9d6f('0xb4')](this[_0x9d6f('0x1c8')](_0x4ff5e5))['then'](mergeDataErlangB(_0x4ff5e5))[_0x9d6f('0xb4')](this[_0x9d6f('0x1c9')](_0x4ff5e5))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x4ff5e5));}else if(!ifInterval(_0x4ff5e5[_0x9d6f('0x1c0')],_0x4ff5e5[_0x9d6f('0x28')])){_0x4ff5e5[_0x9d6f('0x68')]=0x0;_0x4ff5e5[_0x9d6f('0x28')]=moment()[_0x9d6f('0x75')](_0x9d6f('0xf6'));loggerPredictive[_0x9d6f('0x7b')](_0x4ff5e5[_0x9d6f('0x40')],_0x9d6f('0x1ca'),_0x4ff5e5[_0x9d6f('0x28')]);clearInterval(_0x4ff5e5[_0x9d6f('0x8b')]);_0x4ff5e5[_0x9d6f('0x8b')]=undefined;this[_0x9d6f('0xb9')](_0x4ff5e5['dialPredictiveInterval'])[_0x9d6f('0xb4')](this[_0x9d6f('0x1c8')](_0x4ff5e5))['then'](mergeDataErlangB(_0x4ff5e5))[_0x9d6f('0xb4')](this[_0x9d6f('0x1c9')](_0x4ff5e5))[_0x9d6f('0xad')](loggerCatchPredictive(_0x9d6f('0x1cb'),_0x4ff5e5));}else if(_0x4ff5e5[_0x9d6f('0x6c')]&&_0x3530fb<_0x4ff5e5['predictiveIntervalAvailable']-_0x55bb9b){freeVariablesPredictive(_0x4ff5e5);loggerPredictive[_0x9d6f('0x7b')](_0x4ff5e5[_0x9d6f('0x40')],_0x9d6f('0x1cc'),_0x3530fb,_0x9d6f('0x1cd'),_0x4ff5e5[_0x9d6f('0x6c')],'-',_0x55bb9b,'=',_0x4ff5e5[_0x9d6f('0x6c')]-_0x55bb9b,')');}else if(_0x4ff5e5[_0x9d6f('0x6c')]&&_0x3530fb>_0x4ff5e5['predictiveIntervalAvailable']+_0x14e3f5){freeVariablesPredictive(_0x4ff5e5);loggerPredictive[_0x9d6f('0x7b')](_0x4ff5e5[_0x9d6f('0x40')],_0x9d6f('0x1cc'),_0x3530fb,_0x9d6f('0x1ce'),_0x4ff5e5[_0x9d6f('0x6c')],'+',_0x14e3f5,'=',_0x4ff5e5['predictiveIntervalAvailable']+_0x14e3f5,')');}};Dialer['prototype'][_0x9d6f('0x1c8')]=function(_0x593945){var _0x549bf0=this;return function(_0x27158c){return new BPromise(function(_0x150ff3,_0x132fb8){_['merge'](_0x593945,_0x27158c[0x0]);if(checkGetDataPredictive(_0x27158c[0x0])){var _0x6daf04=_0x593945[_0x9d6f('0x6c')]=_0x593945[_0x9d6f('0x9e')]+_0x593945[_0x9d6f('0x52')];var _0x399cbc=_0x593945[_0x9d6f('0x1c0')]*0x3c;var _0x115611=_0x27158c[0x0][_0x9d6f('0x65')]+_0x27158c[0x0][_0x9d6f('0x64')];var _0x5da269=(_0x27158c[0x0]['predictiveIntervalAnsweredCalls']+_0x27158c[0x0][_0x9d6f('0x66')]+_0x27158c[0x0][_0x9d6f('0x7f')])/_0x27158c[0x0][_0x9d6f('0x6d')];_0x593945['predictiveIntervalHitRate']=_0x5da269>0x0?_0x5da269:0x1;switch(_0x593945[_0x9d6f('0x1c2')]){case'dropRate':var _0x284dc6=_0x593945['dialPredictiveOptimizationPercentage']/0x64;return _0x549bf0['abandonmentRate'](_0x6daf04,_0x399cbc,_0x115611,_0x5da269,_0x284dc6)[_0x9d6f('0xb4')](function(_0x552b23){return _0x150ff3(_0x552b23);});case'agentBusyFactor':var _0x570a5b=_0x593945['dialPredictiveOptimizationPercentage']/0x64;return _0x549bf0[_0x9d6f('0x1cf')](_0x6daf04,_0x399cbc,_0x115611,_0x5da269,_0x570a5b)['then'](function(_0xfa816e){return _0x150ff3(_0xfa816e);});default:return _0x132fb8(msgResponse('[getDataPredictive]',_0x9d6f('0x13d'),_0x9d6f('0x1d0')));}}else{return _0x132fb8(msgResponse(_0x9d6f('0x1d1'),'Failure',_0x9d6f('0x1d2')));}});};};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x1d3')]=function(_0x10e354){var _0x140e6d=this;return function(_0x1488c2){return new BPromise(function(_0x4b417c,_0x3d3f8a){_['merge'](_0x10e354,_0x1488c2[0x0]);if(checkGetDataPredictive(_0x1488c2[0x0])){loggerPredictive[_0x9d6f('0x7b')](JSON[_0x9d6f('0x4a')](_0x1488c2[0x0]));if(_0x10e354[_0x9d6f('0x1c2')]==='dropRate'){return _0x140e6d[_0x9d6f('0xc3')](_0x10e354['id'])[_0x9d6f('0xb4')](function(_0x391a69){var _0x3f9678=_0x10e354[_0x9d6f('0x157')]-_0x391a69[0x0][_0x9d6f('0x1d4')];var _0x421e2d=_0x10e354['dialPredictiveInterval']*0x3c;var _0x4c70e6=_0x1488c2[0x0][_0x9d6f('0x65')]+_0x1488c2[0x0][_0x9d6f('0x64')];var _0x5372bf=(_0x1488c2[0x0][_0x9d6f('0x63')]+_0x1488c2[0x0][_0x9d6f('0x66')]+_0x1488c2[0x0][_0x9d6f('0x7f')])/_0x1488c2[0x0][_0x9d6f('0x6d')];var _0x6fd02e=_0x10e354[_0x9d6f('0x1b9')]/0x64;_0x10e354[_0x9d6f('0x6b')]=_0x391a69[0x0][_0x9d6f('0x1d4')]||0x0;_0x10e354[_0x9d6f('0x69')]=_0x5372bf>0x0?_0x5372bf:0x1;return _0x140e6d[_0x9d6f('0x1d5')](_0x3f9678,_0x421e2d,_0x4c70e6,_0x5372bf,_0x6fd02e);})[_0x9d6f('0xb4')](function(_0x4c3ea6){return _0x4b417c(_0x4c3ea6);})[_0x9d6f('0xad')](function(_0x4d7cc6){return _0x3d3f8a(msgResponse('[CatchErlangB]','Failure',JSON[_0x9d6f('0x4a')](_0x4d7cc6)));});}if(_0x10e354[_0x9d6f('0x1c2')]===_0x9d6f('0x1d6')){return _0x140e6d[_0x9d6f('0xc3')](_0x10e354['id'])[_0x9d6f('0xb4')](function(_0x4ca754){var _0x409656=_0x10e354[_0x9d6f('0x157')]-_0x4ca754[0x0][_0x9d6f('0x1d4')];var _0xb632bd=_0x10e354[_0x9d6f('0x1c0')]*0x3c;var _0xe28c8=_0x1488c2[0x0][_0x9d6f('0x65')]+_0x1488c2[0x0][_0x9d6f('0x64')];var _0x58a05b=(_0x1488c2[0x0]['predictiveIntervalAnsweredCalls']+_0x1488c2[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1488c2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1488c2[0x0]['predictiveIntervalTotalCalls'];var _0x5cf48e=_0x10e354[_0x9d6f('0x1b9')]/0x64;_0x10e354['predictiveIntervalPauses']=_0x4ca754[0x0][_0x9d6f('0x1d4')]||0x0;_0x10e354[_0x9d6f('0x69')]=_0x58a05b>0x0?_0x58a05b:0x1;return _0x140e6d[_0x9d6f('0x1cf')](_0x409656,_0xb632bd,_0xe28c8,_0x58a05b,_0x5cf48e);})[_0x9d6f('0xb4')](function(_0x57e612){return _0x4b417c(_0x57e612);})[_0x9d6f('0xad')](function(_0x4a381b){return _0x3d3f8a(msgResponse(_0x9d6f('0x1d7'),_0x9d6f('0x13d'),JSON[_0x9d6f('0x4a')](_0x4a381b)));});}}else{return _0x3d3f8a(msgResponse(_0x9d6f('0x1d1'),_0x9d6f('0x13d'),_0x9d6f('0x1d2')));}});};};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x1c9')]=function(_0x135923){var _0x231625=this;return function(){var _0x1d3894=0x0;var _0x3a11cd=Math[_0x9d6f('0x1bc')](_0x135923[_0x9d6f('0x70')]*0x3e8);if(_0x3a11cd>0x0){_0x3a11cd=_0x3a11cd<0x64?0x64:_0x3a11cd;loggerPredictive['info'](_0x135923[_0x9d6f('0x40')],_0x9d6f('0x1d8'),_0x3a11cd,_0x9d6f('0x4b'));_0x135923['handlePredictive']=setInterval(function(){_0x231625[_0x9d6f('0x8b')](_0x135923);loggerPredictiveCalls[_0x9d6f('0x7b')](_0x9d6f('0x1d9'),_0x1d3894+=0x1);},_0x3a11cd);}else{loggerPredictive[_0x9d6f('0x7b')](_0x135923[_0x9d6f('0x40')],_0x9d6f('0x1da'));}};};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x1db')]=function(_0x47263c,_0x2b3b9f){var _0x590d25=this;return function(_0x3638f0){if(_[_0x9d6f('0x47')](_0x3638f0)){if(_['isNil'](_0x2b3b9f['UserId'])||!_0x2b3b9f[_0x9d6f('0x1dc')]){if(_0x47263c['dialMethod']===_0x9d6f('0x7')){_0x47263c[_0x9d6f('0x12a')]=_[_0x9d6f('0x3d')](_0x47263c[_0x9d6f('0x12a')])?!![]:_0x47263c[_0x9d6f('0x12a')];var _0x4d13bd=uuid['v4']();_0x590d25[_0x9d6f('0x26')][_0x4d13bd]=new Action(_0x47263c,_0x2b3b9f,_0x4d13bd);loggerBooked['info']('[booked][checkContactBlack]',_0x4d13bd,'queueStatusComplete:\x20',JSON[_0x9d6f('0x4a')](_0x47263c[_0x9d6f('0x12a')]),'Queue:\x20',_0x47263c[_0x9d6f('0x40')]);if(_0x47263c['queueStatusComplete']){_0x47263c[_0x9d6f('0x12a')]=![];_0x590d25[_0x9d6f('0x29')][_0x590d25['actions'][_0x4d13bd][_0x9d6f('0xb0')]]=[];ami[_0x9d6f('0xaa')]({'actionid':_0x4d13bd,'action':_0x9d6f('0x1dd'),'queue':_0x47263c[_0x9d6f('0x40')]})['catch'](function(){_0x590d25['updateOriginated'](_0x47263c);_0x590d25[_0x9d6f('0xbc')]({'active':![],'ContactId':_0x590d25['actions'][_0x4d13bd][_0x9d6f('0xce')],'ListId':_0x590d25['actions'][_0x4d13bd][_0x9d6f('0xcf')],'VoiceQueueId':_0x590d25['actions'][_0x4d13bd][_0x9d6f('0xd1')]||undefined,'CampaignId':_0x590d25['actions'][_0x4d13bd][_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x590d25[_0x9d6f('0x26')][_0x4d13bd];});}else{loggerBooked[_0x9d6f('0x7b')](_0x9d6f('0x1de'),JSON[_0x9d6f('0x4a')](_0x47263c[_0x9d6f('0x12a')]),_0x9d6f('0x1df'),_0x47263c[_0x9d6f('0x40')]);_0x590d25[_0x9d6f('0xb1')](_0x47263c);_0x590d25[_0x9d6f('0xbc')]({'active':![],'ContactId':_0x590d25[_0x9d6f('0x26')][_0x4d13bd][_0x9d6f('0xce')],'ListId':_0x590d25[_0x9d6f('0x26')][_0x4d13bd][_0x9d6f('0xcf')],'VoiceQueueId':_0x590d25[_0x9d6f('0x26')][_0x4d13bd][_0x9d6f('0xd1')]||undefined,'CampaignId':_0x590d25[_0x9d6f('0x26')][_0x4d13bd][_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x1e0')));delete _0x590d25[_0x9d6f('0x26')][_0x4d13bd];}}else{return _0x590d25[_0x9d6f('0x15e')](_0x47263c,_0x2b3b9f);}}else{if(getDiff(_0x2b3b9f['scheduledat'])<_0x47263c['dialRecallMeTimeout']*0x3c){if(_0x2b3b9f['Agent']&&!_0x2b3b9f['Agent'][_0x9d6f('0x1e1')]){_0x590d25[_0x9d6f('0x8d')][_0x9d6f('0x12c')](_0x2b3b9f['id'])[_0x9d6f('0x1e')](function(){_0x590d25[_0x9d6f('0xb1')](_0x47263c);});}else{_0x590d25[_0x9d6f('0xbd')]({'active':![]},_0x2b3b9f['id'],0x1)[_0x9d6f('0x1e')](function(){_0x590d25[_0x9d6f('0xb1')](_0x47263c);});}}else{_0x47263c['outboundReCallsDay']+=0x1;_0x590d25[_0x9d6f('0xb1')](_0x47263c);if(_0x47263c[_0x9d6f('0x1e2')]){_0x590d25[_0x9d6f('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b3b9f[_0x9d6f('0xce')],'ListId':_0x2b3b9f[_0x9d6f('0xcf')],'VoiceQueueId':_0x2b3b9f[_0x9d6f('0xd1')]||undefined,'CampaignId':_0x2b3b9f[_0x9d6f('0xf7')]||undefined})[_0x9d6f('0xad')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x590d25[_0x9d6f('0xc7')](createObjHistory(_0x47263c,_0x2b3b9f,_0x9d6f('0x1e3'),0x17,_0x9d6f('0x1e4')))[_0x9d6f('0xad')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x590d25[_0x9d6f('0xcc')](createObjHistory(_0x47263c,_0x2b3b9f,_0x9d6f('0x1e5'),0x16,_0x9d6f('0x1e6')),_0x9d6f('0x1e7'),_0x9d6f('0x1e8'));}}}}else{_0x47263c[_0x9d6f('0x1e9')]+=0x1;_0x590d25[_0x9d6f('0xcc')](createObjHistory(_0x47263c,_0x2b3b9f,_0x9d6f('0x1ea'),0xd,_0x9d6f('0x1eb')),_0x9d6f('0x1ec'),_0x9d6f('0x1ed'));throw'inBlackList';}};};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x155')]=function(_0x9ff64b){var _0x5229bd=this;var _0x5e8b43=_0x9ff64b[_0x9d6f('0x1ee')]-_0x9ff64b['originated']-_0x9ff64b[_0x9d6f('0xc0')];emitCampaignSummary(_0x9ff64b);if(_0x5e8b43>0x0){if(_0x5e8b43>this['maxNumberOriginate']){_0x5e8b43=this[_0x9d6f('0x24')];}_0x9ff64b[_0x9d6f('0xc0')]+=_0x5e8b43;this['getContactDialerIvr'](_0x9ff64b['id'],_0x5e8b43,_0x9ff64b[_0x9d6f('0x1ef')],_0x9ff64b)[_0x9d6f('0xb4')](function(_0x3e5f33){_0x9ff64b['temp']-=_0x5e8b43;_0x9ff64b[_0x9d6f('0xc0')]=_0x9ff64b['temp']>0x0?_0x9ff64b['temp']:0x0;if(!checkContactEmpty(_0x3e5f33)){_0x9ff64b[_0x9d6f('0x3e')]=_0x9d6f('0x9b');logger[_0x9d6f('0x7b')]('[getContactCampaign2][Empty]'+_0x9ff64b[_0x9d6f('0x40')]);}else{_0x9ff64b[_0x9d6f('0x6e')]+=_0x3e5f33[_0x9d6f('0x94')];_0x9ff64b[_0x9d6f('0x3e')]=_0x9d6f('0x1f0');for(var _0x437479=0x0;_0x437479<_0x3e5f33[_0x9d6f('0x94')];_0x437479+=0x1){_0x9ff64b[_0x9d6f('0x1f1')]+=0x1;if(_[_0x9d6f('0xa9')](_0x3e5f33[_0x437479])||_[_0x9d6f('0xa9')](_0x3e5f33[_0x437479]['Contact'])||_['isNil'](_0x3e5f33[_0x437479][_0x9d6f('0x162')][_0x9d6f('0x161')])){_0x5229bd[_0x9d6f('0xca')](_0x9d6f('0x1f2'),_0x9ff64b,_0x3e5f33[_0x437479]);}else{_0x5229bd['checkIsBlackListIvr'](_['pick'](_0x3e5f33[_0x437479],[_0x9d6f('0xf7'),'Contact.phone']))[_0x9d6f('0xb4')](_0x5229bd[_0x9d6f('0x1db')](_0x9ff64b,_0x3e5f33[_0x437479]))[_0x9d6f('0xad')](_0x5229bd[_0x9d6f('0xc9')]('[actionOriginateIvr]\x20',_0x9ff64b));}}}})['catch'](loggerGetContactDialer(_0x9d6f('0x1f3'),_0x9ff64b,_0x5e8b43));}};Dialer[_0x9d6f('0x1b')]['handlePower']=function(_0x3f6655,_0x443d7f){var _0x1b405b=this;var _0x5414fa=[];var _0x33545d=_0x443d7f>=0x1?_0x443d7f:0x1;if(_0x3f6655['dialMethod']===_0x9d6f('0x7')){_0x33545d=0x1;}var _0x4c70b3=Math[_0x9d6f('0x1bc')](_0x3f6655[_0x9d6f('0x52')]*_0x33545d)-_0x3f6655[_0x9d6f('0x6e')]-_0x3f6655[_0x9d6f('0xc0')];emitVoiceQueueSummary(_0x3f6655);if(_0x3f6655[_0x9d6f('0x1f4')]>0x0){var _0x43167f=_0x3f6655[_0x9d6f('0x1f4')]-_0x3f6655[_0x9d6f('0x6e')]-_0x3f6655[_0x9d6f('0x9e')]-_0x3f6655[_0x9d6f('0xc0')]-_0x3f6655['pTalking'];if(_0x4c70b3>_0x43167f){_0x4c70b3=_0x43167f;}}if(_0x4c70b3>0x0){if(_0x3f6655['dialMethod']===_0x9d6f('0x7')){_0x4c70b3=0x1;}if(_0x4c70b3>this[_0x9d6f('0x24')]){_0x4c70b3=this['maxNumberOriginate'];}_0x3f6655[_0x9d6f('0xc0')]+=_0x4c70b3;for(var _0x5133c8 in this[_0x9d6f('0x22')]){if(typeof this['agents'][_0x5133c8]!==_0x9d6f('0x95')){if(this[_0x9d6f('0x22')][_0x5133c8][_0x9d6f('0xdf')]===_0x9d6f('0x1f5')&&this[_0x9d6f('0x22')][_0x5133c8]['status']===_0x9d6f('0xd8')){_0x5414fa[_0x9d6f('0x128')](this[_0x9d6f('0x22')][_0x5133c8]['id']);}}}this[_0x9d6f('0xbf')](_0x3f6655['id'],_0x5414fa,_0x4c70b3,_0x3f6655[_0x9d6f('0x1ef')],_0x3f6655)[_0x9d6f('0xb4')](function(_0x345f9b){_0x3f6655['temp']-=_0x4c70b3;_0x3f6655['temp']=_0x3f6655[_0x9d6f('0xc0')]>0x0?_0x3f6655[_0x9d6f('0xc0')]:0x0;if(!checkContactEmpty(_0x345f9b)){_0x1b405b[_0x9d6f('0xb5')](_0x3f6655)[_0x9d6f('0xb4')](sendMessageReschedule(_0x3f6655))[_0x9d6f('0xad')](loggerCatch(_0x9d6f('0x1f6')));}else{_0x3f6655[_0x9d6f('0x6e')]+=_0x345f9b['length'];_0x3f6655['message']=_0x3f6655[_0x9d6f('0x14e')]==='booked'?_0x9d6f('0x169'):_0x9d6f('0x1f0');for(var _0x49c783=0x0;_0x49c783<_0x345f9b[_0x9d6f('0x94')];_0x49c783+=0x1){if(_[_0x9d6f('0xa9')](_0x345f9b[_0x49c783])||_[_0x9d6f('0xa9')](_0x345f9b[_0x49c783][_0x9d6f('0x162')])||_[_0x9d6f('0xa9')](_0x345f9b[_0x49c783][_0x9d6f('0x162')][_0x9d6f('0x161')])){_0x1b405b[_0x9d6f('0xca')](_0x9d6f('0x1f2'),_0x3f6655,_0x345f9b[_0x49c783]);}else{_0x1b405b['checkIsBlackList'](_[_0x9d6f('0xcd')](_0x345f9b[_0x49c783],[_0x9d6f('0xd1'),_0x9d6f('0x1f7')]))[_0x9d6f('0xb4')](_0x1b405b[_0x9d6f('0x1db')](_0x3f6655,_0x345f9b[_0x49c783]))[_0x9d6f('0xad')](_0x1b405b['loggerHandler'](_0x9d6f('0x1f2'),_0x3f6655));}}}})[_0x9d6f('0xad')](loggerGetContactDialer('[getContactDialer2]',_0x3f6655,_0x4c70b3));}};Dialer['prototype']['handlePredictive']=function(_0x1e6384){if(_0x1e6384[_0x9d6f('0x1f4')]>0x0){var _0x10797e=_0x1e6384[_0x9d6f('0x1f4')]-_0x1e6384['originated']-_0x1e6384[_0x9d6f('0x9e')];if(_0x10797e>0x0){this[_0x9d6f('0x1f8')](_0x1e6384);}else{loggerPredictiveCalls[_0x9d6f('0x7b')](_0x9d6f('0x1f9'));}}else{this[_0x9d6f('0x1f8')](_0x1e6384);}};Dialer['prototype'][_0x9d6f('0x1f8')]=function(_0x13d1bf){var _0x2211a6=this;var _0x303116=[];_0x13d1bf[_0x9d6f('0x6e')]+=0x1;for(var _0x4ad4d4 in this[_0x9d6f('0x22')]){if(typeof this[_0x9d6f('0x22')][_0x4ad4d4]!==_0x9d6f('0x95')){if(this['agents'][_0x4ad4d4][_0x9d6f('0xdf')]===_0x9d6f('0x1f5')&&this[_0x9d6f('0x22')][_0x4ad4d4][_0x9d6f('0xab')]===_0x9d6f('0xd8')){_0x303116[_0x9d6f('0x128')](this[_0x9d6f('0x22')][_0x4ad4d4]['id']);}}}this['getContactDialer'](_0x13d1bf['id'],_0x303116,0x1,_0x13d1bf[_0x9d6f('0x1ef')],_0x13d1bf)['then'](function(_0x4e6d69){if(!checkContactEmpty(_0x4e6d69)){checkContactLowerLimitOriginate(_0x13d1bf,0x1,0x0);_0x2211a6[_0x9d6f('0xb5')](_0x13d1bf)[_0x9d6f('0xb4')](sendMessageReschedule(_0x13d1bf))['catch'](loggerCatch(_0x9d6f('0x1f6')));}else{_0x13d1bf['message']='RUNNING';if(_[_0x9d6f('0xa9')](_0x4e6d69[0x0])||_['isNil'](_0x4e6d69[0x0][_0x9d6f('0x162')])||_[_0x9d6f('0xa9')](_0x4e6d69[0x0][_0x9d6f('0x162')][_0x9d6f('0x161')])){_0x2211a6[_0x9d6f('0xca')](_0x9d6f('0x1f2'),_0x13d1bf,_0x4e6d69[0x0]);}else{_0x2211a6[_0x9d6f('0xb6')](_[_0x9d6f('0xcd')](_0x4e6d69[0x0],[_0x9d6f('0xd1'),_0x9d6f('0x1f7')]))[_0x9d6f('0xb4')](_0x2211a6[_0x9d6f('0x1db')](_0x13d1bf,_0x4e6d69[0x0]))[_0x9d6f('0xad')](_0x2211a6[_0x9d6f('0xc9')](_0x9d6f('0x1fa'),_0x13d1bf));}}})[_0x9d6f('0xad')](loggerGetContactDialer(_0x9d6f('0x1fb'),_0x13d1bf,0x1));emitVoiceQueueSummary(_0x13d1bf);};Dialer['prototype'][_0x9d6f('0x1d5')]=function(_0x287ef9,_0x26ec43,_0x503f3b,_0x43f6d8,_0x48e768,_0x33806d){loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x1fc'));loggerPredictive[_0x9d6f('0x7b')]('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',_0x287ef9);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x1fd'),_0x26ec43);loggerPredictive[_0x9d6f('0x7b')]('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',_0x503f3b);loggerPredictive['info'](_0x9d6f('0x1fe'),_0x43f6d8);loggerPredictive['info'](_0x9d6f('0x1ff'),_0x48e768);loggerPredictive['info'](_0x9d6f('0x88'));return new BPromise(function(_0x5664e9,_0x276209){if(_0x287ef9<=0x0||isNaN(_0x287ef9)){return _0x276209(msgResponse(_0x9d6f('0x200'),_0x9d6f('0x49'),_0x9d6f('0x201')+_0x287ef9));}if(_0x503f3b<=0x0||isNaN(_0x503f3b)){return _0x276209(msgResponse(_0x9d6f('0x200'),_0x9d6f('0x49'),'Ts\x20=\x20'+_0x503f3b));}if(_0x43f6d8<=0x0||isNaN(_0x43f6d8)){return _0x276209(msgResponse('[abandonmentRate]','Error','p\x20=\x20'+_0x43f6d8));}if(_0x26ec43<=0x0||isNaN(_0x26ec43)){return _0x276209(msgResponse(_0x9d6f('0x200'),_0x9d6f('0x49'),_0x9d6f('0x202')+_0x26ec43));}if(_0x48e768<=0x0||isNaN(_0x48e768)){return _0x276209(msgResponse(_0x9d6f('0x200'),_0x9d6f('0x49'),_0x9d6f('0x203')+_0x48e768));}_0x33806d=_0x33806d||0x0;var _0x251f39=0x1/_0x503f3b;var _0x8d979b=0x0;var _0x48c4d0=0x0;var _0x36d62f=0x0;var _0x57658c=0x0;for(var _0x45ba82=0x0;_0x36d62f<_0x48e768;_0x45ba82+=0x1){_0x48c4d0=_0x45ba82/_0x26ec43;_0x8d979b=(_0x43f6d8*_0x48c4d0+_0x33806d)/_0x251f39;_0x36d62f=erlangb(_0x8d979b,_0x287ef9);_0x57658c=_0x8d979b/_0x287ef9*(0x1-erlangb(_0x8d979b,_0x287ef9));}return _0x5664e9({'erlangCalls':_0x45ba82,'erlangCallToSecond':_0x26ec43/_0x45ba82,'erlangAbandonmentRate':_0x36d62f,'erlangBusyFactor':_0x57658c});});};Dialer[_0x9d6f('0x1b')][_0x9d6f('0x1cf')]=function(_0x2dc7e7,_0x21ffeb,_0x583a53,_0x1e1342,_0xdcb85e,_0x4a020d){loggerPredictive['info'](_0x9d6f('0x204'));loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x205'),_0x2dc7e7);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x21ffeb);loggerPredictive['info'](_0x9d6f('0x206'),_0x583a53);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x1fe'),_0x1e1342);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x207'),_0xdcb85e);loggerPredictive[_0x9d6f('0x7b')](_0x9d6f('0x88'));return new BPromise(function(_0x5b4087,_0x37902b){if(_0x2dc7e7<=0x0||isNaN(_0x2dc7e7)){return _0x37902b(msgResponse(_0x9d6f('0x208'),'Error',_0x9d6f('0x201')+_0x2dc7e7));}if(_0x583a53<=0x0||isNaN(_0x583a53)){return _0x37902b(msgResponse(_0x9d6f('0x208'),_0x9d6f('0x49'),'Ts\x20=\x20'+_0x583a53));}if(_0x1e1342<=0x0||isNaN(_0x1e1342)){return _0x37902b(msgResponse(_0x9d6f('0x208'),'Error',_0x9d6f('0x209')+_0x1e1342));}if(_0x21ffeb<=0x0||isNaN(_0x21ffeb)){return _0x37902b(msgResponse(_0x9d6f('0x208'),'Error','interval\x20=\x20'+_0x21ffeb));}if(_0xdcb85e<=0x0||isNaN(_0xdcb85e)){return _0x37902b(msgResponse(_0x9d6f('0x208'),_0x9d6f('0x49'),_0x9d6f('0x20a')+_0xdcb85e));}_0x4a020d=_0x4a020d||0x0;var _0x2b9489=0x1/_0x583a53;var _0x49c7b4=0x0;var _0x42dd08=0x0;var _0x5b5a6d=0x0;var _0x5371dd=0x0;for(var _0x23880a=0x0;_0x5371dd<_0xdcb85e;_0x23880a+=0x1){_0x42dd08=_0x23880a/_0x21ffeb;_0x49c7b4=(_0x1e1342*_0x42dd08+_0x4a020d)/_0x2b9489;_0x5b5a6d=erlangb(_0x49c7b4,_0x2dc7e7);_0x5371dd=_0x49c7b4/_0x2dc7e7*(0x1-erlangb(_0x49c7b4,_0x2dc7e7));}return _0x5b4087({'erlangCalls':_0x23880a,'erlangCallToSecond':_0x21ffeb/_0x23880a,'erlangAbandonmentRate':_0x5b5a6d,'erlangBusyFactor':_0x5371dd});});};module[_0x9d6f('0x20b')]=Dialer; \ No newline at end of file +var _0xf0ab=['[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','actions','actionid','paused','stateinterface','locked','push','pick','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','iftime\x20%s,%s','content','indexOf','true','command','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','from-sip','OriginateError','[originate][error]','originate','Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','handleIvr','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','floor','dialLimitQueue','not_inuse','reachable','dialOrderByScheduledAt','ACTIVE','[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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','lodash','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','127.0.0.1','rrmemory','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','startProgressive','queueBooked','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','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','merge','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','prototype','clearZombieChannels','[uniqueid]','isNil','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','catch','[countReScheduled]\x20','[checkIsBlackList]\x20','then','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','HANGUP','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','dialAMDActive','value','MACHINE','Machine','countmachineretry','countglobal','custom:amd','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countbusyretry','countdropretry','minutes','YYYY-MM-DD\x20HH:mm:ss','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','syncAgentComplete','reason','agiafterat','[syncAgentComplete][createHistory]'];(function(_0x4be64f,_0x35c983){var _0x370f5a=function(_0x306bfa){while(--_0x306bfa){_0x4be64f['push'](_0x4be64f['shift']());}};_0x370f5a(++_0x35c983);}(_0xf0ab,0x10e));var _0xbf0a=function(_0x468756,_0x4f7d41){_0x468756=_0x468756-0x0;var _0x120528=_0xf0ab[_0x468756];return _0x120528;};'use strict';var util=require('util');var _=require(_0xbf0a('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xbf0a('0x1'));var rr=require('rr');var md5=require(_0xbf0a('0x2'));var Redis=require(_0xbf0a('0x3'));var ut=require(_0xbf0a('0x4'));var config=require(_0xbf0a('0x5'));var logger=require(_0xbf0a('0x6'))(_0xbf0a('0x7'));var loggerBooked=require(_0xbf0a('0x6'))(_0xbf0a('0x8'));var loggerPredictive=require(_0xbf0a('0x6'))(_0xbf0a('0x9'));var loggerPredictiveCalls=require(_0xbf0a('0x6'))(_0xbf0a('0xa'));var loggerSyncQueueSummary=require(_0xbf0a('0x6'))('syncQueueSummary');var ami=require('../ami');config[_0xbf0a('0xb')]=_[_0xbf0a('0xc')](config[_0xbf0a('0xb')],{'host':_0xbf0a('0xd'),'port':0x18eb});var io=require(_0xbf0a('0xe'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xbf0a('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xbf0a('0x10'));var Action=require(_0xbf0a('0x11'));var History=require('./history');var Final=require(_0xbf0a('0x12'));var AgentComplete=require(_0xbf0a('0x13'));var QueueCallerAbandon=require(_0xbf0a('0x14'));var Hangup=require(_0xbf0a('0x15'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xbf0a('0x16');var strategy={'rrmemory':_0xbf0a('0x17'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0xbf0a('0x18')]=function(_0x1c3532){this['tail']=this[_0xbf0a('0x19')]?this[_0xbf0a('0x19')]['finally'](_0x1c3532):_0x1c3532();};function Dialer(_0x350967,_0x28752b){this[_0xbf0a('0x1a')]=new Sequence();this['preview']=_0x28752b;this[_0xbf0a('0x1b')]=_0x350967[_0xbf0a('0x1b')];this[_0xbf0a('0x1c')]=_0x350967[_0xbf0a('0x1c')];this[_0xbf0a('0x1d')]=_0x350967[_0xbf0a('0x1d')];this[_0xbf0a('0x1e')]=_0x350967[_0xbf0a('0x1e')];this[_0xbf0a('0x1f')]=config[_0xbf0a('0x1f')]||0x2;this[_0xbf0a('0x20')]={};this['actions']={};this['contactsId']={};this[_0xbf0a('0x21')]={};this['optionPredictive']={};this['startPredictive']={};this[_0xbf0a('0x22')]={};this['ivrOriginated']={};this[_0xbf0a('0x23')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0xbf0a('0x24')][_0xbf0a('0x25')](this));ami['on'](_0xbf0a('0x26'),this[_0xbf0a('0x27')][_0xbf0a('0x25')](this));ami['on'](_0xbf0a('0x28'),this[_0xbf0a('0x29')][_0xbf0a('0x25')](this));ami['on'](_0xbf0a('0x2a'),this['syncAgentComplete']['bind'](this));ami['on'](_0xbf0a('0x2b'),this[_0xbf0a('0x2c')][_0xbf0a('0x25')](this));ami['on'](_0xbf0a('0x2d'),this[_0xbf0a('0x2e')][_0xbf0a('0x25')](this));ami['on']('newexten',this[_0xbf0a('0x2f')][_0xbf0a('0x25')](this));ami['on']('varset',this[_0xbf0a('0x30')][_0xbf0a('0x25')](this));ami['on']('queuemember',this[_0xbf0a('0x31')]['bind'](this));ami['on'](_0xbf0a('0x32'),this[_0xbf0a('0x33')][_0xbf0a('0x25')](this));this[_0xbf0a('0x34')]();this['loopClearZombieChannels']();}function isNotNull(_0x527539){return _0x527539!==null&&!_[_0xbf0a('0x35')](_0x527539);}function checkIsLoggedIn(_0x437b54,_0x1b51cd){return function(){if(_0x1b51cd<=0x0){_0x437b54['message']=_0xbf0a('0x36');throw _0x437b54[_0xbf0a('0x37')]+_0xbf0a('0x38');}};}function isActive(_0x4075b5){return _0x4075b5;}function checkIsActive(_0x3ea33b,_0x45554b){return function(){if(!isActive(_0x45554b)){_0x3ea33b[_0xbf0a('0x39')]=_0xbf0a('0x3a');throw _0x3ea33b['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x46b1a8){return function(){if(!isNotNull(_0x46b1a8[_0xbf0a('0x3b')])){_0x46b1a8[_0xbf0a('0x39')]='INTERVAL_IS_NULL';throw _0x46b1a8[_0xbf0a('0x37')]+_0xbf0a('0x3c');}if(!isNotNull(_0x46b1a8['Interval'][_0xbf0a('0x3d')])){_0x46b1a8[_0xbf0a('0x39')]=_0xbf0a('0x3e');throw _0x46b1a8['name']+_0xbf0a('0x3c');}if(!isNotNull(_[_0xbf0a('0x3f')](_0x46b1a8[_0xbf0a('0x3b')]['Intervals']))){_0x46b1a8[_0xbf0a('0x39')]=_0xbf0a('0x3e');throw _0x46b1a8[_0xbf0a('0x37')]+_0xbf0a('0x3c');}};}function msgResponse(_0x1a1343,_0x429e3a,_0x342630){return{'action':_0x1a1343,'response':_0x429e3a,'message':_0x342630,'stack':_0x342630};}function myreject(_0x8831f6){return function(_0x5bf59e){return _0x8831f6(msgResponse(_0xbf0a('0x40'),'Error',JSON[_0xbf0a('0x41')](_0x5bf59e)));};}function getSeconds(_0x3a44ec,_0xb20f31){var _0x1edd71=moment(_0x3a44ec)[_0xbf0a('0x42')](0x0);var _0x4e8564=moment(_0xb20f31)[_0xbf0a('0x42')](0x0);return _0x1edd71[_0xbf0a('0x43')](_0x4e8564,_0xbf0a('0x44'));}function emit(_0x393f51,_0x37e49d,_0x4762fa){io['to'](_0x393f51)[_0xbf0a('0x45')](_0x37e49d,_0x4762fa);}function emitVoiceQueueSummary(_0x2c9691){if(_0x2c9691[_0xbf0a('0x46')]===_0xbf0a('0x47')){var _0x4bf076={'id':_0x2c9691['id'],'name':_0x2c9691[_0xbf0a('0x37')],'strategy':_0x2c9691[_0xbf0a('0x48')],'answered':_0x2c9691[_0xbf0a('0x49')],'available':_0x2c9691[_0xbf0a('0x4a')],'loggedIn':_0x2c9691[_0xbf0a('0x4b')],'pTalking':_0x2c9691['pTalking'],'sumBillable':_0x2c9691[_0xbf0a('0x4c')],'sumDuration':_0x2c9691[_0xbf0a('0x4d')],'sumHoldTime':_0x2c9691[_0xbf0a('0x4e')]||0x0,'talking':_0x2c9691[_0xbf0a('0x4f')],'total':_0x2c9691[_0xbf0a('0x50')],'type':_0x2c9691['type'],'unmanaged':_0x2c9691[_0xbf0a('0x51')],'abandoned':_0x2c9691[_0xbf0a('0x52')],'waiting':_0x2c9691[_0xbf0a('0x53')],'loggedInDb':_0x2c9691[_0xbf0a('0x54')],'dialActive':_0x2c9691['dialActive'],'dialMethod':_0x2c9691[_0xbf0a('0x55')],'dialOriginateCallerIdName':_0x2c9691['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2c9691[_0xbf0a('0x56')],'dialOriginateTimeout':_0x2c9691[_0xbf0a('0x57')],'dialPrefix':_0x2c9691[_0xbf0a('0x58')],'outboundAnswerAgiCallsDay':_0x2c9691[_0xbf0a('0x59')],'outboundAnswerCallsDay':_0x2c9691[_0xbf0a('0x5a')],'outboundBlacklistCallsDay':_0x2c9691['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2c9691[_0xbf0a('0x5b')],'outboundCongestionCallsDay':_0x2c9691[_0xbf0a('0x5c')],'outboundDropCallsDayACS':_0x2c9691[_0xbf0a('0x5d')],'outboundDropCallsDayCallersExit':_0x2c9691['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2c9691[_0xbf0a('0x5e')],'outboundNoAnswerCallsDay':_0x2c9691['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2c9691[_0xbf0a('0x5f')],'outboundOriginateFailureCallsDay':_0x2c9691[_0xbf0a('0x60')],'outboundReCallsDay':_0x2c9691[_0xbf0a('0x61')],'outboundRejectCallsDay':_0x2c9691[_0xbf0a('0x62')],'outboundUnknownCallsDay':_0x2c9691[_0xbf0a('0x63')],'predictiveIntervalAnsweredCalls':_0x2c9691[_0xbf0a('0x64')],'predictiveIntervalAvgHoldtime':_0x2c9691[_0xbf0a('0x65')],'predictiveIntervalAvgTalktime':_0x2c9691[_0xbf0a('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x2c9691['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2c9691['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x2c9691[_0xbf0a('0x67')],'predictiveIntervalErlangCallsDroppedCalls':_0x2c9691[_0xbf0a('0x68')],'predictiveIntervalHitRate':_0x2c9691['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2c9691['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2c9691[_0xbf0a('0x69')],'predictiveIntervalAvailable':_0x2c9691[_0xbf0a('0x6a')],'predictiveIntervalTotalCalls':_0x2c9691[_0xbf0a('0x6b')],'message':_0x2c9691['message'],'originated':_0x2c9691[_0xbf0a('0x6c')],'erlangCalls':_0x2c9691[_0xbf0a('0x6d')],'erlangCallToSecond':_0x2c9691[_0xbf0a('0x6e')],'erlangAbandonmentRate':_0x2c9691[_0xbf0a('0x6f')],'erlangBusyFactor':_0x2c9691[_0xbf0a('0x70')],'startPredictive':_0x2c9691['startPredictive'],'startProgressive':_0x2c9691[_0xbf0a('0x22')]};if(_0x2c9691['Trunk']){_0x4bf076[_0xbf0a('0x71')]={'id':_0x2c9691[_0xbf0a('0x71')]['id'],'name':_0x2c9691[_0xbf0a('0x71')]['name'],'active':_0x2c9691[_0xbf0a('0x71')][_0xbf0a('0x72')],'callerid':_0x2c9691['Trunk'][_0xbf0a('0x73')]};}if(_0x2c9691[_0xbf0a('0x3b')]){_0x4bf076[_0xbf0a('0x3b')]={'id':_0x2c9691['Interval']['id'],'name':_0x2c9691[_0xbf0a('0x3b')][_0xbf0a('0x37')]};}var _0x5db7b0=md5(JSON[_0xbf0a('0x41')](_0x4bf076));if(_0x2c9691[_0xbf0a('0x2')]!==_0x5db7b0){_0x2c9691[_0xbf0a('0x2')]=_0x5db7b0;emit(util[_0xbf0a('0x74')](_0xbf0a('0x75'),_0x4bf076[_0xbf0a('0x37')]),'voice_queue:save',_0x4bf076);}}}function emitCampaignSummary(_0xd9cafb){if(_0xd9cafb[_0xbf0a('0x46')]===_0xbf0a('0x76')){emit(util[_0xbf0a('0x74')](_0xbf0a('0x77'),_0xd9cafb[_0xbf0a('0x37')]),_0xbf0a('0x78'),_0xd9cafb);}}function checkGetDataPredictive(_0x3c298d){if(isNotNull(_0x3c298d)&&!_[_0xbf0a('0x3f')](_0x3c298d)){loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x7a'));loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x7b'),_0x3c298d[_0xbf0a('0x6b')]);loggerPredictive['info'](_0xbf0a('0x7c'),_0x3c298d[_0xbf0a('0x64')]);loggerPredictive['info'](_0xbf0a('0x7d'),_0x3c298d[_0xbf0a('0x7e')]);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x7f'),_0x3c298d[_0xbf0a('0x80')]);loggerPredictive['info'](_0xbf0a('0x81'),_0x3c298d[_0xbf0a('0x65')]);loggerPredictive[_0xbf0a('0x79')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c298d[_0xbf0a('0x66')]);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x82'));if(_0x3c298d[_0xbf0a('0x6b')]>0x0){if(!_[_0xbf0a('0x35')](_0x3c298d['predictiveIntervalAvgTalktime'])&&_0x3c298d[_0xbf0a('0x66')]>0x0){return!![];}loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x83'));if(!_[_0xbf0a('0x35')](_0x3c298d[_0xbf0a('0x65')])&&_0x3c298d['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x84'));}else{loggerPredictive['info'](_0xbf0a('0x85'));}}else{loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x86'));}return![];}function mergeDataErlangB(_0x3586e0){return function(_0x8fb3a5){loggerPredictive['info'](_0xbf0a('0x87'));loggerPredictive[_0xbf0a('0x79')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x8fb3a5[_0xbf0a('0x6d')]);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x88'),_0x8fb3a5['erlangCallToSecond']);loggerPredictive[_0xbf0a('0x79')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x8fb3a5[_0xbf0a('0x6f')]);loggerPredictive['info'](_0xbf0a('0x89'),_0x8fb3a5[_0xbf0a('0x70')]);loggerPredictive[_0xbf0a('0x79')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x8fb3a5[_0xbf0a('0x6f')]);loggerPredictive[_0xbf0a('0x79')]('---------------------------');_[_0xbf0a('0x8a')](_0x3586e0,_0x8fb3a5);};}function getDiff(_0x54551b){var _0x355ff3=moment()[_0xbf0a('0x42')](0x0);var _0x3ad2a7=moment(_0x54551b)[_0xbf0a('0x42')](0x0);return _0x355ff3[_0xbf0a('0x43')](_0x3ad2a7,_0xbf0a('0x44'));}function ifInterval(_0x1dfa48,_0x5dc5a0){if(_[_0xbf0a('0x35')](_0x5dc5a0)){return![];}return getDiff(_0x5dc5a0)<_0x1dfa48*0x3c;}function freeVariablesPredictive(_0x93e4ed){if(isNotNull(_0x93e4ed)){if(!_[_0xbf0a('0x35')](_0x93e4ed[_0xbf0a('0x22')])){_0x93e4ed[_0xbf0a('0x22')]=undefined;loggerPredictive[_0xbf0a('0x79')](_0x93e4ed[_0xbf0a('0x37')],_0xbf0a('0x8b'));}if(!_[_0xbf0a('0x35')](_0x93e4ed[_0xbf0a('0x8c')])){_0x93e4ed[_0xbf0a('0x8c')]=undefined;loggerPredictive['info'](_0x93e4ed[_0xbf0a('0x37')],_0xbf0a('0x8d'));}if(!_[_0xbf0a('0x35')](_0x93e4ed[_0xbf0a('0x8e')])){clearInterval(_0x93e4ed[_0xbf0a('0x8e')]);_0x93e4ed[_0xbf0a('0x8e')]=undefined;loggerPredictive['info'](_0x93e4ed[_0xbf0a('0x37')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4ef330,_0x1a2dcd){if(_0x1a2dcd===0x0){return 0x0;}var _0x3b9836=0x1;for(var _0x2da51d=0x1;_0x2da51d<=_0x1a2dcd;_0x2da51d+=0x1){_0x3b9836=0x1+_0x3b9836*_0x2da51d/_0x4ef330;}return 0x1/_0x3b9836;}function isVoiceQueueOutbound(_0x9aad1f){return _0x9aad1f===_0xbf0a('0x47');}function isNotPreview(_0x15f57f){return _0x15f57f!==_0xbf0a('0x8f');}function isCampaignIvr(_0xc93229){return _0xc93229===_0xbf0a('0x76');}function getCallerId(_0x385ec1,_0x480a9d,_0x109504){if(!_[_0xbf0a('0x35')](_0x109504)&&typeof _0x109504===_0xbf0a('0x90')&&!_[_0xbf0a('0x3f')](_0x109504)){if(!_[_0xbf0a('0x35')](_0x480a9d)&&typeof _0x480a9d===_0xbf0a('0x90')&&!_[_0xbf0a('0x3f')](_0x480a9d)){return util[_0xbf0a('0x74')](_0xbf0a('0x91'),_0x480a9d,_0x109504);}return util[_0xbf0a('0x74')](_0xbf0a('0x91'),_0x109504,_0x109504);}if(!_['isUndefined'](_0x385ec1)&&typeof _0x385ec1==='string'&&!_[_0xbf0a('0x3f')](_0x385ec1)){return _0x385ec1;}return _0xbf0a('0x92');}function loggerCatchQueueSummary(_0x2e0002,_0x81d300){return function(_0x5010b9){freeVariablesPredictive(_0x81d300);emitVoiceQueueSummary(_0x81d300);emitCampaignSummary(_0x81d300);loggerSyncQueueSummary[_0xbf0a('0x93')](_0x2e0002,util[_0xbf0a('0x94')](_0x5010b9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x591ec7,_0x36f1e1){return function(_0x2775cc){loggerPredictive[_0xbf0a('0x93')](_0x36f1e1[_0xbf0a('0x37')],_0x591ec7);loggerPredictive[_0xbf0a('0x93')](_0x2775cc['stack']);freeVariablesPredictive(_0x36f1e1);};}function loggerCatch(_0x5289ac){return function(_0x188a7e){logger['error'](_0x5289ac,util[_0xbf0a('0x94')](_0x188a7e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x582f06){return _0x582f06&&!_[_0xbf0a('0x35')](_0x582f06)&&_0x582f06[_0xbf0a('0x95')]>0x0;}function decremetOriginate(_0x5f4760){if(!_[_0xbf0a('0x35')](_0x5f4760)&&_0x5f4760!==null){if(typeof _0x5f4760[_0xbf0a('0x6c')]!==_0xbf0a('0x96')){if(_0x5f4760[_0xbf0a('0x6c')]>0x0){_0x5f4760['originated']-=0x1;}else{logger[_0xbf0a('0x93')](_0xbf0a('0x97'));}}}else{logger[_0xbf0a('0x93')](_0xbf0a('0x98'));}}function checkContactLowerLimitOriginate(_0x45c3c7,_0x473dc9,_0x410c43){if(_0x473dc9>_0x410c43){for(var _0x2d6080=0x0;_0x2d6080<_0x473dc9-_0x410c43;_0x2d6080+=0x1){decremetOriginate(_0x45c3c7);}}}function loggerGetContactDialer(_0x5a1d6e,_0x181b79,_0x10fa3d){return function(_0x2110c9){checkContactLowerLimitOriginate(_0x181b79,_0x10fa3d,0x0);logger[_0xbf0a('0x93')](_0x5a1d6e,util[_0xbf0a('0x94')](_0x2110c9,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5bf393){return function(_0x24f718){if(isNotNull(_0x24f718)&&isNotNull(_0x24f718[0x0])){if(_0x24f718[0x0][_0xbf0a('0x99')]>0x0){_0x5bf393[_0xbf0a('0x39')]=_0xbf0a('0x9a');logger[_0xbf0a('0x79')](_0xbf0a('0x9b')+_0x5bf393[_0xbf0a('0x37')],_0x24f718[0x0][_0xbf0a('0x99')],_0xbf0a('0x9c'));}else{_0x5bf393[_0xbf0a('0x39')]=_0xbf0a('0x9d');logger[_0xbf0a('0x79')](_0xbf0a('0x9e')+_0x5bf393[_0xbf0a('0x37')]);}}};}function notSendMessagesQueue(_0x637be7){if(_0x637be7['sendMessageOneNotActive']){freeVariablesPredictive(_0x637be7);if(_0x637be7[_0xbf0a('0x6c')]===0x0&&_0x637be7['talking']===0x0&&_0x637be7[_0xbf0a('0x53')]===0x0&&(_0x637be7[_0xbf0a('0x9f')]||0x0)===0x0){_0x637be7[_0xbf0a('0xa0')]=![];_0x637be7[_0xbf0a('0x4a')]=0x0;_0x637be7[_0xbf0a('0x39')]=_0xbf0a('0x3a');loggerSyncQueueSummary[_0xbf0a('0x93')](_0xbf0a('0xa1'),_0x637be7['name'],_0xbf0a('0xa2'));}else{_0x637be7[_0xbf0a('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xbf0a('0xa1'),_0x637be7[_0xbf0a('0x37')],'is\x20disactive');}emitVoiceQueueSummary(_0x637be7);}}function notSendMessagesCampaign(_0x1d4672){if(_0x1d4672[_0xbf0a('0xa0')]){if(_0x1d4672[_0xbf0a('0x6c')]===0x0){_0x1d4672[_0xbf0a('0xa0')]=![];_0x1d4672[_0xbf0a('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xbf0a('0xa3'),_0x1d4672['name'],_0xbf0a('0xa2'));}else{_0x1d4672[_0xbf0a('0x39')]=_0xbf0a('0xa4');loggerSyncQueueSummary[_0xbf0a('0x93')](_0xbf0a('0xa3'),_0x1d4672[_0xbf0a('0x37')],_0xbf0a('0xa5'));}emitCampaignSummary(_0x1d4672);}}function createObjHistory(_0x520a00,_0x2017c8,_0xffe1d9,_0x3ca68f,_0x1793ff){_0x520a00[_0xbf0a('0x39')]=_0xffe1d9;var _0x1036aa=new Action(_0x520a00,_0x2017c8);var _0x12e70c=new History(_0x1036aa);_0x12e70c[_0xbf0a('0xa6')]=_0x3ca68f;_0x12e70c[_0xbf0a('0xa7')]=_0x1793ff;_0x12e70c[_0xbf0a('0xa8')]=_0x1036aa['starttime'];return _0x12e70c;}Dialer[_0xbf0a('0xa9')]['loopClearZombieChannels']=function(){var _0x5e6312=this;setInterval(function(){_0x5e6312[_0xbf0a('0xaa')](_0x5e6312['uniqueId'],_0xbf0a('0xab'));_0x5e6312['clearZombieChannels'](_0x5e6312['actions'],'[actions]');},0x32c8);};Dialer[_0xbf0a('0xa9')]['clearZombieChannels']=function(_0xd1a2a0,_0x3c01d9){var _0x1dd87b=this;for(var _0x114e6c in _0xd1a2a0){if(typeof _0xd1a2a0[_0x114e6c]!==_0xbf0a('0x96')){this[_0xbf0a('0x1a')][_0xbf0a('0x18')](function(){if(!_[_0xbf0a('0xac')](_0xd1a2a0[_0x114e6c])){return ami['Action']({'action':_0xbf0a('0xad'),'channel':_0xd1a2a0[_0x114e6c][_0xbf0a('0xae')]})['catch'](function(_0x44718e){if(_0x44718e[_0xbf0a('0x39')]===_0xbf0a('0xaf')){setTimeout(function(){if(_0xd1a2a0[_0x114e6c]&&_0xd1a2a0[_0x114e6c][_0xbf0a('0x46')]!==_0xbf0a('0x76')){_0x1dd87b[_0xbf0a('0xb0')](_0x1dd87b['voiceQueues'][_0xd1a2a0[_0x114e6c][_0xbf0a('0xb1')]]);logger[_0xbf0a('0x93')](_0xbf0a('0xb2'),_0x3c01d9,_0x114e6c,_0xd1a2a0[_0x114e6c][_0xbf0a('0xb1')]);delete _0xd1a2a0[_0x114e6c];}if(_0xd1a2a0[_0x114e6c]&&_0xd1a2a0[_0x114e6c][_0xbf0a('0x46')]===_0xbf0a('0x76')){_0x1dd87b[_0xbf0a('0xb0')](_0x1dd87b[_0xbf0a('0x1c')][_0xd1a2a0[_0x114e6c][_0xbf0a('0xb1')]]);logger[_0xbf0a('0x93')](_0xbf0a('0xb3'),_0x3c01d9,_0x114e6c,_0xd1a2a0[_0x114e6c][_0xbf0a('0xb1')]);delete _0xd1a2a0[_0x114e6c];}},0x2328);}});}});}}};Dialer[_0xbf0a('0xa9')]['countReScheduled']=function(_0x3e02f2){return BPromise[_0xbf0a('0xb4')]()['then'](cmHopper[_0xbf0a('0xb5')](_0x3e02f2))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xb7')));};Dialer[_0xbf0a('0xa9')]['checkIsBlackList']=function(_0x4ece01){return BPromise[_0xbf0a('0xb4')]()['then'](cmHopperBlack['checkIsBlackList'](_0x4ece01))['catch'](loggerCatch(_0xbf0a('0xb8')));};Dialer[_0xbf0a('0xa9')]['checkIsBlackListIvr']=function(_0x3436cb){return BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](cmHopperBlack['checkIsBlackListIvr'](_0x3436cb))[_0xbf0a('0xb6')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xba')]=function(_0x34e244){return BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](cmHopperHistory[_0xbf0a('0xbb')](_0x34e244))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xbc')));};Dialer[_0xbf0a('0xa9')]['rescheduleContact']=function(_0x272b89){return BPromise['resolve']()[_0xbf0a('0xb9')](cmHopper[_0xbf0a('0xbd')](_0x272b89))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xbe')));};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xbf')]=function(_0x1d6b80,_0x1d5983,_0x20de7c){return BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](cmHopper[_0xbf0a('0xbf')](_0x1d6b80,_0x1d5983,_0x20de7c))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xc0')));};Dialer['prototype'][_0xbf0a('0xc1')]=function(_0x177069,_0x325d62,_0x704ba6,_0x344522,_0x55885b){return BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](cmHopper[_0xbf0a('0xc1')](_0x177069,_0x325d62,_0x704ba6,_0x344522))[_0xbf0a('0xb6')](function(_0x1e7235){_0x55885b[_0xbf0a('0xc2')]-=_0x704ba6;_0x55885b[_0xbf0a('0xc2')]=_0x55885b['temp']>0x0?_0x55885b[_0xbf0a('0xc2')]:0x0;loggerCatch(_0xbf0a('0xc3'))(_0x1e7235);});};Dialer['prototype'][_0xbf0a('0xc4')]=function(_0x2ba98b,_0x377555,_0x330db4,_0x29fea6){return BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](cmHopper[_0xbf0a('0xc4')](_0x2ba98b,_0x377555,_0x330db4))['catch'](function(_0x142611){_0x29fea6[_0xbf0a('0xc2')]-=_0x377555;_0x29fea6[_0xbf0a('0xc2')]=_0x29fea6[_0xbf0a('0xc2')]>0x0?_0x29fea6[_0xbf0a('0xc2')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x142611);});};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xc5')]=function(_0x2acf38){return BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](voiceQueueRt['getVoiceQueueRtPauses'](_0x2acf38))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xc6')));};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xc7')]=function(_0x160218){return BPromise[_0xbf0a('0xb4')]()['then'](cmHopper[_0xbf0a('0xc7')](_0x160218))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xc8')));};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xc9')]=function(_0x246370){return BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](cmHopperHistory[_0xbf0a('0xc9')](_0x246370))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xca')));};Dialer['prototype'][_0xbf0a('0xb0')]=function(_0x4d05b8){if(!_['isUndefined'](_0x4d05b8)&&_0x4d05b8!==null){if(typeof _0x4d05b8[_0xbf0a('0x6c')]!==_0xbf0a('0x96')){if(_0x4d05b8['originated']>0x0){_0x4d05b8[_0xbf0a('0x6c')]-=0x1;}else{logger[_0xbf0a('0x93')](_0xbf0a('0xcb'));}}}else{logger[_0xbf0a('0x93')](_0xbf0a('0xcc'));}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xcd')]=function(_0x572b74,_0x3a6cba){var _0x2feec2=this;return function(_0x1a9a4d){_0x2feec2[_0xbf0a('0xb0')](_0x3a6cba);logger['error'](_0x572b74,util[_0xbf0a('0x94')](_0x1a9a4d,{'showHidden':![],'depth':null}));};};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xce')]=function(_0x8141ee,_0x3eae9,_0x436a1c){var _0x5ee3e8={'state':0x19,'statedesc':'notFound'};this[_0xbf0a('0xb0')](_0x3eae9);this[_0xbf0a('0xcf')](_[_0xbf0a('0x8a')](_0x5ee3e8,_['pick'](_0x436a1c,[_0xbf0a('0xd0'),'ListId',_0xbf0a('0xd1'),_0xbf0a('0xd2'),_0xbf0a('0xd3')])),_0xbf0a('0xd4'),_0xbf0a('0xd5'));logger[_0xbf0a('0x93')](_0x8141ee);};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xd6')]=function(_0x4f9430){return _0x4f9430===_0xbf0a('0xd7');};Dialer['prototype'][_0xbf0a('0xd8')]=function(_0x148b3e){return!_[_0xbf0a('0x35')](_0x148b3e)&&_0x148b3e&&!_['isUndefined'](_0x148b3e[_0xbf0a('0x37')])&&!_[_0xbf0a('0x35')](_0x148b3e[_0xbf0a('0x72')])&&_0x148b3e[_0xbf0a('0x72')]&&(this[_0xbf0a('0x1e')][util[_0xbf0a('0x74')](_0xbf0a('0xd9'),_0x148b3e[_0xbf0a('0x37')])][_0xbf0a('0xad')]==='reachable'||this[_0xbf0a('0x1e')][util[_0xbf0a('0x74')](_0xbf0a('0xd9'),_0x148b3e[_0xbf0a('0x37')])]['status']===_0xbf0a('0xda'));};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xcf')]=function(_0x17f353,_0x1d1624,_0x29cf92){this[_0xbf0a('0xc9')](_0x17f353)[_0xbf0a('0xb6')](loggerCatch(_0x1d1624));this['moveContactManagedDialer'](_0x17f353)['catch'](loggerCatch(_0x29cf92));};Dialer['prototype'][_0xbf0a('0x30')]=function(_0x5266b0){var _0x15b569=this['uniqueId'][_0x5266b0[_0xbf0a('0xdb')]];var _0x676ec4;if(!_[_0xbf0a('0xac')](_0x5266b0)&&!_[_0xbf0a('0xac')](_0x5266b0['variable'])&&!_['isNil'](_0x5266b0[_0xbf0a('0xdc')][_0xbf0a('0xdd')])&&_0x5266b0[_0xbf0a('0xde')]==='xcally-motion-dialer'&&_0x15b569){if(_0x15b569[_0xbf0a('0x46')]!==_0xbf0a('0x76')&&this[_0xbf0a('0x1b')][_0x15b569[_0xbf0a('0xb1')]]['dialAMDActive']&&_0x5266b0['value']===_0xbf0a('0xdf')){delete this[_0xbf0a('0x21')][_0x5266b0[_0xbf0a('0xdb')]];this[_0xbf0a('0xb0')](this[_0xbf0a('0x1b')][_0x15b569[_0xbf0a('0xb1')]]);this[_0xbf0a('0x1b')][_0x15b569[_0xbf0a('0xb1')]][_0xbf0a('0x5a')]+=0x1;this['voiceQueues'][_0x15b569['queue']][_0xbf0a('0x59')]+=0x1;_0x676ec4=new Hangup(_0x15b569,_0x5266b0);_0x676ec4[_0xbf0a('0xa6')]=0x12;_0x676ec4[_0xbf0a('0xa7')]=_0xbf0a('0xe0');_0x676ec4[_0xbf0a('0xe1')]=_0xbf0a('0xe2');ami[_0xbf0a('0x45')]('custom:amd',ut[_0xbf0a('0xe3')](_0x676ec4,_0xbf0a('0xe4')));this[_0xbf0a('0xcf')](_0x676ec4,_0xbf0a('0xe5'),'[syncHangupInAMD]');}if(_0x15b569['type']!=='ivr'&&this[_0xbf0a('0x1b')][_0x15b569['queue']][_0xbf0a('0xe6')]&&_0x5266b0[_0xbf0a('0xe7')]===_0xbf0a('0xe8')){var _0x43d06a=this;return new BPromise(function(_0x19a72b,_0x140b18){delete _0x43d06a[_0xbf0a('0x21')][_0x5266b0[_0xbf0a('0xdb')]];_0x43d06a[_0xbf0a('0xb0')](_0x43d06a[_0xbf0a('0x1b')][_0x15b569[_0xbf0a('0xb1')]]);_0x43d06a['voiceQueues'][_0x15b569[_0xbf0a('0xb1')]][_0xbf0a('0x5a')]+=0x1;_0x43d06a[_0xbf0a('0x1b')][_0x15b569[_0xbf0a('0xb1')]][_0xbf0a('0x59')]+=0x1;var _0x288c75=_0x43d06a['voiceQueues'][_0x15b569[_0xbf0a('0xb1')]];var _0x4e2993=new Hangup(_0x15b569,_0x5266b0);_0x4e2993['state']=0x13;_0x4e2993[_0xbf0a('0xa7')]=_0xbf0a('0xe9');_0x4e2993[_0xbf0a('0xe1')]=_0xbf0a('0xe2');_0x4e2993[_0xbf0a('0xea')]+=0x1;_0x4e2993[_0xbf0a('0xeb')]+=0x1;_0x4e2993[_0xbf0a('0xe4')]=!![];ami[_0xbf0a('0x45')](_0xbf0a('0xec'),ut[_0xbf0a('0xe3')](_0x4e2993,_0xbf0a('0xe4')));_0x43d06a[_0xbf0a('0xc9')](_0x4e2993)[_0xbf0a('0xb6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4e2993['countbusyretry']+_0x4e2993[_0xbf0a('0xed')]+_0x4e2993[_0xbf0a('0xee')]+_0x4e2993[_0xbf0a('0xef')]+_0x4e2993['countdropretry']+_0x4e2993[_0xbf0a('0xf0')]+_0x4e2993[_0xbf0a('0xea')]+_0x4e2993[_0xbf0a('0xf1')]>=_0x288c75[_0xbf0a('0xf2')]){_0x43d06a[_0xbf0a('0xf3')](_0x4e2993,_0x19a72b,_0x140b18,_0xbf0a('0xf4'));}else{if(_0x4e2993[_0xbf0a('0xea')]>=_0x288c75[_0xbf0a('0xf5')]){_0x43d06a[_0xbf0a('0xf6')](_0x4e2993,_0x19a72b,_0x140b18,_0xbf0a('0xf7'));}else{_0x43d06a['rescheduleContact']({'active':![],'countmachineretry':_0x4e2993['countmachineretry'],'scheduledat':moment()[_0xbf0a('0xf8')](_0x288c75[_0xbf0a('0xf9')],'minutes')[_0xbf0a('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e2993[_0xbf0a('0xd0')],'ListId':_0x4e2993[_0xbf0a('0xfa')],'VoiceQueueId':_0x4e2993[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x4e2993[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xfb')));_0x19a72b({'reschedule':0x1});}}});}if(_0x15b569[_0xbf0a('0x46')]===_0xbf0a('0x76')&&this[_0xbf0a('0x1c')][_0x15b569[_0xbf0a('0xb1')]]['dialAMDActive']&&_0x5266b0[_0xbf0a('0xe7')]===_0xbf0a('0xdf')){delete this[_0xbf0a('0x21')][_0x5266b0['uniqueid']];this[_0xbf0a('0xb0')](this[_0xbf0a('0x1c')][_0x15b569[_0xbf0a('0xb1')]]);_0x676ec4=new Hangup(_0x15b569,_0x5266b0);_0x676ec4[_0xbf0a('0xa6')]=0x12;_0x676ec4[_0xbf0a('0xa7')]='HangupInAMD';_0x676ec4['membername']=_0xbf0a('0xe2');ami['emit']('custom:amd',ut[_0xbf0a('0xe3')](_0x676ec4,_0xbf0a('0xe4')));this[_0xbf0a('0xcf')](_0x676ec4,_0xbf0a('0xfc'),_0xbf0a('0xfd'));}if(_0x15b569['type']==='ivr'&&this['campaigns'][_0x15b569['queue']][_0xbf0a('0xe6')]&&_0x5266b0[_0xbf0a('0xe7')]===_0xbf0a('0xe8')){var _0x43d06a=this;return new BPromise(function(_0xb3e0f0,_0x51cca8){delete _0x43d06a['uniqueId'][_0x5266b0[_0xbf0a('0xdb')]];_0x43d06a[_0xbf0a('0xb0')](_0x43d06a[_0xbf0a('0x1c')][_0x15b569['queue']]);_0x43d06a[_0xbf0a('0x1c')][_0x15b569[_0xbf0a('0xb1')]]['outboundAnswerCallsDay']+=0x1;_0x43d06a[_0xbf0a('0x1c')][_0x15b569[_0xbf0a('0xb1')]][_0xbf0a('0x59')]+=0x1;var _0x5f4a8c=_0x43d06a[_0xbf0a('0x1c')][_0x15b569['queue']];var _0x1a9636=new Hangup(_0x15b569,_0x5266b0);_0x1a9636[_0xbf0a('0xa6')]=0x13;_0x1a9636['statedesc']=_0xbf0a('0xe9');_0x1a9636[_0xbf0a('0xe1')]=_0xbf0a('0xe2');_0x1a9636[_0xbf0a('0xea')]+=0x1;_0x1a9636[_0xbf0a('0xeb')]+=0x1;_0x1a9636[_0xbf0a('0xe4')]=!![];ami[_0xbf0a('0x45')](_0xbf0a('0xec'),ut['buildObj'](_0x1a9636,_0xbf0a('0xe4')));_0x43d06a[_0xbf0a('0xc9')](_0x1a9636)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xfe')));if(_0x1a9636[_0xbf0a('0xff')]+_0x1a9636[_0xbf0a('0xed')]+_0x1a9636[_0xbf0a('0xee')]+_0x1a9636[_0xbf0a('0xef')]+_0x1a9636[_0xbf0a('0x100')]+_0x1a9636[_0xbf0a('0xf0')]+_0x1a9636[_0xbf0a('0xea')]+_0x1a9636['countagentrejectretry']>=_0x5f4a8c['dialGlobalMaxRetry']){_0x43d06a[_0xbf0a('0xf3')](_0x1a9636,_0xb3e0f0,_0x51cca8,_0xbf0a('0xf4'));}else{if(_0x1a9636[_0xbf0a('0xea')]>=_0x5f4a8c[_0xbf0a('0xf5')]){_0x43d06a[_0xbf0a('0xf6')](_0x1a9636,_0xb3e0f0,_0x51cca8,_0xbf0a('0xf7'));}else{_0x43d06a[_0xbf0a('0xbd')]({'active':![],'countmachineretry':_0x1a9636[_0xbf0a('0xea')],'scheduledat':moment()[_0xbf0a('0xf8')](_0x5f4a8c['dialMachineRetryFrequency'],_0xbf0a('0x101'))[_0xbf0a('0x74')](_0xbf0a('0x102')),'ContactId':_0x1a9636[_0xbf0a('0xd0')],'ListId':_0x1a9636[_0xbf0a('0xfa')],'VoiceQueueId':_0x1a9636[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x1a9636[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xfb')));_0xb3e0f0({'reschedule':0x1});}}});}}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x2e')]=function(_0x1511a1){var _0x18d2a8=this[_0xbf0a('0x21')][_0x1511a1[_0xbf0a('0xdb')]];var _0x2865ea=this;var _0x441fbc;if(_0x18d2a8&&_0x18d2a8[_0xbf0a('0x46')]===_0xbf0a('0x76')){delete this[_0xbf0a('0x21')][_0x1511a1[_0xbf0a('0xdb')]];this[_0xbf0a('0xb0')](this[_0xbf0a('0x1c')][_0x18d2a8[_0xbf0a('0xb1')]]);this[_0xbf0a('0x1c')][_0x18d2a8[_0xbf0a('0xb1')]]['ivrAnswerCallsDay']+=0x1;_0x441fbc=new Hangup(_0x18d2a8,_0x1511a1);this[_0xbf0a('0xc9')](_0x441fbc)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x103')));this[_0xbf0a('0xc7')](_0x441fbc)[_0xbf0a('0xb6')](loggerCatch('[syncHangupIvr]'));}if(_0x18d2a8&&_0x18d2a8[_0xbf0a('0x46')]!==_0xbf0a('0x76')&&isNotNull(this[_0xbf0a('0x1b')][_0x18d2a8[_0xbf0a('0xb1')]][_0xbf0a('0x104')])){delete this[_0xbf0a('0x21')][_0x1511a1['uniqueid']];this[_0xbf0a('0xb0')](this['voiceQueues'][_0x18d2a8[_0xbf0a('0xb1')]]);this['voiceQueues'][_0x18d2a8['queue']][_0xbf0a('0x5a')]+=0x1;this[_0xbf0a('0x1b')][_0x18d2a8[_0xbf0a('0xb1')]][_0xbf0a('0x59')]+=0x1;_0x441fbc=new Hangup(_0x18d2a8,_0x1511a1);_0x441fbc[_0xbf0a('0xa6')]=0x10;_0x441fbc[_0xbf0a('0xa7')]=_0xbf0a('0x105');_0x441fbc[_0xbf0a('0xe1')]=_0xbf0a('0x106');this[_0xbf0a('0xc9')](_0x441fbc)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x103')));this[_0xbf0a('0xc7')](_0x441fbc)[_0xbf0a('0xb6')](loggerCatch('[syncHangupIvr]'));}if(_0x18d2a8&&_0x18d2a8[_0xbf0a('0x46')]!==_0xbf0a('0x76')&&!isNotNull(this[_0xbf0a('0x1b')][_0x18d2a8[_0xbf0a('0xb1')]][_0xbf0a('0x104')])){delete this['uniqueId'][_0x1511a1['uniqueid']];this[_0xbf0a('0xb0')](this[_0xbf0a('0x1b')][_0x18d2a8['queue']]);this[_0xbf0a('0x1b')][_0x18d2a8['queue']][_0xbf0a('0x63')]+=0x1;_0x441fbc=new Hangup(_0x18d2a8,_0x1511a1);_0x441fbc[_0xbf0a('0xa6')]=0xc;_0x441fbc[_0xbf0a('0xa7')]=_0x1511a1['cause-txt'];_0x441fbc[_0xbf0a('0xe1')]='Unknow';this[_0xbf0a('0xc9')](_0x441fbc)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x103')));this['moveContactManagedDialer'](_0x441fbc)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x107')));}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x108')]=function(_0x47f328){var _0x52816b=this['uniqueId'][_0x47f328[_0xbf0a('0xdb')]];var _0x11bd0c=this;if(this[_0xbf0a('0x1b')][_0x47f328[_0xbf0a('0xb1')]]){if(_0x52816b&&_0x52816b[_0xbf0a('0x46')]!==_0xbf0a('0x76')){delete this['uniqueId'][_0x47f328[_0xbf0a('0xdb')]];this[_0xbf0a('0x1b')][_0x47f328[_0xbf0a('0xb1')]]['outboundAnswerCallsDay']+=0x1;var _0x2fc3e5=new AgentComplete(_0x52816b,_0x47f328);if(_0x47f328[_0xbf0a('0x109')]==='agent'){_0x2fc3e5[_0xbf0a('0x10a')]=this[_0xbf0a('0x1b')][_0x47f328[_0xbf0a('0xb1')]]['dialQueueProject2']&&this[_0xbf0a('0x1b')][_0x47f328['queue']]['dialAgiAfterHangupAgent']?moment()[_0xbf0a('0x74')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xbf0a('0xc9')](_0x2fc3e5)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x10b')));this[_0xbf0a('0xc7')](_0x2fc3e5)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x10c')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x118e54){if(this['voiceQueues'][_0x118e54[_0xbf0a('0xb1')]]){if(this[_0xbf0a('0x21')][_0x118e54[_0xbf0a('0xdb')]]&&this['uniqueId'][_0x118e54['uniqueid']][_0xbf0a('0x46')]!==_0xbf0a('0x76')){this[_0xbf0a('0xb0')](this['voiceQueues'][_0x118e54['queue']]);this[_0xbf0a('0x21')][_0x118e54[_0xbf0a('0xdb')]]['answertime']=moment()[_0xbf0a('0x74')](_0xbf0a('0x102'));}}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x10d')]=function(_0x45eccb){this[_0xbf0a('0xc9')](_0x45eccb)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x10b')));this[_0xbf0a('0xc7')](_0x45eccb)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x10e')));};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x27')]=function(_0x4f891a){var _0x2ed635=this[_0xbf0a('0x21')][_0x4f891a[_0xbf0a('0xdb')]];var _0x179b46=this;if(this['voiceQueues'][_0x4f891a[_0xbf0a('0xb1')]]){if(_0x2ed635&&_0x2ed635['type']!==_0xbf0a('0x76')){delete this[_0xbf0a('0x21')][_0x4f891a[_0xbf0a('0xdb')]];this[_0xbf0a('0xb0')](this['voiceQueues'][_0x4f891a[_0xbf0a('0xb1')]]);_0x2ed635[_0xbf0a('0x10f')]=moment()[_0xbf0a('0x74')](_0xbf0a('0x102'));var _0xc90fe4=new QueueCallerAbandon(_0x2ed635,_0x4f891a);if(getSeconds(_0x2ed635[_0xbf0a('0x10f')],_0x2ed635[_0xbf0a('0x110')])>=_0x2ed635[_0xbf0a('0x111')]){this[_0xbf0a('0x1b')][_0x4f891a[_0xbf0a('0xb1')]][_0xbf0a('0x7e')]+=0x1;this['voiceQueues'][_0x4f891a['queue']][_0xbf0a('0x5e')]+=0x1;this['voiceQueues'][_0x4f891a[_0xbf0a('0xb1')]][_0xbf0a('0x68')]+=0x1;_0xc90fe4[_0xbf0a('0xa6')]=0xa;_0xc90fe4['statedesc']=_0xbf0a('0x112');_0xc90fe4[_0xbf0a('0x113')]=_0xbf0a('0x114');_0xc90fe4[_0xbf0a('0x10a')]=this[_0xbf0a('0x1b')][_0x4f891a[_0xbf0a('0xb1')]]['dialQueueProject2']?moment()[_0xbf0a('0x74')](_0xbf0a('0x102')):undefined;_0xc90fe4[_0xbf0a('0x100')]+=0x1;_0xc90fe4[_0xbf0a('0xeb')]+=0x1;if(_0xc90fe4['countdropretry']>=this[_0xbf0a('0x1b')][_0x4f891a['queue']][_0xbf0a('0x115')]){this['queueCallerAbandonCreateState'](_0xc90fe4);}else{this[_0xbf0a('0xbd')]({'active':![],'countdropretry':_0xc90fe4[_0xbf0a('0x100')],'scheduledat':moment()[_0xbf0a('0xf8')](this[_0xbf0a('0x1b')][_0x4f891a[_0xbf0a('0xb1')]][_0xbf0a('0x116')],_0xbf0a('0x101'))[_0xbf0a('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2ed635[_0xbf0a('0xd0')],'ListId':_0x2ed635[_0xbf0a('0xfa')],'VoiceQueueId':_0x2ed635[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x2ed635[_0xbf0a('0xd3')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x1b463b=new History(_0xc90fe4);_0x1b463b[_0xbf0a('0xa6')]=0xa;_0x1b463b[_0xbf0a('0xa7')]=_0xbf0a('0x112');_0x1b463b[_0xbf0a('0x117')]=moment()[_0xbf0a('0x74')](_0xbf0a('0x102'));_0x1b463b[_0xbf0a('0xa8')]=_0x1b463b['starttime'];_0x1b463b['calleridname']=_0xc90fe4[_0xbf0a('0x118')];_0x1b463b['calleridnum']=_0xc90fe4[_0xbf0a('0x119')];this[_0xbf0a('0xc9')](_0x1b463b)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x11a')));}}else{this['voiceQueues'][_0x4f891a[_0xbf0a('0xb1')]][_0xbf0a('0x80')]+=0x1;this['voiceQueues'][_0x4f891a[_0xbf0a('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0xc90fe4[_0xbf0a('0xa6')]=0xb;_0xc90fe4[_0xbf0a('0xa7')]=_0xbf0a('0x11b');_0xc90fe4[_0xbf0a('0x113')]=_0xbf0a('0x11c');_0xc90fe4[_0xbf0a('0xf0')]+=0x1;_0xc90fe4[_0xbf0a('0xeb')]+=0x1;if(_0xc90fe4['countabandonedretry']>=this[_0xbf0a('0x1b')][_0x4f891a[_0xbf0a('0xb1')]][_0xbf0a('0x11d')]){this[_0xbf0a('0x10d')](_0xc90fe4);}else{this[_0xbf0a('0xbd')]({'active':![],'countabandonedretry':_0xc90fe4[_0xbf0a('0xf0')],'scheduledat':moment()[_0xbf0a('0xf8')](this['voiceQueues'][_0x4f891a[_0xbf0a('0xb1')]][_0xbf0a('0x11e')],_0xbf0a('0x101'))[_0xbf0a('0x74')](_0xbf0a('0x102')),'ContactId':_0x2ed635[_0xbf0a('0xd0')],'ListId':_0x2ed635[_0xbf0a('0xfa')],'VoiceQueueId':_0x2ed635[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x2ed635[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1b463b=new History(_0xc90fe4);_0x1b463b[_0xbf0a('0xa6')]=0xb;_0x1b463b[_0xbf0a('0xa7')]=_0xbf0a('0x11b');_0x1b463b[_0xbf0a('0x117')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1b463b[_0xbf0a('0xa8')]=_0x1b463b[_0xbf0a('0x117')];_0x1b463b['calleridname']=_0xc90fe4[_0xbf0a('0x118')];_0x1b463b['calleridnum']=_0xc90fe4[_0xbf0a('0x119')];this[_0xbf0a('0xc9')](_0x1b463b)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x11f')));}}}}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x2f')]=function(_0x234efd){if(this['actions'][_0x234efd[_0xbf0a('0xdb')]]){this[_0xbf0a('0x120')][_0x234efd[_0xbf0a('0xdb')]][_0xbf0a('0xae')]=_0x234efd[_0xbf0a('0xae')];}if(this[_0xbf0a('0x21')][_0x234efd[_0xbf0a('0xdb')]]){this['uniqueId'][_0x234efd[_0xbf0a('0xdb')]][_0xbf0a('0xae')]=_0x234efd[_0xbf0a('0xae')];}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x31')]=function(_0x4309e7){if(strategy[this[_0xbf0a('0x1b')][this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]]['queue']][_0xbf0a('0x48')]]==='roundrobin'){if(this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]]&&_[_0xbf0a('0xac')](this['actions'][_0x4309e7[_0xbf0a('0x121')]]['locked'])&&_0x4309e7['status']==='1'&&_0x4309e7[_0xbf0a('0x122')]==='0'){if(this[_0xbf0a('0x1d')][_0x4309e7['stateinterface']]){if(!this[_0xbf0a('0x1d')][_0x4309e7[_0xbf0a('0x123')]][_0xbf0a('0x124')]){this[_0xbf0a('0x1d')][_0x4309e7[_0xbf0a('0x123')]][_0xbf0a('0x124')]=!![];this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]][_0xbf0a('0x124')]=!![];this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]]['stateinterface']=_0x4309e7[_0xbf0a('0x123')];}}}}else if((strategy[this[_0xbf0a('0x1b')][this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]][_0xbf0a('0xb1')]][_0xbf0a('0x48')]]||_0xbf0a('0x17'))===_0xbf0a('0x17')){if(this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]]){if(this[_0xbf0a('0x1d')][_0x4309e7[_0xbf0a('0x123')]]){this['actions'][_0x4309e7[_0xbf0a('0x121')]][_0xbf0a('0x123')]=_0x4309e7[_0xbf0a('0x123')];if(_['isNil'](this[_0xbf0a('0x23')][this[_0xbf0a('0x120')][_0x4309e7['actionid']]['queue']])){this['queueBooked'][this[_0xbf0a('0x120')][_0x4309e7['actionid']][_0xbf0a('0xb1')]]=[];}this[_0xbf0a('0x23')][this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]][_0xbf0a('0xb1')]][_0xbf0a('0x125')](_[_0xbf0a('0x8a')](_[_0xbf0a('0x126')](this[_0xbf0a('0x120')][_0x4309e7[_0xbf0a('0x121')]],['idHopper',_0xbf0a('0x123')]),{'status':_0x4309e7[_0xbf0a('0xad')],'paused':_0x4309e7['paused']}));}}}};function unlockQueueStatus(_0x25e9e9,_0x3a3b26){setTimeout(function(){if(_[_0xbf0a('0x35')](_0x25e9e9[_0xbf0a('0x127')])){loggerBooked[_0xbf0a('0x93')](_0xbf0a('0x128'),_0x3a3b26);}_0x25e9e9[_0xbf0a('0x127')]=!![];loggerBooked[_0xbf0a('0x79')](_0xbf0a('0x129'),_0x3a3b26,JSON[_0xbf0a('0x41')](_[_0xbf0a('0x126')](_0x25e9e9,['name',_0xbf0a('0x127')])));},0x1f3);}Dialer[_0xbf0a('0xa9')]['syncQueueStatusComplete']=function(_0x48467e){var _0xe73ba5=this;var _0x384793=_0xe73ba5[_0xbf0a('0x1b')][_0xe73ba5[_0xbf0a('0x120')][_0x48467e['actionid']][_0xbf0a('0xb1')]];if(strategy[this['voiceQueues'][this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]]['strategy']]===_0xbf0a('0x12a')){if(this['actions'][_0x48467e[_0xbf0a('0x121')]]&&this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]]['stateinterface']){this[_0xbf0a('0x8f')][_0xbf0a('0x12b')](this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0x12c')],this[_0xbf0a('0x120')][_0x48467e['actionid']][_0xbf0a('0x123')])[_0xbf0a('0xb6')](function(_0x1d82fa){logger[_0xbf0a('0x93')](_0xbf0a('0x12d'),util[_0xbf0a('0x94')](_0x1d82fa,{'showHidden':![],'depth':null}));})[_0xbf0a('0x12e')](function(){_0xe73ba5[_0xbf0a('0xb0')](_0xe73ba5[_0xbf0a('0x1b')][_0xe73ba5[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]]);_0xe73ba5['agents'][_0xe73ba5[_0xbf0a('0x120')][_0x48467e['actionid']]['stateinterface']][_0xbf0a('0x124')]=![];delete _0xe73ba5[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]];unlockQueueStatus(_0x384793);});}else{this[_0xbf0a('0xb0')](this[_0xbf0a('0x1b')][this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]]);this[_0xbf0a('0xbd')]({'active':![],'ContactId':this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xd0')],'ListId':this[_0xbf0a('0x120')][_0x48467e['actionid']][_0xbf0a('0xfa')],'VoiceQueueId':this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xd2')]||undefined,'CampaignId':this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]];unlockQueueStatus(_0x384793);}}else if((strategy[this[_0xbf0a('0x1b')][this[_0xbf0a('0x120')][_0x48467e['actionid']][_0xbf0a('0xb1')]][_0xbf0a('0x48')]]||_0xbf0a('0x17'))===_0xbf0a('0x17')){var _0x464d22;if(this['actions'][_0x48467e[_0xbf0a('0x121')]]&&!_[_0xbf0a('0x3f')](this['queueBooked'][this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]])){if(this[_0xbf0a('0x12f')][_0xe73ba5[_0xbf0a('0x120')][_0x48467e['actionid']][_0xbf0a('0xb1')]]){this[_0xbf0a('0x12f')][_0xe73ba5[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]]=this[_0xbf0a('0x12f')][this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]]['queue']]?this[_0xbf0a('0x12f')][this[_0xbf0a('0x120')][_0x48467e['actionid']]['queue']]:this[_0xbf0a('0x23')][this['actions'][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]]?this[_0xbf0a('0x23')][this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]][_0xbf0a('0x130')]||0x0:0x0;}this[_0xbf0a('0x23')][this[_0xbf0a('0x120')][_0x48467e[_0xbf0a('0x121')]]['queue']]['_rr']=this['queueBookedRR'][this['actions'][_0x48467e[_0xbf0a('0x121')]][_0xbf0a('0xb1')]];for(var _0x46f6fb=0x0;_0x46f6fb=0x0;})[_0xbf0a('0xb6')](myreject(_0xed396b)));}}else{_0x5e15be[_0xbf0a('0x125')](ami[_0xbf0a('0x14a')]({'action':_0xbf0a('0x14f'),'command':util[_0xbf0a('0x74')](_0xbf0a('0x14b'),_0x1db24f,!_['isUndefined'](config[_0xbf0a('0x146')][_0x246398])?_0x246398:'')})[_0xbf0a('0xb9')](function(_0x1465be){return _0x1465be['content'][_0xbf0a('0x14d')](_0xbf0a('0x14e'))>=0x0;})[_0xbf0a('0xb6')](myreject(_0xed396b)));}BPromise[_0xbf0a('0x150')](_0x5e15be)[_0xbf0a('0xb9')](function(_0x311dfb){var _0x255f6=_[_0xbf0a('0x151')](_0x311dfb);if(_0x255f6){return _0x11afa5(_0x255f6);}else{_0x321802[_0xbf0a('0x39')]=_0x8402ed?'GLOBAL_INTERVAL_IS_OVERTIME':_0xbf0a('0x152');return _0xed396b(msgResponse(_0xbf0a('0x153'),_0xbf0a('0x142'),_0xbf0a('0x154')+_0x8402ed+'\x20'+_0x57f7e7+_0xbf0a('0x155')+util[_0xbf0a('0x94')](_0x1db24f,{'showHidden':![],'depth':null})+_0xbf0a('0x156')+_0x246398));}})[_0xbf0a('0xb6')](function(_0x5e4271){return _0xed396b(msgResponse(_0xbf0a('0x140'),_0xbf0a('0x142'),JSON[_0xbf0a('0x41')](_0x5e4271)));});});};Dialer[_0xbf0a('0xa9')]['checkDialMethod']=function(_0x308fdd){var _0x52ac08=this;return function(){switch(_0x308fdd['dialMethod']){case _0xbf0a('0x157'):freeVariablesPredictive(_0x308fdd);_0x52ac08[_0xbf0a('0x158')](_0x308fdd,0x1);break;case _0xbf0a('0x159'):freeVariablesPredictive(_0x308fdd);_0x52ac08[_0xbf0a('0x158')](_0x308fdd,_0x308fdd[_0xbf0a('0x15a')]);break;case'predictive':_0x52ac08[_0xbf0a('0x9')](_0x308fdd);break;case _0xbf0a('0x8'):freeVariablesPredictive(_0x308fdd);_0x52ac08['handlePower'](_0x308fdd,0x1);break;default:freeVariablesPredictive(_0x308fdd);logger[_0xbf0a('0x93')]('Queue',_0x308fdd[_0xbf0a('0x37')],'method\x20not\x20recognized');}};};Dialer[_0xbf0a('0xa9')]['launchHandleIvr']=function(_0x48dac9){var _0x393a3b=this;return function(){_0x393a3b['handleIvr'](_0x48dac9);};};Dialer[_0xbf0a('0xa9')]['syncQueueSummary']=function(_0x5a8e19){var _0x20b664=this;if(isNotPreview(_0x5a8e19[_0xbf0a('0x55')])){if(isVoiceQueueOutbound(_0x5a8e19[_0xbf0a('0x46')])&&isActive(_0x5a8e19[_0xbf0a('0x15b')])){_0x5a8e19[_0xbf0a('0xa0')]=!![];BPromise['resolve']()[_0xbf0a('0xb9')](checkIsLoggedIn(_0x5a8e19,_0x5a8e19['loggedIn']))[_0xbf0a('0xb9')](checkIsActive(_0x5a8e19,_0x5a8e19[_0xbf0a('0x15b')]))[_0xbf0a('0xb9')](checkInterval(_0x5a8e19))[_0xbf0a('0xb9')](_0x20b664['checkIsTrunkReachable'](_0x5a8e19))[_0xbf0a('0xb9')](_0x20b664[_0xbf0a('0x13f')](_0x5a8e19[_0xbf0a('0x15c')],_0x5a8e19['dialTimezone'],_0x5a8e19[_0xbf0a('0x37')],_0x5a8e19))['then'](_0x20b664['checkIfTimeIntervals'](_0x5a8e19['Interval'],_0x5a8e19[_0xbf0a('0x15d')],_0x5a8e19[_0xbf0a('0x37')],_0x5a8e19))[_0xbf0a('0xb9')](_0x20b664['checkDialMethod'](_0x5a8e19))[_0xbf0a('0xb6')](loggerCatchQueueSummary(_0xbf0a('0x15e'),_0x5a8e19));}else{notSendMessagesQueue(_0x5a8e19);}}else{freeVariablesPredictive(_0x5a8e19);}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x13b')]=function(){var _0xe8fd8=this;var _0x3c8ec2;for(var _0x3fc936 in this[_0xbf0a('0x1c')]){if(typeof this[_0xbf0a('0x1c')][_0x3fc936]!==_0xbf0a('0x96')){_0x3c8ec2=this['campaigns'][_0x3fc936];if(isCampaignIvr(_0x3c8ec2[_0xbf0a('0x46')])&&isActive(_0x3c8ec2['active'])){_0x3c8ec2[_0xbf0a('0xa0')]=!![];BPromise[_0xbf0a('0xb4')]()[_0xbf0a('0xb9')](checkIsActive(_0x3c8ec2,_0x3c8ec2[_0xbf0a('0x72')]))[_0xbf0a('0xb9')](checkInterval(_0x3c8ec2))[_0xbf0a('0xb9')](_0xe8fd8['checkIsTrunkReachable'](_0x3c8ec2))[_0xbf0a('0xb9')](_0xe8fd8[_0xbf0a('0x13f')](_0x3c8ec2[_0xbf0a('0x15c')],_0x3c8ec2[_0xbf0a('0x15d')],_0x3c8ec2['name'],_0x3c8ec2))[_0xbf0a('0xb9')](_0xe8fd8[_0xbf0a('0x141')](_0x3c8ec2[_0xbf0a('0x3b')],_0x3c8ec2[_0xbf0a('0x15d')],_0x3c8ec2[_0xbf0a('0x37')],_0x3c8ec2))[_0xbf0a('0xb9')](_0xe8fd8['launchHandleIvr'](_0x3c8ec2))[_0xbf0a('0xb6')](loggerCatchQueueSummary(_0xbf0a('0x15f'),_0x3c8ec2));}else{notSendMessagesCampaign(_0x3c8ec2);}}}};function getCallerIdRandom(_0x464c7b,_0x66ede8){var _0x306ce0;var _0x2779f2;var _0x18b397;if(_0x66ede8<=0x0){_0x66ede8=0x1;}_0x306ce0=new RegExp(_0xbf0a('0x160')+_0x66ede8+'}$');_0x2779f2=Math['pow'](0xa,_0x66ede8-0x1);_0x18b397=Math[_0xbf0a('0x161')](0xa,_0x66ede8)-0x1;return util[_0xbf0a('0x74')]('%s',_[_0xbf0a('0x162')](_0x464c7b,_0x306ce0,_[_0xbf0a('0x163')](_0x2779f2,_0x18b397)));}function extractCalleridName(_0xb4810d){var _0x67c4ba=_0xb4810d[_0xbf0a('0x164')](/"(.*?)"/);return _0x67c4ba?_0x67c4ba[0x1]:_0xb4810d;}function extractCalleridNumber(_0x4e01d1){var _0xd52499=_0x4e01d1['match'](/<(.*?)>/);return _0xd52499?_0xd52499[0x1]:_0x4e01d1;}Dialer[_0xbf0a('0xa9')]['actionOriginate']=function(_0x3f62ae,_0x58ef2c){var _0xac8624=this;var _0x292af3=uuid['v4']();this[_0xbf0a('0x120')][_0x292af3]=new Action(_0x3f62ae,_0x58ef2c,_0x292af3);return new BPromise(function(_0x3c7e55,_0xd4bc65){if(_['isUndefined'](_0x3f62ae)&&typeof _0x3f62ae!=='object'){return _0xd4bc65(msgResponse('originate','Failure',_0xbf0a('0x165')));}if(_['isUndefined'](_0x58ef2c[_0xbf0a('0x166')][_0xbf0a('0x167')])||_0x58ef2c[_0xbf0a('0x166')]['phone']===null){return _0xd4bc65(msgResponse('originate','Failure',_0xbf0a('0x168')));}var _0x52d890={'XMD-CALLERID':_0xac8624['actions'][_0x292af3][_0xbf0a('0x169')](),'XMD-AGI':_0x3f62ae[_0xbf0a('0x104')]?util[_0xbf0a('0x74')](_0xbf0a('0x16a'),ipAgi,_0x3f62ae[_0xbf0a('0x104')]):_0xbf0a('0x16b'),'XMD-AGIAFTER':_0x3f62ae[_0xbf0a('0x16c')]?util[_0xbf0a('0x74')](_0xbf0a('0x16a'),ipAgi,_0x3f62ae[_0xbf0a('0x16c')]):'NONE','XMD-QUEUE':_0x3f62ae[_0xbf0a('0x46')]===_0xbf0a('0x47')?util[_0xbf0a('0x74')](_0xbf0a('0x16d'),_0x3f62ae[_0xbf0a('0x37')],_0x3f62ae[_0xbf0a('0x16e')]||'',_0x3f62ae[_0xbf0a('0x16f')]?'c':'',_0x3f62ae[_0xbf0a('0x111')]||0x3):_0xbf0a('0x16b'),'XMD-CONTACTID':_0x58ef2c[_0xbf0a('0xd0')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xac8624[_0xbf0a('0x120')][_0x292af3][_0xbf0a('0x169')](),'XMD-AMD':_0x3f62ae['dialAMDActive']?'ACTIVE':_0xbf0a('0x16b'),'XMD-DESTINATION':_0xbf0a('0x170')};if(_0x3f62ae['dialAMDActive']){_0x52d890[_0xbf0a('0x171')]=_0x3f62ae[_0xbf0a('0x172')]||0x9c4;_0x52d890[_0xbf0a('0x173')]=_0x3f62ae['dialAMDGreeting']||0x5dc;_0x52d890['XMD-AMDAFTERGREETINGSILENCE']=_0x3f62ae[_0xbf0a('0x174')]||0x320;_0x52d890[_0xbf0a('0x175')]=_0x3f62ae[_0xbf0a('0x176')]||0x1388;_0x52d890['XMD-AMDMINWORDLENGTH']=_0x3f62ae['dialAMDMinWordLength']||0x64;_0x52d890[_0xbf0a('0x177')]=_0x3f62ae[_0xbf0a('0x178')]||0x32;_0x52d890[_0xbf0a('0x179')]=_0x3f62ae[_0xbf0a('0x17a')]||0x3;_0x52d890[_0xbf0a('0x17b')]=_0x3f62ae[_0xbf0a('0x17c')]||0x100;_0x52d890[_0xbf0a('0x17d')]=_0x3f62ae[_0xbf0a('0x17e')]||0x1388;}if(_0x3f62ae[_0xbf0a('0x46')]===_0xbf0a('0x47')){_0x52d890['XMD-VOICEQUEUEID']=_0x58ef2c[_0xbf0a('0xd2')];}else{_0x52d890[_0xbf0a('0x17f')]=_0x58ef2c[_0xbf0a('0xd3')];}for(var _0x5afbe1 in _0x58ef2c[_0xbf0a('0x166')]){if(typeof _0x58ef2c['Contact'][_0x5afbe1]!==_0xbf0a('0x96')){if(isNotNull(_0x58ef2c[_0xbf0a('0x166')][_0x5afbe1])&&_0x5afbe1!=='id'&&_0x5afbe1!==_0xbf0a('0x180')&&_0x5afbe1!=='createdAt'&&_0x5afbe1!=='updatedAt'){_0x52d890[util[_0xbf0a('0x74')](_0xbf0a('0x181'),_0xbf0a('0x182'),_[_0xbf0a('0x183')](_0x5afbe1))]=_0x58ef2c['Contact'][_0x5afbe1];}}}var _0x15ab23=_0xac8624['isTrunkReachable'](_0x3f62ae[_0xbf0a('0x71')])?getCallerId(_0x3f62ae['Trunk'][_0xbf0a('0x73')],_0x3f62ae['dialOriginateCallerIdName'],_0x3f62ae[_0xbf0a('0x184')]>0x0?getCallerIdRandom(_0x3f62ae[_0xbf0a('0x56')],_0x3f62ae[_0xbf0a('0x184')]):_0x3f62ae[_0xbf0a('0x56')]):getCallerId(_[_0xbf0a('0xac')](_0x3f62ae[_0xbf0a('0x185')])?_0x3f62ae[_0xbf0a('0x71')][_0xbf0a('0x73')]:_0x3f62ae[_0xbf0a('0x185')][_0xbf0a('0x73')],_0x3f62ae[_0xbf0a('0x186')],_0x3f62ae['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x3f62ae[_0xbf0a('0x56')],_0x3f62ae[_0xbf0a('0x184')]):_0x3f62ae[_0xbf0a('0x56')]);if(_0x15ab23){_0x52d890[_0xbf0a('0x187')]=_0xac8624['actions'][_0x292af3][_0xbf0a('0x188')]=extractCalleridName(_0x15ab23);_0x52d890[_0xbf0a('0x189')]=_0xac8624[_0xbf0a('0x120')][_0x292af3][_0xbf0a('0x18a')]=extractCalleridNumber(_0x15ab23);}return ami[_0xbf0a('0x14a')]({'actionid':_0x292af3,'action':'originate','channel':_0xac8624['isTrunkReachable'](_0x3f62ae[_0xbf0a('0x71')])?util[_0xbf0a('0x74')]('SIP/%s/%s%s',_0x3f62ae[_0xbf0a('0x71')][_0xbf0a('0x37')],isNotNull(_0x3f62ae[_0xbf0a('0x58')])?_0x3f62ae[_0xbf0a('0x58')][_0xbf0a('0x18b')]()||'':'',_0x3f62ae[_0xbf0a('0x18c')]>0x0?_0x58ef2c[_0xbf0a('0x166')][_0xbf0a('0x167')]['substring'](_0x3f62ae[_0xbf0a('0x18c')]):_0x58ef2c[_0xbf0a('0x166')]['phone']):util[_0xbf0a('0x74')]('SIP/%s/%s%s',_['isNil'](_0x3f62ae[_0xbf0a('0x185')])?_0x3f62ae[_0xbf0a('0x71')][_0xbf0a('0x37')]:_0x3f62ae['TrunkBackup']['name'],isNotNull(_0x3f62ae[_0xbf0a('0x58')])?_0x3f62ae[_0xbf0a('0x58')]['trim']()||'':'',_0x3f62ae[_0xbf0a('0x18c')]>0x0?_0x58ef2c[_0xbf0a('0x166')][_0xbf0a('0x167')]['substring'](_0x3f62ae['dialCutDigit']):_0x58ef2c['Contact'][_0xbf0a('0x167')]),'callerid':_0x15ab23,'Exten':_0xbf0a('0x170'),'Context':_0xbf0a('0x18d'),'Priority':'1','variable':_0x52d890,'timeout':(_0x3f62ae[_0xbf0a('0x57')]||0x1e)*0x3e8,'async':!![],'channelid':_0x292af3})[_0xbf0a('0xb9')](function(_0x118639){return _0x3c7e55(_0x118639);})[_0xbf0a('0xb6')](function(_0x79fec0){_0x3f62ae[_0xbf0a('0x60')]+=0x1;var _0x357dad=new History(_0xac8624[_0xbf0a('0x120')][_0x292af3]);logger[_0xbf0a('0x93')](util[_0xbf0a('0x74')]('[originateError]:\x20%s',JSON[_0xbf0a('0x41')](_0x79fec0)));_0x357dad[_0xbf0a('0xa6')]=0xe;_0x357dad[_0xbf0a('0xa7')]=_0xbf0a('0x18e');_0x357dad[_0xbf0a('0x117')]=moment()[_0xbf0a('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x357dad['endtime']=_0x357dad[_0xbf0a('0x117')];_0xac8624[_0xbf0a('0xc9')](_0x357dad)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x18f')));_0xac8624[_0xbf0a('0xc7')](_0x357dad)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0xac8624[_0xbf0a('0x120')][_0x292af3];return _0xd4bc65(msgResponse(_0xbf0a('0x190'),_0xbf0a('0x191'),'originate\x20action\x20Error'));});});});};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x29')]=function(_0x1c9fa3){var _0x51a089=this[_0xbf0a('0x120')][_0x1c9fa3[_0xbf0a('0x121')]];if(_0x51a089){delete this[_0xbf0a('0x120')][_0x1c9fa3[_0xbf0a('0x121')]];_0x51a089[_0xbf0a('0x110')]=moment()[_0xbf0a('0x74')](_0xbf0a('0x102'));var _0x7e5e02=_0x51a089['type']===_0xbf0a('0x76')?this[_0xbf0a('0x1c')][_0x51a089[_0xbf0a('0xb1')]]:this[_0xbf0a('0x1b')][_0x51a089[_0xbf0a('0x192')]()];if(!this['isSuccess'](_0x1c9fa3[_0xbf0a('0x193')])){this[_0xbf0a('0xb0')](_0x7e5e02);return this[_0xbf0a('0x194')](_0x51a089,_0x7e5e02,_0x1c9fa3)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x195')));}this[_0xbf0a('0x21')][_0x1c9fa3[_0xbf0a('0xdb')]]=_0x51a089;}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x196')]=function(_0x5ea6b6,_0x1a3bbe,_0x4a1cc1){var _0x302cb7=new History(_0x1a3bbe);if(_0x302cb7['countbusyretry']+_0x302cb7['countcongestionretry']+_0x302cb7[_0xbf0a('0xee')]+_0x302cb7['countnosuchnumberretry']+_0x302cb7[_0xbf0a('0x100')]+_0x302cb7[_0xbf0a('0xf0')]+_0x302cb7[_0xbf0a('0xea')]+_0x302cb7[_0xbf0a('0xf1')]>=_0x4a1cc1[_0xbf0a('0xf2')]-0x1){return!![];}switch(_0x5ea6b6){case 0x3:if(_0x302cb7[_0xbf0a('0xee')]>=_0x4a1cc1[_0xbf0a('0x197')]-0x1){return!![];}this[_0xbf0a('0xbd')]({'active':![],'countnoanswerretry':_0x302cb7[_0xbf0a('0xee')]+=0x1,'scheduledat':moment()['add'](_0x4a1cc1[_0xbf0a('0x198')],'minutes')[_0xbf0a('0x74')](_0xbf0a('0x102')),'ContactId':_0x302cb7['ContactId'],'ListId':_0x302cb7[_0xbf0a('0xfa')],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x302cb7[_0xbf0a('0xff')]>=_0x4a1cc1['dialBusyMaxRetry']-0x1){return!![];}this[_0xbf0a('0xbd')]({'active':![],'countbusyretry':_0x302cb7[_0xbf0a('0xff')]+=0x1,'scheduledat':moment()[_0xbf0a('0xf8')](_0x4a1cc1[_0xbf0a('0x199')],_0xbf0a('0x101'))[_0xbf0a('0x74')](_0xbf0a('0x102')),'ContactId':_0x302cb7[_0xbf0a('0xd0')],'ListId':_0x302cb7[_0xbf0a('0xfa')],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x19a')));break;case 0x8:if(_0x302cb7[_0xbf0a('0xed')]>=_0x4a1cc1[_0xbf0a('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x302cb7[_0xbf0a('0xed')]+=0x1,'scheduledat':moment()[_0xbf0a('0xf8')](_0x4a1cc1['dialCongestionRetryFrequency'],'minutes')[_0xbf0a('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x302cb7['ContactId'],'ListId':_0x302cb7[_0xbf0a('0xfa')],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7['CampaignId']||undefined})['catch'](loggerCatch(_0xbf0a('0x19c')));break;case 0x0:if(_0x302cb7['countnosuchnumberretry']>=_0x4a1cc1[_0xbf0a('0x19d')]-0x1){return!![];}else{this[_0xbf0a('0xbd')]({'active':![],'countnosuchnumberretry':_0x302cb7[_0xbf0a('0xef')]+=0x1,'scheduledat':moment()[_0xbf0a('0xf8')](_0x4a1cc1[_0xbf0a('0x19e')],_0xbf0a('0x101'))[_0xbf0a('0x74')](_0xbf0a('0x102')),'ContactId':_0x302cb7[_0xbf0a('0xd0')],'ListId':_0x302cb7[_0xbf0a('0xfa')],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x19f')));}break;case 0xa:if(_0x302cb7['countdropretry']>=_0x4a1cc1[_0xbf0a('0x115')]-0x1){return!![];}this[_0xbf0a('0xbd')]({'active':![],'countdropretry':_0x302cb7[_0xbf0a('0x100')]+=0x1,'scheduledat':moment()[_0xbf0a('0xf8')](_0x4a1cc1[_0xbf0a('0x116')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x302cb7['ContactId'],'ListId':_0x302cb7[_0xbf0a('0xfa')],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x1a0')));break;case 0xb:if(_0x302cb7['countabandonedretry']>=_0x4a1cc1[_0xbf0a('0x11d')]-0x1){return!![];}this[_0xbf0a('0xbd')]({'active':![],'countabandonedretry':_0x302cb7['countabandonedretry']+=0x1,'scheduledat':moment()[_0xbf0a('0xf8')](_0x4a1cc1[_0xbf0a('0x11e')],'minutes')['format'](_0xbf0a('0x102')),'ContactId':_0x302cb7[_0xbf0a('0xd0')],'ListId':_0x302cb7['ListId'],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7['CampaignId']||undefined})[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x1a1')));break;case 0x13:if(_0x302cb7['countmachineretry']>=_0x4a1cc1['dialMachineMaxRetry']-0x1){return!![];}this[_0xbf0a('0xbd')]({'active':![],'countmachineretry':_0x302cb7['countmachineretry']+=0x1,'scheduledat':moment()[_0xbf0a('0xf8')](_0x4a1cc1[_0xbf0a('0xf9')],_0xbf0a('0x101'))[_0xbf0a('0x74')](_0xbf0a('0x102')),'ContactId':_0x302cb7[_0xbf0a('0xd0')],'ListId':_0x302cb7['ListId'],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7[_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x302cb7[_0xbf0a('0xf1')]>=_0x4a1cc1[_0xbf0a('0x1a2')]-0x1){return!![];}this[_0xbf0a('0xbd')]({'active':![],'countagentrejectretry':_0x302cb7[_0xbf0a('0xf1')]+=0x1,'scheduledat':moment()[_0xbf0a('0xf8')](_0x4a1cc1[_0xbf0a('0x1a3')],'minutes')[_0xbf0a('0x74')](_0xbf0a('0x102')),'ContactId':_0x302cb7[_0xbf0a('0xd0')],'ListId':_0x302cb7[_0xbf0a('0xfa')],'VoiceQueueId':_0x302cb7[_0xbf0a('0xd2')]||undefined,'CampaignId':_0x302cb7['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xbf0a('0xa9')]['callProgressDetecting']=function(_0x17682e,_0x3b9010,_0x5eadb7){var _0x3552b3=this;var _0x26b6c2=new History(_0x17682e);return new BPromise(function(_0x34f258,_0x995392){if(_[_0xbf0a('0x35')](_0x3b9010)&&typeof _0x3b9010!==_0xbf0a('0x1a4')){return _0x995392(msgResponse(_0xbf0a('0x1a5'),_0xbf0a('0x142'),_0xbf0a('0x1a6')));}if(_[_0xbf0a('0x35')](_0x5eadb7)&&typeof _0x5eadb7!==_0xbf0a('0x1a4')){return _0x995392(msgResponse(_0xbf0a('0x1a5'),'Failure',_0xbf0a('0x1a7')));}switch(_0x5eadb7['reason']){case'0':_0x3b9010['outboundNoSuchCallsDay']+=0x1;_0x26b6c2[_0xbf0a('0xa6')]=0x0;_0x26b6c2[_0xbf0a('0xa7')]=_0xbf0a('0x1a8');_0x26b6c2[_0xbf0a('0xef')]+=0x1;_0x26b6c2['countglobal']+=0x1;ami[_0xbf0a('0x45')]('custom:agentnosuchnumber',ut[_0xbf0a('0xe3')](_0x17682e,_0xbf0a('0x1a9')));_0x3552b3[_0xbf0a('0xc9')](_0x26b6c2)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xfe')));if(_0x3552b3[_0xbf0a('0x196')](0x0,_0x17682e,_0x3b9010)){if(_0x26b6c2[_0xbf0a('0xef')]>=_0x3b9010[_0xbf0a('0x19d')]){_0x3552b3[_0xbf0a('0xf6')](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1aa'));}else{_0x3552b3[_0xbf0a('0xf3')](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1aa'));}}break;case'3':_0x3b9010[_0xbf0a('0x1ab')]+=0x1;_0x26b6c2[_0xbf0a('0xa6')]=0x3;_0x26b6c2[_0xbf0a('0xa7')]=_0xbf0a('0x1ac');_0x26b6c2[_0xbf0a('0xee')]+=0x1;_0x26b6c2[_0xbf0a('0xeb')]+=0x1;ami['emit'](_0xbf0a('0x1ad'),ut[_0xbf0a('0xe3')](_0x17682e,_0xbf0a('0x1ae')));_0x3552b3[_0xbf0a('0xc9')](_0x26b6c2)[_0xbf0a('0xb6')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3552b3['checkRetriveMax'](0x3,_0x17682e,_0x3b9010)){if(_0x26b6c2[_0xbf0a('0xee')]>=_0x3b9010[_0xbf0a('0x197')]){_0x3552b3[_0xbf0a('0xf6')](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1af'));}else{_0x3552b3[_0xbf0a('0xf3')](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1af'));}}break;case'5':_0x3b9010[_0xbf0a('0x5b')]+=0x1;_0x26b6c2[_0xbf0a('0xa6')]=0x5;_0x26b6c2[_0xbf0a('0xa7')]=_0xbf0a('0x1b0');_0x26b6c2[_0xbf0a('0xff')]+=0x1;_0x26b6c2[_0xbf0a('0xeb')]+=0x1;ami[_0xbf0a('0x45')](_0xbf0a('0x1b1'),ut[_0xbf0a('0xe3')](_0x17682e,_0xbf0a('0x1b2')));_0x3552b3[_0xbf0a('0xc9')](_0x26b6c2)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x1b3')));if(_0x3552b3[_0xbf0a('0x196')](0x5,_0x17682e,_0x3b9010)){if(_0x26b6c2[_0xbf0a('0xff')]>=_0x3b9010['dialBusyMaxRetry']){_0x3552b3[_0xbf0a('0xf6')](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1b4'));}else{_0x3552b3[_0xbf0a('0xf3')](_0x26b6c2,_0x34f258,_0x995392,'reason\x205\x20busy');}}break;case'8':_0x3b9010[_0xbf0a('0x5c')]+=0x1;_0x26b6c2[_0xbf0a('0xa6')]=0x8;_0x26b6c2['statedesc']=_0xbf0a('0x1b5');_0x26b6c2[_0xbf0a('0xed')]+=0x1;_0x26b6c2['countglobal']+=0x1;ami[_0xbf0a('0x45')](_0xbf0a('0x1b6'),ut[_0xbf0a('0xe3')](_0x17682e,_0xbf0a('0x1b7')));_0x3552b3[_0xbf0a('0xc9')](_0x26b6c2)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x1b8')));if(_0x3552b3[_0xbf0a('0x196')](0x8,_0x17682e,_0x3b9010)){if(_0x26b6c2[_0xbf0a('0xed')]>=_0x3b9010[_0xbf0a('0x19b')]){_0x3552b3[_0xbf0a('0xf6')](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1b9'));}else{_0x3552b3['stateGlobal'](_0x26b6c2,_0x34f258,_0x995392,'reason\x208\x20congestion');}}break;case'11':_0x3b9010[_0xbf0a('0x1ba')]+=0x1;_0x26b6c2[_0xbf0a('0xa6')]=0xb;_0x26b6c2[_0xbf0a('0xa7')]=_0xbf0a('0x11b');_0x26b6c2[_0xbf0a('0xf0')]+=0x1;_0x26b6c2[_0xbf0a('0xeb')]+=0x1;_0x3552b3[_0xbf0a('0xc9')](_0x26b6c2)[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x11f')));if(_0x3552b3[_0xbf0a('0x196')](0xb,_0x17682e,_0x3b9010)){if(_0x26b6c2[_0xbf0a('0xf0')]>=_0x3b9010['dialAbandonedMaxRetry']){_0x3552b3['createStateFinal'](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1bb'));}else{_0x3552b3['stateGlobal'](_0x26b6c2,_0x34f258,_0x995392,'reason\x2011\x20abandoned');}}break;case'20':_0x3b9010['outboundRejectCallsDay']+=0x1;_0x26b6c2[_0xbf0a('0xa6')]=0x14;_0x26b6c2[_0xbf0a('0xa7')]=_0xbf0a('0x1bc');_0x26b6c2[_0xbf0a('0xf1')]+=0x1;_0x26b6c2[_0xbf0a('0xeb')]+=0x1;ami['emit']('custom:agentreject',ut[_0xbf0a('0xe3')](_0x17682e,'agentreject'));_0x3552b3['createHistory'](_0x26b6c2)[_0xbf0a('0xb6')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x3552b3[_0xbf0a('0x196')](0x14,_0x17682e,_0x3b9010)){if(_0x26b6c2[_0xbf0a('0xf1')]>=_0x3b9010[_0xbf0a('0x1a2')]){_0x3552b3['createStateFinal'](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1bd'));}else{_0x3552b3[_0xbf0a('0xf3')](_0x26b6c2,_0x34f258,_0x995392,_0xbf0a('0x1bd'));}}break;default:_0x3b9010[_0xbf0a('0x63')]+=0x1;_0x26b6c2[_0xbf0a('0xa6')]=0xc;_0x26b6c2[_0xbf0a('0xa7')]=_0x5eadb7['reason'];_0x3552b3['createHistory'](_0x26b6c2)[_0xbf0a('0xb6')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3552b3[_0xbf0a('0x196')](_0x5eadb7['reason'],_0x17682e,_0x3b9010)){if(_0x26b6c2[_0xbf0a('0xff')]+_0x26b6c2[_0xbf0a('0xed')]+_0x26b6c2[_0xbf0a('0xee')]+_0x26b6c2[_0xbf0a('0xef')]+_0x26b6c2[_0xbf0a('0x100')]+_0x26b6c2[_0xbf0a('0xf0')]+_0x26b6c2[_0xbf0a('0xea')]+_0x26b6c2[_0xbf0a('0xf1')]>=_0x3b9010[_0xbf0a('0xf2')]){_0x3552b3[_0xbf0a('0xf3')](_0x26b6c2,_0x34f258,_0x995392,_0x5eadb7['reason']);}else{_0x3552b3[_0xbf0a('0xf6')](_0x26b6c2,_0x34f258,_0x995392,_0x5eadb7[_0xbf0a('0x109')]);}}}});};Dialer['prototype'][_0xbf0a('0xf3')]=function(_0x33cd1f,_0x4bd1ea,_0x13acdd,_0x64bd28){var _0x998b67=new Final(_0x33cd1f);_0x998b67[_0xbf0a('0xa6')]=0xf;_0x998b67[_0xbf0a('0xa7')]='Global';this[_0xbf0a('0xf6')](_0x998b67,_0x4bd1ea,_0x13acdd,_0x64bd28);};Dialer[_0xbf0a('0xa9')][_0xbf0a('0xf6')]=function(_0x588e3b,_0x467efe,_0x555dcf,_0xe170d){this[_0xbf0a('0xc7')](_0x588e3b)[_0xbf0a('0xb9')](function(){return _0x467efe(msgResponse(_0xbf0a('0x1a5'),_0xbf0a('0xd7'),_0xe170d));})['catch'](function(){return _0x555dcf(msgResponse(_0xbf0a('0x1be'),_0xbf0a('0x142'),_0xbf0a('0x1bf')));});};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x9')]=function(_0x3f5dc4){var _0xaa51ab=_0x3f5dc4[_0xbf0a('0x1c0')]/0x64;var _0x1f1a21=_0x3f5dc4[_0xbf0a('0x5e')]/(_0x3f5dc4[_0xbf0a('0x5e')]+_0x3f5dc4[_0xbf0a('0x5a')]);var _0x2df83b=Math[_0xbf0a('0x1c1')](_0x3f5dc4['predictiveIntervalAvailable']*(_0x3f5dc4[_0xbf0a('0x1c2')]/0x64));var _0x188f44=Math['round'](_0x3f5dc4['predictiveIntervalAvailable']*(_0x3f5dc4[_0xbf0a('0x1c3')]/0x64));var _0xb2345e=_0x3f5dc4[_0xbf0a('0x4a')]+_0x3f5dc4[_0xbf0a('0x4f')];var _0x37cace=Math['floor'](_0x3f5dc4[_0xbf0a('0x6d')]*_0x3f5dc4[_0xbf0a('0x6f')]*_0x3f5dc4['predictiveIntervalHitRate']*_0x3f5dc4['predictiveIntervalMultiplicativeFactor']);if(_[_0xbf0a('0x35')](_0x3f5dc4[_0xbf0a('0x22')])){if(!_[_0xbf0a('0x35')](_0x3f5dc4[_0xbf0a('0x8c')])){_0x3f5dc4[_0xbf0a('0x8c')]=undefined;loggerPredictive[_0xbf0a('0x93')](_0xbf0a('0x1c4'),_0xbf0a('0x1c5'));}if(!_['isUndefined'](_0x3f5dc4['handlePredictive'])){loggerPredictive[_0xbf0a('0x93')](_0xbf0a('0x1c4'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3f5dc4[_0xbf0a('0x8e')]);_0x3f5dc4[_0xbf0a('0x8e')]=undefined;}_0x3f5dc4[_0xbf0a('0x22')]=moment()[_0xbf0a('0x74')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbf0a('0x79')](_0x3f5dc4['name'],'collection\x20data\x20in\x20progressive\x20at',_0x3f5dc4['startProgressive']);this[_0xbf0a('0x158')](_0x3f5dc4,0x1);}else if(ifInterval(_0x3f5dc4['dialPredictiveInterval'],_0x3f5dc4[_0xbf0a('0x22')])){this['handlePower'](_0x3f5dc4,0x1);loggerPredictiveCalls[_0xbf0a('0x79')](_0xbf0a('0x1c6'),_0x3f5dc4[_0xbf0a('0x22')],_0x3f5dc4[_0xbf0a('0x37')]);_0x3f5dc4[_0xbf0a('0x6d')]=0x0;_0x3f5dc4['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xaa51ab<_0x1f1a21&&_0x3f5dc4['dialPredictiveOptimization']===_0xbf0a('0x1c7')){freeVariablesPredictive(_0x3f5dc4);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x1c8'),_0xbf0a('0x1c9'),_0x1f1a21,_0xbf0a('0x22'),_0x3f5dc4[_0xbf0a('0x37')]);}else if(_0x37cace<_0x3f5dc4[_0xbf0a('0x68')]&&_0x3f5dc4['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x3f5dc4);loggerPredictive['info'](_0xbf0a('0x1ca'),_0xbf0a('0x1cb'),_0x37cace,'Drop\x20in\x20this\x20interval',_0x3f5dc4[_0xbf0a('0x68')],_0xbf0a('0x22'),_0x3f5dc4[_0xbf0a('0x37')]);}else if(!ifInterval(_0x3f5dc4[_0xbf0a('0x1cc')],_0x3f5dc4[_0xbf0a('0x22')])&&_[_0xbf0a('0x35')](_0x3f5dc4[_0xbf0a('0x8c')])&&!_[_0xbf0a('0x35')](_0x3f5dc4[_0xbf0a('0x22')])){_0x3f5dc4[_0xbf0a('0x8c')]=moment()['format'](_0xbf0a('0x102'));loggerPredictive[_0xbf0a('0x79')](_0x3f5dc4[_0xbf0a('0x37')],_0xbf0a('0x1cd'),_0x3f5dc4[_0xbf0a('0x8c')]);this[_0xbf0a('0xba')](_0x3f5dc4['dialPredictiveInterval'])[_0xbf0a('0xb9')](this['getDataPredictive'](_0x3f5dc4))['then'](mergeDataErlangB(_0x3f5dc4))[_0xbf0a('0xb9')](this[_0xbf0a('0x1ce')](_0x3f5dc4))['catch'](loggerCatchPredictive(_0xbf0a('0x1cf'),_0x3f5dc4));}else if(!ifInterval(_0x3f5dc4['dialPredictiveInterval'],_0x3f5dc4['startPredictive'])){_0x3f5dc4[_0xbf0a('0x68')]=0x0;_0x3f5dc4[_0xbf0a('0x8c')]=moment()[_0xbf0a('0x74')](_0xbf0a('0x102'));loggerPredictive[_0xbf0a('0x79')](_0x3f5dc4[_0xbf0a('0x37')],_0xbf0a('0x1d0'),_0x3f5dc4[_0xbf0a('0x8c')]);clearInterval(_0x3f5dc4[_0xbf0a('0x8e')]);_0x3f5dc4[_0xbf0a('0x8e')]=undefined;this[_0xbf0a('0xba')](_0x3f5dc4['dialPredictiveInterval'])[_0xbf0a('0xb9')](this[_0xbf0a('0x1d1')](_0x3f5dc4))[_0xbf0a('0xb9')](mergeDataErlangB(_0x3f5dc4))[_0xbf0a('0xb9')](this[_0xbf0a('0x1ce')](_0x3f5dc4))[_0xbf0a('0xb6')](loggerCatchPredictive(_0xbf0a('0x1d2'),_0x3f5dc4));}else if(_0x3f5dc4[_0xbf0a('0x6a')]&&_0xb2345e<_0x3f5dc4['predictiveIntervalAvailable']-_0x188f44){freeVariablesPredictive(_0x3f5dc4);loggerPredictive[_0xbf0a('0x79')](_0x3f5dc4['name'],_0xbf0a('0x1d3'),_0xb2345e,_0xbf0a('0x1d4'),_0x3f5dc4[_0xbf0a('0x6a')],'-',_0x188f44,'=',_0x3f5dc4['predictiveIntervalAvailable']-_0x188f44,')');}else if(_0x3f5dc4[_0xbf0a('0x6a')]&&_0xb2345e>_0x3f5dc4['predictiveIntervalAvailable']+_0x2df83b){freeVariablesPredictive(_0x3f5dc4);loggerPredictive[_0xbf0a('0x79')](_0x3f5dc4['name'],_0xbf0a('0x1d3'),_0xb2345e,_0xbf0a('0x1d5'),_0x3f5dc4[_0xbf0a('0x6a')],'+',_0x2df83b,'=',_0x3f5dc4['predictiveIntervalAvailable']+_0x2df83b,')');}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x1d1')]=function(_0x1a1fb8){var _0x4e3649=this;return function(_0x598f8c){return new BPromise(function(_0x124bd5,_0x53e68a){_['merge'](_0x1a1fb8,_0x598f8c[0x0]);if(checkGetDataPredictive(_0x598f8c[0x0])){var _0x1e189e=_0x1a1fb8[_0xbf0a('0x6a')]=_0x1a1fb8[_0xbf0a('0x4f')]+_0x1a1fb8[_0xbf0a('0x4a')];var _0x28b703=_0x1a1fb8[_0xbf0a('0x1cc')]*0x3c;var _0x56758a=_0x598f8c[0x0]['predictiveIntervalAvgTalktime']+_0x598f8c[0x0][_0xbf0a('0x65')];var _0x1cdbe9=(_0x598f8c[0x0][_0xbf0a('0x64')]+_0x598f8c[0x0][_0xbf0a('0x7e')]+_0x598f8c[0x0][_0xbf0a('0x80')])/_0x598f8c[0x0][_0xbf0a('0x6b')];_0x1a1fb8[_0xbf0a('0x1d6')]=_0x1cdbe9>0x0?_0x1cdbe9:0x1;switch(_0x1a1fb8[_0xbf0a('0x1d7')]){case _0xbf0a('0x1c7'):var _0x3abc7c=_0x1a1fb8[_0xbf0a('0x1c0')]/0x64;return _0x4e3649[_0xbf0a('0x1d8')](_0x1e189e,_0x28b703,_0x56758a,_0x1cdbe9,_0x3abc7c)[_0xbf0a('0xb9')](function(_0x119686){return _0x124bd5(_0x119686);});case _0xbf0a('0x1d9'):var _0x5633c1=_0x1a1fb8['dialPredictiveOptimizationPercentage']/0x64;return _0x4e3649[_0xbf0a('0x1da')](_0x1e189e,_0x28b703,_0x56758a,_0x1cdbe9,_0x5633c1)[_0xbf0a('0xb9')](function(_0x27f400){return _0x124bd5(_0x27f400);});default:return _0x53e68a(msgResponse(_0xbf0a('0x1db'),_0xbf0a('0x142'),'Unknown\x20Predictive'));}}else{return _0x53e68a(msgResponse(_0xbf0a('0x1db'),'Failure','check\x20failure'));}});};};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x1dc')]=function(_0x569932){var _0x5e9a6e=this;return function(_0x5a1def){return new BPromise(function(_0x3f74c4,_0x391598){_[_0xbf0a('0x8a')](_0x569932,_0x5a1def[0x0]);if(checkGetDataPredictive(_0x5a1def[0x0])){loggerPredictive[_0xbf0a('0x79')](JSON['stringify'](_0x5a1def[0x0]));if(_0x569932[_0xbf0a('0x1d7')]===_0xbf0a('0x1c7')){return _0x5e9a6e[_0xbf0a('0xc5')](_0x569932['id'])[_0xbf0a('0xb9')](function(_0x132947){var _0x4d0bf3=_0x569932['loggedIn']-_0x132947[0x0][_0xbf0a('0x1dd')];var _0x9343df=_0x569932[_0xbf0a('0x1cc')]*0x3c;var _0x2ed559=_0x5a1def[0x0][_0xbf0a('0x66')]+_0x5a1def[0x0][_0xbf0a('0x65')];var _0x4d5cdc=(_0x5a1def[0x0][_0xbf0a('0x64')]+_0x5a1def[0x0][_0xbf0a('0x7e')]+_0x5a1def[0x0][_0xbf0a('0x80')])/_0x5a1def[0x0][_0xbf0a('0x6b')];var _0x134aab=_0x569932[_0xbf0a('0x1c0')]/0x64;_0x569932[_0xbf0a('0x69')]=_0x132947[0x0][_0xbf0a('0x1dd')]||0x0;_0x569932['predictiveIntervalHitRate']=_0x4d5cdc>0x0?_0x4d5cdc:0x1;return _0x5e9a6e[_0xbf0a('0x1d8')](_0x4d0bf3,_0x9343df,_0x2ed559,_0x4d5cdc,_0x134aab);})['then'](function(_0x273f42){return _0x3f74c4(_0x273f42);})[_0xbf0a('0xb6')](function(_0x21589e){return _0x391598(msgResponse(_0xbf0a('0x1de'),'Failure',JSON[_0xbf0a('0x41')](_0x21589e)));});}if(_0x569932['dialPredictiveOptimization']===_0xbf0a('0x1d9')){return _0x5e9a6e['getVoiceQueueRtPauses'](_0x569932['id'])[_0xbf0a('0xb9')](function(_0x6d7dbf){var _0x3508c6=_0x569932[_0xbf0a('0x4b')]-_0x6d7dbf[0x0][_0xbf0a('0x1dd')];var _0x549661=_0x569932[_0xbf0a('0x1cc')]*0x3c;var _0x347db3=_0x5a1def[0x0][_0xbf0a('0x66')]+_0x5a1def[0x0][_0xbf0a('0x65')];var _0x4799da=(_0x5a1def[0x0]['predictiveIntervalAnsweredCalls']+_0x5a1def[0x0][_0xbf0a('0x7e')]+_0x5a1def[0x0][_0xbf0a('0x80')])/_0x5a1def[0x0][_0xbf0a('0x6b')];var _0x1f086a=_0x569932[_0xbf0a('0x1c0')]/0x64;_0x569932[_0xbf0a('0x69')]=_0x6d7dbf[0x0][_0xbf0a('0x1dd')]||0x0;_0x569932[_0xbf0a('0x1d6')]=_0x4799da>0x0?_0x4799da:0x1;return _0x5e9a6e[_0xbf0a('0x1da')](_0x3508c6,_0x549661,_0x347db3,_0x4799da,_0x1f086a);})[_0xbf0a('0xb9')](function(_0x1d6bde){return _0x3f74c4(_0x1d6bde);})[_0xbf0a('0xb6')](function(_0x89bd71){return _0x391598(msgResponse(_0xbf0a('0x1de'),_0xbf0a('0x142'),JSON['stringify'](_0x89bd71)));});}}else{return _0x391598(msgResponse(_0xbf0a('0x1db'),_0xbf0a('0x142'),_0xbf0a('0x1df')));}});};};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x1ce')]=function(_0x37cdc7){var _0x13ff26=this;return function(){var _0x37902c=0x0;var _0x50babb=Math['floor'](_0x37cdc7[_0xbf0a('0x6e')]*0x3e8);if(_0x50babb>0x0){_0x50babb=_0x50babb<0x64?0x64:_0x50babb;loggerPredictive[_0xbf0a('0x79')](_0x37cdc7['name'],_0xbf0a('0x1e0'),_0x50babb,_0xbf0a('0x42'));_0x37cdc7['handlePredictive']=setInterval(function(){_0x13ff26[_0xbf0a('0x8e')](_0x37cdc7);loggerPredictiveCalls[_0xbf0a('0x79')](_0xbf0a('0x1e1'),_0x37902c+=0x1);},_0x50babb);}else{loggerPredictive[_0xbf0a('0x79')](_0x37cdc7[_0xbf0a('0x37')],_0xbf0a('0x1e2'));}};};Dialer[_0xbf0a('0xa9')]['checkContactBlack']=function(_0x359ba2,_0xbbe4b0){var _0x181671=this;return function(_0x1a79d6){if(_[_0xbf0a('0x3f')](_0x1a79d6)){if(_[_0xbf0a('0xac')](_0xbbe4b0['UserId'])||!_0xbbe4b0[_0xbf0a('0x1e3')]){if(_0x359ba2[_0xbf0a('0x55')]===_0xbf0a('0x8')){_0x359ba2[_0xbf0a('0x127')]=_[_0xbf0a('0x35')](_0x359ba2['queueStatusComplete'])?!![]:_0x359ba2['queueStatusComplete'];var _0x16a9bc=uuid['v4']();_0x181671[_0xbf0a('0x120')][_0x16a9bc]=new Action(_0x359ba2,_0xbbe4b0,_0x16a9bc);loggerBooked[_0xbf0a('0x79')]('[booked][checkContactBlack]',_0x16a9bc,_0xbf0a('0x1e4'),JSON['stringify'](_0x359ba2['queueStatusComplete']),_0xbf0a('0x1e5'),_0x359ba2[_0xbf0a('0x37')]);if(_0x359ba2[_0xbf0a('0x127')]){_0x359ba2[_0xbf0a('0x127')]=![];_0x181671[_0xbf0a('0x23')][_0x181671[_0xbf0a('0x120')][_0x16a9bc]['queue']]=[];ami[_0xbf0a('0x14a')]({'actionid':_0x16a9bc,'action':'queuestatus','queue':_0x359ba2['name']})[_0xbf0a('0xb6')](function(){_0x181671[_0xbf0a('0xb0')](_0x359ba2);_0x181671['rescheduleContact']({'active':![],'ContactId':_0x181671[_0xbf0a('0x120')][_0x16a9bc]['ContactId'],'ListId':_0x181671[_0xbf0a('0x120')][_0x16a9bc]['ListId'],'VoiceQueueId':_0x181671['actions'][_0x16a9bc][_0xbf0a('0xd2')]||undefined,'CampaignId':_0x181671[_0xbf0a('0x120')][_0x16a9bc][_0xbf0a('0xd3')]||undefined})[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x1e6')));delete _0x181671[_0xbf0a('0x120')][_0x16a9bc];});}else{loggerBooked[_0xbf0a('0x79')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x359ba2['queueStatusComplete']),_0xbf0a('0x1e5'),_0x359ba2[_0xbf0a('0x37')]);_0x181671[_0xbf0a('0xb0')](_0x359ba2);_0x181671[_0xbf0a('0xbd')]({'active':![],'ContactId':_0x181671[_0xbf0a('0x120')][_0x16a9bc][_0xbf0a('0xd0')],'ListId':_0x181671[_0xbf0a('0x120')][_0x16a9bc]['ListId'],'VoiceQueueId':_0x181671[_0xbf0a('0x120')][_0x16a9bc]['VoiceQueueId']||undefined,'CampaignId':_0x181671[_0xbf0a('0x120')][_0x16a9bc]['CampaignId']||undefined})[_0xbf0a('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x181671[_0xbf0a('0x120')][_0x16a9bc];}}else{return _0x181671[_0xbf0a('0x1e7')](_0x359ba2,_0xbbe4b0);}}else{if(getDiff(_0xbbe4b0[_0xbf0a('0x1e8')])<_0x359ba2['dialRecallMeTimeout']*0x3c){if(_0xbbe4b0[_0xbf0a('0x1e9')]&&!_0xbbe4b0[_0xbf0a('0x1e9')][_0xbf0a('0x1ea')]){_0x181671[_0xbf0a('0x8f')][_0xbf0a('0x12b')](_0xbbe4b0['id'])[_0xbf0a('0x12e')](function(){_0x181671[_0xbf0a('0xb0')](_0x359ba2);});}else{_0x181671[_0xbf0a('0xbf')]({'active':![]},_0xbbe4b0['id'],0x1)['finally'](function(){_0x181671[_0xbf0a('0xb0')](_0x359ba2);});}}else{_0x359ba2[_0xbf0a('0x61')]+=0x1;_0x181671['updateOriginated'](_0x359ba2);if(_0x359ba2[_0xbf0a('0x1eb')]){_0x181671[_0xbf0a('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xbbe4b0[_0xbf0a('0xd0')],'ListId':_0xbbe4b0[_0xbf0a('0xfa')],'VoiceQueueId':_0xbbe4b0[_0xbf0a('0xd2')]||undefined,'CampaignId':_0xbbe4b0[_0xbf0a('0xd3')]||undefined})['catch'](loggerCatch(_0xbf0a('0x1ec')));_0x181671[_0xbf0a('0xc9')](createObjHistory(_0x359ba2,_0xbbe4b0,_0xbf0a('0x1ed'),0x17,_0xbf0a('0x1ee')))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0x1ef')));}else{_0x181671[_0xbf0a('0xcf')](createObjHistory(_0x359ba2,_0xbbe4b0,_0xbf0a('0x1f0'),0x16,_0xbf0a('0x1f1')),_0xbf0a('0x1f2'),_0xbf0a('0x1f3'));}}}}else{_0x359ba2[_0xbf0a('0x1f4')]+=0x1;_0x181671[_0xbf0a('0xcf')](createObjHistory(_0x359ba2,_0xbbe4b0,_0xbf0a('0x1f5'),0xd,_0xbf0a('0x1f6')),'[Originate][historyBlacklist]',_0xbf0a('0x1f7'));throw'inBlackList';}};};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x1f8')]=function(_0x561af7){var _0x2e7ecf=this;var _0x50b306=_0x561af7['limitCalls']-_0x561af7[_0xbf0a('0x6c')]-_0x561af7[_0xbf0a('0xc2')];emitCampaignSummary(_0x561af7);if(_0x50b306>0x0){if(_0x50b306>this[_0xbf0a('0x1f')]){_0x50b306=this[_0xbf0a('0x1f')];}_0x561af7[_0xbf0a('0xc2')]+=_0x50b306;this[_0xbf0a('0xc4')](_0x561af7['id'],_0x50b306,_0x561af7['dialOrderByScheduledAt'],_0x561af7)[_0xbf0a('0xb9')](function(_0x3a30c3){_0x561af7['temp']-=_0x50b306;_0x561af7[_0xbf0a('0xc2')]=_0x561af7[_0xbf0a('0xc2')]>0x0?_0x561af7[_0xbf0a('0xc2')]:0x0;if(!checkContactEmpty(_0x3a30c3)){_0x561af7['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xbf0a('0x1f9')+_0x561af7[_0xbf0a('0x37')]);}else{_0x561af7[_0xbf0a('0x6c')]+=_0x3a30c3['length'];_0x561af7[_0xbf0a('0x39')]=_0xbf0a('0x1fa');for(var _0x4c6983=0x0;_0x4c6983<_0x3a30c3[_0xbf0a('0x95')];_0x4c6983+=0x1){_0x561af7[_0xbf0a('0x1fb')]+=0x1;if(_[_0xbf0a('0xac')](_0x3a30c3[_0x4c6983])||_[_0xbf0a('0xac')](_0x3a30c3[_0x4c6983][_0xbf0a('0x166')])||_['isNil'](_0x3a30c3[_0x4c6983]['Contact'][_0xbf0a('0x167')])){_0x2e7ecf[_0xbf0a('0xce')](_0xbf0a('0x1fc'),_0x561af7,_0x3a30c3[_0x4c6983]);}else{_0x2e7ecf[_0xbf0a('0x1fd')](_['pick'](_0x3a30c3[_0x4c6983],[_0xbf0a('0xd3'),_0xbf0a('0x1fe')]))[_0xbf0a('0xb9')](_0x2e7ecf[_0xbf0a('0x1ff')](_0x561af7,_0x3a30c3[_0x4c6983]))[_0xbf0a('0xb6')](_0x2e7ecf[_0xbf0a('0xcd')](_0xbf0a('0x200'),_0x561af7));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x561af7,_0x50b306));}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x158')]=function(_0x4cf5e4,_0x29ab65){var _0x598ddd=this;var _0x396ed3=[];var _0x11b855=_0x29ab65>=0x1?_0x29ab65:0x1;if(_0x4cf5e4[_0xbf0a('0x55')]===_0xbf0a('0x8')){_0x11b855=0x1;}var _0x4b92fb=Math[_0xbf0a('0x201')](_0x4cf5e4[_0xbf0a('0x4a')]*_0x11b855)-_0x4cf5e4[_0xbf0a('0x6c')]-_0x4cf5e4['temp'];emitVoiceQueueSummary(_0x4cf5e4);if(_0x4cf5e4[_0xbf0a('0x202')]>0x0){var _0x5c0506=_0x4cf5e4['dialLimitQueue']-_0x4cf5e4[_0xbf0a('0x6c')]-_0x4cf5e4[_0xbf0a('0x4f')]-_0x4cf5e4[_0xbf0a('0xc2')]-_0x4cf5e4[_0xbf0a('0x9f')];if(_0x4b92fb>_0x5c0506){_0x4b92fb=_0x5c0506;}}if(_0x4b92fb>0x0){if(_0x4cf5e4[_0xbf0a('0x55')]===_0xbf0a('0x8')){_0x4b92fb=0x1;}if(_0x4b92fb>this[_0xbf0a('0x1f')]){_0x4b92fb=this['maxNumberOriginate'];}_0x4cf5e4[_0xbf0a('0xc2')]+=_0x4b92fb;for(var _0x29cf37 in this['agents']){if(typeof this[_0xbf0a('0x1d')][_0x29cf37]!==_0xbf0a('0x96')){if(this[_0xbf0a('0x1d')][_0x29cf37][_0xbf0a('0xa6')]===_0xbf0a('0x203')&&this['agents'][_0x29cf37][_0xbf0a('0xad')]===_0xbf0a('0x204')){_0x396ed3[_0xbf0a('0x125')](this[_0xbf0a('0x1d')][_0x29cf37]['id']);}}}this['getContactDialer'](_0x4cf5e4['id'],_0x396ed3,_0x4b92fb,_0x4cf5e4[_0xbf0a('0x205')],_0x4cf5e4)['then'](function(_0x30f64a){_0x4cf5e4[_0xbf0a('0xc2')]-=_0x4b92fb;_0x4cf5e4[_0xbf0a('0xc2')]=_0x4cf5e4[_0xbf0a('0xc2')]>0x0?_0x4cf5e4[_0xbf0a('0xc2')]:0x0;if(!checkContactEmpty(_0x30f64a)){_0x598ddd['countReScheduled'](_0x4cf5e4)[_0xbf0a('0xb9')](sendMessageReschedule(_0x4cf5e4))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xb7')));}else{_0x4cf5e4[_0xbf0a('0x6c')]+=_0x30f64a['length'];_0x4cf5e4[_0xbf0a('0x39')]=_0x4cf5e4[_0xbf0a('0x55')]===_0xbf0a('0x8')?_0xbf0a('0x206'):_0xbf0a('0x1fa');for(var _0x5b9701=0x0;_0x5b9701<_0x30f64a[_0xbf0a('0x95')];_0x5b9701+=0x1){if(_[_0xbf0a('0xac')](_0x30f64a[_0x5b9701])||_[_0xbf0a('0xac')](_0x30f64a[_0x5b9701][_0xbf0a('0x166')])||_['isNil'](_0x30f64a[_0x5b9701][_0xbf0a('0x166')]['phone'])){_0x598ddd['emptyContact'](_0xbf0a('0x1fc'),_0x4cf5e4,_0x30f64a[_0x5b9701]);}else{_0x598ddd['checkIsBlackList'](_[_0xbf0a('0x126')](_0x30f64a[_0x5b9701],[_0xbf0a('0xd2'),_0xbf0a('0x1fe')]))[_0xbf0a('0xb9')](_0x598ddd[_0xbf0a('0x1ff')](_0x4cf5e4,_0x30f64a[_0x5b9701]))[_0xbf0a('0xb6')](_0x598ddd[_0xbf0a('0xcd')]('[actionOriginate]\x20',_0x4cf5e4));}}}})['catch'](loggerGetContactDialer(_0xbf0a('0x207'),_0x4cf5e4,_0x4b92fb));}};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x8e')]=function(_0x16ec38){if(_0x16ec38[_0xbf0a('0x202')]>0x0){var _0x354804=_0x16ec38[_0xbf0a('0x202')]-_0x16ec38[_0xbf0a('0x6c')]-_0x16ec38['talking'];if(_0x354804>0x0){this[_0xbf0a('0x208')](_0x16ec38);}else{loggerPredictiveCalls[_0xbf0a('0x79')](_0xbf0a('0x209'));}}else{this[_0xbf0a('0x208')](_0x16ec38);}};Dialer[_0xbf0a('0xa9')]['tryOriginatePredictive']=function(_0x3204bd){var _0x31eec5=this;var _0x3c1278=[];_0x3204bd[_0xbf0a('0x6c')]+=0x1;for(var _0x596ef3 in this[_0xbf0a('0x1d')]){if(typeof this[_0xbf0a('0x1d')][_0x596ef3]!==_0xbf0a('0x96')){if(this[_0xbf0a('0x1d')][_0x596ef3][_0xbf0a('0xa6')]===_0xbf0a('0x203')&&this[_0xbf0a('0x1d')][_0x596ef3][_0xbf0a('0xad')]===_0xbf0a('0x204')){_0x3c1278['push'](this[_0xbf0a('0x1d')][_0x596ef3]['id']);}}}this[_0xbf0a('0xc1')](_0x3204bd['id'],_0x3c1278,0x1,_0x3204bd[_0xbf0a('0x205')],_0x3204bd)[_0xbf0a('0xb9')](function(_0x5a3f58){if(!checkContactEmpty(_0x5a3f58)){checkContactLowerLimitOriginate(_0x3204bd,0x1,0x0);_0x31eec5[_0xbf0a('0xb5')](_0x3204bd)[_0xbf0a('0xb9')](sendMessageReschedule(_0x3204bd))[_0xbf0a('0xb6')](loggerCatch(_0xbf0a('0xb7')));}else{_0x3204bd[_0xbf0a('0x39')]=_0xbf0a('0x1fa');if(_['isNil'](_0x5a3f58[0x0])||_[_0xbf0a('0xac')](_0x5a3f58[0x0][_0xbf0a('0x166')])||_[_0xbf0a('0xac')](_0x5a3f58[0x0][_0xbf0a('0x166')]['phone'])){_0x31eec5[_0xbf0a('0xce')](_0xbf0a('0x1fc'),_0x3204bd,_0x5a3f58[0x0]);}else{_0x31eec5['checkIsBlackList'](_['pick'](_0x5a3f58[0x0],[_0xbf0a('0xd2'),_0xbf0a('0x1fe')]))[_0xbf0a('0xb9')](_0x31eec5[_0xbf0a('0x1ff')](_0x3204bd,_0x5a3f58[0x0]))[_0xbf0a('0xb6')](_0x31eec5[_0xbf0a('0xcd')](_0xbf0a('0x20a'),_0x3204bd));}}})['catch'](loggerGetContactDialer(_0xbf0a('0x20b'),_0x3204bd,0x1));emitVoiceQueueSummary(_0x3204bd);};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x1d8')]=function(_0x37383f,_0x37abdd,_0x3d7d15,_0x284c25,_0x5580ef,_0x23da19){loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x20c'));loggerPredictive[_0xbf0a('0x79')]('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',_0x37383f);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x20d'),_0x37abdd);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x20e'),_0x3d7d15);loggerPredictive[_0xbf0a('0x79')]('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',_0x284c25);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x20f'),_0x5580ef);loggerPredictive['info'](_0xbf0a('0x82'));return new BPromise(function(_0x3eb1ad,_0x38826c){if(_0x37383f<=0x0||isNaN(_0x37383f)){return _0x38826c(msgResponse(_0xbf0a('0x210'),_0xbf0a('0x191'),'m\x20=\x20'+_0x37383f));}if(_0x3d7d15<=0x0||isNaN(_0x3d7d15)){return _0x38826c(msgResponse(_0xbf0a('0x210'),_0xbf0a('0x191'),'Ts\x20=\x20'+_0x3d7d15));}if(_0x284c25<=0x0||isNaN(_0x284c25)){return _0x38826c(msgResponse('[abandonmentRate]',_0xbf0a('0x191'),_0xbf0a('0x211')+_0x284c25));}if(_0x37abdd<=0x0||isNaN(_0x37abdd)){return _0x38826c(msgResponse(_0xbf0a('0x210'),'Error',_0xbf0a('0x212')+_0x37abdd));}if(_0x5580ef<=0x0||isNaN(_0x5580ef)){return _0x38826c(msgResponse(_0xbf0a('0x210'),'Error',_0xbf0a('0x213')+_0x5580ef));}_0x23da19=_0x23da19||0x0;var _0x4ca2af=0x1/_0x3d7d15;var _0x5b03b6=0x0;var _0x238df1=0x0;var _0x2ec716=0x0;var _0xd6336a=0x0;for(var _0x37c68c=0x0;_0x2ec716<_0x5580ef;_0x37c68c+=0x1){_0x238df1=_0x37c68c/_0x37abdd;_0x5b03b6=(_0x284c25*_0x238df1+_0x23da19)/_0x4ca2af;_0x2ec716=erlangb(_0x5b03b6,_0x37383f);_0xd6336a=_0x5b03b6/_0x37383f*(0x1-erlangb(_0x5b03b6,_0x37383f));}return _0x3eb1ad({'erlangCalls':_0x37c68c,'erlangCallToSecond':_0x37abdd/_0x37c68c,'erlangAbandonmentRate':_0x2ec716,'erlangBusyFactor':_0xd6336a});});};Dialer[_0xbf0a('0xa9')][_0xbf0a('0x1da')]=function(_0x6f66ce,_0xd215d3,_0x1a94a0,_0x69a069,_0x66c2d,_0x415f3f){loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x214'));loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x215'),_0x6f66ce);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x20d'),_0xd215d3);loggerPredictive[_0xbf0a('0x79')]('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',_0x1a94a0);loggerPredictive['info'](_0xbf0a('0x216'),_0x69a069);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x217'),_0x66c2d);loggerPredictive[_0xbf0a('0x79')](_0xbf0a('0x82'));return new BPromise(function(_0x5ddea9,_0x30a9cc){if(_0x6f66ce<=0x0||isNaN(_0x6f66ce)){return _0x30a9cc(msgResponse(_0xbf0a('0x218'),_0xbf0a('0x191'),'m\x20=\x20'+_0x6f66ce));}if(_0x1a94a0<=0x0||isNaN(_0x1a94a0)){return _0x30a9cc(msgResponse(_0xbf0a('0x218'),'Error','Ts\x20=\x20'+_0x1a94a0));}if(_0x69a069<=0x0||isNaN(_0x69a069)){return _0x30a9cc(msgResponse('[busyFactor]',_0xbf0a('0x191'),_0xbf0a('0x211')+_0x69a069));}if(_0xd215d3<=0x0||isNaN(_0xd215d3)){return _0x30a9cc(msgResponse(_0xbf0a('0x218'),_0xbf0a('0x191'),_0xbf0a('0x212')+_0xd215d3));}if(_0x66c2d<=0x0||isNaN(_0x66c2d)){return _0x30a9cc(msgResponse(_0xbf0a('0x218'),_0xbf0a('0x191'),'Umin\x20=\x20'+_0x66c2d));}_0x415f3f=_0x415f3f||0x0;var _0x1eefe0=0x1/_0x1a94a0;var _0x44cdb1=0x0;var _0x4d1539=0x0;var _0x287e0d=0x0;var _0xeb82c6=0x0;for(var _0x4a189e=0x0;_0xeb82c6<_0x66c2d;_0x4a189e+=0x1){_0x4d1539=_0x4a189e/_0xd215d3;_0x44cdb1=(_0x69a069*_0x4d1539+_0x415f3f)/_0x1eefe0;_0x287e0d=erlangb(_0x44cdb1,_0x6f66ce);_0xeb82c6=_0x44cdb1/_0x6f66ce*(0x1-erlangb(_0x44cdb1,_0x6f66ce));}return _0x5ddea9({'erlangCalls':_0x4a189e,'erlangCallToSecond':_0xd215d3/_0x4a189e,'erlangAbandonmentRate':_0x287e0d,'erlangBusyFactor':_0xeb82c6});});};module[_0xbf0a('0x219')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index a9acb0f..c51cec7 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 _0xeb0b=['number','starttime','responsetime','droptime','endtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum'];(function(_0x460066,_0x55e6e7){var _0x35f6d6=function(_0xe63aff){while(--_0xe63aff){_0x460066['push'](_0x460066['shift']());}};_0x35f6d6(++_0x55e6e7);}(_0xeb0b,0x1ad));var _0xbeb0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeb0b[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xbeb0('0x0'));var _=require(_0xbeb0('0x1'));var moment=require(_0xbeb0('0x2'));function getSeconds(_0x468d17,_0xfbcf69){var _0x36105c=moment(_0x468d17)['milliseconds'](0x0);var _0x9358b1=moment(_0xfbcf69)[_0xbeb0('0x3')](0x0);return _0x36105c[_0xbeb0('0x4')](_0x9358b1,'seconds');}function QueueCallerAbandon(_0x25f529,_0x58ac31){this[_0xbeb0('0x5')]=_0x25f529[_0xbeb0('0x5')];this[_0xbeb0('0x6')]=_0x25f529[_0xbeb0('0x6')];this[_0xbeb0('0x7')]=_0x25f529['type']===_0xbeb0('0x8')?_0xbeb0('0x9'):_0x25f529[_0xbeb0('0x6')];this[_0xbeb0('0xa')]=_0x25f529[_0xbeb0('0xa')];this[_0xbeb0('0xb')]=_0x25f529[_0xbeb0('0xb')];this[_0xbeb0('0xc')]=_0x25f529[_0xbeb0('0xc')];this[_0xbeb0('0xd')]=_0x25f529['countbusyretry']+_0x25f529[_0xbeb0('0xb')]+_0x25f529[_0xbeb0('0xc')]+_0x25f529[_0xbeb0('0xe')]+_0x25f529[_0xbeb0('0xf')]+_0x25f529['countabandonedretry']+_0x25f529[_0xbeb0('0x10')]+_0x25f529[_0xbeb0('0x11')];this['countnosuchnumberretry']=_0x25f529[_0xbeb0('0xe')];this[_0xbeb0('0xf')]=_0x25f529[_0xbeb0('0xf')];this['countabandonedretry']=_0x25f529[_0xbeb0('0x12')];this[_0xbeb0('0x10')]=_0x25f529[_0xbeb0('0x10')];this[_0xbeb0('0x11')]=_0x25f529[_0xbeb0('0x11')];this[_0xbeb0('0x13')]=_0x58ac31['uniqueid'];this['calleridname']=_0x25f529[_0xbeb0('0x14')];this[_0xbeb0('0x15')]=_0x25f529[_0xbeb0('0x16')];this[_0xbeb0('0x17')]=_0x25f529[_0xbeb0('0x17')];this['responsetime']=_0x25f529[_0xbeb0('0x18')];this[_0xbeb0('0x19')]=_0x25f529[_0xbeb0('0x19')];this[_0xbeb0('0x1a')]=this[_0xbeb0('0x19')];this['ringtime']=getSeconds(_0x25f529[_0xbeb0('0x18')],_0x25f529[_0xbeb0('0x17')]);this[_0xbeb0('0x1b')]=getSeconds(this[_0xbeb0('0x19')],_0x25f529[_0xbeb0('0x18')]);this['talktime']=0x0;this[_0xbeb0('0x9')]=_0x58ac31[_0xbeb0('0x9')];this[_0xbeb0('0x1c')]=_0x58ac31['connectedlinename'];this[_0xbeb0('0x1d')]=_0x58ac31[_0xbeb0('0x1d')];this['callback']=_0x25f529[_0xbeb0('0x1e')];this['callbackuniqueid']=_0x25f529[_0xbeb0('0x1f')];this[_0xbeb0('0x20')]=_0x25f529['callbackat'];this[_0xbeb0('0x21')]=_0x25f529['recallme'];this[_0xbeb0('0x22')]=_0x25f529[_0xbeb0('0x22')];this['ListId']=_0x25f529[_0xbeb0('0x23')];this[_0xbeb0('0x24')]=_0x25f529[_0xbeb0('0x24')];this[_0xbeb0('0x25')]=_0x25f529[_0xbeb0('0x25')];this['CampaignId']=_0x25f529['CampaignId'];this[_0xbeb0('0x26')]=_0x25f529[_0xbeb0('0x26')]||'';this[_0xbeb0('0x27')]=_0x25f529['originatecalleridname']||'';}module[_0xbeb0('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0x2021=['lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','droptime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x1faf65,_0x5e1b4e){var _0x537281=function(_0x5842f5){while(--_0x5842f5){_0x1faf65['push'](_0x1faf65['shift']());}};_0x537281(++_0x5e1b4e);}(_0x2021,0x1c2));var _0x1202=function(_0x509d98,_0x4d19fd){_0x509d98=_0x509d98-0x0;var _0x40e290=_0x2021[_0x509d98];return _0x40e290;};'use strict';var util=require(_0x1202('0x0'));var _=require(_0x1202('0x1'));var moment=require(_0x1202('0x2'));function getSeconds(_0x2f5885,_0x11d7f3){var _0x1d1e52=moment(_0x2f5885)['milliseconds'](0x0);var _0x46c47b=moment(_0x11d7f3)[_0x1202('0x3')](0x0);return _0x1d1e52[_0x1202('0x4')](_0x46c47b,_0x1202('0x5'));}function QueueCallerAbandon(_0x357c57,_0x39a569){this[_0x1202('0x6')]=_0x357c57[_0x1202('0x6')];this[_0x1202('0x7')]=_0x357c57['type'];this[_0x1202('0x8')]=_0x357c57[_0x1202('0x7')]===_0x1202('0x9')?_0x1202('0xa'):_0x357c57[_0x1202('0x7')];this[_0x1202('0xb')]=_0x357c57[_0x1202('0xb')];this[_0x1202('0xc')]=_0x357c57[_0x1202('0xc')];this['countnoanswerretry']=_0x357c57[_0x1202('0xd')];this[_0x1202('0xe')]=_0x357c57[_0x1202('0xb')]+_0x357c57[_0x1202('0xc')]+_0x357c57[_0x1202('0xd')]+_0x357c57[_0x1202('0xf')]+_0x357c57['countdropretry']+_0x357c57[_0x1202('0x10')]+_0x357c57[_0x1202('0x11')]+_0x357c57['countagentrejectretry'];this[_0x1202('0xf')]=_0x357c57['countnosuchnumberretry'];this[_0x1202('0x12')]=_0x357c57[_0x1202('0x12')];this['countabandonedretry']=_0x357c57['countabandonedretry'];this[_0x1202('0x11')]=_0x357c57[_0x1202('0x11')];this[_0x1202('0x13')]=_0x357c57['countagentrejectretry'];this['uniqueid']=_0x39a569[_0x1202('0x14')];this['calleridname']=_0x357c57[_0x1202('0x15')];this[_0x1202('0x16')]=_0x357c57['number'];this[_0x1202('0x17')]=_0x357c57[_0x1202('0x17')];this[_0x1202('0x18')]=_0x357c57[_0x1202('0x18')];this[_0x1202('0x19')]=_0x357c57[_0x1202('0x19')];this['endtime']=this[_0x1202('0x19')];this['ringtime']=getSeconds(_0x357c57[_0x1202('0x18')],_0x357c57[_0x1202('0x17')]);this[_0x1202('0x1a')]=getSeconds(this['droptime'],_0x357c57['responsetime']);this[_0x1202('0x1b')]=0x0;this['queue']=_0x39a569[_0x1202('0xa')];this[_0x1202('0x1c')]=_0x39a569[_0x1202('0x1d')];this[_0x1202('0x1e')]=_0x39a569[_0x1202('0x1e')];this[_0x1202('0x1f')]=_0x357c57[_0x1202('0x1f')];this[_0x1202('0x20')]=_0x357c57['callbackuniqueid'];this[_0x1202('0x21')]=_0x357c57[_0x1202('0x21')];this[_0x1202('0x22')]=_0x357c57['recallme'];this['ContactId']=_0x357c57['ContactId'];this[_0x1202('0x23')]=_0x357c57[_0x1202('0x23')];this[_0x1202('0x24')]=_0x357c57[_0x1202('0x24')];this['VoiceQueueId']=_0x357c57[_0x1202('0x25')];this['CampaignId']=_0x357c57['CampaignId'];this['originatecalleridnum']=_0x357c57[_0x1202('0x26')]||'';this[_0x1202('0x27')]=_0x357c57['originatecalleridname']||'';}module[_0x1202('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 7a6ab40..f9d9c03 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(_0x18fe63,_0x4894b1){var _0x4854c6=function(_0x1ca83b){while(--_0x1ca83b){_0x18fe63['push'](_0x18fe63['shift']());}};_0x4854c6(++_0x4894b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x280d9e,_0xb4cbfe){var _0xc24e98=function(_0x18b968){while(--_0x18b968){_0x280d9e['push'](_0x280d9e['shift']());}};_0xc24e98(++_0xb4cbfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 8101d9f..4f7c040 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 _0xe511=['checkTrunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','ext','isNil','active','format','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channels','channel','name','info','\x20syncNewchannel\x20','prototype','variable','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','stringify','\x20receiveFax\x20','pick','response','reason','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend'];(function(_0x5b41f1,_0x1a72d0){var _0x14cb16=function(_0x1ce02a){while(--_0x1ce02a){_0x5b41f1['push'](_0x5b41f1['shift']());}};_0x14cb16(++_0x1a72d0);}(_0xe511,0x16f));var _0x1e51=function(_0x1bab70,_0x399ccf){_0x1bab70=_0x1bab70-0x0;var _0x44a639=_0xe511[_0x1bab70];return _0x44a639;};'use strict';var util=require(_0x1e51('0x0'));var _=require(_0x1e51('0x1'));var BPromise=require('bluebird');var uuid=require(_0x1e51('0x2'));var moment=require('moment');var path=require(_0x1e51('0x3'));var tiff2pdf=require(_0x1e51('0x4'));var gs=require('./util/gs');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var ami=require(_0x1e51('0x7'));var rpcDb=require(_0x1e51('0x8'));var Channel=require('./channel');var ut=require(_0x1e51('0x9'));var Action=require(_0x1e51('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x1e51('0xb'));function Fax(_0x133021){this['channels']={};this['faxAccounts']=_0x133021[_0x1e51('0xc')];this[_0x1e51('0xd')]=_0x133021[_0x1e51('0xd')];this[_0x1e51('0xe')]={};ami['on'](_0x1e51('0xf'),this[_0x1e51('0x10')]['bind'](this));ami['on'](_0x1e51('0x11'),this[_0x1e51('0x12')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x14'),this[_0x1e51('0x15')][_0x1e51('0x13')](this));ami['on']('newexten',this[_0x1e51('0x16')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x17'),this[_0x1e51('0x18')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x19'),this[_0x1e51('0x1a')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x1b'),this[_0x1e51('0x1c')]['bind'](this));ami['on'](_0x1e51('0x1d'),this[_0x1e51('0x1e')][_0x1e51('0x13')](this));}Fax['prototype'][_0x1e51('0x10')]=function(_0x4f7aaf){if(_0x4f7aaf['context']===_0x1e51('0x1f')){for(var _0x27dcad in this[_0x1e51('0xc')]){if(this[_0x1e51('0xc')][_0x1e51('0x20')](_0x27dcad)){if(_0x4f7aaf[_0x1e51('0x21')]===this['faxAccounts'][_0x27dcad][_0x1e51('0x22')]){this['channels'][_0x4f7aaf[_0x1e51('0x23')]]={};this[_0x1e51('0x24')][_0x4f7aaf[_0x1e51('0x23')]][_0x1e51('0x25')]=_0x4f7aaf['channel'];this['channels'][_0x4f7aaf['uniqueid']]['id']=this['faxAccounts'][_0x27dcad]['id'];this[_0x1e51('0x24')][_0x4f7aaf['uniqueid']][_0x1e51('0x26')]=this[_0x1e51('0xc')][_0x27dcad][_0x1e51('0x26')];logger[_0x1e51('0x27')](_0x4f7aaf[_0x1e51('0x23')],_0x1e51('0x28'));}}}}if(this[_0x1e51('0xe')][_0x4f7aaf[_0x1e51('0x23')]]){this['channels'][_0x4f7aaf['uniqueid']]={};this[_0x1e51('0x24')][_0x4f7aaf[_0x1e51('0x23')]][_0x1e51('0x25')]=_0x4f7aaf[_0x1e51('0x25')];logger['info'](_0x4f7aaf['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x1e51('0x29')][_0x1e51('0x12')]=function(_0x433c2d){if(this['channels'][_0x433c2d[_0x1e51('0x23')]]){for(var _0x49c507 in _0x433c2d['variable']){if(_0x433c2d[_0x1e51('0x2a')]['hasOwnProperty'](_0x49c507)){this[_0x1e51('0x24')][_0x433c2d[_0x1e51('0x23')]][_0x49c507]=_0x433c2d['value'];}}}};Fax[_0x1e51('0x29')][_0x1e51('0x15')]=function(_0x71c7af){if(this[_0x1e51('0x24')][_0x71c7af['uniqueid']]){this['channels'][_0x71c7af['uniqueid']][_0x1e51('0x2b')]=_0x71c7af[_0x1e51('0x2b')];this[_0x1e51('0x24')][_0x71c7af[_0x1e51('0x23')]][_0x1e51('0x2c')]=_0x71c7af[_0x1e51('0x2c')];}};Fax[_0x1e51('0x29')][_0x1e51('0x16')]=function(_0x31b678){if(this[_0x1e51('0x24')][_0x31b678[_0x1e51('0x23')]]){for(var _0x54c84e in _0x31b678[_0x1e51('0x2a')]){if(_0x31b678[_0x1e51('0x2a')][_0x1e51('0x20')](_0x54c84e)){this[_0x1e51('0x24')][_0x31b678[_0x1e51('0x23')]][_0x54c84e]=_0x31b678['value'];}}}};Fax[_0x1e51('0x29')]['syncFaxStatus']=function(_0x2a7b70){if(this[_0x1e51('0x24')][_0x2a7b70[_0x1e51('0x23')]]){this['channels'][_0x2a7b70[_0x1e51('0x23')]]['operation']=_0x2a7b70[_0x1e51('0x2d')];this['channels'][_0x2a7b70['uniqueid']][_0x1e51('0x2e')]=_0x2a7b70[_0x1e51('0x2e')];this[_0x1e51('0x24')][_0x2a7b70['uniqueid']][_0x1e51('0x22')]=_0x2a7b70['localstationid'];this[_0x1e51('0x24')][_0x2a7b70[_0x1e51('0x23')]]['filename']=_0x2a7b70[_0x1e51('0x2f')];logger[_0x1e51('0x27')](_0x2a7b70[_0x1e51('0x23')],_0x1e51('0x30'));}};Fax[_0x1e51('0x29')][_0x1e51('0x1a')]=function(_0x5c57a6){var _0x509f7d=this;if(this[_0x1e51('0x24')][_0x5c57a6['uniqueid']]){var _0x3c6c35=this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]]['id'];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x31')]=_0x5c57a6[_0x1e51('0x31')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x32')]=_0x5c57a6[_0x1e51('0x32')];this['channels'][_0x5c57a6[_0x1e51('0x23')]]['localstationid']=_0x5c57a6[_0x1e51('0x22')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x33')]=_0x5c57a6[_0x1e51('0x33')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x34')]=_0x5c57a6[_0x1e51('0x34')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]]['filename']=_0x5c57a6['filename'];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x35')]=_0x5c57a6[_0x1e51('0x35')];if(this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x32')]>0x0){tiff2pdf(_0x5c57a6[_0x1e51('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x279fca){logger[_0x1e51('0x27')](_0x5c57a6[_0x1e51('0x23')],_0x1e51('0x36'),_0x279fca[_0x1e51('0x37')]);attachment[_0x1e51('0x38')]({'name':path[_0x1e51('0x39')](_0x5c57a6['filename'])[_0x1e51('0x26')],'basename':path[_0x1e51('0x39')](_0x5c57a6['filename'])[_0x1e51('0x26')]+_0x1e51('0x3a'),'type':_0x1e51('0x3b')})['then'](function(_0x2b0790){faxAccount[_0x1e51('0x3c')](_0x3c6c35,{'from':_0x5c57a6[_0x1e51('0x35')],'mapKey':_0x1e51('0x6'),'body':path[_0x1e51('0x39')](_0x5c57a6[_0x1e51('0x2f')])[_0x1e51('0x26')]+_0x1e51('0x3a'),'AttachmentId':_0x2b0790['id']})[_0x1e51('0x3d')](function(_0x551ca4){logger[_0x1e51('0x3e')](_0x5c57a6[_0x1e51('0x23')],'\x20notify\x20',JSON[_0x1e51('0x3f')](_0x551ca4));});})[_0x1e51('0x3d')](function(_0x139e9f){logger['error'](_0x5c57a6[_0x1e51('0x23')],_0x1e51('0x40'),JSON[_0x1e51('0x3f')](_0x139e9f));});});}logger['info'](_0x5c57a6[_0x1e51('0x23')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x169e6c){if(this[_0x1e51('0xe')][_0x169e6c['uniqueid']]){_['merge'](this[_0x1e51('0x24')][_0x169e6c[_0x1e51('0x23')]],_[_0x1e51('0x41')](_0x169e6c,[_0x1e51('0x42'),_0x1e51('0x43')]));}};function updateStatus(_0x54ce36){if(_0x54ce36['AttachmentId']){faxMessage[_0x1e51('0x44')](_0x54ce36['AttachmentId'],{'failMessage':_0x1e51('0x45')})[_0x1e51('0x46')](function(_0x47f9c7){ut['logger']('[Fax][Message][Error][Updated]',_0x47f9c7);})[_0x1e51('0x3d')](function(_0x1cad52){ut[_0x1e51('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x1cad52);});}else{ut[_0x1e51('0x47')](_0x1e51('0x48'));}}Fax[_0x1e51('0x29')][_0x1e51('0x49')]=function(_0x1ccb55,_0x12584c,_0x32fe1f){var _0x2ca91f=this;var _0x5b64f6={};if(_0x12584c){_0x5b64f6={'read':_0x12584c};}else{_0x5b64f6={'failMessage':_0x32fe1f};}if(this[_0x1e51('0xe')][_0x1ccb55][_0x1e51('0x4a')]){faxMessage[_0x1e51('0x44')](this[_0x1e51('0xe')][_0x1ccb55][_0x1e51('0x4a')],_0x5b64f6)[_0x1e51('0x46')](function(_0x5ba6c2){ut[_0x1e51('0x47')]('[Fax][Message][Updated]',_0x5ba6c2);})['catch'](function(_0x4807b9){ut[_0x1e51('0x47')](_0x1e51('0x4b'),_0x4807b9);})[_0x1e51('0x4c')](function(){delete _0x2ca91f['channels'][_0x1ccb55];delete _0x2ca91f[_0x1e51('0xe')][_0x1ccb55];});}else{ut[_0x1e51('0x47')](_0x1e51('0x4d'));delete this['channels'][_0x1ccb55];delete this[_0x1e51('0xe')][_0x1ccb55];}};Fax[_0x1e51('0x29')][_0x1e51('0x1c')]=function(_0x570193){var _0x2d5e58=this;if(this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]){if(this[_0x1e51('0xe')][_0x570193[_0x1e51('0x23')]]){this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['id']=this[_0x1e51('0xe')][_0x570193['uniqueid']]['id'];this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['name']=this['actions'][_0x570193['uniqueid']][_0x1e51('0x26')];}logger[_0x1e51('0x27')](_0x570193[_0x1e51('0x23')],this[_0x1e51('0xe')][_0x570193[_0x1e51('0x23')]]?_0x1e51('0x4e'):_0x1e51('0x4f'),JSON[_0x1e51('0x3f')](this[_0x1e51('0x24')][_0x570193['uniqueid']]));if(this['actions'][_0x570193['uniqueid']]){if(this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['faxpages']>0x0&&this['channels'][_0x570193[_0x1e51('0x23')]][_0x1e51('0x17')]==='SUCCESS'){this[_0x1e51('0x49')](_0x570193[_0x1e51('0x23')],!![]);}else{this[_0x1e51('0x49')](_0x570193[_0x1e51('0x23')],![],this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]][_0x1e51('0x50')]?_0x1e51('0x51')+this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['faxstatusstring']:_0x1e51('0x52'));}}}};Fax[_0x1e51('0x29')][_0x1e51('0x53')]=function(_0x402bbd){var _0xc720e2=this;return new BPromise(function(_0x224dbc,_0x47cc50){_0xc720e2['execOriginate'](_0x402bbd,_0xc720e2[_0x1e51('0xc')][_0x402bbd[_0x1e51('0x54')]])[_0x1e51('0x46')](function(_0x13fb81){ut['logger']('[Fax][execOriginate][success]',_0x13fb81);_0x224dbc(ut['message'](_0x1e51('0x55')));})[_0x1e51('0x3d')](function(_0x100126){ut[_0x1e51('0x47')](_0x1e51('0x56'),_0x100126);updateStatus(_0x402bbd);_0x47cc50(ut['message'](_0x1e51('0x57')));});});};Fax[_0x1e51('0x29')][_0x1e51('0x58')]=function(_0x556b74){var _0x2d0ff0=this;return new BPromise(function(_0x77f0c1,_0x45e607){var _0x5f19af=_0x2d0ff0[_0x1e51('0x59')](_0x2d0ff0[_0x1e51('0xc')][_0x556b74['FaxAccountId']]['Trunk'],_0x556b74);if(_0x5f19af[_0x1e51('0x5a')]){_0x77f0c1(ut['message'](_0x1e51('0x5b')));}else{_0x45e607(ut['message'](_0x5f19af[_0x1e51('0x37')]));}});};function originate(_0xe1cfa0,_0x35f12e,_0x457e4a){return new BPromise(function(_0x5142ed,_0x37f3e6){if(_0x457e4a){var _0x4c9871=util['format'](_0x1e51('0x5c'),path[_0x1e51('0x39')](_0xe1cfa0[_0x1e51('0x3')])['name'],_0xe1cfa0[_0x1e51('0x3')]);gs[_0x1e51('0x5d')](_0x4c9871)[_0x1e51('0x46')](function(){_0xe1cfa0[_0x1e51('0x3')]=util['format'](_0x1e51('0x5e'),path['parse'](_0xe1cfa0['path'])[_0x1e51('0x5f')],path['parse'](_0xe1cfa0[_0x1e51('0x3')])['name']);_0x35f12e[_0x1e51('0x60')]=_0xe1cfa0['path'];ut[_0x1e51('0x47')](_0x1e51('0x61'),'');ami['Action'](ut[_0x1e51('0x62')](_0xe1cfa0,_0x35f12e))['then'](function(_0x204962){_0x5142ed(_0x204962);})[_0x1e51('0x3d')](function(_0x1d2753){_0x37f3e6(_0x1d2753);});})[_0x1e51('0x3d')](function(_0x2cda1a){_0x37f3e6(_0x2cda1a);});}else{ami[_0x1e51('0x63')](ut['variablesAction'](_0xe1cfa0,_0x35f12e))[_0x1e51('0x46')](function(_0x5054b0){_0x5142ed(_0x5054b0);})['catch'](function(_0x23068f){_0x37f3e6(_0x23068f);});}});}Fax[_0x1e51('0x29')][_0x1e51('0x64')]=function(_0x7091fe,_0x38dda4){var _0x25d128=this;return new BPromise(function(_0x41b43b,_0x51ef46){var _0x39dc12=uuid['v4']();var _0x260f4a=ut[_0x1e51('0x65')](_0x7091fe,_0x38dda4);_0x25d128['actions'][_0x39dc12]=new Action(_0x39dc12,_0x38dda4,_0x7091fe);var _0x4da887=_0x25d128[_0x1e51('0xe')][_0x39dc12];if(path[_0x1e51('0x39')](_0x7091fe['path'])[_0x1e51('0x66')]===_0x1e51('0x3a')){originate(_0x4da887,_0x260f4a,!![])['then'](function(_0x5eb939){_0x41b43b(_0x5eb939);})[_0x1e51('0x3d')](function(_0x49263c){_0x51ef46(_0x49263c);});}else{originate(_0x4da887,_0x260f4a,![])[_0x1e51('0x46')](function(_0x1d6a02){_0x41b43b(_0x1d6a02);})[_0x1e51('0x3d')](function(_0xd450df){_0x51ef46(_0xd450df);});}});};Fax[_0x1e51('0x29')]['isTrunkReachable']=function(_0x4e3460){return!_[_0x1e51('0x67')](_0x4e3460)&&!_[_0x1e51('0x67')](_0x4e3460['name'])&&!_[_0x1e51('0x67')](_0x4e3460[_0x1e51('0x68')])&&_0x4e3460['active']&&!_[_0x1e51('0x67')](this['trunks'][util[_0x1e51('0x69')]('SIP/%s',_0x4e3460['name'])])&&!_['isNil'](this['trunks'][util['format']('SIP/%s',_0x4e3460[_0x1e51('0x26')])]['status'])&&(this[_0x1e51('0xd')][util['format'](_0x1e51('0x6a'),_0x4e3460[_0x1e51('0x26')])][_0x1e51('0x2e')]==='reachable'||this[_0x1e51('0xd')][util[_0x1e51('0x69')]('SIP/%s',_0x4e3460[_0x1e51('0x26')])]['status']===_0x1e51('0x6b'));};Fax['prototype'][_0x1e51('0x59')]=function(_0x42318c,_0x2d5062){if(!this[_0x1e51('0x6c')](_0x42318c)){ut[_0x1e51('0x47')](_0x1e51('0x6d'),_['isNil'](_0x42318c)?'':_0x42318c[_0x1e51('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x1e51('0x6e')};}if(_[_0x1e51('0x67')](_0x2d5062[_0x1e51('0x6')])){ut[_0x1e51('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x2d5062));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x1e51('0x67')](_0x2d5062[_0x1e51('0x3')])){ut[_0x1e51('0x47')](_0x1e51('0x6f'),JSON['stringify'](_0x2d5062));return{'isValid':![],'message':_0x1e51('0x70')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x1e51('0x71')]=Fax; \ No newline at end of file +var _0x2032=['actions','newchannel','bind','syncVarSet','newstate','syncNewState','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x2032,0xd9));var _0x2203=function(_0x12395e,_0x4cdf14){_0x12395e=_0x12395e-0x0;var _0x4fab0f=_0x2032[_0x12395e];return _0x4fab0f;};'use strict';var util=require('util');var _=require(_0x2203('0x0'));var BPromise=require(_0x2203('0x1'));var uuid=require(_0x2203('0x2'));var moment=require('moment');var path=require(_0x2203('0x3'));var tiff2pdf=require(_0x2203('0x4'));var gs=require('./util/gs');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var ami=require(_0x2203('0x7'));var rpcDb=require(_0x2203('0x8'));var Channel=require(_0x2203('0x9'));var ut=require(_0x2203('0xa'));var Action=require(_0x2203('0xb'));var faxAccount=require(_0x2203('0xc'));var attachment=require(_0x2203('0xd'));var faxMessage=require(_0x2203('0xe'));function Fax(_0x2999ed){this['channels']={};this['faxAccounts']=_0x2999ed[_0x2203('0xf')];this['trunks']=_0x2999ed[_0x2203('0x10')];this[_0x2203('0x11')]={};ami['on'](_0x2203('0x12'),this['syncNewchannel'][_0x2203('0x13')](this));ami['on']('varset',this[_0x2203('0x14')]['bind'](this));ami['on'](_0x2203('0x15'),this[_0x2203('0x16')]['bind'](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0x2203('0x17')]['bind'](this));ami['on']('receivefax',this[_0x2203('0x18')][_0x2203('0x13')](this));ami['on'](_0x2203('0x19'),this[_0x2203('0x1a')][_0x2203('0x13')](this));ami['on'](_0x2203('0x1b'),this[_0x2203('0x1c')][_0x2203('0x13')](this));}Fax[_0x2203('0x1d')][_0x2203('0x1e')]=function(_0x5129fb){if(_0x5129fb[_0x2203('0x1f')]===_0x2203('0x20')){for(var _0x4893ff in this[_0x2203('0xf')]){if(this[_0x2203('0xf')]['hasOwnProperty'](_0x4893ff)){if(_0x5129fb[_0x2203('0x21')]===this['faxAccounts'][_0x4893ff][_0x2203('0x22')]){this[_0x2203('0x23')][_0x5129fb[_0x2203('0x24')]]={};this[_0x2203('0x23')][_0x5129fb[_0x2203('0x24')]][_0x2203('0x25')]=_0x5129fb['channel'];this[_0x2203('0x23')][_0x5129fb['uniqueid']]['id']=this['faxAccounts'][_0x4893ff]['id'];this[_0x2203('0x23')][_0x5129fb['uniqueid']][_0x2203('0x26')]=this[_0x2203('0xf')][_0x4893ff]['name'];logger[_0x2203('0x27')](_0x5129fb['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x2203('0x11')][_0x5129fb[_0x2203('0x24')]]){this[_0x2203('0x23')][_0x5129fb[_0x2203('0x24')]]={};this[_0x2203('0x23')][_0x5129fb[_0x2203('0x24')]][_0x2203('0x25')]=_0x5129fb[_0x2203('0x25')];logger['info'](_0x5129fb[_0x2203('0x24')],_0x2203('0x28'));}};Fax[_0x2203('0x1d')]['syncVarSet']=function(_0xb2071b){if(this[_0x2203('0x23')][_0xb2071b['uniqueid']]){for(var _0xd6e109 in _0xb2071b[_0x2203('0x29')]){if(_0xb2071b[_0x2203('0x29')][_0x2203('0x2a')](_0xd6e109)){this[_0x2203('0x23')][_0xb2071b[_0x2203('0x24')]][_0xd6e109]=_0xb2071b[_0x2203('0x2b')];}}}};Fax['prototype'][_0x2203('0x16')]=function(_0x616ed8){if(this[_0x2203('0x23')][_0x616ed8[_0x2203('0x24')]]){this['channels'][_0x616ed8[_0x2203('0x24')]][_0x2203('0x2c')]=_0x616ed8[_0x2203('0x2c')];this[_0x2203('0x23')][_0x616ed8['uniqueid']][_0x2203('0x2d')]=_0x616ed8[_0x2203('0x2d')];}};Fax['prototype']['syncNewExten']=function(_0x1d5f74){if(this['channels'][_0x1d5f74['uniqueid']]){for(var _0x125dfc in _0x1d5f74[_0x2203('0x29')]){if(_0x1d5f74[_0x2203('0x29')][_0x2203('0x2a')](_0x125dfc)){this[_0x2203('0x23')][_0x1d5f74['uniqueid']][_0x125dfc]=_0x1d5f74[_0x2203('0x2b')];}}}};Fax[_0x2203('0x1d')]['syncFaxStatus']=function(_0x2a2ee7){if(this[_0x2203('0x23')][_0x2a2ee7[_0x2203('0x24')]]){this[_0x2203('0x23')][_0x2a2ee7[_0x2203('0x24')]][_0x2203('0x2e')]=_0x2a2ee7[_0x2203('0x2e')];this[_0x2203('0x23')][_0x2a2ee7[_0x2203('0x24')]]['status']=_0x2a2ee7[_0x2203('0x2f')];this[_0x2203('0x23')][_0x2a2ee7['uniqueid']]['localstationid']=_0x2a2ee7[_0x2203('0x22')];this['channels'][_0x2a2ee7[_0x2203('0x24')]][_0x2203('0x30')]=_0x2a2ee7[_0x2203('0x30')];logger['info'](_0x2a2ee7['uniqueid'],_0x2203('0x31'));}};Fax['prototype'][_0x2203('0x18')]=function(_0x5cfe5e){var _0x11451e=this;if(this['channels'][_0x5cfe5e[_0x2203('0x24')]]){var _0x13ed9e=this[_0x2203('0x23')][_0x5cfe5e[_0x2203('0x24')]]['id'];this[_0x2203('0x23')][_0x5cfe5e['uniqueid']]['remotestationid']=_0x5cfe5e['remotestationid'];this[_0x2203('0x23')][_0x5cfe5e[_0x2203('0x24')]][_0x2203('0x32')]=_0x5cfe5e[_0x2203('0x32')];this[_0x2203('0x23')][_0x5cfe5e[_0x2203('0x24')]][_0x2203('0x22')]=_0x5cfe5e['localstationid'];this[_0x2203('0x23')][_0x5cfe5e[_0x2203('0x24')]][_0x2203('0x33')]=_0x5cfe5e[_0x2203('0x33')];this['channels'][_0x5cfe5e['uniqueid']][_0x2203('0x34')]=_0x5cfe5e['transferrate'];this[_0x2203('0x23')][_0x5cfe5e[_0x2203('0x24')]][_0x2203('0x30')]=_0x5cfe5e['filename'];this['channels'][_0x5cfe5e[_0x2203('0x24')]][_0x2203('0x35')]=_0x5cfe5e[_0x2203('0x35')];if(this[_0x2203('0x23')][_0x5cfe5e[_0x2203('0x24')]][_0x2203('0x32')]>0x0){tiff2pdf(_0x5cfe5e['filename'],_0x2203('0x36'),function(_0x165a3f){logger[_0x2203('0x27')](_0x5cfe5e[_0x2203('0x24')],_0x2203('0x37'),_0x165a3f[_0x2203('0x38')]);attachment[_0x2203('0x39')]({'name':path[_0x2203('0x3a')](_0x5cfe5e[_0x2203('0x30')])[_0x2203('0x26')],'basename':path['parse'](_0x5cfe5e[_0x2203('0x30')])[_0x2203('0x26')]+_0x2203('0x3b'),'type':_0x2203('0x3c')})['then'](function(_0x58bd5c){faxAccount[_0x2203('0x3d')](_0x13ed9e,{'from':_0x5cfe5e['calleridnum'],'mapKey':_0x2203('0x6'),'body':path[_0x2203('0x3a')](_0x5cfe5e[_0x2203('0x30')])[_0x2203('0x26')]+'.pdf','AttachmentId':_0x58bd5c['id']})[_0x2203('0x3e')](function(_0x102803){logger['error'](_0x5cfe5e[_0x2203('0x24')],_0x2203('0x3f'),JSON[_0x2203('0x40')](_0x102803));});})[_0x2203('0x3e')](function(_0x5a71a5){logger['error'](_0x5cfe5e[_0x2203('0x24')],'\x20receiveFax\x20',JSON['stringify'](_0x5a71a5));});});}logger[_0x2203('0x27')](_0x5cfe5e[_0x2203('0x24')],_0x2203('0x41'));}};Fax['prototype']['syncOriginateResponse']=function(_0x131aec){if(this[_0x2203('0x11')][_0x131aec[_0x2203('0x24')]]){_[_0x2203('0x42')](this[_0x2203('0x23')][_0x131aec[_0x2203('0x24')]],_['pick'](_0x131aec,[_0x2203('0x43'),'reason']));}};function updateStatus(_0x3f7685){if(_0x3f7685[_0x2203('0x44')]){faxMessage[_0x2203('0x45')](_0x3f7685[_0x2203('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x30d503){ut[_0x2203('0x46')](_0x2203('0x47'),_0x30d503);})[_0x2203('0x3e')](function(_0x559370){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x559370);});}else{ut[_0x2203('0x46')](_0x2203('0x48'));}}Fax['prototype'][_0x2203('0x49')]=function(_0x267627,_0x538d17,_0x32b1db){var _0xb47204=this;var _0x172c6a={};if(_0x538d17){_0x172c6a={'read':_0x538d17};}else{_0x172c6a={'failMessage':_0x32b1db};}if(this[_0x2203('0x11')][_0x267627]['AttachmentId']){faxMessage[_0x2203('0x45')](this['actions'][_0x267627][_0x2203('0x44')],_0x172c6a)[_0x2203('0x4a')](function(_0x4ee8cf){ut[_0x2203('0x46')](_0x2203('0x4b'),_0x4ee8cf);})[_0x2203('0x3e')](function(_0x378132){ut[_0x2203('0x46')](_0x2203('0x4c'),_0x378132);})['finally'](function(){delete _0xb47204['channels'][_0x267627];delete _0xb47204[_0x2203('0x11')][_0x267627];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x2203('0x23')][_0x267627];delete this[_0x2203('0x11')][_0x267627];}};Fax[_0x2203('0x1d')]['syncHangup']=function(_0x213c24){var _0x4b2788=this;if(this['channels'][_0x213c24[_0x2203('0x24')]]){if(this['actions'][_0x213c24['uniqueid']]){this['channels'][_0x213c24[_0x2203('0x24')]]['id']=this[_0x2203('0x11')][_0x213c24[_0x2203('0x24')]]['id'];this[_0x2203('0x23')][_0x213c24[_0x2203('0x24')]][_0x2203('0x26')]=this[_0x2203('0x11')][_0x213c24[_0x2203('0x24')]][_0x2203('0x26')];}logger[_0x2203('0x27')](_0x213c24[_0x2203('0x24')],this[_0x2203('0x11')][_0x213c24['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x2203('0x4d'),JSON[_0x2203('0x40')](this[_0x2203('0x23')][_0x213c24[_0x2203('0x24')]]));if(this[_0x2203('0x11')][_0x213c24[_0x2203('0x24')]]){if(this['channels'][_0x213c24['uniqueid']][_0x2203('0x4e')]>0x0&&this[_0x2203('0x23')][_0x213c24[_0x2203('0x24')]][_0x2203('0x4f')]===_0x2203('0x50')){this[_0x2203('0x49')](_0x213c24[_0x2203('0x24')],!![]);}else{this[_0x2203('0x49')](_0x213c24[_0x2203('0x24')],![],this[_0x2203('0x23')][_0x213c24[_0x2203('0x24')]]['faxstatusstring']?_0x2203('0x51')+this[_0x2203('0x23')][_0x213c24[_0x2203('0x24')]][_0x2203('0x52')]:_0x2203('0x53'));}}}};Fax[_0x2203('0x1d')][_0x2203('0x54')]=function(_0x544756){var _0x286121=this;return new BPromise(function(_0x35b7b9,_0x49e795){_0x286121[_0x2203('0x55')](_0x544756,_0x286121[_0x2203('0xf')][_0x544756[_0x2203('0x56')]])[_0x2203('0x4a')](function(_0x34e820){ut[_0x2203('0x46')](_0x2203('0x57'),_0x34e820);_0x35b7b9(ut[_0x2203('0x38')](_0x2203('0x58')));})['catch'](function(_0x468619){ut[_0x2203('0x46')](_0x2203('0x59'),_0x468619);updateStatus(_0x544756);_0x49e795(ut['message'](_0x2203('0x5a')));});});};Fax[_0x2203('0x1d')][_0x2203('0x5b')]=function(_0x1b7aa8){var _0x403b89=this;return new BPromise(function(_0x556efa,_0x38b077){var _0x11243d=_0x403b89[_0x2203('0x5c')](_0x403b89['faxAccounts'][_0x1b7aa8['FaxAccountId']]['Trunk'],_0x1b7aa8);if(_0x11243d['isValid']){_0x556efa(ut['message'](_0x2203('0x5d')));}else{_0x38b077(ut[_0x2203('0x38')](_0x11243d[_0x2203('0x38')]));}});};function originate(_0x145c59,_0x4287f4,_0x169845){return new BPromise(function(_0x3f7926,_0x44bea0){if(_0x169845){var _0x56dcbe=util['format'](_0x2203('0x5e'),path[_0x2203('0x3a')](_0x145c59[_0x2203('0x3')])[_0x2203('0x26')],_0x145c59[_0x2203('0x3')]);gs[_0x2203('0x5f')](_0x56dcbe)[_0x2203('0x4a')](function(){_0x145c59[_0x2203('0x3')]=util[_0x2203('0x60')](_0x2203('0x61'),path[_0x2203('0x3a')](_0x145c59[_0x2203('0x3')])[_0x2203('0x62')],path[_0x2203('0x3a')](_0x145c59[_0x2203('0x3')])[_0x2203('0x26')]);_0x4287f4[_0x2203('0x63')]=_0x145c59[_0x2203('0x3')];ut[_0x2203('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0x2203('0x64')](ut['variablesAction'](_0x145c59,_0x4287f4))[_0x2203('0x4a')](function(_0x55ecbb){_0x3f7926(_0x55ecbb);})[_0x2203('0x3e')](function(_0xf71e7e){_0x44bea0(_0xf71e7e);});})[_0x2203('0x3e')](function(_0x2f3522){_0x44bea0(_0x2f3522);});}else{ami[_0x2203('0x64')](ut[_0x2203('0x65')](_0x145c59,_0x4287f4))[_0x2203('0x4a')](function(_0x2eab08){_0x3f7926(_0x2eab08);})['catch'](function(_0x4cd079){_0x44bea0(_0x4cd079);});}});}Fax[_0x2203('0x1d')][_0x2203('0x55')]=function(_0x18d583,_0x484549){var _0x48c6c9=this;return new BPromise(function(_0x54878d,_0xdff006){var _0x2d26ba=uuid['v4']();var _0x20385b=ut[_0x2203('0x66')](_0x18d583,_0x484549);_0x48c6c9['actions'][_0x2d26ba]=new Action(_0x2d26ba,_0x484549,_0x18d583);var _0x2f7850=_0x48c6c9['actions'][_0x2d26ba];if(path[_0x2203('0x3a')](_0x18d583[_0x2203('0x3')])[_0x2203('0x67')]===_0x2203('0x3b')){originate(_0x2f7850,_0x20385b,!![])[_0x2203('0x4a')](function(_0x56c79a){_0x54878d(_0x56c79a);})[_0x2203('0x3e')](function(_0x247f26){_0xdff006(_0x247f26);});}else{originate(_0x2f7850,_0x20385b,![])[_0x2203('0x4a')](function(_0x4a5f15){_0x54878d(_0x4a5f15);})[_0x2203('0x3e')](function(_0x45d235){_0xdff006(_0x45d235);});}});};Fax[_0x2203('0x1d')][_0x2203('0x68')]=function(_0x1c65f9){return!_[_0x2203('0x69')](_0x1c65f9)&&!_[_0x2203('0x69')](_0x1c65f9[_0x2203('0x26')])&&!_[_0x2203('0x69')](_0x1c65f9[_0x2203('0x6a')])&&_0x1c65f9[_0x2203('0x6a')]&&!_['isNil'](this[_0x2203('0x10')][util[_0x2203('0x60')](_0x2203('0x6b'),_0x1c65f9[_0x2203('0x26')])])&&!_[_0x2203('0x69')](this[_0x2203('0x10')][util[_0x2203('0x60')](_0x2203('0x6b'),_0x1c65f9[_0x2203('0x26')])][_0x2203('0x2f')])&&(this[_0x2203('0x10')][util[_0x2203('0x60')]('SIP/%s',_0x1c65f9['name'])][_0x2203('0x2f')]===_0x2203('0x6c')||this[_0x2203('0x10')][util[_0x2203('0x60')](_0x2203('0x6b'),_0x1c65f9['name'])][_0x2203('0x2f')]===_0x2203('0x6d'));};Fax['prototype']['checkTrunk']=function(_0x4edac6,_0x4fc51a){if(!this['isTrunkReachable'](_0x4edac6)){ut[_0x2203('0x46')](_0x2203('0x6e'),_[_0x2203('0x69')](_0x4edac6)?'':_0x4edac6['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x2203('0x69')](_0x4fc51a[_0x2203('0x6')])){ut[_0x2203('0x46')](_0x2203('0x6f'),JSON[_0x2203('0x40')](_0x4fc51a));return{'isValid':![],'message':_0x2203('0x70')};}if(_[_0x2203('0x69')](_0x4fc51a['path'])){ut[_0x2203('0x46')](_0x2203('0x71'),JSON[_0x2203('0x40')](_0x4fc51a));return{'isValid':![],'message':_0x2203('0x72')};}return{'isValid':!![],'message':_0x2203('0x73')};};module[_0x2203('0x74')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f801b19..00face9 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 _0xede1=['lodash','../rpc/faxAccount','error','then','notify','catch','util','bluebird','../../../config/logger','preview'];(function(_0x2c8df0,_0x143fc2){var _0x416e43=function(_0x33791f){while(--_0x33791f){_0x2c8df0['push'](_0x2c8df0['shift']());}};_0x416e43(++_0x143fc2);}(_0xede1,0x114));var _0x1ede=function(_0x1a3166,_0x21ba52){_0x1a3166=_0x1a3166-0x0;var _0x391f54=_0xede1[_0x1a3166];return _0x391f54;};'use strict';var util=require(_0x1ede('0x0'));var BPromise=require(_0x1ede('0x1'));var logger=require(_0x1ede('0x2'))(_0x1ede('0x3'));var _=require(_0x1ede('0x4'));var faxAccount=require(_0x1ede('0x5'));function loggerCatch(_0x16346b){return function(_0xd62f00){logger[_0x1ede('0x6')](_0x16346b,util['inspect'](_0xd62f00,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4848b4,_0x331687){return BPromise['resolve']()[_0x1ede('0x7')](faxAccount[_0x1ede('0x8')](_0x4848b4,_0x331687))[_0x1ede('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x2f13=['lodash','../rpc/faxAccount','error','notify','then','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x20c72d,_0x277a2d){var _0xb4dc5=function(_0x556bf0){while(--_0x556bf0){_0x20c72d['push'](_0x20c72d['shift']());}};_0xb4dc5(++_0x277a2d);}(_0x2f13,0x14a));var _0x32f1=function(_0x33761c,_0x2af443){_0x33761c=_0x33761c-0x0;var _0x15d67b=_0x2f13[_0x33761c];return _0x15d67b;};'use strict';var util=require(_0x32f1('0x0'));var BPromise=require(_0x32f1('0x1'));var logger=require(_0x32f1('0x2'))('preview');var _=require(_0x32f1('0x3'));var faxAccount=require(_0x32f1('0x4'));function loggerCatch(_0x3ea2db){return function(_0xb95595){logger[_0x32f1('0x5')](_0x3ea2db,util['inspect'](_0xb95595,{'showHidden':![],'depth':null}));};}exports[_0x32f1('0x6')]=function(_0x169d53,_0x2b2f07){return BPromise['resolve']()[_0x32f1('0x7')](faxAccount[_0x32f1('0x6')](_0x169d53,_0x2b2f07))['catch'](loggerCatch(_0x32f1('0x8')));}; \ 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 7b60423..0a91613 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 _0x8c35=['fax','bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger'];(function(_0x3d46ec,_0x223ab2){var _0x535ef3=function(_0x312e32){while(--_0x312e32){_0x3d46ec['push'](_0x3d46ec['shift']());}};_0x535ef3(++_0x223ab2);}(_0x8c35,0x103));var _0x58c3=function(_0x2c3cdd,_0x1da2de){_0x2c3cdd=_0x2c3cdd-0x0;var _0x14a441=_0x8c35[_0x2c3cdd];return _0x14a441;};'use strict';var util=require(_0x58c3('0x0'));var logger=require(_0x58c3('0x1'))(_0x58c3('0x2'));var BPromise=require(_0x58c3('0x3'));var exec=require(_0x58c3('0x4'))[_0x58c3('0x5')];exports['execute']=function(_0x52129e){return new BPromise(function(_0x1d5463,_0x1422e2){exec(_0x52129e,function(_0x33480b,_0x4deb89,_0x437dae){logger[_0x58c3('0x6')](_0x58c3('0x7'),_0x4deb89);if(_0x33480b){logger[_0x58c3('0x6')]('Exec\x20gs',_0x58c3('0x8'),util['inspect'](_0x33480b,{'showHidden':![],'depth':null}),_0x4deb89,_0x437dae);_0x1422e2(_0x33480b);}_0x1d5463(_0x4deb89);});});}; \ No newline at end of file +var _0xd563=['child_process','info','Exec\x20gs','util','fax','bluebird'];(function(_0x376765,_0x502aac){var _0x8f19c7=function(_0xf972fb){while(--_0xf972fb){_0x376765['push'](_0x376765['shift']());}};_0x8f19c7(++_0x502aac);}(_0xd563,0x12f));var _0x3d56=function(_0x31fb4b,_0x4a90fc){_0x31fb4b=_0x31fb4b-0x0;var _0x50fef7=_0xd563[_0x31fb4b];return _0x50fef7;};'use strict';var util=require(_0x3d56('0x0'));var logger=require('../../../../config/logger')(_0x3d56('0x1'));var BPromise=require(_0x3d56('0x2'));var exec=require(_0x3d56('0x3'))['exec'];exports['execute']=function(_0x1b3516){return new BPromise(function(_0x2ca299,_0x550878){exec(_0x1b3516,function(_0x3e09e8,_0x42d4ed,_0x12bab4){logger[_0x3d56('0x4')](_0x3d56('0x5'),_0x42d4ed);if(_0x3e09e8){logger[_0x3d56('0x4')](_0x3d56('0x5'),'\x20Error\x20:',util['inspect'](_0x3e09e8,{'showHidden':![],'depth':null}),_0x42d4ed,_0x12bab4);_0x550878(_0x3e09e8);}_0x2ca299(_0x42d4ed);});});}; \ 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 4e34aca..f180d0f 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 _0x782a=['format','t38timeout','localstationid','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','headerinfo','maxrate'];(function(_0x3b1d1e,_0x10d8d9){var _0x5670b7=function(_0x2ed53a){while(--_0x2ed53a){_0x3b1d1e['push'](_0x3b1d1e['shift']());}};_0x5670b7(++_0x10d8d9);}(_0x782a,0xec));var _0xa782=function(_0x300686,_0x6a0f52){_0x300686=_0x300686-0x0;var _0x2ff942=_0x782a[_0x300686];return _0x2ff942;};'use strict';var util=require(_0xa782('0x0'));var _=require(_0xa782('0x1'));var moment=require(_0xa782('0x2'));var logger=require(_0xa782('0x3'))(_0xa782('0x4'));exports[_0xa782('0x5')]=function(_0xdfe01a){return{'message':_0xdfe01a};};exports[_0xa782('0x6')]=function(_0xd3f4db,_0x53b93b){logger[_0xa782('0x7')](_0xd3f4db,util[_0xa782('0x8')](_0x53b93b,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x42fa80,_0xbb3e8c){var _0x46dc6d={'XMF-ECM':_0xbb3e8c['ecm'],'XMF-HEADERINFO':_0xbb3e8c[_0xa782('0x9')],'XMF-MINRATE':_0xbb3e8c['minrate'],'XMF-MAXRATE':_0xbb3e8c[_0xa782('0xa')],'XMF-MODEM':util[_0xa782('0xb')]('\x22%s\x22',_0xbb3e8c['modem']),'XMF-GATEWAY':_0xbb3e8c['gateway'],'XMF-FAXDETECT':_0xbb3e8c['faxdetect'],'XMF-T38TIMEOUT':_0xbb3e8c[_0xa782('0xc')],'XMF-LOCALSTATIONID':_0xbb3e8c[_0xa782('0xd')],'XMF-PATH':_0x42fa80['path']};return _0x46dc6d;};exports['variablesAction']=function(_0x35a00d,_0x1406d7){return{'actionid':_0x35a00d[_0xa782('0xe')],'action':_0xa782('0xf'),'channel':_0x35a00d['channel'],'Exten':_0xa782('0x10'),'Context':_0xa782('0x11'),'Priority':'1','callerid':util[_0xa782('0xb')](_0xa782('0x12'),_0x35a00d[_0xa782('0x9')]?_0x35a00d['headerinfo']:'',_0x35a00d[_0xa782('0xd')]),'variable':_0x1406d7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x35a00d[_0xa782('0xe')]};}; \ No newline at end of file +var _0xe981=['localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','maxrate','format','modem','gateway','t38timeout'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe981,0x188));var _0x1e98=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xe981[_0x3d4876];return _0x58ca9d;};'use strict';var util=require(_0x1e98('0x0'));var _=require(_0x1e98('0x1'));var moment=require(_0x1e98('0x2'));var logger=require('../../../../config/logger')(_0x1e98('0x3'));exports[_0x1e98('0x4')]=function(_0x2e1a20){return{'message':_0x2e1a20};};exports[_0x1e98('0x5')]=function(_0xe7ebb1,_0x35eedf){logger[_0x1e98('0x6')](_0xe7ebb1,util[_0x1e98('0x7')](_0x35eedf,{'showHidden':![],'depth':null}));};exports[_0x1e98('0x8')]=function(_0x3ee145,_0x3bb8e6){var _0x508810={'XMF-ECM':_0x3bb8e6[_0x1e98('0x9')],'XMF-HEADERINFO':_0x3bb8e6[_0x1e98('0xa')],'XMF-MINRATE':_0x3bb8e6['minrate'],'XMF-MAXRATE':_0x3bb8e6[_0x1e98('0xb')],'XMF-MODEM':util[_0x1e98('0xc')]('\x22%s\x22',_0x3bb8e6[_0x1e98('0xd')]),'XMF-GATEWAY':_0x3bb8e6[_0x1e98('0xe')],'XMF-FAXDETECT':_0x3bb8e6['faxdetect'],'XMF-T38TIMEOUT':_0x3bb8e6[_0x1e98('0xf')],'XMF-LOCALSTATIONID':_0x3bb8e6[_0x1e98('0x10')],'XMF-PATH':_0x3ee145[_0x1e98('0x11')]};return _0x508810;};exports[_0x1e98('0x12')]=function(_0x334509,_0x55af6c){return{'actionid':_0x334509[_0x1e98('0x13')],'action':_0x1e98('0x14'),'channel':_0x334509[_0x1e98('0x15')],'Exten':'xcally-motion-fax','Context':_0x1e98('0x16'),'Priority':'1','callerid':util[_0x1e98('0xc')](_0x1e98('0x17'),_0x334509[_0x1e98('0xa')]?_0x334509[_0x1e98('0xa')]:'',_0x334509[_0x1e98('0x10')]),'variable':_0x55af6c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x334509[_0x1e98('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index cf97a60..e656e8f 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 _0xa6c8=['./rpc/integrations/freshsales','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','[index.js][initParams]','inspect','listen','error','bluebird','util','./server','./realtime','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk'];(function(_0xf1402a,_0x187f5c){var _0x4f7ead=function(_0x57dfd9){while(--_0x57dfd9){_0xf1402a['push'](_0xf1402a['shift']());}};_0x4f7ead(++_0x187f5c);}(_0xa6c8,0xb1));var _0x8a6c=function(_0x5c03b3,_0x250528){_0x5c03b3=_0x5c03b3-0x0;var _0x134cca=_0xa6c8[_0x5c03b3];return _0x134cca;};'use strict';var BPromise=require(_0x8a6c('0x0'));var util=require(_0x8a6c('0x1'));var moment=require('moment');var server=require(_0x8a6c('0x2'));var Realtime=require(_0x8a6c('0x3'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x8a6c('0x4'));var Dialer=require(_0x8a6c('0x5'));var Preview=require(_0x8a6c('0x6'));var Fax=require('./fax');var user=require(_0x8a6c('0x7'));var voiceQueue=require(_0x8a6c('0x8'));var voiceQueueReport=require(_0x8a6c('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x8a6c('0xa'));var trigger=require(_0x8a6c('0xb'));var template=require(_0x8a6c('0xc'));var cmHopperHistory=require(_0x8a6c('0xd'));var campaign=require(_0x8a6c('0xe'));var voiceExtension=require(_0x8a6c('0xf'));var faxAccount=require(_0x8a6c('0x10'));var zendesk=require(_0x8a6c('0x11'));var salesforce=require(_0x8a6c('0x12'));var sugarcrm=require(_0x8a6c('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x8a6c('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x8a6c('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x8a6c('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x8a6c('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8a6c('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x8a6c('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8a6c('0x1a')]()[_0x8a6c('0x1b')](user['getAgents']())[_0x8a6c('0x1b')](realtime['initAgents']())[_0x8a6c('0x1b')](user[_0x8a6c('0x1c')]())[_0x8a6c('0x1b')](realtime['initTelephones']())[_0x8a6c('0x1b')](trunk['getTrunks']())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x1d')]())['then'](voiceQueue[_0x8a6c('0x1e')]())['then'](realtime[_0x8a6c('0x1f')]())[_0x8a6c('0x1b')](trigger[_0x8a6c('0x20')]())['then'](realtime[_0x8a6c('0x21')]())[_0x8a6c('0x1b')](template[_0x8a6c('0x22')]())[_0x8a6c('0x1b')](realtime['initTemplates']())[_0x8a6c('0x1b')](zendesk[_0x8a6c('0x23')]())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x24')]())[_0x8a6c('0x1b')](salesforce[_0x8a6c('0x25')]())['then'](realtime[_0x8a6c('0x26')]())[_0x8a6c('0x1b')](sugarcrm['getSugarcrmAccounts']())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x27')]())['then'](freshdesk[_0x8a6c('0x28')]())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x29')]())[_0x8a6c('0x1b')](desk[_0x8a6c('0x2a')]())[_0x8a6c('0x1b')](realtime['initDeskAccounts']())['then'](zoho[_0x8a6c('0x2b')]())['then'](realtime[_0x8a6c('0x2c')]())[_0x8a6c('0x1b')](vtiger[_0x8a6c('0x2d')]())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x2e')]())[_0x8a6c('0x1b')](freshsales[_0x8a6c('0x2f')]())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x30')]())[_0x8a6c('0x1b')](servicenow[_0x8a6c('0x31')]())[_0x8a6c('0x1b')](realtime['initServicenowAccounts']())[_0x8a6c('0x1b')](dynamics365[_0x8a6c('0x32')]())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x33')]())[_0x8a6c('0x1b')](campaign[_0x8a6c('0x34')]())['then'](realtime[_0x8a6c('0x35')]())[_0x8a6c('0x1b')](voiceExtension[_0x8a6c('0x36')]())['then'](realtime[_0x8a6c('0x37')]())[_0x8a6c('0x1b')](faxAccount[_0x8a6c('0x38')]())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x39')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x8a6c('0x1a')]()[_0x8a6c('0x1b')](voiceQueueReport[_0x8a6c('0x3a')]())['then'](realtime[_0x8a6c('0x3b')]())[_0x8a6c('0x1b')](cmHopperHistory[_0x8a6c('0x3c')]())[_0x8a6c('0x1b')](realtime[_0x8a6c('0x3d')]())[_0x8a6c('0x1b')](cmHopperHistory['getCampaignHopperHistory']())[_0x8a6c('0x1b')](realtime['initCampaignHopperHistory']())[_0x8a6c('0x1b')](voiceCallReport['getVoiceCallReports']())[_0x8a6c('0x1b')](realtime['initVoiceCallReports']())['catch'](function(_0x10fa41){logger['error'](_0x8a6c('0x3e'),util[_0x8a6c('0x3f')](_0x10fa41,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8a6c('0x40')](realtime,preview,fax)[_0x8a6c('0x1b')](function(_0x488937){return initRealtime();})[_0x8a6c('0x1b')](function(){return initParams();})[_0x8a6c('0x1b')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x4d0f78){logger[_0x8a6c('0x41')]('[index.js][main]',util[_0x8a6c('0x3f')](_0x4d0f78,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xe5ca=['initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','[index.js][main]','inspect','bluebird','util','moment','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe5ca,0x141));var _0xae5c=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xe5ca[_0x37a79c];return _0x561d89;};'use strict';var BPromise=require(_0xae5c('0x0'));var util=require(_0xae5c('0x1'));var moment=require(_0xae5c('0x2'));var server=require('./server');var Realtime=require(_0xae5c('0x3'));var Report=require(_0xae5c('0x4'));var Acw=require(_0xae5c('0x5'));var Trigger=require(_0xae5c('0x6'));var Dialer=require('./dialer');var Preview=require(_0xae5c('0x7'));var Fax=require(_0xae5c('0x8'));var user=require(_0xae5c('0x9'));var voiceQueue=require(_0xae5c('0xa'));var voiceQueueReport=require(_0xae5c('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0xae5c('0xc'));var template=require(_0xae5c('0xd'));var cmHopperHistory=require(_0xae5c('0xe'));var campaign=require(_0xae5c('0xf'));var voiceExtension=require(_0xae5c('0x10'));var faxAccount=require(_0xae5c('0x11'));var zendesk=require(_0xae5c('0x12'));var salesforce=require(_0xae5c('0x13'));var sugarcrm=require(_0xae5c('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xae5c('0x15'));var zoho=require(_0xae5c('0x16'));var vtiger=require(_0xae5c('0x17'));var freshsales=require(_0xae5c('0x18'));var servicenow=require(_0xae5c('0x19'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xae5c('0x1a'))(_0xae5c('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xae5c('0x1c')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xae5c('0x1c')](_0xae5c('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xae5c('0x1e')]()[_0xae5c('0x1f')](user[_0xae5c('0x20')]())[_0xae5c('0x1f')](realtime[_0xae5c('0x21')]())[_0xae5c('0x1f')](user[_0xae5c('0x22')]())['then'](realtime[_0xae5c('0x23')]())[_0xae5c('0x1f')](trunk[_0xae5c('0x24')]())[_0xae5c('0x1f')](realtime[_0xae5c('0x25')]())[_0xae5c('0x1f')](voiceQueue[_0xae5c('0x26')]())['then'](realtime[_0xae5c('0x27')]())['then'](trigger[_0xae5c('0x28')]())['then'](realtime[_0xae5c('0x29')]())['then'](template[_0xae5c('0x2a')]())['then'](realtime[_0xae5c('0x2b')]())[_0xae5c('0x1f')](zendesk[_0xae5c('0x2c')]())['then'](realtime[_0xae5c('0x2d')]())['then'](salesforce['getSalesforceAccounts']())[_0xae5c('0x1f')](realtime[_0xae5c('0x2e')]())[_0xae5c('0x1f')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xae5c('0x2f')]())[_0xae5c('0x1f')](freshdesk[_0xae5c('0x30')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk[_0xae5c('0x31')]())[_0xae5c('0x1f')](realtime[_0xae5c('0x32')]())[_0xae5c('0x1f')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0xae5c('0x33')]())[_0xae5c('0x1f')](realtime[_0xae5c('0x34')]())['then'](freshsales[_0xae5c('0x35')]())['then'](realtime[_0xae5c('0x36')]())['then'](servicenow[_0xae5c('0x37')]())['then'](realtime[_0xae5c('0x38')]())[_0xae5c('0x1f')](dynamics365['getDynamics365Accounts']())[_0xae5c('0x1f')](realtime['initDynamics365Accounts']())[_0xae5c('0x1f')](campaign[_0xae5c('0x39')]())[_0xae5c('0x1f')](realtime['initCampaigns']())[_0xae5c('0x1f')](voiceExtension[_0xae5c('0x3a')]())[_0xae5c('0x1f')](realtime[_0xae5c('0x3b')]())[_0xae5c('0x1f')](faxAccount[_0xae5c('0x3c')]())[_0xae5c('0x1f')](realtime[_0xae5c('0x3d')]())[_0xae5c('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0xae5c('0x1e')]()['then'](voiceQueueReport[_0xae5c('0x3e')]())[_0xae5c('0x1f')](realtime['initVoiceQueueReports']())[_0xae5c('0x1f')](cmHopperHistory[_0xae5c('0x3f')]())[_0xae5c('0x1f')](realtime[_0xae5c('0x40')]())[_0xae5c('0x1f')](cmHopperHistory['getCampaignHopperHistory']())[_0xae5c('0x1f')](realtime[_0xae5c('0x41')]())[_0xae5c('0x1f')](voiceCallReport[_0xae5c('0x42')]())[_0xae5c('0x1f')](realtime['initVoiceCallReports']())[_0xae5c('0x43')](function(_0x8fba20){logger[_0xae5c('0x44')](_0xae5c('0x45'),util['inspect'](_0x8fba20,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xae5c('0x1f')](function(_0x4c154e){return initRealtime();})[_0xae5c('0x1f')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xae5c('0x43')](function(_0x2b41e9){logger[_0xae5c('0x44')](_0xae5c('0x46'),util[_0xae5c('0x47')](_0x2b41e9,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 9b3c148..ed70b08 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xedd9,0xfc));var _0x9edd=function(_0x238386,_0x28f397){_0x238386=_0x238386-0x0;var _0x2c97e7=_0xedd9[_0x238386];return _0x2c97e7;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x5b49f7,_0x3814a8){var _0x3fd308=function(_0x3787da){while(--_0x3787da){_0x5b49f7['push'](_0x5b49f7['shift']());}};_0x3fd308(++_0x3814a8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index d4b4853..96ae797 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 _0xde82=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','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','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xde82,0x16c));var _0x2de8=function(_0x3e3ad2,_0x1fbc91){_0x3e3ad2=_0x3e3ad2-0x0;var _0x42c9aa=_0xde82[_0x3e3ad2];return _0x42c9aa;};'use strict';function Campaign(_0x534c0b){this['id']=_0x534c0b['id']||0x0;this[_0x2de8('0x0')]=_0x534c0b[_0x2de8('0x0')]||'';this[_0x2de8('0x1')]=_0x534c0b[_0x2de8('0x1')]||_0x2de8('0x2');this[_0x2de8('0x3')]=0x0;this[_0x2de8('0x4')]=0x0;this[_0x2de8('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x2de8('0x6')]=!![];this['active']=_0x534c0b[_0x2de8('0x7')];this['limitCalls']=_0x534c0b[_0x2de8('0x8')];this['dialTimezone']=_0x534c0b['dialTimezone']||null;this[_0x2de8('0x9')]=_0x534c0b[_0x2de8('0x9')]?_0x534c0b[_0x2de8('0x9')]:null;this['dialOriginateCallerIdName']=_0x534c0b['dialOriginateCallerIdName'];this[_0x2de8('0xa')]=_0x534c0b['dialOriginateCallerIdNumber'];this[_0x2de8('0xb')]=_0x534c0b['dialOriginateTimeout']||0x1e;this[_0x2de8('0xc')]=_0x534c0b[_0x2de8('0xc')];this[_0x2de8('0xd')]=_0x534c0b[_0x2de8('0xd')];this[_0x2de8('0xe')]=_0x534c0b['dialBusyMaxRetry'];this[_0x2de8('0xf')]=_0x534c0b[_0x2de8('0xf')];this[_0x2de8('0x10')]=_0x534c0b[_0x2de8('0x10')];this[_0x2de8('0x11')]=_0x534c0b[_0x2de8('0x11')];this[_0x2de8('0x12')]=_0x534c0b[_0x2de8('0x12')];this[_0x2de8('0x13')]=_0x534c0b[_0x2de8('0x13')]||0x3;this[_0x2de8('0x14')]=_0x534c0b[_0x2de8('0x14')]||0x96;this[_0x2de8('0x15')]=_0x534c0b[_0x2de8('0x15')]||0x3;this[_0x2de8('0x16')]=_0x534c0b['dialDropRetryFrequency']||0x96;this[_0x2de8('0x17')]=_0x534c0b['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x534c0b[_0x2de8('0x18')]||0x96;this[_0x2de8('0x19')]=_0x534c0b['dialMachineMaxRetry']||0x3;this[_0x2de8('0x1a')]=_0x534c0b[_0x2de8('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x534c0b[_0x2de8('0x1b')]||0x3;this[_0x2de8('0x1c')]=_0x534c0b[_0x2de8('0x1c')]||0x96;this[_0x2de8('0x1d')]=_0x534c0b[_0x2de8('0x1d')]||'DESC';this[_0x2de8('0x1e')]=_0x534c0b['dialPrefix']||undefined;this[_0x2de8('0x1f')]=_0x534c0b[_0x2de8('0x1f')]||undefined;this[_0x2de8('0x20')]=_0x534c0b[_0x2de8('0x20')]||undefined;this[_0x2de8('0x21')]=_0x534c0b['TrunkBackup']?_0x534c0b[_0x2de8('0x21')]:undefined;this[_0x2de8('0x22')]=_0x534c0b['Trunk']?_0x534c0b['Trunk']:undefined;this[_0x2de8('0x23')]=_0x534c0b[_0x2de8('0x23')]?_0x534c0b[_0x2de8('0x23')]:undefined;this[_0x2de8('0x24')]=_0x534c0b['SquareProject']?_0x534c0b['SquareProject']:undefined;this[_0x2de8('0x25')]=_0x534c0b[_0x2de8('0x24')]?_0x534c0b['SquareProject'][_0x2de8('0x0')]:undefined;this['dialAMDActive']=_0x534c0b[_0x2de8('0x26')]||![];this[_0x2de8('0x27')]=_0x534c0b[_0x2de8('0x27')];this['dialAMDGreeting']=_0x534c0b[_0x2de8('0x28')];this[_0x2de8('0x29')]=_0x534c0b[_0x2de8('0x29')];this[_0x2de8('0x2a')]=_0x534c0b[_0x2de8('0x2a')];this[_0x2de8('0x2b')]=_0x534c0b[_0x2de8('0x2b')];this[_0x2de8('0x2c')]=_0x534c0b[_0x2de8('0x2c')];this[_0x2de8('0x2d')]=_0x534c0b[_0x2de8('0x2d')];this['dialAMDSilenceThreshold']=_0x534c0b['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x534c0b['dialAMDMaximumWordLength'];}module[_0x2de8('0x2e')]=Campaign; \ No newline at end of file +var _0xde59=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x2c391b,_0x1d0c41){var _0xa55581=function(_0x47f32a){while(--_0x47f32a){_0x2c391b['push'](_0x2c391b['shift']());}};_0xa55581(++_0x1d0c41);}(_0xde59,0x108));var _0x9de5=function(_0x7b2f72,_0x468eef){_0x7b2f72=_0x7b2f72-0x0;var _0x45bb37=_0xde59[_0x7b2f72];return _0x45bb37;};'use strict';function Campaign(_0x625960){this['id']=_0x625960['id']||0x0;this[_0x9de5('0x0')]=_0x625960[_0x9de5('0x0')]||'';this[_0x9de5('0x1')]=_0x625960[_0x9de5('0x1')]||_0x9de5('0x2');this[_0x9de5('0x3')]=0x0;this[_0x9de5('0x4')]=0x0;this[_0x9de5('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x9de5('0x6')]='';this[_0x9de5('0x7')]=!![];this[_0x9de5('0x8')]=_0x625960[_0x9de5('0x8')];this[_0x9de5('0x9')]=_0x625960['limitCalls'];this[_0x9de5('0xa')]=_0x625960[_0x9de5('0xa')]||null;this[_0x9de5('0xb')]=_0x625960[_0x9de5('0xb')]?_0x625960[_0x9de5('0xb')]:null;this[_0x9de5('0xc')]=_0x625960[_0x9de5('0xc')];this[_0x9de5('0xd')]=_0x625960[_0x9de5('0xd')];this[_0x9de5('0xe')]=_0x625960[_0x9de5('0xe')]||0x1e;this[_0x9de5('0xf')]=_0x625960['dialCongestionMaxRetry'];this[_0x9de5('0x10')]=_0x625960[_0x9de5('0x10')];this[_0x9de5('0x11')]=_0x625960[_0x9de5('0x11')];this[_0x9de5('0x12')]=_0x625960[_0x9de5('0x12')];this[_0x9de5('0x13')]=_0x625960[_0x9de5('0x13')];this[_0x9de5('0x14')]=_0x625960[_0x9de5('0x14')];this[_0x9de5('0x15')]=_0x625960['dialGlobalMaxRetry'];this[_0x9de5('0x16')]=_0x625960['dialNoSuchNumberMaxRetry']||0x3;this[_0x9de5('0x17')]=_0x625960['dialNoSuchNumberRetryFrequency']||0x96;this[_0x9de5('0x18')]=_0x625960[_0x9de5('0x18')]||0x3;this[_0x9de5('0x19')]=_0x625960[_0x9de5('0x19')]||0x96;this[_0x9de5('0x1a')]=_0x625960[_0x9de5('0x1a')]||0x3;this[_0x9de5('0x1b')]=_0x625960[_0x9de5('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x625960['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x625960[_0x9de5('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x625960['dialAgentRejectMaxRetry']||0x3;this[_0x9de5('0x1d')]=_0x625960[_0x9de5('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x625960['dialOrderByScheduledAt']||_0x9de5('0x1e');this[_0x9de5('0x1f')]=_0x625960[_0x9de5('0x1f')]||undefined;this[_0x9de5('0x20')]=_0x625960['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x9de5('0x21')]=_0x625960['dialCutDigit']||undefined;this['TrunkBackup']=_0x625960[_0x9de5('0x22')]?_0x625960[_0x9de5('0x22')]:undefined;this[_0x9de5('0x23')]=_0x625960[_0x9de5('0x23')]?_0x625960[_0x9de5('0x23')]:undefined;this[_0x9de5('0x24')]=_0x625960[_0x9de5('0x24')]?_0x625960['Interval']:undefined;this[_0x9de5('0x25')]=_0x625960['SquareProject']?_0x625960[_0x9de5('0x25')]:undefined;this['dialQueueProject']=_0x625960[_0x9de5('0x25')]?_0x625960[_0x9de5('0x25')]['name']:undefined;this[_0x9de5('0x26')]=_0x625960[_0x9de5('0x26')]||![];this[_0x9de5('0x27')]=_0x625960[_0x9de5('0x27')];this[_0x9de5('0x28')]=_0x625960[_0x9de5('0x28')];this['dialAMDAfterGreetingSilence']=_0x625960['dialAMDAfterGreetingSilence'];this[_0x9de5('0x29')]=_0x625960['dialAMDTotalAnalysisTime'];this[_0x9de5('0x2a')]=_0x625960['dialAMDMinWordLength'];this[_0x9de5('0x2b')]=_0x625960[_0x9de5('0x2b')];this[_0x9de5('0x2c')]=_0x625960['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x625960[_0x9de5('0x2d')];this[_0x9de5('0x2e')]=_0x625960['dialAMDMaximumWordLength'];}module[_0x9de5('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index da209ec..f3bb027 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 _0x49f8=['mohtime','exports','starttime','calleridnum','calleridname','connectedlinename','context','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','holdtime','type','tag','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferType'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x49f8,0xff));var _0x849f=function(_0x3bf4d5,_0x366a37){_0x3bf4d5=_0x3bf4d5-0x0;var _0x48fdea=_0x49f8[_0x3bf4d5];return _0x48fdea;};'use strict';function Channel(){this[_0x849f('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x849f('0x1')]=0x0;this[_0x849f('0x2')]='';this['connectedlinenum']=undefined;this[_0x849f('0x3')]=undefined;this['accountcode']=0x0;this[_0x849f('0x4')]='';this['uniqueid']=0x0;this[_0x849f('0x5')]=0x0;this['exten']=0x0;this[_0x849f('0x6')]=![];this[_0x849f('0x7')]=null;this[_0x849f('0x8')]=null;this[_0x849f('0x9')]=![];this[_0x849f('0xa')]=![];this[_0x849f('0xb')]='';this['lastdata']='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x849f('0xc')]=0x0;this[_0x849f('0xd')]=null;this[_0x849f('0xe')]=null;this[_0x849f('0xf')]=null;this[_0x849f('0x10')]=![];this[_0x849f('0x11')]=null;this[_0x849f('0x12')]=null;this['monitors']=[];this[_0x849f('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x849f('0x14')]=undefined;this[_0x849f('0x15')]=0x0;}module[_0x849f('0x16')]=Channel; \ No newline at end of file +var _0xbf25=['transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','type','tag','disposition','monitor','monitorFilename','queue','monitors'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xbf25,0x12d));var _0x5bf2=function(_0x1900a7,_0x55de31){_0x1900a7=_0x1900a7-0x0;var _0x4f9d83=_0xbf25[_0x1900a7];return _0x4f9d83;};'use strict';function Channel(){this[_0x5bf2('0x0')]=null;this[_0x5bf2('0x1')]='';this['destinationchannel']='';this[_0x5bf2('0x2')]=0x0;this[_0x5bf2('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x5bf2('0x4')]=0x0;this[_0x5bf2('0x5')]='';this[_0x5bf2('0x6')]=0x0;this[_0x5bf2('0x7')]=0x0;this[_0x5bf2('0x8')]=0x0;this[_0x5bf2('0x9')]=![];this[_0x5bf2('0xa')]=null;this[_0x5bf2('0xb')]=null;this[_0x5bf2('0xc')]=![];this[_0x5bf2('0xd')]=![];this[_0x5bf2('0xe')]='';this[_0x5bf2('0xf')]='';this['duration']=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x5bf2('0x10')]=null;this[_0x5bf2('0x11')]=null;this[_0x5bf2('0x12')]=null;this[_0x5bf2('0x13')]=![];this[_0x5bf2('0x14')]=null;this[_0x5bf2('0x15')]=null;this[_0x5bf2('0x16')]=[];this[_0x5bf2('0x17')]=undefined;this[_0x5bf2('0x18')]=undefined;this[_0x5bf2('0x19')]=undefined;this['mohtime']=0x0;}module[_0x5bf2('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7cef3a6..52dec77 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 _0x1b50=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x489917,_0x1eacfa){var _0x3fc996=function(_0x3b5c06){while(--_0x3b5c06){_0x489917['push'](_0x489917['shift']());}};_0x3fc996(++_0x1eacfa);}(_0x1b50,0x10c));var _0x01b5=function(_0x5e7093,_0x5ee51e){_0x5e7093=_0x5e7093-0x0;var _0x45c642=_0x1b50[_0x5e7093];return _0x45c642;};'use strict';function DeskAccount(_0x112db4){this['id']=_0x112db4['id']||0x0;this['name']=_0x112db4[_0x01b5('0x0')]||'';this[_0x01b5('0x1')]=_0x112db4[_0x01b5('0x1')]||'';this[_0x01b5('0x2')]=_0x112db4[_0x01b5('0x2')]||'';this[_0x01b5('0x3')]=_0x112db4[_0x01b5('0x3')]||'';this[_0x01b5('0x4')]=_0x112db4[_0x01b5('0x4')]||'';this[_0x01b5('0x5')]=_0x112db4[_0x01b5('0x5')]||'';this[_0x01b5('0x6')]=_0x112db4[_0x01b5('0x6')]||'';this[_0x01b5('0x7')]=_0x112db4[_0x01b5('0x7')]||'';this[_0x01b5('0x8')]=_0x112db4['tokenSecret']||'';this[_0x01b5('0x9')]=_0x112db4[_0x01b5('0x9')]||'';this['serverUrl']=_0x112db4[_0x01b5('0xa')]||'';this[_0x01b5('0xb')]=_0x112db4[_0x01b5('0xb')]||{};}module[_0x01b5('0xc')]=DeskAccount; \ No newline at end of file +var _0xf612=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x11883f,_0x4c1849){var _0x2cf5e7=function(_0x48a564){while(--_0x48a564){_0x11883f['push'](_0x11883f['shift']());}};_0x2cf5e7(++_0x4c1849);}(_0xf612,0x1ec));var _0x2f61=function(_0x3d496e,_0x34a360){_0x3d496e=_0x3d496e-0x0;var _0x28ae7b=_0xf612[_0x3d496e];return _0x28ae7b;};'use strict';function DeskAccount(_0x38a834){this['id']=_0x38a834['id']||0x0;this[_0x2f61('0x0')]=_0x38a834[_0x2f61('0x0')]||'';this[_0x2f61('0x1')]=_0x38a834[_0x2f61('0x1')]||'';this[_0x2f61('0x2')]=_0x38a834[_0x2f61('0x2')]||'';this[_0x2f61('0x3')]=_0x38a834[_0x2f61('0x3')]||'';this[_0x2f61('0x4')]=_0x38a834[_0x2f61('0x4')]||'';this[_0x2f61('0x5')]=_0x38a834['consumerKey']||'';this[_0x2f61('0x6')]=_0x38a834[_0x2f61('0x6')]||'';this[_0x2f61('0x7')]=_0x38a834[_0x2f61('0x7')]||'';this[_0x2f61('0x8')]=_0x38a834[_0x2f61('0x8')]||'';this[_0x2f61('0x9')]=_0x38a834['type']||'';this[_0x2f61('0xa')]=_0x38a834[_0x2f61('0xa')]||'';this[_0x2f61('0xb')]=_0x38a834[_0x2f61('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 9faaea0..d04912d 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 _0x9348=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x9348,0x10d));var _0x8934=function(_0xcdd099,_0x17ef62){_0xcdd099=_0xcdd099-0x0;var _0x37fcbb=_0x9348[_0xcdd099];return _0x37fcbb;};'use strict';function Dynamics365Account(_0x41a189){this['id']=_0x41a189['id']||0x0;this[_0x8934('0x0')]=_0x41a189[_0x8934('0x0')]||'';this[_0x8934('0x1')]=_0x41a189[_0x8934('0x1')]||'';this['password']=_0x41a189[_0x8934('0x2')]||'';this[_0x8934('0x3')]=_0x41a189['remoteUri']||'';this[_0x8934('0x4')]=_0x41a189[_0x8934('0x4')]||'';this[_0x8934('0x5')]=_0x41a189[_0x8934('0x5')]||'';this[_0x8934('0x6')]=_0x41a189[_0x8934('0x6')]||{};this['serverUrl']=_0x41a189[_0x8934('0x7')]||'';this[_0x8934('0x8')]=_0x41a189[_0x8934('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xb688=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x512d4b,_0x223351){var _0x315b21=function(_0x394cf3){while(--_0x394cf3){_0x512d4b['push'](_0x512d4b['shift']());}};_0x315b21(++_0x223351);}(_0xb688,0xcf));var _0x8b68=function(_0x2968c3,_0x49e747){_0x2968c3=_0x2968c3-0x0;var _0x126802=_0xb688[_0x2968c3];return _0x126802;};'use strict';function Dynamics365Account(_0x185590){this['id']=_0x185590['id']||0x0;this[_0x8b68('0x0')]=_0x185590[_0x8b68('0x0')]||'';this[_0x8b68('0x1')]=_0x185590[_0x8b68('0x1')]||'';this[_0x8b68('0x2')]=_0x185590[_0x8b68('0x2')]||'';this['remoteUri']=_0x185590[_0x8b68('0x3')]||'';this[_0x8b68('0x4')]=_0x185590[_0x8b68('0x4')]||'';this[_0x8b68('0x5')]=_0x185590['clientId']||'';this[_0x8b68('0x6')]=_0x185590['clientSecret']||{};this[_0x8b68('0x7')]=_0x185590[_0x8b68('0x7')]||'';this[_0x8b68('0x8')]=_0x185590[_0x8b68('0x8')]||{};}module[_0x8b68('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9ddd6bc..2392b98 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 _0x1f7e=['Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0xbba4b,_0x569837){var _0xd86424=function(_0x2ef88a){while(--_0x2ef88a){_0xbba4b['push'](_0xbba4b['shift']());}};_0xd86424(++_0x569837);}(_0x1f7e,0x1a7));var _0xe1f7=function(_0x2bf457,_0x56d492){_0x2bf457=_0x2bf457-0x0;var _0x1707f6=_0x1f7e[_0x2bf457];return _0x1707f6;};'use strict';function FaxAccount(_0x1a2b5a){this['id']=_0x1a2b5a['id']||0x0;this[_0xe1f7('0x0')]=_0x1a2b5a[_0xe1f7('0x0')]||'';this[_0xe1f7('0x1')]=_0x1a2b5a[_0xe1f7('0x1')];this[_0xe1f7('0x2')]=_0x1a2b5a['ecm'];this['headerinfo']=_0x1a2b5a[_0xe1f7('0x3')];this[_0xe1f7('0x4')]=_0x1a2b5a[_0xe1f7('0x4')];this['minrate']=_0x1a2b5a['minrate']||0x960;this[_0xe1f7('0x5')]=_0x1a2b5a[_0xe1f7('0x5')]||0x3840;this['modem']=_0x1a2b5a[_0xe1f7('0x6')]||'v17,v27,v29';this['gateway']=_0x1a2b5a[_0xe1f7('0x7')]||'no';this[_0xe1f7('0x8')]=_0x1a2b5a[_0xe1f7('0x8')]||'no';this['t38timeout']=_0x1a2b5a[_0xe1f7('0x9')]||0x1388;this[_0xe1f7('0xa')]=_0x1a2b5a['tech']||'SIP';this['Trunk']=_0x1a2b5a[_0xe1f7('0xb')]?_0x1a2b5a[_0xe1f7('0xb')]:undefined;this[_0xe1f7('0xc')]=_0x1a2b5a[_0xe1f7('0xc')];this['key']=_0x1a2b5a[_0xe1f7('0xd')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x00b7=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x00b7,0xc5));var _0x700b=function(_0x13ef5c,_0x5a920c){_0x13ef5c=_0x13ef5c-0x0;var _0x7fab14=_0x00b7[_0x13ef5c];return _0x7fab14;};'use strict';function FaxAccount(_0xf4a80b){this['id']=_0xf4a80b['id']||0x0;this[_0x700b('0x0')]=_0xf4a80b[_0x700b('0x0')]||'';this[_0x700b('0x1')]=_0xf4a80b[_0x700b('0x1')];this[_0x700b('0x2')]=_0xf4a80b[_0x700b('0x2')];this['headerinfo']=_0xf4a80b[_0x700b('0x3')];this[_0x700b('0x4')]=_0xf4a80b['localstationid'];this[_0x700b('0x5')]=_0xf4a80b[_0x700b('0x5')]||0x960;this[_0x700b('0x6')]=_0xf4a80b[_0x700b('0x6')]||0x3840;this[_0x700b('0x7')]=_0xf4a80b[_0x700b('0x7')]||_0x700b('0x8');this[_0x700b('0x9')]=_0xf4a80b[_0x700b('0x9')]||'no';this[_0x700b('0xa')]=_0xf4a80b[_0x700b('0xa')]||'no';this[_0x700b('0xb')]=_0xf4a80b[_0x700b('0xb')]||0x1388;this[_0x700b('0xc')]=_0xf4a80b[_0x700b('0xc')]||_0x700b('0xd');this[_0x700b('0xe')]=_0xf4a80b[_0x700b('0xe')]?_0xf4a80b[_0x700b('0xe')]:undefined;this[_0x700b('0xf')]=_0xf4a80b['ListId'];this[_0x700b('0x10')]=_0xf4a80b[_0x700b('0x10')];}module[_0x700b('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 3e96463..da0520e 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 _0x061c=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x4bf591,_0x48b450){var _0x18f0df=function(_0x4754ea){while(--_0x4754ea){_0x4bf591['push'](_0x4bf591['shift']());}};_0x18f0df(++_0x48b450);}(_0x061c,0xc0));var _0xc061=function(_0x554ec8,_0x2219bb){_0x554ec8=_0x554ec8-0x0;var _0x36ceb7=_0x061c[_0x554ec8];return _0x36ceb7;};'use strict';function FreshdeskAccount(_0xe55c36){this['id']=_0xe55c36['id']||0x0;this['name']=_0xe55c36[_0xc061('0x0')]||'';this[_0xc061('0x1')]=_0xe55c36['username']||'';this[_0xc061('0x2')]=_0xe55c36[_0xc061('0x3')]||'';this['remoteUri']=_0xe55c36[_0xc061('0x4')]||'';this['serverUrl']=_0xe55c36[_0xc061('0x5')]||'';this['Configurations']=_0xe55c36[_0xc061('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xe230=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0xe230,0x16f));var _0x0e23=function(_0x32ed3d,_0xf2d0d1){_0x32ed3d=_0x32ed3d-0x0;var _0x5202e6=_0xe230[_0x32ed3d];return _0x5202e6;};'use strict';function FreshdeskAccount(_0x1e7e47){this['id']=_0x1e7e47['id']||0x0;this[_0x0e23('0x0')]=_0x1e7e47[_0x0e23('0x0')]||'';this[_0x0e23('0x1')]=_0x1e7e47[_0x0e23('0x1')]||'';this[_0x0e23('0x2')]=_0x1e7e47['token']||'';this[_0x0e23('0x3')]=_0x1e7e47['remoteUri']||'';this[_0x0e23('0x4')]=_0x1e7e47[_0x0e23('0x4')]||'';this[_0x0e23('0x5')]=_0x1e7e47[_0x0e23('0x5')]||{};}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 9f3d5c6..9fd2c95 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 _0xeec6=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x5d4b1a,_0x30243f){var _0x3444c1=function(_0x24dbcd){while(--_0x24dbcd){_0x5d4b1a['push'](_0x5d4b1a['shift']());}};_0x3444c1(++_0x30243f);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4f067e,_0x406536){_0x4f067e=_0x4f067e-0x0;var _0x3930d1=_0xeec6[_0x4f067e];return _0x3930d1;};'use strict';function FreshsalesAccount(_0x5158a1){this['id']=_0x5158a1['id']||0x0;this[_0x6eec('0x0')]=_0x5158a1[_0x6eec('0x0')]||'';this[_0x6eec('0x1')]=_0x5158a1['username']||'';this[_0x6eec('0x2')]=_0x5158a1[_0x6eec('0x3')]||'';this[_0x6eec('0x4')]=_0x5158a1[_0x6eec('0x4')]||'';this[_0x6eec('0x5')]=_0x5158a1[_0x6eec('0x5')]||'';this['Configurations']=_0x5158a1[_0x6eec('0x6')]||{};}module[_0x6eec('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x6596=['apiKey','token','remoteUri','Configurations','exports','name','username'];(function(_0x39129b,_0x1d1a20){var _0x46abe7=function(_0x5c583b){while(--_0x5c583b){_0x39129b['push'](_0x39129b['shift']());}};_0x46abe7(++_0x1d1a20);}(_0x6596,0x1d3));var _0x6659=function(_0xaa84f7,_0x270bd4){_0xaa84f7=_0xaa84f7-0x0;var _0x2b4e1a=_0x6596[_0xaa84f7];return _0x2b4e1a;};'use strict';function FreshsalesAccount(_0x4c7f2e){this['id']=_0x4c7f2e['id']||0x0;this[_0x6659('0x0')]=_0x4c7f2e['name']||'';this[_0x6659('0x1')]=_0x4c7f2e[_0x6659('0x1')]||'';this[_0x6659('0x2')]=_0x4c7f2e[_0x6659('0x3')]||'';this[_0x6659('0x4')]=_0x4c7f2e[_0x6659('0x4')]||'';this['serverUrl']=_0x4c7f2e['serverUrl']||'';this[_0x6659('0x5')]=_0x4c7f2e[_0x6659('0x5')]||{};}module[_0x6659('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index ddbcda9..7d7455a 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 _0x1ec9=['assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime'];(function(_0x1caf4f,_0xd0b32d){var _0x11b9e2=function(_0xabd605){while(--_0xabd605){_0x1caf4f['push'](_0x1caf4f['shift']());}};_0x11b9e2(++_0xd0b32d);}(_0x1ec9,0x156));var _0x91ec=function(_0x25e695,_0x4d8bc5){_0x25e695=_0x25e695-0x0;var _0x3b8497=_0x1ec9[_0x25e695];return _0x3b8497;};'use strict';function QueueReport(){this[_0x91ec('0x0')]=_0x91ec('0x1');this[_0x91ec('0x2')]='';this[_0x91ec('0x3')]='';this['calleridname']='';this[_0x91ec('0x4')]='';this['queuecallerjoinAt']=null;this[_0x91ec('0x5')]=null;this[_0x91ec('0x6')]=0x1;this[_0x91ec('0x7')]=0x1;this[_0x91ec('0x8')]=![];this[_0x91ec('0x9')]=null;this[_0x91ec('0xa')]=![];this[_0x91ec('0xb')]=null;this['queuecallerexit']=![];this[_0x91ec('0xc')]=null;this[_0x91ec('0xd')]=0x1;this[_0x91ec('0xe')]='';this[_0x91ec('0xf')]='';this[_0x91ec('0x10')]='';this[_0x91ec('0x11')]='';this[_0x91ec('0x12')]='';this[_0x91ec('0x13')]='';this[_0x91ec('0x14')]='';this[_0x91ec('0x15')]=0x0;this[_0x91ec('0x16')]=![];this[_0x91ec('0x17')]='';this[_0x91ec('0x18')]=_0x91ec('0x19');this['mohtime']=0x0;this[_0x91ec('0x1a')]={};}module[_0x91ec('0x1b')]=QueueReport; \ No newline at end of file +var _0xab81=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','priority','assigned','lastAssignedTo','motionChannel','variables','exports','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0xab81,0xe7));var _0x1ab8=function(_0x10e187,_0x3fcc1d){_0x10e187=_0x10e187-0x0;var _0x506dfb=_0xab81[_0x10e187];return _0x506dfb;};'use strict';function QueueReport(){this['type']='inbound';this[_0x1ab8('0x0')]='';this['calleridnum']='';this[_0x1ab8('0x1')]='';this[_0x1ab8('0x2')]='';this[_0x1ab8('0x3')]=null;this[_0x1ab8('0x4')]=null;this[_0x1ab8('0x5')]=0x1;this[_0x1ab8('0x6')]=0x1;this[_0x1ab8('0x7')]=![];this[_0x1ab8('0x8')]=null;this[_0x1ab8('0x9')]=![];this[_0x1ab8('0xa')]=null;this[_0x1ab8('0xb')]=![];this[_0x1ab8('0xc')]=null;this[_0x1ab8('0xd')]=0x1;this[_0x1ab8('0xe')]='';this['connectedlinenum']='';this[_0x1ab8('0xf')]='';this['accountcode']='';this[_0x1ab8('0x10')]='';this[_0x1ab8('0x11')]='';this[_0x1ab8('0x12')]='';this['holdtime']=0x0;this[_0x1ab8('0x13')]=![];this[_0x1ab8('0x14')]='';this[_0x1ab8('0x15')]='voice';this['mohtime']=0x0;this[_0x1ab8('0x16')]={};}module[_0x1ab8('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index b449754..eddc1ca 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 _0x171c=['username','remoteUri','password','clientId','clientSecret','type','serverUrl','Configurations','exports','name'];(function(_0x5f3ad4,_0x452bbd){var _0x29c737=function(_0x58c0df){while(--_0x58c0df){_0x5f3ad4['push'](_0x5f3ad4['shift']());}};_0x29c737(++_0x452bbd);}(_0x171c,0x8b));var _0xc171=function(_0x3e8534,_0x2461dc){_0x3e8534=_0x3e8534-0x0;var _0x12d0bc=_0x171c[_0x3e8534];return _0x12d0bc;};'use strict';function SalesforceAccount(_0x3e7d18){this['id']=_0x3e7d18['id']||0x0;this['name']=_0x3e7d18[_0xc171('0x0')]||'';this[_0xc171('0x1')]=_0x3e7d18[_0xc171('0x1')]||'';this['remoteUri']=_0x3e7d18[_0xc171('0x2')]||'';this[_0xc171('0x3')]=_0x3e7d18['password']||'';this['clientId']=_0x3e7d18[_0xc171('0x4')]||'';this[_0xc171('0x5')]=_0x3e7d18['clientSecret']||'';this['securityToken']=_0x3e7d18['securityToken']||'';this['type']=_0x3e7d18[_0xc171('0x6')]||'integrationTab';this['serverUrl']=_0x3e7d18[_0xc171('0x7')]||'';this[_0xc171('0x8')]=_0x3e7d18[_0xc171('0x8')]||{};}module[_0xc171('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x34ed=['clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x34ed,0x124));var _0xd34e=function(_0x5d8cb7,_0x2851f7){_0x5d8cb7=_0x5d8cb7-0x0;var _0xece05d=_0x34ed[_0x5d8cb7];return _0xece05d;};'use strict';function SalesforceAccount(_0x1319d1){this['id']=_0x1319d1['id']||0x0;this['name']=_0x1319d1[_0xd34e('0x0')]||'';this[_0xd34e('0x1')]=_0x1319d1[_0xd34e('0x1')]||'';this[_0xd34e('0x2')]=_0x1319d1['remoteUri']||'';this['password']=_0x1319d1[_0xd34e('0x3')]||'';this[_0xd34e('0x4')]=_0x1319d1[_0xd34e('0x4')]||'';this[_0xd34e('0x5')]=_0x1319d1['clientSecret']||'';this[_0xd34e('0x6')]=_0x1319d1[_0xd34e('0x6')]||'';this['type']=_0x1319d1[_0xd34e('0x7')]||'integrationTab';this[_0xd34e('0x8')]=_0x1319d1['serverUrl']||'';this[_0xd34e('0x9')]=_0x1319d1[_0xd34e('0x9')]||{};}module[_0xd34e('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 217b0d1..9172dc2 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 _0xfdc4=['name','username','password','remoteUri','Configurations'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0xfdc4,0x1bd));var _0x4fdc=function(_0xa0c2e0,_0x595a39){_0xa0c2e0=_0xa0c2e0-0x0;var _0x23a548=_0xfdc4[_0xa0c2e0];return _0x23a548;};'use strict';function ServicenowAccount(_0x48c271){this['id']=_0x48c271['id']||0x0;this['name']=_0x48c271[_0x4fdc('0x0')]||'';this[_0x4fdc('0x1')]=_0x48c271[_0x4fdc('0x1')]||'';this[_0x4fdc('0x2')]=_0x48c271['password']||'';this[_0x4fdc('0x3')]=_0x48c271['remoteUri']||'';this['serverUrl']=_0x48c271['serverUrl']||'';this[_0x4fdc('0x4')]=_0x48c271['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x4240=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x460358,_0x45d45e){var _0x2e6a60=function(_0xc3135a){while(--_0xc3135a){_0x460358['push'](_0x460358['shift']());}};_0x2e6a60(++_0x45d45e);}(_0x4240,0xa2));var _0x0424=function(_0x37100c,_0x2f3069){_0x37100c=_0x37100c-0x0;var _0x32818e=_0x4240[_0x37100c];return _0x32818e;};'use strict';function ServicenowAccount(_0x5550df){this['id']=_0x5550df['id']||0x0;this[_0x0424('0x0')]=_0x5550df['name']||'';this[_0x0424('0x1')]=_0x5550df[_0x0424('0x1')]||'';this[_0x0424('0x2')]=_0x5550df['password']||'';this['remoteUri']=_0x5550df[_0x0424('0x3')]||'';this[_0x0424('0x4')]=_0x5550df[_0x0424('0x4')]||'';this[_0x0424('0x5')]=_0x5550df[_0x0424('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 23af34c..c1aa891 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 _0xf4c7=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0xf4c7,0x18a));var _0x7f4c=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0xf4c7[_0x27bcf5];return _0x4ce4cf;};'use strict';function SugarcrmAccount(_0x537ac9){this['id']=_0x537ac9['id']||0x0;this[_0x7f4c('0x0')]=_0x537ac9['name']||'';this['username']=_0x537ac9[_0x7f4c('0x1')]||'';this[_0x7f4c('0x2')]=_0x537ac9['password']||'';this[_0x7f4c('0x3')]=_0x537ac9[_0x7f4c('0x3')]||'';this[_0x7f4c('0x4')]=_0x537ac9[_0x7f4c('0x4')]||'';this[_0x7f4c('0x5')]=_0x537ac9['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xe05f=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x15cb01,_0x4da878){var _0x57e5a9=function(_0x4bf74b){while(--_0x4bf74b){_0x15cb01['push'](_0x15cb01['shift']());}};_0x57e5a9(++_0x4da878);}(_0xe05f,0x158));var _0xfe05=function(_0x154618,_0x2f36b6){_0x154618=_0x154618-0x0;var _0x25daa7=_0xe05f[_0x154618];return _0x25daa7;};'use strict';function SugarcrmAccount(_0x1c9494){this['id']=_0x1c9494['id']||0x0;this['name']=_0x1c9494[_0xfe05('0x0')]||'';this[_0xfe05('0x1')]=_0x1c9494[_0xfe05('0x1')]||'';this['password']=_0x1c9494['password']||'';this['remoteUri']=_0x1c9494[_0xfe05('0x2')]||'';this[_0xfe05('0x3')]=_0x1c9494['serverUrl']||'';this[_0xfe05('0x4')]=_0x1c9494[_0xfe05('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 867c07c..91a6b78 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 _0x6bc4=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x13e81c,_0x3648ef){var _0xefa4c5=function(_0x52b13b){while(--_0x52b13b){_0x13e81c['push'](_0x13e81c['shift']());}};_0xefa4c5(++_0x3648ef);}(_0x6bc4,0x164));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x132c28){this['id']=_0x132c28['id']||0x0;this[_0x46bc('0x0')]=_0x132c28['name']||'';this[_0x46bc('0x1')]=_0x132c28[_0x46bc('0x1')]||'';this[_0x46bc('0x2')]=_0x46bc('0x3');this[_0x46bc('0x4')]=0x0;this[_0x46bc('0x5')]='unknown';this[_0x46bc('0x6')]='';}module[_0x46bc('0x7')]=Telephone; \ No newline at end of file +var _0x7980=['unknown','stateTime','status','address','name','accountcode','state'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7980,0x123));var _0x0798=function(_0x3597b6,_0x4eba98){_0x3597b6=_0x3597b6-0x0;var _0x5c0813=_0x7980[_0x3597b6];return _0x5c0813;};'use strict';function Telephone(_0x16b642){this['id']=_0x16b642['id']||0x0;this[_0x0798('0x0')]=_0x16b642['name']||'';this[_0x0798('0x1')]=_0x16b642[_0x0798('0x1')]||'';this[_0x0798('0x2')]=_0x0798('0x3');this[_0x0798('0x4')]=0x0;this[_0x0798('0x5')]=_0x0798('0x3');this[_0x0798('0x6')]='';}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 7deceaf..1382ff5 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x2a9963,_0x145071){var _0x1014c1=function(_0x475bb0){while(--_0x475bb0){_0x2a9963['push'](_0x2a9963['shift']());}};_0x1014c1(++_0x145071);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x30a3b1,_0x33d7e0){var _0xd11c5e=function(_0x1e81ec){while(--_0x1e81ec){_0x30a3b1['push'](_0x30a3b1['shift']());}};_0xd11c5e(++_0x33d7e0);}(_0xb10b,0x12a));var _0xbb10=function(_0x505088,_0x23a321){_0x505088=_0x505088-0x0;var _0x3eb2c9=_0xb10b[_0x505088];return _0x3eb2c9;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e237243..13f6d6c 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1a85,0x178));var _0x51a8=function(_0x3b9382,_0x32d102){_0x3b9382=_0x3b9382-0x0;var _0x303c10=_0x1a85[_0x3b9382];return _0x303c10;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x33d615,_0x1a5af7){var _0x254611=function(_0x23c410){while(--_0x23c410){_0x33d615['push'](_0x33d615['shift']());}};_0x254611(++_0x1a5af7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f7b9626..4bed063 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 _0x9b00=['refresh','registrationtime','defaultuser','exports','name','state','unknown','stateTime','status','registry','indexOf','split','domain'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0x9b00,0x197));var _0x09b0=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x9b00[_0x2b4411];return _0x8e41ef;};'use strict';function Trunk(_0x11b08a){this['id']=_0x11b08a['id']||0x0;this['active']=_0x11b08a['active']||![];this[_0x09b0('0x0')]=_0x11b08a['name']||'';this[_0x09b0('0x1')]=_0x09b0('0x2');this[_0x09b0('0x3')]=0x0;this[_0x09b0('0x4')]='unknown';this[_0x09b0('0x5')]=_0x11b08a[_0x09b0('0x5')]&&_0x11b08a['registry'][_0x09b0('0x6')](':')?_0x11b08a['registry'][_0x09b0('0x7')](':')[0x0]:'';this['host']='';this['port']='';this[_0x09b0('0x8')]='';this['domainport']='';this[_0x09b0('0x9')]='';this['stateRegistry']=_0x09b0('0x2');this[_0x09b0('0xa')]='';this['address']='';this[_0x09b0('0xb')]=_0x11b08a[_0x09b0('0xb')]||'';}module[_0x09b0('0xc')]=Trunk; \ No newline at end of file +var _0x2ec7=['status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','defaultuser','exports','active','name','unknown','stateTime'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0x2ec7,0x1ec));var _0x72ec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2ec7[_0x321bb2];return _0x9c12ed;};'use strict';function Trunk(_0x62c161){this['id']=_0x62c161['id']||0x0;this[_0x72ec('0x0')]=_0x62c161[_0x72ec('0x0')]||![];this[_0x72ec('0x1')]=_0x62c161[_0x72ec('0x1')]||'';this['state']=_0x72ec('0x2');this[_0x72ec('0x3')]=0x0;this[_0x72ec('0x4')]='unknown';this[_0x72ec('0x5')]=_0x62c161[_0x72ec('0x5')]&&_0x62c161[_0x72ec('0x5')][_0x72ec('0x6')](':')?_0x62c161[_0x72ec('0x5')][_0x72ec('0x7')](':')[0x0]:'';this[_0x72ec('0x8')]='';this[_0x72ec('0x9')]='';this[_0x72ec('0xa')]='';this[_0x72ec('0xb')]='';this[_0x72ec('0xc')]='';this[_0x72ec('0xd')]=_0x72ec('0x2');this['registrationtime']='';this['address']='';this[_0x72ec('0xe')]=_0x62c161[_0x72ec('0xe')]||'';}module[_0x72ec('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index e400a02..1e2dc68 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 _0xe22f=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0xe3f4ce,_0x2b8736){var _0x48e747=function(_0x1dd1b4){while(--_0x1dd1b4){_0xe3f4ce['push'](_0xe3f4ce['shift']());}};_0x48e747(++_0x2b8736);}(_0xe22f,0xcd));var _0xfe22=function(_0x29b619,_0x172e70){_0x29b619=_0x29b619-0x0;var _0x74cec1=_0xe22f[_0x29b619];return _0x74cec1;};'use strict';function voiceExtension(_0x58f42c){this['id']=_0x58f42c['id']||0x0;this[_0xfe22('0x0')]=_0x58f42c[_0xfe22('0x0')]||'';this[_0xfe22('0x1')]=_0x58f42c[_0xfe22('0x1')]||_0xfe22('0x2');this[_0xfe22('0x3')]=_0x58f42c[_0xfe22('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x65b5=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x493c8c,_0x470567){var _0x17344b=function(_0x47aee7){while(--_0x47aee7){_0x493c8c['push'](_0x493c8c['shift']());}};_0x17344b(++_0x470567);}(_0x65b5,0xa2));var _0x565b=function(_0x31e98c,_0x3f49bd){_0x31e98c=_0x31e98c-0x0;var _0x37e647=_0x65b5[_0x31e98c];return _0x37e647;};'use strict';function voiceExtension(_0x2f85d0){this['id']=_0x2f85d0['id']||0x0;this['exten']=_0x2f85d0[_0x565b('0x0')]||'';this[_0x565b('0x1')]=_0x2f85d0[_0x565b('0x1')]||_0x565b('0x2');this[_0x565b('0x3')]=_0x2f85d0[_0x565b('0x3')]||![];}module[_0x565b('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 23eb521..c2fc428 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 _0xd4a5=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav49','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting'];(function(_0x5e159c,_0x514d6d){var _0x5781f7=function(_0x4e95e6){while(--_0x4e95e6){_0x5e159c['push'](_0x5e159c['shift']());}};_0x5781f7(++_0x514d6d);}(_0xd4a5,0xa8));var _0x5d4a=function(_0x5d59b9,_0x72e4ab){_0x5d59b9=_0x5d59b9-0x0;var _0x502e6c=_0xd4a5[_0x5d59b9];return _0x502e6c;};'use strict';var statusDesc=[_0x5d4a('0x0'),_0x5d4a('0x1'),_0x5d4a('0x2'),_0x5d4a('0x3'),_0x5d4a('0x4'),_0x5d4a('0x5'),_0x5d4a('0x6'),_0x5d4a('0x7'),_0x5d4a('0x8')];var monitorFormat={'wav':'wav','wav49':_0x5d4a('0x9'),'gsm':'gsm'};var strategy={'rrmemory':_0x5d4a('0xa'),'roundrobin':_0x5d4a('0xb')};function VoiceQueue(_0x522811){this['id']=_0x522811['id']||0x0;this[_0x5d4a('0xc')]=_0x522811[_0x5d4a('0xc')]||'';this[_0x5d4a('0xd')]=_0x522811[_0x5d4a('0xd')]||'';this[_0x5d4a('0xe')]=_0x522811[_0x5d4a('0xe')]||'inbound';this[_0x5d4a('0xf')]=0x0;this[_0x5d4a('0x10')]=0x0;this[_0x5d4a('0x11')]=0x0;this[_0x5d4a('0x12')]=0x0;this[_0x5d4a('0x13')]=0x0;this['sumHoldTime']=0x0;this[_0x5d4a('0x14')]=0x0;this[_0x5d4a('0x15')]=0x0;this[_0x5d4a('0x16')]=0x0;this['loggedIn']=0x0;this[_0x5d4a('0x17')]=0x0;this['acw']=_0x522811[_0x5d4a('0x18')]||![];this[_0x5d4a('0x19')]=_0x522811['acwTimeout']||0xa;this[_0x5d4a('0x1a')]=_0x522811[_0x5d4a('0x1a')]||'no';this[_0x5d4a('0x1b')]=!![];this[_0x5d4a('0x1c')]='';this[_0x5d4a('0x1d')]=0x0;this[_0x5d4a('0x1e')]=0x0;this['dialTimezone']=_0x522811[_0x5d4a('0x1f')]||null;this['dialGlobalInterval']=_0x522811['dialGlobalInterval']?_0x522811[_0x5d4a('0x20')]:null;this[_0x5d4a('0x21')]=_0x522811[_0x5d4a('0x21')];this[_0x5d4a('0x22')]=_0x522811[_0x5d4a('0x22')]||_0x5d4a('0x23');this[_0x5d4a('0x24')]=_0x522811[_0x5d4a('0x24')]||0x0;this[_0x5d4a('0x25')]=_0x522811[_0x5d4a('0x25')]||0x0;this['dialPowerLevel']=_0x522811[_0x5d4a('0x26')]||0x1;this['dialPredictiveOptimization']=_0x522811['dialPredictiveOptimization']||_0x5d4a('0x27');this['dialPredictiveOptimizationPercentage']=_0x522811['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x522811[_0x5d4a('0x28')]||0x258;this[_0x5d4a('0x29')]=_0x522811[_0x5d4a('0x29')]||_0x5d4a('0x2a');this[_0x5d4a('0x2b')]=_0x522811[_0x5d4a('0x2b')]||_0x5d4a('0x2a');this['dialOriginateTimeout']=_0x522811['dialOriginateTimeout']||0x1e;this[_0x5d4a('0x2c')]=_0x522811['dialQueueOptions']||_0x5d4a('0x2d');this[_0x5d4a('0x2e')]=_0x522811[_0x5d4a('0x2e')]||0x3;this[_0x5d4a('0x2f')]=_0x522811[_0x5d4a('0x2f')]||undefined;this[_0x5d4a('0x30')]=_0x522811['dialCongestionMaxRetry']||0x3;this[_0x5d4a('0x31')]=_0x522811[_0x5d4a('0x31')]||0x96;this['dialBusyMaxRetry']=_0x522811[_0x5d4a('0x32')]||0x3;this['dialBusyRetryFrequency']=_0x522811[_0x5d4a('0x33')]||0x96;this[_0x5d4a('0x34')]=_0x522811[_0x5d4a('0x34')]||0x3;this[_0x5d4a('0x35')]=_0x522811[_0x5d4a('0x35')]||0x96;this[_0x5d4a('0x36')]=_0x522811[_0x5d4a('0x36')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x522811[_0x5d4a('0x37')]||0x96;this[_0x5d4a('0x38')]=_0x522811[_0x5d4a('0x38')]||0x3;this[_0x5d4a('0x39')]=_0x522811[_0x5d4a('0x39')]||0x96;this[_0x5d4a('0x3a')]=_0x522811['dialAbandonedMaxRetry']||0x3;this[_0x5d4a('0x3b')]=_0x522811[_0x5d4a('0x3b')]||0x96;this[_0x5d4a('0x3c')]=_0x522811[_0x5d4a('0x3c')]||0x3;this[_0x5d4a('0x3d')]=_0x522811[_0x5d4a('0x3d')]||0x96;this[_0x5d4a('0x3e')]=_0x522811[_0x5d4a('0x3e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x522811[_0x5d4a('0x3f')]||0x96;this[_0x5d4a('0x40')]=_0x522811[_0x5d4a('0x40')]||0x4;this['Trunk']=_0x522811[_0x5d4a('0x41')]?_0x522811['Trunk']:undefined;this[_0x5d4a('0x42')]=_0x522811[_0x5d4a('0x42')]?_0x522811[_0x5d4a('0x42')]:undefined;this['dialPrefix']=_0x522811[_0x5d4a('0x43')]||undefined;this['Interval']=_0x522811[_0x5d4a('0x44')]?_0x522811[_0x5d4a('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x522811[_0x5d4a('0x45')]||_0x5d4a('0x46');this['dialRandomLastDigitCallerIdNumber']=_0x522811[_0x5d4a('0x47')]||undefined;this[_0x5d4a('0x48')]=_0x522811[_0x5d4a('0x48')]||undefined;this[_0x5d4a('0x49')]=strategy[_0x522811[_0x5d4a('0x49')]]||_0x5d4a('0xa');this[_0x5d4a('0x4a')]=!![];this['dialAMDActive']=_0x522811[_0x5d4a('0x4b')]||![];this[_0x5d4a('0x4c')]=_0x522811[_0x5d4a('0x4c')];this[_0x5d4a('0x4d')]=_0x522811[_0x5d4a('0x4d')];this['dialAMDAfterGreetingSilence']=_0x522811[_0x5d4a('0x4e')];this[_0x5d4a('0x4f')]=_0x522811[_0x5d4a('0x4f')];this['dialAMDMinWordLength']=_0x522811[_0x5d4a('0x50')];this[_0x5d4a('0x51')]=_0x522811[_0x5d4a('0x51')];this[_0x5d4a('0x52')]=_0x522811[_0x5d4a('0x52')];this['dialAMDSilenceThreshold']=_0x522811[_0x5d4a('0x53')];this[_0x5d4a('0x54')]=_0x522811[_0x5d4a('0x54')];this[_0x5d4a('0x55')]=0x0;this[_0x5d4a('0x56')]=0x0;this['timeout']=_0x522811[_0x5d4a('0x57')];this[_0x5d4a('0x58')]=0x0;this[_0x5d4a('0x59')]=0x0;this[_0x5d4a('0x5a')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x5d4a('0x5b')]=0x0;this[_0x5d4a('0x5c')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x5d4a('0x5d')]=0x0;this[_0x5d4a('0x5e')]=0x0;this[_0x5d4a('0x5f')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x5d4a('0x60')]=0x0;this[_0x5d4a('0x61')]=0x0;this[_0x5d4a('0x62')]=undefined;this['startPredictive']=undefined;this[_0x5d4a('0x63')]=undefined;this[_0x5d4a('0x64')]=1.05;this[_0x5d4a('0x65')]=0x0;this[_0x5d4a('0x66')]=0x0;this[_0x5d4a('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x5d4a('0x68')]=0x0;this[_0x5d4a('0x69')]=0x0;this[_0x5d4a('0x6a')]=0x0;this[_0x5d4a('0x6b')]=0x0;this[_0x5d4a('0x6c')]=_0x522811[_0x5d4a('0x6d')]||0x14;this['predictiveIntervalMinThreshold']=_0x522811[_0x5d4a('0x6d')]||0xa;this[_0x5d4a('0x6e')]=0x0;this[_0x5d4a('0x6f')]=0x0;this[_0x5d4a('0x70')]=0x1;this[_0x5d4a('0x71')]=0x0;this['erlangCallToSecond']=0x0;this[_0x5d4a('0x72')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x522811['dialRecallMeTimeout']||0x1e;this[_0x5d4a('0x73')]=_0x522811[_0x5d4a('0x73')]||![];this['dialPreviewAutoRecallMe']=!!_0x522811[_0x5d4a('0x74')]||![];this[_0x5d4a('0x75')]=_0x522811[_0x5d4a('0x75')]||undefined;this[_0x5d4a('0x76')]=_0x522811['dialAgiAfterHangupClient']||![];this[_0x5d4a('0x77')]=_0x522811[_0x5d4a('0x77')]||![];this[_0x5d4a('0xd')]=monitorFormat[_0x522811[_0x5d4a('0xd')]]?monitorFormat[_0x522811[_0x5d4a('0xd')]]:undefined;this[_0x5d4a('0x78')]=_0x522811[_0x5d4a('0x78')]||![];this[_0x5d4a('0x79')]=_0x522811[_0x5d4a('0x79')]?_0x522811[_0x5d4a('0x79')]:undefined;}module[_0x5d4a('0x7a')]=VoiceQueue; \ No newline at end of file +var _0x5e1e=['outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','gsm','roundrobin','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay'];(function(_0x2292cb,_0x4666a6){var _0x1ddf00=function(_0x249d75){while(--_0x249d75){_0x2292cb['push'](_0x2292cb['shift']());}};_0x1ddf00(++_0x4666a6);}(_0x5e1e,0x98));var _0xe5e1=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x5e1e[_0x187ee1];return _0x388160;};'use strict';var statusDesc=[_0xe5e1('0x0'),_0xe5e1('0x1'),_0xe5e1('0x2'),_0xe5e1('0x3'),_0xe5e1('0x4'),_0xe5e1('0x5'),_0xe5e1('0x6'),_0xe5e1('0x7'),_0xe5e1('0x8')];var monitorFormat={'wav':_0xe5e1('0x9'),'wav49':'wav49','gsm':_0xe5e1('0xa')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xe5e1('0xb')};function VoiceQueue(_0x4b8f6f){this['id']=_0x4b8f6f['id']||0x0;this[_0xe5e1('0xc')]=_0x4b8f6f[_0xe5e1('0xc')]||'';this['monitor_format']=_0x4b8f6f[_0xe5e1('0xd')]||'';this[_0xe5e1('0xe')]=_0x4b8f6f['type']||'inbound';this[_0xe5e1('0xf')]=0x0;this['talking']=0x0;this[_0xe5e1('0x10')]=0x0;this[_0xe5e1('0x11')]=0x0;this[_0xe5e1('0x12')]=0x0;this[_0xe5e1('0x13')]=0x0;this[_0xe5e1('0x14')]=0x0;this[_0xe5e1('0x15')]=0x0;this['abandoned']=0x0;this[_0xe5e1('0x16')]=0x0;this['available']=0x0;this[_0xe5e1('0x17')]=_0x4b8f6f[_0xe5e1('0x17')]||![];this[_0xe5e1('0x18')]=_0x4b8f6f[_0xe5e1('0x18')]||0xa;this[_0xe5e1('0x19')]=_0x4b8f6f['autopause']||'no';this[_0xe5e1('0x1a')]=!![];this[_0xe5e1('0x1b')]='';this['originated']=0x0;this['temp']=0x0;this[_0xe5e1('0x1c')]=_0x4b8f6f['dialTimezone']||null;this[_0xe5e1('0x1d')]=_0x4b8f6f[_0xe5e1('0x1d')]?_0x4b8f6f['dialGlobalInterval']:null;this[_0xe5e1('0x1e')]=_0x4b8f6f['dialActive'];this['dialMethod']=_0x4b8f6f[_0xe5e1('0x1f')]||_0xe5e1('0x20');this['dialLimitChannel']=_0x4b8f6f[_0xe5e1('0x21')]||0x0;this[_0xe5e1('0x22')]=_0x4b8f6f[_0xe5e1('0x22')]||0x0;this['dialPowerLevel']=_0x4b8f6f['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x4b8f6f['dialPredictiveOptimization']||_0xe5e1('0x23');this['dialPredictiveOptimizationPercentage']=_0x4b8f6f['dialPredictiveOptimizationPercentage']||0.03;this[_0xe5e1('0x24')]=_0x4b8f6f[_0xe5e1('0x24')]||0x258;this[_0xe5e1('0x25')]=_0x4b8f6f[_0xe5e1('0x25')]||'anonymous';this[_0xe5e1('0x26')]=_0x4b8f6f['dialOriginateCallerIdNumber']||_0xe5e1('0x27');this[_0xe5e1('0x28')]=_0x4b8f6f[_0xe5e1('0x28')]||0x1e;this[_0xe5e1('0x29')]=_0x4b8f6f[_0xe5e1('0x29')]||_0xe5e1('0x2a');this[_0xe5e1('0x2b')]=_0x4b8f6f[_0xe5e1('0x2b')]||0x3;this[_0xe5e1('0x2c')]=_0x4b8f6f[_0xe5e1('0x2c')]||undefined;this[_0xe5e1('0x2d')]=_0x4b8f6f[_0xe5e1('0x2d')]||0x3;this[_0xe5e1('0x2e')]=_0x4b8f6f[_0xe5e1('0x2e')]||0x96;this[_0xe5e1('0x2f')]=_0x4b8f6f[_0xe5e1('0x2f')]||0x3;this[_0xe5e1('0x30')]=_0x4b8f6f['dialBusyRetryFrequency']||0x96;this[_0xe5e1('0x31')]=_0x4b8f6f[_0xe5e1('0x31')]||0x3;this[_0xe5e1('0x32')]=_0x4b8f6f[_0xe5e1('0x32')]||0x96;this[_0xe5e1('0x33')]=_0x4b8f6f[_0xe5e1('0x33')]||0x3;this[_0xe5e1('0x34')]=_0x4b8f6f[_0xe5e1('0x34')]||0x96;this[_0xe5e1('0x35')]=_0x4b8f6f['dialDropMaxRetry']||0x3;this[_0xe5e1('0x36')]=_0x4b8f6f[_0xe5e1('0x36')]||0x96;this[_0xe5e1('0x37')]=_0x4b8f6f[_0xe5e1('0x37')]||0x3;this[_0xe5e1('0x38')]=_0x4b8f6f[_0xe5e1('0x38')]||0x96;this['dialMachineMaxRetry']=_0x4b8f6f[_0xe5e1('0x39')]||0x3;this[_0xe5e1('0x3a')]=_0x4b8f6f['dialMachineRetryFrequency']||0x96;this[_0xe5e1('0x3b')]=_0x4b8f6f['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x4b8f6f['dialAgentRejectRetryFrequency']||0x96;this[_0xe5e1('0x3c')]=_0x4b8f6f['dialGlobalMaxRetry']||0x4;this[_0xe5e1('0x3d')]=_0x4b8f6f[_0xe5e1('0x3d')]?_0x4b8f6f['Trunk']:undefined;this[_0xe5e1('0x3e')]=_0x4b8f6f[_0xe5e1('0x3e')]?_0x4b8f6f[_0xe5e1('0x3e')]:undefined;this['dialPrefix']=_0x4b8f6f[_0xe5e1('0x3f')]||undefined;this[_0xe5e1('0x40')]=_0x4b8f6f[_0xe5e1('0x40')]?_0x4b8f6f[_0xe5e1('0x40')]:undefined;this['dialOrderByScheduledAt']=_0x4b8f6f[_0xe5e1('0x41')]||_0xe5e1('0x42');this['dialRandomLastDigitCallerIdNumber']=_0x4b8f6f[_0xe5e1('0x43')]||undefined;this[_0xe5e1('0x44')]=_0x4b8f6f['dialCutDigit']||undefined;this['strategy']=strategy[_0x4b8f6f['strategy']]||_0xe5e1('0x45');this[_0xe5e1('0x46')]=!![];this['dialAMDActive']=_0x4b8f6f[_0xe5e1('0x47')]||![];this['dialAMDInitialSilence']=_0x4b8f6f[_0xe5e1('0x48')];this[_0xe5e1('0x49')]=_0x4b8f6f['dialAMDGreeting'];this[_0xe5e1('0x4a')]=_0x4b8f6f[_0xe5e1('0x4a')];this['dialAMDTotalAnalysisTime']=_0x4b8f6f['dialAMDTotalAnalysisTime'];this[_0xe5e1('0x4b')]=_0x4b8f6f[_0xe5e1('0x4b')];this[_0xe5e1('0x4c')]=_0x4b8f6f[_0xe5e1('0x4c')];this[_0xe5e1('0x4d')]=_0x4b8f6f['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x4b8f6f[_0xe5e1('0x4e')];this['dialAMDMaximumWordLength']=_0x4b8f6f['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xe5e1('0x4f')]=0x0;this[_0xe5e1('0x50')]=_0x4b8f6f[_0xe5e1('0x50')];this[_0xe5e1('0x51')]=0x0;this[_0xe5e1('0x52')]=0x0;this[_0xe5e1('0x53')]=0x0;this[_0xe5e1('0x54')]=0x0;this[_0xe5e1('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xe5e1('0x56')]=0x0;this[_0xe5e1('0x57')]=0x0;this[_0xe5e1('0x58')]=0x0;this[_0xe5e1('0x59')]=0x0;this[_0xe5e1('0x5a')]=0x0;this['outboundReCallsDay']=0x0;this[_0xe5e1('0x5b')]=0x0;this[_0xe5e1('0x5c')]=undefined;this[_0xe5e1('0x5d')]=undefined;this[_0xe5e1('0x5e')]=undefined;this[_0xe5e1('0x5f')]=1.05;this[_0xe5e1('0x60')]=0x0;this[_0xe5e1('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe5e1('0x62')]=0x0;this[_0xe5e1('0x63')]=0x0;this[_0xe5e1('0x64')]=0x0;this[_0xe5e1('0x65')]=0x0;this[_0xe5e1('0x66')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4b8f6f[_0xe5e1('0x67')]||0x14;this['predictiveIntervalMinThreshold']=_0x4b8f6f['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xe5e1('0x68')]=0x0;this[_0xe5e1('0x69')]=0x0;this[_0xe5e1('0x6a')]=0x1;this[_0xe5e1('0x6b')]=0x0;this[_0xe5e1('0x6c')]=0x0;this[_0xe5e1('0x6d')]=0x0;this[_0xe5e1('0x6e')]=0x0;this[_0xe5e1('0x6f')]=_0x4b8f6f[_0xe5e1('0x6f')]||0x1e;this['dialRecallInQueue']=_0x4b8f6f[_0xe5e1('0x70')]||![];this[_0xe5e1('0x71')]=!!_0x4b8f6f[_0xe5e1('0x71')]||![];this['dialQueueProject2']=_0x4b8f6f['dialQueueProject2']||undefined;this[_0xe5e1('0x72')]=_0x4b8f6f[_0xe5e1('0x72')]||![];this[_0xe5e1('0x73')]=_0x4b8f6f[_0xe5e1('0x73')]||![];this[_0xe5e1('0xd')]=monitorFormat[_0x4b8f6f[_0xe5e1('0xd')]]?monitorFormat[_0x4b8f6f[_0xe5e1('0xd')]]:undefined;this[_0xe5e1('0x74')]=_0x4b8f6f[_0xe5e1('0x74')]||![];this['mandatoryDispositionPause']=_0x4b8f6f[_0xe5e1('0x75')]?_0x4b8f6f[_0xe5e1('0x75')]:undefined;}module[_0xe5e1('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 f9c7dc2..d476783 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 _0x3853=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x49ceb8,_0x458d69){var _0x41cbcc=function(_0xcfd4f1){while(--_0xcfd4f1){_0x49ceb8['push'](_0x49ceb8['shift']());}};_0x41cbcc(++_0x458d69);}(_0x3853,0x142));var _0x3385=function(_0x23502b,_0x3e4023){_0x23502b=_0x23502b-0x0;var _0xbdc310=_0x3853[_0x23502b];return _0xbdc310;};'use strict';function VtigerAccount(_0x2098f2){this['id']=_0x2098f2['id']||0x0;this[_0x3385('0x0')]=_0x2098f2[_0x3385('0x0')]||'';this['username']=_0x2098f2[_0x3385('0x1')]||'';this['accessKey']=_0x2098f2[_0x3385('0x2')]||'';this[_0x3385('0x3')]=_0x2098f2[_0x3385('0x3')]||'';this[_0x3385('0x4')]=_0x2098f2[_0x3385('0x4')]||'';this[_0x3385('0x5')]=_0x2098f2['Configurations']||{};}module[_0x3385('0x6')]=VtigerAccount; \ No newline at end of file +var _0xa10f=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0xa10f,0x157));var _0xfa10=function(_0x37bf72,_0x1c9833){_0x37bf72=_0x37bf72-0x0;var _0x373612=_0xa10f[_0x37bf72];return _0x373612;};'use strict';function VtigerAccount(_0x3673b4){this['id']=_0x3673b4['id']||0x0;this[_0xfa10('0x0')]=_0x3673b4[_0xfa10('0x0')]||'';this[_0xfa10('0x1')]=_0x3673b4[_0xfa10('0x1')]||'';this[_0xfa10('0x2')]=_0x3673b4[_0xfa10('0x2')]||'';this[_0xfa10('0x3')]=_0x3673b4[_0xfa10('0x3')]||'';this['serverUrl']=_0x3673b4[_0xfa10('0x4')]||'';this[_0xfa10('0x5')]=_0x3673b4['Configurations']||{};}module[_0xfa10('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 ad32452..17ca9a8 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 _0xcabc=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x5d8fa1,_0x48f172){var _0x53a280=function(_0x256d98){while(--_0x256d98){_0x5d8fa1['push'](_0x5d8fa1['shift']());}};_0x53a280(++_0x48f172);}(_0xcabc,0x197));var _0xccab=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcabc[_0x4e676e];return _0x336a3c;};'use strict';function ZendeskAccount(_0x2ac6a1){this['id']=_0x2ac6a1['id']||0x0;this[_0xccab('0x0')]=_0x2ac6a1[_0xccab('0x0')]||'';this[_0xccab('0x1')]=_0x2ac6a1[_0xccab('0x1')]||'';this[_0xccab('0x2')]=_0x2ac6a1[_0xccab('0x2')]||'';this[_0xccab('0x3')]=_0x2ac6a1[_0xccab('0x3')]||'';this['remoteUri']=_0x2ac6a1[_0xccab('0x4')]||'';this['authType']=_0x2ac6a1[_0xccab('0x5')]||'';this[_0xccab('0x6')]=_0x2ac6a1[_0xccab('0x6')]||_0xccab('0x7');this['serverUrl']=_0x2ac6a1[_0xccab('0x8')]||'';this[_0xccab('0x9')]=_0x2ac6a1['Configurations']||{};}module[_0xccab('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x5942=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x5942,0x9f));var _0x2594=function(_0x5a3e56,_0x57163b){_0x5a3e56=_0x5a3e56-0x0;var _0x52cad6=_0x5942[_0x5a3e56];return _0x52cad6;};'use strict';function ZendeskAccount(_0x38caed){this['id']=_0x38caed['id']||0x0;this[_0x2594('0x0')]=_0x38caed[_0x2594('0x0')]||'';this['username']=_0x38caed[_0x2594('0x1')]||'';this[_0x2594('0x2')]=_0x38caed['password']||'';this[_0x2594('0x3')]=_0x38caed['token']||'';this['remoteUri']=_0x38caed[_0x2594('0x4')]||'';this[_0x2594('0x5')]=_0x38caed[_0x2594('0x5')]||'';this[_0x2594('0x6')]=_0x38caed[_0x2594('0x6')]||_0x2594('0x7');this[_0x2594('0x8')]=_0x38caed['serverUrl']||'';this['Configurations']=_0x38caed[_0x2594('0x9')]||{};}module[_0x2594('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index db3037f..97f91d1 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 _0x4f88=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4f88,0x1da));var _0x84f8=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0x4f88[_0x22e9fe];return _0x47cd19;};'use strict';function ZohoAccount(_0x1df8fb){this['id']=_0x1df8fb['id']||0x0;this[_0x84f8('0x0')]=_0x1df8fb['name']||'';this[_0x84f8('0x1')]=_0x1df8fb[_0x84f8('0x1')]||'';this[_0x84f8('0x2')]=_0x1df8fb[_0x84f8('0x2')]||'';this[_0x84f8('0x3')]=_0x1df8fb[_0x84f8('0x3')]||'';this[_0x84f8('0x4')]=_0x1df8fb[_0x84f8('0x4')]||'';this[_0x84f8('0x5')]=_0x1df8fb['clientSecret']||'';this[_0x84f8('0x6')]=_0x1df8fb['serverUrl']||'';this[_0x84f8('0x7')]=_0x1df8fb['code']||'';this[_0x84f8('0x8')]=_0x1df8fb['refreshToken']||'';this[_0x84f8('0x9')]=_0x1df8fb[_0x84f8('0x9')]||{};}module[_0x84f8('0xa')]=ZohoAccount; \ No newline at end of file +var _0xb70b=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description'];(function(_0xdaa60f,_0x330d0a){var _0x5855f5=function(_0x2a4471){while(--_0x2a4471){_0xdaa60f['push'](_0xdaa60f['shift']());}};_0x5855f5(++_0x330d0a);}(_0xb70b,0x1c0));var _0xbb70=function(_0xd081f2,_0x583bc0){_0xd081f2=_0xd081f2-0x0;var _0x5eaf54=_0xb70b[_0xd081f2];return _0x5eaf54;};'use strict';function ZohoAccount(_0x56d717){this['id']=_0x56d717['id']||0x0;this[_0xbb70('0x0')]=_0x56d717['name']||'';this['description']=_0x56d717[_0xbb70('0x1')]||'';this[_0xbb70('0x2')]=_0x56d717[_0xbb70('0x2')]||'';this[_0xbb70('0x3')]=_0x56d717[_0xbb70('0x3')]||'';this[_0xbb70('0x4')]=_0x56d717[_0xbb70('0x4')]||'';this[_0xbb70('0x5')]=_0x56d717[_0xbb70('0x5')]||'';this['serverUrl']=_0x56d717[_0xbb70('0x6')]||'';this['code']=_0x56d717[_0xbb70('0x7')]||'';this['refreshToken']=_0x56d717[_0xbb70('0x8')]||'';this[_0xbb70('0x9')]=_0x56d717[_0xbb70('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 797c552..11eb68c 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 _0x56be=['util','lodash','isNil','string','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','number','exports'];(function(_0x2482a7,_0x31a9f1){var _0x474790=function(_0x1ccf5e){while(--_0x1ccf5e){_0x2482a7['push'](_0x2482a7['shift']());}};_0x474790(++_0x31a9f1);}(_0x56be,0x140));var _0xe56b=function(_0x5757df,_0x36ba4e){_0x5757df=_0x5757df-0x0;var _0x212c01=_0x56be[_0x5757df];return _0x212c01;};'use strict';var util=require(_0xe56b('0x0'));var _=require(_0xe56b('0x1'));var moment=require('moment');function checkNameSurname(_0x3940b6,_0x337a6f,_0x18d190){var _0x28fc76='';if(!_[_0xe56b('0x2')](_0x337a6f)&&_0xe56b('0x3')===typeof _0x337a6f){_0x28fc76+=_0x337a6f;}if(!_[_0xe56b('0x2')](_0x18d190)&&'string'===typeof _0x18d190){_0x28fc76+='\x20'+_0x18d190;}if(_0x28fc76!==''){return _0x28fc76;}return _0x3940b6;}function Action(_0x2d60af,_0x3dca51,_0x7ad4d2,_0x493254,_0x5052d4){this['uniqueid']=_0x7ad4d2||undefined;this[_0xe56b('0x4')]=_0x2d60af['id'];this['queue']=_0x3dca51[_0xe56b('0x5')];this[_0xe56b('0x6')]=_0x3dca51['type'];this[_0xe56b('0x7')]=_0xe56b('0x8');this[_0xe56b('0x9')]=![];this[_0xe56b('0xa')]=_['isNil'](_0x2d60af[_0xe56b('0xb')])?undefined:_0x2d60af['Agent'][_0xe56b('0x5')];this[_0xe56b('0xc')]=this['membername']?util[_0xe56b('0xd')]('SIP/%s',this['membername']):_0x493254||undefined;this[_0xe56b('0xe')]=checkNameSurname(_0x2d60af['Contact']['phone'],_0x2d60af[_0xe56b('0xf')]['firstName'],_0x2d60af[_0xe56b('0xf')][_0xe56b('0x10')]);this['active']=_0x2d60af[_0xe56b('0x11')]||![];this[_0xe56b('0x12')]=_0x2d60af['Contact']['phone'];this[_0xe56b('0x13')]=_0x2d60af[_0xe56b('0x13')];this[_0xe56b('0x14')]=_0x2d60af[_0xe56b('0x14')]||0x0;this[_0xe56b('0x15')]=_0x2d60af['countcongestionretry']||0x0;this[_0xe56b('0x16')]=_0x2d60af['countnoanswerretry']||0x0;this['countglobal']=(_0x2d60af[_0xe56b('0x14')]||0x0)+(_0x2d60af[_0xe56b('0x15')]||0x0)+(_0x2d60af[_0xe56b('0x16')]||0x0)+(_0x2d60af[_0xe56b('0x17')]||0x0)+(_0x2d60af[_0xe56b('0x18')]||0x0)+(_0x2d60af[_0xe56b('0x19')]||0x0)+(_0x2d60af['countmachineretry']||0x0)+(_0x2d60af['countagentrejectretry']||0x0);this[_0xe56b('0x17')]=_0x2d60af[_0xe56b('0x17')]||0x0;this['countdropretry']=_0x2d60af[_0xe56b('0x18')]||0x0;this[_0xe56b('0x19')]=_0x2d60af[_0xe56b('0x19')]||0x0;this['countmachineretry']=_0x2d60af[_0xe56b('0x1a')]||0x0;this[_0xe56b('0x1b')]=_0x2d60af['countagentrejectretry']||0x0;this[_0xe56b('0x1c')]=_0x2d60af[_0xe56b('0x1c')];this['callbackuniqueid']=_0x2d60af[_0xe56b('0x1d')];this[_0xe56b('0x1e')]=_0x2d60af['callbackat'];this[_0xe56b('0x1f')]=_0x2d60af['recallme'];this[_0xe56b('0x20')]=_0x2d60af['ContactId'];this[_0xe56b('0x21')]=_0x2d60af['ListId'];this[_0xe56b('0x22')]=_[_0xe56b('0x2')](_0x2d60af['Agent'])?_0x2d60af['UserId']:_0x2d60af['Agent']['id'];this[_0xe56b('0x23')]=_0x2d60af[_0xe56b('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xe56b('0x24')][_0xe56b('0x25')]=function(){return util[_0xe56b('0xd')]('\x22%s\x22\x20<%s>',this[_0xe56b('0xe')],this[_0xe56b('0x26')]);};module[_0xe56b('0x27')]=Action; \ No newline at end of file +var _0x6e2b=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat'];(function(_0x1101cb,_0x3c9ff3){var _0x326507=function(_0x5e2fec){while(--_0x5e2fec){_0x1101cb['push'](_0x1101cb['shift']());}};_0x326507(++_0x3c9ff3);}(_0x6e2b,0x92));var _0xb6e2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e2b[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xb6e2('0x0'));var _=require(_0xb6e2('0x1'));var moment=require(_0xb6e2('0x2'));function checkNameSurname(_0x1db15a,_0x41de85,_0x37a66b){var _0x163dbc='';if(!_[_0xb6e2('0x3')](_0x41de85)&&_0xb6e2('0x4')===typeof _0x41de85){_0x163dbc+=_0x41de85;}if(!_[_0xb6e2('0x3')](_0x37a66b)&&_0xb6e2('0x4')===typeof _0x37a66b){_0x163dbc+='\x20'+_0x37a66b;}if(_0x163dbc!==''){return _0x163dbc;}return _0x1db15a;}function Action(_0x57a195,_0x50905e,_0x4f98e1,_0x808d83,_0x322fd7){this[_0xb6e2('0x5')]=_0x4f98e1||undefined;this[_0xb6e2('0x6')]=_0x57a195['id'];this[_0xb6e2('0x7')]=_0x50905e[_0xb6e2('0x8')];this[_0xb6e2('0x9')]=_0x50905e[_0xb6e2('0x9')];this[_0xb6e2('0xa')]='queue';this[_0xb6e2('0xb')]=![];this[_0xb6e2('0xc')]=_[_0xb6e2('0x3')](_0x57a195[_0xb6e2('0xd')])?undefined:_0x57a195[_0xb6e2('0xd')][_0xb6e2('0x8')];this['channelAgent']=this['membername']?util[_0xb6e2('0xe')]('SIP/%s',this['membername']):_0x808d83||undefined;this[_0xb6e2('0xf')]=checkNameSurname(_0x57a195[_0xb6e2('0x10')][_0xb6e2('0x11')],_0x57a195['Contact']['firstName'],_0x57a195[_0xb6e2('0x10')][_0xb6e2('0x12')]);this[_0xb6e2('0x13')]=_0x57a195[_0xb6e2('0x13')]||![];this[_0xb6e2('0x14')]=_0x57a195[_0xb6e2('0x10')][_0xb6e2('0x11')];this[_0xb6e2('0x15')]=_0x57a195['scheduledat'];this[_0xb6e2('0x16')]=_0x57a195['countbusyretry']||0x0;this[_0xb6e2('0x17')]=_0x57a195['countcongestionretry']||0x0;this[_0xb6e2('0x18')]=_0x57a195['countnoanswerretry']||0x0;this[_0xb6e2('0x19')]=(_0x57a195['countbusyretry']||0x0)+(_0x57a195[_0xb6e2('0x17')]||0x0)+(_0x57a195[_0xb6e2('0x18')]||0x0)+(_0x57a195[_0xb6e2('0x1a')]||0x0)+(_0x57a195[_0xb6e2('0x1b')]||0x0)+(_0x57a195['countabandonedretry']||0x0)+(_0x57a195[_0xb6e2('0x1c')]||0x0)+(_0x57a195['countagentrejectretry']||0x0);this[_0xb6e2('0x1a')]=_0x57a195[_0xb6e2('0x1a')]||0x0;this[_0xb6e2('0x1b')]=_0x57a195[_0xb6e2('0x1b')]||0x0;this[_0xb6e2('0x1d')]=_0x57a195[_0xb6e2('0x1d')]||0x0;this[_0xb6e2('0x1c')]=_0x57a195[_0xb6e2('0x1c')]||0x0;this['countagentrejectretry']=_0x57a195[_0xb6e2('0x1e')]||0x0;this['callback']=_0x57a195[_0xb6e2('0x1f')];this[_0xb6e2('0x20')]=_0x57a195[_0xb6e2('0x20')];this[_0xb6e2('0x21')]=_0x57a195[_0xb6e2('0x21')];this['recallme']=_0x57a195['recallme'];this[_0xb6e2('0x22')]=_0x57a195[_0xb6e2('0x22')];this['ListId']=_0x57a195[_0xb6e2('0x23')];this[_0xb6e2('0x24')]=_[_0xb6e2('0x3')](_0x57a195[_0xb6e2('0xd')])?_0x57a195[_0xb6e2('0x24')]:_0x57a195[_0xb6e2('0xd')]['id'];this['VoiceQueueId']=_0x57a195[_0xb6e2('0x25')];this[_0xb6e2('0x26')]='';this[_0xb6e2('0x27')]='';}Action[_0xb6e2('0x28')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0xb6e2('0x29')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 88d64cd..f201765 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 _0x4bc3=['extractCalleridName','extractCalleridNumber','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','idContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','defaults','redis','localhost','socket.io-emitter','prototype','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','hangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','emit','outbound','name','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','md5','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','enqueue','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','buildObj','busy','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','\x20Queue','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Empty\x20Contact','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','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','TrunkBackup'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x4bc3,0x16e));var _0x34bc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4bc3[_0x46698a];return _0x356db0;};'use strict';var util=require(_0x34bc('0x0'));var _=require(_0x34bc('0x1'));var BPromise=require('bluebird');var uuid=require(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var md5=require('md5');var Redis=require(_0x34bc('0x4'));var config=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var loggerAction=require(_0x34bc('0x6'))(_0x34bc('0x8'));var ami=require(_0x34bc('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0x34bc('0xa'));var ut=require('./util/util');config['redis']=_[_0x34bc('0xb')](config[_0x34bc('0xc')],{'host':_0x34bc('0xd'),'port':0x18eb});var io=require(_0x34bc('0xe'))(new Redis(config[_0x34bc('0xc')]));var Sequence=function(){};Sequence[_0x34bc('0xf')]['enqueue']=function(_0x5a478d){this[_0x34bc('0x10')]=this[_0x34bc('0x10')]?this[_0x34bc('0x10')]['finally'](_0x5a478d):_0x5a478d();};function Preview(_0x41960e){this['sequence']=new Sequence();this[_0x34bc('0x11')]=_0x41960e[_0x34bc('0x12')];this[_0x34bc('0x13')]=_0x41960e['trunks'];this[_0x34bc('0x14')]={};this['agents']=_0x41960e[_0x34bc('0x15')];this[_0x34bc('0x16')]=0x0;ami['on'](_0x34bc('0x17'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x34bc('0x18'),this['syncHangup'][_0x34bc('0x19')](this));ami['on'](_0x34bc('0x1a'),this[_0x34bc('0x1b')][_0x34bc('0x19')](this));ami['on'](_0x34bc('0x1c'),this[_0x34bc('0x1d')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x34bc('0x19')](this));ami['on'](_0x34bc('0x1e'),this[_0x34bc('0x1f')][_0x34bc('0x19')](this));ami['on']('attendedtransfer',this[_0x34bc('0x20')][_0x34bc('0x19')](this));ami['on']('blindtransfer',this[_0x34bc('0x21')][_0x34bc('0x19')](this));this['loopCampaigns'](this[_0x34bc('0x11')]);}function emit(_0x26cdec,_0x2d18ea,_0x120bd3){io['to'](_0x26cdec)[_0x34bc('0x22')](_0x2d18ea,_0x120bd3);}function emitCampaignPreview(_0x42c814){if(_0x42c814['type']===_0x34bc('0x23')){var _0x3c9939={'id':_0x42c814['id'],'name':_0x42c814[_0x34bc('0x24')],'strategy':_0x42c814['strategy'],'answered':_0x42c814['answered'],'available':_0x42c814[_0x34bc('0x25')],'loggedIn':_0x42c814[_0x34bc('0x26')],'pTalking':_0x42c814[_0x34bc('0x27')],'sumBillable':_0x42c814[_0x34bc('0x28')],'sumDuration':_0x42c814[_0x34bc('0x29')],'sumHoldTime':_0x42c814[_0x34bc('0x2a')]||0x0,'talking':_0x42c814[_0x34bc('0x2b')],'total':_0x42c814[_0x34bc('0x2c')],'type':_0x42c814[_0x34bc('0x2d')],'unmanaged':_0x42c814[_0x34bc('0x2e')],'abandoned':_0x42c814[_0x34bc('0x2f')],'waiting':_0x42c814[_0x34bc('0x30')],'loggedInDb':_0x42c814['loggedInDb'],'dialActive':_0x42c814[_0x34bc('0x31')],'dialMethod':_0x42c814['dialMethod'],'dialOriginateCallerIdName':_0x42c814['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x42c814[_0x34bc('0x32')],'dialOriginateTimeout':_0x42c814['dialOriginateTimeout'],'dialPrefix':_0x42c814[_0x34bc('0x33')],'outboundAnswerAgiCallsDay':_0x42c814[_0x34bc('0x34')],'outboundAnswerCallsDay':_0x42c814[_0x34bc('0x35')],'outboundBlacklistCallsDay':_0x42c814['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x42c814[_0x34bc('0x36')],'outboundCongestionCallsDay':_0x42c814[_0x34bc('0x37')],'outboundDropCallsDayACS':_0x42c814[_0x34bc('0x38')],'outboundDropCallsDayCallersExit':_0x42c814[_0x34bc('0x39')],'outboundDropCallsDayTimeout':_0x42c814[_0x34bc('0x3a')],'outboundNoAnswerCallsDay':_0x42c814[_0x34bc('0x3b')],'outboundNoSuchCallsDay':_0x42c814['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x42c814[_0x34bc('0x3c')],'outboundReCallsDay':_0x42c814[_0x34bc('0x3d')],'outboundRejectCallsDay':_0x42c814[_0x34bc('0x3e')],'outboundUnknownCallsDay':_0x42c814[_0x34bc('0x3f')],'outboundAbandonedCallsDay':_0x42c814[_0x34bc('0x40')],'predictiveIntervalAnsweredCalls':_0x42c814[_0x34bc('0x41')],'predictiveIntervalAvgHoldtime':_0x42c814['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x42c814[_0x34bc('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x42c814['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x42c814['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x42c814[_0x34bc('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x42c814['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x42c814[_0x34bc('0x44')],'predictiveIntervalMultiplicativeFactor':_0x42c814[_0x34bc('0x45')],'predictiveIntervalPauses':_0x42c814[_0x34bc('0x46')],'predictiveIntervalAvailable':_0x42c814[_0x34bc('0x47')],'predictiveIntervalTotalCalls':_0x42c814[_0x34bc('0x48')],'message':_0x42c814[_0x34bc('0x49')],'originated':_0x42c814[_0x34bc('0x4a')],'erlangCalls':_0x42c814['erlangCalls'],'erlangCallToSecond':_0x42c814[_0x34bc('0x4b')],'erlangAbandonmentRate':_0x42c814[_0x34bc('0x4c')],'erlangBusyFactor':_0x42c814[_0x34bc('0x4d')],'startPredictive':_0x42c814[_0x34bc('0x4e')],'startProgressive':_0x42c814[_0x34bc('0x4f')]};if(_0x42c814['Trunk']){_0x3c9939[_0x34bc('0x50')]={'id':_0x42c814[_0x34bc('0x50')]['id'],'name':_0x42c814[_0x34bc('0x50')][_0x34bc('0x24')],'active':_0x42c814[_0x34bc('0x50')]['active'],'callerid':_0x42c814['Trunk'][_0x34bc('0x51')]};}if(_0x42c814[_0x34bc('0x52')]){_0x3c9939[_0x34bc('0x52')]={'id':_0x42c814[_0x34bc('0x52')]['id'],'name':_0x42c814['Interval'][_0x34bc('0x24')]};}var _0x4477bd=md5(JSON[_0x34bc('0x53')](_0x3c9939));if(_0x42c814['md5']!==_0x4477bd){_0x42c814[_0x34bc('0x54')]=_0x4477bd;emit(util[_0x34bc('0x55')](_0x34bc('0x56'),_0x3c9939[_0x34bc('0x24')]),'voice_queue:save',_0x3c9939);}}}function emitVoiceQueueChannelRemove(_0x2ac72b){logger[_0x34bc('0x57')](_0x34bc('0x58'),JSON['stringify'](_0x2ac72b));emit(util[_0x34bc('0x55')](_0x34bc('0x56'),_0x2ac72b[_0x34bc('0x24')]),_0x34bc('0x59'),_0x2ac72b);io[_0x34bc('0x22')]('voice_queue_presence:remove',_0x2ac72b);}function notSendMessagesQueue(_0xca2aaf){if(_0xca2aaf[_0x34bc('0x5a')]){if(_0xca2aaf[_0x34bc('0x4a')]===0x0&&_0xca2aaf[_0x34bc('0x27')]===0x0){_0xca2aaf[_0x34bc('0x5a')]=![];_0xca2aaf['available']=0x0;_0xca2aaf[_0x34bc('0x5b')]=0x0;_0xca2aaf['message']=_0x34bc('0x5c');ut[_0x34bc('0x5d')](_0x34bc('0x5e'),_0xca2aaf[_0x34bc('0x24')]+'\x20is\x20not\x20active');}else{_0xca2aaf[_0x34bc('0x49')]=_0x34bc('0x5f');ut['logger'](_0x34bc('0x5e'),_0xca2aaf[_0x34bc('0x24')]+_0x34bc('0x60'));}emitCampaignPreview(_0xca2aaf);}}Preview['prototype'][_0x34bc('0x61')]=function(){var _0xbf2127=this;setInterval(function(){_0xbf2127[_0x34bc('0x62')]();},0x7cf);};Preview[_0x34bc('0xf')][_0x34bc('0x62')]=function(){var _0x20debf=this[_0x34bc('0x11')];this[_0x34bc('0x16')]+=0x1;for(var _0x4756c6 in _0x20debf){if(_0x20debf[_0x34bc('0x63')](_0x4756c6)&&(_0x20debf[_0x4756c6][_0x34bc('0x64')]==='preview'||_0x20debf[_0x4756c6]['dialMethod']===_0x34bc('0x65'))&&_0x20debf[_0x4756c6][_0x34bc('0x2d')]===_0x34bc('0x23')){if(this[_0x34bc('0x16')]>0x7){this[_0x34bc('0x16')]=0x0;this[_0x34bc('0x66')]();}}if(_0x20debf['hasOwnProperty'](_0x4756c6)&&_0x20debf[_0x4756c6][_0x34bc('0x64')]==='preview'&&_0x20debf[_0x4756c6][_0x34bc('0x2d')]===_0x34bc('0x23')){if(_0x20debf[_0x4756c6][_0x34bc('0x31')]){this['setMessage'](_0x20debf[_0x4756c6]);if(_0x20debf[_0x4756c6][_0x34bc('0x67')])this[_0x34bc('0x68')](_0x20debf[_0x4756c6]);}else{notSendMessagesQueue(_0x20debf[_0x4756c6]);}}}};Preview[_0x34bc('0xf')][_0x34bc('0x69')]=function(_0x21b903){var _0x26924c=this;this[_0x34bc('0x6a')][_0x34bc('0x6b')](function(){if(!_[_0x34bc('0x6c')](_0x26924c[_0x34bc('0x14')][_0x21b903])){loggerAction[_0x34bc('0x57')](_0x34bc('0x6d'),_0x21b903,'Queue',_0x26924c['actions'][_0x21b903][_0x34bc('0x6e')],_0x34bc('0x6f'),JSON[_0x34bc('0x53')](_0x26924c['campaignsPreview'][_0x26924c['actions'][_0x21b903][_0x34bc('0x6e')]][_0x34bc('0x4a')]),_0x34bc('0x70'),JSON['stringify'](_0x26924c[_0x34bc('0x11')][_0x26924c[_0x34bc('0x14')][_0x21b903]['queue']][_0x34bc('0x27')]),JSON['stringify'](_0x26924c[_0x34bc('0x14')][_0x21b903]['dialAnswer']),JSON[_0x34bc('0x53')](_[_0x34bc('0x71')](_0x26924c[_0x34bc('0x14')][_0x21b903],[_0x34bc('0x72'),'UserId',_0x34bc('0x73'),_0x34bc('0x74')])));return ami[_0x34bc('0x75')]({'action':_0x34bc('0x76'),'channel':_0x26924c[_0x34bc('0x14')][_0x21b903][_0x34bc('0x77')]})[_0x34bc('0x78')](function(_0x20c3c7){if(_0x20c3c7['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x26924c['actions'][_0x21b903]){ut[_0x34bc('0x79')](_0x26924c[_0x34bc('0x11')][_0x26924c['actions'][_0x21b903][_0x34bc('0x6e')]],_0x34bc('0x7a'));if(_0x26924c[_0x34bc('0x14')][_0x21b903][_0x34bc('0x7b')]===!![]){ut[_0x34bc('0x7c')](_0x26924c['campaignsPreview'][_0x26924c['actions'][_0x21b903]['queue']],_0x34bc('0x7a'));ut[_0x34bc('0x7d')](_0x34bc('0x7e')+_0x21b903,_0x26924c[_0x34bc('0x14')][_0x21b903][_0x34bc('0x6e')]);}ut['loggerError'](_0x34bc('0x7f')+_0x21b903,_0x26924c[_0x34bc('0x14')][_0x21b903][_0x34bc('0x6e')]);delete _0x26924c[_0x34bc('0x14')][_0x21b903];}},0x2328);}});}});};Preview['prototype'][_0x34bc('0x66')]=function(){var _0x9b0c7c=this;loggerAction[_0x34bc('0x57')](_0x34bc('0x80'),_[_0x34bc('0x81')](this[_0x34bc('0x14')]));for(var _0x21de42 in this[_0x34bc('0x14')]){if(_0x9b0c7c[_0x34bc('0x14')][_0x34bc('0x63')](_0x21de42)){_0x9b0c7c[_0x34bc('0x69')](_0x21de42);}}};Preview[_0x34bc('0xf')][_0x34bc('0x68')]=function(_0x592e81){var _0x447c93=this;rpcDb[_0x34bc('0x82')](_0x592e81['id'],ut[_0x34bc('0x83')](this[_0x34bc('0x15')]))[_0x34bc('0x84')](function(_0x1b3704){if(!_[_0x34bc('0x6c')](_0x1b3704)){for(var _0x43337d=0x0;_0x43337d<_0x1b3704[_0x34bc('0x85')];_0x43337d+=0x1){if(ut[_0x34bc('0x86')](_0x1b3704[_0x43337d][_0x34bc('0x87')])<_0x592e81[_0x34bc('0x88')]*0x3c){if(_0x1b3704[_0x43337d][_0x34bc('0x89')]&&!_0x1b3704[_0x43337d][_0x34bc('0x89')]['voicePause']){_0x447c93[_0x34bc('0x8a')](_0x1b3704[_0x43337d]['id'])[_0x34bc('0x84')](ut[_0x34bc('0x8b')](_0x34bc('0x8c')))[_0x34bc('0x78')](ut[_0x34bc('0x8b')](_0x34bc('0x8c')));}else{rpcDb[_0x34bc('0x8d')](_0x1b3704[_0x43337d]['id']);}}else{var _0x47068c=new Action(_0x1b3704[_0x43337d],_0x592e81);_0x47068c[_0x34bc('0x8e')]=moment()['format'](_0x34bc('0x8f'));_0x592e81[_0x34bc('0x3d')]+=0x1;ut[_0x34bc('0x90')](_0x47068c,0x17,'RecallInQueue');if(_0x592e81[_0x34bc('0x91')]){rpcDb[_0x34bc('0x92')](ut[_0x34bc('0x93')](_0x1b3704[_0x43337d]));rpcDb[_0x34bc('0x94')](_0x47068c,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x34bc('0x90')](_0x47068c,0x16,_0x34bc('0x95'));rpcDb[_0x34bc('0x94')](_0x47068c,_0x34bc('0x96'));rpcDb[_0x34bc('0x97')](_0x47068c,_0x34bc('0x96'));}}}}})[_0x34bc('0x78')](ut[_0x34bc('0x8b')]('[getContactRecallMe]'));};Preview['prototype'][_0x34bc('0x98')]=function(_0x1dd036){_0x1dd036[_0x34bc('0x5a')]=!![];if(ut[_0x34bc('0x99')](_0x1dd036[_0x34bc('0x26')])){_0x1dd036[_0x34bc('0x49')]=_0x34bc('0x9a');}else if(!ut[_0x34bc('0x9b')](_0x1dd036[_0x34bc('0x31')])){_0x1dd036[_0x34bc('0x49')]=_0x34bc('0x5c');}else if(!this[_0x34bc('0x9c')](_0x1dd036[_0x34bc('0x50')])){if(!this[_0x34bc('0x9c')](_0x1dd036['TrunkBackup'])){_0x1dd036[_0x34bc('0x49')]=_0x34bc('0x9d');}else{_0x1dd036[_0x34bc('0x49')]='ACTIVE';}}else{_0x1dd036[_0x34bc('0x49')]=_0x34bc('0x9e');}emitCampaignPreview(_0x1dd036);};Preview[_0x34bc('0xf')][_0x34bc('0x9f')]=function(_0x570876,_0x13007f,_0x278133){var _0x1542b7=this;var _0x190689=this[_0x34bc('0x14')][_0x13007f];var _0x4b209b=this[_0x34bc('0x11')][_0x190689[_0x34bc('0x6e')]];var _0x1c2c10;if(_0x4b209b){switch(_0x278133){case'1':_0x4b209b[_0x34bc('0xa0')]+=0x1;_0x190689['countnosuchnumberretry']+=0x1;_0x190689[_0x34bc('0xa1')]=ut[_0x34bc('0xa2')](_0x190689);ut[_0x34bc('0x90')](_0x190689,0x0,_0x34bc('0xa3'));ami[_0x34bc('0x22')](_0x34bc('0xa4'),ut['buildObj'](_0x190689,'nosuchnumber'));rpcDb[_0x34bc('0x94')](_0x190689,_0x34bc('0xa5'));if(ut['totalGlobal'](_0x190689)>=_0x4b209b[_0x34bc('0xa6')]){_0x1c2c10=ut[_0x34bc('0xa7')](_0x190689,0xf,_0x34bc('0xa8'));rpcDb[_0x34bc('0x97')](_0x1c2c10,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x190689['countnosuchnumberretry']>=_0x4b209b[_0x34bc('0xa9')]){rpcDb[_0x34bc('0x97')](_0x190689,_0x34bc('0xaa'));}else{rpcDb[_0x34bc('0xab')](ut[_0x34bc('0xac')](_0x190689,_0x34bc('0xad'),_0x4b209b[_0x34bc('0xae')]),_0x190689[_0x34bc('0xaf')],_0x190689[_0x34bc('0xb0')]);}}delete this[_0x34bc('0x14')][_0x570876[_0x34bc('0xb1')]];break;case _0x34bc('0xb2'):var _0x21e18b=moment()[_0x34bc('0x55')](_0x34bc('0x8f'));_0x190689[_0x34bc('0xb3')]=_0x21e18b;_0x190689['answertime']=_0x21e18b;_0x190689[_0x34bc('0x7b')]=!![];_0x4b209b[_0x34bc('0x27')]+=0x1;logger[_0x34bc('0x57')](_0x34bc('0xb4'),_0x190689[_0x34bc('0xb5')],'\x20Queue',_0x4b209b[_0x34bc('0x24')],_0x34bc('0x70'),_0x4b209b[_0x34bc('0x27')]);ami[_0x34bc('0x22')](_0x34bc('0xb6'),ut['buildObj'](_0x190689,_0x34bc('0xb7'),this[_0x34bc('0x11')][_0x190689[_0x34bc('0x6e')]]));if(_0x4b209b[_0x34bc('0xb8')]){ami[_0x34bc('0x22')](_0x34bc('0xb9'),ut['buildAcw'](_0x190689));}break;case'16':ami[_0x34bc('0x22')](_0x34bc('0xba'),ut['buildObj'](_0x190689,_0x34bc('0xbb'),this[_0x34bc('0x11')][_0x190689[_0x34bc('0x6e')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x190689,'complete'));_0x4b209b[_0x34bc('0x35')]+=0x1;_0x4b209b['total']+=0x1;_0x4b209b['answered']+=0x1;ut['decrementTalkink'](_0x4b209b,_0x34bc('0xbc'));_0x190689[_0x34bc('0xa1')]=ut[_0x34bc('0xa2')](_0x190689);ut['logCustomer'](_0x190689,0x4,_0x34bc('0xbd'));rpcDb[_0x34bc('0x94')](_0x190689,_0x34bc('0xbe'));rpcDb[_0x34bc('0x97')](_0x190689,_0x34bc('0xbf'));rpcDb[_0x34bc('0xc0')](_0x190689);_0x4b209b[_0x34bc('0x29')]+=_0x190689[_0x34bc('0xc1')];_0x4b209b[_0x34bc('0x28')]+=_0x190689[_0x34bc('0xc1')];logger[_0x34bc('0x57')](_0x34bc('0xc2'),_0x190689['uniqueid'],'\x20Queue',_0x4b209b[_0x34bc('0x24')],_0x34bc('0x70'),_0x4b209b[_0x34bc('0x27')]);delete this[_0x34bc('0x14')][_0x570876[_0x34bc('0xb1')]];break;case _0x34bc('0xc3'):_0x4b209b[_0x34bc('0x36')]+=0x1;_0x190689[_0x34bc('0xc4')]+=0x1;_0x190689[_0x34bc('0xa1')]=ut[_0x34bc('0xa2')](_0x190689);ut['logCustomer'](_0x190689,0x5,_0x34bc('0xc5'));ami[_0x34bc('0x22')](_0x34bc('0xc6'),ut[_0x34bc('0xc7')](_0x190689,_0x34bc('0xc8')));rpcDb[_0x34bc('0x94')](_0x190689,_0x34bc('0xc9'));if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b[_0x34bc('0xa6')]){_0x1c2c10=ut['cloneAction'](_0x190689,0xf,_0x34bc('0xa8'));rpcDb['createCustomerFinal'](_0x1c2c10,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x190689[_0x34bc('0xc4')]>=_0x4b209b['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x190689,_0x34bc('0xc9'));}else{rpcDb[_0x34bc('0xab')](ut['scheduledAt'](_0x190689,_0x34bc('0xc4'),_0x4b209b[_0x34bc('0xca')]),_0x190689[_0x34bc('0xaf')],_0x190689[_0x34bc('0xb0')]);}}break;case'NOANSWER':_0x4b209b[_0x34bc('0x3b')]+=0x1;_0x190689[_0x34bc('0xcb')]+=0x1;_0x190689['countglobal']=ut['totalGlobal'](_0x190689);ut['logCustomer'](_0x190689,0x3,_0x34bc('0xcc'));ami[_0x34bc('0x22')](_0x34bc('0xcd'),ut[_0x34bc('0xc7')](_0x190689,_0x34bc('0xce')));rpcDb[_0x34bc('0x94')](_0x190689,_0x34bc('0xcf'));if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b[_0x34bc('0xa6')]){_0x1c2c10=ut['cloneAction'](_0x190689,0xf,_0x34bc('0xa8'));rpcDb[_0x34bc('0x97')](_0x1c2c10,_0x34bc('0xd0'));}else{if(_0x190689[_0x34bc('0xcb')]>=_0x4b209b[_0x34bc('0xd1')]){rpcDb[_0x34bc('0x97')](_0x190689,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x34bc('0xab')](ut[_0x34bc('0xac')](_0x190689,_0x34bc('0xcb'),_0x4b209b[_0x34bc('0xd2')]),_0x190689[_0x34bc('0xaf')],_0x190689[_0x34bc('0xb0')]);}}break;case _0x34bc('0xd3'):_0x4b209b[_0x34bc('0x37')]+=0x1;_0x190689['countcongestionretry']+=0x1;_0x190689[_0x34bc('0xa1')]=ut[_0x34bc('0xa2')](_0x190689);ut[_0x34bc('0x90')](_0x190689,0x8,'Congestion');ami['emit'](_0x34bc('0xd4'),ut[_0x34bc('0xc7')](_0x190689,_0x34bc('0xd5')));rpcDb[_0x34bc('0x94')](_0x190689,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b[_0x34bc('0xa6')]){_0x1c2c10=ut[_0x34bc('0xa7')](_0x190689,0xf,_0x34bc('0xa8'));rpcDb['createCustomerFinal'](_0x1c2c10,_0x34bc('0xd6'));}else{if(_0x190689[_0x34bc('0xd7')]>=_0x4b209b[_0x34bc('0xd8')]){rpcDb[_0x34bc('0x97')](_0x190689,_0x34bc('0xd9'));}else{rpcDb[_0x34bc('0xab')](ut['scheduledAt'](_0x190689,_0x34bc('0xd7'),_0x4b209b[_0x34bc('0xca')]),_0x190689[_0x34bc('0xaf')],_0x190689[_0x34bc('0xb0')]);}}break;case'CANCEL':_0x4b209b[_0x34bc('0x3e')]+=0x1;_0x190689[_0x34bc('0xda')]+=0x1;_0x190689[_0x34bc('0xa1')]=ut['totalGlobal'](_0x190689);ut[_0x34bc('0x90')](_0x190689,0x14,_0x34bc('0xdb'));ami[_0x34bc('0x22')](_0x34bc('0xdc'),ut['buildObj'](_0x190689,_0x34bc('0xdd')));rpcDb['createCustomerHistory'](_0x190689,'[syncHangupRequest][logAgentReject]');if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b['dialGlobalMaxRetry']){_0x1c2c10=ut[_0x34bc('0xa7')](_0x190689,0x14,_0x34bc('0xdb'));rpcDb[_0x34bc('0x97')](_0x1c2c10,_0x34bc('0xde'));}else{if(_0x190689['countagentrejectretry']>=_0x4b209b[_0x34bc('0xdf')]){rpcDb['createCustomerFinal'](_0x190689,_0x34bc('0xde'));}else{rpcDb[_0x34bc('0xab')](ut['scheduledAt'](_0x190689,_0x34bc('0xda'),_0x4b209b[_0x34bc('0xe0')]),_0x190689[_0x34bc('0xaf')],_0x190689['activeContact']);}}break;case'ABANDONED':_0x4b209b['outboundAbandonedCallsDay']+=0x1;_0x190689['countabandonedretry']+=0x1;_0x190689['countglobal']=ut[_0x34bc('0xa2')](_0x190689);ut[_0x34bc('0x90')](_0x190689,0xb,_0x34bc('0xe1'));rpcDb[_0x34bc('0x94')](_0x190689,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b[_0x34bc('0xa6')]){_0x1c2c10=ut[_0x34bc('0xa7')](_0x190689,0xf,_0x34bc('0xa8'));rpcDb[_0x34bc('0x97')](_0x1c2c10,_0x34bc('0xe2'));}else{if(_0x190689[_0x34bc('0xe3')]>=_0x4b209b[_0x34bc('0xe4')]){rpcDb[_0x34bc('0x97')](_0x190689,_0x34bc('0xe2'));}else{rpcDb[_0x34bc('0xab')](ut[_0x34bc('0xac')](_0x190689,_0x34bc('0xe5'),_0x4b209b[_0x34bc('0xe6')]),_0x190689[_0x34bc('0xaf')],_0x190689[_0x34bc('0xb0')]);}}break;case'18':_0x4b209b[_0x34bc('0x3f')]+=0x1;_0x190689[_0x34bc('0xe7')]+=0x1;_0x190689['countglobal']=ut['totalGlobal'](_0x190689);ut['logCustomer'](_0x190689,0x12,_0x570876[_0x34bc('0xe8')]||_0x570876[_0x34bc('0xe9')]);ami[_0x34bc('0x22')](_0x34bc('0xea'),ut['buildObj'](_0x190689,_0x34bc('0xeb')));rpcDb[_0x34bc('0x94')](_0x190689,_0x34bc('0xec'));if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b['dialGlobalMaxRetry']){_0x1c2c10=ut[_0x34bc('0xa7')](_0x190689,0xf,'Global');rpcDb[_0x34bc('0x97')](_0x1c2c10,_0x34bc('0xec'));}else{rpcDb['createCustomerFinal'](_0x190689,_0x34bc('0xec'));}delete this['actions'][_0x570876[_0x34bc('0xb1')]];break;case'19':_0x4b209b[_0x34bc('0x3f')]+=0x1;_0x190689[_0x34bc('0xa1')]=ut[_0x34bc('0xa2')](_0x190689);ut['logCustomer'](_0x190689,0x13,_0x570876[_0x34bc('0xe8')]||_0x570876[_0x34bc('0xe9')]);ami[_0x34bc('0x22')]('custom:amd',ut[_0x34bc('0xc7')](_0x190689,_0x34bc('0xeb')));rpcDb[_0x34bc('0x94')](_0x190689,_0x34bc('0xed'));if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b[_0x34bc('0xa6')]){_0x1c2c10=ut[_0x34bc('0xa7')](_0x190689,0xf,_0x34bc('0xa8'));rpcDb[_0x34bc('0x97')](_0x1c2c10,_0x34bc('0xed'));}else{rpcDb['createCustomerFinal'](_0x190689,_0x34bc('0xed'));}delete this[_0x34bc('0x14')][_0x570876[_0x34bc('0xb1')]];break;default:if(_0x190689[_0x34bc('0x7b')]){ut[_0x34bc('0x7c')](_0x4b209b,_0x34bc('0xee'));ut[_0x34bc('0x7d')](_0x34bc('0xef')+_0x4b209b[_0x34bc('0x24')],_0x570876);}_0x4b209b[_0x34bc('0x3f')]+=0x1;_0x190689['countglobal']=ut[_0x34bc('0xa2')](_0x190689);ut[_0x34bc('0x90')](_0x190689,0xc,_0x570876[_0x34bc('0xe8')]||_0x570876[_0x34bc('0xe9')]);rpcDb[_0x34bc('0x94')](_0x190689,_0x34bc('0xf0'));if(ut[_0x34bc('0xa2')](_0x190689)>=_0x4b209b[_0x34bc('0xa6')]){_0x1c2c10=ut[_0x34bc('0xa7')](_0x190689,0xf,_0x34bc('0xa8'));rpcDb[_0x34bc('0x97')](_0x1c2c10,_0x34bc('0xf1'));}else{rpcDb[_0x34bc('0x97')](_0x190689,_0x34bc('0xf1'));}delete this['actions'][_0x570876[_0x34bc('0xb1')]];}if(!(_0x190689[_0x34bc('0x7b')]&&_0x278133==='16')){ut[_0x34bc('0x79')](_0x4b209b,'[callProgressDetectingCustomer]');logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x190689[_0x34bc('0xb5')],'\x20Queue',_0x4b209b[_0x34bc('0x24')],_0x34bc('0x6f'),_0x4b209b['originated']);}if(_0x278133!=='ANSWER'){delete this[_0x34bc('0x14')][_0x570876[_0x34bc('0xb1')]];delete this['actions'][_0x570876[_0x34bc('0xf2')]];}}};Preview['prototype'][_0x34bc('0xf3')]=function(_0xdd6643,_0x3dbf98,_0x1a81ad){if(_['isUndefined'](_0x3dbf98)&&_0x34bc('0xf4')!==typeof _0x3dbf98){return;}if(_[_0x34bc('0xf5')](_0x1a81ad)&&_0x34bc('0xf4')!==typeof _0x1a81ad){return;}switch(_0x1a81ad[_0x34bc('0xf6')]){case'0':ut[_0x34bc('0xf7')](_0xdd6643,0x0,_0x34bc('0xa3'));rpcDb[_0x34bc('0xf8')](_0xdd6643,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0xdd6643,0x3,_0x34bc('0xcc'));rpcDb[_0x34bc('0xf8')](_0xdd6643,_0x34bc('0xf9'));break;case'5':ut['logAgent'](_0xdd6643,0x5,_0x34bc('0xc5'));rpcDb[_0x34bc('0xf8')](_0xdd6643,_0x34bc('0xfa'));break;case'8':ut[_0x34bc('0xf7')](_0xdd6643,0x8,'Congestion');rpcDb[_0x34bc('0xf8')](_0xdd6643,_0x34bc('0xfb'));break;case'22':ut[_0x34bc('0xf7')](_0xdd6643,0x16,_0x34bc('0xfc'));rpcDb[_0x34bc('0xf8')](_0xdd6643,_0x34bc('0xfd'));break;default:ut[_0x34bc('0xf7')](_0xdd6643,0xc,_0x1a81ad[_0x34bc('0xf6')]);rpcDb[_0x34bc('0xf8')](_0xdd6643,_0x34bc('0xfb'));}ut[_0x34bc('0x79')](_0x3dbf98,_0x34bc('0xfe'));logger[_0x34bc('0x57')](_0x34bc('0xff'),_0xdd6643['uniqueid'],_0x34bc('0x100'),_0x3dbf98[_0x34bc('0x24')],'originated:\x20',_0x3dbf98[_0x34bc('0x4a')]);delete this[_0x34bc('0x14')][_0xdd6643[_0x34bc('0xb5')]];};Preview[_0x34bc('0xf')][_0x34bc('0x101')]=function(_0x2133c8,_0x5b7c41,_0x283a47,_0x5a65e3,_0x1ebfaf){var _0x4fd988=this;return new BPromise(function(_0x2495df,_0x3f3944){if(_['isNil'](_0x5b7c41)||_[_0x34bc('0x6c')](_0x5b7c41[_0x34bc('0x102')])||_[_0x34bc('0x6c')](_0x5b7c41['Contact'][_0x34bc('0x103')])||_[_0x34bc('0x6c')](_0x5b7c41[_0x34bc('0x73')])){_0x3f3944(ut[_0x34bc('0x49')](_0x34bc('0x104'),_0x5a65e3,_0x1ebfaf));return;}var _0x386a24=uuid['v4']();var _0x4ee5d5=_0x4fd988[_0x34bc('0x11')][_0x5b7c41[_0x34bc('0x105')]['name']];var _0x53604d=_0x283a47?_0x4fd988[_0x34bc('0x15')][_0x283a47]['id']:undefined;_0x4fd988['actions'][_0x386a24]=new Action(_0x5b7c41,_0x4ee5d5,_0x386a24,_0x283a47,_0x53604d);var _0x23ae6=_0x4fd988[_0x34bc('0x14')][_0x386a24];_0x23ae6[_0x34bc('0xaf')]=_0x5a65e3;_0x23ae6['activeContact']=_0x1ebfaf;_0x23ae6[_0x34bc('0x106')]=_0x283a47;if(_['isEmpty'](_0x2133c8)){_0x4fd988['execCall'](_0x23ae6,_0x4ee5d5,_0x5b7c41,_0x283a47)['then'](function(_0x3f1e4c){logger['info'](_0x34bc('0x107'),'Queue:\x20'+_0x23ae6['queue']+_0x34bc('0x108')+_0x23ae6['idContact'],JSON['stringify'](_0x3f1e4c));ami[_0x34bc('0x22')]('custom:agentcalled',ut[_0x34bc('0xc7')](_0x23ae6,_0x34bc('0x109'),_0x4fd988[_0x34bc('0x11')][_0x23ae6[_0x34bc('0x6e')]]));_0x2495df(ut['message'](_0x34bc('0x10a')));})[_0x34bc('0x78')](function(_0x22ac51){ut[_0x34bc('0x5d')]('[Preview][execCall][failure]',_0x22ac51);_0x3f3944(ut[_0x34bc('0x49')](_0x34bc('0x10b'),_0x5a65e3,_0x1ebfaf));});}else{_0x4ee5d5[_0x34bc('0x10c')]+=0x1;ut[_0x34bc('0x10d')](_0x23ae6);rpcDb[_0x34bc('0x10e')](_0x23ae6,_0x34bc('0x10f'));delete _0x4fd988[_0x34bc('0x14')][_0x386a24];_0x3f3944(ut[_0x34bc('0x49')](_0x34bc('0x110'),_0x5a65e3,_0x1ebfaf));}});};Preview[_0x34bc('0xf')][_0x34bc('0x9c')]=function(_0x596197){return!_['isNil'](_0x596197)&&!_['isNil'](_0x596197[_0x34bc('0x24')])&&!_[_0x34bc('0x6c')](_0x596197['active'])&&_0x596197[_0x34bc('0x111')]&&!_[_0x34bc('0x6c')](this['trunks'][util['format'](_0x34bc('0x112'),_0x596197[_0x34bc('0x24')])])&&!_['isNil'](this['trunks'][util[_0x34bc('0x55')](_0x34bc('0x112'),_0x596197[_0x34bc('0x24')])]['status'])&&(this['trunks'][util['format'](_0x34bc('0x112'),_0x596197['name'])][_0x34bc('0x76')]==='reachable'||this['trunks'][util[_0x34bc('0x55')](_0x34bc('0x112'),_0x596197[_0x34bc('0x24')])][_0x34bc('0x76')]===_0x34bc('0x113'));};Preview[_0x34bc('0xf')][_0x34bc('0x8a')]=function(_0x2f574c,_0x26cc21){var _0x248b3e=this;return new BPromise(function(_0x37451f,_0x47d405){_0x248b3e[_0x34bc('0x114')](_0x2f574c,_0x26cc21)[_0x34bc('0x84')](function(_0x21c64b){_0x37451f(_[_0x34bc('0x71')](_0x21c64b,[_0x34bc('0x49')]));})['catch'](function(_0x38216){if(_0x38216['unlock']){rpcDb[_0x34bc('0x115')](_0x2f574c);}if(_0x38216['active']){rpcDb['disableContact'](_0x2f574c);}_0x47d405(_[_0x34bc('0x71')](_0x38216,[_0x34bc('0x49')]));});});};Preview[_0x34bc('0xf')][_0x34bc('0x114')]=function(_0x2953c2,_0x51a660){var _0x4a85fc=this;return new BPromise(function(_0x1e41fa,_0x2f3901){var _0x9900f0,_0x3ad883;rpcDb[_0x34bc('0x116')](_0x2953c2)[_0x34bc('0x84')](function(_0x17ae0e){if(!_['isNil'](_0x17ae0e[0x0])){_0x3ad883=_0x17ae0e[0x0]['recallme']?![]:!![];_0x9900f0=_0x17ae0e[0x0][_0x34bc('0x117')]?!![]:![];_0x9900f0=_0x51a660?!![]:_0x9900f0;}var _0x2deba5=_0x4a85fc['validateContact'](_0x17ae0e);if(_0x2deba5[_0x34bc('0x118')]){rpcDb[_0x34bc('0x119')](_[_0x34bc('0x71')](_0x17ae0e[0x0],[_0x34bc('0x73'),'Contact.phone']))[_0x34bc('0x84')](function(_0xc20c96){_0x4a85fc[_0x34bc('0x101')](_0xc20c96,_0x17ae0e[0x0],_0x51a660,_0x3ad883,_0x9900f0)[_0x34bc('0x84')](function(_0x1b229e){_0x1e41fa(_0x1b229e);})[_0x34bc('0x78')](function(_0x5e4aea){_0x2f3901(_0x5e4aea);});})[_0x34bc('0x78')](function(_0x335f94){ut[_0x34bc('0x5d')]('[Preview][checkIsBlackList]',_0x335f94);_0x2f3901(ut[_0x34bc('0x49')](_0x34bc('0x11a'),_0x3ad883,_0x9900f0));});}else{_0x2f3901(ut[_0x34bc('0x49')](_0x2deba5[_0x34bc('0x49')],_0x3ad883,_0x9900f0));}})[_0x34bc('0x78')](function(_0x1db257){ut[_0x34bc('0x5d')](_0x34bc('0x11b'),_0x1db257);_0x2f3901(ut['message'](_0x34bc('0x11a'),![],!![]));});});};Preview[_0x34bc('0xf')][_0x34bc('0x11c')]=function(_0x5e0e3f){if(_[_0x34bc('0x6c')](_0x5e0e3f)||_['isEmpty'](_0x5e0e3f)||!_['isNil'](_0x5e0e3f[0x0]['Agent'])&&_[_0x34bc('0x6c')](_0x5e0e3f[0x0]['Agent']['name'])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x5e0e3f);return{'isValid':![],'message':_0x34bc('0x11d')};}var _0x4d3930=this[_0x34bc('0x11')][_0x5e0e3f[0x0][_0x34bc('0x105')][_0x34bc('0x24')]];_0x4d3930[_0x34bc('0x49')]=_0x34bc('0x9e');if(_[_0x34bc('0x6c')](_0x4d3930)){ut[_0x34bc('0x5d')]('[Preview][validateContact][Empty\x20Campaign]',_0x4d3930);return{'isValid':![],'message':_0x34bc('0x11e')};}if(!this[_0x34bc('0x9c')](_0x4d3930[_0x34bc('0x50')])){ut[_0x34bc('0x5d')](_0x34bc('0x11f'),_0x34bc('0x120')+_0x4d3930[_0x34bc('0x24')]+_0x34bc('0x121'));if(!this[_0x34bc('0x9c')](_0x4d3930['TrunkBackup'])){ut[_0x34bc('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x4d3930['name']+_0x34bc('0x122'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x34bc('0x9b')](_0x4d3930[_0x34bc('0x31')])){ut['logger'](_0x34bc('0x123'),_0x4d3930['name']+_0x34bc('0x124'));return{'isValid':![],'message':_0x34bc('0x120')+_0x4d3930['name']+_0x34bc('0x124')};}return{'isValid':!![],'message':_0x34bc('0x125')};};Preview[_0x34bc('0xf')][_0x34bc('0x126')]=function(_0x97c6a8,_0x3c1ea2,_0x2244c6,_0x23542f){var _0x361d7e=this;return new BPromise(function(_0x1a1cec,_0x3bb4d9){var _0x23e590=_0x97c6a8[_0x34bc('0xb5')];var _0x493eb5=_0x361d7e[_0x34bc('0x9c')](_0x3c1ea2[_0x34bc('0x50')])?util[_0x34bc('0x55')](_0x34bc('0x127'),_0x3c1ea2[_0x34bc('0x50')][_0x34bc('0x24')],_[_0x34bc('0x6c')](_0x3c1ea2['dialPrefix'])?'':_0x3c1ea2[_0x34bc('0x33')][_0x34bc('0x128')]()||'',_0x3c1ea2[_0x34bc('0x129')]>0x0?_0x2244c6[_0x34bc('0x102')][_0x34bc('0x103')][_0x34bc('0x12a')](_0x3c1ea2['dialCutDigit']):_0x2244c6['Contact'][_0x34bc('0x103')]):util[_0x34bc('0x55')]('SIP/%s/%s%s',_[_0x34bc('0x6c')](_0x3c1ea2['TrunkBackup'])?_0x3c1ea2[_0x34bc('0x50')]['name']:_0x3c1ea2['TrunkBackup']['name'],_[_0x34bc('0x6c')](_0x3c1ea2[_0x34bc('0x33')])?'':_0x3c1ea2[_0x34bc('0x33')][_0x34bc('0x128')]()||'',_0x3c1ea2[_0x34bc('0x129')]>0x0?_0x2244c6[_0x34bc('0x102')]['phone'][_0x34bc('0x12a')](_0x3c1ea2[_0x34bc('0x129')]):_0x2244c6[_0x34bc('0x102')][_0x34bc('0x103')]);var _0x1b5b81=_0x361d7e[_0x34bc('0x9c')](_0x3c1ea2['Trunk'])?ut[_0x34bc('0x12b')](_0x3c1ea2[_0x34bc('0x50')][_0x34bc('0x51')],_0x3c1ea2[_0x34bc('0x12c')],_0x3c1ea2[_0x34bc('0x12d')]>0x0?ut[_0x34bc('0x12e')](_0x3c1ea2[_0x34bc('0x32')],_0x3c1ea2[_0x34bc('0x12d')]):_0x3c1ea2[_0x34bc('0x32')]):ut[_0x34bc('0x12b')](_['isNil'](_0x3c1ea2['TrunkBackup'])?_0x3c1ea2[_0x34bc('0x50')][_0x34bc('0x51')]:_0x3c1ea2[_0x34bc('0x12f')]['callerid'],_0x3c1ea2[_0x34bc('0x12c')],_0x3c1ea2['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x34bc('0x12e')](_0x3c1ea2[_0x34bc('0x32')],_0x3c1ea2[_0x34bc('0x12d')]):_0x3c1ea2[_0x34bc('0x32')]);if(_0x1b5b81){_0x97c6a8['originatecalleridname']=ut[_0x34bc('0x130')](_0x1b5b81);_0x97c6a8['originatecalleridnum']=ut[_0x34bc('0x131')](_0x1b5b81);}var _0xbf34b1=ut['addVariables'](_0x3c1ea2,_0x2244c6,_0x493eb5,_0x1b5b81,_0x23e590,_0x97c6a8);_[_0x34bc('0x132')](_0x97c6a8,ut[_0x34bc('0x133')](_0xbf34b1));_0x97c6a8['starttime']=moment()['format'](_0x34bc('0x8f'));ami[_0x34bc('0x75')](ut['variablesAction'](_0x97c6a8,_0x3c1ea2,_0xbf34b1,_0x97c6a8['activeContact'],_0x23542f))[_0x34bc('0x84')](function(_0x1fdfc5){_0x3c1ea2[_0x34bc('0x4a')]+=0x1;logger['info'](_0x34bc('0x134'),_0x23e590,_0x34bc('0x100'),_0x3c1ea2['name'],_0x34bc('0x6f'),_0x3c1ea2['originated']);_0x1a1cec(_0x1fdfc5);})[_0x34bc('0x78')](function(_0x6dd0af){ut[_0x34bc('0xf7')](_0x97c6a8,0xe,_0x34bc('0x135'));rpcDb[_0x34bc('0xf8')](_0x97c6a8,_0x34bc('0x136'));_0x3bb4d9(_0x6dd0af);});});};Preview['prototype']['syncNewExten']=function(_0x71d567){if(this['actions'][_0x71d567[_0x34bc('0xb1')]]){this[_0x34bc('0x14')][_0x71d567['linkedid']][_0x34bc('0x77')]=_0x71d567[_0x34bc('0x77')];}};Preview[_0x34bc('0xf')][_0x34bc('0x137')]=function(_0x11d0bc){var _0x4b52dc=this;var _0x235700=this[_0x34bc('0x14')][_0x11d0bc[_0x34bc('0x138')]];if(_0x235700){if(_0x235700[_0x34bc('0x106')]&&this[_0x34bc('0x15')][_0x235700[_0x34bc('0x106')]]){ut[_0x34bc('0x139')](_0x235700,this['agents'][_0x235700[_0x34bc('0x106')]][_0x34bc('0x24')],this[_0x34bc('0x15')][_0x235700[_0x34bc('0x106')]]['id']);}var _0x3a14f9=_[_0x34bc('0x13a')](_0x235700);_0x3a14f9['responsetime']=moment()[_0x34bc('0x55')](_0x34bc('0x8f'));var _0x19bf93=_0x4b52dc[_0x34bc('0x11')][_0x235700[_0x34bc('0x6e')]];if(ut[_0x34bc('0x13b')](_0x11d0bc['response'])){if(_0x235700[_0x34bc('0xaf')]){rpcDb[_0x34bc('0x115')](_0x235700[_0x34bc('0x13c')]);}if(_0x235700[_0x34bc('0xb0')]){rpcDb[_0x34bc('0x8d')](_0x235700[_0x34bc('0x13c')]);}ami[_0x34bc('0x22')]('custom:agentringnoanswer',ut['buildObj'](_0x235700,_0x34bc('0x13d'),this[_0x34bc('0x11')][_0x235700[_0x34bc('0x6e')]]));this[_0x34bc('0xf3')](_0x3a14f9,_0x19bf93,_0x11d0bc);}else{_0x235700[_0x34bc('0x8e')]=moment()[_0x34bc('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x34bc('0xf7')](_0x3a14f9,0x4,_0x34bc('0xbd'));rpcDb['createAgentHistory'](_0x3a14f9,_0x34bc('0x13e'));}}};Preview[_0x34bc('0xf')]['syncHangup']=function(_0x4bd0e3){var _0x3bc686=this;var _0x2e7052=this[_0x34bc('0x14')][_0x4bd0e3[_0x34bc('0xb1')]];var _0x329589;if(_0x2e7052){_0x329589=this[_0x34bc('0x11')][_0x2e7052[_0x34bc('0x6e')]];logger[_0x34bc('0x57')](_0x34bc('0x13f'),_0x4bd0e3[_0x34bc('0xb1')],_0x34bc('0x100'),_0x329589['name'],_0x34bc('0x70'),_0x329589[_0x34bc('0x27')]);}if(this[_0x34bc('0x14')][_0x4bd0e3[_0x34bc('0xb1')]]&&_0x4bd0e3[_0x34bc('0xb1')]!==_0x4bd0e3[_0x34bc('0xb5')]){if(_0x4bd0e3['cause']==='16'&&this[_0x34bc('0x14')][_0x4bd0e3['linkedid']][_0x34bc('0x7b')]){this['callProgressDetectingCustomer'](_0x4bd0e3,_0x4bd0e3['linkedid'],_0x4bd0e3[_0x34bc('0x140')]);}else if(this[_0x34bc('0x14')][_0x4bd0e3[_0x34bc('0xb1')]]['dialAnswer']){logger[_0x34bc('0x57')]('[syncHangup][talking][cause]',_0x4bd0e3[_0x34bc('0xb1')],_0x4bd0e3['cause'],_0x34bc('0x100'),_0x329589[_0x34bc('0x24')],_0x34bc('0x70'),_0x329589['pTalking']);this['callProgressDetectingCustomer'](_0x4bd0e3,_0x4bd0e3[_0x34bc('0xb1')],_0x4bd0e3['cause']);}}else if(_0x2e7052&&_['isNil'](_0x2e7052[_0x34bc('0x141')])&&_0x329589[_0x34bc('0x142')]&&_0x4bd0e3[_0x34bc('0xb1')]===_0x4bd0e3[_0x34bc('0xb5')]&&_[_0x34bc('0x6c')](_0x4bd0e3[_0x34bc('0xf6')])&&_0x4bd0e3[_0x34bc('0x140')]==='16'&&_0x4bd0e3['channelstate']==='6'&&_['isUndefined'](_0x2e7052[_0x34bc('0x143')])){if(_0x2e7052[_0x34bc('0xaf')]){rpcDb['unlockContact'](_0x2e7052[_0x34bc('0x13c')]);}if(_0x2e7052['activeContact']){rpcDb[_0x34bc('0x8d')](_0x2e7052[_0x34bc('0x13c')]);}_0x4bd0e3[_0x34bc('0xf6')]='22';this[_0x34bc('0xf3')](_0x2e7052,_0x329589,_0x4bd0e3);}else if(_0x2e7052&&_0x2e7052[_0x34bc('0x143')]){if(_0x4bd0e3[_0x34bc('0x140')]==='16'&&this['actions'][_0x4bd0e3['linkedid']][_0x34bc('0x7b')]){logger[_0x34bc('0x57')](_0x34bc('0x144'),_0x4bd0e3['linkedid'],_0x4bd0e3['cause'],_0x34bc('0x100'),_0x329589['name'],'pTalking:\x20',_0x329589[_0x34bc('0x27')]);this[_0x34bc('0x9f')](_0x4bd0e3,_0x4bd0e3[_0x34bc('0xb1')],_0x4bd0e3[_0x34bc('0x140')]);}else if(this[_0x34bc('0x14')][_0x4bd0e3[_0x34bc('0xb1')]][_0x34bc('0x7b')]){logger['info'](_0x34bc('0x145'),_0x4bd0e3['linkedid'],_0x4bd0e3[_0x34bc('0x140')],_0x34bc('0x100'),_0x329589['name'],_0x34bc('0x70'),_0x329589['pTalking']);this[_0x34bc('0x9f')](_0x4bd0e3,_0x4bd0e3['linkedid'],_0x4bd0e3['cause']);}}};Preview[_0x34bc('0xf')][_0x34bc('0x1d')]=function(_0x47f72a){if(this['actions'][_0x47f72a[_0x34bc('0xf2')]]&&_0x47f72a['destlinkedid']!==_0x47f72a['destuniqueid']){this[_0x34bc('0x9f')](_0x47f72a,_0x47f72a[_0x34bc('0xf2')],_0x47f72a[_0x34bc('0xe9')]);}};Preview['prototype'][_0x34bc('0x1b')]=function(_0x15d46e){if(this['actions'][_0x15d46e[_0x34bc('0xb1')]]&&_0x15d46e[_0x34bc('0xb1')]!==_0x15d46e['uniqueid']&&!this[_0x34bc('0x14')][_0x15d46e['linkedid']][_0x34bc('0x7b')]){if(_0x15d46e[_0x34bc('0x140')]==='1'){this['callProgressDetectingCustomer'](_0x15d46e,_0x15d46e['linkedid'],_0x15d46e[_0x34bc('0x140')]);}}};Preview['prototype'][_0x34bc('0x146')]=function(_0x4181e0,_0x54a6ca,_0x3d59d7){if(this[_0x34bc('0x14')][_0x4181e0]){if(_[_0x34bc('0x6c')](this['actions'][_0x4181e0][_0x34bc('0x147')])){this[_0x34bc('0x14')][_0x4181e0][_0x34bc('0x147')]={};}this[_0x34bc('0x14')][_0x4181e0][_0x34bc('0x147')][_0x54a6ca]=_0x3d59d7;}};Preview[_0x34bc('0xf')][_0x34bc('0x1f')]=function(_0x3e6ed8){try{if(!_[_0x34bc('0x6c')](_0x3e6ed8)){if(ut['filterKey'](_[_0x34bc('0x148')](_0x3e6ed8[_0x34bc('0x149')])[0x0])){this[_0x34bc('0x146')](_0x3e6ed8[_0x34bc('0xb5')],_[_0x34bc('0x148')](_0x3e6ed8[_0x34bc('0x149')])[0x0],_0x3e6ed8[_0x34bc('0x14a')]);}}}catch(_0x44fd69){logger[_0x34bc('0x14b')](_0x34bc('0x14c'),util['inspect'](_0x44fd69,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x1047bf){if(_0x1047bf){if(this[_0x34bc('0x14')][_0x1047bf[_0x34bc('0x14d')]]){this[_0x34bc('0x14')][_0x1047bf[_0x34bc('0x14d')]][_0x34bc('0x143')]=!![];}}};Preview[_0x34bc('0xf')][_0x34bc('0x21')]=function(_0x250ac2){if(_0x250ac2){if(this['actions'][_0x250ac2[_0x34bc('0x14e')]]){this[_0x34bc('0x14')][_0x250ac2[_0x34bc('0x14e')]][_0x34bc('0x143')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xc949=['recallme','validateContact','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','syncOriginateResponse','clone','isFailure','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','message','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','info','originated:\x20','pTalking:\x20','stringify','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','channel','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','queue','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','logger2','catch','[RecallMe]','disableContact','starttime','logCustomer','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','acw','buildAcw','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','isUndefined','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','reachable','SIP/%s','unmonitored','run','execRun','unlockContact'];(function(_0x489c17,_0x47a59d){var _0x1d8e28=function(_0x25d15d){while(--_0x25d15d){_0x489c17['push'](_0x489c17['shift']());}};_0x1d8e28(++_0x47a59d);}(_0xc949,0x181));var _0x9c94=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc949[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x9c94('0x0'));var _=require('lodash');var BPromise=require(_0x9c94('0x1'));var uuid=require(_0x9c94('0x2'));var moment=require(_0x9c94('0x3'));var md5=require(_0x9c94('0x4'));var Redis=require('ioredis');var config=require(_0x9c94('0x5'));var logger=require(_0x9c94('0x6'))('preview');var loggerAction=require(_0x9c94('0x6'))(_0x9c94('0x7'));var ami=require(_0x9c94('0x8'));var rpcDb=require(_0x9c94('0x9'));var Action=require('./action');var ut=require(_0x9c94('0xa'));config[_0x9c94('0xb')]=_[_0x9c94('0xc')](config[_0x9c94('0xb')],{'host':_0x9c94('0xd'),'port':0x18eb});var io=require(_0x9c94('0xe'))(new Redis(config[_0x9c94('0xb')]));var Sequence=function(){};Sequence[_0x9c94('0xf')][_0x9c94('0x10')]=function(_0x3287f8){this['tail']=this[_0x9c94('0x11')]?this[_0x9c94('0x11')][_0x9c94('0x12')](_0x3287f8):_0x3287f8();};function Preview(_0x20fc5a){this[_0x9c94('0x13')]=new Sequence();this[_0x9c94('0x14')]=_0x20fc5a[_0x9c94('0x15')];this[_0x9c94('0x16')]=_0x20fc5a[_0x9c94('0x16')];this[_0x9c94('0x17')]={};this[_0x9c94('0x18')]=_0x20fc5a[_0x9c94('0x18')];this[_0x9c94('0x19')]=0x0;ami['on'](_0x9c94('0x1a'),this['syncOriginateResponse'][_0x9c94('0x1b')](this));ami['on']('hangup',this[_0x9c94('0x1c')][_0x9c94('0x1b')](this));ami['on']('hanguprequest',this[_0x9c94('0x1d')]['bind'](this));ami['on']('dialend',this[_0x9c94('0x1e')]['bind'](this));ami['on'](_0x9c94('0x1f'),this[_0x9c94('0x20')]['bind'](this));ami['on'](_0x9c94('0x21'),this[_0x9c94('0x22')][_0x9c94('0x1b')](this));ami['on'](_0x9c94('0x23'),this[_0x9c94('0x24')][_0x9c94('0x1b')](this));ami['on'](_0x9c94('0x25'),this['syncBlindTransfer'][_0x9c94('0x1b')](this));this[_0x9c94('0x26')](this['campaignsPreview']);}function emit(_0x141801,_0x845304,_0x3caab0){io['to'](_0x141801)[_0x9c94('0x27')](_0x845304,_0x3caab0);}function emitCampaignPreview(_0x2dcb25){if(_0x2dcb25[_0x9c94('0x28')]===_0x9c94('0x29')){var _0x23cdf5={'id':_0x2dcb25['id'],'name':_0x2dcb25[_0x9c94('0x2a')],'strategy':_0x2dcb25[_0x9c94('0x2b')],'answered':_0x2dcb25[_0x9c94('0x2c')],'available':_0x2dcb25[_0x9c94('0x2d')],'loggedIn':_0x2dcb25[_0x9c94('0x2e')],'pTalking':_0x2dcb25[_0x9c94('0x2f')],'sumBillable':_0x2dcb25['sumBillable'],'sumDuration':_0x2dcb25[_0x9c94('0x30')],'sumHoldTime':_0x2dcb25[_0x9c94('0x31')]||0x0,'talking':_0x2dcb25['talking'],'total':_0x2dcb25[_0x9c94('0x32')],'type':_0x2dcb25[_0x9c94('0x28')],'unmanaged':_0x2dcb25[_0x9c94('0x33')],'abandoned':_0x2dcb25[_0x9c94('0x34')],'waiting':_0x2dcb25[_0x9c94('0x35')],'loggedInDb':_0x2dcb25['loggedInDb'],'dialActive':_0x2dcb25[_0x9c94('0x36')],'dialMethod':_0x2dcb25[_0x9c94('0x37')],'dialOriginateCallerIdName':_0x2dcb25['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2dcb25[_0x9c94('0x38')],'dialOriginateTimeout':_0x2dcb25['dialOriginateTimeout'],'dialPrefix':_0x2dcb25[_0x9c94('0x39')],'outboundAnswerAgiCallsDay':_0x2dcb25[_0x9c94('0x3a')],'outboundAnswerCallsDay':_0x2dcb25[_0x9c94('0x3b')],'outboundBlacklistCallsDay':_0x2dcb25[_0x9c94('0x3c')],'outboundBusyCallsDay':_0x2dcb25[_0x9c94('0x3d')],'outboundCongestionCallsDay':_0x2dcb25[_0x9c94('0x3e')],'outboundDropCallsDayACS':_0x2dcb25[_0x9c94('0x3f')],'outboundDropCallsDayCallersExit':_0x2dcb25['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2dcb25['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2dcb25[_0x9c94('0x40')],'outboundNoSuchCallsDay':_0x2dcb25[_0x9c94('0x41')],'outboundOriginateFailureCallsDay':_0x2dcb25[_0x9c94('0x42')],'outboundReCallsDay':_0x2dcb25['outboundReCallsDay'],'outboundRejectCallsDay':_0x2dcb25[_0x9c94('0x43')],'outboundUnknownCallsDay':_0x2dcb25['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x2dcb25[_0x9c94('0x44')],'predictiveIntervalAnsweredCalls':_0x2dcb25[_0x9c94('0x45')],'predictiveIntervalAvgHoldtime':_0x2dcb25[_0x9c94('0x46')],'predictiveIntervalAvgTalktime':_0x2dcb25['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x2dcb25['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2dcb25[_0x9c94('0x47')],'predictiveIntervalErlangCalls':_0x2dcb25[_0x9c94('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x2dcb25[_0x9c94('0x49')],'predictiveIntervalHitRate':_0x2dcb25['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2dcb25['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2dcb25['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2dcb25['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2dcb25[_0x9c94('0x4a')],'message':_0x2dcb25['message'],'originated':_0x2dcb25[_0x9c94('0x4b')],'erlangCalls':_0x2dcb25[_0x9c94('0x4c')],'erlangCallToSecond':_0x2dcb25['erlangCallToSecond'],'erlangAbandonmentRate':_0x2dcb25['erlangAbandonmentRate'],'erlangBusyFactor':_0x2dcb25[_0x9c94('0x4d')],'startPredictive':_0x2dcb25[_0x9c94('0x4e')],'startProgressive':_0x2dcb25[_0x9c94('0x4f')]};if(_0x2dcb25[_0x9c94('0x50')]){_0x23cdf5[_0x9c94('0x50')]={'id':_0x2dcb25[_0x9c94('0x50')]['id'],'name':_0x2dcb25[_0x9c94('0x50')][_0x9c94('0x2a')],'active':_0x2dcb25[_0x9c94('0x50')][_0x9c94('0x51')],'callerid':_0x2dcb25[_0x9c94('0x50')][_0x9c94('0x52')]};}if(_0x2dcb25[_0x9c94('0x53')]){_0x23cdf5[_0x9c94('0x53')]={'id':_0x2dcb25[_0x9c94('0x53')]['id'],'name':_0x2dcb25[_0x9c94('0x53')][_0x9c94('0x2a')]};}var _0x177850=md5(JSON['stringify'](_0x23cdf5));if(_0x2dcb25[_0x9c94('0x4')]!==_0x177850){_0x2dcb25[_0x9c94('0x4')]=_0x177850;emit(util[_0x9c94('0x54')](_0x9c94('0x55'),_0x23cdf5[_0x9c94('0x2a')]),_0x9c94('0x56'),_0x23cdf5);}}}function emitVoiceQueueChannelRemove(_0x13f94c){logger['info'](_0x9c94('0x57'),JSON['stringify'](_0x13f94c));emit(util[_0x9c94('0x54')](_0x9c94('0x55'),_0x13f94c[_0x9c94('0x2a')]),_0x9c94('0x58'),_0x13f94c);io['emit'](_0x9c94('0x59'),_0x13f94c);}function notSendMessagesQueue(_0x49ca05){if(_0x49ca05[_0x9c94('0x5a')]){if(_0x49ca05[_0x9c94('0x4b')]===0x0&&_0x49ca05[_0x9c94('0x2f')]===0x0){_0x49ca05['sendMessageOneNotActive']=![];_0x49ca05[_0x9c94('0x2d')]=0x0;_0x49ca05['paused']=0x0;_0x49ca05[_0x9c94('0x5b')]='NOT_ACTIVE';ut['logger'](_0x9c94('0x5c'),_0x49ca05[_0x9c94('0x2a')]+_0x9c94('0x5d'));}else{_0x49ca05[_0x9c94('0x5b')]='IS_DISACTIVED';ut[_0x9c94('0x5e')](_0x9c94('0x5c'),_0x49ca05[_0x9c94('0x2a')]+_0x9c94('0x5f'));}emitCampaignPreview(_0x49ca05);}}Preview['prototype'][_0x9c94('0x26')]=function(){var _0x365e7e=this;setInterval(function(){_0x365e7e['syncCampaigns']();},0x7cf);};Preview[_0x9c94('0xf')][_0x9c94('0x60')]=function(){var _0x2a5bd5=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x2731c7 in _0x2a5bd5){if(_0x2a5bd5[_0x9c94('0x61')](_0x2731c7)&&(_0x2a5bd5[_0x2731c7][_0x9c94('0x37')]===_0x9c94('0x62')||_0x2a5bd5[_0x2731c7][_0x9c94('0x37')]===_0x9c94('0x63'))&&_0x2a5bd5[_0x2731c7][_0x9c94('0x28')]===_0x9c94('0x29')){if(this[_0x9c94('0x19')]>0x7){this[_0x9c94('0x19')]=0x0;this[_0x9c94('0x64')]();}}if(_0x2a5bd5['hasOwnProperty'](_0x2731c7)&&_0x2a5bd5[_0x2731c7][_0x9c94('0x37')]==='preview'&&_0x2a5bd5[_0x2731c7][_0x9c94('0x28')]===_0x9c94('0x29')){if(_0x2a5bd5[_0x2731c7][_0x9c94('0x36')]){this[_0x9c94('0x65')](_0x2a5bd5[_0x2731c7]);if(_0x2a5bd5[_0x2731c7][_0x9c94('0x66')])this[_0x9c94('0x67')](_0x2a5bd5[_0x2731c7]);}else{notSendMessagesQueue(_0x2a5bd5[_0x2731c7]);}}}};Preview[_0x9c94('0xf')]['clearZombieChannel']=function(_0x5665d2){var _0x268506=this;this[_0x9c94('0x13')][_0x9c94('0x10')](function(){if(!_['isNil'](_0x268506[_0x9c94('0x17')][_0x5665d2])){loggerAction[_0x9c94('0x68')]('[clearZombieChannels][talking]',_0x5665d2,'Queue',_0x268506['actions'][_0x5665d2]['queue'],_0x9c94('0x69'),JSON['stringify'](_0x268506['campaignsPreview'][_0x268506[_0x9c94('0x17')][_0x5665d2]['queue']][_0x9c94('0x4b')]),_0x9c94('0x6a'),JSON[_0x9c94('0x6b')](_0x268506[_0x9c94('0x14')][_0x268506[_0x9c94('0x17')][_0x5665d2]['queue']][_0x9c94('0x2f')]),JSON[_0x9c94('0x6b')](_0x268506[_0x9c94('0x17')][_0x5665d2][_0x9c94('0x6c')]),JSON[_0x9c94('0x6b')](_[_0x9c94('0x6d')](_0x268506['actions'][_0x5665d2],[_0x9c94('0x6e'),'UserId',_0x9c94('0x6f'),_0x9c94('0x70')])));return ami[_0x9c94('0x71')]({'action':'status','channel':_0x268506[_0x9c94('0x17')][_0x5665d2][_0x9c94('0x72')]})['catch'](function(_0x3a4bc6){if(_0x3a4bc6['message']===_0x9c94('0x73')){setTimeout(function(){if(_0x268506[_0x9c94('0x17')][_0x5665d2]){ut['updateOriginated'](_0x268506['campaignsPreview'][_0x268506[_0x9c94('0x17')][_0x5665d2]['queue']],_0x9c94('0x74'));if(_0x268506[_0x9c94('0x17')][_0x5665d2][_0x9c94('0x6c')]===!![]){ut[_0x9c94('0x75')](_0x268506['campaignsPreview'][_0x268506[_0x9c94('0x17')][_0x5665d2][_0x9c94('0x76')]],'[clearZombieChannel]');ut['loggerError'](_0x9c94('0x77')+_0x5665d2,_0x268506[_0x9c94('0x17')][_0x5665d2][_0x9c94('0x76')]);}ut[_0x9c94('0x78')](_0x9c94('0x79')+_0x5665d2,_0x268506[_0x9c94('0x17')][_0x5665d2]['queue']);delete _0x268506[_0x9c94('0x17')][_0x5665d2];}},0x2328);}});}});};Preview[_0x9c94('0xf')][_0x9c94('0x64')]=function(){var _0x3424b1=this;loggerAction[_0x9c94('0x68')](_0x9c94('0x7a'),_['size'](this[_0x9c94('0x17')]));for(var _0x4bf026 in this[_0x9c94('0x17')]){if(_0x3424b1[_0x9c94('0x17')][_0x9c94('0x61')](_0x4bf026)){_0x3424b1['clearZombieChannel'](_0x4bf026);}}};Preview[_0x9c94('0xf')]['recallMe']=function(_0x4cfd03){var _0x7bc91d=this;rpcDb[_0x9c94('0x7b')](_0x4cfd03['id'],ut['agentReadyId'](this[_0x9c94('0x18')]))[_0x9c94('0x7c')](function(_0x1f0beb){if(!_[_0x9c94('0x7d')](_0x1f0beb)){for(var _0x1173f3=0x0;_0x1173f3<_0x1f0beb[_0x9c94('0x7e')];_0x1173f3+=0x1){if(ut[_0x9c94('0x7f')](_0x1f0beb[_0x1173f3][_0x9c94('0x80')])<_0x4cfd03[_0x9c94('0x81')]*0x3c){if(_0x1f0beb[_0x1173f3][_0x9c94('0x82')]&&!_0x1f0beb[_0x1173f3][_0x9c94('0x82')]['voicePause']){_0x7bc91d['run'](_0x1f0beb[_0x1173f3]['id'])[_0x9c94('0x7c')](ut[_0x9c94('0x83')]('[RecallMe]'))[_0x9c94('0x84')](ut[_0x9c94('0x83')](_0x9c94('0x85')));}else{rpcDb[_0x9c94('0x86')](_0x1f0beb[_0x1173f3]['id']);}}else{var _0x249759=new Action(_0x1f0beb[_0x1173f3],_0x4cfd03);_0x249759[_0x9c94('0x87')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4cfd03['outboundReCallsDay']+=0x1;ut[_0x9c94('0x88')](_0x249759,0x17,'RecallInQueue');if(_0x4cfd03['dialRecallInQueue']){rpcDb[_0x9c94('0x89')](ut[_0x9c94('0x8a')](_0x1f0beb[_0x1173f3]));rpcDb[_0x9c94('0x8b')](_0x249759,_0x9c94('0x8c'));}else{ut[_0x9c94('0x88')](_0x249759,0x16,_0x9c94('0x8d'));rpcDb['createCustomerHistory'](_0x249759,_0x9c94('0x8e'));rpcDb['createCustomerFinal'](_0x249759,_0x9c94('0x8e'));}}}}})[_0x9c94('0x84')](ut['logger2'](_0x9c94('0x8f')));};Preview[_0x9c94('0xf')]['setMessage']=function(_0x3deac6){_0x3deac6[_0x9c94('0x5a')]=!![];if(ut[_0x9c94('0x90')](_0x3deac6[_0x9c94('0x2e')])){_0x3deac6['message']=_0x9c94('0x91');}else if(!ut[_0x9c94('0x92')](_0x3deac6['dialActive'])){_0x3deac6['message']=_0x9c94('0x93');}else if(!this[_0x9c94('0x94')](_0x3deac6[_0x9c94('0x50')])){if(!this['isTrunkReachable'](_0x3deac6['TrunkBackup'])){_0x3deac6[_0x9c94('0x5b')]=_0x9c94('0x95');}else{_0x3deac6[_0x9c94('0x5b')]='ACTIVE';}}else{_0x3deac6[_0x9c94('0x5b')]=_0x9c94('0x96');}emitCampaignPreview(_0x3deac6);};Preview[_0x9c94('0xf')][_0x9c94('0x97')]=function(_0x2c82a0,_0x11fc37,_0x4ff9ea){var _0x3d4c26=this;var _0x21547d=this[_0x9c94('0x17')][_0x11fc37];var _0x3e1eb5=this[_0x9c94('0x14')][_0x21547d[_0x9c94('0x76')]];var _0x2f5533;if(_0x3e1eb5){switch(_0x4ff9ea){case'1':_0x3e1eb5[_0x9c94('0x41')]+=0x1;_0x21547d[_0x9c94('0x98')]+=0x1;_0x21547d[_0x9c94('0x99')]=ut[_0x9c94('0x9a')](_0x21547d);ut['logCustomer'](_0x21547d,0x0,'NoSuchNumber');ami[_0x9c94('0x27')]('custom:agentnosuchnumber',ut['buildObj'](_0x21547d,'nosuchnumber'));rpcDb[_0x9c94('0x8b')](_0x21547d,_0x9c94('0x9b'));if(ut['totalGlobal'](_0x21547d)>=_0x3e1eb5[_0x9c94('0x9c')]){_0x2f5533=ut[_0x9c94('0x9d')](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,_0x9c94('0xa0'));}else{if(_0x21547d['countnosuchnumberretry']>=_0x3e1eb5[_0x9c94('0xa1')]){rpcDb['createCustomerFinal'](_0x21547d,_0x9c94('0xa0'));}else{rpcDb[_0x9c94('0xa2')](ut[_0x9c94('0xa3')](_0x21547d,_0x9c94('0x98'),_0x3e1eb5[_0x9c94('0xa4')]),_0x21547d[_0x9c94('0xa5')],_0x21547d[_0x9c94('0xa6')]);}}delete this[_0x9c94('0x17')][_0x2c82a0[_0x9c94('0xa7')]];break;case _0x9c94('0xa8'):var _0x1bcdf5=moment()['format'](_0x9c94('0xa9'));_0x21547d[_0x9c94('0xaa')]=_0x1bcdf5;_0x21547d[_0x9c94('0xab')]=_0x1bcdf5;_0x21547d['dialAnswer']=!![];_0x3e1eb5[_0x9c94('0x2f')]+=0x1;logger[_0x9c94('0x68')](_0x9c94('0xac'),_0x21547d[_0x9c94('0xad')],_0x9c94('0xae'),_0x3e1eb5[_0x9c94('0x2a')],_0x9c94('0x6a'),_0x3e1eb5['pTalking']);ami[_0x9c94('0x27')](_0x9c94('0xaf'),ut[_0x9c94('0xb0')](_0x21547d,'connect',this[_0x9c94('0x14')][_0x21547d[_0x9c94('0x76')]]));if(_0x3e1eb5[_0x9c94('0xb1')]){ami[_0x9c94('0x27')]('custom:agentConnectPreview',ut[_0x9c94('0xb2')](_0x21547d));}break;case'16':ami[_0x9c94('0x27')](_0x9c94('0xb3'),ut[_0x9c94('0xb0')](_0x21547d,_0x9c94('0xb4'),this[_0x9c94('0x14')][_0x21547d['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x21547d,_0x9c94('0xb4')));_0x3e1eb5[_0x9c94('0x3b')]+=0x1;_0x3e1eb5[_0x9c94('0x32')]+=0x1;_0x3e1eb5['answered']+=0x1;ut[_0x9c94('0x75')](_0x3e1eb5,_0x9c94('0xb5'));_0x21547d[_0x9c94('0x99')]=ut['totalGlobal'](_0x21547d);ut[_0x9c94('0x88')](_0x21547d,0x4,'Answer');rpcDb['createCustomerHistory'](_0x21547d,_0x9c94('0xb6'));rpcDb[_0x9c94('0x9f')](_0x21547d,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x9c94('0xb7')](_0x21547d);_0x3e1eb5[_0x9c94('0x30')]+=_0x21547d['talktime'];_0x3e1eb5[_0x9c94('0xb8')]+=_0x21547d[_0x9c94('0xb9')];logger[_0x9c94('0x68')](_0x9c94('0xba'),_0x21547d[_0x9c94('0xad')],_0x9c94('0xae'),_0x3e1eb5[_0x9c94('0x2a')],_0x9c94('0x6a'),_0x3e1eb5[_0x9c94('0x2f')]);delete this['actions'][_0x2c82a0[_0x9c94('0xa7')]];break;case _0x9c94('0xbb'):_0x3e1eb5[_0x9c94('0x3d')]+=0x1;_0x21547d[_0x9c94('0xbc')]+=0x1;_0x21547d[_0x9c94('0x99')]=ut['totalGlobal'](_0x21547d);ut[_0x9c94('0x88')](_0x21547d,0x5,'Busy');ami[_0x9c94('0x27')](_0x9c94('0xbd'),ut['buildObj'](_0x21547d,'busy'));rpcDb[_0x9c94('0x8b')](_0x21547d,_0x9c94('0xbe'));if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5['dialGlobalMaxRetry']){_0x2f5533=ut['cloneAction'](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,_0x9c94('0xbf'));}else{if(_0x21547d[_0x9c94('0xbc')]>=_0x3e1eb5[_0x9c94('0xc0')]){rpcDb[_0x9c94('0x9f')](_0x21547d,_0x9c94('0xbe'));}else{rpcDb[_0x9c94('0xa2')](ut[_0x9c94('0xa3')](_0x21547d,'countbusyretry',_0x3e1eb5['dialBusyRetryFrequency']),_0x21547d['unlockAgent'],_0x21547d['activeContact']);}}break;case _0x9c94('0xc1'):_0x3e1eb5['outboundNoAnswerCallsDay']+=0x1;_0x21547d[_0x9c94('0xc2')]+=0x1;_0x21547d[_0x9c94('0x99')]=ut[_0x9c94('0x9a')](_0x21547d);ut['logCustomer'](_0x21547d,0x3,_0x9c94('0xc3'));ami[_0x9c94('0x27')](_0x9c94('0xc4'),ut['buildObj'](_0x21547d,_0x9c94('0xc5')));rpcDb[_0x9c94('0x8b')](_0x21547d,_0x9c94('0xc6'));if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5[_0x9c94('0x9c')]){_0x2f5533=ut['cloneAction'](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,_0x9c94('0xc7'));}else{if(_0x21547d[_0x9c94('0xc2')]>=_0x3e1eb5[_0x9c94('0xc8')]){rpcDb[_0x9c94('0x9f')](_0x21547d,_0x9c94('0xc6'));}else{rpcDb[_0x9c94('0xa2')](ut[_0x9c94('0xa3')](_0x21547d,_0x9c94('0xc2'),_0x3e1eb5['dialNoAnswerRetryFrequency']),_0x21547d['unlockAgent'],_0x21547d['activeContact']);}}break;case'CONGESTION':_0x3e1eb5['outboundCongestionCallsDay']+=0x1;_0x21547d[_0x9c94('0xc9')]+=0x1;_0x21547d[_0x9c94('0x99')]=ut[_0x9c94('0x9a')](_0x21547d);ut[_0x9c94('0x88')](_0x21547d,0x8,_0x9c94('0xca'));ami[_0x9c94('0x27')]('custom:agentcongestion',ut[_0x9c94('0xb0')](_0x21547d,_0x9c94('0xcb')));rpcDb[_0x9c94('0x8b')](_0x21547d,_0x9c94('0xcc'));if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5['dialGlobalMaxRetry']){_0x2f5533=ut[_0x9c94('0x9d')](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,_0x9c94('0xcd'));}else{if(_0x21547d[_0x9c94('0xc9')]>=_0x3e1eb5['dialCongestionMaxRetry']){rpcDb[_0x9c94('0x9f')](_0x21547d,_0x9c94('0xcc'));}else{rpcDb[_0x9c94('0xa2')](ut[_0x9c94('0xa3')](_0x21547d,_0x9c94('0xc9'),_0x3e1eb5[_0x9c94('0xce')]),_0x21547d[_0x9c94('0xa5')],_0x21547d[_0x9c94('0xa6')]);}}break;case'CANCEL':_0x3e1eb5['outboundRejectCallsDay']+=0x1;_0x21547d[_0x9c94('0xcf')]+=0x1;_0x21547d[_0x9c94('0x99')]=ut['totalGlobal'](_0x21547d);ut['logCustomer'](_0x21547d,0x14,_0x9c94('0xd0'));ami['emit']('custom:agentreject',ut['buildObj'](_0x21547d,_0x9c94('0xd1')));rpcDb['createCustomerHistory'](_0x21547d,_0x9c94('0xd2'));if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5[_0x9c94('0x9c')]){_0x2f5533=ut[_0x9c94('0x9d')](_0x21547d,0x14,_0x9c94('0xd0'));rpcDb[_0x9c94('0x9f')](_0x2f5533,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x21547d[_0x9c94('0xcf')]>=_0x3e1eb5[_0x9c94('0xd3')]){rpcDb[_0x9c94('0x9f')](_0x21547d,_0x9c94('0xd4'));}else{rpcDb[_0x9c94('0xa2')](ut[_0x9c94('0xa3')](_0x21547d,'countagentrejectretry',_0x3e1eb5['dialAgentRejectRetryFrequency']),_0x21547d[_0x9c94('0xa5')],_0x21547d[_0x9c94('0xa6')]);}}break;case _0x9c94('0xd5'):_0x3e1eb5[_0x9c94('0x44')]+=0x1;_0x21547d[_0x9c94('0xd6')]+=0x1;_0x21547d['countglobal']=ut[_0x9c94('0x9a')](_0x21547d);ut['logCustomer'](_0x21547d,0xb,'Abandoned');rpcDb[_0x9c94('0x8b')](_0x21547d,_0x9c94('0xd7'));if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5[_0x9c94('0x9c')]){_0x2f5533=ut[_0x9c94('0x9d')](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,_0x9c94('0xd7'));}else{if(_0x21547d[_0x9c94('0xd8')]>=_0x3e1eb5[_0x9c94('0xd9')]){rpcDb[_0x9c94('0x9f')](_0x21547d,_0x9c94('0xd7'));}else{rpcDb[_0x9c94('0xa2')](ut[_0x9c94('0xa3')](_0x21547d,'countabandonedretry',_0x3e1eb5['dialAbandonedRetryFrequency']),_0x21547d['unlockAgent'],_0x21547d[_0x9c94('0xa6')]);}}break;case'18':_0x3e1eb5[_0x9c94('0xda')]+=0x1;_0x21547d[_0x9c94('0xdb')]+=0x1;_0x21547d[_0x9c94('0x99')]=ut[_0x9c94('0x9a')](_0x21547d);ut['logCustomer'](_0x21547d,0x12,_0x2c82a0[_0x9c94('0xdc')]||_0x2c82a0[_0x9c94('0xdd')]);ami['emit'](_0x9c94('0xde'),ut[_0x9c94('0xb0')](_0x21547d,_0x9c94('0xdf')));rpcDb['createCustomerHistory'](_0x21547d,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5[_0x9c94('0x9c')]){_0x2f5533=ut[_0x9c94('0x9d')](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,_0x9c94('0xe0'));}else{rpcDb[_0x9c94('0x9f')](_0x21547d,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x9c94('0x17')][_0x2c82a0[_0x9c94('0xa7')]];break;case'19':_0x3e1eb5[_0x9c94('0xda')]+=0x1;_0x21547d[_0x9c94('0x99')]=ut[_0x9c94('0x9a')](_0x21547d);ut[_0x9c94('0x88')](_0x21547d,0x13,_0x2c82a0[_0x9c94('0xdc')]||_0x2c82a0['dialstatus']);ami['emit'](_0x9c94('0xde'),ut[_0x9c94('0xb0')](_0x21547d,_0x9c94('0xdf')));rpcDb[_0x9c94('0x8b')](_0x21547d,_0x9c94('0xe1'));if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5[_0x9c94('0x9c')]){_0x2f5533=ut[_0x9c94('0x9d')](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x9c94('0x9f')](_0x21547d,_0x9c94('0xe1'));}delete this[_0x9c94('0x17')][_0x2c82a0[_0x9c94('0xa7')]];break;default:if(_0x21547d['dialAnswer']){ut[_0x9c94('0x75')](_0x3e1eb5,_0x9c94('0xe2'));ut[_0x9c94('0x78')](_0x9c94('0xe3')+_0x3e1eb5[_0x9c94('0x2a')],_0x2c82a0);}_0x3e1eb5['outboundUnknownCallsDay']+=0x1;_0x21547d[_0x9c94('0x99')]=ut['totalGlobal'](_0x21547d);ut[_0x9c94('0x88')](_0x21547d,0xc,_0x2c82a0[_0x9c94('0xdc')]||_0x2c82a0[_0x9c94('0xdd')]);rpcDb[_0x9c94('0x8b')](_0x21547d,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x9c94('0x9a')](_0x21547d)>=_0x3e1eb5[_0x9c94('0x9c')]){_0x2f5533=ut['cloneAction'](_0x21547d,0xf,_0x9c94('0x9e'));rpcDb[_0x9c94('0x9f')](_0x2f5533,_0x9c94('0xe4'));}else{rpcDb['createCustomerFinal'](_0x21547d,_0x9c94('0xe4'));}delete this[_0x9c94('0x17')][_0x2c82a0['linkedid']];}if(!(_0x21547d[_0x9c94('0x6c')]&&_0x4ff9ea==='16')){ut['updateOriginated'](_0x3e1eb5,'[callProgressDetectingCustomer]');logger[_0x9c94('0x68')]('[originated][decrement][callProgressDetectingCustomer]',_0x21547d[_0x9c94('0xad')],_0x9c94('0xae'),_0x3e1eb5[_0x9c94('0x2a')],_0x9c94('0x69'),_0x3e1eb5['originated']);}if(_0x4ff9ea!==_0x9c94('0xa8')){delete this[_0x9c94('0x17')][_0x2c82a0[_0x9c94('0xa7')]];delete this[_0x9c94('0x17')][_0x2c82a0[_0x9c94('0xe5')]];}}};Preview[_0x9c94('0xf')]['callProgressDetectingAgent']=function(_0x20c857,_0x4b377b,_0x1ec787){if(_[_0x9c94('0xe6')](_0x4b377b)&&_0x9c94('0xe7')!==typeof _0x4b377b){return;}if(_['isUndefined'](_0x1ec787)&&_0x9c94('0xe7')!==typeof _0x1ec787){return;}switch(_0x1ec787[_0x9c94('0xe8')]){case'0':ut['logAgent'](_0x20c857,0x0,_0x9c94('0xe9'));rpcDb[_0x9c94('0xea')](_0x20c857,_0x9c94('0xeb'));break;case'3':ut[_0x9c94('0xec')](_0x20c857,0x3,'NoAnswer');rpcDb[_0x9c94('0xea')](_0x20c857,_0x9c94('0xed'));break;case'5':ut['logAgent'](_0x20c857,0x5,'Busy');rpcDb[_0x9c94('0xea')](_0x20c857,_0x9c94('0xee'));break;case'8':ut['logAgent'](_0x20c857,0x8,_0x9c94('0xca'));rpcDb[_0x9c94('0xea')](_0x20c857,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x9c94('0xec')](_0x20c857,0x16,_0x9c94('0xef'));rpcDb[_0x9c94('0xea')](_0x20c857,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x9c94('0xec')](_0x20c857,0xc,_0x1ec787[_0x9c94('0xe8')]);rpcDb[_0x9c94('0xea')](_0x20c857,_0x9c94('0xf0'));}ut['updateOriginated'](_0x4b377b,_0x9c94('0xf1'));logger['info'](_0x9c94('0xf2'),_0x20c857[_0x9c94('0xad')],_0x9c94('0xae'),_0x4b377b[_0x9c94('0x2a')],_0x9c94('0x69'),_0x4b377b['originated']);delete this[_0x9c94('0x17')][_0x20c857[_0x9c94('0xad')]];};Preview[_0x9c94('0xf')][_0x9c94('0xf3')]=function(_0x2a44dc,_0x3d7f28,_0x3590dd,_0x4d0ea5,_0xe0bbad){var _0x1aea46=this;return new BPromise(function(_0x5e139b,_0x6a3e5a){if(_[_0x9c94('0x7d')](_0x3d7f28)||_[_0x9c94('0x7d')](_0x3d7f28[_0x9c94('0xf4')])||_['isNil'](_0x3d7f28[_0x9c94('0xf4')][_0x9c94('0xf5')])||_[_0x9c94('0x7d')](_0x3d7f28[_0x9c94('0x6f')])){_0x6a3e5a(ut[_0x9c94('0x5b')](_0x9c94('0xf6'),_0x4d0ea5,_0xe0bbad));return;}var _0x3bf6a5=uuid['v4']();var _0x485a95=_0x1aea46[_0x9c94('0x14')][_0x3d7f28[_0x9c94('0xf7')][_0x9c94('0x2a')]];var _0x24c778=_0x3590dd?_0x1aea46['agents'][_0x3590dd]['id']:undefined;_0x1aea46[_0x9c94('0x17')][_0x3bf6a5]=new Action(_0x3d7f28,_0x485a95,_0x3bf6a5,_0x3590dd,_0x24c778);var _0x57da9e=_0x1aea46[_0x9c94('0x17')][_0x3bf6a5];_0x57da9e[_0x9c94('0xa5')]=_0x4d0ea5;_0x57da9e[_0x9c94('0xa6')]=_0xe0bbad;_0x57da9e[_0x9c94('0xf8')]=_0x3590dd;if(_[_0x9c94('0xf9')](_0x2a44dc)){_0x1aea46['execCall'](_0x57da9e,_0x485a95,_0x3d7f28,_0x3590dd)['then'](function(_0x27c711){logger[_0x9c94('0x68')](_0x9c94('0xfa'),_0x9c94('0xfb')+_0x57da9e[_0x9c94('0x76')]+_0x9c94('0xfc')+_0x57da9e[_0x9c94('0xfd')],JSON[_0x9c94('0x6b')](_0x27c711));ami[_0x9c94('0x27')](_0x9c94('0xfe'),ut[_0x9c94('0xb0')](_0x57da9e,_0x9c94('0xff'),_0x1aea46[_0x9c94('0x14')][_0x57da9e[_0x9c94('0x76')]]));_0x5e139b(ut[_0x9c94('0x5b')](_0x9c94('0x100')));})[_0x9c94('0x84')](function(_0x551c8f){ut[_0x9c94('0x5e')](_0x9c94('0x101'),_0x551c8f);_0x6a3e5a(ut[_0x9c94('0x5b')](_0x9c94('0x102'),_0x4d0ea5,_0xe0bbad));});}else{_0x485a95['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x57da9e);rpcDb[_0x9c94('0x103')](_0x57da9e,_0x9c94('0x104'));delete _0x1aea46[_0x9c94('0x17')][_0x3bf6a5];_0x6a3e5a(ut[_0x9c94('0x5b')](_0x9c94('0x105'),_0x4d0ea5,_0xe0bbad));}});};Preview[_0x9c94('0xf')][_0x9c94('0x94')]=function(_0x28eadd){return!_[_0x9c94('0x7d')](_0x28eadd)&&!_[_0x9c94('0x7d')](_0x28eadd[_0x9c94('0x2a')])&&!_[_0x9c94('0x7d')](_0x28eadd[_0x9c94('0x51')])&&_0x28eadd['active']&&!_['isNil'](this[_0x9c94('0x16')][util[_0x9c94('0x54')]('SIP/%s',_0x28eadd[_0x9c94('0x2a')])])&&!_['isNil'](this[_0x9c94('0x16')][util['format']('SIP/%s',_0x28eadd[_0x9c94('0x2a')])][_0x9c94('0x106')])&&(this['trunks'][util[_0x9c94('0x54')]('SIP/%s',_0x28eadd[_0x9c94('0x2a')])][_0x9c94('0x106')]===_0x9c94('0x107')||this['trunks'][util[_0x9c94('0x54')](_0x9c94('0x108'),_0x28eadd['name'])]['status']===_0x9c94('0x109'));};Preview[_0x9c94('0xf')][_0x9c94('0x10a')]=function(_0x2a299d,_0x42c610){var _0x21f49d=this;return new BPromise(function(_0x3a0c6a,_0x23ce80){_0x21f49d[_0x9c94('0x10b')](_0x2a299d,_0x42c610)[_0x9c94('0x7c')](function(_0x11c4e0){_0x3a0c6a(_[_0x9c94('0x6d')](_0x11c4e0,['message']));})[_0x9c94('0x84')](function(_0x218dd1){if(_0x218dd1['unlock']){rpcDb[_0x9c94('0x10c')](_0x2a299d);}if(_0x218dd1['active']){rpcDb[_0x9c94('0x86')](_0x2a299d);}_0x23ce80(_[_0x9c94('0x6d')](_0x218dd1,[_0x9c94('0x5b')]));});});};Preview[_0x9c94('0xf')]['execRun']=function(_0xd40738,_0x3997b0){var _0x4df44c=this;return new BPromise(function(_0x3d527d,_0x5c9fc0){var _0x34df49,_0x1d7d08;rpcDb['getContactPreview'](_0xd40738)[_0x9c94('0x7c')](function(_0x4581d1){if(!_['isNil'](_0x4581d1[0x0])){_0x1d7d08=_0x4581d1[0x0][_0x9c94('0x10d')]?![]:!![];_0x34df49=_0x4581d1[0x0][_0x9c94('0x10d')]?!![]:![];_0x34df49=_0x3997b0?!![]:_0x34df49;}var _0x3cc457=_0x4df44c[_0x9c94('0x10e')](_0x4581d1);if(_0x3cc457['isValid']){rpcDb['checkIsBlackList'](_[_0x9c94('0x6d')](_0x4581d1[0x0],[_0x9c94('0x6f'),_0x9c94('0x10f')]))[_0x9c94('0x7c')](function(_0x534cef){_0x4df44c[_0x9c94('0xf3')](_0x534cef,_0x4581d1[0x0],_0x3997b0,_0x1d7d08,_0x34df49)['then'](function(_0x6dbf6){_0x3d527d(_0x6dbf6);})[_0x9c94('0x84')](function(_0x24a07d){_0x5c9fc0(_0x24a07d);});})['catch'](function(_0x3038e6){ut[_0x9c94('0x5e')](_0x9c94('0x110'),_0x3038e6);_0x5c9fc0(ut[_0x9c94('0x5b')](_0x9c94('0x111'),_0x1d7d08,_0x34df49));});}else{_0x5c9fc0(ut[_0x9c94('0x5b')](_0x3cc457[_0x9c94('0x5b')],_0x1d7d08,_0x34df49));}})['catch'](function(_0x4f7a2c){ut[_0x9c94('0x5e')](_0x9c94('0x112'),_0x4f7a2c);_0x5c9fc0(ut[_0x9c94('0x5b')](_0x9c94('0x111'),![],!![]));});});};Preview[_0x9c94('0xf')][_0x9c94('0x10e')]=function(_0x4be462){if(_[_0x9c94('0x7d')](_0x4be462)||_[_0x9c94('0xf9')](_0x4be462)||!_['isNil'](_0x4be462[0x0]['Agent'])&&_['isNil'](_0x4be462[0x0]['Agent'][_0x9c94('0x2a')])){ut[_0x9c94('0x5e')](_0x9c94('0x113'),_0x4be462);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x53f878=this['campaignsPreview'][_0x4be462[0x0][_0x9c94('0xf7')][_0x9c94('0x2a')]];_0x53f878[_0x9c94('0x5b')]='ACTIVE';if(_[_0x9c94('0x7d')](_0x53f878)){ut[_0x9c94('0x5e')]('[Preview][validateContact][Empty\x20Campaign]',_0x53f878);return{'isValid':![],'message':_0x9c94('0x114')};}if(!this['isTrunkReachable'](_0x53f878[_0x9c94('0x50')])){ut[_0x9c94('0x5e')](_0x9c94('0x115'),_0x9c94('0x116')+_0x53f878[_0x9c94('0x2a')]+_0x9c94('0x117'));if(!this[_0x9c94('0x94')](_0x53f878[_0x9c94('0x118')])){ut[_0x9c94('0x5e')](_0x9c94('0x115'),_0x53f878[_0x9c94('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x9c94('0x119')};}}if(!ut[_0x9c94('0x92')](_0x53f878[_0x9c94('0x36')])){ut['logger'](_0x9c94('0x11a'),_0x53f878[_0x9c94('0x2a')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x9c94('0x116')+_0x53f878[_0x9c94('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x9c94('0xf')][_0x9c94('0x11b')]=function(_0x351391,_0x1edc14,_0xcbf46b,_0x322031){var _0x41a72c=this;return new BPromise(function(_0x3fa153,_0x570b50){var _0x1ae9dc=_0x351391[_0x9c94('0xad')];var _0x5dd89f=_0x41a72c[_0x9c94('0x94')](_0x1edc14['Trunk'])?util[_0x9c94('0x54')](_0x9c94('0x11c'),_0x1edc14['Trunk'][_0x9c94('0x2a')],_[_0x9c94('0x7d')](_0x1edc14[_0x9c94('0x39')])?'':_0x1edc14[_0x9c94('0x39')][_0x9c94('0x11d')]()||'',_0x1edc14[_0x9c94('0x11e')]>0x0?_0xcbf46b[_0x9c94('0xf4')][_0x9c94('0xf5')][_0x9c94('0x11f')](_0x1edc14[_0x9c94('0x11e')]):_0xcbf46b[_0x9c94('0xf4')]['phone']):util[_0x9c94('0x54')](_0x9c94('0x11c'),_['isNil'](_0x1edc14[_0x9c94('0x118')])?_0x1edc14[_0x9c94('0x50')]['name']:_0x1edc14[_0x9c94('0x118')][_0x9c94('0x2a')],_[_0x9c94('0x7d')](_0x1edc14[_0x9c94('0x39')])?'':_0x1edc14[_0x9c94('0x39')][_0x9c94('0x11d')]()||'',_0x1edc14[_0x9c94('0x11e')]>0x0?_0xcbf46b['Contact'][_0x9c94('0xf5')][_0x9c94('0x11f')](_0x1edc14[_0x9c94('0x11e')]):_0xcbf46b[_0x9c94('0xf4')][_0x9c94('0xf5')]);var _0x4b9785=_0x41a72c[_0x9c94('0x94')](_0x1edc14[_0x9c94('0x50')])?ut[_0x9c94('0x120')](_0x1edc14[_0x9c94('0x50')][_0x9c94('0x52')],_0x1edc14[_0x9c94('0x121')],_0x1edc14['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x9c94('0x122')](_0x1edc14[_0x9c94('0x38')],_0x1edc14[_0x9c94('0x123')]):_0x1edc14[_0x9c94('0x38')]):ut[_0x9c94('0x120')](_[_0x9c94('0x7d')](_0x1edc14[_0x9c94('0x118')])?_0x1edc14[_0x9c94('0x50')]['callerid']:_0x1edc14[_0x9c94('0x118')][_0x9c94('0x52')],_0x1edc14['dialOriginateCallerIdName'],_0x1edc14[_0x9c94('0x123')]>0x0?ut[_0x9c94('0x122')](_0x1edc14[_0x9c94('0x38')],_0x1edc14[_0x9c94('0x123')]):_0x1edc14[_0x9c94('0x38')]);if(_0x4b9785){_0x351391[_0x9c94('0x124')]=ut[_0x9c94('0x125')](_0x4b9785);_0x351391[_0x9c94('0x126')]=ut[_0x9c94('0x127')](_0x4b9785);}var _0xadbac1=ut['addVariables'](_0x1edc14,_0xcbf46b,_0x5dd89f,_0x4b9785,_0x1ae9dc,_0x351391);_[_0x9c94('0x128')](_0x351391,ut[_0x9c94('0x129')](_0xadbac1));_0x351391['starttime']=moment()[_0x9c94('0x54')](_0x9c94('0xa9'));ami['Action'](ut[_0x9c94('0x12a')](_0x351391,_0x1edc14,_0xadbac1,_0x351391['activeContact'],_0x322031))[_0x9c94('0x7c')](function(_0x45e0e8){_0x1edc14[_0x9c94('0x4b')]+=0x1;logger[_0x9c94('0x68')](_0x9c94('0x12b'),_0x1ae9dc,_0x9c94('0xae'),_0x1edc14[_0x9c94('0x2a')],_0x9c94('0x69'),_0x1edc14['originated']);_0x3fa153(_0x45e0e8);})[_0x9c94('0x84')](function(_0x5da1ca){ut[_0x9c94('0xec')](_0x351391,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x351391,'[originateFailure][logOriginateFailure]');_0x570b50(_0x5da1ca);});});};Preview[_0x9c94('0xf')][_0x9c94('0x20')]=function(_0x3ba016){if(this[_0x9c94('0x17')][_0x3ba016[_0x9c94('0xa7')]]){this['actions'][_0x3ba016[_0x9c94('0xa7')]][_0x9c94('0x72')]=_0x3ba016[_0x9c94('0x72')];}};Preview[_0x9c94('0xf')][_0x9c94('0x12c')]=function(_0x42ebac){var _0x1a56af=this;var _0x3055cf=this['actions'][_0x42ebac['actionid']];if(_0x3055cf){if(_0x3055cf['lookAgent']&&this[_0x9c94('0x18')][_0x3055cf[_0x9c94('0xf8')]]){ut['logLookAgent'](_0x3055cf,this[_0x9c94('0x18')][_0x3055cf[_0x9c94('0xf8')]][_0x9c94('0x2a')],this['agents'][_0x3055cf[_0x9c94('0xf8')]]['id']);}var _0x2e6216=_[_0x9c94('0x12d')](_0x3055cf);_0x2e6216[_0x9c94('0xaa')]=moment()[_0x9c94('0x54')](_0x9c94('0xa9'));var _0x1f5c39=_0x1a56af['campaignsPreview'][_0x3055cf[_0x9c94('0x76')]];if(ut[_0x9c94('0x12e')](_0x42ebac['response'])){if(_0x3055cf[_0x9c94('0xa5')]){rpcDb[_0x9c94('0x10c')](_0x3055cf[_0x9c94('0xfd')]);}if(_0x3055cf[_0x9c94('0xa6')]){rpcDb[_0x9c94('0x86')](_0x3055cf['idContact']);}ami[_0x9c94('0x27')]('custom:agentringnoanswer',ut[_0x9c94('0xb0')](_0x3055cf,_0x9c94('0x12f'),this[_0x9c94('0x14')][_0x3055cf[_0x9c94('0x76')]]));this[_0x9c94('0x130')](_0x2e6216,_0x1f5c39,_0x42ebac);}else{_0x3055cf[_0x9c94('0x87')]=moment()[_0x9c94('0x54')](_0x9c94('0xa9'));ut[_0x9c94('0xec')](_0x2e6216,0x4,_0x9c94('0x131'));rpcDb[_0x9c94('0xea')](_0x2e6216,_0x9c94('0x132'));}}};Preview[_0x9c94('0xf')]['syncHangup']=function(_0x12b608){var _0x56cf5c=this;var _0x6814f3=this[_0x9c94('0x17')][_0x12b608['linkedid']];var _0x5f52bc;if(_0x6814f3){_0x5f52bc=this[_0x9c94('0x14')][_0x6814f3[_0x9c94('0x76')]];logger[_0x9c94('0x68')](_0x9c94('0x133'),_0x12b608[_0x9c94('0xa7')],_0x9c94('0xae'),_0x5f52bc[_0x9c94('0x2a')],_0x9c94('0x6a'),_0x5f52bc[_0x9c94('0x2f')]);}if(this[_0x9c94('0x17')][_0x12b608['linkedid']]&&_0x12b608[_0x9c94('0xa7')]!==_0x12b608[_0x9c94('0xad')]){if(_0x12b608[_0x9c94('0x134')]==='16'&&this[_0x9c94('0x17')][_0x12b608[_0x9c94('0xa7')]][_0x9c94('0x6c')]){this['callProgressDetectingCustomer'](_0x12b608,_0x12b608[_0x9c94('0xa7')],_0x12b608[_0x9c94('0x134')]);}else if(this['actions'][_0x12b608['linkedid']]['dialAnswer']){logger[_0x9c94('0x68')](_0x9c94('0x135'),_0x12b608[_0x9c94('0xa7')],_0x12b608[_0x9c94('0x134')],_0x9c94('0xae'),_0x5f52bc['name'],_0x9c94('0x6a'),_0x5f52bc[_0x9c94('0x2f')]);this[_0x9c94('0x97')](_0x12b608,_0x12b608[_0x9c94('0xa7')],_0x12b608[_0x9c94('0x134')]);}}else if(_0x6814f3&&_['isNil'](_0x6814f3[_0x9c94('0x136')])&&_0x5f52bc[_0x9c94('0x137')]&&_0x12b608[_0x9c94('0xa7')]===_0x12b608['uniqueid']&&_[_0x9c94('0x7d')](_0x12b608[_0x9c94('0xe8')])&&_0x12b608[_0x9c94('0x134')]==='16'&&_0x12b608['channelstate']==='6'&&_[_0x9c94('0xe6')](_0x6814f3['transfer'])){if(_0x6814f3['unlockAgent']){rpcDb[_0x9c94('0x10c')](_0x6814f3[_0x9c94('0xfd')]);}if(_0x6814f3[_0x9c94('0xa6')]){rpcDb[_0x9c94('0x86')](_0x6814f3[_0x9c94('0xfd')]);}_0x12b608[_0x9c94('0xe8')]='22';this['callProgressDetectingAgent'](_0x6814f3,_0x5f52bc,_0x12b608);}else if(_0x6814f3&&_0x6814f3[_0x9c94('0x138')]){if(_0x12b608['cause']==='16'&&this['actions'][_0x12b608[_0x9c94('0xa7')]][_0x9c94('0x6c')]){logger[_0x9c94('0x68')](_0x9c94('0x139'),_0x12b608['linkedid'],_0x12b608[_0x9c94('0x134')],_0x9c94('0xae'),_0x5f52bc['name'],_0x9c94('0x6a'),_0x5f52bc[_0x9c94('0x2f')]);this['callProgressDetectingCustomer'](_0x12b608,_0x12b608[_0x9c94('0xa7')],_0x12b608[_0x9c94('0x134')]);}else if(this[_0x9c94('0x17')][_0x12b608[_0x9c94('0xa7')]][_0x9c94('0x6c')]){logger['info']('[syncHangup][talking][cause]',_0x12b608[_0x9c94('0xa7')],_0x12b608[_0x9c94('0x134')],'\x20Queue',_0x5f52bc[_0x9c94('0x2a')],'pTalking:\x20',_0x5f52bc[_0x9c94('0x2f')]);this[_0x9c94('0x97')](_0x12b608,_0x12b608[_0x9c94('0xa7')],_0x12b608[_0x9c94('0x134')]);}}};Preview[_0x9c94('0xf')][_0x9c94('0x1e')]=function(_0x26d6b5){if(this[_0x9c94('0x17')][_0x26d6b5[_0x9c94('0xe5')]]&&_0x26d6b5[_0x9c94('0xe5')]!==_0x26d6b5[_0x9c94('0x13a')]){this[_0x9c94('0x97')](_0x26d6b5,_0x26d6b5[_0x9c94('0xe5')],_0x26d6b5[_0x9c94('0xdd')]);}};Preview['prototype'][_0x9c94('0x1d')]=function(_0x378f62){if(this[_0x9c94('0x17')][_0x378f62['linkedid']]&&_0x378f62[_0x9c94('0xa7')]!==_0x378f62[_0x9c94('0xad')]&&!this[_0x9c94('0x17')][_0x378f62['linkedid']]['dialAnswer']){if(_0x378f62[_0x9c94('0x134')]==='1'){this[_0x9c94('0x97')](_0x378f62,_0x378f62[_0x9c94('0xa7')],_0x378f62[_0x9c94('0x134')]);}}};Preview[_0x9c94('0xf')][_0x9c94('0x13b')]=function(_0x1e85fd,_0xa31f55,_0x567c55){if(this[_0x9c94('0x17')][_0x1e85fd]){if(_[_0x9c94('0x7d')](this[_0x9c94('0x17')][_0x1e85fd][_0x9c94('0x13c')])){this[_0x9c94('0x17')][_0x1e85fd][_0x9c94('0x13c')]={};}this[_0x9c94('0x17')][_0x1e85fd][_0x9c94('0x13c')][_0xa31f55]=_0x567c55;}};Preview['prototype'][_0x9c94('0x22')]=function(_0x3437b0){try{if(!_[_0x9c94('0x7d')](_0x3437b0)){if(ut[_0x9c94('0x13d')](_[_0x9c94('0x13e')](_0x3437b0[_0x9c94('0x13f')])[0x0])){this[_0x9c94('0x13b')](_0x3437b0[_0x9c94('0xad')],_[_0x9c94('0x13e')](_0x3437b0['variable'])[0x0],_0x3437b0[_0x9c94('0x140')]);}}}catch(_0x1ed780){logger[_0x9c94('0x141')]('[syncVarSet][Preview]',util[_0x9c94('0x142')](_0x1ed780,{'showHidden':![],'depth':null}));}};Preview[_0x9c94('0xf')]['syncAttendedTransfer']=function(_0x20c644){if(_0x20c644){if(this[_0x9c94('0x17')][_0x20c644['transfertargetlinkedid']]){this[_0x9c94('0x17')][_0x20c644[_0x9c94('0x143')]][_0x9c94('0x138')]=!![];}}};Preview[_0x9c94('0xf')][_0x9c94('0x144')]=function(_0x41a6ad){if(_0x41a6ad){if(this[_0x9c94('0x17')][_0x41a6ad['transfererlinkedid']]){this[_0x9c94('0x17')][_0x41a6ad[_0x9c94('0x145')]][_0x9c94('0x138')]=!![];}}};module[_0x9c94('0x146')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 72d3beb..f7885f8 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 _0xe680=['[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList'];(function(_0x15771e,_0x10835a){var _0x5e95ec=function(_0x4524a4){while(--_0x4524a4){_0x15771e['push'](_0x15771e['shift']());}};_0x5e95ec(++_0x10835a);}(_0xe680,0x15a));var _0x0e68=function(_0x2dbcf0,_0x1c9ce9){_0x2dbcf0=_0x2dbcf0-0x0;var _0x185a15=_0xe680[_0x2dbcf0];return _0x185a15;};'use strict';var util=require(_0x0e68('0x0'));var BPromise=require(_0x0e68('0x1'));var logger=require(_0x0e68('0x2'))('preview');var _=require(_0x0e68('0x3'));var cmHopper=require(_0x0e68('0x4'));var cmHopperFinal=require(_0x0e68('0x5'));var cmHopperHistory=require(_0x0e68('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x0e68('0x7'));var agentReportPreview=require(_0x0e68('0x8'));var voiceQueueReport=require(_0x0e68('0x9'));function loggerCatch(_0x260469){return function(_0x262f83){logger[_0x0e68('0xa')](_0x260469,util['inspect'](_0x262f83,{'showHidden':![],'depth':null}));};}function create(_0xaa1c26){return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](cmHopperHistory[_0x0e68('0xd')](_0xaa1c26))[_0x0e68('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2a5f7a){return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](agentReportPreview[_0x0e68('0xd')](_0x2a5f7a))['catch'](loggerCatch(_0x0e68('0xf')));}function moveContact(_0x3fd3ea){return BPromise['resolve']()[_0x0e68('0xc')](cmHopper[_0x0e68('0x10')](_0x3fd3ea,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x0e68('0x11')]=function(_0x393306){return BPromise['resolve']()[_0x0e68('0xc')](cmHopperBlack[_0x0e68('0x11')](_0x393306))[_0x0e68('0xe')](loggerCatch(_0x0e68('0x12')));};exports[_0x0e68('0x13')]=function(_0x395c51){return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](cmHopper['getContactPreview'](_0x395c51))[_0x0e68('0xe')](loggerCatch(_0x0e68('0x14')));};exports[_0x0e68('0xd')]=function(_0xb291ce,_0x1407a8){create(_0xb291ce)[_0x0e68('0xe')](loggerCatch(_0x1407a8));moveContact(_0xb291ce)['catch'](loggerCatch(_0x1407a8));};exports[_0x0e68('0x15')]=function(_0xef674e,_0x835993){createAgent(_0xef674e)[_0x0e68('0xe')](loggerCatch(_0x835993));};exports[_0x0e68('0x16')]=function(_0x12db65,_0x5614c9){create(_0x12db65)[_0x0e68('0xe')](loggerCatch(_0x5614c9));};exports[_0x0e68('0x17')]=function(_0x1b5e5b,_0x291222){moveContact(_0x1b5e5b)['catch'](loggerCatch(_0x291222));};exports[_0x0e68('0x18')]=function(_0x3b883e,_0x31d6c4,_0x4796c6){if(_0x31d6c4){_0x3b883e['UserId']=null;}if(_0x4796c6){_0x3b883e['active']=![];}return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](cmHopper[_0x0e68('0x18')](_0x3b883e))[_0x0e68('0xe')](loggerCatch(_0x0e68('0x19')));};exports[_0x0e68('0x1a')]=function(_0x3a43c2){return BPromise['resolve']()['then'](cmHopper[_0x0e68('0x1a')](_0x3a43c2))[_0x0e68('0xe')](loggerCatch(_0x0e68('0x1b')));};exports['unlockContact']=function(_0x733c29){return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](cmHopper['unlockContact']({'UserId':null},_0x733c29,0x1))[_0x0e68('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x0e68('0x1c')]=function(_0x315850){return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](cmHopper[_0x0e68('0x1d')]({'active':![]},_0x315850,0x1))[_0x0e68('0xe')](loggerCatch(_0x0e68('0x1e')));};exports[_0x0e68('0x1f')]=function(_0x8e6a62){var _0x46a4a9={};_0x46a4a9[_0x0e68('0x20')]=_0x8e6a62[_0x0e68('0x20')];_0x46a4a9[_0x0e68('0x21')]=_0x8e6a62[_0x0e68('0x21')];_0x46a4a9['calleridnum']=_0x8e6a62[_0x0e68('0x22')];_0x46a4a9[_0x0e68('0x23')]=_0x8e6a62['calleridname'];_0x46a4a9[_0x0e68('0x24')]=_0x8e6a62[_0x0e68('0x24')];_0x46a4a9[_0x0e68('0x25')]=_0x8e6a62[_0x0e68('0x26')];_0x46a4a9['queuecallerleaveAt']=_0x8e6a62[_0x0e68('0x26')];_0x46a4a9[_0x0e68('0x27')]=0x1;_0x46a4a9[_0x0e68('0x28')]=_0x8e6a62['endtime'];_0x46a4a9['connectedlinename']=_0x8e6a62['membername'];_0x46a4a9[_0x0e68('0x29')]=_0x0e68('0x2a');_0x46a4a9[_0x0e68('0x2b')]=_0x0e68('0x2c');_0x46a4a9[_0x0e68('0x2d')]=0x0;_0x46a4a9[_0x0e68('0x2e')]=0x1;_0x46a4a9[_0x0e68('0x2f')]=_0x8e6a62[_0x0e68('0x30')];_0x46a4a9['queuecallerexitreason']=_0x0e68('0x31');return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](voiceQueueReport['create'](_0x46a4a9))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x0e68('0x32')]=function(_0x557537,_0x39af32){return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](cmHopper[_0x0e68('0x32')](_0x557537,_0x39af32))[_0x0e68('0xe')](loggerCatch(_0x0e68('0x33')));};exports['rescheduleContactInQueue']=function(_0x4f90fd){return BPromise[_0x0e68('0xb')]()[_0x0e68('0xc')](cmHopper[_0x0e68('0x18')](_0x4f90fd,!![],!![]))[_0x0e68('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x5491=['getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5491,0xe7));var _0x1549=function(_0x380d0d,_0x1142f9){_0x380d0d=_0x380d0d-0x0;var _0xf16ee4=_0x5491[_0x380d0d];return _0xf16ee4;};'use strict';var util=require(_0x1549('0x0'));var BPromise=require('bluebird');var logger=require(_0x1549('0x1'))(_0x1549('0x2'));var _=require('lodash');var cmHopper=require(_0x1549('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1549('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x1549('0x5'));var voiceQueueReport=require(_0x1549('0x6'));function loggerCatch(_0x82463e){return function(_0x23610c){logger[_0x1549('0x7')](_0x82463e,util[_0x1549('0x8')](_0x23610c,{'showHidden':![],'depth':null}));};}function create(_0x5a358c){return BPromise['resolve']()[_0x1549('0x9')](cmHopperHistory[_0x1549('0xa')](_0x5a358c))['catch'](loggerCatch(_0x1549('0xb')));}function createAgent(_0x13cf42){return BPromise[_0x1549('0xc')]()[_0x1549('0x9')](agentReportPreview['createHistory'](_0x13cf42))[_0x1549('0xd')](loggerCatch(_0x1549('0xb')));}function moveContact(_0x39350b){return BPromise[_0x1549('0xc')]()['then'](cmHopper[_0x1549('0xe')](_0x39350b,!![]))[_0x1549('0xd')](loggerCatch(_0x1549('0xf')));}exports[_0x1549('0x10')]=function(_0x1fd329){return BPromise['resolve']()[_0x1549('0x9')](cmHopperBlack[_0x1549('0x10')](_0x1fd329))[_0x1549('0xd')](loggerCatch(_0x1549('0x11')));};exports['getContactPreview']=function(_0x113e10){return BPromise[_0x1549('0xc')]()[_0x1549('0x9')](cmHopper[_0x1549('0x12')](_0x113e10))[_0x1549('0xd')](loggerCatch(_0x1549('0x13')));};exports[_0x1549('0xa')]=function(_0x13bc0b,_0x342e69){create(_0x13bc0b)[_0x1549('0xd')](loggerCatch(_0x342e69));moveContact(_0x13bc0b)[_0x1549('0xd')](loggerCatch(_0x342e69));};exports[_0x1549('0x14')]=function(_0x40517d,_0x55b44){createAgent(_0x40517d)[_0x1549('0xd')](loggerCatch(_0x55b44));};exports['createCustomerHistory']=function(_0x1656bc,_0x2d19b4){create(_0x1656bc)[_0x1549('0xd')](loggerCatch(_0x2d19b4));};exports[_0x1549('0x15')]=function(_0x568e73,_0x74157){moveContact(_0x568e73)[_0x1549('0xd')](loggerCatch(_0x74157));};exports[_0x1549('0x16')]=function(_0x838d82,_0xaddeed,_0x2b65a5){if(_0xaddeed){_0x838d82[_0x1549('0x17')]=null;}if(_0x2b65a5){_0x838d82[_0x1549('0x18')]=![];}return BPromise['resolve']()[_0x1549('0x9')](cmHopper[_0x1549('0x16')](_0x838d82))['catch'](loggerCatch(_0x1549('0x19')));};exports['countReScheduled']=function(_0x48df27){return BPromise[_0x1549('0xc')]()[_0x1549('0x9')](cmHopper[_0x1549('0x1a')](_0x48df27))[_0x1549('0xd')](loggerCatch(_0x1549('0x1b')));};exports[_0x1549('0x1c')]=function(_0x429cad){return BPromise[_0x1549('0xc')]()[_0x1549('0x9')](cmHopper[_0x1549('0x1c')]({'UserId':null},_0x429cad,0x1))['catch'](loggerCatch(_0x1549('0x1d')));};exports[_0x1549('0x1e')]=function(_0x292a33){return BPromise['resolve']()[_0x1549('0x9')](cmHopper[_0x1549('0x1c')]({'active':![]},_0x292a33,0x1))[_0x1549('0xd')](loggerCatch(_0x1549('0x1f')));};exports[_0x1549('0x20')]=function(_0x562368){var _0x5d0f2e={};_0x5d0f2e[_0x1549('0x21')]=_0x562368[_0x1549('0x21')];_0x5d0f2e[_0x1549('0x22')]=_0x562368[_0x1549('0x22')];_0x5d0f2e['calleridnum']=_0x562368['calleridnum'];_0x5d0f2e[_0x1549('0x23')]=_0x562368[_0x1549('0x23')];_0x5d0f2e[_0x1549('0x24')]=_0x562368['queue'];_0x5d0f2e[_0x1549('0x25')]=_0x562368[_0x1549('0x26')];_0x5d0f2e[_0x1549('0x27')]=_0x562368['answertime'];_0x5d0f2e[_0x1549('0x28')]=0x1;_0x5d0f2e[_0x1549('0x29')]=_0x562368[_0x1549('0x2a')];_0x5d0f2e[_0x1549('0x2b')]=_0x562368[_0x1549('0x2c')];_0x5d0f2e[_0x1549('0x2d')]=_0x1549('0x2e');_0x5d0f2e['exten']=_0x1549('0x2f');_0x5d0f2e[_0x1549('0x30')]=0x0;_0x5d0f2e[_0x1549('0x31')]=0x1;_0x5d0f2e['lastAssignedTo']=_0x562368['membername'];_0x5d0f2e[_0x1549('0x32')]=_0x1549('0x33');return BPromise[_0x1549('0xc')]()[_0x1549('0x9')](voiceQueueReport[_0x1549('0x34')](_0x5d0f2e))[_0x1549('0xd')](loggerCatch(_0x1549('0x35')));};exports[_0x1549('0x36')]=function(_0x46fc12,_0x208118){return BPromise[_0x1549('0xc')]()['then'](cmHopper['getContactRecallMe'](_0x46fc12,_0x208118))[_0x1549('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x1549('0x37')]=function(_0x4467b9){return BPromise[_0x1549('0xc')]()[_0x1549('0x9')](cmHopper[_0x1549('0x16')](_0x4467b9,!![],!![]))[_0x1549('0xd')](loggerCatch(_0x1549('0x38')));}; \ 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 f928b94..9eabff8 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 _0xf4fb=['preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','endtime','talktime','answertime','Failure','variablesAction','originate','channelAgent','calleridnum','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','add','minutes','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','motionChannel','mandatoryDisposition','buildAcw','queue','interface','agentReadyId','status','reachable','getDiff','CampaignId','idContact','type','campaigntype','dialAnswer','active','scheduledat','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','ListId','sipcallid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xf4fb,0x88));var _0xbf4f=function(_0xf2096,_0x23fc88){_0xf2096=_0xf2096-0x0;var _0x15cfab=_0xf4fb[_0xf2096];return _0x15cfab;};'use strict';var util=require(_0xbf4f('0x0'));var _=require(_0xbf4f('0x1'));var moment=require(_0xbf4f('0x2'));var logger=require(_0xbf4f('0x3'))(_0xbf4f('0x4'));var ipAgi=process[_0xbf4f('0x5')][_0xbf4f('0x6')]||'127.0.0.1';function getSeconds(_0x3a980a,_0xb3bf04){var _0x56ab60=moment(_0x3a980a)[_0xbf4f('0x7')](0x0);var _0x2289ed=moment(_0xb3bf04)[_0xbf4f('0x7')](0x0);return _0x56ab60[_0xbf4f('0x8')](_0x2289ed,_0xbf4f('0x9'));}exports[_0xbf4f('0xa')]=function(_0x642e0c){return function(_0x5ec5c1){logger[_0xbf4f('0xb')](_0x642e0c,util[_0xbf4f('0xc')](_0x5ec5c1,{'showHidden':![],'depth':null}));};};exports[_0xbf4f('0xd')]=function(_0x4001a7,_0x11074d){logger[_0xbf4f('0xe')](_0x4001a7,util[_0xbf4f('0xc')](_0x11074d,{'showHidden':![],'depth':null}));};exports[_0xbf4f('0xf')]=function(_0x3b3fa9,_0x218785){logger[_0xbf4f('0xb')](_0x3b3fa9,util[_0xbf4f('0xc')](_0x218785,{'showHidden':![],'depth':null}));};exports[_0xbf4f('0x10')]=function(_0x59509c){return function(_0x517437){logger[_0xbf4f('0xe')](_0x59509c,util[_0xbf4f('0xc')](_0x517437,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1e2a14,_0x1eec4d,_0x4e8f96){return{'message':_0x1e2a14,'unlock':_0x1eec4d,'active':_0x4e8f96};};exports[_0xbf4f('0x11')]=function(_0x55dd10,_0x48f131,_0x50986a){if(!_[_0xbf4f('0x12')](_0x50986a)&&_0xbf4f('0x13')===typeof _0x50986a&&!_['isEmpty'](_0x50986a)){if(!_['isUndefined'](_0x48f131)&&_0xbf4f('0x13')===typeof _0x48f131&&!_[_0xbf4f('0x14')](_0x48f131)){return util[_0xbf4f('0x15')]('\x22%s\x22\x20<%s>',_0x48f131,_0x50986a);}return util['format'](_0xbf4f('0x16'),_0x50986a,_0x50986a);}if(!_[_0xbf4f('0x12')](_0x55dd10)&&'string'===typeof _0x55dd10&&!_['isEmpty'](_0x55dd10)){return _0x55dd10;}return _0xbf4f('0x17');};exports[_0xbf4f('0x18')]=function(_0x25d172){if(_[_0xbf4f('0x19')](_0x25d172)){return![];}return _0x25d172;};exports[_0xbf4f('0x1a')]=function(_0x9df5d9,_0x4d1728,_0x21d275,_0x4e95c5,_0x27b568,_0x42904d){var _0x526e63={'XMD-QUEUE':_0x4d1728[_0xbf4f('0x1b')]?_0x4d1728[_0xbf4f('0x1b')][_0xbf4f('0x1c')]:'','XMD-CALLERID':_0x4e95c5,'XMD-CALLERID-PREVIEW':_0x42904d?util[_0xbf4f('0x15')](_0xbf4f('0x16'),_0x42904d[_0xbf4f('0x1d')],_0x42904d['calleridnum']):_0x4e95c5,'XMD-DIALID':_0x27b568,'XMD-CONTACTID':_0x4d1728[_0xbf4f('0x1e')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4e95c5,'XMD-VOICEQUEUEID':_0x4d1728['VoiceQueueId'],'XMD-DIALCHANNEL':_0x21d275,'XMD-DIALTIMEOUT':_0x9df5d9['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xbf4f('0x15')](_0xbf4f('0x1f'),_0x9df5d9['dialQueueProject2']?'g':'',_[_0xbf4f('0x14')](_0x9df5d9[_0xbf4f('0x20')])?'':_0xbf4f('0x21')),'XMD-DIALURL':_0x9df5d9[_0xbf4f('0x22')]||'','XMD-AGI':_0x9df5d9['dialQueueProject']?util[_0xbf4f('0x15')](_0xbf4f('0x23'),ipAgi,_0x9df5d9[_0xbf4f('0x24')]):_0xbf4f('0x25'),'XMD-AGIAFTER':_0x9df5d9[_0xbf4f('0x26')]?util[_0xbf4f('0x15')](_0xbf4f('0x23'),ipAgi,_0x9df5d9[_0xbf4f('0x26')]):_0xbf4f('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x42904d?_0x42904d[_0xbf4f('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x42904d?_0x42904d[_0xbf4f('0x28')]:'','XMD-DESTINATION':_0xbf4f('0x29'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x9df5d9[_0xbf4f('0x20')])){_0x526e63[util[_0xbf4f('0x15')]('%s',_0xbf4f('0x2a'))]=_0x9df5d9['monitor_format'];_0x526e63[util[_0xbf4f('0x15')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x27b568;}if(_0x4d1728&&_0x4d1728[_0xbf4f('0x2b')]){for(var _0x3801d2 in _0x4d1728['Contact']){if(_0x4d1728[_0xbf4f('0x2b')][_0xbf4f('0x2c')](_0x3801d2)){if(!_[_0xbf4f('0x19')](_0x4d1728[_0xbf4f('0x2b')][_0x3801d2])&&_0x3801d2!=='id'&&_0x3801d2!==_0xbf4f('0x2d')&&_0x3801d2!==_0xbf4f('0x2e')&&_0x3801d2!==_0xbf4f('0x2f')){_0x526e63[util[_0xbf4f('0x15')](_0xbf4f('0x30'),_0xbf4f('0x31'),_[_0xbf4f('0x32')](_0x3801d2))]=_0x4d1728[_0xbf4f('0x2b')][_0x3801d2];}}}}return _0x526e63;};exports[_0xbf4f('0x33')]=function(_0x2b973e){var _0x16ee48={};for(var _0x43c973 in _0x2b973e){if(_0x2b973e[_0xbf4f('0x2c')](_0x43c973)){_0x16ee48[util[_0xbf4f('0x15')]('%s',_[_0xbf4f('0x34')](_0x43c973))]=_0x2b973e[_0x43c973];}}return{'variables':_0x16ee48};};exports['updateOriginated']=function(_0x5e8876,_0x54d4ef){if(!_[_0xbf4f('0x19')](_0x5e8876)){if(_0x5e8876[_0xbf4f('0x2c')]('originated')){if(_0x5e8876[_0xbf4f('0x35')]>0x0){_0x5e8876['originated']-=0x1;}else{logger[_0xbf4f('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x54d4ef);}}}else{logger[_0xbf4f('0xb')](_0xbf4f('0x36'),_0x54d4ef);}};exports[_0xbf4f('0x37')]=function(_0x349188){var _0x408f83=moment()[_0xbf4f('0x15')](_0xbf4f('0x38'));_0x349188[_0xbf4f('0x39')]=0xd;_0x349188[_0xbf4f('0x3a')]=_0xbf4f('0x3b');_0x349188[_0xbf4f('0x3c')]=_0x408f83;_0x349188[_0xbf4f('0x3d')]=_0x408f83;_0x349188['endtime']=_0x408f83;};exports[_0xbf4f('0x3e')]=function(_0x5c88f0,_0x3b4c54,_0xd51488){var _0xf16fb6=moment()[_0xbf4f('0x15')](_0xbf4f('0x38'));_0x5c88f0[_0xbf4f('0x39')]=_0x3b4c54;_0x5c88f0[_0xbf4f('0x3a')]=_0xd51488;_0x5c88f0[_0xbf4f('0x3d')]=_0xf16fb6;_0x5c88f0[_0xbf4f('0x3f')]=getSeconds(_0x5c88f0[_0xbf4f('0x3d')],_0x5c88f0[_0xbf4f('0x3c')]);};exports[_0xbf4f('0x40')]=function(_0x52aaeb,_0x32d1d7,_0x589355){_0x52aaeb[_0xbf4f('0x41')]=_0x32d1d7;_0x52aaeb['UserId']=_0x589355;};exports['logCustomer']=function(_0x28dbf4,_0x3fbd49,_0x452b47){var _0x1e71a4=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x28dbf4[_0xbf4f('0x39')]=_0x3fbd49;_0x28dbf4[_0xbf4f('0x3a')]=_0x452b47;_0x28dbf4[_0xbf4f('0x3d')]=_0x28dbf4[_0xbf4f('0x3d')]?_0x28dbf4[_0xbf4f('0x3d')]:_0x1e71a4;_0x28dbf4['endtime']=_0x28dbf4[_0xbf4f('0x42')]?_0x28dbf4[_0xbf4f('0x42')]:_0x1e71a4;_0x28dbf4[_0xbf4f('0x3f')]=getSeconds(_0x28dbf4['responsetime']||0x0,_0x28dbf4[_0xbf4f('0x3c')]||0x0);_0x28dbf4[_0xbf4f('0x43')]=_0x28dbf4[_0xbf4f('0x44')]?getSeconds(_0x28dbf4[_0xbf4f('0x42')],_0x28dbf4['answertime']):0x0;};exports['isFailure']=function(_0x3167a4){return _0x3167a4===_0xbf4f('0x45');};exports[_0xbf4f('0x46')]=function(_0x2de009,_0xccc2a7,_0x43f29e,_0x51c197,_0x5090cd){var _0x85000e=_0x51c197?'RECALL':_0x2de009[_0xbf4f('0x1d')];_0x85000e=_0x5090cd?'BOOKED':_0x85000e;return{'actionid':_0x2de009['uniqueid'],'action':_0xbf4f('0x47'),'channel':_0x2de009[_0xbf4f('0x48')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x85000e,_0x2de009[_0xbf4f('0x49')]),'Exten':_0xbf4f('0x29'),'Context':_0xbf4f('0x4a'),'Priority':'1','variable':_0x43f29e,'timeout':(_0xccc2a7[_0xbf4f('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2de009[_0xbf4f('0x4c')]};};exports[_0xbf4f('0x4d')]=function(_0x39f8eb){return _0x39f8eb[_0xbf4f('0x4e')]+_0x39f8eb[_0xbf4f('0x4f')]+_0x39f8eb['countnoanswerretry']+_0x39f8eb[_0xbf4f('0x50')]+_0x39f8eb[_0xbf4f('0x51')];};exports['cloneAction']=function(_0x16cc62){var _0x1c3046=_[_0xbf4f('0x52')](_0x16cc62);_0x1c3046[_0xbf4f('0x39')]=0xf;_0x1c3046[_0xbf4f('0x3a')]='Global';return _0x1c3046;};exports[_0xbf4f('0x53')]=function(_0x21e064,_0xd06159,_0x48bdab){var _0x3b983e={};_0x3b983e[_0xd06159]=_0x21e064[_0xd06159];_0x3b983e['active']=![];_0x3b983e['scheduledat']=moment()[_0xbf4f('0x54')](_0x48bdab,_0xbf4f('0x55'))[_0xbf4f('0x15')](_0xbf4f('0x38'));_0x3b983e[_0xbf4f('0x1e')]=_0x21e064[_0xbf4f('0x1e')];_0x3b983e['ListId']=_0x21e064['ListId'];_0x3b983e[_0xbf4f('0x56')]=_0x21e064[_0xbf4f('0x56')]||undefined;return _0x3b983e;};exports['decrementTalkink']=function(_0x3974bd,_0x23bdb6){if(!_['isNil'](_0x3974bd)){if(_0x3974bd[_0xbf4f('0x57')]>0x0){_0x3974bd[_0xbf4f('0x57')]-=0x1;}else{logger[_0xbf4f('0xb')](_0x23bdb6,_0xbf4f('0x58'));}}else{logger[_0xbf4f('0xb')](_0x23bdb6,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xbf4f('0x59')]=function(_0x2d397a){if(_0x2d397a<=0x0){return!![];}return![];};exports[_0xbf4f('0x5a')]=function(_0x4f87a2,_0x2e2cdb,_0x3a7e9b){_0x4f87a2[_0xbf4f('0x5b')]=_0x2e2cdb;_0x4f87a2['name']=_0x4f87a2['queue'];_0x4f87a2['interface']=_0x4f87a2[_0xbf4f('0x48')];_0x4f87a2[_0xbf4f('0x5c')]='voice';if(_0x3a7e9b){_0x4f87a2[_0xbf4f('0x5d')]=_0x3a7e9b[_0xbf4f('0x5d')];}return _0x4f87a2;};exports[_0xbf4f('0x5e')]=function(_0x5e9f2f){var _0x139d47={};_0x139d47[_0xbf4f('0x5f')]=_0x5e9f2f['queue'];_0x139d47[_0xbf4f('0x60')]=_0x5e9f2f[_0xbf4f('0x48')];_0x139d47[_0xbf4f('0x4c')]=_0x5e9f2f[_0xbf4f('0x4c')];return _0x139d47;};exports[_0xbf4f('0x61')]=function(_0x4f936d){var _0xef843e=[];for(var _0x3538e7 in _0x4f936d){if(_0x4f936d[_0xbf4f('0x2c')](_0x3538e7)){if(!_[_0xbf4f('0x19')](_0x4f936d[_0x3538e7])&&_0x4f936d[_0x3538e7][_0xbf4f('0x39')]==='not_inuse'&&_0x4f936d[_0x3538e7][_0xbf4f('0x62')]===_0xbf4f('0x63')){_0xef843e['push'](_0x4f936d[_0x3538e7]['id']);}}}return _0xef843e;};exports[_0xbf4f('0x64')]=function(_0x4f50f4){var _0x3ddeab=moment()[_0xbf4f('0x7')](0x0);var _0xb9ca0b=moment(_0x4f50f4)[_0xbf4f('0x7')](0x0);return _0x3ddeab[_0xbf4f('0x8')](_0xb9ca0b,_0xbf4f('0x9'));};exports['createBody']=function(_0x4a20bb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a20bb[_0xbf4f('0x1e')],'ListId':_0x4a20bb['ListId'],'VoiceQueueId':_0x4a20bb[_0xbf4f('0x56')]||undefined,'CampaignId':_0x4a20bb[_0xbf4f('0x65')]||undefined};};exports['filterKey']=function(_0x3bcad4){if(_0x3bcad4==='uniqueid'||_0x3bcad4===_0xbf4f('0x66')||_0x3bcad4===_0xbf4f('0x5f')||_0x3bcad4===_0xbf4f('0x67')||_0x3bcad4===_0xbf4f('0x68')||_0x3bcad4===_0xbf4f('0x69')||_0x3bcad4===_0xbf4f('0x41')||_0x3bcad4===_0xbf4f('0x48')||_0x3bcad4===_0xbf4f('0x1d')||_0x3bcad4===_0xbf4f('0x6a')||_0x3bcad4===_0xbf4f('0x49')||_0x3bcad4===_0xbf4f('0x6b')||_0x3bcad4===_0xbf4f('0x4e')||_0x3bcad4===_0xbf4f('0x4f')||_0x3bcad4===_0xbf4f('0x6c')||_0x3bcad4===_0xbf4f('0x6d')||_0x3bcad4===_0xbf4f('0x6e')||_0x3bcad4===_0xbf4f('0x6f')||_0x3bcad4===_0xbf4f('0x70')||_0x3bcad4==='recallme'||_0x3bcad4===_0xbf4f('0x1e')||_0x3bcad4===_0xbf4f('0x71')||_0x3bcad4==='UserId'||_0x3bcad4==='VoiceQueueId'||_0x3bcad4===_0xbf4f('0x72')||_0x3bcad4==='xmd-voicequeueid'||_0x3bcad4===_0xbf4f('0x73')||_0x3bcad4==='xmd-phone'||_0x3bcad4===_0xbf4f('0x74')||_0x3bcad4===_0xbf4f('0x75')||_0x3bcad4===_0xbf4f('0x76')||_0x3bcad4===_0xbf4f('0x77')||_0x3bcad4===_0xbf4f('0x78')||_0x3bcad4===_0xbf4f('0x79')||_0x3bcad4===_0xbf4f('0x7a')||_0x3bcad4===_0xbf4f('0x7b')||_0x3bcad4===_0xbf4f('0x7c')||_0x3bcad4===_0xbf4f('0x7d')||_0x3bcad4===_0xbf4f('0x7e')||_0x3bcad4===_0xbf4f('0x7f')||_0x3bcad4===_0xbf4f('0x80')||_0x3bcad4===_0xbf4f('0x81')||_0x3bcad4===_0xbf4f('0x82')||_0x3bcad4===_0xbf4f('0x83')||_0x3bcad4==='rtpaudioqoslossbridged'||_0x3bcad4==='rtpaudioqosrtt'||_0x3bcad4==='rtpaudioqosrttbridged'||_0x3bcad4===_0xbf4f('0x7f')||_0x3bcad4===_0xbf4f('0x80')||_0x3bcad4===_0xbf4f('0x81')||_0x3bcad4===_0xbf4f('0x82')||_0x3bcad4===_0xbf4f('0x83')||_0x3bcad4===_0xbf4f('0x84')||_0x3bcad4==='rtpaudioqosrtt'||_0x3bcad4===_0xbf4f('0x85')||_0x3bcad4==='bridgepeer'||_0x3bcad4==='bridgepvtcallid'||_0x3bcad4==='state'||_0x3bcad4===_0xbf4f('0x3a')){return![];}return!![];};exports[_0xbf4f('0x86')]=function(_0x4249a3,_0x50b7f5){var _0xeafdb5,_0x32e800,_0x2d8f64;if(_0x50b7f5<=0x0){_0x50b7f5=0x1;}_0xeafdb5=new RegExp(_0xbf4f('0x87')+_0x50b7f5+'}$');_0x32e800=Math[_0xbf4f('0x88')](0xa,_0x50b7f5-0x1);_0x2d8f64=Math['pow'](0xa,_0x50b7f5)-0x1;return util[_0xbf4f('0x15')]('%s',_['replace'](_0x4249a3,_0xeafdb5,_[_0xbf4f('0x89')](_0x32e800,_0x2d8f64)));};exports[_0xbf4f('0x8a')]=function(_0x2d6729){var _0xcf479e=_0x2d6729['match'](/"(.*?)"/);return _0xcf479e?_0xcf479e[0x1]:_0x2d6729;};exports['extractCalleridNumber']=function(_0x1efe3d){var _0x2747d9=_0x1efe3d[_0xbf4f('0x8b')](/<(.*?)>/);return _0x2747d9?_0x2747d9[0x1]:_0x1efe3d;}; \ No newline at end of file +var _0xfd69=['milliseconds','diff','seconds','loggerCatch','inspect','logger','info','error','logger2','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','Queue','name','calleridname','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_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','state','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','motionChannel','mandatoryDisposition','buildAcw','queue','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','countglobal','callback','callbackat','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0xfd69,0x1ab));var _0x9fd6=function(_0x11d915,_0x703c68){_0x11d915=_0x11d915-0x0;var _0x2e669c=_0xfd69[_0x11d915];return _0x2e669c;};'use strict';var util=require(_0x9fd6('0x0'));var _=require(_0x9fd6('0x1'));var moment=require(_0x9fd6('0x2'));var logger=require(_0x9fd6('0x3'))(_0x9fd6('0x4'));var ipAgi=process[_0x9fd6('0x5')][_0x9fd6('0x6')]||_0x9fd6('0x7');function getSeconds(_0x4ea0eb,_0x3d6552){var _0x3b40fe=moment(_0x4ea0eb)[_0x9fd6('0x8')](0x0);var _0xda56b4=moment(_0x3d6552)[_0x9fd6('0x8')](0x0);return _0x3b40fe[_0x9fd6('0x9')](_0xda56b4,_0x9fd6('0xa'));}exports[_0x9fd6('0xb')]=function(_0x5b6273){return function(_0x1ae20a){logger['error'](_0x5b6273,util[_0x9fd6('0xc')](_0x1ae20a,{'showHidden':![],'depth':null}));};};exports[_0x9fd6('0xd')]=function(_0x1cc2b0,_0x4224b7){logger[_0x9fd6('0xe')](_0x1cc2b0,util['inspect'](_0x4224b7,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x442355,_0x4bd714){logger[_0x9fd6('0xf')](_0x442355,util[_0x9fd6('0xc')](_0x4bd714,{'showHidden':![],'depth':null}));};exports[_0x9fd6('0x10')]=function(_0x33ba99){return function(_0x197587){logger[_0x9fd6('0xe')](_0x33ba99,util['inspect'](_0x197587,{'showHidden':![],'depth':null}));};};exports[_0x9fd6('0x11')]=function(_0x445156,_0x360049,_0x2ec0fe){return{'message':_0x445156,'unlock':_0x360049,'active':_0x2ec0fe};};exports[_0x9fd6('0x12')]=function(_0x49da78,_0xb7240c,_0x2ab85f){if(!_[_0x9fd6('0x13')](_0x2ab85f)&&'string'===typeof _0x2ab85f&&!_[_0x9fd6('0x14')](_0x2ab85f)){if(!_['isUndefined'](_0xb7240c)&&_0x9fd6('0x15')===typeof _0xb7240c&&!_['isEmpty'](_0xb7240c)){return util[_0x9fd6('0x16')]('\x22%s\x22\x20<%s>',_0xb7240c,_0x2ab85f);}return util[_0x9fd6('0x16')](_0x9fd6('0x17'),_0x2ab85f,_0x2ab85f);}if(!_[_0x9fd6('0x13')](_0x49da78)&&_0x9fd6('0x15')===typeof _0x49da78&&!_[_0x9fd6('0x14')](_0x49da78)){return _0x49da78;}return _0x9fd6('0x18');};exports['isActive']=function(_0x30a2e7){if(_['isNil'](_0x30a2e7)){return![];}return _0x30a2e7;};exports['addVariables']=function(_0x387a51,_0x71c0d7,_0x38d6af,_0xce860c,_0xa088a0,_0x375e0e){var _0x177de2={'XMD-QUEUE':_0x71c0d7['Queue']?_0x71c0d7[_0x9fd6('0x19')][_0x9fd6('0x1a')]:'','XMD-CALLERID':_0xce860c,'XMD-CALLERID-PREVIEW':_0x375e0e?util['format']('\x22%s\x22\x20<%s>',_0x375e0e[_0x9fd6('0x1b')],_0x375e0e['calleridnum']):_0xce860c,'XMD-DIALID':_0xa088a0,'XMD-CONTACTID':_0x71c0d7[_0x9fd6('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xce860c,'XMD-VOICEQUEUEID':_0x71c0d7[_0x9fd6('0x1d')],'XMD-DIALCHANNEL':_0x38d6af,'XMD-DIALTIMEOUT':_0x387a51[_0x9fd6('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x9fd6('0x16')](_0x9fd6('0x1f'),_0x387a51['dialQueueProject2']?'g':'',_[_0x9fd6('0x14')](_0x387a51[_0x9fd6('0x20')])?'':_0x9fd6('0x21')),'XMD-DIALURL':_0x387a51['dialPreviewUrl']||'','XMD-AGI':_0x387a51[_0x9fd6('0x22')]?util['format'](_0x9fd6('0x23'),ipAgi,_0x387a51['dialQueueProject']):_0x9fd6('0x24'),'XMD-AGIAFTER':_0x387a51[_0x9fd6('0x25')]?util[_0x9fd6('0x16')](_0x9fd6('0x23'),ipAgi,_0x387a51[_0x9fd6('0x25')]):_0x9fd6('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x375e0e?_0x375e0e[_0x9fd6('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x375e0e?_0x375e0e[_0x9fd6('0x27')]:'','XMD-DESTINATION':_0x9fd6('0x28'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x9fd6('0x14')](_0x387a51['monitor_format'])){_0x177de2[util['format']('%s',_0x9fd6('0x29'))]=_0x387a51['monitor_format'];_0x177de2[util[_0x9fd6('0x16')]('%s',_0x9fd6('0x2a'))]=_0xa088a0;}if(_0x71c0d7&&_0x71c0d7['Contact']){for(var _0x3f8fd9 in _0x71c0d7[_0x9fd6('0x2b')]){if(_0x71c0d7[_0x9fd6('0x2b')][_0x9fd6('0x2c')](_0x3f8fd9)){if(!_['isNil'](_0x71c0d7[_0x9fd6('0x2b')][_0x3f8fd9])&&_0x3f8fd9!=='id'&&_0x3f8fd9!=='tags'&&_0x3f8fd9!==_0x9fd6('0x2d')&&_0x3f8fd9!==_0x9fd6('0x2e')){_0x177de2[util['format'](_0x9fd6('0x2f'),_0x9fd6('0x30'),_[_0x9fd6('0x31')](_0x3f8fd9))]=_0x71c0d7[_0x9fd6('0x2b')][_0x3f8fd9];}}}}return _0x177de2;};exports[_0x9fd6('0x32')]=function(_0x5d3a1b){var _0x4befd0={};for(var _0x12a319 in _0x5d3a1b){if(_0x5d3a1b[_0x9fd6('0x2c')](_0x12a319)){_0x4befd0[util[_0x9fd6('0x16')]('%s',_[_0x9fd6('0x33')](_0x12a319))]=_0x5d3a1b[_0x12a319];}}return{'variables':_0x4befd0};};exports['updateOriginated']=function(_0x35f1,_0x2f95f5){if(!_[_0x9fd6('0x34')](_0x35f1)){if(_0x35f1[_0x9fd6('0x2c')](_0x9fd6('0x35'))){if(_0x35f1[_0x9fd6('0x35')]>0x0){_0x35f1['originated']-=0x1;}else{logger[_0x9fd6('0xf')](_0x9fd6('0x36'),_0x2f95f5);}}}else{logger[_0x9fd6('0xf')](_0x9fd6('0x37'),_0x2f95f5);}};exports['logBlacklist']=function(_0x153566){var _0x5ca6ef=moment()[_0x9fd6('0x16')](_0x9fd6('0x38'));_0x153566['state']=0xd;_0x153566[_0x9fd6('0x39')]=_0x9fd6('0x3a');_0x153566[_0x9fd6('0x3b')]=_0x5ca6ef;_0x153566[_0x9fd6('0x3c')]=_0x5ca6ef;_0x153566[_0x9fd6('0x3d')]=_0x5ca6ef;};exports[_0x9fd6('0x3e')]=function(_0x3adde7,_0x712367,_0x5baa3b){var _0x503547=moment()[_0x9fd6('0x16')](_0x9fd6('0x38'));_0x3adde7['state']=_0x712367;_0x3adde7[_0x9fd6('0x39')]=_0x5baa3b;_0x3adde7['responsetime']=_0x503547;_0x3adde7[_0x9fd6('0x3f')]=getSeconds(_0x3adde7[_0x9fd6('0x3c')],_0x3adde7[_0x9fd6('0x3b')]);};exports[_0x9fd6('0x40')]=function(_0x47d5fb,_0x429629,_0x46ed08){_0x47d5fb[_0x9fd6('0x41')]=_0x429629;_0x47d5fb[_0x9fd6('0x42')]=_0x46ed08;};exports[_0x9fd6('0x43')]=function(_0xa0bf5b,_0x4cf4db,_0x3c9d99){var _0x10bc57=moment()[_0x9fd6('0x16')](_0x9fd6('0x38'));_0xa0bf5b[_0x9fd6('0x44')]=_0x4cf4db;_0xa0bf5b[_0x9fd6('0x39')]=_0x3c9d99;_0xa0bf5b[_0x9fd6('0x3c')]=_0xa0bf5b['responsetime']?_0xa0bf5b[_0x9fd6('0x3c')]:_0x10bc57;_0xa0bf5b[_0x9fd6('0x3d')]=_0xa0bf5b['endtime']?_0xa0bf5b[_0x9fd6('0x3d')]:_0x10bc57;_0xa0bf5b['ringtime']=getSeconds(_0xa0bf5b[_0x9fd6('0x3c')]||0x0,_0xa0bf5b[_0x9fd6('0x3b')]||0x0);_0xa0bf5b[_0x9fd6('0x45')]=_0xa0bf5b[_0x9fd6('0x46')]?getSeconds(_0xa0bf5b['endtime'],_0xa0bf5b[_0x9fd6('0x46')]):0x0;};exports[_0x9fd6('0x47')]=function(_0x3be00f){return _0x3be00f==='Failure';};exports[_0x9fd6('0x48')]=function(_0x1c1bc8,_0x51e35a,_0x420cc4,_0x1a0c47,_0x37b517){var _0x503dde=_0x1a0c47?_0x9fd6('0x49'):_0x1c1bc8[_0x9fd6('0x1b')];_0x503dde=_0x37b517?_0x9fd6('0x4a'):_0x503dde;return{'actionid':_0x1c1bc8[_0x9fd6('0x4b')],'action':_0x9fd6('0x4c'),'channel':_0x1c1bc8[_0x9fd6('0x4d')],'callerid':util['format'](_0x9fd6('0x17'),_0x503dde,_0x1c1bc8[_0x9fd6('0x4e')]),'Exten':_0x9fd6('0x28'),'Context':_0x9fd6('0x4f'),'Priority':'1','variable':_0x420cc4,'timeout':(_0x51e35a['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1c1bc8[_0x9fd6('0x4b')]};};exports[_0x9fd6('0x50')]=function(_0x1d50f3){return _0x1d50f3[_0x9fd6('0x51')]+_0x1d50f3[_0x9fd6('0x52')]+_0x1d50f3[_0x9fd6('0x53')]+_0x1d50f3[_0x9fd6('0x54')]+_0x1d50f3['countnosuchnumberretry'];};exports[_0x9fd6('0x55')]=function(_0x21cf14){var _0x17bd83=_[_0x9fd6('0x56')](_0x21cf14);_0x17bd83[_0x9fd6('0x44')]=0xf;_0x17bd83['statedesc']=_0x9fd6('0x57');return _0x17bd83;};exports['scheduledAt']=function(_0xa7f37,_0x9d0b08,_0x47e0ff){var _0x325415={};_0x325415[_0x9d0b08]=_0xa7f37[_0x9d0b08];_0x325415[_0x9fd6('0x58')]=![];_0x325415[_0x9fd6('0x59')]=moment()[_0x9fd6('0x5a')](_0x47e0ff,_0x9fd6('0x5b'))['format'](_0x9fd6('0x38'));_0x325415[_0x9fd6('0x1c')]=_0xa7f37[_0x9fd6('0x1c')];_0x325415[_0x9fd6('0x5c')]=_0xa7f37[_0x9fd6('0x5c')];_0x325415[_0x9fd6('0x1d')]=_0xa7f37['VoiceQueueId']||undefined;return _0x325415;};exports[_0x9fd6('0x5d')]=function(_0x3b9145,_0x3b9e04){if(!_[_0x9fd6('0x34')](_0x3b9145)){if(_0x3b9145['pTalking']>0x0){_0x3b9145['pTalking']-=0x1;}else{logger[_0x9fd6('0xf')](_0x3b9e04,_0x9fd6('0x5e'));}}else{logger[_0x9fd6('0xf')](_0x3b9e04,_0x9fd6('0x5f'));}};exports[_0x9fd6('0x60')]=function(_0x3576bd){if(_0x3576bd<=0x0){return!![];}return![];};exports[_0x9fd6('0x61')]=function(_0x26237a,_0x2ecd57,_0x21127e){_0x26237a[_0x9fd6('0x62')]=_0x2ecd57;_0x26237a['name']=_0x26237a['queue'];_0x26237a[_0x9fd6('0x63')]=_0x26237a[_0x9fd6('0x4d')];_0x26237a[_0x9fd6('0x64')]='voice';if(_0x21127e){_0x26237a[_0x9fd6('0x65')]=_0x21127e[_0x9fd6('0x65')];}return _0x26237a;};exports[_0x9fd6('0x66')]=function(_0x395875){var _0x353a17={};_0x353a17[_0x9fd6('0x67')]=_0x395875[_0x9fd6('0x67')];_0x353a17[_0x9fd6('0x63')]=_0x395875[_0x9fd6('0x4d')];_0x353a17[_0x9fd6('0x4b')]=_0x395875[_0x9fd6('0x4b')];return _0x353a17;};exports['agentReadyId']=function(_0x5aeb85){var _0x547aab=[];for(var _0x39e777 in _0x5aeb85){if(_0x5aeb85['hasOwnProperty'](_0x39e777)){if(!_[_0x9fd6('0x34')](_0x5aeb85[_0x39e777])&&_0x5aeb85[_0x39e777]['state']===_0x9fd6('0x68')&&_0x5aeb85[_0x39e777][_0x9fd6('0x69')]===_0x9fd6('0x6a')){_0x547aab[_0x9fd6('0x6b')](_0x5aeb85[_0x39e777]['id']);}}}return _0x547aab;};exports[_0x9fd6('0x6c')]=function(_0x646e24){var _0x9921b1=moment()[_0x9fd6('0x8')](0x0);var _0x4d39d5=moment(_0x646e24)[_0x9fd6('0x8')](0x0);return _0x9921b1[_0x9fd6('0x9')](_0x4d39d5,'seconds');};exports[_0x9fd6('0x6d')]=function(_0x2fad59){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2fad59['ContactId'],'ListId':_0x2fad59['ListId'],'VoiceQueueId':_0x2fad59[_0x9fd6('0x1d')]||undefined,'CampaignId':_0x2fad59[_0x9fd6('0x6e')]||undefined};};exports[_0x9fd6('0x6f')]=function(_0x1b3173){if(_0x1b3173==='uniqueid'||_0x1b3173===_0x9fd6('0x70')||_0x1b3173==='queue'||_0x1b3173===_0x9fd6('0x71')||_0x1b3173===_0x9fd6('0x72')||_0x1b3173==='dialAnswer'||_0x1b3173==='membername'||_0x1b3173===_0x9fd6('0x4d')||_0x1b3173===_0x9fd6('0x1b')||_0x1b3173===_0x9fd6('0x58')||_0x1b3173===_0x9fd6('0x4e')||_0x1b3173===_0x9fd6('0x59')||_0x1b3173==='countbusyretry'||_0x1b3173===_0x9fd6('0x52')||_0x1b3173==='countnoanswerretry'||_0x1b3173===_0x9fd6('0x73')||_0x1b3173===_0x9fd6('0x74')||_0x1b3173==='callbackuniqueid'||_0x1b3173===_0x9fd6('0x75')||_0x1b3173==='recallme'||_0x1b3173===_0x9fd6('0x1c')||_0x1b3173===_0x9fd6('0x5c')||_0x1b3173===_0x9fd6('0x42')||_0x1b3173===_0x9fd6('0x1d')||_0x1b3173==='sipcallid'||_0x1b3173===_0x9fd6('0x76')||_0x1b3173==='xmd-queue'||_0x1b3173===_0x9fd6('0x77')||_0x1b3173==='xmd-listid'||_0x1b3173===_0x9fd6('0x78')||_0x1b3173===_0x9fd6('0x79')||_0x1b3173===_0x9fd6('0x7a')||_0x1b3173===_0x9fd6('0x7b')||_0x1b3173===_0x9fd6('0x7c')||_0x1b3173===_0x9fd6('0x7d')||_0x1b3173===_0x9fd6('0x7e')||_0x1b3173==='xmd-callerid'||_0x1b3173===_0x9fd6('0x7f')||_0x1b3173===_0x9fd6('0x80')||_0x1b3173===_0x9fd6('0x81')||_0x1b3173==='rtpaudioqosbridged'||_0x1b3173===_0x9fd6('0x82')||_0x1b3173===_0x9fd6('0x83')||_0x1b3173==='rtpaudioqosloss'||_0x1b3173===_0x9fd6('0x84')||_0x1b3173===_0x9fd6('0x85')||_0x1b3173===_0x9fd6('0x86')||_0x1b3173===_0x9fd6('0x81')||_0x1b3173===_0x9fd6('0x87')||_0x1b3173===_0x9fd6('0x82')||_0x1b3173===_0x9fd6('0x83')||_0x1b3173===_0x9fd6('0x88')||_0x1b3173==='rtpaudioqoslossbridged'||_0x1b3173===_0x9fd6('0x85')||_0x1b3173==='rtpaudioqosrttbridged'||_0x1b3173===_0x9fd6('0x89')||_0x1b3173===_0x9fd6('0x8a')||_0x1b3173==='state'||_0x1b3173===_0x9fd6('0x39')){return![];}return!![];};exports[_0x9fd6('0x8b')]=function(_0x4a84da,_0x280953){var _0x53aa06,_0x4761d1,_0x8e0bfe;if(_0x280953<=0x0){_0x280953=0x1;}_0x53aa06=new RegExp(_0x9fd6('0x8c')+_0x280953+'}$');_0x4761d1=Math['pow'](0xa,_0x280953-0x1);_0x8e0bfe=Math[_0x9fd6('0x8d')](0xa,_0x280953)-0x1;return util[_0x9fd6('0x16')]('%s',_['replace'](_0x4a84da,_0x53aa06,_[_0x9fd6('0x8e')](_0x4761d1,_0x8e0bfe)));};exports['extractCalleridName']=function(_0x22996b){var _0x1982b7=_0x22996b[_0x9fd6('0x8f')](/"(.*?)"/);return _0x1982b7?_0x1982b7[0x1]:_0x22996b;};exports[_0x9fd6('0x90')]=function(_0x13dfc2){var _0xddca06=_0x13dfc2[_0x9fd6('0x8f')](/<(.*?)>/);return _0xddca06?_0xddca06[0x1]:_0x13dfc2;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2559d3e..7d76c7d 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 _0x4bc0=['string','number','queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd'];(function(_0x471784,_0x3c24af){var _0x11b9e2=function(_0x4d3d47){while(--_0x4d3d47){_0x471784['push'](_0x471784['shift']());}};_0x11b9e2(++_0x3c24af);}(_0x4bc0,0x1c1));var _0x04bc=function(_0xb6d8f0,_0x43be3b){_0xb6d8f0=_0xb6d8f0-0x0;var _0x1e3dc6=_0x4bc0[_0xb6d8f0];return _0x1e3dc6;};'use strict';exports[_0x04bc('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x04bc('0x1'),'required':!![]},'membername':{'type':_0x04bc('0x1'),'required':!![]},'penalty':{'type':_0x04bc('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x04bc('0x3')]={'queue':{'type':_0x04bc('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x04bc('0x4')]={'interface':{'type':_0x04bc('0x1'),'required':!![]},'paused':{'type':_0x04bc('0x5')},'reason':{'type':_0x04bc('0x1'),'required':![]}};exports[_0x04bc('0x6')]={'module':{'type':_0x04bc('0x1'),'required':![]}};exports[_0x04bc('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x04bc('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x04bc('0x1')},'format':{'type':_0x04bc('0x1')},'mixmonitorid':{'type':_0x04bc('0x1')}};exports[_0x04bc('0x9')]={'uniqueid':{'type':_0x04bc('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x04bc('0x1')}}; \ No newline at end of file +var _0xdbeb=['string','boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x3a7a8a,_0x1dd9a3){var _0x155607=function(_0x3c761c){while(--_0x3c761c){_0x3a7a8a['push'](_0x3a7a8a['shift']());}};_0x155607(++_0x1dd9a3);}(_0xdbeb,0xa0));var _0xbdbe=function(_0x3f5f3d,_0x397bfd){_0x3f5f3d=_0x3f5f3d-0x0;var _0x3b5f3c=_0xdbeb[_0x3f5f3d];return _0x3b5f3c;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbdbe('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xbdbe('0x1'),'required':![]}};exports[_0xbdbe('0x2')]={'queue':{'type':_0xbdbe('0x0'),'required':!![]},'interface':{'type':_0xbdbe('0x0'),'required':!![]}};exports[_0xbdbe('0x3')]={'interface':{'type':_0xbdbe('0x0'),'required':!![]},'paused':{'type':_0xbdbe('0x1')},'reason':{'type':'string','required':![]}};exports[_0xbdbe('0x4')]={'module':{'type':_0xbdbe('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbdbe('0x0'),'required':!![]}};exports[_0xbdbe('0x5')]={'uniqueid':{'type':_0xbdbe('0x0'),'required':!![]},'filename':{'type':_0xbdbe('0x0')},'format':{'type':_0xbdbe('0x0')},'mixmonitorid':{'type':'string'}};exports[_0xbdbe('0x6')]={'uniqueid':{'type':_0xbdbe('0x0'),'required':!![]}};exports[_0xbdbe('0x7')]={'uniqueid':{'type':_0xbdbe('0x0'),'required':!![]},'exten':{'type':_0xbdbe('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index d7ca598..1113cb0 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 _0xd33f=['sumDuration','queuecallercompleteAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/voiceExtension','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','SIP/%s','name','isNil','format','total','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','interface','initTelephones','isUndefined','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds'];(function(_0xff852b,_0x1b2e88){var _0x1f024c=function(_0x40f4ba){while(--_0x40f4ba){_0xff852b['push'](_0xff852b['shift']());}};_0x1f024c(++_0x1b2e88);}(_0xd33f,0xe3));var _0xfd33=function(_0x4ce4ae,_0x327b0c){_0x4ce4ae=_0x4ce4ae-0x0;var _0x3ca28e=_0xd33f[_0x4ce4ae];return _0x3ca28e;};'use strict';var BPromise=require(_0xfd33('0x0'));var util=require(_0xfd33('0x1'));var _=require(_0xfd33('0x2'));var moment=require(_0xfd33('0x3'));var Agent=require(_0xfd33('0x4'));var Telephone=require(_0xfd33('0x5'));var Trunk=require(_0xfd33('0x6'));var VoiceQueue=require(_0xfd33('0x7'));var Trigger=require('../model/trigger');var Template=require(_0xfd33('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xfd33('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xfd33('0xa'));var SugarcrmAccount=require(_0xfd33('0xb'));var ZohoAccount=require(_0xfd33('0xc'));var DeskAccount=require(_0xfd33('0xd'));var VtigerAccount=require(_0xfd33('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xfd33('0xf'));var FreshsalesAccount=require(_0xfd33('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xfd33('0x11')]={};this[_0xfd33('0x12')]={};this[_0xfd33('0x13')]={};this['voiceQueues']={};this[_0xfd33('0x14')]={};this[_0xfd33('0x15')]={};this[_0xfd33('0x16')]={};this[_0xfd33('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xfd33('0x18')]={};this['channels']={};this[_0xfd33('0x19')]={};this[_0xfd33('0x1a')]={};this[_0xfd33('0x1b')]={};this[_0xfd33('0x1c')]={};this[_0xfd33('0x1d')]={};this[_0xfd33('0x1e')]={};this[_0xfd33('0x1f')]={};this['freshdeskAccounts']={};this[_0xfd33('0x20')]={};this[_0xfd33('0x21')]={};this[_0xfd33('0x22')]={};this['servicenowAccounts']={};this[_0xfd33('0x23')]={};this['freshsalesAccounts']={};this[_0xfd33('0x24')]={};};function freeIsNotKey(_0x473c4e,_0x2e7229,_0x1b168c){var _0x1bad20=_['mapKeys'](_0x473c4e,function(_0x4f59be,_0x194bb3){return _0x4f59be[_0x1b168c];});for(var _0x1fb17a in _0x2e7229){if(_0x2e7229[_0xfd33('0x25')](_0x1fb17a)){if(!_0x1bad20[_0x1fb17a]){delete _0x2e7229[_0x1fb17a];}}}}function freeIsNotKeySip(_0x104626,_0x5cb42b){var _0x520690=_[_0xfd33('0x26')](_0x104626,function(_0x174d88,_0x5ea891){return util['format'](_0xfd33('0x27'),_0x174d88[_0xfd33('0x28')]);});for(var _0x6f2cbb in _0x5cb42b){if(_0x5cb42b[_0xfd33('0x25')](_0x6f2cbb)){if(!_0x520690[_0x6f2cbb]){delete _0x5cb42b[_0x6f2cbb];}}}}function freeIsNotKeyAgent(_0xd87d3c,_0x3234be){var _0x4a0149=_[_0xfd33('0x26')](_0xd87d3c,function(_0xe1646a,_0x1fffd0){var _0x25cd9c=_[_0xfd33('0x29')](_0xe1646a['interface'])?util[_0xfd33('0x2a')](_0xfd33('0x27'),_0xe1646a[_0xfd33('0x28')]):_0xe1646a['interface'];return _0x25cd9c;});for(var _0xa7f2e6 in _0x3234be){if(_0x3234be[_0xfd33('0x25')](_0xa7f2e6)){if(!_0x4a0149[_0xa7f2e6]){delete _0x3234be[_0xa7f2e6];}}}}function clearVoiceCallReports(_0x479389){_0x479389[_0xfd33('0x2b')]=0x0;_0x479389['answered']=0x0;_0x479389['sumHoldTime']=0x0;_0x479389['sumDuration']=0x0;_0x479389[_0xfd33('0x2c')]=0x0;}function clearCampaigns(_0x308bf4){if(!_[_0xfd33('0x2d')](_0x308bf4)){for(var _0x4981a9 in _0x308bf4){if(_0x308bf4[_0xfd33('0x25')](_0x4981a9)){_0x308bf4[_0x4981a9][_0xfd33('0x2e')]=0x0;_0x308bf4[_0x4981a9]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x95f2ca){if(!_[_0xfd33('0x2d')](_0x95f2ca)){for(var _0xad1ad3 in _0x95f2ca){if(_0x95f2ca[_0xfd33('0x25')](_0xad1ad3)){_0x95f2ca[_0xad1ad3]['total']=0x0;_0x95f2ca[_0xad1ad3]['answered']=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x2f')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x30')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x31')]=0x0;_0x95f2ca[_0xad1ad3]['sumDuration']=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x2c')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x32')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x33')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x34')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x35')]=0x0;_0x95f2ca[_0xad1ad3]['outboundNoSuchCallsDay']=0x0;_0x95f2ca[_0xad1ad3]['outboundUnknownCallsDay']=0x0;_0x95f2ca[_0xad1ad3]['outboundDropCallsDayTimeout']=0x0;_0x95f2ca[_0xad1ad3]['outboundDropCallsDayCallersExit']=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x36')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x37')]=0x0;_0x95f2ca[_0xad1ad3]['outboundRejectCallsDay']=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x38')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x32')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x39')]=0x0;_0x95f2ca[_0xad1ad3][_0xfd33('0x3a')]=!![];}}}}Realtime[_0xfd33('0x3b')][_0xfd33('0x3c')]=function(_0x47ecb6,_0x40a322){for(var _0x61cd95 in _0x40a322){if(_0x47ecb6[_0xfd33('0x25')](_0x61cd95)){_0x47ecb6[_0x61cd95]=_0x40a322[_0x61cd95];}}};Realtime[_0xfd33('0x3b')][_0xfd33('0x3d')]=function(){var _0x1d1b3a=this;return function(_0x3fb4c1){if(_0x3fb4c1){freeIsNotKeyAgent(_0x3fb4c1,_0x1d1b3a[_0xfd33('0x11')]);for(var _0xf99c8f=0x0,_0x4d7aaa={},_0x2e0c2d={};_0xf99c8f<_0x3fb4c1[_0xfd33('0x3e')];_0xf99c8f+=0x1){_0x4d7aaa=_0x3fb4c1[_0xf99c8f];var _0x32d993=_['isNil'](_0x4d7aaa[_0xfd33('0x3f')])?util[_0xfd33('0x2a')](_0xfd33('0x27'),_0x4d7aaa[_0xfd33('0x28')]):_0x4d7aaa[_0xfd33('0x3f')];if(_['isUndefined'](_0x1d1b3a[_0xfd33('0x11')][_0x32d993])){_0x1d1b3a[_0xfd33('0x11')][_0x32d993]=new Agent(_0x4d7aaa);}else{_0x1d1b3a['mergeFromDatabase'](_0x1d1b3a['agents'][_0x32d993],_0x4d7aaa);}}}return _0x1d1b3a[_0xfd33('0x11')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x40')]=function(){var _0x13c0ce=this;return function(_0x2acb4c){if(_0x2acb4c){freeIsNotKeySip(_0x2acb4c,_0x13c0ce['telephones']);for(var _0x18ed21=0x0,_0x57d0f2={},_0x5913f7={};_0x18ed21<_0x2acb4c['length'];_0x18ed21+=0x1){_0x57d0f2=_0x2acb4c[_0x18ed21];if(_[_0xfd33('0x41')](_0x13c0ce[_0xfd33('0x12')][util[_0xfd33('0x2a')](_0xfd33('0x27'),_0x57d0f2[_0xfd33('0x28')])])){_0x13c0ce[_0xfd33('0x12')][util[_0xfd33('0x2a')](_0xfd33('0x27'),_0x57d0f2['name'])]=new Telephone(_0x57d0f2);}else{_0x13c0ce[_0xfd33('0x3c')](_0x13c0ce['telephones'][util[_0xfd33('0x2a')](_0xfd33('0x27'),_0x57d0f2['name'])],_0x57d0f2);}}}return _0x13c0ce[_0xfd33('0x12')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x42')]=function(){var _0x98b385=this;return function(_0x3538de){if(_0x3538de){freeIsNotKeySip(_0x3538de,_0x98b385['trunks']);for(var _0x54fad7=0x0,_0x3f79ee={},_0x503fa4={};_0x54fad7<_0x3538de[_0xfd33('0x3e')];_0x54fad7+=0x1){_0x3f79ee=_0x3538de[_0x54fad7];if(_[_0xfd33('0x41')](_0x98b385[_0xfd33('0x13')][util[_0xfd33('0x2a')](_0xfd33('0x27'),_0x3f79ee[_0xfd33('0x28')])])){_0x98b385[_0xfd33('0x13')][util['format'](_0xfd33('0x27'),_0x3f79ee[_0xfd33('0x28')])]=new Trunk(_0x3f79ee);}else{_0x98b385[_0xfd33('0x3c')](_0x98b385[_0xfd33('0x13')][util[_0xfd33('0x2a')](_0xfd33('0x27'),_0x3f79ee[_0xfd33('0x28')])],_0x3f79ee);}}}return _0x98b385['trunks'];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x43')]=function(){var _0x3e5496=this;return function(_0xe07efe){if(_0xe07efe){freeIsNotKey(_0xe07efe,_0x3e5496[_0xfd33('0x44')],_0xfd33('0x28'));for(var _0x2e7282=0x0,_0x50bab0={},_0x573269={};_0x2e7282<_0xe07efe[_0xfd33('0x3e')];_0x2e7282+=0x1){_0x50bab0=_0xe07efe[_0x2e7282];if(_[_0xfd33('0x41')](_0x3e5496[_0xfd33('0x44')][_0x50bab0[_0xfd33('0x28')]])){_0x3e5496[_0xfd33('0x44')][_0x50bab0[_0xfd33('0x28')]]=new VoiceQueue(_0x50bab0);}else{_0x3e5496['mergeFromDatabase'](_0x3e5496[_0xfd33('0x44')][_0x50bab0['name']],_0x50bab0);}}}return _0x3e5496[_0xfd33('0x44')];};};Realtime['prototype'][_0xfd33('0x45')]=function(){var _0x765469=this;return function(_0x108671){if(_0x108671){freeIsNotKey(_0x108671,_0x765469[_0xfd33('0x14')],'id');for(var _0x3a1868=0x0,_0x3fa167={},_0x24ad5a={};_0x3a1868<_0x108671[_0xfd33('0x3e')];_0x3a1868+=0x1){_0x3fa167=_0x108671[_0x3a1868];if(_[_0xfd33('0x41')](_0x765469[_0xfd33('0x14')][_0x3fa167['id']])){_0x765469[_0xfd33('0x14')][_0x3fa167['id']]=new Trigger(_0x3fa167);}else{_0x765469[_0xfd33('0x3c')](_0x765469[_0xfd33('0x14')][_0x3fa167['id']],_0x3fa167);}}}return _0x765469[_0xfd33('0x14')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x46')]=function(){var _0x54fd97=this;return function(_0x10f2f2){if(_0x10f2f2){freeIsNotKey(_0x10f2f2,_0x54fd97[_0xfd33('0x16')],'id');for(var _0x4a9c93=0x0,_0x397fb7={},_0x281efe={};_0x4a9c93<_0x10f2f2[_0xfd33('0x3e')];_0x4a9c93+=0x1){_0x397fb7=_0x10f2f2[_0x4a9c93];if(_[_0xfd33('0x41')](_0x54fd97[_0xfd33('0x16')][_0x397fb7['id']])){_0x54fd97[_0xfd33('0x16')][_0x397fb7['id']]=new Template(_0x397fb7);}else{_0x54fd97[_0xfd33('0x3c')](_0x54fd97['templates'][_0x397fb7['id']],_0x397fb7);}}}return _0x54fd97['templates'];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x47')]=function(){var _0x5a3326=this;return function(_0x32d658){if(_0x32d658){freeIsNotKey(_0x32d658,_0x5a3326[_0xfd33('0x1d')],'id');for(var _0x68c15c=0x0,_0x4d6dab={},_0x5f0a11={};_0x68c15c<_0x32d658[_0xfd33('0x3e')];_0x68c15c+=0x1){_0x4d6dab=_0x32d658[_0x68c15c];if(_['isUndefined'](_0x5a3326[_0xfd33('0x1d')][_0x4d6dab['id']])){_0x5a3326['zendeskAccounts'][_0x4d6dab['id']]=new ZendeskAccount(_0x4d6dab);}else{_0x5a3326[_0xfd33('0x3c')](_0x5a3326['zendeskAccounts'][_0x4d6dab['id']],_0x4d6dab);}}}return _0x5a3326[_0xfd33('0x1d')];};};Realtime['prototype'][_0xfd33('0x48')]=function(){var _0x245f25=this;return function(_0x34fcc3){if(_0x34fcc3){freeIsNotKey(_0x34fcc3,_0x245f25[_0xfd33('0x1e')],'id');for(var _0x24b7ed=0x0,_0x3d08a5={},_0x279574={};_0x24b7ed<_0x34fcc3[_0xfd33('0x3e')];_0x24b7ed+=0x1){_0x3d08a5=_0x34fcc3[_0x24b7ed];if(_[_0xfd33('0x41')](_0x245f25['salesforceAccounts'][_0x3d08a5['id']])){_0x245f25[_0xfd33('0x1e')][_0x3d08a5['id']]=new SalesforceAccount(_0x3d08a5);}else{_0x245f25[_0xfd33('0x3c')](_0x245f25[_0xfd33('0x1e')][_0x3d08a5['id']],_0x3d08a5);}}}return _0x245f25[_0xfd33('0x1e')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x49')]=function(){var _0x2dc9fd=this;return function(_0xb3cbc9){if(_0xb3cbc9){freeIsNotKey(_0xb3cbc9,_0x2dc9fd[_0xfd33('0x4a')],'id');for(var _0x6d7f56=0x0,_0x5b54fc={},_0x3cb2d8={};_0x6d7f56<_0xb3cbc9[_0xfd33('0x3e')];_0x6d7f56+=0x1){_0x5b54fc=_0xb3cbc9[_0x6d7f56];if(_[_0xfd33('0x41')](_0x2dc9fd['freshdeskAccounts'][_0x5b54fc['id']])){_0x2dc9fd[_0xfd33('0x4a')][_0x5b54fc['id']]=new FreshdeskAccount(_0x5b54fc);}else{_0x2dc9fd[_0xfd33('0x3c')](_0x2dc9fd['freshdeskAccounts'][_0x5b54fc['id']],_0x5b54fc);}}}return _0x2dc9fd[_0xfd33('0x4a')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x74ba54=this;return function(_0x568ace){if(_0x568ace){freeIsNotKey(_0x568ace,_0x74ba54['zohoAccounts'],'id');for(var _0x3e1262=0x0,_0x1889ee={},_0xceca04={};_0x3e1262<_0x568ace[_0xfd33('0x3e')];_0x3e1262+=0x1){_0x1889ee=_0x568ace[_0x3e1262];if(_[_0xfd33('0x41')](_0x74ba54[_0xfd33('0x20')][_0x1889ee['id']])){_0x74ba54[_0xfd33('0x20')][_0x1889ee['id']]=new ZohoAccount(_0x1889ee);}else{_0x74ba54['mergeFromDatabase'](_0x74ba54[_0xfd33('0x20')][_0x1889ee['id']],_0x1889ee);}}}return _0x74ba54[_0xfd33('0x20')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x4b')]=function(){var _0x3d9d4a=this;return function(_0x465cb7){if(_0x465cb7){freeIsNotKey(_0x465cb7,_0x3d9d4a[_0xfd33('0x21')],'id');for(var _0x5a76ea=0x0,_0x1d7a23={},_0x207c9f={};_0x5a76ea<_0x465cb7[_0xfd33('0x3e')];_0x5a76ea+=0x1){_0x1d7a23=_0x465cb7[_0x5a76ea];if(_[_0xfd33('0x41')](_0x3d9d4a[_0xfd33('0x21')][_0x1d7a23['id']])){_0x3d9d4a['deskAccounts'][_0x1d7a23['id']]=new DeskAccount(_0x1d7a23);}else{_0x3d9d4a['mergeFromDatabase'](_0x3d9d4a[_0xfd33('0x21')][_0x1d7a23['id']],_0x1d7a23);}}}return _0x3d9d4a['deskAccounts'];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x4c')]=function(){var _0x507548=this;return function(_0xf8d36c){if(_0xf8d36c){freeIsNotKey(_0xf8d36c,_0x507548['sugarcrmAccounts'],'id');for(var _0x45aaad=0x0,_0x2b79a3={},_0xb90fa2={};_0x45aaad<_0xf8d36c[_0xfd33('0x3e')];_0x45aaad+=0x1){_0x2b79a3=_0xf8d36c[_0x45aaad];if(_[_0xfd33('0x41')](_0x507548[_0xfd33('0x1f')][_0x2b79a3['id']])){_0x507548[_0xfd33('0x1f')][_0x2b79a3['id']]=new SugarcrmAccount(_0x2b79a3);}else{_0x507548[_0xfd33('0x3c')](_0x507548[_0xfd33('0x1f')][_0x2b79a3['id']],_0x2b79a3);}}}return _0x507548[_0xfd33('0x1f')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x4d')]=function(){var _0x2231cb=this;return function(_0x4bf823){if(_0x4bf823){freeIsNotKey(_0x4bf823,_0x2231cb['vtigerAccounts'],'id');for(var _0x547641=0x0,_0x5dccf6={},_0x4ade7f={};_0x547641<_0x4bf823[_0xfd33('0x3e')];_0x547641+=0x1){_0x5dccf6=_0x4bf823[_0x547641];if(_['isUndefined'](_0x2231cb['vtigerAccounts'][_0x5dccf6['id']])){_0x2231cb[_0xfd33('0x22')][_0x5dccf6['id']]=new VtigerAccount(_0x5dccf6);}else{_0x2231cb[_0xfd33('0x3c')](_0x2231cb[_0xfd33('0x22')][_0x5dccf6['id']],_0x5dccf6);}}}return _0x2231cb[_0xfd33('0x22')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x4e')]=function(){var _0x5d04d7=this;return function(_0x31d698){if(_0x31d698){freeIsNotKey(_0x31d698,_0x5d04d7[_0xfd33('0x4f')],'id');for(var _0x5382c5=0x0,_0x175756={},_0x228326={};_0x5382c5<_0x31d698[_0xfd33('0x3e')];_0x5382c5+=0x1){_0x175756=_0x31d698[_0x5382c5];if(_[_0xfd33('0x41')](_0x5d04d7['servicenowAccounts'][_0x175756['id']])){_0x5d04d7[_0xfd33('0x4f')][_0x175756['id']]=new ServicenowAccount(_0x175756);}else{_0x5d04d7[_0xfd33('0x3c')](_0x5d04d7[_0xfd33('0x4f')][_0x175756['id']],_0x175756);}}}return _0x5d04d7['servicenowAccounts'];};};Realtime['prototype'][_0xfd33('0x50')]=function(){var _0x18ccc8=this;return function(_0x5af04f){if(_0x5af04f){freeIsNotKey(_0x5af04f,_0x18ccc8['dynamics365Accounts'],'id');for(var _0x5e8751=0x0,_0x214a99={},_0x551eb8={};_0x5e8751<_0x5af04f['length'];_0x5e8751+=0x1){_0x214a99=_0x5af04f[_0x5e8751];if(_[_0xfd33('0x41')](_0x18ccc8[_0xfd33('0x23')][_0x214a99['id']])){_0x18ccc8['dynamics365Accounts'][_0x214a99['id']]=new Dynamics365Account(_0x214a99);}else{_0x18ccc8[_0xfd33('0x3c')](_0x18ccc8[_0xfd33('0x23')][_0x214a99['id']],_0x214a99);}}}return _0x18ccc8['dynamics365Accounts'];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x51')]=function(){var _0x1b4d74=this;return function(_0x1db4c2){if(_0x1db4c2){freeIsNotKey(_0x1db4c2,_0x1b4d74['freshsalesAccounts'],'id');for(var _0x145e07=0x0,_0x4dac3e={},_0x4686b7={};_0x145e07<_0x1db4c2['length'];_0x145e07+=0x1){_0x4dac3e=_0x1db4c2[_0x145e07];if(_[_0xfd33('0x41')](_0x1b4d74[_0xfd33('0x52')][_0x4dac3e['id']])){_0x1b4d74[_0xfd33('0x52')][_0x4dac3e['id']]=new FreshsalesAccount(_0x4dac3e);}else{_0x1b4d74[_0xfd33('0x3c')](_0x1b4d74[_0xfd33('0x52')][_0x4dac3e['id']],_0x4dac3e);}}}return _0x1b4d74[_0xfd33('0x52')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x1f76ce=this;return function(_0x2db04c){for(var _0xdc633c=0x0;_0xdc633c<_0x2db04c['length'];_0xdc633c+=0x1){_['merge'](_0x1f76ce['voiceQueues'][_0x2db04c[_0xdc633c][_0xfd33('0x28')]],_0x2db04c[_0xdc633c]);}return _0x1f76ce['voiceQueues'];};};Realtime['prototype'][_0xfd33('0x53')]=function(){var _0x361aee=this;return function(_0x1058c6){clearVoiceQueues(_0x361aee[_0xfd33('0x44')]);if(_0x1058c6){_0x1058c6=_[_0xfd33('0x54')](_0x1058c6,'uniqueid');for(var _0x3dddf8 in _0x1058c6){if(_0x1058c6[_0xfd33('0x25')](_0x3dddf8)){var _0x56b1ed={};for(var _0x332620=0x0;_0x332620<_0x1058c6[_0x3dddf8][_0xfd33('0x3e')];_0x332620+=0x1){var _0x2a1b90=_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x55')];if(_0x361aee['voiceQueues'][_0x2a1b90]){if(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x56')]){_0x361aee[_0xfd33('0x44')][_0x2a1b90][_0xfd33('0x2f')]+=0x1;}if(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x57')]){_0x361aee[_0xfd33('0x44')][_0x2a1b90][_0xfd33('0x30')]+=0x1;}_0x361aee[_0xfd33('0x44')][_0x2a1b90][_0xfd33('0x31')]+=moment(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x58')])['diff'](moment(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x59')]),_0xfd33('0x5a'))||0x0;if(_0x332620===_0x1058c6[_0x3dddf8][_0xfd33('0x3e')]-0x1){_0x361aee[_0xfd33('0x44')][_0x2a1b90][_0xfd33('0x5b')]+=moment(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x5c')]||_0x1058c6[_0x3dddf8][_0x332620]['queuecallerabandonAt']||_0x1058c6[_0x3dddf8][_0x332620]['queuecallerexitAt'])[_0xfd33('0x5d')](moment(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x59')]),_0xfd33('0x5a'))||0x0;_0x361aee['voiceQueues'][_0x2a1b90][_0xfd33('0x2b')]+=0x1;if(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x5e')]){_0x361aee[_0xfd33('0x44')][_0x2a1b90][_0xfd33('0x5f')]+=0x1;_0x361aee[_0xfd33('0x44')][_0x2a1b90][_0xfd33('0x2c')]+=moment(_0x1058c6[_0x3dddf8][_0x332620][_0xfd33('0x5c')])['diff'](moment(_0x1058c6[_0x3dddf8][_0x332620]['queuecallerleaveAt']),_0xfd33('0x5a'))||0x0;}}else{_0x361aee[_0xfd33('0x44')][_0x2a1b90]['sumDuration']+=_0x361aee[_0xfd33('0x44')][_0x2a1b90]['sumHoldTime']||0x0;}}}}}}return _0x361aee[_0xfd33('0x44')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x60')]=function(){var _0x4e5b81=this;return function(_0x384638){clearVoiceCallReports(_0x4e5b81[_0xfd33('0x17')]);if(_0x384638){for(var _0x1809b6=0x0;_0x1809b6<_0x384638[_0xfd33('0x3e')];_0x1809b6+=0x1){_0x4e5b81[_0xfd33('0x17')][_0xfd33('0x2b')]+=0x1;_0x4e5b81[_0xfd33('0x17')]['sumDuration']+=_0x384638[_0x1809b6][_0xfd33('0x61')];if(_0x384638[_0x1809b6]['disposition']===_0xfd33('0x62')){_0x4e5b81[_0xfd33('0x17')][_0xfd33('0x5f')]+=0x1;_0x4e5b81[_0xfd33('0x17')][_0xfd33('0x31')]+=_0x384638[_0x1809b6][_0xfd33('0x61')]-_0x384638[_0x1809b6][_0xfd33('0x63')]||0x0;_0x4e5b81['outbound'][_0xfd33('0x2c')]+=_0x384638[_0x1809b6][_0xfd33('0x63')];}}}return _0x4e5b81[_0xfd33('0x17')];};};Realtime['prototype'][_0xfd33('0x64')]=function(){var _0x5c395d=this;return function(_0x2a0543){if(_0x2a0543){freeIsNotKey(_0x2a0543,_0x5c395d[_0xfd33('0x15')],'name');for(var _0xa9bce=0x0,_0x402d5c={};_0xa9bce<_0x2a0543['length'];_0xa9bce+=0x1){_0x402d5c=_0x2a0543[_0xa9bce];if(_['isUndefined'](_0x5c395d[_0xfd33('0x15')][_0x402d5c['name']])){_0x5c395d[_0xfd33('0x15')][_0x402d5c[_0xfd33('0x28')]]=new Campaign(_0x402d5c);}else{_0x5c395d[_0xfd33('0x3c')](_0x5c395d[_0xfd33('0x15')][_0x402d5c['name']],_0x402d5c);_0x5c395d[_0xfd33('0x15')][_0x402d5c[_0xfd33('0x28')]][_0xfd33('0x65')]=_0x402d5c['SquareProject']?_0x402d5c['SquareProject']['name']:undefined;}}}return _0x5c395d[_0xfd33('0x15')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x66')]=function(){var _0x36ae62=this;return function(_0x7504fe){if(_0x7504fe){freeIsNotKey(_0x7504fe,_0x36ae62[_0xfd33('0x18')],'id');for(var _0xae3a98=0x0,_0x15a52a={};_0xae3a98<_0x7504fe[_0xfd33('0x3e')];_0xae3a98+=0x1){_0x15a52a=_0x7504fe[_0xae3a98];if(_['isUndefined'](_0x36ae62[_0xfd33('0x18')][_0x15a52a['id']])){_0x36ae62[_0xfd33('0x18')][_0x15a52a['id']]=new VoiceExtension(_0x15a52a);}else{_0x36ae62['mergeFromDatabase'](_0x36ae62['voiceExtensions'][_0x15a52a['id']],_0x15a52a);}}}return _0x36ae62[_0xfd33('0x18')];};};Realtime[_0xfd33('0x3b')][_0xfd33('0x67')]=function(){var _0x31b30f=this;return function(_0x477f2e){clearCampaigns(_0x31b30f[_0xfd33('0x15')]);for(var _0x3e5eb7=0x0;_0x3e5eb7<_0x477f2e[_0xfd33('0x3e')];_0x3e5eb7+=0x1){_[_0xfd33('0x68')](_0x31b30f[_0xfd33('0x15')][_0x477f2e[_0x3e5eb7][_0xfd33('0x28')]],_0x477f2e[_0x3e5eb7]);}return _0x31b30f[_0xfd33('0x15')];};};Realtime[_0xfd33('0x3b')]['initFaxAccounts']=function(){var _0x125c27=this;return function(_0xeea512){if(_0xeea512){freeIsNotKey(_0xeea512,_0x125c27[_0xfd33('0x24')],'id');for(var _0x380faf=0x0,_0x593912={},_0x236d66={};_0x380faf<_0xeea512['length'];_0x380faf+=0x1){_0x593912=_0xeea512[_0x380faf];if(_[_0xfd33('0x41')](_0x125c27[_0xfd33('0x24')][_0x593912['id']])){_0x125c27[_0xfd33('0x24')][_0x593912['id']]=new FaxAccount(_0x593912);}else{_0x125c27[_0xfd33('0x3c')](_0x125c27['faxAccounts'][_0x593912['id']],_0x593912);}}}return _0x125c27[_0xfd33('0x24')];};};module[_0xfd33('0x69')]=Realtime; \ No newline at end of file +var _0xb9d0=['sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','initTrunks','initVoiceQueues','length','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','util','lodash','moment','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','queueChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','answered','sumDuration'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xb9d0,0xa9));var _0x0b9d=function(_0x464a22,_0xd3aa7b){_0x464a22=_0x464a22-0x0;var _0x38ec36=_0xb9d0[_0x464a22];return _0x38ec36;};'use strict';var BPromise=require('bluebird');var util=require(_0x0b9d('0x0'));var _=require(_0x0b9d('0x1'));var moment=require(_0x0b9d('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x0b9d('0x3'));var Trunk=require(_0x0b9d('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x0b9d('0x5'));var Template=require(_0x0b9d('0x6'));var Campaign=require(_0x0b9d('0x7'));var VoiceExtension=require(_0x0b9d('0x8'));var ZendeskAccount=require(_0x0b9d('0x9'));var SalesforceAccount=require(_0x0b9d('0xa'));var FreshdeskAccount=require(_0x0b9d('0xb'));var SugarcrmAccount=require(_0x0b9d('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x0b9d('0xd'));var ServicenowAccount=require(_0x0b9d('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x0b9d('0xf')]={};this[_0x0b9d('0x10')]={};this[_0x0b9d('0x11')]={};this[_0x0b9d('0x12')]={};this[_0x0b9d('0x13')]={};this[_0x0b9d('0x14')]={};this['templates']={};this[_0x0b9d('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x0b9d('0x16')]={};this['channels']={};this[_0x0b9d('0x17')]={};this['outboundChannels']={};this[_0x0b9d('0x18')]={};this['settings']={};this[_0x0b9d('0x19')]={};this[_0x0b9d('0x1a')]={};this['sugarcrmAccounts']={};this[_0x0b9d('0x1b')]={};this[_0x0b9d('0x1c')]={};this[_0x0b9d('0x1d')]={};this[_0x0b9d('0x1e')]={};this[_0x0b9d('0x1f')]={};this[_0x0b9d('0x20')]={};this[_0x0b9d('0x21')]={};this['faxAccounts']={};};function freeIsNotKey(_0x47912c,_0x45ad0,_0x4d36b){var _0x3c3cb2=_[_0x0b9d('0x22')](_0x47912c,function(_0x3cc8f3,_0x36a838){return _0x3cc8f3[_0x4d36b];});for(var _0x4265fc in _0x45ad0){if(_0x45ad0[_0x0b9d('0x23')](_0x4265fc)){if(!_0x3c3cb2[_0x4265fc]){delete _0x45ad0[_0x4265fc];}}}}function freeIsNotKeySip(_0x4fe1b4,_0x4e943c){var _0x38629b=_[_0x0b9d('0x22')](_0x4fe1b4,function(_0x4c715d,_0x49e4d0){return util[_0x0b9d('0x24')](_0x0b9d('0x25'),_0x4c715d[_0x0b9d('0x26')]);});for(var _0x3fc280 in _0x4e943c){if(_0x4e943c[_0x0b9d('0x23')](_0x3fc280)){if(!_0x38629b[_0x3fc280]){delete _0x4e943c[_0x3fc280];}}}}function freeIsNotKeyAgent(_0x24ee6c,_0x199fdf){var _0x7466c0=_[_0x0b9d('0x22')](_0x24ee6c,function(_0xe6ae21,_0x4a7374){var _0x52603c=_[_0x0b9d('0x27')](_0xe6ae21[_0x0b9d('0x28')])?util[_0x0b9d('0x24')](_0x0b9d('0x25'),_0xe6ae21[_0x0b9d('0x26')]):_0xe6ae21[_0x0b9d('0x28')];return _0x52603c;});for(var _0x4ad60c in _0x199fdf){if(_0x199fdf[_0x0b9d('0x23')](_0x4ad60c)){if(!_0x7466c0[_0x4ad60c]){delete _0x199fdf[_0x4ad60c];}}}}function clearVoiceCallReports(_0xc7ff00){_0xc7ff00['total']=0x0;_0xc7ff00[_0x0b9d('0x29')]=0x0;_0xc7ff00['sumHoldTime']=0x0;_0xc7ff00[_0x0b9d('0x2a')]=0x0;_0xc7ff00[_0x0b9d('0x2b')]=0x0;}function clearCampaigns(_0x3dcda8){if(!_[_0x0b9d('0x2c')](_0x3dcda8)){for(var _0x412384 in _0x3dcda8){if(_0x3dcda8[_0x0b9d('0x23')](_0x412384)){_0x3dcda8[_0x412384][_0x0b9d('0x2d')]=0x0;_0x3dcda8[_0x412384][_0x0b9d('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x520195){if(!_[_0x0b9d('0x2c')](_0x520195)){for(var _0x424d48 in _0x520195){if(_0x520195[_0x0b9d('0x23')](_0x424d48)){_0x520195[_0x424d48][_0x0b9d('0x2f')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x29')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x30')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x31')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x32')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x2a')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x2b')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x33')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x34')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x35')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x36')]=0x0;_0x520195[_0x424d48]['outboundNoSuchCallsDay']=0x0;_0x520195[_0x424d48]['outboundUnknownCallsDay']=0x0;_0x520195[_0x424d48][_0x0b9d('0x37')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x38')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x39')]=0x0;_0x520195[_0x424d48]['outboundOriginateFailureCallsDay']=0x0;_0x520195[_0x424d48][_0x0b9d('0x3a')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x3b')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x33')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x3c')]=0x0;_0x520195[_0x424d48][_0x0b9d('0x3d')]=!![];}}}}Realtime[_0x0b9d('0x3e')][_0x0b9d('0x3f')]=function(_0x18157e,_0x1816a0){for(var _0x25f910 in _0x1816a0){if(_0x18157e[_0x0b9d('0x23')](_0x25f910)){_0x18157e[_0x25f910]=_0x1816a0[_0x25f910];}}};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x40')]=function(){var _0x5e5b79=this;return function(_0x4be1be){if(_0x4be1be){freeIsNotKeyAgent(_0x4be1be,_0x5e5b79[_0x0b9d('0xf')]);for(var _0xc139ae=0x0,_0x3417b8={},_0x47f714={};_0xc139ae<_0x4be1be['length'];_0xc139ae+=0x1){_0x3417b8=_0x4be1be[_0xc139ae];var _0x414cf9=_[_0x0b9d('0x27')](_0x3417b8[_0x0b9d('0x28')])?util[_0x0b9d('0x24')]('SIP/%s',_0x3417b8[_0x0b9d('0x26')]):_0x3417b8[_0x0b9d('0x28')];if(_[_0x0b9d('0x41')](_0x5e5b79[_0x0b9d('0xf')][_0x414cf9])){_0x5e5b79[_0x0b9d('0xf')][_0x414cf9]=new Agent(_0x3417b8);}else{_0x5e5b79[_0x0b9d('0x3f')](_0x5e5b79[_0x0b9d('0xf')][_0x414cf9],_0x3417b8);}}}return _0x5e5b79['agents'];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x42')]=function(){var _0x369c76=this;return function(_0x139461){if(_0x139461){freeIsNotKeySip(_0x139461,_0x369c76[_0x0b9d('0x10')]);for(var _0x491963=0x0,_0xf401d4={},_0x33ca8f={};_0x491963<_0x139461['length'];_0x491963+=0x1){_0xf401d4=_0x139461[_0x491963];if(_[_0x0b9d('0x41')](_0x369c76[_0x0b9d('0x10')][util[_0x0b9d('0x24')]('SIP/%s',_0xf401d4[_0x0b9d('0x26')])])){_0x369c76[_0x0b9d('0x10')][util['format'](_0x0b9d('0x25'),_0xf401d4[_0x0b9d('0x26')])]=new Telephone(_0xf401d4);}else{_0x369c76[_0x0b9d('0x3f')](_0x369c76[_0x0b9d('0x10')][util[_0x0b9d('0x24')](_0x0b9d('0x25'),_0xf401d4['name'])],_0xf401d4);}}}return _0x369c76[_0x0b9d('0x10')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x43')]=function(){var _0x11c181=this;return function(_0x6abda7){if(_0x6abda7){freeIsNotKeySip(_0x6abda7,_0x11c181[_0x0b9d('0x11')]);for(var _0x3f1707=0x0,_0x5df731={},_0x44e03d={};_0x3f1707<_0x6abda7['length'];_0x3f1707+=0x1){_0x5df731=_0x6abda7[_0x3f1707];if(_[_0x0b9d('0x41')](_0x11c181[_0x0b9d('0x11')][util[_0x0b9d('0x24')]('SIP/%s',_0x5df731[_0x0b9d('0x26')])])){_0x11c181[_0x0b9d('0x11')][util[_0x0b9d('0x24')]('SIP/%s',_0x5df731[_0x0b9d('0x26')])]=new Trunk(_0x5df731);}else{_0x11c181[_0x0b9d('0x3f')](_0x11c181[_0x0b9d('0x11')][util[_0x0b9d('0x24')](_0x0b9d('0x25'),_0x5df731[_0x0b9d('0x26')])],_0x5df731);}}}return _0x11c181[_0x0b9d('0x11')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x44')]=function(){var _0x5a9599=this;return function(_0x10ed26){if(_0x10ed26){freeIsNotKey(_0x10ed26,_0x5a9599[_0x0b9d('0x12')],_0x0b9d('0x26'));for(var _0x4f6dba=0x0,_0x180adf={},_0xdb61d9={};_0x4f6dba<_0x10ed26[_0x0b9d('0x45')];_0x4f6dba+=0x1){_0x180adf=_0x10ed26[_0x4f6dba];if(_['isUndefined'](_0x5a9599[_0x0b9d('0x12')][_0x180adf[_0x0b9d('0x26')]])){_0x5a9599['voiceQueues'][_0x180adf[_0x0b9d('0x26')]]=new VoiceQueue(_0x180adf);}else{_0x5a9599[_0x0b9d('0x3f')](_0x5a9599['voiceQueues'][_0x180adf['name']],_0x180adf);}}}return _0x5a9599['voiceQueues'];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x46')]=function(){var _0x5b1d82=this;return function(_0x2c9d32){if(_0x2c9d32){freeIsNotKey(_0x2c9d32,_0x5b1d82[_0x0b9d('0x13')],'id');for(var _0x3b4b0f=0x0,_0x573c83={},_0x3443fb={};_0x3b4b0f<_0x2c9d32[_0x0b9d('0x45')];_0x3b4b0f+=0x1){_0x573c83=_0x2c9d32[_0x3b4b0f];if(_[_0x0b9d('0x41')](_0x5b1d82[_0x0b9d('0x13')][_0x573c83['id']])){_0x5b1d82[_0x0b9d('0x13')][_0x573c83['id']]=new Trigger(_0x573c83);}else{_0x5b1d82['mergeFromDatabase'](_0x5b1d82[_0x0b9d('0x13')][_0x573c83['id']],_0x573c83);}}}return _0x5b1d82['triggers'];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x47')]=function(){var _0x5a0c5b=this;return function(_0x18ddd2){if(_0x18ddd2){freeIsNotKey(_0x18ddd2,_0x5a0c5b['templates'],'id');for(var _0x5debb9=0x0,_0x89e9bc={},_0x2d3b1c={};_0x5debb9<_0x18ddd2['length'];_0x5debb9+=0x1){_0x89e9bc=_0x18ddd2[_0x5debb9];if(_[_0x0b9d('0x41')](_0x5a0c5b[_0x0b9d('0x48')][_0x89e9bc['id']])){_0x5a0c5b['templates'][_0x89e9bc['id']]=new Template(_0x89e9bc);}else{_0x5a0c5b[_0x0b9d('0x3f')](_0x5a0c5b[_0x0b9d('0x48')][_0x89e9bc['id']],_0x89e9bc);}}}return _0x5a0c5b[_0x0b9d('0x48')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x49')]=function(){var _0x2e59eb=this;return function(_0x47fd55){if(_0x47fd55){freeIsNotKey(_0x47fd55,_0x2e59eb[_0x0b9d('0x19')],'id');for(var _0x50b2a9=0x0,_0x4c9580={},_0x1d9ccc={};_0x50b2a9<_0x47fd55[_0x0b9d('0x45')];_0x50b2a9+=0x1){_0x4c9580=_0x47fd55[_0x50b2a9];if(_['isUndefined'](_0x2e59eb[_0x0b9d('0x19')][_0x4c9580['id']])){_0x2e59eb[_0x0b9d('0x19')][_0x4c9580['id']]=new ZendeskAccount(_0x4c9580);}else{_0x2e59eb[_0x0b9d('0x3f')](_0x2e59eb[_0x0b9d('0x19')][_0x4c9580['id']],_0x4c9580);}}}return _0x2e59eb['zendeskAccounts'];};};Realtime['prototype'][_0x0b9d('0x4a')]=function(){var _0x4d0b52=this;return function(_0xaee8ec){if(_0xaee8ec){freeIsNotKey(_0xaee8ec,_0x4d0b52[_0x0b9d('0x1a')],'id');for(var _0x405fd4=0x0,_0x191428={},_0x40ca7a={};_0x405fd4<_0xaee8ec[_0x0b9d('0x45')];_0x405fd4+=0x1){_0x191428=_0xaee8ec[_0x405fd4];if(_[_0x0b9d('0x41')](_0x4d0b52[_0x0b9d('0x1a')][_0x191428['id']])){_0x4d0b52[_0x0b9d('0x1a')][_0x191428['id']]=new SalesforceAccount(_0x191428);}else{_0x4d0b52[_0x0b9d('0x3f')](_0x4d0b52[_0x0b9d('0x1a')][_0x191428['id']],_0x191428);}}}return _0x4d0b52[_0x0b9d('0x1a')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x4b')]=function(){var _0x4aed80=this;return function(_0x1d12a6){if(_0x1d12a6){freeIsNotKey(_0x1d12a6,_0x4aed80['freshdeskAccounts'],'id');for(var _0x15c014=0x0,_0x1502ff={},_0x4e00f8={};_0x15c014<_0x1d12a6[_0x0b9d('0x45')];_0x15c014+=0x1){_0x1502ff=_0x1d12a6[_0x15c014];if(_['isUndefined'](_0x4aed80[_0x0b9d('0x1b')][_0x1502ff['id']])){_0x4aed80[_0x0b9d('0x1b')][_0x1502ff['id']]=new FreshdeskAccount(_0x1502ff);}else{_0x4aed80[_0x0b9d('0x3f')](_0x4aed80[_0x0b9d('0x1b')][_0x1502ff['id']],_0x1502ff);}}}return _0x4aed80[_0x0b9d('0x1b')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x4c')]=function(){var _0x107779=this;return function(_0x32396f){if(_0x32396f){freeIsNotKey(_0x32396f,_0x107779[_0x0b9d('0x1c')],'id');for(var _0x263d1e=0x0,_0x40c8e7={},_0x13216d={};_0x263d1e<_0x32396f['length'];_0x263d1e+=0x1){_0x40c8e7=_0x32396f[_0x263d1e];if(_[_0x0b9d('0x41')](_0x107779[_0x0b9d('0x1c')][_0x40c8e7['id']])){_0x107779[_0x0b9d('0x1c')][_0x40c8e7['id']]=new ZohoAccount(_0x40c8e7);}else{_0x107779[_0x0b9d('0x3f')](_0x107779[_0x0b9d('0x1c')][_0x40c8e7['id']],_0x40c8e7);}}}return _0x107779['zohoAccounts'];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x4d')]=function(){var _0x41b363=this;return function(_0x3ae5ac){if(_0x3ae5ac){freeIsNotKey(_0x3ae5ac,_0x41b363[_0x0b9d('0x1d')],'id');for(var _0x6deea2=0x0,_0x53e9f9={},_0x20575e={};_0x6deea2<_0x3ae5ac['length'];_0x6deea2+=0x1){_0x53e9f9=_0x3ae5ac[_0x6deea2];if(_['isUndefined'](_0x41b363[_0x0b9d('0x1d')][_0x53e9f9['id']])){_0x41b363[_0x0b9d('0x1d')][_0x53e9f9['id']]=new DeskAccount(_0x53e9f9);}else{_0x41b363['mergeFromDatabase'](_0x41b363[_0x0b9d('0x1d')][_0x53e9f9['id']],_0x53e9f9);}}}return _0x41b363['deskAccounts'];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x4e')]=function(){var _0xf64281=this;return function(_0x2558b0){if(_0x2558b0){freeIsNotKey(_0x2558b0,_0xf64281[_0x0b9d('0x4f')],'id');for(var _0x47a015=0x0,_0x5c613c={},_0x3da1bc={};_0x47a015<_0x2558b0[_0x0b9d('0x45')];_0x47a015+=0x1){_0x5c613c=_0x2558b0[_0x47a015];if(_[_0x0b9d('0x41')](_0xf64281['sugarcrmAccounts'][_0x5c613c['id']])){_0xf64281[_0x0b9d('0x4f')][_0x5c613c['id']]=new SugarcrmAccount(_0x5c613c);}else{_0xf64281['mergeFromDatabase'](_0xf64281[_0x0b9d('0x4f')][_0x5c613c['id']],_0x5c613c);}}}return _0xf64281[_0x0b9d('0x4f')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x50')]=function(){var _0x443c9b=this;return function(_0xfce656){if(_0xfce656){freeIsNotKey(_0xfce656,_0x443c9b[_0x0b9d('0x1e')],'id');for(var _0x5ddbe5=0x0,_0x890920={},_0x46195e={};_0x5ddbe5<_0xfce656[_0x0b9d('0x45')];_0x5ddbe5+=0x1){_0x890920=_0xfce656[_0x5ddbe5];if(_[_0x0b9d('0x41')](_0x443c9b[_0x0b9d('0x1e')][_0x890920['id']])){_0x443c9b[_0x0b9d('0x1e')][_0x890920['id']]=new VtigerAccount(_0x890920);}else{_0x443c9b[_0x0b9d('0x3f')](_0x443c9b[_0x0b9d('0x1e')][_0x890920['id']],_0x890920);}}}return _0x443c9b[_0x0b9d('0x1e')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x51')]=function(){var _0x4d8514=this;return function(_0x1e7b14){if(_0x1e7b14){freeIsNotKey(_0x1e7b14,_0x4d8514[_0x0b9d('0x1f')],'id');for(var _0x2b6f48=0x0,_0x48072e={},_0x4a42aa={};_0x2b6f48<_0x1e7b14[_0x0b9d('0x45')];_0x2b6f48+=0x1){_0x48072e=_0x1e7b14[_0x2b6f48];if(_[_0x0b9d('0x41')](_0x4d8514[_0x0b9d('0x1f')][_0x48072e['id']])){_0x4d8514['servicenowAccounts'][_0x48072e['id']]=new ServicenowAccount(_0x48072e);}else{_0x4d8514[_0x0b9d('0x3f')](_0x4d8514[_0x0b9d('0x1f')][_0x48072e['id']],_0x48072e);}}}return _0x4d8514['servicenowAccounts'];};};Realtime[_0x0b9d('0x3e')]['initDynamics365Accounts']=function(){var _0x2782e8=this;return function(_0x5cdba0){if(_0x5cdba0){freeIsNotKey(_0x5cdba0,_0x2782e8['dynamics365Accounts'],'id');for(var _0x551411=0x0,_0x4405b5={},_0xf2f6da={};_0x551411<_0x5cdba0['length'];_0x551411+=0x1){_0x4405b5=_0x5cdba0[_0x551411];if(_['isUndefined'](_0x2782e8[_0x0b9d('0x20')][_0x4405b5['id']])){_0x2782e8['dynamics365Accounts'][_0x4405b5['id']]=new Dynamics365Account(_0x4405b5);}else{_0x2782e8[_0x0b9d('0x3f')](_0x2782e8[_0x0b9d('0x20')][_0x4405b5['id']],_0x4405b5);}}}return _0x2782e8['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x37acb7=this;return function(_0x304bc0){if(_0x304bc0){freeIsNotKey(_0x304bc0,_0x37acb7[_0x0b9d('0x21')],'id');for(var _0x20e63e=0x0,_0x165514={},_0x58ad80={};_0x20e63e<_0x304bc0['length'];_0x20e63e+=0x1){_0x165514=_0x304bc0[_0x20e63e];if(_['isUndefined'](_0x37acb7[_0x0b9d('0x21')][_0x165514['id']])){_0x37acb7[_0x0b9d('0x21')][_0x165514['id']]=new FreshsalesAccount(_0x165514);}else{_0x37acb7['mergeFromDatabase'](_0x37acb7[_0x0b9d('0x21')][_0x165514['id']],_0x165514);}}}return _0x37acb7[_0x0b9d('0x21')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x52')]=function(){var _0x51ff85=this;return function(_0x4f5965){for(var _0x378a8c=0x0;_0x378a8c<_0x4f5965[_0x0b9d('0x45')];_0x378a8c+=0x1){_['merge'](_0x51ff85['voiceQueues'][_0x4f5965[_0x378a8c][_0x0b9d('0x26')]],_0x4f5965[_0x378a8c]);}return _0x51ff85[_0x0b9d('0x12')];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x53')]=function(){var _0x5f0d51=this;return function(_0x1aa479){clearVoiceQueues(_0x5f0d51['voiceQueues']);if(_0x1aa479){_0x1aa479=_['groupBy'](_0x1aa479,_0x0b9d('0x54'));for(var _0x30b671 in _0x1aa479){if(_0x1aa479[_0x0b9d('0x23')](_0x30b671)){var _0x5699ec={};for(var _0x4558f7=0x0;_0x4558f7<_0x1aa479[_0x30b671][_0x0b9d('0x45')];_0x4558f7+=0x1){var _0x11645f=_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x55')];if(_0x5f0d51[_0x0b9d('0x12')][_0x11645f]){if(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x56')]){_0x5f0d51[_0x0b9d('0x12')][_0x11645f]['unmanaged']+=0x1;}if(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x57')]){_0x5f0d51[_0x0b9d('0x12')][_0x11645f][_0x0b9d('0x31')]+=0x1;}_0x5f0d51[_0x0b9d('0x12')][_0x11645f]['sumHoldTime']+=moment(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x58')])[_0x0b9d('0x59')](moment(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x5a')]),_0x0b9d('0x5b'))||0x0;if(_0x4558f7===_0x1aa479[_0x30b671][_0x0b9d('0x45')]-0x1){_0x5f0d51[_0x0b9d('0x12')][_0x11645f][_0x0b9d('0x2a')]+=moment(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x5c')]||_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x5d')]||_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x5e')])[_0x0b9d('0x59')](moment(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x5a')]),_0x0b9d('0x5b'))||0x0;_0x5f0d51[_0x0b9d('0x12')][_0x11645f][_0x0b9d('0x2f')]+=0x1;if(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x5f')]){_0x5f0d51[_0x0b9d('0x12')][_0x11645f][_0x0b9d('0x29')]+=0x1;_0x5f0d51[_0x0b9d('0x12')][_0x11645f]['sumBillable']+=moment(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x5c')])[_0x0b9d('0x59')](moment(_0x1aa479[_0x30b671][_0x4558f7][_0x0b9d('0x58')]),_0x0b9d('0x5b'))||0x0;}}else{_0x5f0d51[_0x0b9d('0x12')][_0x11645f]['sumDuration']+=_0x5f0d51['voiceQueues'][_0x11645f][_0x0b9d('0x32')]||0x0;}}}}}}return _0x5f0d51['voiceQueues'];};};Realtime[_0x0b9d('0x3e')][_0x0b9d('0x60')]=function(){var _0x466642=this;return function(_0xd458bc){clearVoiceCallReports(_0x466642['outbound']);if(_0xd458bc){for(var _0x1b4b34=0x0;_0x1b4b34<_0xd458bc[_0x0b9d('0x45')];_0x1b4b34+=0x1){_0x466642[_0x0b9d('0x15')][_0x0b9d('0x2f')]+=0x1;_0x466642['outbound'][_0x0b9d('0x2a')]+=_0xd458bc[_0x1b4b34][_0x0b9d('0x61')];if(_0xd458bc[_0x1b4b34]['disposition']===_0x0b9d('0x62')){_0x466642['outbound'][_0x0b9d('0x29')]+=0x1;_0x466642['outbound'][_0x0b9d('0x32')]+=_0xd458bc[_0x1b4b34][_0x0b9d('0x61')]-_0xd458bc[_0x1b4b34][_0x0b9d('0x63')]||0x0;_0x466642['outbound'][_0x0b9d('0x2b')]+=_0xd458bc[_0x1b4b34]['billableseconds'];}}}return _0x466642['outbound'];};};Realtime['prototype'][_0x0b9d('0x64')]=function(){var _0x325043=this;return function(_0x58beeb){if(_0x58beeb){freeIsNotKey(_0x58beeb,_0x325043[_0x0b9d('0x14')],_0x0b9d('0x26'));for(var _0x39de39=0x0,_0x1416e7={};_0x39de39<_0x58beeb[_0x0b9d('0x45')];_0x39de39+=0x1){_0x1416e7=_0x58beeb[_0x39de39];if(_[_0x0b9d('0x41')](_0x325043[_0x0b9d('0x14')][_0x1416e7[_0x0b9d('0x26')]])){_0x325043[_0x0b9d('0x14')][_0x1416e7['name']]=new Campaign(_0x1416e7);}else{_0x325043[_0x0b9d('0x3f')](_0x325043['campaigns'][_0x1416e7[_0x0b9d('0x26')]],_0x1416e7);_0x325043[_0x0b9d('0x14')][_0x1416e7[_0x0b9d('0x26')]][_0x0b9d('0x65')]=_0x1416e7[_0x0b9d('0x66')]?_0x1416e7[_0x0b9d('0x66')][_0x0b9d('0x26')]:undefined;}}}return _0x325043['campaigns'];};};Realtime['prototype'][_0x0b9d('0x67')]=function(){var _0x50cd9a=this;return function(_0x2ddda5){if(_0x2ddda5){freeIsNotKey(_0x2ddda5,_0x50cd9a[_0x0b9d('0x16')],'id');for(var _0x47e5c4=0x0,_0x1b915e={};_0x47e5c4<_0x2ddda5[_0x0b9d('0x45')];_0x47e5c4+=0x1){_0x1b915e=_0x2ddda5[_0x47e5c4];if(_[_0x0b9d('0x41')](_0x50cd9a[_0x0b9d('0x16')][_0x1b915e['id']])){_0x50cd9a[_0x0b9d('0x16')][_0x1b915e['id']]=new VoiceExtension(_0x1b915e);}else{_0x50cd9a[_0x0b9d('0x3f')](_0x50cd9a[_0x0b9d('0x16')][_0x1b915e['id']],_0x1b915e);}}}return _0x50cd9a[_0x0b9d('0x16')];};};Realtime['prototype'][_0x0b9d('0x68')]=function(){var _0x1554d2=this;return function(_0x27d0d7){clearCampaigns(_0x1554d2['campaigns']);for(var _0x4bdc9a=0x0;_0x4bdc9a<_0x27d0d7[_0x0b9d('0x45')];_0x4bdc9a+=0x1){_['merge'](_0x1554d2[_0x0b9d('0x14')][_0x27d0d7[_0x4bdc9a]['name']],_0x27d0d7[_0x4bdc9a]);}return _0x1554d2[_0x0b9d('0x14')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x23f0a8=this;return function(_0x2b2ff6){if(_0x2b2ff6){freeIsNotKey(_0x2b2ff6,_0x23f0a8['faxAccounts'],'id');for(var _0x565ec2=0x0,_0x553a1b={},_0x109dc5={};_0x565ec2<_0x2b2ff6[_0x0b9d('0x45')];_0x565ec2+=0x1){_0x553a1b=_0x2b2ff6[_0x565ec2];if(_[_0x0b9d('0x41')](_0x23f0a8[_0x0b9d('0x69')][_0x553a1b['id']])){_0x23f0a8['faxAccounts'][_0x553a1b['id']]=new FaxAccount(_0x553a1b);}else{_0x23f0a8[_0x0b9d('0x3f')](_0x23f0a8[_0x0b9d('0x69')][_0x553a1b['id']],_0x553a1b);}}}return _0x23f0a8[_0x0b9d('0x69')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 325dd85..47e351b 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 _0xaf53=['originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','uniqueid','type','UserId','channel','split','monitor','monitors','createdAt','calleridname','connectedlinename','isArray','startsWith','Local','substring','indexOf','phone','lastIndexOf','membername','transfererlinkedid','attendedTransfer','exports','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','isNil','interface','SIP/%s','name','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','format','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','getAgentByInternal','keys','getCallType','calleridnum','outbound','internal','destination','exten','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview'];(function(_0x37d317,_0x46dcc1){var _0x2c757f=function(_0xcbee92){while(--_0xcbee92){_0x37d317['push'](_0x37d317['shift']());}};_0x2c757f(++_0x46dcc1);}(_0xaf53,0x1d9));var _0x3af5=function(_0xa3d2b6,_0x139051){_0xa3d2b6=_0xa3d2b6-0x0;var _0x2923f3=_0xaf53[_0xa3d2b6];return _0x2923f3;};'use strict';var _=require('lodash');var moment=require(_0x3af5('0x0'));var util=require(_0x3af5('0x1'));var config=require(_0x3af5('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x3af5('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x3af5('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x3af5('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x3af5('0x6'));var VoiceQueueReport=require(_0x3af5('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x3af5('0x8'));var VoiceDialReport=require(_0x3af5('0x9'));var UserReport=require(_0x3af5('0xa'));function Report(_0xe26ec2){this[_0x3af5('0xb')]=_0xe26ec2;this[_0x3af5('0xc')]=_0xe26ec2[_0x3af5('0xc')];this['telephones']=_0xe26ec2[_0x3af5('0xd')];}Report[_0x3af5('0xe')][_0x3af5('0xf')]=function(_0x433a75){var _0x2a8fe=new VoiceQueueReport(this[_0x3af5('0xb')]);var _0x18c8db=new VoiceAgentReport(this['realtime']);var _0x539d7f=new VoiceDialReport(this['realtime']);var _0x2c3820=new VoiceCallReport(this['realtime']);var _0x5b807c=new UserReport(this[_0x3af5('0xb')]);if(config[_0x3af5('0x10')]&&config[_0x3af5('0x10')][_0x3af5('0x11')]){ami['on'](_0x3af5('0x12'),this['voiceQueueReport'][_0x3af5('0x13')](this));ami['on'](_0x3af5('0x14'),this[_0x3af5('0x15')][_0x3af5('0x13')](this));ami['on']('custom:voiceAgentReport',this[_0x3af5('0x16')][_0x3af5('0x13')](this));ami['on'](_0x3af5('0x17'),this[_0x3af5('0x18')][_0x3af5('0x13')](this));ami['on'](_0x3af5('0x19'),this[_0x3af5('0x1a')][_0x3af5('0x13')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x3af5('0x13')](this));}};Report[_0x3af5('0xe')][_0x3af5('0x1b')]=function(_0x562ffc){var _0x1907a7;_0x1907a7=_[_0x3af5('0x1c')](this['agents'],function(_0x1de6f5){return _0x1de6f5[_0x3af5('0x1d')]==_0x562ffc||_0x1de6f5['name']==_0x562ffc;});if(_[_0x3af5('0x1e')](_0x1907a7)){var _0x5ceef4=_['find'](this['telephones'],function(_0x5d748e){return _0x5d748e['accountcode']==_0x562ffc||_0x5d748e['name']==_0x562ffc;});if(_0x5ceef4){_0x1907a7=_[_0x3af5('0x1c')](this['agents'],function(_0x4c64f7){return _0x4c64f7[_0x3af5('0x1f')]==util['format'](_0x3af5('0x20'),_0x5ceef4[_0x3af5('0x21')]);});}}return _0x1907a7;};Report[_0x3af5('0xe')][_0x3af5('0x22')]=function(_0x2ed27a){for(var _0x129910=0x0;_0x129910<_0x2ed27a[_0x3af5('0x23')];_0x129910+=0x1){var _0xf039ec=this[_0x3af5('0x1b')](_0x2ed27a[_0x129910][_0x3af5('0x24')]);if(_0xf039ec){_0x2ed27a[_0x129910][_0x3af5('0x1d')]=_0xf039ec['accountcode'];_0x2ed27a[_0x129910][_0x3af5('0x25')]=!![];_0x2ed27a[_0x129910][_0x3af5('0x26')]=_0xf039ec['name'];_0x2ed27a[_0x129910]['interface']=_[_0x3af5('0x1e')](_0xf039ec[_0x3af5('0x1f')])?util['format']('SIP/%s',_0xf039ec[_0x3af5('0x21')]):_0xf039ec[_0x3af5('0x1f')];if(_0x2ed27a[_0x129910][_0x3af5('0x27')]){_0x2ed27a[_0x129910][_0x3af5('0x28')]=moment()[_0x3af5('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2ed27a[_0x129910]['queuecallerexit']){_0x2ed27a[_0x129910][_0x3af5('0x2a')]=moment()['format'](_0x3af5('0x2b'));}RpcMemberReport[_0x3af5('0x22')](_0x2ed27a[_0x129910]);}RpcVoiceQueueReport[_0x3af5('0x2c')](_0x2ed27a[_0x129910]);}};function extractCalleridNumber(_0x1b9195){var _0x58d4af=_0x1b9195['match'](/<(.*?)>/);return _0x58d4af?_0x58d4af[0x1]:_0x1b9195;}Report[_0x3af5('0xe')][_0x3af5('0x2d')]=function(_0x11a259){for(var _0x4ae089=0x0;_0x4ae089','calleridname','transfers','linkedid','uniqueid','type','UserId','monitors','filename','membername','originatecalleridnum','xcally-motion-dialer','isArray','Local','substring','indexOf','mobile','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','accountcode','isNil','format','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','interface','name','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','keys','getCallType','channel','split','getAgentByInternal','calleridnum','internal','destination','exten','dialer','lastapplication','queue','context','from-voip-provider','from-sip','xcally-motion-preview'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x5350,0x70));var _0x0535=function(_0x38c1db,_0xe425a7){_0x38c1db=_0x38c1db-0x0;var _0x3c3203=_0x5350[_0x38c1db];return _0x3c3203;};'use strict';var _=require(_0x0535('0x0'));var moment=require(_0x0535('0x1'));var util=require(_0x0535('0x2'));var config=require(_0x0535('0x3'));var ami=require(_0x0535('0x4'));var RpcVoiceAgentReport=require(_0x0535('0x5'));var RpcVoiceCallReport=require(_0x0535('0x6'));var RpcVoiceDialReport=require(_0x0535('0x7'));var RpcMemberReport=require(_0x0535('0x8'));var RpcVoiceQueueReport=require(_0x0535('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x0535('0xa'));var VoiceCallReport=require(_0x0535('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x0535('0xc'));var UserReport=require(_0x0535('0xd'));function Report(_0x5b4e8c){this[_0x0535('0xe')]=_0x5b4e8c;this[_0x0535('0xf')]=_0x5b4e8c[_0x0535('0xf')];this[_0x0535('0x10')]=_0x5b4e8c[_0x0535('0x10')];}Report[_0x0535('0x11')][_0x0535('0x12')]=function(_0x538358){var _0x118bab=new VoiceQueueReport(this[_0x0535('0xe')]);var _0x283b5c=new VoiceAgentReport(this[_0x0535('0xe')]);var _0x2d132c=new VoiceDialReport(this[_0x0535('0xe')]);var _0x317857=new VoiceCallReport(this[_0x0535('0xe')]);var _0x105ff2=new UserReport(this[_0x0535('0xe')]);if(config['xdr']&&config['xdr'][_0x0535('0x13')]){ami['on'](_0x0535('0x14'),this['voiceQueueReport'][_0x0535('0x15')](this));ami['on'](_0x0535('0x16'),this[_0x0535('0x17')][_0x0535('0x15')](this));ami['on'](_0x0535('0x18'),this['voiceAgentReport'][_0x0535('0x15')](this));ami['on'](_0x0535('0x19'),this[_0x0535('0x1a')][_0x0535('0x15')](this));ami['on'](_0x0535('0x1b'),this[_0x0535('0x1c')]['bind'](this));ami['on'](_0x0535('0x1d'),this['attendedTransfer']['bind'](this));}};Report['prototype'][_0x0535('0x1e')]=function(_0x408180){var _0x936072;_0x936072=_[_0x0535('0x1f')](this[_0x0535('0xf')],function(_0x24ca02){return _0x24ca02[_0x0535('0x20')]==_0x408180||_0x24ca02['name']==_0x408180;});if(_[_0x0535('0x21')](_0x936072)){var _0x2ceeeb=_[_0x0535('0x1f')](this[_0x0535('0x10')],function(_0x4ae9e0){return _0x4ae9e0[_0x0535('0x20')]==_0x408180||_0x4ae9e0['name']==_0x408180;});if(_0x2ceeeb){_0x936072=_[_0x0535('0x1f')](this[_0x0535('0xf')],function(_0x276753){return _0x276753['interface']==util[_0x0535('0x22')](_0x0535('0x23'),_0x2ceeeb['name']);});}}return _0x936072;};Report['prototype'][_0x0535('0x24')]=function(_0x4294b5){for(var _0x174b9c=0x0;_0x174b9c<_0x4294b5[_0x0535('0x25')];_0x174b9c+=0x1){var _0x3e3086=this[_0x0535('0x1e')](_0x4294b5[_0x174b9c][_0x0535('0x26')]);if(_0x3e3086){_0x4294b5[_0x174b9c][_0x0535('0x20')]=_0x3e3086[_0x0535('0x20')];_0x4294b5[_0x174b9c][_0x0535('0x27')]=!![];_0x4294b5[_0x174b9c][_0x0535('0x28')]=_0x3e3086['name'];_0x4294b5[_0x174b9c]['interface']=_[_0x0535('0x21')](_0x3e3086[_0x0535('0x29')])?util['format'](_0x0535('0x23'),_0x3e3086[_0x0535('0x2a')]):_0x3e3086[_0x0535('0x29')];if(_0x4294b5[_0x174b9c][_0x0535('0x2b')]){_0x4294b5[_0x174b9c][_0x0535('0x2c')]=moment()[_0x0535('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4294b5[_0x174b9c][_0x0535('0x2d')]){_0x4294b5[_0x174b9c][_0x0535('0x2e')]=moment()[_0x0535('0x22')](_0x0535('0x2f'));}RpcMemberReport[_0x0535('0x24')](_0x4294b5[_0x174b9c]);}RpcVoiceQueueReport[_0x0535('0x30')](_0x4294b5[_0x174b9c]);}};function extractCalleridNumber(_0x55c16a){var _0x479190=_0x55c16a[_0x0535('0x31')](/<(.*?)>/);return _0x479190?_0x479190[0x1]:_0x55c16a;}Report['prototype']['getAgentByInternal']=function(_0x5c1210){for(var _0x76f9ac=0x0;_0x76f9ac0x0?_0x4dfb82:0x0;this[_0x2461('0x14')][_0x519712['queue']][_0x2461('0x58')]=this[_0x2461('0x14')][_0x519712[_0x2461('0x6e')]][_0x2461('0x58')]>_['toNumber'](_0x519712[_0x2461('0x73')])?_['toNumber'](_0x519712[_0x2461('0x73')]):this['voiceQueues'][_0x519712['queue']]['talking'];this[_0x2461('0x4f')](this[_0x2461('0x14')][_0x519712[_0x2461('0x6e')]],'queuesummary');}logger[_0x2461('0x45')](_0x2461('0x74'),util[_0x2461('0x3e')](this[_0x2461('0x14')][_0x519712[_0x2461('0x6e')]],{'showHidden':![],'depth':null}));ami[_0x2461('0x44')](_0x2461('0x75'),this[_0x2461('0x14')][_0x519712[_0x2461('0x6e')]]);}}}catch(_0x16cc7e){logger[_0x2461('0x3c')](_0x2461('0x6c'),util[_0x2461('0x3e')](_0x16cc7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2461('0xd')]['syncQueueSummaryComplete']=function(_0x1a7abe){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x1a7abe,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x2461('0xd')][_0x2461('0x1b')]=function(_0x573f81){try{if(this['isNotNull'](_0x573f81)){logger[_0x2461('0x45')](_0x2461('0x76'),_0x573f81[_0x2461('0x47')],util[_0x2461('0x3e')](_0x573f81,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x2461('0x11')][_0x573f81[_0x2461('0x47')]]))this[_0x2461('0x11')][_0x573f81[_0x2461('0x47')]]=[];if(_[_0x2461('0x66')](this[_0x2461('0x35')][_0x573f81[_0x2461('0x47')]]))this['channels'][_0x573f81[_0x2461('0x47')]]={};var _0x24a633=new QueueReport();_0x24a633[_0x2461('0x4a')]=_0x573f81[_0x2461('0x6e')];_0x24a633[_0x2461('0x50')]=this['voiceQueues'][_0x24a633[_0x2461('0x4a')]]&&this[_0x2461('0x14')][_0x24a633['name']][_0x2461('0x50')]?this[_0x2461('0x14')][_0x24a633['name']][_0x2461('0x50')]||_0x2461('0x51'):_0x2461('0x51');_0x24a633['queue']=_0x573f81[_0x2461('0x6e')];_0x24a633[_0x2461('0x77')]=moment()[_0x2461('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x24a633[_0x2461('0x78')]=_0x573f81[_0x2461('0x78')];_0x24a633[_0x2461('0x79')]=_0x573f81[_0x2461('0x79')];_0x24a633[_0x2461('0x47')]=_0x573f81[_0x2461('0x47')];_0x24a633[_0x2461('0x7a')]=this[_0x2461('0x35')][_0x573f81[_0x2461('0x47')]][_0x2461('0x7a')];logger['info'](_0x2461('0x7b'),_0x24a633[_0x2461('0x4a')],_0x24a633[_0x2461('0x50')]);_[_0x2461('0x7c')](_0x24a633,_[_0x2461('0x7d')](_0x573f81,_[_0x2461('0x7e')](_0x24a633)));this[_0x2461('0x11')][_0x573f81[_0x2461('0x47')]]['push'](_0x24a633);this[_0x2461('0x35')][_0x573f81['uniqueid']]=_0x24a633;this['emitVoiceQueueChannelSave'](_0x24a633,_0x2461('0x1a'));}}catch(_0x536bc5){logger['error'](_0x2461('0x76'),_0x573f81[_0x2461('0x47')],util[_0x2461('0x3e')](_0x536bc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2461('0xd')]['syncQueueCallerAbandon']=function(_0x583825){try{if(this[_0x2461('0x65')](_0x583825)){logger[_0x2461('0x45')](_0x2461('0x7f'),_0x583825[_0x2461('0x47')],util[_0x2461('0x3e')](_0x583825,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x583825['uniqueid']]){var _0xbbd257=_[_0x2461('0x80')](this['queueReports'][_0x583825[_0x2461('0x47')]]);_0xbbd257['queuecallercomplete']=![];_0xbbd257[_0x2461('0x81')]=null;_0xbbd257[_0x2461('0x82')]=_0x583825[_0x2461('0x82')];_0xbbd257[_0x2461('0x83')]=_0x583825[_0x2461('0x83')];_0xbbd257[_0x2461('0x1c')]=!![];_0xbbd257[_0x2461('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xbbd257['queuecallerexitreason']=_0x2461('0x85');_0xbbd257['lastAssignedTo']=null;logger[_0x2461('0x86')](_0x2461('0x87'),_0xbbd257[_0x2461('0x4a')],_0xbbd257['type']);this['channels'][_0x583825[_0x2461('0x47')]]=_0xbbd257;this[_0x2461('0x42')](_0xbbd257,_0x2461('0x1c'));}}}catch(_0x4a7917){logger[_0x2461('0x3c')](_0x2461('0x7f'),_0x583825[_0x2461('0x47')],util[_0x2461('0x3e')](_0x4a7917,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2461('0xd')][_0x2461('0x1e')]=function(_0x1ffffd){try{if(this[_0x2461('0x65')](_0x1ffffd)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x1ffffd[_0x2461('0x47')],util[_0x2461('0x3e')](_0x1ffffd,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1ffffd[_0x2461('0x47')]]){var _0x198205=_['last'](this['queueReports'][_0x1ffffd['uniqueid']]);_0x198205['queuecallerleaveAt']=moment()[_0x2461('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x198205[_0x2461('0x88')]=_0x1ffffd[_0x2461('0x88')];_0x198205[_0x2461('0x89')]=_0x1ffffd[_0x2461('0x89')];logger[_0x2461('0x86')](_0x2461('0x8a'),_0x198205[_0x2461('0x4a')],_0x198205[_0x2461('0x50')],_0x1ffffd[_0x2461('0x88')],_0x1ffffd[_0x2461('0x89')]);this[_0x2461('0x35')][_0x1ffffd[_0x2461('0x47')]]=_0x198205;this['emitVoiceQueueChannelSave'](_0x198205,_0x2461('0x1d'));}}}catch(_0x2849db){logger[_0x2461('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x1ffffd[_0x2461('0x47')],util[_0x2461('0x3e')](_0x2849db,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2461('0xd')][_0x2461('0x20')]=function(_0x2f5541){try{if(this[_0x2461('0x65')](_0x2f5541)){logger[_0x2461('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x2f5541[_0x2461('0x47')],util['inspect'](_0x2f5541,{'showHidden':![],'depth':null}));if(this[_0x2461('0x11')][_0x2f5541[_0x2461('0x47')]]){var _0x18642e=_[_0x2461('0x80')](this[_0x2461('0x11')][_0x2f5541[_0x2461('0x47')]]);_0x18642e[_0x2461('0x8b')]=!![];_0x18642e[_0x2461('0x8c')]=_0x2461('0x8d');logger[_0x2461('0x86')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x18642e[_0x2461('0x4a')],_0x18642e[_0x2461('0x50')]);}}}catch(_0x70ae10){logger[_0x2461('0x3c')](_0x2461('0x8e'),_0x2f5541['uniqueid'],util[_0x2461('0x3e')](_0x70ae10,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2461('0xd')][_0x2461('0x8f')]=function(_0x40ab03){try{if(this['isNotNull'](_0x40ab03)){logger[_0x2461('0x45')](_0x2461('0x90'),_0x40ab03[_0x2461('0x47')],util[_0x2461('0x3e')](_0x40ab03,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x40ab03[_0x2461('0x47')]]){var _0x6e71b=_[_0x2461('0x80')](this[_0x2461('0x11')][_0x40ab03[_0x2461('0x47')]]);_0x6e71b['queuecallerabandon']=![];_0x6e71b[_0x2461('0x84')]=null;_0x6e71b[_0x2461('0x91')]=!![];_0x6e71b[_0x2461('0x92')]=_0x40ab03['membername'];_0x6e71b['holdtime']=_0x40ab03['holdtime'];_0x6e71b['queuecallercomplete']=!![];_0x6e71b[_0x2461('0x93')]=![];_0x6e71b[_0x2461('0x94')]=null;if(!_0x6e71b['transfer']){if(_0x40ab03['reason']==_0x2461('0x95')){_0x6e71b[_0x2461('0x8c')]=_0x2461('0x96');logger[_0x2461('0x86')](_0x2461('0x97'),_0x6e71b[_0x2461('0x4a')],_0x6e71b[_0x2461('0x50')]);}else{if(_[_0x2461('0x98')](_0x40ab03[_0x2461('0x38')][_0x2461('0x99')](),'local/')){if(this[_0x2461('0x11')][_0x40ab03[_0x2461('0x9a')]]){var _0x12aef9=_[_0x2461('0x80')](this[_0x2461('0x11')][_0x40ab03['linkedid']]);_0x12aef9[_0x2461('0x8b')]=![];_0x12aef9[_0x2461('0x93')]=!![];_0x12aef9[_0x2461('0x94')]=moment(_0x6e71b[_0x2461('0x77')])[_0x2461('0x9b')](_0x40ab03['holdtime'],_0x2461('0x9c'))[_0x2461('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x12aef9[_0x2461('0x8c')]=_0x2461('0x9d');_0x12aef9[_0x2461('0x95')]=!![];_0x12aef9[_0x2461('0x9e')]=_0x2461('0x9f');_0x12aef9[_0x2461('0xa0')]=_0x40ab03[_0x2461('0xa1')];_0x12aef9[_0x2461('0xa2')]=_0x40ab03[_0x2461('0x47')];logger['info'](_0x2461('0xa3'),_0x12aef9[_0x2461('0x4a')],_0x12aef9[_0x2461('0x50')]);var _0x1372d1=this[_0x2461('0x11')][_0x40ab03['linkedid']];this[_0x2461('0x11')][_0x40ab03['linkedid']]=this['queueReports'][_0x40ab03[_0x2461('0x47')]];this[_0x2461('0x11')][_0x40ab03[_0x2461('0x47')]]=_0x1372d1;}}else{_0x6e71b[_0x2461('0x8c')]=_0x2461('0xa4')+_0x40ab03['reason'][_0x2461('0xa5')]();logger['info'](_0x2461('0xa6'),_0x6e71b[_0x2461('0x4a')],_0x6e71b[_0x2461('0x50')],_0x6e71b['queuecallerexitreason']);}}}this[_0x2461('0x35')][_0x40ab03[_0x2461('0x47')]]=_0x6e71b;this[_0x2461('0x42')](_0x6e71b,'agentcomplete');}}}catch(_0x424db8){logger[_0x2461('0x3c')](_0x2461('0x90'),_0x40ab03[_0x2461('0x47')],util[_0x2461('0x3e')](_0x424db8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2461('0xd')][_0x2461('0x22')]=function(_0x2dc78a){try{if(this[_0x2461('0x65')](_0x2dc78a)){logger[_0x2461('0x45')](_0x2461('0xa7'),_0x2dc78a['uniqueid'],util['inspect'](_0x2dc78a,{'showHidden':![],'depth':null}));this[_0x2461('0xa8')](_0x2dc78a['uniqueid'],_[_0x2461('0x7e')](_0x2dc78a[_0x2461('0xa9')])[0x0],_0x2dc78a[_0x2461('0xaa')]);if(this[_0x2461('0x11')][_0x2dc78a[_0x2461('0x47')]]){var _0x50d5bc=_['last'](this[_0x2461('0x11')][_0x2dc78a[_0x2461('0x47')]]);if(_0x50d5bc){if(this['isNotNull'](_0x2dc78a[_0x2461('0xa9')])&&this['isNotNull'](_0x2dc78a[_0x2461('0xa9')]['queuestatus'])){switch(_0x2dc78a['value']){case _0x2461('0xab'):_0x50d5bc[_0x2461('0x93')]=![];_0x50d5bc[_0x2461('0x94')]=null;break;case _0x2461('0xac'):_0x50d5bc[_0x2461('0xad')]='timeout';_0x50d5bc[_0x2461('0x93')]=!![];_0x50d5bc[_0x2461('0x94')]=moment()['format'](_0x2461('0xae'));_0x50d5bc[_0x2461('0xaf')]=moment()['format'](_0x2461('0xae'));logger[_0x2461('0x45')](_0x2461('0xb0'),_0x2dc78a[_0x2461('0x47')],util[_0x2461('0x3e')](_0x50d5bc,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x50d5bc);break;default:_0x50d5bc[_0x2461('0x93')]=!![];_0x50d5bc['queuecallerexitAt']=moment()[_0x2461('0x48')](_0x2461('0xae'));_0x50d5bc[_0x2461('0xaf')]=moment()['format'](_0x2461('0xae'));}_0x50d5bc[_0x2461('0x1c')]=![];_0x50d5bc[_0x2461('0x84')]=null;_0x50d5bc['queuecallerexitreason']=_0x2dc78a[_0x2461('0xaa')];this['channels'][_0x2dc78a['uniqueid']]=_0x50d5bc;this['emitVoiceQueueChannelRemove'](_0x50d5bc,'varset');}else if(this[_0x2461('0x65')](_0x2dc78a[_0x2461('0xa9')])&&this[_0x2461('0x65')](_0x2dc78a[_0x2461('0xa9')][_0x2461('0xb1')])){if(!_0x50d5bc[_0x2461('0x1c')]){_0x50d5bc[_0x2461('0x93')]=!![];_0x50d5bc[_0x2461('0x94')]=moment()[_0x2461('0x48')](_0x2461('0xae'));_0x50d5bc[_0x2461('0x8c')]=_0x2461('0xb2');_0x50d5bc[_0x2461('0xaf')]=moment()['format'](_0x2461('0xae'));this[_0x2461('0x35')][_0x2dc78a['uniqueid']]=_0x50d5bc;}}logger[_0x2461('0x86')](_0x2461('0xb3'),_0x2dc78a[_0x2461('0x47')],_0x50d5bc[_0x2461('0x4a')],_0x50d5bc[_0x2461('0x50')],_[_0x2461('0x7e')](_0x2dc78a['variable'])[0x0],_0x2dc78a['value']);_0x50d5bc[_0x2461('0x16')]=this[_0x2461('0x16')][_0x2dc78a[_0x2461('0x47')]];}}}}catch(_0xf102cb){logger[_0x2461('0x3c')](_0x2461('0xa7'),_0x2dc78a[_0x2461('0x47')],util['inspect'](_0xf102cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2461('0xd')][_0x2461('0xa8')]=function(_0x55b3d8,_0xdad5ac,_0x20c3b9){var _0x127441=[_0x2461('0xb4'),_0x2461('0xb5'),_0x2461('0xb6'),_0x2461('0xb7'),'rtpaudioqosloss',_0x2461('0xb8'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x2461('0xb9'),'sipuri','bridgepeer',_0x2461('0xba'),_0x2461('0xbb'),_0x2461('0xbc'),'memberinterface',_0x2461('0xbd'),_0x2461('0xbe'),_0x2461('0xbf'),'memberrealtime'];if(!_[_0x2461('0x37')](_0xdad5ac)&&!_[_0x2461('0xc0')](_0x127441,_0xdad5ac)){if(_[_0x2461('0x66')](this[_0x2461('0x16')][_0x55b3d8])){this[_0x2461('0x16')][_0x55b3d8]={};}this['variables'][_0x55b3d8][_0xdad5ac]=_0x20c3b9;}};VoiceQueueReport[_0x2461('0xd')]['syncHangup']=function(_0xd58f1b){try{if(this[_0x2461('0x65')](_0xd58f1b)){logger[_0x2461('0x45')]('[%s][voiceQueueReport][hangup]',_0xd58f1b[_0x2461('0x47')],util['inspect'](_0xd58f1b,{'showHidden':![],'depth':null}));if(this[_0x2461('0x11')][_0xd58f1b[_0x2461('0x47')]]){for(var _0x4b6a51=0x0,_0x45514e={};_0x4b6a510x0?_0x5672e8:0x0;this[_0xc2a4('0x13')][_0x1c57f1[_0xc2a4('0x65')]][_0xc2a4('0x53')]=this[_0xc2a4('0x13')][_0x1c57f1[_0xc2a4('0x65')]]['talking']>_[_0xc2a4('0x6b')](_0x1c57f1[_0xc2a4('0x6c')])?_[_0xc2a4('0x6b')](_0x1c57f1[_0xc2a4('0x6c')]):this[_0xc2a4('0x13')][_0x1c57f1[_0xc2a4('0x65')]][_0xc2a4('0x53')];this[_0xc2a4('0x4d')](this['voiceQueues'][_0x1c57f1[_0xc2a4('0x65')]],_0xc2a4('0x17'));}logger[_0xc2a4('0x45')](_0xc2a4('0x6e'),util[_0xc2a4('0x3c')](this[_0xc2a4('0x13')][_0x1c57f1[_0xc2a4('0x65')]],{'showHidden':![],'depth':null}));ami[_0xc2a4('0x44')](_0xc2a4('0x6f'),this['voiceQueues'][_0x1c57f1[_0xc2a4('0x65')]]);}}}catch(_0x48c38e){logger[_0xc2a4('0x3a')](_0xc2a4('0x63'),util[_0xc2a4('0x3c')](_0x48c38e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x70')]=function(_0x341f5f){logger[_0xc2a4('0x45')](_0xc2a4('0x71'),util[_0xc2a4('0x3c')](_0x341f5f,{'showHidden':![],'depth':null}));this[_0xc2a4('0x14')]=!![];};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x72')]=function(_0x4b0352){try{if(this[_0xc2a4('0x5e')](_0x4b0352)){logger[_0xc2a4('0x45')](_0xc2a4('0x73'),_0x4b0352[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x4b0352,{'showHidden':![],'depth':null}));if(_[_0xc2a4('0x5f')](this[_0xc2a4('0x3d')][_0x4b0352[_0xc2a4('0x48')]]))this[_0xc2a4('0x3d')][_0x4b0352[_0xc2a4('0x48')]]=[];if(_[_0xc2a4('0x5f')](this[_0xc2a4('0x11')][_0x4b0352[_0xc2a4('0x48')]]))this[_0xc2a4('0x11')][_0x4b0352[_0xc2a4('0x48')]]={};var _0x4c2e65=new QueueReport();_0x4c2e65[_0xc2a4('0x4a')]=_0x4b0352['queue'];_0x4c2e65['type']=this[_0xc2a4('0x13')][_0x4c2e65[_0xc2a4('0x4a')]]&&this['voiceQueues'][_0x4c2e65[_0xc2a4('0x4a')]][_0xc2a4('0x4e')]?this['voiceQueues'][_0x4c2e65['name']][_0xc2a4('0x4e')]||'inbound':_0xc2a4('0x4f');_0x4c2e65[_0xc2a4('0x65')]=_0x4b0352[_0xc2a4('0x65')];_0x4c2e65[_0xc2a4('0x74')]=moment()[_0xc2a4('0x49')](_0xc2a4('0x75'));_0x4c2e65['position']=_0x4b0352[_0xc2a4('0x76')];_0x4c2e65[_0xc2a4('0x77')]=_0x4b0352[_0xc2a4('0x77')];_0x4c2e65[_0xc2a4('0x48')]=_0x4b0352[_0xc2a4('0x48')];_0x4c2e65[_0xc2a4('0x78')]=this[_0xc2a4('0x11')][_0x4b0352[_0xc2a4('0x48')]][_0xc2a4('0x78')];logger[_0xc2a4('0x67')](_0xc2a4('0x79'),_0x4c2e65[_0xc2a4('0x4a')],_0x4c2e65['type']);_[_0xc2a4('0x7a')](_0x4c2e65,_[_0xc2a4('0x7b')](_0x4b0352,_['keys'](_0x4c2e65)));this[_0xc2a4('0x3d')][_0x4b0352[_0xc2a4('0x48')]][_0xc2a4('0x7c')](_0x4c2e65);this[_0xc2a4('0x11')][_0x4b0352['uniqueid']]=_0x4c2e65;this['emitVoiceQueueChannelSave'](_0x4c2e65,_0xc2a4('0x7d'));}}catch(_0x543632){logger[_0xc2a4('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4b0352[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x543632,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x1b')]=function(_0x3ddf3c){try{if(this[_0xc2a4('0x5e')](_0x3ddf3c)){logger[_0xc2a4('0x45')](_0xc2a4('0x7e'),_0x3ddf3c[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x3ddf3c,{'showHidden':![],'depth':null}));if(this[_0xc2a4('0x3d')][_0x3ddf3c[_0xc2a4('0x48')]]){var _0x20c7b2=_[_0xc2a4('0x7f')](this['queueReports'][_0x3ddf3c[_0xc2a4('0x48')]]);_0x20c7b2[_0xc2a4('0x80')]=![];_0x20c7b2['queuecallercompleteAt']=null;_0x20c7b2[_0xc2a4('0x81')]=_0x3ddf3c[_0xc2a4('0x81')];_0x20c7b2[_0xc2a4('0x82')]=_0x3ddf3c[_0xc2a4('0x82')];_0x20c7b2[_0xc2a4('0x1a')]=!![];_0x20c7b2[_0xc2a4('0x83')]=moment()['format'](_0xc2a4('0x75'));_0x20c7b2[_0xc2a4('0x84')]='ABANDONED';_0x20c7b2[_0xc2a4('0x85')]=null;logger[_0xc2a4('0x67')](_0xc2a4('0x86'),_0x20c7b2[_0xc2a4('0x4a')],_0x20c7b2[_0xc2a4('0x4e')]);this['channels'][_0x3ddf3c[_0xc2a4('0x48')]]=_0x20c7b2;this[_0xc2a4('0x42')](_0x20c7b2,_0xc2a4('0x1a'));}}}catch(_0x5df647){logger[_0xc2a4('0x3a')](_0xc2a4('0x7e'),_0x3ddf3c[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x5df647,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x1d')]=function(_0x460231){try{if(this[_0xc2a4('0x5e')](_0x460231)){logger['debug'](_0xc2a4('0x87'),_0x460231[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x460231,{'showHidden':![],'depth':null}));if(this[_0xc2a4('0x3d')][_0x460231[_0xc2a4('0x48')]]){var _0x2b9c0a=_['last'](this[_0xc2a4('0x3d')][_0x460231[_0xc2a4('0x48')]]);_0x2b9c0a[_0xc2a4('0x88')]=moment()['format'](_0xc2a4('0x75'));_0x2b9c0a[_0xc2a4('0x89')]=_0x460231[_0xc2a4('0x89')];_0x2b9c0a['connectedlinename']=_0x460231[_0xc2a4('0x8a')];logger[_0xc2a4('0x67')](_0xc2a4('0x8b'),_0x2b9c0a['name'],_0x2b9c0a[_0xc2a4('0x4e')],_0x460231[_0xc2a4('0x89')],_0x460231['connectedlinename']);this[_0xc2a4('0x11')][_0x460231[_0xc2a4('0x48')]]=_0x2b9c0a;this[_0xc2a4('0x8c')](_0x2b9c0a,_0xc2a4('0x1c'));}}}catch(_0x475140){logger[_0xc2a4('0x3a')](_0xc2a4('0x87'),_0x460231[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x475140,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x20')]=function(_0x487aa7){try{if(this['isNotNull'](_0x487aa7)){logger[_0xc2a4('0x45')](_0xc2a4('0x8d'),_0x487aa7['uniqueid'],util[_0xc2a4('0x3c')](_0x487aa7,{'showHidden':![],'depth':null}));if(this[_0xc2a4('0x3d')][_0x487aa7[_0xc2a4('0x48')]]){var _0x383bfa=_['last'](this['queueReports'][_0x487aa7[_0xc2a4('0x48')]]);_0x383bfa['queuecallercomplete']=!![];_0x383bfa[_0xc2a4('0x84')]=_0xc2a4('0x8e');logger[_0xc2a4('0x67')](_0xc2a4('0x8f'),_0x383bfa[_0xc2a4('0x4a')],_0x383bfa[_0xc2a4('0x4e')]);}}}catch(_0x1e1329){logger['error'](_0xc2a4('0x8d'),_0x487aa7['uniqueid'],util[_0xc2a4('0x3c')](_0x1e1329,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x1f')]=function(_0x598818){try{if(this[_0xc2a4('0x5e')](_0x598818)){logger[_0xc2a4('0x45')](_0xc2a4('0x90'),_0x598818['uniqueid'],util[_0xc2a4('0x3c')](_0x598818,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x598818['uniqueid']]){var _0x1ef6be=_['last'](this[_0xc2a4('0x3d')][_0x598818[_0xc2a4('0x48')]]);_0x1ef6be[_0xc2a4('0x1a')]=![];_0x1ef6be['queuecallerabandonAt']=null;_0x1ef6be['assigned']=!![];_0x1ef6be[_0xc2a4('0x85')]=_0x598818[_0xc2a4('0x91')];_0x1ef6be['holdtime']=_0x598818['holdtime'];_0x1ef6be[_0xc2a4('0x80')]=!![];_0x1ef6be['queuecallerexit']=![];_0x1ef6be[_0xc2a4('0x92')]=null;if(!_0x1ef6be[_0xc2a4('0x93')]){if(_0x598818[_0xc2a4('0x94')]==_0xc2a4('0x93')){_0x1ef6be['queuecallerexitreason']=_0xc2a4('0x95');logger[_0xc2a4('0x67')](_0xc2a4('0x96'),_0x1ef6be[_0xc2a4('0x4a')],_0x1ef6be[_0xc2a4('0x4e')]);}else{if(_['startsWith'](_0x598818[_0xc2a4('0x37')][_0xc2a4('0x97')](),_0xc2a4('0x98'))){if(this['queueReports'][_0x598818[_0xc2a4('0x99')]]){var _0x44d11d=_['last'](this[_0xc2a4('0x3d')][_0x598818[_0xc2a4('0x99')]]);_0x44d11d[_0xc2a4('0x80')]=![];_0x44d11d['queuecallerexit']=!![];_0x44d11d[_0xc2a4('0x92')]=moment(_0x1ef6be[_0xc2a4('0x74')])[_0xc2a4('0x9a')](_0x598818[_0xc2a4('0x81')],'seconds')[_0xc2a4('0x49')](_0xc2a4('0x75'));_0x44d11d['queuecallerexitreason']=_0xc2a4('0x9b');_0x44d11d['transfer']=!![];_0x44d11d[_0xc2a4('0x9c')]=_0xc2a4('0x9d');_0x44d11d['transferexten']=_0x598818[_0xc2a4('0x9e')];_0x44d11d[_0xc2a4('0x9f')]=_0x598818['uniqueid'];logger[_0xc2a4('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x44d11d[_0xc2a4('0x4a')],_0x44d11d[_0xc2a4('0x4e')]);var _0x5ccfca=this[_0xc2a4('0x3d')][_0x598818['linkedid']];this[_0xc2a4('0x3d')][_0x598818[_0xc2a4('0x99')]]=this['queueReports'][_0x598818[_0xc2a4('0x48')]];this[_0xc2a4('0x3d')][_0x598818[_0xc2a4('0x48')]]=_0x5ccfca;}}else{_0x1ef6be['queuecallerexitreason']=_0xc2a4('0xa0')+_0x598818[_0xc2a4('0x94')]['toUpperCase']();logger[_0xc2a4('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x1ef6be[_0xc2a4('0x4a')],_0x1ef6be[_0xc2a4('0x4e')],_0x1ef6be[_0xc2a4('0x84')]);}}}this['channels'][_0x598818[_0xc2a4('0x48')]]=_0x1ef6be;this[_0xc2a4('0x42')](_0x1ef6be,_0xc2a4('0x1e'));}}}catch(_0x545f95){logger[_0xc2a4('0x3a')](_0xc2a4('0x90'),_0x598818[_0xc2a4('0x48')],util['inspect'](_0x545f95,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x21')]=function(_0x91292c){try{if(this[_0xc2a4('0x5e')](_0x91292c)){logger[_0xc2a4('0x45')]('[%s][voiceQueueReport][varset]',_0x91292c[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x91292c,{'showHidden':![],'depth':null}));this['addVariable'](_0x91292c[_0xc2a4('0x48')],_[_0xc2a4('0xa1')](_0x91292c[_0xc2a4('0xa2')])[0x0],_0x91292c[_0xc2a4('0xa3')]);if(this[_0xc2a4('0x3d')][_0x91292c[_0xc2a4('0x48')]]){var _0x3ef955=_[_0xc2a4('0x7f')](this[_0xc2a4('0x3d')][_0x91292c[_0xc2a4('0x48')]]);if(_0x3ef955){if(this[_0xc2a4('0x5e')](_0x91292c['variable'])&&this[_0xc2a4('0x5e')](_0x91292c[_0xc2a4('0xa2')][_0xc2a4('0xa4')])){switch(_0x91292c['value']){case _0xc2a4('0xa5'):_0x3ef955[_0xc2a4('0xa6')]=![];_0x3ef955[_0xc2a4('0x92')]=null;break;case _0xc2a4('0xa7'):_0x3ef955[_0xc2a4('0xa8')]=_0xc2a4('0xa9');_0x3ef955[_0xc2a4('0xa6')]=!![];_0x3ef955[_0xc2a4('0x92')]=moment()[_0xc2a4('0x49')](_0xc2a4('0x75'));_0x3ef955[_0xc2a4('0x88')]=moment()[_0xc2a4('0x49')](_0xc2a4('0x75'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x91292c['uniqueid'],util[_0xc2a4('0x3c')](_0x3ef955,{'showHidden':![],'depth':null}));ami[_0xc2a4('0x44')]('custom:timeout',_0x3ef955);break;default:_0x3ef955[_0xc2a4('0xa6')]=!![];_0x3ef955[_0xc2a4('0x92')]=moment()[_0xc2a4('0x49')](_0xc2a4('0x75'));_0x3ef955['queuecallerleaveAt']=moment()[_0xc2a4('0x49')](_0xc2a4('0x75'));}_0x3ef955[_0xc2a4('0x1a')]=![];_0x3ef955[_0xc2a4('0x83')]=null;_0x3ef955[_0xc2a4('0x84')]=_0x91292c[_0xc2a4('0xa3')];this['channels'][_0x91292c[_0xc2a4('0x48')]]=_0x3ef955;this['emitVoiceQueueChannelRemove'](_0x3ef955,'varset');}else if(this['isNotNull'](_0x91292c[_0xc2a4('0xa2')])&&this[_0xc2a4('0x5e')](_0x91292c[_0xc2a4('0xa2')]['queueposition'])){if(!_0x3ef955['queuecallerabandon']){_0x3ef955[_0xc2a4('0xa6')]=!![];_0x3ef955[_0xc2a4('0x92')]=moment()['format'](_0xc2a4('0x75'));_0x3ef955[_0xc2a4('0x84')]=_0xc2a4('0xaa');_0x3ef955[_0xc2a4('0x88')]=moment()[_0xc2a4('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc2a4('0x11')][_0x91292c['uniqueid']]=_0x3ef955;}}logger[_0xc2a4('0x67')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x91292c[_0xc2a4('0x48')],_0x3ef955[_0xc2a4('0x4a')],_0x3ef955[_0xc2a4('0x4e')],_[_0xc2a4('0xa1')](_0x91292c[_0xc2a4('0xa2')])[0x0],_0x91292c['value']);_0x3ef955[_0xc2a4('0x16')]=this[_0xc2a4('0x16')][_0x91292c[_0xc2a4('0x48')]];}}}}catch(_0xff361d){logger[_0xc2a4('0x3a')](_0xc2a4('0xab'),_0x91292c[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0xff361d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc2a4('0xac')]=function(_0x52104b,_0x16ebb4,_0x1ca0c2){var _0x128714=[_0xc2a4('0xad'),_0xc2a4('0xae'),_0xc2a4('0xaf'),_0xc2a4('0xb0'),_0xc2a4('0xb1'),_0xc2a4('0xb2'),_0xc2a4('0xb3'),'rtpaudioqosrttbridged',_0xc2a4('0xb4'),_0xc2a4('0xb5'),'bridgepeer',_0xc2a4('0xb6'),_0xc2a4('0xb7'),_0xc2a4('0xb8'),'memberinterface',_0xc2a4('0xb9'),'membername',_0xc2a4('0xba'),_0xc2a4('0xbb')];if(!_[_0xc2a4('0x34')](_0x16ebb4)&&!_[_0xc2a4('0xbc')](_0x128714,_0x16ebb4)){if(_[_0xc2a4('0x5f')](this[_0xc2a4('0x16')][_0x52104b])){this[_0xc2a4('0x16')][_0x52104b]={};}this[_0xc2a4('0x16')][_0x52104b][_0x16ebb4]=_0x1ca0c2;}};VoiceQueueReport[_0xc2a4('0xc')][_0xc2a4('0x23')]=function(_0x5c6fbe){try{if(this[_0xc2a4('0x5e')](_0x5c6fbe)){logger['debug'](_0xc2a4('0xbd'),_0x5c6fbe[_0xc2a4('0x48')],util[_0xc2a4('0x3c')](_0x5c6fbe,{'showHidden':![],'depth':null}));if(this[_0xc2a4('0x3d')][_0x5c6fbe['uniqueid']]){for(var _0x10c262=0x0,_0x5a8fb3={};_0x10c262=0x0?moment(_0x51762b[_0xd249('0x17')])['diff'](_0x51762b[_0xd249('0x16')],_0xd249('0xc')):null,'data1':_0xd249('0x18'),'data2':_0x51762b[_0xd249('0x11')],'data3':_0x51762b[_0xd249('0xf')],'data4':_0x51762b[_0xd249('0x19')]||null,'role':'agent','internal':_0x51762b[_0xd249('0x11')]?_[_0xd249('0x12')](_0x51762b[_0xd249('0x11')]):undefined,'uniqueid':_0x51762b['uniqueid']},'log':_0xd249('0x14')});}; \ No newline at end of file +var _0x5ef1=['util','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','TALKING','seconds','inbound','calleridnum','queue','agent','accountcode','uniqueid','voiceDialReport','membername','endtime','diff','starttime','outbound','exten','toNumber','moment','lodash'];(function(_0x2858b9,_0x548f7b){var _0x585277=function(_0x40a7ad){while(--_0x40a7ad){_0x2858b9['push'](_0x2858b9['shift']());}};_0x585277(++_0x548f7b);}(_0x5ef1,0x1ae));var _0x15ef=function(_0x4b4739,_0x9b3da9){_0x4b4739=_0x4b4739-0x0;var _0x2f1495=_0x5ef1[_0x4b4739];return _0x2f1495;};'use strict';var moment=require(_0x15ef('0x0'));var _=require(_0x15ef('0x1'));var util=require(_0x15ef('0x2'));var client=require('../client');exports[_0x15ef('0x3')]=function(_0x3d39fd){var _0x38e7ae=_0x3d39fd[_0x15ef('0x4')]||_0x3d39fd['queuecallerexitAt'];return client[_0x15ef('0x5')](_0x15ef('0x6'),{'body':{'channel':_0x15ef('0x7'),'membername':_0x3d39fd[_0x15ef('0x8')],'interface':_['isNil'](_0x3d39fd[_0x15ef('0x9')])?util[_0x15ef('0xa')]('SIP/%s',_0x3d39fd['lastAssignedTo']):_0x3d39fd[_0x15ef('0x9')],'type':_0x15ef('0xb'),'enterAt':_0x3d39fd['queuecallerleaveAt'],'exitAt':_0x38e7ae,'duration':moment(_0x38e7ae)['diff'](_0x3d39fd['queuecallerleaveAt'],_0x15ef('0xc')),'data1':_0x15ef('0xd'),'data2':_0x3d39fd[_0x15ef('0xe')],'data3':_0x3d39fd['exten'],'data4':null,'data5':_0x3d39fd[_0x15ef('0xf')],'role':_0x15ef('0x10'),'internal':_0x3d39fd[_0x15ef('0x11')]?_['toNumber'](_0x3d39fd[_0x15ef('0x11')]):undefined,'uniqueid':_0x3d39fd[_0x15ef('0x12')]},'log':_0x15ef('0x6')});};exports[_0x15ef('0x13')]=function(_0x415900){return client[_0x15ef('0x5')]('CreateMemberReport',{'body':{'channel':_0x15ef('0x7'),'membername':_0x415900[_0x15ef('0x14')],'interface':_0x415900['interface'],'type':'TALKING','enterAt':_0x415900['starttime'],'exitAt':_0x415900[_0x15ef('0x15')],'duration':moment(_0x415900['endtime'])[_0x15ef('0x16')](_0x415900[_0x15ef('0x17')],_0x15ef('0xc'))>=0x0?moment(_0x415900[_0x15ef('0x15')])[_0x15ef('0x16')](_0x415900[_0x15ef('0x17')],_0x15ef('0xc')):null,'data1':_0x15ef('0x18'),'data2':_0x415900[_0x15ef('0x11')],'data3':_0x415900[_0x15ef('0x19')],'data4':_0x415900['dialstring']||null,'role':'agent','internal':_0x415900[_0x15ef('0x11')]?_[_0x15ef('0x1a')](_0x415900[_0x15ef('0x11')]):undefined,'uniqueid':_0x415900[_0x15ef('0x12')]},'log':_0x15ef('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 1621379..a44487a 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 _0xe812=['getSettings','Request','GetSettings'];(function(_0x5d1e84,_0x126635){var _0x3c0090=function(_0x11f7db){while(--_0x11f7db){_0x5d1e84['push'](_0x5d1e84['shift']());}};_0x3c0090(++_0x126635);}(_0xe812,0x1f2));var _0x2e81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe812[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports[_0x2e81('0x0')]=function(){return client[_0x2e81('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x2e81('0x2')});}; \ No newline at end of file +var _0xe28e=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x5a3c68,_0x1633b5){var _0x500a46=function(_0x5832eb){while(--_0x5832eb){_0x5a3c68['push'](_0x5a3c68['shift']());}};_0x500a46(++_0x1633b5);}(_0xe28e,0x1ba));var _0xee28=function(_0x2b349e,_0x160c6a){_0x2b349e=_0x2b349e-0x0;var _0x170571=_0xe28e[_0x2b349e];return _0x170571;};'use strict';var client=require(_0xee28('0x0'));exports[_0xee28('0x1')]=function(){return client[_0xee28('0x2')](_0xee28('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xee28('0x4')]},'log':_0xee28('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 71a1cc5..eab6b30 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 _0x9425=['getTemplates','Request','GetTemplate','name','html'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x9425,0x91));var _0x5942=function(_0x4b44a0,_0x541395){_0x4b44a0=_0x4b44a0-0x0;var _0x1203f4=_0x9425[_0x4b44a0];return _0x1203f4;};'use strict';var client=require('../client');exports[_0x5942('0x0')]=function(_0x99d43){return function(_0x2b1dfe){return client[_0x5942('0x1')](_0x5942('0x2'),{'options':{'raw':!![],'attributes':['id',_0x5942('0x3'),_0x5942('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x15fe=['../client','getTemplates','name','GetTemplate'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x15fe,0x158));var _0xe15f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x15fe[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0xe15f('0x0'));exports[_0xe15f('0x1')]=function(_0x372592){return function(_0x3d46ae){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xe15f('0x2'),'html']},'log':_0xe15f('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index cbbb8b5..a481574 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 _0x2a8d=['Actions','action','data2','data3','data4','data5','GetTrigger','../client','getTriggers','name','channel','status','Condition','AllConditions','value','AnyConditions','field','operator','Action'];(function(_0x2e94a8,_0x1cfb4a){var _0x28ab4c=function(_0x3bc266){while(--_0x3bc266){_0x2e94a8['push'](_0x2e94a8['shift']());}};_0x28ab4c(++_0x1cfb4a);}(_0x2a8d,0xc5));var _0xd2a8=function(_0x5053ff,_0x3fb835){_0x5053ff=_0x5053ff-0x0;var _0x2d4f6c=_0x2a8d[_0x5053ff];return _0x2d4f6c;};'use strict';var client=require(_0xd2a8('0x0'));exports[_0xd2a8('0x1')]=function(_0x2b01b4){return function(_0x112996){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xd2a8('0x2'),_0xd2a8('0x3'),_0xd2a8('0x4')],'include':[{'model':_0xd2a8('0x5'),'as':_0xd2a8('0x6'),'attributes':['id','field','operator',_0xd2a8('0x7')]},{'model':_0xd2a8('0x5'),'as':_0xd2a8('0x8'),'attributes':['id',_0xd2a8('0x9'),_0xd2a8('0xa'),_0xd2a8('0x7')]},{'model':_0xd2a8('0xb'),'as':_0xd2a8('0xc'),'attributes':['id',_0xd2a8('0xd'),'data1',_0xd2a8('0xe'),_0xd2a8('0xf'),_0xd2a8('0x10'),_0xd2a8('0x11'),'data6','data7']}]},'log':_0xd2a8('0x12')});};}; \ No newline at end of file +var _0xcae9=['Condition','operator','value','Action','action','data2','data3','data4','data6','Request','GetTrigger','name','channel','status'];(function(_0x58cf7a,_0x9f0265){var _0x3d1b0f=function(_0x39719e){while(--_0x39719e){_0x58cf7a['push'](_0x58cf7a['shift']());}};_0x3d1b0f(++_0x9f0265);}(_0xcae9,0xcd));var _0x9cae=function(_0x5becd6,_0x13e651){_0x5becd6=_0x5becd6-0x0;var _0x3b7b78=_0xcae9[_0x5becd6];return _0x3b7b78;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x1a1fa0){return function(_0x217aff){return client[_0x9cae('0x0')](_0x9cae('0x1'),{'options':{'raw':![],'attributes':['id',_0x9cae('0x2'),_0x9cae('0x3'),_0x9cae('0x4')],'include':[{'model':_0x9cae('0x5'),'as':'AllConditions','attributes':['id','field',_0x9cae('0x6'),'value']},{'model':_0x9cae('0x5'),'as':'AnyConditions','attributes':['id','field',_0x9cae('0x6'),_0x9cae('0x7')]},{'model':_0x9cae('0x8'),'as':'Actions','attributes':['id',_0x9cae('0x9'),'data1',_0x9cae('0xa'),_0x9cae('0xb'),_0x9cae('0xc'),'data5',_0x9cae('0xd'),'data7']}]},'log':_0x9cae('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a9117eb..6e176a6 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 _0xc5c7=['GetTrunk','name','defaultuser','getTrunks','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x226822,_0x4182a5){_0x226822=_0x226822-0x0;var _0x1938e2=_0xc5c7[_0x226822];return _0x1938e2;};'use strict';var client=require('../client');exports[_0x7c5c('0x0')]=function(_0x28e1a9){return function(_0x2e1b3a){return client[_0x7c5c('0x1')](_0x7c5c('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7c5c('0x3'),'registry',_0x7c5c('0x4')]},'log':_0x7c5c('0x2')});};}; \ No newline at end of file +var _0xb767=['name','defaultuser','getTrunks','Request','GetTrunk'];(function(_0x58ca46,_0x255c4f){var _0x29d8a1=function(_0x1ae54e){while(--_0x1ae54e){_0x58ca46['push'](_0x58ca46['shift']());}};_0x29d8a1(++_0x255c4f);}(_0xb767,0x160));var _0x7b76=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb767[_0x4a9fb1];return _0x348672;};'use strict';var client=require('../client');exports[_0x7b76('0x0')]=function(_0x2b7301){return function(_0x57669c){return client[_0x7b76('0x1')](_0x7b76('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7b76('0x3'),'registry',_0x7b76('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7f734de..a1f9989 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(_0xed372a,_0x2c514a){var _0x4d30c1=function(_0x371226){while(--_0x371226){_0xed372a['push'](_0xed372a['shift']());}};_0x4d30c1(++_0x2c514a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0xcb91[_0x29a29f];return _0x443ea3;};'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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 72d1ffa..a4ef9a0 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 _0xa41e=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x1156af,_0x16ffe7){var _0x241968=function(_0x239262){while(--_0x239262){_0x1156af['push'](_0x1156af['shift']());}};_0x241968(++_0x16ffe7);}(_0xa41e,0x9c));var _0xea41=function(_0x3d00dd,_0x4e8fd8){_0x3d00dd=_0x3d00dd-0x0;var _0x199270=_0xa41e[_0x3d00dd];return _0x199270;};'use strict';var client=require(_0xea41('0x0'));exports[_0xea41('0x1')]=function(_0x12ffe4){return client[_0xea41('0x2')]('CreateVoiceAgentReport',{'body':_0x12ffe4,'log':_0xea41('0x3')});};exports[_0xea41('0x4')]=function(_0x297b1d,_0x4cbc9f,_0x5afeaf){return client[_0xea41('0x2')](_0xea41('0x5'),{'body':_0x297b1d,'options':{'where':{'uniqueid':_0x4cbc9f,'interface':_0x5afeaf,'agentcomplete':!![]}},'log':_0xea41('0x5')});}; \ No newline at end of file +var _0x8d2e=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x2808f6,_0x4e2ef7){var _0x44d32b=function(_0x4c5606){while(--_0x4c5606){_0x2808f6['push'](_0x2808f6['shift']());}};_0x44d32b(++_0x4e2ef7);}(_0x8d2e,0x8f));var _0xe8d2=function(_0x78ecc5,_0x7bd145){_0x78ecc5=_0x78ecc5-0x0;var _0x4398bb=_0x8d2e[_0x78ecc5];return _0x4398bb;};'use strict';var client=require(_0xe8d2('0x0'));exports[_0xe8d2('0x1')]=function(_0xd40510){return client[_0xe8d2('0x2')](_0xe8d2('0x3'),{'body':_0xd40510,'log':_0xe8d2('0x3')});};exports['update']=function(_0x5a91e9,_0x571b80,_0x110e08){return client[_0xe8d2('0x2')](_0xe8d2('0x4'),{'body':_0x5a91e9,'options':{'where':{'uniqueid':_0x571b80,'interface':_0x110e08,'agentcomplete':!![]}},'log':_0xe8d2('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 6f695dc..4772bec 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 _0xbff1=['duration','billableseconds','GetVoiceCallReports','util','lodash','create','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xbff1,0x123));var _0x1bff=function(_0x34217a,_0x1f545a){_0x34217a=_0x34217a-0x0;var _0x23c2be=_0xbff1[_0x34217a];return _0x23c2be;};'use strict';var moment=require('moment');var util=require(_0x1bff('0x0'));var _=require(_0x1bff('0x1'));var client=require('../client');exports[_0x1bff('0x2')]=function(_0x2b2568){return client[_0x1bff('0x3')](_0x1bff('0x4'),{'body':_['merge'](_0x2b2568,{'source':_0x2b2568['calleridnum'],'destinationcontext':_0x2b2568[_0x1bff('0x5')],'callerid':_0x2b2568[_0x1bff('0x6')],'amaflags':_0x1bff('0x7')}),'log':_0x1bff('0x4')});};exports[_0x1bff('0x8')]=function(){return function(){return client[_0x1bff('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x1bff('0x9')](_0x1bff('0xa'))[_0x1bff('0xb')](_0x1bff('0xc')),moment()[_0x1bff('0xd')](_0x1bff('0xa'))[_0x1bff('0xb')](_0x1bff('0xc'))]}},'attributes':[_0x1bff('0xe'),'disposition',_0x1bff('0xf'),_0x1bff('0x10')]},'log':_0x1bff('0x11')});};}; \ No newline at end of file +var _0x7cb2=['create','Request','merge','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','GetVoiceCallReports'];(function(_0x1d25fc,_0x18bad8){var _0x1d1522=function(_0x5bc481){while(--_0x5bc481){_0x1d25fc['push'](_0x1d25fc['shift']());}};_0x1d1522(++_0x18bad8);}(_0x7cb2,0x1e0));var _0x27cb=function(_0x37f647,_0x3bb179){_0x37f647=_0x37f647-0x0;var _0x4530cc=_0x7cb2[_0x37f647];return _0x4530cc;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require('../client');exports[_0x27cb('0x0')]=function(_0x86c95d){return client[_0x27cb('0x1')]('CreateVoiceCallReport',{'body':_[_0x27cb('0x2')](_0x86c95d,{'source':_0x86c95d['calleridnum'],'destinationcontext':_0x86c95d['context'],'callerid':_0x86c95d[_0x27cb('0x3')],'amaflags':_0x27cb('0x4')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x27cb('0x1')](_0x27cb('0x5'),{'options':{'where':{'type':[_0x27cb('0x6')],'createdAt':{'$between':[moment()[_0x27cb('0x7')](_0x27cb('0x8'))['format'](_0x27cb('0x9')),moment()[_0x27cb('0xa')](_0x27cb('0x8'))[_0x27cb('0xb')](_0x27cb('0x9'))]}},'attributes':[_0x27cb('0xc'),_0x27cb('0xd'),_0x27cb('0xe'),'billableseconds']},'log':_0x27cb('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 468623f..9c91260 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 _0x004c=['Request','CreateVoiceDialReport','create'];(function(_0x4a1b3c,_0x20aa97){var _0xe314d7=function(_0x220bdf){while(--_0x220bdf){_0x4a1b3c['push'](_0x4a1b3c['shift']());}};_0xe314d7(++_0x20aa97);}(_0x004c,0xe6));var _0xc004=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x004c[_0x4fbfd9];return _0x31dc94;};'use strict';var client=require('../client');exports[_0xc004('0x0')]=function(_0x11809a){return client[_0xc004('0x1')](_0xc004('0x2'),{'body':_0x11809a,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x6dcf=['create','CreateVoiceDialReport','../client'];(function(_0x5ac3e3,_0x6fb047){var _0x1e8fd0=function(_0x590746){while(--_0x590746){_0x5ac3e3['push'](_0x5ac3e3['shift']());}};_0x1e8fd0(++_0x6fb047);}(_0x6dcf,0x107));var _0xf6dc=function(_0xf48d35,_0x2044f4){_0xf48d35=_0xf48d35-0x0;var _0x23522=_0x6dcf[_0xf48d35];return _0x23522;};'use strict';var client=require(_0xf6dc('0x0'));exports[_0xf6dc('0x1')]=function(_0x1aca76){return client['Request'](_0xf6dc('0x2'),{'body':_0x1aca76,'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 524d38a..6638359 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 _0x0884=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4088('0x0'));exports[_0x4088('0x1')]=function(){return function(){return client[_0x4088('0x2')](_0x4088('0x3'),{'options':{'raw':!![],'attributes':['id',_0x4088('0x4'),_0x4088('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x4088('0x1')});};}; \ No newline at end of file +var _0xac55=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0xaa764d,_0x207138){var _0x110dc9=function(_0x454a1e){while(--_0x454a1e){_0xaa764d['push'](_0xaa764d['shift']());}};_0x110dc9(++_0x207138);}(_0xac55,0x1c8));var _0x5ac5=function(_0x18e39e,_0x29a917){_0x18e39e=_0x18e39e-0x0;var _0xd0aacd=_0xac55[_0x18e39e];return _0xd0aacd;};'use strict';var client=require(_0x5ac5('0x0'));exports[_0x5ac5('0x1')]=function(){return function(){return client[_0x5ac5('0x2')](_0x5ac5('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x5ac5('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x5ac5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index da1014b..d1b6f44 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 _0x8be8=['Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x8be8,0xf6));var _0x88be=function(_0x482acd,_0x2306a6){_0x482acd=_0x482acd-0x0;var _0x36e890=_0x8be8[_0x482acd];return _0x36e890;};'use strict';var client=require(_0x88be('0x0'));exports[_0x88be('0x1')]=function(){return function(){return client[_0x88be('0x2')](_0x88be('0x3'),{'options':{'raw':![],'attributes':['id',_0x88be('0x4'),_0x88be('0x5'),_0x88be('0x6'),_0x88be('0x7'),_0x88be('0x8'),'type',_0x88be('0x9'),'dialMethod',_0x88be('0xa'),'dialLimitQueue',_0x88be('0xb'),_0x88be('0xc'),_0x88be('0xd'),_0x88be('0xe'),_0x88be('0xf'),_0x88be('0x10'),'dialOriginateTimeout',_0x88be('0x11'),'dialQueueTimeout',_0x88be('0x12'),_0x88be('0x13'),_0x88be('0x14'),'dialBusyMaxRetry',_0x88be('0x15'),_0x88be('0x16'),_0x88be('0x17'),'dialGlobalMaxRetry',_0x88be('0x18'),'dialGlobalInterval',_0x88be('0x19'),'dialCheckDuplicateType','dialAMDActive',_0x88be('0x1a'),_0x88be('0x1b'),_0x88be('0x1c'),_0x88be('0x1d'),_0x88be('0x1e'),_0x88be('0x1f'),_0x88be('0x20'),_0x88be('0x21'),'dialAMDMaximumWordLength',_0x88be('0x22'),_0x88be('0x23'),_0x88be('0x24'),'dialOrderByScheduledAt',_0x88be('0x25'),_0x88be('0x26'),'dialQueueProject2',_0x88be('0x8'),_0x88be('0x27'),_0x88be('0x28'),_0x88be('0x29'),_0x88be('0x2a'),_0x88be('0x2b'),_0x88be('0x2c'),_0x88be('0x2d'),'dialAbandonedMaxRetry',_0x88be('0x2e'),'dialMachineMaxRetry',_0x88be('0x2f'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x88be('0x30'),_0x88be('0x31'),_0x88be('0x32'),'dialPreviewAutoRecallMe'],'include':[{'model':_0x88be('0x33'),'as':_0x88be('0x33'),'attributes':['id',_0x88be('0x4'),_0x88be('0x34'),_0x88be('0x35')]},{'model':_0x88be('0x36'),'as':_0x88be('0x37'),'attributes':['id',_0x88be('0x4')]},{'model':_0x88be('0x33'),'as':_0x88be('0x38'),'attributes':['id',_0x88be('0x4'),_0x88be('0x34'),_0x88be('0x35')]},{'model':_0x88be('0x39'),'as':_0x88be('0x39'),'attributes':['id',_0x88be('0x4')],'include':[{'model':'Interval','as':_0x88be('0x3a'),'attributes':['id',_0x88be('0x4'),_0x88be('0x3b')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x004c=['getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','TrunkBackup','Interval','interval','../client'];(function(_0xb94e42,_0x3dfadf){var _0x17bf66=function(_0x499bdb){while(--_0x499bdb){_0xb94e42['push'](_0xb94e42['shift']());}};_0x17bf66(++_0x3dfadf);}(_0x004c,0x85));var _0xc004=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x004c[_0x29d94e];return _0x106237;};'use strict';var client=require(_0xc004('0x0'));exports[_0xc004('0x1')]=function(){return function(){return client[_0xc004('0x2')](_0xc004('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc004('0x4'),_0xc004('0x5'),_0xc004('0x6'),_0xc004('0x7'),'type',_0xc004('0x8'),'dialMethod',_0xc004('0x9'),_0xc004('0xa'),_0xc004('0xb'),'dialPredictiveOptimization',_0xc004('0xc'),_0xc004('0xd'),_0xc004('0xe'),_0xc004('0xf'),'dialOriginateTimeout',_0xc004('0x10'),_0xc004('0x11'),_0xc004('0x12'),_0xc004('0x13'),_0xc004('0x14'),_0xc004('0x15'),_0xc004('0x16'),_0xc004('0x17'),_0xc004('0x18'),_0xc004('0x19'),'dialTimezone',_0xc004('0x1a'),_0xc004('0x1b'),_0xc004('0x1c'),_0xc004('0x1d'),_0xc004('0x1e'),_0xc004('0x1f'),_0xc004('0x20'),_0xc004('0x21'),_0xc004('0x22'),_0xc004('0x23'),_0xc004('0x24'),_0xc004('0x25'),_0xc004('0x26'),_0xc004('0x27'),'dialRecallMeTimeout',_0xc004('0x28'),_0xc004('0x29'),_0xc004('0x2a'),_0xc004('0x2b'),_0xc004('0x2c'),'monitor_format',_0xc004('0x2d'),_0xc004('0x2e'),_0xc004('0x2f'),_0xc004('0x30'),_0xc004('0x31'),_0xc004('0x32'),_0xc004('0x33'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0xc004('0x34'),_0xc004('0x35'),_0xc004('0x36'),'dialAgentRejectRetryFrequency',_0xc004('0x37'),_0xc004('0x38'),_0xc004('0x39'),_0xc004('0x3a')],'include':[{'model':_0xc004('0x3b'),'as':_0xc004('0x3b'),'attributes':['id',_0xc004('0x3c'),_0xc004('0x3d'),_0xc004('0x3e')]},{'model':_0xc004('0x3f'),'as':'mandatoryDispositionPause','attributes':['id',_0xc004('0x3c')]},{'model':_0xc004('0x3b'),'as':_0xc004('0x40'),'attributes':['id',_0xc004('0x3c'),'callerid',_0xc004('0x3e')]},{'model':'Interval','as':_0xc004('0x41'),'attributes':['id','name'],'include':[{'model':_0xc004('0x41'),'as':'Intervals','attributes':['id','name',_0xc004('0x42')]}]}]},'log':_0xc004('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 63eb658..c255fa3 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(_0x570d4d,_0x451663){var _0xe9e63d=function(_0x59a8ba){while(--_0x59a8ba){_0x570d4d['push'](_0x570d4d['shift']());}};_0xe9e63d(++_0x451663);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x195b80,_0x18420a){var _0x3e84ab=function(_0xcd7d56){while(--_0xcd7d56){_0x195b80['push'](_0x195b80['shift']());}};_0x3e84ab(++_0x18420a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 0f4d5db..84c9753 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 _0xcbee=['../client','getVoiceQueueRtPauses'];(function(_0x346e8a,_0x2c85ce){var _0x56f714=function(_0x3fc542){while(--_0x3fc542){_0x346e8a['push'](_0x346e8a['shift']());}};_0x56f714(++_0x2c85ce);}(_0xcbee,0x86));var _0xecbe=function(_0x3d4145,_0x12c190){_0x3d4145=_0x3d4145-0x0;var _0x2aab78=_0xcbee[_0x3d4145];return _0x2aab78;};'use strict';var client=require(_0xecbe('0x0'));exports[_0xecbe('0x1')]=function(_0x5dbe04){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5dbe04,'paused':!![]},'raw':!![]},'log':_0xecbe('0x1')});};}; \ No newline at end of file +var _0x181f=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x181f,0x1c3));var _0xf181=function(_0x56c570,_0x38bbdd){_0x56c570=_0x56c570-0x0;var _0x4e1068=_0x181f[_0x56c570];return _0x4e1068;};'use strict';var client=require('../client');exports[_0xf181('0x0')]=function(_0x5eb1b8){return function(){return client['Request'](_0xf181('0x1'),{'options':{'where':{'VoiceQueueId':_0x5eb1b8,'paused':!![]},'raw':!![]},'log':_0xf181('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index eeef747..1e5fd6d 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x22b58a,_0x107db0){var _0x3595a5=function(_0x35ef5b){while(--_0x35ef5b){_0x22b58a['push'](_0x22b58a['shift']());}};_0x3595a5(++_0x107db0);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x56464f,_0x364523){var _0x1f9e1b=function(_0x36ba6b){while(--_0x36ba6b){_0x56464f['push'](_0x56464f['shift']());}};_0x1f9e1b(++_0x364523);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index f38de9a..e1216cb 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 _0x55ee=['CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','Request'];(function(_0xf7dc43,_0x8fa320){var _0x383961=function(_0xff5376){while(--_0xff5376){_0xf7dc43['push'](_0xf7dc43['shift']());}};_0x383961(++_0x8fa320);}(_0x55ee,0x100));var _0xe55e=function(_0x4c9250,_0x3e39d4){_0x4c9250=_0x4c9250-0x0;var _0x4b371a=_0x55ee[_0x4c9250];return _0x4b371a;};'use strict';var client=require(_0xe55e('0x0'));exports[_0xe55e('0x1')]={};exports['blindTransfer']=function(_0x50653c){return client[_0xe55e('0x2')](_0xe55e('0x3'),{'body':{'result':_0x50653c['result'],'transfererchannel':_0x50653c[_0xe55e('0x4')],'transferercalleridnum':_0x50653c[_0xe55e('0x5')],'transferercalleridname':_0x50653c[_0xe55e('0x6')],'transfererconnectedlinenum':_0x50653c['transfererconnectedlinenum'],'transfererconnectedlinename':_0x50653c[_0xe55e('0x7')],'transfereraccountcode':_0x50653c[_0xe55e('0x8')],'transferercontext':_0x50653c[_0xe55e('0x9')],'transfererexten':_0x50653c[_0xe55e('0xa')],'transfererlinkedid':_0x50653c[_0xe55e('0xb')],'transfereechannel':_0x50653c['transfereechannel'],'transfereecalleridnum':_0x50653c['transfereecalleridnum'],'transfereecalleridname':_0x50653c[_0xe55e('0xc')],'transfereeconnectedlinenum':_0x50653c[_0xe55e('0xd')],'transfereeconnectedlinename':_0x50653c['transfereeconnectedlinename'],'transfereeaccountcode':_0x50653c['transfereeaccountcode'],'transfereecontext':_0x50653c[_0xe55e('0xe')],'transfereeexten':_0x50653c['transfereeexten'],'transfereelinkedid':_0x50653c[_0xe55e('0xf')],'isexternal':_0x50653c[_0xe55e('0x10')],'context':_0x50653c[_0xe55e('0x11')],'extension':_0x50653c[_0xe55e('0x12')],'type':_0xe55e('0x13')},'log':'CreateVoiceTransferReport'});};exports[_0xe55e('0x14')]=function(_0x18fe7d){return client[_0xe55e('0x2')](_0xe55e('0x3'),{'body':{'result':_0x18fe7d[_0xe55e('0x15')],'transfererchannel':_0x18fe7d[_0xe55e('0x16')],'transferercalleridnum':_0x18fe7d[_0xe55e('0x17')],'transferercalleridname':_0x18fe7d['origtransferercalleridname'],'transfererconnectedlinenum':_0x18fe7d['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x18fe7d[_0xe55e('0x18')],'transfereraccountcode':_0x18fe7d[_0xe55e('0x19')],'transferercontext':_0x18fe7d[_0xe55e('0x1a')],'transfererexten':_0x18fe7d[_0xe55e('0x1b')],'transfererlinkedid':_0x18fe7d[_0xe55e('0x1c')],'transfereechannel':_0x18fe7d[_0xe55e('0x1d')],'transfereecalleridnum':_0x18fe7d['transfertargetcalleridnum'],'transfereecalleridname':_0x18fe7d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x18fe7d[_0xe55e('0x1e')],'transfereeconnectedlinename':_0x18fe7d[_0xe55e('0x1f')],'transfereeaccountcode':_0x18fe7d['transfertargetaccountcode'],'transfereecontext':_0x18fe7d[_0xe55e('0x20')],'transfereeexten':_0x18fe7d[_0xe55e('0x21')],'transfereelinkedid':_0x18fe7d[_0xe55e('0x22')],'isexternal':_0x18fe7d[_0xe55e('0x10')],'context':_0x18fe7d[_0xe55e('0x23')],'extension':_0x18fe7d[_0xe55e('0x24')],'type':'attended'},'log':_0xe55e('0x3')});}; \ No newline at end of file +var _0x19be=['transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel'];(function(_0x42d937,_0x791c6){var _0x1db401=function(_0x4b7ba0){while(--_0x4b7ba0){_0x42d937['push'](_0x42d937['shift']());}};_0x1db401(++_0x791c6);}(_0x19be,0x164));var _0xe19b=function(_0x3c5567,_0x46c69e){_0x3c5567=_0x3c5567-0x0;var _0x15ae6a=_0x19be[_0x3c5567];return _0x15ae6a;};'use strict';var client=require(_0xe19b('0x0'));exports[_0xe19b('0x1')]={};exports[_0xe19b('0x2')]=function(_0x51eaf9){return client[_0xe19b('0x3')](_0xe19b('0x4'),{'body':{'result':_0x51eaf9['result'],'transfererchannel':_0x51eaf9[_0xe19b('0x5')],'transferercalleridnum':_0x51eaf9[_0xe19b('0x6')],'transferercalleridname':_0x51eaf9[_0xe19b('0x7')],'transfererconnectedlinenum':_0x51eaf9[_0xe19b('0x8')],'transfererconnectedlinename':_0x51eaf9['transfererconnectedlinename'],'transfereraccountcode':_0x51eaf9[_0xe19b('0x9')],'transferercontext':_0x51eaf9[_0xe19b('0xa')],'transfererexten':_0x51eaf9[_0xe19b('0xb')],'transfererlinkedid':_0x51eaf9[_0xe19b('0xc')],'transfereechannel':_0x51eaf9[_0xe19b('0xd')],'transfereecalleridnum':_0x51eaf9['transfereecalleridnum'],'transfereecalleridname':_0x51eaf9['transfereecalleridname'],'transfereeconnectedlinenum':_0x51eaf9[_0xe19b('0xe')],'transfereeconnectedlinename':_0x51eaf9[_0xe19b('0xf')],'transfereeaccountcode':_0x51eaf9['transfereeaccountcode'],'transfereecontext':_0x51eaf9[_0xe19b('0x10')],'transfereeexten':_0x51eaf9[_0xe19b('0x11')],'transfereelinkedid':_0x51eaf9[_0xe19b('0x12')],'isexternal':_0x51eaf9[_0xe19b('0x13')],'context':_0x51eaf9[_0xe19b('0x14')],'extension':_0x51eaf9['extension'],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xe19b('0x15')]=function(_0x5d21bb){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x5d21bb['result'],'transfererchannel':_0x5d21bb[_0xe19b('0x16')],'transferercalleridnum':_0x5d21bb[_0xe19b('0x17')],'transferercalleridname':_0x5d21bb[_0xe19b('0x18')],'transfererconnectedlinenum':_0x5d21bb[_0xe19b('0x19')],'transfererconnectedlinename':_0x5d21bb[_0xe19b('0x1a')],'transfereraccountcode':_0x5d21bb[_0xe19b('0x1b')],'transferercontext':_0x5d21bb[_0xe19b('0x1c')],'transfererexten':_0x5d21bb['secondtransfererexten'],'transfererlinkedid':_0x5d21bb[_0xe19b('0x1d')],'transfereechannel':_0x5d21bb[_0xe19b('0x1e')],'transfereecalleridnum':_0x5d21bb['transfertargetcalleridnum'],'transfereecalleridname':_0x5d21bb['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x5d21bb[_0xe19b('0x1f')],'transfereeconnectedlinename':_0x5d21bb[_0xe19b('0x20')],'transfereeaccountcode':_0x5d21bb[_0xe19b('0x21')],'transfereecontext':_0x5d21bb[_0xe19b('0x22')],'transfereeexten':_0x5d21bb['transfertargetexten'],'transfereelinkedid':_0x5d21bb['transfertargetlinkedid'],'isexternal':_0x5d21bb[_0xe19b('0x13')],'context':_0x5d21bb['origtransferercontext'],'extension':_0x5d21bb[_0xe19b('0x23')],'type':_0xe19b('0x24')},'log':_0xe19b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index f1e602e..6918a60 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 _0xeff8=['join','pick','keys','module','action','Reload','then','message','catch','isConnected','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','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','callerid','Interval','push','length','find','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','toLowerCase','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../properties','../ami','listen','format','name','timers','timer','agents','QueuePause','error','asterisk','username','ami\x20disconnected'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xeff8,0x186));var _0x8eff=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xeff8[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var jayson=require('jayson/promise');var schema=require(_0x8eff('0x2'));var BPromise=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var config=require('../../../config/environment');var properties=require(_0x8eff('0x5'));var ami=require(_0x8eff('0x6'));exports[_0x8eff('0x7')]=function(_0x2911b1,_0x4ac51c,_0x469641){return new BPromise(function(_0xb54063,_0x3409bc){var _0x323b2={'QueuePause':function(_0x491f01){return new Promise(function(_0x3fb9ee,_0x19557f){var _0x17f22b=util[_0x8eff('0x8')]('%s/%s','SIP',_0x491f01[_0x8eff('0x9')]);if(_0x2911b1[_0x8eff('0xa')]&&_0x2911b1[_0x8eff('0xa')][_0x17f22b]&&_0x2911b1['timers'][_0x17f22b][_0x8eff('0xb')]){_0x2911b1[_0x8eff('0xa')][_0x17f22b]['updateAcw']();}if(_0x2911b1[_0x8eff('0xc')][_0x17f22b]){_0x2911b1[_0x8eff('0xc')][_0x17f22b]['updateStatusRealtime']({'statePause':_0x491f01['pause']?!![]:![]});}_0x3fb9ee({'code':0xc8,'message':_0x8eff('0xd')});});},'Reload':function(_0x43c914){var _0xfa12bb=this;return new Promise(function(_0x42fb24,_0x1349cb){if(ami['isConnected']()==![]){return _0x1349cb(_0xfa12bb[_0x8eff('0xe')](0x1f4,[config[_0x8eff('0xf')]['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],_0x8eff('0x11')][_0x8eff('0x12')]('\x20')));}_0x43c914=_[_0x8eff('0x13')](_0x43c914,_[_0x8eff('0x14')](properties[_0x8eff('0x15')]));_0x43c914[_0x8eff('0x16')]=_0x8eff('0x17');return ami['Action'](_0x43c914)[_0x8eff('0x18')](function(_0x38fb15){_0x42fb24({'code':0xc8,'message':_0x38fb15[_0x8eff('0x19')]});})[_0x8eff('0x1a')](function(_0x2cd7c5){_0x1349cb(_0xfa12bb[_0x8eff('0xe')](0x1f5,_0x2cd7c5[_0x8eff('0x19')]));});});},'Command':function(_0x399d96){var _0x1b003c=this;return new Promise(function(_0x198ee9,_0x453c7a){if(ami[_0x8eff('0x1b')]()==![]){return _0x453c7a(_0x1b003c[_0x8eff('0xe')](0x1f4,[config[_0x8eff('0xf')]['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],'ami\x20disconnected'][_0x8eff('0x12')]('\x20')));}_0x399d96=_[_0x8eff('0x13')](_0x399d96,'command');_0x399d96[_0x8eff('0x16')]='Command';return ami[_0x8eff('0x1c')](_0x399d96)[_0x8eff('0x18')](function(_0x1ccc79){_0x198ee9({'code':0xc8,'message':_0x1ccc79[_0x8eff('0x1d')]});})[_0x8eff('0x1a')](function(_0x4e891c){_0x453c7a(_0x1b003c[_0x8eff('0xe')](0x1f5,_0x4e891c[_0x8eff('0x19')]));});});},'VoiceQueues':function(_0x50784c){return new Promise(function(_0x15b66f,_0x5ec3d7){var _0x40404b=[];for(var _0x3b698b in _0x2911b1[_0x8eff('0x1e')]){if(_0x2911b1[_0x8eff('0x1e')][_0x8eff('0x1f')](_0x3b698b)){var _0x2e8067=_0x2911b1['voiceQueues'][_0x3b698b];var _0x3e1607={'id':_0x2e8067['id'],'name':_0x2e8067[_0x8eff('0x9')],'strategy':_0x2e8067[_0x8eff('0x20')],'answered':_0x2e8067[_0x8eff('0x21')],'available':_0x2e8067[_0x8eff('0x22')],'loggedIn':_0x2e8067[_0x8eff('0x23')],'pTalking':_0x2e8067['pTalking'],'sumBillable':_0x2e8067['sumBillable'],'sumDuration':_0x2e8067[_0x8eff('0x24')],'sumHoldTime':_0x2e8067[_0x8eff('0x25')]||0x0,'talking':_0x2e8067[_0x8eff('0x26')],'total':_0x2e8067['total'],'type':_0x2e8067[_0x8eff('0x27')],'unmanaged':_0x2e8067[_0x8eff('0x28')],'abandoned':_0x2e8067[_0x8eff('0x29')],'waiting':_0x2e8067[_0x8eff('0x2a')],'loggedInDb':_0x2e8067[_0x8eff('0x2b')]};if(_0x2e8067[_0x8eff('0x27')]===_0x8eff('0x2c')){_0x3e1607[_0x8eff('0x2d')]=_0x2e8067[_0x8eff('0x2d')];_0x3e1607[_0x8eff('0x2e')]=_0x2e8067[_0x8eff('0x2e')];_0x3e1607[_0x8eff('0x2f')]=_0x2e8067['dialOriginateCallerIdName'];_0x3e1607[_0x8eff('0x30')]=_0x2e8067[_0x8eff('0x30')];_0x3e1607[_0x8eff('0x31')]=_0x2e8067[_0x8eff('0x31')];_0x3e1607['dialPrefix']=_0x2e8067[_0x8eff('0x32')];_0x3e1607[_0x8eff('0x33')]=_0x2e8067['temp'];_0x3e1607['outboundAnswerAgiCallsDay']=_0x2e8067[_0x8eff('0x34')];_0x3e1607[_0x8eff('0x35')]=_0x2e8067['outboundAnswerCallsDay'];_0x3e1607['outboundBlacklistCallsDay']=_0x2e8067['outboundBlacklistCallsDay'];_0x3e1607[_0x8eff('0x36')]=_0x2e8067['outboundBusyCallsDay'];_0x3e1607[_0x8eff('0x37')]=_0x2e8067['outboundCongestionCallsDay'];_0x3e1607[_0x8eff('0x38')]=_0x2e8067[_0x8eff('0x38')];_0x3e1607[_0x8eff('0x39')]=_0x2e8067[_0x8eff('0x39')];_0x3e1607[_0x8eff('0x3a')]=_0x2e8067[_0x8eff('0x3a')];_0x3e1607['outboundNoAnswerCallsDay']=_0x2e8067[_0x8eff('0x3b')];_0x3e1607['outboundNoSuchCallsDay']=_0x2e8067[_0x8eff('0x3c')];_0x3e1607['outboundOriginateFailureCallsDay']=_0x2e8067[_0x8eff('0x3d')];_0x3e1607[_0x8eff('0x3e')]=_0x2e8067[_0x8eff('0x3e')];_0x3e1607[_0x8eff('0x3f')]=_0x2e8067['outboundRejectCallsDay'];_0x3e1607[_0x8eff('0x40')]=_0x2e8067[_0x8eff('0x40')];_0x3e1607[_0x8eff('0x41')]=_0x2e8067['predictiveIntervalAnsweredCalls'];_0x3e1607[_0x8eff('0x42')]=_0x2e8067[_0x8eff('0x42')];_0x3e1607[_0x8eff('0x43')]=_0x2e8067[_0x8eff('0x43')];_0x3e1607[_0x8eff('0x44')]=_0x2e8067[_0x8eff('0x44')];_0x3e1607[_0x8eff('0x45')]=_0x2e8067[_0x8eff('0x45')];_0x3e1607[_0x8eff('0x46')]=_0x2e8067['predictiveIntervalErlangCalls'];_0x3e1607['predictiveIntervalErlangCallsDroppedCalls']=_0x2e8067[_0x8eff('0x47')];_0x3e1607[_0x8eff('0x48')]=_0x2e8067[_0x8eff('0x48')];_0x3e1607[_0x8eff('0x49')]=_0x2e8067[_0x8eff('0x49')];_0x3e1607[_0x8eff('0x4a')]=_0x2e8067[_0x8eff('0x4a')];_0x3e1607['predictiveIntervalAvailable']=_0x2e8067[_0x8eff('0x4b')];_0x3e1607[_0x8eff('0x4c')]=_0x2e8067['predictiveIntervalTotalCalls'];_0x3e1607[_0x8eff('0x19')]=_0x2e8067[_0x8eff('0x19')];_0x3e1607[_0x8eff('0x4d')]=_0x2e8067[_0x8eff('0x4d')];_0x3e1607[_0x8eff('0x4e')]=_0x2e8067[_0x8eff('0x4e')];_0x3e1607[_0x8eff('0x4f')]=_0x2e8067[_0x8eff('0x4f')];_0x3e1607[_0x8eff('0x50')]=_0x2e8067['erlangAbandonmentRate'];_0x3e1607[_0x8eff('0x51')]=_0x2e8067[_0x8eff('0x51')];_0x3e1607[_0x8eff('0x52')]=_0x2e8067[_0x8eff('0x52')];_0x3e1607[_0x8eff('0x53')]=_0x2e8067['startProgressive'];}if(_0x2e8067[_0x8eff('0x54')]){_0x3e1607['Trunk']={'id':_0x2e8067[_0x8eff('0x54')]['id'],'name':_0x2e8067[_0x8eff('0x54')][_0x8eff('0x9')],'active':_0x2e8067[_0x8eff('0x54')]['active'],'callerid':_0x2e8067[_0x8eff('0x54')][_0x8eff('0x55')]};}if(_0x2e8067[_0x8eff('0x56')]){_0x3e1607['Interval']={'id':_0x2e8067['Interval']['id'],'name':_0x2e8067[_0x8eff('0x56')][_0x8eff('0x9')]};}_0x40404b[_0x8eff('0x57')](_0x3e1607);}}_0x15b66f({'count':_0x40404b[_0x8eff('0x58')],'rows':_0x40404b});});},'UpdateVoiceQueue':function(_0x37fbdd){return new Promise(function(_0x4819dc,_0x28cb8e){var _0x51aa5d=_[_0x8eff('0x59')](_0x2911b1[_0x8eff('0x1e')],{'id':parseInt(_0x37fbdd['id'])});var _0x577a2b=_['omit'](_0x37fbdd,['id']);if(_0x51aa5d){for(var _0x47ecff in _0x577a2b){if(typeof _0x577a2b[_0x47ecff]!=='undefined'&&typeof _0x51aa5d[_0x47ecff]!=='undefined'){_0x51aa5d[_0x47ecff]=_0x577a2b[_0x47ecff];}}_0x4819dc(_0x51aa5d);}else{_0x28cb8e();}});},'VoiceChannels':function(_0x4feeae){return new Promise(function(_0xcd41c0,_0x44cda1){var _0x33aa8d=_[_0x8eff('0x5a')](_0x2911b1[_0x8eff('0x5b')]);_0xcd41c0({'count':_0x33aa8d[_0x8eff('0x58')],'rows':_0x33aa8d});});},'VoiceChannelMixMonitor':function(_0x27555e){var _0x3067c7=this;return new Promise(function(_0x46944f,_0x3287d6){if(ami['isConnected']()==![]){return _0x3287d6(_0x3067c7[_0x8eff('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],_0x8eff('0x11')][_0x8eff('0x12')]('\x20')));}var _0x5c491b=schema(properties[_0x8eff('0x5c')])[_0x8eff('0x2')](_0x27555e);if(_0x5c491b[_0x8eff('0x58')]>0x0){return _0x3287d6(_0x3067c7[_0x8eff('0xe')](0x1f4,_[_0x8eff('0x5d')](_0x5c491b,_0x8eff('0x19'))[_0x8eff('0x12')](',\x20')));}var _0x47b28d=_[_0x8eff('0x59')](_0x2911b1[_0x8eff('0x5b')],{'uniqueid':_0x27555e[_0x8eff('0x5e')]});if(_0x47b28d&&_0x47b28d[_0x8eff('0x5f')]){var _0x3de247=util[_0x8eff('0x8')](_0x8eff('0x60'),_0x27555e[_0x8eff('0x61')]||_0x27555e[_0x8eff('0x5e')],_0x27555e['format']||'wav');return ami[_0x8eff('0x1c')]({'action':_0x8eff('0x62'),'channel':_0x47b28d[_0x8eff('0x5f')],'file':_0x3de247,'options':_0x8eff('0x63')})[_0x8eff('0x18')](function(_0x9a8a92){var _0x4b92ae=_[_0x8eff('0x59')](_0x47b28d[_0x8eff('0x64')],{'filename':_0x8eff('0x65')+_0x3de247['toLowerCase']()});if(_[_0x8eff('0x66')](_0x4b92ae)){_0x47b28d[_0x8eff('0x64')][_0x8eff('0x57')]({'filename':_0x8eff('0x65')+_0x3de247['toLowerCase'](),'createdAt':moment()[_0x8eff('0x8')](_0x8eff('0x67')),'mixmonitorid':_0x9a8a92[_0x8eff('0x68')],'status':_0x8eff('0x69')});}else{_0x4b92ae[_0x8eff('0x68')]=_0x9a8a92[_0x8eff('0x68')];_0x4b92ae[_0x8eff('0x6a')]='rec';}_0x46944f({'code':0xc8,'message':[_0x27555e[_0x8eff('0x5e')],_0x8eff('0x6b'),_0x9a8a92[_0x8eff('0x68')]][_0x8eff('0x12')]('\x20'),'mixmonitorid':_0x9a8a92[_0x8eff('0x68')]});})['catch'](function(_0x13c2e6){_0x3287d6(_0x3067c7[_0x8eff('0xe')](0x1f5,[_0x27555e[_0x8eff('0x5e')],_0x13c2e6['message'][_0x8eff('0x6c')]()]['join']('\x20')));});}else{return _0x3287d6(_0x3067c7[_0x8eff('0xe')](0x1f5,_0x8eff('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x23ed92){var _0xfecdd8=this;return new Promise(function(_0x3d82b6,_0xa6355e){if(ami[_0x8eff('0x1b')]()==![]){return _0xa6355e(_0xfecdd8['error'](0x1f4,[config['asterisk']['ip'],config[_0x8eff('0xf')]['username'],_0x8eff('0x11')][_0x8eff('0x12')]('\x20')));}var _0x3064ae=schema(properties[_0x8eff('0x5c')])[_0x8eff('0x2')](_0x23ed92);if(_0x3064ae['length']>0x0){return _0xa6355e(_0xfecdd8[_0x8eff('0xe')](0x1f4,_[_0x8eff('0x5d')](_0x3064ae,_0x8eff('0x19'))[_0x8eff('0x12')](',\x20')));}var _0x12c3a2=_[_0x8eff('0x59')](_0x2911b1['channels'],{'uniqueid':_0x23ed92[_0x8eff('0x5e')]});if(_0x12c3a2){return BPromise['resolve']()[_0x8eff('0x18')](function(){if(_0x12c3a2[_0x8eff('0x5f')]){return ami['Action']({'action':_0x8eff('0x6e'),'channel':_0x12c3a2[_0x8eff('0x5f')],'mixmonitorid':_0x23ed92[_0x8eff('0x68')]})[_0x8eff('0x1a')](function(_0x26ce78){});}})[_0x8eff('0x18')](function(){if(_0x12c3a2[_0x8eff('0x6f')]){return ami[_0x8eff('0x1c')]({'action':'StopMixMonitor','channel':_0x12c3a2[_0x8eff('0x6f')],'mixmonitorid':_0x23ed92['mixmonitorid']})['catch'](function(_0x1a748f){});}})[_0x8eff('0x18')](function(_0x487cf2){var _0x2d3cc2=_[_0x8eff('0x59')](_0x12c3a2['monitors'],{'mixmonitorid':_0x23ed92[_0x8eff('0x68')]});if(_0x2d3cc2){_0x2d3cc2[_0x8eff('0x6a')]='stop';}})[_0x8eff('0x18')](function(){var _0x1c6ee1=util[_0x8eff('0x8')](_0x8eff('0x60'),_0x23ed92[_0x8eff('0x61')]||_0x23ed92[_0x8eff('0x5e')],_0x23ed92[_0x8eff('0x8')]||'wav');var _0x479a4b=_[_0x8eff('0x59')](_0x12c3a2[_0x8eff('0x64')],{'filename':_0x8eff('0x65')+_0x1c6ee1[_0x8eff('0x6c')]()});if(_0x479a4b){_0x479a4b[_0x8eff('0x6a')]=_0x8eff('0x70');}})[_0x8eff('0x18')](function(){_0x3d82b6({'code':0xc8,'message':[_0x23ed92['uniqueid'],'StopMixMonitor\x20Success'][_0x8eff('0x12')]('\x20')});})['catch'](function(_0x4a25c6){_0xa6355e(_0xfecdd8['error'](0x1f5,[_0x23ed92[_0x8eff('0x5e')],_0x4a25c6[_0x8eff('0x19')][_0x8eff('0x6c')]()][_0x8eff('0x12')]('\x20')));});}else{return _0xa6355e(_0xfecdd8[_0x8eff('0xe')](0x1f5,_0x8eff('0x6d')));}});},'VoiceQueuesChannels':function(_0x2acfad){return new Promise(function(_0x2bb23a,_0x531452){var _0x227469=_['values'](_0x2911b1[_0x8eff('0x71')]);_0x2bb23a({'count':_0x227469[_0x8eff('0x58')],'rows':_0x227469});});},'VoiceQueuesChannel':function(_0x12ebd1){var _0x225703=this;return new Promise(function(_0x2eca0f,_0x2f65de){var _0x570728=schema(properties[_0x8eff('0x72')])['validate'](_0x12ebd1);if(_0x570728[_0x8eff('0x58')]>0x0){return _0x2f65de(_0x225703[_0x8eff('0xe')](0x1f4,_[_0x8eff('0x5d')](_0x570728,_0x8eff('0x19'))[_0x8eff('0x12')](',\x20')));}var _0x2f30cb=_[_0x8eff('0x59')](_0x2911b1[_0x8eff('0x71')],{'uniqueid':_0x12ebd1[_0x8eff('0x5e')]});if(_0x2f30cb){_0x2eca0f(_0x2f30cb);}else{return _0x2f65de(_0x225703['error'](0x1f5,_0x8eff('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x73b49f){var _0x1299b5=this;return new Promise(function(_0x3eba9e,_0xa5816d){if(ami[_0x8eff('0x1b')]()==![]){return _0xa5816d(_0x1299b5[_0x8eff('0xe')](0x1f4,[config[_0x8eff('0xf')]['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],'ami\x20disconnected']['join']('\x20')));}var _0x5da127=schema(properties['voicequeuechannelhangup'])[_0x8eff('0x2')](_0x73b49f);if(_0x5da127[_0x8eff('0x58')]>0x0){return _0xa5816d(_0x1299b5[_0x8eff('0xe')](0x1f4,_[_0x8eff('0x5d')](_0x5da127,_0x8eff('0x19'))[_0x8eff('0x12')](',\x20')));}var _0x2e9b26=_['find'](_0x2911b1[_0x8eff('0x71')],{'uniqueid':_0x73b49f[_0x8eff('0x5e')]});if(_0x2e9b26&&_0x2e9b26[_0x8eff('0x5f')]){return ami[_0x8eff('0x1c')]({'action':'Hangup','channel':_0x2e9b26[_0x8eff('0x5f')]})[_0x8eff('0x18')](function(_0x4f6a75){_0x3eba9e({'code':0xc8,'message':[_0x73b49f[_0x8eff('0x5e')],_0x4f6a75[_0x8eff('0x19')][_0x8eff('0x6c')]()]['join']('\x20')});})['catch'](function(_0x49f8f1){_0xa5816d(_0x1299b5[_0x8eff('0xe')](0x1f5,[_0x73b49f[_0x8eff('0x5e')],_0x49f8f1[_0x8eff('0x19')][_0x8eff('0x6c')]()][_0x8eff('0x12')]('\x20')));});}else{return _0xa5816d(_0x1299b5[_0x8eff('0xe')](0x1f5,_0x8eff('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x5a329b){var _0x131ff8=this;return new Promise(function(_0x103a50,_0x4272e8){if(ami['isConnected']()==![]){return _0x4272e8(_0x131ff8[_0x8eff('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],'ami\x20disconnected'][_0x8eff('0x12')]('\x20')));}var _0x536b6f=schema(properties[_0x8eff('0x73')])[_0x8eff('0x2')](_0x5a329b);if(_0x536b6f[_0x8eff('0x58')]>0x0){return _0x4272e8(_0x131ff8[_0x8eff('0xe')](0x1f4,_[_0x8eff('0x5d')](_0x536b6f,'message')[_0x8eff('0x12')](',\x20')));}var _0x56fd7d=_[_0x8eff('0x59')](_0x2911b1[_0x8eff('0x71')],{'uniqueid':_0x5a329b[_0x8eff('0x5e')]});if(_0x56fd7d&&_0x56fd7d[_0x8eff('0x5f')]){return ami[_0x8eff('0x1c')]({'action':_0x8eff('0x74'),'channel':_0x56fd7d[_0x8eff('0x5f')],'exten':_0x5a329b[_0x8eff('0x75')],'context':_0x5a329b[_0x8eff('0x76')]||_0x56fd7d['context'],'priority':0x1})[_0x8eff('0x18')](function(_0x29d77f){_0x103a50({'code':0xc8,'message':[_0x5a329b[_0x8eff('0x5e')],_0x29d77f[_0x8eff('0x19')][_0x8eff('0x6c')]()]['join']('\x20')});})[_0x8eff('0x1a')](function(_0x2c231c){_0x4272e8(_0x131ff8['error'](0x1f5,[_0x5a329b['uniqueid'],_0x2c231c[_0x8eff('0x19')][_0x8eff('0x6c')]()][_0x8eff('0x12')]('\x20')));});}else{return _0x4272e8(_0x131ff8[_0x8eff('0xe')](0x1f5,_0x8eff('0x6d')));}});},'Agents':function(_0x24901b){return new Promise(function(_0x5f258c,_0x1c4c30){var _0x522e5f=_[_0x8eff('0x5a')](_0x2911b1[_0x8eff('0xc')]);_0x5f258c({'count':_0x522e5f['length'],'rows':_0x522e5f});});},'Telephones':function(_0x386c1c){return new Promise(function(_0x484289,_0x506c3f){var _0x4522b=_['values'](_0x2911b1[_0x8eff('0x77')]);_0x484289({'count':_0x4522b[_0x8eff('0x58')],'rows':_0x4522b});});},'Trunks':function(_0x4e0128){return new Promise(function(_0x63754,_0x10cb2e){var _0x50dd68=_[_0x8eff('0x5a')](_0x2911b1[_0x8eff('0x78')]);_0x63754({'count':_0x50dd68[_0x8eff('0x58')],'rows':_0x50dd68});});},'OutboundChannels':function(_0x33c21a){return new Promise(function(_0x22abc5,_0x284b0c){var _0x44dedb=_[_0x8eff('0x5a')](_0x2911b1[_0x8eff('0x79')]);_0x22abc5({'count':_0x44dedb['length'],'rows':_0x44dedb});});},'Outbound':function(_0x4f7209){return new Promise(function(_0x4c9436,_0x338269){_0x4c9436(_0x2911b1[_0x8eff('0x2c')]);});},'Campaigns':function(_0x37c149){return new Promise(function(_0x5d3448,_0xe8557f){var _0x35cf4c=_[_0x8eff('0x5a')](_0x2911b1[_0x8eff('0x7a')]);_0x5d3448({'count':_0x35cf4c[_0x8eff('0x58')],'rows':_0x35cf4c});});},'VoiceQueuesPreview':function(_0x1b748e){var _0x5ee248=this;return new Promise(function(_0xec23ba,_0x520715){_0x4ac51c[_0x8eff('0x7b')](_0x1b748e['id'])[_0x8eff('0x18')](function(_0x4b8070){_0xec23ba({'code':0xc8,'message':_0x4b8070[_0x8eff('0x19')]});})[_0x8eff('0x1a')](function(_0x30b929){_0x520715(_0x5ee248[_0x8eff('0xe')](0x1f4,_0x30b929['message']));});});},'EventManager':function(_0x290fa2){var _0x159d86=this;return new Promise(function(_0x46533f,_0x202600){if(!_0x290fa2[_0x8eff('0x7c')]){return _0x202600(_0x159d86['error'](0x1f4,_0x8eff('0x7d')));}ami[_0x8eff('0x7e')](_0x8eff('0x7f')+_0x290fa2['event'],_0x290fa2['message']);_0x46533f({'code':0xc8,'message':_0x290fa2});});},'FaxAccounts':function(_0x58740){return new Promise(function(_0x55ac8,_0xbddba2){var _0x58db46=_[_0x8eff('0x5a')](_0x2911b1['faxAccounts']);_0x55ac8({'count':_0x58db46['length'],'rows':_0x58db46});});},'SendFax':function(_0x10b9ac){var _0x6bc93b=this;return new Promise(function(_0x10ade6,_0x22bcdb){_0x469641[_0x8eff('0x80')](_0x10b9ac)[_0x8eff('0x18')](function(_0x354676){_0x10ade6({'code':0xc8,'message':_0x354676[_0x8eff('0x19')]});})[_0x8eff('0x1a')](function(_0x2936d8){_0x22bcdb(_0x6bc93b[_0x8eff('0xe')](0x1f4,_0x2936d8[_0x8eff('0x19')]));});});},'CheckAfterSend':function(_0x4a7ae5){var _0x34a0f7=this;return new Promise(function(_0x291043,_0x46e6fe){_0x469641[_0x8eff('0x81')](_0x4a7ae5)[_0x8eff('0x18')](function(_0x4e4713){_0x291043({'code':0xc8,'message':_0x4e4713[_0x8eff('0x19')]});})[_0x8eff('0x1a')](function(_0x3cd391){_0x46e6fe(_0x34a0f7[_0x8eff('0xe')](0x1f4,_0x3cd391['message']));});});}};var _0x5db7b8=jayson[_0x8eff('0x82')](_0x323b2)[_0x8eff('0x83')]();_0x5db7b8['on'](_0x8eff('0xe'),function(_0x32d427){return _0x3409bc(_0x32d427);});_0x5db7b8['listen'](0x232a,_0x8eff('0x84'),function(){console[_0x8eff('0x85')](_0x8eff('0x86'),0x232a);return _0xb54063(_0x8eff('0x87')+0x232a);});});}; \ No newline at end of file +var _0xc1c6=['module','action','Action','then','message','command','Command','content','catch','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','undefined','channels','validate','uniqueid','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','toLowerCase','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','send','checkAfterSend','server','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../../../config/environment','../properties','../ami','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick'];(function(_0x35bad0,_0x21927d){var _0x4fe50f=function(_0x1873df){while(--_0x1873df){_0x35bad0['push'](_0x35bad0['shift']());}};_0x4fe50f(++_0x21927d);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2f7acf,_0x3b01f2){_0x2f7acf=_0x2f7acf-0x0;var _0x3549ec=_0xc1c6[_0x2f7acf];return _0x3549ec;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var jayson=require(_0x6c1c('0x2'));var schema=require('validate');var BPromise=require(_0x6c1c('0x3'));var moment=require('moment');var config=require(_0x6c1c('0x4'));var properties=require(_0x6c1c('0x5'));var ami=require(_0x6c1c('0x6'));exports['listen']=function(_0x56ed6f,_0x32af84,_0x524a6b){return new BPromise(function(_0x50c1bb,_0x582bec){var _0xe510ca={'QueuePause':function(_0x2eb1ba){return new Promise(function(_0x38369d,_0x2cec58){var _0x4b66ec=util[_0x6c1c('0x7')](_0x6c1c('0x8'),'SIP',_0x2eb1ba[_0x6c1c('0x9')]);if(_0x56ed6f[_0x6c1c('0xa')]&&_0x56ed6f[_0x6c1c('0xa')][_0x4b66ec]&&_0x56ed6f[_0x6c1c('0xa')][_0x4b66ec]['timer']){_0x56ed6f[_0x6c1c('0xa')][_0x4b66ec][_0x6c1c('0xb')]();}if(_0x56ed6f[_0x6c1c('0xc')][_0x4b66ec]){_0x56ed6f['agents'][_0x4b66ec][_0x6c1c('0xd')]({'statePause':_0x2eb1ba[_0x6c1c('0xe')]?!![]:![]});}_0x38369d({'code':0xc8,'message':_0x6c1c('0xf')});});},'Reload':function(_0x49304f){var _0x2e82e9=this;return new Promise(function(_0x5e64b7,_0x357370){if(ami[_0x6c1c('0x10')]()==![]){return _0x357370(_0x2e82e9[_0x6c1c('0x11')](0x1f4,[config[_0x6c1c('0x12')]['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],_0x6c1c('0x14')][_0x6c1c('0x15')]('\x20')));}_0x49304f=_[_0x6c1c('0x16')](_0x49304f,_['keys'](properties[_0x6c1c('0x17')]));_0x49304f[_0x6c1c('0x18')]='Reload';return ami[_0x6c1c('0x19')](_0x49304f)[_0x6c1c('0x1a')](function(_0x494ffc){_0x5e64b7({'code':0xc8,'message':_0x494ffc[_0x6c1c('0x1b')]});})['catch'](function(_0x338dc2){_0x357370(_0x2e82e9[_0x6c1c('0x11')](0x1f5,_0x338dc2['message']));});});},'Command':function(_0xa667eb){var _0x59ab38=this;return new Promise(function(_0x2db60e,_0x3527bf){if(ami[_0x6c1c('0x10')]()==![]){return _0x3527bf(_0x59ab38[_0x6c1c('0x11')](0x1f4,[config[_0x6c1c('0x12')]['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],_0x6c1c('0x14')][_0x6c1c('0x15')]('\x20')));}_0xa667eb=_[_0x6c1c('0x16')](_0xa667eb,_0x6c1c('0x1c'));_0xa667eb[_0x6c1c('0x18')]=_0x6c1c('0x1d');return ami[_0x6c1c('0x19')](_0xa667eb)[_0x6c1c('0x1a')](function(_0x19c269){_0x2db60e({'code':0xc8,'message':_0x19c269[_0x6c1c('0x1e')]});})[_0x6c1c('0x1f')](function(_0x3a3f13){_0x3527bf(_0x59ab38[_0x6c1c('0x11')](0x1f5,_0x3a3f13[_0x6c1c('0x1b')]));});});},'VoiceQueues':function(_0x3f517e){return new Promise(function(_0x2ef382,_0x7ff10d){var _0x18452d=[];for(var _0x80bc05 in _0x56ed6f[_0x6c1c('0x20')]){if(_0x56ed6f[_0x6c1c('0x20')][_0x6c1c('0x21')](_0x80bc05)){var _0x5f4568=_0x56ed6f[_0x6c1c('0x20')][_0x80bc05];var _0x4d73aa={'id':_0x5f4568['id'],'name':_0x5f4568[_0x6c1c('0x9')],'strategy':_0x5f4568['strategy'],'answered':_0x5f4568[_0x6c1c('0x22')],'available':_0x5f4568['available'],'loggedIn':_0x5f4568[_0x6c1c('0x23')],'pTalking':_0x5f4568[_0x6c1c('0x24')],'sumBillable':_0x5f4568['sumBillable'],'sumDuration':_0x5f4568[_0x6c1c('0x25')],'sumHoldTime':_0x5f4568[_0x6c1c('0x26')]||0x0,'talking':_0x5f4568['talking'],'total':_0x5f4568[_0x6c1c('0x27')],'type':_0x5f4568[_0x6c1c('0x28')],'unmanaged':_0x5f4568[_0x6c1c('0x29')],'abandoned':_0x5f4568[_0x6c1c('0x2a')],'waiting':_0x5f4568['waiting'],'loggedInDb':_0x5f4568['loggedInDb']};if(_0x5f4568[_0x6c1c('0x28')]===_0x6c1c('0x2b')){_0x4d73aa[_0x6c1c('0x2c')]=_0x5f4568[_0x6c1c('0x2c')];_0x4d73aa[_0x6c1c('0x2d')]=_0x5f4568[_0x6c1c('0x2d')];_0x4d73aa['dialOriginateCallerIdName']=_0x5f4568[_0x6c1c('0x2e')];_0x4d73aa[_0x6c1c('0x2f')]=_0x5f4568['dialOriginateCallerIdNumber'];_0x4d73aa[_0x6c1c('0x30')]=_0x5f4568[_0x6c1c('0x30')];_0x4d73aa[_0x6c1c('0x31')]=_0x5f4568[_0x6c1c('0x31')];_0x4d73aa['temp']=_0x5f4568[_0x6c1c('0x32')];_0x4d73aa[_0x6c1c('0x33')]=_0x5f4568[_0x6c1c('0x33')];_0x4d73aa['outboundAnswerCallsDay']=_0x5f4568[_0x6c1c('0x34')];_0x4d73aa['outboundBlacklistCallsDay']=_0x5f4568[_0x6c1c('0x35')];_0x4d73aa['outboundBusyCallsDay']=_0x5f4568[_0x6c1c('0x36')];_0x4d73aa[_0x6c1c('0x37')]=_0x5f4568[_0x6c1c('0x37')];_0x4d73aa['outboundDropCallsDayACS']=_0x5f4568['outboundDropCallsDayACS'];_0x4d73aa[_0x6c1c('0x38')]=_0x5f4568[_0x6c1c('0x38')];_0x4d73aa[_0x6c1c('0x39')]=_0x5f4568['outboundDropCallsDayTimeout'];_0x4d73aa[_0x6c1c('0x3a')]=_0x5f4568['outboundNoAnswerCallsDay'];_0x4d73aa['outboundNoSuchCallsDay']=_0x5f4568[_0x6c1c('0x3b')];_0x4d73aa[_0x6c1c('0x3c')]=_0x5f4568[_0x6c1c('0x3c')];_0x4d73aa[_0x6c1c('0x3d')]=_0x5f4568['outboundReCallsDay'];_0x4d73aa[_0x6c1c('0x3e')]=_0x5f4568[_0x6c1c('0x3e')];_0x4d73aa[_0x6c1c('0x3f')]=_0x5f4568[_0x6c1c('0x3f')];_0x4d73aa[_0x6c1c('0x40')]=_0x5f4568[_0x6c1c('0x40')];_0x4d73aa[_0x6c1c('0x41')]=_0x5f4568[_0x6c1c('0x41')];_0x4d73aa[_0x6c1c('0x42')]=_0x5f4568[_0x6c1c('0x42')];_0x4d73aa['predictiveIntervalDroppedCallsCallersExit']=_0x5f4568[_0x6c1c('0x43')];_0x4d73aa[_0x6c1c('0x44')]=_0x5f4568[_0x6c1c('0x44')];_0x4d73aa[_0x6c1c('0x45')]=_0x5f4568[_0x6c1c('0x45')];_0x4d73aa['predictiveIntervalErlangCallsDroppedCalls']=_0x5f4568['predictiveIntervalErlangCallsDroppedCalls'];_0x4d73aa['predictiveIntervalHitRate']=_0x5f4568[_0x6c1c('0x46')];_0x4d73aa['predictiveIntervalMultiplicativeFactor']=_0x5f4568['predictiveIntervalMultiplicativeFactor'];_0x4d73aa[_0x6c1c('0x47')]=_0x5f4568[_0x6c1c('0x47')];_0x4d73aa['predictiveIntervalAvailable']=_0x5f4568[_0x6c1c('0x48')];_0x4d73aa[_0x6c1c('0x49')]=_0x5f4568[_0x6c1c('0x49')];_0x4d73aa['message']=_0x5f4568[_0x6c1c('0x1b')];_0x4d73aa[_0x6c1c('0x4a')]=_0x5f4568['originated'];_0x4d73aa[_0x6c1c('0x4b')]=_0x5f4568['erlangCalls'];_0x4d73aa[_0x6c1c('0x4c')]=_0x5f4568[_0x6c1c('0x4c')];_0x4d73aa[_0x6c1c('0x4d')]=_0x5f4568[_0x6c1c('0x4d')];_0x4d73aa[_0x6c1c('0x4e')]=_0x5f4568['erlangBusyFactor'];_0x4d73aa[_0x6c1c('0x4f')]=_0x5f4568[_0x6c1c('0x4f')];_0x4d73aa[_0x6c1c('0x50')]=_0x5f4568['startProgressive'];}if(_0x5f4568[_0x6c1c('0x51')]){_0x4d73aa[_0x6c1c('0x51')]={'id':_0x5f4568[_0x6c1c('0x51')]['id'],'name':_0x5f4568[_0x6c1c('0x51')][_0x6c1c('0x9')],'active':_0x5f4568['Trunk'][_0x6c1c('0x52')],'callerid':_0x5f4568['Trunk']['callerid']};}if(_0x5f4568['Interval']){_0x4d73aa[_0x6c1c('0x53')]={'id':_0x5f4568[_0x6c1c('0x53')]['id'],'name':_0x5f4568[_0x6c1c('0x53')][_0x6c1c('0x9')]};}_0x18452d[_0x6c1c('0x54')](_0x4d73aa);}}_0x2ef382({'count':_0x18452d[_0x6c1c('0x55')],'rows':_0x18452d});});},'UpdateVoiceQueue':function(_0x260363){return new Promise(function(_0x167f3b,_0x5ed2d7){var _0x1aae67=_[_0x6c1c('0x56')](_0x56ed6f['voiceQueues'],{'id':parseInt(_0x260363['id'])});var _0x2b4706=_['omit'](_0x260363,['id']);if(_0x1aae67){for(var _0x39e741 in _0x2b4706){if(typeof _0x2b4706[_0x39e741]!==_0x6c1c('0x57')&&typeof _0x1aae67[_0x39e741]!==_0x6c1c('0x57')){_0x1aae67[_0x39e741]=_0x2b4706[_0x39e741];}}_0x167f3b(_0x1aae67);}else{_0x5ed2d7();}});},'VoiceChannels':function(_0x1dd47a){return new Promise(function(_0x261c89,_0x5ea4af){var _0x1fe6e8=_['values'](_0x56ed6f[_0x6c1c('0x58')]);_0x261c89({'count':_0x1fe6e8[_0x6c1c('0x55')],'rows':_0x1fe6e8});});},'VoiceChannelMixMonitor':function(_0x2f6ce0){var _0xa06377=this;return new Promise(function(_0x8d614,_0x26cf7f){if(ami['isConnected']()==![]){return _0x26cf7f(_0xa06377[_0x6c1c('0x11')](0x1f4,[config[_0x6c1c('0x12')]['ip'],config['asterisk'][_0x6c1c('0x13')],_0x6c1c('0x14')][_0x6c1c('0x15')]('\x20')));}var _0x22be7c=schema(properties['voicechannel'])[_0x6c1c('0x59')](_0x2f6ce0);if(_0x22be7c[_0x6c1c('0x55')]>0x0){return _0x26cf7f(_0xa06377[_0x6c1c('0x11')](0x1f4,_['map'](_0x22be7c,'message')['join'](',\x20')));}var _0x5714a6=_['find'](_0x56ed6f[_0x6c1c('0x58')],{'uniqueid':_0x2f6ce0[_0x6c1c('0x5a')]});if(_0x5714a6&&_0x5714a6['channel']){var _0x3ab1af=util[_0x6c1c('0x7')](_0x6c1c('0x5b'),_0x2f6ce0['filename']||_0x2f6ce0['uniqueid'],_0x2f6ce0[_0x6c1c('0x7')]||_0x6c1c('0x5c'));return ami['Action']({'action':_0x6c1c('0x5d'),'channel':_0x5714a6[_0x6c1c('0x5e')],'file':_0x3ab1af,'options':_0x6c1c('0x5f')})[_0x6c1c('0x1a')](function(_0x1f4e95){var _0xc30dde=_['find'](_0x5714a6[_0x6c1c('0x60')],{'filename':_0x6c1c('0x61')+_0x3ab1af['toLowerCase']()});if(_['isNil'](_0xc30dde)){_0x5714a6[_0x6c1c('0x60')][_0x6c1c('0x54')]({'filename':_0x6c1c('0x61')+_0x3ab1af['toLowerCase'](),'createdAt':moment()[_0x6c1c('0x7')](_0x6c1c('0x62')),'mixmonitorid':_0x1f4e95[_0x6c1c('0x63')],'status':_0x6c1c('0x64')});}else{_0xc30dde['mixmonitorid']=_0x1f4e95['mixmonitorid'];_0xc30dde[_0x6c1c('0x65')]=_0x6c1c('0x64');}_0x8d614({'code':0xc8,'message':[_0x2f6ce0[_0x6c1c('0x5a')],'MixMonitor\x20Success',_0x1f4e95['mixmonitorid']][_0x6c1c('0x15')]('\x20'),'mixmonitorid':_0x1f4e95[_0x6c1c('0x63')]});})['catch'](function(_0x2a334b){_0x26cf7f(_0xa06377[_0x6c1c('0x11')](0x1f5,[_0x2f6ce0[_0x6c1c('0x5a')],_0x2a334b[_0x6c1c('0x1b')][_0x6c1c('0x66')]()][_0x6c1c('0x15')]('\x20')));});}else{return _0x26cf7f(_0xa06377['error'](0x1f5,_0x6c1c('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x5a2692){var _0x103fe1=this;return new Promise(function(_0x1930ea,_0x117240){if(ami[_0x6c1c('0x10')]()==![]){return _0x117240(_0x103fe1['error'](0x1f4,[config['asterisk']['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],_0x6c1c('0x14')]['join']('\x20')));}var _0x3273e0=schema(properties[_0x6c1c('0x68')])[_0x6c1c('0x59')](_0x5a2692);if(_0x3273e0[_0x6c1c('0x55')]>0x0){return _0x117240(_0x103fe1[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0x3273e0,_0x6c1c('0x1b'))['join'](',\x20')));}var _0x268fec=_['find'](_0x56ed6f[_0x6c1c('0x58')],{'uniqueid':_0x5a2692[_0x6c1c('0x5a')]});if(_0x268fec){return BPromise[_0x6c1c('0x6a')]()[_0x6c1c('0x1a')](function(){if(_0x268fec['channel']){return ami[_0x6c1c('0x19')]({'action':_0x6c1c('0x6b'),'channel':_0x268fec[_0x6c1c('0x5e')],'mixmonitorid':_0x5a2692[_0x6c1c('0x63')]})[_0x6c1c('0x1f')](function(_0x475c3b){});}})[_0x6c1c('0x1a')](function(){if(_0x268fec[_0x6c1c('0x6c')]){return ami[_0x6c1c('0x19')]({'action':_0x6c1c('0x6b'),'channel':_0x268fec[_0x6c1c('0x6c')],'mixmonitorid':_0x5a2692['mixmonitorid']})[_0x6c1c('0x1f')](function(_0x6b05c7){});}})[_0x6c1c('0x1a')](function(_0x321997){var _0x441648=_['find'](_0x268fec[_0x6c1c('0x60')],{'mixmonitorid':_0x5a2692[_0x6c1c('0x63')]});if(_0x441648){_0x441648['status']=_0x6c1c('0x6d');}})[_0x6c1c('0x1a')](function(){var _0x1b59bf=util['format'](_0x6c1c('0x5b'),_0x5a2692[_0x6c1c('0x6e')]||_0x5a2692[_0x6c1c('0x5a')],_0x5a2692[_0x6c1c('0x7')]||_0x6c1c('0x5c'));var _0x374b22=_['find'](_0x268fec['monitors'],{'filename':_0x6c1c('0x61')+_0x1b59bf[_0x6c1c('0x66')]()});if(_0x374b22){_0x374b22['status']='stop';}})['then'](function(){_0x1930ea({'code':0xc8,'message':[_0x5a2692[_0x6c1c('0x5a')],_0x6c1c('0x6f')][_0x6c1c('0x15')]('\x20')});})[_0x6c1c('0x1f')](function(_0x585d6d){_0x117240(_0x103fe1[_0x6c1c('0x11')](0x1f5,[_0x5a2692['uniqueid'],_0x585d6d['message']['toLowerCase']()][_0x6c1c('0x15')]('\x20')));});}else{return _0x117240(_0x103fe1[_0x6c1c('0x11')](0x1f5,_0x6c1c('0x67')));}});},'VoiceQueuesChannels':function(_0x42ae1b){return new Promise(function(_0x10bfb4,_0x376074){var _0x4e8b8a=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x71')]);_0x10bfb4({'count':_0x4e8b8a[_0x6c1c('0x55')],'rows':_0x4e8b8a});});},'VoiceQueuesChannel':function(_0x5a919a){var _0x585a42=this;return new Promise(function(_0x4ea97d,_0x14a20f){var _0x1b955f=schema(properties['voicequeuechannel'])[_0x6c1c('0x59')](_0x5a919a);if(_0x1b955f['length']>0x0){return _0x14a20f(_0x585a42[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0x1b955f,_0x6c1c('0x1b'))[_0x6c1c('0x15')](',\x20')));}var _0x4b1cac=_[_0x6c1c('0x56')](_0x56ed6f[_0x6c1c('0x71')],{'uniqueid':_0x5a919a['uniqueid']});if(_0x4b1cac){_0x4ea97d(_0x4b1cac);}else{return _0x14a20f(_0x585a42['error'](0x1f5,_0x6c1c('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x2204a6){var _0x10f39d=this;return new Promise(function(_0x52b1a6,_0x13f292){if(ami[_0x6c1c('0x10')]()==![]){return _0x13f292(_0x10f39d['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x6c1c('0x14')]['join']('\x20')));}var _0xea59ea=schema(properties[_0x6c1c('0x72')])[_0x6c1c('0x59')](_0x2204a6);if(_0xea59ea['length']>0x0){return _0x13f292(_0x10f39d[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0xea59ea,_0x6c1c('0x1b'))[_0x6c1c('0x15')](',\x20')));}var _0x13c1de=_['find'](_0x56ed6f[_0x6c1c('0x71')],{'uniqueid':_0x2204a6['uniqueid']});if(_0x13c1de&&_0x13c1de[_0x6c1c('0x5e')]){return ami[_0x6c1c('0x19')]({'action':_0x6c1c('0x73'),'channel':_0x13c1de[_0x6c1c('0x5e')]})[_0x6c1c('0x1a')](function(_0x302948){_0x52b1a6({'code':0xc8,'message':[_0x2204a6[_0x6c1c('0x5a')],_0x302948[_0x6c1c('0x1b')]['toLowerCase']()][_0x6c1c('0x15')]('\x20')});})['catch'](function(_0x47b53d){_0x13f292(_0x10f39d[_0x6c1c('0x11')](0x1f5,[_0x2204a6[_0x6c1c('0x5a')],_0x47b53d[_0x6c1c('0x1b')][_0x6c1c('0x66')]()]['join']('\x20')));});}else{return _0x13f292(_0x10f39d[_0x6c1c('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2c0dd1){var _0x48ff6e=this;return new Promise(function(_0xad1f6,_0x23332d){if(ami[_0x6c1c('0x10')]()==![]){return _0x23332d(_0x48ff6e['error'](0x1f4,[config[_0x6c1c('0x12')]['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],'ami\x20disconnected'][_0x6c1c('0x15')]('\x20')));}var _0x2f9a4d=schema(properties[_0x6c1c('0x74')])[_0x6c1c('0x59')](_0x2c0dd1);if(_0x2f9a4d['length']>0x0){return _0x23332d(_0x48ff6e[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0x2f9a4d,_0x6c1c('0x1b'))[_0x6c1c('0x15')](',\x20')));}var _0x3f87db=_['find'](_0x56ed6f[_0x6c1c('0x71')],{'uniqueid':_0x2c0dd1[_0x6c1c('0x5a')]});if(_0x3f87db&&_0x3f87db[_0x6c1c('0x5e')]){return ami[_0x6c1c('0x19')]({'action':'Redirect','channel':_0x3f87db[_0x6c1c('0x5e')],'exten':_0x2c0dd1[_0x6c1c('0x75')],'context':_0x2c0dd1[_0x6c1c('0x76')]||_0x3f87db['context'],'priority':0x1})[_0x6c1c('0x1a')](function(_0x2684e9){_0xad1f6({'code':0xc8,'message':[_0x2c0dd1['uniqueid'],_0x2684e9[_0x6c1c('0x1b')]['toLowerCase']()][_0x6c1c('0x15')]('\x20')});})[_0x6c1c('0x1f')](function(_0x246682){_0x23332d(_0x48ff6e[_0x6c1c('0x11')](0x1f5,[_0x2c0dd1['uniqueid'],_0x246682[_0x6c1c('0x1b')][_0x6c1c('0x66')]()][_0x6c1c('0x15')]('\x20')));});}else{return _0x23332d(_0x48ff6e['error'](0x1f5,_0x6c1c('0x67')));}});},'Agents':function(_0x1cf3a5){return new Promise(function(_0x4361e5,_0x2ae7b5){var _0x5b01d2=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0xc')]);_0x4361e5({'count':_0x5b01d2[_0x6c1c('0x55')],'rows':_0x5b01d2});});},'Telephones':function(_0x4c0c6d){return new Promise(function(_0x1aa7e0,_0x5baaa9){var _0x29c5c8=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x77')]);_0x1aa7e0({'count':_0x29c5c8[_0x6c1c('0x55')],'rows':_0x29c5c8});});},'Trunks':function(_0x29da07){return new Promise(function(_0x1ff557,_0x389e22){var _0x2b0866=_['values'](_0x56ed6f[_0x6c1c('0x78')]);_0x1ff557({'count':_0x2b0866['length'],'rows':_0x2b0866});});},'OutboundChannels':function(_0x398a61){return new Promise(function(_0x214630,_0x11220a){var _0x10138=_['values'](_0x56ed6f[_0x6c1c('0x79')]);_0x214630({'count':_0x10138[_0x6c1c('0x55')],'rows':_0x10138});});},'Outbound':function(_0x27a8cc){return new Promise(function(_0x5e77e8,_0xf58113){_0x5e77e8(_0x56ed6f[_0x6c1c('0x2b')]);});},'Campaigns':function(_0x4f9477){return new Promise(function(_0x5e4036,_0x197faa){var _0x1456e1=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x7a')]);_0x5e4036({'count':_0x1456e1[_0x6c1c('0x55')],'rows':_0x1456e1});});},'VoiceQueuesPreview':function(_0x12ce5a){var _0x250e21=this;return new Promise(function(_0x3b017d,_0x1f311f){_0x32af84[_0x6c1c('0x7b')](_0x12ce5a['id'])[_0x6c1c('0x1a')](function(_0x3f9697){_0x3b017d({'code':0xc8,'message':_0x3f9697['message']});})[_0x6c1c('0x1f')](function(_0x3a5014){_0x1f311f(_0x250e21[_0x6c1c('0x11')](0x1f4,_0x3a5014[_0x6c1c('0x1b')]));});});},'EventManager':function(_0x40415d){var _0x2af9f3=this;return new Promise(function(_0x469a73,_0x5ca667){if(!_0x40415d[_0x6c1c('0x7c')]){return _0x5ca667(_0x2af9f3['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x6c1c('0x7d')](_0x6c1c('0x7e')+_0x40415d[_0x6c1c('0x7c')],_0x40415d[_0x6c1c('0x1b')]);_0x469a73({'code':0xc8,'message':_0x40415d});});},'FaxAccounts':function(_0x3f09e6){return new Promise(function(_0x21b63d,_0x25198a){var _0x2a2797=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x7f')]);_0x21b63d({'count':_0x2a2797['length'],'rows':_0x2a2797});});},'SendFax':function(_0x3e40b6){var _0x654041=this;return new Promise(function(_0x1a0da8,_0x3efe9c){_0x524a6b[_0x6c1c('0x80')](_0x3e40b6)[_0x6c1c('0x1a')](function(_0x24ffc3){_0x1a0da8({'code':0xc8,'message':_0x24ffc3[_0x6c1c('0x1b')]});})['catch'](function(_0x463e76){_0x3efe9c(_0x654041[_0x6c1c('0x11')](0x1f4,_0x463e76[_0x6c1c('0x1b')]));});});},'CheckAfterSend':function(_0x700aee){var _0x385629=this;return new Promise(function(_0x42a812,_0x152fef){_0x524a6b[_0x6c1c('0x81')](_0x700aee)[_0x6c1c('0x1a')](function(_0x3d92c2){_0x42a812({'code':0xc8,'message':_0x3d92c2[_0x6c1c('0x1b')]});})[_0x6c1c('0x1f')](function(_0x2700b5){_0x152fef(_0x385629[_0x6c1c('0x11')](0x1f4,_0x2700b5['message']));});});}};var _0x58a474=jayson[_0x6c1c('0x82')](_0xe510ca)['http']();_0x58a474['on'](_0x6c1c('0x11'),function(_0x20a29f){return _0x582bec(_0x20a29f);});_0x58a474[_0x6c1c('0x83')](0x232a,_0x6c1c('0x84'),function(){console[_0x6c1c('0x85')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x50c1bb(_0x6c1c('0x86')+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 e7eb502..d075eb3 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(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xb458,0x103));var _0x8b45=function(_0xbca161,_0x4ff432){_0xbca161=_0xbca161-0x0;var _0x16b108=_0xb458[_0xbca161];return _0x16b108;};'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 _0x5636=['data3','split','phone','$or','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','length','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','isNil','routeId','firstName','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','merge','lodash','bluebird','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','data5','xmd-contactid','ListId'];(function(_0x3d0a0f,_0x10a83d){var _0x58432d=function(_0xde9090){while(--_0xde9090){_0x3d0a0f['push'](_0x3d0a0f['shift']());}};_0x58432d(++_0x10a83d);}(_0x5636,0x102));var _0x6563=function(_0x1ab9e0,_0xf6582e){_0x1ab9e0=_0x1ab9e0-0x0;var _0x178472=_0x5636[_0x1ab9e0];return _0x178472;};'use strict';var _=require(_0x6563('0x0'));var BPromise=require(_0x6563('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x6563('0x2'))(_0x6563('0x3'));var cmContactRpc=require(_0x6563('0x4'));config['redis']=_[_0x6563('0x5')](config[_0x6563('0x6')],{'host':_0x6563('0x7'),'port':0x18eb});var io=require(_0x6563('0x8'))(new Redis(config[_0x6563('0x6')]));function emit(_0x193942,_0x9884a9,_0x2d57d5,_0x2d0d5b,_0x98fcd4){logger[_0x6563('0x9')](_0x6563('0xa'),_0x193942,_0x9884a9['id'],_0x2d57d5,_0x2d0d5b,JSON[_0x6563('0xb')](_0x98fcd4));io['to'](_0x2d57d5)['emit'](_0x2d0d5b,_0x98fcd4);}exports['exec']=function(_0x2946f3,_0x129fa3,_0x490a56,_0x506ee9){var _0x5da960,_0x1ef002;var _0x111d38={};var _0x35936d=Number(_0x490a56[_0x6563('0xc')]);var _0x33816e=_0x490a56[_0x6563('0xd')]?Boolean(Number(_0x490a56[_0x6563('0xd')])):![];var _0xbbae72;var _0x447f9a=![];if(!_['isNil'](_0x490a56[_0x6563('0xe')])){if(_0x490a56['data5']=='1')_0x447f9a=!![];}if(!_0x447f9a){if(_0x506ee9[_0x6563('0xf')]){_0x111d38['id']=_0x506ee9[_0x6563('0xf')];}}if(!_0x111d38['id']){_0x111d38[_0x6563('0x10')]=_0x35936d;_0xbbae72=_0x490a56[_0x6563('0x11')]&&_0x490a56['data3']!=='0'?_0x490a56[_0x6563('0x11')][_0x6563('0x12')](','):[_0x6563('0x13')];_0x111d38[_0x6563('0x14')]=_['map'](_0xbbae72,function(_0x3563fd){var _0x589632={};_0x589632[_0x3563fd]=_0x506ee9['routeId']?_0x506ee9['destcalleridnum']:_0x506ee9[_0x6563('0x15')];return _0x589632;});}var _0x4f5609=['id','firstName',_0x6563('0x16'),_0x6563('0x13'),_0x6563('0x17'),_0x6563('0x18'),_0x6563('0x10'),_0x6563('0x19'),_0x6563('0x1a'),_0x6563('0x1b')];var _0x2a70f0=_['union'](_0x4f5609,_0xbbae72);BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x1e')]({'attributes':_0x2a70f0,'where':_0x111d38}))['then'](function(_0x293db2){_0x1ef002=_0x293db2;if(!_['isEmpty'](_0x1ef002)){if(_0x1ef002[_0x6563('0x1f')]===0x1){_0x5da960=_0x1ef002[0x0];logger[_0x6563('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x506ee9['uniqueid'],_0x129fa3['id'],_0x5da960['id']);}else{logger[_0x6563('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_[_0x6563('0x21')](_0x1ef002,'id')[_0x6563('0x22')](','));}return;}else{logger['info'](_0x6563('0x23'),_0x506ee9['uniqueid'],_0x129fa3['id']);var _0x7ea857={'ListId':_0x35936d};var _0x1590e6=_0x490a56['data4']&&_0x490a56[_0x6563('0x24')]!=='0'?_0x490a56[_0x6563('0x24')]:'phone';if(_0x33816e){logger[_0x6563('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x506ee9[_0x6563('0x20')],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_['isNil'](_0x506ee9['routeId'])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857[_0x6563('0x28')]=_0x506ee9['calleridname']&&_0x506ee9[_0x6563('0x29')]!==''?_0x506ee9['calleridname']:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9[_0x6563('0x2b')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:_0x6563('0x2a');}return BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x2d')](_0x7ea857))['then'](function(_0x9b3d86){_0x5da960=_0x9b3d86;_0x1ef002[_0x6563('0x2e')](_0x9b3d86);if(_0x5da960){logger[_0x6563('0x9')](_0x6563('0x2f'),_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_0x5da960['id']);}return;});}else{logger[_0x6563('0x9')](_0x6563('0x30'),_0x506ee9['uniqueid'],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857['firstName']=_0x506ee9[_0x6563('0x29')]&&_0x506ee9[_0x6563('0x29')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x29')]:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9['destcalleridname']!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:'Unknown';}_0x5da960=_0x7ea857;_0x1ef002[_0x6563('0x2e')](_0x7ea857);return;}}})[_0x6563('0x1d')](function(){if(_0x2946f3){emit(_0x506ee9['uniqueid'],_0x129fa3,util['format'](_0x6563('0x31'),_0x2946f3[_0x6563('0x32')]),util[_0x6563('0x33')](_0x6563('0x34'),_0x490a56['action'][_0x6563('0x35')]()),{'evt':_[_0x6563('0x36')](_0x506ee9,{'autoCreate':_0x33816e}),'contact':_0x5da960===undefined?{}:_0x5da960,'contacts':_0x1ef002['length']===0x0?undefined:_0x1ef002});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4b8708e..f47a37c 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 _0x5283=['data6','600','winApplication','format','user:%s','name','trigger:%s:%s','toLowerCase','trigger:%s','contactmanager','integration','exec','accounts','queue','routeId','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','account','chat','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','offlineMessage','event','agent','membername','lastevent','mailSubstatus','null','substatus','exports','util','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','emit','stringify','prototype','motionChannel','undefined','checkTriggers','hasOwnProperty','status','checkTrigger','merge','length','interface','action','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','data3','isNil','location','data4','windowWidth','800','data5','windowHeight'];(function(_0x32ed9c,_0x44b8f7){var _0x5aeda7=function(_0x25ef55){while(--_0x25ef55){_0x32ed9c['push'](_0x32ed9c['shift']());}};_0x5aeda7(++_0x44b8f7);}(_0x5283,0x1af));var _0x3528=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x5283[_0x318840];return _0x223da4;};'use strict';var util=require(_0x3528('0x0'));var _=require(_0x3528('0x1'));var url=require(_0x3528('0x2'));var Mustache=require(_0x3528('0x3'));var Redis=require(_0x3528('0x4'));var urlforward=require('./urlforward');var integration=require(_0x3528('0x5'));var cmContact=require(_0x3528('0x6'));var script=require(_0x3528('0x7'));var config=require(_0x3528('0x8'));var logger=require(_0x3528('0x9'))(_0x3528('0xa'));var ami=require(_0x3528('0xb'));config['redis']=_['defaults'](config[_0x3528('0xc')],{'host':_0x3528('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3528('0xc')]));var operators={'equals':function(_0xc66501,_0xa6b363){return _0xc66501==_0xa6b363;},'not_equals':function(_0x3315c7,_0xd16a85){return _0x3315c7!=_0xd16a85;}};var barAndWebActions=[_0x3528('0xe'),'url',_0x3528('0xf')];function Trigger(_0x50b295){this[_0x3528('0x10')]=_0x50b295[_0x3528('0x10')];this[_0x3528('0x11')]=_0x50b295[_0x3528('0x11')];this[_0x3528('0x12')]=_0x50b295[_0x3528('0x12')];this[_0x3528('0x13')]=_0x50b295[_0x3528('0x13')];this['voiceExtensions']=_0x50b295[_0x3528('0x14')];this['zendeskAccounts']=_0x50b295[_0x3528('0x15')];this[_0x3528('0x16')]=_0x50b295[_0x3528('0x16')];this[_0x3528('0x17')]=_0x50b295[_0x3528('0x17')];this['sugarcrmAccounts']=_0x50b295[_0x3528('0x18')];this[_0x3528('0x19')]=_0x50b295[_0x3528('0x19')];this['deskAccounts']=_0x50b295[_0x3528('0x1a')];this[_0x3528('0x1b')]=_0x50b295[_0x3528('0x1b')];this[_0x3528('0x1c')]=_0x50b295[_0x3528('0x1c')];this[_0x3528('0x1d')]=_0x50b295[_0x3528('0x1d')];this[_0x3528('0x1e')]=_0x50b295[_0x3528('0x1e')];this['accounts']={'zendesk':this[_0x3528('0x15')],'salesforce':this[_0x3528('0x17')],'freshdesk':this[_0x3528('0x16')],'sugarcrm':this[_0x3528('0x18')],'zoho':this[_0x3528('0x19')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x3528('0x1d')],'freshsales':this[_0x3528('0x1e')],'servicenow':this[_0x3528('0x1c')]};ami['on'](_0x3528('0x1f'),this[_0x3528('0x20')]['bind'](this));ami['on'](_0x3528('0x21'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x23'),this['syncCustomEvent'][_0x3528('0x22')](this));ami['on'](_0x3528('0x24'),this['syncCustomEvent'][_0x3528('0x22')](this));ami['on'](_0x3528('0x25'),this['syncCustomEvent'][_0x3528('0x22')](this));ami['on']('custom:agentnoanswer',this[_0x3528('0x20')]['bind'](this));ami['on'](_0x3528('0x26'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x27'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x28'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x29'),this[_0x3528('0x20')]['bind'](this));ami['on'](_0x3528('0x2a'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0x3528('0x22')](this));ami['on'](_0x3528('0x2b'),this[_0x3528('0x2c')][_0x3528('0x22')](this));ami['on'](_0x3528('0x2d'),this['syncAgentDial'][_0x3528('0x22')](this));ami['on'](_0x3528('0x2e'),this['syncAgentDial'][_0x3528('0x22')](this));ami['on'](_0x3528('0x2f'),this['syncCustomEvent'][_0x3528('0x22')](this));ami['on'](_0x3528('0x30'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x31'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x32'),this[_0x3528('0x20')]['bind'](this));ami['on'](_0x3528('0x33'),this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x34'),this['syncCustomEvent'][_0x3528('0x22')](this));ami['on']('custom:rejectmessage',this[_0x3528('0x20')][_0x3528('0x22')](this));ami['on'](_0x3528('0x35'),this[_0x3528('0x20')]['bind'](this));}Trigger['prototype'][_0x3528('0x36')]=function(_0x15135c,_0x598fb2,_0x116a2e){logger['info'](_0x15135c,_0x598fb2,JSON[_0x3528('0x37')](_0x116a2e));io['to'](_0x15135c)[_0x3528('0x36')](_0x598fb2,_0x116a2e);};Trigger[_0x3528('0x38')][_0x3528('0x20')]=function(_0x33d3e8){var _0x37e4c1=_['clone'](_0x33d3e8);if(typeof _0x37e4c1[_0x3528('0x39')]===_0x3528('0x3a')){_0x37e4c1[_0x3528('0x39')]='voice';}this[_0x3528('0x3b')](_0x37e4c1);};Trigger[_0x3528('0x38')][_0x3528('0x2c')]=function(_0x5bbd1d){if(this['agents'][_0x5bbd1d['interface']]){this[_0x3528('0x20')](_0x5bbd1d);}};Trigger[_0x3528('0x38')]['checkTriggers']=function(_0x7942d5){var _0x4d3bef;for(var _0x2bffab in this[_0x3528('0x10')]){if(this[_0x3528('0x10')][_0x3528('0x3c')](_0x2bffab)){if(this[_0x3528('0x10')][_0x2bffab][_0x3528('0x3d')]){_0x4d3bef=this[_0x3528('0x3e')](this[_0x3528('0x10')][_0x2bffab],_0x7942d5);if(_0x4d3bef){_[_0x3528('0x3f')](_0x7942d5,_0x7942d5['variables']);for(var _0x44af65=0x0,_0x27970d,_0x4eca5d,_0x1a0f10;_0x44af650x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x37ec53,_0x35eb1b){var _0x27e6d3=function(_0x3554cd){while(--_0x3554cd){_0x37ec53['push'](_0x37ec53['shift']());}};_0x27e6d3(++_0x35eb1b);}(_0x55ca,0x126));var _0xa55c=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0x55ca[_0x1529a3];return _0x1a0d4b;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 43edeb6..7c6d06c 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 _0x9ae5=['md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','validateEmail','email','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','destcalleridnum','calleridnum','POST','/systemusers(','headers','lastIndexOf','enduserId','outbound','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','Bearer\x20','length','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','idField','substring','indexOf','content','incident','incidents','assign','getString','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','Subjects','Descriptions','odata-entityid','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ae5,0x191));var _0x59ae=function(_0xe7c9f5,_0x5532c4){_0xe7c9f5=_0xe7c9f5-0x0;var _0x253f0e=_0x9ae5[_0xe7c9f5];return _0x253f0e;};'use strict';var _=require(_0x59ae('0x0'));var BPromise=require(_0x59ae('0x1'));var rp=require('request-promise');var util=require(_0x59ae('0x2'));var intUtil=require('./util');var md5=require(_0x59ae('0x3'));var Redis=require('ioredis');var logger=require(_0x59ae('0x4'))(_0x59ae('0x5'));var config=require(_0x59ae('0x6'));config[_0x59ae('0x7')]=_[_0x59ae('0x8')](config[_0x59ae('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x59ae('0x9'))(new Redis(config['redis']));function getAuthToken(_0x4ce896,_0x5cfe3f,_0x40ed22){var _0x5f5016={'method':'POST','uri':_0x5cfe3f,'form':{'client_id':_0x4ce896[_0x59ae('0xa')],'resource':_0x4ce896[_0x59ae('0xb')],'username':_0x4ce896[_0x59ae('0xc')],'password':_0x4ce896[_0x59ae('0xd')],'grant_type':'password','client_secret':_0x4ce896[_0x59ae('0xe')]},'json':!![]};return rp(_0x5f5016)[_0x59ae('0xf')](function(_0x231a2a){return _0x231a2a[_0x59ae('0x10')];})[_0x59ae('0x11')](function(_0x5094a8){logger[_0x59ae('0x12')]('['+[_0x40ed22[_0x59ae('0x13')]()]+_0x59ae('0x14'));return _0x5094a8[_0x59ae('0x15')];});}function getUser(_0x59eb72,_0x4f9700,_0x55fae8,_0x1a90dd,_0x956ee7,_0x389527){return new BPromise(function(_0x38a053,_0x52d0fe){return getAuthToken(_0x4f9700,_0x1a90dd,_0x389527)[_0x59ae('0xf')](function(_0x4fb7cf){var _0x170b15={'method':'GET','uri':_0x956ee7+_0x59ae('0x16'),'headers':{'Authorization':'Bearer\x20'+_0x4fb7cf,'OData-Version':_0x59ae('0x17')},'json':!![]};return rp(_0x170b15);})[_0x59ae('0xf')](function(_0x3c3327){var _0x357b49=_0x3c3327[_0x59ae('0x18')];var _0x4f16a8=![];var _0xd0b815=null;if(!_['isNil'](_0x55fae8)){if(intUtil[_0x59ae('0x19')](_0x55fae8['email'])){_0x59eb72['userEmail']=_0x55fae8[_0x59ae('0x1a')];for(_0xd0b815=0x0;_0xd0b815<_0x357b49['length'];_0xd0b815++){if(_0x357b49[_0xd0b815][_0x59ae('0x1b')]===_0x55fae8['email']&&!_0x357b49[_0xd0b815]['isdisabled']){_0x4f16a8=!![];logger[_0x59ae('0x1c')]('['+[_0x389527[_0x59ae('0x13')]()]+_0x59ae('0x1d')+_0x357b49[_0xd0b815][_0x59ae('0x1e')]+'!');_0x59eb72[_0x59ae('0x1f')]=_0x357b49[_0xd0b815][_0x59ae('0x1e')];}}}}if(!_0x4f16a8){logger[_0x59ae('0x1c')]('['+[_0x389527[_0x59ae('0x13')]()]+_0x59ae('0x20'));_0x59eb72['userEmail']=_0x4f9700[_0x59ae('0xc')];for(_0xd0b815=0x0;_0xd0b815<_0x357b49['length'];_0xd0b815++){if(_0x357b49[_0xd0b815][_0x59ae('0x1b')]===_0x4f9700['username']){_0x59eb72[_0x59ae('0x1f')]=_0x357b49[_0xd0b815]['systemuserid'];}}}_0x38a053(_0x59eb72);})[_0x59ae('0x11')](function(_0x3ecec8){_0x52d0fe(_0x3ecec8[_0x59ae('0x15')]);});});}function createEndUser(_0x12762a,_0x286a41,_0x381c55,_0xdee8ca,_0x231924,_0x23e35b){return new BPromise(function(_0x302601,_0x10414c){return getAuthToken(_0x286a41,_0x381c55,_0x23e35b)['then'](function(_0x513d6b){var _0x401e46=_0x23e35b[_0x59ae('0x21')]()==='outbound'?_0x231924[_0x59ae('0x22')]:_0x231924[_0x59ae('0x23')];var _0x3ed211={'method':_0x59ae('0x24'),'uri':_0xdee8ca+'contacts','body':{'telephone1':_0x401e46,'fullname':_0x401e46,'firstname':_0x401e46,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x59ae('0x25')+_0x12762a[_0x59ae('0x1f')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x513d6b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3ed211);})[_0x59ae('0xf')](function(_0x38bee4){var _0x2e97c1=_0x38bee4[_0x59ae('0x26')]['odata-entityid'];var _0x540805=_0x2e97c1['substring'](_0x2e97c1['lastIndexOf']('(')+0x1,_0x2e97c1[_0x59ae('0x27')](')'));_0x12762a[_0x59ae('0x28')]=_0x540805;_0x302601(_0x12762a);})[_0x59ae('0x11')](function(_0x5dc65b){_0x10414c(_0x5dc65b[_0x59ae('0x15')]);});});}function getEndUser(_0x41262e,_0x31c30b,_0x1aa4a1,_0x5e976c,_0x51afc8,_0x100afa,_0x190058){var _0x51c97c=_0x100afa[_0x59ae('0x21')]()===_0x59ae('0x29')?_0x51afc8[_0x59ae('0x22')]:_0x51afc8['calleridnum'];return getAuthToken(_0x31c30b,_0x1aa4a1,_0x100afa)[_0x59ae('0xf')](function(_0x5d9a22){var _0xfc5088={'method':_0x59ae('0x2a'),'uri':_0x5e976c+_0x59ae('0x2b')+_0x51c97c[_0x59ae('0x2c')]('+','%2b')+'\x27','headers':{'Authorization':_0x59ae('0x2d')+_0x5d9a22,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xfc5088);})[_0x59ae('0xf')](function(_0x5146d6){var _0x3e976a=![];if(!_0x5146d6)return _0x3e976a;var _0x3717ca=_0x5146d6[_0x59ae('0x18')];for(var _0x1de1c7=0x0;_0x1de1c7<_0x3717ca[_0x59ae('0x2e')];_0x1de1c7++){if(_0x3717ca[_0x1de1c7][_0x59ae('0x2f')]===_0x51c97c){_0x3e976a=!![];_0x41262e[_0x59ae('0x28')]=_0x3717ca[_0x1de1c7][_0x59ae('0x30')];}}return _0x3e976a;})[_0x59ae('0xf')](function(_0x8a0da6){if(_0x8a0da6)return _0x41262e;if(_0x190058==='nothing'){logger[_0x59ae('0x1c')]('['+[_0x100afa[_0x59ae('0x13')]()]+_0x59ae('0x31'));return _0x41262e;}return createEndUser(_0x41262e,_0x31c30b,_0x1aa4a1,_0x5e976c,_0x51afc8,_0x100afa)['then'](function(_0x1f12cb){logger[_0x59ae('0x1c')]('['+[_0x100afa[_0x59ae('0x13')]()]+']\x20Enduser\x20created!',_0x1f12cb[_0x59ae('0x28')]);return _0x1f12cb;});});}function getCustomFields(_0x273334,_0x3fcc2d,_0x8bee12){var _0x4744da={};if(_0x273334[_0x59ae('0x2e')]>0x0){_[_0x59ae('0x32')](_0x273334,function(_0x59d0c1){if(_[_0x59ae('0x33')]([_0x59ae('0x34'),_0x59ae('0x35')],_0x59d0c1[_0x59ae('0x36')])&&_0x59d0c1[_0x59ae('0x37')]&&!_0x59d0c1['customField']){var _0x15bf1f=_0x59d0c1[_0x59ae('0x38')]['toLowerCase']();var _0x347b9e=_0x15bf1f[_0x59ae('0x39')](0x0,_0x15bf1f[_0x59ae('0x3a')]('_'));var _0x51438b=_0x15bf1f['substring'](_0x15bf1f['indexOf']('_')+0x1);if(_0x347b9e===_0x8bee12){_0x4744da[_0x51438b]=_0x59d0c1[_0x59ae('0x3b')];}}});}return _0x4744da;}function getTicket(_0x3b6651,_0x32f460,_0x26e2ff,_0x10ded2,_0x15ace2,_0x141a0c,_0x1f88f7){return new BPromise(function(_0x161b74,_0x3a6cad){var _0x20987f;return getAuthToken(_0x32f460,_0x26e2ff,_0x1f88f7)[_0x59ae('0xf')](function(_0x759e5e){if(_0x141a0c['ticketType']===_0x59ae('0x3c')){_0x20987f={'method':'POST','uri':_0x10ded2+_0x59ae('0x3d'),'body':Object[_0x59ae('0x3e')]({},{'title':intUtil[_0x59ae('0x3f')](_0x141a0c['Subjects'],_0x15ace2,'\x20'),'description':intUtil[_0x59ae('0x3f')](_0x141a0c['Descriptions'],_0x15ace2,'\x0a'),'customerid_contact@odata.bind':_0x3b6651['enduserId']?_0x59ae('0x40')+_0x3b6651[_0x59ae('0x28')]+')':undefined,'ownerid@odata.bind':_0x59ae('0x25')+_0x3b6651[_0x59ae('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x141a0c[_0x59ae('0x41')],_0x15ace2,_0x141a0c[_0x59ae('0x42')])),'headers':{'Authorization':_0x59ae('0x2d')+_0x759e5e,'OData-Version':_0x59ae('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x141a0c[_0x59ae('0x42')]===_0x59ae('0x43')){var _0x5f5347=_0x3b6651[_0x59ae('0x28')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3b6651[_0x59ae('0x1f')]+')','participationtypemask':_0x3b6651[_0x59ae('0x44')]===_0x59ae('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x59ae('0x40')+_0x3b6651[_0x59ae('0x28')]+')','participationtypemask':_0x3b6651['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x59ae('0x25')+_0x3b6651[_0x59ae('0x1f')]+')','participationtypemask':_0x3b6651[_0x59ae('0x44')]==='queue'?0x2:0x1}];_0x20987f={'method':_0x59ae('0x24'),'uri':_0x10ded2+_0x59ae('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x59ae('0x3f')](_0x141a0c[_0x59ae('0x47')],_0x15ace2,'\x20'),'phonenumber':String(_0x15ace2[_0x59ae('0x23')]),'description':intUtil[_0x59ae('0x3f')](_0x141a0c[_0x59ae('0x48')],_0x15ace2,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3b6651['enduserId']?_0x59ae('0x40')+_0x3b6651[_0x59ae('0x28')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x3b6651[_0x59ae('0x1f')]+')','directioncode':_0x3b6651[_0x59ae('0x44')]===_0x59ae('0x45')?![]:!![],'phonecall_activity_parties':_0x5f5347},getCustomFields(_0x141a0c[_0x59ae('0x41')],_0x15ace2,_0x141a0c['ticketType'])),'headers':{'Authorization':_0x59ae('0x2d')+_0x759e5e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x20987f);})['then'](function(_0xa50ab1){var _0x3fea96=_0xa50ab1['headers'][_0x59ae('0x49')];var _0x30ddad=_0x3fea96[_0x59ae('0x39')](_0x3fea96['lastIndexOf']('(')+0x1,_0x3fea96['lastIndexOf'](')'));_0x3b6651[_0x59ae('0x4a')]=_0x30ddad;_0x161b74(_0x3b6651);})[_0x59ae('0x11')](function(_0x2cb165){_0x3a6cad(_0x2cb165['message']);});});}function emit(_0x281002,_0x51eedc,_0x385b6d,_0x51673a){var _0x547a0b={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x281002,_0x385b6d,_0x51673a)};io['to'](util[_0x59ae('0x4b')](_0x59ae('0x4c'),_0x51eedc))[_0x59ae('0x4d')](_0x59ae('0x4e'),_0x547a0b);}exports['cs']=function(_0x1015ca,_0x866c45,_0x2134ec,_0x58ecdc,_0x23a052,_0x197b56,_0x43b68b,_0x58e5f0){var _0x5036de={};_0x197b56[_0x59ae('0xb')]=intUtil[_0x59ae('0x4f')](_0x197b56[_0x59ae('0xb')]);_0x197b56[_0x59ae('0x50')]=intUtil['stripTrailingSlash'](_0x197b56['serverUrl']);_0x5036de[_0x59ae('0x44')]=_0x58e5f0==='queue'||_0x58e5f0===_0x59ae('0x51')?_0x59ae('0x45'):'outbound';var _0x46b926=util[_0x59ae('0x4b')](_0x59ae('0x52'),_0x197b56['remoteUri']);var _0x27d2a8=util[_0x59ae('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x197b56['tenantId']);var _0x515ea8=util[_0x59ae('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x197b56['serverUrl'],_0x866c45['uniqueid'],md5(_0x866c45[_0x59ae('0x53')]));if(_0x23a052&&_0x23a052[_0x59ae('0x54')]){logger[_0x59ae('0x1c')](_0x59ae('0x55'),_0x59ae('0x56'));_0x866c45[_0x59ae('0x57')]=_0x515ea8;}else if(_0x43b68b&&_0x43b68b[_0x59ae('0x58')]&&_0x43b68b[_0x59ae('0x58')]!==_0x59ae('0x59')){logger[_0x59ae('0x1c')](_0x59ae('0x5a'),_0x59ae('0x56'));_0x866c45[_0x59ae('0x57')]=_0x515ea8;}else{_0x866c45[_0x59ae('0x57')]='';}return getUser(_0x5036de,_0x197b56,_0x58ecdc,_0x27d2a8,_0x46b926,_0x58e5f0)[_0x59ae('0xf')](function(_0x45705f){logger['info']('['+_0x58e5f0[_0x59ae('0x13')]()+_0x59ae('0x5b'),_0x45705f[_0x59ae('0x1f')]);logger[_0x59ae('0x1c')]('['+_0x58e5f0[_0x59ae('0x13')]()+_0x59ae('0x5c'),_0x45705f[_0x59ae('0x5d')]);return getEndUser(_0x45705f,_0x197b56,_0x27d2a8,_0x46b926,_0x866c45,_0x58e5f0,_0x2134ec['moduleCreate']);})[_0x59ae('0xf')](function(_0x49d719){logger[_0x59ae('0x1c')]('['+_0x58e5f0['toUpperCase']()+_0x59ae('0x5e'),_0x49d719[_0x59ae('0x28')]);logger[_0x59ae('0x1c')]('['+_0x58e5f0[_0x59ae('0x13')]()+_0x59ae('0x5f'),_0x866c45[_0x59ae('0x23')]);return getTicket(_0x49d719,_0x197b56,_0x27d2a8,_0x46b926,_0x866c45,_0x2134ec,_0x58e5f0);})[_0x59ae('0xf')](function(_0x95e31d){logger[_0x59ae('0x1c')](util[_0x59ae('0x4b')]('['+_0x58e5f0[_0x59ae('0x13')]()+_0x59ae('0x60'),_0x2134ec['ticketType'],_0x95e31d[_0x59ae('0x4a')]));logger[_0x59ae('0x1c')](util['format']('['+_0x58e5f0[_0x59ae('0x13')]()+_0x59ae('0x61'),_0x58e5f0));if(_0x58e5f0!==_0x59ae('0x51')){logger[_0x59ae('0x1c')]('['+_0x58e5f0[_0x59ae('0x13')]()+']',_0x59ae('0x62'));emit(_0x197b56['remoteUri'],_0x58ecdc['name'],_0x2134ec[_0x59ae('0x42')],_0x95e31d['ticketId']);}})['catch'](function(_0x4f735b){logger[_0x59ae('0x12')]('['+_0x58e5f0[_0x59ae('0x13')]()+_0x59ae('0x63'),util[_0x59ae('0x64')](_0x4f735b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9421=['ticketType','callDirection','queue','phonecalls','ticketId','format','user:%s','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','inspect','lodash','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','4.0','value','isNil','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','Bearer\x20','enduserId','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','indexOf','content','incident','POST','assign','getString','Subjects','Descriptions','/contacts('];(function(_0x39a3c8,_0x58edc5){var _0x60ec6a=function(_0x1079d7){while(--_0x1079d7){_0x39a3c8['push'](_0x39a3c8['shift']());}};_0x60ec6a(++_0x58edc5);}(_0x9421,0x136));var _0x1942=function(_0x23431a,_0xa9024c){_0x23431a=_0x23431a-0x0;var _0x66f376=_0x9421[_0x23431a];return _0x66f376;};'use strict';var _=require(_0x1942('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0x1942('0x1'));var intUtil=require(_0x1942('0x2'));var md5=require(_0x1942('0x3'));var Redis=require('ioredis');var logger=require(_0x1942('0x4'))(_0x1942('0x5'));var config=require(_0x1942('0x6'));config[_0x1942('0x7')]=_['defaults'](config[_0x1942('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1942('0x7')]));function getAuthToken(_0x10f904,_0x4f394c,_0x1c84e2){var _0x4a5718={'method':'POST','uri':_0x4f394c,'form':{'client_id':_0x10f904[_0x1942('0x8')],'resource':_0x10f904[_0x1942('0x9')],'username':_0x10f904[_0x1942('0xa')],'password':_0x10f904['password'],'grant_type':_0x1942('0xb'),'client_secret':_0x10f904[_0x1942('0xc')]},'json':!![]};return rp(_0x4a5718)[_0x1942('0xd')](function(_0xbdfda1){return _0xbdfda1[_0x1942('0xe')];})[_0x1942('0xf')](function(_0x17c41c){logger[_0x1942('0x10')]('['+[_0x1c84e2[_0x1942('0x11')]()]+_0x1942('0x12'));return _0x17c41c[_0x1942('0x13')];});}function getUser(_0x26acdf,_0x50e7d0,_0x1068e9,_0x13b1b2,_0x137af5,_0x1d7a15){return new BPromise(function(_0x401638,_0x3557f6){return getAuthToken(_0x50e7d0,_0x13b1b2,_0x1d7a15)['then'](function(_0x30c6f3){var _0x355f91={'method':_0x1942('0x14'),'uri':_0x137af5+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x30c6f3,'OData-Version':_0x1942('0x15')},'json':!![]};return rp(_0x355f91);})['then'](function(_0x119ddc){var _0x76d6dd=_0x119ddc[_0x1942('0x16')];var _0x493f97=![];var _0x31cc4b=null;if(!_[_0x1942('0x17')](_0x1068e9)){if(intUtil[_0x1942('0x18')](_0x1068e9[_0x1942('0x19')])){_0x26acdf['userEmail']=_0x1068e9[_0x1942('0x19')];for(_0x31cc4b=0x0;_0x31cc4b<_0x76d6dd['length'];_0x31cc4b++){if(_0x76d6dd[_0x31cc4b][_0x1942('0x1a')]===_0x1068e9[_0x1942('0x19')]&&!_0x76d6dd[_0x31cc4b][_0x1942('0x1b')]){_0x493f97=!![];logger[_0x1942('0x1c')]('['+[_0x1d7a15[_0x1942('0x11')]()]+_0x1942('0x1d')+_0x76d6dd[_0x31cc4b][_0x1942('0x1e')]+'!');_0x26acdf[_0x1942('0x1f')]=_0x76d6dd[_0x31cc4b][_0x1942('0x1e')];}}}}if(!_0x493f97){logger[_0x1942('0x1c')]('['+[_0x1d7a15[_0x1942('0x11')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x26acdf['userEmail']=_0x50e7d0[_0x1942('0xa')];for(_0x31cc4b=0x0;_0x31cc4b<_0x76d6dd[_0x1942('0x20')];_0x31cc4b++){if(_0x76d6dd[_0x31cc4b][_0x1942('0x1a')]===_0x50e7d0[_0x1942('0xa')]){_0x26acdf[_0x1942('0x1f')]=_0x76d6dd[_0x31cc4b][_0x1942('0x1e')];}}}_0x401638(_0x26acdf);})[_0x1942('0xf')](function(_0x281315){_0x3557f6(_0x281315[_0x1942('0x13')]);});});}function createEndUser(_0x5c9975,_0xfbed01,_0x1d8b90,_0x12052c,_0x38d73f,_0x22aff7){return new BPromise(function(_0x2677c3,_0x23adc1){return getAuthToken(_0xfbed01,_0x1d8b90,_0x22aff7)[_0x1942('0xd')](function(_0x3850b0){var _0x1716d7=_0x22aff7[_0x1942('0x21')]()===_0x1942('0x22')?_0x38d73f[_0x1942('0x23')]:_0x38d73f[_0x1942('0x24')];var _0x28eb44={'method':'POST','uri':_0x12052c+_0x1942('0x25'),'body':{'telephone1':_0x1716d7,'fullname':_0x1716d7,'firstname':_0x1716d7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1942('0x26')+_0x5c9975['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x3850b0,'OData-Version':_0x1942('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x28eb44);})[_0x1942('0xd')](function(_0x535d5d){var _0x17b6e3=_0x535d5d[_0x1942('0x27')]['odata-entityid'];var _0x19bb5d=_0x17b6e3[_0x1942('0x28')](_0x17b6e3[_0x1942('0x29')]('(')+0x1,_0x17b6e3['lastIndexOf'](')'));_0x5c9975['enduserId']=_0x19bb5d;_0x2677c3(_0x5c9975);})['catch'](function(_0x4fca58){_0x23adc1(_0x4fca58[_0x1942('0x13')]);});});}function getEndUser(_0x2fbcaf,_0x2b64e4,_0x5d11bd,_0x5427bf,_0x1a7dc0,_0x21188a,_0x307c8f){var _0x39fab9=_0x21188a[_0x1942('0x21')]()===_0x1942('0x22')?_0x1a7dc0[_0x1942('0x23')]:_0x1a7dc0[_0x1942('0x24')];return getAuthToken(_0x2b64e4,_0x5d11bd,_0x21188a)[_0x1942('0xd')](function(_0x371f4c){var _0x289512={'method':_0x1942('0x14'),'uri':_0x5427bf+_0x1942('0x2a')+_0x39fab9[_0x1942('0x2b')]('+',_0x1942('0x2c'))+'\x27','headers':{'Authorization':_0x1942('0x2d')+_0x371f4c,'If-None-Match':null,'OData-Version':_0x1942('0x15')},'json':!![]};return rp(_0x289512);})['then'](function(_0x535d3d){var _0x2e7b3d=![];if(!_0x535d3d)return _0x2e7b3d;var _0x3403cd=_0x535d3d[_0x1942('0x16')];for(var _0x1e8923=0x0;_0x1e8923<_0x3403cd[_0x1942('0x20')];_0x1e8923++){if(_0x3403cd[_0x1e8923]['telephone1']===_0x39fab9){_0x2e7b3d=!![];_0x2fbcaf[_0x1942('0x2e')]=_0x3403cd[_0x1e8923][_0x1942('0x2f')];}}return _0x2e7b3d;})['then'](function(_0x1b7291){if(_0x1b7291)return _0x2fbcaf;if(_0x307c8f==='nothing'){logger['info']('['+[_0x21188a[_0x1942('0x11')]()]+_0x1942('0x30'));return _0x2fbcaf;}return createEndUser(_0x2fbcaf,_0x2b64e4,_0x5d11bd,_0x5427bf,_0x1a7dc0,_0x21188a)[_0x1942('0xd')](function(_0x2e4ba){logger[_0x1942('0x1c')]('['+[_0x21188a['toUpperCase']()]+_0x1942('0x31'),_0x2e4ba['enduserId']);return _0x2e4ba;});});}function getCustomFields(_0x37b104,_0x1b3778,_0x3f3e43){var _0x26009a={};if(_0x37b104['length']>0x0){_[_0x1942('0x32')](_0x37b104,function(_0x415896){if(_[_0x1942('0x33')]([_0x1942('0x34'),_0x1942('0x35')],_0x415896[_0x1942('0x36')])&&_0x415896['nameField']&&!_0x415896[_0x1942('0x37')]){var _0x2ce134=_0x415896[_0x1942('0x38')][_0x1942('0x21')]();var _0x20ccb1=_0x2ce134[_0x1942('0x28')](0x0,_0x2ce134[_0x1942('0x39')]('_'));var _0x47f2e6=_0x2ce134[_0x1942('0x28')](_0x2ce134[_0x1942('0x39')]('_')+0x1);if(_0x20ccb1===_0x3f3e43){_0x26009a[_0x47f2e6]=_0x415896[_0x1942('0x3a')];}}});}return _0x26009a;}function getTicket(_0x42e65f,_0x4273f2,_0x41034b,_0x33668d,_0x36b798,_0x41ac7c,_0x39c897){return new BPromise(function(_0x5d2e3f,_0x371819){var _0x328f11;return getAuthToken(_0x4273f2,_0x41034b,_0x39c897)[_0x1942('0xd')](function(_0x49172c){if(_0x41ac7c['ticketType']===_0x1942('0x3b')){_0x328f11={'method':_0x1942('0x3c'),'uri':_0x33668d+'incidents','body':Object[_0x1942('0x3d')]({},{'title':intUtil[_0x1942('0x3e')](_0x41ac7c[_0x1942('0x3f')],_0x36b798,'\x20'),'description':intUtil[_0x1942('0x3e')](_0x41ac7c[_0x1942('0x40')],_0x36b798,'\x0a'),'customerid_contact@odata.bind':_0x42e65f[_0x1942('0x2e')]?_0x1942('0x41')+_0x42e65f['enduserId']+')':undefined,'ownerid@odata.bind':_0x1942('0x26')+_0x42e65f[_0x1942('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x41ac7c['Fields'],_0x36b798,_0x41ac7c[_0x1942('0x42')])),'headers':{'Authorization':_0x1942('0x2d')+_0x49172c,'OData-Version':_0x1942('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x41ac7c[_0x1942('0x42')]==='phonecall'){var _0x449461=_0x42e65f[_0x1942('0x2e')]?[{'partyid_systemuser@odata.bind':_0x1942('0x26')+_0x42e65f[_0x1942('0x1f')]+')','participationtypemask':_0x42e65f[_0x1942('0x43')]===_0x1942('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x1942('0x41')+_0x42e65f[_0x1942('0x2e')]+')','participationtypemask':_0x42e65f['callDirection']===_0x1942('0x44')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x1942('0x26')+_0x42e65f['userId']+')','participationtypemask':_0x42e65f[_0x1942('0x43')]===_0x1942('0x44')?0x2:0x1}];_0x328f11={'method':_0x1942('0x3c'),'uri':_0x33668d+_0x1942('0x45'),'body':Object[_0x1942('0x3d')]({},{'subject':intUtil[_0x1942('0x3e')](_0x41ac7c[_0x1942('0x3f')],_0x36b798,'\x20'),'phonenumber':String(_0x36b798[_0x1942('0x24')]),'description':intUtil[_0x1942('0x3e')](_0x41ac7c[_0x1942('0x40')],_0x36b798,'\x0a'),'regardingobjectid_contact@odata.bind':_0x42e65f[_0x1942('0x2e')]?'/contacts('+_0x42e65f[_0x1942('0x2e')]+')':undefined,'ownerid@odata.bind':_0x1942('0x26')+_0x42e65f[_0x1942('0x1f')]+')','directioncode':_0x42e65f[_0x1942('0x43')]===_0x1942('0x44')?![]:!![],'phonecall_activity_parties':_0x449461},getCustomFields(_0x41ac7c['Fields'],_0x36b798,_0x41ac7c['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x49172c,'OData-Version':_0x1942('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x328f11);})[_0x1942('0xd')](function(_0x401451){var _0x48a6b0=_0x401451[_0x1942('0x27')]['odata-entityid'];var _0x485539=_0x48a6b0[_0x1942('0x28')](_0x48a6b0[_0x1942('0x29')]('(')+0x1,_0x48a6b0[_0x1942('0x29')](')'));_0x42e65f[_0x1942('0x46')]=_0x485539;_0x5d2e3f(_0x42e65f);})[_0x1942('0xf')](function(_0x3ee1c7){_0x371819(_0x3ee1c7[_0x1942('0x13')]);});});}function emit(_0x469e05,_0x56c10d,_0x50fd44,_0x2f4d9a){var _0x10b731={'uri':util[_0x1942('0x47')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x469e05,_0x50fd44,_0x2f4d9a)};io['to'](util[_0x1942('0x47')](_0x1942('0x48'),_0x56c10d))['emit'](_0x1942('0x49'),_0x10b731);}exports['cs']=function(_0x253990,_0x52298a,_0x2acd3a,_0x42dae4,_0x51924e,_0x110b0c,_0x38f8d8,_0x2d3ab1){var _0x3cfb4d={};_0x110b0c[_0x1942('0x9')]=intUtil['stripTrailingSlash'](_0x110b0c[_0x1942('0x9')]);_0x110b0c[_0x1942('0x4a')]=intUtil[_0x1942('0x4b')](_0x110b0c['serverUrl']);_0x3cfb4d[_0x1942('0x43')]=_0x2d3ab1===_0x1942('0x44')||_0x2d3ab1===_0x1942('0x4c')?_0x1942('0x44'):'outbound';var _0x4236f2=util['format'](_0x1942('0x4d'),_0x110b0c[_0x1942('0x9')]);var _0x5dcb97=util[_0x1942('0x47')]('https://login.microsoftonline.com/%s/oauth2/token',_0x110b0c['tenantId']);var _0x4e4d10=util[_0x1942('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x110b0c[_0x1942('0x4a')],_0x52298a[_0x1942('0x4e')],md5(_0x52298a[_0x1942('0x4e')]));if(_0x51924e&&_0x51924e[_0x1942('0x4f')]){logger['info']('[QUEUE]',_0x1942('0x50'));_0x52298a[_0x1942('0x51')]=_0x4e4d10;}else if(_0x38f8d8&&_0x38f8d8[_0x1942('0x52')]&&_0x38f8d8[_0x1942('0x52')]!=='none'){logger[_0x1942('0x1c')](_0x1942('0x53'),_0x1942('0x50'));_0x52298a[_0x1942('0x51')]=_0x4e4d10;}else{_0x52298a[_0x1942('0x51')]='';}return getUser(_0x3cfb4d,_0x110b0c,_0x42dae4,_0x5dcb97,_0x4236f2,_0x2d3ab1)[_0x1942('0xd')](function(_0x5a4c70){logger[_0x1942('0x1c')]('['+_0x2d3ab1[_0x1942('0x11')]()+_0x1942('0x54'),_0x5a4c70[_0x1942('0x1f')]);logger[_0x1942('0x1c')]('['+_0x2d3ab1['toUpperCase']()+_0x1942('0x55'),_0x5a4c70[_0x1942('0x56')]);return getEndUser(_0x5a4c70,_0x110b0c,_0x5dcb97,_0x4236f2,_0x52298a,_0x2d3ab1,_0x2acd3a[_0x1942('0x57')]);})[_0x1942('0xd')](function(_0x1545dd){logger[_0x1942('0x1c')]('['+_0x2d3ab1[_0x1942('0x11')]()+_0x1942('0x58'),_0x1545dd[_0x1942('0x2e')]);logger[_0x1942('0x1c')]('['+_0x2d3ab1[_0x1942('0x11')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x52298a[_0x1942('0x24')]);return getTicket(_0x1545dd,_0x110b0c,_0x5dcb97,_0x4236f2,_0x52298a,_0x2acd3a,_0x2d3ab1);})[_0x1942('0xd')](function(_0x17274f){logger[_0x1942('0x1c')](util[_0x1942('0x47')]('['+_0x2d3ab1[_0x1942('0x11')]()+_0x1942('0x59'),_0x2acd3a[_0x1942('0x42')],_0x17274f[_0x1942('0x46')]));logger[_0x1942('0x1c')](util['format']('['+_0x2d3ab1[_0x1942('0x11')]()+_0x1942('0x5a'),_0x2d3ab1));if(_0x2d3ab1!==_0x1942('0x4c')){logger['info']('['+_0x2d3ab1[_0x1942('0x11')]()+']',_0x1942('0x5b'));emit(_0x110b0c[_0x1942('0x9')],_0x42dae4[_0x1942('0x5c')],_0x2acd3a[_0x1942('0x42')],_0x17274f[_0x1942('0x46')]);}})[_0x1942('0xf')](function(_0x616127){logger[_0x1942('0x10')]('['+_0x2d3ab1['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x1942('0x5d')](_0x616127,{'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 f7ea0d3..94f0a7a 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 _0x2625=['Enduser\x20created.','Basic\x20%s','apiKey','base64','[HTTP]','defaults','GET','map','forEach','includes','picklist','type','customField','nameField','toLowerCase','content','toString','string','idField','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','unmanaged','lastevent','toUpperCase','calleridname','stringify','request-promise','md5','util','ioredis','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','info','Ticket\x20created!','remoteUri','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x43f2ed,_0x18ef91){var _0x5f452f=function(_0x4616df){while(--_0x4616df){_0x43f2ed['push'](_0x43f2ed['shift']());}};_0x5f452f(++_0x18ef91);}(_0x2625,0x8f));var _0x5262=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2625[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var rp=require(_0x5262('0x0'));var md5=require(_0x5262('0x1'));var util=require(_0x5262('0x2'));var Redis=require(_0x5262('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x5262('0x4'))(_0x5262('0x5'));config[_0x5262('0x6')]=_['defaults'](config[_0x5262('0x6')],{'host':_0x5262('0x7'),'port':0x18eb});var io=require(_0x5262('0x8'))(new Redis(config[_0x5262('0x6')]));var headers={'Content-Type':_0x5262('0x9'),'Accept':_0x5262('0x9')};function emit(_0x583bec,_0x30e993,_0x2b1b58){io['to'](_0x583bec)[_0x5262('0xa')](_0x30e993,_0x2b1b58);}function getTicket(_0x4e3799,_0x5f478b,_0x1d9b71,_0x436264,_0xc162ec){logger['info'](_0x5262('0xb'));var _0x2c0884=_[_0x5262('0xc')]({'responder_id':_0x5f478b['id'],'requester_id':_0x1d9b71['id'],'name':util[_0x5262('0xd')](_0x5262('0xe'),_0xc162ec['calleridname']),'phone':_0xc162ec[_0x5262('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x436264['Subjects'],_0xc162ec,'\x20'),'description':intUtil[_0x5262('0x10')](_0x436264[_0x5262('0x11')],_0xc162ec,_0x5262('0x12')),'tags':getTags(_0x436264['Tags'],_0x5262('0x13'))},getCustomFields(_0x436264[_0x5262('0x14')],_0xc162ec));_0x2c0884[_0x5262('0x15')]=_[_0x5262('0x16')](_[_0x5262('0x17')](_0x2c0884[_0x5262('0x15')],'id'),_0x5262('0x18'));return request({'uri':util['format'](_0x5262('0x19'),_0x4e3799['remoteUri']),'method':_0x5262('0x1a'),'body':_0x2c0884})['then'](function(_0x13fd72){logger[_0x5262('0x1b')](_0x5262('0x1c'));return _0x13fd72;});}function getUser(_0x5a13b3,_0x238fee){if(intUtil['validateEmail'](_0x238fee)){return request({'uri':util[_0x5262('0xd')]('%s/api/v2/agents',_0x5a13b3[_0x5262('0x1d')]),'qs':{'email':_0x238fee}})[_0x5262('0x1e')](function(_0x10bd91){if(_0x10bd91[_0x5262('0x1f')]){logger[_0x5262('0x1b')](_0x5262('0x20'));return _[_0x5262('0x21')](_0x10bd91,function(_0x44fb74){return _0x44fb74[_0x5262('0x22')][_0x5262('0x23')]===_0x238fee;});}else{logger[_0x5262('0x1b')](_0x5262('0x24'));return request({'uri':util[_0x5262('0xd')]('%s/api/v2/agents/me',_0x5a13b3['remoteUri'])})[_0x5262('0x1e')](function(_0x5379a1){logger[_0x5262('0x1b')](_0x5262('0x25'));return _0x5379a1;});}});}else{logger['info'](_0x5262('0x26'));return request({'uri':util[_0x5262('0xd')]('%s/api/v2/agents/me',_0x5a13b3['remoteUri'])})[_0x5262('0x1e')](function(_0x399126){logger[_0x5262('0x1b')](_0x5262('0x25'));return _0x399126;});}}function getEndUser(_0x1cbf18,_0x32c61d,_0x387b6f){logger['info'](_0x5262('0x27'),_0x387b6f);return request({'uri':util[_0x5262('0xd')](_0x5262('0x28'),_0x1cbf18['remoteUri']),'qs':{'phone':_0x387b6f}})[_0x5262('0x1e')](function(_0x404e20){if(_0x404e20['length']){logger['info'](_0x5262('0x29'));return _[_0x5262('0x21')](_0x404e20,{'phone':_0x387b6f});}else{logger[_0x5262('0x1b')](_0x5262('0x2a'));return request({'uri':util[_0x5262('0xd')](_0x5262('0x28'),_0x1cbf18[_0x5262('0x1d')]),'method':_0x5262('0x1a'),'body':{'name':_0x32c61d,'phone':_0x387b6f}})['then'](function(_0x254cb3){logger[_0x5262('0x1b')](_0x5262('0x2b'));return _0x254cb3;});}});}function getAuth(_0x29fbcf){return util[_0x5262('0xd')](_0x5262('0x2c'),new Buffer(_0x29fbcf[_0x5262('0x2d')]+':X')['toString'](_0x5262('0x2e')));}function request(_0x2747cd){logger['debug'](_0x5262('0x2f'),JSON['stringify'](_0x2747cd));return rp(_[_0x5262('0x30')](_0x2747cd,{'method':_0x5262('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x4adda6,_0x2a2687){var _0x5ce18e=[];if(_0x4adda6&&_0x4adda6['length']>0x0){_0x5ce18e=_[_0x5262('0x32')](_0x4adda6,_0x2a2687);}return _0x5ce18e;}function getCustomFields(_0x1a5d99,_0x11a77f){var _0x19bdea=[];var _0x3045c9={'custom_fields':[]};if(_0x1a5d99[_0x5262('0x1f')]>0x0){_[_0x5262('0x33')](_0x1a5d99,function(_0x2f27d1){if(_[_0x5262('0x34')](['string',_0x5262('0x35')],_0x2f27d1[_0x5262('0x36')])&&_0x2f27d1['nameField']&&!_0x2f27d1[_0x5262('0x37')]){_0x3045c9[_0x2f27d1[_0x5262('0x38')][_0x5262('0x39')]()]=_0x2f27d1[_0x5262('0x3a')][_0x5262('0x3b')]();}else if(_['includes']([_0x5262('0x3c'),'picklist'],_0x2f27d1[_0x5262('0x36')])&&_0x2f27d1[_0x5262('0x3d')]&&_0x2f27d1[_0x5262('0x37')]){_0x3045c9[_0x5262('0x15')][_0x5262('0x3e')]({'id':_0x2f27d1[_0x5262('0x3d')],'value':_0x2f27d1['content']['toString']()});}else if(_0x2f27d1[_0x5262('0x36')]==='variable'&&_0x2f27d1[_0x5262('0x3f')]&&_0x2f27d1[_0x5262('0x3d')]&&_0x2f27d1[_0x5262('0x37')]){_0x11a77f[_0x2f27d1[_0x5262('0x3f')]]&&_0x3045c9[_0x5262('0x15')]['push']({'id':_0x2f27d1[_0x5262('0x3d')],'value':_0x11a77f[_0x2f27d1['variableName']][_0x5262('0x3b')]()});}else if(_0x2f27d1[_0x5262('0x36')]===_0x5262('0x40')&&_0x2f27d1[_0x5262('0x41')]&&_0x2f27d1['Variable'][_0x5262('0x13')]&&_0x2f27d1['idField']&&_0x2f27d1['customField']){_0x11a77f[_0x2f27d1['Variable']['name'][_0x5262('0x39')]()]&&_0x3045c9[_0x5262('0x15')][_0x5262('0x3e')]({'id':_0x2f27d1[_0x5262('0x3d')],'value':_0x11a77f[_0x2f27d1['Variable'][_0x5262('0x13')][_0x5262('0x39')]()][_0x5262('0x3b')]()});}});}return _0x3045c9;}exports[_0x5262('0x42')]=function(_0x8dfb9d,_0x101109,_0x5ab94a,_0x5da758,_0x15df8c,_0x26aeaf){var _0x58071a,_0x5a28cd;_0x26aeaf[_0x5262('0x1d')]=intUtil[_0x5262('0x43')](_0x26aeaf[_0x5262('0x1d')]);_0x26aeaf['serverUrl']=intUtil['stripTrailingSlash'](_0x26aeaf[_0x5262('0x44')]);if(_0x15df8c&&_0x15df8c[_0x5262('0x45')]){logger[_0x5262('0x1b')](_0x5262('0x46'),'Recording\x20is\x20enabled!');_0x101109[_0x5262('0x47')]=util[_0x5262('0xd')](_0x5262('0x48'),_0x26aeaf['serverUrl'],_0x101109[_0x5262('0x49')],md5(_0x101109[_0x5262('0x49')]));}else{_0x101109[_0x5262('0x47')]='';}headers['Authorization']=getAuth(_0x26aeaf);return getUser(_0x26aeaf,_0x5da758[_0x5262('0x23')])['then'](function(_0x5cc409){_0x58071a=_0x5cc409;logger['info'](_0x5262('0x4a'),_0x58071a['id']);return getEndUser(_0x26aeaf,_0x101109['calleridname'],_0x101109[_0x5262('0xf')]);})[_0x5262('0x1e')](function(_0x418ebd){_0x5a28cd=_0x418ebd;logger[_0x5262('0x1b')](_0x5262('0x4b'),_0x5a28cd['id']);return getTicket(_0x26aeaf,_0x58071a,_0x5a28cd,_0x5ab94a,_0x101109);})['then'](function(_0x1e9063){if(_0x1e9063&&_0x1e9063['id']){logger['info'](_0x5262('0x1c'));logger[_0x5262('0x1b')](_0x5262('0x4c'),_0x1e9063['id']);logger[_0x5262('0x1b')]('[QUEUE]',_0x5262('0x4d'));emit(util[_0x5262('0xd')](_0x5262('0x4e'),_0x5da758[_0x5262('0x13')]),_0x5262('0x4f'),{'uri':util[_0x5262('0xd')](_0x5262('0x50'),_0x26aeaf[_0x5262('0x1d')],_0x1e9063['id'])});}})[_0x5262('0x51')](function(_0x22069a){logger[_0x5262('0x52')]('[QUEUE]',JSON['stringify'](_0x22069a));});};exports[_0x5262('0x53')]=function(_0x149de7,_0x632331,_0x2258cb,_0x25e7f5,_0x46b810,_0x1a25ad,_0x336299){var _0x4a08c3,_0xf82223;_0x1a25ad[_0x5262('0x1d')]=intUtil['stripTrailingSlash'](_0x1a25ad[_0x5262('0x1d')]);_0x1a25ad[_0x5262('0x44')]=intUtil[_0x5262('0x43')](_0x1a25ad[_0x5262('0x44')]);if(_0x336299&&_0x336299['recordingFormat']&&_0x336299['recordingFormat']!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x632331[_0x5262('0x47')]=util['format'](_0x5262('0x48'),_0x1a25ad[_0x5262('0x44')],_0x632331[_0x5262('0x49')],md5(_0x632331[_0x5262('0x49')]));}headers[_0x5262('0x54')]=getAuth(_0x1a25ad);return getUser(_0x1a25ad,_0x25e7f5['email'])['then'](function(_0x2e3e54){_0x4a08c3=_0x2e3e54;logger['info'](_0x5262('0x4a'),_0x4a08c3['id']);return getEndUser(_0x1a25ad,_0x632331[_0x5262('0x55')],_0x632331[_0x5262('0x56')]);})[_0x5262('0x1e')](function(_0x4bde20){_0xf82223=_0x4bde20;logger[_0x5262('0x1b')](_0x5262('0x4b'),_0xf82223['id']);return getTicket(_0x1a25ad,_0x4a08c3,_0xf82223,_0x2258cb,_0x632331);})[_0x5262('0x1e')](function(_0x5e7772){if(_0x5e7772&&_0x5e7772['id']){logger[_0x5262('0x1b')](_0x5262('0x1c'));logger[_0x5262('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x5e7772['id']);logger[_0x5262('0x1b')]('[OUTBOUND]',_0x5262('0x4d'));emit(util[_0x5262('0xd')]('user:%s',_0x25e7f5[_0x5262('0x13')]),_0x5262('0x4f'),{'uri':util[_0x5262('0xd')](_0x5262('0x50'),_0x1a25ad['remoteUri'],_0x5e7772['id'])});}})['catch'](function(_0x4f9bd4){logger[_0x5262('0x52')](_0x5262('0x57'),JSON['stringify'](_0x4f9bd4));});};exports[_0x5262('0x58')]=function(_0x4ef8a7,_0x12f632,_0x418542,_0x3e087c,_0xda1db9,_0x3e335a){var _0x2d9abd,_0x416c94;_0x3e335a[_0x5262('0x1d')]=intUtil['stripTrailingSlash'](_0x3e335a['remoteUri']);_0x3e335a[_0x5262('0x44')]=intUtil[_0x5262('0x43')](_0x3e335a[_0x5262('0x44')]);if(_0xda1db9&&_0xda1db9[_0x5262('0x45')]){logger['info']('['+_0x12f632[_0x5262('0x59')][_0x5262('0x5a')]()+']','Recording\x20is\x20enabled!');_0x12f632[_0x5262('0x47')]=util[_0x5262('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e335a['serverUrl'],_0x12f632['uniqueid'],md5(_0x12f632[_0x5262('0x49')]));}else{_0x12f632[_0x5262('0x47')]='';}headers[_0x5262('0x54')]=getAuth(_0x3e335a);return getUser(_0x3e335a,'')[_0x5262('0x1e')](function(_0x3d7229){_0x2d9abd=_0x3d7229;logger[_0x5262('0x1b')](_0x5262('0x4a'),_0x2d9abd['id']);return getEndUser(_0x3e335a,_0x12f632[_0x5262('0x5b')],_0x12f632[_0x5262('0xf')]);})[_0x5262('0x1e')](function(_0x4d73d5){_0x416c94=_0x4d73d5;logger[_0x5262('0x1b')](_0x5262('0x4b'),_0x416c94['id']);return getTicket(_0x3e335a,_0x2d9abd,_0x416c94,_0x418542,_0x12f632);})[_0x5262('0x1e')](function(_0x10a074){if(_0x10a074){logger['info'](_0x5262('0x1c'));logger['info'](_0x5262('0x4c'),_0x10a074['id']);}})[_0x5262('0x51')](function(_0x5cb687){logger[_0x5262('0x52')]('['+_0x12f632[_0x5262('0x59')][_0x5262('0x5a')]()+']',JSON[_0x5262('0x5c')](_0x5cb687));});}; \ No newline at end of file +var _0xbfe3=['The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','stringify','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','catch','error','unmanaged','lastevent','toUpperCase','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','validateEmail','%s/api/v2/agents','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','defaults','GET','forEach','includes','string','picklist','type','nameField','customField','content','idField','push','variable','variableName','customVariable','Variable','name','toLowerCase','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0xbfe3,0x79));var _0x3bfe=function(_0x12b860,_0xd4ea25){_0x12b860=_0x12b860-0x0;var _0x3c0a5c=_0xbfe3[_0x12b860];return _0x3c0a5c;};'use strict';var _=require('lodash');var rp=require(_0x3bfe('0x0'));var md5=require('md5');var util=require(_0x3bfe('0x1'));var Redis=require(_0x3bfe('0x2'));var intUtil=require(_0x3bfe('0x3'));var config=require(_0x3bfe('0x4'));var logger=require('../../../../config/logger')(_0x3bfe('0x5'));config[_0x3bfe('0x6')]=_['defaults'](config[_0x3bfe('0x6')],{'host':_0x3bfe('0x7'),'port':0x18eb});var io=require(_0x3bfe('0x8'))(new Redis(config[_0x3bfe('0x6')]));var headers={'Content-Type':_0x3bfe('0x9'),'Accept':_0x3bfe('0x9')};function emit(_0x50f37c,_0x330610,_0x35372e){io['to'](_0x50f37c)['emit'](_0x330610,_0x35372e);}function getTicket(_0x594c3e,_0x87eba5,_0x2fb834,_0x1494e8,_0x415e94){logger[_0x3bfe('0xa')](_0x3bfe('0xb'));var _0x4db681=_[_0x3bfe('0xc')]({'responder_id':_0x87eba5['id'],'requester_id':_0x2fb834['id'],'name':util[_0x3bfe('0xd')](_0x3bfe('0xe'),_0x415e94[_0x3bfe('0xf')]),'phone':_0x415e94[_0x3bfe('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1494e8[_0x3bfe('0x11')],_0x415e94,'\x20'),'description':intUtil[_0x3bfe('0x12')](_0x1494e8[_0x3bfe('0x13')],_0x415e94,_0x3bfe('0x14')),'tags':getTags(_0x1494e8[_0x3bfe('0x15')],'name')},getCustomFields(_0x1494e8[_0x3bfe('0x16')],_0x415e94));_0x4db681[_0x3bfe('0x17')]=_[_0x3bfe('0x18')](_[_0x3bfe('0x19')](_0x4db681['custom_fields'],'id'),_0x3bfe('0x1a'));return request({'uri':util[_0x3bfe('0xd')](_0x3bfe('0x1b'),_0x594c3e[_0x3bfe('0x1c')]),'method':_0x3bfe('0x1d'),'body':_0x4db681})['then'](function(_0x8bf120){logger['info']('Ticket\x20created!');return _0x8bf120;});}function getUser(_0x1f8874,_0x24de90){if(intUtil[_0x3bfe('0x1e')](_0x24de90)){return request({'uri':util[_0x3bfe('0xd')](_0x3bfe('0x1f'),_0x1f8874[_0x3bfe('0x1c')]),'qs':{'email':_0x24de90}})['then'](function(_0x374094){if(_0x374094['length']){logger[_0x3bfe('0xa')](_0x3bfe('0x20'));return _[_0x3bfe('0x21')](_0x374094,function(_0x42dbb6){return _0x42dbb6[_0x3bfe('0x22')][_0x3bfe('0x23')]===_0x24de90;});}else{logger[_0x3bfe('0xa')](_0x3bfe('0x24'));return request({'uri':util[_0x3bfe('0xd')](_0x3bfe('0x25'),_0x1f8874[_0x3bfe('0x1c')])})[_0x3bfe('0x26')](function(_0x53dc7e){logger[_0x3bfe('0xa')](_0x3bfe('0x27'));return _0x53dc7e;});}});}else{logger[_0x3bfe('0xa')](_0x3bfe('0x28'));return request({'uri':util['format'](_0x3bfe('0x25'),_0x1f8874[_0x3bfe('0x1c')])})[_0x3bfe('0x26')](function(_0x1e6815){logger[_0x3bfe('0xa')](_0x3bfe('0x27'));return _0x1e6815;});}}function getEndUser(_0x32e0b3,_0x14aeca,_0x1eb7a7){logger['info'](_0x3bfe('0x29'),_0x1eb7a7);return request({'uri':util[_0x3bfe('0xd')](_0x3bfe('0x2a'),_0x32e0b3['remoteUri']),'qs':{'phone':_0x1eb7a7}})['then'](function(_0xc1e64f){if(_0xc1e64f[_0x3bfe('0x2b')]){logger[_0x3bfe('0xa')](_0x3bfe('0x2c'));return _[_0x3bfe('0x21')](_0xc1e64f,{'phone':_0x1eb7a7});}else{logger[_0x3bfe('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3bfe('0xd')](_0x3bfe('0x2a'),_0x32e0b3[_0x3bfe('0x1c')]),'method':_0x3bfe('0x1d'),'body':{'name':_0x14aeca,'phone':_0x1eb7a7}})[_0x3bfe('0x26')](function(_0x391878){logger[_0x3bfe('0xa')]('Enduser\x20created.');return _0x391878;});}});}function getAuth(_0x5a2869){return util[_0x3bfe('0xd')](_0x3bfe('0x2d'),new Buffer(_0x5a2869[_0x3bfe('0x2e')]+':X')[_0x3bfe('0x2f')](_0x3bfe('0x30')));}function request(_0x58b858){logger[_0x3bfe('0x31')](_0x3bfe('0x32'),JSON['stringify'](_0x58b858));return rp(_[_0x3bfe('0x33')](_0x58b858,{'method':_0x3bfe('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x507354,_0x1fe555){var _0x4b4689=[];if(_0x507354&&_0x507354[_0x3bfe('0x2b')]>0x0){_0x4b4689=_['map'](_0x507354,_0x1fe555);}return _0x4b4689;}function getCustomFields(_0x20a945,_0x17ac58){var _0x41f30c=[];var _0x5967e0={'custom_fields':[]};if(_0x20a945['length']>0x0){_[_0x3bfe('0x35')](_0x20a945,function(_0xf88578){if(_[_0x3bfe('0x36')]([_0x3bfe('0x37'),_0x3bfe('0x38')],_0xf88578[_0x3bfe('0x39')])&&_0xf88578[_0x3bfe('0x3a')]&&!_0xf88578[_0x3bfe('0x3b')]){_0x5967e0[_0xf88578[_0x3bfe('0x3a')]['toLowerCase']()]=_0xf88578[_0x3bfe('0x3c')][_0x3bfe('0x2f')]();}else if(_[_0x3bfe('0x36')]([_0x3bfe('0x37'),_0x3bfe('0x38')],_0xf88578['type'])&&_0xf88578[_0x3bfe('0x3d')]&&_0xf88578[_0x3bfe('0x3b')]){_0x5967e0[_0x3bfe('0x17')][_0x3bfe('0x3e')]({'id':_0xf88578['idField'],'value':_0xf88578[_0x3bfe('0x3c')]['toString']()});}else if(_0xf88578[_0x3bfe('0x39')]===_0x3bfe('0x3f')&&_0xf88578[_0x3bfe('0x40')]&&_0xf88578[_0x3bfe('0x3d')]&&_0xf88578['customField']){_0x17ac58[_0xf88578[_0x3bfe('0x40')]]&&_0x5967e0[_0x3bfe('0x17')][_0x3bfe('0x3e')]({'id':_0xf88578[_0x3bfe('0x3d')],'value':_0x17ac58[_0xf88578['variableName']][_0x3bfe('0x2f')]()});}else if(_0xf88578[_0x3bfe('0x39')]===_0x3bfe('0x41')&&_0xf88578[_0x3bfe('0x42')]&&_0xf88578[_0x3bfe('0x42')][_0x3bfe('0x43')]&&_0xf88578[_0x3bfe('0x3d')]&&_0xf88578['customField']){_0x17ac58[_0xf88578[_0x3bfe('0x42')]['name'][_0x3bfe('0x44')]()]&&_0x5967e0[_0x3bfe('0x17')][_0x3bfe('0x3e')]({'id':_0xf88578[_0x3bfe('0x3d')],'value':_0x17ac58[_0xf88578[_0x3bfe('0x42')][_0x3bfe('0x43')][_0x3bfe('0x44')]()][_0x3bfe('0x2f')]()});}});}return _0x5967e0;}exports['queue']=function(_0x5a3a7a,_0x4b57b7,_0x51fce0,_0x31f518,_0x4841d4,_0x37f28b){var _0x3c011a,_0x4322f2;_0x37f28b[_0x3bfe('0x1c')]=intUtil['stripTrailingSlash'](_0x37f28b[_0x3bfe('0x1c')]);_0x37f28b[_0x3bfe('0x45')]=intUtil['stripTrailingSlash'](_0x37f28b[_0x3bfe('0x45')]);if(_0x4841d4&&_0x4841d4[_0x3bfe('0x46')]){logger[_0x3bfe('0xa')]('[QUEUE]',_0x3bfe('0x47'));_0x4b57b7[_0x3bfe('0x48')]=util[_0x3bfe('0xd')](_0x3bfe('0x49'),_0x37f28b[_0x3bfe('0x45')],_0x4b57b7[_0x3bfe('0x4a')],md5(_0x4b57b7['uniqueid']));}else{_0x4b57b7[_0x3bfe('0x48')]='';}headers['Authorization']=getAuth(_0x37f28b);return getUser(_0x37f28b,_0x31f518['email'])[_0x3bfe('0x26')](function(_0x494554){_0x3c011a=_0x494554;logger['info']('The\x20User\x20ID\x20is:',_0x3c011a['id']);return getEndUser(_0x37f28b,_0x4b57b7['calleridname'],_0x4b57b7[_0x3bfe('0x10')]);})[_0x3bfe('0x26')](function(_0x222cc2){_0x4322f2=_0x222cc2;logger[_0x3bfe('0xa')](_0x3bfe('0x4b'),_0x4322f2['id']);return getTicket(_0x37f28b,_0x3c011a,_0x4322f2,_0x51fce0,_0x4b57b7);})['then'](function(_0x30dc4a){if(_0x30dc4a&&_0x30dc4a['id']){logger[_0x3bfe('0xa')](_0x3bfe('0x4c'));logger[_0x3bfe('0xa')](_0x3bfe('0x4d'),_0x30dc4a['id']);logger[_0x3bfe('0xa')](_0x3bfe('0x4e'),_0x3bfe('0x4f'));emit(util[_0x3bfe('0xd')](_0x3bfe('0x50'),_0x31f518[_0x3bfe('0x43')]),_0x3bfe('0x51'),{'uri':util[_0x3bfe('0xd')]('%s/helpdesk/tickets/%d',_0x37f28b[_0x3bfe('0x1c')],_0x30dc4a['id'])});}})['catch'](function(_0x50c210){logger['error']('[QUEUE]',JSON[_0x3bfe('0x52')](_0x50c210));});};exports[_0x3bfe('0x53')]=function(_0x4f3702,_0x142551,_0x3420be,_0x41543b,_0x13cb3c,_0xf2c12f,_0x59d859){var _0x248955,_0x436c29;_0xf2c12f[_0x3bfe('0x1c')]=intUtil['stripTrailingSlash'](_0xf2c12f[_0x3bfe('0x1c')]);_0xf2c12f[_0x3bfe('0x45')]=intUtil[_0x3bfe('0x54')](_0xf2c12f[_0x3bfe('0x45')]);if(_0x59d859&&_0x59d859['recordingFormat']&&_0x59d859[_0x3bfe('0x55')]!==_0x3bfe('0x56')){logger[_0x3bfe('0xa')](_0x3bfe('0x57'),_0x3bfe('0x47'));_0x142551[_0x3bfe('0x48')]=util[_0x3bfe('0xd')](_0x3bfe('0x49'),_0xf2c12f[_0x3bfe('0x45')],_0x142551['uniqueid'],md5(_0x142551['uniqueid']));}headers[_0x3bfe('0x58')]=getAuth(_0xf2c12f);return getUser(_0xf2c12f,_0x41543b['email'])[_0x3bfe('0x26')](function(_0x1fb609){_0x248955=_0x1fb609;logger[_0x3bfe('0xa')](_0x3bfe('0x59'),_0x248955['id']);return getEndUser(_0xf2c12f,_0x142551[_0x3bfe('0x5a')],_0x142551[_0x3bfe('0x5b')]);})[_0x3bfe('0x26')](function(_0x55e7e3){_0x436c29=_0x55e7e3;logger[_0x3bfe('0xa')](_0x3bfe('0x4b'),_0x436c29['id']);return getTicket(_0xf2c12f,_0x248955,_0x436c29,_0x3420be,_0x142551);})[_0x3bfe('0x26')](function(_0x1950b3){if(_0x1950b3&&_0x1950b3['id']){logger['info'](_0x3bfe('0x4c'));logger[_0x3bfe('0xa')](_0x3bfe('0x4d'),_0x1950b3['id']);logger[_0x3bfe('0xa')](_0x3bfe('0x57'),_0x3bfe('0x4f'));emit(util[_0x3bfe('0xd')]('user:%s',_0x41543b[_0x3bfe('0x43')]),_0x3bfe('0x51'),{'uri':util[_0x3bfe('0xd')](_0x3bfe('0x5c'),_0xf2c12f[_0x3bfe('0x1c')],_0x1950b3['id'])});}})[_0x3bfe('0x5d')](function(_0x2d56a1){logger[_0x3bfe('0x5e')](_0x3bfe('0x57'),JSON[_0x3bfe('0x52')](_0x2d56a1));});};exports[_0x3bfe('0x5f')]=function(_0x2edfe4,_0x5cbd89,_0x16fb7e,_0x5c4c90,_0x56998f,_0x5e3955){var _0x35ee1b,_0x16a6ad;_0x5e3955[_0x3bfe('0x1c')]=intUtil['stripTrailingSlash'](_0x5e3955[_0x3bfe('0x1c')]);_0x5e3955[_0x3bfe('0x45')]=intUtil[_0x3bfe('0x54')](_0x5e3955['serverUrl']);if(_0x56998f&&_0x56998f[_0x3bfe('0x46')]){logger[_0x3bfe('0xa')]('['+_0x5cbd89[_0x3bfe('0x60')][_0x3bfe('0x61')]()+']',_0x3bfe('0x47'));_0x5cbd89[_0x3bfe('0x48')]=util[_0x3bfe('0xd')](_0x3bfe('0x49'),_0x5e3955['serverUrl'],_0x5cbd89[_0x3bfe('0x4a')],md5(_0x5cbd89[_0x3bfe('0x4a')]));}else{_0x5cbd89[_0x3bfe('0x48')]='';}headers[_0x3bfe('0x58')]=getAuth(_0x5e3955);return getUser(_0x5e3955,'')[_0x3bfe('0x26')](function(_0xf1214e){_0x35ee1b=_0xf1214e;logger['info'](_0x3bfe('0x59'),_0x35ee1b['id']);return getEndUser(_0x5e3955,_0x5cbd89[_0x3bfe('0xf')],_0x5cbd89['calleridnum']);})['then'](function(_0x21c61f){_0x16a6ad=_0x21c61f;logger['info'](_0x3bfe('0x4b'),_0x16a6ad['id']);return getTicket(_0x5e3955,_0x35ee1b,_0x16a6ad,_0x16fb7e,_0x5cbd89);})[_0x3bfe('0x26')](function(_0x3fce55){if(_0x3fce55){logger[_0x3bfe('0xa')](_0x3bfe('0x4c'));logger[_0x3bfe('0xa')](_0x3bfe('0x4d'),_0x3fce55['id']);}})['catch'](function(_0x288ed7){logger[_0x3bfe('0x5e')]('['+_0x5cbd89['lastevent'][_0x3bfe('0x61')]()+']',JSON['stringify'](_0x288ed7));});}; \ 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 58de532..15ad5cb 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 _0x1450=['add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','catch','&f=','&entities=contact','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact'];(function(_0x3b36e7,_0x4c3466){var _0x13c07b=function(_0x14decb){while(--_0x14decb){_0x3b36e7['push'](_0x3b36e7['shift']());}};_0x13c07b(++_0x4c3466);}(_0x1450,0x167));var _0x0145=function(_0x39f415,_0x555ec1){_0x39f415=_0x39f415-0x0;var _0x50829b=_0x1450[_0x39f415];return _0x50829b;};'use strict';var _=require(_0x0145('0x0'));var rp=require('request-promise');var md5=require(_0x0145('0x1'));var util=require(_0x0145('0x2'));var moment=require(_0x0145('0x3'));var Promise=require(_0x0145('0x4'));var Redis=require(_0x0145('0x5'));var intUtil=require(_0x0145('0x6'));var config=require(_0x0145('0x7'));var logger=require(_0x0145('0x8'))(_0x0145('0x9'));config[_0x0145('0xa')]=_[_0x0145('0xb')](config['redis'],{'host':_0x0145('0xc'),'port':0x18eb});var io=require(_0x0145('0xd'))(new Redis(config[_0x0145('0xa')]));function getAdminId(_0x2b1ac5,_0x3713ca,_0x31439c,_0x231c50){return new Promise(function(_0x27915b,_0x2a47c7){var _0x35bf29=![];var _0x583137={'method':_0x0145('0xe'),'uri':_0x231c50+_0x0145('0xf'),'json':!![]};_0x583137[_0x0145('0x10')]=_0x31439c;logger[_0x0145('0x11')](_0x0145('0x12'));return rp(_0x583137)['then'](function(_0x3e8159){if(_0x3e8159){var _0x82f4b9=_0x3e8159[_0x0145('0x13')];var _0x1e027d=null;for(_0x1e027d=0x0;_0x1e027d<_0x82f4b9[_0x0145('0x14')];_0x1e027d++){if(_0x82f4b9[_0x1e027d][_0x0145('0x15')]===_0x2b1ac5[_0x0145('0x16')]){_0x2b1ac5[_0x0145('0x17')]=_0x82f4b9[_0x1e027d]['id'];_0x35bf29=!![];}}if(_0x35bf29){logger[_0x0145('0x11')](_0x0145('0x18'),_0x2b1ac5['adminId']);_0x27915b(_0x2b1ac5);}else{_0x2a47c7({'statusCode':0x194,'message':_0x0145('0x19')});}}else{_0x2a47c7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x544384){logger[_0x0145('0x1a')]('['+[_0x3713ca[_0x0145('0x1b')]()]+']',_0x544384[_0x0145('0x1c')]);_0x2a47c7(_0x544384);});});}function getUser(_0x190df2,_0x1c6eb0,_0x2302d5){return function(_0x23d9fd){return new Promise(function(_0x516eb4,_0x1aa71d){var _0x185b36={'method':_0x0145('0xe'),'uri':_0x2302d5+_0x0145('0xf'),'json':!![]};_0x185b36['headers']=_0x1c6eb0;logger['info'](_0x0145('0x1d'));return rp(_0x185b36)[_0x0145('0x1e')](function(_0x450014){if(_0x450014){var _0x2464bb=_0x450014['users'];var _0x1c6ae6=![];var _0x5bb34b=null;if(_0x23d9fd[_0x0145('0x1f')]!==null){logger[_0x0145('0x11')](_0x0145('0x20'),_0x23d9fd[_0x0145('0x1f')]);_0x23d9fd[_0x0145('0x21')]=_0x23d9fd['agentEmail'];for(_0x5bb34b=0x0;_0x5bb34b<_0x2464bb['length'];_0x5bb34b++){if(_0x2464bb[_0x5bb34b][_0x0145('0x15')]===_0x23d9fd[_0x0145('0x1f')]){_0x1c6ae6=!![];_0x23d9fd[_0x0145('0x22')]=_0x2464bb[_0x5bb34b]['id'];logger[_0x0145('0x11')](_0x0145('0x23'),_0x23d9fd['userId']);}}}if(!_0x1c6ae6){logger[_0x0145('0x11')](_0x0145('0x24'));_0x23d9fd[_0x0145('0x21')]=_0x23d9fd[_0x0145('0x16')];_0x23d9fd['userId']=_0x23d9fd[_0x0145('0x17')];_0x1c6ae6=!![];}if(_0x1c6ae6){_0x516eb4(_0x23d9fd);}else{_0x1aa71d({'statusCode':0x194,'message':_0x0145('0x19')});}}else{_0x1aa71d({'statusCode':0x194,'message':_0x0145('0x19')});}})[_0x0145('0x25')](function(_0x37a49e){logger[_0x0145('0x1a')]('['+[_0x190df2[_0x0145('0x1b')]()]+']',_0x37a49e['message']);_0x1aa71d(_0x37a49e);});});};}function searchContact(_0x371054,_0x32794d,_0x14190a,_0x18f7ed){return new Promise(function(_0x1b2e03,_0x16746a){var _0x18753d={'method':'GET','headers':_0x32794d,'uri':_0x371054+'/api/lookup?q='+_0x18f7ed+_0x0145('0x26')+_0x14190a+_0x0145('0x27'),'json':!![]};rp(_0x18753d)[_0x0145('0x1e')](function(_0x3739e6){var _0x4c2047=_['find'](_0x3739e6['contacts']['contacts'],[_0x14190a,_0x18f7ed]);_0x1b2e03(_0x4c2047);})[_0x0145('0x25')](function(_0x511674){_0x16746a(_0x511674);});});}function getEndUser(_0x29473b,_0x52df1d,_0x1cc790){return function(_0x453f3a){return new Promise(function(_0x355e9c,_0x4dc9f2){logger['info'](util[_0x0145('0x28')](_0x0145('0x29'),_0x453f3a[_0x0145('0x2a')]));searchContact(_0x1cc790,_0x52df1d,_0x0145('0x2b'),_0x453f3a[_0x0145('0x2a')])[_0x0145('0x1e')](function(_0x55e12d){if(_0x55e12d){_0x453f3a[_0x0145('0x2c')]=_0x55e12d['id'];logger[_0x0145('0x11')](_0x0145('0x2d'),_0x453f3a['endUserId']);return _0x355e9c(_0x453f3a);}searchContact(_0x1cc790,_0x52df1d,_0x0145('0x2e'),_0x453f3a[_0x0145('0x2a')])[_0x0145('0x1e')](function(_0x2df7d2){if(_0x2df7d2){_0x453f3a['endUserId']=_0x2df7d2['id'];logger[_0x0145('0x11')]('Contact\x20found\x20work_number:',_0x453f3a[_0x0145('0x2c')]);return _0x355e9c(_0x453f3a);}createEndUser(_0x453f3a,_0x29473b,_0x52df1d,_0x1cc790)[_0x0145('0x1e')](function(_0x452203){logger[_0x0145('0x11')](_0x0145('0x2f'),_0x452203[_0x0145('0x2c')]);return _0x355e9c(_0x452203);});});})[_0x0145('0x25')](function(_0x558f47){_0x4dc9f2(_0x558f47);});});};}function createEndUser(_0x240183,_0x57b27e,_0x1f8c0a,_0x53e3ae){return new Promise(function(_0x26aed3,_0x12ea35){var _0x2ba9d0=moment();var _0x3fd489={'method':_0x0145('0x30'),'uri':_0x53e3ae+'/api/contacts','body':{'contact':{'last_name':_0x240183[_0x0145('0x2a')],'work_number':_0x240183['contactNumber'],'mobile_number':_0x240183[_0x0145('0x2a')],'owner_id':_0x240183[_0x0145('0x22')],'created_at':_0x2ba9d0['format'](_0x0145('0x31'))}},'json':!![]};_0x3fd489['headers']=_0x1f8c0a;logger[_0x0145('0x11')](_0x0145('0x32'));return rp(_0x3fd489)['then'](function(_0x4fa303){_0x240183[_0x0145('0x2c')]=_0x4fa303['contact']['id'];_0x26aed3(_0x240183);})[_0x0145('0x25')](function(_0x1db83b){logger[_0x0145('0x1a')]('['+[_0x57b27e[_0x0145('0x1b')]()]+']',_0x1db83b[_0x0145('0x1c')]);_0x12ea35(_0x1db83b['message']);});});}function getTicket(_0xd96d4b,_0x485bdb,_0x22abb9,_0x16b64e,_0x3fe17b){return function(_0x4a3632){logger[_0x0145('0x11')](_0x0145('0x33'));return new Promise(function(_0x17214a,_0x1ae025){var _0x5f1340=moment();var _0x4d8083={'method':_0x0145('0x30'),'uri':_0x22abb9+_0x0145('0x34'),'body':{'title':intUtil[_0x0145('0x35')](_0x16b64e[_0x0145('0x36')],_0x3fe17b,'\x20'),'description':intUtil['getString'](_0x16b64e['Descriptions'],_0x3fe17b,'\x0a'),'owner_id':_0x4a3632[_0x0145('0x22')],'creater_id':_0x4a3632['adminId'],'targetable_id':_0x4a3632['endUserId'],'targetable_type':_0x0145('0x37'),'created_at':_0x5f1340['format'](_0x0145('0x31')),'due_date':_0x5f1340[_0x0145('0x38')](0x1e,'m')['format'](_0x0145('0x31'))},'json':!![]};_0x4d8083[_0x0145('0x10')]=_0x485bdb;return rp(_0x4d8083)[_0x0145('0x1e')](function(_0x595c30){_0x4a3632[_0x0145('0x39')]=_0x595c30[_0x0145('0x3a')]['id'];logger['info'](_0x0145('0x3b'),_0x4a3632[_0x0145('0x39')]);_0x17214a(_0x4a3632);})['catch'](function(_0x1d14a8){logger[_0x0145('0x1a')]('['+[_0xd96d4b[_0x0145('0x1b')]()]+']',_0x1d14a8['message']);_0x1ae025(_0x1d14a8[_0x0145('0x1c')]);});});};}function emit(_0x490810,_0x3cc093,_0x22f317){var _0x2870a9={'uri':_0x490810+_0x0145('0x3c')+_0x22f317};io['to'](util[_0x0145('0x28')]('user:%s',_0x3cc093))[_0x0145('0x3d')](_0x0145('0x3e'),_0x2870a9);}exports['cs']=function(_0x189ec3,_0x57f80e,_0x2e59f3,_0x255ffa,_0x10f6ac,_0x582f,_0x14cfd9,_0x5a5f9c){var _0x5abd4c={};var _0x29af52={'Authorization':_0x0145('0x3f')+_0x582f[_0x0145('0x40')]};_0x582f[_0x0145('0x41')]=intUtil[_0x0145('0x42')](_0x582f[_0x0145('0x41')]);_0x582f[_0x0145('0x43')]=intUtil[_0x0145('0x42')](_0x582f[_0x0145('0x43')]);var _0x22b205=_0x582f[_0x0145('0x41')];_0x5abd4c['adminEmail']=_0x582f[_0x0145('0x44')];_0x5abd4c[_0x0145('0x2a')]=_0x5a5f9c['toLowerCase']()===_0x0145('0x45')?_0x57f80e['destcalleridnum']:_0x57f80e[_0x0145('0x46')];_0x5abd4c[_0x0145('0x47')]=_0x5a5f9c===_0x0145('0x48')||_0x5a5f9c===_0x0145('0x49')?_0x0145('0x48'):_0x0145('0x45');if(_0x255ffa){_0x5abd4c['agentEmail']=_0x255ffa[_0x0145('0x15')];}var _0x3d6b66=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x582f[_0x0145('0x43')],_0x57f80e['uniqueid'],md5(_0x57f80e[_0x0145('0x4a')]));if(_0x10f6ac&&_0x10f6ac['monitor_format']){logger[_0x0145('0x11')](_0x0145('0x4b'),_0x0145('0x4c'));_0x57f80e[_0x0145('0x4d')]=_0x3d6b66;}else if(_0x14cfd9&&_0x14cfd9[_0x0145('0x4e')]&&_0x14cfd9[_0x0145('0x4e')]!==_0x0145('0x4f')){logger[_0x0145('0x11')](_0x0145('0x50'),_0x0145('0x4c'));_0x57f80e[_0x0145('0x4d')]=_0x3d6b66;}else{_0x57f80e[_0x0145('0x4d')]='';}return getAdminId(_0x5abd4c,_0x5a5f9c,_0x29af52,_0x22b205)['then'](getUser(_0x5a5f9c,_0x29af52,_0x22b205))['then'](getEndUser(_0x5a5f9c,_0x29af52,_0x22b205))[_0x0145('0x1e')](getTicket(_0x5a5f9c,_0x29af52,_0x22b205,_0x2e59f3,_0x57f80e))[_0x0145('0x1e')](function(_0x5bcbb0){logger[_0x0145('0x11')](util[_0x0145('0x28')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5bcbb0[_0x0145('0x39')]));if(_0x5a5f9c!==_0x0145('0x49')){logger[_0x0145('0x11')]('['+[_0x5a5f9c[_0x0145('0x1b')]()]+']',_0x0145('0x51'));emit(_0x22b205,_0x255ffa[_0x0145('0x52')],_0x5bcbb0[_0x0145('0x2c')]);}})[_0x0145('0x25')](function(_0x2e37ba){logger[_0x0145('0x1a')]('['+[_0x5a5f9c[_0x0145('0x1b')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x2e37ba,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6c08=['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','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','email','userId','Admin\x20selected','adminId','/api/lookup?q='];(function(_0x958af5,_0x5974cf){var _0x1fa6f8=function(_0xad300b){while(--_0xad300b){_0x958af5['push'](_0x958af5['shift']());}};_0x1fa6f8(++_0x5974cf);}(_0x6c08,0xd7));var _0x86c0=function(_0x33e261,_0x2c53cd){_0x33e261=_0x33e261-0x0;var _0xafdbb5=_0x6c08[_0x33e261];return _0xafdbb5;};'use strict';var _=require(_0x86c0('0x0'));var rp=require(_0x86c0('0x1'));var md5=require('md5');var util=require(_0x86c0('0x2'));var moment=require('moment');var Promise=require(_0x86c0('0x3'));var Redis=require(_0x86c0('0x4'));var intUtil=require(_0x86c0('0x5'));var config=require(_0x86c0('0x6'));var logger=require(_0x86c0('0x7'))(_0x86c0('0x8'));config['redis']=_[_0x86c0('0x9')](config[_0x86c0('0xa')],{'host':_0x86c0('0xb'),'port':0x18eb});var io=require(_0x86c0('0xc'))(new Redis(config[_0x86c0('0xa')]));function getAdminId(_0x31cb04,_0x29bbf0,_0x30031a,_0x5a6b4c){return new Promise(function(_0x18eafe,_0x5724bc){var _0x3c4a25=![];var _0x34919b={'method':'GET','uri':_0x5a6b4c+_0x86c0('0xd'),'json':!![]};_0x34919b['headers']=_0x30031a;logger[_0x86c0('0xe')](_0x86c0('0xf'));return rp(_0x34919b)[_0x86c0('0x10')](function(_0x4b34bd){if(_0x4b34bd){var _0x5f57e0=_0x4b34bd[_0x86c0('0x11')];var _0x2d59aa=null;for(_0x2d59aa=0x0;_0x2d59aa<_0x5f57e0[_0x86c0('0x12')];_0x2d59aa++){if(_0x5f57e0[_0x2d59aa]['email']===_0x31cb04[_0x86c0('0x13')]){_0x31cb04['adminId']=_0x5f57e0[_0x2d59aa]['id'];_0x3c4a25=!![];}}if(_0x3c4a25){logger[_0x86c0('0xe')](_0x86c0('0x14'),_0x31cb04['adminId']);_0x18eafe(_0x31cb04);}else{_0x5724bc({'statusCode':0x194,'message':_0x86c0('0x15')});}}else{_0x5724bc({'statusCode':0x194,'message':_0x86c0('0x15')});}})[_0x86c0('0x16')](function(_0x1a7263){logger[_0x86c0('0x17')]('['+[_0x29bbf0[_0x86c0('0x18')]()]+']',_0x1a7263[_0x86c0('0x19')]);_0x5724bc(_0x1a7263);});});}function getUser(_0x590388,_0x21d3a0,_0x19301b){return function(_0x3f4a04){return new Promise(function(_0x104862,_0x5b2d73){var _0x1e91b9={'method':_0x86c0('0x1a'),'uri':_0x19301b+_0x86c0('0xd'),'json':!![]};_0x1e91b9[_0x86c0('0x1b')]=_0x21d3a0;logger[_0x86c0('0xe')](_0x86c0('0x1c'));return rp(_0x1e91b9)[_0x86c0('0x10')](function(_0xa1138a){if(_0xa1138a){var _0x54eb89=_0xa1138a['users'];var _0x23e0e5=![];var _0x47a0f4=null;if(_0x3f4a04['agentEmail']!==null){logger['info'](_0x86c0('0x1d'),_0x3f4a04[_0x86c0('0x1e')]);_0x3f4a04[_0x86c0('0x1f')]=_0x3f4a04[_0x86c0('0x1e')];for(_0x47a0f4=0x0;_0x47a0f4<_0x54eb89[_0x86c0('0x12')];_0x47a0f4++){if(_0x54eb89[_0x47a0f4][_0x86c0('0x20')]===_0x3f4a04['agentEmail']){_0x23e0e5=!![];_0x3f4a04[_0x86c0('0x21')]=_0x54eb89[_0x47a0f4]['id'];logger[_0x86c0('0xe')]('User\x20found:',_0x3f4a04[_0x86c0('0x21')]);}}}if(!_0x23e0e5){logger['info'](_0x86c0('0x22'));_0x3f4a04[_0x86c0('0x1f')]=_0x3f4a04[_0x86c0('0x13')];_0x3f4a04[_0x86c0('0x21')]=_0x3f4a04[_0x86c0('0x23')];_0x23e0e5=!![];}if(_0x23e0e5){_0x104862(_0x3f4a04);}else{_0x5b2d73({'statusCode':0x194,'message':_0x86c0('0x15')});}}else{_0x5b2d73({'statusCode':0x194,'message':_0x86c0('0x15')});}})[_0x86c0('0x16')](function(_0x29be48){logger[_0x86c0('0x17')]('['+[_0x590388[_0x86c0('0x18')]()]+']',_0x29be48['message']);_0x5b2d73(_0x29be48);});});};}function searchContact(_0x5e205f,_0x3d8a1e,_0x52cc01,_0x2f6993){return new Promise(function(_0x516c5c,_0x2f7d4b){var _0x483ae2={'method':'GET','headers':_0x3d8a1e,'uri':_0x5e205f+_0x86c0('0x24')+_0x2f6993+'&f='+_0x52cc01+'&entities=contact','json':!![]};rp(_0x483ae2)['then'](function(_0x218d3d){var _0x58ba84=_[_0x86c0('0x25')](_0x218d3d[_0x86c0('0x26')]['contacts'],[_0x52cc01,_0x2f6993]);_0x516c5c(_0x58ba84);})[_0x86c0('0x16')](function(_0x1c736c){_0x2f7d4b(_0x1c736c);});});}function getEndUser(_0xe83af0,_0x236131,_0x5d4e69){return function(_0x261ca2){return new Promise(function(_0x5cab7f,_0x44aefa){logger[_0x86c0('0xe')](util[_0x86c0('0x27')](_0x86c0('0x28'),_0x261ca2['contactNumber']));searchContact(_0x5d4e69,_0x236131,'mobile_number',_0x261ca2[_0x86c0('0x29')])['then'](function(_0x1f989e){if(_0x1f989e){_0x261ca2[_0x86c0('0x2a')]=_0x1f989e['id'];logger[_0x86c0('0xe')](_0x86c0('0x2b'),_0x261ca2[_0x86c0('0x2a')]);return _0x5cab7f(_0x261ca2);}searchContact(_0x5d4e69,_0x236131,_0x86c0('0x2c'),_0x261ca2[_0x86c0('0x29')])['then'](function(_0x1ef5d4){if(_0x1ef5d4){_0x261ca2[_0x86c0('0x2a')]=_0x1ef5d4['id'];logger[_0x86c0('0xe')](_0x86c0('0x2d'),_0x261ca2[_0x86c0('0x2a')]);return _0x5cab7f(_0x261ca2);}createEndUser(_0x261ca2,_0xe83af0,_0x236131,_0x5d4e69)['then'](function(_0x24c8e1){logger[_0x86c0('0xe')](_0x86c0('0x2e'),_0x24c8e1[_0x86c0('0x2a')]);return _0x5cab7f(_0x24c8e1);});});})['catch'](function(_0xcf3519){_0x44aefa(_0xcf3519);});});};}function createEndUser(_0x8dc367,_0x1f8978,_0x41f747,_0x2f38fe){return new Promise(function(_0x375833,_0x2130ea){var _0x515b9a=moment();var _0x3d3796={'method':_0x86c0('0x2f'),'uri':_0x2f38fe+_0x86c0('0x30'),'body':{'contact':{'last_name':_0x8dc367[_0x86c0('0x29')],'work_number':_0x8dc367[_0x86c0('0x29')],'mobile_number':_0x8dc367[_0x86c0('0x29')],'owner_id':_0x8dc367[_0x86c0('0x21')],'created_at':_0x515b9a[_0x86c0('0x27')](_0x86c0('0x31'))}},'json':!![]};_0x3d3796[_0x86c0('0x1b')]=_0x41f747;logger[_0x86c0('0xe')](_0x86c0('0x32'));return rp(_0x3d3796)[_0x86c0('0x10')](function(_0x102550){_0x8dc367[_0x86c0('0x2a')]=_0x102550[_0x86c0('0x33')]['id'];_0x375833(_0x8dc367);})[_0x86c0('0x16')](function(_0x3d52d2){logger[_0x86c0('0x17')]('['+[_0x1f8978[_0x86c0('0x18')]()]+']',_0x3d52d2[_0x86c0('0x19')]);_0x2130ea(_0x3d52d2[_0x86c0('0x19')]);});});}function getTicket(_0x3b2157,_0xd7a2b6,_0x11082d,_0x2eb6c5,_0x134fe6){return function(_0x235d83){logger[_0x86c0('0xe')](_0x86c0('0x34'));return new Promise(function(_0x26efab,_0x44cb67){var _0x30532a=moment();var _0xae5964={'method':_0x86c0('0x2f'),'uri':_0x11082d+_0x86c0('0x35'),'body':{'title':intUtil[_0x86c0('0x36')](_0x2eb6c5['Subjects'],_0x134fe6,'\x20'),'description':intUtil[_0x86c0('0x36')](_0x2eb6c5[_0x86c0('0x37')],_0x134fe6,'\x0a'),'owner_id':_0x235d83['userId'],'creater_id':_0x235d83[_0x86c0('0x23')],'targetable_id':_0x235d83[_0x86c0('0x2a')],'targetable_type':'Contact','created_at':_0x30532a[_0x86c0('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x30532a[_0x86c0('0x38')](0x1e,'m')[_0x86c0('0x27')](_0x86c0('0x31'))},'json':!![]};_0xae5964[_0x86c0('0x1b')]=_0xd7a2b6;return rp(_0xae5964)[_0x86c0('0x10')](function(_0x5f656){_0x235d83[_0x86c0('0x39')]=_0x5f656['task']['id'];logger[_0x86c0('0xe')]('Task\x20created:',_0x235d83['ticketId']);_0x26efab(_0x235d83);})['catch'](function(_0x2a7682){logger[_0x86c0('0x17')]('['+[_0x3b2157[_0x86c0('0x18')]()]+']',_0x2a7682[_0x86c0('0x19')]);_0x44cb67(_0x2a7682[_0x86c0('0x19')]);});});};}function emit(_0x38c650,_0x213087,_0x339eb5){var _0x472596={'uri':_0x38c650+_0x86c0('0x3a')+_0x339eb5};io['to'](util[_0x86c0('0x27')](_0x86c0('0x3b'),_0x213087))['emit'](_0x86c0('0x3c'),_0x472596);}exports['cs']=function(_0x587cd5,_0x5d55f7,_0x3c3a7d,_0x17fb2f,_0x29b4b0,_0x2734a9,_0x2b5c1b,_0xbeec60){var _0x1488e0={};var _0x5c4412={'Authorization':_0x86c0('0x3d')+_0x2734a9[_0x86c0('0x3e')]};_0x2734a9[_0x86c0('0x3f')]=intUtil[_0x86c0('0x40')](_0x2734a9['remoteUri']);_0x2734a9[_0x86c0('0x41')]=intUtil[_0x86c0('0x40')](_0x2734a9['serverUrl']);var _0x65e426=_0x2734a9['remoteUri'];_0x1488e0[_0x86c0('0x13')]=_0x2734a9['username'];_0x1488e0[_0x86c0('0x29')]=_0xbeec60[_0x86c0('0x42')]()===_0x86c0('0x43')?_0x5d55f7[_0x86c0('0x44')]:_0x5d55f7[_0x86c0('0x45')];_0x1488e0[_0x86c0('0x46')]=_0xbeec60==='queue'||_0xbeec60===_0x86c0('0x47')?_0x86c0('0x48'):_0x86c0('0x43');if(_0x17fb2f){_0x1488e0[_0x86c0('0x1e')]=_0x17fb2f[_0x86c0('0x20')];}var _0x4d03f4=util[_0x86c0('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2734a9[_0x86c0('0x41')],_0x5d55f7['uniqueid'],md5(_0x5d55f7[_0x86c0('0x49')]));if(_0x29b4b0&&_0x29b4b0[_0x86c0('0x4a')]){logger['info'](_0x86c0('0x4b'),_0x86c0('0x4c'));_0x5d55f7['recordingURL']=_0x4d03f4;}else if(_0x2b5c1b&&_0x2b5c1b['recordingFormat']&&_0x2b5c1b['recordingFormat']!==_0x86c0('0x4d')){logger[_0x86c0('0xe')](_0x86c0('0x4e'),'Recording\x20is\x20enabled!');_0x5d55f7['recordingURL']=_0x4d03f4;}else{_0x5d55f7['recordingURL']='';}return getAdminId(_0x1488e0,_0xbeec60,_0x5c4412,_0x65e426)[_0x86c0('0x10')](getUser(_0xbeec60,_0x5c4412,_0x65e426))[_0x86c0('0x10')](getEndUser(_0xbeec60,_0x5c4412,_0x65e426))['then'](getTicket(_0xbeec60,_0x5c4412,_0x65e426,_0x3c3a7d,_0x5d55f7))[_0x86c0('0x10')](function(_0x98eb90){logger[_0x86c0('0xe')](util[_0x86c0('0x27')](_0x86c0('0x4f'),_0x98eb90[_0x86c0('0x39')]));if(_0xbeec60!==_0x86c0('0x47')){logger[_0x86c0('0xe')]('['+[_0xbeec60[_0x86c0('0x18')]()]+']',_0x86c0('0x50'));emit(_0x65e426,_0x17fb2f[_0x86c0('0x51')],_0x98eb90[_0x86c0('0x2a')]);}})[_0x86c0('0x16')](function(_0x30e812){logger[_0x86c0('0x17')]('['+[_0xbeec60[_0x86c0('0x18')]()]+_0x86c0('0x52'),util[_0x86c0('0x53')](_0x30e812,{'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 f31085a..dc8d3de 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 _0x4873=['dynamics365','freshsales','exec','includes','toLowerCase','data1','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','servicenow','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','lodash','util','./zendesk','./sugarcrm','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4873,0x1df));var _0x3487=function(_0x34a4f6,_0x55b9a4){_0x34a4f6=_0x34a4f6-0x0;var _0x4ab331=_0x4873[_0x34a4f6];return _0x4ab331;};'use strict';var _=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var zendesk=require(_0x3487('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x3487('0x3'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x3487('0x4'));var vtiger=require(_0x3487('0x5'));var servicenow=require(_0x3487('0x6'));var dynamics365=require(_0x3487('0x7'));var freshsales=require(_0x3487('0x8'));var integrations=[_0x3487('0x9'),_0x3487('0xa'),_0x3487('0xb'),'freshdesk',_0x3487('0xc'),_0x3487('0xd'),_0x3487('0xe'),_0x3487('0xf'),_0x3487('0x10'),'servicenow'];exports[_0x3487('0x11')]=function(_0x5e2cca,_0x1a5a7a,_0x1b9955,_0x56d926,_0x56b795,_0x43a64c){if(_0x1b9955){if(_[_0x3487('0x12')](integrations,_0x5e2cca['data1'][_0x3487('0x13')]())){try{var _0x50f795=null;var _0x557d64='';var _0x395774=_0x1b9955[_0x5e2cca[_0x3487('0x14')][_0x3487('0x13')]()];if(_0x395774){var _0x3033b3=_0x395774[_0x5e2cca[_0x3487('0x15')]];if(_0x3033b3){var _0x1e468b=_['find'](_0x3033b3[_0x3487('0x16')],{'id':parseInt(_0x5e2cca[_0x3487('0x17')],0xa)});if(_0x1e468b){if(_0x56d926){if(_0x56b795&&_0x1a5a7a[_0x3487('0x18')]){_0x557d64='queue';}else if(_0x1a5a7a[_0x3487('0x19')]){_0x557d64=_0x3487('0x1a');}else{console[_0x3487('0x1b')](_0x3487('0x1c'),_0x1a5a7a);}}else{_0x557d64=_0x3487('0x1d');}switch(_0x5e2cca[_0x3487('0x14')][_0x3487('0x13')]()){case _0x3487('0x9'):zendesk[_0x557d64](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c);break;case _0x3487('0xa'):salesforce[_0x557d64](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c);break;case _0x3487('0xb'):sugarcrm[_0x557d64](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c);break;case _0x3487('0x1e'):freshdesk[_0x557d64](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c);break;case _0x3487('0xc'):zoho[_0x557d64](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c);break;case _0x3487('0xd'):desk[_0x557d64](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c);break;case _0x3487('0xe'):vtiger[_0x557d64](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c);break;case'freshsales':freshsales['cs'](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c,_0x557d64);break;case _0x3487('0x1f'):servicenow['cs'](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c,_0x557d64);break;case'dynamics365':dynamics365['cs'](_0x5e2cca,_0x1a5a7a,_0x1e468b,_0x56d926,_0x56b795,_0x3033b3,_0x43a64c,_0x557d64);break;default:console[_0x3487('0x1b')](_0x3487('0x20'));}}else{_0x50f795=require(_0x3487('0x21'))(_0x5e2cca[_0x3487('0x14')][_0x3487('0x13')]());_0x50f795[_0x3487('0x22')]('[EXEC]',util[_0x3487('0x23')](_0x3487('0x24'),_0x5e2cca[_0x3487('0x14')][_0x3487('0x13')](),_0x5e2cca[_0x3487('0x17')]));}}else{_0x50f795=require(_0x3487('0x21'))(_0x5e2cca['data1'][_0x3487('0x13')]());_0x50f795[_0x3487('0x22')](_0x3487('0x25'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x5e2cca[_0x3487('0x14')][_0x3487('0x13')](),_0x5e2cca[_0x3487('0x15')]));}}else{}}catch(_0x3a9d76){console['error'](_0x3a9d76);}}}}; \ No newline at end of file +var _0x4067=['./zoho','./desk','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','includes','data1','toLowerCase','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','zendesk','freshsales','unknown\x20integration','../../../../config/logger','[EXEC]','format','error','%s\x20account\x20#%s\x20not\x20found','lodash','./sugarcrm'];(function(_0x58aae3,_0x3fbc1b){var _0x5c1c8a=function(_0x251f05){while(--_0x251f05){_0x58aae3['push'](_0x58aae3['shift']());}};_0x5c1c8a(++_0x3fbc1b);}(_0x4067,0xd0));var _0x7406=function(_0x42f9a1,_0x3e4acb){_0x42f9a1=_0x42f9a1-0x0;var _0x412c3e=_0x4067[_0x42f9a1];return _0x412c3e;};'use strict';var _=require(_0x7406('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x7406('0x1'));var freshdesk=require('./freshdesk');var zoho=require(_0x7406('0x2'));var desk=require(_0x7406('0x3'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x7406('0x4'));var integrations=['zendesk',_0x7406('0x5'),_0x7406('0x6'),_0x7406('0x7'),_0x7406('0x8'),_0x7406('0x9'),_0x7406('0xa'),_0x7406('0xb'),'freshsales',_0x7406('0xc')];exports['exec']=function(_0x231442,_0x297c64,_0x8584e3,_0x592d01,_0x459bc5,_0x2bc62b){if(_0x8584e3){if(_[_0x7406('0xd')](integrations,_0x231442[_0x7406('0xe')][_0x7406('0xf')]())){try{var _0x224f4b=null;var _0x1d215d='';var _0x10dfd0=_0x8584e3[_0x231442[_0x7406('0xe')][_0x7406('0xf')]()];if(_0x10dfd0){var _0x46dd82=_0x10dfd0[_0x231442['data2']];if(_0x46dd82){var _0x472f25=_['find'](_0x46dd82['Configurations'],{'id':parseInt(_0x231442[_0x7406('0x10')],0xa)});if(_0x472f25){if(_0x592d01){if(_0x459bc5&&_0x297c64[_0x7406('0x11')]){_0x1d215d=_0x7406('0x11');}else if(_0x297c64[_0x7406('0x12')]){_0x1d215d=_0x7406('0x13');}else{console[_0x7406('0x14')](_0x7406('0x15'),_0x297c64);}}else{_0x1d215d='unmanaged';}switch(_0x231442['data1'][_0x7406('0xf')]()){case _0x7406('0x16'):zendesk[_0x1d215d](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b);break;case _0x7406('0x5'):salesforce[_0x1d215d](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b);break;case _0x7406('0x6'):sugarcrm[_0x1d215d](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b);break;case _0x7406('0x7'):freshdesk[_0x1d215d](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b);break;case _0x7406('0x8'):zoho[_0x1d215d](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b);break;case _0x7406('0x9'):desk[_0x1d215d](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b);break;case _0x7406('0xa'):vtiger[_0x1d215d](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b);break;case _0x7406('0x17'):freshsales['cs'](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b,_0x1d215d);break;case _0x7406('0xc'):servicenow['cs'](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b,_0x1d215d);break;case _0x7406('0xb'):dynamics365['cs'](_0x231442,_0x297c64,_0x472f25,_0x592d01,_0x459bc5,_0x46dd82,_0x2bc62b,_0x1d215d);break;default:console[_0x7406('0x14')](_0x7406('0x18'));}}else{_0x224f4b=require(_0x7406('0x19'))(_0x231442[_0x7406('0xe')][_0x7406('0xf')]());_0x224f4b['error'](_0x7406('0x1a'),util[_0x7406('0x1b')]('%s\x20configuration\x20#%s\x20not\x20found',_0x231442[_0x7406('0xe')][_0x7406('0xf')](),_0x231442[_0x7406('0x10')]));}}else{_0x224f4b=require(_0x7406('0x19'))(_0x231442[_0x7406('0xe')][_0x7406('0xf')]());_0x224f4b[_0x7406('0x1c')](_0x7406('0x1a'),util[_0x7406('0x1b')](_0x7406('0x1d'),_0x231442[_0x7406('0xe')]['toLowerCase'](),_0x231442['data2']));}}else{}}catch(_0x3111e6){console[_0x7406('0x1c')](_0x3111e6);}}}}; \ 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 dffc20b..4b1c0f0 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 _0x347e=['ActivityDate','IsReminderSet','IsRecurrence','contact','endUserType','lead','Case','account','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','execute','then','Email','Agent\x20%s\x20found.','resolve','user_id','display_name','identity','info','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','find','Contact','Account','Name','Phone','attributes','type','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','Company','No\x20Company','Caller\x20-\x20%s','forEach','includes','picklist','idField','content','variableName','Variable','name','toLowerCase','toString','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','jsforce','ioredis','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task'];(function(_0x246390,_0x1be5fa){var _0x17516e=function(_0x4cfc97){while(--_0x4cfc97){_0x246390['push'](_0x246390['shift']());}};_0x17516e(++_0x1be5fa);}(_0x347e,0x6a));var _0xe347=function(_0x3a3a7d,_0x58e12f){_0x3a3a7d=_0x3a3a7d-0x0;var _0x82c974=_0x347e[_0x3a3a7d];return _0x82c974;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xe347('0x0'));var BPromise=require(_0xe347('0x1'));var md5=require('md5');var jsforce=require(_0xe347('0x2'));var util=require('util');var Redis=require(_0xe347('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe347('0x4'))(_0xe347('0x5'));config[_0xe347('0x6')]=_[_0xe347('0x7')](config[_0xe347('0x6')],{'host':_0xe347('0x8'),'port':0x18eb});var io=require(_0xe347('0x9'))(new Redis(config[_0xe347('0x6')]));function emit(_0x2e57aa,_0x36e395,_0xc7351f){io['to'](_0x2e57aa)[_0xe347('0xa')](_0x36e395,_0xc7351f);}function getTicket(_0x4775b0,_0x4eb5e1,_0x2e9c66,_0x5459aa,_0x584855,_0x5e99be,_0x155e4e,_0x1f11ab){var _0x201702=Object[_0xe347('0xb')]({},{'OwnerId':_0x4eb5e1['id'],'Subject':intUtil[_0xe347('0xc')](_0x5459aa[_0xe347('0xd')],_0x584855,'\x20'),'Description':intUtil[_0xe347('0xc')](_0x5459aa[_0xe347('0xe')],_0x584855,'\x0a')},getCustomFields(_0x5e99be,_0x584855));if(_0x2e9c66){if(_0x5459aa[_0xe347('0xf')]===_0xe347('0x10')){_0x201702[_0xe347('0x11')]=moment['utc']();_0x201702[_0xe347('0x12')]=![];_0x201702[_0xe347('0x13')]=![];if(_0x2e9c66['endUserType']===_0xe347('0x14')||_0x2e9c66[_0xe347('0x15')]===_0xe347('0x16')){_0x201702['WhoId']=_0x2e9c66['id'];}else if(_0x2e9c66[_0xe347('0x15')]==='account'){_0x201702['WhatId']=_0x2e9c66['id'];}}else if(_0x5459aa[_0xe347('0xf')]===_0xe347('0x17')){if(_0x2e9c66['endUserType']===_0xe347('0x14')){_0x201702['ContactId']=_0x2e9c66['id'];}else if(_0x2e9c66[_0xe347('0x15')]===_0xe347('0x18')){_0x201702['AccountId']=_0x2e9c66['id'];}else if(_0x2e9c66[_0xe347('0x15')]===_0xe347('0x16')&&_0x5459aa[_0xe347('0x19')]){_0x201702[_0x5459aa['leadId']]=_0x2e9c66['id'];}else{logger['info'](_0xe347('0x1a'));}}}return _0x155e4e[_0xe347('0x1b')](_0x5459aa[_0xe347('0xf')])[_0xe347('0x1c')](_0x201702);}function getUser(_0x82a725,_0x334e9f,_0x19aac0){if(!_[_0xe347('0x1d')](_0x334e9f)&&intUtil['validateEmail'](_0x334e9f)){var _0x1cc48d={'Email':_0x334e9f};var _0x24659f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x19aac0[_0xe347('0x1b')](_0xe347('0x1e'))['find'](_0x1cc48d,_0x24659f)[_0xe347('0x1f')]()[_0xe347('0x20')](function(_0x275cc2){if(_0x275cc2['length']){var _0x432c78=_['find'](_0x275cc2,function(_0x4a6004){return _0x4a6004[_0xe347('0x21')]===_0x334e9f;});if(_0x432c78){logger['info'](_0xe347('0x22'),_0x334e9f);return BPromise[_0xe347('0x23')]({'id':_0x432c78['Id'],'name':_0x432c78['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x334e9f);return _0x19aac0['identity']()[_0xe347('0x20')](function(_0x27bdba){return BPromise[_0xe347('0x23')]({'id':_0x27bdba[_0xe347('0x24')],'name':_0x27bdba[_0xe347('0x25')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x334e9f);return _0x19aac0[_0xe347('0x26')]()['then'](function(_0x108a64){return BPromise[_0xe347('0x23')]({'id':_0x108a64[_0xe347('0x24')],'name':_0x108a64[_0xe347('0x25')]});});}}function getEndUser(_0xc5c737,_0x2954c5,_0x29d896,_0x3d2e26,_0x3c3a28){var _0x41a95c={'$or':{'Phone':_0x3d2e26}};var _0x3f2574={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe347('0x23')]()[_0xe347('0x20')](function(){logger[_0xe347('0x27')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3d2e26,_0x2954c5['moduleSearch']);switch(_0x2954c5['moduleSearch']){case _0xe347('0x28'):var _0x5adc8b=_[_0xe347('0x29')](_0x41a95c);if(_0x2954c5[_0xe347('0x2a')]){var _0x192ab6={};_0x192ab6[_0x2954c5[_0xe347('0x2a')]]=_0x3d2e26;_[_0xe347('0x2b')](_0x5adc8b[_0xe347('0x2c')],_0x192ab6);}return _0x3c3a28[_0xe347('0x1b')]('Contact')['find'](_0x5adc8b,_0x3f2574)[_0xe347('0x1f')]()[_0xe347('0x20')](function(_0x4b54c5){if(_0x4b54c5&&_0x4b54c5[_0xe347('0x2d')]){return _0x4b54c5;}else{var _0x472a6f=_[_0xe347('0x29')](_0x41a95c);if(_0x2954c5[_0xe347('0x2e')]){var _0x2a475e={};_0x2a475e[_0x2954c5['additionalSearchLead']]=_0x3d2e26;_[_0xe347('0x2b')](_0x472a6f[_0xe347('0x2c')],_0x2a475e);}return _0x3c3a28[_0xe347('0x1b')](_0xe347('0x2f'))['find'](_0x472a6f,_0x3f2574);}});case _0xe347('0x30'):var _0x2b21ae=_[_0xe347('0x29')](_0x41a95c);if(_0x2954c5['additionalSearchAccount']){var _0x192ab6={};_0x192ab6[_0x2954c5[_0xe347('0x31')]]=_0x3d2e26;_[_0xe347('0x2b')](_0x2b21ae[_0xe347('0x2c')],_0x192ab6);}return _0x3c3a28[_0xe347('0x1b')]('Account')[_0xe347('0x32')](_0x2b21ae,_0x3f2574)[_0xe347('0x1f')]()['then'](function(_0x12b655){if(_0x12b655&&_0x12b655[_0xe347('0x2d')]){return _0x12b655;}else{var _0x2f51c0=_[_0xe347('0x29')](_0x41a95c);if(_0x2954c5[_0xe347('0x2a')]){var _0x173242={};_0x173242[_0x2954c5[_0xe347('0x2a')]]=_0x3d2e26;_[_0xe347('0x2b')](_0x2f51c0['$or'],_0x173242);}return _0x3c3a28[_0xe347('0x1b')]('Contact')[_0xe347('0x32')](_0x2f51c0,_0x3f2574)[_0xe347('0x20')](function(_0x744533){if(_0x744533&&_0x744533[_0xe347('0x2d')]){return _0x744533;}else{var _0x3f24f2=_['cloneDeep'](_0x41a95c);if(_0x2954c5[_0xe347('0x2e')]){var _0x13439f={};_0x13439f[_0x2954c5[_0xe347('0x2e')]]=_0x3d2e26;_[_0xe347('0x2b')](_0x3f24f2[_0xe347('0x2c')],_0x13439f);}return _0x3c3a28[_0xe347('0x1b')]('Lead')[_0xe347('0x32')](_0x3f24f2,_0x3f2574);}});}});case _0xe347('0x14'):var _0x5adc8b=_[_0xe347('0x29')](_0x41a95c);if(_0x2954c5[_0xe347('0x2a')]){var _0x192ab6={};_0x192ab6[_0x2954c5[_0xe347('0x2a')]]=_0x3d2e26;_[_0xe347('0x2b')](_0x5adc8b[_0xe347('0x2c')],_0x192ab6);}return _0x3c3a28[_0xe347('0x1b')](_0xe347('0x33'))[_0xe347('0x32')](_0x5adc8b,_0x3f2574)['execute']();case'lead':var _0x477a67=_[_0xe347('0x29')](_0x41a95c);if(_0x2954c5[_0xe347('0x2e')]){var _0x192ab6={};_0x192ab6[_0x2954c5[_0xe347('0x2e')]]=_0x3d2e26;_[_0xe347('0x2b')](_0x477a67[_0xe347('0x2c')],_0x192ab6);}return _0x3c3a28[_0xe347('0x1b')]('Lead')[_0xe347('0x32')](_0x477a67,_0x3f2574);case _0xe347('0x18'):var _0x2b21ae=_['cloneDeep'](_0x41a95c);if(_0x2954c5[_0xe347('0x31')]){var _0x192ab6={};_0x192ab6[_0x2954c5[_0xe347('0x31')]]=_0x3d2e26;_[_0xe347('0x2b')](_0x2b21ae[_0xe347('0x2c')],_0x192ab6);}return _0x3c3a28[_0xe347('0x1b')](_0xe347('0x34'))[_0xe347('0x32')](_0x2b21ae,_0x3f2574);default:return null;}})[_0xe347('0x20')](function(_0x56db3e){if(_0x56db3e&&_0x56db3e[_0xe347('0x2d')]){var _0x2a7811=_['first'](_0x56db3e);if(_0x2a7811){return BPromise[_0xe347('0x23')]({'id':_0x2a7811['Id'],'name':_0x2a7811[_0xe347('0x35')],'phone':_0x2a7811[_0xe347('0x36')],'endUserType':_0x2a7811[_0xe347('0x37')][_0xe347('0x38')]['toLowerCase']()});}}})[_0xe347('0x20')](function(_0x15cf6f){if(_0x15cf6f){logger[_0xe347('0x27')](_0xe347('0x39'),_0x15cf6f[_0xe347('0x15')],_0x3d2e26);return BPromise[_0xe347('0x23')](_0x15cf6f);}else{logger[_0xe347('0x27')](_0xe347('0x3a'),_0x3d2e26);var _0x502061={'Phone':_0x3d2e26};if(_0x2954c5[_0xe347('0x3b')]){if(_0x2954c5[_0xe347('0x3b')]===_0xe347('0x14')){logger[_0xe347('0x27')](_0xe347('0x3c'),_0x3d2e26,_0x2954c5['moduleCreate']);_0x502061[_0xe347('0x3d')]=_0x29d896!==_0xe347('0x3e')?_0x29d896:util['format']('Caller\x20-\x20%s',_0x3d2e26);}else if(_0x2954c5[_0xe347('0x3b')]===_0xe347('0x16')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3d2e26,_0x2954c5[_0xe347('0x3b')]);_0x502061[_0xe347('0x3d')]=_0x29d896!==''?_0x29d896:util[_0xe347('0x3f')]('Caller\x20-\x20%s',_0x3d2e26);_0x502061[_0xe347('0x40')]=_0xe347('0x41');}else if(_0x2954c5[_0xe347('0x3b')]===_0xe347('0x18')){logger[_0xe347('0x27')](_0xe347('0x3c'),_0x3d2e26,_0x2954c5[_0xe347('0x3b')]);_0x502061['Name']=_0x29d896!==_0xe347('0x3e')?_0x29d896:util[_0xe347('0x3f')](_0xe347('0x42'),_0x3d2e26);}else{return null;}}return _0x3c3a28['sobject'](_['upperFirst'](_0x2954c5[_0xe347('0x3b')]))['create'](_0x502061)[_0xe347('0x20')](function(_0x38a746){return BPromise[_0xe347('0x23')]({'id':_0x38a746['id'],'endUserType':_0x2954c5['moduleCreate']});});}});}function getCustomFields(_0x29f6a9,_0x1865d9){var _0x1d95b9={};if(_0x29f6a9[_0xe347('0x2d')]>0x0){_[_0xe347('0x43')](_0x29f6a9,function(_0x261d92){if(_[_0xe347('0x44')](['string',_0xe347('0x45')],_0x261d92[_0xe347('0x38')])&&_0x261d92[_0xe347('0x46')]){_0x1d95b9[_0x261d92[_0xe347('0x46')]]=_0x261d92[_0xe347('0x47')]['toString']();}else if(_0x261d92['type']==='variable'&&_0x261d92[_0xe347('0x48')]&&_0x261d92[_0xe347('0x46')]){_0x1865d9[_0x261d92[_0xe347('0x48')]]&&(_0x1d95b9[_0x261d92['idField']]=_0x1865d9[_0x261d92['variableName']]['toString']());}else if(_0x261d92['type']==='customVariable'&&_0x261d92[_0xe347('0x49')]&&_0x261d92[_0xe347('0x49')][_0xe347('0x4a')]&&_0x261d92['idField']){_0x1865d9[_0x261d92['Variable']['name'][_0xe347('0x4b')]()]&&(_0x1d95b9[_0x261d92[_0xe347('0x46')]]=_0x1865d9[_0x261d92['Variable']['name']['toLowerCase']()][_0xe347('0x4c')]());}});}return _0x1d95b9;}function getConnection(_0x5a07a4){var _0xd30cf2=_0x5a07a4[_0xe347('0x4d')]['concat'](_0x5a07a4[_0xe347('0x4e')]);var _0x39c0f0=new jsforce[(_0xe347('0x4f'))]({'oauth2':{'loginUrl':_0x5a07a4[_0xe347('0x50')]||_0xe347('0x51'),'clientId':_0x5a07a4[_0xe347('0x52')],'clientSecret':_0x5a07a4['clientSecret']}});return _0x39c0f0[_0xe347('0x53')](_0x5a07a4[_0xe347('0x54')],_0xd30cf2)['then'](function(){logger['info'](_0xe347('0x55'));return _0x39c0f0;});}exports[_0xe347('0x56')]=function(_0x3f67c6,_0xc11478,_0x3ed8a4,_0x121765,_0xdf198a,_0x2656dd){var _0x2d8afb,_0x29a808,_0x4905ba,_0x342d1d;_0x2656dd[_0xe347('0x57')]=intUtil[_0xe347('0x58')](_0x2656dd[_0xe347('0x57')]);_0x2656dd[_0xe347('0x50')]=intUtil[_0xe347('0x58')](_0x2656dd[_0xe347('0x50')]);if(_0xdf198a&&_0xdf198a[_0xe347('0x59')]){logger[_0xe347('0x27')](_0xe347('0x5a'),_0xe347('0x5b'));_0xc11478[_0xe347('0x5c')]=util[_0xe347('0x3f')](_0xe347('0x5d'),_0x2656dd[_0xe347('0x57')],_0xc11478[_0xe347('0x5e')],md5(_0xc11478[_0xe347('0x5e')]));}else{_0xc11478[_0xe347('0x5c')]='';}return getConnection(_0x2656dd)[_0xe347('0x20')](function(_0x471b23){_0x342d1d=_0x471b23;return getUser(_0x2656dd,_0x121765[_0xe347('0x5f')],_0x342d1d);})['then'](function(_0x16c693){_0x2d8afb=_0x16c693;return getEndUser(_0x2656dd,_0x3ed8a4,_0xc11478[_0xe347('0x60')],_0xc11478[_0xe347('0x61')],_0x342d1d);})['then'](function(_0x3ab3d7){_0x29a808=_0x3ab3d7;return getTicket(_0x2656dd,_0x2d8afb,_0x29a808,_0x3ed8a4,_0xc11478,_0x3ed8a4[_0xe347('0x62')],_0x342d1d,_0xe347('0x56'));})[_0xe347('0x20')](function(_0xf72d0c){_0x4905ba=_0xf72d0c;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x4905ba['id']);logger[_0xe347('0x27')](_0xe347('0x63'),_0x4905ba['id'],_0x121765[_0xe347('0x4a')],_0x2656dd[_0xe347('0x38')]);switch(_0x2656dd[_0xe347('0x38')]){case _0xe347('0x64'):emit(util[_0xe347('0x3f')]('user:%s',_0x121765[_0xe347('0x4a')]),_0xe347('0x65'),{'recordId':_0x4905ba['id']});break;case'newTab':emit(util[_0xe347('0x3f')]('user:%s',_0x121765[_0xe347('0x4a')]),_0xe347('0x66'),{'uri':util[_0xe347('0x3f')](_0xe347('0x67'),_0x342d1d[_0xe347('0x68')],_0x4905ba['id'])});break;default:logger[_0xe347('0x69')](_0xe347('0x6a'));}})[_0xe347('0x6b')](function(_0x538df8){logger['error'](_0xe347('0x5a'),_0x538df8);});};exports[_0xe347('0x6c')]=function(_0x4f7e66,_0x25787b,_0x50f59f,_0x23f87e,_0x169213,_0x528dd6,_0x46a8a2){var _0x2505fc,_0x162c76,_0x329be8,_0x318dbc;_0x528dd6[_0xe347('0x57')]=intUtil['stripTrailingSlash'](_0x528dd6[_0xe347('0x57')]);_0x528dd6[_0xe347('0x50')]=intUtil[_0xe347('0x58')](_0x528dd6['remoteUri']);if(_0x46a8a2&&_0x46a8a2[_0xe347('0x6d')]&&_0x46a8a2[_0xe347('0x6d')]!==_0xe347('0x6e')){logger['info'](_0xe347('0x6f'),_0xe347('0x5b'));_0x25787b[_0xe347('0x5c')]=util[_0xe347('0x3f')](_0xe347('0x5d'),_0x528dd6[_0xe347('0x57')],_0x25787b['uniqueid'],md5(_0x25787b['uniqueid']));}return getConnection(_0x528dd6)['then'](function(_0x1a824e){_0x318dbc=_0x1a824e;return getUser(_0x528dd6,_0x23f87e['email'],_0x318dbc);})[_0xe347('0x20')](function(_0x5c3bf2){_0x2505fc=_0x5c3bf2;return getEndUser(_0x528dd6,_0x50f59f,_0x25787b[_0xe347('0x70')],_0x25787b[_0xe347('0x71')],_0x318dbc);})[_0xe347('0x20')](function(_0x4aae71){_0x162c76=_0x4aae71;return getTicket(_0x528dd6,_0x2505fc,_0x162c76,_0x50f59f,_0x25787b,_0x50f59f[_0xe347('0x62')],_0x318dbc,_0xe347('0x6c'));})[_0xe347('0x20')](function(_0x58bfa4){_0x329be8=_0x58bfa4;logger['info'](_0xe347('0x72'),_0x329be8['id']);logger['info'](_0xe347('0x73'),_0x329be8['id'],_0x23f87e[_0xe347('0x4a')],_0x528dd6['type']);switch(_0x528dd6[_0xe347('0x38')]){case'integrationTab':emit(util[_0xe347('0x3f')](_0xe347('0x74'),_0x23f87e[_0xe347('0x4a')]),_0xe347('0x65'),{'recordId':_0x329be8['id']});break;case _0xe347('0x75'):emit(util['format'](_0xe347('0x74'),_0x23f87e[_0xe347('0x4a')]),_0xe347('0x66'),{'uri':util[_0xe347('0x3f')]('%s/%s/e',_0x318dbc[_0xe347('0x68')],_0x329be8['id'])});break;default:logger[_0xe347('0x69')](_0xe347('0x6f'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x4e7e11){logger['error'](_0xe347('0x6f'),_0x4e7e11);});};exports[_0xe347('0x76')]=function(_0x2e2b7f,_0xbcdaa6,_0x56411d,_0x3436b5,_0x5ca543,_0x2f811){var _0x3b19fd,_0x18c03d,_0x2a2858,_0x26c95f;_0x2f811['serverUrl']=intUtil[_0xe347('0x58')](_0x2f811[_0xe347('0x57')]);_0x2f811[_0xe347('0x50')]=intUtil[_0xe347('0x58')](_0x2f811[_0xe347('0x50')]);if(_0x5ca543&&_0x5ca543[_0xe347('0x59')]){logger['info']('['+_0xbcdaa6[_0xe347('0x77')][_0xe347('0x78')]()+']','Recording\x20is\x20enabled!');_0xbcdaa6['recordingURL']=util[_0xe347('0x3f')](_0xe347('0x5d'),_0x2f811['serverUrl'],_0xbcdaa6[_0xe347('0x5e')],md5(_0xbcdaa6[_0xe347('0x5e')]));}else{_0xbcdaa6[_0xe347('0x5c')]='';}return getConnection(_0x2f811)[_0xe347('0x20')](function(_0x33c6fe){_0x26c95f=_0x33c6fe;if(!_[_0xe347('0x1d')](_0x3436b5)){return getUser(_0x2f811,_0x3436b5[_0xe347('0x4a')],_0x26c95f);}else{return getUser(_0x2f811,null,_0x26c95f);}})[_0xe347('0x20')](function(_0x5ce2e5){_0x3b19fd=_0x5ce2e5;return getEndUser(_0x2f811,_0x56411d,_0xbcdaa6[_0xe347('0x60')],_0xbcdaa6[_0xe347('0x61')],_0x26c95f);})['then'](function(_0x490a32){_0x18c03d=_0x490a32;return getTicket(_0x2f811,_0x3b19fd,_0x18c03d,_0x56411d,_0xbcdaa6,_0x56411d[_0xe347('0x62')],_0x26c95f);})[_0xe347('0x20')](function(_0x2a507e){_0x2a2858=_0x2a507e;logger[_0xe347('0x27')]('['+_0xbcdaa6[_0xe347('0x77')][_0xe347('0x78')]()+_0xe347('0x79'),_0x2a2858['id']);logger[_0xe347('0x27')]('['+_0xbcdaa6[_0xe347('0x77')][_0xe347('0x78')]()+_0xe347('0x7a'),_0x2f811[_0xe347('0x38')]);})[_0xe347('0x6b')](function(_0x2d3c69){logger[_0xe347('0x69')]('['+_0xbcdaa6[_0xe347('0x77')][_0xe347('0x78')]()+']',_0x2d3c69);});}; \ No newline at end of file +var _0x6bbd=['catch','error','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','Task','contact','endUserType','lead','WhoId','account','WhatId','ticketType','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','sobject','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','merge','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','Connection\x20established.','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bbd,0x8d));var _0xd6bb=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x6bbd[_0x35007a];return _0x574f68;};'use strict';var _=require('lodash');var rp=require(_0xd6bb('0x0'));var moment=require(_0xd6bb('0x1'));var BPromise=require(_0xd6bb('0x2'));var md5=require('md5');var jsforce=require(_0xd6bb('0x3'));var util=require(_0xd6bb('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xd6bb('0x5'));var logger=require('../../../../config/logger')('salesforce');config[_0xd6bb('0x6')]=_[_0xd6bb('0x7')](config[_0xd6bb('0x6')],{'host':_0xd6bb('0x8'),'port':0x18eb});var io=require(_0xd6bb('0x9'))(new Redis(config[_0xd6bb('0x6')]));function emit(_0x32ffdd,_0x56b593,_0x5e0f1b){io['to'](_0x32ffdd)[_0xd6bb('0xa')](_0x56b593,_0x5e0f1b);}function getTicket(_0x1ce775,_0x1e9721,_0x3c2b37,_0x4852a4,_0x4a3928,_0x39fd29,_0x4ce670,_0x5d8317){var _0x2529d7=Object[_0xd6bb('0xb')]({},{'OwnerId':_0x1e9721['id'],'Subject':intUtil[_0xd6bb('0xc')](_0x4852a4['Subjects'],_0x4a3928,'\x20'),'Description':intUtil[_0xd6bb('0xc')](_0x4852a4[_0xd6bb('0xd')],_0x4a3928,'\x0a')},getCustomFields(_0x39fd29,_0x4a3928));if(_0x3c2b37){if(_0x4852a4['ticketType']===_0xd6bb('0xe')){_0x2529d7['ActivityDate']=moment['utc']();_0x2529d7['IsReminderSet']=![];_0x2529d7['IsRecurrence']=![];if(_0x3c2b37['endUserType']===_0xd6bb('0xf')||_0x3c2b37[_0xd6bb('0x10')]===_0xd6bb('0x11')){_0x2529d7[_0xd6bb('0x12')]=_0x3c2b37['id'];}else if(_0x3c2b37[_0xd6bb('0x10')]===_0xd6bb('0x13')){_0x2529d7[_0xd6bb('0x14')]=_0x3c2b37['id'];}}else if(_0x4852a4[_0xd6bb('0x15')]==='Case'){if(_0x3c2b37['endUserType']==='contact'){_0x2529d7[_0xd6bb('0x16')]=_0x3c2b37['id'];}else if(_0x3c2b37[_0xd6bb('0x10')]===_0xd6bb('0x13')){_0x2529d7[_0xd6bb('0x17')]=_0x3c2b37['id'];}else if(_0x3c2b37['endUserType']===_0xd6bb('0x11')&&_0x4852a4[_0xd6bb('0x18')]){_0x2529d7[_0x4852a4[_0xd6bb('0x18')]]=_0x3c2b37['id'];}else{logger[_0xd6bb('0x19')](_0xd6bb('0x1a'));}}}return _0x4ce670['sobject'](_0x4852a4[_0xd6bb('0x15')])[_0xd6bb('0x1b')](_0x2529d7);}function getUser(_0x539739,_0x1a37b5,_0x7ff2b1){if(!_[_0xd6bb('0x1c')](_0x1a37b5)&&intUtil[_0xd6bb('0x1d')](_0x1a37b5)){var _0x2f6a9a={'Email':_0x1a37b5};var _0x3971df={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x7ff2b1['sobject'](_0xd6bb('0x1e'))[_0xd6bb('0x1f')](_0x2f6a9a,_0x3971df)[_0xd6bb('0x20')]()['then'](function(_0x2fdd04){if(_0x2fdd04[_0xd6bb('0x21')]){var _0x47f157=_[_0xd6bb('0x1f')](_0x2fdd04,function(_0x1b9c36){return _0x1b9c36[_0xd6bb('0x22')]===_0x1a37b5;});if(_0x47f157){logger[_0xd6bb('0x19')](_0xd6bb('0x23'),_0x1a37b5);return BPromise[_0xd6bb('0x24')]({'id':_0x47f157['Id'],'name':_0x47f157[_0xd6bb('0x25')]});}}else{logger[_0xd6bb('0x19')](_0xd6bb('0x26'),_0x1a37b5);return _0x7ff2b1['identity']()[_0xd6bb('0x27')](function(_0x2f67be){return BPromise['resolve']({'id':_0x2f67be[_0xd6bb('0x28')],'name':_0x2f67be['display_name']});});}});}else{logger['info'](_0xd6bb('0x26'),_0x1a37b5);return _0x7ff2b1[_0xd6bb('0x29')]()[_0xd6bb('0x27')](function(_0x5d9bc3){return BPromise['resolve']({'id':_0x5d9bc3['user_id'],'name':_0x5d9bc3[_0xd6bb('0x2a')]});});}}function getEndUser(_0x51adbc,_0x33ca4c,_0x39d521,_0x3f4448,_0x16de12){var _0x1d29e4={'$or':{'Phone':_0x3f4448}};var _0x566cf0={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xd6bb('0x24')]()['then'](function(){logger[_0xd6bb('0x19')](_0xd6bb('0x2b'),_0x3f4448,_0x33ca4c['moduleSearch']);switch(_0x33ca4c[_0xd6bb('0x2c')]){case _0xd6bb('0x2d'):var _0x1e4891=_[_0xd6bb('0x2e')](_0x1d29e4);if(_0x33ca4c['additionalSearchContact']){var _0x5d743a={};_0x5d743a[_0x33ca4c[_0xd6bb('0x2f')]]=_0x3f4448;_['merge'](_0x1e4891[_0xd6bb('0x30')],_0x5d743a);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x32'))[_0xd6bb('0x1f')](_0x1e4891,_0x566cf0)['execute']()[_0xd6bb('0x27')](function(_0x5f52fe){if(_0x5f52fe&&_0x5f52fe[_0xd6bb('0x21')]){return _0x5f52fe;}else{var _0x3d63f8=_[_0xd6bb('0x2e')](_0x1d29e4);if(_0x33ca4c[_0xd6bb('0x33')]){var _0x479d3a={};_0x479d3a[_0x33ca4c[_0xd6bb('0x33')]]=_0x3f4448;_['merge'](_0x3d63f8['$or'],_0x479d3a);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x34'))[_0xd6bb('0x1f')](_0x3d63f8,_0x566cf0);}});case _0xd6bb('0x35'):var _0x342eea=_[_0xd6bb('0x2e')](_0x1d29e4);if(_0x33ca4c[_0xd6bb('0x36')]){var _0x5d743a={};_0x5d743a[_0x33ca4c['additionalSearchAccount']]=_0x3f4448;_[_0xd6bb('0x37')](_0x342eea[_0xd6bb('0x30')],_0x5d743a);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x38'))[_0xd6bb('0x1f')](_0x342eea,_0x566cf0)[_0xd6bb('0x20')]()[_0xd6bb('0x27')](function(_0x22a178){if(_0x22a178&&_0x22a178[_0xd6bb('0x21')]){return _0x22a178;}else{var _0x2d561b=_[_0xd6bb('0x2e')](_0x1d29e4);if(_0x33ca4c[_0xd6bb('0x2f')]){var _0x49dc50={};_0x49dc50[_0x33ca4c[_0xd6bb('0x2f')]]=_0x3f4448;_[_0xd6bb('0x37')](_0x2d561b[_0xd6bb('0x30')],_0x49dc50);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x32'))[_0xd6bb('0x1f')](_0x2d561b,_0x566cf0)[_0xd6bb('0x27')](function(_0x3e9dd2){if(_0x3e9dd2&&_0x3e9dd2[_0xd6bb('0x21')]){return _0x3e9dd2;}else{var _0x4414bd=_['cloneDeep'](_0x1d29e4);if(_0x33ca4c[_0xd6bb('0x33')]){var _0x1fc4fa={};_0x1fc4fa[_0x33ca4c[_0xd6bb('0x33')]]=_0x3f4448;_[_0xd6bb('0x37')](_0x4414bd['$or'],_0x1fc4fa);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x34'))['find'](_0x4414bd,_0x566cf0);}});}});case'contact':var _0x1e4891=_[_0xd6bb('0x2e')](_0x1d29e4);if(_0x33ca4c[_0xd6bb('0x2f')]){var _0x5d743a={};_0x5d743a[_0x33ca4c[_0xd6bb('0x2f')]]=_0x3f4448;_['merge'](_0x1e4891[_0xd6bb('0x30')],_0x5d743a);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x32'))[_0xd6bb('0x1f')](_0x1e4891,_0x566cf0)[_0xd6bb('0x20')]();case _0xd6bb('0x11'):var _0x2efabb=_[_0xd6bb('0x2e')](_0x1d29e4);if(_0x33ca4c[_0xd6bb('0x33')]){var _0x5d743a={};_0x5d743a[_0x33ca4c[_0xd6bb('0x33')]]=_0x3f4448;_[_0xd6bb('0x37')](_0x2efabb[_0xd6bb('0x30')],_0x5d743a);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x34'))['find'](_0x2efabb,_0x566cf0);case _0xd6bb('0x13'):var _0x342eea=_[_0xd6bb('0x2e')](_0x1d29e4);if(_0x33ca4c[_0xd6bb('0x36')]){var _0x5d743a={};_0x5d743a[_0x33ca4c[_0xd6bb('0x36')]]=_0x3f4448;_[_0xd6bb('0x37')](_0x342eea[_0xd6bb('0x30')],_0x5d743a);}return _0x16de12[_0xd6bb('0x31')](_0xd6bb('0x38'))['find'](_0x342eea,_0x566cf0);default:return null;}})[_0xd6bb('0x27')](function(_0x57c4c2){if(_0x57c4c2&&_0x57c4c2[_0xd6bb('0x21')]){var _0x5beadc=_[_0xd6bb('0x39')](_0x57c4c2);if(_0x5beadc){return BPromise['resolve']({'id':_0x5beadc['Id'],'name':_0x5beadc[_0xd6bb('0x25')],'phone':_0x5beadc[_0xd6bb('0x3a')],'endUserType':_0x5beadc[_0xd6bb('0x3b')][_0xd6bb('0x3c')][_0xd6bb('0x3d')]()});}}})[_0xd6bb('0x27')](function(_0x3b7239){if(_0x3b7239){logger[_0xd6bb('0x19')](_0xd6bb('0x3e'),_0x3b7239[_0xd6bb('0x10')],_0x3f4448);return BPromise[_0xd6bb('0x24')](_0x3b7239);}else{logger[_0xd6bb('0x19')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x3f4448);var _0x455ab1={'Phone':_0x3f4448};if(_0x33ca4c['moduleCreate']){if(_0x33ca4c[_0xd6bb('0x3f')]===_0xd6bb('0xf')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3f4448,_0x33ca4c[_0xd6bb('0x3f')]);_0x455ab1['LastName']=_0x39d521!==_0xd6bb('0x40')?_0x39d521:util[_0xd6bb('0x41')](_0xd6bb('0x42'),_0x3f4448);}else if(_0x33ca4c[_0xd6bb('0x3f')]==='lead'){logger['info'](_0xd6bb('0x43'),_0x3f4448,_0x33ca4c[_0xd6bb('0x3f')]);_0x455ab1['LastName']=_0x39d521!==_0xd6bb('0x40')?_0x39d521:util[_0xd6bb('0x41')](_0xd6bb('0x42'),_0x3f4448);_0x455ab1[_0xd6bb('0x44')]='No\x20Company';}else if(_0x33ca4c[_0xd6bb('0x3f')]==='account'){logger[_0xd6bb('0x19')](_0xd6bb('0x43'),_0x3f4448,_0x33ca4c[_0xd6bb('0x3f')]);_0x455ab1[_0xd6bb('0x25')]=_0x39d521!==''?_0x39d521:util[_0xd6bb('0x41')]('Caller\x20-\x20%s',_0x3f4448);}else{return null;}}return _0x16de12[_0xd6bb('0x31')](_[_0xd6bb('0x45')](_0x33ca4c['moduleCreate']))[_0xd6bb('0x1b')](_0x455ab1)['then'](function(_0x5d0c89){return BPromise['resolve']({'id':_0x5d0c89['id'],'endUserType':_0x33ca4c[_0xd6bb('0x3f')]});});}});}function getCustomFields(_0x54f33f,_0x5e76bb){var _0x1e321d={};if(_0x54f33f[_0xd6bb('0x21')]>0x0){_[_0xd6bb('0x46')](_0x54f33f,function(_0x37316e){if(_['includes']([_0xd6bb('0x47'),_0xd6bb('0x48')],_0x37316e[_0xd6bb('0x3c')])&&_0x37316e[_0xd6bb('0x49')]){_0x1e321d[_0x37316e[_0xd6bb('0x49')]]=_0x37316e['content'][_0xd6bb('0x4a')]();}else if(_0x37316e[_0xd6bb('0x3c')]===_0xd6bb('0x4b')&&_0x37316e[_0xd6bb('0x4c')]&&_0x37316e[_0xd6bb('0x49')]){_0x5e76bb[_0x37316e[_0xd6bb('0x4c')]]&&(_0x1e321d[_0x37316e[_0xd6bb('0x49')]]=_0x5e76bb[_0x37316e[_0xd6bb('0x4c')]][_0xd6bb('0x4a')]());}else if(_0x37316e['type']===_0xd6bb('0x4d')&&_0x37316e[_0xd6bb('0x4e')]&&_0x37316e[_0xd6bb('0x4e')][_0xd6bb('0x4f')]&&_0x37316e[_0xd6bb('0x49')]){_0x5e76bb[_0x37316e[_0xd6bb('0x4e')][_0xd6bb('0x4f')][_0xd6bb('0x3d')]()]&&(_0x1e321d[_0x37316e[_0xd6bb('0x49')]]=_0x5e76bb[_0x37316e['Variable'][_0xd6bb('0x4f')][_0xd6bb('0x3d')]()]['toString']());}});}return _0x1e321d;}function getConnection(_0x3c9f95){var _0x512369=_0x3c9f95[_0xd6bb('0x50')][_0xd6bb('0x51')](_0x3c9f95['securityToken']);var _0x3fb9c0=new jsforce[(_0xd6bb('0x52'))]({'oauth2':{'loginUrl':_0x3c9f95[_0xd6bb('0x53')]||_0xd6bb('0x54'),'clientId':_0x3c9f95['clientId'],'clientSecret':_0x3c9f95[_0xd6bb('0x55')]}});return _0x3fb9c0['login'](_0x3c9f95['username'],_0x512369)['then'](function(){logger[_0xd6bb('0x19')](_0xd6bb('0x56'));return _0x3fb9c0;});}exports[_0xd6bb('0x57')]=function(_0x28e215,_0x30e8f6,_0x265c35,_0x3e8454,_0x455a15,_0x20e726){var _0x1e605a,_0x94efc,_0x2ad79f,_0x299c59;_0x20e726['serverUrl']=intUtil[_0xd6bb('0x58')](_0x20e726['serverUrl']);_0x20e726[_0xd6bb('0x53')]=intUtil[_0xd6bb('0x58')](_0x20e726[_0xd6bb('0x53')]);if(_0x455a15&&_0x455a15[_0xd6bb('0x59')]){logger[_0xd6bb('0x19')]('[QUEUE]',_0xd6bb('0x5a'));_0x30e8f6[_0xd6bb('0x5b')]=util[_0xd6bb('0x41')](_0xd6bb('0x5c'),_0x20e726['serverUrl'],_0x30e8f6[_0xd6bb('0x5d')],md5(_0x30e8f6[_0xd6bb('0x5d')]));}else{_0x30e8f6[_0xd6bb('0x5b')]='';}return getConnection(_0x20e726)[_0xd6bb('0x27')](function(_0x4ab68f){_0x299c59=_0x4ab68f;return getUser(_0x20e726,_0x3e8454[_0xd6bb('0x5e')],_0x299c59);})[_0xd6bb('0x27')](function(_0x38fd10){_0x1e605a=_0x38fd10;return getEndUser(_0x20e726,_0x265c35,_0x30e8f6[_0xd6bb('0x5f')],_0x30e8f6[_0xd6bb('0x60')],_0x299c59);})[_0xd6bb('0x27')](function(_0x2d418e){_0x94efc=_0x2d418e;return getTicket(_0x20e726,_0x1e605a,_0x94efc,_0x265c35,_0x30e8f6,_0x265c35[_0xd6bb('0x61')],_0x299c59,_0xd6bb('0x57'));})['then'](function(_0x3bdc9a){_0x2ad79f=_0x3bdc9a;logger[_0xd6bb('0x19')](_0xd6bb('0x62'),_0x2ad79f['id']);logger['info'](_0xd6bb('0x63'),_0x2ad79f['id'],_0x3e8454[_0xd6bb('0x4f')],_0x20e726['type']);switch(_0x20e726[_0xd6bb('0x3c')]){case _0xd6bb('0x64'):emit(util[_0xd6bb('0x41')]('user:%s',_0x3e8454[_0xd6bb('0x4f')]),_0xd6bb('0x65'),{'recordId':_0x2ad79f['id']});break;case _0xd6bb('0x66'):emit(util[_0xd6bb('0x41')](_0xd6bb('0x67'),_0x3e8454[_0xd6bb('0x4f')]),'trigger:browser:url',{'uri':util[_0xd6bb('0x41')](_0xd6bb('0x68'),_0x299c59[_0xd6bb('0x69')],_0x2ad79f['id'])});break;default:logger['error'](_0xd6bb('0x6a'));}})[_0xd6bb('0x6b')](function(_0x4fdc1a){logger[_0xd6bb('0x6c')]('[QUEUE]',_0x4fdc1a);});};exports[_0xd6bb('0x6d')]=function(_0x55841d,_0x4a843b,_0xd9faed,_0x457a0c,_0xea4be,_0x2b482e,_0x2fc876){var _0x54efd3,_0x4a2983,_0x3ea5ce,_0x34658d;_0x2b482e['serverUrl']=intUtil[_0xd6bb('0x58')](_0x2b482e[_0xd6bb('0x6e')]);_0x2b482e[_0xd6bb('0x53')]=intUtil['stripTrailingSlash'](_0x2b482e['remoteUri']);if(_0x2fc876&&_0x2fc876[_0xd6bb('0x6f')]&&_0x2fc876[_0xd6bb('0x6f')]!==_0xd6bb('0x70')){logger['info'](_0xd6bb('0x71'),_0xd6bb('0x5a'));_0x4a843b[_0xd6bb('0x5b')]=util[_0xd6bb('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b482e[_0xd6bb('0x6e')],_0x4a843b['uniqueid'],md5(_0x4a843b['uniqueid']));}return getConnection(_0x2b482e)[_0xd6bb('0x27')](function(_0x37282c){_0x34658d=_0x37282c;return getUser(_0x2b482e,_0x457a0c['email'],_0x34658d);})[_0xd6bb('0x27')](function(_0x2ebfa1){_0x54efd3=_0x2ebfa1;return getEndUser(_0x2b482e,_0xd9faed,_0x4a843b[_0xd6bb('0x72')],_0x4a843b[_0xd6bb('0x73')],_0x34658d);})[_0xd6bb('0x27')](function(_0x46ef05){_0x4a2983=_0x46ef05;return getTicket(_0x2b482e,_0x54efd3,_0x4a2983,_0xd9faed,_0x4a843b,_0xd9faed[_0xd6bb('0x61')],_0x34658d,_0xd6bb('0x6d'));})[_0xd6bb('0x27')](function(_0x170d5b){_0x3ea5ce=_0x170d5b;logger[_0xd6bb('0x19')](_0xd6bb('0x74'),_0x3ea5ce['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3ea5ce['id'],_0x457a0c[_0xd6bb('0x4f')],_0x2b482e['type']);switch(_0x2b482e[_0xd6bb('0x3c')]){case'integrationTab':emit(util['format']('user:%s',_0x457a0c[_0xd6bb('0x4f')]),_0xd6bb('0x65'),{'recordId':_0x3ea5ce['id']});break;case _0xd6bb('0x66'):emit(util[_0xd6bb('0x41')](_0xd6bb('0x67'),_0x457a0c[_0xd6bb('0x4f')]),_0xd6bb('0x75'),{'uri':util[_0xd6bb('0x41')]('%s/%s/e',_0x34658d[_0xd6bb('0x69')],_0x3ea5ce['id'])});break;default:logger[_0xd6bb('0x6c')](_0xd6bb('0x71'),_0xd6bb('0x76'));}})[_0xd6bb('0x6b')](function(_0x5159f0){logger[_0xd6bb('0x6c')]('[OUTBOUND]',_0x5159f0);});};exports[_0xd6bb('0x77')]=function(_0x271aab,_0x2295fc,_0x4252c0,_0x3e4763,_0x134cfb,_0x1f412d){var _0x273c4a,_0x2d469d,_0x53c13f,_0x316932;_0x1f412d['serverUrl']=intUtil[_0xd6bb('0x58')](_0x1f412d[_0xd6bb('0x6e')]);_0x1f412d[_0xd6bb('0x53')]=intUtil['stripTrailingSlash'](_0x1f412d[_0xd6bb('0x53')]);if(_0x134cfb&&_0x134cfb[_0xd6bb('0x59')]){logger[_0xd6bb('0x19')]('['+_0x2295fc['lastevent'][_0xd6bb('0x78')]()+']',_0xd6bb('0x5a'));_0x2295fc['recordingURL']=util[_0xd6bb('0x41')](_0xd6bb('0x5c'),_0x1f412d[_0xd6bb('0x6e')],_0x2295fc[_0xd6bb('0x5d')],md5(_0x2295fc[_0xd6bb('0x5d')]));}else{_0x2295fc[_0xd6bb('0x5b')]='';}return getConnection(_0x1f412d)[_0xd6bb('0x27')](function(_0x596cf7){_0x316932=_0x596cf7;if(!_[_0xd6bb('0x1c')](_0x3e4763)){return getUser(_0x1f412d,_0x3e4763[_0xd6bb('0x4f')],_0x316932);}else{return getUser(_0x1f412d,null,_0x316932);}})[_0xd6bb('0x27')](function(_0x31b08e){_0x273c4a=_0x31b08e;return getEndUser(_0x1f412d,_0x4252c0,_0x2295fc['calleridname'],_0x2295fc[_0xd6bb('0x60')],_0x316932);})['then'](function(_0x1bc871){_0x2d469d=_0x1bc871;return getTicket(_0x1f412d,_0x273c4a,_0x2d469d,_0x4252c0,_0x2295fc,_0x4252c0['Fields'],_0x316932);})[_0xd6bb('0x27')](function(_0xe97f7c){_0x53c13f=_0xe97f7c;logger['info']('['+_0x2295fc[_0xd6bb('0x79')][_0xd6bb('0x78')]()+_0xd6bb('0x7a'),_0x53c13f['id']);logger[_0xd6bb('0x19')]('['+_0x2295fc[_0xd6bb('0x79')][_0xd6bb('0x78')]()+_0xd6bb('0x7b'),_0x1f412d[_0xd6bb('0x3c')]);})[_0xd6bb('0x6b')](function(_0x464333){logger[_0xd6bb('0x6c')]('['+_0x2295fc[_0xd6bb('0x79')][_0xd6bb('0x78')]()+']',_0x464333);});}; \ 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 00c4fb8..e8752b2 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 _0x6210=['callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','length','result','info','toUpperCase','message','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm','catch','error',']\x20using\x20admin\x20profile','adminId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','toLowerCase','content','toString','string','idField','customField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum'];(function(_0x2b3756,_0xddc972){var _0x2aef4d=function(_0x282093){while(--_0x282093){_0x2b3756['push'](_0x2b3756['shift']());}};_0x2aef4d(++_0xddc972);}(_0x6210,0x1ce));var _0x0621=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x6210[_0x44946b];return _0x249bc4;};'use strict';var _=require('lodash');var Promise=require(_0x0621('0x0'));var rp=require(_0x0621('0x1'));var util=require(_0x0621('0x2'));var md5=require(_0x0621('0x3'));var Redis=require(_0x0621('0x4'));var intUtil=require('./util');var config=require(_0x0621('0x5'));var logger=require(_0x0621('0x6'))(_0x0621('0x7'));config[_0x0621('0x8')]=_[_0x0621('0x9')](config['redis'],{'host':_0x0621('0xa'),'port':0x18eb});var io=require(_0x0621('0xb'))(new Redis(config[_0x0621('0x8')]));function getAdminUser(_0x7de173,_0x48ac05,_0x3a1dbb,_0x472069,_0x11ed7d,_0x48da2e){return new Promise(function(_0x55d6f5,_0x27fd33){var _0x1513d8={'method':'GET','uri':_0x472069+_0x0621('0xc')+'&'+_0x11ed7d+'&'+_0x48da2e,'auth':_0x48ac05,'json':!![]};return rp(_0x1513d8)['then'](function(_0x4cd079){if(_0x4cd079['result'][_0x0621('0xd')]>0x0){_0x3a1dbb['adminId']=_0x4cd079[_0x0621('0xe')][0x0]['sys_id'];}logger[_0x0621('0xf')]('['+[_0x7de173[_0x0621('0x10')]()]+'],\x20getAdminUser\x20crm',_0x3a1dbb);_0x55d6f5(_0x3a1dbb);})['catch'](function(_0xf64381){logger['error']('['+[_0x7de173[_0x0621('0x10')]()]+']',_0xf64381[_0x0621('0x11')]);_0x27fd33(_0xf64381['message']);});});}function getUser(_0x10becf,_0xacdb35,_0x3678fb,_0x37c3d9,_0x3dade0){return function(_0x2ac315){logger[_0x0621('0xf')]('['+[_0x10becf[_0x0621('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x2ac315);return new Promise(function(_0x1f49dc,_0x1b9948){if(intUtil[_0x0621('0x12')](_0x2ac315[_0x0621('0x13')])){var _0x46b47f={'method':_0x0621('0x14'),'uri':_0x3678fb+_0x0621('0x15')+_0x2ac315[_0x0621('0x13')]+'&'+_0x37c3d9+'&'+_0x3dade0,'auth':_0xacdb35,'json':!![]};logger[_0x0621('0xf')]('['+[_0x10becf[_0x0621('0x10')]()]+_0x0621('0x16'),_0x46b47f);return rp(_0x46b47f)[_0x0621('0x17')](function(_0x574ff1){logger['info']('['+[_0x10becf[_0x0621('0x10')]()]+_0x0621('0x18'),_0x574ff1);if(_0x574ff1[_0x0621('0xe')][_0x0621('0xd')]>0x0&&String(_0x574ff1[_0x0621('0xe')][0x0][_0x0621('0x19')])===_0x0621('0x1a')){_0x2ac315[_0x0621('0x1b')]=_0x574ff1[_0x0621('0xe')][0x0][_0x0621('0x1c')];}else{_0x2ac315[_0x0621('0x1b')]=_0x2ac315['adminId'];_0x2ac315[_0x0621('0x13')]=_0x2ac315[_0x0621('0x1d')];}logger[_0x0621('0xf')]('['+[_0x10becf[_0x0621('0x10')]()]+_0x0621('0x1e'),_0x2ac315);_0x1f49dc(_0x2ac315);})[_0x0621('0x1f')](function(_0x3c24ed){logger[_0x0621('0x20')]('['+[_0x10becf[_0x0621('0x10')]()]+']',_0x3c24ed[_0x0621('0x11')]);_0x1b9948(_0x3c24ed[_0x0621('0x11')]);});}else{logger[_0x0621('0xf')]('['+[_0x10becf[_0x0621('0x10')]()]+_0x0621('0x21'));_0x2ac315[_0x0621('0x1b')]=_0x2ac315[_0x0621('0x22')];_0x2ac315['userEmail']=_0x2ac315[_0x0621('0x1d')];_0x1f49dc(_0x2ac315);}});};}function createEndUser(_0x6eb401,_0x40dd34,_0x471a62,_0x33a63a,_0x5d06fe){logger['info']('['+[_0x6eb401['toUpperCase']()]+_0x0621('0x23'),_0x471a62);return new Promise(function(_0x3f7a51,_0x222bfe){var _0x26b83f={'method':_0x0621('0x24'),'uri':_0x33a63a+_0x0621('0x25')+_0x5d06fe,'body':{'user_name':_0x471a62['endUserNumber'],'roles':_0x0621('0x26'),'first_name':_0x471a62[_0x0621('0x27')],'active':_0x0621('0x1a'),'date_format':_0x0621('0x28'),'phone':_0x471a62[_0x0621('0x27')]},'auth':_0x40dd34,'json':!![]};return rp(_0x26b83f)[_0x0621('0x17')](function(_0x1f02d4){logger[_0x0621('0xf')]('['+[_0x6eb401['toUpperCase']()]+_0x0621('0x29'),_0x1f02d4[_0x0621('0xe')]);_0x471a62[_0x0621('0x2a')]=_0x1f02d4['result'][_0x0621('0x1c')];_0x3f7a51(_0x471a62);})[_0x0621('0x1f')](function(_0x1c7e48){logger['error']('['+[_0x6eb401[_0x0621('0x10')]()]+']',_0x1c7e48['message']);_0x222bfe(_0x1c7e48[_0x0621('0x11')]);});});}function getEndUser(_0x3e78ec,_0xc6cf46,_0x33a06f,_0x1ddb7e,_0x5a9d70){return function(_0x373315){logger[_0x0621('0xf')]('['+[_0x3e78ec[_0x0621('0x10')]()]+_0x0621('0x2b'),_0x373315);return new Promise(function(_0x391498,_0x4e67fe){var _0x3be0ec={'method':_0x0621('0x14'),'uri':_0x33a06f+'sys_user?sysparm_query=phone%3D'+_0x373315[_0x0621('0x27')]+'&'+_0x1ddb7e+'&'+_0x5a9d70,'auth':_0xc6cf46,'json':!![]};return rp(_0x3be0ec)['then'](function(_0x460782){if(_0x460782[_0x0621('0xe')]['length']>0x0){_0x373315[_0x0621('0x2a')]=_0x460782[_0x0621('0xe')][0x0][_0x0621('0x1c')];logger['info']('['+[_0x3e78ec[_0x0621('0x10')]()]+'],\x20getEndUser\x20crm',_0x373315);_0x391498(_0x373315);}else{return createEndUser(_0x3e78ec,_0xc6cf46,_0x373315,_0x33a06f,_0x1ddb7e)[_0x0621('0x17')](function(_0x3289b2){logger[_0x0621('0xf')]('['+[_0x3e78ec[_0x0621('0x10')]()]+_0x0621('0x2c'),_0x3289b2);_0x391498(_0x3289b2);});}})['catch'](function(_0x1d521d){logger['error']('['+[_0x3e78ec[_0x0621('0x10')]()]+']',_0x1d521d[_0x0621('0x11')]);_0x4e67fe(_0x1d521d[_0x0621('0x11')]);});});};}function getCustomFields(_0x19edaa,_0x2edf95){var _0x4bfeb5={};if(_0x19edaa[_0x0621('0xd')]>0x0){_[_0x0621('0x2d')](_0x19edaa,function(_0x4739ac){if(_[_0x0621('0x2e')](['string',_0x0621('0x2f')],_0x4739ac[_0x0621('0x30')])&&_0x4739ac[_0x0621('0x31')]&&!_0x4739ac['customField']){_0x4bfeb5[_0x4739ac[_0x0621('0x31')][_0x0621('0x32')]()]=_0x4739ac[_0x0621('0x33')][_0x0621('0x34')]();}else if(_['includes']([_0x0621('0x35'),'picklist'],_0x4739ac['type'])&&_0x4739ac[_0x0621('0x36')]&&_0x4739ac[_0x0621('0x37')]){_0x4bfeb5[_0x4739ac[_0x0621('0x36')][_0x0621('0x32')]()]=_0x4739ac[_0x0621('0x33')][_0x0621('0x34')]();}else if(_0x4739ac['type']==='variable'&&_0x4739ac[_0x0621('0x38')]&&_0x4739ac[_0x0621('0x36')]&&_0x4739ac[_0x0621('0x37')]){_0x4bfeb5[_0x4739ac[_0x0621('0x36')][_0x0621('0x32')]()]=_0x2edf95[_0x4739ac[_0x0621('0x38')]][_0x0621('0x34')]();}else if(_0x4739ac['type']===_0x0621('0x39')&&_0x4739ac[_0x0621('0x3a')]&&_0x4739ac['Variable'][_0x0621('0x3b')]&&_0x4739ac[_0x0621('0x36')]&&_0x4739ac[_0x0621('0x37')]){_0x4bfeb5[_0x4739ac[_0x0621('0x36')]['toLowerCase']()]=_0x2edf95[_0x4739ac[_0x0621('0x3a')]['name'][_0x0621('0x32')]()]['toString']();}});}return _0x4bfeb5;}function getTicket(_0x1895aa,_0x1eb346,_0x13985e,_0x80af3f,_0x314492,_0x34545b){return function(_0x4687f9){logger['info']('['+[_0x1895aa[_0x0621('0x10')]()]+_0x0621('0x3c'),_0x4687f9);return new Promise(function(_0x14a322,_0x15c91a){var _0xffbf2b=_0x1895aa[_0x0621('0x32')]()===_0x0621('0x3d')?_0x4687f9[_0x0621('0x1b')]:_0x4687f9['endUserId'];var _0x28825d={'method':_0x0621('0x24'),'uri':_0x13985e+_0x0621('0x3e')+'?'+_0x34545b,'body':Object['assign']({},{'active':_0x0621('0x1a'),'caller_id':_0xffbf2b,'assigned_to':_0x4687f9[_0x0621('0x1b')],'short_description':intUtil[_0x0621('0x3f')](_0x80af3f['Subjects'],_0x314492,'\x20'),'description':intUtil[_0x0621('0x3f')](_0x80af3f['Descriptions'],_0x314492,'\x0a')},getCustomFields(_0x80af3f[_0x0621('0x40')],_0x314492)),'auth':_0x1eb346,'json':!![]};return rp(_0x28825d)['then'](function(_0x309d91){logger[_0x0621('0xf')]('['+[_0x1895aa['toUpperCase']()]+_0x0621('0x41'),_0x309d91[_0x0621('0xe')]);_0x4687f9[_0x0621('0x42')]=_0x309d91['result'][_0x0621('0x1c')];_0x4687f9[_0x0621('0x43')]=_0x309d91[_0x0621('0xe')][_0x0621('0x44')];logger[_0x0621('0xf')]('['+[_0x1895aa['toUpperCase']()]+_0x0621('0x45'),_0x4687f9);_0x14a322(_0x4687f9);})['catch'](function(_0x1ef625){logger[_0x0621('0x20')]('['+[_0x1895aa['toUpperCase']()]+']',_0x1ef625[_0x0621('0x11')]);_0x15c91a(_0x1ef625['message']);});});};}function createRemoteTag(_0xcfa51f,_0x1e105e,_0x46b5b5,_0x5461aa){return new Promise(function(_0x300adc,_0x2c00bb){var _0x1b6480={'method':_0x0621('0x24'),'uri':_0x46b5b5+'label'+'?'+_0x5461aa,'body':{'short_description':_0xcfa51f,'global':!![],'active':!![],'name':_0xcfa51f},'auth':_0x1e105e,'json':!![]};return rp(_0x1b6480)[_0x0621('0x17')](function(_0xb2e28f){var _0x49123b=_0xb2e28f['result'][_0x0621('0x1c')];_0x300adc(_0x49123b);});});}function getRemoteTag(_0x2280e6,_0x5c4739,_0x34d214,_0x5d7cce,_0x5d6505){return new Promise(function(_0x40679c,_0x108d51){var _0x504bb2={'method':_0x0621('0x14'),'uri':_0x34d214+'label'+_0x0621('0x46')+_0x2280e6+'&'+_0x5d7cce,'auth':_0x5c4739,'json':!![]};return rp(_0x504bb2)[_0x0621('0x17')](function(_0x1877fd){if(_0x1877fd[_0x0621('0xe')][_0x0621('0xd')]>0x0){var _0x4363aa=_0x1877fd[_0x0621('0xe')][0x0][_0x0621('0x1c')];_0x40679c(_0x4363aa);}else{return createRemoteTag(_0x2280e6,_0x5c4739,_0x34d214,_0x5d7cce)[_0x0621('0x17')](function(_0x35bc19){_0x40679c(_0x35bc19);});}});});}function assignTagToIncident(_0x494807,_0x58f5c9,_0xcd611d,_0x1ebde4,_0xc75f40){return new Promise(function(_0x21e362,_0x2c3c9a){var _0x3a1683={'method':'POST','uri':_0xcd611d+_0x0621('0x47')+'?'+_0xc75f40,'body':{'label':_0x494807,'table':_0x0621('0x3e'),'id_type':_0x0621('0x48'),'table_key':_0x1ebde4[_0x0621('0x42')],'title':_0x0621('0x49')+_0x1ebde4['ticketNumber'],'id_display':_0x1ebde4[_0x0621('0x43')]},'auth':_0x58f5c9,'json':!![]};return rp(_0x3a1683)[_0x0621('0x17')](function(_0x3344c3){_0x21e362();})[_0x0621('0x1f')](function(){_0x21e362();});});}function manageTags(_0x715a3d,_0x35105c,_0x22c9b1,_0x2140a0,_0xdfaefc,_0x5372af,_0x2689d0){return new Promise(function(_0x5a2e3a,_0x811f0e){var _0x299324=[];_0x35105c[_0x0621('0x2d')](function(_0x1d1147){_0x299324['push'](getRemoteTag(_0x1d1147,_0x22c9b1,_0x2140a0,_0x5372af,_0x2689d0));});return Promise[_0x0621('0x4a')](_0x299324)[_0x0621('0x17')](function(_0x4a33a7){if(_0x4a33a7[_0x0621('0xd')]){logger[_0x0621('0xf')]('['+[_0x715a3d['toUpperCase']()]+_0x0621('0x4b'),_0x4a33a7);var _0x4605ea=[];_0x4a33a7[_0x0621('0x2d')](function(_0x108f6e){_0x4605ea[_0x0621('0x4c')](assignTagToIncident(_0x108f6e,_0x22c9b1,_0x2140a0,_0xdfaefc,_0x5372af));});return Promise[_0x0621('0x4a')](_0x4605ea)['then'](function(){_0x5a2e3a();})[_0x0621('0x1f')](function(){_0x5a2e3a();});}else{_0x5a2e3a();}});});}function getTags(_0x964f4a,_0xa873d0,_0x26a8a9,_0x477706,_0x18446d,_0x3f293c){return function(_0x37c443){return new Promise(function(_0x4350a1,_0xda8aa5){var _0x3e6258=[];var _0x47525c=_0x477706[_0x0621('0x4d')];if(_0x47525c&&_0x47525c[_0x0621('0xd')]>0x0){_0x3e6258=_[_0x0621('0x4e')](_0x47525c,_0x0621('0x3b'));}if(_0x3e6258[_0x0621('0xd')]>0x0){return manageTags(_0x964f4a,_0x3e6258,_0xa873d0,_0x26a8a9,_0x37c443,_0x18446d,_0x3f293c)[_0x0621('0x17')](function(){_0x4350a1(_0x37c443);});}else{_0x4350a1(_0x37c443);}});};}function emit(_0x56a27b,_0x4ccef1,_0x4ddcaf){var _0x197544=_0x0621('0x4f')+_0x0621('0x50')+_0x0621('0x51')+_0x0621('0x52');var _0x532122={'uri':_0x56a27b+_0x0621('0x53')+_0x4ddcaf+_0x197544};io['to'](util['format'](_0x0621('0x54'),_0x4ccef1))['emit'](_0x0621('0x55'),_0x532122);}exports['cs']=function(_0xd2099b,_0x1062fc,_0x4e64d7,_0x5cf2ba,_0x3e5a2a,_0x41a054,_0x2dcab6,_0x4ef276){var _0x13e809={};var _0x43699a={'user':_0x41a054[_0x0621('0x56')],'pass':_0x41a054[_0x0621('0x57')]};var _0x1a01ab=_0x0621('0x58');var _0x44b06f=_0x0621('0x59');_0x41a054[_0x0621('0x5a')]=intUtil[_0x0621('0x5b')](_0x41a054[_0x0621('0x5a')]);_0x41a054[_0x0621('0x5c')]=intUtil[_0x0621('0x5b')](_0x41a054[_0x0621('0x5c')]);var _0x2b3bce=util[_0x0621('0x5d')](_0x0621('0x5e'),_0x41a054['remoteUri']);_0x13e809[_0x0621('0x13')]=!_['isNil'](_0x5cf2ba)?_0x5cf2ba[_0x0621('0x5f')]:null;_0x13e809[_0x0621('0x1d')]=_0x41a054[_0x0621('0x5f')];_0x13e809['endUserNumber']=_0x4ef276[_0x0621('0x32')]()===_0x0621('0x3d')?_0x1062fc[_0x0621('0x60')]:_0x1062fc[_0x0621('0x61')];_0x13e809[_0x0621('0x62')]=_0x4ef276==='queue'||_0x4ef276===_0x0621('0x63')?'queue':_0x0621('0x3d');var _0x544b71=util[_0x0621('0x5d')](_0x0621('0x64'),_0x41a054[_0x0621('0x5c')],_0x1062fc[_0x0621('0x65')],md5(_0x1062fc['uniqueid']));if(_0x3e5a2a&&_0x3e5a2a[_0x0621('0x66')]){logger[_0x0621('0xf')](_0x0621('0x67'),_0x0621('0x68'));_0x1062fc[_0x0621('0x69')]=_0x544b71;}else if(_0x2dcab6&&_0x2dcab6['recordingFormat']&&_0x2dcab6['recordingFormat']!==_0x0621('0x6a')){logger[_0x0621('0xf')](_0x0621('0x6b'),_0x0621('0x68'));_0x1062fc[_0x0621('0x69')]=_0x544b71;}else{_0x1062fc[_0x0621('0x69')]='';}return getAdminUser(_0x4ef276,_0x43699a,_0x13e809,_0x2b3bce,_0x44b06f,_0x1a01ab)['then'](getUser(_0x4ef276,_0x43699a,_0x2b3bce,_0x44b06f,_0x1a01ab))[_0x0621('0x17')](getEndUser(_0x4ef276,_0x43699a,_0x2b3bce,_0x44b06f,_0x1a01ab))[_0x0621('0x17')](getTicket(_0x4ef276,_0x43699a,_0x2b3bce,_0x4e64d7,_0x1062fc,_0x44b06f))['then'](function(_0x207846){logger[_0x0621('0xf')](util['format'](_0x0621('0x6c'),_0x207846[_0x0621('0x42')]));logger['info'](util[_0x0621('0x5d')](_0x0621('0x6d'),_0x4ef276));if(_0x4ef276!==_0x0621('0x63')){logger['info']('['+[_0x4ef276['toUpperCase']()]+']',_0x0621('0x6e'));emit(_0x41a054[_0x0621('0x5a')],_0x5cf2ba['name'],_0x207846[_0x0621('0x42')]);}})[_0x0621('0x1f')](function(_0x5072f5){logger[_0x0621('0x20')]('['+[_0x4ef276[_0x0621('0x10')]()]+_0x0621('0x6f'),util['inspect'](_0x5072f5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2b99=['result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','],\x20createEndUser\x20crm','includes','picklist','nameField','customField','toLowerCase','toString','string','type','idField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','./util','../../../../config/environment','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then'];(function(_0x15413d,_0x3fda1f){var _0x52536f=function(_0x42a975){while(--_0x42a975){_0x15413d['push'](_0x15413d['shift']());}};_0x52536f(++_0x3fda1f);}(_0x2b99,0x1b3));var _0x92b9=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x2b99[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x92b9('0x0'));var Promise=require(_0x92b9('0x1'));var rp=require(_0x92b9('0x2'));var util=require('util');var md5=require(_0x92b9('0x3'));var Redis=require('ioredis');var intUtil=require(_0x92b9('0x4'));var config=require(_0x92b9('0x5'));var logger=require('../../../../config/logger')(_0x92b9('0x6'));config[_0x92b9('0x7')]=_['defaults'](config[_0x92b9('0x7')],{'host':_0x92b9('0x8'),'port':0x18eb});var io=require(_0x92b9('0x9'))(new Redis(config[_0x92b9('0x7')]));function getAdminUser(_0x4267b2,_0x927fc0,_0x53e1a5,_0x2acdb9,_0x1adb15,_0x31f8bb){return new Promise(function(_0x285e96,_0x57a8a0){var _0x148d7b={'method':_0x92b9('0xa'),'uri':_0x2acdb9+_0x92b9('0xb')+'&'+_0x1adb15+'&'+_0x31f8bb,'auth':_0x927fc0,'json':!![]};return rp(_0x148d7b)[_0x92b9('0xc')](function(_0x3589bd){if(_0x3589bd[_0x92b9('0xd')][_0x92b9('0xe')]>0x0){_0x53e1a5[_0x92b9('0xf')]=_0x3589bd[_0x92b9('0xd')][0x0][_0x92b9('0x10')];}logger[_0x92b9('0x11')]('['+[_0x4267b2[_0x92b9('0x12')]()]+_0x92b9('0x13'),_0x53e1a5);_0x285e96(_0x53e1a5);})[_0x92b9('0x14')](function(_0x23ae57){logger['error']('['+[_0x4267b2[_0x92b9('0x12')]()]+']',_0x23ae57[_0x92b9('0x15')]);_0x57a8a0(_0x23ae57['message']);});});}function getUser(_0x5d9e54,_0x203c78,_0x27ca99,_0x30e156,_0x3ee0e8){return function(_0x7932e3){logger[_0x92b9('0x11')]('['+[_0x5d9e54['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x7932e3);return new Promise(function(_0x2b98ef,_0x109900){if(intUtil[_0x92b9('0x16')](_0x7932e3[_0x92b9('0x17')])){var _0x10cedd={'method':_0x92b9('0xa'),'uri':_0x27ca99+'sys_user?sysparm_query=email%3D'+_0x7932e3['userEmail']+'&'+_0x30e156+'&'+_0x3ee0e8,'auth':_0x203c78,'json':!![]};logger[_0x92b9('0x11')]('['+[_0x5d9e54['toUpperCase']()]+_0x92b9('0x18'),_0x10cedd);return rp(_0x10cedd)['then'](function(_0x5cdf41){logger[_0x92b9('0x11')]('['+[_0x5d9e54[_0x92b9('0x12')]()]+_0x92b9('0x19'),_0x5cdf41);if(_0x5cdf41['result'][_0x92b9('0xe')]>0x0&&String(_0x5cdf41[_0x92b9('0xd')][0x0][_0x92b9('0x1a')])===_0x92b9('0x1b')){_0x7932e3[_0x92b9('0x1c')]=_0x5cdf41['result'][0x0][_0x92b9('0x10')];}else{_0x7932e3['userId']=_0x7932e3[_0x92b9('0xf')];_0x7932e3['userEmail']=_0x7932e3['adminEmail'];}logger[_0x92b9('0x11')]('['+[_0x5d9e54[_0x92b9('0x12')]()]+_0x92b9('0x1d'),_0x7932e3);_0x2b98ef(_0x7932e3);})['catch'](function(_0x754d07){logger['error']('['+[_0x5d9e54[_0x92b9('0x12')]()]+']',_0x754d07[_0x92b9('0x15')]);_0x109900(_0x754d07[_0x92b9('0x15')]);});}else{logger[_0x92b9('0x11')]('['+[_0x5d9e54[_0x92b9('0x12')]()]+_0x92b9('0x1e'));_0x7932e3['userId']=_0x7932e3[_0x92b9('0xf')];_0x7932e3[_0x92b9('0x17')]=_0x7932e3[_0x92b9('0x1f')];_0x2b98ef(_0x7932e3);}});};}function createEndUser(_0x10085b,_0x598494,_0x2744a0,_0x6964a9,_0x57b118){logger[_0x92b9('0x11')]('['+[_0x10085b[_0x92b9('0x12')]()]+_0x92b9('0x20'),_0x2744a0);return new Promise(function(_0x378429,_0x4ab50b){var _0x1911ea={'method':_0x92b9('0x21'),'uri':_0x6964a9+'sys_user?'+_0x57b118,'body':{'user_name':_0x2744a0[_0x92b9('0x22')],'roles':_0x92b9('0x23'),'first_name':_0x2744a0[_0x92b9('0x22')],'active':_0x92b9('0x1b'),'date_format':_0x92b9('0x24'),'phone':_0x2744a0[_0x92b9('0x22')]},'auth':_0x598494,'json':!![]};return rp(_0x1911ea)[_0x92b9('0xc')](function(_0x45603b){logger['info']('['+[_0x10085b[_0x92b9('0x12')]()]+_0x92b9('0x25'),_0x45603b[_0x92b9('0xd')]);_0x2744a0[_0x92b9('0x26')]=_0x45603b[_0x92b9('0xd')][_0x92b9('0x10')];_0x378429(_0x2744a0);})[_0x92b9('0x14')](function(_0x458c4b){logger[_0x92b9('0x27')]('['+[_0x10085b[_0x92b9('0x12')]()]+']',_0x458c4b[_0x92b9('0x15')]);_0x4ab50b(_0x458c4b[_0x92b9('0x15')]);});});}function getEndUser(_0x1f9652,_0x506a84,_0x1868de,_0x2eb821,_0x3e2411){return function(_0x54d05c){logger['info']('['+[_0x1f9652[_0x92b9('0x12')]()]+_0x92b9('0x28'),_0x54d05c);return new Promise(function(_0x5eac33,_0x1f55ae){var _0x393ca6={'method':_0x92b9('0xa'),'uri':_0x1868de+'sys_user?sysparm_query=phone%3D'+_0x54d05c[_0x92b9('0x22')]+'&'+_0x2eb821+'&'+_0x3e2411,'auth':_0x506a84,'json':!![]};return rp(_0x393ca6)[_0x92b9('0xc')](function(_0x407a31){if(_0x407a31[_0x92b9('0xd')][_0x92b9('0xe')]>0x0){_0x54d05c['endUserId']=_0x407a31[_0x92b9('0xd')][0x0][_0x92b9('0x10')];logger[_0x92b9('0x11')]('['+[_0x1f9652[_0x92b9('0x12')]()]+'],\x20getEndUser\x20crm',_0x54d05c);_0x5eac33(_0x54d05c);}else{return createEndUser(_0x1f9652,_0x506a84,_0x54d05c,_0x1868de,_0x2eb821)[_0x92b9('0xc')](function(_0x46e015){logger['info']('['+[_0x1f9652['toUpperCase']()]+_0x92b9('0x29'),_0x46e015);_0x5eac33(_0x46e015);});}})[_0x92b9('0x14')](function(_0x50de0f){logger[_0x92b9('0x27')]('['+[_0x1f9652[_0x92b9('0x12')]()]+']',_0x50de0f[_0x92b9('0x15')]);_0x1f55ae(_0x50de0f[_0x92b9('0x15')]);});});};}function getCustomFields(_0x3b3cfe,_0x4f2b53){var _0x16faa0={};if(_0x3b3cfe[_0x92b9('0xe')]>0x0){_['forEach'](_0x3b3cfe,function(_0x5c7555){if(_[_0x92b9('0x2a')](['string',_0x92b9('0x2b')],_0x5c7555['type'])&&_0x5c7555[_0x92b9('0x2c')]&&!_0x5c7555[_0x92b9('0x2d')]){_0x16faa0[_0x5c7555[_0x92b9('0x2c')][_0x92b9('0x2e')]()]=_0x5c7555['content'][_0x92b9('0x2f')]();}else if(_[_0x92b9('0x2a')]([_0x92b9('0x30'),_0x92b9('0x2b')],_0x5c7555[_0x92b9('0x31')])&&_0x5c7555[_0x92b9('0x32')]&&_0x5c7555[_0x92b9('0x2d')]){_0x16faa0[_0x5c7555[_0x92b9('0x32')]['toLowerCase']()]=_0x5c7555[_0x92b9('0x33')]['toString']();}else if(_0x5c7555[_0x92b9('0x31')]===_0x92b9('0x34')&&_0x5c7555[_0x92b9('0x35')]&&_0x5c7555[_0x92b9('0x32')]&&_0x5c7555['customField']){_0x16faa0[_0x5c7555[_0x92b9('0x32')][_0x92b9('0x2e')]()]=_0x4f2b53[_0x5c7555['variableName']][_0x92b9('0x2f')]();}else if(_0x5c7555[_0x92b9('0x31')]===_0x92b9('0x36')&&_0x5c7555[_0x92b9('0x37')]&&_0x5c7555[_0x92b9('0x37')][_0x92b9('0x38')]&&_0x5c7555[_0x92b9('0x32')]&&_0x5c7555[_0x92b9('0x2d')]){_0x16faa0[_0x5c7555[_0x92b9('0x32')][_0x92b9('0x2e')]()]=_0x4f2b53[_0x5c7555[_0x92b9('0x37')][_0x92b9('0x38')][_0x92b9('0x2e')]()]['toString']();}});}return _0x16faa0;}function getTicket(_0x55cc76,_0x268875,_0x44560e,_0x50eb97,_0x425ff0,_0x120b31){return function(_0x817e2d){logger[_0x92b9('0x11')]('['+[_0x55cc76['toUpperCase']()]+_0x92b9('0x39'),_0x817e2d);return new Promise(function(_0x32bdf6,_0x2668b8){var _0x311393=_0x55cc76[_0x92b9('0x2e')]()===_0x92b9('0x3a')?_0x817e2d[_0x92b9('0x1c')]:_0x817e2d[_0x92b9('0x26')];var _0x1aab39={'method':_0x92b9('0x21'),'uri':_0x44560e+_0x92b9('0x3b')+'?'+_0x120b31,'body':Object[_0x92b9('0x3c')]({},{'active':_0x92b9('0x1b'),'caller_id':_0x311393,'assigned_to':_0x817e2d[_0x92b9('0x1c')],'short_description':intUtil[_0x92b9('0x3d')](_0x50eb97['Subjects'],_0x425ff0,'\x20'),'description':intUtil['getString'](_0x50eb97[_0x92b9('0x3e')],_0x425ff0,'\x0a')},getCustomFields(_0x50eb97['Fields'],_0x425ff0)),'auth':_0x268875,'json':!![]};return rp(_0x1aab39)[_0x92b9('0xc')](function(_0x328e99){logger[_0x92b9('0x11')]('['+[_0x55cc76['toUpperCase']()]+_0x92b9('0x3f'),_0x328e99['result']);_0x817e2d[_0x92b9('0x40')]=_0x328e99[_0x92b9('0xd')][_0x92b9('0x10')];_0x817e2d[_0x92b9('0x41')]=_0x328e99[_0x92b9('0xd')][_0x92b9('0x42')];logger['info']('['+[_0x55cc76[_0x92b9('0x12')]()]+_0x92b9('0x43'),_0x817e2d);_0x32bdf6(_0x817e2d);})[_0x92b9('0x14')](function(_0x566509){logger[_0x92b9('0x27')]('['+[_0x55cc76[_0x92b9('0x12')]()]+']',_0x566509[_0x92b9('0x15')]);_0x2668b8(_0x566509[_0x92b9('0x15')]);});});};}function createRemoteTag(_0x150939,_0x37a1a5,_0x20612c,_0x303e96){return new Promise(function(_0x9f04b7,_0x1e80ea){var _0x4851f5={'method':_0x92b9('0x21'),'uri':_0x20612c+_0x92b9('0x44')+'?'+_0x303e96,'body':{'short_description':_0x150939,'global':!![],'active':!![],'name':_0x150939},'auth':_0x37a1a5,'json':!![]};return rp(_0x4851f5)[_0x92b9('0xc')](function(_0xec16f6){var _0x25e252=_0xec16f6[_0x92b9('0xd')][_0x92b9('0x10')];_0x9f04b7(_0x25e252);});});}function getRemoteTag(_0x6a3e6c,_0x5b87c8,_0x451676,_0x4f231a,_0x1b4f74){return new Promise(function(_0x1288b7,_0x2d3e15){var _0x5aaa4a={'method':'GET','uri':_0x451676+_0x92b9('0x44')+_0x92b9('0x45')+_0x6a3e6c+'&'+_0x4f231a,'auth':_0x5b87c8,'json':!![]};return rp(_0x5aaa4a)[_0x92b9('0xc')](function(_0x41187c){if(_0x41187c[_0x92b9('0xd')][_0x92b9('0xe')]>0x0){var _0x2a41cd=_0x41187c['result'][0x0][_0x92b9('0x10')];_0x1288b7(_0x2a41cd);}else{return createRemoteTag(_0x6a3e6c,_0x5b87c8,_0x451676,_0x4f231a)['then'](function(_0x129630){_0x1288b7(_0x129630);});}});});}function assignTagToIncident(_0x40d968,_0x1d8b83,_0x79fa42,_0x6f5623,_0x33cab7){return new Promise(function(_0x5d2b7f,_0xb1108e){var _0x50e346={'method':_0x92b9('0x21'),'uri':_0x79fa42+_0x92b9('0x46')+'?'+_0x33cab7,'body':{'label':_0x40d968,'table':_0x92b9('0x3b'),'id_type':'Incident','table_key':_0x6f5623['ticketId'],'title':_0x92b9('0x47')+_0x6f5623[_0x92b9('0x41')],'id_display':_0x6f5623['ticketNumber']},'auth':_0x1d8b83,'json':!![]};return rp(_0x50e346)[_0x92b9('0xc')](function(_0xfbb459){_0x5d2b7f();})[_0x92b9('0x14')](function(){_0x5d2b7f();});});}function manageTags(_0x1544f6,_0x23d04d,_0x4ebde0,_0x3049a8,_0x5f0991,_0x4201d1,_0x23da28){return new Promise(function(_0x13f547,_0x2ee23b){var _0x3a5fca=[];_0x23d04d[_0x92b9('0x48')](function(_0x2ded81){_0x3a5fca[_0x92b9('0x49')](getRemoteTag(_0x2ded81,_0x4ebde0,_0x3049a8,_0x4201d1,_0x23da28));});return Promise['all'](_0x3a5fca)[_0x92b9('0xc')](function(_0x1ddbf5){if(_0x1ddbf5['length']){logger[_0x92b9('0x11')]('['+[_0x1544f6['toUpperCase']()]+_0x92b9('0x4a'),_0x1ddbf5);var _0x489a13=[];_0x1ddbf5['forEach'](function(_0x367b6d){_0x489a13['push'](assignTagToIncident(_0x367b6d,_0x4ebde0,_0x3049a8,_0x5f0991,_0x4201d1));});return Promise[_0x92b9('0x4b')](_0x489a13)[_0x92b9('0xc')](function(){_0x13f547();})['catch'](function(){_0x13f547();});}else{_0x13f547();}});});}function getTags(_0x4eb505,_0xd9bdc0,_0x2c54c6,_0x118057,_0x2b2da3,_0x21d6d9){return function(_0x5c4537){return new Promise(function(_0x1a12f1,_0x5af81d){var _0x14437f=[];var _0x473c51=_0x118057[_0x92b9('0x4c')];if(_0x473c51&&_0x473c51[_0x92b9('0xe')]>0x0){_0x14437f=_['map'](_0x473c51,_0x92b9('0x38'));}if(_0x14437f[_0x92b9('0xe')]>0x0){return manageTags(_0x4eb505,_0x14437f,_0xd9bdc0,_0x2c54c6,_0x5c4537,_0x2b2da3,_0x21d6d9)['then'](function(){_0x1a12f1(_0x5c4537);});}else{_0x1a12f1(_0x5c4537);}});};}function emit(_0x1a8ff4,_0x1c79af,_0x2608ee){var _0x287607=_0x92b9('0x4d')+_0x92b9('0x4e')+_0x92b9('0x4f')+_0x92b9('0x50');var _0x265638={'uri':_0x1a8ff4+_0x92b9('0x51')+_0x2608ee+_0x287607};io['to'](util['format'](_0x92b9('0x52'),_0x1c79af))[_0x92b9('0x53')](_0x92b9('0x54'),_0x265638);}exports['cs']=function(_0x275f9e,_0x466a9f,_0xdced90,_0x2fcf18,_0x51a57b,_0x59145d,_0x5d94c8,_0x1de411){var _0x469808={};var _0x55c467={'user':_0x59145d['username'],'pass':_0x59145d[_0x92b9('0x55')]};var _0x5012d2=_0x92b9('0x56');var _0x385b24=_0x92b9('0x57');_0x59145d[_0x92b9('0x58')]=intUtil[_0x92b9('0x59')](_0x59145d['remoteUri']);_0x59145d[_0x92b9('0x5a')]=intUtil[_0x92b9('0x59')](_0x59145d[_0x92b9('0x5a')]);var _0x322296=util[_0x92b9('0x5b')](_0x92b9('0x5c'),_0x59145d[_0x92b9('0x58')]);_0x469808[_0x92b9('0x17')]=!_[_0x92b9('0x5d')](_0x2fcf18)?_0x2fcf18[_0x92b9('0x5e')]:null;_0x469808[_0x92b9('0x1f')]=_0x59145d[_0x92b9('0x5e')];_0x469808[_0x92b9('0x22')]=_0x1de411[_0x92b9('0x2e')]()==='outbound'?_0x466a9f[_0x92b9('0x5f')]:_0x466a9f[_0x92b9('0x60')];_0x469808[_0x92b9('0x61')]=_0x1de411===_0x92b9('0x62')||_0x1de411===_0x92b9('0x63')?_0x92b9('0x62'):_0x92b9('0x3a');var _0x2f0387=util['format'](_0x92b9('0x64'),_0x59145d[_0x92b9('0x5a')],_0x466a9f[_0x92b9('0x65')],md5(_0x466a9f[_0x92b9('0x65')]));if(_0x51a57b&&_0x51a57b[_0x92b9('0x66')]){logger[_0x92b9('0x11')]('[QUEUE]','Recording\x20is\x20enabled!');_0x466a9f[_0x92b9('0x67')]=_0x2f0387;}else if(_0x5d94c8&&_0x5d94c8[_0x92b9('0x68')]&&_0x5d94c8['recordingFormat']!==_0x92b9('0x69')){logger['info']('[OUTBOUND]',_0x92b9('0x6a'));_0x466a9f[_0x92b9('0x67')]=_0x2f0387;}else{_0x466a9f['recordingURL']='';}return getAdminUser(_0x1de411,_0x55c467,_0x469808,_0x322296,_0x385b24,_0x5012d2)[_0x92b9('0xc')](getUser(_0x1de411,_0x55c467,_0x322296,_0x385b24,_0x5012d2))[_0x92b9('0xc')](getEndUser(_0x1de411,_0x55c467,_0x322296,_0x385b24,_0x5012d2))[_0x92b9('0xc')](getTicket(_0x1de411,_0x55c467,_0x322296,_0xdced90,_0x466a9f,_0x385b24))['then'](function(_0x5b5f93){logger[_0x92b9('0x11')](util[_0x92b9('0x5b')](_0x92b9('0x6b'),_0x5b5f93[_0x92b9('0x40')]));logger[_0x92b9('0x11')](util['format'](_0x92b9('0x6c'),_0x1de411));if(_0x1de411!==_0x92b9('0x63')){logger['info']('['+[_0x1de411[_0x92b9('0x12')]()]+']',_0x92b9('0x6d'));emit(_0x59145d['remoteUri'],_0x2fcf18['name'],_0x5b5f93['ticketId']);}})[_0x92b9('0x14')](function(_0x102043){logger[_0x92b9('0x27')]('['+[_0x1de411[_0x92b9('0x12')]()]+_0x92b9('0x6e'),util[_0x92b9('0x6f')](_0x102043,{'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 d5ea6e6..1a1b37b 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 _0xe2e0=['redis','localhost','socket.io-emitter','POST','info','name','assigned_user_id','created_by','description','getString','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','forEach','push','idField','variableName','JSON','format','apiKey','toString','get_server_info','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','value','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','stripTrailingSlash','remoteUri','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','error','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','lastevent','toUpperCase','calleridname','request-promise','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','defaults'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xe2e0,0xdc));var _0x0e2e=function(_0x1b1f88,_0x3fe1cb){_0x1b1f88=_0x1b1f88-0x0;var _0x5045b9=_0xe2e0[_0x1b1f88];return _0x5045b9;};'use strict';var _=require('lodash');var rp=require(_0x0e2e('0x0'));var BPromise=require(_0x0e2e('0x1'));var md5=require('md5');var util=require(_0x0e2e('0x2'));var Redis=require(_0x0e2e('0x3'));var intUtil=require('./util');var config=require(_0x0e2e('0x4'));var logger=require(_0x0e2e('0x5'))(_0x0e2e('0x6'));config['redis']=_[_0x0e2e('0x7')](config[_0x0e2e('0x8')],{'host':_0x0e2e('0x9'),'port':0x18eb});var io=require(_0x0e2e('0xa'))(new Redis(config[_0x0e2e('0x8')]));var def={'method':_0x0e2e('0xb'),'json':!![]};function emit(_0x13a79c,_0x6c900d,_0x405d53){io['to'](_0x13a79c)['emit'](_0x6c900d,_0x405d53);}function getTicket(_0x24ecbb,_0x34e968,_0x4d75ae,_0x16dce7,_0x110395,_0x4dbc17,_0x340cfb,_0x4783e7){logger[_0x0e2e('0xc')]('Creating\x20new\x20ticket...');var _0x220c31=new Date();var _0x447847=[{'name':_0x0e2e('0xd'),'value':intUtil['getString'](_0x16dce7['Subjects'],_0x110395,'\x20')},{'name':_0x0e2e('0xe'),'value':_0x34e968['id']},{'name':_0x0e2e('0xf'),'value':_0x34e968['id']},{'name':_0x0e2e('0x10'),'value':intUtil[_0x0e2e('0x11')](_0x16dce7['Descriptions'],_0x110395,'\x0a')},{'name':'date_start','value':_0x220c31[_0x0e2e('0x12')]()[_0x0e2e('0x13')](0x0,0x13)[_0x0e2e('0x14')]('T','\x20')},{'name':_0x0e2e('0x15'),'value':'0'},{'name':_0x0e2e('0x16'),'value':'15'},{'name':_0x0e2e('0x17'),'value':_0x4d75ae['id']},{'name':'parent_type','value':_0x0e2e('0x18')},{'name':_0x0e2e('0x19'),'value':_0x4d75ae[_0x0e2e('0xd')]},{'name':'direction','value':_0x4783e7}];if(_0x4dbc17['length']){_[_0x0e2e('0x1a')](_0x4dbc17,function(_0x4c364d){if(_0x110395[_0x4c364d['variableName']]){_0x447847[_0x0e2e('0x1b')]({'name':_0x4c364d[_0x0e2e('0x1c')],'value':_0x110395[_0x4c364d[_0x0e2e('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x0e2e('0x1e'),'response_type':_0x0e2e('0x1e'),'rest_data':JSON['stringify']({'session':_0x340cfb['id'],'module_name':'Calls','name_value_list':_0x447847})}});}function getAuth(_0x326c50){return util[_0x0e2e('0x1f')]('Basic\x20%s',new Buffer(_0x326c50[_0x0e2e('0x20')]+':X')[_0x0e2e('0x21')]('base64'));}function getServerInfo(_0x46baed){return request({'form':{'method':_0x0e2e('0x22'),'input_type':_0x0e2e('0x1e'),'response_type':'JSON','rest_data':JSON[_0x0e2e('0x23')]({'session':_0x46baed['id']})}});}function getUser(_0x583aee,_0x36b06c,_0x508c58){if(!_[_0x0e2e('0x24')](_0x36b06c)){logger[_0x0e2e('0xc')]('Getting\x20agent\x20with\x20name',_0x36b06c);return request({'form':{'method':_0x0e2e('0x25'),'input_type':_0x0e2e('0x1e'),'response_type':_0x0e2e('0x1e'),'rest_data':JSON['stringify']({'session':_0x508c58['id'],'module_name':_0x0e2e('0x26'),'query':util[_0x0e2e('0x1f')](_0x0e2e('0x27'),_0x36b06c),'order_by':'','offset':'0','select_fields':['id','name',_0x0e2e('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0e2e('0x29')](function(_0x1b29f8){if(_0x1b29f8[_0x0e2e('0x2a')][_0x0e2e('0x2b')]){var _0x22e11b=_[_0x0e2e('0x2c')](_0x1b29f8[_0x0e2e('0x2a')],function(_0x3e2aea){return _0x3e2aea['name_value_list'][_0x0e2e('0x28')][_0x0e2e('0x2d')]===_0x36b06c;});if(_0x22e11b){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x22e11b[_0x0e2e('0x2e')]['id'][_0x0e2e('0x2d')],'name':_0x22e11b['name_value_list'][_0x0e2e('0xd')]['value']});}}logger[_0x0e2e('0xc')](_0x0e2e('0x2f'));return BPromise[_0x0e2e('0x30')]({'id':_0x508c58[_0x0e2e('0x2e')][_0x0e2e('0x31')][_0x0e2e('0x2d')],'name':_0x508c58[_0x0e2e('0x2e')]['user_name']['value']});});}else{logger[_0x0e2e('0xc')](_0x0e2e('0x32'));return BPromise[_0x0e2e('0x30')]({'id':_0x508c58[_0x0e2e('0x2e')][_0x0e2e('0x31')][_0x0e2e('0x2d')],'name':_0x508c58['name_value_list'][_0x0e2e('0x28')][_0x0e2e('0x2d')]});}}function getEndUser(_0x3b0401,_0x582000,_0xb5db56,_0x23a78c){logger['info'](_0x0e2e('0x33'),_0xb5db56);return request({'form':{'method':_0x0e2e('0x25'),'input_type':_0x0e2e('0x1e'),'response_type':_0x0e2e('0x1e'),'rest_data':JSON[_0x0e2e('0x23')]({'session':_0x23a78c['id'],'module_name':'Contacts','query':util[_0x0e2e('0x1f')](_0x0e2e('0x34'),_0xb5db56),'order_by':'','offset':'0','select_fields':['id',_0x0e2e('0xd'),_0x0e2e('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0e2e('0x29')](function(_0x54af37){if(_0x54af37['entry_list'][_0x0e2e('0x2b')]){var _0x23554a=_[_0x0e2e('0x2c')](_0x54af37[_0x0e2e('0x2a')],function(_0x2b5aa1){return _0x2b5aa1[_0x0e2e('0x2e')][_0x0e2e('0x35')][_0x0e2e('0x2d')]===_0xb5db56;});if(_0x23554a){logger[_0x0e2e('0xc')]('Enduser\x20found!');return BPromise[_0x0e2e('0x30')]({'id':_0x23554a[_0x0e2e('0x2e')]['id'][_0x0e2e('0x2d')],'name':_0x23554a['name_value_list'][_0x0e2e('0xd')][_0x0e2e('0x2d')],'phone':_0x23554a[_0x0e2e('0x2e')]['phone_home'][_0x0e2e('0x2d')]});}}else{logger[_0x0e2e('0xc')](_0x0e2e('0x36'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x0e2e('0x23')]({'session':_0x23a78c['id'],'module_name':_0x0e2e('0x18'),'name_value_list':[{'name':_0x0e2e('0x37'),'value':_0x582000!==_0x0e2e('0x38')?_0x582000:util[_0x0e2e('0x1f')](_0x0e2e('0x39'),_0xb5db56)},{'name':_0x0e2e('0x35'),'value':_0xb5db56}]})}})[_0x0e2e('0x29')](function(_0x2e0030){logger[_0x0e2e('0xc')](_0x0e2e('0x3a'));return BPromise[_0x0e2e('0x30')]({'id':_0x2e0030['id'],'name':_0x2e0030[_0x0e2e('0x2a')][_0x0e2e('0x37')]['value'],'phone':_0x2e0030[_0x0e2e('0x2a')]['phone_home']['value']});});}});}function request(_0x34ef05){logger[_0x0e2e('0x3b')](_0x0e2e('0x3c'),JSON[_0x0e2e('0x23')](_0x34ef05));return rp(_[_0x0e2e('0x3d')](def,_0x34ef05));}function getTags(_0x2f5d0b,_0xe4561d){var _0x292f48=[];if(_0x2f5d0b&&_0x2f5d0b[_0x0e2e('0x2b')]>0x0){_0x292f48=_[_0x0e2e('0x3e')](_0x2f5d0b,_0xe4561d);}return _0x292f48;}function getCustomFields(_0x445b69,_0xd04ba9){var _0x4482c6=[];var _0x31c848={'custom_fields':[]};if(_0x445b69[_0x0e2e('0x2b')]>0x0){_[_0x0e2e('0x1a')](_0x445b69,function(_0x19b516){if(_0x19b516[_0x0e2e('0x3f')]===_0x0e2e('0x40')&&_0x19b516[_0x0e2e('0x41')]&&!_0x19b516[_0x0e2e('0x42')]){_0x31c848[_0x19b516['nameField'][_0x0e2e('0x43')]()]=_0x19b516[_0x0e2e('0x44')][_0x0e2e('0x21')]();}else if(_0x19b516[_0x0e2e('0x3f')]===_0x0e2e('0x40')&&_0x19b516['idField']&&_0x19b516[_0x0e2e('0x42')]){_0x31c848[_0x0e2e('0x45')][_0x0e2e('0x1b')]({'id':_0x19b516[_0x0e2e('0x1c')],'value':_0x19b516[_0x0e2e('0x44')][_0x0e2e('0x21')]()});}else if(_0x19b516[_0x0e2e('0x3f')]===_0x0e2e('0x46')&&_0x19b516[_0x0e2e('0x1d')]&&_0x19b516[_0x0e2e('0x1c')]&&_0x19b516[_0x0e2e('0x42')]){_0xd04ba9[_0x19b516[_0x0e2e('0x1d')]]&&_0x31c848['custom_fields'][_0x0e2e('0x1b')]({'id':_0x19b516['idField'],'value':_0xd04ba9[_0x19b516['variableName']]['toString']()});}else if(_0x19b516[_0x0e2e('0x3f')]===_0x0e2e('0x47')&&_0x19b516['Variable']&&_0x19b516[_0x0e2e('0x48')]['name']&&_0x19b516['idField']&&_0x19b516[_0x0e2e('0x42')]){_0xd04ba9[_0x19b516[_0x0e2e('0x48')]['name'][_0x0e2e('0x43')]()]&&_0x31c848[_0x0e2e('0x45')][_0x0e2e('0x1b')]({'id':_0x19b516[_0x0e2e('0x1c')],'value':_0xd04ba9[_0x19b516[_0x0e2e('0x48')][_0x0e2e('0xd')][_0x0e2e('0x43')]()][_0x0e2e('0x21')]()});}});}return _0x31c848;}function getConnection(_0x5a40b3){return request({'method':_0x0e2e('0xb'),'form':{'method':_0x0e2e('0x49'),'input_type':_0x0e2e('0x1e'),'response_type':_0x0e2e('0x1e'),'rest_data':JSON[_0x0e2e('0x23')]({'user_auth':{'user_name':_0x5a40b3['username'],'password':_0x5a40b3['password'],'encryption':_0x0e2e('0x4a')},'application':_0x0e2e('0x4b')})}})[_0x0e2e('0x29')](function(_0x2ffef0){var _0x3f59ba=_0x2ffef0;if(_0x3f59ba['id']){def[_0x0e2e('0x4c')]=_0x3f59ba['id'];return BPromise['resolve'](_0x3f59ba);}else{throw new Error(util[_0x0e2e('0x1f')]('Account\x20%d\x20is\x20not\x20valid',_0x5a40b3['id']));}});}function setRelationship(_0x1c5e5a,_0x30e89e,_0x296b35,_0x4c55df){return request({'form':{'method':_0x0e2e('0x4d'),'input_type':_0x0e2e('0x1e'),'response_type':_0x0e2e('0x1e'),'rest_data':JSON[_0x0e2e('0x23')]({'session':_0x1c5e5a['id'],'module_name':_0x0e2e('0x4e'),'module_id':_0x296b35['id'],'link_field_name':_0x4c55df,'related_ids':[_0x30e89e['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0e2e('0x4f')]=function(_0x390450,_0xfb694a,_0x36145f,_0x44d1a5,_0x2c17ab,_0x1657ec){var _0x574aac,_0x1bbc1c,_0x122f3e,_0x4890fd;_0x1657ec['remoteUri']=intUtil[_0x0e2e('0x50')](_0x1657ec[_0x0e2e('0x51')]);_0x1657ec['serverUrl']=intUtil[_0x0e2e('0x50')](_0x1657ec['serverUrl']);def[_0x0e2e('0x52')]=util[_0x0e2e('0x1f')]('%s/service/v4_1/rest.php',_0x1657ec[_0x0e2e('0x51')]);if(_0x2c17ab&&_0x2c17ab[_0x0e2e('0x53')]){logger['info'](_0x0e2e('0x54'),_0x0e2e('0x55'));_0xfb694a[_0x0e2e('0x56')]=util[_0x0e2e('0x1f')](_0x0e2e('0x57'),_0x1657ec[_0x0e2e('0x58')],_0xfb694a[_0x0e2e('0x59')],md5(_0xfb694a[_0x0e2e('0x59')]));}else{_0xfb694a[_0x0e2e('0x56')]='';}return getConnection(_0x1657ec)['then'](function(_0x46ee4f){_0x4890fd=_0x46ee4f;return getUser(_0x1657ec,_0x44d1a5['name'],_0x4890fd);})[_0x0e2e('0x29')](function(_0x3fe3e4){_0x574aac=_0x3fe3e4;logger[_0x0e2e('0xc')]('The\x20User\x20ID\x20is:',_0x574aac['id']);return getEndUser(_0x1657ec,_0xfb694a['calleridname'],_0xfb694a[_0x0e2e('0x5a')],_0x4890fd);})[_0x0e2e('0x29')](function(_0x507fca){_0x1bbc1c=_0x507fca;logger[_0x0e2e('0xc')](_0x0e2e('0x5b'),_0x1bbc1c['id']);return getTicket(_0x1657ec,_0x574aac,_0x1bbc1c,_0x36145f,_0xfb694a,_0x36145f[_0x0e2e('0x5c')],_0x4890fd,_0x0e2e('0x5d'));})[_0x0e2e('0x29')](function(_0x3125ea){_0x122f3e=_0x3125ea;logger[_0x0e2e('0xc')](_0x0e2e('0x5e'));logger[_0x0e2e('0xc')](_0x0e2e('0x5f'),_0x122f3e['id']);return setRelationship(_0x4890fd,_0x574aac,_0x122f3e,_0x0e2e('0x60'));})[_0x0e2e('0x29')](function(){return setRelationship(_0x4890fd,_0x1bbc1c,_0x122f3e,_0x0e2e('0x61'));})[_0x0e2e('0x29')](function(){return getServerInfo(_0x4890fd);})[_0x0e2e('0x29')](function(_0x1914b1){var _0x2ba5d7=parseInt(_0x1914b1['version'][_0x0e2e('0x62')](0x0));var _0x36fb39=util[_0x0e2e('0x1f')](_0x0e2e('0x63'),_0x1657ec[_0x0e2e('0x51')],_0x122f3e['id']);if(_0x2ba5d7>0x6){_0x36fb39=util[_0x0e2e('0x1f')](_0x0e2e('0x64'),_0x1657ec['remoteUri'],_0x122f3e['id']);}logger[_0x0e2e('0xc')](_0x0e2e('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0e2e('0x1f')]('user:%s',_0x44d1a5['name']),_0x0e2e('0x65'),{'uri':_0x36fb39});})['catch'](function(_0x2b9b82){logger[_0x0e2e('0x66')](_0x0e2e('0x54'),JSON[_0x0e2e('0x23')](_0x2b9b82));});};exports['outbound']=function(_0x136f00,_0x13728d,_0x1f0de4,_0x3e9d22,_0x174280,_0x53526b,_0x376501){var _0x215cc5,_0x3a03b5,_0x2d9326,_0x52a00b;_0x53526b[_0x0e2e('0x51')]=intUtil[_0x0e2e('0x50')](_0x53526b[_0x0e2e('0x51')]);_0x53526b[_0x0e2e('0x58')]=intUtil[_0x0e2e('0x50')](_0x53526b['serverUrl']);def['uri']=util[_0x0e2e('0x1f')](_0x0e2e('0x67'),_0x53526b[_0x0e2e('0x51')]);if(_0x376501&&_0x376501[_0x0e2e('0x68')]&&_0x376501[_0x0e2e('0x68')]!=='none'){logger[_0x0e2e('0xc')](_0x0e2e('0x69'),_0x0e2e('0x55'));_0x13728d[_0x0e2e('0x56')]=util[_0x0e2e('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53526b[_0x0e2e('0x58')],_0x13728d[_0x0e2e('0x59')],md5(_0x13728d[_0x0e2e('0x59')]));}return getConnection(_0x53526b)['then'](function(_0x580d5a){_0x52a00b=_0x580d5a;return getUser(_0x53526b,_0x3e9d22[_0x0e2e('0xd')],_0x52a00b);})[_0x0e2e('0x29')](function(_0x1830be){_0x215cc5=_0x1830be;logger[_0x0e2e('0xc')](_0x0e2e('0x6a'),_0x215cc5['id']);return getEndUser(_0x53526b,_0x13728d[_0x0e2e('0x6b')],_0x13728d[_0x0e2e('0x6c')],_0x52a00b);})[_0x0e2e('0x29')](function(_0x1e967c){_0x3a03b5=_0x1e967c;logger[_0x0e2e('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3a03b5['id']);return getTicket(_0x53526b,_0x215cc5,_0x3a03b5,_0x1f0de4,_0x13728d,_0x1f0de4[_0x0e2e('0x5c')],_0x52a00b,'Outbound');})['then'](function(_0x10ed63){_0x2d9326=_0x10ed63;logger['info'](_0x0e2e('0x5e'));logger['info'](_0x0e2e('0x5f'),_0x2d9326['id']);return setRelationship(_0x52a00b,_0x215cc5,_0x2d9326,_0x0e2e('0x60'));})['then'](function(){return setRelationship(_0x52a00b,_0x3a03b5,_0x2d9326,'contacts');})[_0x0e2e('0x29')](function(){return getServerInfo(_0x52a00b);})[_0x0e2e('0x29')](function(_0x15d55b){var _0xd5d8b3=parseInt(_0x15d55b['version']['charAt'](0x0));var _0x53e3d5=util[_0x0e2e('0x1f')](_0x0e2e('0x63'),_0x53526b[_0x0e2e('0x51')],_0x2d9326['id']);if(_0xd5d8b3>0x6){_0x53e3d5=util['format'](_0x0e2e('0x64'),_0x53526b[_0x0e2e('0x51')],_0x2d9326['id']);}logger[_0x0e2e('0xc')](_0x0e2e('0x69'),_0x0e2e('0x6d'));emit(util[_0x0e2e('0x1f')](_0x0e2e('0x6e'),_0x3e9d22[_0x0e2e('0xd')]),_0x0e2e('0x65'),{'uri':_0x53e3d5});})['catch'](function(_0xd59321){logger[_0x0e2e('0x66')](_0x0e2e('0x69'),JSON[_0x0e2e('0x23')](_0xd59321));});};exports['unmanaged']=function(_0x24f6b7,_0x3789fa,_0x4a7e01,_0x227c6f,_0x5b1468,_0x3c8147){var _0x5a6e1d,_0x331906,_0x4cdfd2,_0x3e97cc;_0x3c8147[_0x0e2e('0x51')]=intUtil[_0x0e2e('0x50')](_0x3c8147[_0x0e2e('0x51')]);_0x3c8147[_0x0e2e('0x58')]=intUtil[_0x0e2e('0x50')](_0x3c8147[_0x0e2e('0x58')]);def['uri']=util[_0x0e2e('0x1f')](_0x0e2e('0x67'),_0x3c8147[_0x0e2e('0x51')]);if(_0x5b1468&&_0x5b1468[_0x0e2e('0x53')]){logger[_0x0e2e('0xc')]('['+_0x3789fa[_0x0e2e('0x6f')][_0x0e2e('0x70')]()+']','Recording\x20is\x20enabled!');_0x3789fa[_0x0e2e('0x56')]=util[_0x0e2e('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3c8147['serverUrl'],_0x3789fa['uniqueid'],md5(_0x3789fa[_0x0e2e('0x59')]));}else{_0x3789fa[_0x0e2e('0x56')]='';}return getConnection(_0x3c8147)[_0x0e2e('0x29')](function(_0xfb83d8){_0x3e97cc=_0xfb83d8;if(!_['isNil'](_0x227c6f)){return getUser(_0x3c8147,_0x227c6f[_0x0e2e('0xd')],_0x3e97cc);}else{return getUser(_0x3c8147,null,_0x3e97cc);}})[_0x0e2e('0x29')](function(_0xe954){_0x5a6e1d=_0xe954;logger[_0x0e2e('0xc')](_0x0e2e('0x6a'),_0x5a6e1d['id']);return getEndUser(_0x3c8147,_0x3789fa[_0x0e2e('0x71')],_0x3789fa[_0x0e2e('0x5a')],_0x3e97cc);})[_0x0e2e('0x29')](function(_0x4adb5d){_0x331906=_0x4adb5d;logger[_0x0e2e('0xc')](_0x0e2e('0x5b'),_0x331906['id']);return getTicket(_0x3c8147,_0x5a6e1d,_0x331906,_0x4a7e01,_0x3789fa,_0x4a7e01[_0x0e2e('0x5c')],_0x3e97cc,_0x0e2e('0x5d'));})[_0x0e2e('0x29')](function(_0x308418){_0x4cdfd2=_0x308418;logger[_0x0e2e('0xc')](_0x0e2e('0x5e'));logger['info'](_0x0e2e('0x5f'),_0x4cdfd2['id']);return setRelationship(_0x3e97cc,_0x5a6e1d,_0x4cdfd2,_0x0e2e('0x60'));})[_0x0e2e('0x29')](function(){return setRelationship(_0x3e97cc,_0x331906,_0x4cdfd2,_0x0e2e('0x61'));})['then'](function(){return getServerInfo(_0x3e97cc);})['catch'](function(_0x31ec9d){logger[_0x0e2e('0x66')]('['+_0x3789fa[_0x0e2e('0x6f')][_0x0e2e('0x70')]()+']',JSON[_0x0e2e('0x23')](_0x31ec9d));});}; \ No newline at end of file +var _0x5136=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','recordingFormat','none','uniqueid','destcalleridname','Fields','Outbound','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','lastevent','lodash','bluebird','md5','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','slice','replace','duration_hours','parent_id','Contacts','parent_name','name','direction','length','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find','entry_list','name_value_list','value','Agent\x20found!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','resolve','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','custom_fields','content','variable','Variable','username','password','PLAIN','sessionID','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0x5136,0x184));var _0x6513=function(_0x1d99c8,_0x83d1b7){_0x1d99c8=_0x1d99c8-0x0;var _0x5245c8=_0x5136[_0x1d99c8];return _0x5245c8;};'use strict';var _=require(_0x6513('0x0'));var rp=require('request-promise');var BPromise=require(_0x6513('0x1'));var md5=require(_0x6513('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x6513('0x3'));var config=require(_0x6513('0x4'));var logger=require('../../../../config/logger')(_0x6513('0x5'));config[_0x6513('0x6')]=_[_0x6513('0x7')](config['redis'],{'host':_0x6513('0x8'),'port':0x18eb});var io=require(_0x6513('0x9'))(new Redis(config[_0x6513('0x6')]));var def={'method':_0x6513('0xa'),'json':!![]};function emit(_0x14e738,_0x391dea,_0x52b85d){io['to'](_0x14e738)[_0x6513('0xb')](_0x391dea,_0x52b85d);}function getTicket(_0x497159,_0x2335d3,_0x2a09f0,_0x13a1ae,_0x7ff1d6,_0x233cc0,_0x16bf06,_0x5cd2e3){logger['info'](_0x6513('0xc'));var _0x29e4c1=new Date();var _0x4dc1e5=[{'name':'name','value':intUtil['getString'](_0x13a1ae[_0x6513('0xd')],_0x7ff1d6,'\x20')},{'name':_0x6513('0xe'),'value':_0x2335d3['id']},{'name':_0x6513('0xf'),'value':_0x2335d3['id']},{'name':_0x6513('0x10'),'value':intUtil[_0x6513('0x11')](_0x13a1ae[_0x6513('0x12')],_0x7ff1d6,'\x0a')},{'name':_0x6513('0x13'),'value':_0x29e4c1['toISOString']()[_0x6513('0x14')](0x0,0x13)[_0x6513('0x15')]('T','\x20')},{'name':_0x6513('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x6513('0x17'),'value':_0x2a09f0['id']},{'name':'parent_type','value':_0x6513('0x18')},{'name':_0x6513('0x19'),'value':_0x2a09f0[_0x6513('0x1a')]},{'name':_0x6513('0x1b'),'value':_0x5cd2e3}];if(_0x233cc0[_0x6513('0x1c')]){_['forEach'](_0x233cc0,function(_0x414474){if(_0x7ff1d6[_0x414474[_0x6513('0x1d')]]){_0x4dc1e5[_0x6513('0x1e')]({'name':_0x414474[_0x6513('0x1f')],'value':_0x7ff1d6[_0x414474[_0x6513('0x1d')]]});}});}return request({'form':{'method':_0x6513('0x20'),'input_type':'JSON','response_type':_0x6513('0x21'),'rest_data':JSON['stringify']({'session':_0x16bf06['id'],'module_name':_0x6513('0x22'),'name_value_list':_0x4dc1e5})}});}function getAuth(_0x297db1){return util[_0x6513('0x23')](_0x6513('0x24'),new Buffer(_0x297db1[_0x6513('0x25')]+':X')[_0x6513('0x26')](_0x6513('0x27')));}function getServerInfo(_0x4ed234){return request({'form':{'method':_0x6513('0x28'),'input_type':'JSON','response_type':_0x6513('0x21'),'rest_data':JSON[_0x6513('0x29')]({'session':_0x4ed234['id']})}});}function getUser(_0x39a1d2,_0x466ffd,_0x46a49c){if(!_[_0x6513('0x2a')](_0x466ffd)){logger[_0x6513('0x2b')](_0x6513('0x2c'),_0x466ffd);return request({'form':{'method':_0x6513('0x2d'),'input_type':'JSON','response_type':_0x6513('0x21'),'rest_data':JSON[_0x6513('0x29')]({'session':_0x46a49c['id'],'module_name':_0x6513('0x2e'),'query':util[_0x6513('0x23')](_0x6513('0x2f'),_0x466ffd),'order_by':'','offset':'0','select_fields':['id',_0x6513('0x1a'),_0x6513('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x36bbf8){if(_0x36bbf8['entry_list']['length']){var _0x4808c5=_[_0x6513('0x31')](_0x36bbf8[_0x6513('0x32')],function(_0x245907){return _0x245907[_0x6513('0x33')][_0x6513('0x30')][_0x6513('0x34')]===_0x466ffd;});if(_0x4808c5){logger['info'](_0x6513('0x35'));return BPromise['resolve']({'id':_0x4808c5[_0x6513('0x33')]['id']['value'],'name':_0x4808c5[_0x6513('0x33')][_0x6513('0x1a')][_0x6513('0x34')]});}}logger[_0x6513('0x2b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x46a49c[_0x6513('0x33')][_0x6513('0x36')][_0x6513('0x34')],'name':_0x46a49c[_0x6513('0x33')][_0x6513('0x30')][_0x6513('0x34')]});});}else{logger['info'](_0x6513('0x37'));return BPromise['resolve']({'id':_0x46a49c[_0x6513('0x33')]['user_id']['value'],'name':_0x46a49c['name_value_list'][_0x6513('0x30')][_0x6513('0x34')]});}}function getEndUser(_0x41a644,_0x221931,_0x4117cd,_0x821b3){logger[_0x6513('0x2b')](_0x6513('0x38'),_0x4117cd);return request({'form':{'method':_0x6513('0x2d'),'input_type':_0x6513('0x21'),'response_type':_0x6513('0x21'),'rest_data':JSON[_0x6513('0x29')]({'session':_0x821b3['id'],'module_name':_0x6513('0x18'),'query':util[_0x6513('0x23')](_0x6513('0x39'),_0x4117cd),'order_by':'','offset':'0','select_fields':['id','name',_0x6513('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6513('0x3b')](function(_0x3e9244){if(_0x3e9244[_0x6513('0x32')][_0x6513('0x1c')]){var _0x2e205e=_[_0x6513('0x31')](_0x3e9244['entry_list'],function(_0x491149){return _0x491149[_0x6513('0x33')]['phone_home'][_0x6513('0x34')]===_0x4117cd;});if(_0x2e205e){logger[_0x6513('0x2b')](_0x6513('0x3c'));return BPromise[_0x6513('0x3d')]({'id':_0x2e205e['name_value_list']['id']['value'],'name':_0x2e205e[_0x6513('0x33')][_0x6513('0x1a')][_0x6513('0x34')],'phone':_0x2e205e['name_value_list']['phone_home'][_0x6513('0x34')]});}}else{logger[_0x6513('0x2b')](_0x6513('0x3e'));return request({'form':{'method':_0x6513('0x20'),'input_type':_0x6513('0x21'),'response_type':_0x6513('0x21'),'rest_data':JSON['stringify']({'session':_0x821b3['id'],'module_name':_0x6513('0x18'),'name_value_list':[{'name':_0x6513('0x3f'),'value':_0x221931!==_0x6513('0x40')?_0x221931:util[_0x6513('0x23')]('Caller\x20-\x20%s',_0x4117cd)},{'name':_0x6513('0x3a'),'value':_0x4117cd}]})}})[_0x6513('0x3b')](function(_0x737776){logger[_0x6513('0x2b')]('Enduser\x20created.');return BPromise[_0x6513('0x3d')]({'id':_0x737776['id'],'name':_0x737776[_0x6513('0x32')][_0x6513('0x3f')][_0x6513('0x34')],'phone':_0x737776[_0x6513('0x32')]['phone_home'][_0x6513('0x34')]});});}});}function request(_0x4aa8f4){logger[_0x6513('0x41')](_0x6513('0x42'),JSON[_0x6513('0x29')](_0x4aa8f4));return rp(_[_0x6513('0x43')](def,_0x4aa8f4));}function getTags(_0x2c0752,_0x20ac54){var _0x130627=[];if(_0x2c0752&&_0x2c0752[_0x6513('0x1c')]>0x0){_0x130627=_[_0x6513('0x44')](_0x2c0752,_0x20ac54);}return _0x130627;}function getCustomFields(_0x9a683c,_0x2d8d91){var _0x4b45c1=[];var _0x44b40c={'custom_fields':[]};if(_0x9a683c['length']>0x0){_[_0x6513('0x45')](_0x9a683c,function(_0x2f0946){if(_0x2f0946[_0x6513('0x46')]===_0x6513('0x47')&&_0x2f0946[_0x6513('0x48')]&&!_0x2f0946[_0x6513('0x49')]){_0x44b40c[_0x2f0946[_0x6513('0x48')][_0x6513('0x4a')]()]=_0x2f0946['content'][_0x6513('0x26')]();}else if(_0x2f0946['type']===_0x6513('0x47')&&_0x2f0946['idField']&&_0x2f0946[_0x6513('0x49')]){_0x44b40c[_0x6513('0x4b')][_0x6513('0x1e')]({'id':_0x2f0946[_0x6513('0x1f')],'value':_0x2f0946[_0x6513('0x4c')][_0x6513('0x26')]()});}else if(_0x2f0946[_0x6513('0x46')]===_0x6513('0x4d')&&_0x2f0946[_0x6513('0x1d')]&&_0x2f0946[_0x6513('0x1f')]&&_0x2f0946[_0x6513('0x49')]){_0x2d8d91[_0x2f0946[_0x6513('0x1d')]]&&_0x44b40c['custom_fields']['push']({'id':_0x2f0946[_0x6513('0x1f')],'value':_0x2d8d91[_0x2f0946[_0x6513('0x1d')]][_0x6513('0x26')]()});}else if(_0x2f0946[_0x6513('0x46')]==='customVariable'&&_0x2f0946['Variable']&&_0x2f0946[_0x6513('0x4e')]['name']&&_0x2f0946['idField']&&_0x2f0946[_0x6513('0x49')]){_0x2d8d91[_0x2f0946[_0x6513('0x4e')]['name'][_0x6513('0x4a')]()]&&_0x44b40c[_0x6513('0x4b')][_0x6513('0x1e')]({'id':_0x2f0946[_0x6513('0x1f')],'value':_0x2d8d91[_0x2f0946['Variable']['name']['toLowerCase']()][_0x6513('0x26')]()});}});}return _0x44b40c;}function getConnection(_0x506880){return request({'method':'POST','form':{'method':'login','input_type':_0x6513('0x21'),'response_type':'JSON','rest_data':JSON[_0x6513('0x29')]({'user_auth':{'user_name':_0x506880[_0x6513('0x4f')],'password':_0x506880[_0x6513('0x50')],'encryption':_0x6513('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x6513('0x3b')](function(_0x3de181){var _0x332a61=_0x3de181;if(_0x332a61['id']){def[_0x6513('0x52')]=_0x332a61['id'];return BPromise['resolve'](_0x332a61);}else{throw new Error(util[_0x6513('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x506880['id']));}});}function setRelationship(_0x280d6f,_0x1007ed,_0x255a53,_0x2d94b2){return request({'form':{'method':_0x6513('0x53'),'input_type':_0x6513('0x21'),'response_type':_0x6513('0x21'),'rest_data':JSON[_0x6513('0x29')]({'session':_0x280d6f['id'],'module_name':_0x6513('0x22'),'module_id':_0x255a53['id'],'link_field_name':_0x2d94b2,'related_ids':[_0x1007ed['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x48ad8d,_0x2ba426,_0x47bcde,_0x7150a3,_0xec8510,_0x585f42){var _0x2125cb,_0x5fba27,_0x3db6bb,_0x346092;_0x585f42[_0x6513('0x54')]=intUtil[_0x6513('0x55')](_0x585f42[_0x6513('0x54')]);_0x585f42['serverUrl']=intUtil[_0x6513('0x55')](_0x585f42[_0x6513('0x56')]);def[_0x6513('0x57')]=util[_0x6513('0x23')](_0x6513('0x58'),_0x585f42['remoteUri']);if(_0xec8510&&_0xec8510[_0x6513('0x59')]){logger[_0x6513('0x2b')](_0x6513('0x5a'),_0x6513('0x5b'));_0x2ba426[_0x6513('0x5c')]=util[_0x6513('0x23')](_0x6513('0x5d'),_0x585f42[_0x6513('0x56')],_0x2ba426['uniqueid'],md5(_0x2ba426['uniqueid']));}else{_0x2ba426['recordingURL']='';}return getConnection(_0x585f42)[_0x6513('0x3b')](function(_0x1a5bbd){_0x346092=_0x1a5bbd;return getUser(_0x585f42,_0x7150a3[_0x6513('0x1a')],_0x346092);})[_0x6513('0x3b')](function(_0x3c043f){_0x2125cb=_0x3c043f;logger['info'](_0x6513('0x5e'),_0x2125cb['id']);return getEndUser(_0x585f42,_0x2ba426[_0x6513('0x5f')],_0x2ba426[_0x6513('0x60')],_0x346092);})[_0x6513('0x3b')](function(_0x5abe36){_0x5fba27=_0x5abe36;logger['info'](_0x6513('0x61'),_0x5fba27['id']);return getTicket(_0x585f42,_0x2125cb,_0x5fba27,_0x47bcde,_0x2ba426,_0x47bcde['Fields'],_0x346092,_0x6513('0x62'));})['then'](function(_0x48c4c3){_0x3db6bb=_0x48c4c3;logger['info'](_0x6513('0x63'));logger[_0x6513('0x2b')](_0x6513('0x64'),_0x3db6bb['id']);return setRelationship(_0x346092,_0x2125cb,_0x3db6bb,_0x6513('0x65'));})['then'](function(){return setRelationship(_0x346092,_0x5fba27,_0x3db6bb,'contacts');})['then'](function(){return getServerInfo(_0x346092);})[_0x6513('0x3b')](function(_0x424697){var _0x30a870=parseInt(_0x424697['version']['charAt'](0x0));var _0x2e8dd2=util['format'](_0x6513('0x66'),_0x585f42['remoteUri'],_0x3db6bb['id']);if(_0x30a870>0x6){_0x2e8dd2=util[_0x6513('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x585f42['remoteUri'],_0x3db6bb['id']);}logger[_0x6513('0x2b')](_0x6513('0x5a'),_0x6513('0x67'));emit(util[_0x6513('0x23')]('user:%s',_0x7150a3[_0x6513('0x1a')]),'trigger:browser:url',{'uri':_0x2e8dd2});})[_0x6513('0x68')](function(_0x1739b7){logger[_0x6513('0x69')](_0x6513('0x5a'),JSON[_0x6513('0x29')](_0x1739b7));});};exports['outbound']=function(_0x301737,_0x19ffdd,_0x4046ca,_0x2ed822,_0x2e802b,_0x5e4ac6,_0x4e4d13){var _0x37ecc0,_0x39d5ca,_0x526d93,_0x33b3ec;_0x5e4ac6[_0x6513('0x54')]=intUtil[_0x6513('0x55')](_0x5e4ac6['remoteUri']);_0x5e4ac6['serverUrl']=intUtil[_0x6513('0x55')](_0x5e4ac6[_0x6513('0x56')]);def['uri']=util['format'](_0x6513('0x58'),_0x5e4ac6['remoteUri']);if(_0x4e4d13&&_0x4e4d13[_0x6513('0x6a')]&&_0x4e4d13[_0x6513('0x6a')]!==_0x6513('0x6b')){logger[_0x6513('0x2b')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x19ffdd['recordingURL']=util[_0x6513('0x23')](_0x6513('0x5d'),_0x5e4ac6[_0x6513('0x56')],_0x19ffdd['uniqueid'],md5(_0x19ffdd[_0x6513('0x6c')]));}return getConnection(_0x5e4ac6)[_0x6513('0x3b')](function(_0x282dba){_0x33b3ec=_0x282dba;return getUser(_0x5e4ac6,_0x2ed822['name'],_0x33b3ec);})[_0x6513('0x3b')](function(_0x5ea954){_0x37ecc0=_0x5ea954;logger['info']('The\x20User\x20ID\x20is:',_0x37ecc0['id']);return getEndUser(_0x5e4ac6,_0x19ffdd[_0x6513('0x6d')],_0x19ffdd['destcalleridnum'],_0x33b3ec);})[_0x6513('0x3b')](function(_0x4d432c){_0x39d5ca=_0x4d432c;logger[_0x6513('0x2b')]('The\x20Enduser\x20ID\x20is:',_0x39d5ca['id']);return getTicket(_0x5e4ac6,_0x37ecc0,_0x39d5ca,_0x4046ca,_0x19ffdd,_0x4046ca[_0x6513('0x6e')],_0x33b3ec,_0x6513('0x6f'));})['then'](function(_0x1ec539){_0x526d93=_0x1ec539;logger['info'](_0x6513('0x63'));logger[_0x6513('0x2b')](_0x6513('0x64'),_0x526d93['id']);return setRelationship(_0x33b3ec,_0x37ecc0,_0x526d93,_0x6513('0x65'));})[_0x6513('0x3b')](function(){return setRelationship(_0x33b3ec,_0x39d5ca,_0x526d93,_0x6513('0x70'));})['then'](function(){return getServerInfo(_0x33b3ec);})[_0x6513('0x3b')](function(_0x5e5e11){var _0x1ccd52=parseInt(_0x5e5e11[_0x6513('0x71')]['charAt'](0x0));var _0x55ff36=util[_0x6513('0x23')](_0x6513('0x66'),_0x5e4ac6['remoteUri'],_0x526d93['id']);if(_0x1ccd52>0x6){_0x55ff36=util['format'](_0x6513('0x72'),_0x5e4ac6[_0x6513('0x54')],_0x526d93['id']);}logger[_0x6513('0x2b')](_0x6513('0x73'),_0x6513('0x67'));emit(util[_0x6513('0x23')]('user:%s',_0x2ed822['name']),_0x6513('0x74'),{'uri':_0x55ff36});})[_0x6513('0x68')](function(_0x1d933f){logger[_0x6513('0x69')]('[OUTBOUND]',JSON[_0x6513('0x29')](_0x1d933f));});};exports[_0x6513('0x75')]=function(_0xd35cea,_0x184ba3,_0x40402b,_0x215370,_0x3dbe95,_0xc3af89){var _0x1aa88d,_0x3d57c3,_0x17353f,_0x5c4e20;_0xc3af89[_0x6513('0x54')]=intUtil[_0x6513('0x55')](_0xc3af89[_0x6513('0x54')]);_0xc3af89[_0x6513('0x56')]=intUtil[_0x6513('0x55')](_0xc3af89['serverUrl']);def['uri']=util['format']('%s/service/v4_1/rest.php',_0xc3af89[_0x6513('0x54')]);if(_0x3dbe95&&_0x3dbe95[_0x6513('0x59')]){logger[_0x6513('0x2b')]('['+_0x184ba3['lastevent'][_0x6513('0x76')]()+']',_0x6513('0x5b'));_0x184ba3[_0x6513('0x5c')]=util[_0x6513('0x23')](_0x6513('0x5d'),_0xc3af89[_0x6513('0x56')],_0x184ba3['uniqueid'],md5(_0x184ba3[_0x6513('0x6c')]));}else{_0x184ba3[_0x6513('0x5c')]='';}return getConnection(_0xc3af89)['then'](function(_0x5725c6){_0x5c4e20=_0x5725c6;if(!_[_0x6513('0x2a')](_0x215370)){return getUser(_0xc3af89,_0x215370['name'],_0x5c4e20);}else{return getUser(_0xc3af89,null,_0x5c4e20);}})[_0x6513('0x3b')](function(_0x18d107){_0x1aa88d=_0x18d107;logger['info']('The\x20User\x20ID\x20is:',_0x1aa88d['id']);return getEndUser(_0xc3af89,_0x184ba3[_0x6513('0x5f')],_0x184ba3['calleridnum'],_0x5c4e20);})[_0x6513('0x3b')](function(_0x334c8){_0x3d57c3=_0x334c8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3d57c3['id']);return getTicket(_0xc3af89,_0x1aa88d,_0x3d57c3,_0x40402b,_0x184ba3,_0x40402b[_0x6513('0x6e')],_0x5c4e20,_0x6513('0x62'));})[_0x6513('0x3b')](function(_0x259f39){_0x17353f=_0x259f39;logger['info'](_0x6513('0x63'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x17353f['id']);return setRelationship(_0x5c4e20,_0x1aa88d,_0x17353f,_0x6513('0x65'));})[_0x6513('0x3b')](function(){return setRelationship(_0x5c4e20,_0x3d57c3,_0x17353f,_0x6513('0x70'));})[_0x6513('0x3b')](function(){return getServerInfo(_0x5c4e20);})['catch'](function(_0x414ed4){logger[_0x6513('0x69')]('['+_0x184ba3[_0x6513('0x77')]['toUpperCase']()+']',JSON['stringify'](_0x414ed4));});}; \ 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 9a91111..f8d5203 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 _0x3c61=['variableName','push','toString','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','variable','customVariable','format','stripTrailingSlash','slice','validateEmail','isNil','test','lodash','getString','sortBy','length','type','string','content'];(function(_0x3ce3a2,_0x3bf618){var _0x1ffb95=function(_0x2522ae){while(--_0x2522ae){_0x3ce3a2['push'](_0x3ce3a2['shift']());}};_0x1ffb95(++_0x3bf618);}(_0x3c61,0x165));var _0x13c6=function(_0x14c770,_0x455be1){_0x14c770=_0x14c770-0x0;var _0x5abec4=_0x3c61[_0x14c770];return _0x5abec4;};'use strict';var _=require(_0x13c6('0x0'));var util=require('util');exports[_0x13c6('0x1')]=function(_0x2c8f5e,_0x1669ab,_0x1dd8ad){var _0x5a378a=[];if(_0x2c8f5e['length']>0x0){var _0x1c6d9a=_[_0x13c6('0x2')](_0x2c8f5e,['id']);for(var _0x30a939=0x0;_0x30a939<_0x1c6d9a[_0x13c6('0x3')];_0x30a939++){var _0x5363a4=_0x1c6d9a[_0x30a939];if(_0x5363a4[_0x13c6('0x4')]===_0x13c6('0x5')){_0x5a378a['push'](_0x5363a4[_0x13c6('0x6')]);}else if(_0x5363a4[_0x13c6('0x4')]==='variable'&&_0x5363a4['variableName']){_0x1669ab[_0x5363a4[_0x13c6('0x7')]]&&_0x5a378a[_0x13c6('0x8')](_0x1669ab[_0x5363a4['variableName']][_0x13c6('0x9')]());}else if(_0x5363a4[_0x13c6('0x4')]==='customVariable'&&_0x5363a4[_0x13c6('0xa')]&&_0x5363a4['Variable'][_0x13c6('0xb')]){_0x1669ab[_0x5363a4[_0x13c6('0xa')]['name'][_0x13c6('0xc')]()]&&_0x5a378a['push'](_0x1669ab[_0x5363a4['Variable'][_0x13c6('0xb')][_0x13c6('0xc')]()][_0x13c6('0x9')]());}else if(_0x5363a4[_0x13c6('0x4')]===_0x13c6('0xd')){if(_0x5363a4[_0x13c6('0xe')]==='string'&&_0x5363a4[_0x13c6('0xf')]){_0x5a378a[_0x13c6('0x8')](util['format'](_0x13c6('0x10'),_0x5363a4[_0x13c6('0xf')],_0x5363a4[_0x13c6('0x11')]));}else if(_0x5363a4[_0x13c6('0xe')]===_0x13c6('0x12')&&_0x5363a4[_0x13c6('0x7')]&&_0x5363a4[_0x13c6('0xf')]){_0x1669ab[_0x5363a4[_0x13c6('0x7')]]&&_0x5a378a['push'](util['format'](_0x13c6('0x10'),_0x5363a4[_0x13c6('0xf')],_0x1669ab[_0x5363a4[_0x13c6('0x7')]]));}else if(_0x5363a4[_0x13c6('0xe')]===_0x13c6('0x13')&&_0x5363a4['Variable']&&_0x5363a4[_0x13c6('0xa')][_0x13c6('0xb')]&&_0x5363a4[_0x13c6('0xf')]){_0x1669ab[_0x5363a4[_0x13c6('0xa')][_0x13c6('0xb')][_0x13c6('0xc')]()]&&_0x5a378a['push'](util[_0x13c6('0x14')](_0x13c6('0x10'),_0x5363a4[_0x13c6('0xf')],_0x1669ab[_0x5363a4[_0x13c6('0xa')][_0x13c6('0xb')][_0x13c6('0xc')]()]));}}}}return _0x5a378a['join'](_0x1dd8ad);};exports[_0x13c6('0x15')]=function(_0x16ccdf){var _0x3b9fff=_0x16ccdf[_0x13c6('0x16')](-0x1);if(_0x3b9fff==='/'){_0x16ccdf=_0x16ccdf['substring'](0x0,_0x16ccdf['lastIndexOf'](_0x3b9fff));}return _0x16ccdf;};exports[_0x13c6('0x17')]=function(_0x323e04){if(!_[_0x13c6('0x18')](_0x323e04)&&_0x323e04!==''){var _0x5d27ad=/^(([^<>()\[\]\\.,;:\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 _0x5d27ad[_0x13c6('0x19')](String(_0x323e04)[_0x13c6('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x5776=['customVariable','Variable','name','toLowerCase','keyType','format','%s:\x20%s','key','variable','join','stripTrailingSlash','slice','validateEmail','isNil','test','util','getString','length','sortBy','type','push','content','variableName','toString'];(function(_0x2362d1,_0x5afc34){var _0x373dd0=function(_0x59bd20){while(--_0x59bd20){_0x2362d1['push'](_0x2362d1['shift']());}};_0x373dd0(++_0x5afc34);}(_0x5776,0xcf));var _0x6577=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5776[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x6577('0x0'));exports[_0x6577('0x1')]=function(_0x821a22,_0xa22666,_0x1152c2){var _0x5cde45=[];if(_0x821a22[_0x6577('0x2')]>0x0){var _0x33a6a9=_[_0x6577('0x3')](_0x821a22,['id']);for(var _0x2fde9c=0x0;_0x2fde9c<_0x33a6a9['length'];_0x2fde9c++){var _0x3372fb=_0x33a6a9[_0x2fde9c];if(_0x3372fb[_0x6577('0x4')]==='string'){_0x5cde45[_0x6577('0x5')](_0x3372fb[_0x6577('0x6')]);}else if(_0x3372fb[_0x6577('0x4')]==='variable'&&_0x3372fb[_0x6577('0x7')]){_0xa22666[_0x3372fb['variableName']]&&_0x5cde45[_0x6577('0x5')](_0xa22666[_0x3372fb[_0x6577('0x7')]][_0x6577('0x8')]());}else if(_0x3372fb[_0x6577('0x4')]===_0x6577('0x9')&&_0x3372fb[_0x6577('0xa')]&&_0x3372fb['Variable'][_0x6577('0xb')]){_0xa22666[_0x3372fb[_0x6577('0xa')][_0x6577('0xb')][_0x6577('0xc')]()]&&_0x5cde45[_0x6577('0x5')](_0xa22666[_0x3372fb[_0x6577('0xa')][_0x6577('0xb')][_0x6577('0xc')]()][_0x6577('0x8')]());}else if(_0x3372fb[_0x6577('0x4')]==='keyValue'){if(_0x3372fb[_0x6577('0xd')]==='string'&&_0x3372fb['key']){_0x5cde45['push'](util[_0x6577('0xe')](_0x6577('0xf'),_0x3372fb[_0x6577('0x10')],_0x3372fb['keyContent']));}else if(_0x3372fb[_0x6577('0xd')]===_0x6577('0x11')&&_0x3372fb[_0x6577('0x7')]&&_0x3372fb['key']){_0xa22666[_0x3372fb[_0x6577('0x7')]]&&_0x5cde45[_0x6577('0x5')](util[_0x6577('0xe')](_0x6577('0xf'),_0x3372fb[_0x6577('0x10')],_0xa22666[_0x3372fb[_0x6577('0x7')]]));}else if(_0x3372fb['keyType']===_0x6577('0x9')&&_0x3372fb[_0x6577('0xa')]&&_0x3372fb['Variable']['name']&&_0x3372fb[_0x6577('0x10')]){_0xa22666[_0x3372fb[_0x6577('0xa')][_0x6577('0xb')][_0x6577('0xc')]()]&&_0x5cde45[_0x6577('0x5')](util[_0x6577('0xe')]('%s:\x20%s',_0x3372fb[_0x6577('0x10')],_0xa22666[_0x3372fb['Variable']['name'][_0x6577('0xc')]()]));}}}}return _0x5cde45[_0x6577('0x12')](_0x1152c2);};exports[_0x6577('0x13')]=function(_0x418b0e){var _0x422535=_0x418b0e[_0x6577('0x14')](-0x1);if(_0x422535==='/'){_0x418b0e=_0x418b0e['substring'](0x0,_0x418b0e['lastIndexOf'](_0x422535));}return _0x418b0e;};exports[_0x6577('0x15')]=function(_0x49e5e1){if(!_[_0x6577('0x16')](_0x49e5e1)&&_0x49e5e1!==''){var _0xa68bd4=/^(([^<>()\[\]\\.,;:\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 _0xa68bd4[_0x6577('0x17')](String(_0x49e5e1)[_0x6577('0xc')]());}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 f73e2f1..1da97ef 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x944a10,_0x2b2df2){var _0x1b0786=function(_0x415577){while(--_0x415577){_0x944a10['push'](_0x944a10['shift']());}};_0x1b0786(++_0x2b2df2);}(_0x34e8,0x12c));var _0x834e=function(_0x1e2c4e,_0x143fa0){_0x1e2c4e=_0x1e2c4e-0x0;var _0x56920a=_0x34e8[_0x1e2c4e];return _0x56920a;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index fc50ff2..ae0366c 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 _0x01b1=['format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s/token:%s','username','token','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','custom_fields','push','content','variable','variableName','idField','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','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','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x01b1,0x65));var _0x101b=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x01b1[_0x460150];return _0x340677;};'use strict';var _=require(_0x101b('0x0'));var rp=require(_0x101b('0x1'));var md5=require(_0x101b('0x2'));var util=require('util');var Redis=require(_0x101b('0x3'));var intUtil=require(_0x101b('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x101b('0x5'));config[_0x101b('0x6')]=_[_0x101b('0x7')](config[_0x101b('0x6')],{'host':_0x101b('0x8'),'port':0x18eb});var io=require(_0x101b('0x9'))(new Redis(config[_0x101b('0x6')]));function emit(_0x118f58,_0x4b611b,_0x1c69b9){io['to'](_0x118f58)[_0x101b('0xa')](_0x4b611b,_0x1c69b9);}var headers={'Content-Type':_0x101b('0xb'),'Accept':_0x101b('0xb')};function getTicket(_0x5e8978,_0x558865,_0x177925,_0x734e0c,_0x2fc473){logger[_0x101b('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x101b('0xd')](_0x101b('0xe'),_0x5e8978[_0x101b('0xf')]),'method':_0x101b('0x10'),'body':{'ticket':_[_0x101b('0x11')]({'requester_id':_0x177925['id'],'submitter_id':_0x558865?_0x558865['id']:undefined,'assignee_id':_0x558865?_0x558865['id']:undefined,'tags':getTags(_0x734e0c['Tags'],_0x101b('0x12')),'subject':intUtil[_0x101b('0x13')](_0x734e0c['Subjects'],_0x2fc473,'\x20'),'description':intUtil[_0x101b('0x13')](_0x734e0c[_0x101b('0x14')],_0x2fc473,'\x0a'),'comment':{'public':![],'body':intUtil[_0x101b('0x13')](_0x734e0c[_0x101b('0x14')],_0x2fc473,'\x0a')}},getCustomFields(_0x734e0c['Fields'],_0x2fc473))}})[_0x101b('0x15')](function(_0x329ae7){logger['info']('Ticket\x20created!');return _0x329ae7[_0x101b('0x16')];});}function getUser(_0x5a7940,_0x212d80){if(intUtil[_0x101b('0x17')](_0x212d80)){logger['info'](_0x101b('0x18'),_0x212d80);return request({'uri':util[_0x101b('0xd')](_0x101b('0x19'),_0x5a7940[_0x101b('0xf')]),'qs':{'query':util[_0x101b('0xd')](_0x101b('0x1a'),_0x212d80)}})[_0x101b('0x15')](function(_0x33ea66){if(_0x33ea66['count']){logger[_0x101b('0xc')](_0x101b('0x1b'));return _[_0x101b('0x1c')](_0x33ea66['results'],{'email':_0x212d80,'role':_0x101b('0x1d')});}else{logger['info'](_0x101b('0x1e'));return request({'uri':util['format'](_0x101b('0x1f'),_0x5a7940[_0x101b('0xf')])})[_0x101b('0x15')](function(_0x5ebeda){logger[_0x101b('0xc')]('Admin\x20account\x20selected.');return _0x5ebeda['user'];});}});}else{logger[_0x101b('0xc')](_0x101b('0x1e'));return request({'uri':util['format'](_0x101b('0x1f'),_0x5a7940['remoteUri'])})['then'](function(_0x3c4e17){logger[_0x101b('0xc')](_0x101b('0x20'));return _0x3c4e17[_0x101b('0x21')];});}}function getEndUser(_0x39d136,_0x59803b,_0x102c52){logger[_0x101b('0xc')](_0x101b('0x22'),_0x102c52);return request({'uri':util[_0x101b('0xd')](_0x101b('0x19'),_0x39d136[_0x101b('0xf')]),'qs':{'query':util['format'](_0x101b('0x23'),_0x102c52)}})[_0x101b('0x15')](function(_0x3e8af7){var _0x28ac29;if(_0x3e8af7[_0x101b('0x24')][_0x101b('0x25')]){_0x3e8af7['results']=_[_0x101b('0x26')](_0x3e8af7[_0x101b('0x24')],{'suspended':![],'role':_0x101b('0x27')});if(_0x3e8af7[_0x101b('0x24')][_0x101b('0x25')]){_0x28ac29=_[_0x101b('0x28')](_0x3e8af7[_0x101b('0x24')]);}}if(_0x28ac29){logger[_0x101b('0xc')](_0x101b('0x29'));return _0x28ac29;}else{logger['info'](_0x101b('0x2a'));return request({'uri':util['format'](_0x101b('0x2b'),_0x39d136['remoteUri']),'method':_0x101b('0x10'),'body':{'user':{'role':_0x101b('0x27'),'name':util[_0x101b('0xd')](_0x101b('0x2c'),_0x59803b||_0x102c52),'phone':_0x102c52}}})['then'](function(_0x16fe8a){logger['info'](_0x101b('0x2d'));return _0x16fe8a[_0x101b('0x21')];});}});}function getAuth(_0x553b43){var _0xc2fe2a;if(_0x553b43[_0x101b('0x2e')]===_0x101b('0x2f')){_0xc2fe2a=util['format']('%s:%s',_0x553b43['username'],_0x553b43[_0x101b('0x2f')]);}else if(_0x553b43['authType']==='token'){_0xc2fe2a=util[_0x101b('0xd')](_0x101b('0x30'),_0x553b43[_0x101b('0x31')],_0x553b43[_0x101b('0x32')]);}return util[_0x101b('0xd')]('Basic\x20%s',new Buffer(_0xc2fe2a)[_0x101b('0x33')](_0x101b('0x34')));}function request(_0x3faaca){logger[_0x101b('0x35')](_0x101b('0x36'),JSON[_0x101b('0x37')](_0x3faaca));return rp(_[_0x101b('0x7')](_0x3faaca,{'method':_0x101b('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x31cd92,_0x462cdb){var _0x3e9a6a=[];if(_0x31cd92&&_0x31cd92[_0x101b('0x25')]>0x0){_0x3e9a6a=_['map'](_0x31cd92,_0x462cdb);}return _0x3e9a6a;}function getCustomFields(_0x53b106,_0x50b67f){var _0x2bad27=[];var _0x4ecfef={'custom_fields':[]};if(_0x53b106[_0x101b('0x25')]>0x0){_[_0x101b('0x39')](_0x53b106,function(_0xbb7e0f){if(_[_0x101b('0x3a')]([_0x101b('0x3b'),_0x101b('0x3c')],_0xbb7e0f[_0x101b('0x3d')])&&_0xbb7e0f[_0x101b('0x3e')]&&!_0xbb7e0f[_0x101b('0x3f')]){_0x4ecfef[_0xbb7e0f[_0x101b('0x3e')][_0x101b('0x40')]()]=_0xbb7e0f['content'][_0x101b('0x33')]();}else if(_[_0x101b('0x3a')]([_0x101b('0x3b'),_0x101b('0x3c')],_0xbb7e0f[_0x101b('0x3d')])&&_0xbb7e0f['idField']&&_0xbb7e0f[_0x101b('0x3f')]){_0x4ecfef[_0x101b('0x41')][_0x101b('0x42')]({'id':_0xbb7e0f['idField'],'value':_0xbb7e0f[_0x101b('0x43')][_0x101b('0x33')]()});}else if(_0xbb7e0f[_0x101b('0x3d')]===_0x101b('0x44')&&_0xbb7e0f[_0x101b('0x45')]&&_0xbb7e0f['idField']&&_0xbb7e0f[_0x101b('0x3f')]){_0x50b67f[_0xbb7e0f[_0x101b('0x45')]]&&_0x4ecfef[_0x101b('0x41')][_0x101b('0x42')]({'id':_0xbb7e0f[_0x101b('0x46')],'value':_0x50b67f[_0xbb7e0f[_0x101b('0x45')]]['toString']()});}else if(_0xbb7e0f['type']===_0x101b('0x47')&&_0xbb7e0f[_0x101b('0x48')]&&_0xbb7e0f['Variable'][_0x101b('0x12')]&&_0xbb7e0f[_0x101b('0x46')]&&_0xbb7e0f[_0x101b('0x3f')]){_0x50b67f[_0xbb7e0f[_0x101b('0x48')][_0x101b('0x12')][_0x101b('0x40')]()]&&_0x4ecfef[_0x101b('0x41')][_0x101b('0x42')]({'id':_0xbb7e0f[_0x101b('0x46')],'value':_0x50b67f[_0xbb7e0f[_0x101b('0x48')][_0x101b('0x12')][_0x101b('0x40')]()][_0x101b('0x33')]()});}});}return _0x4ecfef;}exports[_0x101b('0x49')]=function(_0x14c453,_0x32aafc,_0x1b5b8,_0x2f6c2d,_0x5e1919,_0x213f51){var _0x4c3b4e,_0x3d9f64;_0x213f51[_0x101b('0xf')]=intUtil[_0x101b('0x4a')](_0x213f51['remoteUri']);_0x213f51[_0x101b('0x4b')]=intUtil[_0x101b('0x4a')](_0x213f51[_0x101b('0x4b')]);if(_0x5e1919&&_0x5e1919[_0x101b('0x4c')]){logger[_0x101b('0xc')]('[QUEUE]',_0x101b('0x4d'));_0x32aafc['recordingURL']=util['format'](_0x101b('0x4e'),_0x213f51[_0x101b('0x4b')],_0x32aafc[_0x101b('0x4f')],md5(_0x32aafc[_0x101b('0x4f')]));}else{_0x32aafc[_0x101b('0x50')]='';}headers[_0x101b('0x51')]=getAuth(_0x213f51);return getUser(_0x213f51,_0x2f6c2d[_0x101b('0x52')])[_0x101b('0x15')](function(_0x4b1430){_0x4c3b4e=_0x4b1430;logger[_0x101b('0xc')](_0x101b('0x53'),_0x4c3b4e['id']);return getEndUser(_0x213f51,_0x32aafc['calleridname'],_0x32aafc[_0x101b('0x54')]);})[_0x101b('0x15')](function(_0xf54786){_0x3d9f64=_0xf54786;logger[_0x101b('0xc')](_0x101b('0x55'),_0x3d9f64['id']);return getTicket(_0x213f51,_0x4c3b4e,_0x3d9f64,_0x1b5b8,_0x32aafc);})[_0x101b('0x15')](function(_0xe495ee){if(_0xe495ee){logger['info'](_0x101b('0x56'),_0xe495ee['id']);switch(_0x213f51[_0x101b('0x3d')]){case _0x101b('0x57'):logger['info']('[QUEUE]',_0x101b('0x58'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x213f51[_0x101b('0xf')],_0x4c3b4e['id'],_0xe495ee['id']),'method':_0x101b('0x10')});case _0x101b('0x59'):logger[_0x101b('0xc')](_0x101b('0x5a'),_0x101b('0x5b'));emit(util['format']('user:%s',_0x2f6c2d[_0x101b('0x12')]),_0x101b('0x5c'),{'uri':util['format'](_0x101b('0x5d'),_0x213f51[_0x101b('0xf')][_0x101b('0x5e')](_0x101b('0x5f'),''),_0xe495ee['id'])});break;default:logger['error'](_0x101b('0x5a'),_0x101b('0x60'));}}})[_0x101b('0x61')](function(_0x43a2c2){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x101b('0x62')](_0x43a2c2,{'showHidden':!![],'depth':null}));});};exports[_0x101b('0x63')]=function(_0x15d183,_0x1a4d50,_0x5dc050,_0x19bf5e,_0x1b62fb,_0x5170cc,_0x3a414b){var _0x4e97eb,_0x5409a5;_0x5170cc[_0x101b('0xf')]=intUtil[_0x101b('0x4a')](_0x5170cc[_0x101b('0xf')]);_0x5170cc[_0x101b('0x4b')]=intUtil[_0x101b('0x4a')](_0x5170cc['serverUrl']);if(_0x3a414b&&_0x3a414b['recordingFormat']&&_0x3a414b[_0x101b('0x64')]!==_0x101b('0x65')){logger[_0x101b('0xc')](_0x101b('0x66'),_0x101b('0x4d'));_0x1a4d50[_0x101b('0x50')]=util[_0x101b('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5170cc[_0x101b('0x4b')],_0x1a4d50[_0x101b('0x4f')],md5(_0x1a4d50[_0x101b('0x4f')]));}headers[_0x101b('0x51')]=getAuth(_0x5170cc);return getUser(_0x5170cc,_0x19bf5e['email'])[_0x101b('0x15')](function(_0x1ae21f){_0x4e97eb=_0x1ae21f;logger['info'](_0x101b('0x53'),_0x4e97eb['id']);return getEndUser(_0x5170cc,_0x1a4d50[_0x101b('0x67')],_0x1a4d50[_0x101b('0x68')]);})[_0x101b('0x15')](function(_0x5a3d87){_0x5409a5=_0x5a3d87;logger[_0x101b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x5409a5['id']);return getTicket(_0x5170cc,_0x4e97eb,_0x5409a5,_0x5dc050,_0x1a4d50);})[_0x101b('0x15')](function(_0x50ce4c){if(_0x50ce4c){logger[_0x101b('0xc')](_0x101b('0x56'),_0x50ce4c['id']);switch(_0x5170cc['type']){case _0x101b('0x57'):logger[_0x101b('0xc')](_0x101b('0x66'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x101b('0xd')](_0x101b('0x69'),_0x5170cc[_0x101b('0xf')],_0x4e97eb['id'],_0x50ce4c['id']),'method':_0x101b('0x10')});case'newTab':logger[_0x101b('0xc')](_0x101b('0x66'),_0x101b('0x5b'));emit(util['format'](_0x101b('0x6a'),_0x19bf5e[_0x101b('0x12')]),_0x101b('0x5c'),{'uri':util[_0x101b('0xd')](_0x101b('0x5d'),_0x5170cc[_0x101b('0xf')][_0x101b('0x5e')]('/api/v2',''),_0x50ce4c['id'])});break;default:logger[_0x101b('0x6b')](_0x101b('0x66'),_0x101b('0x60'));}}})[_0x101b('0x61')](function(_0x2722ec){logger['error'](_0x101b('0x6c'),util[_0x101b('0x62')](_0x2722ec,{'showHidden':!![],'depth':null}));});};exports[_0x101b('0x6d')]=function(_0x404ea2,_0x2ba257,_0x35abb2,_0x1e4a31,_0x26b287,_0x1ad0b6){var _0x41e67e,_0xa0b906;_0x1ad0b6['remoteUri']=intUtil[_0x101b('0x4a')](_0x1ad0b6['remoteUri']);_0x1ad0b6[_0x101b('0x4b')]=intUtil[_0x101b('0x4a')](_0x1ad0b6[_0x101b('0x4b')]);if(_0x26b287&&_0x26b287['monitor_format']){logger['info']('['+_0x2ba257[_0x101b('0x6e')][_0x101b('0x6f')]()+']',_0x101b('0x4d'));_0x2ba257['recordingURL']=util['format'](_0x101b('0x4e'),_0x1ad0b6[_0x101b('0x4b')],_0x2ba257['uniqueid'],md5(_0x2ba257[_0x101b('0x4f')]));}else{_0x2ba257[_0x101b('0x50')]='';}headers[_0x101b('0x51')]=getAuth(_0x1ad0b6);return getUser(_0x1ad0b6)[_0x101b('0x15')](function(_0x3fc174){_0x41e67e=_0x3fc174;logger['info'](_0x101b('0x53'),_0x41e67e['id']);return getEndUser(_0x1ad0b6,_0x2ba257[_0x101b('0x70')],_0x2ba257['calleridnum']);})[_0x101b('0x15')](function(_0x4fa9f0){_0xa0b906=_0x4fa9f0;logger['info'](_0x101b('0x55'),_0xa0b906['id']);return getTicket(_0x1ad0b6,_0x41e67e,_0xa0b906,_0x35abb2,_0x2ba257);})[_0x101b('0x15')](function(_0x2805b1){if(_0x2805b1){logger[_0x101b('0xc')](_0x101b('0x56'),_0x2805b1['id']);}})[_0x101b('0x61')](function(_0x2ebd60){logger[_0x101b('0x6b')]('['+_0x2ba257[_0x101b('0x6e')][_0x101b('0x6f')]()+']'+_0x101b('0x71'),util[_0x101b('0x62')](_0x2ebd60,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdf39=['info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','user','authType','%s:%s','username','password','token','toString','base64','debug','[HTTP]','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','email','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','[OUTBOUND]','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json'];(function(_0x18f1c6,_0x1357d6){var _0x4d09c0=function(_0x5bb1f7){while(--_0x5bb1f7){_0x18f1c6['push'](_0x18f1c6['shift']());}};_0x4d09c0(++_0x1357d6);}(_0xdf39,0x143));var _0x9df3=function(_0x4d03a5,_0x3355b1){_0x4d03a5=_0x4d03a5-0x0;var _0x5521f3=_0xdf39[_0x4d03a5];return _0x5521f3;};'use strict';var _=require(_0x9df3('0x0'));var rp=require(_0x9df3('0x1'));var md5=require(_0x9df3('0x2'));var util=require(_0x9df3('0x3'));var Redis=require('ioredis');var intUtil=require(_0x9df3('0x4'));var config=require(_0x9df3('0x5'));var logger=require(_0x9df3('0x6'))('zendesk');config['redis']=_[_0x9df3('0x7')](config[_0x9df3('0x8')],{'host':_0x9df3('0x9'),'port':0x18eb});var io=require(_0x9df3('0xa'))(new Redis(config['redis']));function emit(_0xedcfc1,_0x2b803e,_0x8334e9){io['to'](_0xedcfc1)[_0x9df3('0xb')](_0x2b803e,_0x8334e9);}var headers={'Content-Type':_0x9df3('0xc'),'Accept':_0x9df3('0xc')};function getTicket(_0x1975f9,_0x2ac862,_0x14c9c1,_0x19cf73,_0x56ed91){logger[_0x9df3('0xd')](_0x9df3('0xe'));return request({'uri':util['format'](_0x9df3('0xf'),_0x1975f9[_0x9df3('0x10')]),'method':_0x9df3('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x14c9c1['id'],'submitter_id':_0x2ac862?_0x2ac862['id']:undefined,'assignee_id':_0x2ac862?_0x2ac862['id']:undefined,'tags':getTags(_0x19cf73[_0x9df3('0x12')],_0x9df3('0x13')),'subject':intUtil[_0x9df3('0x14')](_0x19cf73[_0x9df3('0x15')],_0x56ed91,'\x20'),'description':intUtil[_0x9df3('0x14')](_0x19cf73[_0x9df3('0x16')],_0x56ed91,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9df3('0x14')](_0x19cf73[_0x9df3('0x16')],_0x56ed91,'\x0a')}},getCustomFields(_0x19cf73['Fields'],_0x56ed91))}})['then'](function(_0x380692){logger['info'](_0x9df3('0x17'));return _0x380692[_0x9df3('0x18')];});}function getUser(_0x559414,_0x5a6dd1){if(intUtil[_0x9df3('0x19')](_0x5a6dd1)){logger['info'](_0x9df3('0x1a'),_0x5a6dd1);return request({'uri':util[_0x9df3('0x1b')]('%s/search.json',_0x559414[_0x9df3('0x10')]),'qs':{'query':util[_0x9df3('0x1b')]('type:user\x20role:agent\x20email:%s',_0x5a6dd1)}})[_0x9df3('0x1c')](function(_0x4d008a){if(_0x4d008a[_0x9df3('0x1d')]){logger[_0x9df3('0xd')](_0x9df3('0x1e'));return _[_0x9df3('0x1f')](_0x4d008a[_0x9df3('0x20')],{'email':_0x5a6dd1,'role':_0x9df3('0x21')});}else{logger[_0x9df3('0xd')](_0x9df3('0x22'));return request({'uri':util[_0x9df3('0x1b')](_0x9df3('0x23'),_0x559414[_0x9df3('0x10')])})[_0x9df3('0x1c')](function(_0x594c11){logger[_0x9df3('0xd')](_0x9df3('0x24'));return _0x594c11['user'];});}});}else{logger[_0x9df3('0xd')](_0x9df3('0x22'));return request({'uri':util[_0x9df3('0x1b')](_0x9df3('0x23'),_0x559414[_0x9df3('0x10')])})[_0x9df3('0x1c')](function(_0xc30c28){logger[_0x9df3('0xd')](_0x9df3('0x24'));return _0xc30c28['user'];});}}function getEndUser(_0x422f64,_0x580208,_0x598e8b){logger[_0x9df3('0xd')](_0x9df3('0x25'),_0x598e8b);return request({'uri':util[_0x9df3('0x1b')](_0x9df3('0x26'),_0x422f64['remoteUri']),'qs':{'query':util['format'](_0x9df3('0x27'),_0x598e8b)}})[_0x9df3('0x1c')](function(_0x246317){var _0x35852b;if(_0x246317[_0x9df3('0x20')][_0x9df3('0x28')]){_0x246317['results']=_[_0x9df3('0x29')](_0x246317[_0x9df3('0x20')],{'suspended':![],'role':_0x9df3('0x2a')});if(_0x246317[_0x9df3('0x20')][_0x9df3('0x28')]){_0x35852b=_[_0x9df3('0x2b')](_0x246317[_0x9df3('0x20')]);}}if(_0x35852b){logger[_0x9df3('0xd')](_0x9df3('0x2c'));return _0x35852b;}else{logger[_0x9df3('0xd')](_0x9df3('0x2d'));return request({'uri':util['format'](_0x9df3('0x2e'),_0x422f64[_0x9df3('0x10')]),'method':'POST','body':{'user':{'role':_0x9df3('0x2a'),'name':util[_0x9df3('0x1b')](_0x9df3('0x2f'),_0x580208||_0x598e8b),'phone':_0x598e8b}}})[_0x9df3('0x1c')](function(_0x3e94dc){logger[_0x9df3('0xd')]('Enduser\x20created.');return _0x3e94dc[_0x9df3('0x30')];});}});}function getAuth(_0x517296){var _0x1fc3a7;if(_0x517296[_0x9df3('0x31')]==='password'){_0x1fc3a7=util[_0x9df3('0x1b')](_0x9df3('0x32'),_0x517296[_0x9df3('0x33')],_0x517296[_0x9df3('0x34')]);}else if(_0x517296['authType']===_0x9df3('0x35')){_0x1fc3a7=util[_0x9df3('0x1b')]('%s/token:%s',_0x517296[_0x9df3('0x33')],_0x517296[_0x9df3('0x35')]);}return util[_0x9df3('0x1b')]('Basic\x20%s',new Buffer(_0x1fc3a7)[_0x9df3('0x36')](_0x9df3('0x37')));}function request(_0x4c0f95){logger[_0x9df3('0x38')](_0x9df3('0x39'),JSON['stringify'](_0x4c0f95));return rp(_[_0x9df3('0x7')](_0x4c0f95,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5c8ad7,_0x45ae52){var _0x903a1d=[];if(_0x5c8ad7&&_0x5c8ad7[_0x9df3('0x28')]>0x0){_0x903a1d=_['map'](_0x5c8ad7,_0x45ae52);}return _0x903a1d;}function getCustomFields(_0x375286,_0x3292b5){var _0x287e80=[];var _0x3dd4eb={'custom_fields':[]};if(_0x375286['length']>0x0){_[_0x9df3('0x3a')](_0x375286,function(_0x24a65c){if(_[_0x9df3('0x3b')]([_0x9df3('0x3c'),_0x9df3('0x3d')],_0x24a65c[_0x9df3('0x3e')])&&_0x24a65c[_0x9df3('0x3f')]&&!_0x24a65c['customField']){_0x3dd4eb[_0x24a65c[_0x9df3('0x3f')][_0x9df3('0x40')]()]=_0x24a65c[_0x9df3('0x41')][_0x9df3('0x36')]();}else if(_[_0x9df3('0x3b')](['string','picklist'],_0x24a65c[_0x9df3('0x3e')])&&_0x24a65c[_0x9df3('0x42')]&&_0x24a65c[_0x9df3('0x43')]){_0x3dd4eb[_0x9df3('0x44')]['push']({'id':_0x24a65c['idField'],'value':_0x24a65c[_0x9df3('0x41')][_0x9df3('0x36')]()});}else if(_0x24a65c['type']===_0x9df3('0x45')&&_0x24a65c[_0x9df3('0x46')]&&_0x24a65c['idField']&&_0x24a65c[_0x9df3('0x43')]){_0x3292b5[_0x24a65c[_0x9df3('0x46')]]&&_0x3dd4eb[_0x9df3('0x44')][_0x9df3('0x47')]({'id':_0x24a65c[_0x9df3('0x42')],'value':_0x3292b5[_0x24a65c[_0x9df3('0x46')]][_0x9df3('0x36')]()});}else if(_0x24a65c[_0x9df3('0x3e')]===_0x9df3('0x48')&&_0x24a65c[_0x9df3('0x49')]&&_0x24a65c[_0x9df3('0x49')][_0x9df3('0x13')]&&_0x24a65c['idField']&&_0x24a65c[_0x9df3('0x43')]){_0x3292b5[_0x24a65c[_0x9df3('0x49')][_0x9df3('0x13')][_0x9df3('0x40')]()]&&_0x3dd4eb['custom_fields']['push']({'id':_0x24a65c[_0x9df3('0x42')],'value':_0x3292b5[_0x24a65c[_0x9df3('0x49')][_0x9df3('0x13')][_0x9df3('0x40')]()][_0x9df3('0x36')]()});}});}return _0x3dd4eb;}exports[_0x9df3('0x4a')]=function(_0x40fc99,_0xcf2738,_0x5834bc,_0x556e92,_0xa58952,_0xa4ceaa){var _0x5a3016,_0x2eec6d;_0xa4ceaa[_0x9df3('0x10')]=intUtil[_0x9df3('0x4b')](_0xa4ceaa['remoteUri']);_0xa4ceaa[_0x9df3('0x4c')]=intUtil[_0x9df3('0x4b')](_0xa4ceaa[_0x9df3('0x4c')]);if(_0xa58952&&_0xa58952[_0x9df3('0x4d')]){logger[_0x9df3('0xd')]('[QUEUE]',_0x9df3('0x4e'));_0xcf2738[_0x9df3('0x4f')]=util[_0x9df3('0x1b')](_0x9df3('0x50'),_0xa4ceaa['serverUrl'],_0xcf2738[_0x9df3('0x51')],md5(_0xcf2738[_0x9df3('0x51')]));}else{_0xcf2738[_0x9df3('0x4f')]='';}headers[_0x9df3('0x52')]=getAuth(_0xa4ceaa);return getUser(_0xa4ceaa,_0x556e92['email'])['then'](function(_0x2a8ffb){_0x5a3016=_0x2a8ffb;logger[_0x9df3('0xd')](_0x9df3('0x53'),_0x5a3016['id']);return getEndUser(_0xa4ceaa,_0xcf2738[_0x9df3('0x54')],_0xcf2738[_0x9df3('0x55')]);})['then'](function(_0x50c77e){_0x2eec6d=_0x50c77e;logger[_0x9df3('0xd')](_0x9df3('0x56'),_0x2eec6d['id']);return getTicket(_0xa4ceaa,_0x5a3016,_0x2eec6d,_0x5834bc,_0xcf2738);})[_0x9df3('0x1c')](function(_0x21be88){if(_0x21be88){logger[_0x9df3('0xd')](_0x9df3('0x57'),_0x21be88['id']);switch(_0xa4ceaa[_0x9df3('0x3e')]){case _0x9df3('0x58'):logger[_0x9df3('0xd')](_0x9df3('0x59'),_0x9df3('0x5a'));return request({'uri':util[_0x9df3('0x1b')](_0x9df3('0x5b'),_0xa4ceaa[_0x9df3('0x10')],_0x5a3016['id'],_0x21be88['id']),'method':_0x9df3('0x11')});case _0x9df3('0x5c'):logger[_0x9df3('0xd')](_0x9df3('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9df3('0x1b')](_0x9df3('0x5d'),_0x556e92['name']),'trigger:browser:url',{'uri':util[_0x9df3('0x1b')](_0x9df3('0x5e'),_0xa4ceaa[_0x9df3('0x10')][_0x9df3('0x5f')](_0x9df3('0x60'),''),_0x21be88['id'])});break;default:logger[_0x9df3('0x61')](_0x9df3('0x59'),_0x9df3('0x62'));}}})['catch'](function(_0x8d7af){logger['error'](_0x9df3('0x63'),util[_0x9df3('0x64')](_0x8d7af,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3f755a,_0x200b1b,_0x570672,_0x25ccf1,_0x5eab02,_0x49dc58,_0x538281){var _0x7924d8,_0x4bce11;_0x49dc58[_0x9df3('0x10')]=intUtil[_0x9df3('0x4b')](_0x49dc58[_0x9df3('0x10')]);_0x49dc58['serverUrl']=intUtil[_0x9df3('0x4b')](_0x49dc58[_0x9df3('0x4c')]);if(_0x538281&&_0x538281[_0x9df3('0x65')]&&_0x538281[_0x9df3('0x65')]!=='none'){logger[_0x9df3('0xd')]('[OUTBOUND]',_0x9df3('0x4e'));_0x200b1b['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49dc58[_0x9df3('0x4c')],_0x200b1b[_0x9df3('0x51')],md5(_0x200b1b[_0x9df3('0x51')]));}headers[_0x9df3('0x52')]=getAuth(_0x49dc58);return getUser(_0x49dc58,_0x25ccf1[_0x9df3('0x66')])[_0x9df3('0x1c')](function(_0x2bc6f8){_0x7924d8=_0x2bc6f8;logger[_0x9df3('0xd')]('The\x20User\x20ID\x20is:',_0x7924d8['id']);return getEndUser(_0x49dc58,_0x200b1b['destcalleridname'],_0x200b1b['destcalleridnum']);})['then'](function(_0x1446e1){_0x4bce11=_0x1446e1;logger[_0x9df3('0xd')](_0x9df3('0x56'),_0x4bce11['id']);return getTicket(_0x49dc58,_0x7924d8,_0x4bce11,_0x570672,_0x200b1b);})[_0x9df3('0x1c')](function(_0x289eb5){if(_0x289eb5){logger[_0x9df3('0xd')]('The\x20Ticket\x20ID\x20is:',_0x289eb5['id']);switch(_0x49dc58['type']){case'integrationTab':logger['info']('[OUTBOUND]',_0x9df3('0x5a'));return request({'uri':util[_0x9df3('0x1b')](_0x9df3('0x5b'),_0x49dc58[_0x9df3('0x10')],_0x7924d8['id'],_0x289eb5['id']),'method':'POST'});case'newTab':logger[_0x9df3('0xd')]('[OUTBOUND]',_0x9df3('0x67'));emit(util[_0x9df3('0x1b')]('user:%s',_0x25ccf1['name']),_0x9df3('0x68'),{'uri':util['format'](_0x9df3('0x5e'),_0x49dc58[_0x9df3('0x10')]['replace'](_0x9df3('0x60'),''),_0x289eb5['id'])});break;default:logger[_0x9df3('0x61')](_0x9df3('0x69'),_0x9df3('0x62'));}}})[_0x9df3('0x6a')](function(_0x653877){logger['error'](_0x9df3('0x6b'),util['inspect'](_0x653877,{'showHidden':!![],'depth':null}));});};exports[_0x9df3('0x6c')]=function(_0x184a30,_0x433222,_0x1dcade,_0x2e5246,_0x16f839,_0x493445){var _0x424c61,_0xf09f5a;_0x493445[_0x9df3('0x10')]=intUtil[_0x9df3('0x4b')](_0x493445[_0x9df3('0x10')]);_0x493445[_0x9df3('0x4c')]=intUtil[_0x9df3('0x4b')](_0x493445[_0x9df3('0x4c')]);if(_0x16f839&&_0x16f839[_0x9df3('0x4d')]){logger[_0x9df3('0xd')]('['+_0x433222[_0x9df3('0x6d')][_0x9df3('0x6e')]()+']',_0x9df3('0x4e'));_0x433222['recordingURL']=util[_0x9df3('0x1b')](_0x9df3('0x50'),_0x493445[_0x9df3('0x4c')],_0x433222[_0x9df3('0x51')],md5(_0x433222['uniqueid']));}else{_0x433222[_0x9df3('0x4f')]='';}headers[_0x9df3('0x52')]=getAuth(_0x493445);return getUser(_0x493445)[_0x9df3('0x1c')](function(_0x410e90){_0x424c61=_0x410e90;logger[_0x9df3('0xd')](_0x9df3('0x53'),_0x424c61['id']);return getEndUser(_0x493445,_0x433222[_0x9df3('0x54')],_0x433222[_0x9df3('0x55')]);})[_0x9df3('0x1c')](function(_0x599e7e){_0xf09f5a=_0x599e7e;logger[_0x9df3('0xd')]('The\x20Enduser\x20ID\x20is:',_0xf09f5a['id']);return getTicket(_0x493445,_0x424c61,_0xf09f5a,_0x1dcade,_0x433222);})[_0x9df3('0x1c')](function(_0x370c1d){if(_0x370c1d){logger[_0x9df3('0xd')](_0x9df3('0x57'),_0x370c1d['id']);}})[_0x9df3('0x6a')](function(_0x31a811){logger[_0x9df3('0x61')]('['+_0x433222['lastevent'][_0x9df3('0x6e')]()+']'+_0x9df3('0x6f'),util['inspect'](_0x31a811,{'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 7fec19b..a9e922f 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 _0xa047=['https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','uri','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','talktime','Call_Duration','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','user:%s','trigger:browser:url','toUpperCase','/downloads?type=uniqueid&token=','com','lodash','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','[HTTP]','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com'];(function(_0x29d129,_0x5ba87){var _0x40a927=function(_0x738bb8){while(--_0x738bb8){_0x29d129['push'](_0x29d129['shift']());}};_0x40a927(++_0x5ba87);}(_0xa047,0x1c5));var _0x7a04=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xa047[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x7a04('0x0'));var rp=require(_0x7a04('0x1'));var md5=require(_0x7a04('0x2'));var util=require(_0x7a04('0x3'));var intUtil=require('./util');var moment=require(_0x7a04('0x4'));var Redis=require('ioredis');var BPromise=require(_0x7a04('0x5'));var config=require(_0x7a04('0x6'));var logger=require(_0x7a04('0x7'))(_0x7a04('0x8'));config[_0x7a04('0x9')]=_['defaults'](config[_0x7a04('0x9')],{'host':_0x7a04('0xa'),'port':0x18eb});var io=require(_0x7a04('0xb'))(new Redis(config['redis']));function emit(_0x10d92f,_0x10faf9,_0x500da7){io['to'](_0x10d92f)[_0x7a04('0xc')](_0x10faf9,_0x500da7);}function request(_0xc64317){logger['debug'](_0x7a04('0xd'),JSON['stringify'](_0xc64317));return rp(_0xc64317);}function getCustomFields(_0x545716,_0x24b4d7){var _0x35b8aa={};if(_0x545716['length']>0x0){_['forEach'](_0x545716,function(_0x4a90b2){if(_[_0x7a04('0xe')]([_0x7a04('0xf'),_0x7a04('0x10')],_0x4a90b2[_0x7a04('0x11')])&&_0x4a90b2[_0x7a04('0x12')]){_0x35b8aa[_0x4a90b2[_0x7a04('0x12')]]=_0x4a90b2[_0x7a04('0x13')][_0x7a04('0x14')]();}else if(_0x4a90b2[_0x7a04('0x11')]==='variable'&&_0x4a90b2[_0x7a04('0x15')]&&_0x4a90b2[_0x7a04('0x12')]&&_0x24b4d7[_0x4a90b2[_0x7a04('0x15')]]){_0x35b8aa[_0x4a90b2[_0x7a04('0x12')]]=_0x24b4d7[_0x4a90b2[_0x7a04('0x15')]][_0x7a04('0x14')]();}else if(_0x4a90b2['type']===_0x7a04('0x16')&&_0x4a90b2[_0x7a04('0x17')]&&_0x4a90b2[_0x7a04('0x17')]['name']&&_0x4a90b2['idField']&&_0x24b4d7[_0x4a90b2[_0x7a04('0x17')][_0x7a04('0x18')][_0x7a04('0x19')]()]){_0x35b8aa[_0x4a90b2['idField']]=_0x24b4d7[_0x4a90b2[_0x7a04('0x17')][_0x7a04('0x18')]['toLowerCase']()][_0x7a04('0x14')]();}});}return _0x35b8aa;}function getName(_0x5a5bf5){if(_0x5a5bf5[_0x7a04('0x1a')]('\x20')>0x0){var _0x5205f1=_0x5a5bf5[_0x7a04('0x1b')](/ (.+)/);if(_0x5205f1[0x1]){return _0x5205f1;}}return[_0x5a5bf5,_0x5a5bf5];}var accountsTokens={};function getAccessToken(_0x10c327){return new Promise(function(_0x51b13b,_0x37494a){if(!_[_0x7a04('0x1c')](accountsTokens[_0x10c327['id']])&&!_['isNil'](accountsTokens[_0x10c327['id']][_0x7a04('0x1d')])){if(moment()[_0x7a04('0x1e')](accountsTokens[_0x10c327['id']]['expires_in'])){_0x51b13b(accountsTokens[_0x10c327['id']][_0x7a04('0x1d')]);}}var _0x130bc9;switch(_0x10c327[_0x7a04('0x1f')]){case'US':_0x130bc9=_0x7a04('0x20');break;case'AU':_0x130bc9=_0x7a04('0x21');break;case'EU':_0x130bc9=_0x7a04('0x22');break;case'IN':_0x130bc9=_0x7a04('0x23');break;case'CN':_0x130bc9=_0x7a04('0x24');break;default:_0x130bc9='https://accounts.zoho.eu';break;}var _0x166e0b={'method':'POST','uri':_0x130bc9+_0x7a04('0x25'),'qs':{'refresh_token':_0x10c327[_0x7a04('0x26')],'client_id':_0x10c327[_0x7a04('0x27')],'client_secret':_0x10c327[_0x7a04('0x28')],'grant_type':_0x7a04('0x29')},'json':!![]};return rp(_0x166e0b)[_0x7a04('0x2a')](function(_0x3743b3){accountsTokens[_0x10c327['id']]={'access_token':_0x3743b3[_0x7a04('0x1d')],'expires_in':moment()[_0x7a04('0x2b')](_0x3743b3[_0x7a04('0x2c')],_0x7a04('0x2d'))};_0x51b13b(_0x3743b3['access_token']);})[_0x7a04('0x2e')](function(_0x49cd48){logger[_0x7a04('0x2f')](_0x7a04('0x30'),_0x49cd48[_0x7a04('0x31')]);_0x37494a(_0x49cd48);});});}function getUser(_0x3a9d10,_0x99b61d,_0x22a8e6,_0x4ce6f2){logger[_0x7a04('0x32')]('Search\x20user');return request({'method':_0x7a04('0x33'),'uri':util[_0x7a04('0x34')]('https://www.zohoapis.%s/crm/v2/users',_0x99b61d),'qs':{'type':_0x7a04('0x35')},'headers':{'Authorization':_0x7a04('0x36')+_0x3a9d10},'json':!![]})['then'](function(_0x5d0b4e){if(_0x5d0b4e[_0x7a04('0x37')]){var _0x2891b0=-0x1;if(_[_0x7a04('0x38')](_0x5d0b4e[_0x7a04('0x37')])){if(!_[_0x7a04('0x1c')](_0x4ce6f2)){_0x2891b0=_[_0x7a04('0x39')](_0x5d0b4e[_0x7a04('0x37')],function(_0x16d995){return _0x16d995['email']===_0x4ce6f2;});}if(_0x2891b0>=0x0){logger[_0x7a04('0x32')](_0x7a04('0x3a'));}else{logger['info'](_0x7a04('0x3b'));_0x2891b0=_[_0x7a04('0x39')](_0x5d0b4e[_0x7a04('0x37')],function(_0x82af27){return _0x82af27[_0x7a04('0x3c')][_0x7a04('0x18')]===_0x7a04('0x3d');});}return _0x5d0b4e['users'][_0x2891b0];}else{if(_0x5d0b4e[_0x7a04('0x3e')][_0x7a04('0x3c')]['name']==='Administrator'){logger[_0x7a04('0x32')]('Using\x20the\x20admin\x20account!');user=_0x5d0b4e[_0x7a04('0x3e')];return user;}else{logger['error'](_0x7a04('0x3f'),JSON[_0x7a04('0x40')](_0x5d0b4e));throw new Error(_0x7a04('0x41')+JSON[_0x7a04('0x40')](_0x5d0b4e));}}}else{logger[_0x7a04('0x2f')](_0x7a04('0x3f'),JSON[_0x7a04('0x40')](_0x5d0b4e));throw new Error(_0x7a04('0x41')+JSON[_0x7a04('0x40')](_0x5d0b4e));}})['catch'](function(_0x54bca9){console['error'](_0x54bca9);});}function getZohoUser(_0x5dd834,_0x37b7bd){return new BPromise(function(_0x564890,_0x2103fb){request(_0x5dd834)[_0x7a04('0x2a')](function(_0x19f7ec){var _0x38cf7d=null;if(_0x19f7ec){_0x38cf7d=_0x19f7ec[_0x7a04('0x42')][0x0];_0x38cf7d[_0x7a04('0x43')]=_0x37b7bd;}_0x564890(_0x38cf7d);})[_0x7a04('0x2e')](function(_0x4e7713){_0x2103fb(_0x4e7713);});});}function createEndUser(_0x3228b6,_0x2f7baf,_0x420ffe,_0x4fda19,_0x1752c4,_0x3a3a28){var _0x420ffe=getName(_0x420ffe);return request({'method':_0x7a04('0x44'),'uri':_0x7a04('0x45')+_0x2f7baf+_0x7a04('0x46')+_[_0x7a04('0x47')](_0x3a3a28[_0x7a04('0x48')])+'s','body':{'data':[{'Last_Name':_0x420ffe[0x1],'First_Name':_0x420ffe[0x0],'Phone':_0x4fda19,'Owner':{'name':!_['isNil'](_0x1752c4['role'][_0x7a04('0x18')])?_0x1752c4[_0x7a04('0x49')]['name']:!_['isNil'](_0x1752c4['first_name'])?_0x1752c4[_0x7a04('0x4a')]+'\x20'+_0x1752c4[_0x7a04('0x4b')]:_0x1752c4[_0x7a04('0x4b')],'id':_0x1752c4['id']}}]},'headers':{'Authorization':_0x7a04('0x36')+_0x3228b6},'json':!![]})[_0x7a04('0x2a')](function(_0x2bec59){if(_0x2bec59&&_0x2bec59['data'][0x0][_0x7a04('0x4c')]===_0x7a04('0x4d')){var _0x5a8ce0=_0x2bec59['data'][0x0][_0x7a04('0x4e')];_0x5a8ce0[_0x7a04('0x43')]=_[_0x7a04('0x47')](_0x3a3a28[_0x7a04('0x48')])+'s';return _0x5a8ce0;}logger[_0x7a04('0x2f')](_0x7a04('0x3f'),JSON['stringify'](data));throw new Error(_0x7a04('0x4f')+JSON[_0x7a04('0x40')](data));})[_0x7a04('0x2e')](function(_0x33e44b){console[_0x7a04('0x50')](_0x7a04('0x51'),_0x33e44b);});}function getEndUser(_0x206610,_0x575e60,_0x2687e4,_0x2d8d45,_0x555e2e,_0x4ecdb4,_0x58f79c){var _0x55e902={'method':_0x7a04('0x33'),'uri':'','headers':{'Authorization':_0x7a04('0x36')+_0x206610},'json':!![]};switch(_0x58f79c[_0x7a04('0x52')]){case _0x7a04('0x53'):_0x55e902['uri']='https://www.zohoapis.'+_0x575e60+_0x7a04('0x54')+_0x555e2e+'))';return getZohoUser(_0x55e902,_0x7a04('0x55'))[_0x7a04('0x2a')](function(_0x14e42e){if(_0x14e42e)return _0x14e42e;_0x55e902['uri']='https://www.zohoapis.'+_0x575e60+_0x7a04('0x56')+_0x555e2e+'))';return getZohoUser(_0x55e902,'Leads')[_0x7a04('0x2a')](function(_0x4d159d){if(_0x4d159d)return _0x4d159d;if(_0x58f79c[_0x7a04('0x48')]!=_0x7a04('0x57')){return createEndUser(_0x206610,_0x575e60,_0x2d8d45,_0x555e2e,_0x4ecdb4,_0x58f79c);}else{return{};}});});break;case _0x7a04('0x58'):_0x55e902[_0x7a04('0x59')]=_0x7a04('0x45')+_0x575e60+_0x7a04('0x54')+_0x555e2e+'))';return getZohoUser(_0x55e902,_0x7a04('0x55'))['then'](function(_0x55ee9d){if(_0x55ee9d)return _0x55ee9d;if(_0x58f79c[_0x7a04('0x48')]!=_0x7a04('0x57')){return createEndUser(_0x206610,_0x575e60,_0x2d8d45,_0x555e2e,_0x4ecdb4,_0x58f79c);}else{return{};}});break;case _0x7a04('0x5a'):_0x55e902[_0x7a04('0x59')]=_0x7a04('0x45')+_0x575e60+_0x7a04('0x56')+_0x555e2e+'))';return getZohoUser(_0x55e902,_0x7a04('0x5b'))[_0x7a04('0x2a')](function(_0x5109f6){if(_0x5109f6)return _0x5109f6;if(_0x58f79c['moduleCreate']!=_0x7a04('0x57')){return createEndUser(_0x206610,_0x575e60,_0x2d8d45,_0x555e2e,_0x4ecdb4,_0x58f79c);}else{return{};}});break;}}function getCall(_0x3cf11d,_0x568226,_0x30e0d2,_0x576300,_0x5c28c3,_0x83a38b,_0x5a45bf,_0x1d273b){logger[_0x7a04('0x32')](_0x7a04('0x5c'));var _0x58a6e1={};_0x58a6e1[_0x7a04('0x5d')]={'name':!_[_0x7a04('0x1c')](_0x576300[_0x7a04('0x49')]['name'])&&!_['isNil'](_0x576300[_0x7a04('0x3c')][_0x7a04('0x18')])&&_0x576300[_0x7a04('0x3c')][_0x7a04('0x18')]===_0x7a04('0x5e')?_0x576300[_0x7a04('0x49')][_0x7a04('0x18')]:!_[_0x7a04('0x1c')](_0x576300[_0x7a04('0x4a')])?_0x576300[_0x7a04('0x4a')]+'\x20'+_0x576300[_0x7a04('0x4b')]:_0x576300[_0x7a04('0x4b')],'id':_0x576300['id']};_0x58a6e1[_0x7a04('0x5f')]=intUtil['getString'](_0x83a38b['Subjects'],_0x5a45bf,'\x20');_0x58a6e1['Description']=intUtil[_0x7a04('0x60')](_0x83a38b[_0x7a04('0x61')],_0x5a45bf,'\x0a');if(_0x5c28c3['enduserType']===_0x7a04('0x55')){_0x58a6e1[_0x7a04('0x62')]={'name':!_[_0x7a04('0x1c')](_0x5c28c3[_0x7a04('0x63')])?_0x5c28c3['Full_Name']:!_['isNil'](_0x5c28c3[_0x7a04('0x64')])?_0x5c28c3[_0x7a04('0x64')]+'\x20'+_0x5c28c3['Last_Name']:_0x5c28c3['Last_Name'],'id':_0x5c28c3['id']};}if(_0x5c28c3[_0x7a04('0x43')]===_0x7a04('0x5b')){_0x58a6e1[_0x7a04('0x65')]={'name':!_[_0x7a04('0x1c')](_0x5c28c3[_0x7a04('0x63')])?_0x5c28c3[_0x7a04('0x63')]:!_['isNil'](_0x5c28c3[_0x7a04('0x64')])?_0x5c28c3['First_Name']+'\x20'+_0x5c28c3[_0x7a04('0x66')]:_0x5c28c3['Last_Name'],'id':_0x5c28c3['id']};_0x58a6e1['$se_module']=_[_0x7a04('0x47')](_0x5c28c3['enduserType']);}if(_0x5a45bf[_0x7a04('0x67')]){_0x58a6e1[_0x7a04('0x68')]=moment['utc'](parseInt(_0x5a45bf[_0x7a04('0x67')])*0x3e8)[_0x7a04('0x34')](_0x7a04('0x69'));}else if(_0x5a45bf[_0x7a04('0x6a')]&&_0x5a45bf[_0x7a04('0x6b')]){_0x58a6e1[_0x7a04('0x68')]=moment['utc'](moment(_0x5a45bf['endtime'],_0x7a04('0x6c'))[_0x7a04('0x6d')](moment(_0x5a45bf[_0x7a04('0x6e')],'YYYY-MM-DDTHH:mm:ss')))[_0x7a04('0x34')](_0x7a04('0x69'));}switch(_0x5a45bf[_0x7a04('0x6f')]){case _0x7a04('0x70'):_0x58a6e1[_0x7a04('0x71')]='Called';break;case _0x7a04('0x72'):case _0x7a04('0x73'):_0x58a6e1[_0x7a04('0x71')]=_0x7a04('0x74');break;case _0x7a04('0x75'):_0x58a6e1[_0x7a04('0x71')]=_0x7a04('0x76');break;case _0x7a04('0x77'):_0x58a6e1[_0x7a04('0x71')]=_0x7a04('0x78');break;case _0x7a04('0x79'):_0x58a6e1[_0x7a04('0x71')]=_0x7a04('0x7a');default:}_0x58a6e1[_0x7a04('0x7b')]=(_0x1d273b===_0x7a04('0x7c')?moment(_0x5a45bf['starttime'])[_0x7a04('0x34')](_0x7a04('0x6c')):moment(_0x5a45bf[_0x7a04('0x7d')])[_0x7a04('0x34')](_0x7a04('0x6c')))||moment()[_0x7a04('0x34')](_0x7a04('0x6c'));_0x58a6e1['Call_Type']=_0x1d273b||_0x7a04('0x7e');_0x58a6e1=_[_0x7a04('0x7f')](_0x58a6e1,getCustomFields(_0x83a38b[_0x7a04('0x80')],_0x5a45bf));return request({'method':_0x7a04('0x44'),'uri':_0x7a04('0x45')+_0x568226+_0x7a04('0x81'),'headers':{'Authorization':_0x7a04('0x36')+_0x3cf11d},'body':{'data':[_0x58a6e1]},'json':!![]})[_0x7a04('0x2a')](function(_0x50d7e6){if(_0x50d7e6&&_0x50d7e6[_0x7a04('0x42')][0x0][_0x7a04('0x4c')]===_0x7a04('0x4d')){logger[_0x7a04('0x32')](_0x7a04('0x82'));return{'id':_0x50d7e6[_0x7a04('0x42')][0x0][_0x7a04('0x4e')]['id']};}})['catch'](function(_0x549c3a){logger[_0x7a04('0x32')](_0x7a04('0x83'),_0x549c3a['stack']);console[_0x7a04('0x50')]('err',_0x549c3a);});}exports[_0x7a04('0x84')]=function(_0x2df085,_0x180712,_0x2c263c,_0xd0dc9b,_0x5aa109,_0x20c805){var _0x53e865,_0x5a194f,_0x1a4092;_0x20c805['host']=intUtil[_0x7a04('0x85')](_0x20c805[_0x7a04('0x86')]);_0x20c805[_0x7a04('0x87')]=intUtil[_0x7a04('0x85')](_0x20c805[_0x7a04('0x87')]);if(_0x5aa109&&_0x5aa109[_0x7a04('0x88')]){logger['info'](_0x7a04('0x89'),_0x7a04('0x8a'));_0x180712[_0x7a04('0x8b')]=_0x20c805['serverUrl']+_0x7a04('0x8c')+_0x180712[_0x7a04('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x180712[_0x7a04('0x8d')]);}else{_0x180712[_0x7a04('0x8b')]='';}var _0x60881=_0x20c805['host']===_0x7a04('0x8e')?'eu':'com';return getAccessToken(_0x20c805)[_0x7a04('0x2a')](function(_0x130872){_0x1a4092=_0x130872;return getUser(_0x1a4092,_0x60881,_0x20c805,_0xd0dc9b[_0x7a04('0x8f')]);})[_0x7a04('0x2a')](function(_0x23713e){_0x53e865=_0x23713e;logger[_0x7a04('0x32')](_0x7a04('0x90'),_0x53e865['id']);return getEndUser(_0x1a4092,_0x60881,_0x20c805,_0x180712[_0x7a04('0x91')],_0x180712[_0x7a04('0x92')],_0x53e865,_0x2c263c);})['then'](function(_0xc5ee14){_0x5a194f=_0xc5ee14;return getCall(_0x1a4092,_0x60881,_0x20c805,_0x53e865,_0x5a194f,_0x2c263c,_0x180712,_0x7a04('0x7e'));})[_0x7a04('0x2a')](function(_0x3cfb67){if(_0x3cfb67){logger['info'](_0x7a04('0x93'),_0x3cfb67['id']);logger['info']('[QUEUE]',_0x7a04('0x94'));emit(util[_0x7a04('0x34')]('user:%s',_0xd0dc9b['name']),'trigger:browser:url',{'uri':_0x7a04('0x95')+_0x20c805['host']+_0x7a04('0x96')+_0x3cfb67['id']});}})[_0x7a04('0x2e')](function(_0x4a1e3e){logger[_0x7a04('0x2f')](_0x7a04('0x89'),JSON['stringify'](_0x4a1e3e));});};exports[_0x7a04('0x7c')]=function(_0x69d2c2,_0x93e5f7,_0x221a29,_0x114e4d,_0x580db9,_0x2d630c,_0x83433d){var _0x5d4778,_0x629f89,_0x383caf;_0x2d630c[_0x7a04('0x86')]=intUtil[_0x7a04('0x85')](_0x2d630c[_0x7a04('0x86')]);_0x2d630c[_0x7a04('0x87')]=intUtil['stripTrailingSlash'](_0x2d630c['serverUrl']);if(_0x83433d&&_0x83433d['recordingFormat']&&_0x83433d[_0x7a04('0x97')]!==_0x7a04('0x98')){logger['info']('[OUTBOUND]',_0x7a04('0x8a'));_0x93e5f7[_0x7a04('0x8b')]=_0x2d630c['serverUrl']+_0x7a04('0x8c')+_0x93e5f7['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x93e5f7[_0x7a04('0x8d')]);}var _0x4f8222=_0x2d630c[_0x7a04('0x86')]===_0x7a04('0x8e')?'eu':'com';return getAccessToken(_0x2d630c)[_0x7a04('0x2a')](function(_0x268cf8){_0x383caf=_0x268cf8;return getUser(_0x383caf,_0x4f8222,_0x2d630c,_0x114e4d[_0x7a04('0x8f')]);})[_0x7a04('0x2a')](function(_0x46f8dc){_0x5d4778=_0x46f8dc;logger['info'](_0x7a04('0x90'),_0x5d4778['id']);return getEndUser(_0x383caf,_0x4f8222,_0x2d630c,_0x93e5f7[_0x7a04('0x99')],_0x93e5f7[_0x7a04('0x9a')],_0x5d4778,_0x221a29);})[_0x7a04('0x2a')](function(_0x4b8e50){_0x629f89=_0x4b8e50;return getCall(_0x383caf,_0x4f8222,_0x2d630c,_0x5d4778,_0x629f89,_0x221a29,_0x93e5f7,_0x7a04('0x9b'));})[_0x7a04('0x2a')](function(_0x2e626f){if(_0x2e626f){logger[_0x7a04('0x32')](_0x7a04('0x93'),_0x2e626f['id']);logger['info'](_0x7a04('0x9c'),_0x7a04('0x94'));emit(util['format'](_0x7a04('0x9d'),_0x114e4d[_0x7a04('0x18')]),_0x7a04('0x9e'),{'uri':_0x7a04('0x95')+_0x2d630c[_0x7a04('0x86')]+_0x7a04('0x96')+_0x2e626f['id']});}})['catch'](function(_0x2c58ed){logger[_0x7a04('0x2f')]('[OUTBOUND]',JSON['stringify'](_0x2c58ed));});};exports['unmanaged']=function(_0x53e3af,_0x423397,_0x4f5702,_0x1fba88,_0x4fa829,_0x10187b){var _0x44ead8,_0x58e392,_0x504086;_0x10187b[_0x7a04('0x86')]=intUtil[_0x7a04('0x85')](_0x10187b['host']);_0x10187b[_0x7a04('0x87')]=intUtil[_0x7a04('0x85')](_0x10187b['serverUrl']);if(_0x4fa829&&_0x4fa829[_0x7a04('0x88')]){logger['info']('['+_0x423397['lastevent'][_0x7a04('0x9f')]()+']',_0x7a04('0x8a'));_0x423397[_0x7a04('0x8b')]=_0x10187b[_0x7a04('0x87')]+_0x7a04('0x8c')+_0x423397[_0x7a04('0x8d')]+_0x7a04('0xa0')+md5(_0x423397[_0x7a04('0x8d')]);}else{_0x423397[_0x7a04('0x8b')]='';}var _0x1ad4db=_0x10187b[_0x7a04('0x86')]===_0x7a04('0x8e')?'eu':_0x7a04('0xa1');return getAccessToken(_0x10187b)[_0x7a04('0x2a')](function(_0x547458){_0x504086=_0x547458;return getUser(_0x504086,_0x1ad4db,_0x10187b);})['then'](function(_0x20ae29){_0x44ead8=_0x20ae29;logger[_0x7a04('0x32')](_0x7a04('0x90'),_0x44ead8['id']);return getEndUser(_0x504086,_0x1ad4db,_0x10187b,_0x423397[_0x7a04('0x91')],_0x423397[_0x7a04('0x92')],_0x44ead8,_0x4f5702);})[_0x7a04('0x2a')](function(_0x4e3f5f){_0x58e392=_0x4e3f5f;return getCall(_0x504086,_0x1ad4db,_0x10187b,_0x44ead8,_0x58e392,_0x4f5702,_0x423397,'Inbound');})[_0x7a04('0x2a')](function(_0x294cdb){if(_0x294cdb){logger[_0x7a04('0x32')](_0x7a04('0x93'),_0x294cdb['id']);}})['catch'](function(_0x262319){logger['error']('['+_0x423397[_0x7a04('0x6f')][_0x7a04('0x9f')]()+']',JSON['stringify'](_0x262319));});}; \ No newline at end of file +var _0xd2bb=['stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','type','idField','content','toString','variableName','name','Variable','toLowerCase','split','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','isNil','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','data','enduserType','POST','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','CREATE\x20ERROR','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','Call_Duration','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','mm:ss','called','Called','complete','connect','rejected','Call_Result','abandoned','Abandoned','Timeout','Call_Start_Time','merge','/crm/v2/Calls','Call\x20created!','err','stack','queue','host'];(function(_0x40aa24,_0x2b69ca){var _0x1655a5=function(_0x59c906){while(--_0x59c906){_0x40aa24['push'](_0x40aa24['shift']());}};_0x1655a5(++_0x2b69ca);}(_0xd2bb,0x1d2));var _0xbd2b=function(_0x509baf,_0x414b6f){_0x509baf=_0x509baf-0x0;var _0x18a292=_0xd2bb[_0x509baf];return _0x18a292;};'use strict';var _=require(_0xbd2b('0x0'));var rp=require(_0xbd2b('0x1'));var md5=require(_0xbd2b('0x2'));var util=require(_0xbd2b('0x3'));var intUtil=require(_0xbd2b('0x4'));var moment=require('moment');var Redis=require(_0xbd2b('0x5'));var BPromise=require('bluebird');var config=require(_0xbd2b('0x6'));var logger=require(_0xbd2b('0x7'))(_0xbd2b('0x8'));config[_0xbd2b('0x9')]=_[_0xbd2b('0xa')](config[_0xbd2b('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xbd2b('0xb'))(new Redis(config[_0xbd2b('0x9')]));function emit(_0x491a3f,_0x3d56e0,_0x2e1e51){io['to'](_0x491a3f)['emit'](_0x3d56e0,_0x2e1e51);}function request(_0x44a122){logger[_0xbd2b('0xc')](_0xbd2b('0xd'),JSON[_0xbd2b('0xe')](_0x44a122));return rp(_0x44a122);}function getCustomFields(_0x108c80,_0x54317d){var _0x4ea7b7={};if(_0x108c80[_0xbd2b('0xf')]>0x0){_[_0xbd2b('0x10')](_0x108c80,function(_0x5aac59){if(_['includes'](['string','picklist'],_0x5aac59[_0xbd2b('0x11')])&&_0x5aac59['idField']){_0x4ea7b7[_0x5aac59[_0xbd2b('0x12')]]=_0x5aac59[_0xbd2b('0x13')][_0xbd2b('0x14')]();}else if(_0x5aac59[_0xbd2b('0x11')]==='variable'&&_0x5aac59[_0xbd2b('0x15')]&&_0x5aac59['idField']&&_0x54317d[_0x5aac59[_0xbd2b('0x15')]]){_0x4ea7b7[_0x5aac59[_0xbd2b('0x12')]]=_0x54317d[_0x5aac59[_0xbd2b('0x15')]][_0xbd2b('0x14')]();}else if(_0x5aac59[_0xbd2b('0x11')]==='customVariable'&&_0x5aac59['Variable']&&_0x5aac59['Variable'][_0xbd2b('0x16')]&&_0x5aac59[_0xbd2b('0x12')]&&_0x54317d[_0x5aac59[_0xbd2b('0x17')][_0xbd2b('0x16')][_0xbd2b('0x18')]()]){_0x4ea7b7[_0x5aac59[_0xbd2b('0x12')]]=_0x54317d[_0x5aac59[_0xbd2b('0x17')][_0xbd2b('0x16')][_0xbd2b('0x18')]()][_0xbd2b('0x14')]();}});}return _0x4ea7b7;}function getName(_0x24a235){if(_0x24a235['indexOf']('\x20')>0x0){var _0x449e88=_0x24a235[_0xbd2b('0x19')](/ (.+)/);if(_0x449e88[0x1]){return _0x449e88;}}return[_0x24a235,_0x24a235];}var accountsTokens={};function getAccessToken(_0x5da34f){return new Promise(function(_0x489d1f,_0x54a330){if(!_['isNil'](accountsTokens[_0x5da34f['id']])&&!_['isNil'](accountsTokens[_0x5da34f['id']][_0xbd2b('0x1a')])){if(moment()[_0xbd2b('0x1b')](accountsTokens[_0x5da34f['id']][_0xbd2b('0x1c')])){_0x489d1f(accountsTokens[_0x5da34f['id']][_0xbd2b('0x1a')]);}}var _0x4cd741;switch(_0x5da34f['zone']){case'US':_0x4cd741=_0xbd2b('0x1d');break;case'AU':_0x4cd741=_0xbd2b('0x1e');break;case'EU':_0x4cd741=_0xbd2b('0x1f');break;case'IN':_0x4cd741='https://accounts.zoho.in';break;case'CN':_0x4cd741=_0xbd2b('0x20');break;default:_0x4cd741=_0xbd2b('0x1f');break;}var _0x45ccee={'method':'POST','uri':_0x4cd741+_0xbd2b('0x21'),'qs':{'refresh_token':_0x5da34f['refreshToken'],'client_id':_0x5da34f[_0xbd2b('0x22')],'client_secret':_0x5da34f['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x45ccee)[_0xbd2b('0x23')](function(_0x442fd9){accountsTokens[_0x5da34f['id']]={'access_token':_0x442fd9[_0xbd2b('0x1a')],'expires_in':moment()['add'](_0x442fd9[_0xbd2b('0x1c')],_0xbd2b('0x24'))};_0x489d1f(_0x442fd9[_0xbd2b('0x1a')]);})[_0xbd2b('0x25')](function(_0x473de3){logger[_0xbd2b('0x26')](_0xbd2b('0x27'),_0x473de3['stack']);_0x54a330(_0x473de3);});});}function getUser(_0x82ccbd,_0x2c8c89,_0x259ebc,_0x16cb19){logger['info'](_0xbd2b('0x28'));return request({'method':'GET','uri':util[_0xbd2b('0x29')](_0xbd2b('0x2a'),_0x2c8c89),'qs':{'type':_0xbd2b('0x2b')},'headers':{'Authorization':_0xbd2b('0x2c')+_0x82ccbd},'json':!![]})[_0xbd2b('0x23')](function(_0x1e62a4){if(_0x1e62a4[_0xbd2b('0x2d')]){var _0x1a0e87=-0x1;if(_[_0xbd2b('0x2e')](_0x1e62a4[_0xbd2b('0x2d')])){if(!_[_0xbd2b('0x2f')](_0x16cb19)){_0x1a0e87=_['findIndex'](_0x1e62a4[_0xbd2b('0x2d')],function(_0x2681eb){return _0x2681eb[_0xbd2b('0x30')]===_0x16cb19;});}if(_0x1a0e87>=0x0){logger[_0xbd2b('0x31')](_0xbd2b('0x32'));}else{logger['info'](_0xbd2b('0x33'));_0x1a0e87=_[_0xbd2b('0x34')](_0x1e62a4[_0xbd2b('0x2d')],function(_0x547e7c){return _0x547e7c[_0xbd2b('0x35')][_0xbd2b('0x16')]===_0xbd2b('0x36');});}return _0x1e62a4['users'][_0x1a0e87];}else{if(_0x1e62a4[_0xbd2b('0x37')][_0xbd2b('0x35')][_0xbd2b('0x16')]===_0xbd2b('0x36')){logger['info'](_0xbd2b('0x33'));user=_0x1e62a4[_0xbd2b('0x37')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xbd2b('0xe')](_0x1e62a4));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xbd2b('0xe')](_0x1e62a4));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x1e62a4));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x1e62a4));}})[_0xbd2b('0x25')](function(_0x543431){console[_0xbd2b('0x26')](_0x543431);});}function getZohoUser(_0x41e8ee,_0x11f085){return new BPromise(function(_0x3ffda2,_0x19bfbc){request(_0x41e8ee)[_0xbd2b('0x23')](function(_0x52d165){var _0x867c64=null;if(_0x52d165){_0x867c64=_0x52d165[_0xbd2b('0x38')][0x0];_0x867c64[_0xbd2b('0x39')]=_0x11f085;}_0x3ffda2(_0x867c64);})[_0xbd2b('0x25')](function(_0x4f5d25){_0x19bfbc(_0x4f5d25);});});}function createEndUser(_0x469dda,_0x5eda8b,_0x20e86c,_0x300e97,_0x595249,_0x1ea770){var _0x20e86c=getName(_0x20e86c);return request({'method':_0xbd2b('0x3a'),'uri':'https://www.zohoapis.'+_0x5eda8b+_0xbd2b('0x3b')+_[_0xbd2b('0x3c')](_0x1ea770[_0xbd2b('0x3d')])+'s','body':{'data':[{'Last_Name':_0x20e86c[0x1],'First_Name':_0x20e86c[0x0],'Phone':_0x300e97,'Owner':{'name':!_[_0xbd2b('0x2f')](_0x595249['role'][_0xbd2b('0x16')])?_0x595249[_0xbd2b('0x3e')]['name']:!_[_0xbd2b('0x2f')](_0x595249[_0xbd2b('0x3f')])?_0x595249[_0xbd2b('0x3f')]+'\x20'+_0x595249[_0xbd2b('0x40')]:_0x595249[_0xbd2b('0x40')],'id':_0x595249['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x469dda},'json':!![]})[_0xbd2b('0x23')](function(_0x37b89b){if(_0x37b89b&&_0x37b89b[_0xbd2b('0x38')][0x0][_0xbd2b('0x41')]===_0xbd2b('0x42')){var _0x3a2028=_0x37b89b[_0xbd2b('0x38')][0x0]['details'];_0x3a2028['enduserType']=_['startCase'](_0x1ea770[_0xbd2b('0x3d')])+'s';return _0x3a2028;}logger[_0xbd2b('0x26')]('The\x20failing\x20result\x20is',JSON[_0xbd2b('0xe')](data));throw new Error(_0xbd2b('0x43')+JSON[_0xbd2b('0xe')](data));})['catch'](function(_0xb4a63){console['log'](_0xbd2b('0x44'),_0xb4a63);});}function getEndUser(_0x5e88f7,_0x19011c,_0x4585d1,_0x541dd7,_0x2b4f13,_0x11522d,_0x5c2529){var _0x73b4ea={'method':_0xbd2b('0x45'),'uri':'','headers':{'Authorization':_0xbd2b('0x2c')+_0x5e88f7},'json':!![]};switch(_0x5c2529[_0xbd2b('0x46')]){case _0xbd2b('0x47'):_0x73b4ea['uri']='https://www.zohoapis.'+_0x19011c+_0xbd2b('0x48')+_0x2b4f13+'))';return getZohoUser(_0x73b4ea,_0xbd2b('0x49'))[_0xbd2b('0x23')](function(_0x2e860a){if(_0x2e860a)return _0x2e860a;_0x73b4ea[_0xbd2b('0x4a')]=_0xbd2b('0x4b')+_0x19011c+_0xbd2b('0x4c')+_0x2b4f13+'))';return getZohoUser(_0x73b4ea,_0xbd2b('0x4d'))[_0xbd2b('0x23')](function(_0x1938a5){if(_0x1938a5)return _0x1938a5;if(_0x5c2529[_0xbd2b('0x3d')]!='nothing'){return createEndUser(_0x5e88f7,_0x19011c,_0x541dd7,_0x2b4f13,_0x11522d,_0x5c2529);}else{return{};}});});break;case _0xbd2b('0x4e'):_0x73b4ea[_0xbd2b('0x4a')]='https://www.zohoapis.'+_0x19011c+_0xbd2b('0x48')+_0x2b4f13+'))';return getZohoUser(_0x73b4ea,_0xbd2b('0x49'))[_0xbd2b('0x23')](function(_0x99e555){if(_0x99e555)return _0x99e555;if(_0x5c2529[_0xbd2b('0x3d')]!='nothing'){return createEndUser(_0x5e88f7,_0x19011c,_0x541dd7,_0x2b4f13,_0x11522d,_0x5c2529);}else{return{};}});break;case _0xbd2b('0x4f'):_0x73b4ea[_0xbd2b('0x4a')]='https://www.zohoapis.'+_0x19011c+_0xbd2b('0x4c')+_0x2b4f13+'))';return getZohoUser(_0x73b4ea,_0xbd2b('0x4d'))[_0xbd2b('0x23')](function(_0x44de79){if(_0x44de79)return _0x44de79;if(_0x5c2529['moduleCreate']!='nothing'){return createEndUser(_0x5e88f7,_0x19011c,_0x541dd7,_0x2b4f13,_0x11522d,_0x5c2529);}else{return{};}});break;}}function getCall(_0x4f4756,_0x4c26b9,_0x57bedc,_0x8be7f3,_0x4756cc,_0x2d3145,_0x2d017a,_0x56c262){logger[_0xbd2b('0x31')](_0xbd2b('0x50'));var _0x1e94bc={};_0x1e94bc[_0xbd2b('0x51')]={'name':!_[_0xbd2b('0x2f')](_0x8be7f3[_0xbd2b('0x3e')][_0xbd2b('0x16')])&&!_[_0xbd2b('0x2f')](_0x8be7f3[_0xbd2b('0x35')][_0xbd2b('0x16')])&&_0x8be7f3[_0xbd2b('0x35')]['name']===_0xbd2b('0x52')?_0x8be7f3['role'][_0xbd2b('0x16')]:!_[_0xbd2b('0x2f')](_0x8be7f3[_0xbd2b('0x3f')])?_0x8be7f3[_0xbd2b('0x3f')]+'\x20'+_0x8be7f3[_0xbd2b('0x40')]:_0x8be7f3[_0xbd2b('0x40')],'id':_0x8be7f3['id']};_0x1e94bc[_0xbd2b('0x53')]=intUtil[_0xbd2b('0x54')](_0x2d3145[_0xbd2b('0x55')],_0x2d017a,'\x20');_0x1e94bc['Description']=intUtil[_0xbd2b('0x54')](_0x2d3145[_0xbd2b('0x56')],_0x2d017a,'\x0a');if(_0x4756cc[_0xbd2b('0x39')]===_0xbd2b('0x49')){_0x1e94bc[_0xbd2b('0x57')]={'name':!_[_0xbd2b('0x2f')](_0x4756cc[_0xbd2b('0x58')])?_0x4756cc[_0xbd2b('0x58')]:!_[_0xbd2b('0x2f')](_0x4756cc[_0xbd2b('0x59')])?_0x4756cc['First_Name']+'\x20'+_0x4756cc[_0xbd2b('0x5a')]:_0x4756cc[_0xbd2b('0x5a')],'id':_0x4756cc['id']};}if(_0x4756cc['enduserType']==='Leads'){_0x1e94bc[_0xbd2b('0x5b')]={'name':!_[_0xbd2b('0x2f')](_0x4756cc[_0xbd2b('0x58')])?_0x4756cc[_0xbd2b('0x58')]:!_[_0xbd2b('0x2f')](_0x4756cc[_0xbd2b('0x59')])?_0x4756cc['First_Name']+'\x20'+_0x4756cc[_0xbd2b('0x5a')]:_0x4756cc[_0xbd2b('0x5a')],'id':_0x4756cc['id']};_0x1e94bc[_0xbd2b('0x5c')]=_['startCase'](_0x4756cc[_0xbd2b('0x39')]);}if(_0x2d017a[_0xbd2b('0x5d')]){_0x1e94bc['Call_Duration']=moment[_0xbd2b('0x5e')](parseInt(_0x2d017a[_0xbd2b('0x5d')])*0x3e8)['format']('mm:ss');}else if(_0x2d017a['answertime']&&_0x2d017a['endtime']){_0x1e94bc[_0xbd2b('0x5f')]=moment['utc'](moment(_0x2d017a[_0xbd2b('0x60')],'YYYY-MM-DDTHH:mm:ss')[_0xbd2b('0x61')](moment(_0x2d017a[_0xbd2b('0x62')],_0xbd2b('0x63'))))[_0xbd2b('0x29')](_0xbd2b('0x64'));}switch(_0x2d017a['lastevent']){case _0xbd2b('0x65'):_0x1e94bc['Call_Result']=_0xbd2b('0x66');break;case _0xbd2b('0x67'):case _0xbd2b('0x68'):_0x1e94bc['Call_Result']='Answered';break;case _0xbd2b('0x69'):_0x1e94bc[_0xbd2b('0x6a')]='Rejected';break;case _0xbd2b('0x6b'):_0x1e94bc[_0xbd2b('0x6a')]=_0xbd2b('0x6c');break;case'timeout':_0x1e94bc['Call_Result']=_0xbd2b('0x6d');default:}_0x1e94bc[_0xbd2b('0x6e')]=(_0x56c262==='outbound'?moment(_0x2d017a[_0xbd2b('0x62')])['format'](_0xbd2b('0x63')):moment(_0x2d017a['agentcalledAt'])['format'](_0xbd2b('0x63')))||moment()[_0xbd2b('0x29')](_0xbd2b('0x63'));_0x1e94bc['Call_Type']=_0x56c262||'Inbound';_0x1e94bc=_[_0xbd2b('0x6f')](_0x1e94bc,getCustomFields(_0x2d3145['Fields'],_0x2d017a));return request({'method':_0xbd2b('0x3a'),'uri':_0xbd2b('0x4b')+_0x4c26b9+_0xbd2b('0x70'),'headers':{'Authorization':_0xbd2b('0x2c')+_0x4f4756},'body':{'data':[_0x1e94bc]},'json':!![]})[_0xbd2b('0x23')](function(_0x3cb087){if(_0x3cb087&&_0x3cb087[_0xbd2b('0x38')][0x0][_0xbd2b('0x41')]===_0xbd2b('0x42')){logger[_0xbd2b('0x31')](_0xbd2b('0x71'));return{'id':_0x3cb087[_0xbd2b('0x38')][0x0]['details']['id']};}})[_0xbd2b('0x25')](function(_0x2fc31d){logger[_0xbd2b('0x31')](_0xbd2b('0x72'),_0x2fc31d[_0xbd2b('0x73')]);console['log'](_0xbd2b('0x72'),_0x2fc31d);});}exports[_0xbd2b('0x74')]=function(_0x456e8c,_0x4aa7a0,_0x5d45d7,_0x4849eb,_0x5117b9,_0x5e33b8){var _0x5d6116,_0x2d6ccc,_0x38e963;_0x5e33b8[_0xbd2b('0x75')]=intUtil[_0xbd2b('0x76')](_0x5e33b8[_0xbd2b('0x75')]);_0x5e33b8[_0xbd2b('0x77')]=intUtil[_0xbd2b('0x76')](_0x5e33b8[_0xbd2b('0x77')]);if(_0x5117b9&&_0x5117b9['monitor_format']){logger[_0xbd2b('0x31')]('[QUEUE]',_0xbd2b('0x78'));_0x4aa7a0[_0xbd2b('0x79')]=_0x5e33b8[_0xbd2b('0x77')]+_0xbd2b('0x7a')+_0x4aa7a0['uniqueid']+_0xbd2b('0x7b')+md5(_0x4aa7a0[_0xbd2b('0x7c')]);}else{_0x4aa7a0['recordingURL']='';}var _0x5f3d61=_0x5e33b8['host']===_0xbd2b('0x7d')?'eu':_0xbd2b('0x7e');return getAccessToken(_0x5e33b8)[_0xbd2b('0x23')](function(_0x1db466){_0x38e963=_0x1db466;return getUser(_0x38e963,_0x5f3d61,_0x5e33b8,_0x4849eb[_0xbd2b('0x30')]);})['then'](function(_0x10df09){_0x5d6116=_0x10df09;logger['info'](_0xbd2b('0x7f'),_0x5d6116['id']);return getEndUser(_0x38e963,_0x5f3d61,_0x5e33b8,_0x4aa7a0[_0xbd2b('0x80')],_0x4aa7a0[_0xbd2b('0x81')],_0x5d6116,_0x5d45d7);})[_0xbd2b('0x23')](function(_0x3d005e){_0x2d6ccc=_0x3d005e;return getCall(_0x38e963,_0x5f3d61,_0x5e33b8,_0x5d6116,_0x2d6ccc,_0x5d45d7,_0x4aa7a0,_0xbd2b('0x82'));})[_0xbd2b('0x23')](function(_0x232b5a){if(_0x232b5a){logger[_0xbd2b('0x31')](_0xbd2b('0x83'),_0x232b5a['id']);logger[_0xbd2b('0x31')](_0xbd2b('0x84'),_0xbd2b('0x85'));emit(util[_0xbd2b('0x29')]('user:%s',_0x4849eb[_0xbd2b('0x16')]),_0xbd2b('0x86'),{'uri':_0xbd2b('0x87')+_0x5e33b8[_0xbd2b('0x75')]+'/crm/EntityInfo.do?module=Calls&id='+_0x232b5a['id']});}})[_0xbd2b('0x25')](function(_0x1da1eb){logger[_0xbd2b('0x26')](_0xbd2b('0x84'),JSON[_0xbd2b('0xe')](_0x1da1eb));});};exports['outbound']=function(_0x561ca8,_0x355696,_0x29a644,_0x5edc55,_0x188787,_0x391952,_0x25fc05){var _0x1c90a4,_0x5cd17a,_0x5f289b;_0x391952[_0xbd2b('0x75')]=intUtil[_0xbd2b('0x76')](_0x391952[_0xbd2b('0x75')]);_0x391952['serverUrl']=intUtil[_0xbd2b('0x76')](_0x391952[_0xbd2b('0x77')]);if(_0x25fc05&&_0x25fc05['recordingFormat']&&_0x25fc05[_0xbd2b('0x88')]!==_0xbd2b('0x89')){logger[_0xbd2b('0x31')](_0xbd2b('0x8a'),_0xbd2b('0x78'));_0x355696['recordingURL']=_0x391952[_0xbd2b('0x77')]+_0xbd2b('0x7a')+_0x355696['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x355696[_0xbd2b('0x7c')]);}var _0x319b5e=_0x391952[_0xbd2b('0x75')]===_0xbd2b('0x7d')?'eu':'com';return getAccessToken(_0x391952)[_0xbd2b('0x23')](function(_0x2055a5){_0x5f289b=_0x2055a5;return getUser(_0x5f289b,_0x319b5e,_0x391952,_0x5edc55[_0xbd2b('0x30')]);})[_0xbd2b('0x23')](function(_0x2baad2){_0x1c90a4=_0x2baad2;logger[_0xbd2b('0x31')](_0xbd2b('0x7f'),_0x1c90a4['id']);return getEndUser(_0x5f289b,_0x319b5e,_0x391952,_0x355696[_0xbd2b('0x8b')],_0x355696[_0xbd2b('0x8c')],_0x1c90a4,_0x29a644);})['then'](function(_0x5caca7){_0x5cd17a=_0x5caca7;return getCall(_0x5f289b,_0x319b5e,_0x391952,_0x1c90a4,_0x5cd17a,_0x29a644,_0x355696,_0xbd2b('0x8d'));})['then'](function(_0x20bbd5){if(_0x20bbd5){logger['info'](_0xbd2b('0x83'),_0x20bbd5['id']);logger[_0xbd2b('0x31')]('[OUTBOUND]',_0xbd2b('0x85'));emit(util[_0xbd2b('0x29')]('user:%s',_0x5edc55['name']),_0xbd2b('0x86'),{'uri':_0xbd2b('0x87')+_0x391952[_0xbd2b('0x75')]+_0xbd2b('0x8e')+_0x20bbd5['id']});}})[_0xbd2b('0x25')](function(_0x288293){logger['error'](_0xbd2b('0x8a'),JSON[_0xbd2b('0xe')](_0x288293));});};exports[_0xbd2b('0x8f')]=function(_0x30d45c,_0x3d7279,_0x293fd9,_0x5057bc,_0x2f0284,_0x195c8a){var _0x53c9cb,_0x22a3f0,_0x59fec5;_0x195c8a['host']=intUtil['stripTrailingSlash'](_0x195c8a[_0xbd2b('0x75')]);_0x195c8a['serverUrl']=intUtil[_0xbd2b('0x76')](_0x195c8a[_0xbd2b('0x77')]);if(_0x2f0284&&_0x2f0284['monitor_format']){logger['info']('['+_0x3d7279[_0xbd2b('0x90')]['toUpperCase']()+']',_0xbd2b('0x78'));_0x3d7279['recordingURL']=_0x195c8a['serverUrl']+'/api/voice/recordings/'+_0x3d7279[_0xbd2b('0x7c')]+_0xbd2b('0x7b')+md5(_0x3d7279[_0xbd2b('0x7c')]);}else{_0x3d7279[_0xbd2b('0x79')]='';}var _0x48aa6c=_0x195c8a[_0xbd2b('0x75')]===_0xbd2b('0x7d')?'eu':_0xbd2b('0x7e');return getAccessToken(_0x195c8a)[_0xbd2b('0x23')](function(_0xcb6aa){_0x59fec5=_0xcb6aa;return getUser(_0x59fec5,_0x48aa6c,_0x195c8a);})[_0xbd2b('0x23')](function(_0x3502ac){_0x53c9cb=_0x3502ac;logger['info'](_0xbd2b('0x7f'),_0x53c9cb['id']);return getEndUser(_0x59fec5,_0x48aa6c,_0x195c8a,_0x3d7279[_0xbd2b('0x80')],_0x3d7279[_0xbd2b('0x81')],_0x53c9cb,_0x293fd9);})['then'](function(_0x5a59c4){_0x22a3f0=_0x5a59c4;return getCall(_0x59fec5,_0x48aa6c,_0x195c8a,_0x53c9cb,_0x22a3f0,_0x293fd9,_0x3d7279,'Inbound');})['then'](function(_0x4d99af){if(_0x4d99af){logger[_0xbd2b('0x31')]('The\x20Call\x20ID\x20is:',_0x4d99af['id']);}})[_0xbd2b('0x25')](function(_0x1e3323){logger[_0xbd2b('0x26')]('['+_0x3d7279[_0xbd2b('0x90')][_0xbd2b('0x91')]()+']',JSON[_0xbd2b('0xe')](_0x1e3323));});}; \ 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 e5137ca..3c86f7a 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 _0x0e75=['data2','Script','data3','render','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','trigger','exec'];(function(_0x1e0eb4,_0x228ceb){var _0x3f0517=function(_0x844c93){while(--_0x844c93){_0x1e0eb4['push'](_0x1e0eb4['shift']());}};_0x3f0517(++_0x228ceb);}(_0x0e75,0x104));var _0x50e7=function(_0x4b71ec,_0x1d5ce0){_0x4b71ec=_0x4b71ec-0x0;var _0x1e69bf=_0x0e75[_0x4b71ec];return _0x1e69bf;};'use strict';var util=require('util');var sh=require(_0x50e7('0x0'));var Mustache=require('mustache');var logger=require(_0x50e7('0x1'))(_0x50e7('0x2'));exports[_0x50e7('0x3')]=function(_0x44105a,_0x13dbcf){var _0xf9d731=_0x44105a[_0x50e7('0x4')]?_0x44105a['data2']:_0x50e7('0x5');var _0x15969a=_0x44105a[_0x50e7('0x6')]?Mustache[_0x50e7('0x7')](_0x44105a[_0x50e7('0x6')],_0x13dbcf):_0x13dbcf;sh[_0x50e7('0x3')](_0x15969a,function(_0x15062b,_0x8fea64,_0x1163f5){if(_0x15062b!==0x0){logger['error'](util[_0x50e7('0x8')](_0x50e7('0x9'),_0xf9d731,_0x15969a,_0x15062b,_0x1163f5));}else{logger[_0x50e7('0xa')](util[_0x50e7('0x8')](_0x50e7('0xb'),_0xf9d731,_0x15969a,_0x8fea64));}});}; \ No newline at end of file +var _0xe4ca=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xe4ca,0x1bf));var _0xae4c=function(_0x2a53a4,_0x2bfbeb){_0x2a53a4=_0x2a53a4-0x0;var _0x134a90=_0xe4ca[_0x2a53a4];return _0x134a90;};'use strict';var util=require(_0xae4c('0x0'));var sh=require(_0xae4c('0x1'));var Mustache=require(_0xae4c('0x2'));var logger=require(_0xae4c('0x3'))(_0xae4c('0x4'));exports[_0xae4c('0x5')]=function(_0x1b14af,_0x3163fc){var _0x3a55cb=_0x1b14af['data2']?_0x1b14af[_0xae4c('0x6')]:_0xae4c('0x7');var _0x1dff6f=_0x1b14af[_0xae4c('0x8')]?Mustache['render'](_0x1b14af['data3'],_0x3163fc):_0x3163fc;sh['exec'](_0x1dff6f,function(_0x1f5e9d,_0xfc18aa,_0x5b7b58){if(_0x1f5e9d!==0x0){logger['error'](util[_0xae4c('0x9')](_0xae4c('0xa'),_0x3a55cb,_0x1dff6f,_0x1f5e9d,_0x5b7b58));}else{logger['info'](util[_0xae4c('0x9')](_0xae4c('0xb'),_0x3a55cb,_0x1dff6f,_0xfc18aa));}});}; \ 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 d25ee63..541003c 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 _0xf66b=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','number','data5','headers','data6','parse','stack','GET','POST','data7','render','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then',',\x20request\x20body:\x20','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode'];(function(_0x436719,_0x2b87c6){var _0x284f73=function(_0x8b14f4){while(--_0x8b14f4){_0x436719['push'](_0x436719['shift']());}};_0x284f73(++_0x2b87c6);}(_0xf66b,0x135));var _0xbf66=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf66b[_0x2a6809];return _0x11c371;};'use strict';var rp=require('request-promise');var util=require(_0xbf66('0x0'));var _=require(_0xbf66('0x1'));var Mustache=require(_0xbf66('0x2'));var logger=require(_0xbf66('0x3'))(_0xbf66('0x4'));exports[_0xbf66('0x5')]=function(_0x52cd62,_0x14e9ae){var _0x5db164,_0x1b114d;var _0x120852={'method':_0x52cd62[_0xbf66('0x6')][_0xbf66('0x7')](),'uri':Mustache['render'](_0x52cd62['data2'],_0x14e9ae),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x52cd62['data5'])===_0xbf66('0x8')&&parseInt(_0x52cd62['data5'])>=0x1&&parseInt(_0x52cd62[_0xbf66('0x9')])<=0xa?parseInt(_0x52cd62[_0xbf66('0x9')])*0x3e8:0x5*0x3e8};try{_0x120852[_0xbf66('0xa')]=_0x52cd62[_0xbf66('0xb')]?JSON[_0xbf66('0xc')](Mustache['render'](_0x52cd62[_0xbf66('0xb')],_0x14e9ae)):{};}catch(_0x172079){logger['error'](_0x172079[_0xbf66('0xd')]);}switch(_0x52cd62['data1'][_0xbf66('0x7')]()){case _0xbf66('0xe'):case'DELETE':_0x5db164=null;_0x120852['qs']=_0x14e9ae;break;case _0xbf66('0xf'):case'PUT':if(_0x52cd62[_0xbf66('0x10')]){try{_0x5db164=JSON[_0xbf66('0xc')](Mustache[_0xbf66('0x11')](_0x52cd62['data7'],_0x14e9ae));_0x120852[_0xbf66('0x12')]=_0x5db164;}catch(_0x1147ed){logger[_0xbf66('0x13')](_0x1147ed[_0xbf66('0xd')]);logger[_0xbf66('0x13')](_0xbf66('0x14'));}}else{_0x5db164=_0x14e9ae;_0x120852[_0xbf66('0x12')]=_0x5db164;}break;}logger['info'](util[_0xbf66('0x15')](_0xbf66('0x16'),_0x52cd62[_0xbf66('0x6')],_0x52cd62[_0xbf66('0x17')],JSON['stringify'](_0x120852)));rp(_0x120852)[_0xbf66('0x18')](function(_0x66c994){_0x5db164=!_['isNil'](_0x5db164)?_0xbf66('0x19')+_0x5db164:'';_0x1b114d=typeof _0x66c994['body']===_0xbf66('0x1a')?JSON[_0xbf66('0x1b')](_0x66c994[_0xbf66('0x12')]):_0x66c994[_0xbf66('0x12')];logger[_0xbf66('0x1c')](util[_0xbf66('0x15')](_0xbf66('0x1d'),_0x52cd62[_0xbf66('0x6')],_0x52cd62[_0xbf66('0x17')],_0x66c994[_0xbf66('0x1e')],_0x1b114d));})['catch'](function(_0xc98bc6){logger[_0xbf66('0x13')](util[_0xbf66('0x15')](_0xbf66('0x1f'),_0x52cd62[_0xbf66('0x6')],_0x52cd62[_0xbf66('0x17')],_0xc98bc6[_0xbf66('0x1e')],_0xc98bc6[_0xbf66('0x20')],_0xc98bc6[_0xbf66('0x21')]));});}; \ No newline at end of file +var _0x999d=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','trigger','data1','toUpperCase','render','data2','number','data5','headers','parse','data6','error','GET','DELETE','POST','PUT','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','object'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x999d,0xaf));var _0xd999=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0x999d[_0x888385];return _0x22d5c2;};'use strict';var rp=require(_0xd999('0x0'));var util=require('util');var _=require(_0xd999('0x1'));var Mustache=require(_0xd999('0x2'));var logger=require('../../../../config/logger')(_0xd999('0x3'));exports['exec']=function(_0x28ae62,_0x5e5507){var _0x658044,_0x199137;var _0x1f5ec3={'method':_0x28ae62[_0xd999('0x4')][_0xd999('0x5')](),'uri':Mustache[_0xd999('0x6')](_0x28ae62[_0xd999('0x7')],_0x5e5507),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x28ae62['data5'])===_0xd999('0x8')&&parseInt(_0x28ae62[_0xd999('0x9')])>=0x1&&parseInt(_0x28ae62[_0xd999('0x9')])<=0xa?parseInt(_0x28ae62[_0xd999('0x9')])*0x3e8:0x5*0x3e8};try{_0x1f5ec3[_0xd999('0xa')]=_0x28ae62['data6']?JSON[_0xd999('0xb')](Mustache['render'](_0x28ae62[_0xd999('0xc')],_0x5e5507)):{};}catch(_0x117819){logger[_0xd999('0xd')](_0x117819['stack']);}switch(_0x28ae62[_0xd999('0x4')][_0xd999('0x5')]()){case _0xd999('0xe'):case _0xd999('0xf'):_0x658044=null;_0x1f5ec3['qs']=_0x5e5507;break;case _0xd999('0x10'):case _0xd999('0x11'):if(_0x28ae62[_0xd999('0x12')]){try{_0x658044=JSON[_0xd999('0xb')](Mustache['render'](_0x28ae62['data7'],_0x5e5507));_0x1f5ec3['body']=_0x658044;}catch(_0x16515e){logger[_0xd999('0xd')](_0x16515e[_0xd999('0x13')]);logger[_0xd999('0xd')](_0xd999('0x14'));}}else{_0x658044=_0x5e5507;_0x1f5ec3[_0xd999('0x15')]=_0x658044;}break;}logger[_0xd999('0x16')](util[_0xd999('0x17')](_0xd999('0x18'),_0x28ae62[_0xd999('0x4')],_0x28ae62['data2'],JSON[_0xd999('0x19')](_0x1f5ec3)));rp(_0x1f5ec3)[_0xd999('0x1a')](function(_0x1c1a27){_0x658044=!_[_0xd999('0x1b')](_0x658044)?',\x20request\x20body:\x20'+_0x658044:'';_0x199137=typeof _0x1c1a27['body']===_0xd999('0x1c')?JSON[_0xd999('0x19')](_0x1c1a27[_0xd999('0x15')]):_0x1c1a27['body'];logger[_0xd999('0x16')](util[_0xd999('0x17')](_0xd999('0x1d'),_0x28ae62[_0xd999('0x4')],_0x28ae62['data2'],_0x1c1a27[_0xd999('0x1e')],_0x199137));})['catch'](function(_0x566962){logger[_0xd999('0xd')](util[_0xd999('0x17')](_0xd999('0x1f'),_0x28ae62[_0xd999('0x4')],_0x28ae62['data2'],_0x566962[_0xd999('0x1e')],_0x566962[_0xd999('0x20')],_0x566962[_0xd999('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 3faa7dc..128231f 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 _0x20d5=['Request','request','then','debug','error','message','result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x407b3e,_0x26b4e7){var _0x37e532=function(_0x38f4a8){while(--_0x38f4a8){_0x407b3e['push'](_0x407b3e['shift']());}};_0x37e532(++_0x26b4e7);}(_0x20d5,0x14a));var _0x520d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20d5[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x520d('0x0'));var BPromise=require(_0x520d('0x1'));var logger=require(_0x520d('0x2'))(_0x520d('0x3'));var client=jayson[_0x520d('0x4')][_0x520d('0x5')]({'port':0x2329});client[_0x520d('0x6')]=function(_0x3b02c9,_0x2b2b12){return new BPromise(function(_0xfb2f86,_0x20aa60){return client[_0x520d('0x7')](_0x3b02c9,_0x2b2b12)[_0x520d('0x8')](function(_0x4c9316){logger[_0x520d('0x9')]('rpc','routing',_0x3b02c9,_0x2b2b12,_0x4c9316);if(_0x4c9316['error']){logger[_0x520d('0xa')]('rpc',_0x520d('0x3'),_0x3b02c9,_0x4c9316[_0x520d('0xa')][_0x520d('0xb')],_0x2b2b12);return _0x20aa60(_0x4c9316[_0x520d('0xa')][_0x520d('0xb')]);}else{return _0xfb2f86(_0x4c9316[_0x520d('0xc')]);}})[_0x520d('0xd')](function(_0x17259b){logger[_0x520d('0xa')](_0x520d('0xe'),'routing',_0x3b02c9,_0x17259b,_0x2b2b12);return _0x20aa60(_0x17259b);});});};module[_0x520d('0xf')]=client; \ No newline at end of file +var _0x0908=['message','rpc','exports','jayson/promise','bluebird','routing','http','Request','request','then','debug','error'];(function(_0x11952e,_0x5f4414){var _0x3fe657=function(_0x59bc80){while(--_0x59bc80){_0x11952e['push'](_0x11952e['shift']());}};_0x3fe657(++_0x5f4414);}(_0x0908,0x19b));var _0x8090=function(_0x19b6f0,_0x14b11e){_0x19b6f0=_0x19b6f0-0x0;var _0x38a0cc=_0x0908[_0x19b6f0];return _0x38a0cc;};'use strict';var jayson=require(_0x8090('0x0'));var BPromise=require(_0x8090('0x1'));var logger=require('../../config/logger')(_0x8090('0x2'));var client=jayson['client'][_0x8090('0x3')]({'port':0x2329});client[_0x8090('0x4')]=function(_0x540995,_0x8725d){return new BPromise(function(_0x51236d,_0x1b979f){return client[_0x8090('0x5')](_0x540995,_0x8725d)[_0x8090('0x6')](function(_0x3478ad){logger[_0x8090('0x7')]('rpc',_0x8090('0x2'),_0x540995,_0x8725d,_0x3478ad);if(_0x3478ad[_0x8090('0x8')]){logger[_0x8090('0x8')]('rpc',_0x8090('0x2'),_0x540995,_0x3478ad[_0x8090('0x8')]['message'],_0x8725d);return _0x1b979f(_0x3478ad[_0x8090('0x8')][_0x8090('0x9')]);}else{return _0x51236d(_0x3478ad['result']);}})['catch'](function(_0x243282){logger[_0x8090('0x8')](_0x8090('0xa'),'routing',_0x540995,_0x243282,_0x8725d);return _0x1b979f(_0x243282);});});};module[_0x8090('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 9a01bec..5d1e673 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 _0xc247=['then','initMailAccounts','refresh','mailAccounts','listen','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','./rpc/setting','getMailAccounts'];(function(_0x4694a0,_0x35b97f){var _0x38a2dc=function(_0x298039){while(--_0x298039){_0x4694a0['push'](_0x4694a0['shift']());}};_0x38a2dc(++_0x35b97f);}(_0xc247,0xfe));var _0x7c24=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0xc247[_0x82140];return _0x2b15a6;};'use strict';var BPromise=require(_0x7c24('0x0'));var server=require(_0x7c24('0x1'));var Realtime=require(_0x7c24('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x7c24('0x3'));var setting=require(_0x7c24('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0x7c24('0x5')]())[_0x7c24('0x6')](realtime[_0x7c24('0x7')]())[_0x7c24('0x6')](function(){email[_0x7c24('0x8')](realtime[_0x7c24('0x9')]);return realtime;});}function main(){return server[_0x7c24('0xa')](realtime,email)[_0x7c24('0x6')](function(){return initRealtime();})[_0x7c24('0x6')](function(){return setting['getSettings']();})[_0x7c24('0x6')](function(_0x517f4c){return setInterval(initRealtime,_0x517f4c['loginMailFrequency']*0x3e8);})[_0x7c24('0xb')](function(_0xd329d0){console[_0x7c24('0xc')](_0xd329d0);});}main(); \ No newline at end of file +var _0x6784=['./lib/email','./rpc/setting','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','log','./server','./realtime'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x6784,0x136));var _0x4678=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x6784[_0x2c0dc0];return _0x4c0990;};'use strict';var BPromise=require('bluebird');var server=require(_0x4678('0x0'));var Realtime=require(_0x4678('0x1'));var EmailChannel=require(_0x4678('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x4678('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x4678('0x4')](mailAccount[_0x4678('0x5')]())[_0x4678('0x4')](realtime[_0x4678('0x6')]())['then'](function(){email[_0x4678('0x7')](realtime[_0x4678('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x4678('0x4')](function(){return setting[_0x4678('0x9')]();})['then'](function(_0x4fdab2){return setInterval(initRealtime,_0x4fdab2[_0x4678('0xa')]*0x3e8);})[_0x4678('0xb')](function(_0x23be8e){console[_0x4678('0xc')](_0x23be8e);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 40c4140..90b613d 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 _0xe729=['Smtp','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','prototype','emit','name','active','Imap','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','email','handleImapEnd','error','handleImapError','status','disabled','messageStatus','connected','messages','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','verifySmtp'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0xe729,0x158));var _0x9e72=function(_0x1b20b0,_0x425f43){_0x1b20b0=_0x1b20b0-0x0;var _0x125ad3=_0xe729[_0x1b20b0];return _0x125ad3;};'use strict';var _=require(_0x9e72('0x0'));var moment=require(_0x9e72('0x1'));var BPromise=require('bluebird');var md5=require(_0x9e72('0x2'));var Redis=require(_0x9e72('0x3'));var config=require(_0x9e72('0x4'));var logger=require('../../../config/logger')('email');config[_0x9e72('0x5')]=_[_0x9e72('0x6')](config[_0x9e72('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9e72('0x7'))(new Redis(config[_0x9e72('0x5')]));var EmailImap=require(_0x9e72('0x8'));var EmailSmtp=require(_0x9e72('0x9'));var mailAccount=require(_0x9e72('0xa'));var md5Accounts={};function EmailChannel(_0x1ddda7){logger[_0x9e72('0xb')]('start\x20email\x20channel');this[_0x9e72('0xc')]=_0x1ddda7['mailAccounts'];this[_0x9e72('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x9e72('0xe')][_0x9e72('0xf')]=function(_0x2d97f1){var _0x5ece5c=this['mailAccounts'][_0x2d97f1];var _0x59f118={'id':_0x5ece5c['id'],'name':_0x5ece5c[_0x9e72('0x10')],'key':_0x5ece5c['key'],'active':_0x5ece5c[_0x9e72('0x11')],'Imap':{'status':_0x5ece5c['Imap']['status'],'messageStatus':_0x5ece5c[_0x9e72('0x12')]['messageStatus'],'total':_0x5ece5c[_0x9e72('0x12')][_0x9e72('0x13')]}};if(_[_0x9e72('0x14')](md5Accounts[_0x2d97f1])){md5Accounts[_0x2d97f1]={};}var _0x53a82d=md5(JSON[_0x9e72('0x15')](_0x59f118));if(md5Accounts[_0x2d97f1]['md5']!==_0x53a82d){md5Accounts[_0x2d97f1][_0x9e72('0x2')]=_0x53a82d;io['emit'](_0x9e72('0x16'),_0x59f118);}};EmailChannel[_0x9e72('0xe')][_0x9e72('0x17')]=function(_0x244345){for(var _0x406c52 in _0x244345){if(_0x244345[_0x9e72('0x18')](_0x406c52)){if(_0x244345[_0x406c52][_0x9e72('0x12')]&&_0x244345[_0x406c52][_0x9e72('0x11')]){var _0x5a473d=_0x244345[_0x406c52][_0x9e72('0x12')];if(!this[_0x9e72('0xd')][_0x9e72('0x18')](_0x5a473d['id'])){this[_0x9e72('0xd')][_0x5a473d['id']]=new EmailImap(_0x5a473d,_0x244345[_0x406c52]['email']);this[_0x9e72('0xd')][_0x5a473d['id']]['on'](_0x9e72('0x19'),this[_0x9e72('0x1a')][_0x9e72('0x1b')](this,_0x406c52));this['imapAccounts'][_0x5a473d['id']]['on'](_0x9e72('0x1c'),this['handleImapEmail'][_0x9e72('0x1b')](this,_0x406c52));this[_0x9e72('0xd')][_0x5a473d['id']]['on']('end',this[_0x9e72('0x1d')][_0x9e72('0x1b')](this,_0x406c52));this[_0x9e72('0xd')][_0x5a473d['id']]['on'](_0x9e72('0x1e'),this[_0x9e72('0x1f')][_0x9e72('0x1b')](this,_0x406c52));}}else{if(_['isNil'](this[_0x9e72('0xc')][_0x406c52][_0x9e72('0x12')])){this[_0x9e72('0xc')][_0x406c52]['Imap']={};}this[_0x9e72('0xc')][_0x406c52][_0x9e72('0x12')][_0x9e72('0x20')]=_0x9e72('0x21');this[_0x9e72('0xc')][_0x406c52][_0x9e72('0x12')][_0x9e72('0x22')]='';this[_0x9e72('0xf')](_0x406c52);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x364368,_0x4a75b3){if(this['mailAccounts'][_0x364368]){this[_0x9e72('0xc')][_0x364368][_0x9e72('0x12')]['status']=_0x9e72('0x23');this[_0x9e72('0xc')][_0x364368][_0x9e72('0x12')][_0x9e72('0x22')]=_0x4a75b3[_0x9e72('0x10')];if(_0x4a75b3[_0x9e72('0x24')]){this['mailAccounts'][_0x364368][_0x9e72('0x12')][_0x9e72('0x13')]=_0x4a75b3[_0x9e72('0x24')][_0x9e72('0x13')];}return this['emit'](_0x364368);}};EmailChannel[_0x9e72('0xe')]['handleImapEmail']=function(_0x4c59a6,_0x110c43){logger[_0x9e72('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x110c43[_0x9e72('0x25')],_0x110c43[_0x9e72('0x26')],_0x110c43[_0x9e72('0x27')],_0x4c59a6);if(this[_0x9e72('0xc')][_0x4c59a6]){return mailAccount['notify'](_0x4c59a6,_0x110c43)[_0x9e72('0x28')](function(_0x58013a){if(_0x58013a){logger[_0x9e72('0xb')](_0x9e72('0x29'));}})[_0x9e72('0x2a')](function(_0x4369f4){logger[_0x9e72('0x1e')](_0x9e72('0x2b'),JSON['stringify'](_0x4369f4));});}};EmailChannel[_0x9e72('0xe')][_0x9e72('0x1d')]=function(_0x1f6646){if(this['mailAccounts'][_0x1f6646]&&this['mailAccounts'][_0x1f6646][_0x9e72('0x12')]){if(this['imapAccounts'][this[_0x9e72('0xc')][_0x1f6646][_0x9e72('0x12')]['id']]){delete this[_0x9e72('0xd')][this['mailAccounts'][_0x1f6646][_0x9e72('0x12')]['id']];}this[_0x9e72('0xc')][_0x1f6646][_0x9e72('0x12')][_0x9e72('0x2c')]=moment();this[_0x9e72('0xf')](_0x1f6646);}};EmailChannel[_0x9e72('0xe')][_0x9e72('0x1f')]=function(_0x203a95,_0x2f9ffb){if(this[_0x9e72('0xc')][_0x203a95]){this[_0x9e72('0xc')][_0x203a95]['Imap']['status']='error';this[_0x9e72('0xc')][_0x203a95][_0x9e72('0x12')][_0x9e72('0x22')]=_0x2f9ffb;return this[_0x9e72('0xf')](_0x203a95);}};EmailChannel[_0x9e72('0xe')][_0x9e72('0x2d')]=function(_0x5e422b,_0x1cc0b7){return this[_0x9e72('0x2e')]['send'](_0x5e422b,_0x1cc0b7);};EmailChannel[_0x9e72('0xe')][_0x9e72('0x2f')]=function(_0x2e9d84){var _0x6a5c57=this;if(this[_0x9e72('0xc')][_0x2e9d84['id']]){if(_[_0x9e72('0x14')](this[_0x9e72('0xc')][_0x2e9d84['id']][_0x9e72('0x30')])){this[_0x9e72('0xc')][_0x2e9d84['id']][_0x9e72('0x30')]={};}this[_0x9e72('0xc')][_0x2e9d84['id']][_0x9e72('0x30')]['lastSync']=moment();return new BPromise(function(_0x42ee6b,_0x2f1f19){return _0x6a5c57[_0x9e72('0x2e')]['verify'](_0x2e9d84)[_0x9e72('0x28')](function(_0x13d4cf){_0x6a5c57[_0x9e72('0xc')][_0x2e9d84['id']][_0x9e72('0x30')]['status']='verified';_0x6a5c57[_0x9e72('0xc')][_0x2e9d84['id']][_0x9e72('0x30')]['messageStatus']='';_0x6a5c57[_0x9e72('0xf')](_0x2e9d84['id']);_0x42ee6b(_0x13d4cf);})[_0x9e72('0x2a')](function(_0x35ca37){_0x6a5c57['mailAccounts'][_0x2e9d84['id']][_0x9e72('0x30')][_0x9e72('0x20')]=_0x9e72('0x1e');_0x6a5c57[_0x9e72('0xc')][_0x2e9d84['id']][_0x9e72('0x30')][_0x9e72('0x22')]=_0x35ca37;_0x6a5c57[_0x9e72('0xf')](_0x2e9d84['id']);_0x2f1f19(_0x35ca37);});});}return this[_0x9e72('0x2e')]['verify'](_0x2e9d84);};module['exports']=EmailChannel; \ No newline at end of file +var _0x206b=['isNil','md5','mailAccount:update','refresh','hasOwnProperty','email','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','verifySmtp','Smtp','verify','verified','lodash','bluebird','ioredis','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','messageStatus','total'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x206b,0x19a));var _0xb206=function(_0xbf48eb,_0x54fb10){_0xbf48eb=_0xbf48eb-0x0;var _0x306c75=_0x206b[_0xbf48eb];return _0x306c75;};'use strict';var _=require(_0xb206('0x0'));var moment=require('moment');var BPromise=require(_0xb206('0x1'));var md5=require('md5');var Redis=require(_0xb206('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('email');config[_0xb206('0x3')]=_[_0xb206('0x4')](config['redis'],{'host':_0xb206('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xb206('0x6'));var EmailSmtp=require(_0xb206('0x7'));var mailAccount=require(_0xb206('0x8'));var md5Accounts={};function EmailChannel(_0x40822f){logger[_0xb206('0x9')](_0xb206('0xa'));this[_0xb206('0xb')]=_0x40822f[_0xb206('0xb')];this[_0xb206('0xc')]={};this[_0xb206('0xd')]=new EmailSmtp();}EmailChannel[_0xb206('0xe')][_0xb206('0xf')]=function(_0x194827){var _0x209a1c=this[_0xb206('0xb')][_0x194827];var _0x58f2ee={'id':_0x209a1c['id'],'name':_0x209a1c[_0xb206('0x10')],'key':_0x209a1c[_0xb206('0x11')],'active':_0x209a1c['active'],'Imap':{'status':_0x209a1c[_0xb206('0x12')][_0xb206('0x13')],'messageStatus':_0x209a1c[_0xb206('0x12')][_0xb206('0x14')],'total':_0x209a1c[_0xb206('0x12')][_0xb206('0x15')]}};if(_[_0xb206('0x16')](md5Accounts[_0x194827])){md5Accounts[_0x194827]={};}var _0x4ed918=md5(JSON['stringify'](_0x58f2ee));if(md5Accounts[_0x194827]['md5']!==_0x4ed918){md5Accounts[_0x194827][_0xb206('0x17')]=_0x4ed918;io[_0xb206('0xf')](_0xb206('0x18'),_0x58f2ee);}};EmailChannel[_0xb206('0xe')][_0xb206('0x19')]=function(_0x2a7756){for(var _0x569145 in _0x2a7756){if(_0x2a7756[_0xb206('0x1a')](_0x569145)){if(_0x2a7756[_0x569145]['Imap']&&_0x2a7756[_0x569145]['active']){var _0x1d856c=_0x2a7756[_0x569145][_0xb206('0x12')];if(!this['imapAccounts'][_0xb206('0x1a')](_0x1d856c['id'])){this[_0xb206('0xc')][_0x1d856c['id']]=new EmailImap(_0x1d856c,_0x2a7756[_0x569145][_0xb206('0x1b')]);this['imapAccounts'][_0x1d856c['id']]['on'](_0xb206('0x1c'),this[_0xb206('0x1d')]['bind'](this,_0x569145));this[_0xb206('0xc')][_0x1d856c['id']]['on']('email',this[_0xb206('0x1e')][_0xb206('0x1f')](this,_0x569145));this['imapAccounts'][_0x1d856c['id']]['on'](_0xb206('0x20'),this[_0xb206('0x21')]['bind'](this,_0x569145));this[_0xb206('0xc')][_0x1d856c['id']]['on'](_0xb206('0x22'),this[_0xb206('0x23')]['bind'](this,_0x569145));}}else{if(_[_0xb206('0x16')](this[_0xb206('0xb')][_0x569145][_0xb206('0x12')])){this[_0xb206('0xb')][_0x569145]['Imap']={};}this[_0xb206('0xb')][_0x569145][_0xb206('0x12')][_0xb206('0x13')]=_0xb206('0x24');this[_0xb206('0xb')][_0x569145]['Imap']['messageStatus']='';this['emit'](_0x569145);}}}};EmailChannel[_0xb206('0xe')]['handleImapBox']=function(_0x17ca87,_0x5ce73b){if(this['mailAccounts'][_0x17ca87]){this[_0xb206('0xb')][_0x17ca87]['Imap'][_0xb206('0x13')]=_0xb206('0x25');this[_0xb206('0xb')][_0x17ca87][_0xb206('0x12')][_0xb206('0x14')]=_0x5ce73b[_0xb206('0x10')];if(_0x5ce73b[_0xb206('0x26')]){this[_0xb206('0xb')][_0x17ca87][_0xb206('0x12')][_0xb206('0x15')]=_0x5ce73b['messages']['total'];}return this[_0xb206('0xf')](_0x17ca87);}};EmailChannel[_0xb206('0xe')][_0xb206('0x1e')]=function(_0x5d48df,_0x38ed73){logger[_0xb206('0x9')](_0xb206('0x27'),_0x38ed73[_0xb206('0x28')],_0x38ed73['lastName'],_0x38ed73[_0xb206('0x29')],_0x5d48df);if(this['mailAccounts'][_0x5d48df]){return mailAccount[_0xb206('0x2a')](_0x5d48df,_0x38ed73)[_0xb206('0x2b')](function(_0x246a39){if(_0x246a39){logger[_0xb206('0x9')](_0xb206('0x2c'));}})[_0xb206('0x2d')](function(_0x238f5c){logger['error'](_0xb206('0x2e'),JSON[_0xb206('0x2f')](_0x238f5c));});}};EmailChannel[_0xb206('0xe')][_0xb206('0x21')]=function(_0x3d1781){if(this[_0xb206('0xb')][_0x3d1781]&&this[_0xb206('0xb')][_0x3d1781][_0xb206('0x12')]){if(this['imapAccounts'][this[_0xb206('0xb')][_0x3d1781]['Imap']['id']]){delete this[_0xb206('0xc')][this[_0xb206('0xb')][_0x3d1781][_0xb206('0x12')]['id']];}this[_0xb206('0xb')][_0x3d1781]['Imap'][_0xb206('0x30')]=moment();this[_0xb206('0xf')](_0x3d1781);}};EmailChannel[_0xb206('0xe')][_0xb206('0x23')]=function(_0x5d067e,_0x5649c8){if(this[_0xb206('0xb')][_0x5d067e]){this[_0xb206('0xb')][_0x5d067e][_0xb206('0x12')][_0xb206('0x13')]=_0xb206('0x22');this[_0xb206('0xb')][_0x5d067e][_0xb206('0x12')][_0xb206('0x14')]=_0x5649c8;return this[_0xb206('0xf')](_0x5d067e);}};EmailChannel[_0xb206('0xe')][_0xb206('0x31')]=function(_0x4fcb37,_0x414e6b){return this[_0xb206('0xd')]['send'](_0x4fcb37,_0x414e6b);};EmailChannel['prototype'][_0xb206('0x32')]=function(_0x1763d2){var _0xd206d8=this;if(this[_0xb206('0xb')][_0x1763d2['id']]){if(_[_0xb206('0x16')](this[_0xb206('0xb')][_0x1763d2['id']][_0xb206('0x33')])){this[_0xb206('0xb')][_0x1763d2['id']][_0xb206('0x33')]={};}this[_0xb206('0xb')][_0x1763d2['id']][_0xb206('0x33')][_0xb206('0x30')]=moment();return new BPromise(function(_0x54567c,_0x24cc0e){return _0xd206d8[_0xb206('0xd')][_0xb206('0x34')](_0x1763d2)['then'](function(_0x11b3c0){_0xd206d8[_0xb206('0xb')][_0x1763d2['id']][_0xb206('0x33')][_0xb206('0x13')]=_0xb206('0x35');_0xd206d8[_0xb206('0xb')][_0x1763d2['id']][_0xb206('0x33')][_0xb206('0x14')]='';_0xd206d8[_0xb206('0xf')](_0x1763d2['id']);_0x54567c(_0x11b3c0);})[_0xb206('0x2d')](function(_0x3fec60){_0xd206d8[_0xb206('0xb')][_0x1763d2['id']][_0xb206('0x33')]['status']=_0xb206('0x22');_0xd206d8['mailAccounts'][_0x1763d2['id']][_0xb206('0x33')][_0xb206('0x14')]=_0x3fec60;_0xd206d8[_0xb206('0xf')](_0x1763d2['id']);_0x24cc0e(_0x3fec60);});});}return this['smtp']['verify'](_0x1763d2);};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 cfca339..27dc512 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 _0x7dc2=['handleCloseBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','textCode','exports','path','util','imap','lodash','mailparser','iconv','Iconv','events','../../../config/logger','email','account','getAccount','once','ready','handleReady','end','handleEnd','bind','error','inherits','prototype','connTimeout','authTimeout','authentication','user','password','host','port','tls','autotls','required','getHost','service','mailbox','handleOpenBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','handleFetchError','handleFetchEnd','closeBox'];(function(_0x1d06a5,_0x4fc577){var _0xbaab59=function(_0x458664){while(--_0x458664){_0x1d06a5['push'](_0x1d06a5['shift']());}};_0xbaab59(++_0x4fc577);}(_0x7dc2,0xeb));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0x27dc('0x0'));var util=require(_0x27dc('0x1'));var Imap=require(_0x27dc('0x2'));var _=require(_0x27dc('0x3'));var rs=require('randomstring');var simpleParser=require(_0x27dc('0x4'))['simpleParser'];var Iconv=require(_0x27dc('0x5'))[_0x27dc('0x6')];var EventEmitter=require(_0x27dc('0x7'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x27dc('0x8'))(_0x27dc('0x9'));function EmailImap(_0x18b976,_0x13d390){this['mailbox']='INBOX';this[_0x27dc('0xa')]=this[_0x27dc('0xb')](_0x18b976,_0x13d390);this[_0x27dc('0x2')]=new Imap(this[_0x27dc('0xa')]);this[_0x27dc('0x2')][_0x27dc('0xc')](_0x27dc('0xd'),this[_0x27dc('0xe')]['bind'](this));this['imap'][_0x27dc('0xc')](_0x27dc('0xf'),this[_0x27dc('0x10')][_0x27dc('0x11')](this));this[_0x27dc('0x2')]['on'](_0x27dc('0x12'),this['handleError'][_0x27dc('0x11')](this));this['imap']['connect']();}util[_0x27dc('0x13')](EmailImap,EventEmitter);EmailImap[_0x27dc('0x14')][_0x27dc('0xb')]=function(_0x132488,_0x1a0822){var _0x2e4aca={'connTimeout':_0x132488[_0x27dc('0x15')]?_0x132488[_0x27dc('0x15')]*0x3e8:0x2710,'authTimeout':_0x132488[_0x27dc('0x16')]?_0x132488[_0x27dc('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x132488['service'])){if(_0x132488[_0x27dc('0x17')]){_0x2e4aca[_0x27dc('0x18')]=_0x132488[_0x27dc('0x18')];_0x2e4aca['password']=_0x132488[_0x27dc('0x19')];}_0x2e4aca[_0x27dc('0x1a')]=_0x132488['host'];_0x2e4aca[_0x27dc('0x1b')]=_0x132488[_0x27dc('0x1b')]||0x3e1;if(_0x132488[_0x27dc('0x1c')]){_0x2e4aca[_0x27dc('0x1c')]=!![];}else{_0x2e4aca[_0x27dc('0x1c')]=![];_0x2e4aca[_0x27dc('0x1d')]=_0x27dc('0x1e');}}else{_0x2e4aca[_0x27dc('0x18')]=_0x132488['user'];_0x2e4aca[_0x27dc('0x19')]=_0x132488['password'];_0x2e4aca[_0x27dc('0x1a')]=utils[_0x27dc('0x1f')](_0x132488[_0x27dc('0x20')]);_0x2e4aca[_0x27dc('0x1b')]=0x3e1;_0x2e4aca['tls']=!![];}_0x2e4aca[_0x27dc('0x9')]=_0x1a0822||_0x132488[_0x27dc('0x18')]||'anonymous@xcally.com';return _0x2e4aca;};EmailImap[_0x27dc('0x14')][_0x27dc('0xe')]=function(){this[_0x27dc('0x2')]['openBox'](this[_0x27dc('0x21')],![],this[_0x27dc('0x22')][_0x27dc('0x11')](this));};EmailImap[_0x27dc('0x14')]['handleOpenBox']=function(_0x3c5208,_0x449f31){if(_0x3c5208){this[_0x27dc('0x23')](_0x3c5208,!![]);}else{this[_0x27dc('0x24')](_0x27dc('0x25'),_0x449f31);this[_0x27dc('0x26')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x4af2bb){if(_0x4af2bb){this[_0x27dc('0x23')](_0x4af2bb,!![]);}else{this[_0x27dc('0x2')][_0x27dc('0xf')]();}};EmailImap['prototype'][_0x27dc('0x26')]=function(){this[_0x27dc('0x2')][_0x27dc('0x27')]([_0x27dc('0x28')],this[_0x27dc('0x29')]['bind'](this));};EmailImap['prototype'][_0x27dc('0x29')]=function(_0x16117b,_0x2b9f5a){if(_0x16117b){this[_0x27dc('0x23')](_0x16117b,!![]);}else{if(_0x2b9f5a['length']){try{var _0x13196c=this[_0x27dc('0x2')]['fetch'](_0x2b9f5a,{'bodies':'','markSeen':!![]});_0x13196c['on']('message',this['handleFetchMessage'][_0x27dc('0x11')](this));_0x13196c[_0x27dc('0xc')](_0x27dc('0x12'),this[_0x27dc('0x2a')][_0x27dc('0x11')](this));_0x13196c[_0x27dc('0xc')]('end',this[_0x27dc('0x2b')][_0x27dc('0x11')](this));}catch(_0x187df0){logger[_0x27dc('0x12')](_0x187df0);}}else{this[_0x27dc('0x2')][_0x27dc('0x2c')](!![],this[_0x27dc('0x2d')]['bind'](this));}}};EmailImap[_0x27dc('0x14')][_0x27dc('0x2e')]=function(_0x4975bd,_0x6871e9){_0x4975bd['on'](_0x27dc('0x2f'),this[_0x27dc('0x30')][_0x27dc('0x11')](this));_0x4975bd[_0x27dc('0xc')](_0x27dc('0x31'),this[_0x27dc('0x32')][_0x27dc('0x11')](this));_0x4975bd[_0x27dc('0xc')](_0x27dc('0xf'),this[_0x27dc('0x33')]['bind'](this));};EmailImap[_0x27dc('0x14')][_0x27dc('0x30')]=function(_0x3dba78,_0x28308b){simpleParser(_0x3dba78,{'Iconv':Iconv},this[_0x27dc('0x34')]['bind'](this));};EmailImap[_0x27dc('0x14')][_0x27dc('0x32')]=function(_0x5576f1){};EmailImap['prototype'][_0x27dc('0x33')]=function(){};EmailImap[_0x27dc('0x14')][_0x27dc('0x34')]=function(_0x2c65e6,_0x5c91ea){if(_0x2c65e6){logger[_0x27dc('0x12')](_0x2c65e6);}else{var _0x1dc4e2=this;utils[_0x27dc('0x35')](this[_0x27dc('0xa')],_0x5c91ea,function(_0x2e0a7b){_0x1dc4e2[_0x27dc('0x24')](_0x27dc('0x9'),_0x2e0a7b);});}};EmailImap[_0x27dc('0x14')][_0x27dc('0x2b')]=function(){this[_0x27dc('0x2')][_0x27dc('0x2c')](!![],this[_0x27dc('0x2d')][_0x27dc('0x11')](this));};EmailImap['prototype'][_0x27dc('0x2a')]=function(_0xf10b8){this[_0x27dc('0x23')](_0xf10b8);this['imap'][_0x27dc('0x2c')](!![],this[_0x27dc('0x2d')][_0x27dc('0x11')](this));};EmailImap[_0x27dc('0x14')][_0x27dc('0x10')]=function(){this['emit'](_0x27dc('0xf'));};EmailImap['prototype']['handleError']=function(_0x818bc2,_0x226d8d){logger[_0x27dc('0x12')](_0x27dc('0x23'),this[_0x27dc('0xa')][_0x27dc('0x9')],JSON['stringify'](_0x818bc2));var _0x1aab19='';if(_0x818bc2){if(_0x818bc2[_0x27dc('0x36')]){_0x1aab19=_0x818bc2[_0x27dc('0x36')];}else{for(var _0x3b28ee in _0x818bc2){if(_0x818bc2['hasOwnProperty'](_0x3b28ee)){_0x1aab19+=_['upperFirst'](_0x3b28ee)+':\x20'+_0x818bc2[_0x3b28ee]+'\x0a';}}}}if(_0x226d8d){this[_0x27dc('0x2')][_0x27dc('0xf')]();}else{this['emit'](_0x27dc('0x12'),_0x1aab19);this[_0x27dc('0x24')](_0x27dc('0xf'));}};module[_0x27dc('0x37')]=EmailImap; \ No newline at end of file +var _0xdbfb=['once','bind','handleError','connect','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','getHost','service','anonymous@xcally.com','handleReady','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','error','closeBox','body','handleMessageBody','handleMessageAttributes','end','handleSimpleParser','handleMessageEnd','parser','emit','handleFetchEnd','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','simpleParser','iconv','Iconv','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','imap','account'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xdbfb,0x16b));var _0xbdbf=function(_0x5e53f3,_0x3cb950){_0x5e53f3=_0x5e53f3-0x0;var _0x5d4c1d=_0xdbfb[_0x5e53f3];return _0x5d4c1d;};'use strict';var fs=require('fs');var path=require(_0xbdbf('0x0'));var util=require(_0xbdbf('0x1'));var Imap=require('imap');var _=require(_0xbdbf('0x2'));var rs=require(_0xbdbf('0x3'));var simpleParser=require('mailparser')[_0xbdbf('0x4')];var Iconv=require(_0xbdbf('0x5'))[_0xbdbf('0x6')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xbdbf('0x7'));var logger=require(_0xbdbf('0x8'))(_0xbdbf('0x9'));function EmailImap(_0x1c818a,_0x1d068d){this[_0xbdbf('0xa')]=_0xbdbf('0xb');this['account']=this[_0xbdbf('0xc')](_0x1c818a,_0x1d068d);this[_0xbdbf('0xd')]=new Imap(this[_0xbdbf('0xe')]);this[_0xbdbf('0xd')][_0xbdbf('0xf')]('ready',this['handleReady'][_0xbdbf('0x10')](this));this['imap'][_0xbdbf('0xf')]('end',this['handleEnd']['bind'](this));this[_0xbdbf('0xd')]['on']('error',this[_0xbdbf('0x11')][_0xbdbf('0x10')](this));this[_0xbdbf('0xd')][_0xbdbf('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xbdbf('0x13')][_0xbdbf('0xc')]=function(_0x3cf2d9,_0x16dca8){var _0x1399e4={'connTimeout':_0x3cf2d9[_0xbdbf('0x14')]?_0x3cf2d9[_0xbdbf('0x14')]*0x3e8:0x2710,'authTimeout':_0x3cf2d9[_0xbdbf('0x15')]?_0x3cf2d9[_0xbdbf('0x15')]*0x3e8:0x1388};if(_[_0xbdbf('0x16')](_0x3cf2d9['service'])){if(_0x3cf2d9[_0xbdbf('0x17')]){_0x1399e4[_0xbdbf('0x18')]=_0x3cf2d9['user'];_0x1399e4['password']=_0x3cf2d9[_0xbdbf('0x19')];}_0x1399e4[_0xbdbf('0x1a')]=_0x3cf2d9[_0xbdbf('0x1a')];_0x1399e4[_0xbdbf('0x1b')]=_0x3cf2d9[_0xbdbf('0x1b')]||0x3e1;if(_0x3cf2d9[_0xbdbf('0x1c')]){_0x1399e4[_0xbdbf('0x1c')]=!![];}else{_0x1399e4[_0xbdbf('0x1c')]=![];_0x1399e4[_0xbdbf('0x1d')]=_0xbdbf('0x1e');}}else{_0x1399e4[_0xbdbf('0x18')]=_0x3cf2d9[_0xbdbf('0x18')];_0x1399e4['password']=_0x3cf2d9['password'];_0x1399e4[_0xbdbf('0x1a')]=utils[_0xbdbf('0x1f')](_0x3cf2d9[_0xbdbf('0x20')]);_0x1399e4[_0xbdbf('0x1b')]=0x3e1;_0x1399e4['tls']=!![];}_0x1399e4['email']=_0x16dca8||_0x3cf2d9[_0xbdbf('0x18')]||_0xbdbf('0x21');return _0x1399e4;};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x22')]=function(){this[_0xbdbf('0xd')][_0xbdbf('0x23')](this[_0xbdbf('0xa')],![],this[_0xbdbf('0x24')][_0xbdbf('0x10')](this));};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x24')]=function(_0x55e708,_0x136a27){if(_0x55e708){this[_0xbdbf('0x11')](_0x55e708,!![]);}else{this['emit'](_0xbdbf('0x25'),_0x136a27);this[_0xbdbf('0x26')]();}};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x27')]=function(_0x3eb4ef){if(_0x3eb4ef){this[_0xbdbf('0x11')](_0x3eb4ef,!![]);}else{this[_0xbdbf('0xd')]['end']();}};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x26')]=function(){this[_0xbdbf('0xd')][_0xbdbf('0x28')]([_0xbdbf('0x29')],this['handleReadUnseen'][_0xbdbf('0x10')](this));};EmailImap['prototype'][_0xbdbf('0x2a')]=function(_0x18fbd9,_0x58aa84){if(_0x18fbd9){this['handleError'](_0x18fbd9,!![]);}else{if(_0x58aa84[_0xbdbf('0x2b')]){try{var _0x2a82f5=this[_0xbdbf('0xd')][_0xbdbf('0x2c')](_0x58aa84,{'bodies':'','markSeen':!![]});_0x2a82f5['on'](_0xbdbf('0x2d'),this[_0xbdbf('0x2e')][_0xbdbf('0x10')](this));_0x2a82f5[_0xbdbf('0xf')]('error',this[_0xbdbf('0x2f')][_0xbdbf('0x10')](this));_0x2a82f5[_0xbdbf('0xf')]('end',this['handleFetchEnd'][_0xbdbf('0x10')](this));}catch(_0x1190d5){logger[_0xbdbf('0x30')](_0x1190d5);}}else{this[_0xbdbf('0xd')][_0xbdbf('0x31')](!![],this['handleCloseBox'][_0xbdbf('0x10')](this));}}};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x2e')]=function(_0x2254c2,_0x52274d){_0x2254c2['on'](_0xbdbf('0x32'),this[_0xbdbf('0x33')][_0xbdbf('0x10')](this));_0x2254c2[_0xbdbf('0xf')]('attributes',this[_0xbdbf('0x34')][_0xbdbf('0x10')](this));_0x2254c2[_0xbdbf('0xf')](_0xbdbf('0x35'),this['handleMessageEnd'][_0xbdbf('0x10')](this));};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x33')]=function(_0x1ecb6d,_0x27f08c){simpleParser(_0x1ecb6d,{'Iconv':Iconv},this[_0xbdbf('0x36')][_0xbdbf('0x10')](this));};EmailImap[_0xbdbf('0x13')]['handleMessageAttributes']=function(_0x268981){};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x37')]=function(){};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x36')]=function(_0x33097d,_0x2de4a1){if(_0x33097d){logger['error'](_0x33097d);}else{var _0x31496b=this;utils[_0xbdbf('0x38')](this[_0xbdbf('0xe')],_0x2de4a1,function(_0x248691){_0x31496b[_0xbdbf('0x39')]('email',_0x248691);});}};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x3a')]=function(){this[_0xbdbf('0xd')][_0xbdbf('0x31')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xbdbf('0x13')][_0xbdbf('0x2f')]=function(_0x52bc13){this[_0xbdbf('0x11')](_0x52bc13);this['imap'][_0xbdbf('0x31')](!![],this[_0xbdbf('0x27')]['bind'](this));};EmailImap[_0xbdbf('0x13')]['handleEnd']=function(){this[_0xbdbf('0x39')]('end');};EmailImap['prototype'][_0xbdbf('0x11')]=function(_0x3af2d7,_0x46f898){logger['error']('handleError',this[_0xbdbf('0xe')]['email'],JSON['stringify'](_0x3af2d7));var _0x57b466='';if(_0x3af2d7){if(_0x3af2d7[_0xbdbf('0x3b')]){_0x57b466=_0x3af2d7[_0xbdbf('0x3b')];}else{for(var _0x567e9a in _0x3af2d7){if(_0x3af2d7[_0xbdbf('0x3c')](_0x567e9a)){_0x57b466+=_[_0xbdbf('0x3d')](_0x567e9a)+':\x20'+_0x3af2d7[_0x567e9a]+'\x0a';}}}}if(_0x46f898){this['imap'][_0xbdbf('0x35')]();}else{this[_0xbdbf('0x39')](_0xbdbf('0x30'),_0x57b466);this[_0xbdbf('0x39')](_0xbdbf('0x35'));}};module[_0xbdbf('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 5df52c4..23d4254 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 _0x1590=['verify','toString','Not\x20verifired','exports','nodemailer','bluebird','prototype','send','createTransport','use','compile','sendMail'];(function(_0xd4d369,_0x4f6ad2){var _0x293e5d=function(_0xb0e6a4){while(--_0xb0e6a4){_0xd4d369['push'](_0xd4d369['shift']());}};_0x293e5d(++_0x4f6ad2);}(_0x1590,0x154));var _0x0159=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1590[_0x20a584];return _0x4b41a8;};'use strict';var nodemailer=require(_0x0159('0x0'));var BPromise=require(_0x0159('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x0159('0x2')][_0x0159('0x3')]=function(_0x136b31,_0x97e943){return new BPromise(function(_0x243235,_0x4a234f){var _0x880d7=nodemailer[_0x0159('0x4')](_0x136b31);_0x880d7[_0x0159('0x5')](_0x0159('0x6'),inlineBase64());_0x880d7[_0x0159('0x7')](_0x97e943,function(_0x2f43df,_0x52dae5){if(_0x2f43df){_0x4a234f(_0x2f43df['toString']());}else{_0x243235(_0x52dae5);}});});};EmailSmtp[_0x0159('0x2')][_0x0159('0x8')]=function(_0x318d00){return new BPromise(function(_0x30f7a1,_0x523fcb){var _0x9b2eae=nodemailer[_0x0159('0x4')](_0x318d00);_0x9b2eae['verify'](function(_0x28275d,_0x1383c3){if(_0x28275d){_0x523fcb(_0x28275d[_0x0159('0x9')]());}else{if(_0x1383c3){_0x30f7a1(_0x1383c3);}else{_0x523fcb(_0x0159('0xa'));}}});});};module[_0x0159('0xb')]=EmailSmtp; \ No newline at end of file +var _0xfe4f=['toString','verify','Not\x20verifired','exports','bluebird','nodemailer-plugin-inline-base64','prototype','use','compile','sendMail'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfe4f,0xcc));var _0xffe4=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0xfe4f[_0x27c24e];return _0x39004a;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xffe4('0x0'));var inlineBase64=require(_0xffe4('0x1'));function EmailSmtp(){}EmailSmtp[_0xffe4('0x2')]['send']=function(_0x356566,_0x1cac11){return new BPromise(function(_0x55a431,_0x55548c){var _0x9ebee2=nodemailer['createTransport'](_0x356566);_0x9ebee2[_0xffe4('0x3')](_0xffe4('0x4'),inlineBase64());_0x9ebee2[_0xffe4('0x5')](_0x1cac11,function(_0x53601c,_0x46cf38){if(_0x53601c){_0x55548c(_0x53601c[_0xffe4('0x6')]());}else{_0x55a431(_0x46cf38);}});});};EmailSmtp[_0xffe4('0x2')][_0xffe4('0x7')]=function(_0x3ee5ee){return new BPromise(function(_0x5472be,_0x3470d1){var _0x100000=nodemailer['createTransport'](_0x3ee5ee);_0x100000[_0xffe4('0x7')](function(_0x534d0f,_0x44b139){if(_0x534d0f){_0x3470d1(_0x534d0f[_0xffe4('0x6')]());}else{if(_0x44b139){_0x5472be(_0x44b139);}else{_0x3470d1(_0xffe4('0x8'));}}});});};module[_0xffe4('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 02e9f1e..acef30c 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 _0xe9ef=['email','../../../config/environment','value','address','generate','head','name','substring','indexOf','split','length','slice','join','Anonymous','isEmpty','anonymous','@xcally.com','html','test','includes','forEach','filename','replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','push','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','node-tnef'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xe9ef[_0x3a07c1];return _0x2bbe15;};'use strict';var _=require(_0xfe9e('0x0'));var moment=require('moment');var random=require(_0xfe9e('0x1'));var fs=require('fs');var path=require(_0xfe9e('0x2'));var util=require('util');var tnef=require(_0xfe9e('0x3'));var logger=require('../../../config/logger')(_0xfe9e('0x4'));var config=require(_0xfe9e('0x5'));function getAddress(_0x199f65){var _0x20d75f=_['head'](_0x199f65[_0xfe9e('0x6')]);return _0x20d75f&&_0x20d75f[_0xfe9e('0x7')]?_0x20d75f['address']:'anonymous'+random[_0xfe9e('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x4325a6){var _0xd60e70=_[_0xfe9e('0x9')](_0x4325a6['value']);if(_0xd60e70&&_0xd60e70[_0xfe9e('0xa')]){if(_0xd60e70[_0xfe9e('0xa')]==_0xd60e70[_0xfe9e('0x7')]){return _0xd60e70['name'][_0xfe9e('0xb')](0x0,_0xd60e70['name'][_0xfe9e('0xc')]('@'));}var _0x318158=_0xd60e70[_0xfe9e('0xa')][_0xfe9e('0xd')](/\s+/);return _0x318158[_0xfe9e('0xe')]>0x1?_0x318158[_0xfe9e('0xf')](0x0,-0x1)[_0xfe9e('0x10')]('\x20'):_0xd60e70[_0xfe9e('0xa')];}return _0xfe9e('0x11');}function getLastName(_0x551d72){var _0x2805cb=_[_0xfe9e('0x9')](_0x551d72['value']);if(_0x2805cb&&_0x2805cb[_0xfe9e('0xa')]){var _0x11d24e=_0x2805cb[_0xfe9e('0xa')][_0xfe9e('0xd')](/\s+/);return _0x11d24e['length']>0x1?_0x11d24e['pop']():'';}return'';}function getMails(_0x44d746,_0x463125){var _0x152d44='';for(var _0x30ad77=0x0;_0x30ad77<_0x463125['value'][_0xfe9e('0xe')];_0x30ad77+=0x1){if(_0x463125[_0xfe9e('0x6')][_0x30ad77][_0xfe9e('0x7')]!==_0x44d746){if(!_[_0xfe9e('0x12')](_0x152d44)){_0x152d44+=',';}_0x152d44+=_0x463125['value'][_0x30ad77][_0xfe9e('0xa')]||_0x463125[_0xfe9e('0x6')][_0x30ad77][_0xfe9e('0x7')]||'';_0x152d44+='\x20<';_0x152d44+=_0x463125[_0xfe9e('0x6')][_0x30ad77][_0xfe9e('0x7')]?_0x463125['value'][_0x30ad77]['address']:_0xfe9e('0x13')+random[_0xfe9e('0x8')](0x6)+_0xfe9e('0x14');_0x152d44+='>';}}return _0x152d44;}function parseEmail(_0x2a2c5d,_0x1ad37a,_0x147ae5){if(_0x1ad37a[_0xfe9e('0x15')]){var _0xb5d636=/)<[^<]*)*<\/script>/gi;while(_0xb5d636[_0xfe9e('0x16')](_0x1ad37a[_0xfe9e('0x15')])){_0x1ad37a[_0xfe9e('0x15')]=_0x1ad37a[_0xfe9e('0x15')]['replace'](_0xb5d636,'');}if(_0x1ad37a[_0xfe9e('0x15')][_0xfe9e('0x17')]('{_0x40324c['push'](_0x1df6cd[_0xfe9e('0x19')]);});var _0x3b5aea=/]+>/g;var _0x28d2cb=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x344746=_0x1ad37a[_0xfe9e('0x15')][_0xfe9e('0x1a')](_0x28d2cb,_0xfe9e('0x1b'));var _0x150e42=_0x344746[_0xfe9e('0x1a')](_0x3b5aea,_0xfe9e('0x1c'));for(let _0x267a0b=0x0;_0x267a0b<_0x40324c[_0xfe9e('0xe')];_0x267a0b++){var _0x1595a5=_0x150e42['replace']('_IMG',_0xfe9e('0x1d')+_0x40324c[_0x267a0b]+_0xfe9e('0x1e'));_0x150e42=_0x1595a5;}_0x1ad37a[_0xfe9e('0x15')]=_0x150e42;}_0x147ae5[_0xfe9e('0x1f')]=_0x1ad37a['html'];}else{_0x147ae5[_0xfe9e('0x1f')]=_0x1ad37a['textAsHtml'];}if(_0x147ae5['body']){_0x147ae5['body']=_0x147ae5[_0xfe9e('0x1f')][_0xfe9e('0x1a')](/0x0){var _0x451ab5=[_0xfe9e('0x2d'),_0xfe9e('0x2e'),_0xfe9e('0x2f')];for(var _0x11cb70=0x0;_0x11cb70<_0x1ad37a['headerLines'][_0xfe9e('0xe')];_0x11cb70++){var _0x3ebc2f=_[_0xfe9e('0xc')](_0x451ab5,_0x1ad37a[_0xfe9e('0x2c')][_0x11cb70][_0xfe9e('0x30')]);if(_0x3ebc2f>=0x0){_0x147ae5[_0xfe9e('0x31')]=!![];}}}return _0x147ae5;}exports[_0xfe9e('0x32')]=function(_0x3caf7b,_0x30d892,_0x56b092){var _0x564d72={'from':getAddress(_0x30d892[_0xfe9e('0x33')]),'firstName':getFirstName(_0x30d892[_0xfe9e('0x33')]),'lastName':getLastName(_0x30d892[_0xfe9e('0x33')]),'mapKey':_0xfe9e('0x4'),'message':{'from':getMails(_0x3caf7b['email'],_0x30d892[_0xfe9e('0x33')]),'to':_0x3caf7b[_0xfe9e('0x4')],'cc':'','subject':_0x30d892[_0xfe9e('0x34')]||'','messageId':_0x30d892[_0xfe9e('0x35')],'inReplyTo':_0x30d892[_0xfe9e('0x36')],'sentAt':moment(_0x30d892['date'])[_0xfe9e('0x26')](_0xfe9e('0x37')),'attach':![],'attachments':[]}};if(!_0x30d892[_0xfe9e('0x15')]&&!_0x30d892[_0xfe9e('0x38')]){var _0x3cda45=_[_0xfe9e('0x39')](_0x30d892['attachments'],{'contentType':'application/ms-tnef'});if(_0x3cda45[_0xfe9e('0xe')]){logger[_0xfe9e('0x3a')](util[_0xfe9e('0x26')](_0xfe9e('0x3b'),_0x30d892[_0xfe9e('0x35')]));tnef[_0xfe9e('0x3c')](_['first'](_0x3cda45)['content'],function(_0x3e7c73,_0x27e57e){if(_0x27e57e){_0x30d892[_0xfe9e('0x15')]=_0x27e57e['BodyHTML']||_0xfe9e('0x3d');if(_0x27e57e[_0xfe9e('0x3e')]){for(var _0xad0a90=0x0;_0xad0a90<_0x27e57e[_0xfe9e('0x3e')]['length'];_0xad0a90++){var _0x221ac8=_0x27e57e[_0xfe9e('0x3e')][_0xad0a90];_0x564d72[_0xfe9e('0x21')][_0xfe9e('0x22')][_0xfe9e('0x3f')]({'filename':_0x221ac8['Title'],'content':Buffer[_0xfe9e('0x33')](_0x221ac8[_0xfe9e('0x40')])});}}}_0x56b092(parseEmail(_0x3caf7b,_0x30d892,_0x564d72));});}else{_0x30d892[_0xfe9e('0x15')]=_0xfe9e('0x3d');_0x56b092(parseEmail(_0x3caf7b,_0x30d892,_0x564d72));}}else{_0x56b092(parseEmail(_0x3caf7b,_0x30d892,_0x564d72));}};exports['getHost']=function(_0x4cb9f9){switch(_0x4cb9f9){case _0xfe9e('0x41'):return _0xfe9e('0x42');case _0xfe9e('0x43'):return _0xfe9e('0x44');case _0xfe9e('0x45'):return _0xfe9e('0x46');case _0xfe9e('0x47'):return _0xfe9e('0x48');}return _0xfe9e('0x49');}; \ No newline at end of file +var _0x3c8b=['bcc','attach','type','attachment','attachment-','now','root','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','parser','from','subject','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','format','first','

Empty\x20message

','Attachments','Title','Data','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','path','util','node-tnef','email','../../../config/environment','head','value','address','generate','name','indexOf','length','join','Anonymous','pop','isEmpty','anonymous','@xcally.com','test','html','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x21eac8['slice'](0x0,-0x1)[_0xb3c8('0xd')]('\x20'):_0x1010d9['name'];}return _0xb3c8('0xe');}function getLastName(_0x36a816){var _0x34d866=_['head'](_0x36a816['value']);if(_0x34d866&&_0x34d866[_0xb3c8('0xa')]){var _0x2b38e4=_0x34d866[_0xb3c8('0xa')]['split'](/\s+/);return _0x2b38e4['length']>0x1?_0x2b38e4[_0xb3c8('0xf')]():'';}return'';}function getMails(_0x1ae662,_0x124ab6){var _0x47edd7='';for(var _0x2ecca3=0x0;_0x2ecca3<_0x124ab6[_0xb3c8('0x7')][_0xb3c8('0xc')];_0x2ecca3+=0x1){if(_0x124ab6[_0xb3c8('0x7')][_0x2ecca3][_0xb3c8('0x8')]!==_0x1ae662){if(!_[_0xb3c8('0x10')](_0x47edd7)){_0x47edd7+=',';}_0x47edd7+=_0x124ab6[_0xb3c8('0x7')][_0x2ecca3][_0xb3c8('0xa')]||_0x124ab6[_0xb3c8('0x7')][_0x2ecca3]['address']||'';_0x47edd7+='\x20<';_0x47edd7+=_0x124ab6['value'][_0x2ecca3][_0xb3c8('0x8')]?_0x124ab6['value'][_0x2ecca3]['address']:_0xb3c8('0x11')+random['generate'](0x6)+_0xb3c8('0x12');_0x47edd7+='>';}}return _0x47edd7;}function parseEmail(_0x5218df,_0x4a9f37,_0x223fd9){if(_0x4a9f37['html']){var _0x3f209a=/)<[^<]*)*<\/script>/gi;while(_0x3f209a[_0xb3c8('0x13')](_0x4a9f37[_0xb3c8('0x14')])){_0x4a9f37['html']=_0x4a9f37[_0xb3c8('0x14')]['replace'](_0x3f209a,'');}if(_0x4a9f37[_0xb3c8('0x14')][_0xb3c8('0x15')](_0xb3c8('0x16'))){var _0x22a3b4=[];_0x4a9f37[_0xb3c8('0x17')][_0xb3c8('0x18')](_0x27c593=>{_0x22a3b4[_0xb3c8('0x19')](_0x27c593[_0xb3c8('0x1a')]);});var _0x557be7=/]+>/g;var _0x4325e5=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5d941e=_0x4a9f37[_0xb3c8('0x14')][_0xb3c8('0x1b')](_0x4325e5,_0xb3c8('0x1c'));var _0x1d0b73=_0x5d941e['replace'](_0x557be7,_0xb3c8('0x1d'));for(let _0x657ae1=0x0;_0x657ae1<_0x22a3b4[_0xb3c8('0xc')];_0x657ae1++){var _0x1622e2=_0x1d0b73[_0xb3c8('0x1b')](_0xb3c8('0x1d'),_0xb3c8('0x1e')+_0x22a3b4[_0x657ae1]+'\x20]');_0x1d0b73=_0x1622e2;}_0x4a9f37[_0xb3c8('0x14')]=_0x1d0b73;}_0x223fd9[_0xb3c8('0x1f')]=_0x4a9f37['html'];}else{_0x223fd9[_0xb3c8('0x1f')]=_0x4a9f37[_0xb3c8('0x20')];}if(_0x223fd9[_0xb3c8('0x1f')]){_0x223fd9[_0xb3c8('0x1f')]=_0x223fd9[_0xb3c8('0x1f')][_0xb3c8('0x1b')](/0x0){var _0x34deb3=[_0xb3c8('0x30'),_0xb3c8('0x31'),_0xb3c8('0x32')];for(var _0x1b9672=0x0;_0x1b9672<_0x4a9f37['headerLines'][_0xb3c8('0xc')];_0x1b9672++){var _0x102cd8=_[_0xb3c8('0xb')](_0x34deb3,_0x4a9f37[_0xb3c8('0x2f')][_0x1b9672]['line']);if(_0x102cd8>=0x0){_0x223fd9['isAutoreply']=!![];}}}return _0x223fd9;}exports[_0xb3c8('0x33')]=function(_0x371f4a,_0x149354,_0x59d5e2){var _0x795f8c={'from':getAddress(_0x149354[_0xb3c8('0x34')]),'firstName':getFirstName(_0x149354[_0xb3c8('0x34')]),'lastName':getLastName(_0x149354[_0xb3c8('0x34')]),'mapKey':_0xb3c8('0x4'),'message':{'from':getMails(_0x371f4a['email'],_0x149354[_0xb3c8('0x34')]),'to':_0x371f4a[_0xb3c8('0x4')],'cc':'','subject':_0x149354[_0xb3c8('0x35')]||'','messageId':_0x149354['messageId'],'inReplyTo':_0x149354['inReplyTo'],'sentAt':moment(_0x149354[_0xb3c8('0x36')])['format'](_0xb3c8('0x37')),'attach':![],'attachments':[]}};if(!_0x149354[_0xb3c8('0x14')]&&!_0x149354[_0xb3c8('0x20')]){var _0x395ed9=_['filter'](_0x149354['attachments'],{'contentType':_0xb3c8('0x38')});if(_0x395ed9[_0xb3c8('0xc')]){logger[_0xb3c8('0x39')](util[_0xb3c8('0x3a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x149354['messageId']));tnef['parseBuffer'](_[_0xb3c8('0x3b')](_0x395ed9)[_0xb3c8('0x2d')],function(_0x1ae0bf,_0x91bad9){if(_0x91bad9){_0x149354[_0xb3c8('0x14')]=_0x91bad9['BodyHTML']||_0xb3c8('0x3c');if(_0x91bad9[_0xb3c8('0x3d')]){for(var _0x214b75=0x0;_0x214b75<_0x91bad9[_0xb3c8('0x3d')][_0xb3c8('0xc')];_0x214b75++){var _0x406a9e=_0x91bad9[_0xb3c8('0x3d')][_0x214b75];_0x795f8c[_0xb3c8('0x23')][_0xb3c8('0x17')]['push']({'filename':_0x406a9e[_0xb3c8('0x3e')],'content':Buffer[_0xb3c8('0x34')](_0x406a9e[_0xb3c8('0x3f')])});}}}_0x59d5e2(parseEmail(_0x371f4a,_0x149354,_0x795f8c));});}else{_0x149354[_0xb3c8('0x14')]=_0xb3c8('0x3c');_0x59d5e2(parseEmail(_0x371f4a,_0x149354,_0x795f8c));}}else{_0x59d5e2(parseEmail(_0x371f4a,_0x149354,_0x795f8c));}};exports['getHost']=function(_0x3da4a3){switch(_0x3da4a3){case'gmail':return _0xb3c8('0x40');case _0xb3c8('0x41'):return _0xb3c8('0x42');case _0xb3c8('0x43'):return _0xb3c8('0x44');case _0xb3c8('0x45'):return _0xb3c8('0x46');}return _0xb3c8('0x47');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 6da34dd..5b4a6af 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 _0x92f3=['name','Service','key','active','Imap','Smtp'];(function(_0x154b19,_0x21e4cf){var _0x10f433=function(_0x44e746){while(--_0x44e746){_0x154b19['push'](_0x154b19['shift']());}};_0x10f433(++_0x21e4cf);}(_0x92f3,0xa2));var _0x392f=function(_0x25c5a4,_0x1922b9){_0x25c5a4=_0x25c5a4-0x0;var _0x3f191b=_0x92f3[_0x25c5a4];return _0x3f191b;};'use strict';var _=require('lodash');function MailAccount(_0x500396){this['id']=_0x500396['id']||0x0;this[_0x392f('0x0')]=_0x500396[_0x392f('0x0')]||_0x392f('0x1');this['key']=_0x500396[_0x392f('0x2')]||'SERV';this[_0x392f('0x3')]=_0x500396[_0x392f('0x3')]||![];this[_0x392f('0x4')]=_0x500396['Imap']||[];this[_0x392f('0x5')]=_0x500396[_0x392f('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xed1f=['SERV','Imap','Smtp','exports','lodash','name','key'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed1f,0x154));var _0xfed1=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xed1f[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xfed1('0x0'));function MailAccount(_0x6351a0){this['id']=_0x6351a0['id']||0x0;this['name']=_0x6351a0[_0xfed1('0x1')]||'Service';this[_0xfed1('0x2')]=_0x6351a0[_0xfed1('0x2')]||_0xfed1('0x3');this['active']=_0x6351a0['active']||![];this['Imap']=_0x6351a0[_0xfed1('0x4')]||[];this[_0xfed1('0x5')]=_0x6351a0['Smtp']||[];}module[_0xfed1('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 dbe7779..4daaae5 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 _0xb669=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge','exports','lodash'];(function(_0x3b94ee,_0x4193dd){var _0x136d08=function(_0x3809a0){while(--_0x3809a0){_0x3b94ee['push'](_0x3b94ee['shift']());}};_0x136d08(++_0x4193dd);}(_0xb669,0x185));var _0x9b66=function(_0x3bcfa7,_0x1f3a4a){_0x3bcfa7=_0x3bcfa7-0x0;var _0x261583=_0xb669[_0x3bcfa7];return _0x261583;};'use strict';var _=require(_0x9b66('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x9b66('0x1')]={};};function freeIsNotKey(_0x17b2ae,_0x4619ee,_0x4f64e3){var _0x85823e=_[_0x9b66('0x2')](_0x17b2ae,function(_0x1e4e12,_0xd1adae){return _0x1e4e12[_0x4f64e3];});for(var _0x279703 in _0x4619ee){if(_0x4619ee[_0x9b66('0x3')](_0x279703)){if(!_0x85823e[_0x279703]){delete _0x4619ee[_0x279703];}}}}Realtime[_0x9b66('0x4')][_0x9b66('0x5')]=function(_0x2ae1b7,_0x240b3b){for(var _0x4ca1db in _0x240b3b){if(_0x2ae1b7[_0x9b66('0x3')](_0x4ca1db)){_0x2ae1b7[_0x4ca1db]=_0x240b3b[_0x4ca1db];}}};Realtime[_0x9b66('0x4')]['initMailAccounts']=function(){var _0x5838ee=this;return function(_0x297140){if(_0x297140){freeIsNotKey(_0x297140,_0x5838ee['mailAccounts'],'id');for(var _0x2d455d=0x0,_0x5b4269={},_0x5c4cc8={};_0x2d455d<_0x297140[_0x9b66('0x6')];_0x2d455d+=0x1){_0x5b4269=_0x297140[_0x2d455d];if(_[_0x9b66('0x7')](_0x5838ee[_0x9b66('0x1')][_0x5b4269['id']])){_0x5838ee['mailAccounts'][_0x5b4269['id']]=new MailAccount(_0x5b4269);}else{_[_0x9b66('0x8')](_0x5838ee[_0x9b66('0x1')][_0x5b4269['id']],_0x5b4269);}}}return _0x5838ee[_0x9b66('0x1')];};};module[_0x9b66('0x9')]=Realtime; \ No newline at end of file +var _0x19e2=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x32c8ed,_0x45fef2){var _0x580764=function(_0xeb440e){while(--_0xeb440e){_0x32c8ed['push'](_0x32c8ed['shift']());}};_0x580764(++_0x45fef2);}(_0x19e2,0xcd));var _0x219e=function(_0x4045aa,_0xab173f){_0x4045aa=_0x4045aa-0x0;var _0x548db3=_0x19e2[_0x4045aa];return _0x548db3;};'use strict';var _=require(_0x219e('0x0'));var MailAccount=require(_0x219e('0x1'));var Realtime=function(){this[_0x219e('0x2')]={};};function freeIsNotKey(_0x3fcd5a,_0x5d67fc,_0x391acb){var _0x1f688c=_[_0x219e('0x3')](_0x3fcd5a,function(_0x3f1487,_0x2610d5){return _0x3f1487[_0x391acb];});for(var _0xff28d5 in _0x5d67fc){if(_0x5d67fc[_0x219e('0x4')](_0xff28d5)){if(!_0x1f688c[_0xff28d5]){delete _0x5d67fc[_0xff28d5];}}}}Realtime[_0x219e('0x5')][_0x219e('0x6')]=function(_0x33d50e,_0x3807d3){for(var _0x272c51 in _0x3807d3){if(_0x33d50e['hasOwnProperty'](_0x272c51)){_0x33d50e[_0x272c51]=_0x3807d3[_0x272c51];}}};Realtime[_0x219e('0x5')][_0x219e('0x7')]=function(){var _0x5f3842=this;return function(_0x45473d){if(_0x45473d){freeIsNotKey(_0x45473d,_0x5f3842[_0x219e('0x2')],'id');for(var _0x19eef3=0x0,_0x5156fe={},_0xd73cd8={};_0x19eef3<_0x45473d[_0x219e('0x8')];_0x19eef3+=0x1){_0x5156fe=_0x45473d[_0x19eef3];if(_[_0x219e('0x9')](_0x5f3842[_0x219e('0x2')][_0x5156fe['id']])){_0x5f3842[_0x219e('0x2')][_0x5156fe['id']]=new MailAccount(_0x5156fe);}else{_[_0x219e('0xa')](_0x5f3842[_0x219e('0x2')][_0x5156fe['id']],_0x5156fe);}}}return _0x5f3842[_0x219e('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 4a8c04f..da4825f 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 _0xccd4=['getMailAccounts','Request','GetMailAccount','name','service','email','active','key','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xccd4,0xa4));var _0x4ccd=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xccd4[_0x710815];return _0x5b3b89;};'use strict';var client=require(_0x4ccd('0x0'));exports[_0x4ccd('0x1')]=function(){return function(){return client[_0x4ccd('0x2')](_0x4ccd('0x3'),{'options':{'attributes':['id',_0x4ccd('0x4'),_0x4ccd('0x5'),_0x4ccd('0x6'),_0x4ccd('0x7'),_0x4ccd('0x8'),'ListId','TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0x4ccd('0x9')},{'model':_0x4ccd('0xa'),'as':_0x4ccd('0xb')}]},'log':_0x4ccd('0xc')});};};exports[_0x4ccd('0xd')]=function(_0x3c5b28,_0x50ab0f){return client[_0x4ccd('0x2')](_0x4ccd('0xe'),{'account':{'id':_0x3c5b28},'body':_0x50ab0f,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x79d7=['../client','Request','GetMailAccount','name','service','email','active','ListId','TemplateId','MailServerIn','Smtp','notify'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x79d7,0x9c));var _0x779d=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x79d7[_0x2d2c16];return _0x53f2fb;};'use strict';var client=require(_0x779d('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x779d('0x1')](_0x779d('0x2'),{'options':{'attributes':['id',_0x779d('0x3'),_0x779d('0x4'),_0x779d('0x5'),_0x779d('0x6'),'key',_0x779d('0x7'),_0x779d('0x8')],'raw':![],'include':[{'model':_0x779d('0x9'),'as':'Imap'},{'model':'MailServerOut','as':_0x779d('0xa')}]},'log':'getMailAccount'});};};exports[_0x779d('0xb')]=function(_0x2f83f6,_0x4c7c92){return client['Request']('NotifyMailAccount',{'account':{'id':_0x2f83f6},'body':_0x4c7c92,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index ce2e2e7..a69abae 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 _0x091b=['loginMailFrequency','GetSettings','getSettings','Request'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x091b,0xaa));var _0xb091=function(_0x42c2ca,_0x168698){_0x42c2ca=_0x42c2ca-0x0;var _0x500f20=_0x091b[_0x42c2ca];return _0x500f20;};'use strict';var client=require('../client');exports[_0xb091('0x0')]=function(){return client[_0xb091('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb091('0x2')]},'log':_0xb091('0x3')});}; \ No newline at end of file +var _0xdbff=['loginMailFrequency','getSettings','Request','ShowSetting'];(function(_0x15f540,_0x596940){var _0x5c3174=function(_0x403f86){while(--_0x403f86){_0x15f540['push'](_0x15f540['shift']());}};_0x5c3174(++_0x596940);}(_0xdbff,0x199));var _0xfdbf=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xdbff[_0x15bc81];return _0x59440e;};'use strict';var client=require('../client');exports[_0xfdbf('0x0')]=function(){return client[_0xfdbf('0x1')](_0xfdbf('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfdbf('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 5746810..11dd162 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +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(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 0400807..e2ffb80 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 _0x4cf8=['log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','redis','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x4cf8,0x1e5));var _0x84cf=function(_0x2f3947,_0x2ee083){_0x2f3947=_0x2f3947-0x0;var _0x3e6ab7=_0x4cf8[_0x2f3947];return _0x3e6ab7;};'use strict';var _=require(_0x84cf('0x0'));var http=require('http');var express=require(_0x84cf('0x1'));var sticky=require(_0x84cf('0x2'));var Redis=require(_0x84cf('0x3'));var config=require(_0x84cf('0x4'));var app=express();var server=http[_0x84cf('0x5')](app);server[_0x84cf('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x84cf('0x7')])){var socketio=require(_0x84cf('0x8'))(server,{'transports':[_0x84cf('0x9'),_0x84cf('0xa')]});config[_0x84cf('0xb')]=_['defaults'](config[_0x84cf('0xb')],{'host':_0x84cf('0xc'),'port':0x18eb});socketio[_0x84cf('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x84cf('0xb')]),'subClient':new Redis(config[_0x84cf('0xb')])}));require(_0x84cf('0xe'))[_0x84cf('0xf')]();require(_0x84cf('0x10'))[_0x84cf('0xf')](socketio);require(_0x84cf('0x11'))[_0x84cf('0xf')](app);require(_0x84cf('0x12'))['default'](app);}else{server[_0x84cf('0x13')](_0x84cf('0x14'),function(){console[_0x84cf('0x15')](_0x84cf('0x16'),config[_0x84cf('0x7')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x3b8e=['socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','lodash','http','express','sticky-session','createServer','listen','port','websocket','polling','redis','adapter'];(function(_0x2fbeef,_0x5746d1){var _0x378253=function(_0x4206a4){while(--_0x4206a4){_0x2fbeef['push'](_0x2fbeef['shift']());}};_0x378253(++_0x5746d1);}(_0x3b8e,0x1d8));var _0xe3b8=function(_0x23e8a9,_0x9e24c){_0x23e8a9=_0x23e8a9-0x0;var _0x1b003a=_0x3b8e[_0x23e8a9];return _0x1b003a;};'use strict';var _=require(_0xe3b8('0x0'));var http=require(_0xe3b8('0x1'));var express=require(_0xe3b8('0x2'));var sticky=require(_0xe3b8('0x3'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0xe3b8('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xe3b8('0x5')](server,config[_0xe3b8('0x6')])){var socketio=require('socket.io')(server,{'transports':[_0xe3b8('0x7'),_0xe3b8('0x8')]});config[_0xe3b8('0x9')]=_['defaults'](config[_0xe3b8('0x9')],{'host':'localhost','port':0x18eb});socketio[_0xe3b8('0xa')](require(_0xe3b8('0xb'))({'pubClient':new Redis(config[_0xe3b8('0x9')]),'subClient':new Redis(config[_0xe3b8('0x9')])}));require(_0xe3b8('0xc'))[_0xe3b8('0xd')]();require(_0xe3b8('0xe'))[_0xe3b8('0xd')](socketio);require(_0xe3b8('0xf'))[_0xe3b8('0xd')](app);require(_0xe3b8('0x10'))[_0xe3b8('0xd')](app);}else{server[_0xe3b8('0x11')](_0xe3b8('0x12'),function(){console[_0xe3b8('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe3b8('0x6')]);});}exports=module[_0xe3b8('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 98159d2..5b51d81 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 _0x83ff=['routing','client','http','request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x5c18e2,_0x63cd56){var _0xed2728=function(_0x56babd){while(--_0x56babd){_0x5c18e2['push'](_0x5c18e2['shift']());}};_0xed2728(++_0x63cd56);}(_0x83ff,0x1af));var _0xf83f=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x83ff[_0x4b2863];return _0x567d67;};'use strict';var jayson=require(_0xf83f('0x0'));var BPromise=require(_0xf83f('0x1'));var logger=require(_0xf83f('0x2'))(_0xf83f('0x3'));var client=jayson[_0xf83f('0x4')][_0xf83f('0x5')]({'port':0x2329});client['Request']=function(_0x22f732,_0xcfab26){return new BPromise(function(_0x448216,_0x23f2fc){return client[_0xf83f('0x6')](_0x22f732,_0xcfab26)[_0xf83f('0x7')](function(_0x58d353){logger[_0xf83f('0x8')](_0xf83f('0x9'),_0xf83f('0x3'),_0x22f732,_0xcfab26,_0x58d353);if(_0x58d353[_0xf83f('0xa')]){logger[_0xf83f('0xa')]('rpc',_0xf83f('0x3'),_0x22f732,_0x58d353['error'][_0xf83f('0xb')],_0xcfab26);return _0x23f2fc(_0x58d353[_0xf83f('0xa')][_0xf83f('0xb')]);}else{return _0x448216(_0x58d353['result']);}})[_0xf83f('0xc')](function(_0x260534){logger[_0xf83f('0xa')](_0xf83f('0x9'),_0xf83f('0x3'),_0x22f732,_0x260534,_0xcfab26);return _0x23f2fc(_0x260534);});});};module[_0xf83f('0xd')]=client; \ No newline at end of file +var _0x4ee5=['../../config/logger','routing','client','http','Request','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x1dde5d,_0x433089){var _0x376ec1=function(_0x6a0d59){while(--_0x6a0d59){_0x1dde5d['push'](_0x1dde5d['shift']());}};_0x376ec1(++_0x433089);}(_0x4ee5,0xb4));var _0x54ee=function(_0x1360f6,_0x42fd0e){_0x1360f6=_0x1360f6-0x0;var _0x4dc3bd=_0x4ee5[_0x1360f6];return _0x4dc3bd;};'use strict';var jayson=require(_0x54ee('0x0'));var BPromise=require(_0x54ee('0x1'));var logger=require(_0x54ee('0x2'))(_0x54ee('0x3'));var client=jayson[_0x54ee('0x4')][_0x54ee('0x5')]({'port':0x2329});client[_0x54ee('0x6')]=function(_0x426ff8,_0x7e1487){return new BPromise(function(_0x46c229,_0x3bdefe){return client['request'](_0x426ff8,_0x7e1487)['then'](function(_0x1478ce){logger[_0x54ee('0x7')](_0x54ee('0x8'),_0x54ee('0x3'),_0x426ff8,_0x7e1487,_0x1478ce);if(_0x1478ce[_0x54ee('0x9')]){logger[_0x54ee('0x9')](_0x54ee('0x8'),'routing',_0x426ff8,_0x1478ce[_0x54ee('0x9')]['message'],_0x7e1487);return _0x3bdefe(_0x1478ce[_0x54ee('0x9')][_0x54ee('0xa')]);}else{return _0x46c229(_0x1478ce[_0x54ee('0xb')]);}})[_0x54ee('0xc')](function(_0x4eeafd){logger[_0x54ee('0x9')](_0x54ee('0x8'),_0x54ee('0x3'),_0x426ff8,_0x4eeafd,_0x7e1487);return _0x3bdefe(_0x4eeafd);});});};module[_0x54ee('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 3f4ee33..cef15f1 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 _0x7e2a=['./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','initAgents','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','initWhatsappQueues','listen','catch','bluebird','./server','./realtime'];(function(_0x292688,_0x4ed5d4){var _0x12f117=function(_0x528959){while(--_0x528959){_0x292688['push'](_0x292688['shift']());}};_0x12f117(++_0x4ed5d4);}(_0x7e2a,0xed));var _0xa7e2=function(_0x4a411b,_0xa4fbb1){_0x4a411b=_0x4a411b-0x0;var _0x4f415f=_0x7e2a[_0x4a411b];return _0x4f415f;};'use strict';var BPromise=require(_0xa7e2('0x0'));var server=require(_0xa7e2('0x1'));var Realtime=require(_0xa7e2('0x2'));var user=require('./rpc/user');var interval=require(_0xa7e2('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xa7e2('0x4'));var smsQueue=require(_0xa7e2('0x5'));var mailQueue=require(_0xa7e2('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xa7e2('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa7e2('0x8')]()[_0xa7e2('0x9')](user['getAgents']())['then'](realtime[_0xa7e2('0xa')]())[_0xa7e2('0x9')](interval['getIntervals']())[_0xa7e2('0x9')](realtime['initIntervals']())[_0xa7e2('0x9')](openchannelQueue[_0xa7e2('0xb')]())[_0xa7e2('0x9')](realtime[_0xa7e2('0xc')]())['then'](chatQueue['getChatQueues']())['then'](realtime[_0xa7e2('0xd')]())[_0xa7e2('0x9')](smsQueue['getSmsQueues']())[_0xa7e2('0x9')](realtime[_0xa7e2('0xe')]())[_0xa7e2('0x9')](mailQueue[_0xa7e2('0xf')]())[_0xa7e2('0x9')](realtime['initMailQueues']())['then'](faxQueue[_0xa7e2('0x10')]())[_0xa7e2('0x9')](realtime['initFaxQueues']())['then'](whatsappQueue['getWhatsappQueues']())[_0xa7e2('0x9')](realtime[_0xa7e2('0x11')]())['then'](function(){return realtime;});}function main(){return server[_0xa7e2('0x12')](realtime)[_0xa7e2('0x9')](function(_0x506919){return initRealtime();})[_0xa7e2('0x9')](function(_0x15148a){return setInterval(initRealtime,0x1388);})[_0xa7e2('0x13')](function(_0x4cb46d){console['log'](_0x4cb46d);});}main(); \ No newline at end of file +var _0x05ad=['listen','catch','log','bluebird','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x05ad,0x1e7));var _0xd05a=function(_0x5196e4,_0x39be6f){_0x5196e4=_0x5196e4-0x0;var _0x5b0686=_0x05ad[_0x5196e4];return _0x5b0686;};'use strict';var BPromise=require(_0xd05a('0x0'));var server=require('./server');var Realtime=require(_0xd05a('0x1'));var user=require('./rpc/user');var interval=require(_0xd05a('0x2'));var openchannelQueue=require(_0xd05a('0x3'));var chatQueue=require(_0xd05a('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xd05a('0x5'));var faxQueue=require(_0xd05a('0x6'));var whatsappQueue=require(_0xd05a('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd05a('0x8')]()['then'](user['getAgents']())[_0xd05a('0x9')](realtime[_0xd05a('0xa')]())[_0xd05a('0x9')](interval['getIntervals']())[_0xd05a('0x9')](realtime[_0xd05a('0xb')]())[_0xd05a('0x9')](openchannelQueue['getOpenchannelQueues']())[_0xd05a('0x9')](realtime[_0xd05a('0xc')]())[_0xd05a('0x9')](chatQueue[_0xd05a('0xd')]())[_0xd05a('0x9')](realtime[_0xd05a('0xe')]())[_0xd05a('0x9')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0xd05a('0x9')](mailQueue['getMailQueues']())[_0xd05a('0x9')](realtime[_0xd05a('0xf')]())['then'](faxQueue[_0xd05a('0x10')]())[_0xd05a('0x9')](realtime[_0xd05a('0x11')]())[_0xd05a('0x9')](whatsappQueue[_0xd05a('0x12')]())[_0xd05a('0x9')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0xd05a('0x13')](realtime)[_0xd05a('0x9')](function(_0x3dd1f1){return initRealtime();})[_0xd05a('0x9')](function(_0x3fe7ea){return setInterval(initRealtime,0x1388);})[_0xd05a('0x14')](function(_0x1e9fe9){console[_0xd05a('0x15')](_0x1e9fe9);});}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 c99540b..c9b3c33 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x1261[_0x169e53];return _0x252bb3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x38a653,_0x1a5872){var _0x370492=function(_0x33a556){while(--_0x33a556){_0x38a653['push'](_0x38a653['shift']());}};_0x370492(++_0x1a5872);}(_0x814b,0x1a2));var _0xb814=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0x814b[_0xa5d9f9];return _0x40e9f6;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index b51d941..e59bba0 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 _0x012f=['client','http','request','then','error','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x26afb0,_0x2f89a3){var _0x1623c4=function(_0x50b0c0){while(--_0x50b0c0){_0x26afb0['push'](_0x26afb0['shift']());}};_0x1623c4(++_0x2f89a3);}(_0x012f,0x13f));var _0xf012=function(_0x2d27af,_0x372192){_0x2d27af=_0x2d27af-0x0;var _0x536700=_0x012f[_0x2d27af];return _0x536700;};'use strict';var BPromise=require(_0xf012('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xf012('0x1')][_0xf012('0x2')]({'port':0x232b});function request(_0xb5b30d,_0x53140c){return new BPromise(function(_0x57723e,_0x4b3caa){return client[_0xf012('0x3')](_0xb5b30d,_0x53140c)[_0xf012('0x4')](function(_0x3ef566){if(_0x3ef566[_0xf012('0x5')]){return _0x4b3caa(_0x3ef566[_0xf012('0x5')]['message']);}else{return _0x57723e(_0x3ef566[_0xf012('0x6')]);}})[_0xf012('0x7')](function(_0x4e82cc){return _0x4b3caa(_0x4e82cc);});});}exports[_0xf012('0x8')]=function(_0x50d5aa,_0x57b71a){return request(_0xf012('0x9'),{'account':_0x50d5aa,'message':_0x57b71a});}; \ No newline at end of file +var _0x7fa9=['catch','sendMailMessage','jayson/promise','client','http','request','then','error','message','result'];(function(_0x221bd3,_0x6d9ec2){var _0x571c9a=function(_0x4c52ef){while(--_0x4c52ef){_0x221bd3['push'](_0x221bd3['shift']());}};_0x571c9a(++_0x6d9ec2);}(_0x7fa9,0x188));var _0x97fa=function(_0x5bdefc,_0x261e81){_0x5bdefc=_0x5bdefc-0x0;var _0x53e883=_0x7fa9[_0x5bdefc];return _0x53e883;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x97fa('0x0'));var client=jayson[_0x97fa('0x1')][_0x97fa('0x2')]({'port':0x232b});function request(_0x2fc8c0,_0x1c4767){return new BPromise(function(_0x576d62,_0x40b6d4){return client[_0x97fa('0x3')](_0x2fc8c0,_0x1c4767)[_0x97fa('0x4')](function(_0x41ada8){if(_0x41ada8[_0x97fa('0x5')]){return _0x40b6d4(_0x41ada8['error'][_0x97fa('0x6')]);}else{return _0x576d62(_0x41ada8[_0x97fa('0x7')]);}})[_0x97fa('0x8')](function(_0x284914){return _0x40b6d4(_0x284914);});});}exports[_0x97fa('0x9')]=function(_0x4e8f02,_0xc31c1a){return request('SendMail',{'account':_0x4e8f02,'message':_0xc31c1a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 37179e8..c1f3fbc 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 _0xc91e=['whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','smsCapacity','whatsappCapacity','openchannelStatusTime','emit','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','whatsappStatus','whatsappStatusTime','whatsappCurrentCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','Capacity','CurrentCapacity','maxcapacity','working','mail','chat','openchannel','fax','sms'];(function(_0x341a5a,_0x4ae5ed){var _0x53f85b=function(_0x24899d){while(--_0x24899d){_0x341a5a['push'](_0x341a5a['shift']());}};_0x53f85b(++_0x4ae5ed);}(_0xc91e,0xf3));var _0xec91=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc91e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0xec91('0x0'));var md5=require(_0xec91('0x1'));var Redis=require(_0xec91('0x2'));var config=require(_0xec91('0x3'));config[_0xec91('0x4')]=_['defaults'](config[_0xec91('0x4')],{'host':_0xec91('0x5'),'port':0x18eb});var io=require(_0xec91('0x6'))(new Redis(config[_0xec91('0x4')]));function Agent(_0xe40caf){this['id']=_0xe40caf['id']||0x0;this[_0xec91('0x7')]=_0xe40caf['name']||'';this[_0xec91('0x8')]=_0xe40caf[_0xec91('0x8')]||!![];this[_0xec91('0x9')]=_0xe40caf[_0xec91('0x9')]||![];this[_0xec91('0xa')]=_0xe40caf[_0xec91('0xa')]||![];this[_0xec91('0xb')]=_0xe40caf['mailPause']||![];this[_0xec91('0xc')]=_0xe40caf[_0xec91('0xc')]||![];this[_0xec91('0xd')]=_0xe40caf[_0xec91('0xd')]||![];this[_0xec91('0xe')]=_0xe40caf[_0xec91('0xe')]||![];this[_0xec91('0xf')]=_0xec91('0x10');this[_0xec91('0x11')]=0x0;this[_0xec91('0x12')]=_0xe40caf[_0xec91('0x12')]||0x0;this[_0xec91('0x13')]=0x0;this[_0xec91('0x14')]=_0xec91('0x10');this[_0xec91('0x15')]=0x0;this[_0xec91('0x16')]=_0xe40caf['mailCapacity']||0x0;this[_0xec91('0x17')]=0x0;this[_0xec91('0x18')]='unknown';this[_0xec91('0x19')]=0x0;this[_0xec91('0x1a')]=_0xe40caf['faxCapacity']||0x0;this[_0xec91('0x1b')]=0x0;this['smsStatus']=_0xec91('0x10');this[_0xec91('0x1c')]=0x0;this['smsCapacity']=_0xe40caf['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xec91('0x1d')]=_0xec91('0x10');this[_0xec91('0x1e')]=0x0;this['whatsappCapacity']=_0xe40caf['whatsappCapacity']||0x0;this[_0xec91('0x1f')]=0x0;this['openchannelStatus']=_0xec91('0x10');this['openchannelStatusTime']=0x0;this[_0xec91('0x20')]=_0xe40caf[_0xec91('0x20')]||0x0;this[_0xec91('0x21')]=0x0;this[_0xec91('0x22')]=![];this[_0xec91('0x23')]=undefined;this['md5']='';this[_0xec91('0x24')]();}Agent[_0xec91('0x25')]['getChannelStatus']=function(_0x403711){if(this[_0x403711+'CurrentCapacity']>0x0){if(this[_0x403711+_0xec91('0x26')]>0x0&&this[_0x403711+_0xec91('0x27')]>=this[_0x403711+'Capacity']){return _0xec91('0x28');}else{return _0xec91('0x29');}}else{return'idle';}};Agent[_0xec91('0x25')][_0xec91('0x24')]=function(){var _0x36d563=[_0xec91('0x2a'),_0xec91('0x2b'),_0xec91('0x2c'),_0xec91('0x2d'),_0xec91('0x2e'),_0xec91('0x2f')];for(var _0x4b46ed=0x0;_0x4b46ed<_0x36d563[_0xec91('0x30')];_0x4b46ed+=0x1){var _0x1976da=this[_0xec91('0x31')](_0x36d563[_0x4b46ed]);if(this[_0x36d563[_0x4b46ed]+_0xec91('0x32')]!==_0x1976da){this[_0x36d563[_0x4b46ed]+_0xec91('0x33')]=_[_0xec91('0x34')](moment()[_0xec91('0x35')]('x'));}this[_0x36d563[_0x4b46ed]+_0xec91('0x32')]=_0x1976da;}var _0x2693c1={'id':this['id'],'name':this[_0xec91('0x7')],'online':this[_0xec91('0x8')],'voicePause':this[_0xec91('0x9')],'chatPause':this[_0xec91('0xa')],'mailPause':this[_0xec91('0xb')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xec91('0xe')],'chatStatus':this[_0xec91('0xf')],'chatStatusTime':this[_0xec91('0x11')],'chatCapacity':this[_0xec91('0x12')],'chatCurrentCapacity':this[_0xec91('0x13')],'mailStatus':this[_0xec91('0x14')],'mailStatusTime':this[_0xec91('0x15')],'mailCapacity':this[_0xec91('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xec91('0x18')],'faxStatusTime':this[_0xec91('0x19')],'faxCapacity':this[_0xec91('0x1a')],'faxCurrentCapacity':this[_0xec91('0x1b')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xec91('0x1c')],'smsCapacity':this[_0xec91('0x36')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xec91('0x37')],'whatsappCurrentCapacity':this[_0xec91('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xec91('0x38')],'openchannelCapacity':this[_0xec91('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xec91('0x22')],'busyQueue':this[_0xec91('0x23')]};var _0x3a6ab4=md5(JSON['stringify'](_0x2693c1));if(this['md5']!==_0x3a6ab4){this['md5']=_0x3a6ab4;io[_0xec91('0x39')]('user:save',_0x2693c1);}};module['exports']=Agent; \ No newline at end of file +var _0x9fbb=['openchannelCapacity','openchannelCurrentCapacity','busyQueue','CurrentCapacity','Capacity','working','prototype','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','format','busy','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime'];(function(_0xe73e62,_0x286323){var _0x4bdb57=function(_0x14ad79){while(--_0x14ad79){_0xe73e62['push'](_0xe73e62['shift']());}};_0x4bdb57(++_0x286323);}(_0x9fbb,0x83));var _0xb9fb=function(_0x6bfcec,_0x1c737a){_0x6bfcec=_0x6bfcec-0x0;var _0x3701bb=_0x9fbb[_0x6bfcec];return _0x3701bb;};'use strict';var _=require(_0xb9fb('0x0'));var moment=require(_0xb9fb('0x1'));var md5=require(_0xb9fb('0x2'));var Redis=require(_0xb9fb('0x3'));var config=require(_0xb9fb('0x4'));config[_0xb9fb('0x5')]=_[_0xb9fb('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb9fb('0x7'))(new Redis(config[_0xb9fb('0x5')]));function Agent(_0x4d980a){this['id']=_0x4d980a['id']||0x0;this[_0xb9fb('0x8')]=_0x4d980a[_0xb9fb('0x8')]||'';this['online']=_0x4d980a[_0xb9fb('0x9')]||!![];this[_0xb9fb('0xa')]=_0x4d980a['voicePause']||![];this['chatPause']=_0x4d980a[_0xb9fb('0xb')]||![];this[_0xb9fb('0xc')]=_0x4d980a[_0xb9fb('0xc')]||![];this[_0xb9fb('0xd')]=_0x4d980a['faxPause']||![];this[_0xb9fb('0xe')]=_0x4d980a[_0xb9fb('0xe')]||![];this['openchannelPause']=_0x4d980a[_0xb9fb('0xf')]||![];this[_0xb9fb('0x10')]='unknown';this[_0xb9fb('0x11')]=0x0;this[_0xb9fb('0x12')]=_0x4d980a[_0xb9fb('0x12')]||0x0;this[_0xb9fb('0x13')]=0x0;this[_0xb9fb('0x14')]=_0xb9fb('0x15');this[_0xb9fb('0x16')]=0x0;this['mailCapacity']=_0x4d980a[_0xb9fb('0x17')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xb9fb('0x18')]=_0xb9fb('0x15');this['faxStatusTime']=0x0;this[_0xb9fb('0x19')]=_0x4d980a['faxCapacity']||0x0;this[_0xb9fb('0x1a')]=0x0;this[_0xb9fb('0x1b')]=_0xb9fb('0x15');this[_0xb9fb('0x1c')]=0x0;this['smsCapacity']=_0x4d980a[_0xb9fb('0x1d')]||0x0;this[_0xb9fb('0x1e')]=0x0;this[_0xb9fb('0x1f')]=_0xb9fb('0x15');this[_0xb9fb('0x20')]=0x0;this[_0xb9fb('0x21')]=_0x4d980a[_0xb9fb('0x21')]||0x0;this[_0xb9fb('0x22')]=0x0;this[_0xb9fb('0x23')]=_0xb9fb('0x15');this[_0xb9fb('0x24')]=0x0;this[_0xb9fb('0x25')]=_0x4d980a[_0xb9fb('0x25')]||0x0;this[_0xb9fb('0x26')]=0x0;this['busy']=![];this[_0xb9fb('0x27')]=undefined;this[_0xb9fb('0x2')]='';this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0x361108){if(this[_0x361108+_0xb9fb('0x28')]>0x0){if(this[_0x361108+'Capacity']>0x0&&this[_0x361108+_0xb9fb('0x28')]>=this[_0x361108+_0xb9fb('0x29')]){return'maxcapacity';}else{return _0xb9fb('0x2a');}}else{return'idle';}};Agent[_0xb9fb('0x2b')]['updateRealtime']=function(){var _0x1f54c3=['mail','chat','openchannel',_0xb9fb('0x2c'),_0xb9fb('0x2d'),_0xb9fb('0x2e')];for(var _0xbe93ee=0x0;_0xbe93ee<_0x1f54c3[_0xb9fb('0x2f')];_0xbe93ee+=0x1){var _0x536253=this[_0xb9fb('0x30')](_0x1f54c3[_0xbe93ee]);if(this[_0x1f54c3[_0xbe93ee]+_0xb9fb('0x31')]!==_0x536253){this[_0x1f54c3[_0xbe93ee]+_0xb9fb('0x32')]=_['toNumber'](moment()[_0xb9fb('0x33')]('x'));}this[_0x1f54c3[_0xbe93ee]+_0xb9fb('0x31')]=_0x536253;}var _0x3d4715={'id':this['id'],'name':this[_0xb9fb('0x8')],'online':this['online'],'voicePause':this[_0xb9fb('0xa')],'chatPause':this[_0xb9fb('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xb9fb('0xe')],'faxPause':this[_0xb9fb('0xd')],'openchannelPause':this[_0xb9fb('0xf')],'chatStatus':this[_0xb9fb('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xb9fb('0x12')],'chatCurrentCapacity':this[_0xb9fb('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xb9fb('0x16')],'mailCapacity':this[_0xb9fb('0x17')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xb9fb('0x19')],'faxCurrentCapacity':this[_0xb9fb('0x1a')],'smsStatus':this[_0xb9fb('0x1b')],'smsStatusTime':this[_0xb9fb('0x1c')],'smsCapacity':this[_0xb9fb('0x1d')],'smsCurrentCapacity':this[_0xb9fb('0x1e')],'whatsappStatus':this[_0xb9fb('0x1f')],'whatsappStatusTime':this[_0xb9fb('0x20')],'whatsappCapacity':this[_0xb9fb('0x21')],'whatsappCurrentCapacity':this[_0xb9fb('0x22')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xb9fb('0x24')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xb9fb('0x26')],'busy':this[_0xb9fb('0x34')],'busyQueue':this[_0xb9fb('0x27')]};var _0x4af15f=md5(JSON['stringify'](_0x3d4715));if(this[_0xb9fb('0x2')]!==_0x4af15f){this[_0xb9fb('0x2')]=_0x4af15f;io[_0xb9fb('0x35')](_0xb9fb('0x36'),_0x3d4715);}};module[_0xb9fb('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 7e5079f..488f08b 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 _0xacdc=['loggedIn','paused','Agents','length','online','chatPause','available','stringify','format','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime'];(function(_0xb6b0d5,_0x305c17){var _0x18b4b6=function(_0x4fb6f2){while(--_0x4fb6f2){_0xb6b0d5['push'](_0xb6b0d5['shift']());}};_0x18b4b6(++_0x305c17);}(_0xacdc,0x17f));var _0xcacd=function(_0x2e2882,_0x3bf5be){_0x2e2882=_0x2e2882-0x0;var _0x433df9=_0xacdc[_0x2e2882];return _0x433df9;};'use strict';var _=require(_0xcacd('0x0'));var md5=require(_0xcacd('0x1'));var util=require(_0xcacd('0x2'));var Redis=require(_0xcacd('0x3'));var config=require(_0xcacd('0x4'));config[_0xcacd('0x5')]=_[_0xcacd('0x6')](config[_0xcacd('0x5')],{'host':_0xcacd('0x7'),'port':0x18eb});var io=require(_0xcacd('0x8'))(new Redis(config['redis']));function ChatQueue(_0xeea7fe){this['id']=_0xeea7fe['id']||0x0;this['name']=_0xeea7fe[_0xcacd('0x9')]||'';this[_0xcacd('0xa')]=_0xeea7fe[_0xcacd('0xa')]||0xa;this[_0xcacd('0xb')]=_0xeea7fe['strategy']||_0xcacd('0xc');this['Agents']=_0xeea7fe['Agents'];this[_0xcacd('0xd')]={};this[_0xcacd('0xe')]=0x0;this['md5']='';this[_0xcacd('0xf')]();this['updateRealtime']();}ChatQueue[_0xcacd('0x10')]['updateRouting']=function(){var _0x43b0d6=this['mapAgentsId'][_0xcacd('0x11')];this[_0xcacd('0xd')]=_[_0xcacd('0x12')](this['Agents'],'id');this['mapAgentsId'][_0xcacd('0x11')]=_0x43b0d6;};ChatQueue['prototype'][_0xcacd('0x13')]=function(){this[_0xcacd('0x14')]=0x0;this[_0xcacd('0x15')]=0x0;for(var _0x1c9fcb=0x0;_0x1c9fcb=0x0?this[_0xcacd('0x1a')]:0x0;var _0xf82363={'id':this['id'],'available':this[_0xcacd('0x1a')],'loggedIn':this['loggedIn'],'name':this[_0xcacd('0x9')],'paused':this['paused'],'waiting':this[_0xcacd('0xe')]};var _0x12e5bd=md5(JSON[_0xcacd('0x1b')](_0xf82363));if(this[_0xcacd('0x1')]!==_0x12e5bd){this['md5']=_0x12e5bd;io['to'](util[_0xcacd('0x1c')]('chat:queue:%s',_0xf82363[_0xcacd('0x9')]))[_0xcacd('0x1d')](_0xcacd('0x1e'),_0xf82363);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xa00b=['available','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','online','chatPause'];(function(_0x3f12ea,_0x54452e){var _0x45d75e=function(_0x1d12df){while(--_0x1d12df){_0x3f12ea['push'](_0x3f12ea['shift']());}};_0x45d75e(++_0x54452e);}(_0xa00b,0x92));var _0xba00=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa00b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xba00('0x0'));var md5=require(_0xba00('0x1'));var util=require(_0xba00('0x2'));var Redis=require('ioredis');var config=require(_0xba00('0x3'));config[_0xba00('0x4')]=_['defaults'](config[_0xba00('0x4')],{'host':_0xba00('0x5'),'port':0x18eb});var io=require(_0xba00('0x6'))(new Redis(config[_0xba00('0x4')]));function ChatQueue(_0x495012){this['id']=_0x495012['id']||0x0;this[_0xba00('0x7')]=_0x495012['name']||'';this['timeout']=_0x495012[_0xba00('0x8')]||0xa;this[_0xba00('0x9')]=_0x495012[_0xba00('0x9')]||'beepall';this[_0xba00('0xa')]=_0x495012[_0xba00('0xa')];this[_0xba00('0xb')]={};this[_0xba00('0xc')]=0x0;this[_0xba00('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype'][_0xba00('0xd')]=function(){var _0x250f8b=this['mapAgentsId'][_0xba00('0xe')];this[_0xba00('0xb')]=_[_0xba00('0xf')](this['Agents'],'id');this[_0xba00('0xb')][_0xba00('0xe')]=_0x250f8b;};ChatQueue[_0xba00('0x10')][_0xba00('0x11')]=function(){this[_0xba00('0x12')]=0x0;this[_0xba00('0x13')]=0x0;for(var _0x1deae8=0x0;_0x1deae8=0x0?this['available']:0x0;var _0x5b8d13={'id':this['id'],'available':this[_0xba00('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xba00('0x7')],'paused':this[_0xba00('0x13')],'waiting':this[_0xba00('0xc')]};var _0x448a0f=md5(JSON[_0xba00('0x17')](_0x5b8d13));if(this[_0xba00('0x1')]!==_0x448a0f){this[_0xba00('0x1')]=_0x448a0f;io['to'](util[_0xba00('0x18')](_0xba00('0x19'),_0x5b8d13['name']))[_0xba00('0x1a')](_0xba00('0x1b'),_0x5b8d13);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 14ad0d9..57fe329 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 _0x8dc6=['prototype','loggedIn','length','online','faxPause','paused','available','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','map','_rr'];(function(_0x24e52d,_0x1afab8){var _0xacc072=function(_0x42cbc9){while(--_0x42cbc9){_0x24e52d['push'](_0x24e52d['shift']());}};_0xacc072(++_0x1afab8);}(_0x8dc6,0xb3));var _0x68dc=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x8dc6[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0x68dc('0x0'));var md5=require(_0x68dc('0x1'));var util=require(_0x68dc('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x68dc('0x3')]=_[_0x68dc('0x4')](config[_0x68dc('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x68dc('0x5'))(new Redis(config[_0x68dc('0x3')]));function FaxQueue(_0x4733d2){this['id']=_0x4733d2['id']||0x0;this['name']=_0x4733d2[_0x68dc('0x6')]||'';this[_0x68dc('0x7')]=_0x4733d2['timeout']||0xa;this[_0x68dc('0x8')]=_0x4733d2[_0x68dc('0x8')]||_0x68dc('0x9');this[_0x68dc('0xa')]=_0x4733d2[_0x68dc('0xa')];this[_0x68dc('0xb')]={};this[_0x68dc('0xc')]=0x0;this[_0x68dc('0x1')]='';this['updateRouting']();this[_0x68dc('0xd')]();}FaxQueue['prototype'][_0x68dc('0xe')]=function(){var _0x183f09=this[_0x68dc('0xb')]['_rr'];this[_0x68dc('0xb')]=_[_0x68dc('0xf')](this[_0x68dc('0xa')],'id');this[_0x68dc('0xb')][_0x68dc('0x10')]=_0x183f09;};FaxQueue[_0x68dc('0x11')][_0x68dc('0xd')]=function(){this[_0x68dc('0x12')]=0x0;this['paused']=0x0;for(var _0x4069ee=0x0;_0x4069ee=0x0?this['available']:0x0;var _0x65549={'id':this['id'],'available':this[_0x68dc('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x68dc('0x16')],'waiting':this[_0x68dc('0xc')]};var _0x7ebfa6=md5(JSON['stringify'](_0x65549));if(this['md5']!==_0x7ebfa6){this['md5']=_0x7ebfa6;io['to'](util['format'](_0x68dc('0x18'),_0x65549[_0x68dc('0x6')]))[_0x68dc('0x19')](_0x68dc('0x1a'),_0x65549);}};module[_0x68dc('0x1b')]=FaxQueue; \ No newline at end of file +var _0xfcda=['paused','length','online','faxPause','available','format','emit','fax_queue:save','lodash','../../../config/environment','defaults','redis','localhost','name','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','_rr','updateRealtime','loggedIn'];(function(_0x2f05cc,_0x6aa40d){var _0x363e66=function(_0x504980){while(--_0x504980){_0x2f05cc['push'](_0x2f05cc['shift']());}};_0x363e66(++_0x6aa40d);}(_0xfcda,0x188));var _0xafcd=function(_0x43a302,_0x5372ec){_0x43a302=_0x43a302-0x0;var _0x2b23a8=_0xfcda[_0x43a302];return _0x2b23a8;};'use strict';var _=require(_0xafcd('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0xafcd('0x1'));config['redis']=_[_0xafcd('0x2')](config[_0xafcd('0x3')],{'host':_0xafcd('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xafcd('0x3')]));function FaxQueue(_0x11fe8a){this['id']=_0x11fe8a['id']||0x0;this['name']=_0x11fe8a[_0xafcd('0x5')]||'';this['timeout']=_0x11fe8a['timeout']||0xa;this['strategy']=_0x11fe8a[_0xafcd('0x6')]||_0xafcd('0x7');this[_0xafcd('0x8')]=_0x11fe8a[_0xafcd('0x8')];this[_0xafcd('0x9')]={};this[_0xafcd('0xa')]=0x0;this[_0xafcd('0xb')]='';this[_0xafcd('0xc')]();this['updateRealtime']();}FaxQueue['prototype'][_0xafcd('0xc')]=function(){var _0x29e62d=this['mapAgentsId'][_0xafcd('0xd')];this[_0xafcd('0x9')]=_['map'](this[_0xafcd('0x8')],'id');this['mapAgentsId'][_0xafcd('0xd')]=_0x29e62d;};FaxQueue['prototype'][_0xafcd('0xe')]=function(){this[_0xafcd('0xf')]=0x0;this[_0xafcd('0x10')]=0x0;for(var _0x44423d=0x0;_0x44423d=0x0?this[_0xafcd('0x14')]:0x0;var _0x4ebb47={'id':this['id'],'available':this[_0xafcd('0x14')],'loggedIn':this[_0xafcd('0xf')],'name':this[_0xafcd('0x5')],'paused':this['paused'],'waiting':this[_0xafcd('0xa')]};var _0x459c78=md5(JSON['stringify'](_0x4ebb47));if(this[_0xafcd('0xb')]!==_0x459c78){this[_0xafcd('0xb')]=_0x459c78;io['to'](util[_0xafcd('0x15')]('fax:queue:%s',_0x4ebb47[_0xafcd('0x5')]))[_0xafcd('0x16')](_0xafcd('0x17'),_0x4ebb47);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index e44bc08..9075af5 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 _0xcab7=['exports','name','Intervals'];(function(_0x4f0c82,_0x372a3f){var _0x2620d7=function(_0x5ed010){while(--_0x5ed010){_0x4f0c82['push'](_0x4f0c82['shift']());}};_0x2620d7(++_0x372a3f);}(_0xcab7,0x121));var _0x7cab=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0xcab7[_0x214a25];return _0x405988;};'use strict';function Interval(_0x538356){this['id']=_0x538356['id']||0x0;this[_0x7cab('0x0')]=_0x538356[_0x7cab('0x0')]||'';this['Intervals']=_0x538356[_0x7cab('0x1')]||{};}module[_0x7cab('0x2')]=Interval; \ No newline at end of file +var _0xc5da=['Intervals','exports','name'];(function(_0x2eda1d,_0x1ce7fc){var _0x12466a=function(_0x53bdf6){while(--_0x53bdf6){_0x2eda1d['push'](_0x2eda1d['shift']());}};_0x12466a(++_0x1ce7fc);}(_0xc5da,0x158));var _0xac5d=function(_0x23a859,_0x13a7ce){_0x23a859=_0x23a859-0x0;var _0x1c38ae=_0xc5da[_0x23a859];return _0x1c38ae;};'use strict';function Interval(_0x57d642){this['id']=_0x57d642['id']||0x0;this[_0xac5d('0x0')]=_0x57d642[_0xac5d('0x0')]||'';this[_0xac5d('0x1')]=_0x57d642[_0xac5d('0x1')]||{};}module[_0xac5d('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 cb407a1..bf06f0c 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 _0x0e14=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy'];(function(_0x21d3f2,_0x8cb415){var _0xb8b683=function(_0x3ff2af){while(--_0x3ff2af){_0x21d3f2['push'](_0x21d3f2['shift']());}};_0xb8b683(++_0x8cb415);}(_0x0e14,0x12a));var _0x40e1=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x0e14[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x40e1('0x0'));var md5=require(_0x40e1('0x1'));var util=require('util');var Redis=require(_0x40e1('0x2'));var config=require(_0x40e1('0x3'));config[_0x40e1('0x4')]=_[_0x40e1('0x5')](config[_0x40e1('0x4')],{'host':_0x40e1('0x6'),'port':0x18eb});var io=require(_0x40e1('0x7'))(new Redis(config[_0x40e1('0x4')]));function MailQueue(_0x303ba4){this['id']=_0x303ba4['id']||0x0;this[_0x40e1('0x8')]=_0x303ba4[_0x40e1('0x8')]||'';this['timeout']=_0x303ba4['timeout']||0xa;this[_0x40e1('0x9')]=_0x303ba4[_0x40e1('0x9')]||_0x40e1('0xa');this[_0x40e1('0xb')]=_0x303ba4[_0x40e1('0xb')];this[_0x40e1('0xc')]={};this[_0x40e1('0xd')]=0x0;this['md5']='';this[_0x40e1('0xe')]();this[_0x40e1('0xf')]();}MailQueue[_0x40e1('0x10')]['updateRouting']=function(){var _0x3df670=this[_0x40e1('0xc')][_0x40e1('0x11')];this[_0x40e1('0xc')]=_[_0x40e1('0x12')](this[_0x40e1('0xb')],'id');this['mapAgentsId'][_0x40e1('0x11')]=_0x3df670;};MailQueue[_0x40e1('0x10')][_0x40e1('0xf')]=function(){this[_0x40e1('0x13')]=0x0;this[_0x40e1('0x14')]=0x0;for(var _0x3cf995=0x0;_0x3cf995=0x0?this[_0x40e1('0x17')]:0x0;var _0x6ed78e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x40e1('0x13')],'name':this[_0x40e1('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x9027f4=md5(JSON['stringify'](_0x6ed78e));if(this[_0x40e1('0x1')]!==_0x9027f4){this[_0x40e1('0x1')]=_0x9027f4;io['to'](util[_0x40e1('0x18')](_0x40e1('0x19'),_0x6ed78e[_0x40e1('0x8')]))[_0x40e1('0x1a')](_0x40e1('0x1b'),_0x6ed78e);}};module['exports']=MailQueue; \ No newline at end of file +var _0x08d0=['../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','length','loggedIn','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis'];(function(_0xb9fe33,_0x47a545){var _0x15f7c2=function(_0x24f0e3){while(--_0x24f0e3){_0xb9fe33['push'](_0xb9fe33['shift']());}};_0x15f7c2(++_0x47a545);}(_0x08d0,0xce));var _0x008d=function(_0xb532e7,_0x4e98c8){_0xb532e7=_0xb532e7-0x0;var _0x4ff8a6=_0x08d0[_0xb532e7];return _0x4ff8a6;};'use strict';var _=require(_0x008d('0x0'));var md5=require(_0x008d('0x1'));var util=require(_0x008d('0x2'));var Redis=require(_0x008d('0x3'));var config=require(_0x008d('0x4'));config['redis']=_[_0x008d('0x5')](config['redis'],{'host':_0x008d('0x6'),'port':0x18eb});var io=require(_0x008d('0x7'))(new Redis(config[_0x008d('0x8')]));function MailQueue(_0x107ab4){this['id']=_0x107ab4['id']||0x0;this[_0x008d('0x9')]=_0x107ab4[_0x008d('0x9')]||'';this['timeout']=_0x107ab4['timeout']||0xa;this[_0x008d('0xa')]=_0x107ab4[_0x008d('0xa')]||_0x008d('0xb');this[_0x008d('0xc')]=_0x107ab4[_0x008d('0xc')];this[_0x008d('0xd')]={};this[_0x008d('0xe')]=0x0;this['md5']='';this[_0x008d('0xf')]();this[_0x008d('0x10')]();}MailQueue[_0x008d('0x11')][_0x008d('0xf')]=function(){var _0x4c83b4=this[_0x008d('0xd')]['_rr'];this[_0x008d('0xd')]=_[_0x008d('0x12')](this[_0x008d('0xc')],'id');this[_0x008d('0xd')][_0x008d('0x13')]=_0x4c83b4;};MailQueue[_0x008d('0x11')][_0x008d('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x23dc94=0x0;_0x23dc94=0x0?this[_0x008d('0x17')]:0x0;var _0x4d6c06={'id':this['id'],'available':this[_0x008d('0x17')],'loggedIn':this[_0x008d('0x15')],'name':this[_0x008d('0x9')],'paused':this[_0x008d('0x16')],'waiting':this[_0x008d('0xe')]};var _0x58bbae=md5(JSON[_0x008d('0x18')](_0x4d6c06));if(this[_0x008d('0x1')]!==_0x58bbae){this['md5']=_0x58bbae;io['to'](util[_0x008d('0x19')](_0x008d('0x1a'),_0x4d6c06[_0x008d('0x9')]))[_0x008d('0x1b')](_0x008d('0x1c'),_0x4d6c06);}};module[_0x008d('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7ec38a5..4f0a240 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(_0x43d106,_0x96a475){var _0x2160bc=function(_0x1219fb){while(--_0x1219fb){_0x43d106['push'](_0x43d106['shift']());}};_0x2160bc(++_0x96a475);}(_0xadb5,0xad));var _0x5adb=function(_0x30f703,_0x171fa8){_0x30f703=_0x30f703-0x0;var _0x5127cb=_0xadb5[_0x30f703];return _0x5127cb;};'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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x440048,_0x3fcce0){var _0xe8d503=function(_0x1545de){while(--_0x1545de){_0x440048['push'](_0x440048['shift']());}};_0xe8d503(++_0x3fcce0);}(_0x814b,0x1a2));var _0xb814=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x814b[_0xc14df7];return _0x34a445;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 9c0e7b1..f9a8cca 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 _0x0f69=['prototype','updateRealtime','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','util','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x0f69,0x173));var _0x90f6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0f69[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x90f6('0x0'));var Redis=require('ioredis');var config=require(_0x90f6('0x1'));config[_0x90f6('0x2')]=_['defaults'](config[_0x90f6('0x2')],{'host':_0x90f6('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x90f6('0x2')]));function SmsQueue(_0x558130){this['id']=_0x558130['id']||0x0;this[_0x90f6('0x4')]=_0x558130[_0x90f6('0x4')]||'';this[_0x90f6('0x5')]=_0x558130[_0x90f6('0x5')]||0xa;this[_0x90f6('0x6')]=_0x558130[_0x90f6('0x6')]||_0x90f6('0x7');this[_0x90f6('0x8')]=_0x558130[_0x90f6('0x8')];this[_0x90f6('0x9')]={};this[_0x90f6('0xa')]=0x0;this[_0x90f6('0xb')]='';this[_0x90f6('0xc')]();this['updateRealtime']();}SmsQueue[_0x90f6('0xd')][_0x90f6('0xc')]=function(){var _0x51930c=this[_0x90f6('0x9')]['_rr'];this[_0x90f6('0x9')]=_['map'](this['Agents'],'id');this[_0x90f6('0x9')]['_rr']=_0x51930c;};SmsQueue[_0x90f6('0xd')][_0x90f6('0xe')]=function(){this[_0x90f6('0xf')]=0x0;this[_0x90f6('0x10')]=0x0;for(var _0x47fd3c=0x0;_0x47fd3c=0x0?this[_0x90f6('0x13')]:0x0;var _0x2898a8={'id':this['id'],'available':this['available'],'loggedIn':this[_0x90f6('0xf')],'name':this[_0x90f6('0x4')],'paused':this[_0x90f6('0x10')],'waiting':this[_0x90f6('0xa')]};var _0x3e6dc0=md5(JSON[_0x90f6('0x14')](_0x2898a8));if(this[_0x90f6('0xb')]!==_0x3e6dc0){this['md5']=_0x3e6dc0;io['to'](util[_0x90f6('0x15')](_0x90f6('0x16'),_0x2898a8['name']))['emit'](_0x90f6('0x17'),_0x2898a8);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x01fe=['defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','available','stringify','md5','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis'];(function(_0x324ced,_0x29e021){var _0x36f1d3=function(_0x511953){while(--_0x511953){_0x324ced['push'](_0x324ced['shift']());}};_0x36f1d3(++_0x29e021);}(_0x01fe,0x102));var _0xe01f=function(_0x525d1e,_0x4d0b1c){_0x525d1e=_0x525d1e-0x0;var _0xbadc83=_0x01fe[_0x525d1e];return _0xbadc83;};'use strict';var _=require(_0xe01f('0x0'));var md5=require('md5');var util=require(_0xe01f('0x1'));var Redis=require(_0xe01f('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xe01f('0x3')](config[_0xe01f('0x4')],{'host':_0xe01f('0x5'),'port':0x18eb});var io=require(_0xe01f('0x6'))(new Redis(config['redis']));function SmsQueue(_0x14340f){this['id']=_0x14340f['id']||0x0;this['name']=_0x14340f[_0xe01f('0x7')]||'';this[_0xe01f('0x8')]=_0x14340f[_0xe01f('0x8')]||0xa;this[_0xe01f('0x9')]=_0x14340f[_0xe01f('0x9')]||'beepall';this[_0xe01f('0xa')]=_0x14340f[_0xe01f('0xa')];this['mapAgentsId']={};this[_0xe01f('0xb')]=0x0;this['md5']='';this[_0xe01f('0xc')]();this[_0xe01f('0xd')]();}SmsQueue['prototype'][_0xe01f('0xc')]=function(){var _0x4f409c=this[_0xe01f('0xe')][_0xe01f('0xf')];this[_0xe01f('0xe')]=_[_0xe01f('0x10')](this[_0xe01f('0xa')],'id');this[_0xe01f('0xe')][_0xe01f('0xf')]=_0x4f409c;};SmsQueue[_0xe01f('0x11')]['updateRealtime']=function(){this[_0xe01f('0x12')]=0x0;this[_0xe01f('0x13')]=0x0;for(var _0x2d55c8=0x0;_0x2d55c8=0x0?this[_0xe01f('0x16')]:0x0;var _0x26cd4d={'id':this['id'],'available':this[_0xe01f('0x16')],'loggedIn':this[_0xe01f('0x12')],'name':this['name'],'paused':this[_0xe01f('0x13')],'waiting':this['waiting']};var _0x948cfa=md5(JSON[_0xe01f('0x17')](_0x26cd4d));if(this[_0xe01f('0x18')]!==_0x948cfa){this[_0xe01f('0x18')]=_0x948cfa;io['to'](util['format'](_0xe01f('0x19'),_0x26cd4d[_0xe01f('0x7')]))[_0xe01f('0x1a')](_0xe01f('0x1b'),_0x26cd4d);}};module[_0xe01f('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 2726b07..88c3386 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 _0x5591=['Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','whatsappPause','available','paused','waiting','stringify','whatsapp:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','defaults','socket.io-emitter','redis','name','timeout','strategy','beepall'];(function(_0x179f61,_0x2891b5){var _0x32523b=function(_0x5b36ca){while(--_0x5b36ca){_0x179f61['push'](_0x179f61['shift']());}};_0x32523b(++_0x2891b5);}(_0x5591,0x1e1));var _0x1559=function(_0x3960d0,_0x2272e5){_0x3960d0=_0x3960d0-0x0;var _0x5750df=_0x5591[_0x3960d0];return _0x5750df;};'use strict';var _=require(_0x1559('0x0'));var md5=require(_0x1559('0x1'));var util=require(_0x1559('0x2'));var Redis=require(_0x1559('0x3'));var config=require(_0x1559('0x4'));config['redis']=_[_0x1559('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1559('0x6'))(new Redis(config[_0x1559('0x7')]));function WhatsappQueue(_0x486b58){this['id']=_0x486b58['id']||0x0;this[_0x1559('0x8')]=_0x486b58[_0x1559('0x8')]||'';this[_0x1559('0x9')]=_0x486b58[_0x1559('0x9')]||0xa;this[_0x1559('0xa')]=_0x486b58[_0x1559('0xa')]||_0x1559('0xb');this[_0x1559('0xc')]=_0x486b58['Agents'];this[_0x1559('0xd')]={};this['waiting']=0x0;this[_0x1559('0x1')]='';this[_0x1559('0xe')]();this[_0x1559('0xf')]();}WhatsappQueue[_0x1559('0x10')][_0x1559('0xe')]=function(){var _0x371d52=this[_0x1559('0xd')][_0x1559('0x11')];this[_0x1559('0xd')]=_[_0x1559('0x12')](this[_0x1559('0xc')],'id');this['mapAgentsId'][_0x1559('0x11')]=_0x371d52;};WhatsappQueue[_0x1559('0x10')][_0x1559('0xf')]=function(){this[_0x1559('0x13')]=0x0;this['paused']=0x0;for(var _0x121a8c=0x0;_0x121a8c=0x0?this[_0x1559('0x17')]:0x0;var _0x46b0c3={'id':this['id'],'available':this[_0x1559('0x17')],'loggedIn':this[_0x1559('0x13')],'name':this[_0x1559('0x8')],'paused':this['paused'],'waiting':this[_0x1559('0x19')]};var _0x4c2fed=md5(JSON[_0x1559('0x1a')](_0x46b0c3));if(this[_0x1559('0x1')]!==_0x4c2fed){this[_0x1559('0x1')]=_0x4c2fed;io['to'](util['format'](_0x1559('0x1b'),_0x46b0c3[_0x1559('0x8')]))[_0x1559('0x1c')]('whatsapp_queue:save',_0x46b0c3);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xb579=['_rr','map','loggedIn','paused','length','online','whatsappPause','available','waiting','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype'];(function(_0x337fb3,_0x458f30){var _0x34f370=function(_0x6c77af){while(--_0x6c77af){_0x337fb3['push'](_0x337fb3['shift']());}};_0x34f370(++_0x458f30);}(_0xb579,0x163));var _0x9b57=function(_0x553873,_0x2b9c46){_0x553873=_0x553873-0x0;var _0x5efcdf=_0xb579[_0x553873];return _0x5efcdf;};'use strict';var _=require(_0x9b57('0x0'));var md5=require(_0x9b57('0x1'));var util=require('util');var Redis=require(_0x9b57('0x2'));var config=require(_0x9b57('0x3'));config[_0x9b57('0x4')]=_[_0x9b57('0x5')](config['redis'],{'host':_0x9b57('0x6'),'port':0x18eb});var io=require(_0x9b57('0x7'))(new Redis(config[_0x9b57('0x4')]));function WhatsappQueue(_0x338395){this['id']=_0x338395['id']||0x0;this[_0x9b57('0x8')]=_0x338395[_0x9b57('0x8')]||'';this[_0x9b57('0x9')]=_0x338395[_0x9b57('0x9')]||0xa;this[_0x9b57('0xa')]=_0x338395[_0x9b57('0xa')]||_0x9b57('0xb');this['Agents']=_0x338395[_0x9b57('0xc')];this[_0x9b57('0xd')]={};this['waiting']=0x0;this[_0x9b57('0x1')]='';this[_0x9b57('0xe')]();this[_0x9b57('0xf')]();}WhatsappQueue[_0x9b57('0x10')][_0x9b57('0xe')]=function(){var _0x245666=this[_0x9b57('0xd')][_0x9b57('0x11')];this[_0x9b57('0xd')]=_[_0x9b57('0x12')](this[_0x9b57('0xc')],'id');this[_0x9b57('0xd')]['_rr']=_0x245666;};WhatsappQueue['prototype'][_0x9b57('0xf')]=function(){this[_0x9b57('0x13')]=0x0;this[_0x9b57('0x14')]=0x0;for(var _0x32849c=0x0;_0x32849c=0x0?this[_0x9b57('0x18')]:0x0;var _0x277603={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9b57('0x13')],'name':this[_0x9b57('0x8')],'paused':this[_0x9b57('0x14')],'waiting':this[_0x9b57('0x19')]};var _0x57eb4b=md5(JSON['stringify'](_0x277603));if(this[_0x9b57('0x1')]!==_0x57eb4b){this[_0x9b57('0x1')]=_0x57eb4b;io['to'](util[_0x9b57('0x1a')](_0x9b57('0x1b'),_0x277603['name']))[_0x9b57('0x1c')](_0x9b57('0x1d'),_0x277603);}};module[_0x9b57('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 e69b734..32e143b 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(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x5a301f,_0x967c5a){var _0x32cce9=function(_0x3dfe07){while(--_0x3dfe07){_0x5a301f['push'](_0x5a301f['shift']());}};_0x32cce9(++_0x967c5a);}(_0xb10b,0x12a));var _0xbb10=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xb10b[_0x29e3ec];return _0x25727e;};'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 181ec88..4c384c5 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 _0x66fc=['update','addTags','Request','../client'];(function(_0x28030a,_0x51bae4){var _0x4ef1da=function(_0x3bec43){while(--_0x3bec43){_0x28030a['push'](_0x28030a['shift']());}};_0x4ef1da(++_0x51bae4);}(_0x66fc,0x1bb));var _0xc66f=function(_0x3164b2,_0x547245){_0x3164b2=_0x3164b2-0x0;var _0x25b692=_0x66fc[_0x3164b2];return _0x25b692;};'use strict';var client=require(_0xc66f('0x0'));exports[_0xc66f('0x1')]=function(_0x52a26c,_0x30e5e4){return client['Request']('UpdateChatInteraction',{'body':_0x30e5e4,'options':{'where':{'id':_0x52a26c}},'log':'updateChatInteraction'});};exports[_0xc66f('0x2')]=function(_0x1217ce,_0x4c1c1e){return client[_0xc66f('0x3')]('AddTagsToChatInteraction',{'body':_0x4c1c1e,'options':{'where':{'id':_0x1217ce}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x86c0=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','UpdateChatInteraction','addTags'];(function(_0x51e897,_0x3d9a7e){var _0x54a1b8=function(_0x32089d){while(--_0x32089d){_0x51e897['push'](_0x51e897['shift']());}};_0x54a1b8(++_0x3d9a7e);}(_0x86c0,0x133));var _0x086c=function(_0x1c52c3,_0x1b9379){_0x1c52c3=_0x1c52c3-0x0;var _0xf61a3a=_0x86c0[_0x1c52c3];return _0xf61a3a;};'use strict';var client=require(_0x086c('0x0'));exports['update']=function(_0x497658,_0x34d08b){return client['Request'](_0x086c('0x1'),{'body':_0x34d08b,'options':{'where':{'id':_0x497658}},'log':'updateChatInteraction'});};exports[_0x086c('0x2')]=function(_0x54f8f9,_0x4157d9){return client['Request'](_0x086c('0x3'),{'body':_0x4157d9,'options':{'where':{'id':_0x54f8f9}},'log':_0x086c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 958c844..c3a4445 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 _0x2060=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x3d7a9f,_0x24e0f1){var _0x13f5f1=function(_0x1fbbda){while(--_0x1fbbda){_0x3d7a9f['push'](_0x3d7a9f['shift']());}};_0x13f5f1(++_0x24e0f1);}(_0x2060,0x1cd));var _0x0206=function(_0x37332e,_0x41b74c){_0x37332e=_0x37332e-0x0;var _0x28f1f3=_0x2060[_0x37332e];return _0x28f1f3;};'use strict';var client=require(_0x0206('0x0'));exports[_0x0206('0x1')]=function(_0x43b0fa){return client[_0x0206('0x2')](_0x0206('0x3'),{'body':_0x43b0fa,'log':_0x0206('0x4')});}; \ No newline at end of file +var _0x0c29=['CreateChatMessage','create','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0c29,0x133));var _0x90c2=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x0c29[_0x3a3758];return _0x1a9234;};'use strict';var client=require('../client');exports[_0x90c2('0x0')]=function(_0xe1e6aa){return client[_0x90c2('0x1')](_0x90c2('0x2'),{'body':_0xe1e6aa,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index ae5415c..93376f7 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 _0xf961=['name','online','chatPause','../client','getChatQueues','Request','GetChatQueue','timeout','strategy','User'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0xf961,0x1cf));var _0x1f96=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xf961[_0x47aa64];return _0x549c7a;};'use strict';var client=require(_0x1f96('0x0'));exports[_0x1f96('0x1')]=function(){return function(){return client[_0x1f96('0x2')](_0x1f96('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1f96('0x4'),_0x1f96('0x5')],'include':[{'model':_0x1f96('0x6'),'as':'Agents','attributes':['id',_0x1f96('0x7'),_0x1f96('0x8'),_0x1f96('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xf041=['GetChatQueue','name','timeout','User','getChatQueues','Request'];(function(_0x489c6e,_0x4f4e0d){var _0x519ff1=function(_0x3c05fc){while(--_0x3c05fc){_0x489c6e['push'](_0x489c6e['shift']());}};_0x519ff1(++_0x4f4e0d);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x1f04('0x0')](_0x1f04('0x1'),{'options':{'raw':![],'attributes':['id',_0x1f04('0x2'),_0x1f04('0x3'),'strategy'],'include':[{'model':_0x1f04('0x4'),'as':'Agents','attributes':['id',_0x1f04('0x2'),'online','chatPause']}]},'log':_0x1f04('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 98b02ec..d9cdf13 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 _0x1782=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','Request'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x1782,0x13e));var _0x2178=function(_0x98aa6f,_0x1c2cb0){_0x98aa6f=_0x98aa6f-0x0;var _0x1371ec=_0x1782[_0x98aa6f];return _0x1371ec;};'use strict';var client=require(_0x2178('0x0'));exports['create']=function(_0x131618){return client[_0x2178('0x1')](_0x2178('0x2'),{'body':_0x131618,'log':_0x2178('0x2')});};exports[_0x2178('0x3')]=function(_0x4a185d,_0x601378){return client[_0x2178('0x1')]('UpdateChatQueueReport',{'body':_0x601378,'options':{'where':{'uniqueid':_0x4a185d},'order':[['id','DESC']],'limit':0x1},'log':_0x2178('0x4')});}; \ No newline at end of file +var _0x2b84=['DESC','../client','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x23119a,_0x213ff4){var _0x2a8b7e=function(_0x2333c3){while(--_0x2333c3){_0x23119a['push'](_0x23119a['shift']());}};_0x2a8b7e(++_0x213ff4);}(_0x2b84,0x105));var _0x42b8=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x2b84[_0x40ac5e];return _0x2839d6;};'use strict';var client=require(_0x42b8('0x0'));exports['create']=function(_0x17ebee){return client[_0x42b8('0x1')](_0x42b8('0x2'),{'body':_0x17ebee,'log':_0x42b8('0x2')});};exports['update']=function(_0x1d40a2,_0x14cc6b){return client[_0x42b8('0x1')](_0x42b8('0x3'),{'body':_0x14cc6b,'options':{'where':{'uniqueid':_0x1d40a2},'order':[['id',_0x42b8('0x4')]],'limit':0x1},'log':_0x42b8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 489d13f..08229b5 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x7a54,0x106));var _0x47a5=function(_0x61f372,_0x145c32){_0x61f372=_0x61f372-0x0;var _0x428cee=_0x7a54[_0x61f372];return _0x428cee;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 082c3e2..128b269 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 _0x0471=['CreateFaxMessage','../client','create','Request'];(function(_0xe45fab,_0x130ebc){var _0x5f500b=function(_0x22fa8d){while(--_0x22fa8d){_0xe45fab['push'](_0xe45fab['shift']());}};_0x5f500b(++_0x130ebc);}(_0x0471,0xf1));var _0x1047=function(_0x155574,_0x4e0b0b){_0x155574=_0x155574-0x0;var _0x56b559=_0x0471[_0x155574];return _0x56b559;};'use strict';var client=require(_0x1047('0x0'));exports[_0x1047('0x1')]=function(_0x411690){return client[_0x1047('0x2')](_0x1047('0x3'),{'body':_0x411690,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x7c62=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7c62,0x17c));var _0x27c6=function(_0x3be88b,_0x230504){_0x3be88b=_0x3be88b-0x0;var _0x4b9e44=_0x7c62[_0x3be88b];return _0x4b9e44;};'use strict';var client=require('../client');exports[_0x27c6('0x0')]=function(_0x1d6980){return client[_0x27c6('0x1')](_0x27c6('0x2'),{'body':_0x1d6980,'log':_0x27c6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 3bb78f4..f02a139 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 _0xd0f2=['faxPause','getFaxQueues','Request','name','strategy','User','Agents','online'];(function(_0x26cad0,_0x1366a7){var _0x42c26a=function(_0xff49c){while(--_0xff49c){_0x26cad0['push'](_0x26cad0['shift']());}};_0x42c26a(++_0x1366a7);}(_0xd0f2,0x1a9));var _0x2d0f=function(_0x130b2b,_0x3fba35){_0x130b2b=_0x130b2b-0x0;var _0x591798=_0xd0f2[_0x130b2b];return _0x591798;};'use strict';var client=require('../client');exports[_0x2d0f('0x0')]=function(){return function(){return client[_0x2d0f('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x2d0f('0x2'),'timeout',_0x2d0f('0x3')],'include':[{'model':_0x2d0f('0x4'),'as':_0x2d0f('0x5'),'attributes':['id',_0x2d0f('0x2'),_0x2d0f('0x6'),_0x2d0f('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x9729=['strategy','User','Agents','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x347c33,_0x4a00af){var _0x4660ee=function(_0x13e58c){while(--_0x13e58c){_0x347c33['push'](_0x347c33['shift']());}};_0x4660ee(++_0x4a00af);}(_0x9729,0x136));var _0x9972=function(_0x2ad881,_0x27ff6e){_0x2ad881=_0x2ad881-0x0;var _0x527e1d=_0x9729[_0x2ad881];return _0x527e1d;};'use strict';var client=require(_0x9972('0x0'));exports[_0x9972('0x1')]=function(){return function(){return client[_0x9972('0x2')](_0x9972('0x3'),{'options':{'raw':![],'attributes':['id',_0x9972('0x4'),'timeout',_0x9972('0x5')],'include':[{'model':_0x9972('0x6'),'as':_0x9972('0x7'),'attributes':['id',_0x9972('0x4'),'online',_0x9972('0x8')]}]},'log':_0x9972('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d25d4fa..c0b73ca 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 _0x02ed=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x36867f,_0x155d32){var _0x1d3e1d=function(_0xcbbde5){while(--_0xcbbde5){_0x36867f['push'](_0x36867f['shift']());}};_0x1d3e1d(++_0x155d32);}(_0x02ed,0x152));var _0xd02e=function(_0x442c77,_0x364010){_0x442c77=_0x442c77-0x0;var _0x2ddc1c=_0x02ed[_0x442c77];return _0x2ddc1c;};'use strict';var client=require(_0xd02e('0x0'));exports[_0xd02e('0x1')]=function(_0x148ca4){return client[_0xd02e('0x2')](_0xd02e('0x3'),{'body':_0x148ca4,'log':_0xd02e('0x3')});};exports['update']=function(_0x322a30,_0x3d68f7){return client[_0xd02e('0x2')](_0xd02e('0x4'),{'body':_0x3d68f7,'options':{'where':{'uniqueid':_0x322a30},'order':[['id',_0xd02e('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xf168=['update','UpdateFaxQueueReport','Request','CreateFaxQueueReport'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0xf168,0x1ce));var _0x8f16=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xf168[_0x4709c0];return _0x13348b;};'use strict';var client=require('../client');exports['create']=function(_0x5b3d0f){return client[_0x8f16('0x0')]('CreateFaxQueueReport',{'body':_0x5b3d0f,'log':_0x8f16('0x1')});};exports[_0x8f16('0x2')]=function(_0xe134a3,_0x18d412){return client[_0x8f16('0x0')](_0x8f16('0x3'),{'body':_0x18d412,'options':{'where':{'uniqueid':_0xe134a3},'order':[['id','DESC']],'limit':0x1},'log':_0x8f16('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 5c3f6bc..6789d8d 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 _0xaadb=['getIntervals','Request','GetInterval','name','Interval','interval','../client'];(function(_0x529587,_0x7b9e47){var _0x4ea039=function(_0x51cf40){while(--_0x51cf40){_0x529587['push'](_0x529587['shift']());}};_0x4ea039(++_0x7b9e47);}(_0xaadb,0x18e));var _0xbaad=function(_0x24d26d,_0x4f6932){_0x24d26d=_0x24d26d-0x0;var _0x156e9f=_0xaadb[_0x24d26d];return _0x156e9f;};'use strict';var client=require(_0xbaad('0x0'));exports[_0xbaad('0x1')]=function(){return function(){return client[_0xbaad('0x2')](_0xbaad('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xbaad('0x4')],'include':[{'model':_0xbaad('0x5'),'as':'Intervals','attributes':['id',_0xbaad('0x4'),_0xbaad('0x6')]}]},'log':_0xbaad('0x1')});};}; \ No newline at end of file +var _0x9115=['Request','name','Intervals','getIntervals'];(function(_0x3e2d54,_0x5d6325){var _0x5772ea=function(_0x2ac344){while(--_0x2ac344){_0x3e2d54['push'](_0x3e2d54['shift']());}};_0x5772ea(++_0x5d6325);}(_0x9115,0x77));var _0x5911=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x9115[_0x1aeda2];return _0x32dc6d;};'use strict';var client=require('../client');exports[_0x5911('0x0')]=function(){return function(){return client[_0x5911('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5911('0x2')],'include':[{'model':'Interval','as':_0x5911('0x3'),'attributes':['id',_0x5911('0x2'),'interval']}]},'log':_0x5911('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b640236..1830930 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 _0x8952=['UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0xe2937c,_0x279aac){var _0xda9977=function(_0x456f3b){while(--_0x456f3b){_0xe2937c['push'](_0xe2937c['shift']());}};_0xda9977(++_0x279aac);}(_0x8952,0x17e));var _0x2895=function(_0xa44f10,_0x3a7539){_0xa44f10=_0xa44f10-0x0;var _0x53c094=_0x8952[_0xa44f10];return _0x53c094;};'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 +var _0x5b12=['addTagsToChatInteraction','../client','update','Request','updateMailInteraction','addTags'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0x5b12,0xa3));var _0x25b1=function(_0x3e3113,_0x426b06){_0x3e3113=_0x3e3113-0x0;var _0x1d2be6=_0x5b12[_0x3e3113];return _0x1d2be6;};'use strict';var client=require(_0x25b1('0x0'));exports[_0x25b1('0x1')]=function(_0x1fe5c1,_0x569948){return client[_0x25b1('0x2')]('UpdateMailInteraction',{'body':_0x569948,'options':{'where':{'id':_0x1fe5c1}},'log':_0x25b1('0x3')});};exports[_0x25b1('0x4')]=function(_0x47995b,_0x31f3fc){return client['Request']('AddTagsToMailInteraction',{'body':_0x31f3fc,'options':{'where':{'id':_0x47995b}},'log':_0x25b1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 006782b..585039c 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 _0x17d5=['../client','create','createMailMessage'];(function(_0xe7e9ff,_0xf6fe64){var _0x45797d=function(_0x225479){while(--_0x225479){_0xe7e9ff['push'](_0xe7e9ff['shift']());}};_0x45797d(++_0xf6fe64);}(_0x17d5,0xe4));var _0x517d=function(_0x58ca3c,_0xc5a75e){_0x58ca3c=_0x58ca3c-0x0;var _0x5003f3=_0x17d5[_0x58ca3c];return _0x5003f3;};'use strict';var client=require(_0x517d('0x0'));exports[_0x517d('0x1')]=function(_0x1afa04){return client['Request']('CreateMailMessage',{'body':_0x1afa04,'log':_0x517d('0x2')});}; \ No newline at end of file +var _0x8719=['createMailMessage','../client','create','CreateMailMessage'];(function(_0x54e6d6,_0x27e996){var _0x46931c=function(_0x19602e){while(--_0x19602e){_0x54e6d6['push'](_0x54e6d6['shift']());}};_0x46931c(++_0x27e996);}(_0x8719,0x69));var _0x9871=function(_0x867100,_0x4ea60e){_0x867100=_0x867100-0x0;var _0x371d4e=_0x8719[_0x867100];return _0x371d4e;};'use strict';var client=require(_0x9871('0x0'));exports[_0x9871('0x1')]=function(_0x3a63ae){return client['Request'](_0x9871('0x2'),{'body':_0x3a63ae,'log':_0x9871('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 6a565f4..aa15e2e 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 _0xcdaa=['strategy','User','Agents','online','mailPause','getMailQueues','../client','Request','GetMailQueue','name','timeout'];(function(_0x4e254d,_0x23499e){var _0x2d5101=function(_0x3434df){while(--_0x3434df){_0x4e254d['push'](_0x4e254d['shift']());}};_0x2d5101(++_0x23499e);}(_0xcdaa,0xab));var _0xacda=function(_0x8050b0,_0x61cde5){_0x8050b0=_0x8050b0-0x0;var _0x41b767=_0xcdaa[_0x8050b0];return _0x41b767;};'use strict';var client=require(_0xacda('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xacda('0x1')](_0xacda('0x2'),{'options':{'raw':![],'attributes':['id',_0xacda('0x3'),_0xacda('0x4'),_0xacda('0x5')],'include':[{'model':_0xacda('0x6'),'as':_0xacda('0x7'),'attributes':['id',_0xacda('0x3'),_0xacda('0x8'),_0xacda('0x9')]}]},'log':_0xacda('0xa')});};}; \ No newline at end of file +var _0x9721=['strategy','User','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0x50c2c8,_0x17421e){var _0x55f8a3=function(_0x1fb37e){while(--_0x1fb37e){_0x50c2c8['push'](_0x50c2c8['shift']());}};_0x55f8a3(++_0x17421e);}(_0x9721,0x9c));var _0x1972=function(_0x5b8b75,_0xbeed82){_0x5b8b75=_0x5b8b75-0x0;var _0x50eb22=_0x9721[_0x5b8b75];return _0x50eb22;};'use strict';var client=require(_0x1972('0x0'));exports[_0x1972('0x1')]=function(){return function(){return client[_0x1972('0x2')](_0x1972('0x3'),{'options':{'raw':![],'attributes':['id',_0x1972('0x4'),_0x1972('0x5'),_0x1972('0x6')],'include':[{'model':_0x1972('0x7'),'as':'Agents','attributes':['id',_0x1972('0x4'),'online',_0x1972('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index e35e36d..63d9b7c 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 _0xc263=['UpdateMailQueueReport','DESC','../client','create','Request','update'];(function(_0x28b778,_0x5238ca){var _0x2e8570=function(_0x59b391){while(--_0x59b391){_0x28b778['push'](_0x28b778['shift']());}};_0x2e8570(++_0x5238ca);}(_0xc263,0x1a0));var _0x3c26=function(_0x429c7e,_0x24114a){_0x429c7e=_0x429c7e-0x0;var _0x464264=_0xc263[_0x429c7e];return _0x464264;};'use strict';var client=require(_0x3c26('0x0'));exports[_0x3c26('0x1')]=function(_0x437a4c){return client[_0x3c26('0x2')]('CreateMailQueueReport',{'body':_0x437a4c,'log':'CreateMailQueueReport'});};exports[_0x3c26('0x3')]=function(_0x10c269,_0x3553e7){return client['Request'](_0x3c26('0x4'),{'body':_0x3553e7,'options':{'where':{'uniqueid':_0x10c269},'order':[['id',_0x3c26('0x5')]],'limit':0x1},'log':_0x3c26('0x4')});}; \ No newline at end of file +var _0x2640=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x568226,_0x445720){var _0x30aa82=function(_0x224bbf){while(--_0x224bbf){_0x568226['push'](_0x568226['shift']());}};_0x30aa82(++_0x445720);}(_0x2640,0x6c));var _0x0264=function(_0xc6118b,_0x3d0d0a){_0xc6118b=_0xc6118b-0x0;var _0x476401=_0x2640[_0xc6118b];return _0x476401;};'use strict';var client=require(_0x0264('0x0'));exports[_0x0264('0x1')]=function(_0x958f2f){return client[_0x0264('0x2')](_0x0264('0x3'),{'body':_0x958f2f,'log':_0x0264('0x3')});};exports[_0x0264('0x4')]=function(_0x19eea7,_0x1cdcd1){return client[_0x0264('0x2')](_0x0264('0x5'),{'body':_0x1cdcd1,'options':{'where':{'uniqueid':_0x19eea7},'order':[['id',_0x0264('0x6')]],'limit':0x1},'log':_0x0264('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ba33864..21ddf68 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 _0x1bad=['addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bad,0x9b));var _0xd1ba=function(_0x5791dc,_0xf78514){_0x5791dc=_0x5791dc-0x0;var _0x377476=_0x1bad[_0x5791dc];return _0x377476;};'use strict';var client=require(_0xd1ba('0x0'));exports[_0xd1ba('0x1')]=function(_0x2f95ec,_0x441e9a){return client['Request'](_0xd1ba('0x2'),{'body':_0x441e9a,'options':{'where':{'id':_0x2f95ec}},'log':_0xd1ba('0x3')});};exports[_0xd1ba('0x4')]=function(_0x5f3880,_0x5e5fda){return client[_0xd1ba('0x5')]('AddTagsToOpenchannelInteraction',{'body':_0x5e5fda,'options':{'where':{'id':_0x5f3880}},'log':_0xd1ba('0x6')});}; \ No newline at end of file +var _0x21e2=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x3c989c,_0xdd0084){var _0x325422=function(_0x4537d9){while(--_0x4537d9){_0x3c989c['push'](_0x3c989c['shift']());}};_0x325422(++_0xdd0084);}(_0x21e2,0x165));var _0x221e=function(_0x55245d,_0x3d6f0a){_0x55245d=_0x55245d-0x0;var _0x589b0e=_0x21e2[_0x55245d];return _0x589b0e;};'use strict';var client=require(_0x221e('0x0'));exports[_0x221e('0x1')]=function(_0x433d03,_0x1ad2cf){return client[_0x221e('0x2')](_0x221e('0x3'),{'body':_0x1ad2cf,'options':{'where':{'id':_0x433d03}},'log':_0x221e('0x4')});};exports[_0x221e('0x5')]=function(_0x22757a,_0x175ab4){return client[_0x221e('0x2')](_0x221e('0x6'),{'body':_0x175ab4,'options':{'where':{'id':_0x22757a}},'log':_0x221e('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index fcc6711..a40530e 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 _0x77b6=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x77b6,0x116));var _0x677b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x77b6[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x677b('0x0'));exports[_0x677b('0x1')]=function(_0x2e0d27){return client['Request'](_0x677b('0x2'),{'body':_0x2e0d27,'log':_0x677b('0x3')});}; \ No newline at end of file +var _0x2ec6=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x50e239,_0x1c535d){var _0x1854af=function(_0x5b280f){while(--_0x5b280f){_0x50e239['push'](_0x50e239['shift']());}};_0x1854af(++_0x1c535d);}(_0x2ec6,0xe7));var _0x62ec=function(_0x42c83c,_0x3b3072){_0x42c83c=_0x42c83c-0x0;var _0x436104=_0x2ec6[_0x42c83c];return _0x436104;};'use strict';var client=require(_0x62ec('0x0'));exports[_0x62ec('0x1')]=function(_0x5149c1){return client[_0x62ec('0x2')](_0x62ec('0x3'),{'body':_0x5149c1,'log':_0x62ec('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index f417ec0..33c448d 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 _0x4aa6=['User','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy'];(function(_0x2e5a3f,_0x165893){var _0x10b64e=function(_0x103e0f){while(--_0x103e0f){_0x2e5a3f['push'](_0x2e5a3f['shift']());}};_0x10b64e(++_0x165893);}(_0x4aa6,0x18a));var _0x64aa=function(_0x10a617,_0x4d6a9f){_0x10a617=_0x10a617-0x0;var _0x590e7b=_0x4aa6[_0x10a617];return _0x590e7b;};'use strict';var client=require(_0x64aa('0x0'));exports[_0x64aa('0x1')]=function(){return function(){return client[_0x64aa('0x2')](_0x64aa('0x3'),{'options':{'raw':![],'attributes':['id',_0x64aa('0x4'),'timeout',_0x64aa('0x5')],'include':[{'model':_0x64aa('0x6'),'as':'Agents','attributes':['id',_0x64aa('0x4'),'online',_0x64aa('0x7')]}]},'log':_0x64aa('0x1')});};}; \ No newline at end of file +var _0xf186=['name','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','User','Agents'];(function(_0x5e5deb,_0x3312e5){var _0x59e9ae=function(_0x568d87){while(--_0x568d87){_0x5e5deb['push'](_0x5e5deb['shift']());}};_0x59e9ae(++_0x3312e5);}(_0xf186,0x161));var _0x6f18=function(_0x30421c,_0x5ce6cc){_0x30421c=_0x30421c-0x0;var _0x59c4d6=_0xf186[_0x30421c];return _0x59c4d6;};'use strict';var client=require(_0x6f18('0x0'));exports[_0x6f18('0x1')]=function(){return function(){return client[_0x6f18('0x2')](_0x6f18('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x6f18('0x4'),'strategy'],'include':[{'model':_0x6f18('0x5'),'as':_0x6f18('0x6'),'attributes':['id',_0x6f18('0x7'),_0x6f18('0x8'),_0x6f18('0x9')]}]},'log':_0x6f18('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 78c3de4..d1757e7 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 _0xc626=['UpdateOpenchannelQueueReport','Request','CreateOpenchannelQueueReport','update'];(function(_0x3f1739,_0x59c32f){var _0x514ee2=function(_0x5867fd){while(--_0x5867fd){_0x3f1739['push'](_0x3f1739['shift']());}};_0x514ee2(++_0x59c32f);}(_0xc626,0x6d));var _0x6c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc626[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x503b21){return client[_0x6c62('0x0')](_0x6c62('0x1'),{'body':_0x503b21,'log':_0x6c62('0x1')});};exports[_0x6c62('0x2')]=function(_0x363009,_0x32d44b){return client[_0x6c62('0x0')](_0x6c62('0x3'),{'body':_0x32d44b,'options':{'where':{'uniqueid':_0x363009},'order':[['id','DESC']],'limit':0x1},'log':_0x6c62('0x3')});}; \ No newline at end of file +var _0x135b=['UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x543d2f,_0x1d7da3){var _0x1fc01a=function(_0xf81b90){while(--_0xf81b90){_0x543d2f['push'](_0x543d2f['shift']());}};_0x1fc01a(++_0x1d7da3);}(_0x135b,0xaf));var _0xb135=function(_0x45982a,_0x1f2be4){_0x45982a=_0x45982a-0x0;var _0x59a372=_0x135b[_0x45982a];return _0x59a372;};'use strict';var client=require(_0xb135('0x0'));exports[_0xb135('0x1')]=function(_0x35ae8a){return client[_0xb135('0x2')]('CreateOpenchannelQueueReport',{'body':_0x35ae8a,'log':_0xb135('0x3')});};exports[_0xb135('0x4')]=function(_0x4ee03d,_0x3b6c51){return client[_0xb135('0x2')](_0xb135('0x5'),{'body':_0x3b6c51,'options':{'where':{'uniqueid':_0x4ee03d},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index bc76470..5e795e1 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 _0xf1e1=['../client','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x2c8c0a,_0x53306b){var _0x1ff4d1=function(_0x233480){while(--_0x233480){_0x2c8c0a['push'](_0x2c8c0a['shift']());}};_0x1ff4d1(++_0x53306b);}(_0xf1e1,0x102));var _0x1f1e=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0xf1e1[_0x5dfc2a];return _0x3f1a71;};'use strict';var client=require(_0x1f1e('0x0'));exports['update']=function(_0x1689b1,_0x4953ca){return client[_0x1f1e('0x1')]('UpdateSmsInteraction',{'body':_0x4953ca,'options':{'where':{'id':_0x1689b1}},'log':_0x1f1e('0x2')});};exports[_0x1f1e('0x3')]=function(_0x2243c6,_0x2ab1f9){return client[_0x1f1e('0x1')](_0x1f1e('0x4'),{'body':_0x2ab1f9,'options':{'where':{'id':_0x2243c6}},'log':_0x1f1e('0x5')});}; \ No newline at end of file +var _0xc978=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','addTags'];(function(_0x30e026,_0xe6d9ec){var _0x55afd7=function(_0x54e287){while(--_0x54e287){_0x30e026['push'](_0x30e026['shift']());}};_0x55afd7(++_0xe6d9ec);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x8c97('0x0'));exports[_0x8c97('0x1')]=function(_0x45590d,_0x35f7e9){return client[_0x8c97('0x2')](_0x8c97('0x3'),{'body':_0x35f7e9,'options':{'where':{'id':_0x45590d}},'log':'updateSmsInteraction'});};exports[_0x8c97('0x4')]=function(_0x23c28d,_0x3ad972){return client[_0x8c97('0x2')](_0x8c97('0x5'),{'body':_0x3ad972,'options':{'where':{'id':_0x23c28d}},'log':_0x8c97('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index eab4074..22c1892 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 _0x297f=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x32c418,_0x43d591){var _0x295737=function(_0x2aadf6){while(--_0x2aadf6){_0x32c418['push'](_0x32c418['shift']());}};_0x295737(++_0x43d591);}(_0x297f,0xc0));var _0xf297=function(_0x3e6f36,_0x4c5ec4){_0x3e6f36=_0x3e6f36-0x0;var _0x4bb1a2=_0x297f[_0x3e6f36];return _0x4bb1a2;};'use strict';var client=require('../client');exports[_0xf297('0x0')]=function(_0x25977a){return client[_0xf297('0x1')](_0xf297('0x2'),{'body':_0x25977a,'log':_0xf297('0x3')});}; \ No newline at end of file +var _0xffdb=['Request','createSmsMessage'];(function(_0x2982ba,_0x5670c4){var _0x2e2a2e=function(_0x49dda1){while(--_0x49dda1){_0x2982ba['push'](_0x2982ba['shift']());}};_0x2e2a2e(++_0x5670c4);}(_0xffdb,0x1ea));var _0xbffd=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xffdb[_0x4a747d];return _0x3a5b5c;};'use strict';var client=require('../client');exports['create']=function(_0x464a1f){return client[_0xbffd('0x0')]('CreateSmsMessage',{'body':_0x464a1f,'log':_0xbffd('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 3c097c8..fdcee39 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x248648,_0x1c9f7f){var _0x32a7d0=function(_0x3eb228){while(--_0x3eb228){_0x248648['push'](_0x248648['shift']());}};_0x32a7d0(++_0x1c9f7f);}(_0x70e0,0x17b));var _0x070e=function(_0x502c31,_0xf6f719){_0x502c31=_0x502c31-0x0;var _0x3c154d=_0x70e0[_0x502c31];return _0x3c154d;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x316ed9,_0x4755fa){var _0x3d6e33=function(_0x34d01e){while(--_0x34d01e){_0x316ed9['push'](_0x316ed9['shift']());}};_0x3d6e33(++_0x4755fa);}(_0x70e0,0x17b));var _0x070e=function(_0x17fb78,_0x1f4064){_0x17fb78=_0x17fb78-0x0;var _0x31c593=_0x70e0[_0x17fb78];return _0x31c593;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 1d48ebd..d0efeb1 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x48bde8,_0x387736){var _0x1349e8=function(_0x85b7b0){while(--_0x85b7b0){_0x48bde8['push'](_0x48bde8['shift']());}};_0x1349e8(++_0x387736);}(_0x3e74,0x175));var _0x43e7=function(_0x52d8ba,_0x3ddd81){_0x52d8ba=_0x52d8ba-0x0;var _0x4fb74e=_0x3e74[_0x52d8ba];return _0x4fb74e;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2b4cd0,_0x457878){var _0x474616=function(_0x435315){while(--_0x435315){_0x2b4cd0['push'](_0x2b4cd0['shift']());}};_0x474616(++_0x457878);}(_0x008c,0x188));var _0xc008=function(_0x400096,_0x101dc3){_0x400096=_0x400096-0x0;var _0x31755a=_0x008c[_0x400096];return _0x31755a;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 639c8c6..ca4c971 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(_0x2409c7,_0x548bec){var _0x318759=function(_0xf61096){while(--_0xf61096){_0x2409c7['push'](_0x2409c7['shift']());}};_0x318759(++_0x548bec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x36467b,_0x1a49ac){var _0x76de4=function(_0x1459b2){while(--_0x1459b2){_0x36467b['push'](_0x36467b['shift']());}};_0x76de4(++_0x1a49ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 2b4dbce..a6c7766 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 _0x4f0d=['addTags','addTagsToWhatsappInteraction','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x31b045,_0x963840){var _0x147673=function(_0x251460){while(--_0x251460){_0x31b045['push'](_0x31b045['shift']());}};_0x147673(++_0x963840);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0x4f0d[_0xea1570];return _0x579e74;};'use strict';var client=require('../client');exports['update']=function(_0x4c1091,_0x5290b6){return client['Request'](_0xd4f0('0x0'),{'body':_0x5290b6,'options':{'where':{'id':_0x4c1091}},'log':_0xd4f0('0x1')});};exports[_0xd4f0('0x2')]=function(_0x577c8f,_0xb1db5){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0xb1db5,'options':{'where':{'id':_0x577c8f}},'log':_0xd4f0('0x3')});}; \ No newline at end of file +var _0xe1d3=['../client','update','Request','updateWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x2f1c54,_0x3321ac){var _0x28e88c=function(_0x36bb39){while(--_0x36bb39){_0x2f1c54['push'](_0x2f1c54['shift']());}};_0x28e88c(++_0x3321ac);}(_0xe1d3,0x159));var _0x3e1d=function(_0x582a30,_0x412286){_0x582a30=_0x582a30-0x0;var _0x5d70e5=_0xe1d3[_0x582a30];return _0x5d70e5;};'use strict';var client=require(_0x3e1d('0x0'));exports[_0x3e1d('0x1')]=function(_0x1aa7c7,_0x1340c7){return client[_0x3e1d('0x2')]('UpdateWhatsappInteraction',{'body':_0x1340c7,'options':{'where':{'id':_0x1aa7c7}},'log':_0x3e1d('0x3')});};exports['addTags']=function(_0x23f59b,_0x38df15){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x38df15,'options':{'where':{'id':_0x23f59b}},'log':_0x3e1d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index b34d3e5..cbb556e 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 _0x0a1b=['../client','create','Request','CreateWhatsappMessage'];(function(_0x53d17e,_0xf979c9){var _0x35b0cc=function(_0x556323){while(--_0x556323){_0x53d17e['push'](_0x53d17e['shift']());}};_0x35b0cc(++_0xf979c9);}(_0x0a1b,0x190));var _0xb0a1=function(_0x4af855,_0x529565){_0x4af855=_0x4af855-0x0;var _0x1147ed=_0x0a1b[_0x4af855];return _0x1147ed;};'use strict';var client=require(_0xb0a1('0x0'));exports[_0xb0a1('0x1')]=function(_0x8b5e2f){return client[_0xb0a1('0x2')](_0xb0a1('0x3'),{'body':_0x8b5e2f,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x13bb=['CreateWhatsappMessage','create','Request'];(function(_0x18d349,_0x2ba7f2){var _0x420307=function(_0x1c2742){while(--_0x1c2742){_0x18d349['push'](_0x18d349['shift']());}};_0x420307(++_0x2ba7f2);}(_0x13bb,0x13c));var _0xb13b=function(_0x1b3f23,_0xa1dee4){_0x1b3f23=_0x1b3f23-0x0;var _0x56a6b9=_0x13bb[_0x1b3f23];return _0x56a6b9;};'use strict';var client=require('../client');exports[_0xb13b('0x0')]=function(_0x1f988e){return client[_0xb13b('0x1')](_0xb13b('0x2'),{'body':_0x1f988e,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index bdcd357..07a8b52 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 _0xa896=['User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy'];(function(_0x1b905c,_0x287883){var _0x1f0195=function(_0x2959b2){while(--_0x2959b2){_0x1b905c['push'](_0x1b905c['shift']());}};_0x1f0195(++_0x287883);}(_0xa896,0x19e));var _0x6a89=function(_0x42203b,_0x5f2882){_0x42203b=_0x42203b-0x0;var _0x312bec=_0xa896[_0x42203b];return _0x312bec;};'use strict';var client=require(_0x6a89('0x0'));exports[_0x6a89('0x1')]=function(){return function(){return client[_0x6a89('0x2')](_0x6a89('0x3'),{'options':{'raw':![],'attributes':['id',_0x6a89('0x4'),'timeout',_0x6a89('0x5')],'include':[{'model':_0x6a89('0x6'),'as':_0x6a89('0x7'),'attributes':['id',_0x6a89('0x4'),_0x6a89('0x8'),_0x6a89('0x9')]}]},'log':_0x6a89('0x1')});};}; \ No newline at end of file +var _0xd3e1=['online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','strategy','User','Agents'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0xd3e1,0xda));var _0x1d3e=function(_0xc97b68,_0x528d2f){_0xc97b68=_0xc97b68-0x0;var _0x2b74b1=_0xd3e1[_0xc97b68];return _0x2b74b1;};'use strict';var client=require(_0x1d3e('0x0'));exports[_0x1d3e('0x1')]=function(){return function(){return client['Request'](_0x1d3e('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d3e('0x3'),'timeout',_0x1d3e('0x4')],'include':[{'model':_0x1d3e('0x5'),'as':_0x1d3e('0x6'),'attributes':['id','name',_0x1d3e('0x7'),_0x1d3e('0x8')]}]},'log':_0x1d3e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 57f9aab..aef390d 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 _0xaa05=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x3c480d,_0x342e8f){var _0x108168=function(_0x1dae17){while(--_0x1dae17){_0x3c480d['push'](_0x3c480d['shift']());}};_0x108168(++_0x342e8f);}(_0xaa05,0xaa));var _0x5aa0=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0xaa05[_0x480bc8];return _0x28c245;};'use strict';var client=require(_0x5aa0('0x0'));exports['create']=function(_0x3aa337){return client[_0x5aa0('0x1')](_0x5aa0('0x2'),{'body':_0x3aa337,'log':_0x5aa0('0x2')});};exports[_0x5aa0('0x3')]=function(_0x2b9e36,_0x291af6){return client[_0x5aa0('0x1')](_0x5aa0('0x4'),{'body':_0x291af6,'options':{'where':{'uniqueid':_0x2b9e36},'order':[['id','DESC']],'limit':0x1},'log':_0x5aa0('0x4')});}; \ No newline at end of file +var _0x3f15=['DESC','UpdateWhatsappQueueReport','create','Request','update'];(function(_0x5b3e69,_0x2dd2f7){var _0x1e8a56=function(_0x1cbb1b){while(--_0x1cbb1b){_0x5b3e69['push'](_0x5b3e69['shift']());}};_0x1e8a56(++_0x2dd2f7);}(_0x3f15,0xe3));var _0x53f1=function(_0x503e3d,_0x65c6c3){_0x503e3d=_0x503e3d-0x0;var _0x559eaa=_0x3f15[_0x503e3d];return _0x559eaa;};'use strict';var client=require('../client');exports[_0x53f1('0x0')]=function(_0x5450b5){return client[_0x53f1('0x1')]('CreateWhatsappQueueReport',{'body':_0x5450b5,'log':'CreateWhatsappQueueReport'});};exports[_0x53f1('0x2')]=function(_0x1b0cea,_0x1e800c){return client[_0x53f1('0x1')]('UpdateWhatsappQueueReport',{'body':_0x1e800c,'options':{'where':{'uniqueid':_0x1b0cea},'order':[['id',_0x53f1('0x3')]],'limit':0x1},'log':_0x53f1('0x4')});}; \ 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 cf0d6d3..ab3215f 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 _0x982d=['length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate'];(function(_0x58c73d,_0x1e3572){var _0x2e676a=function(_0x4a154f){while(--_0x4a154f){_0x58c73d['push'](_0x58c73d['shift']());}};_0x2e676a(++_0x1e3572);}(_0x982d,0x111));var _0xd982=function(_0x21248a,_0x36e179){_0x21248a=_0x21248a-0x0;var _0x33ac83=_0x982d[_0x21248a];return _0x33ac83;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xd982('0x0'));var seqqueue=require(_0xd982('0x1'));var logger=require(_0xd982('0x2'))(_0xd982('0x3'));var strategy=require(_0xd982('0x4'));var queue=schema({'name':{'type':_0xd982('0x5'),'required':!![],'message':_0xd982('0x6')},'timeout':{'type':_0xd982('0x7'),'message':_0xd982('0x8')}});function writeLog(_0x4f568b,_0x526a6e,_0x434697){return logger['info'](util[_0xd982('0x9')](_0xd982('0xa'),_0x4f568b,_0x526a6e[_0xd982('0xb')],_0x434697));}function handleFindAgent(_0x44a75d){return function(_0x5eeb7b){return _0x5eeb7b[_0xd982('0xb')][_0xd982('0xc')]()===_0x44a75d[_0xd982('0xc')]();};}exports[_0xd982('0xd')]=function(_0x7541ee,_0x1b5197,_0x41ae50,_0x41554e){return function(_0x4a2748){try{var _0x1e71f0={'name':_0x1b5197[0x0],'timeout':_0x1b5197[0x1]};var _0x18e7a3=queue[_0xd982('0xe')](_0x1e71f0,{'typecast':!![]});if(_0x18e7a3[_0xd982('0xf')]){logger['error'](_0xd982('0x10'),_0x7541ee,_[_0xd982('0x11')](_0x18e7a3,_0xd982('0x12'))[_0xd982('0x13')](',\x20'));_0x4a2748[_0xd982('0x14')]();}else{var _0x1b1596=_[_0xd982('0x15')](_0x41ae50[_0xd982('0x16')],handleFindAgent(_0x1e71f0['name']));if(_0x1b1596){var _0x2e60f4=(_0x1e71f0[_0xd982('0x17')]||0xa)*0x3e8;var _0x64343c,_0xffab71;var _0x5516a0=seqqueue[_0xd982('0x18')](_0x2e60f4);_0x5516a0['id']=_0x7541ee;_0x5516a0['atimeout']=_0x2e60f4;_0x5516a0[_0xd982('0x19')]=_0x41554e[_0xd982('0x19')];writeLog(_0x7541ee,_0x1b1596,util[_0xd982('0x9')](_0xd982('0x1a'),_0x2e60f4));_0x41ae50[_0xd982('0x1b')][_0x7541ee]['on']('end',function(){logger[_0xd982('0x1c')](_0xd982('0x1d'),_0x7541ee);clearTimeout(_0xffab71);_0xffab71=undefined;_0x5516a0[_0xd982('0x1e')]();if(_0x41ae50[_0xd982('0x1b')][_0x7541ee]){delete _0x41ae50[_0xd982('0x1b')][_0x7541ee];}_0x4a2748[_0xd982('0x14')]();});_0x41ae50[_0xd982('0x1b')][_0x7541ee]['on'](_0xd982('0x1f'),function(){if(_0x41ae50[_0xd982('0x1b')][_0x7541ee]){delete _0x41ae50[_0xd982('0x1b')][_0x7541ee];}});_0xffab71=setTimeout(function(){logger[_0xd982('0x1c')](_0xd982('0x20'),_0x7541ee);clearTimeout(_0xffab71);_0x5516a0[_0xd982('0x1e')]();_0x4a2748['next']();},_0x2e60f4);strategy[_0xd982('0x21')](_0x5516a0,_0x1b1596,_0x41ae50,_0x41554e);}else{logger['error'](_0xd982('0x22'),_0x7541ee,_0x1e71f0[_0xd982('0xb')]);_0x4a2748[_0xd982('0x14')]();}}}catch(_0x5a95dc){console['log'](_0x5a95dc);logger['error'](_0xd982('0x23'),_0x7541ee,_0x5a95dc['stack']);_0x4a2748['stop']();}};}; \ No newline at end of file +var _0x7574=['[%s][QUEUE]\x20%s','util','../../../../config/logger','./strategy','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','validate','length','error','map','message','join','find','agents','name','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x40d314,_0x20efaf){var _0x51d842=function(_0x48f90b){while(--_0x48f90b){_0x40d314['push'](_0x40d314['shift']());}};_0x51d842(++_0x20efaf);}(_0x7574,0x1d5));var _0x4757=function(_0x50c9e3,_0x20225b){_0x50c9e3=_0x50c9e3-0x0;var _0x76a518=_0x7574[_0x50c9e3];return _0x76a518;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x4757('0x0'));var seqqueue=require('seq-queue');var logger=require(_0x4757('0x1'))('routing');var strategy=require(_0x4757('0x2'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x4757('0x3'),'message':_0x4757('0x4')}});function writeLog(_0x58251b,_0x36a76e,_0x5c96fd){return logger[_0x4757('0x5')](util[_0x4757('0x6')](_0x4757('0x7'),_0x58251b,_0x36a76e['name'],_0x5c96fd));}function handleFindAgent(_0x620801){return function(_0x450817){return _0x450817['name']['toLowerCase']()===_0x620801[_0x4757('0x8')]();};}exports[_0x4757('0x9')]=function(_0x1088e7,_0x27998a,_0x556245,_0x593269){return function(_0x2ea80b){try{var _0x51763b={'name':_0x27998a[0x0],'timeout':_0x27998a[0x1]};var _0x501c5c=queue[_0x4757('0xa')](_0x51763b,{'typecast':!![]});if(_0x501c5c[_0x4757('0xb')]){logger[_0x4757('0xc')]('[%s][AGENT]\x20%s',_0x1088e7,_[_0x4757('0xd')](_0x501c5c,_0x4757('0xe'))[_0x4757('0xf')](',\x20'));_0x2ea80b['stop']();}else{var _0x2da30a=_[_0x4757('0x10')](_0x556245[_0x4757('0x11')],handleFindAgent(_0x51763b[_0x4757('0x12')]));if(_0x2da30a){var _0x18699b=(_0x51763b[_0x4757('0x13')]||0xa)*0x3e8;var _0x3083fc,_0x317b9f;var _0x590fd9=seqqueue[_0x4757('0x14')](_0x18699b);_0x590fd9['id']=_0x1088e7;_0x590fd9[_0x4757('0x15')]=_0x18699b;_0x590fd9[_0x4757('0x16')]=_0x593269[_0x4757('0x16')];writeLog(_0x1088e7,_0x2da30a,util[_0x4757('0x6')](_0x4757('0x17'),_0x18699b));_0x556245[_0x4757('0x18')][_0x1088e7]['on'](_0x4757('0x19'),function(){logger[_0x4757('0x5')](_0x4757('0x1a'),_0x1088e7);clearTimeout(_0x317b9f);_0x317b9f=undefined;_0x590fd9[_0x4757('0x1b')]();if(_0x556245['rules'][_0x1088e7]){delete _0x556245[_0x4757('0x18')][_0x1088e7];}_0x2ea80b[_0x4757('0x1c')]();});_0x556245[_0x4757('0x18')][_0x1088e7]['on'](_0x4757('0x1d'),function(){if(_0x556245[_0x4757('0x18')][_0x1088e7]){delete _0x556245[_0x4757('0x18')][_0x1088e7];}});_0x317b9f=setTimeout(function(){logger[_0x4757('0x5')](_0x4757('0x1e'),_0x1088e7);clearTimeout(_0x317b9f);_0x590fd9[_0x4757('0x1b')]();_0x2ea80b[_0x4757('0x1f')]();},_0x18699b);strategy[_0x4757('0x20')](_0x590fd9,_0x2da30a,_0x556245,_0x593269);}else{logger['error'](_0x4757('0x21'),_0x1088e7,_0x51763b[_0x4757('0x12')]);_0x2ea80b['stop']();}}}catch(_0x5f2449){console[_0x4757('0x22')](_0x5f2449);logger[_0x4757('0xc')](_0x4757('0x23'),_0x1088e7,_0x5f2449['stack']);_0x2ea80b['stop']();}};}; \ 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 df7ceab..d3c6291 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 _0x4b4f=['channel','sms','phone','upperFirst','AccountId','InteractionId','created','getMustacheRender','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','amazonlex','providerResponse','Message','then','dialogState','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x1a167a,_0x37fcaf){var _0x148f8b=function(_0x26c39a){while(--_0x26c39a){_0x1a167a['push'](_0x1a167a['shift']());}};_0x148f8b(++_0x37fcaf);}(_0x4b4f,0xd5));var _0xf4b4=function(_0x3c31be,_0x379c19){_0x3c31be=_0x3c31be-0x0;var _0x3a5b92=_0x4b4f[_0x3c31be];return _0x3a5b92;};'use strict';var _=require(_0xf4b4('0x0'));var moment=require('moment');var AWS=require(_0xf4b4('0x1'));var utils=require(_0xf4b4('0x2'));var logger=require(_0xf4b4('0x3'))(_0xf4b4('0x4'));var rpc={'chatMessage':require(_0xf4b4('0x5')),'openchannelMessage':require(_0xf4b4('0x6')),'mailMessage':require(_0xf4b4('0x7')),'smsMessage':require(_0xf4b4('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf4b4('0x9'))};exports[_0xf4b4('0xa')]=function(_0x43551a,_0x56c6b8){return function(_0x31a7f2){try{if(!_[_0xf4b4('0xb')](this[_0xf4b4('0xc')][_0xf4b4('0xd')])){logger[_0xf4b4('0xe')](_0xf4b4('0xf'),_0x43551a,_0xf4b4('0x10'));return _0x31a7f2[_0xf4b4('0x11')]();}var _0x5b01e1={'ContactId':this[_0xf4b4('0x12')]['id'],'sentAt':moment()[_0xf4b4('0x13')](_0xf4b4('0x14')),'direction':_0xf4b4('0x15')};if(this[_0xf4b4('0x16')]===_0xf4b4('0x17')||this[_0xf4b4('0x16')]==='whatsapp'){_0x5b01e1[_0xf4b4('0x18')]=this[_0xf4b4('0xc')][_0xf4b4('0x18')];}var _0x58b619=this[_0xf4b4('0x16')];if(_0x58b619==='chat'){_0x5b01e1['ChatWebsiteId']=this['account']['id'];}else{_0x5b01e1[_[_0xf4b4('0x19')](_0x58b619)+_0xf4b4('0x1a')]=this['account']['id'];}_0x5b01e1[_[_0xf4b4('0x19')](_0x58b619)+_0xf4b4('0x1b')]=this[_0xf4b4('0xc')]['id'];if(this[_0xf4b4('0xc')][_0xf4b4('0x1c')]){var _0x41109d=_0x56c6b8[0x4];if(!_['isEmpty'](_0x41109d)){_0x5b01e1['body']=utils[_0xf4b4('0x1d')](_0x41109d,this);return rpc[_0x58b619+'Message']['create'](_0x5b01e1)['then'](function(_0x4af217){logger[_0xf4b4('0xe')](_0xf4b4('0xf'),_0x43551a,_0x5b01e1[_0xf4b4('0x1e')]);})['catch'](function(_0x17bdfe){logger[_0xf4b4('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x43551a,JSON[_0xf4b4('0x20')](_0x17bdfe));})[_0xf4b4('0x21')](function(){logger[_0xf4b4('0xe')](_0xf4b4('0x22'),_0x43551a);_0x31a7f2[_0xf4b4('0x23')]();});}else{logger[_0xf4b4('0xe')](_0xf4b4('0x24'),_0x43551a);_0x31a7f2[_0xf4b4('0x23')]();}}else{var _0x1d5d59=this;var _0x459a71=new AWS[(_0xf4b4('0x25'))]({'accessKeyId':_0x56c6b8[0x0],'secretAccessKey':_0x56c6b8[0x1],'region':_0x56c6b8[0x2]});var _0x3089b6={'botAlias':'$LATEST','botName':_0x56c6b8[0x3],'inputText':this[_0xf4b4('0x26')][_0xf4b4('0x1e')],'userId':this[_0xf4b4('0x16')]+':'+this['interaction']['id'][_0xf4b4('0x27')]()};_0x459a71[_0xf4b4('0x28')](_0x3089b6,function(_0x4326d9,_0x36aada){if(_0x4326d9){logger[_0xf4b4('0x1f')](_0xf4b4('0xf'),_0x43551a,_0x4326d9['message']);_0x31a7f2['next']();}else if(_0x36aada&&_0x36aada[_0xf4b4('0x26')]){_0x1d5d59[_0xf4b4('0x1e')]['amazonlex']=_0x36aada;_0x5b01e1['body']=_0x36aada[_0xf4b4('0x26')];_0x5b01e1[_0xf4b4('0x29')]=_0xf4b4('0x2a');_0x5b01e1[_0xf4b4('0x2b')]=JSON[_0xf4b4('0x20')](_0x36aada);return rpc[_0x58b619+_0xf4b4('0x2c')]['create'](_0x5b01e1)[_0xf4b4('0x2d')](function(_0x29f8b4){logger[_0xf4b4('0xe')](_0xf4b4('0xf'),_0x43551a,_0x5b01e1[_0xf4b4('0x1e')]);if(_0x36aada[_0xf4b4('0x2e')]=='Failed'){_0x31a7f2[_0xf4b4('0x11')]();}else{_0x31a7f2[_0xf4b4('0x23')]();}})['catch'](function(_0x51cf69){logger['error'](_0xf4b4('0xf'),_0x43551a,JSON['stringify'](_0x51cf69));_0x31a7f2[_0xf4b4('0x11')]();});}else{_0x31a7f2['next']();}});}}catch(_0x7dc941){logger[_0xf4b4('0x1f')](_0xf4b4('0xf'),_0x43551a,JSON['stringify'](_0x7dc941));_0x31a7f2['stop']();}};}; \ No newline at end of file +var _0x185e=['lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','chat','account','AccountId','upperFirst','InteractionId','created','body','Message','create','then','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','postText','error','message','amazonlex','providerName','providerResponse','Failed','catch'];(function(_0x2bf6a7,_0x2b4525){var _0x16b013=function(_0x1349d8){while(--_0x1349d8){_0x2bf6a7['push'](_0x2bf6a7['shift']());}};_0x16b013(++_0x2b4525);}(_0x185e,0x114));var _0xe185=function(_0x4bf8c2,_0x17f83){_0x4bf8c2=_0x4bf8c2-0x0;var _0xf2ecfe=_0x185e[_0x4bf8c2];return _0xf2ecfe;};'use strict';var _=require(_0xe185('0x0'));var moment=require('moment');var AWS=require(_0xe185('0x1'));var utils=require('./utils');var logger=require(_0xe185('0x2'))(_0xe185('0x3'));var rpc={'chatMessage':require(_0xe185('0x4')),'openchannelMessage':require(_0xe185('0x5')),'mailMessage':require(_0xe185('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe185('0x7')),'whatsappMessage':require(_0xe185('0x8'))};exports[_0xe185('0x9')]=function(_0x3499ea,_0x42a1cd){return function(_0x2ac0a3){try{if(!_[_0xe185('0xa')](this[_0xe185('0xb')]['UserId'])){logger[_0xe185('0xc')](_0xe185('0xd'),_0x3499ea,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2ac0a3[_0xe185('0xe')]();}var _0x56a2b2={'ContactId':this[_0xe185('0xf')]['id'],'sentAt':moment()[_0xe185('0x10')](_0xe185('0x11')),'direction':'out'};if(this['channel']===_0xe185('0x12')||this[_0xe185('0x13')]===_0xe185('0x14')){_0x56a2b2[_0xe185('0x15')]=this['interaction'][_0xe185('0x15')];}var _0x568cac=this['channel'];if(_0x568cac===_0xe185('0x16')){_0x56a2b2['ChatWebsiteId']=this[_0xe185('0x17')]['id'];}else{_0x56a2b2[_['upperFirst'](_0x568cac)+_0xe185('0x18')]=this[_0xe185('0x17')]['id'];}_0x56a2b2[_[_0xe185('0x19')](_0x568cac)+_0xe185('0x1a')]=this[_0xe185('0xb')]['id'];if(this['interaction'][_0xe185('0x1b')]){var _0x5506cc=_0x42a1cd[0x4];if(!_['isEmpty'](_0x5506cc)){_0x56a2b2[_0xe185('0x1c')]=utils['getMustacheRender'](_0x5506cc,this);return rpc[_0x568cac+_0xe185('0x1d')][_0xe185('0x1e')](_0x56a2b2)[_0xe185('0x1f')](function(_0x27b57e){logger[_0xe185('0xc')](_0xe185('0xd'),_0x3499ea,_0x56a2b2[_0xe185('0x1c')]);})['catch'](function(_0x446f8f){logger['error'](_0xe185('0xd'),_0x3499ea,JSON[_0xe185('0x20')](_0x446f8f));})[_0xe185('0x21')](function(){logger[_0xe185('0xc')](_0xe185('0x22'),_0x3499ea);_0x2ac0a3[_0xe185('0x23')]();});}else{logger[_0xe185('0xc')](_0xe185('0x24'),_0x3499ea);_0x2ac0a3[_0xe185('0x23')]();}}else{var _0x3744cc=this;var _0x27ddc5=new AWS['LexRuntime']({'accessKeyId':_0x42a1cd[0x0],'secretAccessKey':_0x42a1cd[0x1],'region':_0x42a1cd[0x2]});var _0x235473={'botAlias':_0xe185('0x25'),'botName':_0x42a1cd[0x3],'inputText':this['message']['body'],'userId':this[_0xe185('0x13')]+':'+this[_0xe185('0xb')]['id']['toString']()};_0x27ddc5[_0xe185('0x26')](_0x235473,function(_0x559fc7,_0x5da290){if(_0x559fc7){logger[_0xe185('0x27')](_0xe185('0xd'),_0x3499ea,_0x559fc7[_0xe185('0x28')]);_0x2ac0a3[_0xe185('0xe')]();}else if(_0x5da290&&_0x5da290[_0xe185('0x28')]){_0x3744cc['body'][_0xe185('0x29')]=_0x5da290;_0x56a2b2[_0xe185('0x1c')]=_0x5da290[_0xe185('0x28')];_0x56a2b2[_0xe185('0x2a')]=_0xe185('0x29');_0x56a2b2[_0xe185('0x2b')]=JSON[_0xe185('0x20')](_0x5da290);return rpc[_0x568cac+_0xe185('0x1d')][_0xe185('0x1e')](_0x56a2b2)[_0xe185('0x1f')](function(_0x51c3a7){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3499ea,_0x56a2b2[_0xe185('0x1c')]);if(_0x5da290['dialogState']==_0xe185('0x2c')){_0x2ac0a3[_0xe185('0xe')]();}else{_0x2ac0a3[_0xe185('0x23')]();}})[_0xe185('0x2d')](function(_0x285384){logger[_0xe185('0x27')](_0xe185('0xd'),_0x3499ea,JSON['stringify'](_0x285384));_0x2ac0a3[_0xe185('0xe')]();});}else{_0x2ac0a3[_0xe185('0xe')]();}});}}catch(_0x1254a2){logger[_0xe185('0x27')](_0xe185('0xd'),_0x3499ea,JSON['stringify'](_0x1254a2));_0x2ac0a3[_0xe185('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index e91c2bd..dfa47b4 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 _0x6410=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','phone','subject','startsWith','Re:','Re:\x20','account','AccountId','upperFirst','InteractionId','Message','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','html','replace','','headers','auto-replied','All','auto_reply','then','messageId','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','next','create','finally','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x82d188,_0x9feace){var _0x31d3d2=function(_0x4a2961){while(--_0x4a2961){_0x82d188['push'](_0x82d188['shift']());}};_0x31d3d2(++_0x9feace);}(_0x6410,0x16c));var _0x0641=function(_0x10dbd4,_0x258862){_0x10dbd4=_0x10dbd4-0x0;var _0x4045cf=_0x6410[_0x10dbd4];return _0x4045cf;};'use strict';var _=require(_0x0641('0x0'));var moment=require(_0x0641('0x1'));var utils=require(_0x0641('0x2'));var logger=require(_0x0641('0x3'))(_0x0641('0x4'));var rpc={'chatMessage':require(_0x0641('0x5')),'openchannelMessage':require(_0x0641('0x6')),'mailMessage':require(_0x0641('0x7')),'smsMessage':require(_0x0641('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x0641('0x9')),'openchannelInteraction':require(_0x0641('0xa')),'mailInteraction':require(_0x0641('0xb')),'smsInteraction':require(_0x0641('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x0641('0xd'))};var mailRpc=require(_0x0641('0xe'));exports[_0x0641('0xf')]=function(_0x51d3f9,_0x114fd2,_0x5c296b,_0x105764){return function(_0x196ebb){try{var _0x45aa40=this[_0x0641('0x10')];if(_0x45aa40===_0x0641('0x11')&&_0x105764[_0x0641('0x12')][_0x0641('0x13')]){logger[_0x0641('0x14')](_0x0641('0x15'),_0x51d3f9,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x196ebb['next']();}if(_0x114fd2[0x0]==='1'&&(_[_0x0641('0x16')](this['interaction']['created'])||!this[_0x0641('0x17')][_0x0641('0x18')])){logger[_0x0641('0x14')](_0x0641('0x15'),_0x51d3f9,'Autoreply\x20already\x20sent');return _0x196ebb['next']();}if(_0x114fd2[0x0]==='2'&&this[_0x0641('0x17')][_0x0641('0x19')]){logger[_0x0641('0x14')](_0x0641('0x1a'),_0x51d3f9,_0x0641('0x1b'));return _0x196ebb['next']();}var _0x16b622={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0641('0x1c')](_0x0641('0x1d')),'direction':_0x0641('0x1e')};if(this[_0x0641('0x10')]===_0x0641('0x11')){_0x16b622[_0x0641('0x12')]=utils[_0x0641('0x1f')](_0x114fd2[0x2],this);}else{_0x16b622[_0x0641('0x12')]=utils[_0x0641('0x1f')](_0x114fd2[0x1],this);}if(this[_0x0641('0x20')]){_0x16b622['to']=this['message']['from']||'';if(this['channel']==='mail'&&_0x114fd2[0x1]==='1'){_0x16b622['cc']=this[_0x0641('0x20')]['cc']||'';}_0x16b622['from']=this['message']['to']||'';_0x16b622[_0x0641('0x21')]=this[_0x0641('0x20')][_0x0641('0x21')]||'';_0x16b622['read']=!![];if(this[_0x0641('0x20')][_0x0641('0x22')]){_0x16b622['subject']='';_0x16b622[_0x0641('0x22')]+=_[_0x0641('0x23')](this[_0x0641('0x20')][_0x0641('0x22')],_0x0641('0x24'))?'':_0x0641('0x25');_0x16b622[_0x0641('0x22')]+=this[_0x0641('0x20')][_0x0641('0x22')];}}if(this['channel']==='chat'){_0x16b622['ChatWebsiteId']=this[_0x0641('0x26')]['id'];}else{_0x16b622[_['upperFirst'](this[_0x0641('0x10')])+_0x0641('0x27')]=this[_0x0641('0x26')]['id'];}_0x16b622[_[_0x0641('0x28')](this[_0x0641('0x10')])+_0x0641('0x29')]=this[_0x0641('0x17')]['id'];var _0x2b958b=this['interaction'];if(rpc[this[_0x0641('0x10')]+_0x0641('0x2a')]){if(this[_0x0641('0x10')]===_0x0641('0x11')){var _0x50026f={'tls':{'rejectUnauthorized':![]}};if(this[_0x0641('0x26')][_0x0641('0x2b')][_0x0641('0x2c')]){_0x50026f[_0x0641('0x2c')]=this['account']['Smtp'][_0x0641('0x2c')];}else{_0x50026f['host']=this[_0x0641('0x26')][_0x0641('0x2b')]['host'];_0x50026f[_0x0641('0x2d')]=this['account'][_0x0641('0x2b')]['port'];_0x50026f[_0x0641('0x2e')]=this[_0x0641('0x26')][_0x0641('0x2b')][_0x0641('0x2e')];}if(this[_0x0641('0x26')]['Smtp'][_0x0641('0x2f')]){_0x50026f[_0x0641('0x30')]={'user':this[_0x0641('0x26')][_0x0641('0x2b')][_0x0641('0x31')],'pass':this['account']['Smtp'][_0x0641('0x32')]};}_0x16b622[_0x0641('0x33')]=this[_0x0641('0x20')]['messageId'];_0x16b622[_0x0641('0x34')]=''+_[_0x0641('0x35')](_0x16b622[_0x0641('0x12')],_0x0641('0x36'),_0x0641('0x37'))+_0x0641('0x38');_0x16b622[_0x0641('0x39')]={'Auto-Submitted':_0x0641('0x3a'),'X-Auto-Response-Suppress':_0x0641('0x3b'),'Precedence':_0x0641('0x3c')};return mailRpc['sendMailMessage'](_0x50026f,_0x16b622)[_0x0641('0x3d')](function(_0x49ba8c){logger[_0x0641('0x14')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x51d3f9);_0x16b622[_0x0641('0x3e')]=_0x49ba8c[_0x0641('0x20')][_0x0641('0x3e')];return rpc[_0x45aa40+_0x0641('0x2a')]['create'](_0x16b622);})[_0x0641('0x3d')](function(_0x33d65a){logger['info']('[%s][AUTOREPLY]\x20%s',_0x51d3f9,JSON[_0x0641('0x3f')](_0x33d65a));})['catch'](function(_0x58537c){logger[_0x0641('0x40')](_0x0641('0x41'),_0x51d3f9,JSON['stringify'](_0x58537c));})['finally'](function(){Promise[_0x0641('0x42')]()['then'](function(){if(_0x114fd2[0x0]!=='2'||_0x2b958b[_0x0641('0x19')])return;return rpc[_0x45aa40+_0x0641('0x43')][_0x0641('0x44')](_0x2b958b['id'],{'autoreplyExecuted':!![]})['then'](function(_0x446baf){logger[_0x0641('0x14')](_0x0641('0x1a'),_0x51d3f9,JSON[_0x0641('0x3f')](_0x446baf));})[_0x0641('0x45')](function(_0x33c750){logger[_0x0641('0x40')](_0x0641('0x46'),_0x51d3f9,JSON[_0x0641('0x3f')](_0x33c750));});})[_0x0641('0x3d')](function(){_0x196ebb[_0x0641('0x47')]();});});}else{return rpc[this['channel']+'Message'][_0x0641('0x48')](_0x16b622)['then'](function(_0x516a3f){logger[_0x0641('0x14')]('[%s][AUTOREPLY]\x20%s',_0x51d3f9,_0x16b622['body']);})[_0x0641('0x45')](function(_0x4e503f){logger[_0x0641('0x40')]('[%s][AUTOREPLY]\x20%s',_0x51d3f9,JSON[_0x0641('0x3f')](_0x4e503f));})[_0x0641('0x49')](function(){Promise[_0x0641('0x42')]()[_0x0641('0x3d')](function(){if(_0x114fd2[0x0]!=='2'||_0x2b958b['autoreplyExecuted'])return;return rpc[_0x45aa40+_0x0641('0x43')]['update'](_0x2b958b['id'],{'autoreplyExecuted':!![]})[_0x0641('0x3d')](function(_0x78626a){logger[_0x0641('0x14')](_0x0641('0x1a'),_0x51d3f9,JSON[_0x0641('0x3f')](_0x78626a));})['catch'](function(_0x1d61cc){logger['error'](_0x0641('0x46'),_0x51d3f9,JSON[_0x0641('0x3f')](_0x1d61cc));});})[_0x0641('0x3d')](function(){_0x196ebb['next']();});});}}}catch(_0x530622){logger['error'](_0x0641('0x15'),_0x51d3f9,JSON[_0x0641('0x3f')](_0x530622));_0x196ebb['stop']();}};}; \ No newline at end of file +var _0xbd24=['format','out','channel','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','Smtp','service','host','port','authentication','auth','user','pass','inReplyTo',''+_['replace'](_0x2e24d3[_0x4bd2('0xd')],_0x4bd2('0x32'),_0x4bd2('0x33'))+'';_0x2e24d3[_0x4bd2('0x34')]={'Auto-Submitted':_0x4bd2('0x35'),'X-Auto-Response-Suppress':_0x4bd2('0x36'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](_0x46f3bf,_0x2e24d3)[_0x4bd2('0x37')](function(_0x1141f7){logger[_0x4bd2('0x12')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x2dc11e);_0x2e24d3[_0x4bd2('0x38')]=_0x1141f7[_0x4bd2('0x1c')][_0x4bd2('0x38')];return rpc[_0x4bd898+_0x4bd2('0x28')][_0x4bd2('0x39')](_0x2e24d3);})[_0x4bd2('0x37')](function(_0x3e69ec){logger[_0x4bd2('0x12')](_0x4bd2('0x13'),_0x2dc11e,JSON[_0x4bd2('0x3a')](_0x3e69ec));})[_0x4bd2('0x3b')](function(_0x3286de){logger[_0x4bd2('0x3c')](_0x4bd2('0x3d'),_0x2dc11e,JSON['stringify'](_0x3286de));})[_0x4bd2('0x3e')](function(){Promise['resolve']()[_0x4bd2('0x37')](function(){if(_0x57cde2[0x0]!=='2'||_0x2aed2c[_0x4bd2('0x15')])return;return rpc[_0x4bd898+'Interaction']['update'](_0x2aed2c['id'],{'autoreplyExecuted':!![]})[_0x4bd2('0x37')](function(_0x526530){logger['info'](_0x4bd2('0x3f'),_0x2dc11e,JSON[_0x4bd2('0x3a')](_0x526530));})[_0x4bd2('0x3b')](function(_0x333c2e){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2dc11e,JSON[_0x4bd2('0x3a')](_0x333c2e));});})[_0x4bd2('0x37')](function(){_0x1883d3[_0x4bd2('0xe')]();});});}else{return rpc[this[_0x4bd2('0x1a')]+_0x4bd2('0x28')][_0x4bd2('0x39')](_0x2e24d3)[_0x4bd2('0x37')](function(_0x59a408){logger[_0x4bd2('0x12')](_0x4bd2('0x13'),_0x2dc11e,_0x2e24d3[_0x4bd2('0xd')]);})[_0x4bd2('0x3b')](function(_0xe0f5ee){logger['error'](_0x4bd2('0x13'),_0x2dc11e,JSON[_0x4bd2('0x3a')](_0xe0f5ee));})[_0x4bd2('0x3e')](function(){Promise['resolve']()[_0x4bd2('0x37')](function(){if(_0x57cde2[0x0]!=='2'||_0x2aed2c[_0x4bd2('0x15')])return;return rpc[_0x4bd898+_0x4bd2('0x40')][_0x4bd2('0x41')](_0x2aed2c['id'],{'autoreplyExecuted':!![]})[_0x4bd2('0x37')](function(_0x231b03){logger['info'](_0x4bd2('0x3f'),_0x2dc11e,JSON[_0x4bd2('0x3a')](_0x231b03));})[_0x4bd2('0x3b')](function(_0x260a23){logger['error'](_0x4bd2('0x42'),_0x2dc11e,JSON[_0x4bd2('0x3a')](_0x260a23));});})[_0x4bd2('0x37')](function(){_0x1883d3['next']();});});}}}catch(_0x2edf8e){logger['error'](_0x4bd2('0x13'),_0x2dc11e,JSON['stringify'](_0x2edf8e));_0x1883d3[_0x4bd2('0x43')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index c550220..9b5df77 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72f5=['moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','interaction','[%s][CLOSE]\x20%s','stringify','finally','stop','error'];(function(_0x530850,_0x14c4fa){var _0x1fce4d=function(_0x1bbcf7){while(--_0x1bbcf7){_0x530850['push'](_0x530850['shift']());}};_0x1fce4d(++_0x14c4fa);}(_0x72f5,0x143));var _0x572f=function(_0xd6b000,_0x52bb24){_0xd6b000=_0xd6b000-0x0;var _0x99473d=_0x72f5[_0xd6b000];return _0x99473d;};'use strict';var moment=require(_0x572f('0x0'));var logger=require('../../../../config/logger')(_0x572f('0x1'));var rpc={'chatInteraction':require(_0x572f('0x2')),'openchannelInteraction':require(_0x572f('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x572f('0x4')),'faxInteraction':require(_0x572f('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x572f('0x6')]=function(_0x5901bd,_0x27c198,_0x5ac947,_0x5eea46){return function(_0x2c73d7){try{logger[_0x572f('0x7')](_0x572f('0x8'),_0x5901bd,_0x27c198[0x0]);var _0x1b1128={'closed':0x1,'closedAt':moment()[_0x572f('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x572f('0xa'),'disposition':_0x27c198[0x0]};if(rpc[_0x5eea46[_0x572f('0xb')]+_0x572f('0xc')]){rpc[_0x5eea46[_0x572f('0xb')]+'Interaction']['update'](_0x5eea46[_0x572f('0xd')]['id'],_0x1b1128)['then'](function(_0x58bb92){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5901bd,_0x5eea46['interaction']['id']);})['catch'](function(_0x40762f){logger['error'](_0x572f('0xe'),_0x5901bd,JSON[_0x572f('0xf')](_0x40762f));})[_0x572f('0x10')](function(){_0x2c73d7[_0x572f('0x11')]();});}}catch(_0x357f17){logger[_0x572f('0x12')](_0x572f('0xe'),_0x5901bd,JSON['stringify'](_0x357f17));_0x2c73d7['stop']();}};}; \ No newline at end of file +var _0x458f=['channel','Interaction','update','interaction','then','info','catch','error','[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','routing','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x458f,0x1af));var _0xf458=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x458f[_0x57b54c];return _0x59cc19;};'use strict';var moment=require('moment');var logger=require(_0xf458('0x0'))(_0xf458('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xf458('0x2')),'mailInteraction':require(_0xf458('0x3')),'faxInteraction':require(_0xf458('0x4')),'whatsappInteraction':require(_0xf458('0x5'))};exports[_0xf458('0x6')]=function(_0x541199,_0x49e23d,_0x4e5cdb,_0x33a0d9){return function(_0x10423f){try{logger['info'](_0xf458('0x7'),_0x541199,_0x49e23d[0x0]);var _0x3a4bcb={'closed':0x1,'closedAt':moment()[_0xf458('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x49e23d[0x0]};if(rpc[_0x33a0d9[_0xf458('0x9')]+'Interaction']){rpc[_0x33a0d9['channel']+_0xf458('0xa')][_0xf458('0xb')](_0x33a0d9[_0xf458('0xc')]['id'],_0x3a4bcb)[_0xf458('0xd')](function(_0x1588ac){logger[_0xf458('0xe')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x541199,_0x33a0d9[_0xf458('0xc')]['id']);})[_0xf458('0xf')](function(_0xfd5939){logger['error']('[%s][CLOSE]\x20%s',_0x541199,JSON['stringify'](_0xfd5939));})['finally'](function(){_0x10423f['stop']();});}}catch(_0x3b339b){logger[_0xf458('0x10')](_0xf458('0x11'),_0x541199,JSON[_0xf458('0x12')](_0x3b339b));_0x10423f[_0xf458('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 4b83ff0..5f0c230 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad68=['isEmpty','body','getMustacheRender','create','then','info','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','providerName','providerResponse','Message','result','metadata','endConversation','next','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created'];(function(_0x22cb01,_0x1a5986){var _0x22c660=function(_0x17323e){while(--_0x17323e){_0x22cb01['push'](_0x22cb01['shift']());}};_0x22c660(++_0x1a5986);}(_0xad68,0x100));var _0x8ad6=function(_0x445b7e,_0x3ea85f){_0x445b7e=_0x445b7e-0x0;var _0x17d997=_0xad68[_0x445b7e];return _0x17d997;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x8ad6('0x0'));var md5=require(_0x8ad6('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x8ad6('0x2'));var rpc={'chatMessage':require(_0x8ad6('0x3')),'openchannelMessage':require(_0x8ad6('0x4')),'mailMessage':require(_0x8ad6('0x5')),'smsMessage':require(_0x8ad6('0x6')),'faxMessage':require(_0x8ad6('0x7')),'whatsappMessage':require(_0x8ad6('0x8'))};exports['consequence']=function(_0x144a85,_0x1ca47f){return function(_0x3e009f){try{if(!_[_0x8ad6('0x9')](this[_0x8ad6('0xa')]['UserId'])){logger['info'](_0x8ad6('0xb'),_0x144a85,_0x8ad6('0xc'));return _0x3e009f['next']();}var _0x4b5b88={'ContactId':this[_0x8ad6('0xd')]['id'],'sentAt':moment()[_0x8ad6('0xe')](_0x8ad6('0xf')),'direction':_0x8ad6('0x10')};if(this[_0x8ad6('0x11')]===_0x8ad6('0x12')||this[_0x8ad6('0x11')]===_0x8ad6('0x13')){_0x4b5b88['phone']=this[_0x8ad6('0xa')]['phone'];}var _0x5de67c=this[_0x8ad6('0x11')];if(_0x5de67c==='chat'){_0x4b5b88[_0x8ad6('0x14')]=this['account']['id'];}else{_0x4b5b88[_[_0x8ad6('0x15')](_0x5de67c)+_0x8ad6('0x16')]=this[_0x8ad6('0x17')]['id'];}_0x4b5b88[_['upperFirst'](_0x5de67c)+_0x8ad6('0x18')]=this[_0x8ad6('0xa')]['id'];if(this[_0x8ad6('0xa')][_0x8ad6('0x19')]){var _0x10a21c=_0x1ca47f[0x2];if(!_[_0x8ad6('0x1a')](_0x10a21c)){_0x4b5b88[_0x8ad6('0x1b')]=utils[_0x8ad6('0x1c')](_0x10a21c,this);return rpc[_0x5de67c+'Message'][_0x8ad6('0x1d')](_0x4b5b88)[_0x8ad6('0x1e')](function(_0x29e6a6){logger[_0x8ad6('0x1f')](_0x8ad6('0xb'),_0x144a85,_0x4b5b88[_0x8ad6('0x1b')]);})[_0x8ad6('0x20')](function(_0x58a393){logger[_0x8ad6('0x21')](_0x8ad6('0xb'),_0x144a85,JSON[_0x8ad6('0x22')](_0x58a393));})['finally'](function(){logger[_0x8ad6('0x1f')](_0x8ad6('0x23'),_0x144a85);_0x3e009f[_0x8ad6('0x24')]();});}else{logger[_0x8ad6('0x1f')](_0x8ad6('0x25'),_0x144a85);_0x3e009f[_0x8ad6('0x24')]();}}else{var _0x42f18b=this;var _0x5edc1=apiai(_0x1ca47f[0x0],{'language':_0x1ca47f[0x1]||'en'});return _0x5edc1[_0x8ad6('0x26')](this['message']['body'],{'sessionId':md5(this[_0x8ad6('0xa')]['id'])})[_0x8ad6('0x1e')](function(_0x558430){_0x42f18b[_0x8ad6('0x1b')][_0x8ad6('0x27')]=_0x558430;_0x4b5b88[_0x8ad6('0x1b')]=_0x558430['result']['fulfillment']['speech'];_0x4b5b88[_0x8ad6('0x28')]=_0x8ad6('0x27');_0x4b5b88[_0x8ad6('0x29')]=JSON[_0x8ad6('0x22')](_0x558430);return rpc[_0x5de67c+_0x8ad6('0x2a')][_0x8ad6('0x1d')](_0x4b5b88)[_0x8ad6('0x1e')](function(_0x3a6151){logger[_0x8ad6('0x1f')](_0x8ad6('0xb'),_0x144a85,_0x4b5b88[_0x8ad6('0x1b')]);if(_0x558430[_0x8ad6('0x2b')][_0x8ad6('0x2c')][_0x8ad6('0x2d')]){_0x3e009f[_0x8ad6('0x2e')]();}else{_0x3e009f[_0x8ad6('0x24')]();}})[_0x8ad6('0x20')](function(_0x3c2092){logger[_0x8ad6('0x21')](_0x8ad6('0xb'),_0x144a85,JSON['stringify'](_0x3c2092));_0x3e009f[_0x8ad6('0x2e')]();});})[_0x8ad6('0x20')](function(_0x105d07){logger['error'](_0x8ad6('0xb'),_0x144a85,_0x105d07['message']);_0x3e009f['next']();});}}catch(_0x56e99d){logger[_0x8ad6('0x21')](_0x8ad6('0xb'),_0x144a85,JSON['stringify'](_0x56e99d));_0x3e009f[_0x8ad6('0x24')]();}};}; \ No newline at end of file +var _0x02b6=['[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','then','dialogflow','fulfillment','speech','providerResponse','result','metadata','endConversation','error','stringify','lodash','apiai-promise','md5','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','sms','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','catch','finally'];(function(_0x1e42c1,_0x7b343e){var _0x1125b4=function(_0x504839){while(--_0x504839){_0x1e42c1['push'](_0x1e42c1['shift']());}};_0x1125b4(++_0x7b343e);}(_0x02b6,0xfe));var _0x602b=function(_0x475cdf,_0x15055b){_0x475cdf=_0x475cdf-0x0;var _0x377a07=_0x02b6[_0x475cdf];return _0x377a07;};'use strict';var _=require(_0x602b('0x0'));var moment=require('moment');var apiai=require(_0x602b('0x1'));var md5=require(_0x602b('0x2'));var utils=require(_0x602b('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x602b('0x4')),'openchannelMessage':require(_0x602b('0x5')),'mailMessage':require(_0x602b('0x6')),'smsMessage':require(_0x602b('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x602b('0x8'))};exports['consequence']=function(_0x265e3b,_0xac6c85){return function(_0x140c8a){try{if(!_[_0x602b('0x9')](this[_0x602b('0xa')][_0x602b('0xb')])){logger[_0x602b('0xc')](_0x602b('0xd'),_0x265e3b,_0x602b('0xe'));return _0x140c8a[_0x602b('0xf')]();}var _0x4fb0a2={'ContactId':this[_0x602b('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x602b('0x11')};if(this['channel']===_0x602b('0x12')||this[_0x602b('0x13')]==='whatsapp'){_0x4fb0a2[_0x602b('0x14')]=this[_0x602b('0xa')][_0x602b('0x14')];}var _0x56a4d3=this[_0x602b('0x13')];if(_0x56a4d3===_0x602b('0x15')){_0x4fb0a2[_0x602b('0x16')]=this[_0x602b('0x17')]['id'];}else{_0x4fb0a2[_[_0x602b('0x18')](_0x56a4d3)+_0x602b('0x19')]=this[_0x602b('0x17')]['id'];}_0x4fb0a2[_['upperFirst'](_0x56a4d3)+'InteractionId']=this[_0x602b('0xa')]['id'];if(this[_0x602b('0xa')][_0x602b('0x1a')]){var _0x18abb6=_0xac6c85[0x2];if(!_[_0x602b('0x1b')](_0x18abb6)){_0x4fb0a2[_0x602b('0x1c')]=utils[_0x602b('0x1d')](_0x18abb6,this);return rpc[_0x56a4d3+_0x602b('0x1e')][_0x602b('0x1f')](_0x4fb0a2)['then'](function(_0x48d992){logger[_0x602b('0xc')](_0x602b('0xd'),_0x265e3b,_0x4fb0a2['body']);})[_0x602b('0x20')](function(_0x581a3b){logger['error'](_0x602b('0xd'),_0x265e3b,JSON['stringify'](_0x581a3b));})[_0x602b('0x21')](function(){logger['info'](_0x602b('0x22'),_0x265e3b);_0x140c8a[_0x602b('0x23')]();});}else{logger[_0x602b('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x265e3b);_0x140c8a[_0x602b('0x23')]();}}else{var _0x1264c8=this;var _0x580b66=apiai(_0xac6c85[0x0],{'language':_0xac6c85[0x1]||'en'});return _0x580b66[_0x602b('0x24')](this[_0x602b('0x25')][_0x602b('0x1c')],{'sessionId':md5(this[_0x602b('0xa')]['id'])})[_0x602b('0x26')](function(_0xb3beff){_0x1264c8[_0x602b('0x1c')][_0x602b('0x27')]=_0xb3beff;_0x4fb0a2[_0x602b('0x1c')]=_0xb3beff['result'][_0x602b('0x28')][_0x602b('0x29')];_0x4fb0a2['providerName']=_0x602b('0x27');_0x4fb0a2[_0x602b('0x2a')]=JSON['stringify'](_0xb3beff);return rpc[_0x56a4d3+_0x602b('0x1e')][_0x602b('0x1f')](_0x4fb0a2)[_0x602b('0x26')](function(_0x2bb5b7){logger[_0x602b('0xc')](_0x602b('0xd'),_0x265e3b,_0x4fb0a2[_0x602b('0x1c')]);if(_0xb3beff[_0x602b('0x2b')][_0x602b('0x2c')][_0x602b('0x2d')]){_0x140c8a[_0x602b('0xf')]();}else{_0x140c8a['stop']();}})[_0x602b('0x20')](function(_0x582ccc){logger[_0x602b('0x2e')](_0x602b('0xd'),_0x265e3b,JSON[_0x602b('0x2f')](_0x582ccc));_0x140c8a[_0x602b('0xf')]();});})[_0x602b('0x20')](function(_0x3647cf){logger[_0x602b('0x2e')](_0x602b('0xd'),_0x265e3b,_0x3647cf[_0x602b('0x25')]);_0x140c8a[_0x602b('0xf')]();});}}catch(_0x407f54){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x265e3b,JSON[_0x602b('0x2f')](_0x407f54));_0x140c8a[_0x602b('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index aa957d8..0516c70 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5dbc=['DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','lodash','md5','moment','bluebird','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','isNil','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','error','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','allRequiredParamsPresent'];(function(_0x2564c8,_0x1a190c){var _0x491021=function(_0x158930){while(--_0x158930){_0x2564c8['push'](_0x2564c8['shift']());}};_0x491021(++_0x1a190c);}(_0x5dbc,0x16a));var _0xc5db=function(_0x30100f,_0x14c047){_0x30100f=_0x30100f-0x0;var _0x23812f=_0x5dbc[_0x30100f];return _0x23812f;};'use strict';var _=require(_0xc5db('0x0'));var dialogflow=require('dialogflow');var md5=require(_0xc5db('0x1'));var moment=require(_0xc5db('0x2'));var Promise=require(_0xc5db('0x3'));var logger=require(_0xc5db('0x4'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0xc5db('0x5')),'openchannelMessage':require(_0xc5db('0x6')),'mailMessage':require(_0xc5db('0x7')),'smsMessage':require(_0xc5db('0x8')),'faxMessage':require(_0xc5db('0x9')),'whatsappMessage':require(_0xc5db('0xa'))};function createMessage(_0x5965d3,_0x309497,_0xc3ae63,_0x489c81){return new Promise(function(_0x4bbfcb,_0x466bf1){var _0x3b2d49=_[_0xc5db('0xb')](_0xc3ae63);_0x3b2d49[_0xc5db('0xc')]=_0x489c81;return rpc[_0x309497+_0xc5db('0xd')][_0xc5db('0xe')](_0x3b2d49)[_0xc5db('0xf')](function(){logger[_0xc5db('0x10')](_0xc5db('0x11'),_0x5965d3,_0x3b2d49['body']);_0x4bbfcb();})[_0xc5db('0x12')](function(_0x46983a){logger['error'](_0xc5db('0x11'),_0x5965d3,JSON[_0xc5db('0x13')](_0x46983a));_0x466bf1(_0x46983a);});});}exports[_0xc5db('0x14')]=function(_0x4c4876,_0x465927){return function(_0x538477){try{if(!_[_0xc5db('0x15')](this['interaction']['UserId'])){logger[_0xc5db('0x10')](_0xc5db('0x11'),_0x4c4876,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x538477[_0xc5db('0x16')]();}var _0x4810c0={'ContactId':this[_0xc5db('0x17')]['id'],'sentAt':moment()['format'](_0xc5db('0x18')),'direction':'out'};if(this[_0xc5db('0x19')]==='sms'||this['channel']===_0xc5db('0x1a')){_0x4810c0[_0xc5db('0x1b')]=this[_0xc5db('0x1c')][_0xc5db('0x1b')];}var _0x385997=this['channel'];if(_0x385997===_0xc5db('0x1d')){_0x4810c0[_0xc5db('0x1e')]=this[_0xc5db('0x1f')]['id'];}else{_0x4810c0[_['upperFirst'](_0x385997)+_0xc5db('0x20')]=this[_0xc5db('0x1f')]['id'];}_0x4810c0[_[_0xc5db('0x21')](_0x385997)+_0xc5db('0x22')]=this[_0xc5db('0x1c')]['id'];if(this[_0xc5db('0x1c')][_0xc5db('0x23')]){var _0x332de3=_0x465927[0x4];if(!_[_0xc5db('0x24')](_0x332de3)){_0x4810c0[_0xc5db('0xc')]=utils['getMustacheRender'](_0x332de3,this);return rpc[_0x385997+'Message']['create'](_0x4810c0)['then'](function(_0x39996e){logger[_0xc5db('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x4c4876,_0x4810c0[_0xc5db('0xc')]);})[_0xc5db('0x12')](function(_0x26b508){logger[_0xc5db('0x25')](_0xc5db('0x11'),_0x4c4876,JSON[_0xc5db('0x13')](_0x26b508));})['finally'](function(){logger[_0xc5db('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4c4876);_0x538477[_0xc5db('0x26')]();});}else{logger[_0xc5db('0x10')](_0xc5db('0x27'),_0x4c4876);_0x538477[_0xc5db('0x26')]();}}else{var _0x17f6f6=this;var _0xeaec0d=_0x465927[0x2][_0xc5db('0x28')](/\\n/g,'\x0a');var _0x21dfe2={'credentials':{'private_key':_0xeaec0d,'client_email':_0x465927[0x1]}};var _0x5c58de=new dialogflow['SessionsClient'](_0x21dfe2);var _0x473ca2=_0x5c58de[_0xc5db('0x29')](_0x465927[0x0],md5(_0x17f6f6[_0xc5db('0x1c')]['id']));var _0x4a050d={'session':_0x473ca2,'queryInput':{'text':{'text':_0x17f6f6[_0xc5db('0x2a')]['body'],'languageCode':_0x465927[0x3]||'en'}}};return _0x5c58de[_0xc5db('0x2b')](_0x4a050d)[_0xc5db('0xf')](function(_0x2bcf34){if(_0x2bcf34&&_0x2bcf34[_0xc5db('0x2c')]){_0x17f6f6['body'][_0xc5db('0x2d')]=_0x2bcf34;var _0x228578=_0x2bcf34[0x0];var _0x51acb9=_0x228578[_0xc5db('0x2e')][_0xc5db('0x2f')]&&_0x228578[_0xc5db('0x2e')][_0xc5db('0x2f')][_0xc5db('0x30')]?_0x228578[_0xc5db('0x2e')]['diagnosticInfo']['fields'][_0xc5db('0x31')][_0xc5db('0x32')]:![];_0x17f6f6['body']['DIALOGFLOWV2_ACTION']=_0x228578['queryResult']['action'];_0x17f6f6['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x228578[_0xc5db('0x2e')][_0xc5db('0x33')];_0x17f6f6[_0xc5db('0xc')][_0xc5db('0x34')]=_0x228578['queryResult'][_0xc5db('0x2f')]&&_0x228578[_0xc5db('0x2e')]['diagnosticInfo'][_0xc5db('0x30')]?_0x228578[_0xc5db('0x2e')][_0xc5db('0x2f')]['fields'][_0xc5db('0x31')][_0xc5db('0x32')]:![];_0x17f6f6[_0xc5db('0xc')][_0xc5db('0x35')]=_0x228578[_0xc5db('0x2e')][_0xc5db('0x36')][_0xc5db('0x37')];_0x17f6f6[_0xc5db('0xc')][_0xc5db('0x38')]=_0x228578[_0xc5db('0x2e')][_0xc5db('0x36')][_0xc5db('0x39')];_0x17f6f6['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x228578[_0xc5db('0x2e')][_0xc5db('0x36')][_0xc5db('0x3a')];_0x17f6f6[_0xc5db('0xc')][_0xc5db('0x3b')]=_0x228578[_0xc5db('0x2e')][_0xc5db('0x3c')];_0x17f6f6['body'][_0xc5db('0x3d')]=_0x228578[_0xc5db('0x2e')][_0xc5db('0x3e')];_0x17f6f6[_0xc5db('0xc')]['DIALOGFLOWV2_SCORE']=_0x228578[_0xc5db('0x2e')][_0xc5db('0x3f')];_0x4810c0[_0xc5db('0x40')]=_0xc5db('0x2d');_0x4810c0[_0xc5db('0x41')]=JSON['stringify'](_0x2bcf34);var _0x338260=[];for(var _0x45c086=0x0;_0x45c086<_0x2bcf34['length'];_0x45c086++){var _0x317ad0=_0x2bcf34[_0x45c086];if(_0x317ad0&&_0x317ad0[_0xc5db('0x2e')]&&_0x317ad0[_0xc5db('0x2e')][_0xc5db('0x42')]){_0x338260[_0xc5db('0x43')](createMessage(_0x4c4876,_0x385997,_0x4810c0,_0x317ad0[_0xc5db('0x2e')]['fulfillmentText']));}}return Promise[_0xc5db('0x44')](_0x338260)[_0xc5db('0xf')](function(){if(_0x51acb9){_0x538477['next']();}else{_0x538477[_0xc5db('0x26')]();}})[_0xc5db('0x12')](function(_0x58df21){logger[_0xc5db('0x25')]('[%s][DIALOGFLOWV2]\x20%s',_0x4c4876,JSON[_0xc5db('0x13')](_0x58df21));_0x538477[_0xc5db('0x16')]();});}})[_0xc5db('0x12')](function(_0x3e2441){logger[_0xc5db('0x25')](_0xc5db('0x11'),_0x4c4876,_0x3e2441['message']);_0x538477[_0xc5db('0x16')]();});}}catch(_0x6dba37){logger[_0xc5db('0x25')](_0xc5db('0x11'),_0x4c4876,JSON[_0xc5db('0x13')](_0x6dba37));_0x538477[_0xc5db('0x26')]();}};}; \ No newline at end of file +var _0x4588=['DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','then','catch','finally','stop','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','fields','diagnosticInfo','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name'];(function(_0x3af146,_0x4cf39c){var _0x360a9b=function(_0x3d1eec){while(--_0x3d1eec){_0x3af146['push'](_0x3af146['shift']());}};_0x360a9b(++_0x4cf39c);}(_0x4588,0x179));var _0x8458=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0x4588[_0x609988];return _0x159984;};'use strict';var _=require(_0x8458('0x0'));var dialogflow=require(_0x8458('0x1'));var md5=require(_0x8458('0x2'));var moment=require(_0x8458('0x3'));var Promise=require('bluebird');var logger=require(_0x8458('0x4'))(_0x8458('0x5'));var utils=require(_0x8458('0x6'));var rpc={'chatMessage':require(_0x8458('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8458('0x8')),'whatsappMessage':require(_0x8458('0x9'))};function createMessage(_0xcb6374,_0x39e192,_0x3ac34a,_0x5cda6e){return new Promise(function(_0x4621e5,_0x3812aa){var _0x346b61=_[_0x8458('0xa')](_0x3ac34a);_0x346b61[_0x8458('0xb')]=_0x5cda6e;return rpc[_0x39e192+_0x8458('0xc')][_0x8458('0xd')](_0x346b61)['then'](function(){logger[_0x8458('0xe')](_0x8458('0xf'),_0xcb6374,_0x346b61[_0x8458('0xb')]);_0x4621e5();})['catch'](function(_0xcd2184){logger[_0x8458('0x10')](_0x8458('0xf'),_0xcb6374,JSON[_0x8458('0x11')](_0xcd2184));_0x3812aa(_0xcd2184);});});}exports[_0x8458('0x12')]=function(_0x31286f,_0x3a74c8){return function(_0x4d6d6b){try{if(!_[_0x8458('0x13')](this[_0x8458('0x14')][_0x8458('0x15')])){logger[_0x8458('0xe')](_0x8458('0xf'),_0x31286f,_0x8458('0x16'));return _0x4d6d6b[_0x8458('0x17')]();}var _0x2868fa={'ContactId':this[_0x8458('0x18')]['id'],'sentAt':moment()[_0x8458('0x19')](_0x8458('0x1a')),'direction':_0x8458('0x1b')};if(this[_0x8458('0x1c')]==='sms'||this[_0x8458('0x1c')]===_0x8458('0x1d')){_0x2868fa[_0x8458('0x1e')]=this[_0x8458('0x14')]['phone'];}var _0x50b3fb=this[_0x8458('0x1c')];if(_0x50b3fb===_0x8458('0x1f')){_0x2868fa[_0x8458('0x20')]=this[_0x8458('0x21')]['id'];}else{_0x2868fa[_[_0x8458('0x22')](_0x50b3fb)+_0x8458('0x23')]=this[_0x8458('0x21')]['id'];}_0x2868fa[_[_0x8458('0x22')](_0x50b3fb)+_0x8458('0x24')]=this[_0x8458('0x14')]['id'];if(this[_0x8458('0x14')][_0x8458('0x25')]){var _0x27b25d=_0x3a74c8[0x4];if(!_[_0x8458('0x26')](_0x27b25d)){_0x2868fa[_0x8458('0xb')]=utils[_0x8458('0x27')](_0x27b25d,this);return rpc[_0x50b3fb+'Message'][_0x8458('0xd')](_0x2868fa)[_0x8458('0x28')](function(_0x13e915){logger[_0x8458('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x31286f,_0x2868fa['body']);})[_0x8458('0x29')](function(_0x186d09){logger[_0x8458('0x10')](_0x8458('0xf'),_0x31286f,JSON[_0x8458('0x11')](_0x186d09));})[_0x8458('0x2a')](function(){logger[_0x8458('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x31286f);_0x4d6d6b[_0x8458('0x2b')]();});}else{logger[_0x8458('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x31286f);_0x4d6d6b[_0x8458('0x2b')]();}}else{var _0x2baddd=this;var _0x294154=_0x3a74c8[0x2][_0x8458('0x2c')](/\\n/g,'\x0a');var _0x2beb65={'credentials':{'private_key':_0x294154,'client_email':_0x3a74c8[0x1]}};var _0x21807e=new dialogflow['SessionsClient'](_0x2beb65);var _0x37a34c=_0x21807e[_0x8458('0x2d')](_0x3a74c8[0x0],md5(_0x2baddd[_0x8458('0x14')]['id']));var _0x2b19a={'session':_0x37a34c,'queryInput':{'text':{'text':_0x2baddd[_0x8458('0x2e')]['body'],'languageCode':_0x3a74c8[0x3]||'en'}}};return _0x21807e[_0x8458('0x2f')](_0x2b19a)[_0x8458('0x28')](function(_0x457abd){if(_0x457abd&&_0x457abd[_0x8458('0x30')]){_0x2baddd['body'][_0x8458('0x31')]=_0x457abd;var _0x259fa5=_0x457abd[0x0];var _0x496a48=_0x259fa5[_0x8458('0x32')]['diagnosticInfo']&&_0x259fa5[_0x8458('0x32')]['diagnosticInfo'][_0x8458('0x33')]?_0x259fa5[_0x8458('0x32')][_0x8458('0x34')]['fields']['end_conversation'][_0x8458('0x35')]:![];_0x2baddd[_0x8458('0xb')][_0x8458('0x36')]=_0x259fa5[_0x8458('0x32')][_0x8458('0x37')];_0x2baddd[_0x8458('0xb')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x259fa5['queryResult'][_0x8458('0x38')];_0x2baddd['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x259fa5[_0x8458('0x32')][_0x8458('0x34')]&&_0x259fa5['queryResult']['diagnosticInfo'][_0x8458('0x33')]?_0x259fa5['queryResult'][_0x8458('0x34')][_0x8458('0x33')][_0x8458('0x39')][_0x8458('0x35')]:![];_0x2baddd[_0x8458('0xb')][_0x8458('0x3a')]=_0x259fa5[_0x8458('0x32')][_0x8458('0x3b')][_0x8458('0x3c')];_0x2baddd[_0x8458('0xb')][_0x8458('0x3d')]=_0x259fa5[_0x8458('0x32')][_0x8458('0x3b')][_0x8458('0x3e')];_0x2baddd[_0x8458('0xb')][_0x8458('0x3f')]=_0x259fa5[_0x8458('0x32')]['intent']['isFallback'];_0x2baddd['body'][_0x8458('0x40')]=_0x259fa5['queryResult'][_0x8458('0x41')];_0x2baddd['body']['DIALOGFLOWV2_QUERYTEXT']=_0x259fa5['queryResult'][_0x8458('0x42')];_0x2baddd['body'][_0x8458('0x43')]=_0x259fa5[_0x8458('0x32')][_0x8458('0x44')];_0x2868fa[_0x8458('0x45')]=_0x8458('0x31');_0x2868fa[_0x8458('0x46')]=JSON[_0x8458('0x11')](_0x457abd);var _0x27090a=[];for(var _0x1a4f9e=0x0;_0x1a4f9e<_0x457abd[_0x8458('0x30')];_0x1a4f9e++){var _0x1642b6=_0x457abd[_0x1a4f9e];if(_0x1642b6&&_0x1642b6['queryResult']&&_0x1642b6[_0x8458('0x32')][_0x8458('0x47')]){_0x27090a[_0x8458('0x48')](createMessage(_0x31286f,_0x50b3fb,_0x2868fa,_0x1642b6[_0x8458('0x32')]['fulfillmentText']));}}return Promise['all'](_0x27090a)['then'](function(){if(_0x496a48){_0x4d6d6b[_0x8458('0x17')]();}else{_0x4d6d6b[_0x8458('0x2b')]();}})[_0x8458('0x29')](function(_0xdf1a76){logger['error'](_0x8458('0xf'),_0x31286f,JSON[_0x8458('0x11')](_0xdf1a76));_0x4d6d6b[_0x8458('0x17')]();});}})[_0x8458('0x29')](function(_0x49b921){logger[_0x8458('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x31286f,_0x49b921[_0x8458('0x2e')]);_0x4d6d6b[_0x8458('0x17')]();});}}catch(_0x38ae9c){logger[_0x8458('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x31286f,JSON[_0x8458('0x11')](_0x38ae9c));_0x4d6d6b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 3f305d4..2b4fe72 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5460=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','number','consequence','fromString','length','join','stop','condition','priorityTrue','info','next','findIndex','rules'];(function(_0x36f6eb,_0x3a6d09){var _0x3e0c92=function(_0x846798){while(--_0x846798){_0x36f6eb['push'](_0x36f6eb['shift']());}};_0x3e0c92(++_0x3a6d09);}(_0x5460,0x1b6));var _0x0546=function(_0x4cefdf,_0x34f6d2){_0x4cefdf=_0x4cefdf-0x0;var _0x78fc66=_0x5460[_0x4cefdf];return _0x78fc66;};'use strict';var schema=require(_0x0546('0x0'));var _=require(_0x0546('0x1'));var htmlToText=require(_0x0546('0x2'));var utils=require('./utils');var logger=require(_0x0546('0x3'))(_0x0546('0x4'));var gotoif=schema({'condition':{'type':_0x0546('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x0546('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x0546('0x7')]=function(_0x56b5fb,_0x2abd81){return function(_0x88d21f){try{var _0x4cbb3a={'condition':htmlToText[_0x0546('0x8')](utils['getMustacheRender'](_0x2abd81[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2abd81[0x1],'priorityFalse':_0x2abd81[0x2]};var _0x24fe68=gotoif[_0x0546('0x0')](_0x4cbb3a,{'typecast':!![]});if(_0x24fe68[_0x0546('0x9')]){logger['error']('[%s][GOTOIF]\x20%s',_0x56b5fb,_['map'](_0x24fe68,'message')[_0x0546('0xa')](',\x20'));_0x88d21f[_0x0546('0xb')]();}else{try{var _0x3f3857=eval('('+_0x4cbb3a[_0x0546('0xc')]+')');var _0x443bd1=_0x3f3857?_0x4cbb3a[_0x0546('0xd')]:_0x4cbb3a['priorityFalse'];logger[_0x0546('0xe')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x56b5fb,_0x4cbb3a[_0x0546('0xc')],_0x3f3857,_0x443bd1||_0x0546('0xf'));if(_0x443bd1){var _0x40d21e=_[_0x0546('0x10')](_0x88d21f[_0x0546('0x11')](),{'p':_0x443bd1});if(_0x40d21e>=0x0){logger[_0x0546('0xe')](_0x0546('0x12'),_0x56b5fb,_0x443bd1||_0x0546('0xf'),_0x40d21e);_0x88d21f['next'](_0x40d21e);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x56b5fb,_0x443bd1||_0x0546('0xf'));_0x88d21f[_0x0546('0xb')]();}}else{_0x88d21f[_0x0546('0xf')]();}}catch(_0x1adfe7){logger[_0x0546('0x13')](_0x0546('0x14'),_0x56b5fb,_0x1adfe7[_0x0546('0x15')]);_0x88d21f[_0x0546('0xb')]();}}}catch(_0x124467){logger[_0x0546('0x13')](_0x0546('0x16'),_0x56b5fb,JSON[_0x0546('0x17')](_0x124467));_0x88d21f[_0x0546('0xb')]();}};}; \ No newline at end of file +var _0x4575=['map','message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','validate','error'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x4575,0x14e));var _0x5457=function(_0x188832,_0x49101d){_0x188832=_0x188832-0x0;var _0x2b990f=_0x4575[_0x188832];return _0x2b990f;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x5457('0x0'));var utils=require(_0x5457('0x1'));var logger=require(_0x5457('0x2'))(_0x5457('0x3'));var gotoif=schema({'condition':{'type':_0x5457('0x4'),'required':!![],'message':_0x5457('0x5')},'priorityTrue':{'type':_0x5457('0x6'),'message':_0x5457('0x7')},'priorityFalse':{'type':_0x5457('0x6'),'message':_0x5457('0x8')}});exports['consequence']=function(_0x9abbe2,_0x198f4f){return function(_0x12c295){try{var _0x1968a0={'condition':htmlToText[_0x5457('0x9')](utils[_0x5457('0xa')](_0x198f4f[0x0],this),{'wordwrap':![]})[_0x5457('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x198f4f[0x1],'priorityFalse':_0x198f4f[0x2]};var _0x561f72=gotoif[_0x5457('0xc')](_0x1968a0,{'typecast':!![]});if(_0x561f72['length']){logger[_0x5457('0xd')]('[%s][GOTOIF]\x20%s',_0x9abbe2,_[_0x5457('0xe')](_0x561f72,_0x5457('0xf'))[_0x5457('0x10')](',\x20'));_0x12c295[_0x5457('0x11')]();}else{try{var _0x4d8f5b=eval('('+_0x1968a0['condition']+')');var _0x3bf97d=_0x4d8f5b?_0x1968a0[_0x5457('0x12')]:_0x1968a0[_0x5457('0x13')];logger[_0x5457('0x14')](_0x5457('0x15'),_0x9abbe2,_0x1968a0[_0x5457('0x16')],_0x4d8f5b,_0x3bf97d||_0x5457('0x17'));if(_0x3bf97d){var _0x3de257=_[_0x5457('0x18')](_0x12c295[_0x5457('0x19')](),{'p':_0x3bf97d});if(_0x3de257>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x9abbe2,_0x3bf97d||_0x5457('0x17'),_0x3de257);_0x12c295[_0x5457('0x17')](_0x3de257);}else{logger[_0x5457('0x14')](_0x5457('0x1a'),_0x9abbe2,_0x3bf97d||_0x5457('0x17'));_0x12c295[_0x5457('0x11')]();}}else{_0x12c295[_0x5457('0x17')]();}}catch(_0x57436d){logger[_0x5457('0xd')](_0x5457('0x1b'),_0x9abbe2,_0x57436d[_0x5457('0xf')]);_0x12c295[_0x5457('0x11')]();}}}catch(_0x45325c){logger[_0x5457('0xd')](_0x5457('0x1c'),_0x9abbe2,JSON['stringify'](_0x45325c));_0x12c295[_0x5457('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 0361c0f..a2e17e8 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 _0x0b64=['map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x0b64,0x173));var _0x40b6=function(_0x3e228a,_0x2ded29){_0x3e228a=_0x3e228a-0x0;var _0x5647b0=_0x0b64[_0x3e228a];return _0x5647b0;};'use strict';var schema=require('validate');var _=require(_0x40b6('0x0'));var logger=require('../../../../config/logger')(_0x40b6('0x1'));var gotop=schema({'priority':{'type':_0x40b6('0x2'),'required':!![],'message':_0x40b6('0x3')}});exports[_0x40b6('0x4')]=function(_0x5dc24c,_0x86b600){return function(_0x58bd50){try{var _0x21097a={'priority':_0x86b600[0x0]};var _0x1b64fc=gotop[_0x40b6('0x5')](_0x21097a,{'typecast':!![]});if(_0x1b64fc[_0x40b6('0x6')]){logger[_0x40b6('0x7')](_0x40b6('0x8'),_0x5dc24c,_[_0x40b6('0x9')](_0x1b64fc,_0x40b6('0xa'))[_0x40b6('0xb')](',\x20'));_0x58bd50[_0x40b6('0xc')]();}else{logger[_0x40b6('0xd')](_0x40b6('0xe'),_0x5dc24c,_0x21097a[_0x40b6('0xf')]);if(_0x21097a['priority']){var _0x3f1a57=_[_0x40b6('0x10')](_0x58bd50[_0x40b6('0x11')](),{'p':_0x21097a[_0x40b6('0xf')]});if(_0x3f1a57>=0x0){logger[_0x40b6('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5dc24c,_0x21097a['priority']||_0x40b6('0x12'),_0x3f1a57);_0x58bd50[_0x40b6('0x12')](_0x3f1a57);}else{logger[_0x40b6('0xd')](_0x40b6('0x13'),_0x5dc24c,_0x21097a[_0x40b6('0xf')]||'next');_0x58bd50[_0x40b6('0xc')]();}}else{_0x58bd50[_0x40b6('0x12')]();}}}catch(_0x5493d2){logger[_0x40b6('0x7')]('[%s][GOTOP]\x20%s',_0x5dc24c,JSON['stringify'](_0x5493d2));_0x58bd50[_0x40b6('0xc')]();}};}; \ No newline at end of file +var _0xa78e=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa78e,0x145));var _0xea78=function(_0x40626c,_0x1d050f){_0x40626c=_0x40626c-0x0;var _0xf9c0fd=_0xa78e[_0x40626c];return _0xf9c0fd;};'use strict';var schema=require(_0xea78('0x0'));var _=require(_0xea78('0x1'));var logger=require(_0xea78('0x2'))(_0xea78('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xea78('0x4')}});exports[_0xea78('0x5')]=function(_0x1e6bf8,_0x14c9ad){return function(_0x381338){try{var _0x5d74b={'priority':_0x14c9ad[0x0]};var _0x275abe=gotop[_0xea78('0x0')](_0x5d74b,{'typecast':!![]});if(_0x275abe[_0xea78('0x6')]){logger[_0xea78('0x7')](_0xea78('0x8'),_0x1e6bf8,_['map'](_0x275abe,_0xea78('0x9'))[_0xea78('0xa')](',\x20'));_0x381338[_0xea78('0xb')]();}else{logger[_0xea78('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x1e6bf8,_0x5d74b[_0xea78('0xd')]);if(_0x5d74b['priority']){var _0x17b479=_[_0xea78('0xe')](_0x381338[_0xea78('0xf')](),{'p':_0x5d74b[_0xea78('0xd')]});if(_0x17b479>=0x0){logger[_0xea78('0xc')](_0xea78('0x10'),_0x1e6bf8,_0x5d74b[_0xea78('0xd')]||_0xea78('0x11'),_0x17b479);_0x381338[_0xea78('0x11')](_0x17b479);}else{logger[_0xea78('0xc')](_0xea78('0x12'),_0x1e6bf8,_0x5d74b[_0xea78('0xd')]||_0xea78('0x11'));_0x381338[_0xea78('0xb')]();}}else{_0x381338['next']();}}}catch(_0x252a27){logger[_0xea78('0x7')](_0xea78('0x8'),_0x1e6bf8,JSON['stringify'](_0x252a27));_0x381338[_0xea78('0xb')]();}};}; \ 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 866f7f3..edcbba9 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 _0x9931=['account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','body','catch','[%s][MESSAGE]\x20%s','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat'];(function(_0x4d2938,_0x332d65){var _0x5e7d9b=function(_0x135e24){while(--_0x135e24){_0x4d2938['push'](_0x4d2938['shift']());}};_0x5e7d9b(++_0x332d65);}(_0x9931,0xb1));var _0x1993=function(_0x412a6c,_0x18e993){_0x412a6c=_0x412a6c-0x0;var _0x34ef3c=_0x9931[_0x412a6c];return _0x34ef3c;};'use strict';var _=require(_0x1993('0x0'));var utils=require(_0x1993('0x1'));var logger=require(_0x1993('0x2'))(_0x1993('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x1993('0x4')),'mailMessage':require(_0x1993('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1993('0x6'))};exports[_0x1993('0x7')]=function(_0x42256c,_0x286006){return function(_0x5281c2){try{var _0x1e1538={'body':utils[_0x1993('0x8')](_0x286006[0x0],this),'ContactId':this[_0x1993('0x9')]['id']};if(this[_0x1993('0xa')]===_0x1993('0xb')){_0x1e1538['ChatWebsiteId']=this[_0x1993('0xc')]['id'];}else{_0x1e1538[_[_0x1993('0xd')](this[_0x1993('0xa')])+_0x1993('0xe')]=this['account']['id'];}_0x1e1538[_[_0x1993('0xd')](this[_0x1993('0xa')])+_0x1993('0xf')]=this[_0x1993('0x10')]['id'];if(rpc[this[_0x1993('0xa')]+_0x1993('0x11')]){return rpc[this['channel']+'Message'][_0x1993('0x12')](_0x1e1538)[_0x1993('0x13')](function(_0x54de7f){logger[_0x1993('0x14')]('[%s][MESSAGE]\x20%s',_0x42256c,_0x1e1538[_0x1993('0x15')]);_0x5281c2['next']();})[_0x1993('0x16')](function(_0x5a2181){logger['error'](_0x1993('0x17'),_0x42256c,JSON[_0x1993('0x18')](_0x5a2181));_0x5281c2[_0x1993('0x19')]();});}}catch(_0x1411b3){logger[_0x1993('0x1a')](_0x1993('0x17'),_0x42256c,JSON['stringify'](_0x1411b3));_0x5281c2[_0x1993('0x19')]();}};}; \ No newline at end of file +var _0x14a0=['interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','error','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','getMustacheRender','contact','channel','account','upperFirst','InteractionId'];(function(_0x5014fa,_0x4da985){var _0x4d11b4=function(_0x1d4a8c){while(--_0x1d4a8c){_0x5014fa['push'](_0x5014fa['shift']());}};_0x4d11b4(++_0x4da985);}(_0x14a0,0x8e));var _0x014a=function(_0x1885ca,_0x969905){_0x1885ca=_0x1885ca-0x0;var _0x59be88=_0x14a0[_0x1885ca];return _0x59be88;};'use strict';var _=require('lodash');var utils=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var rpc={'chatMessage':require(_0x014a('0x3')),'openchannelMessage':require(_0x014a('0x4')),'mailMessage':require(_0x014a('0x5')),'smsMessage':require(_0x014a('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x014a('0x7')]=function(_0x12e8da,_0x38a22c){return function(_0x5ec84d){try{var _0x5a61ac={'body':utils[_0x014a('0x8')](_0x38a22c[0x0],this),'ContactId':this[_0x014a('0x9')]['id']};if(this[_0x014a('0xa')]==='chat'){_0x5a61ac['ChatWebsiteId']=this[_0x014a('0xb')]['id'];}else{_0x5a61ac[_['upperFirst'](this['channel'])+'AccountId']=this['account']['id'];}_0x5a61ac[_[_0x014a('0xc')](this['channel'])+_0x014a('0xd')]=this[_0x014a('0xe')]['id'];if(rpc[this['channel']+_0x014a('0xf')]){return rpc[this[_0x014a('0xa')]+_0x014a('0xf')][_0x014a('0x10')](_0x5a61ac)[_0x014a('0x11')](function(_0x20cb56){logger[_0x014a('0x12')](_0x014a('0x13'),_0x12e8da,_0x5a61ac[_0x014a('0x14')]);_0x5ec84d[_0x014a('0x15')]();})[_0x014a('0x16')](function(_0x3c54c8){logger['error'](_0x014a('0x13'),_0x12e8da,JSON[_0x014a('0x17')](_0x3c54c8));_0x5ec84d['stop']();});}}catch(_0x3a836f){logger[_0x014a('0x18')]('[%s][MESSAGE]\x20%s',_0x12e8da,JSON[_0x014a('0x17')](_0x3a836f));_0x5ec84d[_0x014a('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 0eefb74..9f740a5 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 _0xd34e=['stringify','stop','./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xd34e,0xd1));var _0xed34=function(_0x360913,_0x21634e){_0x360913=_0x360913-0x0;var _0xbdf07b=_0xd34e[_0x360913];return _0xbdf07b;};'use strict';var utils=require(_0xed34('0x0'));var logger=require(_0xed34('0x1'))('routing');exports[_0xed34('0x2')]=function(_0x115b0d,_0x3b8224){return function(_0x16b3da){try{logger[_0xed34('0x3')](_0xed34('0x4'),_0x115b0d,utils[_0xed34('0x5')](_0x3b8224[0x0],this));_0x16b3da[_0xed34('0x6')]();}catch(_0x22830f){logger['error'](_0xed34('0x4'),_0x115b0d,JSON[_0xed34('0x7')](_0x22830f));_0x16b3da[_0xed34('0x8')]();}};}; \ No newline at end of file +var _0x9c40=['stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x384c01,_0x1e0dc5){var _0x300793=function(_0x32bb86){while(--_0x32bb86){_0x384c01['push'](_0x384c01['shift']());}};_0x300793(++_0x1e0dc5);}(_0x9c40,0x1c4));var _0x09c4=function(_0x25e5ef,_0x2a1960){_0x25e5ef=_0x25e5ef-0x0;var _0xbbb239=_0x9c40[_0x25e5ef];return _0xbbb239;};'use strict';var utils=require(_0x09c4('0x0'));var logger=require(_0x09c4('0x1'))(_0x09c4('0x2'));exports[_0x09c4('0x3')]=function(_0x5980e2,_0x2f5940){return function(_0x1a761e){try{logger[_0x09c4('0x4')](_0x09c4('0x5'),_0x5980e2,utils[_0x09c4('0x6')](_0x2f5940[0x0],this));_0x1a761e[_0x09c4('0x7')]();}catch(_0x453dcc){logger[_0x09c4('0x8')]('[%s][NOOP]\x20%s',_0x5980e2,JSON[_0x09c4('0x9')](_0x453dcc));_0x1a761e[_0x09c4('0xa')]();}};}; \ 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 044c6ad..32b517d 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 _0xc476=['queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','contact','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','info','name','QueueReport','create','catch','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','error','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','queue_id','account'];(function(_0x19cfac,_0x3745dc){var _0x25d2a5=function(_0x2bad78){while(--_0x2bad78){_0x19cfac['push'](_0x19cfac['shift']());}};_0x25d2a5(++_0x3745dc);}(_0xc476,0x84));var _0x6c47=function(_0x3acc8e,_0x2e5b3d){_0x3acc8e=_0x3acc8e-0x0;var _0x5eeea0=_0xc476[_0x3acc8e];return _0x5eeea0;};'use strict';var schema=require(_0x6c47('0x0'));var _=require(_0x6c47('0x1'));var util=require(_0x6c47('0x2'));var seqqueue=require(_0x6c47('0x3'));var moment=require(_0x6c47('0x4'));var Redis=require(_0x6c47('0x5'));var config=require(_0x6c47('0x6'));var logger=require(_0x6c47('0x7'))('routing');var strategy=require(_0x6c47('0x8'));config[_0x6c47('0x9')]=_[_0x6c47('0xa')](config[_0x6c47('0x9')],{'host':_0x6c47('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x6c47('0xc'),_0x6c47('0xd'),_0x6c47('0xe'),_0x6c47('0xf'),_0x6c47('0x10')];function emit(_0x28c7d1,_0x399216,_0x1ab77e){io['to'](_0x28c7d1)[_0x6c47('0x11')](_0x399216,_0x1ab77e);}function emitChannelQueueInteraction(_0x3e678c,_0x171210,_0x1a15d6,_0x2b5a3d,_0x27347e,_0x1fcab9,_0x2a78e9,_0x95540f){var _0x4b2754=_[_0x6c47('0x12')](_0x1a15d6);_0x4b2754['queue_id']=_0x95540f;_0x4b2754[_0x6c47('0xe')]=_0x171210;_0x4b2754[_0x6c47('0xd')]=_0x2b5a3d;_0x4b2754['id']=_0x27347e;if(_0x1fcab9){_0x2a78e9[util[_0x6c47('0x13')](_0x6c47('0x14'),_0x3e678c)][_0x27347e]=_[_0x6c47('0x15')](_0x4b2754,attributes);}else{delete _0x2a78e9[util['format']('%sQueuesWaitingInteractions',_0x3e678c)][_0x27347e];}emit(util[_0x6c47('0x13')]('%s:queue:%s',_0x3e678c,_0x171210),util[_0x6c47('0x13')](_0x6c47('0x16'),_0x3e678c,_0x1fcab9?_0x6c47('0x17'):_0x6c47('0x18')),_['pick'](_0x4b2754,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x6c47('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x6c47('0x1a')),'faxQueueReport':require(_0x6c47('0x1b')),'whatsappQueueReport':require(_0x6c47('0x1c'))};var queue=schema({'name':{'type':_0x6c47('0x1d'),'required':!![],'message':_0x6c47('0x1e')},'timeout':{'type':_0x6c47('0x1f'),'message':_0x6c47('0x20')}});function startRouting(_0x3c4c0b,_0x4ab837,_0x155c3d,_0x1d4c97){if(_0x3c4c0b&&_0x4ab837&&_0x155c3d){_0x4ab837[_0x6c47('0x21')]+=0x1;var _0x1f542d={'uniqueid':_0x3c4c0b,'from':_0x155c3d['body']?_0x155c3d['body']['from']:'','joinAt':moment()[_0x6c47('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x155c3d['contact']?_0x155c3d[_0x6c47('0x22')]['id']:null,'ListId':_0x155c3d['list']?_0x155c3d['list']['id']:null};_0x1f542d[_[_0x6c47('0x23')](_0x155c3d[_0x6c47('0x24')])+_0x6c47('0x25')]=_0x4ab837['id']||null;_0x1f542d[_[_0x6c47('0x23')](_0x155c3d[_0x6c47('0x24')])+_0x6c47('0x26')]=_0x155c3d[_0x6c47('0x27')]?_0x155c3d[_0x6c47('0x27')]['id']:null;_0x1f542d[_[_0x6c47('0x23')](_0x155c3d['channel'])+_0x6c47('0x28')]=_0x155c3d['message']?_0x155c3d[_0x6c47('0x29')]['id']:null;_0x1f542d[_[_0x6c47('0x23')](_0x155c3d['channel'])+(_0x155c3d[_0x6c47('0x24')]!==_0x6c47('0x2a')?_0x6c47('0x2b'):'WebsiteId')]=_0x155c3d[_0x6c47('0xd')]?_0x155c3d['account']['id']:null;logger[_0x6c47('0x2c')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x3c4c0b,_0x4ab837[_0x6c47('0x2d')]));emitChannelQueueInteraction(_0x155c3d[_0x6c47('0x24')],_0x4ab837['name'],_0x1f542d,_0x155c3d['account'][_0x6c47('0x2d')],_0x155c3d['message']['id'],!![],_0x1d4c97,_0x4ab837['id']);if(rpc[_0x155c3d['channel']+_0x6c47('0x2e')]){return rpc[_0x155c3d[_0x6c47('0x24')]+_0x6c47('0x2e')][_0x6c47('0x2f')](_0x1f542d)[_0x6c47('0x30')](function(_0x441922){logger['error'](_0x6c47('0x31'));});}}}function stopRouting(_0x13e7f7,_0x2fcaa9,_0x38a1b0,_0x564617){if(_0x13e7f7&&_0x2fcaa9){_0x2fcaa9[_0x6c47('0x21')]-=0x1;var _0xef285e={'leaveAt':moment()[_0x6c47('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger['info'](util[_0x6c47('0x13')](_0x6c47('0x32'),_0x13e7f7,_0x2fcaa9[_0x6c47('0x2d')]));emitChannelQueueInteraction(_0x38a1b0[_0x6c47('0x24')],_0x2fcaa9[_0x6c47('0x2d')],_0x38a1b0['body'],_0x38a1b0[_0x6c47('0xd')]['name'],_0x38a1b0['message']['id'],![],_0x564617,_0x2fcaa9['id']);if(rpc[_0x38a1b0[_0x6c47('0x24')]+_0x6c47('0x2e')]){return rpc[_0x38a1b0['channel']+_0x6c47('0x2e')]['update'](_0x13e7f7,_0xef285e)[_0x6c47('0x30')](function(_0x59b6e0){logger[_0x6c47('0x33')](_0x6c47('0x34'));});}}}function endRouting(_0x3a8f85,_0x16abe3,_0x35905b,_0x41e2ad){if(_0x3a8f85&&_0x16abe3){_0x16abe3[_0x6c47('0x21')]-=0x1;var _0x2d197c={'leaveAt':moment()[_0x6c47('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x6c47('0x13')](_0x6c47('0x35')),'reason':_0x6c47('0x36')};logger[_0x6c47('0x2c')](util[_0x6c47('0x13')]('[%s][END:QUEUE][NAME:%s]',_0x3a8f85,_0x16abe3[_0x6c47('0x2d')]));emitChannelQueueInteraction(_0x35905b[_0x6c47('0x24')],_0x16abe3[_0x6c47('0x2d')],_0x35905b['body'],_0x35905b[_0x6c47('0xd')][_0x6c47('0x2d')],_0x35905b[_0x6c47('0x29')]['id'],![],_0x41e2ad);if(rpc[_0x35905b[_0x6c47('0x24')]+_0x6c47('0x2e')]){return rpc[_0x35905b['channel']+_0x6c47('0x2e')]['update'](_0x3a8f85,_0x2d197c)['catch'](function(_0x32043f){logger[_0x6c47('0x33')](_0x6c47('0x34'));});}}}function handleFindQueue(_0x4a44f6){return function(_0x57229c){return _0x57229c['name'][_0x6c47('0x37')]()===_0x4a44f6[_0x6c47('0x37')]();};}exports['consequence']=function(_0x5a4bde,_0x37724a,_0x18ad5c,_0x3e35ef){return function(_0x3caeea){try{var _0x36f001={'name':_0x37724a[0x0],'timeout':_0x37724a[0x1]};var _0x2e03a4=queue[_0x6c47('0x0')](_0x36f001,{'typecast':!![]});if(_0x2e03a4[_0x6c47('0x38')]){logger[_0x6c47('0x33')](_0x6c47('0x39'),_0x5a4bde,_[_0x6c47('0x3a')](_0x2e03a4,_0x6c47('0x29'))['join'](',\x20'));_0x3caeea[_0x6c47('0x3b')]();}else{var _0x55755a=_[_0x6c47('0x3c')](_0x18ad5c[_0x3e35ef['channel']+_0x6c47('0x3d')],handleFindQueue(_0x36f001[_0x6c47('0x2d')]));if(_0x55755a){startRouting(_0x5a4bde,_0x55755a,_0x3e35ef,_0x18ad5c);var _0x59e571=(_0x55755a[_0x6c47('0x36')]||0xa)*0x3e8;var _0x53be2d=(_0x36f001[_0x6c47('0x36')]||0x14)*0x3e8;var _0x3a2e05,_0x342c44;if(_0x59e571>_0x53be2d){_0x53be2d=_0x59e571;}var _0x2c3d9e=seqqueue[_0x6c47('0x3e')](_0x59e571);_0x2c3d9e['id']=_0x5a4bde;_0x2c3d9e[_0x6c47('0x3f')]=_0x59e571;_0x2c3d9e[_0x6c47('0x40')]=_0x53be2d;_0x2c3d9e[_0x6c47('0x24')]=_0x3e35ef[_0x6c47('0x24')];_0x18ad5c[_0x6c47('0x41')][_0x5a4bde]['on'](_0x6c47('0x42'),function(){logger[_0x6c47('0x2c')](_0x6c47('0x43'),_0x5a4bde);stopRouting(_0x5a4bde,_0x55755a,_0x3e35ef,_0x18ad5c);clearTimeout(_0x3a2e05);_0x3a2e05=undefined;_0x2c3d9e['close'](!![]);if(_0x18ad5c[_0x6c47('0x41')][_0x5a4bde]){delete _0x18ad5c['rules'][_0x5a4bde];}_0x3caeea[_0x6c47('0x3b')]();});_0x18ad5c[_0x6c47('0x41')][_0x5a4bde]['on']('complete',function(){if(_0x18ad5c[_0x6c47('0x41')][_0x5a4bde]){delete _0x18ad5c[_0x6c47('0x41')][_0x5a4bde];}});_0x3a2e05=setTimeout(function(){logger[_0x6c47('0x2c')](_0x6c47('0x44'),_0x5a4bde);endRouting(_0x5a4bde,_0x55755a,_0x3e35ef,_0x18ad5c);clearTimeout(_0x3a2e05);_0x2c3d9e['close'](!![]);_0x3caeea['next']();},_0x53be2d);switch(_0x55755a['strategy']){case _0x6c47('0x45'):strategy[_0x6c47('0x45')](_0x2c3d9e,_0x55755a,_0x18ad5c,_0x3e35ef);break;default:strategy['beepall'](_0x2c3d9e,_0x55755a,_0x18ad5c,_0x3e35ef);}}else{logger[_0x6c47('0x33')](_0x6c47('0x46'),_0x5a4bde,_0x36f001[_0x6c47('0x2d')]);_0x3caeea[_0x6c47('0x3b')]();}}}catch(_0x403c18){console[_0x6c47('0x47')](_0x403c18);logger['error'](_0x6c47('0x39'),_0x5a4bde,_0x403c18[_0x6c47('0x48')]);_0x3caeea['stop']();}};}; \ No newline at end of file +var _0xea89=['toLowerCase','consequence','map','join','find','createQueue','qtimeout','rules','end','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','account','from','joinAt','emit','clone','queue_id','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','update','error','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0xea89,0xfa));var _0x9ea8=function(_0x1d8f95,_0xcd1d0e){_0x1d8f95=_0x1d8f95-0x0;var _0x4cb618=_0xea89[_0x1d8f95];return _0x4cb618;};'use strict';var schema=require(_0x9ea8('0x0'));var _=require(_0x9ea8('0x1'));var util=require(_0x9ea8('0x2'));var seqqueue=require(_0x9ea8('0x3'));var moment=require(_0x9ea8('0x4'));var Redis=require(_0x9ea8('0x5'));var config=require(_0x9ea8('0x6'));var logger=require(_0x9ea8('0x7'))('routing');var strategy=require(_0x9ea8('0x8'));config[_0x9ea8('0x9')]=_[_0x9ea8('0xa')](config[_0x9ea8('0x9')],{'host':_0x9ea8('0xb'),'port':0x18eb});var io=require(_0x9ea8('0xc'))(new Redis(config[_0x9ea8('0x9')]));var attributes=['id','queue_id',_0x9ea8('0xd'),'queue',_0x9ea8('0xe'),_0x9ea8('0xf')];function emit(_0xd2435,_0x179c41,_0xb1467f){io['to'](_0xd2435)[_0x9ea8('0x10')](_0x179c41,_0xb1467f);}function emitChannelQueueInteraction(_0x37b1b9,_0x5716ac,_0x3e3209,_0x5a39e5,_0x530d93,_0x47ec1a,_0x415b1c,_0x1c66e2){var _0x1650ab=_[_0x9ea8('0x11')](_0x3e3209);_0x1650ab[_0x9ea8('0x12')]=_0x1c66e2;_0x1650ab[_0x9ea8('0x13')]=_0x5716ac;_0x1650ab['account']=_0x5a39e5;_0x1650ab['id']=_0x530d93;if(_0x47ec1a){_0x415b1c[util[_0x9ea8('0x14')](_0x9ea8('0x15'),_0x37b1b9)][_0x530d93]=_[_0x9ea8('0x16')](_0x1650ab,attributes);}else{delete _0x415b1c[util['format'](_0x9ea8('0x15'),_0x37b1b9)][_0x530d93];}emit(util[_0x9ea8('0x14')](_0x9ea8('0x17'),_0x37b1b9,_0x5716ac),util[_0x9ea8('0x14')](_0x9ea8('0x18'),_0x37b1b9,_0x47ec1a?'save':_0x9ea8('0x19')),_[_0x9ea8('0x16')](_0x1650ab,attributes));}var rpc={'openchannelQueueReport':require(_0x9ea8('0x1a')),'mailQueueReport':require(_0x9ea8('0x1b')),'chatQueueReport':require(_0x9ea8('0x1c')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x9ea8('0x1d')),'whatsappQueueReport':require(_0x9ea8('0x1e'))};var queue=schema({'name':{'type':_0x9ea8('0x1f'),'required':!![],'message':_0x9ea8('0x20')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xa49feb,_0x313601,_0xf04e06,_0x1ebf80){if(_0xa49feb&&_0x313601&&_0xf04e06){_0x313601[_0x9ea8('0x21')]+=0x1;var _0x11e74b={'uniqueid':_0xa49feb,'from':_0xf04e06[_0x9ea8('0x22')]?_0xf04e06[_0x9ea8('0x22')][_0x9ea8('0xe')]:'','joinAt':moment()[_0x9ea8('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf04e06[_0x9ea8('0x23')]?_0xf04e06[_0x9ea8('0x23')]['id']:null,'ListId':_0xf04e06['list']?_0xf04e06[_0x9ea8('0x24')]['id']:null};_0x11e74b[_['upperFirst'](_0xf04e06[_0x9ea8('0x25')])+_0x9ea8('0x26')]=_0x313601['id']||null;_0x11e74b[_[_0x9ea8('0x27')](_0xf04e06[_0x9ea8('0x25')])+_0x9ea8('0x28')]=_0xf04e06[_0x9ea8('0x29')]?_0xf04e06[_0x9ea8('0x29')]['id']:null;_0x11e74b[_['upperFirst'](_0xf04e06[_0x9ea8('0x25')])+'MessageId']=_0xf04e06[_0x9ea8('0x2a')]?_0xf04e06['message']['id']:null;_0x11e74b[_[_0x9ea8('0x27')](_0xf04e06[_0x9ea8('0x25')])+(_0xf04e06[_0x9ea8('0x25')]!==_0x9ea8('0x2b')?_0x9ea8('0x2c'):'WebsiteId')]=_0xf04e06['account']?_0xf04e06['account']['id']:null;logger[_0x9ea8('0x2d')](util[_0x9ea8('0x14')](_0x9ea8('0x2e'),_0xa49feb,_0x313601['name']));emitChannelQueueInteraction(_0xf04e06[_0x9ea8('0x25')],_0x313601[_0x9ea8('0x2f')],_0x11e74b,_0xf04e06[_0x9ea8('0xd')][_0x9ea8('0x2f')],_0xf04e06[_0x9ea8('0x2a')]['id'],!![],_0x1ebf80,_0x313601['id']);if(rpc[_0xf04e06[_0x9ea8('0x25')]+_0x9ea8('0x30')]){return rpc[_0xf04e06[_0x9ea8('0x25')]+_0x9ea8('0x30')]['create'](_0x11e74b)[_0x9ea8('0x31')](function(_0x164dd7){logger['error'](_0x9ea8('0x32'));});}}}function stopRouting(_0x42ba10,_0xcc540f,_0x5a9b5,_0x55f961){if(_0x42ba10&&_0xcc540f){_0xcc540f[_0x9ea8('0x21')]-=0x1;var _0x2e2b4b={'leaveAt':moment()[_0x9ea8('0x14')](_0x9ea8('0x33')),'acceptAt':moment()[_0x9ea8('0x14')](_0x9ea8('0x33')),'reason':_0x9ea8('0x34')};logger['info'](util[_0x9ea8('0x14')]('[%s][STOP:QUEUE][NAME:%s]',_0x42ba10,_0xcc540f[_0x9ea8('0x2f')]));emitChannelQueueInteraction(_0x5a9b5[_0x9ea8('0x25')],_0xcc540f[_0x9ea8('0x2f')],_0x5a9b5[_0x9ea8('0x22')],_0x5a9b5[_0x9ea8('0xd')][_0x9ea8('0x2f')],_0x5a9b5[_0x9ea8('0x2a')]['id'],![],_0x55f961,_0xcc540f['id']);if(rpc[_0x5a9b5['channel']+'QueueReport']){return rpc[_0x5a9b5['channel']+_0x9ea8('0x30')][_0x9ea8('0x35')](_0x42ba10,_0x2e2b4b)['catch'](function(_0x1f0d85){logger[_0x9ea8('0x36')]('update\x20queue\x20report');});}}}function endRouting(_0x254284,_0x2f4caa,_0x4116c6,_0x3fcb1c){if(_0x254284&&_0x2f4caa){_0x2f4caa[_0x9ea8('0x21')]-=0x1;var _0x22ba94={'leaveAt':moment()[_0x9ea8('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x9ea8('0x14')](_0x9ea8('0x33')),'reason':_0x9ea8('0x37')};logger['info'](util['format'](_0x9ea8('0x38'),_0x254284,_0x2f4caa[_0x9ea8('0x2f')]));emitChannelQueueInteraction(_0x4116c6['channel'],_0x2f4caa['name'],_0x4116c6[_0x9ea8('0x22')],_0x4116c6[_0x9ea8('0xd')][_0x9ea8('0x2f')],_0x4116c6[_0x9ea8('0x2a')]['id'],![],_0x3fcb1c);if(rpc[_0x4116c6[_0x9ea8('0x25')]+_0x9ea8('0x30')]){return rpc[_0x4116c6[_0x9ea8('0x25')]+'QueueReport'][_0x9ea8('0x35')](_0x254284,_0x22ba94)[_0x9ea8('0x31')](function(_0x554d0c){logger['error'](_0x9ea8('0x39'));});}}}function handleFindQueue(_0x1d4224){return function(_0x5b8688){return _0x5b8688[_0x9ea8('0x2f')][_0x9ea8('0x3a')]()===_0x1d4224['toLowerCase']();};}exports[_0x9ea8('0x3b')]=function(_0x3eb81f,_0x461a3f,_0x519a6f,_0x3ca865){return function(_0x5cf95a){try{var _0x49935d={'name':_0x461a3f[0x0],'timeout':_0x461a3f[0x1]};var _0x3d059c=queue[_0x9ea8('0x0')](_0x49935d,{'typecast':!![]});if(_0x3d059c['length']){logger[_0x9ea8('0x36')]('[%s][QUEUE]\x20%s',_0x3eb81f,_[_0x9ea8('0x3c')](_0x3d059c,_0x9ea8('0x2a'))[_0x9ea8('0x3d')](',\x20'));_0x5cf95a['stop']();}else{var _0x2347f1=_[_0x9ea8('0x3e')](_0x519a6f[_0x3ca865[_0x9ea8('0x25')]+'Queues'],handleFindQueue(_0x49935d['name']));if(_0x2347f1){startRouting(_0x3eb81f,_0x2347f1,_0x3ca865,_0x519a6f);var _0x175dfe=(_0x2347f1['timeout']||0xa)*0x3e8;var _0x1444c1=(_0x49935d[_0x9ea8('0x37')]||0x14)*0x3e8;var _0x2fb98d,_0x1bf275;if(_0x175dfe>_0x1444c1){_0x1444c1=_0x175dfe;}var _0x38467d=seqqueue[_0x9ea8('0x3f')](_0x175dfe);_0x38467d['id']=_0x3eb81f;_0x38467d['atimeout']=_0x175dfe;_0x38467d[_0x9ea8('0x40')]=_0x1444c1;_0x38467d['channel']=_0x3ca865['channel'];_0x519a6f[_0x9ea8('0x41')][_0x3eb81f]['on'](_0x9ea8('0x42'),function(){logger[_0x9ea8('0x2d')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x3eb81f);stopRouting(_0x3eb81f,_0x2347f1,_0x3ca865,_0x519a6f);clearTimeout(_0x2fb98d);_0x2fb98d=undefined;_0x38467d[_0x9ea8('0x43')](!![]);if(_0x519a6f['rules'][_0x3eb81f]){delete _0x519a6f[_0x9ea8('0x41')][_0x3eb81f];}_0x5cf95a[_0x9ea8('0x44')]();});_0x519a6f[_0x9ea8('0x41')][_0x3eb81f]['on'](_0x9ea8('0x45'),function(){if(_0x519a6f[_0x9ea8('0x41')][_0x3eb81f]){delete _0x519a6f['rules'][_0x3eb81f];}});_0x2fb98d=setTimeout(function(){logger['info'](_0x9ea8('0x46'),_0x3eb81f);endRouting(_0x3eb81f,_0x2347f1,_0x3ca865,_0x519a6f);clearTimeout(_0x2fb98d);_0x38467d[_0x9ea8('0x43')](!![]);_0x5cf95a['next']();},_0x1444c1);switch(_0x2347f1[_0x9ea8('0x47')]){case _0x9ea8('0x48'):strategy[_0x9ea8('0x48')](_0x38467d,_0x2347f1,_0x519a6f,_0x3ca865);break;default:strategy['beepall'](_0x38467d,_0x2347f1,_0x519a6f,_0x3ca865);}}else{logger[_0x9ea8('0x36')](_0x9ea8('0x49'),_0x3eb81f,_0x49935d['name']);_0x5cf95a[_0x9ea8('0x44')]();}}}catch(_0x559bd1){console[_0x9ea8('0x4a')](_0x559bd1);logger[_0x9ea8('0x36')](_0x9ea8('0x4b'),_0x3eb81f,_0x559bd1[_0x9ea8('0x4c')]);_0x5cf95a[_0x9ea8('0x44')]();}};}; \ 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 50056b4..d91a6e9 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 _0xbe51=['exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','push','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x4a78b9,_0x2b2acf){var _0x63f4fc=function(_0x20b854){while(--_0x20b854){_0x4a78b9['push'](_0x4a78b9['shift']());}};_0x63f4fc(++_0x2b2acf);}(_0xbe51,0xc7));var _0x1be5=function(_0x199c45,_0x5d6f7a){_0x199c45=_0x199c45-0x0;var _0x339f81=_0xbe51[_0x199c45];return _0x339f81;};'use strict';var _=require(_0x1be5('0x0'));var uuid=require(_0x1be5('0x1'));var util=require(_0x1be5('0x2'));var logger=require(_0x1be5('0x3'))(_0x1be5('0x4'));var Agent=function(_0x1edda0,_0x1e3fa3,_0x5230cb,_0x2ed51b){this[_0x1be5('0x5')]=uuid['v4']();this[_0x1be5('0x6')]=_0x1edda0;this['agent']=_0x1e3fa3;this[_0x1be5('0x7')]=_0x5230cb;this[_0x1be5('0x4')]=_0x2ed51b;this['squeue']['push'](this[_0x1be5('0x8')][_0x1be5('0x9')](this),this[_0x1be5('0xa')][_0x1be5('0x9')](this));this[_0x1be5('0x6')]['on'](_0x1be5('0xb'),this[_0x1be5('0xa')][_0x1be5('0x9')](this));this[_0x1be5('0x6')]['on'](_0x1be5('0xc'),this[_0x1be5('0xd')][_0x1be5('0x9')](this));};Agent['prototype']['push']=function(){this[_0x1be5('0x6')]['push'](this[_0x1be5('0x8')][_0x1be5('0x9')](this),this[_0x1be5('0xa')]['bind'](this));};Agent[_0x1be5('0xe')][_0x1be5('0xd')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x1be5('0x8')]=function(_0xe0d4e4){logger['info'](_0x1be5('0xf'),this['squeue']['id'],this[_0x1be5('0x10')]['id']);if(_[_0x1be5('0x11')](this['realtime'][_0x1be5('0x12')][this[_0x1be5('0x10')]['id']])){logger[_0x1be5('0x13')](_0x1be5('0x14'),this[_0x1be5('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x1be5('0x15')][_0x1be5('0x9')](this),0x3e8);}else{if(this[_0x1be5('0x4')]['forcedOwnership']||util[_0x1be5('0x16')](this[_0x1be5('0x6')]['id'],this[_0x1be5('0x7')]['agents'][this[_0x1be5('0x10')]['id']],this[_0x1be5('0x6')][_0x1be5('0x17')],![])){this[_0x1be5('0x7')]['agents'][this[_0x1be5('0x10')]['id']][_0x1be5('0x18')]=!![];this[_0x1be5('0x7')]['agents'][this[_0x1be5('0x10')]['id']][_0x1be5('0x19')]=undefined;util[_0x1be5('0x1a')](this[_0x1be5('0x5')],this[_0x1be5('0x6')]['id'],this[_0x1be5('0x7')][_0x1be5('0x12')][this[_0x1be5('0x10')]['id']],null,this['routing']);util[_0x1be5('0x1b')](this[_0x1be5('0x6')]['id'],this[_0x1be5('0x7')][_0x1be5('0x12')][this[_0x1be5('0x10')]['id']],_0x1be5('0x1c')+(this['routing'][_0x1be5('0x1d')]?':FORCED':''));}else{logger[_0x1be5('0x13')](_0x1be5('0x1e'),this[_0x1be5('0x6')]['id'],this[_0x1be5('0x10')]['id']);setTimeout(this[_0x1be5('0x15')][_0x1be5('0x9')](this),0x3e8);}}};Agent[_0x1be5('0xe')][_0x1be5('0xa')]=function(_0x1bd26f){if(_[_0x1be5('0x11')](this[_0x1be5('0x7')][_0x1be5('0x12')][this[_0x1be5('0x10')]['id']])){return logger[_0x1be5('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1be5('0x6')]['id'],this[_0x1be5('0x10')]['id']);}else{logger[_0x1be5('0x13')](_0x1be5('0x1f'),this['squeue']['id'],this[_0x1be5('0x10')]['id']);util['hideNotification'](this['notificationId'],this[_0x1be5('0x6')]['id'],this[_0x1be5('0x7')][_0x1be5('0x12')][this[_0x1be5('0x10')]['id']],null,this['routing']);this[_0x1be5('0x7')][_0x1be5('0x12')][this[_0x1be5('0x10')]['id']][_0x1be5('0x18')]=![];this[_0x1be5('0x7')]['agents'][this[_0x1be5('0x10')]['id']][_0x1be5('0x19')]=undefined;util[_0x1be5('0x1b')](this[_0x1be5('0x6')]['id'],this[_0x1be5('0x7')][_0x1be5('0x12')][this[_0x1be5('0x10')]['id']],_0x1bd26f?'STOP':'TIMEOUT');}if(!_0x1bd26f){setTimeout(this[_0x1be5('0x15')][_0x1be5('0x9')](this),0x3e8);}};function agent(_0x676c30,_0x25c658,_0x164ce0,_0x27007e){return new Agent(_0x676c30,_0x25c658,_0x164ce0,_0x27007e);}module[_0x1be5('0x20')]=agent; \ No newline at end of file +var _0xebed=['agents','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xebed,0x1a5));var _0xdebe=function(_0x256422,_0x367394){_0x256422=_0x256422-0x0;var _0x55dddc=_0xebed[_0x256422];return _0x55dddc;};'use strict';var _=require('lodash');var uuid=require(_0xdebe('0x0'));var util=require(_0xdebe('0x1'));var logger=require(_0xdebe('0x2'))(_0xdebe('0x3'));var Agent=function(_0x531a4a,_0x32bcb2,_0x794a54,_0x35e182){this[_0xdebe('0x4')]=uuid['v4']();this[_0xdebe('0x5')]=_0x531a4a;this['agent']=_0x32bcb2;this[_0xdebe('0x6')]=_0x794a54;this['routing']=_0x35e182;this[_0xdebe('0x5')][_0xdebe('0x7')](this[_0xdebe('0x8')][_0xdebe('0x9')](this),this['handleTimeout'][_0xdebe('0x9')](this));this[_0xdebe('0x5')]['on'](_0xdebe('0xa'),this[_0xdebe('0xb')][_0xdebe('0x9')](this));this[_0xdebe('0x5')]['on'](_0xdebe('0xc'),this[_0xdebe('0xd')][_0xdebe('0x9')](this));};Agent['prototype']['push']=function(){this[_0xdebe('0x5')][_0xdebe('0x7')](this['handleRun'][_0xdebe('0x9')](this),this['handleTimeout'][_0xdebe('0x9')](this));};Agent['prototype']['handleDrained']=function(){this[_0xdebe('0xb')](!![]);};Agent[_0xdebe('0xe')][_0xdebe('0x8')]=function(_0x11fb81){logger[_0xdebe('0xf')](_0xdebe('0x10'),this[_0xdebe('0x5')]['id'],this[_0xdebe('0x11')]['id']);if(_['isNil'](this[_0xdebe('0x6')]['agents'][this[_0xdebe('0x11')]['id']])){logger['info'](_0xdebe('0x12'),this[_0xdebe('0x5')]['id'],this[_0xdebe('0x11')]['id']);setTimeout(this[_0xdebe('0x7')][_0xdebe('0x9')](this),0x3e8);}else{if(this[_0xdebe('0x3')][_0xdebe('0x13')]||util[_0xdebe('0x14')](this['squeue']['id'],this[_0xdebe('0x6')][_0xdebe('0x15')][this[_0xdebe('0x11')]['id']],this[_0xdebe('0x5')][_0xdebe('0x16')],![])){this[_0xdebe('0x6')][_0xdebe('0x15')][this[_0xdebe('0x11')]['id']][_0xdebe('0x17')]=!![];this[_0xdebe('0x6')]['agents'][this[_0xdebe('0x11')]['id']][_0xdebe('0x18')]=undefined;util['showNotification'](this[_0xdebe('0x4')],this[_0xdebe('0x5')]['id'],this[_0xdebe('0x6')]['agents'][this[_0xdebe('0x11')]['id']],null,this[_0xdebe('0x3')]);util[_0xdebe('0x19')](this[_0xdebe('0x5')]['id'],this[_0xdebe('0x6')][_0xdebe('0x15')][this[_0xdebe('0x11')]['id']],_0xdebe('0x1a')+(this['routing'][_0xdebe('0x13')]?_0xdebe('0x1b'):''));}else{logger['info'](_0xdebe('0x1c'),this['squeue']['id'],this[_0xdebe('0x11')]['id']);setTimeout(this[_0xdebe('0x7')][_0xdebe('0x9')](this),0x3e8);}}};Agent['prototype'][_0xdebe('0xb')]=function(_0x237bdd){if(_[_0xdebe('0x1d')](this['realtime'][_0xdebe('0x15')][this[_0xdebe('0x11')]['id']])){return logger[_0xdebe('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xdebe('0x5')]['id'],this[_0xdebe('0x11')]['id']);}else{logger[_0xdebe('0xf')](_0xdebe('0x1e'),this[_0xdebe('0x5')]['id'],this[_0xdebe('0x11')]['id']);util['hideNotification'](this[_0xdebe('0x4')],this['squeue']['id'],this[_0xdebe('0x6')][_0xdebe('0x15')][this[_0xdebe('0x11')]['id']],null,this['routing']);this['realtime'][_0xdebe('0x15')][this[_0xdebe('0x11')]['id']]['busy']=![];this['realtime']['agents'][this[_0xdebe('0x11')]['id']]['busyQueue']=undefined;util[_0xdebe('0x19')](this[_0xdebe('0x5')]['id'],this[_0xdebe('0x6')][_0xdebe('0x15')][this['agent']['id']],_0x237bdd?_0xdebe('0x1f'):_0xdebe('0x20'));}if(!_0x237bdd){setTimeout(this[_0xdebe('0x7')][_0xdebe('0x9')](this),0x3e8);}};function agent(_0x3b81f1,_0x15cf8a,_0x162df0,_0x5a94c0){return new Agent(_0x3b81f1,_0x15cf8a,_0x162df0,_0x5a94c0);}module[_0xdebe('0x21')]=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 c5e3972..ee38b56 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 _0xe132=['length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','routing','notificationId','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','queue','Agents'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xe132,0x162));var _0x2e13=function(_0x13defd,_0x432572){_0x13defd=_0x13defd-0x0;var _0xd37e2c=_0xe132[_0x13defd];return _0xd37e2c;};'use strict';var _=require(_0x2e13('0x0'));var uuid=require('uuid');var util=require(_0x2e13('0x1'));var logger=require(_0x2e13('0x2'))(_0x2e13('0x3'));var Beepall=function(_0x2c2bdd,_0x2a5250,_0x4b87a6,_0x1ae6a9){this[_0x2e13('0x4')]=uuid['v4']();this['squeue']=_0x2c2bdd;this['queue']=_0x2a5250;this[_0x2e13('0x5')]=_0x4b87a6;this[_0x2e13('0x3')]=_0x1ae6a9;this[_0x2e13('0x6')][_0x2e13('0x7')](this[_0x2e13('0x8')][_0x2e13('0x9')](this),this[_0x2e13('0xa')][_0x2e13('0x9')](this));this[_0x2e13('0x6')]['on'](_0x2e13('0xb'),this['handleTimeout'][_0x2e13('0x9')](this));this[_0x2e13('0x6')]['on'](_0x2e13('0xc'),this[_0x2e13('0xd')][_0x2e13('0x9')](this));};Beepall[_0x2e13('0xe')][_0x2e13('0x7')]=function(){this['squeue'][_0x2e13('0x7')](this[_0x2e13('0x8')][_0x2e13('0x9')](this),this[_0x2e13('0xa')][_0x2e13('0x9')](this));};Beepall[_0x2e13('0xe')][_0x2e13('0xd')]=function(_0x51f1a3){this[_0x2e13('0xa')](!![]);};Beepall[_0x2e13('0xe')][_0x2e13('0x8')]=function(_0x4bc56a){var _0x4d7fa3=!![];if(!_[_0x2e13('0xf')](this[_0x2e13('0x10')])&&!_['isNil'](this[_0x2e13('0x10')][_0x2e13('0x11')])&&this[_0x2e13('0x10')]['Agents']['length']>0x0){for(var _0x2a3007=0x0,_0x2c026d;_0x2a30070x0){for(var _0x5b62ca=0x0,_0x1bddc7;_0x5b62ca0x0&&_0x2402de[_0x3f80b9+_0x901d('0x24')]>=_0x2402de[_0x3f80b9+_0x901d('0x23')]){writeLog(_0x53ee69,_0x2402de,_0x3f80b9[_0x901d('0x25')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x901d('0x26')]=function(_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9){return sendNotification(!![],_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9);};exports['hideNotification']=function(_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5){return sendNotification(![],_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5);};exports[_0x901d('0x27')]=writeLog; \ No newline at end of file +var _0x2a07=['socket.io-emitter','emit','format','name','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','error','[%s][QUEUE]\x20%s','user:%s','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','defaults','localhost'];(function(_0x385206,_0x2975be){var _0x50fe8e=function(_0x37aef3){while(--_0x37aef3){_0x385206['push'](_0x385206['shift']());}};_0x50fe8e(++_0x2975be);}(_0x2a07,0x74));var _0x72a0=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x2a07[_0x4aa4af];return _0x3bf44a;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var utils=require(_0x72a0('0x2'));var Mustache=require(_0x72a0('0x3'));var Redis=require(_0x72a0('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x72a0('0x5'))(_0x72a0('0x6'));config[_0x72a0('0x7')]=_[_0x72a0('0x8')](config[_0x72a0('0x7')],{'host':_0x72a0('0x9'),'port':0x18eb});var io=require(_0x72a0('0xa'))(new Redis(config[_0x72a0('0x7')]));function emit(_0x193e3b,_0x287b06,_0x21c819){io['to'](_0x193e3b)[_0x72a0('0xb')](_0x287b06,_0x21c819);}function sendNotification(_0x22270e,_0x1d32e9,_0x55b3e9,_0x2bc45b,_0x5c1d1e,_0x169dc2){io['to'](util[_0x72a0('0xc')]('user:%s',_0x2bc45b[_0x72a0('0xd')]))[_0x72a0('0xb')](_0x72a0('0xe'),_0x2bc45b);var _0x44d7cf=_0x169dc2||{};var _0x975c27=_0x55b3e9['split']('.');var _0x130797={'uniqueid':_0x1d32e9,'channel':_0x975c27[0x0],'id':_0x975c27[0x1],'title':_0x975c27[0x0]+_0x72a0('0xf'),'interactionId':_0x975c27[0x2],'queue':_0x5c1d1e?_0x5c1d1e[_0x72a0('0xd')]:null,'sound':_0x44d7cf[_0x72a0('0x10')][_0x72a0('0x11')],'shake':_0x44d7cf[_0x72a0('0x10')][_0x72a0('0x12')]};try{if(!_0x44d7cf['body']){_0x44d7cf['body']={};}if(_0x5c1d1e){_0x44d7cf[_0x72a0('0x13')][_0x72a0('0x14')]=_0x5c1d1e;}else if(_0x44d7cf[_0x72a0('0x13')][_0x72a0('0x14')]){delete _0x44d7cf[_0x72a0('0x13')][_0x72a0('0x14')];}_0x130797['msg']=utils[_0x72a0('0x15')](_0x44d7cf[_0x72a0('0x10')][_0x72a0('0x16')],_0x44d7cf);}catch(_0xb7e22d){_0x130797[_0x72a0('0x17')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x72a0('0x18')](util[_0x72a0('0xc')](_0x72a0('0x19'),_0x1d32e9,_0xb7e22d['message']));}io['to'](util[_0x72a0('0xc')](_0x72a0('0x1a'),_0x2bc45b[_0x72a0('0xd')]))[_0x72a0('0xb')](util['format'](_0x72a0('0x1b'),_0x22270e?'save':_0x72a0('0x1c')),_0x130797);}function writeLog(_0x315413,_0xde058c,_0x5c7479){return logger[_0x72a0('0x1d')](util[_0x72a0('0xc')](_0x72a0('0x1e'),_0x315413,_0xde058c[_0x72a0('0xd')],_0x5c7479));}exports['isAgentAvailable']=function(_0x38a7ba,_0x390464,_0x1ddd54,_0x23b918){if(_0x390464[_0x72a0('0x1f')]){writeLog(_0x38a7ba,_0x390464,_0x72a0('0x20'));return![];}if(!_0x390464['online']){writeLog(_0x38a7ba,_0x390464,'OFFLINE');return![];}if(_0x390464[_0x1ddd54+_0x72a0('0x21')]){writeLog(_0x38a7ba,_0x390464,_0x72a0('0x22'));return![];}if(_0x23b918&&_0x390464[_0x72a0('0x23')](_0x1ddd54+_0x72a0('0x24'))&&_0x390464[_0x72a0('0x23')](_0x1ddd54+_0x72a0('0x25'))){if(_0x390464[_0x1ddd54+_0x72a0('0x24')]>0x0&&_0x390464[_0x1ddd54+_0x72a0('0x25')]>=_0x390464[_0x1ddd54+_0x72a0('0x24')]){writeLog(_0x38a7ba,_0x390464,_0x1ddd54[_0x72a0('0x26')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x72a0('0x27')]=function(_0x553641,_0xc22d18,_0x2928f6,_0x1773ea,_0x177a3a){return sendNotification(!![],_0x553641,_0xc22d18,_0x2928f6,_0x1773ea,_0x177a3a);};exports[_0x72a0('0x28')]=function(_0x12eda2,_0x23c96a,_0x916733,_0x4ba037,_0x41efc1){return sendNotification(![],_0x12eda2,_0x23c96a,_0x916733,_0x4ba037,_0x41efc1);};exports[_0x72a0('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 afb1b2f..441df2a 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 _0x80ce=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty'];(function(_0x18063f,_0x3efbaf){var _0x116771=function(_0x366444){while(--_0x366444){_0x18063f['push'](_0x18063f['shift']());}};_0x116771(++_0x3efbaf);}(_0x80ce,0xae));var _0xe80c=function(_0x501396,_0x4a5460){_0x501396=_0x501396-0x0;var _0xfe0679=_0x80ce[_0x501396];return _0xfe0679;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0xe80c('0x0'));var logger=require(_0xe80c('0x1'))('routing');var system=schema({'command':{'type':_0xe80c('0x2'),'required':!![],'message':_0xe80c('0x3')}});exports[_0xe80c('0x4')]=function(_0x57043c,_0x4cb700){return function(_0x4b331a){try{var _0x48d62c={'command':_0x4cb700[0x0]};var _0x19b480=system[_0xe80c('0x5')](_0x48d62c,{'typecast':!![]});if(_0x19b480[_0xe80c('0x6')]){logger['error']('[%s][SYSTEM]\x20%s',_0x57043c,_[_0xe80c('0x7')](_0x19b480,_0xe80c('0x8'))['join'](',\x20'));logger[_0xe80c('0x9')](_0xe80c('0xa'),_0x57043c);_0x4b331a[_0xe80c('0xb')]();}else{var _0x3cfbeb=this;var _0x75b98f=utils['getMustacheRender'](_0x4cb700[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x57043c,_0x75b98f);sh[_0xe80c('0xc')](_[_0xe80c('0xd')](_0x75b98f),function(_0x2dcc9b,_0x3abe79){logger[_0xe80c('0x9')](_0xe80c('0xe'),_0x57043c,_0x2dcc9b);if(_0x2dcc9b==0x0){var _0xefba08=_0x3abe79[_0xe80c('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0xe80c('0x10')](_0x4cb700[0x1])||_[_0xe80c('0x11')](_0x4cb700[0x1])){logger[_0xe80c('0x9')](_0xe80c('0x12'),_0x57043c);_0x3cfbeb[_0xe80c('0x13')][_0x4cb700[0x1]]=_0xefba08;}else{logger['info'](_0xe80c('0x14'),_0x57043c,_0x4cb700[0x1],_0xefba08);_0x3cfbeb['body'][_0x4cb700[0x1]]=_0xefba08;}}_0x4b331a[_0xe80c('0xb')]();});}}catch(_0x2a118e){logger[_0xe80c('0x15')]('[%s][SYSTEM]\x20%s',_0x57043c,_[_0xe80c('0x16')](_0x2a118e)?JSON[_0xe80c('0x17')](_0x2a118e):_0x2a118e);logger['info'](_0xe80c('0xa'),_0x57043c);_0x4b331a[_0xe80c('0xb')]();}};}; \ No newline at end of file +var _0xd3a6=['stringify','validate','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject'];(function(_0x31b2a5,_0x2480b4){var _0x198fa4=function(_0x1414b9){while(--_0x1414b9){_0x31b2a5['push'](_0x31b2a5['shift']());}};_0x198fa4(++_0x2480b4);}(_0xd3a6,0x181));var _0x6d3a=function(_0x97a9ac,_0x38d2cc){_0x97a9ac=_0x97a9ac-0x0;var _0x58de49=_0xd3a6[_0x97a9ac];return _0x58de49;};'use strict';var schema=require(_0x6d3a('0x0'));var sh=require('shelljs');var _=require(_0x6d3a('0x1'));var utils=require(_0x6d3a('0x2'));var logger=require(_0x6d3a('0x3'))(_0x6d3a('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x6d3a('0x5')}});exports[_0x6d3a('0x6')]=function(_0x14b197,_0x5ae27f){return function(_0x2b9f7a){try{var _0x41951b={'command':_0x5ae27f[0x0]};var _0x536a70=system[_0x6d3a('0x0')](_0x41951b,{'typecast':!![]});if(_0x536a70[_0x6d3a('0x7')]){logger[_0x6d3a('0x8')](_0x6d3a('0x9'),_0x14b197,_[_0x6d3a('0xa')](_0x536a70,'message')['join'](',\x20'));logger['info'](_0x6d3a('0xb'),_0x14b197);_0x2b9f7a[_0x6d3a('0xc')]();}else{var _0x1a4000=this;var _0xe59ec9=utils[_0x6d3a('0xd')](_0x5ae27f[0x0],this);logger[_0x6d3a('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x14b197,_0xe59ec9);sh[_0x6d3a('0xf')](_['trim'](_0xe59ec9),function(_0x2ec3ea,_0x529ea6){logger[_0x6d3a('0xe')](_0x6d3a('0x10'),_0x14b197,_0x2ec3ea);if(_0x2ec3ea==0x0){var _0x2eb423=_0x529ea6[_0x6d3a('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x5ae27f[0x1])||_[_0x6d3a('0x12')](_0x5ae27f[0x1])){logger[_0x6d3a('0xe')](_0x6d3a('0x13'),_0x14b197);_0x1a4000[_0x6d3a('0x14')][_0x5ae27f[0x1]]=_0x2eb423;}else{logger[_0x6d3a('0xe')](_0x6d3a('0x15'),_0x14b197,_0x5ae27f[0x1],_0x2eb423);_0x1a4000[_0x6d3a('0x14')][_0x5ae27f[0x1]]=_0x2eb423;}}_0x2b9f7a[_0x6d3a('0xc')]();});}}catch(_0x1c6ab1){logger[_0x6d3a('0x8')]('[%s][SYSTEM]\x20%s',_0x14b197,_[_0x6d3a('0x16')](_0x1c6ab1)?JSON[_0x6d3a('0x17')](_0x1c6ab1):_0x1c6ab1);logger[_0x6d3a('0xe')](_0x6d3a('0xb'),_0x14b197);_0x2b9f7a[_0x6d3a('0xc')]();}};}; \ 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 53f7458..36cb1e4 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 _0xa544=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','finally','isObject','stringify','lodash'];(function(_0x23b7c4,_0x3e80c2){var _0x1aa773=function(_0x1c1233){while(--_0x1c1233){_0x23b7c4['push'](_0x23b7c4['shift']());}};_0x1aa773(++_0x3e80c2);}(_0xa544,0xc3));var _0x4a54=function(_0x5ec0e8,_0x2cc210){_0x5ec0e8=_0x5ec0e8-0x0;var _0x531953=_0xa544[_0x5ec0e8];return _0x531953;};'use strict';var schema=require('validate');var _=require(_0x4a54('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x4a54('0x1')),'smsInteraction':require(_0x4a54('0x2')),'mailInteraction':require(_0x4a54('0x3')),'faxInteraction':require(_0x4a54('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x4a54('0x5'))('routing');var tag=schema({'tag':{'type':_0x4a54('0x6'),'required':!![],'message':_0x4a54('0x7')}});exports[_0x4a54('0x8')]=function(_0x521c40,_0xfbca4a,_0x453084,_0x54c6dc){return function(_0x58891f){try{var _0x2ce2f0={'tag':_0xfbca4a[0x0]};var _0x4765c6=tag[_0x4a54('0x9')](_0x2ce2f0,{'typecast':!![]});if(_0x4765c6[_0x4a54('0xa')]){logger['error'](_0x4a54('0xb'),_0x521c40,_[_0x4a54('0xc')](_0x4765c6,_0x4a54('0xd'))[_0x4a54('0xe')](',\x20'));logger[_0x4a54('0xf')](_0x4a54('0x10'),_0x521c40);_0x58891f[_0x4a54('0x11')]();}else{var _0x5cb057={'ids':[_0xfbca4a[0x0]]};if(rpc[_0x54c6dc[_0x4a54('0x12')]+_0x4a54('0x13')]){rpc[_0x54c6dc[_0x4a54('0x12')]+'Interaction']['addTags'](_0x54c6dc[_0x4a54('0x14')]['id'],_0x5cb057)[_0x4a54('0x15')](function(_0x54272b){logger['info'](_0x4a54('0x16'),_0x521c40,_0xfbca4a[0x1],_0x54c6dc['channel'],_0x54c6dc[_0x4a54('0x14')]['id']);})[_0x4a54('0x17')](function(_0x13d162){logger[_0x4a54('0x18')]('[%s][TAG]\x20%s',_0x521c40,JSON['stringify'](_0x13d162));logger[_0x4a54('0xf')](_0x4a54('0x10'),_0x521c40);})[_0x4a54('0x19')](function(){_0x58891f['next']();});}}}catch(_0x56ffb1){logger[_0x4a54('0x18')]('[%s][TAG]\x20%s',_0x521c40,_[_0x4a54('0x1a')](_0x56ffb1)?JSON[_0x4a54('0x1b')](_0x56ffb1):_0x56ffb1);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x521c40);_0x58891f[_0x4a54('0x11')]();}};}; \ No newline at end of file +var _0xe437=['../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','channel','Interaction','addTags','interaction','then','info','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction'];(function(_0x252630,_0x549054){var _0x4aba81=function(_0x18612f){while(--_0x18612f){_0x252630['push'](_0x252630['shift']());}};_0x4aba81(++_0x549054);}(_0xe437,0x7c));var _0x7e43=function(_0x15132c,_0x57220d){_0x15132c=_0x15132c-0x0;var _0x55cf73=_0xe437[_0x15132c];return _0x55cf73;};'use strict';var schema=require(_0x7e43('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x7e43('0x1')),'openchannelInteraction':require(_0x7e43('0x2')),'smsInteraction':require(_0x7e43('0x3')),'mailInteraction':require(_0x7e43('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x7e43('0x5'))};var logger=require(_0x7e43('0x6'))(_0x7e43('0x7'));var tag=schema({'tag':{'type':_0x7e43('0x8'),'required':!![],'message':_0x7e43('0x9')}});exports[_0x7e43('0xa')]=function(_0x2c91d1,_0x57b6c6,_0x18c2ce,_0x365317){return function(_0x4c3bf2){try{var _0x10a6d7={'tag':_0x57b6c6[0x0]};var _0x16e348=tag['validate'](_0x10a6d7,{'typecast':!![]});if(_0x16e348[_0x7e43('0xb')]){logger[_0x7e43('0xc')]('[%s][TAG]\x20%s',_0x2c91d1,_[_0x7e43('0xd')](_0x16e348,_0x7e43('0xe'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2c91d1);_0x4c3bf2['next']();}else{var _0xe97ee5={'ids':[_0x57b6c6[0x0]]};if(rpc[_0x365317[_0x7e43('0xf')]+_0x7e43('0x10')]){rpc[_0x365317['channel']+_0x7e43('0x10')][_0x7e43('0x11')](_0x365317[_0x7e43('0x12')]['id'],_0xe97ee5)[_0x7e43('0x13')](function(_0x2e8345){logger[_0x7e43('0x14')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x2c91d1,_0x57b6c6[0x1],_0x365317['channel'],_0x365317['interaction']['id']);})[_0x7e43('0x15')](function(_0x4e871b){logger['error'](_0x7e43('0x16'),_0x2c91d1,JSON[_0x7e43('0x17')](_0x4e871b));logger['info'](_0x7e43('0x18'),_0x2c91d1);})['finally'](function(){_0x4c3bf2[_0x7e43('0x19')]();});}}}catch(_0x279254){logger['error']('[%s][TAG]\x20%s',_0x2c91d1,_['isObject'](_0x279254)?JSON[_0x7e43('0x17')](_0x279254):_0x279254);logger[_0x7e43('0x14')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2c91d1);_0x4c3bf2[_0x7e43('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index a12c2fb..0e6b180 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bdb=['stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','stringify','utf8','POST','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s'];(function(_0x59f173,_0x180a51){var _0x3645e6=function(_0x594518){while(--_0x594518){_0x59f173['push'](_0x59f173['shift']());}};_0x3645e6(++_0x180a51);}(_0x8bdb,0x17e));var _0xb8bd=function(_0x724bba,_0x190240){_0x724bba=_0x724bba-0x0;var _0x28e9c9=_0x8bdb[_0x724bba];return _0x28e9c9;};'use strict';var rp=require(_0xb8bd('0x0'));var logger=require('../../../../config/logger')(_0xb8bd('0x1'));var _=require(_0xb8bd('0x2'));var arr=[];exports['consequence']=function(_0x5c89f1,_0x3c488b){return function(_0x2aa087){var _0x14fcd2=_0x3c488b[0xa];var _0x207055=_0x3c488b[0xb];var _0x1bb859=_0x3c488b[0xc];var _0x4f69dc=_0x3c488b[0xd];var _0x409606=_0x3c488b[0xe];var _0x32c3ad=_0x3c488b[0xf][_0xb8bd('0x3')](/\n/g,_0xb8bd('0x4'));var _0x3ab4e8=_0x3c488b[0x10][_0xb8bd('0x3')](/\n/g,'\x20');if(!arr[_0xb8bd('0x5')](_0x207055)){arr[_0xb8bd('0x6')](_0x207055);var _0x382eb2=_0x3c488b[0x3];var _0x318568=_0x3c488b[0x4];var _0x25b1d7=_0x3c488b[0x1];var _0xec909d=_0x3c488b[0x0];var _0x53387b={};_0x53387b[_0xb8bd('0x7')]=_0x3c488b[0x8]+'?params='+_0x1bb859+'|'+_0x14fcd2+'|'+_0x4f69dc+'|'+_0x207055+'|'+_0x409606;_0x53387b[_0xb8bd('0x8')]=_0x3c488b[0x7]+_0xb8bd('0x9')+_0x1bb859+'|'+_0x14fcd2+'|'+_0x4f69dc+'|'+_0x207055+'|'+_0x409606+'|'+_0x32c3ad+'|'+_0x3ab4e8;_0x53387b[_0xb8bd('0xa')]=_0x3c488b[0x9];var _0x1aaa60={};_0x1aaa60[_0xb8bd('0xb')]=_0xb8bd('0xc');_0x1aaa60[_0xb8bd('0xd')]='login';var _0x47ed4=[];_0x47ed4['push'](_0x3c488b[0x2]);_0x47ed4[_0xb8bd('0x6')](_0x3c488b[0x5]);_0x47ed4['push'](_0x3c488b[0x6]);_0x1aaa60['params']=_0x47ed4;_0x1aaa60['id']=0x1;var _0x5248f8=JSON[_0xb8bd('0xe')](_0x1aaa60);var _0x4b70d2={'encoding':_0xb8bd('0xf'),'method':_0xb8bd('0x10'),'timeout':0x2710,'url':_0x382eb2,'headers':{'Content-Type':_0xb8bd('0x11')},'body':_0x5248f8};return rp(_0x4b70d2)[_0xb8bd('0x12')](function(_0x245b7){const _0x462b0b=JSON['parse'](_0x245b7);if(!_0x462b0b[_0xb8bd('0x13')][_0xb8bd('0x14')]){throw new Error(_0xb8bd('0x15'));}var _0x352239=_0x207055;var _0x59bb53=_0xb8bd('0x16')+_0x25b1d7+_0xb8bd('0x17')+_0xec909d+'&sessionId='+_0x352239+_0xb8bd('0x18')+JSON[_0xb8bd('0xe')](_0x53387b);var _0x40080e=_0x318568+'?'+_0x59bb53;return rp(_0x40080e);})[_0xb8bd('0x12')](function(_0x1049d1){logger['info'](_0xb8bd('0x19'),_0x5c89f1,_0x1049d1);_0x2aa087[_0xb8bd('0x1a')]();})[_0xb8bd('0x1b')](function(_0x4e76ae){logger[_0xb8bd('0x1c')](_0xb8bd('0x1d'),_0x5c89f1,_[_0xb8bd('0x1e')](_0x4e76ae)?JSON[_0xb8bd('0xe')](_0x4e76ae):_0x4e76ae);_0x2aa087['stop']();});}else{logger[_0xb8bd('0x1f')](_0xb8bd('0x20'),_0x5c89f1);_0x2aa087[_0xb8bd('0x21')]();}};}; \ No newline at end of file +var _0xe592=['Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','replace','\x20-\x20','urlOnAnswer','?params=','urlOnRing','title','method','login','push','params','stringify','utf8','POST','application/json-rpc','logged'];(function(_0x361f2b,_0x2379b1){var _0x1d7863=function(_0xba0207){while(--_0xba0207){_0x361f2b['push'](_0x361f2b['shift']());}};_0x1d7863(++_0x2379b1);}(_0xe592,0xd6));var _0x2e59=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0xe592[_0x7791d5];return _0x5ce288;};'use strict';var rp=require('request-promise');var logger=require(_0x2e59('0x0'))(_0x2e59('0x1'));var _=require(_0x2e59('0x2'));var arr=[];exports['consequence']=function(_0x5a8403,_0x4775e1){return function(_0x12c14a){var _0x44b672=_0x4775e1[0xa];var _0x1990a4=_0x4775e1[0xb];var _0x4765c8=_0x4775e1[0xc];var _0x1a09cf=_0x4775e1[0xd];var _0x32824b=_0x4775e1[0xe];var _0x45c137=_0x4775e1[0xf][_0x2e59('0x3')](/\n/g,_0x2e59('0x4'));var _0x28e74d=_0x4775e1[0x10][_0x2e59('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x1990a4)){arr['push'](_0x1990a4);var _0xda15ba=_0x4775e1[0x3];var _0x240d9d=_0x4775e1[0x4];var _0x2429c4=_0x4775e1[0x1];var _0x279d11=_0x4775e1[0x0];var _0x55ffe7={};_0x55ffe7[_0x2e59('0x5')]=_0x4775e1[0x8]+_0x2e59('0x6')+_0x4765c8+'|'+_0x44b672+'|'+_0x1a09cf+'|'+_0x1990a4+'|'+_0x32824b;_0x55ffe7[_0x2e59('0x7')]=_0x4775e1[0x7]+_0x2e59('0x6')+_0x4765c8+'|'+_0x44b672+'|'+_0x1a09cf+'|'+_0x1990a4+'|'+_0x32824b+'|'+_0x45c137+'|'+_0x28e74d;_0x55ffe7[_0x2e59('0x8')]=_0x4775e1[0x9];var _0x7c773d={};_0x7c773d['jsonrpc']='2.0';_0x7c773d[_0x2e59('0x9')]=_0x2e59('0xa');var _0x1574be=[];_0x1574be['push'](_0x4775e1[0x2]);_0x1574be['push'](_0x4775e1[0x5]);_0x1574be[_0x2e59('0xb')](_0x4775e1[0x6]);_0x7c773d[_0x2e59('0xc')]=_0x1574be;_0x7c773d['id']=0x1;var _0x55f9bf=JSON[_0x2e59('0xd')](_0x7c773d);var _0x21a2ad={'encoding':_0x2e59('0xe'),'method':_0x2e59('0xf'),'timeout':0x2710,'url':_0xda15ba,'headers':{'Content-Type':_0x2e59('0x10')},'body':_0x55f9bf};return rp(_0x21a2ad)['then'](function(_0x1ef31f){const _0x23fb19=JSON['parse'](_0x1ef31f);if(!_0x23fb19['result'][_0x2e59('0x11')]){throw new Error(_0x2e59('0x12'));}var _0x37be8e=_0x1990a4;var _0x4631a4=_0x2e59('0x13')+_0x2429c4+'&serviceId='+_0x279d11+'&sessionId='+_0x37be8e+_0x2e59('0x14')+JSON['stringify'](_0x55ffe7);var _0x45d4fc=_0x240d9d+'?'+_0x4631a4;return rp(_0x45d4fc);})[_0x2e59('0x15')](function(_0x10568e){logger[_0x2e59('0x16')](_0x2e59('0x17'),_0x5a8403,_0x10568e);_0x12c14a[_0x2e59('0x18')]();})[_0x2e59('0x19')](function(_0x527aaa){logger['error']('[%s][TVOX]\x20%s',_0x5a8403,_[_0x2e59('0x1a')](_0x527aaa)?JSON[_0x2e59('0xd')](_0x527aaa):_0x527aaa);_0x12c14a[_0x2e59('0x18')]();});}else{logger[_0x2e59('0x16')](_0x2e59('0x1b'),_0x5a8403);_0x12c14a[_0x2e59('0x1c')]();}};}; \ 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 72342b5..dbe74eb 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x131111,_0x2fc660){var _0x477a26=function(_0x24f69c){while(--_0x24f69c){_0x131111['push'](_0x131111['shift']());}};_0x477a26(++_0x2fc660);}(_0xe706,0xa3));var _0x6e70=function(_0x431c26,_0x4b8f47){_0x431c26=_0x431c26-0x0;var _0x3092fd=_0xe706[_0x431c26];return _0x3092fd;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x58df84,_0xd7d169){var _0x55dced=function(_0xe23020){while(--_0xe23020){_0x58df84['push'](_0x58df84['shift']());}};_0x55dced(++_0xd7d169);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 01c718d..105830d 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 _0x2917=['whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','autoreply','split','mail','push','slice','appdata','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','.js','execute','stringify','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2917,0x142));var _0x7291=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x2917[_0x671369];return _0x33f2b4;};'use strict';var _=require(_0x7291('0x0'));var util=require(_0x7291('0x1'));var path=require(_0x7291('0x2'));var fs=require('fs');var jayson=require(_0x7291('0x3'));var BPromise=require(_0x7291('0x4'));var uuid=require(_0x7291('0x5'));var utils=require(_0x7291('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x7291('0x7'));var rpc={'openchannelQueueReport':require(_0x7291('0x8')),'mailQueueReport':require(_0x7291('0x9')),'chatQueueReport':require(_0x7291('0xa')),'smsQueueReport':require(_0x7291('0xb')),'faxQueueReport':require(_0x7291('0xc')),'whatsappQueueReport':require(_0x7291('0xd'))};var RuleEngine=require(_0x7291('0xe'));function getId(_0x452fc5,_0xb013b3,_0x3c7f38){return util[_0x7291('0xf')](_0x7291('0x10'),_0x452fc5,_0xb013b3||0x0,_0x3c7f38||0x0);}function getIntervals(_0x15298e,_0x3efe33){var _0x5d1b56=[];if(!_[_0x7291('0x11')](_0x3efe33[_0x7291('0x12')])&&!_[_0x7291('0x11')](_0x15298e[_0x3efe33[_0x7291('0x12')]])&&!_[_0x7291('0x11')](_0x15298e[_0x3efe33[_0x7291('0x12')]]['Intervals'])){_0x5d1b56=_['map'](_0x15298e[_0x3efe33[_0x7291('0x12')]][_0x7291('0x13')],_0x7291('0x14'));}else if(!_[_0x7291('0x11')](_0x3efe33[_0x7291('0x14')])){_0x5d1b56=[_0x3efe33[_0x7291('0x14')]];}return _0x5d1b56;}exports[_0x7291('0x15')]=function(_0x54e3e6){_0x54e3e6[_0x7291('0x16')]={};return new BPromise(function(_0x1b48d2,_0x1777e1){var _0x51d353={'Start':function(_0x55cca6){var _0x34808c=this;return new Promise(function(_0x304a33,_0x431ccd){if(_0x55cca6){try{var _0x12aa0f=[];var _0x427602=getId(_0x55cca6[_0x7291('0x17')],_0x55cca6['message']?_0x55cca6[_0x7291('0x18')]['id']:0x0,_0x55cca6[_0x7291('0x19')]?_0x55cca6[_0x7291('0x19')]['id']:0x0);if(_0x55cca6[_0x7291('0x1a')]&&_[_0x7291('0x1b')](_0x55cca6['applications'])&&_0x55cca6[_0x7291('0x1a')]['length']){for(var _0x4258a1=0x0;_0x4258a1<_0x55cca6[_0x7291('0x1a')][_0x7291('0x1c')];_0x4258a1+=0x1){var _0x5229d6=_0x55cca6[_0x7291('0x1a')][_0x4258a1];if(fs['existsSync'](path[_0x7291('0x1d')](__dirname,_0x7291('0x1a'),_0x5229d6['app']+'.js'))){var _0x56bf5f=[];switch(_0x5229d6[_0x7291('0x1e')]['toLowerCase']()){case _0x7291('0x1f'):var _0x251649=_0x5229d6['appdata'][_0x7291('0x20')](',');if(_0x55cca6['channel']===_0x7291('0x21')){_0x56bf5f[_0x7291('0x22')](_0x251649[0x0]);_0x56bf5f['push'](_0x251649[0x1]);_0x56bf5f[_0x7291('0x22')](_0x251649[_0x7291('0x23')](0x2,_0x251649[_0x7291('0x1c')])[_0x7291('0x1d')](','));}else{_0x56bf5f[_0x7291('0x22')](_0x251649[0x0]);_0x56bf5f[_0x7291('0x22')](_0x251649[_0x7291('0x23')](0x1,_0x251649[_0x7291('0x1c')])[_0x7291('0x1d')](','));}break;case'dialogflow':var _0x35d666=_0x5229d6[_0x7291('0x24')]['split'](',');_0x56bf5f[_0x7291('0x22')](_0x35d666[0x0]);_0x56bf5f[_0x7291('0x22')](_0x35d666[0x1]);_0x56bf5f['push'](_0x35d666[_0x7291('0x23')](0x2,_0x35d666[_0x7291('0x1c')])['join'](','));break;case _0x7291('0x25'):var _0x10e006=_0x5229d6[_0x7291('0x24')]['split'](',');_0x56bf5f[_0x7291('0x22')](_0x10e006[0x0]);_0x56bf5f['push'](_0x10e006[0x1]);_0x56bf5f['push'](_0x10e006[0x2]);_0x56bf5f[_0x7291('0x22')](_0x10e006[0x3]);_0x56bf5f[_0x7291('0x22')](_0x10e006[_0x7291('0x23')](0x4,_0x10e006[_0x7291('0x1c')])[_0x7291('0x1d')](','));break;case _0x7291('0x26'):var _0x438542=_0x5229d6[_0x7291('0x24')][_0x7291('0x20')](',');_0x56bf5f[_0x7291('0x22')](_0x438542[0x0]);_0x56bf5f[_0x7291('0x22')](_0x438542[0x1]);_0x56bf5f[_0x7291('0x22')](_0x438542[0x2]);_0x56bf5f[_0x7291('0x22')](_0x438542[0x3]);_0x56bf5f['push'](_0x438542[_0x7291('0x23')](0x4,_0x438542['length'])['join'](','));break;case'message':_0x56bf5f[_0x7291('0x22')](_0x5229d6[_0x7291('0x24')]);break;case _0x7291('0x27'):_0x56bf5f[_0x7291('0x22')](_0x5229d6[_0x7291('0x28')]);_0x56bf5f['push'](_0x5229d6[_0x7291('0x24')]);break;case _0x7291('0x29'):var _0x54b8b9=utils[_0x7291('0x2a')](_0x55cca6[_0x7291('0x2b')][_0x7291('0x2c')],_0x55cca6);var _0x16afa5=_0x5229d6['appdata']['split'](',');_0x56bf5f[_0x7291('0x22')](_0x16afa5[0x0]);_0x56bf5f[_0x7291('0x22')](_0x16afa5[0x1]);_0x56bf5f['push'](_0x16afa5[0x2]);_0x56bf5f['push'](_0x16afa5[0x3]);_0x56bf5f[_0x7291('0x22')](_0x16afa5[0x4]);_0x56bf5f[_0x7291('0x22')](_0x16afa5[0x5]);_0x56bf5f[_0x7291('0x22')](_0x16afa5[0x6]);_0x56bf5f[_0x7291('0x22')](_0x16afa5[0x7]);_0x56bf5f[_0x7291('0x22')](_0x16afa5[0x8]);_0x56bf5f['push'](_0x16afa5[0x9]);_0x56bf5f['push'](_0x16afa5[0xa]);_0x56bf5f[_0x7291('0x22')](_0x55cca6[_0x7291('0x19')]['id']);_0x56bf5f[_0x7291('0x22')](_0x55cca6[_0x7291('0x18')]['id']);_0x56bf5f[_0x7291('0x22')](_0x5229d6['ChatWebsiteId']);_0x56bf5f[_0x7291('0x22')](_0x55cca6['interaction'][_0x7291('0x2d')]);_0x56bf5f[_0x7291('0x22')](_0x55cca6['body']['body']);_0x56bf5f[_0x7291('0x22')](_0x54b8b9);break;default:_0x56bf5f=_[_0x7291('0x11')](_0x5229d6[_0x7291('0x24')])?[]:_0x5229d6[_0x7291('0x24')][_0x7291('0x20')](',');}var _0x205eb8={'id':util[_0x7291('0xf')](_0x7291('0x2e'),_0x427602,_0x5229d6['id'],_0x5229d6[_0x7291('0x1e')]),'condition':require(_0x7291('0x2f'))[_0x7291('0x30')](_0x427602,getIntervals(_0x54e3e6[_0x7291('0x31')],_0x5229d6),_0x54e3e6),'consequence':require('./applications/'+_0x5229d6[_0x7291('0x1e')])[_0x7291('0x32')](_0x427602,_0x56bf5f,_0x54e3e6,_0x55cca6),'p':_0x5229d6[_0x7291('0x33')]||0x0};logger[_0x7291('0x34')](_0x7291('0x35'),_0x205eb8['id'],_0x7291('0x36'),getIntervals(_0x54e3e6['intervals'],_0x5229d6)[_0x7291('0x1d')](_0x7291('0x37')));_0x12aa0f[_0x7291('0x22')](_0x205eb8);}else{logger[_0x7291('0x38')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x7291('0x1d')](__dirname,_0x7291('0x1a'),_0x5229d6[_0x7291('0x1e')]+_0x7291('0x39')));}}_0x54e3e6[_0x7291('0x16')][_0x427602]=new RuleEngine(_0x12aa0f);_0x54e3e6[_0x7291('0x16')][_0x427602][_0x7291('0x3a')](_0x55cca6,function(_0x24ba49){logger[_0x7291('0x34')]('Applications\x20executed',JSON[_0x7291('0x3b')](_0x24ba49['matchPath']));if(_0x54e3e6[_0x7291('0x16')][_0x427602]){_0x54e3e6[_0x7291('0x16')][_0x427602][_0x7291('0x3c')](_0x7291('0x3d'));}});return _0x304a33({'code':0xc8,'message':_0x55cca6});}else{logger[_0x7291('0x34')](_0x7291('0x3e'));return _0x304a33({'code':0xc8,'message':_0x55cca6});}}catch(_0x45bd71){logger[_0x7291('0x38')](_0x45bd71['stack']);return _0x431ccd(_0x34808c[_0x7291('0x38')](0x1f4,_0x45bd71));}}return _0x431ccd(_0x7291('0x3f'));});},'AcceptMessage':function(_0x228de8){var _0x1bcd17=this;return new Promise(function(_0x415f30,_0xc9e37e){if(_0x228de8[_0x7291('0x40')]&&_0x228de8[_0x7291('0x40')]['id']){if(_0x54e3e6[_0x7291('0x41')][_0x228de8[_0x7291('0x40')]['id']]){_0x54e3e6[_0x7291('0x41')][_0x228de8[_0x7291('0x40')]['id']][_0x7291('0x42')]=![];_0x54e3e6[_0x7291('0x41')][_0x228de8[_0x7291('0x40')]['id']][_0x7291('0x43')]=undefined;}}if(_0x228de8['message']&&_0x228de8[_0x7291('0x18')]['id']){try{var _0x1518d3=getId(_0x228de8['channel'],_0x228de8[_0x7291('0x18')]?_0x228de8[_0x7291('0x18')]['id']:0x0,_0x228de8[_0x7291('0x19')]?_0x228de8['interaction']['id']:0x0);if(_0x54e3e6['rules'][_0x1518d3]){_0x54e3e6[_0x7291('0x16')][_0x1518d3]['emit']('end');if(rpc[_0x228de8[_0x7291('0x17')]+_0x7291('0x44')]){rpc[_0x228de8[_0x7291('0x17')]+'QueueReport'][_0x7291('0x45')](_0x1518d3,{'UserId':_0x228de8[_0x7291('0x18')][_0x7291('0x46')]})[_0x7291('0x47')](function(_0x57fce5){logger[_0x7291('0x38')]('error\x20update\x20queue\x20report');});}}return _0x415f30({'code':0xc8,'message':_0x228de8});}catch(_0x306613){logger[_0x7291('0x38')](_0x306613[_0x7291('0x48')]);return _0xc9e37e(_0x1bcd17[_0x7291('0x38')](0x1f4,_0x306613));}}logger[_0x7291('0x38')](_0x7291('0x49'));return _0xc9e37e(_0x1bcd17[_0x7291('0x38')](0x1f4,_0x7291('0x49')));});},'RejectMessage':function(_0x2f4165){var _0x187143=this;return new Promise(function(_0x4e1624,_0x42121a){if(_0x2f4165[_0x7291('0x40')]&&_0x2f4165['agent']['id']){try{if(_0x54e3e6[_0x7291('0x41')][_0x2f4165[_0x7291('0x40')]['id']]){_0x54e3e6['agents'][_0x2f4165['agent']['id']][_0x7291('0x42')]=![];_0x54e3e6['agents'][_0x2f4165[_0x7291('0x40')]['id']][_0x7291('0x43')]=undefined;}return _0x4e1624({'code':0xc8,'message':_0x2f4165});}catch(_0x573134){logger[_0x7291('0x38')](_0x573134[_0x7291('0x48')]);return _0x42121a(_0x187143[_0x7291('0x38')](0x1f4,_0x573134));}}logger[_0x7291('0x38')]('message\x20is\x20empty');return _0x42121a(_0x187143['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x3127a1){var _0x871e95=this;return new Promise(function(_0x3379a1,_0x26d312){if(_0x3127a1[_0x7291('0x17')]&&_0x3127a1['interaction']&&_0x3127a1[_0x7291('0x19')]['id']){try{var _0x2d380a=getId(_0x3127a1[_0x7291('0x17')],_0x3127a1[_0x7291('0x18')]?_0x3127a1['message']['id']:0x0,_0x3127a1[_0x7291('0x19')]?_0x3127a1[_0x7291('0x19')]['id']:0x0);if(_0x54e3e6[_0x7291('0x16')][_0x2d380a]){_0x54e3e6['rules'][_0x2d380a][_0x7291('0x3c')](_0x7291('0x4a'));}return _0x3379a1({'code':0xc8,'message':_0x3127a1});}catch(_0x5b24a3){logger[_0x7291('0x38')](_0x5b24a3[_0x7291('0x48')]);return _0x26d312(_0x871e95[_0x7291('0x38')](0x1f4,_0x5b24a3));}}logger[_0x7291('0x38')](_0x7291('0x49'));return _0x26d312(_0x871e95['error'](0x1f4,_0x7291('0x49')));});},'AgentCapacity':function(_0x3498d6){var _0x5c4e66=this;return new Promise(function(_0x13a56b,_0x3a0edd){if(_0x54e3e6[_0x7291('0x41')][_0x7291('0x4b')](_0x3498d6['id'])){for(var _0x351d71 in _0x3498d6[_0x7291('0x4c')]){if(_0x3498d6[_0x7291('0x4c')]['hasOwnProperty'](_0x351d71)){if(_0x54e3e6[_0x7291('0x41')][_0x3498d6['id']][_0x7291('0x4b')](_0x351d71+'CurrentCapacity')){_0x54e3e6[_0x7291('0x41')][_0x3498d6['id']][_0x351d71+_0x7291('0x4d')]=parseInt(_0x3498d6[_0x7291('0x4c')][_0x351d71],0xa);}}}_0x54e3e6[_0x7291('0x41')][_0x3498d6['id']][_0x7291('0x4e')]();return _0x13a56b({'code':0xc8,'message':_0x54e3e6[_0x7291('0x41')][_0x3498d6['id']]});}else{return _0x3a0edd(_0x5c4e66[_0x7291('0x38')](0x1f4,_0x7291('0x4f')));}});},'Agents':function(_0x53b8b8){return new Promise(function(_0x45903a,_0x1a7ebe){var _0x176f31=_['values'](_0x54e3e6[_0x7291('0x41')]);_0x45903a({'count':_0x176f31[_0x7291('0x1c')],'rows':_0x176f31});});},'ChatQueues':function(_0x10739f){return new Promise(function(_0x834e39,_0x5c7e4c){var _0x203804=[];for(var _0x2ab0a8 in _0x54e3e6['chatQueues']){if(_0x54e3e6[_0x7291('0x50')]['hasOwnProperty'](_0x2ab0a8)){var _0x5d1d82=_0x54e3e6[_0x7291('0x50')][_0x2ab0a8];var _0x11d110={'id':_0x5d1d82['id'],'available':_0x5d1d82[_0x7291('0x51')],'loggedIn':_0x5d1d82[_0x7291('0x52')],'name':_0x5d1d82['name'],'paused':_0x5d1d82[_0x7291('0x53')],'waiting':_0x5d1d82[_0x7291('0x54')]};_0x203804[_0x7291('0x22')](_0x11d110);}}_0x834e39({'count':_0x203804[_0x7291('0x1c')],'rows':_0x203804});});},'MailQueues':function(_0x175666){return new Promise(function(_0x2afdba,_0x52270b){var _0x590b2e=[];for(var _0x46beac in _0x54e3e6[_0x7291('0x55')]){if(_0x54e3e6['mailQueues'][_0x7291('0x4b')](_0x46beac)){var _0xcb8d94=_0x54e3e6['mailQueues'][_0x46beac];var _0x24db4f={'id':_0xcb8d94['id'],'available':_0xcb8d94[_0x7291('0x51')],'loggedIn':_0xcb8d94['loggedIn'],'name':_0xcb8d94[_0x7291('0x56')],'paused':_0xcb8d94[_0x7291('0x53')],'waiting':_0xcb8d94[_0x7291('0x54')]};_0x590b2e['push'](_0x24db4f);}}_0x2afdba({'count':_0x590b2e[_0x7291('0x1c')],'rows':_0x590b2e});});},'OpenchannelQueues':function(_0x455853){return new Promise(function(_0x2a30df,_0x3b121a){var _0x140e99=[];for(var _0x3ee410 in _0x54e3e6['openchannelQueues']){if(_0x54e3e6['openchannelQueues'][_0x7291('0x4b')](_0x3ee410)){var _0x44cd41=_0x54e3e6[_0x7291('0x57')][_0x3ee410];var _0x19c384={'id':_0x44cd41['id'],'available':_0x44cd41[_0x7291('0x51')],'loggedIn':_0x44cd41[_0x7291('0x52')],'name':_0x44cd41[_0x7291('0x56')],'paused':_0x44cd41[_0x7291('0x53')],'waiting':_0x44cd41['waiting']};_0x140e99[_0x7291('0x22')](_0x19c384);}}_0x2a30df({'count':_0x140e99[_0x7291('0x1c')],'rows':_0x140e99});});},'SmsQueues':function(_0x42e20b){return new Promise(function(_0x57346d,_0x2e31ef){var _0x52ac94=[];for(var _0x53ed59 in _0x54e3e6[_0x7291('0x58')]){if(_0x54e3e6[_0x7291('0x58')][_0x7291('0x4b')](_0x53ed59)){var _0x32f814=_0x54e3e6[_0x7291('0x58')][_0x53ed59];var _0x383b9a={'id':_0x32f814['id'],'available':_0x32f814[_0x7291('0x51')],'loggedIn':_0x32f814['loggedIn'],'name':_0x32f814[_0x7291('0x56')],'paused':_0x32f814[_0x7291('0x53')],'waiting':_0x32f814[_0x7291('0x54')]};_0x52ac94[_0x7291('0x22')](_0x383b9a);}}_0x57346d({'count':_0x52ac94[_0x7291('0x1c')],'rows':_0x52ac94});});},'FaxQueues':function(_0x130758){return new Promise(function(_0xa8d5d3,_0x3d17bd){var _0x52f1c3=[];for(var _0x4057f9 in _0x54e3e6[_0x7291('0x59')]){if(_0x54e3e6[_0x7291('0x59')][_0x7291('0x4b')](_0x4057f9)){var _0x211161=_0x54e3e6[_0x7291('0x59')][_0x4057f9];var _0x1acedf={'id':_0x211161['id'],'available':_0x211161[_0x7291('0x51')],'loggedIn':_0x211161[_0x7291('0x52')],'name':_0x211161[_0x7291('0x56')],'paused':_0x211161[_0x7291('0x53')],'waiting':_0x211161['waiting']};_0x52f1c3[_0x7291('0x22')](_0x1acedf);}}_0xa8d5d3({'count':_0x52f1c3[_0x7291('0x1c')],'rows':_0x52f1c3});});},'WhatsappQueues':function(_0x289815){return new Promise(function(_0x79479a,_0x3a5ced){var _0x788384=[];for(var _0x19898a in _0x54e3e6[_0x7291('0x5a')]){if(_0x54e3e6[_0x7291('0x5a')]['hasOwnProperty'](_0x19898a)){var _0x36d39e=_0x54e3e6[_0x7291('0x5a')][_0x19898a];var _0x40e56e={'id':_0x36d39e['id'],'available':_0x36d39e[_0x7291('0x51')],'loggedIn':_0x36d39e[_0x7291('0x52')],'name':_0x36d39e[_0x7291('0x56')],'paused':_0x36d39e[_0x7291('0x53')],'waiting':_0x36d39e[_0x7291('0x54')]};_0x788384[_0x7291('0x22')](_0x40e56e);}}_0x79479a({'count':_0x788384['length'],'rows':_0x788384});});},'ChatQueuesWaitingInteractions':function(_0x5398b6){return new Promise(function(_0x4690f1,_0x25632d){var _0x343fa9=_[_0x7291('0x5b')](_0x54e3e6[_0x7291('0x5c')]);_0x4690f1({'count':_0x343fa9[_0x7291('0x1c')],'rows':_0x343fa9});});},'MailQueuesWaitingInteractions':function(_0x18e396){return new Promise(function(_0x4771c4,_0x52a68d){var _0x546591=_[_0x7291('0x5b')](_0x54e3e6[_0x7291('0x5d')]);_0x4771c4({'count':_0x546591[_0x7291('0x1c')],'rows':_0x546591});});},'OpenchannelQueuesWaitingInteractions':function(_0x1d2edc){return new Promise(function(_0x529c7e,_0x206691){var _0x11ca09=_[_0x7291('0x5b')](_0x54e3e6[_0x7291('0x5e')]);_0x529c7e({'count':_0x11ca09[_0x7291('0x1c')],'rows':_0x11ca09});});},'SmsQueuesWaitingInteractions':function(_0x519787){return new Promise(function(_0x56006c,_0x2cf419){var _0x3d5595=_['values'](_0x54e3e6['smsQueuesWaitingInteractions']);_0x56006c({'count':_0x3d5595['length'],'rows':_0x3d5595});});},'FaxQueuesWaitingInteractions':function(_0x18ddf5){return new Promise(function(_0x1790dc,_0x2598e6){var _0x33d540=_[_0x7291('0x5b')](_0x54e3e6[_0x7291('0x5f')]);_0x1790dc({'count':_0x33d540[_0x7291('0x1c')],'rows':_0x33d540});});},'WhatsappQueuesWaitingInteractions':function(_0x440096){return new Promise(function(_0x1b8650,_0x97b168){var _0x144ea=_[_0x7291('0x5b')](_0x54e3e6[_0x7291('0x60')]);_0x1b8650({'count':_0x144ea[_0x7291('0x1c')],'rows':_0x144ea});});}};var _0x334fb3=jayson[_0x7291('0x61')](_0x51d353)[_0x7291('0x62')]();_0x334fb3['on'](_0x7291('0x38'),function(_0x46f392){logger['error'](JSON['stringify'](_0x46f392));return _0x1777e1(_0x46f392);});_0x334fb3[_0x7291('0x15')](0x232c,_0x7291('0x63'),function(){console[_0x7291('0x64')](_0x7291('0x65'),0x232c);return _0x1b48d2(_0x7291('0x66')+0x232c);});});}; \ No newline at end of file +var _0x8cfd=['name','paused','mailQueues','loggedIn','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','stringify','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','mail','push','slice','dialogflow','appdata','split','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Applications\x20executed','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available'];(function(_0x1cd880,_0x31fc63){var _0x218fe0=function(_0x2be449){while(--_0x2be449){_0x1cd880['push'](_0x1cd880['shift']());}};_0x218fe0(++_0x31fc63);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x2f023d,_0x29dfe5){_0x2f023d=_0x2f023d-0x0;var _0x4ef240=_0x8cfd[_0x2f023d];return _0x4ef240;};'use strict';var _=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var path=require(_0xd8cf('0x2'));var fs=require('fs');var jayson=require(_0xd8cf('0x3'));var BPromise=require(_0xd8cf('0x4'));var uuid=require(_0xd8cf('0x5'));var utils=require('./applications/utils');var config=require(_0xd8cf('0x6'));var logger=require(_0xd8cf('0x7'))(_0xd8cf('0x8'));var rpc={'openchannelQueueReport':require(_0xd8cf('0x9')),'mailQueueReport':require(_0xd8cf('0xa')),'chatQueueReport':require(_0xd8cf('0xb')),'smsQueueReport':require(_0xd8cf('0xc')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xd8cf('0xd'));function getId(_0xa5b446,_0x37b91b,_0x32b9f6){return util[_0xd8cf('0xe')](_0xd8cf('0xf'),_0xa5b446,_0x37b91b||0x0,_0x32b9f6||0x0);}function getIntervals(_0x526b59,_0x3342fb){var _0x3a5d21=[];if(!_[_0xd8cf('0x10')](_0x3342fb[_0xd8cf('0x11')])&&!_[_0xd8cf('0x10')](_0x526b59[_0x3342fb[_0xd8cf('0x11')]])&&!_[_0xd8cf('0x10')](_0x526b59[_0x3342fb[_0xd8cf('0x11')]][_0xd8cf('0x12')])){_0x3a5d21=_[_0xd8cf('0x13')](_0x526b59[_0x3342fb[_0xd8cf('0x11')]][_0xd8cf('0x12')],'interval');}else if(!_[_0xd8cf('0x10')](_0x3342fb['interval'])){_0x3a5d21=[_0x3342fb[_0xd8cf('0x14')]];}return _0x3a5d21;}exports[_0xd8cf('0x15')]=function(_0x4e6760){_0x4e6760[_0xd8cf('0x16')]={};return new BPromise(function(_0x1ec11c,_0xd5ad37){var _0x5cf564={'Start':function(_0x19cf6c){var _0x5b9fb4=this;return new Promise(function(_0xc39a9a,_0x24c78c){if(_0x19cf6c){try{var _0x2fe158=[];var _0x55018c=getId(_0x19cf6c[_0xd8cf('0x17')],_0x19cf6c[_0xd8cf('0x18')]?_0x19cf6c['message']['id']:0x0,_0x19cf6c[_0xd8cf('0x19')]?_0x19cf6c[_0xd8cf('0x19')]['id']:0x0);if(_0x19cf6c[_0xd8cf('0x1a')]&&_[_0xd8cf('0x1b')](_0x19cf6c[_0xd8cf('0x1a')])&&_0x19cf6c[_0xd8cf('0x1a')][_0xd8cf('0x1c')]){for(var _0x1a8cee=0x0;_0x1a8cee<_0x19cf6c[_0xd8cf('0x1a')][_0xd8cf('0x1c')];_0x1a8cee+=0x1){var _0x40b18a=_0x19cf6c[_0xd8cf('0x1a')][_0x1a8cee];if(fs[_0xd8cf('0x1d')](path[_0xd8cf('0x1e')](__dirname,'applications',_0x40b18a[_0xd8cf('0x1f')]+_0xd8cf('0x20')))){var _0x37e5c1=[];switch(_0x40b18a[_0xd8cf('0x1f')][_0xd8cf('0x21')]()){case'autoreply':var _0x39f01f=_0x40b18a['appdata']['split'](',');if(_0x19cf6c['channel']===_0xd8cf('0x22')){_0x37e5c1['push'](_0x39f01f[0x0]);_0x37e5c1[_0xd8cf('0x23')](_0x39f01f[0x1]);_0x37e5c1[_0xd8cf('0x23')](_0x39f01f[_0xd8cf('0x24')](0x2,_0x39f01f[_0xd8cf('0x1c')])['join'](','));}else{_0x37e5c1[_0xd8cf('0x23')](_0x39f01f[0x0]);_0x37e5c1[_0xd8cf('0x23')](_0x39f01f[_0xd8cf('0x24')](0x1,_0x39f01f[_0xd8cf('0x1c')])[_0xd8cf('0x1e')](','));}break;case _0xd8cf('0x25'):var _0x533808=_0x40b18a[_0xd8cf('0x26')][_0xd8cf('0x27')](',');_0x37e5c1['push'](_0x533808[0x0]);_0x37e5c1[_0xd8cf('0x23')](_0x533808[0x1]);_0x37e5c1[_0xd8cf('0x23')](_0x533808[_0xd8cf('0x24')](0x2,_0x533808[_0xd8cf('0x1c')])[_0xd8cf('0x1e')](','));break;case'dialogflowv2':var _0x43fdf0=_0x40b18a[_0xd8cf('0x26')][_0xd8cf('0x27')](',');_0x37e5c1[_0xd8cf('0x23')](_0x43fdf0[0x0]);_0x37e5c1[_0xd8cf('0x23')](_0x43fdf0[0x1]);_0x37e5c1['push'](_0x43fdf0[0x2]);_0x37e5c1[_0xd8cf('0x23')](_0x43fdf0[0x3]);_0x37e5c1[_0xd8cf('0x23')](_0x43fdf0['slice'](0x4,_0x43fdf0[_0xd8cf('0x1c')])[_0xd8cf('0x1e')](','));break;case'amazonlex':var _0x15add9=_0x40b18a[_0xd8cf('0x26')][_0xd8cf('0x27')](',');_0x37e5c1['push'](_0x15add9[0x0]);_0x37e5c1[_0xd8cf('0x23')](_0x15add9[0x1]);_0x37e5c1['push'](_0x15add9[0x2]);_0x37e5c1[_0xd8cf('0x23')](_0x15add9[0x3]);_0x37e5c1[_0xd8cf('0x23')](_0x15add9[_0xd8cf('0x24')](0x4,_0x15add9[_0xd8cf('0x1c')])[_0xd8cf('0x1e')](','));break;case _0xd8cf('0x18'):_0x37e5c1[_0xd8cf('0x23')](_0x40b18a[_0xd8cf('0x26')]);break;case _0xd8cf('0x28'):_0x37e5c1[_0xd8cf('0x23')](_0x40b18a[_0xd8cf('0x29')]);_0x37e5c1['push'](_0x40b18a[_0xd8cf('0x26')]);break;case _0xd8cf('0x2a'):var _0x5a5bd5=utils[_0xd8cf('0x2b')](_0x19cf6c[_0xd8cf('0x2c')]['notificationTemplate'],_0x19cf6c);var _0x196e7d=_0x40b18a[_0xd8cf('0x26')][_0xd8cf('0x27')](',');_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x0]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x1]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x2]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x3]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x4]);_0x37e5c1['push'](_0x196e7d[0x5]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x6]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x7]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0x8]);_0x37e5c1['push'](_0x196e7d[0x9]);_0x37e5c1[_0xd8cf('0x23')](_0x196e7d[0xa]);_0x37e5c1[_0xd8cf('0x23')](_0x19cf6c[_0xd8cf('0x19')]['id']);_0x37e5c1[_0xd8cf('0x23')](_0x19cf6c[_0xd8cf('0x18')]['id']);_0x37e5c1[_0xd8cf('0x23')](_0x40b18a[_0xd8cf('0x2d')]);_0x37e5c1[_0xd8cf('0x23')](_0x19cf6c[_0xd8cf('0x19')][_0xd8cf('0x2e')]);_0x37e5c1[_0xd8cf('0x23')](_0x19cf6c['body']['body']);_0x37e5c1['push'](_0x5a5bd5);break;default:_0x37e5c1=_[_0xd8cf('0x10')](_0x40b18a['appdata'])?[]:_0x40b18a['appdata']['split'](',');}var _0x29a857={'id':util[_0xd8cf('0xe')](_0xd8cf('0x2f'),_0x55018c,_0x40b18a['id'],_0x40b18a[_0xd8cf('0x1f')]),'condition':require(_0xd8cf('0x30'))[_0xd8cf('0x31')](_0x55018c,getIntervals(_0x4e6760['intervals'],_0x40b18a),_0x4e6760),'consequence':require(_0xd8cf('0x32')+_0x40b18a[_0xd8cf('0x1f')])[_0xd8cf('0x33')](_0x55018c,_0x37e5c1,_0x4e6760,_0x19cf6c),'p':_0x40b18a[_0xd8cf('0x34')]||0x0};logger[_0xd8cf('0x35')](_0xd8cf('0x36'),_0x29a857['id'],_0xd8cf('0x37'),getIntervals(_0x4e6760[_0xd8cf('0x38')],_0x40b18a)['join'](_0xd8cf('0x39')));_0x2fe158[_0xd8cf('0x23')](_0x29a857);}else{logger[_0xd8cf('0x3a')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xd8cf('0x1e')](__dirname,'applications',_0x40b18a[_0xd8cf('0x1f')]+'.js'));}}_0x4e6760['rules'][_0x55018c]=new RuleEngine(_0x2fe158);_0x4e6760['rules'][_0x55018c]['execute'](_0x19cf6c,function(_0x6093d9){logger[_0xd8cf('0x35')](_0xd8cf('0x3b'),JSON['stringify'](_0x6093d9['matchPath']));if(_0x4e6760[_0xd8cf('0x16')][_0x55018c]){_0x4e6760[_0xd8cf('0x16')][_0x55018c][_0xd8cf('0x3c')](_0xd8cf('0x3d'));}});return _0xc39a9a({'code':0xc8,'message':_0x19cf6c});}else{logger['info'](_0xd8cf('0x3e'));return _0xc39a9a({'code':0xc8,'message':_0x19cf6c});}}catch(_0x457073){logger[_0xd8cf('0x3a')](_0x457073['stack']);return _0x24c78c(_0x5b9fb4[_0xd8cf('0x3a')](0x1f4,_0x457073));}}return _0x24c78c(_0xd8cf('0x3f'));});},'AcceptMessage':function(_0x3d8782){var _0x378c4d=this;return new Promise(function(_0xd8fc0d,_0x2831cd){if(_0x3d8782['agent']&&_0x3d8782[_0xd8cf('0x40')]['id']){if(_0x4e6760[_0xd8cf('0x41')][_0x3d8782[_0xd8cf('0x40')]['id']]){_0x4e6760[_0xd8cf('0x41')][_0x3d8782[_0xd8cf('0x40')]['id']][_0xd8cf('0x42')]=![];_0x4e6760['agents'][_0x3d8782[_0xd8cf('0x40')]['id']][_0xd8cf('0x43')]=undefined;}}if(_0x3d8782[_0xd8cf('0x18')]&&_0x3d8782['message']['id']){try{var _0x201a08=getId(_0x3d8782[_0xd8cf('0x17')],_0x3d8782[_0xd8cf('0x18')]?_0x3d8782[_0xd8cf('0x18')]['id']:0x0,_0x3d8782[_0xd8cf('0x19')]?_0x3d8782[_0xd8cf('0x19')]['id']:0x0);if(_0x4e6760[_0xd8cf('0x16')][_0x201a08]){_0x4e6760[_0xd8cf('0x16')][_0x201a08]['emit'](_0xd8cf('0x44'));if(rpc[_0x3d8782[_0xd8cf('0x17')]+_0xd8cf('0x45')]){rpc[_0x3d8782[_0xd8cf('0x17')]+_0xd8cf('0x45')][_0xd8cf('0x46')](_0x201a08,{'UserId':_0x3d8782[_0xd8cf('0x18')][_0xd8cf('0x47')]})[_0xd8cf('0x48')](function(_0x3dea3b){logger[_0xd8cf('0x3a')](_0xd8cf('0x49'));});}}return _0xd8fc0d({'code':0xc8,'message':_0x3d8782});}catch(_0x129f26){logger[_0xd8cf('0x3a')](_0x129f26[_0xd8cf('0x4a')]);return _0x2831cd(_0x378c4d[_0xd8cf('0x3a')](0x1f4,_0x129f26));}}logger[_0xd8cf('0x3a')](_0xd8cf('0x4b'));return _0x2831cd(_0x378c4d[_0xd8cf('0x3a')](0x1f4,_0xd8cf('0x4b')));});},'RejectMessage':function(_0x4d7b4d){var _0x256beb=this;return new Promise(function(_0x1f8c4e,_0x3cbf36){if(_0x4d7b4d['agent']&&_0x4d7b4d[_0xd8cf('0x40')]['id']){try{if(_0x4e6760[_0xd8cf('0x41')][_0x4d7b4d[_0xd8cf('0x40')]['id']]){_0x4e6760[_0xd8cf('0x41')][_0x4d7b4d[_0xd8cf('0x40')]['id']][_0xd8cf('0x42')]=![];_0x4e6760['agents'][_0x4d7b4d['agent']['id']][_0xd8cf('0x43')]=undefined;}return _0x1f8c4e({'code':0xc8,'message':_0x4d7b4d});}catch(_0x4789cb){logger[_0xd8cf('0x3a')](_0x4789cb[_0xd8cf('0x4a')]);return _0x3cbf36(_0x256beb[_0xd8cf('0x3a')](0x1f4,_0x4789cb));}}logger['error'](_0xd8cf('0x4b'));return _0x3cbf36(_0x256beb[_0xd8cf('0x3a')](0x1f4,_0xd8cf('0x4b')));});},'AbandonInteraction':function(_0x326592){var _0xfb1156=this;return new Promise(function(_0x1e247e,_0x3d4cdd){if(_0x326592['channel']&&_0x326592[_0xd8cf('0x19')]&&_0x326592[_0xd8cf('0x19')]['id']){try{var _0x3f4cfd=getId(_0x326592['channel'],_0x326592[_0xd8cf('0x18')]?_0x326592[_0xd8cf('0x18')]['id']:0x0,_0x326592[_0xd8cf('0x19')]?_0x326592[_0xd8cf('0x19')]['id']:0x0);if(_0x4e6760[_0xd8cf('0x16')][_0x3f4cfd]){_0x4e6760[_0xd8cf('0x16')][_0x3f4cfd][_0xd8cf('0x3c')]('end');}return _0x1e247e({'code':0xc8,'message':_0x326592});}catch(_0x33ba5f){logger[_0xd8cf('0x3a')](_0x33ba5f[_0xd8cf('0x4a')]);return _0x3d4cdd(_0xfb1156['error'](0x1f4,_0x33ba5f));}}logger[_0xd8cf('0x3a')]('message\x20is\x20empty');return _0x3d4cdd(_0xfb1156[_0xd8cf('0x3a')](0x1f4,_0xd8cf('0x4b')));});},'AgentCapacity':function(_0x4d85e9){var _0x38ee26=this;return new Promise(function(_0x43b9af,_0x1d373f){if(_0x4e6760['agents'][_0xd8cf('0x4c')](_0x4d85e9['id'])){for(var _0x47a425 in _0x4d85e9[_0xd8cf('0x4d')]){if(_0x4d85e9[_0xd8cf('0x4d')][_0xd8cf('0x4c')](_0x47a425)){if(_0x4e6760['agents'][_0x4d85e9['id']][_0xd8cf('0x4c')](_0x47a425+_0xd8cf('0x4e'))){_0x4e6760[_0xd8cf('0x41')][_0x4d85e9['id']][_0x47a425+_0xd8cf('0x4e')]=parseInt(_0x4d85e9[_0xd8cf('0x4d')][_0x47a425],0xa);}}}_0x4e6760[_0xd8cf('0x41')][_0x4d85e9['id']][_0xd8cf('0x4f')]();return _0x43b9af({'code':0xc8,'message':_0x4e6760[_0xd8cf('0x41')][_0x4d85e9['id']]});}else{return _0x1d373f(_0x38ee26[_0xd8cf('0x3a')](0x1f4,_0xd8cf('0x50')));}});},'Agents':function(_0x221f24){return new Promise(function(_0xe4f90,_0x36317b){var _0x2cf49b=_[_0xd8cf('0x51')](_0x4e6760[_0xd8cf('0x41')]);_0xe4f90({'count':_0x2cf49b['length'],'rows':_0x2cf49b});});},'ChatQueues':function(_0x2f9459){return new Promise(function(_0x4ecd21,_0x46e644){var _0x348906=[];for(var _0x4188e0 in _0x4e6760[_0xd8cf('0x52')]){if(_0x4e6760[_0xd8cf('0x52')][_0xd8cf('0x4c')](_0x4188e0)){var _0x1123a3=_0x4e6760[_0xd8cf('0x52')][_0x4188e0];var _0x139f45={'id':_0x1123a3['id'],'available':_0x1123a3[_0xd8cf('0x53')],'loggedIn':_0x1123a3['loggedIn'],'name':_0x1123a3[_0xd8cf('0x54')],'paused':_0x1123a3[_0xd8cf('0x55')],'waiting':_0x1123a3['waiting']};_0x348906['push'](_0x139f45);}}_0x4ecd21({'count':_0x348906[_0xd8cf('0x1c')],'rows':_0x348906});});},'MailQueues':function(_0x3ee6bb){return new Promise(function(_0x1e4b9b,_0xcb9425){var _0x1e481f=[];for(var _0x17a466 in _0x4e6760[_0xd8cf('0x56')]){if(_0x4e6760[_0xd8cf('0x56')][_0xd8cf('0x4c')](_0x17a466)){var _0x2005aa=_0x4e6760[_0xd8cf('0x56')][_0x17a466];var _0x4c3fde={'id':_0x2005aa['id'],'available':_0x2005aa['available'],'loggedIn':_0x2005aa[_0xd8cf('0x57')],'name':_0x2005aa[_0xd8cf('0x54')],'paused':_0x2005aa[_0xd8cf('0x55')],'waiting':_0x2005aa['waiting']};_0x1e481f[_0xd8cf('0x23')](_0x4c3fde);}}_0x1e4b9b({'count':_0x1e481f['length'],'rows':_0x1e481f});});},'OpenchannelQueues':function(_0x5aaa32){return new Promise(function(_0x46b17e,_0x5910a4){var _0x23fe99=[];for(var _0x41dd8b in _0x4e6760[_0xd8cf('0x58')]){if(_0x4e6760[_0xd8cf('0x58')]['hasOwnProperty'](_0x41dd8b)){var _0x15e3e7=_0x4e6760[_0xd8cf('0x58')][_0x41dd8b];var _0xbba3de={'id':_0x15e3e7['id'],'available':_0x15e3e7[_0xd8cf('0x53')],'loggedIn':_0x15e3e7[_0xd8cf('0x57')],'name':_0x15e3e7[_0xd8cf('0x54')],'paused':_0x15e3e7[_0xd8cf('0x55')],'waiting':_0x15e3e7[_0xd8cf('0x59')]};_0x23fe99[_0xd8cf('0x23')](_0xbba3de);}}_0x46b17e({'count':_0x23fe99['length'],'rows':_0x23fe99});});},'SmsQueues':function(_0x3155c3){return new Promise(function(_0x46d139,_0x27fec6){var _0x3c8ba3=[];for(var _0x23a880 in _0x4e6760['smsQueues']){if(_0x4e6760[_0xd8cf('0x5a')][_0xd8cf('0x4c')](_0x23a880)){var _0x6479c8=_0x4e6760['smsQueues'][_0x23a880];var _0x10293b={'id':_0x6479c8['id'],'available':_0x6479c8['available'],'loggedIn':_0x6479c8[_0xd8cf('0x57')],'name':_0x6479c8[_0xd8cf('0x54')],'paused':_0x6479c8[_0xd8cf('0x55')],'waiting':_0x6479c8[_0xd8cf('0x59')]};_0x3c8ba3[_0xd8cf('0x23')](_0x10293b);}}_0x46d139({'count':_0x3c8ba3[_0xd8cf('0x1c')],'rows':_0x3c8ba3});});},'FaxQueues':function(_0x307fea){return new Promise(function(_0x4e5b79,_0x42c0db){var _0x11e597=[];for(var _0x2c9f35 in _0x4e6760[_0xd8cf('0x5b')]){if(_0x4e6760[_0xd8cf('0x5b')][_0xd8cf('0x4c')](_0x2c9f35)){var _0x3f1048=_0x4e6760[_0xd8cf('0x5b')][_0x2c9f35];var _0x4c4883={'id':_0x3f1048['id'],'available':_0x3f1048[_0xd8cf('0x53')],'loggedIn':_0x3f1048[_0xd8cf('0x57')],'name':_0x3f1048['name'],'paused':_0x3f1048[_0xd8cf('0x55')],'waiting':_0x3f1048['waiting']};_0x11e597['push'](_0x4c4883);}}_0x4e5b79({'count':_0x11e597[_0xd8cf('0x1c')],'rows':_0x11e597});});},'WhatsappQueues':function(_0x1bbcaf){return new Promise(function(_0x4171bb,_0x26c664){var _0x3f34cd=[];for(var _0x5845e7 in _0x4e6760[_0xd8cf('0x5c')]){if(_0x4e6760[_0xd8cf('0x5c')][_0xd8cf('0x4c')](_0x5845e7)){var _0x3d3bb8=_0x4e6760['whatsappQueues'][_0x5845e7];var _0x6426d2={'id':_0x3d3bb8['id'],'available':_0x3d3bb8[_0xd8cf('0x53')],'loggedIn':_0x3d3bb8[_0xd8cf('0x57')],'name':_0x3d3bb8['name'],'paused':_0x3d3bb8[_0xd8cf('0x55')],'waiting':_0x3d3bb8[_0xd8cf('0x59')]};_0x3f34cd[_0xd8cf('0x23')](_0x6426d2);}}_0x4171bb({'count':_0x3f34cd[_0xd8cf('0x1c')],'rows':_0x3f34cd});});},'ChatQueuesWaitingInteractions':function(_0x130bb5){return new Promise(function(_0x21ea8c,_0x2f25c0){var _0x246ea2=_[_0xd8cf('0x51')](_0x4e6760[_0xd8cf('0x5d')]);_0x21ea8c({'count':_0x246ea2[_0xd8cf('0x1c')],'rows':_0x246ea2});});},'MailQueuesWaitingInteractions':function(_0x389abf){return new Promise(function(_0x27c4da,_0x23ce06){var _0x3c5c6e=_[_0xd8cf('0x51')](_0x4e6760[_0xd8cf('0x5e')]);_0x27c4da({'count':_0x3c5c6e[_0xd8cf('0x1c')],'rows':_0x3c5c6e});});},'OpenchannelQueuesWaitingInteractions':function(_0x41b537){return new Promise(function(_0x8196bf,_0x11d1bf){var _0x476a2d=_['values'](_0x4e6760[_0xd8cf('0x5f')]);_0x8196bf({'count':_0x476a2d['length'],'rows':_0x476a2d});});},'SmsQueuesWaitingInteractions':function(_0x1193f6){return new Promise(function(_0x1df0c6,_0x13cc87){var _0x5b8bd7=_[_0xd8cf('0x51')](_0x4e6760[_0xd8cf('0x60')]);_0x1df0c6({'count':_0x5b8bd7[_0xd8cf('0x1c')],'rows':_0x5b8bd7});});},'FaxQueuesWaitingInteractions':function(_0x5764dd){return new Promise(function(_0x440ae8,_0x5862ab){var _0x439d77=_[_0xd8cf('0x51')](_0x4e6760[_0xd8cf('0x61')]);_0x440ae8({'count':_0x439d77[_0xd8cf('0x1c')],'rows':_0x439d77});});},'WhatsappQueuesWaitingInteractions':function(_0x330f09){return new Promise(function(_0x1146f8,_0x30987a){var _0x2aaca6=_[_0xd8cf('0x51')](_0x4e6760[_0xd8cf('0x62')]);_0x1146f8({'count':_0x2aaca6[_0xd8cf('0x1c')],'rows':_0x2aaca6});});}};var _0x604d0b=jayson['server'](_0x5cf564)[_0xd8cf('0x63')]();_0x604d0b['on'](_0xd8cf('0x3a'),function(_0x584e34){logger[_0xd8cf('0x3a')](JSON[_0xd8cf('0x64')](_0x584e34));return _0xd5ad37(_0x584e34);});_0x604d0b[_0xd8cf('0x15')](0x232c,_0xd8cf('0x65'),function(){console[_0xd8cf('0x66')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1ec11c(_0xd8cf('0x67')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 9e2b07f..fc5a1fb 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 _0xd1fa=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','client','request','then','error','message','result','catch','condition','rules'];(function(_0x4e731b,_0x535e94){var _0x4831bd=function(_0x1d7c70){while(--_0x1d7c70){_0x4e731b['push'](_0x4e731b['shift']());}};_0x4831bd(++_0x535e94);}(_0xd1fa,0x1f2));var _0xad1f=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xd1fa[_0x266618];return _0x54dbf5;};'use strict';var util=require(_0xad1f('0x0'));var BPromise=require(_0xad1f('0x1'));var jayson=require(_0xad1f('0x2'));var _=require(_0xad1f('0x3'));var logger=require(_0xad1f('0x4'))('routing');var client=jayson[_0xad1f('0x5')]['http']({'port':0x232a});function request(_0x582117,_0x42521f){return new BPromise(function(_0x17c727,_0x55db77){return client[_0xad1f('0x6')](_0x582117,_0x42521f)[_0xad1f('0x7')](function(_0xb7fe3e){if(_0xb7fe3e['error']){return _0x55db77(_0xb7fe3e[_0xad1f('0x8')][_0xad1f('0x9')]);}else{return _0x17c727(_0xb7fe3e[_0xad1f('0xa')]);}})[_0xad1f('0xb')](function(_0x99941c){return _0x55db77(_0x99941c);});});}exports[_0xad1f('0xc')]=function(_0x312d14,_0x3828fc,_0xc9c016){return function(_0x2ff6d1){if(_0xc9c016['rules']&&!_0xc9c016[_0xad1f('0xd')][_0x312d14]){logger[_0xad1f('0xe')](_0xad1f('0xf'),_0x312d14);return _0x2ff6d1['stop']();}var _0x5d5b6d=[];for(var _0x36b051=0x0;_0x36b051<_0x3828fc[_0xad1f('0x10')];_0x36b051+=0x1){_0x5d5b6d[_0xad1f('0x11')](request(_0xad1f('0x12'),{'command':util[_0xad1f('0x13')]('iftime\x20%s',_0x3828fc[_0x36b051])})[_0xad1f('0x7')](function(_0x5b3c60){return _0x5b3c60&&_0x5b3c60[_0xad1f('0x9')]&&_0x5b3c60[_0xad1f('0x9')][_0xad1f('0x14')](_0xad1f('0x15'))>=0x0?!![]:![];})[_0xad1f('0xb')](function(_0x20d920){logger[_0xad1f('0x8')](_0xad1f('0x16'),_0x312d14,_0x3828fc[_0x36b051]);}));}BPromise[_0xad1f('0x17')](_0x5d5b6d)[_0xad1f('0x7')](function(_0x2e1e96){var _0x84160e=_[_0xad1f('0x18')](_0x2e1e96);logger[_0xad1f('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x312d14,_0x3828fc[_0xad1f('0x19')](_0xad1f('0x1a')),_0x84160e);_0x2ff6d1[_0xad1f('0x1b')](_0x84160e);})[_0xad1f('0xb')](function(_0x5c8cdb){console[_0xad1f('0x1c')](_0x5c8cdb);logger[_0xad1f('0x8')](_0xad1f('0x1d'),_0x312d14,_0x3828fc[_0xad1f('0x19')]('\x20|\x20'),_0x5c8cdb[_0xad1f('0x1e')]);_0x2ff6d1[_0xad1f('0x1f')]();});};}; \ No newline at end of file +var _0x6c7d=['condition','rules','info','stop','length','push','format','iftime\x20%s','message','indexOf','[%s][INTERVAL]\x20%s','then','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util','bluebird','jayson/promise','../../../config/logger','client','request','error','result','catch'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x6c7d,0x197));var _0xd6c7=function(_0x25cf2b,_0x219a02){_0x25cf2b=_0x25cf2b-0x0;var _0x46639e=_0x6c7d[_0x25cf2b];return _0x46639e;};'use strict';var util=require(_0xd6c7('0x0'));var BPromise=require(_0xd6c7('0x1'));var jayson=require(_0xd6c7('0x2'));var _=require('lodash');var logger=require(_0xd6c7('0x3'))('routing');var client=jayson[_0xd6c7('0x4')]['http']({'port':0x232a});function request(_0x3bb4b5,_0x1949a1){return new BPromise(function(_0x4d9d7f,_0x1f6861){return client[_0xd6c7('0x5')](_0x3bb4b5,_0x1949a1)['then'](function(_0x2e9291){if(_0x2e9291['error']){return _0x1f6861(_0x2e9291[_0xd6c7('0x6')]['message']);}else{return _0x4d9d7f(_0x2e9291[_0xd6c7('0x7')]);}})[_0xd6c7('0x8')](function(_0x398897){return _0x1f6861(_0x398897);});});}exports[_0xd6c7('0x9')]=function(_0x3f0568,_0x4da4e1,_0x3dbbd3){return function(_0x32baeb){if(_0x3dbbd3[_0xd6c7('0xa')]&&!_0x3dbbd3[_0xd6c7('0xa')][_0x3f0568]){logger[_0xd6c7('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3f0568);return _0x32baeb[_0xd6c7('0xc')]();}var _0x5bb860=[];for(var _0xd02059=0x0;_0xd02059<_0x4da4e1[_0xd6c7('0xd')];_0xd02059+=0x1){_0x5bb860[_0xd6c7('0xe')](request('Command',{'command':util[_0xd6c7('0xf')](_0xd6c7('0x10'),_0x4da4e1[_0xd02059])})['then'](function(_0x2e032c){return _0x2e032c&&_0x2e032c[_0xd6c7('0x11')]&&_0x2e032c[_0xd6c7('0x11')][_0xd6c7('0x12')]('true')>=0x0?!![]:![];})[_0xd6c7('0x8')](function(_0x5106eb){logger[_0xd6c7('0x6')](_0xd6c7('0x13'),_0x3f0568,_0x4da4e1[_0xd02059]);}));}BPromise['all'](_0x5bb860)[_0xd6c7('0x14')](function(_0x4339c5){var _0x24c78c=_[_0xd6c7('0x15')](_0x4339c5);logger['info'](_0xd6c7('0x16'),_0x3f0568,_0x4da4e1[_0xd6c7('0x17')](_0xd6c7('0x18')),_0x24c78c);_0x32baeb[_0xd6c7('0x19')](_0x24c78c);})[_0xd6c7('0x8')](function(_0x35d4ef){console['log'](_0x35d4ef);logger[_0xd6c7('0x6')]('[%s][INTERVAL]\x20%s\x20%s',_0x3f0568,_0x4da4e1[_0xd6c7('0x17')](_0xd6c7('0x18')),_0x35d4ef['stack']);_0x32baeb[_0xd6c7('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index cab0c0c..d7ecda7 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 _0xab40=['forIn','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','membername','agentringnoanswerAt','timeout','reason','ringtime','talktime','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xab40,0xcd));var _0x0ab4=function(_0xe93dea,_0x2ac029){_0xe93dea=_0xe93dea-0x0;var _0x1fd2c7=_0xab40[_0xe93dea];return _0x1fd2c7;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x570f05,_0x4f3e19){utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x4'),_0x570f05[_0x0ab4('0x5')],_0x570f05[_0x0ab4('0x6')],_0x570f05['queue'],_0x570f05['membername'],_0x570f05[_0x0ab4('0x7')],_0x570f05['calleridnum'],_0x570f05[_0x0ab4('0x8')],_0x570f05[_0x0ab4('0x9')]));if(_0x570f05[_0x0ab4('0xa')]){utils[_0x0ab4('0xb')](_0x570f05['queue'])['then'](function(_0x4b01c4){if(_0x4b01c4){_0x570f05[_0x0ab4('0xc')]=_0x4b01c4[_0x0ab4('0xc')];_0x570f05[_0x0ab4('0xd')]=_0x570f05[_0x0ab4('0xe')]?_0x4b01c4[_0x0ab4('0xf')]:![];_0x570f05[_0x0ab4('0x10')]=_0x570f05[_0x0ab4('0xd')]?_0x4b01c4[_0x0ab4('0x11')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x570f05);});}else{utils[_0x0ab4('0x12')]('CreateVoiceAgentReport',_0x570f05);}if(_0x4f3e19){delete transfers[_0x570f05[_0x0ab4('0x5')]];}else{delete agents[_0x570f05[_0x0ab4('0x13')]];}}exports[_0x0ab4('0x14')]=function(_0x1e2b56){try{utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x16'),_0x1e2b56[_0x0ab4('0x5')]),_0x1e2b56);agents[_0x1e2b56[_0x0ab4('0x13')]]=_0x1e2b56;agents[_0x1e2b56[_0x0ab4('0x13')]][_0x0ab4('0x17')]=utils[_0x0ab4('0x18')]();agents[_0x1e2b56[_0x0ab4('0x13')]][_0x0ab4('0x9')]=_0x0ab4('0x19');agents[_0x1e2b56[_0x0ab4('0x13')]][_0x0ab4('0x8')]=null;agents[_0x1e2b56[_0x0ab4('0x13')]]['connectedlinename']=null;utils['info'](util['format'](_0x0ab4('0x1a'),_0x1e2b56[_0x0ab4('0x5')],agents[_0x1e2b56[_0x0ab4('0x13')]]['membername'],_0x1e2b56[_0x0ab4('0x13')]));}catch(_0x13ea9f){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')]('[%s][agents][agentcalled]',_0x1e2b56['uniqueid']),_0x13ea9f);}};exports[_0x0ab4('0x1c')]=function(_0x5b1ed5){try{if(!_[_0x0ab4('0x1d')](agents[_0x5b1ed5[_0x0ab4('0x13')]])){utils['debug'](util[_0x0ab4('0x3')](_0x0ab4('0x1e'),_0x5b1ed5[_0x0ab4('0x5')]),_0x5b1ed5);utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5b1ed5['uniqueid'],agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x1f')],_0x5b1ed5[_0x0ab4('0x13')]));agents[_0x5b1ed5[_0x0ab4('0x13')]]['agentringnoanswer']=!![];agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x20')]=utils[_0x0ab4('0x18')]();agents[_0x5b1ed5['destuniqueid']]['lastevent']=_0x0ab4('0x21');agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x22')]='timeout';agents[_0x5b1ed5['destuniqueid']]['holdtime']=_0x5b1ed5[_0x0ab4('0x23')]?parseInt(_0x5b1ed5['ringtime'])/0x3e8:0x0;agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x24')]=0x0;unanswered['push'](_0x5b1ed5['destuniqueid']);}}catch(_0x4d0cc1){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')](_0x0ab4('0x1e'),_0x5b1ed5[_0x0ab4('0x5')]),_0x4d0cc1);}};exports[_0x0ab4('0x25')]=function(_0x588e0d){try{_['forIn'](agents,function(_0x580d56,_0x2e7a97){if(_0x580d56[_0x0ab4('0x5')]==_0x588e0d[_0x0ab4('0x5')]&&!_[_0x0ab4('0x26')](unanswered,_0x580d56[_0x0ab4('0x13')])){utils['debug'](util['format'](_0x0ab4('0x27'),_0x588e0d[_0x0ab4('0x5')]),_0x588e0d);utils[_0x0ab4('0x2')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x588e0d[_0x0ab4('0x5')],_0x580d56['membername'],_0x580d56[_0x0ab4('0x13')]));_0x580d56[_0x0ab4('0x1c')]=!![];_0x580d56[_0x0ab4('0x20')]=utils[_0x0ab4('0x18')]();_0x580d56[_0x0ab4('0x9')]=_0x0ab4('0x28');_0x580d56['reason']=_0x0ab4('0x28');_0x580d56[_0x0ab4('0x29')]=_0x588e0d[_0x0ab4('0x29')];_0x580d56[_0x0ab4('0x24')]=0x0;writeDB(_0x580d56);}});}catch(_0x4cce0c){utils['error'](util[_0x0ab4('0x3')](_0x0ab4('0x27'),_0x588e0d[_0x0ab4('0x5')]),_0x4cce0c);}};exports['agentconnect']=function(_0x507d77){try{if(agents[_0x507d77['destuniqueid']]){utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x2a'),_0x507d77['uniqueid']),_0x507d77);utils['info'](util['format'](_0x0ab4('0x2b'),_0x507d77[_0x0ab4('0x5')],agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x1f')],_0x507d77[_0x0ab4('0x13')]));agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x2c')]=utils[_0x0ab4('0x18')]();agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x8')]=_0x507d77['connectedlinenum'];agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x2d')]=_0x507d77[_0x0ab4('0x2d')];agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x29')]=_0x507d77[_0x0ab4('0x23')];agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x9')]=_0x0ab4('0x2e');_[_0x0ab4('0x2f')](agents,function(_0x449437,_0x1974ce){if(_0x449437['destuniqueid']!=_0x507d77[_0x0ab4('0x13')]&&_0x449437[_0x0ab4('0x5')]==_0x507d77[_0x0ab4('0x5')]){_0x449437[_0x0ab4('0x24')]=0x0;_0x449437['holdtime']=_0x507d77[_0x0ab4('0x23')];_0x449437['agentringnoanswer']=!![];_0x449437[_0x0ab4('0x20')]=utils[_0x0ab4('0x18')]();_0x449437[_0x0ab4('0x9')]=_0x0ab4('0x30');_0x449437[_0x0ab4('0x22')]=_0x0ab4('0x30');_0x449437['answeredelsewheredestinationuniqueid']=_0x507d77[_0x0ab4('0x13')];_0x449437[_0x0ab4('0x31')]=_0x507d77[_0x0ab4('0x1f')];writeDB(_0x449437);}});}}catch(_0x48029f){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')](_0x0ab4('0x2a'),_0x507d77[_0x0ab4('0x5')]),_0x48029f);}};exports[_0x0ab4('0xe')]=function(_0x5aa047){try{if(!_['isNil'](agents[_0x5aa047['destuniqueid']])){utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')]('[%s][agents][agentcomplete]',_0x5aa047[_0x0ab4('0x5')]),_0x5aa047);utils['info'](util[_0x0ab4('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5aa047[_0x0ab4('0x5')],agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0x1f')],_0x5aa047[_0x0ab4('0x13')]));agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0xe')]=!![];agents[_0x5aa047['destuniqueid']][_0x0ab4('0x32')]=utils[_0x0ab4('0x18')]();agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0x24')]=utils[_0x0ab4('0x33')](agents[_0x5aa047[_0x0ab4('0x13')]]['agentcompleteAt'],agents[_0x5aa047[_0x0ab4('0x13')]]['agentconnectAt']);agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0x22')]=_0x5aa047[_0x0ab4('0x22')];agents[_0x5aa047['destuniqueid']][_0x0ab4('0x9')]=_0x0ab4('0x34');writeDB(agents[_0x5aa047[_0x0ab4('0x13')]]);}}catch(_0x3c1247){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')]('[%s][agents][agentcomplete]',_0x5aa047[_0x0ab4('0x5')]),_0x3c1247);}};exports[_0x0ab4('0x35')]=function(_0x302894){try{if(!_[_0x0ab4('0x1d')](agents[_0x302894[_0x0ab4('0x36')]])){utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x37'),_0x302894[_0x0ab4('0x5')]),_0x302894);utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x38'),_0x302894[_0x0ab4('0x5')],agents[_0x302894['transfereruniqueid']][_0x0ab4('0x1f')],agents[_0x302894[_0x0ab4('0x36')]]['uniqueid']));agents[_0x302894[_0x0ab4('0x36')]]['transfer']=!![];agents[_0x302894['transfereruniqueid']][_0x0ab4('0x39')]=_0x0ab4('0x3a');agents[_0x302894[_0x0ab4('0x36')]]['transferexten']=_0x302894[_0x0ab4('0x3b')];agents[_0x302894[_0x0ab4('0x36')]][_0x0ab4('0x3c')]=agents[_0x302894[_0x0ab4('0x36')]][_0x0ab4('0x5')];}}catch(_0x3f20de){utils[_0x0ab4('0x1b')](util['format'](_0x0ab4('0x37'),_0x302894['uniqueid']),_0x3f20de);}};exports[_0x0ab4('0x3d')]=function(_0x55c073){try{utils[_0x0ab4('0x15')](util['format']('[%s][agents][attendedtransfer]',_0x55c073[_0x0ab4('0x3e')]),_0x55c073);if(_0x55c073[_0x0ab4('0x3e')]==_0x55c073[_0x0ab4('0x3f')]){if(!_[_0x0ab4('0x1d')](agents[_0x55c073['secondtransfereruniqueid']])){utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x40'),_0x55c073[_0x0ab4('0x3e')],agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x1f')]));agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x42')]=!![];agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x39')]=_0x0ab4('0x43');agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x44')]=_0x55c073[_0x0ab4('0x45')];agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x3c')]=_0x55c073[_0x0ab4('0x3e')];}if(_0x55c073[_0x0ab4('0x46')]&&agents[_0x55c073[_0x0ab4('0x46')]]){agents[_0x55c073['transfereeuniqueid']][_0x0ab4('0x47')]=0x1;transfers[_0x55c073[_0x0ab4('0x46')]]=_[_0x0ab4('0x48')](agents[_0x55c073[_0x0ab4('0x46')]]);transfers[_0x55c073[_0x0ab4('0x46')]][_0x0ab4('0x49')]=agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x49')];transfers[_0x55c073['transfereeuniqueid']][_0x0ab4('0x4a')]=agents[_0x55c073[_0x0ab4('0x41')]]['calleridname'];transfers[_0x55c073['transfereeuniqueid']][_0x0ab4('0x17')]=utils[_0x0ab4('0x18')]();transfers[_0x55c073['transfereeuniqueid']]['agentconnectAt']=utils[_0x0ab4('0x18')]();transfers[_0x55c073['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x55c073[_0x0ab4('0x46')]][_0x0ab4('0x47')]=0x2;}}else if(_0x55c073[_0x0ab4('0x41')]==_0x55c073[_0x0ab4('0x4b')]){if(!_[_0x0ab4('0x1d')](agents[_0x55c073[_0x0ab4('0x3e')]])){utils[_0x0ab4('0x2')](util['format'](_0x0ab4('0x40'),_0x55c073[_0x0ab4('0x3e')],agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x1f')]));agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x42')]=!![];agents[_0x55c073['origtransfereruniqueid']][_0x0ab4('0x39')]=_0x0ab4('0x43');agents[_0x55c073['origtransfereruniqueid']][_0x0ab4('0x44')]=_0x55c073['secondtransfererexten'];agents[_0x55c073[_0x0ab4('0x3e')]]['transferuniqueid']=_0x55c073[_0x0ab4('0x41')];}if(_0x55c073[_0x0ab4('0x4c')]&&agents[_0x55c073[_0x0ab4('0x4c')]]){agents[_0x55c073[_0x0ab4('0x4c')]]['agententerreason']=0x1;transfers[_0x55c073['transfertargetuniqueid']]=_[_0x0ab4('0x48')](agents[_0x55c073[_0x0ab4('0x4c')]]);transfers[_0x55c073['transfertargetuniqueid']][_0x0ab4('0x49')]=agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x49')];transfers[_0x55c073['transfertargetuniqueid']][_0x0ab4('0x4a')]=agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x4a')];transfers[_0x55c073[_0x0ab4('0x4c')]][_0x0ab4('0x17')]=utils[_0x0ab4('0x18')]();transfers[_0x55c073[_0x0ab4('0x4c')]][_0x0ab4('0x2c')]=utils['now']();transfers[_0x55c073['transfertargetuniqueid']][_0x0ab4('0x29')]=0x0;transfers[_0x55c073[_0x0ab4('0x4c')]][_0x0ab4('0x47')]=0x2;}}}catch(_0xc23642){utils['error'](util[_0x0ab4('0x3')]('[%s][agents][attendedtransfer]',_0x55c073[_0x0ab4('0x3e')]),_0xc23642);}};exports[_0x0ab4('0x4d')]=function(_0x18308f){try{utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x4e'),_0x18308f[_0x0ab4('0x5')]),_0x18308f);if(agents[_0x18308f[_0x0ab4('0x5')]]&&agents[_0x18308f[_0x0ab4('0x5')]]['reason']===_0x0ab4('0x21')){if(_0x18308f['cause']==='21'){agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')]=_0x0ab4('0x4f');agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]=_0x0ab4('0x4f');}utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x50'),_0x18308f['uniqueid'],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x1f')],agents[_0x18308f['uniqueid']][_0x0ab4('0x22')],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]));writeDB(agents[_0x18308f['uniqueid']]);var _0x3feaaa=unanswered[_0x0ab4('0x51')](_0x18308f[_0x0ab4('0x5')]);if(_0x3feaaa>-0x1){unanswered[_0x0ab4('0x52')](_0x3feaaa,0x1);}}if(transfers[_0x18308f['uniqueid']]){transfers[_0x18308f['uniqueid']][_0x0ab4('0xe')]=!![];transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x32')]=utils[_0x0ab4('0x18')]();transfers[_0x18308f['uniqueid']][_0x0ab4('0x24')]=utils[_0x0ab4('0x33')](transfers[_0x18308f[_0x0ab4('0x5')]]['agentcompleteAt'],transfers[_0x18308f['uniqueid']][_0x0ab4('0x2c')]);transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')]=_0x0ab4('0x53');transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]=_0x0ab4('0x34');utils['info'](util[_0x0ab4('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x18308f['uniqueid'],transfers[_0x18308f[_0x0ab4('0x5')]]['membername'],transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')],transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]));writeDB(transfers[_0x18308f[_0x0ab4('0x5')]],!![]);}if(agents[_0x18308f['uniqueid']]&&agents[_0x18308f['uniqueid']][_0x0ab4('0x2c')]){agents[_0x18308f[_0x0ab4('0x5')]]['agentcomplete']=!![];agents[_0x18308f['uniqueid']][_0x0ab4('0x32')]=utils[_0x0ab4('0x18')]();agents[_0x18308f['uniqueid']][_0x0ab4('0x24')]=utils[_0x0ab4('0x33')](agents[_0x18308f[_0x0ab4('0x5')]]['agentcompleteAt'],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x2c')]);agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')]=agents[_0x18308f['uniqueid']][_0x0ab4('0x42')]?_0x0ab4('0x42'):_0x0ab4('0x53');agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]=_0x0ab4('0x34');utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x50'),_0x18308f[_0x0ab4('0x5')],agents[_0x18308f['uniqueid']][_0x0ab4('0x1f')],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]));writeDB(agents[_0x18308f['uniqueid']]);}}catch(_0x448fcb){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')](_0x0ab4('0x4e'),_0x18308f[_0x0ab4('0x5')]),_0x448fcb);}}; \ No newline at end of file +var _0x3f8c=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','./utils','info','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','rejected','indexOf','splice','agent'];(function(_0x35b127,_0x297e17){var _0x50dbaa=function(_0x3d833a){while(--_0x3d833a){_0x35b127['push'](_0x35b127['shift']());}};_0x50dbaa(++_0x297e17);}(_0x3f8c,0x104));var _0xc3f8=function(_0x3b2277,_0x1cc2b4){_0x3b2277=_0x3b2277-0x0;var _0x288d72=_0x3f8c[_0x3b2277];return _0x288d72;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xc3f8('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3a1f6a,_0x2e70c4){utils[_0xc3f8('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3a1f6a['uniqueid'],_0x3a1f6a['channel'],_0x3a1f6a['queue'],_0x3a1f6a[_0xc3f8('0x2')],_0x3a1f6a[_0xc3f8('0x3')],_0x3a1f6a[_0xc3f8('0x4')],_0x3a1f6a[_0xc3f8('0x5')],_0x3a1f6a[_0xc3f8('0x6')]));if(_0x3a1f6a[_0xc3f8('0x7')]){utils['getVoiceQueueByName'](_0x3a1f6a[_0xc3f8('0x7')])[_0xc3f8('0x8')](function(_0x15cb3b){if(_0x15cb3b){_0x3a1f6a[_0xc3f8('0x9')]=_0x15cb3b[_0xc3f8('0x9')];_0x3a1f6a[_0xc3f8('0xa')]=_0x3a1f6a[_0xc3f8('0xb')]?_0x15cb3b['acw']:![];_0x3a1f6a[_0xc3f8('0xc')]=_0x3a1f6a[_0xc3f8('0xa')]?_0x15cb3b[_0xc3f8('0xd')]:0x0;}utils[_0xc3f8('0xe')]('CreateVoiceAgentReport',_0x3a1f6a);});}else{utils[_0xc3f8('0xe')](_0xc3f8('0xf'),_0x3a1f6a);}if(_0x2e70c4){delete transfers[_0x3a1f6a[_0xc3f8('0x10')]];}else{delete agents[_0x3a1f6a[_0xc3f8('0x11')]];}}exports['agentcalled']=function(_0x84f489){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x14'),_0x84f489[_0xc3f8('0x10')]),_0x84f489);agents[_0x84f489[_0xc3f8('0x11')]]=_0x84f489;agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x17');agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinenum']=null;agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinename']=null;utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x18'),_0x84f489[_0xc3f8('0x10')],agents[_0x84f489[_0xc3f8('0x11')]]['membername'],_0x84f489[_0xc3f8('0x11')]));}catch(_0x1db809){utils['error'](util[_0xc3f8('0x13')]('[%s][agents][agentcalled]',_0x84f489[_0xc3f8('0x10')]),_0x1db809);}};exports[_0xc3f8('0x19')]=function(_0x3b2e98){try{if(!_['isNil'](agents[_0x3b2e98['destuniqueid']])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98[_0xc3f8('0x10')]),_0x3b2e98);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x1b'),_0x3b2e98[_0xc3f8('0x10')],agents[_0x3b2e98['destuniqueid']]['membername'],_0x3b2e98['destuniqueid']));agents[_0x3b2e98[_0xc3f8('0x11')]]['agentringnoanswer']=!![];agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1c')]=utils['now']();agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1f')]=_0x3b2e98[_0xc3f8('0x20')]?parseInt(_0x3b2e98[_0xc3f8('0x20')])/0x3e8:0x0;agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x21')]=0x0;unanswered[_0xc3f8('0x22')](_0x3b2e98[_0xc3f8('0x11')]);}}catch(_0x59e4dd){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98['uniqueid']),_0x59e4dd);}};exports[_0xc3f8('0x24')]=function(_0x4d39a0){try{_[_0xc3f8('0x25')](agents,function(_0x32343e,_0x47ab53){if(_0x32343e['uniqueid']==_0x4d39a0[_0xc3f8('0x10')]&&!_[_0xc3f8('0x26')](unanswered,_0x32343e[_0xc3f8('0x11')])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0[_0xc3f8('0x10')]),_0x4d39a0);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x28'),_0x4d39a0['uniqueid'],_0x32343e[_0xc3f8('0x2')],_0x32343e[_0xc3f8('0x11')]));_0x32343e[_0xc3f8('0x19')]=!![];_0x32343e[_0xc3f8('0x1c')]=utils[_0xc3f8('0x16')]();_0x32343e['lastevent']='abandoned';_0x32343e[_0xc3f8('0x1e')]=_0xc3f8('0x29');_0x32343e[_0xc3f8('0x1f')]=_0x4d39a0[_0xc3f8('0x1f')];_0x32343e[_0xc3f8('0x21')]=0x0;writeDB(_0x32343e);}});}catch(_0x4e51ac){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0['uniqueid']),_0x4e51ac);}};exports[_0xc3f8('0x2a')]=function(_0x11ecc2){try{if(agents[_0x11ecc2[_0xc3f8('0x11')]]){utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x11ecc2);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x2c'),_0x11ecc2[_0xc3f8('0x10')],agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x11ecc2['destuniqueid']));agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x5')]=_0x11ecc2['connectedlinenum'];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2e')]=_0x11ecc2[_0xc3f8('0x2e')];agents[_0x11ecc2['destuniqueid']][_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x6')]='connect';_[_0xc3f8('0x25')](agents,function(_0x45d416,_0x2df096){if(_0x45d416[_0xc3f8('0x11')]!=_0x11ecc2['destuniqueid']&&_0x45d416[_0xc3f8('0x10')]==_0x11ecc2['uniqueid']){_0x45d416['talktime']=0x0;_0x45d416[_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];_0x45d416[_0xc3f8('0x19')]=!![];_0x45d416[_0xc3f8('0x1c')]=utils['now']();_0x45d416['lastevent']=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x1e')]=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x30')]=_0x11ecc2[_0xc3f8('0x11')];_0x45d416[_0xc3f8('0x31')]=_0x11ecc2[_0xc3f8('0x2')];writeDB(_0x45d416);}});}}catch(_0x45e6ea){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x45e6ea);}};exports[_0xc3f8('0xb')]=function(_0x22e9b3){try{if(!_['isNil'](agents[_0x22e9b3[_0xc3f8('0x11')]])){utils[_0xc3f8('0x12')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0x22e9b3);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x33'),_0x22e9b3[_0xc3f8('0x10')],agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x22e9b3[_0xc3f8('0x11')]));agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0xb')]=!![];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x34')],agents[_0x22e9b3['destuniqueid']]['agentconnectAt']);agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0x22e9b3[_0xc3f8('0x1e')];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x36');writeDB(agents[_0x22e9b3[_0xc3f8('0x11')]]);}}catch(_0xe3d5c4){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0xe3d5c4);}};exports['blindtransfer']=function(_0x1becae){try{if(!_[_0xc3f8('0x37')](agents[_0x1becae[_0xc3f8('0x38')]])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae[_0xc3f8('0x10')]),_0x1becae);utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x3a'),_0x1becae['uniqueid'],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x2')],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')]));agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3b')]=!![];agents[_0x1becae[_0xc3f8('0x38')]]['transfertype']=_0xc3f8('0x3c');agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3d')]=_0x1becae[_0xc3f8('0x3e')];agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3f')]=agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')];}}catch(_0x4fc02c){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae['uniqueid']),_0x4fc02c);}};exports['attendedtransfer']=function(_0x773d56){try{utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x773d56);if(_0x773d56['origtransfereruniqueid']==_0x773d56[_0xc3f8('0x42')]){if(!_['isNil'](agents[_0x773d56['secondtransfereruniqueid']])){utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x44')]]['membername']));agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56['secondtransfereruniqueid']]['transferexten']=_0x773d56[_0xc3f8('0x47')];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3f')]=_0x773d56[_0xc3f8('0x41')];}if(_0x773d56[_0xc3f8('0x48')]&&agents[_0x773d56['transfereeuniqueid']]){agents[_0x773d56[_0xc3f8('0x48')]]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x48')]]=_[_0xc3f8('0x49')](agents[_0x773d56[_0xc3f8('0x48')]]);transfers[_0x773d56[_0xc3f8('0x48')]]['calleridnum']=agents[_0x773d56[_0xc3f8('0x44')]]['calleridnum'];transfers[_0x773d56['transfereeuniqueid']]['calleridname']=agents[_0x773d56['secondtransfereruniqueid']][_0xc3f8('0x4a')];transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x4b')]=0x2;}}else if(_0x773d56[_0xc3f8('0x44')]==_0x773d56[_0xc3f8('0x4c')]){if(!_[_0xc3f8('0x37')](agents[_0x773d56['origtransfereruniqueid']])){utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x41')]]['membername']));agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56[_0xc3f8('0x41')]]['transferexten']=_0x773d56[_0xc3f8('0x4d')];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3f')]=_0x773d56['secondtransfereruniqueid'];}if(_0x773d56[_0xc3f8('0x4e')]&&agents[_0x773d56[_0xc3f8('0x4e')]]){agents[_0x773d56['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x4e')]]=_[_0xc3f8('0x49')](agents[_0x773d56['transfertargetuniqueid']]);transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4')];transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4a')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4a')];transfers[_0x773d56['transfertargetuniqueid']]['agentcalledAt']=utils[_0xc3f8('0x16')]();transfers[_0x773d56['transfertargetuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x773d56['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4b')]=0x2;}}}catch(_0x188d39){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x188d39);}};exports['hangup']=function(_0x3b9b47){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')]('[%s][agents][hangup]',_0x3b9b47[_0xc3f8('0x10')]),_0x3b9b47);if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47['uniqueid']]['reason']===_0xc3f8('0x1d')){if(_0x3b9b47[_0xc3f8('0x4f')]==='21'){agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')]=_0xc3f8('0x50');agents[_0x3b9b47['uniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x50');}utils['info'](util[_0xc3f8('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47[_0xc3f8('0x10')]]['membername'],agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],agents[_0x3b9b47[_0xc3f8('0x10')]]['lastevent']));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);var _0x5de19e=unanswered[_0xc3f8('0x51')](_0x3b9b47['uniqueid']);if(_0x5de19e>-0x1){unanswered[_0xc3f8('0x52')](_0x5de19e,0x1);}}if(transfers[_0x3b9b47[_0xc3f8('0x10')]]){transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0xb')]=!![];transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x21')]=utils['diffTime'](transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]);transfers[_0x3b9b47[_0xc3f8('0x10')]]['reason']=_0xc3f8('0x53');transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],transfers[_0x3b9b47[_0xc3f8('0x10')]]['membername'],transfers[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(transfers[_0x3b9b47[_0xc3f8('0x10')]],!![]);}if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]){agents[_0x3b9b47[_0xc3f8('0x10')]]['agentcomplete']=!![];agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils['now']();agents[_0x3b9b47['uniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x3b9b47['uniqueid']][_0xc3f8('0x34')],agents[_0x3b9b47[_0xc3f8('0x10')]]['agentconnectAt']);agents[_0x3b9b47[_0xc3f8('0x10')]]['reason']=agents[_0x3b9b47[_0xc3f8('0x10')]]['transfer']?_0xc3f8('0x3b'):_0xc3f8('0x53');agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47['uniqueid']]['membername'],agents[_0x3b9b47[_0xc3f8('0x10')]]['reason'],agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);}}catch(_0xfb05eb){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x55'),_0x3b9b47[_0xc3f8('0x10')]),_0xfb05eb);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7249eca..8fefdcd 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 _0x2842=['./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','[%s][calls][newstate]','isNil','channelstate','info','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','xmd-phone','[%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','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','noop','execif','util','./utils'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0x2842,0x1ba));var _0x2284=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2842[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0x2284('0x0'));var utils=require(_0x2284('0x1'));var transfers=require(_0x2284('0x2'));var dispositions=[_0x2284('0x3'),_0x2284('0x4'),'FAILED',_0x2284('0x3'),_0x2284('0x3'),'NO\x20ANSWER',_0x2284('0x5'),_0x2284('0x6'),_0x2284('0x4'),_0x2284('0x4'),_0x2284('0x4')];var channels={};function writeDB(_0x2f43bf){var _0x4f9375;if(transfers[_0x2284('0x7')][_0x2f43bf['uniqueid']]){_0x4f9375=_0x2f43bf[_0x2284('0x8')];_0x2f43bf[_0x2284('0x8')]=transfers[_0x2284('0x7')][_0x2f43bf['uniqueid']][_0x2284('0x9')];}utils['info'](util[_0x2284('0xa')](_0x2284('0xb'),_0x2f43bf[_0x2284('0x8')],_0x2f43bf[_0x2284('0xc')],_0x2f43bf[_0x2284('0xd')],_0x2f43bf[_0x2284('0xe')],_0x2f43bf[_0x2284('0xf')],_0x2f43bf['calleridnum'],_0x2f43bf[_0x2284('0x10')],_0x2f43bf['lastevent']));if(_0x2f43bf[_0x2284('0x11')]){utils[_0x2284('0x12')](_0x2f43bf[_0x2284('0x11')])[_0x2284('0x13')](function(_0x56b45b){if(_0x56b45b){_0x2f43bf[_0x2284('0x14')]=_0x56b45b['id'];}utils[_0x2284('0x15')]('CreateVoiceCallReport',_0x2f43bf);});}else{utils[_0x2284('0x15')]('CreateVoiceCallReport',_0x2f43bf);}if(channels[_0x2f43bf['uniqueid']]){delete channels[_0x2f43bf[_0x2284('0x8')]];}else if(_0x4f9375&&channels[_0x4f9375]){if(!transfers[_0x2284('0x7')][_0x4f9375][_0x2284('0x16')])delete transfers[_0x2284('0x7')][_0x4f9375];delete channels[_0x4f9375];}}exports[_0x2284('0x17')]=function(_0x578eff){try{utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x19'),_0x578eff['uniqueid']),_0x578eff);if(_0x578eff[_0x2284('0x8')]==_0x578eff[_0x2284('0x1a')]&&_0x578eff[_0x2284('0xc')]!=_0x2284('0x1b')){utils['info'](util[_0x2284('0xa')](_0x2284('0x1c'),_0x578eff['uniqueid'],_0x578eff[_0x2284('0x1d')],_0x578eff['exten']));channels[_0x578eff[_0x2284('0x8')]]={'uniqueid':_0x578eff['uniqueid'],'accountcode':_0x578eff[_0x2284('0x11')],'source':_0x578eff['calleridnum'],'destination':_0x578eff[_0x2284('0x1e')],'destinationcontext':_0x578eff[_0x2284('0x1d')],'channel':_0x578eff[_0x2284('0xc')],'starttime':utils[_0x2284('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2284('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x3e8f59){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x19'),_0x578eff[_0x2284('0x8')]),_0x3e8f59);}};exports['newstate']=function(_0x23e6f8){try{utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x21'),_0x23e6f8[_0x2284('0x8')]),_0x23e6f8);if(!_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x8')]])&&_0x23e6f8[_0x2284('0x23')]==0x6){utils[_0x2284('0x24')](util['format'](_0x2284('0x25'),_0x23e6f8[_0x2284('0x8')],_0x23e6f8[_0x2284('0x1d')],_0x23e6f8[_0x2284('0xc')]));if(_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x8')]]['systemanswertime'])){channels[_0x23e6f8[_0x2284('0x8')]][_0x2284('0x26')]=utils['now']();}}else if(!_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x1a')]])&&_0x23e6f8[_0x2284('0x23')]==0x6&&_0x23e6f8[_0x2284('0x1d')]!='transfer'){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x27'),_0x23e6f8[_0x2284('0x8')],_0x23e6f8[_0x2284('0x1a')],_0x23e6f8['context'],_0x23e6f8[_0x2284('0xc')]));channels[_0x23e6f8[_0x2284('0x1a')]][_0x2284('0x11')]=_0x23e6f8[_0x2284('0x11')];channels[_0x23e6f8[_0x2284('0x1a')]][_0x2284('0x28')]=_0x23e6f8[_0x2284('0xc')];if(_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x1a')]][_0x2284('0x29')])){channels[_0x23e6f8['linkedid']][_0x2284('0x29')]=utils['now']();}channels[_0x23e6f8[_0x2284('0x1a')]]['disposition']=dispositions[_[_0x2284('0x2a')](_0x23e6f8[_0x2284('0x23')])]||_0x2284('0x5');}}catch(_0x1d5b75){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x21'),_0x23e6f8[_0x2284('0x8')]),_0x1d5b75);}};exports[_0x2284('0x2b')]=function(_0x39e489){try{if(!_[_0x2284('0x22')](channels[_0x39e489[_0x2284('0x8')]])){utils[_0x2284('0x18')](util[_0x2284('0xa')]('[%s][calls][hangup]',_0x39e489[_0x2284('0x8')]),_0x39e489);if(_[_0x2284('0x22')](channels[_0x39e489['uniqueid']][_0x2284('0x2c')])){channels[_0x39e489[_0x2284('0x8')]]['callerid']=_0x39e489[_0x2284('0x2d')]+'\x20<'+_0x39e489[_0x2284('0x2e')]+'>';}utils[_0x2284('0x24')](util['format'](_0x2284('0x2f'),_0x39e489[_0x2284('0x8')],channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x2c')],_0x39e489[_0x2284('0x30')]));channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x31')]=utils[_0x2284('0x1f')]();channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x32')]=utils[_0x2284('0x33')](channels[_0x39e489['uniqueid']][_0x2284('0x31')],channels[_0x39e489['uniqueid']][_0x2284('0x34')]);channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x35')]=channels[_0x39e489['uniqueid']][_0x2284('0x29')]?utils['diffTime'](channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x31')],channels[_0x39e489['uniqueid']][_0x2284('0x29')]):0x0;writeDB(channels[_0x39e489['uniqueid']]);}}catch(_0x5621d5){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x36'),_0x39e489[_0x2284('0x8')]),_0x5621d5);}};exports[_0x2284('0x37')]=function(_0x5912ef){try{if(!_['isNil'](channels[_0x5912ef[_0x2284('0x38')]])){utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x39'),_0x5912ef[_0x2284('0x3a')]),_0x5912ef);if(channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0xc')]==_0x5912ef[_0x2284('0x3b')]){utils['info'](util[_0x2284('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5912ef[_0x2284('0x3a')],_0x5912ef[_0x2284('0x38')],_0x5912ef[_0x2284('0x3c')]));channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0x28')]=_0x5912ef[_0x2284('0x3c')];channels[_0x5912ef['localtwolinkedid']][_0x2284('0x3d')]='_attended';}else if(channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0xc')]=_0x5912ef[_0x2284('0x3e')]){utils[_0x2284('0x24')](util['format'](_0x2284('0x3f'),_0x5912ef[_0x2284('0x3a')],_0x5912ef[_0x2284('0x38')],_0x5912ef['origtransfererchannel']));channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0x28')]=_0x5912ef['origtransfererchannel'];channels[_0x5912ef[_0x2284('0x38')]]['userfield']=_0x2284('0x40');}}}catch(_0x5d9ef0){utils[_0x2284('0x20')](util['format'](_0x2284('0x39'),_0x5912ef[_0x2284('0x3a')]),_0x5d9ef0);}};exports['musiconholdstart']=function(_0x414a87){try{if(!_['isNil'](channels[_0x414a87['uniqueid']])){utils[_0x2284('0x18')](util['format'](_0x2284('0x41'),_0x414a87[_0x2284('0x8')]),_0x414a87);channels[_0x414a87[_0x2284('0x8')]][_0x2284('0x42')]=utils[_0x2284('0x1f')]();utils[_0x2284('0x24')](util['format'](_0x2284('0x43'),_0x414a87[_0x2284('0x8')],channels[_0x414a87[_0x2284('0x8')]][_0x2284('0x42')]));}}catch(_0x4e33c1){utils[_0x2284('0x20')](util['format'](_0x2284('0x41'),_0x414a87['uniqueid']),_0x4e33c1);}};exports['musiconholdstop']=function(_0xeecfae){try{if(!_['isNil'](channels[_0xeecfae['uniqueid']])){utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x44'),_0xeecfae[_0x2284('0x8')]),_0xeecfae);if(!_[_0x2284('0x22')](channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x42')])){channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x45')]+=utils['diffTime'](utils[_0x2284('0x1f')](),channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x42')]);utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x46'),_0xeecfae[_0x2284('0x8')],channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x45')]));delete channels[_0xeecfae['uniqueid']]['musiconholdstartAt'];}}}catch(_0x489bb1){utils[_0x2284('0x20')](util['format'](_0x2284('0x44'),_0xeecfae[_0x2284('0x8')]),_0x489bb1);}};exports[_0x2284('0x47')]=function(_0x5758ad){try{if(!_[_0x2284('0x22')](channels[_0x5758ad['uniqueid']])){utils[_0x2284('0x18')](util[_0x2284('0xa')]('[%s][calls][varset]',_0x5758ad['uniqueid']),_0x5758ad);if(!_[_0x2284('0x22')](_0x5758ad['variable'][_0x2284('0x48')])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x49'),_0x5758ad['uniqueid'],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]]['source']=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x4c')])){utils['info'](util[_0x2284('0xa')](_0x2284('0x4d'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x4e')]=_0x5758ad[_0x2284('0x4a')];channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x2c')]='\x22'+_0x5758ad[_0x2284('0x4a')]+_0x2284('0x4f')+_0x5758ad[_0x2284('0x4a')]+'>';}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x50')])||!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x51')])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x52'),_0x5758ad[_0x2284('0x8')],!_['isNil'](_0x5758ad[_0x2284('0x4b')]['xmd-callerid-preview'])?_0x2284('0x50'):'xmd-callerid',_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x2c')]=_0x5758ad[_0x2284('0x4a')];}if(!_['isNil'](_0x5758ad[_0x2284('0x4b')][_0x2284('0x53')])||!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')]['xmcs-queue'])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x52'),_0x5758ad['uniqueid'],!_['isNil'](_0x5758ad[_0x2284('0x4b')][_0x2284('0x53')])?'xmd-queue':_0x2284('0x54'),_0x5758ad['value']));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x55')]='Queue';channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x56')]=_0x5758ad[_0x2284('0x4a')];channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0xd')]=!![];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x57')])){utils['info'](util[_0x2284('0xa')](_0x2284('0x58'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x59')]=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x5a')])){utils[_0x2284('0x24')](util[_0x2284('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5758ad['uniqueid'],_0x5758ad['value']));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x5b')]=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x5c')])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x5d'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]]['routeid']=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')]['sipcallid'])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x5e'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad['uniqueid']][_0x2284('0x5f')]=_0x5758ad[_0x2284('0x4a')];}}}catch(_0x5c7e93){utils[_0x2284('0x20')](util['format'](_0x2284('0x60'),_0x5758ad[_0x2284('0x8')]),_0x5c7e93);}};exports[_0x2284('0x61')]=function(_0x5cfd46){try{if(!_[_0x2284('0x22')](channels[_0x5cfd46[_0x2284('0x8')]])){utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x62'),_0x5cfd46['uniqueid']),_0x5cfd46);utils[_0x2284('0x24')](util['format'](_0x2284('0x63'),_0x5cfd46['uniqueid'],_0x5cfd46[_0x2284('0x64')],_0x5cfd46[_0x2284('0x65')]));if(_0x5cfd46[_0x2284('0x64')][_0x2284('0x66')]()==_0x2284('0x67')&&_[_0x2284('0x68')](_0x5cfd46['appdata'][_0x2284('0x66')](),_0x2284('0x69'))){var _0x10f52a=_0x5cfd46[_0x2284('0x65')][_0x2284('0x6a')]('=');var _0x44af90=_0x10f52a[0x0][_0x2284('0x6b')](_0x10f52a[0x0][_0x2284('0x6c')]('(')+0x1,_0x10f52a[0x0]['lastIndexOf'](')'));var _0x41e9de=_0x10f52a[0x1];channels[_0x5cfd46['uniqueid']][_0x44af90]=_0x41e9de;}if(!_['includes']([_0x2284('0x2b'),_0x2284('0x6d'),_0x2284('0x6e'),'set','gotoif'],_0x5cfd46[_0x2284('0x64')][_0x2284('0x66')]())){channels[_0x5cfd46[_0x2284('0x8')]][_0x2284('0x55')]=_0x5cfd46[_0x2284('0x64')];channels[_0x5cfd46['uniqueid']]['lastdata']=_0x5cfd46[_0x2284('0x65')];}}}catch(_0x24419d){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x62'),_0x5cfd46['uniqueid']),_0x24419d);}}; \ No newline at end of file +var _0xcb1a=['answertime','disposition','toNumber','error','[%s][calls][hangup]','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','application','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb1a,0xb6));var _0xacb1=function(_0x5065f8,_0x141374){_0x5065f8=_0x5065f8-0x0;var _0x5a6de4=_0xcb1a[_0x5065f8];return _0x5a6de4;};'use strict';var _=require(_0xacb1('0x0'));var util=require(_0xacb1('0x1'));var utils=require(_0xacb1('0x2'));var transfers=require(_0xacb1('0x3'));var dispositions=['NO\x20ANSWER','FAILED',_0xacb1('0x4'),'NO\x20ANSWER',_0xacb1('0x5'),_0xacb1('0x5'),'ANSWERED',_0xacb1('0x6'),_0xacb1('0x4'),_0xacb1('0x4'),_0xacb1('0x4')];var channels={};function writeDB(_0x270f0d){var _0xb6ec05;if(transfers['blinds'][_0x270f0d[_0xacb1('0x7')]]){_0xb6ec05=_0x270f0d[_0xacb1('0x7')];_0x270f0d[_0xacb1('0x7')]=transfers[_0xacb1('0x8')][_0x270f0d[_0xacb1('0x7')]][_0xacb1('0x9')];}utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0xc'),_0x270f0d[_0xacb1('0x7')],_0x270f0d[_0xacb1('0xd')],_0x270f0d['queue'],_0x270f0d[_0xacb1('0xe')],_0x270f0d[_0xacb1('0xf')],_0x270f0d['calleridnum'],_0x270f0d['connectedlinenum'],_0x270f0d[_0xacb1('0x10')]));if(_0x270f0d[_0xacb1('0x11')]){utils[_0xacb1('0x12')](_0x270f0d[_0xacb1('0x11')])[_0xacb1('0x13')](function(_0x40c6cc){if(_0x40c6cc){_0x270f0d['UserId']=_0x40c6cc['id'];}utils[_0xacb1('0x14')]('CreateVoiceCallReport',_0x270f0d);});}else{utils[_0xacb1('0x14')](_0xacb1('0x15'),_0x270f0d);}if(channels[_0x270f0d[_0xacb1('0x7')]]){delete channels[_0x270f0d[_0xacb1('0x7')]];}else if(_0xb6ec05&&channels[_0xb6ec05]){if(!transfers['blinds'][_0xb6ec05]['recording'])delete transfers[_0xacb1('0x8')][_0xb6ec05];delete channels[_0xb6ec05];}}exports[_0xacb1('0x16')]=function(_0x31ee0b){try{utils[_0xacb1('0x17')](util[_0xacb1('0xb')](_0xacb1('0x18'),_0x31ee0b[_0xacb1('0x7')]),_0x31ee0b);if(_0x31ee0b[_0xacb1('0x7')]==_0x31ee0b[_0xacb1('0x19')]&&_0x31ee0b[_0xacb1('0xd')]!=_0xacb1('0x1a')){utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x1b'),_0x31ee0b[_0xacb1('0x7')],_0x31ee0b[_0xacb1('0x1c')],_0x31ee0b[_0xacb1('0x1d')]));channels[_0x31ee0b[_0xacb1('0x7')]]={'uniqueid':_0x31ee0b[_0xacb1('0x7')],'accountcode':_0x31ee0b[_0xacb1('0x11')],'source':_0x31ee0b[_0xacb1('0x1e')],'destination':_0x31ee0b[_0xacb1('0x1d')],'destinationcontext':_0x31ee0b[_0xacb1('0x1c')],'channel':_0x31ee0b[_0xacb1('0xd')],'starttime':utils[_0xacb1('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xacb1('0x20')};}}catch(_0x2f9eb8){utils['error'](util['format'](_0xacb1('0x18'),_0x31ee0b[_0xacb1('0x7')]),_0x2f9eb8);}};exports['newstate']=function(_0xd8284d){try{utils[_0xacb1('0x17')](util[_0xacb1('0xb')](_0xacb1('0x21'),_0xd8284d['uniqueid']),_0xd8284d);if(!_['isNil'](channels[_0xd8284d[_0xacb1('0x7')]])&&_0xd8284d[_0xacb1('0x22')]==0x6){utils['info'](util[_0xacb1('0xb')](_0xacb1('0x23'),_0xd8284d[_0xacb1('0x7')],_0xd8284d[_0xacb1('0x1c')],_0xd8284d[_0xacb1('0xd')]));if(_['isNil'](channels[_0xd8284d[_0xacb1('0x7')]][_0xacb1('0x24')])){channels[_0xd8284d['uniqueid']][_0xacb1('0x24')]=utils[_0xacb1('0x1f')]();}}else if(!_[_0xacb1('0x25')](channels[_0xd8284d['linkedid']])&&_0xd8284d[_0xacb1('0x22')]==0x6&&_0xd8284d[_0xacb1('0x1c')]!='transfer'){utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x26'),_0xd8284d['uniqueid'],_0xd8284d['linkedid'],_0xd8284d[_0xacb1('0x1c')],_0xd8284d['channel']));channels[_0xd8284d[_0xacb1('0x19')]][_0xacb1('0x11')]=_0xd8284d[_0xacb1('0x11')];channels[_0xd8284d[_0xacb1('0x19')]][_0xacb1('0x27')]=_0xd8284d[_0xacb1('0xd')];if(_[_0xacb1('0x25')](channels[_0xd8284d[_0xacb1('0x19')]][_0xacb1('0x28')])){channels[_0xd8284d[_0xacb1('0x19')]][_0xacb1('0x28')]=utils[_0xacb1('0x1f')]();}channels[_0xd8284d[_0xacb1('0x19')]][_0xacb1('0x29')]=dispositions[_[_0xacb1('0x2a')](_0xd8284d[_0xacb1('0x22')])]||'ANSWERED';}}catch(_0x2b029a){utils[_0xacb1('0x2b')](util['format'](_0xacb1('0x21'),_0xd8284d[_0xacb1('0x7')]),_0x2b029a);}};exports['hangup']=function(_0x8f329a){try{if(!_[_0xacb1('0x25')](channels[_0x8f329a[_0xacb1('0x7')]])){utils['debug'](util[_0xacb1('0xb')](_0xacb1('0x2c'),_0x8f329a[_0xacb1('0x7')]),_0x8f329a);if(_[_0xacb1('0x25')](channels[_0x8f329a[_0xacb1('0x7')]][_0xacb1('0x2d')])){channels[_0x8f329a[_0xacb1('0x7')]][_0xacb1('0x2d')]=_0x8f329a['calleridname']+'\x20<'+_0x8f329a[_0xacb1('0x1e')]+'>';}utils[_0xacb1('0xa')](util[_0xacb1('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x8f329a[_0xacb1('0x7')],channels[_0x8f329a[_0xacb1('0x7')]]['callerid'],_0x8f329a[_0xacb1('0x2e')]));channels[_0x8f329a[_0xacb1('0x7')]][_0xacb1('0x2f')]=utils[_0xacb1('0x1f')]();channels[_0x8f329a['uniqueid']][_0xacb1('0x30')]=utils[_0xacb1('0x31')](channels[_0x8f329a[_0xacb1('0x7')]][_0xacb1('0x2f')],channels[_0x8f329a['uniqueid']][_0xacb1('0x32')]);channels[_0x8f329a[_0xacb1('0x7')]][_0xacb1('0x33')]=channels[_0x8f329a[_0xacb1('0x7')]][_0xacb1('0x28')]?utils[_0xacb1('0x31')](channels[_0x8f329a[_0xacb1('0x7')]][_0xacb1('0x2f')],channels[_0x8f329a['uniqueid']][_0xacb1('0x28')]):0x0;writeDB(channels[_0x8f329a[_0xacb1('0x7')]]);}}catch(_0x3a76c5){utils[_0xacb1('0x2b')](util[_0xacb1('0xb')]('[%s][calls][hangup]',_0x8f329a['uniqueid']),_0x3a76c5);}};exports[_0xacb1('0x34')]=function(_0x34aae2){try{if(!_[_0xacb1('0x25')](channels[_0x34aae2[_0xacb1('0x35')]])){utils[_0xacb1('0x17')](util[_0xacb1('0xb')](_0xacb1('0x36'),_0x34aae2[_0xacb1('0x37')]),_0x34aae2);if(channels[_0x34aae2[_0xacb1('0x35')]][_0xacb1('0xd')]==_0x34aae2['transfereechannel']){utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x38'),_0x34aae2[_0xacb1('0x37')],_0x34aae2[_0xacb1('0x35')],_0x34aae2[_0xacb1('0x39')]));channels[_0x34aae2['localtwolinkedid']][_0xacb1('0x27')]=_0x34aae2['secondtransfererchannel'];channels[_0x34aae2[_0xacb1('0x35')]][_0xacb1('0x3a')]=_0xacb1('0x3b');}else if(channels[_0x34aae2['localtwolinkedid']][_0xacb1('0xd')]=_0x34aae2[_0xacb1('0x3c')]){utils[_0xacb1('0xa')](util[_0xacb1('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x34aae2[_0xacb1('0x37')],_0x34aae2[_0xacb1('0x35')],_0x34aae2[_0xacb1('0x3d')]));channels[_0x34aae2[_0xacb1('0x35')]]['destinationchannel']=_0x34aae2['origtransfererchannel'];channels[_0x34aae2['localtwolinkedid']][_0xacb1('0x3a')]='_attended';}}}catch(_0x404df6){utils['error'](util[_0xacb1('0xb')](_0xacb1('0x36'),_0x34aae2[_0xacb1('0x37')]),_0x404df6);}};exports[_0xacb1('0x3e')]=function(_0x5c2532){try{if(!_[_0xacb1('0x25')](channels[_0x5c2532[_0xacb1('0x7')]])){utils[_0xacb1('0x17')](util[_0xacb1('0xb')](_0xacb1('0x3f'),_0x5c2532[_0xacb1('0x7')]),_0x5c2532);channels[_0x5c2532[_0xacb1('0x7')]][_0xacb1('0x40')]=utils[_0xacb1('0x1f')]();utils[_0xacb1('0xa')](util[_0xacb1('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x5c2532['uniqueid'],channels[_0x5c2532[_0xacb1('0x7')]][_0xacb1('0x40')]));}}catch(_0x31ffd2){utils[_0xacb1('0x2b')](util[_0xacb1('0xb')](_0xacb1('0x3f'),_0x5c2532[_0xacb1('0x7')]),_0x31ffd2);}};exports[_0xacb1('0x41')]=function(_0x3f6063){try{if(!_[_0xacb1('0x25')](channels[_0x3f6063['uniqueid']])){utils[_0xacb1('0x17')](util[_0xacb1('0xb')]('[%s][calls][musiconholdstop]',_0x3f6063[_0xacb1('0x7')]),_0x3f6063);if(!_['isNil'](channels[_0x3f6063[_0xacb1('0x7')]][_0xacb1('0x40')])){channels[_0x3f6063[_0xacb1('0x7')]][_0xacb1('0x42')]+=utils['diffTime'](utils[_0xacb1('0x1f')](),channels[_0x3f6063[_0xacb1('0x7')]][_0xacb1('0x40')]);utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x43'),_0x3f6063[_0xacb1('0x7')],channels[_0x3f6063[_0xacb1('0x7')]][_0xacb1('0x42')]));delete channels[_0x3f6063[_0xacb1('0x7')]][_0xacb1('0x40')];}}}catch(_0x18ebf4){utils[_0xacb1('0x2b')](util['format'](_0xacb1('0x44'),_0x3f6063['uniqueid']),_0x18ebf4);}};exports[_0xacb1('0x45')]=function(_0xa07dae){try{if(!_[_0xacb1('0x25')](channels[_0xa07dae[_0xacb1('0x7')]])){utils['debug'](util[_0xacb1('0xb')]('[%s][calls][varset]',_0xa07dae[_0xacb1('0x7')]),_0xa07dae);if(!_['isNil'](_0xa07dae[_0xacb1('0x46')][_0xacb1('0x47')])){utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x48'),_0xa07dae[_0xacb1('0x7')],_0xa07dae['value']));channels[_0xa07dae[_0xacb1('0x7')]][_0xacb1('0x49')]=_0xa07dae[_0xacb1('0x4a')];}if(!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')][_0xacb1('0x4b')])){utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x4c'),_0xa07dae[_0xacb1('0x7')],_0xa07dae[_0xacb1('0x4a')]));channels[_0xa07dae['uniqueid']][_0xacb1('0x4d')]=_0xa07dae['value'];channels[_0xa07dae[_0xacb1('0x7')]]['callerid']='\x22'+_0xa07dae[_0xacb1('0x4a')]+_0xacb1('0x4e')+_0xa07dae['value']+'>';}if(!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')][_0xacb1('0x4f')])||!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')]['xmd-callerid'])){utils[_0xacb1('0xa')](util[_0xacb1('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xa07dae[_0xacb1('0x7')],!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')][_0xacb1('0x4f')])?_0xacb1('0x4f'):'xmd-callerid',_0xa07dae['value']));channels[_0xa07dae[_0xacb1('0x7')]]['callerid']=_0xa07dae[_0xacb1('0x4a')];}if(!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')]['xmd-queue'])||!_['isNil'](_0xa07dae['variable']['xmcs-queue'])){utils[_0xacb1('0xa')](util[_0xacb1('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xa07dae[_0xacb1('0x7')],!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')][_0xacb1('0x50')])?_0xacb1('0x50'):_0xacb1('0x51'),_0xa07dae[_0xacb1('0x4a')]));channels[_0xa07dae[_0xacb1('0x7')]][_0xacb1('0x52')]=_0xacb1('0x53');channels[_0xa07dae[_0xacb1('0x7')]][_0xacb1('0x54')]=_0xa07dae[_0xacb1('0x4a')];channels[_0xa07dae['uniqueid']]['queue']=!![];}if(!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')][_0xacb1('0x55')])){utils['info'](util['format'](_0xacb1('0x56'),_0xa07dae[_0xacb1('0x7')],_0xa07dae[_0xacb1('0x4a')]));channels[_0xa07dae[_0xacb1('0x7')]][_0xacb1('0x57')]=_0xa07dae[_0xacb1('0x4a')];}if(!_[_0xacb1('0x25')](_0xa07dae['variable'][_0xacb1('0x58')])){utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x59'),_0xa07dae[_0xacb1('0x7')],_0xa07dae[_0xacb1('0x4a')]));channels[_0xa07dae[_0xacb1('0x7')]]['type']=_0xa07dae[_0xacb1('0x4a')];}if(!_[_0xacb1('0x25')](_0xa07dae[_0xacb1('0x46')][_0xacb1('0x5a')])){utils[_0xacb1('0xa')](util['format'](_0xacb1('0x5b'),_0xa07dae[_0xacb1('0x7')],_0xa07dae[_0xacb1('0x4a')]));channels[_0xa07dae[_0xacb1('0x7')]][_0xacb1('0x5c')]=_0xa07dae[_0xacb1('0x4a')];}if(!_['isNil'](_0xa07dae['variable']['sipcallid'])){utils[_0xacb1('0xa')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xa07dae[_0xacb1('0x7')],_0xa07dae[_0xacb1('0x4a')]));channels[_0xa07dae[_0xacb1('0x7')]][_0xacb1('0x5d')]=_0xa07dae[_0xacb1('0x4a')];}}}catch(_0x10f2c9){utils[_0xacb1('0x2b')](util[_0xacb1('0xb')](_0xacb1('0x5e'),_0xa07dae[_0xacb1('0x7')]),_0x10f2c9);}};exports[_0xacb1('0x5f')]=function(_0x1b565b){try{if(!_[_0xacb1('0x25')](channels[_0x1b565b[_0xacb1('0x7')]])){utils[_0xacb1('0x17')](util[_0xacb1('0xb')](_0xacb1('0x60'),_0x1b565b[_0xacb1('0x7')]),_0x1b565b);utils[_0xacb1('0xa')](util[_0xacb1('0xb')](_0xacb1('0x61'),_0x1b565b['uniqueid'],_0x1b565b['application'],_0x1b565b[_0xacb1('0x62')]));if(_0x1b565b['application'][_0xacb1('0x63')]()==_0xacb1('0x64')&&_[_0xacb1('0x65')](_0x1b565b[_0xacb1('0x62')][_0xacb1('0x63')](),'cdr')){var _0x5e98c4=_0x1b565b[_0xacb1('0x62')][_0xacb1('0x66')]('=');var _0x360f06=_0x5e98c4[0x0][_0xacb1('0x67')](_0x5e98c4[0x0][_0xacb1('0x68')]('(')+0x1,_0x5e98c4[0x0]['lastIndexOf'](')'));var _0x51143b=_0x5e98c4[0x1];channels[_0x1b565b[_0xacb1('0x7')]][_0x360f06]=_0x51143b;}if(!_[_0xacb1('0x69')]([_0xacb1('0x6a'),_0xacb1('0x6b'),_0xacb1('0x6c'),_0xacb1('0x64'),_0xacb1('0x6d')],_0x1b565b[_0xacb1('0x6e')][_0xacb1('0x63')]())){channels[_0x1b565b[_0xacb1('0x7')]][_0xacb1('0x52')]=_0x1b565b[_0xacb1('0x6e')];channels[_0x1b565b[_0xacb1('0x7')]][_0xacb1('0x54')]=_0x1b565b[_0xacb1('0x62')];}}}catch(_0x1ab5a0){utils[_0xacb1('0x2b')](util[_0xacb1('0xb')](_0xacb1('0x60'),_0x1b565b['uniqueid']),_0x1ab5a0);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 5c7d329..727c90d 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 _0x2894=['[core]\x20connected','shutdown','[core]\x20shutdown','info','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','./utils','connect'];(function(_0x2e3531,_0x1f0a91){var _0x39f792=function(_0x453003){while(--_0x453003){_0x2e3531['push'](_0x2e3531['shift']());}};_0x39f792(++_0x1f0a91);}(_0x2894,0xb2));var _0x4289=function(_0x3a68a0,_0x5a26d7){_0x3a68a0=_0x3a68a0-0x0;var _0x3db8ff=_0x2894[_0x3a68a0];return _0x3db8ff;};'use strict';var utils=require(_0x4289('0x0'));exports[_0x4289('0x1')]=function(){utils['info'](_0x4289('0x2'));};exports[_0x4289('0x3')]=function(){utils['info'](_0x4289('0x4'));};exports['fullybooted']=function(){utils[_0x4289('0x5')](_0x4289('0x6'));};exports[_0x4289('0x7')]=function(_0x1f7dc8){utils[_0x4289('0x7')](_0x4289('0x8'),_0x1f7dc8);};exports['close']=function(){utils[_0x4289('0x5')](_0x4289('0x9'));};exports['managerevent']=function(_0x11203a){}; \ No newline at end of file +var _0x42fa=['connect','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','info','error','close','managerevent','./utils'];(function(_0x47e6e6,_0x18d48e){var _0x2845f0=function(_0x1bee10){while(--_0x1bee10){_0x47e6e6['push'](_0x47e6e6['shift']());}};_0x2845f0(++_0x18d48e);}(_0x42fa,0x103));var _0xa42f=function(_0xe9099e,_0x3e387d){_0xe9099e=_0xe9099e-0x0;var _0x25fedd=_0x42fa[_0xe9099e];return _0x25fedd;};'use strict';var utils=require(_0xa42f('0x0'));exports[_0xa42f('0x1')]=function(){utils['info'](_0xa42f('0x2'));};exports[_0xa42f('0x3')]=function(){utils['info'](_0xa42f('0x4'));};exports[_0xa42f('0x5')]=function(){utils[_0xa42f('0x6')]('[core]\x20fullybooted');};exports['error']=function(_0x1fea3b){utils[_0xa42f('0x7')]('[core]\x20error',_0x1fea3b);};exports[_0xa42f('0x8')]=function(){utils[_0xa42f('0x6')]('[core]\x20close');};exports[_0xa42f('0x9')]=function(_0x5c529b){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 328751a..33843f1 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 _0x3c3d=['format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','uniqueid','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','now','lastevent','called','starttime','[%s][dials][dialbegin]','dialend','debug','[%s][dials][dialend]','dialstatus','ANSWER','assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','./utils','info'];(function(_0x46bfe1,_0x42d186){var _0x42c931=function(_0x230eaf){while(--_0x230eaf){_0x46bfe1['push'](_0x46bfe1['shift']());}};_0x42c931(++_0x42d186);}(_0x3c3d,0x146));var _0xd3c3=function(_0x5aedf7,_0xb2ed87){_0x5aedf7=_0x5aedf7-0x0;var _0x2189b2=_0x3c3d[_0x5aedf7];return _0x2189b2;};'use strict';var _=require(_0xd3c3('0x0'));var util=require(_0xd3c3('0x1'));var utils=require(_0xd3c3('0x2'));var dials={};function writeDB(_0x435abb){utils[_0xd3c3('0x3')](util[_0xd3c3('0x4')](_0xd3c3('0x5'),_0x435abb['uniqueid'],_0x435abb[_0xd3c3('0x6')],_0x435abb[_0xd3c3('0x7')],_0x435abb[_0xd3c3('0x8')],_0x435abb['connectedlinenum'],_0x435abb['dialstatus']));utils[_0xd3c3('0x9')](_0xd3c3('0xa'),_0x435abb);delete dials[_0x435abb['uniqueid']];}exports[_0xd3c3('0xb')]=function(_0x4849e7){try{utils['debug'](util[_0xd3c3('0x4')](_0xd3c3('0xc'),_0x4849e7['uniqueid']),_0x4849e7);utils['info'](util[_0xd3c3('0x4')](_0xd3c3('0xd'),_0x4849e7[_0xd3c3('0xe')],_0x4849e7[_0xd3c3('0xf')],_0x4849e7[_0xd3c3('0x10')]));if(_0x4849e7['application'][_0xd3c3('0x11')]()==_0xd3c3('0x12')&&_[_0xd3c3('0x13')](_0x4849e7[_0xd3c3('0x10')][_0xd3c3('0x11')](),_0xd3c3('0x14'))){var _0xec0dd9=_0x4849e7[_0xd3c3('0x10')]['split']('=');dials[_0x4849e7[_0xd3c3('0xe')]]={'routeId':_0xec0dd9[0x1]};}}catch(_0x4d1e2b){utils[_0xd3c3('0x15')](util[_0xd3c3('0x4')]('[%s][dials][newexten]',_0x4849e7[_0xd3c3('0xe')]),_0x4d1e2b);}};exports[_0xd3c3('0x16')]=function(_0x2c7c7b){try{utils['debug'](util['format'](_0xd3c3('0x17'),_0x2c7c7b['uniqueid']),_0x2c7c7b);if(!_[_0xd3c3('0x18')](_0x2c7c7b[_0xd3c3('0x19')][_0xd3c3('0x1a')])){utils['info'](util[_0xd3c3('0x4')](_0xd3c3('0x1b'),_0x2c7c7b[_0xd3c3('0xe')],_0x2c7c7b[_0xd3c3('0x1c')]));dials[_0x2c7c7b[_0xd3c3('0xe')]]={'routeId':_0x2c7c7b[_0xd3c3('0x1c')]};}}catch(_0x11ab2d){utils['error'](util[_0xd3c3('0x4')]('[%s][dials][varset]',_0x2c7c7b[_0xd3c3('0xe')]),_0x11ab2d);}};exports[_0xd3c3('0x1d')]=function(_0x35ad34){try{if(!_['isNil'](dials[_0x35ad34[_0xd3c3('0xe')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x35ad34[_0xd3c3('0xe')]),_0x35ad34);dials[_0x35ad34[_0xd3c3('0xe')]]=_['assign'](dials[_0x35ad34[_0xd3c3('0xe')]],_0x35ad34);dials[_0x35ad34['uniqueid']]['starttime']=utils[_0xd3c3('0x1e')]();dials[_0x35ad34[_0xd3c3('0xe')]][_0xd3c3('0x1f')]=_0xd3c3('0x20');utils[_0xd3c3('0x3')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x35ad34[_0xd3c3('0xe')],dials[_0x35ad34[_0xd3c3('0xe')]][_0xd3c3('0x21')]));}}catch(_0x5bee6f){utils['error'](util[_0xd3c3('0x4')](_0xd3c3('0x22'),_0x35ad34['uniqueid']),_0x5bee6f);}};exports[_0xd3c3('0x23')]=function(_0x1c9e54){try{if(!_[_0xd3c3('0x18')](dials[_0x1c9e54['uniqueid']])){utils[_0xd3c3('0x24')](util[_0xd3c3('0x4')](_0xd3c3('0x25'),_0x1c9e54[_0xd3c3('0xe')]),_0x1c9e54);dials[_0x1c9e54[_0xd3c3('0xe')]][_0xd3c3('0x26')]=_0x1c9e54[_0xd3c3('0x26')];if(_0x1c9e54[_0xd3c3('0x26')]==_0xd3c3('0x27')){dials[_0x1c9e54[_0xd3c3('0xe')]]=_[_0xd3c3('0x28')](dials[_0x1c9e54['uniqueid']],_0x1c9e54);dials[_0x1c9e54[_0xd3c3('0xe')]]['answertime']=utils[_0xd3c3('0x1e')]();dials[_0x1c9e54['uniqueid']][_0xd3c3('0x1f')]=_0xd3c3('0x29');utils[_0xd3c3('0x3')](util[_0xd3c3('0x4')](_0xd3c3('0x2a'),_0x1c9e54[_0xd3c3('0xe')],_0x1c9e54['dialstatus'],dials[_0x1c9e54['uniqueid']][_0xd3c3('0x2b')]));}else{utils[_0xd3c3('0x3')](util['format'](_0xd3c3('0x2c'),_0x1c9e54[_0xd3c3('0xe')],_0x1c9e54[_0xd3c3('0x26')]));}}}catch(_0x279eb2){utils[_0xd3c3('0x15')](util[_0xd3c3('0x4')]('[%s][dials][dialend]',_0x1c9e54['uniqueid']),_0x279eb2);}};exports[_0xd3c3('0x2d')]=function(_0x174276){try{if(!_[_0xd3c3('0x18')](dials[_0x174276[_0xd3c3('0xe')]])){utils[_0xd3c3('0x24')](util[_0xd3c3('0x4')](_0xd3c3('0x2e'),_0x174276[_0xd3c3('0xe')]),_0x174276);utils[_0xd3c3('0x3')](util['format'](_0xd3c3('0x2f'),_0x174276[_0xd3c3('0xe')],_0x174276[_0xd3c3('0x8')],_0x174276[_0xd3c3('0x30')],_0x174276[_0xd3c3('0x31')]));dials[_0x174276[_0xd3c3('0xe')]]=_['assign'](dials[_0x174276['uniqueid']],{'endtime':utils[_0xd3c3('0x1e')](),'lastevent':_0xd3c3('0x32')});dials[_0x174276['uniqueid']][_0xd3c3('0x33')]=utils[_0xd3c3('0x34')](dials[_0x174276['uniqueid']][_0xd3c3('0x35')],dials[_0x174276['uniqueid']][_0xd3c3('0x21')]);dials[_0x174276[_0xd3c3('0xe')]]['holdtime']=utils[_0xd3c3('0x34')](dials[_0x174276['uniqueid']]['answertime']||dials[_0x174276[_0xd3c3('0xe')]][_0xd3c3('0x35')],dials[_0x174276['uniqueid']][_0xd3c3('0x21')]);dials[_0x174276[_0xd3c3('0xe')]][_0xd3c3('0x36')]=dials[_0x174276[_0xd3c3('0xe')]][_0xd3c3('0x2b')]?utils[_0xd3c3('0x34')](dials[_0x174276['uniqueid']][_0xd3c3('0x35')],dials[_0x174276[_0xd3c3('0xe')]]['answertime']):0x0;writeDB(dials[_0x174276[_0xd3c3('0xe')]]);}}catch(_0xa93e44){utils[_0xd3c3('0x15')](util[_0xd3c3('0x4')](_0xd3c3('0x2e'),_0x174276[_0xd3c3('0xe')]),_0xa93e44);}}; \ No newline at end of file +var _0x91a9=['isNil','variable','outboundrouteid','value','error','dialbegin','[%s][dials][dialbegin]','assign','lastevent','starttime','[%s][dials][dialend]','dialstatus','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','diffTime','endtime','holdtime','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','varset','[%s][dials][varset]'];(function(_0x21a0e4,_0x376ce7){var _0x31df96=function(_0x537da5){while(--_0x537da5){_0x21a0e4['push'](_0x21a0e4['shift']());}};_0x31df96(++_0x376ce7);}(_0x91a9,0xd8));var _0x991a=function(_0x253232,_0x34a158){_0x253232=_0x253232-0x0;var _0x5b80d1=_0x91a9[_0x253232];return _0x5b80d1;};'use strict';var _=require(_0x991a('0x0'));var util=require(_0x991a('0x1'));var utils=require(_0x991a('0x2'));var dials={};function writeDB(_0x2557d6){utils[_0x991a('0x3')](util['format'](_0x991a('0x4'),_0x2557d6[_0x991a('0x5')],_0x2557d6[_0x991a('0x6')],_0x2557d6[_0x991a('0x7')],_0x2557d6[_0x991a('0x8')],_0x2557d6[_0x991a('0x9')],_0x2557d6['dialstatus']));utils['request'](_0x991a('0xa'),_0x2557d6);delete dials[_0x2557d6[_0x991a('0x5')]];}exports[_0x991a('0xb')]=function(_0xc78b5d){try{utils[_0x991a('0xc')](util['format'](_0x991a('0xd'),_0xc78b5d['uniqueid']),_0xc78b5d);utils[_0x991a('0x3')](util[_0x991a('0xe')](_0x991a('0xf'),_0xc78b5d['uniqueid'],_0xc78b5d[_0x991a('0x10')],_0xc78b5d[_0x991a('0x11')]));if(_0xc78b5d[_0x991a('0x10')][_0x991a('0x12')]()==_0x991a('0x13')&&_['startsWith'](_0xc78b5d['appdata']['toLowerCase'](),_0x991a('0x14'))){var _0x461f4e=_0xc78b5d[_0x991a('0x11')][_0x991a('0x15')]('=');dials[_0xc78b5d[_0x991a('0x5')]]={'routeId':_0x461f4e[0x1]};}}catch(_0xe48714){utils['error'](util['format']('[%s][dials][newexten]',_0xc78b5d[_0x991a('0x5')]),_0xe48714);}};exports[_0x991a('0x16')]=function(_0x2ac7d8){try{utils[_0x991a('0xc')](util['format'](_0x991a('0x17'),_0x2ac7d8['uniqueid']),_0x2ac7d8);if(!_[_0x991a('0x18')](_0x2ac7d8[_0x991a('0x19')][_0x991a('0x1a')])){utils[_0x991a('0x3')](util[_0x991a('0xe')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x2ac7d8[_0x991a('0x5')],_0x2ac7d8[_0x991a('0x1b')]));dials[_0x2ac7d8[_0x991a('0x5')]]={'routeId':_0x2ac7d8[_0x991a('0x1b')]};}}catch(_0xb749a5){utils[_0x991a('0x1c')](util[_0x991a('0xe')](_0x991a('0x17'),_0x2ac7d8[_0x991a('0x5')]),_0xb749a5);}};exports[_0x991a('0x1d')]=function(_0x3ea43d){try{if(!_[_0x991a('0x18')](dials[_0x3ea43d[_0x991a('0x5')]])){utils['debug'](util['format'](_0x991a('0x1e'),_0x3ea43d['uniqueid']),_0x3ea43d);dials[_0x3ea43d[_0x991a('0x5')]]=_[_0x991a('0x1f')](dials[_0x3ea43d['uniqueid']],_0x3ea43d);dials[_0x3ea43d[_0x991a('0x5')]]['starttime']=utils['now']();dials[_0x3ea43d[_0x991a('0x5')]][_0x991a('0x20')]='called';utils[_0x991a('0x3')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3ea43d['uniqueid'],dials[_0x3ea43d[_0x991a('0x5')]][_0x991a('0x21')]));}}catch(_0x34a9fd){utils[_0x991a('0x1c')](util['format'](_0x991a('0x1e'),_0x3ea43d[_0x991a('0x5')]),_0x34a9fd);}};exports['dialend']=function(_0x136319){try{if(!_[_0x991a('0x18')](dials[_0x136319[_0x991a('0x5')]])){utils['debug'](util[_0x991a('0xe')](_0x991a('0x22'),_0x136319[_0x991a('0x5')]),_0x136319);dials[_0x136319[_0x991a('0x5')]][_0x991a('0x23')]=_0x136319[_0x991a('0x23')];if(_0x136319[_0x991a('0x23')]=='ANSWER'){dials[_0x136319[_0x991a('0x5')]]=_[_0x991a('0x1f')](dials[_0x136319[_0x991a('0x5')]],_0x136319);dials[_0x136319['uniqueid']][_0x991a('0x24')]=utils[_0x991a('0x25')]();dials[_0x136319[_0x991a('0x5')]][_0x991a('0x20')]=_0x991a('0x26');utils[_0x991a('0x3')](util[_0x991a('0xe')](_0x991a('0x27'),_0x136319[_0x991a('0x5')],_0x136319[_0x991a('0x23')],dials[_0x136319[_0x991a('0x5')]][_0x991a('0x24')]));}else{utils[_0x991a('0x3')](util[_0x991a('0xe')](_0x991a('0x28'),_0x136319[_0x991a('0x5')],_0x136319[_0x991a('0x23')]));}}}catch(_0xd727e4){utils[_0x991a('0x1c')](util[_0x991a('0xe')](_0x991a('0x22'),_0x136319['uniqueid']),_0xd727e4);}};exports[_0x991a('0x29')]=function(_0x2e0c52){try{if(!_[_0x991a('0x18')](dials[_0x2e0c52[_0x991a('0x5')]])){utils[_0x991a('0xc')](util[_0x991a('0xe')]('[%s][dials][hangup]',_0x2e0c52['uniqueid']),_0x2e0c52);utils[_0x991a('0x3')](util['format'](_0x991a('0x2a'),_0x2e0c52['uniqueid'],_0x2e0c52[_0x991a('0x8')],_0x2e0c52['calleridname'],_0x2e0c52[_0x991a('0x2b')]));dials[_0x2e0c52['uniqueid']]=_[_0x991a('0x1f')](dials[_0x2e0c52[_0x991a('0x5')]],{'endtime':utils[_0x991a('0x25')](),'lastevent':'complete'});dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x2c')]=utils[_0x991a('0x2d')](dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x2e')],dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x21')]);dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x2f')]=utils[_0x991a('0x2d')](dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x24')]||dials[_0x2e0c52[_0x991a('0x5')]]['endtime'],dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x21')]);dials[_0x2e0c52[_0x991a('0x5')]]['billableseconds']=dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x24')]?utils['diffTime'](dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x2e')],dials[_0x2e0c52[_0x991a('0x5')]][_0x991a('0x24')]):0x0;writeDB(dials[_0x2e0c52['uniqueid']]);}}catch(_0x5ab691){utils[_0x991a('0x1c')](util[_0x991a('0xe')]('[%s][dials][hangup]',_0x2e0c52[_0x991a('0x5')]),_0x5ab691);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 821727f..c33df8d 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 _0xd0d6=['varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','password','xdr','disabled','info','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','agentcalled','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid'];(function(_0x142071,_0x500736){var _0x8a949f=function(_0x227cf1){while(--_0x227cf1){_0x142071['push'](_0x142071['shift']());}};_0x8a949f(++_0x500736);}(_0xd0d6,0x17e));var _0x6d0d=function(_0x54e0aa,_0xdd58e7){_0x54e0aa=_0x54e0aa-0x0;var _0xe25182=_0xd0d6[_0x54e0aa];return _0xe25182;};var AsteriskManager=require(_0x6d0d('0x0'));var config=require(_0x6d0d('0x1'));var utils=require(_0x6d0d('0x2'));var util=require(_0x6d0d('0x3'));var ami=new AsteriskManager(config[_0x6d0d('0x4')][_0x6d0d('0x5')],config[_0x6d0d('0x4')]['ip'],config['asterisk']['username'],config[_0x6d0d('0x4')][_0x6d0d('0x6')],!![]);ami['keepConnected']();if(config[_0x6d0d('0x7')]&&config['xdr'][_0x6d0d('0x8')]){utils[_0x6d0d('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0x6d0d('0xa'));var calls=require('./calls.controller');var queues=require(_0x6d0d('0xb'));var recordings=require(_0x6d0d('0xc'));var members=require(_0x6d0d('0xd'));var dials=require('./dials.controller');var transfers=require(_0x6d0d('0xe'));var core=require(_0x6d0d('0xf'));ami['on'](_0x6d0d('0x10'),core[_0x6d0d('0x10')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0x6d0d('0x11'),core[_0x6d0d('0x11')]);ami['on'](_0x6d0d('0x12'),core[_0x6d0d('0x12')]);ami['on']('close',core[_0x6d0d('0x13')]);ami['on'](_0x6d0d('0x14'),core[_0x6d0d('0x14')]);ami['on'](_0x6d0d('0x15'),function(_0x579842){try{utils[_0x6d0d('0x16')](util['format'](_0x6d0d('0x17'),_0x579842[_0x6d0d('0x18')]),_0x579842);members[_0x6d0d('0x15')](_0x579842);}catch(_0x22c7e6){utils[_0x6d0d('0x12')](util['format'](_0x6d0d('0x17'),_0x579842[_0x6d0d('0x18')]),_0x22c7e6);}});ami['on'](_0x6d0d('0x19'),function(_0x2a5f6f){try{utils['debug'](util[_0x6d0d('0x1a')](_0x6d0d('0x1b'),_0x2a5f6f['uniqueid']),_0x2a5f6f);agents[_0x6d0d('0x19')](_0x2a5f6f);}catch(_0x46eff7){utils['error'](util['format']('[%s][index][agentcalled]',_0x2a5f6f[_0x6d0d('0x1c')]),_0x46eff7);}});ami['on'](_0x6d0d('0x1d'),function(_0x356d31){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x1e'),_0x356d31[_0x6d0d('0x1c')]),_0x356d31);agents[_0x6d0d('0x1d')](_0x356d31);}catch(_0x791e2){utils[_0x6d0d('0x12')](util['format']('[%s][index][agentringnoanswer]',_0x356d31[_0x6d0d('0x1c')]),_0x791e2);}});ami['on'](_0x6d0d('0x1f'),function(_0x451815){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x20'),_0x451815['uniqueid']),_0x451815);agents[_0x6d0d('0x1f')](_0x451815);queues['agentconnect'](_0x451815);}catch(_0x217b8e){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x20'),_0x451815[_0x6d0d('0x1c')]),_0x217b8e);}});ami['on'](_0x6d0d('0x21'),function(_0x522d91){try{utils[_0x6d0d('0x16')](util['format']('[%s][index][agentcomplete]',_0x522d91[_0x6d0d('0x1c')]),_0x522d91);agents[_0x6d0d('0x21')](_0x522d91);queues[_0x6d0d('0x21')](_0x522d91);members[_0x6d0d('0x21')](_0x522d91);}catch(_0x2e2381){utils['error'](util[_0x6d0d('0x1a')]('[%s][index][agentcomplete]',_0x522d91[_0x6d0d('0x1c')]),_0x2e2381);}});ami['on']('queuecallerabandon',function(_0x224ebe){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x22'),_0x224ebe['uniqueid']),_0x224ebe);agents['queuecallerabandon'](_0x224ebe);queues['queuecallerabandon'](_0x224ebe);}catch(_0x21923c){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')]('[%s][index][queuecallerabandon]',_0x224ebe[_0x6d0d('0x1c')]),_0x21923c);}});ami['on'](_0x6d0d('0x23'),function(_0x318189){try{utils[_0x6d0d('0x16')](util['format'](_0x6d0d('0x24'),_0x318189['uniqueid']),_0x318189);queues[_0x6d0d('0x23')](_0x318189);recordings[_0x6d0d('0x23')](_0x318189);}catch(_0x189f0c){utils['error'](util[_0x6d0d('0x1a')](_0x6d0d('0x24'),_0x318189[_0x6d0d('0x1c')]),_0x189f0c);}});ami['on']('queuecallerleave',function(_0xa98c28){try{utils['debug'](util['format'](_0x6d0d('0x25'),_0xa98c28[_0x6d0d('0x1c')]),_0xa98c28);queues['queuecallerleave'](_0xa98c28);}catch(_0x20b186){utils[_0x6d0d('0x12')](util['format']('[%s][index][queuecallerleave]',_0xa98c28[_0x6d0d('0x1c')]),_0x20b186);}});ami['on']('musiconholdstart',function(_0x4685af){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x26'),_0x4685af[_0x6d0d('0x1c')]),_0x4685af);queues[_0x6d0d('0x27')](_0x4685af);calls[_0x6d0d('0x27')](_0x4685af);}catch(_0x1c2fb4){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x26'),_0x4685af[_0x6d0d('0x1c')]),_0x1c2fb4);}});ami['on'](_0x6d0d('0x28'),function(_0x25036c){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')]('[%s][index][musiconholdstop]',_0x25036c['uniqueid']),_0x25036c);queues[_0x6d0d('0x28')](_0x25036c);calls[_0x6d0d('0x28')](_0x25036c);}catch(_0x1cbf46){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')]('[%s][index][musiconholdstop]',_0x25036c[_0x6d0d('0x1c')]),_0x1cbf46);}});ami['on']('newstate',function(_0x777a9a){try{utils[_0x6d0d('0x16')](util['format'](_0x6d0d('0x29'),_0x777a9a[_0x6d0d('0x1c')]),_0x777a9a);calls[_0x6d0d('0x2a')](_0x777a9a);recordings['newstate'](_0x777a9a);}catch(_0x5307ad){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x29'),_0x777a9a[_0x6d0d('0x1c')]),_0x5307ad);}});ami['on'](_0x6d0d('0x2b'),function(_0x52d50d){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x2c'),_0x52d50d[_0x6d0d('0x1c')]),_0x52d50d);calls[_0x6d0d('0x2b')](_0x52d50d);recordings['hangup'](_0x52d50d);dials[_0x6d0d('0x2b')](_0x52d50d);agents['hangup'](_0x52d50d);queues['hangup'](_0x52d50d);}catch(_0x4d636a){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x2c'),_0x52d50d[_0x6d0d('0x1c')]),_0x4d636a);}});ami['on'](_0x6d0d('0x2d'),function(_0x46bd5f){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x2e'),_0x46bd5f[_0x6d0d('0x1c')]),_0x46bd5f);members[_0x6d0d('0x2d')](_0x46bd5f);}catch(_0xab00d){utils[_0x6d0d('0x12')](util['format'](_0x6d0d('0x2e'),_0x46bd5f[_0x6d0d('0x1c')]),_0xab00d);}});ami['on'](_0x6d0d('0x2f'),function(_0x169d52){try{utils['debug'](util[_0x6d0d('0x1a')]('[%s][index][blindtransfer]',_0x169d52[_0x6d0d('0x1c')]),_0x169d52);queues[_0x6d0d('0x2f')](_0x169d52);agents[_0x6d0d('0x2f')](_0x169d52);transfers[_0x6d0d('0x2f')](_0x169d52);recordings[_0x6d0d('0x2f')](_0x169d52);}catch(_0x4f73c2){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x30'),_0x169d52[_0x6d0d('0x1c')]),_0x4f73c2);}});ami['on'](_0x6d0d('0x31'),function(_0x5b2504){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x32'),_0x5b2504[_0x6d0d('0x33')]),_0x5b2504);queues[_0x6d0d('0x31')](_0x5b2504);transfers[_0x6d0d('0x31')](_0x5b2504);agents[_0x6d0d('0x31')](_0x5b2504);calls['attendedtransfer'](_0x5b2504);}catch(_0x3fd3e3){utils['error'](util[_0x6d0d('0x1a')](_0x6d0d('0x32'),_0x5b2504[_0x6d0d('0x33')]),_0x3fd3e3);}});ami['on'](_0x6d0d('0x34'),function(_0x322539){try{utils['debug'](util[_0x6d0d('0x1a')](_0x6d0d('0x35'),_0x322539[_0x6d0d('0x1c')]),_0x322539);queues[_0x6d0d('0x34')](_0x322539);recordings['varset'](_0x322539);calls[_0x6d0d('0x34')](_0x322539);dials[_0x6d0d('0x34')](_0x322539);}catch(_0x1ff9b3){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x35'),_0x322539[_0x6d0d('0x1c')]),_0x1ff9b3);}});ami['on'](_0x6d0d('0x36'),function(_0x6556dc){try{utils['debug'](util[_0x6d0d('0x1a')](_0x6d0d('0x37'),_0x6556dc[_0x6d0d('0x1c')]),_0x6556dc);calls[_0x6d0d('0x36')](_0x6556dc);recordings[_0x6d0d('0x36')](_0x6556dc);dials['newexten'](_0x6556dc);}catch(_0x366f14){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x37'),_0x6556dc[_0x6d0d('0x1c')]),_0x366f14);}});ami['on'](_0x6d0d('0x38'),function(_0x1aaab5){try{utils['debug'](util[_0x6d0d('0x1a')]('[%s][index][newchannel]',_0x1aaab5[_0x6d0d('0x1c')]),_0x1aaab5);calls[_0x6d0d('0x38')](_0x1aaab5);recordings['newchannel'](_0x1aaab5);}catch(_0x57f93d){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x39'),_0x1aaab5[_0x6d0d('0x1c')]),_0x57f93d);}});ami['on'](_0x6d0d('0x3a'),function(_0x1ab4c8){try{utils[_0x6d0d('0x16')](util['format'](_0x6d0d('0x3b'),_0x1ab4c8[_0x6d0d('0x1c')]),_0x1ab4c8);dials['dialbegin'](_0x1ab4c8);}catch(_0x7b6991){utils[_0x6d0d('0x12')](util['format']('[%s]dialbegin',_0x1ab4c8[_0x6d0d('0x1c')]),_0x7b6991);}});ami['on'](_0x6d0d('0x3c'),function(_0x17b972){try{utils[_0x6d0d('0x16')](util[_0x6d0d('0x1a')](_0x6d0d('0x3d'),_0x17b972[_0x6d0d('0x1c')]),_0x17b972);dials[_0x6d0d('0x3c')](_0x17b972);}catch(_0x3c960c){utils[_0x6d0d('0x12')](util[_0x6d0d('0x1a')](_0x6d0d('0x3d'),_0x17b972['uniqueid']),_0x3c960c);}});} \ No newline at end of file +var _0xb08a=['[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][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','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','./agents.controller','./recordings.controller','./dials.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','format'];(function(_0x178f67,_0x34133d){var _0x298ede=function(_0x2c65cc){while(--_0x2c65cc){_0x178f67['push'](_0x178f67['shift']());}};_0x298ede(++_0x34133d);}(_0xb08a,0xe4));var _0xab08=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0xb08a[_0x53d172];return _0x1bd0a2;};var AsteriskManager=require(_0xab08('0x0'));var config=require('../../config/environment');var utils=require(_0xab08('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0xab08('0x2')][_0xab08('0x3')],config[_0xab08('0x2')]['ip'],config['asterisk'][_0xab08('0x4')],config[_0xab08('0x2')][_0xab08('0x5')],!![]);ami[_0xab08('0x6')]();if(config[_0xab08('0x7')]&&config[_0xab08('0x7')][_0xab08('0x8')]){utils[_0xab08('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0xab08('0xa'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xab08('0xb'));var members=require('./members.controller');var dials=require(_0xab08('0xc'));var transfers=require('./transfers.controller');var core=require(_0xab08('0xd'));ami['on']('connect',core['connect']);ami['on'](_0xab08('0xe'),core[_0xab08('0xe')]);ami['on'](_0xab08('0xf'),core[_0xab08('0xf')]);ami['on'](_0xab08('0x10'),core[_0xab08('0x10')]);ami['on'](_0xab08('0x11'),core[_0xab08('0x11')]);ami['on'](_0xab08('0x12'),core[_0xab08('0x12')]);ami['on']('devicestatechange',function(_0x4d219d){try{utils['debug'](util[_0xab08('0x13')](_0xab08('0x14'),_0x4d219d[_0xab08('0x15')]),_0x4d219d);members['devicestatechange'](_0x4d219d);}catch(_0x1fcc27){utils[_0xab08('0x10')](util[_0xab08('0x13')](_0xab08('0x14'),_0x4d219d[_0xab08('0x15')]),_0x1fcc27);}});ami['on'](_0xab08('0x16'),function(_0x27f562){try{utils[_0xab08('0x17')](util[_0xab08('0x13')](_0xab08('0x18'),_0x27f562[_0xab08('0x19')]),_0x27f562);agents['agentcalled'](_0x27f562);}catch(_0x29a833){utils[_0xab08('0x10')](util['format'](_0xab08('0x18'),_0x27f562[_0xab08('0x19')]),_0x29a833);}});ami['on'](_0xab08('0x1a'),function(_0x203d0b){try{utils[_0xab08('0x17')](util['format'](_0xab08('0x1b'),_0x203d0b[_0xab08('0x19')]),_0x203d0b);agents[_0xab08('0x1a')](_0x203d0b);}catch(_0x4fbbca){utils['error'](util['format'](_0xab08('0x1b'),_0x203d0b[_0xab08('0x19')]),_0x4fbbca);}});ami['on']('agentconnect',function(_0x442a37){try{utils['debug'](util['format'](_0xab08('0x1c'),_0x442a37['uniqueid']),_0x442a37);agents[_0xab08('0x1d')](_0x442a37);queues[_0xab08('0x1d')](_0x442a37);}catch(_0x3c1c5e){utils['error'](util[_0xab08('0x13')](_0xab08('0x1c'),_0x442a37[_0xab08('0x19')]),_0x3c1c5e);}});ami['on'](_0xab08('0x1e'),function(_0x467cab){try{utils[_0xab08('0x17')](util[_0xab08('0x13')](_0xab08('0x1f'),_0x467cab[_0xab08('0x19')]),_0x467cab);agents[_0xab08('0x1e')](_0x467cab);queues[_0xab08('0x1e')](_0x467cab);members[_0xab08('0x1e')](_0x467cab);}catch(_0x223386){utils[_0xab08('0x10')](util[_0xab08('0x13')](_0xab08('0x1f'),_0x467cab[_0xab08('0x19')]),_0x223386);}});ami['on'](_0xab08('0x20'),function(_0x8b1e27){try{utils['debug'](util['format'](_0xab08('0x21'),_0x8b1e27['uniqueid']),_0x8b1e27);agents[_0xab08('0x20')](_0x8b1e27);queues[_0xab08('0x20')](_0x8b1e27);}catch(_0x5d33fe){utils[_0xab08('0x10')](util[_0xab08('0x13')](_0xab08('0x21'),_0x8b1e27[_0xab08('0x19')]),_0x5d33fe);}});ami['on'](_0xab08('0x22'),function(_0x1d9aa3){try{utils['debug'](util[_0xab08('0x13')](_0xab08('0x23'),_0x1d9aa3['uniqueid']),_0x1d9aa3);queues[_0xab08('0x22')](_0x1d9aa3);recordings['queuecallerjoin'](_0x1d9aa3);}catch(_0x5b6fc0){utils['error'](util[_0xab08('0x13')](_0xab08('0x23'),_0x1d9aa3[_0xab08('0x19')]),_0x5b6fc0);}});ami['on'](_0xab08('0x24'),function(_0x1344ae){try{utils['debug'](util[_0xab08('0x13')](_0xab08('0x25'),_0x1344ae[_0xab08('0x19')]),_0x1344ae);queues[_0xab08('0x24')](_0x1344ae);}catch(_0x17ef46){utils[_0xab08('0x10')](util[_0xab08('0x13')]('[%s][index][queuecallerleave]',_0x1344ae['uniqueid']),_0x17ef46);}});ami['on'](_0xab08('0x26'),function(_0x392923){try{utils[_0xab08('0x17')](util[_0xab08('0x13')]('[%s][index][musiconholdstart]',_0x392923[_0xab08('0x19')]),_0x392923);queues['musiconholdstart'](_0x392923);calls[_0xab08('0x26')](_0x392923);}catch(_0x2ac261){utils[_0xab08('0x10')](util[_0xab08('0x13')](_0xab08('0x27'),_0x392923[_0xab08('0x19')]),_0x2ac261);}});ami['on'](_0xab08('0x28'),function(_0x222836){try{utils[_0xab08('0x17')](util['format']('[%s][index][musiconholdstop]',_0x222836['uniqueid']),_0x222836);queues[_0xab08('0x28')](_0x222836);calls['musiconholdstop'](_0x222836);}catch(_0x30544b){utils[_0xab08('0x10')](util[_0xab08('0x13')](_0xab08('0x29'),_0x222836[_0xab08('0x19')]),_0x30544b);}});ami['on'](_0xab08('0x2a'),function(_0x9f1d36){try{utils[_0xab08('0x17')](util[_0xab08('0x13')]('[%s][index][newstate]',_0x9f1d36['uniqueid']),_0x9f1d36);calls['newstate'](_0x9f1d36);recordings[_0xab08('0x2a')](_0x9f1d36);}catch(_0x5c4d05){utils[_0xab08('0x10')](util['format'](_0xab08('0x2b'),_0x9f1d36[_0xab08('0x19')]),_0x5c4d05);}});ami['on'](_0xab08('0x2c'),function(_0x280bf0){try{utils[_0xab08('0x17')](util[_0xab08('0x13')]('[%s][index][hangup]',_0x280bf0[_0xab08('0x19')]),_0x280bf0);calls[_0xab08('0x2c')](_0x280bf0);recordings[_0xab08('0x2c')](_0x280bf0);dials['hangup'](_0x280bf0);agents[_0xab08('0x2c')](_0x280bf0);queues[_0xab08('0x2c')](_0x280bf0);}catch(_0x57210e){utils[_0xab08('0x10')](util['format'](_0xab08('0x2d'),_0x280bf0[_0xab08('0x19')]),_0x57210e);}});ami['on'](_0xab08('0x2e'),function(_0x472019){try{utils[_0xab08('0x17')](util['format']('[%s][index][cdr]',_0x472019[_0xab08('0x19')]),_0x472019);members[_0xab08('0x2e')](_0x472019);}catch(_0x209817){utils['error'](util['format'](_0xab08('0x2f'),_0x472019[_0xab08('0x19')]),_0x209817);}});ami['on'](_0xab08('0x30'),function(_0x3b553d){try{utils['debug'](util[_0xab08('0x13')](_0xab08('0x31'),_0x3b553d[_0xab08('0x19')]),_0x3b553d);queues[_0xab08('0x30')](_0x3b553d);agents[_0xab08('0x30')](_0x3b553d);transfers[_0xab08('0x30')](_0x3b553d);recordings[_0xab08('0x30')](_0x3b553d);}catch(_0xaa26df){utils['error'](util[_0xab08('0x13')]('[%s][index][blindtransfer]',_0x3b553d[_0xab08('0x19')]),_0xaa26df);}});ami['on']('attendedtransfer',function(_0xa7b753){try{utils['debug'](util['format']('[%s][index][attendedtransfer]',_0xa7b753[_0xab08('0x32')]),_0xa7b753);queues[_0xab08('0x33')](_0xa7b753);transfers[_0xab08('0x33')](_0xa7b753);agents['attendedtransfer'](_0xa7b753);calls[_0xab08('0x33')](_0xa7b753);}catch(_0x3c6861){utils['error'](util[_0xab08('0x13')](_0xab08('0x34'),_0xa7b753[_0xab08('0x32')]),_0x3c6861);}});ami['on'](_0xab08('0x35'),function(_0x5b82f4){try{utils['debug'](util[_0xab08('0x13')](_0xab08('0x36'),_0x5b82f4[_0xab08('0x19')]),_0x5b82f4);queues[_0xab08('0x35')](_0x5b82f4);recordings[_0xab08('0x35')](_0x5b82f4);calls[_0xab08('0x35')](_0x5b82f4);dials['varset'](_0x5b82f4);}catch(_0x31d4b8){utils['error'](util[_0xab08('0x13')](_0xab08('0x36'),_0x5b82f4[_0xab08('0x19')]),_0x31d4b8);}});ami['on'](_0xab08('0x37'),function(_0x19896b){try{utils[_0xab08('0x17')](util[_0xab08('0x13')]('[%s][index][newexten]',_0x19896b[_0xab08('0x19')]),_0x19896b);calls[_0xab08('0x37')](_0x19896b);recordings[_0xab08('0x37')](_0x19896b);dials['newexten'](_0x19896b);}catch(_0x530457){utils[_0xab08('0x10')](util['format'](_0xab08('0x38'),_0x19896b['uniqueid']),_0x530457);}});ami['on']('newchannel',function(_0x2db52b){try{utils['debug'](util[_0xab08('0x13')]('[%s][index][newchannel]',_0x2db52b[_0xab08('0x19')]),_0x2db52b);calls[_0xab08('0x39')](_0x2db52b);recordings['newchannel'](_0x2db52b);}catch(_0x4a1f3f){utils['error'](util['format'](_0xab08('0x3a'),_0x2db52b['uniqueid']),_0x4a1f3f);}});ami['on']('dialbegin',function(_0x3f565e){try{utils[_0xab08('0x17')](util['format']('[%s][index][dialbegin]',_0x3f565e[_0xab08('0x19')]),_0x3f565e);dials['dialbegin'](_0x3f565e);}catch(_0x3d046f){utils[_0xab08('0x10')](util[_0xab08('0x13')](_0xab08('0x3b'),_0x3f565e[_0xab08('0x19')]),_0x3d046f);}});ami['on'](_0xab08('0x3c'),function(_0x417d1f){try{utils[_0xab08('0x17')](util['format'](_0xab08('0x3d'),_0x417d1f[_0xab08('0x19')]),_0x417d1f);dials[_0xab08('0x3c')](_0x417d1f);}catch(_0x25bf35){utils['error'](util[_0xab08('0x13')](_0xab08('0x3d'),_0x417d1f[_0xab08('0x19')]),_0x25bf35);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 7666511..722fdab 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 _0xa5fe=['format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Local/_attended@transfer','info'];(function(_0x4ca6f2,_0x58136f){var _0x26c794=function(_0x1a74b3){while(--_0x1a74b3){_0x4ca6f2['push'](_0x4ca6f2['shift']());}};_0x26c794(++_0x58136f);}(_0xa5fe,0xfb));var _0xea5f=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xa5fe[_0x4358f5];return _0x4d8104;};'use strict';var _=require('lodash');var util=require(_0xea5f('0x0'));var utils=require(_0xea5f('0x1'));var members={};var exclude=[_0xea5f('0x2'),'Queue:'];function writeDB(_0x1701d2){utils[_0xea5f('0x3')](util[_0xea5f('0x4')](_0xea5f('0x5'),_0x1701d2[_0xea5f('0x6')],_0x1701d2[_0xea5f('0x7')],_0x1701d2[_0xea5f('0x8')],_0x1701d2[_0xea5f('0x9')],_0x1701d2[_0xea5f('0xa')],_0x1701d2[_0xea5f('0xb')]));if(_0x1701d2[_0xea5f('0x7')]){utils['getUserByInterface'](_0x1701d2[_0xea5f('0x7')])[_0xea5f('0xc')](function(_0x14324e){if(_0x14324e){_0x1701d2[_0xea5f('0xa')]=_0x14324e[_0xea5f('0xd')];_0x1701d2[_0xea5f('0xe')]=_0x14324e[_0xea5f('0xe')];utils[_0xea5f('0xf')](_0xea5f('0x10'),_0x1701d2);}else{utils[_0xea5f('0x11')](_0x1701d2[_0xea5f('0x7')][_0xea5f('0x12')]('/')[0x1])[_0xea5f('0xc')](function(_0x310000){if(_0x310000){_0x1701d2[_0xea5f('0xa')]=_0x310000[_0xea5f('0xd')];_0x1701d2['internal']=_0x310000[_0xea5f('0xe')];utils[_0xea5f('0xf')](_0xea5f('0x10'),_0x1701d2);}});}})[_0xea5f('0x13')](function(_0x5293cb){utils[_0xea5f('0x14')](util[_0xea5f('0x4')](_0xea5f('0x15'),_0x1701d2[_0xea5f('0x6')]),_0x5293cb);});}delete members[_0x1701d2[_0xea5f('0x7')]];}function startsWith(_0x3babc5,_0x558d31){return _[_0xea5f('0x16')](_0x3babc5,function(_0x3aac22){return _[_0xea5f('0x17')](_0x558d31,_0x3aac22);});}exports[_0xea5f('0x18')]=function(_0xf5c4b2){try{utils[_0xea5f('0x19')](util[_0xea5f('0x4')](_0xea5f('0x1a'),members[_0xf5c4b2[_0xea5f('0x1b')]]?members[_0xf5c4b2['device']]['uniqueid']:_0xf5c4b2[_0xea5f('0x1b')]),_0xf5c4b2);utils[_0xea5f('0x3')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0xf5c4b2[_0xea5f('0x1b')]]?members[_0xf5c4b2[_0xea5f('0x1b')]]['uniqueid']:_0xf5c4b2['device'],_0xf5c4b2['state'],_0xf5c4b2[_0xea5f('0x1b')]));switch(_0xf5c4b2[_0xea5f('0x1c')]){case _0xea5f('0x1d'):case _0xea5f('0x1e'):if(!startsWith(exclude,_0xf5c4b2[_0xea5f('0x1b')])){members[_0xf5c4b2['device']]={'channel':_0xea5f('0x1f'),'interface':_0xf5c4b2['device'],'type':_0xea5f('0x20'),'enterAt':utils[_0xea5f('0x21')](),'role':_0xea5f('0x22')};}break;case _0xea5f('0x23'):if(!_[_0xea5f('0x24')](members[_0xf5c4b2['device']])){members[_0xf5c4b2[_0xea5f('0x1b')]][_0xea5f('0x25')]=utils[_0xea5f('0x21')]();members[_0xf5c4b2['device']][_0xea5f('0x26')]=utils[_0xea5f('0x27')](members[_0xf5c4b2['device']]['exitAt'],members[_0xf5c4b2[_0xea5f('0x1b')]][_0xea5f('0x28')]);if(members[_0xf5c4b2[_0xea5f('0x1b')]]['uniqueid']){writeDB(members[_0xf5c4b2['device']]);}}break;default:break;}}catch(_0x17491){utils[_0xea5f('0x14')](util[_0xea5f('0x4')]('[%s][members][devicestatechange]',members[_0xf5c4b2[_0xea5f('0x1b')]]?members[_0xf5c4b2[_0xea5f('0x1b')]][_0xea5f('0x6')]:_0xf5c4b2[_0xea5f('0x1b')]),_0x17491);}};exports[_0xea5f('0x29')]=function(_0x306580){try{if(!_[_0xea5f('0x24')](members[_0x306580[_0xea5f('0x7')]])){utils[_0xea5f('0x19')](util['format'](_0xea5f('0x2a'),_0x306580['uniqueid']),_0x306580);utils['info'](util[_0xea5f('0x4')](_0xea5f('0x2b'),_0x306580['uniqueid'],_0x306580[_0xea5f('0x7')],_0x306580['queue']));members[_0x306580[_0xea5f('0x7')]]=_[_0xea5f('0x2c')](members[_0x306580[_0xea5f('0x7')]],{'data4':_0x306580[_0xea5f('0x2d')],'uniqueid':_0x306580[_0xea5f('0x6')]});}}catch(_0x55627f){utils['error'](util['format'](_0xea5f('0x2a'),_0x306580[_0xea5f('0x6')]),_0x55627f);}};exports[_0xea5f('0x2e')]=function(_0x2dfcbf){try{utils[_0xea5f('0x19')](util['format']('[%s][members][cdr]',_0x2dfcbf[_0xea5f('0x6')]),_0x2dfcbf);if(_0x2dfcbf[_0xea5f('0x8')]){var _0x17a429=_0x2dfcbf['channel'][_0xea5f('0x12')]('-')[0x0];if(!_[_0xea5f('0x24')](members[_0x17a429])){members[_0x17a429]=_[_0xea5f('0x2c')](members[_0x17a429],{'data1':members[_0x17a429][_0xea5f('0x2f')]||_0x2dfcbf['type'],'data2':members[_0x17a429][_0xea5f('0x9')]||_0x2dfcbf[_0xea5f('0x30')],'data3':members[_0x17a429][_0xea5f('0x31')]||_0x2dfcbf['destination'],'uniqueid':members[_0x17a429]['uniqueid']||_0x2dfcbf[_0xea5f('0x6')]});utils[_0xea5f('0x3')](util['format'](_0xea5f('0x32'),_0x2dfcbf[_0xea5f('0x6')],members[_0x17a429][_0xea5f('0x2f')],members[_0x17a429]['data2'],members[_0x17a429][_0xea5f('0x31')]));if(members[_0x17a429][_0xea5f('0x25')]){writeDB(members[_0x17a429]);}}}if(_0x2dfcbf['destinationchannel']){var _0x507056=_0x2dfcbf['destinationchannel'][_0xea5f('0x12')]('-')[0x0];if(!_[_0xea5f('0x24')](members[_0x507056])){members[_0x507056]=_[_0xea5f('0x2c')](members[_0x507056],{'data1':members[_0x507056][_0xea5f('0x2f')]||_0x2dfcbf[_0xea5f('0xb')],'data2':members[_0x507056][_0xea5f('0x9')]||_0x2dfcbf[_0xea5f('0x30')],'data3':members[_0x507056][_0xea5f('0x31')]||_0x2dfcbf['destination'],'uniqueid':members[_0x507056][_0xea5f('0x6')]||_0x2dfcbf[_0xea5f('0x6')]});utils[_0xea5f('0x3')](util['format'](_0xea5f('0x32'),_0x2dfcbf[_0xea5f('0x6')],members[_0x507056][_0xea5f('0x2f')],members[_0x507056][_0xea5f('0x9')],members[_0x507056][_0xea5f('0x31')]));if(members[_0x507056][_0xea5f('0x25')]){writeDB(members[_0x507056]);}}}}catch(_0x2d291b){utils[_0xea5f('0x14')](util[_0xea5f('0x4')]('[%s][members][cdr]',_0x2dfcbf[_0xea5f('0x6')]),_0x2d291b);}}; \ No newline at end of file +var _0x2bd6=['[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','channel','data1','data2','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data3','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','uniqueid','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','error','agentcomplete','debug'];(function(_0x1b4167,_0x525726){var _0x274636=function(_0x3f360d){while(--_0x3f360d){_0x1b4167['push'](_0x1b4167['shift']());}};_0x274636(++_0x525726);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x2bd6[_0x2892da];return _0x28cff2;};'use strict';var _=require(_0x62bd('0x0'));var util=require(_0x62bd('0x1'));var utils=require(_0x62bd('0x2'));var members={};var exclude=[_0x62bd('0x3'),_0x62bd('0x4')];function writeDB(_0x484023){utils[_0x62bd('0x5')](util[_0x62bd('0x6')](_0x62bd('0x7'),_0x484023['uniqueid'],_0x484023[_0x62bd('0x8')],_0x484023['channel'],_0x484023['data2'],_0x484023[_0x62bd('0x9')],_0x484023[_0x62bd('0xa')]));if(_0x484023['interface']){utils[_0x62bd('0xb')](_0x484023[_0x62bd('0x8')])['then'](function(_0x1e3f0e){if(_0x1e3f0e){_0x484023[_0x62bd('0x9')]=_0x1e3f0e[_0x62bd('0xc')];_0x484023[_0x62bd('0xd')]=_0x1e3f0e[_0x62bd('0xd')];utils[_0x62bd('0xe')](_0x62bd('0xf'),_0x484023);}else{utils[_0x62bd('0x10')](_0x484023[_0x62bd('0x8')][_0x62bd('0x11')]('/')[0x1])['then'](function(_0x543c0a){if(_0x543c0a){_0x484023[_0x62bd('0x9')]=_0x543c0a[_0x62bd('0xc')];_0x484023[_0x62bd('0xd')]=_0x543c0a[_0x62bd('0xd')];utils[_0x62bd('0xe')](_0x62bd('0xf'),_0x484023);}});}})['catch'](function(_0x12815e){utils['error'](util[_0x62bd('0x6')]('[%s][members][writeDB]',_0x484023['uniqueid']),_0x12815e);});}delete members[_0x484023[_0x62bd('0x8')]];}function startsWith(_0x397a41,_0x5260f9){return _[_0x62bd('0x12')](_0x397a41,function(_0x1d178b){return _[_0x62bd('0x13')](_0x5260f9,_0x1d178b);});}exports[_0x62bd('0x14')]=function(_0x16f723){try{utils['debug'](util[_0x62bd('0x6')](_0x62bd('0x15'),members[_0x16f723[_0x62bd('0x16')]]?members[_0x16f723[_0x62bd('0x16')]]['uniqueid']:_0x16f723[_0x62bd('0x16')]),_0x16f723);utils[_0x62bd('0x5')](util[_0x62bd('0x6')](_0x62bd('0x17'),members[_0x16f723['device']]?members[_0x16f723[_0x62bd('0x16')]][_0x62bd('0x18')]:_0x16f723[_0x62bd('0x16')],_0x16f723[_0x62bd('0x19')],_0x16f723['device']));switch(_0x16f723[_0x62bd('0x19')]){case _0x62bd('0x1a'):case _0x62bd('0x1b'):if(!startsWith(exclude,_0x16f723[_0x62bd('0x16')])){members[_0x16f723['device']]={'channel':_0x62bd('0x1c'),'interface':_0x16f723[_0x62bd('0x16')],'type':_0x62bd('0x1d'),'enterAt':utils[_0x62bd('0x1e')](),'role':_0x62bd('0x1f')};}break;case _0x62bd('0x20'):if(!_[_0x62bd('0x21')](members[_0x16f723[_0x62bd('0x16')]])){members[_0x16f723[_0x62bd('0x16')]][_0x62bd('0x22')]=utils[_0x62bd('0x1e')]();members[_0x16f723[_0x62bd('0x16')]][_0x62bd('0x23')]=utils['diffTime'](members[_0x16f723[_0x62bd('0x16')]][_0x62bd('0x22')],members[_0x16f723['device']][_0x62bd('0x24')]);if(members[_0x16f723[_0x62bd('0x16')]][_0x62bd('0x18')]){writeDB(members[_0x16f723['device']]);}}break;default:break;}}catch(_0x191063){utils[_0x62bd('0x25')](util[_0x62bd('0x6')](_0x62bd('0x15'),members[_0x16f723[_0x62bd('0x16')]]?members[_0x16f723[_0x62bd('0x16')]][_0x62bd('0x18')]:_0x16f723[_0x62bd('0x16')]),_0x191063);}};exports[_0x62bd('0x26')]=function(_0x4823cf){try{if(!_[_0x62bd('0x21')](members[_0x4823cf[_0x62bd('0x8')]])){utils[_0x62bd('0x27')](util[_0x62bd('0x6')](_0x62bd('0x28'),_0x4823cf[_0x62bd('0x18')]),_0x4823cf);utils['info'](util[_0x62bd('0x6')](_0x62bd('0x29'),_0x4823cf[_0x62bd('0x18')],_0x4823cf[_0x62bd('0x8')],_0x4823cf[_0x62bd('0x2a')]));members[_0x4823cf['interface']]=_[_0x62bd('0x2b')](members[_0x4823cf['interface']],{'data4':_0x4823cf['queue'],'uniqueid':_0x4823cf[_0x62bd('0x18')]});}}catch(_0x203b53){utils[_0x62bd('0x25')](util[_0x62bd('0x6')](_0x62bd('0x28'),_0x4823cf['uniqueid']),_0x203b53);}};exports[_0x62bd('0x2c')]=function(_0x17ba8c){try{utils[_0x62bd('0x27')](util[_0x62bd('0x6')](_0x62bd('0x2d'),_0x17ba8c[_0x62bd('0x18')]),_0x17ba8c);if(_0x17ba8c[_0x62bd('0x2e')]){var _0x171901=_0x17ba8c[_0x62bd('0x2e')]['split']('-')[0x0];if(!_[_0x62bd('0x21')](members[_0x171901])){members[_0x171901]=_['assign'](members[_0x171901],{'data1':members[_0x171901][_0x62bd('0x2f')]||_0x17ba8c['type'],'data2':members[_0x171901][_0x62bd('0x30')]||_0x17ba8c[_0x62bd('0x31')],'data3':members[_0x171901]['data3']||_0x17ba8c[_0x62bd('0x32')],'uniqueid':members[_0x171901][_0x62bd('0x18')]||_0x17ba8c[_0x62bd('0x18')]});utils[_0x62bd('0x5')](util[_0x62bd('0x6')](_0x62bd('0x33'),_0x17ba8c[_0x62bd('0x18')],members[_0x171901][_0x62bd('0x2f')],members[_0x171901]['data2'],members[_0x171901]['data3']));if(members[_0x171901][_0x62bd('0x22')]){writeDB(members[_0x171901]);}}}if(_0x17ba8c[_0x62bd('0x34')]){var _0x2f8c44=_0x17ba8c[_0x62bd('0x34')][_0x62bd('0x11')]('-')[0x0];if(!_[_0x62bd('0x21')](members[_0x2f8c44])){members[_0x2f8c44]=_[_0x62bd('0x2b')](members[_0x2f8c44],{'data1':members[_0x2f8c44]['data1']||_0x17ba8c[_0x62bd('0xa')],'data2':members[_0x2f8c44]['data2']||_0x17ba8c[_0x62bd('0x31')],'data3':members[_0x2f8c44][_0x62bd('0x35')]||_0x17ba8c[_0x62bd('0x32')],'uniqueid':members[_0x2f8c44][_0x62bd('0x18')]||_0x17ba8c[_0x62bd('0x18')]});utils['info'](util[_0x62bd('0x6')](_0x62bd('0x33'),_0x17ba8c[_0x62bd('0x18')],members[_0x2f8c44]['data1'],members[_0x2f8c44][_0x62bd('0x30')],members[_0x2f8c44]['data3']));if(members[_0x2f8c44][_0x62bd('0x22')]){writeDB(members[_0x2f8c44]);}}}}catch(_0x370e47){utils[_0x62bd('0x25')](util[_0x62bd('0x6')](_0x62bd('0x2d'),_0x17ba8c[_0x62bd('0x18')]),_0x370e47);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index cd1ef83..9693093 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 _0x3e98=['value','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','holdtime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercompleteAt','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','isNil','variable','queuestatus','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s'];(function(_0x21483c,_0x58518b){var _0x15af60=function(_0x480962){while(--_0x480962){_0x21483c['push'](_0x21483c['shift']());}};_0x15af60(++_0x58518b);}(_0x3e98,0x171));var _0x83e9=function(_0x55a41c,_0x2ced02){_0x55a41c=_0x55a41c-0x0;var _0x278b73=_0x3e98[_0x55a41c];return _0x278b73;};'use strict';var _=require(_0x83e9('0x0'));var util=require(_0x83e9('0x1'));var utils=require(_0x83e9('0x2'));var queues={};function writeDB(_0x29f6a3){utils[_0x83e9('0x3')](util['format'](_0x83e9('0x4'),_0x29f6a3[_0x83e9('0x5')],_0x29f6a3['channel'],_0x29f6a3[_0x83e9('0x6')],_0x29f6a3[_0x83e9('0x7')],_0x29f6a3[_0x83e9('0x8')],_0x29f6a3['accountcode'],_0x29f6a3[_0x83e9('0x9')]));if(_0x29f6a3[_0x83e9('0x6')]){utils[_0x83e9('0xa')](_0x29f6a3[_0x83e9('0x6')])[_0x83e9('0xb')](function(_0x139440){if(_0x139440){_0x29f6a3[_0x83e9('0xc')]=_0x139440[_0x83e9('0xc')];}utils[_0x83e9('0xd')](_0x83e9('0xe'),_0x29f6a3);});}else{utils[_0x83e9('0xd')](_0x83e9('0xe'),_0x29f6a3);}if(_0x29f6a3['transfereduniqueid']){delete queues[_0x29f6a3[_0x83e9('0xf')]];}else{delete queues[_0x29f6a3[_0x83e9('0x5')]];}}exports[_0x83e9('0x10')]=function(_0x41159b){try{utils[_0x83e9('0x11')](util['format'](_0x83e9('0x12'),_0x41159b['uniqueid']),_0x41159b);utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x14'),_0x41159b[_0x83e9('0x5')],_0x41159b['queue'],_0x41159b[_0x83e9('0x15')]));queues[_0x41159b['uniqueid']]=_['assign'](_0x41159b,{'originalposition':_0x41159b[_0x83e9('0x15')],'queuecallerjoinAt':utils[_0x83e9('0x16')](),'mohtime':0x0});}catch(_0x4c39ff){utils[_0x83e9('0x17')](util[_0x83e9('0x13')]('[%s][queues][queuecallerjoin]',_0x41159b['uniqueid']),_0x4c39ff);}};exports['hangup']=function(_0x4c7218){try{if(!_['isNil'](queues[_0x4c7218[_0x83e9('0x5')]])){utils[_0x83e9('0x11')](util[_0x83e9('0x13')](_0x83e9('0x18'),_0x4c7218['uniqueid']),_0x4c7218);if(queues[_0x4c7218[_0x83e9('0x5')]]['queuecallerleaveAt']){if(!queues[_0x4c7218[_0x83e9('0x5')]][_0x83e9('0x19')]&&!queues[_0x4c7218['uniqueid']][_0x83e9('0x1a')]){queues[_0x4c7218[_0x83e9('0x5')]]['queuecallercomplete']=!![];queues[_0x4c7218['uniqueid']][_0x83e9('0x1b')]=utils[_0x83e9('0x16')]();queues[_0x4c7218[_0x83e9('0x5')]][_0x83e9('0x9')]='COMPLETEDBYAGENT';}utils['info'](util[_0x83e9('0x13')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4c7218[_0x83e9('0x5')],queues[_0x4c7218[_0x83e9('0x5')]][_0x83e9('0x1c')],queues[_0x4c7218[_0x83e9('0x5')]][_0x83e9('0x9')]));writeDB(queues[_0x4c7218[_0x83e9('0x5')]]);}else if(queues[_0x4c7218[_0x83e9('0x5')]][_0x83e9('0xf')]){utils[_0x83e9('0x3')](util['format'](_0x83e9('0x1d'),_0x4c7218[_0x83e9('0x5')],queues[_0x4c7218[_0x83e9('0x5')]][_0x83e9('0x1c')],queues[_0x4c7218['uniqueid']][_0x83e9('0xf')]));queues[queues[_0x4c7218[_0x83e9('0x5')]][_0x83e9('0xf')]]=queues[_0x4c7218[_0x83e9('0x5')]];queues[queues[_0x4c7218[_0x83e9('0x5')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x4c7218[_0x83e9('0x5')]];}}}catch(_0x4261df){utils[_0x83e9('0x17')](util[_0x83e9('0x13')](_0x83e9('0x18'),_0x4c7218[_0x83e9('0x5')]),_0x4261df);}};exports[_0x83e9('0x1e')]=function(_0x247667){try{utils['debug'](util[_0x83e9('0x13')](_0x83e9('0x1f'),_0x247667[_0x83e9('0x5')]),_0x247667);if(!_[_0x83e9('0x20')](_0x247667[_0x83e9('0x21')][_0x83e9('0x22')])&&_0x247667['value'][_0x83e9('0x23')]()!==_0x83e9('0x24')){if(!_['isNil'](queues[_0x247667[_0x83e9('0x5')]])){queues[_0x247667[_0x83e9('0x5')]]['queuecallerabandon']=![];queues[_0x247667[_0x83e9('0x5')]]['queuecallerabandonAt']=null;queues[_0x247667[_0x83e9('0x5')]]['queuecallerexit']=!![];queues[_0x247667[_0x83e9('0x5')]][_0x83e9('0x25')]=utils[_0x83e9('0x16')]();queues[_0x247667['uniqueid']]['queuecallerexitreason']=_0x247667['value']['toUpperCase']();utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x26'),_0x247667['uniqueid'],queues[_0x247667[_0x83e9('0x5')]]['name'],_0x247667[_0x83e9('0x27')],queues[_0x247667[_0x83e9('0x5')]][_0x83e9('0x9')]));writeDB(queues[_0x247667['uniqueid']]);}}else if(!_[_0x83e9('0x20')](_0x247667[_0x83e9('0x21')][_0x83e9('0x28')])){if(!_['isNil'](queues[_0x247667[_0x83e9('0x5')]])&&!queues[_0x247667['uniqueid']][_0x83e9('0x19')]){queues[_0x247667['uniqueid']][_0x83e9('0x19')]=![];queues[_0x247667['uniqueid']][_0x83e9('0x29')]=null;queues[_0x247667[_0x83e9('0x5')]]['queuecallerexit']=!![];queues[_0x247667[_0x83e9('0x5')]]['queuecallerexitAt']=utils[_0x83e9('0x16')]();queues[_0x247667[_0x83e9('0x5')]][_0x83e9('0x9')]=_0x83e9('0x2a');utils[_0x83e9('0x3')](util['format'](_0x83e9('0x2b'),_0x247667['uniqueid'],queues[_0x247667[_0x83e9('0x5')]][_0x83e9('0x1c')],_0x247667[_0x83e9('0x27')],queues[_0x247667[_0x83e9('0x5')]][_0x83e9('0x9')]));}}}catch(_0x2f2db6){utils[_0x83e9('0x17')](util[_0x83e9('0x13')](_0x83e9('0x1f'),_0x247667[_0x83e9('0x5')]),_0x2f2db6);}};exports[_0x83e9('0x19')]=function(_0x368e32){try{if(!_[_0x83e9('0x20')](queues[_0x368e32[_0x83e9('0x5')]])){utils['debug'](util[_0x83e9('0x13')](_0x83e9('0x2c'),_0x368e32[_0x83e9('0x5')]),_0x368e32);queues[_0x368e32[_0x83e9('0x5')]][_0x83e9('0x1a')]=![];queues[_0x368e32[_0x83e9('0x5')]][_0x83e9('0x25')]=null;queues[_0x368e32[_0x83e9('0x5')]][_0x83e9('0x19')]=!![];queues[_0x368e32[_0x83e9('0x5')]]['queuecallerabandonAt']=utils[_0x83e9('0x16')]();queues[_0x368e32[_0x83e9('0x5')]][_0x83e9('0x9')]=_0x83e9('0x2d');utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x2e'),_0x368e32[_0x83e9('0x5')],queues[_0x368e32[_0x83e9('0x5')]]['name'],queues[_0x368e32[_0x83e9('0x5')]]['queuecallerexitreason']));}}catch(_0x1f1987){utils[_0x83e9('0x17')](util[_0x83e9('0x13')](_0x83e9('0x2c'),_0x368e32['uniqueid']),_0x1f1987);}};exports[_0x83e9('0x2f')]=function(_0x310443){try{if(!_[_0x83e9('0x20')](queues[_0x310443[_0x83e9('0x5')]])){utils['debug'](util[_0x83e9('0x13')](_0x83e9('0x30'),_0x310443['uniqueid']),_0x310443);utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x31'),_0x310443[_0x83e9('0x5')],queues[_0x310443[_0x83e9('0x5')]][_0x83e9('0x1c')],_0x310443[_0x83e9('0x32')],_0x310443['connectedlinename']));queues[_0x310443[_0x83e9('0x5')]][_0x83e9('0x2f')]=!![];queues[_0x310443[_0x83e9('0x5')]][_0x83e9('0x33')]=utils[_0x83e9('0x16')]();queues[_0x310443['uniqueid']][_0x83e9('0x34')]=utils['diffTime'](queues[_0x310443[_0x83e9('0x5')]]['queuecallerleaveAt'],queues[_0x310443[_0x83e9('0x5')]][_0x83e9('0x35')]);queues[_0x310443['uniqueid']]['position']=_0x310443[_0x83e9('0x15')];queues[_0x310443['uniqueid']]['count']=_0x310443[_0x83e9('0x36')];queues[_0x310443['uniqueid']]['connectedlinenum']=_0x310443[_0x83e9('0x32')];queues[_0x310443['uniqueid']][_0x83e9('0x37')]=_0x310443[_0x83e9('0x37')];}}catch(_0x543504){utils['error'](util[_0x83e9('0x13')](_0x83e9('0x30'),_0x310443['uniqueid']),_0x543504);}};exports[_0x83e9('0x38')]=function(_0x224bdb){try{if(!_[_0x83e9('0x20')](queues[_0x224bdb[_0x83e9('0x5')]])){utils[_0x83e9('0x11')](util['format']('[%s][queues][agentconnect]',_0x224bdb[_0x83e9('0x5')]),_0x224bdb);utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x39'),_0x224bdb[_0x83e9('0x5')],queues[_0x224bdb[_0x83e9('0x5')]][_0x83e9('0x1c')],_0x224bdb[_0x83e9('0x3a')],_0x224bdb[_0x83e9('0x3b')]));queues[_0x224bdb['uniqueid']][_0x83e9('0x19')]=![];queues[_0x224bdb['uniqueid']]['queuecallerabandon']=![];queues[_0x224bdb[_0x83e9('0x5')]][_0x83e9('0x29')]=null;queues[_0x224bdb[_0x83e9('0x5')]]['queuecallerexit']=![];queues[_0x224bdb[_0x83e9('0x5')]]['queuecallerexitreason']=null;queues[_0x224bdb[_0x83e9('0x5')]][_0x83e9('0x25')]=null;queues[_0x224bdb['uniqueid']][_0x83e9('0x3c')]=!![];queues[_0x224bdb[_0x83e9('0x5')]][_0x83e9('0x3d')]=_0x224bdb[_0x83e9('0x3b')];queues[_0x224bdb[_0x83e9('0x5')]][_0x83e9('0x7')]=_0x224bdb['membername'];}}catch(_0x437d58){utils[_0x83e9('0x17')](util[_0x83e9('0x13')](_0x83e9('0x3e'),_0x224bdb[_0x83e9('0x5')]),_0x437d58);}};exports[_0x83e9('0x3f')]=function(_0x21d266){try{if(!_[_0x83e9('0x20')](queues[_0x21d266[_0x83e9('0x5')]])){if(queues[_0x21d266[_0x83e9('0x5')]]['queuecallerleaveAt']){utils[_0x83e9('0x11')](util['format'](_0x83e9('0x40'),_0x21d266['uniqueid']),_0x21d266);queues[_0x21d266[_0x83e9('0x5')]][_0x83e9('0x19')]=![];queues[_0x21d266['uniqueid']]['queuecallerabandon']=![];queues[_0x21d266['uniqueid']][_0x83e9('0x29')]=null;queues[_0x21d266[_0x83e9('0x5')]][_0x83e9('0x1a')]=![];queues[_0x21d266[_0x83e9('0x5')]][_0x83e9('0x25')]=null;queues[_0x21d266[_0x83e9('0x5')]][_0x83e9('0x3c')]=!![];queues[_0x21d266[_0x83e9('0x5')]]['lastAssignedTo']=_0x21d266[_0x83e9('0x3a')];queues[_0x21d266['uniqueid']]['queuecallercomplete']=!![];queues[_0x21d266['uniqueid']][_0x83e9('0x1b')]=utils[_0x83e9('0x16')]();if(_0x21d266['reason']==_0x83e9('0x41')){if(!queues[_0x21d266[_0x83e9('0x5')]][_0x83e9('0x41')]){queues[_0x21d266['uniqueid']][_0x83e9('0x9')]='TRANSFER';}}else{queues[_0x21d266['uniqueid']]['queuecallerexitreason']=_0x83e9('0x42')+_0x21d266['reason']['toUpperCase']();}utils[_0x83e9('0x3')](util[_0x83e9('0x13')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x21d266[_0x83e9('0x5')],queues[_0x21d266[_0x83e9('0x5')]][_0x83e9('0x1c')],_0x21d266[_0x83e9('0x3a')],queues[_0x21d266[_0x83e9('0x5')]][_0x83e9('0x9')]));writeDB(queues[_0x21d266[_0x83e9('0x5')]]);}}}catch(_0x447294){utils[_0x83e9('0x17')](util[_0x83e9('0x13')](_0x83e9('0x40'),_0x21d266[_0x83e9('0x5')]),_0x447294);}};exports[_0x83e9('0x43')]=function(_0x19308f){try{if(!_[_0x83e9('0x20')](queues[_0x19308f[_0x83e9('0x44')]])){utils[_0x83e9('0x11')](util[_0x83e9('0x13')](_0x83e9('0x45'),_0x19308f[_0x83e9('0x5')]),_0x19308f);queues[_0x19308f[_0x83e9('0x44')]][_0x83e9('0x41')]=!![];queues[_0x19308f[_0x83e9('0x44')]]['transfertype']='BLIND';queues[_0x19308f[_0x83e9('0x44')]][_0x83e9('0x46')]=_0x19308f[_0x83e9('0x47')];queues[_0x19308f['transfereeuniqueid']][_0x83e9('0x48')]=_0x19308f[_0x83e9('0x44')];queues[_0x19308f[_0x83e9('0x44')]][_0x83e9('0x9')]=_0x83e9('0x49');utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x4a'),_0x19308f[_0x83e9('0x5')],queues[_0x19308f[_0x83e9('0x44')]]['name'],_0x19308f['transfereeuniqueid'],_0x19308f[_0x83e9('0x47')]));}}catch(_0x9820f8){utils[_0x83e9('0x17')](util['format'](_0x83e9('0x45'),_0x19308f['uniqueid']),_0x9820f8);}};exports['attendedtransfer']=function(_0x5c829f){try{utils[_0x83e9('0x11')](util['format'](_0x83e9('0x4b'),_0x5c829f[_0x83e9('0x4c')]),_0x5c829f);if(_0x5c829f[_0x83e9('0x4c')]==_0x5c829f['origtransfererlinkedid']){if(!_[_0x83e9('0x20')](queues[_0x5c829f[_0x83e9('0x4d')]])){utils[_0x83e9('0x3')](util['format'](_0x83e9('0x4e'),_0x5c829f[_0x83e9('0x4c')],queues[_0x5c829f[_0x83e9('0x4d')]][_0x83e9('0x1c')],_0x5c829f[_0x83e9('0x4f')]));queues[_0x5c829f[_0x83e9('0x4d')]][_0x83e9('0x41')]=!![];queues[_0x5c829f['secondtransfererlinkedid']]['transfertype']=_0x83e9('0x50');queues[_0x5c829f[_0x83e9('0x4d')]][_0x83e9('0x46')]=_0x5c829f[_0x83e9('0x4f')];queues[_0x5c829f['secondtransfererlinkedid']][_0x83e9('0x48')]=_0x5c829f[_0x83e9('0x4c')];queues[_0x5c829f['secondtransfererlinkedid']][_0x83e9('0x9')]=_0x83e9('0x51');}if(!_[_0x83e9('0x20')](queues[_0x5c829f[_0x83e9('0x52')]])){if(_0x5c829f[_0x83e9('0x53')]&&queues[_0x5c829f[_0x83e9('0x53')]]){queues[_0x5c829f[_0x83e9('0x53')]][_0x83e9('0x54')]=0x1;queues[_0x5c829f[_0x83e9('0x44')]]=_[_0x83e9('0x55')](queues[_0x5c829f[_0x83e9('0x53')]]);queues[_0x5c829f[_0x83e9('0x44')]]['transfereduniqueid']=_0x5c829f[_0x83e9('0x56')];queues[_0x5c829f['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x5c829f[_0x83e9('0x44')]][_0x83e9('0x8')]=queues[_0x5c829f[_0x83e9('0x4d')]][_0x83e9('0x8')];queues[_0x5c829f[_0x83e9('0x44')]][_0x83e9('0x57')]=queues[_0x5c829f[_0x83e9('0x4d')]][_0x83e9('0x57')];queues[_0x5c829f['transfereeuniqueid']][_0x83e9('0x35')]=utils['now']();queues[_0x5c829f[_0x83e9('0x44')]][_0x83e9('0x33')]=utils[_0x83e9('0x16')]();queues[_0x5c829f['transfereeuniqueid']]['holdtime']=0x0;queues[_0x5c829f['transfereeuniqueid']]['mohtime']=0x0;utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x58'),_0x5c829f['origtransfereruniqueid'],queues[_0x5c829f[_0x83e9('0x44')]][_0x83e9('0x1c')],queues[_0x5c829f[_0x83e9('0x44')]][_0x83e9('0x8')],queues[_0x5c829f[_0x83e9('0x44')]]['calleridname']));}else{utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x59'),_0x5c829f[_0x83e9('0x4c')],queues[_0x5c829f['origtransfererlinkedid']][_0x83e9('0x1c')],_0x5c829f[_0x83e9('0x4d')]));queues[_0x5c829f['origtransfererlinkedid']]['transfereduniqueid']=_0x5c829f[_0x83e9('0x4d')];}}}else if(_0x5c829f[_0x83e9('0x5a')]==_0x5c829f[_0x83e9('0x4d')]){if(!_[_0x83e9('0x20')](queues[_0x5c829f[_0x83e9('0x52')]])){utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x5b'),_0x5c829f[_0x83e9('0x4c')],queues[_0x5c829f['origtransfererlinkedid']][_0x83e9('0x1c')],_0x5c829f['secondtransfereruniqueid'],_0x5c829f['secondtransfererexten']));queues[_0x5c829f[_0x83e9('0x52')]][_0x83e9('0x41')]=!![];queues[_0x5c829f[_0x83e9('0x52')]]['transfertype']=_0x83e9('0x50');queues[_0x5c829f[_0x83e9('0x52')]][_0x83e9('0x46')]=_0x5c829f[_0x83e9('0x5c')];queues[_0x5c829f[_0x83e9('0x52')]]['transferuniqueid']=_0x5c829f['secondtransfereruniqueid'];queues[_0x5c829f[_0x83e9('0x52')]][_0x83e9('0x9')]=_0x83e9('0x51');}if(!_['isNil'](queues[_0x5c829f['secondtransfererlinkedid']])){if(_0x5c829f[_0x83e9('0x5d')]&&queues[_0x5c829f['transfertargetlinkedid']]){queues[_0x5c829f[_0x83e9('0x5d')]][_0x83e9('0x54')]=0x1;queues[_0x5c829f[_0x83e9('0x56')]]=_['clone'](queues[_0x5c829f[_0x83e9('0x5d')]]);queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0xf')]=_0x5c829f['transfertargetuniqueid'];queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0x54')]=0x2;queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0x8')]=queues[_0x5c829f['origtransfererlinkedid']][_0x83e9('0x8')];queues[_0x5c829f[_0x83e9('0x56')]]['calleridname']=queues[_0x5c829f[_0x83e9('0x52')]][_0x83e9('0x57')];queues[_0x5c829f['transfertargetuniqueid']][_0x83e9('0x35')]=utils[_0x83e9('0x16')]();queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0x33')]=utils['now']();queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0x34')]=0x0;queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0x5e')]=0x0;utils['info'](util[_0x83e9('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x5c829f['origtransfereruniqueid'],queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0x1c')],queues[_0x5c829f[_0x83e9('0x56')]]['transfereduniqueid'],queues[_0x5c829f[_0x83e9('0x56')]]['calleridnum'],queues[_0x5c829f[_0x83e9('0x56')]][_0x83e9('0x57')]));}else{utils['info'](util['format'](_0x83e9('0x59'),_0x5c829f[_0x83e9('0x4c')],queues[_0x5c829f[_0x83e9('0x4d')]]['name'],_0x5c829f['origtransfererlinkedid']));queues[_0x5c829f['secondtransfererlinkedid']][_0x83e9('0xf')]=_0x5c829f[_0x83e9('0x52')];}}}}catch(_0x46cdcc){utils[_0x83e9('0x17')](util[_0x83e9('0x13')](_0x83e9('0x4b'),_0x5c829f['origtransfereruniqueid']),_0x46cdcc);}};exports[_0x83e9('0x5f')]=function(_0x40f219){try{if(!_[_0x83e9('0x20')](queues[_0x40f219[_0x83e9('0x5')]])){utils[_0x83e9('0x11')](util[_0x83e9('0x13')](_0x83e9('0x60'),_0x40f219['uniqueid']),_0x40f219);queues[_0x40f219['uniqueid']][_0x83e9('0x61')]=utils[_0x83e9('0x16')]();utils[_0x83e9('0x3')](util['format'](_0x83e9('0x62'),_0x40f219[_0x83e9('0x5')],queues[_0x40f219['uniqueid']][_0x83e9('0x1c')],queues[_0x40f219[_0x83e9('0x5')]][_0x83e9('0x61')]));}}catch(_0x3f6f30){utils[_0x83e9('0x17')](util[_0x83e9('0x13')](_0x83e9('0x60'),_0x40f219[_0x83e9('0x5')]),_0x3f6f30);}};exports['musiconholdstop']=function(_0x5bf17d){try{if(!_[_0x83e9('0x20')](queues[_0x5bf17d[_0x83e9('0x5')]])){if(!_['isNil'](queues[_0x5bf17d[_0x83e9('0x5')]][_0x83e9('0x61')])){utils[_0x83e9('0x11')](util[_0x83e9('0x13')](_0x83e9('0x63'),_0x5bf17d['uniqueid']),_0x5bf17d);queues[_0x5bf17d[_0x83e9('0x5')]]['mohtime']+=utils[_0x83e9('0x64')](utils['now'](),queues[_0x5bf17d[_0x83e9('0x5')]][_0x83e9('0x61')]);utils[_0x83e9('0x3')](util[_0x83e9('0x13')](_0x83e9('0x65'),_0x5bf17d[_0x83e9('0x5')],queues[_0x5bf17d['uniqueid']][_0x83e9('0x1c')],queues[_0x5bf17d[_0x83e9('0x5')]]['mohtime']));delete queues[_0x5bf17d[_0x83e9('0x5')]][_0x83e9('0x61')];}}}catch(_0x128379){utils['error'](util[_0x83e9('0x13')](_0x83e9('0x63'),_0x5bf17d[_0x83e9('0x5')]),_0x128379);}}; \ No newline at end of file +var _0xdb81=['origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','ATTENDED','transferexten','transfertargetlinkedid','queuecallerenterreason','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','accountcode','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','isNil','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','lastAssignedTo','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','BLIND','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]'];(function(_0x1ae11f,_0x58013b){var _0x5c94a4=function(_0xc0c3f8){while(--_0xc0c3f8){_0x1ae11f['push'](_0x1ae11f['shift']());}};_0x5c94a4(++_0x58013b);}(_0xdb81,0x83));var _0x1db8=function(_0x4f9153,_0x16fd7c){_0x4f9153=_0x4f9153-0x0;var _0x8fb221=_0xdb81[_0x4f9153];return _0x8fb221;};'use strict';var _=require(_0x1db8('0x0'));var util=require(_0x1db8('0x1'));var utils=require(_0x1db8('0x2'));var queues={};function writeDB(_0x4ed56){utils['info'](util[_0x1db8('0x3')](_0x1db8('0x4'),_0x4ed56[_0x1db8('0x5')],_0x4ed56[_0x1db8('0x6')],_0x4ed56[_0x1db8('0x7')],_0x4ed56['lastAssignedTo'],_0x4ed56['calleridnum'],_0x4ed56[_0x1db8('0x8')],_0x4ed56['queuecallerexitreason']));if(_0x4ed56[_0x1db8('0x7')]){utils['getVoiceQueueByName'](_0x4ed56[_0x1db8('0x7')])['then'](function(_0x494efb){if(_0x494efb){_0x4ed56[_0x1db8('0x9')]=_0x494efb[_0x1db8('0x9')];}utils[_0x1db8('0xa')]('CreateVoiceQueueReport',_0x4ed56);});}else{utils[_0x1db8('0xa')](_0x1db8('0xb'),_0x4ed56);}if(_0x4ed56['transfereduniqueid']){delete queues[_0x4ed56[_0x1db8('0xc')]];}else{delete queues[_0x4ed56[_0x1db8('0x5')]];}}exports['queuecallerjoin']=function(_0x5b319d){try{utils[_0x1db8('0xd')](util[_0x1db8('0x3')](_0x1db8('0xe'),_0x5b319d[_0x1db8('0x5')]),_0x5b319d);utils['info'](util[_0x1db8('0x3')](_0x1db8('0xf'),_0x5b319d['uniqueid'],_0x5b319d['queue'],_0x5b319d['position']));queues[_0x5b319d['uniqueid']]=_[_0x1db8('0x10')](_0x5b319d,{'originalposition':_0x5b319d[_0x1db8('0x11')],'queuecallerjoinAt':utils[_0x1db8('0x12')](),'mohtime':0x0});}catch(_0x58ca5f){utils[_0x1db8('0x13')](util['format'](_0x1db8('0xe'),_0x5b319d[_0x1db8('0x5')]),_0x58ca5f);}};exports[_0x1db8('0x14')]=function(_0x1730f1){try{if(!_['isNil'](queues[_0x1730f1[_0x1db8('0x5')]])){utils[_0x1db8('0xd')](util[_0x1db8('0x3')]('[%s][queues][hangup]',_0x1730f1[_0x1db8('0x5')]),_0x1730f1);if(queues[_0x1730f1[_0x1db8('0x5')]][_0x1db8('0x15')]){if(!queues[_0x1730f1[_0x1db8('0x5')]]['queuecallerabandon']&&!queues[_0x1730f1[_0x1db8('0x5')]]['queuecallerexit']){queues[_0x1730f1[_0x1db8('0x5')]][_0x1db8('0x16')]=!![];queues[_0x1730f1[_0x1db8('0x5')]][_0x1db8('0x17')]=utils[_0x1db8('0x12')]();queues[_0x1730f1[_0x1db8('0x5')]][_0x1db8('0x18')]=_0x1db8('0x19');}utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x1b'),_0x1730f1[_0x1db8('0x5')],queues[_0x1730f1['uniqueid']]['name'],queues[_0x1730f1[_0x1db8('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1730f1[_0x1db8('0x5')]]);}else if(queues[_0x1730f1[_0x1db8('0x5')]][_0x1db8('0xc')]){utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x1c'),_0x1730f1['uniqueid'],queues[_0x1730f1[_0x1db8('0x5')]][_0x1db8('0x1d')],queues[_0x1730f1['uniqueid']]['transfereduniqueid']));queues[queues[_0x1730f1[_0x1db8('0x5')]]['transfereduniqueid']]=queues[_0x1730f1[_0x1db8('0x5')]];queues[queues[_0x1730f1[_0x1db8('0x5')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x1730f1[_0x1db8('0x5')]];}}}catch(_0x1101e5){utils[_0x1db8('0x13')](util[_0x1db8('0x3')]('[%s][queues][hangup]',_0x1730f1[_0x1db8('0x5')]),_0x1101e5);}};exports[_0x1db8('0x1e')]=function(_0x1dd326){try{utils['debug'](util[_0x1db8('0x3')](_0x1db8('0x1f'),_0x1dd326[_0x1db8('0x5')]),_0x1dd326);if(!_['isNil'](_0x1dd326[_0x1db8('0x20')]['queuestatus'])&&_0x1dd326['value'][_0x1db8('0x21')]()!==_0x1db8('0x22')){if(!_['isNil'](queues[_0x1dd326[_0x1db8('0x5')]])){queues[_0x1dd326[_0x1db8('0x5')]][_0x1db8('0x23')]=![];queues[_0x1dd326['uniqueid']][_0x1db8('0x24')]=null;queues[_0x1dd326['uniqueid']][_0x1db8('0x25')]=!![];queues[_0x1dd326['uniqueid']][_0x1db8('0x26')]=utils['now']();queues[_0x1dd326[_0x1db8('0x5')]][_0x1db8('0x18')]=_0x1dd326[_0x1db8('0x27')][_0x1db8('0x21')]();utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x28'),_0x1dd326[_0x1db8('0x5')],queues[_0x1dd326['uniqueid']][_0x1db8('0x1d')],_0x1dd326['value'],queues[_0x1dd326[_0x1db8('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1dd326[_0x1db8('0x5')]]);}}else if(!_['isNil'](_0x1dd326[_0x1db8('0x20')][_0x1db8('0x29')])){if(!_['isNil'](queues[_0x1dd326['uniqueid']])&&!queues[_0x1dd326[_0x1db8('0x5')]][_0x1db8('0x23')]){queues[_0x1dd326[_0x1db8('0x5')]][_0x1db8('0x23')]=![];queues[_0x1dd326[_0x1db8('0x5')]][_0x1db8('0x24')]=null;queues[_0x1dd326['uniqueid']][_0x1db8('0x25')]=!![];queues[_0x1dd326[_0x1db8('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x1dd326[_0x1db8('0x5')]][_0x1db8('0x18')]='EXITWITHKEY';utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x2a'),_0x1dd326[_0x1db8('0x5')],queues[_0x1dd326['uniqueid']][_0x1db8('0x1d')],_0x1dd326[_0x1db8('0x27')],queues[_0x1dd326[_0x1db8('0x5')]][_0x1db8('0x18')]));}}}catch(_0x46ecab){utils[_0x1db8('0x13')](util[_0x1db8('0x3')](_0x1db8('0x1f'),_0x1dd326[_0x1db8('0x5')]),_0x46ecab);}};exports[_0x1db8('0x23')]=function(_0x24fd60){try{if(!_[_0x1db8('0x2b')](queues[_0x24fd60[_0x1db8('0x5')]])){utils[_0x1db8('0xd')](util[_0x1db8('0x3')](_0x1db8('0x2c'),_0x24fd60['uniqueid']),_0x24fd60);queues[_0x24fd60[_0x1db8('0x5')]][_0x1db8('0x25')]=![];queues[_0x24fd60[_0x1db8('0x5')]]['queuecallerexitAt']=null;queues[_0x24fd60[_0x1db8('0x5')]][_0x1db8('0x23')]=!![];queues[_0x24fd60[_0x1db8('0x5')]][_0x1db8('0x24')]=utils[_0x1db8('0x12')]();queues[_0x24fd60[_0x1db8('0x5')]]['queuecallerexitreason']=_0x1db8('0x2d');utils[_0x1db8('0x1a')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x24fd60['uniqueid'],queues[_0x24fd60['uniqueid']][_0x1db8('0x1d')],queues[_0x24fd60[_0x1db8('0x5')]][_0x1db8('0x18')]));}}catch(_0x612292){utils[_0x1db8('0x13')](util['format'](_0x1db8('0x2c'),_0x24fd60[_0x1db8('0x5')]),_0x612292);}};exports[_0x1db8('0x2e')]=function(_0x2193b8){try{if(!_[_0x1db8('0x2b')](queues[_0x2193b8[_0x1db8('0x5')]])){utils[_0x1db8('0xd')](util[_0x1db8('0x3')]('[%s][queues][queuecallerleave]',_0x2193b8[_0x1db8('0x5')]),_0x2193b8);utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x2f'),_0x2193b8['uniqueid'],queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x1d')],_0x2193b8[_0x1db8('0x30')],_0x2193b8[_0x1db8('0x31')]));queues[_0x2193b8[_0x1db8('0x5')]]['queuecallerleave']=!![];queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x15')]=utils[_0x1db8('0x12')]();queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x32')]=utils[_0x1db8('0x33')](queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x15')],queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x34')]);queues[_0x2193b8['uniqueid']][_0x1db8('0x11')]=_0x2193b8[_0x1db8('0x11')];queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x35')]=_0x2193b8['count'];queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x30')]=_0x2193b8[_0x1db8('0x30')];queues[_0x2193b8[_0x1db8('0x5')]][_0x1db8('0x31')]=_0x2193b8['connectedlinename'];}}catch(_0x1a4276){utils['error'](util[_0x1db8('0x3')](_0x1db8('0x36'),_0x2193b8[_0x1db8('0x5')]),_0x1a4276);}};exports['agentconnect']=function(_0x4ccc24){try{if(!_['isNil'](queues[_0x4ccc24[_0x1db8('0x5')]])){utils['debug'](util[_0x1db8('0x3')](_0x1db8('0x37'),_0x4ccc24[_0x1db8('0x5')]),_0x4ccc24);utils['info'](util['format'](_0x1db8('0x38'),_0x4ccc24[_0x1db8('0x5')],queues[_0x4ccc24[_0x1db8('0x5')]][_0x1db8('0x1d')],_0x4ccc24[_0x1db8('0x39')],_0x4ccc24[_0x1db8('0x3a')]));queues[_0x4ccc24[_0x1db8('0x5')]][_0x1db8('0x23')]=![];queues[_0x4ccc24[_0x1db8('0x5')]]['queuecallerabandon']=![];queues[_0x4ccc24[_0x1db8('0x5')]]['queuecallerabandonAt']=null;queues[_0x4ccc24[_0x1db8('0x5')]]['queuecallerexit']=![];queues[_0x4ccc24[_0x1db8('0x5')]]['queuecallerexitreason']=null;queues[_0x4ccc24[_0x1db8('0x5')]]['queuecallerexitAt']=null;queues[_0x4ccc24['uniqueid']][_0x1db8('0x3b')]=!![];queues[_0x4ccc24[_0x1db8('0x5')]][_0x1db8('0x8')]=_0x4ccc24[_0x1db8('0x3a')];queues[_0x4ccc24['uniqueid']]['lastAssignedTo']=_0x4ccc24[_0x1db8('0x39')];}}catch(_0x3d2ad3){utils[_0x1db8('0x13')](util[_0x1db8('0x3')](_0x1db8('0x37'),_0x4ccc24['uniqueid']),_0x3d2ad3);}};exports[_0x1db8('0x3c')]=function(_0x663b66){try{if(!_[_0x1db8('0x2b')](queues[_0x663b66[_0x1db8('0x5')]])){if(queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x15')]){utils['debug'](util[_0x1db8('0x3')]('[%s][queues][agentcomplete]',_0x663b66[_0x1db8('0x5')]),_0x663b66);queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x23')]=![];queues[_0x663b66[_0x1db8('0x5')]]['queuecallerabandon']=![];queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x24')]=null;queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x25')]=![];queues[_0x663b66['uniqueid']]['queuecallerexitAt']=null;queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x3b')]=!![];queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x3d')]=_0x663b66['membername'];queues[_0x663b66['uniqueid']][_0x1db8('0x16')]=!![];queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x17')]=utils[_0x1db8('0x12')]();if(_0x663b66[_0x1db8('0x3e')]=='transfer'){if(!queues[_0x663b66['uniqueid']][_0x1db8('0x3f')]){queues[_0x663b66[_0x1db8('0x5')]]['queuecallerexitreason']=_0x1db8('0x40');}}else{queues[_0x663b66['uniqueid']][_0x1db8('0x18')]='COMPLETEDBY'+_0x663b66[_0x1db8('0x3e')][_0x1db8('0x21')]();}utils['info'](util[_0x1db8('0x3')](_0x1db8('0x41'),_0x663b66['uniqueid'],queues[_0x663b66[_0x1db8('0x5')]][_0x1db8('0x1d')],_0x663b66['membername'],queues[_0x663b66['uniqueid']][_0x1db8('0x18')]));writeDB(queues[_0x663b66['uniqueid']]);}}}catch(_0x24c253){utils[_0x1db8('0x13')](util[_0x1db8('0x3')](_0x1db8('0x42'),_0x663b66[_0x1db8('0x5')]),_0x24c253);}};exports[_0x1db8('0x43')]=function(_0x3f9b49){try{if(!_[_0x1db8('0x2b')](queues[_0x3f9b49[_0x1db8('0x44')]])){utils['debug'](util[_0x1db8('0x3')]('[%s][queues][blindtransfer]',_0x3f9b49[_0x1db8('0x5')]),_0x3f9b49);queues[_0x3f9b49[_0x1db8('0x44')]][_0x1db8('0x3f')]=!![];queues[_0x3f9b49['transfereeuniqueid']]['transfertype']=_0x1db8('0x45');queues[_0x3f9b49['transfereeuniqueid']]['transferexten']=_0x3f9b49[_0x1db8('0x46')];queues[_0x3f9b49[_0x1db8('0x44')]][_0x1db8('0x47')]=_0x3f9b49[_0x1db8('0x44')];queues[_0x3f9b49[_0x1db8('0x44')]][_0x1db8('0x18')]=_0x1db8('0x48');utils['info'](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3f9b49[_0x1db8('0x5')],queues[_0x3f9b49[_0x1db8('0x44')]][_0x1db8('0x1d')],_0x3f9b49[_0x1db8('0x44')],_0x3f9b49[_0x1db8('0x46')]));}}catch(_0x16b244){utils['error'](util[_0x1db8('0x3')]('[%s][queues][blindtransfer]',_0x3f9b49[_0x1db8('0x5')]),_0x16b244);}};exports[_0x1db8('0x49')]=function(_0x22e181){try{utils[_0x1db8('0xd')](util[_0x1db8('0x3')](_0x1db8('0x4a'),_0x22e181[_0x1db8('0x4b')]),_0x22e181);if(_0x22e181['origtransfereruniqueid']==_0x22e181['origtransfererlinkedid']){if(!_[_0x1db8('0x2b')](queues[_0x22e181['secondtransfererlinkedid']])){utils[_0x1db8('0x1a')](util[_0x1db8('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x22e181['origtransfereruniqueid'],queues[_0x22e181[_0x1db8('0x4c')]][_0x1db8('0x1d')],_0x22e181[_0x1db8('0x4d')]));queues[_0x22e181[_0x1db8('0x4c')]][_0x1db8('0x3f')]=!![];queues[_0x22e181[_0x1db8('0x4c')]]['transfertype']='ATTENDED';queues[_0x22e181['secondtransfererlinkedid']]['transferexten']=_0x22e181[_0x1db8('0x4d')];queues[_0x22e181[_0x1db8('0x4c')]]['transferuniqueid']=_0x22e181['origtransfereruniqueid'];queues[_0x22e181[_0x1db8('0x4c')]][_0x1db8('0x18')]=_0x1db8('0x4e');}if(!_[_0x1db8('0x2b')](queues[_0x22e181[_0x1db8('0x4f')]])){if(_0x22e181[_0x1db8('0x50')]&&queues[_0x22e181[_0x1db8('0x50')]]){queues[_0x22e181[_0x1db8('0x50')]]['queuecallerenterreason']=0x1;queues[_0x22e181[_0x1db8('0x44')]]=_[_0x1db8('0x51')](queues[_0x22e181[_0x1db8('0x50')]]);queues[_0x22e181[_0x1db8('0x44')]]['transfereduniqueid']=_0x22e181[_0x1db8('0x52')];queues[_0x22e181['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x22e181['transfereeuniqueid']][_0x1db8('0x53')]=queues[_0x22e181[_0x1db8('0x4c')]][_0x1db8('0x53')];queues[_0x22e181[_0x1db8('0x44')]][_0x1db8('0x54')]=queues[_0x22e181[_0x1db8('0x4c')]][_0x1db8('0x54')];queues[_0x22e181['transfereeuniqueid']][_0x1db8('0x34')]=utils[_0x1db8('0x12')]();queues[_0x22e181[_0x1db8('0x44')]]['queuecallerleaveAt']=utils[_0x1db8('0x12')]();queues[_0x22e181['transfereeuniqueid']][_0x1db8('0x32')]=0x0;queues[_0x22e181['transfereeuniqueid']][_0x1db8('0x55')]=0x0;utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x56'),_0x22e181['origtransfereruniqueid'],queues[_0x22e181[_0x1db8('0x44')]][_0x1db8('0x1d')],queues[_0x22e181[_0x1db8('0x44')]]['calleridnum'],queues[_0x22e181[_0x1db8('0x44')]][_0x1db8('0x54')]));}else{utils['info'](util['format'](_0x1db8('0x57'),_0x22e181[_0x1db8('0x4b')],queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x1d')],_0x22e181[_0x1db8('0x4c')]));queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0xc')]=_0x22e181[_0x1db8('0x4c')];}}}else if(_0x22e181[_0x1db8('0x58')]==_0x22e181[_0x1db8('0x4c')]){if(!_[_0x1db8('0x2b')](queues[_0x22e181[_0x1db8('0x4f')]])){utils[_0x1db8('0x1a')](util[_0x1db8('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x22e181['origtransfereruniqueid'],queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x1d')],_0x22e181[_0x1db8('0x58')],_0x22e181[_0x1db8('0x59')]));queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x3f')]=!![];queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x5a')]=_0x1db8('0x5b');queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x5c')]=_0x22e181[_0x1db8('0x59')];queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x47')]=_0x22e181['secondtransfereruniqueid'];queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x18')]=_0x1db8('0x4e');}if(!_[_0x1db8('0x2b')](queues[_0x22e181[_0x1db8('0x4c')]])){if(_0x22e181['transfertargetlinkedid']&&queues[_0x22e181[_0x1db8('0x5d')]]){queues[_0x22e181[_0x1db8('0x5d')]][_0x1db8('0x5e')]=0x1;queues[_0x22e181[_0x1db8('0x52')]]=_[_0x1db8('0x51')](queues[_0x22e181['transfertargetlinkedid']]);queues[_0x22e181[_0x1db8('0x52')]][_0x1db8('0xc')]=_0x22e181[_0x1db8('0x52')];queues[_0x22e181['transfertargetuniqueid']][_0x1db8('0x5e')]=0x2;queues[_0x22e181[_0x1db8('0x52')]]['calleridnum']=queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x53')];queues[_0x22e181[_0x1db8('0x52')]]['calleridname']=queues[_0x22e181[_0x1db8('0x4f')]][_0x1db8('0x54')];queues[_0x22e181[_0x1db8('0x52')]][_0x1db8('0x34')]=utils[_0x1db8('0x12')]();queues[_0x22e181['transfertargetuniqueid']][_0x1db8('0x15')]=utils[_0x1db8('0x12')]();queues[_0x22e181[_0x1db8('0x52')]][_0x1db8('0x32')]=0x0;queues[_0x22e181['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x1db8('0x1a')](util['format'](_0x1db8('0x5f'),_0x22e181[_0x1db8('0x4b')],queues[_0x22e181[_0x1db8('0x52')]]['name'],queues[_0x22e181[_0x1db8('0x52')]]['transfereduniqueid'],queues[_0x22e181[_0x1db8('0x52')]]['calleridnum'],queues[_0x22e181[_0x1db8('0x52')]][_0x1db8('0x54')]));}else{utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x57'),_0x22e181['origtransfereruniqueid'],queues[_0x22e181[_0x1db8('0x4c')]][_0x1db8('0x1d')],_0x22e181[_0x1db8('0x4f')]));queues[_0x22e181[_0x1db8('0x4c')]][_0x1db8('0xc')]=_0x22e181['origtransfererlinkedid'];}}}}catch(_0x5e56e4){utils[_0x1db8('0x13')](util[_0x1db8('0x3')]('[%s][queues][attendedtransfer]',_0x22e181[_0x1db8('0x4b')]),_0x5e56e4);}};exports[_0x1db8('0x60')]=function(_0x1807e1){try{if(!_[_0x1db8('0x2b')](queues[_0x1807e1['uniqueid']])){utils[_0x1db8('0xd')](util[_0x1db8('0x3')](_0x1db8('0x61'),_0x1807e1[_0x1db8('0x5')]),_0x1807e1);queues[_0x1807e1[_0x1db8('0x5')]][_0x1db8('0x62')]=utils[_0x1db8('0x12')]();utils[_0x1db8('0x1a')](util[_0x1db8('0x3')](_0x1db8('0x63'),_0x1807e1[_0x1db8('0x5')],queues[_0x1807e1[_0x1db8('0x5')]][_0x1db8('0x1d')],queues[_0x1807e1['uniqueid']][_0x1db8('0x62')]));}}catch(_0x357b20){utils[_0x1db8('0x13')](util[_0x1db8('0x3')](_0x1db8('0x61'),_0x1807e1['uniqueid']),_0x357b20);}};exports[_0x1db8('0x64')]=function(_0x43fb29){try{if(!_[_0x1db8('0x2b')](queues[_0x43fb29[_0x1db8('0x5')]])){if(!_[_0x1db8('0x2b')](queues[_0x43fb29['uniqueid']][_0x1db8('0x62')])){utils[_0x1db8('0xd')](util[_0x1db8('0x3')](_0x1db8('0x65'),_0x43fb29[_0x1db8('0x5')]),_0x43fb29);queues[_0x43fb29['uniqueid']][_0x1db8('0x55')]+=utils[_0x1db8('0x33')](utils[_0x1db8('0x12')](),queues[_0x43fb29[_0x1db8('0x5')]][_0x1db8('0x62')]);utils[_0x1db8('0x1a')](util['format'](_0x1db8('0x66'),_0x43fb29[_0x1db8('0x5')],queues[_0x43fb29['uniqueid']][_0x1db8('0x1d')],queues[_0x43fb29[_0x1db8('0x5')]][_0x1db8('0x55')]));delete queues[_0x43fb29[_0x1db8('0x5')]][_0x1db8('0x62')];}}}catch(_0xd38e66){utils['error'](util['format'](_0x1db8('0x65'),_0x43fb29[_0x1db8('0x5')]),_0xd38e66);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 18c5ce3..b32bc9d 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 _0xcc7a=['value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','accountcode','then','membername','name','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','debug','[%s][recordings][newstate]','isNil','channelstate','channel','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','variable','mixmonitor_filename','[%s][recordings][varset]'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0xcc7a,0x73));var _0xacc7=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0xcc7a[_0x1627ae];return _0x34b38f;};'use strict';var _=require('lodash');var util=require(_0xacc7('0x0'));var utils=require(_0xacc7('0x1'));var transfers=require(_0xacc7('0x2'));var recordings={};function writeDB(_0x2e1f2e){var _0xfad7eb;utils[_0xacc7('0x3')](util[_0xacc7('0x4')](_0xacc7('0x5'),_0x2e1f2e['uniqueid']));if(transfers[_0xacc7('0x6')][_0x2e1f2e['uniqueid']]){_0xfad7eb=_0x2e1f2e['uniqueid'];_0x2e1f2e[_0xacc7('0x7')]=transfers[_0xacc7('0x6')][_0x2e1f2e[_0xacc7('0x7')]]['transfereeuniqueid'];}if(_0x2e1f2e[_0xacc7('0x8')]){utils['getUserByInternal'](_0x2e1f2e[_0xacc7('0x8')])[_0xacc7('0x9')](function(_0xf50221){if(_0xf50221){_0x2e1f2e[_0xacc7('0xa')]=_0xf50221[_0xacc7('0xb')];_0x2e1f2e['UserId']=_0xf50221['id'];}utils[_0xacc7('0xc')](_0xacc7('0xd'),_0x2e1f2e);});}else{utils['request'](_0xacc7('0xd'),_0x2e1f2e);}if(_0xfad7eb)delete transfers[_0xacc7('0x6')][_0xfad7eb];}exports[_0xacc7('0xe')]=function(_0xaaae9e){try{utils['debug'](util['format'](_0xacc7('0xf'),_0xaaae9e[_0xacc7('0x7')]),_0xaaae9e);if(_0xaaae9e[_0xacc7('0x7')]==_0xaaae9e['linkedid']){utils[_0xacc7('0x3')](util['format'](_0xacc7('0x10'),_0xaaae9e[_0xacc7('0x7')],_0xaaae9e['context'],_0xaaae9e['exten']));recordings[_0xaaae9e[_0xacc7('0x7')]]={'uniqueid':_0xaaae9e[_0xacc7('0x7')],'accountcode':_0xaaae9e[_0xacc7('0x8')],'exten':_0xaaae9e[_0xacc7('0x11')],'context':_0xaaae9e[_0xacc7('0x12')],'channel':_0xaaae9e['channel'],'monitors':[]};}}catch(_0x189574){utils['error'](util[_0xacc7('0x4')]('[%s][recordings][newchannel]',_0xaaae9e[_0xacc7('0x7')]),_0x189574);}};exports['newstate']=function(_0x32ff3c){try{utils[_0xacc7('0x13')](util['format'](_0xacc7('0x14'),_0x32ff3c[_0xacc7('0x7')]),_0x32ff3c);if(!_[_0xacc7('0x15')](recordings[_0x32ff3c[_0xacc7('0x7')]])&&_0x32ff3c[_0xacc7('0x16')]==0x6){utils['info'](util[_0xacc7('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x32ff3c[_0xacc7('0x7')],_0x32ff3c[_0xacc7('0x12')],_0x32ff3c[_0xacc7('0x17')]));}else if(!_[_0xacc7('0x15')](recordings[_0x32ff3c[_0xacc7('0x18')]])&&_0x32ff3c[_0xacc7('0x16')]==0x6&&_0x32ff3c[_0xacc7('0x12')]!=_0xacc7('0x19')){utils[_0xacc7('0x3')](util[_0xacc7('0x4')](_0xacc7('0x1a'),_0x32ff3c[_0xacc7('0x7')],_0x32ff3c[_0xacc7('0x18')],_0x32ff3c['context'],_0x32ff3c[_0xacc7('0x17')]));recordings[_0x32ff3c[_0xacc7('0x18')]][_0xacc7('0x8')]=_0x32ff3c[_0xacc7('0x8')];}}catch(_0x90e20e){utils[_0xacc7('0x1b')](util[_0xacc7('0x4')]('[%s][recordings][newstate]',_0x32ff3c['uniqueid']),_0x90e20e);}};exports['varset']=function(_0x26ae1){try{if(!_['isNil'](_0x26ae1[_0xacc7('0x1c')])&&!_[_0xacc7('0x15')](_0x26ae1['variable'][_0xacc7('0x1d')])){utils[_0xacc7('0x13')](util['format'](_0xacc7('0x1e'),_0x26ae1[_0xacc7('0x7')]),_0x26ae1);utils['info'](util[_0xacc7('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x26ae1[_0xacc7('0x7')],_0x26ae1[_0xacc7('0x1c')],_0x26ae1[_0xacc7('0x1f')]));if(_[_0xacc7('0x20')](_0x26ae1[_0xacc7('0x1f')],_0xacc7('0x21'))){_0x26ae1[_0xacc7('0x1f')]=_0x26ae1['value'][_0xacc7('0x22')](_0xacc7('0x21'),_0xacc7('0x23'));}if(recordings[_0x26ae1[_0xacc7('0x18')]]){var _0x59239e=_[_0xacc7('0x24')](recordings[_0x26ae1[_0xacc7('0x18')]][_0xacc7('0x25')],{'value':_0x26ae1[_0xacc7('0x1f')]});if(_[_0xacc7('0x15')](_0x59239e)){recordings[_0x26ae1['linkedid']]['monitors'][_0xacc7('0x26')]({'value':_0x26ae1['value']});}}}}catch(_0x48667b){utils['error'](util[_0xacc7('0x4')](_0xacc7('0x1e'),_0x26ae1[_0xacc7('0x7')]),_0x48667b);}};exports[_0xacc7('0x27')]=function(_0x54fe24){try{if(!_[_0xacc7('0x15')](recordings[_0x54fe24[_0xacc7('0x7')]])){utils[_0xacc7('0x13')](util[_0xacc7('0x4')](_0xacc7('0x28'),_0x54fe24[_0xacc7('0x7')]),_0x54fe24);utils[_0xacc7('0x3')](util[_0xacc7('0x4')](_0xacc7('0x29'),_0x54fe24[_0xacc7('0x7')],_0x54fe24[_0xacc7('0x2a')],_0x54fe24[_0xacc7('0x2b')],_0x54fe24[_0xacc7('0x2c')]));recordings[_0x54fe24['uniqueid']][_0xacc7('0x2a')]=_0x54fe24['calleridnum'];recordings[_0x54fe24[_0xacc7('0x7')]][_0xacc7('0x2b')]=_0x54fe24[_0xacc7('0x2b')];recordings[_0x54fe24[_0xacc7('0x7')]][_0xacc7('0x2d')]=_0x54fe24[_0xacc7('0x2d')];recordings[_0x54fe24[_0xacc7('0x7')]][_0xacc7('0x2e')]=_0x54fe24[_0xacc7('0x2e')];if(recordings[_0x54fe24[_0xacc7('0x7')]][_0xacc7('0x2f')]==_0xacc7('0x30')&&recordings[_0x54fe24[_0xacc7('0x7')]][_0xacc7('0x8')]){recordings[_0x54fe24[_0xacc7('0x7')]]['connectedlinenum']=recordings[_0x54fe24[_0xacc7('0x7')]][_0xacc7('0x8')];recordings[_0x54fe24[_0xacc7('0x7')]]['connectedlinename']='';}recordings[_0x54fe24[_0xacc7('0x7')]]['monitors']['forEach'](function(_0x10bd74){var _0x232018=_[_0xacc7('0x31')](recordings[_0x54fe24['uniqueid']]);_0x232018[_0xacc7('0x1f')]=_0x10bd74[_0xacc7('0x1f')];writeDB(_0x232018);});delete recordings[_0x54fe24[_0xacc7('0x7')]];}}catch(_0x478dc8){utils[_0xacc7('0x1b')](util[_0xacc7('0x4')](_0xacc7('0x28'),_0x54fe24[_0xacc7('0x7')]),_0x478dc8);}};exports[_0xacc7('0x32')]=function(_0x4319eb){try{if(!_['isNil'](recordings[_0x4319eb['uniqueid']])){utils[_0xacc7('0x13')](util[_0xacc7('0x4')]('[%s][recordings][newexten]',_0x4319eb[_0xacc7('0x7')]),_0x4319eb);utils[_0xacc7('0x3')](util[_0xacc7('0x4')](_0xacc7('0x33'),_0x4319eb[_0xacc7('0x7')],_0x4319eb[_0xacc7('0x34')],_0x4319eb[_0xacc7('0x35')]));if(_0x4319eb[_0xacc7('0x34')][_0xacc7('0x36')]()==_0xacc7('0x37')&&_[_0xacc7('0x38')](_0x4319eb[_0xacc7('0x35')]['toLowerCase'](),'cdr')){var _0x318b00=_0x4319eb[_0xacc7('0x35')][_0xacc7('0x39')]('=');var _0x788900=_0x318b00[0x0][_0xacc7('0x3a')](_0x318b00[0x0]['lastIndexOf']('(')+0x1,_0x318b00[0x0][_0xacc7('0x3b')](')'));var _0x1e8445=_0x318b00[0x1];recordings[_0x4319eb[_0xacc7('0x7')]][_0x788900]=_0x1e8445;}}}catch(_0x130ebc){utils['error'](util[_0xacc7('0x4')](_0xacc7('0x3c'),_0x4319eb[_0xacc7('0x7')]),_0x130ebc);}};exports[_0xacc7('0x3d')]=function(_0x2f043b){try{if(!_['isNil'](recordings[_0x2f043b['uniqueid']])){utils['debug'](util[_0xacc7('0x4')](_0xacc7('0x3e'),_0x2f043b[_0xacc7('0x7')]),_0x2f043b);utils[_0xacc7('0x3')](util[_0xacc7('0x4')](_0xacc7('0x3f'),_0x2f043b[_0xacc7('0x7')],_0x2f043b[_0xacc7('0x40')]));recordings[_0x2f043b[_0xacc7('0x7')]][_0xacc7('0x40')]=_0x2f043b['queue'];}}catch(_0x5f16af){utils[_0xacc7('0x1b')](util[_0xacc7('0x4')](_0xacc7('0x3e'),_0x2f043b['uniqueid']),_0x5f16af);}};exports[_0xacc7('0x41')]=function(_0x9e5e1d){try{utils[_0xacc7('0x13')](util['format'](_0xacc7('0x42'),_0x9e5e1d['uniqueid']),_0x9e5e1d);utils[_0xacc7('0x3')](util[_0xacc7('0x4')](_0xacc7('0x43'),_0x9e5e1d[_0xacc7('0x7')],_0x9e5e1d[_0xacc7('0x44')],_0x9e5e1d[_0xacc7('0x45')],_0x9e5e1d[_0xacc7('0x46')],_0x9e5e1d['transfereecalleridname']));if(recordings[_0x9e5e1d[_0xacc7('0x47')]]&&transfers[_0xacc7('0x6')][_0x9e5e1d['transfereruniqueid']]){transfers[_0xacc7('0x6')][_0x9e5e1d[_0xacc7('0x47')]][_0xacc7('0x48')]=!![];}}catch(_0x596c88){utils[_0xacc7('0x1b')](util[_0xacc7('0x4')](_0xacc7('0x42'),_0x9e5e1d[_0xacc7('0x7')]),_0x596c88);}}; \ No newline at end of file +var _0x8648=['exten','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','channel','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','mixmonitor_filename','[%s][recordings][varset]','variable','value','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','newexten','[%s][recordings][newexten]','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./transfers.controller','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','info','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s'];(function(_0x2eb876,_0x5b15b1){var _0x58d1fa=function(_0x162a04){while(--_0x162a04){_0x2eb876['push'](_0x2eb876['shift']());}};_0x58d1fa(++_0x5b15b1);}(_0x8648,0x138));var _0x8864=function(_0x149a75,_0x408899){_0x149a75=_0x149a75-0x0;var _0x2b7fe5=_0x8648[_0x149a75];return _0x2b7fe5;};'use strict';var _=require('lodash');var util=require(_0x8864('0x0'));var utils=require('./utils');var transfers=require(_0x8864('0x1'));var recordings={};function writeDB(_0x43344b){var _0x3d007f;utils['info'](util['format'](_0x8864('0x2'),_0x43344b[_0x8864('0x3')]));if(transfers[_0x8864('0x4')][_0x43344b[_0x8864('0x3')]]){_0x3d007f=_0x43344b[_0x8864('0x3')];_0x43344b[_0x8864('0x3')]=transfers[_0x8864('0x4')][_0x43344b[_0x8864('0x3')]][_0x8864('0x5')];}if(_0x43344b[_0x8864('0x6')]){utils[_0x8864('0x7')](_0x43344b[_0x8864('0x6')])[_0x8864('0x8')](function(_0x37af89){if(_0x37af89){_0x43344b[_0x8864('0x9')]=_0x37af89[_0x8864('0xa')];_0x43344b['UserId']=_0x37af89['id'];}utils['request']('CreateVoiceRecording',_0x43344b);});}else{utils[_0x8864('0xb')](_0x8864('0xc'),_0x43344b);}if(_0x3d007f)delete transfers[_0x8864('0x4')][_0x3d007f];}exports['newchannel']=function(_0x4488b7){try{utils[_0x8864('0xd')](util['format'](_0x8864('0xe'),_0x4488b7[_0x8864('0x3')]),_0x4488b7);if(_0x4488b7[_0x8864('0x3')]==_0x4488b7['linkedid']){utils[_0x8864('0xf')](util[_0x8864('0x10')](_0x8864('0x11'),_0x4488b7['uniqueid'],_0x4488b7['context'],_0x4488b7[_0x8864('0x12')]));recordings[_0x4488b7[_0x8864('0x3')]]={'uniqueid':_0x4488b7['uniqueid'],'accountcode':_0x4488b7[_0x8864('0x6')],'exten':_0x4488b7[_0x8864('0x12')],'context':_0x4488b7['context'],'channel':_0x4488b7['channel'],'monitors':[]};}}catch(_0x4707e5){utils['error'](util['format'](_0x8864('0xe'),_0x4488b7[_0x8864('0x3')]),_0x4707e5);}};exports['newstate']=function(_0x447117){try{utils['debug'](util['format'](_0x8864('0x13'),_0x447117[_0x8864('0x3')]),_0x447117);if(!_[_0x8864('0x14')](recordings[_0x447117['uniqueid']])&&_0x447117[_0x8864('0x15')]==0x6){utils[_0x8864('0xf')](util[_0x8864('0x10')](_0x8864('0x16'),_0x447117[_0x8864('0x3')],_0x447117[_0x8864('0x17')],_0x447117[_0x8864('0x18')]));}else if(!_['isNil'](recordings[_0x447117[_0x8864('0x19')]])&&_0x447117[_0x8864('0x15')]==0x6&&_0x447117[_0x8864('0x17')]!='transfer'){utils['info'](util[_0x8864('0x10')](_0x8864('0x1a'),_0x447117['uniqueid'],_0x447117['linkedid'],_0x447117[_0x8864('0x17')],_0x447117[_0x8864('0x18')]));recordings[_0x447117[_0x8864('0x19')]][_0x8864('0x6')]=_0x447117['accountcode'];}}catch(_0x37509f){utils[_0x8864('0x1b')](util[_0x8864('0x10')]('[%s][recordings][newstate]',_0x447117[_0x8864('0x3')]),_0x37509f);}};exports[_0x8864('0x1c')]=function(_0x436683){try{if(!_[_0x8864('0x14')](_0x436683['variable'])&&!_[_0x8864('0x14')](_0x436683['variable'][_0x8864('0x1d')])){utils[_0x8864('0xd')](util[_0x8864('0x10')](_0x8864('0x1e'),_0x436683[_0x8864('0x3')]),_0x436683);utils['info'](util[_0x8864('0x10')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x436683[_0x8864('0x3')],_0x436683[_0x8864('0x1f')],_0x436683[_0x8864('0x20')]));if(_['endsWith'](_0x436683[_0x8864('0x20')],_0x8864('0x21'))){_0x436683[_0x8864('0x20')]=_0x436683[_0x8864('0x20')]['replace'](_0x8864('0x21'),_0x8864('0x22'));}if(recordings[_0x436683[_0x8864('0x19')]]){var _0x636e10=_[_0x8864('0x23')](recordings[_0x436683[_0x8864('0x19')]][_0x8864('0x24')],{'value':_0x436683[_0x8864('0x20')]});if(_[_0x8864('0x14')](_0x636e10)){recordings[_0x436683[_0x8864('0x19')]][_0x8864('0x24')]['push']({'value':_0x436683['value']});}}}}catch(_0x5b41da){utils[_0x8864('0x1b')](util['format'](_0x8864('0x1e'),_0x436683[_0x8864('0x3')]),_0x5b41da);}};exports[_0x8864('0x25')]=function(_0x48b4fb){try{if(!_[_0x8864('0x14')](recordings[_0x48b4fb[_0x8864('0x3')]])){utils['debug'](util[_0x8864('0x10')](_0x8864('0x26'),_0x48b4fb[_0x8864('0x3')]),_0x48b4fb);utils[_0x8864('0xf')](util[_0x8864('0x10')](_0x8864('0x27'),_0x48b4fb['uniqueid'],_0x48b4fb['calleridnum'],_0x48b4fb[_0x8864('0x28')],_0x48b4fb[_0x8864('0x29')]));recordings[_0x48b4fb[_0x8864('0x3')]]['calleridnum']=_0x48b4fb['calleridnum'];recordings[_0x48b4fb['uniqueid']][_0x8864('0x28')]=_0x48b4fb['calleridname'];recordings[_0x48b4fb['uniqueid']][_0x8864('0x2a')]=_0x48b4fb['connectedlinenum'];recordings[_0x48b4fb[_0x8864('0x3')]][_0x8864('0x2b')]=_0x48b4fb[_0x8864('0x2b')];if(recordings[_0x48b4fb['uniqueid']]['type']==_0x8864('0x2c')&&recordings[_0x48b4fb['uniqueid']][_0x8864('0x6')]){recordings[_0x48b4fb['uniqueid']]['connectedlinenum']=recordings[_0x48b4fb[_0x8864('0x3')]][_0x8864('0x6')];recordings[_0x48b4fb['uniqueid']][_0x8864('0x2b')]='';}recordings[_0x48b4fb['uniqueid']][_0x8864('0x24')][_0x8864('0x2d')](function(_0x4b021a){var _0x253deb=_['clone'](recordings[_0x48b4fb[_0x8864('0x3')]]);_0x253deb['value']=_0x4b021a[_0x8864('0x20')];writeDB(_0x253deb);});delete recordings[_0x48b4fb[_0x8864('0x3')]];}}catch(_0x223cb4){utils[_0x8864('0x1b')](util[_0x8864('0x10')](_0x8864('0x26'),_0x48b4fb['uniqueid']),_0x223cb4);}};exports[_0x8864('0x2e')]=function(_0x19d3fb){try{if(!_[_0x8864('0x14')](recordings[_0x19d3fb[_0x8864('0x3')]])){utils['debug'](util['format'](_0x8864('0x2f'),_0x19d3fb[_0x8864('0x3')]),_0x19d3fb);utils['info'](util[_0x8864('0x10')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x19d3fb[_0x8864('0x3')],_0x19d3fb[_0x8864('0x30')],_0x19d3fb['appdata']));if(_0x19d3fb[_0x8864('0x30')][_0x8864('0x31')]()==_0x8864('0x32')&&_[_0x8864('0x33')](_0x19d3fb[_0x8864('0x34')][_0x8864('0x31')](),'cdr')){var _0x5ecaf5=_0x19d3fb['appdata'][_0x8864('0x35')]('=');var _0x3030c5=_0x5ecaf5[0x0][_0x8864('0x36')](_0x5ecaf5[0x0][_0x8864('0x37')]('(')+0x1,_0x5ecaf5[0x0]['lastIndexOf'](')'));var _0x515259=_0x5ecaf5[0x1];recordings[_0x19d3fb[_0x8864('0x3')]][_0x3030c5]=_0x515259;}}}catch(_0x573251){utils[_0x8864('0x1b')](util[_0x8864('0x10')](_0x8864('0x2f'),_0x19d3fb[_0x8864('0x3')]),_0x573251);}};exports['queuecallerjoin']=function(_0x2859a3){try{if(!_['isNil'](recordings[_0x2859a3['uniqueid']])){utils[_0x8864('0xd')](util[_0x8864('0x10')](_0x8864('0x38'),_0x2859a3['uniqueid']),_0x2859a3);utils['info'](util[_0x8864('0x10')](_0x8864('0x39'),_0x2859a3['uniqueid'],_0x2859a3['queue']));recordings[_0x2859a3['uniqueid']][_0x8864('0x3a')]=_0x2859a3['queue'];}}catch(_0x2a52cd){utils[_0x8864('0x1b')](util[_0x8864('0x10')]('[%s][recordings][queuecallerjoin]',_0x2859a3[_0x8864('0x3')]),_0x2a52cd);}};exports[_0x8864('0x3b')]=function(_0x55079c){try{utils[_0x8864('0xd')](util[_0x8864('0x10')](_0x8864('0x3c'),_0x55079c[_0x8864('0x3')]),_0x55079c);utils['info'](util[_0x8864('0x10')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x55079c[_0x8864('0x3')],_0x55079c['transferercalleridnum'],_0x55079c[_0x8864('0x3d')],_0x55079c[_0x8864('0x3e')],_0x55079c[_0x8864('0x3f')]));if(recordings[_0x55079c[_0x8864('0x40')]]&&transfers[_0x8864('0x4')][_0x55079c[_0x8864('0x40')]]){transfers[_0x8864('0x4')][_0x55079c[_0x8864('0x40')]][_0x8864('0x41')]=!![];}}catch(_0x1090c4){utils['error'](util[_0x8864('0x10')](_0x8864('0x3c'),_0x55079c[_0x8864('0x3')]),_0x1090c4);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a0e40ce..66c8d9d 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 _0x4161=['blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x4161,0x13d));var _0x1416=function(_0x4556df,_0x20d6b3){_0x4556df=_0x4556df-0x0;var _0x351e0c=_0x4161[_0x4556df];return _0x351e0c;};'use strict';var _=require(_0x1416('0x0'));var util=require(_0x1416('0x1'));var utils=require(_0x1416('0x2'));function writeDB(_0x314fbc){utils[_0x1416('0x3')](util[_0x1416('0x4')](_0x1416('0x5'),_0x314fbc[_0x1416('0x6')]===_0x1416('0x7')?_0x314fbc[_0x1416('0x8')]:_0x314fbc['uniqueid'],_0x314fbc[_0x1416('0x6')]));utils[_0x1416('0x9')](_0x1416('0xa'),_0x314fbc);}exports[_0x1416('0xb')]={};exports[_0x1416('0xc')]=function(_0x468173){try{utils[_0x1416('0xd')](util[_0x1416('0x4')]('[%s][transfers][blindtransfer]',_0x468173[_0x1416('0xe')]),_0x468173);utils['info'](util[_0x1416('0x4')](_0x1416('0xf'),_0x468173[_0x1416('0xe')],_0x468173['transferercalleridnum'],_0x468173[_0x1416('0x10')],_0x468173[_0x1416('0x11')],_0x468173[_0x1416('0x12')]));_0x468173[_0x1416('0x6')]=_0x1416('0x13');exports['blinds'][_0x468173[_0x1416('0x14')]]=_0x468173;writeDB(_0x468173);}catch(_0x32a3a9){utils[_0x1416('0x15')](util[_0x1416('0x4')](_0x1416('0x16'),_0x468173[_0x1416('0xe')]),_0x32a3a9);}};exports['attendedtransfer']=function(_0x5368e1){try{utils[_0x1416('0xd')](util[_0x1416('0x4')]('[%s][transfers][attendedtransfer]',_0x5368e1[_0x1416('0x8')]),_0x5368e1);utils[_0x1416('0x3')](util[_0x1416('0x4')](_0x1416('0x17'),_0x5368e1['origtransfereruniqueid'],_0x5368e1[_0x1416('0x18')],_0x5368e1[_0x1416('0x19')],_0x5368e1['transfertargetcalleridnum'],_0x5368e1[_0x1416('0x1a')]));_0x5368e1=_[_0x1416('0x1b')](_0x5368e1,{'transfererchannel':_0x5368e1[_0x1416('0x1c')],'transferercalleridnum':_0x5368e1[_0x1416('0x18')],'transferercalleridname':_0x5368e1[_0x1416('0x19')],'transfererconnectedlinenum':_0x5368e1[_0x1416('0x1d')],'transfererconnectedlinename':_0x5368e1[_0x1416('0x1e')],'transfereraccountcode':_0x5368e1[_0x1416('0x1f')],'transferercontext':_0x5368e1['secondtransferercontext'],'transfererexten':_0x5368e1['secondtransfererexten'],'transfererlinkedid':_0x5368e1['origtransfererlinkedid'],'context':_0x5368e1['origtransferercontext'],'extension':_0x5368e1[_0x1416('0x20')],'type':'attended'});if(_[_0x1416('0x21')](_0x5368e1[_0x1416('0x22')])){_0x5368e1=_['assign'](_0x5368e1,{'transfereechannel':_0x5368e1[_0x1416('0x23')],'transfereecalleridnum':_0x5368e1[_0x1416('0x24')],'transfereecalleridname':_0x5368e1[_0x1416('0x1a')],'transfereeconnectedlinenum':_0x5368e1['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5368e1[_0x1416('0x25')],'transfereeaccountcode':_0x5368e1[_0x1416('0x26')],'transfereecontext':_0x5368e1['transfertargetcontext'],'transfereeexten':_0x5368e1[_0x1416('0x27')],'transfereelinkedid':_0x5368e1[_0x1416('0x28')]});}writeDB(_0x5368e1);}catch(_0x4e07d7){utils['error'](util[_0x1416('0x4')](_0x1416('0x29'),_0x5368e1[_0x1416('0x8')]),_0x4e07d7);}}; \ No newline at end of file +var _0x45a3=['attended','origtransfereruniqueid','uniqueid','request','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','type'];(function(_0x867141,_0x3c2c){var _0x3a77f6=function(_0x211583){while(--_0x211583){_0x867141['push'](_0x867141['shift']());}};_0x3a77f6(++_0x3c2c);}(_0x45a3,0xd5));var _0x345a=function(_0x4bb30b,_0x59a253){_0x4bb30b=_0x4bb30b-0x0;var _0x376108=_0x45a3[_0x4bb30b];return _0x376108;};'use strict';var _=require(_0x345a('0x0'));var util=require(_0x345a('0x1'));var utils=require('./utils');function writeDB(_0x149c03){utils['info'](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x149c03[_0x345a('0x2')]===_0x345a('0x3')?_0x149c03[_0x345a('0x4')]:_0x149c03[_0x345a('0x5')],_0x149c03[_0x345a('0x2')]));utils[_0x345a('0x6')]('CreateVoiceTransferReport',_0x149c03);}exports['blinds']={};exports['blindtransfer']=function(_0x96995d){try{utils[_0x345a('0x7')](util[_0x345a('0x8')](_0x345a('0x9'),_0x96995d[_0x345a('0x5')]),_0x96995d);utils['info'](util[_0x345a('0x8')](_0x345a('0xa'),_0x96995d[_0x345a('0x5')],_0x96995d[_0x345a('0xb')],_0x96995d[_0x345a('0xc')],_0x96995d[_0x345a('0xd')],_0x96995d[_0x345a('0xe')]));_0x96995d[_0x345a('0x2')]=_0x345a('0xf');exports[_0x345a('0x10')][_0x96995d[_0x345a('0x11')]]=_0x96995d;writeDB(_0x96995d);}catch(_0x33a149){utils[_0x345a('0x12')](util[_0x345a('0x8')]('[%s][transfers][blindtransfer]',_0x96995d[_0x345a('0x5')]),_0x33a149);}};exports[_0x345a('0x13')]=function(_0x2687d5){try{utils[_0x345a('0x7')](util[_0x345a('0x8')](_0x345a('0x14'),_0x2687d5[_0x345a('0x4')]),_0x2687d5);utils['info'](util[_0x345a('0x8')](_0x345a('0x15'),_0x2687d5[_0x345a('0x4')],_0x2687d5['origtransferercalleridnum'],_0x2687d5['origtransferercalleridname'],_0x2687d5[_0x345a('0x16')],_0x2687d5['transfertargetcalleridname']));_0x2687d5=_[_0x345a('0x17')](_0x2687d5,{'transfererchannel':_0x2687d5['origtransfererchannel'],'transferercalleridnum':_0x2687d5['origtransferercalleridnum'],'transferercalleridname':_0x2687d5['origtransferercalleridname'],'transfererconnectedlinenum':_0x2687d5[_0x345a('0x18')],'transfererconnectedlinename':_0x2687d5[_0x345a('0x19')],'transfereraccountcode':_0x2687d5[_0x345a('0x1a')],'transferercontext':_0x2687d5[_0x345a('0x1b')],'transfererexten':_0x2687d5['secondtransfererexten'],'transfererlinkedid':_0x2687d5['origtransfererlinkedid'],'context':_0x2687d5['origtransferercontext'],'extension':_0x2687d5['origtransfererexten'],'type':_0x345a('0x3')});if(_[_0x345a('0x1c')](_0x2687d5[_0x345a('0x1d')])){_0x2687d5=_['assign'](_0x2687d5,{'transfereechannel':_0x2687d5[_0x345a('0x1e')],'transfereecalleridnum':_0x2687d5[_0x345a('0x16')],'transfereecalleridname':_0x2687d5[_0x345a('0x1f')],'transfereeconnectedlinenum':_0x2687d5[_0x345a('0x20')],'transfereeconnectedlinename':_0x2687d5['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2687d5['transfertargetaccountcode'],'transfereecontext':_0x2687d5[_0x345a('0x21')],'transfereeexten':_0x2687d5[_0x345a('0x22')],'transfereelinkedid':_0x2687d5[_0x345a('0x23')]});}writeDB(_0x2687d5);}catch(_0x1ac6f0){utils[_0x345a('0x12')](util[_0x345a('0x8')](_0x345a('0x14'),_0x2687d5['origtransfereruniqueid']),_0x1ac6f0);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 42feaba..bf40e8f 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 _0x45ba=['debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect'];(function(_0x3049a1,_0x350afc){var _0x291ef7=function(_0x2cc7d0){while(--_0x2cc7d0){_0x3049a1['push'](_0x3049a1['shift']());}};_0x291ef7(++_0x350afc);}(_0x45ba,0x1d7));var _0xa45b=function(_0x133520,_0x3a3b98){_0x133520=_0x133520-0x0;var _0x2fdd99=_0x45ba[_0x133520];return _0x2fdd99;};'use strict';var BPromise=require(_0xa45b('0x0'));var jayson=require(_0xa45b('0x1'));var moment=require(_0xa45b('0x2'));var util=require(_0xa45b('0x3'));var client=jayson[_0xa45b('0x4')][_0xa45b('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xa45b('0x6'));exports[_0xa45b('0x7')]=function(_0x397eaa,_0x35b065){logger[_0xa45b('0x7')](_0x397eaa,_0x35b065?util[_0xa45b('0x8')](_0x35b065,{'showHidden':![],'depth':null}):'');};exports[_0xa45b('0x9')]=function(_0x5b60f9,_0x3d26c3){logger[_0xa45b('0x9')](_0x5b60f9,_0x3d26c3?util[_0xa45b('0x8')](_0x3d26c3,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4a5820,_0x20b318){logger[_0xa45b('0xa')](_0x4a5820,_0x20b318?util['inspect'](_0x20b318,{'showHidden':![],'depth':null}):'');};exports[_0xa45b('0xb')]=function(_0x34fb0a,_0x566a5a){return client[_0xa45b('0xb')](_0x34fb0a,{'body':_0x566a5a})[_0xa45b('0xc')](function(_0x9b0271){logger[_0xa45b('0x9')](_0xa45b('0xd'),_0x34fb0a,_0x9b0271?util[_0xa45b('0x8')](_0x9b0271,{'showHidden':![],'depth':null}):'');})[_0xa45b('0xe')](function(_0x13c1d6){logger['error'](_0xa45b('0xd'),_0x34fb0a,_0x13c1d6?util[_0xa45b('0x8')](_0x13c1d6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1019b8){return client[_0xa45b('0xb')](_0xa45b('0xf'),{'options':{'raw':!![],'attributes':['id','internal',_0xa45b('0x10'),_0xa45b('0x11')],'where':_0x1019b8,'limit':0x1}})[_0xa45b('0xc')](function(_0x22b19d){logger[_0xa45b('0x9')](_0xa45b('0x12'),JSON[_0xa45b('0x13')](_0x1019b8),_0x22b19d?util[_0xa45b('0x8')](_0x22b19d,{'showHidden':![],'depth':null}):'');return _0x22b19d[_0xa45b('0x14')][_0xa45b('0x15')]?_0x22b19d[_0xa45b('0x14')][0x0]:null;});}exports[_0xa45b('0x16')]=function(_0x595e04){return new BPromise(function(_0x7f2667,_0x14b91f){if(_0x595e04){return getUser({'internal':_0x595e04})[_0xa45b('0xc')](function(_0x40b9b8){logger['info'](_0xa45b('0x17'),_0x595e04,_0x40b9b8?_0xa45b('0x18'):'notfound');return _0x7f2667(_0x40b9b8);})[_0xa45b('0xe')](function(_0x4107c9){logger[_0xa45b('0xa')]('[utils][getUserByInternal]',_0x4107c9?util[_0xa45b('0x8')](_0x4107c9,{'showHidden':![],'depth':null}):'');return _0x7f2667(null);});}return _0x7f2667(null);});};exports[_0xa45b('0x19')]=function(_0x401a66){return new BPromise(function(_0x2b8a07,_0x3169b1){if(_0x401a66){return getUser({'interface':_0x401a66})['then'](function(_0x60c6e2){logger[_0xa45b('0x7')](_0xa45b('0x1a'),_0x401a66,_0x60c6e2?_0xa45b('0x18'):_0xa45b('0x1b'));return _0x2b8a07(_0x60c6e2);})[_0xa45b('0xe')](function(_0x3025fb){logger['error'](_0xa45b('0x1c'),_0x3025fb?util[_0xa45b('0x8')](_0x3025fb,{'showHidden':![],'depth':null}):'');return _0x2b8a07(null);});}return _0x2b8a07(null);});};exports[_0xa45b('0x1d')]=function(_0x2b98ff){return new BPromise(function(_0x4603d6,_0x584325){if(_0x2b98ff){return getUser({'name':_0x2b98ff})[_0xa45b('0xc')](function(_0xe8c4a4){logger[_0xa45b('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2b98ff,_0xe8c4a4?_0xa45b('0x18'):_0xa45b('0x1b'));return _0x4603d6(_0xe8c4a4);})[_0xa45b('0xe')](function(_0xc6656){logger[_0xa45b('0xa')](_0xa45b('0x1e'),_0xc6656?util[_0xa45b('0x8')](_0xc6656,{'showHidden':![],'depth':null}):'');return _0x4603d6(null);});}return _0x4603d6(null);});};exports['getVoiceQueueByName']=function(_0x222845){return new BPromise(function(_0x52ef3e,_0x552e13){if(_0x222845){return client[_0xa45b('0xb')](_0xa45b('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xa45b('0x10'),'type',_0xa45b('0x20'),'acwTimeout'],'where':{'name':_0x222845},'limit':0x1}})[_0xa45b('0xc')](function(_0x5da037){logger[_0xa45b('0x9')](_0xa45b('0x21'),_0x222845,_0x5da037?util[_0xa45b('0x8')](_0x5da037,{'showHidden':![],'depth':null}):'');logger[_0xa45b('0x7')](_0xa45b('0x22'),_0x222845,_0x5da037?_0xa45b('0x18'):'notfound');return _0x52ef3e(_0x5da037[_0xa45b('0x14')][_0xa45b('0x15')]?_0x5da037[_0xa45b('0x14')][0x0]:null);})[_0xa45b('0xe')](function(_0x2688e2){logger['error'](_0xa45b('0x23'),_0x2688e2?util['inspect'](_0x2688e2,{'showHidden':![],'depth':null}):'');return _0x52ef3e(null);});}return _0x52ef3e(null);});};exports[_0xa45b('0x24')]=function(_0x503f1f,_0x11e73f){return moment(_0x503f1f)['add'](_0x11e73f,'seconds')['format'](_0xa45b('0x25'));};exports[_0xa45b('0x26')]=function(_0x48b8f2,_0x15f790){return moment(_0x48b8f2)[_0xa45b('0x27')](_0x15f790,_0xa45b('0x28'))[_0xa45b('0x29')](_0xa45b('0x25'));};exports[_0xa45b('0x2a')]=function(_0x47ca24,_0x19a71c){return moment(_0x47ca24)[_0xa45b('0x2b')](moment(_0x19a71c),_0xa45b('0x28'));};exports[_0xa45b('0x2c')]=function(_0x3936ce,_0x501df4){return parseInt(_0x3936ce,0xa)+parseInt(_0x501df4,0xa);};exports[_0xa45b('0x2d')]=function(){return moment()[_0xa45b('0x29')](_0xa45b('0x25'));};exports[_0xa45b('0x2e')]=function(_0x2ae37e,_0x3bf3f7){if(_0x3bf3f7){return moment(_0x2ae37e)[_0xa45b('0x2e')](_0x3bf3f7);}return!![];};exports[_0xa45b('0x2f')]=function(_0x2e4112,_0xa256a6){if(_0xa256a6){return moment(_0x2e4112)[_0xa45b('0x2f')](_0xa256a6);}else if(_0x2e4112){return!![];}return![];}; \ No newline at end of file +var _0xbc22=['name','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','internal'];(function(_0x5691d3,_0x2f9741){var _0x49d901=function(_0x325120){while(--_0x325120){_0x5691d3['push'](_0x5691d3['shift']());}};_0x49d901(++_0x2f9741);}(_0xbc22,0x79));var _0x2bc2=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0xbc22[_0x3124f8];return _0x5bab5f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x2bc2('0x0'));var moment=require('moment');var util=require(_0x2bc2('0x1'));var client=jayson['client'][_0x2bc2('0x2')]({'port':0x2329});var logger=require(_0x2bc2('0x3'))(_0x2bc2('0x4'));exports[_0x2bc2('0x5')]=function(_0xfb9e77,_0x230c2d){logger[_0x2bc2('0x5')](_0xfb9e77,_0x230c2d?util[_0x2bc2('0x6')](_0x230c2d,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x44710c,_0x153ebd){logger[_0x2bc2('0x7')](_0x44710c,_0x153ebd?util['inspect'](_0x153ebd,{'showHidden':![],'depth':null}):'');};exports[_0x2bc2('0x8')]=function(_0x24dfed,_0x3aaace){logger[_0x2bc2('0x8')](_0x24dfed,_0x3aaace?util[_0x2bc2('0x6')](_0x3aaace,{'showHidden':![],'depth':null}):'');};exports[_0x2bc2('0x9')]=function(_0x3af1cf,_0x540a15){return client[_0x2bc2('0x9')](_0x3af1cf,{'body':_0x540a15})[_0x2bc2('0xa')](function(_0x36a670){logger[_0x2bc2('0x7')]('[utils][request]\x20name:%s',_0x3af1cf,_0x36a670?util['inspect'](_0x36a670,{'showHidden':![],'depth':null}):'');})[_0x2bc2('0xb')](function(_0x3723b0){logger['error'](_0x2bc2('0xc'),_0x3af1cf,_0x3723b0?util[_0x2bc2('0x6')](_0x3723b0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x18e995){return client[_0x2bc2('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x2bc2('0xd'),_0x2bc2('0xe'),'interface'],'where':_0x18e995,'limit':0x1}})[_0x2bc2('0xa')](function(_0x14cb59){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0x18e995),_0x14cb59?util['inspect'](_0x14cb59,{'showHidden':![],'depth':null}):'');return _0x14cb59[_0x2bc2('0xf')]['length']?_0x14cb59[_0x2bc2('0xf')][0x0]:null;});}exports[_0x2bc2('0x10')]=function(_0x4ece40){return new BPromise(function(_0x5ed2c4,_0x386e01){if(_0x4ece40){return getUser({'internal':_0x4ece40})['then'](function(_0x16b782){logger[_0x2bc2('0x5')](_0x2bc2('0x11'),_0x4ece40,_0x16b782?_0x2bc2('0x12'):_0x2bc2('0x13'));return _0x5ed2c4(_0x16b782);})[_0x2bc2('0xb')](function(_0x54bb55){logger[_0x2bc2('0x8')](_0x2bc2('0x14'),_0x54bb55?util[_0x2bc2('0x6')](_0x54bb55,{'showHidden':![],'depth':null}):'');return _0x5ed2c4(null);});}return _0x5ed2c4(null);});};exports['getUserByInterface']=function(_0x1af622){return new BPromise(function(_0x2547d3,_0x3b7f1b){if(_0x1af622){return getUser({'interface':_0x1af622})['then'](function(_0x43c46e){logger['info'](_0x2bc2('0x15'),_0x1af622,_0x43c46e?_0x2bc2('0x12'):'notfound');return _0x2547d3(_0x43c46e);})[_0x2bc2('0xb')](function(_0x5d0aef){logger['error'](_0x2bc2('0x16'),_0x5d0aef?util['inspect'](_0x5d0aef,{'showHidden':![],'depth':null}):'');return _0x2547d3(null);});}return _0x2547d3(null);});};exports[_0x2bc2('0x17')]=function(_0x28565a){return new BPromise(function(_0x53ac89,_0xf37e5){if(_0x28565a){return getUser({'name':_0x28565a})[_0x2bc2('0xa')](function(_0x28a3ca){logger[_0x2bc2('0x5')](_0x2bc2('0x18'),_0x28565a,_0x28a3ca?_0x2bc2('0x12'):_0x2bc2('0x13'));return _0x53ac89(_0x28a3ca);})[_0x2bc2('0xb')](function(_0x24bddd){logger[_0x2bc2('0x8')](_0x2bc2('0x19'),_0x24bddd?util[_0x2bc2('0x6')](_0x24bddd,{'showHidden':![],'depth':null}):'');return _0x53ac89(null);});}return _0x53ac89(null);});};exports[_0x2bc2('0x1a')]=function(_0xb86ffe){return new BPromise(function(_0x367ddc,_0x5b7a4a){if(_0xb86ffe){return client[_0x2bc2('0x9')](_0x2bc2('0x1b'),{'options':{'raw':!![],'attributes':['id','name',_0x2bc2('0x1c'),'acw',_0x2bc2('0x1d')],'where':{'name':_0xb86ffe},'limit':0x1}})[_0x2bc2('0xa')](function(_0x970a5c){logger[_0x2bc2('0x7')](_0x2bc2('0x1e'),_0xb86ffe,_0x970a5c?util[_0x2bc2('0x6')](_0x970a5c,{'showHidden':![],'depth':null}):'');logger['info'](_0x2bc2('0x1f'),_0xb86ffe,_0x970a5c?'found':'notfound');return _0x367ddc(_0x970a5c['result'][_0x2bc2('0x20')]?_0x970a5c[_0x2bc2('0xf')][0x0]:null);})[_0x2bc2('0xb')](function(_0x2f2c98){logger[_0x2bc2('0x8')]('[utils][getVoiceQueueByName]',_0x2f2c98?util[_0x2bc2('0x6')](_0x2f2c98,{'showHidden':![],'depth':null}):'');return _0x367ddc(null);});}return _0x367ddc(null);});};exports[_0x2bc2('0x21')]=function(_0x31ff32,_0x42e32a){return moment(_0x31ff32)[_0x2bc2('0x22')](_0x42e32a,_0x2bc2('0x23'))[_0x2bc2('0x24')](_0x2bc2('0x25'));};exports[_0x2bc2('0x26')]=function(_0x244663,_0x155e12){return moment(_0x244663)['subtract'](_0x155e12,_0x2bc2('0x23'))[_0x2bc2('0x24')](_0x2bc2('0x25'));};exports[_0x2bc2('0x27')]=function(_0x6d921a,_0x389fb7){return moment(_0x6d921a)[_0x2bc2('0x28')](moment(_0x389fb7),_0x2bc2('0x23'));};exports[_0x2bc2('0x29')]=function(_0x4d8c30,_0x1b4f36){return parseInt(_0x4d8c30,0xa)+parseInt(_0x1b4f36,0xa);};exports[_0x2bc2('0x2a')]=function(){return moment()[_0x2bc2('0x24')](_0x2bc2('0x25'));};exports[_0x2bc2('0x2b')]=function(_0x4e86e3,_0x594bb8){if(_0x594bb8){return moment(_0x4e86e3)['isAfter'](_0x594bb8);}return!![];};exports[_0x2bc2('0x2c')]=function(_0x2c1ebb,_0x5224cc){if(_0x5224cc){return moment(_0x2c1ebb)[_0x2bc2('0x2c')](_0x5224cc);}else if(_0x2c1ebb){return!![];}return![];}; \ No newline at end of file